From bd44ed59ec5104573cdd5d7b141a9ea7055763b6 Mon Sep 17 00:00:00 2001 From: Andrea Bianco Date: Sat, 28 Aug 2021 23:46:48 +0200 Subject: [PATCH] Built motion from commit 2efa48e9.|2.5.34 --- 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 +- .../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 +- .../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 +- 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/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/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/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/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 +- 1147 files changed, 1147 insertions(+), 1147 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 2c393d9..37a0668 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-28T21:29:44.669Z", + "time": "2021-08-28T21:39:47.131Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index a987636..344eafb 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-28T21:29:44.669Z", + "time": "2021-08-28T21:39:47.131Z", "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 ef7a144..2347682 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 _0x7f24=['sequelize','exports','VIRTUAL','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','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]','TEXT'];(function(_0x2cc8e2,_0x28db24){var _0x4c6a94=function(_0x4a1f3a){while(--_0x4a1f3a){_0x2cc8e2['push'](_0x2cc8e2['shift']());}};_0x4c6a94(++_0x28db24);}(_0x7f24,0xf0));var _0x47f2=function(_0x324661,_0x3fb798){_0x324661=_0x324661-0x0;var _0x135bed=_0x7f24[_0x324661];return _0x135bed;};'use strict';var Sequelize=require(_0x47f2('0x0'));module[_0x47f2('0x1')]={'name':{'type':Sequelize[_0x47f2('0x2')],'get':function(_0x5e6f68){return this['getDataValue'](_0x47f2('0x3'));}},'action':{'type':Sequelize[_0x47f2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x47f2('0x5'),'integration',_0x47f2('0x6'),_0x47f2('0x7'),_0x47f2('0x8'),_0x47f2('0x9'),_0x47f2('0xa'),_0x47f2('0xb')]],'msg':_0x47f2('0xc')}},'comment':_0x47f2('0xc')},'data1':{'type':Sequelize[_0x47f2('0x4')](0x1000),'comment':_0x47f2('0xd')},'data2':{'type':Sequelize[_0x47f2('0x4')](0x1000),'comment':_0x47f2('0xe')},'data3':{'type':Sequelize[_0x47f2('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x47f2('0x4')](0x1000)},'data6':{'type':Sequelize[_0x47f2('0x4')]},'data7':{'type':Sequelize[_0x47f2('0xf')]}}; \ No newline at end of file +var _0x8f7f=['contactManager','integration','motionbar','jscripty','urlForward','bot','script','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]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8f7f,0x82));var _0xf8f7=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x8f7f[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xf8f7('0x0'));module[_0xf8f7('0x1')]={'name':{'type':Sequelize[_0xf8f7('0x2')],'get':function(_0x7bc4ad){return this[_0xf8f7('0x3')](_0xf8f7('0x4'));}},'action':{'type':Sequelize[_0xf8f7('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xf8f7('0x6'),_0xf8f7('0x7'),_0xf8f7('0x8'),_0xf8f7('0x9'),_0xf8f7('0xa'),'browser',_0xf8f7('0xb'),_0xf8f7('0xc')]],'msg':_0xf8f7('0xd')}},'comment':_0xf8f7('0xd')},'data1':{'type':Sequelize[_0xf8f7('0x5')](0x1000),'comment':_0xf8f7('0xe')},'data2':{'type':Sequelize[_0xf8f7('0x5')](0x1000),'comment':_0xf8f7('0xf')},'data3':{'type':Sequelize[_0xf8f7('0x5')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0xf8f7('0x5')](0x1000)},'data6':{'type':Sequelize[_0xf8f7('0x5')]},'data7':{'type':Sequelize[_0xf8f7('0x10')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 95bdbd8..7c6018c 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 _0x46a0=['fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','name','body','Action','catch','find','params','eml-format','rimraf'];(function(_0xa5fbfa,_0x4009b6){var _0x1318f3=function(_0x4c2964){while(--_0x4c2964){_0xa5fbfa['push'](_0xa5fbfa['shift']());}};_0x1318f3(++_0x4009b6);}(_0x46a0,0xe9));var _0x046a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x46a0[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x046a('0x0'));var rimraf=require(_0x046a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x046a('0x2'));var rp=require(_0x046a('0x3'));var moment=require(_0x046a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x046a('0x5'));var util=require(_0x046a('0x6'));var path=require('path');var sox=require(_0x046a('0x7'));var csv=require('to-csv');var ejs=require(_0x046a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x046a('0x9'));var squel=require('squel');var crypto=require(_0x046a('0xa'));var jsforce=require(_0x046a('0xb'));var deskjs=require(_0x046a('0xc'));var toCsv=require(_0x046a('0xd'));var querystring=require(_0x046a('0xe'));var Papa=require(_0x046a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x046a('0x10'));var as=require(_0x046a('0x11'));var hardwareService=require(_0x046a('0x12'));var logger=require(_0x046a('0x13'))(_0x046a('0x14'));var utils=require(_0x046a('0x15'));var config=require(_0x046a('0x16'));var licenseUtil=require(_0x046a('0x17'));var db=require(_0x046a('0x18'))['db'];function respondWithStatusCode(_0xf22835,_0x5c098c){_0x5c098c=_0x5c098c||0xcc;return function(_0x48b2a0){if(_0x48b2a0){return _0xf22835[_0x046a('0x19')](_0x5c098c);}return _0xf22835[_0x046a('0x1a')](_0x5c098c)[_0x046a('0x1b')]();};}function respondWithResult(_0x1c3af4,_0x1123b8){_0x1123b8=_0x1123b8||0xc8;return function(_0x140195){if(_0x140195){return _0x1c3af4[_0x046a('0x1a')](_0x1123b8)[_0x046a('0x1c')](_0x140195);}};}function respondWithFilteredResult(_0x1a8398,_0x181317){return function(_0x461628){if(_0x461628){var _0x59faee=typeof _0x181317[_0x046a('0x1d')]===_0x046a('0x1e')&&typeof _0x181317['limit']===_0x046a('0x1e');var _0x4db743=_0x461628[_0x046a('0x1f')];var _0x3664d8=_0x59faee?0x0:_0x181317['offset'];var _0x175fb7=_0x59faee?_0x461628['count']:_0x181317[_0x046a('0x1d')]+_0x181317[_0x046a('0x20')];var _0x32a889;if(_0x175fb7>=_0x4db743){_0x175fb7=_0x4db743;_0x32a889=0xc8;}else{_0x32a889=0xce;}_0x1a8398['status'](_0x32a889);return _0x1a8398[_0x046a('0x21')](_0x046a('0x22'),_0x3664d8+'-'+_0x175fb7+'/'+_0x4db743)[_0x046a('0x1c')](_0x461628);}return null;};}function patchUpdates(_0x4905d5){return function(_0x3bc372){try{jsonpatch['apply'](_0x3bc372,_0x4905d5,!![]);}catch(_0x3de05d){return BPromise[_0x046a('0x23')](_0x3de05d);}return _0x3bc372[_0x046a('0x24')]();};}function saveUpdates(_0x1e734c,_0x5a8ac2){return function(_0xd3ffa3){if(_0xd3ffa3){return _0xd3ffa3[_0x046a('0x25')](_0x1e734c)['then'](function(_0x4b9910){return _0x4b9910;});}return null;};}function removeEntity(_0x49ad05,_0x5d30da){return function(_0x168fe6){if(_0x168fe6){return _0x168fe6[_0x046a('0x26')]()[_0x046a('0x27')](function(){_0x49ad05[_0x046a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2432d2,_0x20486c){return function(_0x5b4e92){if(!_0x5b4e92){_0x2432d2[_0x046a('0x19')](0x194);}return _0x5b4e92;};}function handleError(_0x4e58e9,_0x8e2574){_0x8e2574=_0x8e2574||0x1f4;return function(_0x85e694){logger[_0x046a('0x28')](_0x85e694['stack']);if(_0x85e694[_0x046a('0x29')]){delete _0x85e694[_0x046a('0x29')];}_0x4e58e9['status'](_0x8e2574)['send'](_0x85e694);};}exports[_0x046a('0x25')]=function(_0x18ecde,_0x88430e){if(_0x18ecde[_0x046a('0x2a')]['id']){delete _0x18ecde[_0x046a('0x2a')]['id'];}return db[_0x046a('0x2b')]['find']({'where':{'id':_0x18ecde['params']['id']}})[_0x046a('0x27')](handleEntityNotFound(_0x88430e,null))['then'](saveUpdates(_0x18ecde[_0x046a('0x2a')],null))[_0x046a('0x27')](respondWithResult(_0x88430e,null))[_0x046a('0x2c')](handleError(_0x88430e,null));};exports['destroy']=function(_0x4370c0,_0x2145e7){return db[_0x046a('0x2b')][_0x046a('0x2d')]({'where':{'id':_0x4370c0[_0x046a('0x2e')]['id']}})[_0x046a('0x27')](handleEntityNotFound(_0x2145e7,null))[_0x046a('0x27')](removeEntity(_0x2145e7,null))[_0x046a('0x2c')](handleError(_0x2145e7,null));}; \ No newline at end of file +var _0xfd5b=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','offset','set','reject','then','destroy','error','stack','name','update','body','Action','params','catch','rimraf'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfd5b,0xdb));var _0xbfd5=function(_0x15e534,_0x5f3a71){_0x15e534=_0x15e534-0x0;var _0x94b62=_0xfd5b[_0x15e534];return _0x94b62;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfd5('0x0'));var zipdir=require(_0xbfd5('0x1'));var jsonpatch=require(_0xbfd5('0x2'));var rp=require('request-promise');var moment=require(_0xbfd5('0x3'));var BPromise=require(_0xbfd5('0x4'));var Mustache=require(_0xbfd5('0x5'));var util=require(_0xbfd5('0x6'));var path=require(_0xbfd5('0x7'));var sox=require(_0xbfd5('0x8'));var csv=require('to-csv');var ejs=require(_0xbfd5('0x9'));var fs=require('fs');var fs_extra=require(_0xbfd5('0xa'));var _=require(_0xbfd5('0xb'));var squel=require(_0xbfd5('0xc'));var crypto=require(_0xbfd5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbfd5('0xe'));var toCsv=require(_0xbfd5('0xf'));var querystring=require(_0xbfd5('0x10'));var Papa=require(_0xbfd5('0x11'));var Redis=require(_0xbfd5('0x12'));var authService=require(_0xbfd5('0x13'));var qs=require(_0xbfd5('0x14'));var as=require(_0xbfd5('0x15'));var hardwareService=require(_0xbfd5('0x16'));var logger=require(_0xbfd5('0x17'))('api');var utils=require(_0xbfd5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbfd5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x253842,_0x475a40){_0x475a40=_0x475a40||0xcc;return function(_0x56636d){if(_0x56636d){return _0x253842[_0xbfd5('0x1a')](_0x475a40);}return _0x253842[_0xbfd5('0x1b')](_0x475a40)[_0xbfd5('0x1c')]();};}function respondWithResult(_0x3fe6ea,_0x38a706){_0x38a706=_0x38a706||0xc8;return function(_0x6d30f9){if(_0x6d30f9){return _0x3fe6ea['status'](_0x38a706)[_0xbfd5('0x1d')](_0x6d30f9);}};}function respondWithFilteredResult(_0x5938b2,_0x597fd0){return function(_0xa494df){if(_0xa494df){var _0x474dc3=typeof _0x597fd0['offset']==='undefined'&&typeof _0x597fd0[_0xbfd5('0x1e')]==='undefined';var _0x8c1f3f=_0xa494df['count'];var _0x523098=_0x474dc3?0x0:_0x597fd0[_0xbfd5('0x1f')];var _0x2a5cfd=_0x474dc3?_0xa494df['count']:_0x597fd0[_0xbfd5('0x1f')]+_0x597fd0['limit'];var _0xad3c40;if(_0x2a5cfd>=_0x8c1f3f){_0x2a5cfd=_0x8c1f3f;_0xad3c40=0xc8;}else{_0xad3c40=0xce;}_0x5938b2[_0xbfd5('0x1b')](_0xad3c40);return _0x5938b2[_0xbfd5('0x20')]('Content-Range',_0x523098+'-'+_0x2a5cfd+'/'+_0x8c1f3f)[_0xbfd5('0x1d')](_0xa494df);}return null;};}function patchUpdates(_0x13907d){return function(_0x5d8381){try{jsonpatch['apply'](_0x5d8381,_0x13907d,!![]);}catch(_0x3f0059){return BPromise[_0xbfd5('0x21')](_0x3f0059);}return _0x5d8381['save']();};}function saveUpdates(_0x51bb46,_0xa3b66d){return function(_0x2b59bb){if(_0x2b59bb){return _0x2b59bb['update'](_0x51bb46)[_0xbfd5('0x22')](function(_0xee2601){return _0xee2601;});}return null;};}function removeEntity(_0x42ff1a,_0x27ad7e){return function(_0x527f20){if(_0x527f20){return _0x527f20[_0xbfd5('0x23')]()[_0xbfd5('0x22')](function(){_0x42ff1a[_0xbfd5('0x1b')](0xcc)[_0xbfd5('0x1c')]();});}};}function handleEntityNotFound(_0x3b37e2,_0x36a85a){return function(_0x3d0e15){if(!_0x3d0e15){_0x3b37e2[_0xbfd5('0x1a')](0x194);}return _0x3d0e15;};}function handleError(_0x5164ed,_0xab791c){_0xab791c=_0xab791c||0x1f4;return function(_0x3f0534){logger[_0xbfd5('0x24')](_0x3f0534[_0xbfd5('0x25')]);if(_0x3f0534[_0xbfd5('0x26')]){delete _0x3f0534[_0xbfd5('0x26')];}_0x5164ed[_0xbfd5('0x1b')](_0xab791c)['send'](_0x3f0534);};}exports[_0xbfd5('0x27')]=function(_0x3a7488,_0x185592){if(_0x3a7488[_0xbfd5('0x28')]['id']){delete _0x3a7488[_0xbfd5('0x28')]['id'];}return db[_0xbfd5('0x29')]['find']({'where':{'id':_0x3a7488[_0xbfd5('0x2a')]['id']}})[_0xbfd5('0x22')](handleEntityNotFound(_0x185592,null))[_0xbfd5('0x22')](saveUpdates(_0x3a7488[_0xbfd5('0x28')],null))['then'](respondWithResult(_0x185592,null))['catch'](handleError(_0x185592,null));};exports['destroy']=function(_0x37a01d,_0x87d57a){return db[_0xbfd5('0x29')]['find']({'where':{'id':_0x37a01d[_0xbfd5('0x2a')]['id']}})[_0xbfd5('0x22')](handleEntityNotFound(_0x87d57a,null))[_0xbfd5('0x22')](removeEntity(_0x87d57a,null))[_0xbfd5('0x2b')](handleError(_0x87d57a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 2c31606..79fee74 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 _0xb035=['moment','bluebird','request-promise','path','rimraf','exports','define','lodash','util'];(function(_0x15f43a,_0x57c8b5){var _0x2369bc=function(_0x46c265){while(--_0x46c265){_0x15f43a['push'](_0x15f43a['shift']());}};_0x2369bc(++_0x57c8b5);}(_0xb035,0x1b7));var _0x5b03=function(_0x165d3c,_0x3ba20d){_0x165d3c=_0x165d3c-0x0;var _0xc27339=_0xb035[_0x165d3c];return _0xc27339;};'use strict';var _=require(_0x5b03('0x0'));var util=require(_0x5b03('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5b03('0x2'));var BPromise=require(_0x5b03('0x3'));var rp=require(_0x5b03('0x4'));var fs=require('fs');var path=require(_0x5b03('0x5'));var rimraf=require(_0x5b03('0x6'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x5b03('0x7')]=function(_0x4d3fd6,_0x3838a3){return _0x4d3fd6[_0x5b03('0x8')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ef9=['request-promise','path','../../config/environment','exports','define','Action','lodash','../../config/logger','api','moment'];(function(_0x400349,_0x4ef492){var _0x2646e8=function(_0x22924d){while(--_0x22924d){_0x400349['push'](_0x400349['shift']());}};_0x2646e8(++_0x4ef492);}(_0x7ef9,0xe2));var _0x97ef=function(_0x592e27,_0x563e79){_0x592e27=_0x592e27-0x0;var _0x2f739f=_0x7ef9[_0x592e27];return _0x2f739f;};'use strict';var _=require(_0x97ef('0x0'));var util=require('util');var logger=require(_0x97ef('0x1'))(_0x97ef('0x2'));var moment=require(_0x97ef('0x3'));var BPromise=require('bluebird');var rp=require(_0x97ef('0x4'));var fs=require('fs');var path=require(_0x97ef('0x5'));var rimraf=require('rimraf');var config=require(_0x97ef('0x6'));var attributes=require('./action.attributes');module[_0x97ef('0x7')]=function(_0x42fa3b,_0x1dbfdf){return _0x42fa3b[_0x97ef('0x8')](_0x97ef('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index e4acf6f..e5eea5a 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x814b,0x1a2));var _0xb814=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x814b[_0x1ad901];return _0x3c0249;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _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(_0x57add0,_0x25c24b){var _0x504b0f=function(_0x19ba46){while(--_0x19ba46){_0x57add0['push'](_0x57add0['shift']());}};_0x504b0f(++_0x25c24b);}(_0x1261,0x144));var _0x1126=function(_0x5cb508,_0x2cb3bd){_0x5cb508=_0x5cb508-0x0;var _0x44d4f5=_0x1261[_0x5cb508];return _0x44d4f5;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index af6d56f..ac1c527 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 _0xb8e8=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer','util','path'];(function(_0x488141,_0x58c0a4){var _0xb35deb=function(_0x657f76){while(--_0x657f76){_0x488141['push'](_0x488141['shift']());}};_0xb35deb(++_0x58c0a4);}(_0xb8e8,0xeb));var _0x8b8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb8e8[_0x14add3];return _0x4a174f;};'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(_0x8b8e('0x5'));var auth=require(_0x8b8e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b8e('0x7'));var controller=require(_0x8b8e('0x8'));router['put'](_0x8b8e('0x9'),auth[_0x8b8e('0xa')](),controller[_0x8b8e('0xb')]);router[_0x8b8e('0xc')]('/:id',auth[_0x8b8e('0xa')](),controller[_0x8b8e('0xd')]);module['exports']=router; \ No newline at end of file +var _0xe0d4=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util'];(function(_0x460234,_0x58d00b){var _0x33e37c=function(_0x122ba8){while(--_0x122ba8){_0x460234['push'](_0x460234['shift']());}};_0x33e37c(++_0x58d00b);}(_0xe0d4,0xec));var _0x4e0d=function(_0x5edc4d,_0x543aa5){_0x5edc4d=_0x5edc4d-0x0;var _0x134fb6=_0xe0d4[_0x5edc4d];return _0x134fb6;};'use strict';var multer=require(_0x4e0d('0x0'));var util=require(_0x4e0d('0x1'));var path=require(_0x4e0d('0x2'));var timeout=require(_0x4e0d('0x3'));var express=require(_0x4e0d('0x4'));var router=express[_0x4e0d('0x5')]();var fs_extra=require(_0x4e0d('0x6'));var auth=require(_0x4e0d('0x7'));var interaction=require(_0x4e0d('0x8'));var config=require(_0x4e0d('0x9'));var controller=require(_0x4e0d('0xa'));router[_0x4e0d('0xb')](_0x4e0d('0xc'),auth[_0x4e0d('0xd')](),controller[_0x4e0d('0xe')]);router[_0x4e0d('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4e0d('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index d568439..88c88aa 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 _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x33b586,_0x484222){var _0x14bcfd=function(_0x13cf2d){while(--_0x13cf2d){_0x33b586['push'](_0x33b586['shift']());}};_0x14bcfd(++_0x484222);}(_0x1883,0xab));var _0x3188=function(_0x45bd9f,_0x23507b){_0x45bd9f=_0x45bd9f-0x0;var _0x160dc3=_0x1883[_0x45bd9f];return _0x160dc3;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}}; \ No newline at end of file +var _0xbd51=['sequelize','STRING'];(function(_0xbda849,_0x2dcb1a){var _0x2d3e9d=function(_0x2c8f10){while(--_0x2c8f10){_0xbda849['push'](_0xbda849['shift']());}};_0x2d3e9d(++_0x2dcb1a);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1090bc,_0xed0f01){_0x1090bc=_0x1090bc-0x0;var _0x2478ea=_0xbd51[_0x1090bc];return _0x2478ea;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 9faea2c..4a21f8a 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 _0xf6f7=['.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','parentKey','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','keyBy','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','COUNT(DISTINCT\x20%s)','DATE(%s)','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','DESC','web','fullPath','%s-%s.%s','randomstring','generate','output','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf6f7,0xae));var _0x7f6f=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xf6f7[_0x609988];return _0x159984;};'use strict';var emlformat=require(_0x7f6f('0x0'));var rimraf=require(_0x7f6f('0x1'));var zipdir=require(_0x7f6f('0x2'));var jsonpatch=require(_0x7f6f('0x3'));var rp=require(_0x7f6f('0x4'));var moment=require(_0x7f6f('0x5'));var BPromise=require(_0x7f6f('0x6'));var Mustache=require(_0x7f6f('0x7'));var util=require(_0x7f6f('0x8'));var path=require('path');var sox=require(_0x7f6f('0x9'));var csv=require(_0x7f6f('0xa'));var ejs=require(_0x7f6f('0xb'));var fs=require('fs');var fs_extra=require(_0x7f6f('0xc'));var _=require(_0x7f6f('0xd'));var squel=require('squel');var crypto=require(_0x7f6f('0xe'));var jsforce=require(_0x7f6f('0xf'));var deskjs=require(_0x7f6f('0x10'));var toCsv=require(_0x7f6f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7f6f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f6f('0x12'));var as=require(_0x7f6f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7f6f('0x14'));var utils=require(_0x7f6f('0x15'));var config=require(_0x7f6f('0x16'));var licenseUtil=require(_0x7f6f('0x17'));var db=require(_0x7f6f('0x18'))['db'];var dbH=require(_0x7f6f('0x18'))[_0x7f6f('0x19')];function respondWithStatusCode(_0x521d0a,_0x37418f){_0x37418f=_0x37418f||0xcc;return function(_0x40632b){if(_0x40632b){return _0x521d0a[_0x7f6f('0x1a')](_0x37418f);}return _0x521d0a[_0x7f6f('0x1b')](_0x37418f)[_0x7f6f('0x1c')]();};}function respondWithResult(_0x678041,_0x4f6d27){_0x4f6d27=_0x4f6d27||0xc8;return function(_0x1b9689){if(_0x1b9689){return _0x678041[_0x7f6f('0x1b')](_0x4f6d27)[_0x7f6f('0x1d')](_0x1b9689);}};}function respondWithFilteredResult(_0x55dace,_0x2f39e3){return function(_0x1b7288){if(_0x1b7288){var _0xe86614=typeof _0x2f39e3[_0x7f6f('0x1e')]===_0x7f6f('0x1f')&&typeof _0x2f39e3[_0x7f6f('0x20')]===_0x7f6f('0x1f');var _0xffac6=_0x1b7288['count'];var _0x5eccb0=_0xe86614?0x0:_0x2f39e3[_0x7f6f('0x1e')];var _0x869c64=_0xe86614?_0x1b7288[_0x7f6f('0x21')]:_0x2f39e3[_0x7f6f('0x1e')]+_0x2f39e3[_0x7f6f('0x20')];var _0x5ed0eb;if(_0x869c64>=_0xffac6){_0x869c64=_0xffac6;_0x5ed0eb=0xc8;}else{_0x5ed0eb=0xce;}_0x55dace['status'](_0x5ed0eb);return _0x55dace['set'](_0x7f6f('0x22'),_0x5eccb0+'-'+_0x869c64+'/'+_0xffac6)[_0x7f6f('0x1d')](_0x1b7288);}return null;};}function patchUpdates(_0x228d0d){return function(_0x3d77e5){try{jsonpatch[_0x7f6f('0x23')](_0x3d77e5,_0x228d0d,!![]);}catch(_0x2539b7){return BPromise[_0x7f6f('0x24')](_0x2539b7);}return _0x3d77e5[_0x7f6f('0x25')]();};}function saveUpdates(_0x21288d,_0x62489){return function(_0x40cff1){if(_0x40cff1){return _0x40cff1[_0x7f6f('0x26')](_0x21288d)[_0x7f6f('0x27')](function(_0x54c0cc){return _0x54c0cc;});}return null;};}function removeEntity(_0x36d313,_0x3bb4f6){return function(_0x55b086){if(_0x55b086){return _0x55b086['destroy']()[_0x7f6f('0x27')](function(){var _0x42a197=_0x55b086[_0x7f6f('0x28')]({'plain':!![]});var _0x367ad9='CustomReports';return db[_0x7f6f('0x29')]['destroy']({'where':{'type':_0x367ad9,'resourceId':_0x42a197['id']}})['then'](function(){return _0x55b086;});})[_0x7f6f('0x27')](function(){_0x36d313[_0x7f6f('0x1b')](0xcc)[_0x7f6f('0x1c')]();});}};}function handleEntityNotFound(_0x1765c0,_0x45fa04){return function(_0x1f6742){if(!_0x1f6742){_0x1765c0['sendStatus'](0x194);}return _0x1f6742;};}function handleError(_0x509c64,_0x2d2b12){_0x2d2b12=_0x2d2b12||0x1f4;return function(_0x5266ad){logger[_0x7f6f('0x2a')](_0x5266ad['stack']);if(_0x5266ad[_0x7f6f('0x2b')]){delete _0x5266ad[_0x7f6f('0x2b')];}_0x509c64[_0x7f6f('0x1b')](_0x2d2b12)[_0x7f6f('0x2c')](_0x5266ad);};}exports[_0x7f6f('0x2d')]=function(_0x3dca6a,_0x1c1fa1){var _0x3cd7b1={},_0x2aad16={},_0x1aadc1={'count':0x0,'rows':[]};var _0x228d0c=_[_0x7f6f('0x2e')](db['AnalyticCustomReport'][_0x7f6f('0x2f')],function(_0x3eed09){return{'name':_0x3eed09[_0x7f6f('0x30')],'type':_0x3eed09[_0x7f6f('0x31')]['key']};});_0x2aad16[_0x7f6f('0x32')]=_[_0x7f6f('0x2e')](_0x228d0c,_0x7f6f('0x2b'));_0x2aad16[_0x7f6f('0x33')]=_[_0x7f6f('0x34')](_0x3dca6a[_0x7f6f('0x33')]);_0x2aad16[_0x7f6f('0x35')]=_[_0x7f6f('0x36')](_0x2aad16[_0x7f6f('0x32')],_0x2aad16['query']);_0x3cd7b1[_0x7f6f('0x37')]=_[_0x7f6f('0x36')](_0x2aad16[_0x7f6f('0x32')],qs[_0x7f6f('0x38')](_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x38')]));_0x3cd7b1['attributes']=_0x3cd7b1[_0x7f6f('0x37')][_0x7f6f('0x39')]?_0x3cd7b1['attributes']:_0x2aad16['model'];if(!_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x3a')](_0x7f6f('0x3b'))){_0x3cd7b1[_0x7f6f('0x20')]=qs['limit'](_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x20')]);_0x3cd7b1[_0x7f6f('0x1e')]=qs[_0x7f6f('0x1e')](_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x1e')]);}_0x3cd7b1[_0x7f6f('0x3c')]=qs[_0x7f6f('0x3d')](_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x3d')]);_0x3cd7b1[_0x7f6f('0x3e')]=qs[_0x7f6f('0x35')](_['pick'](_0x3dca6a['query'],_0x2aad16['filters']),_0x228d0c);if(_0x3dca6a[_0x7f6f('0x33')]['filter']){_0x3cd7b1['where']=_[_0x7f6f('0x3f')](_0x3cd7b1[_0x7f6f('0x3e')],{'$or':_['map'](_0x228d0c,function(_0x413423){if(_0x413423[_0x7f6f('0x31')]!=='VIRTUAL'){var _0x2375ba={};_0x2375ba[_0x413423[_0x7f6f('0x2b')]]={'$like':'%'+_0x3dca6a[_0x7f6f('0x33')]['filter']+'%'};return _0x2375ba;}})});}_0x3cd7b1=_[_0x7f6f('0x3f')]({},_0x3cd7b1,_0x3dca6a['options']);var _0x2c893a={'where':_0x3cd7b1[_0x7f6f('0x3e')]};return db[_0x7f6f('0x40')][_0x7f6f('0x21')](_0x2c893a)['then'](function(_0x12a501){_0x1aadc1[_0x7f6f('0x21')]=_0x12a501;if(_0x3dca6a[_0x7f6f('0x33')][_0x7f6f('0x41')]){_0x3cd7b1[_0x7f6f('0x42')]=[{'all':!![]}];}return db[_0x7f6f('0x40')][_0x7f6f('0x43')](_0x3cd7b1);})['then'](function(_0x509697){_0x1aadc1['rows']=_0x509697;return _0x1aadc1;})[_0x7f6f('0x27')](respondWithFilteredResult(_0x1c1fa1,_0x3cd7b1))[_0x7f6f('0x44')](handleError(_0x1c1fa1,null));};exports[_0x7f6f('0x45')]=function(_0x11ea83,_0x2edde2){var _0x16188d={'raw':![],'where':{'id':_0x11ea83[_0x7f6f('0x46')]['id']}},_0x5b6277={};_0x5b6277['model']=_[_0x7f6f('0x34')](db['AnalyticCustomReport'][_0x7f6f('0x2f')]);_0x5b6277['query']=_[_0x7f6f('0x34')](_0x11ea83['query']);_0x5b6277[_0x7f6f('0x35')]=_[_0x7f6f('0x36')](_0x5b6277[_0x7f6f('0x32')],_0x5b6277['query']);_0x16188d[_0x7f6f('0x37')]=_[_0x7f6f('0x36')](_0x5b6277[_0x7f6f('0x32')],qs[_0x7f6f('0x38')](_0x11ea83[_0x7f6f('0x33')][_0x7f6f('0x38')]));_0x16188d[_0x7f6f('0x37')]=_0x16188d[_0x7f6f('0x37')][_0x7f6f('0x39')]?_0x16188d[_0x7f6f('0x37')]:_0x5b6277[_0x7f6f('0x32')];if(_0x11ea83['query'][_0x7f6f('0x41')]){_0x16188d[_0x7f6f('0x42')]=[{'all':!![]}];}_0x16188d=_[_0x7f6f('0x3f')]({},_0x16188d,_0x11ea83[_0x7f6f('0x47')]);return db[_0x7f6f('0x40')][_0x7f6f('0x48')](_0x16188d)['then'](handleEntityNotFound(_0x2edde2,null))[_0x7f6f('0x27')](respondWithResult(_0x2edde2,null))[_0x7f6f('0x44')](handleError(_0x2edde2,null));};exports[_0x7f6f('0x49')]=function(_0x278ac0,_0x1b84b6){return db[_0x7f6f('0x40')][_0x7f6f('0x49')](_0x278ac0[_0x7f6f('0x4a')],{})[_0x7f6f('0x27')](function(_0x22bd30){var _0x4c5f99=_0x278ac0[_0x7f6f('0x4b')][_0x7f6f('0x28')]({'plain':!![]});if(!_0x4c5f99)throw new Error(_0x7f6f('0x4c'));if(_0x4c5f99[_0x7f6f('0x4d')]===_0x7f6f('0x4b')){var _0x361c27=_0x22bd30[_0x7f6f('0x28')]({'plain':!![]});var _0x33ce9c='Reports';return db[_0x7f6f('0x4e')][_0x7f6f('0x48')]({'where':{'name':_0x33ce9c,'userProfileId':_0x4c5f99[_0x7f6f('0x4f')]},'raw':!![]})[_0x7f6f('0x27')](function(_0x1d1d85){if(_0x1d1d85&&_0x1d1d85['autoAssociation']===0x0){return db[_0x7f6f('0x29')][_0x7f6f('0x49')]({'name':_0x361c27[_0x7f6f('0x2b')],'resourceId':_0x361c27['id'],'type':_0x7f6f('0x50'),'sectionId':_0x1d1d85['id']},{})[_0x7f6f('0x27')](function(){return _0x22bd30;});}else{return _0x22bd30;}})['catch'](function(_0x2a1608){logger[_0x7f6f('0x2a')](_0x7f6f('0x51'),_0x2a1608);throw _0x2a1608;});}return _0x22bd30;})[_0x7f6f('0x27')](respondWithResult(_0x1b84b6,0xc9))[_0x7f6f('0x44')](handleError(_0x1b84b6,null));};exports[_0x7f6f('0x26')]=function(_0x48ab1c,_0x365738){if(_0x48ab1c[_0x7f6f('0x4a')]['id']){delete _0x48ab1c[_0x7f6f('0x4a')]['id'];}return db[_0x7f6f('0x40')][_0x7f6f('0x48')]({'where':{'id':_0x48ab1c['params']['id']}})[_0x7f6f('0x27')](handleEntityNotFound(_0x365738,null))[_0x7f6f('0x27')](saveUpdates(_0x48ab1c[_0x7f6f('0x4a')],null))[_0x7f6f('0x27')](respondWithResult(_0x365738,null))[_0x7f6f('0x44')](handleError(_0x365738,null));};exports[_0x7f6f('0x52')]=function(_0x102a3f,_0x254172){return db[_0x7f6f('0x40')]['find']({'where':{'id':_0x102a3f[_0x7f6f('0x46')]['id']}})[_0x7f6f('0x27')](handleEntityNotFound(_0x254172,null))[_0x7f6f('0x27')](removeEntity(_0x254172,null))[_0x7f6f('0x44')](handleError(_0x254172,null));};exports[_0x7f6f('0x53')]=function(_0x9d84af,_0x169b63){var _0x19dd85=0xa;var _0x3d57ff=['join',_0x7f6f('0x54'),_0x7f6f('0x55'),_0x7f6f('0x56')];var _0x247041={'SUM':_0x7f6f('0x57'),'COUNT':_0x7f6f('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7f6f('0x59'),'MIN':_0x7f6f('0x5a'),'AVG':_0x7f6f('0x5b'),'GROUP_CONCAT':_0x7f6f('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7f6f('0x5d')};var _0x486337={'SEC_TO_TIME':_0x7f6f('0x5e'),'DATE':'DATE(%s)','HOUR':_0x7f6f('0x5f'),'ROUND':_0x7f6f('0x60'),'UNIX_TIMESTAMP':_0x7f6f('0x61')};var _0x1c86c6=function(_0x40fc87){return!_[_0x7f6f('0x62')]([_0x7f6f('0x63'),_0x7f6f('0x64'),_0x7f6f('0x65'),_0x7f6f('0x66')],_0x40fc87);};var _0x3950b4=function(_0x2a2cf2){if(!_0x2a2cf2||!_0x2a2cf2[_0x7f6f('0x67')]['length']){return'';}for(var _0x5ecf81='(',_0x5cde77=0x0;_0x5cde77<_0x2a2cf2[_0x7f6f('0x67')][_0x7f6f('0x39')];_0x5cde77+=0x1){_0x5cde77>0x0&&(_0x5ecf81+='\x20'+_0x2a2cf2[_0x7f6f('0x68')]+'\x20');_0x5ecf81+=_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x69')]?_0x3950b4(_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x69')]):_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x6a')]+'\x20'+_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x6b')]+(_0x1c86c6(_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x6b')])?'\x20'+_0x2a2cf2[_0x7f6f('0x67')][_0x5cde77][_0x7f6f('0x6c')]:'');}return _0x5ecf81+')';};var _0x184586={'where':{'id':_0x9d84af['params']['id']}},_0x4ab892,_0x26d7cb,_0x52d2ae,_0xe1a97f,_0x4150a9;_0x184586=_[_0x7f6f('0x3f')]({},_0x184586,_0x9d84af[_0x7f6f('0x47')]);return db['AnalyticCustomReport']['find'](_0x184586)[_0x7f6f('0x27')](function(_0x35cb3a){if(_0x35cb3a){_0x4ab892=_0x35cb3a;return _0x35cb3a[_0x7f6f('0x6d')]();}return null;})['then'](function(_0x449dd7){if(_0x449dd7){if(!_0x449dd7[_0x7f6f('0x39')]){throw new db[(_0x7f6f('0x6e'))][(_0x7f6f('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x26d7cb=_0x449dd7;return db['AnalyticMetric'][_0x7f6f('0x43')]({'raw':!![]});}return null;})[_0x7f6f('0x27')](function(_0x4ab987){if(_0x4ab987){_0x52d2ae=_[_0x7f6f('0x70')](_0x4ab987,'id');var _0x23d145;var _0x3f7ad5=squel[_0x7f6f('0x71')]();_0x3f7ad5['from'](_0x4ab892[_0x7f6f('0x72')]);for(var _0x2275fe=0x0;_0x2275fe<_0x26d7cb[_0x7f6f('0x39')];_0x2275fe+=0x1){_0x23d145=_0x26d7cb[_0x2275fe]['MetricId']?_0x52d2ae[_0x26d7cb[_0x2275fe][_0x7f6f('0x73')]][_0x7f6f('0x74')]:_0x26d7cb[_0x2275fe][_0x7f6f('0x6a')];_0x23d145=_0x26d7cb[_0x2275fe]['function']?_[_0x7f6f('0x75')](_0x247041[_0x26d7cb[_0x2275fe][_0x7f6f('0x76')]],'%s',_0x23d145):_0x23d145;_0x23d145=_0x26d7cb[_0x2275fe][_0x7f6f('0x77')]?_[_0x7f6f('0x75')](_0x486337[_0x26d7cb[_0x2275fe]['format']],'%s',_0x23d145):_0x23d145;if(_0x26d7cb[_0x2275fe][_0x7f6f('0x78')]){_0x3f7ad5[_0x7f6f('0x69')](_0x23d145);}_0x26d7cb[_0x2275fe][_0x7f6f('0x79')]&&_0x3f7ad5[_0x7f6f('0x3c')](_0x23d145,_0x26d7cb[_0x2275fe]['orderBy']==='DESC'?![]:!![]);_0x3f7ad5[_0x7f6f('0x6a')](_0x23d145,_0x26d7cb[_0x2275fe][_0x7f6f('0x7a')]||_0x23d145);}if(_0x4ab892[_0x7f6f('0x7b')]){_0x4ab892[_0x7f6f('0x7b')]=JSON[_0x7f6f('0x7c')](_0x4ab892['joins']);for(var _0x1f2ab8=0x0;_0x1f2ab8<_0x4ab892[_0x7f6f('0x7b')][_0x7f6f('0x39')];_0x1f2ab8+=0x1){if(_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x31')]&&_[_0x7f6f('0x62')](_0x3d57ff,_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x31')])&&_0x4ab892['joins'][_0x1f2ab8]['parentKey']&&_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x7d')]&&_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x7e')]){_0x3f7ad5[_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x31')]](_0x4ab892['joins'][_0x1f2ab8][_0x7f6f('0x7d')],null,util['format'](_0x7f6f('0x7f'),_0x4ab892[_0x7f6f('0x72')],_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8]['parentKey'],_0x4ab892['joins'][_0x1f2ab8][_0x7f6f('0x7d')],_0x4ab892[_0x7f6f('0x7b')][_0x1f2ab8][_0x7f6f('0x7e')]));}}}if(_0x4ab892[_0x7f6f('0x80')]){_0x4ab892['conditions']=JSON[_0x7f6f('0x7c')](_0x4ab892[_0x7f6f('0x80')]);_0x3f7ad5[_0x7f6f('0x3e')](_0x3950b4(_0x4ab892[_0x7f6f('0x80')][_0x7f6f('0x69')]));}_0x4150a9=_0x3f7ad5[_0x7f6f('0x81')]();_0x3f7ad5['limit'](_0x19dd85);_0x3f7ad5[_0x7f6f('0x1e')](0x0);logger['debug'](_0x7f6f('0x82'),_0x3f7ad5[_0x7f6f('0x83')]());return dbH[_0x7f6f('0x84')][_0x7f6f('0x33')](_0x3f7ad5[_0x7f6f('0x83')](),{'type':dbH[_0x7f6f('0x84')][_0x7f6f('0x85')][_0x7f6f('0x86')]});}})[_0x7f6f('0x27')](respondWithResult(_0x169b63,null))['catch'](handleError(_0x169b63,null));};function runReport(_0x421aa4,_0xf6b58f,_0xa4cee6){var _0x1e5fa0=_0xf6b58f[_0x7f6f('0x2b')];var _0x550308=0xa;var _0x3cf99e=[_0x7f6f('0x87'),_0x7f6f('0x54'),_0x7f6f('0x55'),'cross_join'];var _0x2b2826={'SUM':_0x7f6f('0x57'),'COUNT':_0x7f6f('0x58'),'COUNT DISTINCT':_0x7f6f('0x88'),'MAX':'MAX(%s)','MIN':_0x7f6f('0x5a'),'AVG':_0x7f6f('0x5b'),'GROUP_CONCAT':_0x7f6f('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7f6f('0x5d')};var _0x15c2e2={'SEC_TO_TIME':_0x7f6f('0x5e'),'DATE':_0x7f6f('0x89'),'HOUR':_0x7f6f('0x5f'),'ROUND':_0x7f6f('0x60'),'UNIX_TIMESTAMP':_0x7f6f('0x61')};var _0x672dd0=function(_0x228948){return!_[_0x7f6f('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7f6f('0x65'),_0x7f6f('0x66')],_0x228948);};var _0x241f22=function(_0x539cbe){if(!_0x539cbe||!_0x539cbe[_0x7f6f('0x67')][_0x7f6f('0x39')]){return'';}for(var _0x3c7496='(',_0x46f159=0x0;_0x46f159<_0x539cbe[_0x7f6f('0x67')][_0x7f6f('0x39')];_0x46f159+=0x1){_0x46f159>0x0&&(_0x3c7496+='\x20'+_0x539cbe[_0x7f6f('0x68')]+'\x20');_0x3c7496+=_0x539cbe[_0x7f6f('0x67')][_0x46f159]['group']?_0x241f22(_0x539cbe[_0x7f6f('0x67')][_0x46f159][_0x7f6f('0x69')]):_0x539cbe[_0x7f6f('0x67')][_0x46f159]['field']+'\x20'+_0x539cbe[_0x7f6f('0x67')][_0x46f159]['condition']+(_0x672dd0(_0x539cbe['rules'][_0x46f159][_0x7f6f('0x6b')])?'\x20'+_0x539cbe['rules'][_0x46f159][_0x7f6f('0x6c')]:'');}return _0x3c7496+')';};var _0xe72352={'where':{'id':_0x421aa4['id']}},_0xacf636,_0x59f9ed,_0x1f82be,_0xaaa7fb,_0x18d06d;_0xe72352=_['merge']({},_0xe72352,_0xa4cee6);return db[_0x7f6f('0x40')][_0x7f6f('0x48')](_0xe72352)[_0x7f6f('0x27')](function(_0x549713){if(_0x549713){_0xacf636=_0x549713;return _0x549713[_0x7f6f('0x6d')]();}return null;})[_0x7f6f('0x27')](function(_0x1bb457){if(_0x1bb457){if(!_0x1bb457[_0x7f6f('0x39')]){throw new db[(_0x7f6f('0x6e'))][(_0x7f6f('0x6f'))](_0x7f6f('0x8a'),0x193);}_0x59f9ed=_0x1bb457;return db[_0x7f6f('0x8b')][_0x7f6f('0x43')]({'raw':!![]});}return null;})['then'](function(_0x44dcb9){if(_0x44dcb9){_0x1f82be=_[_0x7f6f('0x70')](_0x44dcb9,'id');var _0x4db479;var _0x58bf38=squel[_0x7f6f('0x71')]();_0x58bf38[_0x7f6f('0x8c')](_0xacf636[_0x7f6f('0x72')]);for(var _0x553b6d=0x0;_0x553b6d<_0x59f9ed[_0x7f6f('0x39')];_0x553b6d+=0x1){_0x4db479=_0x59f9ed[_0x553b6d][_0x7f6f('0x73')]?_0x1f82be[_0x59f9ed[_0x553b6d][_0x7f6f('0x73')]][_0x7f6f('0x74')]:_0x59f9ed[_0x553b6d][_0x7f6f('0x6a')];_0x4db479=_0x59f9ed[_0x553b6d][_0x7f6f('0x76')]?_[_0x7f6f('0x75')](_0x2b2826[_0x59f9ed[_0x553b6d][_0x7f6f('0x76')]],'%s',_0x4db479):_0x4db479;_0x4db479=_0x59f9ed[_0x553b6d][_0x7f6f('0x77')]?_[_0x7f6f('0x75')](_0x15c2e2[_0x59f9ed[_0x553b6d][_0x7f6f('0x77')]],'%s',_0x4db479):_0x4db479;if(_0x59f9ed[_0x553b6d][_0x7f6f('0x78')]){_0x58bf38[_0x7f6f('0x69')](_0x4db479);}_0x59f9ed[_0x553b6d]['orderBy']&&_0x58bf38[_0x7f6f('0x3c')](_0x4db479,_0x59f9ed[_0x553b6d][_0x7f6f('0x79')]===_0x7f6f('0x8d')?![]:!![]);_0x58bf38[_0x7f6f('0x6a')](_0x4db479,_0x59f9ed[_0x553b6d]['alias']||_0x4db479);}if(_0xacf636[_0x7f6f('0x7b')]){_0xacf636[_0x7f6f('0x7b')]=JSON['parse'](_0xacf636[_0x7f6f('0x7b')]);for(var _0x226a18=0x0;_0x226a18<_0xacf636[_0x7f6f('0x7b')][_0x7f6f('0x39')];_0x226a18+=0x1){if(_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x31')]&&_[_0x7f6f('0x62')](_0x3cf99e,_0xacf636[_0x7f6f('0x7b')][_0x226a18]['type'])&&_0xacf636['joins'][_0x226a18]['parentKey']&&_0xacf636[_0x7f6f('0x7b')][_0x226a18]['foreignTable']&&_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x7e')]){_0x58bf38[_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x31')]](_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x7d')],null,util['format'](_0x7f6f('0x7f'),_0xacf636[_0x7f6f('0x72')],_0xacf636['joins'][_0x226a18]['parentKey'],_0xacf636[_0x7f6f('0x7b')][_0x226a18]['foreignTable'],_0xacf636[_0x7f6f('0x7b')][_0x226a18][_0x7f6f('0x7e')]));}}}if(_0xacf636[_0x7f6f('0x80')]){_0xacf636[_0x7f6f('0x80')]=JSON['parse'](_0xacf636[_0x7f6f('0x80')]);_0x58bf38['where'](_0x241f22(_0xacf636[_0x7f6f('0x80')]['group']));}_0x18d06d=_0x58bf38[_0x7f6f('0x81')]();_0x58bf38[_0x7f6f('0x20')](_0x550308);_0x58bf38['offset'](0x0);return;}})[_0x7f6f('0x27')](function(){if(_0xf6b58f['output']===_0x7f6f('0x8e')){return null;}var _0x304650=_[_0x7f6f('0x3f')](_0xf6b58f,{'name':_0xf6b58f[_0x7f6f('0x8f')]||_0xf6b58f[_0x7f6f('0x2b')]||_0xacf636[_0x7f6f('0x2b')],'basename':_0x1e5fa0,'savename':util[_0x7f6f('0x77')](_0x7f6f('0x90'),_0xf6b58f[_0x7f6f('0x2b')]||_0xacf636[_0x7f6f('0x2b')],require(_0x7f6f('0x91'))[_0x7f6f('0x92')](0x4),_0xf6b58f[_0x7f6f('0x93')]||'csv'),'reportId':_0xacf636['id'],'reportType':'custom'});return db[_0x7f6f('0x94')][_0x7f6f('0x49')](_0x304650,{'raw':!![]});})[_0x7f6f('0x27')](function(_0x4512bc){if(_0xacf636[_0x7f6f('0x72')]===_0x7f6f('0x95')){_0x18d06d['where'](_0xacf636[_0x7f6f('0x72')]+_0x7f6f('0x96'),_0xf6b58f[_0x7f6f('0x97')],_0xf6b58f['endDate']);}else{_0x18d06d[_0x7f6f('0x3e')](_0xacf636[_0x7f6f('0x72')]+_0x7f6f('0x98'),_0xf6b58f['startDate'],_0xf6b58f['endDate']);}if(_0x4512bc){logger[_0x7f6f('0x99')](_0x7f6f('0x9a'),_0x18d06d['toString']());require('child_process')['fork'](path[_0x7f6f('0x87')](__dirname,_0x7f6f('0x9b'),_0x4512bc[_0x7f6f('0x93')]),[_0x4512bc['id'],_0x18d06d[_0x7f6f('0x83')](),path[_0x7f6f('0x87')](__dirname,_0x7f6f('0x9c'),_0x4512bc[_0x7f6f('0x9d')]),_0x1e5fa0]);return _0x4512bc;}else{var _0x352629=squel['select']();_0x352629[_0x7f6f('0x8c')]('('+_0x18d06d[_0x7f6f('0x83')]()+')','countTable');_0x352629[_0x7f6f('0x6a')]('COUNT(*)',_0x7f6f('0x21'));_0x18d06d['limit'](_0xf6b58f[_0x7f6f('0x20')]||_0x550308);_0x18d06d[_0x7f6f('0x1e')](_0xf6b58f[_0x7f6f('0x1e')]||0x0);return dbH['sequelize']['query'](_0x352629[_0x7f6f('0x83')](),{'type':dbH[_0x7f6f('0x84')]['QueryTypes'][_0x7f6f('0x86')]})[_0x7f6f('0x27')](function(_0x1b4a38){if(!_0x1b4a38[_0x7f6f('0x39')]){_0xaaa7fb=0x0;}else{_0xaaa7fb=_0x1b4a38[0x0][_0x7f6f('0x21')]||0x0;}return dbH[_0x7f6f('0x84')][_0x7f6f('0x33')](_0x18d06d[_0x7f6f('0x83')](),{'type':dbH[_0x7f6f('0x84')]['QueryTypes'][_0x7f6f('0x86')]});})['then'](function(_0x42fdf1){return{'rows':_0x42fdf1||[],'count':_0xaaa7fb};});}});}exports[_0x7f6f('0x9e')]=function(_0x358fa1,_0x421b3e){return runReport(_0x358fa1[_0x7f6f('0x46')],_0x358fa1[_0x7f6f('0x33')],_0x358fa1[_0x7f6f('0x47')])[_0x7f6f('0x27')](respondWithResult(_0x421b3e,null))[_0x7f6f('0x44')](handleError(_0x421b3e,null));};exports[_0x7f6f('0x9f')]=runReport;exports[_0x7f6f('0x33')]=function(_0x461c82,_0x1fe774){var _0x519ee2=0xa;var _0x3b7b41=[_0x7f6f('0x87'),_0x7f6f('0x54'),_0x7f6f('0x55'),_0x7f6f('0x56')];var _0x250345={'SUM':'SUM(%s)','COUNT':_0x7f6f('0x58'),'COUNT DISTINCT':_0x7f6f('0x88'),'MAX':_0x7f6f('0x59'),'MIN':'MIN(%s)','AVG':_0x7f6f('0x5b'),'GROUP_CONCAT':_0x7f6f('0x5c'),'GROUP_CONCAT ASC':_0x7f6f('0xa0'),'GROUP_CONCAT DESC':_0x7f6f('0x5d')};var _0x20ee3b={'SEC_TO_TIME':_0x7f6f('0x5e'),'DATE':_0x7f6f('0x89'),'HOUR':_0x7f6f('0x5f'),'ROUND':_0x7f6f('0x60'),'UNIX_TIMESTAMP':_0x7f6f('0x61')};var _0x274e95=function(_0x132984){return!_[_0x7f6f('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7f6f('0x65'),'IS\x20NOT\x20EMPTY'],_0x132984);};var _0x2c320d=function(_0x3b47be){if(!_0x3b47be||!_0x3b47be[_0x7f6f('0x67')][_0x7f6f('0x39')]){return'';}for(var _0x209335='(',_0x204178=0x0;_0x204178<_0x3b47be[_0x7f6f('0x67')][_0x7f6f('0x39')];_0x204178+=0x1){_0x204178>0x0&&(_0x209335+='\x20'+_0x3b47be[_0x7f6f('0x68')]+'\x20');_0x209335+=_0x3b47be['rules'][_0x204178][_0x7f6f('0x69')]?_0x2c320d(_0x3b47be[_0x7f6f('0x67')][_0x204178][_0x7f6f('0x69')]):_0x3b47be[_0x7f6f('0x67')][_0x204178][_0x7f6f('0x6a')]+'\x20'+_0x3b47be[_0x7f6f('0x67')][_0x204178]['condition']+(_0x274e95(_0x3b47be['rules'][_0x204178]['condition'])?'\x20'+_0x3b47be[_0x7f6f('0x67')][_0x204178]['value']:'');}return _0x209335+')';};var _0x565641={'where':{'id':_0x461c82['params']['id']}},_0x5a5073,_0x56674f,_0x2f8df6,_0x4acbb9,_0x39fcef;_0x565641=_[_0x7f6f('0x3f')]({},_0x565641,_0x461c82['options']);return db[_0x7f6f('0x40')][_0x7f6f('0x48')](_0x565641)['then'](function(_0x239aa1){if(_0x239aa1){_0x5a5073=_0x239aa1;return _0x239aa1['getFields']();}return null;})[_0x7f6f('0x27')](function(_0x4f0469){if(_0x4f0469){if(!_0x4f0469[_0x7f6f('0x39')]){throw new db[(_0x7f6f('0x6e'))][(_0x7f6f('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56674f=_0x4f0469;return db[_0x7f6f('0x8b')][_0x7f6f('0x43')]({'raw':!![]});}return null;})['then'](function(_0x2bf1a5){if(_0x2bf1a5){_0x2f8df6=_[_0x7f6f('0x70')](_0x2bf1a5,'id');var _0x56ef1d;var _0x24c389=squel[_0x7f6f('0x71')]();_0x24c389['from'](_0x5a5073[_0x7f6f('0x72')]);for(var _0x2abffd=0x0;_0x2abffd<_0x56674f['length'];_0x2abffd+=0x1){_0x56ef1d=_0x56674f[_0x2abffd][_0x7f6f('0x73')]?_0x2f8df6[_0x56674f[_0x2abffd][_0x7f6f('0x73')]][_0x7f6f('0x74')]:_0x56674f[_0x2abffd][_0x7f6f('0x6a')];_0x56ef1d=_0x56674f[_0x2abffd][_0x7f6f('0x76')]?_[_0x7f6f('0x75')](_0x250345[_0x56674f[_0x2abffd][_0x7f6f('0x76')]],'%s',_0x56ef1d):_0x56ef1d;_0x56ef1d=_0x56674f[_0x2abffd][_0x7f6f('0x77')]?_['replace'](_0x20ee3b[_0x56674f[_0x2abffd][_0x7f6f('0x77')]],'%s',_0x56ef1d):_0x56ef1d;if(_0x56674f[_0x2abffd][_0x7f6f('0x78')]){_0x24c389[_0x7f6f('0x69')](_0x56ef1d);}_0x56674f[_0x2abffd]['orderBy']&&_0x24c389[_0x7f6f('0x3c')](_0x56ef1d,_0x56674f[_0x2abffd][_0x7f6f('0x79')]===_0x7f6f('0x8d')?![]:!![]);_0x24c389[_0x7f6f('0x6a')](_0x56ef1d,_0x56674f[_0x2abffd][_0x7f6f('0x7a')]||_0x56ef1d);}if(_0x5a5073[_0x7f6f('0x7b')]){_0x5a5073['joins']=JSON[_0x7f6f('0x7c')](_0x5a5073['joins']);for(var _0x2a7f7d=0x0;_0x2a7f7d<_0x5a5073['joins'][_0x7f6f('0x39')];_0x2a7f7d+=0x1){if(_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x31')]&&_[_0x7f6f('0x62')](_0x3b7b41,_0x5a5073['joins'][_0x2a7f7d][_0x7f6f('0x31')])&&_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0xa1')]&&_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7d')]&&_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7e')]){_0x24c389[_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d]['type']](_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7d')],null,util[_0x7f6f('0x77')](_0x7f6f('0x7f'),_0x5a5073[_0x7f6f('0x72')],_0x5a5073['joins'][_0x2a7f7d][_0x7f6f('0xa1')],_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7d')],_0x5a5073[_0x7f6f('0x7b')][_0x2a7f7d][_0x7f6f('0x7e')]));}}}if(_0x5a5073[_0x7f6f('0x80')]){_0x5a5073['conditions']=JSON[_0x7f6f('0x7c')](_0x5a5073[_0x7f6f('0x80')]);_0x24c389[_0x7f6f('0x3e')](_0x2c320d(_0x5a5073[_0x7f6f('0x80')]['group']));}_0x39fcef=_0x24c389[_0x7f6f('0x81')]();_0x24c389['limit'](_0x519ee2);_0x24c389[_0x7f6f('0x1e')](0x0);logger[_0x7f6f('0xa2')](_0x7f6f('0x82'),_0x24c389[_0x7f6f('0x83')]());return dbH[_0x7f6f('0x84')][_0x7f6f('0x33')](_0x24c389[_0x7f6f('0x83')](),{'type':dbH['sequelize']['QueryTypes'][_0x7f6f('0x86')]});}})[_0x7f6f('0x27')](function(){return{'sql':_0x39fcef[_0x7f6f('0x83')]()};})[_0x7f6f('0x27')](respondWithResult(_0x1fe774,null))['catch'](handleError(_0x1fe774,null));}; \ No newline at end of file +var _0x429a=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','field','function','replace','format','groupBy','orderBy','parse','joins','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','SELECT','AVG(%s)','GROUP_CONCAT(%s)','DATE(%s)','operator','metric','output','generate','csv','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','savename','from','countTable','COUNT(*)','QueryTypes','runReport','DESC','alias','%s.%s\x20=\x20%s.%s','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','stack','name','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x2d1a83,_0x5cc1ca){var _0x342bb4=function(_0x1c9ee9){while(--_0x1c9ee9){_0x2d1a83['push'](_0x2d1a83['shift']());}};_0x342bb4(++_0x5cc1ca);}(_0x429a,0x116));var _0xa429=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0x429a[_0x36f47c];return _0x296c55;};'use strict';var emlformat=require(_0xa429('0x0'));var rimraf=require(_0xa429('0x1'));var zipdir=require(_0xa429('0x2'));var jsonpatch=require(_0xa429('0x3'));var rp=require('request-promise');var moment=require(_0xa429('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa429('0x5'));var util=require(_0xa429('0x6'));var path=require(_0xa429('0x7'));var sox=require(_0xa429('0x8'));var csv=require('to-csv');var ejs=require(_0xa429('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa429('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa429('0xb'));var toCsv=require(_0xa429('0xc'));var querystring=require(_0xa429('0xd'));var Papa=require(_0xa429('0xe'));var Redis=require(_0xa429('0xf'));var authService=require(_0xa429('0x10'));var qs=require(_0xa429('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa429('0x12'))(_0xa429('0x13'));var utils=require(_0xa429('0x14'));var config=require(_0xa429('0x15'));var licenseUtil=require(_0xa429('0x16'));var db=require(_0xa429('0x17'))['db'];var dbH=require(_0xa429('0x17'))[_0xa429('0x18')];function respondWithStatusCode(_0xe95590,_0x3c958c){_0x3c958c=_0x3c958c||0xcc;return function(_0x5da8e0){if(_0x5da8e0){return _0xe95590[_0xa429('0x19')](_0x3c958c);}return _0xe95590[_0xa429('0x1a')](_0x3c958c)[_0xa429('0x1b')]();};}function respondWithResult(_0x5bdda4,_0x459dd8){_0x459dd8=_0x459dd8||0xc8;return function(_0x5fc78b){if(_0x5fc78b){return _0x5bdda4['status'](_0x459dd8)[_0xa429('0x1c')](_0x5fc78b);}};}function respondWithFilteredResult(_0x6338f0,_0x18b914){return function(_0xae98){if(_0xae98){var _0x158d5d=typeof _0x18b914['offset']===_0xa429('0x1d')&&typeof _0x18b914['limit']==='undefined';var _0x52fc66=_0xae98[_0xa429('0x1e')];var _0x5b736f=_0x158d5d?0x0:_0x18b914[_0xa429('0x1f')];var _0x50ab2b=_0x158d5d?_0xae98['count']:_0x18b914[_0xa429('0x1f')]+_0x18b914[_0xa429('0x20')];var _0x2d27b2;if(_0x50ab2b>=_0x52fc66){_0x50ab2b=_0x52fc66;_0x2d27b2=0xc8;}else{_0x2d27b2=0xce;}_0x6338f0['status'](_0x2d27b2);return _0x6338f0[_0xa429('0x21')](_0xa429('0x22'),_0x5b736f+'-'+_0x50ab2b+'/'+_0x52fc66)[_0xa429('0x1c')](_0xae98);}return null;};}function patchUpdates(_0x54023a){return function(_0x4c0343){try{jsonpatch[_0xa429('0x23')](_0x4c0343,_0x54023a,!![]);}catch(_0x1ff595){return BPromise[_0xa429('0x24')](_0x1ff595);}return _0x4c0343['save']();};}function saveUpdates(_0x1c8388,_0x54210e){return function(_0x442bbe){if(_0x442bbe){return _0x442bbe[_0xa429('0x25')](_0x1c8388)['then'](function(_0x47c8c1){return _0x47c8c1;});}return null;};}function removeEntity(_0x5d422f,_0x321275){return function(_0x2edf3a){if(_0x2edf3a){return _0x2edf3a[_0xa429('0x26')]()[_0xa429('0x27')](function(){var _0x374998=_0x2edf3a['get']({'plain':!![]});var _0x58e426='CustomReports';return db[_0xa429('0x28')][_0xa429('0x26')]({'where':{'type':_0x58e426,'resourceId':_0x374998['id']}})[_0xa429('0x27')](function(){return _0x2edf3a;});})[_0xa429('0x27')](function(){_0x5d422f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50bbd9,_0x1df5fe){return function(_0x3e386d){if(!_0x3e386d){_0x50bbd9[_0xa429('0x19')](0x194);}return _0x3e386d;};}function handleError(_0x4026e5,_0x1552e2){_0x1552e2=_0x1552e2||0x1f4;return function(_0x316e5b){logger[_0xa429('0x29')](_0x316e5b[_0xa429('0x2a')]);if(_0x316e5b['name']){delete _0x316e5b[_0xa429('0x2b')];}_0x4026e5['status'](_0x1552e2)['send'](_0x316e5b);};}exports[_0xa429('0x2c')]=function(_0xc05a5e,_0x11bf84){var _0x9860aa={},_0x1244da={},_0x468d3c={'count':0x0,'rows':[]};var _0x368371=_['map'](db[_0xa429('0x2d')][_0xa429('0x2e')],function(_0x36884e){return{'name':_0x36884e[_0xa429('0x2f')],'type':_0x36884e[_0xa429('0x30')][_0xa429('0x31')]};});_0x1244da[_0xa429('0x32')]=_[_0xa429('0x33')](_0x368371,'name');_0x1244da[_0xa429('0x34')]=_[_0xa429('0x35')](_0xc05a5e[_0xa429('0x34')]);_0x1244da['filters']=_[_0xa429('0x36')](_0x1244da[_0xa429('0x32')],_0x1244da[_0xa429('0x34')]);_0x9860aa[_0xa429('0x37')]=_[_0xa429('0x36')](_0x1244da[_0xa429('0x32')],qs[_0xa429('0x38')](_0xc05a5e[_0xa429('0x34')]['fields']));_0x9860aa[_0xa429('0x37')]=_0x9860aa[_0xa429('0x37')][_0xa429('0x39')]?_0x9860aa[_0xa429('0x37')]:_0x1244da[_0xa429('0x32')];if(!_0xc05a5e[_0xa429('0x34')][_0xa429('0x3a')]('nolimit')){_0x9860aa[_0xa429('0x20')]=qs[_0xa429('0x20')](_0xc05a5e[_0xa429('0x34')][_0xa429('0x20')]);_0x9860aa[_0xa429('0x1f')]=qs[_0xa429('0x1f')](_0xc05a5e['query']['offset']);}_0x9860aa[_0xa429('0x3b')]=qs[_0xa429('0x3c')](_0xc05a5e[_0xa429('0x34')][_0xa429('0x3c')]);_0x9860aa[_0xa429('0x3d')]=qs[_0xa429('0x3e')](_[_0xa429('0x3f')](_0xc05a5e[_0xa429('0x34')],_0x1244da['filters']),_0x368371);if(_0xc05a5e[_0xa429('0x34')][_0xa429('0x40')]){_0x9860aa[_0xa429('0x3d')]=_['merge'](_0x9860aa[_0xa429('0x3d')],{'$or':_[_0xa429('0x33')](_0x368371,function(_0x28ab8f){if(_0x28ab8f[_0xa429('0x30')]!==_0xa429('0x41')){var _0x13fdcb={};_0x13fdcb[_0x28ab8f[_0xa429('0x2b')]]={'$like':'%'+_0xc05a5e[_0xa429('0x34')][_0xa429('0x40')]+'%'};return _0x13fdcb;}})});}_0x9860aa=_[_0xa429('0x42')]({},_0x9860aa,_0xc05a5e[_0xa429('0x43')]);var _0x10c741={'where':_0x9860aa[_0xa429('0x3d')]};return db[_0xa429('0x2d')][_0xa429('0x1e')](_0x10c741)[_0xa429('0x27')](function(_0x355390){_0x468d3c['count']=_0x355390;if(_0xc05a5e[_0xa429('0x34')][_0xa429('0x44')]){_0x9860aa[_0xa429('0x45')]=[{'all':!![]}];}return db[_0xa429('0x2d')]['findAll'](_0x9860aa);})['then'](function(_0x1eaec6){_0x468d3c['rows']=_0x1eaec6;return _0x468d3c;})['then'](respondWithFilteredResult(_0x11bf84,_0x9860aa))['catch'](handleError(_0x11bf84,null));};exports[_0xa429('0x46')]=function(_0x5d3df3,_0x1cfaa4){var _0x5f563b={'raw':![],'where':{'id':_0x5d3df3['params']['id']}},_0x287ba9={};_0x287ba9[_0xa429('0x32')]=_[_0xa429('0x35')](db['AnalyticCustomReport'][_0xa429('0x2e')]);_0x287ba9[_0xa429('0x34')]=_[_0xa429('0x35')](_0x5d3df3[_0xa429('0x34')]);_0x287ba9['filters']=_[_0xa429('0x36')](_0x287ba9['model'],_0x287ba9[_0xa429('0x34')]);_0x5f563b[_0xa429('0x37')]=_[_0xa429('0x36')](_0x287ba9[_0xa429('0x32')],qs['fields'](_0x5d3df3[_0xa429('0x34')]['fields']));_0x5f563b[_0xa429('0x37')]=_0x5f563b['attributes'][_0xa429('0x39')]?_0x5f563b[_0xa429('0x37')]:_0x287ba9[_0xa429('0x32')];if(_0x5d3df3[_0xa429('0x34')][_0xa429('0x44')]){_0x5f563b[_0xa429('0x45')]=[{'all':!![]}];}_0x5f563b=_['merge']({},_0x5f563b,_0x5d3df3[_0xa429('0x43')]);return db[_0xa429('0x2d')]['find'](_0x5f563b)[_0xa429('0x27')](handleEntityNotFound(_0x1cfaa4,null))[_0xa429('0x27')](respondWithResult(_0x1cfaa4,null))[_0xa429('0x47')](handleError(_0x1cfaa4,null));};exports['create']=function(_0x11fdcd,_0x172bda){return db[_0xa429('0x2d')][_0xa429('0x48')](_0x11fdcd[_0xa429('0x49')],{})[_0xa429('0x27')](function(_0x412ae0){var _0x5b30d6=_0x11fdcd[_0xa429('0x4a')][_0xa429('0x4b')]({'plain':!![]});if(!_0x5b30d6)throw new Error(_0xa429('0x4c'));if(_0x5b30d6[_0xa429('0x4d')]===_0xa429('0x4a')){var _0x335fb8=_0x412ae0['get']({'plain':!![]});var _0xb0ef14=_0xa429('0x4e');return db[_0xa429('0x4f')][_0xa429('0x50')]({'where':{'name':_0xb0ef14,'userProfileId':_0x5b30d6['userProfileId']},'raw':!![]})['then'](function(_0x5293c9){if(_0x5293c9&&_0x5293c9['autoAssociation']===0x0){return db['UserProfileResource'][_0xa429('0x48')]({'name':_0x335fb8['name'],'resourceId':_0x335fb8['id'],'type':_0xa429('0x51'),'sectionId':_0x5293c9['id']},{})[_0xa429('0x27')](function(){return _0x412ae0;});}else{return _0x412ae0;}})[_0xa429('0x47')](function(_0x22743e){logger[_0xa429('0x29')](_0xa429('0x52'),_0x22743e);throw _0x22743e;});}return _0x412ae0;})[_0xa429('0x27')](respondWithResult(_0x172bda,0xc9))['catch'](handleError(_0x172bda,null));};exports[_0xa429('0x25')]=function(_0x1b2c82,_0x194b66){if(_0x1b2c82[_0xa429('0x49')]['id']){delete _0x1b2c82[_0xa429('0x49')]['id'];}return db[_0xa429('0x2d')]['find']({'where':{'id':_0x1b2c82[_0xa429('0x53')]['id']}})[_0xa429('0x27')](handleEntityNotFound(_0x194b66,null))[_0xa429('0x27')](saveUpdates(_0x1b2c82[_0xa429('0x49')],null))[_0xa429('0x27')](respondWithResult(_0x194b66,null))[_0xa429('0x47')](handleError(_0x194b66,null));};exports[_0xa429('0x26')]=function(_0x4f0c60,_0x48ffd5){return db[_0xa429('0x2d')][_0xa429('0x50')]({'where':{'id':_0x4f0c60[_0xa429('0x53')]['id']}})[_0xa429('0x27')](handleEntityNotFound(_0x48ffd5,null))[_0xa429('0x27')](removeEntity(_0x48ffd5,null))['catch'](handleError(_0x48ffd5,null));};exports[_0xa429('0x54')]=function(_0x5b1148,_0x4b3160){var _0x504194=0xa;var _0x352b97=[_0xa429('0x55'),_0xa429('0x56'),_0xa429('0x57'),_0xa429('0x58')];var _0x52c701={'SUM':_0xa429('0x59'),'COUNT':_0xa429('0x5a'),'COUNT DISTINCT':_0xa429('0x5b'),'MAX':_0xa429('0x5c'),'MIN':_0xa429('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa429('0x5e'),'GROUP_CONCAT DESC':_0xa429('0x5f')};var _0x3fb7ca={'SEC_TO_TIME':_0xa429('0x60'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xa429('0x61'),'UNIX_TIMESTAMP':_0xa429('0x62')};var _0x3af073=function(_0x2584f7){return!_[_0xa429('0x63')]([_0xa429('0x64'),_0xa429('0x65'),_0xa429('0x66'),_0xa429('0x67')],_0x2584f7);};var _0x279f50=function(_0x5ebc3e){if(!_0x5ebc3e||!_0x5ebc3e[_0xa429('0x68')][_0xa429('0x39')]){return'';}for(var _0x100029='(',_0x220210=0x0;_0x220210<_0x5ebc3e[_0xa429('0x68')][_0xa429('0x39')];_0x220210+=0x1){_0x220210>0x0&&(_0x100029+='\x20'+_0x5ebc3e['operator']+'\x20');_0x100029+=_0x5ebc3e[_0xa429('0x68')][_0x220210][_0xa429('0x69')]?_0x279f50(_0x5ebc3e[_0xa429('0x68')][_0x220210]['group']):_0x5ebc3e[_0xa429('0x68')][_0x220210]['field']+'\x20'+_0x5ebc3e[_0xa429('0x68')][_0x220210][_0xa429('0x6a')]+(_0x3af073(_0x5ebc3e[_0xa429('0x68')][_0x220210][_0xa429('0x6a')])?'\x20'+_0x5ebc3e[_0xa429('0x68')][_0x220210][_0xa429('0x6b')]:'');}return _0x100029+')';};var _0x2d7cb1={'where':{'id':_0x5b1148[_0xa429('0x53')]['id']}},_0x4acbde,_0x463871,_0x1c6afa,_0x364e68,_0x1a2b16;_0x2d7cb1=_[_0xa429('0x42')]({},_0x2d7cb1,_0x5b1148[_0xa429('0x43')]);return db[_0xa429('0x2d')][_0xa429('0x50')](_0x2d7cb1)[_0xa429('0x27')](function(_0x3398cb){if(_0x3398cb){_0x4acbde=_0x3398cb;return _0x3398cb[_0xa429('0x6c')]();}return null;})['then'](function(_0x443ad9){if(_0x443ad9){if(!_0x443ad9[_0xa429('0x39')]){throw new db[(_0xa429('0x6d'))][(_0xa429('0x6e'))](_0xa429('0x6f'),0x193);}_0x463871=_0x443ad9;return db[_0xa429('0x70')][_0xa429('0x71')]({'raw':!![]});}return null;})[_0xa429('0x27')](function(_0x4c6bdc){if(_0x4c6bdc){_0x1c6afa=_[_0xa429('0x72')](_0x4c6bdc,'id');var _0x5948b2;var _0xe11587=squel[_0xa429('0x73')]();_0xe11587['from'](_0x4acbde[_0xa429('0x74')]);for(var _0x457de3=0x0;_0x457de3<_0x463871['length'];_0x457de3+=0x1){_0x5948b2=_0x463871[_0x457de3][_0xa429('0x75')]?_0x1c6afa[_0x463871[_0x457de3][_0xa429('0x75')]]['metric']:_0x463871[_0x457de3][_0xa429('0x76')];_0x5948b2=_0x463871[_0x457de3][_0xa429('0x77')]?_[_0xa429('0x78')](_0x52c701[_0x463871[_0x457de3][_0xa429('0x77')]],'%s',_0x5948b2):_0x5948b2;_0x5948b2=_0x463871[_0x457de3][_0xa429('0x79')]?_[_0xa429('0x78')](_0x3fb7ca[_0x463871[_0x457de3][_0xa429('0x79')]],'%s',_0x5948b2):_0x5948b2;if(_0x463871[_0x457de3][_0xa429('0x7a')]){_0xe11587['group'](_0x5948b2);}_0x463871[_0x457de3][_0xa429('0x7b')]&&_0xe11587[_0xa429('0x3b')](_0x5948b2,_0x463871[_0x457de3]['orderBy']==='DESC'?![]:!![]);_0xe11587[_0xa429('0x76')](_0x5948b2,_0x463871[_0x457de3]['alias']||_0x5948b2);}if(_0x4acbde['joins']){_0x4acbde['joins']=JSON[_0xa429('0x7c')](_0x4acbde['joins']);for(var _0x47237f=0x0;_0x47237f<_0x4acbde['joins'][_0xa429('0x39')];_0x47237f+=0x1){if(_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x30')]&&_['includes'](_0x352b97,_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x30')])&&_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x7e')]&&_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x7f')]&&_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x80')]){_0xe11587[_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x30')]](_0x4acbde[_0xa429('0x7d')][_0x47237f]['foreignTable'],null,util[_0xa429('0x79')]('%s.%s\x20=\x20%s.%s',_0x4acbde[_0xa429('0x74')],_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x7e')],_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x7f')],_0x4acbde[_0xa429('0x7d')][_0x47237f][_0xa429('0x80')]));}}}if(_0x4acbde[_0xa429('0x81')]){_0x4acbde[_0xa429('0x81')]=JSON['parse'](_0x4acbde[_0xa429('0x81')]);_0xe11587['where'](_0x279f50(_0x4acbde['conditions'][_0xa429('0x69')]));}_0x1a2b16=_0xe11587[_0xa429('0x82')]();_0xe11587[_0xa429('0x20')](_0x504194);_0xe11587[_0xa429('0x1f')](0x0);logger[_0xa429('0x83')]('Limited\x20Query:',_0xe11587[_0xa429('0x84')]());return dbH[_0xa429('0x85')][_0xa429('0x34')](_0xe11587[_0xa429('0x84')](),{'type':dbH[_0xa429('0x85')]['QueryTypes'][_0xa429('0x86')]});}})[_0xa429('0x27')](respondWithResult(_0x4b3160,null))[_0xa429('0x47')](handleError(_0x4b3160,null));};function runReport(_0x12531d,_0x5a87bc,_0x4df11a){var _0x4e7079=_0x5a87bc[_0xa429('0x2b')];var _0x2c4e35=0xa;var _0x30bedb=[_0xa429('0x55'),_0xa429('0x56'),_0xa429('0x57'),'cross_join'];var _0x539598={'SUM':_0xa429('0x59'),'COUNT':_0xa429('0x5a'),'COUNT DISTINCT':_0xa429('0x5b'),'MAX':_0xa429('0x5c'),'MIN':_0xa429('0x5d'),'AVG':_0xa429('0x87'),'GROUP_CONCAT':_0xa429('0x88'),'GROUP_CONCAT ASC':_0xa429('0x5e'),'GROUP_CONCAT DESC':_0xa429('0x5f')};var _0x2087d7={'SEC_TO_TIME':_0xa429('0x60'),'DATE':_0xa429('0x89'),'HOUR':'HOUR(%s)','ROUND':_0xa429('0x61'),'UNIX_TIMESTAMP':_0xa429('0x62')};var _0x15d658=function(_0x318fa7){return!_[_0xa429('0x63')]([_0xa429('0x64'),'IS\x20NOT\x20NULL',_0xa429('0x66'),_0xa429('0x67')],_0x318fa7);};var _0x20dfc4=function(_0x3d7e4b){if(!_0x3d7e4b||!_0x3d7e4b['rules'][_0xa429('0x39')]){return'';}for(var _0x551f00='(',_0x2d2392=0x0;_0x2d2392<_0x3d7e4b[_0xa429('0x68')][_0xa429('0x39')];_0x2d2392+=0x1){_0x2d2392>0x0&&(_0x551f00+='\x20'+_0x3d7e4b[_0xa429('0x8a')]+'\x20');_0x551f00+=_0x3d7e4b[_0xa429('0x68')][_0x2d2392]['group']?_0x20dfc4(_0x3d7e4b[_0xa429('0x68')][_0x2d2392][_0xa429('0x69')]):_0x3d7e4b[_0xa429('0x68')][_0x2d2392]['field']+'\x20'+_0x3d7e4b['rules'][_0x2d2392][_0xa429('0x6a')]+(_0x15d658(_0x3d7e4b['rules'][_0x2d2392][_0xa429('0x6a')])?'\x20'+_0x3d7e4b['rules'][_0x2d2392]['value']:'');}return _0x551f00+')';};var _0xca3956={'where':{'id':_0x12531d['id']}},_0x53efca,_0x4167d5,_0x2552e1,_0x49ec25,_0x5b0615;_0xca3956=_[_0xa429('0x42')]({},_0xca3956,_0x4df11a);return db['AnalyticCustomReport'][_0xa429('0x50')](_0xca3956)[_0xa429('0x27')](function(_0x2996ee){if(_0x2996ee){_0x53efca=_0x2996ee;return _0x2996ee[_0xa429('0x6c')]();}return null;})['then'](function(_0x1d433f){if(_0x1d433f){if(!_0x1d433f['length']){throw new db[(_0xa429('0x6d'))][(_0xa429('0x6e'))](_0xa429('0x6f'),0x193);}_0x4167d5=_0x1d433f;return db[_0xa429('0x70')][_0xa429('0x71')]({'raw':!![]});}return null;})[_0xa429('0x27')](function(_0x378ae1){if(_0x378ae1){_0x2552e1=_['keyBy'](_0x378ae1,'id');var _0x5839ed;var _0x55c4b0=squel[_0xa429('0x73')]();_0x55c4b0['from'](_0x53efca[_0xa429('0x74')]);for(var _0x6d882e=0x0;_0x6d882e<_0x4167d5['length'];_0x6d882e+=0x1){_0x5839ed=_0x4167d5[_0x6d882e]['MetricId']?_0x2552e1[_0x4167d5[_0x6d882e][_0xa429('0x75')]][_0xa429('0x8b')]:_0x4167d5[_0x6d882e]['field'];_0x5839ed=_0x4167d5[_0x6d882e][_0xa429('0x77')]?_[_0xa429('0x78')](_0x539598[_0x4167d5[_0x6d882e]['function']],'%s',_0x5839ed):_0x5839ed;_0x5839ed=_0x4167d5[_0x6d882e][_0xa429('0x79')]?_[_0xa429('0x78')](_0x2087d7[_0x4167d5[_0x6d882e][_0xa429('0x79')]],'%s',_0x5839ed):_0x5839ed;if(_0x4167d5[_0x6d882e][_0xa429('0x7a')]){_0x55c4b0[_0xa429('0x69')](_0x5839ed);}_0x4167d5[_0x6d882e][_0xa429('0x7b')]&&_0x55c4b0[_0xa429('0x3b')](_0x5839ed,_0x4167d5[_0x6d882e][_0xa429('0x7b')]==='DESC'?![]:!![]);_0x55c4b0[_0xa429('0x76')](_0x5839ed,_0x4167d5[_0x6d882e]['alias']||_0x5839ed);}if(_0x53efca[_0xa429('0x7d')]){_0x53efca[_0xa429('0x7d')]=JSON[_0xa429('0x7c')](_0x53efca['joins']);for(var _0x2cb328=0x0;_0x2cb328<_0x53efca['joins']['length'];_0x2cb328+=0x1){if(_0x53efca[_0xa429('0x7d')][_0x2cb328]['type']&&_[_0xa429('0x63')](_0x30bedb,_0x53efca[_0xa429('0x7d')][_0x2cb328][_0xa429('0x30')])&&_0x53efca['joins'][_0x2cb328][_0xa429('0x7e')]&&_0x53efca['joins'][_0x2cb328][_0xa429('0x7f')]&&_0x53efca['joins'][_0x2cb328][_0xa429('0x80')]){_0x55c4b0[_0x53efca[_0xa429('0x7d')][_0x2cb328][_0xa429('0x30')]](_0x53efca[_0xa429('0x7d')][_0x2cb328][_0xa429('0x7f')],null,util[_0xa429('0x79')]('%s.%s\x20=\x20%s.%s',_0x53efca[_0xa429('0x74')],_0x53efca[_0xa429('0x7d')][_0x2cb328][_0xa429('0x7e')],_0x53efca['joins'][_0x2cb328]['foreignTable'],_0x53efca[_0xa429('0x7d')][_0x2cb328]['foreignKey']));}}}if(_0x53efca[_0xa429('0x81')]){_0x53efca[_0xa429('0x81')]=JSON[_0xa429('0x7c')](_0x53efca['conditions']);_0x55c4b0[_0xa429('0x3d')](_0x20dfc4(_0x53efca[_0xa429('0x81')][_0xa429('0x69')]));}_0x5b0615=_0x55c4b0[_0xa429('0x82')]();_0x55c4b0[_0xa429('0x20')](_0x2c4e35);_0x55c4b0[_0xa429('0x1f')](0x0);return;}})[_0xa429('0x27')](function(){if(_0x5a87bc[_0xa429('0x8c')]==='web'){return null;}var _0x42e810=_[_0xa429('0x42')](_0x5a87bc,{'name':_0x5a87bc['fullPath']||_0x5a87bc['name']||_0x53efca[_0xa429('0x2b')],'basename':_0x4e7079,'savename':util[_0xa429('0x79')]('%s-%s.%s',_0x5a87bc[_0xa429('0x2b')]||_0x53efca[_0xa429('0x2b')],require('randomstring')[_0xa429('0x8d')](0x4),_0x5a87bc[_0xa429('0x8c')]||_0xa429('0x8e')),'reportId':_0x53efca['id'],'reportType':_0xa429('0x8f')});return db[_0xa429('0x90')][_0xa429('0x48')](_0x42e810,{'raw':!![]});})[_0xa429('0x27')](function(_0x57008c){if(_0x53efca[_0xa429('0x74')]===_0xa429('0x91')){_0x5b0615['where'](_0x53efca['table']+_0xa429('0x92'),_0x5a87bc[_0xa429('0x93')],_0x5a87bc['endDate']);}else{_0x5b0615[_0xa429('0x3d')](_0x53efca[_0xa429('0x74')]+_0xa429('0x94'),_0x5a87bc[_0xa429('0x93')],_0x5a87bc[_0xa429('0x95')]);}if(_0x57008c){logger[_0xa429('0x96')](_0xa429('0x97'),_0x5b0615['toString']());require(_0xa429('0x98'))[_0xa429('0x99')](path[_0xa429('0x55')](__dirname,_0xa429('0x9a'),_0x57008c[_0xa429('0x8c')]),[_0x57008c['id'],_0x5b0615[_0xa429('0x84')](),path[_0xa429('0x55')](__dirname,_0xa429('0x9b'),_0x57008c[_0xa429('0x9c')]),_0x4e7079]);return _0x57008c;}else{var _0x2385c4=squel[_0xa429('0x73')]();_0x2385c4[_0xa429('0x9d')]('('+_0x5b0615['toString']()+')',_0xa429('0x9e'));_0x2385c4[_0xa429('0x76')](_0xa429('0x9f'),'count');_0x5b0615[_0xa429('0x20')](_0x5a87bc[_0xa429('0x20')]||_0x2c4e35);_0x5b0615[_0xa429('0x1f')](_0x5a87bc[_0xa429('0x1f')]||0x0);return dbH[_0xa429('0x85')]['query'](_0x2385c4[_0xa429('0x84')](),{'type':dbH[_0xa429('0x85')][_0xa429('0xa0')][_0xa429('0x86')]})[_0xa429('0x27')](function(_0x12a745){if(!_0x12a745[_0xa429('0x39')]){_0x49ec25=0x0;}else{_0x49ec25=_0x12a745[0x0][_0xa429('0x1e')]||0x0;}return dbH[_0xa429('0x85')][_0xa429('0x34')](_0x5b0615[_0xa429('0x84')](),{'type':dbH[_0xa429('0x85')][_0xa429('0xa0')]['SELECT']});})['then'](function(_0x2b2cc2){return{'rows':_0x2b2cc2||[],'count':_0x49ec25};});}});}exports['run']=function(_0x4dec95,_0x26c027){return runReport(_0x4dec95['params'],_0x4dec95['query'],_0x4dec95[_0xa429('0x43')])[_0xa429('0x27')](respondWithResult(_0x26c027,null))[_0xa429('0x47')](handleError(_0x26c027,null));};exports[_0xa429('0xa1')]=runReport;exports[_0xa429('0x34')]=function(_0x9e76dd,_0x14efd8){var _0x4f99bd=0xa;var _0x599b85=[_0xa429('0x55'),'left_join',_0xa429('0x57'),'cross_join'];var _0x1e04be={'SUM':'SUM(%s)','COUNT':_0xa429('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xa429('0x88'),'GROUP_CONCAT ASC':_0xa429('0x5e'),'GROUP_CONCAT DESC':_0xa429('0x5f')};var _0x4210db={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xa429('0x61'),'UNIX_TIMESTAMP':_0xa429('0x62')};var _0x33261e=function(_0x4d2852){return!_[_0xa429('0x63')]([_0xa429('0x64'),_0xa429('0x65'),_0xa429('0x66'),_0xa429('0x67')],_0x4d2852);};var _0x2e4b99=function(_0x22b305){if(!_0x22b305||!_0x22b305[_0xa429('0x68')][_0xa429('0x39')]){return'';}for(var _0x2a8254='(',_0x53b32d=0x0;_0x53b32d<_0x22b305['rules'][_0xa429('0x39')];_0x53b32d+=0x1){_0x53b32d>0x0&&(_0x2a8254+='\x20'+_0x22b305['operator']+'\x20');_0x2a8254+=_0x22b305[_0xa429('0x68')][_0x53b32d][_0xa429('0x69')]?_0x2e4b99(_0x22b305['rules'][_0x53b32d][_0xa429('0x69')]):_0x22b305[_0xa429('0x68')][_0x53b32d]['field']+'\x20'+_0x22b305['rules'][_0x53b32d]['condition']+(_0x33261e(_0x22b305[_0xa429('0x68')][_0x53b32d]['condition'])?'\x20'+_0x22b305['rules'][_0x53b32d][_0xa429('0x6b')]:'');}return _0x2a8254+')';};var _0x1d912d={'where':{'id':_0x9e76dd[_0xa429('0x53')]['id']}},_0x5679fb,_0x31ced9,_0x180df9,_0x51c36c,_0x2706cb;_0x1d912d=_[_0xa429('0x42')]({},_0x1d912d,_0x9e76dd['options']);return db['AnalyticCustomReport'][_0xa429('0x50')](_0x1d912d)[_0xa429('0x27')](function(_0x3f3b46){if(_0x3f3b46){_0x5679fb=_0x3f3b46;return _0x3f3b46['getFields']();}return null;})[_0xa429('0x27')](function(_0x5bf2e0){if(_0x5bf2e0){if(!_0x5bf2e0[_0xa429('0x39')]){throw new db[(_0xa429('0x6d'))][(_0xa429('0x6e'))](_0xa429('0x6f'),0x193);}_0x31ced9=_0x5bf2e0;return db[_0xa429('0x70')][_0xa429('0x71')]({'raw':!![]});}return null;})[_0xa429('0x27')](function(_0x4ad287){if(_0x4ad287){_0x180df9=_[_0xa429('0x72')](_0x4ad287,'id');var _0xbdde9f;var _0x5c310d=squel[_0xa429('0x73')]();_0x5c310d[_0xa429('0x9d')](_0x5679fb['table']);for(var _0x221ea6=0x0;_0x221ea6<_0x31ced9[_0xa429('0x39')];_0x221ea6+=0x1){_0xbdde9f=_0x31ced9[_0x221ea6][_0xa429('0x75')]?_0x180df9[_0x31ced9[_0x221ea6][_0xa429('0x75')]]['metric']:_0x31ced9[_0x221ea6][_0xa429('0x76')];_0xbdde9f=_0x31ced9[_0x221ea6][_0xa429('0x77')]?_['replace'](_0x1e04be[_0x31ced9[_0x221ea6][_0xa429('0x77')]],'%s',_0xbdde9f):_0xbdde9f;_0xbdde9f=_0x31ced9[_0x221ea6][_0xa429('0x79')]?_[_0xa429('0x78')](_0x4210db[_0x31ced9[_0x221ea6]['format']],'%s',_0xbdde9f):_0xbdde9f;if(_0x31ced9[_0x221ea6][_0xa429('0x7a')]){_0x5c310d['group'](_0xbdde9f);}_0x31ced9[_0x221ea6][_0xa429('0x7b')]&&_0x5c310d[_0xa429('0x3b')](_0xbdde9f,_0x31ced9[_0x221ea6]['orderBy']===_0xa429('0xa2')?![]:!![]);_0x5c310d[_0xa429('0x76')](_0xbdde9f,_0x31ced9[_0x221ea6][_0xa429('0xa3')]||_0xbdde9f);}if(_0x5679fb[_0xa429('0x7d')]){_0x5679fb[_0xa429('0x7d')]=JSON[_0xa429('0x7c')](_0x5679fb[_0xa429('0x7d')]);for(var _0x337304=0x0;_0x337304<_0x5679fb[_0xa429('0x7d')][_0xa429('0x39')];_0x337304+=0x1){if(_0x5679fb['joins'][_0x337304]['type']&&_[_0xa429('0x63')](_0x599b85,_0x5679fb[_0xa429('0x7d')][_0x337304][_0xa429('0x30')])&&_0x5679fb[_0xa429('0x7d')][_0x337304][_0xa429('0x7e')]&&_0x5679fb[_0xa429('0x7d')][_0x337304]['foreignTable']&&_0x5679fb['joins'][_0x337304]['foreignKey']){_0x5c310d[_0x5679fb['joins'][_0x337304][_0xa429('0x30')]](_0x5679fb[_0xa429('0x7d')][_0x337304][_0xa429('0x7f')],null,util['format'](_0xa429('0xa4'),_0x5679fb['table'],_0x5679fb[_0xa429('0x7d')][_0x337304][_0xa429('0x7e')],_0x5679fb['joins'][_0x337304]['foreignTable'],_0x5679fb[_0xa429('0x7d')][_0x337304][_0xa429('0x80')]));}}}if(_0x5679fb[_0xa429('0x81')]){_0x5679fb['conditions']=JSON[_0xa429('0x7c')](_0x5679fb[_0xa429('0x81')]);_0x5c310d[_0xa429('0x3d')](_0x2e4b99(_0x5679fb[_0xa429('0x81')][_0xa429('0x69')]));}_0x2706cb=_0x5c310d['clone']();_0x5c310d[_0xa429('0x20')](_0x4f99bd);_0x5c310d[_0xa429('0x1f')](0x0);logger[_0xa429('0x83')](_0xa429('0xa5'),_0x5c310d[_0xa429('0x84')]());return dbH[_0xa429('0x85')][_0xa429('0x34')](_0x5c310d[_0xa429('0x84')](),{'type':dbH[_0xa429('0x85')][_0xa429('0xa0')][_0xa429('0x86')]});}})[_0xa429('0x27')](function(){return{'sql':_0x2706cb[_0xa429('0x84')]()};})[_0xa429('0x27')](respondWithResult(_0x14efd8,null))[_0xa429('0x47')](handleError(_0x14efd8,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 51565f7..1f22f12 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 _0xfd5f=['bluebird','request-promise','rimraf','./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0x1da46d,_0x41ce26){var _0x463df9=function(_0x3788e7){while(--_0x3788e7){_0x1da46d['push'](_0x1da46d['shift']());}};_0x463df9(++_0x41ce26);}(_0xfd5f,0xb6));var _0xffd5=function(_0x49a8f0,_0x525c1a){_0x49a8f0=_0x49a8f0-0x0;var _0x318193=_0xfd5f[_0x49a8f0];return _0x318193;};'use strict';var _=require(_0xffd5('0x0'));var util=require(_0xffd5('0x1'));var logger=require(_0xffd5('0x2'))(_0xffd5('0x3'));var moment=require(_0xffd5('0x4'));var BPromise=require(_0xffd5('0x5'));var rp=require(_0xffd5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffd5('0x7'));var config=require('../../config/environment');var attributes=require(_0xffd5('0x8'));module[_0xffd5('0x9')]=function(_0x2c701e,_0xda0a1d){return _0x2c701e['define']('AnalyticCustomReport',attributes,{'tableName':_0xffd5('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb15a=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x244861,_0x1d0b73){var _0x346b31=function(_0x57d4d4){while(--_0x57d4d4){_0x244861['push'](_0x244861['shift']());}};_0x346b31(++_0x1d0b73);}(_0xb15a,0xc3));var _0xab15=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0xb15a[_0x9edfd5];return _0x330738;};'use strict';var _=require(_0xab15('0x0'));var util=require(_0xab15('0x1'));var logger=require(_0xab15('0x2'))('api');var moment=require(_0xab15('0x3'));var BPromise=require(_0xab15('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab15('0x5'));var config=require(_0xab15('0x6'));var attributes=require(_0xab15('0x7'));module[_0xab15('0x8')]=function(_0x568857,_0x29913c){return _0x568857[_0xab15('0x9')](_0xab15('0xa'),attributes,{'tableName':_0xab15('0xb'),'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 e5b03b2..29b57c4 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 _0xd5a8=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../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'];(function(_0x20f9b9,_0x472933){var _0x5815d4=function(_0x5d9e15){while(--_0x5d9e15){_0x20f9b9['push'](_0x20f9b9['shift']());}};_0x5815d4(++_0x472933);}(_0xd5a8,0x194));var _0x8d5a=function(_0x173ad1,_0xb69870){_0x173ad1=_0x173ad1-0x0;var _0x202363=_0xd5a8[_0x173ad1];return _0x202363;};'use strict';var _=require(_0x8d5a('0x0'));var util=require(_0x8d5a('0x1'));var moment=require(_0x8d5a('0x2'));var BPromise=require(_0x8d5a('0x3'));var rs=require(_0x8d5a('0x4'));var fs=require('fs');var Redis=require(_0x8d5a('0x5'));var db=require(_0x8d5a('0x6'))['db'];var utils=require(_0x8d5a('0x7'));var logger=require(_0x8d5a('0x8'))('rpc');var config=require(_0x8d5a('0x9'));var jayson=require(_0x8d5a('0xa'));var client=jayson[_0x8d5a('0xb')][_0x8d5a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ef7a8,_0x3837fe,_0xbbfb66){return new BPromise(function(_0x2fcbae,_0x3cbfdb){return client[_0x8d5a('0xd')](_0x5ef7a8,_0xbbfb66)[_0x8d5a('0xe')](function(_0x4475a1){logger[_0x8d5a('0xf')](_0x8d5a('0x10'),_0x3837fe,_0x8d5a('0x11'));logger[_0x8d5a('0x12')](_0x8d5a('0x13'),_0x3837fe,'request\x20sent',JSON[_0x8d5a('0x14')](_0x4475a1));if(_0x4475a1[_0x8d5a('0x15')]){if(_0x4475a1[_0x8d5a('0x15')][_0x8d5a('0x16')]===0x1f4){logger[_0x8d5a('0x15')](_0x8d5a('0x10'),_0x3837fe,_0x4475a1[_0x8d5a('0x15')][_0x8d5a('0x17')]);return _0x3cbfdb(_0x4475a1['error']['message']);}logger[_0x8d5a('0x15')](_0x8d5a('0x10'),_0x3837fe,_0x4475a1[_0x8d5a('0x15')][_0x8d5a('0x17')]);return _0x2fcbae(_0x4475a1['error'][_0x8d5a('0x17')]);}else{logger[_0x8d5a('0xf')](_0x8d5a('0x10'),_0x3837fe,_0x8d5a('0x11'));_0x2fcbae(_0x4475a1[_0x8d5a('0x18')][_0x8d5a('0x17')]);}})['catch'](function(_0x24190e){logger['error'](_0x8d5a('0x10'),_0x3837fe,_0x24190e);_0x3cbfdb(_0x24190e);});});} \ No newline at end of file +var _0xae6f=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x179bd3,_0x45614a){var _0x1d1d04=function(_0x39e455){while(--_0x39e455){_0x179bd3['push'](_0x179bd3['shift']());}};_0x1d1d04(++_0x45614a);}(_0xae6f,0x130));var _0xfae6=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xae6f[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xfae6('0x0'));var util=require(_0xfae6('0x1'));var moment=require(_0xfae6('0x2'));var BPromise=require('bluebird');var rs=require(_0xfae6('0x3'));var fs=require('fs');var Redis=require(_0xfae6('0x4'));var db=require(_0xfae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfae6('0x6'))(_0xfae6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfae6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x113463,_0x2bd3bb,_0x1da579){return new BPromise(function(_0x4926a6,_0x3aa50a){return client['request'](_0x113463,_0x1da579)[_0xfae6('0x9')](function(_0x144858){logger[_0xfae6('0xa')](_0xfae6('0xb'),_0x2bd3bb,_0xfae6('0xc'));logger[_0xfae6('0xd')](_0xfae6('0xe'),_0x2bd3bb,'request\x20sent',JSON[_0xfae6('0xf')](_0x144858));if(_0x144858[_0xfae6('0x10')]){if(_0x144858[_0xfae6('0x10')]['code']===0x1f4){logger['error'](_0xfae6('0xb'),_0x2bd3bb,_0x144858[_0xfae6('0x10')][_0xfae6('0x11')]);return _0x3aa50a(_0x144858['error'][_0xfae6('0x11')]);}logger[_0xfae6('0x10')](_0xfae6('0xb'),_0x2bd3bb,_0x144858[_0xfae6('0x10')][_0xfae6('0x11')]);return _0x4926a6(_0x144858['error']['message']);}else{logger['info'](_0xfae6('0xb'),_0x2bd3bb,'request\x20sent');_0x4926a6(_0x144858[_0xfae6('0x12')][_0xfae6('0x11')]);}})[_0xfae6('0x13')](function(_0x5ec01d){logger['error'](_0xfae6('0xb'),_0x2bd3bb,_0x5ec01d);_0x3aa50a(_0x5ec01d);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 1c469b8..d9c4264 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 _0xe1f8=['get','isAuthenticated','index','show','/:id/preview','preview','query','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller'];(function(_0x31aa2e,_0x16c6ed){var _0x2f57f0=function(_0x1111d4){while(--_0x1111d4){_0x31aa2e['push'](_0x31aa2e['shift']());}};_0x2f57f0(++_0x16c6ed);}(_0xe1f8,0xf4));var _0x8e1f=function(_0x3563a1,_0x38e0ad){_0x3563a1=_0x3563a1-0x0;var _0x3fbe20=_0xe1f8[_0x3563a1];return _0x3fbe20;};'use strict';var multer=require(_0x8e1f('0x0'));var util=require(_0x8e1f('0x1'));var path=require(_0x8e1f('0x2'));var timeout=require(_0x8e1f('0x3'));var express=require('express');var router=express[_0x8e1f('0x4')]();var fs_extra=require(_0x8e1f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e1f('0x6'));var config=require('../../config/environment');var controller=require(_0x8e1f('0x7'));router[_0x8e1f('0x8')]('/',auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xa')]);router[_0x8e1f('0x8')]('/:id',auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xb')]);router[_0x8e1f('0x8')](_0x8e1f('0xc'),auth[_0x8e1f('0x9')](),controller[_0x8e1f('0xd')]);router[_0x8e1f('0x8')]('/:id/run',auth[_0x8e1f('0x9')](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x8e1f('0xe')]);router[_0x8e1f('0xf')]('/',auth[_0x8e1f('0x9')](),controller['create']);router[_0x8e1f('0x10')](_0x8e1f('0x11'),auth[_0x8e1f('0x9')](),controller[_0x8e1f('0x12')]);router['delete'](_0x8e1f('0x11'),auth[_0x8e1f('0x9')](),controller[_0x8e1f('0x13')]);module[_0x8e1f('0x14')]=router; \ No newline at end of file +var _0xb149=['run','/:id/query','query','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run'];(function(_0x2c29c1,_0x44e05e){var _0x23ab89=function(_0x31ae89){while(--_0x31ae89){_0x2c29c1['push'](_0x2c29c1['shift']());}};_0x23ab89(++_0x44e05e);}(_0xb149,0xd9));var _0x9b14=function(_0x5b080b,_0xe34631){_0x5b080b=_0x5b080b-0x0;var _0x3d724c=_0xb149[_0x5b080b];return _0x3d724c;};'use strict';var multer=require(_0x9b14('0x0'));var util=require(_0x9b14('0x1'));var path=require(_0x9b14('0x2'));var timeout=require(_0x9b14('0x3'));var express=require(_0x9b14('0x4'));var router=express[_0x9b14('0x5')]();var fs_extra=require(_0x9b14('0x6'));var auth=require(_0x9b14('0x7'));var interaction=require(_0x9b14('0x8'));var config=require(_0x9b14('0x9'));var controller=require(_0x9b14('0xa'));router[_0x9b14('0xb')]('/',auth[_0x9b14('0xc')](),controller[_0x9b14('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9b14('0xb')](_0x9b14('0xe'),auth[_0x9b14('0xc')](),controller[_0x9b14('0xf')]);router[_0x9b14('0xb')](_0x9b14('0x10'),auth[_0x9b14('0xc')](),controller[_0x9b14('0x11')]);router[_0x9b14('0xb')](_0x9b14('0x12'),auth[_0x9b14('0xc')](),controller[_0x9b14('0x13')]);router[_0x9b14('0x14')]('/',auth[_0x9b14('0xc')](),controller[_0x9b14('0x15')]);router['put'](_0x9b14('0x16'),auth[_0x9b14('0xc')](),controller[_0x9b14('0x17')]);router[_0x9b14('0x18')](_0x9b14('0x16'),auth['isAuthenticated'](),controller[_0x9b14('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 51fb022..cc57728 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 _0xda19=['exports','STRING','TEXT'];(function(_0x36f5af,_0x40f484){var _0x430004=function(_0x37fe84){while(--_0x37fe84){_0x36f5af['push'](_0x36f5af['shift']());}};_0x430004(++_0x40f484);}(_0xda19,0xd5));var _0x9da1=function(_0x369b03,_0x59f4e7){_0x369b03=_0x369b03-0x0;var _0x1c693e=_0xda19[_0x369b03];return _0x1c693e;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2eb2=['TEXT','exports','STRING'];(function(_0x48bae4,_0x3502fe){var _0x210760=function(_0x3b273e){while(--_0x3b273e){_0x48bae4['push'](_0x48bae4['shift']());}};_0x210760(++_0x3502fe);}(_0x2eb2,0x19f));var _0x22eb=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x2eb2[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index c973a70..eb9ef4a 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x203357,_0x21c97e){var _0x255385=function(_0x1de374){while(--_0x1de374){_0x203357['push'](_0x203357['shift']());}};_0x255385(++_0x21c97e);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file +var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0xaa7fe0,_0x16f24a){var _0x13dfc7=function(_0x3d37e9){while(--_0x3d37e9){_0xaa7fe0['push'](_0xaa7fe0['shift']());}};_0x13dfc7(++_0x16f24a);}(_0x53ec,0x192));var _0xc53e=function(_0x2d398b,_0x5e98f8){_0x2d398b=_0x2d398b-0x0;var _0x5d8b9d=_0x53ec[_0x2d398b];return _0x5d8b9d;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 700b12a..cf7c1dc 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 _0xa029=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','lodash','util','../../config/logger','api'];(function(_0x392412,_0x20fd5c){var _0x1b417c=function(_0x5566a2){while(--_0x5566a2){_0x392412['push'](_0x392412['shift']());}};_0x1b417c(++_0x20fd5c);}(_0xa029,0x1a0));var _0x9a02=function(_0x22d7ee,_0x395978){_0x22d7ee=_0x22d7ee-0x0;var _0x5989ac=_0xa029[_0x22d7ee];return _0x5989ac;};'use strict';var _=require(_0x9a02('0x0'));var util=require(_0x9a02('0x1'));var logger=require(_0x9a02('0x2'))(_0x9a02('0x3'));var moment=require('moment');var BPromise=require(_0x9a02('0x4'));var rp=require(_0x9a02('0x5'));var fs=require('fs');var path=require(_0x9a02('0x6'));var rimraf=require(_0x9a02('0x7'));var config=require(_0x9a02('0x8'));var attributes=require(_0x9a02('0x9'));module['exports']=function(_0x118d37,_0x20f584){return _0x118d37[_0x9a02('0xa')](_0x9a02('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1df3=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4d93ce,_0x25da93){var _0x4472cb=function(_0x2cc32d){while(--_0x2cc32d){_0x4d93ce['push'](_0x4d93ce['shift']());}};_0x4472cb(++_0x25da93);}(_0x1df3,0xda));var _0x31df=function(_0x4d028d,_0x53ee60){_0x4d028d=_0x4d028d-0x0;var _0x177fb9=_0x1df3[_0x4d028d];return _0x177fb9;};'use strict';var _=require(_0x31df('0x0'));var util=require(_0x31df('0x1'));var logger=require(_0x31df('0x2'))(_0x31df('0x3'));var moment=require('moment');var BPromise=require(_0x31df('0x4'));var rp=require(_0x31df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31df('0x6'));var config=require(_0x31df('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x31df('0x8')]=function(_0x34ef12,_0x4dcf6a){return _0x34ef12[_0x31df('0x9')](_0x31df('0xa'),attributes,{'tableName':_0x31df('0xb'),'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 f3eaaf1..e3bb26e 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 _0xd956=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x5448a0,_0x4b7e59){var _0x3c93e7=function(_0x307282){while(--_0x307282){_0x5448a0['push'](_0x5448a0['shift']());}};_0x3c93e7(++_0x4b7e59);}(_0xd956,0x182));var _0x6d95=function(_0x3fc3ef,_0x46c08f){_0x3fc3ef=_0x3fc3ef-0x0;var _0x59e8c9=_0xd956[_0x3fc3ef];return _0x59e8c9;};'use strict';var _=require(_0x6d95('0x0'));var util=require('util');var moment=require(_0x6d95('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d95('0x2'));var db=require(_0x6d95('0x3'))['db'];var utils=require(_0x6d95('0x4'));var logger=require(_0x6d95('0x5'))(_0x6d95('0x6'));var config=require(_0x6d95('0x7'));var jayson=require(_0x6d95('0x8'));var client=jayson['client'][_0x6d95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38aac4,_0x469648,_0xd2fa2f){return new BPromise(function(_0x2464c0,_0x2abd41){return client[_0x6d95('0xa')](_0x38aac4,_0xd2fa2f)[_0x6d95('0xb')](function(_0x825568){logger['info'](_0x6d95('0xc'),_0x469648,'request\x20sent');logger[_0x6d95('0xd')](_0x6d95('0xe'),_0x469648,_0x6d95('0xf'),JSON[_0x6d95('0x10')](_0x825568));if(_0x825568[_0x6d95('0x11')]){if(_0x825568[_0x6d95('0x11')][_0x6d95('0x12')]===0x1f4){logger[_0x6d95('0x11')](_0x6d95('0xc'),_0x469648,_0x825568[_0x6d95('0x11')]['message']);return _0x2abd41(_0x825568[_0x6d95('0x11')][_0x6d95('0x13')]);}logger[_0x6d95('0x11')](_0x6d95('0xc'),_0x469648,_0x825568[_0x6d95('0x11')]['message']);return _0x2464c0(_0x825568['error']['message']);}else{logger[_0x6d95('0x14')](_0x6d95('0xc'),_0x469648,_0x6d95('0xf'));_0x2464c0(_0x825568[_0x6d95('0x15')][_0x6d95('0x13')]);}})[_0x6d95('0x16')](function(_0xfa0dd8){logger[_0x6d95('0x11')](_0x6d95('0xc'),_0x469648,_0xfa0dd8);_0x2abd41(_0xfa0dd8);});});} \ No newline at end of file +var _0x12f9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis'];(function(_0x40d70a,_0x3c194d){var _0x28c886=function(_0x2dbf3d){while(--_0x2dbf3d){_0x40d70a['push'](_0x40d70a['shift']());}};_0x28c886(++_0x3c194d);}(_0x12f9,0x1a1));var _0x912f=function(_0x18816b,_0x360c87){_0x18816b=_0x18816b-0x0;var _0x302d9a=_0x12f9[_0x18816b];return _0x302d9a;};'use strict';var _=require(_0x912f('0x0'));var util=require('util');var moment=require(_0x912f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x912f('0x2'));var db=require(_0x912f('0x3'))['db'];var utils=require(_0x912f('0x4'));var logger=require(_0x912f('0x5'))(_0x912f('0x6'));var config=require(_0x912f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x912f('0x8')][_0x912f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf4b196,_0x30d0e4,_0x4372e0){return new BPromise(function(_0x3c2470,_0x551a5f){return client[_0x912f('0xa')](_0xf4b196,_0x4372e0)['then'](function(_0x1e99ed){logger[_0x912f('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x30d0e4,'request\x20sent');logger['debug'](_0x912f('0xc'),_0x30d0e4,_0x912f('0xd'),JSON[_0x912f('0xe')](_0x1e99ed));if(_0x1e99ed[_0x912f('0xf')]){if(_0x1e99ed[_0x912f('0xf')][_0x912f('0x10')]===0x1f4){logger[_0x912f('0xf')](_0x912f('0x11'),_0x30d0e4,_0x1e99ed['error'][_0x912f('0x12')]);return _0x551a5f(_0x1e99ed[_0x912f('0xf')][_0x912f('0x12')]);}logger[_0x912f('0xf')](_0x912f('0x11'),_0x30d0e4,_0x1e99ed[_0x912f('0xf')][_0x912f('0x12')]);return _0x3c2470(_0x1e99ed[_0x912f('0xf')][_0x912f('0x12')]);}else{logger[_0x912f('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x30d0e4,'request\x20sent');_0x3c2470(_0x1e99ed[_0x912f('0x13')][_0x912f('0x12')]);}})[_0x912f('0x14')](function(_0x336b86){logger[_0x912f('0xf')](_0x912f('0x11'),_0x30d0e4,_0x336b86);_0x551a5f(_0x336b86);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 8750001..0d9e082 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 _0x77f1=['delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x77f1,0x13e));var _0x177f=function(_0x20f16e,_0x4f661f){_0x20f16e=_0x20f16e-0x0;var _0xa32be4=_0x77f1[_0x20f16e];return _0xa32be4;};'use strict';var multer=require('multer');var util=require(_0x177f('0x0'));var path=require('path');var timeout=require(_0x177f('0x1'));var express=require('express');var router=express[_0x177f('0x2')]();var fs_extra=require(_0x177f('0x3'));var auth=require(_0x177f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x177f('0x5')](),controller[_0x177f('0x6')]);router[_0x177f('0x7')](_0x177f('0x8'),auth[_0x177f('0x5')](),controller[_0x177f('0x9')]);router[_0x177f('0x7')](_0x177f('0xa'),auth[_0x177f('0x5')](),controller[_0x177f('0xb')]);router[_0x177f('0x7')](_0x177f('0xc'),auth[_0x177f('0x5')](),controller[_0x177f('0xd')]);router[_0x177f('0x7')](_0x177f('0xe'),auth['isAuthenticated'](),controller[_0x177f('0xf')]);router['post']('/',auth[_0x177f('0x5')](),controller[_0x177f('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x177f('0x11')]);router[_0x177f('0x12')](_0x177f('0x8'),auth[_0x177f('0x5')](),controller[_0x177f('0x13')]);module[_0x177f('0x14')]=router; \ No newline at end of file +var _0x4471=['delete','/:id','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run','run','query','post','put','update'];(function(_0x37cfb6,_0x4a9b59){var _0x5390ed=function(_0x506f0c){while(--_0x506f0c){_0x37cfb6['push'](_0x37cfb6['shift']());}};_0x5390ed(++_0x4a9b59);}(_0x4471,0x179));var _0x1447=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4471[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x1447('0x0'));var util=require('util');var path=require(_0x1447('0x1'));var timeout=require(_0x1447('0x2'));var express=require('express');var router=express[_0x1447('0x3')]();var fs_extra=require(_0x1447('0x4'));var auth=require(_0x1447('0x5'));var interaction=require(_0x1447('0x6'));var config=require('../../config/environment');var controller=require(_0x1447('0x7'));router[_0x1447('0x8')]('/',auth[_0x1447('0x9')](),controller[_0x1447('0xa')]);router[_0x1447('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1447('0x8')](_0x1447('0xb'),auth[_0x1447('0x9')](),controller[_0x1447('0xc')]);router['get'](_0x1447('0xd'),auth['isAuthenticated'](),controller[_0x1447('0xe')]);router[_0x1447('0x8')]('/:id/query',auth[_0x1447('0x9')](),controller[_0x1447('0xf')]);router[_0x1447('0x10')]('/',auth[_0x1447('0x9')](),controller['create']);router[_0x1447('0x11')]('/:id',auth[_0x1447('0x9')](),controller[_0x1447('0x12')]);router[_0x1447('0x13')](_0x1447('0x14'),auth[_0x1447('0x9')](),controller['destroy']);module[_0x1447('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index c924389..0022d1b 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 _0x0743=['UNSIGNED','sequelize','moment','STRING','ENUM','csv','DATE','Loading','manual','INTEGER'];(function(_0x536c66,_0x570b6b){var _0x221d57=function(_0x34af51){while(--_0x34af51){_0x536c66['push'](_0x536c66['shift']());}};_0x221d57(++_0x570b6b);}(_0x0743,0x173));var _0x3074=function(_0x43cd49,_0x5e851b){_0x43cd49=_0x43cd49-0x0;var _0x21c57a=_0x0743[_0x43cd49];return _0x21c57a;};'use strict';var Sequelize=require(_0x3074('0x0'));var moment=require(_0x3074('0x1'));module['exports']={'name':{'type':Sequelize[_0x3074('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3074('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3074('0x3')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x3074('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x3074('0x5')]},'endDate':{'type':Sequelize[_0x3074('0x5')]},'status':{'type':Sequelize[_0x3074('0x2')],'defaultValue':_0x3074('0x6')},'type':{'type':Sequelize[_0x3074('0x3')](_0x3074('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x3074('0x8')](0xb)[_0x3074('0x9')]},'reportType':{'type':Sequelize[_0x3074('0x2')]}}; \ No newline at end of file +var _0xda59=['UNSIGNED','sequelize','moment','exports','csv','xlsx','STRING','DATE','Loading','ENUM','manual','scheduled'];(function(_0x7d5a8b,_0x2aedef){var _0x56ac46=function(_0x55a1ab){while(--_0x55a1ab){_0x7d5a8b['push'](_0x7d5a8b['shift']());}};_0x56ac46(++_0x2aedef);}(_0xda59,0xd9));var _0x9da5=function(_0x2995f7,_0x58858b){_0x2995f7=_0x2995f7-0x0;var _0x2810b5=_0xda59[_0x2995f7];return _0x2810b5;};'use strict';var Sequelize=require(_0x9da5('0x0'));var moment=require(_0x9da5('0x1'));module[_0x9da5('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x9da5('0x3'),'pdf',_0x9da5('0x4')),'allowNull':![],'defaultValue':_0x9da5('0x3')},'savename':{'type':Sequelize[_0x9da5('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9da5('0x6')]},'endDate':{'type':Sequelize[_0x9da5('0x6')]},'status':{'type':Sequelize[_0x9da5('0x5')],'defaultValue':_0x9da5('0x7')},'type':{'type':Sequelize[_0x9da5('0x8')](_0x9da5('0x9'),_0x9da5('0xa')),'allowNull':![],'defaultValue':_0x9da5('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x9da5('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 49aafe9..62187d3 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 _0x172d=['filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','output','existsSync','join','server/files/reports','Sequelize','exists','download','root','savename','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x4d212c,_0xdcd75){var _0x54618f=function(_0xb1b710){while(--_0xb1b710){_0x4d212c['push'](_0x4d212c['shift']());}};_0x54618f(++_0xdcd75);}(_0x172d,0x88));var _0xd172=function(_0x4559ad,_0x2eba0c){_0x4559ad=_0x4559ad-0x0;var _0x392de1=_0x172d[_0x4559ad];return _0x392de1;};'use strict';var emlformat=require(_0xd172('0x0'));var rimraf=require(_0xd172('0x1'));var zipdir=require(_0xd172('0x2'));var jsonpatch=require(_0xd172('0x3'));var rp=require('request-promise');var moment=require(_0xd172('0x4'));var BPromise=require(_0xd172('0x5'));var Mustache=require('mustache');var util=require(_0xd172('0x6'));var path=require(_0xd172('0x7'));var sox=require('sox');var csv=require(_0xd172('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd172('0x9'));var _=require('lodash');var squel=require(_0xd172('0xa'));var crypto=require(_0xd172('0xb'));var jsforce=require(_0xd172('0xc'));var deskjs=require(_0xd172('0xd'));var toCsv=require(_0xd172('0x8'));var querystring=require(_0xd172('0xe'));var Papa=require(_0xd172('0xf'));var Redis=require(_0xd172('0x10'));var authService=require(_0xd172('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd172('0x12'));var hardwareService=require(_0xd172('0x13'));var logger=require(_0xd172('0x14'))(_0xd172('0x15'));var utils=require(_0xd172('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd172('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461ae1,_0x47b9c7){_0x47b9c7=_0x47b9c7||0xcc;return function(_0x322879){if(_0x322879){return _0x461ae1[_0xd172('0x18')](_0x47b9c7);}return _0x461ae1['status'](_0x47b9c7)[_0xd172('0x19')]();};}function respondWithResult(_0x45cb8a,_0x18dfec){_0x18dfec=_0x18dfec||0xc8;return function(_0x736fd0){if(_0x736fd0){return _0x45cb8a['status'](_0x18dfec)[_0xd172('0x1a')](_0x736fd0);}};}function respondWithFilteredResult(_0x24a896,_0x4d6d38){return function(_0x26953f){if(_0x26953f){var _0x1b9348=typeof _0x4d6d38[_0xd172('0x1b')]==='undefined'&&typeof _0x4d6d38[_0xd172('0x1c')]===_0xd172('0x1d');var _0x5b4a07=_0x26953f[_0xd172('0x1e')];var _0x55ebb4=_0x1b9348?0x0:_0x4d6d38['offset'];var _0x18fee4=_0x1b9348?_0x26953f[_0xd172('0x1e')]:_0x4d6d38['offset']+_0x4d6d38['limit'];var _0x349966;if(_0x18fee4>=_0x5b4a07){_0x18fee4=_0x5b4a07;_0x349966=0xc8;}else{_0x349966=0xce;}_0x24a896[_0xd172('0x1f')](_0x349966);return _0x24a896[_0xd172('0x20')]('Content-Range',_0x55ebb4+'-'+_0x18fee4+'/'+_0x5b4a07)[_0xd172('0x1a')](_0x26953f);}return null;};}function patchUpdates(_0x267b9d){return function(_0x3700b0){try{jsonpatch['apply'](_0x3700b0,_0x267b9d,!![]);}catch(_0x57f0f3){return BPromise[_0xd172('0x21')](_0x57f0f3);}return _0x3700b0[_0xd172('0x22')]();};}function saveUpdates(_0x14f21c,_0x4fc530){return function(_0x272bb5){if(_0x272bb5){return _0x272bb5[_0xd172('0x23')](_0x14f21c)[_0xd172('0x24')](function(_0x4ac6fd){return _0x4ac6fd;});}return null;};}function removeEntity(_0x3d2258,_0x1c8b4b){return function(_0x1cfb81){if(_0x1cfb81){return _0x1cfb81['destroy']()[_0xd172('0x24')](function(){var _0x2354df=_0x1cfb81[_0xd172('0x25')]({'plain':!![]});var _0x2697d9='ExtractedReports';return db[_0xd172('0x26')][_0xd172('0x27')]({'where':{'type':_0x2697d9,'resourceId':_0x2354df['id']}})['then'](function(){return _0x1cfb81;});})[_0xd172('0x24')](function(){_0x3d2258[_0xd172('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x510f98,_0x5eefa4){return function(_0x4a9a62){if(!_0x4a9a62){_0x510f98[_0xd172('0x18')](0x194);}return _0x4a9a62;};}function handleError(_0x53f01b,_0x348c15){_0x348c15=_0x348c15||0x1f4;return function(_0x5d0986){logger[_0xd172('0x28')](_0x5d0986[_0xd172('0x29')]);if(_0x5d0986[_0xd172('0x2a')]){delete _0x5d0986[_0xd172('0x2a')];}_0x53f01b[_0xd172('0x1f')](_0x348c15)['send'](_0x5d0986);};}exports[_0xd172('0x2b')]=function(_0x3342ef,_0x2adb6e){var _0x15c40b={},_0x5c4d6a={},_0x528317={'count':0x0,'rows':[]};var _0x22d7c9=_['map'](db[_0xd172('0x2c')][_0xd172('0x2d')],function(_0xc45fc4){return{'name':_0xc45fc4[_0xd172('0x2e')],'type':_0xc45fc4[_0xd172('0x2f')][_0xd172('0x30')]};});_0x5c4d6a[_0xd172('0x31')]=_['map'](_0x22d7c9,'name');_0x5c4d6a[_0xd172('0x32')]=_[_0xd172('0x33')](_0x3342ef[_0xd172('0x32')]);_0x5c4d6a[_0xd172('0x34')]=_[_0xd172('0x35')](_0x5c4d6a[_0xd172('0x31')],_0x5c4d6a['query']);_0x15c40b['attributes']=_[_0xd172('0x35')](_0x5c4d6a['model'],qs[_0xd172('0x36')](_0x3342ef['query'][_0xd172('0x36')]));_0x15c40b[_0xd172('0x37')]=_0x15c40b[_0xd172('0x37')][_0xd172('0x38')]?_0x15c40b[_0xd172('0x37')]:_0x5c4d6a[_0xd172('0x31')];if(!_0x3342ef[_0xd172('0x32')]['hasOwnProperty'](_0xd172('0x39'))){_0x15c40b[_0xd172('0x1c')]=qs[_0xd172('0x1c')](_0x3342ef[_0xd172('0x32')][_0xd172('0x1c')]);_0x15c40b[_0xd172('0x1b')]=qs[_0xd172('0x1b')](_0x3342ef[_0xd172('0x32')][_0xd172('0x1b')]);}_0x15c40b[_0xd172('0x3a')]=qs['sort'](_0x3342ef[_0xd172('0x32')][_0xd172('0x3b')]);_0x15c40b[_0xd172('0x3c')]=qs['filters'](_[_0xd172('0x3d')](_0x3342ef[_0xd172('0x32')],_0x5c4d6a['filters']),_0x22d7c9);if(_0x3342ef['query'][_0xd172('0x3e')]){_0x15c40b[_0xd172('0x3c')]=_[_0xd172('0x3f')](_0x15c40b[_0xd172('0x3c')],{'$or':_[_0xd172('0x40')](_0x22d7c9,function(_0x5c102f){if(_0x5c102f[_0xd172('0x2f')]!==_0xd172('0x41')){var _0x106504={};_0x106504[_0x5c102f[_0xd172('0x2a')]]={'$like':'%'+_0x3342ef['query'][_0xd172('0x3e')]+'%'};return _0x106504;}})});}_0x15c40b=_[_0xd172('0x3f')]({},_0x15c40b,_0x3342ef[_0xd172('0x42')]);var _0x261f1f={'where':_0x15c40b[_0xd172('0x3c')]};return db['AnalyticExtractedReport']['count'](_0x261f1f)[_0xd172('0x24')](function(_0x5de1d5){_0x528317['count']=_0x5de1d5;if(_0x3342ef['query'][_0xd172('0x43')]){_0x15c40b[_0xd172('0x44')]=[{'all':!![]}];}return db[_0xd172('0x2c')][_0xd172('0x45')](_0x15c40b);})['then'](function(_0x2b1f86){_0x528317[_0xd172('0x46')]=_0x2b1f86;return _0x528317;})[_0xd172('0x24')](respondWithFilteredResult(_0x2adb6e,_0x15c40b))[_0xd172('0x47')](handleError(_0x2adb6e,null));};exports[_0xd172('0x48')]=function(_0x5a5704,_0x21ddbe){var _0x40bc1f={'raw':!![],'where':{'id':_0x5a5704[_0xd172('0x49')]['id']}},_0x2f5c25={};_0x2f5c25[_0xd172('0x31')]=_[_0xd172('0x33')](db[_0xd172('0x2c')][_0xd172('0x2d')]);_0x2f5c25[_0xd172('0x32')]=_[_0xd172('0x33')](_0x5a5704[_0xd172('0x32')]);_0x2f5c25[_0xd172('0x34')]=_[_0xd172('0x35')](_0x2f5c25[_0xd172('0x31')],_0x2f5c25[_0xd172('0x32')]);_0x40bc1f[_0xd172('0x37')]=_[_0xd172('0x35')](_0x2f5c25[_0xd172('0x31')],qs['fields'](_0x5a5704[_0xd172('0x32')][_0xd172('0x36')]));_0x40bc1f[_0xd172('0x37')]=_0x40bc1f[_0xd172('0x37')]['length']?_0x40bc1f[_0xd172('0x37')]:_0x2f5c25['model'];if(_0x5a5704['query'][_0xd172('0x43')]){_0x40bc1f['include']=[{'all':!![]}];}_0x40bc1f=_['merge']({},_0x40bc1f,_0x5a5704[_0xd172('0x42')]);return db[_0xd172('0x2c')][_0xd172('0x4a')](_0x40bc1f)[_0xd172('0x24')](handleEntityNotFound(_0x21ddbe,null))[_0xd172('0x24')](respondWithResult(_0x21ddbe,null))['catch'](handleError(_0x21ddbe,null));};exports[_0xd172('0x4b')]=function(_0x4dbda8,_0x3bde7b){return db['AnalyticExtractedReport']['create'](_0x4dbda8['body'],{})[_0xd172('0x24')](function(_0x446add){var _0x4576b6=_0x4dbda8[_0xd172('0x4c')][_0xd172('0x25')]({'plain':!![]});if(!_0x4576b6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4576b6[_0xd172('0x4d')]===_0xd172('0x4c')){var _0x2df4e9=_0x446add[_0xd172('0x25')]({'plain':!![]});var _0x336b3a='ExtractedReports';return db['UserProfileSection'][_0xd172('0x4a')]({'where':{'name':_0x336b3a,'userProfileId':_0x4576b6[_0xd172('0x4e')]},'raw':!![]})[_0xd172('0x24')](function(_0x36628b){if(_0x36628b&&_0x36628b[_0xd172('0x4f')]===0x0){return db[_0xd172('0x26')][_0xd172('0x4b')]({'name':_0x2df4e9['name'],'resourceId':_0x2df4e9['id'],'type':_0x36628b[_0xd172('0x2a')],'sectionId':_0x36628b['id']},{})[_0xd172('0x24')](function(){return _0x446add;});}else{return _0x446add;}})['catch'](function(_0x26e1c6){logger[_0xd172('0x28')](_0xd172('0x50'),_0x26e1c6);throw _0x26e1c6;});}return _0x446add;})[_0xd172('0x24')](respondWithResult(_0x3bde7b,0xc9))[_0xd172('0x47')](handleError(_0x3bde7b,null));};exports['update']=function(_0x33bbe5,_0x5c2890){if(_0x33bbe5[_0xd172('0x51')]['id']){delete _0x33bbe5[_0xd172('0x51')]['id'];}return db[_0xd172('0x2c')][_0xd172('0x4a')]({'where':{'id':_0x33bbe5['params']['id']}})[_0xd172('0x24')](handleEntityNotFound(_0x5c2890,null))[_0xd172('0x24')](saveUpdates(_0x33bbe5[_0xd172('0x51')],null))[_0xd172('0x24')](respondWithResult(_0x5c2890,null))[_0xd172('0x47')](handleError(_0x5c2890,null));};exports['destroy']=function(_0x33353e,_0x10be80){return db[_0xd172('0x2c')][_0xd172('0x4a')]({'where':{'id':_0x33353e[_0xd172('0x49')]['id']}})[_0xd172('0x24')](handleEntityNotFound(_0x10be80,null))[_0xd172('0x24')](removeEntity(_0x10be80,null))[_0xd172('0x47')](handleError(_0x10be80,null));};exports['download']=function(_0x4e7e8c,_0x4399d4,_0x162c5d){return db[_0xd172('0x2c')]['find']({'where':{'id':_0x4e7e8c[_0xd172('0x49')]['id']},'attributes':[_0xd172('0x2a'),'basename','savename',_0xd172('0x52')],'raw':!![]})[_0xd172('0x24')](handleEntityNotFound(_0x4399d4,null))[_0xd172('0x24')](function(_0x57b92c){if(_0x57b92c){if(!fs[_0xd172('0x53')](path[_0xd172('0x54')](config['root'],_0xd172('0x55'),_0x57b92c['savename']))){throw new db[(_0xd172('0x56'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x4e7e8c[_0xd172('0x32')][_0xd172('0x57')]){return _0x4399d4['sendStatus'](0xc8);}return _0x4399d4[_0xd172('0x58')](path[_0xd172('0x54')](config[_0xd172('0x59')],_0xd172('0x55'),_0x57b92c[_0xd172('0x5a')]),util[_0xd172('0x5b')]('%s.%s',_0x57b92c[_0xd172('0x5c')]||_0x57b92c['name'],_0x57b92c[_0xd172('0x52')][_0xd172('0x5d')]()));}})[_0xd172('0x47')](handleError(_0x4399d4,null));}; \ No newline at end of file +var _0xc01d=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','download','basename','savename','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model'];(function(_0x2e5d06,_0x314044){var _0x29f588=function(_0xd379ea){while(--_0xd379ea){_0x2e5d06['push'](_0x2e5d06['shift']());}};_0x29f588(++_0x314044);}(_0xc01d,0x1b1));var _0xdc01=function(_0xb36f78,_0x3cf612){_0xb36f78=_0xb36f78-0x0;var _0x10f5d4=_0xc01d[_0xb36f78];return _0x10f5d4;};'use strict';var emlformat=require(_0xdc01('0x0'));var rimraf=require(_0xdc01('0x1'));var zipdir=require(_0xdc01('0x2'));var jsonpatch=require(_0xdc01('0x3'));var rp=require(_0xdc01('0x4'));var moment=require(_0xdc01('0x5'));var BPromise=require(_0xdc01('0x6'));var Mustache=require(_0xdc01('0x7'));var util=require(_0xdc01('0x8'));var path=require(_0xdc01('0x9'));var sox=require(_0xdc01('0xa'));var csv=require(_0xdc01('0xb'));var ejs=require(_0xdc01('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc01('0xd'));var squel=require(_0xdc01('0xe'));var crypto=require('crypto');var jsforce=require(_0xdc01('0xf'));var deskjs=require(_0xdc01('0x10'));var toCsv=require(_0xdc01('0xb'));var querystring=require(_0xdc01('0x11'));var Papa=require('papaparse');var Redis=require(_0xdc01('0x12'));var authService=require(_0xdc01('0x13'));var qs=require(_0xdc01('0x14'));var as=require(_0xdc01('0x15'));var hardwareService=require(_0xdc01('0x16'));var logger=require(_0xdc01('0x17'))(_0xdc01('0x18'));var utils=require(_0xdc01('0x19'));var config=require(_0xdc01('0x1a'));var licenseUtil=require(_0xdc01('0x1b'));var db=require(_0xdc01('0x1c'))['db'];function respondWithStatusCode(_0x45e3c6,_0x71f7b6){_0x71f7b6=_0x71f7b6||0xcc;return function(_0x3dbe2b){if(_0x3dbe2b){return _0x45e3c6['sendStatus'](_0x71f7b6);}return _0x45e3c6[_0xdc01('0x1d')](_0x71f7b6)[_0xdc01('0x1e')]();};}function respondWithResult(_0x4374e4,_0x6f7a77){_0x6f7a77=_0x6f7a77||0xc8;return function(_0x1cf4d9){if(_0x1cf4d9){return _0x4374e4[_0xdc01('0x1d')](_0x6f7a77)[_0xdc01('0x1f')](_0x1cf4d9);}};}function respondWithFilteredResult(_0x24b8b3,_0x1a133b){return function(_0x4f2585){if(_0x4f2585){var _0x5efad4=typeof _0x1a133b[_0xdc01('0x20')]===_0xdc01('0x21')&&typeof _0x1a133b[_0xdc01('0x22')]===_0xdc01('0x21');var _0x2f5db3=_0x4f2585[_0xdc01('0x23')];var _0x2b87e6=_0x5efad4?0x0:_0x1a133b[_0xdc01('0x20')];var _0xc3d8c2=_0x5efad4?_0x4f2585['count']:_0x1a133b[_0xdc01('0x20')]+_0x1a133b[_0xdc01('0x22')];var _0x492d3a;if(_0xc3d8c2>=_0x2f5db3){_0xc3d8c2=_0x2f5db3;_0x492d3a=0xc8;}else{_0x492d3a=0xce;}_0x24b8b3[_0xdc01('0x1d')](_0x492d3a);return _0x24b8b3[_0xdc01('0x24')](_0xdc01('0x25'),_0x2b87e6+'-'+_0xc3d8c2+'/'+_0x2f5db3)[_0xdc01('0x1f')](_0x4f2585);}return null;};}function patchUpdates(_0x255a12){return function(_0x29e362){try{jsonpatch[_0xdc01('0x26')](_0x29e362,_0x255a12,!![]);}catch(_0x457f47){return BPromise[_0xdc01('0x27')](_0x457f47);}return _0x29e362['save']();};}function saveUpdates(_0x50258c,_0x52fd6){return function(_0x5cb27e){if(_0x5cb27e){return _0x5cb27e[_0xdc01('0x28')](_0x50258c)[_0xdc01('0x29')](function(_0x31d7e1){return _0x31d7e1;});}return null;};}function removeEntity(_0x47b06b,_0x41c25d){return function(_0x51476d){if(_0x51476d){return _0x51476d[_0xdc01('0x2a')]()['then'](function(){var _0x14bc8d=_0x51476d['get']({'plain':!![]});var _0x535e9e=_0xdc01('0x2b');return db[_0xdc01('0x2c')][_0xdc01('0x2a')]({'where':{'type':_0x535e9e,'resourceId':_0x14bc8d['id']}})[_0xdc01('0x29')](function(){return _0x51476d;});})['then'](function(){_0x47b06b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a56fc,_0x5e36aa){return function(_0x58b52b){if(!_0x58b52b){_0x5a56fc[_0xdc01('0x2d')](0x194);}return _0x58b52b;};}function handleError(_0x4b5397,_0x176991){_0x176991=_0x176991||0x1f4;return function(_0x514f86){logger[_0xdc01('0x2e')](_0x514f86[_0xdc01('0x2f')]);if(_0x514f86[_0xdc01('0x30')]){delete _0x514f86['name'];}_0x4b5397[_0xdc01('0x1d')](_0x176991)[_0xdc01('0x31')](_0x514f86);};}exports[_0xdc01('0x32')]=function(_0x245494,_0x552547){var _0x39e21c={},_0x16f9df={},_0x3f5ebb={'count':0x0,'rows':[]};var _0xe601fe=_[_0xdc01('0x33')](db[_0xdc01('0x34')][_0xdc01('0x35')],function(_0x51e7c4){return{'name':_0x51e7c4[_0xdc01('0x36')],'type':_0x51e7c4[_0xdc01('0x37')]['key']};});_0x16f9df[_0xdc01('0x38')]=_[_0xdc01('0x33')](_0xe601fe,_0xdc01('0x30'));_0x16f9df[_0xdc01('0x39')]=_['keys'](_0x245494[_0xdc01('0x39')]);_0x16f9df[_0xdc01('0x3a')]=_[_0xdc01('0x3b')](_0x16f9df[_0xdc01('0x38')],_0x16f9df[_0xdc01('0x39')]);_0x39e21c[_0xdc01('0x3c')]=_[_0xdc01('0x3b')](_0x16f9df[_0xdc01('0x38')],qs[_0xdc01('0x3d')](_0x245494[_0xdc01('0x39')]['fields']));_0x39e21c[_0xdc01('0x3c')]=_0x39e21c[_0xdc01('0x3c')]['length']?_0x39e21c[_0xdc01('0x3c')]:_0x16f9df[_0xdc01('0x38')];if(!_0x245494['query'][_0xdc01('0x3e')](_0xdc01('0x3f'))){_0x39e21c[_0xdc01('0x22')]=qs[_0xdc01('0x22')](_0x245494[_0xdc01('0x39')][_0xdc01('0x22')]);_0x39e21c['offset']=qs[_0xdc01('0x20')](_0x245494[_0xdc01('0x39')]['offset']);}_0x39e21c[_0xdc01('0x40')]=qs[_0xdc01('0x41')](_0x245494[_0xdc01('0x39')][_0xdc01('0x41')]);_0x39e21c['where']=qs[_0xdc01('0x3a')](_[_0xdc01('0x42')](_0x245494[_0xdc01('0x39')],_0x16f9df['filters']),_0xe601fe);if(_0x245494[_0xdc01('0x39')][_0xdc01('0x43')]){_0x39e21c[_0xdc01('0x44')]=_[_0xdc01('0x45')](_0x39e21c[_0xdc01('0x44')],{'$or':_[_0xdc01('0x33')](_0xe601fe,function(_0x30e875){if(_0x30e875[_0xdc01('0x37')]!=='VIRTUAL'){var _0x3fcced={};_0x3fcced[_0x30e875[_0xdc01('0x30')]]={'$like':'%'+_0x245494['query'][_0xdc01('0x43')]+'%'};return _0x3fcced;}})});}_0x39e21c=_['merge']({},_0x39e21c,_0x245494[_0xdc01('0x46')]);var _0x355365={'where':_0x39e21c['where']};return db[_0xdc01('0x34')][_0xdc01('0x23')](_0x355365)[_0xdc01('0x29')](function(_0x3d5469){_0x3f5ebb[_0xdc01('0x23')]=_0x3d5469;if(_0x245494[_0xdc01('0x39')][_0xdc01('0x47')]){_0x39e21c[_0xdc01('0x48')]=[{'all':!![]}];}return db[_0xdc01('0x34')]['findAll'](_0x39e21c);})['then'](function(_0x2a63d7){_0x3f5ebb[_0xdc01('0x49')]=_0x2a63d7;return _0x3f5ebb;})['then'](respondWithFilteredResult(_0x552547,_0x39e21c))[_0xdc01('0x4a')](handleError(_0x552547,null));};exports[_0xdc01('0x4b')]=function(_0x2befdd,_0x31b2f1){var _0x3fc7fb={'raw':!![],'where':{'id':_0x2befdd[_0xdc01('0x4c')]['id']}},_0x300612={};_0x300612[_0xdc01('0x38')]=_[_0xdc01('0x4d')](db[_0xdc01('0x34')]['rawAttributes']);_0x300612[_0xdc01('0x39')]=_[_0xdc01('0x4d')](_0x2befdd[_0xdc01('0x39')]);_0x300612[_0xdc01('0x3a')]=_[_0xdc01('0x3b')](_0x300612[_0xdc01('0x38')],_0x300612['query']);_0x3fc7fb['attributes']=_[_0xdc01('0x3b')](_0x300612[_0xdc01('0x38')],qs[_0xdc01('0x3d')](_0x2befdd[_0xdc01('0x39')][_0xdc01('0x3d')]));_0x3fc7fb['attributes']=_0x3fc7fb[_0xdc01('0x3c')]['length']?_0x3fc7fb['attributes']:_0x300612[_0xdc01('0x38')];if(_0x2befdd[_0xdc01('0x39')][_0xdc01('0x47')]){_0x3fc7fb[_0xdc01('0x48')]=[{'all':!![]}];}_0x3fc7fb=_[_0xdc01('0x45')]({},_0x3fc7fb,_0x2befdd[_0xdc01('0x46')]);return db[_0xdc01('0x34')]['find'](_0x3fc7fb)[_0xdc01('0x29')](handleEntityNotFound(_0x31b2f1,null))[_0xdc01('0x29')](respondWithResult(_0x31b2f1,null))[_0xdc01('0x4a')](handleError(_0x31b2f1,null));};exports[_0xdc01('0x4e')]=function(_0x30709c,_0x1315bf){return db[_0xdc01('0x34')]['create'](_0x30709c['body'],{})[_0xdc01('0x29')](function(_0x4a4efd){var _0x494bbe=_0x30709c['user'][_0xdc01('0x4f')]({'plain':!![]});if(!_0x494bbe)throw new Error(_0xdc01('0x50'));if(_0x494bbe[_0xdc01('0x51')]===_0xdc01('0x52')){var _0x1a07d5=_0x4a4efd['get']({'plain':!![]});var _0x520595=_0xdc01('0x2b');return db[_0xdc01('0x53')]['find']({'where':{'name':_0x520595,'userProfileId':_0x494bbe[_0xdc01('0x54')]},'raw':!![]})['then'](function(_0x2b5a39){if(_0x2b5a39&&_0x2b5a39['autoAssociation']===0x0){return db[_0xdc01('0x2c')][_0xdc01('0x4e')]({'name':_0x1a07d5[_0xdc01('0x30')],'resourceId':_0x1a07d5['id'],'type':_0x2b5a39[_0xdc01('0x30')],'sectionId':_0x2b5a39['id']},{})[_0xdc01('0x29')](function(){return _0x4a4efd;});}else{return _0x4a4efd;}})['catch'](function(_0xd5fa1b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd5fa1b);throw _0xd5fa1b;});}return _0x4a4efd;})['then'](respondWithResult(_0x1315bf,0xc9))['catch'](handleError(_0x1315bf,null));};exports[_0xdc01('0x28')]=function(_0x2600f1,_0x345808){if(_0x2600f1[_0xdc01('0x55')]['id']){delete _0x2600f1['body']['id'];}return db[_0xdc01('0x34')]['find']({'where':{'id':_0x2600f1[_0xdc01('0x4c')]['id']}})[_0xdc01('0x29')](handleEntityNotFound(_0x345808,null))[_0xdc01('0x29')](saveUpdates(_0x2600f1[_0xdc01('0x55')],null))[_0xdc01('0x29')](respondWithResult(_0x345808,null))[_0xdc01('0x4a')](handleError(_0x345808,null));};exports[_0xdc01('0x2a')]=function(_0x3bdbfc,_0x47e7f9){return db[_0xdc01('0x34')]['find']({'where':{'id':_0x3bdbfc['params']['id']}})[_0xdc01('0x29')](handleEntityNotFound(_0x47e7f9,null))['then'](removeEntity(_0x47e7f9,null))[_0xdc01('0x4a')](handleError(_0x47e7f9,null));};exports[_0xdc01('0x56')]=function(_0x25543f,_0x5d6e14,_0x4d19e5){return db[_0xdc01('0x34')]['find']({'where':{'id':_0x25543f['params']['id']},'attributes':[_0xdc01('0x30'),_0xdc01('0x57'),_0xdc01('0x58'),'output'],'raw':!![]})[_0xdc01('0x29')](handleEntityNotFound(_0x5d6e14,null))['then'](function(_0x3e5b0d){if(_0x3e5b0d){if(!fs[_0xdc01('0x59')](path[_0xdc01('0x5a')](config[_0xdc01('0x5b')],_0xdc01('0x5c'),_0x3e5b0d[_0xdc01('0x58')]))){throw new db['Sequelize'][(_0xdc01('0x5d'))](_0xdc01('0x5e'));}if(_0x25543f[_0xdc01('0x39')][_0xdc01('0x5f')]){return _0x5d6e14[_0xdc01('0x2d')](0xc8);}return _0x5d6e14['download'](path[_0xdc01('0x5a')](config[_0xdc01('0x5b')],'server/files/reports',_0x3e5b0d['savename']),util[_0xdc01('0x60')](_0xdc01('0x61'),_0x3e5b0d[_0xdc01('0x57')]||_0x3e5b0d[_0xdc01('0x30')],_0x3e5b0d['output']['toLowerCase']()));}})[_0xdc01('0x4a')](handleError(_0x5d6e14,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b4761cc..863fa11 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 _0xfae9=['request-promise','rimraf','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','moment'];(function(_0xd81b5b,_0x15f6a7){var _0x52ffd9=function(_0x5571ea){while(--_0x5571ea){_0xd81b5b['push'](_0xd81b5b['shift']());}};_0x52ffd9(++_0x15f6a7);}(_0xfae9,0xf9));var _0x9fae=function(_0xfb41d,_0x32740c){_0xfb41d=_0xfb41d-0x0;var _0x246945=_0xfae9[_0xfb41d];return _0x246945;};'use strict';var _=require('lodash');var util=require(_0x9fae('0x0'));var logger=require(_0x9fae('0x1'))('api');var moment=require(_0x9fae('0x2'));var BPromise=require('bluebird');var rp=require(_0x9fae('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fae('0x4'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x41370b,_0x4129cd){return _0x41370b['define'](_0x9fae('0x5'),attributes,{'tableName':_0x9fae('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x400a=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x400a,0x174));var _0xa400=function(_0x308946,_0x434515){_0x308946=_0x308946-0x0;var _0x51fdcb=_0x400a[_0x308946];return _0x51fdcb;};'use strict';var _=require('lodash');var util=require(_0xa400('0x0'));var logger=require(_0xa400('0x1'))(_0xa400('0x2'));var moment=require(_0xa400('0x3'));var BPromise=require(_0xa400('0x4'));var rp=require(_0xa400('0x5'));var fs=require('fs');var path=require(_0xa400('0x6'));var rimraf=require(_0xa400('0x7'));var config=require(_0xa400('0x8'));var attributes=require(_0xa400('0x9'));module['exports']=function(_0x61bac5,_0xc45484){return _0x61bac5[_0xa400('0xa')](_0xa400('0xb'),attributes,{'tableName':_0xa400('0xc'),'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 d91c5a4..8d0d03e 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 _0xdcec=['then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xdcec,0xf2));var _0xcdce=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xdcec[_0x5ecadc];return _0x565037;};'use strict';var _=require('lodash');var util=require(_0xcdce('0x0'));var moment=require(_0xcdce('0x1'));var BPromise=require(_0xcdce('0x2'));var rs=require(_0xcdce('0x3'));var fs=require('fs');var Redis=require(_0xcdce('0x4'));var db=require(_0xcdce('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcdce('0x6'));var config=require(_0xcdce('0x7'));var jayson=require(_0xcdce('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x475aed,_0x321f2f,_0xe97d13){return new BPromise(function(_0x1c582f,_0x16f148){return client[_0xcdce('0x9')](_0x475aed,_0xe97d13)[_0xcdce('0xa')](function(_0xb1c86b){logger['info'](_0xcdce('0xb'),_0x321f2f,_0xcdce('0xc'));logger[_0xcdce('0xd')](_0xcdce('0xe'),_0x321f2f,_0xcdce('0xc'),JSON[_0xcdce('0xf')](_0xb1c86b));if(_0xb1c86b[_0xcdce('0x10')]){if(_0xb1c86b['error'][_0xcdce('0x11')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x321f2f,_0xb1c86b[_0xcdce('0x10')]['message']);return _0x16f148(_0xb1c86b[_0xcdce('0x10')][_0xcdce('0x12')]);}logger[_0xcdce('0x10')](_0xcdce('0xb'),_0x321f2f,_0xb1c86b[_0xcdce('0x10')][_0xcdce('0x12')]);return _0x1c582f(_0xb1c86b['error']['message']);}else{logger[_0xcdce('0x13')](_0xcdce('0xb'),_0x321f2f,_0xcdce('0xc'));_0x1c582f(_0xb1c86b['result']['message']);}})[_0xcdce('0x14')](function(_0x22c10f){logger[_0xcdce('0x10')](_0xcdce('0xb'),_0x321f2f,_0x22c10f);_0x16f148(_0x22c10f);});});} \ No newline at end of file +var _0x4a2f=['error','code','message','result','catch','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x4a2f,0x8a));var _0xf4a2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4a2f[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf4a2('0x0'));var BPromise=require(_0xf4a2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf4a2('0x2'));var logger=require(_0xf4a2('0x3'))(_0xf4a2('0x4'));var config=require(_0xf4a2('0x5'));var jayson=require(_0xf4a2('0x6'));var client=jayson[_0xf4a2('0x7')][_0xf4a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10060f,_0x306b1c,_0x2952e6){return new BPromise(function(_0x5e3cd6,_0x48904b){return client[_0xf4a2('0x9')](_0x10060f,_0x2952e6)['then'](function(_0x4f72fd){logger[_0xf4a2('0xa')](_0xf4a2('0xb'),_0x306b1c,_0xf4a2('0xc'));logger['debug'](_0xf4a2('0xd'),_0x306b1c,_0xf4a2('0xc'),JSON['stringify'](_0x4f72fd));if(_0x4f72fd[_0xf4a2('0xe')]){if(_0x4f72fd[_0xf4a2('0xe')][_0xf4a2('0xf')]===0x1f4){logger['error'](_0xf4a2('0xb'),_0x306b1c,_0x4f72fd[_0xf4a2('0xe')]['message']);return _0x48904b(_0x4f72fd[_0xf4a2('0xe')]['message']);}logger[_0xf4a2('0xe')](_0xf4a2('0xb'),_0x306b1c,_0x4f72fd[_0xf4a2('0xe')][_0xf4a2('0x10')]);return _0x5e3cd6(_0x4f72fd['error'][_0xf4a2('0x10')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x306b1c,_0xf4a2('0xc'));_0x5e3cd6(_0x4f72fd[_0xf4a2('0x11')]['message']);}})[_0xf4a2('0x12')](function(_0x552517){logger[_0xf4a2('0xe')](_0xf4a2('0xb'),_0x306b1c,_0x552517);_0x48904b(_0x552517);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 2e1f114..263828b 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 _0x4e79=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x4e79,0x1f2));var _0x94e7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4e79[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x94e7('0x0'));var util=require(_0x94e7('0x1'));var path=require(_0x94e7('0x2'));var timeout=require(_0x94e7('0x3'));var express=require('express');var router=express[_0x94e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94e7('0x5'));var interaction=require(_0x94e7('0x6'));var config=require('../../config/environment');var controller=require(_0x94e7('0x7'));router[_0x94e7('0x8')]('/',auth[_0x94e7('0x9')](),controller[_0x94e7('0xa')]);router[_0x94e7('0x8')](_0x94e7('0xb'),auth['isAuthenticated'](),controller[_0x94e7('0xc')]);router[_0x94e7('0x8')]('/:id/download',auth[_0x94e7('0x9')](),controller[_0x94e7('0xd')]);router['post']('/',auth[_0x94e7('0x9')](),controller[_0x94e7('0xe')]);router[_0x94e7('0xf')](_0x94e7('0xb'),auth[_0x94e7('0x9')](),controller[_0x94e7('0x10')]);router[_0x94e7('0x11')](_0x94e7('0xb'),auth[_0x94e7('0x9')](),controller[_0x94e7('0x12')]);module[_0x94e7('0x13')]=router; \ No newline at end of file +var _0xbd6f=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','create','put','update','util','path'];(function(_0xffe4b5,_0x574c36){var _0x150c10=function(_0x2b4f93){while(--_0x2b4f93){_0xffe4b5['push'](_0xffe4b5['shift']());}};_0x150c10(++_0x574c36);}(_0xbd6f,0x154));var _0xfbd6=function(_0x336c66,_0x1d1b0f){_0x336c66=_0x336c66-0x0;var _0x5ee5bc=_0xbd6f[_0x336c66];return _0x5ee5bc;};'use strict';var multer=require('multer');var util=require(_0xfbd6('0x0'));var path=require(_0xfbd6('0x1'));var timeout=require(_0xfbd6('0x2'));var express=require(_0xfbd6('0x3'));var router=express[_0xfbd6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfbd6('0x5'));var interaction=require(_0xfbd6('0x6'));var config=require(_0xfbd6('0x7'));var controller=require(_0xfbd6('0x8'));router[_0xfbd6('0x9')]('/',auth[_0xfbd6('0xa')](),controller[_0xfbd6('0xb')]);router[_0xfbd6('0x9')](_0xfbd6('0xc'),auth['isAuthenticated'](),controller[_0xfbd6('0xd')]);router[_0xfbd6('0x9')]('/:id/download',auth[_0xfbd6('0xa')](),controller[_0xfbd6('0xe')]);router['post']('/',auth[_0xfbd6('0xa')](),controller[_0xfbd6('0xf')]);router[_0xfbd6('0x10')](_0xfbd6('0xc'),auth[_0xfbd6('0xa')](),controller[_0xfbd6('0x11')]);router['delete'](_0xfbd6('0xc'),auth[_0xfbd6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 0f66045..16a6f23 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 _0x6a7e=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x76c797,_0x6e6570){var _0x39a216=function(_0x51b64c){while(--_0x51b64c){_0x76c797['push'](_0x76c797['shift']());}};_0x39a216(++_0x6e6570);}(_0x6a7e,0x1cb));var _0xe6a7=function(_0x4cab15,_0x4418ba){_0x4cab15=_0x4cab15-0x0;var _0x20b49a=_0x6a7e[_0x4cab15];return _0x20b49a;};'use strict';var Sequelize=require(_0xe6a7('0x0'));module[_0xe6a7('0x1')]={'field':{'type':Sequelize[_0xe6a7('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xe6a7('0x3')]},'format':{'type':Sequelize[_0xe6a7('0x3')]},'groupBy':{'type':Sequelize[_0xe6a7('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe6a7('0x3')]},'custom':{'type':Sequelize[_0xe6a7('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x4820=['exports','STRING','BOOLEAN','sequelize'];(function(_0x35ead7,_0x453d3a){var _0x33b761=function(_0x1c28b9){while(--_0x1c28b9){_0x35ead7['push'](_0x35ead7['shift']());}};_0x33b761(++_0x453d3a);}(_0x4820,0x173));var _0x0482=function(_0x4007cf,_0x2facba){_0x4007cf=_0x4007cf-0x0;var _0x577503=_0x4820[_0x4007cf];return _0x577503;};'use strict';var Sequelize=require(_0x0482('0x0'));module[_0x0482('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0482('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x0482('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0482('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 23e1f5f..45c03e2 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 _0x2bbc=['sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','destroy','then','stack','name','send','index','map','AnalyticFieldReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5a299c,_0x2b97e5){var _0x5d886e=function(_0x22d2f7){while(--_0x22d2f7){_0x5a299c['push'](_0x5a299c['shift']());}};_0x5d886e(++_0x2b97e5);}(_0x2bbc,0x100));var _0xc2bb=function(_0x3d3b6c,_0x26cee6){_0x3d3b6c=_0x3d3b6c-0x0;var _0x55cb2c=_0x2bbc[_0x3d3b6c];return _0x55cb2c;};'use strict';var emlformat=require(_0xc2bb('0x0'));var rimraf=require(_0xc2bb('0x1'));var zipdir=require(_0xc2bb('0x2'));var jsonpatch=require(_0xc2bb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc2bb('0x4'));var Mustache=require('mustache');var util=require(_0xc2bb('0x5'));var path=require(_0xc2bb('0x6'));var sox=require(_0xc2bb('0x7'));var csv=require('to-csv');var ejs=require(_0xc2bb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc2bb('0x9'));var crypto=require(_0xc2bb('0xa'));var jsforce=require(_0xc2bb('0xb'));var deskjs=require(_0xc2bb('0xc'));var toCsv=require(_0xc2bb('0xd'));var querystring=require('querystring');var Papa=require(_0xc2bb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc2bb('0xf'));var as=require(_0xc2bb('0x10'));var hardwareService=require(_0xc2bb('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xc2bb('0x12'));var config=require(_0xc2bb('0x13'));var licenseUtil=require(_0xc2bb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20d09e,_0xbc2a84){_0xbc2a84=_0xbc2a84||0xcc;return function(_0x3a53b8){if(_0x3a53b8){return _0x20d09e[_0xc2bb('0x15')](_0xbc2a84);}return _0x20d09e[_0xc2bb('0x16')](_0xbc2a84)[_0xc2bb('0x17')]();};}function respondWithResult(_0x582fa1,_0x1ddd0e){_0x1ddd0e=_0x1ddd0e||0xc8;return function(_0x1a0159){if(_0x1a0159){return _0x582fa1['status'](_0x1ddd0e)[_0xc2bb('0x18')](_0x1a0159);}};}function respondWithFilteredResult(_0x21aaec,_0x3e776a){return function(_0x49af5c){if(_0x49af5c){var _0x1518b4=typeof _0x3e776a['offset']===_0xc2bb('0x19')&&typeof _0x3e776a[_0xc2bb('0x1a')]===_0xc2bb('0x19');var _0x17ea5f=_0x49af5c[_0xc2bb('0x1b')];var _0x1ccb92=_0x1518b4?0x0:_0x3e776a[_0xc2bb('0x1c')];var _0x348762=_0x1518b4?_0x49af5c[_0xc2bb('0x1b')]:_0x3e776a[_0xc2bb('0x1c')]+_0x3e776a[_0xc2bb('0x1a')];var _0x26bdcd;if(_0x348762>=_0x17ea5f){_0x348762=_0x17ea5f;_0x26bdcd=0xc8;}else{_0x26bdcd=0xce;}_0x21aaec['status'](_0x26bdcd);return _0x21aaec[_0xc2bb('0x1d')](_0xc2bb('0x1e'),_0x1ccb92+'-'+_0x348762+'/'+_0x17ea5f)[_0xc2bb('0x18')](_0x49af5c);}return null;};}function patchUpdates(_0x53be41){return function(_0x13137f){try{jsonpatch['apply'](_0x13137f,_0x53be41,!![]);}catch(_0x68576d){return BPromise['reject'](_0x68576d);}return _0x13137f[_0xc2bb('0x1f')]();};}function saveUpdates(_0x2b9fa8,_0x2db511){return function(_0x4d4b64){if(_0x4d4b64){return _0x4d4b64['update'](_0x2b9fa8)['then'](function(_0x34ce9f){return _0x34ce9f;});}return null;};}function removeEntity(_0x5a03af,_0x1af8c4){return function(_0x33843c){if(_0x33843c){return _0x33843c[_0xc2bb('0x20')]()[_0xc2bb('0x21')](function(){_0x5a03af[_0xc2bb('0x16')](0xcc)[_0xc2bb('0x17')]();});}};}function handleEntityNotFound(_0x13b18d,_0x212642){return function(_0x1f801d){if(!_0x1f801d){_0x13b18d[_0xc2bb('0x15')](0x194);}return _0x1f801d;};}function handleError(_0x3d9069,_0x285740){_0x285740=_0x285740||0x1f4;return function(_0x3dab88){logger['error'](_0x3dab88[_0xc2bb('0x22')]);if(_0x3dab88[_0xc2bb('0x23')]){delete _0x3dab88['name'];}_0x3d9069['status'](_0x285740)[_0xc2bb('0x24')](_0x3dab88);};}exports[_0xc2bb('0x25')]=function(_0x4f9d30,_0x31c41c){var _0x2e4225={},_0x18ea00={},_0x5db4ed={'count':0x0,'rows':[]};var _0x4d67ce=_[_0xc2bb('0x26')](db[_0xc2bb('0x27')]['rawAttributes'],function(_0x13e60f){return{'name':_0x13e60f[_0xc2bb('0x28')],'type':_0x13e60f['type']['key']};});_0x18ea00[_0xc2bb('0x29')]=_[_0xc2bb('0x26')](_0x4d67ce,_0xc2bb('0x23'));_0x18ea00[_0xc2bb('0x2a')]=_[_0xc2bb('0x2b')](_0x4f9d30[_0xc2bb('0x2a')]);_0x18ea00[_0xc2bb('0x2c')]=_[_0xc2bb('0x2d')](_0x18ea00[_0xc2bb('0x29')],_0x18ea00[_0xc2bb('0x2a')]);_0x2e4225[_0xc2bb('0x2e')]=_['intersection'](_0x18ea00[_0xc2bb('0x29')],qs[_0xc2bb('0x2f')](_0x4f9d30[_0xc2bb('0x2a')][_0xc2bb('0x2f')]));_0x2e4225[_0xc2bb('0x2e')]=_0x2e4225['attributes'][_0xc2bb('0x30')]?_0x2e4225[_0xc2bb('0x2e')]:_0x18ea00[_0xc2bb('0x29')];if(!_0x4f9d30[_0xc2bb('0x2a')][_0xc2bb('0x31')](_0xc2bb('0x32'))){_0x2e4225['limit']=qs[_0xc2bb('0x1a')](_0x4f9d30['query'][_0xc2bb('0x1a')]);_0x2e4225[_0xc2bb('0x1c')]=qs[_0xc2bb('0x1c')](_0x4f9d30[_0xc2bb('0x2a')]['offset']);}_0x2e4225[_0xc2bb('0x33')]=qs[_0xc2bb('0x34')](_0x4f9d30['query'][_0xc2bb('0x34')]);_0x2e4225[_0xc2bb('0x35')]=qs[_0xc2bb('0x2c')](_['pick'](_0x4f9d30['query'],_0x18ea00[_0xc2bb('0x2c')]),_0x4d67ce);if(_0x4f9d30['query'][_0xc2bb('0x36')]){_0x2e4225[_0xc2bb('0x35')]=_[_0xc2bb('0x37')](_0x2e4225[_0xc2bb('0x35')],{'$or':_[_0xc2bb('0x26')](_0x4d67ce,function(_0xadac76){if(_0xadac76[_0xc2bb('0x38')]!==_0xc2bb('0x39')){var _0x3aae8d={};_0x3aae8d[_0xadac76[_0xc2bb('0x23')]]={'$like':'%'+_0x4f9d30[_0xc2bb('0x2a')][_0xc2bb('0x36')]+'%'};return _0x3aae8d;}})});}_0x2e4225=_['merge']({},_0x2e4225,_0x4f9d30[_0xc2bb('0x3a')]);var _0x51bde3={'where':_0x2e4225[_0xc2bb('0x35')]};return db['AnalyticFieldReport']['count'](_0x51bde3)[_0xc2bb('0x21')](function(_0x4d256c){_0x5db4ed[_0xc2bb('0x1b')]=_0x4d256c;if(_0x4f9d30[_0xc2bb('0x2a')][_0xc2bb('0x3b')]){_0x2e4225[_0xc2bb('0x3c')]=[{'all':!![]}];}return db[_0xc2bb('0x27')][_0xc2bb('0x3d')](_0x2e4225);})['then'](function(_0x1543af){_0x5db4ed[_0xc2bb('0x3e')]=_0x1543af;return _0x5db4ed;})[_0xc2bb('0x21')](respondWithFilteredResult(_0x31c41c,_0x2e4225))['catch'](handleError(_0x31c41c,null));};exports[_0xc2bb('0x3f')]=function(_0x429364,_0x5ba09f){var _0x13c108={'raw':![],'where':{'id':_0x429364[_0xc2bb('0x40')]['id']}},_0x27a852={};_0x27a852[_0xc2bb('0x29')]=_[_0xc2bb('0x2b')](db[_0xc2bb('0x27')]['rawAttributes']);_0x27a852['query']=_[_0xc2bb('0x2b')](_0x429364['query']);_0x27a852[_0xc2bb('0x2c')]=_['intersection'](_0x27a852[_0xc2bb('0x29')],_0x27a852[_0xc2bb('0x2a')]);_0x13c108[_0xc2bb('0x2e')]=_[_0xc2bb('0x2d')](_0x27a852[_0xc2bb('0x29')],qs[_0xc2bb('0x2f')](_0x429364[_0xc2bb('0x2a')][_0xc2bb('0x2f')]));_0x13c108[_0xc2bb('0x2e')]=_0x13c108[_0xc2bb('0x2e')]['length']?_0x13c108[_0xc2bb('0x2e')]:_0x27a852[_0xc2bb('0x29')];if(_0x429364['query']['includeAll']){_0x13c108[_0xc2bb('0x3c')]=[{'all':!![]}];}_0x13c108=_[_0xc2bb('0x37')]({},_0x13c108,_0x429364[_0xc2bb('0x3a')]);return db[_0xc2bb('0x27')][_0xc2bb('0x41')](_0x13c108)['then'](handleEntityNotFound(_0x5ba09f,null))[_0xc2bb('0x21')](respondWithResult(_0x5ba09f,null))[_0xc2bb('0x42')](handleError(_0x5ba09f,null));};exports[_0xc2bb('0x43')]=function(_0x50dc79,_0xe56517){return db[_0xc2bb('0x27')][_0xc2bb('0x43')](_0x50dc79[_0xc2bb('0x44')],{})[_0xc2bb('0x21')](respondWithResult(_0xe56517,0xc9))['catch'](handleError(_0xe56517,null));};exports['bulkCreate']=function(_0x45133a,_0x416af0){return db[_0xc2bb('0x27')]['bulkCreate'](_0x45133a['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x416af0,0xc9))[_0xc2bb('0x42')](handleError(_0x416af0,null));};exports[_0xc2bb('0x45')]=function(_0x2efd15,_0x4df9bc){if(_0x2efd15['body']['id']){delete _0x2efd15[_0xc2bb('0x44')]['id'];}return db[_0xc2bb('0x27')][_0xc2bb('0x41')]({'where':{'id':_0x2efd15[_0xc2bb('0x40')]['id']}})[_0xc2bb('0x21')](handleEntityNotFound(_0x4df9bc,null))[_0xc2bb('0x21')](saveUpdates(_0x2efd15[_0xc2bb('0x44')],null))[_0xc2bb('0x21')](respondWithResult(_0x4df9bc,null))[_0xc2bb('0x42')](handleError(_0x4df9bc,null));};exports[_0xc2bb('0x20')]=function(_0x56b019,_0x3bca3a){return db[_0xc2bb('0x27')][_0xc2bb('0x41')]({'where':{'id':_0x56b019[_0xc2bb('0x40')]['id']}})[_0xc2bb('0x21')](handleEntityNotFound(_0x3bca3a,null))[_0xc2bb('0x21')](removeEntity(_0x3bca3a,null))[_0xc2bb('0x42')](handleError(_0x3bca3a,null));};exports[_0xc2bb('0x46')]=function(_0x185a1d,_0x471067){return db[_0xc2bb('0x27')][_0xc2bb('0x20')]({'where':{'id':_0x185a1d[_0xc2bb('0x2a')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xc2bb('0x21')](respondWithResult(_0x471067,0xcc))[_0xc2bb('0x42')](handleError(_0x471067,null));};exports[_0xc2bb('0x47')]=function(_0x98dcbc,_0x3a0dbc,_0x24441f){return db[_0xc2bb('0x48')][_0xc2bb('0x49')]({'where':{'id':_0x98dcbc[_0xc2bb('0x40')]['id']}})[_0xc2bb('0x21')](handleEntityNotFound(_0x3a0dbc,null))[_0xc2bb('0x21')](function(_0x26134b){if(_0x26134b){return db[_0xc2bb('0x4a')]['transaction'](function(_0x279fe9){return db['AnalyticFieldReport'][_0xc2bb('0x20')]({'where':{'CustomReportId':_0x98dcbc[_0xc2bb('0x40')]['id']},'transaction':_0x279fe9})[_0xc2bb('0x21')](function(_0x501d5e){var _0x5b3d46=_[_0xc2bb('0x26')](_0x98dcbc['body'],function(_0x13415c){delete _0x13415c['id'];_0x13415c[_0xc2bb('0x4b')]=_0x98dcbc[_0xc2bb('0x40')]['id'];return _0x13415c;});return db['AnalyticFieldReport'][_0xc2bb('0x4c')](_0x5b3d46,{'transaction':_0x279fe9});});})[_0xc2bb('0x21')](function(){return db[_0xc2bb('0x27')][_0xc2bb('0x3d')]({'where':{'CustomReportId':_0x98dcbc[_0xc2bb('0x40')]['id']}});});}})['then'](respondWithResult(_0x3a0dbc,null))[_0xc2bb('0x42')](handleError(_0x3a0dbc,null));}; \ No newline at end of file +var _0xda85=['key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','fields','includeAll','include','AnalyticFieldReport','create','bulkCreate','body','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','error','name','send','index','map','rawAttributes','type'];(function(_0xec1f4d,_0x1455b4){var _0x3dc88d=function(_0x1370a9){while(--_0x1370a9){_0xec1f4d['push'](_0xec1f4d['shift']());}};_0x3dc88d(++_0x1455b4);}(_0xda85,0x76));var _0x5da8=function(_0x371eb8,_0x11409b){_0x371eb8=_0x371eb8-0x0;var _0x224438=_0xda85[_0x371eb8];return _0x224438;};'use strict';var emlformat=require(_0x5da8('0x0'));var rimraf=require(_0x5da8('0x1'));var zipdir=require(_0x5da8('0x2'));var jsonpatch=require(_0x5da8('0x3'));var rp=require(_0x5da8('0x4'));var moment=require(_0x5da8('0x5'));var BPromise=require(_0x5da8('0x6'));var Mustache=require(_0x5da8('0x7'));var util=require('util');var path=require(_0x5da8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5da8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5da8('0xa'));var crypto=require(_0x5da8('0xb'));var jsforce=require(_0x5da8('0xc'));var deskjs=require(_0x5da8('0xd'));var toCsv=require(_0x5da8('0xe'));var querystring=require(_0x5da8('0xf'));var Papa=require(_0x5da8('0x10'));var Redis=require(_0x5da8('0x11'));var authService=require(_0x5da8('0x12'));var qs=require(_0x5da8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5da8('0x14'));var logger=require('../../config/logger')(_0x5da8('0x15'));var utils=require(_0x5da8('0x16'));var config=require(_0x5da8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25f631,_0x558f6d){_0x558f6d=_0x558f6d||0xcc;return function(_0x2225cb){if(_0x2225cb){return _0x25f631[_0x5da8('0x18')](_0x558f6d);}return _0x25f631[_0x5da8('0x19')](_0x558f6d)[_0x5da8('0x1a')]();};}function respondWithResult(_0x2f8f16,_0x38f7c){_0x38f7c=_0x38f7c||0xc8;return function(_0x353618){if(_0x353618){return _0x2f8f16[_0x5da8('0x19')](_0x38f7c)[_0x5da8('0x1b')](_0x353618);}};}function respondWithFilteredResult(_0x26b6fa,_0x27773c){return function(_0xa083d6){if(_0xa083d6){var _0x1af207=typeof _0x27773c[_0x5da8('0x1c')]===_0x5da8('0x1d')&&typeof _0x27773c[_0x5da8('0x1e')]===_0x5da8('0x1d');var _0x4ed2b1=_0xa083d6['count'];var _0x20e018=_0x1af207?0x0:_0x27773c['offset'];var _0x39d410=_0x1af207?_0xa083d6[_0x5da8('0x1f')]:_0x27773c['offset']+_0x27773c[_0x5da8('0x1e')];var _0x3a9fe5;if(_0x39d410>=_0x4ed2b1){_0x39d410=_0x4ed2b1;_0x3a9fe5=0xc8;}else{_0x3a9fe5=0xce;}_0x26b6fa[_0x5da8('0x19')](_0x3a9fe5);return _0x26b6fa['set'](_0x5da8('0x20'),_0x20e018+'-'+_0x39d410+'/'+_0x4ed2b1)[_0x5da8('0x1b')](_0xa083d6);}return null;};}function patchUpdates(_0x302ed5){return function(_0x25b919){try{jsonpatch[_0x5da8('0x21')](_0x25b919,_0x302ed5,!![]);}catch(_0x482677){return BPromise['reject'](_0x482677);}return _0x25b919[_0x5da8('0x22')]();};}function saveUpdates(_0xfc560e,_0x57494b){return function(_0x46e1d3){if(_0x46e1d3){return _0x46e1d3['update'](_0xfc560e)['then'](function(_0x5009ec){return _0x5009ec;});}return null;};}function removeEntity(_0x24e0c3,_0x333c2b){return function(_0x237a45){if(_0x237a45){return _0x237a45[_0x5da8('0x23')]()[_0x5da8('0x24')](function(){_0x24e0c3[_0x5da8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x517cde,_0x4f1c42){return function(_0x3eba69){if(!_0x3eba69){_0x517cde['sendStatus'](0x194);}return _0x3eba69;};}function handleError(_0x5dc874,_0x4aea96){_0x4aea96=_0x4aea96||0x1f4;return function(_0x3daf94){logger[_0x5da8('0x25')](_0x3daf94['stack']);if(_0x3daf94[_0x5da8('0x26')]){delete _0x3daf94[_0x5da8('0x26')];}_0x5dc874[_0x5da8('0x19')](_0x4aea96)[_0x5da8('0x27')](_0x3daf94);};}exports[_0x5da8('0x28')]=function(_0x5146a5,_0x663cb8){var _0x1cc7f7={},_0x480ce0={},_0x31e524={'count':0x0,'rows':[]};var _0x442d5c=_[_0x5da8('0x29')](db['AnalyticFieldReport'][_0x5da8('0x2a')],function(_0x5966b1){return{'name':_0x5966b1['fieldName'],'type':_0x5966b1[_0x5da8('0x2b')][_0x5da8('0x2c')]};});_0x480ce0[_0x5da8('0x2d')]=_['map'](_0x442d5c,_0x5da8('0x26'));_0x480ce0[_0x5da8('0x2e')]=_[_0x5da8('0x2f')](_0x5146a5[_0x5da8('0x2e')]);_0x480ce0[_0x5da8('0x30')]=_[_0x5da8('0x31')](_0x480ce0['model'],_0x480ce0[_0x5da8('0x2e')]);_0x1cc7f7[_0x5da8('0x32')]=_[_0x5da8('0x31')](_0x480ce0[_0x5da8('0x2d')],qs['fields'](_0x5146a5['query']['fields']));_0x1cc7f7[_0x5da8('0x32')]=_0x1cc7f7[_0x5da8('0x32')][_0x5da8('0x33')]?_0x1cc7f7[_0x5da8('0x32')]:_0x480ce0['model'];if(!_0x5146a5[_0x5da8('0x2e')][_0x5da8('0x34')](_0x5da8('0x35'))){_0x1cc7f7[_0x5da8('0x1e')]=qs[_0x5da8('0x1e')](_0x5146a5[_0x5da8('0x2e')][_0x5da8('0x1e')]);_0x1cc7f7['offset']=qs['offset'](_0x5146a5['query']['offset']);}_0x1cc7f7[_0x5da8('0x36')]=qs[_0x5da8('0x37')](_0x5146a5[_0x5da8('0x2e')][_0x5da8('0x37')]);_0x1cc7f7[_0x5da8('0x38')]=qs['filters'](_[_0x5da8('0x39')](_0x5146a5['query'],_0x480ce0[_0x5da8('0x30')]),_0x442d5c);if(_0x5146a5[_0x5da8('0x2e')][_0x5da8('0x3a')]){_0x1cc7f7['where']=_['merge'](_0x1cc7f7[_0x5da8('0x38')],{'$or':_[_0x5da8('0x29')](_0x442d5c,function(_0x1c7853){if(_0x1c7853['type']!==_0x5da8('0x3b')){var _0x4e9c96={};_0x4e9c96[_0x1c7853[_0x5da8('0x26')]]={'$like':'%'+_0x5146a5[_0x5da8('0x2e')][_0x5da8('0x3a')]+'%'};return _0x4e9c96;}})});}_0x1cc7f7=_[_0x5da8('0x3c')]({},_0x1cc7f7,_0x5146a5['options']);var _0x5753f8={'where':_0x1cc7f7['where']};return db['AnalyticFieldReport']['count'](_0x5753f8)[_0x5da8('0x24')](function(_0x303fe){_0x31e524['count']=_0x303fe;if(_0x5146a5[_0x5da8('0x2e')]['includeAll']){_0x1cc7f7['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x5da8('0x3d')](_0x1cc7f7);})['then'](function(_0x57ef0c){_0x31e524[_0x5da8('0x3e')]=_0x57ef0c;return _0x31e524;})[_0x5da8('0x24')](respondWithFilteredResult(_0x663cb8,_0x1cc7f7))[_0x5da8('0x3f')](handleError(_0x663cb8,null));};exports[_0x5da8('0x40')]=function(_0x1c1e3f,_0x3e7320){var _0xebb360={'raw':![],'where':{'id':_0x1c1e3f[_0x5da8('0x41')]['id']}},_0x41d710={};_0x41d710['model']=_[_0x5da8('0x2f')](db['AnalyticFieldReport'][_0x5da8('0x2a')]);_0x41d710[_0x5da8('0x2e')]=_['keys'](_0x1c1e3f[_0x5da8('0x2e')]);_0x41d710['filters']=_[_0x5da8('0x31')](_0x41d710[_0x5da8('0x2d')],_0x41d710['query']);_0xebb360['attributes']=_[_0x5da8('0x31')](_0x41d710['model'],qs[_0x5da8('0x42')](_0x1c1e3f[_0x5da8('0x2e')][_0x5da8('0x42')]));_0xebb360[_0x5da8('0x32')]=_0xebb360[_0x5da8('0x32')][_0x5da8('0x33')]?_0xebb360[_0x5da8('0x32')]:_0x41d710['model'];if(_0x1c1e3f[_0x5da8('0x2e')][_0x5da8('0x43')]){_0xebb360[_0x5da8('0x44')]=[{'all':!![]}];}_0xebb360=_[_0x5da8('0x3c')]({},_0xebb360,_0x1c1e3f['options']);return db['AnalyticFieldReport']['find'](_0xebb360)[_0x5da8('0x24')](handleEntityNotFound(_0x3e7320,null))['then'](respondWithResult(_0x3e7320,null))[_0x5da8('0x3f')](handleError(_0x3e7320,null));};exports['create']=function(_0x1ee375,_0x74cb07){return db[_0x5da8('0x45')][_0x5da8('0x46')](_0x1ee375['body'],{})[_0x5da8('0x24')](respondWithResult(_0x74cb07,0xc9))[_0x5da8('0x3f')](handleError(_0x74cb07,null));};exports[_0x5da8('0x47')]=function(_0x6a4859,_0x10e8f4){return db[_0x5da8('0x45')]['bulkCreate'](_0x6a4859[_0x5da8('0x48')],{'raw':![],'individualHooks':!![]})[_0x5da8('0x24')](respondWithResult(_0x10e8f4,0xc9))['catch'](handleError(_0x10e8f4,null));};exports['update']=function(_0x27464c,_0x587c74){if(_0x27464c['body']['id']){delete _0x27464c[_0x5da8('0x48')]['id'];}return db[_0x5da8('0x45')]['find']({'where':{'id':_0x27464c['params']['id']}})[_0x5da8('0x24')](handleEntityNotFound(_0x587c74,null))[_0x5da8('0x24')](saveUpdates(_0x27464c[_0x5da8('0x48')],null))[_0x5da8('0x24')](respondWithResult(_0x587c74,null))[_0x5da8('0x3f')](handleError(_0x587c74,null));};exports[_0x5da8('0x23')]=function(_0x557fae,_0x2eedae){return db[_0x5da8('0x45')][_0x5da8('0x49')]({'where':{'id':_0x557fae['params']['id']}})[_0x5da8('0x24')](handleEntityNotFound(_0x2eedae,null))[_0x5da8('0x24')](removeEntity(_0x2eedae,null))['catch'](handleError(_0x2eedae,null));};exports[_0x5da8('0x4a')]=function(_0x5edc00,_0x2a8e4f){return db[_0x5da8('0x45')][_0x5da8('0x23')]({'where':{'id':_0x5edc00[_0x5da8('0x2e')][_0x5da8('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x5da8('0x24')](respondWithResult(_0x2a8e4f,0xcc))[_0x5da8('0x3f')](handleError(_0x2a8e4f,null));};exports[_0x5da8('0x4c')]=function(_0x3c2eaa,_0x192911,_0x5aae3b){return db[_0x5da8('0x4d')][_0x5da8('0x4e')]({'where':{'id':_0x3c2eaa['params']['id']}})[_0x5da8('0x24')](handleEntityNotFound(_0x192911,null))[_0x5da8('0x24')](function(_0x5b0851){if(_0x5b0851){return db['sequelize'][_0x5da8('0x4f')](function(_0x33b4ea){return db[_0x5da8('0x45')][_0x5da8('0x23')]({'where':{'CustomReportId':_0x3c2eaa[_0x5da8('0x41')]['id']},'transaction':_0x33b4ea})['then'](function(_0x55498d){var _0x26ad6e=_['map'](_0x3c2eaa[_0x5da8('0x48')],function(_0x2ca5f7){delete _0x2ca5f7['id'];_0x2ca5f7[_0x5da8('0x50')]=_0x3c2eaa['params']['id'];return _0x2ca5f7;});return db[_0x5da8('0x45')][_0x5da8('0x47')](_0x26ad6e,{'transaction':_0x33b4ea});});})[_0x5da8('0x24')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x3c2eaa['params']['id']}});});}})[_0x5da8('0x24')](respondWithResult(_0x192911,null))[_0x5da8('0x3f')](handleError(_0x192911,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 79a2148..a0045b7 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 _0x01fd=['exports','define','AnalyticFieldReport','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes'];(function(_0x449039,_0x23a6fd){var _0x34451e=function(_0x3560b0){while(--_0x3560b0){_0x449039['push'](_0x449039['shift']());}};_0x34451e(++_0x23a6fd);}(_0x01fd,0xc3));var _0xd01f=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x01fd[_0x1a7550];return _0x426e22;};'use strict';var _=require('lodash');var util=require(_0xd01f('0x0'));var logger=require(_0xd01f('0x1'))(_0xd01f('0x2'));var moment=require(_0xd01f('0x3'));var BPromise=require(_0xd01f('0x4'));var rp=require(_0xd01f('0x5'));var fs=require('fs');var path=require(_0xd01f('0x6'));var rimraf=require(_0xd01f('0x7'));var config=require('../../config/environment');var attributes=require(_0xd01f('0x8'));module[_0xd01f('0x9')]=function(_0x5a730c,_0x51935d){return _0x5a730c[_0xd01f('0xa')](_0xd01f('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x651a=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x1ae1fb,_0x81c2ec){var _0x57166=function(_0x48c137){while(--_0x48c137){_0x1ae1fb['push'](_0x1ae1fb['shift']());}};_0x57166(++_0x81c2ec);}(_0x651a,0x184));var _0xa651=function(_0x1f1731,_0x4b77eb){_0x1f1731=_0x1f1731-0x0;var _0x1f7625=_0x651a[_0x1f1731];return _0x1f7625;};'use strict';var _=require(_0xa651('0x0'));var util=require(_0xa651('0x1'));var logger=require(_0xa651('0x2'))(_0xa651('0x3'));var moment=require(_0xa651('0x4'));var BPromise=require(_0xa651('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa651('0x6'));var rimraf=require(_0xa651('0x7'));var config=require(_0xa651('0x8'));var attributes=require(_0xa651('0x9'));module[_0xa651('0xa')]=function(_0x5359d4,_0x2553e9){return _0x5359d4['define'](_0xa651('0xb'),attributes,{'tableName':_0xa651('0xc'),'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 f82882e..c7bc352 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 _0x513e=['../../config/environment','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xc03c9d,_0x1412fc){var _0x2c11=function(_0x3b7543){while(--_0x3b7543){_0xc03c9d['push'](_0xc03c9d['shift']());}};_0x2c11(++_0x1412fc);}(_0x513e,0x138));var _0xe513=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x513e[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xe513('0x0'));var util=require(_0xe513('0x1'));var moment=require(_0xe513('0x2'));var BPromise=require(_0xe513('0x3'));var rs=require(_0xe513('0x4'));var fs=require('fs');var Redis=require(_0xe513('0x5'));var db=require(_0xe513('0x6'))['db'];var utils=require(_0xe513('0x7'));var logger=require(_0xe513('0x8'))(_0xe513('0x9'));var config=require(_0xe513('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe513('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dd1bd,_0x125157,_0xd98878){return new BPromise(function(_0x41a943,_0x395486){return client[_0xe513('0xc')](_0x2dd1bd,_0xd98878)[_0xe513('0xd')](function(_0x3d0e6c){logger[_0xe513('0xe')](_0xe513('0xf'),_0x125157,'request\x20sent');logger[_0xe513('0x10')](_0xe513('0x11'),_0x125157,_0xe513('0x12'),JSON['stringify'](_0x3d0e6c));if(_0x3d0e6c[_0xe513('0x13')]){if(_0x3d0e6c[_0xe513('0x13')][_0xe513('0x14')]===0x1f4){logger[_0xe513('0x13')](_0xe513('0xf'),_0x125157,_0x3d0e6c[_0xe513('0x13')][_0xe513('0x15')]);return _0x395486(_0x3d0e6c['error'][_0xe513('0x15')]);}logger[_0xe513('0x13')](_0xe513('0xf'),_0x125157,_0x3d0e6c[_0xe513('0x13')][_0xe513('0x15')]);return _0x41a943(_0x3d0e6c['error']['message']);}else{logger[_0xe513('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x125157,'request\x20sent');_0x41a943(_0x3d0e6c[_0xe513('0x16')][_0xe513('0x15')]);}})['catch'](function(_0x28582e){logger[_0xe513('0x13')](_0xe513('0xf'),_0x125157,_0x28582e);_0x395486(_0x28582e);});});} \ No newline at end of file +var _0xa42e=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x27e5ac,_0x3faaa3){var _0x4a8c79=function(_0x1f1989){while(--_0x1f1989){_0x27e5ac['push'](_0x27e5ac['shift']());}};_0x4a8c79(++_0x3faaa3);}(_0xa42e,0xec));var _0xea42=function(_0x1dc99e,_0x16a117){_0x1dc99e=_0x1dc99e-0x0;var _0x4b3113=_0xa42e[_0x1dc99e];return _0x4b3113;};'use strict';var _=require(_0xea42('0x0'));var util=require(_0xea42('0x1'));var moment=require(_0xea42('0x2'));var BPromise=require(_0xea42('0x3'));var rs=require(_0xea42('0x4'));var fs=require('fs');var Redis=require(_0xea42('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea42('0x6'));var config=require(_0xea42('0x7'));var jayson=require(_0xea42('0x8'));var client=jayson[_0xea42('0x9')][_0xea42('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f6063,_0x39a02a,_0x39f235){return new BPromise(function(_0x3b8553,_0x366ca6){return client[_0xea42('0xb')](_0x4f6063,_0x39f235)[_0xea42('0xc')](function(_0x339486){logger[_0xea42('0xd')](_0xea42('0xe'),_0x39a02a,_0xea42('0xf'));logger[_0xea42('0x10')](_0xea42('0x11'),_0x39a02a,_0xea42('0xf'),JSON[_0xea42('0x12')](_0x339486));if(_0x339486['error']){if(_0x339486[_0xea42('0x13')][_0xea42('0x14')]===0x1f4){logger[_0xea42('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x39a02a,_0x339486['error']['message']);return _0x366ca6(_0x339486[_0xea42('0x13')][_0xea42('0x15')]);}logger[_0xea42('0x13')](_0xea42('0xe'),_0x39a02a,_0x339486[_0xea42('0x13')][_0xea42('0x15')]);return _0x3b8553(_0x339486['error'][_0xea42('0x15')]);}else{logger[_0xea42('0xd')](_0xea42('0xe'),_0x39a02a,_0xea42('0xf'));_0x3b8553(_0x339486[_0xea42('0x16')][_0xea42('0x15')]);}})['catch'](function(_0x5c718f){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x39a02a,_0x5c718f);_0x366ca6(_0x5c718f);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 78f76f4..82fb8c2 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(_0x4a601e,_0x268dfb){var _0x451d47=function(_0x4ac46f){while(--_0x4ac46f){_0x4a601e['push'](_0x4a601e['shift']());}};_0x451d47(++_0x268dfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x14c5c3,_0x3ae959){var _0x4b1ecc=function(_0xc8fe33){while(--_0xc8fe33){_0x14c5c3['push'](_0x14c5c3['shift']());}};_0x4b1ecc(++_0x3ae959);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 d912e3f..cf2568f 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 _0xfc03=['STRING','name','TEXT','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfc03,0x16f));var _0x3fc0=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xfc03[_0x5627e1];return _0x2f013f;};'use strict';var Sequelize=require(_0x3fc0('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fc0('0x1')],'allowNull':![],'unique':_0x3fc0('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x3fc0('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9354=['exports','STRING','TEXT'];(function(_0xb03c1c,_0x2f98ed){var _0x507e93=function(_0xbb4f3f){while(--_0xbb4f3f){_0xb03c1c['push'](_0xb03c1c['shift']());}};_0x507e93(++_0x2f98ed);}(_0x9354,0x96));var _0x4935=function(_0x34ed48,_0x2cc995){_0x34ed48=_0x34ed48-0x0;var _0x37da5c=_0x9354[_0x34ed48];return _0x37da5c;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'name':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x4935('0x1')]},'metric':{'type':Sequelize[_0x4935('0x2')]},'description':{'type':Sequelize[_0x4935('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 9b9a048..0b4e752 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 _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x4b15ec,_0x5db374){var _0x6a8309=function(_0x34c22c){while(--_0x34c22c){_0x4b15ec['push'](_0x4b15ec['shift']());}};_0x6a8309(++_0x5db374);}(_0xa41a,0x6b));var _0xaa41=function(_0x4502d1,_0x26601f){_0x4502d1=_0x4502d1-0x0;var _0x34baa6=_0xa41a[_0x4502d1];return _0x34baa6;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file +var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x23fd09,_0x51c74c){var _0x5d8176=function(_0x178bc6){while(--_0x178bc6){_0x23fd09['push'](_0x23fd09['shift']());}};_0x5d8176(++_0x51c74c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1129dd,_0x408c){_0x1129dd=_0x1129dd-0x0;var _0x40755=_0x8d0e[_0x1129dd];return _0x40755;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 972e039..cd8830b 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 _0x80c3=['define','AnalyticMetric','analytics_metrics','lodash','api','bluebird','request-promise','path','exports'];(function(_0x5a5db0,_0x4c9d2c){var _0x5a45da=function(_0x574994){while(--_0x574994){_0x5a5db0['push'](_0x5a5db0['shift']());}};_0x5a45da(++_0x4c9d2c);}(_0x80c3,0x18f));var _0x380c=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x80c3[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x380c('0x1'));var moment=require('moment');var BPromise=require(_0x380c('0x2'));var rp=require(_0x380c('0x3'));var fs=require('fs');var path=require(_0x380c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x380c('0x5')]=function(_0x595b66,_0x581c96){return _0x595b66[_0x380c('0x6')](_0x380c('0x7'),attributes,{'tableName':_0x380c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb8b=['AnalyticMetric','analytics_metrics','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x1af5af,_0x5cc834){var _0x106eb2=function(_0x1203ec){while(--_0x1203ec){_0x1af5af['push'](_0x1af5af['shift']());}};_0x106eb2(++_0x5cc834);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x400df3,_0x27fe20){_0x400df3=_0x400df3-0x0;var _0x6cc9fe=_0xdb8b[_0x400df3];return _0x6cc9fe;};'use strict';var _=require('lodash');var util=require(_0xbdb8('0x0'));var logger=require(_0xbdb8('0x1'))(_0xbdb8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbdb8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdb8('0x4'));var config=require(_0xbdb8('0x5'));var attributes=require(_0xbdb8('0x6'));module[_0xbdb8('0x7')]=function(_0x4c6bdb,_0x7affe8){return _0x4c6bdb['define'](_0xbdb8('0x8'),attributes,{'tableName':_0xbdb8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 7aec4d4..be576db 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 _0x6678=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x49ffaf,_0x52ca64){var _0x32d9c8=function(_0x46e1f7){while(--_0x46e1f7){_0x49ffaf['push'](_0x49ffaf['shift']());}};_0x32d9c8(++_0x52ca64);}(_0x6678,0xb8));var _0x8667=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x6678[_0x1305e3];return _0x1068e9;};'use strict';var _=require(_0x8667('0x0'));var util=require(_0x8667('0x1'));var moment=require(_0x8667('0x2'));var BPromise=require(_0x8667('0x3'));var rs=require(_0x8667('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8667('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8667('0x6'))('rpc');var config=require(_0x8667('0x7'));var jayson=require(_0x8667('0x8'));var client=jayson[_0x8667('0x9')][_0x8667('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa2ae4d,_0x36b691,_0x3b75f5){return new BPromise(function(_0x3e363d,_0x310d45){return client['request'](_0xa2ae4d,_0x3b75f5)[_0x8667('0xb')](function(_0x5f1506){logger[_0x8667('0xc')](_0x8667('0xd'),_0x36b691,_0x8667('0xe'));logger[_0x8667('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x36b691,_0x8667('0xe'),JSON[_0x8667('0x10')](_0x5f1506));if(_0x5f1506[_0x8667('0x11')]){if(_0x5f1506['error'][_0x8667('0x12')]===0x1f4){logger[_0x8667('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x36b691,_0x5f1506['error'][_0x8667('0x13')]);return _0x310d45(_0x5f1506[_0x8667('0x11')][_0x8667('0x13')]);}logger[_0x8667('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x36b691,_0x5f1506['error'][_0x8667('0x13')]);return _0x3e363d(_0x5f1506['error']['message']);}else{logger[_0x8667('0xc')](_0x8667('0xd'),_0x36b691,_0x8667('0xe'));_0x3e363d(_0x5f1506[_0x8667('0x14')][_0x8667('0x13')]);}})[_0x8667('0x15')](function(_0x18eb22){logger['error'](_0x8667('0xd'),_0x36b691,_0x18eb22);_0x310d45(_0x18eb22);});});} \ No newline at end of file +var _0x2fec=['../../config/logger','../../config/environment','jayson/promise','client','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x11dd70,_0x7fcb27){var _0x4fb490=function(_0x21d95e){while(--_0x21d95e){_0x11dd70['push'](_0x11dd70['shift']());}};_0x4fb490(++_0x7fcb27);}(_0x2fec,0x13e));var _0xc2fe=function(_0x13816a,_0x409dac){_0x13816a=_0x13816a-0x0;var _0x16f428=_0x2fec[_0x13816a];return _0x16f428;};'use strict';var _=require('lodash');var util=require(_0xc2fe('0x0'));var moment=require(_0xc2fe('0x1'));var BPromise=require(_0xc2fe('0x2'));var rs=require(_0xc2fe('0x3'));var fs=require('fs');var Redis=require(_0xc2fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc2fe('0x5'))('rpc');var config=require(_0xc2fe('0x6'));var jayson=require(_0xc2fe('0x7'));var client=jayson[_0xc2fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x493dcb,_0xbccc84,_0x486550){return new BPromise(function(_0x472235,_0x5dd602){return client['request'](_0x493dcb,_0x486550)[_0xc2fe('0x9')](function(_0x2b2cf7){logger['info'](_0xc2fe('0xa'),_0xbccc84,_0xc2fe('0xb'));logger['debug'](_0xc2fe('0xc'),_0xbccc84,_0xc2fe('0xb'),JSON[_0xc2fe('0xd')](_0x2b2cf7));if(_0x2b2cf7[_0xc2fe('0xe')]){if(_0x2b2cf7[_0xc2fe('0xe')][_0xc2fe('0xf')]===0x1f4){logger[_0xc2fe('0xe')](_0xc2fe('0xa'),_0xbccc84,_0x2b2cf7[_0xc2fe('0xe')][_0xc2fe('0x10')]);return _0x5dd602(_0x2b2cf7[_0xc2fe('0xe')][_0xc2fe('0x10')]);}logger[_0xc2fe('0xe')](_0xc2fe('0xa'),_0xbccc84,_0x2b2cf7['error'][_0xc2fe('0x10')]);return _0x472235(_0x2b2cf7[_0xc2fe('0xe')][_0xc2fe('0x10')]);}else{logger[_0xc2fe('0x11')](_0xc2fe('0xa'),_0xbccc84,_0xc2fe('0xb'));_0x472235(_0x2b2cf7['result'][_0xc2fe('0x10')]);}})[_0xc2fe('0x12')](function(_0x18a7f3){logger[_0xc2fe('0xe')](_0xc2fe('0xa'),_0xbccc84,_0x18a7f3);_0x5dd602(_0x18a7f3);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 1c81a0f..fb3027c 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 _0xed1f=['../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x519420,_0x2624cf){var _0x33817a=function(_0xdba68b){while(--_0xdba68b){_0x519420['push'](_0x519420['shift']());}};_0x33817a(++_0x2624cf);}(_0xed1f,0x6a));var _0xfed1=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xed1f[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0xd')]);router[_0xfed1('0xb')](_0xfed1('0xe'),auth[_0xfed1('0xc')](),controller[_0xfed1('0xf')]);router['post']('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xe'),auth[_0xfed1('0xc')](),controller['update']);router[_0xfed1('0x11')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x12')]);module['exports']=router; \ No newline at end of file +var _0xfb82=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x20f14f,_0x4987f1){var _0x60e03f=function(_0x5acb33){while(--_0x5acb33){_0x20f14f['push'](_0x20f14f['shift']());}};_0x60e03f(++_0x4987f1);}(_0xfb82,0x17f));var _0x2fb8=function(_0xf82424,_0x48e2e9){_0xf82424=_0xf82424-0x0;var _0x24007e=_0xfb82[_0xf82424];return _0x24007e;};'use strict';var multer=require(_0x2fb8('0x0'));var util=require(_0x2fb8('0x1'));var path=require(_0x2fb8('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fb8('0x3'));var router=express[_0x2fb8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fb8('0x5'));var interaction=require(_0x2fb8('0x6'));var config=require(_0x2fb8('0x7'));var controller=require(_0x2fb8('0x8'));router[_0x2fb8('0x9')]('/',auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xb')]);router[_0x2fb8('0x9')](_0x2fb8('0xc'),auth[_0x2fb8('0xa')](),controller['show']);router[_0x2fb8('0xd')]('/',auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xe')]);router[_0x2fb8('0xf')](_0x2fb8('0xc'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0x10')]);router[_0x2fb8('0x11')](_0x2fb8('0xc'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0x12')]);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 dc944de..c793689 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 _0xaf34=['TEXT','sequelize'];(function(_0x5f2643,_0x2f987f){var _0x2d05dc=function(_0x55c0c3){while(--_0x55c0c3){_0x5f2643['push'](_0x5f2643['shift']());}};_0x2d05dc(++_0x2f987f);}(_0xaf34,0x163));var _0x4af3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xaf34[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x4af3('0x0'));module['exports']={'tree':{'type':Sequelize[_0x4af3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xbe77=['sequelize'];(function(_0x4c38a7,_0x264431){var _0x3ca3e8=function(_0x4fe153){while(--_0x4fe153){_0x4c38a7['push'](_0x4c38a7['shift']());}};_0x3ca3e8(++_0x264431);}(_0xbe77,0x16d));var _0x7be7=function(_0x5b7ce0,_0x45703d){_0x5b7ce0=_0x5b7ce0-0x0;var _0x5def41=_0xbe77[_0x5b7ce0];return _0x5def41;};'use strict';var Sequelize=require(_0x7be7('0x0'));module['exports']={'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 422dec2..7c47243 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 _0x32f9=['params','length','find','create','body','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x310dc1,_0x5bf189){var _0x23a052=function(_0x306853){while(--_0x306853){_0x310dc1['push'](_0x310dc1['shift']());}};_0x23a052(++_0x5bf189);}(_0x32f9,0x186));var _0x932f=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x32f9[_0x62c958];return _0x57ec61;};'use strict';var emlformat=require(_0x932f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x932f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x932f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x932f('0x3'));var util=require(_0x932f('0x4'));var path=require(_0x932f('0x5'));var sox=require(_0x932f('0x6'));var csv=require(_0x932f('0x7'));var ejs=require(_0x932f('0x8'));var fs=require('fs');var fs_extra=require(_0x932f('0x9'));var _=require(_0x932f('0xa'));var squel=require(_0x932f('0xb'));var crypto=require('crypto');var jsforce=require(_0x932f('0xc'));var deskjs=require(_0x932f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x932f('0xe'));var Papa=require(_0x932f('0xf'));var Redis=require(_0x932f('0x10'));var authService=require(_0x932f('0x11'));var qs=require(_0x932f('0x12'));var as=require(_0x932f('0x13'));var hardwareService=require(_0x932f('0x14'));var logger=require(_0x932f('0x15'))('api');var utils=require(_0x932f('0x16'));var config=require(_0x932f('0x17'));var licenseUtil=require(_0x932f('0x18'));var db=require(_0x932f('0x19'))['db'];function respondWithStatusCode(_0x366f95,_0xa64e67){_0xa64e67=_0xa64e67||0xcc;return function(_0x9c03a5){if(_0x9c03a5){return _0x366f95[_0x932f('0x1a')](_0xa64e67);}return _0x366f95[_0x932f('0x1b')](_0xa64e67)[_0x932f('0x1c')]();};}function respondWithResult(_0x538b9d,_0x35db39){_0x35db39=_0x35db39||0xc8;return function(_0x58cb11){if(_0x58cb11){return _0x538b9d['status'](_0x35db39)[_0x932f('0x1d')](_0x58cb11);}};}function respondWithFilteredResult(_0x44c471,_0x6ccfbe){return function(_0x2a069e){if(_0x2a069e){var _0x1cba4c=typeof _0x6ccfbe[_0x932f('0x1e')]===_0x932f('0x1f')&&typeof _0x6ccfbe['limit']==='undefined';var _0x550734=_0x2a069e['count'];var _0x76b57b=_0x1cba4c?0x0:_0x6ccfbe['offset'];var _0x11a464=_0x1cba4c?_0x2a069e[_0x932f('0x20')]:_0x6ccfbe['offset']+_0x6ccfbe[_0x932f('0x21')];var _0x30c2ce;if(_0x11a464>=_0x550734){_0x11a464=_0x550734;_0x30c2ce=0xc8;}else{_0x30c2ce=0xce;}_0x44c471[_0x932f('0x1b')](_0x30c2ce);return _0x44c471['set']('Content-Range',_0x76b57b+'-'+_0x11a464+'/'+_0x550734)['json'](_0x2a069e);}return null;};}function patchUpdates(_0x5f4ade){return function(_0x5c025b){try{jsonpatch[_0x932f('0x22')](_0x5c025b,_0x5f4ade,!![]);}catch(_0x2200bf){return BPromise[_0x932f('0x23')](_0x2200bf);}return _0x5c025b[_0x932f('0x24')]();};}function saveUpdates(_0xb5512b,_0x515451){return function(_0x503dbc){if(_0x503dbc){return _0x503dbc[_0x932f('0x25')](_0xb5512b)[_0x932f('0x26')](function(_0xc19cad){return _0xc19cad;});}return null;};}function removeEntity(_0x50ac85,_0x242ee9){return function(_0x2f1318){if(_0x2f1318){return _0x2f1318[_0x932f('0x27')]()[_0x932f('0x26')](function(){_0x50ac85[_0x932f('0x1b')](0xcc)[_0x932f('0x1c')]();});}};}function handleEntityNotFound(_0x4938d5,_0x374d19){return function(_0x433c5c){if(!_0x433c5c){_0x4938d5[_0x932f('0x1a')](0x194);}return _0x433c5c;};}function handleError(_0x329a79,_0x5c155b){_0x5c155b=_0x5c155b||0x1f4;return function(_0x21b3c4){logger[_0x932f('0x28')](_0x21b3c4[_0x932f('0x29')]);if(_0x21b3c4['name']){delete _0x21b3c4[_0x932f('0x2a')];}_0x329a79[_0x932f('0x1b')](_0x5c155b)['send'](_0x21b3c4);};}exports[_0x932f('0x2b')]=function(_0x583568,_0x52039a){var _0x20c166={},_0x413b8a={},_0x25bf96={'count':0x0,'rows':[]};var _0xee4e0c=_[_0x932f('0x2c')](db[_0x932f('0x2d')][_0x932f('0x2e')],function(_0x5a9824){return{'name':_0x5a9824[_0x932f('0x2f')],'type':_0x5a9824[_0x932f('0x30')][_0x932f('0x31')]};});_0x413b8a[_0x932f('0x32')]=_[_0x932f('0x2c')](_0xee4e0c,_0x932f('0x2a'));_0x413b8a['query']=_[_0x932f('0x33')](_0x583568[_0x932f('0x34')]);_0x413b8a[_0x932f('0x35')]=_[_0x932f('0x36')](_0x413b8a['model'],_0x413b8a['query']);_0x20c166[_0x932f('0x37')]=_['intersection'](_0x413b8a['model'],qs['fields'](_0x583568[_0x932f('0x34')][_0x932f('0x38')]));_0x20c166[_0x932f('0x37')]=_0x20c166[_0x932f('0x37')]['length']?_0x20c166['attributes']:_0x413b8a[_0x932f('0x32')];if(!_0x583568[_0x932f('0x34')][_0x932f('0x39')](_0x932f('0x3a'))){_0x20c166[_0x932f('0x21')]=qs['limit'](_0x583568['query']['limit']);_0x20c166[_0x932f('0x1e')]=qs[_0x932f('0x1e')](_0x583568[_0x932f('0x34')][_0x932f('0x1e')]);}_0x20c166[_0x932f('0x3b')]=qs[_0x932f('0x3c')](_0x583568['query'][_0x932f('0x3c')]);_0x20c166['where']=qs['filters'](_[_0x932f('0x3d')](_0x583568[_0x932f('0x34')],_0x413b8a[_0x932f('0x35')]),_0xee4e0c);if(_0x583568['query'][_0x932f('0x3e')]){_0x20c166[_0x932f('0x3f')]=_[_0x932f('0x40')](_0x20c166[_0x932f('0x3f')],{'$or':_[_0x932f('0x2c')](_0xee4e0c,function(_0x3e2d3b){if(_0x3e2d3b[_0x932f('0x30')]!==_0x932f('0x41')){var _0x554166={};_0x554166[_0x3e2d3b[_0x932f('0x2a')]]={'$like':'%'+_0x583568['query'][_0x932f('0x3e')]+'%'};return _0x554166;}})});}_0x20c166=_['merge']({},_0x20c166,_0x583568[_0x932f('0x42')]);var _0x52bee0={'where':_0x20c166[_0x932f('0x3f')]};return db[_0x932f('0x2d')]['count'](_0x52bee0)[_0x932f('0x26')](function(_0x83d08){_0x25bf96[_0x932f('0x20')]=_0x83d08;if(_0x583568['query']['includeAll']){_0x20c166[_0x932f('0x43')]=[{'all':!![]}];}return db[_0x932f('0x2d')][_0x932f('0x44')](_0x20c166);})[_0x932f('0x26')](function(_0x201052){_0x25bf96[_0x932f('0x45')]=_0x201052;return _0x25bf96;})[_0x932f('0x26')](respondWithFilteredResult(_0x52039a,_0x20c166))[_0x932f('0x46')](handleError(_0x52039a,null));};exports[_0x932f('0x47')]=function(_0x4badc2,_0x4ea626){var _0x9ea30d={'raw':!![],'where':{'id':_0x4badc2[_0x932f('0x48')]['id']}},_0x3d70fe={};_0x3d70fe[_0x932f('0x32')]=_['keys'](db[_0x932f('0x2d')][_0x932f('0x2e')]);_0x3d70fe[_0x932f('0x34')]=_[_0x932f('0x33')](_0x4badc2[_0x932f('0x34')]);_0x3d70fe[_0x932f('0x35')]=_[_0x932f('0x36')](_0x3d70fe['model'],_0x3d70fe[_0x932f('0x34')]);_0x9ea30d['attributes']=_[_0x932f('0x36')](_0x3d70fe[_0x932f('0x32')],qs[_0x932f('0x38')](_0x4badc2[_0x932f('0x34')][_0x932f('0x38')]));_0x9ea30d[_0x932f('0x37')]=_0x9ea30d['attributes'][_0x932f('0x49')]?_0x9ea30d[_0x932f('0x37')]:_0x3d70fe[_0x932f('0x32')];if(_0x4badc2[_0x932f('0x34')]['includeAll']){_0x9ea30d['include']=[{'all':!![]}];}_0x9ea30d=_[_0x932f('0x40')]({},_0x9ea30d,_0x4badc2['options']);return db[_0x932f('0x2d')][_0x932f('0x4a')](_0x9ea30d)[_0x932f('0x26')](handleEntityNotFound(_0x4ea626,null))[_0x932f('0x26')](respondWithResult(_0x4ea626,null))[_0x932f('0x46')](handleError(_0x4ea626,null));};exports[_0x932f('0x4b')]=function(_0x9712d7,_0x465d88){return db[_0x932f('0x2d')][_0x932f('0x4b')](_0x9712d7[_0x932f('0x4c')],{})['then'](respondWithResult(_0x465d88,0xc9))[_0x932f('0x46')](handleError(_0x465d88,null));};exports[_0x932f('0x25')]=function(_0x245977,_0x4ae3f5){if(_0x245977[_0x932f('0x4c')]['id']){delete _0x245977[_0x932f('0x4c')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x245977[_0x932f('0x48')]['id']}})[_0x932f('0x26')](handleEntityNotFound(_0x4ae3f5,null))[_0x932f('0x26')](saveUpdates(_0x245977[_0x932f('0x4c')],null))[_0x932f('0x26')](respondWithResult(_0x4ae3f5,null))[_0x932f('0x46')](handleError(_0x4ae3f5,null));};exports['destroy']=function(_0x507591,_0xadc753){return db[_0x932f('0x2d')][_0x932f('0x4a')]({'where':{'id':_0x507591['params']['id']}})[_0x932f('0x26')](handleEntityNotFound(_0xadc753,null))[_0x932f('0x26')](removeEntity(_0xadc753,null))[_0x932f('0x46')](handleError(_0xadc753,null));}; \ No newline at end of file +var _0x33d2=['util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','params','include','find','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xa45f1d,_0x1d2e89){var _0x2eabe0=function(_0x18f383){while(--_0x18f383){_0xa45f1d['push'](_0xa45f1d['shift']());}};_0x2eabe0(++_0x1d2e89);}(_0x33d2,0x89));var _0x233d=function(_0x16f775,_0x45b10f){_0x16f775=_0x16f775-0x0;var _0x17d9e2=_0x33d2[_0x16f775];return _0x17d9e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x233d('0x0'));var zipdir=require(_0x233d('0x1'));var jsonpatch=require(_0x233d('0x2'));var rp=require(_0x233d('0x3'));var moment=require(_0x233d('0x4'));var BPromise=require(_0x233d('0x5'));var Mustache=require(_0x233d('0x6'));var util=require(_0x233d('0x7'));var path=require(_0x233d('0x8'));var sox=require('sox');var csv=require(_0x233d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x233d('0xa'));var _=require(_0x233d('0xb'));var squel=require(_0x233d('0xc'));var crypto=require('crypto');var jsforce=require(_0x233d('0xd'));var deskjs=require(_0x233d('0xe'));var toCsv=require(_0x233d('0x9'));var querystring=require('querystring');var Papa=require(_0x233d('0xf'));var Redis=require(_0x233d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x233d('0x11'));var logger=require(_0x233d('0x12'))('api');var utils=require(_0x233d('0x13'));var config=require(_0x233d('0x14'));var licenseUtil=require(_0x233d('0x15'));var db=require(_0x233d('0x16'))['db'];function respondWithStatusCode(_0xfc88f3,_0x162d74){_0x162d74=_0x162d74||0xcc;return function(_0x2b66e2){if(_0x2b66e2){return _0xfc88f3[_0x233d('0x17')](_0x162d74);}return _0xfc88f3[_0x233d('0x18')](_0x162d74)[_0x233d('0x19')]();};}function respondWithResult(_0x6ae7ab,_0x1bbaa6){_0x1bbaa6=_0x1bbaa6||0xc8;return function(_0x4b87a8){if(_0x4b87a8){return _0x6ae7ab[_0x233d('0x18')](_0x1bbaa6)['json'](_0x4b87a8);}};}function respondWithFilteredResult(_0x420ce6,_0x1fb54f){return function(_0x428ae9){if(_0x428ae9){var _0x2f8a38=typeof _0x1fb54f[_0x233d('0x1a')]===_0x233d('0x1b')&&typeof _0x1fb54f[_0x233d('0x1c')]===_0x233d('0x1b');var _0x82c71=_0x428ae9[_0x233d('0x1d')];var _0xab0474=_0x2f8a38?0x0:_0x1fb54f[_0x233d('0x1a')];var _0x2d9c22=_0x2f8a38?_0x428ae9[_0x233d('0x1d')]:_0x1fb54f['offset']+_0x1fb54f[_0x233d('0x1c')];var _0x505f8d;if(_0x2d9c22>=_0x82c71){_0x2d9c22=_0x82c71;_0x505f8d=0xc8;}else{_0x505f8d=0xce;}_0x420ce6[_0x233d('0x18')](_0x505f8d);return _0x420ce6['set'](_0x233d('0x1e'),_0xab0474+'-'+_0x2d9c22+'/'+_0x82c71)[_0x233d('0x1f')](_0x428ae9);}return null;};}function patchUpdates(_0x5ed5fb){return function(_0x1b4bb6){try{jsonpatch[_0x233d('0x20')](_0x1b4bb6,_0x5ed5fb,!![]);}catch(_0x49e866){return BPromise[_0x233d('0x21')](_0x49e866);}return _0x1b4bb6[_0x233d('0x22')]();};}function saveUpdates(_0x454d25,_0x34df63){return function(_0x3b5f0a){if(_0x3b5f0a){return _0x3b5f0a[_0x233d('0x23')](_0x454d25)[_0x233d('0x24')](function(_0x21ea34){return _0x21ea34;});}return null;};}function removeEntity(_0x4faa29,_0x41fd9e){return function(_0x26abae){if(_0x26abae){return _0x26abae['destroy']()['then'](function(){_0x4faa29[_0x233d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481f11,_0x50b27a){return function(_0x3e5d2e){if(!_0x3e5d2e){_0x481f11['sendStatus'](0x194);}return _0x3e5d2e;};}function handleError(_0x17dd29,_0x5588a9){_0x5588a9=_0x5588a9||0x1f4;return function(_0x1d727d){logger[_0x233d('0x25')](_0x1d727d[_0x233d('0x26')]);if(_0x1d727d[_0x233d('0x27')]){delete _0x1d727d[_0x233d('0x27')];}_0x17dd29[_0x233d('0x18')](_0x5588a9)['send'](_0x1d727d);};}exports[_0x233d('0x28')]=function(_0x3c6ee8,_0x460cb6){var _0x2d7ce2={},_0x3dd2a2={},_0x37df3d={'count':0x0,'rows':[]};var _0x22d146=_[_0x233d('0x29')](db[_0x233d('0x2a')][_0x233d('0x2b')],function(_0x3b568e){return{'name':_0x3b568e[_0x233d('0x2c')],'type':_0x3b568e[_0x233d('0x2d')][_0x233d('0x2e')]};});_0x3dd2a2[_0x233d('0x2f')]=_[_0x233d('0x29')](_0x22d146,_0x233d('0x27'));_0x3dd2a2[_0x233d('0x30')]=_[_0x233d('0x31')](_0x3c6ee8[_0x233d('0x30')]);_0x3dd2a2[_0x233d('0x32')]=_['intersection'](_0x3dd2a2['model'],_0x3dd2a2[_0x233d('0x30')]);_0x2d7ce2[_0x233d('0x33')]=_[_0x233d('0x34')](_0x3dd2a2[_0x233d('0x2f')],qs['fields'](_0x3c6ee8['query'][_0x233d('0x35')]));_0x2d7ce2[_0x233d('0x33')]=_0x2d7ce2['attributes'][_0x233d('0x36')]?_0x2d7ce2['attributes']:_0x3dd2a2[_0x233d('0x2f')];if(!_0x3c6ee8[_0x233d('0x30')][_0x233d('0x37')](_0x233d('0x38'))){_0x2d7ce2['limit']=qs[_0x233d('0x1c')](_0x3c6ee8[_0x233d('0x30')]['limit']);_0x2d7ce2['offset']=qs[_0x233d('0x1a')](_0x3c6ee8[_0x233d('0x30')][_0x233d('0x1a')]);}_0x2d7ce2['order']=qs['sort'](_0x3c6ee8[_0x233d('0x30')][_0x233d('0x39')]);_0x2d7ce2[_0x233d('0x3a')]=qs[_0x233d('0x32')](_[_0x233d('0x3b')](_0x3c6ee8[_0x233d('0x30')],_0x3dd2a2[_0x233d('0x32')]),_0x22d146);if(_0x3c6ee8[_0x233d('0x30')]['filter']){_0x2d7ce2[_0x233d('0x3a')]=_[_0x233d('0x3c')](_0x2d7ce2['where'],{'$or':_[_0x233d('0x29')](_0x22d146,function(_0x3c6bb1){if(_0x3c6bb1[_0x233d('0x2d')]!==_0x233d('0x3d')){var _0x3f703e={};_0x3f703e[_0x3c6bb1['name']]={'$like':'%'+_0x3c6ee8['query'][_0x233d('0x3e')]+'%'};return _0x3f703e;}})});}_0x2d7ce2=_[_0x233d('0x3c')]({},_0x2d7ce2,_0x3c6ee8[_0x233d('0x3f')]);var _0x4c13f6={'where':_0x2d7ce2[_0x233d('0x3a')]};return db['AnalyticTreeReport'][_0x233d('0x1d')](_0x4c13f6)[_0x233d('0x24')](function(_0x1c29e2){_0x37df3d[_0x233d('0x1d')]=_0x1c29e2;if(_0x3c6ee8[_0x233d('0x30')][_0x233d('0x40')]){_0x2d7ce2['include']=[{'all':!![]}];}return db[_0x233d('0x2a')]['findAll'](_0x2d7ce2);})[_0x233d('0x24')](function(_0x487f9f){_0x37df3d[_0x233d('0x41')]=_0x487f9f;return _0x37df3d;})[_0x233d('0x24')](respondWithFilteredResult(_0x460cb6,_0x2d7ce2))[_0x233d('0x42')](handleError(_0x460cb6,null));};exports['show']=function(_0x74ea8f,_0xed7dc4){var _0x1a827f={'raw':!![],'where':{'id':_0x74ea8f[_0x233d('0x43')]['id']}},_0x457834={};_0x457834[_0x233d('0x2f')]=_[_0x233d('0x31')](db[_0x233d('0x2a')][_0x233d('0x2b')]);_0x457834[_0x233d('0x30')]=_[_0x233d('0x31')](_0x74ea8f[_0x233d('0x30')]);_0x457834[_0x233d('0x32')]=_[_0x233d('0x34')](_0x457834[_0x233d('0x2f')],_0x457834['query']);_0x1a827f[_0x233d('0x33')]=_[_0x233d('0x34')](_0x457834['model'],qs['fields'](_0x74ea8f[_0x233d('0x30')][_0x233d('0x35')]));_0x1a827f[_0x233d('0x33')]=_0x1a827f['attributes']['length']?_0x1a827f['attributes']:_0x457834[_0x233d('0x2f')];if(_0x74ea8f[_0x233d('0x30')][_0x233d('0x40')]){_0x1a827f[_0x233d('0x44')]=[{'all':!![]}];}_0x1a827f=_[_0x233d('0x3c')]({},_0x1a827f,_0x74ea8f[_0x233d('0x3f')]);return db[_0x233d('0x2a')][_0x233d('0x45')](_0x1a827f)['then'](handleEntityNotFound(_0xed7dc4,null))[_0x233d('0x24')](respondWithResult(_0xed7dc4,null))[_0x233d('0x42')](handleError(_0xed7dc4,null));};exports['create']=function(_0xb92965,_0xfae772){return db['AnalyticTreeReport']['create'](_0xb92965['body'],{})[_0x233d('0x24')](respondWithResult(_0xfae772,0xc9))[_0x233d('0x42')](handleError(_0xfae772,null));};exports[_0x233d('0x23')]=function(_0x15abd6,_0x4efb03){if(_0x15abd6['body']['id']){delete _0x15abd6['body']['id'];}return db[_0x233d('0x2a')]['find']({'where':{'id':_0x15abd6[_0x233d('0x43')]['id']}})[_0x233d('0x24')](handleEntityNotFound(_0x4efb03,null))[_0x233d('0x24')](saveUpdates(_0x15abd6[_0x233d('0x46')],null))[_0x233d('0x24')](respondWithResult(_0x4efb03,null))[_0x233d('0x42')](handleError(_0x4efb03,null));};exports[_0x233d('0x47')]=function(_0x4db971,_0x2d90b4){return db[_0x233d('0x2a')][_0x233d('0x45')]({'where':{'id':_0x4db971[_0x233d('0x43')]['id']}})[_0x233d('0x24')](handleEntityNotFound(_0x2d90b4,null))[_0x233d('0x24')](removeEntity(_0x2d90b4,null))[_0x233d('0x42')](handleError(_0x2d90b4,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index e9e3d92..96df22e 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 _0xfc35=['request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0xfc35,0x14c));var _0x5fc3=function(_0x1a3a9b,_0x3f8344){_0x1a3a9b=_0x1a3a9b-0x0;var _0x402617=_0xfc35[_0x1a3a9b];return _0x402617;};'use strict';var _=require(_0x5fc3('0x0'));var util=require(_0x5fc3('0x1'));var logger=require(_0x5fc3('0x2'))(_0x5fc3('0x3'));var moment=require(_0x5fc3('0x4'));var BPromise=require(_0x5fc3('0x5'));var rp=require(_0x5fc3('0x6'));var fs=require('fs');var path=require(_0x5fc3('0x7'));var rimraf=require('rimraf');var config=require(_0x5fc3('0x8'));var attributes=require(_0x5fc3('0x9'));module[_0x5fc3('0xa')]=function(_0x2f0fbf,_0x194efb){return _0x2f0fbf[_0x5fc3('0xb')](_0x5fc3('0xc'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6847=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','request-promise','path'];(function(_0x2dc46e,_0x22c800){var _0x4eb52c=function(_0x235e58){while(--_0x235e58){_0x2dc46e['push'](_0x2dc46e['shift']());}};_0x4eb52c(++_0x22c800);}(_0x6847,0x14b));var _0x7684=function(_0x21f3bf,_0xfb0f59){_0x21f3bf=_0x21f3bf-0x0;var _0x249d08=_0x6847[_0x21f3bf];return _0x249d08;};'use strict';var _=require(_0x7684('0x0'));var util=require(_0x7684('0x1'));var logger=require(_0x7684('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7684('0x3'));var fs=require('fs');var path=require(_0x7684('0x4'));var rimraf=require(_0x7684('0x5'));var config=require(_0x7684('0x6'));var attributes=require(_0x7684('0x7'));module[_0x7684('0x8')]=function(_0x10aabd,_0x31a084){return _0x10aabd[_0x7684('0x9')](_0x7684('0xa'),attributes,{'tableName':_0x7684('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 4d46f0e..48a3c30 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5125cd,_0x1acb11){var _0x25777e=function(_0x29a1c8){while(--_0x29a1c8){_0x5125cd['push'](_0x5125cd['shift']());}};_0x25777e(++_0x1acb11);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e9db5,_0x321766){_0x1e9db5=_0x1e9db5-0x0;var _0x16b5d4=_0x2ef3[_0x1e9db5];return _0x16b5d4;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\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','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x5c1834,_0x154d0){var _0x541801=function(_0x31e781){while(--_0x31e781){_0x5c1834['push'](_0x5c1834['shift']());}};_0x541801(++_0x154d0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x439862,_0x1ce5ae){_0x439862=_0x439862-0x0;var _0x361e80=_0x5f2f[_0x439862];return _0x361e80;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index bff8d79..83fadfe 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 _0x0485=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x1392d4,_0x588cf7){var _0xc3fbc8=function(_0x3ac60c){while(--_0x3ac60c){_0x1392d4['push'](_0x1392d4['shift']());}};_0xc3fbc8(++_0x588cf7);}(_0x0485,0xff));var _0x5048=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x0485[_0x307bf6];return _0x2878fc;};'use strict';var multer=require(_0x5048('0x0'));var util=require(_0x5048('0x1'));var path=require(_0x5048('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5048('0x3')]();var fs_extra=require(_0x5048('0x4'));var auth=require(_0x5048('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5048('0x6'));var controller=require(_0x5048('0x7'));router[_0x5048('0x8')]('/',auth[_0x5048('0x9')](),controller[_0x5048('0xa')]);router[_0x5048('0x8')](_0x5048('0xb'),auth[_0x5048('0x9')](),controller[_0x5048('0xc')]);router[_0x5048('0xd')]('/',auth['isAuthenticated'](),controller[_0x5048('0xe')]);router[_0x5048('0xf')](_0x5048('0xb'),auth[_0x5048('0x9')](),controller[_0x5048('0x10')]);router[_0x5048('0x11')](_0x5048('0xb'),auth[_0x5048('0x9')](),controller[_0x5048('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc5be=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','post','put'];(function(_0x793b24,_0xadc6ee){var _0x3effb0=function(_0x37438d){while(--_0x37438d){_0x793b24['push'](_0x793b24['shift']());}};_0x3effb0(++_0xadc6ee);}(_0xc5be,0x190));var _0xec5b=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xc5be[_0x1ae5ab];return _0x1ce001;};'use strict';var multer=require('multer');var util=require(_0xec5b('0x0'));var path=require(_0xec5b('0x1'));var timeout=require(_0xec5b('0x2'));var express=require(_0xec5b('0x3'));var router=express[_0xec5b('0x4')]();var fs_extra=require(_0xec5b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec5b('0x6'));var config=require(_0xec5b('0x7'));var controller=require(_0xec5b('0x8'));router[_0xec5b('0x9')]('/',auth[_0xec5b('0xa')](),controller[_0xec5b('0xb')]);router[_0xec5b('0x9')]('/:id',auth[_0xec5b('0xa')](),controller['show']);router[_0xec5b('0xc')]('/',auth[_0xec5b('0xa')](),controller['create']);router[_0xec5b('0xd')](_0xec5b('0xe'),auth[_0xec5b('0xa')](),controller[_0xec5b('0xf')]);router[_0xec5b('0x10')](_0xec5b('0xe'),auth[_0xec5b('0xa')](),controller['destroy']);module[_0xec5b('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 b19116b..5a0adad 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 _0xf14b=['exports','STRING','sequelize'];(function(_0x294acd,_0x4b243c){var _0x32ad44=function(_0x1f1c0d){while(--_0x1f1c0d){_0x294acd['push'](_0x294acd['shift']());}};_0x32ad44(++_0x4b243c);}(_0xf14b,0xdd));var _0xbf14=function(_0xef9edb,_0x406d7b){_0xef9edb=_0xef9edb-0x0;var _0x3583e3=_0xf14b[_0xef9edb];return _0x3583e3;};'use strict';var Sequelize=require(_0xbf14('0x0'));module[_0xbf14('0x1')]={'name':{'type':Sequelize[_0xbf14('0x2')]},'basename':{'type':Sequelize[_0xbf14('0x2')]},'type':{'type':Sequelize[_0xbf14('0x2')]}}; \ No newline at end of file +var _0x55d2=['STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x55d2,0x9f));var _0x255d=function(_0x50eba0,_0x3f92b4){_0x50eba0=_0x50eba0-0x0;var _0x21c82b=_0x55d2[_0x50eba0];return _0x21c82b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x255d('0x0')]},'basename':{'type':Sequelize[_0x255d('0x0')]},'type':{'type':Sequelize[_0x255d('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 9c0b299..1c377e6 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 _0xbc70=['destroy','error','stack','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','options','includeAll','findAll','show','params','find','catch','clone','include','get','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x3528a1,_0x43c125){var _0x5c1a48=function(_0x5906fa){while(--_0x5906fa){_0x3528a1['push'](_0x3528a1['shift']());}};_0x5c1a48(++_0x43c125);}(_0xbc70,0xde));var _0x0bc7=function(_0xafdc70,_0x23936d){_0xafdc70=_0xafdc70-0x0;var _0x3242ce=_0xbc70[_0xafdc70];return _0x3242ce;};'use strict';var emlformat=require(_0x0bc7('0x0'));var rimraf=require(_0x0bc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bc7('0x2'));var moment=require(_0x0bc7('0x3'));var BPromise=require(_0x0bc7('0x4'));var Mustache=require(_0x0bc7('0x5'));var util=require(_0x0bc7('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bc7('0x7'));var fs=require('fs');var fs_extra=require(_0x0bc7('0x8'));var _=require(_0x0bc7('0x9'));var squel=require(_0x0bc7('0xa'));var crypto=require(_0x0bc7('0xb'));var jsforce=require(_0x0bc7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0bc7('0xd'));var querystring=require(_0x0bc7('0xe'));var Papa=require(_0x0bc7('0xf'));var Redis=require(_0x0bc7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0bc7('0x11'));var as=require(_0x0bc7('0x12'));var hardwareService=require(_0x0bc7('0x13'));var logger=require('../../config/logger')(_0x0bc7('0x14'));var utils=require(_0x0bc7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0bc7('0x16'));var db=require(_0x0bc7('0x17'))['db'];function respondWithStatusCode(_0x430229,_0x3a8def){_0x3a8def=_0x3a8def||0xcc;return function(_0x48b628){if(_0x48b628){return _0x430229[_0x0bc7('0x18')](_0x3a8def);}return _0x430229['status'](_0x3a8def)[_0x0bc7('0x19')]();};}function respondWithResult(_0x3a8339,_0x3d5604){_0x3d5604=_0x3d5604||0xc8;return function(_0x3dd87d){if(_0x3dd87d){return _0x3a8339[_0x0bc7('0x1a')](_0x3d5604)[_0x0bc7('0x1b')](_0x3dd87d);}};}function respondWithFilteredResult(_0x3a87f9,_0x3013b7){return function(_0xf9825c){if(_0xf9825c){var _0x4753ad=typeof _0x3013b7[_0x0bc7('0x1c')]===_0x0bc7('0x1d')&&typeof _0x3013b7[_0x0bc7('0x1e')]===_0x0bc7('0x1d');var _0x6dd719=_0xf9825c['count'];var _0xcb317=_0x4753ad?0x0:_0x3013b7[_0x0bc7('0x1c')];var _0x436bd4=_0x4753ad?_0xf9825c[_0x0bc7('0x1f')]:_0x3013b7[_0x0bc7('0x1c')]+_0x3013b7[_0x0bc7('0x1e')];var _0x199a32;if(_0x436bd4>=_0x6dd719){_0x436bd4=_0x6dd719;_0x199a32=0xc8;}else{_0x199a32=0xce;}_0x3a87f9[_0x0bc7('0x1a')](_0x199a32);return _0x3a87f9[_0x0bc7('0x20')](_0x0bc7('0x21'),_0xcb317+'-'+_0x436bd4+'/'+_0x6dd719)[_0x0bc7('0x1b')](_0xf9825c);}return null;};}function patchUpdates(_0xf3b6c3){return function(_0x3827ef){try{jsonpatch[_0x0bc7('0x22')](_0x3827ef,_0xf3b6c3,!![]);}catch(_0x9c3846){return BPromise[_0x0bc7('0x23')](_0x9c3846);}return _0x3827ef[_0x0bc7('0x24')]();};}function saveUpdates(_0x2b3117,_0x5de1bc){return function(_0x275ee2){if(_0x275ee2){return _0x275ee2[_0x0bc7('0x25')](_0x2b3117)[_0x0bc7('0x26')](function(_0x4b6b97){return _0x4b6b97;});}return null;};}function removeEntity(_0x44ff08,_0x23e321){return function(_0x18fdb5){if(_0x18fdb5){return _0x18fdb5[_0x0bc7('0x27')]()[_0x0bc7('0x26')](function(){_0x44ff08[_0x0bc7('0x1a')](0xcc)[_0x0bc7('0x19')]();});}};}function handleEntityNotFound(_0x2655e9,_0x4782ba){return function(_0x2c76fa){if(!_0x2c76fa){_0x2655e9[_0x0bc7('0x18')](0x194);}return _0x2c76fa;};}function handleError(_0xd58628,_0x30264c){_0x30264c=_0x30264c||0x1f4;return function(_0x515650){logger[_0x0bc7('0x28')](_0x515650[_0x0bc7('0x29')]);if(_0x515650[_0x0bc7('0x2a')]){delete _0x515650[_0x0bc7('0x2a')];}_0xd58628[_0x0bc7('0x1a')](_0x30264c)['send'](_0x515650);};}exports[_0x0bc7('0x2b')]=function(_0x2b4077,_0x441c40){var _0x175ab3={},_0x29831f={},_0x2347dd={'count':0x0,'rows':[]};var _0x1d0a44=_['map'](db[_0x0bc7('0x2c')][_0x0bc7('0x2d')],function(_0x3839db){return{'name':_0x3839db[_0x0bc7('0x2e')],'type':_0x3839db[_0x0bc7('0x2f')][_0x0bc7('0x30')]};});_0x29831f[_0x0bc7('0x31')]=_[_0x0bc7('0x32')](_0x1d0a44,_0x0bc7('0x2a'));_0x29831f[_0x0bc7('0x33')]=_[_0x0bc7('0x34')](_0x2b4077[_0x0bc7('0x33')]);_0x29831f['filters']=_[_0x0bc7('0x35')](_0x29831f[_0x0bc7('0x31')],_0x29831f[_0x0bc7('0x33')]);_0x175ab3[_0x0bc7('0x36')]=_[_0x0bc7('0x35')](_0x29831f[_0x0bc7('0x31')],qs[_0x0bc7('0x37')](_0x2b4077[_0x0bc7('0x33')]['fields']));_0x175ab3[_0x0bc7('0x36')]=_0x175ab3[_0x0bc7('0x36')][_0x0bc7('0x38')]?_0x175ab3[_0x0bc7('0x36')]:_0x29831f[_0x0bc7('0x31')];if(!_0x2b4077[_0x0bc7('0x33')][_0x0bc7('0x39')]('nolimit')){_0x175ab3[_0x0bc7('0x1e')]=qs['limit'](_0x2b4077['query'][_0x0bc7('0x1e')]);_0x175ab3[_0x0bc7('0x1c')]=qs[_0x0bc7('0x1c')](_0x2b4077[_0x0bc7('0x33')][_0x0bc7('0x1c')]);}_0x175ab3['order']=qs[_0x0bc7('0x3a')](_0x2b4077['query'][_0x0bc7('0x3a')]);_0x175ab3[_0x0bc7('0x3b')]=qs[_0x0bc7('0x3c')](_['pick'](_0x2b4077[_0x0bc7('0x33')],_0x29831f[_0x0bc7('0x3c')]),_0x1d0a44);if(_0x2b4077[_0x0bc7('0x33')][_0x0bc7('0x3d')]){_0x175ab3[_0x0bc7('0x3b')]=_[_0x0bc7('0x3e')](_0x175ab3[_0x0bc7('0x3b')],{'$or':_[_0x0bc7('0x32')](_0x1d0a44,function(_0x55697b){if(_0x55697b[_0x0bc7('0x2f')]!=='VIRTUAL'){var _0x454f73={};_0x454f73[_0x55697b[_0x0bc7('0x2a')]]={'$like':'%'+_0x2b4077['query'][_0x0bc7('0x3d')]+'%'};return _0x454f73;}})});}_0x175ab3=_['merge']({},_0x175ab3,_0x2b4077[_0x0bc7('0x3f')]);var _0x37b6a3={'where':_0x175ab3[_0x0bc7('0x3b')]};return db[_0x0bc7('0x2c')][_0x0bc7('0x1f')](_0x37b6a3)['then'](function(_0x46c7e0){_0x2347dd[_0x0bc7('0x1f')]=_0x46c7e0;if(_0x2b4077[_0x0bc7('0x33')][_0x0bc7('0x40')]){_0x175ab3['include']=[{'all':!![]}];}return db['Attachment'][_0x0bc7('0x41')](_0x175ab3);})['then'](function(_0x470fac){_0x2347dd['rows']=_0x470fac;return _0x2347dd;})[_0x0bc7('0x26')](respondWithFilteredResult(_0x441c40,_0x175ab3))['catch'](handleError(_0x441c40,null));};exports[_0x0bc7('0x42')]=function(_0xffce22,_0x544c91){var _0x336f99={'raw':!![],'where':{'id':_0xffce22[_0x0bc7('0x43')]['id']}},_0x7d3ad6={};_0x7d3ad6[_0x0bc7('0x31')]=_[_0x0bc7('0x34')](db[_0x0bc7('0x2c')][_0x0bc7('0x2d')]);_0x7d3ad6['query']=_[_0x0bc7('0x34')](_0xffce22[_0x0bc7('0x33')]);_0x7d3ad6[_0x0bc7('0x3c')]=_[_0x0bc7('0x35')](_0x7d3ad6[_0x0bc7('0x31')],_0x7d3ad6[_0x0bc7('0x33')]);_0x336f99[_0x0bc7('0x36')]=_[_0x0bc7('0x35')](_0x7d3ad6[_0x0bc7('0x31')],qs[_0x0bc7('0x37')](_0xffce22['query']['fields']));_0x336f99['attributes']=_0x336f99[_0x0bc7('0x36')]['length']?_0x336f99[_0x0bc7('0x36')]:_0x7d3ad6[_0x0bc7('0x31')];if(_0xffce22['query'][_0x0bc7('0x40')]){_0x336f99['include']=[{'all':!![]}];}_0x336f99=_[_0x0bc7('0x3e')]({},_0x336f99,_0xffce22[_0x0bc7('0x3f')]);return db['Attachment'][_0x0bc7('0x44')](_0x336f99)[_0x0bc7('0x26')](handleEntityNotFound(_0x544c91,null))['then'](respondWithResult(_0x544c91,null))[_0x0bc7('0x45')](handleError(_0x544c91,null));};exports[_0x0bc7('0x46')]=function(_0x48ab88,_0x1db535){var _0x5d9f58={'where':{'id':_0x48ab88[_0x0bc7('0x43')]['id']}},_0x2ed59b={};_0x2ed59b[_0x0bc7('0x31')]=_[_0x0bc7('0x34')](db['Attachment']['rawAttributes']);_0x5d9f58[_0x0bc7('0x36')]=_['intersection'](_0x2ed59b['model'],qs[_0x0bc7('0x37')](_0x48ab88['query']['fields']));_0x5d9f58[_0x0bc7('0x36')]=_0x5d9f58[_0x0bc7('0x36')][_0x0bc7('0x38')]?_0x5d9f58[_0x0bc7('0x36')]:_0x2ed59b['model'];if(_0x48ab88[_0x0bc7('0x33')][_0x0bc7('0x40')]){_0x5d9f58[_0x0bc7('0x47')]=[{'all':!![]}];}_0x5d9f58=_[_0x0bc7('0x3e')]({},_0x5d9f58,_0x48ab88[_0x0bc7('0x3f')]);return db['Attachment'][_0x0bc7('0x44')](_0x5d9f58)['then'](handleEntityNotFound(_0x1db535,null))['then'](function(_0x3521c8){if(_0x3521c8){var _0x357e90=_0x3521c8[_0x0bc7('0x48')]({'plain':!![]});_0x357e90=qs[_0x0bc7('0x49')](_0x357e90,['id',_0x0bc7('0x4a'),'updatedAt']);_0x48ab88[_0x0bc7('0x4b')]=_['omit'](_0x48ab88['body'],['id',_0x0bc7('0x4a'),_0x0bc7('0x4c')]);return db[_0x0bc7('0x2c')]['create'](_['merge'](_0x357e90,_0x48ab88[_0x0bc7('0x4b')]),{'include':_0x48ab88[_0x0bc7('0x33')][_0x0bc7('0x40')]?[{'all':!![]}]:undefined});}})[_0x0bc7('0x26')](respondWithResult(_0x1db535,0xc9))[_0x0bc7('0x45')](handleError(_0x1db535,null));};exports['update']=function(_0x39799b,_0x4a4a70){if(_0x39799b['body']['id']){delete _0x39799b['body']['id'];}return db['Attachment'][_0x0bc7('0x44')]({'where':{'id':_0x39799b[_0x0bc7('0x43')]['id']}})[_0x0bc7('0x26')](handleEntityNotFound(_0x4a4a70,null))[_0x0bc7('0x26')](saveUpdates(_0x39799b['body'],null))['then'](respondWithResult(_0x4a4a70,null))['catch'](handleError(_0x4a4a70,null));};exports[_0x0bc7('0x27')]=function(_0x2a5ef8,_0x5451ad){return db[_0x0bc7('0x2c')][_0x0bc7('0x44')]({'where':{'id':_0x2a5ef8[_0x0bc7('0x43')]['id']}})[_0x0bc7('0x26')](handleEntityNotFound(_0x5451ad,null))[_0x0bc7('0x26')](removeEntity(_0x5451ad,null))[_0x0bc7('0x45')](handleError(_0x5451ad,null));};exports[_0x0bc7('0x4d')]=function(_0x1cefeb,_0x3fc1c5,_0x18ba57){_0x1cefeb[_0x0bc7('0x4b')]['name']=_0x1cefeb[_0x0bc7('0x4e')][_0x0bc7('0x4f')];_0x1cefeb[_0x0bc7('0x4b')][_0x0bc7('0x50')]=_0x1cefeb['file'][_0x0bc7('0x51')];_0x1cefeb[_0x0bc7('0x4b')][_0x0bc7('0x2f')]=_0x1cefeb['file']['mimetype'];return db['Attachment'][_0x0bc7('0x4d')](_0x1cefeb[_0x0bc7('0x4b')])[_0x0bc7('0x26')](respondWithResult(_0x3fc1c5,0xc9))['catch'](handleError(_0x3fc1c5,null));};exports['download']=function(_0x3bb7f7,_0x517824,_0x480b5d){return db[_0x0bc7('0x2c')][_0x0bc7('0x52')]({'where':{'id':_0x3bb7f7[_0x0bc7('0x43')]['id']},'raw':!![]})[_0x0bc7('0x26')](handleEntityNotFound(_0x517824,null))[_0x0bc7('0x26')](function(_0x227dbe){if(_0x227dbe){var _0x3ff99c=_0x227dbe[_0x0bc7('0x53')]!==null;var _0x35976b=path['join'](config[_0x0bc7('0x54')],_0x0bc7('0x55'));if(_0x3ff99c){_0x35976b=path[_0x0bc7('0x56')](_0x35976b,'offline-chat/');}var _0x146355=path[_0x0bc7('0x56')](_0x35976b,_0x227dbe[_0x0bc7('0x50')]);return _0x517824['download'](_0x146355);}})['catch'](handleError(_0x517824,null));}; \ No newline at end of file +var _0x5646=['limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','Attachment','include','findAll','rows','catch','show','find','rawAttributes','get','omit','createdAt','updatedAt','body','create','includeAll','params','file','basename','filename','download','join','root','offline-chat/','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x5646,0x1ee));var _0x6564=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x5646[_0xb833b1];return _0x1ab87a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6564('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6564('0x1'));var moment=require(_0x6564('0x2'));var BPromise=require(_0x6564('0x3'));var Mustache=require(_0x6564('0x4'));var util=require('util');var path=require(_0x6564('0x5'));var sox=require(_0x6564('0x6'));var csv=require(_0x6564('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6564('0x8'));var _=require(_0x6564('0x9'));var squel=require('squel');var crypto=require(_0x6564('0xa'));var jsforce=require(_0x6564('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6564('0xc'));var Papa=require(_0x6564('0xd'));var Redis=require(_0x6564('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6564('0xf'));var hardwareService=require(_0x6564('0x10'));var logger=require(_0x6564('0x11'))(_0x6564('0x12'));var utils=require(_0x6564('0x13'));var config=require(_0x6564('0x14'));var licenseUtil=require(_0x6564('0x15'));var db=require(_0x6564('0x16'))['db'];function respondWithStatusCode(_0x50bfc6,_0x4cfabb){_0x4cfabb=_0x4cfabb||0xcc;return function(_0x1f2359){if(_0x1f2359){return _0x50bfc6[_0x6564('0x17')](_0x4cfabb);}return _0x50bfc6[_0x6564('0x18')](_0x4cfabb)[_0x6564('0x19')]();};}function respondWithResult(_0x21fd44,_0x386c21){_0x386c21=_0x386c21||0xc8;return function(_0x5102fc){if(_0x5102fc){return _0x21fd44[_0x6564('0x18')](_0x386c21)[_0x6564('0x1a')](_0x5102fc);}};}function respondWithFilteredResult(_0x5f4b73,_0x4ac8e8){return function(_0x120d27){if(_0x120d27){var _0x53d7d4=typeof _0x4ac8e8[_0x6564('0x1b')]==='undefined'&&typeof _0x4ac8e8[_0x6564('0x1c')]===_0x6564('0x1d');var _0x3f433a=_0x120d27[_0x6564('0x1e')];var _0x8989d2=_0x53d7d4?0x0:_0x4ac8e8[_0x6564('0x1b')];var _0x2c3fb9=_0x53d7d4?_0x120d27[_0x6564('0x1e')]:_0x4ac8e8[_0x6564('0x1b')]+_0x4ac8e8[_0x6564('0x1c')];var _0x34d9d4;if(_0x2c3fb9>=_0x3f433a){_0x2c3fb9=_0x3f433a;_0x34d9d4=0xc8;}else{_0x34d9d4=0xce;}_0x5f4b73[_0x6564('0x18')](_0x34d9d4);return _0x5f4b73[_0x6564('0x1f')](_0x6564('0x20'),_0x8989d2+'-'+_0x2c3fb9+'/'+_0x3f433a)[_0x6564('0x1a')](_0x120d27);}return null;};}function patchUpdates(_0x1d20d6){return function(_0xf8d65a){try{jsonpatch['apply'](_0xf8d65a,_0x1d20d6,!![]);}catch(_0x328b14){return BPromise[_0x6564('0x21')](_0x328b14);}return _0xf8d65a[_0x6564('0x22')]();};}function saveUpdates(_0x466780,_0x5befc4){return function(_0x26b55a){if(_0x26b55a){return _0x26b55a[_0x6564('0x23')](_0x466780)[_0x6564('0x24')](function(_0x4a9424){return _0x4a9424;});}return null;};}function removeEntity(_0x2f2291,_0x17511b){return function(_0x544a5b){if(_0x544a5b){return _0x544a5b[_0x6564('0x25')]()['then'](function(){_0x2f2291[_0x6564('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b3c9,_0x1a68ac){return function(_0x18a10d){if(!_0x18a10d){_0x13b3c9['sendStatus'](0x194);}return _0x18a10d;};}function handleError(_0x219abb,_0x5289d9){_0x5289d9=_0x5289d9||0x1f4;return function(_0x4c24d8){logger[_0x6564('0x26')](_0x4c24d8[_0x6564('0x27')]);if(_0x4c24d8[_0x6564('0x28')]){delete _0x4c24d8['name'];}_0x219abb[_0x6564('0x18')](_0x5289d9)['send'](_0x4c24d8);};}exports[_0x6564('0x29')]=function(_0x26e3e1,_0x54ca45){var _0x5e5158={},_0x5a8b41={},_0x1d7726={'count':0x0,'rows':[]};var _0x3e1a8e=_[_0x6564('0x2a')](db['Attachment']['rawAttributes'],function(_0x5706dd){return{'name':_0x5706dd[_0x6564('0x2b')],'type':_0x5706dd[_0x6564('0x2c')][_0x6564('0x2d')]};});_0x5a8b41['model']=_['map'](_0x3e1a8e,'name');_0x5a8b41['query']=_[_0x6564('0x2e')](_0x26e3e1[_0x6564('0x2f')]);_0x5a8b41['filters']=_[_0x6564('0x30')](_0x5a8b41[_0x6564('0x31')],_0x5a8b41['query']);_0x5e5158[_0x6564('0x32')]=_[_0x6564('0x30')](_0x5a8b41[_0x6564('0x31')],qs[_0x6564('0x33')](_0x26e3e1[_0x6564('0x2f')]['fields']));_0x5e5158[_0x6564('0x32')]=_0x5e5158[_0x6564('0x32')][_0x6564('0x34')]?_0x5e5158['attributes']:_0x5a8b41[_0x6564('0x31')];if(!_0x26e3e1[_0x6564('0x2f')][_0x6564('0x35')](_0x6564('0x36'))){_0x5e5158[_0x6564('0x1c')]=qs[_0x6564('0x1c')](_0x26e3e1[_0x6564('0x2f')]['limit']);_0x5e5158[_0x6564('0x1b')]=qs[_0x6564('0x1b')](_0x26e3e1[_0x6564('0x2f')][_0x6564('0x1b')]);}_0x5e5158[_0x6564('0x37')]=qs[_0x6564('0x38')](_0x26e3e1['query'][_0x6564('0x38')]);_0x5e5158['where']=qs['filters'](_[_0x6564('0x39')](_0x26e3e1[_0x6564('0x2f')],_0x5a8b41[_0x6564('0x3a')]),_0x3e1a8e);if(_0x26e3e1[_0x6564('0x2f')][_0x6564('0x3b')]){_0x5e5158[_0x6564('0x3c')]=_[_0x6564('0x3d')](_0x5e5158[_0x6564('0x3c')],{'$or':_['map'](_0x3e1a8e,function(_0x2a3d71){if(_0x2a3d71[_0x6564('0x2c')]!==_0x6564('0x3e')){var _0x39a880={};_0x39a880[_0x2a3d71[_0x6564('0x28')]]={'$like':'%'+_0x26e3e1[_0x6564('0x2f')]['filter']+'%'};return _0x39a880;}})});}_0x5e5158=_[_0x6564('0x3d')]({},_0x5e5158,_0x26e3e1[_0x6564('0x3f')]);var _0x52aa9a={'where':_0x5e5158['where']};return db[_0x6564('0x40')][_0x6564('0x1e')](_0x52aa9a)['then'](function(_0x4c6524){_0x1d7726['count']=_0x4c6524;if(_0x26e3e1[_0x6564('0x2f')]['includeAll']){_0x5e5158[_0x6564('0x41')]=[{'all':!![]}];}return db[_0x6564('0x40')][_0x6564('0x42')](_0x5e5158);})[_0x6564('0x24')](function(_0x1aafa1){_0x1d7726[_0x6564('0x43')]=_0x1aafa1;return _0x1d7726;})['then'](respondWithFilteredResult(_0x54ca45,_0x5e5158))[_0x6564('0x44')](handleError(_0x54ca45,null));};exports[_0x6564('0x45')]=function(_0xb61deb,_0xe49265){var _0x3d38f6={'raw':!![],'where':{'id':_0xb61deb['params']['id']}},_0xa93738={};_0xa93738[_0x6564('0x31')]=_[_0x6564('0x2e')](db['Attachment']['rawAttributes']);_0xa93738['query']=_[_0x6564('0x2e')](_0xb61deb[_0x6564('0x2f')]);_0xa93738[_0x6564('0x3a')]=_['intersection'](_0xa93738[_0x6564('0x31')],_0xa93738[_0x6564('0x2f')]);_0x3d38f6[_0x6564('0x32')]=_[_0x6564('0x30')](_0xa93738[_0x6564('0x31')],qs['fields'](_0xb61deb['query']['fields']));_0x3d38f6[_0x6564('0x32')]=_0x3d38f6[_0x6564('0x32')]['length']?_0x3d38f6[_0x6564('0x32')]:_0xa93738[_0x6564('0x31')];if(_0xb61deb[_0x6564('0x2f')]['includeAll']){_0x3d38f6[_0x6564('0x41')]=[{'all':!![]}];}_0x3d38f6=_[_0x6564('0x3d')]({},_0x3d38f6,_0xb61deb[_0x6564('0x3f')]);return db['Attachment'][_0x6564('0x46')](_0x3d38f6)[_0x6564('0x24')](handleEntityNotFound(_0xe49265,null))[_0x6564('0x24')](respondWithResult(_0xe49265,null))[_0x6564('0x44')](handleError(_0xe49265,null));};exports['clone']=function(_0x525eac,_0x32973e){var _0x17a0de={'where':{'id':_0x525eac['params']['id']}},_0x31fd38={};_0x31fd38[_0x6564('0x31')]=_[_0x6564('0x2e')](db[_0x6564('0x40')][_0x6564('0x47')]);_0x17a0de[_0x6564('0x32')]=_[_0x6564('0x30')](_0x31fd38['model'],qs['fields'](_0x525eac[_0x6564('0x2f')][_0x6564('0x33')]));_0x17a0de[_0x6564('0x32')]=_0x17a0de[_0x6564('0x32')][_0x6564('0x34')]?_0x17a0de[_0x6564('0x32')]:_0x31fd38[_0x6564('0x31')];if(_0x525eac[_0x6564('0x2f')]['includeAll']){_0x17a0de[_0x6564('0x41')]=[{'all':!![]}];}_0x17a0de=_['merge']({},_0x17a0de,_0x525eac['options']);return db[_0x6564('0x40')][_0x6564('0x46')](_0x17a0de)['then'](handleEntityNotFound(_0x32973e,null))[_0x6564('0x24')](function(_0x318f61){if(_0x318f61){var _0x4da580=_0x318f61[_0x6564('0x48')]({'plain':!![]});_0x4da580=qs[_0x6564('0x49')](_0x4da580,['id',_0x6564('0x4a'),_0x6564('0x4b')]);_0x525eac[_0x6564('0x4c')]=_[_0x6564('0x49')](_0x525eac[_0x6564('0x4c')],['id','createdAt','updatedAt']);return db[_0x6564('0x40')][_0x6564('0x4d')](_['merge'](_0x4da580,_0x525eac[_0x6564('0x4c')]),{'include':_0x525eac['query'][_0x6564('0x4e')]?[{'all':!![]}]:undefined});}})[_0x6564('0x24')](respondWithResult(_0x32973e,0xc9))[_0x6564('0x44')](handleError(_0x32973e,null));};exports['update']=function(_0x3fca39,_0x376724){if(_0x3fca39[_0x6564('0x4c')]['id']){delete _0x3fca39[_0x6564('0x4c')]['id'];}return db['Attachment'][_0x6564('0x46')]({'where':{'id':_0x3fca39[_0x6564('0x4f')]['id']}})[_0x6564('0x24')](handleEntityNotFound(_0x376724,null))[_0x6564('0x24')](saveUpdates(_0x3fca39[_0x6564('0x4c')],null))[_0x6564('0x24')](respondWithResult(_0x376724,null))['catch'](handleError(_0x376724,null));};exports[_0x6564('0x25')]=function(_0x519932,_0x5c6ce9){return db['Attachment']['find']({'where':{'id':_0x519932[_0x6564('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5c6ce9,null))[_0x6564('0x24')](removeEntity(_0x5c6ce9,null))[_0x6564('0x44')](handleError(_0x5c6ce9,null));};exports[_0x6564('0x4d')]=function(_0x660a0e,_0x2931cf,_0x5c623f){_0x660a0e[_0x6564('0x4c')]['name']=_0x660a0e[_0x6564('0x50')]['originalname'];_0x660a0e[_0x6564('0x4c')][_0x6564('0x51')]=_0x660a0e[_0x6564('0x50')][_0x6564('0x52')];_0x660a0e[_0x6564('0x4c')][_0x6564('0x2c')]=_0x660a0e[_0x6564('0x50')]['mimetype'];return db[_0x6564('0x40')]['create'](_0x660a0e[_0x6564('0x4c')])[_0x6564('0x24')](respondWithResult(_0x2931cf,0xc9))[_0x6564('0x44')](handleError(_0x2931cf,null));};exports[_0x6564('0x53')]=function(_0x5b109b,_0x202519,_0xaf744f){return db[_0x6564('0x40')]['findOne']({'where':{'id':_0x5b109b[_0x6564('0x4f')]['id']},'raw':!![]})[_0x6564('0x24')](handleEntityNotFound(_0x202519,null))[_0x6564('0x24')](function(_0x42d9d1){if(_0x42d9d1){var _0x3cb9a2=_0x42d9d1['ChatOfflineMessageId']!==null;var _0x5e89f5=path[_0x6564('0x54')](config[_0x6564('0x55')],'server/files/attachments/');if(_0x3cb9a2){_0x5e89f5=path['join'](_0x5e89f5,_0x6564('0x56'));}var _0x5473db=path[_0x6564('0x54')](_0x5e89f5,_0x42d9d1[_0x6564('0x51')]);return _0x202519[_0x6564('0x53')](_0x5473db);}})[_0x6564('0x44')](handleError(_0x202519,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 3938b2e..307e6f6 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 _0x0bc7=['bluebird','request-promise','path','rimraf','./attachment.attributes','exports','Attachment','util','../../config/logger','moment'];(function(_0x16c0bd,_0x9676d2){var _0x48fd60=function(_0x2e3eb3){while(--_0x2e3eb3){_0x16c0bd['push'](_0x16c0bd['shift']());}};_0x48fd60(++_0x9676d2);}(_0x0bc7,0x10b));var _0x70bc=function(_0x30c2d7,_0x32cbcb){_0x30c2d7=_0x30c2d7-0x0;var _0x1052a0=_0x0bc7[_0x30c2d7];return _0x1052a0;};'use strict';var _=require('lodash');var util=require(_0x70bc('0x0'));var logger=require(_0x70bc('0x1'))('api');var moment=require(_0x70bc('0x2'));var BPromise=require(_0x70bc('0x3'));var rp=require(_0x70bc('0x4'));var fs=require('fs');var path=require(_0x70bc('0x5'));var rimraf=require(_0x70bc('0x6'));var config=require('../../config/environment');var attributes=require(_0x70bc('0x7'));module[_0x70bc('0x8')]=function(_0x3c24ba,_0x7185a6){return _0x3c24ba['define'](_0x70bc('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff2b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','attachments','lodash','../../config/logger','api'];(function(_0x57b0b6,_0x321f11){var _0x40e196=function(_0x5bce9f){while(--_0x5bce9f){_0x57b0b6['push'](_0x57b0b6['shift']());}};_0x40e196(++_0x321f11);}(_0xff2b,0x179));var _0xbff2=function(_0x1e9980,_0x43b214){_0x1e9980=_0x1e9980-0x0;var _0x1181bc=_0xff2b[_0x1e9980];return _0x1181bc;};'use strict';var _=require(_0xbff2('0x0'));var util=require('util');var logger=require(_0xbff2('0x1'))(_0xbff2('0x2'));var moment=require(_0xbff2('0x3'));var BPromise=require(_0xbff2('0x4'));var rp=require(_0xbff2('0x5'));var fs=require('fs');var path=require(_0xbff2('0x6'));var rimraf=require(_0xbff2('0x7'));var config=require(_0xbff2('0x8'));var attributes=require('./attachment.attributes');module['exports']=function(_0x3b311d,_0x11d5d6){return _0x3b311d['define']('Attachment',attributes,{'tableName':_0xbff2('0x9'),'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 cdce2de..419ef83 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 _0x6c50=['error','Attachment,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x180bd3,_0x240488){var _0x2c7250=function(_0x949746){while(--_0x949746){_0x180bd3['push'](_0x180bd3['shift']());}};_0x2c7250(++_0x240488);}(_0x6c50,0xa4));var _0x06c5=function(_0x20f697,_0x232c4b){_0x20f697=_0x20f697-0x0;var _0x39a07a=_0x6c50[_0x20f697];return _0x39a07a;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06c5('0x5'));var logger=require(_0x06c5('0x6'))(_0x06c5('0x7'));var config=require(_0x06c5('0x8'));var jayson=require(_0x06c5('0x9'));var client=jayson[_0x06c5('0xa')][_0x06c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427dd6,_0x181c7f,_0x17c636){return new BPromise(function(_0x154b0a,_0x546ae5){return client[_0x06c5('0xc')](_0x427dd6,_0x17c636)[_0x06c5('0xd')](function(_0x3010af){logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,'request\x20sent');logger['debug'](_0x06c5('0xf'),_0x181c7f,'request\x20sent',JSON['stringify'](_0x3010af));if(_0x3010af['error']){if(_0x3010af[_0x06c5('0x10')]['code']===0x1f4){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af[_0x06c5('0x10')]['message']);return _0x546ae5(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af['error']['message']);return _0x154b0a(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}else{logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,_0x06c5('0x13'));_0x154b0a(_0x3010af[_0x06c5('0x14')]['message']);}})[_0x06c5('0x15')](function(_0x9045e6){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x9045e6);_0x546ae5(_0x9045e6);});});}exports[_0x06c5('0x16')]=function(_0x36b9e9){var _0x44d14e=this;return new Promise(function(_0x18a070,_0x1393f5){return db[_0x06c5('0x17')][_0x06c5('0x18')](_0x36b9e9[_0x06c5('0x19')],{'raw':_0x36b9e9[_0x06c5('0x1a')]?_0x36b9e9[_0x06c5('0x1a')][_0x06c5('0x1b')]===undefined?!![]:![]:!![]})[_0x06c5('0xd')](function(_0x26a653){logger['info'](_0x06c5('0x16'),_0x36b9e9);logger[_0x06c5('0x1c')](_0x06c5('0x16'),_0x36b9e9,JSON[_0x06c5('0x1d')](_0x26a653));_0x18a070(_0x26a653);})[_0x06c5('0x15')](function(_0x3c9e49){logger[_0x06c5('0x10')]('CreateAttachment',_0x3c9e49[_0x06c5('0x12')],_0x36b9e9);_0x1393f5(_0x44d14e[_0x06c5('0x10')](0x1f4,_0x3c9e49[_0x06c5('0x12')]));});});}; \ No newline at end of file +var _0xbdb7=['Attachment','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment'];(function(_0x31ad86,_0x2fce0e){var _0x5e3989=function(_0x5bc82c){while(--_0x5bc82c){_0x31ad86['push'](_0x31ad86['shift']());}};_0x5e3989(++_0x2fce0e);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xdf13c9,_0x5da43f){_0xdf13c9=_0xdf13c9-0x0;var _0x302aaa=_0xbdb7[_0xdf13c9];return _0x302aaa;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}exports[_0x7bdb('0x15')]=function(_0x5723f4){var _0x2aff6a=this;return new Promise(function(_0x4ffd4b,_0x41f540){return db[_0x7bdb('0x16')]['create'](_0x5723f4[_0x7bdb('0x17')],{'raw':_0x5723f4[_0x7bdb('0x18')]?_0x5723f4[_0x7bdb('0x18')][_0x7bdb('0x19')]===undefined?!![]:![]:!![]})[_0x7bdb('0x1a')](function(_0x5bfc35){logger['info'](_0x7bdb('0x15'),_0x5723f4);logger[_0x7bdb('0xe')]('CreateAttachment',_0x5723f4,JSON[_0x7bdb('0x10')](_0x5bfc35));_0x4ffd4b(_0x5bfc35);})[_0x7bdb('0x14')](function(_0x346c72){logger[_0x7bdb('0x11')](_0x7bdb('0x15'),_0x346c72['message'],_0x5723f4);_0x41f540(_0x2aff6a[_0x7bdb('0x11')](0x1f4,_0x346c72[_0x7bdb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 8a32073..062981e 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x5d24e9,_0x2035ac){var _0x1eb863=function(_0x186fad){while(--_0x186fad){_0x5d24e9['push'](_0x5d24e9['shift']());}};_0x1eb863(++_0x2035ac);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f1753,_0x458f6d){_0x2f1753=_0x2f1753-0x0;var _0x56a164=_0xb10b[_0x2f1753];return _0x56a164;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x25af20,_0x1843a9){var _0x3bad6d=function(_0x333964){while(--_0x333964){_0x25af20['push'](_0x25af20['shift']());}};_0x3bad6d(++_0x1843a9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x254069,_0x1bc8b9){_0x254069=_0x254069-0x0;var _0x5e2747=_0x5f2f[_0x254069];return _0x5e2747;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index d16fa4a..80712e3 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 _0x1931=['findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','authenticate','google','profile','email','callback','use','clientID','secret','callbackURL','Setting'];(function(_0x4543cb,_0x42fed5){var _0x3aed87=function(_0x21db2b){while(--_0x21db2b){_0x4543cb['push'](_0x4543cb['shift']());}};_0x3aed87(++_0x42fed5);}(_0x1931,0x169));var _0x1193=function(_0x3f18b5,_0x46cf7c){_0x3f18b5=_0x3f18b5-0x0;var _0x597183=_0x1931[_0x3f18b5];return _0x597183;};'use strict';var _=require(_0x1193('0x0'));var passport=require(_0x1193('0x1'));var GoogleStrategy=require(_0x1193('0x2'))[_0x1193('0x3')];var moment=require(_0x1193('0x4'));var db=require(_0x1193('0x5'))['db'];var config=require(_0x1193('0x6'));var signToken=require(_0x1193('0x7'))['signToken'];var utils=require(_0x1193('0x8'));exports['login']=passport[_0x1193('0x9')](_0x1193('0xa'),{'failureRedirect':'/login','scope':[_0x1193('0xb'),_0x1193('0xc')],'session':![]});exports[_0x1193('0xd')]=passport[_0x1193('0x9')](_0x1193('0xa'),{'failureRedirect':'/login','session':![]});passport[_0x1193('0xe')](new GoogleStrategy({'clientID':config[_0x1193('0xa')]?config[_0x1193('0xa')][_0x1193('0xf')]:'id','clientSecret':config[_0x1193('0xa')]?config[_0x1193('0xa')]['clientSecret']:_0x1193('0x10'),'callbackURL':config[_0x1193('0xa')]?config[_0x1193('0xa')][_0x1193('0x11')]:''},function(_0x519960,_0x5de32e,_0x3a25d6,_0x25f6c3){var _0x5b777d,_0x1dddb9;return db[_0x1193('0x12')][_0x1193('0x13')]({'where':{'id':0x1},'attributes':[_0x1193('0x14'),_0x1193('0x15')],'raw':!![]})[_0x1193('0x16')](function(_0x508d8f){_0x5b777d=_0x508d8f;return db[_0x1193('0x17')][_0x1193('0x18')]({'where':{'email':_[_0x1193('0x19')](_0x3a25d6[_0x1193('0x1a')],'value'),'role':{'$or':[_0x1193('0x1b'),_0x1193('0x1c'),'agent']}}});})['then'](function(_0x3e2ed9){_0x1dddb9=_0x3e2ed9;if(_0x1dddb9){if(_0x1dddb9[_0x1193('0x1d')]){return _0x25f6c3(_0x1193('0x1e'));}else if(_0x5b777d[_0x1193('0x15')]>0x0){if(_0x1dddb9[_0x1193('0x1f')]){if(moment(_0x1dddb9[_0x1193('0x20')])[_0x1193('0x21')](_0x5b777d[_0x1193('0x15')],_0x1193('0x22'))>moment()){return _0x25f6c3(_0x1193('0x1e'));}else{return utils[_0x1193('0x23')](_0x1dddb9,0x0,![],null)[_0x1193('0x16')](function(){return utils['getLicense'](_0x1dddb9);})['then'](function(){return _0x25f6c3(null,_0x1dddb9);});}}else{return utils[_0x1193('0x24')](_0x1dddb9)['then'](function(){return _0x25f6c3(null,_0x1dddb9);});}}else{return utils[_0x1193('0x24')](_0x1dddb9)['then'](function(){return _0x25f6c3(null,_0x1dddb9);});}}return _0x25f6c3(_0x1193('0x1e'));})[_0x1193('0x25')](function(_0x5ef9ab){_0x25f6c3(_0x5ef9ab);});})); \ No newline at end of file +var _0xbb77=['clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','email','callback','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','minutes'];(function(_0x5c4178,_0x11471c){var _0x384e71=function(_0x4ff0db){while(--_0x4ff0db){_0x5c4178['push'](_0x5c4178['shift']());}};_0x384e71(++_0x11471c);}(_0xbb77,0x147));var _0x7bb7=function(_0x167ff1,_0x231dd9){_0x167ff1=_0x167ff1-0x0;var _0x5a210f=_0xbb77[_0x167ff1];return _0x5a210f;};'use strict';var _=require(_0x7bb7('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x7bb7('0x1'))[_0x7bb7('0x2')];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x7bb7('0x3'));var signToken=require(_0x7bb7('0x4'))[_0x7bb7('0x5')];var utils=require(_0x7bb7('0x6'));exports[_0x7bb7('0x7')]=passport[_0x7bb7('0x8')](_0x7bb7('0x9'),{'failureRedirect':_0x7bb7('0xa'),'scope':['profile',_0x7bb7('0xb')],'session':![]});exports[_0x7bb7('0xc')]=passport[_0x7bb7('0x8')](_0x7bb7('0x9'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x7bb7('0x9')]?config[_0x7bb7('0x9')][_0x7bb7('0xd')]:'id','clientSecret':config[_0x7bb7('0x9')]?config[_0x7bb7('0x9')]['clientSecret']:_0x7bb7('0xe'),'callbackURL':config['google']?config[_0x7bb7('0x9')][_0x7bb7('0xf')]:''},function(_0x4fa8c2,_0x3edacc,_0x323b9b,_0x582a70){var _0x986164,_0x51e4db;return db[_0x7bb7('0x10')][_0x7bb7('0x11')]({'where':{'id':0x1},'attributes':[_0x7bb7('0x12'),'blockDuration'],'raw':!![]})['then'](function(_0x5c49f3){_0x986164=_0x5c49f3;return db[_0x7bb7('0x13')][_0x7bb7('0x14')]({'where':{'email':_[_0x7bb7('0x15')](_0x323b9b[_0x7bb7('0x16')],_0x7bb7('0x17')),'role':{'$or':[_0x7bb7('0x18'),_0x7bb7('0x19'),_0x7bb7('0x1a')]}}});})[_0x7bb7('0x1b')](function(_0x2c9b31){_0x51e4db=_0x2c9b31;if(_0x51e4db){if(_0x51e4db['disabled']){return _0x582a70(_0x7bb7('0x1c'));}else if(_0x986164[_0x7bb7('0x1d')]>0x0){if(_0x51e4db[_0x7bb7('0x1e')]){if(moment(_0x51e4db[_0x7bb7('0x1f')])['add'](_0x986164[_0x7bb7('0x1d')],_0x7bb7('0x20'))>moment()){return _0x582a70(_0x7bb7('0x1c'));}else{return utils[_0x7bb7('0x21')](_0x51e4db,0x0,![],null)[_0x7bb7('0x1b')](function(){return utils['getLicense'](_0x51e4db);})[_0x7bb7('0x1b')](function(){return _0x582a70(null,_0x51e4db);});}}else{return utils[_0x7bb7('0x22')](_0x51e4db)[_0x7bb7('0x1b')](function(){return _0x582a70(null,_0x51e4db);});}}else{return utils['getLicense'](_0x51e4db)['then'](function(){return _0x582a70(null,_0x51e4db);});}}return _0x582a70(_0x7bb7('0x1c'));})[_0x7bb7('0x23')](function(_0x56f4c3){_0x582a70(_0x56f4c3);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f6cbeb1..48bc0b5 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 _0x1af1=['/callback','isMiddleware','setTokenCookie','express','passport','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0xdf2cb,_0x1ea5d8){var _0x1f92dd=function(_0x13473b){while(--_0x13473b){_0xdf2cb['push'](_0xdf2cb['shift']());}};_0x1f92dd(++_0x1ea5d8);}(_0x1af1,0x1e9));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x11af('0x0'));var passport=require(_0x11af('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x11af('0x2'));var authService=require(_0x11af('0x3'));router[_0x11af('0x4')]('/',controller[_0x11af('0x5')]);router[_0x11af('0x4')](_0x11af('0x6'),controller['callback'],authService[_0x11af('0x7')],userController[_0x11af('0x5')],authService[_0x11af('0x8')]);module['exports']=router; \ No newline at end of file +var _0xf377=['get','login','/callback','isMiddleware','exports','express','passport','../user/user.controller.js','../../components/auth/service'];(function(_0x335771,_0x465d46){var _0x2c193a=function(_0x32a6cc){while(--_0x32a6cc){_0x335771['push'](_0x335771['shift']());}};_0x2c193a(++_0x465d46);}(_0xf377,0x113));var _0x7f37=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xf377[_0x134c2e];return _0x2825db;};'use strict';var express=require(_0x7f37('0x0'));var passport=require(_0x7f37('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x7f37('0x2'));var authService=require(_0x7f37('0x3'));router[_0x7f37('0x4')]('/',controller[_0x7f37('0x5')]);router['get'](_0x7f37('0x6'),controller['callback'],authService[_0x7f37('0x7')],userController['login'],authService['setTokenCookie']);module[_0x7f37('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 14a1ef8..4251297 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 _0x7f3c=['enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','resetPasswordToken','passport-local','jayson/promise','randomstring','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','disabled','blockedAt','user','agent','loginAttempts','blocked','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','minutes','getLicense','catch','MailAccount','find','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','role','signToken','json','online','forgot','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword'];(function(_0x37c9ea,_0x4421c8){var _0x186ae1=function(_0x3e6d87){while(--_0x3e6d87){_0x37c9ea['push'](_0x37c9ea['shift']());}};_0x186ae1(++_0x4421c8);}(_0x7f3c,0x1d3));var _0xc7f3=function(_0x1c3331,_0x49ecd7){_0x1c3331=_0x1c3331-0x0;var _0x4a2b9f=_0x7f3c[_0x1c3331];return _0x4a2b9f;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xc7f3('0x0'))['Strategy'];var jayson=require(_0xc7f3('0x1'));var _=require('lodash');var rs=require(_0xc7f3('0x2'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xc7f3('0x3'));var utils=require(_0xc7f3('0x4'));var client=jayson['client'][_0xc7f3('0x5')]({'port':0x232b});function localAuthenticate(_0x356245,_0x5ec722,_0x13c864,_0x5a0d5e){var _0x1ec02b,_0x9ee025;return db[_0xc7f3('0x6')][_0xc7f3('0x7')]({'where':{'id':0x1},'attributes':[_0xc7f3('0x8'),_0xc7f3('0x9')],'raw':!![]})[_0xc7f3('0xa')](function(_0xa17e6a){_0x1ec02b=_0xa17e6a;return _0x356245[_0xc7f3('0x7')]({'attributes':['id',_0xc7f3('0xb'),_0xc7f3('0xc'),_0xc7f3('0xd'),'role',_0xc7f3('0xe'),'blocked',_0xc7f3('0xf'),'loginAttempts'],'where':{'name':_0x5ec722,'role':{'$or':['admin',_0xc7f3('0x10'),_0xc7f3('0x11')]}}});})[_0xc7f3('0xa')](function(_0x4d1f60){if(!_0x4d1f60||_0x4d1f60&&_0x4d1f60['name']!==_0x5ec722){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x9ee025=_0x4d1f60;return _0x9ee025;}})[_0xc7f3('0xa')](function(){_0x9ee025['authenticate'](_0x13c864,function(_0x808715,_0x214408){var _0x105111=_0x9ee025[_0xc7f3('0x12')]+0x1;if(_0x808715){return _0x5a0d5e(_0x808715);}else if(!_0x214408){if(_0x9ee025[_0xc7f3('0xe')]){return _0x5a0d5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1ec02b[_0xc7f3('0x8')]>0x0){if(_0x9ee025[_0xc7f3('0x13')]){if(_0x1ec02b[_0xc7f3('0x9')]>0x0){if(moment(_0x9ee025[_0xc7f3('0xf')])[_0xc7f3('0x14')](_0x1ec02b[_0xc7f3('0x9')],'minutes')>moment()){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}else{return utils[_0xc7f3('0x16')](_0x9ee025,_0x105111,![],null)['then'](function(){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});});}}else{return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}}else{if(_0x105111>=_0x1ec02b[_0xc7f3('0x8')]){return utils[_0xc7f3('0x16')](_0x9ee025,0x0,!![],moment())[_0xc7f3('0xa')](function(){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});});}else{return utils['clearBlockUser'](_0x9ee025,_0x105111,![],null)[_0xc7f3('0xa')](function(){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});});}}}else{return _0x5a0d5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x9ee025[_0xc7f3('0xe')]){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}else if(_0x1ec02b['allowedLoginAttempts']>0x0){if(_0x9ee025[_0xc7f3('0x13')]){if(_0x1ec02b[_0xc7f3('0x9')]>0x0){if(moment(_0x9ee025[_0xc7f3('0xf')])[_0xc7f3('0x14')](_0x1ec02b['blockDuration'],_0xc7f3('0x17'))>moment()){return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}else{return utils[_0xc7f3('0x16')](_0x9ee025,0x0,![],null)[_0xc7f3('0xa')](function(){return utils[_0xc7f3('0x18')](_0x9ee025);})[_0xc7f3('0xa')](function(){return _0x5a0d5e(null,_0x9ee025);});}}else{return _0x5a0d5e(null,![],{'message':_0xc7f3('0x15')});}}else{return utils[_0xc7f3('0x16')](_0x9ee025,0x0,![],null)[_0xc7f3('0xa')](function(){return utils[_0xc7f3('0x18')](_0x9ee025);})['then'](function(){return _0x5a0d5e(null,_0x9ee025);})[_0xc7f3('0x19')](function(_0x17211f){return _0x5a0d5e(null,![],_0x17211f);});}}else{if(_0x9ee025[_0xc7f3('0x13')]){return _0x5a0d5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc7f3('0x18')](_0x9ee025)['then'](function(){return _0x5a0d5e(null,_0x9ee025);});}}}});})[_0xc7f3('0x19')](function(_0x4a6aad){return _0x5a0d5e(null,![],_0x4a6aad);});}function sendServiceMail(_0x49d57c){return db[_0xc7f3('0x1a')][_0xc7f3('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xc7f3('0xb'),'email'],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xc7f3('0xa')](function(_0x3ef07f){if(!_0x3ef07f){throw new Error(_0xc7f3('0x1c'));}var _0x3566a3={'tls':{'rejectUnauthorized':![]}};if(_0x3ef07f['Smtp']['service']){_0x3566a3[_0xc7f3('0x1d')]=_0x3ef07f[_0xc7f3('0x1e')]['service'];}else{_0x3566a3['host']=_0x3ef07f['Smtp'][_0xc7f3('0x1f')];_0x3566a3[_0xc7f3('0x20')]=_0x3ef07f[_0xc7f3('0x1e')][_0xc7f3('0x20')];_0x3566a3[_0xc7f3('0x21')]=_0x3ef07f[_0xc7f3('0x1e')]['secure'];}if(_0x3ef07f[_0xc7f3('0x1e')][_0xc7f3('0x22')]){_0x3566a3[_0xc7f3('0x23')]={'user':_0x3ef07f[_0xc7f3('0x1e')][_0xc7f3('0x10')],'pass':_0x3ef07f[_0xc7f3('0x1e')]['pass']};}var _0x47274d={'account':_0x3566a3,'message':_[_0xc7f3('0x24')]({'from':util['format'](_0xc7f3('0x25'),_0x3ef07f[_0xc7f3('0xb')],_0x3ef07f[_0xc7f3('0x26')]||_0x3ef07f[_0xc7f3('0x1e')][_0xc7f3('0x10')])},_0x49d57c)};return client[_0xc7f3('0x27')](_0xc7f3('0x28'),_0x47274d);})[_0xc7f3('0xa')](function(_0x593e99){if(_0x593e99[_0xc7f3('0x29')]){throw new Error(util[_0xc7f3('0x2a')](_0xc7f3('0x2b'),_0x593e99['error'][_0xc7f3('0x2c')]||JSON['stringify'](_0x593e99['error'])));}return!![];});}function handleError(_0x1b8a02,_0x7408a2,_0x560f76){return _0x1b8a02[_0xc7f3('0x2d')](_0x7408a2||0x1f4)['send']({'message':_0x560f76?_0x560f76[_0xc7f3('0x2c')]||_0x560f76:''});}exports[_0xc7f3('0x2e')]=function(_0x444024,_0x1204b1,_0x451f1d){passport['authenticate']('local',function(_0x4e49f9,_0x454d07,_0x145890){var _0x20a1a6=_0x4e49f9||_0x145890;if(_0x20a1a6){return handleError(_0x1204b1,0x191,_0x20a1a6);}if(!_0x454d07){return handleError(_0x1204b1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4ba037={'payload':{'id':_0x454d07['id'],'role':_0x454d07[_0xc7f3('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0xc7f3('0x30')](_0x4ba037)[_0xc7f3('0xa')](function(_0x4060d6){_0x1204b1[_0xc7f3('0x31')]({'id':_0x454d07['id'],'token':_0x4060d6,'statusCall':'','isAlreadyLogged':_0x454d07[_0xc7f3('0x32')]});});}})(_0x444024,_0x1204b1,_0x451f1d);};exports[_0xc7f3('0x33')]=function(_0x1b2cbc,_0x3781a4,_0x4853e4){if(!_0x1b2cbc['body'][_0xc7f3('0x26')]){return handleError(_0x3781a4,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x122c8e=rs['generate']();_0x1b2cbc[_0xc7f3('0x34')]['email']=_0x1b2cbc['body'][_0xc7f3('0x26')][_0xc7f3('0x35')]()[_0xc7f3('0x36')]();var _0x135953;return db['Setting'][_0xc7f3('0x7')]({'where':{'id':0x1},'attributes':[_0xc7f3('0x8'),_0xc7f3('0x9')],'raw':!![]})['then'](function(_0x476321){_0x135953=_0x476321;return db['User'][_0xc7f3('0x1b')]({'where':{'email':_0x1b2cbc[_0xc7f3('0x34')][_0xc7f3('0x26')]}});})[_0xc7f3('0xa')](function(_0x29bbd8){if(!_0x29bbd8){throw new Error(_0xc7f3('0x37'));}if(_0x29bbd8[_0xc7f3('0xe')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x29bbd8[_0xc7f3('0x13')]){if(moment(_0x29bbd8[_0xc7f3('0xf')])[_0xc7f3('0x14')](_0x135953[_0xc7f3('0x9')],_0xc7f3('0x17'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x29bbd8[_0xc7f3('0x13')]=![];_0x29bbd8['blockedAt']=null;}}_0x29bbd8['resetPasswordToken']=_0x122c8e;_0x29bbd8[_0xc7f3('0x38')]=Date[_0xc7f3('0x39')]()+0x36ee80;return _0x29bbd8[_0xc7f3('0x3a')]();})[_0xc7f3('0xa')](function(){return sendServiceMail({'to':_0x1b2cbc[_0xc7f3('0x34')][_0xc7f3('0x26')],'subject':_0xc7f3('0x3b'),'text':_0xc7f3('0x3c')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xc7f3('0x3d')+_0x1b2cbc[_0xc7f3('0x3e')][_0xc7f3('0x1f')]+_0xc7f3('0x3f')+_0x122c8e+'\x0a\x0a'+_0xc7f3('0x40')});})['then'](function(){_0x3781a4['status'](0xc8)[_0xc7f3('0x41')]({'message':_0xc7f3('0x42')});})[_0xc7f3('0x19')](function(_0x11f5b2){return handleError(_0x3781a4,0x1f4,_0x11f5b2);});};exports[_0xc7f3('0x43')]=function(_0x162ad3,_0x452e32,_0x577efa){return db[_0xc7f3('0x44')][_0xc7f3('0x1b')]({'where':{'resetPasswordToken':_0x162ad3[_0xc7f3('0x45')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc7f3('0x39')]()}}})[_0xc7f3('0xa')](function(_0x214f3e){if(!_0x214f3e){throw new Error(_0xc7f3('0x46'));}return db['Setting']['findOne']({'attributes':['id',_0xc7f3('0x47'),_0xc7f3('0x48'),_0xc7f3('0x49')]})[_0xc7f3('0xa')](function(_0x59f74a){if(_0x59f74a[_0xc7f3('0x47')])authService[_0xc7f3('0x4a')](_0x162ad3[_0xc7f3('0x34')]['password']);if(!_0x59f74a[_0xc7f3('0x48')]||!_0x214f3e['previousPasswords'])return _0x214f3e;authService[_0xc7f3('0x4b')](_0x162ad3[_0xc7f3('0x34')]['password'],_0x214f3e['previousPasswords'],_0x59f74a[_0xc7f3('0x49')]);return _0x214f3e;})[_0xc7f3('0xa')](function(){_0x214f3e[_0xc7f3('0xc')]=_0x162ad3[_0xc7f3('0x34')]['password'];_0x214f3e[_0xc7f3('0x4c')]=null;_0x214f3e[_0xc7f3('0x38')]=null;return _0x214f3e[_0xc7f3('0x3a')]();});})[_0xc7f3('0xa')](function(){_0x452e32[_0xc7f3('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xc7f3('0x19')](function(_0x23b058){return handleError(_0x452e32,0x1f4,_0x23b058);});};passport['use'](new LocalStrategy({'usernameField':_0xc7f3('0xb'),'passwordField':_0xc7f3('0xc')},function(_0x454cee,_0x1113f2,_0x28e61f){return localAuthenticate(db['User'],_0x454cee,_0x1113f2,_0x28e61f);})); \ No newline at end of file +var _0x867f=['loginAttempts','admin','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','clearBlockUser','minutes','getLicense','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','authentication','user','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','send','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','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','headers','/reset/','status','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','resetPasswordExpires','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blockedAt'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x867f,0xe6));var _0xf867=function(_0x2d2a9b,_0x5870ff){_0x2d2a9b=_0x2d2a9b-0x0;var _0x3d2d49=_0x867f[_0x2d2a9b];return _0x3d2d49;};'use strict';var util=require(_0xf867('0x0'));var passport=require(_0xf867('0x1'));var LocalStrategy=require(_0xf867('0x2'))[_0xf867('0x3')];var jayson=require(_0xf867('0x4'));var _=require(_0xf867('0x5'));var rs=require(_0xf867('0x6'));var moment=require(_0xf867('0x7'));var db=require(_0xf867('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xf867('0x9')][_0xf867('0xa')]({'port':0x232b});function localAuthenticate(_0x2c09b1,_0x2841d1,_0x3fe5d1,_0x5c35f9){var _0x583f87,_0x26cfba;return db['Setting'][_0xf867('0xb')]({'where':{'id':0x1},'attributes':[_0xf867('0xc'),_0xf867('0xd')],'raw':!![]})[_0xf867('0xe')](function(_0x4a385d){_0x583f87=_0x4a385d;return _0x2c09b1[_0xf867('0xb')]({'attributes':['id',_0xf867('0xf'),_0xf867('0x10'),'salt',_0xf867('0x11'),'disabled','blocked',_0xf867('0x12'),_0xf867('0x13')],'where':{'name':_0x2841d1,'role':{'$or':[_0xf867('0x14'),'user','agent']}}});})[_0xf867('0xe')](function(_0x56732c){if(!_0x56732c||_0x56732c&&_0x56732c[_0xf867('0xf')]!==_0x2841d1){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x26cfba=_0x56732c;return _0x26cfba;}})['then'](function(){_0x26cfba[_0xf867('0x15')](_0x3fe5d1,function(_0x1f6c42,_0x7a143e){var _0x13973b=_0x26cfba[_0xf867('0x13')]+0x1;if(_0x1f6c42){return _0x5c35f9(_0x1f6c42);}else if(!_0x7a143e){if(_0x26cfba[_0xf867('0x16')]){return _0x5c35f9(null,![],{'message':_0xf867('0x17')});}else if(_0x583f87[_0xf867('0xc')]>0x0){if(_0x26cfba[_0xf867('0x18')]){if(_0x583f87['blockDuration']>0x0){if(moment(_0x26cfba[_0xf867('0x12')])['add'](_0x583f87[_0xf867('0xd')],'minutes')>moment()){return _0x5c35f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf867('0x19')](_0x26cfba,_0x13973b,![],null)['then'](function(){return _0x5c35f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5c35f9(null,![],{'message':_0xf867('0x17')});}}else{if(_0x13973b>=_0x583f87[_0xf867('0xc')]){return utils['clearBlockUser'](_0x26cfba,0x0,!![],moment())['then'](function(){return _0x5c35f9(null,![],{'message':_0xf867('0x17')});});}else{return utils[_0xf867('0x19')](_0x26cfba,_0x13973b,![],null)[_0xf867('0xe')](function(){return _0x5c35f9(null,![],{'message':_0xf867('0x17')});});}}}else{return _0x5c35f9(null,![],{'message':_0xf867('0x17')});}}else{if(_0x26cfba[_0xf867('0x16')]){return _0x5c35f9(null,![],{'message':_0xf867('0x17')});}else if(_0x583f87[_0xf867('0xc')]>0x0){if(_0x26cfba['blocked']){if(_0x583f87['blockDuration']>0x0){if(moment(_0x26cfba[_0xf867('0x12')])['add'](_0x583f87[_0xf867('0xd')],_0xf867('0x1a'))>moment()){return _0x5c35f9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf867('0x19')](_0x26cfba,0x0,![],null)[_0xf867('0xe')](function(){return utils['getLicense'](_0x26cfba);})[_0xf867('0xe')](function(){return _0x5c35f9(null,_0x26cfba);});}}else{return _0x5c35f9(null,![],{'message':_0xf867('0x17')});}}else{return utils[_0xf867('0x19')](_0x26cfba,0x0,![],null)[_0xf867('0xe')](function(){return utils[_0xf867('0x1b')](_0x26cfba);})[_0xf867('0xe')](function(){return _0x5c35f9(null,_0x26cfba);})[_0xf867('0x1c')](function(_0x2efca3){return _0x5c35f9(null,![],_0x2efca3);});}}else{if(_0x26cfba[_0xf867('0x18')]){return _0x5c35f9(null,![],{'message':_0xf867('0x17')});}else{return utils[_0xf867('0x1b')](_0x26cfba)[_0xf867('0xe')](function(){return _0x5c35f9(null,_0x26cfba);});}}}});})[_0xf867('0x1c')](function(_0x234fa0){return _0x5c35f9(null,![],_0x234fa0);});}function sendServiceMail(_0x327a13){return db[_0xf867('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0xf867('0xf'),_0xf867('0x1e')],'include':[{'model':db[_0xf867('0x1f')],'as':_0xf867('0x20')}]})[_0xf867('0xe')](function(_0x2678c9){if(!_0x2678c9){throw new Error(_0xf867('0x21'));}var _0x517b9c={'tls':{'rejectUnauthorized':![]}};if(_0x2678c9[_0xf867('0x20')][_0xf867('0x22')]){_0x517b9c[_0xf867('0x22')]=_0x2678c9[_0xf867('0x20')][_0xf867('0x22')];}else{_0x517b9c[_0xf867('0x23')]=_0x2678c9[_0xf867('0x20')][_0xf867('0x23')];_0x517b9c['port']=_0x2678c9[_0xf867('0x20')]['port'];_0x517b9c[_0xf867('0x24')]=_0x2678c9['Smtp'][_0xf867('0x24')];}if(_0x2678c9[_0xf867('0x20')][_0xf867('0x25')]){_0x517b9c['auth']={'user':_0x2678c9[_0xf867('0x20')][_0xf867('0x26')],'pass':_0x2678c9['Smtp']['pass']};}var _0xc1f9ce={'account':_0x517b9c,'message':_['merge']({'from':util[_0xf867('0x27')](_0xf867('0x28'),_0x2678c9[_0xf867('0xf')],_0x2678c9[_0xf867('0x1e')]||_0x2678c9['Smtp']['user'])},_0x327a13)};return client[_0xf867('0x29')](_0xf867('0x2a'),_0xc1f9ce);})[_0xf867('0xe')](function(_0x50fb7d){if(_0x50fb7d[_0xf867('0x2b')]){throw new Error(util[_0xf867('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x50fb7d[_0xf867('0x2b')]['message']||JSON[_0xf867('0x2c')](_0x50fb7d[_0xf867('0x2b')])));}return!![];});}function handleError(_0x326abf,_0x4c47ad,_0x17e99a){return _0x326abf['status'](_0x4c47ad||0x1f4)[_0xf867('0x2d')]({'message':_0x17e99a?_0x17e99a[_0xf867('0x2e')]||_0x17e99a:''});}exports[_0xf867('0x2f')]=function(_0x1aa841,_0x193bd0,_0x290619){passport[_0xf867('0x15')](_0xf867('0x30'),function(_0x5e28c0,_0x47880e,_0x4a877){var _0x1e1074=_0x5e28c0||_0x4a877;if(_0x1e1074){return handleError(_0x193bd0,0x191,_0x1e1074);}if(!_0x47880e){return handleError(_0x193bd0,0x194,{'message':_0xf867('0x31')});}else{var _0xca48b8={'payload':{'id':_0x47880e['id'],'role':_0x47880e[_0xf867('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xf867('0x32')](_0xca48b8)[_0xf867('0xe')](function(_0x4acc2b){_0x193bd0[_0xf867('0x33')]({'id':_0x47880e['id'],'token':_0x4acc2b,'statusCall':'','isAlreadyLogged':_0x47880e[_0xf867('0x34')]});});}})(_0x1aa841,_0x193bd0,_0x290619);};exports[_0xf867('0x35')]=function(_0x352f8e,_0x256a7e,_0x3e35d2){if(!_0x352f8e[_0xf867('0x36')][_0xf867('0x1e')]){return handleError(_0x256a7e,0x1f4,{'message':_0xf867('0x37')});}var _0x5f216c=rs[_0xf867('0x38')]();_0x352f8e['body'][_0xf867('0x1e')]=_0x352f8e[_0xf867('0x36')][_0xf867('0x1e')]['trim']()[_0xf867('0x39')]();var _0x86d79c;return db[_0xf867('0x3a')][_0xf867('0xb')]({'where':{'id':0x1},'attributes':[_0xf867('0xc'),_0xf867('0xd')],'raw':!![]})['then'](function(_0x421e12){_0x86d79c=_0x421e12;return db[_0xf867('0x3b')][_0xf867('0x3c')]({'where':{'email':_0x352f8e[_0xf867('0x36')][_0xf867('0x1e')]}});})['then'](function(_0x1ce25a){if(!_0x1ce25a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1ce25a[_0xf867('0x16')]){throw new Error(_0xf867('0x3d'));}if(_0x1ce25a['blocked']){if(moment(_0x1ce25a[_0xf867('0x12')])[_0xf867('0x3e')](_0x86d79c[_0xf867('0xd')],_0xf867('0x1a'))>moment()){throw new Error(_0xf867('0x3f'));}else{_0x1ce25a[_0xf867('0x18')]=![];_0x1ce25a['blockedAt']=null;}}_0x1ce25a[_0xf867('0x40')]=_0x5f216c;_0x1ce25a['resetPasswordExpires']=Date[_0xf867('0x41')]()+0x36ee80;return _0x1ce25a[_0xf867('0x42')]();})[_0xf867('0xe')](function(){return sendServiceMail({'to':_0x352f8e[_0xf867('0x36')][_0xf867('0x1e')],'subject':_0xf867('0x43'),'text':_0xf867('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x352f8e[_0xf867('0x45')][_0xf867('0x23')]+_0xf867('0x46')+_0x5f216c+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xf867('0xe')](function(){_0x256a7e[_0xf867('0x47')](0xc8)[_0xf867('0x2d')]({'message':'Reset\x20Email\x20sent!'});})[_0xf867('0x1c')](function(_0x570071){return handleError(_0x256a7e,0x1f4,_0x570071);});};exports[_0xf867('0x48')]=function(_0x2d56c0,_0x290e22,_0x35a94a){return db[_0xf867('0x3b')][_0xf867('0x3c')]({'where':{'resetPasswordToken':_0x2d56c0[_0xf867('0x49')][_0xf867('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x1c1c90){if(!_0x1c1c90){throw new Error(_0xf867('0x4b'));}return db[_0xf867('0x3a')][_0xf867('0xb')]({'attributes':['id',_0xf867('0x4c'),_0xf867('0x4d'),_0xf867('0x4e')]})['then'](function(_0xde9cd6){if(_0xde9cd6[_0xf867('0x4c')])authService[_0xf867('0x4f')](_0x2d56c0[_0xf867('0x36')]['password']);if(!_0xde9cd6[_0xf867('0x4d')]||!_0x1c1c90[_0xf867('0x50')])return _0x1c1c90;authService['validatePasswordHistory'](_0x2d56c0['body']['password'],_0x1c1c90[_0xf867('0x50')],_0xde9cd6[_0xf867('0x4e')]);return _0x1c1c90;})['then'](function(){_0x1c1c90[_0xf867('0x10')]=_0x2d56c0[_0xf867('0x36')]['password'];_0x1c1c90[_0xf867('0x40')]=null;_0x1c1c90[_0xf867('0x51')]=null;return _0x1c1c90['save']();});})[_0xf867('0xe')](function(){_0x290e22[_0xf867('0x47')](0xc8)[_0xf867('0x2d')]({'message':_0xf867('0x52')});})[_0xf867('0x1c')](function(_0x5cdd1b){return handleError(_0x290e22,0x1f4,_0x5cdd1b);});};passport['use'](new LocalStrategy({'usernameField':_0xf867('0xf'),'passwordField':_0xf867('0x10')},function(_0x29ac26,_0x626097,_0x3afdc9){return localAuthenticate(db[_0xf867('0x3b')],_0x29ac26,_0x626097,_0x3afdc9);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 705f58b..d8db256 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 _0x0275=['/forgot','forgot','post','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x4377cc,_0x24ab80){var _0x2b10cf=function(_0x283a4a){while(--_0x283a4a){_0x4377cc['push'](_0x4377cc['shift']());}};_0x2b10cf(++_0x24ab80);}(_0x0275,0x1bf));var _0x5027=function(_0x223583,_0x49a46c){_0x223583=_0x223583-0x0;var _0x52819b=_0x0275[_0x223583];return _0x52819b;};'use strict';var express=require(_0x5027('0x0'));var router=express[_0x5027('0x1')]();var controller=require(_0x5027('0x2'));router['post']('/',controller['login']);router['post'](_0x5027('0x3'),controller[_0x5027('0x4')]);router[_0x5027('0x5')](_0x5027('0x6'),controller[_0x5027('0x7')]);module[_0x5027('0x8')]=router; \ No newline at end of file +var _0x6fb1=['reset','exports','express','Router','./authLocal.controller','post','login','forgot','/reset/:token'];(function(_0x416832,_0x4a1f1d){var _0x1cc6da=function(_0x10699d){while(--_0x10699d){_0x416832['push'](_0x416832['shift']());}};_0x1cc6da(++_0x4a1f1d);}(_0x6fb1,0x1d6));var _0x16fb=function(_0x704472,_0x36e958){_0x704472=_0x704472-0x0;var _0x164004=_0x6fb1[_0x704472];return _0x164004;};'use strict';var express=require(_0x16fb('0x0'));var router=express[_0x16fb('0x1')]();var controller=require(_0x16fb('0x2'));router[_0x16fb('0x3')]('/',controller[_0x16fb('0x4')]);router[_0x16fb('0x3')]('/forgot',controller[_0x16fb('0x5')]);router['post'](_0x16fb('0x6'),controller[_0x16fb('0x7')]);module[_0x16fb('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index ae7440e..7cca225 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 _0x7171=['sequelize','exports','STRING','INTEGER'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7171,0x198));var _0x1717=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x7171[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require(_0x1717('0x0'));module[_0x1717('0x1')]={'name':{'type':Sequelize[_0x1717('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1717('0x2')]},'description':{'type':Sequelize[_0x1717('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1717('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xcfea=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfea,0x1a6));var _0xacfe=function(_0x55a4e2,_0x439f1c){_0x55a4e2=_0x55a4e2-0x0;var _0x2699c9=_0xcfea[_0x55a4e2];return _0x2699c9;};'use strict';var Sequelize=require(_0xacfe('0x0'));module[_0xacfe('0x1')]={'name':{'type':Sequelize[_0xacfe('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xacfe('0x2')]},'description':{'type':Sequelize[_0xacfe('0x2')]},'status':{'type':Sequelize[_0xacfe('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xacfe('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index adb9859..407958e 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 _0x205d=['status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Automation','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5906a5,_0x48af0a){var _0x1b9a31=function(_0x4b72ac){while(--_0x4b72ac){_0x5906a5['push'](_0x5906a5['shift']());}};_0x1b9a31(++_0x48af0a);}(_0x205d,0x1da));var _0xd205=function(_0x39507b,_0x3efdac){_0x39507b=_0x39507b-0x0;var _0x5e7dd4=_0x205d[_0x39507b];return _0x5e7dd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd205('0x0'));var zipdir=require(_0xd205('0x1'));var jsonpatch=require(_0xd205('0x2'));var rp=require(_0xd205('0x3'));var moment=require('moment');var BPromise=require(_0xd205('0x4'));var Mustache=require('mustache');var util=require(_0xd205('0x5'));var path=require(_0xd205('0x6'));var sox=require(_0xd205('0x7'));var csv=require('to-csv');var ejs=require(_0xd205('0x8'));var fs=require('fs');var fs_extra=require(_0xd205('0x9'));var _=require('lodash');var squel=require(_0xd205('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd205('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd205('0xc'));var Papa=require(_0xd205('0xd'));var Redis=require(_0xd205('0xe'));var authService=require(_0xd205('0xf'));var qs=require(_0xd205('0x10'));var as=require(_0xd205('0x11'));var hardwareService=require(_0xd205('0x12'));var logger=require(_0xd205('0x13'))('api');var utils=require(_0xd205('0x14'));var config=require(_0xd205('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd205('0x16'))['db'];function respondWithStatusCode(_0x16d880,_0x1c91f8){_0x1c91f8=_0x1c91f8||0xcc;return function(_0x330b58){if(_0x330b58){return _0x16d880[_0xd205('0x17')](_0x1c91f8);}return _0x16d880[_0xd205('0x18')](_0x1c91f8)[_0xd205('0x19')]();};}function respondWithResult(_0x5c71b0,_0x4fada9){_0x4fada9=_0x4fada9||0xc8;return function(_0xe8e8e8){if(_0xe8e8e8){return _0x5c71b0[_0xd205('0x18')](_0x4fada9)['json'](_0xe8e8e8);}};}function respondWithFilteredResult(_0x20df59,_0x5e9154){return function(_0x59c8f5){if(_0x59c8f5){var _0x108506=typeof _0x5e9154[_0xd205('0x1a')]==='undefined'&&typeof _0x5e9154[_0xd205('0x1b')]===_0xd205('0x1c');var _0x5eb550=_0x59c8f5[_0xd205('0x1d')];var _0x1a5fbe=_0x108506?0x0:_0x5e9154['offset'];var _0x1f13d5=_0x108506?_0x59c8f5[_0xd205('0x1d')]:_0x5e9154['offset']+_0x5e9154[_0xd205('0x1b')];var _0x145092;if(_0x1f13d5>=_0x5eb550){_0x1f13d5=_0x5eb550;_0x145092=0xc8;}else{_0x145092=0xce;}_0x20df59[_0xd205('0x18')](_0x145092);return _0x20df59['set'](_0xd205('0x1e'),_0x1a5fbe+'-'+_0x1f13d5+'/'+_0x5eb550)[_0xd205('0x1f')](_0x59c8f5);}return null;};}function patchUpdates(_0x9e0a5f){return function(_0x40aaa6){try{jsonpatch[_0xd205('0x20')](_0x40aaa6,_0x9e0a5f,!![]);}catch(_0x16d2de){return BPromise['reject'](_0x16d2de);}return _0x40aaa6[_0xd205('0x21')]();};}function saveUpdates(_0x18d5d8,_0x594c62){return function(_0x26ced1){if(_0x26ced1){return _0x26ced1[_0xd205('0x22')](_0x18d5d8)[_0xd205('0x23')](function(_0x3b298d){return _0x3b298d;});}return null;};}function removeEntity(_0x2f0b10,_0x38bfdd){return function(_0x1a6c80){if(_0x1a6c80){return _0x1a6c80[_0xd205('0x24')]()[_0xd205('0x23')](function(){_0x2f0b10[_0xd205('0x18')](0xcc)[_0xd205('0x19')]();});}};}function handleEntityNotFound(_0x2d461b,_0x9cf58a){return function(_0x3ec5bb){if(!_0x3ec5bb){_0x2d461b[_0xd205('0x17')](0x194);}return _0x3ec5bb;};}function handleError(_0x6d5c8e,_0x357aa3){_0x357aa3=_0x357aa3||0x1f4;return function(_0x18be85){logger['error'](_0x18be85[_0xd205('0x25')]);if(_0x18be85[_0xd205('0x26')]){delete _0x18be85[_0xd205('0x26')];}_0x6d5c8e[_0xd205('0x18')](_0x357aa3)[_0xd205('0x27')](_0x18be85);};}exports[_0xd205('0x28')]=function(_0x1c9880,_0x2219a7){var _0x845c6c={},_0x387e16={},_0x43ca3e={'count':0x0,'rows':[]};var _0xd49e3=_[_0xd205('0x29')](db['Automation'][_0xd205('0x2a')],function(_0xded885){return{'name':_0xded885[_0xd205('0x2b')],'type':_0xded885['type'][_0xd205('0x2c')]};});_0x387e16[_0xd205('0x2d')]=_[_0xd205('0x29')](_0xd49e3,_0xd205('0x26'));_0x387e16['query']=_[_0xd205('0x2e')](_0x1c9880[_0xd205('0x2f')]);_0x387e16[_0xd205('0x30')]=_[_0xd205('0x31')](_0x387e16[_0xd205('0x2d')],_0x387e16[_0xd205('0x2f')]);_0x845c6c[_0xd205('0x32')]=_[_0xd205('0x31')](_0x387e16['model'],qs[_0xd205('0x33')](_0x1c9880[_0xd205('0x2f')][_0xd205('0x33')]));_0x845c6c[_0xd205('0x32')]=_0x845c6c[_0xd205('0x32')][_0xd205('0x34')]?_0x845c6c[_0xd205('0x32')]:_0x387e16['model'];if(!_0x1c9880['query'][_0xd205('0x35')](_0xd205('0x36'))){_0x845c6c[_0xd205('0x1b')]=qs[_0xd205('0x1b')](_0x1c9880[_0xd205('0x2f')][_0xd205('0x1b')]);_0x845c6c[_0xd205('0x1a')]=qs[_0xd205('0x1a')](_0x1c9880[_0xd205('0x2f')]['offset']);}_0x845c6c[_0xd205('0x37')]=qs[_0xd205('0x38')](_0x1c9880[_0xd205('0x2f')][_0xd205('0x38')]);_0x845c6c[_0xd205('0x39')]=qs[_0xd205('0x30')](_[_0xd205('0x3a')](_0x1c9880[_0xd205('0x2f')],_0x387e16[_0xd205('0x30')]),_0xd49e3);if(_0x1c9880[_0xd205('0x2f')][_0xd205('0x3b')]){_0x845c6c[_0xd205('0x39')]=_['merge'](_0x845c6c[_0xd205('0x39')],{'$or':_[_0xd205('0x29')](_0xd49e3,function(_0x1c8b23){if(_0x1c8b23[_0xd205('0x3c')]!==_0xd205('0x3d')){var _0x539465={};_0x539465[_0x1c8b23[_0xd205('0x26')]]={'$like':'%'+_0x1c9880['query'][_0xd205('0x3b')]+'%'};return _0x539465;}})});}_0x845c6c=_[_0xd205('0x3e')]({},_0x845c6c,_0x1c9880[_0xd205('0x3f')]);var _0x100ea0={'where':_0x845c6c[_0xd205('0x39')]};return db[_0xd205('0x40')]['count'](_0x100ea0)['then'](function(_0x1201b1){_0x43ca3e[_0xd205('0x1d')]=_0x1201b1;if(_0x1c9880['query'][_0xd205('0x41')]){_0x845c6c[_0xd205('0x42')]=[{'all':!![]}];}return db[_0xd205('0x40')][_0xd205('0x43')](_0x845c6c);})[_0xd205('0x23')](function(_0x3b680a){_0x43ca3e[_0xd205('0x44')]=_0x3b680a;return _0x43ca3e;})[_0xd205('0x23')](respondWithFilteredResult(_0x2219a7,_0x845c6c))[_0xd205('0x45')](handleError(_0x2219a7,null));};exports[_0xd205('0x46')]=function(_0x4f7845,_0x302413){var _0x4e39eb={'raw':![],'where':{'id':_0x4f7845[_0xd205('0x47')]['id']}},_0x10c28d={};_0x10c28d[_0xd205('0x2d')]=_['keys'](db[_0xd205('0x40')]['rawAttributes']);_0x10c28d[_0xd205('0x2f')]=_[_0xd205('0x2e')](_0x4f7845[_0xd205('0x2f')]);_0x10c28d[_0xd205('0x30')]=_[_0xd205('0x31')](_0x10c28d[_0xd205('0x2d')],_0x10c28d['query']);_0x4e39eb[_0xd205('0x32')]=_[_0xd205('0x31')](_0x10c28d[_0xd205('0x2d')],qs[_0xd205('0x33')](_0x4f7845[_0xd205('0x2f')]['fields']));_0x4e39eb[_0xd205('0x32')]=_0x4e39eb['attributes']['length']?_0x4e39eb['attributes']:_0x10c28d[_0xd205('0x2d')];if(_0x4f7845[_0xd205('0x2f')][_0xd205('0x41')]){_0x4e39eb[_0xd205('0x42')]=[{'all':!![]}];}_0x4e39eb=_[_0xd205('0x3e')]({},_0x4e39eb,_0x4f7845[_0xd205('0x3f')]);return db['Automation'][_0xd205('0x48')](_0x4e39eb)[_0xd205('0x23')](handleEntityNotFound(_0x302413,null))[_0xd205('0x23')](respondWithResult(_0x302413,null))['catch'](handleError(_0x302413,null));};exports['create']=function(_0x5e4ce9,_0x47db77){return db[_0xd205('0x40')][_0xd205('0x49')](_0x5e4ce9['body'],{})['then'](respondWithResult(_0x47db77,0xc9))[_0xd205('0x45')](handleError(_0x47db77,null));};exports[_0xd205('0x22')]=function(_0xa13bc2,_0x39879b){if(_0xa13bc2[_0xd205('0x4a')]['id']){delete _0xa13bc2[_0xd205('0x4a')]['id'];}return db[_0xd205('0x40')][_0xd205('0x48')]({'where':{'id':_0xa13bc2[_0xd205('0x47')]['id']}})['then'](handleEntityNotFound(_0x39879b,null))[_0xd205('0x23')](saveUpdates(_0xa13bc2[_0xd205('0x4a')],null))[_0xd205('0x23')](respondWithResult(_0x39879b,null))[_0xd205('0x45')](handleError(_0x39879b,null));};exports[_0xd205('0x24')]=function(_0x2fc89e,_0x4522f3){return db[_0xd205('0x40')]['find']({'where':{'id':_0x2fc89e[_0xd205('0x47')]['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x4522f3,null))[_0xd205('0x23')](removeEntity(_0x4522f3,null))[_0xd205('0x45')](handleError(_0x4522f3,null));};exports[_0xd205('0x4b')]=function(_0x571fba,_0x190a67,_0x3681ba){return db[_0xd205('0x4c')][_0xd205('0x48')]({'where':{'id':_0x571fba[_0xd205('0x47')]['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x190a67,null))[_0xd205('0x23')](function(_0xb46681){if(_0xb46681){return _0xb46681[_0xd205('0x4b')](_0x571fba[_0xd205('0x4a')]['ids'],_['omit'](_0x571fba['body'],[_0xd205('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x190a67,null))[_0xd205('0x45')](handleError(_0x190a67,null));};exports[_0xd205('0x4e')]=function(_0x5c65e7,_0x4cd81d,_0x28d067){var _0x492fcf={};var _0x111860={};var _0x2d5d1f;var _0x44b42f;return db[_0xd205('0x40')][_0xd205('0x4f')]({'where':{'id':_0x5c65e7[_0xd205('0x47')]['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x4cd81d,null))['then'](function(_0x3ed556){if(_0x3ed556){_0x2d5d1f=_0x3ed556;_0x111860[_0xd205('0x2d')]=_[_0xd205('0x2e')](db['Condition'][_0xd205('0x2a')]);_0x111860[_0xd205('0x2f')]=_[_0xd205('0x2e')](_0x5c65e7[_0xd205('0x2f')]);_0x111860[_0xd205('0x30')]=_[_0xd205('0x31')](_0x111860['model'],_0x111860[_0xd205('0x2f')]);_0x492fcf['attributes']=_[_0xd205('0x31')](_0x111860[_0xd205('0x2d')],qs['fields'](_0x5c65e7['query'][_0xd205('0x33')]));_0x492fcf['attributes']=_0x492fcf[_0xd205('0x32')][_0xd205('0x34')]?_0x492fcf[_0xd205('0x32')]:_0x111860[_0xd205('0x2d')];_0x492fcf[_0xd205('0x37')]=qs[_0xd205('0x38')](_0x5c65e7[_0xd205('0x2f')]['sort']);_0x492fcf[_0xd205('0x39')]=qs[_0xd205('0x30')](_['pick'](_0x5c65e7[_0xd205('0x2f')],_0x111860[_0xd205('0x30')]));if(_0x5c65e7['query'][_0xd205('0x3b')]){_0x492fcf['where']=_[_0xd205('0x3e')](_0x492fcf[_0xd205('0x39')],{'$or':_[_0xd205('0x29')](_0x492fcf['attributes'],function(_0x5c7486){var _0x32abb1={};_0x32abb1[_0x5c7486]={'$like':'%'+_0x5c65e7['query']['filter']+'%'};return _0x32abb1;})});}_0x492fcf=_['merge']({},_0x492fcf,_0x5c65e7['options']);return _0x2d5d1f[_0xd205('0x4e')](_0x492fcf);}})[_0xd205('0x23')](function(_0x1dc3dd){if(_0x1dc3dd){_0x44b42f=_0x1dc3dd[_0xd205('0x34')];if(!_0x5c65e7[_0xd205('0x2f')][_0xd205('0x35')](_0xd205('0x36'))){_0x492fcf[_0xd205('0x1b')]=qs[_0xd205('0x1b')](_0x5c65e7[_0xd205('0x2f')]['limit']);_0x492fcf[_0xd205('0x1a')]=qs['offset'](_0x5c65e7[_0xd205('0x2f')][_0xd205('0x1a')]);}return _0x2d5d1f[_0xd205('0x4e')](_0x492fcf);}})[_0xd205('0x23')](function(_0x57e6da){if(_0x57e6da){return _0x57e6da?{'count':_0x44b42f,'rows':_0x57e6da}:null;}})[_0xd205('0x23')](respondWithResult(_0x4cd81d,null))[_0xd205('0x45')](handleError(_0x4cd81d,null));};exports[_0xd205('0x50')]=function(_0x25701d,_0x1c085f,_0x55a801){return db[_0xd205('0x51')]['find']({'where':{'id':_0x25701d['params']['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x1c085f,null))[_0xd205('0x23')](function(_0x1767fd){if(_0x1767fd){return _0x1767fd[_0xd205('0x50')](_0x25701d[_0xd205('0x4a')][_0xd205('0x4d')],_['omit'](_0x25701d['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1c085f,null))[_0xd205('0x45')](handleError(_0x1c085f,null));};exports['getActions']=function(_0x3ad083,_0x59d118,_0x1b852c){var _0x3db0cf={};var _0x2d1ab5={};var _0x547c03;var _0x559ffe;return db[_0xd205('0x40')]['findOne']({'where':{'id':_0x3ad083[_0xd205('0x47')]['id']}})[_0xd205('0x23')](handleEntityNotFound(_0x59d118,null))[_0xd205('0x23')](function(_0x451d14){if(_0x451d14){_0x547c03=_0x451d14;_0x2d1ab5[_0xd205('0x2d')]=_[_0xd205('0x2e')](db[_0xd205('0x51')][_0xd205('0x2a')]);_0x2d1ab5[_0xd205('0x2f')]=_[_0xd205('0x2e')](_0x3ad083[_0xd205('0x2f')]);_0x2d1ab5[_0xd205('0x30')]=_['intersection'](_0x2d1ab5[_0xd205('0x2d')],_0x2d1ab5[_0xd205('0x2f')]);_0x3db0cf[_0xd205('0x32')]=_[_0xd205('0x31')](_0x2d1ab5['model'],qs[_0xd205('0x33')](_0x3ad083[_0xd205('0x2f')]['fields']));_0x3db0cf[_0xd205('0x32')]=_0x3db0cf[_0xd205('0x32')][_0xd205('0x34')]?_0x3db0cf[_0xd205('0x32')]:_0x2d1ab5[_0xd205('0x2d')];_0x3db0cf['order']=qs['sort'](_0x3ad083[_0xd205('0x2f')]['sort']);_0x3db0cf[_0xd205('0x39')]=qs[_0xd205('0x30')](_[_0xd205('0x3a')](_0x3ad083[_0xd205('0x2f')],_0x2d1ab5[_0xd205('0x30')]));if(_0x3ad083[_0xd205('0x2f')]['filter']){_0x3db0cf[_0xd205('0x39')]=_[_0xd205('0x3e')](_0x3db0cf[_0xd205('0x39')],{'$or':_[_0xd205('0x29')](_0x3db0cf[_0xd205('0x32')],function(_0x45b594){var _0x3679f4={};_0x3679f4[_0x45b594]={'$like':'%'+_0x3ad083[_0xd205('0x2f')][_0xd205('0x3b')]+'%'};return _0x3679f4;})});}_0x3db0cf=_[_0xd205('0x3e')]({},_0x3db0cf,_0x3ad083[_0xd205('0x3f')]);return _0x547c03[_0xd205('0x52')](_0x3db0cf);}})[_0xd205('0x23')](function(_0x1d0652){if(_0x1d0652){_0x559ffe=_0x1d0652['length'];if(!_0x3ad083[_0xd205('0x2f')]['hasOwnProperty'](_0xd205('0x36'))){_0x3db0cf[_0xd205('0x1b')]=qs[_0xd205('0x1b')](_0x3ad083[_0xd205('0x2f')][_0xd205('0x1b')]);_0x3db0cf[_0xd205('0x1a')]=qs[_0xd205('0x1a')](_0x3ad083[_0xd205('0x2f')][_0xd205('0x1a')]);}return _0x547c03[_0xd205('0x52')](_0x3db0cf);}})[_0xd205('0x23')](function(_0x26e97b){if(_0x26e97b){return _0x26e97b?{'count':_0x559ffe,'rows':_0x26e97b}:null;}})['then'](respondWithResult(_0x59d118,null))[_0xd205('0x45')](handleError(_0x59d118,null));}; \ No newline at end of file +var _0xaab7=['addConditions','Condition','ids','findOne','order','pick','getConditions','Action','addActions','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body'];(function(_0x595862,_0x12d028){var _0x275da2=function(_0xfe2299){while(--_0xfe2299){_0x595862['push'](_0x595862['shift']());}};_0x275da2(++_0x12d028);}(_0xaab7,0x1b9));var _0x7aab=function(_0x373c50,_0x299679){_0x373c50=_0x373c50-0x0;var _0x2b8b77=_0xaab7[_0x373c50];return _0x2b8b77;};'use strict';var emlformat=require(_0x7aab('0x0'));var rimraf=require(_0x7aab('0x1'));var zipdir=require(_0x7aab('0x2'));var jsonpatch=require(_0x7aab('0x3'));var rp=require('request-promise');var moment=require(_0x7aab('0x4'));var BPromise=require(_0x7aab('0x5'));var Mustache=require(_0x7aab('0x6'));var util=require(_0x7aab('0x7'));var path=require(_0x7aab('0x8'));var sox=require(_0x7aab('0x9'));var csv=require(_0x7aab('0xa'));var ejs=require(_0x7aab('0xb'));var fs=require('fs');var fs_extra=require(_0x7aab('0xc'));var _=require(_0x7aab('0xd'));var squel=require('squel');var crypto=require(_0x7aab('0xe'));var jsforce=require(_0x7aab('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7aab('0xa'));var querystring=require(_0x7aab('0x10'));var Papa=require(_0x7aab('0x11'));var Redis=require(_0x7aab('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7aab('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7aab('0x14'));var logger=require(_0x7aab('0x15'))(_0x7aab('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7aab('0x17'))['db'];function respondWithStatusCode(_0x5a8816,_0x941ca){_0x941ca=_0x941ca||0xcc;return function(_0x128ec1){if(_0x128ec1){return _0x5a8816[_0x7aab('0x18')](_0x941ca);}return _0x5a8816['status'](_0x941ca)[_0x7aab('0x19')]();};}function respondWithResult(_0x294e72,_0x8dda41){_0x8dda41=_0x8dda41||0xc8;return function(_0x54868d){if(_0x54868d){return _0x294e72[_0x7aab('0x1a')](_0x8dda41)[_0x7aab('0x1b')](_0x54868d);}};}function respondWithFilteredResult(_0x211b19,_0x41ddc2){return function(_0x13bad2){if(_0x13bad2){var _0x5635fa=typeof _0x41ddc2[_0x7aab('0x1c')]===_0x7aab('0x1d')&&typeof _0x41ddc2[_0x7aab('0x1e')]===_0x7aab('0x1d');var _0x2e9873=_0x13bad2[_0x7aab('0x1f')];var _0x5ef2aa=_0x5635fa?0x0:_0x41ddc2[_0x7aab('0x1c')];var _0x3d94b6=_0x5635fa?_0x13bad2[_0x7aab('0x1f')]:_0x41ddc2[_0x7aab('0x1c')]+_0x41ddc2[_0x7aab('0x1e')];var _0xbffc68;if(_0x3d94b6>=_0x2e9873){_0x3d94b6=_0x2e9873;_0xbffc68=0xc8;}else{_0xbffc68=0xce;}_0x211b19[_0x7aab('0x1a')](_0xbffc68);return _0x211b19[_0x7aab('0x20')](_0x7aab('0x21'),_0x5ef2aa+'-'+_0x3d94b6+'/'+_0x2e9873)[_0x7aab('0x1b')](_0x13bad2);}return null;};}function patchUpdates(_0x205b33){return function(_0x20d701){try{jsonpatch[_0x7aab('0x22')](_0x20d701,_0x205b33,!![]);}catch(_0x35a0f9){return BPromise[_0x7aab('0x23')](_0x35a0f9);}return _0x20d701[_0x7aab('0x24')]();};}function saveUpdates(_0x31a128,_0x43f58a){return function(_0x511def){if(_0x511def){return _0x511def[_0x7aab('0x25')](_0x31a128)[_0x7aab('0x26')](function(_0x36d06a){return _0x36d06a;});}return null;};}function removeEntity(_0x281e1c,_0x3536c8){return function(_0x1250a2){if(_0x1250a2){return _0x1250a2[_0x7aab('0x27')]()['then'](function(){_0x281e1c['status'](0xcc)[_0x7aab('0x19')]();});}};}function handleEntityNotFound(_0x7df8bf,_0x133f9f){return function(_0x39d973){if(!_0x39d973){_0x7df8bf['sendStatus'](0x194);}return _0x39d973;};}function handleError(_0x219ed8,_0x5f5902){_0x5f5902=_0x5f5902||0x1f4;return function(_0x2e6288){logger['error'](_0x2e6288['stack']);if(_0x2e6288[_0x7aab('0x28')]){delete _0x2e6288[_0x7aab('0x28')];}_0x219ed8['status'](_0x5f5902)[_0x7aab('0x29')](_0x2e6288);};}exports[_0x7aab('0x2a')]=function(_0x414cea,_0x115b37){var _0x407cde={},_0x2df61e={},_0x12977d={'count':0x0,'rows':[]};var _0x552f71=_[_0x7aab('0x2b')](db[_0x7aab('0x2c')][_0x7aab('0x2d')],function(_0x50343e){return{'name':_0x50343e[_0x7aab('0x2e')],'type':_0x50343e[_0x7aab('0x2f')][_0x7aab('0x30')]};});_0x2df61e[_0x7aab('0x31')]=_[_0x7aab('0x2b')](_0x552f71,'name');_0x2df61e[_0x7aab('0x32')]=_['keys'](_0x414cea['query']);_0x2df61e[_0x7aab('0x33')]=_['intersection'](_0x2df61e[_0x7aab('0x31')],_0x2df61e['query']);_0x407cde[_0x7aab('0x34')]=_['intersection'](_0x2df61e[_0x7aab('0x31')],qs['fields'](_0x414cea[_0x7aab('0x32')][_0x7aab('0x35')]));_0x407cde[_0x7aab('0x34')]=_0x407cde[_0x7aab('0x34')][_0x7aab('0x36')]?_0x407cde[_0x7aab('0x34')]:_0x2df61e['model'];if(!_0x414cea[_0x7aab('0x32')][_0x7aab('0x37')](_0x7aab('0x38'))){_0x407cde[_0x7aab('0x1e')]=qs[_0x7aab('0x1e')](_0x414cea[_0x7aab('0x32')][_0x7aab('0x1e')]);_0x407cde[_0x7aab('0x1c')]=qs[_0x7aab('0x1c')](_0x414cea[_0x7aab('0x32')][_0x7aab('0x1c')]);}_0x407cde['order']=qs['sort'](_0x414cea[_0x7aab('0x32')][_0x7aab('0x39')]);_0x407cde[_0x7aab('0x3a')]=qs[_0x7aab('0x33')](_['pick'](_0x414cea[_0x7aab('0x32')],_0x2df61e['filters']),_0x552f71);if(_0x414cea[_0x7aab('0x32')][_0x7aab('0x3b')]){_0x407cde[_0x7aab('0x3a')]=_['merge'](_0x407cde['where'],{'$or':_[_0x7aab('0x2b')](_0x552f71,function(_0x1a63fb){if(_0x1a63fb[_0x7aab('0x2f')]!==_0x7aab('0x3c')){var _0x5ca150={};_0x5ca150[_0x1a63fb[_0x7aab('0x28')]]={'$like':'%'+_0x414cea[_0x7aab('0x32')][_0x7aab('0x3b')]+'%'};return _0x5ca150;}})});}_0x407cde=_[_0x7aab('0x3d')]({},_0x407cde,_0x414cea[_0x7aab('0x3e')]);var _0x318cf7={'where':_0x407cde[_0x7aab('0x3a')]};return db[_0x7aab('0x2c')][_0x7aab('0x1f')](_0x318cf7)[_0x7aab('0x26')](function(_0x3fb213){_0x12977d[_0x7aab('0x1f')]=_0x3fb213;if(_0x414cea[_0x7aab('0x32')][_0x7aab('0x3f')]){_0x407cde[_0x7aab('0x40')]=[{'all':!![]}];}return db['Automation'][_0x7aab('0x41')](_0x407cde);})[_0x7aab('0x26')](function(_0xcffd8){_0x12977d[_0x7aab('0x42')]=_0xcffd8;return _0x12977d;})[_0x7aab('0x26')](respondWithFilteredResult(_0x115b37,_0x407cde))[_0x7aab('0x43')](handleError(_0x115b37,null));};exports[_0x7aab('0x44')]=function(_0x3da2c4,_0x25b657){var _0xa2ea88={'raw':![],'where':{'id':_0x3da2c4[_0x7aab('0x45')]['id']}},_0x4e949b={};_0x4e949b['model']=_[_0x7aab('0x46')](db[_0x7aab('0x2c')]['rawAttributes']);_0x4e949b[_0x7aab('0x32')]=_[_0x7aab('0x46')](_0x3da2c4[_0x7aab('0x32')]);_0x4e949b['filters']=_['intersection'](_0x4e949b[_0x7aab('0x31')],_0x4e949b['query']);_0xa2ea88[_0x7aab('0x34')]=_[_0x7aab('0x47')](_0x4e949b['model'],qs[_0x7aab('0x35')](_0x3da2c4[_0x7aab('0x32')][_0x7aab('0x35')]));_0xa2ea88[_0x7aab('0x34')]=_0xa2ea88[_0x7aab('0x34')][_0x7aab('0x36')]?_0xa2ea88[_0x7aab('0x34')]:_0x4e949b[_0x7aab('0x31')];if(_0x3da2c4['query'][_0x7aab('0x3f')]){_0xa2ea88[_0x7aab('0x40')]=[{'all':!![]}];}_0xa2ea88=_[_0x7aab('0x3d')]({},_0xa2ea88,_0x3da2c4[_0x7aab('0x3e')]);return db['Automation'][_0x7aab('0x48')](_0xa2ea88)[_0x7aab('0x26')](handleEntityNotFound(_0x25b657,null))['then'](respondWithResult(_0x25b657,null))[_0x7aab('0x43')](handleError(_0x25b657,null));};exports[_0x7aab('0x49')]=function(_0x128e1e,_0x1601b7){return db[_0x7aab('0x2c')][_0x7aab('0x49')](_0x128e1e['body'],{})[_0x7aab('0x26')](respondWithResult(_0x1601b7,0xc9))['catch'](handleError(_0x1601b7,null));};exports[_0x7aab('0x25')]=function(_0x2f594a,_0x316aef){if(_0x2f594a['body']['id']){delete _0x2f594a[_0x7aab('0x4a')]['id'];}return db[_0x7aab('0x2c')]['find']({'where':{'id':_0x2f594a['params']['id']}})[_0x7aab('0x26')](handleEntityNotFound(_0x316aef,null))[_0x7aab('0x26')](saveUpdates(_0x2f594a[_0x7aab('0x4a')],null))[_0x7aab('0x26')](respondWithResult(_0x316aef,null))[_0x7aab('0x43')](handleError(_0x316aef,null));};exports[_0x7aab('0x27')]=function(_0x5d8cb3,_0x30d554){return db[_0x7aab('0x2c')]['find']({'where':{'id':_0x5d8cb3['params']['id']}})['then'](handleEntityNotFound(_0x30d554,null))[_0x7aab('0x26')](removeEntity(_0x30d554,null))[_0x7aab('0x43')](handleError(_0x30d554,null));};exports[_0x7aab('0x4b')]=function(_0x2693f1,_0x1a342c,_0x3d85db){return db[_0x7aab('0x4c')]['find']({'where':{'id':_0x2693f1[_0x7aab('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a342c,null))[_0x7aab('0x26')](function(_0x4cd1c8){if(_0x4cd1c8){return _0x4cd1c8[_0x7aab('0x4b')](_0x2693f1[_0x7aab('0x4a')]['ids'],_['omit'](_0x2693f1['body'],[_0x7aab('0x4d'),'id'])||{});}})[_0x7aab('0x26')](respondWithResult(_0x1a342c,null))['catch'](handleError(_0x1a342c,null));};exports['getConditions']=function(_0x17e005,_0x1114fd,_0x2f8e9e){var _0x1d3b80={};var _0x38666a={};var _0x5bbc83;var _0x5559dc;return db[_0x7aab('0x2c')][_0x7aab('0x4e')]({'where':{'id':_0x17e005['params']['id']}})[_0x7aab('0x26')](handleEntityNotFound(_0x1114fd,null))['then'](function(_0x23ef4e){if(_0x23ef4e){_0x5bbc83=_0x23ef4e;_0x38666a['model']=_[_0x7aab('0x46')](db[_0x7aab('0x4c')][_0x7aab('0x2d')]);_0x38666a[_0x7aab('0x32')]=_['keys'](_0x17e005['query']);_0x38666a[_0x7aab('0x33')]=_['intersection'](_0x38666a[_0x7aab('0x31')],_0x38666a[_0x7aab('0x32')]);_0x1d3b80['attributes']=_[_0x7aab('0x47')](_0x38666a['model'],qs['fields'](_0x17e005[_0x7aab('0x32')][_0x7aab('0x35')]));_0x1d3b80[_0x7aab('0x34')]=_0x1d3b80[_0x7aab('0x34')][_0x7aab('0x36')]?_0x1d3b80[_0x7aab('0x34')]:_0x38666a['model'];_0x1d3b80[_0x7aab('0x4f')]=qs[_0x7aab('0x39')](_0x17e005[_0x7aab('0x32')]['sort']);_0x1d3b80[_0x7aab('0x3a')]=qs['filters'](_[_0x7aab('0x50')](_0x17e005[_0x7aab('0x32')],_0x38666a[_0x7aab('0x33')]));if(_0x17e005[_0x7aab('0x32')][_0x7aab('0x3b')]){_0x1d3b80[_0x7aab('0x3a')]=_[_0x7aab('0x3d')](_0x1d3b80[_0x7aab('0x3a')],{'$or':_['map'](_0x1d3b80[_0x7aab('0x34')],function(_0x5bba84){var _0x3e1a63={};_0x3e1a63[_0x5bba84]={'$like':'%'+_0x17e005[_0x7aab('0x32')]['filter']+'%'};return _0x3e1a63;})});}_0x1d3b80=_[_0x7aab('0x3d')]({},_0x1d3b80,_0x17e005['options']);return _0x5bbc83[_0x7aab('0x51')](_0x1d3b80);}})[_0x7aab('0x26')](function(_0x2bcdc3){if(_0x2bcdc3){_0x5559dc=_0x2bcdc3['length'];if(!_0x17e005[_0x7aab('0x32')][_0x7aab('0x37')]('nolimit')){_0x1d3b80['limit']=qs['limit'](_0x17e005[_0x7aab('0x32')][_0x7aab('0x1e')]);_0x1d3b80['offset']=qs[_0x7aab('0x1c')](_0x17e005['query']['offset']);}return _0x5bbc83[_0x7aab('0x51')](_0x1d3b80);}})[_0x7aab('0x26')](function(_0x2a4d9f){if(_0x2a4d9f){return _0x2a4d9f?{'count':_0x5559dc,'rows':_0x2a4d9f}:null;}})[_0x7aab('0x26')](respondWithResult(_0x1114fd,null))['catch'](handleError(_0x1114fd,null));};exports['addActions']=function(_0x325838,_0x130211,_0x34e87e){return db[_0x7aab('0x52')][_0x7aab('0x48')]({'where':{'id':_0x325838['params']['id']}})[_0x7aab('0x26')](handleEntityNotFound(_0x130211,null))[_0x7aab('0x26')](function(_0x322306){if(_0x322306){return _0x322306[_0x7aab('0x53')](_0x325838[_0x7aab('0x4a')]['ids'],_[_0x7aab('0x54')](_0x325838['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x130211,null))[_0x7aab('0x43')](handleError(_0x130211,null));};exports[_0x7aab('0x55')]=function(_0x31fd51,_0x36a4b3,_0x1ed4f5){var _0x179c5f={};var _0x314023={};var _0x46f4d1;var _0x4d2675;return db['Automation']['findOne']({'where':{'id':_0x31fd51['params']['id']}})['then'](handleEntityNotFound(_0x36a4b3,null))[_0x7aab('0x26')](function(_0x3fed57){if(_0x3fed57){_0x46f4d1=_0x3fed57;_0x314023[_0x7aab('0x31')]=_[_0x7aab('0x46')](db[_0x7aab('0x52')][_0x7aab('0x2d')]);_0x314023['query']=_[_0x7aab('0x46')](_0x31fd51['query']);_0x314023['filters']=_[_0x7aab('0x47')](_0x314023['model'],_0x314023[_0x7aab('0x32')]);_0x179c5f[_0x7aab('0x34')]=_[_0x7aab('0x47')](_0x314023[_0x7aab('0x31')],qs[_0x7aab('0x35')](_0x31fd51[_0x7aab('0x32')][_0x7aab('0x35')]));_0x179c5f[_0x7aab('0x34')]=_0x179c5f[_0x7aab('0x34')][_0x7aab('0x36')]?_0x179c5f[_0x7aab('0x34')]:_0x314023[_0x7aab('0x31')];_0x179c5f[_0x7aab('0x4f')]=qs[_0x7aab('0x39')](_0x31fd51['query']['sort']);_0x179c5f['where']=qs['filters'](_[_0x7aab('0x50')](_0x31fd51['query'],_0x314023[_0x7aab('0x33')]));if(_0x31fd51[_0x7aab('0x32')][_0x7aab('0x3b')]){_0x179c5f[_0x7aab('0x3a')]=_[_0x7aab('0x3d')](_0x179c5f[_0x7aab('0x3a')],{'$or':_[_0x7aab('0x2b')](_0x179c5f[_0x7aab('0x34')],function(_0xe857ee){var _0x1840be={};_0x1840be[_0xe857ee]={'$like':'%'+_0x31fd51[_0x7aab('0x32')]['filter']+'%'};return _0x1840be;})});}_0x179c5f=_['merge']({},_0x179c5f,_0x31fd51[_0x7aab('0x3e')]);return _0x46f4d1[_0x7aab('0x55')](_0x179c5f);}})[_0x7aab('0x26')](function(_0xe21a03){if(_0xe21a03){_0x4d2675=_0xe21a03[_0x7aab('0x36')];if(!_0x31fd51[_0x7aab('0x32')]['hasOwnProperty'](_0x7aab('0x38'))){_0x179c5f[_0x7aab('0x1e')]=qs[_0x7aab('0x1e')](_0x31fd51['query']['limit']);_0x179c5f['offset']=qs['offset'](_0x31fd51[_0x7aab('0x32')][_0x7aab('0x1c')]);}return _0x46f4d1[_0x7aab('0x55')](_0x179c5f);}})['then'](function(_0x2eafb2){if(_0x2eafb2){return _0x2eafb2?{'count':_0x4d2675,'rows':_0x2eafb2}:null;}})['then'](respondWithResult(_0x36a4b3,null))['catch'](handleError(_0x36a4b3,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index bd5ab03..b3146a5 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 _0xc885=['request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xc885,0x10b));var _0x5c88=function(_0x446d64,_0x1357d3){_0x446d64=_0x446d64-0x0;var _0x34201b=_0xc885[_0x446d64];return _0x34201b;};'use strict';var _=require(_0x5c88('0x0'));var util=require(_0x5c88('0x1'));var logger=require(_0x5c88('0x2'))(_0x5c88('0x3'));var moment=require(_0x5c88('0x4'));var BPromise=require(_0x5c88('0x5'));var rp=require(_0x5c88('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5c88('0x7'));var config=require(_0x5c88('0x8'));var attributes=require(_0x5c88('0x9'));module[_0x5c88('0xa')]=function(_0x5caaed,_0x38c40f){return _0x5caaed['define'](_0x5c88('0xb'),attributes,{'tableName':_0x5c88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee51=['rimraf','../../config/environment','./automation.attributes','define','Automation','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x991f6d,_0xb18081){var _0x317a95=function(_0x3624c7){while(--_0x3624c7){_0x991f6d['push'](_0x991f6d['shift']());}};_0x317a95(++_0xb18081);}(_0xee51,0x68));var _0x1ee5=function(_0x196655,_0x3664e2){_0x196655=_0x196655-0x0;var _0x51e53f=_0xee51[_0x196655];return _0x51e53f;};'use strict';var _=require(_0x1ee5('0x0'));var util=require('util');var logger=require(_0x1ee5('0x1'))(_0x1ee5('0x2'));var moment=require(_0x1ee5('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ee5('0x4'));var fs=require('fs');var path=require(_0x1ee5('0x5'));var rimraf=require(_0x1ee5('0x6'));var config=require(_0x1ee5('0x7'));var attributes=require(_0x1ee5('0x8'));module['exports']=function(_0x34736e,_0x1c3cef){return _0x34736e[_0x1ee5('0x9')](_0x1ee5('0xa'),attributes,{'tableName':'tools_automations','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 7deb535..2be90ab 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 _0xb982=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird'];(function(_0x3eb221,_0x39f3ab){var _0x2bdf1e=function(_0x3308ce){while(--_0x3308ce){_0x3eb221['push'](_0x3eb221['shift']());}};_0x2bdf1e(++_0x39f3ab);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2b98('0x0'));var BPromise=require(_0x2b98('0x1'));var rs=require(_0x2b98('0x2'));var fs=require('fs');var Redis=require(_0x2b98('0x3'));var db=require(_0x2b98('0x4'))['db'];var utils=require(_0x2b98('0x5'));var logger=require(_0x2b98('0x6'))(_0x2b98('0x7'));var config=require(_0x2b98('0x8'));var jayson=require(_0x2b98('0x9'));var client=jayson['client'][_0x2b98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1166cb,_0x15ee91,_0x4626ad){return new BPromise(function(_0x3a6bad,_0x6b6f9e){return client['request'](_0x1166cb,_0x4626ad)[_0x2b98('0xb')](function(_0x4c64b5){logger['info'](_0x2b98('0xc'),_0x15ee91,'request\x20sent');logger[_0x2b98('0xd')](_0x2b98('0xe'),_0x15ee91,_0x2b98('0xf'),JSON[_0x2b98('0x10')](_0x4c64b5));if(_0x4c64b5[_0x2b98('0x11')]){if(_0x4c64b5['error'][_0x2b98('0x12')]===0x1f4){logger['error'](_0x2b98('0xc'),_0x15ee91,_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);return _0x6b6f9e(_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);}logger[_0x2b98('0x11')]('Automation,\x20%s,\x20%s',_0x15ee91,_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);return _0x3a6bad(_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);}else{logger[_0x2b98('0x14')](_0x2b98('0xc'),_0x15ee91,_0x2b98('0xf'));_0x3a6bad(_0x4c64b5['result'][_0x2b98('0x13')]);}})[_0x2b98('0x15')](function(_0x51eb95){logger[_0x2b98('0x11')]('Automation,\x20%s,\x20%s',_0x15ee91,_0x51eb95);_0x6b6f9e(_0x51eb95);});});} \ No newline at end of file +var _0x1e8c=['info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x21c586,_0x58e148){var _0x45d9bc=function(_0x4d6fc8){while(--_0x4d6fc8){_0x21c586['push'](_0x21c586['shift']());}};_0x45d9bc(++_0x58e148);}(_0x1e8c,0xd3));var _0xc1e8=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x1e8c[_0x45b034];return _0x509cb0;};'use strict';var _=require('lodash');var util=require(_0xc1e8('0x0'));var moment=require(_0xc1e8('0x1'));var BPromise=require(_0xc1e8('0x2'));var rs=require(_0xc1e8('0x3'));var fs=require('fs');var Redis=require(_0xc1e8('0x4'));var db=require(_0xc1e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1e8('0x6'))(_0xc1e8('0x7'));var config=require(_0xc1e8('0x8'));var jayson=require(_0xc1e8('0x9'));var client=jayson[_0xc1e8('0xa')][_0xc1e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x547868,_0x457b9d,_0x40e7cd){return new BPromise(function(_0x3b5001,_0x48a012){return client[_0xc1e8('0xc')](_0x547868,_0x40e7cd)[_0xc1e8('0xd')](function(_0xad4215){logger[_0xc1e8('0xe')](_0xc1e8('0xf'),_0x457b9d,'request\x20sent');logger[_0xc1e8('0x10')](_0xc1e8('0x11'),_0x457b9d,_0xc1e8('0x12'),JSON[_0xc1e8('0x13')](_0xad4215));if(_0xad4215[_0xc1e8('0x14')]){if(_0xad4215[_0xc1e8('0x14')][_0xc1e8('0x15')]===0x1f4){logger[_0xc1e8('0x14')]('Automation,\x20%s,\x20%s',_0x457b9d,_0xad4215[_0xc1e8('0x14')][_0xc1e8('0x16')]);return _0x48a012(_0xad4215[_0xc1e8('0x14')][_0xc1e8('0x16')]);}logger[_0xc1e8('0x14')](_0xc1e8('0xf'),_0x457b9d,_0xad4215[_0xc1e8('0x14')]['message']);return _0x3b5001(_0xad4215[_0xc1e8('0x14')][_0xc1e8('0x16')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x457b9d,_0xc1e8('0x12'));_0x3b5001(_0xad4215[_0xc1e8('0x17')][_0xc1e8('0x16')]);}})[_0xc1e8('0x18')](function(_0xe69604){logger['error'](_0xc1e8('0xf'),_0x457b9d,_0xe69604);_0x48a012(_0xe69604);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5be289e..555b344 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 _0x0389=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','/:id/actions','addActions','/:id','update','delete','exports','multer'];(function(_0x2eef0d,_0x9a36a1){var _0x23a0a2=function(_0x3a72c9){while(--_0x3a72c9){_0x2eef0d['push'](_0x2eef0d['shift']());}};_0x23a0a2(++_0x9a36a1);}(_0x0389,0x175));var _0x9038=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x0389[_0x320b8e];return _0x55a10a;};'use strict';var multer=require(_0x9038('0x0'));var util=require('util');var path=require(_0x9038('0x1'));var timeout=require(_0x9038('0x2'));var express=require(_0x9038('0x3'));var router=express[_0x9038('0x4')]();var fs_extra=require(_0x9038('0x5'));var auth=require(_0x9038('0x6'));var interaction=require(_0x9038('0x7'));var config=require('../../config/environment');var controller=require(_0x9038('0x8'));router[_0x9038('0x9')]('/',auth[_0x9038('0xa')](),controller['index']);router['get']('/:id',auth[_0x9038('0xa')](),controller[_0x9038('0xb')]);router[_0x9038('0x9')](_0x9038('0xc'),auth['isAuthenticated'](),controller[_0x9038('0xd')]);router['get']('/:id/actions',auth[_0x9038('0xa')](),controller[_0x9038('0xe')]);router['post']('/',auth[_0x9038('0xa')](),controller['create']);router[_0x9038('0xf')](_0x9038('0xc'),auth[_0x9038('0xa')](),controller['addConditions']);router[_0x9038('0xf')](_0x9038('0x10'),auth[_0x9038('0xa')](),controller[_0x9038('0x11')]);router['put'](_0x9038('0x12'),auth[_0x9038('0xa')](),controller[_0x9038('0x13')]);router[_0x9038('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9038('0x15')]=router; \ No newline at end of file +var _0xadae=['put','update','multer','util','path','../../config/environment','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions'];(function(_0x1238e0,_0x16bd9b){var _0x59dfc8=function(_0x3cd547){while(--_0x3cd547){_0x1238e0['push'](_0x1238e0['shift']());}};_0x59dfc8(++_0x16bd9b);}(_0xadae,0x134));var _0xeada=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xadae[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0xeada('0x0'));var util=require(_0xeada('0x1'));var path=require(_0xeada('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeada('0x3'));var controller=require('./automation.controller');router[_0xeada('0x4')]('/',auth[_0xeada('0x5')](),controller['index']);router['get'](_0xeada('0x6'),auth[_0xeada('0x5')](),controller[_0xeada('0x7')]);router[_0xeada('0x4')](_0xeada('0x8'),auth[_0xeada('0x5')](),controller[_0xeada('0x9')]);router[_0xeada('0x4')](_0xeada('0xa'),auth[_0xeada('0x5')](),controller[_0xeada('0xb')]);router[_0xeada('0xc')]('/',auth[_0xeada('0x5')](),controller['create']);router['post'](_0xeada('0x8'),auth[_0xeada('0x5')](),controller[_0xeada('0xd')]);router[_0xeada('0xc')](_0xeada('0xa'),auth['isAuthenticated'](),controller[_0xeada('0xe')]);router[_0xeada('0xf')](_0xeada('0x6'),auth[_0xeada('0x5')](),controller[_0xeada('0x10')]);router['delete'](_0xeada('0x6'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index cc8eacf..c10b51f 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 _0xea67=['exports','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\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,*,*,*','always','never','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0x11aa3e,_0x11a2e8){var _0x3693a7=function(_0x4ad881){while(--_0x4ad881){_0x11aa3e['push'](_0x11aa3e['shift']());}};_0x3693a7(++_0x11a2e8);}(_0xea67,0x1e9));var _0x7ea6=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0xea67[_0x3bef2c];return _0x331503;};'use strict';var Sequelize=require(_0x7ea6('0x0'));module[_0x7ea6('0x1')]={'name':{'type':Sequelize[_0x7ea6('0x2')],'unique':_0x7ea6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7ea6('0x4')](_0x7ea6('0x5')),'allowNull':![],'defaultValue':_0x7ea6('0x5')},'description':{'type':Sequelize[_0x7ea6('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x7ea6('0x6')](0x4)[_0x7ea6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7ea6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7ea6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7ea6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'comment':_0x7ea6('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x7ea6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7ea6('0x2')],'defaultValue':_0x7ea6('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x7ea6('0x4')](_0x7ea6('0xe'),_0x7ea6('0xf'),_0x7ea6('0x10')),'defaultValue':_0x7ea6('0xe')},'dialAMDActive':{'type':Sequelize[_0x7ea6('0x11')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x7ea6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7ea6('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x7ea6('0x6')](0x9)[_0x7ea6('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7ea6('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7ea6('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7ea6('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x7ea6('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7ea6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7ea6('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7ea6('0x6')](0x9)[_0x7ea6('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7ea6('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7ea6('0x6')](0x9)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7ea6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7ea6('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7ea6('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7ea6('0x4')](_0x7ea6('0x19'),_0x7ea6('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7ea6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7ea6('0x1b')},'dialCutDigit':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)[_0x7ea6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7ea6('0x6')](0x3)[_0x7ea6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7ea6('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7ea6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7ea6('0x22')}}; \ No newline at end of file +var _0x2faf=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2b88a9,_0x2ecbbe){var _0x5ad1be=function(_0x4ba84e){while(--_0x4ba84e){_0x2b88a9['push'](_0x2b88a9['shift']());}};_0x5ad1be(++_0x2ecbbe);}(_0x2faf,0x16a));var _0xf2fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2faf[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xf2fa('0x0'));module[_0xf2fa('0x1')]={'name':{'type':Sequelize[_0xf2fa('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf2fa('0x3')](_0xf2fa('0x4')),'allowNull':![],'defaultValue':_0xf2fa('0x4')},'description':{'type':Sequelize[_0xf2fa('0x2')]},'active':{'type':Sequelize[_0xf2fa('0x5')],'defaultValue':0x0,'comment':_0xf2fa('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf2fa('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf2fa('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf2fa('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xf2fa('0x8')](0x3)[_0xf2fa('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf2fa('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf2fa('0x8')](0x3)[_0xf2fa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf2fa('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf2fa('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf2fa('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xf2fa('0x8')](0x3)[_0xf2fa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf2fa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf2fa('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf2fa('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf2fa('0x8')](0x5)[_0xf2fa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf2fa('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf2fa('0xf')},'dialTimezone':{'type':Sequelize[_0xf2fa('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf2fa('0x2')],'defaultValue':_0xf2fa('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf2fa('0x3')](_0xf2fa('0x11'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xf2fa('0x5')],'defaultValue':0x0,'comment':_0xf2fa('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xf2fa('0x8')](0x9)[_0xf2fa('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf2fa('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xf2fa('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf2fa('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf2fa('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf2fa('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf2fa('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xf2fa('0x8')](0x9)[_0xf2fa('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf2fa('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf2fa('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf2fa('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf2fa('0x8')](0x9)[_0xf2fa('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf2fa('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf2fa('0x8')](0x5)[_0xf2fa('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf2fa('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf2fa('0x8')](0x9)[_0xf2fa('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf2fa('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xf2fa('0x1b'),_0xf2fa('0x1c')),'defaultValue':_0xf2fa('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf2fa('0x8')](0x3)[_0xf2fa('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf2fa('0x8')](0x3)[_0xf2fa('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf2fa('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf2fa('0x8')](0x3)[_0xf2fa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf2fa('0x8')](0x5)[_0xf2fa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf2fa('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf2fa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf2fa('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf2fa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf2fa('0x8')](0x3)[_0xf2fa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf2fa('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf2fa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf2fa('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf2fa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf2fa('0x8')](0x5)[_0xf2fa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf2fa('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf2fa('0x8')](0x3)[_0xf2fa('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf2fa('0x8')](0x5)[_0xf2fa('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf2fa('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 6d82b4e..5472bb9 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 _0x3828=['../../mysqldb','sendStatus','end','json','offset','limit','undefined','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','clone','params','omit','createdAt','updatedAt','role','IvrCampaigns','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','order','CampaignId','getHopperHistories','CmHopperHistory','sort','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2aa3ed,_0x21bb61){var _0x4e0881=function(_0x581164){while(--_0x581164){_0x2aa3ed['push'](_0x2aa3ed['shift']());}};_0x4e0881(++_0x21bb61);}(_0x3828,0x188));var _0x8382=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3828[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x8382('0x0'));var rimraf=require(_0x8382('0x1'));var zipdir=require(_0x8382('0x2'));var jsonpatch=require(_0x8382('0x3'));var rp=require('request-promise');var moment=require(_0x8382('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8382('0x5'));var util=require(_0x8382('0x6'));var path=require(_0x8382('0x7'));var sox=require('sox');var csv=require(_0x8382('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8382('0x9'));var _=require('lodash');var squel=require(_0x8382('0xa'));var crypto=require(_0x8382('0xb'));var jsforce=require(_0x8382('0xc'));var deskjs=require(_0x8382('0xd'));var toCsv=require(_0x8382('0x8'));var querystring=require(_0x8382('0xe'));var Papa=require(_0x8382('0xf'));var Redis=require(_0x8382('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8382('0x11'));var as=require(_0x8382('0x12'));var hardwareService=require(_0x8382('0x13'));var logger=require(_0x8382('0x14'))(_0x8382('0x15'));var utils=require(_0x8382('0x16'));var config=require(_0x8382('0x17'));var licenseUtil=require(_0x8382('0x18'));var db=require(_0x8382('0x19'))['db'];function respondWithStatusCode(_0x2a485c,_0x114977){_0x114977=_0x114977||0xcc;return function(_0x3b9d59){if(_0x3b9d59){return _0x2a485c[_0x8382('0x1a')](_0x114977);}return _0x2a485c['status'](_0x114977)[_0x8382('0x1b')]();};}function respondWithResult(_0x2e0c65,_0x43eb8c){_0x43eb8c=_0x43eb8c||0xc8;return function(_0x31080f){if(_0x31080f){return _0x2e0c65['status'](_0x43eb8c)[_0x8382('0x1c')](_0x31080f);}};}function respondWithFilteredResult(_0x32409c,_0x21d942){return function(_0x4b4760){if(_0x4b4760){var _0x3bee21=typeof _0x21d942[_0x8382('0x1d')]==='undefined'&&typeof _0x21d942[_0x8382('0x1e')]===_0x8382('0x1f');var _0x441cb1=_0x4b4760['count'];var _0x5b39fa=_0x3bee21?0x0:_0x21d942['offset'];var _0x434de1=_0x3bee21?_0x4b4760['count']:_0x21d942[_0x8382('0x1d')]+_0x21d942[_0x8382('0x1e')];var _0x125e30;if(_0x434de1>=_0x441cb1){_0x434de1=_0x441cb1;_0x125e30=0xc8;}else{_0x125e30=0xce;}_0x32409c[_0x8382('0x20')](_0x125e30);return _0x32409c[_0x8382('0x21')](_0x8382('0x22'),_0x5b39fa+'-'+_0x434de1+'/'+_0x441cb1)[_0x8382('0x1c')](_0x4b4760);}return null;};}function patchUpdates(_0x351e58){return function(_0x43ad44){try{jsonpatch[_0x8382('0x23')](_0x43ad44,_0x351e58,!![]);}catch(_0x344cbf){return BPromise[_0x8382('0x24')](_0x344cbf);}return _0x43ad44['save']();};}function saveUpdates(_0x4af78f,_0xc595b7){return function(_0x27e87a){if(_0x27e87a){return _0x27e87a[_0x8382('0x25')](_0x4af78f)['then'](function(_0x29b9ce){return _0x29b9ce;});}return null;};}function removeEntity(_0x98f02f,_0x2fa5a0){return function(_0x503bb6){if(_0x503bb6){return _0x503bb6['destroy']()[_0x8382('0x26')](function(){var _0x12311c=_0x503bb6['get']({'plain':!![]});var _0x4377d9='IvrCampaigns';return db['UserProfileResource'][_0x8382('0x27')]({'where':{'type':_0x4377d9,'resourceId':_0x12311c['id']}})[_0x8382('0x26')](function(){return _0x503bb6;});})[_0x8382('0x26')](function(){_0x98f02f[_0x8382('0x20')](0xcc)[_0x8382('0x1b')]();});}};}function handleEntityNotFound(_0x5344dd,_0x2625e9){return function(_0x2f1a2b){if(!_0x2f1a2b){_0x5344dd[_0x8382('0x1a')](0x194);}return _0x2f1a2b;};}function handleError(_0xd2a383,_0xf207e4){_0xf207e4=_0xf207e4||0x1f4;return function(_0x10e3bc){logger[_0x8382('0x28')](_0x10e3bc[_0x8382('0x29')]);if(_0x10e3bc['name']){delete _0x10e3bc[_0x8382('0x2a')];}_0xd2a383['status'](_0xf207e4)[_0x8382('0x2b')](_0x10e3bc);};}exports[_0x8382('0x2c')]=function(_0x1f5f89,_0x188c72){var _0x75d838={},_0x41c259={},_0x5f4108={'count':0x0,'rows':[]};var _0x4bc4f0=_[_0x8382('0x2d')](db[_0x8382('0x2e')]['rawAttributes'],function(_0xf3b1ed){return{'name':_0xf3b1ed[_0x8382('0x2f')],'type':_0xf3b1ed[_0x8382('0x30')]['key']};});_0x41c259[_0x8382('0x31')]=_['map'](_0x4bc4f0,'name');_0x41c259[_0x8382('0x32')]=_[_0x8382('0x33')](_0x1f5f89['query']);_0x41c259[_0x8382('0x34')]=_[_0x8382('0x35')](_0x41c259['model'],_0x41c259[_0x8382('0x32')]);_0x75d838[_0x8382('0x36')]=_[_0x8382('0x35')](_0x41c259[_0x8382('0x31')],qs[_0x8382('0x37')](_0x1f5f89['query'][_0x8382('0x37')]));_0x75d838[_0x8382('0x36')]=_0x75d838['attributes'][_0x8382('0x38')]?_0x75d838[_0x8382('0x36')]:_0x41c259['model'];if(!_0x1f5f89[_0x8382('0x32')]['hasOwnProperty']('nolimit')){_0x75d838[_0x8382('0x1e')]=qs[_0x8382('0x1e')](_0x1f5f89[_0x8382('0x32')][_0x8382('0x1e')]);_0x75d838[_0x8382('0x1d')]=qs['offset'](_0x1f5f89[_0x8382('0x32')][_0x8382('0x1d')]);}_0x75d838['order']=qs['sort'](_0x1f5f89[_0x8382('0x32')]['sort']);_0x75d838[_0x8382('0x39')]=qs['filters'](_[_0x8382('0x3a')](_0x1f5f89[_0x8382('0x32')],_0x41c259[_0x8382('0x34')]),_0x4bc4f0);if(_0x1f5f89[_0x8382('0x32')][_0x8382('0x3b')]){_0x75d838[_0x8382('0x39')]=_[_0x8382('0x3c')](_0x75d838[_0x8382('0x39')],{'$or':_[_0x8382('0x2d')](_0x4bc4f0,function(_0x1b351a){if(_0x1b351a[_0x8382('0x30')]!=='VIRTUAL'){var _0x1ff735={};_0x1ff735[_0x1b351a[_0x8382('0x2a')]]={'$like':'%'+_0x1f5f89['query'][_0x8382('0x3b')]+'%'};return _0x1ff735;}})});}_0x75d838=_[_0x8382('0x3c')]({},_0x75d838,_0x1f5f89[_0x8382('0x3d')]);var _0x398164={'where':_0x75d838[_0x8382('0x39')]};return db[_0x8382('0x2e')][_0x8382('0x3e')](_0x398164)[_0x8382('0x26')](function(_0x4206b3){_0x5f4108[_0x8382('0x3e')]=_0x4206b3;if(_0x1f5f89[_0x8382('0x32')][_0x8382('0x3f')]){_0x75d838[_0x8382('0x40')]=[{'all':!![]}];}return db['Campaign'][_0x8382('0x41')](_0x75d838);})[_0x8382('0x26')](function(_0x2d6e44){_0x5f4108[_0x8382('0x42')]=_0x2d6e44;return _0x5f4108;})[_0x8382('0x26')](respondWithFilteredResult(_0x188c72,_0x75d838))['catch'](handleError(_0x188c72,null));};exports[_0x8382('0x43')]=function(_0x361f93,_0x13da07){var _0xf0b230={'raw':![],'where':{'id':_0x361f93['params']['id']}},_0x1aed7b={};_0x1aed7b['model']=_[_0x8382('0x33')](db[_0x8382('0x2e')][_0x8382('0x44')]);_0x1aed7b[_0x8382('0x32')]=_[_0x8382('0x33')](_0x361f93[_0x8382('0x32')]);_0x1aed7b[_0x8382('0x34')]=_[_0x8382('0x35')](_0x1aed7b[_0x8382('0x31')],_0x1aed7b[_0x8382('0x32')]);_0xf0b230[_0x8382('0x36')]=_['intersection'](_0x1aed7b[_0x8382('0x31')],qs[_0x8382('0x37')](_0x361f93['query'][_0x8382('0x37')]));_0xf0b230[_0x8382('0x36')]=_0xf0b230['attributes'][_0x8382('0x38')]?_0xf0b230[_0x8382('0x36')]:_0x1aed7b[_0x8382('0x31')];if(_0x361f93['query'][_0x8382('0x3f')]){_0xf0b230['include']=[{'all':!![]}];}_0xf0b230=_[_0x8382('0x3c')]({},_0xf0b230,_0x361f93[_0x8382('0x3d')]);return db[_0x8382('0x2e')][_0x8382('0x45')](_0xf0b230)[_0x8382('0x26')](handleEntityNotFound(_0x13da07,null))[_0x8382('0x26')](respondWithResult(_0x13da07,null))[_0x8382('0x46')](handleError(_0x13da07,null));};exports['create']=function(_0x4e83ca,_0x1bd57e){return db[_0x8382('0x2e')][_0x8382('0x47')](_0x4e83ca[_0x8382('0x48')],{})[_0x8382('0x26')](function(_0x3337b5){var _0x4cb8a4=_0x4e83ca[_0x8382('0x49')]['get']({'plain':!![]});if(!_0x4cb8a4)throw new Error(_0x8382('0x4a'));if(_0x4cb8a4['role']===_0x8382('0x49')){var _0x2e3c10=_0x3337b5[_0x8382('0x4b')]({'plain':!![]});var _0x14eb15='IvrCampaigns';return db[_0x8382('0x4c')][_0x8382('0x45')]({'where':{'name':_0x14eb15,'userProfileId':_0x4cb8a4[_0x8382('0x4d')]},'raw':!![]})[_0x8382('0x26')](function(_0x19e515){if(_0x19e515&&_0x19e515['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2e3c10[_0x8382('0x2a')],'resourceId':_0x2e3c10['id'],'type':_0x19e515[_0x8382('0x2a')],'sectionId':_0x19e515['id']},{})[_0x8382('0x26')](function(){return _0x3337b5;});}else{return _0x3337b5;}})[_0x8382('0x46')](function(_0x36c1f0){logger[_0x8382('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36c1f0);throw _0x36c1f0;});}return _0x3337b5;})[_0x8382('0x26')](respondWithResult(_0x1bd57e,0xc9))['catch'](handleError(_0x1bd57e,null));};exports[_0x8382('0x4e')]=function(_0x42d565,_0x1de434){var _0x4e730a={'where':{'id':_0x42d565[_0x8382('0x4f')]['id']}},_0x3b572e={};_0x3b572e['model']=_[_0x8382('0x33')](db[_0x8382('0x2e')][_0x8382('0x44')]);_0x4e730a[_0x8382('0x36')]=_[_0x8382('0x35')](_0x3b572e[_0x8382('0x31')],qs['fields'](_0x42d565[_0x8382('0x32')][_0x8382('0x37')]));_0x4e730a[_0x8382('0x36')]=_0x4e730a[_0x8382('0x36')]['length']?_0x4e730a[_0x8382('0x36')]:_0x3b572e[_0x8382('0x31')];if(_0x42d565[_0x8382('0x32')][_0x8382('0x3f')]){_0x4e730a[_0x8382('0x40')]=[{'all':!![]}];}_0x4e730a=_['merge']({},_0x4e730a,_0x42d565[_0x8382('0x3d')]);return db[_0x8382('0x2e')]['find'](_0x4e730a)[_0x8382('0x26')](handleEntityNotFound(_0x1de434,null))[_0x8382('0x26')](function(_0x362229){if(_0x362229){var _0x154e0c=_0x362229['get']({'plain':!![]});_0x154e0c=qs[_0x8382('0x50')](_0x154e0c,['id',_0x8382('0x51'),_0x8382('0x52')]);_0x42d565[_0x8382('0x48')]=_[_0x8382('0x50')](_0x42d565[_0x8382('0x48')],['id',_0x8382('0x51'),_0x8382('0x52')]);return db[_0x8382('0x2e')][_0x8382('0x47')](_['merge'](_0x154e0c,_0x42d565['body']),{'include':_0x42d565[_0x8382('0x32')][_0x8382('0x3f')]?[{'all':!![]}]:undefined})[_0x8382('0x26')](function(_0x4f16d9){var _0x4907eb=_0x42d565[_0x8382('0x49')][_0x8382('0x4b')]({'plain':!![]});if(!_0x4907eb)throw new Error(_0x8382('0x4a'));if(_0x4907eb[_0x8382('0x53')]===_0x8382('0x49')){var _0x4ba717=_0x4f16d9[_0x8382('0x4b')]({'plain':!![]});var _0x4f1c4a=_0x8382('0x54');return db[_0x8382('0x4c')][_0x8382('0x45')]({'where':{'name':_0x4f1c4a,'userProfileId':_0x4907eb[_0x8382('0x4d')]},'raw':!![]})[_0x8382('0x26')](function(_0x2e0ecb){if(_0x2e0ecb&&_0x2e0ecb['autoAssociation']===0x0){return db['UserProfileResource'][_0x8382('0x47')]({'name':_0x4ba717[_0x8382('0x2a')],'resourceId':_0x4ba717['id'],'type':_0x2e0ecb[_0x8382('0x2a')],'sectionId':_0x2e0ecb['id']},{})[_0x8382('0x26')](function(){return _0x4f16d9;});}else{return _0x4f16d9;}})[_0x8382('0x46')](function(_0x17ff21){logger[_0x8382('0x28')](_0x8382('0x55'),_0x17ff21);throw _0x17ff21;});}return _0x4f16d9;});}})[_0x8382('0x26')](respondWithResult(_0x1de434,0xc9))[_0x8382('0x46')](handleError(_0x1de434,null));};exports[_0x8382('0x25')]=function(_0x1b97d8,_0x107a7c){if(_0x1b97d8[_0x8382('0x48')]['id']){delete _0x1b97d8[_0x8382('0x48')]['id'];}return db['Campaign']['find']({'where':{'id':_0x1b97d8[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x107a7c,null))[_0x8382('0x26')](saveUpdates(_0x1b97d8[_0x8382('0x48')],null))[_0x8382('0x26')](respondWithResult(_0x107a7c,null))[_0x8382('0x46')](handleError(_0x107a7c,null));};exports[_0x8382('0x27')]=function(_0x30303d,_0x4854cc){return db[_0x8382('0x2e')][_0x8382('0x45')]({'where':{'id':_0x30303d[_0x8382('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4854cc,null))[_0x8382('0x26')](removeEntity(_0x4854cc,null))[_0x8382('0x46')](handleError(_0x4854cc,null));};exports[_0x8382('0x56')]=function(_0x4800dd,_0x44e678,_0xbd9997){var _0x1031d9={'raw':!![],'where':{}};var _0x271b66={};var _0x3de4ad={'count':0x0,'rows':[]};return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x4800dd[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x44e678,null))[_0x8382('0x26')](function(_0x182fd1){if(_0x182fd1){_0x271b66[_0x8382('0x31')]=_['keys'](db[_0x8382('0x58')][_0x8382('0x44')]);_0x271b66[_0x8382('0x32')]=_[_0x8382('0x33')](_0x4800dd[_0x8382('0x32')]);_0x271b66['filters']=_[_0x8382('0x35')](_0x271b66[_0x8382('0x31')],_0x271b66[_0x8382('0x32')]);_0x1031d9[_0x8382('0x36')]=_[_0x8382('0x35')](_0x271b66[_0x8382('0x31')],qs[_0x8382('0x37')](_0x4800dd[_0x8382('0x32')][_0x8382('0x37')]));_0x1031d9['attributes']=_0x1031d9[_0x8382('0x36')][_0x8382('0x38')]?_0x1031d9['attributes']:_0x271b66[_0x8382('0x31')];if(!_0x4800dd[_0x8382('0x32')][_0x8382('0x59')](_0x8382('0x5a'))){_0x1031d9['limit']=qs[_0x8382('0x1e')](_0x4800dd[_0x8382('0x32')][_0x8382('0x1e')]);_0x1031d9['offset']=qs[_0x8382('0x1d')](_0x4800dd['query'][_0x8382('0x1d')]);}_0x1031d9[_0x8382('0x5b')]=qs['sort'](_0x4800dd[_0x8382('0x32')]['sort']);_0x1031d9[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x4800dd['query'],_0x271b66[_0x8382('0x34')]));_0x1031d9['where'][_0x8382('0x5c')]=_0x182fd1['id'];if(_0x4800dd[_0x8382('0x32')]['filter']){_0x1031d9[_0x8382('0x39')]=_[_0x8382('0x3c')](_0x1031d9[_0x8382('0x39')],{'$or':_[_0x8382('0x2d')](_0x1031d9['attributes'],function(_0x5933a6){var _0x10e101={};_0x10e101[_0x5933a6]={'$like':'%'+_0x4800dd[_0x8382('0x32')]['filter']+'%'};return _0x10e101;})});}_0x1031d9=_[_0x8382('0x3c')]({},_0x1031d9,_0x4800dd['options']);return db[_0x8382('0x58')][_0x8382('0x3e')]({'where':_0x1031d9['where']})[_0x8382('0x26')](function(_0x54b693){_0x3de4ad[_0x8382('0x3e')]=_0x54b693;if(_0x4800dd[_0x8382('0x32')][_0x8382('0x3f')]){_0x1031d9['include']=[{'all':!![]}];}return db[_0x8382('0x58')]['findAll'](_0x1031d9);})[_0x8382('0x26')](function(_0x14580b){_0x3de4ad['rows']=_0x14580b;return _0x3de4ad;});}})['then'](respondWithFilteredResult(_0x44e678,_0x1031d9))['catch'](handleError(_0x44e678,null));};exports[_0x8382('0x5d')]=function(_0x1e396e,_0x1d8ef2,_0x325f20){var _0x386fee={'raw':!![],'where':{}};var _0x4e69ed={};var _0x757852={'count':0x0,'rows':[]};return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x1e396e[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x1d8ef2,null))[_0x8382('0x26')](function(_0x12aea1){if(_0x12aea1){_0x4e69ed[_0x8382('0x31')]=_['keys'](db[_0x8382('0x5e')][_0x8382('0x44')]);_0x4e69ed[_0x8382('0x32')]=_[_0x8382('0x33')](_0x1e396e[_0x8382('0x32')]);_0x4e69ed[_0x8382('0x34')]=_[_0x8382('0x35')](_0x4e69ed[_0x8382('0x31')],_0x4e69ed[_0x8382('0x32')]);_0x386fee[_0x8382('0x36')]=_[_0x8382('0x35')](_0x4e69ed[_0x8382('0x31')],qs[_0x8382('0x37')](_0x1e396e[_0x8382('0x32')][_0x8382('0x37')]));_0x386fee[_0x8382('0x36')]=_0x386fee[_0x8382('0x36')]['length']?_0x386fee[_0x8382('0x36')]:_0x4e69ed[_0x8382('0x31')];if(!_0x1e396e[_0x8382('0x32')]['hasOwnProperty'](_0x8382('0x5a'))){_0x386fee[_0x8382('0x1e')]=qs['limit'](_0x1e396e[_0x8382('0x32')][_0x8382('0x1e')]);_0x386fee[_0x8382('0x1d')]=qs[_0x8382('0x1d')](_0x1e396e['query'][_0x8382('0x1d')]);}_0x386fee[_0x8382('0x5b')]=qs[_0x8382('0x5f')](_0x1e396e['query'][_0x8382('0x5f')]);_0x386fee[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x1e396e[_0x8382('0x32')],_0x4e69ed['filters']));_0x386fee[_0x8382('0x39')]['CampaignId']=_0x12aea1['id'];if(_0x1e396e[_0x8382('0x32')][_0x8382('0x3b')]){_0x386fee[_0x8382('0x39')]=_['merge'](_0x386fee[_0x8382('0x39')],{'$or':_[_0x8382('0x2d')](_0x386fee[_0x8382('0x36')],function(_0x21ca0b){var _0x428fca={};_0x428fca[_0x21ca0b]={'$like':'%'+_0x1e396e[_0x8382('0x32')]['filter']+'%'};return _0x428fca;})});}_0x386fee=_[_0x8382('0x3c')]({},_0x386fee,_0x1e396e['options']);return db['CmHopperHistory'][_0x8382('0x3e')]({'where':_0x386fee[_0x8382('0x39')]})['then'](function(_0x5347c1){_0x757852[_0x8382('0x3e')]=_0x5347c1;if(_0x1e396e[_0x8382('0x32')][_0x8382('0x3f')]){_0x386fee[_0x8382('0x40')]=[{'all':!![]}];}return db[_0x8382('0x5e')]['findAll'](_0x386fee);})[_0x8382('0x26')](function(_0x103101){_0x757852[_0x8382('0x42')]=_0x103101;return _0x757852;});}})[_0x8382('0x26')](respondWithFilteredResult(_0x1d8ef2,_0x386fee))[_0x8382('0x46')](handleError(_0x1d8ef2,null));};exports[_0x8382('0x60')]=function(_0x96cbe3,_0x136281,_0x1bbd81){var _0x5d650e={'raw':!![],'where':{}};var _0x27b351={};var _0x2bfec2={'count':0x0,'rows':[]};return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x96cbe3[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x136281,null))['then'](function(_0x2a1419){if(_0x2a1419){_0x27b351['model']=_['keys'](db[_0x8382('0x61')][_0x8382('0x44')]);_0x27b351[_0x8382('0x32')]=_['keys'](_0x96cbe3[_0x8382('0x32')]);_0x27b351[_0x8382('0x34')]=_['intersection'](_0x27b351['model'],_0x27b351[_0x8382('0x32')]);_0x5d650e['attributes']=_['intersection'](_0x27b351[_0x8382('0x31')],qs[_0x8382('0x37')](_0x96cbe3[_0x8382('0x32')][_0x8382('0x37')]));_0x5d650e[_0x8382('0x36')]=_0x5d650e['attributes'][_0x8382('0x38')]?_0x5d650e['attributes']:_0x27b351[_0x8382('0x31')];if(!_0x96cbe3[_0x8382('0x32')][_0x8382('0x59')]('nolimit')){_0x5d650e['limit']=qs['limit'](_0x96cbe3[_0x8382('0x32')][_0x8382('0x1e')]);_0x5d650e[_0x8382('0x1d')]=qs[_0x8382('0x1d')](_0x96cbe3[_0x8382('0x32')][_0x8382('0x1d')]);}_0x5d650e['order']=qs[_0x8382('0x5f')](_0x96cbe3['query'][_0x8382('0x5f')]);_0x5d650e[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x96cbe3[_0x8382('0x32')],_0x27b351[_0x8382('0x34')]));_0x5d650e[_0x8382('0x39')][_0x8382('0x5c')]=_0x2a1419['id'];if(_0x96cbe3[_0x8382('0x32')]['filter']){_0x5d650e[_0x8382('0x39')]=_[_0x8382('0x3c')](_0x5d650e[_0x8382('0x39')],{'$or':_[_0x8382('0x2d')](_0x5d650e[_0x8382('0x36')],function(_0x5b7322){var _0xd464d2={};_0xd464d2[_0x5b7322]={'$like':'%'+_0x96cbe3[_0x8382('0x32')][_0x8382('0x3b')]+'%'};return _0xd464d2;})});}_0x5d650e=_[_0x8382('0x3c')]({},_0x5d650e,_0x96cbe3[_0x8382('0x3d')]);return db[_0x8382('0x61')]['count']({'where':_0x5d650e['where']})[_0x8382('0x26')](function(_0x10e7fa){_0x2bfec2[_0x8382('0x3e')]=_0x10e7fa;if(_0x96cbe3[_0x8382('0x32')][_0x8382('0x3f')]){_0x5d650e[_0x8382('0x40')]=[{'all':!![]}];}return db[_0x8382('0x61')][_0x8382('0x41')](_0x5d650e);})[_0x8382('0x26')](function(_0x42bc94){_0x2bfec2[_0x8382('0x42')]=_0x42bc94;return _0x2bfec2;});}})[_0x8382('0x26')](respondWithFilteredResult(_0x136281,_0x5d650e))['catch'](handleError(_0x136281,null));};exports[_0x8382('0x62')]=function(_0x310deb,_0x4f3929,_0x1911f4){var _0xb599c7={'raw':!![],'where':{}};var _0x20ca7e={};var _0x154773={'count':0x0,'rows':[]};return db['Campaign'][_0x8382('0x57')]({'where':{'id':_0x310deb[_0x8382('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4f3929,null))[_0x8382('0x26')](function(_0x357846){if(_0x357846){_0x20ca7e[_0x8382('0x31')]=_['keys'](db['CmHopperBlack'][_0x8382('0x44')]);_0x20ca7e[_0x8382('0x32')]=_['keys'](_0x310deb[_0x8382('0x32')]);_0x20ca7e[_0x8382('0x34')]=_[_0x8382('0x35')](_0x20ca7e[_0x8382('0x31')],_0x20ca7e[_0x8382('0x32')]);_0xb599c7[_0x8382('0x36')]=_[_0x8382('0x35')](_0x20ca7e['model'],qs[_0x8382('0x37')](_0x310deb['query'][_0x8382('0x37')]));_0xb599c7[_0x8382('0x36')]=_0xb599c7['attributes'][_0x8382('0x38')]?_0xb599c7[_0x8382('0x36')]:_0x20ca7e[_0x8382('0x31')];if(!_0x310deb[_0x8382('0x32')][_0x8382('0x59')](_0x8382('0x5a'))){_0xb599c7[_0x8382('0x1e')]=qs[_0x8382('0x1e')](_0x310deb['query']['limit']);_0xb599c7[_0x8382('0x1d')]=qs['offset'](_0x310deb[_0x8382('0x32')]['offset']);}_0xb599c7[_0x8382('0x5b')]=qs['sort'](_0x310deb['query']['sort']);_0xb599c7[_0x8382('0x39')]=qs[_0x8382('0x34')](_['pick'](_0x310deb[_0x8382('0x32')],_0x20ca7e[_0x8382('0x34')]));_0xb599c7['where'][_0x8382('0x5c')]=_0x357846['id'];if(_0x310deb['query'][_0x8382('0x3b')]){_0xb599c7[_0x8382('0x39')]=_[_0x8382('0x3c')](_0xb599c7['where'],{'$or':_['map'](_0xb599c7[_0x8382('0x36')],function(_0x4c0a9a){var _0x2dd58c={};_0x2dd58c[_0x4c0a9a]={'$like':'%'+_0x310deb[_0x8382('0x32')][_0x8382('0x3b')]+'%'};return _0x2dd58c;})});}_0xb599c7=_[_0x8382('0x3c')]({},_0xb599c7,_0x310deb['options']);return db[_0x8382('0x63')][_0x8382('0x3e')]({'where':_0xb599c7[_0x8382('0x39')]})[_0x8382('0x26')](function(_0x1edd02){_0x154773[_0x8382('0x3e')]=_0x1edd02;if(_0x310deb[_0x8382('0x32')]['includeAll']){_0xb599c7[_0x8382('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x8382('0x41')](_0xb599c7);})[_0x8382('0x26')](function(_0x56b672){_0x154773['rows']=_0x56b672;return _0x154773;});}})['then'](respondWithFilteredResult(_0x4f3929,_0xb599c7))[_0x8382('0x46')](handleError(_0x4f3929,null));};exports[_0x8382('0x64')]=function(_0x4ff59b,_0x3239d4,_0x426775){var _0x314bc5={};var _0x4cdc4d={};var _0x207dac;var _0x16d360;return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x4ff59b[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x3239d4,null))['then'](function(_0x39dd09){if(_0x39dd09){_0x207dac=_0x39dd09;_0x4cdc4d[_0x8382('0x31')]=_['keys'](db[_0x8382('0x65')]['rawAttributes']);_0x4cdc4d[_0x8382('0x32')]=_[_0x8382('0x33')](_0x4ff59b['query']);_0x4cdc4d['filters']=_[_0x8382('0x35')](_0x4cdc4d[_0x8382('0x31')],_0x4cdc4d['query']);_0x314bc5[_0x8382('0x36')]=_[_0x8382('0x35')](_0x4cdc4d['model'],qs[_0x8382('0x37')](_0x4ff59b[_0x8382('0x32')][_0x8382('0x37')]));_0x314bc5['attributes']=_0x314bc5[_0x8382('0x36')][_0x8382('0x38')]?_0x314bc5[_0x8382('0x36')]:_0x4cdc4d[_0x8382('0x31')];_0x314bc5[_0x8382('0x5b')]=qs[_0x8382('0x5f')](_0x4ff59b[_0x8382('0x32')][_0x8382('0x5f')]);_0x314bc5[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x4ff59b[_0x8382('0x32')],_0x4cdc4d[_0x8382('0x34')]));if(_0x4ff59b[_0x8382('0x32')][_0x8382('0x3b')]){_0x314bc5[_0x8382('0x39')]=_[_0x8382('0x3c')](_0x314bc5[_0x8382('0x39')],{'$or':_['map'](_0x314bc5[_0x8382('0x36')],function(_0x181e2a){var _0x255bce={};_0x255bce[_0x181e2a]={'$like':'%'+_0x4ff59b[_0x8382('0x32')][_0x8382('0x3b')]+'%'};return _0x255bce;})});}_0x314bc5=_[_0x8382('0x3c')]({},_0x314bc5,_0x4ff59b[_0x8382('0x3d')]);return _0x207dac[_0x8382('0x64')](_0x314bc5);}})[_0x8382('0x26')](function(_0x2526e7){if(_0x2526e7){_0x16d360=_0x2526e7[_0x8382('0x38')];if(!_0x4ff59b[_0x8382('0x32')][_0x8382('0x59')](_0x8382('0x5a'))){_0x314bc5[_0x8382('0x1e')]=qs[_0x8382('0x1e')](_0x4ff59b[_0x8382('0x32')][_0x8382('0x1e')]);_0x314bc5[_0x8382('0x1d')]=qs['offset'](_0x4ff59b[_0x8382('0x32')][_0x8382('0x1d')]);}return _0x207dac[_0x8382('0x64')](_0x314bc5);}})[_0x8382('0x26')](function(_0x2b6c95){if(_0x2b6c95){return _0x2b6c95?{'count':_0x16d360,'rows':_0x2b6c95}:null;}})[_0x8382('0x26')](respondWithResult(_0x3239d4,null))[_0x8382('0x46')](handleError(_0x3239d4,null));};exports[_0x8382('0x66')]=function(_0x458ee,_0x53be6e,_0x254096){var _0x84b1f3,_0x463fe5;return db[_0x8382('0x2e')][_0x8382('0x45')]({'where':{'id':_0x458ee['params']['id']}})['then'](handleEntityNotFound(_0x53be6e,null))[_0x8382('0x26')](function(_0x27b2eb){if(_0x27b2eb){_0x463fe5=_0x27b2eb;return _0x27b2eb['addLists'](_0x458ee['body'][_0x8382('0x67')],_[_0x8382('0x50')](_0x458ee[_0x8382('0x48')],['ids','id'])||{});}return null;})[_0x8382('0x68')](function(_0x4d04c7){var _0x12f4eb;_0x84b1f3=_0x4d04c7||[];var _0x189de7=[];if(_0x4d04c7){for(var _0x37462e=0x0;_0x37462e<_0x4d04c7[_0x8382('0x38')];_0x37462e+=0x1){var _0x752986=_0x4d04c7[_0x37462e][_0x8382('0x4b')]({'plain':!![]});_0x463fe5['dialCheckDuplicateType']=_0x458ee['body'][_0x8382('0x69')]?_0x458ee[_0x8382('0x48')][_0x8382('0x69')]:_0x463fe5['dialCheckDuplicateType'];switch(_0x463fe5[_0x8382('0x69')]){case _0x8382('0x6a'):_0x12f4eb=squel[_0x8382('0x6b')]()[_0x8382('0x6c')](_0x8382('0x6d'))[_0x8382('0x6e')](['phone',_0x8382('0x6f'),_0x8382('0x70'),'ListId',_0x8382('0x5c'),_0x8382('0x51'),_0x8382('0x52')],squel['select']()['field'](_0x8382('0x71'),_0x8382('0x71'))[_0x8382('0x72')](_0x8382('0x73'),'scheduledAt')[_0x8382('0x72')]('id',_0x8382('0x70'))[_0x8382('0x72')](_0x752986[_0x8382('0x74')]['toString'](),'ListId')[_0x8382('0x72')](_0x458ee[_0x8382('0x4f')]['id'][_0x8382('0x75')](),_0x8382('0x5c'))[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x51'))[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x52'))[_0x8382('0x76')](_0x8382('0x77'))['where'](_0x8382('0x78'))['where'](_0x8382('0x79'),_0x752986[_0x8382('0x74')][_0x8382('0x75')]())['where'](_0x8382('0x7a'))['where'](_0x8382('0x7b'),squel[_0x8382('0x7c')]()[_0x8382('0x72')](_0x8382('0x7d'))[_0x8382('0x76')](_0x8382('0x7e'))[_0x8382('0x39')](_0x8382('0x7f'),_0x458ee['params']['id'][_0x8382('0x75')]()))[_0x8382('0x39')](_0x8382('0x7b'),squel['select']()['field'](_0x8382('0x80'))[_0x8382('0x76')](_0x8382('0x6d'))['where'](_0x8382('0x7f'),_0x458ee['params']['id'][_0x8382('0x75')]())))['toString']();break;case _0x8382('0x81'):_0x12f4eb=squel['insert']()['into'](_0x8382('0x6d'))[_0x8382('0x6e')]([_0x8382('0x71'),_0x8382('0x6f'),'ContactId',_0x8382('0x82'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x8382('0x72')](_0x8382('0x71'),'phone')['field'](_0x8382('0x73'),_0x8382('0x6f'))[_0x8382('0x72')]('id',_0x8382('0x70'))['field'](_0x752986[_0x8382('0x74')]['toString'](),_0x8382('0x82'))[_0x8382('0x72')](_0x458ee['params']['id'][_0x8382('0x75')](),_0x8382('0x5c'))[_0x8382('0x72')]('NOW()',_0x8382('0x51'))[_0x8382('0x72')]('NOW()',_0x8382('0x52'))[_0x8382('0x76')](_0x8382('0x77'))[_0x8382('0x39')](_0x8382('0x78'))[_0x8382('0x39')](_0x8382('0x79'),_0x752986[_0x8382('0x74')]['toString']())[_0x8382('0x39')](_0x8382('0x7a'))[_0x8382('0x39')](_0x8382('0x7b'),squel[_0x8382('0x7c')]()[_0x8382('0x72')](_0x8382('0x80'))[_0x8382('0x76')](_0x8382('0x6d'))[_0x8382('0x39')](_0x8382('0x7f'),_0x458ee[_0x8382('0x4f')]['id'][_0x8382('0x75')]())))[_0x8382('0x75')]();break;default:_0x12f4eb=squel['insert']()[_0x8382('0x6c')]('cm_hopper')[_0x8382('0x6e')]([_0x8382('0x71'),_0x8382('0x6f'),_0x8382('0x70'),_0x8382('0x82'),_0x8382('0x5c'),_0x8382('0x51'),_0x8382('0x52')],squel[_0x8382('0x7c')]()[_0x8382('0x72')](_0x8382('0x71'),'phone')['field']('NOW()',_0x8382('0x6f'))[_0x8382('0x72')]('id',_0x8382('0x70'))[_0x8382('0x72')](_0x752986[_0x8382('0x74')][_0x8382('0x75')](),_0x8382('0x82'))[_0x8382('0x72')](_0x458ee[_0x8382('0x4f')]['id'][_0x8382('0x75')](),_0x8382('0x5c'))[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x51'))['field'](_0x8382('0x73'),_0x8382('0x52'))[_0x8382('0x76')](_0x8382('0x77'))[_0x8382('0x39')](_0x8382('0x78'))['where'](_0x8382('0x79'),_0x752986[_0x8382('0x74')][_0x8382('0x75')]())[_0x8382('0x39')](_0x8382('0x7a')))[_0x8382('0x75')]();}_0x189de7[_0x8382('0x83')](db[_0x8382('0x84')][_0x8382('0x32')](_0x12f4eb));}return BPromise['all'](_0x189de7);}})[_0x8382('0x26')](function(){return _0x84b1f3;})[_0x8382('0x26')](respondWithResult(_0x53be6e,null))[_0x8382('0x46')](handleError(_0x53be6e,null));};exports[_0x8382('0x85')]=function(_0x4e1411,_0x384c27,_0x4bf422){return db[_0x8382('0x2e')][_0x8382('0x45')]({'where':{'id':_0x4e1411[_0x8382('0x4f')]['id']}})['then'](handleEntityNotFound(_0x384c27,null))[_0x8382('0x26')](function(_0x35ff56){if(_0x35ff56){return _0x35ff56[_0x8382('0x85')](_0x4e1411[_0x8382('0x32')][_0x8382('0x67')]);}})[_0x8382('0x26')](function(_0x345030){if(_0x345030){return db[_0x8382('0x58')][_0x8382('0x27')]({'where':{'ListId':_0x4e1411[_0x8382('0x32')][_0x8382('0x67')],'CampaignId':_0x4e1411[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](function(){return _0x345030;});}})['then'](respondWithStatusCode(_0x384c27,null))[_0x8382('0x46')](handleError(_0x384c27,null));};exports[_0x8382('0x86')]=function(_0x23fec9,_0x46e9f7,_0x1cd6e0){var _0x1a8be6={};var _0x458b5b={};var _0x10f00e;var _0x5ec246;return db[_0x8382('0x2e')][_0x8382('0x57')]({'where':{'id':_0x23fec9[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x46e9f7,null))[_0x8382('0x26')](function(_0x10e6df){if(_0x10e6df){_0x10f00e=_0x10e6df;_0x458b5b[_0x8382('0x31')]=_[_0x8382('0x33')](db[_0x8382('0x65')][_0x8382('0x44')]);_0x458b5b[_0x8382('0x32')]=_[_0x8382('0x33')](_0x23fec9[_0x8382('0x32')]);_0x458b5b[_0x8382('0x34')]=_[_0x8382('0x35')](_0x458b5b[_0x8382('0x31')],_0x458b5b[_0x8382('0x32')]);_0x1a8be6[_0x8382('0x36')]=_[_0x8382('0x35')](_0x458b5b[_0x8382('0x31')],qs[_0x8382('0x37')](_0x23fec9[_0x8382('0x32')][_0x8382('0x37')]));_0x1a8be6[_0x8382('0x36')]=_0x1a8be6[_0x8382('0x36')][_0x8382('0x38')]?_0x1a8be6[_0x8382('0x36')]:_0x458b5b[_0x8382('0x31')];_0x1a8be6[_0x8382('0x5b')]=qs[_0x8382('0x5f')](_0x23fec9[_0x8382('0x32')][_0x8382('0x5f')]);_0x1a8be6[_0x8382('0x39')]=qs[_0x8382('0x34')](_[_0x8382('0x3a')](_0x23fec9[_0x8382('0x32')],_0x458b5b[_0x8382('0x34')]));if(_0x23fec9[_0x8382('0x32')][_0x8382('0x3b')]){_0x1a8be6[_0x8382('0x39')]=_['merge'](_0x1a8be6['where'],{'$or':_[_0x8382('0x2d')](_0x1a8be6[_0x8382('0x36')],function(_0x26d2e9){var _0xeeee20={};_0xeeee20[_0x26d2e9]={'$like':'%'+_0x23fec9['query'][_0x8382('0x3b')]+'%'};return _0xeeee20;})});}_0x1a8be6=_[_0x8382('0x3c')]({},_0x1a8be6,_0x23fec9[_0x8382('0x3d')]);return _0x10f00e[_0x8382('0x86')](_0x1a8be6);}})[_0x8382('0x26')](function(_0x5b9084){if(_0x5b9084){_0x5ec246=_0x5b9084[_0x8382('0x38')];if(!_0x23fec9[_0x8382('0x32')][_0x8382('0x59')]('nolimit')){_0x1a8be6['limit']=qs[_0x8382('0x1e')](_0x23fec9[_0x8382('0x32')][_0x8382('0x1e')]);_0x1a8be6[_0x8382('0x1d')]=qs['offset'](_0x23fec9['query'][_0x8382('0x1d')]);}return _0x10f00e['getBlackLists'](_0x1a8be6);}})[_0x8382('0x26')](function(_0x43472a){if(_0x43472a){return _0x43472a?{'count':_0x5ec246,'rows':_0x43472a}:null;}})[_0x8382('0x26')](respondWithResult(_0x46e9f7,null))[_0x8382('0x46')](handleError(_0x46e9f7,null));};exports[_0x8382('0x87')]=function(_0x163f47,_0x5f27f2,_0x480cd3){var _0x2902dc,_0x1ac4cd;return db[_0x8382('0x2e')]['find']({'where':{'id':_0x163f47[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x5f27f2,null))['then'](function(_0x46d74d){if(_0x46d74d){_0x1ac4cd=_0x46d74d;return _0x46d74d[_0x8382('0x87')](_0x163f47[_0x8382('0x48')][_0x8382('0x67')],_['omit'](_0x163f47['body'],[_0x8382('0x67'),'id'])||{});}return null;})[_0x8382('0x68')](function(_0xf29451){var _0x1f89f5;_0x2902dc=_0xf29451||[];var _0x3ded7a=[];if(_0xf29451){for(var _0x504786=0x0;_0x504786<_0xf29451[_0x8382('0x38')];_0x504786+=0x1){var _0x2db5b3=_0xf29451[_0x504786][_0x8382('0x4b')]({'plain':!![]});_0x1f89f5=squel[_0x8382('0x6b')]()[_0x8382('0x6c')](_0x8382('0x88'))[_0x8382('0x6e')]([_0x8382('0x71'),'ContactId',_0x8382('0x82'),'CampaignId','createdAt',_0x8382('0x52')],squel[_0x8382('0x7c')]()[_0x8382('0x72')](_0x8382('0x71'),_0x8382('0x71'))[_0x8382('0x72')]('id',_0x8382('0x70'))['field'](_0x2db5b3[_0x8382('0x74')]['toString'](),'ListId')['field'](_0x163f47[_0x8382('0x4f')]['id']['toString'](),'CampaignId')[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x51'))[_0x8382('0x72')](_0x8382('0x73'),_0x8382('0x52'))[_0x8382('0x76')](_0x8382('0x77'))[_0x8382('0x39')](_0x8382('0x78'))[_0x8382('0x39')](_0x8382('0x79'),_0x2db5b3['CmListId'][_0x8382('0x75')]())['where'](_0x8382('0x7a')))[_0x8382('0x75')]();_0x3ded7a[_0x8382('0x83')](db[_0x8382('0x84')][_0x8382('0x32')](_0x1f89f5));}return BPromise[_0x8382('0x89')](_0x3ded7a);}})[_0x8382('0x26')](function(){return _0x2902dc;})[_0x8382('0x26')](respondWithResult(_0x5f27f2,null))[_0x8382('0x46')](handleError(_0x5f27f2,null));};exports[_0x8382('0x8a')]=function(_0x5e7e3a,_0x50bb8c,_0x41f569){return db[_0x8382('0x2e')]['find']({'where':{'id':_0x5e7e3a[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](handleEntityNotFound(_0x50bb8c,null))[_0x8382('0x26')](function(_0x3f741c){if(_0x3f741c){return _0x3f741c[_0x8382('0x8a')](_0x5e7e3a[_0x8382('0x32')][_0x8382('0x67')]);}})[_0x8382('0x26')](function(_0x53bd78){if(_0x53bd78){return db[_0x8382('0x63')][_0x8382('0x27')]({'where':{'ListId':_0x5e7e3a[_0x8382('0x32')][_0x8382('0x67')],'CampaignId':_0x5e7e3a[_0x8382('0x4f')]['id']}})[_0x8382('0x26')](function(){return _0x53bd78;});}})['then'](respondWithStatusCode(_0x50bb8c,null))['catch'](handleError(_0x50bb8c,null));}; \ No newline at end of file +var _0xe2c5=['filters','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','Campaign','includeAll','include','findAll','rows','catch','show','params','intersection','merge','options','find','create','body','user','role','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','nolimit','getHopperHistories','length','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xe2c5,0x172));var _0x5e2c=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0xe2c5[_0x3e91a9];return _0x25c9ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e2c('0x0'));var zipdir=require(_0x5e2c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e2c('0x2'));var moment=require(_0x5e2c('0x3'));var BPromise=require(_0x5e2c('0x4'));var Mustache=require('mustache');var util=require(_0x5e2c('0x5'));var path=require(_0x5e2c('0x6'));var sox=require(_0x5e2c('0x7'));var csv=require(_0x5e2c('0x8'));var ejs=require(_0x5e2c('0x9'));var fs=require('fs');var fs_extra=require(_0x5e2c('0xa'));var _=require(_0x5e2c('0xb'));var squel=require(_0x5e2c('0xc'));var crypto=require('crypto');var jsforce=require(_0x5e2c('0xd'));var deskjs=require(_0x5e2c('0xe'));var toCsv=require(_0x5e2c('0x8'));var querystring=require('querystring');var Papa=require(_0x5e2c('0xf'));var Redis=require(_0x5e2c('0x10'));var authService=require(_0x5e2c('0x11'));var qs=require(_0x5e2c('0x12'));var as=require(_0x5e2c('0x13'));var hardwareService=require(_0x5e2c('0x14'));var logger=require(_0x5e2c('0x15'))(_0x5e2c('0x16'));var utils=require('../../config/utils');var config=require(_0x5e2c('0x17'));var licenseUtil=require(_0x5e2c('0x18'));var db=require(_0x5e2c('0x19'))['db'];function respondWithStatusCode(_0x527e43,_0x40f8e1){_0x40f8e1=_0x40f8e1||0xcc;return function(_0x3d7d96){if(_0x3d7d96){return _0x527e43['sendStatus'](_0x40f8e1);}return _0x527e43[_0x5e2c('0x1a')](_0x40f8e1)[_0x5e2c('0x1b')]();};}function respondWithResult(_0x28ed2f,_0x70f099){_0x70f099=_0x70f099||0xc8;return function(_0x44367c){if(_0x44367c){return _0x28ed2f['status'](_0x70f099)[_0x5e2c('0x1c')](_0x44367c);}};}function respondWithFilteredResult(_0x4a775a,_0x7af38f){return function(_0x264712){if(_0x264712){var _0x59dd47=typeof _0x7af38f[_0x5e2c('0x1d')]===_0x5e2c('0x1e')&&typeof _0x7af38f[_0x5e2c('0x1f')]===_0x5e2c('0x1e');var _0x346b6a=_0x264712[_0x5e2c('0x20')];var _0xa87ed4=_0x59dd47?0x0:_0x7af38f[_0x5e2c('0x1d')];var _0x3d0da7=_0x59dd47?_0x264712['count']:_0x7af38f['offset']+_0x7af38f[_0x5e2c('0x1f')];var _0x2985c9;if(_0x3d0da7>=_0x346b6a){_0x3d0da7=_0x346b6a;_0x2985c9=0xc8;}else{_0x2985c9=0xce;}_0x4a775a[_0x5e2c('0x1a')](_0x2985c9);return _0x4a775a['set'](_0x5e2c('0x21'),_0xa87ed4+'-'+_0x3d0da7+'/'+_0x346b6a)[_0x5e2c('0x1c')](_0x264712);}return null;};}function patchUpdates(_0x143e65){return function(_0x53c814){try{jsonpatch[_0x5e2c('0x22')](_0x53c814,_0x143e65,!![]);}catch(_0x570e20){return BPromise[_0x5e2c('0x23')](_0x570e20);}return _0x53c814[_0x5e2c('0x24')]();};}function saveUpdates(_0x40eb2c,_0x27e779){return function(_0x331abe){if(_0x331abe){return _0x331abe[_0x5e2c('0x25')](_0x40eb2c)[_0x5e2c('0x26')](function(_0x227b76){return _0x227b76;});}return null;};}function removeEntity(_0x8ad061,_0x5aae69){return function(_0x376d84){if(_0x376d84){return _0x376d84['destroy']()[_0x5e2c('0x26')](function(){var _0x45112d=_0x376d84[_0x5e2c('0x27')]({'plain':!![]});var _0x1e5477=_0x5e2c('0x28');return db[_0x5e2c('0x29')][_0x5e2c('0x2a')]({'where':{'type':_0x1e5477,'resourceId':_0x45112d['id']}})[_0x5e2c('0x26')](function(){return _0x376d84;});})[_0x5e2c('0x26')](function(){_0x8ad061[_0x5e2c('0x1a')](0xcc)[_0x5e2c('0x1b')]();});}};}function handleEntityNotFound(_0x1c27cd,_0x3ca699){return function(_0x152cf2){if(!_0x152cf2){_0x1c27cd[_0x5e2c('0x2b')](0x194);}return _0x152cf2;};}function handleError(_0x1a5ed1,_0x440503){_0x440503=_0x440503||0x1f4;return function(_0xba82f0){logger[_0x5e2c('0x2c')](_0xba82f0[_0x5e2c('0x2d')]);if(_0xba82f0[_0x5e2c('0x2e')]){delete _0xba82f0[_0x5e2c('0x2e')];}_0x1a5ed1['status'](_0x440503)[_0x5e2c('0x2f')](_0xba82f0);};}exports[_0x5e2c('0x30')]=function(_0x14c6d2,_0x50bf19){var _0xf1341c={},_0x41330d={},_0x32ccc1={'count':0x0,'rows':[]};var _0x2ba4d3=_['map'](db['Campaign'][_0x5e2c('0x31')],function(_0x5f0785){return{'name':_0x5f0785[_0x5e2c('0x32')],'type':_0x5f0785[_0x5e2c('0x33')][_0x5e2c('0x34')]};});_0x41330d['model']=_[_0x5e2c('0x35')](_0x2ba4d3,_0x5e2c('0x2e'));_0x41330d[_0x5e2c('0x36')]=_[_0x5e2c('0x37')](_0x14c6d2[_0x5e2c('0x36')]);_0x41330d[_0x5e2c('0x38')]=_['intersection'](_0x41330d[_0x5e2c('0x39')],_0x41330d[_0x5e2c('0x36')]);_0xf1341c[_0x5e2c('0x3a')]=_['intersection'](_0x41330d[_0x5e2c('0x39')],qs[_0x5e2c('0x3b')](_0x14c6d2['query'][_0x5e2c('0x3b')]));_0xf1341c[_0x5e2c('0x3a')]=_0xf1341c[_0x5e2c('0x3a')]['length']?_0xf1341c[_0x5e2c('0x3a')]:_0x41330d['model'];if(!_0x14c6d2['query'][_0x5e2c('0x3c')]('nolimit')){_0xf1341c[_0x5e2c('0x1f')]=qs[_0x5e2c('0x1f')](_0x14c6d2[_0x5e2c('0x36')][_0x5e2c('0x1f')]);_0xf1341c[_0x5e2c('0x1d')]=qs['offset'](_0x14c6d2[_0x5e2c('0x36')]['offset']);}_0xf1341c[_0x5e2c('0x3d')]=qs[_0x5e2c('0x3e')](_0x14c6d2[_0x5e2c('0x36')][_0x5e2c('0x3e')]);_0xf1341c[_0x5e2c('0x3f')]=qs['filters'](_[_0x5e2c('0x40')](_0x14c6d2[_0x5e2c('0x36')],_0x41330d['filters']),_0x2ba4d3);if(_0x14c6d2[_0x5e2c('0x36')][_0x5e2c('0x41')]){_0xf1341c[_0x5e2c('0x3f')]=_['merge'](_0xf1341c[_0x5e2c('0x3f')],{'$or':_['map'](_0x2ba4d3,function(_0x5026ff){if(_0x5026ff[_0x5e2c('0x33')]!==_0x5e2c('0x42')){var _0x47e13e={};_0x47e13e[_0x5026ff[_0x5e2c('0x2e')]]={'$like':'%'+_0x14c6d2[_0x5e2c('0x36')][_0x5e2c('0x41')]+'%'};return _0x47e13e;}})});}_0xf1341c=_['merge']({},_0xf1341c,_0x14c6d2['options']);var _0x5e1aca={'where':_0xf1341c[_0x5e2c('0x3f')]};return db[_0x5e2c('0x43')][_0x5e2c('0x20')](_0x5e1aca)[_0x5e2c('0x26')](function(_0x1478e9){_0x32ccc1[_0x5e2c('0x20')]=_0x1478e9;if(_0x14c6d2[_0x5e2c('0x36')][_0x5e2c('0x44')]){_0xf1341c[_0x5e2c('0x45')]=[{'all':!![]}];}return db[_0x5e2c('0x43')][_0x5e2c('0x46')](_0xf1341c);})[_0x5e2c('0x26')](function(_0x3f4864){_0x32ccc1[_0x5e2c('0x47')]=_0x3f4864;return _0x32ccc1;})[_0x5e2c('0x26')](respondWithFilteredResult(_0x50bf19,_0xf1341c))[_0x5e2c('0x48')](handleError(_0x50bf19,null));};exports[_0x5e2c('0x49')]=function(_0x37193a,_0x4f5ab9){var _0x1ce627={'raw':![],'where':{'id':_0x37193a[_0x5e2c('0x4a')]['id']}},_0x586fb5={};_0x586fb5[_0x5e2c('0x39')]=_[_0x5e2c('0x37')](db['Campaign'][_0x5e2c('0x31')]);_0x586fb5['query']=_[_0x5e2c('0x37')](_0x37193a[_0x5e2c('0x36')]);_0x586fb5['filters']=_[_0x5e2c('0x4b')](_0x586fb5[_0x5e2c('0x39')],_0x586fb5['query']);_0x1ce627['attributes']=_[_0x5e2c('0x4b')](_0x586fb5['model'],qs[_0x5e2c('0x3b')](_0x37193a[_0x5e2c('0x36')][_0x5e2c('0x3b')]));_0x1ce627['attributes']=_0x1ce627[_0x5e2c('0x3a')]['length']?_0x1ce627['attributes']:_0x586fb5[_0x5e2c('0x39')];if(_0x37193a[_0x5e2c('0x36')][_0x5e2c('0x44')]){_0x1ce627['include']=[{'all':!![]}];}_0x1ce627=_[_0x5e2c('0x4c')]({},_0x1ce627,_0x37193a[_0x5e2c('0x4d')]);return db[_0x5e2c('0x43')][_0x5e2c('0x4e')](_0x1ce627)[_0x5e2c('0x26')](handleEntityNotFound(_0x4f5ab9,null))[_0x5e2c('0x26')](respondWithResult(_0x4f5ab9,null))[_0x5e2c('0x48')](handleError(_0x4f5ab9,null));};exports['create']=function(_0x51b224,_0x319dd4){return db[_0x5e2c('0x43')][_0x5e2c('0x4f')](_0x51b224[_0x5e2c('0x50')],{})[_0x5e2c('0x26')](function(_0x4722f9){var _0x7927eb=_0x51b224[_0x5e2c('0x51')][_0x5e2c('0x27')]({'plain':!![]});if(!_0x7927eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7927eb[_0x5e2c('0x52')]===_0x5e2c('0x51')){var _0x102593=_0x4722f9[_0x5e2c('0x27')]({'plain':!![]});var _0x59502e='IvrCampaigns';return db[_0x5e2c('0x53')]['find']({'where':{'name':_0x59502e,'userProfileId':_0x7927eb['userProfileId']},'raw':!![]})['then'](function(_0x3e687e){if(_0x3e687e&&_0x3e687e[_0x5e2c('0x54')]===0x0){return db[_0x5e2c('0x29')]['create']({'name':_0x102593[_0x5e2c('0x2e')],'resourceId':_0x102593['id'],'type':_0x3e687e[_0x5e2c('0x2e')],'sectionId':_0x3e687e['id']},{})[_0x5e2c('0x26')](function(){return _0x4722f9;});}else{return _0x4722f9;}})['catch'](function(_0x440210){logger[_0x5e2c('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x440210);throw _0x440210;});}return _0x4722f9;})[_0x5e2c('0x26')](respondWithResult(_0x319dd4,0xc9))[_0x5e2c('0x48')](handleError(_0x319dd4,null));};exports[_0x5e2c('0x55')]=function(_0x35bd55,_0x4b1726){var _0x274d4d={'where':{'id':_0x35bd55[_0x5e2c('0x4a')]['id']}},_0x644170={};_0x644170[_0x5e2c('0x39')]=_[_0x5e2c('0x37')](db[_0x5e2c('0x43')]['rawAttributes']);_0x274d4d[_0x5e2c('0x3a')]=_[_0x5e2c('0x4b')](_0x644170[_0x5e2c('0x39')],qs[_0x5e2c('0x3b')](_0x35bd55[_0x5e2c('0x36')][_0x5e2c('0x3b')]));_0x274d4d[_0x5e2c('0x3a')]=_0x274d4d[_0x5e2c('0x3a')]['length']?_0x274d4d[_0x5e2c('0x3a')]:_0x644170[_0x5e2c('0x39')];if(_0x35bd55['query'][_0x5e2c('0x44')]){_0x274d4d[_0x5e2c('0x45')]=[{'all':!![]}];}_0x274d4d=_[_0x5e2c('0x4c')]({},_0x274d4d,_0x35bd55[_0x5e2c('0x4d')]);return db[_0x5e2c('0x43')][_0x5e2c('0x4e')](_0x274d4d)[_0x5e2c('0x26')](handleEntityNotFound(_0x4b1726,null))[_0x5e2c('0x26')](function(_0x1b900e){if(_0x1b900e){var _0xc78161=_0x1b900e[_0x5e2c('0x27')]({'plain':!![]});_0xc78161=qs[_0x5e2c('0x56')](_0xc78161,['id',_0x5e2c('0x57'),_0x5e2c('0x58')]);_0x35bd55[_0x5e2c('0x50')]=_['omit'](_0x35bd55[_0x5e2c('0x50')],['id',_0x5e2c('0x57'),_0x5e2c('0x58')]);return db[_0x5e2c('0x43')][_0x5e2c('0x4f')](_[_0x5e2c('0x4c')](_0xc78161,_0x35bd55['body']),{'include':_0x35bd55['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x37d706){var _0x56b91d=_0x35bd55[_0x5e2c('0x51')]['get']({'plain':!![]});if(!_0x56b91d)throw new Error(_0x5e2c('0x59'));if(_0x56b91d['role']===_0x5e2c('0x51')){var _0x4a2116=_0x37d706[_0x5e2c('0x27')]({'plain':!![]});var _0x1fc939=_0x5e2c('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fc939,'userProfileId':_0x56b91d[_0x5e2c('0x5a')]},'raw':!![]})['then'](function(_0x1cdcbc){if(_0x1cdcbc&&_0x1cdcbc['autoAssociation']===0x0){return db[_0x5e2c('0x29')][_0x5e2c('0x4f')]({'name':_0x4a2116[_0x5e2c('0x2e')],'resourceId':_0x4a2116['id'],'type':_0x1cdcbc['name'],'sectionId':_0x1cdcbc['id']},{})['then'](function(){return _0x37d706;});}else{return _0x37d706;}})['catch'](function(_0x23a111){logger['error'](_0x5e2c('0x5b'),_0x23a111);throw _0x23a111;});}return _0x37d706;});}})[_0x5e2c('0x26')](respondWithResult(_0x4b1726,0xc9))[_0x5e2c('0x48')](handleError(_0x4b1726,null));};exports[_0x5e2c('0x25')]=function(_0x256534,_0x480502){if(_0x256534[_0x5e2c('0x50')]['id']){delete _0x256534['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x256534[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x480502,null))[_0x5e2c('0x26')](saveUpdates(_0x256534['body'],null))[_0x5e2c('0x26')](respondWithResult(_0x480502,null))[_0x5e2c('0x48')](handleError(_0x480502,null));};exports[_0x5e2c('0x2a')]=function(_0x4be2b7,_0x535795){return db[_0x5e2c('0x43')][_0x5e2c('0x4e')]({'where':{'id':_0x4be2b7[_0x5e2c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x535795,null))[_0x5e2c('0x26')](removeEntity(_0x535795,null))['catch'](handleError(_0x535795,null));};exports[_0x5e2c('0x5c')]=function(_0x353722,_0x56fd0e,_0x1da7e3){var _0x2a9bf6={'raw':!![],'where':{}};var _0x242ea6={};var _0x37b96f={'count':0x0,'rows':[]};return db['Campaign'][_0x5e2c('0x5d')]({'where':{'id':_0x353722[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x56fd0e,null))['then'](function(_0x1bda27){if(_0x1bda27){_0x242ea6[_0x5e2c('0x39')]=_['keys'](db[_0x5e2c('0x5e')][_0x5e2c('0x31')]);_0x242ea6[_0x5e2c('0x36')]=_[_0x5e2c('0x37')](_0x353722[_0x5e2c('0x36')]);_0x242ea6['filters']=_[_0x5e2c('0x4b')](_0x242ea6['model'],_0x242ea6[_0x5e2c('0x36')]);_0x2a9bf6[_0x5e2c('0x3a')]=_[_0x5e2c('0x4b')](_0x242ea6[_0x5e2c('0x39')],qs[_0x5e2c('0x3b')](_0x353722[_0x5e2c('0x36')][_0x5e2c('0x3b')]));_0x2a9bf6[_0x5e2c('0x3a')]=_0x2a9bf6['attributes']['length']?_0x2a9bf6[_0x5e2c('0x3a')]:_0x242ea6[_0x5e2c('0x39')];if(!_0x353722[_0x5e2c('0x36')][_0x5e2c('0x3c')](_0x5e2c('0x5f'))){_0x2a9bf6[_0x5e2c('0x1f')]=qs['limit'](_0x353722[_0x5e2c('0x36')][_0x5e2c('0x1f')]);_0x2a9bf6[_0x5e2c('0x1d')]=qs[_0x5e2c('0x1d')](_0x353722[_0x5e2c('0x36')][_0x5e2c('0x1d')]);}_0x2a9bf6[_0x5e2c('0x3d')]=qs[_0x5e2c('0x3e')](_0x353722['query']['sort']);_0x2a9bf6[_0x5e2c('0x3f')]=qs['filters'](_['pick'](_0x353722[_0x5e2c('0x36')],_0x242ea6['filters']));_0x2a9bf6['where']['CampaignId']=_0x1bda27['id'];if(_0x353722[_0x5e2c('0x36')][_0x5e2c('0x41')]){_0x2a9bf6[_0x5e2c('0x3f')]=_[_0x5e2c('0x4c')](_0x2a9bf6[_0x5e2c('0x3f')],{'$or':_[_0x5e2c('0x35')](_0x2a9bf6[_0x5e2c('0x3a')],function(_0x493084){var _0x429c54={};_0x429c54[_0x493084]={'$like':'%'+_0x353722[_0x5e2c('0x36')][_0x5e2c('0x41')]+'%'};return _0x429c54;})});}_0x2a9bf6=_[_0x5e2c('0x4c')]({},_0x2a9bf6,_0x353722['options']);return db[_0x5e2c('0x5e')][_0x5e2c('0x20')]({'where':_0x2a9bf6['where']})['then'](function(_0x1682da){_0x37b96f[_0x5e2c('0x20')]=_0x1682da;if(_0x353722[_0x5e2c('0x36')][_0x5e2c('0x44')]){_0x2a9bf6[_0x5e2c('0x45')]=[{'all':!![]}];}return db[_0x5e2c('0x5e')][_0x5e2c('0x46')](_0x2a9bf6);})[_0x5e2c('0x26')](function(_0x269bf1){_0x37b96f[_0x5e2c('0x47')]=_0x269bf1;return _0x37b96f;});}})[_0x5e2c('0x26')](respondWithFilteredResult(_0x56fd0e,_0x2a9bf6))[_0x5e2c('0x48')](handleError(_0x56fd0e,null));};exports[_0x5e2c('0x60')]=function(_0x590a67,_0x57cef1,_0x1753b0){var _0x4b926f={'raw':!![],'where':{}};var _0x59b028={};var _0x9c27a={'count':0x0,'rows':[]};return db[_0x5e2c('0x43')][_0x5e2c('0x5d')]({'where':{'id':_0x590a67[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x57cef1,null))[_0x5e2c('0x26')](function(_0x45db11){if(_0x45db11){_0x59b028[_0x5e2c('0x39')]=_[_0x5e2c('0x37')](db['CmHopperHistory'][_0x5e2c('0x31')]);_0x59b028[_0x5e2c('0x36')]=_[_0x5e2c('0x37')](_0x590a67[_0x5e2c('0x36')]);_0x59b028[_0x5e2c('0x38')]=_[_0x5e2c('0x4b')](_0x59b028[_0x5e2c('0x39')],_0x59b028['query']);_0x4b926f[_0x5e2c('0x3a')]=_[_0x5e2c('0x4b')](_0x59b028[_0x5e2c('0x39')],qs[_0x5e2c('0x3b')](_0x590a67[_0x5e2c('0x36')][_0x5e2c('0x3b')]));_0x4b926f[_0x5e2c('0x3a')]=_0x4b926f[_0x5e2c('0x3a')][_0x5e2c('0x61')]?_0x4b926f[_0x5e2c('0x3a')]:_0x59b028[_0x5e2c('0x39')];if(!_0x590a67['query'][_0x5e2c('0x3c')]('nolimit')){_0x4b926f[_0x5e2c('0x1f')]=qs['limit'](_0x590a67[_0x5e2c('0x36')][_0x5e2c('0x1f')]);_0x4b926f[_0x5e2c('0x1d')]=qs[_0x5e2c('0x1d')](_0x590a67['query'][_0x5e2c('0x1d')]);}_0x4b926f[_0x5e2c('0x3d')]=qs[_0x5e2c('0x3e')](_0x590a67[_0x5e2c('0x36')][_0x5e2c('0x3e')]);_0x4b926f[_0x5e2c('0x3f')]=qs[_0x5e2c('0x38')](_[_0x5e2c('0x40')](_0x590a67['query'],_0x59b028[_0x5e2c('0x38')]));_0x4b926f[_0x5e2c('0x3f')]['CampaignId']=_0x45db11['id'];if(_0x590a67[_0x5e2c('0x36')]['filter']){_0x4b926f['where']=_[_0x5e2c('0x4c')](_0x4b926f[_0x5e2c('0x3f')],{'$or':_[_0x5e2c('0x35')](_0x4b926f[_0x5e2c('0x3a')],function(_0x59025f){var _0x3ab777={};_0x3ab777[_0x59025f]={'$like':'%'+_0x590a67[_0x5e2c('0x36')][_0x5e2c('0x41')]+'%'};return _0x3ab777;})});}_0x4b926f=_[_0x5e2c('0x4c')]({},_0x4b926f,_0x590a67['options']);return db[_0x5e2c('0x62')][_0x5e2c('0x20')]({'where':_0x4b926f[_0x5e2c('0x3f')]})[_0x5e2c('0x26')](function(_0x379079){_0x9c27a['count']=_0x379079;if(_0x590a67[_0x5e2c('0x36')][_0x5e2c('0x44')]){_0x4b926f['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4b926f);})['then'](function(_0x55fc5a){_0x9c27a[_0x5e2c('0x47')]=_0x55fc5a;return _0x9c27a;});}})[_0x5e2c('0x26')](respondWithFilteredResult(_0x57cef1,_0x4b926f))['catch'](handleError(_0x57cef1,null));};exports['getHopperFinals']=function(_0x3a5176,_0x15ea5b,_0x2935b9){var _0x2f7c76={'raw':!![],'where':{}};var _0x1aca1e={};var _0x11fa9a={'count':0x0,'rows':[]};return db[_0x5e2c('0x43')][_0x5e2c('0x5d')]({'where':{'id':_0x3a5176[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x15ea5b,null))[_0x5e2c('0x26')](function(_0x3cc629){if(_0x3cc629){_0x1aca1e[_0x5e2c('0x39')]=_['keys'](db[_0x5e2c('0x63')][_0x5e2c('0x31')]);_0x1aca1e[_0x5e2c('0x36')]=_[_0x5e2c('0x37')](_0x3a5176['query']);_0x1aca1e['filters']=_['intersection'](_0x1aca1e['model'],_0x1aca1e[_0x5e2c('0x36')]);_0x2f7c76[_0x5e2c('0x3a')]=_[_0x5e2c('0x4b')](_0x1aca1e[_0x5e2c('0x39')],qs['fields'](_0x3a5176[_0x5e2c('0x36')][_0x5e2c('0x3b')]));_0x2f7c76[_0x5e2c('0x3a')]=_0x2f7c76[_0x5e2c('0x3a')][_0x5e2c('0x61')]?_0x2f7c76[_0x5e2c('0x3a')]:_0x1aca1e[_0x5e2c('0x39')];if(!_0x3a5176[_0x5e2c('0x36')]['hasOwnProperty'](_0x5e2c('0x5f'))){_0x2f7c76['limit']=qs[_0x5e2c('0x1f')](_0x3a5176[_0x5e2c('0x36')]['limit']);_0x2f7c76[_0x5e2c('0x1d')]=qs[_0x5e2c('0x1d')](_0x3a5176[_0x5e2c('0x36')]['offset']);}_0x2f7c76[_0x5e2c('0x3d')]=qs['sort'](_0x3a5176['query'][_0x5e2c('0x3e')]);_0x2f7c76[_0x5e2c('0x3f')]=qs[_0x5e2c('0x38')](_[_0x5e2c('0x40')](_0x3a5176['query'],_0x1aca1e[_0x5e2c('0x38')]));_0x2f7c76[_0x5e2c('0x3f')][_0x5e2c('0x64')]=_0x3cc629['id'];if(_0x3a5176[_0x5e2c('0x36')][_0x5e2c('0x41')]){_0x2f7c76[_0x5e2c('0x3f')]=_[_0x5e2c('0x4c')](_0x2f7c76['where'],{'$or':_['map'](_0x2f7c76[_0x5e2c('0x3a')],function(_0x87b715){var _0x3744ad={};_0x3744ad[_0x87b715]={'$like':'%'+_0x3a5176[_0x5e2c('0x36')]['filter']+'%'};return _0x3744ad;})});}_0x2f7c76=_[_0x5e2c('0x4c')]({},_0x2f7c76,_0x3a5176[_0x5e2c('0x4d')]);return db[_0x5e2c('0x63')][_0x5e2c('0x20')]({'where':_0x2f7c76[_0x5e2c('0x3f')]})['then'](function(_0x3fef0c){_0x11fa9a['count']=_0x3fef0c;if(_0x3a5176['query'][_0x5e2c('0x44')]){_0x2f7c76[_0x5e2c('0x45')]=[{'all':!![]}];}return db[_0x5e2c('0x63')]['findAll'](_0x2f7c76);})['then'](function(_0x470745){_0x11fa9a[_0x5e2c('0x47')]=_0x470745;return _0x11fa9a;});}})[_0x5e2c('0x26')](respondWithFilteredResult(_0x15ea5b,_0x2f7c76))[_0x5e2c('0x48')](handleError(_0x15ea5b,null));};exports[_0x5e2c('0x65')]=function(_0xd481ae,_0x15ab7d,_0x4bed05){var _0xc18d4c={'raw':!![],'where':{}};var _0x4a7c32={};var _0x186c1b={'count':0x0,'rows':[]};return db['Campaign'][_0x5e2c('0x5d')]({'where':{'id':_0xd481ae[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x15ab7d,null))['then'](function(_0x202263){if(_0x202263){_0x4a7c32[_0x5e2c('0x39')]=_[_0x5e2c('0x37')](db[_0x5e2c('0x66')][_0x5e2c('0x31')]);_0x4a7c32['query']=_['keys'](_0xd481ae[_0x5e2c('0x36')]);_0x4a7c32['filters']=_['intersection'](_0x4a7c32[_0x5e2c('0x39')],_0x4a7c32['query']);_0xc18d4c['attributes']=_['intersection'](_0x4a7c32[_0x5e2c('0x39')],qs['fields'](_0xd481ae[_0x5e2c('0x36')][_0x5e2c('0x3b')]));_0xc18d4c['attributes']=_0xc18d4c[_0x5e2c('0x3a')][_0x5e2c('0x61')]?_0xc18d4c['attributes']:_0x4a7c32[_0x5e2c('0x39')];if(!_0xd481ae[_0x5e2c('0x36')][_0x5e2c('0x3c')]('nolimit')){_0xc18d4c['limit']=qs[_0x5e2c('0x1f')](_0xd481ae[_0x5e2c('0x36')]['limit']);_0xc18d4c[_0x5e2c('0x1d')]=qs[_0x5e2c('0x1d')](_0xd481ae[_0x5e2c('0x36')][_0x5e2c('0x1d')]);}_0xc18d4c[_0x5e2c('0x3d')]=qs[_0x5e2c('0x3e')](_0xd481ae[_0x5e2c('0x36')][_0x5e2c('0x3e')]);_0xc18d4c[_0x5e2c('0x3f')]=qs[_0x5e2c('0x38')](_[_0x5e2c('0x40')](_0xd481ae[_0x5e2c('0x36')],_0x4a7c32['filters']));_0xc18d4c[_0x5e2c('0x3f')][_0x5e2c('0x64')]=_0x202263['id'];if(_0xd481ae[_0x5e2c('0x36')][_0x5e2c('0x41')]){_0xc18d4c[_0x5e2c('0x3f')]=_[_0x5e2c('0x4c')](_0xc18d4c[_0x5e2c('0x3f')],{'$or':_[_0x5e2c('0x35')](_0xc18d4c[_0x5e2c('0x3a')],function(_0xabb2b2){var _0x5232ef={};_0x5232ef[_0xabb2b2]={'$like':'%'+_0xd481ae[_0x5e2c('0x36')]['filter']+'%'};return _0x5232ef;})});}_0xc18d4c=_[_0x5e2c('0x4c')]({},_0xc18d4c,_0xd481ae[_0x5e2c('0x4d')]);return db['CmHopperBlack'][_0x5e2c('0x20')]({'where':_0xc18d4c[_0x5e2c('0x3f')]})[_0x5e2c('0x26')](function(_0x51bfba){_0x186c1b[_0x5e2c('0x20')]=_0x51bfba;if(_0xd481ae[_0x5e2c('0x36')][_0x5e2c('0x44')]){_0xc18d4c[_0x5e2c('0x45')]=[{'all':!![]}];}return db[_0x5e2c('0x66')]['findAll'](_0xc18d4c);})['then'](function(_0x152bc7){_0x186c1b['rows']=_0x152bc7;return _0x186c1b;});}})[_0x5e2c('0x26')](respondWithFilteredResult(_0x15ab7d,_0xc18d4c))['catch'](handleError(_0x15ab7d,null));};exports['getLists']=function(_0x240cdc,_0x199c5e,_0x43277b){var _0x1e7394={};var _0x2d5d4a={};var _0x49cdc4;var _0x34c104;return db[_0x5e2c('0x43')][_0x5e2c('0x5d')]({'where':{'id':_0x240cdc[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x199c5e,null))['then'](function(_0x53af9e){if(_0x53af9e){_0x49cdc4=_0x53af9e;_0x2d5d4a[_0x5e2c('0x39')]=_[_0x5e2c('0x37')](db[_0x5e2c('0x67')][_0x5e2c('0x31')]);_0x2d5d4a['query']=_[_0x5e2c('0x37')](_0x240cdc['query']);_0x2d5d4a['filters']=_[_0x5e2c('0x4b')](_0x2d5d4a['model'],_0x2d5d4a['query']);_0x1e7394[_0x5e2c('0x3a')]=_[_0x5e2c('0x4b')](_0x2d5d4a[_0x5e2c('0x39')],qs['fields'](_0x240cdc[_0x5e2c('0x36')][_0x5e2c('0x3b')]));_0x1e7394['attributes']=_0x1e7394[_0x5e2c('0x3a')][_0x5e2c('0x61')]?_0x1e7394[_0x5e2c('0x3a')]:_0x2d5d4a['model'];_0x1e7394[_0x5e2c('0x3d')]=qs[_0x5e2c('0x3e')](_0x240cdc[_0x5e2c('0x36')][_0x5e2c('0x3e')]);_0x1e7394['where']=qs[_0x5e2c('0x38')](_[_0x5e2c('0x40')](_0x240cdc['query'],_0x2d5d4a[_0x5e2c('0x38')]));if(_0x240cdc[_0x5e2c('0x36')][_0x5e2c('0x41')]){_0x1e7394[_0x5e2c('0x3f')]=_['merge'](_0x1e7394['where'],{'$or':_['map'](_0x1e7394[_0x5e2c('0x3a')],function(_0xa152c3){var _0x4df6e0={};_0x4df6e0[_0xa152c3]={'$like':'%'+_0x240cdc[_0x5e2c('0x36')][_0x5e2c('0x41')]+'%'};return _0x4df6e0;})});}_0x1e7394=_[_0x5e2c('0x4c')]({},_0x1e7394,_0x240cdc[_0x5e2c('0x4d')]);return _0x49cdc4[_0x5e2c('0x68')](_0x1e7394);}})[_0x5e2c('0x26')](function(_0x210ea1){if(_0x210ea1){_0x34c104=_0x210ea1[_0x5e2c('0x61')];if(!_0x240cdc[_0x5e2c('0x36')][_0x5e2c('0x3c')](_0x5e2c('0x5f'))){_0x1e7394[_0x5e2c('0x1f')]=qs[_0x5e2c('0x1f')](_0x240cdc[_0x5e2c('0x36')][_0x5e2c('0x1f')]);_0x1e7394[_0x5e2c('0x1d')]=qs['offset'](_0x240cdc[_0x5e2c('0x36')][_0x5e2c('0x1d')]);}return _0x49cdc4['getLists'](_0x1e7394);}})[_0x5e2c('0x26')](function(_0x17ef0a){if(_0x17ef0a){return _0x17ef0a?{'count':_0x34c104,'rows':_0x17ef0a}:null;}})['then'](respondWithResult(_0x199c5e,null))[_0x5e2c('0x48')](handleError(_0x199c5e,null));};exports[_0x5e2c('0x69')]=function(_0x48e3eb,_0x424850,_0x3533b1){var _0x2f6768,_0x320564;return db[_0x5e2c('0x43')]['find']({'where':{'id':_0x48e3eb['params']['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x424850,null))[_0x5e2c('0x26')](function(_0x1b8646){if(_0x1b8646){_0x320564=_0x1b8646;return _0x1b8646[_0x5e2c('0x69')](_0x48e3eb[_0x5e2c('0x50')][_0x5e2c('0x6a')],_['omit'](_0x48e3eb[_0x5e2c('0x50')],[_0x5e2c('0x6a'),'id'])||{});}return null;})[_0x5e2c('0x6b')](function(_0x16c8fa){var _0x1cbc75;_0x2f6768=_0x16c8fa||[];var _0x1ebf61=[];if(_0x16c8fa){for(var _0x53f5a0=0x0;_0x53f5a0<_0x16c8fa[_0x5e2c('0x61')];_0x53f5a0+=0x1){var _0x49f45d=_0x16c8fa[_0x53f5a0]['get']({'plain':!![]});_0x320564[_0x5e2c('0x6c')]=_0x48e3eb[_0x5e2c('0x50')][_0x5e2c('0x6c')]?_0x48e3eb['body'][_0x5e2c('0x6c')]:_0x320564[_0x5e2c('0x6c')];switch(_0x320564[_0x5e2c('0x6c')]){case _0x5e2c('0x6d'):_0x1cbc75=squel[_0x5e2c('0x6e')]()[_0x5e2c('0x6f')](_0x5e2c('0x70'))[_0x5e2c('0x71')]([_0x5e2c('0x72'),_0x5e2c('0x73'),_0x5e2c('0x74'),_0x5e2c('0x75'),_0x5e2c('0x64'),_0x5e2c('0x57'),_0x5e2c('0x58')],squel[_0x5e2c('0x76')]()[_0x5e2c('0x77')](_0x5e2c('0x72'),_0x5e2c('0x72'))[_0x5e2c('0x77')]('NOW()',_0x5e2c('0x73'))['field']('id','ContactId')['field'](_0x49f45d[_0x5e2c('0x78')][_0x5e2c('0x79')](),_0x5e2c('0x75'))[_0x5e2c('0x77')](_0x48e3eb[_0x5e2c('0x4a')]['id'][_0x5e2c('0x79')](),_0x5e2c('0x64'))[_0x5e2c('0x77')](_0x5e2c('0x7a'),'createdAt')[_0x5e2c('0x77')](_0x5e2c('0x7a'),_0x5e2c('0x58'))[_0x5e2c('0x7b')]('cm_contacts')['where'](_0x5e2c('0x7c'))[_0x5e2c('0x3f')]('ListId\x20=\x20?',_0x49f45d[_0x5e2c('0x78')][_0x5e2c('0x79')]())[_0x5e2c('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x5e2c('0x3f')](_0x5e2c('0x7d'),squel[_0x5e2c('0x76')]()[_0x5e2c('0x77')](_0x5e2c('0x7e'))[_0x5e2c('0x7b')](_0x5e2c('0x7f'))[_0x5e2c('0x3f')](_0x5e2c('0x80'),_0x48e3eb['params']['id'][_0x5e2c('0x79')]()))[_0x5e2c('0x3f')](_0x5e2c('0x7d'),squel[_0x5e2c('0x76')]()[_0x5e2c('0x77')]('COALESCE(phone,\x27\x27)')[_0x5e2c('0x7b')]('cm_hopper')['where'](_0x5e2c('0x80'),_0x48e3eb[_0x5e2c('0x4a')]['id'][_0x5e2c('0x79')]())))[_0x5e2c('0x79')]();break;case _0x5e2c('0x81'):_0x1cbc75=squel['insert']()['into']('cm_hopper')[_0x5e2c('0x71')]([_0x5e2c('0x72'),'scheduledAt','ContactId',_0x5e2c('0x75'),_0x5e2c('0x64'),_0x5e2c('0x57'),'updatedAt'],squel['select']()[_0x5e2c('0x77')](_0x5e2c('0x72'),'phone')['field'](_0x5e2c('0x7a'),_0x5e2c('0x73'))[_0x5e2c('0x77')]('id','ContactId')[_0x5e2c('0x77')](_0x49f45d[_0x5e2c('0x78')][_0x5e2c('0x79')](),'ListId')['field'](_0x48e3eb[_0x5e2c('0x4a')]['id'][_0x5e2c('0x79')](),_0x5e2c('0x64'))[_0x5e2c('0x77')](_0x5e2c('0x7a'),'createdAt')['field'](_0x5e2c('0x7a'),_0x5e2c('0x58'))[_0x5e2c('0x7b')](_0x5e2c('0x82'))[_0x5e2c('0x3f')]('deletedAt\x20IS\x20NULL')[_0x5e2c('0x3f')]('ListId\x20=\x20?',_0x49f45d[_0x5e2c('0x78')][_0x5e2c('0x79')]())[_0x5e2c('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x5e2c('0x3f')](_0x5e2c('0x7d'),squel[_0x5e2c('0x76')]()[_0x5e2c('0x77')](_0x5e2c('0x83'))[_0x5e2c('0x7b')](_0x5e2c('0x70'))[_0x5e2c('0x3f')](_0x5e2c('0x80'),_0x48e3eb[_0x5e2c('0x4a')]['id'][_0x5e2c('0x79')]())))[_0x5e2c('0x79')]();break;default:_0x1cbc75=squel['insert']()[_0x5e2c('0x6f')](_0x5e2c('0x70'))[_0x5e2c('0x71')]([_0x5e2c('0x72'),'scheduledAt',_0x5e2c('0x74'),_0x5e2c('0x75'),_0x5e2c('0x64'),_0x5e2c('0x57'),_0x5e2c('0x58')],squel['select']()[_0x5e2c('0x77')](_0x5e2c('0x72'),_0x5e2c('0x72'))[_0x5e2c('0x77')](_0x5e2c('0x7a'),_0x5e2c('0x73'))[_0x5e2c('0x77')]('id',_0x5e2c('0x74'))[_0x5e2c('0x77')](_0x49f45d['CmListId']['toString'](),_0x5e2c('0x75'))[_0x5e2c('0x77')](_0x48e3eb[_0x5e2c('0x4a')]['id'][_0x5e2c('0x79')](),_0x5e2c('0x64'))[_0x5e2c('0x77')]('NOW()','createdAt')[_0x5e2c('0x77')](_0x5e2c('0x7a'),_0x5e2c('0x58'))[_0x5e2c('0x7b')]('cm_contacts')[_0x5e2c('0x3f')](_0x5e2c('0x7c'))[_0x5e2c('0x3f')](_0x5e2c('0x84'),_0x49f45d[_0x5e2c('0x78')][_0x5e2c('0x79')]())[_0x5e2c('0x3f')](_0x5e2c('0x85')))[_0x5e2c('0x79')]();}_0x1ebf61[_0x5e2c('0x86')](db[_0x5e2c('0x87')][_0x5e2c('0x36')](_0x1cbc75));}return BPromise[_0x5e2c('0x88')](_0x1ebf61);}})[_0x5e2c('0x26')](function(){return _0x2f6768;})[_0x5e2c('0x26')](respondWithResult(_0x424850,null))[_0x5e2c('0x48')](handleError(_0x424850,null));};exports['removeLists']=function(_0x1f58ee,_0x5c8eba,_0x3dc8bf){return db['Campaign'][_0x5e2c('0x4e')]({'where':{'id':_0x1f58ee[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x5c8eba,null))[_0x5e2c('0x26')](function(_0x40775a){if(_0x40775a){return _0x40775a[_0x5e2c('0x89')](_0x1f58ee['query']['ids']);}})[_0x5e2c('0x26')](function(_0x180d86){if(_0x180d86){return db[_0x5e2c('0x5e')][_0x5e2c('0x2a')]({'where':{'ListId':_0x1f58ee[_0x5e2c('0x36')][_0x5e2c('0x6a')],'CampaignId':_0x1f58ee['params']['id']}})['then'](function(){return _0x180d86;});}})[_0x5e2c('0x26')](respondWithStatusCode(_0x5c8eba,null))['catch'](handleError(_0x5c8eba,null));};exports['getBlackLists']=function(_0x5e2478,_0x1313e7,_0x9792d1){var _0x33f480={};var _0x17740a={};var _0x57733f;var _0x1d5a0f;return db[_0x5e2c('0x43')]['findOne']({'where':{'id':_0x5e2478[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x1313e7,null))[_0x5e2c('0x26')](function(_0x112482){if(_0x112482){_0x57733f=_0x112482;_0x17740a[_0x5e2c('0x39')]=_[_0x5e2c('0x37')](db['CmList'][_0x5e2c('0x31')]);_0x17740a[_0x5e2c('0x36')]=_[_0x5e2c('0x37')](_0x5e2478[_0x5e2c('0x36')]);_0x17740a['filters']=_[_0x5e2c('0x4b')](_0x17740a['model'],_0x17740a[_0x5e2c('0x36')]);_0x33f480['attributes']=_[_0x5e2c('0x4b')](_0x17740a[_0x5e2c('0x39')],qs[_0x5e2c('0x3b')](_0x5e2478[_0x5e2c('0x36')][_0x5e2c('0x3b')]));_0x33f480[_0x5e2c('0x3a')]=_0x33f480[_0x5e2c('0x3a')][_0x5e2c('0x61')]?_0x33f480[_0x5e2c('0x3a')]:_0x17740a[_0x5e2c('0x39')];_0x33f480[_0x5e2c('0x3d')]=qs[_0x5e2c('0x3e')](_0x5e2478['query'][_0x5e2c('0x3e')]);_0x33f480[_0x5e2c('0x3f')]=qs[_0x5e2c('0x38')](_[_0x5e2c('0x40')](_0x5e2478[_0x5e2c('0x36')],_0x17740a[_0x5e2c('0x38')]));if(_0x5e2478[_0x5e2c('0x36')][_0x5e2c('0x41')]){_0x33f480['where']=_['merge'](_0x33f480['where'],{'$or':_[_0x5e2c('0x35')](_0x33f480[_0x5e2c('0x3a')],function(_0x18b210){var _0x3b7224={};_0x3b7224[_0x18b210]={'$like':'%'+_0x5e2478[_0x5e2c('0x36')][_0x5e2c('0x41')]+'%'};return _0x3b7224;})});}_0x33f480=_[_0x5e2c('0x4c')]({},_0x33f480,_0x5e2478[_0x5e2c('0x4d')]);return _0x57733f['getBlackLists'](_0x33f480);}})['then'](function(_0x4067ad){if(_0x4067ad){_0x1d5a0f=_0x4067ad[_0x5e2c('0x61')];if(!_0x5e2478['query']['hasOwnProperty'](_0x5e2c('0x5f'))){_0x33f480[_0x5e2c('0x1f')]=qs['limit'](_0x5e2478[_0x5e2c('0x36')][_0x5e2c('0x1f')]);_0x33f480[_0x5e2c('0x1d')]=qs[_0x5e2c('0x1d')](_0x5e2478[_0x5e2c('0x36')][_0x5e2c('0x1d')]);}return _0x57733f[_0x5e2c('0x8a')](_0x33f480);}})['then'](function(_0x487767){if(_0x487767){return _0x487767?{'count':_0x1d5a0f,'rows':_0x487767}:null;}})['then'](respondWithResult(_0x1313e7,null))[_0x5e2c('0x48')](handleError(_0x1313e7,null));};exports[_0x5e2c('0x8b')]=function(_0x446ce0,_0x3b6be5,_0x546603){var _0x1e8ddb,_0x2eb768;return db[_0x5e2c('0x43')][_0x5e2c('0x4e')]({'where':{'id':_0x446ce0[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0x3b6be5,null))[_0x5e2c('0x26')](function(_0x3008eb){if(_0x3008eb){_0x2eb768=_0x3008eb;return _0x3008eb[_0x5e2c('0x8b')](_0x446ce0['body']['ids'],_[_0x5e2c('0x56')](_0x446ce0[_0x5e2c('0x50')],[_0x5e2c('0x6a'),'id'])||{});}return null;})[_0x5e2c('0x6b')](function(_0x4f7a91){var _0x237c08;_0x1e8ddb=_0x4f7a91||[];var _0x42e0d4=[];if(_0x4f7a91){for(var _0x1a6845=0x0;_0x1a6845<_0x4f7a91[_0x5e2c('0x61')];_0x1a6845+=0x1){var _0x514935=_0x4f7a91[_0x1a6845][_0x5e2c('0x27')]({'plain':!![]});_0x237c08=squel[_0x5e2c('0x6e')]()[_0x5e2c('0x6f')](_0x5e2c('0x8c'))[_0x5e2c('0x71')]([_0x5e2c('0x72'),'ContactId',_0x5e2c('0x75'),_0x5e2c('0x64'),'createdAt',_0x5e2c('0x58')],squel[_0x5e2c('0x76')]()[_0x5e2c('0x77')](_0x5e2c('0x72'),_0x5e2c('0x72'))[_0x5e2c('0x77')]('id',_0x5e2c('0x74'))[_0x5e2c('0x77')](_0x514935['CmListId'][_0x5e2c('0x79')](),_0x5e2c('0x75'))['field'](_0x446ce0[_0x5e2c('0x4a')]['id']['toString'](),_0x5e2c('0x64'))['field']('NOW()',_0x5e2c('0x57'))[_0x5e2c('0x77')](_0x5e2c('0x7a'),_0x5e2c('0x58'))[_0x5e2c('0x7b')](_0x5e2c('0x82'))[_0x5e2c('0x3f')](_0x5e2c('0x7c'))[_0x5e2c('0x3f')](_0x5e2c('0x84'),_0x514935[_0x5e2c('0x78')][_0x5e2c('0x79')]())[_0x5e2c('0x3f')](_0x5e2c('0x85')))['toString']();_0x42e0d4[_0x5e2c('0x86')](db[_0x5e2c('0x87')][_0x5e2c('0x36')](_0x237c08));}return BPromise['all'](_0x42e0d4);}})['then'](function(){return _0x1e8ddb;})[_0x5e2c('0x26')](respondWithResult(_0x3b6be5,null))['catch'](handleError(_0x3b6be5,null));};exports['removeBlackLists']=function(_0x19df4d,_0xd46500,_0x172341){return db[_0x5e2c('0x43')][_0x5e2c('0x4e')]({'where':{'id':_0x19df4d[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](handleEntityNotFound(_0xd46500,null))[_0x5e2c('0x26')](function(_0x3fc76e){if(_0x3fc76e){return _0x3fc76e[_0x5e2c('0x8d')](_0x19df4d['query'][_0x5e2c('0x6a')]);}})[_0x5e2c('0x26')](function(_0x37e091){if(_0x37e091){return db[_0x5e2c('0x66')]['destroy']({'where':{'ListId':_0x19df4d['query']['ids'],'CampaignId':_0x19df4d[_0x5e2c('0x4a')]['id']}})[_0x5e2c('0x26')](function(){return _0x37e091;});}})[_0x5e2c('0x26')](respondWithStatusCode(_0xd46500,null))[_0x5e2c('0x48')](handleError(_0xd46500,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index d64ded3..ab9c873 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(_0x309e52,_0x26c91b){var _0x2797c6=function(_0x1f333f){while(--_0x1f333f){_0x309e52['push'](_0x309e52['shift']());}};_0x2797c6(++_0x26c91b);}(_0x7a54,0x106));var _0x47a5=function(_0x117209,_0x5ae3b1){_0x117209=_0x117209-0x0;var _0x3dfb7d=_0x7a54[_0x117209];return _0x3dfb7d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index f3bb0b6..1bff1d4 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 _0x3ee5=['limit','include','map','model','attributes','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where'];(function(_0x555d30,_0xba683d){var _0x423c33=function(_0x332e28){while(--_0x332e28){_0x555d30['push'](_0x555d30['shift']());}};_0x423c33(++_0xba683d);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x4c6b47,_0x46d3a0){_0x4c6b47=_0x4c6b47-0x0;var _0x33a498=_0x3ee5[_0x4c6b47];return _0x33a498;};'use strict';var _=require('lodash');var util=require(_0x53ee('0x0'));var moment=require(_0x53ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x2'));var fs=require('fs');var Redis=require(_0x53ee('0x3'));var db=require(_0x53ee('0x4'))['db'];var utils=require(_0x53ee('0x5'));var logger=require(_0x53ee('0x6'))(_0x53ee('0x7'));var config=require(_0x53ee('0x8'));var jayson=require(_0x53ee('0x9'));var client=jayson[_0x53ee('0xa')][_0x53ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3173b2,_0x48bc62,_0x299b23){return new BPromise(function(_0x235c9f,_0x1ec296){return client[_0x53ee('0xc')](_0x3173b2,_0x299b23)[_0x53ee('0xd')](function(_0x3b1252){logger[_0x53ee('0xe')](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));logger[_0x53ee('0x11')](_0x53ee('0x12'),_0x48bc62,_0x53ee('0x10'),JSON['stringify'](_0x3b1252));if(_0x3b1252['error']){if(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x14')]===0x1f4){logger[_0x53ee('0x13')](_0x53ee('0xf'),_0x48bc62,_0x3b1252[_0x53ee('0x13')]['message']);return _0x1ec296(_0x3b1252['error'][_0x53ee('0x15')]);}logger[_0x53ee('0x13')]('Campaign,\x20%s,\x20%s',_0x48bc62,_0x3b1252['error'][_0x53ee('0x15')]);return _0x235c9f(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x15')]);}else{logger['info'](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));_0x235c9f(_0x3b1252[_0x53ee('0x16')][_0x53ee('0x15')]);}})[_0x53ee('0x17')](function(_0x2fb3cd){logger['error'](_0x53ee('0xf'),_0x48bc62,_0x2fb3cd);_0x1ec296(_0x2fb3cd);});});}exports[_0x53ee('0x18')]=function(_0x3d788e){var _0x17c3cb=this;return new Promise(function(_0x708604,_0x29a4b4){return db[_0x53ee('0x19')][_0x53ee('0x1a')]({'raw':_0x3d788e[_0x53ee('0x1b')]?_0x3d788e[_0x53ee('0x1b')][_0x53ee('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d788e[_0x53ee('0x1b')]?_0x3d788e[_0x53ee('0x1b')][_0x53ee('0x1d')]||null:null,'attributes':_0x3d788e['options']?_0x3d788e[_0x53ee('0x1b')]['attributes']||null:null,'limit':_0x3d788e['options']?_0x3d788e[_0x53ee('0x1b')][_0x53ee('0x1e')]||null:null,'include':_0x3d788e[_0x53ee('0x1b')]?_0x3d788e['options'][_0x53ee('0x1f')]?_[_0x53ee('0x20')](_0x3d788e[_0x53ee('0x1b')][_0x53ee('0x1f')],function(_0x364444){return{'model':db[_0x364444[_0x53ee('0x21')]],'as':_0x364444['as'],'attributes':_0x364444['attributes'],'include':_0x364444['include']?_[_0x53ee('0x20')](_0x364444[_0x53ee('0x1f')],function(_0x2274cf){return{'model':db[_0x2274cf[_0x53ee('0x21')]],'as':_0x2274cf['as'],'attributes':_0x2274cf[_0x53ee('0x22')],'include':_0x2274cf['include']?_[_0x53ee('0x20')](_0x2274cf['include'],function(_0x26080d){return{'model':db[_0x26080d['model']],'as':_0x26080d['as'],'attributes':_0x26080d[_0x53ee('0x22')]};}):[]};}):[]};}):[]:[]})[_0x53ee('0xd')](function(_0x11d4fa){logger[_0x53ee('0xe')](_0x53ee('0x18'),_0x3d788e);logger[_0x53ee('0x11')](_0x53ee('0x18'),_0x3d788e,JSON[_0x53ee('0x23')](_0x11d4fa));_0x708604(_0x11d4fa);})[_0x53ee('0x17')](function(_0x189ef9){logger[_0x53ee('0x13')]('GetCampaign',_0x189ef9[_0x53ee('0x15')],_0x3d788e);_0x29a4b4(_0x17c3cb['error'](0x1f4,_0x189ef9[_0x53ee('0x15')]));});});}; \ No newline at end of file +var _0xd847=['options','raw','where','attributes','limit','include','map','model','GetCampaign','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','info','result','findAll'];(function(_0x526944,_0x2a2c50){var _0x3fa769=function(_0x22e302){while(--_0x22e302){_0x526944['push'](_0x526944['shift']());}};_0x3fa769(++_0x2a2c50);}(_0xd847,0x18a));var _0x7d84=function(_0x55da0c,_0x23780f){_0x55da0c=_0x55da0c-0x0;var _0x4fc256=_0xd847[_0x55da0c];return _0x4fc256;};'use strict';var _=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var moment=require(_0x7d84('0x2'));var BPromise=require(_0x7d84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d84('0x4'))['db'];var utils=require(_0x7d84('0x5'));var logger=require(_0x7d84('0x6'))(_0x7d84('0x7'));var config=require(_0x7d84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d84('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c57cd,_0x20ce63,_0x1d6297){return new BPromise(function(_0x32da6d,_0x128ef5){return client[_0x7d84('0xa')](_0x3c57cd,_0x1d6297)['then'](function(_0x1cf0b9){logger['info']('Campaign,\x20%s,\x20%s',_0x20ce63,_0x7d84('0xb'));logger[_0x7d84('0xc')](_0x7d84('0xd'),_0x20ce63,_0x7d84('0xb'),JSON[_0x7d84('0xe')](_0x1cf0b9));if(_0x1cf0b9[_0x7d84('0xf')]){if(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x10')]===0x1f4){logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);return _0x128ef5(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);}logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);return _0x32da6d(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);}else{logger[_0x7d84('0x13')]('Campaign,\x20%s,\x20%s',_0x20ce63,_0x7d84('0xb'));_0x32da6d(_0x1cf0b9[_0x7d84('0x14')]['message']);}})['catch'](function(_0x5338ab){logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x5338ab);_0x128ef5(_0x5338ab);});});}exports['GetCampaign']=function(_0x58b71b){var _0x5f1237=this;return new Promise(function(_0x50c9b4,_0x62f87f){return db['Campaign'][_0x7d84('0x15')]({'raw':_0x58b71b[_0x7d84('0x16')]?_0x58b71b[_0x7d84('0x16')][_0x7d84('0x17')]===undefined?!![]:![]:!![],'where':_0x58b71b['options']?_0x58b71b[_0x7d84('0x16')][_0x7d84('0x18')]||null:null,'attributes':_0x58b71b[_0x7d84('0x16')]?_0x58b71b[_0x7d84('0x16')][_0x7d84('0x19')]||null:null,'limit':_0x58b71b[_0x7d84('0x16')]?_0x58b71b[_0x7d84('0x16')][_0x7d84('0x1a')]||null:null,'include':_0x58b71b[_0x7d84('0x16')]?_0x58b71b[_0x7d84('0x16')][_0x7d84('0x1b')]?_[_0x7d84('0x1c')](_0x58b71b[_0x7d84('0x16')][_0x7d84('0x1b')],function(_0x218791){return{'model':db[_0x218791[_0x7d84('0x1d')]],'as':_0x218791['as'],'attributes':_0x218791[_0x7d84('0x19')],'include':_0x218791[_0x7d84('0x1b')]?_[_0x7d84('0x1c')](_0x218791[_0x7d84('0x1b')],function(_0x18c42e){return{'model':db[_0x18c42e[_0x7d84('0x1d')]],'as':_0x18c42e['as'],'attributes':_0x18c42e['attributes'],'include':_0x18c42e[_0x7d84('0x1b')]?_[_0x7d84('0x1c')](_0x18c42e[_0x7d84('0x1b')],function(_0xfe8284){return{'model':db[_0xfe8284[_0x7d84('0x1d')]],'as':_0xfe8284['as'],'attributes':_0xfe8284['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e238d){logger[_0x7d84('0x13')](_0x7d84('0x1e'),_0x58b71b);logger[_0x7d84('0xc')]('GetCampaign',_0x58b71b,JSON[_0x7d84('0xe')](_0x5e238d));_0x50c9b4(_0x5e238d);})[_0x7d84('0x1f')](function(_0x252a68){logger['error']('GetCampaign',_0x252a68[_0x7d84('0x12')],_0x58b71b);_0x62f87f(_0x5f1237['error'](0x1f4,_0x252a68[_0x7d84('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 2b4c7f5..c89cad1 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 _0x1da6=['create','clone','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post'];(function(_0x532383,_0x5a01d2){var _0x4e6c7c=function(_0xe23203){while(--_0xe23203){_0x532383['push'](_0x532383['shift']());}};_0x4e6c7c(++_0x5a01d2);}(_0x1da6,0x7c));var _0x61da=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x1da6[_0x263f4c];return _0x3a78d3;};'use strict';var multer=require(_0x61da('0x0'));var util=require(_0x61da('0x1'));var path=require(_0x61da('0x2'));var timeout=require(_0x61da('0x3'));var express=require(_0x61da('0x4'));var router=express[_0x61da('0x5')]();var fs_extra=require(_0x61da('0x6'));var auth=require(_0x61da('0x7'));var interaction=require(_0x61da('0x8'));var config=require(_0x61da('0x9'));var controller=require(_0x61da('0xa'));router[_0x61da('0xb')]('/',auth[_0x61da('0xc')](),controller[_0x61da('0xd')]);router[_0x61da('0xb')](_0x61da('0xe'),auth[_0x61da('0xc')](),controller[_0x61da('0xf')]);router[_0x61da('0xb')](_0x61da('0x10'),auth['isAuthenticated'](),controller[_0x61da('0x11')]);router[_0x61da('0xb')](_0x61da('0x12'),auth[_0x61da('0xc')](),controller[_0x61da('0x13')]);router[_0x61da('0xb')](_0x61da('0x14'),auth[_0x61da('0xc')](),controller[_0x61da('0x15')]);router[_0x61da('0xb')](_0x61da('0x16'),auth[_0x61da('0xc')](),controller[_0x61da('0x17')]);router[_0x61da('0xb')](_0x61da('0x18'),auth['isAuthenticated'](),controller[_0x61da('0x19')]);router[_0x61da('0xb')](_0x61da('0x1a'),auth[_0x61da('0xc')](),controller['getBlackLists']);router[_0x61da('0x1b')]('/',auth['isAuthenticated'](),controller[_0x61da('0x1c')]);router[_0x61da('0x1b')]('/:id/clone',auth['isAuthenticated'](),controller[_0x61da('0x1d')]);router[_0x61da('0x1b')](_0x61da('0x18'),auth[_0x61da('0xc')](),controller[_0x61da('0x1e')]);router[_0x61da('0x1b')]('/:id/blacklists',auth[_0x61da('0xc')](),controller[_0x61da('0x1f')]);router[_0x61da('0x20')](_0x61da('0xe'),auth['isAuthenticated'](),controller[_0x61da('0x21')]);router[_0x61da('0x22')](_0x61da('0xe'),auth[_0x61da('0xc')](),controller['destroy']);router[_0x61da('0x22')]('/:id/lists',auth[_0x61da('0xc')](),controller[_0x61da('0x23')]);router[_0x61da('0x22')](_0x61da('0x1a'),auth[_0x61da('0xc')](),controller[_0x61da('0x24')]);module[_0x61da('0x25')]=router; \ No newline at end of file +var _0xe7be=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addBlackLists','put','destroy','removeLists','delete','removeBlackLists','multer'];(function(_0x4abc8f,_0xef597d){var _0x5d7939=function(_0x145f23){while(--_0x145f23){_0x4abc8f['push'](_0x4abc8f['shift']());}};_0x5d7939(++_0xef597d);}(_0xe7be,0x16a));var _0xee7b=function(_0x32214a,_0x24fb09){_0x32214a=_0x32214a-0x0;var _0x1ce1a5=_0xe7be[_0x32214a];return _0x1ce1a5;};'use strict';var multer=require(_0xee7b('0x0'));var util=require(_0xee7b('0x1'));var path=require(_0xee7b('0x2'));var timeout=require(_0xee7b('0x3'));var express=require('express');var router=express[_0xee7b('0x4')]();var fs_extra=require(_0xee7b('0x5'));var auth=require(_0xee7b('0x6'));var interaction=require(_0xee7b('0x7'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xee7b('0x8')]('/',auth['isAuthenticated'](),controller[_0xee7b('0x9')]);router[_0xee7b('0x8')](_0xee7b('0xa'),auth['isAuthenticated'](),controller[_0xee7b('0xb')]);router[_0xee7b('0x8')](_0xee7b('0xc'),auth[_0xee7b('0xd')](),controller[_0xee7b('0xe')]);router['get'](_0xee7b('0xf'),auth[_0xee7b('0xd')](),controller[_0xee7b('0x10')]);router['get'](_0xee7b('0x11'),auth[_0xee7b('0xd')](),controller[_0xee7b('0x12')]);router['get'](_0xee7b('0x13'),auth[_0xee7b('0xd')](),controller[_0xee7b('0x14')]);router['get']('/:id/lists',auth[_0xee7b('0xd')](),controller['getLists']);router[_0xee7b('0x8')](_0xee7b('0x15'),auth[_0xee7b('0xd')](),controller[_0xee7b('0x16')]);router['post']('/',auth[_0xee7b('0xd')](),controller[_0xee7b('0x17')]);router[_0xee7b('0x18')](_0xee7b('0x19'),auth[_0xee7b('0xd')](),controller[_0xee7b('0x1a')]);router['post']('/:id/lists',auth[_0xee7b('0xd')](),controller['addLists']);router['post'](_0xee7b('0x15'),auth[_0xee7b('0xd')](),controller[_0xee7b('0x1b')]);router[_0xee7b('0x1c')](_0xee7b('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xee7b('0xa'),auth['isAuthenticated'](),controller[_0xee7b('0x1d')]);router['delete']('/:id/lists',auth[_0xee7b('0xd')](),controller[_0xee7b('0x1e')]);router[_0xee7b('0x1f')](_0xee7b('0x15'),auth[_0xee7b('0xd')](),controller[_0xee7b('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ab8c0c8..948d8c2 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 _0x1565=['VIRTUAL','getDataValue','key','sequelize','TEXT','STRING'];(function(_0x380a5a,_0x50f2e5){var _0xd47ac1=function(_0x57dda9){while(--_0x57dda9){_0x380a5a['push'](_0x380a5a['shift']());}};_0xd47ac1(++_0x50f2e5);}(_0x1565,0xb1));var _0x5156=function(_0x5ccb57,_0x5a8d00){_0x5ccb57=_0x5ccb57-0x0;var _0x34d458=_0x1565[_0x5ccb57];return _0x34d458;};'use strict';var Sequelize=require(_0x5156('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x5156('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5156('0x2')]},'name':{'type':Sequelize[_0x5156('0x3')],'get':function(){return this[_0x5156('0x4')](_0x5156('0x5'));}}}; \ No newline at end of file +var _0xd2b6=['STRING','VIRTUAL','getDataValue','key','sequelize','exports','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd2b6,0xc8));var _0x6d2b=function(_0x403969,_0x495f6c){_0x403969=_0x403969-0x0;var _0x7ebf13=_0xd2b6[_0x403969];return _0x7ebf13;};'use strict';var Sequelize=require(_0x6d2b('0x0'));module[_0x6d2b('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6d2b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6d2b('0x3')]},'name':{'type':Sequelize[_0x6d2b('0x4')],'get':function(){return this[_0x6d2b('0x5')](_0x6d2b('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index d3fa0ba..1c9ff34 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 _0x7d64=['then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','count','include','findAll','catch','show','params','rawAttributes','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update'];(function(_0x2ff8e3,_0x15553b){var _0x2f60b5=function(_0x582b5f){while(--_0x582b5f){_0x2ff8e3['push'](_0x2ff8e3['shift']());}};_0x2f60b5(++_0x15553b);}(_0x7d64,0xea));var _0x47d6=function(_0x4869b3,_0x53a366){_0x4869b3=_0x4869b3-0x0;var _0x7d9e28=_0x7d64[_0x4869b3];return _0x7d9e28;};'use strict';var emlformat=require(_0x47d6('0x0'));var rimraf=require(_0x47d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47d6('0x2'));var rp=require(_0x47d6('0x3'));var moment=require(_0x47d6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47d6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x47d6('0x6'));var ejs=require(_0x47d6('0x7'));var fs=require('fs');var fs_extra=require(_0x47d6('0x8'));var _=require(_0x47d6('0x9'));var squel=require(_0x47d6('0xa'));var crypto=require(_0x47d6('0xb'));var jsforce=require(_0x47d6('0xc'));var deskjs=require(_0x47d6('0xd'));var toCsv=require(_0x47d6('0x6'));var querystring=require(_0x47d6('0xe'));var Papa=require(_0x47d6('0xf'));var Redis=require(_0x47d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x47d6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47d6('0x12'));var logger=require(_0x47d6('0x13'))('api');var utils=require(_0x47d6('0x14'));var config=require(_0x47d6('0x15'));var licenseUtil=require(_0x47d6('0x16'));var db=require(_0x47d6('0x17'))['db'];function respondWithStatusCode(_0x4050bc,_0x2ec5bd){_0x2ec5bd=_0x2ec5bd||0xcc;return function(_0x4541cd){if(_0x4541cd){return _0x4050bc[_0x47d6('0x18')](_0x2ec5bd);}return _0x4050bc[_0x47d6('0x19')](_0x2ec5bd)[_0x47d6('0x1a')]();};}function respondWithResult(_0x1b9309,_0x42d132){_0x42d132=_0x42d132||0xc8;return function(_0x563333){if(_0x563333){return _0x1b9309[_0x47d6('0x19')](_0x42d132)[_0x47d6('0x1b')](_0x563333);}};}function respondWithFilteredResult(_0x5572ee,_0x279876){return function(_0x359fec){if(_0x359fec){var _0xd2d680=typeof _0x279876[_0x47d6('0x1c')]===_0x47d6('0x1d')&&typeof _0x279876[_0x47d6('0x1e')]===_0x47d6('0x1d');var _0x2ed80d=_0x359fec['count'];var _0x192cc8=_0xd2d680?0x0:_0x279876['offset'];var _0x3eb7e6=_0xd2d680?_0x359fec['count']:_0x279876['offset']+_0x279876[_0x47d6('0x1e')];var _0x1f9fbe;if(_0x3eb7e6>=_0x2ed80d){_0x3eb7e6=_0x2ed80d;_0x1f9fbe=0xc8;}else{_0x1f9fbe=0xce;}_0x5572ee[_0x47d6('0x19')](_0x1f9fbe);return _0x5572ee[_0x47d6('0x1f')](_0x47d6('0x20'),_0x192cc8+'-'+_0x3eb7e6+'/'+_0x2ed80d)['json'](_0x359fec);}return null;};}function patchUpdates(_0x4d32e5){return function(_0x4e9fb1){try{jsonpatch['apply'](_0x4e9fb1,_0x4d32e5,!![]);}catch(_0xb0be61){return BPromise[_0x47d6('0x21')](_0xb0be61);}return _0x4e9fb1[_0x47d6('0x22')]();};}function saveUpdates(_0x31e4fd,_0x234831){return function(_0xafbf60){if(_0xafbf60){return _0xafbf60[_0x47d6('0x23')](_0x31e4fd)[_0x47d6('0x24')](function(_0x34b9dc){return _0x34b9dc;});}return null;};}function removeEntity(_0x56091d,_0x13a4bc){return function(_0x12e4a6){if(_0x12e4a6){return _0x12e4a6[_0x47d6('0x25')]()[_0x47d6('0x24')](function(){var _0x3cc9f0=_0x12e4a6[_0x47d6('0x26')]({'plain':!![]});var _0x30fde6=_0x47d6('0x27');return db[_0x47d6('0x28')][_0x47d6('0x25')]({'where':{'type':_0x30fde6,'resourceId':_0x3cc9f0['id']}})['then'](function(){return _0x12e4a6;});})[_0x47d6('0x24')](function(){_0x56091d['status'](0xcc)[_0x47d6('0x1a')]();});}};}function handleEntityNotFound(_0x25e944,_0x5df188){return function(_0x23e16c){if(!_0x23e16c){_0x25e944[_0x47d6('0x18')](0x194);}return _0x23e16c;};}function handleError(_0x16943a,_0x31b350){_0x31b350=_0x31b350||0x1f4;return function(_0x5ec1cf){logger[_0x47d6('0x29')](_0x5ec1cf[_0x47d6('0x2a')]);if(_0x5ec1cf[_0x47d6('0x2b')]){delete _0x5ec1cf[_0x47d6('0x2b')];}_0x16943a['status'](_0x31b350)[_0x47d6('0x2c')](_0x5ec1cf);};}exports[_0x47d6('0x2d')]=function(_0x429904,_0xbff684){var _0x3ac2a4={},_0x360311={},_0x491da1={'count':0x0,'rows':[]};var _0x5da501=_[_0x47d6('0x2e')](db[_0x47d6('0x2f')]['rawAttributes'],function(_0xafdf8e){return{'name':_0xafdf8e[_0x47d6('0x30')],'type':_0xafdf8e[_0x47d6('0x31')][_0x47d6('0x32')]};});_0x360311['model']=_[_0x47d6('0x2e')](_0x5da501,_0x47d6('0x2b'));_0x360311[_0x47d6('0x33')]=_[_0x47d6('0x34')](_0x429904['query']);_0x360311[_0x47d6('0x35')]=_[_0x47d6('0x36')](_0x360311[_0x47d6('0x37')],_0x360311[_0x47d6('0x33')]);_0x3ac2a4['attributes']=_['intersection'](_0x360311['model'],qs[_0x47d6('0x38')](_0x429904['query'][_0x47d6('0x38')]));_0x3ac2a4[_0x47d6('0x39')]=_0x3ac2a4[_0x47d6('0x39')][_0x47d6('0x3a')]?_0x3ac2a4[_0x47d6('0x39')]:_0x360311[_0x47d6('0x37')];if(!_0x429904[_0x47d6('0x33')][_0x47d6('0x3b')]('nolimit')){_0x3ac2a4[_0x47d6('0x1e')]=qs[_0x47d6('0x1e')](_0x429904[_0x47d6('0x33')][_0x47d6('0x1e')]);_0x3ac2a4[_0x47d6('0x1c')]=qs['offset'](_0x429904[_0x47d6('0x33')]['offset']);}_0x3ac2a4[_0x47d6('0x3c')]=qs[_0x47d6('0x3d')](_0x429904['query'][_0x47d6('0x3d')]);_0x3ac2a4[_0x47d6('0x3e')]=qs[_0x47d6('0x35')](_[_0x47d6('0x3f')](_0x429904[_0x47d6('0x33')],_0x360311[_0x47d6('0x35')]),_0x5da501);if(_0x429904[_0x47d6('0x33')]['filter']){_0x3ac2a4[_0x47d6('0x3e')]=_[_0x47d6('0x40')](_0x3ac2a4[_0x47d6('0x3e')],{'$or':[{'key':{'$like':'%'+_0x429904[_0x47d6('0x33')][_0x47d6('0x41')]+'%'}},{'value':{'$like':'%'+_0x429904[_0x47d6('0x33')][_0x47d6('0x41')]+'%'}}]});}_0x3ac2a4=_[_0x47d6('0x40')]({},_0x3ac2a4,_0x429904[_0x47d6('0x42')]);var _0x27b1ae={'where':_0x3ac2a4[_0x47d6('0x3e')]};return db[_0x47d6('0x2f')][_0x47d6('0x43')](_0x27b1ae)['then'](function(_0x5d9af9){_0x491da1[_0x47d6('0x43')]=_0x5d9af9;if(_0x429904['query']['includeAll']){_0x3ac2a4[_0x47d6('0x44')]=[{'all':!![]}];}return db[_0x47d6('0x2f')][_0x47d6('0x45')](_0x3ac2a4);})[_0x47d6('0x24')](function(_0x51bfee){_0x491da1['rows']=_0x51bfee;return _0x491da1;})[_0x47d6('0x24')](respondWithFilteredResult(_0xbff684,_0x3ac2a4))[_0x47d6('0x46')](handleError(_0xbff684,null));};exports[_0x47d6('0x47')]=function(_0x279fa,_0x3e303f){var _0xb0dc5f={'raw':!![],'where':{'id':_0x279fa[_0x47d6('0x48')]['id']}},_0x211e57={};_0x211e57['model']=_[_0x47d6('0x34')](db[_0x47d6('0x2f')][_0x47d6('0x49')]);_0x211e57['query']=_['keys'](_0x279fa[_0x47d6('0x33')]);_0x211e57[_0x47d6('0x35')]=_['intersection'](_0x211e57[_0x47d6('0x37')],_0x211e57[_0x47d6('0x33')]);_0xb0dc5f[_0x47d6('0x39')]=_[_0x47d6('0x36')](_0x211e57[_0x47d6('0x37')],qs[_0x47d6('0x38')](_0x279fa[_0x47d6('0x33')][_0x47d6('0x38')]));_0xb0dc5f[_0x47d6('0x39')]=_0xb0dc5f[_0x47d6('0x39')][_0x47d6('0x3a')]?_0xb0dc5f[_0x47d6('0x39')]:_0x211e57[_0x47d6('0x37')];if(_0x279fa[_0x47d6('0x33')][_0x47d6('0x4a')]){_0xb0dc5f[_0x47d6('0x44')]=[{'all':!![]}];}_0xb0dc5f=_[_0x47d6('0x40')]({},_0xb0dc5f,_0x279fa[_0x47d6('0x42')]);return db[_0x47d6('0x2f')][_0x47d6('0x4b')](_0xb0dc5f)['then'](handleEntityNotFound(_0x3e303f,null))[_0x47d6('0x24')](respondWithResult(_0x3e303f,null))['catch'](handleError(_0x3e303f,null));};exports['update']=function(_0x4db305,_0x4b8893){if(_0x4db305[_0x47d6('0x4c')]['id']){delete _0x4db305[_0x47d6('0x4c')]['id'];}return db[_0x47d6('0x2f')][_0x47d6('0x4b')]({'where':{'id':_0x4db305[_0x47d6('0x48')]['id']}})[_0x47d6('0x24')](handleEntityNotFound(_0x4b8893,null))['then'](saveUpdates(_0x4db305['body'],null))[_0x47d6('0x24')](respondWithResult(_0x4b8893,null))['catch'](handleError(_0x4b8893,null));};exports[_0x47d6('0x25')]=function(_0x508538,_0x415b72){return db[_0x47d6('0x2f')][_0x47d6('0x4b')]({'where':{'id':_0x508538[_0x47d6('0x48')]['id']}})['then'](handleEntityNotFound(_0x415b72,null))['then'](removeEntity(_0x415b72,null))['catch'](handleError(_0x415b72,null));};exports[_0x47d6('0x4d')]=function(_0x43c136,_0x371c9b){var _0x52ee0b={'key':_0x43c136['body'][_0x47d6('0x32')]};if(_0x43c136['body'][_0x47d6('0x4e')]){_0x52ee0b[_0x47d6('0x4e')]=_0x43c136[_0x47d6('0x4c')][_0x47d6('0x4e')];}else if(_0x43c136['body'][_0x47d6('0x4f')]){_0x52ee0b[_0x47d6('0x4f')]=_0x43c136['body'][_0x47d6('0x4f')];}else if(_0x43c136[_0x47d6('0x4c')]['OpenchannelAccountId']){_0x52ee0b['OpenchannelAccountId']=_0x43c136[_0x47d6('0x4c')][_0x47d6('0x50')];}else if(_0x43c136['body'][_0x47d6('0x51')]){_0x52ee0b['ChatWebsiteId']=_0x43c136[_0x47d6('0x4c')][_0x47d6('0x51')];}return db[_0x47d6('0x2f')][_0x47d6('0x4b')]({'where':_0x52ee0b})[_0x47d6('0x24')](function(_0xf23e59){if(_0xf23e59){throw new db[(_0x47d6('0x52'))][(_0x47d6('0x53'))](_0x47d6('0x54'));}return db['CannedAnswer']['create'](_0x43c136[_0x47d6('0x4c')]);})['then'](function(_0x434640){var _0x36a4bc=_0x43c136[_0x47d6('0x55')][_0x47d6('0x26')]({'plain':!![]});if(!_0x36a4bc)throw new Error(_0x47d6('0x56'));if(_0x36a4bc[_0x47d6('0x57')]===_0x47d6('0x55')){var _0x460ce1=_0x434640[_0x47d6('0x26')]({'plain':!![]});return db[_0x47d6('0x58')][_0x47d6('0x4b')]({'where':{'name':_0x47d6('0x27'),'userProfileId':_0x36a4bc['userProfileId']},'raw':!![]})['then'](function(_0x4d5497){if(_0x4d5497&&_0x4d5497[_0x47d6('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x460ce1['name'],'resourceId':_0x460ce1['id'],'type':_0x4d5497[_0x47d6('0x2b')],'sectionId':_0x4d5497['id']},{})[_0x47d6('0x24')](function(){return _0x434640;});}else{return _0x434640;}})[_0x47d6('0x46')](function(_0x2fff7d){logger[_0x47d6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fff7d);throw _0x2fff7d;});}return _0x434640;})[_0x47d6('0x24')](respondWithResult(_0x371c9b,0xc9))[_0x47d6('0x46')](handleError(_0x371c9b,null));}; \ No newline at end of file +var _0x8c80=['bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','index','CannedAnswer','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','length','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8c80,0xa8));var _0x08c8=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x8c80[_0x43a1b8];return _0x324ecc;};'use strict';var emlformat=require(_0x08c8('0x0'));var rimraf=require(_0x08c8('0x1'));var zipdir=require(_0x08c8('0x2'));var jsonpatch=require(_0x08c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x08c8('0x4'));var Mustache=require('mustache');var util=require(_0x08c8('0x5'));var path=require(_0x08c8('0x6'));var sox=require(_0x08c8('0x7'));var csv=require('to-csv');var ejs=require(_0x08c8('0x8'));var fs=require('fs');var fs_extra=require(_0x08c8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x08c8('0xa'));var jsforce=require(_0x08c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x08c8('0xc'));var querystring=require('querystring');var Papa=require(_0x08c8('0xd'));var Redis=require(_0x08c8('0xe'));var authService=require(_0x08c8('0xf'));var qs=require(_0x08c8('0x10'));var as=require(_0x08c8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x08c8('0x12'))(_0x08c8('0x13'));var utils=require(_0x08c8('0x14'));var config=require(_0x08c8('0x15'));var licenseUtil=require(_0x08c8('0x16'));var db=require(_0x08c8('0x17'))['db'];function respondWithStatusCode(_0x20f4b1,_0x5ef694){_0x5ef694=_0x5ef694||0xcc;return function(_0x5ef30c){if(_0x5ef30c){return _0x20f4b1[_0x08c8('0x18')](_0x5ef694);}return _0x20f4b1[_0x08c8('0x19')](_0x5ef694)[_0x08c8('0x1a')]();};}function respondWithResult(_0x50469b,_0x5ebc0d){_0x5ebc0d=_0x5ebc0d||0xc8;return function(_0x20d216){if(_0x20d216){return _0x50469b[_0x08c8('0x19')](_0x5ebc0d)[_0x08c8('0x1b')](_0x20d216);}};}function respondWithFilteredResult(_0x55e9e2,_0x271490){return function(_0x4443d5){if(_0x4443d5){var _0x56c09b=typeof _0x271490[_0x08c8('0x1c')]===_0x08c8('0x1d')&&typeof _0x271490[_0x08c8('0x1e')]===_0x08c8('0x1d');var _0xa06d9=_0x4443d5[_0x08c8('0x1f')];var _0x5922e6=_0x56c09b?0x0:_0x271490[_0x08c8('0x1c')];var _0x206ec6=_0x56c09b?_0x4443d5[_0x08c8('0x1f')]:_0x271490[_0x08c8('0x1c')]+_0x271490[_0x08c8('0x1e')];var _0x442222;if(_0x206ec6>=_0xa06d9){_0x206ec6=_0xa06d9;_0x442222=0xc8;}else{_0x442222=0xce;}_0x55e9e2[_0x08c8('0x19')](_0x442222);return _0x55e9e2['set'](_0x08c8('0x20'),_0x5922e6+'-'+_0x206ec6+'/'+_0xa06d9)[_0x08c8('0x1b')](_0x4443d5);}return null;};}function patchUpdates(_0x555817){return function(_0x16ec5c){try{jsonpatch[_0x08c8('0x21')](_0x16ec5c,_0x555817,!![]);}catch(_0x51f516){return BPromise[_0x08c8('0x22')](_0x51f516);}return _0x16ec5c[_0x08c8('0x23')]();};}function saveUpdates(_0x179766,_0x636838){return function(_0x2f626b){if(_0x2f626b){return _0x2f626b[_0x08c8('0x24')](_0x179766)['then'](function(_0x3d12c7){return _0x3d12c7;});}return null;};}function removeEntity(_0xd22bf0,_0x54d311){return function(_0x5c5d81){if(_0x5c5d81){return _0x5c5d81[_0x08c8('0x25')]()[_0x08c8('0x26')](function(){var _0x4885e3=_0x5c5d81[_0x08c8('0x27')]({'plain':!![]});var _0x527d1e='CannedAnswers';return db[_0x08c8('0x28')][_0x08c8('0x25')]({'where':{'type':_0x527d1e,'resourceId':_0x4885e3['id']}})['then'](function(){return _0x5c5d81;});})[_0x08c8('0x26')](function(){_0xd22bf0[_0x08c8('0x19')](0xcc)[_0x08c8('0x1a')]();});}};}function handleEntityNotFound(_0x4a3cd6,_0xdf05d3){return function(_0x5c078d){if(!_0x5c078d){_0x4a3cd6[_0x08c8('0x18')](0x194);}return _0x5c078d;};}function handleError(_0x5918c8,_0x209bfc){_0x209bfc=_0x209bfc||0x1f4;return function(_0x1ddad1){logger['error'](_0x1ddad1[_0x08c8('0x29')]);if(_0x1ddad1[_0x08c8('0x2a')]){delete _0x1ddad1[_0x08c8('0x2a')];}_0x5918c8['status'](_0x209bfc)['send'](_0x1ddad1);};}exports[_0x08c8('0x2b')]=function(_0x2d9c86,_0x35d673){var _0x581bdf={},_0x243a6d={},_0x5d2aed={'count':0x0,'rows':[]};var _0x2ae6f1=_['map'](db[_0x08c8('0x2c')][_0x08c8('0x2d')],function(_0x59f545){return{'name':_0x59f545['fieldName'],'type':_0x59f545['type'][_0x08c8('0x2e')]};});_0x243a6d[_0x08c8('0x2f')]=_[_0x08c8('0x30')](_0x2ae6f1,_0x08c8('0x2a'));_0x243a6d['query']=_[_0x08c8('0x31')](_0x2d9c86[_0x08c8('0x32')]);_0x243a6d[_0x08c8('0x33')]=_[_0x08c8('0x34')](_0x243a6d[_0x08c8('0x2f')],_0x243a6d[_0x08c8('0x32')]);_0x581bdf[_0x08c8('0x35')]=_['intersection'](_0x243a6d[_0x08c8('0x2f')],qs[_0x08c8('0x36')](_0x2d9c86[_0x08c8('0x32')][_0x08c8('0x36')]));_0x581bdf[_0x08c8('0x35')]=_0x581bdf[_0x08c8('0x35')]['length']?_0x581bdf[_0x08c8('0x35')]:_0x243a6d[_0x08c8('0x2f')];if(!_0x2d9c86[_0x08c8('0x32')][_0x08c8('0x37')](_0x08c8('0x38'))){_0x581bdf[_0x08c8('0x1e')]=qs[_0x08c8('0x1e')](_0x2d9c86[_0x08c8('0x32')][_0x08c8('0x1e')]);_0x581bdf[_0x08c8('0x1c')]=qs[_0x08c8('0x1c')](_0x2d9c86[_0x08c8('0x32')]['offset']);}_0x581bdf[_0x08c8('0x39')]=qs[_0x08c8('0x3a')](_0x2d9c86[_0x08c8('0x32')][_0x08c8('0x3a')]);_0x581bdf['where']=qs[_0x08c8('0x33')](_[_0x08c8('0x3b')](_0x2d9c86[_0x08c8('0x32')],_0x243a6d[_0x08c8('0x33')]),_0x2ae6f1);if(_0x2d9c86['query'][_0x08c8('0x3c')]){_0x581bdf['where']=_['merge'](_0x581bdf['where'],{'$or':[{'key':{'$like':'%'+_0x2d9c86[_0x08c8('0x32')][_0x08c8('0x3c')]+'%'}},{'value':{'$like':'%'+_0x2d9c86[_0x08c8('0x32')][_0x08c8('0x3c')]+'%'}}]});}_0x581bdf=_[_0x08c8('0x3d')]({},_0x581bdf,_0x2d9c86['options']);var _0x330e2a={'where':_0x581bdf[_0x08c8('0x3e')]};return db[_0x08c8('0x2c')][_0x08c8('0x1f')](_0x330e2a)['then'](function(_0x52862a){_0x5d2aed[_0x08c8('0x1f')]=_0x52862a;if(_0x2d9c86[_0x08c8('0x32')][_0x08c8('0x3f')]){_0x581bdf[_0x08c8('0x40')]=[{'all':!![]}];}return db[_0x08c8('0x2c')][_0x08c8('0x41')](_0x581bdf);})[_0x08c8('0x26')](function(_0x5f0a18){_0x5d2aed['rows']=_0x5f0a18;return _0x5d2aed;})[_0x08c8('0x26')](respondWithFilteredResult(_0x35d673,_0x581bdf))[_0x08c8('0x42')](handleError(_0x35d673,null));};exports[_0x08c8('0x43')]=function(_0x214e96,_0x5a5b73){var _0x61adf8={'raw':!![],'where':{'id':_0x214e96[_0x08c8('0x44')]['id']}},_0xc19f1c={};_0xc19f1c[_0x08c8('0x2f')]=_['keys'](db[_0x08c8('0x2c')][_0x08c8('0x2d')]);_0xc19f1c[_0x08c8('0x32')]=_[_0x08c8('0x31')](_0x214e96[_0x08c8('0x32')]);_0xc19f1c[_0x08c8('0x33')]=_[_0x08c8('0x34')](_0xc19f1c['model'],_0xc19f1c[_0x08c8('0x32')]);_0x61adf8[_0x08c8('0x35')]=_[_0x08c8('0x34')](_0xc19f1c['model'],qs['fields'](_0x214e96['query']['fields']));_0x61adf8['attributes']=_0x61adf8[_0x08c8('0x35')][_0x08c8('0x45')]?_0x61adf8[_0x08c8('0x35')]:_0xc19f1c[_0x08c8('0x2f')];if(_0x214e96['query'][_0x08c8('0x3f')]){_0x61adf8[_0x08c8('0x40')]=[{'all':!![]}];}_0x61adf8=_[_0x08c8('0x3d')]({},_0x61adf8,_0x214e96[_0x08c8('0x46')]);return db[_0x08c8('0x2c')][_0x08c8('0x47')](_0x61adf8)[_0x08c8('0x26')](handleEntityNotFound(_0x5a5b73,null))[_0x08c8('0x26')](respondWithResult(_0x5a5b73,null))[_0x08c8('0x42')](handleError(_0x5a5b73,null));};exports['update']=function(_0x345e37,_0x253278){if(_0x345e37[_0x08c8('0x48')]['id']){delete _0x345e37['body']['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x345e37[_0x08c8('0x44')]['id']}})[_0x08c8('0x26')](handleEntityNotFound(_0x253278,null))[_0x08c8('0x26')](saveUpdates(_0x345e37[_0x08c8('0x48')],null))[_0x08c8('0x26')](respondWithResult(_0x253278,null))[_0x08c8('0x42')](handleError(_0x253278,null));};exports[_0x08c8('0x25')]=function(_0x39bc60,_0x773403){return db['CannedAnswer'][_0x08c8('0x47')]({'where':{'id':_0x39bc60[_0x08c8('0x44')]['id']}})[_0x08c8('0x26')](handleEntityNotFound(_0x773403,null))[_0x08c8('0x26')](removeEntity(_0x773403,null))[_0x08c8('0x42')](handleError(_0x773403,null));};exports[_0x08c8('0x49')]=function(_0x173476,_0x5e5763){var _0x3f2cf2={'key':_0x173476[_0x08c8('0x48')]['key']};if(_0x173476[_0x08c8('0x48')][_0x08c8('0x4a')]){_0x3f2cf2[_0x08c8('0x4a')]=_0x173476['body'][_0x08c8('0x4a')];}else if(_0x173476[_0x08c8('0x48')][_0x08c8('0x4b')]){_0x3f2cf2[_0x08c8('0x4b')]=_0x173476[_0x08c8('0x48')]['SmsAccountId'];}else if(_0x173476[_0x08c8('0x48')][_0x08c8('0x4c')]){_0x3f2cf2[_0x08c8('0x4c')]=_0x173476[_0x08c8('0x48')]['OpenchannelAccountId'];}else if(_0x173476['body']['ChatWebsiteId']){_0x3f2cf2['ChatWebsiteId']=_0x173476[_0x08c8('0x48')]['ChatWebsiteId'];}return db[_0x08c8('0x2c')][_0x08c8('0x47')]({'where':_0x3f2cf2})[_0x08c8('0x26')](function(_0x150631){if(_0x150631){throw new db[(_0x08c8('0x4d'))][(_0x08c8('0x4e'))](_0x08c8('0x4f'));}return db[_0x08c8('0x2c')][_0x08c8('0x49')](_0x173476[_0x08c8('0x48')]);})[_0x08c8('0x26')](function(_0x5dd69d){var _0x58b306=_0x173476[_0x08c8('0x50')]['get']({'plain':!![]});if(!_0x58b306)throw new Error(_0x08c8('0x51'));if(_0x58b306[_0x08c8('0x52')]===_0x08c8('0x50')){var _0x146b3d=_0x5dd69d[_0x08c8('0x27')]({'plain':!![]});return db[_0x08c8('0x53')][_0x08c8('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x58b306['userProfileId']},'raw':!![]})[_0x08c8('0x26')](function(_0x18bc46){if(_0x18bc46&&_0x18bc46['autoAssociation']===0x0){return db[_0x08c8('0x28')][_0x08c8('0x49')]({'name':_0x146b3d[_0x08c8('0x2a')],'resourceId':_0x146b3d['id'],'type':_0x18bc46[_0x08c8('0x2a')],'sectionId':_0x18bc46['id']},{})['then'](function(){return _0x5dd69d;});}else{return _0x5dd69d;}})['catch'](function(_0x44e9d3){logger[_0x08c8('0x54')](_0x08c8('0x55'),_0x44e9d3);throw _0x44e9d3;});}return _0x5dd69d;})['then'](respondWithResult(_0x5e5763,0xc9))[_0x08c8('0x42')](handleError(_0x5e5763,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index adb7303..4d69fd7 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 _0xe900=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0xe900,0x89));var _0x0e90=function(_0x31261c,_0x5d84dd){_0x31261c=_0x31261c-0x0;var _0x43919d=_0xe900[_0x31261c];return _0x43919d;};'use strict';var _=require(_0x0e90('0x0'));var util=require('util');var logger=require(_0x0e90('0x1'))(_0x0e90('0x2'));var moment=require(_0x0e90('0x3'));var BPromise=require('bluebird');var rp=require(_0x0e90('0x4'));var fs=require('fs');var path=require(_0x0e90('0x5'));var rimraf=require('rimraf');var config=require(_0x0e90('0x6'));var attributes=require(_0x0e90('0x7'));module[_0x0e90('0x8')]=function(_0x413d4b,_0x34a068){return _0x413d4b[_0x0e90('0x9')](_0x0e90('0xa'),attributes,{'tableName':_0x0e90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e90('0xc')});}; \ No newline at end of file +var _0x1789=['moment','bluebird','request-promise','path','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util'];(function(_0x2933cc,_0x315416){var _0x351f85=function(_0x2403d2){while(--_0x2403d2){_0x2933cc['push'](_0x2933cc['shift']());}};_0x351f85(++_0x315416);}(_0x1789,0xaa));var _0x9178=function(_0x583bf0,_0x4b59aa){_0x583bf0=_0x583bf0-0x0;var _0x210ec6=_0x1789[_0x583bf0];return _0x210ec6;};'use strict';var _=require('lodash');var util=require(_0x9178('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9178('0x1'));var BPromise=require(_0x9178('0x2'));var rp=require(_0x9178('0x3'));var fs=require('fs');var path=require(_0x9178('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x291f39,_0x1df3b1){return _0x291f39[_0x9178('0x5')](_0x9178('0x6'),attributes,{'tableName':_0x9178('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9178('0x8')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 47c1bbc..2c1bc00 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(_0x1167cc,_0x5ea952){var _0x4aaedf=function(_0x529868){while(--_0x529868){_0x1167cc['push'](_0x1167cc['shift']());}};_0x4aaedf(++_0x5ea952);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x37f68f,_0x385db0){var _0x515854=function(_0x23f644){while(--_0x23f644){_0x37f68f['push'](_0x37f68f['shift']());}};_0x515854(++_0x385db0);}(_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);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 6786de4..2e65d24 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 _0xeece=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','put'];(function(_0xa9518,_0x3ab179){var _0x230fff=function(_0x5a3131){while(--_0x5a3131){_0xa9518['push'](_0xa9518['shift']());}};_0x230fff(++_0x3ab179);}(_0xeece,0x178));var _0xeeec=function(_0x92fb1a,_0x359dcf){_0x92fb1a=_0x92fb1a-0x0;var _0x4d1675=_0xeece[_0x92fb1a];return _0x4d1675;};'use strict';var multer=require(_0xeeec('0x0'));var util=require(_0xeeec('0x1'));var path=require(_0xeeec('0x2'));var timeout=require(_0xeeec('0x3'));var express=require(_0xeeec('0x4'));var router=express[_0xeeec('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeeec('0x6'));var config=require(_0xeeec('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xeeec('0x8')](),controller['index']);router[_0xeeec('0x9')](_0xeeec('0xa'),auth[_0xeeec('0x8')](),controller[_0xeeec('0xb')]);router[_0xeeec('0xc')]('/',auth[_0xeeec('0x8')](),controller[_0xeeec('0xd')]);router[_0xeeec('0xe')](_0xeeec('0xa'),auth[_0xeeec('0x8')](),controller['update']);router[_0xeeec('0xf')](_0xeeec('0xa'),auth[_0xeeec('0x8')](),controller['destroy']);module[_0xeeec('0x10')]=router; \ No newline at end of file +var _0x983e=['./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x983e,0x93));var _0xe983=function(_0x1cc48f,_0x50b0d0){_0x1cc48f=_0x1cc48f-0x0;var _0x4cae02=_0x983e[_0x1cc48f];return _0x4cae02;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe983('0x0'));var express=require(_0xe983('0x1'));var router=express['Router']();var fs_extra=require(_0xe983('0x2'));var auth=require(_0xe983('0x3'));var interaction=require(_0xe983('0x4'));var config=require(_0xe983('0x5'));var controller=require(_0xe983('0x6'));router[_0xe983('0x7')]('/',auth[_0xe983('0x8')](),controller[_0xe983('0x9')]);router['get'](_0xe983('0xa'),auth[_0xe983('0x8')](),controller[_0xe983('0xb')]);router[_0xe983('0xc')]('/',auth[_0xe983('0x8')](),controller[_0xe983('0xd')]);router[_0xe983('0xe')](_0xe983('0xa'),auth[_0xe983('0x8')](),controller['update']);router[_0xe983('0xf')]('/:id',auth[_0xe983('0x8')](),controller['destroy']);module[_0xe983('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 3ebd24f..fe9e3a0 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 _0x7daf=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0x7daf,0xaa));var _0xf7da=function(_0x40e0eb,_0x51f9a5){_0x40e0eb=_0x40e0eb-0x0;var _0x3b11ee=_0x7daf[_0x40e0eb];return _0x3b11ee;};'use strict';var Sequelize=require('sequelize');module[_0xf7da('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xf7da('0x1')},'clid':{'type':Sequelize[_0xf7da('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xf7da('0x2')]},'dcontext':{'type':Sequelize[_0xf7da('0x2')]},'channel':{'type':Sequelize[_0xf7da('0x2')]},'dstchannel':{'type':Sequelize[_0xf7da('0x2')]},'lastapp':{'type':Sequelize[_0xf7da('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xf7da('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf7da('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf7da('0x2')]},'amaflags':{'type':Sequelize[_0xf7da('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf7da('0x2')]},'userfield':{'type':Sequelize[_0xf7da('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf7da('0x2')]},'sequence':{'type':Sequelize[_0xf7da('0x2')]},'peeraccount':{'type':Sequelize[_0xf7da('0x2')]},'type':{'type':Sequelize[_0xf7da('0x2')]},'tag':{'type':Sequelize[_0xf7da('0x2')]}}; \ No newline at end of file +var _0x867f=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x2f8bc6,_0x4dc869){var _0x2d008a=function(_0x276072){while(--_0x276072){_0x2f8bc6['push'](_0x2f8bc6['shift']());}};_0x2d008a(++_0x4dc869);}(_0x867f,0xe6));var _0xf867=function(_0x5b96f6,_0x26fe54){_0x5b96f6=_0x5b96f6-0x0;var _0xe67cd8=_0x867f[_0x5b96f6];return _0xe67cd8;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'calldate':{'type':Sequelize[_0xf867('0x2')],'allowNull':![],'defaultValue':_0xf867('0x3')},'clid':{'type':Sequelize[_0xf867('0x4')]},'src':{'type':Sequelize[_0xf867('0x4')]},'dst':{'type':Sequelize[_0xf867('0x4')]},'dcontext':{'type':Sequelize[_0xf867('0x4')]},'channel':{'type':Sequelize[_0xf867('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf867('0x4')]},'duration':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf867('0x4')]},'amaflags':{'type':Sequelize[_0xf867('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf867('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xf867('0x4')]},'peeraccount':{'type':Sequelize[_0xf867('0x4')]},'type':{'type':Sequelize[_0xf867('0x4')]},'tag':{'type':Sequelize[_0xf867('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index f5335e8..f57ab38 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 _0x72b1=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x72b1,0x16e));var _0x172b=function(_0x536bff,_0x16668f){_0x536bff=_0x536bff-0x0;var _0x4f196a=_0x72b1[_0x536bff];return _0x4f196a;};'use strict';var emlformat=require(_0x172b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x172b('0x1'));var jsonpatch=require(_0x172b('0x2'));var rp=require(_0x172b('0x3'));var moment=require(_0x172b('0x4'));var BPromise=require(_0x172b('0x5'));var Mustache=require(_0x172b('0x6'));var util=require(_0x172b('0x7'));var path=require('path');var sox=require(_0x172b('0x8'));var csv=require(_0x172b('0x9'));var ejs=require(_0x172b('0xa'));var fs=require('fs');var fs_extra=require(_0x172b('0xb'));var _=require('lodash');var squel=require(_0x172b('0xc'));var crypto=require('crypto');var jsforce=require(_0x172b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x172b('0x9'));var querystring=require(_0x172b('0xe'));var Papa=require(_0x172b('0xf'));var Redis=require(_0x172b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x172b('0x11'));var as=require(_0x172b('0x12'));var hardwareService=require(_0x172b('0x13'));var logger=require(_0x172b('0x14'))(_0x172b('0x15'));var utils=require(_0x172b('0x16'));var config=require(_0x172b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x172b('0x18'))['db'];function respondWithStatusCode(_0x82727f,_0xdf832e){_0xdf832e=_0xdf832e||0xcc;return function(_0x4970f8){if(_0x4970f8){return _0x82727f[_0x172b('0x19')](_0xdf832e);}return _0x82727f['status'](_0xdf832e)[_0x172b('0x1a')]();};}function respondWithResult(_0x81e11e,_0x5239b9){_0x5239b9=_0x5239b9||0xc8;return function(_0x1b7247){if(_0x1b7247){return _0x81e11e[_0x172b('0x1b')](_0x5239b9)[_0x172b('0x1c')](_0x1b7247);}};}function respondWithFilteredResult(_0xa28463,_0x5b0ab1){return function(_0x5293ef){if(_0x5293ef){var _0x3625bb=typeof _0x5b0ab1[_0x172b('0x1d')]===_0x172b('0x1e')&&typeof _0x5b0ab1[_0x172b('0x1f')]==='undefined';var _0x4f369b=_0x5293ef[_0x172b('0x20')];var _0x3b2701=_0x3625bb?0x0:_0x5b0ab1[_0x172b('0x1d')];var _0xba7825=_0x3625bb?_0x5293ef[_0x172b('0x20')]:_0x5b0ab1['offset']+_0x5b0ab1[_0x172b('0x1f')];var _0x2d24f9;if(_0xba7825>=_0x4f369b){_0xba7825=_0x4f369b;_0x2d24f9=0xc8;}else{_0x2d24f9=0xce;}_0xa28463[_0x172b('0x1b')](_0x2d24f9);return _0xa28463[_0x172b('0x21')](_0x172b('0x22'),_0x3b2701+'-'+_0xba7825+'/'+_0x4f369b)[_0x172b('0x1c')](_0x5293ef);}return null;};}function patchUpdates(_0x296aa6){return function(_0x5c7e17){try{jsonpatch['apply'](_0x5c7e17,_0x296aa6,!![]);}catch(_0x562db9){return BPromise['reject'](_0x562db9);}return _0x5c7e17[_0x172b('0x23')]();};}function saveUpdates(_0x4c8090,_0x721d07){return function(_0x25ee62){if(_0x25ee62){return _0x25ee62[_0x172b('0x24')](_0x4c8090)[_0x172b('0x25')](function(_0x32419a){return _0x32419a;});}return null;};}function removeEntity(_0x24e4ff,_0x507b99){return function(_0x1cefd1){if(_0x1cefd1){return _0x1cefd1[_0x172b('0x26')]()['then'](function(){_0x24e4ff[_0x172b('0x1b')](0xcc)[_0x172b('0x1a')]();});}};}function handleEntityNotFound(_0x3df490,_0x29e1d4){return function(_0x356c83){if(!_0x356c83){_0x3df490[_0x172b('0x19')](0x194);}return _0x356c83;};}function handleError(_0x39bdc5,_0x5ee442){_0x5ee442=_0x5ee442||0x1f4;return function(_0x1deb7e){logger[_0x172b('0x27')](_0x1deb7e['stack']);if(_0x1deb7e[_0x172b('0x28')]){delete _0x1deb7e[_0x172b('0x28')];}_0x39bdc5[_0x172b('0x1b')](_0x5ee442)[_0x172b('0x29')](_0x1deb7e);};}exports[_0x172b('0x2a')]=function(_0x4bea8e,_0x9624f5){var _0x37acc5={},_0x596b4c={},_0x5db251={'count':0x0,'rows':[]};var _0x43728b=_[_0x172b('0x2b')](db[_0x172b('0x2c')][_0x172b('0x2d')],function(_0x367f80){return{'name':_0x367f80[_0x172b('0x2e')],'type':_0x367f80[_0x172b('0x2f')][_0x172b('0x30')]};});_0x596b4c[_0x172b('0x31')]=_[_0x172b('0x2b')](_0x43728b,_0x172b('0x28'));_0x596b4c[_0x172b('0x32')]=_[_0x172b('0x33')](_0x4bea8e[_0x172b('0x32')]);_0x596b4c[_0x172b('0x34')]=_[_0x172b('0x35')](_0x596b4c[_0x172b('0x31')],_0x596b4c[_0x172b('0x32')]);_0x37acc5[_0x172b('0x36')]=_[_0x172b('0x35')](_0x596b4c[_0x172b('0x31')],qs[_0x172b('0x37')](_0x4bea8e[_0x172b('0x32')][_0x172b('0x37')]));_0x37acc5[_0x172b('0x36')]=_0x37acc5['attributes'][_0x172b('0x38')]?_0x37acc5[_0x172b('0x36')]:_0x596b4c[_0x172b('0x31')];if(!_0x4bea8e['query'][_0x172b('0x39')]('nolimit')){_0x37acc5['limit']=qs['limit'](_0x4bea8e[_0x172b('0x32')]['limit']);_0x37acc5['offset']=qs[_0x172b('0x1d')](_0x4bea8e[_0x172b('0x32')][_0x172b('0x1d')]);}_0x37acc5['order']=qs[_0x172b('0x3a')](_0x4bea8e[_0x172b('0x32')][_0x172b('0x3a')]);_0x37acc5[_0x172b('0x3b')]=qs[_0x172b('0x34')](_[_0x172b('0x3c')](_0x4bea8e[_0x172b('0x32')],_0x596b4c[_0x172b('0x34')]),_0x43728b);if(_0x4bea8e[_0x172b('0x32')][_0x172b('0x3d')]){_0x37acc5[_0x172b('0x3b')]=_[_0x172b('0x3e')](_0x37acc5[_0x172b('0x3b')],{'$or':_[_0x172b('0x2b')](_0x43728b,function(_0x51ac71){if(_0x51ac71[_0x172b('0x2f')]!==_0x172b('0x3f')){var _0x2beb2a={};_0x2beb2a[_0x51ac71[_0x172b('0x28')]]={'$like':'%'+_0x4bea8e['query']['filter']+'%'};return _0x2beb2a;}})});}_0x37acc5=_[_0x172b('0x3e')]({},_0x37acc5,_0x4bea8e['options']);var _0x5e8ff6={'where':_0x37acc5['where']};return db[_0x172b('0x2c')][_0x172b('0x20')](_0x5e8ff6)[_0x172b('0x25')](function(_0x54e62d){_0x5db251[_0x172b('0x20')]=_0x54e62d;if(_0x4bea8e[_0x172b('0x32')][_0x172b('0x40')]){_0x37acc5['include']=[{'all':!![]}];}return db[_0x172b('0x2c')]['findAll'](_0x37acc5);})[_0x172b('0x25')](function(_0x4a05da){_0x5db251[_0x172b('0x41')]=_0x4a05da;return _0x5db251;})[_0x172b('0x25')](respondWithFilteredResult(_0x9624f5,_0x37acc5))[_0x172b('0x42')](handleError(_0x9624f5,null));};exports[_0x172b('0x43')]=function(_0x24fba9,_0x5c973c){var _0x177250={'raw':!![],'where':{'id':_0x24fba9[_0x172b('0x44')]['id']}},_0x5e036e={};_0x5e036e[_0x172b('0x31')]=_[_0x172b('0x33')](db[_0x172b('0x2c')]['rawAttributes']);_0x5e036e['query']=_[_0x172b('0x33')](_0x24fba9['query']);_0x5e036e['filters']=_['intersection'](_0x5e036e[_0x172b('0x31')],_0x5e036e[_0x172b('0x32')]);_0x177250[_0x172b('0x36')]=_[_0x172b('0x35')](_0x5e036e['model'],qs[_0x172b('0x37')](_0x24fba9[_0x172b('0x32')][_0x172b('0x37')]));_0x177250[_0x172b('0x36')]=_0x177250[_0x172b('0x36')][_0x172b('0x38')]?_0x177250[_0x172b('0x36')]:_0x5e036e[_0x172b('0x31')];if(_0x24fba9[_0x172b('0x32')][_0x172b('0x40')]){_0x177250[_0x172b('0x45')]=[{'all':!![]}];}_0x177250=_[_0x172b('0x3e')]({},_0x177250,_0x24fba9['options']);return db[_0x172b('0x2c')][_0x172b('0x46')](_0x177250)['then'](handleEntityNotFound(_0x5c973c,null))['then'](respondWithResult(_0x5c973c,null))[_0x172b('0x42')](handleError(_0x5c973c,null));};exports[_0x172b('0x47')]=function(_0x1a14b2,_0x571504){return db[_0x172b('0x2c')]['create'](_0x1a14b2['body'],{})[_0x172b('0x25')](respondWithResult(_0x571504,0xc9))[_0x172b('0x42')](handleError(_0x571504,null));};exports[_0x172b('0x24')]=function(_0x3941d4,_0x24ab0c){if(_0x3941d4[_0x172b('0x48')]['id']){delete _0x3941d4[_0x172b('0x48')]['id'];}return db[_0x172b('0x2c')][_0x172b('0x46')]({'where':{'id':_0x3941d4[_0x172b('0x44')]['id']}})['then'](handleEntityNotFound(_0x24ab0c,null))['then'](saveUpdates(_0x3941d4[_0x172b('0x48')],null))[_0x172b('0x25')](respondWithResult(_0x24ab0c,null))['catch'](handleError(_0x24ab0c,null));};exports['destroy']=function(_0x3db238,_0x41ea2c){return db[_0x172b('0x2c')][_0x172b('0x46')]({'where':{'id':_0x3db238[_0x172b('0x44')]['id']}})[_0x172b('0x25')](handleEntityNotFound(_0x41ea2c,null))['then'](removeEntity(_0x41ea2c,null))[_0x172b('0x42')](handleError(_0x41ea2c,null));};exports['describe']=function(_0x5f22eb,_0x221cd7){return db[_0x172b('0x2c')][_0x172b('0x49')]()['then'](respondWithResult(_0x221cd7,null))[_0x172b('0x42')](handleError(_0x221cd7,null));}; \ No newline at end of file +var _0x1224=['sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order'];(function(_0x3f4bb2,_0x1fe283){var _0x113328=function(_0xdb325f){while(--_0xdb325f){_0x3f4bb2['push'](_0x3f4bb2['shift']());}};_0x113328(++_0x1fe283);}(_0x1224,0x10d));var _0x4122=function(_0x468ac5,_0x2edfd5){_0x468ac5=_0x468ac5-0x0;var _0x33a807=_0x1224[_0x468ac5];return _0x33a807;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];function respondWithStatusCode(_0x440ff0,_0x8d4876){_0x8d4876=_0x8d4876||0xcc;return function(_0xe213d){if(_0xe213d){return _0x440ff0[_0x4122('0x1e')](_0x8d4876);}return _0x440ff0[_0x4122('0x1f')](_0x8d4876)[_0x4122('0x20')]();};}function respondWithResult(_0x421ee3,_0x1a701e){_0x1a701e=_0x1a701e||0xc8;return function(_0x3a88fe){if(_0x3a88fe){return _0x421ee3['status'](_0x1a701e)[_0x4122('0x21')](_0x3a88fe);}};}function respondWithFilteredResult(_0x3c674e,_0x192e77){return function(_0x359909){if(_0x359909){var _0x520300=typeof _0x192e77[_0x4122('0x22')]===_0x4122('0x23')&&typeof _0x192e77['limit']===_0x4122('0x23');var _0x3ec4d3=_0x359909[_0x4122('0x24')];var _0x4636ae=_0x520300?0x0:_0x192e77[_0x4122('0x22')];var _0x42374d=_0x520300?_0x359909[_0x4122('0x24')]:_0x192e77['offset']+_0x192e77['limit'];var _0x586105;if(_0x42374d>=_0x3ec4d3){_0x42374d=_0x3ec4d3;_0x586105=0xc8;}else{_0x586105=0xce;}_0x3c674e[_0x4122('0x1f')](_0x586105);return _0x3c674e[_0x4122('0x25')](_0x4122('0x26'),_0x4636ae+'-'+_0x42374d+'/'+_0x3ec4d3)[_0x4122('0x21')](_0x359909);}return null;};}function patchUpdates(_0xef6995){return function(_0xb0a7d){try{jsonpatch[_0x4122('0x27')](_0xb0a7d,_0xef6995,!![]);}catch(_0x46b24e){return BPromise['reject'](_0x46b24e);}return _0xb0a7d[_0x4122('0x28')]();};}function saveUpdates(_0x50e243,_0x4f949a){return function(_0x508cd7){if(_0x508cd7){return _0x508cd7[_0x4122('0x29')](_0x50e243)[_0x4122('0x2a')](function(_0x317418){return _0x317418;});}return null;};}function removeEntity(_0x4eb35b,_0x128fde){return function(_0x386cdc){if(_0x386cdc){return _0x386cdc['destroy']()['then'](function(){_0x4eb35b[_0x4122('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db23e,_0x59895d){return function(_0x1b449b){if(!_0x1b449b){_0x4db23e[_0x4122('0x1e')](0x194);}return _0x1b449b;};}function handleError(_0xbb76e1,_0x1bb51b){_0x1bb51b=_0x1bb51b||0x1f4;return function(_0x31568f){logger[_0x4122('0x2b')](_0x31568f[_0x4122('0x2c')]);if(_0x31568f[_0x4122('0x2d')]){delete _0x31568f[_0x4122('0x2d')];}_0xbb76e1[_0x4122('0x1f')](_0x1bb51b)[_0x4122('0x2e')](_0x31568f);};}exports[_0x4122('0x2f')]=function(_0xfefaf6,_0x5f32c5){var _0x2e5bc2={},_0x43c51c={},_0x79c85={'count':0x0,'rows':[]};var _0x31f141=_['map'](db[_0x4122('0x30')]['rawAttributes'],function(_0x3e4eee){return{'name':_0x3e4eee[_0x4122('0x31')],'type':_0x3e4eee[_0x4122('0x32')][_0x4122('0x33')]};});_0x43c51c[_0x4122('0x34')]=_[_0x4122('0x35')](_0x31f141,_0x4122('0x2d'));_0x43c51c[_0x4122('0x36')]=_['keys'](_0xfefaf6[_0x4122('0x36')]);_0x43c51c[_0x4122('0x37')]=_['intersection'](_0x43c51c[_0x4122('0x34')],_0x43c51c[_0x4122('0x36')]);_0x2e5bc2[_0x4122('0x38')]=_[_0x4122('0x39')](_0x43c51c['model'],qs[_0x4122('0x3a')](_0xfefaf6[_0x4122('0x36')]['fields']));_0x2e5bc2['attributes']=_0x2e5bc2[_0x4122('0x38')]['length']?_0x2e5bc2[_0x4122('0x38')]:_0x43c51c[_0x4122('0x34')];if(!_0xfefaf6['query'][_0x4122('0x3b')](_0x4122('0x3c'))){_0x2e5bc2[_0x4122('0x3d')]=qs['limit'](_0xfefaf6[_0x4122('0x36')]['limit']);_0x2e5bc2[_0x4122('0x22')]=qs[_0x4122('0x22')](_0xfefaf6[_0x4122('0x36')]['offset']);}_0x2e5bc2[_0x4122('0x3e')]=qs['sort'](_0xfefaf6[_0x4122('0x36')][_0x4122('0x3f')]);_0x2e5bc2['where']=qs['filters'](_['pick'](_0xfefaf6[_0x4122('0x36')],_0x43c51c['filters']),_0x31f141);if(_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]){_0x2e5bc2[_0x4122('0x41')]=_[_0x4122('0x42')](_0x2e5bc2[_0x4122('0x41')],{'$or':_['map'](_0x31f141,function(_0x5c20ec){if(_0x5c20ec[_0x4122('0x32')]!=='VIRTUAL'){var _0xf4ab54={};_0xf4ab54[_0x5c20ec['name']]={'$like':'%'+_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]+'%'};return _0xf4ab54;}})});}_0x2e5bc2=_['merge']({},_0x2e5bc2,_0xfefaf6[_0x4122('0x43')]);var _0x2b7d56={'where':_0x2e5bc2[_0x4122('0x41')]};return db[_0x4122('0x30')][_0x4122('0x24')](_0x2b7d56)[_0x4122('0x2a')](function(_0x5b8fe2){_0x79c85[_0x4122('0x24')]=_0x5b8fe2;if(_0xfefaf6['query'][_0x4122('0x44')]){_0x2e5bc2['include']=[{'all':!![]}];}return db[_0x4122('0x30')][_0x4122('0x45')](_0x2e5bc2);})[_0x4122('0x2a')](function(_0x469fdd){_0x79c85[_0x4122('0x46')]=_0x469fdd;return _0x79c85;})['then'](respondWithFilteredResult(_0x5f32c5,_0x2e5bc2))[_0x4122('0x47')](handleError(_0x5f32c5,null));};exports[_0x4122('0x48')]=function(_0x59ed80,_0x589b39){var _0x5853ae={'raw':!![],'where':{'id':_0x59ed80[_0x4122('0x49')]['id']}},_0x297937={};_0x297937[_0x4122('0x34')]=_[_0x4122('0x4a')](db[_0x4122('0x30')][_0x4122('0x4b')]);_0x297937[_0x4122('0x36')]=_[_0x4122('0x4a')](_0x59ed80[_0x4122('0x36')]);_0x297937['filters']=_[_0x4122('0x39')](_0x297937['model'],_0x297937['query']);_0x5853ae[_0x4122('0x38')]=_[_0x4122('0x39')](_0x297937[_0x4122('0x34')],qs['fields'](_0x59ed80[_0x4122('0x36')][_0x4122('0x3a')]));_0x5853ae['attributes']=_0x5853ae[_0x4122('0x38')][_0x4122('0x4c')]?_0x5853ae[_0x4122('0x38')]:_0x297937[_0x4122('0x34')];if(_0x59ed80['query'][_0x4122('0x44')]){_0x5853ae[_0x4122('0x4d')]=[{'all':!![]}];}_0x5853ae=_[_0x4122('0x42')]({},_0x5853ae,_0x59ed80[_0x4122('0x43')]);return db[_0x4122('0x30')]['find'](_0x5853ae)['then'](handleEntityNotFound(_0x589b39,null))[_0x4122('0x2a')](respondWithResult(_0x589b39,null))[_0x4122('0x47')](handleError(_0x589b39,null));};exports[_0x4122('0x4e')]=function(_0x13cc1d,_0x144d4c){return db['Cdr'][_0x4122('0x4e')](_0x13cc1d[_0x4122('0x4f')],{})[_0x4122('0x2a')](respondWithResult(_0x144d4c,0xc9))['catch'](handleError(_0x144d4c,null));};exports[_0x4122('0x29')]=function(_0x53f7d9,_0x39515c){if(_0x53f7d9[_0x4122('0x4f')]['id']){delete _0x53f7d9[_0x4122('0x4f')]['id'];}return db[_0x4122('0x30')]['find']({'where':{'id':_0x53f7d9['params']['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x39515c,null))[_0x4122('0x2a')](saveUpdates(_0x53f7d9[_0x4122('0x4f')],null))[_0x4122('0x2a')](respondWithResult(_0x39515c,null))['catch'](handleError(_0x39515c,null));};exports[_0x4122('0x50')]=function(_0x5678ff,_0x376782){return db['Cdr'][_0x4122('0x51')]({'where':{'id':_0x5678ff[_0x4122('0x49')]['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x376782,null))[_0x4122('0x2a')](removeEntity(_0x376782,null))[_0x4122('0x47')](handleError(_0x376782,null));};exports[_0x4122('0x52')]=function(_0x4fb7ac,_0xf265ed){return db['Cdr'][_0x4122('0x52')]()[_0x4122('0x2a')](respondWithResult(_0xf265ed,null))[_0x4122('0x47')](handleError(_0xf265ed,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index af886f5..5f3ae78 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(_0x2ffd4a,_0x4ce2b3){var _0x58146e=function(_0x50191f){while(--_0x50191f){_0x2ffd4a['push'](_0x2ffd4a['shift']());}};_0x58146e(++_0x4ce2b3);}(_0x7a54,0x106));var _0x47a5=function(_0x36865c,_0x1ed4a5){_0x36865c=_0x36865c-0x0;var _0x4940f5=_0x7a54[_0x36865c];return _0x4940f5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5df738,_0x3d47b8){var _0x5e6f49=function(_0x4ad376){while(--_0x4ad376){_0x5df738['push'](_0x5df738['shift']());}};_0x5e6f49(++_0x3d47b8);}(_0x7a54,0x106));var _0x47a5=function(_0x157f9,_0x455a2a){_0x157f9=_0x157f9-0x0;var _0x393c99=_0x7a54[_0x157f9];return _0x393c99;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index cfbbd4f..b18ed9b 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 _0xce8f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1aca78,_0x21c237){var _0x2712e7=function(_0x2f1a5f){while(--_0x2f1a5f){_0x1aca78['push'](_0x1aca78['shift']());}};_0x2712e7(++_0x21c237);}(_0xce8f,0x16b));var _0xfce8=function(_0x528db,_0x31f893){_0x528db=_0x528db-0x0;var _0x5365aa=_0xce8f[_0x528db];return _0x5365aa;};'use strict';var _=require('lodash');var util=require(_0xfce8('0x0'));var moment=require(_0xfce8('0x1'));var BPromise=require(_0xfce8('0x2'));var rs=require(_0xfce8('0x3'));var fs=require('fs');var Redis=require(_0xfce8('0x4'));var db=require(_0xfce8('0x5'))['db'];var utils=require(_0xfce8('0x6'));var logger=require(_0xfce8('0x7'))('rpc');var config=require(_0xfce8('0x8'));var jayson=require(_0xfce8('0x9'));var client=jayson['client'][_0xfce8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x88c1be,_0x326962,_0x47c7c9){return new BPromise(function(_0x74c2ac,_0x588e49){return client[_0xfce8('0xb')](_0x88c1be,_0x47c7c9)[_0xfce8('0xc')](function(_0x1eb534){logger[_0xfce8('0xd')](_0xfce8('0xe'),_0x326962,'request\x20sent');logger[_0xfce8('0xf')](_0xfce8('0x10'),_0x326962,'request\x20sent',JSON['stringify'](_0x1eb534));if(_0x1eb534[_0xfce8('0x11')]){if(_0x1eb534[_0xfce8('0x11')][_0xfce8('0x12')]===0x1f4){logger['error'](_0xfce8('0xe'),_0x326962,_0x1eb534[_0xfce8('0x11')][_0xfce8('0x13')]);return _0x588e49(_0x1eb534['error'][_0xfce8('0x13')]);}logger[_0xfce8('0x11')](_0xfce8('0xe'),_0x326962,_0x1eb534[_0xfce8('0x11')]['message']);return _0x74c2ac(_0x1eb534[_0xfce8('0x11')][_0xfce8('0x13')]);}else{logger[_0xfce8('0xd')](_0xfce8('0xe'),_0x326962,_0xfce8('0x14'));_0x74c2ac(_0x1eb534[_0xfce8('0x15')]['message']);}})[_0xfce8('0x16')](function(_0x44295e){logger[_0xfce8('0x11')](_0xfce8('0xe'),_0x326962,_0x44295e);_0x588e49(_0x44295e);});});} \ No newline at end of file +var _0x6fe8=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1db5ee,_0xb7bb54){var _0x3c9a67=function(_0xc9bae1){while(--_0xc9bae1){_0x1db5ee['push'](_0x1db5ee['shift']());}};_0x3c9a67(++_0xb7bb54);}(_0x6fe8,0xcc));var _0x86fe=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x6fe8[_0x20ef64];return _0x3707d8;};'use strict';var _=require('lodash');var util=require(_0x86fe('0x0'));var moment=require(_0x86fe('0x1'));var BPromise=require(_0x86fe('0x2'));var rs=require(_0x86fe('0x3'));var fs=require('fs');var Redis=require(_0x86fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x86fe('0x5'));var logger=require('../../config/logger')(_0x86fe('0x6'));var config=require(_0x86fe('0x7'));var jayson=require(_0x86fe('0x8'));var client=jayson[_0x86fe('0x9')][_0x86fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a8f50,_0x21ac3e,_0x49a0d2){return new BPromise(function(_0xb5def2,_0x4b8937){return client[_0x86fe('0xb')](_0x2a8f50,_0x49a0d2)['then'](function(_0x13c60f){logger[_0x86fe('0xc')](_0x86fe('0xd'),_0x21ac3e,_0x86fe('0xe'));logger[_0x86fe('0xf')](_0x86fe('0x10'),_0x21ac3e,_0x86fe('0xe'),JSON[_0x86fe('0x11')](_0x13c60f));if(_0x13c60f[_0x86fe('0x12')]){if(_0x13c60f[_0x86fe('0x12')]['code']===0x1f4){logger[_0x86fe('0x12')](_0x86fe('0xd'),_0x21ac3e,_0x13c60f['error'][_0x86fe('0x13')]);return _0x4b8937(_0x13c60f[_0x86fe('0x12')]['message']);}logger[_0x86fe('0x12')](_0x86fe('0xd'),_0x21ac3e,_0x13c60f['error'][_0x86fe('0x13')]);return _0xb5def2(_0x13c60f[_0x86fe('0x12')][_0x86fe('0x13')]);}else{logger[_0x86fe('0xc')](_0x86fe('0xd'),_0x21ac3e,_0x86fe('0xe'));_0xb5def2(_0x13c60f[_0x86fe('0x14')][_0x86fe('0x13')]);}})[_0x86fe('0x15')](function(_0x1a75aa){logger[_0x86fe('0x12')](_0x86fe('0xd'),_0x21ac3e,_0x1a75aa);_0x4b8937(_0x1a75aa);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 5d44847..c637720 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(_0xb14376,_0x5b0bf2){var _0x232f52=function(_0x29342e){while(--_0x29342e){_0xb14376['push'](_0xb14376['shift']());}};_0x232f52(++_0x5b0bf2);}(_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('./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(_0x5dcca6,_0x1672e8){var _0x178cae=function(_0x3f2ef0){while(--_0x3f2ef0){_0x5dcca6['push'](_0x5dcca6['shift']());}};_0x178cae(++_0x1672e8);}(_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('./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 0b217af..dc3c5df 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 _0x0a88=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x149df7,_0x57d5cb){var _0x309d90=function(_0x46d633){while(--_0x46d633){_0x149df7['push'](_0x149df7['shift']());}};_0x309d90(++_0x57d5cb);}(_0x0a88,0xd2));var _0x80a8=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0x0a88[_0x3074f3];return _0x53f112;};'use strict';var Sequelize=require('sequelize');module[_0x80a8('0x0')]={'priority':{'type':Sequelize[_0x80a8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x80a8('0x2')],'allowNull':![],'defaultValue':_0x80a8('0x3')},'appdata':{'type':Sequelize[_0x80a8('0x4')]()},'description':{'type':Sequelize[_0x80a8('0x2')]},'interval':{'type':Sequelize[_0x80a8('0x2')],'defaultValue':_0x80a8('0x5')}}; \ No newline at end of file +var _0xd73c=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd73c,0xd9));var _0xcd73=function(_0x2c35f8,_0x5d3e82){_0x2c35f8=_0x2c35f8-0x0;var _0x52729b=_0xd73c[_0x2c35f8];return _0x52729b;};'use strict';var Sequelize=require('sequelize');module[_0xcd73('0x0')]={'priority':{'type':Sequelize[_0xcd73('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcd73('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcd73('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcd73('0x2')],'defaultValue':_0xcd73('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 39fe90e..808652f 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 _0x2948=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','update','then','destroy','stack','name','model','keys','ChatApplication','query','intersection','attributes','fields','length','includeAll','include','merge','find','body','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4b5be2,_0x3e22a3){var _0x25c2a8=function(_0x6b4d1e){while(--_0x6b4d1e){_0x4b5be2['push'](_0x4b5be2['shift']());}};_0x25c2a8(++_0x3e22a3);}(_0x2948,0xcb));var _0x8294=function(_0x55f316,_0x39b21a){_0x55f316=_0x55f316-0x0;var _0x231040=_0x2948[_0x55f316];return _0x231040;};'use strict';var emlformat=require(_0x8294('0x0'));var rimraf=require(_0x8294('0x1'));var zipdir=require(_0x8294('0x2'));var jsonpatch=require(_0x8294('0x3'));var rp=require(_0x8294('0x4'));var moment=require(_0x8294('0x5'));var BPromise=require(_0x8294('0x6'));var Mustache=require(_0x8294('0x7'));var util=require(_0x8294('0x8'));var path=require('path');var sox=require(_0x8294('0x9'));var csv=require('to-csv');var ejs=require(_0x8294('0xa'));var fs=require('fs');var fs_extra=require(_0x8294('0xb'));var _=require(_0x8294('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8294('0xd'));var querystring=require(_0x8294('0xe'));var Papa=require('papaparse');var Redis=require(_0x8294('0xf'));var authService=require(_0x8294('0x10'));var qs=require(_0x8294('0x11'));var as=require(_0x8294('0x12'));var hardwareService=require(_0x8294('0x13'));var logger=require(_0x8294('0x14'))('api');var utils=require(_0x8294('0x15'));var config=require(_0x8294('0x16'));var licenseUtil=require(_0x8294('0x17'));var db=require(_0x8294('0x18'))['db'];function respondWithStatusCode(_0x3a13f4,_0x29f1c6){_0x29f1c6=_0x29f1c6||0xcc;return function(_0x71e347){if(_0x71e347){return _0x3a13f4[_0x8294('0x19')](_0x29f1c6);}return _0x3a13f4['status'](_0x29f1c6)[_0x8294('0x1a')]();};}function respondWithResult(_0xde307c,_0x3041ce){_0x3041ce=_0x3041ce||0xc8;return function(_0x552a87){if(_0x552a87){return _0xde307c['status'](_0x3041ce)['json'](_0x552a87);}};}function respondWithFilteredResult(_0x19295d,_0x1bccf6){return function(_0x25c9ae){if(_0x25c9ae){var _0x2ca14b=typeof _0x1bccf6[_0x8294('0x1b')]===_0x8294('0x1c')&&typeof _0x1bccf6[_0x8294('0x1d')]===_0x8294('0x1c');var _0xf93bde=_0x25c9ae[_0x8294('0x1e')];var _0x3d194a=_0x2ca14b?0x0:_0x1bccf6['offset'];var _0x40175a=_0x2ca14b?_0x25c9ae['count']:_0x1bccf6[_0x8294('0x1b')]+_0x1bccf6[_0x8294('0x1d')];var _0x256be3;if(_0x40175a>=_0xf93bde){_0x40175a=_0xf93bde;_0x256be3=0xc8;}else{_0x256be3=0xce;}_0x19295d[_0x8294('0x1f')](_0x256be3);return _0x19295d[_0x8294('0x20')](_0x8294('0x21'),_0x3d194a+'-'+_0x40175a+'/'+_0xf93bde)[_0x8294('0x22')](_0x25c9ae);}return null;};}function patchUpdates(_0x27273d){return function(_0x318fd3){try{jsonpatch['apply'](_0x318fd3,_0x27273d,!![]);}catch(_0x24ea70){return BPromise[_0x8294('0x23')](_0x24ea70);}return _0x318fd3['save']();};}function saveUpdates(_0x1e5d1e,_0x140666){return function(_0xc0eed4){if(_0xc0eed4){return _0xc0eed4[_0x8294('0x24')](_0x1e5d1e)[_0x8294('0x25')](function(_0x3a36af){return _0x3a36af;});}return null;};}function removeEntity(_0x2b6935,_0xff5d69){return function(_0x3aa9f6){if(_0x3aa9f6){return _0x3aa9f6[_0x8294('0x26')]()[_0x8294('0x25')](function(){_0x2b6935['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2b6a,_0x557529){return function(_0x83f0c4){if(!_0x83f0c4){_0x2d2b6a['sendStatus'](0x194);}return _0x83f0c4;};}function handleError(_0x591b94,_0x37601e){_0x37601e=_0x37601e||0x1f4;return function(_0x399c9d){logger['error'](_0x399c9d[_0x8294('0x27')]);if(_0x399c9d[_0x8294('0x28')]){delete _0x399c9d[_0x8294('0x28')];}_0x591b94[_0x8294('0x1f')](_0x37601e)['send'](_0x399c9d);};}exports['show']=function(_0x311e6b,_0x2d6312){var _0x3ae908={'raw':!![],'where':{'id':_0x311e6b['params']['id']}},_0x4fa43c={};_0x4fa43c[_0x8294('0x29')]=_[_0x8294('0x2a')](db[_0x8294('0x2b')]['rawAttributes']);_0x4fa43c['query']=_[_0x8294('0x2a')](_0x311e6b[_0x8294('0x2c')]);_0x4fa43c['filters']=_[_0x8294('0x2d')](_0x4fa43c[_0x8294('0x29')],_0x4fa43c['query']);_0x3ae908[_0x8294('0x2e')]=_['intersection'](_0x4fa43c[_0x8294('0x29')],qs['fields'](_0x311e6b[_0x8294('0x2c')][_0x8294('0x2f')]));_0x3ae908[_0x8294('0x2e')]=_0x3ae908[_0x8294('0x2e')][_0x8294('0x30')]?_0x3ae908[_0x8294('0x2e')]:_0x4fa43c[_0x8294('0x29')];if(_0x311e6b['query'][_0x8294('0x31')]){_0x3ae908[_0x8294('0x32')]=[{'all':!![]}];}_0x3ae908=_[_0x8294('0x33')]({},_0x3ae908,_0x311e6b['options']);return db[_0x8294('0x2b')][_0x8294('0x34')](_0x3ae908)[_0x8294('0x25')](handleEntityNotFound(_0x2d6312,null))['then'](respondWithResult(_0x2d6312,null))['catch'](handleError(_0x2d6312,null));};exports[_0x8294('0x24')]=function(_0x35a80d,_0x1f60f3){if(_0x35a80d[_0x8294('0x35')]['id']){delete _0x35a80d[_0x8294('0x35')]['id'];}return db[_0x8294('0x2b')][_0x8294('0x34')]({'where':{'id':_0x35a80d[_0x8294('0x36')]['id']}})[_0x8294('0x25')](handleEntityNotFound(_0x1f60f3,null))['then'](saveUpdates(_0x35a80d[_0x8294('0x35')],null))[_0x8294('0x25')](respondWithResult(_0x1f60f3,null))['catch'](handleError(_0x1f60f3,null));};exports[_0x8294('0x26')]=function(_0x8ad38c,_0x1f2b33){return db[_0x8294('0x2b')]['find']({'where':{'id':_0x8ad38c[_0x8294('0x36')]['id']}})[_0x8294('0x25')](handleEntityNotFound(_0x1f2b33,null))[_0x8294('0x25')](removeEntity(_0x1f2b33,null))[_0x8294('0x37')](handleError(_0x1f2b33,null));}; \ No newline at end of file +var _0xe43c=['ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','show','params','model','ChatApplication','rawAttributes','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse'];(function(_0x1664ab,_0xb97955){var _0x588542=function(_0x56b536){while(--_0x56b536){_0x1664ab['push'](_0x1664ab['shift']());}};_0x588542(++_0xb97955);}(_0xe43c,0x180));var _0xce43=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe43c[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xce43('0x0'));var rimraf=require(_0xce43('0x1'));var zipdir=require(_0xce43('0x2'));var jsonpatch=require(_0xce43('0x3'));var rp=require(_0xce43('0x4'));var moment=require(_0xce43('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xce43('0x6'));var util=require('util');var path=require(_0xce43('0x7'));var sox=require(_0xce43('0x8'));var csv=require(_0xce43('0x9'));var ejs=require(_0xce43('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce43('0xb'));var squel=require('squel');var crypto=require(_0xce43('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xce43('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xce43('0xe'));var Redis=require(_0xce43('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce43('0x10'));var logger=require('../../config/logger')(_0xce43('0x11'));var utils=require('../../config/utils');var config=require(_0xce43('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xce43('0x13'))['db'];function respondWithStatusCode(_0x193861,_0x4c092b){_0x4c092b=_0x4c092b||0xcc;return function(_0x226f21){if(_0x226f21){return _0x193861[_0xce43('0x14')](_0x4c092b);}return _0x193861[_0xce43('0x15')](_0x4c092b)[_0xce43('0x16')]();};}function respondWithResult(_0x4b7970,_0x3034c7){_0x3034c7=_0x3034c7||0xc8;return function(_0x607d92){if(_0x607d92){return _0x4b7970[_0xce43('0x15')](_0x3034c7)[_0xce43('0x17')](_0x607d92);}};}function respondWithFilteredResult(_0x4cb58a,_0x588ddb){return function(_0x3c0948){if(_0x3c0948){var _0x3e4218=typeof _0x588ddb[_0xce43('0x18')]===_0xce43('0x19')&&typeof _0x588ddb[_0xce43('0x1a')]===_0xce43('0x19');var _0x4e166b=_0x3c0948[_0xce43('0x1b')];var _0xbe5b91=_0x3e4218?0x0:_0x588ddb[_0xce43('0x18')];var _0x4444d7=_0x3e4218?_0x3c0948['count']:_0x588ddb[_0xce43('0x18')]+_0x588ddb[_0xce43('0x1a')];var _0x1976eb;if(_0x4444d7>=_0x4e166b){_0x4444d7=_0x4e166b;_0x1976eb=0xc8;}else{_0x1976eb=0xce;}_0x4cb58a[_0xce43('0x15')](_0x1976eb);return _0x4cb58a[_0xce43('0x1c')](_0xce43('0x1d'),_0xbe5b91+'-'+_0x4444d7+'/'+_0x4e166b)['json'](_0x3c0948);}return null;};}function patchUpdates(_0x5bd459){return function(_0x383f69){try{jsonpatch['apply'](_0x383f69,_0x5bd459,!![]);}catch(_0xe2ff3f){return BPromise[_0xce43('0x1e')](_0xe2ff3f);}return _0x383f69[_0xce43('0x1f')]();};}function saveUpdates(_0x5a5bd1,_0x57dcd4){return function(_0x37b34e){if(_0x37b34e){return _0x37b34e[_0xce43('0x20')](_0x5a5bd1)[_0xce43('0x21')](function(_0x78c925){return _0x78c925;});}return null;};}function removeEntity(_0x2d8f7d,_0x2b9874){return function(_0x118a89){if(_0x118a89){return _0x118a89['destroy']()[_0xce43('0x21')](function(){_0x2d8f7d[_0xce43('0x15')](0xcc)[_0xce43('0x16')]();});}};}function handleEntityNotFound(_0x2ae225,_0x48a448){return function(_0x11d60b){if(!_0x11d60b){_0x2ae225[_0xce43('0x14')](0x194);}return _0x11d60b;};}function handleError(_0x117ac1,_0x1bb63f){_0x1bb63f=_0x1bb63f||0x1f4;return function(_0x802b0d){logger[_0xce43('0x22')](_0x802b0d['stack']);if(_0x802b0d[_0xce43('0x23')]){delete _0x802b0d['name'];}_0x117ac1[_0xce43('0x15')](_0x1bb63f)[_0xce43('0x24')](_0x802b0d);};}exports[_0xce43('0x25')]=function(_0x167d5d,_0x536452){var _0xb6527c={'raw':!![],'where':{'id':_0x167d5d[_0xce43('0x26')]['id']}},_0x4402f8={};_0x4402f8[_0xce43('0x27')]=_['keys'](db[_0xce43('0x28')][_0xce43('0x29')]);_0x4402f8['query']=_[_0xce43('0x2a')](_0x167d5d[_0xce43('0x2b')]);_0x4402f8[_0xce43('0x2c')]=_[_0xce43('0x2d')](_0x4402f8[_0xce43('0x27')],_0x4402f8[_0xce43('0x2b')]);_0xb6527c['attributes']=_['intersection'](_0x4402f8[_0xce43('0x27')],qs[_0xce43('0x2e')](_0x167d5d['query'][_0xce43('0x2e')]));_0xb6527c[_0xce43('0x2f')]=_0xb6527c[_0xce43('0x2f')][_0xce43('0x30')]?_0xb6527c[_0xce43('0x2f')]:_0x4402f8['model'];if(_0x167d5d[_0xce43('0x2b')][_0xce43('0x31')]){_0xb6527c[_0xce43('0x32')]=[{'all':!![]}];}_0xb6527c=_[_0xce43('0x33')]({},_0xb6527c,_0x167d5d[_0xce43('0x34')]);return db[_0xce43('0x28')][_0xce43('0x35')](_0xb6527c)[_0xce43('0x21')](handleEntityNotFound(_0x536452,null))[_0xce43('0x21')](respondWithResult(_0x536452,null))[_0xce43('0x36')](handleError(_0x536452,null));};exports[_0xce43('0x20')]=function(_0x391e41,_0x439796){if(_0x391e41[_0xce43('0x37')]['id']){delete _0x391e41[_0xce43('0x37')]['id'];}return db[_0xce43('0x28')][_0xce43('0x35')]({'where':{'id':_0x391e41[_0xce43('0x26')]['id']}})['then'](handleEntityNotFound(_0x439796,null))[_0xce43('0x21')](saveUpdates(_0x391e41[_0xce43('0x37')],null))[_0xce43('0x21')](respondWithResult(_0x439796,null))[_0xce43('0x36')](handleError(_0x439796,null));};exports[_0xce43('0x38')]=function(_0x381fec,_0x4a96ae){return db[_0xce43('0x28')][_0xce43('0x35')]({'where':{'id':_0x381fec[_0xce43('0x26')]['id']}})[_0xce43('0x21')](handleEntityNotFound(_0x4a96ae,null))[_0xce43('0x21')](removeEntity(_0x4a96ae,null))['catch'](handleError(_0x4a96ae,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 2afeb9d..7cddf22 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 _0x6a39=['exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x397b40,_0x511296){var _0x36b866=function(_0x458149){while(--_0x458149){_0x397b40['push'](_0x397b40['shift']());}};_0x36b866(++_0x511296);}(_0x6a39,0x140));var _0x96a3=function(_0x188cc8,_0xd39746){_0x188cc8=_0x188cc8-0x0;var _0x4cb155=_0x6a39[_0x188cc8];return _0x4cb155;};'use strict';var _=require(_0x96a3('0x0'));var util=require(_0x96a3('0x1'));var logger=require(_0x96a3('0x2'))(_0x96a3('0x3'));var moment=require(_0x96a3('0x4'));var BPromise=require(_0x96a3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96a3('0x6'));var rimraf=require(_0x96a3('0x7'));var config=require(_0x96a3('0x8'));var attributes=require(_0x96a3('0x9'));module[_0x96a3('0xa')]=function(_0x21f936,_0x2174a1){return _0x21f936[_0x96a3('0xb')](_0x96a3('0xc'),attributes,{'tableName':_0x96a3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x96a3('0xe')});}; \ No newline at end of file +var _0xc4c2=['define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','../../config/environment','./chatApplication.attributes','exports'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0xc4c2,0x155));var _0x2c4c=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc4c2[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x2c4c('0x0'));var util=require(_0x2c4c('0x1'));var logger=require('../../config/logger')(_0x2c4c('0x2'));var moment=require(_0x2c4c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2c4c('0x4'));var attributes=require(_0x2c4c('0x5'));module[_0x2c4c('0x6')]=function(_0x3a60d5,_0x12e557){return _0x3a60d5[_0x2c4c('0x7')](_0x2c4c('0x8'),attributes,{'tableName':_0x2c4c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2c4c('0xa'),'collate':_0x2c4c('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 73f4d66..34378c4 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 _0x6169=['../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x30945b,_0x225f4b){var _0x796d92=function(_0x537b3f){while(--_0x537b3f){_0x30945b['push'](_0x30945b['shift']());}};_0x796d92(++_0x225f4b);}(_0x6169,0x84));var _0x9616=function(_0x31cb75,_0xdbf4e6){_0x31cb75=_0x31cb75-0x0;var _0x371fb7=_0x6169[_0x31cb75];return _0x371fb7;};'use strict';var _=require(_0x9616('0x0'));var util=require(_0x9616('0x1'));var moment=require(_0x9616('0x2'));var BPromise=require(_0x9616('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9616('0x4'));var db=require(_0x9616('0x5'))['db'];var utils=require(_0x9616('0x6'));var logger=require('../../config/logger')(_0x9616('0x7'));var config=require(_0x9616('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9616('0x9')][_0x9616('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a448c,_0x4db8a2,_0x456f95){return new BPromise(function(_0x182a5f,_0x41de06){return client[_0x9616('0xb')](_0x2a448c,_0x456f95)[_0x9616('0xc')](function(_0x16f6cb){logger['info']('ChatApplication,\x20%s,\x20%s',_0x4db8a2,_0x9616('0xd'));logger[_0x9616('0xe')](_0x9616('0xf'),_0x4db8a2,_0x9616('0xd'),JSON[_0x9616('0x10')](_0x16f6cb));if(_0x16f6cb[_0x9616('0x11')]){if(_0x16f6cb[_0x9616('0x11')]['code']===0x1f4){logger[_0x9616('0x11')](_0x9616('0x12'),_0x4db8a2,_0x16f6cb['error']['message']);return _0x41de06(_0x16f6cb[_0x9616('0x11')]['message']);}logger[_0x9616('0x11')](_0x9616('0x12'),_0x4db8a2,_0x16f6cb[_0x9616('0x11')][_0x9616('0x13')]);return _0x182a5f(_0x16f6cb[_0x9616('0x11')][_0x9616('0x13')]);}else{logger[_0x9616('0x14')](_0x9616('0x12'),_0x4db8a2,_0x9616('0xd'));_0x182a5f(_0x16f6cb[_0x9616('0x15')][_0x9616('0x13')]);}})[_0x9616('0x16')](function(_0x5b1f29){logger['error'](_0x9616('0x12'),_0x4db8a2,_0x5b1f29);_0x41de06(_0x5b1f29);});});} \ No newline at end of file +var _0xe352=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatApplication,\x20%s,\x20%s','catch','util','moment','randomstring'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xe352,0x107));var _0x2e35=function(_0x495437,_0x530d35){_0x495437=_0x495437-0x0;var _0x428ba6=_0xe352[_0x495437];return _0x428ba6;};'use strict';var _=require('lodash');var util=require(_0x2e35('0x0'));var moment=require(_0x2e35('0x1'));var BPromise=require('bluebird');var rs=require(_0x2e35('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e35('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e35('0x4'))('rpc');var config=require(_0x2e35('0x5'));var jayson=require(_0x2e35('0x6'));var client=jayson[_0x2e35('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0aca,_0x4812b1,_0x3f4c1f){return new BPromise(function(_0x17e2de,_0x1cceb3){return client[_0x2e35('0x8')](_0x4e0aca,_0x3f4c1f)[_0x2e35('0x9')](function(_0x1730d6){logger[_0x2e35('0xa')]('ChatApplication,\x20%s,\x20%s',_0x4812b1,_0x2e35('0xb'));logger[_0x2e35('0xc')](_0x2e35('0xd'),_0x4812b1,_0x2e35('0xb'),JSON[_0x2e35('0xe')](_0x1730d6));if(_0x1730d6[_0x2e35('0xf')]){if(_0x1730d6['error']['code']===0x1f4){logger[_0x2e35('0xf')]('ChatApplication,\x20%s,\x20%s',_0x4812b1,_0x1730d6[_0x2e35('0xf')]['message']);return _0x1cceb3(_0x1730d6[_0x2e35('0xf')][_0x2e35('0x10')]);}logger[_0x2e35('0xf')](_0x2e35('0x11'),_0x4812b1,_0x1730d6[_0x2e35('0xf')][_0x2e35('0x10')]);return _0x17e2de(_0x1730d6[_0x2e35('0xf')]['message']);}else{logger[_0x2e35('0xa')]('ChatApplication,\x20%s,\x20%s',_0x4812b1,_0x2e35('0xb'));_0x17e2de(_0x1730d6['result'][_0x2e35('0x10')]);}})[_0x2e35('0x12')](function(_0x3b684d){logger[_0x2e35('0xf')](_0x2e35('0x11'),_0x4812b1,_0x3b684d);_0x1cceb3(_0x3b684d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2fae508..04e763a 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 _0x5b2a=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','exports','multer','util','path'];(function(_0xe0488c,_0x5b86e1){var _0x296757=function(_0x47934f){while(--_0x47934f){_0xe0488c['push'](_0xe0488c['shift']());}};_0x296757(++_0x5b86e1);}(_0x5b2a,0xed));var _0xa5b2=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0x5b2a[_0x515283];return _0x38f836;};'use strict';var multer=require(_0xa5b2('0x0'));var util=require(_0xa5b2('0x1'));var path=require(_0xa5b2('0x2'));var timeout=require(_0xa5b2('0x3'));var express=require(_0xa5b2('0x4'));var router=express['Router']();var fs_extra=require(_0xa5b2('0x5'));var auth=require(_0xa5b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa5b2('0x7'));var controller=require(_0xa5b2('0x8'));router[_0xa5b2('0x9')](_0xa5b2('0xa'),auth[_0xa5b2('0xb')](),controller[_0xa5b2('0xc')]);router[_0xa5b2('0xd')](_0xa5b2('0xa'),auth[_0xa5b2('0xb')](),controller['update']);router['delete'](_0xa5b2('0xa'),auth[_0xa5b2('0xb')](),controller['destroy']);module[_0xa5b2('0xe')]=router; \ No newline at end of file +var _0xcf51=['Router','fs-extra','./chatApplication.controller','get','/:id','show','isAuthenticated','update','delete','destroy','exports','multer','util','path','express'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcf51,0x92));var _0x1cf5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf51[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1cf5('0x0'));var util=require(_0x1cf5('0x1'));var path=require(_0x1cf5('0x2'));var timeout=require('connect-timeout');var express=require(_0x1cf5('0x3'));var router=express[_0x1cf5('0x4')]();var fs_extra=require(_0x1cf5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1cf5('0x6'));router[_0x1cf5('0x7')](_0x1cf5('0x8'),auth['isAuthenticated'](),controller[_0x1cf5('0x9')]);router['put']('/:id',auth[_0x1cf5('0xa')](),controller[_0x1cf5('0xb')]);router[_0x1cf5('0xc')](_0x1cf5('0x8'),auth[_0x1cf5('0xa')](),controller[_0x1cf5('0xd')]);module[_0x1cf5('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 50d25b3..0b7de59 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 _0x5a5a=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x574162,_0x2425ea){_0x574162=_0x574162-0x0;var _0x39c245=_0x5a5a[_0x574162];return _0x39c245;};'use strict';var Sequelize=require('sequelize');module[_0xa5a5('0x0')]={'name':{'type':Sequelize[_0xa5a5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa5a5('0x1')]},'write':{'type':Sequelize[_0xa5a5('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5dcb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x263964,_0x11fd03){var _0x43e569=function(_0x430697){while(--_0x430697){_0x263964['push'](_0x263964['shift']());}};_0x43e569(++_0x11fd03);}(_0x5dcb,0x149));var _0xb5dc=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x5dcb[_0x2d364e];return _0x1b9312;};'use strict';var Sequelize=require(_0xb5dc('0x0'));module[_0xb5dc('0x1')]={'name':{'type':Sequelize[_0xb5dc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb5dc('0x2')]},'write':{'type':Sequelize[_0xb5dc('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 3b0594e..551f3d9 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 _0x8901=['save','update','then','destroy','sendStatus','error','stack','send','index','ChatGroup','rawAttributes','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','rows','catch','show','params','includeAll','include','find','create','body','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','findOne','filter','removeMembers','addMessage','getMessages','$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','count','limit','set','apply','reject'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8901,0x1b3));var _0x1890=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x8901[_0x42f009];return _0x22a1e0;};'use strict';var emlformat=require(_0x1890('0x0'));var rimraf=require(_0x1890('0x1'));var zipdir=require(_0x1890('0x2'));var jsonpatch=require(_0x1890('0x3'));var rp=require(_0x1890('0x4'));var moment=require(_0x1890('0x5'));var BPromise=require(_0x1890('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1890('0x7'));var sox=require('sox');var csv=require(_0x1890('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1890('0x9'));var _=require(_0x1890('0xa'));var squel=require('squel');var crypto=require(_0x1890('0xb'));var jsforce=require(_0x1890('0xc'));var deskjs=require(_0x1890('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1890('0xe'));var Papa=require(_0x1890('0xf'));var Redis=require(_0x1890('0x10'));var authService=require(_0x1890('0x11'));var qs=require(_0x1890('0x12'));var as=require(_0x1890('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1890('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1890('0x15'));var licenseUtil=require(_0x1890('0x16'));var db=require(_0x1890('0x17'))['db'];config[_0x1890('0x18')]=_[_0x1890('0x19')](config[_0x1890('0x18')],{'host':_0x1890('0x1a'),'port':0x18eb});var socket=require(_0x1890('0x1b'))(new Redis(config['redis']));require(_0x1890('0x1c'))[_0x1890('0x1d')](socket);function respondWithStatusCode(_0x2e64bc,_0x46c05f){_0x46c05f=_0x46c05f||0xcc;return function(_0x23e95b){if(_0x23e95b){return _0x2e64bc['sendStatus'](_0x46c05f);}return _0x2e64bc[_0x1890('0x1e')](_0x46c05f)[_0x1890('0x1f')]();};}function respondWithResult(_0x16e687,_0x3268de){_0x3268de=_0x3268de||0xc8;return function(_0x23c4b2){if(_0x23c4b2){return _0x16e687[_0x1890('0x1e')](_0x3268de)[_0x1890('0x20')](_0x23c4b2);}};}function respondWithFilteredResult(_0x1e9acb,_0x274752){return function(_0x472fd3){if(_0x472fd3){var _0x5086ee=typeof _0x274752[_0x1890('0x21')]===_0x1890('0x22')&&typeof _0x274752['limit']===_0x1890('0x22');var _0xe66eed=_0x472fd3[_0x1890('0x23')];var _0x167e71=_0x5086ee?0x0:_0x274752[_0x1890('0x21')];var _0x56edb1=_0x5086ee?_0x472fd3[_0x1890('0x23')]:_0x274752[_0x1890('0x21')]+_0x274752[_0x1890('0x24')];var _0x5112ac;if(_0x56edb1>=_0xe66eed){_0x56edb1=_0xe66eed;_0x5112ac=0xc8;}else{_0x5112ac=0xce;}_0x1e9acb[_0x1890('0x1e')](_0x5112ac);return _0x1e9acb[_0x1890('0x25')]('Content-Range',_0x167e71+'-'+_0x56edb1+'/'+_0xe66eed)[_0x1890('0x20')](_0x472fd3);}return null;};}function patchUpdates(_0x3f95ac){return function(_0x3ea83a){try{jsonpatch[_0x1890('0x26')](_0x3ea83a,_0x3f95ac,!![]);}catch(_0x28d87c){return BPromise[_0x1890('0x27')](_0x28d87c);}return _0x3ea83a[_0x1890('0x28')]();};}function saveUpdates(_0x10dff9,_0x350282){return function(_0x17b620){if(_0x17b620){return _0x17b620[_0x1890('0x29')](_0x10dff9)[_0x1890('0x2a')](function(_0x36c304){return _0x36c304;});}return null;};}function removeEntity(_0xd73d66,_0x310e8b){return function(_0x524267){if(_0x524267){return _0x524267[_0x1890('0x2b')]()[_0x1890('0x2a')](function(){_0xd73d66[_0x1890('0x1e')](0xcc)[_0x1890('0x1f')]();});}};}function handleEntityNotFound(_0x11be8c,_0x3a4934){return function(_0x197c2c){if(!_0x197c2c){_0x11be8c[_0x1890('0x2c')](0x194);}return _0x197c2c;};}function handleError(_0x4f4302,_0x26a1ea){_0x26a1ea=_0x26a1ea||0x1f4;return function(_0x3e1889){logger[_0x1890('0x2d')](_0x3e1889[_0x1890('0x2e')]);if(_0x3e1889['name']){delete _0x3e1889['name'];}_0x4f4302[_0x1890('0x1e')](_0x26a1ea)[_0x1890('0x2f')](_0x3e1889);};}exports[_0x1890('0x30')]=function(_0x2bf707,_0x32b4ef){var _0x1b2a76={},_0x3115f5={},_0x2508b2={'count':0x0,'rows':[]};var _0x1d4d02=_['map'](db[_0x1890('0x31')][_0x1890('0x32')],function(_0x19ecac){return{'name':_0x19ecac['fieldName'],'type':_0x19ecac[_0x1890('0x33')][_0x1890('0x34')]};});_0x3115f5[_0x1890('0x35')]=_[_0x1890('0x36')](_0x1d4d02,_0x1890('0x37'));_0x3115f5['query']=_[_0x1890('0x38')](_0x2bf707[_0x1890('0x39')]);_0x3115f5[_0x1890('0x3a')]=_[_0x1890('0x3b')](_0x3115f5[_0x1890('0x35')],_0x3115f5[_0x1890('0x39')]);_0x1b2a76[_0x1890('0x3c')]=_[_0x1890('0x3b')](_0x3115f5['model'],qs[_0x1890('0x3d')](_0x2bf707[_0x1890('0x39')]['fields']));_0x1b2a76['attributes']=_0x1b2a76['attributes'][_0x1890('0x3e')]?_0x1b2a76[_0x1890('0x3c')]:_0x3115f5[_0x1890('0x35')];if(!_0x2bf707[_0x1890('0x39')][_0x1890('0x3f')](_0x1890('0x40'))){_0x1b2a76[_0x1890('0x24')]=qs[_0x1890('0x24')](_0x2bf707['query'][_0x1890('0x24')]);_0x1b2a76[_0x1890('0x21')]=qs[_0x1890('0x21')](_0x2bf707['query'][_0x1890('0x21')]);}_0x1b2a76[_0x1890('0x41')]=qs[_0x1890('0x42')](_0x2bf707[_0x1890('0x39')][_0x1890('0x42')]);_0x1b2a76[_0x1890('0x43')]=qs['filters'](_[_0x1890('0x44')](_0x2bf707[_0x1890('0x39')],_0x3115f5[_0x1890('0x3a')]),_0x1d4d02);if(_0x2bf707[_0x1890('0x39')]['filter']){_0x1b2a76[_0x1890('0x43')]=_['merge'](_0x1b2a76[_0x1890('0x43')],{'$or':_[_0x1890('0x36')](_0x1d4d02,function(_0x391871){if(_0x391871[_0x1890('0x33')]!==_0x1890('0x45')){var _0x44e0ef={};_0x44e0ef[_0x391871[_0x1890('0x37')]]={'$like':'%'+_0x2bf707[_0x1890('0x39')]['filter']+'%'};return _0x44e0ef;}})});}_0x1b2a76=_[_0x1890('0x46')]({},_0x1b2a76,_0x2bf707[_0x1890('0x47')]);var _0x5758b8={'where':_0x1b2a76['where']};return db[_0x1890('0x31')][_0x1890('0x23')](_0x5758b8)[_0x1890('0x2a')](function(_0x2a0d80){_0x2508b2[_0x1890('0x23')]=_0x2a0d80;if(_0x2bf707[_0x1890('0x39')]['includeAll']){_0x1b2a76['include']=[{'all':!![]}];}return db[_0x1890('0x31')]['findAll'](_0x1b2a76);})[_0x1890('0x2a')](function(_0x41c6be){_0x2508b2[_0x1890('0x48')]=_0x41c6be;return _0x2508b2;})[_0x1890('0x2a')](respondWithFilteredResult(_0x32b4ef,_0x1b2a76))[_0x1890('0x49')](handleError(_0x32b4ef,null));};exports[_0x1890('0x4a')]=function(_0x4e971c,_0x5a0687){var _0x337935={'raw':!![],'where':{'id':_0x4e971c[_0x1890('0x4b')]['id']}},_0x912087={};_0x912087[_0x1890('0x35')]=_[_0x1890('0x38')](db[_0x1890('0x31')][_0x1890('0x32')]);_0x912087[_0x1890('0x39')]=_['keys'](_0x4e971c[_0x1890('0x39')]);_0x912087[_0x1890('0x3a')]=_[_0x1890('0x3b')](_0x912087[_0x1890('0x35')],_0x912087[_0x1890('0x39')]);_0x337935['attributes']=_[_0x1890('0x3b')](_0x912087[_0x1890('0x35')],qs[_0x1890('0x3d')](_0x4e971c['query'][_0x1890('0x3d')]));_0x337935['attributes']=_0x337935[_0x1890('0x3c')][_0x1890('0x3e')]?_0x337935['attributes']:_0x912087['model'];if(_0x4e971c['query'][_0x1890('0x4c')]){_0x337935[_0x1890('0x4d')]=[{'all':!![]}];}_0x337935=_['merge']({},_0x337935,_0x4e971c[_0x1890('0x47')]);return db[_0x1890('0x31')][_0x1890('0x4e')](_0x337935)['then'](handleEntityNotFound(_0x5a0687,null))[_0x1890('0x2a')](respondWithResult(_0x5a0687,null))['catch'](handleError(_0x5a0687,null));};exports[_0x1890('0x4f')]=function(_0x3859f2,_0x50402a){return db[_0x1890('0x31')]['create'](_0x3859f2['body'],{})[_0x1890('0x2a')](respondWithResult(_0x50402a,0xc9))[_0x1890('0x49')](handleError(_0x50402a,null));};exports[_0x1890('0x29')]=function(_0x24aaa2,_0x351197){if(_0x24aaa2[_0x1890('0x50')]['id']){delete _0x24aaa2[_0x1890('0x50')]['id'];}return db[_0x1890('0x31')][_0x1890('0x4e')]({'where':{'id':_0x24aaa2[_0x1890('0x4b')]['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x351197,null))[_0x1890('0x2a')](saveUpdates(_0x24aaa2['body'],null))[_0x1890('0x2a')](respondWithResult(_0x351197,null))[_0x1890('0x49')](handleError(_0x351197,null));};exports[_0x1890('0x2b')]=function(_0x122079,_0x3de606){return db['ChatGroup'][_0x1890('0x4e')]({'where':{'id':_0x122079[_0x1890('0x4b')]['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x3de606,null))['then'](removeEntity(_0x3de606,null))[_0x1890('0x49')](handleError(_0x3de606,null));};exports['describe']=function(_0x416d2d,_0xaeb33e){return db[_0x1890('0x31')]['describe']()[_0x1890('0x2a')](respondWithResult(_0xaeb33e,null))[_0x1890('0x49')](handleError(_0xaeb33e,null));};exports[_0x1890('0x51')]=function(_0x429730,_0x144226,_0x313441){return db[_0x1890('0x52')]['count']({'where':{'ChatGroupId':_0x429730[_0x1890('0x4b')]['id'],'ToId':_0x429730[_0x1890('0x53')]['id'],'read':![]}})[_0x1890('0x2a')](function(_0x3b9611){return{'id':_[_0x1890('0x54')](_0x429730[_0x1890('0x4b')]['id']),'count':_0x3b9611};})[_0x1890('0x2a')](respondWithResult(_0x144226,null))['catch'](handleError(_0x144226,null));};exports[_0x1890('0x55')]=function(_0x1b39a7,_0x570595,_0xdc687e){return db[_0x1890('0x31')][_0x1890('0x4e')]({'where':{'id':_0x1b39a7['params']['id']}})['then'](handleEntityNotFound(_0x570595,null))['then'](function(_0x30d4d5){if(_0x30d4d5){return _0x30d4d5[_0x1890('0x55')](_0x1b39a7[_0x1890('0x50')]['ids'],_[_0x1890('0x56')](_0x1b39a7[_0x1890('0x50')],[_0x1890('0x57'),'id'])||{});}})[_0x1890('0x2a')](respondWithResult(_0x570595,null))[_0x1890('0x49')](handleError(_0x570595,null));};exports['getMembers']=function(_0x7e6eca,_0xb5b1bc,_0x326eef){var _0x4130c5={};var _0x5a3cb4={};var _0x2e17a6;var _0x1b6adb;return db[_0x1890('0x31')][_0x1890('0x58')]({'where':{'id':_0x7e6eca[_0x1890('0x4b')]['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0xb5b1bc,null))[_0x1890('0x2a')](function(_0x19b661){if(_0x19b661){_0x2e17a6=_0x19b661;_0x5a3cb4[_0x1890('0x35')]=_[_0x1890('0x38')](db['User'][_0x1890('0x32')]);_0x5a3cb4['query']=_[_0x1890('0x38')](_0x7e6eca['query']);_0x5a3cb4[_0x1890('0x3a')]=_['intersection'](_0x5a3cb4[_0x1890('0x35')],_0x5a3cb4[_0x1890('0x39')]);_0x4130c5[_0x1890('0x3c')]=_[_0x1890('0x3b')](_0x5a3cb4['model'],qs['fields'](_0x7e6eca[_0x1890('0x39')][_0x1890('0x3d')]));_0x4130c5[_0x1890('0x3c')]=_0x4130c5[_0x1890('0x3c')]['length']?_0x4130c5[_0x1890('0x3c')]:_0x5a3cb4[_0x1890('0x35')];_0x4130c5['order']=qs[_0x1890('0x42')](_0x7e6eca[_0x1890('0x39')][_0x1890('0x42')]);_0x4130c5[_0x1890('0x43')]=qs[_0x1890('0x3a')](_['pick'](_0x7e6eca[_0x1890('0x39')],_0x5a3cb4[_0x1890('0x3a')]));if(_0x7e6eca[_0x1890('0x39')][_0x1890('0x59')]){_0x4130c5['where']=_['merge'](_0x4130c5[_0x1890('0x43')],{'$or':_[_0x1890('0x36')](_0x4130c5[_0x1890('0x3c')],function(_0x4fb957){var _0x199951={};_0x199951[_0x4fb957]={'$like':'%'+_0x7e6eca[_0x1890('0x39')][_0x1890('0x59')]+'%'};return _0x199951;})});}_0x4130c5=_[_0x1890('0x46')]({},_0x4130c5,_0x7e6eca[_0x1890('0x47')]);return _0x2e17a6['getMembers'](_0x4130c5);}})[_0x1890('0x2a')](function(_0x4a1972){if(_0x4a1972){_0x1b6adb=_0x4a1972[_0x1890('0x3e')];if(!_0x7e6eca['query'][_0x1890('0x3f')](_0x1890('0x40'))){_0x4130c5[_0x1890('0x24')]=qs[_0x1890('0x24')](_0x7e6eca[_0x1890('0x39')][_0x1890('0x24')]);_0x4130c5[_0x1890('0x21')]=qs[_0x1890('0x21')](_0x7e6eca[_0x1890('0x39')]['offset']);}return _0x2e17a6['getMembers'](_0x4130c5);}})[_0x1890('0x2a')](function(_0x10e27f){if(_0x10e27f){return _0x10e27f?{'count':_0x1b6adb,'rows':_0x10e27f}:null;}})[_0x1890('0x2a')](respondWithResult(_0xb5b1bc,null))[_0x1890('0x49')](handleError(_0xb5b1bc,null));};exports[_0x1890('0x5a')]=function(_0x306bfe,_0x1bec3c,_0xd7693f){return db['ChatGroup'][_0x1890('0x4e')]({'where':{'id':_0x306bfe['params']['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x1bec3c,null))[_0x1890('0x2a')](function(_0x3e513c){if(_0x3e513c){return _0x3e513c[_0x1890('0x5a')](_0x306bfe[_0x1890('0x39')][_0x1890('0x57')]);}})[_0x1890('0x2a')](respondWithStatusCode(_0x1bec3c,null))[_0x1890('0x49')](handleError(_0x1bec3c,null));};exports[_0x1890('0x5b')]=function(_0x44f388,_0x4d8707,_0x208e22){if(_0x44f388[_0x1890('0x50')]['id']){delete _0x44f388[_0x1890('0x50')]['id'];}return db[_0x1890('0x31')][_0x1890('0x4e')]({'where':{'id':_0x44f388['params']['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x4d8707,null))['then'](function(_0x5f363d){if(_0x5f363d){_0x44f388[_0x1890('0x50')]['ChatGroupId']=_0x5f363d['id'];return db[_0x1890('0x52')][_0x1890('0x4f')](_0x44f388[_0x1890('0x50')]);}})[_0x1890('0x2a')](respondWithResult(_0x4d8707,null))['catch'](handleError(_0x4d8707,null));};exports[_0x1890('0x5c')]=function(_0x401d4b,_0x14fd32,_0x21d642){var _0xfaa17={};var _0x1612f6={};var _0x27ca71;var _0x50fefa;return db[_0x1890('0x31')][_0x1890('0x58')]({'where':{'id':_0x401d4b[_0x1890('0x4b')]['id']}})[_0x1890('0x2a')](handleEntityNotFound(_0x14fd32,null))[_0x1890('0x2a')](function(_0x1b0e2a){if(_0x1b0e2a){_0x27ca71=_0x1b0e2a;_0x1612f6['model']=_[_0x1890('0x38')](db[_0x1890('0x52')][_0x1890('0x32')]);_0x1612f6[_0x1890('0x39')]=_[_0x1890('0x38')](_0x401d4b[_0x1890('0x39')]);_0x1612f6[_0x1890('0x3a')]=_[_0x1890('0x3b')](_0x1612f6[_0x1890('0x35')],_0x1612f6[_0x1890('0x39')]);_0xfaa17[_0x1890('0x3c')]=_[_0x1890('0x3b')](_0x1612f6[_0x1890('0x35')],qs[_0x1890('0x3d')](_0x401d4b['query']['fields']));_0xfaa17[_0x1890('0x3c')]=_0xfaa17['attributes'][_0x1890('0x3e')]?_0xfaa17[_0x1890('0x3c')]:_0x1612f6[_0x1890('0x35')];_0xfaa17['order']=qs[_0x1890('0x42')](_0x401d4b[_0x1890('0x39')][_0x1890('0x42')]);_0xfaa17[_0x1890('0x43')]=qs[_0x1890('0x3a')](_[_0x1890('0x44')](_0x401d4b[_0x1890('0x39')],_0x1612f6[_0x1890('0x3a')]));if(_0x401d4b['query'][_0x1890('0x59')]){_0xfaa17[_0x1890('0x43')]=_[_0x1890('0x46')](_0xfaa17[_0x1890('0x43')],{'$or':_['map'](_0xfaa17[_0x1890('0x3c')],function(_0x28dad2){var _0x1394d5={};_0x1394d5[_0x28dad2]={'$like':'%'+_0x401d4b[_0x1890('0x39')][_0x1890('0x59')]+'%'};return _0x1394d5;})});}if(_0x401d4b[_0x1890('0x39')][_0x1890('0x5d')]){var _0x1463fb=_0x401d4b[_0x1890('0x39')]['$gte'][_0x1890('0x5e')](',');var _0x3c71a9={};_0x3c71a9[_0x1463fb[0x0]]={'$gte':moment(_0x1463fb[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xfaa17['where']=_['merge'](_0xfaa17['where'],_0x3c71a9);}_0xfaa17=_[_0x1890('0x46')]({},_0xfaa17,_0x401d4b[_0x1890('0x47')]);return _0x27ca71[_0x1890('0x5c')](_0xfaa17);}})['then'](function(_0x3c04b0){if(_0x3c04b0){_0x50fefa=_0x3c04b0[_0x1890('0x3e')];if(!_0x401d4b[_0x1890('0x39')][_0x1890('0x3f')](_0x1890('0x40'))){_0xfaa17[_0x1890('0x24')]=qs[_0x1890('0x24')](_0x401d4b[_0x1890('0x39')][_0x1890('0x24')]);_0xfaa17['offset']=qs[_0x1890('0x21')](_0x401d4b['query'][_0x1890('0x21')]);}return _0x27ca71[_0x1890('0x5c')](_0xfaa17);}})[_0x1890('0x2a')](function(_0x1ac353){if(_0x1ac353){return _0x1ac353?{'count':_0x50fefa,'rows':_0x1ac353}:null;}})[_0x1890('0x2a')](respondWithResult(_0x14fd32,null))[_0x1890('0x49')](handleError(_0x14fd32,null));}; \ No newline at end of file +var _0x3a6b=['addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ChatGroup','rawAttributes','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','include','findAll','catch','show','params','options','find','create','body','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','findOne','fields','removeMembers'];(function(_0x3196a4,_0x482605){var _0x3e767a=function(_0x4f6ba1){while(--_0x4f6ba1){_0x3196a4['push'](_0x3196a4['shift']());}};_0x3e767a(++_0x482605);}(_0x3a6b,0x112));var _0xb3a6=function(_0x4f1c35,_0x2a68f1){_0x4f1c35=_0x4f1c35-0x0;var _0xf9340a=_0x3a6b[_0x4f1c35];return _0xf9340a;};'use strict';var emlformat=require(_0xb3a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3a6('0x1'));var jsonpatch=require(_0xb3a6('0x2'));var rp=require(_0xb3a6('0x3'));var moment=require(_0xb3a6('0x4'));var BPromise=require(_0xb3a6('0x5'));var Mustache=require('mustache');var util=require(_0xb3a6('0x6'));var path=require(_0xb3a6('0x7'));var sox=require('sox');var csv=require(_0xb3a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3a6('0x9'));var _=require('lodash');var squel=require(_0xb3a6('0xa'));var crypto=require('crypto');var jsforce=require(_0xb3a6('0xb'));var deskjs=require(_0xb3a6('0xc'));var toCsv=require(_0xb3a6('0x8'));var querystring=require(_0xb3a6('0xd'));var Papa=require(_0xb3a6('0xe'));var Redis=require(_0xb3a6('0xf'));var authService=require(_0xb3a6('0x10'));var qs=require(_0xb3a6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb3a6('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb3a6('0x13'));var db=require(_0xb3a6('0x14'))['db'];config['redis']=_['defaults'](config[_0xb3a6('0x15')],{'host':_0xb3a6('0x16'),'port':0x18eb});var socket=require(_0xb3a6('0x17'))(new Redis(config[_0xb3a6('0x15')]));require('./chatGroup.socket')[_0xb3a6('0x18')](socket);function respondWithStatusCode(_0x58a1a5,_0x45435c){_0x45435c=_0x45435c||0xcc;return function(_0x243eb7){if(_0x243eb7){return _0x58a1a5[_0xb3a6('0x19')](_0x45435c);}return _0x58a1a5['status'](_0x45435c)['end']();};}function respondWithResult(_0x27ba56,_0x331f75){_0x331f75=_0x331f75||0xc8;return function(_0x45aa8a){if(_0x45aa8a){return _0x27ba56[_0xb3a6('0x1a')](_0x331f75)[_0xb3a6('0x1b')](_0x45aa8a);}};}function respondWithFilteredResult(_0x2bc849,_0x910146){return function(_0x3b9dc6){if(_0x3b9dc6){var _0x3e5044=typeof _0x910146[_0xb3a6('0x1c')]===_0xb3a6('0x1d')&&typeof _0x910146[_0xb3a6('0x1e')]===_0xb3a6('0x1d');var _0x27f7fe=_0x3b9dc6[_0xb3a6('0x1f')];var _0x34973c=_0x3e5044?0x0:_0x910146['offset'];var _0x182091=_0x3e5044?_0x3b9dc6['count']:_0x910146[_0xb3a6('0x1c')]+_0x910146[_0xb3a6('0x1e')];var _0x45c9e3;if(_0x182091>=_0x27f7fe){_0x182091=_0x27f7fe;_0x45c9e3=0xc8;}else{_0x45c9e3=0xce;}_0x2bc849[_0xb3a6('0x1a')](_0x45c9e3);return _0x2bc849[_0xb3a6('0x20')](_0xb3a6('0x21'),_0x34973c+'-'+_0x182091+'/'+_0x27f7fe)[_0xb3a6('0x1b')](_0x3b9dc6);}return null;};}function patchUpdates(_0x304712){return function(_0x28ee5f){try{jsonpatch[_0xb3a6('0x22')](_0x28ee5f,_0x304712,!![]);}catch(_0x475c18){return BPromise[_0xb3a6('0x23')](_0x475c18);}return _0x28ee5f[_0xb3a6('0x24')]();};}function saveUpdates(_0xfac3f4,_0x40a8a5){return function(_0x2c5257){if(_0x2c5257){return _0x2c5257[_0xb3a6('0x25')](_0xfac3f4)[_0xb3a6('0x26')](function(_0x58758a){return _0x58758a;});}return null;};}function removeEntity(_0x3ece25,_0x249cdc){return function(_0x32a1b9){if(_0x32a1b9){return _0x32a1b9[_0xb3a6('0x27')]()[_0xb3a6('0x26')](function(){_0x3ece25[_0xb3a6('0x1a')](0xcc)[_0xb3a6('0x28')]();});}};}function handleEntityNotFound(_0x492beb,_0x10ea0a){return function(_0x26ec88){if(!_0x26ec88){_0x492beb[_0xb3a6('0x19')](0x194);}return _0x26ec88;};}function handleError(_0x46adff,_0x21ce53){_0x21ce53=_0x21ce53||0x1f4;return function(_0x3e0628){logger[_0xb3a6('0x29')](_0x3e0628['stack']);if(_0x3e0628[_0xb3a6('0x2a')]){delete _0x3e0628[_0xb3a6('0x2a')];}_0x46adff[_0xb3a6('0x1a')](_0x21ce53)[_0xb3a6('0x2b')](_0x3e0628);};}exports[_0xb3a6('0x2c')]=function(_0x2396d2,_0x169ec8){var _0x333a34={},_0x4fd16f={},_0x44213b={'count':0x0,'rows':[]};var _0x23b9a4=_[_0xb3a6('0x2d')](db[_0xb3a6('0x2e')][_0xb3a6('0x2f')],function(_0x482e03){return{'name':_0x482e03['fieldName'],'type':_0x482e03['type']['key']};});_0x4fd16f[_0xb3a6('0x30')]=_[_0xb3a6('0x2d')](_0x23b9a4,_0xb3a6('0x2a'));_0x4fd16f[_0xb3a6('0x31')]=_[_0xb3a6('0x32')](_0x2396d2[_0xb3a6('0x31')]);_0x4fd16f['filters']=_[_0xb3a6('0x33')](_0x4fd16f['model'],_0x4fd16f[_0xb3a6('0x31')]);_0x333a34[_0xb3a6('0x34')]=_['intersection'](_0x4fd16f[_0xb3a6('0x30')],qs['fields'](_0x2396d2[_0xb3a6('0x31')]['fields']));_0x333a34['attributes']=_0x333a34[_0xb3a6('0x34')][_0xb3a6('0x35')]?_0x333a34[_0xb3a6('0x34')]:_0x4fd16f[_0xb3a6('0x30')];if(!_0x2396d2['query'][_0xb3a6('0x36')](_0xb3a6('0x37'))){_0x333a34[_0xb3a6('0x1e')]=qs[_0xb3a6('0x1e')](_0x2396d2[_0xb3a6('0x31')][_0xb3a6('0x1e')]);_0x333a34[_0xb3a6('0x1c')]=qs[_0xb3a6('0x1c')](_0x2396d2[_0xb3a6('0x31')][_0xb3a6('0x1c')]);}_0x333a34[_0xb3a6('0x38')]=qs['sort'](_0x2396d2[_0xb3a6('0x31')][_0xb3a6('0x39')]);_0x333a34[_0xb3a6('0x3a')]=qs['filters'](_[_0xb3a6('0x3b')](_0x2396d2[_0xb3a6('0x31')],_0x4fd16f[_0xb3a6('0x3c')]),_0x23b9a4);if(_0x2396d2[_0xb3a6('0x31')]['filter']){_0x333a34[_0xb3a6('0x3a')]=_[_0xb3a6('0x3d')](_0x333a34['where'],{'$or':_[_0xb3a6('0x2d')](_0x23b9a4,function(_0xacb51b){if(_0xacb51b['type']!==_0xb3a6('0x3e')){var _0x40f9c9={};_0x40f9c9[_0xacb51b[_0xb3a6('0x2a')]]={'$like':'%'+_0x2396d2[_0xb3a6('0x31')][_0xb3a6('0x3f')]+'%'};return _0x40f9c9;}})});}_0x333a34=_[_0xb3a6('0x3d')]({},_0x333a34,_0x2396d2['options']);var _0x525323={'where':_0x333a34[_0xb3a6('0x3a')]};return db[_0xb3a6('0x2e')][_0xb3a6('0x1f')](_0x525323)[_0xb3a6('0x26')](function(_0x46cce7){_0x44213b[_0xb3a6('0x1f')]=_0x46cce7;if(_0x2396d2[_0xb3a6('0x31')]['includeAll']){_0x333a34[_0xb3a6('0x40')]=[{'all':!![]}];}return db['ChatGroup'][_0xb3a6('0x41')](_0x333a34);})[_0xb3a6('0x26')](function(_0x189fb4){_0x44213b['rows']=_0x189fb4;return _0x44213b;})['then'](respondWithFilteredResult(_0x169ec8,_0x333a34))[_0xb3a6('0x42')](handleError(_0x169ec8,null));};exports[_0xb3a6('0x43')]=function(_0x4a8081,_0x3e7a53){var _0x94b060={'raw':!![],'where':{'id':_0x4a8081[_0xb3a6('0x44')]['id']}},_0x18528f={};_0x18528f[_0xb3a6('0x30')]=_[_0xb3a6('0x32')](db['ChatGroup'][_0xb3a6('0x2f')]);_0x18528f[_0xb3a6('0x31')]=_[_0xb3a6('0x32')](_0x4a8081[_0xb3a6('0x31')]);_0x18528f[_0xb3a6('0x3c')]=_[_0xb3a6('0x33')](_0x18528f['model'],_0x18528f[_0xb3a6('0x31')]);_0x94b060[_0xb3a6('0x34')]=_[_0xb3a6('0x33')](_0x18528f[_0xb3a6('0x30')],qs['fields'](_0x4a8081[_0xb3a6('0x31')]['fields']));_0x94b060[_0xb3a6('0x34')]=_0x94b060[_0xb3a6('0x34')][_0xb3a6('0x35')]?_0x94b060[_0xb3a6('0x34')]:_0x18528f[_0xb3a6('0x30')];if(_0x4a8081[_0xb3a6('0x31')]['includeAll']){_0x94b060[_0xb3a6('0x40')]=[{'all':!![]}];}_0x94b060=_['merge']({},_0x94b060,_0x4a8081[_0xb3a6('0x45')]);return db[_0xb3a6('0x2e')][_0xb3a6('0x46')](_0x94b060)[_0xb3a6('0x26')](handleEntityNotFound(_0x3e7a53,null))[_0xb3a6('0x26')](respondWithResult(_0x3e7a53,null))[_0xb3a6('0x42')](handleError(_0x3e7a53,null));};exports[_0xb3a6('0x47')]=function(_0x1dfe39,_0x23405e){return db[_0xb3a6('0x2e')][_0xb3a6('0x47')](_0x1dfe39[_0xb3a6('0x48')],{})[_0xb3a6('0x26')](respondWithResult(_0x23405e,0xc9))[_0xb3a6('0x42')](handleError(_0x23405e,null));};exports[_0xb3a6('0x25')]=function(_0x43451e,_0x48aaeb){if(_0x43451e[_0xb3a6('0x48')]['id']){delete _0x43451e[_0xb3a6('0x48')]['id'];}return db[_0xb3a6('0x2e')][_0xb3a6('0x46')]({'where':{'id':_0x43451e['params']['id']}})['then'](handleEntityNotFound(_0x48aaeb,null))[_0xb3a6('0x26')](saveUpdates(_0x43451e[_0xb3a6('0x48')],null))['then'](respondWithResult(_0x48aaeb,null))[_0xb3a6('0x42')](handleError(_0x48aaeb,null));};exports['destroy']=function(_0x2408ea,_0x3ff29d){return db[_0xb3a6('0x2e')][_0xb3a6('0x46')]({'where':{'id':_0x2408ea[_0xb3a6('0x44')]['id']}})[_0xb3a6('0x26')](handleEntityNotFound(_0x3ff29d,null))[_0xb3a6('0x26')](removeEntity(_0x3ff29d,null))[_0xb3a6('0x42')](handleError(_0x3ff29d,null));};exports['describe']=function(_0x27fc24,_0x5f5996){return db[_0xb3a6('0x2e')]['describe']()[_0xb3a6('0x26')](respondWithResult(_0x5f5996,null))['catch'](handleError(_0x5f5996,null));};exports[_0xb3a6('0x49')]=function(_0x2717aa,_0x262638,_0x47c56b){return db[_0xb3a6('0x4a')]['count']({'where':{'ChatGroupId':_0x2717aa[_0xb3a6('0x44')]['id'],'ToId':_0x2717aa[_0xb3a6('0x4b')]['id'],'read':![]}})[_0xb3a6('0x26')](function(_0x1079c2){return{'id':_['toInteger'](_0x2717aa[_0xb3a6('0x44')]['id']),'count':_0x1079c2};})[_0xb3a6('0x26')](respondWithResult(_0x262638,null))[_0xb3a6('0x42')](handleError(_0x262638,null));};exports[_0xb3a6('0x4c')]=function(_0x2c7d90,_0x42932c,_0x581059){return db[_0xb3a6('0x2e')]['find']({'where':{'id':_0x2c7d90[_0xb3a6('0x44')]['id']}})[_0xb3a6('0x26')](handleEntityNotFound(_0x42932c,null))[_0xb3a6('0x26')](function(_0x22cfa9){if(_0x22cfa9){return _0x22cfa9[_0xb3a6('0x4c')](_0x2c7d90[_0xb3a6('0x48')]['ids'],_['omit'](_0x2c7d90['body'],[_0xb3a6('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x42932c,null))[_0xb3a6('0x42')](handleError(_0x42932c,null));};exports[_0xb3a6('0x4e')]=function(_0x59f3c0,_0x501c9e,_0xc4b66c){var _0x5a2f6d={};var _0x401fde={};var _0x4c3b0b;var _0xb0e37c;return db[_0xb3a6('0x2e')][_0xb3a6('0x4f')]({'where':{'id':_0x59f3c0['params']['id']}})[_0xb3a6('0x26')](handleEntityNotFound(_0x501c9e,null))[_0xb3a6('0x26')](function(_0x5324ab){if(_0x5324ab){_0x4c3b0b=_0x5324ab;_0x401fde[_0xb3a6('0x30')]=_[_0xb3a6('0x32')](db['User'][_0xb3a6('0x2f')]);_0x401fde[_0xb3a6('0x31')]=_[_0xb3a6('0x32')](_0x59f3c0['query']);_0x401fde[_0xb3a6('0x3c')]=_[_0xb3a6('0x33')](_0x401fde[_0xb3a6('0x30')],_0x401fde['query']);_0x5a2f6d[_0xb3a6('0x34')]=_['intersection'](_0x401fde[_0xb3a6('0x30')],qs['fields'](_0x59f3c0['query'][_0xb3a6('0x50')]));_0x5a2f6d['attributes']=_0x5a2f6d[_0xb3a6('0x34')]['length']?_0x5a2f6d[_0xb3a6('0x34')]:_0x401fde['model'];_0x5a2f6d[_0xb3a6('0x38')]=qs[_0xb3a6('0x39')](_0x59f3c0[_0xb3a6('0x31')][_0xb3a6('0x39')]);_0x5a2f6d[_0xb3a6('0x3a')]=qs[_0xb3a6('0x3c')](_[_0xb3a6('0x3b')](_0x59f3c0['query'],_0x401fde[_0xb3a6('0x3c')]));if(_0x59f3c0['query'][_0xb3a6('0x3f')]){_0x5a2f6d[_0xb3a6('0x3a')]=_[_0xb3a6('0x3d')](_0x5a2f6d[_0xb3a6('0x3a')],{'$or':_['map'](_0x5a2f6d[_0xb3a6('0x34')],function(_0x22fb85){var _0x4f4382={};_0x4f4382[_0x22fb85]={'$like':'%'+_0x59f3c0['query'][_0xb3a6('0x3f')]+'%'};return _0x4f4382;})});}_0x5a2f6d=_[_0xb3a6('0x3d')]({},_0x5a2f6d,_0x59f3c0['options']);return _0x4c3b0b['getMembers'](_0x5a2f6d);}})[_0xb3a6('0x26')](function(_0x42ce0b){if(_0x42ce0b){_0xb0e37c=_0x42ce0b[_0xb3a6('0x35')];if(!_0x59f3c0[_0xb3a6('0x31')][_0xb3a6('0x36')](_0xb3a6('0x37'))){_0x5a2f6d[_0xb3a6('0x1e')]=qs[_0xb3a6('0x1e')](_0x59f3c0[_0xb3a6('0x31')][_0xb3a6('0x1e')]);_0x5a2f6d[_0xb3a6('0x1c')]=qs[_0xb3a6('0x1c')](_0x59f3c0[_0xb3a6('0x31')]['offset']);}return _0x4c3b0b['getMembers'](_0x5a2f6d);}})[_0xb3a6('0x26')](function(_0x98c95d){if(_0x98c95d){return _0x98c95d?{'count':_0xb0e37c,'rows':_0x98c95d}:null;}})[_0xb3a6('0x26')](respondWithResult(_0x501c9e,null))[_0xb3a6('0x42')](handleError(_0x501c9e,null));};exports[_0xb3a6('0x51')]=function(_0x31c7cc,_0x547c96,_0x45c216){return db[_0xb3a6('0x2e')][_0xb3a6('0x46')]({'where':{'id':_0x31c7cc[_0xb3a6('0x44')]['id']}})[_0xb3a6('0x26')](handleEntityNotFound(_0x547c96,null))['then'](function(_0x17086f){if(_0x17086f){return _0x17086f['removeMembers'](_0x31c7cc[_0xb3a6('0x31')]['ids']);}})[_0xb3a6('0x26')](respondWithStatusCode(_0x547c96,null))[_0xb3a6('0x42')](handleError(_0x547c96,null));};exports[_0xb3a6('0x52')]=function(_0x3ab0ee,_0x1cec45,_0xb5ae88){if(_0x3ab0ee[_0xb3a6('0x48')]['id']){delete _0x3ab0ee['body']['id'];}return db[_0xb3a6('0x2e')][_0xb3a6('0x46')]({'where':{'id':_0x3ab0ee['params']['id']}})[_0xb3a6('0x26')](handleEntityNotFound(_0x1cec45,null))[_0xb3a6('0x26')](function(_0x204406){if(_0x204406){_0x3ab0ee[_0xb3a6('0x48')][_0xb3a6('0x53')]=_0x204406['id'];return db[_0xb3a6('0x4a')][_0xb3a6('0x47')](_0x3ab0ee[_0xb3a6('0x48')]);}})['then'](respondWithResult(_0x1cec45,null))[_0xb3a6('0x42')](handleError(_0x1cec45,null));};exports['getMessages']=function(_0x3c711a,_0x5a64b8,_0x3fffb1){var _0x5b4637={};var _0x37e898={};var _0x1bbff7;var _0x12890d;return db[_0xb3a6('0x2e')][_0xb3a6('0x4f')]({'where':{'id':_0x3c711a['params']['id']}})[_0xb3a6('0x26')](handleEntityNotFound(_0x5a64b8,null))[_0xb3a6('0x26')](function(_0x39d6e8){if(_0x39d6e8){_0x1bbff7=_0x39d6e8;_0x37e898[_0xb3a6('0x30')]=_[_0xb3a6('0x32')](db['ChatInternalMessage']['rawAttributes']);_0x37e898[_0xb3a6('0x31')]=_['keys'](_0x3c711a[_0xb3a6('0x31')]);_0x37e898['filters']=_[_0xb3a6('0x33')](_0x37e898[_0xb3a6('0x30')],_0x37e898[_0xb3a6('0x31')]);_0x5b4637['attributes']=_[_0xb3a6('0x33')](_0x37e898[_0xb3a6('0x30')],qs[_0xb3a6('0x50')](_0x3c711a[_0xb3a6('0x31')][_0xb3a6('0x50')]));_0x5b4637[_0xb3a6('0x34')]=_0x5b4637[_0xb3a6('0x34')][_0xb3a6('0x35')]?_0x5b4637['attributes']:_0x37e898[_0xb3a6('0x30')];_0x5b4637[_0xb3a6('0x38')]=qs[_0xb3a6('0x39')](_0x3c711a[_0xb3a6('0x31')]['sort']);_0x5b4637['where']=qs[_0xb3a6('0x3c')](_[_0xb3a6('0x3b')](_0x3c711a[_0xb3a6('0x31')],_0x37e898[_0xb3a6('0x3c')]));if(_0x3c711a['query'][_0xb3a6('0x3f')]){_0x5b4637['where']=_['merge'](_0x5b4637[_0xb3a6('0x3a')],{'$or':_[_0xb3a6('0x2d')](_0x5b4637[_0xb3a6('0x34')],function(_0x55e8da){var _0x4ec5a1={};_0x4ec5a1[_0x55e8da]={'$like':'%'+_0x3c711a[_0xb3a6('0x31')][_0xb3a6('0x3f')]+'%'};return _0x4ec5a1;})});}if(_0x3c711a['query'][_0xb3a6('0x54')]){var _0x26b339=_0x3c711a['query'][_0xb3a6('0x54')][_0xb3a6('0x55')](',');var _0x2a27d0={};_0x2a27d0[_0x26b339[0x0]]={'$gte':moment(_0x26b339[0x1])[_0xb3a6('0x56')](_0xb3a6('0x57'))};_0x5b4637[_0xb3a6('0x3a')]=_[_0xb3a6('0x3d')](_0x5b4637[_0xb3a6('0x3a')],_0x2a27d0);}_0x5b4637=_[_0xb3a6('0x3d')]({},_0x5b4637,_0x3c711a['options']);return _0x1bbff7[_0xb3a6('0x58')](_0x5b4637);}})[_0xb3a6('0x26')](function(_0x3f5edf){if(_0x3f5edf){_0x12890d=_0x3f5edf[_0xb3a6('0x35')];if(!_0x3c711a[_0xb3a6('0x31')][_0xb3a6('0x36')](_0xb3a6('0x37'))){_0x5b4637[_0xb3a6('0x1e')]=qs[_0xb3a6('0x1e')](_0x3c711a[_0xb3a6('0x31')]['limit']);_0x5b4637[_0xb3a6('0x1c')]=qs[_0xb3a6('0x1c')](_0x3c711a[_0xb3a6('0x31')][_0xb3a6('0x1c')]);}return _0x1bbff7[_0xb3a6('0x58')](_0x5b4637);}})[_0xb3a6('0x26')](function(_0x3bd0ec){if(_0x3bd0ec){return _0x3bd0ec?{'count':_0x12890d,'rows':_0x3bd0ec}:null;}})[_0xb3a6('0x26')](respondWithResult(_0x5a64b8,null))[_0xb3a6('0x42')](handleError(_0x5a64b8,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3f8869b..6acaa6d 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 _0x090a=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x4822ac,_0x1dc22e){var _0x3db7f4=function(_0x280e1c){while(--_0x280e1c){_0x4822ac['push'](_0x4822ac['shift']());}};_0x3db7f4(++_0x1dc22e);}(_0x090a,0x133));var _0xa090=function(_0x271a0f,_0x458d11){_0x271a0f=_0x271a0f-0x0;var _0x39ef50=_0x090a[_0x271a0f];return _0x39ef50;};'use strict';var EventEmitter=require(_0xa090('0x0'));var ChatGroup=require(_0xa090('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa090('0x2')](0x0);var events={'afterCreate':_0xa090('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3f7ae2){return function(_0x5a0530,_0x364c3b,_0x191c3a){ChatGroupEvents[_0xa090('0x4')](_0x3f7ae2+':'+_0x5a0530['id'],_0x5a0530);ChatGroupEvents[_0xa090('0x4')](_0x3f7ae2,_0x5a0530);_0x191c3a(null);};}for(var e in events){if(events[_0xa090('0x5')](e)){var event=events[e];ChatGroup[_0xa090('0x6')](e,emitEvent(event));}}module[_0xa090('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x0b78=['hook','exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x19997d,_0x2c92a4){var _0x49be7f=function(_0x2e5d31){while(--_0x2e5d31){_0x19997d['push'](_0x19997d['shift']());}};_0x49be7f(++_0x2c92a4);}(_0x0b78,0x1d6));var _0x80b7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0b78[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x80b7('0x0'))['db'][_0x80b7('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x80b7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x80b7('0x3'),'afterDestroy':_0x80b7('0x4')};function emitEvent(_0x4ad62b){return function(_0x58bc47,_0x5a6e91,_0x2b7f25){ChatGroupEvents[_0x80b7('0x5')](_0x4ad62b+':'+_0x58bc47['id'],_0x58bc47);ChatGroupEvents[_0x80b7('0x5')](_0x4ad62b,_0x58bc47);_0x2b7f25(null);};}for(var e in events){if(events[_0x80b7('0x6')](e)){var event=events[e];ChatGroup[_0x80b7('0x7')](e,emitEvent(event));}}module[_0x80b7('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 bb347b1..1dd987d 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 _0xb9ed=['lodash','util','../../config/logger','api','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xb9ed,0x11e));var _0xdb9e=function(_0x389731,_0x1417b8){_0x389731=_0x389731-0x0;var _0x21b5f2=_0xb9ed[_0x389731];return _0x21b5f2;};'use strict';var _=require(_0xdb9e('0x0'));var util=require(_0xdb9e('0x1'));var logger=require(_0xdb9e('0x2'))(_0xdb9e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb9e('0x4'));var rimraf=require('rimraf');var config=require(_0xdb9e('0x5'));var attributes=require(_0xdb9e('0x6'));module[_0xdb9e('0x7')]=function(_0xf4e485,_0x6d8cd8){return _0xf4e485[_0xdb9e('0x8')](_0xdb9e('0x9'),attributes,{'tableName':_0xdb9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb23=['rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','bluebird','path'];(function(_0x3f35d8,_0x54d214){var _0x10772d=function(_0x4b19f3){while(--_0x4b19f3){_0x3f35d8['push'](_0x3f35d8['shift']());}};_0x10772d(++_0x54d214);}(_0xeb23,0x13a));var _0x3eb2=function(_0x2ef7bc,_0x49bb0e){_0x2ef7bc=_0x2ef7bc-0x0;var _0x369e28=_0xeb23[_0x2ef7bc];return _0x369e28;};'use strict';var _=require(_0x3eb2('0x0'));var util=require('util');var logger=require(_0x3eb2('0x1'))(_0x3eb2('0x2'));var moment=require('moment');var BPromise=require(_0x3eb2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3eb2('0x4'));var rimraf=require(_0x3eb2('0x5'));var config=require(_0x3eb2('0x6'));var attributes=require('./chatGroup.attributes');module[_0x3eb2('0x7')]=function(_0x54a724,_0x5dd333){return _0x54a724[_0x3eb2('0x8')](_0x3eb2('0x9'),attributes,{'tableName':_0x3eb2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 32a6639..f9fd7d4 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 _0x9a22=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a22,0x75));var _0x29a2=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9a22[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x29a2('0x0'));var util=require(_0x29a2('0x1'));var moment=require(_0x29a2('0x2'));var BPromise=require(_0x29a2('0x3'));var rs=require(_0x29a2('0x4'));var fs=require('fs');var Redis=require(_0x29a2('0x5'));var db=require(_0x29a2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x29a2('0x7'));var config=require(_0x29a2('0x8'));var jayson=require(_0x29a2('0x9'));var client=jayson[_0x29a2('0xa')][_0x29a2('0xb')]({'port':0x232a});config[_0x29a2('0xc')]=_[_0x29a2('0xd')](config[_0x29a2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x29a2('0xe'))(new Redis(config[_0x29a2('0xc')]));require('./chatGroup.socket')[_0x29a2('0xf')](socket);function respondWithRpcPromise(_0x336236,_0x4bcc9c,_0x3140c7){return new BPromise(function(_0x47439a,_0x4dded3){return client[_0x29a2('0x10')](_0x336236,_0x3140c7)[_0x29a2('0x11')](function(_0x1442b6){logger[_0x29a2('0x12')](_0x29a2('0x13'),_0x4bcc9c,_0x29a2('0x14'));logger['debug'](_0x29a2('0x15'),_0x4bcc9c,_0x29a2('0x14'),JSON[_0x29a2('0x16')](_0x1442b6));if(_0x1442b6[_0x29a2('0x17')]){if(_0x1442b6[_0x29a2('0x17')][_0x29a2('0x18')]===0x1f4){logger[_0x29a2('0x17')]('ChatGroup,\x20%s,\x20%s',_0x4bcc9c,_0x1442b6[_0x29a2('0x17')][_0x29a2('0x19')]);return _0x4dded3(_0x1442b6[_0x29a2('0x17')][_0x29a2('0x19')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4bcc9c,_0x1442b6[_0x29a2('0x17')][_0x29a2('0x19')]);return _0x47439a(_0x1442b6[_0x29a2('0x17')][_0x29a2('0x19')]);}else{logger[_0x29a2('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4bcc9c,_0x29a2('0x14'));_0x47439a(_0x1442b6[_0x29a2('0x1a')]['message']);}})[_0x29a2('0x1b')](function(_0x4ca5ee){logger[_0x29a2('0x17')](_0x29a2('0x13'),_0x4bcc9c,_0x4ca5ee);_0x4dded3(_0x4ca5ee);});});} \ No newline at end of file +var _0x851c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x644b12,_0x104c4b){var _0x237239=function(_0x3f9618){while(--_0x3f9618){_0x644b12['push'](_0x644b12['shift']());}};_0x237239(++_0x104c4b);}(_0x851c,0x19d));var _0xc851=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x851c[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var moment=require(_0xc851('0x2'));var BPromise=require(_0xc851('0x3'));var rs=require(_0xc851('0x4'));var fs=require('fs');var Redis=require(_0xc851('0x5'));var db=require(_0xc851('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc851('0x7'))(_0xc851('0x8'));var config=require('../../config/environment');var jayson=require(_0xc851('0x9'));var client=jayson[_0xc851('0xa')]['http']({'port':0x232a});config[_0xc851('0xb')]=_['defaults'](config['redis'],{'host':_0xc851('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc851('0xd'))[_0xc851('0xe')](socket);function respondWithRpcPromise(_0x3b4e80,_0x177de0,_0x1f1524){return new BPromise(function(_0x1ee38d,_0x33772a){return client[_0xc851('0xf')](_0x3b4e80,_0x1f1524)['then'](function(_0x3a1ce8){logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));logger[_0xc851('0x13')](_0xc851('0x14'),_0x177de0,_0xc851('0x12'),JSON[_0xc851('0x15')](_0x3a1ce8));if(_0x3a1ce8[_0xc851('0x16')]){if(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x17')]===0x1f4){logger[_0xc851('0x16')](_0xc851('0x11'),_0x177de0,_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);return _0x33772a(_0x3a1ce8[_0xc851('0x16')]['message']);}logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x3a1ce8[_0xc851('0x16')]['message']);return _0x1ee38d(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);}else{logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));_0x1ee38d(_0x3a1ce8[_0xc851('0x19')][_0xc851('0x18')]);}})['catch'](function(_0x27c098){logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x27c098);_0x33772a(_0x27c098);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f1e2a6e..e688f2e 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 _0x7fd4=['removeListener','register','length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x4853fc,_0x52cd55){var _0x23be73=function(_0x541448){while(--_0x541448){_0x4853fc['push'](_0x4853fc['shift']());}};_0x23be73(++_0x52cd55);}(_0x7fd4,0x1ec));var _0x47fd=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x7fd4[_0x22cb5f];return _0x274d36;};'use strict';var ChatGroupEvents=require(_0x47fd('0x0'));var events=['save',_0x47fd('0x1'),_0x47fd('0x2')];function createListener(_0x3f73bb,_0x3fa8f7){return function(_0xf6e7a5){_0x3fa8f7[_0x47fd('0x3')](_0x3f73bb,_0xf6e7a5);};}function removeListener(_0xbe5f8d,_0x7f7d0c){return function(){ChatGroupEvents[_0x47fd('0x4')](_0xbe5f8d,_0x7f7d0c);};}exports[_0x47fd('0x5')]=function(_0x967fa3){for(var _0x282dce=0x0,_0x231744=events[_0x47fd('0x6')];_0x282dce<_0x231744;_0x282dce++){var _0x4c52c7=events[_0x282dce];var _0x5a469d=createListener(_0x47fd('0x7')+_0x4c52c7,_0x967fa3);ChatGroupEvents['on'](_0x4c52c7,_0x5a469d);}}; \ No newline at end of file +var _0xcd84=['chatGroup:','./chatGroup.events','save','remove','removeListener','register','length'];(function(_0x3d8f29,_0x1d1bcd){var _0x5e265d=function(_0x22fb24){while(--_0x22fb24){_0x3d8f29['push'](_0x3d8f29['shift']());}};_0x5e265d(++_0x1d1bcd);}(_0xcd84,0x1eb));var _0x4cd8=function(_0x57d9b7,_0x260f54){_0x57d9b7=_0x57d9b7-0x0;var _0x3f3062=_0xcd84[_0x57d9b7];return _0x3f3062;};'use strict';var ChatGroupEvents=require(_0x4cd8('0x0'));var events=[_0x4cd8('0x1'),_0x4cd8('0x2'),'update'];function createListener(_0x429cd5,_0x3f2d79){return function(_0x54f852){_0x3f2d79['emit'](_0x429cd5,_0x54f852);};}function removeListener(_0x48d534,_0x405190){return function(){ChatGroupEvents[_0x4cd8('0x3')](_0x48d534,_0x405190);};}exports[_0x4cd8('0x4')]=function(_0x26b416){for(var _0x555212=0x0,_0x1671b4=events[_0x4cd8('0x5')];_0x555212<_0x1671b4;_0x555212++){var _0x20f747=events[_0x555212];var _0x8eb5d9=createListener(_0x4cd8('0x6')+_0x20f747,_0x26b416);ChatGroupEvents['on'](_0x20f747,_0x8eb5d9);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4a5611e..e7596b5 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 _0xe3d7=['removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','describe','get','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','addMembers','post','addMessage','put','update','delete'];(function(_0x7a6b9a,_0x34dbf8){var _0x52623a=function(_0x116e1b){while(--_0x116e1b){_0x7a6b9a['push'](_0x7a6b9a['shift']());}};_0x52623a(++_0x34dbf8);}(_0xe3d7,0x1d2));var _0x7e3d=function(_0x1a53a9,_0x299433){_0x1a53a9=_0x1a53a9-0x0;var _0xc06594=_0xe3d7[_0x1a53a9];return _0xc06594;};'use strict';var multer=require('multer');var util=require(_0x7e3d('0x0'));var path=require(_0x7e3d('0x1'));var timeout=require(_0x7e3d('0x2'));var express=require(_0x7e3d('0x3'));var router=express[_0x7e3d('0x4')]();var fs_extra=require(_0x7e3d('0x5'));var auth=require(_0x7e3d('0x6'));var interaction=require(_0x7e3d('0x7'));var config=require(_0x7e3d('0x8'));var controller=require(_0x7e3d('0x9'));router['get']('/',auth[_0x7e3d('0xa')](),controller['index']);router['get']('/describe',auth[_0x7e3d('0xa')](),controller[_0x7e3d('0xb')]);router[_0x7e3d('0xc')](_0x7e3d('0xd'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0xe')]);router[_0x7e3d('0xc')](_0x7e3d('0xf'),auth['isAuthenticated'](),controller[_0x7e3d('0x10')]);router[_0x7e3d('0xc')](_0x7e3d('0x11'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x12')]);router[_0x7e3d('0xc')](_0x7e3d('0x13'),auth[_0x7e3d('0xa')](),controller['getMessages']);router['post']('/',auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x14')]);router['post'](_0x7e3d('0x11'),auth['isAuthenticated'](),controller[_0x7e3d('0x15')]);router[_0x7e3d('0x16')](_0x7e3d('0x13'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x17')]);router[_0x7e3d('0x18')](_0x7e3d('0xd'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x19')]);router[_0x7e3d('0x1a')](_0x7e3d('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x7e3d('0x1a')](_0x7e3d('0x11'),auth[_0x7e3d('0xa')](),controller[_0x7e3d('0x1b')]);module[_0x7e3d('0x1c')]=router; \ No newline at end of file +var _0x23c1=['get','isAuthenticated','/describe','describe','show','/:id/unread','/:id/members','/:id/messages','post','create','addMessage','/:id','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller'];(function(_0x19ee6a,_0x35ca6f){var _0x2142d0=function(_0x1596ff){while(--_0x1596ff){_0x19ee6a['push'](_0x19ee6a['shift']());}};_0x2142d0(++_0x35ca6f);}(_0x23c1,0x78));var _0x123c=function(_0x36a82e,_0x1ccd4e){_0x36a82e=_0x36a82e-0x0;var _0x3cd7f3=_0x23c1[_0x36a82e];return _0x3cd7f3;};'use strict';var multer=require(_0x123c('0x0'));var util=require(_0x123c('0x1'));var path=require(_0x123c('0x2'));var timeout=require(_0x123c('0x3'));var express=require(_0x123c('0x4'));var router=express[_0x123c('0x5')]();var fs_extra=require(_0x123c('0x6'));var auth=require(_0x123c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x123c('0x8'));var controller=require(_0x123c('0x9'));router[_0x123c('0xa')]('/',auth[_0x123c('0xb')](),controller['index']);router[_0x123c('0xa')](_0x123c('0xc'),auth['isAuthenticated'](),controller[_0x123c('0xd')]);router[_0x123c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x123c('0xe')]);router['get'](_0x123c('0xf'),auth[_0x123c('0xb')](),controller['getUnread']);router[_0x123c('0xa')](_0x123c('0x10'),auth[_0x123c('0xb')](),controller['getMembers']);router[_0x123c('0xa')](_0x123c('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x123c('0x12')]('/',auth['isAuthenticated'](),controller[_0x123c('0x13')]);router[_0x123c('0x12')](_0x123c('0x10'),auth[_0x123c('0xb')](),controller['addMembers']);router[_0x123c('0x12')](_0x123c('0x11'),auth['isAuthenticated'](),controller[_0x123c('0x14')]);router['put'](_0x123c('0x15'),auth[_0x123c('0xb')](),controller[_0x123c('0x16')]);router[_0x123c('0x17')](_0x123c('0x15'),auth[_0x123c('0xb')](),controller[_0x123c('0x18')]);router[_0x123c('0x17')](_0x123c('0x10'),auth[_0x123c('0xb')](),controller[_0x123c('0x19')]);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 a04924e..77a98ed 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(_0x8389ed,_0x13b63e){var _0x4d7795=function(_0x3ed3e9){while(--_0x3ed3e9){_0x8389ed['push'](_0x8389ed['shift']());}};_0x4d7795(++_0x13b63e);}(_0x7df3,0x1cc));var _0x37df=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x7df3[_0x30ae5e];return _0x1f2e93;};'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 _0x7a40=['STRING','DATE','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a40,0x197));var _0x07a4=function(_0x2bd43a,_0x446e22){_0x2bd43a=_0x2bd43a-0x0;var _0x41fd92=_0x7a40[_0x2bd43a];return _0x41fd92;};'use strict';var Sequelize=require(_0x07a4('0x0'));module[_0x07a4('0x1')]={'closed':{'type':Sequelize[_0x07a4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x07a4('0x3')](_0x07a4('0x4'),_0x07a4('0x5')),'defaultValue':_0x07a4('0x4')},'ratingMessage':{'type':Sequelize[_0x07a4('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x07a4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x07a4('0x8')]},'disposition':{'type':Sequelize[_0x07a4('0x7')]},'secondDisposition':{'type':Sequelize[_0x07a4('0x7')]},'thirdDisposition':{'type':Sequelize[_0x07a4('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x07a4('0x7')]},'browserVersion':{'type':Sequelize[_0x07a4('0x7')]},'osName':{'type':Sequelize[_0x07a4('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x07a4('0x7')]},'deviceType':{'type':Sequelize[_0x07a4('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x07a4('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x07a4('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x07a4('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x07a4('0x7')]},'customerPort':{'type':Sequelize[_0x07a4('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x07a4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x07a4('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4b951da..b0fa3c1 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 _0x757a=['u.id','u.fullname','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','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','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?','union','User','type','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\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)','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','show','params','rawAttributes','includeAll','include','options','create','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','basename','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','getMessages','$gte','findAll','getMyMessages','secret','includeAgent','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','root','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','push','catch','index','ChatInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags'];(function(_0x26b14f,_0xcf2f69){var _0x566132=function(_0x5d41b3){while(--_0x5d41b3){_0x26b14f['push'](_0x26b14f['shift']());}};_0x566132(++_0xcf2f69);}(_0x757a,0xde));var _0xa757=function(_0x152bf8,_0x462608){_0x152bf8=_0x152bf8-0x0;var _0x320918=_0x757a[_0x152bf8];return _0x320918;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var pdf=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa757('0x15')]=_['defaults'](config['redis'],{'host':_0xa757('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa757('0x17'))[_0xa757('0x18')](socket);var jayson=require(_0xa757('0x19'));var client=jayson[_0xa757('0x1a')][_0xa757('0x1b')]({'port':0x232b});var client9004=jayson[_0xa757('0x1a')][_0xa757('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x2f7947,_0x185011,_0x3df1f9,_0x50aac1){return new BPromise(function(_0x2e195b,_0x44eab8){var _0xde8248=_0x50aac1||client;return _0xde8248['request'](_0x2f7947,_0x3df1f9)['then'](function(_0x151c04){logger[_0xa757('0x1c')](_0xa757('0x1d'),_0x185011,_0xa757('0x1e'));logger[_0xa757('0x1f')](_0xa757('0x20'),_0x185011,'request\x20sent',JSON[_0xa757('0x21')](_0x151c04));if(_0x151c04['error']){if(_0x151c04[_0xa757('0x22')][_0xa757('0x23')]===0x1f4){logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x151c04['error']['message']);return _0x44eab8(_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);}logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);return _0x2e195b(_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);}else{logger[_0xa757('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x185011,_0xa757('0x1e'));_0x2e195b(_0x151c04['result'][_0xa757('0x24')]);}})['catch'](function(_0x40551d){logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x40551d);_0x44eab8(_0x40551d);});});}function respondWithStatusCode(_0x4d58a4,_0x2b19d5){_0x2b19d5=_0x2b19d5||0xcc;return function(_0xcd98bd){if(_0xcd98bd){return _0x4d58a4[_0xa757('0x25')](_0x2b19d5);}return _0x4d58a4[_0xa757('0x26')](_0x2b19d5)['end']();};}function respondWithResult(_0x449a7d,_0x54263b){_0x54263b=_0x54263b||0xc8;return function(_0x5a5664){if(_0x5a5664){return _0x449a7d['status'](_0x54263b)['json'](_0x5a5664);}};}function respondWithFilteredResult(_0xfdf69d,_0x596ae2){return function(_0x2208f9){if(_0x2208f9){var _0x3bc24c=typeof _0x596ae2['offset']===_0xa757('0x27')&&typeof _0x596ae2['limit']===_0xa757('0x27');var _0xa6d0f6=_0x2208f9['count'];var _0x235e54=_0x3bc24c?0x0:_0x596ae2['offset'];var _0x3a4a66=_0x3bc24c?_0x2208f9[_0xa757('0x28')]:_0x596ae2[_0xa757('0x29')]+_0x596ae2[_0xa757('0x2a')];var _0xcc87c0;if(_0x3a4a66>=_0xa6d0f6){_0x3a4a66=_0xa6d0f6;_0xcc87c0=0xc8;}else{_0xcc87c0=0xce;}_0xfdf69d[_0xa757('0x26')](_0xcc87c0);return _0xfdf69d[_0xa757('0x2b')](_0xa757('0x2c'),_0x235e54+'-'+_0x3a4a66+'/'+_0xa6d0f6)[_0xa757('0x2d')](_0x2208f9);}return null;};}function patchUpdates(_0x384424){return function(_0x1f5d5a){try{jsonpatch[_0xa757('0x2e')](_0x1f5d5a,_0x384424,!![]);}catch(_0x25dfbb){return BPromise[_0xa757('0x2f')](_0x25dfbb);}return _0x1f5d5a[_0xa757('0x30')]();};}function saveUpdates(_0xc1cc20,_0x3e64b7){return function(_0x1ad384){if(_0x1ad384){return _0x1ad384[_0xa757('0x31')](_0xc1cc20)[_0xa757('0x32')](function(_0x3de18f){return _0x3de18f;});}return null;};}function removeEntity(_0x170aa9,_0x379de7){return function(_0x3aae1e){if(_0x3aae1e){return _0x3aae1e['destroy']()[_0xa757('0x32')](function(){_0x170aa9[_0xa757('0x26')](0xcc)[_0xa757('0x33')]();});}};}function handleEntityNotFound(_0x1794a9,_0x1c4c40){return function(_0x51e2aa){if(!_0x51e2aa){_0x1794a9[_0xa757('0x25')](0x194);}return _0x51e2aa;};}function handleError(_0x2af470,_0x37b1a3){_0x37b1a3=_0x37b1a3||0x1f4;return function(_0x2c34b1){logger[_0xa757('0x22')](_0x2c34b1[_0xa757('0x34')]);if(_0x2c34b1['name']){delete _0x2c34b1[_0xa757('0x35')];}_0x2af470[_0xa757('0x26')](_0x37b1a3)[_0xa757('0x36')](_0x2c34b1);};}function getMustacheRender(_0xc34409,_0x3b5104){return Mustache[_0xa757('0x37')](_0xc34409,_[_0xa757('0x38')](_0x3b5104[_0xa757('0x39')],{'contact':_0x3b5104[_0xa757('0x3a')],'message':_0x3b5104['message'],'agent':_0x3b5104[_0xa757('0x3b')],'interaction':_0x3b5104[_0xa757('0x3c')],'account':_0x3b5104[_0xa757('0x3d')]}))||'';}function getInteractionUsers(_0x35c15a,_0x2531be){return new BPromise(function(_0x2fd99e,_0x501e26){try{if(_0x2531be[_0x35c15a['id']]){_0x35c15a[_0xa757('0x3e')]=_[_0xa757('0x3f')](_0x2531be[_0x35c15a['id']],function(_0x48cde9){return{'id':_0x48cde9['id'],'fullname':_0x48cde9['fullname']};});}}catch(_0x9607af){_0x501e26(_0x9607af);}_0x2fd99e(_0x35c15a);});}function getInteractionTags(_0x6193bf,_0x5b11fe){return new BPromise(function(_0x51c3d1,_0xcff7c4){try{if(_0x6193bf[_0xa757('0x40')]){_0x6193bf[_0xa757('0x41')]=[];_0x6193bf['TagIds'][_0xa757('0x42')](',')[_0xa757('0x43')](function(_0x26802c){_0x6193bf[_0xa757('0x41')][_0xa757('0x44')](_0x5b11fe[_0x26802c]);});}delete _0x6193bf['TagIds'];}catch(_0x1f9af){_0xcff7c4(_0x1f9af);}_0x51c3d1(_0x6193bf);});}function updateChatInteraction(_0x52c728,_0x564d40,_0x43329c){return new BPromise(function(_0x57298b,_0x373747){return getInteractionUsers(_0x52c728,_0x43329c)[_0xa757('0x32')](function(_0x9a0934){return getInteractionTags(_0x9a0934,_0x564d40);})['then'](function(_0x5d25bb){_0x57298b(_0x5d25bb);})[_0xa757('0x45')](function(_0x129d77){_0x373747(_0x129d77);});});}exports[_0xa757('0x46')]=function(_0xe03a3c,_0xc063db){var _0x3db5d5={},_0x4f12b1={},_0xd61628={'count':0x0,'rows':[]};var _0x364998=_['map'](db[_0xa757('0x47')]['rawAttributes'],function(_0x2d111e){return{'name':_0x2d111e[_0xa757('0x48')],'type':_0x2d111e['type'][_0xa757('0x49')]};});_0x4f12b1[_0xa757('0x4a')]=_['map'](_0x364998,_0xa757('0x35'));_0x4f12b1[_0xa757('0x4b')]=_[_0xa757('0x4c')](_0xe03a3c[_0xa757('0x4b')]);_0x4f12b1['filters']=_[_0xa757('0x4d')](_0x4f12b1[_0xa757('0x4a')],_0x4f12b1[_0xa757('0x4b')]);_0x3db5d5[_0xa757('0x4e')]=_['intersection'](_0x4f12b1[_0xa757('0x4a')],qs['fields'](_0xe03a3c['query'][_0xa757('0x4f')]));_0x3db5d5[_0xa757('0x4e')]=_0x3db5d5[_0xa757('0x4e')]['length']?_0x3db5d5[_0xa757('0x4e')]:_0x4f12b1['model'];if(!_0xe03a3c[_0xa757('0x4b')][_0xa757('0x50')](_0xa757('0x51'))){_0x3db5d5[_0xa757('0x2a')]=qs[_0xa757('0x2a')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x2a')]);_0x3db5d5[_0xa757('0x29')]=qs['offset'](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x29')]);}_0x3db5d5[_0xa757('0x52')]=qs[_0xa757('0x53')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x53')]);_0x3db5d5[_0xa757('0x54')]=qs[_0xa757('0x55')](_[_0xa757('0x56')](_0xe03a3c[_0xa757('0x4b')],_0x4f12b1[_0xa757('0x55')]),_0x364998);var _0x19ceef=[];var _0x2367c7=squel[_0xa757('0x57')]()[_0xa757('0x58')]('id')[_0xa757('0x58')]('name')[_0xa757('0x58')]('color')[_0xa757('0x59')](_0xa757('0x5a'));var _0xa89d24=squel[_0xa757('0x57')]()['field'](_0xa757('0x5b'))[_0xa757('0x58')](_0xa757('0x5c'))[_0xa757('0x58')]('ui.ChatInteractionId')[_0xa757('0x59')](_0xa757('0x5d'),'ui')[_0xa757('0x5e')](_0xa757('0x5f'),'u',_0xa757('0x60'));var _0x291b26=squel['select']()['from']('chat_interactions','i')['left_join'](_0xa757('0x61'),'c',_0xa757('0x62'))[_0xa757('0x5e')](_0xa757('0x5f'),'o',_0xa757('0x63'))[_0xa757('0x5e')]('chat_websites','a',_0xa757('0x64'))[_0xa757('0x5e')](_0xa757('0x65'),'me',_0xa757('0x66'))['left_join'](_0xa757('0x67'),'it',_0xa757('0x68'))['left_join'](_0xa757('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x211980=squel['expr']();var _0x51be6e=[];var _0x58633a=squel['expr']();var _0x367b48;if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x69')]){_0x367b48=as[_0xa757('0x6a')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x69')]);var _0x4c19a6=_0x367b48['sqlOperator'];for(var _0x201557=0x0;_0x201557<_0x367b48[_0xa757('0x6b')][_0xa757('0x6c')];_0x201557++){var _0x4a5ad5=_0x367b48['conditions'][_0x201557];var _0x18dff7='i';var _0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),_0x4a5ad5[_0xa757('0x58')]]);if(!_0x31c4cd){switch(_0x4a5ad5[_0xa757('0x58')]){case'unreadMessages':if(_0x4a5ad5[_0xa757('0x6e')]==0x1){_0x291b26[_0xa757('0x6f')]('`'+_0x4a5ad5[_0xa757('0x58')]+_0xa757('0x70'));}else{_0x291b26[_0xa757('0x6f')]('`'+_0x4a5ad5[_0xa757('0x58')]+_0xa757('0x71'));}break;case _0xa757('0x72'):if(_0x4a5ad5[_0xa757('0x73')]===_0xa757('0x74')){if(_0x4a5ad5['value'][_0xa757('0x42')]('\x20')['length']>0x1){_0x211980[_0x4c19a6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa757('0x75')](_0x4a5ad5[_0xa757('0x6e')]),null);}else{var _0x432856='%'+_0x4a5ad5[_0xa757('0x6e')]+'%';_0x211980[_0x4c19a6](_0xa757('0x76'),_0x432856,_0x432856,_0x432856);}}else{_0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),_0xa757('0x77')]);_0x4a5ad5[_0xa757('0x58')]=_0xa757('0x77');_0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd['type'],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')]['start'],_0x423f3a[_0xa757('0x6e')][_0xa757('0x33')]);}break;case _0xa757('0x7a'):var _0x180cec=_0x4a5ad5[_0xa757('0x6e')][_0xa757('0x42')](',')['map'](function(_0x413217){return Number(_0x413217);});_0x180cec['forEach'](function(_0xee5b78){_0x58633a['or'](_0xa757('0x7b'),'%,'+_0xee5b78+',%');});_0x51be6e=_[_0xa757('0x7c')](_0x51be6e,_0x180cec);break;case _0xa757('0x7d'):if(_0x4a5ad5[_0xa757('0x73')]==='$substring'){_0x211980[_0x4c19a6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4a5ad5[_0xa757('0x6e')]+'%',null);}else{_0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),'UserId']);_0x4a5ad5[_0xa757('0x58')]='UserId';_0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd[_0xa757('0x7e')],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x7f')],_0x423f3a[_0xa757('0x6e')]['end']);}break;case _0xa757('0x39'):_0x423f3a=as[_0xa757('0x78')]('me',null,_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x7f')],_0x423f3a['value'][_0xa757('0x33')]);break;}}else{var _0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd[_0xa757('0x7e')],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a['value'][_0xa757('0x7f')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x33')]);}}}else{var _0x529298=_(_0xe03a3c[_0xa757('0x4b')])[_0xa757('0x4c')]()[_0xa757('0x3f')](function(_0x60f518){return _[_0xa757('0x80')](_0x364998,[_0xa757('0x35'),_0x60f518])?_0x60f518:undefined;})[_0xa757('0x81')]()[_0xa757('0x6e')]();if(!_[_0xa757('0x82')](_0x529298)){_0x529298[_0xa757('0x43')](function(_0x1a868d){if(_0x1a868d===_0xa757('0x83')){_0x291b26[_0xa757('0x54')](_0xa757('0x84'),[]['concat'](_0xe03a3c[_0xa757('0x4b')][_0x1a868d]));}else if(_0x1a868d===_0xa757('0x85')){var _0x532ab5=JSON[_0xa757('0x86')](_0xe03a3c[_0xa757('0x4b')][_0x1a868d])['$gte'];var _0x29aea2=JSON[_0xa757('0x86')](_0xe03a3c[_0xa757('0x4b')][_0x1a868d])[_0xa757('0x87')];_0x291b26[_0xa757('0x54')](_0xa757('0x88'),_0x532ab5,_0x29aea2);}else{if(_0xe03a3c[_0xa757('0x4b')][_0x1a868d]===_0xa757('0x89')){_0x291b26[_0xa757('0x54')]('i.'+_0x1a868d+_0xa757('0x8a'));}else{_0x291b26[_0xa757('0x54')]('i.'+_0x1a868d+_0xa757('0x8b'),_0xe03a3c[_0xa757('0x4b')][_0x1a868d]);}}});}if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8c')]){if(_0xe03a3c[_0xa757('0x4b')]['read']==0x1){_0x291b26[_0xa757('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x291b26[_0xa757('0x6f')](_0xa757('0x8d'));}}if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8e')]){_0x51be6e=_[_0xa757('0x8f')](_0xe03a3c['query'][_0xa757('0x8e')])?_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8e')]:new Array(_0xe03a3c['query'][_0xa757('0x8e')]);_0x51be6e[_0xa757('0x43')](function(_0x2c05d5){_0x58633a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c05d5+',%');});}if(_0xe03a3c['query'][_0xa757('0x90')]){var _0x351e0e=_0xe03a3c[_0xa757('0x4b')]['filter'][_0xa757('0x91')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x351e0e)){_0x211980['or'](_0xa757('0x92'),_0x351e0e+'%');}else{_0x211980['or'](_0xa757('0x93'),qs[_0xa757('0x75')](_0x351e0e))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x351e0e+'%');}}}_0x291b26[_0xa757('0x54')](_0x211980);_0x291b26[_0xa757('0x94')](_0xa757('0x95'));var _0x199f75={'type':db[_0xa757('0x96')][_0xa757('0x97')][_0xa757('0x98')],'raw':!![]};var _0x44c681=_0x291b26[_0xa757('0x99')]();_0x44c681[_0xa757('0x58')](_0xa757('0x95'));_0x44c681[_0xa757('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa757('0x9a'));if(_0x3db5d5[_0xa757('0x52')]){_0x3db5d5[_0xa757('0x52')][_0xa757('0x43')](function(_0x1a46d6){var _0x7440f6=_0x1a46d6[0x0]===_0xa757('0x9b')?_0x1a46d6[0x0]:'i.'+_0x1a46d6[0x0];_0x291b26[_0xa757('0x52')](_0x7440f6,_0x1a46d6[0x1]===_0xa757('0x9c')?![]:!![]);});}if(!_[_0xa757('0x82')](_0x51be6e)){_0x291b26[_0xa757('0x6f')](_0x58633a);_0x44c681[_0xa757('0x54')](_0xa757('0x9d'),_0x51be6e);}BPromise[_0xa757('0x9e')]()[_0xa757('0x32')](function(){if(!_0x367b48){if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x83')])return;_0x44c681[_0xa757('0x54')](_0xa757('0x9f'));_0x291b26[_0xa757('0x54')](_0xa757('0x9f'));return;}if(_0xe03a3c[_0xa757('0xa0')]['role']!==_0xa757('0x3b'))return;return _0xe03a3c[_0xa757('0xa0')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xa757('0x32')](function(_0x4c4b1a){if(_[_0xa757('0x82')](_0x4c4b1a)){_0x44c681[_0xa757('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');_0x291b26[_0xa757('0x54')](_0xa757('0xa1'));}else{_0x44c681[_0xa757('0x54')](_0xa757('0x84'),_['map'](_0x4c4b1a,'id'));_0x291b26[_0xa757('0x54')](_0xa757('0x84'),_['map'](_0x4c4b1a,'id'));}});})[_0xa757('0x32')](function(){if(_0xe03a3c[_0xa757('0xa0')]['role']===_0xa757('0x3b')&&!_0x367b48&&!_0xe03a3c[_0xa757('0x4b')][_0xa757('0x83')])return[];return db[_0xa757('0xa2')][_0xa757('0x4b')](_0x44c681[_0xa757('0xa3')](),_0x199f75);})[_0xa757('0x32')](function(_0x2d6405){_0xd61628[_0xa757('0x28')]=_0x2d6405['length'];if(_0xd61628['count']===0x0)return[];return db[_0xa757('0xa2')][_0xa757('0x4b')](_0x2367c7[_0xa757('0xa3')](),_0x199f75)[_0xa757('0x32')](function(_0x38d0f8){_0x19ceef=_[_0xa757('0xa4')](_0x38d0f8,'id');_0x199f75=_[_0xa757('0x38')](_0x199f75,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe03a3c[_0xa757('0x4b')]['fields']){_0x3db5d5[_0xa757('0x4e')][_0xa757('0x43')](function(_0x365a0d){_0x291b26[_0xa757('0x58')]('i.'+_0x365a0d);});}else{_0x291b26[_0xa757('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa757('0x9a'));_0x291b26['field'](_0xa757('0xa5'),_0xa757('0xa6'));_0x291b26[_0xa757('0x58')](_0xa757('0xa7'),'Account.mandatoryDisposition');_0x291b26[_0xa757('0x58')](_0xa757('0xa8'),_0xa757('0x9b'));_0x291b26[_0xa757('0x58')](_0xa757('0xa9'));_0x291b26[_0xa757('0x58')](_0xa757('0xaa'),_0xa757('0xab'));_0x291b26['field'](_0xa757('0xac'),_0xa757('0xad'));_0x291b26[_0xa757('0x58')](_0xa757('0xae'),'Contact.email');_0x291b26[_0xa757('0x58')](_0xa757('0xaf'),_0xa757('0xb0'));_0x291b26[_0xa757('0x58')](_0xa757('0xb1'),_0xa757('0xb2'));_0x291b26[_0xa757('0x58')]('c.fax','Contact.fax');_0x291b26[_0xa757('0x58')]('o.fullname',_0xa757('0xb3'));_0x291b26['field']('o.internal',_0xa757('0xb4'));_0x291b26[_0xa757('0x58')](_0xa757('0xb5'),_0xa757('0x40'));}if(_0x3db5d5[_0xa757('0x2a')])_0x291b26[_0xa757('0x2a')](_0x3db5d5[_0xa757('0x2a')]);if(_0x3db5d5[_0xa757('0x29')])_0x291b26[_0xa757('0x29')](_0x3db5d5[_0xa757('0x29')]);return db['sequelize'][_0xa757('0x4b')](_0x291b26['toString'](),_0x199f75);})[_0xa757('0x32')](function(_0x4e7280){if(_0x4e7280[_0xa757('0x6c')]>0x0)_0xa89d24[_0xa757('0x54')]('ui.ChatInteractionId\x20IN\x20?',_[_0xa757('0x3f')](_0x4e7280,'id'));return db[_0xa757('0xa2')][_0xa757('0x4b')](_0xa89d24[_0xa757('0xa3')](),_0x199f75)[_0xa757('0x32')](function(_0x162ff6){var _0x1c789c=_[_0xa757('0xb6')](_0x162ff6,_0xa757('0xb7'));var _0x358268=[];_0x4e7280[_0xa757('0x43')](function(_0x204489){_0x358268[_0xa757('0x44')](updateChatInteraction(_0x204489,_0x19ceef,_0x1c789c));});return BPromise[_0xa757('0xb8')](_0x358268);});});})[_0xa757('0x32')](function(_0x56a060){_0xd61628['rows']=_0x56a060;return _0xd61628;})[_0xa757('0x32')](respondWithFilteredResult(_0xc063db,_0x3db5d5))['catch'](handleError(_0xc063db,null));};exports[_0xa757('0xb9')]=function(_0x3404f1,_0x2edad2){var _0x1d03a7={'raw':![],'where':{'id':_0x3404f1[_0xa757('0xba')]['id']}},_0x48c52f={};_0x48c52f[_0xa757('0x4a')]=_[_0xa757('0x4c')](db[_0xa757('0x47')][_0xa757('0xbb')]);_0x48c52f[_0xa757('0x4b')]=_['keys'](_0x3404f1[_0xa757('0x4b')]);_0x48c52f[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x48c52f[_0xa757('0x4a')],_0x48c52f[_0xa757('0x4b')]);_0x1d03a7['attributes']=_['intersection'](_0x48c52f[_0xa757('0x4a')],qs['fields'](_0x3404f1[_0xa757('0x4b')]['fields']));_0x1d03a7[_0xa757('0x4e')]=_0x1d03a7[_0xa757('0x4e')][_0xa757('0x6c')]?_0x1d03a7[_0xa757('0x4e')]:_0x48c52f[_0xa757('0x4a')];if(_0x3404f1[_0xa757('0x4b')][_0xa757('0xbc')]){_0x1d03a7[_0xa757('0xbd')]=[{'all':!![]}];}_0x1d03a7=_[_0xa757('0x38')]({},_0x1d03a7,_0x3404f1[_0xa757('0xbe')]);return db[_0xa757('0x47')]['find'](_0x1d03a7)[_0xa757('0x32')](handleEntityNotFound(_0x2edad2,null))[_0xa757('0x32')](respondWithResult(_0x2edad2,null))[_0xa757('0x45')](handleError(_0x2edad2,null));};exports[_0xa757('0xbf')]=function(_0x1f308f,_0x1ea6d7){return db['ChatInteraction'][_0xa757('0xbf')](_0x1f308f[_0xa757('0x39')],{})['then'](respondWithResult(_0x1ea6d7,0xc9))[_0xa757('0x45')](handleError(_0x1ea6d7,null));};exports[_0xa757('0x31')]=function(_0x1f4782,_0x5e6171){if(_0x1f4782[_0xa757('0x39')]['id']){delete _0x1f4782[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x1f4782[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x5e6171,null))[_0xa757('0x32')](saveUpdates(_0x1f4782['body'],null))['then'](respondWithResult(_0x5e6171,null))[_0xa757('0x45')](handleError(_0x5e6171,null));};exports['destroy']=function(_0x5d9102,_0x44023e){return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x5d9102[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x44023e,null))[_0xa757('0x32')](removeEntity(_0x44023e,null))['catch'](handleError(_0x44023e,null));};exports['describe']=function(_0x556b78,_0x4b4a87){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x4b4a87,null))[_0xa757('0x45')](handleError(_0x4b4a87,null));};exports['createVidaooSession']=function(_0x1ba0df,_0xccb91e){var _0x146305=_0x1ba0df[_0xa757('0xba')]['id'];var _0x46fd6b;var _0xc0a523;var _0x399952;return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0x146305}})['then'](function(_0x4dd40a){_0x46fd6b=_0x4dd40a;return db[_0xa757('0xc1')][_0xa757('0xc0')]({'where':{'id':_0x4dd40a[_0xa757('0x83')]},'attributes':['id',_0xa757('0xc2'),'vidaooEscalation',_0xa757('0xc3'),_0xa757('0xc4'),_0xa757('0xc5')],'raw':!![]});})[_0xa757('0x32')](function(_0x30c170){if(_0x30c170&&_0x30c170[_0xa757('0xc2')]&&_0x30c170[_0xa757('0xc6')]){_0xc0a523=_0x30c170;var _0x4e552d={'interaction':{'id':_0x146305},'agent':{'id':_0x1ba0df[_0xa757('0xa0')]['id'],'name':_0x1ba0df[_0xa757('0xa0')]['name'],'fullname':_0x1ba0df[_0xa757('0xa0')][_0xa757('0xc7')],'email':_0x1ba0df[_0xa757('0xa0')][_0xa757('0xc8')]},'contact':_0x1ba0df[_0xa757('0x39')]['contact'],'account':_0x1ba0df[_0xa757('0x39')][_0xa757('0x3d')]};var _0x3d031d={'rejectUnauthorized':![],'method':'POST','url':_0xa757('0xc9'),'headers':{'X-APIKEY':_0x30c170[_0xa757('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ba0df[_0xa757('0xa0')]['email']],'buttons':null,'topic':_0xc0a523[_0xa757('0xc3')],'note':_[_0xa757('0xca')](_0xc0a523[_0xa757('0xc4')])?null:getMustacheRender(_0xc0a523[_0xa757('0xc4')],_0x4e552d),'metadata':null},'redirect':_0xa757('0xcb'),'json':!![]};try{if(!_['isNull'](_0xc0a523[_0xa757('0xc5')])){var _0x4b440e=getMustacheRender(_0xc0a523['vidaooMetadata'],_0x4e552d);var _0x6e9075=JSON[_0xa757('0x86')](_0x4b440e);_0x3d031d[_0xa757('0x39')][_0xa757('0xcc')]=_0x6e9075;}}catch(_0x4d3423){throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xce'));}return rp(_0x3d031d);}else{throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xcf'));}})[_0xa757('0x32')](function(_0xad41e1){_0x399952=_0xad41e1;if(_0x399952['id']){var _0x564db3={'body':_0x399952[_0xa757('0xd0')],'ChatWebsiteId':_0xc0a523['id'],'ChatInteractionId':_0x46fd6b['id'],'direction':_0xa757('0xd1'),'UserId':_0x1ba0df[_0xa757('0xa0')]['id']};return db[_0xa757('0xd2')][_0xa757('0xbf')](_0x564db3,{});}else{throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xd3'));}})[_0xa757('0x32')](function(){return _0x46fd6b['updateAttributes']({'vidaooSessionId':_0x399952['id']});})['then'](respondWithResult(_0xccb91e,null))[_0xa757('0x45')](handleError(_0xccb91e,null));};exports[_0xa757('0xd4')]=function(_0x542faf,_0x3e7174){if(_0x542faf['body']['id']){delete _0x542faf[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x542faf[_0xa757('0xba')]['id']},'include':[{'model':db[_0xa757('0xd5')],'as':_0xa757('0x72')}]})[_0xa757('0x32')](handleEntityNotFound(_0x3e7174,null))[_0xa757('0x32')](saveUpdates(_0x542faf[_0xa757('0x39')],null))['then'](respondWithResult(_0x3e7174,null))[_0xa757('0x45')](handleError(_0x3e7174,null));};exports[_0xa757('0xd6')]=function(_0x4a7a69,_0xea878b,_0x434c4b){if(_0x4a7a69[_0xa757('0x39')]['id']){delete _0x4a7a69[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x4a7a69[_0xa757('0xba')]['id']}})[_0xa757('0x32')](function(_0x2ea80d){if(!_0x2ea80d){logger[_0xa757('0x22')](_0xa757('0xd7'),_0xa757('0xd6'),0x194,'entity\x20not\x20found');_0xea878b[_0xa757('0x25')](0x194);}else{if(_0x2ea80d[_0xa757('0xd8')]){throw new db['Sequelize'][(_0xa757('0xcd'))](_0xa757('0xd9'));}}return _0x2ea80d;})['then'](function(_0x124eff){if(_0x124eff){return _0x124eff[_0xa757('0x31')]({'closed':_0x4a7a69[_0xa757('0x39')][_0xa757('0xda')],'disposition':_0x4a7a69['body']['disposition']})[_0xa757('0x32')](function(_0x48a9d0){return _0x48a9d0;});}})[_0xa757('0x32')](function(_0x551930){return respondWithRpcPromise(_0xa757('0xdb'),_0xa757('0xd6'),_0x4a7a69[_0xa757('0x39')],client9004);})[_0xa757('0x32')](respondWithResult(_0xea878b,null))[_0xa757('0x45')](handleError(_0xea878b,null));};exports['attachmentUpload']=function(_0x54385d,_0xa77319,_0x7c238d){_0x54385d[_0xa757('0x39')][_0xa757('0x35')]=_0x54385d['file']['originalname'];_0x54385d[_0xa757('0x39')]['basename']=_0x54385d[_0xa757('0xdc')][_0xa757('0xdd')];_0x54385d[_0xa757('0x39')][_0xa757('0x7e')]=_0x54385d[_0xa757('0xdc')][_0xa757('0xde')];return db[_0xa757('0xdf')]['create'](_0x54385d[_0xa757('0x39')])[_0xa757('0x32')](respondWithResult(_0xa77319,0xc9))[_0xa757('0x45')](handleError(_0xa77319,null));};exports[_0xa757('0xe0')]=function(_0x177db5,_0x1f678e,_0x377663){return db['ChatInteraction']['findOne']({'where':{'id':_0x177db5[_0xa757('0xba')]['id']},'raw':!![]})[_0xa757('0x32')](handleEntityNotFound(_0x1f678e,null))[_0xa757('0x32')](function(_0x54da87){if(_0x54da87){if(_0x54da87[_0xa757('0xda')]){return _0x1f678e[_0xa757('0x26')](0x193)['json']({'status':0x193,'message':_0xa757('0xe1')});}return db['Attachment'][_0xa757('0xc0')]({'where':{'id':_0x177db5[_0xa757('0x4b')][_0xa757('0xe2')]},'raw':!![]})[_0xa757('0x32')](handleEntityNotFound(_0x1f678e,null));}})[_0xa757('0x32')](function(_0x1b4e62){if(_0x1b4e62){var _0x42e409=_0x1b4e62[_0xa757('0xe3')]!==null;var _0x19f834=path[_0xa757('0xe4')](config['root'],'server/files/attachments/');if(_0x42e409){_0x19f834=path[_0xa757('0xe4')](_0x19f834,'offline-chat/');}var _0x4bd0a6=path[_0xa757('0xe4')](_0x19f834,_0x1b4e62[_0xa757('0xe5')]);return _0x1f678e['download'](_0x4bd0a6);}})[_0xa757('0x45')](handleError(_0x1f678e,null));};exports['close']=function(_0x334f77,_0x45dc56){var _0x2fe93c=null;var _0x101410=null;var _0x2cc39e=null;var _0x1aa70d=null;if(_0x334f77[_0xa757('0x39')]['id']){delete _0x334f77[_0xa757('0x39')]['id'];}if(_0x334f77['body']['mailTranscript']){_0x1aa70d=path[_0xa757('0xe4')](config['root'],_0xa757('0xe6'),util[_0xa757('0xe7')](_0xa757('0xe8'),Date[_0xa757('0xe9')]()));_0x334f77[_0xa757('0x39')][_0xa757('0xea')]=_0x1aa70d;}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x334f77['params']['id']},'include':[{'model':db[_0xa757('0xd2')],'as':'Messages','include':[{'model':db['User'],'as':_0xa757('0x7d')}]}]})[_0xa757('0x32')](handleEntityNotFound(_0x45dc56,null))[_0xa757('0x32')](saveUpdates(_0x334f77[_0xa757('0x39')],null))['then'](function(_0xce5af4){if(_0xce5af4){_0x2fe93c=_0xce5af4;return db['ChatWebsite'][_0xa757('0x6d')]({'where':{'id':_0x2fe93c['ChatWebsiteId']}});}})[_0xa757('0x32')](function(_0x3e9009){if(_0x3e9009){_0x2cc39e=_0x3e9009;return db['CmContact'][_0xa757('0x6d')]({'where':{'id':_0x2fe93c[_0xa757('0x77')]}});}})['then'](function(_0x2a5b41){if(_0x2a5b41){_0x101410=_0x2a5b41;if(_0x1aa70d){var _0x1ec56a=null;for(var _0xa09d83=0x1;_0xa09d83<_0x2fe93c[_0xa757('0xeb')][_0xa757('0x6c')];++_0xa09d83){_0x1ec56a=_0x2fe93c[_0xa757('0xeb')][_0xa09d83];var _0x2439f9=_0x1ec56a['UserId']?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e['agentAlias'],_0x1ec56a['UserId']):_0xa757('0xed');var _0x30f2da=_0x334f77[_0xa757('0x39')][_0xa757('0xee')]||util[_0xa757('0xe7')](_0xa757('0xec'),_0xa757('0xef'),_0x1ec56a[_0xa757('0x77')]);switch(_0x2cc39e[_0xa757('0xf0')]){case _0xa757('0xf1'):_0x2439f9=_0x1ec56a[_0xa757('0xd8')]?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e['agentAlias'],_0x1ec56a[_0xa757('0xd8')]):_0xa757('0xed');break;case _0xa757('0xf2'):_0x2439f9=_0x1ec56a['UserId']?_0x1ec56a['User'][_0xa757('0xf3')]||_0x1ec56a[_0xa757('0x7d')]['fullname']:_0xa757('0xed');break;case _0xa757('0xf4'):_0x2439f9=_0x1ec56a['UserId']?_0x1ec56a[_0xa757('0x7d')]['fullname']:_0xa757('0xed');break;default:_0x2439f9=_0x1ec56a[_0xa757('0xd8')]?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e[_0xa757('0xf5')],_0x1ec56a[_0xa757('0xd8')]):_0xa757('0xed');}var _0x69af1f=util['format'](_0xa757('0xf6'),moment(_0x1ec56a['createdAt'])['format'](_0xa757('0xf7')),_0x1ec56a[_0xa757('0xf8')]==='in'?_0x30f2da:_0x2439f9,_0x1ec56a['body']);if(!_0x1ec56a['secret']){fs['appendFileSync'](_0x1aa70d,_0x69af1f);}}return db[_0xa757('0xf9')][_0xa757('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xa757('0xfa')],'as':'Smtp','raw':!![]}]});}}})[_0xa757('0x32')](function(_0x2e76e5){if(_0x2e76e5&&_0x2e76e5[_0xa757('0xfb')]&&_0x334f77[_0xa757('0x39')]){var _0x1caccc={'tls':{'rejectUnauthorized':![]}};if(_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfc')]){_0x1caccc[_0xa757('0xfc')]=_0x2e76e5['Smtp'][_0xa757('0xfc')];}else{_0x1caccc['host']=_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfd')];_0x1caccc[_0xa757('0xfe')]=_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfe')];_0x1caccc['secure']=_0x2e76e5[_0xa757('0xfb')]['secure'];}if(_0x2e76e5[_0xa757('0xfb')][_0xa757('0xff')]){_0x1caccc[_0xa757('0x100')]={'user':_0x2e76e5[_0xa757('0xfb')][_0xa757('0xa0')],'pass':_0x2e76e5[_0xa757('0xfb')][_0xa757('0x101')]};}return respondWithRpcPromise(_0xa757('0x102'),_0xa757('0x103'),{'account':_0x1caccc,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2e76e5[_0xa757('0x35')],_0x2e76e5[_0xa757('0xc8')]||_0x2e76e5['Smtp'][_0xa757('0xa0')]),'to':_0x334f77[_0xa757('0x39')]['mailTranscript'],'subject':_0xa757('0x104'),'text':util['format'](_0xa757('0x105'),_0x334f77[_0xa757('0x39')][_0xa757('0x106')]),'attachments':[{'path':_0x1aa70d}]}})[_0xa757('0x32')](function(){return _0x2fe93c;})[_0xa757('0x45')](function(_0xa285fa){console[_0xa757('0x22')](_0xa285fa);});}else{return _0x2fe93c;}})[_0xa757('0x32')](respondWithStatusCode(_0x45dc56,0xc8))[_0xa757('0x45')](handleError(_0x45dc56,null));};exports[_0xa757('0x107')]=function(_0x379660,_0x36643f,_0xe704f0){return db['ChatMessage']['find']({'where':{'id':_0x379660[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x36643f,null))[_0xa757('0x32')](function(_0x4f1a01){if(_0x4f1a01){return _0x4f1a01[_0xa757('0x107')](_0x379660[_0xa757('0x39')][_0xa757('0x108')],_[_0xa757('0x109')](_0x379660[_0xa757('0x39')],['ids','id'])||{});}})['then'](respondWithResult(_0x36643f,null))[_0xa757('0x45')](handleError(_0x36643f,null));};exports[_0xa757('0x10a')]=function(_0xada3bd,_0x566095,_0x25c4da){var _0x35b41e={'raw':![],'where':{}};var _0x4b60b9={};var _0x2d7d24={'count':0x0,'rows':[]};return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0xada3bd['params']['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x566095,null))[_0xa757('0x32')](function(_0x1b702f){if(_0x1b702f){_0x4b60b9[_0xa757('0x4a')]=_[_0xa757('0x4c')](db[_0xa757('0xd2')][_0xa757('0xbb')]);_0x4b60b9['query']=_[_0xa757('0x4c')](_0xada3bd['query']);_0x4b60b9[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x4b60b9[_0xa757('0x4a')],_0x4b60b9[_0xa757('0x4b')]);_0x35b41e['attributes']=_['intersection'](_0x4b60b9[_0xa757('0x4a')],qs[_0xa757('0x4f')](_0xada3bd[_0xa757('0x4b')][_0xa757('0x4f')]));_0x35b41e[_0xa757('0x4e')]=_0x35b41e['attributes']['length']?_0x35b41e[_0xa757('0x4e')]:_0x4b60b9[_0xa757('0x4a')];if(!_0xada3bd[_0xa757('0x4b')][_0xa757('0x50')](_0xa757('0x51'))){_0x35b41e[_0xa757('0x2a')]=qs['limit'](_0xada3bd[_0xa757('0x4b')][_0xa757('0x2a')]);_0x35b41e[_0xa757('0x29')]=qs['offset'](_0xada3bd[_0xa757('0x4b')][_0xa757('0x29')]);}_0x35b41e[_0xa757('0x52')]=qs[_0xa757('0x53')](_0xada3bd[_0xa757('0x4b')][_0xa757('0x53')]);_0x35b41e[_0xa757('0x54')]=qs['filters'](_[_0xa757('0x56')](_0xada3bd[_0xa757('0x4b')],_0x4b60b9[_0xa757('0x55')]));_0x35b41e[_0xa757('0x54')][_0xa757('0xb7')]=_0x1b702f['id'];if(_0xada3bd[_0xa757('0x4b')][_0xa757('0x90')]){_0x35b41e['where']=_[_0xa757('0x38')](_0x35b41e['where'],{'$or':_[_0xa757('0x3f')](_0x35b41e['attributes'],function(_0x4438ec){var _0x1491c7={};_0x1491c7[_0x4438ec]={'$like':'%'+_0xada3bd[_0xa757('0x4b')]['filter']+'%'};return _0x1491c7;})});}if(_0xada3bd['query']['$gte']){var _0xa89e07=_0xada3bd[_0xa757('0x4b')][_0xa757('0x10b')][_0xa757('0x42')](',');var _0x560b05={};_0x560b05[_0xa89e07[0x0]]={'$gte':moment(_0xa89e07[0x1])[_0xa757('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x35b41e[_0xa757('0x54')]=_[_0xa757('0x38')](_0x35b41e[_0xa757('0x54')],_0x560b05);}_0x35b41e=_['merge']({},_0x35b41e,_0xada3bd[_0xa757('0xbe')]);return db['ChatMessage'][_0xa757('0x28')]({'where':_0x35b41e[_0xa757('0x54')]})['then'](function(_0x31c25e){_0x2d7d24[_0xa757('0x28')]=_0x31c25e;if(_0xada3bd[_0xa757('0x4b')]['includeAll']){_0x35b41e['include']=[{'all':!![]}];}return db['ChatMessage'][_0xa757('0x10c')](_0x35b41e);})[_0xa757('0x32')](function(_0x4867c8){_0x2d7d24['rows']=_0x4867c8;return _0x2d7d24;});}})[_0xa757('0x32')](respondWithFilteredResult(_0x566095,_0x35b41e))[_0xa757('0x45')](handleError(_0x566095,null));};exports[_0xa757('0x10d')]=function(_0x4da912,_0x4b0e40,_0x4fe6f5){var _0x3cf8d3={'where':{}},_0x1a1605={},_0x4074a3={'count':0x0,'rows':[]};return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0x4da912[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x4b0e40,null))[_0xa757('0x32')](function(_0x4b3270){if(_0x4b3270){_0x1a1605[_0xa757('0x4a')]=_[_0xa757('0x4c')](db['ChatMessage'][_0xa757('0xbb')]);_0x1a1605[_0xa757('0x4b')]=_[_0xa757('0x4c')](_0x4da912[_0xa757('0x4b')]);_0x1a1605[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x1a1605[_0xa757('0x4a')],_0x1a1605[_0xa757('0x4b')]);_0x3cf8d3[_0xa757('0x4e')]=_[_0xa757('0x4d')](_0x1a1605[_0xa757('0x4a')],qs[_0xa757('0x4f')](_0x4da912['query']['fields']));_0x3cf8d3[_0xa757('0x4e')]=_0x3cf8d3[_0xa757('0x4e')][_0xa757('0x6c')]?_0x3cf8d3[_0xa757('0x4e')]:_0x1a1605[_0xa757('0x4a')];if(!_0x4da912[_0xa757('0x4b')][_0xa757('0x50')]('nolimit')){_0x3cf8d3[_0xa757('0x2a')]=qs[_0xa757('0x2a')](_0x4da912[_0xa757('0x4b')][_0xa757('0x2a')]);_0x3cf8d3[_0xa757('0x29')]=qs[_0xa757('0x29')](_0x4da912[_0xa757('0x4b')]['offset']);}_0x3cf8d3[_0xa757('0x52')]=qs[_0xa757('0x53')](_0x4da912['query']['sort']);_0x3cf8d3['where']=qs[_0xa757('0x55')](_['pick'](_0x4da912['query'],_0x1a1605[_0xa757('0x55')]));_0x3cf8d3[_0xa757('0x54')][_0xa757('0xb7')]=_0x4b3270['id'];if(_0x4da912[_0xa757('0x4b')]['filter']){_0x3cf8d3[_0xa757('0x54')]=_[_0xa757('0x38')](_0x3cf8d3['where'],{'$or':_[_0xa757('0x3f')](_0x3cf8d3[_0xa757('0x4e')],function(_0x2782e3){var _0x2f8045={};_0x2f8045[_0x2782e3]={'$like':'%'+_0x4da912['query'][_0xa757('0x90')]+'%'};return _0x2f8045;})});}_0x3cf8d3[_0xa757('0x54')][_0xa757('0x10e')]=![];if(_0x4da912[_0xa757('0x4b')]['id']){_0x3cf8d3[_0xa757('0x54')]['id']={'$gt':_0x4da912[_0xa757('0x4b')]['id']};}_0x3cf8d3=_[_0xa757('0x38')]({},_0x3cf8d3,_0x4da912[_0xa757('0xbe')]);return db[_0xa757('0xd2')]['count']({'where':_0x3cf8d3[_0xa757('0x54')]})[_0xa757('0x32')](function(_0x409ae1){_0x4074a3[_0xa757('0x28')]=_0x409ae1;_0x3cf8d3[_0xa757('0xbd')]=[];if(_0x4da912[_0xa757('0x4b')][_0xa757('0x10f')]){_0x3cf8d3['include'][_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x7d'),'attributes':['id',_0xa757('0xc7'),_0xa757('0xf3')]});}if(_0x4da912[_0xa757('0x4b')][_0xa757('0xbc')]){_0x3cf8d3[_0xa757('0xbd')]=[{'all':!![]}];}return db[_0xa757('0xd2')]['findAll'](_0x3cf8d3);})[_0xa757('0x32')](function(_0x4c86fd){_0x4074a3['rows']=_0x4c86fd;return _0x4074a3;});}})[_0xa757('0x32')](respondWithFilteredResult(_0x4b0e40,_0x3cf8d3))['catch'](handleError(_0x4b0e40,null));};exports[_0xa757('0x110')]=function(_0x40e0df,_0x54f4ca,_0x4152da){return db['ChatInteraction']['find']({'where':{'id':_0x40e0df[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x54f4ca,null))['then'](function(_0x59ff48){if(_0x59ff48){return _0x59ff48[_0xa757('0x111')](_0x40e0df['body'][_0xa757('0x108')],_[_0xa757('0x109')](_0x40e0df[_0xa757('0x39')],[_0xa757('0x108'),'id'])||{})['spread'](function(){return db[_0xa757('0x7a')][_0xa757('0x10c')]({'attributes':['id',_0xa757('0x35'),_0xa757('0x112')],'where':{'id':_0x40e0df[_0xa757('0x39')][_0xa757('0x108')]}});})[_0xa757('0x32')](function(_0x5d2063){socket[_0xa757('0x113')](_0xa757('0x114'),{'id':Number(_0x40e0df['params']['id']),'tags':_0x5d2063||[]});return{'id':Number(_0x40e0df[_0xa757('0xba')]['id']),'tags':_0x5d2063||[]};});}})[_0xa757('0x32')](respondWithResult(_0x54f4ca,null))['catch'](handleError(_0x54f4ca,null));};exports[_0xa757('0x115')]=function(_0x1474f7,_0x1449d4,_0x2aaf2a){return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x1474f7[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x1449d4,null))[_0xa757('0x32')](function(_0x1ba7d0){if(_0x1ba7d0){return _0x1ba7d0[_0xa757('0x115')](_0x1474f7[_0xa757('0x4b')]['ids']);}})[_0xa757('0x32')](respondWithStatusCode(_0x1449d4,null))[_0xa757('0x45')](handleError(_0x1449d4,null));};exports[_0xa757('0x116')]=function(_0x563988,_0x43e9cb){var _0xaf7112=moment()['unix']()[_0xa757('0xa3')]();var _0x5ea526=path[_0xa757('0xe4')](config['root'],_0xa757('0x117'),_0xa757('0x118'),_0xa757('0x119'));var _0x58f20d=path[_0xa757('0xe4')](config[_0xa757('0x11a')],_0xa757('0x117'),_0xa757('0x118'),_0xa757('0x11b'));var _0x4b274f=path[_0xa757('0xe4')](_0x5ea526,_0xaf7112);var _0x225b14=util[_0xa757('0xe7')](_0xa757('0x11c'),_0x563988[_0xa757('0xba')]['id'],_0xaf7112);var _0x14d04e=path['join'](_0x5ea526,_0x225b14);var _0x3798ea=[];_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x7d'),'attributes':['id',_0xa757('0xc7')],'raw':!![]});_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0xd5')],'as':'Contact','attributes':['id',_0xa757('0x11d'),'lastName'],'raw':!![]});if(_0x563988['query'][_0xa757('0x11b')]){_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0xdf')],'as':'Attachment','raw':!![]});}var _0x3bd69c=[{'model':db['ChatMessage'],'as':_0xa757('0xeb'),'attributes':['id',_0xa757('0x39'),'createdAt',_0xa757('0xf8'),'secret',_0xa757('0x8c')],'include':_0x3798ea}];_0x3bd69c[_0xa757('0x44')]({'model':db[_0xa757('0xc1')],'as':_0xa757('0x11e'),'attributes':['id',_0xa757('0x35')]});_0x3bd69c[_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x11f'),'attributes':['id',_0xa757('0xc7')]});return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x563988['params']['id']},'include':_0x3bd69c})[_0xa757('0x32')](handleEntityNotFound(_0x43e9cb,null))[_0xa757('0x32')](function(_0x374216){if(_0x374216){var _0x1a8c73=_0x374216[_0xa757('0x120')]({'plain':!![]});fs[_0xa757('0x121')](_0x4b274f);var _0xd20b89={'channel':_0xa757('0x122'),'account':_0x1a8c73['Account'][_0xa757('0x35')],'agent':_0x1a8c73['Owner']?_0x1a8c73[_0xa757('0x11f')][_0xa757('0xc7')]:_0xa757('0x123'),'createdAt':moment(_0x1a8c73[_0xa757('0x85')])[_0xa757('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa757('0xa3')](),'closedAt':_0x1a8c73[_0xa757('0xda')]?moment(_0x1a8c73[_0xa757('0x124')])['format'](_0xa757('0x125'))['toString']():'','disposition':_0x1a8c73['disposition'],'chatInfo':{'browser':_0x1a8c73[_0xa757('0x126')],'os':_0x1a8c73[_0xa757('0x127')],'referer':_0x1a8c73[_0xa757('0x128')],'customerIp':_0x1a8c73[_0xa757('0x129')],'customerPort':_0x1a8c73['customerPort']?_0x1a8c73[_0xa757('0x12a')]:_0xa757('0x123')},'messages':_(_0x1a8c73[_0xa757('0xeb')])[_0xa757('0x12b')]()[_0xa757('0x90')]({'secret':![]})['map'](function(_0x535599){if(_0x535599['Attachment']){var _0x56c9b9=path[_0xa757('0xe4')](_0x58f20d,_0x535599['Attachment'][_0xa757('0xe5')]);if(fs[_0xa757('0x12c')](_0x56c9b9)){fs[_0xa757('0x12d')](_0x56c9b9)[_0xa757('0x12e')](fs[_0xa757('0x12f')](path[_0xa757('0xe4')](_0x4b274f,_0x535599[_0xa757('0xdf')][_0xa757('0xe5')])));}}return{'date':moment(_0x535599[_0xa757('0x85')])[_0xa757('0xe7')](_0xa757('0x125'))[_0xa757('0xa3')](),'sender':_0x535599[_0xa757('0xf8')]===_0xa757('0xd1')?_0x535599[_0xa757('0x7d')]?_0x535599[_0xa757('0x7d')][_0xa757('0xc7')]:_0xa757('0xed'):_0x535599[_0xa757('0x72')][_0xa757('0x11d')]+(_0x535599[_0xa757('0x72')][_0xa757('0x130')]?'\x20'+_0x535599[_0xa757('0x72')][_0xa757('0x130')]:''),'body':_0x535599[_0xa757('0xdf')]?_0x535599[_0xa757('0xdf')][_0xa757('0xe5')]:_0x535599[_0xa757('0x39')],'direction':_0x535599['direction']===_0xa757('0xd1')?'A':'C','secret':_0x535599[_0xa757('0x10e')],'read':_0x535599[_0xa757('0x8c')],'attachment':_0x535599[_0xa757('0xdf')]};})['value']()};return ejs[_0xa757('0x131')](path[_0xa757('0xe4')](config[_0xa757('0x11a')],_0xa757('0x117'),_0xa757('0x132'),_0xa757('0x133')),{'interaction':_0xd20b89})[_0xa757('0x32')](function(_0xd7df6f){var _0x7e03ff=path[_0xa757('0xe4')](_0x4b274f,_0xa757('0x134')+_0x1a8c73['id']+'-'+_0xaf7112+_0xa757('0x135'));var _0x1d21e7={'path':_0x7e03ff,'channel':_0xa757('0x122'),'interactionId':_0x1a8c73['id']};return pdf['createPdfFromHTML'](_0xd7df6f,_0x1d21e7);})[_0xa757('0x32')](function(){return new BPromise(function(_0xacfa4b,_0x567517){zipdir(_0x4b274f,{'saveTo':_0x14d04e},function(_0x22e7f5,_0x435552){if(_0x22e7f5)return _0x567517(_0x22e7f5);return _0xacfa4b(_0x435552);});})[_0xa757('0x32')](function(){return new BPromise(function(_0x466f7b,_0x4f5ae1){rimraf(_0x4b274f,function(_0x404003){if(_0x404003)_0x4f5ae1(_0x404003);return _0x466f7b();});});})[_0xa757('0x32')](function(){return _0x43e9cb[_0xa757('0x116')](_0x14d04e,_0x225b14,function(_0x34f745){if(_0x34f745){console[_0xa757('0x136')](_0xa757('0x137'),_0x34f745);}else{fs[_0xa757('0x138')](_0x14d04e);}});});});}else{return _0x43e9cb[_0xa757('0x25')](0xc8);}})[_0xa757('0x45')](handleError(_0x43e9cb,null));}; \ No newline at end of file +var _0xd943=['Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','server','views','downloadInteraction.ejs','transcript-','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','Content-Range','reject','save','update','destroy','stack','name','send','render','body','contact','agent','account','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','`\x20=\x200','having','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','authentication','auth','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript'];(function(_0x976d70,_0x263931){var _0x221d06=function(_0x29c746){while(--_0x29c746){_0x976d70['push'](_0x976d70['shift']());}};_0x221d06(++_0x263931);}(_0xd943,0x15d));var _0x3d94=function(_0x2af4e6,_0x51f950){_0x2af4e6=_0x2af4e6-0x0;var _0x302b93=_0xd943[_0x2af4e6];return _0x302b93;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3d94('0x10'));var hardwareService=require(_0x3d94('0x11'));var logger=require('../../config/logger')(_0x3d94('0x12'));var utils=require(_0x3d94('0x13'));var config=require(_0x3d94('0x14'));var licenseUtil=require(_0x3d94('0x15'));var db=require(_0x3d94('0x16'))['db'];config['redis']=_[_0x3d94('0x17')](config[_0x3d94('0x18')],{'host':_0x3d94('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x18')]));require(_0x3d94('0x1a'))[_0x3d94('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232b});var client9004=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xaf939a,_0xd8efaa,_0x31c6e8,_0x9893cb){return new BPromise(function(_0x540658,_0x22676a){var _0x1a9315=_0x9893cb||client;return _0x1a9315[_0x3d94('0x1e')](_0xaf939a,_0x31c6e8)[_0x3d94('0x1f')](function(_0x4afc92){logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,'request\x20sent');logger[_0x3d94('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd8efaa,_0x3d94('0x23'),JSON[_0x3d94('0x24')](_0x4afc92));if(_0x4afc92[_0x3d94('0x25')]){if(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x26')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x22676a(_0x4afc92[_0x3d94('0x25')]['message']);}logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x540658(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,_0x3d94('0x23'));_0x540658(_0x4afc92[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x292976){logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x292976);_0x22676a(_0x292976);});});}function respondWithStatusCode(_0x5b3b31,_0x123183){_0x123183=_0x123183||0xcc;return function(_0x558fd2){if(_0x558fd2){return _0x5b3b31[_0x3d94('0x2a')](_0x123183);}return _0x5b3b31[_0x3d94('0x2b')](_0x123183)[_0x3d94('0x2c')]();};}function respondWithResult(_0x439173,_0x13254f){_0x13254f=_0x13254f||0xc8;return function(_0x82b568){if(_0x82b568){return _0x439173[_0x3d94('0x2b')](_0x13254f)['json'](_0x82b568);}};}function respondWithFilteredResult(_0x584c4a,_0x362642){return function(_0x4813e1){if(_0x4813e1){var _0x4dd410=typeof _0x362642[_0x3d94('0x2d')]==='undefined'&&typeof _0x362642[_0x3d94('0x2e')]===_0x3d94('0x2f');var _0x32403a=_0x4813e1['count'];var _0x2a07b4=_0x4dd410?0x0:_0x362642['offset'];var _0x3d4994=_0x4dd410?_0x4813e1['count']:_0x362642[_0x3d94('0x2d')]+_0x362642[_0x3d94('0x2e')];var _0x29b1ff;if(_0x3d4994>=_0x32403a){_0x3d4994=_0x32403a;_0x29b1ff=0xc8;}else{_0x29b1ff=0xce;}_0x584c4a[_0x3d94('0x2b')](_0x29b1ff);return _0x584c4a['set'](_0x3d94('0x30'),_0x2a07b4+'-'+_0x3d4994+'/'+_0x32403a)['json'](_0x4813e1);}return null;};}function patchUpdates(_0x1f9559){return function(_0xd294fd){try{jsonpatch['apply'](_0xd294fd,_0x1f9559,!![]);}catch(_0x5288da){return BPromise[_0x3d94('0x31')](_0x5288da);}return _0xd294fd[_0x3d94('0x32')]();};}function saveUpdates(_0x273337,_0x5cdb2e){return function(_0x1e6dbc){if(_0x1e6dbc){return _0x1e6dbc[_0x3d94('0x33')](_0x273337)['then'](function(_0x242500){return _0x242500;});}return null;};}function removeEntity(_0x23f3fe,_0x35947b){return function(_0xbda334){if(_0xbda334){return _0xbda334[_0x3d94('0x34')]()['then'](function(){_0x23f3fe[_0x3d94('0x2b')](0xcc)[_0x3d94('0x2c')]();});}};}function handleEntityNotFound(_0x41579e,_0x52bdb9){return function(_0xb493f1){if(!_0xb493f1){_0x41579e[_0x3d94('0x2a')](0x194);}return _0xb493f1;};}function handleError(_0x546658,_0x555ec5){_0x555ec5=_0x555ec5||0x1f4;return function(_0xfe58eb){logger[_0x3d94('0x25')](_0xfe58eb[_0x3d94('0x35')]);if(_0xfe58eb[_0x3d94('0x36')]){delete _0xfe58eb[_0x3d94('0x36')];}_0x546658[_0x3d94('0x2b')](_0x555ec5)[_0x3d94('0x37')](_0xfe58eb);};}function getMustacheRender(_0x12c01a,_0x2e7b97){return Mustache[_0x3d94('0x38')](_0x12c01a,_['merge'](_0x2e7b97[_0x3d94('0x39')],{'contact':_0x2e7b97[_0x3d94('0x3a')],'message':_0x2e7b97[_0x3d94('0x27')],'agent':_0x2e7b97[_0x3d94('0x3b')],'interaction':_0x2e7b97['interaction'],'account':_0x2e7b97[_0x3d94('0x3c')]}))||'';}function getInteractionUsers(_0x2bf3b2,_0x35e0e6){return new BPromise(function(_0x29eaa4,_0x22b7d2){try{if(_0x35e0e6[_0x2bf3b2['id']]){_0x2bf3b2['Users']=_[_0x3d94('0x3d')](_0x35e0e6[_0x2bf3b2['id']],function(_0x462ab6){return{'id':_0x462ab6['id'],'fullname':_0x462ab6[_0x3d94('0x3e')]};});}}catch(_0x485066){_0x22b7d2(_0x485066);}_0x29eaa4(_0x2bf3b2);});}function getInteractionTags(_0x4eee4d,_0x4d8a8f){return new BPromise(function(_0x47905e,_0x3b3550){try{if(_0x4eee4d[_0x3d94('0x3f')]){_0x4eee4d[_0x3d94('0x40')]=[];_0x4eee4d[_0x3d94('0x3f')][_0x3d94('0x41')](',')[_0x3d94('0x42')](function(_0x3a3898){_0x4eee4d['Tags']['push'](_0x4d8a8f[_0x3a3898]);});}delete _0x4eee4d[_0x3d94('0x3f')];}catch(_0x3ced26){_0x3b3550(_0x3ced26);}_0x47905e(_0x4eee4d);});}function updateChatInteraction(_0x512cef,_0x2d0aa2,_0x4af4b6){return new BPromise(function(_0x1361fb,_0x411b5b){return getInteractionUsers(_0x512cef,_0x4af4b6)[_0x3d94('0x1f')](function(_0xacfc44){return getInteractionTags(_0xacfc44,_0x2d0aa2);})[_0x3d94('0x1f')](function(_0x5a9263){_0x1361fb(_0x5a9263);})[_0x3d94('0x29')](function(_0x168771){_0x411b5b(_0x168771);});});}exports[_0x3d94('0x43')]=function(_0x5d5c66,_0x2910ea){var _0x555366={},_0x4bad90={},_0x3f4b32={'count':0x0,'rows':[]};var _0x402132=_[_0x3d94('0x3d')](db[_0x3d94('0x44')]['rawAttributes'],function(_0x323d58){return{'name':_0x323d58['fieldName'],'type':_0x323d58[_0x3d94('0x45')][_0x3d94('0x46')]};});_0x4bad90[_0x3d94('0x47')]=_[_0x3d94('0x3d')](_0x402132,_0x3d94('0x36'));_0x4bad90[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x5d5c66['query']);_0x4bad90[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4bad90['model'],_0x4bad90['query']);_0x555366[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4bad90['model'],qs[_0x3d94('0x4d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x555366[_0x3d94('0x4c')]=_0x555366[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x555366[_0x3d94('0x4c')]:_0x4bad90[_0x3d94('0x47')];if(!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x555366[_0x3d94('0x2e')]=qs[_0x3d94('0x2e')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x555366['offset']=qs[_0x3d94('0x2d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x555366[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x52')]);_0x555366[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_['pick'](_0x5d5c66[_0x3d94('0x48')],_0x4bad90['filters']),_0x402132);var _0x174eb3=[];var _0x3a7eb0=squel['select']()[_0x3d94('0x54')]('id')['field']('name')[_0x3d94('0x54')]('color')[_0x3d94('0x55')](_0x3d94('0x56'));var _0x5b6061=squel[_0x3d94('0x57')]()['field']('u.id')[_0x3d94('0x54')](_0x3d94('0x58'))[_0x3d94('0x54')](_0x3d94('0x59'))[_0x3d94('0x55')](_0x3d94('0x5a'),'ui')[_0x3d94('0x5b')](_0x3d94('0x5c'),'u',_0x3d94('0x5d'));var _0x584e1d=squel[_0x3d94('0x57')]()[_0x3d94('0x55')](_0x3d94('0x5e'),'i')[_0x3d94('0x5b')](_0x3d94('0x5f'),'c',_0x3d94('0x60'))[_0x3d94('0x5b')](_0x3d94('0x5c'),'o',_0x3d94('0x61'))[_0x3d94('0x5b')](_0x3d94('0x62'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3d94('0x5b')]('chat_messages','me',_0x3d94('0x63'))[_0x3d94('0x5b')](_0x3d94('0x64'),'it',_0x3d94('0x65'))[_0x3d94('0x5b')](_0x3d94('0x56'),'t',_0x3d94('0x66'));var _0x169aa1=squel[_0x3d94('0x67')]();var _0x5da38c=[];var _0x519ada=squel[_0x3d94('0x67')]();var _0x4bd97c;if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]){_0x4bd97c=as['parseSearch'](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]);var _0x3cb8f4=_0x4bd97c[_0x3d94('0x69')];for(var _0xcefff5=0x0;_0xcefff5<_0x4bd97c[_0x3d94('0x6a')][_0x3d94('0x4e')];_0xcefff5++){var _0x4b023e=_0x4bd97c[_0x3d94('0x6a')][_0xcefff5];var _0x351ea6='i';var _0x368581=_['find'](_0x402132,[_0x3d94('0x36'),_0x4b023e[_0x3d94('0x54')]]);if(!_0x368581){switch(_0x4b023e[_0x3d94('0x54')]){case _0x3d94('0x6b'):if(_0x4b023e['value']==0x1){_0x584e1d['having']('`'+_0x4b023e[_0x3d94('0x54')]+_0x3d94('0x6c'));}else{_0x584e1d[_0x3d94('0x6d')]('`'+_0x4b023e[_0x3d94('0x54')]+'`\x20>\x200');}break;case _0x3d94('0x6e'):if(_0x4b023e[_0x3d94('0x6f')]==='$substring'){if(_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')]('\x20')[_0x3d94('0x4e')]>0x1){_0x169aa1[_0x3cb8f4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3d94('0x71')](_0x4b023e[_0x3d94('0x70')]),null);}else{var _0x585531='%'+_0x4b023e['value']+'%';_0x169aa1[_0x3cb8f4](_0x3d94('0x72'),_0x585531,_0x585531,_0x585531);}}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','ContactId']);_0x4b023e['field']=_0x3d94('0x74');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')]['start'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case _0x3d94('0x77'):var _0x1e8e3d=_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')](',')['map'](function(_0x30673a){return Number(_0x30673a);});_0x1e8e3d['forEach'](function(_0x1f3551){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x1f3551+',%');});_0x5da38c=_[_0x3d94('0x79')](_0x5da38c,_0x1e8e3d);break;case _0x3d94('0x7a'):if(_0x4b023e[_0x3d94('0x6f')]===_0x3d94('0x7b')){_0x169aa1[_0x3cb8f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b023e['value']+'%',null);}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','UserId']);_0x4b023e['field']=_0x3d94('0x7c');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case'body':_0x55084e=as[_0x3d94('0x75')]('me',null,_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e['text'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);break;}}else{var _0x55084e=as['buildExpression'](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);}}}else{var _0x5b7316=_(_0x5d5c66[_0x3d94('0x48')])[_0x3d94('0x49')]()[_0x3d94('0x3d')](function(_0x57a4df){return _[_0x3d94('0x7e')](_0x402132,['name',_0x57a4df])?_0x57a4df:undefined;})[_0x3d94('0x7f')]()[_0x3d94('0x70')]();if(!_[_0x3d94('0x80')](_0x5b7316)){_0x5b7316[_0x3d94('0x42')](function(_0x3b42c8){if(_0x3b42c8===_0x3d94('0x81')){_0x584e1d[_0x3d94('0x53')](_0x3d94('0x82'),[][_0x3d94('0x83')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]));}else if(_0x3b42c8===_0x3d94('0x84')){var _0xe6cfd1=JSON[_0x3d94('0x85')](_0x5d5c66['query'][_0x3b42c8])[_0x3d94('0x86')];var _0x2819e2=JSON[_0x3d94('0x85')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8])['$lte'];_0x584e1d[_0x3d94('0x53')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe6cfd1,_0x2819e2);}else{if(_0x5d5c66['query'][_0x3b42c8]===_0x3d94('0x87')){_0x584e1d['where']('i.'+_0x3b42c8+_0x3d94('0x88'));}else{_0x584e1d[_0x3d94('0x53')]('i.'+_0x3b42c8+'\x20=\x20?',_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]);}}});}if(_0x5d5c66['query'][_0x3d94('0x89')]){if(_0x5d5c66[_0x3d94('0x48')]['read']==0x1){_0x584e1d['having']('`unreadMessages`\x20=\x200');}else{_0x584e1d[_0x3d94('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x5d5c66['query'][_0x3d94('0x8a')]){_0x5da38c=_[_0x3d94('0x8b')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')])?_0x5d5c66['query'][_0x3d94('0x8a')]:new Array(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')]);_0x5da38c[_0x3d94('0x42')](function(_0x38b411){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x38b411+',%');});}if(_0x5d5c66['query'][_0x3d94('0x8c')]){var _0x6cfc19=_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8c')][_0x3d94('0x8d')]('\x5c','\x5c\x5c')[_0x3d94('0x8d')](/'/g,'\x27\x27');if(qs[_0x3d94('0x8e')](_0x6cfc19)){_0x169aa1['or'](_0x3d94('0x8f'),_0x6cfc19+'%');}else{_0x169aa1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6cfc19))['or'](_0x3d94('0x90'),_0x6cfc19+'%');}}}_0x584e1d[_0x3d94('0x53')](_0x169aa1);_0x584e1d[_0x3d94('0x91')]('i.id');var _0x43a00e={'type':db[_0x3d94('0x92')][_0x3d94('0x93')][_0x3d94('0x94')],'raw':!![]};var _0x860ee5=_0x584e1d['clone']();_0x860ee5['field'](_0x3d94('0x95'));_0x860ee5[_0x3d94('0x54')](_0x3d94('0x96'),_0x3d94('0x6b'));if(_0x555366[_0x3d94('0x51')]){_0x555366[_0x3d94('0x51')][_0x3d94('0x42')](function(_0x3bcc86){var _0x462e88=_0x3bcc86[0x0]===_0x3d94('0x97')?_0x3bcc86[0x0]:'i.'+_0x3bcc86[0x0];_0x584e1d[_0x3d94('0x51')](_0x462e88,_0x3bcc86[0x1]===_0x3d94('0x98')?![]:!![]);});}if(!_[_0x3d94('0x80')](_0x5da38c)){_0x584e1d['having'](_0x519ada);_0x860ee5[_0x3d94('0x53')](_0x3d94('0x99'),_0x5da38c);}BPromise['resolve']()['then'](function(){if(!_0x4bd97c){if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return;_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9a'));_0x584e1d['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9c')]!==_0x3d94('0x3b'))return;return _0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38975f){if(_['isEmpty'](_0x38975f)){_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9e'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x860ee5[_0x3d94('0x53')](_0x3d94('0x82'),_['map'](_0x38975f,'id'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3d94('0x3d')](_0x38975f,'id'));}});})[_0x3d94('0x1f')](function(){if(_0x5d5c66[_0x3d94('0x9b')]['role']===_0x3d94('0x3b')&&!_0x4bd97c&&!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return[];return db['sequelize'][_0x3d94('0x48')](_0x860ee5[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1f0f6f){_0x3f4b32[_0x3d94('0xa0')]=_0x1f0f6f[_0x3d94('0x4e')];if(_0x3f4b32[_0x3d94('0xa0')]===0x0)return[];return db[_0x3d94('0xa1')]['query'](_0x3a7eb0[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x227d15){_0x174eb3=_[_0x3d94('0xa2')](_0x227d15,'id');_0x43a00e=_[_0x3d94('0xa3')](_0x43a00e,{'model':db[_0x3d94('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d5c66['query'][_0x3d94('0x4d')]){_0x555366[_0x3d94('0x4c')][_0x3d94('0x42')](function(_0x59b62b){_0x584e1d[_0x3d94('0x54')]('i.'+_0x59b62b);});}else{_0x584e1d['field'](_0x3d94('0x96'),_0x3d94('0x6b'));_0x584e1d['field'](_0x3d94('0xa4'),_0x3d94('0xa5'));_0x584e1d['field']('a.mandatoryDisposition',_0x3d94('0xa6'));_0x584e1d[_0x3d94('0x54')]('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');_0x584e1d['field'](_0x3d94('0xa7'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xa8'),_0x3d94('0xa9'));_0x584e1d[_0x3d94('0x54')]('c.lastName',_0x3d94('0xaa'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xab'),'Contact.email');_0x584e1d[_0x3d94('0x54')]('c.phone',_0x3d94('0xac'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xad'),_0x3d94('0xae'));_0x584e1d[_0x3d94('0x54')]('c.fax','Contact.fax');_0x584e1d[_0x3d94('0x54')](_0x3d94('0xaf'),'Owner.fullname');_0x584e1d[_0x3d94('0x54')]('o.internal',_0x3d94('0xb0'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xb1'),'TagIds');}if(_0x555366[_0x3d94('0x2e')])_0x584e1d['limit'](_0x555366[_0x3d94('0x2e')]);if(_0x555366[_0x3d94('0x2d')])_0x584e1d[_0x3d94('0x2d')](_0x555366[_0x3d94('0x2d')]);return db['sequelize']['query'](_0x584e1d[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1c2092){if(_0x1c2092[_0x3d94('0x4e')]>0x0)_0x5b6061['where'](_0x3d94('0xb2'),_['map'](_0x1c2092,'id'));return db['sequelize']['query'](_0x5b6061[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x3706ea){var _0xcd36ab=_[_0x3d94('0xb3')](_0x3706ea,_0x3d94('0xb4'));var _0x33af12=[];_0x1c2092[_0x3d94('0x42')](function(_0x2e2f9f){_0x33af12[_0x3d94('0xb5')](updateChatInteraction(_0x2e2f9f,_0x174eb3,_0xcd36ab));});return BPromise[_0x3d94('0xb6')](_0x33af12);});});})[_0x3d94('0x1f')](function(_0x42c91f){_0x3f4b32[_0x3d94('0xb7')]=_0x42c91f;return _0x3f4b32;})[_0x3d94('0x1f')](respondWithFilteredResult(_0x2910ea,_0x555366))['catch'](handleError(_0x2910ea,null));};exports['show']=function(_0x14ec29,_0x3ff668){var _0x1837c9={'raw':![],'where':{'id':_0x14ec29[_0x3d94('0xb8')]['id']}},_0x41251d={};_0x41251d[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatInteraction'][_0x3d94('0xb9')]);_0x41251d[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x14ec29[_0x3d94('0x48')]);_0x41251d[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x41251d['model'],_0x41251d['query']);_0x1837c9[_0x3d94('0x4c')]=_['intersection'](_0x41251d[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0x14ec29[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x1837c9[_0x3d94('0x4c')]=_0x1837c9[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x1837c9[_0x3d94('0x4c')]:_0x41251d['model'];if(_0x14ec29[_0x3d94('0x48')][_0x3d94('0xba')]){_0x1837c9[_0x3d94('0xbb')]=[{'all':!![]}];}_0x1837c9=_[_0x3d94('0xa3')]({},_0x1837c9,_0x14ec29[_0x3d94('0xbc')]);return db[_0x3d94('0x44')][_0x3d94('0x73')](_0x1837c9)[_0x3d94('0x1f')](handleEntityNotFound(_0x3ff668,null))[_0x3d94('0x1f')](respondWithResult(_0x3ff668,null))[_0x3d94('0x29')](handleError(_0x3ff668,null));};exports[_0x3d94('0xbd')]=function(_0x26c8ef,_0x17b789){return db[_0x3d94('0x44')][_0x3d94('0xbd')](_0x26c8ef[_0x3d94('0x39')],{})[_0x3d94('0x1f')](respondWithResult(_0x17b789,0xc9))[_0x3d94('0x29')](handleError(_0x17b789,null));};exports[_0x3d94('0x33')]=function(_0xe5f109,_0xb55889){if(_0xe5f109['body']['id']){delete _0xe5f109[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xe5f109[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0xb55889,null))[_0x3d94('0x1f')](saveUpdates(_0xe5f109['body'],null))[_0x3d94('0x1f')](respondWithResult(_0xb55889,null))[_0x3d94('0x29')](handleError(_0xb55889,null));};exports[_0x3d94('0x34')]=function(_0x3242ea,_0x17a478){return db[_0x3d94('0x44')]['find']({'where':{'id':_0x3242ea[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x17a478,null))['then'](removeEntity(_0x17a478,null))['catch'](handleError(_0x17a478,null));};exports['describe']=function(_0x3e1139,_0x77b79d){return db[_0x3d94('0x44')][_0x3d94('0xbe')]()[_0x3d94('0x1f')](respondWithResult(_0x77b79d,null))['catch'](handleError(_0x77b79d,null));};exports[_0x3d94('0xbf')]=function(_0x36499a,_0xd8488f){var _0x669d83=_0x36499a[_0x3d94('0xb8')]['id'];var _0x2c004f;var _0x5d10af;var _0x167d4c;return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x669d83}})[_0x3d94('0x1f')](function(_0x34e156){_0x2c004f=_0x34e156;return db[_0x3d94('0xc1')]['findOne']({'where':{'id':_0x34e156[_0x3d94('0x81')]},'attributes':['id',_0x3d94('0xc2'),_0x3d94('0xc3'),_0x3d94('0xc4'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x3d94('0x1f')](function(_0x24d10c){if(_0x24d10c&&_0x24d10c[_0x3d94('0xc2')]&&_0x24d10c['vidaooEscalation']){_0x5d10af=_0x24d10c;var _0x2fac35={'interaction':{'id':_0x669d83},'agent':{'id':_0x36499a['user']['id'],'name':_0x36499a['user'][_0x3d94('0x36')],'fullname':_0x36499a[_0x3d94('0x9b')]['fullname'],'email':_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]},'contact':_0x36499a[_0x3d94('0x39')]['contact'],'account':_0x36499a[_0x3d94('0x39')][_0x3d94('0x3c')]};var _0x579998={'rejectUnauthorized':![],'method':'POST','url':_0x3d94('0xc6'),'headers':{'X-APIKEY':_0x24d10c[_0x3d94('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]],'buttons':null,'topic':_0x5d10af[_0x3d94('0xc4')],'note':_[_0x3d94('0xc7')](_0x5d10af['vidaooNote'])?null:getMustacheRender(_0x5d10af['vidaooNote'],_0x2fac35),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5d10af[_0x3d94('0xc8')])){var _0x3950d1=getMustacheRender(_0x5d10af[_0x3d94('0xc8')],_0x2fac35);var _0x1073d3=JSON[_0x3d94('0x85')](_0x3950d1);_0x579998[_0x3d94('0x39')][_0x3d94('0xc9')]=_0x1073d3;}}catch(_0x23c9d4){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xcb'));}return rp(_0x579998);}else{throw new db['Sequelize'][(_0x3d94('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3d94('0x1f')](function(_0x149fab){_0x167d4c=_0x149fab;if(_0x167d4c['id']){var _0x15cda1={'body':_0x167d4c[_0x3d94('0xcc')],'ChatWebsiteId':_0x5d10af['id'],'ChatInteractionId':_0x2c004f['id'],'direction':_0x3d94('0xcd'),'UserId':_0x36499a[_0x3d94('0x9b')]['id']};return db[_0x3d94('0xce')][_0x3d94('0xbd')](_0x15cda1,{});}else{throw new db['Sequelize'][(_0x3d94('0xca'))](_0x3d94('0xcf'));}})[_0x3d94('0x1f')](function(){return _0x2c004f[_0x3d94('0xd0')]({'vidaooSessionId':_0x167d4c['id']});})[_0x3d94('0x1f')](respondWithResult(_0xd8488f,null))[_0x3d94('0x29')](handleError(_0xd8488f,null));};exports[_0x3d94('0xd1')]=function(_0x1b7ad4,_0x483e7a){if(_0x1b7ad4[_0x3d94('0x39')]['id']){delete _0x1b7ad4[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x1b7ad4[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xd2')],'as':_0x3d94('0x6e')}]})[_0x3d94('0x1f')](handleEntityNotFound(_0x483e7a,null))['then'](saveUpdates(_0x1b7ad4[_0x3d94('0x39')],null))[_0x3d94('0x1f')](respondWithResult(_0x483e7a,null))['catch'](handleError(_0x483e7a,null));};exports[_0x3d94('0xd3')]=function(_0x11378e,_0x24e1c8,_0xaedee0){if(_0x11378e[_0x3d94('0x39')]['id']){delete _0x11378e[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x11378e[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](function(_0xf982a2){if(!_0xf982a2){logger[_0x3d94('0x25')](_0x3d94('0xd4'),_0x3d94('0xd3'),0x194,_0x3d94('0xd5'));_0x24e1c8[_0x3d94('0x2a')](0x194);}else{if(_0xf982a2[_0x3d94('0x7c')]){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xd6'));}}return _0xf982a2;})[_0x3d94('0x1f')](function(_0x4353ca){if(_0x4353ca){return _0x4353ca[_0x3d94('0x33')]({'closed':_0x11378e[_0x3d94('0x39')][_0x3d94('0xd7')],'disposition':_0x11378e['body']['disposition']})[_0x3d94('0x1f')](function(_0x54f366){return _0x54f366;});}})['then'](function(_0x199fa0){return respondWithRpcPromise(_0x3d94('0xd8'),_0x3d94('0xd3'),_0x11378e[_0x3d94('0x39')],client9004);})[_0x3d94('0x1f')](respondWithResult(_0x24e1c8,null))['catch'](handleError(_0x24e1c8,null));};exports[_0x3d94('0xd9')]=function(_0x5c0138,_0x41fd2c,_0x3b5b04){_0x5c0138[_0x3d94('0x39')][_0x3d94('0x36')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdb')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0xdc')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdd')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0x45')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xde')];return db[_0x3d94('0xdf')]['create'](_0x5c0138['body'])['then'](respondWithResult(_0x41fd2c,0xc9))[_0x3d94('0x29')](handleError(_0x41fd2c,null));};exports[_0x3d94('0xe0')]=function(_0x59118c,_0x2105c2,_0x380071){return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0xb8')]['id']},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null))[_0x3d94('0x1f')](function(_0x3d96c5){if(_0x3d96c5){if(_0x3d96c5['closed']){return _0x2105c2[_0x3d94('0x2b')](0x193)[_0x3d94('0xe1')]({'status':0x193,'message':_0x3d94('0xe2')});}return db[_0x3d94('0xdf')][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0x48')][_0x3d94('0xe3')]},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null));}})[_0x3d94('0x1f')](function(_0x4d54e7){if(_0x4d54e7){var _0x26bf00=_0x4d54e7[_0x3d94('0xe4')]!==null;var _0x23bf47=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xe7'));if(_0x26bf00){_0x23bf47=path['join'](_0x23bf47,'offline-chat/');}var _0x336a7d=path[_0x3d94('0xe5')](_0x23bf47,_0x4d54e7['basename']);return _0x2105c2[_0x3d94('0xe8')](_0x336a7d);}})[_0x3d94('0x29')](handleError(_0x2105c2,null));};exports[_0x3d94('0xe9')]=function(_0x37680e,_0x397e85){var _0x5c192c=null;var _0x180595=null;var _0x4a7185=null;var _0x3b0395=null;if(_0x37680e['body']['id']){delete _0x37680e['body']['id'];}if(_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]){_0x3b0395=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xeb'),util['format'](_0x3d94('0xec'),Date['now']()));_0x37680e['body']['pathTranscript']=_0x3b0395;}return db[_0x3d94('0x44')]['find']({'where':{'id':_0x37680e[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'include':[{'model':db[_0x3d94('0x7a')],'as':_0x3d94('0x7a')}]}]})['then'](handleEntityNotFound(_0x397e85,null))[_0x3d94('0x1f')](saveUpdates(_0x37680e[_0x3d94('0x39')],null))[_0x3d94('0x1f')](function(_0x283758){if(_0x283758){_0x5c192c=_0x283758;return db[_0x3d94('0xc1')][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ChatWebsiteId']}});}})[_0x3d94('0x1f')](function(_0x593683){if(_0x593683){_0x4a7185=_0x593683;return db['CmContact'][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ContactId']}});}})[_0x3d94('0x1f')](function(_0xc61003){if(_0xc61003){_0x180595=_0xc61003;if(_0x3b0395){var _0x40b159=null;for(var _0x5262af=0x1;_0x5262af<_0x5c192c['Messages'][_0x3d94('0x4e')];++_0x5262af){_0x40b159=_0x5c192c['Messages'][_0x5262af];var _0x289577=_0x40b159[_0x3d94('0x7c')]?util['format'](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):_0x3d94('0xf0');var _0x4282b3=_0x37680e[_0x3d94('0x39')][_0x3d94('0xf1')]||util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x3d94('0xf3'),_0x40b159[_0x3d94('0x74')]);switch(_0x4a7185[_0x3d94('0xf4')]){case _0x3d94('0xf5'):_0x289577=_0x40b159[_0x3d94('0x7c')]?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159['UserId']):_0x3d94('0xf0');break;case _0x3d94('0xf6'):_0x289577=_0x40b159[_0x3d94('0x7c')]?_0x40b159[_0x3d94('0x7a')][_0x3d94('0xf7')]||_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;case'agent_fullname':_0x289577=_0x40b159['UserId']?_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;default:_0x289577=_0x40b159['UserId']?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):'System';}var _0x5ac9db=util['format'](_0x3d94('0xf8'),moment(_0x40b159['createdAt'])['format'](_0x3d94('0xf9')),_0x40b159[_0x3d94('0xfa')]==='in'?_0x4282b3:_0x289577,_0x40b159[_0x3d94('0x39')]);if(!_0x40b159[_0x3d94('0xfb')]){fs[_0x3d94('0xfc')](_0x3b0395,_0x5ac9db);}}return db[_0x3d94('0xfd')][_0x3d94('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3d94('0x1f')](function(_0x29a79a){if(_0x29a79a&&_0x29a79a[_0x3d94('0xfe')]&&_0x37680e[_0x3d94('0x39')]){var _0x1be31a={'tls':{'rejectUnauthorized':![]}};if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0xff')]){_0x1be31a['service']=_0x29a79a[_0x3d94('0xfe')]['service'];}else{_0x1be31a['host']=_0x29a79a['Smtp'][_0x3d94('0x100')];_0x1be31a[_0x3d94('0x101')]=_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x101')];_0x1be31a['secure']=_0x29a79a[_0x3d94('0xfe')]['secure'];}if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x102')]){_0x1be31a[_0x3d94('0x103')]={'user':_0x29a79a['Smtp'][_0x3d94('0x9b')],'pass':_0x29a79a[_0x3d94('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x3d94('0x104'),{'account':_0x1be31a,'message':{'from':util[_0x3d94('0xf2')](_0x3d94('0x105'),_0x29a79a[_0x3d94('0x36')],_0x29a79a['email']||_0x29a79a['Smtp']['user']),'to':_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')],'subject':_0x3d94('0x106'),'text':util[_0x3d94('0xf2')](_0x3d94('0x107'),_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]),'attachments':[{'path':_0x3b0395}]}})['then'](function(){return _0x5c192c;})['catch'](function(_0xcd4f10){console[_0x3d94('0x25')](_0xcd4f10);});}else{return _0x5c192c;}})[_0x3d94('0x1f')](respondWithStatusCode(_0x397e85,0xc8))[_0x3d94('0x29')](handleError(_0x397e85,null));};exports[_0x3d94('0x108')]=function(_0x4d9b7a,_0x4514fa,_0x29fd6b){return db[_0x3d94('0xce')][_0x3d94('0x73')]({'where':{'id':_0x4d9b7a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4514fa,null))['then'](function(_0xaa7525){if(_0xaa7525){return _0xaa7525[_0x3d94('0x108')](_0x4d9b7a['body'][_0x3d94('0x109')],_[_0x3d94('0x10a')](_0x4d9b7a['body'],[_0x3d94('0x109'),'id'])||{});}})['then'](respondWithResult(_0x4514fa,null))[_0x3d94('0x29')](handleError(_0x4514fa,null));};exports[_0x3d94('0x10b')]=function(_0xabb45a,_0x381b5a,_0x5e935e){var _0x317583={'raw':![],'where':{}};var _0x4733ad={};var _0x5e7388={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xabb45a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x381b5a,null))[_0x3d94('0x1f')](function(_0x5e3823){if(_0x5e3823){_0x4733ad[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatMessage'][_0x3d94('0xb9')]);_0x4733ad[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0xabb45a[_0x3d94('0x48')]);_0x4733ad[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],_0x4733ad[_0x3d94('0x48')]);_0x317583[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x317583[_0x3d94('0x4c')]=_0x317583[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x317583['attributes']:_0x4733ad['model'];if(!_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x317583['limit']=qs['limit'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x317583[_0x3d94('0x2d')]=qs['offset'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x317583[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0xabb45a['query'][_0x3d94('0x52')]);_0x317583[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0xabb45a[_0x3d94('0x48')],_0x4733ad[_0x3d94('0x4a')]));_0x317583['where'][_0x3d94('0xb4')]=_0x5e3823['id'];if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x8c')]){_0x317583['where']=_[_0x3d94('0xa3')](_0x317583[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0x317583[_0x3d94('0x4c')],function(_0x4bd3fd){var _0x4279a6={};_0x4279a6[_0x4bd3fd]={'$like':'%'+_0xabb45a[_0x3d94('0x48')]['filter']+'%'};return _0x4279a6;})});}if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x86')]){var _0x32f992=_0xabb45a['query'][_0x3d94('0x86')]['split'](',');var _0x4ae7d9={};_0x4ae7d9[_0x32f992[0x0]]={'$gte':moment(_0x32f992[0x1])[_0x3d94('0xf2')](_0x3d94('0x10d'))};_0x317583['where']=_['merge'](_0x317583[_0x3d94('0x53')],_0x4ae7d9);}_0x317583=_['merge']({},_0x317583,_0xabb45a[_0x3d94('0xbc')]);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0x317583[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x249f16){_0x5e7388[_0x3d94('0xa0')]=_0x249f16;if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0xba')]){_0x317583['include']=[{'all':!![]}];}return db[_0x3d94('0xce')][_0x3d94('0x10e')](_0x317583);})['then'](function(_0x3e6878){_0x5e7388['rows']=_0x3e6878;return _0x5e7388;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x381b5a,_0x317583))[_0x3d94('0x29')](handleError(_0x381b5a,null));};exports['getMyMessages']=function(_0x1e3d22,_0x562c3f,_0x5ebe77){var _0xf8f4e7={'where':{}},_0x3fd9a9={},_0x1606b6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x1e3d22[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x562c3f,null))[_0x3d94('0x1f')](function(_0x4c76f3){if(_0x4c76f3){_0x3fd9a9[_0x3d94('0x47')]=_[_0x3d94('0x49')](db[_0x3d94('0xce')][_0x3d94('0xb9')]);_0x3fd9a9[_0x3d94('0x48')]=_['keys'](_0x1e3d22['query']);_0x3fd9a9['filters']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],_0x3fd9a9[_0x3d94('0x48')]);_0xf8f4e7['attributes']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],qs['fields'](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x4d')]));_0xf8f4e7[_0x3d94('0x4c')]=_0xf8f4e7[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0xf8f4e7[_0x3d94('0x4c')]:_0x3fd9a9['model'];if(!_0x1e3d22['query'][_0x3d94('0x4f')](_0x3d94('0x50'))){_0xf8f4e7['limit']=qs[_0x3d94('0x2e')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x2e')]);_0xf8f4e7[_0x3d94('0x2d')]=qs[_0x3d94('0x2d')](_0x1e3d22[_0x3d94('0x48')]['offset']);}_0xf8f4e7[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x52')]);_0xf8f4e7['where']=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0x1e3d22['query'],_0x3fd9a9[_0x3d94('0x4a')]));_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xb4')]=_0x4c76f3['id'];if(_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]){_0xf8f4e7[_0x3d94('0x53')]=_[_0x3d94('0xa3')](_0xf8f4e7[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0xf8f4e7[_0x3d94('0x4c')],function(_0x5829be){var _0x56894f={};_0x56894f[_0x5829be]={'$like':'%'+_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]+'%'};return _0x56894f;})});}_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xfb')]=![];if(_0x1e3d22['query']['id']){_0xf8f4e7[_0x3d94('0x53')]['id']={'$gt':_0x1e3d22[_0x3d94('0x48')]['id']};}_0xf8f4e7=_[_0x3d94('0xa3')]({},_0xf8f4e7,_0x1e3d22['options']);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0xf8f4e7[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x289380){_0x1606b6[_0x3d94('0xa0')]=_0x289380;_0xf8f4e7[_0x3d94('0xbb')]=[];if(_0x1e3d22['query'][_0x3d94('0x10f')]){_0xf8f4e7['include'][_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x7a'),'attributes':['id',_0x3d94('0x3e'),'alias']});}if(_0x1e3d22[_0x3d94('0x48')]['includeAll']){_0xf8f4e7[_0x3d94('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xf8f4e7);})[_0x3d94('0x1f')](function(_0x436e01){_0x1606b6[_0x3d94('0xb7')]=_0x436e01;return _0x1606b6;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x562c3f,_0xf8f4e7))[_0x3d94('0x29')](handleError(_0x562c3f,null));};exports[_0x3d94('0x110')]=function(_0xfb94d4,_0x1ef614,_0x137d04){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xfb94d4[_0x3d94('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1ef614,null))[_0x3d94('0x1f')](function(_0x28aad1){if(_0x28aad1){return _0x28aad1[_0x3d94('0x111')](_0xfb94d4[_0x3d94('0x39')]['ids'],_['omit'](_0xfb94d4[_0x3d94('0x39')],[_0x3d94('0x109'),'id'])||{})[_0x3d94('0x112')](function(){return db[_0x3d94('0x77')][_0x3d94('0x10e')]({'attributes':['id','name','color'],'where':{'id':_0xfb94d4[_0x3d94('0x39')]['ids']}});})[_0x3d94('0x1f')](function(_0xc1537){socket[_0x3d94('0x113')](_0x3d94('0x114'),{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]});return{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]};});}})['then'](respondWithResult(_0x1ef614,null))[_0x3d94('0x29')](handleError(_0x1ef614,null));};exports[_0x3d94('0x115')]=function(_0x4aa6e6,_0x18f2db,_0x16082f){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4aa6e6['params']['id']}})['then'](handleEntityNotFound(_0x18f2db,null))[_0x3d94('0x1f')](function(_0x1e480b){if(_0x1e480b){return _0x1e480b[_0x3d94('0x115')](_0x4aa6e6[_0x3d94('0x48')][_0x3d94('0x109')]);}})[_0x3d94('0x1f')](respondWithStatusCode(_0x18f2db,null))[_0x3d94('0x29')](handleError(_0x18f2db,null));};exports[_0x3d94('0xe8')]=function(_0x4147d5,_0x54d72a){var _0x31ec36=moment()[_0x3d94('0x116')]()['toString']();var _0x4897f6=path[_0x3d94('0xe5')](config['root'],'server',_0x3d94('0x117'),_0x3d94('0x118'));var _0x17f392=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],'server',_0x3d94('0x117'),_0x3d94('0x119'));var _0xceded9=path[_0x3d94('0xe5')](_0x4897f6,_0x31ec36);var _0x77078d=util[_0x3d94('0xf2')](_0x3d94('0x11a'),_0x4147d5[_0x3d94('0xb8')]['id'],_0x31ec36);var _0x27008c=path[_0x3d94('0xe5')](_0x4897f6,_0x77078d);var _0x464735=[];_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0x7a')],'as':'User','attributes':['id',_0x3d94('0x3e')],'raw':!![]});_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xd2')],'as':'Contact','attributes':['id',_0x3d94('0x11b'),_0x3d94('0x11c')],'raw':!![]});if(_0x4147d5[_0x3d94('0x48')][_0x3d94('0x119')]){_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xdf')],'as':_0x3d94('0xdf'),'raw':!![]});}var _0x554203=[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'attributes':['id',_0x3d94('0x39'),_0x3d94('0x84'),_0x3d94('0xfa'),_0x3d94('0xfb'),'read'],'include':_0x464735}];_0x554203['push']({'model':db[_0x3d94('0xc1')],'as':_0x3d94('0x11d'),'attributes':['id',_0x3d94('0x36')]});_0x554203[_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x11e'),'attributes':['id','fullname']});return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4147d5['params']['id']},'include':_0x554203})['then'](handleEntityNotFound(_0x54d72a,null))['then'](function(_0x1da500){if(_0x1da500){var _0x2eb637=_0x1da500['get']({'plain':!![]});fs[_0x3d94('0x11f')](_0xceded9);var _0x4f572c={'channel':_0x3d94('0x120'),'account':_0x2eb637[_0x3d94('0x11d')][_0x3d94('0x36')],'agent':_0x2eb637[_0x3d94('0x11e')]?_0x2eb637[_0x3d94('0x11e')][_0x3d94('0x3e')]:'N.A.','createdAt':moment(_0x2eb637['createdAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'closedAt':_0x2eb637[_0x3d94('0xd7')]?moment(_0x2eb637['closedAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')]():'','disposition':_0x2eb637[_0x3d94('0x121')],'chatInfo':{'browser':_0x2eb637[_0x3d94('0x122')],'os':_0x2eb637[_0x3d94('0x123')],'referer':_0x2eb637[_0x3d94('0x124')],'customerIp':_0x2eb637[_0x3d94('0x125')],'customerPort':_0x2eb637['customerPort']?_0x2eb637[_0x3d94('0x126')]:'N.A.'},'messages':_(_0x2eb637['Messages'])[_0x3d94('0x127')]()[_0x3d94('0x8c')]({'secret':![]})[_0x3d94('0x3d')](function(_0x10fdf2){if(_0x10fdf2[_0x3d94('0xdf')]){var _0x70202c=path[_0x3d94('0xe5')](_0x17f392,_0x10fdf2[_0x3d94('0xdf')]['basename']);if(fs[_0x3d94('0x128')](_0x70202c)){fs['createReadStream'](_0x70202c)[_0x3d94('0x129')](fs[_0x3d94('0x12a')](path[_0x3d94('0xe5')](_0xceded9,_0x10fdf2[_0x3d94('0xdf')][_0x3d94('0xdc')])));}}return{'date':moment(_0x10fdf2[_0x3d94('0x84')])['format'](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'sender':_0x10fdf2[_0x3d94('0xfa')]===_0x3d94('0xcd')?_0x10fdf2['User']?_0x10fdf2['User'][_0x3d94('0x3e')]:_0x3d94('0xf0'):_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11b')]+(_0x10fdf2[_0x3d94('0x6e')]['lastName']?'\x20'+_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11c')]:''),'body':_0x10fdf2[_0x3d94('0xdf')]?_0x10fdf2[_0x3d94('0xdf')]['basename']:_0x10fdf2[_0x3d94('0x39')],'direction':_0x10fdf2['direction']===_0x3d94('0xcd')?'A':'C','secret':_0x10fdf2[_0x3d94('0xfb')],'read':_0x10fdf2['read'],'attachment':_0x10fdf2[_0x3d94('0xdf')]};})[_0x3d94('0x70')]()};return ejs[_0x3d94('0x12b')](path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0x12c'),_0x3d94('0x12d'),_0x3d94('0x12e')),{'interaction':_0x4f572c})[_0x3d94('0x1f')](function(_0x244770){var _0x4e0383=path['join'](_0xceded9,_0x3d94('0x12f')+_0x2eb637['id']+'-'+_0x31ec36+'.pdf');var _0x57a739={'path':_0x4e0383,'channel':_0x3d94('0x120'),'interactionId':_0x2eb637['id']};return pdf['createPdfFromHTML'](_0x244770,_0x57a739);})[_0x3d94('0x1f')](function(){return new BPromise(function(_0x46ddad,_0x3063e9){zipdir(_0xceded9,{'saveTo':_0x27008c},function(_0x36c9be,_0x316c31){if(_0x36c9be)return _0x3063e9(_0x36c9be);return _0x46ddad(_0x316c31);});})['then'](function(){return new BPromise(function(_0x4e42e3,_0xeee55f){rimraf(_0xceded9,function(_0x2be870){if(_0x2be870)_0xeee55f(_0x2be870);return _0x4e42e3();});});})[_0x3d94('0x1f')](function(){return _0x54d72a['download'](_0x27008c,_0x77078d,function(_0x3330df){if(_0x3330df){console[_0x3d94('0x130')](_0x3d94('0x131'),_0x3330df);}else{fs['unlinkSync'](_0x27008c);}});});});}else{return _0x54d72a[_0x3d94('0x2a')](0xc8);}})[_0x3d94('0x29')](handleError(_0x54d72a,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 09ca2a7..fefaba3 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 _0x5b00=['remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update'];(function(_0x5e80de,_0x27ed58){var _0x4a7825=function(_0x490249){while(--_0x490249){_0x5e80de['push'](_0x5e80de['shift']());}};_0x4a7825(++_0x27ed58);}(_0x5b00,0x150));var _0x05b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b00[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x05b0('0x0'));var ChatInteraction=require(_0x05b0('0x1'))['db'][_0x05b0('0x2')];var ChatMessage=require(_0x05b0('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x05b0('0x3')](0x0);var events={'afterCreate':_0x05b0('0x4'),'afterUpdate':_0x05b0('0x5'),'afterDestroy':_0x05b0('0x6')};function emitEvent(_0x38d116){return function(_0x4864aa,_0x56a30c,_0x58d374){_0x4864aa[_0x05b0('0x7')]({'attributes':['id'],'raw':!![]})[_0x05b0('0x8')](function(_0x3c285c){_0x4864aa['setDataValue'](_0x05b0('0x9'),_0x3c285c[_0x05b0('0xa')](function(_0x1c3366){return{'id':_0x1c3366['id']};}));return ChatMessage[_0x05b0('0xb')]({'where':{'ChatInteractionId':_0x4864aa['id'],'direction':'in','read':![]},'raw':!![]});})[_0x05b0('0x8')](function(_0x14f09d){_0x4864aa[_0x05b0('0xc')](_0x05b0('0xd'),_0x14f09d['length']);ChatInteractionEvents[_0x05b0('0xe')](_0x38d116+':'+_0x4864aa['id'],_0x4864aa);ChatInteractionEvents[_0x05b0('0xe')](_0x38d116,_0x4864aa);_0x58d374(null);})[_0x05b0('0xf')](_0x58d374(null));};}for(var e in events){if(events[_0x05b0('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x05b0('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x47ff=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x4e6090,_0x50fa28){var _0x108ca1=function(_0x34939e){while(--_0x34939e){_0x4e6090['push'](_0x4e6090['shift']());}};_0x108ca1(++_0x50fa28);}(_0x47ff,0x171));var _0xf47f=function(_0xe1b523,_0x2bc05b){_0xe1b523=_0xe1b523-0x0;var _0x52c152=_0x47ff[_0xe1b523];return _0x52c152;};'use strict';var EventEmitter=require(_0xf47f('0x0'));var ChatInteraction=require(_0xf47f('0x1'))['db'][_0xf47f('0x2')];var ChatMessage=require(_0xf47f('0x1'))['db'][_0xf47f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf47f('0x4')](0x0);var events={'afterCreate':_0xf47f('0x5'),'afterUpdate':'update','afterDestroy':_0xf47f('0x6')};function emitEvent(_0x3dac86){return function(_0x196f50,_0x47b3da,_0x478125){_0x196f50[_0xf47f('0x7')]({'attributes':['id'],'raw':!![]})[_0xf47f('0x8')](function(_0x5cfb76){_0x196f50[_0xf47f('0x9')](_0xf47f('0xa'),_0x5cfb76[_0xf47f('0xb')](function(_0x340d38){return{'id':_0x340d38['id']};}));return ChatMessage[_0xf47f('0xc')]({'where':{'ChatInteractionId':_0x196f50['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf47f('0x8')](function(_0x4b63b5){_0x196f50[_0xf47f('0x9')](_0xf47f('0xd'),_0x4b63b5[_0xf47f('0xe')]);ChatInteractionEvents[_0xf47f('0xf')](_0x3dac86+':'+_0x196f50['id'],_0x196f50);ChatInteractionEvents[_0xf47f('0xf')](_0x3dac86,_0x196f50);_0x478125(null);})[_0xf47f('0x10')](_0x478125(null));};}for(var e in events){if(events[_0xf47f('0x11')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index af58a27..5ad179d 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 _0x447e=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','changed'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0x447e,0x170));var _0xe447=function(_0x1fef69,_0x2d056e){_0x1fef69=_0x1fef69-0x0;var _0x5d0cfb=_0x447e[_0x1fef69];return _0x5d0cfb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe447('0x0'))(_0xe447('0x1'));var moment=require('moment');var BPromise=require(_0xe447('0x2'));var rp=require(_0xe447('0x3'));var fs=require('fs');var path=require(_0xe447('0x4'));var rimraf=require(_0xe447('0x5'));var config=require('../../config/environment');var attributes=require(_0xe447('0x6'));module[_0xe447('0x7')]=function(_0x2a6198,_0x3628b7){return _0x2a6198['define'](_0xe447('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e655a,_0xa52f4a,_0x465c6b){if(_0x4e655a[_0xe447('0x9')]('closed')){_0x4e655a[_0xe447('0xa')]=moment()[_0xe447('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x465c6b(null,_0x4e655a);}},'charset':_0xe447('0xc'),'collate':_0xe447('0xd')});}; \ No newline at end of file +var _0xf4c0=['utf8mb4_unicode_ci','moment','bluebird','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x1d4ad4,_0x4374a0){var _0x4ced8f=function(_0x2445dd){while(--_0x2445dd){_0x1d4ad4['push'](_0x1d4ad4['shift']());}};_0x4ced8f(++_0x4374a0);}(_0xf4c0,0x9d));var _0x0f4c=function(_0x43cc09,_0x5de0eb){_0x43cc09=_0x43cc09-0x0;var _0x62d8bc=_0xf4c0[_0x43cc09];return _0x62d8bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0f4c('0x0'));var BPromise=require(_0x0f4c('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f4c('0x2'));var rimraf=require('rimraf');var config=require(_0x0f4c('0x3'));var attributes=require(_0x0f4c('0x4'));module[_0x0f4c('0x5')]=function(_0x25b310,_0x3eb278){return _0x25b310[_0x0f4c('0x6')](_0x0f4c('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29f3de,_0x452f20,_0xcceb2d){if(_0x29f3de['changed'](_0x0f4c('0x8'))){_0x29f3de[_0x0f4c('0x9')]=moment()['format'](_0x0f4c('0xa'));}_0xcceb2d(null,_0x29f3de);}},'charset':_0x0f4c('0xb'),'collate':_0x0f4c('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index fe25bb2..a56e42d 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 _0x1c14=['body','options','limit','AddTagsToChatInteraction','find','where','omit','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c14,0xd2));var _0x41c1=function(_0x177c62,_0x3f5b73){_0x177c62=_0x177c62-0x0;var _0x548aca=_0x1c14[_0x177c62];return _0x548aca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x41c1('0x0'));var BPromise=require(_0x41c1('0x1'));var rs=require(_0x41c1('0x2'));var fs=require('fs');var Redis=require(_0x41c1('0x3'));var db=require(_0x41c1('0x4'))['db'];var utils=require(_0x41c1('0x5'));var logger=require(_0x41c1('0x6'))(_0x41c1('0x7'));var config=require(_0x41c1('0x8'));var jayson=require(_0x41c1('0x9'));var client=jayson[_0x41c1('0xa')][_0x41c1('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x41c1('0xc')],{'host':_0x41c1('0xd'),'port':0x18eb});var socket=require(_0x41c1('0xe'))(new Redis(config[_0x41c1('0xc')]));require(_0x41c1('0xf'))[_0x41c1('0x10')](socket);function respondWithRpcPromise(_0x10cc6c,_0x11593b,_0x2a9c49){return new BPromise(function(_0xb7be5,_0x431e37){return client['request'](_0x10cc6c,_0x2a9c49)[_0x41c1('0x11')](function(_0x47a1ec){logger[_0x41c1('0x12')](_0x41c1('0x13'),_0x11593b,_0x41c1('0x14'));logger[_0x41c1('0x15')](_0x41c1('0x16'),_0x11593b,_0x41c1('0x14'),JSON[_0x41c1('0x17')](_0x47a1ec));if(_0x47a1ec[_0x41c1('0x18')]){if(_0x47a1ec[_0x41c1('0x18')][_0x41c1('0x19')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x11593b,_0x47a1ec[_0x41c1('0x18')][_0x41c1('0x1a')]);return _0x431e37(_0x47a1ec[_0x41c1('0x18')][_0x41c1('0x1a')]);}logger[_0x41c1('0x18')](_0x41c1('0x13'),_0x11593b,_0x47a1ec[_0x41c1('0x18')]['message']);return _0xb7be5(_0x47a1ec['error'][_0x41c1('0x1a')]);}else{logger['info'](_0x41c1('0x13'),_0x11593b,_0x41c1('0x14'));_0xb7be5(_0x47a1ec['result'][_0x41c1('0x1a')]);}})[_0x41c1('0x1b')](function(_0x2660b3){logger['error'](_0x41c1('0x13'),_0x11593b,_0x2660b3);_0x431e37(_0x2660b3);});});}exports[_0x41c1('0x1c')]=function(_0x18c82c){var _0x2fd6d7=this;return new Promise(function(_0x3317be,_0x2da513){return db['ChatInteraction'][_0x41c1('0x1d')](_0x18c82c[_0x41c1('0x1e')],{'raw':_0x18c82c[_0x41c1('0x1f')]?_0x18c82c[_0x41c1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18c82c[_0x41c1('0x1f')]?_0x18c82c[_0x41c1('0x1f')]['where']||null:null,'attributes':_0x18c82c[_0x41c1('0x1f')]?_0x18c82c[_0x41c1('0x1f')]['attributes']||null:null,'limit':_0x18c82c[_0x41c1('0x1f')]?_0x18c82c['options'][_0x41c1('0x20')]||null:null})[_0x41c1('0x11')](function(_0x30a23a){logger[_0x41c1('0x12')]('UpdateChatInteraction',_0x18c82c);logger['debug']('UpdateChatInteraction',_0x18c82c,JSON['stringify'](_0x30a23a));_0x3317be(_0x30a23a);})['catch'](function(_0x4fa900){logger[_0x41c1('0x18')](_0x41c1('0x1c'),_0x4fa900['message'],_0x18c82c);_0x2da513(_0x2fd6d7[_0x41c1('0x18')](0x1f4,_0x4fa900[_0x41c1('0x1a')]));});});};exports[_0x41c1('0x21')]=function(_0x28ddc0){return new Promise(function(_0x2ea624,_0x4f5740){return db['ChatInteraction'][_0x41c1('0x22')]({'where':_0x28ddc0[_0x41c1('0x1f')]?_0x28ddc0[_0x41c1('0x1f')][_0x41c1('0x23')]||null:null})['then'](function(_0xf2bf15){if(_0xf2bf15){return _0xf2bf15['addTags'](_0x28ddc0[_0x41c1('0x1e')]['ids'],_[_0x41c1('0x24')](_0x28ddc0['body'],[_0x41c1('0x25'),'id'])||{});}})[_0x41c1('0x26')](function(_0x26aae4){logger['info']('AddTags',_0x28ddc0);logger[_0x41c1('0x15')](_0x41c1('0x27'),_0x28ddc0,JSON['stringify'](_0x26aae4));_0x2ea624(_0x26aae4);})[_0x41c1('0x1b')](function(_0x3b938f){logger[_0x41c1('0x18')](_0x41c1('0x27'),_0x3b938f[_0x41c1('0x1a')],_0x28ddc0);_0x4f5740(_this[_0x41c1('0x18')](0x1f4,_0x3b938f['message']));});});}; \ No newline at end of file +var _0xb280=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatInteraction','update','body','options','attributes','stringify','UpdateChatInteraction','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xb280,0x1b6));var _0x0b28=function(_0x25418e,_0x161cf4){_0x25418e=_0x25418e-0x0;var _0x239b45=_0xb280[_0x25418e];return _0x239b45;};'use strict';var _=require(_0x0b28('0x0'));var util=require(_0x0b28('0x1'));var moment=require(_0x0b28('0x2'));var BPromise=require(_0x0b28('0x3'));var rs=require(_0x0b28('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0b28('0x5'));var logger=require(_0x0b28('0x6'))(_0x0b28('0x7'));var config=require(_0x0b28('0x8'));var jayson=require(_0x0b28('0x9'));var client=jayson[_0x0b28('0xa')][_0x0b28('0xb')]({'port':0x232a});config[_0x0b28('0xc')]=_[_0x0b28('0xd')](config[_0x0b28('0xc')],{'host':_0x0b28('0xe'),'port':0x18eb});var socket=require(_0x0b28('0xf'))(new Redis(config[_0x0b28('0xc')]));require(_0x0b28('0x10'))[_0x0b28('0x11')](socket);function respondWithRpcPromise(_0xe0a3f9,_0x52523f,_0x5a6fdb){return new BPromise(function(_0x3aad90,_0x169adf){return client['request'](_0xe0a3f9,_0x5a6fdb)[_0x0b28('0x12')](function(_0x4a8a59){logger[_0x0b28('0x13')](_0x0b28('0x14'),_0x52523f,_0x0b28('0x15'));logger[_0x0b28('0x16')](_0x0b28('0x17'),_0x52523f,_0x0b28('0x15'),JSON['stringify'](_0x4a8a59));if(_0x4a8a59[_0x0b28('0x18')]){if(_0x4a8a59[_0x0b28('0x18')][_0x0b28('0x19')]===0x1f4){logger['error'](_0x0b28('0x14'),_0x52523f,_0x4a8a59[_0x0b28('0x18')][_0x0b28('0x1a')]);return _0x169adf(_0x4a8a59[_0x0b28('0x18')]['message']);}logger[_0x0b28('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x52523f,_0x4a8a59['error']['message']);return _0x3aad90(_0x4a8a59['error'][_0x0b28('0x1a')]);}else{logger[_0x0b28('0x13')](_0x0b28('0x14'),_0x52523f,_0x0b28('0x15'));_0x3aad90(_0x4a8a59[_0x0b28('0x1b')][_0x0b28('0x1a')]);}})[_0x0b28('0x1c')](function(_0x373b61){logger[_0x0b28('0x18')](_0x0b28('0x14'),_0x52523f,_0x373b61);_0x169adf(_0x373b61);});});}exports['UpdateChatInteraction']=function(_0x50ad49){var _0x4c4ca7=this;return new Promise(function(_0x5c98e6,_0x1cb8ea){return db[_0x0b28('0x1d')][_0x0b28('0x1e')](_0x50ad49[_0x0b28('0x1f')],{'raw':_0x50ad49[_0x0b28('0x20')]?_0x50ad49['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50ad49[_0x0b28('0x20')]?_0x50ad49[_0x0b28('0x20')]['where']||null:null,'attributes':_0x50ad49[_0x0b28('0x20')]?_0x50ad49[_0x0b28('0x20')][_0x0b28('0x21')]||null:null,'limit':_0x50ad49[_0x0b28('0x20')]?_0x50ad49[_0x0b28('0x20')]['limit']||null:null})[_0x0b28('0x12')](function(_0xf6c364){logger[_0x0b28('0x13')]('UpdateChatInteraction',_0x50ad49);logger[_0x0b28('0x16')]('UpdateChatInteraction',_0x50ad49,JSON[_0x0b28('0x22')](_0xf6c364));_0x5c98e6(_0xf6c364);})['catch'](function(_0x4aeff5){logger[_0x0b28('0x18')](_0x0b28('0x23'),_0x4aeff5[_0x0b28('0x1a')],_0x50ad49);_0x1cb8ea(_0x4c4ca7['error'](0x1f4,_0x4aeff5[_0x0b28('0x1a')]));});});};exports[_0x0b28('0x24')]=function(_0x157d27){return new Promise(function(_0x2e9ce4,_0x1e8909){return db[_0x0b28('0x1d')][_0x0b28('0x25')]({'where':_0x157d27['options']?_0x157d27[_0x0b28('0x20')][_0x0b28('0x26')]||null:null})[_0x0b28('0x12')](function(_0x411542){if(_0x411542){return _0x411542[_0x0b28('0x27')](_0x157d27['body'][_0x0b28('0x28')],_[_0x0b28('0x29')](_0x157d27[_0x0b28('0x1f')],[_0x0b28('0x28'),'id'])||{});}})[_0x0b28('0x2a')](function(_0x57cc5a){logger[_0x0b28('0x13')](_0x0b28('0x2b'),_0x157d27);logger[_0x0b28('0x16')](_0x0b28('0x2b'),_0x157d27,JSON[_0x0b28('0x22')](_0x57cc5a));_0x2e9ce4(_0x57cc5a);})[_0x0b28('0x1c')](function(_0x56afce){logger[_0x0b28('0x18')]('AddTags',_0x56afce[_0x0b28('0x1a')],_0x157d27);_0x1e8909(_this[_0x0b28('0x18')](0x1f4,_0x56afce['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8584625..7f199fa 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 _0xd0fd=['register','chatInteraction:','./chatInteraction.events','save','emit','removeListener'];(function(_0x1eb755,_0x31610b){var _0x54e51c=function(_0x1c2602){while(--_0x1c2602){_0x1eb755['push'](_0x1eb755['shift']());}};_0x54e51c(++_0x31610b);}(_0xd0fd,0x146));var _0xdd0f=function(_0x73eb36,_0x58feb5){_0x73eb36=_0x73eb36-0x0;var _0x24cb48=_0xd0fd[_0x73eb36];return _0x24cb48;};'use strict';var ChatInteractionEvents=require(_0xdd0f('0x0'));var events=[_0xdd0f('0x1'),'remove','update'];function createListener(_0x341286,_0x31826a){return function(_0x5139d9){_0x31826a[_0xdd0f('0x2')](_0x341286,_0x5139d9);};}function removeListener(_0x814a52,_0x21af32){return function(){ChatInteractionEvents[_0xdd0f('0x3')](_0x814a52,_0x21af32);};}exports[_0xdd0f('0x4')]=function(_0x1936df){for(var _0xb81fa8=0x0,_0x49be38=events['length'];_0xb81fa8<_0x49be38;_0xb81fa8++){var _0x38abd2=events[_0xb81fa8];var _0x1aa0ef=createListener(_0xdd0f('0x5')+_0x38abd2,_0x1936df);ChatInteractionEvents['on'](_0x38abd2,_0x1aa0ef);}}; \ No newline at end of file +var _0x176e=['removeListener','register','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x176e,0x1d3));var _0xe176=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x176e[_0x311c35];return _0x5cc50c;};'use strict';var ChatInteractionEvents=require(_0xe176('0x0'));var events=[_0xe176('0x1'),_0xe176('0x2'),_0xe176('0x3')];function createListener(_0x391983,_0x2a350c){return function(_0x2dee87){_0x2a350c[_0xe176('0x4')](_0x391983,_0x2dee87);};}function removeListener(_0x5b2254,_0x572c92){return function(){ChatInteractionEvents[_0xe176('0x5')](_0x5b2254,_0x572c92);};}exports[_0xe176('0x6')]=function(_0x23c613){for(var _0x1b7e4d=0x0,_0x121d32=events['length'];_0x1b7e4d<_0x121d32;_0x1b7e4d++){var _0x2931d1=events[_0x1b7e4d];var _0x5ef9e3=createListener(_0xe176('0x7')+_0x2931d1,_0x23c613);ChatInteractionEvents['on'](_0x2931d1,_0x5ef9e3);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 16deea9..29f4ceb 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 _0x23a6=['file','attachmentUpload','addMessage','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','post','createVidaooSession','diskStorage','join','server/files/attachments/','%s-%s','originalname','replace','single'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x23a6,0x1d4));var _0x623a=function(_0x52dd3c,_0x2bee4b){_0x52dd3c=_0x52dd3c-0x0;var _0x5015f2=_0x23a6[_0x52dd3c];return _0x5015f2;};'use strict';var multer=require(_0x623a('0x0'));var util=require(_0x623a('0x1'));var path=require(_0x623a('0x2'));var timeout=require(_0x623a('0x3'));var express=require(_0x623a('0x4'));var router=express[_0x623a('0x5')]();var fs_extra=require(_0x623a('0x6'));var auth=require(_0x623a('0x7'));var interaction=require(_0x623a('0x8'));var config=require(_0x623a('0x9'));var controller=require('./chatInteraction.controller');router[_0x623a('0xa')]('/',auth[_0x623a('0xb')](),controller[_0x623a('0xc')]);router[_0x623a('0xa')](_0x623a('0xd'),auth[_0x623a('0xb')](),controller[_0x623a('0xe')]);router[_0x623a('0xa')](_0x623a('0xf'),auth[_0x623a('0x10')](),controller[_0x623a('0x11')]);router[_0x623a('0xa')]('/:id/attachment_download',auth[_0x623a('0x10')](),controller[_0x623a('0x12')]);router['get'](_0x623a('0x13'),auth[_0x623a('0xb')](),controller[_0x623a('0x14')]);router[_0x623a('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x623a('0x15')]);router['get']('/:id/download',auth[_0x623a('0xb')](),controller[_0x623a('0x16')]);router['post']('/',auth[_0x623a('0xb')](),controller['create']);router[_0x623a('0x17')]('/:id/vidaoo',auth[_0x623a('0xb')](),controller[_0x623a('0x18')]);var upload=multer({'storage':multer[_0x623a('0x19')]({'destination':function(_0x4469f0,_0x5165d2,_0x5b192c){_0x5b192c(null,path[_0x623a('0x1a')](config['root'],_0x623a('0x1b')));},'filename':function(_0x2601dc,_0x4142d0,_0x22527f){_0x22527f(null,util['format'](_0x623a('0x1c'),Date['now'](),_0x4142d0[_0x623a('0x1d')][_0x623a('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x623a('0x1f')](_0x623a('0x20')),controller[_0x623a('0x21')]);router[_0x623a('0x17')](_0x623a('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x623a('0x22')]);router[_0x623a('0x17')]('/:id/tags',auth[_0x623a('0xb')](),interaction[_0x623a('0x23')]('chat',_0x623a('0x24')),controller[_0x623a('0x25')]);router[_0x623a('0x26')](_0x623a('0xf'),auth[_0x623a('0xb')](),interaction[_0x623a('0x23')](_0x623a('0x27'),_0x623a('0x28')),controller['update']);router[_0x623a('0x26')](_0x623a('0x29'),controller[_0x623a('0x2a')]);router[_0x623a('0x26')](_0x623a('0x2b'),auth[_0x623a('0x10')](),controller['abandon']);router[_0x623a('0x26')](_0x623a('0x2c'),controller['close']);router[_0x623a('0x2d')](_0x623a('0xf'),auth[_0x623a('0xb')](),interaction[_0x623a('0x23')](_0x623a('0x27'),_0x623a('0x2e')),controller[_0x623a('0x2f')]);router[_0x623a('0x2d')]('/:id/tags',auth[_0x623a('0xb')](),controller[_0x623a('0x30')]);module[_0x623a('0x31')]=router; \ No newline at end of file +var _0x0f0d=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','%s-%s','originalname','replace','/:id/attachment_upload','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','exports','multer','util'];(function(_0x58ee60,_0x3e6351){var _0x43880d=function(_0x25b9ce){while(--_0x25b9ce){_0x58ee60['push'](_0x58ee60['shift']());}};_0x43880d(++_0x3e6351);}(_0x0f0d,0xe9));var _0xd0f0=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0x0f0d[_0x2adfb1];return _0xa52d45;};'use strict';var multer=require(_0xd0f0('0x0'));var util=require(_0xd0f0('0x1'));var path=require(_0xd0f0('0x2'));var timeout=require(_0xd0f0('0x3'));var express=require(_0xd0f0('0x4'));var router=express[_0xd0f0('0x5')]();var fs_extra=require(_0xd0f0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd0f0('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xd0f0('0x8')]('/',auth[_0xd0f0('0x9')](),controller[_0xd0f0('0xa')]);router[_0xd0f0('0x8')](_0xd0f0('0xb'),auth[_0xd0f0('0x9')](),controller[_0xd0f0('0xc')]);router[_0xd0f0('0x8')](_0xd0f0('0xd'),auth[_0xd0f0('0xe')](),controller[_0xd0f0('0xf')]);router[_0xd0f0('0x8')](_0xd0f0('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xd0f0('0x11')]);router['get'](_0xd0f0('0x12'),auth[_0xd0f0('0x9')](),controller['getMessages']);router[_0xd0f0('0x8')]('/:id/my_messages',auth[_0xd0f0('0xe')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0xd0f0('0x9')](),controller[_0xd0f0('0x13')]);router[_0xd0f0('0x14')]('/',auth[_0xd0f0('0x9')](),controller[_0xd0f0('0x15')]);router[_0xd0f0('0x14')](_0xd0f0('0x16'),auth['isAuthenticated'](),controller[_0xd0f0('0x17')]);var upload=multer({'storage':multer[_0xd0f0('0x18')]({'destination':function(_0x48d412,_0x1d2ac4,_0x4dbfe1){_0x4dbfe1(null,path['join'](config[_0xd0f0('0x19')],'server/files/attachments/'));},'filename':function(_0x56d6b5,_0xfb8840,_0x36d2ba){_0x36d2ba(null,util['format'](_0xd0f0('0x1a'),Date['now'](),_0xfb8840[_0xd0f0('0x1b')][_0xd0f0('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd0f0('0x14')](_0xd0f0('0x1d'),upload['single'](_0xd0f0('0x1e')),controller[_0xd0f0('0x1f')]);router[_0xd0f0('0x14')](_0xd0f0('0x12'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xd0f0('0x14')](_0xd0f0('0x20'),auth['isAuthenticated'](),interaction[_0xd0f0('0x21')](_0xd0f0('0x22'),_0xd0f0('0x23')),controller[_0xd0f0('0x24')]);router[_0xd0f0('0x25')](_0xd0f0('0xd'),auth['isAuthenticated'](),interaction[_0xd0f0('0x21')](_0xd0f0('0x22'),'chatinteraction:update'),controller['update']);router[_0xd0f0('0x25')](_0xd0f0('0x26'),controller[_0xd0f0('0x27')]);router[_0xd0f0('0x25')](_0xd0f0('0x28'),auth['isChatInteractionAuthorized'](),controller[_0xd0f0('0x29')]);router[_0xd0f0('0x25')](_0xd0f0('0x2a'),controller['close']);router[_0xd0f0('0x2b')](_0xd0f0('0xd'),auth[_0xd0f0('0x9')](),interaction[_0xd0f0('0x21')](_0xd0f0('0x22'),_0xd0f0('0x2c')),controller[_0xd0f0('0x2d')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xd0f0('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index b62af12..b718d45 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 _0x12a0=['exports','BOOLEAN','INTEGER','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x12a0,0x6f));var _0x012a=function(_0x21b434,_0x4d9fac){_0x21b434=_0x21b434-0x0;var _0x22c0d3=_0x12a0[_0x21b434];return _0x22c0d3;};'use strict';var Sequelize=require(_0x012a('0x0'));module[_0x012a('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x012a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x012a('0x3')]}}; \ No newline at end of file +var _0xc782=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0xc782,0x68));var _0x2c78=function(_0x45513e,_0x433f83){_0x45513e=_0x45513e-0x0;var _0x59331f=_0xc782[_0x45513e];return _0x59331f;};'use strict';var Sequelize=require(_0x2c78('0x0'));module[_0x2c78('0x1')]={'body':{'type':Sequelize[_0x2c78('0x2')](_0x2c78('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2c78('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2c78('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0e165b4..e6750e5 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 _0x4108=['name','index','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','admin','user','fullname','role','internal','online','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack'];(function(_0x3819e5,_0x189bbd){var _0x2041c5=function(_0x3b8fee){while(--_0x3b8fee){_0x3819e5['push'](_0x3819e5['shift']());}};_0x2041c5(++_0x189bbd);}(_0x4108,0xb2));var _0x8410=function(_0x2d23df,_0x509f3e){_0x2d23df=_0x2d23df-0x0;var _0x5b20ce=_0x4108[_0x2d23df];return _0x5b20ce;};'use strict';var emlformat=require(_0x8410('0x0'));var rimraf=require(_0x8410('0x1'));var zipdir=require(_0x8410('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8410('0x3'));var moment=require(_0x8410('0x4'));var BPromise=require(_0x8410('0x5'));var Mustache=require(_0x8410('0x6'));var util=require(_0x8410('0x7'));var path=require(_0x8410('0x8'));var sox=require(_0x8410('0x9'));var csv=require(_0x8410('0xa'));var ejs=require(_0x8410('0xb'));var fs=require('fs');var fs_extra=require(_0x8410('0xc'));var _=require(_0x8410('0xd'));var squel=require('squel');var crypto=require(_0x8410('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8410('0xa'));var querystring=require(_0x8410('0xf'));var Papa=require('papaparse');var Redis=require(_0x8410('0x10'));var authService=require(_0x8410('0x11'));var qs=require(_0x8410('0x12'));var as=require(_0x8410('0x13'));var hardwareService=require(_0x8410('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x8410('0x15'));var config=require(_0x8410('0x16'));var licenseUtil=require(_0x8410('0x17'));var db=require(_0x8410('0x18'))['db'];config[_0x8410('0x19')]=_[_0x8410('0x1a')](config[_0x8410('0x19')],{'host':_0x8410('0x1b'),'port':0x18eb});var socket=require(_0x8410('0x1c'))(new Redis(config['redis']));require(_0x8410('0x1d'))[_0x8410('0x1e')](socket);function respondWithStatusCode(_0x20ad6e,_0x5836d6){_0x5836d6=_0x5836d6||0xcc;return function(_0x2a39c9){if(_0x2a39c9){return _0x20ad6e[_0x8410('0x1f')](_0x5836d6);}return _0x20ad6e[_0x8410('0x20')](_0x5836d6)['end']();};}function respondWithResult(_0x24492d,_0x205ccd){_0x205ccd=_0x205ccd||0xc8;return function(_0x2b43fa){if(_0x2b43fa){return _0x24492d[_0x8410('0x20')](_0x205ccd)[_0x8410('0x21')](_0x2b43fa);}};}function respondWithFilteredResult(_0x49a940,_0x18a9d5){return function(_0x44c5ba){if(_0x44c5ba){var _0x350308=typeof _0x18a9d5['offset']===_0x8410('0x22')&&typeof _0x18a9d5[_0x8410('0x23')]===_0x8410('0x22');var _0x5cc727=_0x44c5ba[_0x8410('0x24')];var _0x27feb5=_0x350308?0x0:_0x18a9d5['offset'];var _0x369986=_0x350308?_0x44c5ba[_0x8410('0x24')]:_0x18a9d5['offset']+_0x18a9d5[_0x8410('0x23')];var _0x500419;if(_0x369986>=_0x5cc727){_0x369986=_0x5cc727;_0x500419=0xc8;}else{_0x500419=0xce;}_0x49a940[_0x8410('0x20')](_0x500419);return _0x49a940[_0x8410('0x25')]('Content-Range',_0x27feb5+'-'+_0x369986+'/'+_0x5cc727)[_0x8410('0x21')](_0x44c5ba);}return null;};}function patchUpdates(_0x1fa3dd){return function(_0x2a16bd){try{jsonpatch[_0x8410('0x26')](_0x2a16bd,_0x1fa3dd,!![]);}catch(_0x16db94){return BPromise[_0x8410('0x27')](_0x16db94);}return _0x2a16bd[_0x8410('0x28')]();};}function saveUpdates(_0x2731a2,_0x500605){return function(_0xa6fa2){if(_0xa6fa2){return _0xa6fa2['update'](_0x2731a2)[_0x8410('0x29')](function(_0x477e3a){return _0x477e3a;});}return null;};}function removeEntity(_0x3fb848,_0xad6271){return function(_0xf7bbc3){if(_0xf7bbc3){return _0xf7bbc3[_0x8410('0x2a')]()[_0x8410('0x29')](function(){_0x3fb848[_0x8410('0x20')](0xcc)[_0x8410('0x2b')]();});}};}function handleEntityNotFound(_0x3b95a7,_0x420cc0){return function(_0x5de78c){if(!_0x5de78c){_0x3b95a7['sendStatus'](0x194);}return _0x5de78c;};}function handleError(_0x46f143,_0x115997){_0x115997=_0x115997||0x1f4;return function(_0x4e3033){logger[_0x8410('0x2c')](_0x4e3033[_0x8410('0x2d')]);if(_0x4e3033['name']){delete _0x4e3033[_0x8410('0x2e')];}_0x46f143[_0x8410('0x20')](_0x115997)['send'](_0x4e3033);};}exports[_0x8410('0x2f')]=function(_0x4228b3,_0xcea616){var _0xc54207={},_0x7cfc35={},_0x1210a4={'count':0x0,'rows':[]};var _0x1b2f42=_['map'](db[_0x8410('0x30')]['rawAttributes'],function(_0x260ad6){return{'name':_0x260ad6[_0x8410('0x31')],'type':_0x260ad6[_0x8410('0x32')][_0x8410('0x33')]};});_0x7cfc35[_0x8410('0x34')]=_['map'](_0x1b2f42,_0x8410('0x2e'));_0x7cfc35[_0x8410('0x35')]=_[_0x8410('0x36')](_0x4228b3['query']);_0x7cfc35[_0x8410('0x37')]=_['intersection'](_0x7cfc35[_0x8410('0x34')],_0x7cfc35['query']);_0xc54207[_0x8410('0x38')]=_[_0x8410('0x39')](_0x7cfc35['model'],qs[_0x8410('0x3a')](_0x4228b3['query'][_0x8410('0x3a')]));_0xc54207[_0x8410('0x38')]=_0xc54207[_0x8410('0x38')][_0x8410('0x3b')]?_0xc54207[_0x8410('0x38')]:_0x7cfc35[_0x8410('0x34')];if(!_0x4228b3[_0x8410('0x35')][_0x8410('0x3c')](_0x8410('0x3d'))){_0xc54207[_0x8410('0x23')]=qs['limit'](_0x4228b3['query'][_0x8410('0x23')]);_0xc54207[_0x8410('0x3e')]=qs['offset'](_0x4228b3['query'][_0x8410('0x3e')]);}_0xc54207[_0x8410('0x3f')]=qs[_0x8410('0x40')](_0x4228b3['query'][_0x8410('0x40')]);_0xc54207['where']=qs['filters'](_['pick'](_0x4228b3['query'],_0x7cfc35['filters']),_0x1b2f42);if(_0x4228b3['query'][_0x8410('0x41')]){_0xc54207[_0x8410('0x42')]=_[_0x8410('0x43')](_0xc54207[_0x8410('0x42')],{'$or':_[_0x8410('0x44')](_0x1b2f42,function(_0x2cd039){if(_0x2cd039[_0x8410('0x32')]!==_0x8410('0x45')){var _0x9933be={};_0x9933be[_0x2cd039['name']]={'$like':'%'+_0x4228b3[_0x8410('0x35')]['filter']+'%'};return _0x9933be;}})});}_0xc54207=_[_0x8410('0x43')]({},_0xc54207,_0x4228b3[_0x8410('0x46')]);var _0x20ad5e={'where':_0xc54207[_0x8410('0x42')]};return db['ChatInternalMessage'][_0x8410('0x24')](_0x20ad5e)[_0x8410('0x29')](function(_0x506525){_0x1210a4[_0x8410('0x24')]=_0x506525;if(_0x4228b3[_0x8410('0x35')][_0x8410('0x47')]){_0xc54207[_0x8410('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x8410('0x49')](_0xc54207);})[_0x8410('0x29')](function(_0x57bb51){_0x1210a4[_0x8410('0x4a')]=_0x57bb51;return _0x1210a4;})[_0x8410('0x29')](respondWithFilteredResult(_0xcea616,_0xc54207))['catch'](handleError(_0xcea616,null));};exports[_0x8410('0x4b')]=function(_0x3bdd76,_0x1fcccc){var _0x57c2b9={'raw':!![],'where':{'id':_0x3bdd76[_0x8410('0x4c')]['id']}},_0x372de9={};_0x372de9[_0x8410('0x34')]=_[_0x8410('0x36')](db['ChatInternalMessage']['rawAttributes']);_0x372de9[_0x8410('0x35')]=_[_0x8410('0x36')](_0x3bdd76['query']);_0x372de9[_0x8410('0x37')]=_[_0x8410('0x39')](_0x372de9[_0x8410('0x34')],_0x372de9[_0x8410('0x35')]);_0x57c2b9[_0x8410('0x38')]=_['intersection'](_0x372de9[_0x8410('0x34')],qs[_0x8410('0x3a')](_0x3bdd76[_0x8410('0x35')]['fields']));_0x57c2b9[_0x8410('0x38')]=_0x57c2b9[_0x8410('0x38')]['length']?_0x57c2b9[_0x8410('0x38')]:_0x372de9[_0x8410('0x34')];if(_0x3bdd76[_0x8410('0x35')][_0x8410('0x47')]){_0x57c2b9['include']=[{'all':!![]}];}_0x57c2b9=_[_0x8410('0x43')]({},_0x57c2b9,_0x3bdd76[_0x8410('0x46')]);return db[_0x8410('0x30')][_0x8410('0x4d')](_0x57c2b9)[_0x8410('0x29')](handleEntityNotFound(_0x1fcccc,null))[_0x8410('0x29')](respondWithResult(_0x1fcccc,null))['catch'](handleError(_0x1fcccc,null));};exports[_0x8410('0x4e')]=function(_0x18d46b,_0x324e34){return db[_0x8410('0x30')][_0x8410('0x4e')](_0x18d46b[_0x8410('0x4f')],{})[_0x8410('0x29')](respondWithResult(_0x324e34,0xc9))[_0x8410('0x50')](handleError(_0x324e34,null));};exports['update']=function(_0x183020,_0x1032d3){if(_0x183020[_0x8410('0x4f')]['id']){delete _0x183020[_0x8410('0x4f')]['id'];}return db['ChatInternalMessage'][_0x8410('0x4d')]({'where':{'id':_0x183020[_0x8410('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1032d3,null))['then'](saveUpdates(_0x183020['body'],null))[_0x8410('0x29')](respondWithResult(_0x1032d3,null))[_0x8410('0x50')](handleError(_0x1032d3,null));};exports['destroy']=function(_0x281c6b,_0x422b1d){return db[_0x8410('0x30')][_0x8410('0x4d')]({'where':{'id':_0x281c6b[_0x8410('0x4c')]['id']}})['then'](handleEntityNotFound(_0x422b1d,null))[_0x8410('0x29')](removeEntity(_0x422b1d,null))[_0x8410('0x50')](handleError(_0x422b1d,null));};exports[_0x8410('0x51')]=function(_0x1af71f,_0x30aced){return db[_0x8410('0x30')]['describe']()['then'](respondWithResult(_0x30aced,null))[_0x8410('0x50')](handleError(_0x30aced,null));};function wrapUser(_0x4af6e9){return function(_0x2bb78b){var _0x7df79e=_0x4af6e9[_0x8410('0x52')]({'plain':!![]});_0x7df79e[_0x8410('0x53')]=[];if(_0x2bb78b){_0x7df79e[_0x8410('0x54')]=_0x2bb78b[_0x8410('0x55')];_0x7df79e['lastMessage']=_0x2bb78b;}else{_0x7df79e[_0x8410('0x54')]=moment(0x0)['format'](_0x8410('0x56'));_0x7df79e[_0x8410('0x57')]={};}return _0x7df79e;};}exports[_0x8410('0x58')]=function(_0x20f7f6,_0x6ef99d,_0x2e8d9a){var _0x292c5c=[];return db[_0x8410('0x59')][_0x8410('0x49')]({'where':{'role':['agent',_0x8410('0x5a'),_0x8410('0x5b')]},'attributes':['id',_0x8410('0x5c'),_0x8410('0x2e'),_0x8410('0x5d'),'userpic',_0x8410('0x5e'),_0x8410('0x5f'),'lastLoginAt',_0x8410('0x60'),_0x8410('0x61')],'order':qs[_0x8410('0x40')]('-online'),'include':[{'model':db[_0x8410('0x62')],'as':_0x8410('0x63'),'attributes':['id',_0x8410('0x2e'),_0x8410('0x32')],'through':{'attributes':[]}}]})[_0x8410('0x29')](function(_0x5861cc){if(_0x5861cc){var _0x2fe7cc=_0x20f7f6[_0x8410('0x5b')]['get']({'plain':!![]});if(!_0x2fe7cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fe7cc[_0x8410('0x5d')]==='user'){return db[_0x8410('0x64')][_0x8410('0x4d')]({'where':{'name':'Agents','userProfileId':_0x2fe7cc[_0x8410('0x65')]},'raw':!![]})[_0x8410('0x29')](function(_0x5dbd15){if(_0x5dbd15){if(_0x5dbd15[_0x8410('0x66')]===0x0){return db[_0x8410('0x67')][_0x8410('0x49')]({'where':{'sectionId':_0x5dbd15['id']},'raw':!![]})[_0x8410('0x29')](function(_0xe7cf8){var _0x4e9407=[];if(_[_0x8410('0x68')](_0xe7cf8)){_0x4e9407=_[_0x8410('0x41')](_0x5861cc,function(_0x11fdb5){if(_0x11fdb5['role']!==_0x8410('0x69')){return _0x11fdb5;}});return _0x4e9407;}else{for(var _0x3d08f4=0x0;_0x3d08f4<_0x5861cc[_0x8410('0x3b')];_0x3d08f4++){var _0x23e433=_0x5861cc[_0x3d08f4];if(_0x23e433[_0x8410('0x5d')]===_0x8410('0x69')){var _0x3c00b6=_[_0x8410('0x4d')](_0xe7cf8,function(_0x1934d4){return _0x1934d4[_0x8410('0x6a')]===_0x23e433['id'];});if(_0x3c00b6)_0x4e9407[_0x8410('0x6b')](_0x23e433);}else{_0x4e9407[_0x8410('0x6b')](_0x23e433);}}return _0x4e9407;}});}else{return _0x5861cc;}}else{var _0x41a0d0=_[_0x8410('0x41')](_0x5861cc,function(_0x2c4f64){if(_0x2c4f64[_0x8410('0x5d')]!==_0x8410('0x69')){return _0x2c4f64;}});return _0x41a0d0;}});}else{return _0x5861cc;}}})[_0x8410('0x29')](function(_0x36f5c5){var _0x1e6da4=[];if(_0x36f5c5){_0x292c5c=_0x36f5c5;for(var _0x3675c1=0x0;_0x3675c1<_0x36f5c5['length'];_0x3675c1+=0x1){_0x292c5c[_0x3675c1]['messages']=[];_0x1e6da4[_0x8410('0x6b')](db['ChatInternalMessage'][_0x8410('0x4d')]({'where':{'FromId':[_0x20f7f6[_0x8410('0x5b')]['id'],_0x36f5c5[_0x3675c1]['id']],'ToId':[_0x20f7f6[_0x8410('0x5b')]['id'],_0x36f5c5[_0x3675c1]['id']],'ChatGroupId':null},'attributes':['id',_0x8410('0x55'),'FromId',_0x8410('0x6c'),_0x8410('0x6d'),'body'],'order':qs[_0x8410('0x40')](_0x8410('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8410('0x29')](wrapUser(_0x36f5c5[_0x3675c1])));}return BPromise[_0x8410('0x6f')](_0x1e6da4);}return[];})['then'](function(_0x214ed4){return{'rows':_0x214ed4,'count':_0x214ed4[_0x8410('0x3b')]};})['then'](respondWithResult(_0x6ef99d,null))[_0x8410('0x50')](handleError(_0x6ef99d,null));}; \ No newline at end of file +var _0x6007=['find','body','update','describe','get','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','isEmpty','resourceId','push','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','destroy','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','length'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6007,0xf8));var _0x7600=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0x6007[_0x34f545];return _0x1ff6b8;};'use strict';var emlformat=require(_0x7600('0x0'));var rimraf=require(_0x7600('0x1'));var zipdir=require(_0x7600('0x2'));var jsonpatch=require(_0x7600('0x3'));var rp=require('request-promise');var moment=require(_0x7600('0x4'));var BPromise=require(_0x7600('0x5'));var Mustache=require(_0x7600('0x6'));var util=require(_0x7600('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7600('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7600('0x9'));var _=require(_0x7600('0xa'));var squel=require(_0x7600('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7600('0xc'));var toCsv=require(_0x7600('0x8'));var querystring=require(_0x7600('0xd'));var Papa=require('papaparse');var Redis=require(_0x7600('0xe'));var authService=require(_0x7600('0xf'));var qs=require(_0x7600('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7600('0x11'));var logger=require('../../config/logger')(_0x7600('0x12'));var utils=require(_0x7600('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7600('0x14'));var db=require('../../mysqldb')['db'];config[_0x7600('0x15')]=_[_0x7600('0x16')](config['redis'],{'host':_0x7600('0x17'),'port':0x18eb});var socket=require(_0x7600('0x18'))(new Redis(config[_0x7600('0x15')]));require(_0x7600('0x19'))[_0x7600('0x1a')](socket);function respondWithStatusCode(_0x5adc0a,_0x220aa0){_0x220aa0=_0x220aa0||0xcc;return function(_0x240fbf){if(_0x240fbf){return _0x5adc0a[_0x7600('0x1b')](_0x220aa0);}return _0x5adc0a[_0x7600('0x1c')](_0x220aa0)[_0x7600('0x1d')]();};}function respondWithResult(_0x4e21b6,_0x1d7e09){_0x1d7e09=_0x1d7e09||0xc8;return function(_0x3f466d){if(_0x3f466d){return _0x4e21b6[_0x7600('0x1c')](_0x1d7e09)['json'](_0x3f466d);}};}function respondWithFilteredResult(_0x2f35cf,_0x31c3d5){return function(_0xa99f3a){if(_0xa99f3a){var _0x2a298e=typeof _0x31c3d5[_0x7600('0x1e')]===_0x7600('0x1f')&&typeof _0x31c3d5[_0x7600('0x20')]==='undefined';var _0x1fe437=_0xa99f3a['count'];var _0x43421e=_0x2a298e?0x0:_0x31c3d5[_0x7600('0x1e')];var _0x53296b=_0x2a298e?_0xa99f3a[_0x7600('0x21')]:_0x31c3d5[_0x7600('0x1e')]+_0x31c3d5[_0x7600('0x20')];var _0x221d29;if(_0x53296b>=_0x1fe437){_0x53296b=_0x1fe437;_0x221d29=0xc8;}else{_0x221d29=0xce;}_0x2f35cf[_0x7600('0x1c')](_0x221d29);return _0x2f35cf['set'](_0x7600('0x22'),_0x43421e+'-'+_0x53296b+'/'+_0x1fe437)[_0x7600('0x23')](_0xa99f3a);}return null;};}function patchUpdates(_0x360522){return function(_0x2d1704){try{jsonpatch[_0x7600('0x24')](_0x2d1704,_0x360522,!![]);}catch(_0x4b7424){return BPromise[_0x7600('0x25')](_0x4b7424);}return _0x2d1704['save']();};}function saveUpdates(_0x44a7de,_0x40fa85){return function(_0x48b179){if(_0x48b179){return _0x48b179['update'](_0x44a7de)['then'](function(_0x2a5d57){return _0x2a5d57;});}return null;};}function removeEntity(_0x22567a,_0x407389){return function(_0x61bb83){if(_0x61bb83){return _0x61bb83[_0x7600('0x26')]()[_0x7600('0x27')](function(){_0x22567a[_0x7600('0x1c')](0xcc)[_0x7600('0x1d')]();});}};}function handleEntityNotFound(_0x44ddb1,_0x464583){return function(_0x2a976e){if(!_0x2a976e){_0x44ddb1[_0x7600('0x1b')](0x194);}return _0x2a976e;};}function handleError(_0xe800d6,_0x434b0c){_0x434b0c=_0x434b0c||0x1f4;return function(_0x300210){logger[_0x7600('0x28')](_0x300210[_0x7600('0x29')]);if(_0x300210[_0x7600('0x2a')]){delete _0x300210[_0x7600('0x2a')];}_0xe800d6[_0x7600('0x1c')](_0x434b0c)[_0x7600('0x2b')](_0x300210);};}exports[_0x7600('0x2c')]=function(_0x441c63,_0x3a1a43){var _0x1eac3b={},_0x24b6d4={},_0x55e76e={'count':0x0,'rows':[]};var _0x306c05=_[_0x7600('0x2d')](db[_0x7600('0x2e')][_0x7600('0x2f')],function(_0x549b67){return{'name':_0x549b67[_0x7600('0x30')],'type':_0x549b67[_0x7600('0x31')][_0x7600('0x32')]};});_0x24b6d4[_0x7600('0x33')]=_[_0x7600('0x2d')](_0x306c05,_0x7600('0x2a'));_0x24b6d4[_0x7600('0x34')]=_[_0x7600('0x35')](_0x441c63[_0x7600('0x34')]);_0x24b6d4[_0x7600('0x36')]=_[_0x7600('0x37')](_0x24b6d4[_0x7600('0x33')],_0x24b6d4[_0x7600('0x34')]);_0x1eac3b[_0x7600('0x38')]=_['intersection'](_0x24b6d4[_0x7600('0x33')],qs[_0x7600('0x39')](_0x441c63[_0x7600('0x34')][_0x7600('0x39')]));_0x1eac3b[_0x7600('0x38')]=_0x1eac3b[_0x7600('0x38')]['length']?_0x1eac3b['attributes']:_0x24b6d4[_0x7600('0x33')];if(!_0x441c63['query'][_0x7600('0x3a')]('nolimit')){_0x1eac3b[_0x7600('0x20')]=qs[_0x7600('0x20')](_0x441c63[_0x7600('0x34')][_0x7600('0x20')]);_0x1eac3b[_0x7600('0x1e')]=qs['offset'](_0x441c63[_0x7600('0x34')][_0x7600('0x1e')]);}_0x1eac3b[_0x7600('0x3b')]=qs['sort'](_0x441c63[_0x7600('0x34')][_0x7600('0x3c')]);_0x1eac3b['where']=qs['filters'](_[_0x7600('0x3d')](_0x441c63['query'],_0x24b6d4[_0x7600('0x36')]),_0x306c05);if(_0x441c63[_0x7600('0x34')]['filter']){_0x1eac3b['where']=_['merge'](_0x1eac3b['where'],{'$or':_[_0x7600('0x2d')](_0x306c05,function(_0x252689){if(_0x252689[_0x7600('0x31')]!==_0x7600('0x3e')){var _0x1579b0={};_0x1579b0[_0x252689[_0x7600('0x2a')]]={'$like':'%'+_0x441c63['query'][_0x7600('0x3f')]+'%'};return _0x1579b0;}})});}_0x1eac3b=_[_0x7600('0x40')]({},_0x1eac3b,_0x441c63[_0x7600('0x41')]);var _0x47b38f={'where':_0x1eac3b['where']};return db['ChatInternalMessage'][_0x7600('0x21')](_0x47b38f)['then'](function(_0x4a74a5){_0x55e76e[_0x7600('0x21')]=_0x4a74a5;if(_0x441c63[_0x7600('0x34')][_0x7600('0x42')]){_0x1eac3b[_0x7600('0x43')]=[{'all':!![]}];}return db[_0x7600('0x2e')][_0x7600('0x44')](_0x1eac3b);})[_0x7600('0x27')](function(_0x4bd73e){_0x55e76e['rows']=_0x4bd73e;return _0x55e76e;})[_0x7600('0x27')](respondWithFilteredResult(_0x3a1a43,_0x1eac3b))[_0x7600('0x45')](handleError(_0x3a1a43,null));};exports[_0x7600('0x46')]=function(_0x13c0ae,_0x5e37d1){var _0x21048b={'raw':!![],'where':{'id':_0x13c0ae[_0x7600('0x47')]['id']}},_0x4fec0e={};_0x4fec0e[_0x7600('0x33')]=_[_0x7600('0x35')](db['ChatInternalMessage'][_0x7600('0x2f')]);_0x4fec0e[_0x7600('0x34')]=_[_0x7600('0x35')](_0x13c0ae['query']);_0x4fec0e['filters']=_[_0x7600('0x37')](_0x4fec0e[_0x7600('0x33')],_0x4fec0e[_0x7600('0x34')]);_0x21048b[_0x7600('0x38')]=_['intersection'](_0x4fec0e[_0x7600('0x33')],qs[_0x7600('0x39')](_0x13c0ae[_0x7600('0x34')]['fields']));_0x21048b['attributes']=_0x21048b['attributes'][_0x7600('0x48')]?_0x21048b[_0x7600('0x38')]:_0x4fec0e['model'];if(_0x13c0ae[_0x7600('0x34')]['includeAll']){_0x21048b[_0x7600('0x43')]=[{'all':!![]}];}_0x21048b=_[_0x7600('0x40')]({},_0x21048b,_0x13c0ae[_0x7600('0x41')]);return db[_0x7600('0x2e')][_0x7600('0x49')](_0x21048b)['then'](handleEntityNotFound(_0x5e37d1,null))[_0x7600('0x27')](respondWithResult(_0x5e37d1,null))[_0x7600('0x45')](handleError(_0x5e37d1,null));};exports['create']=function(_0x2e1a5d,_0x3e3d22){return db[_0x7600('0x2e')]['create'](_0x2e1a5d[_0x7600('0x4a')],{})['then'](respondWithResult(_0x3e3d22,0xc9))[_0x7600('0x45')](handleError(_0x3e3d22,null));};exports[_0x7600('0x4b')]=function(_0x4a4461,_0x226202){if(_0x4a4461['body']['id']){delete _0x4a4461[_0x7600('0x4a')]['id'];}return db[_0x7600('0x2e')]['find']({'where':{'id':_0x4a4461[_0x7600('0x47')]['id']}})[_0x7600('0x27')](handleEntityNotFound(_0x226202,null))[_0x7600('0x27')](saveUpdates(_0x4a4461[_0x7600('0x4a')],null))[_0x7600('0x27')](respondWithResult(_0x226202,null))[_0x7600('0x45')](handleError(_0x226202,null));};exports[_0x7600('0x26')]=function(_0x179745,_0xee913){return db[_0x7600('0x2e')][_0x7600('0x49')]({'where':{'id':_0x179745[_0x7600('0x47')]['id']}})[_0x7600('0x27')](handleEntityNotFound(_0xee913,null))[_0x7600('0x27')](removeEntity(_0xee913,null))['catch'](handleError(_0xee913,null));};exports[_0x7600('0x4c')]=function(_0x2bf6fe,_0x5f1034){return db['ChatInternalMessage'][_0x7600('0x4c')]()[_0x7600('0x27')](respondWithResult(_0x5f1034,null))['catch'](handleError(_0x5f1034,null));};function wrapUser(_0x38a393){return function(_0x2d2578){var _0x1be9b5=_0x38a393[_0x7600('0x4d')]({'plain':!![]});_0x1be9b5['messages']=[];if(_0x2d2578){_0x1be9b5[_0x7600('0x4e')]=_0x2d2578[_0x7600('0x4f')];_0x1be9b5[_0x7600('0x50')]=_0x2d2578;}else{_0x1be9b5[_0x7600('0x4e')]=moment(0x0)[_0x7600('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x1be9b5['lastMessage']={};}return _0x1be9b5;};}exports[_0x7600('0x52')]=function(_0x9ac5ff,_0x1b16ff,_0x123428){var _0x3063fe=[];return db[_0x7600('0x53')]['findAll']({'where':{'role':[_0x7600('0x54'),_0x7600('0x55'),_0x7600('0x56')]},'attributes':['id','fullname',_0x7600('0x2a'),_0x7600('0x57'),_0x7600('0x58'),_0x7600('0x59'),_0x7600('0x5a'),_0x7600('0x5b'),_0x7600('0x5c'),_0x7600('0x5d')],'order':qs[_0x7600('0x3c')](_0x7600('0x5e')),'include':[{'model':db[_0x7600('0x5f')],'as':_0x7600('0x60'),'attributes':['id',_0x7600('0x2a'),_0x7600('0x31')],'through':{'attributes':[]}}]})[_0x7600('0x27')](function(_0x22ea87){if(_0x22ea87){var _0x2656ec=_0x9ac5ff[_0x7600('0x56')][_0x7600('0x4d')]({'plain':!![]});if(!_0x2656ec)throw new Error(_0x7600('0x61'));if(_0x2656ec['role']===_0x7600('0x56')){return db[_0x7600('0x62')]['find']({'where':{'name':_0x7600('0x63'),'userProfileId':_0x2656ec['userProfileId']},'raw':!![]})[_0x7600('0x27')](function(_0x5831f0){if(_0x5831f0){if(_0x5831f0['autoAssociation']===0x0){return db[_0x7600('0x64')][_0x7600('0x44')]({'where':{'sectionId':_0x5831f0['id']},'raw':!![]})[_0x7600('0x27')](function(_0x1719bb){var _0x38df7d=[];if(_[_0x7600('0x65')](_0x1719bb)){_0x38df7d=_['filter'](_0x22ea87,function(_0x213f11){if(_0x213f11[_0x7600('0x57')]!==_0x7600('0x54')){return _0x213f11;}});return _0x38df7d;}else{for(var _0x1bc3b2=0x0;_0x1bc3b2<_0x22ea87['length'];_0x1bc3b2++){var _0x1b3b12=_0x22ea87[_0x1bc3b2];if(_0x1b3b12[_0x7600('0x57')]==='agent'){var _0x53ad90=_[_0x7600('0x49')](_0x1719bb,function(_0xbcfc63){return _0xbcfc63[_0x7600('0x66')]===_0x1b3b12['id'];});if(_0x53ad90)_0x38df7d[_0x7600('0x67')](_0x1b3b12);}else{_0x38df7d[_0x7600('0x67')](_0x1b3b12);}}return _0x38df7d;}});}else{return _0x22ea87;}}else{var _0x363aa5=_[_0x7600('0x3f')](_0x22ea87,function(_0x22788a){if(_0x22788a['role']!==_0x7600('0x54')){return _0x22788a;}});return _0x363aa5;}});}else{return _0x22ea87;}}})[_0x7600('0x27')](function(_0x1cb928){var _0x39f0ac=[];if(_0x1cb928){_0x3063fe=_0x1cb928;for(var _0x18c4cf=0x0;_0x18c4cf<_0x1cb928['length'];_0x18c4cf+=0x1){_0x3063fe[_0x18c4cf]['messages']=[];_0x39f0ac[_0x7600('0x67')](db[_0x7600('0x2e')][_0x7600('0x49')]({'where':{'FromId':[_0x9ac5ff[_0x7600('0x56')]['id'],_0x1cb928[_0x18c4cf]['id']],'ToId':[_0x9ac5ff[_0x7600('0x56')]['id'],_0x1cb928[_0x18c4cf]['id']],'ChatGroupId':null},'attributes':['id',_0x7600('0x4f'),'FromId',_0x7600('0x68'),'read',_0x7600('0x4a')],'order':qs[_0x7600('0x3c')](_0x7600('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7600('0x27')](wrapUser(_0x1cb928[_0x18c4cf])));}return BPromise[_0x7600('0x6a')](_0x39f0ac);}return[];})[_0x7600('0x27')](function(_0x119deb){return{'rows':_0x119deb,'count':_0x119deb[_0x7600('0x48')]};})[_0x7600('0x27')](respondWithResult(_0x1b16ff,null))['catch'](handleError(_0x1b16ff,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 1cbd832..1af4bb7 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 _0xbb1f=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hook'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xbb1f,0x68));var _0xfbb1=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xbb1f[_0x3e2fcf];return _0x497db7;};'use strict';var EventEmitter=require(_0xfbb1('0x0'));var ChatInternalMessage=require(_0xfbb1('0x1'))['db'][_0xfbb1('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfbb1('0x3')](0x0);var events={'afterCreate':_0xfbb1('0x4'),'afterUpdate':_0xfbb1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5baec0){return function(_0x3119b1,_0x41f5b4,_0x5a261c){ChatInternalMessageEvents[_0xfbb1('0x6')](_0x5baec0+':'+_0x3119b1['id'],_0x3119b1);ChatInternalMessageEvents[_0xfbb1('0x6')](_0x5baec0,_0x3119b1);_0x5a261c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xfbb1('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x751c=['exports','events','../../mysqldb','ChatInternalMessage','save','remove','emit','hook'];(function(_0x25df75,_0x2b0458){var _0x565203=function(_0x1f2c6d){while(--_0x1f2c6d){_0x25df75['push'](_0x25df75['shift']());}};_0x565203(++_0x2b0458);}(_0x751c,0x69));var _0xc751=function(_0x3c38ae,_0x231134){_0x3c38ae=_0x3c38ae-0x0;var _0x44f950=_0x751c[_0x3c38ae];return _0x44f950;};'use strict';var EventEmitter=require(_0xc751('0x0'));var ChatInternalMessage=require(_0xc751('0x1'))['db'][_0xc751('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc751('0x3'),'afterUpdate':'update','afterDestroy':_0xc751('0x4')};function emitEvent(_0x5ec687){return function(_0x26b60d,_0x152802,_0x2ec33d){ChatInternalMessageEvents[_0xc751('0x5')](_0x5ec687+':'+_0x26b60d['id'],_0x26b60d);ChatInternalMessageEvents[_0xc751('0x5')](_0x5ec687,_0x26b60d);_0x2ec33d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xc751('0x6')](e,emitEvent(event));}}module[_0xc751('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 67207ce..b2eb92f 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 _0x7f1d=['define','chat_internal_messages','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports'];(function(_0x51f1af,_0x55a1a4){var _0x3ae83d=function(_0xd475e6){while(--_0xd475e6){_0x51f1af['push'](_0x51f1af['shift']());}};_0x3ae83d(++_0x55a1a4);}(_0x7f1d,0x6f));var _0xd7f1=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x7f1d[_0x74892f];return _0x10ee61;};'use strict';var _=require(_0xd7f1('0x0'));var util=require('util');var logger=require(_0xd7f1('0x1'))(_0xd7f1('0x2'));var moment=require('moment');var BPromise=require(_0xd7f1('0x3'));var rp=require(_0xd7f1('0x4'));var fs=require('fs');var path=require(_0xd7f1('0x5'));var rimraf=require(_0xd7f1('0x6'));var config=require('../../config/environment');var attributes=require(_0xd7f1('0x7'));module[_0xd7f1('0x8')]=function(_0x897167,_0x3213e9){return _0x897167[_0xd7f1('0x9')]('ChatInternalMessage',attributes,{'tableName':_0xd7f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd7f1('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfbac=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x5b61db,_0x43ea33){var _0x84f05f=function(_0xfe6356){while(--_0xfe6356){_0x5b61db['push'](_0x5b61db['shift']());}};_0x84f05f(++_0x43ea33);}(_0xfbac,0x1be));var _0xcfba=function(_0x289961,_0x1085d0){_0x289961=_0x289961-0x0;var _0x393b40=_0xfbac[_0x289961];return _0x393b40;};'use strict';var _=require(_0xcfba('0x0'));var util=require('util');var logger=require(_0xcfba('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcfba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcfba('0x3'));var config=require(_0xcfba('0x4'));var attributes=require(_0xcfba('0x5'));module[_0xcfba('0x6')]=function(_0x4ca324,_0x120995){return _0x4ca324[_0xcfba('0x7')](_0xcfba('0x8'),attributes,{'tableName':_0xcfba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcfba('0xa'),'collate':_0xcfba('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6b37f9a..4e7551d 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 _0x6737=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xc96ce9,_0x39dab2){var _0x4f8966=function(_0x5739ef){while(--_0x5739ef){_0xc96ce9['push'](_0xc96ce9['shift']());}};_0x4f8966(++_0x39dab2);}(_0x6737,0xaf));var _0x7673=function(_0x2465bb,_0x4e46d5){_0x2465bb=_0x2465bb-0x0;var _0x3bd189=_0x6737[_0x2465bb];return _0x3bd189;};'use strict';var _=require(_0x7673('0x0'));var util=require(_0x7673('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require(_0x7673('0x6'))(_0x7673('0x7'));var config=require(_0x7673('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x9')]['http']({'port':0x232a});config[_0x7673('0xa')]=_[_0x7673('0xb')](config['redis'],{'host':_0x7673('0xc'),'port':0x18eb});var socket=require(_0x7673('0xd'))(new Redis(config[_0x7673('0xa')]));require(_0x7673('0xe'))['register'](socket);function respondWithRpcPromise(_0x185630,_0x1091a8,_0x70d6a7){return new BPromise(function(_0x39be53,_0x9c88ef){return client['request'](_0x185630,_0x70d6a7)['then'](function(_0xefe8b8){logger[_0x7673('0xf')](_0x7673('0x10'),_0x1091a8,'request\x20sent');logger['debug'](_0x7673('0x11'),_0x1091a8,_0x7673('0x12'),JSON[_0x7673('0x13')](_0xefe8b8));if(_0xefe8b8[_0x7673('0x14')]){if(_0xefe8b8[_0x7673('0x14')][_0x7673('0x15')]===0x1f4){logger[_0x7673('0x14')](_0x7673('0x10'),_0x1091a8,_0xefe8b8['error']['message']);return _0x9c88ef(_0xefe8b8[_0x7673('0x14')][_0x7673('0x16')]);}logger[_0x7673('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1091a8,_0xefe8b8[_0x7673('0x14')][_0x7673('0x16')]);return _0x39be53(_0xefe8b8[_0x7673('0x14')][_0x7673('0x16')]);}else{logger[_0x7673('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x1091a8,_0x7673('0x12'));_0x39be53(_0xefe8b8[_0x7673('0x17')][_0x7673('0x16')]);}})[_0x7673('0x18')](function(_0x3f8f33){logger[_0x7673('0x14')](_0x7673('0x10'),_0x1091a8,_0x3f8f33);_0x9c88ef(_0x3f8f33);});});} \ No newline at end of file +var _0xab3d=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then'];(function(_0x3ef192,_0x134b44){var _0x49b38d=function(_0xb69b73){while(--_0xb69b73){_0x3ef192['push'](_0x3ef192['shift']());}};_0x49b38d(++_0x134b44);}(_0xab3d,0x82));var _0xdab3=function(_0x2d98ce,_0x40634a){_0x2d98ce=_0x2d98ce-0x0;var _0x3498d4=_0xab3d[_0x2d98ce];return _0x3498d4;};'use strict';var _=require(_0xdab3('0x0'));var util=require(_0xdab3('0x1'));var moment=require('moment');var BPromise=require(_0xdab3('0x2'));var rs=require(_0xdab3('0x3'));var fs=require('fs');var Redis=require(_0xdab3('0x4'));var db=require(_0xdab3('0x5'))['db'];var utils=require(_0xdab3('0x6'));var logger=require(_0xdab3('0x7'))(_0xdab3('0x8'));var config=require(_0xdab3('0x9'));var jayson=require(_0xdab3('0xa'));var client=jayson[_0xdab3('0xb')][_0xdab3('0xc')]({'port':0x232a});config['redis']=_[_0xdab3('0xd')](config[_0xdab3('0xe')],{'host':_0xdab3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdab3('0xe')]));require(_0xdab3('0x10'))[_0xdab3('0x11')](socket);function respondWithRpcPromise(_0x3d039e,_0x121362,_0x500a26){return new BPromise(function(_0x52baec,_0x4d8b3c){return client[_0xdab3('0x12')](_0x3d039e,_0x500a26)[_0xdab3('0x13')](function(_0x81f514){logger[_0xdab3('0x14')](_0xdab3('0x15'),_0x121362,_0xdab3('0x16'));logger[_0xdab3('0x17')](_0xdab3('0x18'),_0x121362,_0xdab3('0x16'),JSON[_0xdab3('0x19')](_0x81f514));if(_0x81f514['error']){if(_0x81f514['error'][_0xdab3('0x1a')]===0x1f4){logger[_0xdab3('0x1b')]('ChatInternalMessage,\x20%s,\x20%s',_0x121362,_0x81f514[_0xdab3('0x1b')]['message']);return _0x4d8b3c(_0x81f514[_0xdab3('0x1b')][_0xdab3('0x1c')]);}logger[_0xdab3('0x1b')](_0xdab3('0x15'),_0x121362,_0x81f514['error']['message']);return _0x52baec(_0x81f514[_0xdab3('0x1b')]['message']);}else{logger[_0xdab3('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x121362,'request\x20sent');_0x52baec(_0x81f514['result'][_0xdab3('0x1c')]);}})[_0xdab3('0x1d')](function(_0x3a816c){logger['error'](_0xdab3('0x15'),_0x121362,_0x3a816c);_0x4d8b3c(_0x3a816c);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index c37afbd..e9567ab 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 _0xf688=['./chatInternalMessage.events','remove','update','emit','register','length','chatInternalMessage:'];(function(_0x592141,_0x5031ad){var _0x52efaa=function(_0x2baf97){while(--_0x2baf97){_0x592141['push'](_0x592141['shift']());}};_0x52efaa(++_0x5031ad);}(_0xf688,0x173));var _0x8f68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf688[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x8f68('0x0'));var events=['save',_0x8f68('0x1'),_0x8f68('0x2')];function createListener(_0x850cf5,_0x275a63){return function(_0xb52e46){_0x275a63[_0x8f68('0x3')](_0x850cf5,_0xb52e46);};}function removeListener(_0x1b0f1f,_0x57888b){return function(){ChatInternalMessageEvents['removeListener'](_0x1b0f1f,_0x57888b);};}exports[_0x8f68('0x4')]=function(_0x3dbc56){for(var _0x3aa650=0x0,_0x28af0c=events[_0x8f68('0x5')];_0x3aa650<_0x28af0c;_0x3aa650++){var _0x4647e9=events[_0x3aa650];var _0x53ef23=createListener(_0x8f68('0x6')+_0x4647e9,_0x3dbc56);ChatInternalMessageEvents['on'](_0x4647e9,_0x53ef23);}}; \ No newline at end of file +var _0x465c=['remove','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x18afcd,_0x4ad238){var _0x2f5699=function(_0x248645){while(--_0x248645){_0x18afcd['push'](_0x18afcd['shift']());}};_0x2f5699(++_0x4ad238);}(_0x465c,0x116));var _0xc465=function(_0x5766c3,_0x1f1aaf){_0x5766c3=_0x5766c3-0x0;var _0x54c435=_0x465c[_0x5766c3];return _0x54c435;};'use strict';var ChatInternalMessageEvents=require(_0xc465('0x0'));var events=[_0xc465('0x1'),_0xc465('0x2'),'update'];function createListener(_0x435a0f,_0x45f7d4){return function(_0x5bfaae){_0x45f7d4[_0xc465('0x3')](_0x435a0f,_0x5bfaae);};}function removeListener(_0x49fde8,_0x2b7c01){return function(){ChatInternalMessageEvents['removeListener'](_0x49fde8,_0x2b7c01);};}exports[_0xc465('0x4')]=function(_0x4e8031){for(var _0x29515a=0x0,_0x444eb8=events[_0xc465('0x5')];_0x29515a<_0x444eb8;_0x29515a++){var _0x3c480b=events[_0x29515a];var _0x4925f7=createListener(_0xc465('0x6')+_0x3c480b,_0x4e8031);ChatInternalMessageEvents['on'](_0x3c480b,_0x4925f7);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index a840401..1de3f5e 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 _0x0796=['express','Router','fs-extra','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout'];(function(_0x50972d,_0x2eed5b){var _0x55cdee=function(_0x33cd8d){while(--_0x33cd8d){_0x50972d['push'](_0x50972d['shift']());}};_0x55cdee(++_0x2eed5b);}(_0x0796,0x131));var _0x6079=function(_0x286d47,_0x4d57be){_0x286d47=_0x286d47-0x0;var _0x3cc213=_0x0796[_0x286d47];return _0x3cc213;};'use strict';var multer=require(_0x6079('0x0'));var util=require(_0x6079('0x1'));var path=require('path');var timeout=require(_0x6079('0x2'));var express=require(_0x6079('0x3'));var router=express[_0x6079('0x4')]();var fs_extra=require(_0x6079('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6079('0x6'));var controller=require(_0x6079('0x7'));router['get']('/',auth[_0x6079('0x8')](),controller[_0x6079('0x9')]);router[_0x6079('0xa')](_0x6079('0xb'),auth[_0x6079('0x8')](),controller[_0x6079('0xc')]);router[_0x6079('0xa')](_0x6079('0xd'),auth['isAuthenticated'](),controller[_0x6079('0xe')]);router[_0x6079('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6079('0xf')]('/',auth['isAuthenticated'](),controller[_0x6079('0x10')]);router[_0x6079('0x11')](_0x6079('0x12'),controller[_0x6079('0x13')]);router['delete'](_0x6079('0x12'),auth[_0x6079('0x8')](),controller[_0x6079('0x14')]);module[_0x6079('0x15')]=router; \ No newline at end of file +var _0x5137=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x5b3aca,_0x3d0d08){var _0x3c93b1=function(_0x11a2f5){while(--_0x11a2f5){_0x5b3aca['push'](_0x5b3aca['shift']());}};_0x3c93b1(++_0x3d0d08);}(_0x5137,0x1c9));var _0x7513=function(_0x309fff,_0x2ae13b){_0x309fff=_0x309fff-0x0;var _0x1c139c=_0x5137[_0x309fff];return _0x1c139c;};'use strict';var multer=require(_0x7513('0x0'));var util=require('util');var path=require(_0x7513('0x1'));var timeout=require(_0x7513('0x2'));var express=require('express');var router=express[_0x7513('0x3')]();var fs_extra=require(_0x7513('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7513('0x5'));var config=require(_0x7513('0x6'));var controller=require(_0x7513('0x7'));router[_0x7513('0x8')]('/',auth[_0x7513('0x9')](),controller[_0x7513('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7513('0xb')]);router[_0x7513('0x8')](_0x7513('0xc'),auth[_0x7513('0x9')](),controller[_0x7513('0xd')]);router[_0x7513('0x8')]('/:id',auth[_0x7513('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7513('0xe')]);router[_0x7513('0xf')](_0x7513('0x10'),controller['update']);router[_0x7513('0x11')]('/:id',auth[_0x7513('0x9')](),controller[_0x7513('0x12')]);module[_0x7513('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 65caf9d..dff3e66 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 _0xdb94=['ENUM','out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x16ad5b,_0x406cb0){var _0x1ebc5b=function(_0x269f86){while(--_0x269f86){_0x16ad5b['push'](_0x16ad5b['shift']());}};_0x1ebc5b(++_0x406cb0);}(_0xdb94,0xab));var _0x4db9=function(_0x2316dd,_0x438ece){_0x2316dd=_0x2316dd-0x0;var _0x16e5ce=_0xdb94[_0x2316dd];return _0x16e5ce;};'use strict';var Sequelize=require(_0x4db9('0x0'));module[_0x4db9('0x1')]={'body':{'type':Sequelize[_0x4db9('0x2')](_0x4db9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4db9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4db9('0x5')]('in',_0x4db9('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4db9('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3cae=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0x3cae,0x117));var _0xe3ca=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x3cae[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0xe3ca('0x0'));module[_0xe3ca('0x1')]={'body':{'type':Sequelize[_0xe3ca('0x2')](_0xe3ca('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe3ca('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe3ca('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe3ca('0x5')]('in','out'),'defaultValue':_0xe3ca('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe3ca('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe3ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 1a53533..fa6d1b3 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 _0xffc9=['set','Content-Range','save','update','destroy','stack','name','send','map','ChatMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','rejectmessage','parse','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status'];(function(_0x4e9a07,_0x1b49f0){var _0xab802a=function(_0x73ba57){while(--_0x73ba57){_0x4e9a07['push'](_0x4e9a07['shift']());}};_0xab802a(++_0x1b49f0);}(_0xffc9,0x1f3));var _0x9ffc=function(_0xa0a1ab,_0x6d0eb7){_0xa0a1ab=_0xa0a1ab-0x0;var _0x3d57aa=_0xffc9[_0xa0a1ab];return _0x3d57aa;};'use strict';var emlformat=require(_0x9ffc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9ffc('0x1'));var rp=require(_0x9ffc('0x2'));var moment=require(_0x9ffc('0x3'));var BPromise=require(_0x9ffc('0x4'));var Mustache=require(_0x9ffc('0x5'));var util=require('util');var path=require(_0x9ffc('0x6'));var sox=require(_0x9ffc('0x7'));var csv=require(_0x9ffc('0x8'));var ejs=require(_0x9ffc('0x9'));var fs=require('fs');var fs_extra=require(_0x9ffc('0xa'));var _=require(_0x9ffc('0xb'));var squel=require(_0x9ffc('0xc'));var crypto=require(_0x9ffc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9ffc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9ffc('0xf'));var Papa=require('papaparse');var Redis=require(_0x9ffc('0x10'));var authService=require(_0x9ffc('0x11'));var qs=require(_0x9ffc('0x12'));var as=require(_0x9ffc('0x13'));var hardwareService=require(_0x9ffc('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9ffc('0x15'));var licenseUtil=require(_0x9ffc('0x16'));var db=require(_0x9ffc('0x17'))['db'];config[_0x9ffc('0x18')]=_[_0x9ffc('0x19')](config[_0x9ffc('0x18')],{'host':_0x9ffc('0x1a'),'port':0x18eb});var socket=require(_0x9ffc('0x1b'))(new Redis(config[_0x9ffc('0x18')]));require(_0x9ffc('0x1c'))[_0x9ffc('0x1d')](socket);var jayson=require(_0x9ffc('0x1e'));var client=jayson[_0x9ffc('0x1f')][_0x9ffc('0x20')]({'port':0x232c});var client9002=jayson[_0x9ffc('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57fd15,_0xe5eb6b,_0x35f763,_0x212790){return new BPromise(function(_0x5b30ac,_0x2bf2b9){var _0x65e869=_0x212790||client;return _0x65e869[_0x9ffc('0x21')](_0x57fd15,_0x35f763)[_0x9ffc('0x22')](function(_0x7f1650){logger[_0x9ffc('0x23')](_0x9ffc('0x24'),_0xe5eb6b,_0x9ffc('0x25'));logger['debug'](_0x9ffc('0x26'),_0xe5eb6b,_0x9ffc('0x25'),JSON[_0x9ffc('0x27')](_0x7f1650));if(_0x7f1650['error']){if(_0x7f1650[_0x9ffc('0x28')][_0x9ffc('0x29')]===0x1f4){logger[_0x9ffc('0x28')]('ChatMessage,\x20%s,\x20%s',_0xe5eb6b,_0x7f1650[_0x9ffc('0x28')]['message']);return _0x2bf2b9(_0x7f1650[_0x9ffc('0x28')]['message']);}logger['error'](_0x9ffc('0x24'),_0xe5eb6b,_0x7f1650[_0x9ffc('0x28')][_0x9ffc('0x2a')]);return _0x5b30ac(_0x7f1650[_0x9ffc('0x28')][_0x9ffc('0x2a')]);}else{logger['info'](_0x9ffc('0x24'),_0xe5eb6b,_0x9ffc('0x25'));_0x5b30ac(_0x7f1650[_0x9ffc('0x2b')][_0x9ffc('0x2a')]);}})[_0x9ffc('0x2c')](function(_0x219fce){logger['error'](_0x9ffc('0x24'),_0xe5eb6b,_0x219fce);_0x2bf2b9(_0x219fce);});});}function respondWithStatusCode(_0xedf97,_0x2c49a0){_0x2c49a0=_0x2c49a0||0xcc;return function(_0x44025c){if(_0x44025c){return _0xedf97[_0x9ffc('0x2d')](_0x2c49a0);}return _0xedf97['status'](_0x2c49a0)[_0x9ffc('0x2e')]();};}function respondWithResult(_0x5a4b44,_0xee0c97){_0xee0c97=_0xee0c97||0xc8;return function(_0x59f13c){if(_0x59f13c){return _0x5a4b44['status'](_0xee0c97)[_0x9ffc('0x2f')](_0x59f13c);}};}function respondWithFilteredResult(_0x859dbe,_0xb36f38){return function(_0x5175b4){if(_0x5175b4){var _0x987369=typeof _0xb36f38[_0x9ffc('0x30')]===_0x9ffc('0x31')&&typeof _0xb36f38[_0x9ffc('0x32')]===_0x9ffc('0x31');var _0x207a4f=_0x5175b4[_0x9ffc('0x33')];var _0x4cf349=_0x987369?0x0:_0xb36f38['offset'];var _0x534385=_0x987369?_0x5175b4[_0x9ffc('0x33')]:_0xb36f38['offset']+_0xb36f38[_0x9ffc('0x32')];var _0x2a3d06;if(_0x534385>=_0x207a4f){_0x534385=_0x207a4f;_0x2a3d06=0xc8;}else{_0x2a3d06=0xce;}_0x859dbe[_0x9ffc('0x34')](_0x2a3d06);return _0x859dbe[_0x9ffc('0x35')](_0x9ffc('0x36'),_0x4cf349+'-'+_0x534385+'/'+_0x207a4f)['json'](_0x5175b4);}return null;};}function patchUpdates(_0x426df7){return function(_0x2f253d){try{jsonpatch['apply'](_0x2f253d,_0x426df7,!![]);}catch(_0x12e47c){return BPromise['reject'](_0x12e47c);}return _0x2f253d[_0x9ffc('0x37')]();};}function saveUpdates(_0x45e096,_0x201435){return function(_0x3126fc){if(_0x3126fc){return _0x3126fc[_0x9ffc('0x38')](_0x45e096)[_0x9ffc('0x22')](function(_0x5470c1){return _0x5470c1;});}return null;};}function removeEntity(_0x2718a6,_0x1563db){return function(_0x2348c1){if(_0x2348c1){return _0x2348c1[_0x9ffc('0x39')]()[_0x9ffc('0x22')](function(){_0x2718a6[_0x9ffc('0x34')](0xcc)[_0x9ffc('0x2e')]();});}};}function handleEntityNotFound(_0x57d074,_0x39d8ee){return function(_0x152b17){if(!_0x152b17){_0x57d074[_0x9ffc('0x2d')](0x194);}return _0x152b17;};}function handleError(_0x481842,_0x32cfbe){_0x32cfbe=_0x32cfbe||0x1f4;return function(_0x1c1619){logger[_0x9ffc('0x28')](_0x1c1619[_0x9ffc('0x3a')]);if(_0x1c1619[_0x9ffc('0x3b')]){delete _0x1c1619[_0x9ffc('0x3b')];}_0x481842[_0x9ffc('0x34')](_0x32cfbe)[_0x9ffc('0x3c')](_0x1c1619);};}exports['index']=function(_0x17ee29,_0x11dcfd){var _0xec8368={},_0x2b1487={},_0x18a26b={'count':0x0,'rows':[]};var _0x198704=_[_0x9ffc('0x3d')](db[_0x9ffc('0x3e')]['rawAttributes'],function(_0x6b5c2b){return{'name':_0x6b5c2b['fieldName'],'type':_0x6b5c2b[_0x9ffc('0x3f')][_0x9ffc('0x40')]};});_0x2b1487[_0x9ffc('0x41')]=_['map'](_0x198704,_0x9ffc('0x3b'));_0x2b1487[_0x9ffc('0x42')]=_[_0x9ffc('0x43')](_0x17ee29[_0x9ffc('0x42')]);_0x2b1487[_0x9ffc('0x44')]=_[_0x9ffc('0x45')](_0x2b1487[_0x9ffc('0x41')],_0x2b1487[_0x9ffc('0x42')]);_0xec8368[_0x9ffc('0x46')]=_['intersection'](_0x2b1487[_0x9ffc('0x41')],qs[_0x9ffc('0x47')](_0x17ee29['query'][_0x9ffc('0x47')]));_0xec8368['attributes']=_0xec8368[_0x9ffc('0x46')][_0x9ffc('0x48')]?_0xec8368[_0x9ffc('0x46')]:_0x2b1487[_0x9ffc('0x41')];if(!_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x49')](_0x9ffc('0x4a'))){_0xec8368[_0x9ffc('0x32')]=qs[_0x9ffc('0x32')](_0x17ee29['query']['limit']);_0xec8368[_0x9ffc('0x30')]=qs[_0x9ffc('0x30')](_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x30')]);}_0xec8368[_0x9ffc('0x4b')]=qs[_0x9ffc('0x4c')](_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x4c')]);_0xec8368[_0x9ffc('0x4d')]=qs[_0x9ffc('0x44')](_[_0x9ffc('0x4e')](_0x17ee29[_0x9ffc('0x42')],_0x2b1487[_0x9ffc('0x44')]),_0x198704);if(_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x4f')]){_0xec8368[_0x9ffc('0x4d')]=_[_0x9ffc('0x50')](_0xec8368[_0x9ffc('0x4d')],{'$or':_[_0x9ffc('0x3d')](_0x198704,function(_0x51d4cb){if(_0x51d4cb[_0x9ffc('0x3f')]!=='VIRTUAL'){var _0xadc0c={};_0xadc0c[_0x51d4cb[_0x9ffc('0x3b')]]={'$like':'%'+_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x4f')]+'%'};return _0xadc0c;}})});}_0xec8368=_[_0x9ffc('0x50')]({},_0xec8368,_0x17ee29[_0x9ffc('0x51')]);var _0x4c92e3={'where':_0xec8368[_0x9ffc('0x4d')]};return db[_0x9ffc('0x3e')]['count'](_0x4c92e3)[_0x9ffc('0x22')](function(_0x2259b3){_0x18a26b[_0x9ffc('0x33')]=_0x2259b3;if(_0x17ee29[_0x9ffc('0x42')][_0x9ffc('0x52')]){_0xec8368[_0x9ffc('0x53')]=[{'all':!![]}];}return db[_0x9ffc('0x3e')][_0x9ffc('0x54')](_0xec8368);})[_0x9ffc('0x22')](function(_0x13c786){_0x18a26b[_0x9ffc('0x55')]=_0x13c786;return _0x18a26b;})[_0x9ffc('0x22')](respondWithFilteredResult(_0x11dcfd,_0xec8368))[_0x9ffc('0x2c')](handleError(_0x11dcfd,null));};exports[_0x9ffc('0x56')]=function(_0x19e4e1,_0x1f6ba8){var _0x1c6340={'raw':!![],'where':{'id':_0x19e4e1[_0x9ffc('0x57')]['id']}},_0x2393d1={};_0x2393d1[_0x9ffc('0x41')]=_[_0x9ffc('0x43')](db[_0x9ffc('0x3e')][_0x9ffc('0x58')]);_0x2393d1[_0x9ffc('0x42')]=_['keys'](_0x19e4e1[_0x9ffc('0x42')]);_0x2393d1[_0x9ffc('0x44')]=_[_0x9ffc('0x45')](_0x2393d1[_0x9ffc('0x41')],_0x2393d1['query']);_0x1c6340[_0x9ffc('0x46')]=_['intersection'](_0x2393d1['model'],qs[_0x9ffc('0x47')](_0x19e4e1[_0x9ffc('0x42')][_0x9ffc('0x47')]));_0x1c6340[_0x9ffc('0x46')]=_0x1c6340[_0x9ffc('0x46')][_0x9ffc('0x48')]?_0x1c6340['attributes']:_0x2393d1[_0x9ffc('0x41')];if(_0x19e4e1['query'][_0x9ffc('0x52')]){_0x1c6340[_0x9ffc('0x53')]=[{'all':!![]}];}_0x1c6340=_['merge']({},_0x1c6340,_0x19e4e1['options']);return db[_0x9ffc('0x3e')][_0x9ffc('0x59')](_0x1c6340)[_0x9ffc('0x22')](handleEntityNotFound(_0x1f6ba8,null))[_0x9ffc('0x22')](respondWithResult(_0x1f6ba8,null))['catch'](handleError(_0x1f6ba8,null));};exports[_0x9ffc('0x5a')]=function(_0x15df98,_0x4bf670){return db[_0x9ffc('0x3e')][_0x9ffc('0x5a')](_0x15df98[_0x9ffc('0x5b')],{})[_0x9ffc('0x22')](respondWithResult(_0x4bf670,0xc9))[_0x9ffc('0x2c')](handleError(_0x4bf670,null));};exports['update']=function(_0x209ab6,_0xd24ca2){if(_0x209ab6[_0x9ffc('0x5b')]['id']){delete _0x209ab6[_0x9ffc('0x5b')]['id'];}return db[_0x9ffc('0x3e')][_0x9ffc('0x59')]({'where':{'id':_0x209ab6[_0x9ffc('0x57')]['id']}})['then'](handleEntityNotFound(_0xd24ca2,null))['then'](saveUpdates(_0x209ab6[_0x9ffc('0x5b')],null))[_0x9ffc('0x22')](respondWithResult(_0xd24ca2,null))['catch'](handleError(_0xd24ca2,null));};exports[_0x9ffc('0x39')]=function(_0x2a83f2,_0x11d200){return db[_0x9ffc('0x3e')]['find']({'where':{'id':_0x2a83f2[_0x9ffc('0x57')]['id']}})[_0x9ffc('0x22')](handleEntityNotFound(_0x11d200,null))[_0x9ffc('0x22')](removeEntity(_0x11d200,null))[_0x9ffc('0x2c')](handleError(_0x11d200,null));};exports[_0x9ffc('0x5c')]=function(_0x588058,_0x5e17cf){return db[_0x9ffc('0x3e')][_0x9ffc('0x5c')]()[_0x9ffc('0x22')](respondWithResult(_0x5e17cf,null))[_0x9ffc('0x2c')](handleError(_0x5e17cf,null));};var interaction_log=require(_0x9ffc('0x5d'))(_0x9ffc('0x5e'));exports[_0x9ffc('0x5f')]=function(_0x4f1018,_0x5cbb27,_0x1f8a73){var _0x29a79f={'agent':{},'channel':_0x9ffc('0x60')};if(_0x4f1018[_0x9ffc('0x5b')]['id']){delete _0x4f1018[_0x9ffc('0x5b')]['id'];}_0x4f1018['body']['read']=!![];_0x4f1018['body'][_0x9ffc('0x61')]=moment()[_0x9ffc('0x62')](_0x9ffc('0x63'));_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x64')]=_0x4f1018['body'][_0x9ffc('0x64')]||_0x4f1018[_0x9ffc('0x65')]['id'];_0x29a79f[_0x9ffc('0x66')]['id']=_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x64')];return db[_0x9ffc('0x3e')][_0x9ffc('0x59')]({'where':{'id':_0x4f1018[_0x9ffc('0x57')]['id'],'UserId':null}})[_0x9ffc('0x22')](handleEntityNotFound(_0x5cbb27,null))[_0x9ffc('0x22')](saveUpdates(_0x4f1018[_0x9ffc('0x5b')],null))[_0x9ffc('0x22')](function(_0x494eb8){if(_0x494eb8){_0x29a79f[_0x9ffc('0x2a')]=_0x494eb8[_0x9ffc('0x67')]({'plain':!![]});return db[_0x9ffc('0x68')][_0x9ffc('0x59')]({'where':{'id':_0x494eb8[_0x9ffc('0x69')]}});}return null;})[_0x9ffc('0x22')](handleEntityNotFound(_0x5cbb27,null))[_0x9ffc('0x22')](function(_0x271b6f){if(_0x271b6f){return _0x271b6f[_0x9ffc('0x38')]({'UserId':_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x64')],'read1stAt':_[_0x9ffc('0x6a')](_0x271b6f[_0x9ffc('0x6b')])?moment()['format'](_0x9ffc('0x63')):undefined});}return null;})[_0x9ffc('0x22')](function(_0x14920c){if(_0x14920c){_0x29a79f[_0x9ffc('0x6c')]=_0x14920c[_0x9ffc('0x67')]({'plain':!![]});interaction_log[_0x9ffc('0x23')](_0x9ffc('0x6d'),_0x4f1018[_0x9ffc('0x65')]['id'],_0x4f1018['user'][_0x9ffc('0x3b')],_0x4f1018['user']['role'],_0x29a79f[_0x9ffc('0x6c')]['id'],_0x4f1018['body']?JSON['stringify'](_0x4f1018[_0x9ffc('0x5b')]):'null');return respondWithRpcPromise('AcceptMessage',_0x9ffc('0x6e'),_0x29a79f);}return null;})[_0x9ffc('0x22')](function(_0x4fb12a){var _0xa20664=_0x9ffc('0x6f')+_0x4fb12a[_0x9ffc('0x2a')][_0x9ffc('0x70')];return db[_0x9ffc('0x71')]['query'](_0xa20664,{'type':db[_0x9ffc('0x72')][_0x9ffc('0x73')][_0x9ffc('0x74')],'raw':!![]})[_0x9ffc('0x22')](function(_0x4008e4){return _0x4008e4;});})[_0x9ffc('0x22')](function(_0x6a2063){if(_0x6a2063){_0x29a79f['message'][_0x9ffc('0x75')]=_0x6a2063[0x0];if(!_0x4f1018[_0x9ffc('0x5b')]['UserId'])return;return db[_0x9ffc('0x76')][_0x9ffc('0x59')]({'where':{'id':_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x64')],'role':_0x9ffc('0x66')},'attributes':['id',_0x9ffc('0x3b'),_0x9ffc('0x77'),_0x9ffc('0x78'),'internal'],'raw':!![]});}return null;})[_0x9ffc('0x22')](function(_0x475b98){if(!_0x475b98)return null;_0x29a79f[_0x9ffc('0x2a')][_0x9ffc('0x66')]=_0x475b98;return _0x29a79f;})[_0x9ffc('0x22')](function(_0x4aa326){if(_0x4aa326){if(_0x4f1018[_0x9ffc('0x5b')][_0x9ffc('0x79')]){_0x29a79f['message'][_0x9ffc('0x7a')]=util[_0x9ffc('0x62')](_0x9ffc('0x7b'),_0x4f1018[_0x9ffc('0x65')][_0x9ffc('0x3b')]);_0x29a79f[_0x9ffc('0x2a')][_0x9ffc('0x7c')]=_0x29a79f[_0x9ffc('0x7c')];_0x29a79f[_0x9ffc('0x2a')][_0x9ffc('0x7d')]=_0x29a79f[_0x9ffc('0x7c')];_0x29a79f['message'][_0x9ffc('0x7e')]=_0x9ffc('0x5f');return respondWithRpcPromise(_0x9ffc('0x7f'),'EventManager',{'event':_0x9ffc('0x80'),'message':_[_0x9ffc('0x50')](_0x29a79f[_0x9ffc('0x2a')],JSON['parse'](_0x29a79f['interaction'][_0x9ffc('0x81')]))},client9002)[_0x9ffc('0x22')](function(){return _0x29a79f;});}return _0x29a79f;}return null;})[_0x9ffc('0x22')](respondWithResult(_0x5cbb27,null))[_0x9ffc('0x2c')](handleError(_0x5cbb27,null));};var interaction_log=require(_0x9ffc('0x5d'))(_0x9ffc('0x5e'));exports[_0x9ffc('0x82')]=function(_0x509ebf,_0x2d3ccb,_0x4005b4){var _0x151f3f={'agent':{},'channel':_0x9ffc('0x60')};if(_0x509ebf[_0x9ffc('0x5b')]['id']){delete _0x509ebf[_0x9ffc('0x5b')]['id'];}_0x509ebf[_0x9ffc('0x5b')][_0x9ffc('0x64')]=_0x509ebf['body'][_0x9ffc('0x64')]||_0x509ebf['user']['id'];_0x151f3f[_0x9ffc('0x66')]['id']=_0x509ebf[_0x9ffc('0x5b')][_0x9ffc('0x64')];return db['ChatMessage'][_0x9ffc('0x59')]({'where':{'id':_0x509ebf[_0x9ffc('0x57')]['id'],'UserId':null}})[_0x9ffc('0x22')](handleEntityNotFound(_0x2d3ccb,null))[_0x9ffc('0x22')](function(_0x4f6de5){if(_0x4f6de5){_0x151f3f[_0x9ffc('0x2a')]=_0x4f6de5[_0x9ffc('0x67')]({'plain':!![]});return db[_0x9ffc('0x68')][_0x9ffc('0x59')]({'where':{'id':_0x4f6de5[_0x9ffc('0x69')]}});}return null;})[_0x9ffc('0x22')](handleEntityNotFound(_0x2d3ccb,null))[_0x9ffc('0x22')](function(_0x45cfb5){if(_0x45cfb5){_0x151f3f[_0x9ffc('0x6c')]=_0x45cfb5[_0x9ffc('0x67')]({'plain':!![]});interaction_log[_0x9ffc('0x23')](_0x9ffc('0x83'),_0x509ebf[_0x9ffc('0x65')]['id'],_0x509ebf[_0x9ffc('0x65')][_0x9ffc('0x3b')],_0x509ebf[_0x9ffc('0x65')][_0x9ffc('0x84')],_0x151f3f[_0x9ffc('0x6c')]['id'],_0x509ebf[_0x9ffc('0x5b')]?JSON[_0x9ffc('0x27')](_0x509ebf[_0x9ffc('0x5b')]):_0x9ffc('0x85'));return respondWithRpcPromise(_0x9ffc('0x86'),_0x9ffc('0x87'),_0x151f3f);}return null;})[_0x9ffc('0x22')](function(_0x4421b1){var _0x241699='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4421b1[_0x9ffc('0x2a')][_0x9ffc('0x70')];return db[_0x9ffc('0x71')]['query'](_0x241699,{'type':db[_0x9ffc('0x72')][_0x9ffc('0x73')]['SELECT'],'raw':!![]})[_0x9ffc('0x22')](function(_0x5c7a32){return _0x5c7a32;});})[_0x9ffc('0x22')](function(_0x2c0c16){if(_0x2c0c16){_0x151f3f['message'][_0x9ffc('0x75')]=_0x2c0c16[0x0];if(!_0x509ebf[_0x9ffc('0x5b')][_0x9ffc('0x64')])return;return db['User'][_0x9ffc('0x59')]({'where':{'id':_0x509ebf[_0x9ffc('0x5b')][_0x9ffc('0x64')],'role':_0x9ffc('0x66')},'attributes':['id','name',_0x9ffc('0x77'),'email','internal'],'raw':!![]});}return null;})[_0x9ffc('0x22')](function(_0x544955){if(!_0x544955)return null;_0x151f3f[_0x9ffc('0x2a')]['agent']=_0x544955;return _0x151f3f;})[_0x9ffc('0x22')](function(_0x139083){if(_0x139083){_0x139083[_0x9ffc('0x2a')]['interface']=util['format'](_0x9ffc('0x7b'),_0x509ebf['user'][_0x9ffc('0x3b')]);_0x139083['message'][_0x9ffc('0x7c')]=_0x151f3f[_0x9ffc('0x7c')];_0x139083['message']['motionChannel']=_0x151f3f[_0x9ffc('0x7c')];_0x139083[_0x9ffc('0x2a')][_0x9ffc('0x7e')]=_0x9ffc('0x82');respondWithRpcPromise('EventManager','EventManager',{'event':_0x9ffc('0x88'),'message':_[_0x9ffc('0x50')](_0x151f3f['message'],JSON[_0x9ffc('0x89')](_0x151f3f[_0x9ffc('0x6c')][_0x9ffc('0x81')]))},client9002);return _0x151f3f;}return null;})[_0x9ffc('0x22')](respondWithResult(_0x2d3ccb,null))[_0x9ffc('0x2c')](handleError(_0x2d3ccb,null));}; \ No newline at end of file +var _0x6a31=['filter','VIRTUAL','merge','options','ChatMessage','includeAll','findAll','rows','show','params','keys','length','find','create','body','describe','../../config/logger','chat-interactions','accept','read','UserId','user','agent','get','ChatInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','User','internal','rejectmessage','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0x6a31,0xba));var _0x16a3=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x6a31[_0x420b24];return _0x4da552;};'use strict';var emlformat=require(_0x16a3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x16a3('0x1'));var rp=require('request-promise');var moment=require(_0x16a3('0x2'));var BPromise=require(_0x16a3('0x3'));var Mustache=require(_0x16a3('0x4'));var util=require('util');var path=require('path');var sox=require(_0x16a3('0x5'));var csv=require(_0x16a3('0x6'));var ejs=require(_0x16a3('0x7'));var fs=require('fs');var fs_extra=require(_0x16a3('0x8'));var _=require('lodash');var squel=require(_0x16a3('0x9'));var crypto=require('crypto');var jsforce=require(_0x16a3('0xa'));var deskjs=require(_0x16a3('0xb'));var toCsv=require(_0x16a3('0x6'));var querystring=require('querystring');var Papa=require(_0x16a3('0xc'));var Redis=require(_0x16a3('0xd'));var authService=require(_0x16a3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x16a3('0xf'));var hardwareService=require(_0x16a3('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x16a3('0x11'));var config=require(_0x16a3('0x12'));var licenseUtil=require(_0x16a3('0x13'));var db=require('../../mysqldb')['db'];config[_0x16a3('0x14')]=_[_0x16a3('0x15')](config[_0x16a3('0x14')],{'host':_0x16a3('0x16'),'port':0x18eb});var socket=require(_0x16a3('0x17'))(new Redis(config[_0x16a3('0x14')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x16a3('0x18')]['http']({'port':0x232c});var client9002=jayson['client'][_0x16a3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2974b8,_0x2a269c,_0x1d292d,_0x4e0ad6){return new BPromise(function(_0x36fe33,_0x3aabd7){var _0x3800a1=_0x4e0ad6||client;return _0x3800a1[_0x16a3('0x1a')](_0x2974b8,_0x1d292d)[_0x16a3('0x1b')](function(_0x27e029){logger[_0x16a3('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x2a269c,_0x16a3('0x1d'));logger[_0x16a3('0x1e')](_0x16a3('0x1f'),_0x2a269c,_0x16a3('0x1d'),JSON[_0x16a3('0x20')](_0x27e029));if(_0x27e029['error']){if(_0x27e029[_0x16a3('0x21')][_0x16a3('0x22')]===0x1f4){logger[_0x16a3('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2a269c,_0x27e029[_0x16a3('0x21')]['message']);return _0x3aabd7(_0x27e029[_0x16a3('0x21')][_0x16a3('0x23')]);}logger['error'](_0x16a3('0x24'),_0x2a269c,_0x27e029[_0x16a3('0x21')][_0x16a3('0x23')]);return _0x36fe33(_0x27e029[_0x16a3('0x21')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2a269c,_0x16a3('0x1d'));_0x36fe33(_0x27e029['result']['message']);}})[_0x16a3('0x25')](function(_0x3f3e97){logger[_0x16a3('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2a269c,_0x3f3e97);_0x3aabd7(_0x3f3e97);});});}function respondWithStatusCode(_0x1d5ae1,_0x2f8894){_0x2f8894=_0x2f8894||0xcc;return function(_0x5c7864){if(_0x5c7864){return _0x1d5ae1['sendStatus'](_0x2f8894);}return _0x1d5ae1[_0x16a3('0x26')](_0x2f8894)[_0x16a3('0x27')]();};}function respondWithResult(_0x43e7cd,_0x12502c){_0x12502c=_0x12502c||0xc8;return function(_0x354897){if(_0x354897){return _0x43e7cd[_0x16a3('0x26')](_0x12502c)[_0x16a3('0x28')](_0x354897);}};}function respondWithFilteredResult(_0x532a48,_0x1c8488){return function(_0x5ed0f9){if(_0x5ed0f9){var _0x3500fb=typeof _0x1c8488[_0x16a3('0x29')]===_0x16a3('0x2a')&&typeof _0x1c8488[_0x16a3('0x2b')]===_0x16a3('0x2a');var _0x1b434c=_0x5ed0f9[_0x16a3('0x2c')];var _0xfb0592=_0x3500fb?0x0:_0x1c8488[_0x16a3('0x29')];var _0x4554de=_0x3500fb?_0x5ed0f9['count']:_0x1c8488[_0x16a3('0x29')]+_0x1c8488[_0x16a3('0x2b')];var _0x35c4f8;if(_0x4554de>=_0x1b434c){_0x4554de=_0x1b434c;_0x35c4f8=0xc8;}else{_0x35c4f8=0xce;}_0x532a48[_0x16a3('0x26')](_0x35c4f8);return _0x532a48[_0x16a3('0x2d')]('Content-Range',_0xfb0592+'-'+_0x4554de+'/'+_0x1b434c)[_0x16a3('0x28')](_0x5ed0f9);}return null;};}function patchUpdates(_0x580343){return function(_0x3a9f4a){try{jsonpatch[_0x16a3('0x2e')](_0x3a9f4a,_0x580343,!![]);}catch(_0x35cfa6){return BPromise[_0x16a3('0x2f')](_0x35cfa6);}return _0x3a9f4a[_0x16a3('0x30')]();};}function saveUpdates(_0x38df00,_0x612fc8){return function(_0x4ae579){if(_0x4ae579){return _0x4ae579[_0x16a3('0x31')](_0x38df00)[_0x16a3('0x1b')](function(_0x2bc8a8){return _0x2bc8a8;});}return null;};}function removeEntity(_0x2e8e76,_0x4d83eb){return function(_0x2bf07e){if(_0x2bf07e){return _0x2bf07e[_0x16a3('0x32')]()['then'](function(){_0x2e8e76[_0x16a3('0x26')](0xcc)[_0x16a3('0x27')]();});}};}function handleEntityNotFound(_0x3f7949,_0x490f65){return function(_0x45d843){if(!_0x45d843){_0x3f7949[_0x16a3('0x33')](0x194);}return _0x45d843;};}function handleError(_0x4b88cc,_0x31d9ad){_0x31d9ad=_0x31d9ad||0x1f4;return function(_0x57183a){logger[_0x16a3('0x21')](_0x57183a[_0x16a3('0x34')]);if(_0x57183a['name']){delete _0x57183a[_0x16a3('0x35')];}_0x4b88cc[_0x16a3('0x26')](_0x31d9ad)[_0x16a3('0x36')](_0x57183a);};}exports[_0x16a3('0x37')]=function(_0x3f9063,_0x640b8){var _0x46033e={},_0x1d9ce1={},_0x4ccd22={'count':0x0,'rows':[]};var _0x192031=_[_0x16a3('0x38')](db['ChatMessage'][_0x16a3('0x39')],function(_0x4d3cc3){return{'name':_0x4d3cc3[_0x16a3('0x3a')],'type':_0x4d3cc3[_0x16a3('0x3b')]['key']};});_0x1d9ce1[_0x16a3('0x3c')]=_[_0x16a3('0x38')](_0x192031,_0x16a3('0x35'));_0x1d9ce1[_0x16a3('0x3d')]=_['keys'](_0x3f9063[_0x16a3('0x3d')]);_0x1d9ce1[_0x16a3('0x3e')]=_[_0x16a3('0x3f')](_0x1d9ce1['model'],_0x1d9ce1[_0x16a3('0x3d')]);_0x46033e[_0x16a3('0x40')]=_[_0x16a3('0x3f')](_0x1d9ce1[_0x16a3('0x3c')],qs[_0x16a3('0x41')](_0x3f9063[_0x16a3('0x3d')][_0x16a3('0x41')]));_0x46033e[_0x16a3('0x40')]=_0x46033e[_0x16a3('0x40')]['length']?_0x46033e[_0x16a3('0x40')]:_0x1d9ce1[_0x16a3('0x3c')];if(!_0x3f9063[_0x16a3('0x3d')][_0x16a3('0x42')](_0x16a3('0x43'))){_0x46033e[_0x16a3('0x2b')]=qs[_0x16a3('0x2b')](_0x3f9063['query'][_0x16a3('0x2b')]);_0x46033e['offset']=qs['offset'](_0x3f9063['query'][_0x16a3('0x29')]);}_0x46033e[_0x16a3('0x44')]=qs[_0x16a3('0x45')](_0x3f9063['query'][_0x16a3('0x45')]);_0x46033e[_0x16a3('0x46')]=qs[_0x16a3('0x3e')](_[_0x16a3('0x47')](_0x3f9063[_0x16a3('0x3d')],_0x1d9ce1[_0x16a3('0x3e')]),_0x192031);if(_0x3f9063[_0x16a3('0x3d')][_0x16a3('0x48')]){_0x46033e[_0x16a3('0x46')]=_['merge'](_0x46033e[_0x16a3('0x46')],{'$or':_[_0x16a3('0x38')](_0x192031,function(_0x1f946c){if(_0x1f946c[_0x16a3('0x3b')]!==_0x16a3('0x49')){var _0x379cf2={};_0x379cf2[_0x1f946c['name']]={'$like':'%'+_0x3f9063[_0x16a3('0x3d')]['filter']+'%'};return _0x379cf2;}})});}_0x46033e=_[_0x16a3('0x4a')]({},_0x46033e,_0x3f9063[_0x16a3('0x4b')]);var _0x4abc40={'where':_0x46033e['where']};return db[_0x16a3('0x4c')][_0x16a3('0x2c')](_0x4abc40)[_0x16a3('0x1b')](function(_0x5b239b){_0x4ccd22['count']=_0x5b239b;if(_0x3f9063[_0x16a3('0x3d')][_0x16a3('0x4d')]){_0x46033e['include']=[{'all':!![]}];}return db[_0x16a3('0x4c')][_0x16a3('0x4e')](_0x46033e);})[_0x16a3('0x1b')](function(_0x4a65b2){_0x4ccd22[_0x16a3('0x4f')]=_0x4a65b2;return _0x4ccd22;})[_0x16a3('0x1b')](respondWithFilteredResult(_0x640b8,_0x46033e))[_0x16a3('0x25')](handleError(_0x640b8,null));};exports[_0x16a3('0x50')]=function(_0x4c4786,_0x136776){var _0xb20f7d={'raw':!![],'where':{'id':_0x4c4786[_0x16a3('0x51')]['id']}},_0x2fdc0b={};_0x2fdc0b[_0x16a3('0x3c')]=_[_0x16a3('0x52')](db[_0x16a3('0x4c')][_0x16a3('0x39')]);_0x2fdc0b[_0x16a3('0x3d')]=_[_0x16a3('0x52')](_0x4c4786[_0x16a3('0x3d')]);_0x2fdc0b[_0x16a3('0x3e')]=_[_0x16a3('0x3f')](_0x2fdc0b[_0x16a3('0x3c')],_0x2fdc0b['query']);_0xb20f7d[_0x16a3('0x40')]=_[_0x16a3('0x3f')](_0x2fdc0b[_0x16a3('0x3c')],qs[_0x16a3('0x41')](_0x4c4786['query'][_0x16a3('0x41')]));_0xb20f7d[_0x16a3('0x40')]=_0xb20f7d[_0x16a3('0x40')][_0x16a3('0x53')]?_0xb20f7d[_0x16a3('0x40')]:_0x2fdc0b['model'];if(_0x4c4786[_0x16a3('0x3d')][_0x16a3('0x4d')]){_0xb20f7d['include']=[{'all':!![]}];}_0xb20f7d=_['merge']({},_0xb20f7d,_0x4c4786['options']);return db[_0x16a3('0x4c')][_0x16a3('0x54')](_0xb20f7d)[_0x16a3('0x1b')](handleEntityNotFound(_0x136776,null))[_0x16a3('0x1b')](respondWithResult(_0x136776,null))[_0x16a3('0x25')](handleError(_0x136776,null));};exports[_0x16a3('0x55')]=function(_0x16d393,_0x4ec919){return db[_0x16a3('0x4c')][_0x16a3('0x55')](_0x16d393[_0x16a3('0x56')],{})[_0x16a3('0x1b')](respondWithResult(_0x4ec919,0xc9))[_0x16a3('0x25')](handleError(_0x4ec919,null));};exports[_0x16a3('0x31')]=function(_0x149d48,_0x984ea0){if(_0x149d48['body']['id']){delete _0x149d48['body']['id'];}return db[_0x16a3('0x4c')][_0x16a3('0x54')]({'where':{'id':_0x149d48[_0x16a3('0x51')]['id']}})['then'](handleEntityNotFound(_0x984ea0,null))[_0x16a3('0x1b')](saveUpdates(_0x149d48[_0x16a3('0x56')],null))['then'](respondWithResult(_0x984ea0,null))['catch'](handleError(_0x984ea0,null));};exports[_0x16a3('0x32')]=function(_0x1ca75e,_0x5b8550){return db['ChatMessage']['find']({'where':{'id':_0x1ca75e[_0x16a3('0x51')]['id']}})[_0x16a3('0x1b')](handleEntityNotFound(_0x5b8550,null))['then'](removeEntity(_0x5b8550,null))[_0x16a3('0x25')](handleError(_0x5b8550,null));};exports['describe']=function(_0x354421,_0x19748a){return db[_0x16a3('0x4c')][_0x16a3('0x57')]()['then'](respondWithResult(_0x19748a,null))['catch'](handleError(_0x19748a,null));};var interaction_log=require(_0x16a3('0x58'))(_0x16a3('0x59'));exports[_0x16a3('0x5a')]=function(_0x259817,_0x62580b,_0x1f378b){var _0x506e82={'agent':{},'channel':'chat'};if(_0x259817[_0x16a3('0x56')]['id']){delete _0x259817[_0x16a3('0x56')]['id'];}_0x259817[_0x16a3('0x56')][_0x16a3('0x5b')]=!![];_0x259817[_0x16a3('0x56')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x259817['body'][_0x16a3('0x5c')]=_0x259817[_0x16a3('0x56')][_0x16a3('0x5c')]||_0x259817[_0x16a3('0x5d')]['id'];_0x506e82[_0x16a3('0x5e')]['id']=_0x259817[_0x16a3('0x56')]['UserId'];return db[_0x16a3('0x4c')][_0x16a3('0x54')]({'where':{'id':_0x259817[_0x16a3('0x51')]['id'],'UserId':null}})[_0x16a3('0x1b')](handleEntityNotFound(_0x62580b,null))[_0x16a3('0x1b')](saveUpdates(_0x259817[_0x16a3('0x56')],null))['then'](function(_0x1b6bd7){if(_0x1b6bd7){_0x506e82[_0x16a3('0x23')]=_0x1b6bd7[_0x16a3('0x5f')]({'plain':!![]});return db['ChatInteraction'][_0x16a3('0x54')]({'where':{'id':_0x1b6bd7[_0x16a3('0x60')]}});}return null;})[_0x16a3('0x1b')](handleEntityNotFound(_0x62580b,null))[_0x16a3('0x1b')](function(_0x2a9e5c){if(_0x2a9e5c){return _0x2a9e5c['update']({'UserId':_0x259817[_0x16a3('0x56')][_0x16a3('0x5c')],'read1stAt':_['isNil'](_0x2a9e5c[_0x16a3('0x61')])?moment()[_0x16a3('0x62')](_0x16a3('0x63')):undefined});}return null;})[_0x16a3('0x1b')](function(_0x747e46){if(_0x747e46){_0x506e82[_0x16a3('0x64')]=_0x747e46[_0x16a3('0x5f')]({'plain':!![]});interaction_log[_0x16a3('0x1c')](_0x16a3('0x65'),_0x259817['user']['id'],_0x259817[_0x16a3('0x5d')]['name'],_0x259817[_0x16a3('0x5d')]['role'],_0x506e82['interaction']['id'],_0x259817[_0x16a3('0x56')]?JSON[_0x16a3('0x20')](_0x259817[_0x16a3('0x56')]):_0x16a3('0x66'));return respondWithRpcPromise('AcceptMessage',_0x16a3('0x67'),_0x506e82);}return null;})[_0x16a3('0x1b')](function(_0x2aad8d){var _0x4a16fb=_0x16a3('0x68')+_0x2aad8d[_0x16a3('0x23')][_0x16a3('0x69')];return db[_0x16a3('0x6a')]['query'](_0x4a16fb,{'type':db[_0x16a3('0x6b')][_0x16a3('0x6c')]['SELECT'],'raw':!![]})[_0x16a3('0x1b')](function(_0x3bb892){return _0x3bb892;});})['then'](function(_0x1f7ff5){if(_0x1f7ff5){_0x506e82[_0x16a3('0x23')][_0x16a3('0x6d')]=_0x1f7ff5[0x0];if(!_0x259817[_0x16a3('0x56')][_0x16a3('0x5c')])return;return db['User'][_0x16a3('0x54')]({'where':{'id':_0x259817[_0x16a3('0x56')]['UserId'],'role':_0x16a3('0x5e')},'attributes':['id',_0x16a3('0x35'),'fullname',_0x16a3('0x6e'),'internal'],'raw':!![]});}return null;})[_0x16a3('0x1b')](function(_0x5a6dbb){if(!_0x5a6dbb)return null;_0x506e82['message'][_0x16a3('0x5e')]=_0x5a6dbb;return _0x506e82;})['then'](function(_0x1a679d){if(_0x1a679d){if(_0x259817['body'][_0x16a3('0x6f')]){_0x506e82[_0x16a3('0x23')][_0x16a3('0x70')]=util['format'](_0x16a3('0x71'),_0x259817[_0x16a3('0x5d')][_0x16a3('0x35')]);_0x506e82['message'][_0x16a3('0x72')]=_0x506e82[_0x16a3('0x72')];_0x506e82[_0x16a3('0x23')][_0x16a3('0x73')]=_0x506e82['channel'];_0x506e82[_0x16a3('0x23')][_0x16a3('0x74')]='accept';return respondWithRpcPromise(_0x16a3('0x75'),_0x16a3('0x75'),{'event':_0x16a3('0x76'),'message':_[_0x16a3('0x4a')](_0x506e82['message'],JSON['parse'](_0x506e82[_0x16a3('0x64')][_0x16a3('0x77')]))},client9002)[_0x16a3('0x1b')](function(){return _0x506e82;});}return _0x506e82;}return null;})['then'](respondWithResult(_0x62580b,null))[_0x16a3('0x25')](handleError(_0x62580b,null));};var interaction_log=require(_0x16a3('0x58'))('chat-interactions');exports[_0x16a3('0x2f')]=function(_0x4b73f6,_0xe7000f,_0xb097a9){var _0x253a70={'agent':{},'channel':_0x16a3('0x78')};if(_0x4b73f6[_0x16a3('0x56')]['id']){delete _0x4b73f6[_0x16a3('0x56')]['id'];}_0x4b73f6[_0x16a3('0x56')][_0x16a3('0x5c')]=_0x4b73f6[_0x16a3('0x56')][_0x16a3('0x5c')]||_0x4b73f6['user']['id'];_0x253a70[_0x16a3('0x5e')]['id']=_0x4b73f6[_0x16a3('0x56')]['UserId'];return db[_0x16a3('0x4c')][_0x16a3('0x54')]({'where':{'id':_0x4b73f6[_0x16a3('0x51')]['id'],'UserId':null}})[_0x16a3('0x1b')](handleEntityNotFound(_0xe7000f,null))[_0x16a3('0x1b')](function(_0x12900d){if(_0x12900d){_0x253a70[_0x16a3('0x23')]=_0x12900d[_0x16a3('0x5f')]({'plain':!![]});return db[_0x16a3('0x79')]['find']({'where':{'id':_0x12900d[_0x16a3('0x60')]}});}return null;})[_0x16a3('0x1b')](handleEntityNotFound(_0xe7000f,null))[_0x16a3('0x1b')](function(_0xbbd3d){if(_0xbbd3d){_0x253a70[_0x16a3('0x64')]=_0xbbd3d[_0x16a3('0x5f')]({'plain':!![]});interaction_log[_0x16a3('0x1c')](_0x16a3('0x7a'),_0x4b73f6['user']['id'],_0x4b73f6[_0x16a3('0x5d')][_0x16a3('0x35')],_0x4b73f6[_0x16a3('0x5d')][_0x16a3('0x7b')],_0x253a70['interaction']['id'],_0x4b73f6[_0x16a3('0x56')]?JSON[_0x16a3('0x20')](_0x4b73f6['body']):'null');return respondWithRpcPromise(_0x16a3('0x7c'),_0x16a3('0x7d'),_0x253a70);}return null;})[_0x16a3('0x1b')](function(_0x59b529){var _0x785d4b=_0x16a3('0x68')+_0x59b529['message'][_0x16a3('0x69')];return db[_0x16a3('0x6a')][_0x16a3('0x3d')](_0x785d4b,{'type':db['Sequelize'][_0x16a3('0x6c')]['SELECT'],'raw':!![]})[_0x16a3('0x1b')](function(_0x1b4f1d){return _0x1b4f1d;});})[_0x16a3('0x1b')](function(_0x2bc86a){if(_0x2bc86a){_0x253a70[_0x16a3('0x23')][_0x16a3('0x6d')]=_0x2bc86a[0x0];if(!_0x4b73f6[_0x16a3('0x56')][_0x16a3('0x5c')])return;return db[_0x16a3('0x7e')][_0x16a3('0x54')]({'where':{'id':_0x4b73f6[_0x16a3('0x56')][_0x16a3('0x5c')],'role':'agent'},'attributes':['id',_0x16a3('0x35'),'fullname',_0x16a3('0x6e'),_0x16a3('0x7f')],'raw':!![]});}return null;})['then'](function(_0x292a98){if(!_0x292a98)return null;_0x253a70['message'][_0x16a3('0x5e')]=_0x292a98;return _0x253a70;})[_0x16a3('0x1b')](function(_0x23017f){if(_0x23017f){_0x23017f[_0x16a3('0x23')][_0x16a3('0x70')]=util[_0x16a3('0x62')]('SIP/%s',_0x4b73f6[_0x16a3('0x5d')][_0x16a3('0x35')]);_0x23017f[_0x16a3('0x23')][_0x16a3('0x72')]=_0x253a70[_0x16a3('0x72')];_0x23017f['message'][_0x16a3('0x73')]=_0x253a70['channel'];_0x23017f[_0x16a3('0x23')]['event']=_0x16a3('0x2f');respondWithRpcPromise('EventManager',_0x16a3('0x75'),{'event':_0x16a3('0x80'),'message':_['merge'](_0x253a70['message'],JSON['parse'](_0x253a70[_0x16a3('0x64')][_0x16a3('0x77')]))},client9002);return _0x253a70;}return null;})['then'](respondWithResult(_0xe7000f,null))[_0x16a3('0x25')](handleError(_0xe7000f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 5e98fb5..d6602a8 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 _0xc742=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x491d59,_0x24a469){var _0x24c7c1=function(_0x404959){while(--_0x404959){_0x491d59['push'](_0x491d59['shift']());}};_0x24c7c1(++_0x24a469);}(_0xc742,0x92));var _0x2c74=function(_0x57ae89,_0x441387){_0x57ae89=_0x57ae89-0x0;var _0x5ca4c7=_0xc742[_0x57ae89];return _0x5ca4c7;};'use strict';var EventEmitter=require(_0x2c74('0x0'));var ChatMessage=require(_0x2c74('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2c74('0x2')](0x0);var events={'afterCreate':_0x2c74('0x3'),'afterUpdate':'update','afterDestroy':_0x2c74('0x4')};function emitEvent(_0x570b05){return function(_0x5aba27,_0x3e3f43,_0x9ef519){ChatMessageEvents[_0x2c74('0x5')](_0x570b05+':'+_0x5aba27['id'],_0x5aba27);ChatMessageEvents[_0x2c74('0x5')](_0x570b05,_0x5aba27);_0x9ef519(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x2c74('0x6')](e,emitEvent(event));}}module[_0x2c74('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x85d0=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x57c85f,_0x5e2016){var _0x1fde58=function(_0x2b886a){while(--_0x2b886a){_0x57c85f['push'](_0x57c85f['shift']());}};_0x1fde58(++_0x5e2016);}(_0x85d0,0x1a3));var _0x085d=function(_0x3c6e15,_0x1b2a87){_0x3c6e15=_0x3c6e15-0x0;var _0x17fc6f=_0x85d0[_0x3c6e15];return _0x17fc6f;};'use strict';var EventEmitter=require(_0x085d('0x0'));var ChatMessage=require(_0x085d('0x1'))['db'][_0x085d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x085d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x085d('0x4'),'afterDestroy':_0x085d('0x5')};function emitEvent(_0x54bed8){return function(_0x404446,_0x25f0e5,_0x3b1639){ChatMessageEvents[_0x085d('0x6')](_0x54bed8+':'+_0x404446['id'],_0x404446);ChatMessageEvents[_0x085d('0x6')](_0x54bed8,_0x404446);_0x3b1639(null);};}for(var e in events){if(events[_0x085d('0x7')](e)){var event=events[e];ChatMessage[_0x085d('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index bd0fac5..1368a6b 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 _0x961d=['ChatInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x3259ab,_0x4eeda2){var _0x4bd7af=function(_0x327385){while(--_0x327385){_0x3259ab['push'](_0x3259ab['shift']());}};_0x4bd7af(++_0x4eeda2);}(_0x961d,0x9c));var _0xd961=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x961d[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0xd961('0x0'));var util=require(_0xd961('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd961('0x2'));var BPromise=require('bluebird');var rp=require(_0xd961('0x3'));var fs=require('fs');var path=require(_0xd961('0x4'));var rimraf=require('rimraf');var config=require(_0xd961('0x5'));var attributes=require(_0xd961('0x6'));module[_0xd961('0x7')]=function(_0x2349d1,_0x5af184){return _0x2349d1[_0xd961('0x8')](_0xd961('0x9'),attributes,{'tableName':_0xd961('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xd961('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38e557,_0x513901,_0x3b14d4){var _0x5ef3a0=_0x2349d1['models'];var _0xa749bd=_0x38e557['get']({'plain':!![]});if(_0xa749bd['direction'][_0xd961('0xc')]()==='in'||_0xa749bd['direction'][_0xd961('0xc')]()===_0xd961('0xd')&&!_0xa749bd[_0xd961('0xe')]&&!_[_0xd961('0xf')](_0xa749bd[_0xd961('0x10')])){_0x5ef3a0[_0xd961('0x11')][_0xd961('0x12')]({'where':{'id':_0xa749bd[_0xd961('0x13')]}})[_0xd961('0x14')](function(_0x4ffe3b){if(_0x4ffe3b){_0x4ffe3b[_0xd961('0x15')]({'lastMsgAt':_0xa749bd[_0xd961('0x16')],'lastMsgDirection':_0xa749bd['direction'][_0xd961('0xc')]()});}})['catch'](function(_0x16e02d){console[_0xd961('0x17')](_0x16e02d);});}_0x3b14d4();}},'charset':_0xd961('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0698=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','toLowerCase','direction','out','secret','UserId','findOne','ChatInteractionId','update','createdAt'];(function(_0x70d9b3,_0x33bb56){var _0x4d6eda=function(_0x3a4547){while(--_0x3a4547){_0x70d9b3['push'](_0x70d9b3['shift']());}};_0x4d6eda(++_0x33bb56);}(_0x0698,0xc4));var _0x8069=function(_0x36b926,_0x23359c){_0x36b926=_0x36b926-0x0;var _0x1a17f6=_0x0698[_0x36b926];return _0x1a17f6;};'use strict';var _=require(_0x8069('0x0'));var util=require(_0x8069('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8069('0x2'));var BPromise=require(_0x8069('0x3'));var rp=require(_0x8069('0x4'));var fs=require('fs');var path=require(_0x8069('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8069('0x6'));module[_0x8069('0x7')]=function(_0x39728b,_0x54bb0d){return _0x39728b['define'](_0x8069('0x8'),attributes,{'tableName':_0x8069('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x8069('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24bf0e,_0x51305e,_0x3b4d84){var _0x1174e5=_0x39728b['models'];var _0x1228ff=_0x24bf0e['get']({'plain':!![]});if(_0x1228ff['direction'][_0x8069('0xb')]()==='in'||_0x1228ff[_0x8069('0xc')][_0x8069('0xb')]()===_0x8069('0xd')&&!_0x1228ff[_0x8069('0xe')]&&!_['isNil'](_0x1228ff[_0x8069('0xf')])){_0x1174e5['ChatInteraction'][_0x8069('0x10')]({'where':{'id':_0x1228ff[_0x8069('0x11')]}})['then'](function(_0x5a91ea){if(_0x5a91ea){_0x5a91ea[_0x8069('0x12')]({'lastMsgAt':_0x1228ff[_0x8069('0x13')],'lastMsgDirection':_0x1228ff[_0x8069('0xc')][_0x8069('0xb')]()});}})[_0x8069('0x14')](function(_0xe7d27f){console[_0x8069('0x15')](_0xe7d27f);});}_0x3b4d84();}},'charset':_0x8069('0x16'),'collate':_0x8069('0x17')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 9112f5a..4d15b8e 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 _0x18a1=['info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','ChatMessage','create','body','options','raw','CreateChatMessage','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then'];(function(_0x30efe1,_0x170c82){var _0x798a64=function(_0x1ab695){while(--_0x1ab695){_0x30efe1['push'](_0x30efe1['shift']());}};_0x798a64(++_0x170c82);}(_0x18a1,0x1a8));var _0x118a=function(_0x2e711f,_0x18cbe3){_0x2e711f=_0x2e711f-0x0;var _0x14c7d7=_0x18a1[_0x2e711f];return _0x14c7d7;};'use strict';var _=require(_0x118a('0x0'));var util=require(_0x118a('0x1'));var moment=require('moment');var BPromise=require(_0x118a('0x2'));var rs=require(_0x118a('0x3'));var fs=require('fs');var Redis=require(_0x118a('0x4'));var db=require(_0x118a('0x5'))['db'];var utils=require(_0x118a('0x6'));var logger=require(_0x118a('0x7'))('rpc');var config=require(_0x118a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x118a('0x9')][_0x118a('0xa')]({'port':0x232a});config[_0x118a('0xb')]=_[_0x118a('0xc')](config[_0x118a('0xb')],{'host':_0x118a('0xd'),'port':0x18eb});var socket=require(_0x118a('0xe'))(new Redis(config['redis']));require(_0x118a('0xf'))[_0x118a('0x10')](socket);function respondWithRpcPromise(_0x124788,_0x236c1b,_0x9fc224){return new BPromise(function(_0x40c7d1,_0x47a316){return client['request'](_0x124788,_0x9fc224)[_0x118a('0x11')](function(_0x1aeb7a){logger[_0x118a('0x12')]('ChatMessage,\x20%s,\x20%s',_0x236c1b,'request\x20sent');logger[_0x118a('0x13')](_0x118a('0x14'),_0x236c1b,_0x118a('0x15'),JSON[_0x118a('0x16')](_0x1aeb7a));if(_0x1aeb7a['error']){if(_0x1aeb7a[_0x118a('0x17')]['code']===0x1f4){logger['error'](_0x118a('0x18'),_0x236c1b,_0x1aeb7a['error']['message']);return _0x47a316(_0x1aeb7a[_0x118a('0x17')][_0x118a('0x19')]);}logger[_0x118a('0x17')]('ChatMessage,\x20%s,\x20%s',_0x236c1b,_0x1aeb7a[_0x118a('0x17')]['message']);return _0x40c7d1(_0x1aeb7a[_0x118a('0x17')][_0x118a('0x19')]);}else{logger[_0x118a('0x12')]('ChatMessage,\x20%s,\x20%s',_0x236c1b,_0x118a('0x15'));_0x40c7d1(_0x1aeb7a[_0x118a('0x1a')][_0x118a('0x19')]);}})['catch'](function(_0x2cbee9){logger['error'](_0x118a('0x18'),_0x236c1b,_0x2cbee9);_0x47a316(_0x2cbee9);});});}exports['CreateChatMessage']=function(_0x5d8b0c){var _0x5f133f=this;return new Promise(function(_0x41ed97,_0x3686c7){return db[_0x118a('0x1b')][_0x118a('0x1c')](_0x5d8b0c[_0x118a('0x1d')],{'raw':_0x5d8b0c[_0x118a('0x1e')]?_0x5d8b0c['options'][_0x118a('0x1f')]===undefined?!![]:![]:!![]})[_0x118a('0x11')](function(_0x42a1a9){logger[_0x118a('0x12')](_0x118a('0x20'),_0x5d8b0c);logger[_0x118a('0x13')](_0x118a('0x20'),_0x5d8b0c,JSON['stringify'](_0x42a1a9));_0x41ed97(_0x42a1a9);})[_0x118a('0x21')](function(_0x558f45){logger[_0x118a('0x17')](_0x118a('0x20'),_0x558f45[_0x118a('0x19')],_0x5d8b0c);_0x3686c7(_0x5f133f[_0x118a('0x17')](0x1f4,_0x558f45[_0x118a('0x19')]));});});}; \ No newline at end of file +var _0x2d84=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','body','options','catch','util','moment'];(function(_0x3a6c2c,_0x33b1b5){var _0xb93dcc=function(_0x204279){while(--_0x204279){_0x3a6c2c['push'](_0x3a6c2c['shift']());}};_0xb93dcc(++_0x33b1b5);}(_0x2d84,0x11e));var _0x42d8=function(_0x23cfd9,_0x1ca797){_0x23cfd9=_0x23cfd9-0x0;var _0x36ee3c=_0x2d84[_0x23cfd9];return _0x36ee3c;};'use strict';var _=require('lodash');var util=require(_0x42d8('0x0'));var moment=require(_0x42d8('0x1'));var BPromise=require(_0x42d8('0x2'));var rs=require(_0x42d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42d8('0x4'))['db'];var utils=require(_0x42d8('0x5'));var logger=require(_0x42d8('0x6'))(_0x42d8('0x7'));var config=require(_0x42d8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x42d8('0x9')]({'port':0x232a});config[_0x42d8('0xa')]=_[_0x42d8('0xb')](config[_0x42d8('0xa')],{'host':_0x42d8('0xc'),'port':0x18eb});var socket=require(_0x42d8('0xd'))(new Redis(config['redis']));require(_0x42d8('0xe'))[_0x42d8('0xf')](socket);function respondWithRpcPromise(_0x17a7f3,_0x56951c,_0x4cb3d1){return new BPromise(function(_0x222e1d,_0x18c3bd){return client[_0x42d8('0x10')](_0x17a7f3,_0x4cb3d1)[_0x42d8('0x11')](function(_0x271957){logger[_0x42d8('0x12')](_0x42d8('0x13'),_0x56951c,_0x42d8('0x14'));logger[_0x42d8('0x15')](_0x42d8('0x16'),_0x56951c,_0x42d8('0x14'),JSON[_0x42d8('0x17')](_0x271957));if(_0x271957[_0x42d8('0x18')]){if(_0x271957[_0x42d8('0x18')][_0x42d8('0x19')]===0x1f4){logger['error'](_0x42d8('0x13'),_0x56951c,_0x271957[_0x42d8('0x18')][_0x42d8('0x1a')]);return _0x18c3bd(_0x271957[_0x42d8('0x18')][_0x42d8('0x1a')]);}logger['error'](_0x42d8('0x13'),_0x56951c,_0x271957[_0x42d8('0x18')][_0x42d8('0x1a')]);return _0x222e1d(_0x271957[_0x42d8('0x18')][_0x42d8('0x1a')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x56951c,'request\x20sent');_0x222e1d(_0x271957[_0x42d8('0x1b')][_0x42d8('0x1a')]);}})['catch'](function(_0x4104a0){logger['error']('ChatMessage,\x20%s,\x20%s',_0x56951c,_0x4104a0);_0x18c3bd(_0x4104a0);});});}exports[_0x42d8('0x1c')]=function(_0x38f1e1){var _0x201776=this;return new Promise(function(_0x3bdd10,_0x50bb9b){return db['ChatMessage']['create'](_0x38f1e1[_0x42d8('0x1d')],{'raw':_0x38f1e1[_0x42d8('0x1e')]?_0x38f1e1[_0x42d8('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x42d8('0x11')](function(_0x4f1054){logger[_0x42d8('0x12')](_0x42d8('0x1c'),_0x38f1e1);logger['debug'](_0x42d8('0x1c'),_0x38f1e1,JSON[_0x42d8('0x17')](_0x4f1054));_0x3bdd10(_0x4f1054);})[_0x42d8('0x1f')](function(_0xaf6389){logger['error'](_0x42d8('0x1c'),_0xaf6389[_0x42d8('0x1a')],_0x38f1e1);_0x50bb9b(_0x201776[_0x42d8('0x18')](0x1f4,_0xaf6389[_0x42d8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 315dab2..8904805 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 _0x8585=['remove','removeListener','length','chatMessage:','./chatMessage.events','save'];(function(_0x55f178,_0x46f2aa){var _0x1db52a=function(_0x90330){while(--_0x90330){_0x55f178['push'](_0x55f178['shift']());}};_0x1db52a(++_0x46f2aa);}(_0x8585,0x64));var _0x5858=function(_0x2466e2,_0x407b7c){_0x2466e2=_0x2466e2-0x0;var _0x302e44=_0x8585[_0x2466e2];return _0x302e44;};'use strict';var ChatMessageEvents=require(_0x5858('0x0'));var events=[_0x5858('0x1'),_0x5858('0x2'),'update'];function createListener(_0x2864b0,_0x294e8e){return function(_0x5739bc){_0x294e8e['emit'](_0x2864b0,_0x5739bc);};}function removeListener(_0x5c548b,_0x307ed3){return function(){ChatMessageEvents[_0x5858('0x3')](_0x5c548b,_0x307ed3);};}exports['register']=function(_0x5807a2){for(var _0x35b37a=0x0,_0x1d26d1=events[_0x5858('0x4')];_0x35b37a<_0x1d26d1;_0x35b37a++){var _0x5c8e94=events[_0x35b37a];var _0x4d5efe=createListener(_0x5858('0x5')+_0x5c8e94,_0x5807a2);ChatMessageEvents['on'](_0x5c8e94,_0x4d5efe);}}; \ No newline at end of file +var _0x165d=['./chatMessage.events','save','remove','update','chatMessage:'];(function(_0x18f917,_0x4d3ae5){var _0x4d013d=function(_0x5c9acc){while(--_0x5c9acc){_0x18f917['push'](_0x18f917['shift']());}};_0x4d013d(++_0x4d3ae5);}(_0x165d,0x14a));var _0xd165=function(_0x27e82e,_0x33127a){_0x27e82e=_0x27e82e-0x0;var _0x3b1ec3=_0x165d[_0x27e82e];return _0x3b1ec3;};'use strict';var ChatMessageEvents=require(_0xd165('0x0'));var events=[_0xd165('0x1'),_0xd165('0x2'),_0xd165('0x3')];function createListener(_0x1d6b25,_0x31af22){return function(_0x43f2f9){_0x31af22['emit'](_0x1d6b25,_0x43f2f9);};}function removeListener(_0x405ee0,_0x27993b){return function(){ChatMessageEvents['removeListener'](_0x405ee0,_0x27993b);};}exports['register']=function(_0x5435f9){for(var _0x42d256=0x0,_0x2305bc=events['length'];_0x42d256<_0x2305bc;_0x42d256++){var _0x5eec53=events[_0x42d256];var _0x3fd82e=createListener(_0xd165('0x4')+_0x5eec53,_0x5435f9);ChatMessageEvents['on'](_0x5eec53,_0x3fd82e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 8d8514b..08aaf10 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 _0x886e=['../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','show','post','tracked','chat','chatmessage:create','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5be7cb,_0x494b5f){var _0x124dee=function(_0x378856){while(--_0x378856){_0x5be7cb['push'](_0x5be7cb['shift']());}};_0x124dee(++_0x494b5f);}(_0x886e,0xb6));var _0xe886=function(_0x10bc88,_0x50cf83){_0x10bc88=_0x10bc88-0x0;var _0x1f70ca=_0x886e[_0x10bc88];return _0x1f70ca;};'use strict';var multer=require(_0xe886('0x0'));var util=require(_0xe886('0x1'));var path=require(_0xe886('0x2'));var timeout=require(_0xe886('0x3'));var express=require('express');var router=express[_0xe886('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe886('0x5'));var interaction=require(_0xe886('0x6'));var config=require(_0xe886('0x7'));var controller=require(_0xe886('0x8'));router[_0xe886('0x9')]('/',auth[_0xe886('0xa')](),controller['index']);router[_0xe886('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe886('0xb')]);router[_0xe886('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe886('0xc')]);router[_0xe886('0xd')]('/',auth['isAuthenticated'](),interaction[_0xe886('0xe')](_0xe886('0xf'),_0xe886('0x10')),controller['create']);router['put'](_0xe886('0x11'),controller[_0xe886('0x12')]);router[_0xe886('0x13')](_0xe886('0x14'),auth[_0xe886('0xa')](),controller[_0xe886('0x15')]);router[_0xe886('0x13')](_0xe886('0x16'),auth[_0xe886('0xa')](),controller[_0xe886('0x17')]);router[_0xe886('0x18')]('/:id',auth[_0xe886('0xa')](),controller[_0xe886('0x19')]);module[_0xe886('0x1a')]=router; \ No newline at end of file +var _0x4564=['describe','/:id','show','tracked','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x7a52d,_0x430e6e){var _0x9d6f17=function(_0x3d866d){while(--_0x3d866d){_0x7a52d['push'](_0x7a52d['shift']());}};_0x9d6f17(++_0x430e6e);}(_0x4564,0x1e2));var _0x4456=function(_0x2ac479,_0x866701){_0x2ac479=_0x2ac479-0x0;var _0xd63202=_0x4564[_0x2ac479];return _0xd63202;};'use strict';var multer=require(_0x4456('0x0'));var util=require(_0x4456('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4456('0x2'));var router=express[_0x4456('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4456('0x4'));var interaction=require(_0x4456('0x5'));var config=require(_0x4456('0x6'));var controller=require(_0x4456('0x7'));router[_0x4456('0x8')]('/',auth[_0x4456('0x9')](),controller[_0x4456('0xa')]);router[_0x4456('0x8')](_0x4456('0xb'),auth['isAuthenticated'](),controller[_0x4456('0xc')]);router[_0x4456('0x8')](_0x4456('0xd'),auth[_0x4456('0x9')](),controller[_0x4456('0xe')]);router['post']('/',auth[_0x4456('0x9')](),interaction[_0x4456('0xf')]('chat',_0x4456('0x10')),controller[_0x4456('0x11')]);router[_0x4456('0x12')](_0x4456('0xd'),controller['update']);router['put'](_0x4456('0x13'),auth['isAuthenticated'](),controller[_0x4456('0x14')]);router[_0x4456('0x12')](_0x4456('0x15'),auth[_0x4456('0x9')](),controller[_0x4456('0x16')]);router[_0x4456('0x17')](_0x4456('0xd'),auth[_0x4456('0x9')](),controller[_0x4456('0x18')]);module[_0x4456('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 8a7646d..3a35990 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 _0xace9=['exports','sequelize'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xace9,0x1b9));var _0x9ace=function(_0xf31274,_0x205d9b){_0xf31274=_0xf31274-0x0;var _0x4ee45d=_0xace9[_0xf31274];return _0x4ee45d;};'use strict';var Sequelize=require(_0x9ace('0x0'));module[_0x9ace('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x8be2=['TEXT','medium','sequelize','exports'];(function(_0x3735c5,_0x44d6c1){var _0x31e6a3=function(_0x35002c){while(--_0x35002c){_0x3735c5['push'](_0x3735c5['shift']());}};_0x31e6a3(++_0x44d6c1);}(_0x8be2,0x172));var _0x28be=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x8be2[_0x30033a];return _0x5e3518;};'use strict';var Sequelize=require(_0x28be('0x0'));module[_0x28be('0x1')]={'body':{'type':Sequelize[_0x28be('0x2')](_0x28be('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 88266d6..d95dad4 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(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x7a54,0x106));var _0x47a5=function(_0xee740e,_0xbb089f){_0xee740e=_0xee740e-0x0;var _0x5411c1=_0x7a54[_0xee740e];return _0x5411c1;};'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(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7a54,0x106));var _0x47a5=function(_0xb39d01,_0x200fd5){_0xb39d01=_0xb39d01-0x0;var _0x26961b=_0x7a54[_0xb39d01];return _0x26961b;};'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 51948d8..065ae0f 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 _0x1f01=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0x1f01,0xa3));var _0x11f0=function(_0x46c1a8,_0x363524){_0x46c1a8=_0x46c1a8-0x0;var _0x1d2217=_0x1f01[_0x46c1a8];return _0x1d2217;};'use strict';var _=require(_0x11f0('0x0'));var util=require('util');var logger=require(_0x11f0('0x1'))(_0x11f0('0x2'));var moment=require(_0x11f0('0x3'));var BPromise=require(_0x11f0('0x4'));var rp=require(_0x11f0('0x5'));var fs=require('fs');var path=require(_0x11f0('0x6'));var rimraf=require(_0x11f0('0x7'));var config=require(_0x11f0('0x8'));var attributes=require(_0x11f0('0x9'));module['exports']=function(_0x4dda5c,_0x204b3a){return _0x4dda5c[_0x11f0('0xa')](_0x11f0('0xb'),attributes,{'tableName':_0x11f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x11f0('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6c35=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x57cda2,_0x24da77){var _0x5a1749=function(_0x4a2bea){while(--_0x4a2bea){_0x57cda2['push'](_0x57cda2['shift']());}};_0x5a1749(++_0x24da77);}(_0x6c35,0x9f));var _0x56c3=function(_0x451686,_0x1a67be){_0x451686=_0x451686-0x0;var _0x3ce02d=_0x6c35[_0x451686];return _0x3ce02d;};'use strict';var _=require(_0x56c3('0x0'));var util=require(_0x56c3('0x1'));var logger=require(_0x56c3('0x2'))(_0x56c3('0x3'));var moment=require(_0x56c3('0x4'));var BPromise=require(_0x56c3('0x5'));var rp=require(_0x56c3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56c3('0x7'));var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module[_0x56c3('0x8')]=function(_0x400d2b,_0x24de0d){return _0x400d2b[_0x56c3('0x9')](_0x56c3('0xa'),attributes,{'tableName':_0x56c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x56c3('0xc'),'collate':_0x56c3('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index a360c38..d3a1696 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 _0xeece=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5ace60,_0x48c635){var _0x3a9ab7=function(_0x2920f5){while(--_0x2920f5){_0x5ace60['push'](_0x5ace60['shift']());}};_0x3a9ab7(++_0x48c635);}(_0xeece,0x159));var _0xeeec=function(_0x2fb356,_0x567092){_0x2fb356=_0x2fb356-0x0;var _0x27fb4b=_0xeece[_0x2fb356];return _0x27fb4b;};'use strict';var _=require('lodash');var util=require(_0xeeec('0x0'));var moment=require(_0xeeec('0x1'));var BPromise=require(_0xeeec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeeec('0x3'));var db=require(_0xeeec('0x4'))['db'];var utils=require(_0xeeec('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeeec('0x6')][_0xeeec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34949f,_0x5aa42d,_0x1116bc){return new BPromise(function(_0x50e0b7,_0x51e070){return client['request'](_0x34949f,_0x1116bc)['then'](function(_0x1da37b){logger[_0xeeec('0x8')](_0xeeec('0x9'),_0x5aa42d,_0xeeec('0xa'));logger[_0xeeec('0xb')](_0xeeec('0xc'),_0x5aa42d,'request\x20sent',JSON[_0xeeec('0xd')](_0x1da37b));if(_0x1da37b[_0xeeec('0xe')]){if(_0x1da37b[_0xeeec('0xe')][_0xeeec('0xf')]===0x1f4){logger[_0xeeec('0xe')](_0xeeec('0x9'),_0x5aa42d,_0x1da37b[_0xeeec('0xe')][_0xeeec('0x10')]);return _0x51e070(_0x1da37b[_0xeeec('0xe')]['message']);}logger[_0xeeec('0xe')](_0xeeec('0x9'),_0x5aa42d,_0x1da37b[_0xeeec('0xe')][_0xeeec('0x10')]);return _0x50e0b7(_0x1da37b[_0xeeec('0xe')][_0xeeec('0x10')]);}else{logger['info'](_0xeeec('0x9'),_0x5aa42d,_0xeeec('0xa'));_0x50e0b7(_0x1da37b[_0xeeec('0x11')][_0xeeec('0x10')]);}})[_0xeeec('0x12')](function(_0x3a3350){logger[_0xeeec('0xe')](_0xeeec('0x9'),_0x5aa42d,_0x3a3350);_0x51e070(_0x3a3350);});});} \ No newline at end of file +var _0x54f1=['message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2ca7f9,_0x53d851){var _0x314e65=function(_0x37fb4a){while(--_0x37fb4a){_0x2ca7f9['push'](_0x2ca7f9['shift']());}};_0x314e65(++_0x53d851);}(_0x54f1,0x159));var _0x154f=function(_0x2843de,_0x205b0a){_0x2843de=_0x2843de-0x0;var _0x21dfdc=_0x54f1[_0x2843de];return _0x21dfdc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x154f('0x0'));var rs=require(_0x154f('0x1'));var fs=require('fs');var Redis=require(_0x154f('0x2'));var db=require(_0x154f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x154f('0x4'))(_0x154f('0x5'));var config=require(_0x154f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x154f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b22dd,_0x762ee4,_0x4c5fef){return new BPromise(function(_0x31273f,_0x289720){return client['request'](_0x3b22dd,_0x4c5fef)['then'](function(_0x3934e2){logger[_0x154f('0x8')](_0x154f('0x9'),_0x762ee4,_0x154f('0xa'));logger[_0x154f('0xb')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x762ee4,'request\x20sent',JSON[_0x154f('0xc')](_0x3934e2));if(_0x3934e2[_0x154f('0xd')]){if(_0x3934e2[_0x154f('0xd')][_0x154f('0xe')]===0x1f4){logger[_0x154f('0xd')](_0x154f('0x9'),_0x762ee4,_0x3934e2['error'][_0x154f('0xf')]);return _0x289720(_0x3934e2[_0x154f('0xd')][_0x154f('0xf')]);}logger['error'](_0x154f('0x9'),_0x762ee4,_0x3934e2[_0x154f('0xd')][_0x154f('0xf')]);return _0x31273f(_0x3934e2[_0x154f('0xd')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x762ee4,_0x154f('0xa'));_0x31273f(_0x3934e2[_0x154f('0x10')][_0x154f('0xf')]);}})[_0x154f('0x11')](function(_0x3fc28b){logger[_0x154f('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x762ee4,_0x3fc28b);_0x289720(_0x3fc28b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 6bf5508..496ffba 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 _0x2c23=['put','update','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x56806d,_0x41dd74){var _0x461a97=function(_0x43f77b){while(--_0x43f77b){_0x56806d['push'](_0x56806d['shift']());}};_0x461a97(++_0x41dd74);}(_0x2c23,0x1e9));var _0x32c2=function(_0x2716c6,_0x38dd17){_0x2716c6=_0x2716c6-0x0;var _0x518dc2=_0x2c23[_0x2716c6];return _0x518dc2;};'use strict';var multer=require(_0x32c2('0x0'));var util=require(_0x32c2('0x1'));var path=require(_0x32c2('0x2'));var timeout=require('connect-timeout');var express=require(_0x32c2('0x3'));var router=express['Router']();var fs_extra=require(_0x32c2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x32c2('0x5'));var config=require(_0x32c2('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x32c2('0x7')]('/',auth[_0x32c2('0x8')](),controller[_0x32c2('0x9')]);router['get'](_0x32c2('0xa'),auth[_0x32c2('0x8')](),controller[_0x32c2('0xb')]);router[_0x32c2('0x7')](_0x32c2('0xc'),auth[_0x32c2('0x8')](),controller[_0x32c2('0xd')]);router['post']('/',auth[_0x32c2('0x8')](),controller[_0x32c2('0xe')]);router[_0x32c2('0xf')]('/:id',auth[_0x32c2('0x8')](),controller[_0x32c2('0x10')]);router['delete'](_0x32c2('0xc'),auth[_0x32c2('0x8')](),controller['destroy']);module[_0x32c2('0x11')]=router; \ No newline at end of file +var _0x6938=['../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x43b816,_0x2a2a71){var _0x453a27=function(_0x4af6e2){while(--_0x4af6e2){_0x43b816['push'](_0x43b816['shift']());}};_0x453a27(++_0x2a2a71);}(_0x6938,0x1af));var _0x8693=function(_0x2f23e7,_0x17f274){_0x2f23e7=_0x2f23e7-0x0;var _0x110a07=_0x6938[_0x2f23e7];return _0x110a07;};'use strict';var multer=require(_0x8693('0x0'));var util=require(_0x8693('0x1'));var path=require('path');var timeout=require(_0x8693('0x2'));var express=require('express');var router=express[_0x8693('0x3')]();var fs_extra=require(_0x8693('0x4'));var auth=require(_0x8693('0x5'));var interaction=require(_0x8693('0x6'));var config=require('../../config/environment');var controller=require(_0x8693('0x7'));router[_0x8693('0x8')]('/',auth[_0x8693('0x9')](),controller[_0x8693('0xa')]);router[_0x8693('0x8')](_0x8693('0xb'),auth[_0x8693('0x9')](),controller[_0x8693('0xc')]);router[_0x8693('0x8')](_0x8693('0xd'),auth[_0x8693('0x9')](),controller[_0x8693('0xe')]);router['post']('/',auth[_0x8693('0x9')](),controller[_0x8693('0xf')]);router['put'](_0x8693('0xd'),auth['isAuthenticated'](),controller[_0x8693('0x10')]);router['delete']('/:id',auth[_0x8693('0x9')](),controller[_0x8693('0x11')]);module[_0x8693('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 2c04cd5..0df3f4d 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 _0xa36e=['sequelize','ENUM','mouseOver','STRING','INTEGER'];(function(_0x37c1e3,_0x171831){var _0x3e649f=function(_0xaebd06){while(--_0xaebd06){_0x37c1e3['push'](_0x37c1e3['shift']());}};_0x3e649f(++_0x171831);}(_0xa36e,0x136));var _0xea36=function(_0x4d0a17,_0x46f9ad){_0x4d0a17=_0x4d0a17-0x0;var _0x266701=_0xa36e[_0x4d0a17];return _0x266701;};'use strict';var Sequelize=require(_0xea36('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xea36('0x1')](_0xea36('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xea36('0x3')]},'timeout':{'type':Sequelize[_0xea36('0x4')]}}; \ No newline at end of file +var _0xabcd=['mouseOver','INTEGER','sequelize','exports','STRING','ENUM','timeout'];(function(_0xa50a66,_0x1d107d){var _0x4f7264=function(_0x1b16fc){while(--_0x1b16fc){_0xa50a66['push'](_0xa50a66['shift']());}};_0x4f7264(++_0x1d107d);}(_0xabcd,0x12f));var _0xdabc=function(_0x40a184,_0xd64344){_0x40a184=_0x40a184-0x0;var _0x5e22f5=_0xabcd[_0x40a184];return _0x5e22f5;};'use strict';var Sequelize=require(_0xdabc('0x0'));module[_0xdabc('0x1')]={'name':{'type':Sequelize[_0xdabc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdabc('0x3')]('mouseOver',_0xdabc('0x4')),'defaultValue':_0xdabc('0x5')},'selector':{'type':Sequelize[_0xdabc('0x2')]},'timeout':{'type':Sequelize[_0xdabc('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index d0c487c..1184705 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 _0xf3ff=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','includeAll','merge','options','catch','create','body','find'];(function(_0x102376,_0x16c6a2){var _0x29bc9c=function(_0x5fe5b1){while(--_0x5fe5b1){_0x102376['push'](_0x102376['shift']());}};_0x29bc9c(++_0x16c6a2);}(_0xf3ff,0xae));var _0xff3f=function(_0x1e6417,_0x5e3008){_0x1e6417=_0x1e6417-0x0;var _0x4a3256=_0xf3ff[_0x1e6417];return _0x4a3256;};'use strict';var emlformat=require(_0xff3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff3f('0x1'));var jsonpatch=require(_0xff3f('0x2'));var rp=require(_0xff3f('0x3'));var moment=require(_0xff3f('0x4'));var BPromise=require(_0xff3f('0x5'));var Mustache=require(_0xff3f('0x6'));var util=require('util');var path=require(_0xff3f('0x7'));var sox=require(_0xff3f('0x8'));var csv=require(_0xff3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff3f('0xa'));var _=require(_0xff3f('0xb'));var squel=require('squel');var crypto=require(_0xff3f('0xc'));var jsforce=require(_0xff3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff3f('0xe'));var Redis=require('ioredis');var authService=require(_0xff3f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xff3f('0x10'));var hardwareService=require(_0xff3f('0x11'));var logger=require(_0xff3f('0x12'))(_0xff3f('0x13'));var utils=require(_0xff3f('0x14'));var config=require(_0xff3f('0x15'));var licenseUtil=require(_0xff3f('0x16'));var db=require(_0xff3f('0x17'))['db'];function respondWithStatusCode(_0x24a3c8,_0x2b5d15){_0x2b5d15=_0x2b5d15||0xcc;return function(_0x59fe19){if(_0x59fe19){return _0x24a3c8['sendStatus'](_0x2b5d15);}return _0x24a3c8[_0xff3f('0x18')](_0x2b5d15)[_0xff3f('0x19')]();};}function respondWithResult(_0x32f887,_0x4b3409){_0x4b3409=_0x4b3409||0xc8;return function(_0x54b52c){if(_0x54b52c){return _0x32f887[_0xff3f('0x18')](_0x4b3409)['json'](_0x54b52c);}};}function respondWithFilteredResult(_0x5ae3af,_0x2a7c79){return function(_0x95d895){if(_0x95d895){var _0x54e2a5=typeof _0x2a7c79[_0xff3f('0x1a')]==='undefined'&&typeof _0x2a7c79[_0xff3f('0x1b')]==='undefined';var _0x15c6bf=_0x95d895[_0xff3f('0x1c')];var _0xf21b3=_0x54e2a5?0x0:_0x2a7c79['offset'];var _0xc1698d=_0x54e2a5?_0x95d895[_0xff3f('0x1c')]:_0x2a7c79['offset']+_0x2a7c79[_0xff3f('0x1b')];var _0x3a220b;if(_0xc1698d>=_0x15c6bf){_0xc1698d=_0x15c6bf;_0x3a220b=0xc8;}else{_0x3a220b=0xce;}_0x5ae3af[_0xff3f('0x18')](_0x3a220b);return _0x5ae3af[_0xff3f('0x1d')](_0xff3f('0x1e'),_0xf21b3+'-'+_0xc1698d+'/'+_0x15c6bf)[_0xff3f('0x1f')](_0x95d895);}return null;};}function patchUpdates(_0x2ffd20){return function(_0xfd9c46){try{jsonpatch[_0xff3f('0x20')](_0xfd9c46,_0x2ffd20,!![]);}catch(_0x25bd19){return BPromise[_0xff3f('0x21')](_0x25bd19);}return _0xfd9c46[_0xff3f('0x22')]();};}function saveUpdates(_0x2daed4,_0x396044){return function(_0x52986f){if(_0x52986f){return _0x52986f['update'](_0x2daed4)[_0xff3f('0x23')](function(_0x53fbeb){return _0x53fbeb;});}return null;};}function removeEntity(_0x418316,_0x2bbbb2){return function(_0x4dd74a){if(_0x4dd74a){return _0x4dd74a[_0xff3f('0x24')]()['then'](function(){_0x418316[_0xff3f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b234,_0x7b26a0){return function(_0x21cb5d){if(!_0x21cb5d){_0x20b234[_0xff3f('0x25')](0x194);}return _0x21cb5d;};}function handleError(_0x44fb87,_0x5d6a4e){_0x5d6a4e=_0x5d6a4e||0x1f4;return function(_0x579659){logger[_0xff3f('0x26')](_0x579659[_0xff3f('0x27')]);if(_0x579659[_0xff3f('0x28')]){delete _0x579659[_0xff3f('0x28')];}_0x44fb87[_0xff3f('0x18')](_0x5d6a4e)['send'](_0x579659);};}exports[_0xff3f('0x29')]=function(_0x2dac57,_0x5a46ca){var _0x1f6d2a={'raw':!![],'where':{'id':_0x2dac57[_0xff3f('0x2a')]['id']}},_0x33a849={};_0x33a849[_0xff3f('0x2b')]=_[_0xff3f('0x2c')](db[_0xff3f('0x2d')][_0xff3f('0x2e')]);_0x33a849[_0xff3f('0x2f')]=_[_0xff3f('0x2c')](_0x2dac57[_0xff3f('0x2f')]);_0x33a849['filters']=_[_0xff3f('0x30')](_0x33a849['model'],_0x33a849[_0xff3f('0x2f')]);_0x1f6d2a[_0xff3f('0x31')]=_[_0xff3f('0x30')](_0x33a849[_0xff3f('0x2b')],qs[_0xff3f('0x32')](_0x2dac57[_0xff3f('0x2f')][_0xff3f('0x32')]));_0x1f6d2a[_0xff3f('0x31')]=_0x1f6d2a['attributes']['length']?_0x1f6d2a[_0xff3f('0x31')]:_0x33a849[_0xff3f('0x2b')];if(_0x2dac57[_0xff3f('0x2f')][_0xff3f('0x33')]){_0x1f6d2a['include']=[{'all':!![]}];}_0x1f6d2a=_[_0xff3f('0x34')]({},_0x1f6d2a,_0x2dac57[_0xff3f('0x35')]);return db[_0xff3f('0x2d')]['find'](_0x1f6d2a)[_0xff3f('0x23')](handleEntityNotFound(_0x5a46ca,null))[_0xff3f('0x23')](respondWithResult(_0x5a46ca,null))[_0xff3f('0x36')](handleError(_0x5a46ca,null));};exports['create']=function(_0x3df5a,_0x4ed004){return db[_0xff3f('0x2d')][_0xff3f('0x37')](_0x3df5a[_0xff3f('0x38')],{})[_0xff3f('0x23')](respondWithResult(_0x4ed004,0xc9))[_0xff3f('0x36')](handleError(_0x4ed004,null));};exports['update']=function(_0x521d6f,_0x3f8710){if(_0x521d6f['body']['id']){delete _0x521d6f[_0xff3f('0x38')]['id'];}return db[_0xff3f('0x2d')][_0xff3f('0x39')]({'where':{'id':_0x521d6f[_0xff3f('0x2a')]['id']}})[_0xff3f('0x23')](handleEntityNotFound(_0x3f8710,null))[_0xff3f('0x23')](saveUpdates(_0x521d6f[_0xff3f('0x38')],null))[_0xff3f('0x23')](respondWithResult(_0x3f8710,null))[_0xff3f('0x36')](handleError(_0x3f8710,null));};exports[_0xff3f('0x24')]=function(_0x24d1dc,_0x1213f3){return db['ChatProactiveAction']['find']({'where':{'id':_0x24d1dc['params']['id']}})[_0xff3f('0x23')](handleEntityNotFound(_0x1213f3,null))['then'](removeEntity(_0x1213f3,null))['catch'](handleError(_0x1213f3,null));}; \ No newline at end of file +var _0xc43c=['status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0xc43c,0x152));var _0xcc43=function(_0x1ba1b5,_0x2380b3){_0x1ba1b5=_0x1ba1b5-0x0;var _0x9e8627=_0xc43c[_0x1ba1b5];return _0x9e8627;};'use strict';var emlformat=require(_0xcc43('0x0'));var rimraf=require(_0xcc43('0x1'));var zipdir=require(_0xcc43('0x2'));var jsonpatch=require(_0xcc43('0x3'));var rp=require(_0xcc43('0x4'));var moment=require(_0xcc43('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcc43('0x6'));var util=require(_0xcc43('0x7'));var path=require('path');var sox=require(_0xcc43('0x8'));var csv=require(_0xcc43('0x9'));var ejs=require(_0xcc43('0xa'));var fs=require('fs');var fs_extra=require(_0xcc43('0xb'));var _=require(_0xcc43('0xc'));var squel=require(_0xcc43('0xd'));var crypto=require(_0xcc43('0xe'));var jsforce=require(_0xcc43('0xf'));var deskjs=require(_0xcc43('0x10'));var toCsv=require(_0xcc43('0x9'));var querystring=require('querystring');var Papa=require(_0xcc43('0x11'));var Redis=require(_0xcc43('0x12'));var authService=require(_0xcc43('0x13'));var qs=require(_0xcc43('0x14'));var as=require(_0xcc43('0x15'));var hardwareService=require(_0xcc43('0x16'));var logger=require('../../config/logger')(_0xcc43('0x17'));var utils=require(_0xcc43('0x18'));var config=require(_0xcc43('0x19'));var licenseUtil=require(_0xcc43('0x1a'));var db=require(_0xcc43('0x1b'))['db'];function respondWithStatusCode(_0x2e2292,_0x4967cb){_0x4967cb=_0x4967cb||0xcc;return function(_0x3587b8){if(_0x3587b8){return _0x2e2292['sendStatus'](_0x4967cb);}return _0x2e2292[_0xcc43('0x1c')](_0x4967cb)[_0xcc43('0x1d')]();};}function respondWithResult(_0x5289af,_0x4ac110){_0x4ac110=_0x4ac110||0xc8;return function(_0xe312ba){if(_0xe312ba){return _0x5289af[_0xcc43('0x1c')](_0x4ac110)[_0xcc43('0x1e')](_0xe312ba);}};}function respondWithFilteredResult(_0x3b9eff,_0x34326c){return function(_0x345333){if(_0x345333){var _0x4c34a7=typeof _0x34326c['offset']===_0xcc43('0x1f')&&typeof _0x34326c[_0xcc43('0x20')]===_0xcc43('0x1f');var _0x2e053d=_0x345333['count'];var _0x33fe3a=_0x4c34a7?0x0:_0x34326c[_0xcc43('0x21')];var _0x266af8=_0x4c34a7?_0x345333['count']:_0x34326c['offset']+_0x34326c[_0xcc43('0x20')];var _0x18a1ae;if(_0x266af8>=_0x2e053d){_0x266af8=_0x2e053d;_0x18a1ae=0xc8;}else{_0x18a1ae=0xce;}_0x3b9eff['status'](_0x18a1ae);return _0x3b9eff['set'](_0xcc43('0x22'),_0x33fe3a+'-'+_0x266af8+'/'+_0x2e053d)[_0xcc43('0x1e')](_0x345333);}return null;};}function patchUpdates(_0x2418d3){return function(_0x3a1005){try{jsonpatch[_0xcc43('0x23')](_0x3a1005,_0x2418d3,!![]);}catch(_0x3ae999){return BPromise[_0xcc43('0x24')](_0x3ae999);}return _0x3a1005[_0xcc43('0x25')]();};}function saveUpdates(_0x216bdb,_0x188edd){return function(_0x4f72a2){if(_0x4f72a2){return _0x4f72a2[_0xcc43('0x26')](_0x216bdb)[_0xcc43('0x27')](function(_0x2e26b3){return _0x2e26b3;});}return null;};}function removeEntity(_0x40137c,_0x410d18){return function(_0x52c22e){if(_0x52c22e){return _0x52c22e[_0xcc43('0x28')]()[_0xcc43('0x27')](function(){_0x40137c[_0xcc43('0x1c')](0xcc)[_0xcc43('0x1d')]();});}};}function handleEntityNotFound(_0x440efa,_0x52137f){return function(_0x1b44ce){if(!_0x1b44ce){_0x440efa[_0xcc43('0x29')](0x194);}return _0x1b44ce;};}function handleError(_0x110956,_0x2fd407){_0x2fd407=_0x2fd407||0x1f4;return function(_0x38b860){logger[_0xcc43('0x2a')](_0x38b860[_0xcc43('0x2b')]);if(_0x38b860[_0xcc43('0x2c')]){delete _0x38b860[_0xcc43('0x2c')];}_0x110956[_0xcc43('0x1c')](_0x2fd407)['send'](_0x38b860);};}exports['show']=function(_0x33a463,_0xb70262){var _0x1727e4={'raw':!![],'where':{'id':_0x33a463[_0xcc43('0x2d')]['id']}},_0x430664={};_0x430664[_0xcc43('0x2e')]=_[_0xcc43('0x2f')](db[_0xcc43('0x30')]['rawAttributes']);_0x430664[_0xcc43('0x31')]=_[_0xcc43('0x2f')](_0x33a463[_0xcc43('0x31')]);_0x430664[_0xcc43('0x32')]=_[_0xcc43('0x33')](_0x430664[_0xcc43('0x2e')],_0x430664[_0xcc43('0x31')]);_0x1727e4[_0xcc43('0x34')]=_[_0xcc43('0x33')](_0x430664['model'],qs[_0xcc43('0x35')](_0x33a463[_0xcc43('0x31')]['fields']));_0x1727e4[_0xcc43('0x34')]=_0x1727e4[_0xcc43('0x34')][_0xcc43('0x36')]?_0x1727e4[_0xcc43('0x34')]:_0x430664[_0xcc43('0x2e')];if(_0x33a463[_0xcc43('0x31')]['includeAll']){_0x1727e4[_0xcc43('0x37')]=[{'all':!![]}];}_0x1727e4=_[_0xcc43('0x38')]({},_0x1727e4,_0x33a463[_0xcc43('0x39')]);return db['ChatProactiveAction']['find'](_0x1727e4)[_0xcc43('0x27')](handleEntityNotFound(_0xb70262,null))['then'](respondWithResult(_0xb70262,null))[_0xcc43('0x3a')](handleError(_0xb70262,null));};exports['create']=function(_0x368b26,_0x58df74){return db[_0xcc43('0x30')]['create'](_0x368b26[_0xcc43('0x3b')],{})['then'](respondWithResult(_0x58df74,0xc9))[_0xcc43('0x3a')](handleError(_0x58df74,null));};exports['update']=function(_0x21fdea,_0x887d9c){if(_0x21fdea[_0xcc43('0x3b')]['id']){delete _0x21fdea[_0xcc43('0x3b')]['id'];}return db[_0xcc43('0x30')][_0xcc43('0x3c')]({'where':{'id':_0x21fdea['params']['id']}})[_0xcc43('0x27')](handleEntityNotFound(_0x887d9c,null))[_0xcc43('0x27')](saveUpdates(_0x21fdea['body'],null))[_0xcc43('0x27')](respondWithResult(_0x887d9c,null))[_0xcc43('0x3a')](handleError(_0x887d9c,null));};exports[_0xcc43('0x28')]=function(_0x4d6aa2,_0x27989b){return db[_0xcc43('0x30')][_0xcc43('0x3c')]({'where':{'id':_0x4d6aa2[_0xcc43('0x2d')]['id']}})['then'](handleEntityNotFound(_0x27989b,null))[_0xcc43('0x27')](removeEntity(_0x27989b,null))[_0xcc43('0x3a')](handleError(_0x27989b,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 2956d20..34a49b3 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 _0xbaad=['../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0xbaad,0x10e));var _0xdbaa=function(_0x4b703c,_0x497b61){_0x4b703c=_0x4b703c-0x0;var _0x2748cb=_0xbaad[_0x4b703c];return _0x2748cb;};'use strict';var _=require(_0xdbaa('0x0'));var util=require(_0xdbaa('0x1'));var logger=require(_0xdbaa('0x2'))(_0xdbaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdbaa('0x4'));var fs=require('fs');var path=require(_0xdbaa('0x5'));var rimraf=require('rimraf');var config=require(_0xdbaa('0x6'));var attributes=require(_0xdbaa('0x7'));module[_0xdbaa('0x8')]=function(_0x4f2cef,_0x28cf18){return _0x4f2cef[_0xdbaa('0x9')](_0xdbaa('0xa'),attributes,{'tableName':_0xdbaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd833=['exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd833,0x78));var _0x3d83=function(_0x120b1e,_0x4d2bec){_0x120b1e=_0x120b1e-0x0;var _0x186859=_0xd833[_0x120b1e];return _0x186859;};'use strict';var _=require(_0x3d83('0x0'));var util=require(_0x3d83('0x1'));var logger=require(_0x3d83('0x2'))(_0x3d83('0x3'));var moment=require(_0x3d83('0x4'));var BPromise=require(_0x3d83('0x5'));var rp=require(_0x3d83('0x6'));var fs=require('fs');var path=require(_0x3d83('0x7'));var rimraf=require(_0x3d83('0x8'));var config=require('../../config/environment');var attributes=require(_0x3d83('0x9'));module[_0x3d83('0xa')]=function(_0x41703c,_0xbb10e3){return _0x41703c[_0x3d83('0xb')](_0x3d83('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 5098c63..bb5cd70 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 _0xf46b=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0xf46b,0x1a6));var _0xbf46=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xf46b[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xbf46('0x0'));var util=require(_0xbf46('0x1'));var moment=require(_0xbf46('0x2'));var BPromise=require(_0xbf46('0x3'));var rs=require(_0xbf46('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf46('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbf46('0x6'));var config=require(_0xbf46('0x7'));var jayson=require(_0xbf46('0x8'));var client=jayson[_0xbf46('0x9')][_0xbf46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fb18c,_0x3a3364,_0x2cf2fe){return new BPromise(function(_0x334af4,_0xe3ffc9){return client[_0xbf46('0xb')](_0x2fb18c,_0x2cf2fe)[_0xbf46('0xc')](function(_0x1e2df0){logger[_0xbf46('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x3a3364,_0xbf46('0xe'));logger[_0xbf46('0xf')](_0xbf46('0x10'),_0x3a3364,'request\x20sent',JSON[_0xbf46('0x11')](_0x1e2df0));if(_0x1e2df0['error']){if(_0x1e2df0['error']['code']===0x1f4){logger[_0xbf46('0x12')](_0xbf46('0x13'),_0x3a3364,_0x1e2df0[_0xbf46('0x12')]['message']);return _0xe3ffc9(_0x1e2df0['error'][_0xbf46('0x14')]);}logger[_0xbf46('0x12')](_0xbf46('0x13'),_0x3a3364,_0x1e2df0[_0xbf46('0x12')][_0xbf46('0x14')]);return _0x334af4(_0x1e2df0[_0xbf46('0x12')]['message']);}else{logger[_0xbf46('0xd')](_0xbf46('0x13'),_0x3a3364,_0xbf46('0xe'));_0x334af4(_0x1e2df0[_0xbf46('0x15')]['message']);}})[_0xbf46('0x16')](function(_0x2decc7){logger[_0xbf46('0x12')](_0xbf46('0x13'),_0x3a3364,_0x2decc7);_0xe3ffc9(_0x2decc7);});});} \ No newline at end of file +var _0x0a05=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x773c07,_0x53a96e){var _0x1b6d2c=function(_0x2d3285){while(--_0x2d3285){_0x773c07['push'](_0x773c07['shift']());}};_0x1b6d2c(++_0x53a96e);}(_0x0a05,0x111));var _0x50a0=function(_0x39db05,_0x3868d0){_0x39db05=_0x39db05-0x0;var _0x3f0e22=_0x0a05[_0x39db05];return _0x3f0e22;};'use strict';var _=require('lodash');var util=require(_0x50a0('0x0'));var moment=require(_0x50a0('0x1'));var BPromise=require(_0x50a0('0x2'));var rs=require(_0x50a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x50a0('0x4'));var logger=require(_0x50a0('0x5'))(_0x50a0('0x6'));var config=require('../../config/environment');var jayson=require(_0x50a0('0x7'));var client=jayson[_0x50a0('0x8')][_0x50a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x267177,_0x5ef1,_0x3bf485){return new BPromise(function(_0x4fc7b4,_0x2ba62f){return client[_0x50a0('0xa')](_0x267177,_0x3bf485)[_0x50a0('0xb')](function(_0x5a10e0){logger['info'](_0x50a0('0xc'),_0x5ef1,_0x50a0('0xd'));logger[_0x50a0('0xe')](_0x50a0('0xf'),_0x5ef1,_0x50a0('0xd'),JSON[_0x50a0('0x10')](_0x5a10e0));if(_0x5a10e0[_0x50a0('0x11')]){if(_0x5a10e0[_0x50a0('0x11')][_0x50a0('0x12')]===0x1f4){logger[_0x50a0('0x11')](_0x50a0('0xc'),_0x5ef1,_0x5a10e0['error'][_0x50a0('0x13')]);return _0x2ba62f(_0x5a10e0[_0x50a0('0x11')][_0x50a0('0x13')]);}logger[_0x50a0('0x11')](_0x50a0('0xc'),_0x5ef1,_0x5a10e0[_0x50a0('0x11')][_0x50a0('0x13')]);return _0x4fc7b4(_0x5a10e0['error'][_0x50a0('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x5ef1,_0x50a0('0xd'));_0x4fc7b4(_0x5a10e0[_0x50a0('0x14')][_0x50a0('0x13')]);}})[_0x50a0('0x15')](function(_0xccd986){logger[_0x50a0('0x11')](_0x50a0('0xc'),_0x5ef1,_0xccd986);_0x2ba62f(_0xccd986);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a249dc9..b3be7be 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 _0x9c5a=['/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','update'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1d1cb7,_0xc843d8){_0x1d1cb7=_0x1d1cb7-0x0;var _0x6ae952=_0x9c5a[_0x1d1cb7];return _0x6ae952;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./chatProactiveAction.controller');router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa9c5('0xb')]);router[_0xa9c5('0xc')]('/:id',auth[_0xa9c5('0x9')](),controller[_0xa9c5('0xd')]);router['delete'](_0xa9c5('0xe'),auth[_0xa9c5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x3ead1a,_0x570237){var _0x1ac663=function(_0x91de28){while(--_0x91de28){_0x3ead1a['push'](_0x3ead1a['shift']());}};_0x1ac663(++_0x570237);}(_0x33c5,0xe6));var _0x533c=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x33c5[_0x5ec454];return _0x5ebf50;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 7363486..f0dbcf2 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 _0x8ffb=['exports','STRING','name','rrmemory','beepall'];(function(_0x3adfbc,_0x58ebce){var _0x4c00c0=function(_0x5c074a){while(--_0x5c074a){_0x3adfbc['push'](_0x3adfbc['shift']());}};_0x4c00c0(++_0x58ebce);}(_0x8ffb,0xaa));var _0xb8ff=function(_0x2f0a2c,_0x2bf165){_0x2f0a2c=_0x2f0a2c-0x0;var _0x59fd81=_0x8ffb[_0x2f0a2c];return _0x59fd81;};'use strict';var Sequelize=require('sequelize');module[_0xb8ff('0x0')]={'name':{'type':Sequelize[_0xb8ff('0x1')],'unique':_0xb8ff('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb8ff('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb8ff('0x3'),_0xb8ff('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x6db3=['roundrobin','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x31cc24,_0x3a667b){var _0x10a356=function(_0x558b06){while(--_0x558b06){_0x31cc24['push'](_0x31cc24['shift']());}};_0x10a356(++_0x3a667b);}(_0x6db3,0x10b));var _0x36db=function(_0x11dda5,_0x441064){_0x11dda5=_0x11dda5-0x0;var _0x4175e8=_0x6db3[_0x11dda5];return _0x4175e8;};'use strict';var Sequelize=require('sequelize');module[_0x36db('0x0')]={'name':{'type':Sequelize[_0x36db('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x36db('0x1')]},'timeout':{'type':Sequelize[_0x36db('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x36db('0x3')](_0x36db('0x4'),_0x36db('0x5'),_0x36db('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index d6a2d10..e16fb05 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 _0x6ca0=['reject','save','update','get','UserProfileResource','destroy','name','send','index','ChatQueue','rawAttributes','type','key','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','include','findAll','rows','show','params','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','body','find','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','UserId','agent','chatPause','updatedAt','%s/%s','SIP','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','field','from','team_has_chat_queues','join','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','isArray','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0xeb80c9,_0x3fe888){var _0x259c37=function(_0x49478c){while(--_0x49478c){_0xeb80c9['push'](_0xeb80c9['shift']());}};_0x259c37(++_0x3fe888);}(_0x6ca0,0x196));var _0x06ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ca0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x06ca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06ca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06ca('0x2'));var moment=require(_0x06ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x06ca('0x4'));var util=require(_0x06ca('0x5'));var path=require(_0x06ca('0x6'));var sox=require(_0x06ca('0x7'));var csv=require(_0x06ca('0x8'));var ejs=require(_0x06ca('0x9'));var fs=require('fs');var fs_extra=require(_0x06ca('0xa'));var _=require(_0x06ca('0xb'));var squel=require(_0x06ca('0xc'));var crypto=require(_0x06ca('0xd'));var jsforce=require(_0x06ca('0xe'));var deskjs=require(_0x06ca('0xf'));var toCsv=require(_0x06ca('0x8'));var querystring=require(_0x06ca('0x10'));var Papa=require(_0x06ca('0x11'));var Redis=require(_0x06ca('0x12'));var authService=require(_0x06ca('0x13'));var qs=require(_0x06ca('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ca('0x15'));var logger=require(_0x06ca('0x16'))(_0x06ca('0x17'));var utils=require(_0x06ca('0x18'));var config=require(_0x06ca('0x19'));var licenseUtil=require(_0x06ca('0x1a'));var db=require(_0x06ca('0x1b'))['db'];config[_0x06ca('0x1c')]=_[_0x06ca('0x1d')](config[_0x06ca('0x1c')],{'host':_0x06ca('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x06ca('0x1c')]));require(_0x06ca('0x1f'))[_0x06ca('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x06ca('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x445927,_0x550a72,_0x15e741,_0x2c5f58){return new BPromise(function(_0x2eda77,_0x39e8cb){var _0xff56dc=_0x2c5f58||client;return _0xff56dc[_0x06ca('0x22')](_0x445927,_0x15e741)[_0x06ca('0x23')](function(_0x172111){logger['info'](_0x06ca('0x24'),_0x550a72,_0x06ca('0x25'));logger['debug'](_0x06ca('0x26'),_0x550a72,_0x06ca('0x25'),JSON[_0x06ca('0x27')](_0x172111));if(_0x172111[_0x06ca('0x28')]){if(_0x172111[_0x06ca('0x28')][_0x06ca('0x29')]===0x1f4){logger['error'](_0x06ca('0x24'),_0x550a72,_0x172111[_0x06ca('0x28')][_0x06ca('0x2a')]);return _0x39e8cb(_0x172111[_0x06ca('0x28')][_0x06ca('0x2a')]);}logger['error'](_0x06ca('0x24'),_0x550a72,_0x172111['error'][_0x06ca('0x2a')]);return _0x2eda77(_0x172111[_0x06ca('0x28')][_0x06ca('0x2a')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x550a72,'request\x20sent');_0x2eda77(_0x172111[_0x06ca('0x2b')]['message']);}})[_0x06ca('0x2c')](function(_0x36ae5c){logger['error'](_0x06ca('0x24'),_0x550a72,_0x36ae5c);_0x39e8cb(_0x36ae5c);});});}function respondWithStatusCode(_0x18cc79,_0x564e9e){_0x564e9e=_0x564e9e||0xcc;return function(_0x5e0457){if(_0x5e0457){return _0x18cc79[_0x06ca('0x2d')](_0x564e9e);}return _0x18cc79[_0x06ca('0x2e')](_0x564e9e)[_0x06ca('0x2f')]();};}function respondWithResult(_0x2364cd,_0x43c1c4){_0x43c1c4=_0x43c1c4||0xc8;return function(_0xcd30cb){if(_0xcd30cb){return _0x2364cd['status'](_0x43c1c4)['json'](_0xcd30cb);}};}function respondWithFilteredResult(_0x1ce69a,_0x3eb08f){return function(_0x1b72c3){if(_0x1b72c3){var _0x48fe59=typeof _0x3eb08f[_0x06ca('0x30')]===_0x06ca('0x31')&&typeof _0x3eb08f[_0x06ca('0x32')]===_0x06ca('0x31');var _0xeb61b4=_0x1b72c3[_0x06ca('0x33')];var _0x46ca8b=_0x48fe59?0x0:_0x3eb08f[_0x06ca('0x30')];var _0x2614bf=_0x48fe59?_0x1b72c3[_0x06ca('0x33')]:_0x3eb08f[_0x06ca('0x30')]+_0x3eb08f['limit'];var _0x45db07;if(_0x2614bf>=_0xeb61b4){_0x2614bf=_0xeb61b4;_0x45db07=0xc8;}else{_0x45db07=0xce;}_0x1ce69a[_0x06ca('0x2e')](_0x45db07);return _0x1ce69a[_0x06ca('0x34')](_0x06ca('0x35'),_0x46ca8b+'-'+_0x2614bf+'/'+_0xeb61b4)[_0x06ca('0x36')](_0x1b72c3);}return null;};}function patchUpdates(_0x2a65e7){return function(_0x484b0c){try{jsonpatch[_0x06ca('0x37')](_0x484b0c,_0x2a65e7,!![]);}catch(_0x144cfe){return BPromise[_0x06ca('0x38')](_0x144cfe);}return _0x484b0c[_0x06ca('0x39')]();};}function saveUpdates(_0x38dcf3,_0xf02335){return function(_0xbf01ab){if(_0xbf01ab){return _0xbf01ab[_0x06ca('0x3a')](_0x38dcf3)[_0x06ca('0x23')](function(_0x4d7c44){return _0x4d7c44;});}return null;};}function removeEntity(_0x18fd09,_0xb1b6a){return function(_0x20f3bb){if(_0x20f3bb){return _0x20f3bb['destroy']()[_0x06ca('0x23')](function(){var _0x7e9174=_0x20f3bb[_0x06ca('0x3b')]({'plain':!![]});var _0x515fc1='ChatQueues';return db[_0x06ca('0x3c')][_0x06ca('0x3d')]({'where':{'type':_0x515fc1,'resourceId':_0x7e9174['id']}})['then'](function(){return _0x20f3bb;});})[_0x06ca('0x23')](function(){_0x18fd09['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x312d09,_0x11d8be){return function(_0x5bebbc){if(!_0x5bebbc){_0x312d09[_0x06ca('0x2d')](0x194);}return _0x5bebbc;};}function handleError(_0x4a1dad,_0x59dd6d){_0x59dd6d=_0x59dd6d||0x1f4;return function(_0x1d8cfd){logger[_0x06ca('0x28')](_0x1d8cfd['stack']);if(_0x1d8cfd[_0x06ca('0x3e')]){delete _0x1d8cfd[_0x06ca('0x3e')];}_0x4a1dad[_0x06ca('0x2e')](_0x59dd6d)[_0x06ca('0x3f')](_0x1d8cfd);};}exports[_0x06ca('0x40')]=function(_0x466e46,_0x145378){var _0x16c2c1={},_0x5da2f7={},_0x3864d2={'count':0x0,'rows':[]};var _0x2861d5=_['map'](db[_0x06ca('0x41')][_0x06ca('0x42')],function(_0x589dc9){return{'name':_0x589dc9['fieldName'],'type':_0x589dc9[_0x06ca('0x43')][_0x06ca('0x44')]};});_0x5da2f7['model']=_[_0x06ca('0x45')](_0x2861d5,_0x06ca('0x3e'));_0x5da2f7[_0x06ca('0x46')]=_[_0x06ca('0x47')](_0x466e46[_0x06ca('0x46')]);_0x5da2f7[_0x06ca('0x48')]=_['intersection'](_0x5da2f7['model'],_0x5da2f7[_0x06ca('0x46')]);_0x16c2c1[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x5da2f7[_0x06ca('0x4b')],qs[_0x06ca('0x4c')](_0x466e46[_0x06ca('0x46')]['fields']));_0x16c2c1[_0x06ca('0x49')]=_0x16c2c1['attributes'][_0x06ca('0x4d')]?_0x16c2c1['attributes']:_0x5da2f7['model'];if(!_0x466e46[_0x06ca('0x46')][_0x06ca('0x4e')](_0x06ca('0x4f'))){_0x16c2c1['limit']=qs[_0x06ca('0x32')](_0x466e46[_0x06ca('0x46')][_0x06ca('0x32')]);_0x16c2c1[_0x06ca('0x30')]=qs[_0x06ca('0x30')](_0x466e46[_0x06ca('0x46')][_0x06ca('0x30')]);}_0x16c2c1[_0x06ca('0x50')]=qs[_0x06ca('0x51')](_0x466e46[_0x06ca('0x46')][_0x06ca('0x51')]);_0x16c2c1['where']=qs[_0x06ca('0x48')](_[_0x06ca('0x52')](_0x466e46[_0x06ca('0x46')],_0x5da2f7[_0x06ca('0x48')]),_0x2861d5);if(_0x466e46[_0x06ca('0x46')][_0x06ca('0x53')]){_0x16c2c1[_0x06ca('0x54')]=_['merge'](_0x16c2c1[_0x06ca('0x54')],{'$or':_[_0x06ca('0x45')](_0x2861d5,function(_0x5a9a93){if(_0x5a9a93[_0x06ca('0x43')]!==_0x06ca('0x55')){var _0x4e19a8={};_0x4e19a8[_0x5a9a93[_0x06ca('0x3e')]]={'$like':'%'+_0x466e46['query'][_0x06ca('0x53')]+'%'};return _0x4e19a8;}})});}_0x16c2c1=_['merge']({},_0x16c2c1,_0x466e46[_0x06ca('0x56')]);var _0x57f5c2={'where':_0x16c2c1['where']};return db[_0x06ca('0x41')][_0x06ca('0x33')](_0x57f5c2)[_0x06ca('0x23')](function(_0x4472a3){_0x3864d2[_0x06ca('0x33')]=_0x4472a3;if(_0x466e46[_0x06ca('0x46')]['includeAll']){_0x16c2c1[_0x06ca('0x57')]=[{'all':!![]}];}return db[_0x06ca('0x41')][_0x06ca('0x58')](_0x16c2c1);})['then'](function(_0x38cb95){_0x3864d2[_0x06ca('0x59')]=_0x38cb95;return _0x3864d2;})[_0x06ca('0x23')](respondWithFilteredResult(_0x145378,_0x16c2c1))[_0x06ca('0x2c')](handleError(_0x145378,null));};exports[_0x06ca('0x5a')]=function(_0x24a0cc,_0xedcb4c){var _0x115223={'raw':!![],'where':{'id':_0x24a0cc[_0x06ca('0x5b')]['id']}},_0x5b7dc1={};_0x5b7dc1[_0x06ca('0x4b')]=_[_0x06ca('0x47')](db['ChatQueue'][_0x06ca('0x42')]);_0x5b7dc1[_0x06ca('0x46')]=_[_0x06ca('0x47')](_0x24a0cc[_0x06ca('0x46')]);_0x5b7dc1[_0x06ca('0x48')]=_[_0x06ca('0x4a')](_0x5b7dc1['model'],_0x5b7dc1[_0x06ca('0x46')]);_0x115223[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x5b7dc1[_0x06ca('0x4b')],qs[_0x06ca('0x4c')](_0x24a0cc['query']['fields']));_0x115223['attributes']=_0x115223['attributes'][_0x06ca('0x4d')]?_0x115223[_0x06ca('0x49')]:_0x5b7dc1[_0x06ca('0x4b')];if(_0x24a0cc[_0x06ca('0x46')]['includeAll']){_0x115223['include']=[{'all':!![]}];}_0x115223=_[_0x06ca('0x5c')]({},_0x115223,_0x24a0cc[_0x06ca('0x56')]);return db['ChatQueue']['find'](_0x115223)[_0x06ca('0x23')](handleEntityNotFound(_0xedcb4c,null))['then'](respondWithResult(_0xedcb4c,null))['catch'](handleError(_0xedcb4c,null));};exports[_0x06ca('0x5d')]=function(_0xf8fb94,_0x422d02){return db[_0x06ca('0x41')]['create'](_0xf8fb94['body'],{})[_0x06ca('0x23')](function(_0x1bf11e){var _0x37e683=_0xf8fb94[_0x06ca('0x5e')][_0x06ca('0x3b')]({'plain':!![]});if(!_0x37e683)throw new Error(_0x06ca('0x5f'));if(_0x37e683['role']==='user'){var _0x39e245=_0x1bf11e[_0x06ca('0x3b')]({'plain':!![]});var _0xb156df=_0x06ca('0x60');return db[_0x06ca('0x61')]['find']({'where':{'name':_0xb156df,'userProfileId':_0x37e683[_0x06ca('0x62')]},'raw':!![]})[_0x06ca('0x23')](function(_0x58670e){if(_0x58670e&&_0x58670e[_0x06ca('0x63')]===0x0){return db[_0x06ca('0x3c')][_0x06ca('0x5d')]({'name':_0x39e245[_0x06ca('0x3e')],'resourceId':_0x39e245['id'],'type':_0x58670e[_0x06ca('0x3e')],'sectionId':_0x58670e['id']},{})[_0x06ca('0x23')](function(){return _0x1bf11e;});}else{return _0x1bf11e;}})[_0x06ca('0x2c')](function(_0x5fe32a){logger[_0x06ca('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5fe32a);throw _0x5fe32a;});}return _0x1bf11e;})['then'](respondWithResult(_0x422d02,0xc9))['catch'](handleError(_0x422d02,null));};exports['update']=function(_0x383ab4,_0x4be602){if(_0x383ab4['body']['id']){delete _0x383ab4[_0x06ca('0x64')]['id'];}return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x383ab4[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x4be602,null))['then'](saveUpdates(_0x383ab4[_0x06ca('0x64')],null))[_0x06ca('0x23')](respondWithResult(_0x4be602,null))['catch'](handleError(_0x4be602,null));};exports[_0x06ca('0x3d')]=function(_0x1a838b,_0x1f2a9e){return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x1a838b[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x1f2a9e,null))['then'](removeEntity(_0x1f2a9e,null))[_0x06ca('0x2c')](handleError(_0x1f2a9e,null));};exports[_0x06ca('0x66')]=function(_0x38861d,_0x4270ba){return db[_0x06ca('0x41')][_0x06ca('0x66')]()[_0x06ca('0x23')](respondWithResult(_0x4270ba,null))[_0x06ca('0x2c')](handleError(_0x4270ba,null));};exports[_0x06ca('0x67')]=function(_0x4edb7e,_0x3a35e4,_0x446af6){var _0x1658b9={'raw':!![],'where':{}},_0x2ce4d4={},_0x3ee6f6;return db[_0x06ca('0x41')][_0x06ca('0x68')]({'where':{'id':_0x4edb7e[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x3a35e4,null))[_0x06ca('0x23')](function(_0x306e41){if(_0x306e41){_0x3ee6f6=_0x306e41[_0x06ca('0x3b')]({'plain':!![]});_0x2ce4d4[_0x06ca('0x4b')]=_[_0x06ca('0x47')](db[_0x06ca('0x69')][_0x06ca('0x42')]);_0x2ce4d4[_0x06ca('0x46')]=_[_0x06ca('0x47')](_0x4edb7e[_0x06ca('0x46')]);_0x2ce4d4[_0x06ca('0x48')]=_[_0x06ca('0x4a')](_0x2ce4d4[_0x06ca('0x4b')],_0x2ce4d4[_0x06ca('0x46')]);_0x1658b9[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x2ce4d4[_0x06ca('0x4b')],qs['fields'](_0x4edb7e[_0x06ca('0x46')][_0x06ca('0x4c')]));_0x1658b9[_0x06ca('0x49')]=_0x1658b9[_0x06ca('0x49')][_0x06ca('0x4d')]?_0x1658b9[_0x06ca('0x49')]:_0x2ce4d4[_0x06ca('0x4b')];if(!_0x4edb7e['query'][_0x06ca('0x4e')](_0x06ca('0x4f'))){_0x1658b9[_0x06ca('0x32')]=qs[_0x06ca('0x32')](_0x4edb7e[_0x06ca('0x46')]['limit']);_0x1658b9[_0x06ca('0x30')]=qs[_0x06ca('0x30')](_0x4edb7e[_0x06ca('0x46')]['offset']);}_0x1658b9[_0x06ca('0x50')]=qs['sort'](_0x4edb7e[_0x06ca('0x46')][_0x06ca('0x51')]);_0x1658b9[_0x06ca('0x54')]=qs[_0x06ca('0x48')](_[_0x06ca('0x52')](_0x4edb7e['query'],_0x2ce4d4[_0x06ca('0x48')]));_0x1658b9[_0x06ca('0x54')][_0x06ca('0x6a')]=_0x306e41['id'];if(_0x4edb7e[_0x06ca('0x46')][_0x06ca('0x53')]){_0x1658b9[_0x06ca('0x54')]=_['merge'](_0x1658b9[_0x06ca('0x54')],{'$or':_['map'](_0x1658b9[_0x06ca('0x49')],function(_0x284556){var _0x224dee={};_0x224dee[_0x284556]={'$like':'%'+_0x4edb7e[_0x06ca('0x46')]['filter']+'%'};return _0x224dee;})});}_0x1658b9=_[_0x06ca('0x5c')]({},_0x1658b9,_0x4edb7e[_0x06ca('0x56')]);return db['UserChatQueue'][_0x06ca('0x58')](_0x1658b9);}})[_0x06ca('0x23')](function(_0x475637){if(_0x475637){return db[_0x06ca('0x6b')]['findAndCountAll']({'where':{'id':_[_0x06ca('0x45')](_0x475637,_0x06ca('0x6c')),'role':_0x06ca('0x6d')},'attributes':['id',_0x06ca('0x3e'),_0x06ca('0x6e'),_0x06ca('0x6f'),'createdAt']});}})[_0x06ca('0x23')](function(_0x82d7ef){if(_0x82d7ef){return{'count':_0x82d7ef[_0x06ca('0x33')],'rows':_[_0x06ca('0x45')](_0x82d7ef[_0x06ca('0x59')],function(_0x48c5dd){return{'membername':_0x48c5dd[_0x06ca('0x3e')],'UserId':_0x48c5dd['id'],'queue_name':_0x3ee6f6[_0x06ca('0x3e')],'ChatQueueId':_0x3ee6f6['id'],'interface':util['format'](_0x06ca('0x70'),_0x06ca('0x71'),_0x48c5dd[_0x06ca('0x3e')]),'penalty':0x0,'paused':_0x48c5dd[_0x06ca('0x6e')],'createdAt':_0x48c5dd['createdAt'],'updatedAt':_0x48c5dd[_0x06ca('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x06ca('0x23')](respondWithFilteredResult(_0x3a35e4,_0x1658b9))[_0x06ca('0x2c')](handleError(_0x3a35e4,null));};exports[_0x06ca('0x72')]=function(_0x1b3276,_0x3cfcf3,_0xc10df3){var _0x50d989={};var _0x27e0d9={};var _0xa7ec99;var _0x59e3cf;return db[_0x06ca('0x41')][_0x06ca('0x68')]({'where':{'id':_0x1b3276[_0x06ca('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3cfcf3,null))[_0x06ca('0x23')](function(_0x3746e2){if(_0x3746e2){_0xa7ec99=_0x3746e2;_0x27e0d9[_0x06ca('0x4b')]=_[_0x06ca('0x47')](db['Team'][_0x06ca('0x42')]);_0x27e0d9['query']=_['keys'](_0x1b3276[_0x06ca('0x46')]);_0x27e0d9[_0x06ca('0x48')]=_[_0x06ca('0x4a')](_0x27e0d9[_0x06ca('0x4b')],_0x27e0d9[_0x06ca('0x46')]);_0x50d989[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x27e0d9[_0x06ca('0x4b')],qs[_0x06ca('0x4c')](_0x1b3276[_0x06ca('0x46')][_0x06ca('0x4c')]));_0x50d989['attributes']=_0x50d989[_0x06ca('0x49')][_0x06ca('0x4d')]?_0x50d989[_0x06ca('0x49')]:_0x27e0d9[_0x06ca('0x4b')];_0x50d989[_0x06ca('0x50')]=qs['sort'](_0x1b3276[_0x06ca('0x46')][_0x06ca('0x51')]);_0x50d989[_0x06ca('0x54')]=qs['filters'](_[_0x06ca('0x52')](_0x1b3276[_0x06ca('0x46')],_0x27e0d9[_0x06ca('0x48')]));if(_0x1b3276[_0x06ca('0x46')][_0x06ca('0x53')]){_0x50d989[_0x06ca('0x54')]=_['merge'](_0x50d989[_0x06ca('0x54')],{'$or':_[_0x06ca('0x45')](_0x50d989['attributes'],function(_0x126f3c){var _0x3a8b38={};_0x3a8b38[_0x126f3c]={'$like':'%'+_0x1b3276['query'][_0x06ca('0x53')]+'%'};return _0x3a8b38;})});}_0x50d989=_[_0x06ca('0x5c')]({},_0x50d989,_0x1b3276[_0x06ca('0x56')]);return _0xa7ec99['getTeams'](_0x50d989);}})[_0x06ca('0x23')](function(_0x23f647){if(_0x23f647){_0x59e3cf=_0x23f647['length'];if(!_0x1b3276[_0x06ca('0x46')][_0x06ca('0x4e')](_0x06ca('0x4f'))){_0x50d989[_0x06ca('0x32')]=qs[_0x06ca('0x32')](_0x1b3276[_0x06ca('0x46')]['limit']);_0x50d989['offset']=qs[_0x06ca('0x30')](_0x1b3276[_0x06ca('0x46')][_0x06ca('0x30')]);}return _0xa7ec99[_0x06ca('0x72')](_0x50d989);}})['then'](function(_0x223556){if(_0x223556){return _0x223556?{'count':_0x59e3cf,'rows':_0x223556}:null;}})[_0x06ca('0x23')](respondWithResult(_0x3cfcf3,null))[_0x06ca('0x2c')](handleError(_0x3cfcf3,null));};exports['addTeams']=function(_0x198e78,_0x119e10,_0x5294b2){var _0x4cb36d=_0x198e78[_0x06ca('0x64')][_0x06ca('0x73')];return db[_0x06ca('0x74')][_0x06ca('0x58')]({'where':{'id':_0x4cb36d},'attributes':['id'],'include':[{'model':db[_0x06ca('0x6b')],'as':_0x06ca('0x75'),'attributes':['id',_0x06ca('0x3e'),_0x06ca('0x76'),_0x06ca('0x77'),_0x06ca('0x78')],'raw':!![]}]})[_0x06ca('0x23')](function(_0x33b45a){if(_0x33b45a){var _0x2398b4=_[_0x06ca('0x79')](_0x33b45a,function(_0x227c6f){var _0x6872d6=_0x227c6f['get']({'plain':!![]});return _0x6872d6[_0x06ca('0x75')];});return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x198e78[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](function(_0xdd52bd){return db[_0x06ca('0x7a')][_0x06ca('0x7b')](function(_0x4fb3a8){return _0xdd52bd[_0x06ca('0x7c')](_0x4cb36d,{'transaction':_0x4fb3a8})[_0x06ca('0x23')](function(){return BPromise[_0x06ca('0x7d')](_0x2398b4,function(_0x4273c8){return db[_0x06ca('0x69')][_0x06ca('0x7e')]({'where':{'UserId':_0x4273c8['id'],'ChatQueueId':_0x198e78[_0x06ca('0x5b')]['id']},'transaction':_0x4fb3a8});});})[_0x06ca('0x23')](function(){_0x2398b4[_0x06ca('0x7f')](function(_0x519b18){socket[_0x06ca('0x80')]('userChatQueue:save',{'UserId':_0x519b18['id'],'ChatQueueId':_0xdd52bd['id']});});});});});}})['then'](respondWithStatusCode(_0x119e10,null))[_0x06ca('0x2c')](handleError(_0x119e10,null));};exports['removeTeams']=function(_0x184bfb,_0x1d5927,_0x22fbf4){return db[_0x06ca('0x74')][_0x06ca('0x58')]({'where':{'id':_0x184bfb['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x06ca('0x6b')],'as':_0x06ca('0x75'),'attributes':['id'],'raw':!![]}]})[_0x06ca('0x23')](handleEntityNotFound(_0x1d5927,null))[_0x06ca('0x23')](function(_0x335271){var _0x115f14=_['map'](_0x335271,'id');var _0x5861e8=[];var _0x317396=[];var _0x2774cb=squel[_0x06ca('0x81')]();_0x2774cb[_0x06ca('0x82')]('tq.TeamId')[_0x06ca('0x83')](_0x06ca('0x84'),'tq')[_0x06ca('0x85')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x06ca('0x54')]('ChatQueueId\x20=\x20?',_0x184bfb[_0x06ca('0x5b')]['id']);for(var _0x13b68b=0x0;_0x13b68b<_0x335271[_0x06ca('0x4d')];_0x13b68b+=0x1){let _0x32d488=_0x335271[_0x13b68b];for(var _0x52f77d=0x0;_0x52f77d<_0x32d488[_0x06ca('0x75')][_0x06ca('0x4d')];_0x52f77d+=0x1){let _0x20883d=_0x32d488[_0x06ca('0x75')][_0x52f77d];var _0x1631e3=_0x2774cb[_0x06ca('0x86')]();_0x1631e3[_0x06ca('0x54')](_0x06ca('0x87'),_0x20883d['id']);_0x317396[_0x06ca('0x88')](db[_0x06ca('0x7a')][_0x06ca('0x46')](_0x1631e3[_0x06ca('0x89')](),{'type':db[_0x06ca('0x7a')][_0x06ca('0x8a')]['SELECT']})[_0x06ca('0x23')](function(_0x8239e){if(_0x8239e[_0x06ca('0x4d')]===0x1){return _0x20883d['id'];}else{var _0x5336d4=_['every'](_[_0x06ca('0x45')](_0x8239e,_0x06ca('0x8b')),function(_0x51d4e3){return _[_0x06ca('0x8c')](_0x115f14,_0x51d4e3);});if(_0x5336d4){return _0x20883d['id'];}}}));}}return BPromise[_0x06ca('0x8d')](_0x317396)[_0x06ca('0x23')](function(_0x4c68d4){_0x5861e8=_(_0x5861e8)[_0x06ca('0x8e')](_0x4c68d4)[_0x06ca('0x8f')]()[_0x06ca('0x90')]();return db[_0x06ca('0x41')]['find']({'where':{'id':_0x184bfb['params']['id']}})['then'](function(_0x44cbc8){return db[_0x06ca('0x7a')][_0x06ca('0x7b')](function(_0x35d2ef){return _0x44cbc8[_0x06ca('0x91')](_0x184bfb['query'][_0x06ca('0x73')],{'transaction':_0x35d2ef})[_0x06ca('0x23')](function(){if(!_[_0x06ca('0x92')](_0x5861e8)){return _0x44cbc8[_0x06ca('0x93')](_0x5861e8,{'transaction':_0x35d2ef});}})[_0x06ca('0x23')](function(){_0x5861e8[_0x06ca('0x7f')](function(_0x2361c1){socket[_0x06ca('0x80')](_0x06ca('0x94'),{'UserId':_0x2361c1,'ChatQueueId':_0x44cbc8['id']});});});});});});})[_0x06ca('0x23')](respondWithStatusCode(_0x1d5927,null))[_0x06ca('0x2c')](handleError(_0x1d5927,null));};exports[_0x06ca('0x95')]=function(_0x4989a1,_0x5ed8b0,_0x5234e3){return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x4989a1['params']['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x5ed8b0,null))[_0x06ca('0x23')](function(_0x460546){if(_0x460546){return _0x460546['addAgents'](_0x4989a1['body'][_0x06ca('0x73')],_['omit'](_0x4989a1[_0x06ca('0x64')],[_0x06ca('0x73'),'id'])||{})[_0x06ca('0x96')](function(_0x1ce30b){for(var _0x306216=0x0;_0x306216<_0x4989a1[_0x06ca('0x64')]['ids'][_0x06ca('0x4d')];_0x306216+=0x1){socket[_0x06ca('0x80')](_0x06ca('0x97'),{'UserId':Number(_0x4989a1[_0x06ca('0x64')][_0x06ca('0x73')][_0x306216]),'ChatQueueId':Number(_0x4989a1[_0x06ca('0x5b')]['id'])});}return _0x1ce30b;});}})['then'](respondWithResult(_0x5ed8b0,null))[_0x06ca('0x2c')](handleError(_0x5ed8b0,null));};exports[_0x06ca('0x93')]=function(_0x4fa2db,_0x24063a,_0xf6b1a8){return db[_0x06ca('0x41')][_0x06ca('0x65')]({'where':{'id':_0x4fa2db[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x24063a,null))[_0x06ca('0x23')](function(_0x46c819){if(_0x46c819){return _0x46c819['removeAgents'](_0x4fa2db['query'][_0x06ca('0x73')])[_0x06ca('0x23')](function(){if(_[_0x06ca('0x98')](_0x4fa2db[_0x06ca('0x46')][_0x06ca('0x73')])){for(var _0x52c6d9=0x0;_0x52c6d9<_0x4fa2db[_0x06ca('0x46')]['ids']['length'];_0x52c6d9+=0x1){socket['emit'](_0x06ca('0x94'),{'UserId':Number(_0x4fa2db['query'][_0x06ca('0x73')][_0x52c6d9]),'ChatQueueId':Number(_0x4fa2db['params']['id'])});}}else{socket[_0x06ca('0x80')](_0x06ca('0x94'),{'UserId':Number(_0x4fa2db[_0x06ca('0x46')][_0x06ca('0x73')]),'ChatQueueId':Number(_0x4fa2db[_0x06ca('0x5b')]['id'])});}});}})[_0x06ca('0x23')](respondWithStatusCode(_0x24063a,null))[_0x06ca('0x2c')](handleError(_0x24063a,null));};exports[_0x06ca('0x99')]=function(_0x30bedf,_0x5a2041,_0x584d2a){var _0x105f35={};var _0x4066b5={};var _0x17652b;var _0x50fa7d;return db[_0x06ca('0x41')][_0x06ca('0x68')]({'where':{'id':_0x30bedf[_0x06ca('0x5b')]['id']}})[_0x06ca('0x23')](handleEntityNotFound(_0x5a2041,null))[_0x06ca('0x23')](function(_0x4bc827){if(_0x4bc827){_0x17652b=_0x4bc827;_0x4066b5[_0x06ca('0x4b')]=_[_0x06ca('0x47')](db['User']['rawAttributes']);_0x4066b5['query']=_['keys'](_0x30bedf[_0x06ca('0x46')]);_0x4066b5['filters']=_['intersection'](_0x4066b5[_0x06ca('0x4b')],_0x4066b5['query']);_0x105f35[_0x06ca('0x49')]=_[_0x06ca('0x4a')](_0x4066b5[_0x06ca('0x4b')],qs[_0x06ca('0x4c')](_0x30bedf[_0x06ca('0x46')]['fields']));_0x105f35['attributes']=_0x105f35[_0x06ca('0x49')][_0x06ca('0x4d')]?_0x105f35[_0x06ca('0x49')]:_0x4066b5[_0x06ca('0x4b')];_0x105f35[_0x06ca('0x50')]=qs[_0x06ca('0x51')](_0x30bedf[_0x06ca('0x46')][_0x06ca('0x51')]);_0x105f35['where']=qs[_0x06ca('0x48')](_[_0x06ca('0x52')](_0x30bedf[_0x06ca('0x46')],_0x4066b5[_0x06ca('0x48')]));if(_0x30bedf[_0x06ca('0x46')][_0x06ca('0x53')]){_0x105f35['where']=_[_0x06ca('0x5c')](_0x105f35[_0x06ca('0x54')],{'$or':_['map'](_0x105f35[_0x06ca('0x49')],function(_0x19f122){var _0x1fc9e4={};_0x1fc9e4[_0x19f122]={'$like':'%'+_0x30bedf[_0x06ca('0x46')][_0x06ca('0x53')]+'%'};return _0x1fc9e4;})});}_0x105f35=_[_0x06ca('0x5c')]({},_0x105f35,_0x30bedf[_0x06ca('0x56')]);return _0x17652b[_0x06ca('0x99')](_0x105f35);}})[_0x06ca('0x23')](function(_0x3cc991){if(_0x3cc991){_0x50fa7d=_0x3cc991['length'];if(!_0x30bedf[_0x06ca('0x46')][_0x06ca('0x4e')](_0x06ca('0x4f'))){_0x105f35[_0x06ca('0x32')]=qs['limit'](_0x30bedf[_0x06ca('0x46')][_0x06ca('0x32')]);_0x105f35['offset']=qs[_0x06ca('0x30')](_0x30bedf[_0x06ca('0x46')][_0x06ca('0x30')]);}return _0x17652b[_0x06ca('0x99')](_0x105f35);}})['then'](function(_0x706efb){if(_0x706efb){return _0x706efb?{'count':_0x50fa7d,'rows':_0x706efb}:null;}})[_0x06ca('0x23')](respondWithResult(_0x5a2041,null))[_0x06ca('0x2c')](handleError(_0x5a2041,null));}; \ No newline at end of file +var _0xb6f3=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','client','http','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','offset','set','apply','reject','save','destroy','ChatQueues','send','index','ChatQueue','key','model','map','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','show','params','rawAttributes','include','create','body','user','get','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','length','nolimit','ChatQueueId','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','ids','Team','User','interface','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','all','union','value','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x250aea,_0xfdf9c0){var _0xaa4139=function(_0x2d1c58){while(--_0x2d1c58){_0x250aea['push'](_0x250aea['shift']());}};_0xaa4139(++_0xfdf9c0);}(_0xb6f3,0x12a));var _0x3b6f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb6f3[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x3b6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b6f('0x1'));var jsonpatch=require(_0x3b6f('0x2'));var rp=require(_0x3b6f('0x3'));var moment=require(_0x3b6f('0x4'));var BPromise=require(_0x3b6f('0x5'));var Mustache=require(_0x3b6f('0x6'));var util=require(_0x3b6f('0x7'));var path=require(_0x3b6f('0x8'));var sox=require('sox');var csv=require(_0x3b6f('0x9'));var ejs=require(_0x3b6f('0xa'));var fs=require('fs');var fs_extra=require(_0x3b6f('0xb'));var _=require(_0x3b6f('0xc'));var squel=require(_0x3b6f('0xd'));var crypto=require(_0x3b6f('0xe'));var jsforce=require(_0x3b6f('0xf'));var deskjs=require(_0x3b6f('0x10'));var toCsv=require(_0x3b6f('0x9'));var querystring=require('querystring');var Papa=require(_0x3b6f('0x11'));var Redis=require(_0x3b6f('0x12'));var authService=require(_0x3b6f('0x13'));var qs=require(_0x3b6f('0x14'));var as=require(_0x3b6f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b6f('0x16'))(_0x3b6f('0x17'));var utils=require(_0x3b6f('0x18'));var config=require(_0x3b6f('0x19'));var licenseUtil=require(_0x3b6f('0x1a'));var db=require(_0x3b6f('0x1b'))['db'];config[_0x3b6f('0x1c')]=_[_0x3b6f('0x1d')](config[_0x3b6f('0x1c')],{'host':_0x3b6f('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b6f('0x1c')]));require(_0x3b6f('0x1f'))['register'](socket);var jayson=require(_0x3b6f('0x20'));var client=jayson[_0x3b6f('0x21')][_0x3b6f('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x34626a,_0xa2a93e,_0x5b4b03,_0x2e4e3c){return new BPromise(function(_0x36494e,_0x418143){var _0x56c206=_0x2e4e3c||client;return _0x56c206[_0x3b6f('0x23')](_0x34626a,_0x5b4b03)[_0x3b6f('0x24')](function(_0x7feceb){logger[_0x3b6f('0x25')]('ChatQueue,\x20%s,\x20%s',_0xa2a93e,_0x3b6f('0x26'));logger['debug'](_0x3b6f('0x27'),_0xa2a93e,_0x3b6f('0x26'),JSON[_0x3b6f('0x28')](_0x7feceb));if(_0x7feceb['error']){if(_0x7feceb[_0x3b6f('0x29')]['code']===0x1f4){logger[_0x3b6f('0x29')](_0x3b6f('0x2a'),_0xa2a93e,_0x7feceb[_0x3b6f('0x29')][_0x3b6f('0x2b')]);return _0x418143(_0x7feceb[_0x3b6f('0x29')]['message']);}logger['error'](_0x3b6f('0x2a'),_0xa2a93e,_0x7feceb[_0x3b6f('0x29')][_0x3b6f('0x2b')]);return _0x36494e(_0x7feceb[_0x3b6f('0x29')][_0x3b6f('0x2b')]);}else{logger['info'](_0x3b6f('0x2a'),_0xa2a93e,_0x3b6f('0x26'));_0x36494e(_0x7feceb[_0x3b6f('0x2c')][_0x3b6f('0x2b')]);}})[_0x3b6f('0x2d')](function(_0x2437f2){logger[_0x3b6f('0x29')](_0x3b6f('0x2a'),_0xa2a93e,_0x2437f2);_0x418143(_0x2437f2);});});}function respondWithStatusCode(_0x5ca62e,_0x4a6cce){_0x4a6cce=_0x4a6cce||0xcc;return function(_0x518fad){if(_0x518fad){return _0x5ca62e[_0x3b6f('0x2e')](_0x4a6cce);}return _0x5ca62e[_0x3b6f('0x2f')](_0x4a6cce)[_0x3b6f('0x30')]();};}function respondWithResult(_0xf8b00,_0x5187f1){_0x5187f1=_0x5187f1||0xc8;return function(_0x6ffa1a){if(_0x6ffa1a){return _0xf8b00[_0x3b6f('0x2f')](_0x5187f1)[_0x3b6f('0x31')](_0x6ffa1a);}};}function respondWithFilteredResult(_0x1282e3,_0x3bfc33){return function(_0x4568bd){if(_0x4568bd){var _0x2a43e5=typeof _0x3bfc33['offset']==='undefined'&&typeof _0x3bfc33[_0x3b6f('0x32')]==='undefined';var _0x4956f2=_0x4568bd['count'];var _0x7edb19=_0x2a43e5?0x0:_0x3bfc33['offset'];var _0x260a16=_0x2a43e5?_0x4568bd['count']:_0x3bfc33[_0x3b6f('0x33')]+_0x3bfc33[_0x3b6f('0x32')];var _0x16d5a1;if(_0x260a16>=_0x4956f2){_0x260a16=_0x4956f2;_0x16d5a1=0xc8;}else{_0x16d5a1=0xce;}_0x1282e3[_0x3b6f('0x2f')](_0x16d5a1);return _0x1282e3[_0x3b6f('0x34')]('Content-Range',_0x7edb19+'-'+_0x260a16+'/'+_0x4956f2)[_0x3b6f('0x31')](_0x4568bd);}return null;};}function patchUpdates(_0x40d2f0){return function(_0x583cee){try{jsonpatch[_0x3b6f('0x35')](_0x583cee,_0x40d2f0,!![]);}catch(_0x5aa65a){return BPromise[_0x3b6f('0x36')](_0x5aa65a);}return _0x583cee[_0x3b6f('0x37')]();};}function saveUpdates(_0x58d1b3,_0x56c97d){return function(_0x549f74){if(_0x549f74){return _0x549f74['update'](_0x58d1b3)[_0x3b6f('0x24')](function(_0x3ed038){return _0x3ed038;});}return null;};}function removeEntity(_0x8686f1,_0x553e0a){return function(_0x55bc28){if(_0x55bc28){return _0x55bc28[_0x3b6f('0x38')]()['then'](function(){var _0xc3c31c=_0x55bc28['get']({'plain':!![]});var _0x1bac97=_0x3b6f('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x1bac97,'resourceId':_0xc3c31c['id']}})[_0x3b6f('0x24')](function(){return _0x55bc28;});})[_0x3b6f('0x24')](function(){_0x8686f1[_0x3b6f('0x2f')](0xcc)[_0x3b6f('0x30')]();});}};}function handleEntityNotFound(_0x17c988,_0x3aca6e){return function(_0x5e6124){if(!_0x5e6124){_0x17c988['sendStatus'](0x194);}return _0x5e6124;};}function handleError(_0x1f6a88,_0x302d86){_0x302d86=_0x302d86||0x1f4;return function(_0xb906ba){logger['error'](_0xb906ba['stack']);if(_0xb906ba['name']){delete _0xb906ba['name'];}_0x1f6a88[_0x3b6f('0x2f')](_0x302d86)[_0x3b6f('0x3a')](_0xb906ba);};}exports[_0x3b6f('0x3b')]=function(_0x58785d,_0x24d1e5){var _0x5cab1b={},_0x3c51ef={},_0x58aa99={'count':0x0,'rows':[]};var _0x3dfa34=_['map'](db[_0x3b6f('0x3c')]['rawAttributes'],function(_0x279662){return{'name':_0x279662['fieldName'],'type':_0x279662['type'][_0x3b6f('0x3d')]};});_0x3c51ef[_0x3b6f('0x3e')]=_[_0x3b6f('0x3f')](_0x3dfa34,_0x3b6f('0x40'));_0x3c51ef[_0x3b6f('0x41')]=_[_0x3b6f('0x42')](_0x58785d['query']);_0x3c51ef[_0x3b6f('0x43')]=_[_0x3b6f('0x44')](_0x3c51ef[_0x3b6f('0x3e')],_0x3c51ef[_0x3b6f('0x41')]);_0x5cab1b[_0x3b6f('0x45')]=_['intersection'](_0x3c51ef[_0x3b6f('0x3e')],qs[_0x3b6f('0x46')](_0x58785d[_0x3b6f('0x41')][_0x3b6f('0x46')]));_0x5cab1b['attributes']=_0x5cab1b['attributes']['length']?_0x5cab1b[_0x3b6f('0x45')]:_0x3c51ef[_0x3b6f('0x3e')];if(!_0x58785d['query'][_0x3b6f('0x47')]('nolimit')){_0x5cab1b['limit']=qs[_0x3b6f('0x32')](_0x58785d[_0x3b6f('0x41')][_0x3b6f('0x32')]);_0x5cab1b[_0x3b6f('0x33')]=qs[_0x3b6f('0x33')](_0x58785d[_0x3b6f('0x41')][_0x3b6f('0x33')]);}_0x5cab1b[_0x3b6f('0x48')]=qs['sort'](_0x58785d['query'][_0x3b6f('0x49')]);_0x5cab1b[_0x3b6f('0x4a')]=qs[_0x3b6f('0x43')](_[_0x3b6f('0x4b')](_0x58785d[_0x3b6f('0x41')],_0x3c51ef[_0x3b6f('0x43')]),_0x3dfa34);if(_0x58785d['query'][_0x3b6f('0x4c')]){_0x5cab1b[_0x3b6f('0x4a')]=_[_0x3b6f('0x4d')](_0x5cab1b[_0x3b6f('0x4a')],{'$or':_[_0x3b6f('0x3f')](_0x3dfa34,function(_0x227b26){if(_0x227b26[_0x3b6f('0x4e')]!==_0x3b6f('0x4f')){var _0x24c1ff={};_0x24c1ff[_0x227b26[_0x3b6f('0x40')]]={'$like':'%'+_0x58785d[_0x3b6f('0x41')][_0x3b6f('0x4c')]+'%'};return _0x24c1ff;}})});}_0x5cab1b=_[_0x3b6f('0x4d')]({},_0x5cab1b,_0x58785d[_0x3b6f('0x50')]);var _0x1ceb5b={'where':_0x5cab1b[_0x3b6f('0x4a')]};return db[_0x3b6f('0x3c')][_0x3b6f('0x51')](_0x1ceb5b)[_0x3b6f('0x24')](function(_0x400575){_0x58aa99[_0x3b6f('0x51')]=_0x400575;if(_0x58785d[_0x3b6f('0x41')][_0x3b6f('0x52')]){_0x5cab1b['include']=[{'all':!![]}];}return db[_0x3b6f('0x3c')][_0x3b6f('0x53')](_0x5cab1b);})[_0x3b6f('0x24')](function(_0x443810){_0x58aa99[_0x3b6f('0x54')]=_0x443810;return _0x58aa99;})[_0x3b6f('0x24')](respondWithFilteredResult(_0x24d1e5,_0x5cab1b))[_0x3b6f('0x2d')](handleError(_0x24d1e5,null));};exports[_0x3b6f('0x55')]=function(_0xe68a31,_0x25606c){var _0x47e811={'raw':!![],'where':{'id':_0xe68a31[_0x3b6f('0x56')]['id']}},_0x5d8e9d={};_0x5d8e9d[_0x3b6f('0x3e')]=_[_0x3b6f('0x42')](db[_0x3b6f('0x3c')][_0x3b6f('0x57')]);_0x5d8e9d[_0x3b6f('0x41')]=_['keys'](_0xe68a31[_0x3b6f('0x41')]);_0x5d8e9d['filters']=_['intersection'](_0x5d8e9d[_0x3b6f('0x3e')],_0x5d8e9d[_0x3b6f('0x41')]);_0x47e811['attributes']=_[_0x3b6f('0x44')](_0x5d8e9d[_0x3b6f('0x3e')],qs[_0x3b6f('0x46')](_0xe68a31[_0x3b6f('0x41')][_0x3b6f('0x46')]));_0x47e811['attributes']=_0x47e811[_0x3b6f('0x45')]['length']?_0x47e811['attributes']:_0x5d8e9d[_0x3b6f('0x3e')];if(_0xe68a31[_0x3b6f('0x41')][_0x3b6f('0x52')]){_0x47e811[_0x3b6f('0x58')]=[{'all':!![]}];}_0x47e811=_[_0x3b6f('0x4d')]({},_0x47e811,_0xe68a31[_0x3b6f('0x50')]);return db[_0x3b6f('0x3c')]['find'](_0x47e811)['then'](handleEntityNotFound(_0x25606c,null))[_0x3b6f('0x24')](respondWithResult(_0x25606c,null))[_0x3b6f('0x2d')](handleError(_0x25606c,null));};exports['create']=function(_0x47d127,_0x40b325){return db[_0x3b6f('0x3c')][_0x3b6f('0x59')](_0x47d127[_0x3b6f('0x5a')],{})[_0x3b6f('0x24')](function(_0x473817){var _0x564637=_0x47d127[_0x3b6f('0x5b')]['get']({'plain':!![]});if(!_0x564637)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x564637['role']===_0x3b6f('0x5b')){var _0x565af9=_0x473817[_0x3b6f('0x5c')]({'plain':!![]});var _0x3affef=_0x3b6f('0x39');return db[_0x3b6f('0x5d')][_0x3b6f('0x5e')]({'where':{'name':_0x3affef,'userProfileId':_0x564637['userProfileId']},'raw':!![]})[_0x3b6f('0x24')](function(_0x35fe9d){if(_0x35fe9d&&_0x35fe9d[_0x3b6f('0x5f')]===0x0){return db['UserProfileResource'][_0x3b6f('0x59')]({'name':_0x565af9[_0x3b6f('0x40')],'resourceId':_0x565af9['id'],'type':_0x35fe9d[_0x3b6f('0x40')],'sectionId':_0x35fe9d['id']},{})[_0x3b6f('0x24')](function(){return _0x473817;});}else{return _0x473817;}})[_0x3b6f('0x2d')](function(_0x13e233){logger['error'](_0x3b6f('0x60'),_0x13e233);throw _0x13e233;});}return _0x473817;})['then'](respondWithResult(_0x40b325,0xc9))[_0x3b6f('0x2d')](handleError(_0x40b325,null));};exports['update']=function(_0x3f62e2,_0x47e2e0){if(_0x3f62e2['body']['id']){delete _0x3f62e2['body']['id'];}return db[_0x3b6f('0x3c')][_0x3b6f('0x5e')]({'where':{'id':_0x3f62e2[_0x3b6f('0x56')]['id']}})['then'](handleEntityNotFound(_0x47e2e0,null))[_0x3b6f('0x24')](saveUpdates(_0x3f62e2[_0x3b6f('0x5a')],null))[_0x3b6f('0x24')](respondWithResult(_0x47e2e0,null))[_0x3b6f('0x2d')](handleError(_0x47e2e0,null));};exports['destroy']=function(_0x194995,_0x57cd72){return db[_0x3b6f('0x3c')][_0x3b6f('0x5e')]({'where':{'id':_0x194995[_0x3b6f('0x56')]['id']}})[_0x3b6f('0x24')](handleEntityNotFound(_0x57cd72,null))[_0x3b6f('0x24')](removeEntity(_0x57cd72,null))[_0x3b6f('0x2d')](handleError(_0x57cd72,null));};exports[_0x3b6f('0x61')]=function(_0x13f568,_0x235032){return db[_0x3b6f('0x3c')][_0x3b6f('0x61')]()['then'](respondWithResult(_0x235032,null))[_0x3b6f('0x2d')](handleError(_0x235032,null));};exports[_0x3b6f('0x62')]=function(_0x398154,_0x16a406,_0x2787d3){var _0x272975={'raw':!![],'where':{}},_0x5776c5={},_0x1bf5ab;return db[_0x3b6f('0x3c')][_0x3b6f('0x63')]({'where':{'id':_0x398154[_0x3b6f('0x56')]['id']}})[_0x3b6f('0x24')](handleEntityNotFound(_0x16a406,null))[_0x3b6f('0x24')](function(_0x2c70e8){if(_0x2c70e8){_0x1bf5ab=_0x2c70e8[_0x3b6f('0x5c')]({'plain':!![]});_0x5776c5[_0x3b6f('0x3e')]=_[_0x3b6f('0x42')](db[_0x3b6f('0x64')][_0x3b6f('0x57')]);_0x5776c5['query']=_['keys'](_0x398154['query']);_0x5776c5['filters']=_[_0x3b6f('0x44')](_0x5776c5[_0x3b6f('0x3e')],_0x5776c5[_0x3b6f('0x41')]);_0x272975[_0x3b6f('0x45')]=_['intersection'](_0x5776c5[_0x3b6f('0x3e')],qs[_0x3b6f('0x46')](_0x398154[_0x3b6f('0x41')][_0x3b6f('0x46')]));_0x272975[_0x3b6f('0x45')]=_0x272975['attributes'][_0x3b6f('0x65')]?_0x272975[_0x3b6f('0x45')]:_0x5776c5[_0x3b6f('0x3e')];if(!_0x398154['query'][_0x3b6f('0x47')](_0x3b6f('0x66'))){_0x272975['limit']=qs[_0x3b6f('0x32')](_0x398154[_0x3b6f('0x41')][_0x3b6f('0x32')]);_0x272975['offset']=qs[_0x3b6f('0x33')](_0x398154[_0x3b6f('0x41')][_0x3b6f('0x33')]);}_0x272975[_0x3b6f('0x48')]=qs['sort'](_0x398154['query']['sort']);_0x272975['where']=qs[_0x3b6f('0x43')](_['pick'](_0x398154['query'],_0x5776c5[_0x3b6f('0x43')]));_0x272975[_0x3b6f('0x4a')][_0x3b6f('0x67')]=_0x2c70e8['id'];if(_0x398154['query']['filter']){_0x272975[_0x3b6f('0x4a')]=_[_0x3b6f('0x4d')](_0x272975[_0x3b6f('0x4a')],{'$or':_[_0x3b6f('0x3f')](_0x272975[_0x3b6f('0x45')],function(_0x2aa427){var _0x5a2e46={};_0x5a2e46[_0x2aa427]={'$like':'%'+_0x398154[_0x3b6f('0x41')][_0x3b6f('0x4c')]+'%'};return _0x5a2e46;})});}_0x272975=_[_0x3b6f('0x4d')]({},_0x272975,_0x398154['options']);return db['UserChatQueue']['findAll'](_0x272975);}})[_0x3b6f('0x24')](function(_0x37c9e8){if(_0x37c9e8){return db['User'][_0x3b6f('0x68')]({'where':{'id':_[_0x3b6f('0x3f')](_0x37c9e8,_0x3b6f('0x69')),'role':'agent'},'attributes':['id',_0x3b6f('0x40'),_0x3b6f('0x6a'),_0x3b6f('0x6b'),_0x3b6f('0x6c')]});}})['then'](function(_0x3b9785){if(_0x3b9785){return{'count':_0x3b9785[_0x3b6f('0x51')],'rows':_['map'](_0x3b9785[_0x3b6f('0x54')],function(_0x2fb9d2){return{'membername':_0x2fb9d2[_0x3b6f('0x40')],'UserId':_0x2fb9d2['id'],'queue_name':_0x1bf5ab[_0x3b6f('0x40')],'ChatQueueId':_0x1bf5ab['id'],'interface':util[_0x3b6f('0x6d')](_0x3b6f('0x6e'),_0x3b6f('0x6f'),_0x2fb9d2[_0x3b6f('0x40')]),'penalty':0x0,'paused':_0x2fb9d2[_0x3b6f('0x6a')],'createdAt':_0x2fb9d2[_0x3b6f('0x6c')],'updatedAt':_0x2fb9d2[_0x3b6f('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3b6f('0x24')](respondWithFilteredResult(_0x16a406,_0x272975))[_0x3b6f('0x2d')](handleError(_0x16a406,null));};exports[_0x3b6f('0x70')]=function(_0x323bde,_0x55952b,_0x3654c6){var _0x5bbfad={};var _0x451239={};var _0x22cdc3;var _0x560660;return db['ChatQueue'][_0x3b6f('0x63')]({'where':{'id':_0x323bde['params']['id']}})[_0x3b6f('0x24')](handleEntityNotFound(_0x55952b,null))[_0x3b6f('0x24')](function(_0x5610f8){if(_0x5610f8){_0x22cdc3=_0x5610f8;_0x451239['model']=_['keys'](db['Team'][_0x3b6f('0x57')]);_0x451239[_0x3b6f('0x41')]=_[_0x3b6f('0x42')](_0x323bde[_0x3b6f('0x41')]);_0x451239[_0x3b6f('0x43')]=_[_0x3b6f('0x44')](_0x451239[_0x3b6f('0x3e')],_0x451239[_0x3b6f('0x41')]);_0x5bbfad[_0x3b6f('0x45')]=_[_0x3b6f('0x44')](_0x451239[_0x3b6f('0x3e')],qs[_0x3b6f('0x46')](_0x323bde[_0x3b6f('0x41')][_0x3b6f('0x46')]));_0x5bbfad[_0x3b6f('0x45')]=_0x5bbfad[_0x3b6f('0x45')][_0x3b6f('0x65')]?_0x5bbfad[_0x3b6f('0x45')]:_0x451239[_0x3b6f('0x3e')];_0x5bbfad[_0x3b6f('0x48')]=qs['sort'](_0x323bde['query'][_0x3b6f('0x49')]);_0x5bbfad[_0x3b6f('0x4a')]=qs[_0x3b6f('0x43')](_[_0x3b6f('0x4b')](_0x323bde['query'],_0x451239[_0x3b6f('0x43')]));if(_0x323bde[_0x3b6f('0x41')][_0x3b6f('0x4c')]){_0x5bbfad[_0x3b6f('0x4a')]=_[_0x3b6f('0x4d')](_0x5bbfad[_0x3b6f('0x4a')],{'$or':_[_0x3b6f('0x3f')](_0x5bbfad['attributes'],function(_0x4863ff){var _0xa4e39={};_0xa4e39[_0x4863ff]={'$like':'%'+_0x323bde[_0x3b6f('0x41')][_0x3b6f('0x4c')]+'%'};return _0xa4e39;})});}_0x5bbfad=_['merge']({},_0x5bbfad,_0x323bde['options']);return _0x22cdc3[_0x3b6f('0x70')](_0x5bbfad);}})[_0x3b6f('0x24')](function(_0x3616c5){if(_0x3616c5){_0x560660=_0x3616c5[_0x3b6f('0x65')];if(!_0x323bde[_0x3b6f('0x41')]['hasOwnProperty'](_0x3b6f('0x66'))){_0x5bbfad[_0x3b6f('0x32')]=qs[_0x3b6f('0x32')](_0x323bde['query']['limit']);_0x5bbfad[_0x3b6f('0x33')]=qs[_0x3b6f('0x33')](_0x323bde[_0x3b6f('0x41')][_0x3b6f('0x33')]);}return _0x22cdc3['getTeams'](_0x5bbfad);}})[_0x3b6f('0x24')](function(_0x4cd086){if(_0x4cd086){return _0x4cd086?{'count':_0x560660,'rows':_0x4cd086}:null;}})[_0x3b6f('0x24')](respondWithResult(_0x55952b,null))['catch'](handleError(_0x55952b,null));};exports['addTeams']=function(_0x4e7583,_0x3351be,_0x32da99){var _0x5377d4=_0x4e7583[_0x3b6f('0x5a')][_0x3b6f('0x71')];return db[_0x3b6f('0x72')][_0x3b6f('0x53')]({'where':{'id':_0x5377d4},'attributes':['id'],'include':[{'model':db[_0x3b6f('0x73')],'as':'Agents','attributes':['id','name','online','voicePause',_0x3b6f('0x74')],'raw':!![]}]})[_0x3b6f('0x24')](function(_0x4900b4){if(_0x4900b4){var _0x1f4a25=_[_0x3b6f('0x75')](_0x4900b4,function(_0x1b446b){var _0x42fd50=_0x1b446b[_0x3b6f('0x5c')]({'plain':!![]});return _0x42fd50['Agents'];});return db[_0x3b6f('0x3c')][_0x3b6f('0x5e')]({'where':{'id':_0x4e7583[_0x3b6f('0x56')]['id']}})[_0x3b6f('0x24')](function(_0x2cabd8){return db['sequelize'][_0x3b6f('0x76')](function(_0x2310da){return _0x2cabd8[_0x3b6f('0x77')](_0x5377d4,{'transaction':_0x2310da})['then'](function(){return BPromise['each'](_0x1f4a25,function(_0x1438d1){return db[_0x3b6f('0x64')][_0x3b6f('0x78')]({'where':{'UserId':_0x1438d1['id'],'ChatQueueId':_0x4e7583[_0x3b6f('0x56')]['id']},'transaction':_0x2310da});});})[_0x3b6f('0x24')](function(){_0x1f4a25[_0x3b6f('0x79')](function(_0x47ce68){socket[_0x3b6f('0x7a')](_0x3b6f('0x7b'),{'UserId':_0x47ce68['id'],'ChatQueueId':_0x2cabd8['id']});});});});});}})[_0x3b6f('0x24')](respondWithStatusCode(_0x3351be,null))[_0x3b6f('0x2d')](handleError(_0x3351be,null));};exports[_0x3b6f('0x7c')]=function(_0x68336,_0x560e28,_0x5b923a){return db[_0x3b6f('0x72')][_0x3b6f('0x53')]({'where':{'id':_0x68336[_0x3b6f('0x41')][_0x3b6f('0x71')]},'attributes':['id'],'include':[{'model':db[_0x3b6f('0x73')],'as':_0x3b6f('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x3b6f('0x24')](handleEntityNotFound(_0x560e28,null))[_0x3b6f('0x24')](function(_0xb2ca32){var _0x19bbbb=_[_0x3b6f('0x3f')](_0xb2ca32,'id');var _0x3cec7a=[];var _0x3b7db9=[];var _0x13893b=squel[_0x3b6f('0x7e')]();_0x13893b[_0x3b6f('0x7f')](_0x3b6f('0x80'))[_0x3b6f('0x81')](_0x3b6f('0x82'),'tq')[_0x3b6f('0x83')](_0x3b6f('0x84'),'ut',_0x3b6f('0x85'))[_0x3b6f('0x4a')](_0x3b6f('0x86'),_0x68336[_0x3b6f('0x56')]['id']);for(var _0x3af1e1=0x0;_0x3af1e1<_0xb2ca32[_0x3b6f('0x65')];_0x3af1e1+=0x1){let _0x1e9402=_0xb2ca32[_0x3af1e1];for(var _0xbadac3=0x0;_0xbadac3<_0x1e9402[_0x3b6f('0x7d')][_0x3b6f('0x65')];_0xbadac3+=0x1){let _0x1720cc=_0x1e9402[_0x3b6f('0x7d')][_0xbadac3];var _0x4f0d80=_0x13893b[_0x3b6f('0x87')]();_0x4f0d80[_0x3b6f('0x4a')](_0x3b6f('0x88'),_0x1720cc['id']);_0x3b7db9[_0x3b6f('0x89')](db[_0x3b6f('0x8a')][_0x3b6f('0x41')](_0x4f0d80['toString'](),{'type':db[_0x3b6f('0x8a')][_0x3b6f('0x8b')][_0x3b6f('0x8c')]})[_0x3b6f('0x24')](function(_0x4a61bf){if(_0x4a61bf[_0x3b6f('0x65')]===0x1){return _0x1720cc['id'];}else{var _0x3c5d8b=_['every'](_[_0x3b6f('0x3f')](_0x4a61bf,_0x3b6f('0x8d')),function(_0x1c2452){return _['includes'](_0x19bbbb,_0x1c2452);});if(_0x3c5d8b){return _0x1720cc['id'];}}}));}}return BPromise[_0x3b6f('0x8e')](_0x3b7db9)['then'](function(_0x11cc47){_0x3cec7a=_(_0x3cec7a)[_0x3b6f('0x8f')](_0x11cc47)['compact']()[_0x3b6f('0x90')]();return db['ChatQueue'][_0x3b6f('0x5e')]({'where':{'id':_0x68336[_0x3b6f('0x56')]['id']}})['then'](function(_0x18a584){return db[_0x3b6f('0x8a')][_0x3b6f('0x76')](function(_0x2f7fef){return _0x18a584['removeTeams'](_0x68336['query'][_0x3b6f('0x71')],{'transaction':_0x2f7fef})[_0x3b6f('0x24')](function(){if(!_['isEmpty'](_0x3cec7a)){return _0x18a584[_0x3b6f('0x91')](_0x3cec7a,{'transaction':_0x2f7fef});}})['then'](function(){_0x3cec7a[_0x3b6f('0x79')](function(_0x1a20ba){socket[_0x3b6f('0x7a')](_0x3b6f('0x92'),{'UserId':_0x1a20ba,'ChatQueueId':_0x18a584['id']});});});});});});})[_0x3b6f('0x24')](respondWithStatusCode(_0x560e28,null))[_0x3b6f('0x2d')](handleError(_0x560e28,null));};exports[_0x3b6f('0x93')]=function(_0x2419b3,_0x469f00,_0x15c6ea){return db[_0x3b6f('0x3c')][_0x3b6f('0x5e')]({'where':{'id':_0x2419b3[_0x3b6f('0x56')]['id']}})[_0x3b6f('0x24')](handleEntityNotFound(_0x469f00,null))[_0x3b6f('0x24')](function(_0x8ae194){if(_0x8ae194){return _0x8ae194[_0x3b6f('0x93')](_0x2419b3[_0x3b6f('0x5a')][_0x3b6f('0x71')],_[_0x3b6f('0x94')](_0x2419b3[_0x3b6f('0x5a')],['ids','id'])||{})['spread'](function(_0x477784){for(var _0x55aadd=0x0;_0x55aadd<_0x2419b3[_0x3b6f('0x5a')]['ids'][_0x3b6f('0x65')];_0x55aadd+=0x1){socket['emit'](_0x3b6f('0x7b'),{'UserId':Number(_0x2419b3['body'][_0x3b6f('0x71')][_0x55aadd]),'ChatQueueId':Number(_0x2419b3['params']['id'])});}return _0x477784;});}})[_0x3b6f('0x24')](respondWithResult(_0x469f00,null))[_0x3b6f('0x2d')](handleError(_0x469f00,null));};exports[_0x3b6f('0x91')]=function(_0x3b4f45,_0x45e2b6,_0x4f0c91){return db['ChatQueue'][_0x3b6f('0x5e')]({'where':{'id':_0x3b4f45[_0x3b6f('0x56')]['id']}})['then'](handleEntityNotFound(_0x45e2b6,null))[_0x3b6f('0x24')](function(_0x1cad71){if(_0x1cad71){return _0x1cad71['removeAgents'](_0x3b4f45[_0x3b6f('0x41')][_0x3b6f('0x71')])[_0x3b6f('0x24')](function(){if(_[_0x3b6f('0x95')](_0x3b4f45[_0x3b6f('0x41')][_0x3b6f('0x71')])){for(var _0x129e54=0x0;_0x129e54<_0x3b4f45['query'][_0x3b6f('0x71')][_0x3b6f('0x65')];_0x129e54+=0x1){socket[_0x3b6f('0x7a')](_0x3b6f('0x92'),{'UserId':Number(_0x3b4f45[_0x3b6f('0x41')][_0x3b6f('0x71')][_0x129e54]),'ChatQueueId':Number(_0x3b4f45[_0x3b6f('0x56')]['id'])});}}else{socket[_0x3b6f('0x7a')](_0x3b6f('0x92'),{'UserId':Number(_0x3b4f45[_0x3b6f('0x41')][_0x3b6f('0x71')]),'ChatQueueId':Number(_0x3b4f45[_0x3b6f('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x45e2b6,null))[_0x3b6f('0x2d')](handleError(_0x45e2b6,null));};exports[_0x3b6f('0x96')]=function(_0x45a538,_0x4c18e5,_0x2f6700){var _0x4c2501={};var _0x5ead66={};var _0x11e4f3;var _0x15bd6d;return db['ChatQueue']['findOne']({'where':{'id':_0x45a538[_0x3b6f('0x56')]['id']}})[_0x3b6f('0x24')](handleEntityNotFound(_0x4c18e5,null))[_0x3b6f('0x24')](function(_0x3e625b){if(_0x3e625b){_0x11e4f3=_0x3e625b;_0x5ead66[_0x3b6f('0x3e')]=_['keys'](db[_0x3b6f('0x73')][_0x3b6f('0x57')]);_0x5ead66[_0x3b6f('0x41')]=_['keys'](_0x45a538['query']);_0x5ead66[_0x3b6f('0x43')]=_[_0x3b6f('0x44')](_0x5ead66['model'],_0x5ead66[_0x3b6f('0x41')]);_0x4c2501[_0x3b6f('0x45')]=_[_0x3b6f('0x44')](_0x5ead66[_0x3b6f('0x3e')],qs[_0x3b6f('0x46')](_0x45a538[_0x3b6f('0x41')][_0x3b6f('0x46')]));_0x4c2501['attributes']=_0x4c2501[_0x3b6f('0x45')][_0x3b6f('0x65')]?_0x4c2501['attributes']:_0x5ead66[_0x3b6f('0x3e')];_0x4c2501[_0x3b6f('0x48')]=qs[_0x3b6f('0x49')](_0x45a538['query']['sort']);_0x4c2501['where']=qs['filters'](_[_0x3b6f('0x4b')](_0x45a538['query'],_0x5ead66[_0x3b6f('0x43')]));if(_0x45a538['query'][_0x3b6f('0x4c')]){_0x4c2501[_0x3b6f('0x4a')]=_[_0x3b6f('0x4d')](_0x4c2501[_0x3b6f('0x4a')],{'$or':_[_0x3b6f('0x3f')](_0x4c2501[_0x3b6f('0x45')],function(_0x3019c1){var _0x18c72c={};_0x18c72c[_0x3019c1]={'$like':'%'+_0x45a538[_0x3b6f('0x41')][_0x3b6f('0x4c')]+'%'};return _0x18c72c;})});}_0x4c2501=_['merge']({},_0x4c2501,_0x45a538['options']);return _0x11e4f3['getAgents'](_0x4c2501);}})[_0x3b6f('0x24')](function(_0x4109d7){if(_0x4109d7){_0x15bd6d=_0x4109d7[_0x3b6f('0x65')];if(!_0x45a538['query']['hasOwnProperty'](_0x3b6f('0x66'))){_0x4c2501[_0x3b6f('0x32')]=qs[_0x3b6f('0x32')](_0x45a538[_0x3b6f('0x41')][_0x3b6f('0x32')]);_0x4c2501[_0x3b6f('0x33')]=qs[_0x3b6f('0x33')](_0x45a538['query'][_0x3b6f('0x33')]);}return _0x11e4f3[_0x3b6f('0x96')](_0x4c2501);}})[_0x3b6f('0x24')](function(_0x377b55){if(_0x377b55){return _0x377b55?{'count':_0x15bd6d,'rows':_0x377b55}:null;}})['then'](respondWithResult(_0x4c18e5,null))[_0x3b6f('0x2d')](handleError(_0x4c18e5,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 06d36fc..e67082f 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 _0x9ac8=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2cff3c,_0x33f5c5){var _0x43141c=function(_0x50236f){while(--_0x50236f){_0x2cff3c['push'](_0x2cff3c['shift']());}};_0x43141c(++_0x33f5c5);}(_0x9ac8,0x184));var _0x89ac=function(_0x344e7b,_0xfff3ce){_0x344e7b=_0x344e7b-0x0;var _0x271f43=_0x9ac8[_0x344e7b];return _0x271f43;};'use strict';var EventEmitter=require(_0x89ac('0x0'));var ChatQueue=require(_0x89ac('0x1'))['db'][_0x89ac('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x89ac('0x3'),'afterUpdate':_0x89ac('0x4'),'afterDestroy':_0x89ac('0x5')};function emitEvent(_0x32a208){return function(_0x3eb597,_0x3d0aa8,_0x494d3f){ChatQueueEvents[_0x89ac('0x6')](_0x32a208+':'+_0x3eb597['id'],_0x3eb597);ChatQueueEvents[_0x89ac('0x6')](_0x32a208,_0x3eb597);_0x494d3f(null);};}for(var e in events){if(events[_0x89ac('0x7')](e)){var event=events[e];ChatQueue[_0x89ac('0x8')](e,emitEvent(event));}}module[_0x89ac('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x154e=['exports','events','../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x154e,0xd3));var _0xe154=function(_0x28f57e,_0x260a99){_0x28f57e=_0x28f57e-0x0;var _0x5a7dcf=_0x154e[_0x28f57e];return _0x5a7dcf;};'use strict';var EventEmitter=require(_0xe154('0x0'));var ChatQueue=require(_0xe154('0x1'))['db'][_0xe154('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe154('0x3'),'afterUpdate':_0xe154('0x4'),'afterDestroy':_0xe154('0x5')};function emitEvent(_0x3c559b){return function(_0x42d4ef,_0xf4f120,_0x916585){ChatQueueEvents[_0xe154('0x6')](_0x3c559b+':'+_0x42d4ef['id'],_0x42d4ef);ChatQueueEvents[_0xe154('0x6')](_0x3c559b,_0x42d4ef);_0x916585(null);};}for(var e in events){if(events[_0xe154('0x7')](e)){var event=events[e];ChatQueue[_0xe154('0x8')](e,emitEvent(event));}}module[_0xe154('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index dcf0f5d..6baae40 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 _0x609a=['rimraf','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3494ee,_0x7b1b9a){var _0x12b115=function(_0x25e4c6){while(--_0x25e4c6){_0x3494ee['push'](_0x3494ee['shift']());}};_0x12b115(++_0x7b1b9a);}(_0x609a,0xf5));var _0xa609=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x609a[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xa609('0x0'));var logger=require(_0xa609('0x1'))(_0xa609('0x2'));var moment=require(_0xa609('0x3'));var BPromise=require(_0xa609('0x4'));var rp=require(_0xa609('0x5'));var fs=require('fs');var path=require(_0xa609('0x6'));var rimraf=require(_0xa609('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xa609('0x8')]=function(_0x9413d3,_0x27ae8a){return _0x9413d3[_0xa609('0x9')](_0xa609('0xa'),attributes,{'tableName':_0xa609('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf683=['bluebird','request-promise','path','rimraf','./chatQueue.attributes','ChatQueue','chat_queues','lodash','../../config/logger','api'];(function(_0x5c1906,_0x1fe62d){var _0x260a79=function(_0x61edce){while(--_0x61edce){_0x5c1906['push'](_0x5c1906['shift']());}};_0x260a79(++_0x1fe62d);}(_0xf683,0x9d));var _0x3f68=function(_0x276e66,_0x1b01f7){_0x276e66=_0x276e66-0x0;var _0x5597e6=_0xf683[_0x276e66];return _0x5597e6;};'use strict';var _=require(_0x3f68('0x0'));var util=require('util');var logger=require(_0x3f68('0x1'))(_0x3f68('0x2'));var moment=require('moment');var BPromise=require(_0x3f68('0x3'));var rp=require(_0x3f68('0x4'));var fs=require('fs');var path=require(_0x3f68('0x5'));var rimraf=require(_0x3f68('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f68('0x7'));module['exports']=function(_0x4e1d32,_0x1aa884){return _0x4e1d32['define'](_0x3f68('0x8'),attributes,{'tableName':_0x3f68('0x9'),'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 e8d03a4..2815ead 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 _0x7732=['stringify','ShowChatQueue','find','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes'];(function(_0x26c321,_0x228a43){var _0x516864=function(_0xcb87d2){while(--_0xcb87d2){_0x26c321['push'](_0x26c321['shift']());}};_0x516864(++_0x228a43);}(_0x7732,0x7d));var _0x2773=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0x7732[_0x2abaae];return _0x5b5745;};'use strict';var _=require(_0x2773('0x0'));var util=require(_0x2773('0x1'));var moment=require('moment');var BPromise=require(_0x2773('0x2'));var rs=require(_0x2773('0x3'));var fs=require('fs');var Redis=require(_0x2773('0x4'));var db=require(_0x2773('0x5'))['db'];var utils=require(_0x2773('0x6'));var logger=require(_0x2773('0x7'))(_0x2773('0x8'));var config=require(_0x2773('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2773('0xa')][_0x2773('0xb')]({'port':0x232a});config['redis']=_[_0x2773('0xc')](config[_0x2773('0xd')],{'host':_0x2773('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2773('0xd')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5e0464,_0x3485bf,_0x17d8cd){return new BPromise(function(_0x44ffaf,_0x2b572e){return client['request'](_0x5e0464,_0x17d8cd)['then'](function(_0x136f00){logger[_0x2773('0xf')](_0x2773('0x10'),_0x3485bf,_0x2773('0x11'));logger['debug'](_0x2773('0x12'),_0x3485bf,'request\x20sent',JSON['stringify'](_0x136f00));if(_0x136f00[_0x2773('0x13')]){if(_0x136f00[_0x2773('0x13')][_0x2773('0x14')]===0x1f4){logger[_0x2773('0x13')](_0x2773('0x10'),_0x3485bf,_0x136f00[_0x2773('0x13')][_0x2773('0x15')]);return _0x2b572e(_0x136f00[_0x2773('0x13')][_0x2773('0x15')]);}logger[_0x2773('0x13')](_0x2773('0x10'),_0x3485bf,_0x136f00[_0x2773('0x13')][_0x2773('0x15')]);return _0x44ffaf(_0x136f00['error']['message']);}else{logger[_0x2773('0xf')](_0x2773('0x10'),_0x3485bf,'request\x20sent');_0x44ffaf(_0x136f00[_0x2773('0x16')][_0x2773('0x15')]);}})[_0x2773('0x17')](function(_0x267aeb){logger[_0x2773('0x13')](_0x2773('0x10'),_0x3485bf,_0x267aeb);_0x2b572e(_0x267aeb);});});}exports[_0x2773('0x18')]=function(_0x49cd9b){var _0x434d2f=this;return new Promise(function(_0x28f6fd,_0x3a4130){return db[_0x2773('0x19')][_0x2773('0x1a')]({'raw':_0x49cd9b['options']?_0x49cd9b[_0x2773('0x1b')][_0x2773('0x1c')]===undefined?!![]:![]:!![],'where':_0x49cd9b[_0x2773('0x1b')]?_0x49cd9b['options'][_0x2773('0x1d')]||null:null,'attributes':_0x49cd9b[_0x2773('0x1b')]?_0x49cd9b[_0x2773('0x1b')]['attributes']||null:null,'limit':_0x49cd9b[_0x2773('0x1b')]?_0x49cd9b['options'][_0x2773('0x1e')]||null:null,'include':_0x49cd9b[_0x2773('0x1b')]?_0x49cd9b[_0x2773('0x1b')]['include']?_[_0x2773('0x1f')](_0x49cd9b['options'][_0x2773('0x20')],function(_0x3000c1){return{'model':db[_0x3000c1[_0x2773('0x21')]],'as':_0x3000c1['as'],'attributes':_0x3000c1['attributes'],'include':_0x3000c1[_0x2773('0x20')]?_['map'](_0x3000c1[_0x2773('0x20')],function(_0x478da4){return{'model':db[_0x478da4[_0x2773('0x21')]],'as':_0x478da4['as'],'attributes':_0x478da4[_0x2773('0x22')],'include':_0x478da4[_0x2773('0x20')]?_[_0x2773('0x1f')](_0x478da4[_0x2773('0x20')],function(_0xe02608){return{'model':db[_0xe02608['model']],'as':_0xe02608['as'],'attributes':_0xe02608['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b99f5){logger[_0x2773('0xf')](_0x2773('0x18'),_0x49cd9b);logger['debug'](_0x2773('0x18'),_0x49cd9b,JSON[_0x2773('0x23')](_0x4b99f5));_0x28f6fd(_0x4b99f5);})[_0x2773('0x17')](function(_0x5d6855){logger[_0x2773('0x13')]('GetChatQueue',_0x5d6855[_0x2773('0x15')],_0x49cd9b);_0x3a4130(_0x434d2f[_0x2773('0x13')](0x1f4,_0x5d6855['message']));});});};exports[_0x2773('0x24')]=function(_0x27e36d){var _0x1d75c4=this;return new Promise(function(_0x26a035,_0xe2a092){return db[_0x2773('0x19')][_0x2773('0x25')]({'raw':_0x27e36d['options']?_0x27e36d['options'][_0x2773('0x1c')]===undefined?!![]:![]:!![],'where':_0x27e36d[_0x2773('0x1b')]?_0x27e36d[_0x2773('0x1b')]['where']||null:null,'attributes':_0x27e36d[_0x2773('0x1b')]?_0x27e36d[_0x2773('0x1b')][_0x2773('0x22')]||null:null,'include':_0x27e36d[_0x2773('0x1b')]?_0x27e36d[_0x2773('0x1b')][_0x2773('0x20')]?_[_0x2773('0x1f')](_0x27e36d['options'][_0x2773('0x20')],function(_0x162722){return{'model':db[_0x162722['model']],'as':_0x162722['as'],'attributes':_0x162722[_0x2773('0x22')],'include':_0x162722['include']?_[_0x2773('0x1f')](_0x162722[_0x2773('0x20')],function(_0x2b375a){return{'model':db[_0x2b375a[_0x2773('0x21')]],'as':_0x2b375a['as'],'attributes':_0x2b375a['attributes'],'include':_0x2b375a[_0x2773('0x20')]?_[_0x2773('0x1f')](_0x2b375a[_0x2773('0x20')],function(_0x1cfe56){return{'model':db[_0x1cfe56[_0x2773('0x21')]],'as':_0x1cfe56['as'],'attributes':_0x1cfe56[_0x2773('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2773('0x26')](function(_0x105e8){logger[_0x2773('0xf')](_0x2773('0x24'),_0x27e36d);logger[_0x2773('0x27')]('ShowChatQueue',_0x27e36d,JSON['stringify'](_0x105e8));_0x26a035(_0x105e8);})['catch'](function(_0x2eaff1){logger[_0x2773('0x13')](_0x2773('0x24'),_0x2eaff1['message'],_0x27e36d);_0xe2a092(_0x1d75c4[_0x2773('0x13')](0x1f4,_0x2eaff1[_0x2773('0x15')]));});});}; \ No newline at end of file +var _0xc64b=['debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','./chatQueue.socket','register','request','then','info','request\x20sent'];(function(_0x27e3dc,_0x584456){var _0x1ad4d5=function(_0x5838d2){while(--_0x5838d2){_0x27e3dc['push'](_0x27e3dc['shift']());}};_0x1ad4d5(++_0x584456);}(_0xc64b,0xaf));var _0xbc64=function(_0x2f2315,_0x85c29e){_0x2f2315=_0x2f2315-0x0;var _0x574853=_0xc64b[_0x2f2315];return _0x574853;};'use strict';var _=require(_0xbc64('0x0'));var util=require(_0xbc64('0x1'));var moment=require(_0xbc64('0x2'));var BPromise=require(_0xbc64('0x3'));var rs=require(_0xbc64('0x4'));var fs=require('fs');var Redis=require(_0xbc64('0x5'));var db=require(_0xbc64('0x6'))['db'];var utils=require(_0xbc64('0x7'));var logger=require(_0xbc64('0x8'))('rpc');var config=require(_0xbc64('0x9'));var jayson=require(_0xbc64('0xa'));var client=jayson['client'][_0xbc64('0xb')]({'port':0x232a});config[_0xbc64('0xc')]=_['defaults'](config[_0xbc64('0xc')],{'host':_0xbc64('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc64('0xc')]));require(_0xbc64('0xe'))[_0xbc64('0xf')](socket);function respondWithRpcPromise(_0x399caa,_0x3a29e8,_0x382a9a){return new BPromise(function(_0x1b9869,_0x3eb25a){return client[_0xbc64('0x10')](_0x399caa,_0x382a9a)[_0xbc64('0x11')](function(_0x1777c4){logger[_0xbc64('0x12')]('ChatQueue,\x20%s,\x20%s',_0x3a29e8,_0xbc64('0x13'));logger[_0xbc64('0x14')](_0xbc64('0x15'),_0x3a29e8,_0xbc64('0x13'),JSON[_0xbc64('0x16')](_0x1777c4));if(_0x1777c4[_0xbc64('0x17')]){if(_0x1777c4[_0xbc64('0x17')][_0xbc64('0x18')]===0x1f4){logger[_0xbc64('0x17')](_0xbc64('0x19'),_0x3a29e8,_0x1777c4[_0xbc64('0x17')][_0xbc64('0x1a')]);return _0x3eb25a(_0x1777c4[_0xbc64('0x17')][_0xbc64('0x1a')]);}logger[_0xbc64('0x17')]('ChatQueue,\x20%s,\x20%s',_0x3a29e8,_0x1777c4[_0xbc64('0x17')][_0xbc64('0x1a')]);return _0x1b9869(_0x1777c4[_0xbc64('0x17')][_0xbc64('0x1a')]);}else{logger[_0xbc64('0x12')]('ChatQueue,\x20%s,\x20%s',_0x3a29e8,_0xbc64('0x13'));_0x1b9869(_0x1777c4['result']['message']);}})[_0xbc64('0x1b')](function(_0x3fa920){logger[_0xbc64('0x17')]('ChatQueue,\x20%s,\x20%s',_0x3a29e8,_0x3fa920);_0x3eb25a(_0x3fa920);});});}exports[_0xbc64('0x1c')]=function(_0x37a668){var _0x5708fd=this;return new Promise(function(_0x151ff9,_0x416546){return db[_0xbc64('0x1d')]['findAll']({'raw':_0x37a668[_0xbc64('0x1e')]?_0x37a668[_0xbc64('0x1e')][_0xbc64('0x1f')]===undefined?!![]:![]:!![],'where':_0x37a668[_0xbc64('0x1e')]?_0x37a668[_0xbc64('0x1e')][_0xbc64('0x20')]||null:null,'attributes':_0x37a668[_0xbc64('0x1e')]?_0x37a668[_0xbc64('0x1e')][_0xbc64('0x21')]||null:null,'limit':_0x37a668[_0xbc64('0x1e')]?_0x37a668[_0xbc64('0x1e')][_0xbc64('0x22')]||null:null,'include':_0x37a668[_0xbc64('0x1e')]?_0x37a668[_0xbc64('0x1e')][_0xbc64('0x23')]?_[_0xbc64('0x24')](_0x37a668[_0xbc64('0x1e')][_0xbc64('0x23')],function(_0x483b22){return{'model':db[_0x483b22[_0xbc64('0x25')]],'as':_0x483b22['as'],'attributes':_0x483b22['attributes'],'include':_0x483b22[_0xbc64('0x23')]?_[_0xbc64('0x24')](_0x483b22['include'],function(_0x44e249){return{'model':db[_0x44e249[_0xbc64('0x25')]],'as':_0x44e249['as'],'attributes':_0x44e249[_0xbc64('0x21')],'include':_0x44e249[_0xbc64('0x23')]?_[_0xbc64('0x24')](_0x44e249[_0xbc64('0x23')],function(_0x5547a3){return{'model':db[_0x5547a3[_0xbc64('0x25')]],'as':_0x5547a3['as'],'attributes':_0x5547a3['attributes']};}):[]};}):[]};}):[]:[]})[_0xbc64('0x11')](function(_0x3427a4){logger['info'](_0xbc64('0x1c'),_0x37a668);logger[_0xbc64('0x14')]('GetChatQueue',_0x37a668,JSON[_0xbc64('0x16')](_0x3427a4));_0x151ff9(_0x3427a4);})[_0xbc64('0x1b')](function(_0x19961){logger[_0xbc64('0x17')]('GetChatQueue',_0x19961[_0xbc64('0x1a')],_0x37a668);_0x416546(_0x5708fd[_0xbc64('0x17')](0x1f4,_0x19961['message']));});});};exports[_0xbc64('0x26')]=function(_0x285532){var _0x45b91f=this;return new Promise(function(_0x2b8e4d,_0x31ad4c){return db[_0xbc64('0x1d')]['find']({'raw':_0x285532['options']?_0x285532['options']['raw']===undefined?!![]:![]:!![],'where':_0x285532[_0xbc64('0x1e')]?_0x285532[_0xbc64('0x1e')][_0xbc64('0x20')]||null:null,'attributes':_0x285532['options']?_0x285532[_0xbc64('0x1e')][_0xbc64('0x21')]||null:null,'include':_0x285532[_0xbc64('0x1e')]?_0x285532[_0xbc64('0x1e')]['include']?_[_0xbc64('0x24')](_0x285532['options']['include'],function(_0x4d9265){return{'model':db[_0x4d9265['model']],'as':_0x4d9265['as'],'attributes':_0x4d9265[_0xbc64('0x21')],'include':_0x4d9265['include']?_[_0xbc64('0x24')](_0x4d9265['include'],function(_0x122e18){return{'model':db[_0x122e18[_0xbc64('0x25')]],'as':_0x122e18['as'],'attributes':_0x122e18[_0xbc64('0x21')],'include':_0x122e18[_0xbc64('0x23')]?_[_0xbc64('0x24')](_0x122e18[_0xbc64('0x23')],function(_0xe58262){return{'model':db[_0xe58262[_0xbc64('0x25')]],'as':_0xe58262['as'],'attributes':_0xe58262[_0xbc64('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbc64('0x11')](function(_0x575b6f){logger[_0xbc64('0x12')](_0xbc64('0x26'),_0x285532);logger[_0xbc64('0x14')](_0xbc64('0x26'),_0x285532,JSON[_0xbc64('0x16')](_0x575b6f));_0x2b8e4d(_0x575b6f);})[_0xbc64('0x1b')](function(_0x133089){logger['error'](_0xbc64('0x26'),_0x133089[_0xbc64('0x1a')],_0x285532);_0x31ad4c(_0x45b91f[_0xbc64('0x17')](0x1f4,_0x133089['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 364afe8..ad5a8a4 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 _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x3a8ce2,_0x552ad5){var _0x2e5a45=function(_0x5de5ed){while(--_0x5de5ed){_0x3a8ce2['push'](_0x3a8ce2['shift']());}};_0x2e5a45(++_0x552ad5);}(_0x0faf,0x132));var _0xf0fa=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x0faf[_0x36f243];return _0x426436;};'use strict';var ChatQueueEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatQueueEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}}; \ No newline at end of file +var _0x4b19=['remove','update','emit','removeListener','register','chatQueue:','./chatQueue.events'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0x4b19,0x195));var _0x94b1=function(_0x16d5d6,_0x31bd90){_0x16d5d6=_0x16d5d6-0x0;var _0x77c174=_0x4b19[_0x16d5d6];return _0x77c174;};'use strict';var ChatQueueEvents=require(_0x94b1('0x0'));var events=['save',_0x94b1('0x1'),_0x94b1('0x2')];function createListener(_0x221ab3,_0x577f52){return function(_0x1ffdb7){_0x577f52[_0x94b1('0x3')](_0x221ab3,_0x1ffdb7);};}function removeListener(_0x2240b9,_0x4f607f){return function(){ChatQueueEvents[_0x94b1('0x4')](_0x2240b9,_0x4f607f);};}exports[_0x94b1('0x5')]=function(_0x52d6c1){for(var _0x24df76=0x0,_0x110a52=events['length'];_0x24df76<_0x110a52;_0x24df76++){var _0x40c69c=events[_0x24df76];var _0x201a02=createListener(_0x94b1('0x6')+_0x40c69c,_0x52d6c1);ChatQueueEvents['on'](_0x40c69c,_0x201a02);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 6b3409b..d39ada5 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(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x5fc3[_0x4347ec];return _0x4c8314;};'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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x2d6008,_0x16e1b8){var _0x159e77=function(_0x37c765){while(--_0x37c765){_0x2d6008['push'](_0x2d6008['shift']());}};_0x159e77(++_0x16e1b8);}(_0x55ca,0x126));var _0xa55c=function(_0x171b2f,_0x337677){_0x171b2f=_0x171b2f-0x0;var _0x4678d8=_0x55ca[_0x171b2f];return _0x4678d8;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index e1cf445..b870ee9 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 _0x0260=['exports','STRING','DATE','moment','sequelize'];(function(_0x34b0c8,_0x2a007a){var _0x4778d3=function(_0x452d32){while(--_0x452d32){_0x34b0c8['push'](_0x34b0c8['shift']());}};_0x4778d3(++_0x2a007a);}(_0x0260,0x1d9));var _0x0026=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x0260[_0x4e6ae6];return _0x23c108;};'use strict';var moment=require(_0x0026('0x0'));var Sequelize=require(_0x0026('0x1'));module[_0x0026('0x2')]={'uniqueid':{'type':Sequelize[_0x0026('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0026('0x3')]},'joinAt':{'type':Sequelize[_0x0026('0x4')]},'leaveAt':{'type':Sequelize[_0x0026('0x4')]},'acceptAt':{'type':Sequelize[_0x0026('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0026('0x3')]}}; \ No newline at end of file +var _0x71ab=['sequelize','exports','STRING','DATE','moment'];(function(_0x5c7c31,_0x22aa86){var _0x193fdf=function(_0x271ade){while(--_0x271ade){_0x5c7c31['push'](_0x5c7c31['shift']());}};_0x193fdf(++_0x22aa86);}(_0x71ab,0x1df));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var moment=require(_0xb71a('0x0'));var Sequelize=require(_0xb71a('0x1'));module[_0xb71a('0x2')]={'uniqueid':{'type':Sequelize[_0xb71a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb71a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb71a('0x4')]},'acceptAt':{'type':Sequelize[_0xb71a('0x4')]},'exitAt':{'type':Sequelize[_0xb71a('0x4')]},'reason':{'type':Sequelize[_0xb71a('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 0836e5d..38d5ca3 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 _0xf954=['reject','save','update','then','sendStatus','error','stack','name','index','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','ChatQueueReport','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xf954,0x10e));var _0x4f95=function(_0x567d04,_0x3d13a1){_0x567d04=_0x567d04-0x0;var _0x58ee79=_0xf954[_0x567d04];return _0x58ee79;};'use strict';var emlformat=require(_0x4f95('0x0'));var rimraf=require(_0x4f95('0x1'));var zipdir=require(_0x4f95('0x2'));var jsonpatch=require(_0x4f95('0x3'));var rp=require(_0x4f95('0x4'));var moment=require(_0x4f95('0x5'));var BPromise=require(_0x4f95('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f95('0x7'));var sox=require(_0x4f95('0x8'));var csv=require(_0x4f95('0x9'));var ejs=require(_0x4f95('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f95('0xb'));var squel=require(_0x4f95('0xc'));var crypto=require(_0x4f95('0xd'));var jsforce=require(_0x4f95('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4f95('0xf'));var Papa=require(_0x4f95('0x10'));var Redis=require(_0x4f95('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f95('0x12'));var logger=require(_0x4f95('0x13'))(_0x4f95('0x14'));var utils=require(_0x4f95('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4f95('0x16'));var db=require(_0x4f95('0x17'))['db'];function respondWithStatusCode(_0x424457,_0x4629d9){_0x4629d9=_0x4629d9||0xcc;return function(_0xefe2a2){if(_0xefe2a2){return _0x424457['sendStatus'](_0x4629d9);}return _0x424457[_0x4f95('0x18')](_0x4629d9)[_0x4f95('0x19')]();};}function respondWithResult(_0x39a456,_0x125249){_0x125249=_0x125249||0xc8;return function(_0x56d995){if(_0x56d995){return _0x39a456[_0x4f95('0x18')](_0x125249)[_0x4f95('0x1a')](_0x56d995);}};}function respondWithFilteredResult(_0x234adf,_0x57bbcd){return function(_0xfd3673){if(_0xfd3673){var _0x451dc2=typeof _0x57bbcd[_0x4f95('0x1b')]===_0x4f95('0x1c')&&typeof _0x57bbcd[_0x4f95('0x1d')]===_0x4f95('0x1c');var _0x2aa444=_0xfd3673[_0x4f95('0x1e')];var _0x235c03=_0x451dc2?0x0:_0x57bbcd[_0x4f95('0x1b')];var _0x5918ad=_0x451dc2?_0xfd3673[_0x4f95('0x1e')]:_0x57bbcd[_0x4f95('0x1b')]+_0x57bbcd[_0x4f95('0x1d')];var _0x2d2595;if(_0x5918ad>=_0x2aa444){_0x5918ad=_0x2aa444;_0x2d2595=0xc8;}else{_0x2d2595=0xce;}_0x234adf[_0x4f95('0x18')](_0x2d2595);return _0x234adf[_0x4f95('0x1f')](_0x4f95('0x20'),_0x235c03+'-'+_0x5918ad+'/'+_0x2aa444)[_0x4f95('0x1a')](_0xfd3673);}return null;};}function patchUpdates(_0xc449b4){return function(_0x50d3b0){try{jsonpatch[_0x4f95('0x21')](_0x50d3b0,_0xc449b4,!![]);}catch(_0xf70461){return BPromise[_0x4f95('0x22')](_0xf70461);}return _0x50d3b0[_0x4f95('0x23')]();};}function saveUpdates(_0x131436,_0xe47cd7){return function(_0xe49db2){if(_0xe49db2){return _0xe49db2[_0x4f95('0x24')](_0x131436)[_0x4f95('0x25')](function(_0x10cab5){return _0x10cab5;});}return null;};}function removeEntity(_0x21e3eb,_0x27a229){return function(_0x1e675c){if(_0x1e675c){return _0x1e675c['destroy']()[_0x4f95('0x25')](function(){_0x21e3eb[_0x4f95('0x18')](0xcc)[_0x4f95('0x19')]();});}};}function handleEntityNotFound(_0x34a4de,_0x3875fe){return function(_0x14ba9f){if(!_0x14ba9f){_0x34a4de[_0x4f95('0x26')](0x194);}return _0x14ba9f;};}function handleError(_0x49677d,_0x2154c4){_0x2154c4=_0x2154c4||0x1f4;return function(_0x50996d){logger[_0x4f95('0x27')](_0x50996d[_0x4f95('0x28')]);if(_0x50996d[_0x4f95('0x29')]){delete _0x50996d[_0x4f95('0x29')];}_0x49677d[_0x4f95('0x18')](_0x2154c4)['send'](_0x50996d);};}exports[_0x4f95('0x2a')]=function(_0x2dc278,_0x1cdd1b){var _0x6ff6c4={},_0x1ae268={},_0x73783a={'count':0x0,'rows':[]};var _0x2e33dc=_[_0x4f95('0x2b')](db['ChatQueueReport']['rawAttributes'],function(_0x5ea525){return{'name':_0x5ea525[_0x4f95('0x2c')],'type':_0x5ea525['type'][_0x4f95('0x2d')]};});_0x1ae268[_0x4f95('0x2e')]=_[_0x4f95('0x2b')](_0x2e33dc,_0x4f95('0x29'));_0x1ae268[_0x4f95('0x2f')]=_[_0x4f95('0x30')](_0x2dc278[_0x4f95('0x2f')]);_0x1ae268[_0x4f95('0x31')]=_['intersection'](_0x1ae268[_0x4f95('0x2e')],_0x1ae268[_0x4f95('0x2f')]);_0x6ff6c4[_0x4f95('0x32')]=_[_0x4f95('0x33')](_0x1ae268[_0x4f95('0x2e')],qs[_0x4f95('0x34')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x34')]));_0x6ff6c4['attributes']=_0x6ff6c4[_0x4f95('0x32')][_0x4f95('0x35')]?_0x6ff6c4[_0x4f95('0x32')]:_0x1ae268[_0x4f95('0x2e')];if(!_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x36')](_0x4f95('0x37'))){_0x6ff6c4[_0x4f95('0x1d')]=qs[_0x4f95('0x1d')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x1d')]);_0x6ff6c4[_0x4f95('0x1b')]=qs[_0x4f95('0x1b')](_0x2dc278['query']['offset']);}_0x6ff6c4[_0x4f95('0x38')]=qs[_0x4f95('0x39')](_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x39')]);_0x6ff6c4[_0x4f95('0x3a')]=qs['filters'](_['pick'](_0x2dc278[_0x4f95('0x2f')],_0x1ae268[_0x4f95('0x31')]),_0x2e33dc);if(_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x3b')]){_0x6ff6c4[_0x4f95('0x3a')]=_[_0x4f95('0x3c')](_0x6ff6c4['where'],{'$or':_[_0x4f95('0x2b')](_0x2e33dc,function(_0x110470){if(_0x110470[_0x4f95('0x3d')]!==_0x4f95('0x3e')){var _0x203b19={};_0x203b19[_0x110470[_0x4f95('0x29')]]={'$like':'%'+_0x2dc278[_0x4f95('0x2f')]['filter']+'%'};return _0x203b19;}})});}_0x6ff6c4=_['merge']({},_0x6ff6c4,_0x2dc278['options']);var _0x5322db={'where':_0x6ff6c4[_0x4f95('0x3a')]};return db[_0x4f95('0x3f')]['count'](_0x5322db)['then'](function(_0x4b6009){_0x73783a[_0x4f95('0x1e')]=_0x4b6009;if(_0x2dc278[_0x4f95('0x2f')][_0x4f95('0x40')]){_0x6ff6c4[_0x4f95('0x41')]=[{'all':!![]}];}return db[_0x4f95('0x3f')]['findAll'](_0x6ff6c4);})[_0x4f95('0x25')](function(_0x2af149){_0x73783a[_0x4f95('0x42')]=_0x2af149;return _0x73783a;})[_0x4f95('0x25')](respondWithFilteredResult(_0x1cdd1b,_0x6ff6c4))[_0x4f95('0x43')](handleError(_0x1cdd1b,null));};exports[_0x4f95('0x44')]=function(_0x338d48,_0x10e8bf){var _0x2e133d={'raw':!![],'where':{'id':_0x338d48[_0x4f95('0x45')]['id']}},_0x572606={};_0x572606[_0x4f95('0x2e')]=_[_0x4f95('0x30')](db[_0x4f95('0x3f')][_0x4f95('0x46')]);_0x572606['query']=_['keys'](_0x338d48['query']);_0x572606[_0x4f95('0x31')]=_[_0x4f95('0x33')](_0x572606[_0x4f95('0x2e')],_0x572606['query']);_0x2e133d['attributes']=_[_0x4f95('0x33')](_0x572606[_0x4f95('0x2e')],qs[_0x4f95('0x34')](_0x338d48['query'][_0x4f95('0x34')]));_0x2e133d[_0x4f95('0x32')]=_0x2e133d['attributes']['length']?_0x2e133d[_0x4f95('0x32')]:_0x572606[_0x4f95('0x2e')];if(_0x338d48[_0x4f95('0x2f')][_0x4f95('0x40')]){_0x2e133d[_0x4f95('0x41')]=[{'all':!![]}];}_0x2e133d=_[_0x4f95('0x3c')]({},_0x2e133d,_0x338d48[_0x4f95('0x47')]);return db[_0x4f95('0x3f')][_0x4f95('0x48')](_0x2e133d)[_0x4f95('0x25')](handleEntityNotFound(_0x10e8bf,null))[_0x4f95('0x25')](respondWithResult(_0x10e8bf,null))['catch'](handleError(_0x10e8bf,null));};exports[_0x4f95('0x49')]=function(_0x23b029,_0x372e1b){return db[_0x4f95('0x3f')]['create'](_0x23b029[_0x4f95('0x4a')],{})[_0x4f95('0x25')](respondWithResult(_0x372e1b,0xc9))[_0x4f95('0x43')](handleError(_0x372e1b,null));};exports[_0x4f95('0x24')]=function(_0x3b66b8,_0x43c97b){if(_0x3b66b8['body']['id']){delete _0x3b66b8[_0x4f95('0x4a')]['id'];}return db[_0x4f95('0x3f')][_0x4f95('0x48')]({'where':{'id':_0x3b66b8[_0x4f95('0x45')]['id']}})[_0x4f95('0x25')](handleEntityNotFound(_0x43c97b,null))[_0x4f95('0x25')](saveUpdates(_0x3b66b8[_0x4f95('0x4a')],null))['then'](respondWithResult(_0x43c97b,null))[_0x4f95('0x43')](handleError(_0x43c97b,null));};exports['destroy']=function(_0x4646ca,_0x2d91bc){return db[_0x4f95('0x3f')]['find']({'where':{'id':_0x4646ca['params']['id']}})[_0x4f95('0x25')](handleEntityNotFound(_0x2d91bc,null))['then'](removeEntity(_0x2d91bc,null))[_0x4f95('0x43')](handleError(_0x2d91bc,null));};exports[_0x4f95('0x4b')]=function(_0x1811c2,_0x2f42b4){return db[_0x4f95('0x3f')]['describe']()[_0x4f95('0x25')](respondWithResult(_0x2f42b4,null))['catch'](handleError(_0x2f42b4,null));}; \ No newline at end of file +var _0xb1ad=['rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','pick','filters','filter','where','merge','options','then','includeAll','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb1ad,0x184));var _0xdb1a=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xb1ad[_0xe66cf2];return _0x2d84e7;};'use strict';var emlformat=require(_0xdb1a('0x0'));var rimraf=require(_0xdb1a('0x1'));var zipdir=require(_0xdb1a('0x2'));var jsonpatch=require(_0xdb1a('0x3'));var rp=require(_0xdb1a('0x4'));var moment=require(_0xdb1a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb1a('0x6'));var util=require(_0xdb1a('0x7'));var path=require(_0xdb1a('0x8'));var sox=require(_0xdb1a('0x9'));var csv=require(_0xdb1a('0xa'));var ejs=require(_0xdb1a('0xb'));var fs=require('fs');var fs_extra=require(_0xdb1a('0xc'));var _=require(_0xdb1a('0xd'));var squel=require(_0xdb1a('0xe'));var crypto=require(_0xdb1a('0xf'));var jsforce=require(_0xdb1a('0x10'));var deskjs=require(_0xdb1a('0x11'));var toCsv=require(_0xdb1a('0xa'));var querystring=require(_0xdb1a('0x12'));var Papa=require(_0xdb1a('0x13'));var Redis=require('ioredis');var authService=require(_0xdb1a('0x14'));var qs=require(_0xdb1a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdb1a('0x16'));var utils=require(_0xdb1a('0x17'));var config=require(_0xdb1a('0x18'));var licenseUtil=require(_0xdb1a('0x19'));var db=require(_0xdb1a('0x1a'))['db'];function respondWithStatusCode(_0x31ccd3,_0x3ca28b){_0x3ca28b=_0x3ca28b||0xcc;return function(_0x1c40c8){if(_0x1c40c8){return _0x31ccd3[_0xdb1a('0x1b')](_0x3ca28b);}return _0x31ccd3[_0xdb1a('0x1c')](_0x3ca28b)[_0xdb1a('0x1d')]();};}function respondWithResult(_0x1d69dd,_0x857c00){_0x857c00=_0x857c00||0xc8;return function(_0x5aa761){if(_0x5aa761){return _0x1d69dd[_0xdb1a('0x1c')](_0x857c00)[_0xdb1a('0x1e')](_0x5aa761);}};}function respondWithFilteredResult(_0x112be1,_0x4bdec7){return function(_0x28dfe9){if(_0x28dfe9){var _0x504d92=typeof _0x4bdec7[_0xdb1a('0x1f')]===_0xdb1a('0x20')&&typeof _0x4bdec7[_0xdb1a('0x21')]==='undefined';var _0x9ffb77=_0x28dfe9[_0xdb1a('0x22')];var _0x268ce8=_0x504d92?0x0:_0x4bdec7['offset'];var _0xe3780b=_0x504d92?_0x28dfe9[_0xdb1a('0x22')]:_0x4bdec7[_0xdb1a('0x1f')]+_0x4bdec7[_0xdb1a('0x21')];var _0x37e10c;if(_0xe3780b>=_0x9ffb77){_0xe3780b=_0x9ffb77;_0x37e10c=0xc8;}else{_0x37e10c=0xce;}_0x112be1[_0xdb1a('0x1c')](_0x37e10c);return _0x112be1['set'](_0xdb1a('0x23'),_0x268ce8+'-'+_0xe3780b+'/'+_0x9ffb77)[_0xdb1a('0x1e')](_0x28dfe9);}return null;};}function patchUpdates(_0x386e32){return function(_0x37b776){try{jsonpatch[_0xdb1a('0x24')](_0x37b776,_0x386e32,!![]);}catch(_0x400397){return BPromise[_0xdb1a('0x25')](_0x400397);}return _0x37b776[_0xdb1a('0x26')]();};}function saveUpdates(_0x3a9b3a,_0xc92d26){return function(_0x4d1d09){if(_0x4d1d09){return _0x4d1d09[_0xdb1a('0x27')](_0x3a9b3a)['then'](function(_0x28ccfe){return _0x28ccfe;});}return null;};}function removeEntity(_0x2cc1aa,_0x3d07fc){return function(_0x5d3d24){if(_0x5d3d24){return _0x5d3d24[_0xdb1a('0x28')]()['then'](function(){_0x2cc1aa[_0xdb1a('0x1c')](0xcc)[_0xdb1a('0x1d')]();});}};}function handleEntityNotFound(_0x22c95e,_0x157c6a){return function(_0xaa6f2e){if(!_0xaa6f2e){_0x22c95e[_0xdb1a('0x1b')](0x194);}return _0xaa6f2e;};}function handleError(_0x22c260,_0x2e814e){_0x2e814e=_0x2e814e||0x1f4;return function(_0x5c963b){logger['error'](_0x5c963b[_0xdb1a('0x29')]);if(_0x5c963b[_0xdb1a('0x2a')]){delete _0x5c963b[_0xdb1a('0x2a')];}_0x22c260[_0xdb1a('0x1c')](_0x2e814e)[_0xdb1a('0x2b')](_0x5c963b);};}exports[_0xdb1a('0x2c')]=function(_0x5d1514,_0x3ec2f6){var _0x51f0ff={},_0x5a67c4={},_0xbfa09f={'count':0x0,'rows':[]};var _0x51a26d=_['map'](db[_0xdb1a('0x2d')][_0xdb1a('0x2e')],function(_0x46d019){return{'name':_0x46d019['fieldName'],'type':_0x46d019[_0xdb1a('0x2f')][_0xdb1a('0x30')]};});_0x5a67c4[_0xdb1a('0x31')]=_[_0xdb1a('0x32')](_0x51a26d,'name');_0x5a67c4[_0xdb1a('0x33')]=_[_0xdb1a('0x34')](_0x5d1514[_0xdb1a('0x33')]);_0x5a67c4['filters']=_[_0xdb1a('0x35')](_0x5a67c4[_0xdb1a('0x31')],_0x5a67c4[_0xdb1a('0x33')]);_0x51f0ff[_0xdb1a('0x36')]=_['intersection'](_0x5a67c4['model'],qs['fields'](_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x37')]));_0x51f0ff['attributes']=_0x51f0ff[_0xdb1a('0x36')][_0xdb1a('0x38')]?_0x51f0ff[_0xdb1a('0x36')]:_0x5a67c4[_0xdb1a('0x31')];if(!_0x5d1514[_0xdb1a('0x33')]['hasOwnProperty']('nolimit')){_0x51f0ff['limit']=qs[_0xdb1a('0x21')](_0x5d1514['query']['limit']);_0x51f0ff[_0xdb1a('0x1f')]=qs[_0xdb1a('0x1f')](_0x5d1514['query'][_0xdb1a('0x1f')]);}_0x51f0ff[_0xdb1a('0x39')]=qs[_0xdb1a('0x3a')](_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x3a')]);_0x51f0ff['where']=qs['filters'](_[_0xdb1a('0x3b')](_0x5d1514[_0xdb1a('0x33')],_0x5a67c4[_0xdb1a('0x3c')]),_0x51a26d);if(_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x3d')]){_0x51f0ff[_0xdb1a('0x3e')]=_[_0xdb1a('0x3f')](_0x51f0ff['where'],{'$or':_[_0xdb1a('0x32')](_0x51a26d,function(_0x5ba671){if(_0x5ba671['type']!=='VIRTUAL'){var _0x4a4366={};_0x4a4366[_0x5ba671[_0xdb1a('0x2a')]]={'$like':'%'+_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x3d')]+'%'};return _0x4a4366;}})});}_0x51f0ff=_[_0xdb1a('0x3f')]({},_0x51f0ff,_0x5d1514[_0xdb1a('0x40')]);var _0x5f535d={'where':_0x51f0ff[_0xdb1a('0x3e')]};return db[_0xdb1a('0x2d')][_0xdb1a('0x22')](_0x5f535d)[_0xdb1a('0x41')](function(_0xcffe52){_0xbfa09f[_0xdb1a('0x22')]=_0xcffe52;if(_0x5d1514[_0xdb1a('0x33')][_0xdb1a('0x42')]){_0x51f0ff[_0xdb1a('0x43')]=[{'all':!![]}];}return db[_0xdb1a('0x2d')]['findAll'](_0x51f0ff);})['then'](function(_0x43e27a){_0xbfa09f[_0xdb1a('0x44')]=_0x43e27a;return _0xbfa09f;})[_0xdb1a('0x41')](respondWithFilteredResult(_0x3ec2f6,_0x51f0ff))[_0xdb1a('0x45')](handleError(_0x3ec2f6,null));};exports[_0xdb1a('0x46')]=function(_0x4572d,_0x149fd6){var _0xad79f2={'raw':!![],'where':{'id':_0x4572d[_0xdb1a('0x47')]['id']}},_0xcb156c={};_0xcb156c[_0xdb1a('0x31')]=_[_0xdb1a('0x34')](db[_0xdb1a('0x2d')]['rawAttributes']);_0xcb156c[_0xdb1a('0x33')]=_[_0xdb1a('0x34')](_0x4572d[_0xdb1a('0x33')]);_0xcb156c[_0xdb1a('0x3c')]=_[_0xdb1a('0x35')](_0xcb156c[_0xdb1a('0x31')],_0xcb156c[_0xdb1a('0x33')]);_0xad79f2['attributes']=_['intersection'](_0xcb156c['model'],qs[_0xdb1a('0x37')](_0x4572d[_0xdb1a('0x33')]['fields']));_0xad79f2[_0xdb1a('0x36')]=_0xad79f2[_0xdb1a('0x36')]['length']?_0xad79f2['attributes']:_0xcb156c[_0xdb1a('0x31')];if(_0x4572d[_0xdb1a('0x33')]['includeAll']){_0xad79f2[_0xdb1a('0x43')]=[{'all':!![]}];}_0xad79f2=_[_0xdb1a('0x3f')]({},_0xad79f2,_0x4572d[_0xdb1a('0x40')]);return db['ChatQueueReport'][_0xdb1a('0x48')](_0xad79f2)[_0xdb1a('0x41')](handleEntityNotFound(_0x149fd6,null))[_0xdb1a('0x41')](respondWithResult(_0x149fd6,null))[_0xdb1a('0x45')](handleError(_0x149fd6,null));};exports['create']=function(_0x37aa5e,_0x452aa8){return db[_0xdb1a('0x2d')][_0xdb1a('0x49')](_0x37aa5e['body'],{})[_0xdb1a('0x41')](respondWithResult(_0x452aa8,0xc9))[_0xdb1a('0x45')](handleError(_0x452aa8,null));};exports[_0xdb1a('0x27')]=function(_0x367b1f,_0x40b193){if(_0x367b1f[_0xdb1a('0x4a')]['id']){delete _0x367b1f[_0xdb1a('0x4a')]['id'];}return db[_0xdb1a('0x2d')][_0xdb1a('0x48')]({'where':{'id':_0x367b1f[_0xdb1a('0x47')]['id']}})['then'](handleEntityNotFound(_0x40b193,null))['then'](saveUpdates(_0x367b1f['body'],null))[_0xdb1a('0x41')](respondWithResult(_0x40b193,null))[_0xdb1a('0x45')](handleError(_0x40b193,null));};exports[_0xdb1a('0x28')]=function(_0x3b018c,_0x32faa7){return db[_0xdb1a('0x2d')][_0xdb1a('0x48')]({'where':{'id':_0x3b018c['params']['id']}})['then'](handleEntityNotFound(_0x32faa7,null))['then'](removeEntity(_0x32faa7,null))['catch'](handleError(_0x32faa7,null));};exports[_0xdb1a('0x4b')]=function(_0x1f6115,_0x5663f1){return db['ChatQueueReport']['describe']()[_0xdb1a('0x41')](respondWithResult(_0x5663f1,null))[_0xdb1a('0x45')](handleError(_0x5663f1,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 269b867..e7ed35b 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x26c4a8,_0x2179f7){var _0x46b15b=function(_0x368ac6){while(--_0x368ac6){_0x26c4a8['push'](_0x26c4a8['shift']());}};_0x46b15b(++_0x2179f7);}(_0x757a,0xde));var _0xa757=function(_0x578487,_0x5f5c4d){_0x578487=_0x578487-0x0;var _0x34b72d=_0x757a[_0x578487];return _0x34b72d;};'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'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3fbbf6,_0x60f107){var _0xa7038a=function(_0x1f8f94){while(--_0x1f8f94){_0x3fbbf6['push'](_0x3fbbf6['shift']());}};_0xa7038a(++_0x60f107);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 92a81e5..2c7e075 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 _0xab23=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatQueueReport','create','body','options','ChatQueueReport','update','raw','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xab23,0x1bc));var _0x3ab2=function(_0x4a9218,_0x2b25cc){_0x4a9218=_0x4a9218-0x0;var _0x338098=_0xab23[_0x4a9218];return _0x338098;};'use strict';var _=require(_0x3ab2('0x0'));var util=require(_0x3ab2('0x1'));var moment=require(_0x3ab2('0x2'));var BPromise=require(_0x3ab2('0x3'));var rs=require(_0x3ab2('0x4'));var fs=require('fs');var Redis=require(_0x3ab2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ab2('0x6'));var logger=require(_0x3ab2('0x7'))(_0x3ab2('0x8'));var config=require(_0x3ab2('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e8d92,_0x5c861e,_0x36eee5){return new BPromise(function(_0x46d253,_0x20cfe1){return client[_0x3ab2('0xb')](_0x4e8d92,_0x36eee5)[_0x3ab2('0xc')](function(_0x120021){logger[_0x3ab2('0xd')](_0x3ab2('0xe'),_0x5c861e,_0x3ab2('0xf'));logger[_0x3ab2('0x10')](_0x3ab2('0x11'),_0x5c861e,'request\x20sent',JSON[_0x3ab2('0x12')](_0x120021));if(_0x120021[_0x3ab2('0x13')]){if(_0x120021[_0x3ab2('0x13')]['code']===0x1f4){logger['error'](_0x3ab2('0xe'),_0x5c861e,_0x120021[_0x3ab2('0x13')][_0x3ab2('0x14')]);return _0x20cfe1(_0x120021[_0x3ab2('0x13')][_0x3ab2('0x14')]);}logger[_0x3ab2('0x13')](_0x3ab2('0xe'),_0x5c861e,_0x120021[_0x3ab2('0x13')][_0x3ab2('0x14')]);return _0x46d253(_0x120021['error'][_0x3ab2('0x14')]);}else{logger['info'](_0x3ab2('0xe'),_0x5c861e,_0x3ab2('0xf'));_0x46d253(_0x120021['result']['message']);}})[_0x3ab2('0x15')](function(_0x43336e){logger[_0x3ab2('0x13')](_0x3ab2('0xe'),_0x5c861e,_0x43336e);_0x20cfe1(_0x43336e);});});}exports[_0x3ab2('0x16')]=function(_0x5a6ec4){var _0x4d129b=this;return new Promise(function(_0x42c4f4,_0x1efcb9){return db['ChatQueueReport'][_0x3ab2('0x17')](_0x5a6ec4[_0x3ab2('0x18')],{'raw':_0x5a6ec4[_0x3ab2('0x19')]?_0x5a6ec4[_0x3ab2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3ab2('0xc')](function(_0x42638a){logger[_0x3ab2('0xd')](_0x3ab2('0x16'),_0x5a6ec4);logger[_0x3ab2('0x10')](_0x3ab2('0x16'),_0x5a6ec4,JSON[_0x3ab2('0x12')](_0x42638a));_0x42c4f4(_0x42638a);})[_0x3ab2('0x15')](function(_0x5dbfdc){logger[_0x3ab2('0x13')]('CreateChatQueueReport',_0x5dbfdc[_0x3ab2('0x14')],_0x5a6ec4);_0x1efcb9(_0x4d129b[_0x3ab2('0x13')](0x1f4,_0x5dbfdc[_0x3ab2('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x436433){var _0x3b05dd=this;return new Promise(function(_0x459400,_0x3dcb9e){return db[_0x3ab2('0x1a')][_0x3ab2('0x1b')](_0x436433[_0x3ab2('0x18')],{'raw':_0x436433[_0x3ab2('0x19')]?_0x436433[_0x3ab2('0x19')][_0x3ab2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436433[_0x3ab2('0x19')]?_0x436433[_0x3ab2('0x19')]['where']||null:null,'attributes':_0x436433[_0x3ab2('0x19')]?_0x436433['options'][_0x3ab2('0x1d')]||null:null,'limit':_0x436433[_0x3ab2('0x19')]?_0x436433[_0x3ab2('0x19')][_0x3ab2('0x1e')]||null:null})[_0x3ab2('0xc')](function(_0x36005a){logger[_0x3ab2('0xd')](_0x3ab2('0x1f'),_0x436433);logger[_0x3ab2('0x10')](_0x3ab2('0x1f'),_0x436433,JSON[_0x3ab2('0x12')](_0x36005a));_0x459400(_0x36005a);})['catch'](function(_0x5dbcf4){logger['error'](_0x3ab2('0x1f'),_0x5dbcf4['message'],_0x436433);_0x3dcb9e(_0x3b05dd[_0x3ab2('0x13')](0x1f4,_0x5dbcf4[_0x3ab2('0x14')]));});});}; \ No newline at end of file +var _0x47a2=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport','create','raw','info','CreateChatQueueReport','UpdateChatQueueReport','update','body','options','attributes','limit','lodash','util'];(function(_0x1cbd61,_0x347647){var _0x965308=function(_0x11efae){while(--_0x11efae){_0x1cbd61['push'](_0x1cbd61['shift']());}};_0x965308(++_0x347647);}(_0x47a2,0x64));var _0x247a=function(_0x1d9083,_0x3e506e){_0x1d9083=_0x1d9083-0x0;var _0x558492=_0x47a2[_0x1d9083];return _0x558492;};'use strict';var _=require(_0x247a('0x0'));var util=require(_0x247a('0x1'));var moment=require(_0x247a('0x2'));var BPromise=require(_0x247a('0x3'));var rs=require(_0x247a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x247a('0x5'))['db'];var utils=require(_0x247a('0x6'));var logger=require('../../config/logger')(_0x247a('0x7'));var config=require(_0x247a('0x8'));var jayson=require(_0x247a('0x9'));var client=jayson[_0x247a('0xa')][_0x247a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4655f1,_0x134dc3,_0x4fa983){return new BPromise(function(_0xf624f0,_0x3784ab){return client['request'](_0x4655f1,_0x4fa983)[_0x247a('0xc')](function(_0x38a975){logger['info'](_0x247a('0xd'),_0x134dc3,'request\x20sent');logger[_0x247a('0xe')](_0x247a('0xf'),_0x134dc3,_0x247a('0x10'),JSON[_0x247a('0x11')](_0x38a975));if(_0x38a975['error']){if(_0x38a975[_0x247a('0x12')][_0x247a('0x13')]===0x1f4){logger[_0x247a('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x134dc3,_0x38a975[_0x247a('0x12')]['message']);return _0x3784ab(_0x38a975['error'][_0x247a('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x134dc3,_0x38a975[_0x247a('0x12')][_0x247a('0x14')]);return _0xf624f0(_0x38a975['error'][_0x247a('0x14')]);}else{logger['info'](_0x247a('0xd'),_0x134dc3,_0x247a('0x10'));_0xf624f0(_0x38a975[_0x247a('0x15')][_0x247a('0x14')]);}})[_0x247a('0x16')](function(_0x310c5e){logger[_0x247a('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x134dc3,_0x310c5e);_0x3784ab(_0x310c5e);});});}exports['CreateChatQueueReport']=function(_0x48650e){var _0x53c11c=this;return new Promise(function(_0xcb6c4e,_0x65d0a3){return db[_0x247a('0x17')][_0x247a('0x18')](_0x48650e['body'],{'raw':_0x48650e['options']?_0x48650e['options'][_0x247a('0x19')]===undefined?!![]:![]:!![]})[_0x247a('0xc')](function(_0x30eb63){logger[_0x247a('0x1a')](_0x247a('0x1b'),_0x48650e);logger[_0x247a('0xe')](_0x247a('0x1b'),_0x48650e,JSON['stringify'](_0x30eb63));_0xcb6c4e(_0x30eb63);})[_0x247a('0x16')](function(_0x3fc21e){logger[_0x247a('0x12')](_0x247a('0x1b'),_0x3fc21e[_0x247a('0x14')],_0x48650e);_0x65d0a3(_0x53c11c[_0x247a('0x12')](0x1f4,_0x3fc21e[_0x247a('0x14')]));});});};exports[_0x247a('0x1c')]=function(_0x29ec00){var _0x48e616=this;return new Promise(function(_0x30e21a,_0x1450e7){return db[_0x247a('0x17')][_0x247a('0x1d')](_0x29ec00[_0x247a('0x1e')],{'raw':_0x29ec00['options']?_0x29ec00[_0x247a('0x1f')][_0x247a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29ec00[_0x247a('0x1f')]?_0x29ec00[_0x247a('0x1f')]['where']||null:null,'attributes':_0x29ec00[_0x247a('0x1f')]?_0x29ec00['options'][_0x247a('0x20')]||null:null,'limit':_0x29ec00[_0x247a('0x1f')]?_0x29ec00[_0x247a('0x1f')][_0x247a('0x21')]||null:null})[_0x247a('0xc')](function(_0x147c67){logger[_0x247a('0x1a')](_0x247a('0x1c'),_0x29ec00);logger[_0x247a('0xe')](_0x247a('0x1c'),_0x29ec00,JSON['stringify'](_0x147c67));_0x30e21a(_0x147c67);})[_0x247a('0x16')](function(_0x1e400e){logger[_0x247a('0x12')](_0x247a('0x1c'),_0x1e400e[_0x247a('0x14')],_0x29ec00);_0x1450e7(_0x48e616['error'](0x1f4,_0x1e400e['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 1bf1bf5..d7afbf2 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 _0x6080=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','show','put','/:id','update','delete'];(function(_0x3cff16,_0x12713c){var _0x5943a0=function(_0x572563){while(--_0x572563){_0x3cff16['push'](_0x3cff16['shift']());}};_0x5943a0(++_0x12713c);}(_0x6080,0x18c));var _0x0608=function(_0x5bd1f1,_0xfa1e23){_0x5bd1f1=_0x5bd1f1-0x0;var _0x3313a7=_0x6080[_0x5bd1f1];return _0x3313a7;};'use strict';var multer=require(_0x0608('0x0'));var util=require(_0x0608('0x1'));var path=require(_0x0608('0x2'));var timeout=require(_0x0608('0x3'));var express=require('express');var router=express[_0x0608('0x4')]();var fs_extra=require(_0x0608('0x5'));var auth=require(_0x0608('0x6'));var interaction=require(_0x0608('0x7'));var config=require(_0x0608('0x8'));var controller=require(_0x0608('0x9'));router[_0x0608('0xa')]('/',auth[_0x0608('0xb')](),controller['index']);router[_0x0608('0xa')](_0x0608('0xc'),auth[_0x0608('0xb')](),controller['describe']);router[_0x0608('0xa')]('/:id',auth[_0x0608('0xb')](),controller[_0x0608('0xd')]);router['post']('/',auth[_0x0608('0xb')](),controller['create']);router[_0x0608('0xe')](_0x0608('0xf'),auth['isAuthenticated'](),controller[_0x0608('0x10')]);router[_0x0608('0x11')]('/:id',auth[_0x0608('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd88d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','put','update','delete','/:id','exports','multer','path'];(function(_0x4e6109,_0x1119e1){var _0x226e4f=function(_0x5c4718){while(--_0x5c4718){_0x4e6109['push'](_0x4e6109['shift']());}};_0x226e4f(++_0x1119e1);}(_0xd88d,0x11c));var _0xdd88=function(_0x190be0,_0x387113){_0x190be0=_0x190be0-0x0;var _0x487fb8=_0xd88d[_0x190be0];return _0x487fb8;};'use strict';var multer=require(_0xdd88('0x0'));var util=require('util');var path=require(_0xdd88('0x1'));var timeout=require(_0xdd88('0x2'));var express=require(_0xdd88('0x3'));var router=express[_0xdd88('0x4')]();var fs_extra=require(_0xdd88('0x5'));var auth=require(_0xdd88('0x6'));var interaction=require(_0xdd88('0x7'));var config=require(_0xdd88('0x8'));var controller=require('./chatQueueReport.controller');router[_0xdd88('0x9')]('/',auth['isAuthenticated'](),controller[_0xdd88('0xa')]);router[_0xdd88('0x9')](_0xdd88('0xb'),auth[_0xdd88('0xc')](),controller[_0xdd88('0xd')]);router[_0xdd88('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdd88('0xe')]);router[_0xdd88('0xf')]('/',auth[_0xdd88('0xc')](),controller[_0xdd88('0x10')]);router[_0xdd88('0x11')]('/:id',auth[_0xdd88('0xc')](),controller[_0xdd88('0x12')]);router[_0xdd88('0x13')](_0xdd88('0x14'),auth[_0xdd88('0xc')](),controller['destroy']);module[_0xdd88('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index f562801..0f2fdd5 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x18ddf4,_0x3fb331){var _0xa06d9c=function(_0x8e7c41){while(--_0x8e7c41){_0x18ddf4['push'](_0x18ddf4['shift']());}};_0xa06d9c(++_0x3fb331);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1830ce,_0x305798){_0x1830ce=_0x1830ce-0x0;var _0x2bce9f=_0xf3cd[_0x1830ce];return _0x2bce9f;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x20e4f3,_0x4c24c8){var _0x2055df=function(_0x3a51b7){while(--_0x3a51b7){_0x20e4f3['push'](_0x20e4f3['shift']());}};_0x2055df(++_0x4c24c8);}(_0xedd9,0xfc));var _0x9edd=function(_0x33f0fe,_0x3416cb){_0x33f0fe=_0x33f0fe-0x0;var _0x57c3f5=_0xedd9[_0x33f0fe];return _0x57c3f5;};'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 ad45b3b..5db7e17 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 _0x0881=['catch','show','params','intersection','options','create','body','find','describe','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll'];(function(_0x52a60d,_0x5cf284){var _0x2c6ad2=function(_0x1f2cce){while(--_0x1f2cce){_0x52a60d['push'](_0x52a60d['shift']());}};_0x2c6ad2(++_0x5cf284);}(_0x0881,0xea));var _0x1088=function(_0x1cea7b,_0x37f5f4){_0x1cea7b=_0x1cea7b-0x0;var _0x5618d1=_0x0881[_0x1cea7b];return _0x5618d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1088('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1088('0x1'));var moment=require(_0x1088('0x2'));var BPromise=require(_0x1088('0x3'));var Mustache=require('mustache');var util=require(_0x1088('0x4'));var path=require(_0x1088('0x5'));var sox=require(_0x1088('0x6'));var csv=require(_0x1088('0x7'));var ejs=require(_0x1088('0x8'));var fs=require('fs');var fs_extra=require(_0x1088('0x9'));var _=require(_0x1088('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1088('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1088('0xc'));var Papa=require(_0x1088('0xd'));var Redis=require(_0x1088('0xe'));var authService=require(_0x1088('0xf'));var qs=require(_0x1088('0x10'));var as=require(_0x1088('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1088('0x12'))(_0x1088('0x13'));var utils=require('../../config/utils');var config=require(_0x1088('0x14'));var licenseUtil=require(_0x1088('0x15'));var db=require(_0x1088('0x16'))['db'];function respondWithStatusCode(_0x518232,_0x5da1de){_0x5da1de=_0x5da1de||0xcc;return function(_0x15e1ee){if(_0x15e1ee){return _0x518232[_0x1088('0x17')](_0x5da1de);}return _0x518232[_0x1088('0x18')](_0x5da1de)[_0x1088('0x19')]();};}function respondWithResult(_0x454355,_0x24ac5e){_0x24ac5e=_0x24ac5e||0xc8;return function(_0x13ef5f){if(_0x13ef5f){return _0x454355[_0x1088('0x18')](_0x24ac5e)['json'](_0x13ef5f);}};}function respondWithFilteredResult(_0x5a997a,_0x2bdfb9){return function(_0x1269ae){if(_0x1269ae){var _0xf14386=typeof _0x2bdfb9[_0x1088('0x1a')]==='undefined'&&typeof _0x2bdfb9['limit']==='undefined';var _0x43f429=_0x1269ae[_0x1088('0x1b')];var _0x50fac7=_0xf14386?0x0:_0x2bdfb9[_0x1088('0x1a')];var _0x842f2e=_0xf14386?_0x1269ae[_0x1088('0x1b')]:_0x2bdfb9[_0x1088('0x1a')]+_0x2bdfb9['limit'];var _0x581778;if(_0x842f2e>=_0x43f429){_0x842f2e=_0x43f429;_0x581778=0xc8;}else{_0x581778=0xce;}_0x5a997a['status'](_0x581778);return _0x5a997a[_0x1088('0x1c')](_0x1088('0x1d'),_0x50fac7+'-'+_0x842f2e+'/'+_0x43f429)[_0x1088('0x1e')](_0x1269ae);}return null;};}function patchUpdates(_0x18e441){return function(_0x34945d){try{jsonpatch[_0x1088('0x1f')](_0x34945d,_0x18e441,!![]);}catch(_0x57ebbb){return BPromise['reject'](_0x57ebbb);}return _0x34945d[_0x1088('0x20')]();};}function saveUpdates(_0x3dff76,_0x51f281){return function(_0x3813e4){if(_0x3813e4){return _0x3813e4[_0x1088('0x21')](_0x3dff76)[_0x1088('0x22')](function(_0x27e40e){return _0x27e40e;});}return null;};}function removeEntity(_0x5395cb,_0x2fe399){return function(_0x3e61a2){if(_0x3e61a2){return _0x3e61a2[_0x1088('0x23')]()[_0x1088('0x22')](function(){_0x5395cb[_0x1088('0x18')](0xcc)[_0x1088('0x19')]();});}};}function handleEntityNotFound(_0xb91f37,_0x59b1db){return function(_0xcf449d){if(!_0xcf449d){_0xb91f37[_0x1088('0x17')](0x194);}return _0xcf449d;};}function handleError(_0x5542d9,_0x1adbba){_0x1adbba=_0x1adbba||0x1f4;return function(_0x383c11){logger[_0x1088('0x24')](_0x383c11[_0x1088('0x25')]);if(_0x383c11[_0x1088('0x26')]){delete _0x383c11[_0x1088('0x26')];}_0x5542d9['status'](_0x1adbba)[_0x1088('0x27')](_0x383c11);};}exports['index']=function(_0x43d6c7,_0x45d050){var _0x3e4630={},_0x104708={},_0x8fa8a3={'count':0x0,'rows':[]};var _0x27ead4=_[_0x1088('0x28')](db[_0x1088('0x29')][_0x1088('0x2a')],function(_0x281f08){return{'name':_0x281f08[_0x1088('0x2b')],'type':_0x281f08['type'][_0x1088('0x2c')]};});_0x104708['model']=_[_0x1088('0x28')](_0x27ead4,_0x1088('0x26'));_0x104708[_0x1088('0x2d')]=_[_0x1088('0x2e')](_0x43d6c7[_0x1088('0x2d')]);_0x104708['filters']=_['intersection'](_0x104708[_0x1088('0x2f')],_0x104708[_0x1088('0x2d')]);_0x3e4630[_0x1088('0x30')]=_['intersection'](_0x104708[_0x1088('0x2f')],qs[_0x1088('0x31')](_0x43d6c7[_0x1088('0x2d')][_0x1088('0x31')]));_0x3e4630['attributes']=_0x3e4630[_0x1088('0x30')][_0x1088('0x32')]?_0x3e4630[_0x1088('0x30')]:_0x104708[_0x1088('0x2f')];if(!_0x43d6c7[_0x1088('0x2d')][_0x1088('0x33')](_0x1088('0x34'))){_0x3e4630['limit']=qs[_0x1088('0x35')](_0x43d6c7[_0x1088('0x2d')][_0x1088('0x35')]);_0x3e4630[_0x1088('0x1a')]=qs[_0x1088('0x1a')](_0x43d6c7[_0x1088('0x2d')][_0x1088('0x1a')]);}_0x3e4630[_0x1088('0x36')]=qs[_0x1088('0x37')](_0x43d6c7[_0x1088('0x2d')][_0x1088('0x37')]);_0x3e4630[_0x1088('0x38')]=qs[_0x1088('0x39')](_[_0x1088('0x3a')](_0x43d6c7[_0x1088('0x2d')],_0x104708[_0x1088('0x39')]),_0x27ead4);if(_0x43d6c7[_0x1088('0x2d')][_0x1088('0x3b')]){_0x3e4630[_0x1088('0x38')]=_[_0x1088('0x3c')](_0x3e4630['where'],{'$or':_[_0x1088('0x28')](_0x27ead4,function(_0x955851){if(_0x955851[_0x1088('0x3d')]!==_0x1088('0x3e')){var _0x5ded67={};_0x5ded67[_0x955851['name']]={'$like':'%'+_0x43d6c7[_0x1088('0x2d')][_0x1088('0x3b')]+'%'};return _0x5ded67;}})});}_0x3e4630=_[_0x1088('0x3c')]({},_0x3e4630,_0x43d6c7['options']);var _0x2c3f65={'where':_0x3e4630['where']};return db['ChatTransferReport'][_0x1088('0x1b')](_0x2c3f65)[_0x1088('0x22')](function(_0x152588){_0x8fa8a3[_0x1088('0x1b')]=_0x152588;if(_0x43d6c7['query'][_0x1088('0x3f')]){_0x3e4630[_0x1088('0x40')]=[{'all':!![]}];}return db[_0x1088('0x29')][_0x1088('0x41')](_0x3e4630);})[_0x1088('0x22')](function(_0x593036){_0x8fa8a3['rows']=_0x593036;return _0x8fa8a3;})['then'](respondWithFilteredResult(_0x45d050,_0x3e4630))[_0x1088('0x42')](handleError(_0x45d050,null));};exports[_0x1088('0x43')]=function(_0x33e1bd,_0x135e2e){var _0xf9a196={'raw':!![],'where':{'id':_0x33e1bd[_0x1088('0x44')]['id']}},_0x12caa7={};_0x12caa7[_0x1088('0x2f')]=_[_0x1088('0x2e')](db['ChatTransferReport'][_0x1088('0x2a')]);_0x12caa7['query']=_[_0x1088('0x2e')](_0x33e1bd[_0x1088('0x2d')]);_0x12caa7[_0x1088('0x39')]=_['intersection'](_0x12caa7['model'],_0x12caa7['query']);_0xf9a196[_0x1088('0x30')]=_[_0x1088('0x45')](_0x12caa7['model'],qs[_0x1088('0x31')](_0x33e1bd[_0x1088('0x2d')][_0x1088('0x31')]));_0xf9a196[_0x1088('0x30')]=_0xf9a196[_0x1088('0x30')][_0x1088('0x32')]?_0xf9a196[_0x1088('0x30')]:_0x12caa7[_0x1088('0x2f')];if(_0x33e1bd[_0x1088('0x2d')][_0x1088('0x3f')]){_0xf9a196[_0x1088('0x40')]=[{'all':!![]}];}_0xf9a196=_[_0x1088('0x3c')]({},_0xf9a196,_0x33e1bd[_0x1088('0x46')]);return db[_0x1088('0x29')]['find'](_0xf9a196)[_0x1088('0x22')](handleEntityNotFound(_0x135e2e,null))[_0x1088('0x22')](respondWithResult(_0x135e2e,null))[_0x1088('0x42')](handleError(_0x135e2e,null));};exports[_0x1088('0x47')]=function(_0x1b943c,_0x85e37e){return db['ChatTransferReport'][_0x1088('0x47')](_0x1b943c[_0x1088('0x48')],{})[_0x1088('0x22')](respondWithResult(_0x85e37e,0xc9))[_0x1088('0x42')](handleError(_0x85e37e,null));};exports[_0x1088('0x21')]=function(_0x4bb57b,_0x3386a1){if(_0x4bb57b[_0x1088('0x48')]['id']){delete _0x4bb57b[_0x1088('0x48')]['id'];}return db[_0x1088('0x29')][_0x1088('0x49')]({'where':{'id':_0x4bb57b[_0x1088('0x44')]['id']}})[_0x1088('0x22')](handleEntityNotFound(_0x3386a1,null))['then'](saveUpdates(_0x4bb57b[_0x1088('0x48')],null))[_0x1088('0x22')](respondWithResult(_0x3386a1,null))[_0x1088('0x42')](handleError(_0x3386a1,null));};exports['destroy']=function(_0x332c53,_0x19f071){return db[_0x1088('0x29')]['find']({'where':{'id':_0x332c53[_0x1088('0x44')]['id']}})[_0x1088('0x22')](handleEntityNotFound(_0x19f071,null))[_0x1088('0x22')](removeEntity(_0x19f071,null))['catch'](handleError(_0x19f071,null));};exports[_0x1088('0x4a')]=function(_0x565f0a,_0x43cee8){return db[_0x1088('0x29')]['describe']()[_0x1088('0x22')](respondWithResult(_0x43cee8,null))['catch'](handleError(_0x43cee8,null));}; \ No newline at end of file +var _0x8fe4=['path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../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','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x59ef21,_0x62bfbd){var _0x5528d4=function(_0x1a2807){while(--_0x1a2807){_0x59ef21['push'](_0x59ef21['shift']());}};_0x5528d4(++_0x62bfbd);}(_0x8fe4,0x9b));var _0x48fe=function(_0x39f2ca,_0x17bcfc){_0x39f2ca=_0x39f2ca-0x0;var _0x4fa7f1=_0x8fe4[_0x39f2ca];return _0x4fa7f1;};'use strict';var emlformat=require(_0x48fe('0x0'));var rimraf=require(_0x48fe('0x1'));var zipdir=require(_0x48fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48fe('0x3'));var moment=require('moment');var BPromise=require(_0x48fe('0x4'));var Mustache=require(_0x48fe('0x5'));var util=require(_0x48fe('0x6'));var path=require(_0x48fe('0x7'));var sox=require(_0x48fe('0x8'));var csv=require('to-csv');var ejs=require(_0x48fe('0x9'));var fs=require('fs');var fs_extra=require(_0x48fe('0xa'));var _=require('lodash');var squel=require(_0x48fe('0xb'));var crypto=require('crypto');var jsforce=require(_0x48fe('0xc'));var deskjs=require(_0x48fe('0xd'));var toCsv=require(_0x48fe('0xe'));var querystring=require(_0x48fe('0xf'));var Papa=require(_0x48fe('0x10'));var Redis=require('ioredis');var authService=require(_0x48fe('0x11'));var qs=require(_0x48fe('0x12'));var as=require(_0x48fe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48fe('0x14'))(_0x48fe('0x15'));var utils=require(_0x48fe('0x16'));var config=require(_0x48fe('0x17'));var licenseUtil=require(_0x48fe('0x18'));var db=require(_0x48fe('0x19'))['db'];function respondWithStatusCode(_0xe8edae,_0x127965){_0x127965=_0x127965||0xcc;return function(_0x739ab0){if(_0x739ab0){return _0xe8edae['sendStatus'](_0x127965);}return _0xe8edae[_0x48fe('0x1a')](_0x127965)[_0x48fe('0x1b')]();};}function respondWithResult(_0x551852,_0x58d5fd){_0x58d5fd=_0x58d5fd||0xc8;return function(_0x5c093c){if(_0x5c093c){return _0x551852[_0x48fe('0x1a')](_0x58d5fd)[_0x48fe('0x1c')](_0x5c093c);}};}function respondWithFilteredResult(_0xf5c2e,_0x5bfeb9){return function(_0x292463){if(_0x292463){var _0x1cb9eb=typeof _0x5bfeb9[_0x48fe('0x1d')]===_0x48fe('0x1e')&&typeof _0x5bfeb9[_0x48fe('0x1f')]==='undefined';var _0x27be62=_0x292463[_0x48fe('0x20')];var _0xcbc6eb=_0x1cb9eb?0x0:_0x5bfeb9[_0x48fe('0x1d')];var _0x20e9d8=_0x1cb9eb?_0x292463[_0x48fe('0x20')]:_0x5bfeb9[_0x48fe('0x1d')]+_0x5bfeb9[_0x48fe('0x1f')];var _0x5c8079;if(_0x20e9d8>=_0x27be62){_0x20e9d8=_0x27be62;_0x5c8079=0xc8;}else{_0x5c8079=0xce;}_0xf5c2e[_0x48fe('0x1a')](_0x5c8079);return _0xf5c2e[_0x48fe('0x21')](_0x48fe('0x22'),_0xcbc6eb+'-'+_0x20e9d8+'/'+_0x27be62)[_0x48fe('0x1c')](_0x292463);}return null;};}function patchUpdates(_0x14475f){return function(_0x5ae9f2){try{jsonpatch[_0x48fe('0x23')](_0x5ae9f2,_0x14475f,!![]);}catch(_0x10c81b){return BPromise[_0x48fe('0x24')](_0x10c81b);}return _0x5ae9f2[_0x48fe('0x25')]();};}function saveUpdates(_0x1cb098,_0x1d17b6){return function(_0x1ac357){if(_0x1ac357){return _0x1ac357['update'](_0x1cb098)[_0x48fe('0x26')](function(_0x170abf){return _0x170abf;});}return null;};}function removeEntity(_0x24f043,_0x1fdf7f){return function(_0x8edc5c){if(_0x8edc5c){return _0x8edc5c['destroy']()['then'](function(){_0x24f043[_0x48fe('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55f4e1,_0x442290){return function(_0x3cc570){if(!_0x3cc570){_0x55f4e1[_0x48fe('0x27')](0x194);}return _0x3cc570;};}function handleError(_0x701887,_0x5f2094){_0x5f2094=_0x5f2094||0x1f4;return function(_0x3c57f4){logger[_0x48fe('0x28')](_0x3c57f4[_0x48fe('0x29')]);if(_0x3c57f4[_0x48fe('0x2a')]){delete _0x3c57f4[_0x48fe('0x2a')];}_0x701887[_0x48fe('0x1a')](_0x5f2094)[_0x48fe('0x2b')](_0x3c57f4);};}exports[_0x48fe('0x2c')]=function(_0x47f25c,_0x7d28fc){var _0x34c2aa={},_0x317af0={},_0x44682d={'count':0x0,'rows':[]};var _0x2e1f71=_[_0x48fe('0x2d')](db[_0x48fe('0x2e')][_0x48fe('0x2f')],function(_0x43ae41){return{'name':_0x43ae41[_0x48fe('0x30')],'type':_0x43ae41[_0x48fe('0x31')][_0x48fe('0x32')]};});_0x317af0[_0x48fe('0x33')]=_[_0x48fe('0x2d')](_0x2e1f71,_0x48fe('0x2a'));_0x317af0[_0x48fe('0x34')]=_[_0x48fe('0x35')](_0x47f25c[_0x48fe('0x34')]);_0x317af0[_0x48fe('0x36')]=_[_0x48fe('0x37')](_0x317af0['model'],_0x317af0['query']);_0x34c2aa[_0x48fe('0x38')]=_[_0x48fe('0x37')](_0x317af0[_0x48fe('0x33')],qs[_0x48fe('0x39')](_0x47f25c[_0x48fe('0x34')][_0x48fe('0x39')]));_0x34c2aa[_0x48fe('0x38')]=_0x34c2aa[_0x48fe('0x38')][_0x48fe('0x3a')]?_0x34c2aa[_0x48fe('0x38')]:_0x317af0['model'];if(!_0x47f25c['query']['hasOwnProperty'](_0x48fe('0x3b'))){_0x34c2aa[_0x48fe('0x1f')]=qs[_0x48fe('0x1f')](_0x47f25c['query'][_0x48fe('0x1f')]);_0x34c2aa[_0x48fe('0x1d')]=qs[_0x48fe('0x1d')](_0x47f25c[_0x48fe('0x34')][_0x48fe('0x1d')]);}_0x34c2aa[_0x48fe('0x3c')]=qs[_0x48fe('0x3d')](_0x47f25c[_0x48fe('0x34')][_0x48fe('0x3d')]);_0x34c2aa[_0x48fe('0x3e')]=qs[_0x48fe('0x36')](_[_0x48fe('0x3f')](_0x47f25c[_0x48fe('0x34')],_0x317af0['filters']),_0x2e1f71);if(_0x47f25c[_0x48fe('0x34')][_0x48fe('0x40')]){_0x34c2aa['where']=_[_0x48fe('0x41')](_0x34c2aa['where'],{'$or':_[_0x48fe('0x2d')](_0x2e1f71,function(_0x593a53){if(_0x593a53['type']!==_0x48fe('0x42')){var _0x3e04a0={};_0x3e04a0[_0x593a53[_0x48fe('0x2a')]]={'$like':'%'+_0x47f25c[_0x48fe('0x34')]['filter']+'%'};return _0x3e04a0;}})});}_0x34c2aa=_[_0x48fe('0x41')]({},_0x34c2aa,_0x47f25c[_0x48fe('0x43')]);var _0x15c6f1={'where':_0x34c2aa[_0x48fe('0x3e')]};return db[_0x48fe('0x2e')][_0x48fe('0x20')](_0x15c6f1)[_0x48fe('0x26')](function(_0xacc0ac){_0x44682d['count']=_0xacc0ac;if(_0x47f25c['query'][_0x48fe('0x44')]){_0x34c2aa[_0x48fe('0x45')]=[{'all':!![]}];}return db[_0x48fe('0x2e')][_0x48fe('0x46')](_0x34c2aa);})[_0x48fe('0x26')](function(_0x46db8a){_0x44682d[_0x48fe('0x47')]=_0x46db8a;return _0x44682d;})[_0x48fe('0x26')](respondWithFilteredResult(_0x7d28fc,_0x34c2aa))[_0x48fe('0x48')](handleError(_0x7d28fc,null));};exports[_0x48fe('0x49')]=function(_0xa14edb,_0x2f1930){var _0x3b5072={'raw':!![],'where':{'id':_0xa14edb[_0x48fe('0x4a')]['id']}},_0xf72217={};_0xf72217[_0x48fe('0x33')]=_[_0x48fe('0x35')](db[_0x48fe('0x2e')][_0x48fe('0x2f')]);_0xf72217[_0x48fe('0x34')]=_['keys'](_0xa14edb[_0x48fe('0x34')]);_0xf72217[_0x48fe('0x36')]=_['intersection'](_0xf72217[_0x48fe('0x33')],_0xf72217['query']);_0x3b5072['attributes']=_['intersection'](_0xf72217[_0x48fe('0x33')],qs[_0x48fe('0x39')](_0xa14edb['query'][_0x48fe('0x39')]));_0x3b5072[_0x48fe('0x38')]=_0x3b5072[_0x48fe('0x38')][_0x48fe('0x3a')]?_0x3b5072[_0x48fe('0x38')]:_0xf72217['model'];if(_0xa14edb[_0x48fe('0x34')][_0x48fe('0x44')]){_0x3b5072[_0x48fe('0x45')]=[{'all':!![]}];}_0x3b5072=_[_0x48fe('0x41')]({},_0x3b5072,_0xa14edb[_0x48fe('0x43')]);return db[_0x48fe('0x2e')]['find'](_0x3b5072)[_0x48fe('0x26')](handleEntityNotFound(_0x2f1930,null))['then'](respondWithResult(_0x2f1930,null))[_0x48fe('0x48')](handleError(_0x2f1930,null));};exports[_0x48fe('0x4b')]=function(_0x1641c7,_0x136c9e){return db[_0x48fe('0x2e')]['create'](_0x1641c7[_0x48fe('0x4c')],{})[_0x48fe('0x26')](respondWithResult(_0x136c9e,0xc9))[_0x48fe('0x48')](handleError(_0x136c9e,null));};exports[_0x48fe('0x4d')]=function(_0x4c6aa3,_0xd001f1){if(_0x4c6aa3[_0x48fe('0x4c')]['id']){delete _0x4c6aa3[_0x48fe('0x4c')]['id'];}return db[_0x48fe('0x2e')][_0x48fe('0x4e')]({'where':{'id':_0x4c6aa3[_0x48fe('0x4a')]['id']}})[_0x48fe('0x26')](handleEntityNotFound(_0xd001f1,null))['then'](saveUpdates(_0x4c6aa3[_0x48fe('0x4c')],null))['then'](respondWithResult(_0xd001f1,null))[_0x48fe('0x48')](handleError(_0xd001f1,null));};exports[_0x48fe('0x4f')]=function(_0x147638,_0x218303){return db[_0x48fe('0x2e')]['find']({'where':{'id':_0x147638[_0x48fe('0x4a')]['id']}})['then'](handleEntityNotFound(_0x218303,null))[_0x48fe('0x26')](removeEntity(_0x218303,null))[_0x48fe('0x48')](handleError(_0x218303,null));};exports[_0x48fe('0x50')]=function(_0x1aeffe,_0x3c0515){return db[_0x48fe('0x2e')][_0x48fe('0x50')]()[_0x48fe('0x26')](respondWithResult(_0x3c0515,null))[_0x48fe('0x48')](handleError(_0x3c0515,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 9a0284c..29b6b5f 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 _0xee49=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xee49,0x1ca));var _0x9ee4=function(_0x11bef7,_0x35cfa2){_0x11bef7=_0x11bef7-0x0;var _0x516854=_0xee49[_0x11bef7];return _0x516854;};'use strict';var _=require(_0x9ee4('0x0'));var util=require(_0x9ee4('0x1'));var logger=require(_0x9ee4('0x2'))(_0x9ee4('0x3'));var moment=require(_0x9ee4('0x4'));var BPromise=require(_0x9ee4('0x5'));var rp=require(_0x9ee4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ee4('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x9ee4('0x8')]=function(_0x4a0e3d,_0x4e3185){return _0x4a0e3d[_0x9ee4('0x9')](_0x9ee4('0xa'),attributes,{'tableName':_0x9ee4('0xb'),'paranoid':![],'indexes':[{'name':_0x9ee4('0xc'),'fields':[_0x9ee4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b87=['request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','moment','bluebird'];(function(_0x6c95c5,_0x39cce5){var _0x955260=function(_0x399b79){while(--_0x399b79){_0x6c95c5['push'](_0x6c95c5['shift']());}};_0x955260(++_0x39cce5);}(_0x8b87,0x1c9));var _0x78b8=function(_0x44e281,_0x160249){_0x44e281=_0x44e281-0x0;var _0x1a83da=_0x8b87[_0x44e281];return _0x1a83da;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x78b8('0x0'));var BPromise=require(_0x78b8('0x1'));var rp=require(_0x78b8('0x2'));var fs=require('fs');var path=require(_0x78b8('0x3'));var rimraf=require('rimraf');var config=require(_0x78b8('0x4'));var attributes=require(_0x78b8('0x5'));module[_0x78b8('0x6')]=function(_0x18c219,_0x316811){return _0x18c219['define'](_0x78b8('0x7'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x78b8('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index d745157..640fd2e 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 _0xf008=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5dd5ba,_0x3f14ca){var _0x929129=function(_0x459d45){while(--_0x459d45){_0x5dd5ba['push'](_0x5dd5ba['shift']());}};_0x929129(++_0x3f14ca);}(_0xf008,0xba));var _0x8f00=function(_0x325ffc,_0x6914a7){_0x325ffc=_0x325ffc-0x0;var _0x34324a=_0xf008[_0x325ffc];return _0x34324a;};'use strict';var _=require(_0x8f00('0x0'));var util=require(_0x8f00('0x1'));var moment=require(_0x8f00('0x2'));var BPromise=require(_0x8f00('0x3'));var rs=require(_0x8f00('0x4'));var fs=require('fs');var Redis=require(_0x8f00('0x5'));var db=require(_0x8f00('0x6'))['db'];var utils=require(_0x8f00('0x7'));var logger=require('../../config/logger')(_0x8f00('0x8'));var config=require(_0x8f00('0x9'));var jayson=require(_0x8f00('0xa'));var client=jayson[_0x8f00('0xb')][_0x8f00('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x380e32,_0x3323cd,_0x471fd9){return new BPromise(function(_0x4172f9,_0x5924a6){return client[_0x8f00('0xd')](_0x380e32,_0x471fd9)[_0x8f00('0xe')](function(_0xa00130){logger[_0x8f00('0xf')](_0x8f00('0x10'),_0x3323cd,_0x8f00('0x11'));logger[_0x8f00('0x12')](_0x8f00('0x13'),_0x3323cd,_0x8f00('0x11'),JSON[_0x8f00('0x14')](_0xa00130));if(_0xa00130['error']){if(_0xa00130[_0x8f00('0x15')][_0x8f00('0x16')]===0x1f4){logger[_0x8f00('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x3323cd,_0xa00130['error'][_0x8f00('0x17')]);return _0x5924a6(_0xa00130[_0x8f00('0x15')][_0x8f00('0x17')]);}logger[_0x8f00('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x3323cd,_0xa00130[_0x8f00('0x15')][_0x8f00('0x17')]);return _0x4172f9(_0xa00130['error']['message']);}else{logger[_0x8f00('0xf')](_0x8f00('0x10'),_0x3323cd,_0x8f00('0x11'));_0x4172f9(_0xa00130[_0x8f00('0x18')]['message']);}})[_0x8f00('0x19')](function(_0x55e4a6){logger[_0x8f00('0x15')](_0x8f00('0x10'),_0x3323cd,_0x55e4a6);_0x5924a6(_0x55e4a6);});});} \ No newline at end of file +var _0x5fc2=['code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5fc2,0x88));var _0x25fc=function(_0x237c45,_0x55cf99){_0x237c45=_0x237c45-0x0;var _0x2942f6=_0x5fc2[_0x237c45];return _0x2942f6;};'use strict';var _=require('lodash');var util=require(_0x25fc('0x0'));var moment=require(_0x25fc('0x1'));var BPromise=require(_0x25fc('0x2'));var rs=require(_0x25fc('0x3'));var fs=require('fs');var Redis=require(_0x25fc('0x4'));var db=require(_0x25fc('0x5'))['db'];var utils=require(_0x25fc('0x6'));var logger=require(_0x25fc('0x7'))('rpc');var config=require(_0x25fc('0x8'));var jayson=require(_0x25fc('0x9'));var client=jayson['client'][_0x25fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40ddde,_0x3d7b80,_0x47a3be){return new BPromise(function(_0x34531b,_0x5071a8){return client[_0x25fc('0xb')](_0x40ddde,_0x47a3be)[_0x25fc('0xc')](function(_0x4d17f1){logger[_0x25fc('0xd')](_0x25fc('0xe'),_0x3d7b80,'request\x20sent');logger[_0x25fc('0xf')](_0x25fc('0x10'),_0x3d7b80,'request\x20sent',JSON['stringify'](_0x4d17f1));if(_0x4d17f1[_0x25fc('0x11')]){if(_0x4d17f1[_0x25fc('0x11')][_0x25fc('0x12')]===0x1f4){logger[_0x25fc('0x11')](_0x25fc('0xe'),_0x3d7b80,_0x4d17f1[_0x25fc('0x11')][_0x25fc('0x13')]);return _0x5071a8(_0x4d17f1[_0x25fc('0x11')][_0x25fc('0x13')]);}logger[_0x25fc('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3d7b80,_0x4d17f1['error']['message']);return _0x34531b(_0x4d17f1['error'][_0x25fc('0x13')]);}else{logger[_0x25fc('0xd')](_0x25fc('0xe'),_0x3d7b80,_0x25fc('0x14'));_0x34531b(_0x4d17f1['result'][_0x25fc('0x13')]);}})[_0x25fc('0x15')](function(_0x3ee13d){logger[_0x25fc('0x11')](_0x25fc('0xe'),_0x3d7b80,_0x3ee13d);_0x5071a8(_0x3ee13d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index e928e31..89a8be5 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 _0x7a21=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x41b2bb,_0x4324e3){var _0x7e369b=function(_0x39d9e6){while(--_0x39d9e6){_0x41b2bb['push'](_0x41b2bb['shift']());}};_0x7e369b(++_0x4324e3);}(_0x7a21,0x1d6));var _0x17a2=function(_0x317489,_0x4a8108){_0x317489=_0x317489-0x0;var _0x169ab9=_0x7a21[_0x317489];return _0x169ab9;};'use strict';var multer=require(_0x17a2('0x0'));var util=require('util');var path=require(_0x17a2('0x1'));var timeout=require(_0x17a2('0x2'));var express=require(_0x17a2('0x3'));var router=express[_0x17a2('0x4')]();var fs_extra=require(_0x17a2('0x5'));var auth=require(_0x17a2('0x6'));var interaction=require(_0x17a2('0x7'));var config=require('../../config/environment');var controller=require(_0x17a2('0x8'));router['get']('/',auth[_0x17a2('0x9')](),controller[_0x17a2('0xa')]);router[_0x17a2('0xb')](_0x17a2('0xc'),auth[_0x17a2('0x9')](),controller['describe']);router['get'](_0x17a2('0xd'),auth[_0x17a2('0x9')](),controller[_0x17a2('0xe')]);router[_0x17a2('0xf')]('/',auth[_0x17a2('0x9')](),controller[_0x17a2('0x10')]);router[_0x17a2('0x11')](_0x17a2('0xd'),auth[_0x17a2('0x9')](),controller[_0x17a2('0x12')]);router[_0x17a2('0x13')]('/:id',auth[_0x17a2('0x9')](),controller[_0x17a2('0x14')]);module[_0x17a2('0x15')]=router; \ No newline at end of file +var _0xd17a=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','put','/:id','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x52cdf7,_0x31532e){var _0x2eb782=function(_0x2a8288){while(--_0x2a8288){_0x52cdf7['push'](_0x52cdf7['shift']());}};_0x2eb782(++_0x31532e);}(_0xd17a,0x1f3));var _0xad17=function(_0x44d9e8,_0x2f0bc2){_0x44d9e8=_0x44d9e8-0x0;var _0x64816e=_0xd17a[_0x44d9e8];return _0x64816e;};'use strict';var multer=require(_0xad17('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xad17('0x1'));var express=require(_0xad17('0x2'));var router=express['Router']();var fs_extra=require(_0xad17('0x3'));var auth=require(_0xad17('0x4'));var interaction=require(_0xad17('0x5'));var config=require(_0xad17('0x6'));var controller=require(_0xad17('0x7'));router[_0xad17('0x8')]('/',auth[_0xad17('0x9')](),controller[_0xad17('0xa')]);router[_0xad17('0x8')](_0xad17('0xb'),auth['isAuthenticated'](),controller[_0xad17('0xc')]);router[_0xad17('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xad17('0xd')]('/',auth[_0xad17('0x9')](),controller['create']);router[_0xad17('0xe')](_0xad17('0xf'),auth[_0xad17('0x9')](),controller['update']);router['delete'](_0xad17('0xf'),auth[_0xad17('0x9')](),controller[_0xad17('0x10')]);module[_0xad17('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 7c48298..8da8b73 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 _0x7932=['STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Feedback','thumb','star','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','parse','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','exports'];(function(_0x3e6901,_0x352dab){var _0xf04c26=function(_0x5c931c){while(--_0x5c931c){_0x3e6901['push'](_0x3e6901['shift']());}};_0xf04c26(++_0x352dab);}(_0x7932,0x14e));var _0x2793=function(_0xca2d0c,_0x27bcce){_0xca2d0c=_0xca2d0c-0x0;var _0x221fa8=_0x7932[_0xca2d0c];return _0x221fa8;};'use strict';var Sequelize=require(_0x2793('0x0'));var rs=require('randomstring');module[_0x2793('0x1')]={'name':{'type':Sequelize[_0x2793('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'unique':_0x2793('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x4')},'mapKeyOffline':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x4')},'key':{'type':Sequelize[_0x2793('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':_0x2793('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':_0x2793('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2793('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2793('0x2')]},'animation':{'type':Sequelize[_0x2793('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2793('0xa')](_0x2793('0xb'),_0x2793('0xc')),'defaultValue':_0x2793('0xb')},'header_online':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0xd')},'offline_chat_button':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2793('0xf')]},'closingQuestion':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x12')},'placeholderMessage':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x13')},'closingMessage':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x14')},'closingMessageButton':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x15')},'skipMessageButton':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x16')},'ratingType':{'type':Sequelize[_0x2793('0xa')]('star',_0x2793('0x17')),'defaultValue':_0x2793('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x2793('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x2793('0x19')]({'items':[{'type':_0x2793('0x1a'),'variable':null,'config':{'placeholder':_0x2793('0x1b'),'type':_0x2793('0x1c'),'required':!![]},'props':{'title':_0x2793('0x1b'),'helpText':''}},{'type':_0x2793('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2793('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2793('0x1d')](_0x2793('0x1e'))?JSON['parse'](this[_0x2793('0x1d')](_0x2793('0x1e'))):{};},'set':function(_0xdcc759){return this[_0x2793('0x1f')](_0x2793('0x1e'),JSON[_0x2793('0x19')](_0xdcc759));}},'offlineForm':{'type':Sequelize[_0x2793('0xf')],'defaultValue':function(){return JSON[_0x2793('0x19')]({'items':[{'type':_0x2793('0x1a'),'props':{'title':_0x2793('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2793('0x4'),'type':_0x2793('0x4')},'variable':null},{'type':_0x2793('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0x2793('0x21'),'helpText':_0x2793('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x2793('0x1d')]('offlineForm')?JSON[_0x2793('0x23')](this[_0x2793('0x1d')]('offlineForm')):{};},'set':function(_0x7026b){return this[_0x2793('0x1f')]('offlineForm',JSON[_0x2793('0x19')](_0x7026b));}},'token':{'type':Sequelize[_0x2793('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2793('0x2')]},'forwardOffline':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2793('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x25')},'offlineMessageBody':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x2793('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x27')},'skipUnmanaged':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2793('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2793('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2793('0xf')],'defaultValue':function(){return _0x2793('0x28');}},'notificationSound':{'type':Sequelize[_0x2793('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2793('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2793('0x2')],'defaultValue':_0x2793('0x2a')},'verticalAlignment':{'type':Sequelize[_0x2793('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x2793('0x2')]},'customerAvatar':{'type':Sequelize[_0x2793('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2793('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2793('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2793('0x2b')},'systemAvatar':{'type':Sequelize[_0x2793('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2793('0x8')],'comment':_0x2793('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2793('0x2d'),'set':function(_0x41290f){if(!_0x41290f)this[_0x2793('0x1f')](_0x2793('0x2e'),null);this[_0x2793('0x1f')]('mandatoryDisposition',_0x41290f);}},'vidaooEscalation':{'type':Sequelize[_0x2793('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2793('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2793('0x2')],'allowNull':![],'defaultValue':_0x2793('0x2f')},'vidaooNote':{'type':Sequelize[_0x2793('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x2793('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2793('0xf')]}}; \ No newline at end of file +var _0xfc42=['ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','TEXT','stringify','input','name','text','getDataValue','parse','onlineForm','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x195e54,_0x1553ea){var _0x45abab=function(_0x5049b4){while(--_0x5049b4){_0x195e54['push'](_0x195e54['shift']());}};_0x45abab(++_0x1553ea);}(_0xfc42,0xf6));var _0x2fc4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc42[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x2fc4('0x0'));var rs=require(_0x2fc4('0x1'));module[_0x2fc4('0x2')]={'name':{'type':Sequelize[_0x2fc4('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x2fc4('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x2fc4('0x3')]},'mapKey':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x4')},'mapKeyOffline':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2fc4('0x5')},'customerAlias':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2fc4('0x3')],'allowNull':![],'defaultValue':_0x2fc4('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2fc4('0x3')],'allowNull':![],'defaultValue':_0x2fc4('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2fc4('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2fc4('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2fc4('0x9')]('rounded',_0x2fc4('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0xb')},'start_chat_button':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0xc')},'offline_chat_button':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0xd')},'header_offline':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0xe')},'download_transcript':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2fc4('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x11')},'noteTitle':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x12')},'placeholderMessage':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2fc4('0x14')},'closingMessageButton':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0xd')},'skipMessageButton':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x2fc4('0x9')](_0x2fc4('0x15'),_0x2fc4('0x16')),'defaultValue':_0x2fc4('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x2fc4('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2fc4('0x17')],'defaultValue':function(){return JSON[_0x2fc4('0x18')]({'items':[{'type':_0x2fc4('0x19'),'variable':null,'config':{'placeholder':_0x2fc4('0x1a'),'type':_0x2fc4('0x1b'),'required':!![]},'props':{'title':_0x2fc4('0x1a'),'helpText':''}},{'type':_0x2fc4('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2fc4('0x4'),'type':_0x2fc4('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2fc4('0x1c')]('onlineForm')?JSON[_0x2fc4('0x1d')](this[_0x2fc4('0x1c')](_0x2fc4('0x1e'))):{};},'set':function(_0x4ded39){return this['setDataValue'](_0x2fc4('0x1e'),JSON[_0x2fc4('0x18')](_0x4ded39));}},'offlineForm':{'type':Sequelize[_0x2fc4('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x2fc4('0x19'),'props':{'title':_0x2fc4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2fc4('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x2fc4('0x1f')},'props':{'title':'Comments','helpText':_0x2fc4('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x2fc4('0x1c')]('offlineForm')?JSON[_0x2fc4('0x1d')](this[_0x2fc4('0x1c')](_0x2fc4('0x21'))):{};},'set':function(_0xe9309b){return this[_0x2fc4('0x22')](_0x2fc4('0x21'),JSON[_0x2fc4('0x18')](_0xe9309b));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2fc4('0x23')]();}},'autoclose':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2fc4('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2fc4('0x3')]},'waitingTitle':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x2fc4('0x24')},'offlineMessageBody':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x26')},'skipUnmanaged':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2fc4('0x17')]},'showAgentAvatar':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2fc4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2fc4('0x17')],'defaultValue':function(){return _0x2fc4('0x27');}},'notificationSound':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2fc4('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2fc4('0x3')],'defaultValue':_0x2fc4('0x29')},'verticalAlignment':{'type':Sequelize[_0x2fc4('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2fc4('0x2a')},'defaultTitle':{'type':Sequelize[_0x2fc4('0x3')]},'customerAvatar':{'type':Sequelize[_0x2fc4('0x17')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2fc4('0x3')],'allowNull':![],'defaultValue':_0x2fc4('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2fc4('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2fc4('0x2c')},'systemAvatar':{'type':Sequelize[_0x2fc4('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2fc4('0x8')],'comment':_0x2fc4('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2fc4('0x2e'),'set':function(_0x22ed5f){if(!_0x22ed5f)this['setDataValue'](_0x2fc4('0x2f'),null);this['setDataValue'](_0x2fc4('0x30'),_0x22ed5f);}},'vidaooEscalation':{'type':Sequelize[_0x2fc4('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x2fc4('0x3')],'allowNull':![],'defaultValue':_0x2fc4('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x2fc4('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x2fc4('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2fc4('0x17')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ceabed7..131f2dd 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 _0x3343=['intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','Pause','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','params','Disposition','findOne','hasOwnProperty','ChatWebsiteId','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','createdAt','difference','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','List','ChatApplication','Applications','account','applications','orderBy','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','files','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','rows','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','getProactiveActions','virtual','License','increment','Intervals','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','get','ChatWebsites','name','send','index','mandatoryDispositionPause','ChatWebsite','fieldName','type','key','model','map','query','keys','filters'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x3343,0xf0));var _0x3334=function(_0x174e6b,_0x124a26){_0x174e6b=_0x174e6b-0x0;var _0x10ab0e=_0x3343[_0x174e6b];return _0x10ab0e;};'use strict';var emlformat=require(_0x3334('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3334('0x1'));var jsonpatch=require(_0x3334('0x2'));var rp=require(_0x3334('0x3'));var moment=require('moment');var BPromise=require(_0x3334('0x4'));var Mustache=require(_0x3334('0x5'));var util=require(_0x3334('0x6'));var path=require('path');var sox=require(_0x3334('0x7'));var csv=require(_0x3334('0x8'));var ejs=require(_0x3334('0x9'));var fs=require('fs');var fs_extra=require(_0x3334('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3334('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3334('0xc'));var Papa=require(_0x3334('0xd'));var Redis=require(_0x3334('0xe'));var authService=require(_0x3334('0xf'));var qs=require(_0x3334('0x10'));var as=require(_0x3334('0x11'));var hardwareService=require(_0x3334('0x12'));var logger=require(_0x3334('0x13'))(_0x3334('0x14'));var utils=require(_0x3334('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3334('0x16'));var db=require('../../mysqldb')['db'];config[_0x3334('0x17')]=_[_0x3334('0x18')](config[_0x3334('0x17')],{'host':_0x3334('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3334('0x17')]));require('./chatWebsite.socket')[_0x3334('0x1a')](socket);var jayson=require(_0x3334('0x1b'));var client=jayson[_0x3334('0x1c')][_0x3334('0x1d')]({'port':0x232c});var client9002=jayson[_0x3334('0x1c')][_0x3334('0x1d')]({'port':0x232a});var client9003=jayson[_0x3334('0x1c')]['http']({'port':0x232b});var client9001=jayson[_0x3334('0x1c')][_0x3334('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x1ce163,_0x519947,_0x147246,_0x27bf79){return new BPromise(function(_0x52836e,_0x1b991a){var _0x14d23d=_0x27bf79||client;return _0x14d23d['request'](_0x1ce163,_0x147246)[_0x3334('0x1e')](function(_0x53ecc9){logger[_0x3334('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x519947,_0x3334('0x20'));logger['debug'](_0x3334('0x21'),_0x519947,_0x3334('0x20'),JSON[_0x3334('0x22')](_0x53ecc9));if(_0x53ecc9[_0x3334('0x23')]){if(_0x53ecc9['error'][_0x3334('0x24')]===0x1f4){logger['error'](_0x3334('0x25'),_0x519947,_0x53ecc9['error'][_0x3334('0x26')]);return _0x1b991a(_0x53ecc9[_0x3334('0x23')]['message']);}logger[_0x3334('0x23')](_0x3334('0x25'),_0x519947,_0x53ecc9['error'][_0x3334('0x26')]);return _0x52836e(_0x53ecc9[_0x3334('0x23')]['message']);}else{logger['info'](_0x3334('0x25'),_0x519947,'request\x20sent');_0x52836e(_0x53ecc9[_0x3334('0x27')][_0x3334('0x26')]);}})[_0x3334('0x28')](function(_0x5a98f1){logger[_0x3334('0x23')](_0x3334('0x25'),_0x519947,_0x5a98f1);_0x1b991a(_0x5a98f1);});});}function respondWithStatusCode(_0x21b64f,_0x8dfc65){_0x8dfc65=_0x8dfc65||0xcc;return function(_0xfa3029){if(_0xfa3029){return _0x21b64f[_0x3334('0x29')](_0x8dfc65);}return _0x21b64f[_0x3334('0x2a')](_0x8dfc65)[_0x3334('0x2b')]();};}function respondWithResult(_0x430b64,_0x53689a){_0x53689a=_0x53689a||0xc8;return function(_0x5c1105){if(_0x5c1105){return _0x430b64[_0x3334('0x2a')](_0x53689a)[_0x3334('0x2c')](_0x5c1105);}};}function respondWithFilteredResult(_0x3943b1,_0x53c922){return function(_0x4c2bcc){if(_0x4c2bcc){var _0x4d8ae6=typeof _0x53c922[_0x3334('0x2d')]==='undefined'&&typeof _0x53c922['limit']===_0x3334('0x2e');var _0x447c35=_0x4c2bcc[_0x3334('0x2f')];var _0x2eda3f=_0x4d8ae6?0x0:_0x53c922[_0x3334('0x2d')];var _0x2a6ba4=_0x4d8ae6?_0x4c2bcc[_0x3334('0x2f')]:_0x53c922['offset']+_0x53c922[_0x3334('0x30')];var _0x2df606;if(_0x2a6ba4>=_0x447c35){_0x2a6ba4=_0x447c35;_0x2df606=0xc8;}else{_0x2df606=0xce;}_0x3943b1[_0x3334('0x2a')](_0x2df606);return _0x3943b1[_0x3334('0x31')]('Content-Range',_0x2eda3f+'-'+_0x2a6ba4+'/'+_0x447c35)[_0x3334('0x2c')](_0x4c2bcc);}return null;};}function patchUpdates(_0x36b13d){return function(_0x253b32){try{jsonpatch[_0x3334('0x32')](_0x253b32,_0x36b13d,!![]);}catch(_0x3d48cc){return BPromise[_0x3334('0x33')](_0x3d48cc);}return _0x253b32[_0x3334('0x34')]();};}function saveUpdates(_0xbf9831,_0x389170){return function(_0x31ae02){if(_0x31ae02){return _0x31ae02[_0x3334('0x35')](_0xbf9831)[_0x3334('0x1e')](function(_0x4bed61){return _0x4bed61;});}return null;};}function removeEntity(_0x86ee8d,_0x7fecf2){return function(_0x5469a5){if(_0x5469a5){return _0x5469a5['destroy']()[_0x3334('0x1e')](function(){var _0x40d66f=_0x5469a5[_0x3334('0x36')]({'plain':!![]});var _0x1945c7=_0x3334('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x1945c7,'resourceId':_0x40d66f['id']}})[_0x3334('0x1e')](function(){return _0x5469a5;});})[_0x3334('0x1e')](function(){_0x86ee8d[_0x3334('0x2a')](0xcc)[_0x3334('0x2b')]();});}};}function handleEntityNotFound(_0x156167,_0x8d53d3){return function(_0xf26dd2){if(!_0xf26dd2){_0x156167[_0x3334('0x29')](0x194);}return _0xf26dd2;};}function handleError(_0x1db722,_0x3dcd11){_0x3dcd11=_0x3dcd11||0x1f4;return function(_0x47977d){logger['error'](_0x47977d['stack']);if(_0x47977d[_0x3334('0x38')]){delete _0x47977d[_0x3334('0x38')];}_0x1db722[_0x3334('0x2a')](_0x3dcd11)[_0x3334('0x39')](_0x47977d);};}exports[_0x3334('0x3a')]=function(_0x5e356c,_0x209add){var _0x2919be={'include':[{'model':db['Pause'],'as':_0x3334('0x3b')}]},_0x56918e={},_0x29167b={'count':0x0,'rows':[]};var _0x3a8df1=_['map'](db[_0x3334('0x3c')]['rawAttributes'],function(_0x38a97f){return{'name':_0x38a97f[_0x3334('0x3d')],'type':_0x38a97f[_0x3334('0x3e')][_0x3334('0x3f')]};});_0x56918e[_0x3334('0x40')]=_[_0x3334('0x41')](_0x3a8df1,'name');_0x56918e[_0x3334('0x42')]=_[_0x3334('0x43')](_0x5e356c[_0x3334('0x42')]);_0x56918e[_0x3334('0x44')]=_[_0x3334('0x45')](_0x56918e[_0x3334('0x40')],_0x56918e[_0x3334('0x42')]);_0x2919be[_0x3334('0x46')]=_['intersection'](_0x56918e[_0x3334('0x40')],qs[_0x3334('0x47')](_0x5e356c[_0x3334('0x42')]['fields']));_0x2919be[_0x3334('0x46')]=_0x2919be[_0x3334('0x46')][_0x3334('0x48')]?_0x2919be[_0x3334('0x46')]:_0x56918e['model'];if(!_0x5e356c[_0x3334('0x42')]['hasOwnProperty'](_0x3334('0x49'))){_0x2919be[_0x3334('0x30')]=qs['limit'](_0x5e356c['query'][_0x3334('0x30')]);_0x2919be[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x5e356c[_0x3334('0x42')][_0x3334('0x2d')]);}_0x2919be[_0x3334('0x4a')]=qs[_0x3334('0x4b')](_0x5e356c['query'][_0x3334('0x4b')]);_0x2919be[_0x3334('0x4c')]=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x5e356c[_0x3334('0x42')],_0x56918e['filters']),_0x3a8df1);if(_0x5e356c[_0x3334('0x42')][_0x3334('0x4e')]){_0x2919be['where']=_[_0x3334('0x4f')](_0x2919be['where'],{'$or':_[_0x3334('0x41')](_0x3a8df1,function(_0x35b63b){if(_0x35b63b[_0x3334('0x3e')]!==_0x3334('0x50')){var _0x4a00d0={};_0x4a00d0[_0x35b63b[_0x3334('0x38')]]={'$like':'%'+_0x5e356c[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0x4a00d0;}})});}_0x2919be=_[_0x3334('0x4f')]({},_0x2919be,_0x5e356c[_0x3334('0x51')]);var _0x4518cd={'where':_0x2919be[_0x3334('0x4c')]};return db['ChatWebsite'][_0x3334('0x2f')](_0x4518cd)[_0x3334('0x1e')](function(_0x591a7d){_0x29167b[_0x3334('0x2f')]=_0x591a7d;if(_0x5e356c[_0x3334('0x42')][_0x3334('0x52')]){_0x2919be[_0x3334('0x53')]=[{'all':!![]}];}return db[_0x3334('0x3c')][_0x3334('0x54')](_0x2919be);})['then'](function(_0x10a931){_0x29167b['rows']=_0x10a931;return _0x29167b;})[_0x3334('0x1e')](respondWithFilteredResult(_0x209add,_0x2919be))[_0x3334('0x28')](handleError(_0x209add,null));};exports['show']=function(_0x5e7e73,_0x646834){var _0x3997ed={'raw':![],'where':{'id':_0x5e7e73['params']['id']},'include':[{'model':db[_0x3334('0x55')],'as':'mandatoryDispositionPause'}]},_0x1d80ef={};_0x1d80ef['model']=_[_0x3334('0x43')](db[_0x3334('0x3c')][_0x3334('0x56')]);_0x1d80ef['query']=_['keys'](_0x5e7e73['query']);_0x1d80ef[_0x3334('0x44')]=_['intersection'](_0x1d80ef['model'],_0x1d80ef[_0x3334('0x42')]);_0x3997ed['attributes']=_[_0x3334('0x45')](_0x1d80ef['model'],qs[_0x3334('0x47')](_0x5e7e73[_0x3334('0x42')][_0x3334('0x47')]));_0x3997ed[_0x3334('0x46')]=_0x3997ed['attributes'][_0x3334('0x48')]?_0x3997ed['attributes']:_0x1d80ef[_0x3334('0x40')];if(_0x5e7e73[_0x3334('0x42')][_0x3334('0x52')]){_0x3997ed[_0x3334('0x53')]=[{'all':!![]}];}_0x3997ed=_[_0x3334('0x4f')]({},_0x3997ed,_0x5e7e73[_0x3334('0x51')]);return db[_0x3334('0x3c')]['find'](_0x3997ed)[_0x3334('0x1e')](handleEntityNotFound(_0x646834,null))['then'](respondWithResult(_0x646834,null))[_0x3334('0x28')](handleError(_0x646834,null));};exports[_0x3334('0x57')]=function(_0x451c54,_0x47ab00){return db[_0x3334('0x3c')]['create'](_0x451c54[_0x3334('0x58')],{})[_0x3334('0x1e')](function(_0x434301){var _0x2667dc=_0x451c54[_0x3334('0x59')][_0x3334('0x36')]({'plain':!![]});if(!_0x2667dc)throw new Error(_0x3334('0x5a'));if(_0x2667dc[_0x3334('0x5b')]===_0x3334('0x59')){var _0xfe4e8=_0x434301['get']({'plain':!![]});var _0x17ee34=_0x3334('0x37');return db[_0x3334('0x5c')][_0x3334('0x5d')]({'where':{'name':_0x17ee34,'userProfileId':_0x2667dc[_0x3334('0x5e')]},'raw':!![]})[_0x3334('0x1e')](function(_0xb9a24f){if(_0xb9a24f&&_0xb9a24f[_0x3334('0x5f')]===0x0){return db[_0x3334('0x60')]['create']({'name':_0xfe4e8[_0x3334('0x38')],'resourceId':_0xfe4e8['id'],'type':_0xb9a24f[_0x3334('0x38')],'sectionId':_0xb9a24f['id']},{})['then'](function(){return _0x434301;});}else{return _0x434301;}})['catch'](function(_0x5e89fb){logger[_0x3334('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e89fb);throw _0x5e89fb;});}return _0x434301;})[_0x3334('0x1e')](respondWithResult(_0x47ab00,0xc9))[_0x3334('0x28')](handleError(_0x47ab00,null));};exports['update']=function(_0x155989,_0xd7885d){if(_0x155989['body']['id']){delete _0x155989['body']['id'];}return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x155989['params']['id']},'include':[{'model':db[_0x3334('0x55')],'as':_0x3334('0x3b')}]})[_0x3334('0x1e')](handleEntityNotFound(_0xd7885d,null))[_0x3334('0x1e')](saveUpdates(_0x155989[_0x3334('0x58')],null))[_0x3334('0x1e')](respondWithResult(_0xd7885d,null))[_0x3334('0x28')](handleError(_0xd7885d,null));};exports['destroy']=function(_0x36e8c2,_0x10d833){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x36e8c2['params']['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x10d833,null))[_0x3334('0x1e')](removeEntity(_0x10d833,null))['catch'](handleError(_0x10d833,null));};exports[_0x3334('0x61')]=function(_0x572cdd,_0x218fea){return db[_0x3334('0x3c')][_0x3334('0x61')]()[_0x3334('0x1e')](respondWithResult(_0x218fea,null))[_0x3334('0x28')](handleError(_0x218fea,null));};exports[_0x3334('0x62')]=function(_0x5dc5b2,_0x5cd9d5,_0x408ca9){if(_0x5dc5b2['body']['id']){delete _0x5dc5b2['body']['id'];}return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x5dc5b2[_0x3334('0x63')]['id']}})['then'](handleEntityNotFound(_0x5cd9d5,null))['then'](function(_0x5038db){if(_0x5038db){_0x5dc5b2[_0x3334('0x58')]['ChatWebsiteId']=_0x5038db['id'];return db[_0x3334('0x64')][_0x3334('0x57')](_0x5dc5b2[_0x3334('0x58')]);}})[_0x3334('0x1e')](respondWithResult(_0x5cd9d5,null))[_0x3334('0x28')](handleError(_0x5cd9d5,null));};exports['getDispositions']=function(_0x435052,_0x12b2f1,_0x495964){var _0xf1784c={'raw':![],'where':{}};var _0x212696={};var _0x392070={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3334('0x65')]({'where':{'id':_0x435052[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x12b2f1,null))[_0x3334('0x1e')](function(_0x4f6f4b){if(_0x4f6f4b){_0x212696[_0x3334('0x40')]=_[_0x3334('0x43')](db['Disposition'][_0x3334('0x56')]);_0x212696[_0x3334('0x42')]=_['keys'](_0x435052['query']);_0x212696[_0x3334('0x44')]=_[_0x3334('0x45')](_0x212696[_0x3334('0x40')],_0x212696['query']);_0xf1784c['attributes']=_[_0x3334('0x45')](_0x212696[_0x3334('0x40')],qs[_0x3334('0x47')](_0x435052[_0x3334('0x42')]['fields']));_0xf1784c['attributes']=_0xf1784c[_0x3334('0x46')][_0x3334('0x48')]?_0xf1784c[_0x3334('0x46')]:_0x212696[_0x3334('0x40')];if(!_0x435052['query'][_0x3334('0x66')]('nolimit')){_0xf1784c[_0x3334('0x30')]=qs[_0x3334('0x30')](_0x435052[_0x3334('0x42')][_0x3334('0x30')]);_0xf1784c[_0x3334('0x2d')]=qs['offset'](_0x435052['query'][_0x3334('0x2d')]);}_0xf1784c[_0x3334('0x4a')]=qs['sort'](_0x435052[_0x3334('0x42')]['sort']);_0xf1784c['where']=qs[_0x3334('0x44')](_['pick'](_0x435052['query'],_0x212696[_0x3334('0x44')]));_0xf1784c[_0x3334('0x4c')][_0x3334('0x67')]=_0x4f6f4b['id'];if(_0x435052[_0x3334('0x42')]['filter']){_0xf1784c['where']=_[_0x3334('0x4f')](_0xf1784c[_0x3334('0x4c')],{'$or':_[_0x3334('0x41')](_0xf1784c[_0x3334('0x46')],function(_0x43eca1){var _0xaaaaa3={};_0xaaaaa3[_0x43eca1]={'$like':'%'+_0x435052[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0xaaaaa3;})});}_0xf1784c=_['merge']({},_0xf1784c,_0x435052[_0x3334('0x51')]);return db['Disposition'][_0x3334('0x2f')]({'where':_0xf1784c[_0x3334('0x4c')]})[_0x3334('0x1e')](function(_0x421761){_0x392070[_0x3334('0x2f')]=_0x421761;if(_0x435052[_0x3334('0x42')]['includeAll']){_0xf1784c[_0x3334('0x53')]=[{'all':!![]}];}return db[_0x3334('0x64')][_0x3334('0x54')](_0xf1784c);})['then'](function(_0x596415){_0x392070['rows']=_0x596415;return _0x392070;});}})[_0x3334('0x1e')](respondWithFilteredResult(_0x12b2f1,_0xf1784c))[_0x3334('0x28')](handleError(_0x12b2f1,null));};exports[_0x3334('0x68')]=function(_0x1b1b5c,_0xe86887,_0x3f950b){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x1b1b5c[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0xe86887,null))[_0x3334('0x1e')](function(_0x3409e6){if(_0x3409e6){return _0x3409e6[_0x3334('0x68')](_0x1b1b5c['query'][_0x3334('0x69')]);}})['then'](respondWithStatusCode(_0xe86887,null))[_0x3334('0x28')](handleError(_0xe86887,null));};exports['addAnswer']=function(_0x2e2c35,_0x46895e,_0x34af25){if(_0x2e2c35[_0x3334('0x58')]['id']){delete _0x2e2c35['body']['id'];}return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x2e2c35[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x46895e,null))[_0x3334('0x1e')](function(_0x2cbd80){if(_0x2cbd80){_0x2e2c35[_0x3334('0x58')][_0x3334('0x67')]=_0x2cbd80['id'];return db[_0x3334('0x6a')][_0x3334('0x57')](_0x2e2c35[_0x3334('0x58')]);}})[_0x3334('0x1e')](respondWithResult(_0x46895e,null))[_0x3334('0x28')](handleError(_0x46895e,null));};exports['getAnswers']=function(_0x58e853,_0x1684a5,_0xf982ea){var _0x1cf5ba={'raw':![],'where':{}};var _0x4f4d90={};var _0x408b23={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x58e853[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x1684a5,null))['then'](function(_0x240ed8){if(_0x240ed8){_0x4f4d90[_0x3334('0x40')]=_[_0x3334('0x43')](db['CannedAnswer'][_0x3334('0x56')]);_0x4f4d90[_0x3334('0x42')]=_['keys'](_0x58e853[_0x3334('0x42')]);_0x4f4d90[_0x3334('0x44')]=_[_0x3334('0x45')](_0x4f4d90[_0x3334('0x40')],_0x4f4d90[_0x3334('0x42')]);_0x1cf5ba[_0x3334('0x46')]=_[_0x3334('0x45')](_0x4f4d90[_0x3334('0x40')],qs[_0x3334('0x47')](_0x58e853[_0x3334('0x42')]['fields']));_0x1cf5ba[_0x3334('0x46')]=_0x1cf5ba[_0x3334('0x46')][_0x3334('0x48')]?_0x1cf5ba[_0x3334('0x46')]:_0x4f4d90[_0x3334('0x40')];if(!_0x58e853[_0x3334('0x42')][_0x3334('0x66')](_0x3334('0x49'))){_0x1cf5ba[_0x3334('0x30')]=qs['limit'](_0x58e853[_0x3334('0x42')]['limit']);_0x1cf5ba[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x58e853['query']['offset']);}_0x1cf5ba[_0x3334('0x4a')]=qs['sort'](_0x58e853[_0x3334('0x42')][_0x3334('0x4b')]);_0x1cf5ba[_0x3334('0x4c')]=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x58e853[_0x3334('0x42')],_0x4f4d90[_0x3334('0x44')]));_0x1cf5ba[_0x3334('0x4c')][_0x3334('0x67')]=_0x240ed8['id'];if(_0x58e853[_0x3334('0x42')]['filter']){_0x1cf5ba[_0x3334('0x4c')]=_['merge'](_0x1cf5ba[_0x3334('0x4c')],{'$or':_['map'](_0x1cf5ba[_0x3334('0x46')],function(_0xa4922f){var _0x83cbff={};_0x83cbff[_0xa4922f]={'$like':'%'+_0x58e853[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0x83cbff;})});}_0x1cf5ba=_['merge']({},_0x1cf5ba,_0x58e853['options']);return db[_0x3334('0x6a')][_0x3334('0x2f')]({'where':_0x1cf5ba[_0x3334('0x4c')]})[_0x3334('0x1e')](function(_0x14b147){_0x408b23[_0x3334('0x2f')]=_0x14b147;if(_0x58e853[_0x3334('0x42')][_0x3334('0x52')]){_0x1cf5ba['include']=[{'all':!![]}];}return db[_0x3334('0x6a')][_0x3334('0x54')](_0x1cf5ba);})['then'](function(_0x5d7244){_0x408b23['rows']=_0x5d7244;return _0x408b23;});}})[_0x3334('0x1e')](respondWithFilteredResult(_0x1684a5,_0x1cf5ba))[_0x3334('0x28')](handleError(_0x1684a5,null));};exports[_0x3334('0x6b')]=function(_0x4b76c5,_0x146474,_0x8ec518){return db['ChatWebsite']['find']({'where':{'id':_0x4b76c5[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x146474,null))[_0x3334('0x1e')](function(_0x425bee){if(_0x425bee){return _0x425bee['removeAnswers'](_0x4b76c5[_0x3334('0x42')][_0x3334('0x69')]);}})[_0x3334('0x1e')](respondWithStatusCode(_0x146474,null))[_0x3334('0x28')](handleError(_0x146474,null));};exports[_0x3334('0x6c')]=function(_0x5df94d,_0x473770,_0x682f59){_0x5df94d[_0x3334('0x58')]['sitepic']=_0x5df94d[_0x3334('0x6d')][_0x3334('0x6e')];return db[_0x3334('0x3c')]['find']({'where':{'id':_0x5df94d[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x473770,null))[_0x3334('0x1e')](saveUpdates(_0x5df94d[_0x3334('0x58')],null))[_0x3334('0x1e')](respondWithResult(_0x473770,null))[_0x3334('0x28')](handleError(_0x473770,null));};exports[_0x3334('0x6f')]=function(_0x562ff3,_0x5b404d,_0x157b7b){_0x562ff3[_0x3334('0x58')]['agentAvatar']=_0x562ff3[_0x3334('0x6d')][_0x3334('0x6e')];return db[_0x3334('0x3c')]['find']({'where':{'id':_0x562ff3[_0x3334('0x63')]['id']}})['then'](handleEntityNotFound(_0x5b404d,null))[_0x3334('0x1e')](saveUpdates(_0x562ff3[_0x3334('0x58')],null))[_0x3334('0x1e')](respondWithResult(_0x5b404d,null))[_0x3334('0x28')](handleError(_0x5b404d,null));};exports[_0x3334('0x70')]=function(_0x6c3bc2,_0x118ec1,_0x36dcb3){_0x6c3bc2[_0x3334('0x58')][_0x3334('0x71')]=_0x6c3bc2[_0x3334('0x6d')]['filename'];return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x6c3bc2[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x118ec1,null))['then'](saveUpdates(_0x6c3bc2[_0x3334('0x58')],null))[_0x3334('0x1e')](respondWithResult(_0x118ec1,null))['catch'](handleError(_0x118ec1,null));};exports[_0x3334('0x72')]=function(_0x5752b6,_0x50e160,_0x20e8e7){_0x5752b6[_0x3334('0x58')][_0x3334('0x73')]=_0x5752b6[_0x3334('0x6d')]['filename'];return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x5752b6[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x50e160,null))[_0x3334('0x1e')](saveUpdates(_0x5752b6[_0x3334('0x58')],null))['then'](respondWithResult(_0x50e160,null))[_0x3334('0x28')](handleError(_0x50e160,null));};exports['getLogo']=function(_0x42175d,_0x1d9864,_0x203b91){var _0x5bf759=path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x76'));var _0x5c8ad1={'where':{'id':_0x42175d[_0x3334('0x63')]['id']},'attributes':['id',_0x3334('0x77')],'raw':!![]};var _0xd0389d=![];return require(_0x3334('0x16'))[_0x3334('0x78')]()[_0x3334('0x1e')](function(_0x2ba161){if(_0x2ba161){_0xd0389d=_0x2ba161[_0x3334('0x79')];}})[_0x3334('0x1e')](function(){return db['ChatWebsite'][_0x3334('0x5d')](_0x5c8ad1);})['then'](handleEntityNotFound(_0x1d9864,null))['then'](function(_0x3ea9da){if(_0x3ea9da){if(!_[_0x3334('0x7a')](_0x3ea9da[_0x3334('0x77')])){if(fs[_0x3334('0x7b')](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x7c'),_0x3ea9da['sitepic']))&&_0xd0389d){_0x5bf759=path[_0x3334('0x74')](config['root'],'server/files/images/logos/',_0x3ea9da[_0x3334('0x77')]);}}return _0x1d9864[_0x3334('0x7d')](_0x5bf759);}})[_0x3334('0x28')](handleError(_0x1d9864,null));};exports[_0x3334('0x7e')]=function(_0x514a4b,_0x38ba71,_0x42f42b){var _0x42b45a=path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x7f'));var _0x52081c={'where':{'id':_0x514a4b['params']['id']},'attributes':['id',_0x3334('0x80')],'raw':!![]};return db[_0x3334('0x3c')]['find'](_0x52081c)[_0x3334('0x1e')](handleEntityNotFound(_0x38ba71,null))['then'](function(_0x1c75d6){if(_0x1c75d6){if(!_[_0x3334('0x7a')](_0x1c75d6[_0x3334('0x80')])){if(fs['existsSync'](path[_0x3334('0x74')](config['root'],_0x3334('0x81'),_0x1c75d6['agentAvatar']))){_0x42b45a=path[_0x3334('0x74')](config[_0x3334('0x75')],'server/files/images/avatars/',_0x1c75d6['agentAvatar']);}}return _0x38ba71[_0x3334('0x7d')](_0x42b45a);}})[_0x3334('0x28')](handleError(_0x38ba71,null));};exports[_0x3334('0x82')]=function(_0x276944,_0x436936,_0xbfb75e){var _0x270179=path[_0x3334('0x74')](config['root'],_0x3334('0x83'));var _0x495cb0={'where':{'id':_0x276944[_0x3334('0x63')]['id']},'attributes':['id','customerAvatar',_0x3334('0x84')],'raw':!![]};return db['ChatWebsite'][_0x3334('0x5d')](_0x495cb0)[_0x3334('0x1e')](handleEntityNotFound(_0x436936,null))[_0x3334('0x1e')](function(_0x3fc6f4){if(_0x3fc6f4){if(!_[_0x3334('0x7a')](_0x3fc6f4[_0x3334('0x71')])){if(fs[_0x3334('0x7b')](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x81'),_0x3fc6f4['customerAvatar']))&&_0x3fc6f4[_0x3334('0x84')]){_0x270179=path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x81'),_0x3fc6f4[_0x3334('0x71')]);}}return _0x436936['download'](_0x270179);}})['catch'](handleError(_0x436936,null));};exports[_0x3334('0x85')]=function(_0x2e8109,_0x1e6fc6,_0x39a44b){var _0x38dd22=path[_0x3334('0x74')](config[_0x3334('0x75')],'server/files/images/avatars/system_avatar.png');var _0x409697={'where':{'id':_0x2e8109[_0x3334('0x63')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3334('0x3c')][_0x3334('0x5d')](_0x409697)[_0x3334('0x1e')](handleEntityNotFound(_0x1e6fc6,null))[_0x3334('0x1e')](function(_0x150df3){if(_0x150df3){if(!_[_0x3334('0x7a')](_0x150df3[_0x3334('0x73')])){if(fs['existsSync'](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x81'),_0x150df3['systemAvatar']))){_0x38dd22=path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x81'),_0x150df3[_0x3334('0x73')]);}}return _0x1e6fc6[_0x3334('0x7d')](_0x38dd22);}})[_0x3334('0x28')](handleError(_0x1e6fc6,null));};exports[_0x3334('0x86')]=function(_0x4419a,_0x3a64d7,_0x103f20){var _0x382a6c=require('user-agent-parser');var _0x3323ef=new _0x382a6c();var _0x4f0884=_0x3323ef[_0x3334('0x87')](_0x4419a[_0x3334('0x88')][_0x3334('0x89')])[_0x3334('0x8a')]();var _0x5eb8f8={'body':_0x4419a[_0x3334('0x58')],'channel':_0x3334('0x8b')};var _0x2a8cb0=[];var _0x761a83=[];var _0x103a32={};var _0x2eac4f=![];return db[_0x3334('0x8c')][_0x3334('0x61')]()[_0x3334('0x1e')](function(_0x1839db){if(!_0x1839db){throw new db['Sequelize'][(_0x3334('0x8d'))]('no\x20available\x20attributes');}_0x2a8cb0=_['difference'](_['keys'](_0x1839db),[_0x3334('0x8e'),'updatedAt']);_0x761a83=_[_0x3334('0x8f')](_[_0x3334('0x43')](_0x1839db),['createdAt',_0x3334('0x90'),_0x3334('0x91'),_0x3334('0x92')]);if(_0x4419a[_0x3334('0x58')]['id']){delete _0x4419a[_0x3334('0x58')]['id'];}if(_['isNil'](_0x4419a[_0x3334('0x58')][_0x3334('0x93')])){throw new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0x95'));}if(_[_0x3334('0x7a')](_0x4419a[_0x3334('0x58')][_0x3334('0x58')])||_0x4419a[_0x3334('0x58')]['body']===''){throw new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0x96'));}if(_[_0x3334('0x7a')](_0x4419a[_0x3334('0x58')]['mapKey'])){throw new db[(_0x3334('0x94'))]['ValidationError'](_0x3334('0x97')+_0x761a83);}if(!_[_0x3334('0x98')](_0x761a83,_0x4419a[_0x3334('0x58')]['mapKey'])){throw new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0x99')+_0x761a83);}_0x103a32[_0x4419a[_0x3334('0x58')][_0x3334('0x9a')]]=_0x4419a[_0x3334('0x58')][_0x3334('0x93')];})[_0x3334('0x1e')](function(){return db['ChatWebsite'][_0x3334('0x5d')]({'where':{'id':_0x4419a['params']['id']},'include':[{'model':db['CmList'],'as':_0x3334('0x9b'),'include':[{'model':db[_0x3334('0x8c')],'as':'Contacts','where':_0x103a32,'limit':0x1,'order':[[_0x3334('0x90'),'DESC']]}]},{'model':db[_0x3334('0x9c')],'as':_0x3334('0x9d')}]});})[_0x3334('0x1e')](handleEntityNotFound(_0x3a64d7,null))[_0x3334('0x1e')](function(_0x50cd14){if(_0x50cd14&&_0x50cd14[_0x3334('0x9b')]){_0x5eb8f8[_0x3334('0x9e')]=_0x50cd14;_0x5eb8f8[_0x3334('0x9f')]=_0x50cd14[_0x3334('0x9d')];_0x5eb8f8['list']=_0x50cd14[_0x3334('0x9b')];_0x5eb8f8[_0x3334('0x9f')]=_[_0x3334('0xa0')](_0x5eb8f8['applications'],[_0x3334('0xa1')],[_0x3334('0xa2')]);if(_0x5eb8f8['account'][_0x3334('0x9d')]){delete _0x5eb8f8[_0x3334('0x9e')]['Applications'];}if(_0x5eb8f8['account']['List']&&_0x5eb8f8['account'][_0x3334('0x9b')][_0x3334('0xa3')][_0x3334('0x48')]){return _0x5eb8f8[_0x3334('0x9e')]['List'][_0x3334('0xa3')][0x0];}var _0x1b762=_[_0x3334('0x18')](_0x4419a[_0x3334('0x58')],{'firstName':_0x4419a[_0x3334('0x58')][_0x3334('0x93')],'ListId':_0x50cd14['ListId']});_0x1b762[_0x4419a[_0x3334('0x58')][_0x3334('0x9a')]]=_0x4419a['body'][_0x3334('0x93')];return db[_0x3334('0x8c')][_0x3334('0x57')](_0x1b762,{'fields':_0x2a8cb0,'raw':!![]});}})['then'](handleEntityNotFound(_0x3a64d7,null))[_0x3334('0x1e')](function(_0x3771a3){_0x5eb8f8[_0x3334('0xa4')]=_0x3771a3;var _0x1303ba=_0x4419a[_0x3334('0x58')][_0x3334('0xa5')];if(_0x4419a[_0x3334('0x88')][_0x3334('0xa6')]){_0x1303ba=_0x4419a[_0x3334('0x88')]['cf-connecting-ip'];}else if(_0x4419a[_0x3334('0x88')][_0x3334('0xa7')]){_0x1303ba=_[_0x3334('0xa8')](_0x4419a[_0x3334('0x88')][_0x3334('0xa7')]['split'](','));}if(_0x3771a3){var _0x5c33e3={'ContactId':_0x3771a3['id'],'ChatWebsiteId':_0x4419a[_0x3334('0x63')]['id'],'from':(_0x3771a3[_0x3334('0xa9')]||'')+'\x20'+(_0x3771a3[_0x3334('0xaa')]||''),'customerIp':_0x1303ba,'customerPort':_0x4419a[_0x3334('0x88')]['x-real-port']?_0x4419a[_0x3334('0x88')][_0x3334('0xab')]:null,'referer':_0x4419a[_0x3334('0x58')][_0x3334('0xac')],'browserName':_0x4f0884[_0x3334('0xad')][_0x3334('0x38')]&&_0x4f0884[_0x3334('0xad')][_0x3334('0xae')]?util['format'](_0x3334('0xaf'),_0x4f0884[_0x3334('0xad')][_0x3334('0x38')],_0x4f0884[_0x3334('0xad')][_0x3334('0xae')]):_0x3334('0xb0'),'browserVersion':_0x4f0884[_0x3334('0xad')]['version']||_0x3334('0xb0'),'osName':util[_0x3334('0xb1')]('%s\x20%s',_0x4f0884['os'][_0x3334('0x38')],_0x4f0884['os']['version']),'osVersion':_0x4f0884['os'][_0x3334('0xae')],'deviceModel':_0x4f0884[_0x3334('0xb2')][_0x3334('0x40')]&&_0x4f0884[_0x3334('0xb2')]['vendor']?util[_0x3334('0xb1')](_0x3334('0xb3'),_0x4f0884['device'][_0x3334('0x40')],_0x4f0884[_0x3334('0xb2')][_0x3334('0xb4')],_0x4f0884['device'][_0x3334('0x3e')]):null,'deviceVendor':_0x4f0884[_0x3334('0xb2')][_0x3334('0xb4')],'deviceType':_0x4f0884['device']['type'],'formData':JSON[_0x3334('0x22')](_0x4419a[_0x3334('0x58')])};var _0x383b79={'ChatWebsiteId':_0x4419a['params']['id'],'closed':![]};if(_0x4419a[_0x3334('0x58')][_0x3334('0xb5')]){_0x383b79[_0x3334('0xb5')]=_0x4419a['body'][_0x3334('0xb5')];return db[_0x3334('0xb6')][_0x3334('0x5d')]({'where':_0x383b79})[_0x3334('0x1e')](function(_0x2b54b3){if(_0x2b54b3){return[_0x2b54b3,![]];}_0x5c33e3[_0x3334('0xb5')]=_0x4419a[_0x3334('0x58')][_0x3334('0xb5')];_0x5c33e3[_0x3334('0xb7')]=_0x4419a[_0x3334('0x58')][_0x3334('0xb7')];return db[_0x3334('0xb6')]['create'](_0x5c33e3)[_0x3334('0x1e')](function(_0x277c80){return[_0x277c80,!![]];});});}_0x383b79[_0x3334('0xb8')]=_0x3771a3['id'];if(_0x4419a[_0x3334('0x58')][_0x3334('0xb9')]&&_0x4419a[_0x3334('0x58')]['interaction']['id']){_0x383b79['id']=_0x4419a[_0x3334('0x58')]['interaction']['id'];return db[_0x3334('0xb6')][_0x3334('0x5d')]({'where':_0x383b79})['then'](function(_0x504c2d){if(_0x504c2d){return[_0x504c2d,![]];}return db['ChatInteraction'][_0x3334('0x57')](_0x5c33e3)['then'](function(_0x3d30f6){return[_0x3d30f6,!![]];});});}return db[_0x3334('0xb6')][_0x3334('0x57')](_0x5c33e3)[_0x3334('0x1e')](function(_0x4be62b){return[_0x4be62b,!![]];});}})[_0x3334('0xba')](function(_0x2de1e8,_0x592aab){if(_0x2de1e8){_0x2eac4f=_0x592aab;if(!_0x592aab){var _0xf23640={'from':(_0x5eb8f8[_0x3334('0xa4')][_0x3334('0xa9')]||'')+'\x20'+(_0x5eb8f8[_0x3334('0xa4')][_0x3334('0xaa')]||'')};if(_0x4419a[_0x3334('0x58')][_0x3334('0xb5')]&&_0x4419a[_0x3334('0x58')][_0x3334('0xbb')]&&_0x4419a[_0x3334('0x58')][_0x3334('0xb5')]!=_0x4419a[_0x3334('0x58')]['messageId']){_0xf23640[_0x3334('0xb5')]=_0x4419a[_0x3334('0x58')][_0x3334('0xbb')];}return _0x2de1e8['update'](_0xf23640);}else{return _0x2de1e8;}}})[_0x3334('0x1e')](function(_0x2f0cfd){_0x5eb8f8['interaction']=_0x2f0cfd[_0x3334('0x36')]({'plain':!![]});_0x5eb8f8[_0x3334('0xb9')][_0x3334('0xbc')]=_0x2eac4f;if(_0x5eb8f8[_0x3334('0xb9')][_0x3334('0xbc')]){if(_0x5eb8f8['account'][_0x3334('0xbd')]){_0x5eb8f8[_0x3334('0x9f')][_0x3334('0xbe')]({'id':0x0,'priority':_0x5eb8f8[_0x3334('0x9f')][_0x3334('0x48')]+0x1,'app':'close','appdata':_0x3334('0xbf'),'interval':_0x3334('0xc0')});}}return db['ChatMessage'][_0x3334('0x57')]({'body':_0x4419a[_0x3334('0x58')]['body'],'ChatWebsiteId':_0x4419a['params']['id'],'ChatInteractionId':_0x2f0cfd['id'],'direction':'in','ContactId':_0x5eb8f8[_0x3334('0xa4')]['id'],'AttachmentId':_0x4419a[_0x3334('0x58')][_0x3334('0xc1')]});})[_0x3334('0x1e')](function(_0x41b317){_0x5eb8f8['message']=_0x41b317;if(_0x5eb8f8[_0x3334('0xb9')][_0x3334('0xc2')]){return db['User']['find']({'attributes':['id',_0x3334('0x38')],'where':{'id':_0x5eb8f8[_0x3334('0xb9')]['UserId']}})[_0x3334('0x1e')](function(_0x5f1eed){if(_0x5f1eed){_0x5eb8f8[_0x3334('0x9f')][_0x3334('0xc3')]({'id':0x0,'priority':0x0,'app':_0x3334('0xc4'),'appdata':_0x5f1eed[_0x3334('0x38')]+','+(_0x5eb8f8[_0x3334('0x9e')][_0x3334('0xc5')]||0xa),'interval':_0x3334('0xc0')});_0x5eb8f8[_0x3334('0xc6')]=!![];}return respondWithRpcPromise(_0x3334('0xc7'),_0x3334('0xc8'),_0x5eb8f8);});}return respondWithRpcPromise('Start',_0x3334('0xc8'),_0x5eb8f8);})['then'](function(_0x295eb0){respondWithRpcPromise(_0x3334('0xc9'),_0x3334('0xc9'),{'event':_0x3334('0x86'),'message':_0x295eb0},client9002);return _0x295eb0;})[_0x3334('0x1e')](respondWithResult(_0x3a64d7,null))['catch'](handleError(_0x3a64d7,null));};exports['offline']=function(_0x11635e,_0x2bd0b3,_0x277c10){var _0x3fe386,_0x1c8765,_0x332976;var _0x31ec82=[];var _0x1d754e=[];var _0x4d1967={};var _0x1ed86a=_0x11635e['files']||[];var _0x32c857=[];var _0x993bab;return db[_0x3334('0x8c')]['describe']()[_0x3334('0x1e')](function(_0x5947eb){if(!_0x5947eb){throw new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0xca'));}_0x1d754e=_[_0x3334('0x8f')](_['keys'](_0x5947eb),[_0x3334('0x8e'),_0x3334('0x90')]);_0x31ec82=_['difference'](_[_0x3334('0x43')](_0x5947eb),[_0x3334('0x8e'),_0x3334('0x90'),_0x3334('0x91'),_0x3334('0x92')]);if(_0x11635e[_0x3334('0x58')]['id']){delete _0x11635e[_0x3334('0x58')]['id'];}if(_[_0x3334('0x7a')](_0x11635e[_0x3334('0x58')][_0x3334('0x93')])){throw _0x2bd0b3['status'](0x1f4)['send'](new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0x95')));}if(_[_0x3334('0x7a')](_0x11635e['body'][_0x3334('0x58')])||_0x11635e[_0x3334('0x58')][_0x3334('0x58')]===''){throw _0x2bd0b3[_0x3334('0x2a')](0x1f4)['send'](new db[(_0x3334('0x94'))]['ValidationError'](_0x3334('0x96')));}if(_[_0x3334('0x7a')](_0x11635e['body'][_0x3334('0xcb')])){throw _0x2bd0b3[_0x3334('0x2a')](0x1f4)[_0x3334('0x39')](new db[(_0x3334('0x94'))][(_0x3334('0x8d'))](_0x3334('0xcc')+_0x31ec82));}if(!_[_0x3334('0x98')](_0x31ec82,_0x11635e[_0x3334('0x58')][_0x3334('0xcb')])){throw _0x2bd0b3['status'](0x1f4)[_0x3334('0x39')](new db[(_0x3334('0x94'))]['ValidationError'](_0x3334('0xcd')+_0x31ec82));}_0x4d1967[_0x11635e[_0x3334('0x58')][_0x3334('0xcb')]]=_0x11635e[_0x3334('0x58')][_0x3334('0x93')];})[_0x3334('0x1e')](function(){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x11635e[_0x3334('0x63')]['id']},'include':[{'model':db[_0x3334('0xce')],'as':_0x3334('0x9b')},{'model':db[_0x3334('0xcf')],'as':_0x3334('0xcf')}]});})[_0x3334('0x1e')](handleEntityNotFound(_0x2bd0b3,null))['then'](function(_0x51e286){if(_0x51e286&&_0x51e286[_0x3334('0x9b')]){_0x1c8765=_0x51e286;var _0x337692=_[_0x3334('0x18')](_0x11635e['body'],{'firstName':_0x11635e['body']['from'],'phone':_0x11635e[_0x3334('0x58')][_0x3334('0x93')],'ListId':_0x51e286[_0x3334('0x92')]});_0x337692[_0x11635e[_0x3334('0x58')][_0x3334('0xcb')]]=_0x11635e[_0x3334('0x58')][_0x3334('0x93')];return db[_0x3334('0x8c')][_0x3334('0xd0')]({'where':_0x4d1967,'defaults':_0x337692});}})[_0x3334('0xba')](function(_0x593364){if(_0x593364){_0x332976=_0x593364;var _0x394ebf=fs[_0x3334('0xd1')](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0xd2')),_0x3334('0xd3'));var _0x17bf27=ejs[_0x3334('0xd4')](_0x394ebf,{'body':_[_0x3334('0xd5')](_0x11635e[_0x3334('0x58')][_0x3334('0x58')]),'bodyTitle':_0x1c8765[_0x3334('0xd6')]});return db['ChatOfflineMessage']['create']({'body':_0x17bf27,'ContactId':_0x593364['id'],'ChatWebsiteId':_0x1c8765['id']});}})[_0x3334('0x1e')](function(_0x1f0194){_0x993bab=_0x1f0194;if(_0x1ed86a[_0x3334('0x48')]){var _0x31c262=_0x1ed86a[_0x3334('0x41')](function(_0x34d2b1){return{'name':_0x34d2b1[_0x3334('0xd7')],'basename':_0x34d2b1[_0x3334('0x6e')],'type':_0x34d2b1['mimetype'],'ChatOfflineMessageId':_0x1f0194['id']};});_0x32c857=_0x31c262[_0x3334('0x41')](_0x568146=>{var _0x24bbf4={'filename':_0x568146[_0x3334('0x38')],'path':path[_0x3334('0x74')](config[_0x3334('0x75')],'server',_0x3334('0xd8'),'attachments',_0x3334('0xd9'),_0x568146[_0x3334('0xda')])};return _0x24bbf4;});if(!_0x1c8765[_0x3334('0xdb')]){return db[_0x3334('0xdc')][_0x3334('0xdd')](function(_0x1e7ba0){return db[_0x3334('0xde')]['bulkCreate'](_0x31c262,{'transaction':_0x1e7ba0});});}}})[_0x3334('0x1e')](function(){if(_0x993bab){_0x3fe386=_0x993bab;return db[_0x3334('0xcf')][_0x3334('0x65')]({'where':{'active':!![]},'include':[{'model':db[_0x3334('0xdf')],'as':_0x3334('0xe0'),'raw':!![]}]});}})[_0x3334('0x1e')](function(_0x44d62b){if(_0x44d62b&&_0x44d62b[_0x3334('0xe0')]&&_0x1c8765[_0x3334('0xe1')]&&_0x1c8765[_0x3334('0xe2')]){var _0x38e434={'tls':{'rejectUnauthorized':![]}};if(_0x44d62b[_0x3334('0xe0')]['service']){_0x38e434[_0x3334('0xe3')]=_0x44d62b[_0x3334('0xe0')][_0x3334('0xe3')];}else{_0x38e434['host']=_0x44d62b[_0x3334('0xe0')][_0x3334('0xe4')];_0x38e434['port']=_0x44d62b['Smtp'][_0x3334('0xe5')];_0x38e434[_0x3334('0xe6')]=_0x44d62b['Smtp'][_0x3334('0xe6')];}if(_0x44d62b[_0x3334('0xe0')][_0x3334('0xe7')]){_0x38e434[_0x3334('0xe8')]={'user':_0x44d62b['Smtp'][_0x3334('0x59')],'pass':_0x44d62b[_0x3334('0xe0')][_0x3334('0xe9')]};}return respondWithRpcPromise(_0x3334('0xea'),_0x3334('0xeb'),{'account':_0x38e434,'message':{'from':util[_0x3334('0xb1')](_0x3334('0xec'),_0x44d62b[_0x3334('0x38')],_0x44d62b[_0x3334('0xed')]||_0x44d62b[_0x3334('0xe0')]['user']),'to':_0x1c8765['forwardOfflineAddress'],'subject':_0x1c8765['offlineMessageSubject'],'html':_0x3fe386[_0x3334('0x58')],'attachments':_0x32c857}},client9003)[_0x3334('0x1e')](function(){return _0x3fe386;})[_0x3334('0x28')](function(_0x221770){console[_0x3334('0x23')](_0x221770);});}})['then'](function(){if(_0x1c8765&&_0x1c8765[_0x3334('0xdb')]&&_0x1c8765[_0x3334('0xee')]){var _0x18bae5=[];if(_0x1ed86a['length']){_0x18bae5=_0x1ed86a[_0x3334('0x41')](function(_0x5cb97d){return{'name':_0x5cb97d[_0x3334('0xd7')],'basename':_0x5cb97d[_0x3334('0x6e')],'type':_0x5cb97d['mimetype'],'ChatOfflineMessageId':_0x993bab['id']};});}var _0x11a477;if(!_[_0x3334('0x7a')](_0x1c8765[_0x3334('0xef')])){var _0x20a909=_[_0x3334('0x41')](_0x11635e['body'],function(_0x378cc9){return _0x378cc9;});var _0x492c53=_[_0x3334('0xf0')](_0x20a909)[0x0];var _0x11e743=_[_0x3334('0xf1')](_0x492c53,function(_0x58e943){return _0x58e943;});_0x11a477=_0x11e743[0x1][_0x1c8765[_0x3334('0xef')]];}var _0x2f22fa={'from':_0x332976['email'],'firstName':_0x332976[_0x3334('0xa9')],'lastName':_0x332976[_0x3334('0xaa')],'mapKey':_0x3334('0xed'),'message':{'from':_0x332976[_0x3334('0xed')],'to':_0x1c8765[_0x3334('0xcf')][_0x3334('0xed')],'cc':'','subject':_[_0x3334('0x7a')](_0x11a477)?_0x1c8765[_0x3334('0xf2')]:_0x11a477,'messageId':'','sentAt':new Date(),'attach':_0x18bae5[_0x3334('0x48')],'attachments':_0x18bae5,'originChannel':_0x3334('0xf3'),'ChatWebsiteId':_0x1c8765['id'],'ChatOfflineMessageId':_0x3fe386['id'],'originTo':_0x1c8765[_0x3334('0xcf')]['email']},'body':_0x3fe386['body']};var _0x4a6f07={'account':{'id':_0x1c8765[_0x3334('0xee')]},'body':_0x2f22fa,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x3334('0xf4'),'notifyMail',_0x4a6f07,client9001)['then'](function(){return _0x3fe386;})[_0x3334('0x28')](function(_0x3d2ca1){console[_0x3334('0x23')](_0x3d2ca1);});}return;})[_0x3334('0x1e')](function(){if(_0x3fe386){return _0x3fe386;}})[_0x3334('0x1e')](respondWithResult(_0x2bd0b3,null))[_0x3334('0x28')](function(_0x149884){console[_0x3334('0x23')]('catch',_0x149884);for(var _0x1a979b of _0x1ed86a){var _0xd1811a=path[_0x3334('0x74')](config[_0x3334('0x75')],'server',_0x3334('0xd8'),_0x3334('0xf5'),_0x3334('0xd9'),_0x1a979b['filename']);fs_extra[_0x3334('0xf6')](_0xd1811a)[_0x3334('0x28')](function(_0x3e3dca){console[_0x3334('0x23')](_0x3334('0xf7'),_0xd1811a,_0x3e3dca);});}});};exports[_0x3334('0xf8')]=function(_0x59042c,_0x5ab8e0,_0x355f70){return db['ChatInteraction'][_0x3334('0x5d')]({'where':{'id':_0x59042c[_0x3334('0x63')]['id']}})['then'](handleEntityNotFound(_0x5ab8e0,null))['then'](function(_0x597681){if(_0x597681){return _0x597681['addInteraction'](_0x59042c[_0x3334('0x58')][_0x3334('0x69')],_[_0x3334('0xf9')](_0x59042c[_0x3334('0x58')],[_0x3334('0x69'),'id'])||{});}})['then'](respondWithResult(_0x5ab8e0,null))[_0x3334('0x28')](handleError(_0x5ab8e0,null));};exports[_0x3334('0xfa')]=function(_0x50fab3,_0x502ad1,_0x2d7926){var _0x29f833={'raw':![],'where':{}};var _0x45c278={};var _0x27852a={'count':0x0,'rows':[]};return db[_0x3334('0x3c')][_0x3334('0x65')]({'where':{'id':_0x50fab3[_0x3334('0x63')]['id']}})['then'](handleEntityNotFound(_0x502ad1,null))[_0x3334('0x1e')](function(_0x4e9002){if(_0x4e9002){_0x45c278[_0x3334('0x40')]=_['keys'](db[_0x3334('0xb6')][_0x3334('0x56')]);_0x45c278[_0x3334('0x42')]=_[_0x3334('0x43')](_0x50fab3[_0x3334('0x42')]);_0x45c278[_0x3334('0x44')]=_['intersection'](_0x45c278[_0x3334('0x40')],_0x45c278[_0x3334('0x42')]);_0x29f833['attributes']=_[_0x3334('0x45')](_0x45c278[_0x3334('0x40')],qs[_0x3334('0x47')](_0x50fab3[_0x3334('0x42')][_0x3334('0x47')]));_0x29f833['attributes']=_0x29f833[_0x3334('0x46')]['length']?_0x29f833[_0x3334('0x46')]:_0x45c278['model'];if(!_0x50fab3[_0x3334('0x42')][_0x3334('0x66')](_0x3334('0x49'))){_0x29f833[_0x3334('0x30')]=qs[_0x3334('0x30')](_0x50fab3['query'][_0x3334('0x30')]);_0x29f833[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x50fab3[_0x3334('0x42')][_0x3334('0x2d')]);}_0x29f833[_0x3334('0x4a')]=qs[_0x3334('0x4b')](_0x50fab3[_0x3334('0x42')][_0x3334('0x4b')]);_0x29f833['where']=qs['filters'](_[_0x3334('0x4d')](_0x50fab3['query'],_0x45c278['filters']));_0x29f833[_0x3334('0x4c')][_0x3334('0x67')]=_0x4e9002['id'];if(_0x50fab3['query'][_0x3334('0x4e')]){_0x29f833[_0x3334('0x4c')]=_[_0x3334('0x4f')](_0x29f833[_0x3334('0x4c')],{'$or':_[_0x3334('0x41')](_0x29f833[_0x3334('0x46')],function(_0x5f517d){var _0x5b94c9={};_0x5b94c9[_0x5f517d]={'$like':'%'+_0x50fab3[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0x5b94c9;})});}_0x29f833=_['merge']({},_0x29f833,_0x50fab3[_0x3334('0x51')]);return db[_0x3334('0xb6')][_0x3334('0x2f')]({'where':_0x29f833[_0x3334('0x4c')]})[_0x3334('0x1e')](function(_0x5e15b1){_0x27852a[_0x3334('0x2f')]=_0x5e15b1;if(_0x50fab3['query']['includeAll']){_0x29f833['include']=[{'model':db[_0x3334('0x8c')],'as':_0x3334('0xfb'),'required':![]},{'model':db[_0x3334('0xfc')],'as':'Owner','attributes':[_0x3334('0x38'),_0x3334('0xfd'),_0x3334('0xfe')],'required':![]},{'model':db[_0x3334('0xff')],'as':_0x3334('0x100'),'attributes':['id','name',_0x3334('0x101')],'where':_0x50fab3[_0x3334('0x42')]['tag']?{'id':_0x50fab3[_0x3334('0x42')][_0x3334('0x102')]}:undefined,'required':_0x50fab3[_0x3334('0x42')][_0x3334('0x102')]?!![]:![]}];}return db[_0x3334('0xb6')]['findAll'](_0x29f833);})[_0x3334('0x1e')](function(_0x3a09e6){_0x27852a[_0x3334('0x103')]=_0x3a09e6;return _0x27852a;});}})['then'](respondWithFilteredResult(_0x502ad1,_0x29f833))[_0x3334('0x28')](handleError(_0x502ad1,null));};function iftimePromise(_0x3fd988,_0x5b5537){return respondWithRpcPromise(_0x3334('0x104'),'getSnippet',{'command':_0x5b5537[_0x3334('0x105')]?util[_0x3334('0xb1')](_0x3334('0x106'),_0x3fd988[_0x3334('0x107')],_0x5b5537[_0x3334('0x105')]):util[_0x3334('0xb1')]('iftime\x20%s',_0x3fd988['interval'])},client9002)['then'](function(_0x20d7c6){var _0x332df0=_0x20d7c6&&_0x20d7c6[_0x3334('0x108')](_0x3334('0x109'))>=0x0?!![]:![];logger[_0x3334('0x1f')](_0x3334('0x10a'),_0x5b5537['id'],_0x3fd988['id'],_0x3fd988[_0x3334('0x107')],_0x332df0?_0x3334('0x10b'):_0x3334('0x10c'),_0x5b5537['timezone']?_0x5b5537[_0x3334('0x105')]:'No\x20timezone');return _0x332df0;})[_0x3334('0x28')](function(_0x39d76b){logger['error'](_0x3334('0x10a'),_0x5b5537['id'],_0x3fd988['id'],_0x3fd988['interval'],util['inspect'](_0x39d76b,{'showHidden':![],'depth':null}),_0x5b5537[_0x3334('0x105')]?_0x5b5537['timezone']:_0x3334('0x10d'));return![];});}exports[_0x3334('0x10e')]=function(_0x37a9bf,_0x5c3ae8,_0x52794c){var _0x5b39d4=0x0;var _0x21768d=0x0;var _0x43e6ee=![];var _0x312dcf;var _0xcf86c4;return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x37a9bf[_0x3334('0x63')]['id']},'include':[{'model':db['Interval'],'as':_0x3334('0x10f'),'include':[{'model':db[_0x3334('0x10f')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x3334('0x1e')](handleEntityNotFound(_0x5c3ae8,null))['then'](function(_0x192873){if(_0x192873){_0x312dcf=_0x192873;return _0x192873[_0x3334('0x110')]({'raw':!![]});}})[_0x3334('0x1e')](function(_0x13ce22){if(_0x312dcf){if(_0x13ce22){_0xcf86c4=_0x13ce22;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0xd41b0f){if(_0xd41b0f){_0x21768d=_0xd41b0f[_0x3334('0x111')];_0x43e6ee=_0xd41b0f[_0x3334('0x79')];}})[_0x3334('0x1e')](function(){return db[_0x3334('0xb6')][_0x3334('0x2f')]({'where':{'closed':![]}});})[_0x3334('0x1e')](function(_0x17c7f2){_0x5b39d4=_0x17c7f2;if(_0x21768d&&_0x17c7f2>_0x21768d){return db[_0x3334('0x112')][_0x3334('0x65')]({'where':{'id':0x1}})[_0x3334('0x1e')](function(_0x1669d3){if(_0x1669d3){_0x1669d3[_0x3334('0x113')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x312dcf[_0x3334('0x10f')]&&_0x312dcf['Interval'][_0x3334('0x114')]){var _0x318e7f=[];for(var _0x4aa86d=0x0;_0x4aa86d<_0x312dcf['Interval'][_0x3334('0x114')][_0x3334('0x48')];_0x4aa86d++){var _0x36581a=_0x312dcf[_0x3334('0x10f')][_0x3334('0x114')][_0x4aa86d][_0x3334('0x36')]({'plain':!![]});_0x318e7f[_0x3334('0xbe')](iftimePromise(_0x36581a,_0x312dcf));}return BPromise[_0x3334('0x115')](_0x318e7f)[_0x3334('0x1e')](function(_0x208c4d){return _['some'](_0x208c4d);});}else{return!![];}})[_0x3334('0x1e')](function(_0xc1d7f7){var _0x1998ed=fs[_0x3334('0xd1')](path[_0x3334('0x74')](config[_0x3334('0x75')],_0x3334('0x116')),_0x3334('0xd3'));var _0x33d77f={'remote':_0x312dcf[_0x3334('0x117')],'query':querystring[_0x3334('0x22')](_[_0x3334('0x4f')](_0x312dcf[_0x3334('0x36')]({'plain':!![]}),{'customerIp':_0x37a9bf[_0x3334('0x88')][_0x3334('0xa7')]||_0x37a9bf[_0x3334('0x88')][_0x3334('0x118')]||_0x37a9bf[_0x3334('0x119')][_0x3334('0x11a')]||_0x37a9bf['ip'],'referer':_0x37a9bf['headers']['referer'],'openedInteractions':_0x5b39d4,'maxInteractions':_0x21768d,'virtual':_0x43e6ee[_0x3334('0x111')],'online':_0xc1d7f7,'custom':_0x43e6ee}))[_0x3334('0x11b')](/'/g,'\x5c\x27')};_0x5c3ae8['send'](ejs[_0x3334('0xd4')](Mustache[_0x3334('0xd4')](_0x1998ed,_0x33d77f),{'proactiveActions':_0xcf86c4,'alignment':_0x312dcf[_0x3334('0x11c')],'verticalAlignment':_0x312dcf[_0x3334('0x11d')],'div_color':_0x312dcf[_0x3334('0x101')],'text_color':_0x312dcf[_0x3334('0x11e')],'button_color':_0x312dcf['color_button'],'background_color':_0x312dcf['backgroundColor']}));})[_0x3334('0x28')](handleError(_0x5c3ae8,null));};exports[_0x3334('0x11f')]=function(_0x3f8157,_0x323e7c,_0x4e308b){return db[_0x3334('0x3c')][_0x3334('0x65')]({'where':{'id':_0x3f8157[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x323e7c,null))['then'](function(_0x6a1471){if(_0x6a1471){return db[_0x3334('0xdc')]['transaction'](function(_0x16736e){return db[_0x3334('0x9c')]['destroy']({'where':{'ChatWebsiteId':_0x3f8157[_0x3334('0x63')]['id']},'transaction':_0x16736e})[_0x3334('0x1e')](function(_0x47428b){var _0x360de3=_[_0x3334('0x41')](_0x3f8157[_0x3334('0x58')],function(_0x218ee6){_0x218ee6['ChatWebsiteId']=_0x3f8157[_0x3334('0x63')]['id'];return _0x218ee6;});return db[_0x3334('0x9c')][_0x3334('0x120')](_0x360de3,{'transaction':_0x16736e});});})['then'](function(){return db[_0x3334('0x9c')][_0x3334('0x121')]({'where':{'ChatWebsiteId':_0x3f8157[_0x3334('0x63')]['id']},'order':_0x3334('0xa1')});});}})[_0x3334('0x1e')](respondWithResult(_0x323e7c,null))[_0x3334('0x28')](handleError(_0x323e7c,null));};exports[_0x3334('0x122')]=function(_0x3133ae,_0x3e0f23,_0x3bbdf5){var _0x582240={};var _0x1bdc89={};var _0x2fe176;var _0x836cab;return db[_0x3334('0x3c')][_0x3334('0x65')]({'where':{'id':_0x3133ae[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x3e0f23,null))[_0x3334('0x1e')](function(_0x429b1a){if(_0x429b1a){_0x2fe176=_0x429b1a;_0x1bdc89[_0x3334('0x40')]=_[_0x3334('0x43')](db['ChatApplication'][_0x3334('0x56')]);_0x1bdc89[_0x3334('0x42')]=_[_0x3334('0x43')](_0x3133ae['query']);_0x1bdc89[_0x3334('0x44')]=_[_0x3334('0x45')](_0x1bdc89[_0x3334('0x40')],_0x1bdc89['query']);_0x582240[_0x3334('0x46')]=_[_0x3334('0x45')](_0x1bdc89[_0x3334('0x40')],qs[_0x3334('0x47')](_0x3133ae[_0x3334('0x42')][_0x3334('0x47')]));_0x582240[_0x3334('0x46')]=_0x582240[_0x3334('0x46')][_0x3334('0x48')]?_0x582240[_0x3334('0x46')]:_0x1bdc89[_0x3334('0x40')];_0x582240[_0x3334('0x4a')]=qs[_0x3334('0x4b')](_0x3133ae[_0x3334('0x42')]['sort']);_0x582240['where']=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x3133ae[_0x3334('0x42')],_0x1bdc89[_0x3334('0x44')]));if(_0x3133ae['query'][_0x3334('0x4e')]){_0x582240[_0x3334('0x4c')]=_['merge'](_0x582240[_0x3334('0x4c')],{'$or':_[_0x3334('0x41')](_0x582240[_0x3334('0x46')],function(_0x51b27a){var _0x2523f7={};_0x2523f7[_0x51b27a]={'$like':'%'+_0x3133ae[_0x3334('0x42')]['filter']+'%'};return _0x2523f7;})});}_0x582240=_[_0x3334('0x4f')]({},_0x582240,_0x3133ae[_0x3334('0x51')]);return _0x2fe176[_0x3334('0x122')](_0x582240);}})[_0x3334('0x1e')](function(_0x59dab6){if(_0x59dab6){_0x836cab=_0x59dab6[_0x3334('0x48')];if(!_0x3133ae['query'][_0x3334('0x66')](_0x3334('0x49'))){_0x582240[_0x3334('0x30')]=qs[_0x3334('0x30')](_0x3133ae['query']['limit']);_0x582240[_0x3334('0x2d')]=qs['offset'](_0x3133ae[_0x3334('0x42')][_0x3334('0x2d')]);}return _0x2fe176[_0x3334('0x122')](_0x582240);}})[_0x3334('0x1e')](function(_0x3c46d9){if(_0x3c46d9){return _0x3c46d9?{'count':_0x836cab,'rows':_0x3c46d9}:null;}})[_0x3334('0x1e')](respondWithResult(_0x3e0f23,null))['catch'](handleError(_0x3e0f23,null));};exports[_0x3334('0x123')]=function(_0x2a2be7,_0x34f92b,_0x257c09){return db[_0x3334('0x124')][_0x3334('0x5d')]({'where':{'id':_0x2a2be7[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x34f92b,null))[_0x3334('0x1e')](function(_0x5f5cf4){if(_0x5f5cf4){return _0x5f5cf4[_0x3334('0x123')](_0x2a2be7[_0x3334('0x58')][_0x3334('0x69')],_[_0x3334('0xf9')](_0x2a2be7[_0x3334('0x58')],['ids','id'])||{});}})[_0x3334('0x1e')](respondWithResult(_0x34f92b,null))['catch'](handleError(_0x34f92b,null));};exports[_0x3334('0x110')]=function(_0x1fc116,_0x36fc89,_0x51225a){var _0xec5b49={};var _0x1eb65e={};var _0x27fc03;var _0x583ef8;return db['ChatWebsite'][_0x3334('0x65')]({'where':{'id':_0x1fc116['params']['id']}})['then'](handleEntityNotFound(_0x36fc89,null))[_0x3334('0x1e')](function(_0x147554){if(_0x147554){_0x27fc03=_0x147554;_0x1eb65e[_0x3334('0x40')]=_['keys'](db['ChatProactiveAction'][_0x3334('0x56')]);_0x1eb65e[_0x3334('0x42')]=_[_0x3334('0x43')](_0x1fc116['query']);_0x1eb65e[_0x3334('0x44')]=_[_0x3334('0x45')](_0x1eb65e[_0x3334('0x40')],_0x1eb65e[_0x3334('0x42')]);_0xec5b49[_0x3334('0x46')]=_[_0x3334('0x45')](_0x1eb65e[_0x3334('0x40')],qs[_0x3334('0x47')](_0x1fc116[_0x3334('0x42')][_0x3334('0x47')]));_0xec5b49[_0x3334('0x46')]=_0xec5b49[_0x3334('0x46')]['length']?_0xec5b49[_0x3334('0x46')]:_0x1eb65e[_0x3334('0x40')];_0xec5b49[_0x3334('0x4a')]=qs[_0x3334('0x4b')](_0x1fc116[_0x3334('0x42')][_0x3334('0x4b')]);_0xec5b49[_0x3334('0x4c')]=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x1fc116[_0x3334('0x42')],_0x1eb65e[_0x3334('0x44')]));if(_0x1fc116[_0x3334('0x42')][_0x3334('0x4e')]){_0xec5b49[_0x3334('0x4c')]=_['merge'](_0xec5b49[_0x3334('0x4c')],{'$or':_[_0x3334('0x41')](_0xec5b49[_0x3334('0x46')],function(_0x377057){var _0x32bf81={};_0x32bf81[_0x377057]={'$like':'%'+_0x1fc116[_0x3334('0x42')]['filter']+'%'};return _0x32bf81;})});}_0xec5b49=_[_0x3334('0x4f')]({},_0xec5b49,_0x1fc116[_0x3334('0x51')]);return _0x27fc03[_0x3334('0x110')](_0xec5b49);}})[_0x3334('0x1e')](function(_0x55a5a2){if(_0x55a5a2){_0x583ef8=_0x55a5a2['length'];if(!_0x1fc116[_0x3334('0x42')][_0x3334('0x66')](_0x3334('0x49'))){_0xec5b49['limit']=qs[_0x3334('0x30')](_0x1fc116['query'][_0x3334('0x30')]);_0xec5b49[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x1fc116['query'][_0x3334('0x2d')]);}return _0x27fc03[_0x3334('0x110')](_0xec5b49);}})[_0x3334('0x1e')](function(_0x57c3d8){if(_0x57c3d8){return _0x57c3d8?{'count':_0x583ef8,'rows':_0x57c3d8}:null;}})[_0x3334('0x1e')](respondWithResult(_0x36fc89,null))[_0x3334('0x28')](handleError(_0x36fc89,null));};exports[_0x3334('0x125')]=function(_0x2dfd1e,_0x225d41,_0xddb1e0){var _0xe13317=_0x2dfd1e[_0x3334('0x42')][_0x3334('0x126')]===_0x3334('0x127')?_0x3334('0x128'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0xe13317],'where':{'id':_0x2dfd1e['params']['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x225d41,null))[_0x3334('0x1e')](function(_0x38066b){if(_0x38066b){var _0x36b302=_0x38066b[_0xe13317];var _0x42cd18=_0x36b302&&_0x36b302[_0x3334('0x129')]?_0x36b302[_0x3334('0x129')]:[];_0x225d41['send']({'fromKey':_['isNil'](_0x36b302['fromKey'])?undefined:_0x36b302[_0x3334('0x12a')],'count':_0x42cd18[_0x3334('0x48')],'rows':_0x42cd18});}})[_0x3334('0x28')](handleError(_0x225d41,null));};exports[_0x3334('0x12b')]=function(_0x238ff5,_0x227bb4,_0x750287){var _0x8e6873={'raw':![],'where':{}};var _0x360f55={};var _0x3f1d1c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3334('0x65')]({'where':{'id':_0x238ff5[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x227bb4,null))[_0x3334('0x1e')](function(_0x5dab55){if(_0x5dab55){_0x360f55[_0x3334('0x40')]=_['keys'](db[_0x3334('0x12c')][_0x3334('0x56')]);_0x360f55[_0x3334('0x42')]=_[_0x3334('0x43')](_0x238ff5[_0x3334('0x42')]);_0x360f55['filters']=_[_0x3334('0x45')](_0x360f55[_0x3334('0x40')],_0x360f55[_0x3334('0x42')]);_0x8e6873[_0x3334('0x46')]=_['intersection'](_0x360f55[_0x3334('0x40')],qs[_0x3334('0x47')](_0x238ff5[_0x3334('0x42')][_0x3334('0x47')]));_0x8e6873['attributes']=_0x8e6873['attributes'][_0x3334('0x48')]?_0x8e6873[_0x3334('0x46')]:_0x360f55['model'];if(!_0x238ff5[_0x3334('0x42')]['hasOwnProperty'](_0x3334('0x49'))){_0x8e6873['limit']=qs[_0x3334('0x30')](_0x238ff5[_0x3334('0x42')][_0x3334('0x30')]);_0x8e6873[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x238ff5[_0x3334('0x42')][_0x3334('0x2d')]);}_0x8e6873['order']=qs[_0x3334('0x4b')](_0x238ff5[_0x3334('0x42')][_0x3334('0x4b')]);_0x8e6873['where']=qs['filters'](_[_0x3334('0x4d')](_0x238ff5[_0x3334('0x42')],_0x360f55[_0x3334('0x44')]));_0x8e6873[_0x3334('0x4c')]['ChatWebsiteId']=_0x5dab55['id'];if(_0x238ff5[_0x3334('0x42')][_0x3334('0x4e')]){_0x8e6873[_0x3334('0x4c')]=_[_0x3334('0x4f')](_0x8e6873[_0x3334('0x4c')],{'$or':_['map'](_0x8e6873['attributes'],function(_0x31a28d){var _0x590059={};_0x590059[_0x31a28d]={'$like':'%'+_0x238ff5[_0x3334('0x42')][_0x3334('0x4e')]+'%'};return _0x590059;})});}_0x8e6873=_[_0x3334('0x4f')]({},_0x8e6873,_0x238ff5['options']);return db[_0x3334('0x12c')][_0x3334('0x2f')]({'where':_0x8e6873[_0x3334('0x4c')]})[_0x3334('0x1e')](function(_0x5c7d7a){_0x3f1d1c[_0x3334('0x2f')]=_0x5c7d7a;if(_0x238ff5['query']['includeAll']){_0x8e6873[_0x3334('0x53')]=[{'all':!![]}];}else{_0x8e6873['include']=[{'model':db[_0x3334('0x8c')],'as':_0x3334('0xfb'),'required':![]},{'model':db['Attachment'],'as':_0x3334('0x12d'),'required':![]}];}return db[_0x3334('0x12c')][_0x3334('0x54')](_0x8e6873);})[_0x3334('0x1e')](function(_0x3eb237){_0x3f1d1c[_0x3334('0x103')]=_0x3eb237;return _0x3f1d1c;});}})[_0x3334('0x1e')](respondWithFilteredResult(_0x227bb4,_0x8e6873))['catch'](handleError(_0x227bb4,null));};exports['addAgents']=function(_0x5802ee,_0x9d6937,_0x461ef5){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x5802ee[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x9d6937,null))['then'](function(_0x39966d){if(_0x39966d){return _0x39966d[_0x3334('0x12e')](_0x5802ee[_0x3334('0x58')]['ids'],_[_0x3334('0xf9')](_0x5802ee[_0x3334('0x58')],[_0x3334('0x69'),'id'])||{})[_0x3334('0xba')](function(_0x42488f){for(var _0xf7dbbd=0x0;_0xf7dbbd<_0x5802ee['body']['ids'][_0x3334('0x48')];_0xf7dbbd+=0x1){socket[_0x3334('0x12f')](_0x3334('0x130'),{'UserId':Number(_0x5802ee[_0x3334('0x58')][_0x3334('0x69')][_0xf7dbbd]),'ChatWebsiteId':Number(_0x5802ee[_0x3334('0x63')]['id'])});}return _0x42488f;});}})[_0x3334('0x1e')](respondWithResult(_0x9d6937,null))['catch'](handleError(_0x9d6937,null));};exports[_0x3334('0x131')]=function(_0x27f565,_0x5e5b28,_0x1ad2b4){return db[_0x3334('0x3c')][_0x3334('0x5d')]({'where':{'id':_0x27f565[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x5e5b28,null))[_0x3334('0x1e')](function(_0x4764fb){if(_0x4764fb){return _0x4764fb[_0x3334('0x131')](_0x27f565['query'][_0x3334('0x69')])[_0x3334('0x1e')](function(){if(_[_0x3334('0x132')](_0x27f565[_0x3334('0x42')][_0x3334('0x69')])){for(var _0x1e660b=0x0;_0x1e660b<_0x27f565['query'][_0x3334('0x69')][_0x3334('0x48')];_0x1e660b+=0x1){socket[_0x3334('0x12f')](_0x3334('0x133'),{'UserId':Number(_0x27f565[_0x3334('0x42')][_0x3334('0x69')][_0x1e660b]),'ChatWebsiteId':Number(_0x27f565['params']['id'])});}}else{socket[_0x3334('0x12f')](_0x3334('0x133'),{'UserId':Number(_0x27f565[_0x3334('0x42')][_0x3334('0x69')]),'ChatWebsiteId':Number(_0x27f565[_0x3334('0x63')]['id'])});}});}})[_0x3334('0x1e')](respondWithStatusCode(_0x5e5b28,null))['catch'](handleError(_0x5e5b28,null));};exports[_0x3334('0x134')]=function(_0x36932d,_0x26be74,_0x322985){var _0x479f32={};var _0x59b18a={};var _0x221226;var _0x21285a;return db[_0x3334('0x3c')][_0x3334('0x65')]({'where':{'id':_0x36932d[_0x3334('0x63')]['id']}})[_0x3334('0x1e')](handleEntityNotFound(_0x26be74,null))[_0x3334('0x1e')](function(_0x3c1049){if(_0x3c1049){_0x221226=_0x3c1049;_0x59b18a[_0x3334('0x40')]=_['keys'](db['User'][_0x3334('0x56')]);_0x59b18a['query']=_[_0x3334('0x43')](_0x36932d[_0x3334('0x42')]);_0x59b18a['filters']=_[_0x3334('0x45')](_0x59b18a[_0x3334('0x40')],_0x59b18a[_0x3334('0x42')]);_0x479f32[_0x3334('0x46')]=_[_0x3334('0x45')](_0x59b18a[_0x3334('0x40')],qs[_0x3334('0x47')](_0x36932d[_0x3334('0x42')][_0x3334('0x47')]));_0x479f32[_0x3334('0x46')]=_0x479f32['attributes']['length']?_0x479f32[_0x3334('0x46')]:_0x59b18a[_0x3334('0x40')];_0x479f32['order']=qs[_0x3334('0x4b')](_0x36932d[_0x3334('0x42')][_0x3334('0x4b')]);_0x479f32['where']=qs[_0x3334('0x44')](_[_0x3334('0x4d')](_0x36932d[_0x3334('0x42')],_0x59b18a[_0x3334('0x44')]));if(_0x36932d[_0x3334('0x42')][_0x3334('0x4e')]){_0x479f32[_0x3334('0x4c')]=_[_0x3334('0x4f')](_0x479f32[_0x3334('0x4c')],{'$or':_['map'](_0x479f32[_0x3334('0x46')],function(_0x4e5d21){var _0xbd3e31={};_0xbd3e31[_0x4e5d21]={'$like':'%'+_0x36932d['query'][_0x3334('0x4e')]+'%'};return _0xbd3e31;})});}_0x479f32=_[_0x3334('0x4f')]({},_0x479f32,_0x36932d[_0x3334('0x51')]);return _0x221226[_0x3334('0x134')](_0x479f32);}})[_0x3334('0x1e')](function(_0x4a111a){if(_0x4a111a){_0x21285a=_0x4a111a[_0x3334('0x48')];if(!_0x36932d[_0x3334('0x42')][_0x3334('0x66')](_0x3334('0x49'))){_0x479f32[_0x3334('0x30')]=qs[_0x3334('0x30')](_0x36932d[_0x3334('0x42')]['limit']);_0x479f32[_0x3334('0x2d')]=qs[_0x3334('0x2d')](_0x36932d[_0x3334('0x42')][_0x3334('0x2d')]);}return _0x221226[_0x3334('0x134')](_0x479f32);}})[_0x3334('0x1e')](function(_0xea9dba){if(_0xea9dba){return _0xea9dba?{'count':_0x21285a,'rows':_0xea9dba}:null;}})['then'](respondWithResult(_0x26be74,null))[_0x3334('0x28')](handleError(_0x26be74,null));}; \ No newline at end of file +var _0x5b6c=['items','fromKey','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','include','rows','catch','params','Pause','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','create','describe','ChatWebsiteId','getDispositions','findOne','Disposition','nolimit','pick','findAll','removeDispositions','ids','CannedAnswer','length','removeAnswers','filename','addAvatar','agentAvatar','file','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','from','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','updatedAt','ChatApplication','Applications','account','applications','list','orderBy','asc','customerIp','headers','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','firstName','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','mapKeyOffline','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','\x22%s\x22\x20<%s>','email','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','omit','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','virtual','License','push','all','server/files/chat/iframe.ejs','remote','connection','referer','replace','alignment','color','textColor','color_button','backgroundColor','addApplications','findAndCountAll','priority','getApplications','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm'];(function(_0x185334,_0x4630ac){var _0xf2e59a=function(_0x3cc497){while(--_0x3cc497){_0x185334['push'](_0x185334['shift']());}};_0xf2e59a(++_0x4630ac);}(_0x5b6c,0x13e));var _0xc5b6=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x5b6c[_0x580647];return _0x5f0792;};'use strict';var emlformat=require(_0xc5b6('0x0'));var rimraf=require(_0xc5b6('0x1'));var zipdir=require(_0xc5b6('0x2'));var jsonpatch=require(_0xc5b6('0x3'));var rp=require(_0xc5b6('0x4'));var moment=require(_0xc5b6('0x5'));var BPromise=require(_0xc5b6('0x6'));var Mustache=require(_0xc5b6('0x7'));var util=require(_0xc5b6('0x8'));var path=require(_0xc5b6('0x9'));var sox=require(_0xc5b6('0xa'));var csv=require(_0xc5b6('0xb'));var ejs=require(_0xc5b6('0xc'));var fs=require('fs');var fs_extra=require(_0xc5b6('0xd'));var _=require(_0xc5b6('0xe'));var squel=require(_0xc5b6('0xf'));var crypto=require(_0xc5b6('0x10'));var jsforce=require(_0xc5b6('0x11'));var deskjs=require(_0xc5b6('0x12'));var toCsv=require('to-csv');var querystring=require(_0xc5b6('0x13'));var Papa=require(_0xc5b6('0x14'));var Redis=require(_0xc5b6('0x15'));var authService=require('../../components/auth/service');var qs=require(_0xc5b6('0x16'));var as=require(_0xc5b6('0x17'));var hardwareService=require(_0xc5b6('0x18'));var logger=require(_0xc5b6('0x19'))(_0xc5b6('0x1a'));var utils=require(_0xc5b6('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xc5b6('0x1c'));var db=require(_0xc5b6('0x1d'))['db'];config[_0xc5b6('0x1e')]=_[_0xc5b6('0x1f')](config[_0xc5b6('0x1e')],{'host':_0xc5b6('0x20'),'port':0x18eb});var socket=require(_0xc5b6('0x21'))(new Redis(config[_0xc5b6('0x1e')]));require(_0xc5b6('0x22'))[_0xc5b6('0x23')](socket);var jayson=require(_0xc5b6('0x24'));var client=jayson[_0xc5b6('0x25')][_0xc5b6('0x26')]({'port':0x232c});var client9002=jayson[_0xc5b6('0x25')]['http']({'port':0x232a});var client9003=jayson[_0xc5b6('0x25')][_0xc5b6('0x26')]({'port':0x232b});var client9001=jayson[_0xc5b6('0x25')][_0xc5b6('0x26')]({'port':0x2329});function respondWithRpcPromise(_0x2cace9,_0x2223fb,_0x19829d,_0x31081b){return new BPromise(function(_0x3df75d,_0x3c0c02){var _0x36d338=_0x31081b||client;return _0x36d338['request'](_0x2cace9,_0x19829d)['then'](function(_0x132ced){logger[_0xc5b6('0x27')](_0xc5b6('0x28'),_0x2223fb,_0xc5b6('0x29'));logger[_0xc5b6('0x2a')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2223fb,_0xc5b6('0x29'),JSON[_0xc5b6('0x2b')](_0x132ced));if(_0x132ced[_0xc5b6('0x2c')]){if(_0x132ced['error'][_0xc5b6('0x2d')]===0x1f4){logger['error'](_0xc5b6('0x28'),_0x2223fb,_0x132ced[_0xc5b6('0x2c')][_0xc5b6('0x2e')]);return _0x3c0c02(_0x132ced['error'][_0xc5b6('0x2e')]);}logger['error'](_0xc5b6('0x28'),_0x2223fb,_0x132ced['error'][_0xc5b6('0x2e')]);return _0x3df75d(_0x132ced[_0xc5b6('0x2c')]['message']);}else{logger[_0xc5b6('0x27')](_0xc5b6('0x28'),_0x2223fb,_0xc5b6('0x29'));_0x3df75d(_0x132ced[_0xc5b6('0x2f')]['message']);}})['catch'](function(_0x278e3b){logger[_0xc5b6('0x2c')](_0xc5b6('0x28'),_0x2223fb,_0x278e3b);_0x3c0c02(_0x278e3b);});});}function respondWithStatusCode(_0x8e4e51,_0x22aa65){_0x22aa65=_0x22aa65||0xcc;return function(_0x143a88){if(_0x143a88){return _0x8e4e51[_0xc5b6('0x30')](_0x22aa65);}return _0x8e4e51[_0xc5b6('0x31')](_0x22aa65)[_0xc5b6('0x32')]();};}function respondWithResult(_0x3b19bd,_0xa972fc){_0xa972fc=_0xa972fc||0xc8;return function(_0x268172){if(_0x268172){return _0x3b19bd[_0xc5b6('0x31')](_0xa972fc)[_0xc5b6('0x33')](_0x268172);}};}function respondWithFilteredResult(_0x57c1ed,_0x333875){return function(_0x362257){if(_0x362257){var _0x1323b1=typeof _0x333875['offset']===_0xc5b6('0x34')&&typeof _0x333875[_0xc5b6('0x35')]===_0xc5b6('0x34');var _0x6558a2=_0x362257[_0xc5b6('0x36')];var _0x2f12af=_0x1323b1?0x0:_0x333875['offset'];var _0x3fb955=_0x1323b1?_0x362257[_0xc5b6('0x36')]:_0x333875[_0xc5b6('0x37')]+_0x333875[_0xc5b6('0x35')];var _0x5cc926;if(_0x3fb955>=_0x6558a2){_0x3fb955=_0x6558a2;_0x5cc926=0xc8;}else{_0x5cc926=0xce;}_0x57c1ed[_0xc5b6('0x31')](_0x5cc926);return _0x57c1ed[_0xc5b6('0x38')](_0xc5b6('0x39'),_0x2f12af+'-'+_0x3fb955+'/'+_0x6558a2)[_0xc5b6('0x33')](_0x362257);}return null;};}function patchUpdates(_0x31984c){return function(_0x3849ac){try{jsonpatch[_0xc5b6('0x3a')](_0x3849ac,_0x31984c,!![]);}catch(_0x46796d){return BPromise[_0xc5b6('0x3b')](_0x46796d);}return _0x3849ac[_0xc5b6('0x3c')]();};}function saveUpdates(_0xefce63,_0x37a8e6){return function(_0x9987fd){if(_0x9987fd){return _0x9987fd[_0xc5b6('0x3d')](_0xefce63)['then'](function(_0x49bd9d){return _0x49bd9d;});}return null;};}function removeEntity(_0x3c60c8,_0x1832b4){return function(_0x4089c0){if(_0x4089c0){return _0x4089c0[_0xc5b6('0x3e')]()['then'](function(){var _0x392306=_0x4089c0[_0xc5b6('0x3f')]({'plain':!![]});var _0x27420a='ChatWebsites';return db[_0xc5b6('0x40')][_0xc5b6('0x3e')]({'where':{'type':_0x27420a,'resourceId':_0x392306['id']}})[_0xc5b6('0x41')](function(){return _0x4089c0;});})[_0xc5b6('0x41')](function(){_0x3c60c8['status'](0xcc)[_0xc5b6('0x32')]();});}};}function handleEntityNotFound(_0x3e6035,_0x438cd8){return function(_0x2d0689){if(!_0x2d0689){_0x3e6035[_0xc5b6('0x30')](0x194);}return _0x2d0689;};}function handleError(_0x203992,_0xcd784b){_0xcd784b=_0xcd784b||0x1f4;return function(_0x5990c1){logger[_0xc5b6('0x2c')](_0x5990c1[_0xc5b6('0x42')]);if(_0x5990c1[_0xc5b6('0x43')]){delete _0x5990c1[_0xc5b6('0x43')];}_0x203992['status'](_0xcd784b)[_0xc5b6('0x44')](_0x5990c1);};}exports[_0xc5b6('0x45')]=function(_0x52eff6,_0x316fc5){var _0x515d4d={'include':[{'model':db['Pause'],'as':_0xc5b6('0x46')}]},_0x5d1e24={},_0x13b822={'count':0x0,'rows':[]};var _0x5b31f9=_[_0xc5b6('0x47')](db[_0xc5b6('0x48')][_0xc5b6('0x49')],function(_0xdf9bbd){return{'name':_0xdf9bbd[_0xc5b6('0x4a')],'type':_0xdf9bbd[_0xc5b6('0x4b')]['key']};});_0x5d1e24[_0xc5b6('0x4c')]=_[_0xc5b6('0x47')](_0x5b31f9,'name');_0x5d1e24['query']=_[_0xc5b6('0x4d')](_0x52eff6[_0xc5b6('0x4e')]);_0x5d1e24[_0xc5b6('0x4f')]=_[_0xc5b6('0x50')](_0x5d1e24[_0xc5b6('0x4c')],_0x5d1e24['query']);_0x515d4d[_0xc5b6('0x51')]=_[_0xc5b6('0x50')](_0x5d1e24[_0xc5b6('0x4c')],qs[_0xc5b6('0x52')](_0x52eff6[_0xc5b6('0x4e')]['fields']));_0x515d4d[_0xc5b6('0x51')]=_0x515d4d[_0xc5b6('0x51')]['length']?_0x515d4d[_0xc5b6('0x51')]:_0x5d1e24['model'];if(!_0x52eff6[_0xc5b6('0x4e')][_0xc5b6('0x53')]('nolimit')){_0x515d4d[_0xc5b6('0x35')]=qs[_0xc5b6('0x35')](_0x52eff6['query'][_0xc5b6('0x35')]);_0x515d4d[_0xc5b6('0x37')]=qs[_0xc5b6('0x37')](_0x52eff6[_0xc5b6('0x4e')][_0xc5b6('0x37')]);}_0x515d4d[_0xc5b6('0x54')]=qs[_0xc5b6('0x55')](_0x52eff6['query'][_0xc5b6('0x55')]);_0x515d4d['where']=qs[_0xc5b6('0x4f')](_['pick'](_0x52eff6['query'],_0x5d1e24[_0xc5b6('0x4f')]),_0x5b31f9);if(_0x52eff6[_0xc5b6('0x4e')]['filter']){_0x515d4d[_0xc5b6('0x56')]=_[_0xc5b6('0x57')](_0x515d4d[_0xc5b6('0x56')],{'$or':_[_0xc5b6('0x47')](_0x5b31f9,function(_0x27038d){if(_0x27038d[_0xc5b6('0x4b')]!=='VIRTUAL'){var _0x517db2={};_0x517db2[_0x27038d[_0xc5b6('0x43')]]={'$like':'%'+_0x52eff6['query'][_0xc5b6('0x58')]+'%'};return _0x517db2;}})});}_0x515d4d=_[_0xc5b6('0x57')]({},_0x515d4d,_0x52eff6[_0xc5b6('0x59')]);var _0x92ff62={'where':_0x515d4d['where']};return db[_0xc5b6('0x48')][_0xc5b6('0x36')](_0x92ff62)[_0xc5b6('0x41')](function(_0x4217c2){_0x13b822[_0xc5b6('0x36')]=_0x4217c2;if(_0x52eff6[_0xc5b6('0x4e')][_0xc5b6('0x5a')]){_0x515d4d[_0xc5b6('0x5b')]=[{'all':!![]}];}return db[_0xc5b6('0x48')]['findAll'](_0x515d4d);})[_0xc5b6('0x41')](function(_0x1f0cae){_0x13b822[_0xc5b6('0x5c')]=_0x1f0cae;return _0x13b822;})[_0xc5b6('0x41')](respondWithFilteredResult(_0x316fc5,_0x515d4d))[_0xc5b6('0x5d')](handleError(_0x316fc5,null));};exports['show']=function(_0x38654f,_0x1cf71f){var _0x5229d7={'raw':![],'where':{'id':_0x38654f[_0xc5b6('0x5e')]['id']},'include':[{'model':db[_0xc5b6('0x5f')],'as':_0xc5b6('0x46')}]},_0xeceb46={};_0xeceb46['model']=_[_0xc5b6('0x4d')](db[_0xc5b6('0x48')][_0xc5b6('0x49')]);_0xeceb46[_0xc5b6('0x4e')]=_[_0xc5b6('0x4d')](_0x38654f['query']);_0xeceb46[_0xc5b6('0x4f')]=_[_0xc5b6('0x50')](_0xeceb46[_0xc5b6('0x4c')],_0xeceb46[_0xc5b6('0x4e')]);_0x5229d7[_0xc5b6('0x51')]=_[_0xc5b6('0x50')](_0xeceb46[_0xc5b6('0x4c')],qs['fields'](_0x38654f[_0xc5b6('0x4e')]['fields']));_0x5229d7['attributes']=_0x5229d7[_0xc5b6('0x51')]['length']?_0x5229d7[_0xc5b6('0x51')]:_0xeceb46[_0xc5b6('0x4c')];if(_0x38654f[_0xc5b6('0x4e')][_0xc5b6('0x5a')]){_0x5229d7['include']=[{'all':!![]}];}_0x5229d7=_[_0xc5b6('0x57')]({},_0x5229d7,_0x38654f['options']);return db[_0xc5b6('0x48')][_0xc5b6('0x60')](_0x5229d7)['then'](handleEntityNotFound(_0x1cf71f,null))[_0xc5b6('0x41')](respondWithResult(_0x1cf71f,null))[_0xc5b6('0x5d')](handleError(_0x1cf71f,null));};exports['create']=function(_0x1d42c1,_0x4fc907){return db[_0xc5b6('0x48')]['create'](_0x1d42c1[_0xc5b6('0x61')],{})[_0xc5b6('0x41')](function(_0x3938dd){var _0x47aa4d=_0x1d42c1[_0xc5b6('0x62')][_0xc5b6('0x3f')]({'plain':!![]});if(!_0x47aa4d)throw new Error(_0xc5b6('0x63'));if(_0x47aa4d['role']===_0xc5b6('0x62')){var _0x3bbb0c=_0x3938dd[_0xc5b6('0x3f')]({'plain':!![]});var _0x5d2882=_0xc5b6('0x64');return db[_0xc5b6('0x65')][_0xc5b6('0x60')]({'where':{'name':_0x5d2882,'userProfileId':_0x47aa4d[_0xc5b6('0x66')]},'raw':!![]})['then'](function(_0x489ceb){if(_0x489ceb&&_0x489ceb['autoAssociation']===0x0){return db[_0xc5b6('0x40')][_0xc5b6('0x67')]({'name':_0x3bbb0c['name'],'resourceId':_0x3bbb0c['id'],'type':_0x489ceb[_0xc5b6('0x43')],'sectionId':_0x489ceb['id']},{})[_0xc5b6('0x41')](function(){return _0x3938dd;});}else{return _0x3938dd;}})['catch'](function(_0x10d19c){logger[_0xc5b6('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10d19c);throw _0x10d19c;});}return _0x3938dd;})[_0xc5b6('0x41')](respondWithResult(_0x4fc907,0xc9))['catch'](handleError(_0x4fc907,null));};exports[_0xc5b6('0x3d')]=function(_0x2fa9bd,_0xeb07f3){if(_0x2fa9bd[_0xc5b6('0x61')]['id']){delete _0x2fa9bd[_0xc5b6('0x61')]['id'];}return db['ChatWebsite'][_0xc5b6('0x60')]({'where':{'id':_0x2fa9bd[_0xc5b6('0x5e')]['id']},'include':[{'model':db[_0xc5b6('0x5f')],'as':_0xc5b6('0x46')}]})[_0xc5b6('0x41')](handleEntityNotFound(_0xeb07f3,null))['then'](saveUpdates(_0x2fa9bd[_0xc5b6('0x61')],null))[_0xc5b6('0x41')](respondWithResult(_0xeb07f3,null))[_0xc5b6('0x5d')](handleError(_0xeb07f3,null));};exports[_0xc5b6('0x3e')]=function(_0x5b8d9d,_0x277e62){return db[_0xc5b6('0x48')][_0xc5b6('0x60')]({'where':{'id':_0x5b8d9d[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x277e62,null))[_0xc5b6('0x41')](removeEntity(_0x277e62,null))[_0xc5b6('0x5d')](handleError(_0x277e62,null));};exports[_0xc5b6('0x68')]=function(_0x4e076b,_0x4c3e17){return db[_0xc5b6('0x48')][_0xc5b6('0x68')]()[_0xc5b6('0x41')](respondWithResult(_0x4c3e17,null))[_0xc5b6('0x5d')](handleError(_0x4c3e17,null));};exports['addDisposition']=function(_0x3c1385,_0x21b1f2,_0x356aee){if(_0x3c1385[_0xc5b6('0x61')]['id']){delete _0x3c1385[_0xc5b6('0x61')]['id'];}return db[_0xc5b6('0x48')][_0xc5b6('0x60')]({'where':{'id':_0x3c1385[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x21b1f2,null))[_0xc5b6('0x41')](function(_0x4487f6){if(_0x4487f6){_0x3c1385[_0xc5b6('0x61')][_0xc5b6('0x69')]=_0x4487f6['id'];return db['Disposition'][_0xc5b6('0x67')](_0x3c1385['body']);}})[_0xc5b6('0x41')](respondWithResult(_0x21b1f2,null))['catch'](handleError(_0x21b1f2,null));};exports[_0xc5b6('0x6a')]=function(_0x1aac65,_0x15e4a2,_0x22e6c2){var _0x254e45={'raw':![],'where':{}};var _0x2cf6f2={};var _0x3e730b={'count':0x0,'rows':[]};return db[_0xc5b6('0x48')][_0xc5b6('0x6b')]({'where':{'id':_0x1aac65[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x15e4a2,null))[_0xc5b6('0x41')](function(_0x4c0bb7){if(_0x4c0bb7){_0x2cf6f2[_0xc5b6('0x4c')]=_[_0xc5b6('0x4d')](db[_0xc5b6('0x6c')][_0xc5b6('0x49')]);_0x2cf6f2[_0xc5b6('0x4e')]=_[_0xc5b6('0x4d')](_0x1aac65[_0xc5b6('0x4e')]);_0x2cf6f2['filters']=_[_0xc5b6('0x50')](_0x2cf6f2[_0xc5b6('0x4c')],_0x2cf6f2[_0xc5b6('0x4e')]);_0x254e45[_0xc5b6('0x51')]=_['intersection'](_0x2cf6f2[_0xc5b6('0x4c')],qs[_0xc5b6('0x52')](_0x1aac65[_0xc5b6('0x4e')]['fields']));_0x254e45[_0xc5b6('0x51')]=_0x254e45[_0xc5b6('0x51')]['length']?_0x254e45[_0xc5b6('0x51')]:_0x2cf6f2[_0xc5b6('0x4c')];if(!_0x1aac65['query'][_0xc5b6('0x53')](_0xc5b6('0x6d'))){_0x254e45[_0xc5b6('0x35')]=qs[_0xc5b6('0x35')](_0x1aac65[_0xc5b6('0x4e')][_0xc5b6('0x35')]);_0x254e45['offset']=qs[_0xc5b6('0x37')](_0x1aac65[_0xc5b6('0x4e')][_0xc5b6('0x37')]);}_0x254e45[_0xc5b6('0x54')]=qs[_0xc5b6('0x55')](_0x1aac65[_0xc5b6('0x4e')][_0xc5b6('0x55')]);_0x254e45['where']=qs[_0xc5b6('0x4f')](_[_0xc5b6('0x6e')](_0x1aac65['query'],_0x2cf6f2[_0xc5b6('0x4f')]));_0x254e45[_0xc5b6('0x56')]['ChatWebsiteId']=_0x4c0bb7['id'];if(_0x1aac65[_0xc5b6('0x4e')]['filter']){_0x254e45['where']=_[_0xc5b6('0x57')](_0x254e45[_0xc5b6('0x56')],{'$or':_[_0xc5b6('0x47')](_0x254e45[_0xc5b6('0x51')],function(_0x5edb6e){var _0x1c5e8f={};_0x1c5e8f[_0x5edb6e]={'$like':'%'+_0x1aac65[_0xc5b6('0x4e')][_0xc5b6('0x58')]+'%'};return _0x1c5e8f;})});}_0x254e45=_[_0xc5b6('0x57')]({},_0x254e45,_0x1aac65[_0xc5b6('0x59')]);return db['Disposition'][_0xc5b6('0x36')]({'where':_0x254e45['where']})[_0xc5b6('0x41')](function(_0x358668){_0x3e730b[_0xc5b6('0x36')]=_0x358668;if(_0x1aac65[_0xc5b6('0x4e')][_0xc5b6('0x5a')]){_0x254e45['include']=[{'all':!![]}];}return db[_0xc5b6('0x6c')][_0xc5b6('0x6f')](_0x254e45);})['then'](function(_0x3fee1d){_0x3e730b[_0xc5b6('0x5c')]=_0x3fee1d;return _0x3e730b;});}})[_0xc5b6('0x41')](respondWithFilteredResult(_0x15e4a2,_0x254e45))['catch'](handleError(_0x15e4a2,null));};exports['removeDispositions']=function(_0x2473c8,_0xeed14c,_0x47ad58){return db[_0xc5b6('0x48')]['find']({'where':{'id':_0x2473c8['params']['id']}})['then'](handleEntityNotFound(_0xeed14c,null))[_0xc5b6('0x41')](function(_0x4521ab){if(_0x4521ab){return _0x4521ab[_0xc5b6('0x70')](_0x2473c8[_0xc5b6('0x4e')][_0xc5b6('0x71')]);}})[_0xc5b6('0x41')](respondWithStatusCode(_0xeed14c,null))[_0xc5b6('0x5d')](handleError(_0xeed14c,null));};exports['addAnswer']=function(_0x3899ea,_0x530b9b,_0x22d907){if(_0x3899ea[_0xc5b6('0x61')]['id']){delete _0x3899ea[_0xc5b6('0x61')]['id'];}return db['ChatWebsite'][_0xc5b6('0x60')]({'where':{'id':_0x3899ea[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x530b9b,null))[_0xc5b6('0x41')](function(_0x462870){if(_0x462870){_0x3899ea[_0xc5b6('0x61')][_0xc5b6('0x69')]=_0x462870['id'];return db[_0xc5b6('0x72')][_0xc5b6('0x67')](_0x3899ea[_0xc5b6('0x61')]);}})[_0xc5b6('0x41')](respondWithResult(_0x530b9b,null))[_0xc5b6('0x5d')](handleError(_0x530b9b,null));};exports['getAnswers']=function(_0x44dbca,_0x105427,_0x2eeb7f){var _0x1abbe4={'raw':![],'where':{}};var _0x5c165d={};var _0x49721b={'count':0x0,'rows':[]};return db[_0xc5b6('0x48')][_0xc5b6('0x6b')]({'where':{'id':_0x44dbca[_0xc5b6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x105427,null))[_0xc5b6('0x41')](function(_0x1ef5ec){if(_0x1ef5ec){_0x5c165d[_0xc5b6('0x4c')]=_[_0xc5b6('0x4d')](db[_0xc5b6('0x72')][_0xc5b6('0x49')]);_0x5c165d[_0xc5b6('0x4e')]=_['keys'](_0x44dbca[_0xc5b6('0x4e')]);_0x5c165d[_0xc5b6('0x4f')]=_[_0xc5b6('0x50')](_0x5c165d[_0xc5b6('0x4c')],_0x5c165d['query']);_0x1abbe4['attributes']=_['intersection'](_0x5c165d[_0xc5b6('0x4c')],qs[_0xc5b6('0x52')](_0x44dbca[_0xc5b6('0x4e')]['fields']));_0x1abbe4[_0xc5b6('0x51')]=_0x1abbe4[_0xc5b6('0x51')][_0xc5b6('0x73')]?_0x1abbe4[_0xc5b6('0x51')]:_0x5c165d[_0xc5b6('0x4c')];if(!_0x44dbca[_0xc5b6('0x4e')]['hasOwnProperty'](_0xc5b6('0x6d'))){_0x1abbe4[_0xc5b6('0x35')]=qs[_0xc5b6('0x35')](_0x44dbca[_0xc5b6('0x4e')]['limit']);_0x1abbe4[_0xc5b6('0x37')]=qs[_0xc5b6('0x37')](_0x44dbca[_0xc5b6('0x4e')][_0xc5b6('0x37')]);}_0x1abbe4[_0xc5b6('0x54')]=qs[_0xc5b6('0x55')](_0x44dbca['query'][_0xc5b6('0x55')]);_0x1abbe4['where']=qs['filters'](_[_0xc5b6('0x6e')](_0x44dbca[_0xc5b6('0x4e')],_0x5c165d[_0xc5b6('0x4f')]));_0x1abbe4[_0xc5b6('0x56')][_0xc5b6('0x69')]=_0x1ef5ec['id'];if(_0x44dbca[_0xc5b6('0x4e')]['filter']){_0x1abbe4['where']=_[_0xc5b6('0x57')](_0x1abbe4[_0xc5b6('0x56')],{'$or':_['map'](_0x1abbe4['attributes'],function(_0x24a85e){var _0x4ebe4d={};_0x4ebe4d[_0x24a85e]={'$like':'%'+_0x44dbca[_0xc5b6('0x4e')]['filter']+'%'};return _0x4ebe4d;})});}_0x1abbe4=_[_0xc5b6('0x57')]({},_0x1abbe4,_0x44dbca['options']);return db['CannedAnswer']['count']({'where':_0x1abbe4[_0xc5b6('0x56')]})[_0xc5b6('0x41')](function(_0x2a4313){_0x49721b[_0xc5b6('0x36')]=_0x2a4313;if(_0x44dbca[_0xc5b6('0x4e')][_0xc5b6('0x5a')]){_0x1abbe4[_0xc5b6('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc5b6('0x6f')](_0x1abbe4);})[_0xc5b6('0x41')](function(_0x331e05){_0x49721b[_0xc5b6('0x5c')]=_0x331e05;return _0x49721b;});}})[_0xc5b6('0x41')](respondWithFilteredResult(_0x105427,_0x1abbe4))[_0xc5b6('0x5d')](handleError(_0x105427,null));};exports[_0xc5b6('0x74')]=function(_0x10440b,_0x347e14,_0xb8cf78){return db[_0xc5b6('0x48')]['find']({'where':{'id':_0x10440b['params']['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x347e14,null))['then'](function(_0xcde56a){if(_0xcde56a){return _0xcde56a[_0xc5b6('0x74')](_0x10440b[_0xc5b6('0x4e')][_0xc5b6('0x71')]);}})[_0xc5b6('0x41')](respondWithStatusCode(_0x347e14,null))[_0xc5b6('0x5d')](handleError(_0x347e14,null));};exports['addLogo']=function(_0x71e976,_0x32521a,_0x589f6b){_0x71e976[_0xc5b6('0x61')]['sitepic']=_0x71e976['file'][_0xc5b6('0x75')];return db['ChatWebsite'][_0xc5b6('0x60')]({'where':{'id':_0x71e976[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x32521a,null))[_0xc5b6('0x41')](saveUpdates(_0x71e976[_0xc5b6('0x61')],null))[_0xc5b6('0x41')](respondWithResult(_0x32521a,null))['catch'](handleError(_0x32521a,null));};exports[_0xc5b6('0x76')]=function(_0xe8d303,_0x5971f6,_0xa63652){_0xe8d303[_0xc5b6('0x61')][_0xc5b6('0x77')]=_0xe8d303[_0xc5b6('0x78')][_0xc5b6('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0xe8d303['params']['id']}})['then'](handleEntityNotFound(_0x5971f6,null))[_0xc5b6('0x41')](saveUpdates(_0xe8d303[_0xc5b6('0x61')],null))[_0xc5b6('0x41')](respondWithResult(_0x5971f6,null))[_0xc5b6('0x5d')](handleError(_0x5971f6,null));};exports['addCustomerAvatar']=function(_0x6fb2e2,_0x10080f,_0x3943c7){_0x6fb2e2['body'][_0xc5b6('0x79')]=_0x6fb2e2[_0xc5b6('0x78')][_0xc5b6('0x75')];return db[_0xc5b6('0x48')][_0xc5b6('0x60')]({'where':{'id':_0x6fb2e2[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x10080f,null))[_0xc5b6('0x41')](saveUpdates(_0x6fb2e2[_0xc5b6('0x61')],null))[_0xc5b6('0x41')](respondWithResult(_0x10080f,null))[_0xc5b6('0x5d')](handleError(_0x10080f,null));};exports[_0xc5b6('0x7a')]=function(_0x1a12c8,_0x3f598b,_0x170749){_0x1a12c8['body']['systemAvatar']=_0x1a12c8[_0xc5b6('0x78')][_0xc5b6('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x1a12c8[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x3f598b,null))[_0xc5b6('0x41')](saveUpdates(_0x1a12c8[_0xc5b6('0x61')],null))['then'](respondWithResult(_0x3f598b,null))[_0xc5b6('0x5d')](handleError(_0x3f598b,null));};exports[_0xc5b6('0x7b')]=function(_0x47a9d9,_0x5a442c,_0x1e3073){var _0x3f67e2=path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],_0xc5b6('0x7e'));var _0x40a0f2={'where':{'id':_0x47a9d9[_0xc5b6('0x5e')]['id']},'attributes':['id',_0xc5b6('0x7f')],'raw':!![]};var _0x5802e3=![];return require(_0xc5b6('0x1c'))[_0xc5b6('0x80')]()[_0xc5b6('0x41')](function(_0x53f8e9){if(_0x53f8e9){_0x5802e3=_0x53f8e9[_0xc5b6('0x81')];}})[_0xc5b6('0x41')](function(){return db[_0xc5b6('0x48')][_0xc5b6('0x60')](_0x40a0f2);})[_0xc5b6('0x41')](handleEntityNotFound(_0x5a442c,null))['then'](function(_0x29d2a2){if(_0x29d2a2){if(!_[_0xc5b6('0x82')](_0x29d2a2[_0xc5b6('0x7f')])){if(fs[_0xc5b6('0x83')](path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],_0xc5b6('0x84'),_0x29d2a2[_0xc5b6('0x7f')]))&&_0x5802e3){_0x3f67e2=path['join'](config[_0xc5b6('0x7d')],_0xc5b6('0x84'),_0x29d2a2[_0xc5b6('0x7f')]);}}return _0x5a442c[_0xc5b6('0x85')](_0x3f67e2);}})[_0xc5b6('0x5d')](handleError(_0x5a442c,null));};exports[_0xc5b6('0x86')]=function(_0x128f24,_0xb987e6,_0x4259d2){var _0x31ae91=path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],_0xc5b6('0x87'));var _0x104b77={'where':{'id':_0x128f24[_0xc5b6('0x5e')]['id']},'attributes':['id',_0xc5b6('0x77')],'raw':!![]};return db[_0xc5b6('0x48')][_0xc5b6('0x60')](_0x104b77)['then'](handleEntityNotFound(_0xb987e6,null))['then'](function(_0x314be5){if(_0x314be5){if(!_[_0xc5b6('0x82')](_0x314be5[_0xc5b6('0x77')])){if(fs[_0xc5b6('0x83')](path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],_0xc5b6('0x88'),_0x314be5[_0xc5b6('0x77')]))){_0x31ae91=path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],_0xc5b6('0x88'),_0x314be5[_0xc5b6('0x77')]);}}return _0xb987e6[_0xc5b6('0x85')](_0x31ae91);}})['catch'](handleError(_0xb987e6,null));};exports[_0xc5b6('0x89')]=function(_0x45364f,_0x1564d0,_0x2038b3){var _0x3f679f=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x12e80f={'where':{'id':_0x45364f['params']['id']},'attributes':['id',_0xc5b6('0x79'),_0xc5b6('0x8a')],'raw':!![]};return db[_0xc5b6('0x48')][_0xc5b6('0x60')](_0x12e80f)[_0xc5b6('0x41')](handleEntityNotFound(_0x1564d0,null))[_0xc5b6('0x41')](function(_0x2d816b){if(_0x2d816b){if(!_[_0xc5b6('0x82')](_0x2d816b[_0xc5b6('0x79')])){if(fs[_0xc5b6('0x83')](path['join'](config['root'],_0xc5b6('0x88'),_0x2d816b['customerAvatar']))&&_0x2d816b[_0xc5b6('0x8a')]){_0x3f679f=path['join'](config[_0xc5b6('0x7d')],_0xc5b6('0x88'),_0x2d816b[_0xc5b6('0x79')]);}}return _0x1564d0[_0xc5b6('0x85')](_0x3f679f);}})[_0xc5b6('0x5d')](handleError(_0x1564d0,null));};exports['getSystemAvatar']=function(_0x3cb1c9,_0x1f9432,_0x138d50){var _0x294dc2=path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],'server/files/images/avatars/system_avatar.png');var _0x15dd0a={'where':{'id':_0x3cb1c9['params']['id']},'attributes':['id',_0xc5b6('0x8b')],'raw':!![]};return db[_0xc5b6('0x48')][_0xc5b6('0x60')](_0x15dd0a)[_0xc5b6('0x41')](handleEntityNotFound(_0x1f9432,null))[_0xc5b6('0x41')](function(_0x522bd3){if(_0x522bd3){if(!_[_0xc5b6('0x82')](_0x522bd3[_0xc5b6('0x8b')])){if(fs[_0xc5b6('0x83')](path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],_0xc5b6('0x88'),_0x522bd3[_0xc5b6('0x8b')]))){_0x294dc2=path['join'](config[_0xc5b6('0x7d')],_0xc5b6('0x88'),_0x522bd3[_0xc5b6('0x8b')]);}}return _0x1f9432[_0xc5b6('0x85')](_0x294dc2);}})[_0xc5b6('0x5d')](handleError(_0x1f9432,null));};exports[_0xc5b6('0x8c')]=function(_0x4243d5,_0x2ac0ee,_0x36f411){var _0x2385ba=require(_0xc5b6('0x8d'));var _0x385094=new _0x2385ba();var _0x237729=_0x385094[_0xc5b6('0x8e')](_0x4243d5['headers'][_0xc5b6('0x8f')])[_0xc5b6('0x90')]();var _0x44b773={'body':_0x4243d5[_0xc5b6('0x61')],'channel':_0xc5b6('0x91')};var _0x5723bb=[];var _0x4a9907=[];var _0x42ce67={};var _0xdedb45=![];return db[_0xc5b6('0x92')]['describe']()[_0xc5b6('0x41')](function(_0x1965d6){if(!_0x1965d6){throw new db['Sequelize'][(_0xc5b6('0x93'))](_0xc5b6('0x94'));}_0x5723bb=_[_0xc5b6('0x95')](_[_0xc5b6('0x4d')](_0x1965d6),['createdAt','updatedAt']);_0x4a9907=_['difference'](_[_0xc5b6('0x4d')](_0x1965d6),[_0xc5b6('0x96'),'updatedAt','CompanyId',_0xc5b6('0x97')]);if(_0x4243d5[_0xc5b6('0x61')]['id']){delete _0x4243d5[_0xc5b6('0x61')]['id'];}if(_[_0xc5b6('0x82')](_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0x98')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xc5b6('0x82')](_0x4243d5['body'][_0xc5b6('0x61')])||_0x4243d5['body']['body']===''){throw new db[(_0xc5b6('0x99'))][(_0xc5b6('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0x9a')])){throw new db['Sequelize'][(_0xc5b6('0x93'))](_0xc5b6('0x9b')+_0x4a9907);}if(!_[_0xc5b6('0x9c')](_0x4a9907,_0x4243d5['body'][_0xc5b6('0x9a')])){throw new db[(_0xc5b6('0x99'))][(_0xc5b6('0x93'))](_0xc5b6('0x9d')+_0x4a9907);}_0x42ce67[_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0x9a')]]=_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0x98')];})[_0xc5b6('0x41')](function(){return db[_0xc5b6('0x48')]['find']({'where':{'id':_0x4243d5['params']['id']},'include':[{'model':db[_0xc5b6('0x9e')],'as':_0xc5b6('0x9f'),'include':[{'model':db['CmContact'],'as':_0xc5b6('0xa0'),'where':_0x42ce67,'limit':0x1,'order':[[_0xc5b6('0xa1'),'DESC']]}]},{'model':db[_0xc5b6('0xa2')],'as':_0xc5b6('0xa3')}]});})[_0xc5b6('0x41')](handleEntityNotFound(_0x2ac0ee,null))[_0xc5b6('0x41')](function(_0x59330d){if(_0x59330d&&_0x59330d[_0xc5b6('0x9f')]){_0x44b773[_0xc5b6('0xa4')]=_0x59330d;_0x44b773[_0xc5b6('0xa5')]=_0x59330d[_0xc5b6('0xa3')];_0x44b773[_0xc5b6('0xa6')]=_0x59330d[_0xc5b6('0x9f')];_0x44b773[_0xc5b6('0xa5')]=_[_0xc5b6('0xa7')](_0x44b773['applications'],['priority'],[_0xc5b6('0xa8')]);if(_0x44b773['account'][_0xc5b6('0xa3')]){delete _0x44b773[_0xc5b6('0xa4')][_0xc5b6('0xa3')];}if(_0x44b773[_0xc5b6('0xa4')][_0xc5b6('0x9f')]&&_0x44b773[_0xc5b6('0xa4')][_0xc5b6('0x9f')][_0xc5b6('0xa0')][_0xc5b6('0x73')]){return _0x44b773[_0xc5b6('0xa4')][_0xc5b6('0x9f')][_0xc5b6('0xa0')][0x0];}var _0x161f1c=_[_0xc5b6('0x1f')](_0x4243d5[_0xc5b6('0x61')],{'firstName':_0x4243d5['body'][_0xc5b6('0x98')],'ListId':_0x59330d[_0xc5b6('0x97')]});_0x161f1c[_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0x9a')]]=_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0x98')];return db['CmContact'][_0xc5b6('0x67')](_0x161f1c,{'fields':_0x5723bb,'raw':!![]});}})['then'](handleEntityNotFound(_0x2ac0ee,null))[_0xc5b6('0x41')](function(_0x4c9446){_0x44b773['contact']=_0x4c9446;var _0x55e20f=_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xa9')];if(_0x4243d5[_0xc5b6('0xaa')][_0xc5b6('0xab')]){_0x55e20f=_0x4243d5[_0xc5b6('0xaa')][_0xc5b6('0xab')];}else if(_0x4243d5['headers']['x-forwarded-for']){_0x55e20f=_[_0xc5b6('0xac')](_0x4243d5[_0xc5b6('0xaa')][_0xc5b6('0xad')][_0xc5b6('0xae')](','));}if(_0x4c9446){var _0x328200={'ContactId':_0x4c9446['id'],'ChatWebsiteId':_0x4243d5[_0xc5b6('0x5e')]['id'],'from':(_0x4c9446['firstName']||'')+'\x20'+(_0x4c9446[_0xc5b6('0xaf')]||''),'customerIp':_0x55e20f,'customerPort':_0x4243d5[_0xc5b6('0xaa')][_0xc5b6('0xb0')]?_0x4243d5[_0xc5b6('0xaa')][_0xc5b6('0xb0')]:null,'referer':_0x4243d5[_0xc5b6('0x61')]['referer'],'browserName':_0x237729[_0xc5b6('0xb1')][_0xc5b6('0x43')]&&_0x237729['browser'][_0xc5b6('0xb2')]?util[_0xc5b6('0xb3')](_0xc5b6('0xb4'),_0x237729[_0xc5b6('0xb1')][_0xc5b6('0x43')],_0x237729[_0xc5b6('0xb1')][_0xc5b6('0xb2')]):_0xc5b6('0xb5'),'browserVersion':_0x237729['browser']['version']||_0xc5b6('0xb5'),'osName':util[_0xc5b6('0xb3')](_0xc5b6('0xb4'),_0x237729['os'][_0xc5b6('0x43')],_0x237729['os']['version']),'osVersion':_0x237729['os'][_0xc5b6('0xb2')],'deviceModel':_0x237729[_0xc5b6('0xb6')][_0xc5b6('0x4c')]&&_0x237729[_0xc5b6('0xb6')][_0xc5b6('0xb7')]?util[_0xc5b6('0xb3')](_0xc5b6('0xb8'),_0x237729['device'][_0xc5b6('0x4c')],_0x237729['device'][_0xc5b6('0xb7')],_0x237729[_0xc5b6('0xb6')][_0xc5b6('0x4b')]):null,'deviceVendor':_0x237729[_0xc5b6('0xb6')][_0xc5b6('0xb7')],'deviceType':_0x237729['device']['type'],'formData':JSON[_0xc5b6('0x2b')](_0x4243d5[_0xc5b6('0x61')])};var _0x142e9b={'ChatWebsiteId':_0x4243d5[_0xc5b6('0x5e')]['id'],'closed':![]};if(_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xb9')]){_0x142e9b[_0xc5b6('0xb9')]=_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xb9')];return db['ChatInteraction'][_0xc5b6('0x60')]({'where':_0x142e9b})[_0xc5b6('0x41')](function(_0x2a22f8){if(_0x2a22f8){return[_0x2a22f8,![]];}_0x328200['threadId']=_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xb9')];_0x328200[_0xc5b6('0xba')]=_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xba')];return db[_0xc5b6('0xbb')][_0xc5b6('0x67')](_0x328200)[_0xc5b6('0x41')](function(_0x253e70){return[_0x253e70,!![]];});});}_0x142e9b[_0xc5b6('0xbc')]=_0x4c9446['id'];if(_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xbd')]&&_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xbd')]['id']){_0x142e9b['id']=_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xbd')]['id'];return db[_0xc5b6('0xbb')]['find']({'where':_0x142e9b})[_0xc5b6('0x41')](function(_0x596358){if(_0x596358){return[_0x596358,![]];}return db['ChatInteraction']['create'](_0x328200)['then'](function(_0x2428aa){return[_0x2428aa,!![]];});});}return db[_0xc5b6('0xbb')][_0xc5b6('0x67')](_0x328200)[_0xc5b6('0x41')](function(_0xee3289){return[_0xee3289,!![]];});}})[_0xc5b6('0xbe')](function(_0x1db172,_0x5c1566){if(_0x1db172){_0xdedb45=_0x5c1566;if(!_0x5c1566){var _0x406691={'from':(_0x44b773[_0xc5b6('0xbf')][_0xc5b6('0xc0')]||'')+'\x20'+(_0x44b773[_0xc5b6('0xbf')][_0xc5b6('0xaf')]||'')};if(_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xb9')]&&_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xc1')]&&_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xb9')]!=_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xc1')]){_0x406691[_0xc5b6('0xb9')]=_0x4243d5[_0xc5b6('0x61')]['messageId'];}return _0x1db172[_0xc5b6('0x3d')](_0x406691);}else{return _0x1db172;}}})['then'](function(_0x10b5ce){_0x44b773['interaction']=_0x10b5ce['get']({'plain':!![]});_0x44b773[_0xc5b6('0xbd')][_0xc5b6('0xc2')]=_0xdedb45;if(_0x44b773[_0xc5b6('0xbd')][_0xc5b6('0xc2')]){if(_0x44b773[_0xc5b6('0xa4')][_0xc5b6('0xc3')]){_0x44b773[_0xc5b6('0xa5')]['push']({'id':0x0,'priority':_0x44b773[_0xc5b6('0xa5')][_0xc5b6('0x73')]+0x1,'app':'close','appdata':_0xc5b6('0xc4'),'interval':_0xc5b6('0xc5')});}}return db[_0xc5b6('0xc6')][_0xc5b6('0x67')]({'body':_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0x61')],'ChatWebsiteId':_0x4243d5[_0xc5b6('0x5e')]['id'],'ChatInteractionId':_0x10b5ce['id'],'direction':'in','ContactId':_0x44b773[_0xc5b6('0xbf')]['id'],'AttachmentId':_0x4243d5[_0xc5b6('0x61')][_0xc5b6('0xc7')]});})[_0xc5b6('0x41')](function(_0xf2e5ba){_0x44b773[_0xc5b6('0x2e')]=_0xf2e5ba;if(_0x44b773[_0xc5b6('0xbd')][_0xc5b6('0xc8')]){return db[_0xc5b6('0xc9')][_0xc5b6('0x60')]({'attributes':['id',_0xc5b6('0x43')],'where':{'id':_0x44b773[_0xc5b6('0xbd')][_0xc5b6('0xc8')]}})[_0xc5b6('0x41')](function(_0x3ad2e2){if(_0x3ad2e2){_0x44b773[_0xc5b6('0xa5')][_0xc5b6('0xca')]({'id':0x0,'priority':0x0,'app':_0xc5b6('0xcb'),'appdata':_0x3ad2e2[_0xc5b6('0x43')]+','+(_0x44b773[_0xc5b6('0xa4')]['waitForTheAssignedAgent']||0xa),'interval':_0xc5b6('0xc5')});_0x44b773[_0xc5b6('0xcc')]=!![];}return respondWithRpcPromise(_0xc5b6('0xcd'),_0xc5b6('0xce'),_0x44b773);});}return respondWithRpcPromise(_0xc5b6('0xcd'),_0xc5b6('0xce'),_0x44b773);})[_0xc5b6('0x41')](function(_0x1dc54d){respondWithRpcPromise(_0xc5b6('0xcf'),_0xc5b6('0xcf'),{'event':_0xc5b6('0x8c'),'message':_0x1dc54d},client9002);return _0x1dc54d;})[_0xc5b6('0x41')](respondWithResult(_0x2ac0ee,null))['catch'](handleError(_0x2ac0ee,null));};exports[_0xc5b6('0xd0')]=function(_0x366a99,_0x266c2a,_0x4b7dd0){var _0xbe8426,_0x24e969,_0x21e278;var _0x367f54=[];var _0x4d3de0=[];var _0x6d5d2e={};var _0x4a7a48=_0x366a99[_0xc5b6('0xd1')]||[];var _0x1703db=[];var _0x937d51;return db[_0xc5b6('0x92')][_0xc5b6('0x68')]()[_0xc5b6('0x41')](function(_0x44e602){if(!_0x44e602){throw new db[(_0xc5b6('0x99'))][(_0xc5b6('0x93'))](_0xc5b6('0x94'));}_0x4d3de0=_[_0xc5b6('0x95')](_[_0xc5b6('0x4d')](_0x44e602),['createdAt',_0xc5b6('0xa1')]);_0x367f54=_['difference'](_[_0xc5b6('0x4d')](_0x44e602),[_0xc5b6('0x96'),_0xc5b6('0xa1'),_0xc5b6('0xd2'),_0xc5b6('0x97')]);if(_0x366a99[_0xc5b6('0x61')]['id']){delete _0x366a99[_0xc5b6('0x61')]['id'];}if(_[_0xc5b6('0x82')](_0x366a99['body']['from'])){throw _0x266c2a['status'](0x1f4)[_0xc5b6('0x44')](new db[(_0xc5b6('0x99'))][(_0xc5b6('0x93'))](_0xc5b6('0xd3')));}if(_[_0xc5b6('0x82')](_0x366a99[_0xc5b6('0x61')]['body'])||_0x366a99['body'][_0xc5b6('0x61')]===''){throw _0x266c2a[_0xc5b6('0x31')](0x1f4)[_0xc5b6('0x44')](new db[(_0xc5b6('0x99'))][(_0xc5b6('0x93'))](_0xc5b6('0xd4')));}if(_[_0xc5b6('0x82')](_0x366a99[_0xc5b6('0x61')]['mapKeyOffline'])){throw _0x266c2a['status'](0x1f4)['send'](new db[(_0xc5b6('0x99'))][(_0xc5b6('0x93'))](_0xc5b6('0xd5')+_0x367f54));}if(!_[_0xc5b6('0x9c')](_0x367f54,_0x366a99[_0xc5b6('0x61')]['mapKeyOffline'])){throw _0x266c2a[_0xc5b6('0x31')](0x1f4)[_0xc5b6('0x44')](new db[(_0xc5b6('0x99'))][(_0xc5b6('0x93'))](_0xc5b6('0xd6')+_0x367f54));}_0x6d5d2e[_0x366a99[_0xc5b6('0x61')]['mapKeyOffline']]=_0x366a99[_0xc5b6('0x61')]['from'];})[_0xc5b6('0x41')](function(){return db[_0xc5b6('0x48')][_0xc5b6('0x60')]({'where':{'id':_0x366a99[_0xc5b6('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0xc5b6('0x9f')},{'model':db[_0xc5b6('0xd7')],'as':_0xc5b6('0xd7')}]});})[_0xc5b6('0x41')](handleEntityNotFound(_0x266c2a,null))[_0xc5b6('0x41')](function(_0x711895){if(_0x711895&&_0x711895[_0xc5b6('0x9f')]){_0x24e969=_0x711895;var _0x43d336=_['defaults'](_0x366a99[_0xc5b6('0x61')],{'firstName':_0x366a99[_0xc5b6('0x61')][_0xc5b6('0x98')],'phone':_0x366a99[_0xc5b6('0x61')][_0xc5b6('0x98')],'ListId':_0x711895[_0xc5b6('0x97')]});_0x43d336[_0x366a99[_0xc5b6('0x61')][_0xc5b6('0xd8')]]=_0x366a99[_0xc5b6('0x61')][_0xc5b6('0x98')];return db[_0xc5b6('0x92')][_0xc5b6('0xd9')]({'where':_0x6d5d2e,'defaults':_0x43d336});}})[_0xc5b6('0xbe')](function(_0x5d902a){if(_0x5d902a){_0x21e278=_0x5d902a;var _0x2f2ca0=fs[_0xc5b6('0xda')](path['join'](config[_0xc5b6('0x7d')],_0xc5b6('0xdb')),_0xc5b6('0xdc'));var _0x2db8dd=ejs[_0xc5b6('0xdd')](_0x2f2ca0,{'body':_['toPairs'](_0x366a99[_0xc5b6('0x61')]['body']),'bodyTitle':_0x24e969[_0xc5b6('0xde')]});return db[_0xc5b6('0xdf')][_0xc5b6('0x67')]({'body':_0x2db8dd,'ContactId':_0x5d902a['id'],'ChatWebsiteId':_0x24e969['id']});}})[_0xc5b6('0x41')](function(_0x3a5d27){_0x937d51=_0x3a5d27;if(_0x4a7a48[_0xc5b6('0x73')]){var _0x275dd3=_0x4a7a48[_0xc5b6('0x47')](function(_0x3a0995){return{'name':_0x3a0995[_0xc5b6('0xe0')],'basename':_0x3a0995['filename'],'type':_0x3a0995['mimetype'],'ChatOfflineMessageId':_0x3a5d27['id']};});_0x1703db=_0x275dd3[_0xc5b6('0x47')](_0x53d586=>{var _0x3a3a1e={'filename':_0x53d586[_0xc5b6('0x43')],'path':path['join'](config[_0xc5b6('0x7d')],'server',_0xc5b6('0xd1'),_0xc5b6('0xe1'),_0xc5b6('0xe2'),_0x53d586['basename'])};return _0x3a3a1e;});if(!_0x24e969[_0xc5b6('0xe3')]){return db['sequelize'][_0xc5b6('0xe4')](function(_0xa8e51b){return db[_0xc5b6('0xe5')][_0xc5b6('0xe6')](_0x275dd3,{'transaction':_0xa8e51b});});}}})[_0xc5b6('0x41')](function(){if(_0x937d51){_0xbe8426=_0x937d51;return db['MailAccount'][_0xc5b6('0x6b')]({'where':{'active':!![]},'include':[{'model':db[_0xc5b6('0xe7')],'as':_0xc5b6('0xe8'),'raw':!![]}]});}})[_0xc5b6('0x41')](function(_0x161446){if(_0x161446&&_0x161446['Smtp']&&_0x24e969[_0xc5b6('0xe9')]&&_0x24e969[_0xc5b6('0xea')]){var _0x255d28={'tls':{'rejectUnauthorized':![]}};if(_0x161446[_0xc5b6('0xe8')][_0xc5b6('0xeb')]){_0x255d28[_0xc5b6('0xeb')]=_0x161446[_0xc5b6('0xe8')][_0xc5b6('0xeb')];}else{_0x255d28[_0xc5b6('0xec')]=_0x161446[_0xc5b6('0xe8')][_0xc5b6('0xec')];_0x255d28[_0xc5b6('0xed')]=_0x161446[_0xc5b6('0xe8')][_0xc5b6('0xed')];_0x255d28['secure']=_0x161446[_0xc5b6('0xe8')][_0xc5b6('0xee')];}if(_0x161446[_0xc5b6('0xe8')][_0xc5b6('0xef')]){_0x255d28['auth']={'user':_0x161446[_0xc5b6('0xe8')]['user'],'pass':_0x161446[_0xc5b6('0xe8')][_0xc5b6('0xf0')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x255d28,'message':{'from':util[_0xc5b6('0xb3')](_0xc5b6('0xf1'),_0x161446[_0xc5b6('0x43')],_0x161446[_0xc5b6('0xf2')]||_0x161446[_0xc5b6('0xe8')]['user']),'to':_0x24e969[_0xc5b6('0xea')],'subject':_0x24e969['offlineMessageSubject'],'html':_0xbe8426['body'],'attachments':_0x1703db}},client9003)['then'](function(){return _0xbe8426;})[_0xc5b6('0x5d')](function(_0x53a2e9){console['error'](_0x53a2e9);});}})['then'](function(){if(_0x24e969&&_0x24e969['openNewInteraction']&&_0x24e969[_0xc5b6('0xf3')]){var _0x473f3e=[];if(_0x4a7a48['length']){_0x473f3e=_0x4a7a48[_0xc5b6('0x47')](function(_0x2d762c){return{'name':_0x2d762c['originalname'],'basename':_0x2d762c[_0xc5b6('0x75')],'type':_0x2d762c[_0xc5b6('0xf4')],'ChatOfflineMessageId':_0x937d51['id']};});}var _0x1892f1;if(!_['isNil'](_0x24e969[_0xc5b6('0xf5')])){var _0x45033a=_[_0xc5b6('0x47')](_0x366a99[_0xc5b6('0x61')],function(_0x1dc346){return _0x1dc346;});var _0x50bdff=_[_0xc5b6('0xf6')](_0x45033a)[0x0];var _0xe27af3=_[_0xc5b6('0xf7')](_0x50bdff,function(_0x123145){return _0x123145;});_0x1892f1=_0xe27af3[0x1][_0x24e969[_0xc5b6('0xf5')]];}var _0x1b27d4={'from':_0x21e278[_0xc5b6('0xf2')],'firstName':_0x21e278[_0xc5b6('0xc0')],'lastName':_0x21e278[_0xc5b6('0xaf')],'mapKey':_0xc5b6('0xf2'),'message':{'from':_0x21e278[_0xc5b6('0xf2')],'to':_0x24e969[_0xc5b6('0xd7')][_0xc5b6('0xf2')],'cc':'','subject':_['isNil'](_0x1892f1)?_0x24e969[_0xc5b6('0xf8')]:_0x1892f1,'messageId':'','sentAt':new Date(),'attach':_0x473f3e[_0xc5b6('0x73')],'attachments':_0x473f3e,'originChannel':_0xc5b6('0xf9'),'ChatWebsiteId':_0x24e969['id'],'ChatOfflineMessageId':_0xbe8426['id'],'originTo':_0x24e969[_0xc5b6('0xd7')][_0xc5b6('0xf2')]},'body':_0xbe8426[_0xc5b6('0x61')]};var _0x53a711={'account':{'id':_0x24e969[_0xc5b6('0xf3')]},'body':_0x1b27d4,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xc5b6('0xfa'),_0xc5b6('0xfb'),_0x53a711,client9001)['then'](function(){return _0xbe8426;})[_0xc5b6('0x5d')](function(_0x307717){console[_0xc5b6('0x2c')](_0x307717);});}return;})[_0xc5b6('0x41')](function(){if(_0xbe8426){return _0xbe8426;}})['then'](respondWithResult(_0x266c2a,null))['catch'](function(_0x594e0b){console[_0xc5b6('0x2c')](_0xc5b6('0x5d'),_0x594e0b);for(var _0x5c7bc2 of _0x4a7a48){var _0x53425a=path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],_0xc5b6('0xfc'),_0xc5b6('0xd1'),_0xc5b6('0xe1'),_0xc5b6('0xe2'),_0x5c7bc2[_0xc5b6('0x75')]);fs_extra[_0xc5b6('0xfd')](_0x53425a)[_0xc5b6('0x5d')](function(_0x277951){console[_0xc5b6('0x2c')](_0xc5b6('0xfe'),_0x53425a,_0x277951);});}});};exports['addInteraction']=function(_0x47a2ed,_0x1fe2b7,_0x14e7a8){return db[_0xc5b6('0xbb')][_0xc5b6('0x60')]({'where':{'id':_0x47a2ed[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x1fe2b7,null))[_0xc5b6('0x41')](function(_0xf4a291){if(_0xf4a291){return _0xf4a291['addInteraction'](_0x47a2ed['body'][_0xc5b6('0x71')],_[_0xc5b6('0xff')](_0x47a2ed[_0xc5b6('0x61')],['ids','id'])||{});}})['then'](respondWithResult(_0x1fe2b7,null))[_0xc5b6('0x5d')](handleError(_0x1fe2b7,null));};exports['getInteractions']=function(_0x229c78,_0x2a6305,_0x33791f){var _0x55b04f={'raw':![],'where':{}};var _0x1aa06b={};var _0x11e3df={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc5b6('0x6b')]({'where':{'id':_0x229c78['params']['id']}})['then'](handleEntityNotFound(_0x2a6305,null))['then'](function(_0x21c457){if(_0x21c457){_0x1aa06b['model']=_[_0xc5b6('0x4d')](db[_0xc5b6('0xbb')]['rawAttributes']);_0x1aa06b['query']=_['keys'](_0x229c78[_0xc5b6('0x4e')]);_0x1aa06b['filters']=_[_0xc5b6('0x50')](_0x1aa06b['model'],_0x1aa06b['query']);_0x55b04f[_0xc5b6('0x51')]=_['intersection'](_0x1aa06b[_0xc5b6('0x4c')],qs[_0xc5b6('0x52')](_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x52')]));_0x55b04f[_0xc5b6('0x51')]=_0x55b04f[_0xc5b6('0x51')][_0xc5b6('0x73')]?_0x55b04f[_0xc5b6('0x51')]:_0x1aa06b[_0xc5b6('0x4c')];if(!_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x53')](_0xc5b6('0x6d'))){_0x55b04f['limit']=qs[_0xc5b6('0x35')](_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x35')]);_0x55b04f['offset']=qs[_0xc5b6('0x37')](_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x37')]);}_0x55b04f[_0xc5b6('0x54')]=qs[_0xc5b6('0x55')](_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x55')]);_0x55b04f[_0xc5b6('0x56')]=qs[_0xc5b6('0x4f')](_[_0xc5b6('0x6e')](_0x229c78[_0xc5b6('0x4e')],_0x1aa06b[_0xc5b6('0x4f')]));_0x55b04f['where']['ChatWebsiteId']=_0x21c457['id'];if(_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x58')]){_0x55b04f[_0xc5b6('0x56')]=_['merge'](_0x55b04f['where'],{'$or':_[_0xc5b6('0x47')](_0x55b04f['attributes'],function(_0xbeb3f){var _0x32bec4={};_0x32bec4[_0xbeb3f]={'$like':'%'+_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x58')]+'%'};return _0x32bec4;})});}_0x55b04f=_[_0xc5b6('0x57')]({},_0x55b04f,_0x229c78[_0xc5b6('0x59')]);return db[_0xc5b6('0xbb')]['count']({'where':_0x55b04f[_0xc5b6('0x56')]})['then'](function(_0x598b80){_0x11e3df['count']=_0x598b80;if(_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x5a')]){_0x55b04f[_0xc5b6('0x5b')]=[{'model':db[_0xc5b6('0x92')],'as':_0xc5b6('0x100'),'required':![]},{'model':db[_0xc5b6('0xc9')],'as':_0xc5b6('0x101'),'attributes':[_0xc5b6('0x43'),_0xc5b6('0x102'),_0xc5b6('0x103')],'required':![]},{'model':db[_0xc5b6('0x104')],'as':_0xc5b6('0x105'),'attributes':['id',_0xc5b6('0x43'),'color'],'where':_0x229c78['query'][_0xc5b6('0x106')]?{'id':_0x229c78[_0xc5b6('0x4e')][_0xc5b6('0x106')]}:undefined,'required':_0x229c78['query'][_0xc5b6('0x106')]?!![]:![]}];}return db[_0xc5b6('0xbb')][_0xc5b6('0x6f')](_0x55b04f);})[_0xc5b6('0x41')](function(_0x1e4c7e){_0x11e3df['rows']=_0x1e4c7e;return _0x11e3df;});}})[_0xc5b6('0x41')](respondWithFilteredResult(_0x2a6305,_0x55b04f))[_0xc5b6('0x5d')](handleError(_0x2a6305,null));};function iftimePromise(_0x14527c,_0x46104c){return respondWithRpcPromise(_0xc5b6('0x107'),_0xc5b6('0x108'),{'command':_0x46104c[_0xc5b6('0x109')]?util[_0xc5b6('0xb3')]('iftime\x20%s,%s',_0x14527c[_0xc5b6('0x10a')],_0x46104c[_0xc5b6('0x109')]):util['format'](_0xc5b6('0x10b'),_0x14527c[_0xc5b6('0x10a')])},client9002)[_0xc5b6('0x41')](function(_0x56030b){var _0x584953=_0x56030b&&_0x56030b[_0xc5b6('0x10c')]('true')>=0x0?!![]:![];logger['info'](_0xc5b6('0x10d'),_0x46104c['id'],_0x14527c['id'],_0x14527c[_0xc5b6('0x10a')],_0x584953?_0xc5b6('0x10e'):_0xc5b6('0x10f'),_0x46104c[_0xc5b6('0x109')]?_0x46104c['timezone']:'No\x20timezone');return _0x584953;})['catch'](function(_0xa1ec30){logger[_0xc5b6('0x2c')](_0xc5b6('0x10d'),_0x46104c['id'],_0x14527c['id'],_0x14527c['interval'],util[_0xc5b6('0x110')](_0xa1ec30,{'showHidden':![],'depth':null}),_0x46104c[_0xc5b6('0x109')]?_0x46104c['timezone']:_0xc5b6('0x111'));return![];});}exports[_0xc5b6('0x108')]=function(_0xf6b37a,_0x52220e,_0x25f89f){var _0x3f2bfa=0x0;var _0xf0027d=0x0;var _0x37cd57=![];var _0x4a4fb0;var _0x34e081;return db[_0xc5b6('0x48')]['find']({'where':{'id':_0xf6b37a[_0xc5b6('0x5e')]['id']},'include':[{'model':db['Interval'],'as':_0xc5b6('0x112'),'include':[{'model':db[_0xc5b6('0x112')],'as':_0xc5b6('0x113'),'attributes':['id',_0xc5b6('0x10a')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x52220e,null))[_0xc5b6('0x41')](function(_0x351eaf){if(_0x351eaf){_0x4a4fb0=_0x351eaf;return _0x351eaf['getProactiveActions']({'raw':!![]});}})[_0xc5b6('0x41')](function(_0x229302){if(_0x4a4fb0){if(_0x229302){_0x34e081=_0x229302;}}return require(_0xc5b6('0x1c'))[_0xc5b6('0x80')]();})[_0xc5b6('0x41')](function(_0x342c64){if(_0x342c64){_0xf0027d=_0x342c64[_0xc5b6('0x114')];_0x37cd57=_0x342c64[_0xc5b6('0x81')];}})['then'](function(){return db[_0xc5b6('0xbb')]['count']({'where':{'closed':![]}});})[_0xc5b6('0x41')](function(_0x387a91){_0x3f2bfa=_0x387a91;if(_0xf0027d&&_0x387a91>_0xf0027d){return db[_0xc5b6('0x115')][_0xc5b6('0x6b')]({'where':{'id':0x1}})[_0xc5b6('0x41')](function(_0x56fffa){if(_0x56fffa){_0x56fffa['increment']('chatLicenseExceeded');}});}})[_0xc5b6('0x41')](function(){if(_0x4a4fb0[_0xc5b6('0x112')]&&_0x4a4fb0[_0xc5b6('0x112')][_0xc5b6('0x113')]){var _0x44d967=[];for(var _0x2c4a57=0x0;_0x2c4a57<_0x4a4fb0['Interval']['Intervals'][_0xc5b6('0x73')];_0x2c4a57++){var _0x31dbc2=_0x4a4fb0['Interval'][_0xc5b6('0x113')][_0x2c4a57][_0xc5b6('0x3f')]({'plain':!![]});_0x44d967[_0xc5b6('0x116')](iftimePromise(_0x31dbc2,_0x4a4fb0));}return BPromise[_0xc5b6('0x117')](_0x44d967)[_0xc5b6('0x41')](function(_0x53b7f3){return _['some'](_0x53b7f3);});}else{return!![];}})[_0xc5b6('0x41')](function(_0x5ed182){var _0x3a7797=fs[_0xc5b6('0xda')](path[_0xc5b6('0x7c')](config[_0xc5b6('0x7d')],_0xc5b6('0x118')),'utf8');var _0x5d9e5b={'remote':_0x4a4fb0[_0xc5b6('0x119')],'query':querystring[_0xc5b6('0x2b')](_[_0xc5b6('0x57')](_0x4a4fb0[_0xc5b6('0x3f')]({'plain':!![]}),{'customerIp':_0xf6b37a[_0xc5b6('0xaa')][_0xc5b6('0xad')]||_0xf6b37a['headers']['x-real-ip']||_0xf6b37a[_0xc5b6('0x11a')]['remoteAddress']||_0xf6b37a['ip'],'referer':_0xf6b37a['headers'][_0xc5b6('0x11b')],'openedInteractions':_0x3f2bfa,'maxInteractions':_0xf0027d,'virtual':_0x37cd57[_0xc5b6('0x114')],'online':_0x5ed182,'custom':_0x37cd57}))[_0xc5b6('0x11c')](/'/g,'\x5c\x27')};_0x52220e[_0xc5b6('0x44')](ejs[_0xc5b6('0xdd')](Mustache[_0xc5b6('0xdd')](_0x3a7797,_0x5d9e5b),{'proactiveActions':_0x34e081,'alignment':_0x4a4fb0[_0xc5b6('0x11d')],'verticalAlignment':_0x4a4fb0['verticalAlignment'],'div_color':_0x4a4fb0[_0xc5b6('0x11e')],'text_color':_0x4a4fb0[_0xc5b6('0x11f')],'button_color':_0x4a4fb0[_0xc5b6('0x120')],'background_color':_0x4a4fb0[_0xc5b6('0x121')]}));})[_0xc5b6('0x5d')](handleError(_0x52220e,null));};exports[_0xc5b6('0x122')]=function(_0x23b20e,_0x1f8e58,_0x18a46e){return db[_0xc5b6('0x48')][_0xc5b6('0x6b')]({'where':{'id':_0x23b20e[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x1f8e58,null))[_0xc5b6('0x41')](function(_0x24092c){if(_0x24092c){return db['sequelize'][_0xc5b6('0xe4')](function(_0x2a42dc){return db[_0xc5b6('0xa2')]['destroy']({'where':{'ChatWebsiteId':_0x23b20e[_0xc5b6('0x5e')]['id']},'transaction':_0x2a42dc})[_0xc5b6('0x41')](function(_0x2f859f){var _0x973318=_[_0xc5b6('0x47')](_0x23b20e[_0xc5b6('0x61')],function(_0x50a71f){_0x50a71f['ChatWebsiteId']=_0x23b20e['params']['id'];return _0x50a71f;});return db[_0xc5b6('0xa2')][_0xc5b6('0xe6')](_0x973318,{'transaction':_0x2a42dc});});})[_0xc5b6('0x41')](function(){return db['ChatApplication'][_0xc5b6('0x123')]({'where':{'ChatWebsiteId':_0x23b20e['params']['id']},'order':_0xc5b6('0x124')});});}})[_0xc5b6('0x41')](respondWithResult(_0x1f8e58,null))[_0xc5b6('0x5d')](handleError(_0x1f8e58,null));};exports[_0xc5b6('0x125')]=function(_0x36bb0d,_0x214aab,_0x4ad394){var _0x631bc6={};var _0x3a1905={};var _0x4a2b6e;var _0x3b7164;return db[_0xc5b6('0x48')][_0xc5b6('0x6b')]({'where':{'id':_0x36bb0d[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x214aab,null))[_0xc5b6('0x41')](function(_0xe7579a){if(_0xe7579a){_0x4a2b6e=_0xe7579a;_0x3a1905['model']=_['keys'](db[_0xc5b6('0xa2')][_0xc5b6('0x49')]);_0x3a1905[_0xc5b6('0x4e')]=_[_0xc5b6('0x4d')](_0x36bb0d[_0xc5b6('0x4e')]);_0x3a1905['filters']=_[_0xc5b6('0x50')](_0x3a1905[_0xc5b6('0x4c')],_0x3a1905[_0xc5b6('0x4e')]);_0x631bc6['attributes']=_[_0xc5b6('0x50')](_0x3a1905[_0xc5b6('0x4c')],qs['fields'](_0x36bb0d[_0xc5b6('0x4e')][_0xc5b6('0x52')]));_0x631bc6[_0xc5b6('0x51')]=_0x631bc6[_0xc5b6('0x51')][_0xc5b6('0x73')]?_0x631bc6[_0xc5b6('0x51')]:_0x3a1905[_0xc5b6('0x4c')];_0x631bc6[_0xc5b6('0x54')]=qs[_0xc5b6('0x55')](_0x36bb0d[_0xc5b6('0x4e')][_0xc5b6('0x55')]);_0x631bc6[_0xc5b6('0x56')]=qs[_0xc5b6('0x4f')](_['pick'](_0x36bb0d[_0xc5b6('0x4e')],_0x3a1905['filters']));if(_0x36bb0d[_0xc5b6('0x4e')][_0xc5b6('0x58')]){_0x631bc6[_0xc5b6('0x56')]=_[_0xc5b6('0x57')](_0x631bc6['where'],{'$or':_['map'](_0x631bc6['attributes'],function(_0x18f0a6){var _0x26dc1a={};_0x26dc1a[_0x18f0a6]={'$like':'%'+_0x36bb0d[_0xc5b6('0x4e')][_0xc5b6('0x58')]+'%'};return _0x26dc1a;})});}_0x631bc6=_['merge']({},_0x631bc6,_0x36bb0d[_0xc5b6('0x59')]);return _0x4a2b6e['getApplications'](_0x631bc6);}})[_0xc5b6('0x41')](function(_0x31637b){if(_0x31637b){_0x3b7164=_0x31637b['length'];if(!_0x36bb0d[_0xc5b6('0x4e')][_0xc5b6('0x53')](_0xc5b6('0x6d'))){_0x631bc6[_0xc5b6('0x35')]=qs[_0xc5b6('0x35')](_0x36bb0d[_0xc5b6('0x4e')]['limit']);_0x631bc6[_0xc5b6('0x37')]=qs[_0xc5b6('0x37')](_0x36bb0d['query'][_0xc5b6('0x37')]);}return _0x4a2b6e['getApplications'](_0x631bc6);}})['then'](function(_0x790fe2){if(_0x790fe2){return _0x790fe2?{'count':_0x3b7164,'rows':_0x790fe2}:null;}})[_0xc5b6('0x41')](respondWithResult(_0x214aab,null))[_0xc5b6('0x5d')](handleError(_0x214aab,null));};exports['addProactiveActions']=function(_0x81e1b4,_0x51a429,_0x48100b){return db[_0xc5b6('0x126')][_0xc5b6('0x60')]({'where':{'id':_0x81e1b4[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x51a429,null))[_0xc5b6('0x41')](function(_0x5bbc41){if(_0x5bbc41){return _0x5bbc41['addProactiveActions'](_0x81e1b4[_0xc5b6('0x61')][_0xc5b6('0x71')],_['omit'](_0x81e1b4[_0xc5b6('0x61')],[_0xc5b6('0x71'),'id'])||{});}})['then'](respondWithResult(_0x51a429,null))[_0xc5b6('0x5d')](handleError(_0x51a429,null));};exports[_0xc5b6('0x127')]=function(_0xd1e2fb,_0x32987d,_0x3c90f8){var _0x524821={};var _0x4b2c64={};var _0xba73b1;var _0xb53ddc;return db['ChatWebsite']['findOne']({'where':{'id':_0xd1e2fb[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x32987d,null))[_0xc5b6('0x41')](function(_0x20a297){if(_0x20a297){_0xba73b1=_0x20a297;_0x4b2c64[_0xc5b6('0x4c')]=_[_0xc5b6('0x4d')](db[_0xc5b6('0x128')][_0xc5b6('0x49')]);_0x4b2c64[_0xc5b6('0x4e')]=_[_0xc5b6('0x4d')](_0xd1e2fb['query']);_0x4b2c64['filters']=_[_0xc5b6('0x50')](_0x4b2c64[_0xc5b6('0x4c')],_0x4b2c64[_0xc5b6('0x4e')]);_0x524821[_0xc5b6('0x51')]=_[_0xc5b6('0x50')](_0x4b2c64[_0xc5b6('0x4c')],qs[_0xc5b6('0x52')](_0xd1e2fb[_0xc5b6('0x4e')][_0xc5b6('0x52')]));_0x524821[_0xc5b6('0x51')]=_0x524821[_0xc5b6('0x51')][_0xc5b6('0x73')]?_0x524821[_0xc5b6('0x51')]:_0x4b2c64['model'];_0x524821[_0xc5b6('0x54')]=qs[_0xc5b6('0x55')](_0xd1e2fb[_0xc5b6('0x4e')][_0xc5b6('0x55')]);_0x524821['where']=qs[_0xc5b6('0x4f')](_[_0xc5b6('0x6e')](_0xd1e2fb[_0xc5b6('0x4e')],_0x4b2c64['filters']));if(_0xd1e2fb[_0xc5b6('0x4e')][_0xc5b6('0x58')]){_0x524821[_0xc5b6('0x56')]=_['merge'](_0x524821['where'],{'$or':_['map'](_0x524821[_0xc5b6('0x51')],function(_0x13dc97){var _0x46e61b={};_0x46e61b[_0x13dc97]={'$like':'%'+_0xd1e2fb[_0xc5b6('0x4e')][_0xc5b6('0x58')]+'%'};return _0x46e61b;})});}_0x524821=_[_0xc5b6('0x57')]({},_0x524821,_0xd1e2fb[_0xc5b6('0x59')]);return _0xba73b1['getProactiveActions'](_0x524821);}})[_0xc5b6('0x41')](function(_0x579acf){if(_0x579acf){_0xb53ddc=_0x579acf[_0xc5b6('0x73')];if(!_0xd1e2fb[_0xc5b6('0x4e')][_0xc5b6('0x53')](_0xc5b6('0x6d'))){_0x524821[_0xc5b6('0x35')]=qs['limit'](_0xd1e2fb[_0xc5b6('0x4e')][_0xc5b6('0x35')]);_0x524821['offset']=qs['offset'](_0xd1e2fb['query'][_0xc5b6('0x37')]);}return _0xba73b1[_0xc5b6('0x127')](_0x524821);}})[_0xc5b6('0x41')](function(_0x4be733){if(_0x4be733){return _0x4be733?{'count':_0xb53ddc,'rows':_0x4be733}:null;}})['then'](respondWithResult(_0x32987d,null))[_0xc5b6('0x5d')](handleError(_0x32987d,null));};exports[_0xc5b6('0x129')]=function(_0x18a814,_0xd7880e,_0x3307ea){var _0x34a072=_0x18a814[_0xc5b6('0x4e')][_0xc5b6('0x12a')]===_0xc5b6('0x12b')?_0xc5b6('0x12c'):_0xc5b6('0x12d');return db[_0xc5b6('0x48')][_0xc5b6('0x60')]({'attributes':['id',_0x34a072],'where':{'id':_0x18a814[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0xd7880e,null))[_0xc5b6('0x41')](function(_0x2924be){if(_0x2924be){var _0x5efb05=_0x2924be[_0x34a072];var _0x55bd33=_0x5efb05&&_0x5efb05['items']?_0x5efb05[_0xc5b6('0x12e')]:[];_0xd7880e[_0xc5b6('0x44')]({'fromKey':_['isNil'](_0x5efb05['fromKey'])?undefined:_0x5efb05[_0xc5b6('0x12f')],'count':_0x55bd33[_0xc5b6('0x73')],'rows':_0x55bd33});}})[_0xc5b6('0x5d')](handleError(_0xd7880e,null));};exports['getOfflineMessages']=function(_0x121e6f,_0x58e487,_0x233fe1){var _0x15d653={'raw':![],'where':{}};var _0x2a184d={};var _0x3cfe96={'count':0x0,'rows':[]};return db[_0xc5b6('0x48')][_0xc5b6('0x6b')]({'where':{'id':_0x121e6f['params']['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x58e487,null))[_0xc5b6('0x41')](function(_0x54e1fb){if(_0x54e1fb){_0x2a184d['model']=_[_0xc5b6('0x4d')](db['ChatOfflineMessage'][_0xc5b6('0x49')]);_0x2a184d[_0xc5b6('0x4e')]=_['keys'](_0x121e6f[_0xc5b6('0x4e')]);_0x2a184d[_0xc5b6('0x4f')]=_['intersection'](_0x2a184d[_0xc5b6('0x4c')],_0x2a184d[_0xc5b6('0x4e')]);_0x15d653[_0xc5b6('0x51')]=_['intersection'](_0x2a184d[_0xc5b6('0x4c')],qs['fields'](_0x121e6f[_0xc5b6('0x4e')][_0xc5b6('0x52')]));_0x15d653['attributes']=_0x15d653[_0xc5b6('0x51')][_0xc5b6('0x73')]?_0x15d653[_0xc5b6('0x51')]:_0x2a184d[_0xc5b6('0x4c')];if(!_0x121e6f[_0xc5b6('0x4e')][_0xc5b6('0x53')](_0xc5b6('0x6d'))){_0x15d653['limit']=qs[_0xc5b6('0x35')](_0x121e6f['query']['limit']);_0x15d653[_0xc5b6('0x37')]=qs['offset'](_0x121e6f[_0xc5b6('0x4e')][_0xc5b6('0x37')]);}_0x15d653['order']=qs['sort'](_0x121e6f[_0xc5b6('0x4e')][_0xc5b6('0x55')]);_0x15d653[_0xc5b6('0x56')]=qs[_0xc5b6('0x4f')](_[_0xc5b6('0x6e')](_0x121e6f['query'],_0x2a184d[_0xc5b6('0x4f')]));_0x15d653['where'][_0xc5b6('0x69')]=_0x54e1fb['id'];if(_0x121e6f[_0xc5b6('0x4e')][_0xc5b6('0x58')]){_0x15d653[_0xc5b6('0x56')]=_['merge'](_0x15d653[_0xc5b6('0x56')],{'$or':_[_0xc5b6('0x47')](_0x15d653[_0xc5b6('0x51')],function(_0x5260ce){var _0x591345={};_0x591345[_0x5260ce]={'$like':'%'+_0x121e6f['query'][_0xc5b6('0x58')]+'%'};return _0x591345;})});}_0x15d653=_[_0xc5b6('0x57')]({},_0x15d653,_0x121e6f[_0xc5b6('0x59')]);return db['ChatOfflineMessage'][_0xc5b6('0x36')]({'where':_0x15d653[_0xc5b6('0x56')]})[_0xc5b6('0x41')](function(_0xbc3f3f){_0x3cfe96['count']=_0xbc3f3f;if(_0x121e6f['query'][_0xc5b6('0x5a')]){_0x15d653[_0xc5b6('0x5b')]=[{'all':!![]}];}else{_0x15d653[_0xc5b6('0x5b')]=[{'model':db[_0xc5b6('0x92')],'as':_0xc5b6('0x100'),'required':![]},{'model':db['Attachment'],'as':_0xc5b6('0x130'),'required':![]}];}return db['ChatOfflineMessage'][_0xc5b6('0x6f')](_0x15d653);})[_0xc5b6('0x41')](function(_0x492062){_0x3cfe96[_0xc5b6('0x5c')]=_0x492062;return _0x3cfe96;});}})[_0xc5b6('0x41')](respondWithFilteredResult(_0x58e487,_0x15d653))['catch'](handleError(_0x58e487,null));};exports[_0xc5b6('0x131')]=function(_0x5791b8,_0x52c9b4,_0x6e4b24){return db[_0xc5b6('0x48')][_0xc5b6('0x60')]({'where':{'id':_0x5791b8[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x52c9b4,null))[_0xc5b6('0x41')](function(_0x387711){if(_0x387711){return _0x387711['addAgents'](_0x5791b8[_0xc5b6('0x61')][_0xc5b6('0x71')],_[_0xc5b6('0xff')](_0x5791b8['body'],['ids','id'])||{})[_0xc5b6('0xbe')](function(_0x3e2085){for(var _0x180a4a=0x0;_0x180a4a<_0x5791b8[_0xc5b6('0x61')][_0xc5b6('0x71')][_0xc5b6('0x73')];_0x180a4a+=0x1){socket[_0xc5b6('0x132')]('userChatWebsite:save',{'UserId':Number(_0x5791b8[_0xc5b6('0x61')]['ids'][_0x180a4a]),'ChatWebsiteId':Number(_0x5791b8['params']['id'])});}return _0x3e2085;});}})[_0xc5b6('0x41')](respondWithResult(_0x52c9b4,null))[_0xc5b6('0x5d')](handleError(_0x52c9b4,null));};exports[_0xc5b6('0x133')]=function(_0x463445,_0x1601c3,_0x5b25be){return db[_0xc5b6('0x48')]['find']({'where':{'id':_0x463445[_0xc5b6('0x5e')]['id']}})[_0xc5b6('0x41')](handleEntityNotFound(_0x1601c3,null))[_0xc5b6('0x41')](function(_0x3c90d8){if(_0x3c90d8){return _0x3c90d8['removeAgents'](_0x463445[_0xc5b6('0x4e')][_0xc5b6('0x71')])[_0xc5b6('0x41')](function(){if(_['isArray'](_0x463445[_0xc5b6('0x4e')]['ids'])){for(var _0x138c9d=0x0;_0x138c9d<_0x463445[_0xc5b6('0x4e')][_0xc5b6('0x71')][_0xc5b6('0x73')];_0x138c9d+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x463445['query']['ids'][_0x138c9d]),'ChatWebsiteId':Number(_0x463445[_0xc5b6('0x5e')]['id'])});}}else{socket['emit'](_0xc5b6('0x134'),{'UserId':Number(_0x463445['query'][_0xc5b6('0x71')]),'ChatWebsiteId':Number(_0x463445[_0xc5b6('0x5e')]['id'])});}});}})[_0xc5b6('0x41')](respondWithStatusCode(_0x1601c3,null))[_0xc5b6('0x5d')](handleError(_0x1601c3,null));};exports['getAgents']=function(_0x1fb670,_0x289cf1,_0x11a5c6){var _0xb481d7={};var _0x186845={};var _0x76efd3;var _0x48e980;return db[_0xc5b6('0x48')][_0xc5b6('0x6b')]({'where':{'id':_0x1fb670[_0xc5b6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x289cf1,null))[_0xc5b6('0x41')](function(_0x4c89af){if(_0x4c89af){_0x76efd3=_0x4c89af;_0x186845[_0xc5b6('0x4c')]=_[_0xc5b6('0x4d')](db[_0xc5b6('0xc9')][_0xc5b6('0x49')]);_0x186845['query']=_[_0xc5b6('0x4d')](_0x1fb670['query']);_0x186845['filters']=_[_0xc5b6('0x50')](_0x186845[_0xc5b6('0x4c')],_0x186845[_0xc5b6('0x4e')]);_0xb481d7[_0xc5b6('0x51')]=_['intersection'](_0x186845[_0xc5b6('0x4c')],qs[_0xc5b6('0x52')](_0x1fb670[_0xc5b6('0x4e')][_0xc5b6('0x52')]));_0xb481d7[_0xc5b6('0x51')]=_0xb481d7[_0xc5b6('0x51')]['length']?_0xb481d7[_0xc5b6('0x51')]:_0x186845[_0xc5b6('0x4c')];_0xb481d7[_0xc5b6('0x54')]=qs[_0xc5b6('0x55')](_0x1fb670[_0xc5b6('0x4e')]['sort']);_0xb481d7['where']=qs[_0xc5b6('0x4f')](_[_0xc5b6('0x6e')](_0x1fb670[_0xc5b6('0x4e')],_0x186845[_0xc5b6('0x4f')]));if(_0x1fb670['query'][_0xc5b6('0x58')]){_0xb481d7[_0xc5b6('0x56')]=_['merge'](_0xb481d7[_0xc5b6('0x56')],{'$or':_['map'](_0xb481d7[_0xc5b6('0x51')],function(_0x55b020){var _0xfb55b0={};_0xfb55b0[_0x55b020]={'$like':'%'+_0x1fb670[_0xc5b6('0x4e')][_0xc5b6('0x58')]+'%'};return _0xfb55b0;})});}_0xb481d7=_[_0xc5b6('0x57')]({},_0xb481d7,_0x1fb670['options']);return _0x76efd3[_0xc5b6('0x135')](_0xb481d7);}})['then'](function(_0x2fb4bb){if(_0x2fb4bb){_0x48e980=_0x2fb4bb[_0xc5b6('0x73')];if(!_0x1fb670[_0xc5b6('0x4e')][_0xc5b6('0x53')]('nolimit')){_0xb481d7['limit']=qs[_0xc5b6('0x35')](_0x1fb670['query'][_0xc5b6('0x35')]);_0xb481d7[_0xc5b6('0x37')]=qs[_0xc5b6('0x37')](_0x1fb670[_0xc5b6('0x4e')][_0xc5b6('0x37')]);}return _0x76efd3['getAgents'](_0xb481d7);}})[_0xc5b6('0x41')](function(_0xa58905){if(_0xa58905){return _0xa58905?{'count':_0x48e980,'rows':_0xa58905}:null;}})['then'](respondWithResult(_0x289cf1,null))[_0xc5b6('0x5d')](handleError(_0x289cf1,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 9161944..f593016 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 _0xafdd=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x21a685,_0x3c7c71){var _0x330af2=function(_0x2e1f07){while(--_0x2e1f07){_0x21a685['push'](_0x21a685['shift']());}};_0x330af2(++_0x3c7c71);}(_0xafdd,0x19a));var _0xdafd=function(_0x381d88,_0x187470){_0x381d88=_0x381d88-0x0;var _0x10c0c1=_0xafdd[_0x381d88];return _0x10c0c1;};'use strict';var EventEmitter=require(_0xdafd('0x0'));var ChatWebsite=require(_0xdafd('0x1'))['db'][_0xdafd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdafd('0x3')](0x0);var events={'afterCreate':_0xdafd('0x4'),'afterUpdate':_0xdafd('0x5'),'afterDestroy':_0xdafd('0x6')};function emitEvent(_0x2b0752){return function(_0x5624f6,_0x283ab1,_0x799727){ChatWebsiteEvents[_0xdafd('0x7')](_0x2b0752+':'+_0x5624f6['id'],_0x5624f6);ChatWebsiteEvents[_0xdafd('0x7')](_0x2b0752,_0x5624f6);_0x799727(null);};}for(var e in events){if(events[_0xdafd('0x8')](e)){var event=events[e];ChatWebsite[_0xdafd('0x9')](e,emitEvent(event));}}module[_0xdafd('0xa')]=ChatWebsiteEvents; \ No newline at end of file +var _0x8a8b=['events','setMaxListeners','save','remove','emit','hook'];(function(_0x591204,_0x5a1355){var _0x4553d6=function(_0x244520){while(--_0x244520){_0x591204['push'](_0x591204['shift']());}};_0x4553d6(++_0x5a1355);}(_0x8a8b,0xae));var _0xb8a8=function(_0x329177,_0x587e03){_0x329177=_0x329177-0x0;var _0x3fdc7c=_0x8a8b[_0x329177];return _0x3fdc7c;};'use strict';var EventEmitter=require(_0xb8a8('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb8a8('0x1')](0x0);var events={'afterCreate':_0xb8a8('0x2'),'afterUpdate':'update','afterDestroy':_0xb8a8('0x3')};function emitEvent(_0x5710bc){return function(_0xca9854,_0x4fe301,_0x4043fd){ChatWebsiteEvents[_0xb8a8('0x4')](_0x5710bc+':'+_0xca9854['id'],_0xca9854);ChatWebsiteEvents[_0xb8a8('0x4')](_0x5710bc,_0xca9854);_0x4043fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb8a8('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 72aa206..bd7823d 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 _0x2779=['request-promise','rimraf','../../config/environment','exports','define','chat_websites','lodash','util','api','moment','bluebird'];(function(_0x1fdd6b,_0x56eb13){var _0x34ee8f=function(_0x54fd41){while(--_0x54fd41){_0x1fdd6b['push'](_0x1fdd6b['shift']());}};_0x34ee8f(++_0x56eb13);}(_0x2779,0xf8));var _0x9277=function(_0x49daeb,_0x54baba){_0x49daeb=_0x49daeb-0x0;var _0xaabc8d=_0x2779[_0x49daeb];return _0xaabc8d;};'use strict';var _=require(_0x9277('0x0'));var util=require(_0x9277('0x1'));var logger=require('../../config/logger')(_0x9277('0x2'));var moment=require(_0x9277('0x3'));var BPromise=require(_0x9277('0x4'));var rp=require(_0x9277('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9277('0x6'));var config=require(_0x9277('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x9277('0x8')]=function(_0x3f0a17,_0x2b1d31){return _0x3f0a17[_0x9277('0x9')]('ChatWebsite',attributes,{'tableName':_0x9277('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f31=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0x3f31,0x1d2));var _0x13f3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3f31[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x13f3('0x0'));var util=require(_0x13f3('0x1'));var logger=require(_0x13f3('0x2'))(_0x13f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x13f3('0x4'));var fs=require('fs');var path=require(_0x13f3('0x5'));var rimraf=require(_0x13f3('0x6'));var config=require(_0x13f3('0x7'));var attributes=require(_0x13f3('0x8'));module[_0x13f3('0x9')]=function(_0x1f9bfe,_0x67b72d){return _0x1f9bfe[_0x13f3('0xa')](_0x13f3('0xb'),attributes,{'tableName':_0x13f3('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 c93ebd7..a463405 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 _0xefa1=['socket.io-emitter','register','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x243863,_0x52aebd){var _0x4aca75=function(_0x113eb0){while(--_0x113eb0){_0x243863['push'](_0x243863['shift']());}};_0x4aca75(++_0x52aebd);}(_0xefa1,0x188));var _0x1efa=function(_0x39f78b,_0x11e936){_0x39f78b=_0x39f78b-0x0;var _0x373e4f=_0xefa1[_0x39f78b];return _0x373e4f;};'use strict';var _=require('lodash');var util=require(_0x1efa('0x0'));var moment=require(_0x1efa('0x1'));var BPromise=require(_0x1efa('0x2'));var rs=require(_0x1efa('0x3'));var fs=require('fs');var Redis=require(_0x1efa('0x4'));var db=require(_0x1efa('0x5'))['db'];var utils=require(_0x1efa('0x6'));var logger=require('../../config/logger')(_0x1efa('0x7'));var config=require(_0x1efa('0x8'));var jayson=require(_0x1efa('0x9'));var client=jayson[_0x1efa('0xa')]['http']({'port':0x232a});config[_0x1efa('0xb')]=_['defaults'](config[_0x1efa('0xb')],{'host':_0x1efa('0xc'),'port':0x18eb});var socket=require(_0x1efa('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x1efa('0xe')](socket);function respondWithRpcPromise(_0x4594f6,_0x4ff668,_0x186988){return new BPromise(function(_0xcd812a,_0x4d8ab4){return client[_0x1efa('0xf')](_0x4594f6,_0x186988)[_0x1efa('0x10')](function(_0x111bd3){logger[_0x1efa('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4ff668,_0x1efa('0x12'));logger['debug'](_0x1efa('0x13'),_0x4ff668,_0x1efa('0x12'),JSON[_0x1efa('0x14')](_0x111bd3));if(_0x111bd3['error']){if(_0x111bd3[_0x1efa('0x15')][_0x1efa('0x16')]===0x1f4){logger[_0x1efa('0x15')](_0x1efa('0x17'),_0x4ff668,_0x111bd3[_0x1efa('0x15')][_0x1efa('0x18')]);return _0x4d8ab4(_0x111bd3[_0x1efa('0x15')]['message']);}logger[_0x1efa('0x15')](_0x1efa('0x17'),_0x4ff668,_0x111bd3['error'][_0x1efa('0x18')]);return _0xcd812a(_0x111bd3[_0x1efa('0x15')]['message']);}else{logger[_0x1efa('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x4ff668,_0x1efa('0x12'));_0xcd812a(_0x111bd3[_0x1efa('0x19')][_0x1efa('0x18')]);}})[_0x1efa('0x1a')](function(_0x22bd6c){logger[_0x1efa('0x15')](_0x1efa('0x17'),_0x4ff668,_0x22bd6c);_0x4d8ab4(_0x22bd6c);});});} \ No newline at end of file +var _0xc4fb=['defaults','redis','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3322b9,_0x28101c){var _0x293079=function(_0x1aee02){while(--_0x1aee02){_0x3322b9['push'](_0x3322b9['shift']());}};_0x293079(++_0x28101c);}(_0xc4fb,0x13c));var _0xbc4f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc4fb[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xbc4f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc4f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc4f('0x2'))['db'];var utils=require(_0xbc4f('0x3'));var logger=require(_0xbc4f('0x4'))(_0xbc4f('0x5'));var config=require('../../config/environment');var jayson=require(_0xbc4f('0x6'));var client=jayson[_0xbc4f('0x7')][_0xbc4f('0x8')]({'port':0x232a});config['redis']=_[_0xbc4f('0x9')](config[_0xbc4f('0xa')],{'host':_0xbc4f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc4f('0xa')]));require(_0xbc4f('0xc'))[_0xbc4f('0xd')](socket);function respondWithRpcPromise(_0x29437a,_0x39ac00,_0x47530b){return new BPromise(function(_0x385fee,_0x5cf563){return client[_0xbc4f('0xe')](_0x29437a,_0x47530b)[_0xbc4f('0xf')](function(_0x2595cb){logger[_0xbc4f('0x10')](_0xbc4f('0x11'),_0x39ac00,'request\x20sent');logger[_0xbc4f('0x12')](_0xbc4f('0x13'),_0x39ac00,_0xbc4f('0x14'),JSON[_0xbc4f('0x15')](_0x2595cb));if(_0x2595cb[_0xbc4f('0x16')]){if(_0x2595cb[_0xbc4f('0x16')][_0xbc4f('0x17')]===0x1f4){logger[_0xbc4f('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x39ac00,_0x2595cb[_0xbc4f('0x16')]['message']);return _0x5cf563(_0x2595cb[_0xbc4f('0x16')][_0xbc4f('0x18')]);}logger['error'](_0xbc4f('0x11'),_0x39ac00,_0x2595cb[_0xbc4f('0x16')][_0xbc4f('0x18')]);return _0x385fee(_0x2595cb['error']['message']);}else{logger[_0xbc4f('0x10')](_0xbc4f('0x11'),_0x39ac00,_0xbc4f('0x14'));_0x385fee(_0x2595cb['result'][_0xbc4f('0x18')]);}})['catch'](function(_0x6e4efc){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x39ac00,_0x6e4efc);_0x5cf563(_0x6e4efc);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 6cd4d0b..849de23 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 _0x5951=['update','emit','removeListener','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x5951,0xb5));var _0x1595=function(_0xebbdd5,_0xca00a7){_0xebbdd5=_0xebbdd5-0x0;var _0xe1a941=_0x5951[_0xebbdd5];return _0xe1a941;};'use strict';var ChatWebsiteEvents=require(_0x1595('0x0'));var events=[_0x1595('0x1'),_0x1595('0x2'),_0x1595('0x3')];function createListener(_0x20da50,_0x2e831b){return function(_0x1c9e3b){_0x2e831b[_0x1595('0x4')](_0x20da50,_0x1c9e3b);};}function removeListener(_0x589977,_0x4a2dfe){return function(){ChatWebsiteEvents[_0x1595('0x5')](_0x589977,_0x4a2dfe);};}exports['register']=function(_0x5dc1cc){for(var _0x2652af=0x0,_0x3bd88b=events[_0x1595('0x6')];_0x2652af<_0x3bd88b;_0x2652af++){var _0x599f34=events[_0x2652af];var _0x4cf17a=createListener(_0x1595('0x7')+_0x599f34,_0x5dc1cc);ChatWebsiteEvents['on'](_0x599f34,_0x4cf17a);}}; \ No newline at end of file +var _0x0494=['remove','update','emit','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x4549ef,_0x2c7961){var _0xd96b06=function(_0x5c8030){while(--_0x5c8030){_0x4549ef['push'](_0x4549ef['shift']());}};_0xd96b06(++_0x2c7961);}(_0x0494,0x19c));var _0x4049=function(_0x211041,_0x27f27e){_0x211041=_0x211041-0x0;var _0x14da31=_0x0494[_0x211041];return _0x14da31;};'use strict';var ChatWebsiteEvents=require(_0x4049('0x0'));var events=['save',_0x4049('0x1'),_0x4049('0x2')];function createListener(_0x2b6fbc,_0x5213f9){return function(_0x151915){_0x5213f9[_0x4049('0x3')](_0x2b6fbc,_0x151915);};}function removeListener(_0x3db3f4,_0x5843c8){return function(){ChatWebsiteEvents['removeListener'](_0x3db3f4,_0x5843c8);};}exports[_0x4049('0x4')]=function(_0x3e0317){for(var _0x58f7ce=0x0,_0x14e443=events[_0x4049('0x5')];_0x58f7ce<_0x14e443;_0x58f7ce++){var _0x252885=events[_0x58f7ce];var _0x209f5e=createListener(_0x4049('0x6')+_0x252885,_0x3e0317);ChatWebsiteEvents['on'](_0x252885,_0x209f5e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index fd05bec..2a7efb4 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 _0x2fd7=['getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','server/files/images/logos/','now','originalname','single','file','addLogo','diskStorage','join','root','server/files/images/avatars/','%s-%s','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo'];(function(_0x2afeb8,_0x14d761){var _0x28e268=function(_0x3f348f){while(--_0x3f348f){_0x2afeb8['push'](_0x2afeb8['shift']());}};_0x28e268(++_0x14d761);}(_0x2fd7,0xc8));var _0x72fd=function(_0x581e18,_0x590931){_0x581e18=_0x581e18-0x0;var _0x9e08d7=_0x2fd7[_0x581e18];return _0x9e08d7;};'use strict';var multer=require(_0x72fd('0x0'));var util=require(_0x72fd('0x1'));var path=require(_0x72fd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x72fd('0x3'));var auth=require(_0x72fd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x72fd('0x5'));var controller=require(_0x72fd('0x6'));router[_0x72fd('0x7')]('/',auth[_0x72fd('0x8')](),controller[_0x72fd('0x9')]);router[_0x72fd('0x7')]('/describe',auth[_0x72fd('0x8')](),controller['describe']);router[_0x72fd('0x7')](_0x72fd('0xa'),auth[_0x72fd('0x8')](),controller[_0x72fd('0xb')]);router[_0x72fd('0x7')](_0x72fd('0xc'),auth['isAuthenticated'](),controller[_0x72fd('0xd')]);router[_0x72fd('0x7')](_0x72fd('0xe'),auth[_0x72fd('0x8')](),controller['getAnswers']);router[_0x72fd('0x7')](_0x72fd('0xf'),controller[_0x72fd('0x10')]);router[_0x72fd('0x7')](_0x72fd('0x11'),controller[_0x72fd('0x12')]);router[_0x72fd('0x7')]('/:id/customer_avatar',controller[_0x72fd('0x13')]);router[_0x72fd('0x7')](_0x72fd('0x14'),controller[_0x72fd('0x15')]);router[_0x72fd('0x7')](_0x72fd('0x16'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x17')]);router[_0x72fd('0x7')](_0x72fd('0x18'),controller[_0x72fd('0x19')]);router[_0x72fd('0x7')]('/:id/applications',auth[_0x72fd('0x8')](),controller[_0x72fd('0x1a')]);router['get']('/:id/proactive_actions',auth[_0x72fd('0x8')](),controller[_0x72fd('0x1b')]);router['get'](_0x72fd('0x1c'),controller[_0x72fd('0x1d')]);router['get'](_0x72fd('0x1e'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x1f')]);router['get'](_0x72fd('0x20'),auth['isAuthenticated'](),controller[_0x72fd('0x21')]);router[_0x72fd('0x22')]('/',auth[_0x72fd('0x8')](),controller['create']);router[_0x72fd('0x22')](_0x72fd('0xc'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x23')]);router[_0x72fd('0x22')](_0x72fd('0xe'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f1f67,_0x292292,_0x2d1e54){_0x2d1e54(null,path['join'](config['root'],_0x72fd('0x25')));},'filename':function(_0x1ac066,_0x2b079b,_0x526a36){_0x526a36(null,util['format']('%s-%s',Date[_0x72fd('0x26')](),_0x2b079b[_0x72fd('0x27')]));}})});router[_0x72fd('0x22')]('/:id/logo',upload[_0x72fd('0x28')](_0x72fd('0x29')),controller[_0x72fd('0x2a')]);var upload=multer({'storage':multer[_0x72fd('0x2b')]({'destination':function(_0x4868ff,_0x227cc8,_0x1752ef){_0x1752ef(null,path[_0x72fd('0x2c')](config[_0x72fd('0x2d')],_0x72fd('0x2e')));},'filename':function(_0x48bf6f,_0x3d5a19,_0x5f100d){_0x5f100d(null,util['format'](_0x72fd('0x2f'),Date[_0x72fd('0x26')](),_0x3d5a19[_0x72fd('0x27')]));}})});router['post'](_0x72fd('0x11'),upload[_0x72fd('0x28')](_0x72fd('0x29')),controller[_0x72fd('0x30')]);var upload=multer({'storage':multer[_0x72fd('0x2b')]({'destination':function(_0xecd593,_0x4ed8c1,_0xc76a11){_0xc76a11(null,path[_0x72fd('0x2c')](config[_0x72fd('0x2d')],_0x72fd('0x2e')));},'filename':function(_0x411626,_0x3d6191,_0x193645){_0x193645(null,util['format'](_0x72fd('0x2f'),Date[_0x72fd('0x26')](),_0x3d6191[_0x72fd('0x27')]));}})});router['post'](_0x72fd('0x31'),upload[_0x72fd('0x28')]('file'),controller[_0x72fd('0x32')]);var upload=multer({'storage':multer[_0x72fd('0x2b')]({'destination':function(_0x469826,_0xd01f30,_0x2b3618){_0x2b3618(null,path[_0x72fd('0x2c')](config[_0x72fd('0x2d')],_0x72fd('0x2e')));},'filename':function(_0xa232f0,_0x428fcc,_0x44d19c){_0x44d19c(null,util['format'](_0x72fd('0x2f'),Date[_0x72fd('0x26')](),_0x428fcc['originalname']));}})});router[_0x72fd('0x22')](_0x72fd('0x14'),upload[_0x72fd('0x28')](_0x72fd('0x29')),controller[_0x72fd('0x33')]);router[_0x72fd('0x22')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x72fd('0x2b')]({'destination':function(_0x48561d,_0x4aacda,_0x22611a){const _0x540fe9=path[_0x72fd('0x2c')](config[_0x72fd('0x2d')],_0x72fd('0x34'),_0x72fd('0x35'),_0x72fd('0x36'));fs_extra[_0x72fd('0x37')](_0x540fe9,function(){_0x22611a(null,_0x540fe9);});},'filename':function(_0x2734c2,_0x56e260,_0x5b24b2){const _0x534afd=_0x56e260[_0x72fd('0x27')][_0x72fd('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x179d85=path[_0x72fd('0x39')](_0x534afd);const _0x4d83af=Date['now']()+'-'+_0x534afd['replace'](_0x179d85,'')+_0x179d85;_0x5b24b2(null,_0x4d83af);}})});router[_0x72fd('0x22')]('/:id/offline',offlineUploadMulter[_0x72fd('0x3a')](),controller[_0x72fd('0x3b')]);router[_0x72fd('0x22')](_0x72fd('0x16'),auth['isAuthenticated'](),controller[_0x72fd('0x3c')]);router[_0x72fd('0x22')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x72fd('0x3d'),auth['isAuthenticated'](),controller[_0x72fd('0x3e')]);router[_0x72fd('0x22')]('/:id/users',auth['isAuthenticated'](),controller[_0x72fd('0x3f')]);router[_0x72fd('0x40')]('/:id',auth[_0x72fd('0x8')](),controller[_0x72fd('0x41')]);router[_0x72fd('0x42')](_0x72fd('0xa'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x43')]);router[_0x72fd('0x42')](_0x72fd('0xc'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x44')]);router[_0x72fd('0x42')]('/:id/canned_answers',auth[_0x72fd('0x8')](),controller[_0x72fd('0x45')]);router[_0x72fd('0x42')](_0x72fd('0x20'),auth[_0x72fd('0x8')](),controller[_0x72fd('0x46')]);module[_0x72fd('0x47')]=router; \ No newline at end of file +var _0x4d04=['/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getApplications','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','file','addLogo','server/files/images/avatars/','originalname','single','addCustomerAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','any','offline','addInteraction','/:id/applications','/:id/proactive_actions','addProactiveActions','addAgents','put','delete','removeDispositions','removeAnswers','removeAgents','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get'];(function(_0x14d159,_0x5dbe1e){var _0x4b15e4=function(_0x4363d4){while(--_0x4363d4){_0x14d159['push'](_0x14d159['shift']());}};_0x4b15e4(++_0x5dbe1e);}(_0x4d04,0x1a2));var _0x44d0=function(_0x428b8b,_0x37caaa){_0x428b8b=_0x428b8b-0x0;var _0xa1e075=_0x4d04[_0x428b8b];return _0xa1e075;};'use strict';var multer=require(_0x44d0('0x0'));var util=require('util');var path=require(_0x44d0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x44d0('0x2'));var auth=require(_0x44d0('0x3'));var interaction=require(_0x44d0('0x4'));var config=require('../../config/environment');var controller=require(_0x44d0('0x5'));router['get']('/',auth[_0x44d0('0x6')](),controller[_0x44d0('0x7')]);router[_0x44d0('0x8')](_0x44d0('0x9'),auth[_0x44d0('0x6')](),controller[_0x44d0('0xa')]);router[_0x44d0('0x8')](_0x44d0('0xb'),auth[_0x44d0('0x6')](),controller[_0x44d0('0xc')]);router[_0x44d0('0x8')]('/:id/dispositions',auth[_0x44d0('0x6')](),controller[_0x44d0('0xd')]);router['get'](_0x44d0('0xe'),auth['isAuthenticated'](),controller[_0x44d0('0xf')]);router[_0x44d0('0x8')]('/:id/logo',controller['getLogo']);router[_0x44d0('0x8')](_0x44d0('0x10'),controller['getAvatar']);router[_0x44d0('0x8')](_0x44d0('0x11'),controller[_0x44d0('0x12')]);router[_0x44d0('0x8')](_0x44d0('0x13'),controller['getSystemAvatar']);router[_0x44d0('0x8')](_0x44d0('0x14'),auth[_0x44d0('0x6')](),controller['getInteractions']);router[_0x44d0('0x8')](_0x44d0('0x15'),controller['getSnippet']);router[_0x44d0('0x8')]('/:id/applications',auth[_0x44d0('0x6')](),controller[_0x44d0('0x16')]);router[_0x44d0('0x8')]('/:id/proactive_actions',auth[_0x44d0('0x6')](),controller['getProactiveActions']);router['get']('/:id/fields',controller['getFields']);router['get'](_0x44d0('0x17'),auth['isAuthenticated'](),controller[_0x44d0('0x18')]);router[_0x44d0('0x8')](_0x44d0('0x19'),auth[_0x44d0('0x6')](),controller['getAgents']);router[_0x44d0('0x1a')]('/',auth[_0x44d0('0x6')](),controller[_0x44d0('0x1b')]);router[_0x44d0('0x1a')](_0x44d0('0x1c'),auth[_0x44d0('0x6')](),controller[_0x44d0('0x1d')]);router['post']('/:id/canned_answers',auth[_0x44d0('0x6')](),controller[_0x44d0('0x1e')]);var upload=multer({'storage':multer[_0x44d0('0x1f')]({'destination':function(_0x27078a,_0x58f332,_0x122a39){_0x122a39(null,path[_0x44d0('0x20')](config[_0x44d0('0x21')],'server/files/images/logos/'));},'filename':function(_0x15bf77,_0x44900d,_0x5774f4){_0x5774f4(null,util[_0x44d0('0x22')](_0x44d0('0x23'),Date[_0x44d0('0x24')](),_0x44900d['originalname']));}})});router[_0x44d0('0x1a')]('/:id/logo',upload['single'](_0x44d0('0x25')),controller[_0x44d0('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4eef81,_0x11fce8,_0xd14f9d){_0xd14f9d(null,path[_0x44d0('0x20')](config[_0x44d0('0x21')],_0x44d0('0x27')));},'filename':function(_0x1f7356,_0x47a21c,_0x52d42a){_0x52d42a(null,util[_0x44d0('0x22')](_0x44d0('0x23'),Date['now'](),_0x47a21c[_0x44d0('0x28')]));}})});router[_0x44d0('0x1a')]('/:id/avatar',upload[_0x44d0('0x29')](_0x44d0('0x25')),controller['addAvatar']);var upload=multer({'storage':multer[_0x44d0('0x1f')]({'destination':function(_0x39549f,_0x5b8621,_0x29d6fa){_0x29d6fa(null,path[_0x44d0('0x20')](config[_0x44d0('0x21')],_0x44d0('0x27')));},'filename':function(_0xf0410,_0x5719aa,_0x5a284f){_0x5a284f(null,util[_0x44d0('0x22')](_0x44d0('0x23'),Date[_0x44d0('0x24')](),_0x5719aa[_0x44d0('0x28')]));}})});router[_0x44d0('0x1a')](_0x44d0('0x11'),upload['single']('file'),controller[_0x44d0('0x2a')]);var upload=multer({'storage':multer[_0x44d0('0x1f')]({'destination':function(_0x7a323d,_0x51c1a7,_0x64ec04){_0x64ec04(null,path['join'](config[_0x44d0('0x21')],_0x44d0('0x27')));},'filename':function(_0x374ad6,_0x4f3033,_0x2a93e9){_0x2a93e9(null,util[_0x44d0('0x22')](_0x44d0('0x23'),Date['now'](),_0x4f3033['originalname']));}})});router['post'](_0x44d0('0x13'),upload[_0x44d0('0x29')](_0x44d0('0x25')),controller['addSystemAvatar']);router[_0x44d0('0x1a')]('/:id/notify',controller[_0x44d0('0x2b')]);const offlineUploadMulter=multer({'storage':multer[_0x44d0('0x1f')]({'destination':function(_0x2051a3,_0x490e72,_0x3dd093){const _0x2a33bd=path['join'](config['root'],_0x44d0('0x2c'),_0x44d0('0x2d'),_0x44d0('0x2e'));fs_extra[_0x44d0('0x2f')](_0x2a33bd,function(){_0x3dd093(null,_0x2a33bd);});},'filename':function(_0x360a42,_0x3714ed,_0x539529){const _0x1d33ef=_0x3714ed[_0x44d0('0x28')][_0x44d0('0x30')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4ddbc5=path['extname'](_0x1d33ef);const _0x21aa0c=Date[_0x44d0('0x24')]()+'-'+_0x1d33ef[_0x44d0('0x30')](_0x4ddbc5,'')+_0x4ddbc5;_0x539529(null,_0x21aa0c);}})});router[_0x44d0('0x1a')]('/:id/offline',offlineUploadMulter[_0x44d0('0x31')](),controller[_0x44d0('0x32')]);router[_0x44d0('0x1a')](_0x44d0('0x14'),auth['isAuthenticated'](),controller[_0x44d0('0x33')]);router['post'](_0x44d0('0x34'),auth[_0x44d0('0x6')](),controller['addApplications']);router[_0x44d0('0x1a')](_0x44d0('0x35'),auth[_0x44d0('0x6')](),controller[_0x44d0('0x36')]);router[_0x44d0('0x1a')]('/:id/users',auth[_0x44d0('0x6')](),controller[_0x44d0('0x37')]);router[_0x44d0('0x38')](_0x44d0('0xb'),auth[_0x44d0('0x6')](),controller['update']);router[_0x44d0('0x39')](_0x44d0('0xb'),auth[_0x44d0('0x6')](),controller['destroy']);router[_0x44d0('0x39')]('/:id/dispositions',auth[_0x44d0('0x6')](),controller[_0x44d0('0x3a')]);router['delete']('/:id/canned_answers',auth[_0x44d0('0x6')](),controller[_0x44d0('0x3b')]);router[_0x44d0('0x39')](_0x44d0('0x19'),auth['isAuthenticated'](),controller[_0x44d0('0x3c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 1b6cb19..7088863 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 _0xa498=['STRING','Google','exports'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa498,0x1d6));var _0x8a49=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0xa498[_0x4599b6];return _0x2e014c;};'use strict';var Sequelize=require('sequelize');module[_0x8a49('0x0')]={'name':{'type':Sequelize[_0x8a49('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x8a49('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8a49('0x1')]},'data2':{'type':Sequelize[_0x8a49('0x1')]}}; \ No newline at end of file +var _0x29eb=['STRING','AmazonAWS','Google','sequelize','exports'];(function(_0x44e8f1,_0x33364f){var _0x5dcd33=function(_0x44ea35){while(--_0x44ea35){_0x44e8f1['push'](_0x44e8f1['shift']());}};_0x5dcd33(++_0x33364f);}(_0x29eb,0x1c5));var _0xb29e=function(_0x2cee34,_0x7e21a9){_0x2cee34=_0x2cee34-0x0;var _0x5a369e=_0x29eb[_0x2cee34];return _0x5a369e;};'use strict';var Sequelize=require(_0xb29e('0x0'));module[_0xb29e('0x1')]={'name':{'type':Sequelize[_0xb29e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xb29e('0x3'),_0xb29e('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xb29e('0x2')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 76fece1..565e2c3 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 _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x3ce33a,_0x265c89){var _0x3b5ed6=function(_0x5822e2){while(--_0x5822e2){_0x3ce33a['push'](_0x3ce33a['shift']());}};_0x3b5ed6(++_0x265c89);}(_0x0b0e,0x187));var _0xe0b0=function(_0x249565,_0x2a026a){_0x249565=_0x249565-0x0;var _0x43dee8=_0x0b0e[_0x249565];return _0x43dee8;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xadb5,0xad));var _0x5adb=function(_0x4ab3ce,_0x81a77d){_0x4ab3ce=_0x4ab3ce-0x0;var _0x4e72e6=_0xadb5[_0x4ab3ce];return _0x4e72e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 8bbca22..3053712 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 _0x1293=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e7d56,_0x19d978){var _0x1371e4=function(_0x53d238){while(--_0x53d238){_0x1e7d56['push'](_0x1e7d56['shift']());}};_0x1371e4(++_0x19d978);}(_0x1293,0x68));var _0x3129=function(_0x3267cb,_0x126cc9){_0x3267cb=_0x3267cb-0x0;var _0x200925=_0x1293[_0x3267cb];return _0x200925;};'use strict';var _=require(_0x3129('0x0'));var util=require(_0x3129('0x1'));var logger=require(_0x3129('0x2'))(_0x3129('0x3'));var moment=require(_0x3129('0x4'));var BPromise=require(_0x3129('0x5'));var rp=require(_0x3129('0x6'));var fs=require('fs');var path=require(_0x3129('0x7'));var rimraf=require(_0x3129('0x8'));var config=require(_0x3129('0x9'));var attributes=require(_0x3129('0xa'));module[_0x3129('0xb')]=function(_0x26a5bf,_0x5ec459){return _0x26a5bf[_0x3129('0xc')]('CloudProvider',attributes,{'tableName':_0x3129('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66de=['exports','define','CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cloudProvider.attributes'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0x66de,0xe8));var _0xe66d=function(_0x23f0e1,_0x11d94b){_0x23f0e1=_0x23f0e1-0x0;var _0x257f0d=_0x66de[_0x23f0e1];return _0x257f0d;};'use strict';var _=require('lodash');var util=require(_0xe66d('0x0'));var logger=require(_0xe66d('0x1'))(_0xe66d('0x2'));var moment=require(_0xe66d('0x3'));var BPromise=require(_0xe66d('0x4'));var rp=require(_0xe66d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe66d('0x6'));var attributes=require(_0xe66d('0x7'));module[_0xe66d('0x8')]=function(_0x12a325,_0x2eab23){return _0x12a325[_0xe66d('0x9')](_0xe66d('0xa'),attributes,{'tableName':_0xe66d('0xb'),'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 7ed1a3e..27fc0f1 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 _0x4f7b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','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'];(function(_0x365101,_0x12b1e6){var _0x1c253a=function(_0x42592a){while(--_0x42592a){_0x365101['push'](_0x365101['shift']());}};_0x1c253a(++_0x12b1e6);}(_0x4f7b,0x13e));var _0xb4f7=function(_0xce5d2a,_0x1add09){_0xce5d2a=_0xce5d2a-0x0;var _0xc4fc6f=_0x4f7b[_0xce5d2a];return _0xc4fc6f;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});} \ No newline at end of file +var _0xa456=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa456,0x142));var _0x6a45=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xa456[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a45('0x4'));var db=require(_0x6a45('0x5'))['db'];var utils=require(_0x6a45('0x6'));var logger=require('../../config/logger')(_0x6a45('0x7'));var config=require(_0x6a45('0x8'));var jayson=require(_0x6a45('0x9'));var client=jayson[_0x6a45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cf8d,_0x26bfc0,_0x214514){return new BPromise(function(_0x19e67c,_0x3deb09){return client['request'](_0x25cf8d,_0x214514)[_0x6a45('0xb')](function(_0x517040){logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));logger[_0x6a45('0xf')](_0x6a45('0x10'),_0x26bfc0,'request\x20sent',JSON['stringify'](_0x517040));if(_0x517040[_0x6a45('0x11')]){if(_0x517040[_0x6a45('0x11')]['code']===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('CloudProvider,\x20%s,\x20%s',_0x26bfc0,_0x517040['error'][_0x6a45('0x12')]);return _0x19e67c(_0x517040[_0x6a45('0x11')]['message']);}else{logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));_0x19e67c(_0x517040[_0x6a45('0x13')]['message']);}})['catch'](function(_0x49023f){logger[_0x6a45('0x11')](_0x6a45('0xd'),_0x26bfc0,_0x49023f);_0x3deb09(_0x49023f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 1077040..035ce9c 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 _0xb5a8=['index','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0xb5a8,0x81));var _0x8b5a=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xb5a8[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x8b5a('0x0'));var util=require(_0x8b5a('0x1'));var path=require(_0x8b5a('0x2'));var timeout=require(_0x8b5a('0x3'));var express=require(_0x8b5a('0x4'));var router=express['Router']();var fs_extra=require(_0x8b5a('0x5'));var auth=require(_0x8b5a('0x6'));var interaction=require(_0x8b5a('0x7'));var config=require(_0x8b5a('0x8'));var controller=require(_0x8b5a('0x9'));router[_0x8b5a('0xa')]('/',auth['isAuthenticated'](),controller[_0x8b5a('0xb')]);router[_0x8b5a('0xa')]('/:id',auth[_0x8b5a('0xc')](),controller[_0x8b5a('0xd')]);router[_0x8b5a('0xe')]('/',auth[_0x8b5a('0xc')](),controller['create']);router[_0x8b5a('0xf')](_0x8b5a('0x10'),auth[_0x8b5a('0xc')](),controller[_0x8b5a('0x11')]);router[_0x8b5a('0x12')](_0x8b5a('0x10'),auth[_0x8b5a('0xc')](),controller['destroy']);module[_0x8b5a('0x13')]=router; \ No newline at end of file +var _0x7dbc=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','isAuthenticated','index','get','/:id','show','post','put'];(function(_0x1a2d1c,_0x4a1873){var _0x56eb67=function(_0x295a7d){while(--_0x295a7d){_0x1a2d1c['push'](_0x1a2d1c['shift']());}};_0x56eb67(++_0x4a1873);}(_0x7dbc,0xe0));var _0xc7db=function(_0xb63a15,_0x414fd7){_0xb63a15=_0xb63a15-0x0;var _0x2731ff=_0x7dbc[_0xb63a15];return _0x2731ff;};'use strict';var multer=require(_0xc7db('0x0'));var util=require(_0xc7db('0x1'));var path=require(_0xc7db('0x2'));var timeout=require('connect-timeout');var express=require(_0xc7db('0x3'));var router=express[_0xc7db('0x4')]();var fs_extra=require(_0xc7db('0x5'));var auth=require(_0xc7db('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc7db('0x7'));var controller=require(_0xc7db('0x8'));router['get']('/',auth[_0xc7db('0x9')](),controller[_0xc7db('0xa')]);router[_0xc7db('0xb')](_0xc7db('0xc'),auth[_0xc7db('0x9')](),controller[_0xc7db('0xd')]);router[_0xc7db('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc7db('0xf')]('/:id',auth[_0xc7db('0x9')](),controller[_0xc7db('0x10')]);router[_0xc7db('0x11')](_0xc7db('0xc'),auth[_0xc7db('0x9')](),controller[_0xc7db('0x12')]);module[_0xc7db('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index ce2c581..0a6a795 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 _0x2228=['STRING'];(function(_0x20c2e6,_0x199912){var _0x451b69=function(_0xfa21f){while(--_0xfa21f){_0x20c2e6['push'](_0x20c2e6['shift']());}};_0x451b69(++_0x199912);}(_0x2228,0x118));var _0x8222=function(_0x14eeb5,_0x12a40d){_0x14eeb5=_0x14eeb5-0x0;var _0x200fa3=_0x2228[_0x14eeb5];return _0x200fa3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8222('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8222('0x0')]},'companyId':{'type':Sequelize[_0x8222('0x0')]},'website':{'type':Sequelize[_0x8222('0x0')]},'phone':{'type':Sequelize[_0x8222('0x0')]},'fax':{'type':Sequelize[_0x8222('0x0')]},'type':{'type':Sequelize[_0x8222('0x0')]},'street':{'type':Sequelize[_0x8222('0x0')]},'postalCode':{'type':Sequelize[_0x8222('0x0')]},'city':{'type':Sequelize[_0x8222('0x0')]},'country':{'type':Sequelize[_0x8222('0x0')]},'email':{'type':Sequelize[_0x8222('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8222('0x0')]},'sStreet':{'type':Sequelize[_0x8222('0x0')]},'sPostalCode':{'type':Sequelize[_0x8222('0x0')]},'sCity':{'type':Sequelize[_0x8222('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8222('0x0')]}}; \ No newline at end of file +var _0x935c=['STRING','name','exports'];(function(_0x248049,_0x567841){var _0x4347ed=function(_0x1faa4f){while(--_0x1faa4f){_0x248049['push'](_0x248049['shift']());}};_0x4347ed(++_0x567841);}(_0x935c,0x9b));var _0xc935=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x935c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xc935('0x0')]={'name':{'type':Sequelize[_0xc935('0x1')],'unique':_0xc935('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc935('0x1')]},'companyId':{'type':Sequelize[_0xc935('0x1')]},'website':{'type':Sequelize[_0xc935('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc935('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc935('0x1')]},'postalCode':{'type':Sequelize[_0xc935('0x1')]},'city':{'type':Sequelize[_0xc935('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc935('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xc935('0x1')]},'sCity':{'type':Sequelize[_0xc935('0x1')]},'sCountry':{'type':Sequelize[_0xc935('0x1')]},'description':{'type':Sequelize[_0xc935('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index b094834..1cfb190 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 _0x3a4f=['Content-Range','apply','reject','save','destroy','then','Companies','error','stack','name','send','index','CmCompany','describe','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','user','get','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','omit','CmContact','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','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/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count'];(function(_0x54d7a7,_0x57b69a){var _0x1cf477=function(_0x599cd4){while(--_0x599cd4){_0x54d7a7['push'](_0x54d7a7['shift']());}};_0x1cf477(++_0x57b69a);}(_0x3a4f,0x130));var _0xf3a4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3a4f[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3a4('0x0'));var zipdir=require(_0xf3a4('0x1'));var jsonpatch=require(_0xf3a4('0x2'));var rp=require(_0xf3a4('0x3'));var moment=require(_0xf3a4('0x4'));var BPromise=require(_0xf3a4('0x5'));var Mustache=require(_0xf3a4('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf3a4('0x7'));var csv=require('to-csv');var ejs=require(_0xf3a4('0x8'));var fs=require('fs');var fs_extra=require(_0xf3a4('0x9'));var _=require(_0xf3a4('0xa'));var squel=require('squel');var crypto=require(_0xf3a4('0xb'));var jsforce=require(_0xf3a4('0xc'));var deskjs=require(_0xf3a4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf3a4('0xe'));var Papa=require(_0xf3a4('0xf'));var Redis=require(_0xf3a4('0x10'));var authService=require(_0xf3a4('0x11'));var qs=require(_0xf3a4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3a4('0x13'));var logger=require(_0xf3a4('0x14'))(_0xf3a4('0x15'));var utils=require(_0xf3a4('0x16'));var config=require(_0xf3a4('0x17'));var licenseUtil=require(_0xf3a4('0x18'));var db=require(_0xf3a4('0x19'))['db'];function respondWithStatusCode(_0x4a3630,_0x3b3435){_0x3b3435=_0x3b3435||0xcc;return function(_0x43ec44){if(_0x43ec44){return _0x4a3630['sendStatus'](_0x3b3435);}return _0x4a3630['status'](_0x3b3435)[_0xf3a4('0x1a')]();};}function respondWithResult(_0x1786c0,_0x37b471){_0x37b471=_0x37b471||0xc8;return function(_0x5763a9){if(_0x5763a9){return _0x1786c0[_0xf3a4('0x1b')](_0x37b471)['json'](_0x5763a9);}};}function respondWithFilteredResult(_0x372f8e,_0x3a3a1f){return function(_0xbdc8f5){if(_0xbdc8f5){var _0x103ffc=typeof _0x3a3a1f[_0xf3a4('0x1c')]===_0xf3a4('0x1d')&&typeof _0x3a3a1f[_0xf3a4('0x1e')]===_0xf3a4('0x1d');var _0x1a6528=_0xbdc8f5['count'];var _0x185fc9=_0x103ffc?0x0:_0x3a3a1f['offset'];var _0x50150b=_0x103ffc?_0xbdc8f5[_0xf3a4('0x1f')]:_0x3a3a1f[_0xf3a4('0x1c')]+_0x3a3a1f[_0xf3a4('0x1e')];var _0x47ab3f;if(_0x50150b>=_0x1a6528){_0x50150b=_0x1a6528;_0x47ab3f=0xc8;}else{_0x47ab3f=0xce;}_0x372f8e[_0xf3a4('0x1b')](_0x47ab3f);return _0x372f8e['set'](_0xf3a4('0x20'),_0x185fc9+'-'+_0x50150b+'/'+_0x1a6528)['json'](_0xbdc8f5);}return null;};}function patchUpdates(_0x2ab13b){return function(_0x3fe07d){try{jsonpatch[_0xf3a4('0x21')](_0x3fe07d,_0x2ab13b,!![]);}catch(_0x1eae0b){return BPromise[_0xf3a4('0x22')](_0x1eae0b);}return _0x3fe07d[_0xf3a4('0x23')]();};}function saveUpdates(_0x217afb,_0x228b18){return function(_0x6ce2a2){if(_0x6ce2a2){return _0x6ce2a2['update'](_0x217afb)['then'](function(_0x361cb2){return _0x361cb2;});}return null;};}function removeEntity(_0x2a6a3d,_0x1addc4){return function(_0x458e90){if(_0x458e90){return _0x458e90[_0xf3a4('0x24')]()[_0xf3a4('0x25')](function(){var _0x54b9bc=_0x458e90['get']({'plain':!![]});var _0x212132=_0xf3a4('0x26');return db['UserProfileResource'][_0xf3a4('0x24')]({'where':{'type':_0x212132,'resourceId':_0x54b9bc['id']}})[_0xf3a4('0x25')](function(){return _0x458e90;});})[_0xf3a4('0x25')](function(){_0x2a6a3d[_0xf3a4('0x1b')](0xcc)[_0xf3a4('0x1a')]();});}};}function handleEntityNotFound(_0x4700d3,_0x49b5c8){return function(_0x164ffc){if(!_0x164ffc){_0x4700d3['sendStatus'](0x194);}return _0x164ffc;};}function handleError(_0x2b92c0,_0x5db2a7){_0x5db2a7=_0x5db2a7||0x1f4;return function(_0x38c197){logger[_0xf3a4('0x27')](_0x38c197[_0xf3a4('0x28')]);if(_0x38c197[_0xf3a4('0x29')]){delete _0x38c197[_0xf3a4('0x29')];}_0x2b92c0[_0xf3a4('0x1b')](_0x5db2a7)[_0xf3a4('0x2a')](_0x38c197);};}exports[_0xf3a4('0x2b')]=function(_0x3e13f9,_0x33f75d){var _0x19bf5b={},_0xffb320={},_0x1d6793={'count':0x0,'rows':[]};return db[_0xf3a4('0x2c')][_0xf3a4('0x2d')]()['then'](function(_0x4aff72){_0xffb320['model']=_['keys'](_0x4aff72);_0xffb320[_0xf3a4('0x2e')]=_['keys'](_0x3e13f9[_0xf3a4('0x2e')]);_0xffb320['filters']=_[_0xf3a4('0x2f')](_0xffb320[_0xf3a4('0x30')],_0xffb320[_0xf3a4('0x2e')]);_0x19bf5b[_0xf3a4('0x31')]=_[_0xf3a4('0x2f')](_0xffb320[_0xf3a4('0x30')],qs[_0xf3a4('0x32')](_0x3e13f9[_0xf3a4('0x2e')]['fields']));_0x19bf5b[_0xf3a4('0x31')]=_0x19bf5b[_0xf3a4('0x31')][_0xf3a4('0x33')]?_0x19bf5b['attributes']:_0xffb320[_0xf3a4('0x30')];if(!_0x3e13f9[_0xf3a4('0x2e')][_0xf3a4('0x34')](_0xf3a4('0x35'))){_0x19bf5b[_0xf3a4('0x1e')]=qs[_0xf3a4('0x1e')](_0x3e13f9[_0xf3a4('0x2e')]['limit']);_0x19bf5b[_0xf3a4('0x1c')]=qs[_0xf3a4('0x1c')](_0x3e13f9[_0xf3a4('0x2e')][_0xf3a4('0x1c')]);}_0x19bf5b[_0xf3a4('0x36')]=qs['sort'](_0x3e13f9[_0xf3a4('0x2e')][_0xf3a4('0x37')]);_0x19bf5b['where']=qs['filters'](_[_0xf3a4('0x38')](_0x3e13f9[_0xf3a4('0x2e')],_0xffb320[_0xf3a4('0x39')]),_0x4aff72);if(_0x3e13f9[_0xf3a4('0x2e')]['filter']){_0x19bf5b[_0xf3a4('0x3a')]=_[_0xf3a4('0x3b')](_0x19bf5b[_0xf3a4('0x3a')],{'$or':_['map'](_0x19bf5b[_0xf3a4('0x31')],function(_0x20cd50){var _0x30ca97={};_0x30ca97[_0x20cd50]={'$like':'%'+_0x3e13f9[_0xf3a4('0x2e')][_0xf3a4('0x3c')]+'%'};return _0x30ca97;})});}_0x19bf5b=_['merge']({},_0x19bf5b,_0x3e13f9[_0xf3a4('0x3d')]);var _0x15cec1={'where':_0x19bf5b[_0xf3a4('0x3a')]};return db['CmCompany']['count'](_0x15cec1)[_0xf3a4('0x25')](function(_0x1f82b9){_0x1d6793[_0xf3a4('0x1f')]=_0x1f82b9;if(_0x3e13f9['query'][_0xf3a4('0x3e')]){_0x19bf5b[_0xf3a4('0x3f')]=[{'all':!![]}];}return db[_0xf3a4('0x2c')][_0xf3a4('0x40')](_0x19bf5b);})[_0xf3a4('0x25')](function(_0x4416b7){_0x1d6793['rows']=_0x4416b7;return _0x1d6793;})[_0xf3a4('0x25')](respondWithFilteredResult(_0x33f75d,_0x19bf5b))['catch'](handleError(_0x33f75d,null));})['catch'](handleError(_0x33f75d,null));};exports[_0xf3a4('0x41')]=function(_0x444c95,_0x5ddecb){var _0x4de65e={'raw':![],'where':{'id':_0x444c95[_0xf3a4('0x42')]['id']}},_0x1d7a33={};_0x1d7a33[_0xf3a4('0x30')]=_[_0xf3a4('0x43')](db[_0xf3a4('0x2c')]['rawAttributes']);_0x1d7a33['query']=_['keys'](_0x444c95[_0xf3a4('0x2e')]);_0x1d7a33[_0xf3a4('0x39')]=_[_0xf3a4('0x2f')](_0x1d7a33['model'],_0x1d7a33['query']);_0x4de65e[_0xf3a4('0x31')]=_[_0xf3a4('0x2f')](_0x1d7a33[_0xf3a4('0x30')],qs['fields'](_0x444c95[_0xf3a4('0x2e')][_0xf3a4('0x32')]));_0x4de65e[_0xf3a4('0x31')]=_0x4de65e[_0xf3a4('0x31')][_0xf3a4('0x33')]?_0x4de65e[_0xf3a4('0x31')]:_0x1d7a33[_0xf3a4('0x30')];if(_0x444c95['query'][_0xf3a4('0x3e')]){_0x4de65e[_0xf3a4('0x3f')]=[{'all':!![]}];}_0x4de65e=_[_0xf3a4('0x3b')]({},_0x4de65e,_0x444c95[_0xf3a4('0x3d')]);return db['CmCompany'][_0xf3a4('0x44')](_0x4de65e)[_0xf3a4('0x25')](handleEntityNotFound(_0x5ddecb,null))[_0xf3a4('0x25')](respondWithResult(_0x5ddecb,null))[_0xf3a4('0x45')](handleError(_0x5ddecb,null));};exports[_0xf3a4('0x46')]=function(_0x3621b6,_0x4a927d){return db['CmCompany'][_0xf3a4('0x46')](_0x3621b6[_0xf3a4('0x47')],{})[_0xf3a4('0x25')](function(_0x13e100){var _0x391dfc=_0x3621b6[_0xf3a4('0x48')][_0xf3a4('0x49')]({'plain':!![]});if(!_0x391dfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x391dfc[_0xf3a4('0x4a')]===_0xf3a4('0x48')){var _0x42afa2=_0x13e100[_0xf3a4('0x49')]({'plain':!![]});var _0x513eaa=_0xf3a4('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x513eaa,'userProfileId':_0x391dfc[_0xf3a4('0x4b')]},'raw':!![]})[_0xf3a4('0x25')](function(_0x509b38){if(_0x509b38&&_0x509b38['autoAssociation']===0x0){return db[_0xf3a4('0x4c')][_0xf3a4('0x46')]({'name':_0x42afa2['name'],'resourceId':_0x42afa2['id'],'type':_0x509b38[_0xf3a4('0x29')],'sectionId':_0x509b38['id']},{})[_0xf3a4('0x25')](function(){return _0x13e100;});}else{return _0x13e100;}})[_0xf3a4('0x45')](function(_0x316193){logger['error'](_0xf3a4('0x4d'),_0x316193);throw _0x316193;});}return _0x13e100;})[_0xf3a4('0x25')](respondWithResult(_0x4a927d,0xc9))[_0xf3a4('0x45')](handleError(_0x4a927d,null));};exports[_0xf3a4('0x4e')]=function(_0x16de95,_0x5803b4){if(_0x16de95[_0xf3a4('0x47')]['id']){delete _0x16de95[_0xf3a4('0x47')]['id'];}return db[_0xf3a4('0x2c')][_0xf3a4('0x44')]({'where':{'id':_0x16de95['params']['id']}})['then'](handleEntityNotFound(_0x5803b4,null))['then'](saveUpdates(_0x16de95[_0xf3a4('0x47')],null))[_0xf3a4('0x25')](respondWithResult(_0x5803b4,null))[_0xf3a4('0x45')](handleError(_0x5803b4,null));};exports[_0xf3a4('0x24')]=function(_0x39b10f,_0x3ba0f2){return db[_0xf3a4('0x2c')]['find']({'where':{'id':_0x39b10f[_0xf3a4('0x42')]['id']}})[_0xf3a4('0x25')](handleEntityNotFound(_0x3ba0f2,null))[_0xf3a4('0x25')](removeEntity(_0x3ba0f2,null))[_0xf3a4('0x45')](handleError(_0x3ba0f2,null));};exports['describe']=function(_0x5d970e,_0x136a07){return db[_0xf3a4('0x2c')][_0xf3a4('0x2d')]()[_0xf3a4('0x25')](respondWithResult(_0x136a07,null))[_0xf3a4('0x45')](handleError(_0x136a07,null));};exports[_0xf3a4('0x4f')]=function(_0x4e53c5,_0x318f24,_0x2bce2b){return db['CmContact'][_0xf3a4('0x44')]({'where':{'id':_0x4e53c5['params']['id']}})[_0xf3a4('0x25')](handleEntityNotFound(_0x318f24,null))[_0xf3a4('0x25')](function(_0x49fef5){if(_0x49fef5){return _0x49fef5[_0xf3a4('0x4f')](_0x4e53c5['body'][_0xf3a4('0x50')],_[_0xf3a4('0x51')](_0x4e53c5[_0xf3a4('0x47')],[_0xf3a4('0x50'),'id'])||{});}})[_0xf3a4('0x25')](respondWithResult(_0x318f24,null))[_0xf3a4('0x45')](handleError(_0x318f24,null));};exports['getContacts']=function(_0x7e3497,_0x167730,_0x2722d8){var _0x59e64a={};var _0xca4b22={};var _0x3b5342;var _0xfd6464;return db[_0xf3a4('0x2c')]['findOne']({'where':{'id':_0x7e3497['params']['id']}})['then'](handleEntityNotFound(_0x167730,null))['then'](function(_0xc09cba){if(_0xc09cba){_0x3b5342=_0xc09cba;_0xca4b22['model']=_[_0xf3a4('0x43')](db[_0xf3a4('0x52')]['rawAttributes']);_0xca4b22[_0xf3a4('0x2e')]=_[_0xf3a4('0x43')](_0x7e3497[_0xf3a4('0x2e')]);_0xca4b22[_0xf3a4('0x39')]=_['intersection'](_0xca4b22[_0xf3a4('0x30')],_0xca4b22['query']);_0x59e64a[_0xf3a4('0x31')]=_[_0xf3a4('0x2f')](_0xca4b22['model'],qs[_0xf3a4('0x32')](_0x7e3497[_0xf3a4('0x2e')]['fields']));_0x59e64a['attributes']=_0x59e64a[_0xf3a4('0x31')][_0xf3a4('0x33')]?_0x59e64a['attributes']:_0xca4b22[_0xf3a4('0x30')];_0x59e64a[_0xf3a4('0x36')]=qs[_0xf3a4('0x37')](_0x7e3497[_0xf3a4('0x2e')][_0xf3a4('0x37')]);_0x59e64a[_0xf3a4('0x3a')]=qs[_0xf3a4('0x39')](_[_0xf3a4('0x38')](_0x7e3497[_0xf3a4('0x2e')],_0xca4b22['filters']));if(_0x7e3497[_0xf3a4('0x2e')]['filter']){_0x59e64a['where']=_[_0xf3a4('0x3b')](_0x59e64a[_0xf3a4('0x3a')],{'$or':_['map'](_0x59e64a[_0xf3a4('0x31')],function(_0x2ed003){var _0x11f23a={};_0x11f23a[_0x2ed003]={'$like':'%'+_0x7e3497[_0xf3a4('0x2e')]['filter']+'%'};return _0x11f23a;})});}_0x59e64a=_['merge']({},_0x59e64a,_0x7e3497[_0xf3a4('0x3d')]);return _0x3b5342[_0xf3a4('0x53')](_0x59e64a);}})[_0xf3a4('0x25')](function(_0x57c359){if(_0x57c359){_0xfd6464=_0x57c359[_0xf3a4('0x33')];if(!_0x7e3497[_0xf3a4('0x2e')][_0xf3a4('0x34')](_0xf3a4('0x35'))){_0x59e64a[_0xf3a4('0x1e')]=qs[_0xf3a4('0x1e')](_0x7e3497[_0xf3a4('0x2e')]['limit']);_0x59e64a[_0xf3a4('0x1c')]=qs[_0xf3a4('0x1c')](_0x7e3497[_0xf3a4('0x2e')]['offset']);}return _0x3b5342[_0xf3a4('0x53')](_0x59e64a);}})[_0xf3a4('0x25')](function(_0x501339){if(_0x501339){return _0x501339?{'count':_0xfd6464,'rows':_0x501339}:null;}})['then'](respondWithResult(_0x167730,null))['catch'](handleError(_0x167730,null));}; \ No newline at end of file +var _0xd061=['then','destroy','get','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','options','count','includeAll','include','findAll','catch','show','rawAttributes','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','UserProfileResource','error','params','addContacts','omit','getContacts','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xd061,0x136));var _0x1d06=function(_0x4d2e9c,_0x2bcbbf){_0x4d2e9c=_0x4d2e9c-0x0;var _0x3e8116=_0xd061[_0x4d2e9c];return _0x3e8116;};'use strict';var emlformat=require(_0x1d06('0x0'));var rimraf=require(_0x1d06('0x1'));var zipdir=require(_0x1d06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d06('0x3'));var moment=require(_0x1d06('0x4'));var BPromise=require(_0x1d06('0x5'));var Mustache=require('mustache');var util=require(_0x1d06('0x6'));var path=require('path');var sox=require(_0x1d06('0x7'));var csv=require('to-csv');var ejs=require(_0x1d06('0x8'));var fs=require('fs');var fs_extra=require(_0x1d06('0x9'));var _=require(_0x1d06('0xa'));var squel=require(_0x1d06('0xb'));var crypto=require(_0x1d06('0xc'));var jsforce=require(_0x1d06('0xd'));var deskjs=require(_0x1d06('0xe'));var toCsv=require(_0x1d06('0xf'));var querystring=require('querystring');var Papa=require(_0x1d06('0x10'));var Redis=require('ioredis');var authService=require(_0x1d06('0x11'));var qs=require(_0x1d06('0x12'));var as=require(_0x1d06('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d06('0x14'))(_0x1d06('0x15'));var utils=require(_0x1d06('0x16'));var config=require(_0x1d06('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d06('0x18'))['db'];function respondWithStatusCode(_0x407f9d,_0x4c09a4){_0x4c09a4=_0x4c09a4||0xcc;return function(_0x26c90f){if(_0x26c90f){return _0x407f9d[_0x1d06('0x19')](_0x4c09a4);}return _0x407f9d[_0x1d06('0x1a')](_0x4c09a4)[_0x1d06('0x1b')]();};}function respondWithResult(_0x157d5c,_0x49d958){_0x49d958=_0x49d958||0xc8;return function(_0x112816){if(_0x112816){return _0x157d5c['status'](_0x49d958)[_0x1d06('0x1c')](_0x112816);}};}function respondWithFilteredResult(_0x55496d,_0x229cb3){return function(_0x180909){if(_0x180909){var _0x52206d=typeof _0x229cb3[_0x1d06('0x1d')]===_0x1d06('0x1e')&&typeof _0x229cb3[_0x1d06('0x1f')]===_0x1d06('0x1e');var _0x5d15e1=_0x180909['count'];var _0x16b308=_0x52206d?0x0:_0x229cb3['offset'];var _0xbb4fea=_0x52206d?_0x180909['count']:_0x229cb3['offset']+_0x229cb3[_0x1d06('0x1f')];var _0x525950;if(_0xbb4fea>=_0x5d15e1){_0xbb4fea=_0x5d15e1;_0x525950=0xc8;}else{_0x525950=0xce;}_0x55496d[_0x1d06('0x1a')](_0x525950);return _0x55496d[_0x1d06('0x20')](_0x1d06('0x21'),_0x16b308+'-'+_0xbb4fea+'/'+_0x5d15e1)[_0x1d06('0x1c')](_0x180909);}return null;};}function patchUpdates(_0x5db021){return function(_0x3b92c0){try{jsonpatch[_0x1d06('0x22')](_0x3b92c0,_0x5db021,!![]);}catch(_0x20359e){return BPromise[_0x1d06('0x23')](_0x20359e);}return _0x3b92c0[_0x1d06('0x24')]();};}function saveUpdates(_0x3ea015,_0x1cd5f5){return function(_0x2bad15){if(_0x2bad15){return _0x2bad15[_0x1d06('0x25')](_0x3ea015)[_0x1d06('0x26')](function(_0x3374ec){return _0x3374ec;});}return null;};}function removeEntity(_0x3147f6,_0x7dc136){return function(_0x262fa2){if(_0x262fa2){return _0x262fa2[_0x1d06('0x27')]()[_0x1d06('0x26')](function(){var _0x3392f8=_0x262fa2[_0x1d06('0x28')]({'plain':!![]});var _0x9ff5fe='Companies';return db['UserProfileResource'][_0x1d06('0x27')]({'where':{'type':_0x9ff5fe,'resourceId':_0x3392f8['id']}})[_0x1d06('0x26')](function(){return _0x262fa2;});})[_0x1d06('0x26')](function(){_0x3147f6['status'](0xcc)[_0x1d06('0x1b')]();});}};}function handleEntityNotFound(_0x216b55,_0x1e2d61){return function(_0x50b8b4){if(!_0x50b8b4){_0x216b55[_0x1d06('0x19')](0x194);}return _0x50b8b4;};}function handleError(_0x20376a,_0x2d96e2){_0x2d96e2=_0x2d96e2||0x1f4;return function(_0x13ee3d){logger['error'](_0x13ee3d[_0x1d06('0x29')]);if(_0x13ee3d[_0x1d06('0x2a')]){delete _0x13ee3d[_0x1d06('0x2a')];}_0x20376a[_0x1d06('0x1a')](_0x2d96e2)[_0x1d06('0x2b')](_0x13ee3d);};}exports[_0x1d06('0x2c')]=function(_0x52f59d,_0x15fb37){var _0x3a770b={},_0x3634e4={},_0x6f6bf9={'count':0x0,'rows':[]};return db[_0x1d06('0x2d')][_0x1d06('0x2e')]()[_0x1d06('0x26')](function(_0x415237){_0x3634e4['model']=_[_0x1d06('0x2f')](_0x415237);_0x3634e4[_0x1d06('0x30')]=_[_0x1d06('0x2f')](_0x52f59d[_0x1d06('0x30')]);_0x3634e4[_0x1d06('0x31')]=_[_0x1d06('0x32')](_0x3634e4[_0x1d06('0x33')],_0x3634e4[_0x1d06('0x30')]);_0x3a770b[_0x1d06('0x34')]=_['intersection'](_0x3634e4[_0x1d06('0x33')],qs[_0x1d06('0x35')](_0x52f59d['query']['fields']));_0x3a770b[_0x1d06('0x34')]=_0x3a770b['attributes'][_0x1d06('0x36')]?_0x3a770b[_0x1d06('0x34')]:_0x3634e4[_0x1d06('0x33')];if(!_0x52f59d[_0x1d06('0x30')][_0x1d06('0x37')](_0x1d06('0x38'))){_0x3a770b[_0x1d06('0x1f')]=qs[_0x1d06('0x1f')](_0x52f59d[_0x1d06('0x30')][_0x1d06('0x1f')]);_0x3a770b[_0x1d06('0x1d')]=qs[_0x1d06('0x1d')](_0x52f59d[_0x1d06('0x30')][_0x1d06('0x1d')]);}_0x3a770b[_0x1d06('0x39')]=qs[_0x1d06('0x3a')](_0x52f59d['query']['sort']);_0x3a770b[_0x1d06('0x3b')]=qs[_0x1d06('0x31')](_[_0x1d06('0x3c')](_0x52f59d['query'],_0x3634e4[_0x1d06('0x31')]),_0x415237);if(_0x52f59d[_0x1d06('0x30')][_0x1d06('0x3d')]){_0x3a770b[_0x1d06('0x3b')]=_['merge'](_0x3a770b['where'],{'$or':_[_0x1d06('0x3e')](_0x3a770b[_0x1d06('0x34')],function(_0x264952){var _0x3fb51c={};_0x3fb51c[_0x264952]={'$like':'%'+_0x52f59d[_0x1d06('0x30')][_0x1d06('0x3d')]+'%'};return _0x3fb51c;})});}_0x3a770b=_['merge']({},_0x3a770b,_0x52f59d[_0x1d06('0x3f')]);var _0x10c79={'where':_0x3a770b[_0x1d06('0x3b')]};return db[_0x1d06('0x2d')][_0x1d06('0x40')](_0x10c79)[_0x1d06('0x26')](function(_0x5b021b){_0x6f6bf9[_0x1d06('0x40')]=_0x5b021b;if(_0x52f59d[_0x1d06('0x30')][_0x1d06('0x41')]){_0x3a770b[_0x1d06('0x42')]=[{'all':!![]}];}return db[_0x1d06('0x2d')][_0x1d06('0x43')](_0x3a770b);})[_0x1d06('0x26')](function(_0x298f3d){_0x6f6bf9['rows']=_0x298f3d;return _0x6f6bf9;})[_0x1d06('0x26')](respondWithFilteredResult(_0x15fb37,_0x3a770b))[_0x1d06('0x44')](handleError(_0x15fb37,null));})['catch'](handleError(_0x15fb37,null));};exports[_0x1d06('0x45')]=function(_0x23f2e5,_0x35e063){var _0x137d93={'raw':![],'where':{'id':_0x23f2e5['params']['id']}},_0x5e182c={};_0x5e182c['model']=_[_0x1d06('0x2f')](db[_0x1d06('0x2d')][_0x1d06('0x46')]);_0x5e182c[_0x1d06('0x30')]=_['keys'](_0x23f2e5[_0x1d06('0x30')]);_0x5e182c['filters']=_[_0x1d06('0x32')](_0x5e182c[_0x1d06('0x33')],_0x5e182c[_0x1d06('0x30')]);_0x137d93[_0x1d06('0x34')]=_[_0x1d06('0x32')](_0x5e182c[_0x1d06('0x33')],qs[_0x1d06('0x35')](_0x23f2e5[_0x1d06('0x30')][_0x1d06('0x35')]));_0x137d93[_0x1d06('0x34')]=_0x137d93[_0x1d06('0x34')][_0x1d06('0x36')]?_0x137d93[_0x1d06('0x34')]:_0x5e182c[_0x1d06('0x33')];if(_0x23f2e5[_0x1d06('0x30')][_0x1d06('0x41')]){_0x137d93['include']=[{'all':!![]}];}_0x137d93=_[_0x1d06('0x47')]({},_0x137d93,_0x23f2e5[_0x1d06('0x3f')]);return db['CmCompany'][_0x1d06('0x48')](_0x137d93)[_0x1d06('0x26')](handleEntityNotFound(_0x35e063,null))['then'](respondWithResult(_0x35e063,null))[_0x1d06('0x44')](handleError(_0x35e063,null));};exports[_0x1d06('0x49')]=function(_0x2cac7b,_0xac4751){return db[_0x1d06('0x2d')][_0x1d06('0x49')](_0x2cac7b[_0x1d06('0x4a')],{})[_0x1d06('0x26')](function(_0x2be021){var _0x9350a6=_0x2cac7b['user'][_0x1d06('0x28')]({'plain':!![]});if(!_0x9350a6)throw new Error(_0x1d06('0x4b'));if(_0x9350a6[_0x1d06('0x4c')]===_0x1d06('0x4d')){var _0x2f0865=_0x2be021[_0x1d06('0x28')]({'plain':!![]});var _0x40116d=_0x1d06('0x4e');return db[_0x1d06('0x4f')]['find']({'where':{'name':_0x40116d,'userProfileId':_0x9350a6['userProfileId']},'raw':!![]})[_0x1d06('0x26')](function(_0x25f07f){if(_0x25f07f&&_0x25f07f['autoAssociation']===0x0){return db[_0x1d06('0x50')]['create']({'name':_0x2f0865[_0x1d06('0x2a')],'resourceId':_0x2f0865['id'],'type':_0x25f07f[_0x1d06('0x2a')],'sectionId':_0x25f07f['id']},{})[_0x1d06('0x26')](function(){return _0x2be021;});}else{return _0x2be021;}})['catch'](function(_0x461b94){logger[_0x1d06('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x461b94);throw _0x461b94;});}return _0x2be021;})['then'](respondWithResult(_0xac4751,0xc9))[_0x1d06('0x44')](handleError(_0xac4751,null));};exports[_0x1d06('0x25')]=function(_0x4fd7fb,_0x535b62){if(_0x4fd7fb[_0x1d06('0x4a')]['id']){delete _0x4fd7fb[_0x1d06('0x4a')]['id'];}return db[_0x1d06('0x2d')]['find']({'where':{'id':_0x4fd7fb['params']['id']}})[_0x1d06('0x26')](handleEntityNotFound(_0x535b62,null))[_0x1d06('0x26')](saveUpdates(_0x4fd7fb['body'],null))[_0x1d06('0x26')](respondWithResult(_0x535b62,null))['catch'](handleError(_0x535b62,null));};exports['destroy']=function(_0x38547b,_0x59880d){return db[_0x1d06('0x2d')]['find']({'where':{'id':_0x38547b[_0x1d06('0x52')]['id']}})['then'](handleEntityNotFound(_0x59880d,null))[_0x1d06('0x26')](removeEntity(_0x59880d,null))[_0x1d06('0x44')](handleError(_0x59880d,null));};exports['describe']=function(_0x5a5fb7,_0x3767dc){return db['CmCompany'][_0x1d06('0x2e')]()['then'](respondWithResult(_0x3767dc,null))[_0x1d06('0x44')](handleError(_0x3767dc,null));};exports[_0x1d06('0x53')]=function(_0x166deb,_0x26af8f,_0x49cdfc){return db['CmContact']['find']({'where':{'id':_0x166deb['params']['id']}})[_0x1d06('0x26')](handleEntityNotFound(_0x26af8f,null))['then'](function(_0x5445fc){if(_0x5445fc){return _0x5445fc[_0x1d06('0x53')](_0x166deb['body']['ids'],_[_0x1d06('0x54')](_0x166deb[_0x1d06('0x4a')],['ids','id'])||{});}})[_0x1d06('0x26')](respondWithResult(_0x26af8f,null))[_0x1d06('0x44')](handleError(_0x26af8f,null));};exports[_0x1d06('0x55')]=function(_0xc0a046,_0x3a14a5,_0x33a59d){var _0x1f51b4={};var _0x5568de={};var _0x2eaead;var _0x5eaef1;return db['CmCompany'][_0x1d06('0x56')]({'where':{'id':_0xc0a046['params']['id']}})['then'](handleEntityNotFound(_0x3a14a5,null))[_0x1d06('0x26')](function(_0x4583c9){if(_0x4583c9){_0x2eaead=_0x4583c9;_0x5568de[_0x1d06('0x33')]=_['keys'](db['CmContact'][_0x1d06('0x46')]);_0x5568de['query']=_['keys'](_0xc0a046[_0x1d06('0x30')]);_0x5568de['filters']=_[_0x1d06('0x32')](_0x5568de[_0x1d06('0x33')],_0x5568de['query']);_0x1f51b4[_0x1d06('0x34')]=_[_0x1d06('0x32')](_0x5568de[_0x1d06('0x33')],qs['fields'](_0xc0a046[_0x1d06('0x30')][_0x1d06('0x35')]));_0x1f51b4[_0x1d06('0x34')]=_0x1f51b4['attributes']['length']?_0x1f51b4[_0x1d06('0x34')]:_0x5568de[_0x1d06('0x33')];_0x1f51b4[_0x1d06('0x39')]=qs[_0x1d06('0x3a')](_0xc0a046[_0x1d06('0x30')][_0x1d06('0x3a')]);_0x1f51b4[_0x1d06('0x3b')]=qs['filters'](_['pick'](_0xc0a046['query'],_0x5568de['filters']));if(_0xc0a046['query'][_0x1d06('0x3d')]){_0x1f51b4[_0x1d06('0x3b')]=_[_0x1d06('0x47')](_0x1f51b4[_0x1d06('0x3b')],{'$or':_[_0x1d06('0x3e')](_0x1f51b4[_0x1d06('0x34')],function(_0x58babb){var _0x408a50={};_0x408a50[_0x58babb]={'$like':'%'+_0xc0a046[_0x1d06('0x30')][_0x1d06('0x3d')]+'%'};return _0x408a50;})});}_0x1f51b4=_[_0x1d06('0x47')]({},_0x1f51b4,_0xc0a046['options']);return _0x2eaead[_0x1d06('0x55')](_0x1f51b4);}})[_0x1d06('0x26')](function(_0x138b01){if(_0x138b01){_0x5eaef1=_0x138b01[_0x1d06('0x36')];if(!_0xc0a046[_0x1d06('0x30')][_0x1d06('0x37')](_0x1d06('0x38'))){_0x1f51b4[_0x1d06('0x1f')]=qs[_0x1d06('0x1f')](_0xc0a046[_0x1d06('0x30')][_0x1d06('0x1f')]);_0x1f51b4[_0x1d06('0x1d')]=qs[_0x1d06('0x1d')](_0xc0a046['query']['offset']);}return _0x2eaead[_0x1d06('0x55')](_0x1f51b4);}})['then'](function(_0x13a7e2){if(_0x13a7e2){return _0x13a7e2?{'count':_0x5eaef1,'rows':_0x13a7e2}:null;}})[_0x1d06('0x26')](respondWithResult(_0x3a14a5,null))['catch'](handleError(_0x3a14a5,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 48b74ba..945ed9d 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 _0xbbd8=['path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13a26b,_0x5693b1){var _0x4c2f07=function(_0x260581){while(--_0x260581){_0x13a26b['push'](_0x13a26b['shift']());}};_0x4c2f07(++_0x5693b1);}(_0xbbd8,0x125));var _0x8bbd=function(_0x207909,_0x5ccc80){_0x207909=_0x207909-0x0;var _0x46b282=_0xbbd8[_0x207909];return _0x46b282;};'use strict';var _=require(_0x8bbd('0x0'));var util=require('util');var logger=require(_0x8bbd('0x1'))(_0x8bbd('0x2'));var moment=require(_0x8bbd('0x3'));var BPromise=require(_0x8bbd('0x4'));var rp=require(_0x8bbd('0x5'));var fs=require('fs');var path=require(_0x8bbd('0x6'));var rimraf=require(_0x8bbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x8bbd('0x8'));module[_0x8bbd('0x9')]=function(_0x5be8d3,_0x20fb81){return _0x5be8d3[_0x8bbd('0xa')](_0x8bbd('0xb'),attributes,{'tableName':_0x8bbd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3445=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','lodash','util','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3445,0x115));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5344('0x2'));var BPromise=require('bluebird');var rp=require(_0x5344('0x3'));var fs=require('fs');var path=require(_0x5344('0x4'));var rimraf=require(_0x5344('0x5'));var config=require(_0x5344('0x6'));var attributes=require(_0x5344('0x7'));module[_0x5344('0x8')]=function(_0x3678e7,_0x506b6a){return _0x3678e7['define'](_0x5344('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 523578b..3847757 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 _0x31f0=['error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x2f672e,_0x3405d1){var _0xaf008=function(_0x454fdf){while(--_0x454fdf){_0x2f672e['push'](_0x2f672e['shift']());}};_0xaf008(++_0x3405d1);}(_0x31f0,0xcb));var _0x031f=function(_0x17d5bf,_0x3252c1){_0x17d5bf=_0x17d5bf-0x0;var _0x5b3bf7=_0x31f0[_0x17d5bf];return _0x5b3bf7;};'use strict';var _=require(_0x031f('0x0'));var util=require(_0x031f('0x1'));var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rs=require(_0x031f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x031f('0x5'));var logger=require(_0x031f('0x6'))('rpc');var config=require(_0x031f('0x7'));var jayson=require(_0x031f('0x8'));var client=jayson[_0x031f('0x9')][_0x031f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xec014c,_0x48facc,_0x2553cd){return new BPromise(function(_0x247e10,_0x5dfd85){return client[_0x031f('0xb')](_0xec014c,_0x2553cd)[_0x031f('0xc')](function(_0x2ccc19){logger['info'](_0x031f('0xd'),_0x48facc,_0x031f('0xe'));logger[_0x031f('0xf')](_0x031f('0x10'),_0x48facc,'request\x20sent',JSON['stringify'](_0x2ccc19));if(_0x2ccc19['error']){if(_0x2ccc19[_0x031f('0x11')]['code']===0x1f4){logger[_0x031f('0x11')](_0x031f('0xd'),_0x48facc,_0x2ccc19[_0x031f('0x11')][_0x031f('0x12')]);return _0x5dfd85(_0x2ccc19[_0x031f('0x11')][_0x031f('0x12')]);}logger[_0x031f('0x11')]('CmCompany,\x20%s,\x20%s',_0x48facc,_0x2ccc19[_0x031f('0x11')][_0x031f('0x12')]);return _0x247e10(_0x2ccc19[_0x031f('0x11')][_0x031f('0x12')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x48facc,_0x031f('0xe'));_0x247e10(_0x2ccc19['result'][_0x031f('0x12')]);}})[_0x031f('0x13')](function(_0x43e17d){logger['error'](_0x031f('0xd'),_0x48facc,_0x43e17d);_0x5dfd85(_0x43e17d);});});} \ No newline at end of file +var _0x8da8=['request','then','CmCompany,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8da8,0x94));var _0x88da=function(_0x953867,_0x1f850f){_0x953867=_0x953867-0x0;var _0x4f41f8=_0x8da8[_0x953867];return _0x4f41f8;};'use strict';var _=require(_0x88da('0x0'));var util=require(_0x88da('0x1'));var moment=require(_0x88da('0x2'));var BPromise=require(_0x88da('0x3'));var rs=require(_0x88da('0x4'));var fs=require('fs');var Redis=require(_0x88da('0x5'));var db=require(_0x88da('0x6'))['db'];var utils=require(_0x88da('0x7'));var logger=require(_0x88da('0x8'))('rpc');var config=require(_0x88da('0x9'));var jayson=require(_0x88da('0xa'));var client=jayson[_0x88da('0xb')][_0x88da('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a150b,_0x2e6670,_0x461227){return new BPromise(function(_0x715c16,_0x536057){return client[_0x88da('0xd')](_0x5a150b,_0x461227)[_0x88da('0xe')](function(_0x7790e3){logger['info'](_0x88da('0xf'),_0x2e6670,'request\x20sent');logger[_0x88da('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2e6670,'request\x20sent',JSON['stringify'](_0x7790e3));if(_0x7790e3[_0x88da('0x11')]){if(_0x7790e3[_0x88da('0x11')][_0x88da('0x12')]===0x1f4){logger[_0x88da('0x11')](_0x88da('0xf'),_0x2e6670,_0x7790e3[_0x88da('0x11')][_0x88da('0x13')]);return _0x536057(_0x7790e3[_0x88da('0x11')][_0x88da('0x13')]);}logger[_0x88da('0x11')]('CmCompany,\x20%s,\x20%s',_0x2e6670,_0x7790e3[_0x88da('0x11')][_0x88da('0x13')]);return _0x715c16(_0x7790e3[_0x88da('0x11')][_0x88da('0x13')]);}else{logger['info'](_0x88da('0xf'),_0x2e6670,_0x88da('0x14'));_0x715c16(_0x7790e3[_0x88da('0x15')][_0x88da('0x13')]);}})[_0x88da('0x16')](function(_0x16f727){logger[_0x88da('0x11')](_0x88da('0xf'),_0x2e6670,_0x16f727);_0x536057(_0x16f727);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index b636dd8..79b06de 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 _0x5b58=['update','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','/:id/contacts','getContacts','create','post','addContacts','put'];(function(_0x17aeef,_0x3b10c4){var _0x1764c9=function(_0x2c742d){while(--_0x2c742d){_0x17aeef['push'](_0x17aeef['shift']());}};_0x1764c9(++_0x3b10c4);}(_0x5b58,0xb5));var _0x85b5=function(_0x5137c9,_0x3d193f){_0x5137c9=_0x5137c9-0x0;var _0x548778=_0x5b58[_0x5137c9];return _0x548778;};'use strict';var multer=require('multer');var util=require(_0x85b5('0x0'));var path=require('path');var timeout=require(_0x85b5('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x85b5('0x2'));var auth=require(_0x85b5('0x3'));var interaction=require(_0x85b5('0x4'));var config=require(_0x85b5('0x5'));var controller=require(_0x85b5('0x6'));router[_0x85b5('0x7')]('/',auth[_0x85b5('0x8')](),controller['index']);router[_0x85b5('0x7')](_0x85b5('0x9'),auth[_0x85b5('0x8')](),controller['describe']);router[_0x85b5('0x7')](_0x85b5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x85b5('0x7')](_0x85b5('0xb'),auth['isAuthenticated'](),controller[_0x85b5('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x85b5('0xd')]);router[_0x85b5('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x85b5('0xf')]);router[_0x85b5('0x10')](_0x85b5('0xa'),auth[_0x85b5('0x8')](),controller[_0x85b5('0x11')]);router['delete'](_0x85b5('0xa'),auth[_0x85b5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x767e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1b1d49,_0x5d265b){var _0x4b4813=function(_0x259a0a){while(--_0x259a0a){_0x1b1d49['push'](_0x1b1d49['shift']());}};_0x4b4813(++_0x5d265b);}(_0x767e,0x18c));var _0xe767=function(_0x5ab281,_0x4db3cd){_0x5ab281=_0x5ab281-0x0;var _0x527493=_0x767e[_0x5ab281];return _0x527493;};'use strict';var multer=require(_0xe767('0x0'));var util=require(_0xe767('0x1'));var path=require(_0xe767('0x2'));var timeout=require(_0xe767('0x3'));var express=require(_0xe767('0x4'));var router=express[_0xe767('0x5')]();var fs_extra=require(_0xe767('0x6'));var auth=require(_0xe767('0x7'));var interaction=require(_0xe767('0x8'));var config=require(_0xe767('0x9'));var controller=require(_0xe767('0xa'));router[_0xe767('0xb')]('/',auth[_0xe767('0xc')](),controller[_0xe767('0xd')]);router[_0xe767('0xb')](_0xe767('0xe'),auth[_0xe767('0xc')](),controller[_0xe767('0xf')]);router[_0xe767('0xb')](_0xe767('0x10'),auth[_0xe767('0xc')](),controller[_0xe767('0x11')]);router['get'](_0xe767('0x12'),auth['isAuthenticated'](),controller[_0xe767('0x13')]);router['post']('/',auth[_0xe767('0xc')](),controller[_0xe767('0x14')]);router['post']('/:id/contacts',auth[_0xe767('0xc')](),controller['addContacts']);router[_0xe767('0x15')](_0xe767('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xe767('0x16')](_0xe767('0x10'),auth[_0xe767('0xc')](),controller[_0xe767('0x17')]);module[_0xe767('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index bb05e7b..e21d100 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 _0xc33c=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x9e3edc,_0x594d61){var _0x44a387=function(_0x4edc66){while(--_0x4edc66){_0x9e3edc['push'](_0x9e3edc['shift']());}};_0x44a387(++_0x594d61);}(_0xc33c,0x1ee));var _0xcc33=function(_0xf5e58,_0x25959d){_0xf5e58=_0xf5e58-0x0;var _0x194c49=_0xc33c[_0xf5e58];return _0x194c49;};'use strict';var _=require(_0xcc33('0x0'));var Sequelize=require(_0xcc33('0x1'));module[_0xcc33('0x2')]={'firstName':{'type':Sequelize[_0xcc33('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xcc33('0x3')]},'street':{'type':Sequelize[_0xcc33('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xcc33('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xcc33('0x3')]},'description':{'type':Sequelize[_0xcc33('0x4')]},'phone':{'type':Sequelize[_0xcc33('0x3')]},'mobile':{'type':Sequelize[_0xcc33('0x3')]},'fax':{'type':Sequelize[_0xcc33('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xcc33('0x3')]},'facebook':{'type':Sequelize[_0xcc33('0x3')]},'fb_data':{'type':Sequelize[_0xcc33('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xcc33('0x3')]},'line':{'type':Sequelize[_0xcc33('0x3')]},'wechat':{'type':Sequelize[_0xcc33('0x3')]},'telegram':{'type':Sequelize[_0xcc33('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xcc33('0x5')](0x2)[_0xcc33('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xcc33('0x7')],'defaultValue':Sequelize[_0xcc33('0x8')]}}; \ No newline at end of file +var _0xc04a=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x1e16a0,_0x386161){var _0x84fa98=function(_0x4a8dcc){while(--_0x4a8dcc){_0x1e16a0['push'](_0x1e16a0['shift']());}};_0x84fa98(++_0x386161);}(_0xc04a,0x108));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac04('0x0'));var Sequelize=require(_0xac04('0x1'));module[_0xac04('0x2')]={'firstName':{'type':Sequelize[_0xac04('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xac04('0x3')]},'postalCode':{'type':Sequelize[_0xac04('0x3')]},'city':{'type':Sequelize[_0xac04('0x3')]},'country':{'type':Sequelize[_0xac04('0x3')]},'dateOfBirth':{'type':Sequelize[_0xac04('0x3')]},'description':{'type':Sequelize[_0xac04('0x4')]},'phone':{'type':Sequelize[_0xac04('0x3')]},'mobile':{'type':Sequelize[_0xac04('0x3')]},'fax':{'type':Sequelize[_0xac04('0x3')]},'email':{'type':Sequelize[_0xac04('0x3')]},'url':{'type':Sequelize[_0xac04('0x3')]},'facebook':{'type':Sequelize[_0xac04('0x3')]},'fb_data':{'type':Sequelize[_0xac04('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xac04('0x3')]},'teams':{'type':Sequelize[_0xac04('0x3')]},'viber':{'type':Sequelize[_0xac04('0x3')]},'line':{'type':Sequelize[_0xac04('0x3')]},'wechat':{'type':Sequelize[_0xac04('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xac04('0x5')](0x2)[_0xac04('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xac04('0x7')],'defaultValue':Sequelize[_0xac04('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index adc5491..ded30ca 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 _0x4af7=['FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappMessage','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','$and','CmCustomField','omit','format','cf_%d','pickBy','table','id\x20=\x20?','text','phone','getTags','findOne','rawAttributes','options','setTags','ContactId','getHopperHistories','CmHopperHistory','include','getHopperFinals','includeAll','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','binding_values','CompanyId','upload','path','parse','import','binding','No\x20phone\x20column\x20specified','firstName','../../components/import/cm/csv2','start\x20child\x20process\x20correctly!','pid','mail','chat','sms','openchannel','fax','voice','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','starttime','endtime','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closed','secondDisposition','thirdDisposition','Owner','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','substatus','externalUrl','Interaction','sortBy','slice','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','keys','length','startsWith','cf_','push','all','fieldType','type','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','User','and','datetime','buildExpression','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','SELECT','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','sequelize','toString','keyBy','merge','CmContact','fields','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','describe','columnName','findAll','displayName','alias','custom','values','body','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport'];(function(_0x4566b6,_0x1a56e9){var _0x297cac=function(_0x194174){while(--_0x194174){_0x4566b6['push'](_0x4566b6['shift']());}};_0x297cac(++_0x1a56e9);}(_0x4af7,0x6b));var _0x74af=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0x4af7[_0x4bdf64];return _0x9a1a19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74af('0x0'));var zipdir=require(_0x74af('0x1'));var jsonpatch=require(_0x74af('0x2'));var rp=require(_0x74af('0x3'));var moment=require(_0x74af('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x74af('0x5'));var util=require(_0x74af('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x74af('0x7'));var ejs=require(_0x74af('0x8'));var fs=require('fs');var fs_extra=require(_0x74af('0x9'));var _=require(_0x74af('0xa'));var squel=require(_0x74af('0xb'));var crypto=require(_0x74af('0xc'));var jsforce=require(_0x74af('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x74af('0x7'));var querystring=require(_0x74af('0xe'));var Papa=require(_0x74af('0xf'));var Redis=require(_0x74af('0x10'));var authService=require(_0x74af('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x74af('0x12'));var hardwareService=require(_0x74af('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x74af('0x14'));var config=require(_0x74af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74af('0x16'))['db'];config[_0x74af('0x17')]=_['defaults'](config[_0x74af('0x17')],{'host':_0x74af('0x18'),'port':0x18eb});var socket=require(_0x74af('0x19'))(new Redis(config['redis']));require(_0x74af('0x1a'))['register'](socket);function respondWithStatusCode(_0x2358dc,_0x443164){_0x443164=_0x443164||0xcc;return function(_0x5a1bf6){if(_0x5a1bf6){return _0x2358dc['sendStatus'](_0x443164);}return _0x2358dc[_0x74af('0x1b')](_0x443164)[_0x74af('0x1c')]();};}function respondWithResult(_0x48cad7,_0x4629a5){_0x4629a5=_0x4629a5||0xc8;return function(_0x56575a){if(_0x56575a){return _0x48cad7['status'](_0x4629a5)[_0x74af('0x1d')](_0x56575a);}};}function respondWithFilteredResult(_0x114a19,_0x1402d0){return function(_0x1d5da1){if(_0x1d5da1){var _0x4e63db=typeof _0x1402d0[_0x74af('0x1e')]===_0x74af('0x1f')&&typeof _0x1402d0[_0x74af('0x20')]===_0x74af('0x1f');var _0x17cfe6=_0x1d5da1['count'];var _0x116191=_0x4e63db?0x0:_0x1402d0['offset'];var _0xed00c5=_0x4e63db?_0x1d5da1[_0x74af('0x21')]:_0x1402d0['offset']+_0x1402d0['limit'];var _0x3e1e7e;if(_0xed00c5>=_0x17cfe6){_0xed00c5=_0x17cfe6;_0x3e1e7e=0xc8;}else{_0x3e1e7e=0xce;}_0x114a19['status'](_0x3e1e7e);return _0x114a19[_0x74af('0x22')]('Content-Range',_0x116191+'-'+_0xed00c5+'/'+_0x17cfe6)[_0x74af('0x1d')](_0x1d5da1);}return null;};}function patchUpdates(_0x194deb){return function(_0x6bd7a4){try{jsonpatch[_0x74af('0x23')](_0x6bd7a4,_0x194deb,!![]);}catch(_0x23aab0){return BPromise[_0x74af('0x24')](_0x23aab0);}return _0x6bd7a4[_0x74af('0x25')]();};}function saveUpdates(_0x5aab4b,_0x2455ff){return function(_0x4ca943){if(_0x4ca943){return _0x4ca943[_0x74af('0x26')](_0x5aab4b)[_0x74af('0x27')](function(_0x4af42a){return _0x4af42a;});}return null;};}function removeEntity(_0x3a43b2,_0x114d12){return function(_0x33f8e6){if(_0x33f8e6){return _0x33f8e6[_0x74af('0x28')]()[_0x74af('0x27')](function(){_0x3a43b2[_0x74af('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a1ca,_0x3ee7da){return function(_0x8985cd){if(!_0x8985cd){_0x17a1ca[_0x74af('0x29')](0x194);}return _0x8985cd;};}function handleError(_0x152848,_0x859c84){_0x859c84=_0x859c84||0x1f4;return function(_0x2938ee){logger[_0x74af('0x2a')](_0x2938ee['stack']);if(_0x2938ee[_0x74af('0x2b')]){delete _0x2938ee[_0x74af('0x2b')];}_0x152848[_0x74af('0x1b')](_0x859c84)[_0x74af('0x2c')](_0x2938ee);};}exports[_0x74af('0x2d')]=function(_0x242bee,_0x309c63){var _0x28b480={},_0x2303cf={},_0x2152f9={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x74af('0x27')](function(_0x4886c9){var _0x54b05e=[];for(var _0x704701=0x0;_0x7047010x1){_0x1cdff2['or'](_0x74af('0x69'),qs['getFullTextValue'](_0x26b083),null);}else{if(qs[_0x74af('0x6a')](_0x26b083)){_0x1cdff2['or'](_0x74af('0x6b'),_0x26b083+'%');_0x1cdff2['or'](_0x74af('0x6c'),_0x26b083+'%');_0x1cdff2['or'](_0x74af('0x6d'),_0x26b083+'%');_0x1cdff2['or']('c.fax\x20LIKE\x20?',_0x26b083+'%');}else if(qs[_0x74af('0x6e')](_0x26b083)){_0x1cdff2['or'](_0x74af('0x6f'),_0x26b083+'%');}else{_0x1cdff2['or']('c.firstName\x20LIKE\x20?','%'+_0x26b083+'%');_0x1cdff2['or'](_0x74af('0x70'),'%'+_0x26b083+'%');_0x1cdff2['or'](_0x74af('0x6f'),'%'+_0x26b083+'%');}}}}_0x29a60b['where'](_0x1cdff2);_0x29a60b['group'](_0x74af('0x71'));var _0x91d018={'type':db[_0x74af('0x72')]['QueryTypes'][_0x74af('0x73')],'raw':!![]};var _0x15b572=_0x29a60b['clone']()[_0x74af('0x42')](_0x74af('0x71'));if(_0x28b480[_0x74af('0x3d')]){_0x28b480[_0x74af('0x3d')]['forEach'](function(_0x4f18cc){_0x29a60b[_0x74af('0x3d')]('c.'+_0x4f18cc[0x0],_0x4f18cc[0x1]==='DESC'?![]:!![]);});}if(!_[_0x74af('0x60')](_0x2400a3)){_0x29a60b['having'](_0x410d4a);_0x15b572[_0x74af('0x3f')](_0x74af('0x74'),_0x2400a3);}BPromise[_0x74af('0x75')]()['then'](function(){if(!_0x5170bc)return;if(_0x242bee[_0x74af('0x76')][_0x74af('0x77')]!==_0x74af('0x78'))return;if(!_[_0x74af('0x79')](_0x5170bc[_0x74af('0x51')],['field',_0x74af('0x58')])){return _0x242bee[_0x74af('0x76')][_0x74af('0x7a')]({'attributes':['id'],'raw':!![]})[_0x74af('0x27')](function(_0x12db46){if(_[_0x74af('0x60')](_0x12db46)){_0x15b572['where']('c.ListId\x20IS\x20NULL');_0x29a60b[_0x74af('0x3f')]('c.ListId\x20IS\x20NULL');}else{_0x15b572[_0x74af('0x3f')](_0x74af('0x62'),_['map'](_0x12db46,'id'));_0x29a60b[_0x74af('0x3f')](_0x74af('0x62'),_[_0x74af('0x56')](_0x12db46,'id'));}});}})['then'](function(){if(_0x242bee[_0x74af('0x76')][_0x74af('0x77')]===_0x74af('0x78')&&!_0x5170bc&&!_0x242bee['query'][_0x74af('0x61')])return[];return db[_0x74af('0x7b')][_0x74af('0x37')](_0x15b572['toString'](),_0x91d018);})[_0x74af('0x27')](function(_0xf58763){_0x2152f9[_0x74af('0x21')]=_0xf58763[_0x74af('0x2f')];if(_0x2152f9['count']===0x0)return[];return db[_0x74af('0x7b')][_0x74af('0x37')](_0x185d37[_0x74af('0x7c')](),_0x91d018)[_0x74af('0x27')](function(_0x49671d){_0x2cf34e=_[_0x74af('0x7d')](_0x49671d,'id');_0x91d018=_[_0x74af('0x7e')](_0x91d018,{'model':db[_0x74af('0x7f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x242bee[_0x74af('0x37')][_0x74af('0x80')]){_0x28b480['attributes'][_0x74af('0x57')](function(_0x70f4f9){_0x29a60b[_0x74af('0x42')]('c.'+_0x70f4f9);});}else{_0x29a60b[_0x74af('0x42')]('c.id');_0x29a60b['field']('c.firstName');_0x29a60b[_0x74af('0x42')]('c.lastName');_0x29a60b[_0x74af('0x42')](_0x74af('0x81'));_0x29a60b['field'](_0x74af('0x82'));_0x29a60b[_0x74af('0x42')](_0x74af('0x83'));_0x29a60b[_0x74af('0x42')](_0x74af('0x84'));_0x29a60b['field'](_0x74af('0x85'));_0x29a60b[_0x74af('0x42')]('c.createdAt');_0x29a60b[_0x74af('0x42')](_0x74af('0x86'));_0x29a60b[_0x74af('0x42')](_0x74af('0x87'));_0x29a60b[_0x74af('0x42')](_0x74af('0x88'),_0x74af('0x89'));}if(_0x28b480[_0x74af('0x20')])_0x29a60b[_0x74af('0x20')](_0x28b480[_0x74af('0x20')]);if(_0x28b480[_0x74af('0x1e')])_0x29a60b['offset'](_0x28b480[_0x74af('0x1e')]);return db[_0x74af('0x7b')]['query'](_0x29a60b[_0x74af('0x7c')](),_0x91d018);});})['then'](function(_0x52e217){_0x52e217[_0x74af('0x57')](function(_0x2153a9){if(_0x2153a9[_0x74af('0x89')]){_0x2153a9[_0x74af('0x8a')]=[];_0x2153a9['TagIds'][_0x74af('0x55')](',')[_0x74af('0x57')](function(_0x77c1a4){_0x2153a9[_0x74af('0x8a')]['push'](_0x2cf34e[_0x77c1a4]);});}delete _0x2153a9[_0x74af('0x89')];});_0x2152f9[_0x74af('0x8b')]=_0x52e217;return _0x2152f9;})['then'](respondWithFilteredResult(_0x309c63,_0x28b480));})[_0x74af('0x8c')](handleError(_0x309c63,null));};exports[_0x74af('0x28')]=function(_0x2efd48,_0x46bfec){return db[_0x74af('0x7f')]['find']({'where':{'id':_0x2efd48['params']['id']}})['then'](handleEntityNotFound(_0x46bfec,null))[_0x74af('0x27')](removeEntity(_0x46bfec,null))['catch'](handleError(_0x46bfec,null));};exports[_0x74af('0x8d')]=function(_0x1c4ac6,_0x3bc98e){return db[_0x74af('0x7f')][_0x74af('0x8d')]()[_0x74af('0x27')](function(_0x3dd51c){delete _0x3dd51c['tags'];for(var _0x313f9f=0x0;_0x313f9f=_0x80a2eb){_0x3c85dd=_0x80a2eb;_0x2416fe=0xc8;}else{_0x2416fe=0xce;}_0x41b866['status'](_0x2416fe);return _0x41b866[_0xfe14('0x23')]('Content-Range',_0x40fb59+'-'+_0x3c85dd+'/'+_0x80a2eb)[_0xfe14('0x24')](_0x4ff7e4);}return null;};}function patchUpdates(_0x428ba3){return function(_0x3eba06){try{jsonpatch[_0xfe14('0x25')](_0x3eba06,_0x428ba3,!![]);}catch(_0xca4915){return BPromise[_0xfe14('0x26')](_0xca4915);}return _0x3eba06[_0xfe14('0x27')]();};}function saveUpdates(_0x310367,_0x25f486){return function(_0x45a178){if(_0x45a178){return _0x45a178[_0xfe14('0x28')](_0x310367)[_0xfe14('0x29')](function(_0x46aae7){return _0x46aae7;});}return null;};}function removeEntity(_0x271796,_0x545d86){return function(_0x4c6780){if(_0x4c6780){return _0x4c6780['destroy']()[_0xfe14('0x29')](function(){_0x271796[_0xfe14('0x1e')](0xcc)[_0xfe14('0x1f')]();});}};}function handleEntityNotFound(_0x468258,_0x591018){return function(_0x32a84e){if(!_0x32a84e){_0x468258[_0xfe14('0x1d')](0x194);}return _0x32a84e;};}function handleError(_0x56bc58,_0x382c4b){_0x382c4b=_0x382c4b||0x1f4;return function(_0x39aab8){logger['error'](_0x39aab8[_0xfe14('0x2a')]);if(_0x39aab8[_0xfe14('0x2b')]){delete _0x39aab8[_0xfe14('0x2b')];}_0x56bc58[_0xfe14('0x1e')](_0x382c4b)[_0xfe14('0x2c')](_0x39aab8);};}exports['index']=function(_0x2564db,_0x310a3b){var _0xb787c={},_0x1c5942={},_0x338e50={'count':0x0,'rows':[]};return db['CmContact'][_0xfe14('0x2d')]()[_0xfe14('0x29')](function(_0x5765fb){var _0x28a1ec=[];for(var _0x22f7fb=0x0;_0x22f7fb0x1){_0x18a06a['or'](_0xfe14('0x68'),qs[_0xfe14('0x69')](_0x3e878d),null);}else{if(qs['isNumeric'](_0x3e878d)){_0x18a06a['or'](_0xfe14('0x6a'),_0x3e878d+'%');_0x18a06a['or'](_0xfe14('0x6b'),_0x3e878d+'%');_0x18a06a['or'](_0xfe14('0x6c'),_0x3e878d+'%');_0x18a06a['or'](_0xfe14('0x6d'),_0x3e878d+'%');}else if(qs[_0xfe14('0x6e')](_0x3e878d)){_0x18a06a['or'](_0xfe14('0x6f'),_0x3e878d+'%');}else{_0x18a06a['or'](_0xfe14('0x70'),'%'+_0x3e878d+'%');_0x18a06a['or'](_0xfe14('0x71'),'%'+_0x3e878d+'%');_0x18a06a['or'](_0xfe14('0x6f'),'%'+_0x3e878d+'%');}}}}_0x4b7e50[_0xfe14('0x40')](_0x18a06a);_0x4b7e50[_0xfe14('0x72')](_0xfe14('0x73'));var _0x5010ec={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x383f46=_0x4b7e50[_0xfe14('0x74')]()['field'](_0xfe14('0x73'));if(_0xb787c['order']){_0xb787c[_0xfe14('0x75')][_0xfe14('0x63')](function(_0x46e1e7){_0x4b7e50[_0xfe14('0x75')]('c.'+_0x46e1e7[0x0],_0x46e1e7[0x1]===_0xfe14('0x76')?![]:!![]);});}if(!_[_0xfe14('0x62')](_0x857fed)){_0x4b7e50[_0xfe14('0x77')](_0x2043f3);_0x383f46[_0xfe14('0x40')](_0xfe14('0x78'),_0x857fed);}BPromise['resolve']()[_0xfe14('0x29')](function(){if(!_0x5c3c61)return;if(_0x2564db[_0xfe14('0x79')][_0xfe14('0x7a')]!=='agent')return;if(!_[_0xfe14('0x7b')](_0x5c3c61[_0xfe14('0x50')],[_0xfe14('0x43'),_0xfe14('0x7c')])){return _0x2564db[_0xfe14('0x79')][_0xfe14('0x7d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5100cd){if(_[_0xfe14('0x62')](_0x5100cd)){_0x383f46[_0xfe14('0x40')](_0xfe14('0x7e'));_0x4b7e50[_0xfe14('0x40')](_0xfe14('0x7e'));}else{_0x383f46['where'](_0xfe14('0x7f'),_[_0xfe14('0x54')](_0x5100cd,'id'));_0x4b7e50[_0xfe14('0x40')](_0xfe14('0x7f'),_[_0xfe14('0x54')](_0x5100cd,'id'));}});}})[_0xfe14('0x29')](function(){if(_0x2564db[_0xfe14('0x79')][_0xfe14('0x7a')]===_0xfe14('0x80')&&!_0x5c3c61&&!_0x2564db['query'][_0xfe14('0x81')])return[];return db[_0xfe14('0x82')]['query'](_0x383f46['toString'](),_0x5010ec);})['then'](function(_0x355bc0){_0x338e50['count']=_0x355bc0[_0xfe14('0x2e')];if(_0x338e50[_0xfe14('0x21')]===0x0)return[];return db[_0xfe14('0x82')][_0xfe14('0x39')](_0x21f44f[_0xfe14('0x83')](),_0x5010ec)[_0xfe14('0x29')](function(_0x5864b5){_0x13d78a=_[_0xfe14('0x84')](_0x5864b5,'id');_0x5010ec=_[_0xfe14('0x85')](_0x5010ec,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2564db[_0xfe14('0x39')][_0xfe14('0x86')]){_0xb787c[_0xfe14('0x3c')][_0xfe14('0x63')](function(_0x460287){_0x4b7e50[_0xfe14('0x43')]('c.'+_0x460287);});}else{_0x4b7e50[_0xfe14('0x43')](_0xfe14('0x73'));_0x4b7e50[_0xfe14('0x43')](_0xfe14('0x87'));_0x4b7e50[_0xfe14('0x43')]('c.lastName');_0x4b7e50[_0xfe14('0x43')](_0xfe14('0x88'));_0x4b7e50[_0xfe14('0x43')]('c.mobile');_0x4b7e50[_0xfe14('0x43')](_0xfe14('0x89'));_0x4b7e50['field'](_0xfe14('0x8a'));_0x4b7e50[_0xfe14('0x43')]('c.ListId');_0x4b7e50[_0xfe14('0x43')](_0xfe14('0x8b'));_0x4b7e50[_0xfe14('0x43')]('c.deletedAt');_0x4b7e50['field']('c.CompanyId');_0x4b7e50[_0xfe14('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xb787c[_0xfe14('0x3e')])_0x4b7e50['limit'](_0xb787c[_0xfe14('0x3e')]);if(_0xb787c[_0xfe14('0x22')])_0x4b7e50['offset'](_0xb787c[_0xfe14('0x22')]);return db[_0xfe14('0x82')][_0xfe14('0x39')](_0x4b7e50[_0xfe14('0x83')](),_0x5010ec);});})[_0xfe14('0x29')](function(_0x1a9065){_0x1a9065[_0xfe14('0x63')](function(_0x6d8ef1){if(_0x6d8ef1[_0xfe14('0x8c')]){_0x6d8ef1['Tags']=[];_0x6d8ef1[_0xfe14('0x8c')][_0xfe14('0x53')](',')['forEach'](function(_0x3ff25c){_0x6d8ef1[_0xfe14('0x8d')][_0xfe14('0x31')](_0x13d78a[_0x3ff25c]);});}delete _0x6d8ef1[_0xfe14('0x8c')];});_0x338e50[_0xfe14('0x8e')]=_0x1a9065;return _0x338e50;})[_0xfe14('0x29')](respondWithFilteredResult(_0x310a3b,_0xb787c));})[_0xfe14('0x8f')](handleError(_0x310a3b,null));};exports[_0xfe14('0x90')]=function(_0x206138,_0x467f86){return db[_0xfe14('0x91')]['find']({'where':{'id':_0x206138[_0xfe14('0x92')]['id']}})[_0xfe14('0x29')](handleEntityNotFound(_0x467f86,null))[_0xfe14('0x29')](removeEntity(_0x467f86,null))['catch'](handleError(_0x467f86,null));};exports[_0xfe14('0x2d')]=function(_0x99e728,_0x2f33b0){return db[_0xfe14('0x91')][_0xfe14('0x2d')]()[_0xfe14('0x29')](function(_0x319f59){delete _0x319f59[_0xfe14('0x93')];for(var _0x58d462=0x0;_0x58d462{}\s\\|]/g,'-');_0x4a0f4b(null,util[_0xb756('0x1f')](_0xb756('0x20'),path[_0xb756('0x21')](_0x683694[_0xb756('0x1d')],path[_0xb756('0x22')](_0x683694['originalname'])),Date[_0xb756('0x23')](),path[_0xb756('0x22')](_0x683694['originalname'])));}})});router[_0xb756('0x15')](_0xb756('0x24'),upload[_0xb756('0x25')](_0xb756('0x26')),controller[_0xb756('0x27')]);var upload=multer({'storage':multer[_0xb756('0x1b')]({'destination':function(_0x140327,_0x35d19c,_0x50679e){_0x50679e(null,path[_0xb756('0x28')](config[_0xb756('0x1c')],_0xb756('0x29')));},'filename':function(_0x26d6da,_0x3bee26,_0x34d447){_0x3bee26[_0xb756('0x1d')]=_0x3bee26[_0xb756('0x1d')][_0xb756('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x34d447(null,util[_0xb756('0x1f')](_0xb756('0x20'),path[_0xb756('0x21')](_0x3bee26['originalname'],path['extname'](_0x3bee26[_0xb756('0x1d')])),Date['now'](),path[_0xb756('0x22')](_0x3bee26[_0xb756('0x1d')])));}})});router['post'](_0xb756('0x2a'),upload[_0xb756('0x25')](_0xb756('0x26')),controller[_0xb756('0x2b')]);router[_0xb756('0x15')]('/upload/:id',auth[_0xb756('0x9')](),controller[_0xb756('0x2c')]);router[_0xb756('0x2d')](_0xb756('0xb'),auth[_0xb756('0x9')](),controller[_0xb756('0x2e')]);router['delete'](_0xb756('0xb'),auth['isAuthenticated'](),controller[_0xb756('0x2f')]);module[_0xb756('0x30')]=router; \ No newline at end of file +var _0xfbf7=['../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','post','/merge','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','now','/csv','file','uploadCsv','format','/upload','single','/upload/:id','import','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x28b9b3,_0x22bc26){var _0x3a75c9=function(_0x22be44){while(--_0x22be44){_0x28b9b3['push'](_0x28b9b3['shift']());}};_0x3a75c9(++_0x22bc26);}(_0xfbf7,0x8d));var _0x7fbf=function(_0x449aa7,_0x3af701){_0x449aa7=_0x449aa7-0x0;var _0x27243e=_0xfbf7[_0x449aa7];return _0x27243e;};'use strict';var multer=require(_0x7fbf('0x0'));var util=require(_0x7fbf('0x1'));var path=require(_0x7fbf('0x2'));var timeout=require(_0x7fbf('0x3'));var express=require('express');var router=express[_0x7fbf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7fbf('0x5'));var interaction=require(_0x7fbf('0x6'));var config=require(_0x7fbf('0x7'));var controller=require(_0x7fbf('0x8'));router[_0x7fbf('0x9')]('/',auth[_0x7fbf('0xa')](),controller[_0x7fbf('0xb')]);router[_0x7fbf('0x9')](_0x7fbf('0xc'),auth[_0x7fbf('0xa')](),controller[_0x7fbf('0xd')]);router[_0x7fbf('0x9')](_0x7fbf('0xe'),auth[_0x7fbf('0xa')](),controller[_0x7fbf('0xf')]);router['get'](_0x7fbf('0x10'),auth['isAuthenticated'](),controller[_0x7fbf('0x11')]);router[_0x7fbf('0x9')](_0x7fbf('0x12'),auth[_0x7fbf('0xa')](),controller['getHoppers']);router[_0x7fbf('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x7fbf('0x13')]);router['get'](_0x7fbf('0x14'),auth[_0x7fbf('0xa')](),controller['getHopperFinals']);router[_0x7fbf('0x9')](_0x7fbf('0x15'),auth[_0x7fbf('0xa')](),controller[_0x7fbf('0x16')]);router[_0x7fbf('0x9')](_0x7fbf('0x17'),auth[_0x7fbf('0xa')](),controller['getJourney']);router[_0x7fbf('0x18')](_0x7fbf('0x19'),auth['isAuthenticated'](),controller['merge']);router[_0x7fbf('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7fbf('0x18')]('/create_many',auth[_0x7fbf('0xa')](),controller[_0x7fbf('0x1a')]);router[_0x7fbf('0x18')](_0x7fbf('0x10'),auth['isAuthenticated'](),controller[_0x7fbf('0x1b')]);var upload=multer({'storage':multer[_0x7fbf('0x1c')]({'destination':function(_0x363d99,_0x5965db,_0x1f2fe9){_0x1f2fe9(null,path[_0x7fbf('0x1d')](config[_0x7fbf('0x1e')],_0x7fbf('0x1f')));},'filename':function(_0x12c39d,_0x2f73f1,_0x5f898c){_0x2f73f1[_0x7fbf('0x20')]=_0x2f73f1[_0x7fbf('0x20')][_0x7fbf('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5f898c(null,util['format'](_0x7fbf('0x22'),path[_0x7fbf('0x23')](_0x2f73f1[_0x7fbf('0x20')],path[_0x7fbf('0x24')](_0x2f73f1['originalname'])),Date[_0x7fbf('0x25')](),path[_0x7fbf('0x24')](_0x2f73f1['originalname'])));}})});router[_0x7fbf('0x18')](_0x7fbf('0x26'),upload['single'](_0x7fbf('0x27')),controller[_0x7fbf('0x28')]);var upload=multer({'storage':multer[_0x7fbf('0x1c')]({'destination':function(_0x1f1b2c,_0x384a22,_0x4dca62){_0x4dca62(null,path[_0x7fbf('0x1d')](config[_0x7fbf('0x1e')],'server/files/tmp'));},'filename':function(_0x3717af,_0x188473,_0x473cc5){_0x188473[_0x7fbf('0x20')]=_0x188473[_0x7fbf('0x20')][_0x7fbf('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x473cc5(null,util[_0x7fbf('0x29')]('%s-%s%s',path['basename'](_0x188473[_0x7fbf('0x20')],path['extname'](_0x188473[_0x7fbf('0x20')])),Date[_0x7fbf('0x25')](),path['extname'](_0x188473[_0x7fbf('0x20')])));}})});router[_0x7fbf('0x18')](_0x7fbf('0x2a'),upload[_0x7fbf('0x2b')](_0x7fbf('0x27')),controller['upload']);router[_0x7fbf('0x18')](_0x7fbf('0x2c'),auth['isAuthenticated'](),controller[_0x7fbf('0x2d')]);router['put'](_0x7fbf('0xe'),auth[_0x7fbf('0xa')](),controller['update']);router[_0x7fbf('0x2e')](_0x7fbf('0xe'),auth[_0x7fbf('0xa')](),controller[_0x7fbf('0x2f')]);module[_0x7fbf('0x30')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index e70ac2c..28924ba 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 _0x5fee=['STRING','setDataValue','getDataValue','name','long','type','select','parse','values','isArray','BOOLEAN','voice','sequelize','lodash','VIRTUAL','alias'];(function(_0x16a059,_0x326057){var _0xb8ba8d=function(_0x5f1320){while(--_0x5f1320){_0x16a059['push'](_0x16a059['shift']());}};_0xb8ba8d(++_0x326057);}(_0x5fee,0xfc));var _0xe5fe=function(_0x59fee2,_0x35c51b){_0x59fee2=_0x59fee2-0x0;var _0x12ddac=_0x5fee[_0x59fee2];return _0x12ddac;};'use strict';var Sequelize=require(_0xe5fe('0x0'));var _=require(_0xe5fe('0x1'));module['exports']={'name':{'type':Sequelize[_0xe5fe('0x2')],'get':function(_0x51db67){return this['getDataValue'](_0xe5fe('0x3'));}},'alias':{'type':Sequelize[_0xe5fe('0x4')],'allowNull':![],'set':function(_0x55552f){this[_0xe5fe('0x5')](_0xe5fe('0x3'),_0x55552f?_0x55552f:this[_0xe5fe('0x6')](_0xe5fe('0x7')));}},'type':{'type':Sequelize[_0xe5fe('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xe5fe('0x8')),'get':function(){if(this[_0xe5fe('0x6')](_0xe5fe('0x9'))===_0xe5fe('0xa')){return JSON[_0xe5fe('0xb')](this[_0xe5fe('0x6')](_0xe5fe('0xc')));}else{return this[_0xe5fe('0x6')](_0xe5fe('0xc'));}},'set':function(_0x141ca6){if(Array[_0xe5fe('0xd')](_0x141ca6)){this[_0xe5fe('0x5')](_0xe5fe('0xc'),JSON['stringify'](_0x141ca6));}else{this['setDataValue'](_0xe5fe('0xc'),_0x141ca6);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe5fe('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xe5fe('0xf'))}}; \ No newline at end of file +var _0x8909=['alias','STRING','setDataValue','getDataValue','name','TEXT','long','type','parse','values','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL'];(function(_0x119163,_0x34b2ea){var _0x16bb37=function(_0x2f40c6){while(--_0x2f40c6){_0x119163['push'](_0x119163['shift']());}};_0x16bb37(++_0x34b2ea);}(_0x8909,0x1ac));var _0x9890=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x8909[_0x1d6a82];return _0x5834ac;};'use strict';var Sequelize=require(_0x9890('0x0'));var _=require(_0x9890('0x1'));module[_0x9890('0x2')]={'name':{'type':Sequelize[_0x9890('0x3')],'get':function(_0x55b69b){return this['getDataValue'](_0x9890('0x4'));}},'alias':{'type':Sequelize[_0x9890('0x5')],'allowNull':![],'set':function(_0x3d9cdc){this[_0x9890('0x6')](_0x9890('0x4'),_0x3d9cdc?_0x3d9cdc:this[_0x9890('0x7')](_0x9890('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x9890('0x9')](_0x9890('0xa')),'get':function(){if(this[_0x9890('0x7')](_0x9890('0xb'))==='select'){return JSON[_0x9890('0xc')](this['getDataValue'](_0x9890('0xd')));}else{return this['getDataValue'](_0x9890('0xd'));}},'set':function(_0x5ccb49){if(Array[_0x9890('0xe')](_0x5ccb49)){this[_0x9890('0x6')](_0x9890('0xd'),JSON[_0x9890('0xf')](_0x5ccb49));}else{this[_0x9890('0x6')](_0x9890('0xd'),_0x5ccb49);}}},'required':{'type':Sequelize[_0x9890('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x9890('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x9890('0x11')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index a9e0ea7..06f8252 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 _0x83ca=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','find','update','body','params','create','sequelize','transaction','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb'];(function(_0x158cd2,_0x35de32){var _0x4630f0=function(_0x1ce40c){while(--_0x1ce40c){_0x158cd2['push'](_0x158cd2['shift']());}};_0x4630f0(++_0x35de32);}(_0x83ca,0xe9));var _0xa83c=function(_0x13ba38,_0x4d768b){_0x13ba38=_0x13ba38-0x0;var _0x2d4571=_0x83ca[_0x13ba38];return _0x2d4571;};'use strict';var emlformat=require(_0xa83c('0x0'));var rimraf=require(_0xa83c('0x1'));var zipdir=require(_0xa83c('0x2'));var jsonpatch=require(_0xa83c('0x3'));var rp=require('request-promise');var moment=require(_0xa83c('0x4'));var BPromise=require(_0xa83c('0x5'));var Mustache=require('mustache');var util=require(_0xa83c('0x6'));var path=require(_0xa83c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa83c('0x8'));var fs=require('fs');var fs_extra=require(_0xa83c('0x9'));var _=require('lodash');var squel=require(_0xa83c('0xa'));var crypto=require(_0xa83c('0xb'));var jsforce=require(_0xa83c('0xc'));var deskjs=require(_0xa83c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa83c('0xe'));var Papa=require(_0xa83c('0xf'));var Redis=require('ioredis');var authService=require(_0xa83c('0x10'));var qs=require(_0xa83c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa83c('0x12'));var logger=require('../../config/logger')(_0xa83c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa83c('0x14'));var db=require(_0xa83c('0x15'))['db'];function respondWithStatusCode(_0x4292cc,_0x27ce5c){_0x27ce5c=_0x27ce5c||0xcc;return function(_0x422b7a){if(_0x422b7a){return _0x4292cc[_0xa83c('0x16')](_0x27ce5c);}return _0x4292cc[_0xa83c('0x17')](_0x27ce5c)[_0xa83c('0x18')]();};}function respondWithResult(_0x1d3ef3,_0x27d7f5){_0x27d7f5=_0x27d7f5||0xc8;return function(_0x2167d2){if(_0x2167d2){return _0x1d3ef3[_0xa83c('0x17')](_0x27d7f5)[_0xa83c('0x19')](_0x2167d2);}};}function respondWithFilteredResult(_0x50611d,_0xd15581){return function(_0x444fdd){if(_0x444fdd){var _0x321b0b=typeof _0xd15581[_0xa83c('0x1a')]===_0xa83c('0x1b')&&typeof _0xd15581[_0xa83c('0x1c')]===_0xa83c('0x1b');var _0x4758f6=_0x444fdd[_0xa83c('0x1d')];var _0x569660=_0x321b0b?0x0:_0xd15581[_0xa83c('0x1a')];var _0x4fbbb0=_0x321b0b?_0x444fdd[_0xa83c('0x1d')]:_0xd15581[_0xa83c('0x1a')]+_0xd15581['limit'];var _0x16f28f;if(_0x4fbbb0>=_0x4758f6){_0x4fbbb0=_0x4758f6;_0x16f28f=0xc8;}else{_0x16f28f=0xce;}_0x50611d['status'](_0x16f28f);return _0x50611d[_0xa83c('0x1e')](_0xa83c('0x1f'),_0x569660+'-'+_0x4fbbb0+'/'+_0x4758f6)[_0xa83c('0x19')](_0x444fdd);}return null;};}function patchUpdates(_0x3f429d){return function(_0x57efbf){try{jsonpatch['apply'](_0x57efbf,_0x3f429d,!![]);}catch(_0x34d157){return BPromise[_0xa83c('0x20')](_0x34d157);}return _0x57efbf['save']();};}function saveUpdates(_0x12cf0b,_0x5146c5){return function(_0xfa62b9){if(_0xfa62b9){return _0xfa62b9['update'](_0x12cf0b)[_0xa83c('0x21')](function(_0x1aaeab){return _0x1aaeab;});}return null;};}function removeEntity(_0x49d9ba,_0x215aa8){return function(_0x1c93fb){if(_0x1c93fb){return _0x1c93fb[_0xa83c('0x22')]()[_0xa83c('0x21')](function(){_0x49d9ba['status'](0xcc)[_0xa83c('0x18')]();});}};}function handleEntityNotFound(_0x5f1349,_0x11d8cf){return function(_0x1dc54){if(!_0x1dc54){_0x5f1349[_0xa83c('0x16')](0x194);}return _0x1dc54;};}function handleError(_0x1cc9fe,_0x3c3024){_0x3c3024=_0x3c3024||0x1f4;return function(_0x2b8f62){logger[_0xa83c('0x23')](_0x2b8f62[_0xa83c('0x24')]);if(_0x2b8f62[_0xa83c('0x25')]){delete _0x2b8f62[_0xa83c('0x25')];}_0x1cc9fe[_0xa83c('0x17')](_0x3c3024)['send'](_0x2b8f62);};}exports[_0xa83c('0x26')]=function(_0x4bd765,_0x1962e2){var _0x5e3d78={},_0x941fbd={},_0x53bc58={'count':0x0,'rows':[]};var _0x2d9d59=_[_0xa83c('0x27')](db[_0xa83c('0x28')][_0xa83c('0x29')],function(_0x45bd17){return{'name':_0x45bd17[_0xa83c('0x2a')],'type':_0x45bd17[_0xa83c('0x2b')][_0xa83c('0x2c')]};});_0x941fbd[_0xa83c('0x2d')]=_[_0xa83c('0x2e')](_[_0xa83c('0x27')](_0x2d9d59,_0xa83c('0x25')),[_0xa83c('0x25')]);_0x941fbd[_0xa83c('0x2f')]=_['keys'](_0x4bd765[_0xa83c('0x2f')]);_0x941fbd[_0xa83c('0x30')]=_[_0xa83c('0x31')](_0x941fbd[_0xa83c('0x2d')],_0x941fbd['query']);_0x5e3d78[_0xa83c('0x32')]=_[_0xa83c('0x31')](_0x941fbd[_0xa83c('0x2d')],qs[_0xa83c('0x33')](_0x4bd765['query'][_0xa83c('0x33')]));_0x5e3d78['attributes']=_0x5e3d78[_0xa83c('0x32')]['length']?_0x5e3d78['attributes']:_0x941fbd[_0xa83c('0x2d')];if(!_0x4bd765[_0xa83c('0x2f')]['hasOwnProperty'](_0xa83c('0x34'))){_0x5e3d78[_0xa83c('0x1c')]=qs[_0xa83c('0x1c')](_0x4bd765[_0xa83c('0x2f')][_0xa83c('0x1c')]);_0x5e3d78[_0xa83c('0x1a')]=qs[_0xa83c('0x1a')](_0x4bd765[_0xa83c('0x2f')]['offset']);}_0x5e3d78['order']=qs[_0xa83c('0x35')](_0x4bd765[_0xa83c('0x2f')][_0xa83c('0x35')]);_0x5e3d78[_0xa83c('0x36')]=qs['filters'](_[_0xa83c('0x37')](_0x4bd765['query'],_0x941fbd[_0xa83c('0x30')]),_0x2d9d59);if(_0x4bd765['query'][_0xa83c('0x38')]){_0x5e3d78[_0xa83c('0x36')]=_['merge'](_0x5e3d78[_0xa83c('0x36')],{'$or':_['map'](_0x2d9d59,function(_0x42ec74){if(_0x42ec74['type']!==_0xa83c('0x39')){var _0x1bf700={};_0x1bf700[_0x42ec74[_0xa83c('0x25')]]={'$like':'%'+_0x4bd765['query']['filter']+'%'};return _0x1bf700;}})});}_0x5e3d78=_[_0xa83c('0x3a')]({},_0x5e3d78,_0x4bd765[_0xa83c('0x3b')]);var _0x67395d={'where':_0x5e3d78['where']};return db[_0xa83c('0x28')][_0xa83c('0x1d')](_0x67395d)[_0xa83c('0x21')](function(_0x142def){_0x53bc58['count']=_0x142def;if(_0x4bd765[_0xa83c('0x2f')][_0xa83c('0x3c')]){_0x5e3d78[_0xa83c('0x3d')]=[{'all':!![]}];}return db[_0xa83c('0x28')][_0xa83c('0x3e')](_0x5e3d78);})['then'](function(_0x35082a){_0x53bc58[_0xa83c('0x3f')]=_0x35082a;return _0x53bc58;})[_0xa83c('0x21')](respondWithFilteredResult(_0x1962e2,_0x5e3d78))[_0xa83c('0x40')](handleError(_0x1962e2,null));};exports[_0xa83c('0x41')]=function(_0x343e48,_0x2f901c){var _0x171937={'raw':!![],'where':{'id':_0x343e48['params']['id']}},_0x2b8c74={};_0x2b8c74['model']=_[_0xa83c('0x42')](db[_0xa83c('0x28')]['rawAttributes']);_0x2b8c74[_0xa83c('0x2f')]=_[_0xa83c('0x42')](_0x343e48[_0xa83c('0x2f')]);_0x2b8c74[_0xa83c('0x30')]=_[_0xa83c('0x31')](_0x2b8c74[_0xa83c('0x2d')],_0x2b8c74[_0xa83c('0x2f')]);_0x171937['attributes']=_[_0xa83c('0x31')](_0x2b8c74[_0xa83c('0x2d')],qs[_0xa83c('0x33')](_0x343e48[_0xa83c('0x2f')]['fields']));_0x171937[_0xa83c('0x32')]=_0x171937['attributes'][_0xa83c('0x43')]?_0x171937[_0xa83c('0x32')]:_0x2b8c74[_0xa83c('0x2d')];if(_0x343e48[_0xa83c('0x2f')]['includeAll']){_0x171937['include']=[{'all':!![]}];}_0x171937=_[_0xa83c('0x3a')]({},_0x171937,_0x343e48['options']);return db[_0xa83c('0x28')][_0xa83c('0x44')](_0x171937)['then'](handleEntityNotFound(_0x2f901c,null))[_0xa83c('0x21')](respondWithResult(_0x2f901c,null))[_0xa83c('0x40')](handleError(_0x2f901c,null));};exports[_0xa83c('0x45')]=function(_0x529790,_0x4f460f){if(_0x529790[_0xa83c('0x46')]['id']){delete _0x529790[_0xa83c('0x46')]['id'];}return db[_0xa83c('0x28')][_0xa83c('0x44')]({'where':{'id':_0x529790[_0xa83c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f460f,null))[_0xa83c('0x21')](saveUpdates(_0x529790[_0xa83c('0x46')],null))[_0xa83c('0x21')](respondWithResult(_0x4f460f,null))['catch'](handleError(_0x4f460f,null));};exports[_0xa83c('0x22')]=function(_0x23786c,_0x25e1ec){return db[_0xa83c('0x28')][_0xa83c('0x44')]({'where':{'id':_0x23786c[_0xa83c('0x47')]['id']}})[_0xa83c('0x21')](handleEntityNotFound(_0x25e1ec,null))[_0xa83c('0x21')](removeEntity(_0x25e1ec,null))[_0xa83c('0x40')](handleError(_0x25e1ec,null));};exports[_0xa83c('0x48')]=function(_0x1d745e,_0x1f9c0b){var _0x233f82;return db[_0xa83c('0x49')][_0xa83c('0x4a')](function(_0x2d4591){return db['CmCustomField'][_0xa83c('0x48')](_0x1d745e[_0xa83c('0x46')],{'transaction':_0x2d4591})['then'](function(_0x225458){_0x233f82=_0x225458;var _0x220a3c={'type':db[_0xa83c('0x4b')][_0xa83c('0x4c')],'transaction':_0x2d4591};switch(_0x1d745e[_0xa83c('0x46')][_0xa83c('0x2b')]){case _0xa83c('0x4d'):_0x220a3c['type']=db[_0xa83c('0x4b')]['TEXT'];break;case'number':_0x220a3c[_0xa83c('0x2b')]=db[_0xa83c('0x4b')]['INTEGER'];break;case _0xa83c('0x4e'):_0x220a3c[_0xa83c('0x2b')]=db[_0xa83c('0x4b')][_0xa83c('0x4f')];_0x220a3c[_0xa83c('0x50')]=![];break;default:}return db[_0xa83c('0x49')][_0xa83c('0x51')][_0xa83c('0x52')](_0xa83c('0x53'),util['format'](_0xa83c('0x54'),_0x233f82['id']),_0x220a3c);})[_0xa83c('0x21')](function(){return _0x233f82;});})[_0xa83c('0x21')](respondWithResult(_0x1f9c0b,0xc9))[_0xa83c('0x40')](handleError(_0x1f9c0b,null));}; \ No newline at end of file +var _0x2624=['name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','update','body','find','create','sequelize','transaction','TEXT','text','number','Sequelize','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack'];(function(_0x469665,_0x394876){var _0x291ab5=function(_0x55c1c7){while(--_0x55c1c7){_0x469665['push'](_0x469665['shift']());}};_0x291ab5(++_0x394876);}(_0x2624,0x191));var _0x4262=function(_0x2a6c6d,_0x50b9d9){_0x2a6c6d=_0x2a6c6d-0x0;var _0x10a9a9=_0x2624[_0x2a6c6d];return _0x10a9a9;};'use strict';var emlformat=require(_0x4262('0x0'));var rimraf=require(_0x4262('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4262('0x2'));var rp=require(_0x4262('0x3'));var moment=require('moment');var BPromise=require(_0x4262('0x4'));var Mustache=require(_0x4262('0x5'));var util=require(_0x4262('0x6'));var path=require(_0x4262('0x7'));var sox=require('sox');var csv=require(_0x4262('0x8'));var ejs=require(_0x4262('0x9'));var fs=require('fs');var fs_extra=require(_0x4262('0xa'));var _=require(_0x4262('0xb'));var squel=require('squel');var crypto=require(_0x4262('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4262('0xd'));var toCsv=require(_0x4262('0x8'));var querystring=require(_0x4262('0xe'));var Papa=require('papaparse');var Redis=require(_0x4262('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4262('0x10'));var hardwareService=require(_0x4262('0x11'));var logger=require(_0x4262('0x12'))(_0x4262('0x13'));var utils=require(_0x4262('0x14'));var config=require(_0x4262('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cb67e,_0xce5912){_0xce5912=_0xce5912||0xcc;return function(_0xb896e1){if(_0xb896e1){return _0x1cb67e[_0x4262('0x16')](_0xce5912);}return _0x1cb67e[_0x4262('0x17')](_0xce5912)[_0x4262('0x18')]();};}function respondWithResult(_0x252ec9,_0x36c1f3){_0x36c1f3=_0x36c1f3||0xc8;return function(_0x440e5f){if(_0x440e5f){return _0x252ec9['status'](_0x36c1f3)[_0x4262('0x19')](_0x440e5f);}};}function respondWithFilteredResult(_0x9b16db,_0x1d8228){return function(_0x56f691){if(_0x56f691){var _0x3d9644=typeof _0x1d8228['offset']===_0x4262('0x1a')&&typeof _0x1d8228[_0x4262('0x1b')]===_0x4262('0x1a');var _0x189d87=_0x56f691['count'];var _0x2644d5=_0x3d9644?0x0:_0x1d8228['offset'];var _0x1a0729=_0x3d9644?_0x56f691[_0x4262('0x1c')]:_0x1d8228[_0x4262('0x1d')]+_0x1d8228[_0x4262('0x1b')];var _0x490d4c;if(_0x1a0729>=_0x189d87){_0x1a0729=_0x189d87;_0x490d4c=0xc8;}else{_0x490d4c=0xce;}_0x9b16db['status'](_0x490d4c);return _0x9b16db[_0x4262('0x1e')](_0x4262('0x1f'),_0x2644d5+'-'+_0x1a0729+'/'+_0x189d87)['json'](_0x56f691);}return null;};}function patchUpdates(_0x59c95b){return function(_0x40c034){try{jsonpatch[_0x4262('0x20')](_0x40c034,_0x59c95b,!![]);}catch(_0x16435e){return BPromise[_0x4262('0x21')](_0x16435e);}return _0x40c034[_0x4262('0x22')]();};}function saveUpdates(_0x230b15,_0x44aadc){return function(_0x3d0cbf){if(_0x3d0cbf){return _0x3d0cbf['update'](_0x230b15)['then'](function(_0x2987cb){return _0x2987cb;});}return null;};}function removeEntity(_0x1a4fd8,_0x348922){return function(_0x516fee){if(_0x516fee){return _0x516fee[_0x4262('0x23')]()[_0x4262('0x24')](function(){_0x1a4fd8[_0x4262('0x17')](0xcc)[_0x4262('0x18')]();});}};}function handleEntityNotFound(_0x2baad6,_0x9b50d9){return function(_0x16d487){if(!_0x16d487){_0x2baad6[_0x4262('0x16')](0x194);}return _0x16d487;};}function handleError(_0x580b00,_0x20230c){_0x20230c=_0x20230c||0x1f4;return function(_0x76e198){logger[_0x4262('0x25')](_0x76e198[_0x4262('0x26')]);if(_0x76e198[_0x4262('0x27')]){delete _0x76e198['name'];}_0x580b00['status'](_0x20230c)[_0x4262('0x28')](_0x76e198);};}exports[_0x4262('0x29')]=function(_0x3ac90,_0x2c6ea9){var _0x4bdd7e={},_0x3136e8={},_0x2002fa={'count':0x0,'rows':[]};var _0x1a8533=_[_0x4262('0x2a')](db[_0x4262('0x2b')][_0x4262('0x2c')],function(_0x54d185){return{'name':_0x54d185[_0x4262('0x2d')],'type':_0x54d185['type'][_0x4262('0x2e')]};});_0x3136e8[_0x4262('0x2f')]=_[_0x4262('0x30')](_[_0x4262('0x2a')](_0x1a8533,_0x4262('0x27')),[_0x4262('0x27')]);_0x3136e8[_0x4262('0x31')]=_[_0x4262('0x32')](_0x3ac90[_0x4262('0x31')]);_0x3136e8['filters']=_['intersection'](_0x3136e8[_0x4262('0x2f')],_0x3136e8[_0x4262('0x31')]);_0x4bdd7e['attributes']=_[_0x4262('0x33')](_0x3136e8[_0x4262('0x2f')],qs[_0x4262('0x34')](_0x3ac90[_0x4262('0x31')]['fields']));_0x4bdd7e[_0x4262('0x35')]=_0x4bdd7e[_0x4262('0x35')][_0x4262('0x36')]?_0x4bdd7e[_0x4262('0x35')]:_0x3136e8[_0x4262('0x2f')];if(!_0x3ac90[_0x4262('0x31')][_0x4262('0x37')](_0x4262('0x38'))){_0x4bdd7e[_0x4262('0x1b')]=qs[_0x4262('0x1b')](_0x3ac90[_0x4262('0x31')][_0x4262('0x1b')]);_0x4bdd7e['offset']=qs[_0x4262('0x1d')](_0x3ac90['query'][_0x4262('0x1d')]);}_0x4bdd7e[_0x4262('0x39')]=qs['sort'](_0x3ac90[_0x4262('0x31')][_0x4262('0x3a')]);_0x4bdd7e[_0x4262('0x3b')]=qs[_0x4262('0x3c')](_['pick'](_0x3ac90['query'],_0x3136e8[_0x4262('0x3c')]),_0x1a8533);if(_0x3ac90['query'][_0x4262('0x3d')]){_0x4bdd7e[_0x4262('0x3b')]=_[_0x4262('0x3e')](_0x4bdd7e[_0x4262('0x3b')],{'$or':_[_0x4262('0x2a')](_0x1a8533,function(_0x523419){if(_0x523419[_0x4262('0x3f')]!==_0x4262('0x40')){var _0x548e5e={};_0x548e5e[_0x523419[_0x4262('0x27')]]={'$like':'%'+_0x3ac90[_0x4262('0x31')][_0x4262('0x3d')]+'%'};return _0x548e5e;}})});}_0x4bdd7e=_[_0x4262('0x3e')]({},_0x4bdd7e,_0x3ac90['options']);var _0x1940b6={'where':_0x4bdd7e[_0x4262('0x3b')]};return db[_0x4262('0x2b')][_0x4262('0x1c')](_0x1940b6)[_0x4262('0x24')](function(_0x5ce85d){_0x2002fa[_0x4262('0x1c')]=_0x5ce85d;if(_0x3ac90[_0x4262('0x31')][_0x4262('0x41')]){_0x4bdd7e['include']=[{'all':!![]}];}return db[_0x4262('0x2b')][_0x4262('0x42')](_0x4bdd7e);})[_0x4262('0x24')](function(_0x35c11f){_0x2002fa[_0x4262('0x43')]=_0x35c11f;return _0x2002fa;})[_0x4262('0x24')](respondWithFilteredResult(_0x2c6ea9,_0x4bdd7e))[_0x4262('0x44')](handleError(_0x2c6ea9,null));};exports[_0x4262('0x45')]=function(_0x53332e,_0x102430){var _0x23c51d={'raw':!![],'where':{'id':_0x53332e[_0x4262('0x46')]['id']}},_0x52dbc5={};_0x52dbc5[_0x4262('0x2f')]=_[_0x4262('0x32')](db['CmCustomField'][_0x4262('0x2c')]);_0x52dbc5[_0x4262('0x31')]=_['keys'](_0x53332e[_0x4262('0x31')]);_0x52dbc5['filters']=_[_0x4262('0x33')](_0x52dbc5[_0x4262('0x2f')],_0x52dbc5['query']);_0x23c51d['attributes']=_[_0x4262('0x33')](_0x52dbc5[_0x4262('0x2f')],qs[_0x4262('0x34')](_0x53332e[_0x4262('0x31')]['fields']));_0x23c51d[_0x4262('0x35')]=_0x23c51d['attributes'][_0x4262('0x36')]?_0x23c51d[_0x4262('0x35')]:_0x52dbc5[_0x4262('0x2f')];if(_0x53332e[_0x4262('0x31')][_0x4262('0x41')]){_0x23c51d[_0x4262('0x47')]=[{'all':!![]}];}_0x23c51d=_['merge']({},_0x23c51d,_0x53332e['options']);return db[_0x4262('0x2b')]['find'](_0x23c51d)[_0x4262('0x24')](handleEntityNotFound(_0x102430,null))[_0x4262('0x24')](respondWithResult(_0x102430,null))[_0x4262('0x44')](handleError(_0x102430,null));};exports[_0x4262('0x48')]=function(_0x1a4486,_0x44c353){if(_0x1a4486[_0x4262('0x49')]['id']){delete _0x1a4486[_0x4262('0x49')]['id'];}return db[_0x4262('0x2b')][_0x4262('0x4a')]({'where':{'id':_0x1a4486[_0x4262('0x46')]['id']}})[_0x4262('0x24')](handleEntityNotFound(_0x44c353,null))[_0x4262('0x24')](saveUpdates(_0x1a4486[_0x4262('0x49')],null))[_0x4262('0x24')](respondWithResult(_0x44c353,null))[_0x4262('0x44')](handleError(_0x44c353,null));};exports[_0x4262('0x23')]=function(_0x1f7042,_0x311151){return db['CmCustomField'][_0x4262('0x4a')]({'where':{'id':_0x1f7042[_0x4262('0x46')]['id']}})[_0x4262('0x24')](handleEntityNotFound(_0x311151,null))[_0x4262('0x24')](removeEntity(_0x311151,null))[_0x4262('0x44')](handleError(_0x311151,null));};exports[_0x4262('0x4b')]=function(_0x20fe40,_0x5ee133){var _0x3a8357;return db[_0x4262('0x4c')][_0x4262('0x4d')](function(_0x3ae3f1){return db[_0x4262('0x2b')]['create'](_0x20fe40[_0x4262('0x49')],{'transaction':_0x3ae3f1})[_0x4262('0x24')](function(_0x50a9b3){_0x3a8357=_0x50a9b3;var _0x29380e={'type':db['Sequelize'][_0x4262('0x4e')],'transaction':_0x3ae3f1};switch(_0x20fe40[_0x4262('0x49')][_0x4262('0x3f')]){case _0x4262('0x4f'):_0x29380e[_0x4262('0x3f')]=db['Sequelize'][_0x4262('0x4e')];break;case _0x4262('0x50'):_0x29380e[_0x4262('0x3f')]=db[_0x4262('0x51')]['INTEGER'];break;case'switch':_0x29380e['type']=db[_0x4262('0x51')][_0x4262('0x52')];_0x29380e[_0x4262('0x53')]=![];break;default:}return db[_0x4262('0x4c')][_0x4262('0x54')][_0x4262('0x55')](_0x4262('0x56'),util['format'](_0x4262('0x57'),_0x3a8357['id']),_0x29380e);})[_0x4262('0x24')](function(){return _0x3a8357;});})[_0x4262('0x24')](respondWithResult(_0x5ee133,0xc9))['catch'](handleError(_0x5ee133,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e4621d7..44b4bf7 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 _0xbe34=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3293de,_0x4431d8){var _0x5d2348=function(_0x14ab8f){while(--_0x14ab8f){_0x3293de['push'](_0x3293de['shift']());}};_0x5d2348(++_0x4431d8);}(_0xbe34,0x132));var _0x4be3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xbe34[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x4be3('0x0'));var util=require(_0x4be3('0x1'));var logger=require(_0x4be3('0x2'))(_0x4be3('0x3'));var moment=require(_0x4be3('0x4'));var BPromise=require(_0x4be3('0x5'));var rp=require(_0x4be3('0x6'));var fs=require('fs');var path=require(_0x4be3('0x7'));var rimraf=require(_0x4be3('0x8'));var config=require(_0x4be3('0x9'));var attributes=require(_0x4be3('0xa'));module[_0x4be3('0xb')]=function(_0x269317,_0x4eda4d){return _0x269317[_0x4be3('0xc')](_0x4be3('0xd'),attributes,{'tableName':_0x4be3('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fdf=['../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x46102b,_0x490949){var _0x21587b=function(_0xcfc211){while(--_0xcfc211){_0x46102b['push'](_0x46102b['shift']());}};_0x21587b(++_0x490949);}(_0x0fdf,0x1b2));var _0xf0fd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0fdf[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf0fd('0x0'));var util=require(_0xf0fd('0x1'));var logger=require(_0xf0fd('0x2'))(_0xf0fd('0x3'));var moment=require('moment');var BPromise=require(_0xf0fd('0x4'));var rp=require(_0xf0fd('0x5'));var fs=require('fs');var path=require(_0xf0fd('0x6'));var rimraf=require(_0xf0fd('0x7'));var config=require(_0xf0fd('0x8'));var attributes=require(_0xf0fd('0x9'));module['exports']=function(_0x59664e,_0x383fa9){return _0x59664e[_0xf0fd('0xa')](_0xf0fd('0xb'),attributes,{'tableName':_0xf0fd('0xc'),'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 2734b79..39051e1 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 _0xaf26=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x8ad00,_0x51b817){var _0x54dedd=function(_0x572445){while(--_0x572445){_0x8ad00['push'](_0x8ad00['shift']());}};_0x54dedd(++_0x51b817);}(_0xaf26,0x142));var _0x6af2=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xaf26[_0x2de0a7];return _0x429437;};'use strict';var _=require(_0x6af2('0x0'));var util=require(_0x6af2('0x1'));var moment=require(_0x6af2('0x2'));var BPromise=require(_0x6af2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6af2('0x4'));var db=require(_0x6af2('0x5'))['db'];var utils=require(_0x6af2('0x6'));var logger=require('../../config/logger')(_0x6af2('0x7'));var config=require(_0x6af2('0x8'));var jayson=require(_0x6af2('0x9'));var client=jayson['client'][_0x6af2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x128ab1,_0x362115,_0x3eace4){return new BPromise(function(_0x46b310,_0x1fd11c){return client[_0x6af2('0xb')](_0x128ab1,_0x3eace4)['then'](function(_0x7274e){logger['info'](_0x6af2('0xc'),_0x362115,_0x6af2('0xd'));logger[_0x6af2('0xe')](_0x6af2('0xf'),_0x362115,_0x6af2('0xd'),JSON['stringify'](_0x7274e));if(_0x7274e[_0x6af2('0x10')]){if(_0x7274e[_0x6af2('0x10')]['code']===0x1f4){logger[_0x6af2('0x10')](_0x6af2('0xc'),_0x362115,_0x7274e[_0x6af2('0x10')]['message']);return _0x1fd11c(_0x7274e[_0x6af2('0x10')]['message']);}logger[_0x6af2('0x10')](_0x6af2('0xc'),_0x362115,_0x7274e['error'][_0x6af2('0x11')]);return _0x46b310(_0x7274e[_0x6af2('0x10')][_0x6af2('0x11')]);}else{logger[_0x6af2('0x12')](_0x6af2('0xc'),_0x362115,_0x6af2('0xd'));_0x46b310(_0x7274e[_0x6af2('0x13')]['message']);}})[_0x6af2('0x14')](function(_0x496460){logger[_0x6af2('0x10')](_0x6af2('0xc'),_0x362115,_0x496460);_0x1fd11c(_0x496460);});});} \ No newline at end of file +var _0x6964=['http','then','info','request\x20sent','debug','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x39c453,_0x3e2d2f){var _0x5bca1a=function(_0x2d600a){while(--_0x2d600a){_0x39c453['push'](_0x39c453['shift']());}};_0x5bca1a(++_0x3e2d2f);}(_0x6964,0x11c));var _0x4696=function(_0x4b1665,_0xb0c095){_0x4b1665=_0x4b1665-0x0;var _0x5850c0=_0x6964[_0x4b1665];return _0x5850c0;};'use strict';var _=require(_0x4696('0x0'));var util=require(_0x4696('0x1'));var moment=require('moment');var BPromise=require(_0x4696('0x2'));var rs=require(_0x4696('0x3'));var fs=require('fs');var Redis=require(_0x4696('0x4'));var db=require(_0x4696('0x5'))['db'];var utils=require(_0x4696('0x6'));var logger=require(_0x4696('0x7'))(_0x4696('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4696('0x9')][_0x4696('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8e84,_0x45eb6c,_0x187191){return new BPromise(function(_0x4ef636,_0x514efb){return client['request'](_0x1c8e84,_0x187191)[_0x4696('0xb')](function(_0x3f5796){logger[_0x4696('0xc')]('CmCustomField,\x20%s,\x20%s',_0x45eb6c,_0x4696('0xd'));logger[_0x4696('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x45eb6c,'request\x20sent',JSON[_0x4696('0xf')](_0x3f5796));if(_0x3f5796[_0x4696('0x10')]){if(_0x3f5796[_0x4696('0x10')][_0x4696('0x11')]===0x1f4){logger[_0x4696('0x10')](_0x4696('0x12'),_0x45eb6c,_0x3f5796[_0x4696('0x10')][_0x4696('0x13')]);return _0x514efb(_0x3f5796['error'][_0x4696('0x13')]);}logger[_0x4696('0x10')](_0x4696('0x12'),_0x45eb6c,_0x3f5796['error']['message']);return _0x4ef636(_0x3f5796[_0x4696('0x10')][_0x4696('0x13')]);}else{logger[_0x4696('0xc')]('CmCustomField,\x20%s,\x20%s',_0x45eb6c,_0x4696('0xd'));_0x4ef636(_0x3f5796[_0x4696('0x14')]['message']);}})['catch'](function(_0x304d6f){logger[_0x4696('0x10')](_0x4696('0x12'),_0x45eb6c,_0x304d6f);_0x514efb(_0x304d6f);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index cea4147..176d753 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 _0x44e8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer'];(function(_0x39876c,_0x34a7f1){var _0x5c1fbd=function(_0x8fd7b1){while(--_0x8fd7b1){_0x39876c['push'](_0x39876c['shift']());}};_0x5c1fbd(++_0x34a7f1);}(_0x44e8,0xd7));var _0x844e=function(_0x3c35d7,_0x1a4093){_0x3c35d7=_0x3c35d7-0x0;var _0x2a5395=_0x44e8[_0x3c35d7];return _0x2a5395;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['show']);router[_0x844e('0xc')]('/',auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0xe')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['update']);router[_0x844e('0xf')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller[_0x844e('0x10')]);module[_0x844e('0x11')]=router; \ No newline at end of file +var _0xaba6=['delete','destroy','multer','util','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','create','/:id','update'];(function(_0x200d25,_0x48270c){var _0x326847=function(_0x59296d){while(--_0x59296d){_0x200d25['push'](_0x200d25['shift']());}};_0x326847(++_0x48270c);}(_0xaba6,0xe2));var _0x6aba=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0xaba6[_0x483102];return _0x5cc885;};'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')]('/:id',auth[_0x6aba('0x7')](),controller[_0x6aba('0x8')]);router['post']('/',auth[_0x6aba('0x7')](),controller[_0x6aba('0x9')]);router['put'](_0x6aba('0xa'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')](_0x6aba('0xa'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 98190d0..89c7049 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 _0x0a6f=['STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports'];(function(_0x52282a,_0x45aef7){var _0x3c66b4=function(_0x312aa9){while(--_0x312aa9){_0x52282a['push'](_0x52282a['shift']());}};_0x3c66b4(++_0x45aef7);}(_0x0a6f,0x85));var _0xf0a6=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x0a6f[_0x237f8b];return _0x423f94;};'use strict';var moment=require(_0xf0a6('0x0'));var Sequelize=require('sequelize');module[_0xf0a6('0x1')]={'phone':{'type':Sequelize[_0xf0a6('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xf0a6('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xf0a6('0x4')](_0xf0a6('0x5'))},'countbusyretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf0a6('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xf0a6('0x6')](0x2)[_0xf0a6('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf0a6('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf0a6('0x6')],'unique':_0xf0a6('0x8')},'ListId':{'type':Sequelize[_0xf0a6('0x6')],'unique':_0xf0a6('0x8')},'UserId':{'type':Sequelize[_0xf0a6('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xf0a6('0x6')],'unique':_0xf0a6('0x8')},'CampaignId':{'type':Sequelize[_0xf0a6('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf0a6('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc860=['exports','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','DATE','UNSIGNED','contactListQueue'];(function(_0x256823,_0x2392df){var _0x5db66b=function(_0x2bd5d6){while(--_0x2bd5d6){_0x256823['push'](_0x256823['shift']());}};_0x5db66b(++_0x2392df);}(_0xc860,0x181));var _0x0c86=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xc860[_0x3c4737];return _0x2bb926;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x0c86('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x0c86('0x1'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0c86('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0c86('0x2')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0c86('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0c86('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x0c86('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x0c86('0x6')},'ListId':{'type':Sequelize[_0x0c86('0x2')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x0c86('0x2')]},'VoiceQueueId':{'type':Sequelize[_0x0c86('0x2')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x0c86('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0c86('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0c86('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0c86('0x2')],'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 1cd81fb..7510e5e 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 _0x90e0=['where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','include','create','body','find','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','updatedAt','state','deleted','membername','UserId','user','format','phone','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','outbound','dialOrderByScheduledAt','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','stack','name','send','index','CmHopper','rawAttributes','type','key','model','map','query','keys','filters','$and','$or','$gt','$ne','$eq','$between','$in','$iLike','$like','$overlap','attributes','intersection','fields','length','order','sort'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x90e0,0x1d8));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x090e('0x0'));var zipdir=require(_0x090e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x090e('0x2'));var Mustache=require('mustache');var util=require(_0x090e('0x3'));var path=require(_0x090e('0x4'));var sox=require(_0x090e('0x5'));var csv=require(_0x090e('0x6'));var ejs=require(_0x090e('0x7'));var fs=require('fs');var fs_extra=require(_0x090e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x090e('0x9'));var deskjs=require(_0x090e('0xa'));var toCsv=require(_0x090e('0x6'));var querystring=require(_0x090e('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x090e('0xc'));var qs=require(_0x090e('0xd'));var as=require(_0x090e('0xe'));var hardwareService=require(_0x090e('0xf'));var logger=require(_0x090e('0x10'))(_0x090e('0x11'));var utils=require(_0x090e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x090e('0x13'));var db=require(_0x090e('0x14'))['db'];function respondWithStatusCode(_0x4f301e,_0x38e078){_0x38e078=_0x38e078||0xcc;return function(_0x4ef108){if(_0x4ef108){return _0x4f301e[_0x090e('0x15')](_0x38e078);}return _0x4f301e[_0x090e('0x16')](_0x38e078)[_0x090e('0x17')]();};}function respondWithResult(_0x5b3dcf,_0x1a5ec7){_0x1a5ec7=_0x1a5ec7||0xc8;return function(_0x12e326){if(_0x12e326){return _0x5b3dcf[_0x090e('0x16')](_0x1a5ec7)[_0x090e('0x18')](_0x12e326);}};}function respondWithFilteredResult(_0x56cad3,_0x3ca56d){return function(_0x2817a3){if(_0x2817a3){var _0x26a395=typeof _0x3ca56d[_0x090e('0x19')]===_0x090e('0x1a')&&typeof _0x3ca56d[_0x090e('0x1b')]==='undefined';var _0x869825=_0x2817a3[_0x090e('0x1c')];var _0x17cc10=_0x26a395?0x0:_0x3ca56d[_0x090e('0x19')];var _0x1a800c=_0x26a395?_0x2817a3[_0x090e('0x1c')]:_0x3ca56d[_0x090e('0x19')]+_0x3ca56d[_0x090e('0x1b')];var _0x435cb6;if(_0x1a800c>=_0x869825){_0x1a800c=_0x869825;_0x435cb6=0xc8;}else{_0x435cb6=0xce;}_0x56cad3['status'](_0x435cb6);return _0x56cad3[_0x090e('0x1d')](_0x090e('0x1e'),_0x17cc10+'-'+_0x1a800c+'/'+_0x869825)[_0x090e('0x18')](_0x2817a3);}return null;};}function patchUpdates(_0x5e3209){return function(_0x316f7d){try{jsonpatch['apply'](_0x316f7d,_0x5e3209,!![]);}catch(_0x143793){return BPromise[_0x090e('0x1f')](_0x143793);}return _0x316f7d['save']();};}function saveUpdates(_0x1d71a9,_0x15c9fc){return function(_0x19b80a){if(_0x19b80a){return _0x19b80a[_0x090e('0x20')](_0x1d71a9)['then'](function(_0x528f4f){return _0x528f4f;});}return null;};}function removeEntity(_0x50a041,_0x4212d1){return function(_0x242393){if(_0x242393){return _0x242393['destroy']()[_0x090e('0x21')](function(){_0x50a041['status'](0xcc)[_0x090e('0x17')]();});}};}function handleEntityNotFound(_0x39c0cd,_0x212e45){return function(_0xb9e65a){if(!_0xb9e65a){_0x39c0cd['sendStatus'](0x194);}return _0xb9e65a;};}function handleError(_0x5c2121,_0x228cb1){_0x228cb1=_0x228cb1||0x1f4;return function(_0x343a56){logger[_0x090e('0x22')](_0x343a56[_0x090e('0x23')]);if(_0x343a56[_0x090e('0x24')]){delete _0x343a56[_0x090e('0x24')];}_0x5c2121[_0x090e('0x16')](_0x228cb1)[_0x090e('0x25')](_0x343a56);};}exports[_0x090e('0x26')]=function(_0xe2596a,_0x3f19f2){var _0x5967dc={},_0x4fde16={},_0x36f8e3={'count':0x0,'rows':[]};var _0x25847=_['map'](db[_0x090e('0x27')][_0x090e('0x28')],function(_0x31c6c3){return{'name':_0x31c6c3['fieldName'],'type':_0x31c6c3[_0x090e('0x29')][_0x090e('0x2a')]};});_0x4fde16[_0x090e('0x2b')]=_[_0x090e('0x2c')](_0x25847,_0x090e('0x24'));_0x4fde16[_0x090e('0x2d')]=_[_0x090e('0x2e')](_0xe2596a[_0x090e('0x2d')]);_0x4fde16['filters']=_['intersection'](_0x4fde16[_0x090e('0x2b')],_0x4fde16[_0x090e('0x2d')]);_0x4fde16[_0x090e('0x2f')]=_['concat'](_0x4fde16[_0x090e('0x2f')],[_0x090e('0x30'),_0x090e('0x31'),_0x090e('0x32'),'$gte','$lt','$lte',_0x090e('0x33'),_0x090e('0x34'),'$not',_0x090e('0x35'),'$notBetween',_0x090e('0x36'),'$notIn','$like','$notLike',_0x090e('0x37'),'$notILike',_0x090e('0x38'),_0x090e('0x39'),'$contains','$contained','$any']);_0x5967dc[_0x090e('0x3a')]=_[_0x090e('0x3b')](_0x4fde16['model'],qs[_0x090e('0x3c')](_0xe2596a[_0x090e('0x2d')]['fields']));_0x5967dc['attributes']=_0x5967dc['attributes'][_0x090e('0x3d')]?_0x5967dc[_0x090e('0x3a')]:_0x4fde16[_0x090e('0x2b')];if(!_0xe2596a['query']['hasOwnProperty']('nolimit')){_0x5967dc[_0x090e('0x1b')]=qs[_0x090e('0x1b')](_0xe2596a[_0x090e('0x2d')][_0x090e('0x1b')]);_0x5967dc[_0x090e('0x19')]=qs[_0x090e('0x19')](_0xe2596a[_0x090e('0x2d')]['offset']);}_0x5967dc[_0x090e('0x3e')]=qs[_0x090e('0x3f')](_0xe2596a[_0x090e('0x2d')]['sort']);_0x5967dc[_0x090e('0x40')]=qs['filters'](_[_0x090e('0x41')](_0xe2596a[_0x090e('0x2d')],_0x4fde16[_0x090e('0x2f')]),_0x25847);if(_0xe2596a[_0x090e('0x2d')]['filter']){_0x5967dc['where']=_[_0x090e('0x42')](_0x5967dc[_0x090e('0x40')],{'$or':_[_0x090e('0x2c')](_0x25847,function(_0x4db4dd){if(_0x4db4dd[_0x090e('0x29')]!=='VIRTUAL'){var _0x4fac65={};_0x4fac65[_0x4db4dd[_0x090e('0x24')]]={'$like':'%'+_0xe2596a['query'][_0x090e('0x43')]+'%'};return _0x4fac65;}})});}_0x5967dc=_['merge']({},_0x5967dc,_0xe2596a[_0x090e('0x44')]);var _0x1a844c={'where':_0x5967dc[_0x090e('0x40')]};return db['CmHopper'][_0x090e('0x1c')](_0x1a844c)[_0x090e('0x21')](function(_0x473dd9){_0x36f8e3[_0x090e('0x1c')]=_0x473dd9;if(_0xe2596a[_0x090e('0x2d')][_0x090e('0x45')]){_0x5967dc['include']=[{'all':!![]}];}return db['CmHopper'][_0x090e('0x46')](_0x5967dc);})[_0x090e('0x21')](function(_0x29f472){_0x36f8e3[_0x090e('0x47')]=_0x29f472;return _0x36f8e3;})[_0x090e('0x21')](respondWithFilteredResult(_0x3f19f2,_0x5967dc))[_0x090e('0x48')](handleError(_0x3f19f2,null));};exports[_0x090e('0x49')]=function(_0x1e8822,_0x2aee0f){var _0xb1306a={'raw':!![],'where':{'id':_0x1e8822['params']['id']}},_0x567d8f={};_0x567d8f[_0x090e('0x2b')]=_['keys'](db['CmHopper'][_0x090e('0x28')]);_0x567d8f[_0x090e('0x2d')]=_[_0x090e('0x2e')](_0x1e8822[_0x090e('0x2d')]);_0x567d8f[_0x090e('0x2f')]=_[_0x090e('0x3b')](_0x567d8f[_0x090e('0x2b')],_0x567d8f[_0x090e('0x2d')]);_0xb1306a[_0x090e('0x3a')]=_[_0x090e('0x3b')](_0x567d8f['model'],qs[_0x090e('0x3c')](_0x1e8822[_0x090e('0x2d')][_0x090e('0x3c')]));_0xb1306a[_0x090e('0x3a')]=_0xb1306a[_0x090e('0x3a')][_0x090e('0x3d')]?_0xb1306a[_0x090e('0x3a')]:_0x567d8f[_0x090e('0x2b')];if(_0x1e8822[_0x090e('0x2d')][_0x090e('0x45')]){_0xb1306a[_0x090e('0x4a')]=[{'all':!![]}];}_0xb1306a=_[_0x090e('0x42')]({},_0xb1306a,_0x1e8822[_0x090e('0x44')]);return db[_0x090e('0x27')]['find'](_0xb1306a)[_0x090e('0x21')](handleEntityNotFound(_0x2aee0f,null))['then'](respondWithResult(_0x2aee0f,null))[_0x090e('0x48')](handleError(_0x2aee0f,null));};exports[_0x090e('0x4b')]=function(_0x163283,_0x1b770b){return db['CmHopper'][_0x090e('0x4b')](_0x163283[_0x090e('0x4c')],{})[_0x090e('0x21')](respondWithResult(_0x1b770b,0xc9))[_0x090e('0x48')](handleError(_0x1b770b,null));};exports[_0x090e('0x20')]=function(_0x1da3ca,_0xb65955){if(_0x1da3ca[_0x090e('0x4c')]['id']){delete _0x1da3ca[_0x090e('0x4c')]['id'];}return db['CmHopper'][_0x090e('0x4d')]({'where':{'id':_0x1da3ca[_0x090e('0x4e')]['id']}})[_0x090e('0x21')](handleEntityNotFound(_0xb65955,null))['then'](saveUpdates(_0x1da3ca[_0x090e('0x4c')],null))[_0x090e('0x21')](respondWithResult(_0xb65955,null))[_0x090e('0x48')](handleError(_0xb65955,null));};exports[_0x090e('0x4f')]=function(_0x9f1feb,_0x4427a7){return db['CmHopper'][_0x090e('0x4f')]()[_0x090e('0x21')](respondWithResult(_0x4427a7,null))[_0x090e('0x48')](handleError(_0x4427a7,null));};exports[_0x090e('0x50')]=function(_0x161d69,_0x52f0eb){var _0x53c02e;return db[_0x090e('0x27')][_0x090e('0x4d')]({'where':{'id':_0x161d69[_0x090e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x52f0eb,null))[_0x090e('0x21')](function(_0x596982){if(_0x596982){return _0x596982[_0x090e('0x50')]()['then'](function(_0x13c809){return _0x13c809;});}})['then'](function(_0x25f8a3){_0x53c02e=_0x25f8a3;if(_0x25f8a3){if(_0x25f8a3[_0x090e('0x51')]||_0x25f8a3[_0x090e('0x52')]){return db[_0x25f8a3[_0x090e('0x51')]?_0x090e('0x53'):_0x090e('0x54')]['find']({'where':{'id':_0x25f8a3[_0x090e('0x51')]?_0x25f8a3[_0x090e('0x51')]:_0x25f8a3[_0x090e('0x52')]},'attributes':['id',_0x090e('0x24')],'raw':!![]});}}})[_0x090e('0x21')](function(_0x346759){var _0x5eb5da={};if(_0x346759){_[_0x090e('0x42')](_0x5eb5da,_[_0x090e('0x55')](_0x53c02e['dataValues'],['createdAt',_0x090e('0x56'),'id']));_0x5eb5da[_0x090e('0x57')]=0x15;_0x5eb5da['statedesc']=_0x090e('0x58');_0x5eb5da['campaign']=_0x346759[_0x090e('0x24')];_0x5eb5da[_0x090e('0x59')]=_0x161d69['user'][_0x090e('0x24')];_0x5eb5da[_0x090e('0x5a')]=_0x161d69[_0x090e('0x5b')]['id'];_0x5eb5da[_0x090e('0x58')]=!![];_0x5eb5da['deletedat']=moment()[_0x090e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5eb5da['calleridnum']=_0x53c02e[_0x090e('0x5d')];_0x5eb5da['campaigntype']=_0x53c02e[_0x090e('0x51')]?'queue':_0x090e('0x5e');return db[_0x090e('0x5f')][_0x090e('0x4d')]({'where':{'id':_0x5eb5da[_0x090e('0x60')]},'attributes':[_0x090e('0x61'),_0x090e('0x62')]})[_0x090e('0x21')](function(_0x1e914a){if(!_[_0x090e('0x63')](_0x52f0eb)&&!_[_0x090e('0x63')](_0x1e914a[_0x090e('0x61')])){_0x5eb5da['calleridname']=_0x1e914a['firstName'];if(!_[_0x090e('0x63')](_0x1e914a[_0x090e('0x62')])){_0x5eb5da[_0x090e('0x64')]+='\x20'+_0x1e914a['lastName'];}}})[_0x090e('0x65')](function(){return db[_0x090e('0x66')][_0x090e('0x4b')](_0x5eb5da);});}})[_0x090e('0x21')](function(){return _0x52f0eb[_0x090e('0x16')](0xcc)[_0x090e('0x17')]();})[_0x090e('0x48')](handleError(_0x52f0eb,null));};exports[_0x090e('0x67')]=function(_0x16f47b,_0x42809e,_0x1e83cf){var _0x24b711=[];return db['CmContact'][_0x090e('0x4f')]()['then'](function(_0x2f847c){_0x24b711=_[_0x090e('0x2e')](_0x2f847c);return _0x16f47b[_0x090e('0x5b')]['getVoiceQueues']({'where':{'type':_0x090e('0x68'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x090e('0x69')],'raw':!![]});})[_0x090e('0x21')](function(_0x181216){if(_0x181216&&_0x181216['length']){return db['sequelize'][_0x090e('0x6a')](function(_0x5c0fbc){var _0x1c4e85={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x090e('0x5c')](_0x090e('0x6b'))},'VoiceQueueId':{'$in':_[_0x090e('0x2c')](_0x181216,'id')},'$or':[{'UserId':null},{'UserId':_0x16f47b['user']['id']}]};var _0x300c28=[];if(_0x16f47b[_0x090e('0x4c')][_0x090e('0x6c')]&&_0x16f47b[_0x090e('0x4c')][_0x090e('0x6c')]===_0x090e('0x6d')){if(!_[_0x090e('0x6e')](_0x16f47b[_0x090e('0x4c')][_0x090e('0x6f')])){_0x1c4e85['id']={'$in':_0x16f47b[_0x090e('0x4c')][_0x090e('0x6f')]};}_0x300c28=[['priority','ASC'],[_0x090e('0x70'),_0x181216[0x0][_0x090e('0x69')]==='ASC'?_0x090e('0x71'):'ASC'],db[_0x090e('0x72')][_0x090e('0x73')](_0x090e('0x74')),['id',_0x090e('0x71')]];}else{if(!_[_0x090e('0x6e')](_0x16f47b[_0x090e('0x4c')][_0x090e('0x6f')])){_0x1c4e85['id']={'$notIn':_0x16f47b[_0x090e('0x4c')][_0x090e('0x6f')]};}_0x300c28=[[_0x090e('0x75'),_0x090e('0x71')],[_0x090e('0x70'),_0x181216[0x0][_0x090e('0x69')]],db[_0x090e('0x72')][_0x090e('0x73')](_0x090e('0x76')),['id',_0x090e('0x77')]];}return db[_0x090e('0x27')][_0x090e('0x78')]({'attributes':['id','scheduledat'],'where':_0x1c4e85,'order':_0x300c28,'transaction':_0x5c0fbc,'lock':_0x5c0fbc[_0x090e('0x79')][_0x090e('0x7a')],'include':[{'model':db[_0x090e('0x5f')],'as':_0x090e('0x7b'),'attributes':_0x24b711,'include':[{'model':db[_0x090e('0x7c')],'as':_0x090e('0x7d'),'attributes':['id',_0x090e('0x24')]}]},{'model':db['CmList'],'as':_0x090e('0x7e'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x090e('0x7f'),'attributes':['id',_0x090e('0x24'),_0x090e('0x80')]}]})[_0x090e('0x21')](function(_0x1da4a6){if(_0x1da4a6){return _0x1da4a6['update']({'UserId':_0x16f47b[_0x090e('0x5b')]['id']},{'transaction':_0x5c0fbc});}});});}})['then'](handleEntityNotFound(_0x42809e,null))[_0x090e('0x21')](respondWithResult(_0x42809e,null))['catch'](handleError(_0x42809e,null));};exports[_0x090e('0x81')]=function(_0x605476,_0x2349f5,_0x359d71){return _0x605476[_0x090e('0x5b')]['getVoiceQueues']({'where':{'type':_0x090e('0x68'),'dialActive':!![],'dialMethod':_0x090e('0x82')},'attributes':['id'],'raw':!![]})['then'](function(_0x11e376){if(_0x11e376&&_0x11e376['length']){return db[_0x090e('0x27')][_0x090e('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x090e('0x5c')](_0x090e('0x6b'))},'VoiceQueueId':{'$in':_[_0x090e('0x2c')](_0x11e376,'id')},'$or':[{'UserId':null},{'UserId':_0x605476[_0x090e('0x5b')]['id']}]}});}return 0x0;})[_0x090e('0x21')](function(_0x4a1e4a){if(!_['isNil'](_0x4a1e4a)&&_[_0x090e('0x83')](_0x4a1e4a)){return _0x2349f5[_0x090e('0x16')](0xc8)[_0x090e('0x18')]({'contacts':_0x4a1e4a});}else{logger[_0x090e('0x22')](_0x090e('0x84'),_0x090e('0x81'),0x194,_0x090e('0x85'));_0x2349f5[_0x090e('0x15')](0x194);}})[_0x090e('0x48')](handleError(_0x2349f5,null));}; \ No newline at end of file +var _0x6306=['query','keys','filters','intersection','$and','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contains','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','options','catch','create','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','firstName','isNil','calleridname','lastName','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','hopperIds','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledat','UPDATE','CmCompany','CmList','Queue','dialActive','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','key','model'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x6306,0xe1));var _0x6630=function(_0x46055c,_0x1b187b){_0x46055c=_0x46055c-0x0;var _0x1f5a37=_0x6306[_0x46055c];return _0x1f5a37;};'use strict';var emlformat=require(_0x6630('0x0'));var rimraf=require(_0x6630('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6630('0x2'));var rp=require(_0x6630('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6630('0x4'));var util=require(_0x6630('0x5'));var path=require('path');var sox=require(_0x6630('0x6'));var csv=require(_0x6630('0x7'));var ejs=require(_0x6630('0x8'));var fs=require('fs');var fs_extra=require(_0x6630('0x9'));var _=require(_0x6630('0xa'));var squel=require(_0x6630('0xb'));var crypto=require(_0x6630('0xc'));var jsforce=require(_0x6630('0xd'));var deskjs=require(_0x6630('0xe'));var toCsv=require(_0x6630('0x7'));var querystring=require(_0x6630('0xf'));var Papa=require(_0x6630('0x10'));var Redis=require(_0x6630('0x11'));var authService=require(_0x6630('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6630('0x13'));var hardwareService=require(_0x6630('0x14'));var logger=require(_0x6630('0x15'))(_0x6630('0x16'));var utils=require(_0x6630('0x17'));var config=require(_0x6630('0x18'));var licenseUtil=require(_0x6630('0x19'));var db=require(_0x6630('0x1a'))['db'];function respondWithStatusCode(_0x4efe12,_0x4b6b72){_0x4b6b72=_0x4b6b72||0xcc;return function(_0x24242b){if(_0x24242b){return _0x4efe12[_0x6630('0x1b')](_0x4b6b72);}return _0x4efe12[_0x6630('0x1c')](_0x4b6b72)['end']();};}function respondWithResult(_0x362ee7,_0x180df7){_0x180df7=_0x180df7||0xc8;return function(_0x5be441){if(_0x5be441){return _0x362ee7['status'](_0x180df7)[_0x6630('0x1d')](_0x5be441);}};}function respondWithFilteredResult(_0x47f903,_0x3b80b7){return function(_0x2b12e3){if(_0x2b12e3){var _0x495f6a=typeof _0x3b80b7['offset']==='undefined'&&typeof _0x3b80b7[_0x6630('0x1e')]===_0x6630('0x1f');var _0x393494=_0x2b12e3[_0x6630('0x20')];var _0x22524e=_0x495f6a?0x0:_0x3b80b7[_0x6630('0x21')];var _0x53f369=_0x495f6a?_0x2b12e3[_0x6630('0x20')]:_0x3b80b7[_0x6630('0x21')]+_0x3b80b7['limit'];var _0x2df6f2;if(_0x53f369>=_0x393494){_0x53f369=_0x393494;_0x2df6f2=0xc8;}else{_0x2df6f2=0xce;}_0x47f903[_0x6630('0x1c')](_0x2df6f2);return _0x47f903[_0x6630('0x22')](_0x6630('0x23'),_0x22524e+'-'+_0x53f369+'/'+_0x393494)[_0x6630('0x1d')](_0x2b12e3);}return null;};}function patchUpdates(_0xb4d04b){return function(_0x25d829){try{jsonpatch[_0x6630('0x24')](_0x25d829,_0xb4d04b,!![]);}catch(_0x2edf4b){return BPromise[_0x6630('0x25')](_0x2edf4b);}return _0x25d829[_0x6630('0x26')]();};}function saveUpdates(_0xe5d771,_0x473daf){return function(_0x482592){if(_0x482592){return _0x482592[_0x6630('0x27')](_0xe5d771)[_0x6630('0x28')](function(_0x5c42e1){return _0x5c42e1;});}return null;};}function removeEntity(_0x1b4edd,_0x111b07){return function(_0xb73eb5){if(_0xb73eb5){return _0xb73eb5[_0x6630('0x29')]()[_0x6630('0x28')](function(){_0x1b4edd['status'](0xcc)[_0x6630('0x2a')]();});}};}function handleEntityNotFound(_0x5ad8fc,_0x27f4d1){return function(_0x3e4c7d){if(!_0x3e4c7d){_0x5ad8fc[_0x6630('0x1b')](0x194);}return _0x3e4c7d;};}function handleError(_0x1c56de,_0x3db767){_0x3db767=_0x3db767||0x1f4;return function(_0x1c90e6){logger['error'](_0x1c90e6[_0x6630('0x2b')]);if(_0x1c90e6['name']){delete _0x1c90e6[_0x6630('0x2c')];}_0x1c56de[_0x6630('0x1c')](_0x3db767)[_0x6630('0x2d')](_0x1c90e6);};}exports['index']=function(_0x3550e9,_0x287ed7){var _0x4bb09d={},_0x5d8e99={},_0x436fba={'count':0x0,'rows':[]};var _0x10c01a=_[_0x6630('0x2e')](db[_0x6630('0x2f')][_0x6630('0x30')],function(_0x3f7338){return{'name':_0x3f7338[_0x6630('0x31')],'type':_0x3f7338[_0x6630('0x32')][_0x6630('0x33')]};});_0x5d8e99[_0x6630('0x34')]=_['map'](_0x10c01a,_0x6630('0x2c'));_0x5d8e99[_0x6630('0x35')]=_[_0x6630('0x36')](_0x3550e9[_0x6630('0x35')]);_0x5d8e99[_0x6630('0x37')]=_[_0x6630('0x38')](_0x5d8e99[_0x6630('0x34')],_0x5d8e99[_0x6630('0x35')]);_0x5d8e99[_0x6630('0x37')]=_['concat'](_0x5d8e99['filters'],[_0x6630('0x39'),'$or','$gt',_0x6630('0x3a'),'$lt',_0x6630('0x3b'),_0x6630('0x3c'),_0x6630('0x3d'),_0x6630('0x3e'),_0x6630('0x3f'),_0x6630('0x40'),'$in','$notIn',_0x6630('0x41'),_0x6630('0x42'),_0x6630('0x43'),_0x6630('0x44'),_0x6630('0x41'),_0x6630('0x45'),_0x6630('0x46'),'$contained','$any']);_0x4bb09d['attributes']=_[_0x6630('0x38')](_0x5d8e99[_0x6630('0x34')],qs[_0x6630('0x47')](_0x3550e9[_0x6630('0x35')]['fields']));_0x4bb09d[_0x6630('0x48')]=_0x4bb09d[_0x6630('0x48')][_0x6630('0x49')]?_0x4bb09d[_0x6630('0x48')]:_0x5d8e99[_0x6630('0x34')];if(!_0x3550e9[_0x6630('0x35')][_0x6630('0x4a')]('nolimit')){_0x4bb09d[_0x6630('0x1e')]=qs[_0x6630('0x1e')](_0x3550e9['query'][_0x6630('0x1e')]);_0x4bb09d[_0x6630('0x21')]=qs['offset'](_0x3550e9[_0x6630('0x35')]['offset']);}_0x4bb09d['order']=qs[_0x6630('0x4b')](_0x3550e9[_0x6630('0x35')]['sort']);_0x4bb09d['where']=qs[_0x6630('0x37')](_[_0x6630('0x4c')](_0x3550e9['query'],_0x5d8e99['filters']),_0x10c01a);if(_0x3550e9['query'][_0x6630('0x4d')]){_0x4bb09d[_0x6630('0x4e')]=_[_0x6630('0x4f')](_0x4bb09d[_0x6630('0x4e')],{'$or':_[_0x6630('0x2e')](_0x10c01a,function(_0x39885c){if(_0x39885c['type']!==_0x6630('0x50')){var _0x3d56c2={};_0x3d56c2[_0x39885c[_0x6630('0x2c')]]={'$like':'%'+_0x3550e9[_0x6630('0x35')][_0x6630('0x4d')]+'%'};return _0x3d56c2;}})});}_0x4bb09d=_['merge']({},_0x4bb09d,_0x3550e9['options']);var _0x5d9b2c={'where':_0x4bb09d[_0x6630('0x4e')]};return db[_0x6630('0x2f')][_0x6630('0x20')](_0x5d9b2c)[_0x6630('0x28')](function(_0x3aac0a){_0x436fba[_0x6630('0x20')]=_0x3aac0a;if(_0x3550e9['query'][_0x6630('0x51')]){_0x4bb09d[_0x6630('0x52')]=[{'all':!![]}];}return db[_0x6630('0x2f')]['findAll'](_0x4bb09d);})[_0x6630('0x28')](function(_0x39bd01){_0x436fba[_0x6630('0x53')]=_0x39bd01;return _0x436fba;})['then'](respondWithFilteredResult(_0x287ed7,_0x4bb09d))['catch'](handleError(_0x287ed7,null));};exports[_0x6630('0x54')]=function(_0x4e32d7,_0x2e283a){var _0x55b660={'raw':!![],'where':{'id':_0x4e32d7[_0x6630('0x55')]['id']}},_0x4a7527={};_0x4a7527[_0x6630('0x34')]=_[_0x6630('0x36')](db[_0x6630('0x2f')]['rawAttributes']);_0x4a7527[_0x6630('0x35')]=_[_0x6630('0x36')](_0x4e32d7['query']);_0x4a7527['filters']=_['intersection'](_0x4a7527['model'],_0x4a7527['query']);_0x55b660[_0x6630('0x48')]=_[_0x6630('0x38')](_0x4a7527['model'],qs[_0x6630('0x47')](_0x4e32d7['query'][_0x6630('0x47')]));_0x55b660[_0x6630('0x48')]=_0x55b660[_0x6630('0x48')]['length']?_0x55b660[_0x6630('0x48')]:_0x4a7527[_0x6630('0x34')];if(_0x4e32d7[_0x6630('0x35')]['includeAll']){_0x55b660['include']=[{'all':!![]}];}_0x55b660=_['merge']({},_0x55b660,_0x4e32d7[_0x6630('0x56')]);return db['CmHopper']['find'](_0x55b660)['then'](handleEntityNotFound(_0x2e283a,null))['then'](respondWithResult(_0x2e283a,null))[_0x6630('0x57')](handleError(_0x2e283a,null));};exports[_0x6630('0x58')]=function(_0x3d802c,_0x4bd00a){return db['CmHopper'][_0x6630('0x58')](_0x3d802c[_0x6630('0x59')],{})[_0x6630('0x28')](respondWithResult(_0x4bd00a,0xc9))[_0x6630('0x57')](handleError(_0x4bd00a,null));};exports[_0x6630('0x27')]=function(_0x28f603,_0xb122f8){if(_0x28f603['body']['id']){delete _0x28f603[_0x6630('0x59')]['id'];}return db[_0x6630('0x2f')][_0x6630('0x5a')]({'where':{'id':_0x28f603[_0x6630('0x55')]['id']}})['then'](handleEntityNotFound(_0xb122f8,null))[_0x6630('0x28')](saveUpdates(_0x28f603[_0x6630('0x59')],null))[_0x6630('0x28')](respondWithResult(_0xb122f8,null))[_0x6630('0x57')](handleError(_0xb122f8,null));};exports[_0x6630('0x5b')]=function(_0x5e3dfe,_0x2c3db1){return db[_0x6630('0x2f')]['describe']()[_0x6630('0x28')](respondWithResult(_0x2c3db1,null))[_0x6630('0x57')](handleError(_0x2c3db1,null));};exports['destroy']=function(_0x50f4c7,_0x504f56){var _0x59238f;return db['CmHopper'][_0x6630('0x5a')]({'where':{'id':_0x50f4c7['params']['id']}})[_0x6630('0x28')](handleEntityNotFound(_0x504f56,null))['then'](function(_0x186592){if(_0x186592){return _0x186592[_0x6630('0x29')]()[_0x6630('0x28')](function(_0x365ecd){return _0x365ecd;});}})[_0x6630('0x28')](function(_0x28e231){_0x59238f=_0x28e231;if(_0x28e231){if(_0x28e231[_0x6630('0x5c')]||_0x28e231[_0x6630('0x5d')]){return db[_0x28e231['VoiceQueueId']?_0x6630('0x5e'):'Campaign'][_0x6630('0x5a')]({'where':{'id':_0x28e231[_0x6630('0x5c')]?_0x28e231[_0x6630('0x5c')]:_0x28e231[_0x6630('0x5d')]},'attributes':['id',_0x6630('0x2c')],'raw':!![]});}}})[_0x6630('0x28')](function(_0x40bb7c){var _0x3732c2={};if(_0x40bb7c){_[_0x6630('0x4f')](_0x3732c2,_[_0x6630('0x5f')](_0x59238f[_0x6630('0x60')],[_0x6630('0x61'),'updatedAt','id']));_0x3732c2[_0x6630('0x62')]=0x15;_0x3732c2[_0x6630('0x63')]=_0x6630('0x64');_0x3732c2[_0x6630('0x65')]=_0x40bb7c[_0x6630('0x2c')];_0x3732c2[_0x6630('0x66')]=_0x50f4c7[_0x6630('0x67')][_0x6630('0x2c')];_0x3732c2[_0x6630('0x68')]=_0x50f4c7[_0x6630('0x67')]['id'];_0x3732c2[_0x6630('0x64')]=!![];_0x3732c2['deletedat']=moment()[_0x6630('0x69')](_0x6630('0x6a'));_0x3732c2['calleridnum']=_0x59238f[_0x6630('0x6b')];_0x3732c2[_0x6630('0x6c')]=_0x59238f[_0x6630('0x5c')]?_0x6630('0x6d'):'ivr';return db[_0x6630('0x6e')][_0x6630('0x5a')]({'where':{'id':_0x3732c2['ContactId']},'attributes':[_0x6630('0x6f'),'lastName']})[_0x6630('0x28')](function(_0x108a0){if(!_['isNil'](_0x504f56)&&!_[_0x6630('0x70')](_0x108a0[_0x6630('0x6f')])){_0x3732c2[_0x6630('0x71')]=_0x108a0[_0x6630('0x6f')];if(!_['isNil'](_0x108a0[_0x6630('0x72')])){_0x3732c2[_0x6630('0x71')]+='\x20'+_0x108a0['lastName'];}}})['finally'](function(){return db['CmHopperFinal'][_0x6630('0x58')](_0x3732c2);});}})[_0x6630('0x28')](function(){return _0x504f56[_0x6630('0x1c')](0xcc)[_0x6630('0x2a')]();})[_0x6630('0x57')](handleError(_0x504f56,null));};exports['getPreview']=function(_0x57d4a7,_0x2cf6f4,_0x38e646){var _0x434bc6=[];return db[_0x6630('0x6e')]['describe']()[_0x6630('0x28')](function(_0x1e3855){_0x434bc6=_[_0x6630('0x36')](_0x1e3855);return _0x57d4a7[_0x6630('0x67')][_0x6630('0x73')]({'where':{'type':_0x6630('0x74'),'dialActive':!![],'dialMethod':_0x6630('0x75')},'attributes':['id',_0x6630('0x76')],'raw':!![]});})[_0x6630('0x28')](function(_0x574bcc){if(_0x574bcc&&_0x574bcc['length']){return db[_0x6630('0x77')][_0x6630('0x78')](function(_0x9f6d){var _0x4d1f52={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6630('0x6a'))},'VoiceQueueId':{'$in':_[_0x6630('0x2e')](_0x574bcc,'id')},'$or':[{'UserId':null},{'UserId':_0x57d4a7['user']['id']}]};var _0x56e7ba=[];if(_0x57d4a7[_0x6630('0x59')][_0x6630('0x79')]&&_0x57d4a7[_0x6630('0x59')][_0x6630('0x79')]===_0x6630('0x7a')){if(!_['isEmpty'](_0x57d4a7[_0x6630('0x59')][_0x6630('0x7b')])){_0x4d1f52['id']={'$in':_0x57d4a7[_0x6630('0x59')]['hopperIds']};}_0x56e7ba=[['priority',_0x6630('0x7c')],['scheduledAt',_0x574bcc[0x0][_0x6630('0x76')]===_0x6630('0x7c')?'DESC':_0x6630('0x7c')],db[_0x6630('0x77')][_0x6630('0x7d')](_0x6630('0x7e')),['id',_0x6630('0x7f')]];}else{if(!_['isEmpty'](_0x57d4a7['body'][_0x6630('0x7b')])){_0x4d1f52['id']={'$notIn':_0x57d4a7['body'][_0x6630('0x7b')]};}_0x56e7ba=[['priority',_0x6630('0x7f')],['scheduledAt',_0x574bcc[0x0][_0x6630('0x76')]],db['sequelize'][_0x6630('0x7d')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x6630('0x7c')]];}return db[_0x6630('0x2f')]['findOne']({'attributes':['id',_0x6630('0x80')],'where':_0x4d1f52,'order':_0x56e7ba,'transaction':_0x9f6d,'lock':_0x9f6d['LOCK'][_0x6630('0x81')],'include':[{'model':db[_0x6630('0x6e')],'as':'Contact','attributes':_0x434bc6,'include':[{'model':db[_0x6630('0x82')],'as':'Company','attributes':['id',_0x6630('0x2c')]}]},{'model':db[_0x6630('0x83')],'as':'List','attributes':['id',_0x6630('0x2c')]},{'model':db[_0x6630('0x5e')],'as':_0x6630('0x84'),'attributes':['id','name',_0x6630('0x85')]}]})[_0x6630('0x28')](function(_0x24bf22){if(_0x24bf22){return _0x24bf22['update']({'UserId':_0x57d4a7[_0x6630('0x67')]['id']},{'transaction':_0x9f6d});}});});}})[_0x6630('0x28')](handleEntityNotFound(_0x2cf6f4,null))[_0x6630('0x28')](respondWithResult(_0x2cf6f4,null))['catch'](handleError(_0x2cf6f4,null));};exports['getOpenContacts']=function(_0x4a11ad,_0x398e8d,_0x161863){return _0x4a11ad[_0x6630('0x67')][_0x6630('0x73')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x6630('0x75')},'attributes':['id'],'raw':!![]})['then'](function(_0x4fa9a5){if(_0x4fa9a5&&_0x4fa9a5[_0x6630('0x49')]){return db[_0x6630('0x2f')][_0x6630('0x20')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6630('0x69')](_0x6630('0x6a'))},'VoiceQueueId':{'$in':_[_0x6630('0x2e')](_0x4fa9a5,'id')},'$or':[{'UserId':null},{'UserId':_0x4a11ad[_0x6630('0x67')]['id']}]}});}return 0x0;})[_0x6630('0x28')](function(_0x335043){if(!_[_0x6630('0x70')](_0x335043)&&_[_0x6630('0x86')](_0x335043)){return _0x398e8d[_0x6630('0x1c')](0xc8)[_0x6630('0x1d')]({'contacts':_0x335043});}else{logger[_0x6630('0x87')](_0x6630('0x88'),_0x6630('0x89'),0x194,_0x6630('0x8a'));_0x398e8d[_0x6630('0x1b')](0x194);}})['catch'](handleError(_0x398e8d,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index dd08c75..d0573a1 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 _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x260530,_0x50dbcd){var _0x3c5413=function(_0x1d1941){while(--_0x1d1941){_0x260530['push'](_0x260530['shift']());}};_0x3c5413(++_0x50dbcd);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x872f6f,_0x5efe7b){_0x872f6f=_0x872f6f-0x0;var _0x59a5f4=_0xfdbd[_0x872f6f];return _0x59a5f4;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','priority','lodash','util','../../config/logger','moment'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x1bc097,_0x50c38a){_0x1bc097=_0x1bc097-0x0;var _0x5a4f65=_0x7a54[_0x1bc097];return _0x5a4f65;};'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':'scheduledat','fields':[_0x47a5('0xc')]},{'name':'phone','fields':['phone']},{'name':'priority','fields':[_0x47a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 036b663..445ad71 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 _0x6b8d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','find','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','findAll','order','LOCK','Contact','keys','User','name','voicePause','length','UserId','push','all','MoveContactManagedDialer','sequelize','CmHopperFinal','destroy','CountReScheduled','literal','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x7c6e16,_0x3c11f7){var _0x10f3d9=function(_0x10d250){while(--_0x10d250){_0x7c6e16['push'](_0x7c6e16['shift']());}};_0x10f3d9(++_0x3c11f7);}(_0x6b8d,0x8c));var _0xd6b8=function(_0x2a4e13,_0x5a846e){_0x2a4e13=_0x2a4e13-0x0;var _0xb0c2d9=_0x6b8d[_0x2a4e13];return _0xb0c2d9;};'use strict';var _=require(_0xd6b8('0x0'));var util=require(_0xd6b8('0x1'));var moment=require(_0xd6b8('0x2'));var BPromise=require(_0xd6b8('0x3'));var rs=require(_0xd6b8('0x4'));var fs=require('fs');var Redis=require(_0xd6b8('0x5'));var db=require(_0xd6b8('0x6'))['db'];var utils=require(_0xd6b8('0x7'));var logger=require(_0xd6b8('0x8'))('rpc');var config=require(_0xd6b8('0x9'));var jayson=require(_0xd6b8('0xa'));var client=jayson[_0xd6b8('0xb')][_0xd6b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32c53f,_0x11df27,_0x139df7){return new BPromise(function(_0x61b26c,_0x4f50e0){return client[_0xd6b8('0xd')](_0x32c53f,_0x139df7)[_0xd6b8('0xe')](function(_0x53ea96){logger[_0xd6b8('0xf')](_0xd6b8('0x10'),_0x11df27,'request\x20sent');logger[_0xd6b8('0x11')](_0xd6b8('0x12'),_0x11df27,_0xd6b8('0x13'),JSON[_0xd6b8('0x14')](_0x53ea96));if(_0x53ea96[_0xd6b8('0x15')]){if(_0x53ea96[_0xd6b8('0x15')][_0xd6b8('0x16')]===0x1f4){logger['error'](_0xd6b8('0x10'),_0x11df27,_0x53ea96[_0xd6b8('0x15')][_0xd6b8('0x17')]);return _0x4f50e0(_0x53ea96[_0xd6b8('0x15')][_0xd6b8('0x17')]);}logger[_0xd6b8('0x15')]('CmHopper,\x20%s,\x20%s',_0x11df27,_0x53ea96[_0xd6b8('0x15')]['message']);return _0x61b26c(_0x53ea96['error'][_0xd6b8('0x17')]);}else{logger['info'](_0xd6b8('0x10'),_0x11df27,_0xd6b8('0x13'));_0x61b26c(_0x53ea96[_0xd6b8('0x18')]['message']);}})[_0xd6b8('0x19')](function(_0x2b7672){logger[_0xd6b8('0x15')]('CmHopper,\x20%s,\x20%s',_0x11df27,_0x2b7672);_0x4f50e0(_0x2b7672);});});}exports[_0xd6b8('0x1a')]=function(_0xa0f454){var _0x5e83ed=this;return new Promise(function(_0x1d2f8e,_0x3111f5){return db[_0xd6b8('0x1b')]['findAll']({'raw':_0xa0f454[_0xd6b8('0x1c')]?_0xa0f454[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'where':_0xa0f454[_0xd6b8('0x1c')]?_0xa0f454['options'][_0xd6b8('0x1e')]||null:null,'attributes':_0xa0f454['options']?_0xa0f454[_0xd6b8('0x1c')][_0xd6b8('0x1f')]||null:null,'limit':_0xa0f454[_0xd6b8('0x1c')]?_0xa0f454[_0xd6b8('0x1c')][_0xd6b8('0x20')]||null:null,'include':_0xa0f454[_0xd6b8('0x1c')]?_0xa0f454['options'][_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0xa0f454[_0xd6b8('0x1c')][_0xd6b8('0x21')],function(_0x2f0563){return{'model':db[_0x2f0563[_0xd6b8('0x23')]],'as':_0x2f0563['as'],'attributes':_0x2f0563['attributes'],'include':_0x2f0563[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x2f0563['include'],function(_0xc4a6f9){return{'model':db[_0xc4a6f9[_0xd6b8('0x23')]],'as':_0xc4a6f9['as'],'attributes':_0xc4a6f9['attributes'],'include':_0xc4a6f9['include']?_['map'](_0xc4a6f9[_0xd6b8('0x21')],function(_0x5aa6a0){return{'model':db[_0x5aa6a0[_0xd6b8('0x23')]],'as':_0x5aa6a0['as'],'attributes':_0x5aa6a0[_0xd6b8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xe')](function(_0x1c7b9c){logger[_0xd6b8('0xf')](_0xd6b8('0x1a'),_0xa0f454);logger[_0xd6b8('0x11')](_0xd6b8('0x1a'),_0xa0f454,JSON[_0xd6b8('0x14')](_0x1c7b9c));_0x1d2f8e(_0x1c7b9c);})['catch'](function(_0x156e3c){logger[_0xd6b8('0x15')](_0xd6b8('0x1a'),_0x156e3c[_0xd6b8('0x17')],_0xa0f454);_0x3111f5(_0x5e83ed['error'](0x1f4,_0x156e3c['message']));});});};exports['ShowCmHopper']=function(_0x5e981a){var _0x5388f5=this;return new Promise(function(_0x8dc997,_0x85e0ca){return db[_0xd6b8('0x1b')][_0xd6b8('0x24')]({'raw':_0x5e981a['options']?_0x5e981a['options'][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'where':_0x5e981a[_0xd6b8('0x1c')]?_0x5e981a[_0xd6b8('0x1c')][_0xd6b8('0x1e')]||null:null,'attributes':_0x5e981a[_0xd6b8('0x1c')]?_0x5e981a['options'][_0xd6b8('0x1f')]||null:null,'include':_0x5e981a['options']?_0x5e981a['options'][_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x5e981a[_0xd6b8('0x1c')][_0xd6b8('0x21')],function(_0x52c805){return{'model':db[_0x52c805[_0xd6b8('0x23')]],'as':_0x52c805['as'],'attributes':_0x52c805[_0xd6b8('0x1f')],'include':_0x52c805[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x52c805[_0xd6b8('0x21')],function(_0xf2b5da){return{'model':db[_0xf2b5da[_0xd6b8('0x23')]],'as':_0xf2b5da['as'],'attributes':_0xf2b5da[_0xd6b8('0x1f')],'include':_0xf2b5da[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0xf2b5da[_0xd6b8('0x21')],function(_0x135695){return{'model':db[_0x135695[_0xd6b8('0x23')]],'as':_0x135695['as'],'attributes':_0x135695['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xe')](function(_0x28fd71){logger['info'](_0xd6b8('0x25'),_0x5e981a);logger[_0xd6b8('0x11')](_0xd6b8('0x25'),_0x5e981a,JSON[_0xd6b8('0x14')](_0x28fd71));_0x8dc997(_0x28fd71);})['catch'](function(_0x5b31b8){logger[_0xd6b8('0x15')]('ShowCmHopper',_0x5b31b8[_0xd6b8('0x17')],_0x5e981a);_0x85e0ca(_0x5388f5['error'](0x1f4,_0x5b31b8['message']));});});};exports[_0xd6b8('0x26')]=function(_0x2dcfb7){var _0xfbc9d7=this;return new Promise(function(_0x4b5bbd,_0x3ab26b){return db['CmHopper'][_0xd6b8('0x27')](_0x2dcfb7[_0xd6b8('0x28')],{'raw':_0x2dcfb7['options']?_0x2dcfb7[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![]})[_0xd6b8('0xe')](function(_0x4fe77c){logger['info'](_0xd6b8('0x26'),_0x2dcfb7);logger['debug']('CreateCmHopper',_0x2dcfb7,JSON[_0xd6b8('0x14')](_0x4fe77c));_0x4b5bbd(_0x4fe77c);})[_0xd6b8('0x19')](function(_0x5214e1){logger[_0xd6b8('0x15')](_0xd6b8('0x26'),_0x5214e1[_0xd6b8('0x17')],_0x2dcfb7);_0x3ab26b(_0xfbc9d7[_0xd6b8('0x15')](0x1f4,_0x5214e1['message']));});});};exports[_0xd6b8('0x29')]=function(_0x30651c){var _0x103378=this;return new Promise(function(_0x5e8543,_0x53a8e2){return db[_0xd6b8('0x1b')][_0xd6b8('0x2a')](_0x30651c['body'],{'raw':_0x30651c[_0xd6b8('0x1c')]?_0x30651c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30651c[_0xd6b8('0x1c')]?_0x30651c[_0xd6b8('0x1c')]['where']||null:null,'attributes':_0x30651c[_0xd6b8('0x1c')]?_0x30651c[_0xd6b8('0x1c')][_0xd6b8('0x1f')]||null:null,'limit':_0x30651c['options']?_0x30651c[_0xd6b8('0x1c')]['limit']||null:null})[_0xd6b8('0xe')](function(_0x458616){logger['info']('UpdateCmHopper',_0x30651c);logger[_0xd6b8('0x11')]('UpdateCmHopper',_0x30651c,JSON['stringify'](_0x458616));_0x5e8543(_0x458616);})['catch'](function(_0x1d0ae4){logger[_0xd6b8('0x15')](_0xd6b8('0x29'),_0x1d0ae4['message'],_0x30651c);_0x53a8e2(_0x103378[_0xd6b8('0x15')](0x1f4,_0x1d0ae4[_0xd6b8('0x17')]));});});};exports[_0xd6b8('0x2b')]=function(_0x307d44){var _0x1ad99e=this;return new Promise(function(_0x3f9f5b,_0x5f2f19){return db['CmHopper']['destroy']({'where':_0x307d44[_0xd6b8('0x1c')]?_0x307d44[_0xd6b8('0x1c')]['where']||null:null})[_0xd6b8('0xe')](function(_0x3e4afb){logger[_0xd6b8('0xf')](_0xd6b8('0x2b'),_0x307d44);logger[_0xd6b8('0x11')](_0xd6b8('0x2b'),_0x307d44,JSON[_0xd6b8('0x14')](_0x3e4afb));_0x3f9f5b(_0x3e4afb);})[_0xd6b8('0x19')](function(_0x17182a){logger[_0xd6b8('0x15')](_0xd6b8('0x2b'),_0x17182a[_0xd6b8('0x17')],_0x307d44);_0x5f2f19(_0x1ad99e[_0xd6b8('0x15')](0x1f4,_0x17182a[_0xd6b8('0x17')]));});});};exports[_0xd6b8('0x2c')]=function(_0x2bd263){var _0x12ed0e=this;return new Promise(function(_0x124893,_0xd45db5){return db[_0xd6b8('0x2d')][_0xd6b8('0x2e')]()[_0xd6b8('0xe')](function(_0x35d213){return db['sequelize'][_0xd6b8('0x2f')](function(_0x17381f){return db['CmHopper'][_0xd6b8('0x30')]({'where':_0x2bd263[_0xd6b8('0x1c')]?_0x2bd263[_0xd6b8('0x1c')][_0xd6b8('0x1e')]||null:null,'attributes':_0x2bd263['options']?_0x2bd263[_0xd6b8('0x1c')]['attributes']||null:null,'limit':_0x2bd263[_0xd6b8('0x1c')]?_0x2bd263['options'][_0xd6b8('0x20')]||null:null,'order':_0x2bd263[_0xd6b8('0x1c')]?_0x2bd263[_0xd6b8('0x1c')][_0xd6b8('0x31')]||null:null,'transaction':_0x17381f,'lock':_0x17381f[_0xd6b8('0x32')]['UPDATE'],'include':[{'model':db[_0xd6b8('0x2d')],'as':_0xd6b8('0x33'),'attributes':_[_0xd6b8('0x34')](_0x35d213)},{'model':db[_0xd6b8('0x35')],'as':'Agent','attributes':['id',_0xd6b8('0x36'),_0xd6b8('0x37')]}]})['then'](function(_0x4e7d4d){var _0x58a15c=[];var _0x323e33=[];for(var _0x1f710b=0x0;_0x1f710b<_0x4e7d4d[_0xd6b8('0x38')];_0x1f710b+=0x1){var _0x15cfc4=_0x4e7d4d[_0x1f710b][_0xd6b8('0x39')];if(_0x15cfc4===null){_0x58a15c[_0xd6b8('0x3a')](_0x4e7d4d[_0x1f710b][_0xd6b8('0x2a')](_0x2bd263[_0xd6b8('0x28')],{'transaction':_0x17381f}));}else if(!_0x323e33['includes'](_0x15cfc4)){_0x323e33[_0xd6b8('0x3a')](_0x15cfc4);_0x58a15c['push'](_0x4e7d4d[_0x1f710b][_0xd6b8('0x2a')](_0x2bd263[_0xd6b8('0x28')],{'transaction':_0x17381f}));}}return BPromise[_0xd6b8('0x3b')](_0x58a15c);});})[_0xd6b8('0xe')](function(_0x541671){logger[_0xd6b8('0xf')](_0xd6b8('0x2c'),_0x2bd263);logger[_0xd6b8('0x11')](_0xd6b8('0x2c'),_0x2bd263,JSON[_0xd6b8('0x14')](_0x541671));_0x124893(_0x541671);})['catch'](function(_0x212e28){logger[_0xd6b8('0x15')](_0xd6b8('0x2c'),_0x212e28[_0xd6b8('0x17')],_0x2bd263);_0xd45db5(_0x12ed0e[_0xd6b8('0x15')](0x1f4,_0x212e28[_0xd6b8('0x17')]));});});});};exports[_0xd6b8('0x3c')]=function(_0x5d2b29){var _0x3fd213=this;return new Promise(function(_0x474f05,_0x59063a){return db[_0xd6b8('0x3d')][_0xd6b8('0x2f')](function(_0xe423b6){return db[_0xd6b8('0x3e')][_0xd6b8('0x27')](_0x5d2b29[_0xd6b8('0x28')],{'raw':_0x5d2b29[_0xd6b8('0x1c')]?_0x5d2b29[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'transaction':_0xe423b6})['then'](function(){return db['CmHopper'][_0xd6b8('0x3f')]({'where':_0x5d2b29[_0xd6b8('0x1c')]?_0x5d2b29[_0xd6b8('0x1c')][_0xd6b8('0x1e')]||null:null,'transaction':_0xe423b6});});})['then'](function(_0xd6b9e){logger[_0xd6b8('0xf')](_0xd6b8('0x3c'),_0x5d2b29);logger[_0xd6b8('0x11')](_0xd6b8('0x3c'),_0x5d2b29,JSON[_0xd6b8('0x14')](_0xd6b9e));_0x474f05(_0xd6b9e);})[_0xd6b8('0x19')](function(_0x378eae){logger[_0xd6b8('0x15')](_0xd6b8('0x3c'),_0x378eae[_0xd6b8('0x17')],_0x5d2b29);_0x59063a(_0x3fd213['error'](0x1f4,_0x378eae['message']));});});};exports[_0xd6b8('0x40')]=function(_0x400d97){var _0x22d457=this;return new Promise(function(_0x473306,_0x24e746){return db['CmHopper'][_0xd6b8('0x30')]({'raw':_0x400d97[_0xd6b8('0x1c')]?_0x400d97[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'where':_0x400d97[_0xd6b8('0x1c')]?_0x400d97[_0xd6b8('0x1c')]['where']||null:null,'attributes':[[db[_0xd6b8('0x3d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd6b8('0x3d')][_0xd6b8('0x41')]('`scheduledat`\x20>=\x20'+util['format'](_0xd6b8('0x42'),moment()[_0xd6b8('0x43')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xd6b8('0x44')))),_0xd6b8('0x45')]]})[_0xd6b8('0xe')](function(_0x2e7424){logger[_0xd6b8('0xf')](_0xd6b8('0x40'),_0x400d97);logger['debug'](_0xd6b8('0x40'),_0x400d97,JSON[_0xd6b8('0x14')](_0x2e7424));_0x473306(_0x2e7424);})[_0xd6b8('0x19')](function(_0x574e74){logger[_0xd6b8('0x15')](_0xd6b8('0x40'),_0x574e74[_0xd6b8('0x17')],_0x400d97);_0x24e746(_0x22d457['error'](0x1f4,_0x574e74[_0xd6b8('0x17')]));});});};exports[_0xd6b8('0x46')]=function(_0x45f447){var _0x4f265b=this;return new Promise(function(_0xd4c40d,_0x3cf199){return db['CmContact'][_0xd6b8('0x2e')]()['then'](function(_0x229c37){return db[_0xd6b8('0x3d')][_0xd6b8('0x2f')](function(_0x1b4064){return db['CmHopper'][_0xd6b8('0x30')]({'where':_0x45f447[_0xd6b8('0x1c')]?_0x45f447[_0xd6b8('0x1c')][_0xd6b8('0x1e')]||null:null,'attributes':_0x45f447[_0xd6b8('0x1c')]?_0x45f447[_0xd6b8('0x1c')][_0xd6b8('0x1f')]||null:null,'limit':0x1,'order':_0x45f447[_0xd6b8('0x1c')]?_0x45f447[_0xd6b8('0x1c')][_0xd6b8('0x31')]||null:null,'group':db['CmHopper'][_0xd6b8('0x39')],'transaction':_0x1b4064,'lock':_0x1b4064[_0xd6b8('0x32')][_0xd6b8('0x47')],'include':_0x45f447['options']?_0x45f447['options'][_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x45f447[_0xd6b8('0x1c')][_0xd6b8('0x21')],function(_0xaf0e62){return{'model':db[_0xaf0e62['model']],'as':_0xaf0e62['as'],'attributes':_0xaf0e62[_0xd6b8('0x1f')],'include':_0xaf0e62['include']?_['map'](_0xaf0e62[_0xd6b8('0x21')],function(_0x2f5b5c){return{'model':db[_0x2f5b5c[_0xd6b8('0x23')]],'as':_0x2f5b5c['as'],'attributes':_0x2f5b5c[_0xd6b8('0x1f')],'include':_0x2f5b5c[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x2f5b5c[_0xd6b8('0x21')],function(_0xd64497){return{'model':db[_0xd64497['model']],'as':_0xd64497['as'],'attributes':_0xd64497['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xe')](function(_0x34c873){var _0x413e1d=[];for(var _0x698b5b=0x0;_0x698b5b<_0x34c873[_0xd6b8('0x38')];_0x698b5b+=0x1){_0x413e1d[_0xd6b8('0x3a')](_0x34c873[_0x698b5b][_0xd6b8('0x2a')](_0x45f447[_0xd6b8('0x28')],{'transaction':_0x1b4064}));}return BPromise[_0xd6b8('0x3b')](_0x413e1d);});})[_0xd6b8('0xe')](function(_0x337a02){logger[_0xd6b8('0xf')]('GetContactRecallMe',_0x45f447);logger[_0xd6b8('0x11')](_0xd6b8('0x46'),_0x45f447,JSON[_0xd6b8('0x14')](_0x337a02));_0xd4c40d(_0x337a02);})[_0xd6b8('0x19')](function(_0x51145d){logger['error']('GetContactRecallMe',_0x51145d[_0xd6b8('0x17')],_0x45f447);_0x3cf199(_0x4f265b['error'](0x1f4,_0x51145d[_0xd6b8('0x17')]));});});});};exports[_0xd6b8('0x48')]=function(_0x234a98){var _0xad71bf=this;return new Promise(function(_0x780fcb,_0x33785a){db[_0xd6b8('0x2d')][_0xd6b8('0x2e')]()[_0xd6b8('0xe')](function(_0x2e4a0c){return db['CmHopper'][_0xd6b8('0x30')]({'raw':_0x234a98[_0xd6b8('0x1c')]?_0x234a98[_0xd6b8('0x1c')][_0xd6b8('0x1d')]===undefined?!![]:![]:!![],'where':_0x234a98[_0xd6b8('0x1c')]?_0x234a98[_0xd6b8('0x1c')]['where']||null:null,'attributes':_0x234a98['options']?_0x234a98['options']['attributes']||null:null,'limit':_0x234a98[_0xd6b8('0x1c')]?_0x234a98['options'][_0xd6b8('0x20')]||null:null,'include':_0x234a98[_0xd6b8('0x1c')]?_0x234a98[_0xd6b8('0x1c')][_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x234a98[_0xd6b8('0x1c')][_0xd6b8('0x21')],function(_0x44da24){return{'model':db[_0x44da24[_0xd6b8('0x23')]],'as':_0x44da24['as'],'attributes':_0x44da24['as']===_0xd6b8('0x33')?_[_0xd6b8('0x34')](_0x2e4a0c):_0x44da24[_0xd6b8('0x1f')],'include':_0x44da24[_0xd6b8('0x21')]?_[_0xd6b8('0x22')](_0x44da24[_0xd6b8('0x21')],function(_0x1e859d){return{'model':db[_0x1e859d[_0xd6b8('0x23')]],'as':_0x1e859d['as'],'attributes':_0x1e859d['attributes'],'include':_0x1e859d['include']?_[_0xd6b8('0x22')](_0x1e859d[_0xd6b8('0x21')],function(_0x5dd62a){return{'model':db[_0x5dd62a[_0xd6b8('0x23')]],'as':_0x5dd62a['as'],'attributes':_0x5dd62a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6b8('0xe')](function(_0x5d7537){logger[_0xd6b8('0xf')](_0xd6b8('0x1a'),_0x234a98);logger['debug'](_0xd6b8('0x1a'),_0x234a98,JSON[_0xd6b8('0x14')](_0x5d7537));_0x780fcb(_0x5d7537);})[_0xd6b8('0x19')](function(_0x168f01){logger[_0xd6b8('0x15')]('GetCmHopper',_0x168f01['message'],_0x234a98);_0x33785a(_0xad71bf[_0xd6b8('0x15')](0x1f4,_0x168f01['message']));});});});}; \ No newline at end of file +var _0x84c2=['ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','where','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','order','UPDATE','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','CmHopperFinal','MoveContactManagedDialer','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','describe','LOCK','GetContactRecallMe','GetCmHopperPreview','Contact','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','include','map','model','find'];(function(_0x21354a,_0x3c4926){var _0x128fb6=function(_0x274772){while(--_0x274772){_0x21354a['push'](_0x21354a['shift']());}};_0x128fb6(++_0x3c4926);}(_0x84c2,0x109));var _0x284c=function(_0x3d14d4,_0x153742){_0x3d14d4=_0x3d14d4-0x0;var _0x16d6e4=_0x84c2[_0x3d14d4];return _0x16d6e4;};'use strict';var _=require(_0x284c('0x0'));var util=require(_0x284c('0x1'));var moment=require(_0x284c('0x2'));var BPromise=require(_0x284c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x284c('0x4'));var db=require(_0x284c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x284c('0x6'))(_0x284c('0x7'));var config=require(_0x284c('0x8'));var jayson=require(_0x284c('0x9'));var client=jayson[_0x284c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd22e,_0x1f309c,_0x22a48f){return new BPromise(function(_0x3a2166,_0x21d581){return client[_0x284c('0xb')](_0x4fd22e,_0x22a48f)[_0x284c('0xc')](function(_0x23b93d){logger[_0x284c('0xd')](_0x284c('0xe'),_0x1f309c,_0x284c('0xf'));logger[_0x284c('0x10')](_0x284c('0x11'),_0x1f309c,_0x284c('0xf'),JSON[_0x284c('0x12')](_0x23b93d));if(_0x23b93d[_0x284c('0x13')]){if(_0x23b93d[_0x284c('0x13')][_0x284c('0x14')]===0x1f4){logger[_0x284c('0x13')](_0x284c('0xe'),_0x1f309c,_0x23b93d[_0x284c('0x13')][_0x284c('0x15')]);return _0x21d581(_0x23b93d[_0x284c('0x13')][_0x284c('0x15')]);}logger[_0x284c('0x13')](_0x284c('0xe'),_0x1f309c,_0x23b93d[_0x284c('0x13')]['message']);return _0x3a2166(_0x23b93d[_0x284c('0x13')][_0x284c('0x15')]);}else{logger[_0x284c('0xd')](_0x284c('0xe'),_0x1f309c,'request\x20sent');_0x3a2166(_0x23b93d[_0x284c('0x16')][_0x284c('0x15')]);}})[_0x284c('0x17')](function(_0x43ad5f){logger['error'](_0x284c('0xe'),_0x1f309c,_0x43ad5f);_0x21d581(_0x43ad5f);});});}exports[_0x284c('0x18')]=function(_0x17bd83){var _0x1a4024=this;return new Promise(function(_0xc6d861,_0x177da4){return db[_0x284c('0x19')][_0x284c('0x1a')]({'raw':_0x17bd83[_0x284c('0x1b')]?_0x17bd83[_0x284c('0x1b')][_0x284c('0x1c')]===undefined?!![]:![]:!![],'where':_0x17bd83[_0x284c('0x1b')]?_0x17bd83[_0x284c('0x1b')]['where']||null:null,'attributes':_0x17bd83[_0x284c('0x1b')]?_0x17bd83['options'][_0x284c('0x1d')]||null:null,'limit':_0x17bd83[_0x284c('0x1b')]?_0x17bd83[_0x284c('0x1b')][_0x284c('0x1e')]||null:null,'include':_0x17bd83[_0x284c('0x1b')]?_0x17bd83['options'][_0x284c('0x1f')]?_[_0x284c('0x20')](_0x17bd83[_0x284c('0x1b')][_0x284c('0x1f')],function(_0x5c01fd){return{'model':db[_0x5c01fd[_0x284c('0x21')]],'as':_0x5c01fd['as'],'attributes':_0x5c01fd[_0x284c('0x1d')],'include':_0x5c01fd[_0x284c('0x1f')]?_['map'](_0x5c01fd[_0x284c('0x1f')],function(_0x942f5d){return{'model':db[_0x942f5d[_0x284c('0x21')]],'as':_0x942f5d['as'],'attributes':_0x942f5d[_0x284c('0x1d')],'include':_0x942f5d[_0x284c('0x1f')]?_[_0x284c('0x20')](_0x942f5d['include'],function(_0x1e69ad){return{'model':db[_0x1e69ad[_0x284c('0x21')]],'as':_0x1e69ad['as'],'attributes':_0x1e69ad[_0x284c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x220a70){logger['info']('GetCmHopper',_0x17bd83);logger[_0x284c('0x10')](_0x284c('0x18'),_0x17bd83,JSON[_0x284c('0x12')](_0x220a70));_0xc6d861(_0x220a70);})[_0x284c('0x17')](function(_0x453349){logger['error']('GetCmHopper',_0x453349['message'],_0x17bd83);_0x177da4(_0x1a4024['error'](0x1f4,_0x453349['message']));});});};exports['ShowCmHopper']=function(_0x12f68e){var _0x1af388=this;return new Promise(function(_0x29aaee,_0x3e1c56){return db[_0x284c('0x19')][_0x284c('0x22')]({'raw':_0x12f68e[_0x284c('0x1b')]?_0x12f68e[_0x284c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x12f68e[_0x284c('0x1b')]?_0x12f68e[_0x284c('0x1b')]['where']||null:null,'attributes':_0x12f68e[_0x284c('0x1b')]?_0x12f68e[_0x284c('0x1b')]['attributes']||null:null,'include':_0x12f68e[_0x284c('0x1b')]?_0x12f68e[_0x284c('0x1b')][_0x284c('0x1f')]?_[_0x284c('0x20')](_0x12f68e['options'][_0x284c('0x1f')],function(_0x49e782){return{'model':db[_0x49e782[_0x284c('0x21')]],'as':_0x49e782['as'],'attributes':_0x49e782[_0x284c('0x1d')],'include':_0x49e782['include']?_[_0x284c('0x20')](_0x49e782[_0x284c('0x1f')],function(_0x54933d){return{'model':db[_0x54933d[_0x284c('0x21')]],'as':_0x54933d['as'],'attributes':_0x54933d['attributes'],'include':_0x54933d['include']?_[_0x284c('0x20')](_0x54933d[_0x284c('0x1f')],function(_0x292c89){return{'model':db[_0x292c89['model']],'as':_0x292c89['as'],'attributes':_0x292c89[_0x284c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x169f0a){logger['info'](_0x284c('0x23'),_0x12f68e);logger[_0x284c('0x10')]('ShowCmHopper',_0x12f68e,JSON[_0x284c('0x12')](_0x169f0a));_0x29aaee(_0x169f0a);})[_0x284c('0x17')](function(_0x58a3dc){logger['error'](_0x284c('0x23'),_0x58a3dc[_0x284c('0x15')],_0x12f68e);_0x3e1c56(_0x1af388['error'](0x1f4,_0x58a3dc['message']));});});};exports[_0x284c('0x24')]=function(_0x57db80){var _0x1232d2=this;return new Promise(function(_0x17ddae,_0x3a55fc){return db['CmHopper'][_0x284c('0x25')](_0x57db80[_0x284c('0x26')],{'raw':_0x57db80['options']?_0x57db80[_0x284c('0x1b')][_0x284c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5383f7){logger[_0x284c('0xd')](_0x284c('0x24'),_0x57db80);logger[_0x284c('0x10')](_0x284c('0x24'),_0x57db80,JSON[_0x284c('0x12')](_0x5383f7));_0x17ddae(_0x5383f7);})['catch'](function(_0x5190e1){logger[_0x284c('0x13')](_0x284c('0x24'),_0x5190e1[_0x284c('0x15')],_0x57db80);_0x3a55fc(_0x1232d2[_0x284c('0x13')](0x1f4,_0x5190e1[_0x284c('0x15')]));});});};exports[_0x284c('0x27')]=function(_0x179d00){var _0x739505=this;return new Promise(function(_0x4192e1,_0xa290dd){return db[_0x284c('0x19')][_0x284c('0x28')](_0x179d00[_0x284c('0x26')],{'raw':_0x179d00[_0x284c('0x1b')]?_0x179d00[_0x284c('0x1b')][_0x284c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x179d00[_0x284c('0x1b')]?_0x179d00[_0x284c('0x1b')][_0x284c('0x29')]||null:null,'attributes':_0x179d00[_0x284c('0x1b')]?_0x179d00['options'][_0x284c('0x1d')]||null:null,'limit':_0x179d00['options']?_0x179d00[_0x284c('0x1b')][_0x284c('0x1e')]||null:null})[_0x284c('0xc')](function(_0x4aada9){logger[_0x284c('0xd')](_0x284c('0x27'),_0x179d00);logger[_0x284c('0x10')](_0x284c('0x27'),_0x179d00,JSON[_0x284c('0x12')](_0x4aada9));_0x4192e1(_0x4aada9);})[_0x284c('0x17')](function(_0x467e1e){logger[_0x284c('0x13')](_0x284c('0x27'),_0x467e1e['message'],_0x179d00);_0xa290dd(_0x739505[_0x284c('0x13')](0x1f4,_0x467e1e['message']));});});};exports[_0x284c('0x2a')]=function(_0x1e0c3a){var _0x1b3428=this;return new Promise(function(_0x3b318f,_0x448424){return db[_0x284c('0x19')][_0x284c('0x2b')]({'where':_0x1e0c3a[_0x284c('0x1b')]?_0x1e0c3a[_0x284c('0x1b')][_0x284c('0x29')]||null:null})['then'](function(_0x5eefb5){logger[_0x284c('0xd')](_0x284c('0x2a'),_0x1e0c3a);logger[_0x284c('0x10')](_0x284c('0x2a'),_0x1e0c3a,JSON[_0x284c('0x12')](_0x5eefb5));_0x3b318f(_0x5eefb5);})['catch'](function(_0xb89470){logger['error'](_0x284c('0x2a'),_0xb89470[_0x284c('0x15')],_0x1e0c3a);_0x448424(_0x1b3428['error'](0x1f4,_0xb89470['message']));});});};exports[_0x284c('0x2c')]=function(_0xda61a7){var _0x313370=this;return new Promise(function(_0x4750d7,_0x3bb63f){return db[_0x284c('0x2d')]['describe']()[_0x284c('0xc')](function(_0xf4a7f8){return db[_0x284c('0x2e')][_0x284c('0x2f')](function(_0x4bd610){return db[_0x284c('0x19')][_0x284c('0x1a')]({'where':_0xda61a7[_0x284c('0x1b')]?_0xda61a7[_0x284c('0x1b')][_0x284c('0x29')]||null:null,'attributes':_0xda61a7[_0x284c('0x1b')]?_0xda61a7[_0x284c('0x1b')][_0x284c('0x1d')]||null:null,'limit':_0xda61a7[_0x284c('0x1b')]?_0xda61a7[_0x284c('0x1b')][_0x284c('0x1e')]||null:null,'order':_0xda61a7[_0x284c('0x1b')]?_0xda61a7[_0x284c('0x1b')][_0x284c('0x30')]||null:null,'transaction':_0x4bd610,'lock':_0x4bd610['LOCK'][_0x284c('0x31')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x284c('0x32')](_0xf4a7f8)},{'model':db[_0x284c('0x33')],'as':_0x284c('0x34'),'attributes':['id',_0x284c('0x35'),_0x284c('0x36')]}]})[_0x284c('0xc')](function(_0x4f7855){var _0x4bac61=[];var _0x360b19=[];for(var _0x5bba96=0x0;_0x5bba96<_0x4f7855[_0x284c('0x37')];_0x5bba96+=0x1){var _0x4bb2f6=_0x4f7855[_0x5bba96][_0x284c('0x38')];if(_0x4bb2f6===null){_0x4bac61[_0x284c('0x39')](_0x4f7855[_0x5bba96][_0x284c('0x28')](_0xda61a7[_0x284c('0x26')],{'transaction':_0x4bd610}));}else if(!_0x360b19[_0x284c('0x3a')](_0x4bb2f6)){_0x360b19[_0x284c('0x39')](_0x4bb2f6);_0x4bac61['push'](_0x4f7855[_0x5bba96][_0x284c('0x28')](_0xda61a7[_0x284c('0x26')],{'transaction':_0x4bd610}));}}return BPromise[_0x284c('0x3b')](_0x4bac61);});})[_0x284c('0xc')](function(_0x74d40b){logger[_0x284c('0xd')](_0x284c('0x2c'),_0xda61a7);logger[_0x284c('0x10')](_0x284c('0x2c'),_0xda61a7,JSON[_0x284c('0x12')](_0x74d40b));_0x4750d7(_0x74d40b);})[_0x284c('0x17')](function(_0x352926){logger[_0x284c('0x13')]('GetContactDialer',_0x352926[_0x284c('0x15')],_0xda61a7);_0x3bb63f(_0x313370['error'](0x1f4,_0x352926[_0x284c('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0xa1b57c){var _0x589103=this;return new Promise(function(_0x5b267d,_0x1de58d){return db[_0x284c('0x2e')][_0x284c('0x2f')](function(_0x5ea3bb){return db[_0x284c('0x3c')][_0x284c('0x25')](_0xa1b57c['body'],{'raw':_0xa1b57c[_0x284c('0x1b')]?_0xa1b57c['options'][_0x284c('0x1c')]===undefined?!![]:![]:!![],'transaction':_0x5ea3bb})[_0x284c('0xc')](function(){return db[_0x284c('0x19')]['destroy']({'where':_0xa1b57c[_0x284c('0x1b')]?_0xa1b57c[_0x284c('0x1b')]['where']||null:null,'transaction':_0x5ea3bb});});})['then'](function(_0x3a96e9){logger['info'](_0x284c('0x3d'),_0xa1b57c);logger[_0x284c('0x10')](_0x284c('0x3d'),_0xa1b57c,JSON[_0x284c('0x12')](_0x3a96e9));_0x5b267d(_0x3a96e9);})[_0x284c('0x17')](function(_0x333d23){logger[_0x284c('0x13')](_0x284c('0x3d'),_0x333d23[_0x284c('0x15')],_0xa1b57c);_0x1de58d(_0x589103[_0x284c('0x13')](0x1f4,_0x333d23['message']));});});};exports['CountReScheduled']=function(_0x29946d){var _0x41e97b=this;return new Promise(function(_0x1353bb,_0x54a1d0){return db[_0x284c('0x19')][_0x284c('0x1a')]({'raw':_0x29946d[_0x284c('0x1b')]?_0x29946d['options'][_0x284c('0x1c')]===undefined?!![]:![]:!![],'where':_0x29946d[_0x284c('0x1b')]?_0x29946d[_0x284c('0x1b')][_0x284c('0x29')]||null:null,'attributes':[[db['sequelize']['fn'](_0x284c('0x3e'),db[_0x284c('0x2e')]['fn']('IF',db[_0x284c('0x2e')][_0x284c('0x3f')]('`scheduledat`\x20>=\x20'+util[_0x284c('0x40')](_0x284c('0x41'),moment()[_0x284c('0x40')](_0x284c('0x42')))+_0x284c('0x43')))),_0x284c('0x44')]]})[_0x284c('0xc')](function(_0x8240f9){logger[_0x284c('0xd')](_0x284c('0x45'),_0x29946d);logger['debug'](_0x284c('0x45'),_0x29946d,JSON[_0x284c('0x12')](_0x8240f9));_0x1353bb(_0x8240f9);})[_0x284c('0x17')](function(_0x57439c){logger[_0x284c('0x13')](_0x284c('0x45'),_0x57439c[_0x284c('0x15')],_0x29946d);_0x54a1d0(_0x41e97b[_0x284c('0x13')](0x1f4,_0x57439c['message']));});});};exports['GetContactRecallMe']=function(_0x444344){var _0xe787ea=this;return new Promise(function(_0x48284f,_0xfdbc38){return db[_0x284c('0x2d')][_0x284c('0x46')]()['then'](function(_0x8496cd){return db[_0x284c('0x2e')][_0x284c('0x2f')](function(_0x1c9977){return db[_0x284c('0x19')][_0x284c('0x1a')]({'where':_0x444344[_0x284c('0x1b')]?_0x444344['options'][_0x284c('0x29')]||null:null,'attributes':_0x444344[_0x284c('0x1b')]?_0x444344['options'][_0x284c('0x1d')]||null:null,'limit':0x1,'order':_0x444344[_0x284c('0x1b')]?_0x444344[_0x284c('0x1b')]['order']||null:null,'group':db[_0x284c('0x19')]['UserId'],'transaction':_0x1c9977,'lock':_0x1c9977[_0x284c('0x47')][_0x284c('0x31')],'include':_0x444344[_0x284c('0x1b')]?_0x444344['options'][_0x284c('0x1f')]?_['map'](_0x444344[_0x284c('0x1b')][_0x284c('0x1f')],function(_0x9d7cf4){return{'model':db[_0x9d7cf4['model']],'as':_0x9d7cf4['as'],'attributes':_0x9d7cf4[_0x284c('0x1d')],'include':_0x9d7cf4[_0x284c('0x1f')]?_['map'](_0x9d7cf4[_0x284c('0x1f')],function(_0x540556){return{'model':db[_0x540556[_0x284c('0x21')]],'as':_0x540556['as'],'attributes':_0x540556[_0x284c('0x1d')],'include':_0x540556['include']?_['map'](_0x540556[_0x284c('0x1f')],function(_0x38c32b){return{'model':db[_0x38c32b[_0x284c('0x21')]],'as':_0x38c32b['as'],'attributes':_0x38c32b[_0x284c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x284c('0xc')](function(_0x319493){var _0x4f630c=[];for(var _0x202939=0x0;_0x202939<_0x319493['length'];_0x202939+=0x1){_0x4f630c[_0x284c('0x39')](_0x319493[_0x202939][_0x284c('0x28')](_0x444344[_0x284c('0x26')],{'transaction':_0x1c9977}));}return BPromise['all'](_0x4f630c);});})[_0x284c('0xc')](function(_0x21e114){logger['info'](_0x284c('0x48'),_0x444344);logger['debug'](_0x284c('0x48'),_0x444344,JSON['stringify'](_0x21e114));_0x48284f(_0x21e114);})[_0x284c('0x17')](function(_0x2712c4){logger[_0x284c('0x13')]('GetContactRecallMe',_0x2712c4[_0x284c('0x15')],_0x444344);_0xfdbc38(_0xe787ea[_0x284c('0x13')](0x1f4,_0x2712c4['message']));});});});};exports[_0x284c('0x49')]=function(_0x5c836b){var _0x2b8520=this;return new Promise(function(_0x138b6d,_0x5f1420){db[_0x284c('0x2d')][_0x284c('0x46')]()['then'](function(_0xd24c47){return db['CmHopper'][_0x284c('0x1a')]({'raw':_0x5c836b[_0x284c('0x1b')]?_0x5c836b[_0x284c('0x1b')][_0x284c('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c836b[_0x284c('0x1b')]?_0x5c836b[_0x284c('0x1b')]['where']||null:null,'attributes':_0x5c836b[_0x284c('0x1b')]?_0x5c836b[_0x284c('0x1b')]['attributes']||null:null,'limit':_0x5c836b[_0x284c('0x1b')]?_0x5c836b[_0x284c('0x1b')][_0x284c('0x1e')]||null:null,'include':_0x5c836b[_0x284c('0x1b')]?_0x5c836b[_0x284c('0x1b')][_0x284c('0x1f')]?_[_0x284c('0x20')](_0x5c836b[_0x284c('0x1b')][_0x284c('0x1f')],function(_0x11094f){return{'model':db[_0x11094f[_0x284c('0x21')]],'as':_0x11094f['as'],'attributes':_0x11094f['as']===_0x284c('0x4a')?_[_0x284c('0x32')](_0xd24c47):_0x11094f[_0x284c('0x1d')],'include':_0x11094f[_0x284c('0x1f')]?_['map'](_0x11094f['include'],function(_0x351e0b){return{'model':db[_0x351e0b[_0x284c('0x21')]],'as':_0x351e0b['as'],'attributes':_0x351e0b['attributes'],'include':_0x351e0b[_0x284c('0x1f')]?_[_0x284c('0x20')](_0x351e0b['include'],function(_0x1e8803){return{'model':db[_0x1e8803['model']],'as':_0x1e8803['as'],'attributes':_0x1e8803[_0x284c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x284c('0xc')](function(_0x19c2e4){logger['info'](_0x284c('0x18'),_0x5c836b);logger[_0x284c('0x10')](_0x284c('0x18'),_0x5c836b,JSON[_0x284c('0x12')](_0x19c2e4));_0x138b6d(_0x19c2e4);})[_0x284c('0x17')](function(_0x934e77){logger[_0x284c('0x13')](_0x284c('0x18'),_0x934e77[_0x284c('0x15')],_0x5c836b);_0x5f1420(_0x2b8520['error'](0x1f4,_0x934e77[_0x284c('0x15')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 1fc5336..00ad1ea 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 _0x13a9=['create','/preview','getPreview','put','update','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','describe','/opencontacts','getOpenContacts','/:id','post'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0x13a9,0x132));var _0x913a=function(_0x49986a,_0x368cf5){_0x49986a=_0x49986a-0x0;var _0x97a9f2=_0x13a9[_0x49986a];return _0x97a9f2;};'use strict';var multer=require('multer');var util=require(_0x913a('0x0'));var path=require('path');var timeout=require(_0x913a('0x1'));var express=require(_0x913a('0x2'));var router=express['Router']();var fs_extra=require(_0x913a('0x3'));var auth=require(_0x913a('0x4'));var interaction=require(_0x913a('0x5'));var config=require(_0x913a('0x6'));var controller=require(_0x913a('0x7'));router['get']('/',auth[_0x913a('0x8')](),controller[_0x913a('0x9')]);router[_0x913a('0xa')]('/describe',auth[_0x913a('0x8')](),controller[_0x913a('0xb')]);router[_0x913a('0xa')](_0x913a('0xc'),auth[_0x913a('0x8')](),controller[_0x913a('0xd')]);router[_0x913a('0xa')](_0x913a('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x913a('0xf')]('/',auth[_0x913a('0x8')](),controller[_0x913a('0x10')]);router[_0x913a('0xf')](_0x913a('0x11'),auth[_0x913a('0x8')](),controller[_0x913a('0x12')]);router[_0x913a('0x13')](_0x913a('0xe'),auth[_0x913a('0x8')](),controller[_0x913a('0x14')]);router[_0x913a('0x15')](_0x913a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x913a('0x16')]=router; \ No newline at end of file +var _0xadfa=['index','/describe','describe','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0xb517fb,_0x1ae8bc){var _0x348a16=function(_0x4afe31){while(--_0x4afe31){_0xb517fb['push'](_0xb517fb['shift']());}};_0x348a16(++_0x1ae8bc);}(_0xadfa,0x13a));var _0xaadf=function(_0x427503,_0x46ce8e){_0x427503=_0x427503-0x0;var _0x13e4d5=_0xadfa[_0x427503];return _0x13e4d5;};'use strict';var multer=require(_0xaadf('0x0'));var util=require(_0xaadf('0x1'));var path=require(_0xaadf('0x2'));var timeout=require(_0xaadf('0x3'));var express=require(_0xaadf('0x4'));var router=express[_0xaadf('0x5')]();var fs_extra=require(_0xaadf('0x6'));var auth=require(_0xaadf('0x7'));var interaction=require(_0xaadf('0x8'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0xaadf('0x9')]('/',auth[_0xaadf('0xa')](),controller[_0xaadf('0xb')]);router['get'](_0xaadf('0xc'),auth[_0xaadf('0xa')](),controller[_0xaadf('0xd')]);router['get']('/opencontacts',auth['isAuthenticated'](),controller[_0xaadf('0xe')]);router['get'](_0xaadf('0xf'),auth['isAuthenticated'](),controller[_0xaadf('0x10')]);router[_0xaadf('0x11')]('/',auth['isAuthenticated'](),controller[_0xaadf('0x12')]);router[_0xaadf('0x11')](_0xaadf('0x13'),auth[_0xaadf('0xa')](),controller[_0xaadf('0x14')]);router[_0xaadf('0x15')](_0xaadf('0xf'),auth['isAuthenticated'](),controller[_0xaadf('0x16')]);router['delete'](_0xaadf('0xf'),auth['isAuthenticated'](),controller[_0xaadf('0x17')]);module[_0xaadf('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 811cab4..89f0cf5 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 _0x1a0b=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x1f89d4,_0x1d6de0){_0x1f89d4=_0x1f89d4-0x0;var _0x4b9640=_0x1a0b[_0x1f89d4];return _0x4b9640;};'use strict';var moment=require(_0xb1a0('0x0'));var Sequelize=require('sequelize');module[_0xb1a0('0x1')]={'phone':{'type':Sequelize[_0xb1a0('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb1a0('0x3')],'unique':_0xb1a0('0x4')},'ListId':{'type':Sequelize[_0xb1a0('0x3')],'unique':_0xb1a0('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb1a0('0x3')],'unique':_0xb1a0('0x4')}}; \ No newline at end of file +var _0x5687=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x5687,0x1ce));var _0x7568=function(_0x43b2b6,_0x4aa066){_0x43b2b6=_0x43b2b6-0x0;var _0x2b17ad=_0x5687[_0x43b2b6];return _0x2b17ad;};'use strict';var moment=require(_0x7568('0x0'));var Sequelize=require(_0x7568('0x1'));module[_0x7568('0x2')]={'phone':{'type':Sequelize[_0x7568('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7568('0x4')],'unique':_0x7568('0x5')},'ListId':{'type':Sequelize[_0x7568('0x4')],'unique':_0x7568('0x5')},'VoiceQueueId':{'type':Sequelize[_0x7568('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 977324c..b829104 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 _0x286e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x426d21,_0x1e9415){var _0x33ca32=function(_0x319870){while(--_0x319870){_0x426d21['push'](_0x426d21['shift']());}};_0x33ca32(++_0x1e9415);}(_0x286e,0x85));var _0xe286=function(_0x2f1047,_0x516ee1){_0x2f1047=_0x2f1047-0x0;var _0x24f11a=_0x286e[_0x2f1047];return _0x24f11a;};'use strict';var emlformat=require(_0xe286('0x0'));var rimraf=require(_0xe286('0x1'));var zipdir=require(_0xe286('0x2'));var jsonpatch=require(_0xe286('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe286('0x4'));var Mustache=require(_0xe286('0x5'));var util=require(_0xe286('0x6'));var path=require('path');var sox=require(_0xe286('0x7'));var csv=require('to-csv');var ejs=require(_0xe286('0x8'));var fs=require('fs');var fs_extra=require(_0xe286('0x9'));var _=require('lodash');var squel=require(_0xe286('0xa'));var crypto=require(_0xe286('0xb'));var jsforce=require(_0xe286('0xc'));var deskjs=require(_0xe286('0xd'));var toCsv=require(_0xe286('0xe'));var querystring=require(_0xe286('0xf'));var Papa=require(_0xe286('0x10'));var Redis=require(_0xe286('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe286('0x12'));var as=require(_0xe286('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe286('0x14'))(_0xe286('0x15'));var utils=require(_0xe286('0x16'));var config=require(_0xe286('0x17'));var licenseUtil=require(_0xe286('0x18'));var db=require(_0xe286('0x19'))['db'];function respondWithStatusCode(_0x13a5d3,_0x48830f){_0x48830f=_0x48830f||0xcc;return function(_0x9bb20a){if(_0x9bb20a){return _0x13a5d3[_0xe286('0x1a')](_0x48830f);}return _0x13a5d3['status'](_0x48830f)[_0xe286('0x1b')]();};}function respondWithResult(_0x55692a,_0x1c2a33){_0x1c2a33=_0x1c2a33||0xc8;return function(_0x260820){if(_0x260820){return _0x55692a['status'](_0x1c2a33)[_0xe286('0x1c')](_0x260820);}};}function respondWithFilteredResult(_0xd02c9a,_0x23d1e0){return function(_0x4afd13){if(_0x4afd13){var _0x2e30c7=typeof _0x23d1e0[_0xe286('0x1d')]===_0xe286('0x1e')&&typeof _0x23d1e0[_0xe286('0x1f')]===_0xe286('0x1e');var _0x5abf43=_0x4afd13[_0xe286('0x20')];var _0x582d39=_0x2e30c7?0x0:_0x23d1e0[_0xe286('0x1d')];var _0x3f483e=_0x2e30c7?_0x4afd13[_0xe286('0x20')]:_0x23d1e0['offset']+_0x23d1e0['limit'];var _0xeb4289;if(_0x3f483e>=_0x5abf43){_0x3f483e=_0x5abf43;_0xeb4289=0xc8;}else{_0xeb4289=0xce;}_0xd02c9a[_0xe286('0x21')](_0xeb4289);return _0xd02c9a[_0xe286('0x22')]('Content-Range',_0x582d39+'-'+_0x3f483e+'/'+_0x5abf43)[_0xe286('0x1c')](_0x4afd13);}return null;};}function patchUpdates(_0xd318ad){return function(_0x58cd92){try{jsonpatch[_0xe286('0x23')](_0x58cd92,_0xd318ad,!![]);}catch(_0x31ff9c){return BPromise[_0xe286('0x24')](_0x31ff9c);}return _0x58cd92[_0xe286('0x25')]();};}function saveUpdates(_0x202157,_0x3b285f){return function(_0x506163){if(_0x506163){return _0x506163[_0xe286('0x26')](_0x202157)[_0xe286('0x27')](function(_0x2e2cfa){return _0x2e2cfa;});}return null;};}function removeEntity(_0x176479,_0x117185){return function(_0x1c6721){if(_0x1c6721){return _0x1c6721[_0xe286('0x28')]()[_0xe286('0x27')](function(){_0x176479[_0xe286('0x21')](0xcc)[_0xe286('0x1b')]();});}};}function handleEntityNotFound(_0x93c89,_0x391ee7){return function(_0x5c00de){if(!_0x5c00de){_0x93c89[_0xe286('0x1a')](0x194);}return _0x5c00de;};}function handleError(_0x5dfb29,_0x27f6ce){_0x27f6ce=_0x27f6ce||0x1f4;return function(_0x47fa50){logger[_0xe286('0x29')](_0x47fa50[_0xe286('0x2a')]);if(_0x47fa50[_0xe286('0x2b')]){delete _0x47fa50[_0xe286('0x2b')];}_0x5dfb29['status'](_0x27f6ce)[_0xe286('0x2c')](_0x47fa50);};}exports[_0xe286('0x2d')]=function(_0x2f6345,_0x256661){var _0x236d20={},_0x176477={},_0x4632c8={'count':0x0,'rows':[]};var _0x51ece5=_['map'](db[_0xe286('0x2e')][_0xe286('0x2f')],function(_0x2cf479){return{'name':_0x2cf479[_0xe286('0x30')],'type':_0x2cf479[_0xe286('0x31')][_0xe286('0x32')]};});_0x176477[_0xe286('0x33')]=_[_0xe286('0x34')](_0x51ece5,_0xe286('0x2b'));_0x176477[_0xe286('0x35')]=_[_0xe286('0x36')](_0x2f6345[_0xe286('0x35')]);_0x176477[_0xe286('0x37')]=_[_0xe286('0x38')](_0x176477[_0xe286('0x33')],_0x176477[_0xe286('0x35')]);_0x236d20[_0xe286('0x39')]=_['intersection'](_0x176477['model'],qs[_0xe286('0x3a')](_0x2f6345[_0xe286('0x35')]['fields']));_0x236d20[_0xe286('0x39')]=_0x236d20[_0xe286('0x39')][_0xe286('0x3b')]?_0x236d20[_0xe286('0x39')]:_0x176477[_0xe286('0x33')];if(!_0x2f6345[_0xe286('0x35')][_0xe286('0x3c')](_0xe286('0x3d'))){_0x236d20[_0xe286('0x1f')]=qs[_0xe286('0x1f')](_0x2f6345[_0xe286('0x35')][_0xe286('0x1f')]);_0x236d20[_0xe286('0x1d')]=qs[_0xe286('0x1d')](_0x2f6345['query'][_0xe286('0x1d')]);}_0x236d20['order']=qs['sort'](_0x2f6345[_0xe286('0x35')][_0xe286('0x3e')]);_0x236d20[_0xe286('0x3f')]=qs['filters'](_[_0xe286('0x40')](_0x2f6345['query'],_0x176477['filters']),_0x51ece5);if(_0x2f6345['query']['filter']){_0x236d20[_0xe286('0x3f')]=_['merge'](_0x236d20[_0xe286('0x3f')],{'$or':_[_0xe286('0x34')](_0x51ece5,function(_0x413138){if(_0x413138[_0xe286('0x31')]!=='VIRTUAL'){var _0xf8e032={};_0xf8e032[_0x413138['name']]={'$like':'%'+_0x2f6345['query'][_0xe286('0x41')]+'%'};return _0xf8e032;}})});}_0x236d20=_[_0xe286('0x42')]({},_0x236d20,_0x2f6345[_0xe286('0x43')]);var _0x546837={'where':_0x236d20[_0xe286('0x3f')]};return db['CmHopperBlack'][_0xe286('0x20')](_0x546837)[_0xe286('0x27')](function(_0x1eb0b3){_0x4632c8[_0xe286('0x20')]=_0x1eb0b3;if(_0x2f6345[_0xe286('0x35')]['includeAll']){_0x236d20[_0xe286('0x44')]=[{'all':!![]}];}return db[_0xe286('0x2e')][_0xe286('0x45')](_0x236d20);})[_0xe286('0x27')](function(_0x40e17b){_0x4632c8[_0xe286('0x46')]=_0x40e17b;return _0x4632c8;})[_0xe286('0x27')](respondWithFilteredResult(_0x256661,_0x236d20))[_0xe286('0x47')](handleError(_0x256661,null));};exports[_0xe286('0x48')]=function(_0x1d3ec4,_0x1f6564){var _0x15c927={'raw':!![],'where':{'id':_0x1d3ec4['params']['id']}},_0x105b59={};_0x105b59[_0xe286('0x33')]=_['keys'](db[_0xe286('0x2e')]['rawAttributes']);_0x105b59['query']=_['keys'](_0x1d3ec4[_0xe286('0x35')]);_0x105b59[_0xe286('0x37')]=_['intersection'](_0x105b59[_0xe286('0x33')],_0x105b59[_0xe286('0x35')]);_0x15c927[_0xe286('0x39')]=_[_0xe286('0x38')](_0x105b59['model'],qs[_0xe286('0x3a')](_0x1d3ec4[_0xe286('0x35')][_0xe286('0x3a')]));_0x15c927['attributes']=_0x15c927[_0xe286('0x39')][_0xe286('0x3b')]?_0x15c927[_0xe286('0x39')]:_0x105b59[_0xe286('0x33')];if(_0x1d3ec4[_0xe286('0x35')][_0xe286('0x49')]){_0x15c927[_0xe286('0x44')]=[{'all':!![]}];}_0x15c927=_[_0xe286('0x42')]({},_0x15c927,_0x1d3ec4[_0xe286('0x43')]);return db[_0xe286('0x2e')]['find'](_0x15c927)[_0xe286('0x27')](handleEntityNotFound(_0x1f6564,null))[_0xe286('0x27')](respondWithResult(_0x1f6564,null))[_0xe286('0x47')](handleError(_0x1f6564,null));};exports[_0xe286('0x26')]=function(_0x14b362,_0x7c014d){if(_0x14b362['body']['id']){delete _0x14b362[_0xe286('0x4a')]['id'];}return db[_0xe286('0x2e')]['find']({'where':{'id':_0x14b362['params']['id']}})[_0xe286('0x27')](handleEntityNotFound(_0x7c014d,null))['then'](saveUpdates(_0x14b362[_0xe286('0x4a')],null))[_0xe286('0x27')](respondWithResult(_0x7c014d,null))[_0xe286('0x47')](handleError(_0x7c014d,null));};exports[_0xe286('0x28')]=function(_0x217d9d,_0x34035d){return db[_0xe286('0x2e')][_0xe286('0x4b')]({'where':{'id':_0x217d9d[_0xe286('0x4c')]['id']}})[_0xe286('0x27')](handleEntityNotFound(_0x34035d,null))['then'](removeEntity(_0x34035d,null))[_0xe286('0x47')](handleError(_0x34035d,null));};exports[_0xe286('0x4d')]=function(_0x46783f,_0x46dadd){return db[_0xe286('0x2e')][_0xe286('0x4d')]()[_0xe286('0x27')](respondWithResult(_0x46dadd,null))[_0xe286('0x47')](handleError(_0x46dadd,null));}; \ No newline at end of file +var _0xbfc6=['params','rawAttributes','filters','fields','includeAll','find','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','include','findAll','then','rows','catch','show'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0xbfc6,0xea));var _0x6bfc=function(_0xf2738b,_0xd4bc00){_0xf2738b=_0xf2738b-0x0;var _0x1f12d0=_0xbfc6[_0xf2738b];return _0x1f12d0;};'use strict';var emlformat=require(_0x6bfc('0x0'));var rimraf=require(_0x6bfc('0x1'));var zipdir=require(_0x6bfc('0x2'));var jsonpatch=require(_0x6bfc('0x3'));var rp=require(_0x6bfc('0x4'));var moment=require(_0x6bfc('0x5'));var BPromise=require(_0x6bfc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6bfc('0x7'));var sox=require(_0x6bfc('0x8'));var csv=require(_0x6bfc('0x9'));var ejs=require(_0x6bfc('0xa'));var fs=require('fs');var fs_extra=require(_0x6bfc('0xb'));var _=require(_0x6bfc('0xc'));var squel=require(_0x6bfc('0xd'));var crypto=require(_0x6bfc('0xe'));var jsforce=require(_0x6bfc('0xf'));var deskjs=require(_0x6bfc('0x10'));var toCsv=require(_0x6bfc('0x9'));var querystring=require('querystring');var Papa=require(_0x6bfc('0x11'));var Redis=require(_0x6bfc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6bfc('0x13'));var as=require(_0x6bfc('0x14'));var hardwareService=require(_0x6bfc('0x15'));var logger=require(_0x6bfc('0x16'))('api');var utils=require(_0x6bfc('0x17'));var config=require(_0x6bfc('0x18'));var licenseUtil=require(_0x6bfc('0x19'));var db=require(_0x6bfc('0x1a'))['db'];function respondWithStatusCode(_0x535b18,_0x360131){_0x360131=_0x360131||0xcc;return function(_0x2534b4){if(_0x2534b4){return _0x535b18[_0x6bfc('0x1b')](_0x360131);}return _0x535b18[_0x6bfc('0x1c')](_0x360131)[_0x6bfc('0x1d')]();};}function respondWithResult(_0x1e9ba4,_0x4a16b1){_0x4a16b1=_0x4a16b1||0xc8;return function(_0x23fc08){if(_0x23fc08){return _0x1e9ba4[_0x6bfc('0x1c')](_0x4a16b1)[_0x6bfc('0x1e')](_0x23fc08);}};}function respondWithFilteredResult(_0x49e2cc,_0x5a5a9a){return function(_0x43692d){if(_0x43692d){var _0x1631f2=typeof _0x5a5a9a[_0x6bfc('0x1f')]===_0x6bfc('0x20')&&typeof _0x5a5a9a['limit']===_0x6bfc('0x20');var _0x49968e=_0x43692d[_0x6bfc('0x21')];var _0x1b8a4e=_0x1631f2?0x0:_0x5a5a9a['offset'];var _0x3f338b=_0x1631f2?_0x43692d['count']:_0x5a5a9a[_0x6bfc('0x1f')]+_0x5a5a9a[_0x6bfc('0x22')];var _0xb2663b;if(_0x3f338b>=_0x49968e){_0x3f338b=_0x49968e;_0xb2663b=0xc8;}else{_0xb2663b=0xce;}_0x49e2cc[_0x6bfc('0x1c')](_0xb2663b);return _0x49e2cc['set'](_0x6bfc('0x23'),_0x1b8a4e+'-'+_0x3f338b+'/'+_0x49968e)['json'](_0x43692d);}return null;};}function patchUpdates(_0x3c0ab2){return function(_0x1ef2ad){try{jsonpatch['apply'](_0x1ef2ad,_0x3c0ab2,!![]);}catch(_0x3fc3f6){return BPromise[_0x6bfc('0x24')](_0x3fc3f6);}return _0x1ef2ad[_0x6bfc('0x25')]();};}function saveUpdates(_0x3cf8d9,_0x329b58){return function(_0x1fe35f){if(_0x1fe35f){return _0x1fe35f['update'](_0x3cf8d9)['then'](function(_0x5d897c){return _0x5d897c;});}return null;};}function removeEntity(_0x392541,_0x4b27dd){return function(_0xcca899){if(_0xcca899){return _0xcca899['destroy']()['then'](function(){_0x392541[_0x6bfc('0x1c')](0xcc)[_0x6bfc('0x1d')]();});}};}function handleEntityNotFound(_0x1758da,_0x1d7ba0){return function(_0x56ea9c){if(!_0x56ea9c){_0x1758da['sendStatus'](0x194);}return _0x56ea9c;};}function handleError(_0x4c942f,_0x5ea25f){_0x5ea25f=_0x5ea25f||0x1f4;return function(_0x46cb60){logger['error'](_0x46cb60[_0x6bfc('0x26')]);if(_0x46cb60[_0x6bfc('0x27')]){delete _0x46cb60['name'];}_0x4c942f[_0x6bfc('0x1c')](_0x5ea25f)[_0x6bfc('0x28')](_0x46cb60);};}exports[_0x6bfc('0x29')]=function(_0x5b2afc,_0x46a6ea){var _0x582997={},_0x2b37bd={},_0x2c9b86={'count':0x0,'rows':[]};var _0x2476b2=_[_0x6bfc('0x2a')](db['CmHopperBlack']['rawAttributes'],function(_0x57dd97){return{'name':_0x57dd97['fieldName'],'type':_0x57dd97[_0x6bfc('0x2b')][_0x6bfc('0x2c')]};});_0x2b37bd[_0x6bfc('0x2d')]=_[_0x6bfc('0x2a')](_0x2476b2,_0x6bfc('0x27'));_0x2b37bd[_0x6bfc('0x2e')]=_[_0x6bfc('0x2f')](_0x5b2afc['query']);_0x2b37bd['filters']=_['intersection'](_0x2b37bd[_0x6bfc('0x2d')],_0x2b37bd[_0x6bfc('0x2e')]);_0x582997['attributes']=_[_0x6bfc('0x30')](_0x2b37bd[_0x6bfc('0x2d')],qs['fields'](_0x5b2afc['query']['fields']));_0x582997[_0x6bfc('0x31')]=_0x582997['attributes'][_0x6bfc('0x32')]?_0x582997[_0x6bfc('0x31')]:_0x2b37bd[_0x6bfc('0x2d')];if(!_0x5b2afc[_0x6bfc('0x2e')][_0x6bfc('0x33')]('nolimit')){_0x582997[_0x6bfc('0x22')]=qs['limit'](_0x5b2afc[_0x6bfc('0x2e')][_0x6bfc('0x22')]);_0x582997['offset']=qs['offset'](_0x5b2afc[_0x6bfc('0x2e')]['offset']);}_0x582997['order']=qs['sort'](_0x5b2afc[_0x6bfc('0x2e')][_0x6bfc('0x34')]);_0x582997[_0x6bfc('0x35')]=qs['filters'](_[_0x6bfc('0x36')](_0x5b2afc['query'],_0x2b37bd['filters']),_0x2476b2);if(_0x5b2afc[_0x6bfc('0x2e')][_0x6bfc('0x37')]){_0x582997[_0x6bfc('0x35')]=_[_0x6bfc('0x38')](_0x582997[_0x6bfc('0x35')],{'$or':_[_0x6bfc('0x2a')](_0x2476b2,function(_0x3f8f04){if(_0x3f8f04[_0x6bfc('0x2b')]!==_0x6bfc('0x39')){var _0xd96ab6={};_0xd96ab6[_0x3f8f04[_0x6bfc('0x27')]]={'$like':'%'+_0x5b2afc[_0x6bfc('0x2e')][_0x6bfc('0x37')]+'%'};return _0xd96ab6;}})});}_0x582997=_['merge']({},_0x582997,_0x5b2afc[_0x6bfc('0x3a')]);var _0x181ea1={'where':_0x582997[_0x6bfc('0x35')]};return db[_0x6bfc('0x3b')][_0x6bfc('0x21')](_0x181ea1)['then'](function(_0x30eac9){_0x2c9b86['count']=_0x30eac9;if(_0x5b2afc['query']['includeAll']){_0x582997[_0x6bfc('0x3c')]=[{'all':!![]}];}return db[_0x6bfc('0x3b')][_0x6bfc('0x3d')](_0x582997);})[_0x6bfc('0x3e')](function(_0x454d3e){_0x2c9b86[_0x6bfc('0x3f')]=_0x454d3e;return _0x2c9b86;})['then'](respondWithFilteredResult(_0x46a6ea,_0x582997))[_0x6bfc('0x40')](handleError(_0x46a6ea,null));};exports[_0x6bfc('0x41')]=function(_0x577a89,_0x1afbe0){var _0x1bbec1={'raw':!![],'where':{'id':_0x577a89[_0x6bfc('0x42')]['id']}},_0x20255c={};_0x20255c[_0x6bfc('0x2d')]=_['keys'](db['CmHopperBlack'][_0x6bfc('0x43')]);_0x20255c[_0x6bfc('0x2e')]=_[_0x6bfc('0x2f')](_0x577a89[_0x6bfc('0x2e')]);_0x20255c[_0x6bfc('0x44')]=_[_0x6bfc('0x30')](_0x20255c['model'],_0x20255c[_0x6bfc('0x2e')]);_0x1bbec1[_0x6bfc('0x31')]=_[_0x6bfc('0x30')](_0x20255c['model'],qs['fields'](_0x577a89[_0x6bfc('0x2e')][_0x6bfc('0x45')]));_0x1bbec1[_0x6bfc('0x31')]=_0x1bbec1['attributes'][_0x6bfc('0x32')]?_0x1bbec1[_0x6bfc('0x31')]:_0x20255c[_0x6bfc('0x2d')];if(_0x577a89[_0x6bfc('0x2e')][_0x6bfc('0x46')]){_0x1bbec1['include']=[{'all':!![]}];}_0x1bbec1=_[_0x6bfc('0x38')]({},_0x1bbec1,_0x577a89[_0x6bfc('0x3a')]);return db[_0x6bfc('0x3b')][_0x6bfc('0x47')](_0x1bbec1)[_0x6bfc('0x3e')](handleEntityNotFound(_0x1afbe0,null))[_0x6bfc('0x3e')](respondWithResult(_0x1afbe0,null))['catch'](handleError(_0x1afbe0,null));};exports['update']=function(_0x3b8588,_0x80b5a8){if(_0x3b8588[_0x6bfc('0x48')]['id']){delete _0x3b8588[_0x6bfc('0x48')]['id'];}return db[_0x6bfc('0x3b')][_0x6bfc('0x47')]({'where':{'id':_0x3b8588[_0x6bfc('0x42')]['id']}})[_0x6bfc('0x3e')](handleEntityNotFound(_0x80b5a8,null))['then'](saveUpdates(_0x3b8588['body'],null))[_0x6bfc('0x3e')](respondWithResult(_0x80b5a8,null))[_0x6bfc('0x40')](handleError(_0x80b5a8,null));};exports[_0x6bfc('0x49')]=function(_0x76e1bc,_0x5e906f){return db[_0x6bfc('0x3b')][_0x6bfc('0x47')]({'where':{'id':_0x76e1bc[_0x6bfc('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e906f,null))['then'](removeEntity(_0x5e906f,null))['catch'](handleError(_0x5e906f,null));};exports[_0x6bfc('0x4a')]=function(_0x452aab,_0x10b756){return db[_0x6bfc('0x3b')]['describe']()[_0x6bfc('0x3e')](respondWithResult(_0x10b756,null))[_0x6bfc('0x40')](handleError(_0x10b756,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 67f0a59..2ea0509 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 _0x6133=['moment','bluebird','request-promise','path','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x546dea,_0x385221){var _0xb9451=function(_0x34f354){while(--_0x34f354){_0x546dea['push'](_0x546dea['shift']());}};_0xb9451(++_0x385221);}(_0x6133,0xed));var _0x3613=function(_0xd10088,_0x35153c){_0xd10088=_0xd10088-0x0;var _0x1fbfb3=_0x6133[_0xd10088];return _0x1fbfb3;};'use strict';var _=require(_0x3613('0x0'));var util=require(_0x3613('0x1'));var logger=require(_0x3613('0x2'))('api');var moment=require(_0x3613('0x3'));var BPromise=require(_0x3613('0x4'));var rp=require(_0x3613('0x5'));var fs=require('fs');var path=require(_0x3613('0x6'));var rimraf=require('rimraf');var config=require(_0x3613('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x3613('0x8')]=function(_0x210a4e,_0x895cb7){return _0x210a4e[_0x3613('0x9')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x487f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','util','../../config/logger'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x487f,0x10f));var _0xf487=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x487f[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require(_0xf487('0x0'));var logger=require(_0xf487('0x1'))(_0xf487('0x2'));var moment=require(_0xf487('0x3'));var BPromise=require(_0xf487('0x4'));var rp=require(_0xf487('0x5'));var fs=require('fs');var path=require(_0xf487('0x6'));var rimraf=require(_0xf487('0x7'));var config=require(_0xf487('0x8'));var attributes=require(_0xf487('0x9'));module[_0xf487('0xa')]=function(_0x1abc86,_0x2b0a9f){return _0x1abc86['define'](_0xf487('0xb'),attributes,{'tableName':_0xf487('0xc'),'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 2cdf857..0b2a2de 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 _0x2b5f=['then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','map','include','model','attributes','debug','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request'];(function(_0x17e151,_0x5917ee){var _0x2fa985=function(_0x4a3dc1){while(--_0x4a3dc1){_0x17e151['push'](_0x17e151['shift']());}};_0x2fa985(++_0x5917ee);}(_0x2b5f,0x168));var _0xf2b5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2b5f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xf2b5('0x0'));var moment=require(_0xf2b5('0x1'));var BPromise=require(_0xf2b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2b5('0x3'));var db=require(_0xf2b5('0x4'))['db'];var utils=require(_0xf2b5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf2b5('0x6'));var client=jayson[_0xf2b5('0x7')][_0xf2b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x337749,_0x569c45,_0x7a304d){return new BPromise(function(_0x4aeac3,_0x18a345){return client[_0xf2b5('0x9')](_0x337749,_0x7a304d)[_0xf2b5('0xa')](function(_0x53f246){logger[_0xf2b5('0xb')](_0xf2b5('0xc'),_0x569c45,_0xf2b5('0xd'));logger['debug'](_0xf2b5('0xe'),_0x569c45,_0xf2b5('0xd'),JSON[_0xf2b5('0xf')](_0x53f246));if(_0x53f246['error']){if(_0x53f246[_0xf2b5('0x10')]['code']===0x1f4){logger[_0xf2b5('0x10')](_0xf2b5('0xc'),_0x569c45,_0x53f246[_0xf2b5('0x10')]['message']);return _0x18a345(_0x53f246[_0xf2b5('0x10')][_0xf2b5('0x11')]);}logger[_0xf2b5('0x10')](_0xf2b5('0xc'),_0x569c45,_0x53f246[_0xf2b5('0x10')]['message']);return _0x4aeac3(_0x53f246[_0xf2b5('0x10')][_0xf2b5('0x11')]);}else{logger['info'](_0xf2b5('0xc'),_0x569c45,_0xf2b5('0xd'));_0x4aeac3(_0x53f246[_0xf2b5('0x12')][_0xf2b5('0x11')]);}})['catch'](function(_0x20a646){logger[_0xf2b5('0x10')](_0xf2b5('0xc'),_0x569c45,_0x20a646);_0x18a345(_0x20a646);});});}exports[_0xf2b5('0x13')]=function(_0x28aa69){var _0x389f9a=this;return new Promise(function(_0x10e151,_0x56d9ad){return db[_0xf2b5('0x14')][_0xf2b5('0x15')]({'raw':_0x28aa69['options']?_0x28aa69[_0xf2b5('0x16')][_0xf2b5('0x17')]===undefined?!![]:![]:!![],'where':_0x28aa69['options']?_0x28aa69['options'][_0xf2b5('0x18')]||null:null,'attributes':_0x28aa69[_0xf2b5('0x16')]?_0x28aa69[_0xf2b5('0x16')]['attributes']||null:null,'limit':_0x28aa69[_0xf2b5('0x16')]?_0x28aa69[_0xf2b5('0x16')][_0xf2b5('0x19')]||null:null,'include':_0x28aa69[_0xf2b5('0x16')]?_0x28aa69[_0xf2b5('0x16')]['include']?_[_0xf2b5('0x1a')](_0x28aa69[_0xf2b5('0x16')][_0xf2b5('0x1b')],function(_0xc3ce24){return{'model':db[_0xc3ce24[_0xf2b5('0x1c')]],'as':_0xc3ce24['as'],'attributes':_0xc3ce24[_0xf2b5('0x1d')],'include':_0xc3ce24[_0xf2b5('0x1b')]?_[_0xf2b5('0x1a')](_0xc3ce24['include'],function(_0x2b5fb5){return{'model':db[_0x2b5fb5[_0xf2b5('0x1c')]],'as':_0x2b5fb5['as'],'attributes':_0x2b5fb5['attributes'],'include':_0x2b5fb5[_0xf2b5('0x1b')]?_[_0xf2b5('0x1a')](_0x2b5fb5[_0xf2b5('0x1b')],function(_0x49cce9){return{'model':db[_0x49cce9['model']],'as':_0x49cce9['as'],'attributes':_0x49cce9[_0xf2b5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf2b5('0xa')](function(_0xb0b769){logger[_0xf2b5('0xb')]('GetCmHopperBlack',_0x28aa69);logger[_0xf2b5('0x1e')](_0xf2b5('0x13'),_0x28aa69,JSON[_0xf2b5('0xf')](_0xb0b769));_0x10e151(_0xb0b769);})[_0xf2b5('0x1f')](function(_0x11f136){logger[_0xf2b5('0x10')](_0xf2b5('0x13'),_0x11f136['message'],_0x28aa69);_0x56d9ad(_0x389f9a[_0xf2b5('0x10')](0x1f4,_0x11f136[_0xf2b5('0x11')]));});});};exports[_0xf2b5('0x20')]=function(_0x3e1af8){var _0x81e2f=this;return new Promise(function(_0x5bf99c,_0x93ff9a){return db[_0xf2b5('0x14')][_0xf2b5('0x21')](_0x3e1af8[_0xf2b5('0x22')],{'raw':_0x3e1af8['options']?_0x3e1af8[_0xf2b5('0x16')][_0xf2b5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e1af8['options']?_0x3e1af8['options'][_0xf2b5('0x18')]||null:null,'attributes':_0x3e1af8['options']?_0x3e1af8[_0xf2b5('0x16')]['attributes']||null:null,'limit':_0x3e1af8[_0xf2b5('0x16')]?_0x3e1af8['options'][_0xf2b5('0x19')]||null:null})[_0xf2b5('0xa')](function(_0x4f7ce6){logger[_0xf2b5('0xb')](_0xf2b5('0x20'),_0x3e1af8);logger[_0xf2b5('0x1e')](_0xf2b5('0x20'),_0x3e1af8,JSON[_0xf2b5('0xf')](_0x4f7ce6));_0x5bf99c(_0x4f7ce6);})[_0xf2b5('0x1f')](function(_0x38e986){logger['error'](_0xf2b5('0x20'),_0x38e986[_0xf2b5('0x11')],_0x3e1af8);_0x93ff9a(_0x81e2f[_0xf2b5('0x10')](0x1f4,_0x38e986[_0xf2b5('0x11')]));});});};exports[_0xf2b5('0x23')]=function(_0x286eee){var _0x3e07b9=this;return new Promise(function(_0x8723bf,_0x397caf){return db['CmHopperBlack'][_0xf2b5('0x24')]({'where':_0x286eee[_0xf2b5('0x16')]?_0x286eee[_0xf2b5('0x16')][_0xf2b5('0x18')]||null:null})[_0xf2b5('0xa')](function(_0x3bf55e){logger['info'](_0xf2b5('0x23'),_0x286eee);logger[_0xf2b5('0x1e')](_0xf2b5('0x23'),_0x286eee,JSON[_0xf2b5('0xf')](_0x3bf55e));_0x8723bf(_0x3bf55e);})[_0xf2b5('0x1f')](function(_0x241f76){logger[_0xf2b5('0x10')](_0xf2b5('0x23'),_0x241f76[_0xf2b5('0x11')],_0x286eee);_0x397caf(_0x3e07b9[_0xf2b5('0x10')](0x1f4,_0x241f76[_0xf2b5('0x11')]));});});}; \ No newline at end of file +var _0x41ff=['raw','where','limit','include','attributes','map','then','GetCmHopperBlack','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CmHopperBlack','findAll','options'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x41ff,0xf1));var _0xf41f=function(_0x1c8740,_0x214c03){_0x1c8740=_0x1c8740-0x0;var _0x1a172e=_0x41ff[_0x1c8740];return _0x1a172e;};'use strict';var _=require(_0xf41f('0x0'));var util=require('util');var moment=require(_0xf41f('0x1'));var BPromise=require(_0xf41f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf41f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf41f('0x4'));var logger=require(_0xf41f('0x5'))('rpc');var config=require(_0xf41f('0x6'));var jayson=require(_0xf41f('0x7'));var client=jayson[_0xf41f('0x8')][_0xf41f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52eb11,_0x23ad04,_0x671461){return new BPromise(function(_0x3c6879,_0x30a485){return client[_0xf41f('0xa')](_0x52eb11,_0x671461)['then'](function(_0x4a76cd){logger[_0xf41f('0xb')](_0xf41f('0xc'),_0x23ad04,_0xf41f('0xd'));logger[_0xf41f('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x23ad04,'request\x20sent',JSON[_0xf41f('0xf')](_0x4a76cd));if(_0x4a76cd[_0xf41f('0x10')]){if(_0x4a76cd['error']['code']===0x1f4){logger['error'](_0xf41f('0xc'),_0x23ad04,_0x4a76cd['error']['message']);return _0x30a485(_0x4a76cd[_0xf41f('0x10')][_0xf41f('0x11')]);}logger[_0xf41f('0x10')](_0xf41f('0xc'),_0x23ad04,_0x4a76cd[_0xf41f('0x10')][_0xf41f('0x11')]);return _0x3c6879(_0x4a76cd['error']['message']);}else{logger[_0xf41f('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x23ad04,'request\x20sent');_0x3c6879(_0x4a76cd[_0xf41f('0x12')]['message']);}})[_0xf41f('0x13')](function(_0x29bb90){logger['error'](_0xf41f('0xc'),_0x23ad04,_0x29bb90);_0x30a485(_0x29bb90);});});}exports['GetCmHopperBlack']=function(_0x1535af){var _0xbca833=this;return new Promise(function(_0x20eb3d,_0x5096fb){return db[_0xf41f('0x14')][_0xf41f('0x15')]({'raw':_0x1535af[_0xf41f('0x16')]?_0x1535af[_0xf41f('0x16')][_0xf41f('0x17')]===undefined?!![]:![]:!![],'where':_0x1535af[_0xf41f('0x16')]?_0x1535af[_0xf41f('0x16')][_0xf41f('0x18')]||null:null,'attributes':_0x1535af['options']?_0x1535af['options']['attributes']||null:null,'limit':_0x1535af[_0xf41f('0x16')]?_0x1535af[_0xf41f('0x16')][_0xf41f('0x19')]||null:null,'include':_0x1535af['options']?_0x1535af[_0xf41f('0x16')]['include']?_['map'](_0x1535af[_0xf41f('0x16')][_0xf41f('0x1a')],function(_0x27ef59){return{'model':db[_0x27ef59['model']],'as':_0x27ef59['as'],'attributes':_0x27ef59[_0xf41f('0x1b')],'include':_0x27ef59[_0xf41f('0x1a')]?_[_0xf41f('0x1c')](_0x27ef59[_0xf41f('0x1a')],function(_0x29dd70){return{'model':db[_0x29dd70['model']],'as':_0x29dd70['as'],'attributes':_0x29dd70[_0xf41f('0x1b')],'include':_0x29dd70[_0xf41f('0x1a')]?_[_0xf41f('0x1c')](_0x29dd70[_0xf41f('0x1a')],function(_0xafd765){return{'model':db[_0xafd765['model']],'as':_0xafd765['as'],'attributes':_0xafd765[_0xf41f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf41f('0x1d')](function(_0x2ce768){logger[_0xf41f('0xb')](_0xf41f('0x1e'),_0x1535af);logger[_0xf41f('0xe')](_0xf41f('0x1e'),_0x1535af,JSON['stringify'](_0x2ce768));_0x20eb3d(_0x2ce768);})[_0xf41f('0x13')](function(_0xadb1d5){logger[_0xf41f('0x10')](_0xf41f('0x1e'),_0xadb1d5[_0xf41f('0x11')],_0x1535af);_0x5096fb(_0xbca833[_0xf41f('0x10')](0x1f4,_0xadb1d5[_0xf41f('0x11')]));});});};exports[_0xf41f('0x1f')]=function(_0x4819aa){var _0x1ec2a8=this;return new Promise(function(_0x35b82e,_0x4608c9){return db['CmHopperBlack']['update'](_0x4819aa['body'],{'raw':_0x4819aa[_0xf41f('0x16')]?_0x4819aa[_0xf41f('0x16')][_0xf41f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4819aa[_0xf41f('0x16')]?_0x4819aa['options']['where']||null:null,'attributes':_0x4819aa[_0xf41f('0x16')]?_0x4819aa['options']['attributes']||null:null,'limit':_0x4819aa[_0xf41f('0x16')]?_0x4819aa['options'][_0xf41f('0x19')]||null:null})[_0xf41f('0x1d')](function(_0x106840){logger[_0xf41f('0xb')](_0xf41f('0x1f'),_0x4819aa);logger[_0xf41f('0xe')](_0xf41f('0x1f'),_0x4819aa,JSON[_0xf41f('0xf')](_0x106840));_0x35b82e(_0x106840);})[_0xf41f('0x13')](function(_0x1acd56){logger[_0xf41f('0x10')](_0xf41f('0x1f'),_0x1acd56[_0xf41f('0x11')],_0x4819aa);_0x4608c9(_0x1ec2a8[_0xf41f('0x10')](0x1f4,_0x1acd56['message']));});});};exports[_0xf41f('0x20')]=function(_0x1af3a5){var _0x7159a1=this;return new Promise(function(_0x10f834,_0x161321){return db[_0xf41f('0x14')]['destroy']({'where':_0x1af3a5[_0xf41f('0x16')]?_0x1af3a5[_0xf41f('0x16')][_0xf41f('0x18')]||null:null})[_0xf41f('0x1d')](function(_0x656d08){logger[_0xf41f('0xb')](_0xf41f('0x20'),_0x1af3a5);logger[_0xf41f('0xe')](_0xf41f('0x20'),_0x1af3a5,JSON[_0xf41f('0xf')](_0x656d08));_0x10f834(_0x656d08);})[_0xf41f('0x13')](function(_0x6c1baf){logger[_0xf41f('0x10')](_0xf41f('0x20'),_0x6c1baf[_0xf41f('0x11')],_0x1af3a5);_0x161321(_0x7159a1['error'](0x1f4,_0x6c1baf['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index a6a0c9f..bdbcd41 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 _0x33af=['isAuthenticated','describe','show','put','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','index','/describe'];(function(_0x1f5c94,_0x2be990){var _0x43b6c5=function(_0x596c07){while(--_0x596c07){_0x1f5c94['push'](_0x1f5c94['shift']());}};_0x43b6c5(++_0x2be990);}(_0x33af,0xec));var _0xf33a=function(_0x22123d,_0x45ae06){_0x22123d=_0x22123d-0x0;var _0xeabce1=_0x33af[_0x22123d];return _0xeabce1;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0xe')](_0xf33a('0xf'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router['delete']('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0x11')]);module[_0xf33a('0x12')]=router; \ No newline at end of file +var _0x7bd0=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','update','delete','destroy','exports'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x7bd0,0x111));var _0x07bd=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x7bd0[_0x28f32c];return _0x355402;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var fs_extra=require(_0x07bd('0x6'));var auth=require(_0x07bd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x07bd('0x8'));var controller=require(_0x07bd('0x9'));router[_0x07bd('0xa')]('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0xc')]);router[_0x07bd('0xa')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0xe')]);router['get'](_0x07bd('0xf'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x10')]);router['put'](_0x07bd('0xf'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x11')]);router[_0x07bd('0x12')]('/:id',auth[_0x07bd('0xb')](),controller[_0x07bd('0x13')]);module[_0x07bd('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index a57e40a..1301a7d 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 _0xfa32=['sequelize','moment','INTEGER','DATE','STRING','endtime','setDataValue','seconds','dispositionat','BOOLEAN'];(function(_0x1ea7c2,_0x5b04e2){var _0x147c2e=function(_0x5485c3){while(--_0x5485c3){_0x1ea7c2['push'](_0x1ea7c2['shift']());}};_0x147c2e(++_0x5b04e2);}(_0xfa32,0x17c));var _0x2fa3=function(_0x33ab7b,_0x29403b){_0x33ab7b=_0x33ab7b-0x0;var _0x20ebb4=_0xfa32[_0x33ab7b];return _0x20ebb4;};'use strict';var Sequelize=require(_0x2fa3('0x0'));var moment=require(_0x2fa3('0x1'));module['exports']={'state':{'type':Sequelize[_0x2fa3('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2fa3('0x3')]},'countbusyretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2fa3('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x2fa3('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2fa3('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2fa3('0x4')]},'starttime':{'type':Sequelize[_0x2fa3('0x3')]},'responsetime':{'type':Sequelize[_0x2fa3('0x3')]},'answertime':{'type':Sequelize[_0x2fa3('0x3')]},'droptime':{'type':Sequelize[_0x2fa3('0x3')]},'endtime':{'type':Sequelize[_0x2fa3('0x3')]},'ringtime':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2fa3('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2fa3('0x4')]},'membername':{'type':Sequelize[_0x2fa3('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x2fa3('0x4')]},'secondDisposition':{'type':Sequelize[_0x2fa3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2fa3('0x4')]},'dispositionat':{'type':Sequelize[_0x2fa3('0x3')],'set':function(_0x13aab8){var _0x5594f3=this['getDataValue'](_0x2fa3('0x5'));if(_0x5594f3&&_0x13aab8){this[_0x2fa3('0x6')]('followuptime',moment(_0x13aab8)['diff'](moment(_0x5594f3),_0x2fa3('0x7')));}return this[_0x2fa3('0x6')](_0x2fa3('0x8'),_0x13aab8);}},'amd':{'type':Sequelize[_0x2fa3('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x2fa3('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2fa3('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2fa3('0x3')]},'deleted':{'type':Sequelize[_0x2fa3('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2fa3('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2fa3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x620d=['DATE','STRING','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x46b627,_0x4d8e1a){var _0x2d4b4c=function(_0x2ad2a1){while(--_0x2ad2a1){_0x46b627['push'](_0x46b627['shift']());}};_0x2d4b4c(++_0x4d8e1a);}(_0x620d,0x1ac));var _0xd620=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x620d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd620('0x0'));var moment=require(_0xd620('0x1'));module[_0xd620('0x2')]={'state':{'type':Sequelize[_0xd620('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xd620('0x4')]},'countbusyretry':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd620('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xd620('0x5')]},'originatecalleridname':{'type':Sequelize[_0xd620('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd620('0x5')]},'starttime':{'type':Sequelize[_0xd620('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xd620('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd620('0x4')]},'ringtime':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd620('0x5')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd620('0x5')]},'membername':{'type':Sequelize[_0xd620('0x5')]},'reason':{'type':Sequelize[_0xd620('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd620('0x5')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x53a5ae){var _0x4e90bc=this['getDataValue'](_0xd620('0x6'));if(_0x4e90bc&&_0x53a5ae){this[_0xd620('0x7')](_0xd620('0x8'),moment(_0x53a5ae)[_0xd620('0x9')](moment(_0x4e90bc),_0xd620('0xa')));}return this[_0xd620('0x7')]('dispositionat',_0x53a5ae);}},'amd':{'type':Sequelize[_0xd620('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd620('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd620('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd620('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd620('0x4')]},'callback':{'type':Sequelize[_0xd620('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd620('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xd620('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd620('0x4')]},'recallme':{'type':Sequelize[_0xd620('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd620('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd620('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 9b71e1d..66e032a 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 _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x28080b,_0x1bc499){var _0x34fd53=function(_0x34455f){while(--_0x34455f){_0x28080b['push'](_0x28080b['shift']());}};_0x34fd53(++_0x1bc499);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));}; \ No newline at end of file +var _0xc2c7=['`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','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','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal'];(function(_0x2952d8,_0x2fac53){var _0x591e34=function(_0x2e0545){while(--_0x2e0545){_0x2952d8['push'](_0x2952d8['shift']());}};_0x591e34(++_0x2fac53);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1bdd4b,_0x4b53b9){_0x1bdd4b=_0x1bdd4b-0x0;var _0x1b68ec=_0xc2c7[_0x1bdd4b];return _0x1b68ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['CmHopperFinal'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['describe']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['describe']()['then'](respondWithResult(_0x3091bd,null))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x39d5af,_0x2b79d5){if(_0x39d5af['body']['uniqueid']){delete _0x39d5af['body'][_0x7c2c('0x48')];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'uniqueid':_0x39d5af[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x2b79d5,null))['then'](saveUpdates(_0x39d5af[_0x7c2c('0x4a')],null))[_0x7c2c('0x26')](respondWithResult(_0x2b79d5,null))['catch'](handleError(_0x2b79d5,null));};exports[_0x7c2c('0x4b')]=function(_0x56e09d,_0xfba6a7,_0x3806f4){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x56e09d['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x4d')))),_0x7c2c('0x4e')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x7c2c('0x53')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x54')))),'congestionContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x58')))),_0x7c2c('0x59')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7c2c('0x26')](handleEntityNotFound(_0xfba6a7,null))[_0x7c2c('0x26')](respondWithResult(_0xfba6a7,null))[_0x7c2c('0x45')](handleError(_0xfba6a7,null));};exports[_0x7c2c('0x5a')]=function(_0x44602a,_0x1ad537,_0x2d04da){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'CampaignId':_0x44602a['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x7c2c('0x4e')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x5b')))),'busyContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7c2c('0x54')))),_0x7c2c('0x5c')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5d')))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5e')))),_0x7c2c('0x5f')]]})['then'](handleEntityNotFound(_0x1ad537,null))[_0x7c2c('0x26')](respondWithResult(_0x1ad537,null))['catch'](handleError(_0x1ad537,null));};exports[_0x7c2c('0x60')]=function(_0x2b597d,_0x20eb63,_0x56f737){return db[_0x7c2c('0x61')][_0x7c2c('0x47')]({'where':{'id':_0x2b597d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x20eb63,null))['then'](function(_0x158352){var _0x1e711e;if(_0x158352){_0x1e711e=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')](_0x7c2c('0x64'))[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),'ListId',_0x7c2c('0x69'),_0x7c2c('0x6a'),'updatedAt'],squel[_0x7c2c('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x7c2c('0x66'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),'scheduledAt')[_0x7c2c('0x6c')](_0x7c2c('0x6e'),_0x7c2c('0x68'))['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')](_0x7c2c('0x71'),'VoiceQueueId')[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),_0x7c2c('0x72'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2b597d[_0x7c2c('0x4a')][_0x7c2c('0x77')][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x66'))[_0x7c2c('0x73')](_0x7c2c('0x64'))['where'](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel['select']()[_0x7c2c('0x6c')]('calleridnum')[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')]('state\x20=\x204'))[_0x7c2c('0x7b')](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x1e711e);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x20eb63,null))[_0x7c2c('0x45')](handleError(_0x20eb63,null));};exports[_0x7c2c('0x7c')]=function(_0x2f249d,_0x136226,_0x354236){return db[_0x7c2c('0x7d')][_0x7c2c('0x47')]({'where':{'id':_0x2f249d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x136226,null))[_0x7c2c('0x26')](function(_0xb47bf0){var _0x4d0922;if(_0xb47bf0){_0x4d0922=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')]('cm_hopper')[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),_0x7c2c('0x70'),'CampaignId',_0x7c2c('0x6a'),_0x7c2c('0x72')],squel[_0x7c2c('0x6b')]()['field'](_0x7c2c('0x7e'),_0x7c2c('0x66'))[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x67'))['field'](_0x7c2c('0x6e'),'ContactId')['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')]('ANY_VALUE(CampaignId)',_0x7c2c('0x7f'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),'updatedAt')['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2f249d[_0x7c2c('0x4a')]['state'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()['field']('phone')[_0x7c2c('0x73')](_0x7c2c('0x64'))[_0x7c2c('0x3d')](_0x7c2c('0x80'),_0x2f249d['params']['id'][_0x7c2c('0x78')]()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x81'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')]('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())['where'](_0x7c2c('0x82')))['group'](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x4d0922);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x136226,null))[_0x7c2c('0x45')](handleError(_0x136226,null));};exports[_0x7c2c('0x83')]=function(_0x309051,_0x3f8683,_0x1eeb00){return db[_0x7c2c('0x84')]['findOne']({'where':{'VoiceQueueId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x69')],'CampaignId':_0x309051[_0x7c2c('0x4a')]['CampaignId'],'ContactId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x68')]}})['then'](handleEntityNotFound(_0x3f8683,null))[_0x7c2c('0x26')](function(_0x511158){if(_0x511158){return _0x511158;}return null;})[_0x7c2c('0x26')](respondWithResult(_0x3f8683,null))['catch'](handleError(_0x3f8683,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 72deee6..bdf6a59 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 _0x0f61=['define','CmHopperFinal','calleridnum','uniqueid','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x4c5207,_0x112d7a){var _0x57e4bc=function(_0x3e72ba){while(--_0x3e72ba){_0x4c5207['push'](_0x4c5207['shift']());}};_0x57e4bc(++_0x112d7a);}(_0x0f61,0x12f));var _0x10f6=function(_0x3d91bc,_0x1ee4bc){_0x3d91bc=_0x3d91bc-0x0;var _0x3b4667=_0x0f61[_0x3d91bc];return _0x3b4667;};'use strict';var _=require('lodash');var util=require(_0x10f6('0x0'));var logger=require(_0x10f6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x10f6('0x2'));var rp=require(_0x10f6('0x3'));var fs=require('fs');var path=require(_0x10f6('0x4'));var rimraf=require(_0x10f6('0x5'));var config=require(_0x10f6('0x6'));var attributes=require(_0x10f6('0x7'));module[_0x10f6('0x8')]=function(_0x2ed399,_0x93409){return _0x2ed399[_0x10f6('0x9')](_0x10f6('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x10f6('0xb'),'fields':[_0x10f6('0xb')]},{'name':_0x10f6('0xc'),'fields':[_0x10f6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1171=['util','../../config/logger','api','moment','request-promise','path','rimraf','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x46402b,_0x3d583e){var _0x3ef4e3=function(_0x39b712){while(--_0x39b712){_0x46402b['push'](_0x46402b['shift']());}};_0x3ef4e3(++_0x3d583e);}(_0x1171,0xcf));var _0x1117=function(_0x5b95d9,_0x24d08e){_0x5b95d9=_0x5b95d9-0x0;var _0x20523c=_0x1171[_0x5b95d9];return _0x20523c;};'use strict';var _=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var logger=require(_0x1117('0x2'))(_0x1117('0x3'));var moment=require(_0x1117('0x4'));var BPromise=require('bluebird');var rp=require(_0x1117('0x5'));var fs=require('fs');var path=require(_0x1117('0x6'));var rimraf=require(_0x1117('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x1117('0x8')]=function(_0x33dfb3,_0xd9a56d){return _0x33dfb3['define'](_0x1117('0x9'),attributes,{'tableName':_0x1117('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x1117('0xb')]},{'name':_0x1117('0xc'),'fields':[_0x1117('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 726f216..f09c5d7 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x30a386,_0x1c006c){var _0xe31540=function(_0x598737){while(--_0x598737){_0x30a386['push'](_0x30a386['shift']());}};_0xe31540(++_0x1c006c);}(_0x7a54,0x106));var _0x47a5=function(_0x1556ca,_0x41bda7){_0x1556ca=_0x1556ca-0x0;var _0x112a77=_0x7a54[_0x1556ca];return _0x112a77;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0xd196b1,_0xa26c6a){var _0x1ab195=function(_0x31c105){while(--_0x31c105){_0xd196b1['push'](_0xd196b1['shift']());}};_0x1ab195(++_0xa26c6a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5edd05,_0x8ac1d3){_0x5edd05=_0x5edd05-0x0;var _0x19b62e=_0xb10b[_0x5edd05];return _0x19b62e;};'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 27bbb30..5f1def0 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 _0x7cfa=['index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','checkContactHopper','update','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated'];(function(_0x3a355d,_0x26de2a){var _0x37aa3b=function(_0x42c21a){while(--_0x42c21a){_0x3a355d['push'](_0x3a355d['shift']());}};_0x37aa3b(++_0x26de2a);}(_0x7cfa,0x137));var _0xa7cf=function(_0x57022c,_0x4878eb){_0x57022c=_0x57022c-0x0;var _0x5069f4=_0x7cfa[_0x57022c];return _0x5069f4;};'use strict';var multer=require(_0xa7cf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa7cf('0x1'));var express=require(_0xa7cf('0x2'));var router=express[_0xa7cf('0x3')]();var fs_extra=require(_0xa7cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa7cf('0x5'));var config=require('../../config/environment');var controller=require(_0xa7cf('0x6'));router[_0xa7cf('0x7')]('/',auth[_0xa7cf('0x8')](),controller[_0xa7cf('0x9')]);router[_0xa7cf('0x7')](_0xa7cf('0xa'),auth[_0xa7cf('0x8')](),controller[_0xa7cf('0xb')]);router[_0xa7cf('0x7')](_0xa7cf('0xc'),auth[_0xa7cf('0x8')](),controller['show']);router[_0xa7cf('0x7')](_0xa7cf('0xd'),auth['isAuthenticated'](),controller[_0xa7cf('0xe')]);router[_0xa7cf('0x7')](_0xa7cf('0xf'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0xa7cf('0x10')](_0xa7cf('0x11'),auth[_0xa7cf('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xa7cf('0x10')]('/voice/campaign/moveContacts/:id',auth[_0xa7cf('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0xa7cf('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa7cf('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6829=['moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x6829,0x14c));var _0x9682=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6829[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9682('0x2')]();var fs_extra=require(_0x9682('0x3'));var auth=require(_0x9682('0x4'));var interaction=require(_0x9682('0x5'));var config=require(_0x9682('0x6'));var controller=require(_0x9682('0x7'));router[_0x9682('0x8')]('/',auth[_0x9682('0x9')](),controller[_0x9682('0xa')]);router[_0x9682('0x8')](_0x9682('0xb'),auth[_0x9682('0x9')](),controller['describe']);router['get']('/:id',auth[_0x9682('0x9')](),controller[_0x9682('0xc')]);router['get'](_0x9682('0xd'),auth['isAuthenticated'](),controller[_0x9682('0xe')]);router['get'](_0x9682('0xf'),auth[_0x9682('0x9')](),controller[_0x9682('0x10')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x9682('0x9')](),controller[_0x9682('0x11')]);router['post'](_0x9682('0x12'),auth['isAuthenticated'](),controller[_0x9682('0x13')]);router[_0x9682('0x14')](_0x9682('0x15'),auth[_0x9682('0x9')](),controller[_0x9682('0x16')]);router[_0x9682('0x17')](_0x9682('0x18'),auth[_0x9682('0x9')](),controller[_0x9682('0x19')]);module[_0x9682('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 9b2fba7..54170fd 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 _0xe41c=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x127407,_0xce29ea){var _0x11858d=function(_0x2f08f2){while(--_0x2f08f2){_0x127407['push'](_0x127407['shift']());}};_0x11858d(++_0xce29ea);}(_0xe41c,0xb8));var _0xce41=function(_0x2ec356,_0x3f55c7){_0x2ec356=_0x2ec356-0x0;var _0x41ad23=_0xe41c[_0x2ec356];return _0x41ad23;};'use strict';var Sequelize=require(_0xce41('0x0'));module[_0xce41('0x1')]={'state':{'type':Sequelize[_0xce41('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xce41('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xce41('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xce41('0x3')]},'calleridnum':{'type':Sequelize[_0xce41('0x3')]},'calleridname':{'type':Sequelize[_0xce41('0x3')]},'starttime':{'type':Sequelize[_0xce41('0x4')]},'responsetime':{'type':Sequelize[_0xce41('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xce41('0x4')]},'ringtime':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xce41('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xce41('0x3')]},'membername':{'type':Sequelize[_0xce41('0x3')]},'reason':{'type':Sequelize[_0xce41('0x3')]},'amd':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xce41('0x4')]},'recallme':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xce41('0x4')]},'edited':{'type':Sequelize[_0xce41('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xce41('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2626=['exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0xd5c6ff,_0xa12277){var _0x28d921=function(_0x598bf3){while(--_0x598bf3){_0xd5c6ff['push'](_0xd5c6ff['shift']());}};_0x28d921(++_0xa12277);}(_0x2626,0x10e));var _0x6262=function(_0xead007,_0x43fd22){_0xead007=_0xead007-0x0;var _0x31f650=_0x2626[_0xead007];return _0x31f650;};'use strict';var Sequelize=require('sequelize');module[_0x6262('0x0')]={'state':{'type':Sequelize[_0x6262('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6262('0x2')]},'scheduledat':{'type':Sequelize[_0x6262('0x3')]},'countbusyretry':{'type':Sequelize[_0x6262('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6262('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x6262('0x2')]},'originatecalleridname':{'type':Sequelize[_0x6262('0x2')]},'calleridnum':{'type':Sequelize[_0x6262('0x2')]},'calleridname':{'type':Sequelize[_0x6262('0x2')]},'starttime':{'type':Sequelize[_0x6262('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6262('0x3')]},'ringtime':{'type':Sequelize[_0x6262('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6262('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6262('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x6262('0x2')]},'campaigntype':{'type':Sequelize[_0x6262('0x2')]},'membername':{'type':Sequelize[_0x6262('0x2')]},'reason':{'type':Sequelize[_0x6262('0x2')]},'amd':{'type':Sequelize[_0x6262('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6262('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6262('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6262('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6262('0x3')]},'recallme':{'type':Sequelize[_0x6262('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6262('0x3')]},'edited':{'type':Sequelize[_0x6262('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6262('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6262('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6262('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 3d318a5..54b69e5 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 _0xd5f8=['update','then','destroy','stack','name','send','map','CmHopperHistory','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','describe','uniqueid','find','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','Content-Range','reject','save'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0xd5f8,0xb9));var _0x8d5f=function(_0x1ba6fe,_0xaa7a87){_0x1ba6fe=_0x1ba6fe-0x0;var _0x2deb54=_0xd5f8[_0x1ba6fe];return _0x2deb54;};'use strict';var emlformat=require(_0x8d5f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d5f('0x1'));var rp=require(_0x8d5f('0x2'));var moment=require(_0x8d5f('0x3'));var BPromise=require(_0x8d5f('0x4'));var Mustache=require('mustache');var util=require(_0x8d5f('0x5'));var path=require(_0x8d5f('0x6'));var sox=require('sox');var csv=require(_0x8d5f('0x7'));var ejs=require(_0x8d5f('0x8'));var fs=require('fs');var fs_extra=require(_0x8d5f('0x9'));var _=require(_0x8d5f('0xa'));var squel=require(_0x8d5f('0xb'));var crypto=require(_0x8d5f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8d5f('0xd'));var toCsv=require(_0x8d5f('0x7'));var querystring=require(_0x8d5f('0xe'));var Papa=require(_0x8d5f('0xf'));var Redis=require('ioredis');var authService=require(_0x8d5f('0x10'));var qs=require(_0x8d5f('0x11'));var as=require(_0x8d5f('0x12'));var hardwareService=require(_0x8d5f('0x13'));var logger=require(_0x8d5f('0x14'))(_0x8d5f('0x15'));var utils=require('../../config/utils');var config=require(_0x8d5f('0x16'));var licenseUtil=require(_0x8d5f('0x17'));var db=require(_0x8d5f('0x18'))['db'];function respondWithStatusCode(_0xb3105,_0x13b9c1){_0x13b9c1=_0x13b9c1||0xcc;return function(_0xadb4ee){if(_0xadb4ee){return _0xb3105[_0x8d5f('0x19')](_0x13b9c1);}return _0xb3105[_0x8d5f('0x1a')](_0x13b9c1)[_0x8d5f('0x1b')]();};}function respondWithResult(_0x1ae9ad,_0x11a3bc){_0x11a3bc=_0x11a3bc||0xc8;return function(_0x345ee5){if(_0x345ee5){return _0x1ae9ad[_0x8d5f('0x1a')](_0x11a3bc)['json'](_0x345ee5);}};}function respondWithFilteredResult(_0x5b7848,_0x31ac55){return function(_0x492db9){if(_0x492db9){var _0x1654f3=typeof _0x31ac55[_0x8d5f('0x1c')]==='undefined'&&typeof _0x31ac55[_0x8d5f('0x1d')]==='undefined';var _0x338906=_0x492db9[_0x8d5f('0x1e')];var _0x338c09=_0x1654f3?0x0:_0x31ac55[_0x8d5f('0x1c')];var _0x226f5d=_0x1654f3?_0x492db9[_0x8d5f('0x1e')]:_0x31ac55['offset']+_0x31ac55[_0x8d5f('0x1d')];var _0x4be29c;if(_0x226f5d>=_0x338906){_0x226f5d=_0x338906;_0x4be29c=0xc8;}else{_0x4be29c=0xce;}_0x5b7848['status'](_0x4be29c);return _0x5b7848['set'](_0x8d5f('0x1f'),_0x338c09+'-'+_0x226f5d+'/'+_0x338906)['json'](_0x492db9);}return null;};}function patchUpdates(_0x212c47){return function(_0x12096c){try{jsonpatch['apply'](_0x12096c,_0x212c47,!![]);}catch(_0x3d009e){return BPromise[_0x8d5f('0x20')](_0x3d009e);}return _0x12096c[_0x8d5f('0x21')]();};}function saveUpdates(_0xc81e5c,_0x50966b){return function(_0x1fab62){if(_0x1fab62){return _0x1fab62[_0x8d5f('0x22')](_0xc81e5c)[_0x8d5f('0x23')](function(_0x4c4858){return _0x4c4858;});}return null;};}function removeEntity(_0x2d48de,_0x49a22d){return function(_0x54ae06){if(_0x54ae06){return _0x54ae06[_0x8d5f('0x24')]()[_0x8d5f('0x23')](function(){_0x2d48de['status'](0xcc)[_0x8d5f('0x1b')]();});}};}function handleEntityNotFound(_0x173a8d,_0x3ff0f0){return function(_0x3726c0){if(!_0x3726c0){_0x173a8d[_0x8d5f('0x19')](0x194);}return _0x3726c0;};}function handleError(_0xc06807,_0x291a77){_0x291a77=_0x291a77||0x1f4;return function(_0x8942d0){logger['error'](_0x8942d0[_0x8d5f('0x25')]);if(_0x8942d0[_0x8d5f('0x26')]){delete _0x8942d0[_0x8d5f('0x26')];}_0xc06807['status'](_0x291a77)[_0x8d5f('0x27')](_0x8942d0);};}exports['index']=function(_0xa6e537,_0x490f04){var _0x18ab00={},_0x563e23={},_0x4dac0b={'count':0x0,'rows':[]};var _0x3b33f9=_[_0x8d5f('0x28')](db[_0x8d5f('0x29')][_0x8d5f('0x2a')],function(_0x11d85c){return{'name':_0x11d85c['fieldName'],'type':_0x11d85c[_0x8d5f('0x2b')][_0x8d5f('0x2c')]};});_0x563e23[_0x8d5f('0x2d')]=_[_0x8d5f('0x28')](_0x3b33f9,'name');_0x563e23[_0x8d5f('0x2e')]=_[_0x8d5f('0x2f')](_0xa6e537[_0x8d5f('0x2e')]);_0x563e23[_0x8d5f('0x30')]=_[_0x8d5f('0x31')](_0x563e23[_0x8d5f('0x2d')],_0x563e23[_0x8d5f('0x2e')]);_0x18ab00[_0x8d5f('0x32')]=_[_0x8d5f('0x31')](_0x563e23[_0x8d5f('0x2d')],qs[_0x8d5f('0x33')](_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x33')]));_0x18ab00[_0x8d5f('0x32')]=_0x18ab00[_0x8d5f('0x32')][_0x8d5f('0x34')]?_0x18ab00['attributes']:_0x563e23[_0x8d5f('0x2d')];if(!_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x35')](_0x8d5f('0x36'))){_0x18ab00[_0x8d5f('0x1d')]=qs[_0x8d5f('0x1d')](_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x1d')]);_0x18ab00[_0x8d5f('0x1c')]=qs[_0x8d5f('0x1c')](_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x1c')]);}_0x18ab00['order']=qs[_0x8d5f('0x37')](_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x37')]);_0x18ab00[_0x8d5f('0x38')]=qs[_0x8d5f('0x30')](_['pick'](_0xa6e537[_0x8d5f('0x2e')],_0x563e23['filters']),_0x3b33f9);if(_0xa6e537['query'][_0x8d5f('0x39')]){_0x18ab00[_0x8d5f('0x38')]=_['merge'](_0x18ab00[_0x8d5f('0x38')],{'$or':_[_0x8d5f('0x28')](_0x3b33f9,function(_0x1ccff4){if(_0x1ccff4['type']!==_0x8d5f('0x3a')){var _0x2faaba={};_0x2faaba[_0x1ccff4[_0x8d5f('0x26')]]={'$like':'%'+_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x39')]+'%'};return _0x2faaba;}})});}_0x18ab00=_['merge']({},_0x18ab00,_0xa6e537[_0x8d5f('0x3b')]);var _0x25d88c={'where':_0x18ab00[_0x8d5f('0x38')]};return db[_0x8d5f('0x29')]['count'](_0x25d88c)['then'](function(_0xff0871){_0x4dac0b[_0x8d5f('0x1e')]=_0xff0871;if(_0xa6e537[_0x8d5f('0x2e')][_0x8d5f('0x3c')]){_0x18ab00[_0x8d5f('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8d5f('0x3e')](_0x18ab00);})[_0x8d5f('0x23')](function(_0x471350){_0x4dac0b[_0x8d5f('0x3f')]=_0x471350;return _0x4dac0b;})[_0x8d5f('0x23')](respondWithFilteredResult(_0x490f04,_0x18ab00))[_0x8d5f('0x40')](handleError(_0x490f04,null));};exports[_0x8d5f('0x41')]=function(_0xdb7c83,_0xbd79d0){var _0x123a87={'raw':!![],'where':{'id':_0xdb7c83[_0x8d5f('0x42')]['id']}},_0x104d12={};_0x104d12[_0x8d5f('0x2d')]=_[_0x8d5f('0x2f')](db['CmHopperHistory']['rawAttributes']);_0x104d12[_0x8d5f('0x2e')]=_[_0x8d5f('0x2f')](_0xdb7c83[_0x8d5f('0x2e')]);_0x104d12['filters']=_[_0x8d5f('0x31')](_0x104d12[_0x8d5f('0x2d')],_0x104d12[_0x8d5f('0x2e')]);_0x123a87['attributes']=_[_0x8d5f('0x31')](_0x104d12['model'],qs[_0x8d5f('0x33')](_0xdb7c83[_0x8d5f('0x2e')]['fields']));_0x123a87[_0x8d5f('0x32')]=_0x123a87[_0x8d5f('0x32')][_0x8d5f('0x34')]?_0x123a87[_0x8d5f('0x32')]:_0x104d12[_0x8d5f('0x2d')];if(_0xdb7c83[_0x8d5f('0x2e')][_0x8d5f('0x3c')]){_0x123a87[_0x8d5f('0x3d')]=[{'all':!![]}];}_0x123a87=_[_0x8d5f('0x43')]({},_0x123a87,_0xdb7c83[_0x8d5f('0x3b')]);return db['CmHopperHistory']['find'](_0x123a87)[_0x8d5f('0x23')](handleEntityNotFound(_0xbd79d0,null))[_0x8d5f('0x23')](respondWithResult(_0xbd79d0,null))[_0x8d5f('0x40')](handleError(_0xbd79d0,null));};exports['create']=function(_0x148dd9,_0xc33c33){return db[_0x8d5f('0x29')][_0x8d5f('0x44')](_0x148dd9[_0x8d5f('0x45')],{})[_0x8d5f('0x23')](respondWithResult(_0xc33c33,0xc9))[_0x8d5f('0x40')](handleError(_0xc33c33,null));};exports[_0x8d5f('0x46')]=function(_0x4745f6,_0x14f534){return db[_0x8d5f('0x29')][_0x8d5f('0x46')]()[_0x8d5f('0x23')](respondWithResult(_0x14f534,null))[_0x8d5f('0x40')](handleError(_0x14f534,null));};exports[_0x8d5f('0x22')]=function(_0x449631,_0x1709e6){if(_0x449631[_0x8d5f('0x45')][_0x8d5f('0x47')]){delete _0x449631[_0x8d5f('0x45')]['uniqueid'];}return db[_0x8d5f('0x29')][_0x8d5f('0x48')]({'where':{'uniqueid':_0x449631['params']['id']}})[_0x8d5f('0x23')](handleEntityNotFound(_0x1709e6,null))['then'](saveUpdates(_0x449631[_0x8d5f('0x45')],null))['then'](respondWithResult(_0x1709e6,null))[_0x8d5f('0x40')](handleError(_0x1709e6,null));}; \ No newline at end of file +var _0x677b=['query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','options','includeAll','include','rows','catch','show','merge','create','describe','body','uniqueid','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','keys'];(function(_0x42b63b,_0xfdde56){var _0x2591c8=function(_0x1f2863){while(--_0x1f2863){_0x42b63b['push'](_0x42b63b['shift']());}};_0x2591c8(++_0xfdde56);}(_0x677b,0x1e1));var _0xb677=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x677b[_0x5471ec];return _0x121d4c;};'use strict';var emlformat=require(_0xb677('0x0'));var rimraf=require(_0xb677('0x1'));var zipdir=require(_0xb677('0x2'));var jsonpatch=require(_0xb677('0x3'));var rp=require(_0xb677('0x4'));var moment=require(_0xb677('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb677('0x6'));var path=require(_0xb677('0x7'));var sox=require(_0xb677('0x8'));var csv=require(_0xb677('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb677('0xa'));var _=require(_0xb677('0xb'));var squel=require('squel');var crypto=require(_0xb677('0xc'));var jsforce=require(_0xb677('0xd'));var deskjs=require(_0xb677('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb677('0xf'));var Papa=require(_0xb677('0x10'));var Redis=require(_0xb677('0x11'));var authService=require(_0xb677('0x12'));var qs=require(_0xb677('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb677('0x14'));var logger=require(_0xb677('0x15'))(_0xb677('0x16'));var utils=require(_0xb677('0x17'));var config=require(_0xb677('0x18'));var licenseUtil=require(_0xb677('0x19'));var db=require(_0xb677('0x1a'))['db'];function respondWithStatusCode(_0x207c37,_0xaf0442){_0xaf0442=_0xaf0442||0xcc;return function(_0x1e4ecb){if(_0x1e4ecb){return _0x207c37[_0xb677('0x1b')](_0xaf0442);}return _0x207c37['status'](_0xaf0442)[_0xb677('0x1c')]();};}function respondWithResult(_0x17fdd8,_0x53c74e){_0x53c74e=_0x53c74e||0xc8;return function(_0x1da268){if(_0x1da268){return _0x17fdd8[_0xb677('0x1d')](_0x53c74e)[_0xb677('0x1e')](_0x1da268);}};}function respondWithFilteredResult(_0x54eb51,_0x2542d9){return function(_0x17e297){if(_0x17e297){var _0x41ed5b=typeof _0x2542d9[_0xb677('0x1f')]===_0xb677('0x20')&&typeof _0x2542d9[_0xb677('0x21')]===_0xb677('0x20');var _0x266932=_0x17e297[_0xb677('0x22')];var _0x328b09=_0x41ed5b?0x0:_0x2542d9[_0xb677('0x1f')];var _0x1bc325=_0x41ed5b?_0x17e297['count']:_0x2542d9['offset']+_0x2542d9[_0xb677('0x21')];var _0x292eba;if(_0x1bc325>=_0x266932){_0x1bc325=_0x266932;_0x292eba=0xc8;}else{_0x292eba=0xce;}_0x54eb51[_0xb677('0x1d')](_0x292eba);return _0x54eb51[_0xb677('0x23')]('Content-Range',_0x328b09+'-'+_0x1bc325+'/'+_0x266932)[_0xb677('0x1e')](_0x17e297);}return null;};}function patchUpdates(_0x265e1a){return function(_0x42da49){try{jsonpatch[_0xb677('0x24')](_0x42da49,_0x265e1a,!![]);}catch(_0x4b52e7){return BPromise['reject'](_0x4b52e7);}return _0x42da49['save']();};}function saveUpdates(_0x454bfc,_0x2f569f){return function(_0x2c8ef1){if(_0x2c8ef1){return _0x2c8ef1[_0xb677('0x25')](_0x454bfc)[_0xb677('0x26')](function(_0x5cd0af){return _0x5cd0af;});}return null;};}function removeEntity(_0xe1e9f5,_0x41fe19){return function(_0x172965){if(_0x172965){return _0x172965[_0xb677('0x27')]()[_0xb677('0x26')](function(){_0xe1e9f5['status'](0xcc)[_0xb677('0x1c')]();});}};}function handleEntityNotFound(_0x516874,_0x495a89){return function(_0x505fd1){if(!_0x505fd1){_0x516874[_0xb677('0x1b')](0x194);}return _0x505fd1;};}function handleError(_0x1a944b,_0x2643ef){_0x2643ef=_0x2643ef||0x1f4;return function(_0x415126){logger['error'](_0x415126[_0xb677('0x28')]);if(_0x415126[_0xb677('0x29')]){delete _0x415126[_0xb677('0x29')];}_0x1a944b[_0xb677('0x1d')](_0x2643ef)[_0xb677('0x2a')](_0x415126);};}exports[_0xb677('0x2b')]=function(_0x101e9f,_0x3aadcb){var _0x2327b0={},_0x5b6680={},_0x5264bd={'count':0x0,'rows':[]};var _0x3c3380=_[_0xb677('0x2c')](db[_0xb677('0x2d')][_0xb677('0x2e')],function(_0x365b09){return{'name':_0x365b09['fieldName'],'type':_0x365b09[_0xb677('0x2f')][_0xb677('0x30')]};});_0x5b6680[_0xb677('0x31')]=_[_0xb677('0x2c')](_0x3c3380,_0xb677('0x29'));_0x5b6680['query']=_[_0xb677('0x32')](_0x101e9f[_0xb677('0x33')]);_0x5b6680[_0xb677('0x34')]=_['intersection'](_0x5b6680['model'],_0x5b6680['query']);_0x2327b0['attributes']=_[_0xb677('0x35')](_0x5b6680[_0xb677('0x31')],qs[_0xb677('0x36')](_0x101e9f[_0xb677('0x33')][_0xb677('0x36')]));_0x2327b0[_0xb677('0x37')]=_0x2327b0[_0xb677('0x37')][_0xb677('0x38')]?_0x2327b0[_0xb677('0x37')]:_0x5b6680[_0xb677('0x31')];if(!_0x101e9f[_0xb677('0x33')]['hasOwnProperty'](_0xb677('0x39'))){_0x2327b0[_0xb677('0x21')]=qs['limit'](_0x101e9f['query']['limit']);_0x2327b0['offset']=qs[_0xb677('0x1f')](_0x101e9f[_0xb677('0x33')]['offset']);}_0x2327b0[_0xb677('0x3a')]=qs['sort'](_0x101e9f[_0xb677('0x33')][_0xb677('0x3b')]);_0x2327b0[_0xb677('0x3c')]=qs[_0xb677('0x34')](_[_0xb677('0x3d')](_0x101e9f[_0xb677('0x33')],_0x5b6680[_0xb677('0x34')]),_0x3c3380);if(_0x101e9f['query'][_0xb677('0x3e')]){_0x2327b0['where']=_['merge'](_0x2327b0['where'],{'$or':_[_0xb677('0x2c')](_0x3c3380,function(_0x162036){if(_0x162036[_0xb677('0x2f')]!=='VIRTUAL'){var _0x3d5407={};_0x3d5407[_0x162036['name']]={'$like':'%'+_0x101e9f[_0xb677('0x33')][_0xb677('0x3e')]+'%'};return _0x3d5407;}})});}_0x2327b0=_['merge']({},_0x2327b0,_0x101e9f[_0xb677('0x3f')]);var _0x36592e={'where':_0x2327b0[_0xb677('0x3c')]};return db['CmHopperHistory'][_0xb677('0x22')](_0x36592e)[_0xb677('0x26')](function(_0x5dea56){_0x5264bd[_0xb677('0x22')]=_0x5dea56;if(_0x101e9f[_0xb677('0x33')][_0xb677('0x40')]){_0x2327b0[_0xb677('0x41')]=[{'all':!![]}];}return db[_0xb677('0x2d')]['findAll'](_0x2327b0);})['then'](function(_0x3cbeb2){_0x5264bd[_0xb677('0x42')]=_0x3cbeb2;return _0x5264bd;})[_0xb677('0x26')](respondWithFilteredResult(_0x3aadcb,_0x2327b0))[_0xb677('0x43')](handleError(_0x3aadcb,null));};exports[_0xb677('0x44')]=function(_0x1bb4c4,_0x332b88){var _0x590ff8={'raw':!![],'where':{'id':_0x1bb4c4['params']['id']}},_0x44fa30={};_0x44fa30[_0xb677('0x31')]=_[_0xb677('0x32')](db[_0xb677('0x2d')][_0xb677('0x2e')]);_0x44fa30[_0xb677('0x33')]=_[_0xb677('0x32')](_0x1bb4c4['query']);_0x44fa30[_0xb677('0x34')]=_[_0xb677('0x35')](_0x44fa30[_0xb677('0x31')],_0x44fa30[_0xb677('0x33')]);_0x590ff8['attributes']=_[_0xb677('0x35')](_0x44fa30[_0xb677('0x31')],qs[_0xb677('0x36')](_0x1bb4c4['query'][_0xb677('0x36')]));_0x590ff8[_0xb677('0x37')]=_0x590ff8[_0xb677('0x37')][_0xb677('0x38')]?_0x590ff8[_0xb677('0x37')]:_0x44fa30[_0xb677('0x31')];if(_0x1bb4c4[_0xb677('0x33')]['includeAll']){_0x590ff8[_0xb677('0x41')]=[{'all':!![]}];}_0x590ff8=_[_0xb677('0x45')]({},_0x590ff8,_0x1bb4c4['options']);return db['CmHopperHistory']['find'](_0x590ff8)['then'](handleEntityNotFound(_0x332b88,null))[_0xb677('0x26')](respondWithResult(_0x332b88,null))[_0xb677('0x43')](handleError(_0x332b88,null));};exports['create']=function(_0x2868dd,_0x4e4bd8){return db['CmHopperHistory'][_0xb677('0x46')](_0x2868dd['body'],{})[_0xb677('0x26')](respondWithResult(_0x4e4bd8,0xc9))[_0xb677('0x43')](handleError(_0x4e4bd8,null));};exports[_0xb677('0x47')]=function(_0x388eaf,_0x1c6207){return db[_0xb677('0x2d')][_0xb677('0x47')]()['then'](respondWithResult(_0x1c6207,null))[_0xb677('0x43')](handleError(_0x1c6207,null));};exports[_0xb677('0x25')]=function(_0x2eb630,_0x4b008d){if(_0x2eb630[_0xb677('0x48')][_0xb677('0x49')]){delete _0x2eb630[_0xb677('0x48')][_0xb677('0x49')];}return db[_0xb677('0x2d')][_0xb677('0x4a')]({'where':{'uniqueid':_0x2eb630[_0xb677('0x4b')]['id']}})[_0xb677('0x26')](handleEntityNotFound(_0x4b008d,null))['then'](saveUpdates(_0x2eb630[_0xb677('0x48')],null))[_0xb677('0x26')](respondWithResult(_0x4b008d,null))[_0xb677('0x43')](handleError(_0x4b008d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 724b407..096cd2c 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 _0x2cf5=['util','api','bluebird','request-promise','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x289f02,_0x396fb4){var _0x41a05f=function(_0x1e38ee){while(--_0x1e38ee){_0x289f02['push'](_0x289f02['shift']());}};_0x41a05f(++_0x396fb4);}(_0x2cf5,0x19f));var _0x52cf=function(_0x3dbc05,_0x281539){_0x3dbc05=_0x3dbc05-0x0;var _0x434833=_0x2cf5[_0x3dbc05];return _0x434833;};'use strict';var _=require(_0x52cf('0x0'));var util=require(_0x52cf('0x1'));var logger=require('../../config/logger')(_0x52cf('0x2'));var moment=require('moment');var BPromise=require(_0x52cf('0x3'));var rp=require(_0x52cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x52cf('0x5'));var attributes=require(_0x52cf('0x6'));module[_0x52cf('0x7')]=function(_0x1001bd,_0x31185d){return _0x1001bd[_0x52cf('0x8')](_0x52cf('0x9'),attributes,{'tableName':_0x52cf('0xa'),'paranoid':![],'indexes':[{'name':_0x52cf('0xb'),'fields':[_0x52cf('0xb')]},{'name':_0x52cf('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a85=['rimraf','../../config/environment','exports','CmHopperHistory','cm_hopper_history','endtime','../../config/logger','api','moment','path'];(function(_0x57b482,_0x503233){var _0x12bac4=function(_0x28d969){while(--_0x28d969){_0x57b482['push'](_0x57b482['shift']());}};_0x12bac4(++_0x503233);}(_0x1a85,0x178));var _0x51a8=function(_0x558097,_0x5a6cc2){_0x558097=_0x558097-0x0;var _0xe80464=_0x1a85[_0x558097];return _0xe80464;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./cmHopperHistory.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x51a8('0x9')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index a2c6f87..45158c1 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 _0x3299=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','create','options','raw','stringify','AvgHandleTime','CmHopperHistory','findAll','sequelize','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null'];(function(_0x521c86,_0x441430){var _0x2aba01=function(_0x1e0a57){while(--_0x1e0a57){_0x521c86['push'](_0x521c86['shift']());}};_0x2aba01(++_0x441430);}(_0x3299,0x1bc));var _0x9329=function(_0x4546bf,_0x3899e4){_0x4546bf=_0x4546bf-0x0;var _0x514c6e=_0x3299[_0x4546bf];return _0x514c6e;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['CmHopperHistory'][_0x9329('0x1a')](_0x1b5eed['body'],{'raw':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x6676d7){logger[_0x9329('0xf')](_0x9329('0x19'),_0x1b5eed);logger[_0x9329('0x11')](_0x9329('0x19'),_0x1b5eed,JSON[_0x9329('0x1d')](_0x6676d7));_0x41db73(_0x6676d7);})['catch'](function(_0x1fa600){logger[_0x9329('0x13')](_0x9329('0x19'),_0x1fa600[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x1fa600['message']));});});};exports[_0x9329('0x1e')]=function(_0x46019b){var _0x528927=this;return new Promise(function(_0x425240,_0x84dacf){return db[_0x9329('0x1f')][_0x9329('0x20')]({'raw':_0x46019b['options']?_0x46019b['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![],'where':_0x46019b[_0x9329('0x1b')]?_0x46019b[_0x9329('0x1b')]['where']||null:null,'attributes':[[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')][_0x9329('0x22')]('id')),_0x9329('0x23')],[db['sequelize']['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x9329('0x25')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x9329('0x21')]['fn']('AVG',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0x9329('0x21')]['fn'](_0x9329('0x29'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')]['literal'](_0x9329('0x2a')))),_0x9329('0x2b')]]})[_0x9329('0xe')](function(_0x1d7d20){logger[_0x9329('0xf')](_0x9329('0x1e'),_0x46019b);logger['debug'](_0x9329('0x1e'),_0x46019b,JSON[_0x9329('0x1d')](_0x1d7d20));_0x425240(_0x1d7d20);})[_0x9329('0x18')](function(_0x3ae0a5){logger[_0x9329('0x13')](_0x9329('0x1e'),_0x3ae0a5[_0x9329('0x15')],_0x46019b);_0x84dacf(_0x528927[_0x9329('0x13')](0x1f4,_0x3ae0a5['message']));});});};exports[_0x9329('0x2c')]=function(_0x4f5202){var _0x11dc44=this;return new Promise(function(_0x22086e,_0x37475b){return db[_0x9329('0x1f')][_0x9329('0x20')]({'raw':_0x4f5202[_0x9329('0x1b')]?_0x4f5202['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f5202[_0x9329('0x1b')]?_0x4f5202[_0x9329('0x1b')][_0x9329('0x2d')]||null:null,'attributes':[[_0x9329('0x2e'),_0x9329('0x2f')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x30')))),_0x9329('0x31')],[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x203,\x201,\x20null'))),_0x9329('0x32')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x9329('0x33')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x34')))),'outboundBusyCallsDay'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0x9329('0x35')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x36')))),_0x9329('0x37')],[db['sequelize']['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x38')))),_0x9329('0x39')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x3a')))),_0x9329('0x3b')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db['sequelize']['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x2013,\x201,\x20null'))),_0x9329('0x3c')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x2014,\x201,\x20null'))),_0x9329('0x3d')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db['sequelize']['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x3e')))),'outboundRejectCallsDay'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0x9329('0x3f')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x40')))),_0x9329('0x41')],[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x42')))),_0x9329('0x43')]],'group':[_0x9329('0x2e')]})[_0x9329('0xe')](function(_0x54431c){logger[_0x9329('0xf')](_0x9329('0x2c'),_0x4f5202);logger[_0x9329('0x11')](_0x9329('0x2c'),_0x4f5202,JSON[_0x9329('0x1d')](_0x54431c));_0x22086e(_0x54431c);})[_0x9329('0x18')](function(_0x2cdff6){logger[_0x9329('0x13')](_0x9329('0x2c'),_0x2cdff6[_0x9329('0x15')],_0x4f5202);_0x37475b(_0x11dc44[_0x9329('0x13')](0x1f4,_0x2cdff6[_0x9329('0x15')]));});});};exports[_0x9329('0x44')]=function(_0x3551b5){var _0x83c24a=this;return new Promise(function(_0x1aec36,_0x4ac39c){return db['CmHopperHistory'][_0x9329('0x20')]({'raw':_0x3551b5[_0x9329('0x1b')]?_0x3551b5[_0x9329('0x1b')][_0x9329('0x1c')]===undefined?!![]:![]:!![],'where':_0x3551b5[_0x9329('0x1b')]?_0x3551b5['options'][_0x9329('0x2d')]||null:null,'attributes':[[_0x9329('0x2e'),_0x9329('0x2f')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['col']('id')),'ivrTotalCallsDays'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x45')))),_0x9329('0x46')]],'group':[_0x9329('0x2e')]})['then'](function(_0x1e26d9){logger[_0x9329('0xf')](_0x9329('0x44'),_0x3551b5);logger[_0x9329('0x11')]('GetCampaignHopperHistory',_0x3551b5,JSON['stringify'](_0x1e26d9));_0x1aec36(_0x1e26d9);})[_0x9329('0x18')](function(_0x1fa2a2){logger[_0x9329('0x13')](_0x9329('0x44'),_0x1fa2a2[_0x9329('0x15')],_0x3551b5);_0x4ac39c(_0x83c24a[_0x9329('0x13')](0x1f4,_0x1fa2a2[_0x9329('0x15')]));});});}; \ No newline at end of file +var _0xcd18=['create','body','options','CreateCmHopperHistory','AvgHandleTime','raw','where','sequelize','col','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperHistory'];(function(_0x113fe4,_0x5ebae1){var _0x25a898=function(_0x460d57){while(--_0x460d57){_0x113fe4['push'](_0x113fe4['shift']());}};_0x25a898(++_0x5ebae1);}(_0xcd18,0xb4));var _0x8cd1=function(_0x119488,_0x13dd21){_0x119488=_0x119488-0x0;var _0x1bedb0=_0xcd18[_0x119488];return _0x1bedb0;};'use strict';var _=require(_0x8cd1('0x0'));var util=require(_0x8cd1('0x1'));var moment=require('moment');var BPromise=require(_0x8cd1('0x2'));var rs=require(_0x8cd1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cd1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8cd1('0x5'))(_0x8cd1('0x6'));var config=require('../../config/environment');var jayson=require(_0x8cd1('0x7'));var client=jayson[_0x8cd1('0x8')][_0x8cd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x375f15,_0x16eecb,_0x3cd29b){return new BPromise(function(_0x10b229,_0x52b6fd){return client[_0x8cd1('0xa')](_0x375f15,_0x3cd29b)[_0x8cd1('0xb')](function(_0x27028d){logger[_0x8cd1('0xc')](_0x8cd1('0xd'),_0x16eecb,_0x8cd1('0xe'));logger[_0x8cd1('0xf')](_0x8cd1('0x10'),_0x16eecb,'request\x20sent',JSON[_0x8cd1('0x11')](_0x27028d));if(_0x27028d[_0x8cd1('0x12')]){if(_0x27028d['error'][_0x8cd1('0x13')]===0x1f4){logger[_0x8cd1('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16eecb,_0x27028d[_0x8cd1('0x12')][_0x8cd1('0x14')]);return _0x52b6fd(_0x27028d[_0x8cd1('0x12')]['message']);}logger[_0x8cd1('0x12')](_0x8cd1('0xd'),_0x16eecb,_0x27028d[_0x8cd1('0x12')][_0x8cd1('0x14')]);return _0x10b229(_0x27028d[_0x8cd1('0x12')][_0x8cd1('0x14')]);}else{logger[_0x8cd1('0xc')](_0x8cd1('0xd'),_0x16eecb,'request\x20sent');_0x10b229(_0x27028d[_0x8cd1('0x15')][_0x8cd1('0x14')]);}})[_0x8cd1('0x16')](function(_0x4d1fce){logger[_0x8cd1('0x12')](_0x8cd1('0xd'),_0x16eecb,_0x4d1fce);_0x52b6fd(_0x4d1fce);});});}exports['CreateCmHopperHistory']=function(_0x2ceba1){var _0x159b45=this;return new Promise(function(_0x21dcc4,_0x5069ae){return db[_0x8cd1('0x17')][_0x8cd1('0x18')](_0x2ceba1[_0x8cd1('0x19')],{'raw':_0x2ceba1['options']?_0x2ceba1[_0x8cd1('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8cd1('0xb')](function(_0x168bf0){logger['info'](_0x8cd1('0x1b'),_0x2ceba1);logger[_0x8cd1('0xf')](_0x8cd1('0x1b'),_0x2ceba1,JSON['stringify'](_0x168bf0));_0x21dcc4(_0x168bf0);})['catch'](function(_0x1ed4bc){logger[_0x8cd1('0x12')](_0x8cd1('0x1b'),_0x1ed4bc['message'],_0x2ceba1);_0x5069ae(_0x159b45[_0x8cd1('0x12')](0x1f4,_0x1ed4bc[_0x8cd1('0x14')]));});});};exports[_0x8cd1('0x1c')]=function(_0x5dddcd){var _0x57c814=this;return new Promise(function(_0x55fe48,_0x19c08c){return db[_0x8cd1('0x17')]['findAll']({'raw':_0x5dddcd['options']?_0x5dddcd['options'][_0x8cd1('0x1d')]===undefined?!![]:![]:!![],'where':_0x5dddcd['options']?_0x5dddcd[_0x8cd1('0x1a')][_0x8cd1('0x1e')]||null:null,'attributes':[[db[_0x8cd1('0x1f')]['fn']('COUNT',db[_0x8cd1('0x1f')][_0x8cd1('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db['sequelize'][_0x8cd1('0x22')](_0x8cd1('0x23')))),_0x8cd1('0x24')],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')]['literal'](_0x8cd1('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')]['literal'](_0x8cd1('0x26')))),_0x8cd1('0x27')],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x28'),db[_0x8cd1('0x1f')]['fn']('IF',db['sequelize'][_0x8cd1('0x22')](_0x8cd1('0x29')))),_0x8cd1('0x2a')],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x28'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')](_0x8cd1('0x2b')))),_0x8cd1('0x2c')]]})[_0x8cd1('0xb')](function(_0x4f64c6){logger[_0x8cd1('0xc')](_0x8cd1('0x1c'),_0x5dddcd);logger['debug'](_0x8cd1('0x1c'),_0x5dddcd,JSON[_0x8cd1('0x11')](_0x4f64c6));_0x55fe48(_0x4f64c6);})[_0x8cd1('0x16')](function(_0x5ab6a2){logger[_0x8cd1('0x12')]('AvgHandleTime',_0x5ab6a2[_0x8cd1('0x14')],_0x5dddcd);_0x19c08c(_0x57c814['error'](0x1f4,_0x5ab6a2['message']));});});};exports[_0x8cd1('0x2d')]=function(_0x204b5c){var _0x5e399a=this;return new Promise(function(_0x3616e6,_0x4a4bd9){return db[_0x8cd1('0x17')][_0x8cd1('0x2e')]({'raw':_0x204b5c[_0x8cd1('0x1a')]?_0x204b5c['options'][_0x8cd1('0x1d')]===undefined?!![]:![]:!![],'where':_0x204b5c['options']?_0x204b5c[_0x8cd1('0x1a')]['where']||null:null,'attributes':[[_0x8cd1('0x2f'),'name'],[db['sequelize']['fn'](_0x8cd1('0x21'),db['sequelize']['fn']('IF',db[_0x8cd1('0x1f')]['literal'](_0x8cd1('0x30')))),'outboundNoSuchCallsDay'],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')](_0x8cd1('0x31')))),_0x8cd1('0x32')],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x8cd1('0x33')],[db['sequelize']['fn'](_0x8cd1('0x21'),db['sequelize']['fn']('IF',db[_0x8cd1('0x1f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x8cd1('0x34')],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')](_0x8cd1('0x35')))),'outboundCongestionCallsDay'],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x8cd1('0x22')](_0x8cd1('0x36')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')]['literal'](_0x8cd1('0x37')))),_0x8cd1('0x38')],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')]['literal'](_0x8cd1('0x39')))),'outboundUnknownCallsDay'],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0x8cd1('0x3a')],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')](_0x8cd1('0x3b')))),_0x8cd1('0x3c')],[db['sequelize']['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db['sequelize'][_0x8cd1('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x8cd1('0x3d')],[db['sequelize']['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')](_0x8cd1('0x3e')))),_0x8cd1('0x3f')],[db['sequelize']['fn']('COUNT',db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')](_0x8cd1('0x40')))),_0x8cd1('0x3d')],[db['sequelize']['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x8cd1('0x2f')]})[_0x8cd1('0xb')](function(_0x53e6d6){logger[_0x8cd1('0xc')]('GetVoiceQueueHopperHistory',_0x204b5c);logger[_0x8cd1('0xf')](_0x8cd1('0x2d'),_0x204b5c,JSON['stringify'](_0x53e6d6));_0x3616e6(_0x53e6d6);})[_0x8cd1('0x16')](function(_0x114940){logger[_0x8cd1('0x12')](_0x8cd1('0x2d'),_0x114940['message'],_0x204b5c);_0x4a4bd9(_0x5e399a[_0x8cd1('0x12')](0x1f4,_0x114940['message']));});});};exports[_0x8cd1('0x41')]=function(_0x354560){var _0x5542a3=this;return new Promise(function(_0x4f82a5,_0x158962){return db['CmHopperHistory'][_0x8cd1('0x2e')]({'raw':_0x354560[_0x8cd1('0x1a')]?_0x354560['options'][_0x8cd1('0x1d')]===undefined?!![]:![]:!![],'where':_0x354560[_0x8cd1('0x1a')]?_0x354560[_0x8cd1('0x1a')][_0x8cd1('0x1e')]||null:null,'attributes':[[_0x8cd1('0x2f'),'name'],[db[_0x8cd1('0x1f')]['fn'](_0x8cd1('0x21'),db[_0x8cd1('0x1f')][_0x8cd1('0x20')]('id')),_0x8cd1('0x42')],[db['sequelize']['fn']('COUNT',db[_0x8cd1('0x1f')]['fn']('IF',db[_0x8cd1('0x1f')][_0x8cd1('0x22')](_0x8cd1('0x23')))),_0x8cd1('0x43')]],'group':[_0x8cd1('0x2f')]})[_0x8cd1('0xb')](function(_0x5835ef){logger['info'](_0x8cd1('0x41'),_0x354560);logger[_0x8cd1('0xf')](_0x8cd1('0x41'),_0x354560,JSON[_0x8cd1('0x11')](_0x5835ef));_0x4f82a5(_0x5835ef);})[_0x8cd1('0x16')](function(_0x296fa1){logger['error'](_0x8cd1('0x41'),_0x296fa1[_0x8cd1('0x14')],_0x354560);_0x158962(_0x5542a3[_0x8cd1('0x12')](0x1f4,_0x296fa1[_0x8cd1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 6e34f29..aa36cc7 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 _0xbd7d=['Router','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','post','put','update','multer','util','path','connect-timeout','express'];(function(_0x1305d3,_0x47be29){var _0x883447=function(_0x5ddf06){while(--_0x5ddf06){_0x1305d3['push'](_0x1305d3['shift']());}};_0x883447(++_0x47be29);}(_0xbd7d,0xeb));var _0xdbd7=function(_0x35aeda,_0x264a31){_0x35aeda=_0x35aeda-0x0;var _0x40498c=_0xbd7d[_0x35aeda];return _0x40498c;};'use strict';var multer=require(_0xdbd7('0x0'));var util=require(_0xdbd7('0x1'));var path=require(_0xdbd7('0x2'));var timeout=require(_0xdbd7('0x3'));var express=require(_0xdbd7('0x4'));var router=express[_0xdbd7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdbd7('0x6'));var controller=require(_0xdbd7('0x7'));router[_0xdbd7('0x8')]('/',auth[_0xdbd7('0x9')](),controller['index']);router[_0xdbd7('0x8')](_0xdbd7('0xa'),auth[_0xdbd7('0x9')](),controller[_0xdbd7('0xb')]);router['get'](_0xdbd7('0xc'),auth[_0xdbd7('0x9')](),controller['show']);router[_0xdbd7('0xd')]('/',auth[_0xdbd7('0x9')](),controller['create']);router[_0xdbd7('0xe')](_0xdbd7('0xc'),auth[_0xdbd7('0x9')](),controller[_0xdbd7('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5568=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','index','get','/describe','/:id','isAuthenticated'];(function(_0x2ba665,_0x30361e){var _0xc5e4f5=function(_0x416a73){while(--_0x416a73){_0x2ba665['push'](_0x2ba665['shift']());}};_0xc5e4f5(++_0x30361e);}(_0x5568,0xf6));var _0x8556=function(_0xbd7b15,_0x2f324e){_0xbd7b15=_0xbd7b15-0x0;var _0x28ee0b=_0x5568[_0xbd7b15];return _0x28ee0b;};'use strict';var multer=require(_0x8556('0x0'));var util=require(_0x8556('0x1'));var path=require(_0x8556('0x2'));var timeout=require(_0x8556('0x3'));var express=require(_0x8556('0x4'));var router=express[_0x8556('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8556('0x6'));var config=require(_0x8556('0x7'));var controller=require(_0x8556('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8556('0x9')]);router[_0x8556('0xa')](_0x8556('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8556('0xa')](_0x8556('0xc'),auth[_0x8556('0xd')](),controller[_0x8556('0xe')]);router[_0x8556('0xf')]('/',auth['isAuthenticated'](),controller[_0x8556('0x10')]);router[_0x8556('0x11')]('/:id',auth[_0x8556('0xd')](),controller[_0x8556('0x12')]);module[_0x8556('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 9e5a401..f79f11a 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 _0x00bb=['STRING','sequelize','exports'];(function(_0x47a8c0,_0x4d5931){var _0x551fa1=function(_0x45ac5a){while(--_0x45ac5a){_0x47a8c0['push'](_0x47a8c0['shift']());}};_0x551fa1(++_0x4d5931);}(_0x00bb,0x1d8));var _0xb00b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x00bb[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'name':{'type':Sequelize[_0xb00b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb00b('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe14f=['STRING','name','sequelize','exports'];(function(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0xe14f,0xea));var _0xfe14=function(_0x5ec36f,_0x33e2d5){_0x5ec36f=_0x5ec36f-0x0;var _0x152681=_0xe14f[_0x5ec36f];return _0x152681;};'use strict';var Sequelize=require(_0xfe14('0x0'));module[_0xfe14('0x1')]={'name':{'type':Sequelize[_0xfe14('0x2')],'unique':_0xfe14('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfe14('0x2')]},'dialPrefix':{'type':Sequelize[_0xfe14('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 778c78a..046cac5 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 _0x7e06=['format','cf_%d','raw','CmCustomField','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','Lists','UserProfileResource','end','sendStatus','error','stack','name','send','index','CmList','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','describe','Disposition','getDispositions','findOne','ListId','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','concat','CustomFields'];(function(_0x4cdc4b,_0x38e843){var _0x3dce2c=function(_0x4105c6){while(--_0x4105c6){_0x4cdc4b['push'](_0x4cdc4b['shift']());}};_0x3dce2c(++_0x38e843);}(_0x7e06,0x14a));var _0x67e0=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0x7e06[_0x33155c];return _0x5becf7;};'use strict';var emlformat=require(_0x67e0('0x0'));var rimraf=require(_0x67e0('0x1'));var zipdir=require(_0x67e0('0x2'));var jsonpatch=require(_0x67e0('0x3'));var rp=require(_0x67e0('0x4'));var moment=require(_0x67e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x67e0('0x6'));var util=require(_0x67e0('0x7'));var path=require(_0x67e0('0x8'));var sox=require(_0x67e0('0x9'));var csv=require('to-csv');var ejs=require(_0x67e0('0xa'));var fs=require('fs');var fs_extra=require(_0x67e0('0xb'));var _=require(_0x67e0('0xc'));var squel=require(_0x67e0('0xd'));var crypto=require(_0x67e0('0xe'));var jsforce=require(_0x67e0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x67e0('0x10'));var querystring=require(_0x67e0('0x11'));var Papa=require(_0x67e0('0x12'));var Redis=require(_0x67e0('0x13'));var authService=require(_0x67e0('0x14'));var qs=require(_0x67e0('0x15'));var as=require(_0x67e0('0x16'));var hardwareService=require(_0x67e0('0x17'));var logger=require(_0x67e0('0x18'))('api');var utils=require(_0x67e0('0x19'));var config=require(_0x67e0('0x1a'));var licenseUtil=require(_0x67e0('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x67e0('0x1c')](config[_0x67e0('0x1d')],{'host':_0x67e0('0x1e'),'port':0x18eb});var socket=require(_0x67e0('0x1f'))(new Redis(config[_0x67e0('0x1d')]));require(_0x67e0('0x20'))[_0x67e0('0x21')](socket);function respondWithStatusCode(_0x56a3af,_0x2233b1){_0x2233b1=_0x2233b1||0xcc;return function(_0x36b854){if(_0x36b854){return _0x56a3af['sendStatus'](_0x2233b1);}return _0x56a3af[_0x67e0('0x22')](_0x2233b1)['end']();};}function respondWithResult(_0x55f6af,_0x4f4f17){_0x4f4f17=_0x4f4f17||0xc8;return function(_0x22eae9){if(_0x22eae9){return _0x55f6af['status'](_0x4f4f17)[_0x67e0('0x23')](_0x22eae9);}};}function respondWithFilteredResult(_0x324b2a,_0x6108a8){return function(_0x3b778f){if(_0x3b778f){var _0x2f2a9f=typeof _0x6108a8['offset']===_0x67e0('0x24')&&typeof _0x6108a8[_0x67e0('0x25')]===_0x67e0('0x24');var _0x5e6e38=_0x3b778f[_0x67e0('0x26')];var _0x28edac=_0x2f2a9f?0x0:_0x6108a8[_0x67e0('0x27')];var _0x333fce=_0x2f2a9f?_0x3b778f[_0x67e0('0x26')]:_0x6108a8[_0x67e0('0x27')]+_0x6108a8[_0x67e0('0x25')];var _0x5c0fc9;if(_0x333fce>=_0x5e6e38){_0x333fce=_0x5e6e38;_0x5c0fc9=0xc8;}else{_0x5c0fc9=0xce;}_0x324b2a['status'](_0x5c0fc9);return _0x324b2a[_0x67e0('0x28')](_0x67e0('0x29'),_0x28edac+'-'+_0x333fce+'/'+_0x5e6e38)['json'](_0x3b778f);}return null;};}function patchUpdates(_0xd032ad){return function(_0x21f214){try{jsonpatch[_0x67e0('0x2a')](_0x21f214,_0xd032ad,!![]);}catch(_0x40a78c){return BPromise['reject'](_0x40a78c);}return _0x21f214['save']();};}function saveUpdates(_0x5cbe0b,_0x2e5209){return function(_0xdcc2ca){if(_0xdcc2ca){return _0xdcc2ca[_0x67e0('0x2b')](_0x5cbe0b)[_0x67e0('0x2c')](function(_0xa56068){return _0xa56068;});}return null;};}function removeEntity(_0x89c663,_0x20edad){return function(_0x461fe5){if(_0x461fe5){return _0x461fe5['destroy']()['then'](function(){var _0x3f6aff=_0x461fe5['get']({'plain':!![]});var _0x4cfd8c=_0x67e0('0x2d');return db[_0x67e0('0x2e')]['destroy']({'where':{'type':_0x4cfd8c,'resourceId':_0x3f6aff['id']}})['then'](function(){return _0x461fe5;});})['then'](function(){_0x89c663['status'](0xcc)[_0x67e0('0x2f')]();});}};}function handleEntityNotFound(_0x2f84af,_0x1297f2){return function(_0x172c5c){if(!_0x172c5c){_0x2f84af[_0x67e0('0x30')](0x194);}return _0x172c5c;};}function handleError(_0x1bcf99,_0x1ab48c){_0x1ab48c=_0x1ab48c||0x1f4;return function(_0x58a9d5){logger[_0x67e0('0x31')](_0x58a9d5[_0x67e0('0x32')]);if(_0x58a9d5[_0x67e0('0x33')]){delete _0x58a9d5['name'];}_0x1bcf99[_0x67e0('0x22')](_0x1ab48c)[_0x67e0('0x34')](_0x58a9d5);};}exports[_0x67e0('0x35')]=function(_0xeec987,_0x378e4a){var _0x8cb852={},_0x15762c={},_0x3a0833={'count':0x0,'rows':[]};var _0x3f54ac=_['map'](db[_0x67e0('0x36')][_0x67e0('0x37')],function(_0xd80362){return{'name':_0xd80362[_0x67e0('0x38')],'type':_0xd80362['type'][_0x67e0('0x39')]};});_0x15762c['model']=_[_0x67e0('0x3a')](_0x3f54ac,_0x67e0('0x33'));_0x15762c['query']=_[_0x67e0('0x3b')](_0xeec987[_0x67e0('0x3c')]);_0x15762c[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x15762c[_0x67e0('0x3f')],_0x15762c['query']);_0x8cb852[_0x67e0('0x40')]=_[_0x67e0('0x3e')](_0x15762c[_0x67e0('0x3f')],qs['fields'](_0xeec987[_0x67e0('0x3c')]['fields']));_0x8cb852[_0x67e0('0x40')]=_0x8cb852[_0x67e0('0x40')][_0x67e0('0x41')]?_0x8cb852[_0x67e0('0x40')]:_0x15762c['model'];if(!_0xeec987[_0x67e0('0x3c')][_0x67e0('0x42')](_0x67e0('0x43'))){_0x8cb852['limit']=qs[_0x67e0('0x25')](_0xeec987[_0x67e0('0x3c')]['limit']);_0x8cb852['offset']=qs[_0x67e0('0x27')](_0xeec987[_0x67e0('0x3c')][_0x67e0('0x27')]);}_0x8cb852[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0xeec987[_0x67e0('0x3c')][_0x67e0('0x45')]);_0x8cb852[_0x67e0('0x46')]=qs[_0x67e0('0x3d')](_[_0x67e0('0x47')](_0xeec987[_0x67e0('0x3c')],_0x15762c['filters']),_0x3f54ac);if(_0xeec987['query'][_0x67e0('0x48')]){_0x8cb852[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x8cb852['where'],{'$or':_['map'](_0x3f54ac,function(_0x1266d1){if(_0x1266d1[_0x67e0('0x4a')]!==_0x67e0('0x4b')){var _0xe077ee={};_0xe077ee[_0x1266d1[_0x67e0('0x33')]]={'$like':'%'+_0xeec987[_0x67e0('0x3c')]['filter']+'%'};return _0xe077ee;}})});}_0x8cb852=_[_0x67e0('0x49')]({},_0x8cb852,_0xeec987[_0x67e0('0x4c')]);var _0x42c30d={'where':_0x8cb852[_0x67e0('0x46')]};return db[_0x67e0('0x36')][_0x67e0('0x26')](_0x42c30d)['then'](function(_0x1c03d4){_0x3a0833[_0x67e0('0x26')]=_0x1c03d4;if(_0xeec987['query'][_0x67e0('0x4d')]){_0x8cb852[_0x67e0('0x4e')]=[{'all':!![]}];}return db[_0x67e0('0x36')][_0x67e0('0x4f')](_0x8cb852);})[_0x67e0('0x2c')](function(_0x558da5){_0x3a0833[_0x67e0('0x50')]=_0x558da5;return _0x3a0833;})['then'](respondWithFilteredResult(_0x378e4a,_0x8cb852))[_0x67e0('0x51')](handleError(_0x378e4a,null));};exports[_0x67e0('0x52')]=function(_0x2249cc,_0x89c167){var _0x32522a={'raw':![],'where':{'id':_0x2249cc['params']['id']}},_0x2e9e57={};_0x2e9e57[_0x67e0('0x3f')]=_[_0x67e0('0x3b')](db[_0x67e0('0x36')][_0x67e0('0x37')]);_0x2e9e57[_0x67e0('0x3c')]=_[_0x67e0('0x3b')](_0x2249cc['query']);_0x2e9e57[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x2e9e57[_0x67e0('0x3f')],_0x2e9e57[_0x67e0('0x3c')]);_0x32522a['attributes']=_[_0x67e0('0x3e')](_0x2e9e57[_0x67e0('0x3f')],qs[_0x67e0('0x53')](_0x2249cc['query'][_0x67e0('0x53')]));_0x32522a[_0x67e0('0x40')]=_0x32522a[_0x67e0('0x40')][_0x67e0('0x41')]?_0x32522a[_0x67e0('0x40')]:_0x2e9e57[_0x67e0('0x3f')];if(_0x2249cc[_0x67e0('0x3c')][_0x67e0('0x4d')]){_0x32522a[_0x67e0('0x4e')]=[{'all':!![]}];}_0x32522a=_[_0x67e0('0x49')]({},_0x32522a,_0x2249cc[_0x67e0('0x4c')]);return db[_0x67e0('0x36')][_0x67e0('0x54')](_0x32522a)[_0x67e0('0x2c')](handleEntityNotFound(_0x89c167,null))['then'](respondWithResult(_0x89c167,null))[_0x67e0('0x51')](handleError(_0x89c167,null));};exports[_0x67e0('0x55')]=function(_0x28fc98,_0x9b7d0a){return db[_0x67e0('0x36')][_0x67e0('0x55')](_0x28fc98['body'],{})['then'](function(_0x8cbec9){var _0x339b56=_0x28fc98[_0x67e0('0x56')][_0x67e0('0x57')]({'plain':!![]});if(!_0x339b56)throw new Error(_0x67e0('0x58'));if(_0x339b56[_0x67e0('0x59')]==='user'){var _0x1f503f=_0x8cbec9[_0x67e0('0x57')]({'plain':!![]});var _0x4a815a=_0x67e0('0x2d');return db[_0x67e0('0x5a')][_0x67e0('0x54')]({'where':{'name':_0x4a815a,'userProfileId':_0x339b56['userProfileId']},'raw':!![]})[_0x67e0('0x2c')](function(_0x3f5405){if(_0x3f5405&&_0x3f5405['autoAssociation']===0x0){return db[_0x67e0('0x2e')][_0x67e0('0x55')]({'name':_0x1f503f[_0x67e0('0x33')],'resourceId':_0x1f503f['id'],'type':_0x3f5405['name'],'sectionId':_0x3f5405['id']},{})[_0x67e0('0x2c')](function(){return _0x8cbec9;});}else{return _0x8cbec9;}})[_0x67e0('0x51')](function(_0x3bacc6){logger[_0x67e0('0x31')](_0x67e0('0x5b'),_0x3bacc6);throw _0x3bacc6;});}return _0x8cbec9;})[_0x67e0('0x2c')](respondWithResult(_0x9b7d0a,0xc9))[_0x67e0('0x51')](handleError(_0x9b7d0a,null));};exports['update']=function(_0x39b8c2,_0x27cdc2){if(_0x39b8c2['body']['id']){delete _0x39b8c2[_0x67e0('0x5c')]['id'];}return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x39b8c2['params']['id']}})['then'](handleEntityNotFound(_0x27cdc2,null))[_0x67e0('0x2c')](saveUpdates(_0x39b8c2[_0x67e0('0x5c')],null))[_0x67e0('0x2c')](respondWithResult(_0x27cdc2,null))[_0x67e0('0x51')](handleError(_0x27cdc2,null));};exports[_0x67e0('0x5d')]=function(_0x1d59b5,_0x582a59){return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x1d59b5[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x582a59,null))[_0x67e0('0x2c')](removeEntity(_0x582a59,null))['catch'](handleError(_0x582a59,null));};exports['describe']=function(_0x2520ee,_0x541f78){return db['CmList'][_0x67e0('0x5f')]()[_0x67e0('0x2c')](respondWithResult(_0x541f78,null))[_0x67e0('0x51')](handleError(_0x541f78,null));};exports['addDisposition']=function(_0x1bd63d,_0x4ac86a,_0x42c3fc){if(_0x1bd63d[_0x67e0('0x5c')]['id']){delete _0x1bd63d[_0x67e0('0x5c')]['id'];}return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x1bd63d[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x4ac86a,null))[_0x67e0('0x2c')](function(_0x1f6934){if(_0x1f6934){_0x1bd63d[_0x67e0('0x5c')]['ListId']=_0x1f6934['id'];return db[_0x67e0('0x60')][_0x67e0('0x55')](_0x1bd63d[_0x67e0('0x5c')]);}})['then'](respondWithResult(_0x4ac86a,null))[_0x67e0('0x51')](handleError(_0x4ac86a,null));};exports[_0x67e0('0x61')]=function(_0x551038,_0x436525,_0x58618c){var _0xa73ef7={'raw':![],'where':{}};var _0x1f2f1d={};var _0x57ca26={'count':0x0,'rows':[]};return db[_0x67e0('0x36')][_0x67e0('0x62')]({'where':{'id':_0x551038[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x436525,null))[_0x67e0('0x2c')](function(_0x1538da){if(_0x1538da){_0x1f2f1d[_0x67e0('0x3f')]=_['keys'](db[_0x67e0('0x60')][_0x67e0('0x37')]);_0x1f2f1d[_0x67e0('0x3c')]=_['keys'](_0x551038[_0x67e0('0x3c')]);_0x1f2f1d[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x1f2f1d['model'],_0x1f2f1d[_0x67e0('0x3c')]);_0xa73ef7[_0x67e0('0x40')]=_[_0x67e0('0x3e')](_0x1f2f1d[_0x67e0('0x3f')],qs[_0x67e0('0x53')](_0x551038[_0x67e0('0x3c')]['fields']));_0xa73ef7['attributes']=_0xa73ef7[_0x67e0('0x40')][_0x67e0('0x41')]?_0xa73ef7[_0x67e0('0x40')]:_0x1f2f1d[_0x67e0('0x3f')];if(!_0x551038[_0x67e0('0x3c')][_0x67e0('0x42')](_0x67e0('0x43'))){_0xa73ef7[_0x67e0('0x25')]=qs[_0x67e0('0x25')](_0x551038[_0x67e0('0x3c')][_0x67e0('0x25')]);_0xa73ef7['offset']=qs[_0x67e0('0x27')](_0x551038['query'][_0x67e0('0x27')]);}_0xa73ef7[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0x551038[_0x67e0('0x3c')][_0x67e0('0x45')]);_0xa73ef7[_0x67e0('0x46')]=qs[_0x67e0('0x3d')](_[_0x67e0('0x47')](_0x551038['query'],_0x1f2f1d[_0x67e0('0x3d')]));_0xa73ef7[_0x67e0('0x46')][_0x67e0('0x63')]=_0x1538da['id'];if(_0x551038['query']['filter']){_0xa73ef7[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0xa73ef7[_0x67e0('0x46')],{'$or':_[_0x67e0('0x3a')](_0xa73ef7[_0x67e0('0x40')],function(_0xd93a){var _0x2a403d={};_0x2a403d[_0xd93a]={'$like':'%'+_0x551038[_0x67e0('0x3c')][_0x67e0('0x48')]+'%'};return _0x2a403d;})});}_0xa73ef7=_[_0x67e0('0x49')]({},_0xa73ef7,_0x551038[_0x67e0('0x4c')]);return db[_0x67e0('0x60')][_0x67e0('0x26')]({'where':_0xa73ef7[_0x67e0('0x46')]})[_0x67e0('0x2c')](function(_0x28aa96){_0x57ca26[_0x67e0('0x26')]=_0x28aa96;if(_0x551038['query'][_0x67e0('0x4d')]){_0xa73ef7[_0x67e0('0x4e')]=[{'all':!![]}];}return db[_0x67e0('0x60')][_0x67e0('0x4f')](_0xa73ef7);})[_0x67e0('0x2c')](function(_0x37d3e7){_0x57ca26[_0x67e0('0x50')]=_0x37d3e7;return _0x57ca26;});}})[_0x67e0('0x2c')](respondWithFilteredResult(_0x436525,_0xa73ef7))['catch'](handleError(_0x436525,null));};exports[_0x67e0('0x64')]=function(_0x44c752,_0x8f6cb5,_0x4041e3){return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x44c752['params']['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x8f6cb5,null))[_0x67e0('0x2c')](function(_0x2be77c){if(_0x2be77c){return _0x2be77c[_0x67e0('0x64')](_0x44c752[_0x67e0('0x3c')][_0x67e0('0x65')]);}})[_0x67e0('0x2c')](respondWithStatusCode(_0x8f6cb5,null))[_0x67e0('0x51')](handleError(_0x8f6cb5,null));};exports[_0x67e0('0x66')]=function(_0x10c972,_0x19f9fb,_0x25bd39){return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x10c972['params']['id']}})['then'](handleEntityNotFound(_0x19f9fb,null))[_0x67e0('0x2c')](function(_0x38c327){if(_0x38c327){var _0x428689=[];var _0x354013={'success':[],'errors':[]};return db[_0x67e0('0x67')]['describe']()[_0x67e0('0x2c')](function(_0x3e643d){if(_0x10c972[_0x67e0('0x5c')]['tags']&&_[_0x67e0('0x68')](_0x10c972['body']['tags'])){if(_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')]['length']){_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')]=_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')][_0x67e0('0x6a')](';')+';';}else{_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')]=null;}}else{_0x10c972[_0x67e0('0x5c')][_0x67e0('0x69')]=null;}if(_0x10c972['body']&&_[_0x67e0('0x68')](_0x10c972['body'])){for(var _0x57e993=0x0;_0x57e993<_0x10c972[_0x67e0('0x5c')][_0x67e0('0x41')];_0x57e993+=0x1){_0x10c972[_0x67e0('0x5c')][_0x57e993]['ListId']=_0x10c972[_0x67e0('0x5e')]['id'];_0x428689[_0x67e0('0x6b')](_0x10c972['body'][_0x57e993]);}return BPromise[_0x67e0('0x6c')](_0x428689,function(_0x11bf48){return db['CmContact']['create'](_[_0x67e0('0x6d')](_0x11bf48,[_0x67e0('0x65'),'id'])||{},{'fields':_[_0x67e0('0x3b')](_0x3e643d),'raw':!![]})[_0x67e0('0x2c')](function(_0x29e714){_0x354013[_0x67e0('0x6e')][_0x67e0('0x6b')](_0x29e714[_0x67e0('0x6f')]);})[_0x67e0('0x51')](function(_0x53cffc){_0x354013[_0x67e0('0x70')][_0x67e0('0x6b')]({'data':_0x11bf48,'error':_0x53cffc['message']});});})[_0x67e0('0x2c')](function(_0x3319c6){return _0x354013;})[_0x67e0('0x51')](function(_0x5877ea){return _0x5877ea;});}else{_0x19f9fb[_0x67e0('0x22')](0x190)['json']({'message':_0x67e0('0x71')});}});}})['then'](respondWithResult(_0x19f9fb,null))[_0x67e0('0x51')](handleError(_0x19f9fb,null));};exports[_0x67e0('0x72')]=function(_0x5606c5,_0x55b4ee,_0x5772d0){var _0x9cc511;return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x5606c5[_0x67e0('0x5e')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x67e0('0x2c')](handleEntityNotFound(_0x55b4ee,null))[_0x67e0('0x2c')](function(_0x4eb9b4){if(_0x4eb9b4){_0x9cc511=_0x4eb9b4;return db[_0x67e0('0x67')][_0x67e0('0x37')];}})['then'](function(_0x2a1995){if(_0x2a1995){var _0x3e6764={};var _0x3ce138={};_0x3ce138[_0x67e0('0x3f')]=_[_0x67e0('0x73')](_[_0x67e0('0x3b')](_0x2a1995),_[_0x67e0('0x3a')](_0x9cc511[_0x67e0('0x74')],function(_0x368aa4){return util[_0x67e0('0x75')](_0x67e0('0x76'),_0x368aa4['id']);}));_0x3ce138[_0x67e0('0x3c')]=_[_0x67e0('0x3b')](_0x5606c5[_0x67e0('0x3c')]);_0x3ce138[_0x67e0('0x3d')]=_['intersection'](_0x3ce138['model'],_0x3ce138[_0x67e0('0x3c')]);_0x3e6764[_0x67e0('0x40')]=_['intersection'](_0x3ce138[_0x67e0('0x3f')],qs[_0x67e0('0x53')](_0x5606c5['query'][_0x67e0('0x53')]));_0x3e6764[_0x67e0('0x40')]=_0x3e6764[_0x67e0('0x40')][_0x67e0('0x41')]?_0x3e6764[_0x67e0('0x40')]:_0x3ce138['model'];if(!_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x42')](_0x67e0('0x43'))){_0x3e6764[_0x67e0('0x25')]=qs['limit'](_0x5606c5[_0x67e0('0x3c')]['limit']);_0x3e6764[_0x67e0('0x27')]=qs[_0x67e0('0x27')](_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x27')]);}_0x3e6764[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x45')]);_0x3e6764[_0x67e0('0x46')]=qs['filters'](_[_0x67e0('0x47')](_0x5606c5[_0x67e0('0x3c')],_0x3ce138[_0x67e0('0x3d')]));_0x3e6764[_0x67e0('0x77')]=!![];if(_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x48')]){_0x3e6764[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x3e6764[_0x67e0('0x46')],{'$or':_['map'](_0x3e6764[_0x67e0('0x40')],function(_0x560906){var _0x3337a6={};_0x3337a6[_0x560906]={'$like':'%'+_0x5606c5[_0x67e0('0x3c')][_0x67e0('0x48')]+'%'};return _0x3337a6;})});}_0x3e6764=_[_0x67e0('0x49')]({},_0x3e6764,_0x5606c5[_0x67e0('0x4c')]);return _0x9cc511['getContacts'](_0x3e6764);}})[_0x67e0('0x2c')](respondWithResult(_0x55b4ee,null))[_0x67e0('0x51')](handleError(_0x55b4ee,null));};exports['getContactsCsv']=function(_0x309f38,_0x51d182,_0x103572){var _0x5af785;return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0x309f38['params']['id']},'include':[{'model':db[_0x67e0('0x78')],'as':_0x67e0('0x74')}]})['then'](handleEntityNotFound(_0x51d182,null))[_0x67e0('0x2c')](function(_0x787618){if(_0x787618){_0x5af785=_0x787618;return db['CmContact'][_0x67e0('0x37')];}})[_0x67e0('0x2c')](function(_0x21ff88){if(_0x21ff88){var _0x455635={};var _0x312127={};_0x312127[_0x67e0('0x3f')]=_['concat'](_[_0x67e0('0x3b')](_0x21ff88),_[_0x67e0('0x3a')](_0x5af785[_0x67e0('0x74')],function(_0x35a013){return util[_0x67e0('0x75')](_0x67e0('0x76'),_0x35a013['id']);}));_0x312127[_0x67e0('0x3c')]=_[_0x67e0('0x3b')](_0x309f38['query']);_0x312127[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x312127[_0x67e0('0x3f')],_0x312127[_0x67e0('0x3c')]);_0x455635[_0x67e0('0x40')]=_[_0x67e0('0x3e')](_0x312127[_0x67e0('0x3f')],qs[_0x67e0('0x53')](_0x309f38[_0x67e0('0x3c')][_0x67e0('0x53')]));_0x455635['attributes']=_0x455635[_0x67e0('0x40')][_0x67e0('0x41')]?_0x455635[_0x67e0('0x40')]:_0x312127['model'];if(!_0x309f38[_0x67e0('0x3c')][_0x67e0('0x42')]('nolimit')){_0x455635[_0x67e0('0x25')]=qs['limit'](_0x309f38[_0x67e0('0x3c')][_0x67e0('0x25')]);_0x455635[_0x67e0('0x27')]=qs['offset'](_0x309f38[_0x67e0('0x3c')]['offset']);}_0x455635[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0x309f38['query'][_0x67e0('0x45')]);_0x455635[_0x67e0('0x46')]=qs[_0x67e0('0x3d')](_[_0x67e0('0x47')](_0x309f38[_0x67e0('0x3c')],_0x312127[_0x67e0('0x3d')]));_0x455635['raw']=!![];if(_0x309f38[_0x67e0('0x3c')][_0x67e0('0x48')]){_0x455635[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x455635['where'],{'$or':_[_0x67e0('0x3a')](_0x455635['attributes'],function(_0x140742){var _0x376559={};_0x376559[_0x140742]={'$like':'%'+_0x309f38['query'][_0x67e0('0x48')]+'%'};return _0x376559;})});}_0x455635=_[_0x67e0('0x49')]({},_0x455635,_0x309f38[_0x67e0('0x4c')]);return _0x5af785['getContacts'](_0x455635);}})[_0x67e0('0x2c')](function(_0x3ed59d){if(!_['isEmpty'](_0x3ed59d)){var _0x3867d3=toCsv(_0x3ed59d);var _0x362d9e=Date['now']();fs[_0x67e0('0x79')](util[_0x67e0('0x75')](_0x67e0('0x7a'),_0x5af785['id'],_0x362d9e),_0x3867d3);_0x51d182[_0x67e0('0x7b')](_0x67e0('0x7c'),_0x67e0('0x7d')+util[_0x67e0('0x75')](_0x67e0('0x7e'),_0x5af785['id'],_0x362d9e));_0x51d182[_0x67e0('0x7b')](_0x67e0('0x7f'),_0x67e0('0x80'));return _0x51d182[_0x67e0('0x81')](util['format'](_0x67e0('0x7a'),_0x5af785['id'],_0x362d9e));}else{return _0x51d182[_0x67e0('0x30')](0xcc);}})[_0x67e0('0x51')](handleError(_0x51d182,null));};exports['addCustomField']=function(_0x20e7be,_0x7713dd,_0x5d94f6){var _0x34ab57;delete _0x20e7be[_0x67e0('0x5c')]['id'];return db[_0x67e0('0x36')][_0x67e0('0x62')]({'where':{'id':_0x20e7be[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x7713dd,null))[_0x67e0('0x2c')](function(_0x361195){if(_0x361195){return db[_0x67e0('0x82')][_0x67e0('0x83')](function(_0x2bcea1){return db['CmCustomField']['create'](_0x20e7be[_0x67e0('0x5c')],{'transaction':_0x2bcea1})[_0x67e0('0x2c')](function(_0x3a663d){_0x34ab57=_0x3a663d;return _0x361195['addCustomFields'](_0x3a663d,{'transaction':_0x2bcea1});})[_0x67e0('0x2c')](function(){var _0x3d940a={'type':db[_0x67e0('0x84')][_0x67e0('0x85')],'transaction':_0x2bcea1};switch(_0x20e7be[_0x67e0('0x5c')][_0x67e0('0x4a')]){case _0x67e0('0x86'):_0x3d940a[_0x67e0('0x4a')]=db[_0x67e0('0x84')][_0x67e0('0x85')];break;case'number':_0x3d940a[_0x67e0('0x4a')]=db[_0x67e0('0x84')]['INTEGER'];break;case _0x67e0('0x87'):_0x3d940a[_0x67e0('0x4a')]=db[_0x67e0('0x84')][_0x67e0('0x88')];_0x3d940a[_0x67e0('0x89')]=![];break;default:}return db[_0x67e0('0x82')][_0x67e0('0x8a')][_0x67e0('0x8b')](_0x67e0('0x8c'),util[_0x67e0('0x75')]('cf_%s',_0x34ab57['id']),_0x3d940a);})[_0x67e0('0x2c')](function(){return _0x34ab57;});});}})['then'](respondWithResult(_0x7713dd,null))[_0x67e0('0x51')](handleError(_0x7713dd,null));};exports['getCustomFields']=function(_0x2511bd,_0x514474,_0x494d1d){var _0x51e462={};var _0x4d2432={};var _0x271b56;var _0x3faa49;return db[_0x67e0('0x36')][_0x67e0('0x62')]({'where':{'id':_0x2511bd[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x514474,null))['then'](function(_0x23ddf8){if(_0x23ddf8){_0x271b56=_0x23ddf8;_0x4d2432[_0x67e0('0x3f')]=_[_0x67e0('0x3b')](db[_0x67e0('0x78')][_0x67e0('0x37')]);_0x4d2432['query']=_[_0x67e0('0x3b')](_0x2511bd['query']);_0x4d2432['filters']=_[_0x67e0('0x3e')](_0x4d2432[_0x67e0('0x3f')],_0x4d2432['query']);_0x51e462['attributes']=_['intersection'](_0x4d2432[_0x67e0('0x3f')],qs['fields'](_0x2511bd[_0x67e0('0x3c')][_0x67e0('0x53')]));_0x51e462[_0x67e0('0x40')]=_0x51e462[_0x67e0('0x40')][_0x67e0('0x41')]?_0x51e462[_0x67e0('0x40')]:_0x4d2432['model'];_0x51e462[_0x67e0('0x44')]=qs['sort'](_0x2511bd[_0x67e0('0x3c')][_0x67e0('0x45')]);_0x51e462['where']=qs['filters'](_[_0x67e0('0x47')](_0x2511bd['query'],_0x4d2432[_0x67e0('0x3d')]));_0x51e462[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x51e462[_0x67e0('0x46')],{'$or':[{'ListId':_0x23ddf8['id']},{'ListId':null}]});if(_0x2511bd[_0x67e0('0x3c')][_0x67e0('0x48')]){_0x51e462[_0x67e0('0x46')]=_[_0x67e0('0x49')](_0x51e462['where'],{'$or':_[_0x67e0('0x3a')](_0x51e462['attributes'],function(_0x272650){var _0x12ca4a={};_0x12ca4a[_0x272650]={'$like':'%'+_0x2511bd[_0x67e0('0x3c')][_0x67e0('0x48')]+'%'};return _0x12ca4a;})});}_0x51e462=_['merge']({},_0x51e462,_0x2511bd['options']);return db[_0x67e0('0x78')][_0x67e0('0x8d')](_0x51e462);}})[_0x67e0('0x2c')](respondWithResult(_0x514474,null))['catch'](handleError(_0x514474,null));};exports[_0x67e0('0x8e')]=function(_0x2c0d18,_0x371a50,_0x145301){return db['CmList'][_0x67e0('0x54')]({'where':{'id':_0x2c0d18['params']['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x371a50,null))[_0x67e0('0x2c')](function(_0x1eb601){if(_0x1eb601){return _0x1eb601[_0x67e0('0x8e')](_0x2c0d18[_0x67e0('0x5c')][_0x67e0('0x65')],_[_0x67e0('0x6d')](_0x2c0d18[_0x67e0('0x5c')],[_0x67e0('0x65'),'id'])||{})['spread'](function(_0x2fc97d){for(var _0x1141f8=0x0;_0x1141f8<_0x2c0d18[_0x67e0('0x5c')][_0x67e0('0x65')]['length'];_0x1141f8+=0x1){socket[_0x67e0('0x8f')](_0x67e0('0x90'),{'UserId':Number(_0x2c0d18[_0x67e0('0x5c')]['ids'][_0x1141f8]),'CmListId':Number(_0x2c0d18[_0x67e0('0x5e')]['id'])});}return _0x2fc97d;});}})[_0x67e0('0x2c')](respondWithResult(_0x371a50,null))[_0x67e0('0x51')](handleError(_0x371a50,null));};exports[_0x67e0('0x91')]=function(_0xf7a9e5,_0x53962b,_0x4bb1c3){return db[_0x67e0('0x36')][_0x67e0('0x54')]({'where':{'id':_0xf7a9e5['params']['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x53962b,null))[_0x67e0('0x2c')](function(_0x5736f1){if(_0x5736f1){return _0x5736f1[_0x67e0('0x91')](_0xf7a9e5['query'][_0x67e0('0x65')])[_0x67e0('0x2c')](function(){if(_[_0x67e0('0x68')](_0xf7a9e5[_0x67e0('0x3c')][_0x67e0('0x65')])){for(var _0x35bee1=0x0;_0x35bee1<_0xf7a9e5['query'][_0x67e0('0x65')][_0x67e0('0x41')];_0x35bee1+=0x1){socket['emit'](_0x67e0('0x92'),{'UserId':Number(_0xf7a9e5[_0x67e0('0x3c')][_0x67e0('0x65')][_0x35bee1]),'CmListId':Number(_0xf7a9e5[_0x67e0('0x5e')]['id'])});}}else{socket[_0x67e0('0x8f')](_0x67e0('0x92'),{'UserId':Number(_0xf7a9e5[_0x67e0('0x3c')][_0x67e0('0x65')]),'CmListId':Number(_0xf7a9e5['params']['id'])});}});}})[_0x67e0('0x2c')](respondWithStatusCode(_0x53962b,null))[_0x67e0('0x51')](handleError(_0x53962b,null));};exports[_0x67e0('0x93')]=function(_0x2c3dc7,_0x499803,_0x35fafc){var _0x479d09={};var _0x3fdcae={};var _0x324679;var _0x31cf9d;return db['CmList'][_0x67e0('0x62')]({'where':{'id':_0x2c3dc7[_0x67e0('0x5e')]['id']}})[_0x67e0('0x2c')](handleEntityNotFound(_0x499803,null))[_0x67e0('0x2c')](function(_0x4c3278){if(_0x4c3278){_0x324679=_0x4c3278;_0x3fdcae[_0x67e0('0x3f')]=_['keys'](db[_0x67e0('0x94')][_0x67e0('0x37')]);_0x3fdcae[_0x67e0('0x3c')]=_[_0x67e0('0x3b')](_0x2c3dc7[_0x67e0('0x3c')]);_0x3fdcae[_0x67e0('0x3d')]=_[_0x67e0('0x3e')](_0x3fdcae[_0x67e0('0x3f')],_0x3fdcae[_0x67e0('0x3c')]);_0x479d09[_0x67e0('0x40')]=_[_0x67e0('0x3e')](_0x3fdcae['model'],qs[_0x67e0('0x53')](_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x53')]));_0x479d09[_0x67e0('0x40')]=_0x479d09['attributes']['length']?_0x479d09[_0x67e0('0x40')]:_0x3fdcae[_0x67e0('0x3f')];_0x479d09[_0x67e0('0x44')]=qs[_0x67e0('0x45')](_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x45')]);_0x479d09[_0x67e0('0x46')]=qs['filters'](_[_0x67e0('0x47')](_0x2c3dc7['query'],_0x3fdcae[_0x67e0('0x3d')]));if(_0x2c3dc7['query']['filter']){_0x479d09[_0x67e0('0x46')]=_['merge'](_0x479d09[_0x67e0('0x46')],{'$or':_[_0x67e0('0x3a')](_0x479d09[_0x67e0('0x40')],function(_0x68038f){var _0x3f2734={};_0x3f2734[_0x68038f]={'$like':'%'+_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x48')]+'%'};return _0x3f2734;})});}_0x479d09=_[_0x67e0('0x49')]({},_0x479d09,_0x2c3dc7[_0x67e0('0x4c')]);return _0x324679[_0x67e0('0x93')](_0x479d09);}})[_0x67e0('0x2c')](function(_0x2f8945){if(_0x2f8945){_0x31cf9d=_0x2f8945[_0x67e0('0x41')];if(!_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x42')](_0x67e0('0x43'))){_0x479d09[_0x67e0('0x25')]=qs['limit'](_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x25')]);_0x479d09[_0x67e0('0x27')]=qs[_0x67e0('0x27')](_0x2c3dc7[_0x67e0('0x3c')][_0x67e0('0x27')]);}return _0x324679['getAgents'](_0x479d09);}})['then'](function(_0x4c8690){if(_0x4c8690){return _0x4c8690?{'count':_0x31cf9d,'rows':_0x4c8690}:null;}})['then'](respondWithResult(_0x499803,null))[_0x67e0('0x51')](handleError(_0x499803,null));}; \ No newline at end of file +var _0x4c17=['count','status','Content-Range','reject','save','update','then','get','Lists','destroy','end','error','stack','name','send','index','map','CmList','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','catch','params','keys','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','length','where','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','cf_%d','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','json','offset','limit','undefined'];(function(_0x2d4826,_0x561a8c){var _0x47aa94=function(_0x55cb08){while(--_0x55cb08){_0x2d4826['push'](_0x2d4826['shift']());}};_0x47aa94(++_0x561a8c);}(_0x4c17,0x73));var _0x74c1=function(_0x5ac940,_0x1811c0){_0x5ac940=_0x5ac940-0x0;var _0xb46258=_0x4c17[_0x5ac940];return _0xb46258;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74c1('0x0'));var zipdir=require(_0x74c1('0x1'));var jsonpatch=require(_0x74c1('0x2'));var rp=require(_0x74c1('0x3'));var moment=require(_0x74c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x74c1('0x5'));var util=require(_0x74c1('0x6'));var path=require(_0x74c1('0x7'));var sox=require(_0x74c1('0x8'));var csv=require(_0x74c1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74c1('0xa'));var _=require(_0x74c1('0xb'));var squel=require('squel');var crypto=require(_0x74c1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x74c1('0xd'));var toCsv=require(_0x74c1('0x9'));var querystring=require(_0x74c1('0xe'));var Papa=require(_0x74c1('0xf'));var Redis=require('ioredis');var authService=require(_0x74c1('0x10'));var qs=require(_0x74c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74c1('0x12'));var logger=require(_0x74c1('0x13'))(_0x74c1('0x14'));var utils=require(_0x74c1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x74c1('0x16'));var db=require(_0x74c1('0x17'))['db'];config[_0x74c1('0x18')]=_[_0x74c1('0x19')](config[_0x74c1('0x18')],{'host':_0x74c1('0x1a'),'port':0x18eb});var socket=require(_0x74c1('0x1b'))(new Redis(config[_0x74c1('0x18')]));require(_0x74c1('0x1c'))['register'](socket);function respondWithStatusCode(_0xe400a9,_0x571115){_0x571115=_0x571115||0xcc;return function(_0x20400e){if(_0x20400e){return _0xe400a9[_0x74c1('0x1d')](_0x571115);}return _0xe400a9['status'](_0x571115)['end']();};}function respondWithResult(_0x5ab954,_0x12219e){_0x12219e=_0x12219e||0xc8;return function(_0x3f9e34){if(_0x3f9e34){return _0x5ab954['status'](_0x12219e)[_0x74c1('0x1e')](_0x3f9e34);}};}function respondWithFilteredResult(_0x43206d,_0x4c8351){return function(_0x26eada){if(_0x26eada){var _0x29b766=typeof _0x4c8351[_0x74c1('0x1f')]==='undefined'&&typeof _0x4c8351[_0x74c1('0x20')]===_0x74c1('0x21');var _0x2f6886=_0x26eada['count'];var _0x3141c7=_0x29b766?0x0:_0x4c8351[_0x74c1('0x1f')];var _0x1c9556=_0x29b766?_0x26eada[_0x74c1('0x22')]:_0x4c8351[_0x74c1('0x1f')]+_0x4c8351[_0x74c1('0x20')];var _0x1ebffb;if(_0x1c9556>=_0x2f6886){_0x1c9556=_0x2f6886;_0x1ebffb=0xc8;}else{_0x1ebffb=0xce;}_0x43206d[_0x74c1('0x23')](_0x1ebffb);return _0x43206d['set'](_0x74c1('0x24'),_0x3141c7+'-'+_0x1c9556+'/'+_0x2f6886)[_0x74c1('0x1e')](_0x26eada);}return null;};}function patchUpdates(_0x45646e){return function(_0x33fcd1){try{jsonpatch['apply'](_0x33fcd1,_0x45646e,!![]);}catch(_0x2e5fda){return BPromise[_0x74c1('0x25')](_0x2e5fda);}return _0x33fcd1[_0x74c1('0x26')]();};}function saveUpdates(_0x554104,_0x40fe60){return function(_0x306823){if(_0x306823){return _0x306823[_0x74c1('0x27')](_0x554104)['then'](function(_0x3660c3){return _0x3660c3;});}return null;};}function removeEntity(_0x411963,_0xebc046){return function(_0x2c67cf){if(_0x2c67cf){return _0x2c67cf['destroy']()[_0x74c1('0x28')](function(){var _0x434795=_0x2c67cf[_0x74c1('0x29')]({'plain':!![]});var _0x1f3ae7=_0x74c1('0x2a');return db['UserProfileResource'][_0x74c1('0x2b')]({'where':{'type':_0x1f3ae7,'resourceId':_0x434795['id']}})[_0x74c1('0x28')](function(){return _0x2c67cf;});})[_0x74c1('0x28')](function(){_0x411963[_0x74c1('0x23')](0xcc)[_0x74c1('0x2c')]();});}};}function handleEntityNotFound(_0x3d0e85,_0x71ca3e){return function(_0x2edd76){if(!_0x2edd76){_0x3d0e85['sendStatus'](0x194);}return _0x2edd76;};}function handleError(_0x43d5d7,_0xbf4094){_0xbf4094=_0xbf4094||0x1f4;return function(_0x3532ae){logger[_0x74c1('0x2d')](_0x3532ae[_0x74c1('0x2e')]);if(_0x3532ae[_0x74c1('0x2f')]){delete _0x3532ae[_0x74c1('0x2f')];}_0x43d5d7[_0x74c1('0x23')](_0xbf4094)[_0x74c1('0x30')](_0x3532ae);};}exports[_0x74c1('0x31')]=function(_0x517777,_0x496b65){var _0x61578c={},_0x49de0f={},_0x1c595d={'count':0x0,'rows':[]};var _0x3592e8=_[_0x74c1('0x32')](db[_0x74c1('0x33')][_0x74c1('0x34')],function(_0xf09de9){return{'name':_0xf09de9['fieldName'],'type':_0xf09de9[_0x74c1('0x35')]['key']};});_0x49de0f[_0x74c1('0x36')]=_[_0x74c1('0x32')](_0x3592e8,_0x74c1('0x2f'));_0x49de0f[_0x74c1('0x37')]=_['keys'](_0x517777[_0x74c1('0x37')]);_0x49de0f[_0x74c1('0x38')]=_[_0x74c1('0x39')](_0x49de0f['model'],_0x49de0f['query']);_0x61578c[_0x74c1('0x3a')]=_['intersection'](_0x49de0f['model'],qs[_0x74c1('0x3b')](_0x517777[_0x74c1('0x37')][_0x74c1('0x3b')]));_0x61578c[_0x74c1('0x3a')]=_0x61578c['attributes']['length']?_0x61578c[_0x74c1('0x3a')]:_0x49de0f[_0x74c1('0x36')];if(!_0x517777[_0x74c1('0x37')][_0x74c1('0x3c')](_0x74c1('0x3d'))){_0x61578c[_0x74c1('0x20')]=qs[_0x74c1('0x20')](_0x517777[_0x74c1('0x37')]['limit']);_0x61578c['offset']=qs[_0x74c1('0x1f')](_0x517777[_0x74c1('0x37')]['offset']);}_0x61578c[_0x74c1('0x3e')]=qs[_0x74c1('0x3f')](_0x517777['query'][_0x74c1('0x3f')]);_0x61578c['where']=qs['filters'](_[_0x74c1('0x40')](_0x517777[_0x74c1('0x37')],_0x49de0f['filters']),_0x3592e8);if(_0x517777[_0x74c1('0x37')][_0x74c1('0x41')]){_0x61578c['where']=_[_0x74c1('0x42')](_0x61578c['where'],{'$or':_['map'](_0x3592e8,function(_0xe516bc){if(_0xe516bc[_0x74c1('0x35')]!==_0x74c1('0x43')){var _0xb66c3b={};_0xb66c3b[_0xe516bc[_0x74c1('0x2f')]]={'$like':'%'+_0x517777['query'][_0x74c1('0x41')]+'%'};return _0xb66c3b;}})});}_0x61578c=_[_0x74c1('0x42')]({},_0x61578c,_0x517777['options']);var _0x4eb82c={'where':_0x61578c['where']};return db[_0x74c1('0x33')][_0x74c1('0x22')](_0x4eb82c)[_0x74c1('0x28')](function(_0xa557f){_0x1c595d[_0x74c1('0x22')]=_0xa557f;if(_0x517777[_0x74c1('0x37')]['includeAll']){_0x61578c[_0x74c1('0x44')]=[{'all':!![]}];}return db[_0x74c1('0x33')][_0x74c1('0x45')](_0x61578c);})[_0x74c1('0x28')](function(_0x53442c){_0x1c595d['rows']=_0x53442c;return _0x1c595d;})[_0x74c1('0x28')](respondWithFilteredResult(_0x496b65,_0x61578c))[_0x74c1('0x46')](handleError(_0x496b65,null));};exports['show']=function(_0x28e629,_0x86208f){var _0x13949f={'raw':![],'where':{'id':_0x28e629[_0x74c1('0x47')]['id']}},_0x1bd9d8={};_0x1bd9d8[_0x74c1('0x36')]=_[_0x74c1('0x48')](db[_0x74c1('0x33')]['rawAttributes']);_0x1bd9d8[_0x74c1('0x37')]=_[_0x74c1('0x48')](_0x28e629[_0x74c1('0x37')]);_0x1bd9d8[_0x74c1('0x38')]=_[_0x74c1('0x39')](_0x1bd9d8[_0x74c1('0x36')],_0x1bd9d8[_0x74c1('0x37')]);_0x13949f['attributes']=_[_0x74c1('0x39')](_0x1bd9d8[_0x74c1('0x36')],qs['fields'](_0x28e629[_0x74c1('0x37')][_0x74c1('0x3b')]));_0x13949f[_0x74c1('0x3a')]=_0x13949f[_0x74c1('0x3a')]['length']?_0x13949f[_0x74c1('0x3a')]:_0x1bd9d8['model'];if(_0x28e629[_0x74c1('0x37')][_0x74c1('0x49')]){_0x13949f['include']=[{'all':!![]}];}_0x13949f=_[_0x74c1('0x42')]({},_0x13949f,_0x28e629[_0x74c1('0x4a')]);return db[_0x74c1('0x33')][_0x74c1('0x4b')](_0x13949f)[_0x74c1('0x28')](handleEntityNotFound(_0x86208f,null))[_0x74c1('0x28')](respondWithResult(_0x86208f,null))[_0x74c1('0x46')](handleError(_0x86208f,null));};exports['create']=function(_0x315869,_0x1df31f){return db['CmList'][_0x74c1('0x4c')](_0x315869[_0x74c1('0x4d')],{})[_0x74c1('0x28')](function(_0x2b84f1){var _0x803f5c=_0x315869['user'][_0x74c1('0x29')]({'plain':!![]});if(!_0x803f5c)throw new Error(_0x74c1('0x4e'));if(_0x803f5c[_0x74c1('0x4f')]===_0x74c1('0x50')){var _0x40ab33=_0x2b84f1['get']({'plain':!![]});var _0x4202f5='Lists';return db[_0x74c1('0x51')]['find']({'where':{'name':_0x4202f5,'userProfileId':_0x803f5c['userProfileId']},'raw':!![]})[_0x74c1('0x28')](function(_0x45b914){if(_0x45b914&&_0x45b914[_0x74c1('0x52')]===0x0){return db[_0x74c1('0x53')]['create']({'name':_0x40ab33[_0x74c1('0x2f')],'resourceId':_0x40ab33['id'],'type':_0x45b914[_0x74c1('0x2f')],'sectionId':_0x45b914['id']},{})[_0x74c1('0x28')](function(){return _0x2b84f1;});}else{return _0x2b84f1;}})['catch'](function(_0x14146e){logger[_0x74c1('0x2d')](_0x74c1('0x54'),_0x14146e);throw _0x14146e;});}return _0x2b84f1;})[_0x74c1('0x28')](respondWithResult(_0x1df31f,0xc9))[_0x74c1('0x46')](handleError(_0x1df31f,null));};exports[_0x74c1('0x27')]=function(_0xc34c9d,_0x1a4944){if(_0xc34c9d[_0x74c1('0x4d')]['id']){delete _0xc34c9d[_0x74c1('0x4d')]['id'];}return db[_0x74c1('0x33')][_0x74c1('0x4b')]({'where':{'id':_0xc34c9d[_0x74c1('0x47')]['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x1a4944,null))[_0x74c1('0x28')](saveUpdates(_0xc34c9d[_0x74c1('0x4d')],null))[_0x74c1('0x28')](respondWithResult(_0x1a4944,null))[_0x74c1('0x46')](handleError(_0x1a4944,null));};exports[_0x74c1('0x2b')]=function(_0xf1dc08,_0x372fde){return db[_0x74c1('0x33')][_0x74c1('0x4b')]({'where':{'id':_0xf1dc08[_0x74c1('0x47')]['id']}})['then'](handleEntityNotFound(_0x372fde,null))['then'](removeEntity(_0x372fde,null))[_0x74c1('0x46')](handleError(_0x372fde,null));};exports[_0x74c1('0x55')]=function(_0x4a5eb2,_0x30eeac){return db['CmList'][_0x74c1('0x55')]()[_0x74c1('0x28')](respondWithResult(_0x30eeac,null))[_0x74c1('0x46')](handleError(_0x30eeac,null));};exports[_0x74c1('0x56')]=function(_0x23999e,_0x122623,_0x2c586c){if(_0x23999e['body']['id']){delete _0x23999e[_0x74c1('0x4d')]['id'];}return db[_0x74c1('0x33')]['find']({'where':{'id':_0x23999e['params']['id']}})['then'](handleEntityNotFound(_0x122623,null))['then'](function(_0x11f43d){if(_0x11f43d){_0x23999e[_0x74c1('0x4d')][_0x74c1('0x57')]=_0x11f43d['id'];return db[_0x74c1('0x58')][_0x74c1('0x4c')](_0x23999e[_0x74c1('0x4d')]);}})['then'](respondWithResult(_0x122623,null))[_0x74c1('0x46')](handleError(_0x122623,null));};exports[_0x74c1('0x59')]=function(_0x1f2104,_0x9e2b70,_0x90dbb5){var _0x2befdc={'raw':![],'where':{}};var _0x200254={};var _0x671de6={'count':0x0,'rows':[]};return db[_0x74c1('0x33')][_0x74c1('0x5a')]({'where':{'id':_0x1f2104['params']['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x9e2b70,null))[_0x74c1('0x28')](function(_0x89c90e){if(_0x89c90e){_0x200254[_0x74c1('0x36')]=_[_0x74c1('0x48')](db['Disposition'][_0x74c1('0x34')]);_0x200254[_0x74c1('0x37')]=_['keys'](_0x1f2104['query']);_0x200254['filters']=_['intersection'](_0x200254['model'],_0x200254[_0x74c1('0x37')]);_0x2befdc[_0x74c1('0x3a')]=_[_0x74c1('0x39')](_0x200254[_0x74c1('0x36')],qs[_0x74c1('0x3b')](_0x1f2104[_0x74c1('0x37')]['fields']));_0x2befdc[_0x74c1('0x3a')]=_0x2befdc[_0x74c1('0x3a')][_0x74c1('0x5b')]?_0x2befdc[_0x74c1('0x3a')]:_0x200254[_0x74c1('0x36')];if(!_0x1f2104['query'][_0x74c1('0x3c')]('nolimit')){_0x2befdc[_0x74c1('0x20')]=qs['limit'](_0x1f2104[_0x74c1('0x37')][_0x74c1('0x20')]);_0x2befdc['offset']=qs['offset'](_0x1f2104[_0x74c1('0x37')][_0x74c1('0x1f')]);}_0x2befdc['order']=qs['sort'](_0x1f2104[_0x74c1('0x37')]['sort']);_0x2befdc['where']=qs[_0x74c1('0x38')](_['pick'](_0x1f2104['query'],_0x200254[_0x74c1('0x38')]));_0x2befdc[_0x74c1('0x5c')][_0x74c1('0x57')]=_0x89c90e['id'];if(_0x1f2104[_0x74c1('0x37')][_0x74c1('0x41')]){_0x2befdc['where']=_[_0x74c1('0x42')](_0x2befdc['where'],{'$or':_[_0x74c1('0x32')](_0x2befdc[_0x74c1('0x3a')],function(_0x143620){var _0x3cdabb={};_0x3cdabb[_0x143620]={'$like':'%'+_0x1f2104[_0x74c1('0x37')][_0x74c1('0x41')]+'%'};return _0x3cdabb;})});}_0x2befdc=_[_0x74c1('0x42')]({},_0x2befdc,_0x1f2104[_0x74c1('0x4a')]);return db[_0x74c1('0x58')][_0x74c1('0x22')]({'where':_0x2befdc[_0x74c1('0x5c')]})['then'](function(_0x36d0c5){_0x671de6[_0x74c1('0x22')]=_0x36d0c5;if(_0x1f2104[_0x74c1('0x37')]['includeAll']){_0x2befdc[_0x74c1('0x44')]=[{'all':!![]}];}return db[_0x74c1('0x58')][_0x74c1('0x45')](_0x2befdc);})[_0x74c1('0x28')](function(_0x43993d){_0x671de6[_0x74c1('0x5d')]=_0x43993d;return _0x671de6;});}})[_0x74c1('0x28')](respondWithFilteredResult(_0x9e2b70,_0x2befdc))[_0x74c1('0x46')](handleError(_0x9e2b70,null));};exports[_0x74c1('0x5e')]=function(_0x1243b4,_0x22dc2e,_0x2a2bc6){return db[_0x74c1('0x33')][_0x74c1('0x4b')]({'where':{'id':_0x1243b4[_0x74c1('0x47')]['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x22dc2e,null))[_0x74c1('0x28')](function(_0x5776ae){if(_0x5776ae){return _0x5776ae[_0x74c1('0x5e')](_0x1243b4[_0x74c1('0x37')][_0x74c1('0x5f')]);}})[_0x74c1('0x28')](respondWithStatusCode(_0x22dc2e,null))[_0x74c1('0x46')](handleError(_0x22dc2e,null));};exports[_0x74c1('0x60')]=function(_0x5557a0,_0x275328,_0x4fa79d){return db[_0x74c1('0x33')][_0x74c1('0x4b')]({'where':{'id':_0x5557a0['params']['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x275328,null))[_0x74c1('0x28')](function(_0xebacc3){if(_0xebacc3){var _0x51b481=[];var _0x33e464={'success':[],'errors':[]};return db[_0x74c1('0x61')][_0x74c1('0x55')]()['then'](function(_0x1ad462){if(_0x5557a0[_0x74c1('0x4d')][_0x74c1('0x62')]&&_[_0x74c1('0x63')](_0x5557a0[_0x74c1('0x4d')]['tags'])){if(_0x5557a0[_0x74c1('0x4d')]['tags'][_0x74c1('0x5b')]){_0x5557a0[_0x74c1('0x4d')][_0x74c1('0x62')]=_0x5557a0['body'][_0x74c1('0x62')][_0x74c1('0x64')](';')+';';}else{_0x5557a0[_0x74c1('0x4d')]['tags']=null;}}else{_0x5557a0['body'][_0x74c1('0x62')]=null;}if(_0x5557a0[_0x74c1('0x4d')]&&_['isArray'](_0x5557a0['body'])){for(var _0x4d8c22=0x0;_0x4d8c22<_0x5557a0['body']['length'];_0x4d8c22+=0x1){_0x5557a0[_0x74c1('0x4d')][_0x4d8c22][_0x74c1('0x57')]=_0x5557a0['params']['id'];_0x51b481[_0x74c1('0x65')](_0x5557a0[_0x74c1('0x4d')][_0x4d8c22]);}return BPromise[_0x74c1('0x66')](_0x51b481,function(_0x5b0161){return db[_0x74c1('0x61')][_0x74c1('0x4c')](_[_0x74c1('0x67')](_0x5b0161,[_0x74c1('0x5f'),'id'])||{},{'fields':_[_0x74c1('0x48')](_0x1ad462),'raw':!![]})[_0x74c1('0x28')](function(_0x31ba08){_0x33e464[_0x74c1('0x68')][_0x74c1('0x65')](_0x31ba08[_0x74c1('0x69')]);})[_0x74c1('0x46')](function(_0x5b37b6){_0x33e464[_0x74c1('0x6a')]['push']({'data':_0x5b0161,'error':_0x5b37b6['message']});});})[_0x74c1('0x28')](function(_0xdec5dd){return _0x33e464;})[_0x74c1('0x46')](function(_0x2df6ab){return _0x2df6ab;});}else{_0x275328[_0x74c1('0x23')](0x190)[_0x74c1('0x1e')]({'message':_0x74c1('0x6b')});}});}})[_0x74c1('0x28')](respondWithResult(_0x275328,null))[_0x74c1('0x46')](handleError(_0x275328,null));};exports[_0x74c1('0x6c')]=function(_0x3d482f,_0x57993b,_0x5a5b52){var _0x367f15;return db[_0x74c1('0x33')][_0x74c1('0x4b')]({'where':{'id':_0x3d482f[_0x74c1('0x47')]['id']},'include':[{'model':db[_0x74c1('0x6d')],'as':_0x74c1('0x6e')}]})['then'](handleEntityNotFound(_0x57993b,null))[_0x74c1('0x28')](function(_0x8d178b){if(_0x8d178b){_0x367f15=_0x8d178b;return db['CmContact'][_0x74c1('0x34')];}})[_0x74c1('0x28')](function(_0x40a5c6){if(_0x40a5c6){var _0x4c5d72={};var _0x35ee10={};_0x35ee10['model']=_[_0x74c1('0x6f')](_['keys'](_0x40a5c6),_[_0x74c1('0x32')](_0x367f15[_0x74c1('0x6e')],function(_0x1ebdf6){return util[_0x74c1('0x70')]('cf_%d',_0x1ebdf6['id']);}));_0x35ee10[_0x74c1('0x37')]=_[_0x74c1('0x48')](_0x3d482f[_0x74c1('0x37')]);_0x35ee10[_0x74c1('0x38')]=_[_0x74c1('0x39')](_0x35ee10[_0x74c1('0x36')],_0x35ee10['query']);_0x4c5d72['attributes']=_['intersection'](_0x35ee10[_0x74c1('0x36')],qs[_0x74c1('0x3b')](_0x3d482f[_0x74c1('0x37')][_0x74c1('0x3b')]));_0x4c5d72['attributes']=_0x4c5d72[_0x74c1('0x3a')][_0x74c1('0x5b')]?_0x4c5d72[_0x74c1('0x3a')]:_0x35ee10['model'];if(!_0x3d482f['query'][_0x74c1('0x3c')]('nolimit')){_0x4c5d72[_0x74c1('0x20')]=qs[_0x74c1('0x20')](_0x3d482f['query'][_0x74c1('0x20')]);_0x4c5d72[_0x74c1('0x1f')]=qs[_0x74c1('0x1f')](_0x3d482f[_0x74c1('0x37')][_0x74c1('0x1f')]);}_0x4c5d72[_0x74c1('0x3e')]=qs[_0x74c1('0x3f')](_0x3d482f[_0x74c1('0x37')][_0x74c1('0x3f')]);_0x4c5d72['where']=qs[_0x74c1('0x38')](_['pick'](_0x3d482f[_0x74c1('0x37')],_0x35ee10[_0x74c1('0x38')]));_0x4c5d72[_0x74c1('0x71')]=!![];if(_0x3d482f[_0x74c1('0x37')][_0x74c1('0x41')]){_0x4c5d72['where']=_[_0x74c1('0x42')](_0x4c5d72['where'],{'$or':_[_0x74c1('0x32')](_0x4c5d72[_0x74c1('0x3a')],function(_0x4e5cb1){var _0x4f001f={};_0x4f001f[_0x4e5cb1]={'$like':'%'+_0x3d482f['query']['filter']+'%'};return _0x4f001f;})});}_0x4c5d72=_['merge']({},_0x4c5d72,_0x3d482f[_0x74c1('0x4a')]);return _0x367f15['getContacts'](_0x4c5d72);}})[_0x74c1('0x28')](respondWithResult(_0x57993b,null))[_0x74c1('0x46')](handleError(_0x57993b,null));};exports['getContactsCsv']=function(_0x4d0f96,_0x4a6a1f,_0x587516){var _0x2ec2e3;return db['CmList'][_0x74c1('0x4b')]({'where':{'id':_0x4d0f96[_0x74c1('0x47')]['id']},'include':[{'model':db[_0x74c1('0x6d')],'as':_0x74c1('0x6e')}]})[_0x74c1('0x28')](handleEntityNotFound(_0x4a6a1f,null))[_0x74c1('0x28')](function(_0xf6ca1c){if(_0xf6ca1c){_0x2ec2e3=_0xf6ca1c;return db['CmContact']['rawAttributes'];}})[_0x74c1('0x28')](function(_0x216cbf){if(_0x216cbf){var _0x34eed0={};var _0x59b4d7={};_0x59b4d7['model']=_['concat'](_[_0x74c1('0x48')](_0x216cbf),_['map'](_0x2ec2e3['CustomFields'],function(_0x2c3aa0){return util['format'](_0x74c1('0x72'),_0x2c3aa0['id']);}));_0x59b4d7[_0x74c1('0x37')]=_['keys'](_0x4d0f96['query']);_0x59b4d7['filters']=_[_0x74c1('0x39')](_0x59b4d7[_0x74c1('0x36')],_0x59b4d7[_0x74c1('0x37')]);_0x34eed0['attributes']=_[_0x74c1('0x39')](_0x59b4d7[_0x74c1('0x36')],qs[_0x74c1('0x3b')](_0x4d0f96[_0x74c1('0x37')][_0x74c1('0x3b')]));_0x34eed0[_0x74c1('0x3a')]=_0x34eed0[_0x74c1('0x3a')]['length']?_0x34eed0[_0x74c1('0x3a')]:_0x59b4d7[_0x74c1('0x36')];if(!_0x4d0f96[_0x74c1('0x37')][_0x74c1('0x3c')](_0x74c1('0x3d'))){_0x34eed0[_0x74c1('0x20')]=qs['limit'](_0x4d0f96[_0x74c1('0x37')][_0x74c1('0x20')]);_0x34eed0[_0x74c1('0x1f')]=qs[_0x74c1('0x1f')](_0x4d0f96[_0x74c1('0x37')][_0x74c1('0x1f')]);}_0x34eed0[_0x74c1('0x3e')]=qs['sort'](_0x4d0f96['query'][_0x74c1('0x3f')]);_0x34eed0[_0x74c1('0x5c')]=qs[_0x74c1('0x38')](_['pick'](_0x4d0f96[_0x74c1('0x37')],_0x59b4d7[_0x74c1('0x38')]));_0x34eed0['raw']=!![];if(_0x4d0f96[_0x74c1('0x37')][_0x74c1('0x41')]){_0x34eed0[_0x74c1('0x5c')]=_[_0x74c1('0x42')](_0x34eed0['where'],{'$or':_['map'](_0x34eed0[_0x74c1('0x3a')],function(_0x5432bf){var _0x28e039={};_0x28e039[_0x5432bf]={'$like':'%'+_0x4d0f96[_0x74c1('0x37')][_0x74c1('0x41')]+'%'};return _0x28e039;})});}_0x34eed0=_[_0x74c1('0x42')]({},_0x34eed0,_0x4d0f96[_0x74c1('0x4a')]);return _0x2ec2e3[_0x74c1('0x6c')](_0x34eed0);}})[_0x74c1('0x28')](function(_0x22d618){if(!_[_0x74c1('0x73')](_0x22d618)){var _0x376f6e=toCsv(_0x22d618);var _0x3a5fb2=Date[_0x74c1('0x74')]();fs[_0x74c1('0x75')](util['format']('/tmp/list_%d_%s.csv',_0x2ec2e3['id'],_0x3a5fb2),_0x376f6e);_0x4a6a1f[_0x74c1('0x76')](_0x74c1('0x77'),_0x74c1('0x78')+util[_0x74c1('0x70')]('list_%d_%s.csv',_0x2ec2e3['id'],_0x3a5fb2));_0x4a6a1f[_0x74c1('0x76')]('Content-type',_0x74c1('0x79'));return _0x4a6a1f[_0x74c1('0x7a')](util[_0x74c1('0x70')](_0x74c1('0x7b'),_0x2ec2e3['id'],_0x3a5fb2));}else{return _0x4a6a1f[_0x74c1('0x1d')](0xcc);}})[_0x74c1('0x46')](handleError(_0x4a6a1f,null));};exports[_0x74c1('0x7c')]=function(_0x57713f,_0x5866c5,_0xb90458){var _0x2c5ccb;delete _0x57713f[_0x74c1('0x4d')]['id'];return db[_0x74c1('0x33')][_0x74c1('0x5a')]({'where':{'id':_0x57713f[_0x74c1('0x47')]['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x5866c5,null))[_0x74c1('0x28')](function(_0x167efc){if(_0x167efc){return db[_0x74c1('0x7d')][_0x74c1('0x7e')](function(_0x38b1bd){return db[_0x74c1('0x6d')][_0x74c1('0x4c')](_0x57713f[_0x74c1('0x4d')],{'transaction':_0x38b1bd})['then'](function(_0x2a0bd7){_0x2c5ccb=_0x2a0bd7;return _0x167efc[_0x74c1('0x7f')](_0x2a0bd7,{'transaction':_0x38b1bd});})[_0x74c1('0x28')](function(){var _0x4f1f88={'type':db[_0x74c1('0x80')]['TEXT'],'transaction':_0x38b1bd};switch(_0x57713f[_0x74c1('0x4d')][_0x74c1('0x35')]){case _0x74c1('0x81'):_0x4f1f88[_0x74c1('0x35')]=db['Sequelize'][_0x74c1('0x82')];break;case _0x74c1('0x83'):_0x4f1f88[_0x74c1('0x35')]=db['Sequelize'][_0x74c1('0x84')];break;case _0x74c1('0x85'):_0x4f1f88[_0x74c1('0x35')]=db[_0x74c1('0x80')][_0x74c1('0x86')];_0x4f1f88[_0x74c1('0x87')]=![];break;default:}return db[_0x74c1('0x7d')][_0x74c1('0x88')]['addColumn'](_0x74c1('0x89'),util[_0x74c1('0x70')](_0x74c1('0x8a'),_0x2c5ccb['id']),_0x4f1f88);})[_0x74c1('0x28')](function(){return _0x2c5ccb;});});}})[_0x74c1('0x28')](respondWithResult(_0x5866c5,null))['catch'](handleError(_0x5866c5,null));};exports[_0x74c1('0x8b')]=function(_0xa871cf,_0x5d55c4,_0x32f831){var _0x37a634={};var _0x4a61e9={};var _0x4a0531;var _0x853d00;return db[_0x74c1('0x33')][_0x74c1('0x5a')]({'where':{'id':_0xa871cf[_0x74c1('0x47')]['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x5d55c4,null))[_0x74c1('0x28')](function(_0x463dcd){if(_0x463dcd){_0x4a0531=_0x463dcd;_0x4a61e9['model']=_[_0x74c1('0x48')](db[_0x74c1('0x6d')][_0x74c1('0x34')]);_0x4a61e9['query']=_[_0x74c1('0x48')](_0xa871cf[_0x74c1('0x37')]);_0x4a61e9[_0x74c1('0x38')]=_[_0x74c1('0x39')](_0x4a61e9['model'],_0x4a61e9['query']);_0x37a634['attributes']=_[_0x74c1('0x39')](_0x4a61e9[_0x74c1('0x36')],qs[_0x74c1('0x3b')](_0xa871cf[_0x74c1('0x37')][_0x74c1('0x3b')]));_0x37a634[_0x74c1('0x3a')]=_0x37a634[_0x74c1('0x3a')][_0x74c1('0x5b')]?_0x37a634[_0x74c1('0x3a')]:_0x4a61e9[_0x74c1('0x36')];_0x37a634[_0x74c1('0x3e')]=qs[_0x74c1('0x3f')](_0xa871cf[_0x74c1('0x37')]['sort']);_0x37a634[_0x74c1('0x5c')]=qs[_0x74c1('0x38')](_[_0x74c1('0x40')](_0xa871cf[_0x74c1('0x37')],_0x4a61e9[_0x74c1('0x38')]));_0x37a634[_0x74c1('0x5c')]=_[_0x74c1('0x42')](_0x37a634['where'],{'$or':[{'ListId':_0x463dcd['id']},{'ListId':null}]});if(_0xa871cf[_0x74c1('0x37')][_0x74c1('0x41')]){_0x37a634[_0x74c1('0x5c')]=_[_0x74c1('0x42')](_0x37a634[_0x74c1('0x5c')],{'$or':_[_0x74c1('0x32')](_0x37a634['attributes'],function(_0x4ed162){var _0x4e0563={};_0x4e0563[_0x4ed162]={'$like':'%'+_0xa871cf[_0x74c1('0x37')]['filter']+'%'};return _0x4e0563;})});}_0x37a634=_[_0x74c1('0x42')]({},_0x37a634,_0xa871cf[_0x74c1('0x4a')]);return db[_0x74c1('0x6d')][_0x74c1('0x8c')](_0x37a634);}})[_0x74c1('0x28')](respondWithResult(_0x5d55c4,null))['catch'](handleError(_0x5d55c4,null));};exports[_0x74c1('0x8d')]=function(_0x446b41,_0x7623e7,_0x47c86e){return db['CmList'][_0x74c1('0x4b')]({'where':{'id':_0x446b41['params']['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x7623e7,null))[_0x74c1('0x28')](function(_0x47114b){if(_0x47114b){return _0x47114b[_0x74c1('0x8d')](_0x446b41[_0x74c1('0x4d')]['ids'],_[_0x74c1('0x67')](_0x446b41['body'],['ids','id'])||{})[_0x74c1('0x8e')](function(_0x5dc22d){for(var _0x36de0b=0x0;_0x36de0b<_0x446b41[_0x74c1('0x4d')]['ids'][_0x74c1('0x5b')];_0x36de0b+=0x1){socket[_0x74c1('0x8f')](_0x74c1('0x90'),{'UserId':Number(_0x446b41[_0x74c1('0x4d')]['ids'][_0x36de0b]),'CmListId':Number(_0x446b41[_0x74c1('0x47')]['id'])});}return _0x5dc22d;});}})[_0x74c1('0x28')](respondWithResult(_0x7623e7,null))[_0x74c1('0x46')](handleError(_0x7623e7,null));};exports[_0x74c1('0x91')]=function(_0x58d297,_0x462277,_0x143ec9){return db[_0x74c1('0x33')][_0x74c1('0x4b')]({'where':{'id':_0x58d297[_0x74c1('0x47')]['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x462277,null))[_0x74c1('0x28')](function(_0x550074){if(_0x550074){return _0x550074[_0x74c1('0x91')](_0x58d297[_0x74c1('0x37')][_0x74c1('0x5f')])['then'](function(){if(_['isArray'](_0x58d297[_0x74c1('0x37')]['ids'])){for(var _0x199d53=0x0;_0x199d53<_0x58d297[_0x74c1('0x37')]['ids'][_0x74c1('0x5b')];_0x199d53+=0x1){socket[_0x74c1('0x8f')](_0x74c1('0x92'),{'UserId':Number(_0x58d297[_0x74c1('0x37')][_0x74c1('0x5f')][_0x199d53]),'CmListId':Number(_0x58d297[_0x74c1('0x47')]['id'])});}}else{socket[_0x74c1('0x8f')](_0x74c1('0x92'),{'UserId':Number(_0x58d297[_0x74c1('0x37')][_0x74c1('0x5f')]),'CmListId':Number(_0x58d297[_0x74c1('0x47')]['id'])});}});}})[_0x74c1('0x28')](respondWithStatusCode(_0x462277,null))[_0x74c1('0x46')](handleError(_0x462277,null));};exports[_0x74c1('0x93')]=function(_0x23dd14,_0x1b4eb0,_0x12c28e){var _0x592e49={};var _0x4c7894={};var _0x32be65;var _0x678b83;return db[_0x74c1('0x33')]['findOne']({'where':{'id':_0x23dd14[_0x74c1('0x47')]['id']}})[_0x74c1('0x28')](handleEntityNotFound(_0x1b4eb0,null))['then'](function(_0x42fc23){if(_0x42fc23){_0x32be65=_0x42fc23;_0x4c7894[_0x74c1('0x36')]=_[_0x74c1('0x48')](db[_0x74c1('0x94')][_0x74c1('0x34')]);_0x4c7894['query']=_[_0x74c1('0x48')](_0x23dd14[_0x74c1('0x37')]);_0x4c7894[_0x74c1('0x38')]=_[_0x74c1('0x39')](_0x4c7894[_0x74c1('0x36')],_0x4c7894[_0x74c1('0x37')]);_0x592e49[_0x74c1('0x3a')]=_[_0x74c1('0x39')](_0x4c7894[_0x74c1('0x36')],qs[_0x74c1('0x3b')](_0x23dd14[_0x74c1('0x37')][_0x74c1('0x3b')]));_0x592e49['attributes']=_0x592e49['attributes'][_0x74c1('0x5b')]?_0x592e49[_0x74c1('0x3a')]:_0x4c7894[_0x74c1('0x36')];_0x592e49['order']=qs[_0x74c1('0x3f')](_0x23dd14['query'][_0x74c1('0x3f')]);_0x592e49['where']=qs[_0x74c1('0x38')](_[_0x74c1('0x40')](_0x23dd14['query'],_0x4c7894[_0x74c1('0x38')]));if(_0x23dd14[_0x74c1('0x37')]['filter']){_0x592e49[_0x74c1('0x5c')]=_[_0x74c1('0x42')](_0x592e49[_0x74c1('0x5c')],{'$or':_[_0x74c1('0x32')](_0x592e49['attributes'],function(_0x582a8e){var _0xddcdee={};_0xddcdee[_0x582a8e]={'$like':'%'+_0x23dd14[_0x74c1('0x37')][_0x74c1('0x41')]+'%'};return _0xddcdee;})});}_0x592e49=_['merge']({},_0x592e49,_0x23dd14['options']);return _0x32be65['getAgents'](_0x592e49);}})[_0x74c1('0x28')](function(_0x37d4ff){if(_0x37d4ff){_0x678b83=_0x37d4ff[_0x74c1('0x5b')];if(!_0x23dd14[_0x74c1('0x37')]['hasOwnProperty'](_0x74c1('0x3d'))){_0x592e49[_0x74c1('0x20')]=qs['limit'](_0x23dd14['query'][_0x74c1('0x20')]);_0x592e49['offset']=qs[_0x74c1('0x1f')](_0x23dd14['query'][_0x74c1('0x1f')]);}return _0x32be65['getAgents'](_0x592e49);}})['then'](function(_0x139c36){if(_0x139c36){return _0x139c36?{'count':_0x678b83,'rows':_0x139c36}:null;}})[_0x74c1('0x28')](respondWithResult(_0x1b4eb0,null))[_0x74c1('0x46')](handleError(_0x1b4eb0,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index ee12924..fe8bcfc 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x55ca,0x126));var _0xa55c=function(_0x335f37,_0x37302b){_0x335f37=_0x335f37-0x0;var _0x1768f4=_0x55ca[_0x335f37];return _0x1768f4;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x4408d7,_0x163a55){var _0xe32416=function(_0x530171){while(--_0x530171){_0x4408d7['push'](_0x4408d7['shift']());}};_0xe32416(++_0x163a55);}(_0x814b,0x1a2));var _0xb814=function(_0x337537,_0x4ea7b8){_0x337537=_0x337537-0x0;var _0x4fdd67=_0x814b[_0x337537];return _0x4fdd67;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 57e1993..6b13a4d 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 _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0xa75b,0x170));var _0xba75=function(_0x37e191,_0x578ce2){_0x37e191=_0x37e191-0x0;var _0x59d44a=_0xa75b[_0x37e191];return _0x59d44a;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x702d=['exports','define','CmList','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xf8751,_0x370897){var _0x24deff=function(_0x565cae){while(--_0x565cae){_0xf8751['push'](_0xf8751['shift']());}};_0x24deff(++_0x370897);}(_0x702d,0x147));var _0xd702=function(_0x44d303,_0x2a13e9){_0x44d303=_0x44d303-0x0;var _0x3e6e31=_0x702d[_0x44d303];return _0x3e6e31;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./cmList.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'cm_lists','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 44e2e89..1f429a7 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 _0x37f7=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2a4dda,_0x394a1b){var _0xe725e=function(_0x5c005c){while(--_0x5c005c){_0x2a4dda['push'](_0x2a4dda['shift']());}};_0xe725e(++_0x394a1b);}(_0x37f7,0x1d7));var _0x737f=function(_0x15f39e,_0x473b61){_0x15f39e=_0x15f39e-0x0;var _0xb4f8e5=_0x37f7[_0x15f39e];return _0xb4f8e5;};'use strict';var _=require(_0x737f('0x0'));var util=require(_0x737f('0x1'));var moment=require(_0x737f('0x2'));var BPromise=require(_0x737f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x737f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x737f('0x5'));var logger=require(_0x737f('0x6'))('rpc');var config=require(_0x737f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x737f('0x8')]['http']({'port':0x232a});config[_0x737f('0x9')]=_[_0x737f('0xa')](config['redis'],{'host':_0x737f('0xb'),'port':0x18eb});var socket=require(_0x737f('0xc'))(new Redis(config[_0x737f('0x9')]));require(_0x737f('0xd'))['register'](socket);function respondWithRpcPromise(_0x4c37c5,_0x290a5f,_0x154f81){return new BPromise(function(_0x33f0a3,_0x2dc1d2){return client[_0x737f('0xe')](_0x4c37c5,_0x154f81)[_0x737f('0xf')](function(_0x181636){logger[_0x737f('0x10')](_0x737f('0x11'),_0x290a5f,'request\x20sent');logger[_0x737f('0x12')](_0x737f('0x13'),_0x290a5f,_0x737f('0x14'),JSON[_0x737f('0x15')](_0x181636));if(_0x181636[_0x737f('0x16')]){if(_0x181636['error'][_0x737f('0x17')]===0x1f4){logger[_0x737f('0x16')](_0x737f('0x11'),_0x290a5f,_0x181636['error'][_0x737f('0x18')]);return _0x2dc1d2(_0x181636[_0x737f('0x16')][_0x737f('0x18')]);}logger[_0x737f('0x16')]('CmList,\x20%s,\x20%s',_0x290a5f,_0x181636[_0x737f('0x16')][_0x737f('0x18')]);return _0x33f0a3(_0x181636[_0x737f('0x16')]['message']);}else{logger[_0x737f('0x10')](_0x737f('0x11'),_0x290a5f,_0x737f('0x14'));_0x33f0a3(_0x181636['result'][_0x737f('0x18')]);}})[_0x737f('0x19')](function(_0x4e8a4a){logger[_0x737f('0x16')](_0x737f('0x11'),_0x290a5f,_0x4e8a4a);_0x2dc1d2(_0x4e8a4a);});});} \ No newline at end of file +var _0x950f=['./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x950f,0x16a));var _0xf950=function(_0x40cff7,_0x5c3eb5){_0x40cff7=_0x40cff7-0x0;var _0x38006f=_0x950f[_0x40cff7];return _0x38006f;};'use strict';var _=require(_0xf950('0x0'));var util=require(_0xf950('0x1'));var moment=require(_0xf950('0x2'));var BPromise=require(_0xf950('0x3'));var rs=require(_0xf950('0x4'));var fs=require('fs');var Redis=require(_0xf950('0x5'));var db=require(_0xf950('0x6'))['db'];var utils=require(_0xf950('0x7'));var logger=require(_0xf950('0x8'))(_0xf950('0x9'));var config=require(_0xf950('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf950('0xb')][_0xf950('0xc')]({'port':0x232a});config[_0xf950('0xd')]=_['defaults'](config[_0xf950('0xd')],{'host':_0xf950('0xe'),'port':0x18eb});var socket=require(_0xf950('0xf'))(new Redis(config[_0xf950('0xd')]));require(_0xf950('0x10'))[_0xf950('0x11')](socket);function respondWithRpcPromise(_0x1073a0,_0xd49c58,_0x27560d){return new BPromise(function(_0x5d9169,_0x32c91d){return client[_0xf950('0x12')](_0x1073a0,_0x27560d)['then'](function(_0x538021){logger[_0xf950('0x13')](_0xf950('0x14'),_0xd49c58,_0xf950('0x15'));logger['debug'](_0xf950('0x16'),_0xd49c58,_0xf950('0x15'),JSON['stringify'](_0x538021));if(_0x538021[_0xf950('0x17')]){if(_0x538021[_0xf950('0x17')][_0xf950('0x18')]===0x1f4){logger[_0xf950('0x17')]('CmList,\x20%s,\x20%s',_0xd49c58,_0x538021[_0xf950('0x17')][_0xf950('0x19')]);return _0x32c91d(_0x538021[_0xf950('0x17')][_0xf950('0x19')]);}logger['error'](_0xf950('0x14'),_0xd49c58,_0x538021[_0xf950('0x17')][_0xf950('0x19')]);return _0x5d9169(_0x538021['error'][_0xf950('0x19')]);}else{logger[_0xf950('0x13')](_0xf950('0x14'),_0xd49c58,_0xf950('0x15'));_0x5d9169(_0x538021['result'][_0xf950('0x19')]);}})[_0xf950('0x1a')](function(_0x3ca198){logger[_0xf950('0x17')](_0xf950('0x14'),_0xd49c58,_0x3ca198);_0x32c91d(_0x3ca198);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 980ff31..dd2f948 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 _0xebff=['register','length','remove','update','removeListener'];(function(_0x58b5cf,_0x3b1891){var _0x4d4a1e=function(_0x55f5f4){while(--_0x55f5f4){_0x58b5cf['push'](_0x58b5cf['shift']());}};_0x4d4a1e(++_0x3b1891);}(_0xebff,0x147));var _0xfebf=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xebff[_0x2080a3];return _0x8d7d17;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xfebf('0x0'),_0xfebf('0x1')];function createListener(_0x2159cc,_0x42b1ac){return function(_0x2dd296){_0x42b1ac['emit'](_0x2159cc,_0x2dd296);};}function removeListener(_0x16ad6e,_0x1a8084){return function(){CmListEvents[_0xfebf('0x2')](_0x16ad6e,_0x1a8084);};}exports[_0xfebf('0x3')]=function(_0x309920){for(var _0x5f2e65=0x0,_0x33a544=events[_0xfebf('0x4')];_0x5f2e65<_0x33a544;_0x5f2e65++){var _0x2b7252=events[_0x5f2e65];var _0x3ecfa9=createListener('cmList:'+_0x2b7252,_0x309920);CmListEvents['on'](_0x2b7252,_0x3ecfa9);}}; \ No newline at end of file +var _0xd46c=['update','removeListener','register','length','cmList:','remove'];(function(_0x2c879e,_0x393d19){var _0x1d4f32=function(_0x3b92b8){while(--_0x3b92b8){_0x2c879e['push'](_0x2c879e['shift']());}};_0x1d4f32(++_0x393d19);}(_0xd46c,0x1f1));var _0xcd46=function(_0x25206c,_0x87c8e9){_0x25206c=_0x25206c-0x0;var _0x69d016=_0xd46c[_0x25206c];return _0x69d016;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xcd46('0x0'),_0xcd46('0x1')];function createListener(_0x588564,_0x1c0101){return function(_0x1fa69f){_0x1c0101['emit'](_0x588564,_0x1fa69f);};}function removeListener(_0x2b6517,_0x298a4e){return function(){CmListEvents[_0xcd46('0x2')](_0x2b6517,_0x298a4e);};}exports[_0xcd46('0x3')]=function(_0x5dd748){for(var _0x5efce9=0x0,_0x110353=events[_0xcd46('0x4')];_0x5efce9<_0x110353;_0x5efce9++){var _0x28e6d4=events[_0x5efce9];var _0x152c41=createListener(_0xcd46('0x5')+_0x28e6d4,_0x5dd748);CmListEvents['on'](_0x28e6d4,_0x152c41);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0681bdb..2255a6a 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 _0x942c=['addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getContacts','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','/:id/fields','addCustomField'];(function(_0x9e14b2,_0x173211){var _0x5ddb08=function(_0x546af0){while(--_0x546af0){_0x9e14b2['push'](_0x9e14b2['shift']());}};_0x5ddb08(++_0x173211);}(_0x942c,0xe0));var _0xc942=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x942c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc942('0x0'));var util=require('util');var path=require(_0xc942('0x1'));var timeout=require(_0xc942('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc942('0x3'));var auth=require(_0xc942('0x4'));var interaction=require(_0xc942('0x5'));var config=require(_0xc942('0x6'));var controller=require(_0xc942('0x7'));router['get']('/',auth[_0xc942('0x8')](),controller[_0xc942('0x9')]);router[_0xc942('0xa')](_0xc942('0xb'),auth[_0xc942('0x8')](),controller[_0xc942('0xc')]);router[_0xc942('0xa')](_0xc942('0xd'),auth['isAuthenticated'](),controller[_0xc942('0xe')]);router['get'](_0xc942('0xf'),auth[_0xc942('0x8')](),controller['getDispositions']);router[_0xc942('0xa')]('/:id/contacts',auth[_0xc942('0x8')](),controller[_0xc942('0x10')]);router['get']('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xc942('0x11')]);router[_0xc942('0xa')]('/:id/fields',auth[_0xc942('0x8')](),controller[_0xc942('0x12')]);router['get'](_0xc942('0x13'),auth['isAuthenticated'](),controller[_0xc942('0x14')]);router[_0xc942('0x15')]('/',auth[_0xc942('0x8')](),controller[_0xc942('0x16')]);router['post'](_0xc942('0xf'),auth[_0xc942('0x8')](),controller[_0xc942('0x17')]);router[_0xc942('0x15')](_0xc942('0x18'),auth[_0xc942('0x8')](),controller[_0xc942('0x19')]);router[_0xc942('0x15')](_0xc942('0x1a'),auth[_0xc942('0x8')](),controller[_0xc942('0x1b')]);router[_0xc942('0x15')](_0xc942('0x13'),auth[_0xc942('0x8')](),controller[_0xc942('0x1c')]);router[_0xc942('0x1d')](_0xc942('0xd'),auth[_0xc942('0x8')](),controller[_0xc942('0x1e')]);router[_0xc942('0x1f')](_0xc942('0xd'),auth[_0xc942('0x8')](),controller[_0xc942('0x20')]);router[_0xc942('0x1f')](_0xc942('0xf'),auth[_0xc942('0x8')](),controller[_0xc942('0x21')]);router[_0xc942('0x1f')](_0xc942('0x13'),auth[_0xc942('0x8')](),controller[_0xc942('0x22')]);module[_0xc942('0x23')]=router; \ No newline at end of file +var _0xef3b=['getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addContacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/dispositions'];(function(_0x23c5a6,_0x435e60){var _0x3788a7=function(_0x329d91){while(--_0x329d91){_0x23c5a6['push'](_0x23c5a6['shift']());}};_0x3788a7(++_0x435e60);}(_0xef3b,0x179));var _0xbef3=function(_0x49a052,_0x22ad5e){_0x49a052=_0x49a052-0x0;var _0x5d5618=_0xef3b[_0x49a052];return _0x5d5618;};'use strict';var multer=require(_0xbef3('0x0'));var util=require(_0xbef3('0x1'));var path=require(_0xbef3('0x2'));var timeout=require(_0xbef3('0x3'));var express=require('express');var router=express[_0xbef3('0x4')]();var fs_extra=require(_0xbef3('0x5'));var auth=require(_0xbef3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbef3('0x7'));var controller=require('./cmList.controller');router[_0xbef3('0x8')]('/',auth[_0xbef3('0x9')](),controller['index']);router[_0xbef3('0x8')]('/describe',auth[_0xbef3('0x9')](),controller['describe']);router[_0xbef3('0x8')](_0xbef3('0xa'),auth[_0xbef3('0x9')](),controller[_0xbef3('0xb')]);router[_0xbef3('0x8')](_0xbef3('0xc'),auth[_0xbef3('0x9')](),controller[_0xbef3('0xd')]);router[_0xbef3('0x8')](_0xbef3('0xe'),auth[_0xbef3('0x9')](),controller['getContacts']);router[_0xbef3('0x8')](_0xbef3('0xf'),auth[_0xbef3('0x9')](),controller[_0xbef3('0x10')]);router[_0xbef3('0x8')](_0xbef3('0x11'),auth[_0xbef3('0x9')](),controller[_0xbef3('0x12')]);router['get'](_0xbef3('0x13'),auth[_0xbef3('0x9')](),controller['getAgents']);router[_0xbef3('0x14')]('/',auth[_0xbef3('0x9')](),controller[_0xbef3('0x15')]);router[_0xbef3('0x14')]('/:id/dispositions',auth[_0xbef3('0x9')](),controller['addDisposition']);router[_0xbef3('0x14')](_0xbef3('0xe'),auth[_0xbef3('0x9')](),controller[_0xbef3('0x16')]);router[_0xbef3('0x14')](_0xbef3('0x11'),auth[_0xbef3('0x9')](),controller[_0xbef3('0x17')]);router['post'](_0xbef3('0x13'),auth['isAuthenticated'](),controller[_0xbef3('0x18')]);router[_0xbef3('0x19')]('/:id',auth[_0xbef3('0x9')](),controller['update']);router[_0xbef3('0x1a')](_0xbef3('0xa'),auth[_0xbef3('0x9')](),controller[_0xbef3('0x1b')]);router[_0xbef3('0x1a')](_0xbef3('0xc'),auth[_0xbef3('0x9')](),controller[_0xbef3('0x1c')]);router[_0xbef3('0x1a')](_0xbef3('0x13'),auth[_0xbef3('0x9')](),controller[_0xbef3('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 074cc0b..c170fe7 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 _0x979c=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x3ad737,_0x300131){var _0x16c1e2=function(_0x4c64fe){while(--_0x4c64fe){_0x3ad737['push'](_0x3ad737['shift']());}};_0x16c1e2(++_0x300131);}(_0x979c,0xd0));var _0xc979=function(_0x3ad6e6,_0x552abb){_0x3ad6e6=_0x3ad6e6-0x0;var _0x17d030=_0x979c[_0x3ad6e6];return _0x17d030;};'use strict';var Sequelize=require(_0xc979('0x0'));module[_0xc979('0x1')]={'name':{'type':Sequelize[_0xc979('0x2')],'get':function(_0x4e4b5e){return this['getDataValue'](_0xc979('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xc979('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x7b15=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x1f90f6,_0x5aa570){var _0x27795b=function(_0x64cbda){while(--_0x64cbda){_0x1f90f6['push'](_0x1f90f6['shift']());}};_0x27795b(++_0x5aa570);}(_0x7b15,0x162));var _0x57b1=function(_0xb01343,_0x1b0003){_0xb01343=_0xb01343-0x0;var _0x1ed45e=_0x7b15[_0xb01343];return _0x1ed45e;};'use strict';var Sequelize=require(_0x57b1('0x0'));module[_0x57b1('0x1')]={'name':{'type':Sequelize[_0x57b1('0x2')],'get':function(_0x23c7e0){return this[_0x57b1('0x3')](_0x57b1('0x4'));}},'field':{'type':Sequelize[_0x57b1('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x57b1('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 7096dc0..8be9981 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(_0x43a2b4,_0x1c3871){var _0x3044a1=function(_0x1f19ce){while(--_0x1f19ce){_0x43a2b4['push'](_0x43a2b4['shift']());}};_0x3044a1(++_0x1c3871);}(_0x7a54,0x106));var _0x47a5=function(_0x5149aa,_0x5e88f0){_0x5149aa=_0x5149aa-0x0;var _0x386708=_0x7a54[_0x5149aa];return _0x386708;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x484928,_0x444aea){var _0x223d78=function(_0x2c2184){while(--_0x2c2184){_0x484928['push'](_0x484928['shift']());}};_0x223d78(++_0x444aea);}(_0x7a54,0x106));var _0x47a5=function(_0x224934,_0x2936e1){_0x224934=_0x224934-0x0;var _0xd4a93=_0x7a54[_0x224934];return _0xd4a93;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index fb1bce6..f7035ae 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 _0xc35c=['Condition','tools_conditions','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x3acbb1,_0xd43f85){var _0x585e72=function(_0x12bb95){while(--_0x12bb95){_0x3acbb1['push'](_0x3acbb1['shift']());}};_0x585e72(++_0xd43f85);}(_0xc35c,0x162));var _0xcc35=function(_0x197176,_0x24b6c3){_0x197176=_0x197176-0x0;var _0x2a5220=_0xc35c[_0x197176];return _0x2a5220;};'use strict';var _=require('lodash');var util=require(_0xcc35('0x0'));var logger=require(_0xcc35('0x1'))('api');var moment=require(_0xcc35('0x2'));var BPromise=require(_0xcc35('0x3'));var rp=require(_0xcc35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc35('0x5'));var config=require(_0xcc35('0x6'));var attributes=require(_0xcc35('0x7'));module[_0xcc35('0x8')]=function(_0x19fb6a,_0x2fde71){return _0x19fb6a['define'](_0xcc35('0x9'),attributes,{'tableName':_0xcc35('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35ba=['define','Condition','tools_conditions','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./condition.attributes','exports'];(function(_0xf6aec0,_0x51ffd6){var _0x59a51b=function(_0x57adc6){while(--_0x57adc6){_0xf6aec0['push'](_0xf6aec0['shift']());}};_0x59a51b(++_0x51ffd6);}(_0x35ba,0x93));var _0xa35b=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0x35ba[_0x1f27df];return _0x286ee2;};'use strict';var _=require('lodash');var util=require(_0xa35b('0x0'));var logger=require(_0xa35b('0x1'))(_0xa35b('0x2'));var moment=require('moment');var BPromise=require(_0xa35b('0x3'));var rp=require(_0xa35b('0x4'));var fs=require('fs');var path=require(_0xa35b('0x5'));var rimraf=require(_0xa35b('0x6'));var config=require('../../config/environment');var attributes=require(_0xa35b('0x7'));module[_0xa35b('0x8')]=function(_0x2671b5,_0x4914a9){return _0x2671b5[_0xa35b('0x9')](_0xa35b('0xa'),attributes,{'tableName':_0xa35b('0xb'),'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 302966f..4539544 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 _0x127a=['message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','Condition,\x20%s,\x20%s'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x127a,0x9d));var _0xa127=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x127a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xa127('0x0'));var util=require('util');var moment=require(_0xa127('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa127('0x2'));var db=require(_0xa127('0x3'))['db'];var utils=require(_0xa127('0x4'));var logger=require(_0xa127('0x5'))(_0xa127('0x6'));var config=require(_0xa127('0x7'));var jayson=require(_0xa127('0x8'));var client=jayson[_0xa127('0x9')][_0xa127('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ac1e6,_0x169d26,_0x4bdb55){return new BPromise(function(_0x2d5677,_0x1e8de6){return client[_0xa127('0xb')](_0x3ac1e6,_0x4bdb55)['then'](function(_0x426315){logger[_0xa127('0xc')]('Condition,\x20%s,\x20%s',_0x169d26,_0xa127('0xd'));logger[_0xa127('0xe')](_0xa127('0xf'),_0x169d26,_0xa127('0xd'),JSON[_0xa127('0x10')](_0x426315));if(_0x426315[_0xa127('0x11')]){if(_0x426315[_0xa127('0x11')]['code']===0x1f4){logger[_0xa127('0x11')](_0xa127('0x12'),_0x169d26,_0x426315[_0xa127('0x11')]['message']);return _0x1e8de6(_0x426315['error'][_0xa127('0x13')]);}logger[_0xa127('0x11')](_0xa127('0x12'),_0x169d26,_0x426315['error'][_0xa127('0x13')]);return _0x2d5677(_0x426315[_0xa127('0x11')][_0xa127('0x13')]);}else{logger[_0xa127('0xc')]('Condition,\x20%s,\x20%s',_0x169d26,_0xa127('0xd'));_0x2d5677(_0x426315[_0xa127('0x14')]['message']);}})[_0xa127('0x15')](function(_0x7b34c3){logger[_0xa127('0x11')](_0xa127('0x12'),_0x169d26,_0x7b34c3);_0x1e8de6(_0x7b34c3);});});} \ No newline at end of file +var _0x8294=['request','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x4f848a,_0x240ad6){var _0x5b19a1=function(_0x45d1c1){while(--_0x45d1c1){_0x4f848a['push'](_0x4f848a['shift']());}};_0x5b19a1(++_0x240ad6);}(_0x8294,0x96));var _0x4829=function(_0x378406,_0x278151){_0x378406=_0x378406-0x0;var _0x18b018=_0x8294[_0x378406];return _0x18b018;};'use strict';var _=require(_0x4829('0x0'));var util=require('util');var moment=require(_0x4829('0x1'));var BPromise=require('bluebird');var rs=require(_0x4829('0x2'));var fs=require('fs');var Redis=require(_0x4829('0x3'));var db=require(_0x4829('0x4'))['db'];var utils=require(_0x4829('0x5'));var logger=require('../../config/logger')(_0x4829('0x6'));var config=require(_0x4829('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4829('0x8')][_0x4829('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22af78,_0x43b28b,_0x302d75){return new BPromise(function(_0x2370d1,_0x49d5a0){return client[_0x4829('0xa')](_0x22af78,_0x302d75)['then'](function(_0x183fe5){logger[_0x4829('0xb')](_0x4829('0xc'),_0x43b28b,_0x4829('0xd'));logger['debug'](_0x4829('0xe'),_0x43b28b,_0x4829('0xd'),JSON[_0x4829('0xf')](_0x183fe5));if(_0x183fe5[_0x4829('0x10')]){if(_0x183fe5[_0x4829('0x10')][_0x4829('0x11')]===0x1f4){logger['error'](_0x4829('0xc'),_0x43b28b,_0x183fe5['error'][_0x4829('0x12')]);return _0x49d5a0(_0x183fe5['error']['message']);}logger[_0x4829('0x10')](_0x4829('0xc'),_0x43b28b,_0x183fe5['error']['message']);return _0x2370d1(_0x183fe5['error'][_0x4829('0x12')]);}else{logger[_0x4829('0xb')](_0x4829('0xc'),_0x43b28b,'request\x20sent');_0x2370d1(_0x183fe5['result'][_0x4829('0x12')]);}})[_0x4829('0x13')](function(_0x486f68){logger['error']('Condition,\x20%s,\x20%s',_0x43b28b,_0x486f68);_0x49d5a0(_0x486f68);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ffe9eea..aca48ac 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 _0xa738=['../../config/environment','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x80aaa6,_0x2f8e20){var _0x1ea132=function(_0x178998){while(--_0x178998){_0x80aaa6['push'](_0x80aaa6['shift']());}};_0x1ea132(++_0x2f8e20);}(_0xa738,0x93));var _0x8a73=function(_0x614ae0,_0x44902d){_0x614ae0=_0x614ae0-0x0;var _0xf955a4=_0xa738[_0x614ae0];return _0xf955a4;};'use strict';var multer=require(_0x8a73('0x0'));var util=require(_0x8a73('0x1'));var path=require(_0x8a73('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a73('0x3'));var router=express[_0x8a73('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8a73('0x5'));var interaction=require(_0x8a73('0x6'));var config=require(_0x8a73('0x7'));var controller=require('./condition.controller');router[_0x8a73('0x8')](_0x8a73('0x9'),auth['isAuthenticated'](),controller[_0x8a73('0xa')]);router[_0x8a73('0xb')](_0x8a73('0x9'),auth['isAuthenticated'](),controller[_0x8a73('0xc')]);module[_0x8a73('0xd')]=router; \ No newline at end of file +var _0xc3eb=['fs-extra','../../components/auth/service','../../config/environment','./condition.controller','isAuthenticated','update','delete','/:id','path','express','Router'];(function(_0x321953,_0x41166a){var _0x36f9e9=function(_0x2311da){while(--_0x2311da){_0x321953['push'](_0x321953['shift']());}};_0x36f9e9(++_0x41166a);}(_0xc3eb,0x173));var _0xbc3e=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0xc3eb[_0x37a79c];return _0x561d89;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc3e('0x0'));var timeout=require('connect-timeout');var express=require(_0xbc3e('0x1'));var router=express[_0xbc3e('0x2')]();var fs_extra=require(_0xbc3e('0x3'));var auth=require(_0xbc3e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbc3e('0x5'));var controller=require(_0xbc3e('0x6'));router['put']('/:id',auth[_0xbc3e('0x7')](),controller[_0xbc3e('0x8')]);router[_0xbc3e('0x9')](_0xbc3e('0xa'),auth[_0xbc3e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 3433ee9..5978338 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x185723,_0x5d3c53){var _0x5835e6=function(_0xe55625){while(--_0xe55625){_0x185723['push'](_0x185723['shift']());}};_0x5835e6(++_0x5d3c53);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x11e012,_0x375ea8){var _0x3d2552=function(_0x3f42a7){while(--_0x3f42a7){_0x11e012['push'](_0x11e012['shift']());}};_0x3d2552(++_0x375ea8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 58a583a..76b5ffd 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 _0xcbfa=['length','nolimit','order','sort','pick','filter','merge','name','include','findAll','catch','params','rawAttributes','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','autoAssociation','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','findOne','DashboardItem','where','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','stack','index','map','Dashboard','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0xba2304,_0x476a68){var _0xdf2560=function(_0x5e82d4){while(--_0x5e82d4){_0xba2304['push'](_0xba2304['shift']());}};_0xdf2560(++_0x476a68);}(_0xcbfa,0x12b));var _0xacbf=function(_0x4a8ce2,_0x4cd94e){_0x4a8ce2=_0x4a8ce2-0x0;var _0x38c265=_0xcbfa[_0x4a8ce2];return _0x38c265;};'use strict';var emlformat=require(_0xacbf('0x0'));var rimraf=require(_0xacbf('0x1'));var zipdir=require(_0xacbf('0x2'));var jsonpatch=require(_0xacbf('0x3'));var rp=require(_0xacbf('0x4'));var moment=require(_0xacbf('0x5'));var BPromise=require(_0xacbf('0x6'));var Mustache=require(_0xacbf('0x7'));var util=require(_0xacbf('0x8'));var path=require('path');var sox=require(_0xacbf('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xacbf('0xa'));var _=require(_0xacbf('0xb'));var squel=require(_0xacbf('0xc'));var crypto=require(_0xacbf('0xd'));var jsforce=require(_0xacbf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xacbf('0xf'));var querystring=require(_0xacbf('0x10'));var Papa=require(_0xacbf('0x11'));var Redis=require(_0xacbf('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xacbf('0x13'));var as=require(_0xacbf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacbf('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xacbf('0x16'));var licenseUtil=require(_0xacbf('0x17'));var db=require(_0xacbf('0x18'))['db'];config[_0xacbf('0x19')]=_[_0xacbf('0x1a')](config[_0xacbf('0x19')],{'host':_0xacbf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0xacbf('0x1c')](socket);function respondWithStatusCode(_0x2c9a82,_0x101d43){_0x101d43=_0x101d43||0xcc;return function(_0x27b644){if(_0x27b644){return _0x2c9a82[_0xacbf('0x1d')](_0x101d43);}return _0x2c9a82['status'](_0x101d43)[_0xacbf('0x1e')]();};}function respondWithResult(_0x4e6fc0,_0x3675d8){_0x3675d8=_0x3675d8||0xc8;return function(_0x5e69a4){if(_0x5e69a4){return _0x4e6fc0[_0xacbf('0x1f')](_0x3675d8)[_0xacbf('0x20')](_0x5e69a4);}};}function respondWithFilteredResult(_0x102848,_0x544abc){return function(_0x10cdcb){if(_0x10cdcb){var _0x17486c=typeof _0x544abc[_0xacbf('0x21')]===_0xacbf('0x22')&&typeof _0x544abc[_0xacbf('0x23')]===_0xacbf('0x22');var _0x2facc0=_0x10cdcb[_0xacbf('0x24')];var _0xb38898=_0x17486c?0x0:_0x544abc[_0xacbf('0x21')];var _0x53c00f=_0x17486c?_0x10cdcb['count']:_0x544abc['offset']+_0x544abc[_0xacbf('0x23')];var _0x4c1600;if(_0x53c00f>=_0x2facc0){_0x53c00f=_0x2facc0;_0x4c1600=0xc8;}else{_0x4c1600=0xce;}_0x102848[_0xacbf('0x1f')](_0x4c1600);return _0x102848[_0xacbf('0x25')](_0xacbf('0x26'),_0xb38898+'-'+_0x53c00f+'/'+_0x2facc0)['json'](_0x10cdcb);}return null;};}function patchUpdates(_0x18d934){return function(_0xab6cbe){try{jsonpatch[_0xacbf('0x27')](_0xab6cbe,_0x18d934,!![]);}catch(_0x12efd0){return BPromise['reject'](_0x12efd0);}return _0xab6cbe[_0xacbf('0x28')]();};}function saveUpdates(_0xbdd802,_0x44f4ea){return function(_0x2ee5eb){if(_0x2ee5eb){return _0x2ee5eb['update'](_0xbdd802)[_0xacbf('0x29')](function(_0x3ebb5b){return _0x3ebb5b;});}return null;};}function removeEntity(_0x4d702d,_0x6f5e96){return function(_0x5ba1f5){if(_0x5ba1f5){return _0x5ba1f5[_0xacbf('0x2a')]()[_0xacbf('0x29')](function(){var _0x3e8e22=_0x5ba1f5[_0xacbf('0x2b')]({'plain':!![]});var _0x58b925='CustomDashboards';return db[_0xacbf('0x2c')]['destroy']({'where':{'type':_0x58b925,'resourceId':_0x3e8e22['id']}})[_0xacbf('0x29')](function(){return _0x5ba1f5;});})['then'](function(){_0x4d702d['status'](0xcc)[_0xacbf('0x1e')]();});}};}function handleEntityNotFound(_0x2071b3,_0x46afcd){return function(_0x16287c){if(!_0x16287c){_0x2071b3[_0xacbf('0x1d')](0x194);}return _0x16287c;};}function handleError(_0x52c303,_0x46785c){_0x46785c=_0x46785c||0x1f4;return function(_0x42fd70){logger['error'](_0x42fd70[_0xacbf('0x2d')]);if(_0x42fd70['name']){delete _0x42fd70['name'];}_0x52c303['status'](_0x46785c)['send'](_0x42fd70);};}exports[_0xacbf('0x2e')]=function(_0x454927,_0x54f413){var _0x1da83f={},_0x2ed9df={},_0x330583={'count':0x0,'rows':[]};var _0x1aff8e=_[_0xacbf('0x2f')](db[_0xacbf('0x30')]['rawAttributes'],function(_0x308089){return{'name':_0x308089[_0xacbf('0x31')],'type':_0x308089[_0xacbf('0x32')]['key']};});_0x2ed9df[_0xacbf('0x33')]=_[_0xacbf('0x2f')](_0x1aff8e,'name');_0x2ed9df[_0xacbf('0x34')]=_[_0xacbf('0x35')](_0x454927[_0xacbf('0x34')]);_0x2ed9df[_0xacbf('0x36')]=_[_0xacbf('0x37')](_0x2ed9df[_0xacbf('0x33')],_0x2ed9df['query']);_0x1da83f[_0xacbf('0x38')]=_['intersection'](_0x2ed9df[_0xacbf('0x33')],qs[_0xacbf('0x39')](_0x454927[_0xacbf('0x34')][_0xacbf('0x39')]));_0x1da83f[_0xacbf('0x38')]=_0x1da83f[_0xacbf('0x38')][_0xacbf('0x3a')]?_0x1da83f[_0xacbf('0x38')]:_0x2ed9df[_0xacbf('0x33')];if(!_0x454927[_0xacbf('0x34')]['hasOwnProperty'](_0xacbf('0x3b'))){_0x1da83f[_0xacbf('0x23')]=qs[_0xacbf('0x23')](_0x454927[_0xacbf('0x34')][_0xacbf('0x23')]);_0x1da83f[_0xacbf('0x21')]=qs['offset'](_0x454927['query'][_0xacbf('0x21')]);}_0x1da83f[_0xacbf('0x3c')]=qs['sort'](_0x454927[_0xacbf('0x34')][_0xacbf('0x3d')]);_0x1da83f['where']=qs[_0xacbf('0x36')](_[_0xacbf('0x3e')](_0x454927[_0xacbf('0x34')],_0x2ed9df['filters']),_0x1aff8e);if(_0x454927[_0xacbf('0x34')][_0xacbf('0x3f')]){_0x1da83f['where']=_[_0xacbf('0x40')](_0x1da83f['where'],{'$or':_[_0xacbf('0x2f')](_0x1aff8e,function(_0x3cb3dc){if(_0x3cb3dc[_0xacbf('0x32')]!=='VIRTUAL'){var _0x55c0be={};_0x55c0be[_0x3cb3dc[_0xacbf('0x41')]]={'$like':'%'+_0x454927[_0xacbf('0x34')]['filter']+'%'};return _0x55c0be;}})});}_0x1da83f=_['merge']({},_0x1da83f,_0x454927['options']);var _0x3b3039={'where':_0x1da83f['where']};return db[_0xacbf('0x30')]['count'](_0x3b3039)['then'](function(_0x5b02e9){_0x330583[_0xacbf('0x24')]=_0x5b02e9;if(_0x454927[_0xacbf('0x34')]['includeAll']){_0x1da83f[_0xacbf('0x42')]=[{'all':!![]}];}return db[_0xacbf('0x30')][_0xacbf('0x43')](_0x1da83f);})[_0xacbf('0x29')](function(_0x3702c3){_0x330583['rows']=_0x3702c3;return _0x330583;})[_0xacbf('0x29')](respondWithFilteredResult(_0x54f413,_0x1da83f))[_0xacbf('0x44')](handleError(_0x54f413,null));};exports['show']=function(_0x201595,_0x52da96){var _0x2c5914={'raw':![],'where':{'id':_0x201595[_0xacbf('0x45')]['id']}},_0x12026b={};_0x12026b[_0xacbf('0x33')]=_[_0xacbf('0x35')](db[_0xacbf('0x30')][_0xacbf('0x46')]);_0x12026b[_0xacbf('0x34')]=_['keys'](_0x201595[_0xacbf('0x34')]);_0x12026b['filters']=_['intersection'](_0x12026b[_0xacbf('0x33')],_0x12026b[_0xacbf('0x34')]);_0x2c5914[_0xacbf('0x38')]=_[_0xacbf('0x37')](_0x12026b[_0xacbf('0x33')],qs[_0xacbf('0x39')](_0x201595[_0xacbf('0x34')][_0xacbf('0x39')]));_0x2c5914[_0xacbf('0x38')]=_0x2c5914[_0xacbf('0x38')][_0xacbf('0x3a')]?_0x2c5914[_0xacbf('0x38')]:_0x12026b['model'];if(_0x201595[_0xacbf('0x34')][_0xacbf('0x47')]){_0x2c5914[_0xacbf('0x42')]=[{'all':!![]}];}_0x2c5914=_['merge']({},_0x2c5914,_0x201595[_0xacbf('0x48')]);return db[_0xacbf('0x30')][_0xacbf('0x49')](_0x2c5914)[_0xacbf('0x29')](handleEntityNotFound(_0x52da96,null))[_0xacbf('0x29')](respondWithResult(_0x52da96,null))[_0xacbf('0x44')](handleError(_0x52da96,null));};exports['create']=function(_0x27b9bf,_0x28998d){return db[_0xacbf('0x30')][_0xacbf('0x4a')](_0x27b9bf['body'],{})[_0xacbf('0x29')](function(_0x4b3bfc){var _0x108e9c=_0x27b9bf[_0xacbf('0x4b')]['get']({'plain':!![]});if(!_0x108e9c)throw new Error(_0xacbf('0x4c'));if(_0x108e9c[_0xacbf('0x4d')]===_0xacbf('0x4b')){var _0x2fca54=_0x4b3bfc[_0xacbf('0x2b')]({'plain':!![]});var _0x2a3b83=_0xacbf('0x4e');return db[_0xacbf('0x4f')][_0xacbf('0x49')]({'where':{'name':_0x2a3b83,'userProfileId':_0x108e9c[_0xacbf('0x50')]},'raw':!![]})['then'](function(_0xd609b5){if(_0xd609b5&&_0xd609b5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2fca54['name'],'resourceId':_0x2fca54['id'],'type':_0xd609b5['name'],'sectionId':_0xd609b5['id']},{})['then'](function(){return _0x4b3bfc;});}else{return _0x4b3bfc;}})[_0xacbf('0x44')](function(_0x4254ff){logger[_0xacbf('0x51')](_0xacbf('0x52'),_0x4254ff);throw _0x4254ff;});}return _0x4b3bfc;})['then'](respondWithResult(_0x28998d,0xc9))[_0xacbf('0x44')](handleError(_0x28998d,null));};exports[_0xacbf('0x53')]=function(_0x4491bb,_0x27e9d8){var _0x1de65a={'where':{'id':_0x4491bb['params']['id']}},_0x46f3bd={};_0x46f3bd[_0xacbf('0x33')]=_[_0xacbf('0x35')](db[_0xacbf('0x30')][_0xacbf('0x46')]);_0x1de65a[_0xacbf('0x38')]=_['intersection'](_0x46f3bd[_0xacbf('0x33')],qs[_0xacbf('0x39')](_0x4491bb['query']['fields']));_0x1de65a['attributes']=_0x1de65a['attributes'][_0xacbf('0x3a')]?_0x1de65a['attributes']:_0x46f3bd[_0xacbf('0x33')];if(_0x4491bb['query']['includeAll']){_0x1de65a[_0xacbf('0x42')]=[{'all':!![]}];}_0x1de65a=_['merge']({},_0x1de65a,_0x4491bb[_0xacbf('0x48')]);return db[_0xacbf('0x30')]['find'](_0x1de65a)[_0xacbf('0x29')](handleEntityNotFound(_0x27e9d8,null))[_0xacbf('0x29')](function(_0x1ffe24){if(_0x1ffe24){var _0x353c60=_0x1ffe24['get']({'plain':!![]});_0x353c60=qs['omit'](_0x353c60,['id','createdAt',_0xacbf('0x54')]);_0x4491bb['body']=_['omit'](_0x4491bb[_0xacbf('0x55')],['id',_0xacbf('0x56'),_0xacbf('0x54')]);return db['Dashboard'][_0xacbf('0x4a')](_[_0xacbf('0x40')](_0x353c60,_0x4491bb[_0xacbf('0x55')]),{'include':_0x4491bb[_0xacbf('0x34')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xab137b){var _0x5aaaf9=_0x4491bb[_0xacbf('0x4b')]['get']({'plain':!![]});if(!_0x5aaaf9)throw new Error(_0xacbf('0x4c'));if(_0x5aaaf9[_0xacbf('0x4d')]===_0xacbf('0x4b')){var _0x473ca8=_0xab137b[_0xacbf('0x2b')]({'plain':!![]});var _0x4fb8c9=_0xacbf('0x4e');return db[_0xacbf('0x4f')][_0xacbf('0x49')]({'where':{'name':_0x4fb8c9,'userProfileId':_0x5aaaf9[_0xacbf('0x50')]},'raw':!![]})[_0xacbf('0x29')](function(_0x20f384){if(_0x20f384&&_0x20f384[_0xacbf('0x57')]===0x0){return db['UserProfileResource'][_0xacbf('0x4a')]({'name':_0x473ca8[_0xacbf('0x41')],'resourceId':_0x473ca8['id'],'type':_0x20f384[_0xacbf('0x41')],'sectionId':_0x20f384['id']},{})['then'](function(){return _0xab137b;});}else{return _0xab137b;}})[_0xacbf('0x44')](function(_0x49c537){logger[_0xacbf('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49c537);throw _0x49c537;});}return _0xab137b;});}})[_0xacbf('0x29')](respondWithResult(_0x27e9d8,0xc9))['catch'](handleError(_0x27e9d8,null));};exports[_0xacbf('0x58')]=function(_0x352e26,_0x141e32){if(_0x352e26[_0xacbf('0x55')]['id']){delete _0x352e26[_0xacbf('0x55')]['id'];}return db['Dashboard'][_0xacbf('0x49')]({'where':{'id':_0x352e26['params']['id']}})[_0xacbf('0x29')](handleEntityNotFound(_0x141e32,null))[_0xacbf('0x29')](saveUpdates(_0x352e26['body'],null))['then'](respondWithResult(_0x141e32,null))[_0xacbf('0x44')](handleError(_0x141e32,null));};exports['destroy']=function(_0x45d820,_0x5d5c38){return db['Dashboard'][_0xacbf('0x49')]({'where':{'id':_0x45d820[_0xacbf('0x45')]['id']}})[_0xacbf('0x29')](handleEntityNotFound(_0x5d5c38,null))[_0xacbf('0x29')](removeEntity(_0x5d5c38,null))[_0xacbf('0x44')](handleError(_0x5d5c38,null));};function widgetAttributes(_0x4ce756){try{switch(_0x4ce756['type']){case _0xacbf('0x59'):return[{'name':_0xacbf('0x5a'),'value':_0x4ce756[_0xacbf('0x5a')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x0]?_0x4ce756[_0xacbf('0x5b')][0x0][_0xacbf('0x5c')]:undefined)||_0xacbf('0x5d')}];case _0xacbf('0x5e'):return[{'name':_0xacbf('0x5f'),'value':_0x4ce756[_0xacbf('0x5f')]||(_0x4ce756['attrs']&&_0x4ce756['attrs'][0x0]?_0x4ce756['attrs'][0x0][_0xacbf('0x5c')]:undefined)||''}];case _0xacbf('0x60'):return[{'name':_0xacbf('0x61'),'value':_0x4ce756[_0xacbf('0x61')]||(_0x4ce756['attrs']&&_0x4ce756['attrs'][0x0]?_0x4ce756['attrs'][0x0][_0xacbf('0x5c')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x4ce756[_0xacbf('0x62')]||(_0x4ce756['attrs']&&_0x4ce756[_0xacbf('0x5b')][0x1]?_0x4ce756[_0xacbf('0x5b')][0x1][_0xacbf('0x5c')]:undefined)||_0xacbf('0x63')},{'name':'attrFontSize','value':_0x4ce756[_0xacbf('0x64')]||(_0x4ce756['attrs']&&_0x4ce756['attrs'][0x2]?_0x4ce756[_0xacbf('0x5b')][0x2][_0xacbf('0x5c')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x4ce756[_0xacbf('0x65')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x0]?_0x4ce756[_0xacbf('0x5b')][0x0][_0xacbf('0x5c')]:undefined)||_0xacbf('0x66')},{'name':_0xacbf('0x67'),'value':_0x4ce756[_0xacbf('0x67')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756['attrs'][0x1]?_0x4ce756['attrs'][0x1][_0xacbf('0x5c')]:undefined)||[]},{'name':_0xacbf('0x64'),'value':_0x4ce756[_0xacbf('0x64')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x2]?_0x4ce756[_0xacbf('0x5b')][0x2][_0xacbf('0x5c')]:undefined)||0x14}];case _0xacbf('0x68'):case _0xacbf('0x69'):return[{'name':_0xacbf('0x6a'),'value':_0x4ce756[_0xacbf('0x6a')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x0]?_0x4ce756[_0xacbf('0x5b')][0x0][_0xacbf('0x5c')]:undefined)||_0xacbf('0x66')},{'name':_0xacbf('0x6b'),'value':_0x4ce756[_0xacbf('0x6b')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x1]?_0x4ce756[_0xacbf('0x5b')][0x1][_0xacbf('0x5c')]:undefined)||null},{'name':_0xacbf('0x6c'),'value':_0x4ce756[_0xacbf('0x6c')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x2]?_0x4ce756[_0xacbf('0x5b')][0x2][_0xacbf('0x5c')]:undefined)||null},{'name':_0xacbf('0x67'),'value':_0x4ce756[_0xacbf('0x67')]||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756['attrs'][0x3]?_0x4ce756[_0xacbf('0x5b')][0x3][_0xacbf('0x5c')]:undefined)||[]}];case _0xacbf('0x6d'):return[{'name':'attrReport','type':_0x4ce756['reportType']||(_0x4ce756['attrs']&&_0x4ce756['attrs'][0x0]?_0x4ce756['attrs'][0x0]['type']:undefined)||null,'value':_0x4ce756['attrReport']||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756[_0xacbf('0x5b')][0x0]?_0x4ce756[_0xacbf('0x5b')][0x0][_0xacbf('0x5c')]:undefined)||null},{'name':_0xacbf('0x6e'),'value':_0x4ce756['attrRefresh']||(_0x4ce756[_0xacbf('0x5b')]&&_0x4ce756['attrs'][0x1]?_0x4ce756[_0xacbf('0x5b')][0x1][_0xacbf('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x2dc749){logger[_0xacbf('0x51')](_0xacbf('0x6f'),JSON[_0xacbf('0x70')](_0x2dc749));return[];}}exports[_0xacbf('0x71')]=function(_0x2a3db2,_0x2c495e,_0xc62c3){if(_0x2a3db2[_0xacbf('0x55')]['id']){delete _0x2a3db2[_0xacbf('0x55')]['id'];}return db[_0xacbf('0x30')][_0xacbf('0x49')]({'where':{'id':_0x2a3db2[_0xacbf('0x45')]['id']}})[_0xacbf('0x29')](handleEntityNotFound(_0x2c495e,null))[_0xacbf('0x29')](function(_0x2a0e72){if(_0x2a0e72){_0x2a3db2[_0xacbf('0x55')]['DashboardId']=_0x2a0e72['id'];_0x2a3db2[_0xacbf('0x55')][_0xacbf('0x5b')]=widgetAttributes(_0x2a3db2[_0xacbf('0x55')]);return db['DashboardItem'][_0xacbf('0x4a')](_0x2a3db2[_0xacbf('0x55')]);}})[_0xacbf('0x29')](respondWithResult(_0x2c495e,null))[_0xacbf('0x44')](handleError(_0x2c495e,null));};exports[_0xacbf('0x72')]=function(_0x4f7915,_0x16137a,_0x2ee6fe){var _0x216ced={};var _0xfa5833={};var _0x2eefb9;var _0x30991d;return db[_0xacbf('0x30')][_0xacbf('0x73')]({'where':{'id':_0x4f7915[_0xacbf('0x45')]['id']}})[_0xacbf('0x29')](handleEntityNotFound(_0x16137a,null))[_0xacbf('0x29')](function(_0x2c794c){if(_0x2c794c){_0x2eefb9=_0x2c794c;_0xfa5833[_0xacbf('0x33')]=_[_0xacbf('0x35')](db[_0xacbf('0x74')][_0xacbf('0x46')]);_0xfa5833['query']=_['keys'](_0x4f7915[_0xacbf('0x34')]);_0xfa5833[_0xacbf('0x36')]=_[_0xacbf('0x37')](_0xfa5833[_0xacbf('0x33')],_0xfa5833[_0xacbf('0x34')]);_0x216ced[_0xacbf('0x38')]=_[_0xacbf('0x37')](_0xfa5833['model'],qs['fields'](_0x4f7915[_0xacbf('0x34')][_0xacbf('0x39')]));_0x216ced[_0xacbf('0x38')]=_0x216ced['attributes'][_0xacbf('0x3a')]?_0x216ced[_0xacbf('0x38')]:_0xfa5833[_0xacbf('0x33')];_0x216ced[_0xacbf('0x3c')]=qs['sort'](_0x4f7915[_0xacbf('0x34')]['sort']);_0x216ced[_0xacbf('0x75')]=qs[_0xacbf('0x36')](_['pick'](_0x4f7915[_0xacbf('0x34')],_0xfa5833[_0xacbf('0x36')]));if(_0x4f7915[_0xacbf('0x34')][_0xacbf('0x3f')]){_0x216ced[_0xacbf('0x75')]=_['merge'](_0x216ced['where'],{'$or':_[_0xacbf('0x2f')](_0x216ced[_0xacbf('0x38')],function(_0x3715ca){var _0x591722={};_0x591722[_0x3715ca]={'$like':'%'+_0x4f7915[_0xacbf('0x34')][_0xacbf('0x3f')]+'%'};return _0x591722;})});}_0x216ced=_[_0xacbf('0x40')]({},_0x216ced,_0x4f7915[_0xacbf('0x48')]);return _0x2eefb9[_0xacbf('0x72')](_0x216ced);}})['then'](function(_0x5824fa){if(_0x5824fa){_0x30991d=_0x5824fa[_0xacbf('0x3a')];if(!_0x4f7915['query'][_0xacbf('0x76')](_0xacbf('0x3b'))){_0x216ced['limit']=qs['limit'](_0x4f7915[_0xacbf('0x34')]['limit']);_0x216ced[_0xacbf('0x21')]=qs['offset'](_0x4f7915[_0xacbf('0x34')][_0xacbf('0x21')]);}return _0x2eefb9[_0xacbf('0x72')](_0x216ced);}})['then'](function(_0x2ca61e){if(_0x2ca61e){return _0x2ca61e?{'count':_0x30991d,'rows':_0x2ca61e}:null;}})[_0xacbf('0x29')](respondWithResult(_0x16137a,null))[_0xacbf('0x44')](handleError(_0x16137a,null));}; \ No newline at end of file +var _0x5bf3=['clone','params','rawAttributes','omit','updatedAt','body','createdAt','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll','rows','catch','show','keys','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1ed38d,_0x5cb0bd){var _0x13be3f=function(_0x1ff1e9){while(--_0x1ff1e9){_0x1ed38d['push'](_0x1ed38d['shift']());}};_0x13be3f(++_0x5cb0bd);}(_0x5bf3,0x1a4));var _0x35bf=function(_0x22b6dc,_0x4aa47f){_0x22b6dc=_0x22b6dc-0x0;var _0x28352c=_0x5bf3[_0x22b6dc];return _0x28352c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35bf('0x0'));var zipdir=require(_0x35bf('0x1'));var jsonpatch=require(_0x35bf('0x2'));var rp=require(_0x35bf('0x3'));var moment=require(_0x35bf('0x4'));var BPromise=require(_0x35bf('0x5'));var Mustache=require(_0x35bf('0x6'));var util=require(_0x35bf('0x7'));var path=require(_0x35bf('0x8'));var sox=require(_0x35bf('0x9'));var csv=require(_0x35bf('0xa'));var ejs=require(_0x35bf('0xb'));var fs=require('fs');var fs_extra=require(_0x35bf('0xc'));var _=require(_0x35bf('0xd'));var squel=require('squel');var crypto=require(_0x35bf('0xe'));var jsforce=require(_0x35bf('0xf'));var deskjs=require(_0x35bf('0x10'));var toCsv=require(_0x35bf('0xa'));var querystring=require(_0x35bf('0x11'));var Papa=require('papaparse');var Redis=require(_0x35bf('0x12'));var authService=require(_0x35bf('0x13'));var qs=require(_0x35bf('0x14'));var as=require(_0x35bf('0x15'));var hardwareService=require(_0x35bf('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x35bf('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x35bf('0x18')]=_[_0x35bf('0x19')](config[_0x35bf('0x18')],{'host':_0x35bf('0x1a'),'port':0x18eb});var socket=require(_0x35bf('0x1b'))(new Redis(config[_0x35bf('0x18')]));require(_0x35bf('0x1c'))[_0x35bf('0x1d')](socket);function respondWithStatusCode(_0x948f52,_0x385119){_0x385119=_0x385119||0xcc;return function(_0x5e8597){if(_0x5e8597){return _0x948f52[_0x35bf('0x1e')](_0x385119);}return _0x948f52[_0x35bf('0x1f')](_0x385119)[_0x35bf('0x20')]();};}function respondWithResult(_0xdbcfb8,_0xa2d78f){_0xa2d78f=_0xa2d78f||0xc8;return function(_0x3cb808){if(_0x3cb808){return _0xdbcfb8[_0x35bf('0x1f')](_0xa2d78f)['json'](_0x3cb808);}};}function respondWithFilteredResult(_0x108038,_0x5e3371){return function(_0x47008c){if(_0x47008c){var _0x39ff5e=typeof _0x5e3371[_0x35bf('0x21')]==='undefined'&&typeof _0x5e3371[_0x35bf('0x22')]===_0x35bf('0x23');var _0xf42150=_0x47008c[_0x35bf('0x24')];var _0x38f524=_0x39ff5e?0x0:_0x5e3371[_0x35bf('0x21')];var _0x180b88=_0x39ff5e?_0x47008c['count']:_0x5e3371[_0x35bf('0x21')]+_0x5e3371['limit'];var _0xad61f2;if(_0x180b88>=_0xf42150){_0x180b88=_0xf42150;_0xad61f2=0xc8;}else{_0xad61f2=0xce;}_0x108038[_0x35bf('0x1f')](_0xad61f2);return _0x108038[_0x35bf('0x25')](_0x35bf('0x26'),_0x38f524+'-'+_0x180b88+'/'+_0xf42150)['json'](_0x47008c);}return null;};}function patchUpdates(_0x42081b){return function(_0x4d0b4b){try{jsonpatch[_0x35bf('0x27')](_0x4d0b4b,_0x42081b,!![]);}catch(_0x35dd56){return BPromise[_0x35bf('0x28')](_0x35dd56);}return _0x4d0b4b[_0x35bf('0x29')]();};}function saveUpdates(_0x2b9ccd,_0x40acf1){return function(_0x313e8e){if(_0x313e8e){return _0x313e8e[_0x35bf('0x2a')](_0x2b9ccd)[_0x35bf('0x2b')](function(_0x23deaa){return _0x23deaa;});}return null;};}function removeEntity(_0x5c7c52,_0x2317dd){return function(_0x37e2d3){if(_0x37e2d3){return _0x37e2d3[_0x35bf('0x2c')]()[_0x35bf('0x2b')](function(){var _0x484bbd=_0x37e2d3[_0x35bf('0x2d')]({'plain':!![]});var _0x5e117b=_0x35bf('0x2e');return db[_0x35bf('0x2f')][_0x35bf('0x2c')]({'where':{'type':_0x5e117b,'resourceId':_0x484bbd['id']}})[_0x35bf('0x2b')](function(){return _0x37e2d3;});})['then'](function(){_0x5c7c52[_0x35bf('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x142e06,_0x571035){return function(_0x493c1f){if(!_0x493c1f){_0x142e06['sendStatus'](0x194);}return _0x493c1f;};}function handleError(_0x214359,_0x2def32){_0x2def32=_0x2def32||0x1f4;return function(_0x5c81a8){logger[_0x35bf('0x30')](_0x5c81a8[_0x35bf('0x31')]);if(_0x5c81a8[_0x35bf('0x32')]){delete _0x5c81a8['name'];}_0x214359[_0x35bf('0x1f')](_0x2def32)['send'](_0x5c81a8);};}exports[_0x35bf('0x33')]=function(_0xa8304b,_0x4a9f34){var _0x59a895={},_0x246cb6={},_0x56aadb={'count':0x0,'rows':[]};var _0x672fcc=_[_0x35bf('0x34')](db[_0x35bf('0x35')]['rawAttributes'],function(_0x2c1e5d){return{'name':_0x2c1e5d[_0x35bf('0x36')],'type':_0x2c1e5d[_0x35bf('0x37')][_0x35bf('0x38')]};});_0x246cb6[_0x35bf('0x39')]=_[_0x35bf('0x34')](_0x672fcc,_0x35bf('0x32'));_0x246cb6[_0x35bf('0x3a')]=_['keys'](_0xa8304b[_0x35bf('0x3a')]);_0x246cb6[_0x35bf('0x3b')]=_[_0x35bf('0x3c')](_0x246cb6[_0x35bf('0x39')],_0x246cb6['query']);_0x59a895['attributes']=_[_0x35bf('0x3c')](_0x246cb6[_0x35bf('0x39')],qs[_0x35bf('0x3d')](_0xa8304b[_0x35bf('0x3a')]['fields']));_0x59a895[_0x35bf('0x3e')]=_0x59a895[_0x35bf('0x3e')][_0x35bf('0x3f')]?_0x59a895[_0x35bf('0x3e')]:_0x246cb6['model'];if(!_0xa8304b[_0x35bf('0x3a')]['hasOwnProperty'](_0x35bf('0x40'))){_0x59a895[_0x35bf('0x22')]=qs[_0x35bf('0x22')](_0xa8304b[_0x35bf('0x3a')][_0x35bf('0x22')]);_0x59a895[_0x35bf('0x21')]=qs[_0x35bf('0x21')](_0xa8304b[_0x35bf('0x3a')][_0x35bf('0x21')]);}_0x59a895[_0x35bf('0x41')]=qs[_0x35bf('0x42')](_0xa8304b[_0x35bf('0x3a')][_0x35bf('0x42')]);_0x59a895['where']=qs[_0x35bf('0x3b')](_[_0x35bf('0x43')](_0xa8304b['query'],_0x246cb6[_0x35bf('0x3b')]),_0x672fcc);if(_0xa8304b[_0x35bf('0x3a')][_0x35bf('0x44')]){_0x59a895['where']=_[_0x35bf('0x45')](_0x59a895[_0x35bf('0x46')],{'$or':_[_0x35bf('0x34')](_0x672fcc,function(_0x2a9d4d){if(_0x2a9d4d['type']!==_0x35bf('0x47')){var _0x325799={};_0x325799[_0x2a9d4d[_0x35bf('0x32')]]={'$like':'%'+_0xa8304b[_0x35bf('0x3a')][_0x35bf('0x44')]+'%'};return _0x325799;}})});}_0x59a895=_[_0x35bf('0x45')]({},_0x59a895,_0xa8304b[_0x35bf('0x48')]);var _0x1dae23={'where':_0x59a895[_0x35bf('0x46')]};return db['Dashboard']['count'](_0x1dae23)[_0x35bf('0x2b')](function(_0x206037){_0x56aadb['count']=_0x206037;if(_0xa8304b['query']['includeAll']){_0x59a895['include']=[{'all':!![]}];}return db[_0x35bf('0x35')][_0x35bf('0x49')](_0x59a895);})[_0x35bf('0x2b')](function(_0x20d1e2){_0x56aadb[_0x35bf('0x4a')]=_0x20d1e2;return _0x56aadb;})[_0x35bf('0x2b')](respondWithFilteredResult(_0x4a9f34,_0x59a895))[_0x35bf('0x4b')](handleError(_0x4a9f34,null));};exports[_0x35bf('0x4c')]=function(_0x245f40,_0x17e00f){var _0x25fb52={'raw':![],'where':{'id':_0x245f40['params']['id']}},_0x7067cb={};_0x7067cb[_0x35bf('0x39')]=_['keys'](db[_0x35bf('0x35')]['rawAttributes']);_0x7067cb['query']=_[_0x35bf('0x4d')](_0x245f40['query']);_0x7067cb[_0x35bf('0x3b')]=_[_0x35bf('0x3c')](_0x7067cb[_0x35bf('0x39')],_0x7067cb[_0x35bf('0x3a')]);_0x25fb52[_0x35bf('0x3e')]=_[_0x35bf('0x3c')](_0x7067cb['model'],qs[_0x35bf('0x3d')](_0x245f40[_0x35bf('0x3a')][_0x35bf('0x3d')]));_0x25fb52[_0x35bf('0x3e')]=_0x25fb52['attributes'][_0x35bf('0x3f')]?_0x25fb52[_0x35bf('0x3e')]:_0x7067cb['model'];if(_0x245f40['query'][_0x35bf('0x4e')]){_0x25fb52[_0x35bf('0x4f')]=[{'all':!![]}];}_0x25fb52=_[_0x35bf('0x45')]({},_0x25fb52,_0x245f40[_0x35bf('0x48')]);return db['Dashboard'][_0x35bf('0x50')](_0x25fb52)['then'](handleEntityNotFound(_0x17e00f,null))[_0x35bf('0x2b')](respondWithResult(_0x17e00f,null))[_0x35bf('0x4b')](handleError(_0x17e00f,null));};exports[_0x35bf('0x51')]=function(_0x25289a,_0x1daa24){return db[_0x35bf('0x35')][_0x35bf('0x51')](_0x25289a['body'],{})[_0x35bf('0x2b')](function(_0x4fe17b){var _0x1309b7=_0x25289a[_0x35bf('0x52')]['get']({'plain':!![]});if(!_0x1309b7)throw new Error(_0x35bf('0x53'));if(_0x1309b7[_0x35bf('0x54')]===_0x35bf('0x52')){var _0x1a6a0c=_0x4fe17b[_0x35bf('0x2d')]({'plain':!![]});var _0x515313=_0x35bf('0x2e');return db[_0x35bf('0x55')][_0x35bf('0x50')]({'where':{'name':_0x515313,'userProfileId':_0x1309b7['userProfileId']},'raw':!![]})[_0x35bf('0x2b')](function(_0x58dadc){if(_0x58dadc&&_0x58dadc[_0x35bf('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x1a6a0c[_0x35bf('0x32')],'resourceId':_0x1a6a0c['id'],'type':_0x58dadc[_0x35bf('0x32')],'sectionId':_0x58dadc['id']},{})['then'](function(){return _0x4fe17b;});}else{return _0x4fe17b;}})[_0x35bf('0x4b')](function(_0x236c97){logger[_0x35bf('0x30')](_0x35bf('0x57'),_0x236c97);throw _0x236c97;});}return _0x4fe17b;})[_0x35bf('0x2b')](respondWithResult(_0x1daa24,0xc9))[_0x35bf('0x4b')](handleError(_0x1daa24,null));};exports[_0x35bf('0x58')]=function(_0xf661a0,_0x41938c){var _0x11872b={'where':{'id':_0xf661a0[_0x35bf('0x59')]['id']}},_0x1f2f4d={};_0x1f2f4d['model']=_[_0x35bf('0x4d')](db['Dashboard'][_0x35bf('0x5a')]);_0x11872b[_0x35bf('0x3e')]=_[_0x35bf('0x3c')](_0x1f2f4d['model'],qs[_0x35bf('0x3d')](_0xf661a0[_0x35bf('0x3a')][_0x35bf('0x3d')]));_0x11872b['attributes']=_0x11872b['attributes']['length']?_0x11872b['attributes']:_0x1f2f4d['model'];if(_0xf661a0[_0x35bf('0x3a')][_0x35bf('0x4e')]){_0x11872b['include']=[{'all':!![]}];}_0x11872b=_[_0x35bf('0x45')]({},_0x11872b,_0xf661a0['options']);return db[_0x35bf('0x35')][_0x35bf('0x50')](_0x11872b)[_0x35bf('0x2b')](handleEntityNotFound(_0x41938c,null))['then'](function(_0x1c6c98){if(_0x1c6c98){var _0x5e260f=_0x1c6c98[_0x35bf('0x2d')]({'plain':!![]});_0x5e260f=qs[_0x35bf('0x5b')](_0x5e260f,['id','createdAt',_0x35bf('0x5c')]);_0xf661a0[_0x35bf('0x5d')]=_[_0x35bf('0x5b')](_0xf661a0['body'],['id',_0x35bf('0x5e'),_0x35bf('0x5c')]);return db[_0x35bf('0x35')][_0x35bf('0x51')](_[_0x35bf('0x45')](_0x5e260f,_0xf661a0[_0x35bf('0x5d')]),{'include':_0xf661a0['query'][_0x35bf('0x4e')]?[{'all':!![]}]:undefined})[_0x35bf('0x2b')](function(_0x57970d){var _0x43c135=_0xf661a0[_0x35bf('0x52')][_0x35bf('0x2d')]({'plain':!![]});if(!_0x43c135)throw new Error(_0x35bf('0x53'));if(_0x43c135[_0x35bf('0x54')]===_0x35bf('0x52')){var _0xaceb7f=_0x57970d['get']({'plain':!![]});var _0x4c4bd7=_0x35bf('0x2e');return db[_0x35bf('0x55')]['find']({'where':{'name':_0x4c4bd7,'userProfileId':_0x43c135[_0x35bf('0x5f')]},'raw':!![]})[_0x35bf('0x2b')](function(_0x4aa908){if(_0x4aa908&&_0x4aa908[_0x35bf('0x56')]===0x0){return db['UserProfileResource'][_0x35bf('0x51')]({'name':_0xaceb7f[_0x35bf('0x32')],'resourceId':_0xaceb7f['id'],'type':_0x4aa908['name'],'sectionId':_0x4aa908['id']},{})['then'](function(){return _0x57970d;});}else{return _0x57970d;}})[_0x35bf('0x4b')](function(_0x1b447c){logger[_0x35bf('0x30')](_0x35bf('0x57'),_0x1b447c);throw _0x1b447c;});}return _0x57970d;});}})[_0x35bf('0x2b')](respondWithResult(_0x41938c,0xc9))[_0x35bf('0x4b')](handleError(_0x41938c,null));};exports[_0x35bf('0x2a')]=function(_0x2bf623,_0x3a23cc){if(_0x2bf623['body']['id']){delete _0x2bf623[_0x35bf('0x5d')]['id'];}return db[_0x35bf('0x35')]['find']({'where':{'id':_0x2bf623[_0x35bf('0x59')]['id']}})[_0x35bf('0x2b')](handleEntityNotFound(_0x3a23cc,null))[_0x35bf('0x2b')](saveUpdates(_0x2bf623[_0x35bf('0x5d')],null))[_0x35bf('0x2b')](respondWithResult(_0x3a23cc,null))[_0x35bf('0x4b')](handleError(_0x3a23cc,null));};exports[_0x35bf('0x2c')]=function(_0x40ca5d,_0xbc79fc){return db[_0x35bf('0x35')][_0x35bf('0x50')]({'where':{'id':_0x40ca5d[_0x35bf('0x59')]['id']}})['then'](handleEntityNotFound(_0xbc79fc,null))['then'](removeEntity(_0xbc79fc,null))[_0x35bf('0x4b')](handleError(_0xbc79fc,null));};function widgetAttributes(_0x49900d){try{switch(_0x49900d[_0x35bf('0x37')]){case _0x35bf('0x60'):return[{'name':_0x35bf('0x61'),'value':_0x49900d[_0x35bf('0x61')]||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x0]?_0x49900d[_0x35bf('0x62')][0x0][_0x35bf('0x63')]:undefined)||_0x35bf('0x64')}];case _0x35bf('0x65'):return[{'name':_0x35bf('0x66'),'value':_0x49900d[_0x35bf('0x66')]||(_0x49900d['attrs']&&_0x49900d[_0x35bf('0x62')][0x0]?_0x49900d[_0x35bf('0x62')][0x0]['value']:undefined)||''}];case _0x35bf('0x67'):return[{'name':_0x35bf('0x68'),'value':_0x49900d[_0x35bf('0x68')]||(_0x49900d['attrs']&&_0x49900d[_0x35bf('0x62')][0x0]?_0x49900d[_0x35bf('0x62')][0x0][_0x35bf('0x63')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x49900d[_0x35bf('0x69')]||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x1]?_0x49900d['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0x35bf('0x6a'),'value':_0x49900d['attrFontSize']||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x2]?_0x49900d['attrs'][0x2][_0x35bf('0x63')]:undefined)||0xc}];case _0x35bf('0x6b'):return[{'name':_0x35bf('0x6c'),'value':_0x49900d[_0x35bf('0x6c')]||(_0x49900d[_0x35bf('0x62')]&&_0x49900d['attrs'][0x0]?_0x49900d['attrs'][0x0][_0x35bf('0x63')]:undefined)||_0x35bf('0x6d')},{'name':_0x35bf('0x6e'),'value':_0x49900d['attrVoiceQueues']||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x1]?_0x49900d[_0x35bf('0x62')][0x1][_0x35bf('0x63')]:undefined)||[]},{'name':_0x35bf('0x6a'),'value':_0x49900d['attrFontSize']||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x2]?_0x49900d[_0x35bf('0x62')][0x2][_0x35bf('0x63')]:undefined)||0x14}];case _0x35bf('0x6f'):case _0x35bf('0x70'):return[{'name':_0x35bf('0x71'),'value':_0x49900d[_0x35bf('0x71')]||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x0]?_0x49900d[_0x35bf('0x62')][0x0]['value']:undefined)||_0x35bf('0x6d')},{'name':_0x35bf('0x72'),'value':_0x49900d[_0x35bf('0x72')]||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x1]?_0x49900d[_0x35bf('0x62')][0x1][_0x35bf('0x63')]:undefined)||null},{'name':_0x35bf('0x73'),'value':_0x49900d['attrSerie3']||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x2]?_0x49900d[_0x35bf('0x62')][0x2][_0x35bf('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x49900d[_0x35bf('0x6e')]||(_0x49900d['attrs']&&_0x49900d[_0x35bf('0x62')][0x3]?_0x49900d[_0x35bf('0x62')][0x3][_0x35bf('0x63')]:undefined)||[]}];case'web-report':return[{'name':_0x35bf('0x74'),'type':_0x49900d[_0x35bf('0x75')]||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x0]?_0x49900d[_0x35bf('0x62')][0x0][_0x35bf('0x37')]:undefined)||null,'value':_0x49900d[_0x35bf('0x74')]||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x0]?_0x49900d[_0x35bf('0x62')][0x0][_0x35bf('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x49900d[_0x35bf('0x76')]||(_0x49900d[_0x35bf('0x62')]&&_0x49900d[_0x35bf('0x62')][0x1]?_0x49900d[_0x35bf('0x62')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2e961f){logger['error'](_0x35bf('0x77'),JSON[_0x35bf('0x78')](_0x2e961f));return[];}}exports[_0x35bf('0x79')]=function(_0x13834e,_0x5aac01,_0x5e651e){if(_0x13834e[_0x35bf('0x5d')]['id']){delete _0x13834e['body']['id'];}return db[_0x35bf('0x35')][_0x35bf('0x50')]({'where':{'id':_0x13834e[_0x35bf('0x59')]['id']}})[_0x35bf('0x2b')](handleEntityNotFound(_0x5aac01,null))[_0x35bf('0x2b')](function(_0x5859de){if(_0x5859de){_0x13834e['body'][_0x35bf('0x7a')]=_0x5859de['id'];_0x13834e[_0x35bf('0x5d')][_0x35bf('0x62')]=widgetAttributes(_0x13834e['body']);return db[_0x35bf('0x7b')][_0x35bf('0x51')](_0x13834e[_0x35bf('0x5d')]);}})[_0x35bf('0x2b')](respondWithResult(_0x5aac01,null))[_0x35bf('0x4b')](handleError(_0x5aac01,null));};exports[_0x35bf('0x7c')]=function(_0x84b627,_0x26d0a1,_0x5660aa){var _0x1cb101={};var _0x17c2a4={};var _0x1db4d3;var _0x21fc5e;return db[_0x35bf('0x35')][_0x35bf('0x7d')]({'where':{'id':_0x84b627[_0x35bf('0x59')]['id']}})[_0x35bf('0x2b')](handleEntityNotFound(_0x26d0a1,null))[_0x35bf('0x2b')](function(_0x5f2c9f){if(_0x5f2c9f){_0x1db4d3=_0x5f2c9f;_0x17c2a4[_0x35bf('0x39')]=_[_0x35bf('0x4d')](db[_0x35bf('0x7b')][_0x35bf('0x5a')]);_0x17c2a4[_0x35bf('0x3a')]=_['keys'](_0x84b627[_0x35bf('0x3a')]);_0x17c2a4[_0x35bf('0x3b')]=_[_0x35bf('0x3c')](_0x17c2a4[_0x35bf('0x39')],_0x17c2a4['query']);_0x1cb101[_0x35bf('0x3e')]=_[_0x35bf('0x3c')](_0x17c2a4[_0x35bf('0x39')],qs['fields'](_0x84b627['query'][_0x35bf('0x3d')]));_0x1cb101['attributes']=_0x1cb101[_0x35bf('0x3e')][_0x35bf('0x3f')]?_0x1cb101['attributes']:_0x17c2a4['model'];_0x1cb101[_0x35bf('0x41')]=qs[_0x35bf('0x42')](_0x84b627[_0x35bf('0x3a')]['sort']);_0x1cb101[_0x35bf('0x46')]=qs[_0x35bf('0x3b')](_[_0x35bf('0x43')](_0x84b627['query'],_0x17c2a4['filters']));if(_0x84b627['query']['filter']){_0x1cb101[_0x35bf('0x46')]=_[_0x35bf('0x45')](_0x1cb101[_0x35bf('0x46')],{'$or':_[_0x35bf('0x34')](_0x1cb101['attributes'],function(_0x213640){var _0x5d068e={};_0x5d068e[_0x213640]={'$like':'%'+_0x84b627[_0x35bf('0x3a')][_0x35bf('0x44')]+'%'};return _0x5d068e;})});}_0x1cb101=_['merge']({},_0x1cb101,_0x84b627[_0x35bf('0x48')]);return _0x1db4d3[_0x35bf('0x7c')](_0x1cb101);}})[_0x35bf('0x2b')](function(_0x3175e3){if(_0x3175e3){_0x21fc5e=_0x3175e3[_0x35bf('0x3f')];if(!_0x84b627[_0x35bf('0x3a')][_0x35bf('0x7e')](_0x35bf('0x40'))){_0x1cb101['limit']=qs[_0x35bf('0x22')](_0x84b627['query']['limit']);_0x1cb101[_0x35bf('0x21')]=qs[_0x35bf('0x21')](_0x84b627[_0x35bf('0x3a')][_0x35bf('0x21')]);}return _0x1db4d3[_0x35bf('0x7c')](_0x1cb101);}})['then'](function(_0x354b32){if(_0x354b32){return _0x354b32?{'count':_0x21fc5e,'rows':_0x354b32}:null;}})[_0x35bf('0x2b')](respondWithResult(_0x26d0a1,null))[_0x35bf('0x4b')](handleError(_0x26d0a1,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index aaf8406..6b15675 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 _0x157f=['emit','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x53bec2,_0x2c8db1){var _0x418497=function(_0x208c89){while(--_0x208c89){_0x53bec2['push'](_0x53bec2['shift']());}};_0x418497(++_0x2c8db1);}(_0x157f,0xd2));var _0xf157=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x157f[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0xf157('0x0'));var Dashboard=require(_0xf157('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf157('0x2')](0x0);var events={'afterCreate':_0xf157('0x3'),'afterUpdate':_0xf157('0x4'),'afterDestroy':_0xf157('0x5')};function emitEvent(_0x19d725){return function(_0x6920cf,_0x34a187,_0x248c09){DashboardEvents[_0xf157('0x6')](_0x19d725+':'+_0x6920cf['id'],_0x6920cf);DashboardEvents[_0xf157('0x6')](_0x19d725,_0x6920cf);_0x248c09(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xf157('0x7')]=DashboardEvents; \ No newline at end of file +var _0x1fb5=['hasOwnProperty','hook','exports','../../mysqldb','Dashboard','save','update','remove','emit'];(function(_0x36e8ef,_0x22c15a){var _0x489d41=function(_0x34a7af){while(--_0x34a7af){_0x36e8ef['push'](_0x36e8ef['shift']());}};_0x489d41(++_0x22c15a);}(_0x1fb5,0xae));var _0x51fb=function(_0x5cde3c,_0x598b96){_0x5cde3c=_0x5cde3c-0x0;var _0x176e94=_0x1fb5[_0x5cde3c];return _0x176e94;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x51fb('0x0'))['db'][_0x51fb('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x51fb('0x2'),'afterUpdate':_0x51fb('0x3'),'afterDestroy':_0x51fb('0x4')};function emitEvent(_0x45d565){return function(_0x4a8aa5,_0x59d8d9,_0x494a69){DashboardEvents[_0x51fb('0x5')](_0x45d565+':'+_0x4a8aa5['id'],_0x4a8aa5);DashboardEvents[_0x51fb('0x5')](_0x45d565,_0x4a8aa5);_0x494a69(null);};}for(var e in events){if(events[_0x51fb('0x6')](e)){var event=events[e];Dashboard[_0x51fb('0x7')](e,emitEvent(event));}}module[_0x51fb('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index d4a4284..1b9601e 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 _0x240e=['util','api','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards'];(function(_0x1a5179,_0x59a00e){var _0x14bfcd=function(_0x91c357){while(--_0x91c357){_0x1a5179['push'](_0x1a5179['shift']());}};_0x14bfcd(++_0x59a00e);}(_0x240e,0x96));var _0xe240=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x240e[_0xa6cc5c];return _0x44803d;};'use strict';var _=require('lodash');var util=require(_0xe240('0x0'));var logger=require('../../config/logger')(_0xe240('0x1'));var moment=require('moment');var BPromise=require(_0xe240('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe240('0x3'));var rimraf=require(_0xe240('0x4'));var config=require(_0xe240('0x5'));var attributes=require(_0xe240('0x6'));module[_0xe240('0x7')]=function(_0x1f310b,_0x1ba5cf){return _0x1f310b['define'](_0xe240('0x8'),attributes,{'tableName':_0xe240('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0af9=['../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1238e0,_0x16bd9b){var _0x59dfc8=function(_0x3cd547){while(--_0x3cd547){_0x1238e0['push'](_0x1238e0['shift']());}};_0x59dfc8(++_0x16bd9b);}(_0x0af9,0xb9));var _0x90af=function(_0x57493a,_0x5dff7d){_0x57493a=_0x57493a-0x0;var _0x3680c6=_0x0af9[_0x57493a];return _0x3680c6;};'use strict';var _=require(_0x90af('0x0'));var util=require(_0x90af('0x1'));var logger=require(_0x90af('0x2'))(_0x90af('0x3'));var moment=require('moment');var BPromise=require(_0x90af('0x4'));var rp=require(_0x90af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90af('0x6'));var config=require(_0x90af('0x7'));var attributes=require(_0x90af('0x8'));module[_0x90af('0x9')]=function(_0x2ddc2a,_0x29a4c7){return _0x2ddc2a[_0x90af('0xa')](_0x90af('0xb'),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 ccc280e..0e4ce33 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 _0x2064=['redis','defaults','localhost','socket.io-emitter','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x29342d,_0x4a4720){var _0x2b0bea=function(_0x16383c){while(--_0x16383c){_0x29342d['push'](_0x29342d['shift']());}};_0x2b0bea(++_0x4a4720);}(_0x2064,0x7b));var _0x4206=function(_0x99e075,_0x211213){_0x99e075=_0x99e075-0x0;var _0x1a81ba=_0x2064[_0x99e075];return _0x1a81ba;};'use strict';var _=require(_0x4206('0x0'));var util=require(_0x4206('0x1'));var moment=require(_0x4206('0x2'));var BPromise=require(_0x4206('0x3'));var rs=require(_0x4206('0x4'));var fs=require('fs');var Redis=require(_0x4206('0x5'));var db=require(_0x4206('0x6'))['db'];var utils=require(_0x4206('0x7'));var logger=require(_0x4206('0x8'))(_0x4206('0x9'));var config=require('../../config/environment');var jayson=require(_0x4206('0xa'));var client=jayson[_0x4206('0xb')]['http']({'port':0x232a});config[_0x4206('0xc')]=_[_0x4206('0xd')](config['redis'],{'host':_0x4206('0xe'),'port':0x18eb});var socket=require(_0x4206('0xf'))(new Redis(config[_0x4206('0xc')]));require('./dashboard.socket')[_0x4206('0x10')](socket);function respondWithRpcPromise(_0xdf798e,_0x334015,_0x3875a8){return new BPromise(function(_0xc30a1a,_0xc7096d){return client[_0x4206('0x11')](_0xdf798e,_0x3875a8)[_0x4206('0x12')](function(_0x45f5fa){logger['info'](_0x4206('0x13'),_0x334015,_0x4206('0x14'));logger[_0x4206('0x15')](_0x4206('0x16'),_0x334015,_0x4206('0x14'),JSON['stringify'](_0x45f5fa));if(_0x45f5fa['error']){if(_0x45f5fa[_0x4206('0x17')][_0x4206('0x18')]===0x1f4){logger[_0x4206('0x17')]('Dashboard,\x20%s,\x20%s',_0x334015,_0x45f5fa[_0x4206('0x17')][_0x4206('0x19')]);return _0xc7096d(_0x45f5fa[_0x4206('0x17')][_0x4206('0x19')]);}logger[_0x4206('0x17')]('Dashboard,\x20%s,\x20%s',_0x334015,_0x45f5fa[_0x4206('0x17')][_0x4206('0x19')]);return _0xc30a1a(_0x45f5fa['error'][_0x4206('0x19')]);}else{logger[_0x4206('0x1a')](_0x4206('0x13'),_0x334015,_0x4206('0x14'));_0xc30a1a(_0x45f5fa['result']['message']);}})['catch'](function(_0x4d0c48){logger[_0x4206('0x17')](_0x4206('0x13'),_0x334015,_0x4d0c48);_0xc7096d(_0x4d0c48);});});} \ No newline at end of file +var _0x13a9=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x13a9,0x16f));var _0x913a=function(_0x2c7b80,_0x51b7ea){_0x2c7b80=_0x2c7b80-0x0;var _0x271ea5=_0x13a9[_0x2c7b80];return _0x271ea5;};'use strict';var _=require(_0x913a('0x0'));var util=require(_0x913a('0x1'));var moment=require(_0x913a('0x2'));var BPromise=require(_0x913a('0x3'));var rs=require(_0x913a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x913a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x913a('0x6'))(_0x913a('0x7'));var config=require(_0x913a('0x8'));var jayson=require(_0x913a('0x9'));var client=jayson[_0x913a('0xa')]['http']({'port':0x232a});config[_0x913a('0xb')]=_['defaults'](config[_0x913a('0xb')],{'host':_0x913a('0xc'),'port':0x18eb});var socket=require(_0x913a('0xd'))(new Redis(config[_0x913a('0xb')]));require(_0x913a('0xe'))[_0x913a('0xf')](socket);function respondWithRpcPromise(_0x39e205,_0x5585df,_0x53da5c){return new BPromise(function(_0x17f5d4,_0x1a9017){return client['request'](_0x39e205,_0x53da5c)[_0x913a('0x10')](function(_0x20fdb4){logger[_0x913a('0x11')](_0x913a('0x12'),_0x5585df,'request\x20sent');logger[_0x913a('0x13')](_0x913a('0x14'),_0x5585df,'request\x20sent',JSON['stringify'](_0x20fdb4));if(_0x20fdb4[_0x913a('0x15')]){if(_0x20fdb4[_0x913a('0x15')][_0x913a('0x16')]===0x1f4){logger[_0x913a('0x15')]('Dashboard,\x20%s,\x20%s',_0x5585df,_0x20fdb4[_0x913a('0x15')][_0x913a('0x17')]);return _0x1a9017(_0x20fdb4[_0x913a('0x15')]['message']);}logger[_0x913a('0x15')](_0x913a('0x12'),_0x5585df,_0x20fdb4[_0x913a('0x15')][_0x913a('0x17')]);return _0x17f5d4(_0x20fdb4[_0x913a('0x15')]['message']);}else{logger[_0x913a('0x11')]('Dashboard,\x20%s,\x20%s',_0x5585df,'request\x20sent');_0x17f5d4(_0x20fdb4[_0x913a('0x18')][_0x913a('0x17')]);}})[_0x913a('0x19')](function(_0x5b6baa){logger['error'](_0x913a('0x12'),_0x5585df,_0x5b6baa);_0x1a9017(_0x5b6baa);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3e86958..fe496ab 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 _0x4dfe=['emit','removeListener','register','length','dashboard:','update'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x4dfe,0x15b));var _0xe4df=function(_0x2d81de,_0x119dea){_0x2d81de=_0x2d81de-0x0;var _0x114c59=_0x4dfe[_0x2d81de];return _0x114c59;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save','remove',_0xe4df('0x0')];function createListener(_0x1970d1,_0x24bdfe){return function(_0x5a7880){_0x24bdfe[_0xe4df('0x1')](_0x1970d1,_0x5a7880);};}function removeListener(_0x1520a0,_0x4b7cae){return function(){DashboardEvents[_0xe4df('0x2')](_0x1520a0,_0x4b7cae);};}exports[_0xe4df('0x3')]=function(_0x4e79ba){for(var _0x4d85ca=0x0,_0x3edcc8=events[_0xe4df('0x4')];_0x4d85ca<_0x3edcc8;_0x4d85ca++){var _0x332694=events[_0x4d85ca];var _0x51edf4=createListener(_0xe4df('0x5')+_0x332694,_0x4e79ba);DashboardEvents['on'](_0x332694,_0x51edf4);}}; \ No newline at end of file +var _0xb084=['save','remove','emit','removeListener','register','dashboard:','./dashboard.events'];(function(_0x530d97,_0x475b80){var _0x3cc712=function(_0x3c1cfa){while(--_0x3c1cfa){_0x530d97['push'](_0x530d97['shift']());}};_0x3cc712(++_0x475b80);}(_0xb084,0x110));var _0x4b08=function(_0x2a1dcf,_0x162d65){_0x2a1dcf=_0x2a1dcf-0x0;var _0x36fa40=_0xb084[_0x2a1dcf];return _0x36fa40;};'use strict';var DashboardEvents=require(_0x4b08('0x0'));var events=[_0x4b08('0x1'),_0x4b08('0x2'),'update'];function createListener(_0x5bb128,_0x4880d2){return function(_0x2ee39a){_0x4880d2[_0x4b08('0x3')](_0x5bb128,_0x2ee39a);};}function removeListener(_0x408725,_0x36a64b){return function(){DashboardEvents[_0x4b08('0x4')](_0x408725,_0x36a64b);};}exports[_0x4b08('0x5')]=function(_0x3d862a){for(var _0x55a01a=0x0,_0x5bafac=events['length'];_0x55a01a<_0x5bafac;_0x55a01a++){var _0x335dee=events[_0x55a01a];var _0x73c0aa=createListener(_0x4b08('0x6')+_0x335dee,_0x3d862a);DashboardEvents['on'](_0x335dee,_0x73c0aa);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 9120b7b..7bf68c7 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 _0x9ae9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','exports','util','path','connect-timeout','express','Router'];(function(_0x5c5c54,_0x5872b8){var _0x40e34c=function(_0x2f63b2){while(--_0x2f63b2){_0x5c5c54['push'](_0x5c5c54['shift']());}};_0x40e34c(++_0x5872b8);}(_0x9ae9,0x8b));var _0x99ae=function(_0xd12c7f,_0x413a4d){_0xd12c7f=_0xd12c7f-0x0;var _0x4702da=_0x9ae9[_0xd12c7f];return _0x4702da;};'use strict';var multer=require('multer');var util=require(_0x99ae('0x0'));var path=require(_0x99ae('0x1'));var timeout=require(_0x99ae('0x2'));var express=require(_0x99ae('0x3'));var router=express[_0x99ae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x99ae('0x5'));var interaction=require(_0x99ae('0x6'));var config=require(_0x99ae('0x7'));var controller=require(_0x99ae('0x8'));router[_0x99ae('0x9')]('/',auth[_0x99ae('0xa')](),controller[_0x99ae('0xb')]);router[_0x99ae('0x9')](_0x99ae('0xc'),auth[_0x99ae('0xa')](),controller[_0x99ae('0xd')]);router[_0x99ae('0x9')](_0x99ae('0xe'),auth[_0x99ae('0xa')](),controller[_0x99ae('0xf')]);router[_0x99ae('0x10')]('/',auth['isAuthenticated'](),controller[_0x99ae('0x11')]);router[_0x99ae('0x10')](_0x99ae('0x12'),auth[_0x99ae('0xa')](),controller[_0x99ae('0x13')]);router[_0x99ae('0x10')](_0x99ae('0xe'),auth[_0x99ae('0xa')](),controller[_0x99ae('0x14')]);router[_0x99ae('0x15')](_0x99ae('0xc'),auth['isAuthenticated'](),controller[_0x99ae('0x16')]);router['delete']('/:id',auth[_0x99ae('0xa')](),controller['destroy']);module[_0x99ae('0x17')]=router; \ No newline at end of file +var _0xaa3c=['create','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','show','/:id/items','getItems','post'];(function(_0x2bc3dc,_0x2d2d77){var _0x319595=function(_0x3f3a03){while(--_0x3f3a03){_0x2bc3dc['push'](_0x2bc3dc['shift']());}};_0x319595(++_0x2d2d77);}(_0xaa3c,0xf3));var _0xcaa3=function(_0x1467b3,_0x2bd11a){_0x1467b3=_0x1467b3-0x0;var _0x2e704a=_0xaa3c[_0x1467b3];return _0x2e704a;};'use strict';var multer=require(_0xcaa3('0x0'));var util=require(_0xcaa3('0x1'));var path=require(_0xcaa3('0x2'));var timeout=require('connect-timeout');var express=require(_0xcaa3('0x3'));var router=express[_0xcaa3('0x4')]();var fs_extra=require(_0xcaa3('0x5'));var auth=require(_0xcaa3('0x6'));var interaction=require(_0xcaa3('0x7'));var config=require(_0xcaa3('0x8'));var controller=require(_0xcaa3('0x9'));router['get']('/',auth[_0xcaa3('0xa')](),controller[_0xcaa3('0xb')]);router[_0xcaa3('0xc')]('/:id',auth[_0xcaa3('0xa')](),controller[_0xcaa3('0xd')]);router[_0xcaa3('0xc')](_0xcaa3('0xe'),auth['isAuthenticated'](),controller[_0xcaa3('0xf')]);router[_0xcaa3('0x10')]('/',auth[_0xcaa3('0xa')](),controller[_0xcaa3('0x11')]);router[_0xcaa3('0x10')](_0xcaa3('0x12'),auth[_0xcaa3('0xa')](),controller[_0xcaa3('0x13')]);router[_0xcaa3('0x10')](_0xcaa3('0xe'),auth[_0xcaa3('0xa')](),controller['addItem']);router[_0xcaa3('0x14')](_0xcaa3('0x15'),auth['isAuthenticated'](),controller[_0xcaa3('0x16')]);router[_0xcaa3('0x17')]('/:id',auth[_0xcaa3('0xa')](),controller[_0xcaa3('0x18')]);module[_0xcaa3('0x19')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index f70bd5b..68614fd 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 _0x6d38=['INTEGER','STRING','#2196f3','squel','lodash','exports','TEXT','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0x1e3f59,_0xd39d37){var _0x46a871=function(_0x1490b1){while(--_0x1490b1){_0x1e3f59['push'](_0x1e3f59['shift']());}};_0x46a871(++_0xd39d37);}(_0x6d38,0x1ef));var _0x86d3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6d38[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x86d3('0x0'));var _=require(_0x86d3('0x1'));module[_0x86d3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x86d3('0x3')]('long'),'get':function(){try{return JSON[_0x86d3('0x4')](this[_0x86d3('0x5')](_0x86d3('0x6')));}catch(_0x4ef557){return[];}},'set':function(_0x2d8272){try{this[_0x86d3('0x7')](_0x86d3('0x6'),JSON[_0x86d3('0x8')](_0x2d8272));}catch(_0x47e654){this['setDataValue'](_0x86d3('0x6'),JSON[_0x86d3('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x86d3('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x86d3('0x9')]},'background':{'type':Sequelize[_0x86d3('0xa')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86d3('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x86d3('0xa')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xc4aa=['getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x407e90,_0x2453cf){var _0x288761=function(_0xb56607){while(--_0xb56607){_0x407e90['push'](_0x407e90['shift']());}};_0x288761(++_0x2453cf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0xac4a('0x0'));var squel=require(_0xac4a('0x1'));var _=require(_0xac4a('0x2'));module[_0xac4a('0x3')]={'title':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xac4a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0xac4a('0x5')](_0xac4a('0x6')));}catch(_0x730a38){return[];}},'set':function(_0x215f39){try{this[_0xac4a('0x7')](_0xac4a('0x6'),JSON[_0xac4a('0x8')](_0x215f39));}catch(_0x10525b){this['setDataValue']('attrs',JSON[_0xac4a('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xac4a('0x9')]},'background':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![],'defaultValue':_0xac4a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac4a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xac4a('0x9')],'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 648f997..6540e6a 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 _0x7114=['attrReport','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','status','end','json','offset','limit','undefined','count','Content-Range','save','update','then','destroy','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','params','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3'];(function(_0x3c3fc7,_0x5a17c1){var _0x491162=function(_0x5e1280){while(--_0x5e1280){_0x3c3fc7['push'](_0x3c3fc7['shift']());}};_0x491162(++_0x5a17c1);}(_0x7114,0x177));var _0x4711=function(_0x3af63d,_0xd159f6){_0x3af63d=_0x3af63d-0x0;var _0x103609=_0x7114[_0x3af63d];return _0x103609;};'use strict';var emlformat=require(_0x4711('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4711('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4711('0x2'));var moment=require(_0x4711('0x3'));var BPromise=require(_0x4711('0x4'));var Mustache=require(_0x4711('0x5'));var util=require('util');var path=require(_0x4711('0x6'));var sox=require(_0x4711('0x7'));var csv=require(_0x4711('0x8'));var ejs=require(_0x4711('0x9'));var fs=require('fs');var fs_extra=require(_0x4711('0xa'));var _=require(_0x4711('0xb'));var squel=require('squel');var crypto=require(_0x4711('0xc'));var jsforce=require(_0x4711('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4711('0x8'));var querystring=require(_0x4711('0xe'));var Papa=require('papaparse');var Redis=require(_0x4711('0xf'));var authService=require(_0x4711('0x10'));var qs=require(_0x4711('0x11'));var as=require(_0x4711('0x12'));var hardwareService=require(_0x4711('0x13'));var logger=require(_0x4711('0x14'))(_0x4711('0x15'));var utils=require(_0x4711('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4711('0x17'));var db=require('../../mysqldb')['db'];config[_0x4711('0x18')]=_[_0x4711('0x19')](config[_0x4711('0x18')],{'host':_0x4711('0x1a'),'port':0x18eb});var socket=require(_0x4711('0x1b'))(new Redis(config[_0x4711('0x18')]));require(_0x4711('0x1c'))['register'](socket);function respondWithStatusCode(_0x19cab8,_0x1359cc){_0x1359cc=_0x1359cc||0xcc;return function(_0x1fd001){if(_0x1fd001){return _0x19cab8['sendStatus'](_0x1359cc);}return _0x19cab8[_0x4711('0x1d')](_0x1359cc)[_0x4711('0x1e')]();};}function respondWithResult(_0x43404d,_0xde1922){_0xde1922=_0xde1922||0xc8;return function(_0x3b560b){if(_0x3b560b){return _0x43404d[_0x4711('0x1d')](_0xde1922)[_0x4711('0x1f')](_0x3b560b);}};}function respondWithFilteredResult(_0x1ceeb7,_0x52b93a){return function(_0x13ce49){if(_0x13ce49){var _0x5d7754=typeof _0x52b93a[_0x4711('0x20')]==='undefined'&&typeof _0x52b93a[_0x4711('0x21')]===_0x4711('0x22');var _0x126e9b=_0x13ce49[_0x4711('0x23')];var _0x36850f=_0x5d7754?0x0:_0x52b93a[_0x4711('0x20')];var _0xdee62d=_0x5d7754?_0x13ce49[_0x4711('0x23')]:_0x52b93a[_0x4711('0x20')]+_0x52b93a['limit'];var _0x11ccb4;if(_0xdee62d>=_0x126e9b){_0xdee62d=_0x126e9b;_0x11ccb4=0xc8;}else{_0x11ccb4=0xce;}_0x1ceeb7['status'](_0x11ccb4);return _0x1ceeb7['set'](_0x4711('0x24'),_0x36850f+'-'+_0xdee62d+'/'+_0x126e9b)[_0x4711('0x1f')](_0x13ce49);}return null;};}function patchUpdates(_0x243e31){return function(_0xdb04e2){try{jsonpatch['apply'](_0xdb04e2,_0x243e31,!![]);}catch(_0x17c8ca){return BPromise['reject'](_0x17c8ca);}return _0xdb04e2[_0x4711('0x25')]();};}function saveUpdates(_0x314d79,_0x5acbc6){return function(_0xa50b5c){if(_0xa50b5c){return _0xa50b5c[_0x4711('0x26')](_0x314d79)[_0x4711('0x27')](function(_0x36d3af){return _0x36d3af;});}return null;};}function removeEntity(_0x1cc576,_0x35ecb6){return function(_0x26a220){if(_0x26a220){return _0x26a220[_0x4711('0x28')]()[_0x4711('0x27')](function(){_0x1cc576[_0x4711('0x1d')](0xcc)[_0x4711('0x1e')]();});}};}function handleEntityNotFound(_0x3614bb,_0x438150){return function(_0x5df4bd){if(!_0x5df4bd){_0x3614bb['sendStatus'](0x194);}return _0x5df4bd;};}function handleError(_0x2b3997,_0x756465){_0x756465=_0x756465||0x1f4;return function(_0x1b1a41){logger[_0x4711('0x29')](_0x1b1a41[_0x4711('0x2a')]);if(_0x1b1a41[_0x4711('0x2b')]){delete _0x1b1a41[_0x4711('0x2b')];}_0x2b3997[_0x4711('0x1d')](_0x756465)[_0x4711('0x2c')](_0x1b1a41);};}exports[_0x4711('0x2d')]=function(_0x27cdf4,_0x4664c7){var _0x2163b9={'raw':![],'where':{'id':_0x27cdf4['params']['id']}},_0x216764={};_0x216764[_0x4711('0x2e')]=_[_0x4711('0x2f')](db[_0x4711('0x30')][_0x4711('0x31')]);_0x216764[_0x4711('0x32')]=_['keys'](_0x27cdf4[_0x4711('0x32')]);_0x216764[_0x4711('0x33')]=_[_0x4711('0x34')](_0x216764[_0x4711('0x2e')],_0x216764[_0x4711('0x32')]);_0x2163b9[_0x4711('0x35')]=_[_0x4711('0x34')](_0x216764['model'],qs[_0x4711('0x36')](_0x27cdf4['query'][_0x4711('0x36')]));_0x2163b9[_0x4711('0x35')]=_0x2163b9[_0x4711('0x35')][_0x4711('0x37')]?_0x2163b9[_0x4711('0x35')]:_0x216764['model'];if(_0x27cdf4[_0x4711('0x32')][_0x4711('0x38')]){_0x2163b9[_0x4711('0x39')]=[{'all':!![]}];}_0x2163b9=_[_0x4711('0x3a')]({},_0x2163b9,_0x27cdf4[_0x4711('0x3b')]);return db[_0x4711('0x30')][_0x4711('0x3c')](_0x2163b9)[_0x4711('0x27')](handleEntityNotFound(_0x4664c7,null))[_0x4711('0x27')](respondWithResult(_0x4664c7,null))[_0x4711('0x3d')](handleError(_0x4664c7,null));};exports['destroy']=function(_0x35bb5c,_0xbabbd3){return db[_0x4711('0x30')][_0x4711('0x3c')]({'where':{'id':_0x35bb5c[_0x4711('0x3e')]['id']}})['then'](handleEntityNotFound(_0xbabbd3,null))[_0x4711('0x27')](removeEntity(_0xbabbd3,null))[_0x4711('0x3d')](handleError(_0xbabbd3,null));};function widgetAttributes(_0x12a034){try{switch(_0x12a034['type']){case _0x4711('0x3f'):return[{'name':_0x4711('0x40'),'value':_0x12a034[_0x4711('0x40')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0]['value']:undefined)||_0x4711('0x42')}];case _0x4711('0x43'):return[{'name':_0x4711('0x44'),'value':_0x12a034[_0x4711('0x44')]||(_0x12a034['attrs']&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0][_0x4711('0x45')]:undefined)||''}];case _0x4711('0x46'):return[{'name':'attrHourFormat','value':_0x12a034[_0x4711('0x47')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034['attrs'][0x0]?_0x12a034[_0x4711('0x41')][0x0]['value']:undefined)||_0x4711('0x48')},{'name':'attrTimezone','value':_0x12a034[_0x4711('0x49')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x1]?_0x12a034['attrs'][0x1][_0x4711('0x45')]:undefined)||_0x4711('0x4a')},{'name':_0x4711('0x4b'),'value':_0x12a034[_0x4711('0x4b')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x2]?_0x12a034[_0x4711('0x41')][0x2][_0x4711('0x45')]:undefined)||0xc}];case _0x4711('0x4c'):return[{'name':_0x4711('0x4d'),'value':_0x12a034[_0x4711('0x4d')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0][_0x4711('0x45')]:undefined)||_0x4711('0x4e')},{'name':'attrVoiceQueues','value':_0x12a034[_0x4711('0x4f')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x1]?_0x12a034['attrs'][0x1][_0x4711('0x45')]:undefined)||[]},{'name':_0x4711('0x4b'),'value':_0x12a034[_0x4711('0x4b')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x2]?_0x12a034[_0x4711('0x41')][0x2][_0x4711('0x45')]:undefined)||0x14}];case _0x4711('0x50'):case _0x4711('0x51'):return[{'name':_0x4711('0x52'),'value':_0x12a034[_0x4711('0x52')]||(_0x12a034['attrs']&&_0x12a034['attrs'][0x0]?_0x12a034['attrs'][0x0][_0x4711('0x45')]:undefined)||_0x4711('0x4e')},{'name':'attrSerie2','value':_0x12a034[_0x4711('0x53')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x1]?_0x12a034[_0x4711('0x41')][0x1][_0x4711('0x45')]:undefined)||null},{'name':'attrSerie3','value':_0x12a034[_0x4711('0x54')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034['attrs'][0x2]?_0x12a034[_0x4711('0x41')][0x2][_0x4711('0x45')]:undefined)||null},{'name':_0x4711('0x4f'),'value':_0x12a034[_0x4711('0x4f')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x3]?_0x12a034[_0x4711('0x41')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x4711('0x55'),'type':_0x12a034['reportType']||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0][_0x4711('0x56')]:undefined)||null,'value':_0x12a034[_0x4711('0x55')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x0]?_0x12a034[_0x4711('0x41')][0x0][_0x4711('0x45')]:undefined)||null},{'name':_0x4711('0x57'),'value':_0x12a034[_0x4711('0x57')]||(_0x12a034[_0x4711('0x41')]&&_0x12a034[_0x4711('0x41')][0x1]?_0x12a034[_0x4711('0x41')][0x1][_0x4711('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x557389){logger[_0x4711('0x29')](_0x4711('0x58'),JSON[_0x4711('0x59')](_0x557389));return[];}}exports[_0x4711('0x5a')]=function(_0x287289,_0x35b34a){if(_0x287289[_0x4711('0x5b')]){_0x287289[_0x4711('0x5b')][_0x4711('0x41')]=widgetAttributes(_0x287289[_0x4711('0x5b')]);}return db['DashboardItem'][_0x4711('0x5a')](_0x287289[_0x4711('0x5b')],{})[_0x4711('0x27')](respondWithResult(_0x35b34a,0xc9))[_0x4711('0x3d')](handleError(_0x35b34a,null));};exports[_0x4711('0x26')]=function(_0x4b222f,_0x5f3906){if(_0x4b222f[_0x4711('0x5b')]['id']){delete _0x4b222f['body']['id'];}_0x4b222f['body'][_0x4711('0x41')]=widgetAttributes(_0x4b222f[_0x4711('0x5b')]);return db[_0x4711('0x30')][_0x4711('0x3c')]({'where':{'id':_0x4b222f[_0x4711('0x3e')]['id']}})[_0x4711('0x27')](handleEntityNotFound(_0x5f3906,null))[_0x4711('0x27')](saveUpdates(_0x4b222f[_0x4711('0x5b')],null))[_0x4711('0x27')](respondWithResult(_0x5f3906,null))[_0x4711('0x3d')](handleError(_0x5f3906,null));}; \ No newline at end of file +var _0xea63=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','status','end','offset','undefined','limit','count','set','reject','update','then','sendStatus','stack','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','destroy','type','iframe','attrs','https://','custom','value','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x6c4e85,_0x52fb5d){var _0x12a197=function(_0x295fc5){while(--_0x295fc5){_0x6c4e85['push'](_0x6c4e85['shift']());}};_0x12a197(++_0x52fb5d);}(_0xea63,0x1d6));var _0x3ea6=function(_0xc17eed,_0x10daa6){_0xc17eed=_0xc17eed-0x0;var _0x17c76b=_0xea63[_0xc17eed];return _0x17c76b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ea6('0x0'));var zipdir=require(_0x3ea6('0x1'));var jsonpatch=require(_0x3ea6('0x2'));var rp=require(_0x3ea6('0x3'));var moment=require(_0x3ea6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3ea6('0x5'));var path=require(_0x3ea6('0x6'));var sox=require(_0x3ea6('0x7'));var csv=require('to-csv');var ejs=require(_0x3ea6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ea6('0x9'));var squel=require(_0x3ea6('0xa'));var crypto=require(_0x3ea6('0xb'));var jsforce=require(_0x3ea6('0xc'));var deskjs=require(_0x3ea6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3ea6('0xe'));var Papa=require(_0x3ea6('0xf'));var Redis=require('ioredis');var authService=require(_0x3ea6('0x10'));var qs=require(_0x3ea6('0x11'));var as=require(_0x3ea6('0x12'));var hardwareService=require(_0x3ea6('0x13'));var logger=require('../../config/logger')(_0x3ea6('0x14'));var utils=require('../../config/utils');var config=require(_0x3ea6('0x15'));var licenseUtil=require(_0x3ea6('0x16'));var db=require('../../mysqldb')['db'];config[_0x3ea6('0x17')]=_[_0x3ea6('0x18')](config['redis'],{'host':_0x3ea6('0x19'),'port':0x18eb});var socket=require(_0x3ea6('0x1a'))(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x28a18c,_0x2abac4){_0x2abac4=_0x2abac4||0xcc;return function(_0x1a7693){if(_0x1a7693){return _0x28a18c['sendStatus'](_0x2abac4);}return _0x28a18c[_0x3ea6('0x1b')](_0x2abac4)[_0x3ea6('0x1c')]();};}function respondWithResult(_0x4b0c4e,_0x224a4b){_0x224a4b=_0x224a4b||0xc8;return function(_0x47e631){if(_0x47e631){return _0x4b0c4e[_0x3ea6('0x1b')](_0x224a4b)['json'](_0x47e631);}};}function respondWithFilteredResult(_0xb4d77e,_0x3bb245){return function(_0x371661){if(_0x371661){var _0x4363c7=typeof _0x3bb245[_0x3ea6('0x1d')]===_0x3ea6('0x1e')&&typeof _0x3bb245[_0x3ea6('0x1f')]===_0x3ea6('0x1e');var _0x4025fe=_0x371661['count'];var _0x228bfa=_0x4363c7?0x0:_0x3bb245[_0x3ea6('0x1d')];var _0x4b91f6=_0x4363c7?_0x371661[_0x3ea6('0x20')]:_0x3bb245['offset']+_0x3bb245[_0x3ea6('0x1f')];var _0x2b1310;if(_0x4b91f6>=_0x4025fe){_0x4b91f6=_0x4025fe;_0x2b1310=0xc8;}else{_0x2b1310=0xce;}_0xb4d77e[_0x3ea6('0x1b')](_0x2b1310);return _0xb4d77e[_0x3ea6('0x21')]('Content-Range',_0x228bfa+'-'+_0x4b91f6+'/'+_0x4025fe)['json'](_0x371661);}return null;};}function patchUpdates(_0x15b63a){return function(_0x11b511){try{jsonpatch['apply'](_0x11b511,_0x15b63a,!![]);}catch(_0x3afddf){return BPromise[_0x3ea6('0x22')](_0x3afddf);}return _0x11b511['save']();};}function saveUpdates(_0x485f86,_0x1283bf){return function(_0x517d07){if(_0x517d07){return _0x517d07[_0x3ea6('0x23')](_0x485f86)[_0x3ea6('0x24')](function(_0x4cfcf2){return _0x4cfcf2;});}return null;};}function removeEntity(_0x426078,_0x2aaf42){return function(_0xcf2a39){if(_0xcf2a39){return _0xcf2a39['destroy']()['then'](function(){_0x426078[_0x3ea6('0x1b')](0xcc)[_0x3ea6('0x1c')]();});}};}function handleEntityNotFound(_0x3e3abb,_0x4a3e3f){return function(_0x4c4998){if(!_0x4c4998){_0x3e3abb[_0x3ea6('0x25')](0x194);}return _0x4c4998;};}function handleError(_0x209215,_0x843f58){_0x843f58=_0x843f58||0x1f4;return function(_0xa722de){logger['error'](_0xa722de[_0x3ea6('0x26')]);if(_0xa722de[_0x3ea6('0x27')]){delete _0xa722de[_0x3ea6('0x27')];}_0x209215['status'](_0x843f58)[_0x3ea6('0x28')](_0xa722de);};}exports['show']=function(_0x20c524,_0x445909){var _0x49d639={'raw':![],'where':{'id':_0x20c524[_0x3ea6('0x29')]['id']}},_0x21c83f={};_0x21c83f[_0x3ea6('0x2a')]=_[_0x3ea6('0x2b')](db[_0x3ea6('0x2c')][_0x3ea6('0x2d')]);_0x21c83f[_0x3ea6('0x2e')]=_['keys'](_0x20c524['query']);_0x21c83f[_0x3ea6('0x2f')]=_['intersection'](_0x21c83f[_0x3ea6('0x2a')],_0x21c83f[_0x3ea6('0x2e')]);_0x49d639['attributes']=_[_0x3ea6('0x30')](_0x21c83f[_0x3ea6('0x2a')],qs[_0x3ea6('0x31')](_0x20c524[_0x3ea6('0x2e')]['fields']));_0x49d639[_0x3ea6('0x32')]=_0x49d639[_0x3ea6('0x32')]['length']?_0x49d639[_0x3ea6('0x32')]:_0x21c83f['model'];if(_0x20c524['query'][_0x3ea6('0x33')]){_0x49d639[_0x3ea6('0x34')]=[{'all':!![]}];}_0x49d639=_[_0x3ea6('0x35')]({},_0x49d639,_0x20c524[_0x3ea6('0x36')]);return db[_0x3ea6('0x2c')][_0x3ea6('0x37')](_0x49d639)[_0x3ea6('0x24')](handleEntityNotFound(_0x445909,null))[_0x3ea6('0x24')](respondWithResult(_0x445909,null))[_0x3ea6('0x38')](handleError(_0x445909,null));};exports[_0x3ea6('0x39')]=function(_0x49a647,_0xac346c){return db['DashboardItem']['find']({'where':{'id':_0x49a647[_0x3ea6('0x29')]['id']}})[_0x3ea6('0x24')](handleEntityNotFound(_0xac346c,null))['then'](removeEntity(_0xac346c,null))['catch'](handleError(_0xac346c,null));};function widgetAttributes(_0x268841){try{switch(_0x268841[_0x3ea6('0x3a')]){case _0x3ea6('0x3b'):return[{'name':'attrUrl','value':_0x268841['attrUrl']||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x0]?_0x268841[_0x3ea6('0x3c')][0x0]['value']:undefined)||_0x3ea6('0x3d')}];case _0x3ea6('0x3e'):return[{'name':'attrPath','value':_0x268841['attrPath']||(_0x268841['attrs']&&_0x268841[_0x3ea6('0x3c')][0x0]?_0x268841[_0x3ea6('0x3c')][0x0][_0x3ea6('0x3f')]:undefined)||''}];case _0x3ea6('0x40'):return[{'name':_0x3ea6('0x41'),'value':_0x268841['attrHourFormat']||(_0x268841['attrs']&&_0x268841[_0x3ea6('0x3c')][0x0]?_0x268841[_0x3ea6('0x3c')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x3ea6('0x42'),'value':_0x268841['attrTimezone']||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x1]?_0x268841[_0x3ea6('0x3c')][0x1][_0x3ea6('0x3f')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x268841[_0x3ea6('0x43')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x2]?_0x268841['attrs'][0x2]['value']:undefined)||0xc}];case _0x3ea6('0x44'):return[{'name':_0x3ea6('0x45'),'value':_0x268841[_0x3ea6('0x45')]||(_0x268841['attrs']&&_0x268841[_0x3ea6('0x3c')][0x0]?_0x268841[_0x3ea6('0x3c')][0x0]['value']:undefined)||_0x3ea6('0x46')},{'name':_0x3ea6('0x47'),'value':_0x268841[_0x3ea6('0x47')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x1]?_0x268841[_0x3ea6('0x3c')][0x1][_0x3ea6('0x3f')]:undefined)||[]},{'name':_0x3ea6('0x43'),'value':_0x268841[_0x3ea6('0x43')]||(_0x268841['attrs']&&_0x268841[_0x3ea6('0x3c')][0x2]?_0x268841[_0x3ea6('0x3c')][0x2][_0x3ea6('0x3f')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x3ea6('0x48'),'value':_0x268841[_0x3ea6('0x48')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x0]?_0x268841[_0x3ea6('0x3c')][0x0][_0x3ea6('0x3f')]:undefined)||_0x3ea6('0x46')},{'name':'attrSerie2','value':_0x268841[_0x3ea6('0x49')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841['attrs'][0x1]?_0x268841[_0x3ea6('0x3c')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x268841[_0x3ea6('0x4a')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x2]?_0x268841[_0x3ea6('0x3c')][0x2][_0x3ea6('0x3f')]:undefined)||null},{'name':_0x3ea6('0x47'),'value':_0x268841[_0x3ea6('0x47')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x3]?_0x268841[_0x3ea6('0x3c')][0x3][_0x3ea6('0x3f')]:undefined)||[]}];case'web-report':return[{'name':_0x3ea6('0x4b'),'type':_0x268841[_0x3ea6('0x4c')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x0]?_0x268841[_0x3ea6('0x3c')][0x0][_0x3ea6('0x3a')]:undefined)||null,'value':_0x268841[_0x3ea6('0x4b')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x0]?_0x268841[_0x3ea6('0x3c')][0x0][_0x3ea6('0x3f')]:undefined)||null},{'name':_0x3ea6('0x4d'),'value':_0x268841[_0x3ea6('0x4d')]||(_0x268841[_0x3ea6('0x3c')]&&_0x268841[_0x3ea6('0x3c')][0x1]?_0x268841['attrs'][0x1][_0x3ea6('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x35ac94){logger['error'](_0x3ea6('0x4e'),JSON[_0x3ea6('0x4f')](_0x35ac94));return[];}}exports[_0x3ea6('0x50')]=function(_0x59c104,_0x43657b){if(_0x59c104[_0x3ea6('0x51')]){_0x59c104[_0x3ea6('0x51')]['attrs']=widgetAttributes(_0x59c104[_0x3ea6('0x51')]);}return db[_0x3ea6('0x2c')][_0x3ea6('0x50')](_0x59c104[_0x3ea6('0x51')],{})['then'](respondWithResult(_0x43657b,0xc9))['catch'](handleError(_0x43657b,null));};exports[_0x3ea6('0x23')]=function(_0xb70a11,_0x445e3b){if(_0xb70a11[_0x3ea6('0x51')]['id']){delete _0xb70a11['body']['id'];}_0xb70a11[_0x3ea6('0x51')][_0x3ea6('0x3c')]=widgetAttributes(_0xb70a11[_0x3ea6('0x51')]);return db['DashboardItem'][_0x3ea6('0x37')]({'where':{'id':_0xb70a11[_0x3ea6('0x29')]['id']}})[_0x3ea6('0x24')](handleEntityNotFound(_0x445e3b,null))[_0x3ea6('0x24')](saveUpdates(_0xb70a11[_0x3ea6('0x51')],null))['then'](respondWithResult(_0x445e3b,null))[_0x3ea6('0x38')](handleError(_0x445e3b,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a6bb433..845f4bb 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 _0x490e=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','DashboardItem'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x490e,0x10b));var _0xe490=function(_0x487d0a,_0x1b7cb4){_0x487d0a=_0x487d0a-0x0;var _0x3d740c=_0x490e[_0x487d0a];return _0x3d740c;};'use strict';var EventEmitter=require(_0xe490('0x0'));var DashboardItem=require(_0xe490('0x1'))['db'][_0xe490('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe490('0x3'),'afterUpdate':_0xe490('0x4'),'afterDestroy':_0xe490('0x5')};function emitEvent(_0x42e6c4){return function(_0x34298d,_0xf9b88c,_0x468f6b){DashboardItemEvents[_0xe490('0x6')](_0x42e6c4+':'+_0x34298d['id'],_0x34298d);DashboardItemEvents[_0xe490('0x6')](_0x42e6c4,_0x34298d);_0x468f6b(null);};}for(var e in events){if(events[_0xe490('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xe490('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x9b67=['DashboardItem','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x419e0b,_0x27626b){var _0x92a06d=function(_0x3a650c){while(--_0x3a650c){_0x419e0b['push'](_0x419e0b['shift']());}};_0x92a06d(++_0x27626b);}(_0x9b67,0xed));var _0x79b6=function(_0x48b4cb,_0x4d10ce){_0x48b4cb=_0x48b4cb-0x0;var _0x1ca95d=_0x9b67[_0x48b4cb];return _0x1ca95d;};'use strict';var EventEmitter=require(_0x79b6('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x79b6('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x79b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x79b6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2e76ef){return function(_0x4f4e39,_0x4ca068,_0x2bee45){DashboardItemEvents[_0x79b6('0x4')](_0x2e76ef+':'+_0x4f4e39['id'],_0x4f4e39);DashboardItemEvents['emit'](_0x2e76ef,_0x4f4e39);_0x2bee45(null);};}for(var e in events){if(events[_0x79b6('0x5')](e)){var event=events[e];DashboardItem[_0x79b6('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 481ee92..cbb7049 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 _0x9d54=['dashboard_items','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','define'];(function(_0x35cbb9,_0x2536b6){var _0x3262cb=function(_0x19ffb4){while(--_0x19ffb4){_0x35cbb9['push'](_0x35cbb9['shift']());}};_0x3262cb(++_0x2536b6);}(_0x9d54,0x155));var _0x49d5=function(_0x11df74,_0x40bb4b){_0x11df74=_0x11df74-0x0;var _0x5db810=_0x9d54[_0x11df74];return _0x5db810;};'use strict';var _=require('lodash');var util=require(_0x49d5('0x0'));var logger=require(_0x49d5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x49d5('0x2'));var rp=require(_0x49d5('0x3'));var fs=require('fs');var path=require(_0x49d5('0x4'));var rimraf=require(_0x49d5('0x5'));var config=require(_0x49d5('0x6'));var attributes=require(_0x49d5('0x7'));module['exports']=function(_0x49eff0,_0x2eac1f){return _0x49eff0[_0x49d5('0x8')]('DashboardItem',attributes,{'tableName':_0x49d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87cb=['rimraf','../../config/environment','./dashboardItem.attributes','exports','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1656c9,_0x597f64){var _0x3d756b=function(_0x498f9b){while(--_0x498f9b){_0x1656c9['push'](_0x1656c9['shift']());}};_0x3d756b(++_0x597f64);}(_0x87cb,0xaa));var _0xb87c=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x87cb[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xb87c('0x0'));var util=require(_0xb87c('0x1'));var logger=require(_0xb87c('0x2'))(_0xb87c('0x3'));var moment=require(_0xb87c('0x4'));var BPromise=require(_0xb87c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb87c('0x6'));var config=require(_0xb87c('0x7'));var attributes=require(_0xb87c('0x8'));module[_0xb87c('0x9')]=function(_0x46377b,_0x211d93){return _0x46377b['define']('DashboardItem',attributes,{'tableName':_0xb87c('0xa'),'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 5d66a3f..d70afb7 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 _0x743f=['request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x743f,0x104));var _0xf743=function(_0x4af7fe,_0x535377){_0x4af7fe=_0x4af7fe-0x0;var _0x5dbfda=_0x743f[_0x4af7fe];return _0x5dbfda;};'use strict';var _=require(_0xf743('0x0'));var util=require(_0xf743('0x1'));var moment=require(_0xf743('0x2'));var BPromise=require(_0xf743('0x3'));var rs=require(_0xf743('0x4'));var fs=require('fs');var Redis=require(_0xf743('0x5'));var db=require(_0xf743('0x6'))['db'];var utils=require(_0xf743('0x7'));var logger=require('../../config/logger')(_0xf743('0x8'));var config=require(_0xf743('0x9'));var jayson=require(_0xf743('0xa'));var client=jayson[_0xf743('0xb')][_0xf743('0xc')]({'port':0x232a});config['redis']=_[_0xf743('0xd')](config[_0xf743('0xe')],{'host':_0xf743('0xf'),'port':0x18eb});var socket=require(_0xf743('0x10'))(new Redis(config[_0xf743('0xe')]));require(_0xf743('0x11'))[_0xf743('0x12')](socket);function respondWithRpcPromise(_0x34272b,_0x459d9d,_0x382bc){return new BPromise(function(_0x4b8c7f,_0x182deb){return client[_0xf743('0x13')](_0x34272b,_0x382bc)[_0xf743('0x14')](function(_0x2e3888){logger[_0xf743('0x15')](_0xf743('0x16'),_0x459d9d,'request\x20sent');logger[_0xf743('0x17')](_0xf743('0x18'),_0x459d9d,_0xf743('0x19'),JSON[_0xf743('0x1a')](_0x2e3888));if(_0x2e3888[_0xf743('0x1b')]){if(_0x2e3888[_0xf743('0x1b')][_0xf743('0x1c')]===0x1f4){logger[_0xf743('0x1b')](_0xf743('0x16'),_0x459d9d,_0x2e3888[_0xf743('0x1b')][_0xf743('0x1d')]);return _0x182deb(_0x2e3888['error'][_0xf743('0x1d')]);}logger[_0xf743('0x1b')](_0xf743('0x16'),_0x459d9d,_0x2e3888[_0xf743('0x1b')][_0xf743('0x1d')]);return _0x4b8c7f(_0x2e3888[_0xf743('0x1b')]['message']);}else{logger['info'](_0xf743('0x16'),_0x459d9d,_0xf743('0x19'));_0x4b8c7f(_0x2e3888['result'][_0xf743('0x1d')]);}})[_0xf743('0x1e')](function(_0x54658c){logger['error'](_0xf743('0x16'),_0x459d9d,_0x54658c);_0x182deb(_0x54658c);});});} \ No newline at end of file +var _0x2c6f=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','ioredis','../../config/logger','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x53c2e3,_0x486f96){var _0x28bfd5=function(_0x4af9f2){while(--_0x4af9f2){_0x53c2e3['push'](_0x53c2e3['shift']());}};_0x28bfd5(++_0x486f96);}(_0x2c6f,0x107));var _0xf2c6=function(_0x638f98,_0x5c009e){_0x638f98=_0x638f98-0x0;var _0x1b992a=_0x2c6f[_0x638f98];return _0x1b992a;};'use strict';var _=require(_0xf2c6('0x0'));var util=require(_0xf2c6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2c6('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf2c6('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf2c6('0x4'));var client=jayson[_0xf2c6('0x5')][_0xf2c6('0x6')]({'port':0x232a});config['redis']=_[_0xf2c6('0x7')](config[_0xf2c6('0x8')],{'host':_0xf2c6('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf2c6('0x8')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x4084f8,_0x3ef4b9,_0xf71904){return new BPromise(function(_0x5f0ee7,_0x296449){return client[_0xf2c6('0xa')](_0x4084f8,_0xf71904)[_0xf2c6('0xb')](function(_0x38815a){logger[_0xf2c6('0xc')](_0xf2c6('0xd'),_0x3ef4b9,_0xf2c6('0xe'));logger['debug'](_0xf2c6('0xf'),_0x3ef4b9,_0xf2c6('0xe'),JSON['stringify'](_0x38815a));if(_0x38815a[_0xf2c6('0x10')]){if(_0x38815a[_0xf2c6('0x10')][_0xf2c6('0x11')]===0x1f4){logger[_0xf2c6('0x10')](_0xf2c6('0xd'),_0x3ef4b9,_0x38815a['error'][_0xf2c6('0x12')]);return _0x296449(_0x38815a[_0xf2c6('0x10')][_0xf2c6('0x12')]);}logger[_0xf2c6('0x10')](_0xf2c6('0xd'),_0x3ef4b9,_0x38815a[_0xf2c6('0x10')]['message']);return _0x5f0ee7(_0x38815a['error'][_0xf2c6('0x12')]);}else{logger[_0xf2c6('0xc')](_0xf2c6('0xd'),_0x3ef4b9,_0xf2c6('0xe'));_0x5f0ee7(_0x38815a[_0xf2c6('0x13')][_0xf2c6('0x12')]);}})[_0xf2c6('0x14')](function(_0x545313){logger[_0xf2c6('0x10')](_0xf2c6('0xd'),_0x3ef4b9,_0x545313);_0x296449(_0x545313);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 6ef0a27..e48a283 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 _0x6406=['register','dashboardItem:','./dashboardItem.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6406,0x9e));var _0x6640=function(_0x434138,_0x74656){_0x434138=_0x434138-0x0;var _0x40ebdd=_0x6406[_0x434138];return _0x40ebdd;};'use strict';var DashboardItemEvents=require(_0x6640('0x0'));var events=['save',_0x6640('0x1'),_0x6640('0x2')];function createListener(_0x4e38f6,_0x42d753){return function(_0x58e0be){_0x42d753[_0x6640('0x3')](_0x4e38f6,_0x58e0be);};}function removeListener(_0x68a867,_0x148f5a){return function(){DashboardItemEvents['removeListener'](_0x68a867,_0x148f5a);};}exports[_0x6640('0x4')]=function(_0x2dc702){for(var _0x105fac=0x0,_0x78c566=events['length'];_0x105fac<_0x78c566;_0x105fac++){var _0x3669bf=events[_0x105fac];var _0x35b4b2=createListener(_0x6640('0x5')+_0x3669bf,_0x2dc702);DashboardItemEvents['on'](_0x3669bf,_0x35b4b2);}}; \ No newline at end of file +var _0x01e0=['removeListener','register','length','dashboardItem:','save','remove','emit'];(function(_0x3dc03f,_0x5d673f){var _0x4ff199=function(_0x1d79ab){while(--_0x1d79ab){_0x3dc03f['push'](_0x3dc03f['shift']());}};_0x4ff199(++_0x5d673f);}(_0x01e0,0x19a));var _0x001e=function(_0x21ba39,_0x413046){_0x21ba39=_0x21ba39-0x0;var _0x7a1e4f=_0x01e0[_0x21ba39];return _0x7a1e4f;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x001e('0x0'),_0x001e('0x1'),'update'];function createListener(_0x774ebe,_0x539489){return function(_0x3b65ca){_0x539489[_0x001e('0x2')](_0x774ebe,_0x3b65ca);};}function removeListener(_0x4b6024,_0x207f9a){return function(){DashboardItemEvents[_0x001e('0x3')](_0x4b6024,_0x207f9a);};}exports[_0x001e('0x4')]=function(_0x24a21e){for(var _0x268dc3=0x0,_0x5ae6fd=events[_0x001e('0x5')];_0x268dc3<_0x5ae6fd;_0x268dc3++){var _0x13a450=events[_0x268dc3];var _0x2b3d0e=createListener(_0x001e('0x6')+_0x13a450,_0x24a21e);DashboardItemEvents['on'](_0x13a450,_0x2b3d0e);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 4d1b7e7..40616b7 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 _0x6ecf=['fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4f2dfa,_0x2be505){var _0x1eebd2=function(_0x3689d8){while(--_0x3689d8){_0x4f2dfa['push'](_0x4f2dfa['shift']());}};_0x1eebd2(++_0x2be505);}(_0x6ecf,0x19a));var _0xf6ec=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6ecf[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require('multer');var util=require(_0xf6ec('0x0'));var path=require(_0xf6ec('0x1'));var timeout=require(_0xf6ec('0x2'));var express=require(_0xf6ec('0x3'));var router=express['Router']();var fs_extra=require(_0xf6ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf6ec('0x5'));var config=require(_0xf6ec('0x6'));var controller=require(_0xf6ec('0x7'));router[_0xf6ec('0x8')](_0xf6ec('0x9'),auth[_0xf6ec('0xa')](),controller[_0xf6ec('0xb')]);router[_0xf6ec('0xc')]('/',auth['isAuthenticated'](),controller[_0xf6ec('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf6ec('0xe')]);router[_0xf6ec('0xf')](_0xf6ec('0x9'),auth[_0xf6ec('0xa')](),controller[_0xf6ec('0x10')]);module[_0xf6ec('0x11')]=router; \ No newline at end of file +var _0xe8c8=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer'];(function(_0x301075,_0x33b785){var _0x1a04c5=function(_0x8d5143){while(--_0x8d5143){_0x301075['push'](_0x301075['shift']());}};_0x1a04c5(++_0x33b785);}(_0xe8c8,0x167));var _0x8e8c=function(_0x56d91b,_0x2745d1){_0x56d91b=_0x56d91b-0x0;var _0x24151f=_0xe8c8[_0x56d91b];return _0x24151f;};'use strict';var multer=require(_0x8e8c('0x0'));var util=require(_0x8e8c('0x1'));var path=require(_0x8e8c('0x2'));var timeout=require(_0x8e8c('0x3'));var express=require(_0x8e8c('0x4'));var router=express['Router']();var fs_extra=require(_0x8e8c('0x5'));var auth=require(_0x8e8c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8e8c('0x7'));var controller=require(_0x8e8c('0x8'));router['get'](_0x8e8c('0x9'),auth['isAuthenticated'](),controller[_0x8e8c('0xa')]);router[_0x8e8c('0xb')]('/',auth[_0x8e8c('0xc')](),controller['create']);router[_0x8e8c('0xd')](_0x8e8c('0x9'),auth[_0x8e8c('0xc')](),controller[_0x8e8c('0xe')]);router[_0x8e8c('0xf')](_0x8e8c('0x9'),auth[_0x8e8c('0xc')](),controller[_0x8e8c('0x10')]);module[_0x8e8c('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index c1384c6..42753a6 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 _0xc9c6=['third','first','STRING','exports','ENUM','second'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xc9c6,0x1a7));var _0x6c9c=function(_0x5ee5ac,_0xe68d07){_0x5ee5ac=_0x5ee5ac-0x0;var _0x30fbdd=_0xc9c6[_0x5ee5ac];return _0x30fbdd;};'use strict';var Sequelize=require('sequelize');module[_0x6c9c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x6c9c('0x1')]('first',_0x6c9c('0x2'),_0x6c9c('0x3')),'allowNull':![],'defaultValue':_0x6c9c('0x4')},'description':{'type':Sequelize[_0x6c9c('0x5')]}}; \ No newline at end of file +var _0xc6dc=['STRING','first','second','third','sequelize','exports'];(function(_0x1d0948,_0x29a5ad){var _0x405614=function(_0x1ac2af){while(--_0x1ac2af){_0x1d0948['push'](_0x1d0948['shift']());}};_0x405614(++_0x29a5ad);}(_0xc6dc,0x15a));var _0xcc6d=function(_0xb79a69,_0x3ed883){_0xb79a69=_0xb79a69-0x0;var _0x2db137=_0xc6dc[_0xb79a69];return _0x2db137;};'use strict';var Sequelize=require(_0xcc6d('0x0'));module[_0xcc6d('0x1')]={'name':{'type':Sequelize[_0xcc6d('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xcc6d('0x3'),_0xcc6d('0x4'),_0xcc6d('0x5')),'allowNull':![],'defaultValue':_0xcc6d('0x3')},'description':{'type':Sequelize[_0xcc6d('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 24d3003..fc0d634 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 _0xc55e=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','destroy','then','get','Dispositions','UserProfileResource','end','stack','name','send','index','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','Disposition','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation'];(function(_0x1a659e,_0x419c03){var _0x372753=function(_0x2d4f7f){while(--_0x2d4f7f){_0x1a659e['push'](_0x1a659e['shift']());}};_0x372753(++_0x419c03);}(_0xc55e,0x146));var _0xec55=function(_0x3666ce,_0x3c5c82){_0x3666ce=_0x3666ce-0x0;var _0x164a73=_0xc55e[_0x3666ce];return _0x164a73;};'use strict';var emlformat=require(_0xec55('0x0'));var rimraf=require(_0xec55('0x1'));var zipdir=require(_0xec55('0x2'));var jsonpatch=require(_0xec55('0x3'));var rp=require(_0xec55('0x4'));var moment=require('moment');var BPromise=require(_0xec55('0x5'));var Mustache=require(_0xec55('0x6'));var util=require(_0xec55('0x7'));var path=require(_0xec55('0x8'));var sox=require(_0xec55('0x9'));var csv=require('to-csv');var ejs=require(_0xec55('0xa'));var fs=require('fs');var fs_extra=require(_0xec55('0xb'));var _=require(_0xec55('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xec55('0xd'));var toCsv=require(_0xec55('0xe'));var querystring=require(_0xec55('0xf'));var Papa=require(_0xec55('0x10'));var Redis=require(_0xec55('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xec55('0x12'));var as=require(_0xec55('0x13'));var hardwareService=require(_0xec55('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xec55('0x15'));var licenseUtil=require(_0xec55('0x16'));var db=require(_0xec55('0x17'))['db'];function respondWithStatusCode(_0x5dc831,_0x32042f){_0x32042f=_0x32042f||0xcc;return function(_0x12a687){if(_0x12a687){return _0x5dc831[_0xec55('0x18')](_0x32042f);}return _0x5dc831[_0xec55('0x19')](_0x32042f)['end']();};}function respondWithResult(_0x308c39,_0x5f0a85){_0x5f0a85=_0x5f0a85||0xc8;return function(_0x2faa9d){if(_0x2faa9d){return _0x308c39[_0xec55('0x19')](_0x5f0a85)[_0xec55('0x1a')](_0x2faa9d);}};}function respondWithFilteredResult(_0x5747e7,_0x23916a){return function(_0x10de6a){if(_0x10de6a){var _0x249f73=typeof _0x23916a['offset']===_0xec55('0x1b')&&typeof _0x23916a[_0xec55('0x1c')]===_0xec55('0x1b');var _0x3b471c=_0x10de6a[_0xec55('0x1d')];var _0x5abb76=_0x249f73?0x0:_0x23916a[_0xec55('0x1e')];var _0x1ab4d2=_0x249f73?_0x10de6a[_0xec55('0x1d')]:_0x23916a['offset']+_0x23916a[_0xec55('0x1c')];var _0x25adea;if(_0x1ab4d2>=_0x3b471c){_0x1ab4d2=_0x3b471c;_0x25adea=0xc8;}else{_0x25adea=0xce;}_0x5747e7[_0xec55('0x19')](_0x25adea);return _0x5747e7['set'](_0xec55('0x1f'),_0x5abb76+'-'+_0x1ab4d2+'/'+_0x3b471c)[_0xec55('0x1a')](_0x10de6a);}return null;};}function patchUpdates(_0x5c1b03){return function(_0x3c8871){try{jsonpatch['apply'](_0x3c8871,_0x5c1b03,!![]);}catch(_0x568a36){return BPromise[_0xec55('0x20')](_0x568a36);}return _0x3c8871[_0xec55('0x21')]();};}function saveUpdates(_0x2c9eb1,_0x9a9d38){return function(_0x21f335){if(_0x21f335){return _0x21f335['update'](_0x2c9eb1)['then'](function(_0x368d09){return _0x368d09;});}return null;};}function removeEntity(_0x43aca0,_0x5ce959){return function(_0x18b5d6){if(_0x18b5d6){return _0x18b5d6[_0xec55('0x22')]()[_0xec55('0x23')](function(){var _0x1cec0a=_0x18b5d6[_0xec55('0x24')]({'plain':!![]});var _0x197cc9=_0xec55('0x25');return db[_0xec55('0x26')]['destroy']({'where':{'type':_0x197cc9,'resourceId':_0x1cec0a['id']}})['then'](function(){return _0x18b5d6;});})[_0xec55('0x23')](function(){_0x43aca0[_0xec55('0x19')](0xcc)[_0xec55('0x27')]();});}};}function handleEntityNotFound(_0x238f48,_0x5c6588){return function(_0x38f7fb){if(!_0x38f7fb){_0x238f48[_0xec55('0x18')](0x194);}return _0x38f7fb;};}function handleError(_0x8e6c9f,_0x19c7d4){_0x19c7d4=_0x19c7d4||0x1f4;return function(_0x3fd7ef){logger['error'](_0x3fd7ef[_0xec55('0x28')]);if(_0x3fd7ef['name']){delete _0x3fd7ef[_0xec55('0x29')];}_0x8e6c9f[_0xec55('0x19')](_0x19c7d4)[_0xec55('0x2a')](_0x3fd7ef);};}exports[_0xec55('0x2b')]=function(_0x25e6c9,_0x1830a4){var _0x48b406={},_0x35f522={},_0x1ad344={'count':0x0,'rows':[]};var _0x378ded=_['map'](db['Disposition']['rawAttributes'],function(_0x110957){return{'name':_0x110957['fieldName'],'type':_0x110957['type'][_0xec55('0x2c')]};});_0x35f522['model']=_[_0xec55('0x2d')](_0x378ded,'name');_0x35f522[_0xec55('0x2e')]=_[_0xec55('0x2f')](_0x25e6c9[_0xec55('0x2e')]);_0x35f522[_0xec55('0x30')]=_[_0xec55('0x31')](_0x35f522['model'],_0x35f522[_0xec55('0x2e')]);_0x48b406[_0xec55('0x32')]=_[_0xec55('0x31')](_0x35f522['model'],qs[_0xec55('0x33')](_0x25e6c9[_0xec55('0x2e')][_0xec55('0x33')]));_0x48b406[_0xec55('0x32')]=_0x48b406[_0xec55('0x32')][_0xec55('0x34')]?_0x48b406[_0xec55('0x32')]:_0x35f522[_0xec55('0x35')];if(!_0x25e6c9['query'][_0xec55('0x36')]('nolimit')){_0x48b406[_0xec55('0x1c')]=qs['limit'](_0x25e6c9[_0xec55('0x2e')][_0xec55('0x1c')]);_0x48b406[_0xec55('0x1e')]=qs['offset'](_0x25e6c9[_0xec55('0x2e')]['offset']);}_0x48b406['order']=qs['sort'](_0x25e6c9['query'][_0xec55('0x37')]);_0x48b406[_0xec55('0x38')]=qs[_0xec55('0x30')](_[_0xec55('0x39')](_0x25e6c9[_0xec55('0x2e')],_0x35f522[_0xec55('0x30')]),_0x378ded);if(_0x25e6c9[_0xec55('0x2e')][_0xec55('0x3a')]){_0x48b406[_0xec55('0x38')]=_['merge'](_0x48b406['where'],{'$or':_['map'](_0x378ded,function(_0x522bcf){if(_0x522bcf[_0xec55('0x3b')]!==_0xec55('0x3c')){var _0x3afb95={};_0x3afb95[_0x522bcf['name']]={'$like':'%'+_0x25e6c9[_0xec55('0x2e')]['filter']+'%'};return _0x3afb95;}})});}_0x48b406=_[_0xec55('0x3d')]({},_0x48b406,_0x25e6c9['options']);var _0x192a0d={'where':_0x48b406[_0xec55('0x38')]};return db[_0xec55('0x3e')][_0xec55('0x1d')](_0x192a0d)[_0xec55('0x23')](function(_0x152168){_0x1ad344[_0xec55('0x1d')]=_0x152168;if(_0x25e6c9[_0xec55('0x2e')][_0xec55('0x3f')]){_0x48b406[_0xec55('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xec55('0x41')](_0x48b406);})[_0xec55('0x23')](function(_0x459f28){_0x1ad344['rows']=_0x459f28;return _0x1ad344;})[_0xec55('0x23')](respondWithFilteredResult(_0x1830a4,_0x48b406))[_0xec55('0x42')](handleError(_0x1830a4,null));};exports[_0xec55('0x43')]=function(_0x57a570,_0x563b68){var _0x4e30c4={'raw':!![],'where':{'id':_0x57a570[_0xec55('0x44')]['id']}},_0x4d72fe={};_0x4d72fe['model']=_[_0xec55('0x2f')](db[_0xec55('0x3e')][_0xec55('0x45')]);_0x4d72fe[_0xec55('0x2e')]=_['keys'](_0x57a570['query']);_0x4d72fe[_0xec55('0x30')]=_[_0xec55('0x31')](_0x4d72fe['model'],_0x4d72fe[_0xec55('0x2e')]);_0x4e30c4['attributes']=_[_0xec55('0x31')](_0x4d72fe[_0xec55('0x35')],qs[_0xec55('0x33')](_0x57a570['query'][_0xec55('0x33')]));_0x4e30c4['attributes']=_0x4e30c4['attributes'][_0xec55('0x34')]?_0x4e30c4[_0xec55('0x32')]:_0x4d72fe[_0xec55('0x35')];if(_0x57a570['query']['includeAll']){_0x4e30c4['include']=[{'all':!![]}];}_0x4e30c4=_[_0xec55('0x3d')]({},_0x4e30c4,_0x57a570[_0xec55('0x46')]);return db[_0xec55('0x3e')][_0xec55('0x47')](_0x4e30c4)[_0xec55('0x23')](handleEntityNotFound(_0x563b68,null))[_0xec55('0x23')](respondWithResult(_0x563b68,null))[_0xec55('0x42')](handleError(_0x563b68,null));};exports[_0xec55('0x48')]=function(_0x1cb602,_0x4d54db){return db['Disposition'][_0xec55('0x48')](_0x1cb602[_0xec55('0x49')],{})['then'](function(_0xcb63aa){var _0x340a6f=_0x1cb602['user'][_0xec55('0x24')]({'plain':!![]});if(!_0x340a6f)throw new Error(_0xec55('0x4a'));if(_0x340a6f[_0xec55('0x4b')]===_0xec55('0x4c')){var _0x2b0812=_0xcb63aa[_0xec55('0x24')]({'plain':!![]});var _0x11a776='Dispositions';return db[_0xec55('0x4d')][_0xec55('0x47')]({'where':{'name':_0x11a776,'userProfileId':_0x340a6f['userProfileId']},'raw':!![]})[_0xec55('0x23')](function(_0x30e5d8){if(_0x30e5d8&&_0x30e5d8[_0xec55('0x4e')]===0x0){return db[_0xec55('0x26')][_0xec55('0x48')]({'name':_0x2b0812[_0xec55('0x29')],'resourceId':_0x2b0812['id'],'type':_0x30e5d8[_0xec55('0x29')],'sectionId':_0x30e5d8['id']},{})['then'](function(){return _0xcb63aa;});}else{return _0xcb63aa;}})[_0xec55('0x42')](function(_0x1f4578){logger['error'](_0xec55('0x4f'),_0x1f4578);throw _0x1f4578;});}return _0xcb63aa;})[_0xec55('0x23')](respondWithResult(_0x4d54db,0xc9))[_0xec55('0x42')](handleError(_0x4d54db,null));};exports[_0xec55('0x50')]=function(_0x1ce047,_0x4b972d){if(_0x1ce047[_0xec55('0x49')]['id']){delete _0x1ce047[_0xec55('0x49')]['id'];}return db[_0xec55('0x3e')][_0xec55('0x47')]({'where':{'id':_0x1ce047[_0xec55('0x44')]['id']}})[_0xec55('0x23')](handleEntityNotFound(_0x4b972d,null))['then'](saveUpdates(_0x1ce047[_0xec55('0x49')],null))[_0xec55('0x23')](respondWithResult(_0x4b972d,null))[_0xec55('0x42')](handleError(_0x4b972d,null));};exports['destroy']=function(_0x8a4888,_0x59d7df){return db[_0xec55('0x3e')]['find']({'where':{'id':_0x8a4888[_0xec55('0x44')]['id']}})['then'](handleEntityNotFound(_0x59d7df,null))[_0xec55('0x23')](removeEntity(_0x59d7df,null))[_0xec55('0x42')](handleError(_0x59d7df,null));}; \ No newline at end of file +var _0xdcb8=['destroy','then','sendStatus','error','name','send','map','Disposition','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','merge','includeAll','include','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Dispositions'];(function(_0x2e68db,_0x275d04){var _0x12df4c=function(_0x1b6701){while(--_0x1b6701){_0x2e68db['push'](_0x2e68db['shift']());}};_0x12df4c(++_0x275d04);}(_0xdcb8,0x7a));var _0x8dcb=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdcb8[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dcb('0x0'));var zipdir=require(_0x8dcb('0x1'));var jsonpatch=require(_0x8dcb('0x2'));var rp=require('request-promise');var moment=require(_0x8dcb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8dcb('0x4'));var util=require('util');var path=require(_0x8dcb('0x5'));var sox=require(_0x8dcb('0x6'));var csv=require(_0x8dcb('0x7'));var ejs=require(_0x8dcb('0x8'));var fs=require('fs');var fs_extra=require(_0x8dcb('0x9'));var _=require(_0x8dcb('0xa'));var squel=require(_0x8dcb('0xb'));var crypto=require(_0x8dcb('0xc'));var jsforce=require(_0x8dcb('0xd'));var deskjs=require(_0x8dcb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8dcb('0xf'));var Redis=require(_0x8dcb('0x10'));var authService=require(_0x8dcb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8dcb('0x12'));var hardwareService=require(_0x8dcb('0x13'));var logger=require(_0x8dcb('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x8dcb('0x15'));var licenseUtil=require(_0x8dcb('0x16'));var db=require(_0x8dcb('0x17'))['db'];function respondWithStatusCode(_0x2f63e5,_0x3c64ba){_0x3c64ba=_0x3c64ba||0xcc;return function(_0x3ad21e){if(_0x3ad21e){return _0x2f63e5['sendStatus'](_0x3c64ba);}return _0x2f63e5[_0x8dcb('0x18')](_0x3c64ba)[_0x8dcb('0x19')]();};}function respondWithResult(_0x4088ba,_0x8884a3){_0x8884a3=_0x8884a3||0xc8;return function(_0x76a233){if(_0x76a233){return _0x4088ba[_0x8dcb('0x18')](_0x8884a3)[_0x8dcb('0x1a')](_0x76a233);}};}function respondWithFilteredResult(_0x486119,_0x592028){return function(_0x1192f0){if(_0x1192f0){var _0x506a21=typeof _0x592028['offset']==='undefined'&&typeof _0x592028[_0x8dcb('0x1b')]==='undefined';var _0x42030b=_0x1192f0[_0x8dcb('0x1c')];var _0x124139=_0x506a21?0x0:_0x592028[_0x8dcb('0x1d')];var _0x1969e0=_0x506a21?_0x1192f0['count']:_0x592028['offset']+_0x592028['limit'];var _0x6a92f9;if(_0x1969e0>=_0x42030b){_0x1969e0=_0x42030b;_0x6a92f9=0xc8;}else{_0x6a92f9=0xce;}_0x486119[_0x8dcb('0x18')](_0x6a92f9);return _0x486119[_0x8dcb('0x1e')](_0x8dcb('0x1f'),_0x124139+'-'+_0x1969e0+'/'+_0x42030b)['json'](_0x1192f0);}return null;};}function patchUpdates(_0x45594a){return function(_0x2470e9){try{jsonpatch[_0x8dcb('0x20')](_0x2470e9,_0x45594a,!![]);}catch(_0x5a1cc2){return BPromise[_0x8dcb('0x21')](_0x5a1cc2);}return _0x2470e9[_0x8dcb('0x22')]();};}function saveUpdates(_0x3404cf,_0x268093){return function(_0x844fe4){if(_0x844fe4){return _0x844fe4[_0x8dcb('0x23')](_0x3404cf)['then'](function(_0x57f658){return _0x57f658;});}return null;};}function removeEntity(_0x267ef3,_0x3d88fd){return function(_0x37502b){if(_0x37502b){return _0x37502b['destroy']()['then'](function(){var _0x26fb73=_0x37502b[_0x8dcb('0x24')]({'plain':!![]});var _0x21c305=_0x8dcb('0x25');return db['UserProfileResource'][_0x8dcb('0x26')]({'where':{'type':_0x21c305,'resourceId':_0x26fb73['id']}})['then'](function(){return _0x37502b;});})[_0x8dcb('0x27')](function(){_0x267ef3['status'](0xcc)[_0x8dcb('0x19')]();});}};}function handleEntityNotFound(_0x411bae,_0x3e7e11){return function(_0x2262f7){if(!_0x2262f7){_0x411bae[_0x8dcb('0x28')](0x194);}return _0x2262f7;};}function handleError(_0x509ce0,_0x315f65){_0x315f65=_0x315f65||0x1f4;return function(_0x1578bc){logger[_0x8dcb('0x29')](_0x1578bc['stack']);if(_0x1578bc[_0x8dcb('0x2a')]){delete _0x1578bc[_0x8dcb('0x2a')];}_0x509ce0[_0x8dcb('0x18')](_0x315f65)[_0x8dcb('0x2b')](_0x1578bc);};}exports['index']=function(_0x5d5f17,_0x40cddb){var _0x31b25b={},_0x26a392={},_0x5dc666={'count':0x0,'rows':[]};var _0x469fe2=_[_0x8dcb('0x2c')](db[_0x8dcb('0x2d')][_0x8dcb('0x2e')],function(_0x4af86d){return{'name':_0x4af86d['fieldName'],'type':_0x4af86d[_0x8dcb('0x2f')][_0x8dcb('0x30')]};});_0x26a392['model']=_['map'](_0x469fe2,'name');_0x26a392[_0x8dcb('0x31')]=_['keys'](_0x5d5f17[_0x8dcb('0x31')]);_0x26a392[_0x8dcb('0x32')]=_[_0x8dcb('0x33')](_0x26a392[_0x8dcb('0x34')],_0x26a392[_0x8dcb('0x31')]);_0x31b25b[_0x8dcb('0x35')]=_[_0x8dcb('0x33')](_0x26a392['model'],qs[_0x8dcb('0x36')](_0x5d5f17[_0x8dcb('0x31')]['fields']));_0x31b25b[_0x8dcb('0x35')]=_0x31b25b[_0x8dcb('0x35')][_0x8dcb('0x37')]?_0x31b25b[_0x8dcb('0x35')]:_0x26a392[_0x8dcb('0x34')];if(!_0x5d5f17[_0x8dcb('0x31')][_0x8dcb('0x38')]('nolimit')){_0x31b25b['limit']=qs[_0x8dcb('0x1b')](_0x5d5f17[_0x8dcb('0x31')][_0x8dcb('0x1b')]);_0x31b25b[_0x8dcb('0x1d')]=qs['offset'](_0x5d5f17[_0x8dcb('0x31')][_0x8dcb('0x1d')]);}_0x31b25b['order']=qs['sort'](_0x5d5f17[_0x8dcb('0x31')][_0x8dcb('0x39')]);_0x31b25b[_0x8dcb('0x3a')]=qs[_0x8dcb('0x32')](_[_0x8dcb('0x3b')](_0x5d5f17[_0x8dcb('0x31')],_0x26a392['filters']),_0x469fe2);if(_0x5d5f17[_0x8dcb('0x31')]['filter']){_0x31b25b[_0x8dcb('0x3a')]=_['merge'](_0x31b25b[_0x8dcb('0x3a')],{'$or':_[_0x8dcb('0x2c')](_0x469fe2,function(_0x2d9b4d){if(_0x2d9b4d[_0x8dcb('0x2f')]!==_0x8dcb('0x3c')){var _0x453078={};_0x453078[_0x2d9b4d[_0x8dcb('0x2a')]]={'$like':'%'+_0x5d5f17['query']['filter']+'%'};return _0x453078;}})});}_0x31b25b=_[_0x8dcb('0x3d')]({},_0x31b25b,_0x5d5f17['options']);var _0x4634d2={'where':_0x31b25b['where']};return db['Disposition'][_0x8dcb('0x1c')](_0x4634d2)[_0x8dcb('0x27')](function(_0x5e4986){_0x5dc666[_0x8dcb('0x1c')]=_0x5e4986;if(_0x5d5f17['query'][_0x8dcb('0x3e')]){_0x31b25b[_0x8dcb('0x3f')]=[{'all':!![]}];}return db[_0x8dcb('0x2d')]['findAll'](_0x31b25b);})['then'](function(_0x1ecd3f){_0x5dc666[_0x8dcb('0x40')]=_0x1ecd3f;return _0x5dc666;})[_0x8dcb('0x27')](respondWithFilteredResult(_0x40cddb,_0x31b25b))[_0x8dcb('0x41')](handleError(_0x40cddb,null));};exports[_0x8dcb('0x42')]=function(_0x512816,_0x1c915f){var _0x2d2ee0={'raw':!![],'where':{'id':_0x512816[_0x8dcb('0x43')]['id']}},_0x4e343d={};_0x4e343d[_0x8dcb('0x34')]=_[_0x8dcb('0x44')](db[_0x8dcb('0x2d')]['rawAttributes']);_0x4e343d[_0x8dcb('0x31')]=_[_0x8dcb('0x44')](_0x512816[_0x8dcb('0x31')]);_0x4e343d[_0x8dcb('0x32')]=_[_0x8dcb('0x33')](_0x4e343d[_0x8dcb('0x34')],_0x4e343d['query']);_0x2d2ee0[_0x8dcb('0x35')]=_[_0x8dcb('0x33')](_0x4e343d[_0x8dcb('0x34')],qs[_0x8dcb('0x36')](_0x512816[_0x8dcb('0x31')][_0x8dcb('0x36')]));_0x2d2ee0[_0x8dcb('0x35')]=_0x2d2ee0[_0x8dcb('0x35')][_0x8dcb('0x37')]?_0x2d2ee0[_0x8dcb('0x35')]:_0x4e343d[_0x8dcb('0x34')];if(_0x512816[_0x8dcb('0x31')][_0x8dcb('0x3e')]){_0x2d2ee0[_0x8dcb('0x3f')]=[{'all':!![]}];}_0x2d2ee0=_[_0x8dcb('0x3d')]({},_0x2d2ee0,_0x512816['options']);return db[_0x8dcb('0x2d')][_0x8dcb('0x45')](_0x2d2ee0)[_0x8dcb('0x27')](handleEntityNotFound(_0x1c915f,null))['then'](respondWithResult(_0x1c915f,null))['catch'](handleError(_0x1c915f,null));};exports[_0x8dcb('0x46')]=function(_0x1404b6,_0x5938f2){return db[_0x8dcb('0x2d')][_0x8dcb('0x46')](_0x1404b6['body'],{})[_0x8dcb('0x27')](function(_0x427585){var _0x12418f=_0x1404b6[_0x8dcb('0x47')][_0x8dcb('0x24')]({'plain':!![]});if(!_0x12418f)throw new Error(_0x8dcb('0x48'));if(_0x12418f[_0x8dcb('0x49')]===_0x8dcb('0x47')){var _0x388189=_0x427585['get']({'plain':!![]});var _0x5c7803=_0x8dcb('0x25');return db[_0x8dcb('0x4a')][_0x8dcb('0x45')]({'where':{'name':_0x5c7803,'userProfileId':_0x12418f[_0x8dcb('0x4b')]},'raw':!![]})[_0x8dcb('0x27')](function(_0x555d57){if(_0x555d57&&_0x555d57[_0x8dcb('0x4c')]===0x0){return db[_0x8dcb('0x4d')]['create']({'name':_0x388189[_0x8dcb('0x2a')],'resourceId':_0x388189['id'],'type':_0x555d57['name'],'sectionId':_0x555d57['id']},{})[_0x8dcb('0x27')](function(){return _0x427585;});}else{return _0x427585;}})['catch'](function(_0x3b179f){logger[_0x8dcb('0x29')](_0x8dcb('0x4e'),_0x3b179f);throw _0x3b179f;});}return _0x427585;})[_0x8dcb('0x27')](respondWithResult(_0x5938f2,0xc9))['catch'](handleError(_0x5938f2,null));};exports[_0x8dcb('0x23')]=function(_0x4dfe5a,_0x26bf7b){if(_0x4dfe5a[_0x8dcb('0x4f')]['id']){delete _0x4dfe5a[_0x8dcb('0x4f')]['id'];}return db[_0x8dcb('0x2d')][_0x8dcb('0x45')]({'where':{'id':_0x4dfe5a[_0x8dcb('0x43')]['id']}})[_0x8dcb('0x27')](handleEntityNotFound(_0x26bf7b,null))[_0x8dcb('0x27')](saveUpdates(_0x4dfe5a['body'],null))['then'](respondWithResult(_0x26bf7b,null))['catch'](handleError(_0x26bf7b,null));};exports['destroy']=function(_0x5a3ceb,_0x1c378a){return db[_0x8dcb('0x2d')]['find']({'where':{'id':_0x5a3ceb[_0x8dcb('0x43')]['id']}})[_0x8dcb('0x27')](handleEntityNotFound(_0x1c378a,null))[_0x8dcb('0x27')](removeEntity(_0x1c378a,null))[_0x8dcb('0x41')](handleError(_0x1c378a,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 36e1ede..92009cb 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 _0xb76b=['OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','FaxAccountId','name_openchannel'];(function(_0x44fffe,_0x330dd8){var _0x7f0797=function(_0x3ababd){while(--_0x3ababd){_0x44fffe['push'](_0x44fffe['shift']());}};_0x7f0797(++_0x330dd8);}(_0xb76b,0x12f));var _0xbb76=function(_0x4ffac1,_0x4a5eaa){_0x4ffac1=_0x4ffac1-0x0;var _0x381eca=_0xb76b[_0x4ffac1];return _0x381eca;};'use strict';var _=require('lodash');var util=require(_0xbb76('0x0'));var logger=require(_0xbb76('0x1'))(_0xbb76('0x2'));var moment=require('moment');var BPromise=require(_0xbb76('0x3'));var rp=require(_0xbb76('0x4'));var fs=require('fs');var path=require(_0xbb76('0x5'));var rimraf=require(_0xbb76('0x6'));var config=require(_0xbb76('0x7'));var attributes=require(_0xbb76('0x8'));module[_0xbb76('0x9')]=function(_0x789165,_0x2a98c0){return _0x789165[_0xbb76('0xa')]('Disposition',attributes,{'tableName':_0xbb76('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xbb76('0xc'),'fields':['name',_0xbb76('0xd')]},{'unique':!![],'name':_0xbb76('0xe'),'fields':[_0xbb76('0xf'),_0xbb76('0x10')]},{'unique':!![],'name':_0xbb76('0x11'),'fields':[_0xbb76('0xf'),_0xbb76('0x12')]},{'unique':!![],'name':_0xbb76('0x13'),'fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0xbb76('0xf'),_0xbb76('0x14')]},{'unique':!![],'name':_0xbb76('0x15'),'fields':[_0xbb76('0xf'),_0xbb76('0x16')]},{'unique':!![],'name':_0xbb76('0x17'),'fields':['name',_0xbb76('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8858=['define','Disposition','tools_dispositions','name_voice','ListId','ChatWebsiteId','name','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','../../config/logger','bluebird','path','../../config/environment','./disposition.attributes','exports'];(function(_0x315d32,_0x33485b){var _0x3ea98d=function(_0x4111ee){while(--_0x4111ee){_0x315d32['push'](_0x315d32['shift']());}};_0x3ea98d(++_0x33485b);}(_0x8858,0x99));var _0x8885=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8858[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8885('0x0'));var util=require('util');var logger=require(_0x8885('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8885('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8885('0x3'));var rimraf=require('rimraf');var config=require(_0x8885('0x4'));var attributes=require(_0x8885('0x5'));module[_0x8885('0x6')]=function(_0x37d2cc,_0x5ec9c3){return _0x37d2cc[_0x8885('0x7')](_0x8885('0x8'),attributes,{'tableName':_0x8885('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8885('0xa'),'fields':['name',_0x8885('0xb')]},{'unique':!![],'name':'name_chat','fields':['name',_0x8885('0xc')]},{'unique':!![],'name':'name_mail','fields':[_0x8885('0xd'),_0x8885('0xe')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0x8885('0xf'),'fields':['name',_0x8885('0x10')]},{'unique':!![],'name':_0x8885('0x11'),'fields':[_0x8885('0xd'),_0x8885('0x12')]},{'unique':!![],'name':_0x8885('0x13'),'fields':[_0x8885('0xd'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 9bd3ac9..e253f6d 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(_0x335072,_0x2a89db){var _0x5d719a=function(_0x741647){while(--_0x741647){_0x335072['push'](_0x335072['shift']());}};_0x5d719a(++_0x2a89db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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(_0x402de8,_0x2f0785){var _0x5d245a=function(_0x5a488e){while(--_0x5a488e){_0x402de8['push'](_0x402de8['shift']());}};_0x5d245a(++_0x2f0785);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 0838264..f4c0200 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 _0x966f=['/:id','update','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','post','create','put'];(function(_0x3ef984,_0x3f5981){var _0x578b03=function(_0x112d2f){while(--_0x112d2f){_0x3ef984['push'](_0x3ef984['shift']());}};_0x578b03(++_0x3f5981);}(_0x966f,0x6d));var _0xf966=function(_0xdbde45,_0x36f38a){_0xdbde45=_0xdbde45-0x0;var _0x34a95a=_0x966f[_0xdbde45];return _0x34a95a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf966('0x0'));var express=require(_0xf966('0x1'));var router=express[_0xf966('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf966('0x3'));var interaction=require(_0xf966('0x4'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xf966('0x5')]('/',auth['isAuthenticated'](),controller[_0xf966('0x6')]);router[_0xf966('0x5')]('/:id',auth[_0xf966('0x7')](),controller['show']);router[_0xf966('0x8')]('/',auth['isAuthenticated'](),controller[_0xf966('0x9')]);router[_0xf966('0xa')](_0xf966('0xb'),auth[_0xf966('0x7')](),controller[_0xf966('0xc')]);router['delete'](_0xf966('0xb'),auth[_0xf966('0x7')](),controller[_0xf966('0xd')]);module[_0xf966('0xe')]=router; \ No newline at end of file +var _0x3924=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','post','create','put','delete','/:id','destroy','exports','multer','path'];(function(_0x1aac86,_0x3621e4){var _0x7b7d65=function(_0x4c56f6){while(--_0x4c56f6){_0x1aac86['push'](_0x1aac86['shift']());}};_0x7b7d65(++_0x3621e4);}(_0x3924,0x1eb));var _0x4392=function(_0x16e3f1,_0x1500ab){_0x16e3f1=_0x16e3f1-0x0;var _0x391a46=_0x3924[_0x16e3f1];return _0x391a46;};'use strict';var multer=require(_0x4392('0x0'));var util=require('util');var path=require(_0x4392('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4392('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4392('0x3'));var interaction=require(_0x4392('0x4'));var config=require(_0x4392('0x5'));var controller=require(_0x4392('0x6'));router[_0x4392('0x7')]('/',auth[_0x4392('0x8')](),controller[_0x4392('0x9')]);router[_0x4392('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4392('0xa')]('/',auth[_0x4392('0x8')](),controller[_0x4392('0xb')]);router[_0x4392('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4392('0xd')](_0x4392('0xe'),auth[_0x4392('0x8')](),controller[_0x4392('0xf')]);module[_0x4392('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 83321cb..adf00cb 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 _0xaa44=['4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400'];(function(_0x582995,_0x55a862){var _0x322b86=function(_0x5e7130){while(--_0x5e7130){_0x582995['push'](_0x582995['shift']());}};_0x322b86(++_0x55a862);}(_0xaa44,0x1c6));var _0x4aa4=function(_0xb90b25,_0x3cbb10){_0xb90b25=_0xb90b25-0x0;var _0x3b98e9=_0xaa44[_0xb90b25];return _0x3b98e9;};'use strict';var Sequelize=require(_0x4aa4('0x0'));module[_0x4aa4('0x1')]={'name':{'type':Sequelize[_0x4aa4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4aa4('0x2')]},'ecm':{'type':Sequelize[_0x4aa4('0x3')](_0x4aa4('0x4'),'no'),'defaultValue':_0x4aa4('0x4')},'headerinfo':{'type':Sequelize[_0x4aa4('0x2')],'defaultValue':_0x4aa4('0x5')},'localstationid':{'type':Sequelize[_0x4aa4('0x2')],'unique':_0x4aa4('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x4aa4('0x7'),_0x4aa4('0x8'),_0x4aa4('0x9'),_0x4aa4('0xa'),_0x4aa4('0xb'),'14400'),'defaultValue':_0x4aa4('0x8')},'maxrate':{'type':Sequelize[_0x4aa4('0x3')](_0x4aa4('0x7'),_0x4aa4('0x8'),_0x4aa4('0x9'),'9600','12000',_0x4aa4('0xc')),'defaultValue':_0x4aa4('0xc')},'modem':{'type':Sequelize[_0x4aa4('0x2')],'defaultValue':_0x4aa4('0xd')},'gateway':{'type':Sequelize[_0x4aa4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4aa4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4aa4('0x3')](_0x4aa4('0xe'),_0x4aa4('0xf'),_0x4aa4('0x10'),_0x4aa4('0x11')),'defaultValue':_0x4aa4('0xe')},'key':{'type':Sequelize[_0x4aa4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4aa4('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4aa4('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4aa4('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4aa4('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x4aa4('0x12')],'defaultValue':![],'comment':_0x4aa4('0x14'),'set':function(_0x2e8c2a){if(!_0x2e8c2a)this['setDataValue'](_0x4aa4('0x15'),null);this['setDataValue']('mandatoryDisposition',_0x2e8c2a);}}}; \ No newline at end of file +var _0xb83f=['INTEGER','SIP','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600','14400','ENUM','12000','v17,v27,v29'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb83f,0x135));var _0xfb83=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xb83f[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0xfb83('0x0'));module[_0xfb83('0x1')]={'name':{'type':Sequelize[_0xfb83('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb83('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xfb83('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xfb83('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0xfb83('0x5'),_0xfb83('0x6'),_0xfb83('0x7'),_0xfb83('0x8'),'12000',_0xfb83('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xfb83('0xa')](_0xfb83('0x5'),_0xfb83('0x6'),_0xfb83('0x7'),'9600',_0xfb83('0xb'),'14400'),'defaultValue':_0xfb83('0x9')},'modem':{'type':Sequelize[_0xfb83('0x2')],'defaultValue':_0xfb83('0xc')},'gateway':{'type':Sequelize[_0xfb83('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xfb83('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xfb83('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xfb83('0xa')](_0xfb83('0xe'),_0xfb83('0xf'),'DADHI','KHOMP'),'defaultValue':_0xfb83('0xe')},'key':{'type':Sequelize[_0xfb83('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfb83('0x10')],'defaultValue':function(){return _0xfb83('0x11');}},'notificationSound':{'type':Sequelize[_0xfb83('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb83('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb83('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb83('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfb83('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb83('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb83('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xfb83('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xfb83('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1480c0){if(!_0x1480c0)this['setDataValue'](_0xfb83('0x14'),null);this[_0xfb83('0x15')](_0xfb83('0x16'),_0x1480c0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 2933e10..428305a 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 _0x9edc=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','rawAttributes','pick','includeAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','order','removeAnswers','addInteraction','omit','FaxInteraction','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','app','system','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','DESC','attachments','root','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','client','http','then','info','FaxAccount,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','send','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','Pause','find','create'];(function(_0x40557d,_0x5a48eb){var _0x2db316=function(_0x344620){while(--_0x344620){_0x40557d['push'](_0x40557d['shift']());}};_0x2db316(++_0x5a48eb);}(_0x9edc,0x66));var _0xc9ed=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x9edc[_0x555069];return _0x100af7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9ed('0x0'));var zipdir=require(_0xc9ed('0x1'));var jsonpatch=require(_0xc9ed('0x2'));var rp=require(_0xc9ed('0x3'));var moment=require('moment');var BPromise=require(_0xc9ed('0x4'));var Mustache=require(_0xc9ed('0x5'));var util=require(_0xc9ed('0x6'));var path=require(_0xc9ed('0x7'));var sox=require(_0xc9ed('0x8'));var csv=require(_0xc9ed('0x9'));var ejs=require(_0xc9ed('0xa'));var fs=require('fs');var fs_extra=require(_0xc9ed('0xb'));var _=require(_0xc9ed('0xc'));var squel=require(_0xc9ed('0xd'));var crypto=require(_0xc9ed('0xe'));var jsforce=require(_0xc9ed('0xf'));var deskjs=require(_0xc9ed('0x10'));var toCsv=require(_0xc9ed('0x9'));var querystring=require(_0xc9ed('0x11'));var Papa=require('papaparse');var Redis=require(_0xc9ed('0x12'));var authService=require(_0xc9ed('0x13'));var qs=require(_0xc9ed('0x14'));var as=require(_0xc9ed('0x15'));var hardwareService=require(_0xc9ed('0x16'));var logger=require(_0xc9ed('0x17'))(_0xc9ed('0x18'));var utils=require(_0xc9ed('0x19'));var config=require(_0xc9ed('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9ed('0x1b'))['db'];config['redis']=_[_0xc9ed('0x1c')](config[_0xc9ed('0x1d')],{'host':_0xc9ed('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc9ed('0x1d')]));require(_0xc9ed('0x1f'))[_0xc9ed('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc9ed('0x21')][_0xc9ed('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xc9ed('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5fdff8,_0x3cd7d0,_0x38fae1,_0x4ebe30){return new BPromise(function(_0x123e5b,_0x3600a6){var _0xdd299f=_0x4ebe30||client;return _0xdd299f['request'](_0x5fdff8,_0x38fae1)[_0xc9ed('0x23')](function(_0xc6621f){logger[_0xc9ed('0x24')](_0xc9ed('0x25'),_0x3cd7d0,'request\x20sent');logger[_0xc9ed('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3cd7d0,'request\x20sent',JSON[_0xc9ed('0x27')](_0xc6621f));if(_0xc6621f['error']){if(_0xc6621f['error'][_0xc9ed('0x28')]===0x1f4){logger[_0xc9ed('0x29')](_0xc9ed('0x25'),_0x3cd7d0,_0xc6621f['error'][_0xc9ed('0x2a')]);return _0x3600a6(_0xc6621f[_0xc9ed('0x29')][_0xc9ed('0x2a')]);}logger[_0xc9ed('0x29')](_0xc9ed('0x25'),_0x3cd7d0,_0xc6621f[_0xc9ed('0x29')][_0xc9ed('0x2a')]);return _0x123e5b(_0xc6621f['error'][_0xc9ed('0x2a')]);}else{logger[_0xc9ed('0x24')](_0xc9ed('0x25'),_0x3cd7d0,_0xc9ed('0x2b'));_0x123e5b(_0xc6621f[_0xc9ed('0x2c')]['message']);}})[_0xc9ed('0x2d')](function(_0x188771){logger[_0xc9ed('0x29')](_0xc9ed('0x25'),_0x3cd7d0,_0x188771);_0x3600a6(_0x188771);});});}function respondWithStatusCode(_0x1b3500,_0x375a7b){_0x375a7b=_0x375a7b||0xcc;return function(_0x3c6e6f){if(_0x3c6e6f){return _0x1b3500[_0xc9ed('0x2e')](_0x375a7b);}return _0x1b3500[_0xc9ed('0x2f')](_0x375a7b)[_0xc9ed('0x30')]();};}function respondWithResult(_0x5b5106,_0xc4108d){_0xc4108d=_0xc4108d||0xc8;return function(_0x50b64f){if(_0x50b64f){return _0x5b5106[_0xc9ed('0x2f')](_0xc4108d)[_0xc9ed('0x31')](_0x50b64f);}};}function respondWithFilteredResult(_0x3b4227,_0x2eaf98){return function(_0x351cdc){if(_0x351cdc){var _0x45dbcc=typeof _0x2eaf98[_0xc9ed('0x32')]===_0xc9ed('0x33')&&typeof _0x2eaf98['limit']===_0xc9ed('0x33');var _0x413755=_0x351cdc[_0xc9ed('0x34')];var _0x39b08a=_0x45dbcc?0x0:_0x2eaf98['offset'];var _0x4004f1=_0x45dbcc?_0x351cdc[_0xc9ed('0x34')]:_0x2eaf98[_0xc9ed('0x32')]+_0x2eaf98[_0xc9ed('0x35')];var _0x30255a;if(_0x4004f1>=_0x413755){_0x4004f1=_0x413755;_0x30255a=0xc8;}else{_0x30255a=0xce;}_0x3b4227[_0xc9ed('0x2f')](_0x30255a);return _0x3b4227['set']('Content-Range',_0x39b08a+'-'+_0x4004f1+'/'+_0x413755)[_0xc9ed('0x31')](_0x351cdc);}return null;};}function patchUpdates(_0x1a0810){return function(_0x27b290){try{jsonpatch[_0xc9ed('0x36')](_0x27b290,_0x1a0810,!![]);}catch(_0x4b94e4){return BPromise[_0xc9ed('0x37')](_0x4b94e4);}return _0x27b290[_0xc9ed('0x38')]();};}function saveUpdates(_0x4365fa,_0x1df99f){return function(_0x237f6a){if(_0x237f6a){return _0x237f6a[_0xc9ed('0x39')](_0x4365fa)[_0xc9ed('0x23')](function(_0x38cd94){return _0x38cd94;});}return null;};}function removeEntity(_0x199a9d,_0x25aa89){return function(_0x4dab4a){if(_0x4dab4a){return _0x4dab4a[_0xc9ed('0x3a')]()[_0xc9ed('0x23')](function(){var _0x32533f=_0x4dab4a[_0xc9ed('0x3b')]({'plain':!![]});var _0x108a6c=_0xc9ed('0x3c');return db[_0xc9ed('0x3d')][_0xc9ed('0x3a')]({'where':{'type':_0x108a6c,'resourceId':_0x32533f['id']}})[_0xc9ed('0x23')](function(){return _0x4dab4a;});})[_0xc9ed('0x23')](function(){_0x199a9d['status'](0xcc)[_0xc9ed('0x30')]();});}};}function handleEntityNotFound(_0x41192a,_0x1de891){return function(_0x329b70){if(!_0x329b70){_0x41192a[_0xc9ed('0x2e')](0x194);}return _0x329b70;};}function handleError(_0x2411d7,_0x32d99c){_0x32d99c=_0x32d99c||0x1f4;return function(_0xae4b52){logger[_0xc9ed('0x29')](_0xae4b52['stack']);if(_0xae4b52['name']){delete _0xae4b52['name'];}_0x2411d7[_0xc9ed('0x2f')](_0x32d99c)[_0xc9ed('0x3e')](_0xae4b52);};}exports['index']=function(_0x9ffc3,_0x3ea0a0){var _0x9b06f0={'include':[{'model':db['Pause'],'as':_0xc9ed('0x3f')}]},_0x540d7d={},_0x3f402d={'count':0x0,'rows':[]};var _0x304b97=_[_0xc9ed('0x40')](db[_0xc9ed('0x41')]['rawAttributes'],function(_0x434310){return{'name':_0x434310[_0xc9ed('0x42')],'type':_0x434310[_0xc9ed('0x43')][_0xc9ed('0x44')]};});_0x540d7d[_0xc9ed('0x45')]=_['map'](_0x304b97,_0xc9ed('0x46'));_0x540d7d[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x9ffc3[_0xc9ed('0x47')]);_0x540d7d[_0xc9ed('0x49')]=_[_0xc9ed('0x4a')](_0x540d7d['model'],_0x540d7d['query']);_0x9b06f0['attributes']=_[_0xc9ed('0x4a')](_0x540d7d[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x9b06f0[_0xc9ed('0x4c')]=_0x9b06f0[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x9b06f0[_0xc9ed('0x4c')]:_0x540d7d[_0xc9ed('0x45')];if(!_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x9b06f0['limit']=qs[_0xc9ed('0x35')](_0x9ffc3[_0xc9ed('0x47')]['limit']);_0x9b06f0[_0xc9ed('0x32')]=qs['offset'](_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x9b06f0['order']=qs[_0xc9ed('0x50')](_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x50')]);_0x9b06f0[_0xc9ed('0x51')]=qs[_0xc9ed('0x49')](_['pick'](_0x9ffc3[_0xc9ed('0x47')],_0x540d7d[_0xc9ed('0x49')]),_0x304b97);if(_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x9b06f0[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x9b06f0[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x304b97,function(_0x41b504){if(_0x41b504['type']!==_0xc9ed('0x54')){var _0x29138d={};_0x29138d[_0x41b504['name']]={'$like':'%'+_0x9ffc3[_0xc9ed('0x47')][_0xc9ed('0x52')]+'%'};return _0x29138d;}})});}_0x9b06f0=_[_0xc9ed('0x53')]({},_0x9b06f0,_0x9ffc3[_0xc9ed('0x55')]);var _0x407f3e={'where':_0x9b06f0[_0xc9ed('0x51')]};return db[_0xc9ed('0x41')][_0xc9ed('0x34')](_0x407f3e)['then'](function(_0x385e3a){_0x3f402d['count']=_0x385e3a;if(_0x9ffc3[_0xc9ed('0x47')]['includeAll']){_0x9b06f0[_0xc9ed('0x56')]=[{'all':!![]}];}return db[_0xc9ed('0x41')][_0xc9ed('0x57')](_0x9b06f0);})[_0xc9ed('0x23')](function(_0x3b5366){_0x3f402d[_0xc9ed('0x58')]=_0x3b5366;return _0x3f402d;})[_0xc9ed('0x23')](respondWithFilteredResult(_0x3ea0a0,_0x9b06f0))[_0xc9ed('0x2d')](handleError(_0x3ea0a0,null));};exports[_0xc9ed('0x59')]=function(_0x37de3d,_0x56d10c){var _0x175175={'raw':![],'where':{'id':_0x37de3d[_0xc9ed('0x5a')]['id']},'include':[{'model':db[_0xc9ed('0x5b')],'as':_0xc9ed('0x3f')}]},_0x363990={};_0x363990[_0xc9ed('0x45')]=_[_0xc9ed('0x48')](db[_0xc9ed('0x41')]['rawAttributes']);_0x363990['query']=_[_0xc9ed('0x48')](_0x37de3d[_0xc9ed('0x47')]);_0x363990['filters']=_[_0xc9ed('0x4a')](_0x363990['model'],_0x363990[_0xc9ed('0x47')]);_0x175175['attributes']=_[_0xc9ed('0x4a')](_0x363990[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x37de3d['query'][_0xc9ed('0x4b')]));_0x175175[_0xc9ed('0x4c')]=_0x175175[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x175175[_0xc9ed('0x4c')]:_0x363990[_0xc9ed('0x45')];if(_0x37de3d[_0xc9ed('0x47')]['includeAll']){_0x175175[_0xc9ed('0x56')]=[{'all':!![]}];}_0x175175=_[_0xc9ed('0x53')]({},_0x175175,_0x37de3d['options']);return db['FaxAccount'][_0xc9ed('0x5c')](_0x175175)['then'](handleEntityNotFound(_0x56d10c,null))[_0xc9ed('0x23')](respondWithResult(_0x56d10c,null))['catch'](handleError(_0x56d10c,null));};exports[_0xc9ed('0x5d')]=function(_0x26df5c,_0x5efc23){return db[_0xc9ed('0x41')][_0xc9ed('0x5d')](_0x26df5c[_0xc9ed('0x5e')],{})[_0xc9ed('0x23')](function(_0x694787){var _0x311b47=_0x26df5c[_0xc9ed('0x5f')][_0xc9ed('0x3b')]({'plain':!![]});if(!_0x311b47)throw new Error(_0xc9ed('0x60'));if(_0x311b47[_0xc9ed('0x61')]===_0xc9ed('0x5f')){var _0x522dfa=_0x694787[_0xc9ed('0x3b')]({'plain':!![]});var _0x799402=_0xc9ed('0x3c');return db['UserProfileSection'][_0xc9ed('0x5c')]({'where':{'name':_0x799402,'userProfileId':_0x311b47[_0xc9ed('0x62')]},'raw':!![]})[_0xc9ed('0x23')](function(_0x1e491e){if(_0x1e491e&&_0x1e491e[_0xc9ed('0x63')]===0x0){return db[_0xc9ed('0x3d')][_0xc9ed('0x5d')]({'name':_0x522dfa[_0xc9ed('0x46')],'resourceId':_0x522dfa['id'],'type':_0x1e491e[_0xc9ed('0x46')],'sectionId':_0x1e491e['id']},{})['then'](function(){return _0x694787;});}else{return _0x694787;}})[_0xc9ed('0x2d')](function(_0x42d52e){logger[_0xc9ed('0x29')](_0xc9ed('0x64'),_0x42d52e);throw _0x42d52e;});}return _0x694787;})['then'](respondWithResult(_0x5efc23,0xc9))[_0xc9ed('0x2d')](handleError(_0x5efc23,null));};exports[_0xc9ed('0x39')]=function(_0x300a7b,_0x518e55){if(_0x300a7b[_0xc9ed('0x5e')]['id']){delete _0x300a7b['body']['id'];}return db['FaxAccount'][_0xc9ed('0x5c')]({'where':{'id':_0x300a7b[_0xc9ed('0x5a')]['id']},'include':[{'model':db[_0xc9ed('0x5b')],'as':'mandatoryDispositionPause'}]})[_0xc9ed('0x23')](handleEntityNotFound(_0x518e55,null))['then'](saveUpdates(_0x300a7b[_0xc9ed('0x5e')],null))[_0xc9ed('0x23')](respondWithResult(_0x518e55,null))[_0xc9ed('0x2d')](handleError(_0x518e55,null));};exports['destroy']=function(_0x33131c,_0x1f7819){return db[_0xc9ed('0x41')][_0xc9ed('0x5c')]({'where':{'id':_0x33131c[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x1f7819,null))[_0xc9ed('0x23')](removeEntity(_0x1f7819,null))['catch'](handleError(_0x1f7819,null));};exports['describe']=function(_0x30b118,_0x5ee901){return db[_0xc9ed('0x41')][_0xc9ed('0x65')]()['then'](respondWithResult(_0x5ee901,null))[_0xc9ed('0x2d')](handleError(_0x5ee901,null));};exports[_0xc9ed('0x66')]=function(_0x20297a,_0x142219,_0x3e6176){if(_0x20297a[_0xc9ed('0x5e')]['id']){delete _0x20297a[_0xc9ed('0x5e')]['id'];}return db[_0xc9ed('0x41')][_0xc9ed('0x5c')]({'where':{'id':_0x20297a[_0xc9ed('0x5a')]['id']}})['then'](handleEntityNotFound(_0x142219,null))['then'](function(_0x3dd649){if(_0x3dd649){_0x20297a['body'][_0xc9ed('0x67')]=_0x3dd649['id'];return db[_0xc9ed('0x68')]['create'](_0x20297a[_0xc9ed('0x5e')]);}})[_0xc9ed('0x23')](respondWithResult(_0x142219,null))[_0xc9ed('0x2d')](handleError(_0x142219,null));};exports['getDispositions']=function(_0x3f0374,_0x3ad75b,_0x1b1887){var _0x56d2de={'raw':![],'where':{}};var _0x2f1b88={};var _0x484f85={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3f0374[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x3ad75b,null))[_0xc9ed('0x23')](function(_0x2e83f7){if(_0x2e83f7){_0x2f1b88[_0xc9ed('0x45')]=_['keys'](db[_0xc9ed('0x68')][_0xc9ed('0x69')]);_0x2f1b88[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x3f0374[_0xc9ed('0x47')]);_0x2f1b88[_0xc9ed('0x49')]=_[_0xc9ed('0x4a')](_0x2f1b88['model'],_0x2f1b88['query']);_0x56d2de['attributes']=_[_0xc9ed('0x4a')](_0x2f1b88['model'],qs[_0xc9ed('0x4b')](_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x56d2de[_0xc9ed('0x4c')]=_0x56d2de[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x56d2de[_0xc9ed('0x4c')]:_0x2f1b88[_0xc9ed('0x45')];if(!_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x56d2de[_0xc9ed('0x35')]=qs['limit'](_0x3f0374[_0xc9ed('0x47')]['limit']);_0x56d2de['offset']=qs[_0xc9ed('0x32')](_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x56d2de['order']=qs['sort'](_0x3f0374['query'][_0xc9ed('0x50')]);_0x56d2de[_0xc9ed('0x51')]=qs[_0xc9ed('0x49')](_[_0xc9ed('0x6a')](_0x3f0374[_0xc9ed('0x47')],_0x2f1b88['filters']));_0x56d2de['where'][_0xc9ed('0x67')]=_0x2e83f7['id'];if(_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x56d2de['where']=_[_0xc9ed('0x53')](_0x56d2de[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x56d2de[_0xc9ed('0x4c')],function(_0xdc98b4){var _0x535294={};_0x535294[_0xdc98b4]={'$like':'%'+_0x3f0374[_0xc9ed('0x47')]['filter']+'%'};return _0x535294;})});}_0x56d2de=_['merge']({},_0x56d2de,_0x3f0374[_0xc9ed('0x55')]);return db['Disposition'][_0xc9ed('0x34')]({'where':_0x56d2de[_0xc9ed('0x51')]})[_0xc9ed('0x23')](function(_0x1f5d75){_0x484f85[_0xc9ed('0x34')]=_0x1f5d75;if(_0x3f0374[_0xc9ed('0x47')][_0xc9ed('0x6b')]){_0x56d2de[_0xc9ed('0x56')]=[{'all':!![]}];}return db[_0xc9ed('0x68')]['findAll'](_0x56d2de);})[_0xc9ed('0x23')](function(_0x2d6cea){_0x484f85['rows']=_0x2d6cea;return _0x484f85;});}})[_0xc9ed('0x23')](respondWithFilteredResult(_0x3ad75b,_0x56d2de))['catch'](handleError(_0x3ad75b,null));};exports[_0xc9ed('0x6c')]=function(_0x554ef2,_0x582cdd,_0x4e42e8){return db[_0xc9ed('0x41')]['find']({'where':{'id':_0x554ef2['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x582cdd,null))[_0xc9ed('0x23')](function(_0x1942f4){if(_0x1942f4){return _0x1942f4[_0xc9ed('0x6c')](_0x554ef2[_0xc9ed('0x47')][_0xc9ed('0x6d')]);}})[_0xc9ed('0x23')](respondWithStatusCode(_0x582cdd,null))[_0xc9ed('0x2d')](handleError(_0x582cdd,null));};exports[_0xc9ed('0x6e')]=function(_0x4a9599,_0x4ae55b,_0xdefdb4){if(_0x4a9599[_0xc9ed('0x5e')]['id']){delete _0x4a9599['body']['id'];}return db[_0xc9ed('0x41')]['find']({'where':{'id':_0x4a9599['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x4ae55b,null))['then'](function(_0x1ac8b7){if(_0x1ac8b7){_0x4a9599[_0xc9ed('0x5e')]['FaxAccountId']=_0x1ac8b7['id'];return db['CannedAnswer']['create'](_0x4a9599[_0xc9ed('0x5e')]);}})[_0xc9ed('0x23')](respondWithResult(_0x4ae55b,null))[_0xc9ed('0x2d')](handleError(_0x4ae55b,null));};exports[_0xc9ed('0x6f')]=function(_0x40804c,_0x48a7a4,_0xbe0a4c){var _0x50b063={'raw':![],'where':{}};var _0x10b37d={};var _0x1bec9a={'count':0x0,'rows':[]};return db[_0xc9ed('0x41')][_0xc9ed('0x70')]({'where':{'id':_0x40804c[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x48a7a4,null))[_0xc9ed('0x23')](function(_0xfc78b0){if(_0xfc78b0){_0x10b37d['model']=_[_0xc9ed('0x48')](db[_0xc9ed('0x71')][_0xc9ed('0x69')]);_0x10b37d[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x40804c[_0xc9ed('0x47')]);_0x10b37d[_0xc9ed('0x49')]=_[_0xc9ed('0x4a')](_0x10b37d[_0xc9ed('0x45')],_0x10b37d[_0xc9ed('0x47')]);_0x50b063['attributes']=_['intersection'](_0x10b37d[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x40804c['query']['fields']));_0x50b063[_0xc9ed('0x4c')]=_0x50b063[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x50b063[_0xc9ed('0x4c')]:_0x10b37d[_0xc9ed('0x45')];if(!_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x50b063['limit']=qs['limit'](_0x40804c['query'][_0xc9ed('0x35')]);_0x50b063[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x50b063[_0xc9ed('0x72')]=qs[_0xc9ed('0x50')](_0x40804c[_0xc9ed('0x47')]['sort']);_0x50b063[_0xc9ed('0x51')]=qs[_0xc9ed('0x49')](_[_0xc9ed('0x6a')](_0x40804c['query'],_0x10b37d[_0xc9ed('0x49')]));_0x50b063[_0xc9ed('0x51')][_0xc9ed('0x67')]=_0xfc78b0['id'];if(_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x50b063[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x50b063[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x50b063[_0xc9ed('0x4c')],function(_0xaa3b19){var _0x75b24a={};_0x75b24a[_0xaa3b19]={'$like':'%'+_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x52')]+'%'};return _0x75b24a;})});}_0x50b063=_[_0xc9ed('0x53')]({},_0x50b063,_0x40804c[_0xc9ed('0x55')]);return db[_0xc9ed('0x71')][_0xc9ed('0x34')]({'where':_0x50b063['where']})[_0xc9ed('0x23')](function(_0x47953b){_0x1bec9a['count']=_0x47953b;if(_0x40804c[_0xc9ed('0x47')][_0xc9ed('0x6b')]){_0x50b063[_0xc9ed('0x56')]=[{'all':!![]}];}return db[_0xc9ed('0x71')][_0xc9ed('0x57')](_0x50b063);})[_0xc9ed('0x23')](function(_0x5dc6c8){_0x1bec9a[_0xc9ed('0x58')]=_0x5dc6c8;return _0x1bec9a;});}})['then'](respondWithFilteredResult(_0x48a7a4,_0x50b063))[_0xc9ed('0x2d')](handleError(_0x48a7a4,null));};exports[_0xc9ed('0x73')]=function(_0x4d0389,_0x3a9edf,_0x11d7fe){return db[_0xc9ed('0x41')][_0xc9ed('0x5c')]({'where':{'id':_0x4d0389[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x3a9edf,null))[_0xc9ed('0x23')](function(_0x35e87a){if(_0x35e87a){return _0x35e87a['removeAnswers'](_0x4d0389[_0xc9ed('0x47')][_0xc9ed('0x6d')]);}})[_0xc9ed('0x23')](respondWithStatusCode(_0x3a9edf,null))[_0xc9ed('0x2d')](handleError(_0x3a9edf,null));};exports['addInteraction']=function(_0x124eac,_0x11d449,_0x40a2fc){return db['FaxInteraction'][_0xc9ed('0x5c')]({'where':{'id':_0x124eac[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x11d449,null))[_0xc9ed('0x23')](function(_0x176344){if(_0x176344){return _0x176344[_0xc9ed('0x74')](_0x124eac[_0xc9ed('0x5e')][_0xc9ed('0x6d')],_[_0xc9ed('0x75')](_0x124eac[_0xc9ed('0x5e')],[_0xc9ed('0x6d'),'id'])||{});}})[_0xc9ed('0x23')](respondWithResult(_0x11d449,null))['catch'](handleError(_0x11d449,null));};exports['getInteractions']=function(_0x4b56d6,_0x537daf,_0xc20f87){var _0x31c9e5={'raw':![],'where':{}};var _0x2818ef={};var _0x2e17ea={'count':0x0,'rows':[]};return db[_0xc9ed('0x41')][_0xc9ed('0x70')]({'where':{'id':_0x4b56d6['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x537daf,null))['then'](function(_0x51acc2){if(_0x51acc2){_0x2818ef[_0xc9ed('0x45')]=_[_0xc9ed('0x48')](db[_0xc9ed('0x76')]['rawAttributes']);_0x2818ef['query']=_[_0xc9ed('0x48')](_0x4b56d6['query']);_0x2818ef['filters']=_[_0xc9ed('0x4a')](_0x2818ef['model'],_0x2818ef[_0xc9ed('0x47')]);_0x31c9e5[_0xc9ed('0x4c')]=_[_0xc9ed('0x4a')](_0x2818ef[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x31c9e5[_0xc9ed('0x4c')]=_0x31c9e5[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x31c9e5[_0xc9ed('0x4c')]:_0x2818ef[_0xc9ed('0x45')];if(!_0x4b56d6['query'][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x31c9e5['limit']=qs['limit'](_0x4b56d6['query']['limit']);_0x31c9e5[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x31c9e5['order']=qs['sort'](_0x4b56d6['query'][_0xc9ed('0x50')]);_0x31c9e5['where']=qs[_0xc9ed('0x49')](_[_0xc9ed('0x6a')](_0x4b56d6['query'],_0x2818ef[_0xc9ed('0x49')]));_0x31c9e5[_0xc9ed('0x51')][_0xc9ed('0x67')]=_0x51acc2['id'];if(_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x31c9e5[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x31c9e5[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x31c9e5[_0xc9ed('0x4c')],function(_0x125dc7){var _0x1cb6b6={};_0x1cb6b6[_0x125dc7]={'$like':'%'+_0x4b56d6['query']['filter']+'%'};return _0x1cb6b6;})});}_0x31c9e5=_[_0xc9ed('0x53')]({},_0x31c9e5,_0x4b56d6[_0xc9ed('0x55')]);return db[_0xc9ed('0x76')]['count']({'where':_0x31c9e5['where']})[_0xc9ed('0x23')](function(_0x5b83e5){_0x2e17ea[_0xc9ed('0x34')]=_0x5b83e5;if(_0x4b56d6['query'][_0xc9ed('0x6b')]){_0x31c9e5['include']=[{'model':db['CmContact'],'as':_0xc9ed('0x77'),'required':![]},{'model':db[_0xc9ed('0x78')],'as':_0xc9ed('0x79'),'attributes':[_0xc9ed('0x46'),'fullname',_0xc9ed('0x7a')],'required':![]},{'model':db[_0xc9ed('0x7b')],'as':_0xc9ed('0x7c'),'attributes':['id','name',_0xc9ed('0x7d')],'where':_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x7e')]?{'id':_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x7e')]}:undefined,'required':_0x4b56d6[_0xc9ed('0x47')][_0xc9ed('0x7e')]?!![]:![]}];}return db[_0xc9ed('0x76')][_0xc9ed('0x57')](_0x31c9e5);})[_0xc9ed('0x23')](function(_0x49ca89){_0x2e17ea[_0xc9ed('0x58')]=_0x49ca89;return _0x2e17ea;});}})[_0xc9ed('0x23')](respondWithFilteredResult(_0x537daf,_0x31c9e5))[_0xc9ed('0x2d')](handleError(_0x537daf,null));};exports[_0xc9ed('0x7f')]=function(_0x1237cf,_0xbaec0b,_0x4f9a90){return db[_0xc9ed('0x41')][_0xc9ed('0x70')]({'where':{'id':_0x1237cf['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0xbaec0b,null))[_0xc9ed('0x23')](function(_0x4caa5f){if(_0x4caa5f){return db[_0xc9ed('0x80')][_0xc9ed('0x81')](function(_0x27c925){return db[_0xc9ed('0x82')]['destroy']({'where':{'FaxAccountId':_0x1237cf[_0xc9ed('0x5a')]['id']},'transaction':_0x27c925})[_0xc9ed('0x23')](function(_0x59c334){var _0x285425=_[_0xc9ed('0x40')](_0x1237cf[_0xc9ed('0x5e')],function(_0x3834dd){_0x3834dd[_0xc9ed('0x67')]=_0x1237cf['params']['id'];return _0x3834dd;});return db[_0xc9ed('0x82')][_0xc9ed('0x83')](_0x285425,{'transaction':_0x27c925});});})['then'](function(){return db[_0xc9ed('0x82')][_0xc9ed('0x84')]({'where':{'FaxAccountId':_0x1237cf['params']['id']},'order':_0xc9ed('0x85')});});}})['then'](respondWithResult(_0xbaec0b,null))[_0xc9ed('0x2d')](handleError(_0xbaec0b,null));};exports[_0xc9ed('0x86')]=function(_0x1e2768,_0x27c3a9,_0x47169a){var _0x59257d={};var _0x29c5b1={};var _0x14ee29;var _0x36716f;return db['FaxAccount'][_0xc9ed('0x70')]({'where':{'id':_0x1e2768[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x27c3a9,null))[_0xc9ed('0x23')](function(_0x58973b){if(_0x58973b){_0x14ee29=_0x58973b;_0x29c5b1[_0xc9ed('0x45')]=_[_0xc9ed('0x48')](db['FaxApplication'][_0xc9ed('0x69')]);_0x29c5b1[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x1e2768[_0xc9ed('0x47')]);_0x29c5b1[_0xc9ed('0x49')]=_['intersection'](_0x29c5b1[_0xc9ed('0x45')],_0x29c5b1[_0xc9ed('0x47')]);_0x59257d[_0xc9ed('0x4c')]=_[_0xc9ed('0x4a')](_0x29c5b1[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x1e2768[_0xc9ed('0x47')]['fields']));_0x59257d[_0xc9ed('0x4c')]=_0x59257d[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x59257d[_0xc9ed('0x4c')]:_0x29c5b1['model'];_0x59257d[_0xc9ed('0x72')]=qs[_0xc9ed('0x50')](_0x1e2768[_0xc9ed('0x47')][_0xc9ed('0x50')]);_0x59257d['where']=qs['filters'](_[_0xc9ed('0x6a')](_0x1e2768[_0xc9ed('0x47')],_0x29c5b1['filters']));if(_0x1e2768['query']['filter']){_0x59257d[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x59257d[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x59257d[_0xc9ed('0x4c')],function(_0x1f3d62){var _0x45617b={};_0x45617b[_0x1f3d62]={'$like':'%'+_0x1e2768['query'][_0xc9ed('0x52')]+'%'};return _0x45617b;})});}_0x59257d=_['merge']({},_0x59257d,_0x1e2768['options']);return _0x14ee29[_0xc9ed('0x86')](_0x59257d);}})[_0xc9ed('0x23')](function(_0x1f0658){if(_0x1f0658){_0x36716f=_0x1f0658['length'];if(!_0x1e2768['query'][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x59257d[_0xc9ed('0x35')]=qs['limit'](_0x1e2768[_0xc9ed('0x47')]['limit']);_0x59257d[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x1e2768[_0xc9ed('0x47')]['offset']);}return _0x14ee29[_0xc9ed('0x86')](_0x59257d);}})['then'](function(_0x5530c0){if(_0x5530c0){return _0x5530c0?{'count':_0x36716f,'rows':_0x5530c0}:null;}})[_0xc9ed('0x23')](respondWithResult(_0x27c3a9,null))[_0xc9ed('0x2d')](handleError(_0x27c3a9,null));};function Extension(_0x321e06,_0x26d179,_0x6a5f71,_0x2628f5){this['context']=_0xc9ed('0x87');this[_0xc9ed('0x88')]=_0x321e06['localstationid'];this[_0xc9ed('0x89')]=_0x2628f5;this['type']=_0xc9ed('0x8a');this['description']=_0xc9ed('0x8b');this[_0xc9ed('0x67')]=_0x321e06['id'];this[_0xc9ed('0x85')]=_0x26d179;this['appdata']=_0x6a5f71;}function createExtensionsReciveFax(_0x4c985e){var _0x3c9bab=0x1;var _0x336fc7=[];_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,'','Answer'));_0x3c9bab+=0x1;_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,_0xc9ed('0x8d'),_0xc9ed('0x8e')));_0x3c9bab+=0x1;for(var _0x165f6f in _0x4c985e){if(_0x4c985e[_0xc9ed('0x4e')](_0x165f6f)&&(_0x165f6f===_0xc9ed('0x8f')||_0x165f6f===_0xc9ed('0x90')||_0x165f6f==='gateway'||_0x165f6f===_0xc9ed('0x91')||_0x165f6f===_0xc9ed('0x92')||_0x165f6f===_0xc9ed('0x93')||_0x165f6f==='minrate'||_0x165f6f===_0xc9ed('0x94')||_0x165f6f===_0xc9ed('0x95'))){_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,_0xc9ed('0x96')+_0x165f6f+')='+_0x4c985e[_0x165f6f],'Set'));_0x3c9bab+=0x1;}}_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,'6',_0xc9ed('0x97')));_0x3c9bab+=0x1;_0x336fc7[_0xc9ed('0x8c')](new Extension(_0x4c985e,_0x3c9bab,_0xc9ed('0x98'),_0xc9ed('0x99')));_0x3c9bab=0x0;return _0x336fc7;}exports[_0xc9ed('0x9a')]=function(_0x16db37,_0x591031,_0x27d14e){var _0x13cd56;return db[_0xc9ed('0x80')][_0xc9ed('0x81')](function(_0x293361){return db['FaxAccount']['create'](_0x16db37[_0xc9ed('0x5e')],{'transaction':_0x293361})[_0xc9ed('0x23')](function(_0x4200db){_0x13cd56=_0x4200db['get']({'plain':!![]});return db[_0xc9ed('0x9b')][_0xc9ed('0x83')](createExtensionsReciveFax(_0x13cd56),{'transaction':_0x293361});});})[_0xc9ed('0x23')](function(){return _0x13cd56;})[_0xc9ed('0x23')](respondWithResult(_0x591031,null))[_0xc9ed('0x2d')](handleError(_0x591031,null));};exports[_0xc9ed('0x9c')]=function(_0x974b4a,_0x472455,_0x38c361){var _0x20731e;return db[_0xc9ed('0x80')][_0xc9ed('0x81')](function(_0x23459e){return db[_0xc9ed('0x41')][_0xc9ed('0x39')](_0x974b4a[_0xc9ed('0x5e')],{'where':{'id':_0x974b4a['body']['id']},'transaction':_0x23459e})['then'](function(_0x51bcfa){return db[_0xc9ed('0x9b')][_0xc9ed('0x3a')]({'where':{'FaxAccountId':_0x974b4a[_0xc9ed('0x5e')]['id']},'transaction':_0x23459e})[_0xc9ed('0x23')](function(_0x4337e8){return db[_0xc9ed('0x9b')][_0xc9ed('0x83')](createExtensionsReciveFax(_[_0xc9ed('0x75')](_0x974b4a[_0xc9ed('0x5e')],[_0xc9ed('0x9d'),_0xc9ed('0x44'),_0xc9ed('0x9e'),_0xc9ed('0x9f'),_0xc9ed('0xa0'),_0xc9ed('0xa1')])),{'transaction':_0x23459e});});});})[_0xc9ed('0x23')](function(){return db[_0xc9ed('0x41')][_0xc9ed('0xa2')](_0x974b4a[_0xc9ed('0x5e')]['id']);})[_0xc9ed('0x23')](respondWithResult(_0x472455,null))['catch'](handleError(_0x472455,null));};exports[_0xc9ed('0xa3')]=function(_0x1b3b3d,_0x3b701b,_0x3def7f){var _0x11c97a={'raw':!![],'where':{}};var _0x2e8e24={};var _0x3aa443={'count':0x0,'rows':[]};return db[_0xc9ed('0x41')][_0xc9ed('0x70')]({'where':{'id':_0x1b3b3d[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x3b701b,null))[_0xc9ed('0x23')](function(_0x1bc882){if(_0x1bc882){_0x2e8e24[_0xc9ed('0x45')]=_[_0xc9ed('0x48')](db[_0xc9ed('0xa4')][_0xc9ed('0x69')]);_0x2e8e24[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x1b3b3d[_0xc9ed('0x47')]);_0x2e8e24[_0xc9ed('0x49')]=_['intersection'](_0x2e8e24['model'],_0x2e8e24[_0xc9ed('0x47')]);_0x11c97a[_0xc9ed('0x4c')]=_[_0xc9ed('0x4a')](_0x2e8e24[_0xc9ed('0x45')],qs['fields'](_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x11c97a[_0xc9ed('0x4c')]=_0x11c97a['attributes'][_0xc9ed('0x4d')]?_0x11c97a['attributes']:_0x2e8e24[_0xc9ed('0x45')];if(!_0x1b3b3d[_0xc9ed('0x47')]['hasOwnProperty'](_0xc9ed('0x4f'))){_0x11c97a[_0xc9ed('0x35')]=qs[_0xc9ed('0x35')](_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x35')]);_0x11c97a[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x32')]);}_0x11c97a[_0xc9ed('0x72')]=qs[_0xc9ed('0x50')](_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x50')]);_0x11c97a[_0xc9ed('0x51')]=qs['filters'](_[_0xc9ed('0x6a')](_0x1b3b3d[_0xc9ed('0x47')],_0x2e8e24['filters']));_0x11c97a[_0xc9ed('0x51')]['FaxAccountId']=_0x1bc882['id'];if(_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x52')]){_0x11c97a[_0xc9ed('0x51')]=_[_0xc9ed('0x53')](_0x11c97a['where'],{'$or':_[_0xc9ed('0x40')](_0x11c97a['attributes'],function(_0x4a6e90){var _0x387cc5={};_0x387cc5[_0x4a6e90]={'$like':'%'+_0x1b3b3d['query'][_0xc9ed('0x52')]+'%'};return _0x387cc5;})});}if(_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0xa5')]){var _0x2e667d=_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0xa5')][_0xc9ed('0xa6')](',');var _0x4c3e60={};_0x4c3e60[_0x2e667d[0x0]]={'$gte':moment(_0x2e667d[0x1])[_0xc9ed('0xa7')](_0xc9ed('0xa8'))};_0x11c97a['where']=_[_0xc9ed('0x53')](_0x11c97a[_0xc9ed('0x51')],_0x4c3e60);}_0x11c97a=_[_0xc9ed('0x53')]({},_0x11c97a,_0x1b3b3d[_0xc9ed('0x55')]);return db['FaxMessage'][_0xc9ed('0x34')]({'where':_0x11c97a[_0xc9ed('0x51')]})[_0xc9ed('0x23')](function(_0x33f7e0){_0x3aa443[_0xc9ed('0x34')]=_0x33f7e0;if(_0x1b3b3d[_0xc9ed('0x47')][_0xc9ed('0x6b')]){_0x11c97a[_0xc9ed('0x56')]=[{'all':!![]}];}return db[_0xc9ed('0xa4')][_0xc9ed('0x57')](_0x11c97a);})[_0xc9ed('0x23')](function(_0x52307e){_0x3aa443[_0xc9ed('0x58')]=_0x52307e;return _0x3aa443;});}})[_0xc9ed('0x23')](respondWithFilteredResult(_0x3b701b,_0x11c97a))[_0xc9ed('0x2d')](handleError(_0x3b701b,null));};exports['send']=function(_0x1ea5ac,_0x92aa3d,_0x3cf04e){var _0x43a242,_0x2d3d9b={},_0x116aaa;if(_0x1ea5ac[_0xc9ed('0x5e')]['to']){_0x116aaa=_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0];}return db['FaxAccount'][_0xc9ed('0x5c')]({'where':{'id':_0x1ea5ac['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x116aaa},'limit':0x1,'order':[[_0xc9ed('0x9f'),_0xc9ed('0xa9')]]}]}]})[_0xc9ed('0x23')](handleEntityNotFound(_0x92aa3d,null))['then'](function(_0x199276){_0x43a242=_0x199276;if(_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')]&&_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][_0xc9ed('0x4d')]){for(var _0xa6e77e=0x0;_0xa6e77e<_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][_0xc9ed('0x4d')];_0xa6e77e+=0x1){_0x1ea5ac['body'][_0xc9ed('0xaa')][_0xa6e77e]={'filename':_0x1ea5ac[_0xc9ed('0x5e')]['attachments'][_0xa6e77e][_0xc9ed('0x46')],'id':_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][_0xa6e77e]['id'],'path':path['join'](config[_0xc9ed('0xab')],'server/files/attachments',_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][_0xa6e77e]['basename'])};}}return respondWithRpcPromise(_0xc9ed('0xac'),_0xc9ed('0xac'),{'FaxAccountId':_[_0xc9ed('0xad')](_0x1ea5ac[_0xc9ed('0x5a')]['id'])?undefined:_0x1ea5ac['params']['id'],'path':_[_0xc9ed('0xad')](_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0][_0xc9ed('0x7')])?undefined:_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0]['path'],'fax':_[_0xc9ed('0xad')](_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0])?undefined:_0x1ea5ac['body']['to'][0x0]},client9002);})[_0xc9ed('0x23')](function(){if(_0x43a242){if(_[_0xc9ed('0xad')](_0x1ea5ac['body'][_0xc9ed('0xae')])){_0x1ea5ac['body'][_0xc9ed('0xae')]=util[_0xc9ed('0xa7')](_0xc9ed('0xaf'),_0x43a242[_0xc9ed('0x46')],_0x43a242[_0xc9ed('0xb0')]);}if(_0x43a242[_0xc9ed('0xb1')]){if(_0x43a242[_0xc9ed('0xb1')][_0xc9ed('0xb2')][_0xc9ed('0x4d')]){return _0x43a242['List']['Contacts'][0x0];}else{return db[_0xc9ed('0xb3')]['create'](_['defaults'](_0x1ea5ac[_0xc9ed('0x5e')],{'firstName':_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0],'phone':_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0],'fax':_0x1ea5ac['body']['to'][0x0],'ListId':_0x43a242['ListId']}));}}else{throw new Error(_0xc9ed('0xb4'));}}else{throw new Error(_0xc9ed('0xb5'));}})[_0xc9ed('0x23')](function(_0x3cdbfb){if(_0x3cdbfb){return db['FaxInteraction']['find']({'where':{'ContactId':_0x3cdbfb['id'],'closed':![],'FaxAccountId':_0x43a242['id']}})[_0xc9ed('0x23')](function(_0x36a28d){if(_0x36a28d){return[_0x36a28d,![]];}return db[_0xc9ed('0x76')][_0xc9ed('0x5d')]({'UserId':_0x1ea5ac[_0xc9ed('0x5f')]['id'],'ContactId':_0x3cdbfb['id'],'FaxAccountId':_0x43a242['id'],'fax':_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0],'firstMsgDirection':_0xc9ed('0xb6'),'Messages':[_['merge'](_0x1ea5ac[_0xc9ed('0x5e')],{'read':![],'body':_0x1ea5ac[_0xc9ed('0x5e')]['attachments'][0x0][_0xc9ed('0xb7')],'FaxAccountId':_0x43a242['id'],'UserId':_0x1ea5ac[_0xc9ed('0x5f')]['id'],'ContactId':_0x3cdbfb['id'],'AttachmentId':_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0xc9ed('0xa4')],'as':'Messages'}]})[_0xc9ed('0x23')](function(_0x496131){return[_0x496131,!![]];});});}else{throw new Error(_0xc9ed('0xb8'));}})[_0xc9ed('0xb9')](function(_0x2b173e,_0x1e369e){if(_0x1e369e){return _0x2b173e;}return db['FaxMessage'][_0xc9ed('0x5d')]({'direction':'out','read':![],'body':_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0][_0xc9ed('0xb7')],'FaxAccountId':_0x43a242['id'],'FaxInteractionId':_0x2b173e['id'],'UserId':_0x1ea5ac[_0xc9ed('0x5f')]['id'],'ContactId':_0x2b173e['ContactId'],'AttachmentId':_0x1ea5ac['body'][_0xc9ed('0xaa')][0x0]['id']})['then'](function(_0x5733d5){_0x2b173e['dataValues'][_0xc9ed('0xba')]=[];_0x2b173e[_0xc9ed('0xbb')][_0xc9ed('0xba')][_0xc9ed('0x8c')](_0x5733d5[_0xc9ed('0xbb')]);return _0x2b173e;});})['then'](function(_0x23b025){respondWithRpcPromise('SendFax',_0xc9ed('0xbc'),{'FaxAccountId':_[_0xc9ed('0xad')](_0x1ea5ac[_0xc9ed('0x5a')]['id'])?undefined:_0x1ea5ac[_0xc9ed('0x5a')]['id'],'path':_[_0xc9ed('0xad')](_0x1ea5ac['body'][_0xc9ed('0xaa')][0x0]['path'])?undefined:_0x1ea5ac[_0xc9ed('0x5e')][_0xc9ed('0xaa')][0x0][_0xc9ed('0x7')],'fax':_[_0xc9ed('0xad')](_0x1ea5ac['body']['to'][0x0])?undefined:_0x1ea5ac[_0xc9ed('0x5e')]['to'][0x0],'AttachmentId':_0x1ea5ac['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x4ba8c2){logger[_0xc9ed('0x24')](_0xc9ed('0xbd'),_0x4ba8c2);})['catch'](function(_0x5c195b){logger[_0xc9ed('0x24')](_0xc9ed('0xbd'),_0x5c195b);});return _0x23b025;})['then'](respondWithResult(_0x92aa3d,null))[_0xc9ed('0x2d')](handleError(_0x92aa3d,null));};exports['addAgents']=function(_0x492a8a,_0x502a9b,_0x331c8f){return db[_0xc9ed('0x41')]['find']({'where':{'id':_0x492a8a[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x502a9b,null))[_0xc9ed('0x23')](function(_0x4beb27){if(_0x4beb27){return _0x4beb27[_0xc9ed('0xbe')](_0x492a8a[_0xc9ed('0x5e')]['ids'],_[_0xc9ed('0x75')](_0x492a8a[_0xc9ed('0x5e')],['ids','id'])||{})[_0xc9ed('0xb9')](function(_0x4c9543){for(var _0x1a4d4f=0x0;_0x1a4d4f<_0x492a8a[_0xc9ed('0x5e')]['ids'][_0xc9ed('0x4d')];_0x1a4d4f+=0x1){socket['emit'](_0xc9ed('0xbf'),{'UserId':Number(_0x492a8a['body'][_0xc9ed('0x6d')][_0x1a4d4f]),'FaxAccountId':Number(_0x492a8a['params']['id'])});}return _0x4c9543;});}})[_0xc9ed('0x23')](respondWithResult(_0x502a9b,null))[_0xc9ed('0x2d')](handleError(_0x502a9b,null));};exports[_0xc9ed('0xc0')]=function(_0x36d1f5,_0x3e5409,_0x5cfc93){return db[_0xc9ed('0x41')]['find']({'where':{'id':_0x36d1f5['params']['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x3e5409,null))[_0xc9ed('0x23')](function(_0x3839ee){if(_0x3839ee){return _0x3839ee[_0xc9ed('0xc0')](_0x36d1f5['query']['ids'])['then'](function(){if(_['isArray'](_0x36d1f5[_0xc9ed('0x47')][_0xc9ed('0x6d')])){for(var _0x5aaa2d=0x0;_0x5aaa2d<_0x36d1f5[_0xc9ed('0x47')][_0xc9ed('0x6d')]['length'];_0x5aaa2d+=0x1){socket[_0xc9ed('0xc1')](_0xc9ed('0xc2'),{'UserId':Number(_0x36d1f5[_0xc9ed('0x47')]['ids'][_0x5aaa2d]),'FaxAccountId':Number(_0x36d1f5[_0xc9ed('0x5a')]['id'])});}}else{socket[_0xc9ed('0xc1')](_0xc9ed('0xc2'),{'UserId':Number(_0x36d1f5[_0xc9ed('0x47')][_0xc9ed('0x6d')]),'FaxAccountId':Number(_0x36d1f5[_0xc9ed('0x5a')]['id'])});}});}})[_0xc9ed('0x23')](respondWithStatusCode(_0x3e5409,null))[_0xc9ed('0x2d')](handleError(_0x3e5409,null));};exports[_0xc9ed('0xc3')]=function(_0x456da7,_0x12b26d,_0x2102ff){var _0x3e3d23={};var _0x32c8e7={};var _0x539623;var _0x24c803;return db['FaxAccount'][_0xc9ed('0x70')]({'where':{'id':_0x456da7[_0xc9ed('0x5a')]['id']}})[_0xc9ed('0x23')](handleEntityNotFound(_0x12b26d,null))[_0xc9ed('0x23')](function(_0x296109){if(_0x296109){_0x539623=_0x296109;_0x32c8e7[_0xc9ed('0x45')]=_['keys'](db['User'][_0xc9ed('0x69')]);_0x32c8e7[_0xc9ed('0x47')]=_[_0xc9ed('0x48')](_0x456da7[_0xc9ed('0x47')]);_0x32c8e7[_0xc9ed('0x49')]=_[_0xc9ed('0x4a')](_0x32c8e7[_0xc9ed('0x45')],_0x32c8e7[_0xc9ed('0x47')]);_0x3e3d23[_0xc9ed('0x4c')]=_['intersection'](_0x32c8e7[_0xc9ed('0x45')],qs[_0xc9ed('0x4b')](_0x456da7[_0xc9ed('0x47')][_0xc9ed('0x4b')]));_0x3e3d23[_0xc9ed('0x4c')]=_0x3e3d23[_0xc9ed('0x4c')][_0xc9ed('0x4d')]?_0x3e3d23['attributes']:_0x32c8e7[_0xc9ed('0x45')];_0x3e3d23[_0xc9ed('0x72')]=qs[_0xc9ed('0x50')](_0x456da7[_0xc9ed('0x47')][_0xc9ed('0x50')]);_0x3e3d23[_0xc9ed('0x51')]=qs[_0xc9ed('0x49')](_['pick'](_0x456da7[_0xc9ed('0x47')],_0x32c8e7[_0xc9ed('0x49')]));if(_0x456da7[_0xc9ed('0x47')]['filter']){_0x3e3d23[_0xc9ed('0x51')]=_['merge'](_0x3e3d23[_0xc9ed('0x51')],{'$or':_[_0xc9ed('0x40')](_0x3e3d23[_0xc9ed('0x4c')],function(_0x7180fb){var _0x2c50bc={};_0x2c50bc[_0x7180fb]={'$like':'%'+_0x456da7[_0xc9ed('0x47')][_0xc9ed('0x52')]+'%'};return _0x2c50bc;})});}_0x3e3d23=_['merge']({},_0x3e3d23,_0x456da7[_0xc9ed('0x55')]);return _0x539623[_0xc9ed('0xc3')](_0x3e3d23);}})['then'](function(_0x56e7ef){if(_0x56e7ef){_0x24c803=_0x56e7ef['length'];if(!_0x456da7[_0xc9ed('0x47')][_0xc9ed('0x4e')](_0xc9ed('0x4f'))){_0x3e3d23[_0xc9ed('0x35')]=qs[_0xc9ed('0x35')](_0x456da7[_0xc9ed('0x47')]['limit']);_0x3e3d23[_0xc9ed('0x32')]=qs[_0xc9ed('0x32')](_0x456da7[_0xc9ed('0x47')]['offset']);}return _0x539623[_0xc9ed('0xc3')](_0x3e3d23);}})['then'](function(_0x179a97){if(_0x179a97){return _0x179a97?{'count':_0x24c803,'rows':_0x179a97}:null;}})[_0xc9ed('0x23')](respondWithResult(_0x12b26d,null))[_0xc9ed('0x2d')](handleError(_0x12b26d,null));}; \ No newline at end of file +var _0xf3c9=['addApplications','transaction','FaxApplication','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','bulkCreate','updateAccountApplications','tech','updatedAt','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxAccount.socket','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','FaxAccounts','end','sendStatus','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','where','type','name','options','includeAll','include','findAll','rows','params','Pause','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','length','hasOwnProperty','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','Owner','internal','color','tag'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf3c9,0x1be));var _0x9f3c=function(_0x31bf9a,_0x438767){_0x31bf9a=_0x31bf9a-0x0;var _0x39c0a1=_0xf3c9[_0x31bf9a];return _0x39c0a1;};'use strict';var emlformat=require(_0x9f3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f3c('0x1'));var jsonpatch=require(_0x9f3c('0x2'));var rp=require(_0x9f3c('0x3'));var moment=require(_0x9f3c('0x4'));var BPromise=require(_0x9f3c('0x5'));var Mustache=require('mustache');var util=require(_0x9f3c('0x6'));var path=require(_0x9f3c('0x7'));var sox=require(_0x9f3c('0x8'));var csv=require(_0x9f3c('0x9'));var ejs=require(_0x9f3c('0xa'));var fs=require('fs');var fs_extra=require(_0x9f3c('0xb'));var _=require(_0x9f3c('0xc'));var squel=require(_0x9f3c('0xd'));var crypto=require(_0x9f3c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f3c('0x9'));var querystring=require(_0x9f3c('0xf'));var Papa=require(_0x9f3c('0x10'));var Redis=require(_0x9f3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f3c('0x12'));var as=require(_0x9f3c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f3c('0x14'))(_0x9f3c('0x15'));var utils=require(_0x9f3c('0x16'));var config=require(_0x9f3c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f3c('0x18'))['db'];config[_0x9f3c('0x19')]=_['defaults'](config[_0x9f3c('0x19')],{'host':_0x9f3c('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f3c('0x19')]));require(_0x9f3c('0x1b'))['register'](socket);var jayson=require(_0x9f3c('0x1c'));var client=jayson[_0x9f3c('0x1d')][_0x9f3c('0x1e')]({'port':0x232c});var client9002=jayson[_0x9f3c('0x1d')][_0x9f3c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x27b06b,_0x32e985,_0x7e1b15,_0x208468){return new BPromise(function(_0x10d7fb,_0x34e9b9){var _0x15ec65=_0x208468||client;return _0x15ec65['request'](_0x27b06b,_0x7e1b15)['then'](function(_0x2b8802){logger[_0x9f3c('0x1f')](_0x9f3c('0x20'),_0x32e985,_0x9f3c('0x21'));logger[_0x9f3c('0x22')](_0x9f3c('0x23'),_0x32e985,_0x9f3c('0x21'),JSON[_0x9f3c('0x24')](_0x2b8802));if(_0x2b8802[_0x9f3c('0x25')]){if(_0x2b8802[_0x9f3c('0x25')][_0x9f3c('0x26')]===0x1f4){logger[_0x9f3c('0x25')](_0x9f3c('0x20'),_0x32e985,_0x2b8802[_0x9f3c('0x25')][_0x9f3c('0x27')]);return _0x34e9b9(_0x2b8802[_0x9f3c('0x25')][_0x9f3c('0x27')]);}logger[_0x9f3c('0x25')](_0x9f3c('0x20'),_0x32e985,_0x2b8802[_0x9f3c('0x25')][_0x9f3c('0x27')]);return _0x10d7fb(_0x2b8802['error'][_0x9f3c('0x27')]);}else{logger[_0x9f3c('0x1f')](_0x9f3c('0x20'),_0x32e985,_0x9f3c('0x21'));_0x10d7fb(_0x2b8802[_0x9f3c('0x28')]['message']);}})['catch'](function(_0x35d409){logger[_0x9f3c('0x25')](_0x9f3c('0x20'),_0x32e985,_0x35d409);_0x34e9b9(_0x35d409);});});}function respondWithStatusCode(_0x103f51,_0x2890fa){_0x2890fa=_0x2890fa||0xcc;return function(_0x1e507d){if(_0x1e507d){return _0x103f51['sendStatus'](_0x2890fa);}return _0x103f51[_0x9f3c('0x29')](_0x2890fa)['end']();};}function respondWithResult(_0x14baa0,_0x749236){_0x749236=_0x749236||0xc8;return function(_0x19f9c6){if(_0x19f9c6){return _0x14baa0[_0x9f3c('0x29')](_0x749236)[_0x9f3c('0x2a')](_0x19f9c6);}};}function respondWithFilteredResult(_0x1b9f78,_0x332c0d){return function(_0x3e1f72){if(_0x3e1f72){var _0x8246bb=typeof _0x332c0d[_0x9f3c('0x2b')]===_0x9f3c('0x2c')&&typeof _0x332c0d['limit']===_0x9f3c('0x2c');var _0x2d31f3=_0x3e1f72[_0x9f3c('0x2d')];var _0x546e47=_0x8246bb?0x0:_0x332c0d[_0x9f3c('0x2b')];var _0x687e40=_0x8246bb?_0x3e1f72[_0x9f3c('0x2d')]:_0x332c0d[_0x9f3c('0x2b')]+_0x332c0d[_0x9f3c('0x2e')];var _0x3acbd7;if(_0x687e40>=_0x2d31f3){_0x687e40=_0x2d31f3;_0x3acbd7=0xc8;}else{_0x3acbd7=0xce;}_0x1b9f78[_0x9f3c('0x29')](_0x3acbd7);return _0x1b9f78[_0x9f3c('0x2f')](_0x9f3c('0x30'),_0x546e47+'-'+_0x687e40+'/'+_0x2d31f3)[_0x9f3c('0x2a')](_0x3e1f72);}return null;};}function patchUpdates(_0x4d6de1){return function(_0x1e8b6e){try{jsonpatch[_0x9f3c('0x31')](_0x1e8b6e,_0x4d6de1,!![]);}catch(_0x331815){return BPromise[_0x9f3c('0x32')](_0x331815);}return _0x1e8b6e[_0x9f3c('0x33')]();};}function saveUpdates(_0x54db6c,_0x4e128e){return function(_0x300006){if(_0x300006){return _0x300006[_0x9f3c('0x34')](_0x54db6c)['then'](function(_0x5c5a1c){return _0x5c5a1c;});}return null;};}function removeEntity(_0x301f90,_0x4d319f){return function(_0x672ddf){if(_0x672ddf){return _0x672ddf[_0x9f3c('0x35')]()[_0x9f3c('0x36')](function(){var _0x37a7d0=_0x672ddf['get']({'plain':!![]});var _0x414108=_0x9f3c('0x37');return db['UserProfileResource'][_0x9f3c('0x35')]({'where':{'type':_0x414108,'resourceId':_0x37a7d0['id']}})['then'](function(){return _0x672ddf;});})[_0x9f3c('0x36')](function(){_0x301f90[_0x9f3c('0x29')](0xcc)[_0x9f3c('0x38')]();});}};}function handleEntityNotFound(_0x14e0bc,_0xdbab66){return function(_0x1e058a){if(!_0x1e058a){_0x14e0bc[_0x9f3c('0x39')](0x194);}return _0x1e058a;};}function handleError(_0x391ffb,_0x3ac98f){_0x3ac98f=_0x3ac98f||0x1f4;return function(_0x2d10aa){logger['error'](_0x2d10aa['stack']);if(_0x2d10aa['name']){delete _0x2d10aa['name'];}_0x391ffb[_0x9f3c('0x29')](_0x3ac98f)[_0x9f3c('0x3a')](_0x2d10aa);};}exports[_0x9f3c('0x3b')]=function(_0x407a9e,_0xd6266d){var _0x59d2e1={'include':[{'model':db['Pause'],'as':_0x9f3c('0x3c')}]},_0x13e340={},_0x36f516={'count':0x0,'rows':[]};var _0x23c259=_[_0x9f3c('0x3d')](db[_0x9f3c('0x3e')][_0x9f3c('0x3f')],function(_0x1c9ecc){return{'name':_0x1c9ecc[_0x9f3c('0x40')],'type':_0x1c9ecc['type'][_0x9f3c('0x41')]};});_0x13e340['model']=_['map'](_0x23c259,'name');_0x13e340['query']=_[_0x9f3c('0x42')](_0x407a9e[_0x9f3c('0x43')]);_0x13e340[_0x9f3c('0x44')]=_[_0x9f3c('0x45')](_0x13e340[_0x9f3c('0x46')],_0x13e340[_0x9f3c('0x43')]);_0x59d2e1['attributes']=_[_0x9f3c('0x45')](_0x13e340[_0x9f3c('0x46')],qs[_0x9f3c('0x47')](_0x407a9e[_0x9f3c('0x43')][_0x9f3c('0x47')]));_0x59d2e1['attributes']=_0x59d2e1[_0x9f3c('0x48')]['length']?_0x59d2e1[_0x9f3c('0x48')]:_0x13e340[_0x9f3c('0x46')];if(!_0x407a9e['query']['hasOwnProperty'](_0x9f3c('0x49'))){_0x59d2e1[_0x9f3c('0x2e')]=qs[_0x9f3c('0x2e')](_0x407a9e[_0x9f3c('0x43')][_0x9f3c('0x2e')]);_0x59d2e1[_0x9f3c('0x2b')]=qs[_0x9f3c('0x2b')](_0x407a9e[_0x9f3c('0x43')][_0x9f3c('0x2b')]);}_0x59d2e1[_0x9f3c('0x4a')]=qs[_0x9f3c('0x4b')](_0x407a9e['query'][_0x9f3c('0x4b')]);_0x59d2e1['where']=qs[_0x9f3c('0x44')](_[_0x9f3c('0x4c')](_0x407a9e[_0x9f3c('0x43')],_0x13e340[_0x9f3c('0x44')]),_0x23c259);if(_0x407a9e['query'][_0x9f3c('0x4d')]){_0x59d2e1[_0x9f3c('0x4e')]=_['merge'](_0x59d2e1[_0x9f3c('0x4e')],{'$or':_[_0x9f3c('0x3d')](_0x23c259,function(_0x401582){if(_0x401582[_0x9f3c('0x4f')]!=='VIRTUAL'){var _0x3a1332={};_0x3a1332[_0x401582[_0x9f3c('0x50')]]={'$like':'%'+_0x407a9e[_0x9f3c('0x43')][_0x9f3c('0x4d')]+'%'};return _0x3a1332;}})});}_0x59d2e1=_['merge']({},_0x59d2e1,_0x407a9e[_0x9f3c('0x51')]);var _0x5975ee={'where':_0x59d2e1[_0x9f3c('0x4e')]};return db[_0x9f3c('0x3e')][_0x9f3c('0x2d')](_0x5975ee)[_0x9f3c('0x36')](function(_0x5da7fa){_0x36f516[_0x9f3c('0x2d')]=_0x5da7fa;if(_0x407a9e[_0x9f3c('0x43')][_0x9f3c('0x52')]){_0x59d2e1[_0x9f3c('0x53')]=[{'all':!![]}];}return db['FaxAccount'][_0x9f3c('0x54')](_0x59d2e1);})['then'](function(_0x17788d){_0x36f516[_0x9f3c('0x55')]=_0x17788d;return _0x36f516;})[_0x9f3c('0x36')](respondWithFilteredResult(_0xd6266d,_0x59d2e1))['catch'](handleError(_0xd6266d,null));};exports['show']=function(_0x82e3d9,_0x3ab732){var _0x5fd127={'raw':![],'where':{'id':_0x82e3d9[_0x9f3c('0x56')]['id']},'include':[{'model':db[_0x9f3c('0x57')],'as':_0x9f3c('0x3c')}]},_0xe69bc4={};_0xe69bc4[_0x9f3c('0x46')]=_[_0x9f3c('0x42')](db[_0x9f3c('0x3e')]['rawAttributes']);_0xe69bc4[_0x9f3c('0x43')]=_[_0x9f3c('0x42')](_0x82e3d9[_0x9f3c('0x43')]);_0xe69bc4[_0x9f3c('0x44')]=_[_0x9f3c('0x45')](_0xe69bc4[_0x9f3c('0x46')],_0xe69bc4[_0x9f3c('0x43')]);_0x5fd127[_0x9f3c('0x48')]=_[_0x9f3c('0x45')](_0xe69bc4[_0x9f3c('0x46')],qs['fields'](_0x82e3d9[_0x9f3c('0x43')][_0x9f3c('0x47')]));_0x5fd127['attributes']=_0x5fd127[_0x9f3c('0x48')]['length']?_0x5fd127[_0x9f3c('0x48')]:_0xe69bc4['model'];if(_0x82e3d9['query'][_0x9f3c('0x52')]){_0x5fd127['include']=[{'all':!![]}];}_0x5fd127=_[_0x9f3c('0x58')]({},_0x5fd127,_0x82e3d9[_0x9f3c('0x51')]);return db['FaxAccount'][_0x9f3c('0x59')](_0x5fd127)['then'](handleEntityNotFound(_0x3ab732,null))['then'](respondWithResult(_0x3ab732,null))['catch'](handleError(_0x3ab732,null));};exports[_0x9f3c('0x5a')]=function(_0xa3f803,_0x405ed9){return db[_0x9f3c('0x3e')][_0x9f3c('0x5a')](_0xa3f803[_0x9f3c('0x5b')],{})[_0x9f3c('0x36')](function(_0x430c17){var _0x7d9633=_0xa3f803[_0x9f3c('0x5c')][_0x9f3c('0x5d')]({'plain':!![]});if(!_0x7d9633)throw new Error(_0x9f3c('0x5e'));if(_0x7d9633['role']===_0x9f3c('0x5c')){var _0x49281b=_0x430c17[_0x9f3c('0x5d')]({'plain':!![]});var _0xf39dce='FaxAccounts';return db[_0x9f3c('0x5f')][_0x9f3c('0x59')]({'where':{'name':_0xf39dce,'userProfileId':_0x7d9633[_0x9f3c('0x60')]},'raw':!![]})[_0x9f3c('0x36')](function(_0x45cf78){if(_0x45cf78&&_0x45cf78['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x49281b['name'],'resourceId':_0x49281b['id'],'type':_0x45cf78[_0x9f3c('0x50')],'sectionId':_0x45cf78['id']},{})[_0x9f3c('0x36')](function(){return _0x430c17;});}else{return _0x430c17;}})[_0x9f3c('0x61')](function(_0x5db13d){logger[_0x9f3c('0x25')](_0x9f3c('0x62'),_0x5db13d);throw _0x5db13d;});}return _0x430c17;})[_0x9f3c('0x36')](respondWithResult(_0x405ed9,0xc9))[_0x9f3c('0x61')](handleError(_0x405ed9,null));};exports['update']=function(_0xe792d8,_0x180cfb){if(_0xe792d8[_0x9f3c('0x5b')]['id']){delete _0xe792d8['body']['id'];}return db[_0x9f3c('0x3e')][_0x9f3c('0x59')]({'where':{'id':_0xe792d8['params']['id']},'include':[{'model':db['Pause'],'as':_0x9f3c('0x3c')}]})[_0x9f3c('0x36')](handleEntityNotFound(_0x180cfb,null))[_0x9f3c('0x36')](saveUpdates(_0xe792d8[_0x9f3c('0x5b')],null))['then'](respondWithResult(_0x180cfb,null))[_0x9f3c('0x61')](handleError(_0x180cfb,null));};exports[_0x9f3c('0x35')]=function(_0x5d7dfa,_0x325ca8){return db['FaxAccount']['find']({'where':{'id':_0x5d7dfa[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x325ca8,null))[_0x9f3c('0x36')](removeEntity(_0x325ca8,null))[_0x9f3c('0x61')](handleError(_0x325ca8,null));};exports[_0x9f3c('0x63')]=function(_0x38e4c0,_0xa72866){return db[_0x9f3c('0x3e')][_0x9f3c('0x63')]()[_0x9f3c('0x36')](respondWithResult(_0xa72866,null))['catch'](handleError(_0xa72866,null));};exports[_0x9f3c('0x64')]=function(_0x42ac6d,_0x5af47d,_0x2b5e64){if(_0x42ac6d['body']['id']){delete _0x42ac6d[_0x9f3c('0x5b')]['id'];}return db['FaxAccount'][_0x9f3c('0x59')]({'where':{'id':_0x42ac6d[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x5af47d,null))[_0x9f3c('0x36')](function(_0x5160f5){if(_0x5160f5){_0x42ac6d[_0x9f3c('0x5b')][_0x9f3c('0x65')]=_0x5160f5['id'];return db[_0x9f3c('0x66')][_0x9f3c('0x5a')](_0x42ac6d[_0x9f3c('0x5b')]);}})[_0x9f3c('0x36')](respondWithResult(_0x5af47d,null))[_0x9f3c('0x61')](handleError(_0x5af47d,null));};exports['getDispositions']=function(_0x3c6f21,_0x1ced9f,_0x4afad3){var _0x3f172f={'raw':![],'where':{}};var _0x199db9={};var _0x2ec50b={'count':0x0,'rows':[]};return db[_0x9f3c('0x3e')][_0x9f3c('0x67')]({'where':{'id':_0x3c6f21[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x1ced9f,null))[_0x9f3c('0x36')](function(_0x493d4e){if(_0x493d4e){_0x199db9[_0x9f3c('0x46')]=_['keys'](db[_0x9f3c('0x66')][_0x9f3c('0x3f')]);_0x199db9[_0x9f3c('0x43')]=_[_0x9f3c('0x42')](_0x3c6f21[_0x9f3c('0x43')]);_0x199db9[_0x9f3c('0x44')]=_[_0x9f3c('0x45')](_0x199db9[_0x9f3c('0x46')],_0x199db9[_0x9f3c('0x43')]);_0x3f172f[_0x9f3c('0x48')]=_[_0x9f3c('0x45')](_0x199db9[_0x9f3c('0x46')],qs[_0x9f3c('0x47')](_0x3c6f21[_0x9f3c('0x43')][_0x9f3c('0x47')]));_0x3f172f[_0x9f3c('0x48')]=_0x3f172f['attributes'][_0x9f3c('0x68')]?_0x3f172f[_0x9f3c('0x48')]:_0x199db9['model'];if(!_0x3c6f21['query'][_0x9f3c('0x69')]('nolimit')){_0x3f172f['limit']=qs['limit'](_0x3c6f21['query']['limit']);_0x3f172f[_0x9f3c('0x2b')]=qs['offset'](_0x3c6f21['query'][_0x9f3c('0x2b')]);}_0x3f172f[_0x9f3c('0x4a')]=qs[_0x9f3c('0x4b')](_0x3c6f21['query'][_0x9f3c('0x4b')]);_0x3f172f[_0x9f3c('0x4e')]=qs['filters'](_[_0x9f3c('0x4c')](_0x3c6f21['query'],_0x199db9[_0x9f3c('0x44')]));_0x3f172f[_0x9f3c('0x4e')][_0x9f3c('0x65')]=_0x493d4e['id'];if(_0x3c6f21[_0x9f3c('0x43')][_0x9f3c('0x4d')]){_0x3f172f['where']=_[_0x9f3c('0x58')](_0x3f172f['where'],{'$or':_['map'](_0x3f172f['attributes'],function(_0x39a97f){var _0xf48cd7={};_0xf48cd7[_0x39a97f]={'$like':'%'+_0x3c6f21[_0x9f3c('0x43')]['filter']+'%'};return _0xf48cd7;})});}_0x3f172f=_[_0x9f3c('0x58')]({},_0x3f172f,_0x3c6f21['options']);return db[_0x9f3c('0x66')][_0x9f3c('0x2d')]({'where':_0x3f172f[_0x9f3c('0x4e')]})['then'](function(_0x3fc99a){_0x2ec50b[_0x9f3c('0x2d')]=_0x3fc99a;if(_0x3c6f21[_0x9f3c('0x43')][_0x9f3c('0x52')]){_0x3f172f[_0x9f3c('0x53')]=[{'all':!![]}];}return db[_0x9f3c('0x66')][_0x9f3c('0x54')](_0x3f172f);})[_0x9f3c('0x36')](function(_0x1fa769){_0x2ec50b[_0x9f3c('0x55')]=_0x1fa769;return _0x2ec50b;});}})[_0x9f3c('0x36')](respondWithFilteredResult(_0x1ced9f,_0x3f172f))[_0x9f3c('0x61')](handleError(_0x1ced9f,null));};exports[_0x9f3c('0x6a')]=function(_0x1f8d6a,_0x109e4c,_0x29400b){return db[_0x9f3c('0x3e')][_0x9f3c('0x59')]({'where':{'id':_0x1f8d6a[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x109e4c,null))[_0x9f3c('0x36')](function(_0x35ffb3){if(_0x35ffb3){return _0x35ffb3[_0x9f3c('0x6a')](_0x1f8d6a[_0x9f3c('0x43')][_0x9f3c('0x6b')]);}})['then'](respondWithStatusCode(_0x109e4c,null))[_0x9f3c('0x61')](handleError(_0x109e4c,null));};exports['addAnswer']=function(_0x471186,_0x16fd25,_0x2f69c0){if(_0x471186[_0x9f3c('0x5b')]['id']){delete _0x471186[_0x9f3c('0x5b')]['id'];}return db[_0x9f3c('0x3e')][_0x9f3c('0x59')]({'where':{'id':_0x471186['params']['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x16fd25,null))[_0x9f3c('0x36')](function(_0x59e95c){if(_0x59e95c){_0x471186[_0x9f3c('0x5b')]['FaxAccountId']=_0x59e95c['id'];return db[_0x9f3c('0x6c')]['create'](_0x471186['body']);}})[_0x9f3c('0x36')](respondWithResult(_0x16fd25,null))[_0x9f3c('0x61')](handleError(_0x16fd25,null));};exports[_0x9f3c('0x6d')]=function(_0x40065b,_0x3debce,_0x453813){var _0x2ff369={'raw':![],'where':{}};var _0x339288={};var _0x7d4600={'count':0x0,'rows':[]};return db[_0x9f3c('0x3e')][_0x9f3c('0x67')]({'where':{'id':_0x40065b[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x3debce,null))[_0x9f3c('0x36')](function(_0x15374c){if(_0x15374c){_0x339288['model']=_['keys'](db[_0x9f3c('0x6c')][_0x9f3c('0x3f')]);_0x339288[_0x9f3c('0x43')]=_['keys'](_0x40065b[_0x9f3c('0x43')]);_0x339288[_0x9f3c('0x44')]=_[_0x9f3c('0x45')](_0x339288[_0x9f3c('0x46')],_0x339288[_0x9f3c('0x43')]);_0x2ff369[_0x9f3c('0x48')]=_['intersection'](_0x339288[_0x9f3c('0x46')],qs[_0x9f3c('0x47')](_0x40065b[_0x9f3c('0x43')]['fields']));_0x2ff369[_0x9f3c('0x48')]=_0x2ff369[_0x9f3c('0x48')][_0x9f3c('0x68')]?_0x2ff369[_0x9f3c('0x48')]:_0x339288[_0x9f3c('0x46')];if(!_0x40065b[_0x9f3c('0x43')]['hasOwnProperty'](_0x9f3c('0x49'))){_0x2ff369[_0x9f3c('0x2e')]=qs['limit'](_0x40065b[_0x9f3c('0x43')]['limit']);_0x2ff369[_0x9f3c('0x2b')]=qs[_0x9f3c('0x2b')](_0x40065b[_0x9f3c('0x43')][_0x9f3c('0x2b')]);}_0x2ff369[_0x9f3c('0x4a')]=qs[_0x9f3c('0x4b')](_0x40065b[_0x9f3c('0x43')][_0x9f3c('0x4b')]);_0x2ff369[_0x9f3c('0x4e')]=qs[_0x9f3c('0x44')](_[_0x9f3c('0x4c')](_0x40065b[_0x9f3c('0x43')],_0x339288[_0x9f3c('0x44')]));_0x2ff369['where'][_0x9f3c('0x65')]=_0x15374c['id'];if(_0x40065b['query'][_0x9f3c('0x4d')]){_0x2ff369[_0x9f3c('0x4e')]=_[_0x9f3c('0x58')](_0x2ff369[_0x9f3c('0x4e')],{'$or':_[_0x9f3c('0x3d')](_0x2ff369['attributes'],function(_0x2a51b5){var _0x2228eb={};_0x2228eb[_0x2a51b5]={'$like':'%'+_0x40065b[_0x9f3c('0x43')][_0x9f3c('0x4d')]+'%'};return _0x2228eb;})});}_0x2ff369=_[_0x9f3c('0x58')]({},_0x2ff369,_0x40065b['options']);return db[_0x9f3c('0x6c')][_0x9f3c('0x2d')]({'where':_0x2ff369['where']})['then'](function(_0x58e912){_0x7d4600[_0x9f3c('0x2d')]=_0x58e912;if(_0x40065b[_0x9f3c('0x43')]['includeAll']){_0x2ff369[_0x9f3c('0x53')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2ff369);})['then'](function(_0x290ffc){_0x7d4600[_0x9f3c('0x55')]=_0x290ffc;return _0x7d4600;});}})['then'](respondWithFilteredResult(_0x3debce,_0x2ff369))[_0x9f3c('0x61')](handleError(_0x3debce,null));};exports['removeAnswers']=function(_0x51857b,_0x1d9352,_0x406d67){return db[_0x9f3c('0x3e')][_0x9f3c('0x59')]({'where':{'id':_0x51857b[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x1d9352,null))[_0x9f3c('0x36')](function(_0x4a201c){if(_0x4a201c){return _0x4a201c[_0x9f3c('0x6e')](_0x51857b[_0x9f3c('0x43')][_0x9f3c('0x6b')]);}})['then'](respondWithStatusCode(_0x1d9352,null))['catch'](handleError(_0x1d9352,null));};exports['addInteraction']=function(_0x1f0501,_0x426e1d,_0x16ead5){return db['FaxInteraction']['find']({'where':{'id':_0x1f0501['params']['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x426e1d,null))['then'](function(_0x512a9c){if(_0x512a9c){return _0x512a9c[_0x9f3c('0x6f')](_0x1f0501['body'][_0x9f3c('0x6b')],_[_0x9f3c('0x70')](_0x1f0501[_0x9f3c('0x5b')],[_0x9f3c('0x6b'),'id'])||{});}})[_0x9f3c('0x36')](respondWithResult(_0x426e1d,null))[_0x9f3c('0x61')](handleError(_0x426e1d,null));};exports[_0x9f3c('0x71')]=function(_0x229981,_0x18c0bc,_0x4aad37){var _0x180006={'raw':![],'where':{}};var _0x856ca5={};var _0x337d18={'count':0x0,'rows':[]};return db[_0x9f3c('0x3e')][_0x9f3c('0x67')]({'where':{'id':_0x229981[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x18c0bc,null))['then'](function(_0x539145){if(_0x539145){_0x856ca5['model']=_[_0x9f3c('0x42')](db['FaxInteraction']['rawAttributes']);_0x856ca5[_0x9f3c('0x43')]=_[_0x9f3c('0x42')](_0x229981[_0x9f3c('0x43')]);_0x856ca5['filters']=_[_0x9f3c('0x45')](_0x856ca5[_0x9f3c('0x46')],_0x856ca5[_0x9f3c('0x43')]);_0x180006[_0x9f3c('0x48')]=_[_0x9f3c('0x45')](_0x856ca5['model'],qs[_0x9f3c('0x47')](_0x229981['query'][_0x9f3c('0x47')]));_0x180006['attributes']=_0x180006[_0x9f3c('0x48')][_0x9f3c('0x68')]?_0x180006[_0x9f3c('0x48')]:_0x856ca5[_0x9f3c('0x46')];if(!_0x229981[_0x9f3c('0x43')][_0x9f3c('0x69')](_0x9f3c('0x49'))){_0x180006[_0x9f3c('0x2e')]=qs[_0x9f3c('0x2e')](_0x229981[_0x9f3c('0x43')][_0x9f3c('0x2e')]);_0x180006[_0x9f3c('0x2b')]=qs[_0x9f3c('0x2b')](_0x229981[_0x9f3c('0x43')][_0x9f3c('0x2b')]);}_0x180006[_0x9f3c('0x4a')]=qs['sort'](_0x229981[_0x9f3c('0x43')][_0x9f3c('0x4b')]);_0x180006[_0x9f3c('0x4e')]=qs['filters'](_[_0x9f3c('0x4c')](_0x229981[_0x9f3c('0x43')],_0x856ca5[_0x9f3c('0x44')]));_0x180006[_0x9f3c('0x4e')]['FaxAccountId']=_0x539145['id'];if(_0x229981[_0x9f3c('0x43')][_0x9f3c('0x4d')]){_0x180006[_0x9f3c('0x4e')]=_['merge'](_0x180006[_0x9f3c('0x4e')],{'$or':_['map'](_0x180006['attributes'],function(_0x1aa1f8){var _0x568e25={};_0x568e25[_0x1aa1f8]={'$like':'%'+_0x229981['query']['filter']+'%'};return _0x568e25;})});}_0x180006=_[_0x9f3c('0x58')]({},_0x180006,_0x229981['options']);return db[_0x9f3c('0x72')][_0x9f3c('0x2d')]({'where':_0x180006[_0x9f3c('0x4e')]})[_0x9f3c('0x36')](function(_0x13f7a0){_0x337d18[_0x9f3c('0x2d')]=_0x13f7a0;if(_0x229981[_0x9f3c('0x43')]['includeAll']){_0x180006['include']=[{'model':db[_0x9f3c('0x73')],'as':_0x9f3c('0x74'),'required':![]},{'model':db['User'],'as':_0x9f3c('0x75'),'attributes':[_0x9f3c('0x50'),'fullname',_0x9f3c('0x76')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9f3c('0x50'),_0x9f3c('0x77')],'where':_0x229981[_0x9f3c('0x43')][_0x9f3c('0x78')]?{'id':_0x229981[_0x9f3c('0x43')]['tag']}:undefined,'required':_0x229981[_0x9f3c('0x43')][_0x9f3c('0x78')]?!![]:![]}];}return db[_0x9f3c('0x72')][_0x9f3c('0x54')](_0x180006);})[_0x9f3c('0x36')](function(_0x5a2006){_0x337d18[_0x9f3c('0x55')]=_0x5a2006;return _0x337d18;});}})[_0x9f3c('0x36')](respondWithFilteredResult(_0x18c0bc,_0x180006))[_0x9f3c('0x61')](handleError(_0x18c0bc,null));};exports[_0x9f3c('0x79')]=function(_0x381314,_0x41766b,_0x543b16){return db[_0x9f3c('0x3e')][_0x9f3c('0x67')]({'where':{'id':_0x381314['params']['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x41766b,null))[_0x9f3c('0x36')](function(_0x9d5ef9){if(_0x9d5ef9){return db['sequelize'][_0x9f3c('0x7a')](function(_0x3a3825){return db[_0x9f3c('0x7b')][_0x9f3c('0x35')]({'where':{'FaxAccountId':_0x381314[_0x9f3c('0x56')]['id']},'transaction':_0x3a3825})['then'](function(_0x56ba1e){var _0x368251=_[_0x9f3c('0x3d')](_0x381314[_0x9f3c('0x5b')],function(_0x3fb1ae){_0x3fb1ae[_0x9f3c('0x65')]=_0x381314[_0x9f3c('0x56')]['id'];return _0x3fb1ae;});return db[_0x9f3c('0x7b')]['bulkCreate'](_0x368251,{'transaction':_0x3a3825});});})[_0x9f3c('0x36')](function(){return db['FaxApplication'][_0x9f3c('0x7c')]({'where':{'FaxAccountId':_0x381314[_0x9f3c('0x56')]['id']},'order':'priority'});});}})[_0x9f3c('0x36')](respondWithResult(_0x41766b,null))[_0x9f3c('0x61')](handleError(_0x41766b,null));};exports[_0x9f3c('0x7d')]=function(_0x22ebc0,_0x2d76fc,_0x31e1f2){var _0x596748={};var _0x247c1d={};var _0x40b8dc;var _0x3789a2;return db[_0x9f3c('0x3e')][_0x9f3c('0x67')]({'where':{'id':_0x22ebc0[_0x9f3c('0x56')]['id']}})['then'](handleEntityNotFound(_0x2d76fc,null))[_0x9f3c('0x36')](function(_0x22fb54){if(_0x22fb54){_0x40b8dc=_0x22fb54;_0x247c1d['model']=_[_0x9f3c('0x42')](db['FaxApplication'][_0x9f3c('0x3f')]);_0x247c1d[_0x9f3c('0x43')]=_[_0x9f3c('0x42')](_0x22ebc0['query']);_0x247c1d[_0x9f3c('0x44')]=_[_0x9f3c('0x45')](_0x247c1d[_0x9f3c('0x46')],_0x247c1d[_0x9f3c('0x43')]);_0x596748[_0x9f3c('0x48')]=_[_0x9f3c('0x45')](_0x247c1d[_0x9f3c('0x46')],qs[_0x9f3c('0x47')](_0x22ebc0[_0x9f3c('0x43')][_0x9f3c('0x47')]));_0x596748['attributes']=_0x596748[_0x9f3c('0x48')][_0x9f3c('0x68')]?_0x596748[_0x9f3c('0x48')]:_0x247c1d[_0x9f3c('0x46')];_0x596748['order']=qs[_0x9f3c('0x4b')](_0x22ebc0['query'][_0x9f3c('0x4b')]);_0x596748[_0x9f3c('0x4e')]=qs['filters'](_[_0x9f3c('0x4c')](_0x22ebc0[_0x9f3c('0x43')],_0x247c1d[_0x9f3c('0x44')]));if(_0x22ebc0['query'][_0x9f3c('0x4d')]){_0x596748[_0x9f3c('0x4e')]=_[_0x9f3c('0x58')](_0x596748[_0x9f3c('0x4e')],{'$or':_[_0x9f3c('0x3d')](_0x596748[_0x9f3c('0x48')],function(_0x593cec){var _0x530042={};_0x530042[_0x593cec]={'$like':'%'+_0x22ebc0[_0x9f3c('0x43')]['filter']+'%'};return _0x530042;})});}_0x596748=_['merge']({},_0x596748,_0x22ebc0['options']);return _0x40b8dc[_0x9f3c('0x7d')](_0x596748);}})['then'](function(_0x112dce){if(_0x112dce){_0x3789a2=_0x112dce[_0x9f3c('0x68')];if(!_0x22ebc0[_0x9f3c('0x43')]['hasOwnProperty'](_0x9f3c('0x49'))){_0x596748[_0x9f3c('0x2e')]=qs[_0x9f3c('0x2e')](_0x22ebc0[_0x9f3c('0x43')][_0x9f3c('0x2e')]);_0x596748[_0x9f3c('0x2b')]=qs['offset'](_0x22ebc0[_0x9f3c('0x43')]['offset']);}return _0x40b8dc['getApplications'](_0x596748);}})[_0x9f3c('0x36')](function(_0x1eeabe){if(_0x1eeabe){return _0x1eeabe?{'count':_0x3789a2,'rows':_0x1eeabe}:null;}})[_0x9f3c('0x36')](respondWithResult(_0x2d76fc,null))[_0x9f3c('0x61')](handleError(_0x2d76fc,null));};function Extension(_0x3f5105,_0x1d7cd6,_0x43fc3d,_0x1da526){this[_0x9f3c('0x7e')]=_0x9f3c('0x7f');this[_0x9f3c('0x80')]=_0x3f5105[_0x9f3c('0x81')];this[_0x9f3c('0x82')]=_0x1da526;this[_0x9f3c('0x4f')]='system';this[_0x9f3c('0x83')]=_0x9f3c('0x84');this[_0x9f3c('0x65')]=_0x3f5105['id'];this['priority']=_0x1d7cd6;this[_0x9f3c('0x85')]=_0x43fc3d;}function createExtensionsReciveFax(_0x20f886){var _0x508d6f=0x1;var _0x28f2a9=[];_0x28f2a9[_0x9f3c('0x86')](new Extension(_0x20f886,_0x508d6f,'','Answer'));_0x508d6f+=0x1;_0x28f2a9[_0x9f3c('0x86')](new Extension(_0x20f886,_0x508d6f,_0x9f3c('0x87'),_0x9f3c('0x88')));_0x508d6f+=0x1;for(var _0x3e3e67 in _0x20f886){if(_0x20f886[_0x9f3c('0x69')](_0x3e3e67)&&(_0x3e3e67===_0x9f3c('0x89')||_0x3e3e67===_0x9f3c('0x81')||_0x3e3e67==='gateway'||_0x3e3e67==='faxdetect'||_0x3e3e67===_0x9f3c('0x8a')||_0x3e3e67===_0x9f3c('0x8b')||_0x3e3e67==='minrate'||_0x3e3e67===_0x9f3c('0x8c')||_0x3e3e67===_0x9f3c('0x8d'))){_0x28f2a9[_0x9f3c('0x86')](new Extension(_0x20f886,_0x508d6f,_0x9f3c('0x8e')+_0x3e3e67+')='+_0x20f886[_0x3e3e67],_0x9f3c('0x88')));_0x508d6f+=0x1;}}_0x28f2a9[_0x9f3c('0x86')](new Extension(_0x20f886,_0x508d6f,'6',_0x9f3c('0x8f')));_0x508d6f+=0x1;_0x28f2a9['push'](new Extension(_0x20f886,_0x508d6f,_0x9f3c('0x90'),_0x9f3c('0x91')));_0x508d6f=0x0;return _0x28f2a9;}exports[_0x9f3c('0x92')]=function(_0x2e872e,_0x3f6bac,_0x29ec7c){var _0x5d3364;return db[_0x9f3c('0x93')][_0x9f3c('0x7a')](function(_0x323269){return db[_0x9f3c('0x3e')][_0x9f3c('0x5a')](_0x2e872e[_0x9f3c('0x5b')],{'transaction':_0x323269})[_0x9f3c('0x36')](function(_0x517e70){_0x5d3364=_0x517e70[_0x9f3c('0x5d')]({'plain':!![]});return db[_0x9f3c('0x94')][_0x9f3c('0x95')](createExtensionsReciveFax(_0x5d3364),{'transaction':_0x323269});});})[_0x9f3c('0x36')](function(){return _0x5d3364;})[_0x9f3c('0x36')](respondWithResult(_0x3f6bac,null))[_0x9f3c('0x61')](handleError(_0x3f6bac,null));};exports[_0x9f3c('0x96')]=function(_0x3b4840,_0x230c65,_0x31131b){var _0x3159e4;return db['sequelize'][_0x9f3c('0x7a')](function(_0x877770){return db['FaxAccount'][_0x9f3c('0x34')](_0x3b4840[_0x9f3c('0x5b')],{'where':{'id':_0x3b4840[_0x9f3c('0x5b')]['id']},'transaction':_0x877770})['then'](function(_0x5154f9){return db[_0x9f3c('0x94')][_0x9f3c('0x35')]({'where':{'FaxAccountId':_0x3b4840[_0x9f3c('0x5b')]['id']},'transaction':_0x877770})[_0x9f3c('0x36')](function(_0x59836c){return db[_0x9f3c('0x94')][_0x9f3c('0x95')](createExtensionsReciveFax(_[_0x9f3c('0x70')](_0x3b4840[_0x9f3c('0x5b')],[_0x9f3c('0x97'),_0x9f3c('0x41'),'createdAt',_0x9f3c('0x98'),'TrunkId','ListId'])),{'transaction':_0x877770});});});})[_0x9f3c('0x36')](function(){return db['FaxAccount']['findById'](_0x3b4840[_0x9f3c('0x5b')]['id']);})[_0x9f3c('0x36')](respondWithResult(_0x230c65,null))[_0x9f3c('0x61')](handleError(_0x230c65,null));};exports[_0x9f3c('0x99')]=function(_0x37c60d,_0x426662,_0x302de3){var _0x3d9f7c={'raw':!![],'where':{}};var _0x52bf4e={};var _0x2db5c7={'count':0x0,'rows':[]};return db[_0x9f3c('0x3e')][_0x9f3c('0x67')]({'where':{'id':_0x37c60d[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x426662,null))['then'](function(_0x3b6726){if(_0x3b6726){_0x52bf4e['model']=_['keys'](db[_0x9f3c('0x9a')]['rawAttributes']);_0x52bf4e['query']=_[_0x9f3c('0x42')](_0x37c60d[_0x9f3c('0x43')]);_0x52bf4e[_0x9f3c('0x44')]=_[_0x9f3c('0x45')](_0x52bf4e['model'],_0x52bf4e[_0x9f3c('0x43')]);_0x3d9f7c['attributes']=_[_0x9f3c('0x45')](_0x52bf4e[_0x9f3c('0x46')],qs[_0x9f3c('0x47')](_0x37c60d[_0x9f3c('0x43')]['fields']));_0x3d9f7c[_0x9f3c('0x48')]=_0x3d9f7c[_0x9f3c('0x48')]['length']?_0x3d9f7c[_0x9f3c('0x48')]:_0x52bf4e[_0x9f3c('0x46')];if(!_0x37c60d[_0x9f3c('0x43')]['hasOwnProperty'](_0x9f3c('0x49'))){_0x3d9f7c['limit']=qs[_0x9f3c('0x2e')](_0x37c60d[_0x9f3c('0x43')][_0x9f3c('0x2e')]);_0x3d9f7c[_0x9f3c('0x2b')]=qs['offset'](_0x37c60d[_0x9f3c('0x43')]['offset']);}_0x3d9f7c[_0x9f3c('0x4a')]=qs[_0x9f3c('0x4b')](_0x37c60d['query'][_0x9f3c('0x4b')]);_0x3d9f7c[_0x9f3c('0x4e')]=qs[_0x9f3c('0x44')](_[_0x9f3c('0x4c')](_0x37c60d[_0x9f3c('0x43')],_0x52bf4e[_0x9f3c('0x44')]));_0x3d9f7c['where'][_0x9f3c('0x65')]=_0x3b6726['id'];if(_0x37c60d[_0x9f3c('0x43')][_0x9f3c('0x4d')]){_0x3d9f7c[_0x9f3c('0x4e')]=_[_0x9f3c('0x58')](_0x3d9f7c['where'],{'$or':_['map'](_0x3d9f7c[_0x9f3c('0x48')],function(_0x4b0733){var _0x556b67={};_0x556b67[_0x4b0733]={'$like':'%'+_0x37c60d[_0x9f3c('0x43')][_0x9f3c('0x4d')]+'%'};return _0x556b67;})});}if(_0x37c60d[_0x9f3c('0x43')][_0x9f3c('0x9b')]){var _0x52ea16=_0x37c60d['query'][_0x9f3c('0x9b')][_0x9f3c('0x9c')](',');var _0x30c65f={};_0x30c65f[_0x52ea16[0x0]]={'$gte':moment(_0x52ea16[0x1])[_0x9f3c('0x9d')](_0x9f3c('0x9e'))};_0x3d9f7c['where']=_[_0x9f3c('0x58')](_0x3d9f7c[_0x9f3c('0x4e')],_0x30c65f);}_0x3d9f7c=_['merge']({},_0x3d9f7c,_0x37c60d[_0x9f3c('0x51')]);return db[_0x9f3c('0x9a')]['count']({'where':_0x3d9f7c[_0x9f3c('0x4e')]})[_0x9f3c('0x36')](function(_0x1c0a31){_0x2db5c7[_0x9f3c('0x2d')]=_0x1c0a31;if(_0x37c60d[_0x9f3c('0x43')][_0x9f3c('0x52')]){_0x3d9f7c[_0x9f3c('0x53')]=[{'all':!![]}];}return db[_0x9f3c('0x9a')]['findAll'](_0x3d9f7c);})[_0x9f3c('0x36')](function(_0x3a39f6){_0x2db5c7['rows']=_0x3a39f6;return _0x2db5c7;});}})[_0x9f3c('0x36')](respondWithFilteredResult(_0x426662,_0x3d9f7c))[_0x9f3c('0x61')](handleError(_0x426662,null));};exports['send']=function(_0x36c112,_0x4a6658,_0x123f08){var _0x284cef,_0x1ed231={},_0xdfba2d;if(_0x36c112[_0x9f3c('0x5b')]['to']){_0xdfba2d=_0x36c112[_0x9f3c('0x5b')]['to'][0x0];}return db[_0x9f3c('0x3e')][_0x9f3c('0x59')]({'where':{'id':_0x36c112['params']['id']},'include':[{'model':db[_0x9f3c('0x9f')],'as':_0x9f3c('0xa0'),'include':[{'model':db[_0x9f3c('0x73')],'as':_0x9f3c('0xa1'),'where':{'fax':_0xdfba2d},'limit':0x1,'order':[['updatedAt',_0x9f3c('0xa2')]]}]}]})['then'](handleEntityNotFound(_0x4a6658,null))[_0x9f3c('0x36')](function(_0x1ad7d9){_0x284cef=_0x1ad7d9;if(_0x36c112['body'][_0x9f3c('0xa3')]&&_0x36c112['body'][_0x9f3c('0xa3')][_0x9f3c('0x68')]){for(var _0x1e8563=0x0;_0x1e8563<_0x36c112['body'][_0x9f3c('0xa3')][_0x9f3c('0x68')];_0x1e8563+=0x1){_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][_0x1e8563]={'filename':_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][_0x1e8563][_0x9f3c('0x50')],'id':_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][_0x1e8563]['id'],'path':path[_0x9f3c('0xa4')](config[_0x9f3c('0xa5')],_0x9f3c('0xa6'),_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][_0x1e8563]['basename'])};}}return respondWithRpcPromise(_0x9f3c('0xa7'),_0x9f3c('0xa7'),{'FaxAccountId':_[_0x9f3c('0xa8')](_0x36c112[_0x9f3c('0x56')]['id'])?undefined:_0x36c112[_0x9f3c('0x56')]['id'],'path':_[_0x9f3c('0xa8')](_0x36c112['body'][_0x9f3c('0xa3')][0x0]['path'])?undefined:_0x36c112[_0x9f3c('0x5b')]['attachments'][0x0][_0x9f3c('0x7')],'fax':_[_0x9f3c('0xa8')](_0x36c112[_0x9f3c('0x5b')]['to'][0x0])?undefined:_0x36c112[_0x9f3c('0x5b')]['to'][0x0]},client9002);})[_0x9f3c('0x36')](function(){if(_0x284cef){if(_[_0x9f3c('0xa8')](_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa9')])){_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa9')]=util['format'](_0x9f3c('0xaa'),_0x284cef['name'],_0x284cef[_0x9f3c('0xab')]);}if(_0x284cef[_0x9f3c('0xa0')]){if(_0x284cef[_0x9f3c('0xa0')][_0x9f3c('0xa1')][_0x9f3c('0x68')]){return _0x284cef[_0x9f3c('0xa0')][_0x9f3c('0xa1')][0x0];}else{return db[_0x9f3c('0x73')]['create'](_['defaults'](_0x36c112[_0x9f3c('0x5b')],{'firstName':_0x36c112[_0x9f3c('0x5b')]['to'][0x0],'phone':_0x36c112[_0x9f3c('0x5b')]['to'][0x0],'fax':_0x36c112[_0x9f3c('0x5b')]['to'][0x0],'ListId':_0x284cef['ListId']}));}}else{throw new Error(_0x9f3c('0xac'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x26d90a){if(_0x26d90a){return db[_0x9f3c('0x72')][_0x9f3c('0x59')]({'where':{'ContactId':_0x26d90a['id'],'closed':![],'FaxAccountId':_0x284cef['id']}})[_0x9f3c('0x36')](function(_0x284de5){if(_0x284de5){return[_0x284de5,![]];}return db['FaxInteraction']['create']({'UserId':_0x36c112[_0x9f3c('0x5c')]['id'],'ContactId':_0x26d90a['id'],'FaxAccountId':_0x284cef['id'],'fax':_0x36c112[_0x9f3c('0x5b')]['to'][0x0],'firstMsgDirection':_0x9f3c('0xad'),'Messages':[_[_0x9f3c('0x58')](_0x36c112['body'],{'read':![],'body':_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][0x0][_0x9f3c('0xae')],'FaxAccountId':_0x284cef['id'],'UserId':_0x36c112['user']['id'],'ContactId':_0x26d90a['id'],'AttachmentId':_0x36c112[_0x9f3c('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x9f3c('0x9a')],'as':_0x9f3c('0xaf')}]})[_0x9f3c('0x36')](function(_0x49739d){return[_0x49739d,!![]];});});}else{throw new Error(_0x9f3c('0xb0'));}})[_0x9f3c('0xb1')](function(_0xb174f1,_0x200553){if(_0x200553){return _0xb174f1;}return db[_0x9f3c('0x9a')][_0x9f3c('0x5a')]({'direction':_0x9f3c('0xad'),'read':![],'body':_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][0x0][_0x9f3c('0xae')],'FaxAccountId':_0x284cef['id'],'FaxInteractionId':_0xb174f1['id'],'UserId':_0x36c112[_0x9f3c('0x5c')]['id'],'ContactId':_0xb174f1[_0x9f3c('0xb2')],'AttachmentId':_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][0x0]['id']})[_0x9f3c('0x36')](function(_0x40cc02){_0xb174f1[_0x9f3c('0xb3')][_0x9f3c('0xaf')]=[];_0xb174f1[_0x9f3c('0xb3')]['Messages']['push'](_0x40cc02[_0x9f3c('0xb3')]);return _0xb174f1;});})['then'](function(_0x253eeb){respondWithRpcPromise(_0x9f3c('0xb4'),_0x9f3c('0xb4'),{'FaxAccountId':_[_0x9f3c('0xa8')](_0x36c112[_0x9f3c('0x56')]['id'])?undefined:_0x36c112['params']['id'],'path':_[_0x9f3c('0xa8')](_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][0x0][_0x9f3c('0x7')])?undefined:_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][0x0]['path'],'fax':_[_0x9f3c('0xa8')](_0x36c112[_0x9f3c('0x5b')]['to'][0x0])?undefined:_0x36c112[_0x9f3c('0x5b')]['to'][0x0],'AttachmentId':_0x36c112[_0x9f3c('0x5b')][_0x9f3c('0xa3')][0x0]['id']},client9002)[_0x9f3c('0x36')](function(_0x58e2f0){logger['info'](_0x9f3c('0xb5'),_0x58e2f0);})['catch'](function(_0x32e54b){logger['info'](_0x9f3c('0xb5'),_0x32e54b);});return _0x253eeb;})[_0x9f3c('0x36')](respondWithResult(_0x4a6658,null))['catch'](handleError(_0x4a6658,null));};exports['addAgents']=function(_0x3b0ef9,_0x368fe8,_0x438efa){return db['FaxAccount'][_0x9f3c('0x59')]({'where':{'id':_0x3b0ef9[_0x9f3c('0x56')]['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x368fe8,null))['then'](function(_0x1b0dda){if(_0x1b0dda){return _0x1b0dda[_0x9f3c('0xb6')](_0x3b0ef9[_0x9f3c('0x5b')][_0x9f3c('0x6b')],_['omit'](_0x3b0ef9[_0x9f3c('0x5b')],['ids','id'])||{})['spread'](function(_0x2b3fbc){for(var _0x2d2792=0x0;_0x2d2792<_0x3b0ef9['body'][_0x9f3c('0x6b')]['length'];_0x2d2792+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x3b0ef9[_0x9f3c('0x5b')]['ids'][_0x2d2792]),'FaxAccountId':Number(_0x3b0ef9[_0x9f3c('0x56')]['id'])});}return _0x2b3fbc;});}})[_0x9f3c('0x36')](respondWithResult(_0x368fe8,null))[_0x9f3c('0x61')](handleError(_0x368fe8,null));};exports[_0x9f3c('0xb7')]=function(_0x2323e3,_0x160f40,_0xdc5da4){return db[_0x9f3c('0x3e')][_0x9f3c('0x59')]({'where':{'id':_0x2323e3['params']['id']}})[_0x9f3c('0x36')](handleEntityNotFound(_0x160f40,null))[_0x9f3c('0x36')](function(_0x351c07){if(_0x351c07){return _0x351c07[_0x9f3c('0xb7')](_0x2323e3[_0x9f3c('0x43')]['ids'])['then'](function(){if(_[_0x9f3c('0xb8')](_0x2323e3[_0x9f3c('0x43')]['ids'])){for(var _0x44286b=0x0;_0x44286b<_0x2323e3[_0x9f3c('0x43')][_0x9f3c('0x6b')][_0x9f3c('0x68')];_0x44286b+=0x1){socket[_0x9f3c('0xb9')](_0x9f3c('0xba'),{'UserId':Number(_0x2323e3['query']['ids'][_0x44286b]),'FaxAccountId':Number(_0x2323e3[_0x9f3c('0x56')]['id'])});}}else{socket['emit'](_0x9f3c('0xba'),{'UserId':Number(_0x2323e3[_0x9f3c('0x43')]['ids']),'FaxAccountId':Number(_0x2323e3[_0x9f3c('0x56')]['id'])});}});}})[_0x9f3c('0x36')](respondWithStatusCode(_0x160f40,null))[_0x9f3c('0x61')](handleError(_0x160f40,null));};exports[_0x9f3c('0xbb')]=function(_0x351f75,_0x4fe61f,_0x21d097){var _0x1093c={};var _0x5cf4bb={};var _0x5dabf1;var _0x31b4d8;return db[_0x9f3c('0x3e')][_0x9f3c('0x67')]({'where':{'id':_0x351f75['params']['id']}})['then'](handleEntityNotFound(_0x4fe61f,null))[_0x9f3c('0x36')](function(_0x106ab2){if(_0x106ab2){_0x5dabf1=_0x106ab2;_0x5cf4bb[_0x9f3c('0x46')]=_['keys'](db[_0x9f3c('0xbc')]['rawAttributes']);_0x5cf4bb[_0x9f3c('0x43')]=_[_0x9f3c('0x42')](_0x351f75[_0x9f3c('0x43')]);_0x5cf4bb[_0x9f3c('0x44')]=_['intersection'](_0x5cf4bb[_0x9f3c('0x46')],_0x5cf4bb[_0x9f3c('0x43')]);_0x1093c['attributes']=_[_0x9f3c('0x45')](_0x5cf4bb['model'],qs[_0x9f3c('0x47')](_0x351f75[_0x9f3c('0x43')][_0x9f3c('0x47')]));_0x1093c[_0x9f3c('0x48')]=_0x1093c['attributes']['length']?_0x1093c[_0x9f3c('0x48')]:_0x5cf4bb[_0x9f3c('0x46')];_0x1093c[_0x9f3c('0x4a')]=qs[_0x9f3c('0x4b')](_0x351f75[_0x9f3c('0x43')]['sort']);_0x1093c['where']=qs[_0x9f3c('0x44')](_[_0x9f3c('0x4c')](_0x351f75[_0x9f3c('0x43')],_0x5cf4bb[_0x9f3c('0x44')]));if(_0x351f75['query'][_0x9f3c('0x4d')]){_0x1093c['where']=_[_0x9f3c('0x58')](_0x1093c['where'],{'$or':_[_0x9f3c('0x3d')](_0x1093c[_0x9f3c('0x48')],function(_0x209f40){var _0xef3dda={};_0xef3dda[_0x209f40]={'$like':'%'+_0x351f75['query'][_0x9f3c('0x4d')]+'%'};return _0xef3dda;})});}_0x1093c=_['merge']({},_0x1093c,_0x351f75[_0x9f3c('0x51')]);return _0x5dabf1[_0x9f3c('0xbb')](_0x1093c);}})[_0x9f3c('0x36')](function(_0x23ec8f){if(_0x23ec8f){_0x31b4d8=_0x23ec8f['length'];if(!_0x351f75[_0x9f3c('0x43')][_0x9f3c('0x69')](_0x9f3c('0x49'))){_0x1093c[_0x9f3c('0x2e')]=qs[_0x9f3c('0x2e')](_0x351f75[_0x9f3c('0x43')][_0x9f3c('0x2e')]);_0x1093c[_0x9f3c('0x2b')]=qs[_0x9f3c('0x2b')](_0x351f75[_0x9f3c('0x43')][_0x9f3c('0x2b')]);}return _0x5dabf1[_0x9f3c('0xbb')](_0x1093c);}})['then'](function(_0x2df38b){if(_0x2df38b){return _0x2df38b?{'count':_0x31b4d8,'rows':_0x2df38b}:null;}})[_0x9f3c('0x36')](respondWithResult(_0x4fe61f,null))[_0x9f3c('0x61')](handleError(_0x4fe61f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 9c620b8..1880bdd 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 _0x8294=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x243d1d,_0x411c28){var _0x2c1abc=function(_0x245bd0){while(--_0x245bd0){_0x243d1d['push'](_0x243d1d['shift']());}};_0x2c1abc(++_0x411c28);}(_0x8294,0x1c6));var _0x4829=function(_0x10eef5,_0x440eb8){_0x10eef5=_0x10eef5-0x0;var _0x4981b0=_0x8294[_0x10eef5];return _0x4981b0;};'use strict';var EventEmitter=require(_0x4829('0x0'));var FaxAccount=require(_0x4829('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4829('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4829('0x3')};function emitEvent(_0x31c3ac){return function(_0x27a714,_0x494a7d,_0x1cbde3){FaxAccountEvents['emit'](_0x31c3ac+':'+_0x27a714['id'],_0x27a714);FaxAccountEvents[_0x4829('0x4')](_0x31c3ac,_0x27a714);_0x1cbde3(null);};}for(var e in events){if(events[_0x4829('0x5')](e)){var event=events[e];FaxAccount[_0x4829('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x428e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x2cab71,_0x2f3e37){var _0xf6083b=function(_0x2189c9){while(--_0x2189c9){_0x2cab71['push'](_0x2cab71['shift']());}};_0xf6083b(++_0x2f3e37);}(_0x428e,0x1eb));var _0xe428=function(_0x4001ad,_0x1e22dd){_0x4001ad=_0x4001ad-0x0;var _0x4c7ec2=_0x428e[_0x4001ad];return _0x4c7ec2;};'use strict';var EventEmitter=require(_0xe428('0x0'));var FaxAccount=require(_0xe428('0x1'))['db'][_0xe428('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe428('0x3')](0x0);var events={'afterCreate':_0xe428('0x4'),'afterUpdate':_0xe428('0x5'),'afterDestroy':_0xe428('0x6')};function emitEvent(_0x173cd2){return function(_0x142bd2,_0x2b1cda,_0x837c07){FaxAccountEvents[_0xe428('0x7')](_0x173cd2+':'+_0x142bd2['id'],_0x142bd2);FaxAccountEvents['emit'](_0x173cd2,_0x142bd2);_0x837c07(null);};}for(var e in events){if(events[_0xe428('0x8')](e)){var event=events[e];FaxAccount[_0xe428('0x9')](e,emitEvent(event));}}module[_0xe428('0xa')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 80feda4..baeb85b 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 _0x8fa0=['fax_accounts','lodash','util','api','moment','bluebird','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x266599,_0x3edbee){var _0x12ac8a=function(_0x42ed59){while(--_0x42ed59){_0x266599['push'](_0x266599['shift']());}};_0x12ac8a(++_0x3edbee);}(_0x8fa0,0xd3));var _0x08fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8fa0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x08fa('0x0'));var util=require(_0x08fa('0x1'));var logger=require('../../config/logger')(_0x08fa('0x2'));var moment=require(_0x08fa('0x3'));var BPromise=require(_0x08fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x08fa('0x5'));var attributes=require(_0x08fa('0x6'));module[_0x08fa('0x7')]=function(_0x5cdcc4,_0x31182e){return _0x5cdcc4[_0x08fa('0x8')]('FaxAccount',attributes,{'tableName':_0x08fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff78=['api','moment','request-promise','./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger'];(function(_0x54008b,_0x51e80c){var _0x4ee7ef=function(_0x1f54ad){while(--_0x1f54ad){_0x54008b['push'](_0x54008b['shift']());}};_0x4ee7ef(++_0x51e80c);}(_0xff78,0x183));var _0x8ff7=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0xff78[_0x4e4519];return _0x340044;};'use strict';var _=require(_0x8ff7('0x0'));var util=require(_0x8ff7('0x1'));var logger=require(_0x8ff7('0x2'))(_0x8ff7('0x3'));var moment=require(_0x8ff7('0x4'));var BPromise=require('bluebird');var rp=require(_0x8ff7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ff7('0x6'));module[_0x8ff7('0x7')]=function(_0x264350,_0xeab794){return _0x264350[_0x8ff7('0x8')]('FaxAccount',attributes,{'tableName':_0x8ff7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index f2a701d..dd4dba1 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 _0x82b8=['NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','difference','createdAt','keys','updatedAt','CompanyId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','Applications','get','applications','list','orderBy','priority','ListId','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','create','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','FaxAccount','options','attributes','include','model','map','GetFaxAccount','stringify','catch'];(function(_0x3d6785,_0x492ea3){var _0x39a624=function(_0x27d7db){while(--_0x27d7db){_0x3d6785['push'](_0x3d6785['shift']());}};_0x39a624(++_0x492ea3);}(_0x82b8,0x93));var _0x882b=function(_0x1bd627,_0x4a0d53){_0x1bd627=_0x1bd627-0x0;var _0x58b7a2=_0x82b8[_0x1bd627];return _0x58b7a2;};'use strict';var _=require('lodash');var util=require(_0x882b('0x0'));var moment=require(_0x882b('0x1'));var BPromise=require(_0x882b('0x2'));var rs=require(_0x882b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x882b('0x4'));var logger=require(_0x882b('0x5'))('rpc');var config=require(_0x882b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x882b('0x7')][_0x882b('0x8')]({'port':0x232c});config[_0x882b('0x9')]=_[_0x882b('0xa')](config[_0x882b('0x9')],{'host':_0x882b('0xb'),'port':0x18eb});var socket=require(_0x882b('0xc'))(new Redis(config['redis']));require(_0x882b('0xd'))['register'](socket);function respondWithRpcPromise(_0x1c37b3,_0x53d79b,_0x410b71){return new BPromise(function(_0x4dee96,_0x35f8d7){return client['request'](_0x1c37b3,_0x410b71)[_0x882b('0xe')](function(_0x143d00){logger[_0x882b('0xf')](_0x882b('0x10'),_0x53d79b,_0x882b('0x11'));logger[_0x882b('0x12')](_0x882b('0x13'),_0x53d79b,_0x882b('0x11'),JSON['stringify'](_0x143d00));if(_0x143d00[_0x882b('0x14')]){if(_0x143d00[_0x882b('0x14')][_0x882b('0x15')]===0x1f4){logger[_0x882b('0x14')](_0x882b('0x10'),_0x53d79b,_0x143d00[_0x882b('0x14')][_0x882b('0x16')]);return _0x35f8d7(_0x143d00[_0x882b('0x14')]['message']);}logger['error'](_0x882b('0x10'),_0x53d79b,_0x143d00[_0x882b('0x14')][_0x882b('0x16')]);return _0x4dee96(_0x143d00['error']['message']);}else{logger[_0x882b('0xf')]('FaxAccount,\x20%s,\x20%s',_0x53d79b,_0x882b('0x11'));_0x4dee96(_0x143d00[_0x882b('0x17')][_0x882b('0x16')]);}})['catch'](function(_0x1a1a63){logger[_0x882b('0x14')]('FaxAccount,\x20%s,\x20%s',_0x53d79b,_0x1a1a63);_0x35f8d7(_0x1a1a63);});});}exports['GetFaxAccount']=function(_0x344080){var _0x439c9e=this;return new Promise(function(_0x5381ae,_0x39f80f){return db[_0x882b('0x18')]['findAll']({'raw':_0x344080['options']?_0x344080['options']['raw']===undefined?!![]:![]:!![],'where':_0x344080[_0x882b('0x19')]?_0x344080['options']['where']||null:null,'attributes':_0x344080['options']?_0x344080['options'][_0x882b('0x1a')]||null:null,'limit':_0x344080['options']?_0x344080[_0x882b('0x19')]['limit']||null:null,'include':_0x344080[_0x882b('0x19')]?_0x344080[_0x882b('0x19')][_0x882b('0x1b')]?_['map'](_0x344080[_0x882b('0x19')][_0x882b('0x1b')],function(_0x1dd760){return{'model':db[_0x1dd760[_0x882b('0x1c')]],'as':_0x1dd760['as'],'attributes':_0x1dd760[_0x882b('0x1a')],'include':_0x1dd760['include']?_[_0x882b('0x1d')](_0x1dd760[_0x882b('0x1b')],function(_0x5df45b){return{'model':db[_0x5df45b[_0x882b('0x1c')]],'as':_0x5df45b['as'],'attributes':_0x5df45b['attributes'],'include':_0x5df45b[_0x882b('0x1b')]?_[_0x882b('0x1d')](_0x5df45b[_0x882b('0x1b')],function(_0x147027){return{'model':db[_0x147027[_0x882b('0x1c')]],'as':_0x147027['as'],'attributes':_0x147027[_0x882b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x882b('0xe')](function(_0x3b4524){logger[_0x882b('0xf')]('GetFaxAccount',_0x344080);logger[_0x882b('0x12')](_0x882b('0x1e'),_0x344080,JSON[_0x882b('0x1f')](_0x3b4524));_0x5381ae(_0x3b4524);})[_0x882b('0x20')](function(_0x2c91f6){logger['error'](_0x882b('0x1e'),_0x2c91f6[_0x882b('0x16')],_0x344080);_0x39f80f(_0x439c9e['error'](0x1f4,_0x2c91f6[_0x882b('0x16')]));});});};exports[_0x882b('0x21')]=function(_0xfc935f,_0x5391f5,_0x522232){var _0x337624=this;return new Promise(function(_0x142572,_0x47d4ff){var _0x200414={'body':_0xfc935f[_0x882b('0x22')],'channel':_0x882b('0x23')};var _0x3af1ff=[];var _0x181d4a=[];var _0x25438d={};return db[_0x882b('0x24')][_0x882b('0x25')]()[_0x882b('0xe')](function(_0x3ec174){if(!_0x3ec174){throw new db['Sequelize'][(_0x882b('0x26'))]('no\x20available\x20attributes');}_0x3af1ff=_[_0x882b('0x27')](_['keys'](_0x3ec174),[_0x882b('0x28'),'updatedAt']);_0x181d4a=_[_0x882b('0x27')](_[_0x882b('0x29')](_0x3ec174),[_0x882b('0x28'),_0x882b('0x2a'),_0x882b('0x2b'),'ListId']);if(_0xfc935f[_0x882b('0x22')]['id']){delete _0xfc935f[_0x882b('0x22')]['id'];}if(_[_0x882b('0x2c')](_0xfc935f['body'][_0x882b('0x2d')])){throw new db[(_0x882b('0x2e'))]['ValidationError'](_0x882b('0x2f'));}if(_[_0x882b('0x2c')](_0xfc935f['body'][_0x882b('0x22')])||_0xfc935f[_0x882b('0x22')][_0x882b('0x22')]===''){throw new db[(_0x882b('0x2e'))]['ValidationError'](_0x882b('0x30'));}if(_[_0x882b('0x2c')](_0xfc935f[_0x882b('0x22')]['mapKey'])){throw new db[(_0x882b('0x2e'))][(_0x882b('0x26'))](_0x882b('0x31')+_0x181d4a);}if(!_[_0x882b('0x32')](_0x181d4a,_0xfc935f[_0x882b('0x22')][_0x882b('0x33')])){throw new db['Sequelize']['ValidationError'](_0x882b('0x34')+_0x181d4a);}_0x25438d[_0xfc935f['body'][_0x882b('0x33')]]=_0xfc935f[_0x882b('0x22')][_0x882b('0x2d')];})[_0x882b('0xe')](function(){return db['FaxAccount'][_0x882b('0x35')]({'where':{'id':_0xfc935f[_0x882b('0x36')]['id']},'include':[{'model':db[_0x882b('0x37')],'as':_0x882b('0x38'),'include':[{'model':db[_0x882b('0x24')],'as':_0x882b('0x39'),'where':_0x25438d,'limit':0x1,'order':[[_0x882b('0x2a'),_0x882b('0x3a')]]}]},{'model':db['FaxApplication'],'as':_0x882b('0x3b')}]});})[_0x882b('0xe')](function(_0x4d0517){if(_0x4d0517&&_0x4d0517[_0x882b('0x38')]){var _0x48df0f=_0x4d0517[_0x882b('0x3c')]({'plain':!![]});_0x200414[_0x882b('0x36')]=_0x48df0f;_0x200414[_0x882b('0x3d')]=_0x48df0f[_0x882b('0x3b')];_0x200414[_0x882b('0x3e')]=_0x48df0f[_0x882b('0x38')];_0x200414['applications']=_[_0x882b('0x3f')](_0x200414[_0x882b('0x3d')],[_0x882b('0x40')],['asc']);if(_0x200414[_0x882b('0x36')][_0x882b('0x3b')]){delete _0x200414[_0x882b('0x36')][_0x882b('0x3b')];}if(_0x200414[_0x882b('0x36')][_0x882b('0x38')]&&_0x200414['account'][_0x882b('0x38')][_0x882b('0x39')]['length']){return _0x200414[_0x882b('0x36')][_0x882b('0x38')]['Contacts'][0x0];}var _0x1917cc=_['defaults'](_0xfc935f[_0x882b('0x22')],{'firstName':_0xfc935f['body'][_0x882b('0x2d')],'ListId':_0x48df0f[_0x882b('0x41')]});_0x1917cc[_0xfc935f[_0x882b('0x22')][_0x882b('0x33')]]=_0xfc935f[_0x882b('0x22')][_0x882b('0x2d')];return db['CmContact']['create'](_0x1917cc,{'fields':_0x3af1ff,'raw':!![]});}})['then'](function(_0x4415ac){_0x200414[_0x882b('0x42')]=_0x4415ac;if(_0x4415ac){var _0x53451d={'ContactId':_0x4415ac['id'],'FaxAccountId':_0xfc935f[_0x882b('0x36')]['id'],'fax':_0x4415ac['fax']};return db[_0x882b('0x43')][_0x882b('0x35')]({'where':{'ContactId':_0x4415ac['id'],'closed':![],'FaxAccountId':_0xfc935f['account']['id']}})[_0x882b('0xe')](function(_0x1126d5){if(_0x1126d5){return[_0x1126d5,![]];}return db[_0x882b('0x43')]['create'](_0x53451d)['then'](function(_0x12fecb){return[_0x12fecb,!![]];});});}else{throw new Error(_0x882b('0x44'));}})[_0x882b('0x45')](function(_0x21c1dd,_0x56c356){var _0x55fa93=_0x21c1dd[_0x882b('0x3c')]({'plain':!![]});if(_0x56c356){if(_0x200414['account'][_0x882b('0x46')]){_0x200414[_0x882b('0x3d')][_0x882b('0x47')]({'id':0x0,'priority':_0x200414['applications'][_0x882b('0x48')]+0x1,'app':_0x882b('0x49'),'appdata':_0x882b('0x4a'),'interval':_0x882b('0x4b')});}_0x55fa93[_0x882b('0x4c')]=!![];}else{_0x55fa93[_0x882b('0x4c')]=![];}_0x200414[_0x882b('0x4d')]=_0x55fa93;return db[_0x882b('0x4e')][_0x882b('0x4f')]({'body':_0xfc935f['body'][_0x882b('0x22')],'FaxAccountId':_0xfc935f[_0x882b('0x36')]['id'],'FaxInteractionId':_0x21c1dd['id'],'direction':'in','ContactId':_0x21c1dd[_0x882b('0x50')],'AttachmentId':_0xfc935f[_0x882b('0x22')][_0x882b('0x51')]});})[_0x882b('0xe')](function(_0x54f985){_0x200414[_0x882b('0x16')]=_0x54f985;if(_0x200414['interaction'][_0x882b('0x52')]){return db[_0x882b('0x53')][_0x882b('0x35')]({'attributes':['id',_0x882b('0x54')],'where':{'id':_0x200414[_0x882b('0x4d')][_0x882b('0x52')]}})[_0x882b('0xe')](function(_0x4c7c08){if(_0x4c7c08){_0x200414[_0x882b('0x3d')][_0x882b('0x55')]({'id':0x0,'priority':0x0,'app':_0x882b('0x56'),'appdata':_0x4c7c08[_0x882b('0x54')]+','+(_0x200414[_0x882b('0x36')][_0x882b('0x57')]||0xa),'interval':_0x882b('0x4b')});}return respondWithRpcPromise(_0x882b('0x58'),_0x882b('0x59'),_0x200414);});}return respondWithRpcPromise(_0x882b('0x58'),_0x882b('0x59'),_0x200414);})[_0x882b('0xe')](function(_0x103096){_0x142572(_0x103096);})[_0x882b('0x20')](function(_0x548988){_0x47d4ff(_0x337624[_0x882b('0x14')](0x1f4,_0x548988[_0x882b('0x16')]));});});}; \ No newline at end of file +var _0xc26b=['localhost','socket.io-emitter','./faxAccount.socket','register','request','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','options','where','attributes','include','map','then','debug','stringify','body','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','FaxApplication','get','applications','Applications','list','orderBy','account','create','contact','fax','Contact\x20not\x20found','autoclose','length','close','unmanaged','*,*,*,*','created','interaction','UserId','User','name','unshift','agent','startRouting','Start','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0xdffa4,_0x59697d){var _0x47bd08=function(_0x3e92e3){while(--_0x3e92e3){_0xdffa4['push'](_0xdffa4['shift']());}};_0x47bd08(++_0x59697d);}(_0xc26b,0x148));var _0xbc26=function(_0x4c2900,_0x806225){_0x4c2900=_0x4c2900-0x0;var _0x1f19c9=_0xc26b[_0x4c2900];return _0x1f19c9;};'use strict';var _=require(_0xbc26('0x0'));var util=require(_0xbc26('0x1'));var moment=require(_0xbc26('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc26('0x3'));var fs=require('fs');var Redis=require(_0xbc26('0x4'));var db=require(_0xbc26('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc26('0x6'))('rpc');var config=require(_0xbc26('0x7'));var jayson=require(_0xbc26('0x8'));var client=jayson['client'][_0xbc26('0x9')]({'port':0x232c});config[_0xbc26('0xa')]=_[_0xbc26('0xb')](config[_0xbc26('0xa')],{'host':_0xbc26('0xc'),'port':0x18eb});var socket=require(_0xbc26('0xd'))(new Redis(config[_0xbc26('0xa')]));require(_0xbc26('0xe'))[_0xbc26('0xf')](socket);function respondWithRpcPromise(_0x4464f6,_0x25aca7,_0x5ed709){return new BPromise(function(_0x19baf3,_0x462c6a){return client[_0xbc26('0x10')](_0x4464f6,_0x5ed709)['then'](function(_0x5458a2){logger['info'](_0xbc26('0x11'),_0x25aca7,'request\x20sent');logger['debug'](_0xbc26('0x12'),_0x25aca7,_0xbc26('0x13'),JSON['stringify'](_0x5458a2));if(_0x5458a2[_0xbc26('0x14')]){if(_0x5458a2[_0xbc26('0x14')][_0xbc26('0x15')]===0x1f4){logger[_0xbc26('0x14')](_0xbc26('0x11'),_0x25aca7,_0x5458a2['error'][_0xbc26('0x16')]);return _0x462c6a(_0x5458a2[_0xbc26('0x14')][_0xbc26('0x16')]);}logger[_0xbc26('0x14')](_0xbc26('0x11'),_0x25aca7,_0x5458a2[_0xbc26('0x14')][_0xbc26('0x16')]);return _0x19baf3(_0x5458a2[_0xbc26('0x14')][_0xbc26('0x16')]);}else{logger[_0xbc26('0x17')](_0xbc26('0x11'),_0x25aca7,_0xbc26('0x13'));_0x19baf3(_0x5458a2[_0xbc26('0x18')][_0xbc26('0x16')]);}})[_0xbc26('0x19')](function(_0x638d7f){logger[_0xbc26('0x14')](_0xbc26('0x11'),_0x25aca7,_0x638d7f);_0x462c6a(_0x638d7f);});});}exports[_0xbc26('0x1a')]=function(_0x769fa7){var _0x3a0aee=this;return new Promise(function(_0x473c48,_0x5eb64f){return db[_0xbc26('0x1b')]['findAll']({'raw':_0x769fa7[_0xbc26('0x1c')]?_0x769fa7[_0xbc26('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x769fa7[_0xbc26('0x1c')]?_0x769fa7[_0xbc26('0x1c')][_0xbc26('0x1d')]||null:null,'attributes':_0x769fa7[_0xbc26('0x1c')]?_0x769fa7['options'][_0xbc26('0x1e')]||null:null,'limit':_0x769fa7[_0xbc26('0x1c')]?_0x769fa7[_0xbc26('0x1c')]['limit']||null:null,'include':_0x769fa7['options']?_0x769fa7[_0xbc26('0x1c')][_0xbc26('0x1f')]?_[_0xbc26('0x20')](_0x769fa7[_0xbc26('0x1c')][_0xbc26('0x1f')],function(_0x121ecb){return{'model':db[_0x121ecb['model']],'as':_0x121ecb['as'],'attributes':_0x121ecb[_0xbc26('0x1e')],'include':_0x121ecb[_0xbc26('0x1f')]?_['map'](_0x121ecb[_0xbc26('0x1f')],function(_0x5070a4){return{'model':db[_0x5070a4['model']],'as':_0x5070a4['as'],'attributes':_0x5070a4['attributes'],'include':_0x5070a4['include']?_[_0xbc26('0x20')](_0x5070a4[_0xbc26('0x1f')],function(_0x5d80fd){return{'model':db[_0x5d80fd['model']],'as':_0x5d80fd['as'],'attributes':_0x5d80fd[_0xbc26('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbc26('0x21')](function(_0x4c4c68){logger[_0xbc26('0x17')](_0xbc26('0x1a'),_0x769fa7);logger[_0xbc26('0x22')]('GetFaxAccount',_0x769fa7,JSON[_0xbc26('0x23')](_0x4c4c68));_0x473c48(_0x4c4c68);})[_0xbc26('0x19')](function(_0x566f4b){logger['error']('GetFaxAccount',_0x566f4b[_0xbc26('0x16')],_0x769fa7);_0x5eb64f(_0x3a0aee[_0xbc26('0x14')](0x1f4,_0x566f4b[_0xbc26('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x5e418f,_0x1d969a,_0x3db675){var _0x441e65=this;return new Promise(function(_0x144a6c,_0x415850){var _0x1b2606={'body':_0x5e418f[_0xbc26('0x24')],'channel':'fax'};var _0x17b1ad=[];var _0x251a04=[];var _0x3f103a={};return db[_0xbc26('0x25')][_0xbc26('0x26')]()[_0xbc26('0x21')](function(_0x8687ec){if(!_0x8687ec){throw new db[(_0xbc26('0x27'))][(_0xbc26('0x28'))]('no\x20available\x20attributes');}_0x17b1ad=_[_0xbc26('0x29')](_[_0xbc26('0x2a')](_0x8687ec),[_0xbc26('0x2b'),'updatedAt']);_0x251a04=_[_0xbc26('0x29')](_[_0xbc26('0x2a')](_0x8687ec),[_0xbc26('0x2b'),_0xbc26('0x2c'),_0xbc26('0x2d'),_0xbc26('0x2e')]);if(_0x5e418f[_0xbc26('0x24')]['id']){delete _0x5e418f[_0xbc26('0x24')]['id'];}if(_[_0xbc26('0x2f')](_0x5e418f[_0xbc26('0x24')][_0xbc26('0x30')])){throw new db[(_0xbc26('0x27'))][(_0xbc26('0x28'))](_0xbc26('0x31'));}if(_[_0xbc26('0x2f')](_0x5e418f[_0xbc26('0x24')][_0xbc26('0x24')])||_0x5e418f['body'][_0xbc26('0x24')]===''){throw new db[(_0xbc26('0x27'))][(_0xbc26('0x28'))](_0xbc26('0x32'));}if(_[_0xbc26('0x2f')](_0x5e418f[_0xbc26('0x24')]['mapKey'])){throw new db['Sequelize'][(_0xbc26('0x28'))](_0xbc26('0x33')+_0x251a04);}if(!_[_0xbc26('0x34')](_0x251a04,_0x5e418f['body'][_0xbc26('0x35')])){throw new db[(_0xbc26('0x27'))][(_0xbc26('0x28'))](_0xbc26('0x36')+_0x251a04);}_0x3f103a[_0x5e418f['body'][_0xbc26('0x35')]]=_0x5e418f['body'][_0xbc26('0x30')];})['then'](function(){return db[_0xbc26('0x1b')][_0xbc26('0x37')]({'where':{'id':_0x5e418f['account']['id']},'include':[{'model':db[_0xbc26('0x38')],'as':_0xbc26('0x39'),'include':[{'model':db[_0xbc26('0x25')],'as':_0xbc26('0x3a'),'where':_0x3f103a,'limit':0x1,'order':[['updatedAt',_0xbc26('0x3b')]]}]},{'model':db[_0xbc26('0x3c')],'as':'Applications'}]});})['then'](function(_0x21bfad){if(_0x21bfad&&_0x21bfad['List']){var _0x1bec62=_0x21bfad[_0xbc26('0x3d')]({'plain':!![]});_0x1b2606['account']=_0x1bec62;_0x1b2606[_0xbc26('0x3e')]=_0x1bec62[_0xbc26('0x3f')];_0x1b2606[_0xbc26('0x40')]=_0x1bec62[_0xbc26('0x39')];_0x1b2606[_0xbc26('0x3e')]=_[_0xbc26('0x41')](_0x1b2606['applications'],['priority'],['asc']);if(_0x1b2606[_0xbc26('0x42')][_0xbc26('0x3f')]){delete _0x1b2606[_0xbc26('0x42')][_0xbc26('0x3f')];}if(_0x1b2606['account']['List']&&_0x1b2606[_0xbc26('0x42')][_0xbc26('0x39')][_0xbc26('0x3a')]['length']){return _0x1b2606[_0xbc26('0x42')][_0xbc26('0x39')][_0xbc26('0x3a')][0x0];}var _0x18bd2e=_[_0xbc26('0xb')](_0x5e418f['body'],{'firstName':_0x5e418f[_0xbc26('0x24')][_0xbc26('0x30')],'ListId':_0x1bec62[_0xbc26('0x2e')]});_0x18bd2e[_0x5e418f[_0xbc26('0x24')][_0xbc26('0x35')]]=_0x5e418f[_0xbc26('0x24')]['from'];return db[_0xbc26('0x25')][_0xbc26('0x43')](_0x18bd2e,{'fields':_0x17b1ad,'raw':!![]});}})['then'](function(_0x13214f){_0x1b2606[_0xbc26('0x44')]=_0x13214f;if(_0x13214f){var _0x43eb13={'ContactId':_0x13214f['id'],'FaxAccountId':_0x5e418f[_0xbc26('0x42')]['id'],'fax':_0x13214f[_0xbc26('0x45')]};return db['FaxInteraction'][_0xbc26('0x37')]({'where':{'ContactId':_0x13214f['id'],'closed':![],'FaxAccountId':_0x5e418f[_0xbc26('0x42')]['id']}})[_0xbc26('0x21')](function(_0x5978be){if(_0x5978be){return[_0x5978be,![]];}return db['FaxInteraction'][_0xbc26('0x43')](_0x43eb13)[_0xbc26('0x21')](function(_0x8d600){return[_0x8d600,!![]];});});}else{throw new Error(_0xbc26('0x46'));}})['spread'](function(_0x583e41,_0xd3c1f1){var _0xa8543e=_0x583e41[_0xbc26('0x3d')]({'plain':!![]});if(_0xd3c1f1){if(_0x1b2606[_0xbc26('0x42')][_0xbc26('0x47')]){_0x1b2606[_0xbc26('0x3e')]['push']({'id':0x0,'priority':_0x1b2606[_0xbc26('0x3e')][_0xbc26('0x48')]+0x1,'app':_0xbc26('0x49'),'appdata':_0xbc26('0x4a'),'interval':_0xbc26('0x4b')});}_0xa8543e[_0xbc26('0x4c')]=!![];}else{_0xa8543e[_0xbc26('0x4c')]=![];}_0x1b2606['interaction']=_0xa8543e;return db['FaxMessage'][_0xbc26('0x43')]({'body':_0x5e418f[_0xbc26('0x24')]['body'],'FaxAccountId':_0x5e418f['account']['id'],'FaxInteractionId':_0x583e41['id'],'direction':'in','ContactId':_0x583e41['ContactId'],'AttachmentId':_0x5e418f[_0xbc26('0x24')]['AttachmentId']});})['then'](function(_0x47e3d1){_0x1b2606[_0xbc26('0x16')]=_0x47e3d1;if(_0x1b2606[_0xbc26('0x4d')][_0xbc26('0x4e')]){return db[_0xbc26('0x4f')][_0xbc26('0x37')]({'attributes':['id',_0xbc26('0x50')],'where':{'id':_0x1b2606[_0xbc26('0x4d')][_0xbc26('0x4e')]}})['then'](function(_0x30735b){if(_0x30735b){_0x1b2606[_0xbc26('0x3e')][_0xbc26('0x51')]({'id':0x0,'priority':0x0,'app':_0xbc26('0x52'),'appdata':_0x30735b[_0xbc26('0x50')]+','+(_0x1b2606[_0xbc26('0x42')]['waitForTheAssignedAgent']||0xa),'interval':_0xbc26('0x4b')});}return respondWithRpcPromise('Start',_0xbc26('0x53'),_0x1b2606);});}return respondWithRpcPromise(_0xbc26('0x54'),_0xbc26('0x53'),_0x1b2606);})[_0xbc26('0x21')](function(_0x2a135d){_0x144a6c(_0x2a135d);})[_0xbc26('0x19')](function(_0x17be2e){_0x415850(_0x441e65[_0xbc26('0x14')](0x1f4,_0x17be2e[_0xbc26('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 803d935..a4db677 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 _0xc190=['register','length','faxAccount:','./faxAccount.events','remove','update','removeListener'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0xc190,0x161));var _0x0c19=function(_0x355957,_0x42692c){_0x355957=_0x355957-0x0;var _0x27bbed=_0xc190[_0x355957];return _0x27bbed;};'use strict';var FaxAccountEvents=require(_0x0c19('0x0'));var events=['save',_0x0c19('0x1'),_0x0c19('0x2')];function createListener(_0x35317b,_0xdf02e3){return function(_0x179a95){_0xdf02e3['emit'](_0x35317b,_0x179a95);};}function removeListener(_0x26354c,_0x356cae){return function(){FaxAccountEvents[_0x0c19('0x3')](_0x26354c,_0x356cae);};}exports[_0x0c19('0x4')]=function(_0x587047){for(var _0x32f5fb=0x0,_0x19eb3d=events[_0x0c19('0x5')];_0x32f5fb<_0x19eb3d;_0x32f5fb++){var _0x20bb69=events[_0x32f5fb];var _0x12dfdf=createListener(_0x0c19('0x6')+_0x20bb69,_0x587047);FaxAccountEvents['on'](_0x20bb69,_0x12dfdf);}}; \ No newline at end of file +var _0xd6af=['remove','update','emit','register','length','faxAccount:','./faxAccount.events'];(function(_0x86153c,_0x398d3a){var _0x22b66e=function(_0x9287b8){while(--_0x9287b8){_0x86153c['push'](_0x86153c['shift']());}};_0x22b66e(++_0x398d3a);}(_0xd6af,0x187));var _0xfd6a=function(_0x1738ee,_0x32e204){_0x1738ee=_0x1738ee-0x0;var _0x4b1b60=_0xd6af[_0x1738ee];return _0x4b1b60;};'use strict';var FaxAccountEvents=require(_0xfd6a('0x0'));var events=['save',_0xfd6a('0x1'),_0xfd6a('0x2')];function createListener(_0x1bfe86,_0x56da59){return function(_0x63e99b){_0x56da59[_0xfd6a('0x3')](_0x1bfe86,_0x63e99b);};}function removeListener(_0x5eb48e,_0x278710){return function(){FaxAccountEvents['removeListener'](_0x5eb48e,_0x278710);};}exports[_0xfd6a('0x4')]=function(_0xba5108){for(var _0x4ff758=0x0,_0x3967fd=events[_0xfd6a('0x5')];_0x4ff758<_0x3967fd;_0x4ff758++){var _0x4b4ceb=events[_0x4ff758];var _0x5e1a85=createListener(_0xfd6a('0x6')+_0x4b4ceb,_0xba5108);FaxAccountEvents['on'](_0x4b4ceb,_0x5e1a85);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 5554367..2658151 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(_0x1c47d7,_0x58b64c){var _0x15f013=function(_0x13ccb3){while(--_0x13ccb3){_0x1c47d7['push'](_0x1c47d7['shift']());}};_0x15f013(++_0x58b64c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x4c90bc,_0x3a595d){var _0x38ad08=function(_0x52b81f){while(--_0x52b81f){_0x4c90bc['push'](_0x4c90bc['shift']());}};_0x38ad08(++_0x3a595d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 23ca2a3..bf72d9c 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 _0xef36=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0xef36,0xc6));var _0x6ef3=function(_0x4e9b51,_0x23e0a6){_0x4e9b51=_0x4e9b51-0x0;var _0x5a5550=_0xef36[_0x4e9b51];return _0x5a5550;};'use strict';var Sequelize=require(_0x6ef3('0x0'));module[_0x6ef3('0x1')]={'priority':{'type':Sequelize[_0x6ef3('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ef3('0x3')},'appdata':{'type':Sequelize[_0x6ef3('0x4')]()},'description':{'type':Sequelize[_0x6ef3('0x5')]},'interval':{'type':Sequelize[_0x6ef3('0x5')],'defaultValue':_0x6ef3('0x6')}}; \ No newline at end of file +var _0x1a94=['sequelize','exports','INTEGER','STRING'];(function(_0x52d406,_0x292336){var _0x399443=function(_0x53f631){while(--_0x53f631){_0x52d406['push'](_0x52d406['shift']());}};_0x399443(++_0x292336);}(_0x1a94,0x138));var _0x41a9=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x1a94[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x41a9('0x0'));module[_0x41a9('0x1')]={'priority':{'type':Sequelize[_0x41a9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x41a9('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index d75c189..9db0a1e 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 _0x6c1c=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','create','body','find','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x47bdc1,_0x5614f){var _0x1016c4=function(_0x48fafa){while(--_0x48fafa){_0x47bdc1['push'](_0x47bdc1['shift']());}};_0x1016c4(++_0x5614f);}(_0x6c1c,0x16a));var _0xc6c1=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x6c1c[_0x38a7ac];return _0x53061a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6c1('0x0'));var zipdir=require(_0xc6c1('0x1'));var jsonpatch=require(_0xc6c1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6c1('0x3'));var util=require(_0xc6c1('0x4'));var path=require(_0xc6c1('0x5'));var sox=require(_0xc6c1('0x6'));var csv=require(_0xc6c1('0x7'));var ejs=require(_0xc6c1('0x8'));var fs=require('fs');var fs_extra=require(_0xc6c1('0x9'));var _=require(_0xc6c1('0xa'));var squel=require('squel');var crypto=require(_0xc6c1('0xb'));var jsforce=require(_0xc6c1('0xc'));var deskjs=require(_0xc6c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc6c1('0xe'));var Papa=require(_0xc6c1('0xf'));var Redis=require(_0xc6c1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc6c1('0x11'));var as=require(_0xc6c1('0x12'));var hardwareService=require(_0xc6c1('0x13'));var logger=require(_0xc6c1('0x14'))(_0xc6c1('0x15'));var utils=require(_0xc6c1('0x16'));var config=require(_0xc6c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6c1('0x18'))['db'];function respondWithStatusCode(_0x5d3a30,_0xfb29dc){_0xfb29dc=_0xfb29dc||0xcc;return function(_0x43f504){if(_0x43f504){return _0x5d3a30['sendStatus'](_0xfb29dc);}return _0x5d3a30['status'](_0xfb29dc)[_0xc6c1('0x19')]();};}function respondWithResult(_0x58f988,_0x12fafa){_0x12fafa=_0x12fafa||0xc8;return function(_0x2124db){if(_0x2124db){return _0x58f988[_0xc6c1('0x1a')](_0x12fafa)[_0xc6c1('0x1b')](_0x2124db);}};}function respondWithFilteredResult(_0x5098a9,_0x12efec){return function(_0x5778be){if(_0x5778be){var _0xdc7e22=typeof _0x12efec[_0xc6c1('0x1c')]==='undefined'&&typeof _0x12efec[_0xc6c1('0x1d')]===_0xc6c1('0x1e');var _0x3e9be1=_0x5778be[_0xc6c1('0x1f')];var _0x1ad4f0=_0xdc7e22?0x0:_0x12efec[_0xc6c1('0x1c')];var _0x547f0d=_0xdc7e22?_0x5778be[_0xc6c1('0x1f')]:_0x12efec[_0xc6c1('0x1c')]+_0x12efec['limit'];var _0x53f0b7;if(_0x547f0d>=_0x3e9be1){_0x547f0d=_0x3e9be1;_0x53f0b7=0xc8;}else{_0x53f0b7=0xce;}_0x5098a9[_0xc6c1('0x1a')](_0x53f0b7);return _0x5098a9[_0xc6c1('0x20')](_0xc6c1('0x21'),_0x1ad4f0+'-'+_0x547f0d+'/'+_0x3e9be1)['json'](_0x5778be);}return null;};}function patchUpdates(_0xde0044){return function(_0x29dbba){try{jsonpatch['apply'](_0x29dbba,_0xde0044,!![]);}catch(_0x3c3898){return BPromise[_0xc6c1('0x22')](_0x3c3898);}return _0x29dbba['save']();};}function saveUpdates(_0x4f25a2,_0x26c0be){return function(_0x467b08){if(_0x467b08){return _0x467b08[_0xc6c1('0x23')](_0x4f25a2)[_0xc6c1('0x24')](function(_0x1d46be){return _0x1d46be;});}return null;};}function removeEntity(_0x5fe625,_0x5b8bff){return function(_0x562ce6){if(_0x562ce6){return _0x562ce6[_0xc6c1('0x25')]()['then'](function(){_0x5fe625[_0xc6c1('0x1a')](0xcc)[_0xc6c1('0x19')]();});}};}function handleEntityNotFound(_0x35f9fa,_0xe221ed){return function(_0x2ef8a3){if(!_0x2ef8a3){_0x35f9fa[_0xc6c1('0x26')](0x194);}return _0x2ef8a3;};}function handleError(_0x23b2b2,_0x3d6a26){_0x3d6a26=_0x3d6a26||0x1f4;return function(_0x206344){logger[_0xc6c1('0x27')](_0x206344['stack']);if(_0x206344[_0xc6c1('0x28')]){delete _0x206344[_0xc6c1('0x28')];}_0x23b2b2[_0xc6c1('0x1a')](_0x3d6a26)[_0xc6c1('0x29')](_0x206344);};}exports[_0xc6c1('0x2a')]=function(_0x5a9023,_0x33a377){var _0x1430ba={},_0x4aaa2e={},_0x5812c0={'count':0x0,'rows':[]};var _0x35d476=_[_0xc6c1('0x2b')](db[_0xc6c1('0x2c')][_0xc6c1('0x2d')],function(_0x2b3fd1){return{'name':_0x2b3fd1[_0xc6c1('0x2e')],'type':_0x2b3fd1[_0xc6c1('0x2f')][_0xc6c1('0x30')]};});_0x4aaa2e['model']=_[_0xc6c1('0x2b')](_0x35d476,_0xc6c1('0x28'));_0x4aaa2e[_0xc6c1('0x31')]=_['keys'](_0x5a9023['query']);_0x4aaa2e['filters']=_[_0xc6c1('0x32')](_0x4aaa2e['model'],_0x4aaa2e[_0xc6c1('0x31')]);_0x1430ba[_0xc6c1('0x33')]=_[_0xc6c1('0x32')](_0x4aaa2e[_0xc6c1('0x34')],qs[_0xc6c1('0x35')](_0x5a9023['query'][_0xc6c1('0x35')]));_0x1430ba['attributes']=_0x1430ba[_0xc6c1('0x33')][_0xc6c1('0x36')]?_0x1430ba[_0xc6c1('0x33')]:_0x4aaa2e[_0xc6c1('0x34')];if(!_0x5a9023[_0xc6c1('0x31')][_0xc6c1('0x37')](_0xc6c1('0x38'))){_0x1430ba[_0xc6c1('0x1d')]=qs['limit'](_0x5a9023['query'][_0xc6c1('0x1d')]);_0x1430ba[_0xc6c1('0x1c')]=qs[_0xc6c1('0x1c')](_0x5a9023['query'][_0xc6c1('0x1c')]);}_0x1430ba[_0xc6c1('0x39')]=qs[_0xc6c1('0x3a')](_0x5a9023[_0xc6c1('0x31')]['sort']);_0x1430ba[_0xc6c1('0x3b')]=qs['filters'](_[_0xc6c1('0x3c')](_0x5a9023[_0xc6c1('0x31')],_0x4aaa2e['filters']),_0x35d476);if(_0x5a9023[_0xc6c1('0x31')][_0xc6c1('0x3d')]){_0x1430ba[_0xc6c1('0x3b')]=_[_0xc6c1('0x3e')](_0x1430ba[_0xc6c1('0x3b')],{'$or':_[_0xc6c1('0x2b')](_0x35d476,function(_0x217a4f){if(_0x217a4f['type']!==_0xc6c1('0x3f')){var _0x40a3e6={};_0x40a3e6[_0x217a4f[_0xc6c1('0x28')]]={'$like':'%'+_0x5a9023[_0xc6c1('0x31')][_0xc6c1('0x3d')]+'%'};return _0x40a3e6;}})});}_0x1430ba=_[_0xc6c1('0x3e')]({},_0x1430ba,_0x5a9023['options']);var _0x91bd={'where':_0x1430ba[_0xc6c1('0x3b')]};return db['FaxApplication'][_0xc6c1('0x1f')](_0x91bd)[_0xc6c1('0x24')](function(_0x178cf4){_0x5812c0['count']=_0x178cf4;if(_0x5a9023[_0xc6c1('0x31')][_0xc6c1('0x40')]){_0x1430ba[_0xc6c1('0x41')]=[{'all':!![]}];}return db[_0xc6c1('0x2c')][_0xc6c1('0x42')](_0x1430ba);})[_0xc6c1('0x24')](function(_0x26a9a0){_0x5812c0['rows']=_0x26a9a0;return _0x5812c0;})['then'](respondWithFilteredResult(_0x33a377,_0x1430ba))[_0xc6c1('0x43')](handleError(_0x33a377,null));};exports[_0xc6c1('0x44')]=function(_0x124011,_0x58d616){var _0x4b6aee={'raw':!![],'where':{'id':_0x124011[_0xc6c1('0x45')]['id']}},_0xca8c15={};_0xca8c15[_0xc6c1('0x34')]=_[_0xc6c1('0x46')](db[_0xc6c1('0x2c')]['rawAttributes']);_0xca8c15['query']=_['keys'](_0x124011['query']);_0xca8c15['filters']=_['intersection'](_0xca8c15[_0xc6c1('0x34')],_0xca8c15[_0xc6c1('0x31')]);_0x4b6aee[_0xc6c1('0x33')]=_['intersection'](_0xca8c15['model'],qs['fields'](_0x124011['query']['fields']));_0x4b6aee[_0xc6c1('0x33')]=_0x4b6aee[_0xc6c1('0x33')][_0xc6c1('0x36')]?_0x4b6aee['attributes']:_0xca8c15[_0xc6c1('0x34')];if(_0x124011[_0xc6c1('0x31')][_0xc6c1('0x40')]){_0x4b6aee[_0xc6c1('0x41')]=[{'all':!![]}];}_0x4b6aee=_[_0xc6c1('0x3e')]({},_0x4b6aee,_0x124011[_0xc6c1('0x47')]);return db[_0xc6c1('0x2c')]['find'](_0x4b6aee)['then'](handleEntityNotFound(_0x58d616,null))[_0xc6c1('0x24')](respondWithResult(_0x58d616,null))['catch'](handleError(_0x58d616,null));};exports[_0xc6c1('0x48')]=function(_0x18c23f,_0x124572){return db[_0xc6c1('0x2c')][_0xc6c1('0x48')](_0x18c23f[_0xc6c1('0x49')],{})[_0xc6c1('0x24')](respondWithResult(_0x124572,0xc9))[_0xc6c1('0x43')](handleError(_0x124572,null));};exports[_0xc6c1('0x23')]=function(_0x3f5d94,_0x95d587){if(_0x3f5d94[_0xc6c1('0x49')]['id']){delete _0x3f5d94[_0xc6c1('0x49')]['id'];}return db['FaxApplication'][_0xc6c1('0x4a')]({'where':{'id':_0x3f5d94[_0xc6c1('0x45')]['id']}})[_0xc6c1('0x24')](handleEntityNotFound(_0x95d587,null))['then'](saveUpdates(_0x3f5d94['body'],null))[_0xc6c1('0x24')](respondWithResult(_0x95d587,null))[_0xc6c1('0x43')](handleError(_0x95d587,null));};exports[_0xc6c1('0x25')]=function(_0x1f99cb,_0xbe3933){return db[_0xc6c1('0x2c')][_0xc6c1('0x4a')]({'where':{'id':_0x1f99cb[_0xc6c1('0x45')]['id']}})[_0xc6c1('0x24')](handleEntityNotFound(_0xbe3933,null))['then'](removeEntity(_0xbe3933,null))['catch'](handleError(_0xbe3933,null));}; \ No newline at end of file +var _0x1c29=['catch','show','params','create','body','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','status','sendStatus','error','stack','name','send','map','FaxApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x1af603,_0x172e61){var _0x244dd6=function(_0x40c50d){while(--_0x40c50d){_0x1af603['push'](_0x1af603['shift']());}};_0x244dd6(++_0x172e61);}(_0x1c29,0xe0));var _0x91c2=function(_0x965ea1,_0x3544ce){_0x965ea1=_0x965ea1-0x0;var _0x386cd8=_0x1c29[_0x965ea1];return _0x386cd8;};'use strict';var emlformat=require(_0x91c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91c2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91c2('0x2'));var moment=require(_0x91c2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x91c2('0x4'));var util=require(_0x91c2('0x5'));var path=require(_0x91c2('0x6'));var sox=require(_0x91c2('0x7'));var csv=require(_0x91c2('0x8'));var ejs=require(_0x91c2('0x9'));var fs=require('fs');var fs_extra=require(_0x91c2('0xa'));var _=require(_0x91c2('0xb'));var squel=require(_0x91c2('0xc'));var crypto=require(_0x91c2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x91c2('0xe'));var toCsv=require(_0x91c2('0x8'));var querystring=require(_0x91c2('0xf'));var Papa=require(_0x91c2('0x10'));var Redis=require(_0x91c2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x91c2('0x12'));var hardwareService=require(_0x91c2('0x13'));var logger=require('../../config/logger')(_0x91c2('0x14'));var utils=require(_0x91c2('0x15'));var config=require(_0x91c2('0x16'));var licenseUtil=require(_0x91c2('0x17'));var db=require(_0x91c2('0x18'))['db'];function respondWithStatusCode(_0x20639b,_0x16d16e){_0x16d16e=_0x16d16e||0xcc;return function(_0x163da2){if(_0x163da2){return _0x20639b['sendStatus'](_0x16d16e);}return _0x20639b['status'](_0x16d16e)[_0x91c2('0x19')]();};}function respondWithResult(_0x57ef02,_0x227732){_0x227732=_0x227732||0xc8;return function(_0x4e08ab){if(_0x4e08ab){return _0x57ef02['status'](_0x227732)[_0x91c2('0x1a')](_0x4e08ab);}};}function respondWithFilteredResult(_0x3d4fcf,_0x3725aa){return function(_0x31b140){if(_0x31b140){var _0x4d5862=typeof _0x3725aa['offset']===_0x91c2('0x1b')&&typeof _0x3725aa['limit']===_0x91c2('0x1b');var _0x26fdcc=_0x31b140[_0x91c2('0x1c')];var _0x2c9e0b=_0x4d5862?0x0:_0x3725aa[_0x91c2('0x1d')];var _0x58669e=_0x4d5862?_0x31b140[_0x91c2('0x1c')]:_0x3725aa[_0x91c2('0x1d')]+_0x3725aa[_0x91c2('0x1e')];var _0xaf6e19;if(_0x58669e>=_0x26fdcc){_0x58669e=_0x26fdcc;_0xaf6e19=0xc8;}else{_0xaf6e19=0xce;}_0x3d4fcf['status'](_0xaf6e19);return _0x3d4fcf['set'](_0x91c2('0x1f'),_0x2c9e0b+'-'+_0x58669e+'/'+_0x26fdcc)[_0x91c2('0x1a')](_0x31b140);}return null;};}function patchUpdates(_0x39c2e6){return function(_0x2a16be){try{jsonpatch[_0x91c2('0x20')](_0x2a16be,_0x39c2e6,!![]);}catch(_0x4c50d8){return BPromise[_0x91c2('0x21')](_0x4c50d8);}return _0x2a16be['save']();};}function saveUpdates(_0x5472b8,_0x4f7207){return function(_0x2b4ae9){if(_0x2b4ae9){return _0x2b4ae9[_0x91c2('0x22')](_0x5472b8)[_0x91c2('0x23')](function(_0x1eacdd){return _0x1eacdd;});}return null;};}function removeEntity(_0x348425,_0x57fed9){return function(_0x17b155){if(_0x17b155){return _0x17b155['destroy']()[_0x91c2('0x23')](function(){_0x348425[_0x91c2('0x24')](0xcc)[_0x91c2('0x19')]();});}};}function handleEntityNotFound(_0x4b4fb1,_0x33c964){return function(_0x97cd98){if(!_0x97cd98){_0x4b4fb1[_0x91c2('0x25')](0x194);}return _0x97cd98;};}function handleError(_0x103aa1,_0x5eec1f){_0x5eec1f=_0x5eec1f||0x1f4;return function(_0x37d14f){logger[_0x91c2('0x26')](_0x37d14f[_0x91c2('0x27')]);if(_0x37d14f[_0x91c2('0x28')]){delete _0x37d14f[_0x91c2('0x28')];}_0x103aa1[_0x91c2('0x24')](_0x5eec1f)[_0x91c2('0x29')](_0x37d14f);};}exports['index']=function(_0x56c0b5,_0x517635){var _0x5312be={},_0x2f1f26={},_0x449e27={'count':0x0,'rows':[]};var _0x4371b6=_[_0x91c2('0x2a')](db[_0x91c2('0x2b')][_0x91c2('0x2c')],function(_0xff72f8){return{'name':_0xff72f8['fieldName'],'type':_0xff72f8[_0x91c2('0x2d')][_0x91c2('0x2e')]};});_0x2f1f26[_0x91c2('0x2f')]=_[_0x91c2('0x2a')](_0x4371b6,_0x91c2('0x28'));_0x2f1f26[_0x91c2('0x30')]=_[_0x91c2('0x31')](_0x56c0b5[_0x91c2('0x30')]);_0x2f1f26[_0x91c2('0x32')]=_[_0x91c2('0x33')](_0x2f1f26[_0x91c2('0x2f')],_0x2f1f26[_0x91c2('0x30')]);_0x5312be[_0x91c2('0x34')]=_['intersection'](_0x2f1f26[_0x91c2('0x2f')],qs[_0x91c2('0x35')](_0x56c0b5['query'][_0x91c2('0x35')]));_0x5312be[_0x91c2('0x34')]=_0x5312be['attributes'][_0x91c2('0x36')]?_0x5312be['attributes']:_0x2f1f26['model'];if(!_0x56c0b5[_0x91c2('0x30')][_0x91c2('0x37')]('nolimit')){_0x5312be['limit']=qs[_0x91c2('0x1e')](_0x56c0b5[_0x91c2('0x30')][_0x91c2('0x1e')]);_0x5312be[_0x91c2('0x1d')]=qs['offset'](_0x56c0b5[_0x91c2('0x30')][_0x91c2('0x1d')]);}_0x5312be[_0x91c2('0x38')]=qs[_0x91c2('0x39')](_0x56c0b5['query'][_0x91c2('0x39')]);_0x5312be[_0x91c2('0x3a')]=qs[_0x91c2('0x32')](_[_0x91c2('0x3b')](_0x56c0b5[_0x91c2('0x30')],_0x2f1f26[_0x91c2('0x32')]),_0x4371b6);if(_0x56c0b5[_0x91c2('0x30')][_0x91c2('0x3c')]){_0x5312be[_0x91c2('0x3a')]=_[_0x91c2('0x3d')](_0x5312be[_0x91c2('0x3a')],{'$or':_[_0x91c2('0x2a')](_0x4371b6,function(_0x392799){if(_0x392799[_0x91c2('0x2d')]!==_0x91c2('0x3e')){var _0x185923={};_0x185923[_0x392799['name']]={'$like':'%'+_0x56c0b5['query'][_0x91c2('0x3c')]+'%'};return _0x185923;}})});}_0x5312be=_[_0x91c2('0x3d')]({},_0x5312be,_0x56c0b5[_0x91c2('0x3f')]);var _0x19395d={'where':_0x5312be[_0x91c2('0x3a')]};return db[_0x91c2('0x2b')]['count'](_0x19395d)[_0x91c2('0x23')](function(_0x21c539){_0x449e27[_0x91c2('0x1c')]=_0x21c539;if(_0x56c0b5['query'][_0x91c2('0x40')]){_0x5312be[_0x91c2('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0x91c2('0x42')](_0x5312be);})['then'](function(_0x236669){_0x449e27[_0x91c2('0x43')]=_0x236669;return _0x449e27;})[_0x91c2('0x23')](respondWithFilteredResult(_0x517635,_0x5312be))[_0x91c2('0x44')](handleError(_0x517635,null));};exports[_0x91c2('0x45')]=function(_0x5d0610,_0x86e6f1){var _0x3d386c={'raw':!![],'where':{'id':_0x5d0610[_0x91c2('0x46')]['id']}},_0x2b5e01={};_0x2b5e01[_0x91c2('0x2f')]=_['keys'](db[_0x91c2('0x2b')][_0x91c2('0x2c')]);_0x2b5e01[_0x91c2('0x30')]=_[_0x91c2('0x31')](_0x5d0610[_0x91c2('0x30')]);_0x2b5e01[_0x91c2('0x32')]=_[_0x91c2('0x33')](_0x2b5e01['model'],_0x2b5e01[_0x91c2('0x30')]);_0x3d386c[_0x91c2('0x34')]=_[_0x91c2('0x33')](_0x2b5e01[_0x91c2('0x2f')],qs['fields'](_0x5d0610[_0x91c2('0x30')][_0x91c2('0x35')]));_0x3d386c[_0x91c2('0x34')]=_0x3d386c['attributes']['length']?_0x3d386c['attributes']:_0x2b5e01[_0x91c2('0x2f')];if(_0x5d0610['query']['includeAll']){_0x3d386c[_0x91c2('0x41')]=[{'all':!![]}];}_0x3d386c=_[_0x91c2('0x3d')]({},_0x3d386c,_0x5d0610['options']);return db['FaxApplication']['find'](_0x3d386c)[_0x91c2('0x23')](handleEntityNotFound(_0x86e6f1,null))[_0x91c2('0x23')](respondWithResult(_0x86e6f1,null))['catch'](handleError(_0x86e6f1,null));};exports[_0x91c2('0x47')]=function(_0x5011f1,_0x3f96ad){return db[_0x91c2('0x2b')]['create'](_0x5011f1[_0x91c2('0x48')],{})[_0x91c2('0x23')](respondWithResult(_0x3f96ad,0xc9))[_0x91c2('0x44')](handleError(_0x3f96ad,null));};exports[_0x91c2('0x22')]=function(_0xca756c,_0x36d6b5){if(_0xca756c[_0x91c2('0x48')]['id']){delete _0xca756c[_0x91c2('0x48')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0xca756c[_0x91c2('0x46')]['id']}})['then'](handleEntityNotFound(_0x36d6b5,null))[_0x91c2('0x23')](saveUpdates(_0xca756c['body'],null))[_0x91c2('0x23')](respondWithResult(_0x36d6b5,null))[_0x91c2('0x44')](handleError(_0x36d6b5,null));};exports['destroy']=function(_0x3e7ac9,_0x48511a){return db[_0x91c2('0x2b')]['find']({'where':{'id':_0x3e7ac9[_0x91c2('0x46')]['id']}})[_0x91c2('0x23')](handleEntityNotFound(_0x48511a,null))['then'](removeEntity(_0x48511a,null))[_0x91c2('0x44')](handleError(_0x48511a,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index d75fd38..2cd36c3 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 _0x0758=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x3b0489,_0x571af8){var _0x4de392=function(_0x1b4844){while(--_0x1b4844){_0x3b0489['push'](_0x3b0489['shift']());}};_0x4de392(++_0x571af8);}(_0x0758,0x1ee));var _0x8075=function(_0x47c746,_0xc16c34){_0x47c746=_0x47c746-0x0;var _0x37d5bf=_0x0758[_0x47c746];return _0x37d5bf;};'use strict';var _=require(_0x8075('0x0'));var util=require(_0x8075('0x1'));var logger=require(_0x8075('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8075('0x3'));var rp=require(_0x8075('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8075('0x5'));var config=require(_0x8075('0x6'));var attributes=require(_0x8075('0x7'));module[_0x8075('0x8')]=function(_0x5dd5f3,_0x582788){return _0x5dd5f3[_0x8075('0x9')](_0x8075('0xa'),attributes,{'tableName':_0x8075('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8075('0xc'),'collate':_0x8075('0xd')});}; \ No newline at end of file +var _0x02a3=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02a3,0x122));var _0x302a=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x02a3[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require('lodash');var util=require(_0x302a('0x0'));var logger=require(_0x302a('0x1'))('api');var moment=require(_0x302a('0x2'));var BPromise=require(_0x302a('0x3'));var rp=require(_0x302a('0x4'));var fs=require('fs');var path=require(_0x302a('0x5'));var rimraf=require('rimraf');var config=require(_0x302a('0x6'));var attributes=require(_0x302a('0x7'));module['exports']=function(_0x395017,_0x2d48b8){return _0x395017[_0x302a('0x8')](_0x302a('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x302a('0xa'),'collate':_0x302a('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 804df33..0b897cf 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 _0x357e=['http','request','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','info','result','catch','UpdateFaxApplication','update','body','options','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x4b60ae,_0x4ea45c){var _0x11ddbe=function(_0x196985){while(--_0x196985){_0x4b60ae['push'](_0x4b60ae['shift']());}};_0x11ddbe(++_0x4ea45c);}(_0x357e,0x1c2));var _0xe357=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x357e[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xe357('0x0'));var util=require('util');var moment=require(_0xe357('0x1'));var BPromise=require(_0xe357('0x2'));var rs=require(_0xe357('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe357('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe357('0x5'))(_0xe357('0x6'));var config=require('../../config/environment');var jayson=require(_0xe357('0x7'));var client=jayson[_0xe357('0x8')][_0xe357('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d61fc,_0x143654,_0x2dc298){return new BPromise(function(_0x41f2a2,_0x31b8d2){return client[_0xe357('0xa')](_0x3d61fc,_0x2dc298)['then'](function(_0x33394a){logger['info']('FaxApplication,\x20%s,\x20%s',_0x143654,_0xe357('0xb'));logger[_0xe357('0xc')](_0xe357('0xd'),_0x143654,'request\x20sent',JSON[_0xe357('0xe')](_0x33394a));if(_0x33394a[_0xe357('0xf')]){if(_0x33394a['error']['code']===0x1f4){logger[_0xe357('0xf')](_0xe357('0x10'),_0x143654,_0x33394a[_0xe357('0xf')][_0xe357('0x11')]);return _0x31b8d2(_0x33394a[_0xe357('0xf')][_0xe357('0x11')]);}logger[_0xe357('0xf')]('FaxApplication,\x20%s,\x20%s',_0x143654,_0x33394a[_0xe357('0xf')][_0xe357('0x11')]);return _0x41f2a2(_0x33394a[_0xe357('0xf')][_0xe357('0x11')]);}else{logger[_0xe357('0x12')](_0xe357('0x10'),_0x143654,_0xe357('0xb'));_0x41f2a2(_0x33394a[_0xe357('0x13')][_0xe357('0x11')]);}})[_0xe357('0x14')](function(_0x25bd30){logger[_0xe357('0xf')](_0xe357('0x10'),_0x143654,_0x25bd30);_0x31b8d2(_0x25bd30);});});}exports[_0xe357('0x15')]=function(_0xe05fbf){var _0x4938c2=this;return new Promise(function(_0x3f400f,_0x543bef){return db['FaxApplication'][_0xe357('0x16')](_0xe05fbf[_0xe357('0x17')],{'raw':_0xe05fbf['options']?_0xe05fbf[_0xe357('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe05fbf['options']?_0xe05fbf[_0xe357('0x18')]['where']||null:null,'attributes':_0xe05fbf[_0xe357('0x18')]?_0xe05fbf[_0xe357('0x18')][_0xe357('0x19')]||null:null,'limit':_0xe05fbf[_0xe357('0x18')]?_0xe05fbf[_0xe357('0x18')][_0xe357('0x1a')]||null:null})['then'](function(_0x96f687){logger['info'](_0xe357('0x15'),_0xe05fbf);logger[_0xe357('0xc')](_0xe357('0x15'),_0xe05fbf,JSON[_0xe357('0xe')](_0x96f687));_0x3f400f(_0x96f687);})[_0xe357('0x14')](function(_0x1a69f4){logger[_0xe357('0xf')](_0xe357('0x15'),_0x1a69f4[_0xe357('0x11')],_0xe05fbf);_0x543bef(_0x4938c2['error'](0x1f4,_0x1a69f4[_0xe357('0x11')]));});});}; \ No newline at end of file +var _0x0918=['info','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x850b1,_0x4ab9df){var _0x1cda62=function(_0x27092d){while(--_0x27092d){_0x850b1['push'](_0x850b1['shift']());}};_0x1cda62(++_0x4ab9df);}(_0x0918,0x16b));var _0x8091=function(_0x2c0c3d,_0x28ee6d){_0x2c0c3d=_0x2c0c3d-0x0;var _0x153641=_0x0918[_0x2c0c3d];return _0x153641;};'use strict';var _=require(_0x8091('0x0'));var util=require(_0x8091('0x1'));var moment=require(_0x8091('0x2'));var BPromise=require(_0x8091('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8091('0x4'));var db=require(_0x8091('0x5'))['db'];var utils=require(_0x8091('0x6'));var logger=require('../../config/logger')(_0x8091('0x7'));var config=require(_0x8091('0x8'));var jayson=require(_0x8091('0x9'));var client=jayson[_0x8091('0xa')][_0x8091('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c70be,_0x465227,_0x4c6df6){return new BPromise(function(_0xf02fbc,_0x581c53){return client[_0x8091('0xc')](_0x4c70be,_0x4c6df6)['then'](function(_0x2f5846){logger['info'](_0x8091('0xd'),_0x465227,_0x8091('0xe'));logger[_0x8091('0xf')](_0x8091('0x10'),_0x465227,_0x8091('0xe'),JSON[_0x8091('0x11')](_0x2f5846));if(_0x2f5846[_0x8091('0x12')]){if(_0x2f5846[_0x8091('0x12')][_0x8091('0x13')]===0x1f4){logger[_0x8091('0x12')](_0x8091('0xd'),_0x465227,_0x2f5846[_0x8091('0x12')][_0x8091('0x14')]);return _0x581c53(_0x2f5846[_0x8091('0x12')]['message']);}logger[_0x8091('0x12')](_0x8091('0xd'),_0x465227,_0x2f5846['error'][_0x8091('0x14')]);return _0xf02fbc(_0x2f5846['error'][_0x8091('0x14')]);}else{logger[_0x8091('0x15')](_0x8091('0xd'),_0x465227,'request\x20sent');_0xf02fbc(_0x2f5846['result']['message']);}})[_0x8091('0x16')](function(_0x426985){logger['error'](_0x8091('0xd'),_0x465227,_0x426985);_0x581c53(_0x426985);});});}exports[_0x8091('0x17')]=function(_0xc2b699){var _0x216a93=this;return new Promise(function(_0x4b35e3,_0x299bd2){return db[_0x8091('0x18')][_0x8091('0x19')](_0xc2b699[_0x8091('0x1a')],{'raw':_0xc2b699[_0x8091('0x1b')]?_0xc2b699[_0x8091('0x1b')][_0x8091('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc2b699['options']?_0xc2b699[_0x8091('0x1b')][_0x8091('0x1d')]||null:null,'attributes':_0xc2b699[_0x8091('0x1b')]?_0xc2b699[_0x8091('0x1b')][_0x8091('0x1e')]||null:null,'limit':_0xc2b699[_0x8091('0x1b')]?_0xc2b699[_0x8091('0x1b')]['limit']||null:null})[_0x8091('0x1f')](function(_0x2e2d8a){logger[_0x8091('0x15')]('UpdateFaxApplication',_0xc2b699);logger[_0x8091('0xf')]('UpdateFaxApplication',_0xc2b699,JSON['stringify'](_0x2e2d8a));_0x4b35e3(_0x2e2d8a);})[_0x8091('0x16')](function(_0x3bcda7){logger['error']('UpdateFaxApplication',_0x3bcda7[_0x8091('0x14')],_0xc2b699);_0x299bd2(_0x216a93['error'](0x1f4,_0x3bcda7['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d420c45..9fa99cb 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 _0xea28=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xea28,0x13a));var _0x8ea2=function(_0x2a12ed,_0x2f4927){_0x2a12ed=_0x2a12ed-0x0;var _0x44cbf5=_0xea28[_0x2a12ed];return _0x44cbf5;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xf')]('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0x11')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router['delete']('/:id',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);module[_0x8ea2('0x14')]=router; \ No newline at end of file +var _0x087b=['destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x5298da,_0x47d118){var _0x289f32=function(_0x481cff){while(--_0x481cff){_0x5298da['push'](_0x5298da['shift']());}};_0x289f32(++_0x47d118);}(_0x087b,0x11a));var _0xb087=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x087b[_0x46d0c9];return _0x174506;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0xd')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0xf')](_0xb087('0xb'),auth['isAuthenticated'](),controller[_0xb087('0x10')]);router[_0xb087('0x11')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);module[_0xb087('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 94763c6..bc7475f 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 _0xe68a=['exports','STRING','out','DATE','ENUM','sequelize'];(function(_0xd09f18,_0x3ef147){var _0x1cc45d=function(_0x300f68){while(--_0x300f68){_0xd09f18['push'](_0xd09f18['shift']());}};_0x1cc45d(++_0x3ef147);}(_0xe68a,0x15b));var _0xae68=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0xe68a[_0xb6a965];return _0x51d37d;};'use strict';var Sequelize=require(_0xae68('0x0'));module[_0xae68('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xae68('0x2')]},'secondDisposition':{'type':Sequelize[_0xae68('0x2')]},'thirdDisposition':{'type':Sequelize[_0xae68('0x2')]},'note':{'type':Sequelize[_0xae68('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xae68('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xae68('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xae68('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xae68('0x5')]('in',_0xae68('0x3')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x3bad=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x57a643,_0x52b7b6){var _0x4462cf=function(_0x511845){while(--_0x511845){_0x57a643['push'](_0x57a643['shift']());}};_0x4462cf(++_0x52b7b6);}(_0x3bad,0x1d4));var _0xd3ba=function(_0xe89fb,_0x5c2fd1){_0xe89fb=_0xe89fb-0x0;var _0x595f23=_0x3bad[_0xe89fb];return _0x595f23;};'use strict';var Sequelize=require(_0xd3ba('0x0'));module['exports']={'closed':{'type':Sequelize[_0xd3ba('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd3ba('0x2')]},'disposition':{'type':Sequelize[_0xd3ba('0x3')]},'secondDisposition':{'type':Sequelize[_0xd3ba('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd3ba('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xd3ba('0x2')]},'fax':{'type':Sequelize[_0xd3ba('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd3ba('0x4')]('in',_0xd3ba('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd3ba('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xd3ba('0x4')]('in',_0xd3ba('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 413139c..4e84708 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 _0x408a=['create','update','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','$gte','format','addTags','spread','Tag','findAll','faxInteractionTags:save','removeTags','download','join','server','files','tmp','root','transcript-%d-%s.zip','Attachment','Messages','get','existsSync','createReadStream','pipe','createWriteStream','basename','err','unlinkSync','sendStatus','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','localhost','redis','./faxInteraction.socket','register','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','name','Users','map','TagIds','Tags','forEach','push','catch','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','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','body','end','some','compact','isEmpty','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','sequelize','toString','keyBy','merge','a.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','contactName','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','includeAll','include','options'];(function(_0x5bdae6,_0x50a3dd){var _0x116917=function(_0x3222bc){while(--_0x3222bc){_0x5bdae6['push'](_0x5bdae6['shift']());}};_0x116917(++_0x50a3dd);}(_0x408a,0xf9));var _0xa408=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x408a[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xa408('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa408('0x1'));var rp=require(_0xa408('0x2'));var moment=require(_0xa408('0x3'));var BPromise=require(_0xa408('0x4'));var Mustache=require(_0xa408('0x5'));var util=require(_0xa408('0x6'));var path=require(_0xa408('0x7'));var sox=require(_0xa408('0x8'));var csv=require(_0xa408('0x9'));var ejs=require(_0xa408('0xa'));var fs=require('fs');var fs_extra=require(_0xa408('0xb'));var _=require('lodash');var squel=require(_0xa408('0xc'));var crypto=require('crypto');var jsforce=require(_0xa408('0xd'));var deskjs=require(_0xa408('0xe'));var toCsv=require(_0xa408('0x9'));var querystring=require(_0xa408('0xf'));var Papa=require('papaparse');var Redis=require(_0xa408('0x10'));var authService=require(_0xa408('0x11'));var qs=require(_0xa408('0x12'));var as=require(_0xa408('0x13'));var hardwareService=require(_0xa408('0x14'));var logger=require(_0xa408('0x15'))(_0xa408('0x16'));var utils=require(_0xa408('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa408('0x18')](config['redis'],{'host':_0xa408('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa408('0x1a')]));require(_0xa408('0x1b'))[_0xa408('0x1c')](socket);function respondWithStatusCode(_0x29f8f6,_0x4a4d2c){_0x4a4d2c=_0x4a4d2c||0xcc;return function(_0x5e8b62){if(_0x5e8b62){return _0x29f8f6['sendStatus'](_0x4a4d2c);}return _0x29f8f6[_0xa408('0x1d')](_0x4a4d2c)['end']();};}function respondWithResult(_0x2f64ca,_0x2fbf2b){_0x2fbf2b=_0x2fbf2b||0xc8;return function(_0xa4f273){if(_0xa4f273){return _0x2f64ca[_0xa408('0x1d')](_0x2fbf2b)[_0xa408('0x1e')](_0xa4f273);}};}function respondWithFilteredResult(_0x5c2aba,_0x3be8ef){return function(_0x2473d1){if(_0x2473d1){var _0x4be3e5=typeof _0x3be8ef['offset']===_0xa408('0x1f')&&typeof _0x3be8ef[_0xa408('0x20')]===_0xa408('0x1f');var _0xae66ae=_0x2473d1[_0xa408('0x21')];var _0x3a8a5f=_0x4be3e5?0x0:_0x3be8ef[_0xa408('0x22')];var _0x1c59f1=_0x4be3e5?_0x2473d1[_0xa408('0x21')]:_0x3be8ef[_0xa408('0x22')]+_0x3be8ef[_0xa408('0x20')];var _0x51270c;if(_0x1c59f1>=_0xae66ae){_0x1c59f1=_0xae66ae;_0x51270c=0xc8;}else{_0x51270c=0xce;}_0x5c2aba['status'](_0x51270c);return _0x5c2aba['set'](_0xa408('0x23'),_0x3a8a5f+'-'+_0x1c59f1+'/'+_0xae66ae)['json'](_0x2473d1);}return null;};}function patchUpdates(_0x55b236){return function(_0x4e5785){try{jsonpatch[_0xa408('0x24')](_0x4e5785,_0x55b236,!![]);}catch(_0x1a0ef3){return BPromise[_0xa408('0x25')](_0x1a0ef3);}return _0x4e5785[_0xa408('0x26')]();};}function saveUpdates(_0x4cb2ba,_0xffdc6a){return function(_0x165b07){if(_0x165b07){return _0x165b07['update'](_0x4cb2ba)['then'](function(_0x36bfb6){return _0x36bfb6;});}return null;};}function removeEntity(_0x186f74,_0x4a7dca){return function(_0x40ea2d){if(_0x40ea2d){return _0x40ea2d[_0xa408('0x27')]()[_0xa408('0x28')](function(){_0x186f74[_0xa408('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fd566,_0x29fc94){return function(_0x47fc11){if(!_0x47fc11){_0x1fd566['sendStatus'](0x194);}return _0x47fc11;};}function handleError(_0x14dcb1,_0x2c0a30){_0x2c0a30=_0x2c0a30||0x1f4;return function(_0x907caf){logger['error'](_0x907caf['stack']);if(_0x907caf['name']){delete _0x907caf[_0xa408('0x29')];}_0x14dcb1[_0xa408('0x1d')](_0x2c0a30)['send'](_0x907caf);};}function getInteractionUsers(_0x5a9d51,_0x15ce75){return new BPromise(function(_0x7372a8,_0x36ce90){try{if(_0x15ce75[_0x5a9d51['id']]){_0x5a9d51[_0xa408('0x2a')]=_[_0xa408('0x2b')](_0x15ce75[_0x5a9d51['id']],function(_0x5697ea){return{'id':_0x5697ea['id'],'fullname':_0x5697ea['fullname']};});}}catch(_0x1b715b){_0x36ce90(_0x1b715b);}_0x7372a8(_0x5a9d51);});}function getInteractionTags(_0x4e4d0d,_0xb14a7){return new BPromise(function(_0x520b67,_0x276a14){try{if(_0x4e4d0d[_0xa408('0x2c')]){_0x4e4d0d[_0xa408('0x2d')]=[];_0x4e4d0d[_0xa408('0x2c')]['split'](',')[_0xa408('0x2e')](function(_0x246e60){_0x4e4d0d[_0xa408('0x2d')][_0xa408('0x2f')](_0xb14a7[_0x246e60]);});}delete _0x4e4d0d[_0xa408('0x2c')];}catch(_0x1fa83e){_0x276a14(_0x1fa83e);}_0x520b67(_0x4e4d0d);});}function updateFaxInteraction(_0x17a65f,_0x27ccdf,_0x14ccb1){return new BPromise(function(_0x4cda69,_0x526abc){return getInteractionUsers(_0x17a65f,_0x14ccb1)[_0xa408('0x28')](function(_0xad6352){return getInteractionTags(_0xad6352,_0x27ccdf);})[_0xa408('0x28')](function(_0x49d8df){_0x4cda69(_0x49d8df);})[_0xa408('0x30')](function(_0x11d8ef){_0x526abc(_0x11d8ef);});});}exports['index']=function(_0x4208a7,_0x552460){var _0x129727={},_0x394658={},_0x490358={'count':0x0,'rows':[]};var _0x4f0500=_[_0xa408('0x2b')](db[_0xa408('0x31')][_0xa408('0x32')],function(_0x5a977d){return{'name':_0x5a977d[_0xa408('0x33')],'type':_0x5a977d[_0xa408('0x34')][_0xa408('0x35')]};});_0x394658[_0xa408('0x36')]=_[_0xa408('0x2b')](_0x4f0500,_0xa408('0x29'));_0x394658[_0xa408('0x37')]=_[_0xa408('0x38')](_0x4208a7[_0xa408('0x37')]);_0x394658[_0xa408('0x39')]=_[_0xa408('0x3a')](_0x394658[_0xa408('0x36')],_0x394658[_0xa408('0x37')]);_0x129727[_0xa408('0x3b')]=_[_0xa408('0x3a')](_0x394658[_0xa408('0x36')],qs[_0xa408('0x3c')](_0x4208a7[_0xa408('0x37')][_0xa408('0x3c')]));_0x129727[_0xa408('0x3b')]=_0x129727['attributes']['length']?_0x129727[_0xa408('0x3b')]:_0x394658[_0xa408('0x36')];if(!_0x4208a7[_0xa408('0x37')][_0xa408('0x3d')](_0xa408('0x3e'))){_0x129727[_0xa408('0x20')]=qs[_0xa408('0x20')](_0x4208a7[_0xa408('0x37')]['limit']);_0x129727[_0xa408('0x22')]=qs['offset'](_0x4208a7[_0xa408('0x37')][_0xa408('0x22')]);}_0x129727[_0xa408('0x3f')]=qs[_0xa408('0x40')](_0x4208a7[_0xa408('0x37')][_0xa408('0x40')]);_0x129727[_0xa408('0x41')]=qs[_0xa408('0x39')](_[_0xa408('0x42')](_0x4208a7['query'],_0x394658[_0xa408('0x39')]),_0x4f0500);var _0x176580=[];var _0x813e22=squel[_0xa408('0x43')]()[_0xa408('0x44')]('id')[_0xa408('0x44')](_0xa408('0x29'))[_0xa408('0x44')](_0xa408('0x45'))[_0xa408('0x46')](_0xa408('0x47'));var _0x480ad2=squel[_0xa408('0x43')]()[_0xa408('0x44')](_0xa408('0x48'))[_0xa408('0x44')](_0xa408('0x49'))['field']('ui.FaxInteractionId')[_0xa408('0x46')](_0xa408('0x4a'),'ui')[_0xa408('0x4b')](_0xa408('0x4c'),'u',_0xa408('0x4d'));var _0x5ccb99=squel[_0xa408('0x43')]()[_0xa408('0x46')]('fax_interactions','i')[_0xa408('0x4b')](_0xa408('0x4e'),'c',_0xa408('0x4f'))['left_join'](_0xa408('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xa408('0x4b')](_0xa408('0x50'),'a',_0xa408('0x51'))[_0xa408('0x4b')](_0xa408('0x52'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xa408('0x4b')](_0xa408('0x53'),'it',_0xa408('0x54'))['left_join'](_0xa408('0x47'),'t','t.id\x20=\x20it.TagId');var _0x413f11=squel['expr']();var _0x402cd3=[];var _0x3a7890=squel['expr']();var _0x52bc1e;if(_0x4208a7[_0xa408('0x37')][_0xa408('0x55')]){_0x52bc1e=as[_0xa408('0x56')](_0x4208a7[_0xa408('0x37')][_0xa408('0x55')]);var _0x4d5288=_0x52bc1e[_0xa408('0x57')];for(var _0x16fc7e=0x0;_0x16fc7e<_0x52bc1e['conditions'][_0xa408('0x58')];_0x16fc7e++){var _0xb0c5cf=_0x52bc1e[_0xa408('0x59')][_0x16fc7e];var _0x3df486='i';var _0x442a0f=_[_0xa408('0x5a')](_0x4f0500,[_0xa408('0x29'),_0xb0c5cf['field']]);if(!_0x442a0f){switch(_0xb0c5cf[_0xa408('0x44')]){case _0xa408('0x5b'):if(_0xb0c5cf[_0xa408('0x5c')]==0x1){_0x5ccb99[_0xa408('0x5d')]('`'+_0xb0c5cf[_0xa408('0x44')]+_0xa408('0x5e'));}else{_0x5ccb99[_0xa408('0x5d')]('`'+_0xb0c5cf['field']+_0xa408('0x5f'));}break;case _0xa408('0x60'):if(_0xb0c5cf['operator']===_0xa408('0x61')){if(_0xb0c5cf['value'][_0xa408('0x62')]('\x20')[_0xa408('0x58')]>0x1){_0x413f11[_0x4d5288](_0xa408('0x63'),qs['getFullTextValue'](_0xb0c5cf[_0xa408('0x5c')]),null);}else{var _0xb1e08c='%'+_0xb0c5cf[_0xa408('0x5c')]+'%';_0x413f11[_0x4d5288]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xb1e08c,_0xb1e08c,_0xb1e08c);}}else{_0x442a0f=_[_0xa408('0x5a')](_0x4f0500,[_0xa408('0x29'),_0xa408('0x64')]);_0xb0c5cf[_0xa408('0x44')]=_0xa408('0x64');_0x355bb1=as[_0xa408('0x65')](_0x3df486,_0x442a0f[_0xa408('0x34')],_0xb0c5cf);_0x413f11[_0x4d5288](_0x355bb1[_0xa408('0x66')],_0x355bb1[_0xa408('0x5c')][_0xa408('0x67')],_0x355bb1[_0xa408('0x5c')]['end']);}break;case'Tag':var _0x252bf9=_0xb0c5cf[_0xa408('0x5c')][_0xa408('0x62')](',')['map'](function(_0xa57796){return Number(_0xa57796);});_0x252bf9[_0xa408('0x2e')](function(_0x26f2ca){_0x3a7890['or'](_0xa408('0x68'),'%,'+_0x26f2ca+',%');});_0x402cd3=_[_0xa408('0x69')](_0x402cd3,_0x252bf9);break;case _0xa408('0x6a'):if(_0xb0c5cf[_0xa408('0x6b')]==='$substring'){_0x413f11[_0x4d5288](_0xa408('0x6c'),'%'+_0xb0c5cf[_0xa408('0x5c')]+'%',null);}else{_0x442a0f=_['find'](_0x4f0500,[_0xa408('0x29'),_0xa408('0x6d')]);_0xb0c5cf['field']=_0xa408('0x6d');_0x355bb1=as[_0xa408('0x65')](_0x3df486,_0x442a0f['type'],_0xb0c5cf);_0x413f11[_0x4d5288](_0x355bb1[_0xa408('0x66')],_0x355bb1[_0xa408('0x5c')][_0xa408('0x67')],_0x355bb1[_0xa408('0x5c')]['end']);}break;case _0xa408('0x6e'):_0x355bb1=as[_0xa408('0x65')]('me',null,_0xb0c5cf);_0x413f11[_0x4d5288](_0x355bb1['text'],_0x355bb1[_0xa408('0x5c')][_0xa408('0x67')],_0x355bb1[_0xa408('0x5c')][_0xa408('0x6f')]);break;}}else{var _0x355bb1=as[_0xa408('0x65')](_0x3df486,_0x442a0f['type'],_0xb0c5cf);_0x413f11[_0x4d5288](_0x355bb1[_0xa408('0x66')],_0x355bb1['value'][_0xa408('0x67')],_0x355bb1[_0xa408('0x5c')]['end']);}}}else{var _0x4350fb=_(_0x4208a7[_0xa408('0x37')])[_0xa408('0x38')]()[_0xa408('0x2b')](function(_0x51fdb2){return _[_0xa408('0x70')](_0x4f0500,[_0xa408('0x29'),_0x51fdb2])?_0x51fdb2:undefined;})[_0xa408('0x71')]()[_0xa408('0x5c')]();if(!_[_0xa408('0x72')](_0x4350fb)){_0x4350fb['forEach'](function(_0x5645bc){if(_0x5645bc==='FaxAccountId'){_0x5ccb99[_0xa408('0x41')]('i.FaxAccountId\x20IN\x20?',[][_0xa408('0x73')](_0x4208a7[_0xa408('0x37')][_0x5645bc]));}else if(_0x5645bc===_0xa408('0x74')){var _0x4750c6=JSON[_0xa408('0x75')](_0x4208a7[_0xa408('0x37')][_0x5645bc])['$gte'];var _0x30b079=JSON[_0xa408('0x75')](_0x4208a7['query'][_0x5645bc])[_0xa408('0x76')];_0x5ccb99[_0xa408('0x41')](_0xa408('0x77'),_0x4750c6,_0x30b079);}else{if(_0x4208a7[_0xa408('0x37')][_0x5645bc]==='null'){_0x5ccb99['where']('i.'+_0x5645bc+'\x20IS\x20NULL');}else{_0x5ccb99[_0xa408('0x41')]('i.'+_0x5645bc+'\x20=\x20?',_0x4208a7[_0xa408('0x37')][_0x5645bc]);}}});}if(_0x4208a7[_0xa408('0x37')][_0xa408('0x78')]){if(_0x4208a7['query'][_0xa408('0x78')]==0x1){_0x5ccb99[_0xa408('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x5ccb99[_0xa408('0x5d')](_0xa408('0x79'));}}if(_0x4208a7[_0xa408('0x37')][_0xa408('0x7a')]){_0x402cd3=_[_0xa408('0x7b')](_0x4208a7['query'][_0xa408('0x7a')])?_0x4208a7[_0xa408('0x37')][_0xa408('0x7a')]:new Array(_0x4208a7[_0xa408('0x37')][_0xa408('0x7a')]);_0x402cd3[_0xa408('0x2e')](function(_0x5ad272){_0x3a7890['or'](_0xa408('0x68'),'%,'+_0x5ad272+',%');});}if(_0x4208a7[_0xa408('0x37')][_0xa408('0x7c')]){var _0x2c2320=_0x4208a7[_0xa408('0x37')][_0xa408('0x7c')][_0xa408('0x7d')]('\x5c','\x5c\x5c')[_0xa408('0x7d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2c2320)){_0x413f11['or'](_0xa408('0x7e'),_0x2c2320+'%')['or'](_0xa408('0x7f'),_0x2c2320+'%');}_0x413f11['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2c2320+'%');}}_0x5ccb99[_0xa408('0x41')](_0x413f11);_0x5ccb99[_0xa408('0x80')](_0xa408('0x81'));var _0x547829={'type':db[_0xa408('0x82')]['QueryTypes'][_0xa408('0x83')],'raw':!![]};var _0x79a68f=_0x5ccb99['clone']();_0x79a68f['field'](_0xa408('0x81'));_0x79a68f[_0xa408('0x44')](_0xa408('0x84'),_0xa408('0x5b'));if(_0x129727['order']){_0x129727['order'][_0xa408('0x2e')](function(_0x3997ad){var _0x1d4998=_0x3997ad[0x0]==='contactName'?_0x3997ad[0x0]:'i.'+_0x3997ad[0x0];_0x5ccb99[_0xa408('0x3f')](_0x1d4998,_0x3997ad[0x1]===_0xa408('0x85')?![]:!![]);});}if(!_[_0xa408('0x72')](_0x402cd3)){_0x5ccb99[_0xa408('0x5d')](_0x3a7890);_0x79a68f[_0xa408('0x41')](_0xa408('0x86'),_0x402cd3);}BPromise[_0xa408('0x87')]()[_0xa408('0x28')](function(){if(!_0x52bc1e){if(_0x4208a7[_0xa408('0x37')][_0xa408('0x88')])return;_0x79a68f[_0xa408('0x41')](_0xa408('0x89'));_0x5ccb99[_0xa408('0x41')](_0xa408('0x89'));return;}if(_0x4208a7['user']['role']!==_0xa408('0x8a'))return;return _0x4208a7[_0xa408('0x8b')][_0xa408('0x8c')]({'attributes':['id'],'raw':!![]})[_0xa408('0x28')](function(_0x3486b5){if(_['isEmpty'](_0x3486b5)){_0x79a68f[_0xa408('0x41')](_0xa408('0x8d'));_0x5ccb99['where'](_0xa408('0x8d'));}else{_0x79a68f['where'](_0xa408('0x8e'),_['map'](_0x3486b5,'id'));_0x5ccb99[_0xa408('0x41')](_0xa408('0x8e'),_[_0xa408('0x2b')](_0x3486b5,'id'));}});})[_0xa408('0x28')](function(){if(_0x4208a7[_0xa408('0x8b')][_0xa408('0x8f')]==='agent'&&!_0x52bc1e&&!_0x4208a7[_0xa408('0x37')][_0xa408('0x88')])return[];return db[_0xa408('0x90')]['query'](_0x79a68f['toString'](),_0x547829);})[_0xa408('0x28')](function(_0x46ff90){_0x490358[_0xa408('0x21')]=_0x46ff90[_0xa408('0x58')];if(_0x490358[_0xa408('0x21')]===0x0)return[];return db[_0xa408('0x90')]['query'](_0x813e22[_0xa408('0x91')](),_0x547829)['then'](function(_0x553da7){_0x176580=_[_0xa408('0x92')](_0x553da7,'id');_0x547829=_[_0xa408('0x93')](_0x547829,{'model':db[_0xa408('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4208a7[_0xa408('0x37')][_0xa408('0x3c')]){_0x129727[_0xa408('0x3b')][_0xa408('0x2e')](function(_0x3c6a10){_0x5ccb99[_0xa408('0x44')]('i.'+_0x3c6a10);});}else{_0x5ccb99['field'](_0xa408('0x84'),'unreadMessages');_0x5ccb99[_0xa408('0x44')](_0xa408('0x94'),'Account.key');_0x5ccb99[_0xa408('0x44')](_0xa408('0x95'),_0xa408('0x96'));_0x5ccb99[_0xa408('0x44')](_0xa408('0x97'),_0xa408('0x98'));_0x5ccb99[_0xa408('0x44')](_0xa408('0x99'));_0x5ccb99['field'](_0xa408('0x9a'),'Contact.firstName');_0x5ccb99[_0xa408('0x44')](_0xa408('0x9b'),_0xa408('0x9c'));_0x5ccb99[_0xa408('0x44')](_0xa408('0x9d'),_0xa408('0x9e'));_0x5ccb99[_0xa408('0x44')](_0xa408('0x9f'),_0xa408('0xa0'));_0x5ccb99[_0xa408('0x44')](_0xa408('0xa1'),_0xa408('0xa2'));_0x5ccb99['field'](_0xa408('0xa3'),_0xa408('0xa4'));_0x5ccb99['field'](_0xa408('0xa5'),_0xa408('0xa6'));_0x5ccb99[_0xa408('0x44')]('o.internal',_0xa408('0xa7'));_0x5ccb99[_0xa408('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa408('0x2c'));}if(_0x129727[_0xa408('0x20')])_0x5ccb99[_0xa408('0x20')](_0x129727['limit']);if(_0x129727[_0xa408('0x22')])_0x5ccb99[_0xa408('0x22')](_0x129727[_0xa408('0x22')]);return db['sequelize']['query'](_0x5ccb99[_0xa408('0x91')](),_0x547829);})[_0xa408('0x28')](function(_0x401d77){if(_0x401d77[_0xa408('0x58')]>0x0)_0x480ad2[_0xa408('0x41')](_0xa408('0xa8'),_[_0xa408('0x2b')](_0x401d77,'id'));return db[_0xa408('0x90')][_0xa408('0x37')](_0x480ad2[_0xa408('0x91')](),_0x547829)['then'](function(_0x2d4ada){var _0x39044b=_[_0xa408('0xa9')](_0x2d4ada,_0xa408('0xaa'));var _0x3ec07b=[];_0x401d77['forEach'](function(_0x203c1f){_0x3ec07b[_0xa408('0x2f')](updateFaxInteraction(_0x203c1f,_0x176580,_0x39044b));});return BPromise[_0xa408('0xab')](_0x3ec07b);});});})[_0xa408('0x28')](function(_0x53d188){_0x490358[_0xa408('0xac')]=_0x53d188;return _0x490358;})[_0xa408('0x28')](respondWithFilteredResult(_0x552460,_0x129727))[_0xa408('0x30')](handleError(_0x552460,null));};exports[_0xa408('0xad')]=function(_0xa19f10,_0x42efd9){var _0x393aac={'raw':![],'where':{'id':_0xa19f10['params']['id']}},_0x1c4fb7={};_0x1c4fb7[_0xa408('0x36')]=_['keys'](db[_0xa408('0x31')]['rawAttributes']);_0x1c4fb7[_0xa408('0x37')]=_['keys'](_0xa19f10[_0xa408('0x37')]);_0x1c4fb7[_0xa408('0x39')]=_[_0xa408('0x3a')](_0x1c4fb7[_0xa408('0x36')],_0x1c4fb7[_0xa408('0x37')]);_0x393aac[_0xa408('0x3b')]=_[_0xa408('0x3a')](_0x1c4fb7[_0xa408('0x36')],qs['fields'](_0xa19f10[_0xa408('0x37')]['fields']));_0x393aac[_0xa408('0x3b')]=_0x393aac['attributes'][_0xa408('0x58')]?_0x393aac[_0xa408('0x3b')]:_0x1c4fb7[_0xa408('0x36')];if(_0xa19f10[_0xa408('0x37')][_0xa408('0xae')]){_0x393aac[_0xa408('0xaf')]=[{'all':!![]}];}_0x393aac=_[_0xa408('0x93')]({},_0x393aac,_0xa19f10[_0xa408('0xb0')]);return db['FaxInteraction'][_0xa408('0x5a')](_0x393aac)[_0xa408('0x28')](handleEntityNotFound(_0x42efd9,null))[_0xa408('0x28')](respondWithResult(_0x42efd9,null))['catch'](handleError(_0x42efd9,null));};exports[_0xa408('0xb1')]=function(_0x3841c0,_0x2dedcb){return db[_0xa408('0x31')][_0xa408('0xb1')](_0x3841c0['body'],{})[_0xa408('0x28')](respondWithResult(_0x2dedcb,0xc9))[_0xa408('0x30')](handleError(_0x2dedcb,null));};exports[_0xa408('0xb2')]=function(_0x21ca43,_0x57f433){if(_0x21ca43['body']['id']){delete _0x21ca43[_0xa408('0x6e')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x21ca43[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0x57f433,null))[_0xa408('0x28')](saveUpdates(_0x21ca43[_0xa408('0x6e')],null))[_0xa408('0x28')](respondWithResult(_0x57f433,null))[_0xa408('0x30')](handleError(_0x57f433,null));};exports['destroy']=function(_0x4e6ac3,_0x110501){return db[_0xa408('0x31')][_0xa408('0x5a')]({'where':{'id':_0x4e6ac3[_0xa408('0xb3')]['id']}})['then'](handleEntityNotFound(_0x110501,null))[_0xa408('0x28')](removeEntity(_0x110501,null))['catch'](handleError(_0x110501,null));};exports[_0xa408('0xb4')]=function(_0x24bdf9,_0x251f5a){return db[_0xa408('0x31')]['describe']()[_0xa408('0x28')](respondWithResult(_0x251f5a,null))[_0xa408('0x30')](handleError(_0x251f5a,null));};exports[_0xa408('0xb5')]=function(_0x3ab01c,_0x91e2d3,_0x350e5b){return db[_0xa408('0xb6')][_0xa408('0x5a')]({'where':{'id':_0x3ab01c[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0x91e2d3,null))[_0xa408('0x28')](function(_0xed7117){if(_0xed7117){return _0xed7117[_0xa408('0xb5')](_0x3ab01c[_0xa408('0x6e')][_0xa408('0xb7')],_[_0xa408('0xb8')](_0x3ab01c[_0xa408('0x6e')],[_0xa408('0xb7'),'id'])||{});}})[_0xa408('0x28')](respondWithResult(_0x91e2d3,null))[_0xa408('0x30')](handleError(_0x91e2d3,null));};exports[_0xa408('0xb9')]=function(_0x49220e,_0x16f28c,_0x3289df){var _0xbe05d9={'raw':![],'where':{}};var _0x2d7c6e={};var _0xeb84f6={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xa408('0xba')]({'where':{'id':_0x49220e[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0x16f28c,null))[_0xa408('0x28')](function(_0x8fefa0){if(_0x8fefa0){_0x2d7c6e[_0xa408('0x36')]=_[_0xa408('0x38')](db[_0xa408('0xb6')]['rawAttributes']);_0x2d7c6e[_0xa408('0x37')]=_[_0xa408('0x38')](_0x49220e['query']);_0x2d7c6e[_0xa408('0x39')]=_['intersection'](_0x2d7c6e[_0xa408('0x36')],_0x2d7c6e[_0xa408('0x37')]);_0xbe05d9[_0xa408('0x3b')]=_[_0xa408('0x3a')](_0x2d7c6e[_0xa408('0x36')],qs[_0xa408('0x3c')](_0x49220e[_0xa408('0x37')][_0xa408('0x3c')]));_0xbe05d9['attributes']=_0xbe05d9[_0xa408('0x3b')][_0xa408('0x58')]?_0xbe05d9[_0xa408('0x3b')]:_0x2d7c6e['model'];if(!_0x49220e[_0xa408('0x37')]['hasOwnProperty']('nolimit')){_0xbe05d9[_0xa408('0x20')]=qs[_0xa408('0x20')](_0x49220e[_0xa408('0x37')][_0xa408('0x20')]);_0xbe05d9[_0xa408('0x22')]=qs[_0xa408('0x22')](_0x49220e[_0xa408('0x37')][_0xa408('0x22')]);}_0xbe05d9[_0xa408('0x3f')]=qs[_0xa408('0x40')](_0x49220e['query']['sort']);_0xbe05d9['where']=qs['filters'](_[_0xa408('0x42')](_0x49220e[_0xa408('0x37')],_0x2d7c6e[_0xa408('0x39')]));_0xbe05d9[_0xa408('0x41')][_0xa408('0xaa')]=_0x8fefa0['id'];if(_0x49220e[_0xa408('0x37')][_0xa408('0x7c')]){_0xbe05d9[_0xa408('0x41')]=_['merge'](_0xbe05d9[_0xa408('0x41')],{'$or':_[_0xa408('0x2b')](_0xbe05d9[_0xa408('0x3b')],function(_0x38bdba){var _0x497aaf={};_0x497aaf[_0x38bdba]={'$like':'%'+_0x49220e[_0xa408('0x37')][_0xa408('0x7c')]+'%'};return _0x497aaf;})});}if(_0x49220e[_0xa408('0x37')][_0xa408('0xbb')]){var _0x54ff4a=_0x49220e['query'][_0xa408('0xbb')][_0xa408('0x62')](',');var _0x588497={};_0x588497[_0x54ff4a[0x0]]={'$gte':moment(_0x54ff4a[0x1])[_0xa408('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0xbe05d9[_0xa408('0x41')]=_[_0xa408('0x93')](_0xbe05d9['where'],_0x588497);}_0xbe05d9=_[_0xa408('0x93')]({},_0xbe05d9,_0x49220e[_0xa408('0xb0')]);return db[_0xa408('0xb6')][_0xa408('0x21')]({'where':_0xbe05d9[_0xa408('0x41')]})['then'](function(_0xbeb44b){_0xeb84f6['count']=_0xbeb44b;if(_0x49220e[_0xa408('0x37')][_0xa408('0xae')]){_0xbe05d9[_0xa408('0xaf')]=[{'all':!![]}];}return db[_0xa408('0xb6')]['findAll'](_0xbe05d9);})[_0xa408('0x28')](function(_0xfcebc){_0xeb84f6[_0xa408('0xac')]=_0xfcebc;return _0xeb84f6;});}})[_0xa408('0x28')](respondWithFilteredResult(_0x16f28c,_0xbe05d9))['catch'](handleError(_0x16f28c,null));};exports[_0xa408('0xbd')]=function(_0xe23f54,_0x5372d3,_0x59e994){return db[_0xa408('0x31')][_0xa408('0x5a')]({'where':{'id':_0xe23f54[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0x5372d3,null))[_0xa408('0x28')](function(_0x2f0613){if(_0x2f0613){return _0x2f0613['setTags'](_0xe23f54['body'][_0xa408('0xb7')],_[_0xa408('0xb8')](_0xe23f54[_0xa408('0x6e')],[_0xa408('0xb7'),'id'])||{})[_0xa408('0xbe')](function(){return db[_0xa408('0xbf')][_0xa408('0xc0')]({'attributes':['id',_0xa408('0x29'),_0xa408('0x45')],'where':{'id':_0xe23f54['body'][_0xa408('0xb7')]}});})[_0xa408('0x28')](function(_0x15a115){socket['emit'](_0xa408('0xc1'),{'id':Number(_0xe23f54[_0xa408('0xb3')]['id']),'tags':_0x15a115||[]});return{'id':Number(_0xe23f54[_0xa408('0xb3')]['id']),'tags':_0x15a115||[]};});}})[_0xa408('0x28')](respondWithResult(_0x5372d3,null))[_0xa408('0x30')](handleError(_0x5372d3,null));};exports['removeTags']=function(_0x4cd3cb,_0xf376ab,_0x236712){return db['FaxInteraction'][_0xa408('0x5a')]({'where':{'id':_0x4cd3cb[_0xa408('0xb3')]['id']}})[_0xa408('0x28')](handleEntityNotFound(_0xf376ab,null))[_0xa408('0x28')](function(_0x13e064){if(_0x13e064){return _0x13e064[_0xa408('0xc2')](_0x4cd3cb[_0xa408('0x37')][_0xa408('0xb7')]);}})[_0xa408('0x28')](respondWithStatusCode(_0xf376ab,null))[_0xa408('0x30')](handleError(_0xf376ab,null));};exports[_0xa408('0xc3')]=function(_0x1a1aa2,_0xbdfd34){var _0x3f9186=moment()['unix']()[_0xa408('0x91')]();var _0x5b22c6=path[_0xa408('0xc4')](config['root'],_0xa408('0xc5'),_0xa408('0xc6'),_0xa408('0xc7'));var _0x173ab0=path['join'](config[_0xa408('0xc8')],'server',_0xa408('0xc6'),'attachments');var _0x3f3796=path[_0xa408('0xc4')](_0x5b22c6,_0x3f9186);var _0x2b4013=util['format'](_0xa408('0xc9'),_0x1a1aa2[_0xa408('0xb3')]['id'],_0x3f9186);var _0x1b260c=path[_0xa408('0xc4')](_0x5b22c6,_0x2b4013);var _0x3b41fb=[];_0x3b41fb[_0xa408('0x2f')]({'model':db[_0xa408('0xca')],'as':_0xa408('0xca'),'raw':!![]});var _0xd93eaa=[{'model':db[_0xa408('0xb6')],'as':_0xa408('0xcb'),'attributes':['id',_0xa408('0x6e'),_0xa408('0x74')],'include':_0x3b41fb}];return db['FaxInteraction'][_0xa408('0x5a')]({'where':{'id':_0x1a1aa2['params']['id']},'include':_0xd93eaa})['then'](handleEntityNotFound(_0xbdfd34,null))[_0xa408('0x28')](function(_0x43f6ef){if(_0x43f6ef&&_0x43f6ef[_0xa408('0xcb')]){var _0x2127f8=_0x43f6ef[_0xa408('0xcc')]({'plain':!![]});fs['mkdirSync'](_0x3f3796);for(var _0xd3026d=0x0;_0xd3026d<_0x2127f8['Messages'][_0xa408('0x58')];_0xd3026d++){var _0x1ede07=_0x2127f8[_0xa408('0xcb')][_0xd3026d][_0xa408('0xca')];if(_0x1ede07){var _0x26f694=path['join'](_0x173ab0,_0x1ede07['basename']);if(fs[_0xa408('0xcd')](_0x26f694)){fs[_0xa408('0xce')](_0x26f694)[_0xa408('0xcf')](fs[_0xa408('0xd0')](path[_0xa408('0xc4')](_0x3f3796,_0x1ede07[_0xa408('0xd1')])));}}}return BPromise[_0xa408('0x87')]()[_0xa408('0x28')](function(){return new BPromise(function(_0x49898c,_0x5d5dbb){zipdir(_0x3f3796,{'saveTo':_0x1b260c},function(_0x42823b,_0x5eb983){if(_0x42823b)return _0x5d5dbb(_0x42823b);return _0x49898c(_0x5eb983);});})[_0xa408('0x28')](function(){return new BPromise(function(_0x52f37e,_0xa40400){rimraf(_0x3f3796,function(_0x29298e){if(_0x29298e)_0xa40400(_0x29298e);return _0x52f37e();});});})[_0xa408('0x28')](function(){return _0xbdfd34['download'](_0x1b260c,_0x2b4013,function(_0x50751a){if(_0x50751a){console['log'](_0xa408('0xd2'),_0x50751a);}else{fs[_0xa408('0xd3')](_0x1b260c);}});});});}else{return _0xbdfd34[_0xa408('0xd4')](0xc8);}})[_0xa408('0x30')](handleError(_0xbdfd34,null));}; \ No newline at end of file +var _0x910c=['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','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','FaxInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','color','tools_tags','select','u.id','u.fullname','field','ui.FaxInteractionId','from','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','forEach','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','FaxAccountId','where','concat','createdAt','$gte','parse','$lte','null','\x20=\x20?','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?','i.id','QueryTypes','unreadMessages','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','include','options','catch','create','body','describe','addMessage','FaxMessage','ids','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','mkdirSync','Messages','basename','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x599df6,_0x554547){var _0x400158=function(_0x54b2aa){while(--_0x54b2aa){_0x599df6['push'](_0x599df6['shift']());}};_0x400158(++_0x554547);}(_0x910c,0x1b4));var _0xc910=function(_0x26f866,_0x1900bc){_0x26f866=_0x26f866-0x0;var _0x1abef3=_0x910c[_0x26f866];return _0x1abef3;};'use strict';var emlformat=require(_0xc910('0x0'));var rimraf=require(_0xc910('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc910('0x2'));var rp=require(_0xc910('0x3'));var moment=require(_0xc910('0x4'));var BPromise=require(_0xc910('0x5'));var Mustache=require(_0xc910('0x6'));var util=require(_0xc910('0x7'));var path=require('path');var sox=require(_0xc910('0x8'));var csv=require(_0xc910('0x9'));var ejs=require(_0xc910('0xa'));var fs=require('fs');var fs_extra=require(_0xc910('0xb'));var _=require(_0xc910('0xc'));var squel=require(_0xc910('0xd'));var crypto=require(_0xc910('0xe'));var jsforce=require(_0xc910('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc910('0x10'));var Papa=require(_0xc910('0x11'));var Redis=require(_0xc910('0x12'));var authService=require(_0xc910('0x13'));var qs=require(_0xc910('0x14'));var as=require(_0xc910('0x15'));var hardwareService=require(_0xc910('0x16'));var logger=require(_0xc910('0x17'))(_0xc910('0x18'));var utils=require(_0xc910('0x19'));var config=require(_0xc910('0x1a'));var licenseUtil=require(_0xc910('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc910('0x1c')](config[_0xc910('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xc910('0x1e'))(new Redis(config[_0xc910('0x1d')]));require(_0xc910('0x1f'))[_0xc910('0x20')](socket);function respondWithStatusCode(_0xc8b08f,_0x43ff55){_0x43ff55=_0x43ff55||0xcc;return function(_0x1fc001){if(_0x1fc001){return _0xc8b08f['sendStatus'](_0x43ff55);}return _0xc8b08f[_0xc910('0x21')](_0x43ff55)[_0xc910('0x22')]();};}function respondWithResult(_0x19e62b,_0x501839){_0x501839=_0x501839||0xc8;return function(_0x2a1a46){if(_0x2a1a46){return _0x19e62b[_0xc910('0x21')](_0x501839)[_0xc910('0x23')](_0x2a1a46);}};}function respondWithFilteredResult(_0xd4148b,_0x41b439){return function(_0xb62db4){if(_0xb62db4){var _0x3d7968=typeof _0x41b439[_0xc910('0x24')]===_0xc910('0x25')&&typeof _0x41b439[_0xc910('0x26')]===_0xc910('0x25');var _0x2dc10a=_0xb62db4[_0xc910('0x27')];var _0x391049=_0x3d7968?0x0:_0x41b439[_0xc910('0x24')];var _0x5a94b1=_0x3d7968?_0xb62db4['count']:_0x41b439[_0xc910('0x24')]+_0x41b439[_0xc910('0x26')];var _0x3637e7;if(_0x5a94b1>=_0x2dc10a){_0x5a94b1=_0x2dc10a;_0x3637e7=0xc8;}else{_0x3637e7=0xce;}_0xd4148b['status'](_0x3637e7);return _0xd4148b[_0xc910('0x28')](_0xc910('0x29'),_0x391049+'-'+_0x5a94b1+'/'+_0x2dc10a)[_0xc910('0x23')](_0xb62db4);}return null;};}function patchUpdates(_0x3b057a){return function(_0x1bce39){try{jsonpatch['apply'](_0x1bce39,_0x3b057a,!![]);}catch(_0x3c80a2){return BPromise[_0xc910('0x2a')](_0x3c80a2);}return _0x1bce39[_0xc910('0x2b')]();};}function saveUpdates(_0x177810,_0x1352b6){return function(_0x164ea8){if(_0x164ea8){return _0x164ea8[_0xc910('0x2c')](_0x177810)[_0xc910('0x2d')](function(_0x29c28b){return _0x29c28b;});}return null;};}function removeEntity(_0x188b34,_0x265515){return function(_0x4e32d0){if(_0x4e32d0){return _0x4e32d0[_0xc910('0x2e')]()['then'](function(){_0x188b34[_0xc910('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5233ce,_0x1eb556){return function(_0x414701){if(!_0x414701){_0x5233ce[_0xc910('0x2f')](0x194);}return _0x414701;};}function handleError(_0xc7f40f,_0x47ebe9){_0x47ebe9=_0x47ebe9||0x1f4;return function(_0x562d95){logger['error'](_0x562d95[_0xc910('0x30')]);if(_0x562d95[_0xc910('0x31')]){delete _0x562d95[_0xc910('0x31')];}_0xc7f40f[_0xc910('0x21')](_0x47ebe9)[_0xc910('0x32')](_0x562d95);};}function getInteractionUsers(_0x5dc0da,_0x3f50f6){return new BPromise(function(_0x494de4,_0x3ae238){try{if(_0x3f50f6[_0x5dc0da['id']]){_0x5dc0da[_0xc910('0x33')]=_[_0xc910('0x34')](_0x3f50f6[_0x5dc0da['id']],function(_0x388ad9){return{'id':_0x388ad9['id'],'fullname':_0x388ad9[_0xc910('0x35')]};});}}catch(_0xaf6927){_0x3ae238(_0xaf6927);}_0x494de4(_0x5dc0da);});}function getInteractionTags(_0x410a6b,_0x1bc424){return new BPromise(function(_0xa1c2ba,_0x5d6f59){try{if(_0x410a6b[_0xc910('0x36')]){_0x410a6b[_0xc910('0x37')]=[];_0x410a6b[_0xc910('0x36')][_0xc910('0x38')](',')['forEach'](function(_0x6254e5){_0x410a6b[_0xc910('0x37')][_0xc910('0x39')](_0x1bc424[_0x6254e5]);});}delete _0x410a6b[_0xc910('0x36')];}catch(_0x8eb42c){_0x5d6f59(_0x8eb42c);}_0xa1c2ba(_0x410a6b);});}function updateFaxInteraction(_0xe7f06d,_0x452239,_0x342d06){return new BPromise(function(_0x283a12,_0x2cf81e){return getInteractionUsers(_0xe7f06d,_0x342d06)['then'](function(_0x56b1fa){return getInteractionTags(_0x56b1fa,_0x452239);})[_0xc910('0x2d')](function(_0x28f7e4){_0x283a12(_0x28f7e4);})['catch'](function(_0xd7301b){_0x2cf81e(_0xd7301b);});});}exports['index']=function(_0x5b1e5d,_0x270e36){var _0x227dc5={},_0x2424d6={},_0x31ad1c={'count':0x0,'rows':[]};var _0x1296d7=_[_0xc910('0x34')](db[_0xc910('0x3a')][_0xc910('0x3b')],function(_0x5abfb9){return{'name':_0x5abfb9[_0xc910('0x3c')],'type':_0x5abfb9[_0xc910('0x3d')]['key']};});_0x2424d6[_0xc910('0x3e')]=_[_0xc910('0x34')](_0x1296d7,'name');_0x2424d6[_0xc910('0x3f')]=_[_0xc910('0x40')](_0x5b1e5d['query']);_0x2424d6[_0xc910('0x41')]=_[_0xc910('0x42')](_0x2424d6[_0xc910('0x3e')],_0x2424d6[_0xc910('0x3f')]);_0x227dc5['attributes']=_[_0xc910('0x42')](_0x2424d6[_0xc910('0x3e')],qs['fields'](_0x5b1e5d['query'][_0xc910('0x43')]));_0x227dc5['attributes']=_0x227dc5[_0xc910('0x44')][_0xc910('0x45')]?_0x227dc5[_0xc910('0x44')]:_0x2424d6[_0xc910('0x3e')];if(!_0x5b1e5d['query'][_0xc910('0x46')]('nolimit')){_0x227dc5['limit']=qs['limit'](_0x5b1e5d['query']['limit']);_0x227dc5[_0xc910('0x24')]=qs[_0xc910('0x24')](_0x5b1e5d['query'][_0xc910('0x24')]);}_0x227dc5['order']=qs[_0xc910('0x47')](_0x5b1e5d[_0xc910('0x3f')][_0xc910('0x47')]);_0x227dc5['where']=qs[_0xc910('0x41')](_[_0xc910('0x48')](_0x5b1e5d[_0xc910('0x3f')],_0x2424d6['filters']),_0x1296d7);var _0x30c5cf=[];var _0x25598a=squel['select']()['field']('id')['field'](_0xc910('0x31'))['field'](_0xc910('0x49'))['from'](_0xc910('0x4a'));var _0x4b5c72=squel[_0xc910('0x4b')]()['field'](_0xc910('0x4c'))['field'](_0xc910('0x4d'))[_0xc910('0x4e')](_0xc910('0x4f'))[_0xc910('0x50')](_0xc910('0x51'),'ui')['left_join'](_0xc910('0x52'),'u',_0xc910('0x53'));var _0x5b9548=squel[_0xc910('0x4b')]()[_0xc910('0x50')]('fax_interactions','i')[_0xc910('0x54')](_0xc910('0x55'),'c',_0xc910('0x56'))['left_join'](_0xc910('0x52'),'o',_0xc910('0x57'))['left_join'](_0xc910('0x58'),'a',_0xc910('0x59'))[_0xc910('0x54')](_0xc910('0x5a'),'me',_0xc910('0x5b'))[_0xc910('0x54')](_0xc910('0x5c'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xc910('0x54')]('tools_tags','t',_0xc910('0x5d'));var _0x316766=squel['expr']();var _0x567ba9=[];var _0x43e8ff=squel[_0xc910('0x5e')]();var _0x21f232;if(_0x5b1e5d['query'][_0xc910('0x5f')]){_0x21f232=as[_0xc910('0x60')](_0x5b1e5d['query'][_0xc910('0x5f')]);var _0x540c6f=_0x21f232[_0xc910('0x61')];for(var _0x51eac5=0x0;_0x51eac5<_0x21f232[_0xc910('0x62')][_0xc910('0x45')];_0x51eac5++){var _0xfdcbf4=_0x21f232[_0xc910('0x62')][_0x51eac5];var _0x1aed4a='i';var _0x4af38a=_['find'](_0x1296d7,[_0xc910('0x31'),_0xfdcbf4['field']]);if(!_0x4af38a){switch(_0xfdcbf4[_0xc910('0x4e')]){case'unreadMessages':if(_0xfdcbf4[_0xc910('0x63')]==0x1){_0x5b9548[_0xc910('0x64')]('`'+_0xfdcbf4[_0xc910('0x4e')]+_0xc910('0x65'));}else{_0x5b9548[_0xc910('0x64')]('`'+_0xfdcbf4[_0xc910('0x4e')]+_0xc910('0x66'));}break;case _0xc910('0x67'):if(_0xfdcbf4['operator']===_0xc910('0x68')){if(_0xfdcbf4[_0xc910('0x63')][_0xc910('0x38')]('\x20')['length']>0x1){_0x316766[_0x540c6f](_0xc910('0x69'),qs[_0xc910('0x6a')](_0xfdcbf4[_0xc910('0x63')]),null);}else{var _0x989ddc='%'+_0xfdcbf4[_0xc910('0x63')]+'%';_0x316766[_0x540c6f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x989ddc,_0x989ddc,_0x989ddc);}}else{_0x4af38a=_[_0xc910('0x6b')](_0x1296d7,[_0xc910('0x31'),_0xc910('0x6c')]);_0xfdcbf4['field']=_0xc910('0x6c');_0xe9555=as[_0xc910('0x6d')](_0x1aed4a,_0x4af38a[_0xc910('0x3d')],_0xfdcbf4);_0x316766[_0x540c6f](_0xe9555[_0xc910('0x6e')],_0xe9555['value'][_0xc910('0x6f')],_0xe9555[_0xc910('0x63')][_0xc910('0x22')]);}break;case _0xc910('0x70'):var _0x39c9b9=_0xfdcbf4[_0xc910('0x63')]['split'](',')[_0xc910('0x34')](function(_0x17257f){return Number(_0x17257f);});_0x39c9b9[_0xc910('0x71')](function(_0x290883){_0x43e8ff['or'](_0xc910('0x72'),'%,'+_0x290883+',%');});_0x567ba9=_[_0xc910('0x73')](_0x567ba9,_0x39c9b9);break;case _0xc910('0x74'):if(_0xfdcbf4[_0xc910('0x75')]===_0xc910('0x68')){_0x316766[_0x540c6f](_0xc910('0x76'),'%'+_0xfdcbf4['value']+'%',null);}else{_0x4af38a=_['find'](_0x1296d7,[_0xc910('0x31'),_0xc910('0x77')]);_0xfdcbf4[_0xc910('0x4e')]='UserId';_0xe9555=as[_0xc910('0x6d')](_0x1aed4a,_0x4af38a['type'],_0xfdcbf4);_0x316766[_0x540c6f](_0xe9555[_0xc910('0x6e')],_0xe9555[_0xc910('0x63')]['start'],_0xe9555[_0xc910('0x63')][_0xc910('0x22')]);}break;case'body':_0xe9555=as[_0xc910('0x6d')]('me',null,_0xfdcbf4);_0x316766[_0x540c6f](_0xe9555[_0xc910('0x6e')],_0xe9555[_0xc910('0x63')][_0xc910('0x6f')],_0xe9555[_0xc910('0x63')]['end']);break;}}else{var _0xe9555=as['buildExpression'](_0x1aed4a,_0x4af38a[_0xc910('0x3d')],_0xfdcbf4);_0x316766[_0x540c6f](_0xe9555['text'],_0xe9555['value'][_0xc910('0x6f')],_0xe9555['value']['end']);}}}else{var _0x48be87=_(_0x5b1e5d['query'])['keys']()[_0xc910('0x34')](function(_0x168152){return _['some'](_0x1296d7,['name',_0x168152])?_0x168152:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x48be87)){_0x48be87[_0xc910('0x71')](function(_0x3942e3){if(_0x3942e3===_0xc910('0x78')){_0x5b9548[_0xc910('0x79')]('i.FaxAccountId\x20IN\x20?',[][_0xc910('0x7a')](_0x5b1e5d[_0xc910('0x3f')][_0x3942e3]));}else if(_0x3942e3===_0xc910('0x7b')){var _0x3095f1=JSON['parse'](_0x5b1e5d[_0xc910('0x3f')][_0x3942e3])[_0xc910('0x7c')];var _0x5bbe21=JSON[_0xc910('0x7d')](_0x5b1e5d[_0xc910('0x3f')][_0x3942e3])[_0xc910('0x7e')];_0x5b9548[_0xc910('0x79')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3095f1,_0x5bbe21);}else{if(_0x5b1e5d['query'][_0x3942e3]===_0xc910('0x7f')){_0x5b9548['where']('i.'+_0x3942e3+'\x20IS\x20NULL');}else{_0x5b9548[_0xc910('0x79')]('i.'+_0x3942e3+_0xc910('0x80'),_0x5b1e5d[_0xc910('0x3f')][_0x3942e3]);}}});}if(_0x5b1e5d['query'][_0xc910('0x81')]){if(_0x5b1e5d[_0xc910('0x3f')][_0xc910('0x81')]==0x1){_0x5b9548[_0xc910('0x64')](_0xc910('0x82'));}else{_0x5b9548[_0xc910('0x64')](_0xc910('0x83'));}}if(_0x5b1e5d['query'][_0xc910('0x84')]){_0x567ba9=_[_0xc910('0x85')](_0x5b1e5d[_0xc910('0x3f')][_0xc910('0x84')])?_0x5b1e5d[_0xc910('0x3f')]['tag']:new Array(_0x5b1e5d['query']['tag']);_0x567ba9[_0xc910('0x71')](function(_0x19b74c){_0x43e8ff['or'](_0xc910('0x72'),'%,'+_0x19b74c+',%');});}if(_0x5b1e5d[_0xc910('0x3f')][_0xc910('0x86')]){var _0x4506b2=_0x5b1e5d[_0xc910('0x3f')][_0xc910('0x86')][_0xc910('0x87')]('\x5c','\x5c\x5c')[_0xc910('0x87')](/'/g,'\x27\x27');if(qs[_0xc910('0x88')](_0x4506b2)){_0x316766['or'](_0xc910('0x89'),_0x4506b2+'%')['or']('i.fax\x20LIKE\x20?',_0x4506b2+'%');}_0x316766['or'](_0xc910('0x8a'),_0x4506b2+'%');}}_0x5b9548[_0xc910('0x79')](_0x316766);_0x5b9548['group'](_0xc910('0x8b'));var _0x1e4a22={'type':db['Sequelize'][_0xc910('0x8c')]['SELECT'],'raw':!![]};var _0x25aeba=_0x5b9548['clone']();_0x25aeba['field'](_0xc910('0x8b'));_0x25aeba[_0xc910('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc910('0x8d'));if(_0x227dc5[_0xc910('0x8e')]){_0x227dc5[_0xc910('0x8e')]['forEach'](function(_0x1fab10){var _0x52b82b=_0x1fab10[0x0]===_0xc910('0x8f')?_0x1fab10[0x0]:'i.'+_0x1fab10[0x0];_0x5b9548[_0xc910('0x8e')](_0x52b82b,_0x1fab10[0x1]===_0xc910('0x90')?![]:!![]);});}if(!_[_0xc910('0x91')](_0x567ba9)){_0x5b9548[_0xc910('0x64')](_0x43e8ff);_0x25aeba[_0xc910('0x79')](_0xc910('0x92'),_0x567ba9);}BPromise['resolve']()[_0xc910('0x2d')](function(){if(!_0x21f232){if(_0x5b1e5d[_0xc910('0x3f')][_0xc910('0x78')])return;_0x25aeba['where'](_0xc910('0x93'));_0x5b9548[_0xc910('0x79')](_0xc910('0x93'));return;}if(_0x5b1e5d[_0xc910('0x94')][_0xc910('0x95')]!==_0xc910('0x96'))return;return _0x5b1e5d[_0xc910('0x94')][_0xc910('0x97')]({'attributes':['id'],'raw':!![]})[_0xc910('0x2d')](function(_0x4aad76){if(_[_0xc910('0x91')](_0x4aad76)){_0x25aeba[_0xc910('0x79')]('i.FaxAccountId\x20IS\x20NULL');_0x5b9548['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x25aeba[_0xc910('0x79')](_0xc910('0x98'),_[_0xc910('0x34')](_0x4aad76,'id'));_0x5b9548[_0xc910('0x79')]('i.FaxAccountId\x20IN\x20?',_[_0xc910('0x34')](_0x4aad76,'id'));}});})[_0xc910('0x2d')](function(){if(_0x5b1e5d[_0xc910('0x94')][_0xc910('0x95')]==='agent'&&!_0x21f232&&!_0x5b1e5d['query'][_0xc910('0x78')])return[];return db[_0xc910('0x99')]['query'](_0x25aeba[_0xc910('0x9a')](),_0x1e4a22);})[_0xc910('0x2d')](function(_0x3228f7){_0x31ad1c[_0xc910('0x27')]=_0x3228f7[_0xc910('0x45')];if(_0x31ad1c[_0xc910('0x27')]===0x0)return[];return db[_0xc910('0x99')][_0xc910('0x3f')](_0x25598a['toString'](),_0x1e4a22)[_0xc910('0x2d')](function(_0x48e7b3){_0x30c5cf=_[_0xc910('0x9b')](_0x48e7b3,'id');_0x1e4a22=_[_0xc910('0x9c')](_0x1e4a22,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b1e5d['query'][_0xc910('0x43')]){_0x227dc5[_0xc910('0x44')]['forEach'](function(_0x3cea1c){_0x5b9548[_0xc910('0x4e')]('i.'+_0x3cea1c);});}else{_0x5b9548[_0xc910('0x4e')](_0xc910('0x9d'),_0xc910('0x8d'));_0x5b9548['field'](_0xc910('0x9e'),'Account.key');_0x5b9548['field'](_0xc910('0x9f'),_0xc910('0xa0'));_0x5b9548['field'](_0xc910('0xa1'),_0xc910('0x8f'));_0x5b9548[_0xc910('0x4e')]('i.*');_0x5b9548[_0xc910('0x4e')](_0xc910('0xa2'),_0xc910('0xa3'));_0x5b9548[_0xc910('0x4e')](_0xc910('0xa4'),_0xc910('0xa5'));_0x5b9548[_0xc910('0x4e')](_0xc910('0xa6'),_0xc910('0xa7'));_0x5b9548['field']('c.phone',_0xc910('0xa8'));_0x5b9548[_0xc910('0x4e')](_0xc910('0xa9'),_0xc910('0xaa'));_0x5b9548[_0xc910('0x4e')](_0xc910('0xab'),_0xc910('0xac'));_0x5b9548[_0xc910('0x4e')]('o.fullname',_0xc910('0xad'));_0x5b9548['field']('o.internal',_0xc910('0xae'));_0x5b9548['field'](_0xc910('0xaf'),'TagIds');}if(_0x227dc5['limit'])_0x5b9548[_0xc910('0x26')](_0x227dc5[_0xc910('0x26')]);if(_0x227dc5['offset'])_0x5b9548[_0xc910('0x24')](_0x227dc5['offset']);return db[_0xc910('0x99')][_0xc910('0x3f')](_0x5b9548[_0xc910('0x9a')](),_0x1e4a22);})['then'](function(_0x974699){if(_0x974699[_0xc910('0x45')]>0x0)_0x4b5c72[_0xc910('0x79')](_0xc910('0xb0'),_[_0xc910('0x34')](_0x974699,'id'));return db[_0xc910('0x99')][_0xc910('0x3f')](_0x4b5c72[_0xc910('0x9a')](),_0x1e4a22)['then'](function(_0xcc2d95){var _0x548484=_[_0xc910('0xb1')](_0xcc2d95,_0xc910('0xb2'));var _0x70a960=[];_0x974699[_0xc910('0x71')](function(_0x3d086f){_0x70a960[_0xc910('0x39')](updateFaxInteraction(_0x3d086f,_0x30c5cf,_0x548484));});return BPromise[_0xc910('0xb3')](_0x70a960);});});})[_0xc910('0x2d')](function(_0x9946c8){_0x31ad1c[_0xc910('0xb4')]=_0x9946c8;return _0x31ad1c;})[_0xc910('0x2d')](respondWithFilteredResult(_0x270e36,_0x227dc5))['catch'](handleError(_0x270e36,null));};exports[_0xc910('0xb5')]=function(_0x1fe062,_0x4e3e2d){var _0x2499c4={'raw':![],'where':{'id':_0x1fe062[_0xc910('0xb6')]['id']}},_0x12aaa0={};_0x12aaa0[_0xc910('0x3e')]=_[_0xc910('0x40')](db[_0xc910('0x3a')]['rawAttributes']);_0x12aaa0[_0xc910('0x3f')]=_[_0xc910('0x40')](_0x1fe062[_0xc910('0x3f')]);_0x12aaa0['filters']=_[_0xc910('0x42')](_0x12aaa0['model'],_0x12aaa0[_0xc910('0x3f')]);_0x2499c4['attributes']=_[_0xc910('0x42')](_0x12aaa0[_0xc910('0x3e')],qs[_0xc910('0x43')](_0x1fe062['query']['fields']));_0x2499c4[_0xc910('0x44')]=_0x2499c4[_0xc910('0x44')]['length']?_0x2499c4[_0xc910('0x44')]:_0x12aaa0[_0xc910('0x3e')];if(_0x1fe062['query'][_0xc910('0xb7')]){_0x2499c4[_0xc910('0xb8')]=[{'all':!![]}];}_0x2499c4=_[_0xc910('0x9c')]({},_0x2499c4,_0x1fe062[_0xc910('0xb9')]);return db[_0xc910('0x3a')][_0xc910('0x6b')](_0x2499c4)[_0xc910('0x2d')](handleEntityNotFound(_0x4e3e2d,null))[_0xc910('0x2d')](respondWithResult(_0x4e3e2d,null))[_0xc910('0xba')](handleError(_0x4e3e2d,null));};exports[_0xc910('0xbb')]=function(_0x595fdb,_0x2b13ac){return db[_0xc910('0x3a')]['create'](_0x595fdb[_0xc910('0xbc')],{})[_0xc910('0x2d')](respondWithResult(_0x2b13ac,0xc9))[_0xc910('0xba')](handleError(_0x2b13ac,null));};exports[_0xc910('0x2c')]=function(_0x8bc62b,_0x9e39a){if(_0x8bc62b[_0xc910('0xbc')]['id']){delete _0x8bc62b[_0xc910('0xbc')]['id'];}return db[_0xc910('0x3a')][_0xc910('0x6b')]({'where':{'id':_0x8bc62b[_0xc910('0xb6')]['id']}})[_0xc910('0x2d')](handleEntityNotFound(_0x9e39a,null))[_0xc910('0x2d')](saveUpdates(_0x8bc62b[_0xc910('0xbc')],null))['then'](respondWithResult(_0x9e39a,null))[_0xc910('0xba')](handleError(_0x9e39a,null));};exports['destroy']=function(_0x117364,_0x251350){return db[_0xc910('0x3a')][_0xc910('0x6b')]({'where':{'id':_0x117364[_0xc910('0xb6')]['id']}})[_0xc910('0x2d')](handleEntityNotFound(_0x251350,null))['then'](removeEntity(_0x251350,null))[_0xc910('0xba')](handleError(_0x251350,null));};exports[_0xc910('0xbd')]=function(_0x4d87fc,_0x1a95ae){return db[_0xc910('0x3a')][_0xc910('0xbd')]()['then'](respondWithResult(_0x1a95ae,null))['catch'](handleError(_0x1a95ae,null));};exports[_0xc910('0xbe')]=function(_0x4afded,_0x4000ec,_0x2ca3f1){return db[_0xc910('0xbf')]['find']({'where':{'id':_0x4afded['params']['id']}})[_0xc910('0x2d')](handleEntityNotFound(_0x4000ec,null))[_0xc910('0x2d')](function(_0x1c45d6){if(_0x1c45d6){return _0x1c45d6[_0xc910('0xbe')](_0x4afded['body'][_0xc910('0xc0')],_['omit'](_0x4afded['body'],['ids','id'])||{});}})[_0xc910('0x2d')](respondWithResult(_0x4000ec,null))[_0xc910('0xba')](handleError(_0x4000ec,null));};exports[_0xc910('0xc1')]=function(_0x1d4334,_0x47d088,_0x12425c){var _0x670bc8={'raw':![],'where':{}};var _0x398cc9={};var _0x3a9ee6={'count':0x0,'rows':[]};return db[_0xc910('0x3a')][_0xc910('0xc2')]({'where':{'id':_0x1d4334[_0xc910('0xb6')]['id']}})['then'](handleEntityNotFound(_0x47d088,null))['then'](function(_0x226be2){if(_0x226be2){_0x398cc9[_0xc910('0x3e')]=_[_0xc910('0x40')](db['FaxMessage']['rawAttributes']);_0x398cc9['query']=_[_0xc910('0x40')](_0x1d4334[_0xc910('0x3f')]);_0x398cc9[_0xc910('0x41')]=_[_0xc910('0x42')](_0x398cc9['model'],_0x398cc9[_0xc910('0x3f')]);_0x670bc8[_0xc910('0x44')]=_[_0xc910('0x42')](_0x398cc9[_0xc910('0x3e')],qs[_0xc910('0x43')](_0x1d4334[_0xc910('0x3f')][_0xc910('0x43')]));_0x670bc8[_0xc910('0x44')]=_0x670bc8[_0xc910('0x44')][_0xc910('0x45')]?_0x670bc8['attributes']:_0x398cc9['model'];if(!_0x1d4334['query'][_0xc910('0x46')](_0xc910('0xc3'))){_0x670bc8['limit']=qs[_0xc910('0x26')](_0x1d4334[_0xc910('0x3f')][_0xc910('0x26')]);_0x670bc8[_0xc910('0x24')]=qs['offset'](_0x1d4334[_0xc910('0x3f')][_0xc910('0x24')]);}_0x670bc8[_0xc910('0x8e')]=qs['sort'](_0x1d4334['query'][_0xc910('0x47')]);_0x670bc8[_0xc910('0x79')]=qs[_0xc910('0x41')](_[_0xc910('0x48')](_0x1d4334[_0xc910('0x3f')],_0x398cc9[_0xc910('0x41')]));_0x670bc8[_0xc910('0x79')][_0xc910('0xb2')]=_0x226be2['id'];if(_0x1d4334['query']['filter']){_0x670bc8[_0xc910('0x79')]=_[_0xc910('0x9c')](_0x670bc8[_0xc910('0x79')],{'$or':_['map'](_0x670bc8[_0xc910('0x44')],function(_0x497d6f){var _0x5a52fe={};_0x5a52fe[_0x497d6f]={'$like':'%'+_0x1d4334['query'][_0xc910('0x86')]+'%'};return _0x5a52fe;})});}if(_0x1d4334[_0xc910('0x3f')][_0xc910('0x7c')]){var _0x1e20a3=_0x1d4334[_0xc910('0x3f')][_0xc910('0x7c')][_0xc910('0x38')](',');var _0x4a1330={};_0x4a1330[_0x1e20a3[0x0]]={'$gte':moment(_0x1e20a3[0x1])[_0xc910('0xc4')](_0xc910('0xc5'))};_0x670bc8[_0xc910('0x79')]=_[_0xc910('0x9c')](_0x670bc8['where'],_0x4a1330);}_0x670bc8=_['merge']({},_0x670bc8,_0x1d4334[_0xc910('0xb9')]);return db[_0xc910('0xbf')][_0xc910('0x27')]({'where':_0x670bc8['where']})[_0xc910('0x2d')](function(_0x87be06){_0x3a9ee6[_0xc910('0x27')]=_0x87be06;if(_0x1d4334['query'][_0xc910('0xb7')]){_0x670bc8['include']=[{'all':!![]}];}return db[_0xc910('0xbf')][_0xc910('0xc6')](_0x670bc8);})['then'](function(_0x2a14a2){_0x3a9ee6[_0xc910('0xb4')]=_0x2a14a2;return _0x3a9ee6;});}})[_0xc910('0x2d')](respondWithFilteredResult(_0x47d088,_0x670bc8))[_0xc910('0xba')](handleError(_0x47d088,null));};exports[_0xc910('0xc7')]=function(_0x43eb28,_0x1cc222,_0x53a080){return db[_0xc910('0x3a')][_0xc910('0x6b')]({'where':{'id':_0x43eb28[_0xc910('0xb6')]['id']}})[_0xc910('0x2d')](handleEntityNotFound(_0x1cc222,null))[_0xc910('0x2d')](function(_0x45c2a0){if(_0x45c2a0){return _0x45c2a0[_0xc910('0xc8')](_0x43eb28[_0xc910('0xbc')][_0xc910('0xc0')],_[_0xc910('0xc9')](_0x43eb28[_0xc910('0xbc')],[_0xc910('0xc0'),'id'])||{})['spread'](function(){return db[_0xc910('0x70')]['findAll']({'attributes':['id',_0xc910('0x31'),_0xc910('0x49')],'where':{'id':_0x43eb28[_0xc910('0xbc')]['ids']}});})[_0xc910('0x2d')](function(_0x52cc26){socket[_0xc910('0xca')](_0xc910('0xcb'),{'id':Number(_0x43eb28[_0xc910('0xb6')]['id']),'tags':_0x52cc26||[]});return{'id':Number(_0x43eb28[_0xc910('0xb6')]['id']),'tags':_0x52cc26||[]};});}})['then'](respondWithResult(_0x1cc222,null))[_0xc910('0xba')](handleError(_0x1cc222,null));};exports[_0xc910('0xcc')]=function(_0x4b16ce,_0x3f4dea,_0x3fc321){return db[_0xc910('0x3a')][_0xc910('0x6b')]({'where':{'id':_0x4b16ce['params']['id']}})[_0xc910('0x2d')](handleEntityNotFound(_0x3f4dea,null))[_0xc910('0x2d')](function(_0x149d56){if(_0x149d56){return _0x149d56[_0xc910('0xcc')](_0x4b16ce['query'][_0xc910('0xc0')]);}})[_0xc910('0x2d')](respondWithStatusCode(_0x3f4dea,null))[_0xc910('0xba')](handleError(_0x3f4dea,null));};exports[_0xc910('0xcd')]=function(_0x5ec201,_0x163a46){var _0x2aa8cd=moment()[_0xc910('0xce')]()[_0xc910('0x9a')]();var _0x1c1a46=path[_0xc910('0xcf')](config[_0xc910('0xd0')],_0xc910('0xd1'),'files',_0xc910('0xd2'));var _0x46ef96=path[_0xc910('0xcf')](config[_0xc910('0xd0')],_0xc910('0xd1'),_0xc910('0xd3'),_0xc910('0xd4'));var _0x52902e=path[_0xc910('0xcf')](_0x1c1a46,_0x2aa8cd);var _0x4f8baa=util[_0xc910('0xc4')](_0xc910('0xd5'),_0x5ec201[_0xc910('0xb6')]['id'],_0x2aa8cd);var _0x27d51d=path[_0xc910('0xcf')](_0x1c1a46,_0x4f8baa);var _0x249937=[];_0x249937[_0xc910('0x39')]({'model':db['Attachment'],'as':_0xc910('0xd6'),'raw':!![]});var _0x1985f8=[{'model':db[_0xc910('0xbf')],'as':'Messages','attributes':['id',_0xc910('0xbc'),'createdAt'],'include':_0x249937}];return db[_0xc910('0x3a')][_0xc910('0x6b')]({'where':{'id':_0x5ec201[_0xc910('0xb6')]['id']},'include':_0x1985f8})[_0xc910('0x2d')](handleEntityNotFound(_0x163a46,null))['then'](function(_0x5d026e){if(_0x5d026e&&_0x5d026e['Messages']){var _0x2cffcc=_0x5d026e['get']({'plain':!![]});fs[_0xc910('0xd7')](_0x52902e);for(var _0xa1bfe3=0x0;_0xa1bfe3<_0x2cffcc[_0xc910('0xd8')][_0xc910('0x45')];_0xa1bfe3++){var _0x21454b=_0x2cffcc['Messages'][_0xa1bfe3][_0xc910('0xd6')];if(_0x21454b){var _0x1eff75=path[_0xc910('0xcf')](_0x46ef96,_0x21454b[_0xc910('0xd9')]);if(fs['existsSync'](_0x1eff75)){fs[_0xc910('0xda')](_0x1eff75)[_0xc910('0xdb')](fs[_0xc910('0xdc')](path[_0xc910('0xcf')](_0x52902e,_0x21454b['basename'])));}}}return BPromise[_0xc910('0xdd')]()[_0xc910('0x2d')](function(){return new BPromise(function(_0x3132ba,_0x4fe215){zipdir(_0x52902e,{'saveTo':_0x27d51d},function(_0x41b63d,_0x31a53a){if(_0x41b63d)return _0x4fe215(_0x41b63d);return _0x3132ba(_0x31a53a);});})[_0xc910('0x2d')](function(){return new BPromise(function(_0x43a9cc,_0x335769){rimraf(_0x52902e,function(_0x38d798){if(_0x38d798)_0x335769(_0x38d798);return _0x43a9cc();});});})['then'](function(){return _0x163a46['download'](_0x27d51d,_0x4f8baa,function(_0x5673cb){if(_0x5673cb){console[_0xc910('0xde')]('err',_0x5673cb);}else{fs[_0xc910('0xdf')](_0x27d51d);}});});});}else{return _0x163a46[_0xc910('0x2f')](0xc8);}})[_0xc910('0xba')](handleError(_0x163a46,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 8dde2ff..eecc828 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 _0xe466=['exports','events','../../mysqldb','FaxInteraction','update','remove','getUsers','then','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0xe466,0x178));var _0x6e46=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xe466[_0x4a747d];return _0x3a5b5c;};'use strict';var EventEmitter=require(_0x6e46('0x0'));var FaxInteraction=require(_0x6e46('0x1'))['db'][_0x6e46('0x2')];var FaxMessage=require(_0x6e46('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6e46('0x3'),'afterDestroy':_0x6e46('0x4')};function emitEvent(_0x21987e){return function(_0x513cd9,_0x5578d3,_0x191969){_0x513cd9[_0x6e46('0x5')]({'attributes':['id'],'raw':!![]})[_0x6e46('0x6')](function(_0x219da6){_0x513cd9['setDataValue'](_0x6e46('0x7'),_0x219da6[_0x6e46('0x8')](function(_0xe58788){return{'id':_0xe58788['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x513cd9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6e46('0x6')](function(_0x2d5c2c){_0x513cd9['setDataValue'](_0x6e46('0x9'),_0x2d5c2c[_0x6e46('0xa')]);FaxInteractionEvents[_0x6e46('0xb')](_0x21987e+':'+_0x513cd9['id'],_0x513cd9);FaxInteractionEvents['emit'](_0x21987e,_0x513cd9);_0x191969(null);})[_0x6e46('0xc')](_0x191969(null));};}for(var e in events){if(events[_0x6e46('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x6e46('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x3df6=['emit','catch','hasOwnProperty','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x3df6,0x1ac));var _0x63df=function(_0x2579ce,_0x28330e){_0x2579ce=_0x2579ce-0x0;var _0x1b02f7=_0x3df6[_0x2579ce];return _0x1b02f7;};'use strict';var EventEmitter=require(_0x63df('0x0'));var FaxInteraction=require(_0x63df('0x1'))['db'][_0x63df('0x2')];var FaxMessage=require(_0x63df('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x63df('0x3')](0x0);var events={'afterCreate':_0x63df('0x4'),'afterUpdate':_0x63df('0x5'),'afterDestroy':_0x63df('0x6')};function emitEvent(_0x75b061){return function(_0x2757be,_0x1390d8,_0x186641){_0x2757be[_0x63df('0x7')]({'attributes':['id'],'raw':!![]})[_0x63df('0x8')](function(_0x27a80f){_0x2757be[_0x63df('0x9')](_0x63df('0xa'),_0x27a80f[_0x63df('0xb')](function(_0x4f8ba){return{'id':_0x4f8ba['id']};}));return FaxMessage[_0x63df('0xc')]({'where':{'FaxInteractionId':_0x2757be['id'],'direction':'in','read':![]},'raw':!![]});})[_0x63df('0x8')](function(_0x12ee79){_0x2757be[_0x63df('0x9')](_0x63df('0xd'),_0x12ee79['length']);FaxInteractionEvents[_0x63df('0xe')](_0x75b061+':'+_0x2757be['id'],_0x2757be);FaxInteractionEvents[_0x63df('0xe')](_0x75b061,_0x2757be);_0x186641(null);})[_0x63df('0xf')](_0x186641(null));};}for(var e in events){if(events[_0x63df('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index a5b326a..005d23f 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 _0x842c=['api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x842c,0x1de));var _0xc842=function(_0x4925ea,_0x57dc16){_0x4925ea=_0x4925ea-0x0;var _0x4d7f04=_0x842c[_0x4925ea];return _0x4d7f04;};'use strict';var _=require(_0xc842('0x0'));var util=require(_0xc842('0x1'));var logger=require('../../config/logger')(_0xc842('0x2'));var moment=require(_0xc842('0x3'));var BPromise=require(_0xc842('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc842('0x5'));var rimraf=require(_0xc842('0x6'));var config=require(_0xc842('0x7'));var attributes=require(_0xc842('0x8'));module['exports']=function(_0x2b24da,_0x5c88a2){return _0x2b24da[_0xc842('0x9')](_0xc842('0xa'),attributes,{'tableName':_0xc842('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9e4021,_0x5b3a61,_0x5a87e5){if(_0x9e4021[_0xc842('0xc')]('closed')){_0x9e4021[_0xc842('0xd')]=moment()[_0xc842('0xe')](_0xc842('0xf'));}_0x5a87e5(null,_0x9e4021);}}});}; \ No newline at end of file +var _0x873e=['moment','../../config/environment','./faxInteraction.attributes','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x5a0f1a,_0x4e3c73){var _0x127285=function(_0x2b2033){while(--_0x2b2033){_0x5a0f1a['push'](_0x5a0f1a['shift']());}};_0x127285(++_0x4e3c73);}(_0x873e,0x141));var _0xe873=function(_0x703a6,_0x34911f){_0x703a6=_0x703a6-0x0;var _0x41d592=_0x873e[_0x703a6];return _0x41d592;};'use strict';var _=require(_0xe873('0x0'));var util=require(_0xe873('0x1'));var logger=require(_0xe873('0x2'))(_0xe873('0x3'));var moment=require(_0xe873('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe873('0x5'));var attributes=require(_0xe873('0x6'));module['exports']=function(_0x3f6c72,_0x3e461c){return _0x3f6c72['define'](_0xe873('0x7'),attributes,{'tableName':_0xe873('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x440748,_0x56d55a,_0x456ce5){if(_0x440748[_0xe873('0x9')](_0xe873('0xa'))){_0x440748['closedAt']=moment()[_0xe873('0xb')](_0xe873('0xc'));}_0x456ce5(null,_0x440748);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8b2e8ad..2694837 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 _0x5fc7=['defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','then','AddTagsToFaxInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x1e8d10,_0x84f524){var _0x44e78d=function(_0x311087){while(--_0x311087){_0x1e8d10['push'](_0x1e8d10['shift']());}};_0x44e78d(++_0x84f524);}(_0x5fc7,0x184));var _0x75fc=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x5fc7[_0x58a4ac];return _0x545810;};'use strict';var _=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var moment=require(_0x75fc('0x2'));var BPromise=require(_0x75fc('0x3'));var rs=require(_0x75fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75fc('0x5'))['db'];var utils=require(_0x75fc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x75fc('0x7'));var jayson=require(_0x75fc('0x8'));var client=jayson[_0x75fc('0x9')][_0x75fc('0xa')]({'port':0x232a});config[_0x75fc('0xb')]=_[_0x75fc('0xc')](config[_0x75fc('0xb')],{'host':_0x75fc('0xd'),'port':0x18eb});var socket=require(_0x75fc('0xe'))(new Redis(config[_0x75fc('0xb')]));require(_0x75fc('0xf'))['register'](socket);function respondWithRpcPromise(_0x124de3,_0x11629c,_0xdc8862){return new BPromise(function(_0x4feda4,_0x35c786){return client[_0x75fc('0x10')](_0x124de3,_0xdc8862)['then'](function(_0x28ff02){logger[_0x75fc('0x11')](_0x75fc('0x12'),_0x11629c,_0x75fc('0x13'));logger[_0x75fc('0x14')](_0x75fc('0x15'),_0x11629c,_0x75fc('0x13'),JSON[_0x75fc('0x16')](_0x28ff02));if(_0x28ff02[_0x75fc('0x17')]){if(_0x28ff02[_0x75fc('0x17')][_0x75fc('0x18')]===0x1f4){logger['error'](_0x75fc('0x12'),_0x11629c,_0x28ff02[_0x75fc('0x17')][_0x75fc('0x19')]);return _0x35c786(_0x28ff02[_0x75fc('0x17')][_0x75fc('0x19')]);}logger['error'](_0x75fc('0x12'),_0x11629c,_0x28ff02[_0x75fc('0x17')][_0x75fc('0x19')]);return _0x4feda4(_0x28ff02[_0x75fc('0x17')]['message']);}else{logger[_0x75fc('0x11')](_0x75fc('0x12'),_0x11629c,_0x75fc('0x13'));_0x4feda4(_0x28ff02[_0x75fc('0x1a')][_0x75fc('0x19')]);}})[_0x75fc('0x1b')](function(_0x26673c){logger[_0x75fc('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x11629c,_0x26673c);_0x35c786(_0x26673c);});});}exports[_0x75fc('0x1c')]=function(_0x3e5a9a){var _0x31e186=this;return new Promise(function(_0x55771b,_0x1f1cc5){return db[_0x75fc('0x1d')]['update'](_0x3e5a9a[_0x75fc('0x1e')],{'raw':_0x3e5a9a[_0x75fc('0x1f')]?_0x3e5a9a[_0x75fc('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e5a9a[_0x75fc('0x1f')]?_0x3e5a9a[_0x75fc('0x1f')][_0x75fc('0x20')]||null:null,'attributes':_0x3e5a9a[_0x75fc('0x1f')]?_0x3e5a9a[_0x75fc('0x1f')][_0x75fc('0x21')]||null:null,'limit':_0x3e5a9a['options']?_0x3e5a9a[_0x75fc('0x1f')]['limit']||null:null})[_0x75fc('0x22')](function(_0x261872){logger['info'](_0x75fc('0x1c'),_0x3e5a9a);logger['debug'](_0x75fc('0x1c'),_0x3e5a9a,JSON['stringify'](_0x261872));_0x55771b(_0x261872);})[_0x75fc('0x1b')](function(_0x4fbfc8){logger[_0x75fc('0x17')](_0x75fc('0x1c'),_0x4fbfc8['message'],_0x3e5a9a);_0x1f1cc5(_0x31e186[_0x75fc('0x17')](0x1f4,_0x4fbfc8[_0x75fc('0x19')]));});});};exports[_0x75fc('0x23')]=function(_0x33f625){return new Promise(function(_0xc953ce,_0x43069f){return db[_0x75fc('0x1d')][_0x75fc('0x24')]({'where':_0x33f625[_0x75fc('0x1f')]?_0x33f625[_0x75fc('0x1f')][_0x75fc('0x20')]||null:null})['then'](function(_0x31d670){if(_0x31d670){return _0x31d670['addTags'](_0x33f625[_0x75fc('0x1e')][_0x75fc('0x25')],_[_0x75fc('0x26')](_0x33f625[_0x75fc('0x1e')],[_0x75fc('0x25'),'id'])||{});}})['spread'](function(_0x4828e6){logger['info'](_0x75fc('0x27'),_0x33f625);logger['debug']('AddTags',_0x33f625,JSON['stringify'](_0x4828e6));_0xc953ce(_0x4828e6);})[_0x75fc('0x1b')](function(_0x3fbae3){logger[_0x75fc('0x17')]('AddTags',_0x3fbae3[_0x75fc('0x19')],_0x33f625);_0x43069f(_this[_0x75fc('0x17')](0x1f4,_0x3fbae3[_0x75fc('0x19')]));});});}; \ No newline at end of file +var _0x574b=['./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1ad1d6,_0x44126f){var _0x1379f9=function(_0x196e2b){while(--_0x196e2b){_0x1ad1d6['push'](_0x1ad1d6['shift']());}};_0x1379f9(++_0x44126f);}(_0x574b,0xf8));var _0xb574=function(_0x49153d,_0x683ead){_0x49153d=_0x49153d-0x0;var _0x4f1fec=_0x574b[_0x49153d];return _0x4f1fec;};'use strict';var _=require(_0xb574('0x0'));var util=require(_0xb574('0x1'));var moment=require(_0xb574('0x2'));var BPromise=require('bluebird');var rs=require(_0xb574('0x3'));var fs=require('fs');var Redis=require(_0xb574('0x4'));var db=require(_0xb574('0x5'))['db'];var utils=require(_0xb574('0x6'));var logger=require(_0xb574('0x7'))(_0xb574('0x8'));var config=require(_0xb574('0x9'));var jayson=require(_0xb574('0xa'));var client=jayson['client'][_0xb574('0xb')]({'port':0x232a});config[_0xb574('0xc')]=_[_0xb574('0xd')](config[_0xb574('0xc')],{'host':_0xb574('0xe'),'port':0x18eb});var socket=require(_0xb574('0xf'))(new Redis(config['redis']));require(_0xb574('0x10'))[_0xb574('0x11')](socket);function respondWithRpcPromise(_0x13152f,_0x4582b2,_0x2b872f){return new BPromise(function(_0x44185d,_0xf57f79){return client['request'](_0x13152f,_0x2b872f)[_0xb574('0x12')](function(_0x146b4a){logger[_0xb574('0x13')](_0xb574('0x14'),_0x4582b2,_0xb574('0x15'));logger[_0xb574('0x16')](_0xb574('0x17'),_0x4582b2,_0xb574('0x15'),JSON[_0xb574('0x18')](_0x146b4a));if(_0x146b4a[_0xb574('0x19')]){if(_0x146b4a[_0xb574('0x19')][_0xb574('0x1a')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x4582b2,_0x146b4a[_0xb574('0x19')][_0xb574('0x1b')]);return _0xf57f79(_0x146b4a['error'][_0xb574('0x1b')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x4582b2,_0x146b4a['error'][_0xb574('0x1b')]);return _0x44185d(_0x146b4a[_0xb574('0x19')][_0xb574('0x1b')]);}else{logger[_0xb574('0x13')](_0xb574('0x14'),_0x4582b2,_0xb574('0x15'));_0x44185d(_0x146b4a[_0xb574('0x1c')][_0xb574('0x1b')]);}})[_0xb574('0x1d')](function(_0x4a868a){logger[_0xb574('0x19')](_0xb574('0x14'),_0x4582b2,_0x4a868a);_0xf57f79(_0x4a868a);});});}exports[_0xb574('0x1e')]=function(_0x4f9dcc){var _0x57bdeb=this;return new Promise(function(_0x2d3ee5,_0x434fb2){return db[_0xb574('0x1f')]['update'](_0x4f9dcc[_0xb574('0x20')],{'raw':_0x4f9dcc['options']?_0x4f9dcc[_0xb574('0x21')][_0xb574('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f9dcc['options']?_0x4f9dcc[_0xb574('0x21')][_0xb574('0x23')]||null:null,'attributes':_0x4f9dcc[_0xb574('0x21')]?_0x4f9dcc[_0xb574('0x21')][_0xb574('0x24')]||null:null,'limit':_0x4f9dcc[_0xb574('0x21')]?_0x4f9dcc[_0xb574('0x21')]['limit']||null:null})['then'](function(_0x55cc9e){logger['info'](_0xb574('0x1e'),_0x4f9dcc);logger[_0xb574('0x16')]('UpdateFaxInteraction',_0x4f9dcc,JSON[_0xb574('0x18')](_0x55cc9e));_0x2d3ee5(_0x55cc9e);})[_0xb574('0x1d')](function(_0x48a7b2){logger['error'](_0xb574('0x1e'),_0x48a7b2[_0xb574('0x1b')],_0x4f9dcc);_0x434fb2(_0x57bdeb[_0xb574('0x19')](0x1f4,_0x48a7b2['message']));});});};exports[_0xb574('0x25')]=function(_0x2622ba){return new Promise(function(_0x51cded,_0xc36078){return db[_0xb574('0x1f')][_0xb574('0x26')]({'where':_0x2622ba[_0xb574('0x21')]?_0x2622ba['options'][_0xb574('0x23')]||null:null})[_0xb574('0x12')](function(_0x538e16){if(_0x538e16){return _0x538e16[_0xb574('0x27')](_0x2622ba[_0xb574('0x20')][_0xb574('0x28')],_[_0xb574('0x29')](_0x2622ba[_0xb574('0x20')],[_0xb574('0x28'),'id'])||{});}})[_0xb574('0x2a')](function(_0x134ac8){logger['info'](_0xb574('0x2b'),_0x2622ba);logger[_0xb574('0x16')]('AddTags',_0x2622ba,JSON[_0xb574('0x18')](_0x134ac8));_0x51cded(_0x134ac8);})[_0xb574('0x1d')](function(_0x334422){logger[_0xb574('0x19')]('AddTags',_0x334422[_0xb574('0x1b')],_0x2622ba);_0xc36078(_this[_0xb574('0x19')](0x1f4,_0x334422[_0xb574('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 69cb8b9..0456ee9 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 _0x8ce3=['update','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0x8ce3,0x175));var _0x38ce=function(_0x31db2b,_0xb218b7){_0x31db2b=_0x31db2b-0x0;var _0x1459a0=_0x8ce3[_0x31db2b];return _0x1459a0;};'use strict';var FaxInteractionEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),_0x38ce('0x2'),_0x38ce('0x3')];function createListener(_0x3b78fd,_0x23a9b3){return function(_0x2b7f1a){_0x23a9b3['emit'](_0x3b78fd,_0x2b7f1a);};}function removeListener(_0x1b702e,_0x28b358){return function(){FaxInteractionEvents[_0x38ce('0x4')](_0x1b702e,_0x28b358);};}exports[_0x38ce('0x5')]=function(_0x3fdaf4){for(var _0x569904=0x0,_0x33753c=events[_0x38ce('0x6')];_0x569904<_0x33753c;_0x569904++){var _0x346e16=events[_0x569904];var _0x520564=createListener(_0x38ce('0x7')+_0x346e16,_0x3fdaf4);FaxInteractionEvents['on'](_0x346e16,_0x520564);}}; \ No newline at end of file +var _0x202c=['remove','update','emit','removeListener','register','faxInteraction:','./faxInteraction.events','save'];(function(_0x9e6704,_0x40737e){var _0x3e1f96=function(_0x5cdcdf){while(--_0x5cdcdf){_0x9e6704['push'](_0x9e6704['shift']());}};_0x3e1f96(++_0x40737e);}(_0x202c,0xbe));var _0xc202=function(_0x4f9c08,_0x4d83df){_0x4f9c08=_0x4f9c08-0x0;var _0x4da7e5=_0x202c[_0x4f9c08];return _0x4da7e5;};'use strict';var FaxInteractionEvents=require(_0xc202('0x0'));var events=[_0xc202('0x1'),_0xc202('0x2'),_0xc202('0x3')];function createListener(_0x4e4102,_0x1e9b0c){return function(_0x1d1ce2){_0x1e9b0c[_0xc202('0x4')](_0x4e4102,_0x1d1ce2);};}function removeListener(_0x346cac,_0x58ae96){return function(){FaxInteractionEvents[_0xc202('0x5')](_0x346cac,_0x58ae96);};}exports[_0xc202('0x6')]=function(_0x22773c){for(var _0x366ce3=0x0,_0x216582=events['length'];_0x366ce3<_0x216582;_0x366ce3++){var _0x10d11d=events[_0x366ce3];var _0x2b8ba3=createListener(_0xc202('0x7')+_0x10d11d,_0x22773c);FaxInteractionEvents['on'](_0x10d11d,_0x2b8ba3);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index fc48dbe..ec3fb15 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 _0x3320=['update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getMessages','/:id/download','post','/:id/messages','addMessage','tracked','fax','addTags','put','faxinteraction:update'];(function(_0x3b5a46,_0x19a51f){var _0x33f804=function(_0x12c892){while(--_0x12c892){_0x3b5a46['push'](_0x3b5a46['shift']());}};_0x33f804(++_0x19a51f);}(_0x3320,0x13c));var _0x0332=function(_0xdd9156,_0x4dfe7b){_0xdd9156=_0xdd9156-0x0;var _0x1f57ec=_0x3320[_0xdd9156];return _0x1f57ec;};'use strict';var multer=require('multer');var util=require(_0x0332('0x0'));var path=require(_0x0332('0x1'));var timeout=require('connect-timeout');var express=require(_0x0332('0x2'));var router=express[_0x0332('0x3')]();var fs_extra=require(_0x0332('0x4'));var auth=require(_0x0332('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0332('0x6'));var controller=require(_0x0332('0x7'));router[_0x0332('0x8')]('/',auth['isAuthenticated'](),controller[_0x0332('0x9')]);router[_0x0332('0x8')](_0x0332('0xa'),auth['isAuthenticated'](),controller[_0x0332('0xb')]);router[_0x0332('0x8')](_0x0332('0xc'),auth[_0x0332('0xd')](),controller[_0x0332('0xe')]);router[_0x0332('0x8')]('/:id/messages',auth[_0x0332('0xd')](),controller[_0x0332('0xf')]);router['get'](_0x0332('0x10'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x0332('0xd')](),controller['create']);router[_0x0332('0x11')](_0x0332('0x12'),auth[_0x0332('0xd')](),controller[_0x0332('0x13')]);router[_0x0332('0x11')]('/:id/tags',auth[_0x0332('0xd')](),interaction[_0x0332('0x14')](_0x0332('0x15'),'faxinteraction:addtags'),controller[_0x0332('0x16')]);router[_0x0332('0x17')](_0x0332('0xc'),auth[_0x0332('0xd')](),interaction['tracked'](_0x0332('0x15'),_0x0332('0x18')),controller[_0x0332('0x19')]);router[_0x0332('0x1a')](_0x0332('0xc'),auth[_0x0332('0xd')](),interaction[_0x0332('0x14')](_0x0332('0x15'),_0x0332('0x1b')),controller[_0x0332('0x1c')]);router[_0x0332('0x1a')]('/:id/tags',auth[_0x0332('0xd')](),controller[_0x0332('0x1d')]);module[_0x0332('0x1e')]=router; \ No newline at end of file +var _0xc599=['update','faxinteraction:destroy','destroy','delete','removeTags','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put'];(function(_0x10f315,_0xc435f2){var _0x30250d=function(_0x1a16f4){while(--_0x1a16f4){_0x10f315['push'](_0x10f315['shift']());}};_0x30250d(++_0xc435f2);}(_0xc599,0x71));var _0x9c59=function(_0x126bcd,_0x4a1c06){_0x126bcd=_0x126bcd-0x0;var _0x488a50=_0xc599[_0x126bcd];return _0x488a50;};'use strict';var multer=require(_0x9c59('0x0'));var util=require('util');var path=require(_0x9c59('0x1'));var timeout=require(_0x9c59('0x2'));var express=require('express');var router=express[_0x9c59('0x3')]();var fs_extra=require(_0x9c59('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9c59('0x5'));var controller=require(_0x9c59('0x6'));router[_0x9c59('0x7')]('/',auth[_0x9c59('0x8')](),controller[_0x9c59('0x9')]);router[_0x9c59('0x7')](_0x9c59('0xa'),auth[_0x9c59('0x8')](),controller[_0x9c59('0xb')]);router[_0x9c59('0x7')](_0x9c59('0xc'),auth[_0x9c59('0x8')](),controller['show']);router[_0x9c59('0x7')]('/:id/messages',auth[_0x9c59('0x8')](),controller[_0x9c59('0xd')]);router[_0x9c59('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x9c59('0xe')]('/',auth[_0x9c59('0x8')](),controller['create']);router[_0x9c59('0xe')]('/:id/messages',auth['isAuthenticated'](),controller[_0x9c59('0xf')]);router[_0x9c59('0xe')](_0x9c59('0x10'),auth['isAuthenticated'](),interaction[_0x9c59('0x11')](_0x9c59('0x12'),_0x9c59('0x13')),controller[_0x9c59('0x14')]);router[_0x9c59('0x15')](_0x9c59('0xc'),auth[_0x9c59('0x8')](),interaction[_0x9c59('0x11')](_0x9c59('0x12'),'faxinteraction:update'),controller[_0x9c59('0x16')]);router['delete'](_0x9c59('0xc'),auth[_0x9c59('0x8')](),interaction['tracked']('fax',_0x9c59('0x17')),controller[_0x9c59('0x18')]);router[_0x9c59('0x19')]('/:id/tags',auth[_0x9c59('0x8')](),controller[_0x9c59('0x1a')]);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 52f33e3..0a0ca98 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 _0xadb8=['BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xadb8,0x1d0));var _0x8adb=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xadb8[_0x1e03a6];return _0x295b64;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x8adb('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8adb('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8adb('0x2')]('in',_0x8adb('0x3')),'defaultValue':_0x8adb('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8adb('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8adb('0x4')]}}; \ No newline at end of file +var _0x8d0e=['ENUM','out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x10f328,_0x464bc1){var _0x44dff1=function(_0x253ee5){while(--_0x253ee5){_0x10f328['push'](_0x10f328['shift']());}};_0x44dff1(++_0x464bc1);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4e7426,_0x4061da){_0x4e7426=_0x4e7426-0x0;var _0x4f6096=_0x8d0e[_0x4e7426];return _0x4f6096;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'body':{'type':Sequelize[_0xe8d0('0x2')](_0xe8d0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe8d0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe8d0('0x5')]('in',_0xe8d0('0x6')),'defaultValue':_0xe8d0('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe8d0('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index cbf3cf5..e4be9ba 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 _0x1ec0=['localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','send','index','map','FaxMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','options','body','find','describe','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','agent','email','internal','manual','interface','format','SIP/%s','user','channel','motionChannel','event','EventManager','reject','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','Sequelize','fullname','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x1ec0,0x194));var _0x01ec=function(_0x9f57ca,_0xede913){_0x9f57ca=_0x9f57ca-0x0;var _0x171560=_0x1ec0[_0x9f57ca];return _0x171560;};'use strict';var emlformat=require(_0x01ec('0x0'));var rimraf=require(_0x01ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x01ec('0x2'));var moment=require(_0x01ec('0x3'));var BPromise=require(_0x01ec('0x4'));var Mustache=require(_0x01ec('0x5'));var util=require(_0x01ec('0x6'));var path=require('path');var sox=require(_0x01ec('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01ec('0x8'));var _=require(_0x01ec('0x9'));var squel=require(_0x01ec('0xa'));var crypto=require(_0x01ec('0xb'));var jsforce=require(_0x01ec('0xc'));var deskjs=require(_0x01ec('0xd'));var toCsv=require(_0x01ec('0xe'));var querystring=require(_0x01ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x01ec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01ec('0x11'));var logger=require(_0x01ec('0x12'))(_0x01ec('0x13'));var utils=require('../../config/utils');var config=require(_0x01ec('0x14'));var licenseUtil=require(_0x01ec('0x15'));var db=require(_0x01ec('0x16'))['db'];config['redis']=_[_0x01ec('0x17')](config[_0x01ec('0x18')],{'host':_0x01ec('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01ec('0x18')]));require(_0x01ec('0x1a'))[_0x01ec('0x1b')](socket);var jayson=require(_0x01ec('0x1c'));var client=jayson[_0x01ec('0x1d')][_0x01ec('0x1e')]({'port':0x232c});var client9002=jayson[_0x01ec('0x1d')][_0x01ec('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3b9ea3,_0x1a74bf,_0x937e7,_0x212a34){return new BPromise(function(_0x5b8601,_0x379caf){var _0x4266c3=_0x212a34||client;return _0x4266c3[_0x01ec('0x1f')](_0x3b9ea3,_0x937e7)[_0x01ec('0x20')](function(_0x134134){logger[_0x01ec('0x21')](_0x01ec('0x22'),_0x1a74bf,_0x01ec('0x23'));logger['debug'](_0x01ec('0x24'),_0x1a74bf,_0x01ec('0x23'),JSON[_0x01ec('0x25')](_0x134134));if(_0x134134[_0x01ec('0x26')]){if(_0x134134['error'][_0x01ec('0x27')]===0x1f4){logger[_0x01ec('0x26')](_0x01ec('0x22'),_0x1a74bf,_0x134134[_0x01ec('0x26')]['message']);return _0x379caf(_0x134134['error'][_0x01ec('0x28')]);}logger['error'](_0x01ec('0x22'),_0x1a74bf,_0x134134[_0x01ec('0x26')][_0x01ec('0x28')]);return _0x5b8601(_0x134134[_0x01ec('0x26')][_0x01ec('0x28')]);}else{logger[_0x01ec('0x21')](_0x01ec('0x22'),_0x1a74bf,_0x01ec('0x23'));_0x5b8601(_0x134134['result'][_0x01ec('0x28')]);}})['catch'](function(_0x11158c){logger[_0x01ec('0x26')](_0x01ec('0x22'),_0x1a74bf,_0x11158c);_0x379caf(_0x11158c);});});}function respondWithStatusCode(_0x40ed84,_0x518de4){_0x518de4=_0x518de4||0xcc;return function(_0x4b48d8){if(_0x4b48d8){return _0x40ed84[_0x01ec('0x29')](_0x518de4);}return _0x40ed84[_0x01ec('0x2a')](_0x518de4)[_0x01ec('0x2b')]();};}function respondWithResult(_0x20dd0f,_0x127aa4){_0x127aa4=_0x127aa4||0xc8;return function(_0x31a914){if(_0x31a914){return _0x20dd0f['status'](_0x127aa4)[_0x01ec('0x2c')](_0x31a914);}};}function respondWithFilteredResult(_0x2d75fb,_0x5e3b28){return function(_0x50c2ed){if(_0x50c2ed){var _0x2db7c9=typeof _0x5e3b28[_0x01ec('0x2d')]===_0x01ec('0x2e')&&typeof _0x5e3b28[_0x01ec('0x2f')]===_0x01ec('0x2e');var _0x35ce76=_0x50c2ed[_0x01ec('0x30')];var _0x77bada=_0x2db7c9?0x0:_0x5e3b28[_0x01ec('0x2d')];var _0xacc633=_0x2db7c9?_0x50c2ed[_0x01ec('0x30')]:_0x5e3b28[_0x01ec('0x2d')]+_0x5e3b28[_0x01ec('0x2f')];var _0x25e705;if(_0xacc633>=_0x35ce76){_0xacc633=_0x35ce76;_0x25e705=0xc8;}else{_0x25e705=0xce;}_0x2d75fb['status'](_0x25e705);return _0x2d75fb[_0x01ec('0x31')](_0x01ec('0x32'),_0x77bada+'-'+_0xacc633+'/'+_0x35ce76)['json'](_0x50c2ed);}return null;};}function patchUpdates(_0x11ed44){return function(_0x4dccbb){try{jsonpatch[_0x01ec('0x33')](_0x4dccbb,_0x11ed44,!![]);}catch(_0x27fba4){return BPromise['reject'](_0x27fba4);}return _0x4dccbb[_0x01ec('0x34')]();};}function saveUpdates(_0x300aa0,_0x450980){return function(_0x16ea4c){if(_0x16ea4c){return _0x16ea4c[_0x01ec('0x35')](_0x300aa0)[_0x01ec('0x20')](function(_0x4bcdcd){return _0x4bcdcd;});}return null;};}function removeEntity(_0x3a363a,_0x2b36ed){return function(_0x33e6a3){if(_0x33e6a3){return _0x33e6a3['destroy']()[_0x01ec('0x20')](function(){_0x3a363a[_0x01ec('0x2a')](0xcc)[_0x01ec('0x2b')]();});}};}function handleEntityNotFound(_0x283128,_0x6ec7d9){return function(_0x10e8b9){if(!_0x10e8b9){_0x283128[_0x01ec('0x29')](0x194);}return _0x10e8b9;};}function handleError(_0x5d04c5,_0x199bb1){_0x199bb1=_0x199bb1||0x1f4;return function(_0x4e0143){logger[_0x01ec('0x26')](_0x4e0143[_0x01ec('0x36')]);if(_0x4e0143[_0x01ec('0x37')]){delete _0x4e0143[_0x01ec('0x37')];}_0x5d04c5[_0x01ec('0x2a')](_0x199bb1)[_0x01ec('0x38')](_0x4e0143);};}exports[_0x01ec('0x39')]=function(_0xb4b5db,_0x1495c4){var _0x1032c2={},_0x29c0a0={},_0x3a5757={'count':0x0,'rows':[]};var _0x1bd4b5=_[_0x01ec('0x3a')](db[_0x01ec('0x3b')][_0x01ec('0x3c')],function(_0x377780){return{'name':_0x377780['fieldName'],'type':_0x377780[_0x01ec('0x3d')][_0x01ec('0x3e')]};});_0x29c0a0[_0x01ec('0x3f')]=_['map'](_0x1bd4b5,'name');_0x29c0a0[_0x01ec('0x40')]=_[_0x01ec('0x41')](_0xb4b5db[_0x01ec('0x40')]);_0x29c0a0[_0x01ec('0x42')]=_['intersection'](_0x29c0a0[_0x01ec('0x3f')],_0x29c0a0[_0x01ec('0x40')]);_0x1032c2[_0x01ec('0x43')]=_[_0x01ec('0x44')](_0x29c0a0[_0x01ec('0x3f')],qs[_0x01ec('0x45')](_0xb4b5db[_0x01ec('0x40')]['fields']));_0x1032c2[_0x01ec('0x43')]=_0x1032c2[_0x01ec('0x43')][_0x01ec('0x46')]?_0x1032c2[_0x01ec('0x43')]:_0x29c0a0[_0x01ec('0x3f')];if(!_0xb4b5db[_0x01ec('0x40')][_0x01ec('0x47')](_0x01ec('0x48'))){_0x1032c2[_0x01ec('0x2f')]=qs[_0x01ec('0x2f')](_0xb4b5db['query'][_0x01ec('0x2f')]);_0x1032c2[_0x01ec('0x2d')]=qs[_0x01ec('0x2d')](_0xb4b5db['query']['offset']);}_0x1032c2['order']=qs[_0x01ec('0x49')](_0xb4b5db[_0x01ec('0x40')]['sort']);_0x1032c2['where']=qs[_0x01ec('0x42')](_[_0x01ec('0x4a')](_0xb4b5db[_0x01ec('0x40')],_0x29c0a0[_0x01ec('0x42')]),_0x1bd4b5);if(_0xb4b5db[_0x01ec('0x40')][_0x01ec('0x4b')]){_0x1032c2['where']=_[_0x01ec('0x4c')](_0x1032c2[_0x01ec('0x4d')],{'$or':_[_0x01ec('0x3a')](_0x1bd4b5,function(_0xe61694){if(_0xe61694[_0x01ec('0x3d')]!==_0x01ec('0x4e')){var _0x4b1f16={};_0x4b1f16[_0xe61694[_0x01ec('0x37')]]={'$like':'%'+_0xb4b5db['query'][_0x01ec('0x4b')]+'%'};return _0x4b1f16;}})});}_0x1032c2=_[_0x01ec('0x4c')]({},_0x1032c2,_0xb4b5db['options']);var _0x4468eb={'where':_0x1032c2[_0x01ec('0x4d')]};return db['FaxMessage'][_0x01ec('0x30')](_0x4468eb)[_0x01ec('0x20')](function(_0x463443){_0x3a5757[_0x01ec('0x30')]=_0x463443;if(_0xb4b5db[_0x01ec('0x40')][_0x01ec('0x4f')]){_0x1032c2[_0x01ec('0x50')]=[{'all':!![]}];}return db[_0x01ec('0x3b')]['findAll'](_0x1032c2);})[_0x01ec('0x20')](function(_0x41cfc5){_0x3a5757[_0x01ec('0x51')]=_0x41cfc5;return _0x3a5757;})['then'](respondWithFilteredResult(_0x1495c4,_0x1032c2))[_0x01ec('0x52')](handleError(_0x1495c4,null));};exports[_0x01ec('0x53')]=function(_0x1a0716,_0x269d57){var _0x40c286={'raw':!![],'where':{'id':_0x1a0716[_0x01ec('0x54')]['id']}},_0x340833={};_0x340833[_0x01ec('0x3f')]=_[_0x01ec('0x41')](db[_0x01ec('0x3b')][_0x01ec('0x3c')]);_0x340833[_0x01ec('0x40')]=_['keys'](_0x1a0716[_0x01ec('0x40')]);_0x340833[_0x01ec('0x42')]=_['intersection'](_0x340833[_0x01ec('0x3f')],_0x340833[_0x01ec('0x40')]);_0x40c286[_0x01ec('0x43')]=_[_0x01ec('0x44')](_0x340833['model'],qs['fields'](_0x1a0716[_0x01ec('0x40')][_0x01ec('0x45')]));_0x40c286[_0x01ec('0x43')]=_0x40c286[_0x01ec('0x43')][_0x01ec('0x46')]?_0x40c286[_0x01ec('0x43')]:_0x340833[_0x01ec('0x3f')];if(_0x1a0716[_0x01ec('0x40')]['includeAll']){_0x40c286['include']=[{'all':!![]}];}_0x40c286=_['merge']({},_0x40c286,_0x1a0716[_0x01ec('0x55')]);return db[_0x01ec('0x3b')]['find'](_0x40c286)[_0x01ec('0x20')](handleEntityNotFound(_0x269d57,null))[_0x01ec('0x20')](respondWithResult(_0x269d57,null))[_0x01ec('0x52')](handleError(_0x269d57,null));};exports[_0x01ec('0x35')]=function(_0x1c7da0,_0x49bb20){if(_0x1c7da0['body']['id']){delete _0x1c7da0[_0x01ec('0x56')]['id'];}return db['FaxMessage'][_0x01ec('0x57')]({'where':{'id':_0x1c7da0[_0x01ec('0x54')]['id']}})['then'](handleEntityNotFound(_0x49bb20,null))['then'](saveUpdates(_0x1c7da0[_0x01ec('0x56')],null))[_0x01ec('0x20')](respondWithResult(_0x49bb20,null))[_0x01ec('0x52')](handleError(_0x49bb20,null));};exports['destroy']=function(_0xa56539,_0x1d0f34){return db[_0x01ec('0x3b')][_0x01ec('0x57')]({'where':{'id':_0xa56539[_0x01ec('0x54')]['id']}})[_0x01ec('0x20')](handleEntityNotFound(_0x1d0f34,null))[_0x01ec('0x20')](removeEntity(_0x1d0f34,null))[_0x01ec('0x52')](handleError(_0x1d0f34,null));};exports[_0x01ec('0x58')]=function(_0x223381,_0x358c0f){return db[_0x01ec('0x3b')][_0x01ec('0x58')]()[_0x01ec('0x20')](respondWithResult(_0x358c0f,null))[_0x01ec('0x52')](handleError(_0x358c0f,null));};var interaction_log=require(_0x01ec('0x12'))(_0x01ec('0x59'));exports['accept']=function(_0x5b9070,_0x2739da,_0x41c1e8){var _0x198004={'agent':{},'channel':_0x01ec('0x5a')};if(_0x5b9070['body']['id']){delete _0x5b9070[_0x01ec('0x56')]['id'];}_0x5b9070['body'][_0x01ec('0x5b')]=!![];_0x5b9070['body'][_0x01ec('0x5c')]=moment()['format'](_0x01ec('0x5d'));_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')]=_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')]||_0x5b9070['user']['id'];_0x198004['agent']['id']=_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')];return db['FaxMessage'][_0x01ec('0x57')]({'where':{'id':_0x5b9070['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2739da,null))[_0x01ec('0x20')](saveUpdates(_0x5b9070[_0x01ec('0x56')],null))[_0x01ec('0x20')](function(_0xa56de9){if(_0xa56de9){_0x198004[_0x01ec('0x28')]=_0xa56de9[_0x01ec('0x5f')]({'plain':!![]});return db['FaxInteraction'][_0x01ec('0x57')]({'where':{'id':_0xa56de9['FaxInteractionId']}});}return null;})[_0x01ec('0x20')](handleEntityNotFound(_0x2739da,null))[_0x01ec('0x20')](function(_0x1e29c7){if(_0x1e29c7){return _0x1e29c7[_0x01ec('0x35')]({'UserId':_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')],'read1stAt':_[_0x01ec('0x60')](_0x1e29c7[_0x01ec('0x61')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x16c1d9){if(_0x16c1d9){_0x198004[_0x01ec('0x62')]=_0x16c1d9['get']({'plain':!![]});interaction_log[_0x01ec('0x21')](_0x01ec('0x63'),_0x5b9070['user']['id'],_0x5b9070['user']['name'],_0x5b9070['user'][_0x01ec('0x64')],_0x198004['interaction']['id'],_0x5b9070['body']?JSON['stringify'](_0x5b9070[_0x01ec('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x01ec('0x65'),_0x198004);}return null;})[_0x01ec('0x20')](function(_0x215988){var _0x337ccb=_0x01ec('0x66')+_0x215988['message'][_0x01ec('0x67')];return db['sequelize'][_0x01ec('0x40')](_0x337ccb,{'type':db['Sequelize'][_0x01ec('0x68')][_0x01ec('0x69')],'raw':!![]})['then'](function(_0x57a30){return _0x57a30;});})[_0x01ec('0x20')](function(_0x1fe7e2){if(_0x1fe7e2){_0x198004['message']['contact']=_0x1fe7e2[0x0];if(!_0x5b9070[_0x01ec('0x56')][_0x01ec('0x5e')])return;return db[_0x01ec('0x6a')][_0x01ec('0x57')]({'where':{'id':_0x5b9070['body'][_0x01ec('0x5e')],'role':_0x01ec('0x6b')},'attributes':['id',_0x01ec('0x37'),'fullname',_0x01ec('0x6c'),_0x01ec('0x6d')],'raw':!![]});}return null;})[_0x01ec('0x20')](function(_0xe5f298){if(!_0xe5f298)return null;_0x198004[_0x01ec('0x28')][_0x01ec('0x6b')]=_0xe5f298;return _0x198004;})[_0x01ec('0x20')](function(_0x1bbb27){if(_0x1bbb27){if(_0x5b9070['body'][_0x01ec('0x6e')]){_0x198004[_0x01ec('0x28')][_0x01ec('0x6f')]=util[_0x01ec('0x70')](_0x01ec('0x71'),_0x5b9070[_0x01ec('0x72')][_0x01ec('0x37')]);_0x198004[_0x01ec('0x28')][_0x01ec('0x73')]=_0x198004[_0x01ec('0x73')];_0x198004[_0x01ec('0x28')][_0x01ec('0x74')]=_0x198004[_0x01ec('0x73')];_0x198004[_0x01ec('0x28')][_0x01ec('0x75')]='accept';return respondWithRpcPromise(_0x01ec('0x76'),_0x01ec('0x76'),{'event':'acceptmessage','message':_0x198004[_0x01ec('0x28')]},client9002)[_0x01ec('0x20')](function(){return _0x198004;});}return _0x198004;}return null;})[_0x01ec('0x20')](respondWithResult(_0x2739da,null))[_0x01ec('0x52')](handleError(_0x2739da,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x01ec('0x77')]=function(_0x513948,_0x4b4f16,_0x1fbce6){var _0x36f612={'agent':{},'channel':'fax'};if(_0x513948[_0x01ec('0x56')]['id']){delete _0x513948[_0x01ec('0x56')]['id'];}_0x513948[_0x01ec('0x56')][_0x01ec('0x5e')]=_0x513948[_0x01ec('0x56')]['UserId']||_0x513948[_0x01ec('0x72')]['id'];_0x36f612[_0x01ec('0x6b')]['id']=_0x513948[_0x01ec('0x56')]['UserId'];return db[_0x01ec('0x3b')][_0x01ec('0x57')]({'where':{'id':_0x513948[_0x01ec('0x54')]['id'],'UserId':null}})[_0x01ec('0x20')](handleEntityNotFound(_0x4b4f16,null))['then'](function(_0x4fb5b2){if(_0x4fb5b2){_0x36f612[_0x01ec('0x28')]=_0x4fb5b2[_0x01ec('0x5f')]({'plain':!![]});return db[_0x01ec('0x78')][_0x01ec('0x57')]({'where':{'id':_0x4fb5b2[_0x01ec('0x79')]}});}return null;})[_0x01ec('0x20')](handleEntityNotFound(_0x4b4f16,null))[_0x01ec('0x20')](function(_0x1617f1){if(_0x1617f1){_0x36f612[_0x01ec('0x62')]=_0x1617f1[_0x01ec('0x5f')]({'plain':!![]});interaction_log[_0x01ec('0x21')](_0x01ec('0x7a'),_0x513948[_0x01ec('0x72')]['id'],_0x513948[_0x01ec('0x72')]['name'],_0x513948[_0x01ec('0x72')][_0x01ec('0x64')],_0x36f612[_0x01ec('0x62')]['id'],_0x513948[_0x01ec('0x56')]?JSON['stringify'](_0x513948['body']):_0x01ec('0x7b'));return respondWithRpcPromise(_0x01ec('0x7c'),_0x01ec('0x7d'),_0x36f612);}return null;})[_0x01ec('0x20')](function(_0x369453){var _0x2619d4=_0x01ec('0x66')+_0x369453[_0x01ec('0x28')][_0x01ec('0x67')];return db[_0x01ec('0x7e')][_0x01ec('0x40')](_0x2619d4,{'type':db[_0x01ec('0x7f')][_0x01ec('0x68')]['SELECT'],'raw':!![]})[_0x01ec('0x20')](function(_0x41487c){return _0x41487c;});})[_0x01ec('0x20')](function(_0x55107a){if(_0x55107a){_0x36f612['message']['contact']=_0x55107a[0x0];if(!_0x513948[_0x01ec('0x56')][_0x01ec('0x5e')])return;return db[_0x01ec('0x6a')][_0x01ec('0x57')]({'where':{'id':_0x513948['body'][_0x01ec('0x5e')],'role':'agent'},'attributes':['id',_0x01ec('0x37'),_0x01ec('0x80'),'email',_0x01ec('0x6d')],'raw':!![]});}return null;})[_0x01ec('0x20')](function(_0x1bb96d){if(!_0x1bb96d)return null;_0x36f612[_0x01ec('0x28')][_0x01ec('0x6b')]=_0x1bb96d;return _0x36f612;})[_0x01ec('0x20')](function(_0xe88214){if(_0xe88214){_0xe88214[_0x01ec('0x28')][_0x01ec('0x6f')]=util[_0x01ec('0x70')](_0x01ec('0x71'),_0x513948['user'][_0x01ec('0x37')]);_0xe88214[_0x01ec('0x28')][_0x01ec('0x73')]=_0x36f612[_0x01ec('0x73')];_0xe88214[_0x01ec('0x28')][_0x01ec('0x74')]=_0x36f612[_0x01ec('0x73')];_0xe88214[_0x01ec('0x28')]['event']='reject';respondWithRpcPromise(_0x01ec('0x76'),_0x01ec('0x76'),{'event':_0x01ec('0x81'),'message':_0xe88214[_0x01ec('0x28')]},client9002);return _0x36f612;}return null;})[_0x01ec('0x20')](respondWithResult(_0x4b4f16,null))[_0x01ec('0x52')](handleError(_0x4b4f16,null));};exports[_0x01ec('0x82')]=function(_0x2c19b9,_0x4e7c2f){var _0x4196c5;return db['FaxMessage'][_0x01ec('0x82')](_0x2c19b9[_0x01ec('0x56')],{})['then'](function(_0x2f80e6){_0x4196c5=_0x2f80e6;return db['CmContact'][_0x01ec('0x83')]({'where':{'id':_0x4196c5[_0x01ec('0x67')]}});})[_0x01ec('0x20')](function(_0xa5691d){if(_[_0x01ec('0x60')](_0xa5691d)){return;}else{_0x4196c5[_0x01ec('0x5a')]=_0xa5691d[_0x01ec('0x5a')];return db[_0x01ec('0x84')][_0x01ec('0x83')]({'where':{'id':_0x4196c5[_0x01ec('0x85')]}});}})[_0x01ec('0x20')](function(_0x2f43c7){return respondWithRpcPromise(_0x01ec('0x86'),_0x01ec('0x86'),{'FaxAccountId':_[_0x01ec('0x60')](_0x2c19b9[_0x01ec('0x56')])?undefined:_0x2c19b9['body']['FaxAccountId'],'path':_[_0x01ec('0x60')](_0x2f43c7)?undefined:util['format'](_0x01ec('0x87'),_0x2f43c7['basename']),'fax':_['isNil'](_0x4196c5[_0x01ec('0x5a')])?undefined:_0x4196c5[_0x01ec('0x5a')],'AttachmentId':_0x4196c5['AttachmentId']},client9002);})[_0x01ec('0x20')](respondWithResult(_0x4e7c2f,0xc9))[_0x01ec('0x52')](handleError(_0x4e7c2f,null));};exports[_0x01ec('0x88')]=function(_0x18c781,_0x25a049){var _0x1dd100=path[_0x01ec('0x89')](config[_0x01ec('0x8a')],_0x01ec('0x8b'),_0x01ec('0x8c'),_0x01ec('0x8d'));return db[_0x01ec('0x3b')][_0x01ec('0x57')]({'where':{'id':_0x18c781[_0x01ec('0x54')]['id']},'include':[{'model':db[_0x01ec('0x84')],'as':_0x01ec('0x84')}]})[_0x01ec('0x20')](handleEntityNotFound(_0x25a049,null))['then'](function(_0x882ca5){if(_0x882ca5){return _0x25a049['download'](path[_0x01ec('0x89')](_0x1dd100,_0x882ca5['Attachment'][_0x01ec('0x8e')]));}})['catch'](handleError(_0x25a049,null));}; \ No newline at end of file +var _0x165c=['filter','merge','options','includeAll','include','findAll','rows','show','params','find','update','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteraction','isNil','read1stAt','interaction','get','[FAXMESSAGE: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','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','interface','create','findOne','Attachment','AttachmentId','SendFax','download','join','root','server','files','attachments','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','sort','where','filters','pick'];(function(_0x307083,_0x2a6fad){var _0x130a95=function(_0x28157b){while(--_0x28157b){_0x307083['push'](_0x307083['shift']());}};_0x130a95(++_0x2a6fad);}(_0x165c,0x1f0));var _0xc165=function(_0x31e350,_0x32056e){_0x31e350=_0x31e350-0x0;var _0x1b6df5=_0x165c[_0x31e350];return _0x1b6df5;};'use strict';var emlformat=require(_0xc165('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc165('0x1'));var jsonpatch=require(_0xc165('0x2'));var rp=require(_0xc165('0x3'));var moment=require(_0xc165('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc165('0x5'));var util=require('util');var path=require(_0xc165('0x6'));var sox=require(_0xc165('0x7'));var csv=require(_0xc165('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc165('0x9'));var _=require(_0xc165('0xa'));var squel=require(_0xc165('0xb'));var crypto=require(_0xc165('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc165('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc165('0xe'));var Papa=require(_0xc165('0xf'));var Redis=require(_0xc165('0x10'));var authService=require(_0xc165('0x11'));var qs=require(_0xc165('0x12'));var as=require(_0xc165('0x13'));var hardwareService=require(_0xc165('0x14'));var logger=require(_0xc165('0x15'))(_0xc165('0x16'));var utils=require(_0xc165('0x17'));var config=require(_0xc165('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc165('0x19'))['db'];config[_0xc165('0x1a')]=_[_0xc165('0x1b')](config[_0xc165('0x1a')],{'host':_0xc165('0x1c'),'port':0x18eb});var socket=require(_0xc165('0x1d'))(new Redis(config['redis']));require(_0xc165('0x1e'))['register'](socket);var jayson=require(_0xc165('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc165('0x20')][_0xc165('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x186722,_0x4e5061,_0x5e5114,_0x1a980){return new BPromise(function(_0x28353c,_0x45725d){var _0x51bb18=_0x1a980||client;return _0x51bb18[_0xc165('0x22')](_0x186722,_0x5e5114)[_0xc165('0x23')](function(_0x2b0ccd){logger[_0xc165('0x24')](_0xc165('0x25'),_0x4e5061,_0xc165('0x26'));logger[_0xc165('0x27')](_0xc165('0x28'),_0x4e5061,_0xc165('0x26'),JSON[_0xc165('0x29')](_0x2b0ccd));if(_0x2b0ccd[_0xc165('0x2a')]){if(_0x2b0ccd[_0xc165('0x2a')][_0xc165('0x2b')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4e5061,_0x2b0ccd[_0xc165('0x2a')][_0xc165('0x2c')]);return _0x45725d(_0x2b0ccd[_0xc165('0x2a')]['message']);}logger['error'](_0xc165('0x25'),_0x4e5061,_0x2b0ccd[_0xc165('0x2a')]['message']);return _0x28353c(_0x2b0ccd['error'][_0xc165('0x2c')]);}else{logger['info'](_0xc165('0x25'),_0x4e5061,_0xc165('0x26'));_0x28353c(_0x2b0ccd[_0xc165('0x2d')][_0xc165('0x2c')]);}})[_0xc165('0x2e')](function(_0x4fa38e){logger[_0xc165('0x2a')](_0xc165('0x25'),_0x4e5061,_0x4fa38e);_0x45725d(_0x4fa38e);});});}function respondWithStatusCode(_0x96ac62,_0x4e50cb){_0x4e50cb=_0x4e50cb||0xcc;return function(_0xe05fdb){if(_0xe05fdb){return _0x96ac62[_0xc165('0x2f')](_0x4e50cb);}return _0x96ac62[_0xc165('0x30')](_0x4e50cb)['end']();};}function respondWithResult(_0x30c60e,_0x2f71bd){_0x2f71bd=_0x2f71bd||0xc8;return function(_0x8eeb5f){if(_0x8eeb5f){return _0x30c60e[_0xc165('0x30')](_0x2f71bd)['json'](_0x8eeb5f);}};}function respondWithFilteredResult(_0x46dc6f,_0x15b267){return function(_0x1f6ced){if(_0x1f6ced){var _0x153dad=typeof _0x15b267[_0xc165('0x31')]==='undefined'&&typeof _0x15b267[_0xc165('0x32')]==='undefined';var _0x42aa1e=_0x1f6ced[_0xc165('0x33')];var _0x1e2377=_0x153dad?0x0:_0x15b267[_0xc165('0x31')];var _0x42bab8=_0x153dad?_0x1f6ced[_0xc165('0x33')]:_0x15b267['offset']+_0x15b267[_0xc165('0x32')];var _0x128518;if(_0x42bab8>=_0x42aa1e){_0x42bab8=_0x42aa1e;_0x128518=0xc8;}else{_0x128518=0xce;}_0x46dc6f[_0xc165('0x30')](_0x128518);return _0x46dc6f[_0xc165('0x34')](_0xc165('0x35'),_0x1e2377+'-'+_0x42bab8+'/'+_0x42aa1e)[_0xc165('0x36')](_0x1f6ced);}return null;};}function patchUpdates(_0x191921){return function(_0x2015c4){try{jsonpatch[_0xc165('0x37')](_0x2015c4,_0x191921,!![]);}catch(_0x2dfc36){return BPromise[_0xc165('0x38')](_0x2dfc36);}return _0x2015c4['save']();};}function saveUpdates(_0x20ae25,_0x1715e5){return function(_0x18305c){if(_0x18305c){return _0x18305c['update'](_0x20ae25)['then'](function(_0x320332){return _0x320332;});}return null;};}function removeEntity(_0x284ff7,_0x513734){return function(_0x3d2c74){if(_0x3d2c74){return _0x3d2c74[_0xc165('0x39')]()[_0xc165('0x23')](function(){_0x284ff7[_0xc165('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x463e9b,_0x35a195){return function(_0x2c2960){if(!_0x2c2960){_0x463e9b[_0xc165('0x2f')](0x194);}return _0x2c2960;};}function handleError(_0x120379,_0x178b46){_0x178b46=_0x178b46||0x1f4;return function(_0x29adcd){logger['error'](_0x29adcd[_0xc165('0x3a')]);if(_0x29adcd['name']){delete _0x29adcd[_0xc165('0x3b')];}_0x120379[_0xc165('0x30')](_0x178b46)[_0xc165('0x3c')](_0x29adcd);};}exports[_0xc165('0x3d')]=function(_0x3f22e5,_0x5f4ff9){var _0x2fd9b7={},_0x56efd1={},_0x4871f2={'count':0x0,'rows':[]};var _0x44426b=_[_0xc165('0x3e')](db[_0xc165('0x3f')][_0xc165('0x40')],function(_0x26db6d){return{'name':_0x26db6d[_0xc165('0x41')],'type':_0x26db6d[_0xc165('0x42')][_0xc165('0x43')]};});_0x56efd1['model']=_[_0xc165('0x3e')](_0x44426b,_0xc165('0x3b'));_0x56efd1[_0xc165('0x44')]=_[_0xc165('0x45')](_0x3f22e5[_0xc165('0x44')]);_0x56efd1['filters']=_[_0xc165('0x46')](_0x56efd1['model'],_0x56efd1[_0xc165('0x44')]);_0x2fd9b7[_0xc165('0x47')]=_['intersection'](_0x56efd1[_0xc165('0x48')],qs[_0xc165('0x49')](_0x3f22e5[_0xc165('0x44')][_0xc165('0x49')]));_0x2fd9b7[_0xc165('0x47')]=_0x2fd9b7[_0xc165('0x47')][_0xc165('0x4a')]?_0x2fd9b7[_0xc165('0x47')]:_0x56efd1[_0xc165('0x48')];if(!_0x3f22e5[_0xc165('0x44')]['hasOwnProperty'](_0xc165('0x4b'))){_0x2fd9b7['limit']=qs[_0xc165('0x32')](_0x3f22e5[_0xc165('0x44')][_0xc165('0x32')]);_0x2fd9b7[_0xc165('0x31')]=qs['offset'](_0x3f22e5['query']['offset']);}_0x2fd9b7['order']=qs[_0xc165('0x4c')](_0x3f22e5[_0xc165('0x44')][_0xc165('0x4c')]);_0x2fd9b7[_0xc165('0x4d')]=qs[_0xc165('0x4e')](_[_0xc165('0x4f')](_0x3f22e5[_0xc165('0x44')],_0x56efd1[_0xc165('0x4e')]),_0x44426b);if(_0x3f22e5['query'][_0xc165('0x50')]){_0x2fd9b7[_0xc165('0x4d')]=_[_0xc165('0x51')](_0x2fd9b7['where'],{'$or':_[_0xc165('0x3e')](_0x44426b,function(_0x3f8fe1){if(_0x3f8fe1[_0xc165('0x42')]!=='VIRTUAL'){var _0x545d1f={};_0x545d1f[_0x3f8fe1[_0xc165('0x3b')]]={'$like':'%'+_0x3f22e5['query']['filter']+'%'};return _0x545d1f;}})});}_0x2fd9b7=_[_0xc165('0x51')]({},_0x2fd9b7,_0x3f22e5[_0xc165('0x52')]);var _0x3d32fe={'where':_0x2fd9b7[_0xc165('0x4d')]};return db[_0xc165('0x3f')]['count'](_0x3d32fe)[_0xc165('0x23')](function(_0x567c5e){_0x4871f2[_0xc165('0x33')]=_0x567c5e;if(_0x3f22e5[_0xc165('0x44')][_0xc165('0x53')]){_0x2fd9b7[_0xc165('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0xc165('0x55')](_0x2fd9b7);})[_0xc165('0x23')](function(_0x8853b9){_0x4871f2[_0xc165('0x56')]=_0x8853b9;return _0x4871f2;})[_0xc165('0x23')](respondWithFilteredResult(_0x5f4ff9,_0x2fd9b7))[_0xc165('0x2e')](handleError(_0x5f4ff9,null));};exports[_0xc165('0x57')]=function(_0x1645ac,_0x7ab442){var _0x1cf352={'raw':!![],'where':{'id':_0x1645ac[_0xc165('0x58')]['id']}},_0x1baf95={};_0x1baf95[_0xc165('0x48')]=_[_0xc165('0x45')](db[_0xc165('0x3f')][_0xc165('0x40')]);_0x1baf95[_0xc165('0x44')]=_[_0xc165('0x45')](_0x1645ac['query']);_0x1baf95[_0xc165('0x4e')]=_[_0xc165('0x46')](_0x1baf95['model'],_0x1baf95[_0xc165('0x44')]);_0x1cf352[_0xc165('0x47')]=_['intersection'](_0x1baf95[_0xc165('0x48')],qs['fields'](_0x1645ac['query'][_0xc165('0x49')]));_0x1cf352['attributes']=_0x1cf352[_0xc165('0x47')]['length']?_0x1cf352[_0xc165('0x47')]:_0x1baf95[_0xc165('0x48')];if(_0x1645ac[_0xc165('0x44')][_0xc165('0x53')]){_0x1cf352[_0xc165('0x54')]=[{'all':!![]}];}_0x1cf352=_[_0xc165('0x51')]({},_0x1cf352,_0x1645ac[_0xc165('0x52')]);return db[_0xc165('0x3f')][_0xc165('0x59')](_0x1cf352)[_0xc165('0x23')](handleEntityNotFound(_0x7ab442,null))['then'](respondWithResult(_0x7ab442,null))[_0xc165('0x2e')](handleError(_0x7ab442,null));};exports[_0xc165('0x5a')]=function(_0x24c6b8,_0x71cb9e){if(_0x24c6b8[_0xc165('0x5b')]['id']){delete _0x24c6b8[_0xc165('0x5b')]['id'];}return db[_0xc165('0x3f')][_0xc165('0x59')]({'where':{'id':_0x24c6b8[_0xc165('0x58')]['id']}})[_0xc165('0x23')](handleEntityNotFound(_0x71cb9e,null))[_0xc165('0x23')](saveUpdates(_0x24c6b8['body'],null))['then'](respondWithResult(_0x71cb9e,null))[_0xc165('0x2e')](handleError(_0x71cb9e,null));};exports[_0xc165('0x39')]=function(_0x52714a,_0xe97b9f){return db[_0xc165('0x3f')][_0xc165('0x59')]({'where':{'id':_0x52714a['params']['id']}})[_0xc165('0x23')](handleEntityNotFound(_0xe97b9f,null))[_0xc165('0x23')](removeEntity(_0xe97b9f,null))[_0xc165('0x2e')](handleError(_0xe97b9f,null));};exports[_0xc165('0x5c')]=function(_0xfa392c,_0x579c79){return db[_0xc165('0x3f')][_0xc165('0x5c')]()[_0xc165('0x23')](respondWithResult(_0x579c79,null))[_0xc165('0x2e')](handleError(_0x579c79,null));};var interaction_log=require('../../config/logger')(_0xc165('0x5d'));exports[_0xc165('0x5e')]=function(_0xacb527,_0x386642,_0x2b9cd9){var _0x122382={'agent':{},'channel':_0xc165('0x5f')};if(_0xacb527['body']['id']){delete _0xacb527[_0xc165('0x5b')]['id'];}_0xacb527['body'][_0xc165('0x60')]=!![];_0xacb527[_0xc165('0x5b')]['readAt']=moment()[_0xc165('0x61')](_0xc165('0x62'));_0xacb527[_0xc165('0x5b')][_0xc165('0x63')]=_0xacb527[_0xc165('0x5b')]['UserId']||_0xacb527['user']['id'];_0x122382['agent']['id']=_0xacb527['body']['UserId'];return db[_0xc165('0x3f')][_0xc165('0x59')]({'where':{'id':_0xacb527[_0xc165('0x58')]['id'],'UserId':null}})[_0xc165('0x23')](handleEntityNotFound(_0x386642,null))['then'](saveUpdates(_0xacb527[_0xc165('0x5b')],null))[_0xc165('0x23')](function(_0x1970af){if(_0x1970af){_0x122382[_0xc165('0x2c')]=_0x1970af['get']({'plain':!![]});return db[_0xc165('0x64')][_0xc165('0x59')]({'where':{'id':_0x1970af['FaxInteractionId']}});}return null;})[_0xc165('0x23')](handleEntityNotFound(_0x386642,null))[_0xc165('0x23')](function(_0x23875e){if(_0x23875e){return _0x23875e[_0xc165('0x5a')]({'UserId':_0xacb527[_0xc165('0x5b')][_0xc165('0x63')],'read1stAt':_[_0xc165('0x65')](_0x23875e[_0xc165('0x66')])?moment()[_0xc165('0x61')](_0xc165('0x62')):undefined});}return null;})['then'](function(_0x32f2ed){if(_0x32f2ed){_0x122382[_0xc165('0x67')]=_0x32f2ed[_0xc165('0x68')]({'plain':!![]});interaction_log[_0xc165('0x24')](_0xc165('0x69'),_0xacb527['user']['id'],_0xacb527['user'][_0xc165('0x3b')],_0xacb527[_0xc165('0x6a')][_0xc165('0x6b')],_0x122382[_0xc165('0x67')]['id'],_0xacb527[_0xc165('0x5b')]?JSON[_0xc165('0x29')](_0xacb527[_0xc165('0x5b')]):_0xc165('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xc165('0x6d'),_0x122382);}return null;})[_0xc165('0x23')](function(_0x3648eb){var _0x295709=_0xc165('0x6e')+_0x3648eb[_0xc165('0x2c')][_0xc165('0x6f')];return db[_0xc165('0x70')][_0xc165('0x44')](_0x295709,{'type':db[_0xc165('0x71')][_0xc165('0x72')][_0xc165('0x73')],'raw':!![]})['then'](function(_0x14fe70){return _0x14fe70;});})[_0xc165('0x23')](function(_0x2e3871){if(_0x2e3871){_0x122382[_0xc165('0x2c')]['contact']=_0x2e3871[0x0];if(!_0xacb527['body']['UserId'])return;return db[_0xc165('0x74')][_0xc165('0x59')]({'where':{'id':_0xacb527[_0xc165('0x5b')][_0xc165('0x63')],'role':_0xc165('0x75')},'attributes':['id','name',_0xc165('0x76'),_0xc165('0x77'),_0xc165('0x78')],'raw':!![]});}return null;})['then'](function(_0x2a0633){if(!_0x2a0633)return null;_0x122382[_0xc165('0x2c')][_0xc165('0x75')]=_0x2a0633;return _0x122382;})['then'](function(_0x49c4eb){if(_0x49c4eb){if(_0xacb527[_0xc165('0x5b')]['manual']){_0x122382[_0xc165('0x2c')]['interface']=util['format'](_0xc165('0x79'),_0xacb527['user'][_0xc165('0x3b')]);_0x122382[_0xc165('0x2c')][_0xc165('0x7a')]=_0x122382[_0xc165('0x7a')];_0x122382['message'][_0xc165('0x7b')]=_0x122382[_0xc165('0x7a')];_0x122382[_0xc165('0x2c')][_0xc165('0x7c')]=_0xc165('0x5e');return respondWithRpcPromise(_0xc165('0x7d'),'EventManager',{'event':'acceptmessage','message':_0x122382[_0xc165('0x2c')]},client9002)[_0xc165('0x23')](function(){return _0x122382;});}return _0x122382;}return null;})[_0xc165('0x23')](respondWithResult(_0x386642,null))[_0xc165('0x2e')](handleError(_0x386642,null));};var interaction_log=require('../../config/logger')(_0xc165('0x5d'));exports[_0xc165('0x38')]=function(_0x21bcaa,_0x1fe3e2,_0x2b4720){var _0xffdaba={'agent':{},'channel':'fax'};if(_0x21bcaa[_0xc165('0x5b')]['id']){delete _0x21bcaa[_0xc165('0x5b')]['id'];}_0x21bcaa['body']['UserId']=_0x21bcaa[_0xc165('0x5b')]['UserId']||_0x21bcaa[_0xc165('0x6a')]['id'];_0xffdaba[_0xc165('0x75')]['id']=_0x21bcaa[_0xc165('0x5b')]['UserId'];return db[_0xc165('0x3f')][_0xc165('0x59')]({'where':{'id':_0x21bcaa[_0xc165('0x58')]['id'],'UserId':null}})[_0xc165('0x23')](handleEntityNotFound(_0x1fe3e2,null))[_0xc165('0x23')](function(_0x482469){if(_0x482469){_0xffdaba[_0xc165('0x2c')]=_0x482469[_0xc165('0x68')]({'plain':!![]});return db[_0xc165('0x64')][_0xc165('0x59')]({'where':{'id':_0x482469[_0xc165('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x1fe3e2,null))[_0xc165('0x23')](function(_0x1160d3){if(_0x1160d3){_0xffdaba['interaction']=_0x1160d3[_0xc165('0x68')]({'plain':!![]});interaction_log['info'](_0xc165('0x7f'),_0x21bcaa[_0xc165('0x6a')]['id'],_0x21bcaa[_0xc165('0x6a')]['name'],_0x21bcaa[_0xc165('0x6a')][_0xc165('0x6b')],_0xffdaba[_0xc165('0x67')]['id'],_0x21bcaa[_0xc165('0x5b')]?JSON[_0xc165('0x29')](_0x21bcaa[_0xc165('0x5b')]):_0xc165('0x6c'));return respondWithRpcPromise(_0xc165('0x80'),_0xc165('0x81'),_0xffdaba);}return null;})[_0xc165('0x23')](function(_0x55ede9){var _0x383dbb=_0xc165('0x6e')+_0x55ede9['message'][_0xc165('0x6f')];return db[_0xc165('0x70')][_0xc165('0x44')](_0x383dbb,{'type':db['Sequelize']['QueryTypes'][_0xc165('0x73')],'raw':!![]})[_0xc165('0x23')](function(_0x3f4308){return _0x3f4308;});})[_0xc165('0x23')](function(_0x441e05){if(_0x441e05){_0xffdaba[_0xc165('0x2c')][_0xc165('0x82')]=_0x441e05[0x0];if(!_0x21bcaa[_0xc165('0x5b')][_0xc165('0x63')])return;return db[_0xc165('0x74')][_0xc165('0x59')]({'where':{'id':_0x21bcaa[_0xc165('0x5b')][_0xc165('0x63')],'role':_0xc165('0x75')},'attributes':['id',_0xc165('0x3b'),'fullname','email',_0xc165('0x78')],'raw':!![]});}return null;})['then'](function(_0x40c054){if(!_0x40c054)return null;_0xffdaba[_0xc165('0x2c')][_0xc165('0x75')]=_0x40c054;return _0xffdaba;})['then'](function(_0x5bbad8){if(_0x5bbad8){_0x5bbad8[_0xc165('0x2c')][_0xc165('0x83')]=util['format'](_0xc165('0x79'),_0x21bcaa['user'][_0xc165('0x3b')]);_0x5bbad8[_0xc165('0x2c')]['channel']=_0xffdaba[_0xc165('0x7a')];_0x5bbad8['message'][_0xc165('0x7b')]=_0xffdaba[_0xc165('0x7a')];_0x5bbad8[_0xc165('0x2c')][_0xc165('0x7c')]=_0xc165('0x38');respondWithRpcPromise('EventManager',_0xc165('0x7d'),{'event':'rejectmessage','message':_0x5bbad8[_0xc165('0x2c')]},client9002);return _0xffdaba;}return null;})[_0xc165('0x23')](respondWithResult(_0x1fe3e2,null))[_0xc165('0x2e')](handleError(_0x1fe3e2,null));};exports[_0xc165('0x84')]=function(_0x3aca07,_0x55a2ed){var _0x5aeda0;return db[_0xc165('0x3f')]['create'](_0x3aca07['body'],{})[_0xc165('0x23')](function(_0x358f39){_0x5aeda0=_0x358f39;return db['CmContact'][_0xc165('0x85')]({'where':{'id':_0x5aeda0[_0xc165('0x6f')]}});})[_0xc165('0x23')](function(_0x2bf24a){if(_['isNil'](_0x2bf24a)){return;}else{_0x5aeda0[_0xc165('0x5f')]=_0x2bf24a[_0xc165('0x5f')];return db[_0xc165('0x86')][_0xc165('0x85')]({'where':{'id':_0x5aeda0[_0xc165('0x87')]}});}})[_0xc165('0x23')](function(_0x1ad5bb){return respondWithRpcPromise(_0xc165('0x88'),_0xc165('0x88'),{'FaxAccountId':_['isNil'](_0x3aca07['body'])?undefined:_0x3aca07[_0xc165('0x5b')]['FaxAccountId'],'path':_['isNil'](_0x1ad5bb)?undefined:util[_0xc165('0x61')]('/var/opt/motion2/server/files/attachments/%s',_0x1ad5bb['basename']),'fax':_[_0xc165('0x65')](_0x5aeda0[_0xc165('0x5f')])?undefined:_0x5aeda0[_0xc165('0x5f')],'AttachmentId':_0x5aeda0['AttachmentId']},client9002);})[_0xc165('0x23')](respondWithResult(_0x55a2ed,0xc9))[_0xc165('0x2e')](handleError(_0x55a2ed,null));};exports[_0xc165('0x89')]=function(_0x661bb3,_0x339c61){var _0x35ddf6=path[_0xc165('0x8a')](config[_0xc165('0x8b')],_0xc165('0x8c'),_0xc165('0x8d'),_0xc165('0x8e'));return db['FaxMessage'][_0xc165('0x59')]({'where':{'id':_0x661bb3[_0xc165('0x58')]['id']},'include':[{'model':db['Attachment'],'as':_0xc165('0x86')}]})[_0xc165('0x23')](handleEntityNotFound(_0x339c61,null))[_0xc165('0x23')](function(_0x540c06){if(_0x540c06){return _0x339c61[_0xc165('0x89')](path[_0xc165('0x8a')](_0x35ddf6,_0x540c06['Attachment'][_0xc165('0x8f')]));}})[_0xc165('0x2e')](handleError(_0x339c61,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 123be53..7386cdc 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 _0x00f0=['hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x4740ab,_0x142db6){var _0x1b72eb=function(_0x5a116e){while(--_0x5a116e){_0x4740ab['push'](_0x4740ab['shift']());}};_0x1b72eb(++_0x142db6);}(_0x00f0,0xec));var _0x000f=function(_0x8fbecf,_0x4a518a){_0x8fbecf=_0x8fbecf-0x0;var _0x46c36d=_0x00f0[_0x8fbecf];return _0x46c36d;};'use strict';var EventEmitter=require(_0x000f('0x0'));var FaxMessage=require(_0x000f('0x1'))['db'][_0x000f('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x000f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x000f('0x4')};function emitEvent(_0x4c8ce1){return function(_0x3cd8ed,_0x53989d,_0x3a0613){FaxMessageEvents[_0x000f('0x5')](_0x4c8ce1+':'+_0x3cd8ed['id'],_0x3cd8ed);FaxMessageEvents['emit'](_0x4c8ce1,_0x3cd8ed);_0x3a0613(null);};}for(var e in events){if(events[_0x000f('0x6')](e)){var event=events[e];FaxMessage[_0x000f('0x7')](e,emitEvent(event));}}module[_0x000f('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xee55=['events','FaxMessage','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee55,0x1a0));var _0x5ee5=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xee55[_0x2e50a2];return _0x47e5de;};'use strict';var EventEmitter=require(_0x5ee5('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x5ee5('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5ee5('0x2'),'afterUpdate':'update','afterDestroy':_0x5ee5('0x3')};function emitEvent(_0x2fc0fd){return function(_0x4e5f9b,_0x394334,_0x119392){FaxMessageEvents[_0x5ee5('0x4')](_0x2fc0fd+':'+_0x4e5f9b['id'],_0x4e5f9b);FaxMessageEvents[_0x5ee5('0x4')](_0x2fc0fd,_0x4e5f9b);_0x119392(null);};}for(var e in events){if(events[_0x5ee5('0x5')](e)){var event=events[e];FaxMessage[_0x5ee5('0x6')](e,emitEvent(event));}}module[_0x5ee5('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 48ca3ae..22328bc 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 _0x7ac6=['findOne','FaxInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','./faxMessage.attributes','exports','FaxMessage','fti_fax_messages','body','FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','FaxInteraction'];(function(_0x5e8a68,_0x416f32){var _0x3c0dc8=function(_0xf7df00){while(--_0xf7df00){_0x5e8a68['push'](_0x5e8a68['shift']());}};_0x3c0dc8(++_0x416f32);}(_0x7ac6,0xce));var _0x67ac=function(_0x333ed5,_0x592df1){_0x333ed5=_0x333ed5-0x0;var _0x1eae55=_0x7ac6[_0x333ed5];return _0x1eae55;};'use strict';var _=require('lodash');var util=require(_0x67ac('0x0'));var logger=require('../../config/logger')(_0x67ac('0x1'));var moment=require(_0x67ac('0x2'));var BPromise=require(_0x67ac('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67ac('0x4'));var rimraf=require(_0x67ac('0x5'));var config=require('../../config/environment');var attributes=require(_0x67ac('0x6'));module[_0x67ac('0x7')]=function(_0x1116f1,_0x2b61cf){return _0x1116f1['define'](_0x67ac('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x67ac('0x9'),'fields':[_0x67ac('0xa')],'type':_0x67ac('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a5705,_0x55875e,_0x5cf0b5){var _0x422fd6=_0x1116f1[_0x67ac('0xc')];var _0x11b8a6=_0x3a5705['get']({'plain':!![]});if(_0x11b8a6['direction'][_0x67ac('0xd')]()==='in'||_0x11b8a6[_0x67ac('0xe')][_0x67ac('0xd')]()===_0x67ac('0xf')&&!_0x11b8a6['secret']&&!_[_0x67ac('0x10')](_0x11b8a6[_0x67ac('0x11')])){_0x422fd6[_0x67ac('0x12')][_0x67ac('0x13')]({'where':{'id':_0x11b8a6[_0x67ac('0x14')]}})['then'](function(_0x419cc3){if(_0x419cc3){_0x419cc3[_0x67ac('0x15')]({'lastMsgAt':_0x11b8a6['createdAt'],'lastMsgDirection':_0x11b8a6[_0x67ac('0xe')][_0x67ac('0xd')]()});}})[_0x67ac('0x16')](function(_0x668044){console['error'](_0x668044);});}_0x5cf0b5();}},'charset':_0x67ac('0x17'),'collate':_0x67ac('0x18')});}; \ No newline at end of file +var _0x9a38=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','FaxInteractionId','then','createdAt'];(function(_0x22d202,_0x154b7a){var _0xa3a454=function(_0x428999){while(--_0x428999){_0x22d202['push'](_0x22d202['shift']());}};_0xa3a454(++_0x154b7a);}(_0x9a38,0x100));var _0x89a3=function(_0x5e11f2,_0x16054a){_0x5e11f2=_0x5e11f2-0x0;var _0x48b568=_0x9a38[_0x5e11f2];return _0x48b568;};'use strict';var _=require(_0x89a3('0x0'));var util=require(_0x89a3('0x1'));var logger=require(_0x89a3('0x2'))(_0x89a3('0x3'));var moment=require(_0x89a3('0x4'));var BPromise=require(_0x89a3('0x5'));var rp=require(_0x89a3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x89a3('0x7'));var attributes=require(_0x89a3('0x8'));module['exports']=function(_0x18a710,_0x27c0d8){return _0x18a710[_0x89a3('0x9')](_0x89a3('0xa'),attributes,{'tableName':_0x89a3('0xb'),'paranoid':![],'indexes':[{'name':_0x89a3('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47c93a,_0x1b8a8c,_0x9b642f){var _0x30fc36=_0x18a710[_0x89a3('0xd')];var _0x3bad70=_0x47c93a[_0x89a3('0xe')]({'plain':!![]});if(_0x3bad70[_0x89a3('0xf')][_0x89a3('0x10')]()==='in'||_0x3bad70['direction']['toLowerCase']()===_0x89a3('0x11')&&!_0x3bad70[_0x89a3('0x12')]&&!_['isNil'](_0x3bad70[_0x89a3('0x13')])){_0x30fc36[_0x89a3('0x14')]['findOne']({'where':{'id':_0x3bad70[_0x89a3('0x15')]}})[_0x89a3('0x16')](function(_0x36d0bb){if(_0x36d0bb){_0x36d0bb['update']({'lastMsgAt':_0x3bad70[_0x89a3('0x17')],'lastMsgDirection':_0x3bad70[_0x89a3('0xf')]['toLowerCase']()});}})[_0x89a3('0x18')](function(_0x257722){console[_0x89a3('0x19')](_0x257722);});}_0x9b642f();}},'charset':_0x89a3('0x1a'),'collate':_0x89a3('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index e4401f9..5a047e9 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 _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x42ca7a,_0x2fd73c){var _0x29b7b3=function(_0x53b1b6){while(--_0x53b1b6){_0x42ca7a['push'](_0x42ca7a['shift']());}};_0x29b7b3(++_0x2fd73c);}(_0xac31,0xca));var _0x1ac3=function(_0x546353,_0x3f2e5a){_0x546353=_0x546353-0x0;var _0x1d44c7=_0xac31[_0x546353];return _0x1d44c7;};'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});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file +var _0x99e9=['register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x99e9,0xb4));var _0x999e=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x99e9[_0x16dbfd];return _0x382254;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});config[_0x999e('0xa')]=_[_0x999e('0xb')](config['redis'],{'host':_0x999e('0xc'),'port':0x18eb});var socket=require(_0x999e('0xd'))(new Redis(config[_0x999e('0xa')]));require(_0x999e('0xe'))[_0x999e('0xf')](socket);function respondWithRpcPromise(_0x175042,_0x3f2c24,_0x180846){return new BPromise(function(_0x3cb1c2,_0xf40130){return client[_0x999e('0x10')](_0x175042,_0x180846)[_0x999e('0x11')](function(_0x4246b1){logger[_0x999e('0x12')](_0x999e('0x13'),_0x3f2c24,_0x999e('0x14'));logger[_0x999e('0x15')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3f2c24,_0x999e('0x14'),JSON['stringify'](_0x4246b1));if(_0x4246b1[_0x999e('0x16')]){if(_0x4246b1[_0x999e('0x16')][_0x999e('0x17')]===0x1f4){logger['error'](_0x999e('0x13'),_0x3f2c24,_0x4246b1['error'][_0x999e('0x18')]);return _0xf40130(_0x4246b1['error']['message']);}logger[_0x999e('0x16')](_0x999e('0x13'),_0x3f2c24,_0x4246b1[_0x999e('0x16')][_0x999e('0x18')]);return _0x3cb1c2(_0x4246b1[_0x999e('0x16')][_0x999e('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x3f2c24,'request\x20sent');_0x3cb1c2(_0x4246b1[_0x999e('0x19')][_0x999e('0x18')]);}})[_0x999e('0x1a')](function(_0x302f52){logger[_0x999e('0x16')](_0x999e('0x13'),_0x3f2c24,_0x302f52);_0xf40130(_0x302f52);});});}exports['CreateFaxMessage']=function(_0x5d86d4){var _0xc20d3e=this;return new Promise(function(_0x3f4d7c,_0x3b3642){return db['FaxMessage'][_0x999e('0x1b')](_0x5d86d4[_0x999e('0x1c')],{'raw':_0x5d86d4[_0x999e('0x1d')]?_0x5d86d4[_0x999e('0x1d')][_0x999e('0x1e')]===undefined?!![]:![]:!![]})[_0x999e('0x11')](function(_0x427bcf){logger['info']('CreateFaxMessage',_0x5d86d4);logger[_0x999e('0x15')](_0x999e('0x1f'),_0x5d86d4,JSON['stringify'](_0x427bcf));_0x3f4d7c(_0x427bcf);})[_0x999e('0x1a')](function(_0xe324d8){logger[_0x999e('0x16')](_0x999e('0x1f'),_0xe324d8[_0x999e('0x18')],_0x5d86d4);_0x3b3642(_0xc20d3e[_0x999e('0x16')](0x1f4,_0xe324d8['message']));});});};exports[_0x999e('0x20')]=function(_0x4199ff){var _0x11068e=this;return new Promise(function(_0x12b9ad,_0x1b7adb){return db[_0x999e('0x21')][_0x999e('0x22')](_0x4199ff['body'],{'raw':_0x4199ff[_0x999e('0x1d')]?_0x4199ff['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4199ff[_0x999e('0x1d')]?_0x4199ff[_0x999e('0x1d')][_0x999e('0x23')]||null:null,'attributes':_0x4199ff['options']?_0x4199ff[_0x999e('0x1d')][_0x999e('0x24')]||null:null,'limit':_0x4199ff[_0x999e('0x1d')]?_0x4199ff[_0x999e('0x1d')][_0x999e('0x25')]||null:null})[_0x999e('0x11')](function(_0x82e067){logger[_0x999e('0x12')](_0x999e('0x20'),_0x4199ff);logger[_0x999e('0x15')]('UpdateFaxMessage',_0x4199ff,JSON[_0x999e('0x26')](_0x82e067));_0x12b9ad(_0x82e067);})[_0x999e('0x1a')](function(_0x371613){logger['error'](_0x999e('0x20'),_0x371613['message'],_0x4199ff);_0x1b7adb(_0x11068e['error'](0x1f4,_0x371613[_0x999e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 5a8322d..73ef45b 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 _0x5979=['save','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x3111b5,_0x2731e6){var _0x457a11=function(_0x2d333a){while(--_0x2d333a){_0x3111b5['push'](_0x3111b5['shift']());}};_0x457a11(++_0x2731e6);}(_0x5979,0x176));var _0x9597=function(_0x134058,_0x423995){_0x134058=_0x134058-0x0;var _0x14a1a9=_0x5979[_0x134058];return _0x14a1a9;};'use strict';var FaxMessageEvents=require(_0x9597('0x0'));var events=[_0x9597('0x1'),'remove','update'];function createListener(_0x2bc659,_0x10f657){return function(_0x87bb42){_0x10f657['emit'](_0x2bc659,_0x87bb42);};}function removeListener(_0x2ed5ec,_0x459e47){return function(){FaxMessageEvents[_0x9597('0x2')](_0x2ed5ec,_0x459e47);};}exports[_0x9597('0x3')]=function(_0x4227f6){for(var _0x4d365d=0x0,_0x2935f9=events['length'];_0x4d365d<_0x2935f9;_0x4d365d++){var _0x3942a2=events[_0x4d365d];var _0x5b88b5=createListener(_0x9597('0x4')+_0x3942a2,_0x4227f6);FaxMessageEvents['on'](_0x3942a2,_0x5b88b5);}}; \ No newline at end of file +var _0x390d=['length','faxMessage:','./faxMessage.events','save','remove','update','removeListener','register'];(function(_0x292c4a,_0x52a22c){var _0x199f2d=function(_0x306153){while(--_0x306153){_0x292c4a['push'](_0x292c4a['shift']());}};_0x199f2d(++_0x52a22c);}(_0x390d,0xba));var _0xd390=function(_0x27f105,_0x312e86){_0x27f105=_0x27f105-0x0;var _0x42968a=_0x390d[_0x27f105];return _0x42968a;};'use strict';var FaxMessageEvents=require(_0xd390('0x0'));var events=[_0xd390('0x1'),_0xd390('0x2'),_0xd390('0x3')];function createListener(_0x1c5859,_0x492ee1){return function(_0x46ea17){_0x492ee1['emit'](_0x1c5859,_0x46ea17);};}function removeListener(_0xaaf952,_0x15781c){return function(){FaxMessageEvents[_0xd390('0x4')](_0xaaf952,_0x15781c);};}exports[_0xd390('0x5')]=function(_0x419281){for(var _0x251660=0x0,_0x51ad54=events[_0xd390('0x6')];_0x251660<_0x51ad54;_0x251660++){var _0x3b79ca=events[_0x251660];var _0x45089f=createListener(_0xd390('0x7')+_0x3b79ca,_0x419281);FaxMessageEvents['on'](_0x3b79ca,_0x45089f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index b34655c..5880502 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 _0xeffd=['./faxMessage.controller','get','isAuthenticated','index','/describe','describe','show','download','post','tracked','fax','faxmessage:create','create','/:id','put','accept','/:id/reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4066c4,_0x840cfe){var _0xb9c135=function(_0x175f75){while(--_0x175f75){_0x4066c4['push'](_0x4066c4['shift']());}};_0xb9c135(++_0x840cfe);}(_0xeffd,0x6b));var _0xdeff=function(_0x3b7785,_0x432897){_0x3b7785=_0x3b7785-0x0;var _0x2ede21=_0xeffd[_0x3b7785];return _0x2ede21;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var fs_extra=require(_0xdeff('0x5'));var auth=require(_0xdeff('0x6'));var interaction=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var controller=require(_0xdeff('0x9'));router[_0xdeff('0xa')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0xc')]);router[_0xdeff('0xa')](_0xdeff('0xd'),auth[_0xdeff('0xb')](),controller[_0xdeff('0xe')]);router[_0xdeff('0xa')]('/:id',auth[_0xdeff('0xb')](),controller[_0xdeff('0xf')]);router[_0xdeff('0xa')]('/:id/download',auth[_0xdeff('0xb')](),controller[_0xdeff('0x10')]);router[_0xdeff('0x11')]('/',auth[_0xdeff('0xb')](),interaction[_0xdeff('0x12')](_0xdeff('0x13'),_0xdeff('0x14')),controller[_0xdeff('0x15')]);router['put'](_0xdeff('0x16'),auth[_0xdeff('0xb')](),controller['update']);router[_0xdeff('0x17')]('/:id/accept',auth['isAuthenticated'](),controller[_0xdeff('0x18')]);router[_0xdeff('0x17')](_0xdeff('0x19'),auth[_0xdeff('0xb')](),controller['reject']);router[_0xdeff('0x1a')](_0xdeff('0x16'),auth[_0xdeff('0xb')](),controller[_0xdeff('0x1b')]);module[_0xdeff('0x1c')]=router; \ No newline at end of file +var _0xbdb7=['accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','index','get','describe','show','/:id/download','isAuthenticated','download','post','tracked','put','/:id','update'];(function(_0x215cf6,_0x1fb7a0){var _0x545e05=function(_0x2b9951){while(--_0x2b9951){_0x215cf6['push'](_0x215cf6['shift']());}};_0x545e05(++_0x1fb7a0);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x41bd0d,_0x283017){_0x41bd0d=_0x41bd0d-0x0;var _0x5a4f5d=_0xbdb7[_0x41bd0d];return _0x5a4f5d;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')]('/',auth[_0x7bdb('0xf')](),interaction[_0x7bdb('0x12')]('fax','faxmessage:create'),controller['create']);router[_0x7bdb('0x13')](_0x7bdb('0x14'),auth['isAuthenticated'](),controller[_0x7bdb('0x15')]);router['put']('/:id/accept',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x7bdb('0x17')]);router[_0x7bdb('0x18')](_0x7bdb('0x14'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x19')]);module[_0x7bdb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 9983f9d..dd02a50 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 _0xc00b=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x241ce5,_0x5b5737){var _0x1774aa=function(_0x3a53b1){while(--_0x3a53b1){_0x241ce5['push'](_0x241ce5['shift']());}};_0x1774aa(++_0x5b5737);}(_0xc00b,0x1e5));var _0xbc00=function(_0x4f53a6,_0x582ff5){_0x4f53a6=_0x4f53a6-0x0;var _0x30e4b7=_0xc00b[_0x4f53a6];return _0x30e4b7;};'use strict';var Sequelize=require(_0xbc00('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbc00('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbc00('0x2')](_0xbc00('0x3'),_0xbc00('0x4'),_0xbc00('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2a2d=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x153b0b,_0x374113){var _0x490fa9=function(_0x756736){while(--_0x756736){_0x153b0b['push'](_0x153b0b['shift']());}};_0x490fa9(++_0x374113);}(_0x2a2d,0x1c7));var _0xd2a2=function(_0x32fe22,_0x5287d6){_0x32fe22=_0x32fe22-0x0;var _0x319ba7=_0x2a2d[_0x32fe22];return _0x319ba7;};'use strict';var Sequelize=require('sequelize');module[_0xd2a2('0x0')]={'name':{'type':Sequelize[_0xd2a2('0x1')],'unique':_0xd2a2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd2a2('0x1')]},'timeout':{'type':Sequelize[_0xd2a2('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd2a2('0x4')](_0xd2a2('0x5'),_0xd2a2('0x6'),_0xd2a2('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd2a2('0x3')],'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 6ad5b7a..729f85b 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 _0xd6a2=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','FaxQueues','sendStatus','error','stack','name','send','map','FaxQueue','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','rows','catch','show','params','include','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','rawAttributes','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','forEach','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','request-promise','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5d46b6,_0x2eec71){var _0x23ce81=function(_0x57708b){while(--_0x57708b){_0x5d46b6['push'](_0x5d46b6['shift']());}};_0x23ce81(++_0x2eec71);}(_0xd6a2,0x1a5));var _0x2d6a=function(_0x71649a,_0x28ae87){_0x71649a=_0x71649a-0x0;var _0x5c8c08=_0xd6a2[_0x71649a];return _0x5c8c08;};'use strict';var emlformat=require(_0x2d6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d6a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2d6a('0x3'));var util=require('util');var path=require(_0x2d6a('0x4'));var sox=require(_0x2d6a('0x5'));var csv=require('to-csv');var ejs=require(_0x2d6a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d6a('0x7'));var squel=require(_0x2d6a('0x8'));var crypto=require(_0x2d6a('0x9'));var jsforce=require(_0x2d6a('0xa'));var deskjs=require(_0x2d6a('0xb'));var toCsv=require(_0x2d6a('0xc'));var querystring=require(_0x2d6a('0xd'));var Papa=require(_0x2d6a('0xe'));var Redis=require(_0x2d6a('0xf'));var authService=require(_0x2d6a('0x10'));var qs=require(_0x2d6a('0x11'));var as=require(_0x2d6a('0x12'));var hardwareService=require(_0x2d6a('0x13'));var logger=require(_0x2d6a('0x14'))('api');var utils=require(_0x2d6a('0x15'));var config=require(_0x2d6a('0x16'));var licenseUtil=require(_0x2d6a('0x17'));var db=require(_0x2d6a('0x18'))['db'];config[_0x2d6a('0x19')]=_[_0x2d6a('0x1a')](config[_0x2d6a('0x19')],{'host':_0x2d6a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2d6a('0x19')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x22a449,_0x3f1680){_0x3f1680=_0x3f1680||0xcc;return function(_0xe19c7b){if(_0xe19c7b){return _0x22a449['sendStatus'](_0x3f1680);}return _0x22a449[_0x2d6a('0x1c')](_0x3f1680)[_0x2d6a('0x1d')]();};}function respondWithResult(_0x32be34,_0x534676){_0x534676=_0x534676||0xc8;return function(_0x35ec0e){if(_0x35ec0e){return _0x32be34[_0x2d6a('0x1c')](_0x534676)[_0x2d6a('0x1e')](_0x35ec0e);}};}function respondWithFilteredResult(_0xc067f2,_0x244364){return function(_0x5456a5){if(_0x5456a5){var _0x3108e2=typeof _0x244364[_0x2d6a('0x1f')]===_0x2d6a('0x20')&&typeof _0x244364[_0x2d6a('0x21')]===_0x2d6a('0x20');var _0x11a867=_0x5456a5[_0x2d6a('0x22')];var _0x12ad38=_0x3108e2?0x0:_0x244364[_0x2d6a('0x1f')];var _0x2febdc=_0x3108e2?_0x5456a5[_0x2d6a('0x22')]:_0x244364['offset']+_0x244364[_0x2d6a('0x21')];var _0x351e80;if(_0x2febdc>=_0x11a867){_0x2febdc=_0x11a867;_0x351e80=0xc8;}else{_0x351e80=0xce;}_0xc067f2[_0x2d6a('0x1c')](_0x351e80);return _0xc067f2[_0x2d6a('0x23')](_0x2d6a('0x24'),_0x12ad38+'-'+_0x2febdc+'/'+_0x11a867)[_0x2d6a('0x1e')](_0x5456a5);}return null;};}function patchUpdates(_0x5c13fb){return function(_0x43f92e){try{jsonpatch[_0x2d6a('0x25')](_0x43f92e,_0x5c13fb,!![]);}catch(_0x2fbe82){return BPromise[_0x2d6a('0x26')](_0x2fbe82);}return _0x43f92e[_0x2d6a('0x27')]();};}function saveUpdates(_0x2ef704,_0x2e187b){return function(_0xcfd6e5){if(_0xcfd6e5){return _0xcfd6e5[_0x2d6a('0x28')](_0x2ef704)['then'](function(_0x2606d2){return _0x2606d2;});}return null;};}function removeEntity(_0x3a9701,_0x36b9b6){return function(_0x51dd62){if(_0x51dd62){return _0x51dd62[_0x2d6a('0x29')]()[_0x2d6a('0x2a')](function(){var _0x3d38d1=_0x51dd62['get']({'plain':!![]});var _0x5a6266=_0x2d6a('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x5a6266,'resourceId':_0x3d38d1['id']}})[_0x2d6a('0x2a')](function(){return _0x51dd62;});})[_0x2d6a('0x2a')](function(){_0x3a9701[_0x2d6a('0x1c')](0xcc)[_0x2d6a('0x1d')]();});}};}function handleEntityNotFound(_0x3d17b6,_0x35f8bc){return function(_0x3fa143){if(!_0x3fa143){_0x3d17b6[_0x2d6a('0x2c')](0x194);}return _0x3fa143;};}function handleError(_0x1e545d,_0x1e9aa2){_0x1e9aa2=_0x1e9aa2||0x1f4;return function(_0x18f3fb){logger[_0x2d6a('0x2d')](_0x18f3fb[_0x2d6a('0x2e')]);if(_0x18f3fb['name']){delete _0x18f3fb[_0x2d6a('0x2f')];}_0x1e545d[_0x2d6a('0x1c')](_0x1e9aa2)[_0x2d6a('0x30')](_0x18f3fb);};}exports['index']=function(_0x3aacd9,_0xf9008a){var _0x29457c={},_0x3932f6={},_0x5b3a37={'count':0x0,'rows':[]};var _0x250bd1=_[_0x2d6a('0x31')](db[_0x2d6a('0x32')]['rawAttributes'],function(_0x483630){return{'name':_0x483630['fieldName'],'type':_0x483630[_0x2d6a('0x33')][_0x2d6a('0x34')]};});_0x3932f6[_0x2d6a('0x35')]=_[_0x2d6a('0x31')](_0x250bd1,_0x2d6a('0x2f'));_0x3932f6[_0x2d6a('0x36')]=_[_0x2d6a('0x37')](_0x3aacd9['query']);_0x3932f6[_0x2d6a('0x38')]=_['intersection'](_0x3932f6[_0x2d6a('0x35')],_0x3932f6['query']);_0x29457c[_0x2d6a('0x39')]=_[_0x2d6a('0x3a')](_0x3932f6[_0x2d6a('0x35')],qs[_0x2d6a('0x3b')](_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x3b')]));_0x29457c[_0x2d6a('0x39')]=_0x29457c['attributes'][_0x2d6a('0x3c')]?_0x29457c['attributes']:_0x3932f6['model'];if(!_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x3d')](_0x2d6a('0x3e'))){_0x29457c['limit']=qs[_0x2d6a('0x21')](_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x21')]);_0x29457c['offset']=qs['offset'](_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x1f')]);}_0x29457c[_0x2d6a('0x3f')]=qs[_0x2d6a('0x40')](_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x40')]);_0x29457c['where']=qs[_0x2d6a('0x38')](_[_0x2d6a('0x41')](_0x3aacd9[_0x2d6a('0x36')],_0x3932f6[_0x2d6a('0x38')]),_0x250bd1);if(_0x3aacd9[_0x2d6a('0x36')][_0x2d6a('0x42')]){_0x29457c[_0x2d6a('0x43')]=_['merge'](_0x29457c[_0x2d6a('0x43')],{'$or':_[_0x2d6a('0x31')](_0x250bd1,function(_0x525d9a){if(_0x525d9a[_0x2d6a('0x33')]!==_0x2d6a('0x44')){var _0x5c91ab={};_0x5c91ab[_0x525d9a['name']]={'$like':'%'+_0x3aacd9['query'][_0x2d6a('0x42')]+'%'};return _0x5c91ab;}})});}_0x29457c=_['merge']({},_0x29457c,_0x3aacd9['options']);var _0x2a07e2={'where':_0x29457c[_0x2d6a('0x43')]};return db[_0x2d6a('0x32')][_0x2d6a('0x22')](_0x2a07e2)['then'](function(_0x49b0f2){_0x5b3a37[_0x2d6a('0x22')]=_0x49b0f2;if(_0x3aacd9['query'][_0x2d6a('0x45')]){_0x29457c['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x29457c);})[_0x2d6a('0x2a')](function(_0x88cdf9){_0x5b3a37[_0x2d6a('0x46')]=_0x88cdf9;return _0x5b3a37;})[_0x2d6a('0x2a')](respondWithFilteredResult(_0xf9008a,_0x29457c))[_0x2d6a('0x47')](handleError(_0xf9008a,null));};exports[_0x2d6a('0x48')]=function(_0x226b3c,_0x8f2d10){var _0x429d92={'raw':!![],'where':{'id':_0x226b3c[_0x2d6a('0x49')]['id']}},_0x52a728={};_0x52a728[_0x2d6a('0x35')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x52a728[_0x2d6a('0x36')]=_[_0x2d6a('0x37')](_0x226b3c[_0x2d6a('0x36')]);_0x52a728['filters']=_[_0x2d6a('0x3a')](_0x52a728[_0x2d6a('0x35')],_0x52a728[_0x2d6a('0x36')]);_0x429d92['attributes']=_[_0x2d6a('0x3a')](_0x52a728[_0x2d6a('0x35')],qs[_0x2d6a('0x3b')](_0x226b3c[_0x2d6a('0x36')][_0x2d6a('0x3b')]));_0x429d92['attributes']=_0x429d92[_0x2d6a('0x39')]['length']?_0x429d92[_0x2d6a('0x39')]:_0x52a728[_0x2d6a('0x35')];if(_0x226b3c[_0x2d6a('0x36')][_0x2d6a('0x45')]){_0x429d92[_0x2d6a('0x4a')]=[{'all':!![]}];}_0x429d92=_[_0x2d6a('0x4b')]({},_0x429d92,_0x226b3c[_0x2d6a('0x4c')]);return db[_0x2d6a('0x32')][_0x2d6a('0x4d')](_0x429d92)[_0x2d6a('0x2a')](handleEntityNotFound(_0x8f2d10,null))[_0x2d6a('0x2a')](respondWithResult(_0x8f2d10,null))[_0x2d6a('0x47')](handleError(_0x8f2d10,null));};exports[_0x2d6a('0x4e')]=function(_0x165e7a,_0x2395ad){return db[_0x2d6a('0x32')][_0x2d6a('0x4e')](_0x165e7a[_0x2d6a('0x4f')],{})[_0x2d6a('0x2a')](function(_0x348ab1){var _0x4f5140=_0x165e7a['user']['get']({'plain':!![]});if(!_0x4f5140)throw new Error(_0x2d6a('0x50'));if(_0x4f5140[_0x2d6a('0x51')]===_0x2d6a('0x52')){var _0xb98396=_0x348ab1[_0x2d6a('0x53')]({'plain':!![]});var _0x1aa053='FaxQueues';return db[_0x2d6a('0x54')][_0x2d6a('0x4d')]({'where':{'name':_0x1aa053,'userProfileId':_0x4f5140['userProfileId']},'raw':!![]})[_0x2d6a('0x2a')](function(_0xc99f13){if(_0xc99f13&&_0xc99f13[_0x2d6a('0x55')]===0x0){return db[_0x2d6a('0x56')][_0x2d6a('0x4e')]({'name':_0xb98396[_0x2d6a('0x2f')],'resourceId':_0xb98396['id'],'type':_0xc99f13[_0x2d6a('0x2f')],'sectionId':_0xc99f13['id']},{})['then'](function(){return _0x348ab1;});}else{return _0x348ab1;}})['catch'](function(_0x5ae23d){logger[_0x2d6a('0x2d')](_0x2d6a('0x57'),_0x5ae23d);throw _0x5ae23d;});}return _0x348ab1;})[_0x2d6a('0x2a')](respondWithResult(_0x2395ad,0xc9))[_0x2d6a('0x47')](handleError(_0x2395ad,null));};exports[_0x2d6a('0x28')]=function(_0x40c3eb,_0x22ee03){if(_0x40c3eb[_0x2d6a('0x4f')]['id']){delete _0x40c3eb[_0x2d6a('0x4f')]['id'];}return db[_0x2d6a('0x32')][_0x2d6a('0x4d')]({'where':{'id':_0x40c3eb[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x22ee03,null))[_0x2d6a('0x2a')](saveUpdates(_0x40c3eb[_0x2d6a('0x4f')],null))['then'](respondWithResult(_0x22ee03,null))['catch'](handleError(_0x22ee03,null));};exports[_0x2d6a('0x29')]=function(_0x368b9e,_0x5241d4){return db[_0x2d6a('0x32')][_0x2d6a('0x4d')]({'where':{'id':_0x368b9e[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x5241d4,null))['then'](removeEntity(_0x5241d4,null))[_0x2d6a('0x47')](handleError(_0x5241d4,null));};exports[_0x2d6a('0x58')]=function(_0x4a7830,_0x3c9192){return db[_0x2d6a('0x32')]['describe']()[_0x2d6a('0x2a')](respondWithResult(_0x3c9192,null))['catch'](handleError(_0x3c9192,null));};exports[_0x2d6a('0x59')]=function(_0x2dc9e1,_0x140527,_0xe85bfe){var _0x2f70b6={'raw':!![],'where':{}},_0x16fed7={},_0x570e6f;return db['FaxQueue'][_0x2d6a('0x5a')]({'where':{'id':_0x2dc9e1[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x140527,null))[_0x2d6a('0x2a')](function(_0x1ba4ad){if(_0x1ba4ad){_0x570e6f=_0x1ba4ad[_0x2d6a('0x53')]({'plain':!![]});_0x16fed7[_0x2d6a('0x35')]=_['keys'](db[_0x2d6a('0x5b')][_0x2d6a('0x5c')]);_0x16fed7[_0x2d6a('0x36')]=_[_0x2d6a('0x37')](_0x2dc9e1['query']);_0x16fed7[_0x2d6a('0x38')]=_[_0x2d6a('0x3a')](_0x16fed7[_0x2d6a('0x35')],_0x16fed7[_0x2d6a('0x36')]);_0x2f70b6['attributes']=_[_0x2d6a('0x3a')](_0x16fed7['model'],qs[_0x2d6a('0x3b')](_0x2dc9e1[_0x2d6a('0x36')][_0x2d6a('0x3b')]));_0x2f70b6[_0x2d6a('0x39')]=_0x2f70b6['attributes'][_0x2d6a('0x3c')]?_0x2f70b6[_0x2d6a('0x39')]:_0x16fed7[_0x2d6a('0x35')];if(!_0x2dc9e1[_0x2d6a('0x36')][_0x2d6a('0x3d')](_0x2d6a('0x3e'))){_0x2f70b6[_0x2d6a('0x21')]=qs['limit'](_0x2dc9e1['query']['limit']);_0x2f70b6[_0x2d6a('0x1f')]=qs[_0x2d6a('0x1f')](_0x2dc9e1['query'][_0x2d6a('0x1f')]);}_0x2f70b6['order']=qs[_0x2d6a('0x40')](_0x2dc9e1[_0x2d6a('0x36')][_0x2d6a('0x40')]);_0x2f70b6[_0x2d6a('0x43')]=qs['filters'](_['pick'](_0x2dc9e1[_0x2d6a('0x36')],_0x16fed7[_0x2d6a('0x38')]));_0x2f70b6[_0x2d6a('0x43')][_0x2d6a('0x5d')]=_0x1ba4ad['id'];if(_0x2dc9e1['query']['filter']){_0x2f70b6['where']=_['merge'](_0x2f70b6['where'],{'$or':_['map'](_0x2f70b6['attributes'],function(_0x11e505){var _0x4d379a={};_0x4d379a[_0x11e505]={'$like':'%'+_0x2dc9e1[_0x2d6a('0x36')][_0x2d6a('0x42')]+'%'};return _0x4d379a;})});}_0x2f70b6=_[_0x2d6a('0x4b')]({},_0x2f70b6,_0x2dc9e1[_0x2d6a('0x4c')]);return db[_0x2d6a('0x5b')][_0x2d6a('0x5e')](_0x2f70b6);}})['then'](function(_0x26d27d){if(_0x26d27d){return db[_0x2d6a('0x5f')][_0x2d6a('0x60')]({'where':{'id':_['map'](_0x26d27d,_0x2d6a('0x61')),'role':_0x2d6a('0x62')},'attributes':['id','name',_0x2d6a('0x63'),'updatedAt',_0x2d6a('0x64')]});}})['then'](function(_0x2e6b73){if(_0x2e6b73){return{'count':_0x2e6b73[_0x2d6a('0x22')],'rows':_['map'](_0x2e6b73[_0x2d6a('0x46')],function(_0xcb84e2){return{'membername':_0xcb84e2[_0x2d6a('0x2f')],'UserId':_0xcb84e2['id'],'queue_name':_0x570e6f[_0x2d6a('0x2f')],'FaxQueueId':_0x570e6f['id'],'interface':util['format'](_0x2d6a('0x65'),_0x2d6a('0x66'),_0xcb84e2[_0x2d6a('0x2f')]),'penalty':0x0,'paused':_0xcb84e2[_0x2d6a('0x63')],'createdAt':_0xcb84e2[_0x2d6a('0x64')],'updatedAt':_0xcb84e2[_0x2d6a('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x140527,_0x2f70b6))[_0x2d6a('0x47')](handleError(_0x140527,null));};exports[_0x2d6a('0x68')]=function(_0x5e918e,_0x125d3f,_0xc9957a){var _0x3c494e={};var _0x568f0f={};var _0x2e376b;var _0x1d86df;return db[_0x2d6a('0x32')][_0x2d6a('0x5a')]({'where':{'id':_0x5e918e[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x125d3f,null))[_0x2d6a('0x2a')](function(_0x3da32a){if(_0x3da32a){_0x2e376b=_0x3da32a;_0x568f0f[_0x2d6a('0x35')]=_[_0x2d6a('0x37')](db[_0x2d6a('0x69')][_0x2d6a('0x5c')]);_0x568f0f[_0x2d6a('0x36')]=_['keys'](_0x5e918e[_0x2d6a('0x36')]);_0x568f0f[_0x2d6a('0x38')]=_[_0x2d6a('0x3a')](_0x568f0f[_0x2d6a('0x35')],_0x568f0f[_0x2d6a('0x36')]);_0x3c494e[_0x2d6a('0x39')]=_[_0x2d6a('0x3a')](_0x568f0f[_0x2d6a('0x35')],qs['fields'](_0x5e918e[_0x2d6a('0x36')][_0x2d6a('0x3b')]));_0x3c494e[_0x2d6a('0x39')]=_0x3c494e[_0x2d6a('0x39')]['length']?_0x3c494e[_0x2d6a('0x39')]:_0x568f0f[_0x2d6a('0x35')];_0x3c494e[_0x2d6a('0x3f')]=qs[_0x2d6a('0x40')](_0x5e918e[_0x2d6a('0x36')]['sort']);_0x3c494e[_0x2d6a('0x43')]=qs['filters'](_[_0x2d6a('0x41')](_0x5e918e[_0x2d6a('0x36')],_0x568f0f[_0x2d6a('0x38')]));if(_0x5e918e['query']['filter']){_0x3c494e[_0x2d6a('0x43')]=_[_0x2d6a('0x4b')](_0x3c494e[_0x2d6a('0x43')],{'$or':_[_0x2d6a('0x31')](_0x3c494e[_0x2d6a('0x39')],function(_0x29a67a){var _0x3a8ba7={};_0x3a8ba7[_0x29a67a]={'$like':'%'+_0x5e918e[_0x2d6a('0x36')][_0x2d6a('0x42')]+'%'};return _0x3a8ba7;})});}_0x3c494e=_['merge']({},_0x3c494e,_0x5e918e[_0x2d6a('0x4c')]);return _0x2e376b[_0x2d6a('0x68')](_0x3c494e);}})['then'](function(_0x12012f){if(_0x12012f){_0x1d86df=_0x12012f[_0x2d6a('0x3c')];if(!_0x5e918e[_0x2d6a('0x36')][_0x2d6a('0x3d')](_0x2d6a('0x3e'))){_0x3c494e[_0x2d6a('0x21')]=qs[_0x2d6a('0x21')](_0x5e918e[_0x2d6a('0x36')]['limit']);_0x3c494e[_0x2d6a('0x1f')]=qs[_0x2d6a('0x1f')](_0x5e918e['query']['offset']);}return _0x2e376b['getTeams'](_0x3c494e);}})['then'](function(_0x364c46){if(_0x364c46){return _0x364c46?{'count':_0x1d86df,'rows':_0x364c46}:null;}})['then'](respondWithResult(_0x125d3f,null))['catch'](handleError(_0x125d3f,null));};exports[_0x2d6a('0x6a')]=function(_0x43d173,_0x35a223,_0x34fd89){var _0x1651f9=_0x43d173[_0x2d6a('0x4f')][_0x2d6a('0x6b')];return db[_0x2d6a('0x69')][_0x2d6a('0x5e')]({'where':{'id':_0x1651f9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2d6a('0x6c'),'attributes':['id',_0x2d6a('0x2f'),_0x2d6a('0x6d'),'voicePause',_0x2d6a('0x6e')],'raw':!![]}]})[_0x2d6a('0x2a')](function(_0x32a79d){if(_0x32a79d){var _0x5b578e=_[_0x2d6a('0x6f')](_0x32a79d,function(_0x3dba6e){var _0x4ea0a7=_0x3dba6e['get']({'plain':!![]});return _0x4ea0a7[_0x2d6a('0x6c')];});return db[_0x2d6a('0x32')][_0x2d6a('0x4d')]({'where':{'id':_0x43d173[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](function(_0x15a4f2){return db[_0x2d6a('0x70')][_0x2d6a('0x71')](function(_0x19b826){return _0x15a4f2[_0x2d6a('0x6a')](_0x1651f9,{'transaction':_0x19b826})[_0x2d6a('0x2a')](function(){return BPromise[_0x2d6a('0x72')](_0x5b578e,function(_0x3b35ae){return db[_0x2d6a('0x5b')][_0x2d6a('0x73')]({'where':{'UserId':_0x3b35ae['id'],'FaxQueueId':_0x43d173[_0x2d6a('0x49')]['id']},'transaction':_0x19b826});});})['then'](function(){_0x5b578e['forEach'](function(_0x1c5e32){socket[_0x2d6a('0x74')](_0x2d6a('0x75'),{'UserId':_0x1c5e32['id'],'FaxQueueId':_0x15a4f2['id']});});});});});}})[_0x2d6a('0x2a')](respondWithStatusCode(_0x35a223,null))[_0x2d6a('0x47')](handleError(_0x35a223,null));};exports[_0x2d6a('0x76')]=function(_0x3603d6,_0x2a7674,_0x1f20d8){return db['Team'][_0x2d6a('0x5e')]({'where':{'id':_0x3603d6[_0x2d6a('0x36')][_0x2d6a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x2d6a('0x5f')],'as':_0x2d6a('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x2d6a('0x2a')](handleEntityNotFound(_0x2a7674,null))['then'](function(_0x5701cb){var _0x1ee4c6=_['map'](_0x5701cb,'id');var _0x1e0d89=[];var _0x3b97f0=[];var _0x1e1e9f=squel['select']();_0x1e1e9f[_0x2d6a('0x77')](_0x2d6a('0x78'))[_0x2d6a('0x79')](_0x2d6a('0x7a'),'tq')[_0x2d6a('0x7b')](_0x2d6a('0x7c'),'ut',_0x2d6a('0x7d'))[_0x2d6a('0x43')](_0x2d6a('0x7e'),_0x3603d6[_0x2d6a('0x49')]['id']);for(var _0xf1fd46=0x0;_0xf1fd46<_0x5701cb[_0x2d6a('0x3c')];_0xf1fd46+=0x1){let _0x46e7b1=_0x5701cb[_0xf1fd46];for(var _0x5778a4=0x0;_0x5778a4<_0x46e7b1[_0x2d6a('0x6c')][_0x2d6a('0x3c')];_0x5778a4+=0x1){let _0x4f46e4=_0x46e7b1[_0x2d6a('0x6c')][_0x5778a4];var _0x1aff86=_0x1e1e9f[_0x2d6a('0x7f')]();_0x1aff86[_0x2d6a('0x43')](_0x2d6a('0x80'),_0x4f46e4['id']);_0x3b97f0[_0x2d6a('0x81')](db['sequelize'][_0x2d6a('0x36')](_0x1aff86[_0x2d6a('0x82')](),{'type':db[_0x2d6a('0x70')][_0x2d6a('0x83')][_0x2d6a('0x84')]})[_0x2d6a('0x2a')](function(_0x9a5b38){if(_0x9a5b38['length']===0x1){return _0x4f46e4['id'];}else{var _0x281080=_[_0x2d6a('0x85')](_['map'](_0x9a5b38,'TeamId'),function(_0x4dd4b9){return _[_0x2d6a('0x86')](_0x1ee4c6,_0x4dd4b9);});if(_0x281080){return _0x4f46e4['id'];}}}));}}return BPromise[_0x2d6a('0x87')](_0x3b97f0)[_0x2d6a('0x2a')](function(_0x362aa3){_0x1e0d89=_(_0x1e0d89)[_0x2d6a('0x88')](_0x362aa3)[_0x2d6a('0x89')]()[_0x2d6a('0x8a')]();return db[_0x2d6a('0x32')]['find']({'where':{'id':_0x3603d6[_0x2d6a('0x49')]['id']}})[_0x2d6a('0x2a')](function(_0x32d21b){return db[_0x2d6a('0x70')][_0x2d6a('0x71')](function(_0x3cef5a){return _0x32d21b['removeTeams'](_0x3603d6['query'][_0x2d6a('0x6b')],{'transaction':_0x3cef5a})['then'](function(){if(!_['isEmpty'](_0x1e0d89)){return _0x32d21b['removeAgents'](_0x1e0d89,{'transaction':_0x3cef5a});}})['then'](function(){_0x1e0d89[_0x2d6a('0x8b')](function(_0x2122f6){socket[_0x2d6a('0x74')](_0x2d6a('0x8c'),{'UserId':_0x2122f6,'FaxQueueId':_0x32d21b['id']});});});});});});})[_0x2d6a('0x2a')](respondWithStatusCode(_0x2a7674,null))[_0x2d6a('0x47')](handleError(_0x2a7674,null));};exports[_0x2d6a('0x8d')]=function(_0x4984cb,_0x73a735,_0x50d7aa){return db['FaxQueue']['find']({'where':{'id':_0x4984cb['params']['id']}})['then'](handleEntityNotFound(_0x73a735,null))[_0x2d6a('0x2a')](function(_0x2dce78){if(_0x2dce78){return _0x2dce78[_0x2d6a('0x8d')](_0x4984cb[_0x2d6a('0x4f')][_0x2d6a('0x6b')],_[_0x2d6a('0x8e')](_0x4984cb[_0x2d6a('0x4f')],['ids','id'])||{})[_0x2d6a('0x8f')](function(_0x5e77ab){for(var _0x38a501=0x0;_0x38a501<_0x4984cb[_0x2d6a('0x4f')][_0x2d6a('0x6b')]['length'];_0x38a501+=0x1){socket['emit'](_0x2d6a('0x75'),{'UserId':Number(_0x4984cb[_0x2d6a('0x4f')][_0x2d6a('0x6b')][_0x38a501]),'FaxQueueId':Number(_0x4984cb[_0x2d6a('0x49')]['id'])});}return _0x5e77ab;});}})[_0x2d6a('0x2a')](respondWithResult(_0x73a735,null))[_0x2d6a('0x47')](handleError(_0x73a735,null));};exports[_0x2d6a('0x90')]=function(_0x3df575,_0x54fbb1,_0x314cd2){return db[_0x2d6a('0x32')][_0x2d6a('0x4d')]({'where':{'id':_0x3df575['params']['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x54fbb1,null))[_0x2d6a('0x2a')](function(_0xad46d0){if(_0xad46d0){return _0xad46d0[_0x2d6a('0x90')](_0x3df575[_0x2d6a('0x36')][_0x2d6a('0x6b')])[_0x2d6a('0x2a')](function(){if(_[_0x2d6a('0x91')](_0x3df575[_0x2d6a('0x36')]['ids'])){for(var _0x27f169=0x0;_0x27f169<_0x3df575[_0x2d6a('0x36')][_0x2d6a('0x6b')][_0x2d6a('0x3c')];_0x27f169+=0x1){socket['emit'](_0x2d6a('0x8c'),{'UserId':Number(_0x3df575['query']['ids'][_0x27f169]),'FaxQueueId':Number(_0x3df575[_0x2d6a('0x49')]['id'])});}}else{socket['emit'](_0x2d6a('0x8c'),{'UserId':Number(_0x3df575['query'][_0x2d6a('0x6b')]),'FaxQueueId':Number(_0x3df575[_0x2d6a('0x49')]['id'])});}});}})[_0x2d6a('0x2a')](respondWithStatusCode(_0x54fbb1,null))['catch'](handleError(_0x54fbb1,null));};exports['getAgents']=function(_0x5b8a16,_0x131aaf,_0x1fbdeb){var _0x1638ee={};var _0x2ea582={};var _0x46c043;var _0x10ddbc;return db['FaxQueue'][_0x2d6a('0x5a')]({'where':{'id':_0x5b8a16['params']['id']}})[_0x2d6a('0x2a')](handleEntityNotFound(_0x131aaf,null))[_0x2d6a('0x2a')](function(_0x4b5f93){if(_0x4b5f93){_0x46c043=_0x4b5f93;_0x2ea582[_0x2d6a('0x35')]=_[_0x2d6a('0x37')](db[_0x2d6a('0x5f')][_0x2d6a('0x5c')]);_0x2ea582[_0x2d6a('0x36')]=_['keys'](_0x5b8a16[_0x2d6a('0x36')]);_0x2ea582[_0x2d6a('0x38')]=_[_0x2d6a('0x3a')](_0x2ea582['model'],_0x2ea582[_0x2d6a('0x36')]);_0x1638ee[_0x2d6a('0x39')]=_[_0x2d6a('0x3a')](_0x2ea582[_0x2d6a('0x35')],qs['fields'](_0x5b8a16[_0x2d6a('0x36')]['fields']));_0x1638ee[_0x2d6a('0x39')]=_0x1638ee[_0x2d6a('0x39')][_0x2d6a('0x3c')]?_0x1638ee[_0x2d6a('0x39')]:_0x2ea582[_0x2d6a('0x35')];_0x1638ee[_0x2d6a('0x3f')]=qs[_0x2d6a('0x40')](_0x5b8a16['query'][_0x2d6a('0x40')]);_0x1638ee['where']=qs[_0x2d6a('0x38')](_[_0x2d6a('0x41')](_0x5b8a16['query'],_0x2ea582['filters']));if(_0x5b8a16[_0x2d6a('0x36')][_0x2d6a('0x42')]){_0x1638ee[_0x2d6a('0x43')]=_[_0x2d6a('0x4b')](_0x1638ee[_0x2d6a('0x43')],{'$or':_[_0x2d6a('0x31')](_0x1638ee[_0x2d6a('0x39')],function(_0x488011){var _0x395103={};_0x395103[_0x488011]={'$like':'%'+_0x5b8a16[_0x2d6a('0x36')]['filter']+'%'};return _0x395103;})});}_0x1638ee=_[_0x2d6a('0x4b')]({},_0x1638ee,_0x5b8a16['options']);return _0x46c043[_0x2d6a('0x92')](_0x1638ee);}})[_0x2d6a('0x2a')](function(_0x557cd3){if(_0x557cd3){_0x10ddbc=_0x557cd3[_0x2d6a('0x3c')];if(!_0x5b8a16[_0x2d6a('0x36')][_0x2d6a('0x3d')](_0x2d6a('0x3e'))){_0x1638ee[_0x2d6a('0x21')]=qs[_0x2d6a('0x21')](_0x5b8a16[_0x2d6a('0x36')][_0x2d6a('0x21')]);_0x1638ee[_0x2d6a('0x1f')]=qs[_0x2d6a('0x1f')](_0x5b8a16[_0x2d6a('0x36')][_0x2d6a('0x1f')]);}return _0x46c043[_0x2d6a('0x92')](_0x1638ee);}})[_0x2d6a('0x2a')](function(_0x11ae0a){if(_0x11ae0a){return _0x11ae0a?{'count':_0x10ddbc,'rows':_0x11ae0a}:null;}})[_0x2d6a('0x2a')](respondWithResult(_0x131aaf,null))[_0x2d6a('0x47')](handleError(_0x131aaf,null));}; \ No newline at end of file +var _0x7156=['join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserFaxQueue','length','FaxQueueId','User','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','ids','Team','Agents','online','interface','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','team_has_fax_queues'];(function(_0x4ec10e,_0x30b5f9){var _0x2c31d1=function(_0x526bef){while(--_0x526bef){_0x4ec10e['push'](_0x4ec10e['shift']());}};_0x2c31d1(++_0x30b5f9);}(_0x7156,0xa1));var _0x6715=function(_0x35e9cb,_0x4c6166){_0x35e9cb=_0x35e9cb-0x0;var _0x1badc4=_0x7156[_0x35e9cb];return _0x1badc4;};'use strict';var emlformat=require(_0x6715('0x0'));var rimraf=require(_0x6715('0x1'));var zipdir=require(_0x6715('0x2'));var jsonpatch=require(_0x6715('0x3'));var rp=require(_0x6715('0x4'));var moment=require(_0x6715('0x5'));var BPromise=require(_0x6715('0x6'));var Mustache=require(_0x6715('0x7'));var util=require(_0x6715('0x8'));var path=require(_0x6715('0x9'));var sox=require(_0x6715('0xa'));var csv=require('to-csv');var ejs=require(_0x6715('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6715('0xc'));var squel=require('squel');var crypto=require(_0x6715('0xd'));var jsforce=require(_0x6715('0xe'));var deskjs=require(_0x6715('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6715('0x10'));var Redis=require(_0x6715('0x11'));var authService=require(_0x6715('0x12'));var qs=require(_0x6715('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6715('0x14'));var logger=require(_0x6715('0x15'))(_0x6715('0x16'));var utils=require(_0x6715('0x17'));var config=require(_0x6715('0x18'));var licenseUtil=require(_0x6715('0x19'));var db=require(_0x6715('0x1a'))['db'];config[_0x6715('0x1b')]=_[_0x6715('0x1c')](config[_0x6715('0x1b')],{'host':_0x6715('0x1d'),'port':0x18eb});var socket=require(_0x6715('0x1e'))(new Redis(config[_0x6715('0x1b')]));require(_0x6715('0x1f'))[_0x6715('0x20')](socket);function respondWithStatusCode(_0x247264,_0x2d0806){_0x2d0806=_0x2d0806||0xcc;return function(_0x4cbfa0){if(_0x4cbfa0){return _0x247264[_0x6715('0x21')](_0x2d0806);}return _0x247264['status'](_0x2d0806)[_0x6715('0x22')]();};}function respondWithResult(_0x42c243,_0x429a49){_0x429a49=_0x429a49||0xc8;return function(_0x54f1c8){if(_0x54f1c8){return _0x42c243[_0x6715('0x23')](_0x429a49)[_0x6715('0x24')](_0x54f1c8);}};}function respondWithFilteredResult(_0x3ad6eb,_0x4f62d1){return function(_0x4a978f){if(_0x4a978f){var _0x3ba27b=typeof _0x4f62d1[_0x6715('0x25')]===_0x6715('0x26')&&typeof _0x4f62d1[_0x6715('0x27')]===_0x6715('0x26');var _0x37ffb4=_0x4a978f[_0x6715('0x28')];var _0x17ba73=_0x3ba27b?0x0:_0x4f62d1[_0x6715('0x25')];var _0x16b7d5=_0x3ba27b?_0x4a978f[_0x6715('0x28')]:_0x4f62d1[_0x6715('0x25')]+_0x4f62d1[_0x6715('0x27')];var _0xc2af87;if(_0x16b7d5>=_0x37ffb4){_0x16b7d5=_0x37ffb4;_0xc2af87=0xc8;}else{_0xc2af87=0xce;}_0x3ad6eb[_0x6715('0x23')](_0xc2af87);return _0x3ad6eb[_0x6715('0x29')](_0x6715('0x2a'),_0x17ba73+'-'+_0x16b7d5+'/'+_0x37ffb4)[_0x6715('0x24')](_0x4a978f);}return null;};}function patchUpdates(_0x559605){return function(_0x22ef8a){try{jsonpatch[_0x6715('0x2b')](_0x22ef8a,_0x559605,!![]);}catch(_0x4fe986){return BPromise[_0x6715('0x2c')](_0x4fe986);}return _0x22ef8a[_0x6715('0x2d')]();};}function saveUpdates(_0x500089,_0x4a29ac){return function(_0x5b18d8){if(_0x5b18d8){return _0x5b18d8[_0x6715('0x2e')](_0x500089)[_0x6715('0x2f')](function(_0x554a48){return _0x554a48;});}return null;};}function removeEntity(_0x3d104a,_0x408552){return function(_0xb04cc7){if(_0xb04cc7){return _0xb04cc7[_0x6715('0x30')]()[_0x6715('0x2f')](function(){var _0x1f5d36=_0xb04cc7['get']({'plain':!![]});var _0x4e321b='FaxQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x4e321b,'resourceId':_0x1f5d36['id']}})[_0x6715('0x2f')](function(){return _0xb04cc7;});})['then'](function(){_0x3d104a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f9547,_0x527ae2){return function(_0x218ba1){if(!_0x218ba1){_0x4f9547[_0x6715('0x21')](0x194);}return _0x218ba1;};}function handleError(_0x34f05f,_0x41a22e){_0x41a22e=_0x41a22e||0x1f4;return function(_0x23d0e0){logger[_0x6715('0x31')](_0x23d0e0[_0x6715('0x32')]);if(_0x23d0e0['name']){delete _0x23d0e0[_0x6715('0x33')];}_0x34f05f[_0x6715('0x23')](_0x41a22e)[_0x6715('0x34')](_0x23d0e0);};}exports[_0x6715('0x35')]=function(_0x2d1e9c,_0x4fe84b){var _0xf029f2={},_0xb9980a={},_0x2f0ec9={'count':0x0,'rows':[]};var _0x47cbd4=_[_0x6715('0x36')](db[_0x6715('0x37')][_0x6715('0x38')],function(_0x5a012d){return{'name':_0x5a012d['fieldName'],'type':_0x5a012d[_0x6715('0x39')][_0x6715('0x3a')]};});_0xb9980a[_0x6715('0x3b')]=_[_0x6715('0x36')](_0x47cbd4,_0x6715('0x33'));_0xb9980a['query']=_['keys'](_0x2d1e9c[_0x6715('0x3c')]);_0xb9980a[_0x6715('0x3d')]=_[_0x6715('0x3e')](_0xb9980a[_0x6715('0x3b')],_0xb9980a[_0x6715('0x3c')]);_0xf029f2[_0x6715('0x3f')]=_[_0x6715('0x3e')](_0xb9980a[_0x6715('0x3b')],qs[_0x6715('0x40')](_0x2d1e9c[_0x6715('0x3c')][_0x6715('0x40')]));_0xf029f2[_0x6715('0x3f')]=_0xf029f2[_0x6715('0x3f')]['length']?_0xf029f2[_0x6715('0x3f')]:_0xb9980a[_0x6715('0x3b')];if(!_0x2d1e9c[_0x6715('0x3c')][_0x6715('0x41')](_0x6715('0x42'))){_0xf029f2['limit']=qs[_0x6715('0x27')](_0x2d1e9c[_0x6715('0x3c')][_0x6715('0x27')]);_0xf029f2[_0x6715('0x25')]=qs[_0x6715('0x25')](_0x2d1e9c['query'][_0x6715('0x25')]);}_0xf029f2[_0x6715('0x43')]=qs[_0x6715('0x44')](_0x2d1e9c[_0x6715('0x3c')]['sort']);_0xf029f2[_0x6715('0x45')]=qs[_0x6715('0x3d')](_[_0x6715('0x46')](_0x2d1e9c['query'],_0xb9980a[_0x6715('0x3d')]),_0x47cbd4);if(_0x2d1e9c['query'][_0x6715('0x47')]){_0xf029f2[_0x6715('0x45')]=_[_0x6715('0x48')](_0xf029f2[_0x6715('0x45')],{'$or':_['map'](_0x47cbd4,function(_0x5dd87d){if(_0x5dd87d['type']!=='VIRTUAL'){var _0xb395dd={};_0xb395dd[_0x5dd87d[_0x6715('0x33')]]={'$like':'%'+_0x2d1e9c[_0x6715('0x3c')][_0x6715('0x47')]+'%'};return _0xb395dd;}})});}_0xf029f2=_[_0x6715('0x48')]({},_0xf029f2,_0x2d1e9c['options']);var _0x429a3b={'where':_0xf029f2['where']};return db[_0x6715('0x37')]['count'](_0x429a3b)[_0x6715('0x2f')](function(_0xfa4880){_0x2f0ec9[_0x6715('0x28')]=_0xfa4880;if(_0x2d1e9c[_0x6715('0x3c')][_0x6715('0x49')]){_0xf029f2[_0x6715('0x4a')]=[{'all':!![]}];}return db['FaxQueue'][_0x6715('0x4b')](_0xf029f2);})[_0x6715('0x2f')](function(_0x4835db){_0x2f0ec9[_0x6715('0x4c')]=_0x4835db;return _0x2f0ec9;})[_0x6715('0x2f')](respondWithFilteredResult(_0x4fe84b,_0xf029f2))[_0x6715('0x4d')](handleError(_0x4fe84b,null));};exports[_0x6715('0x4e')]=function(_0x120511,_0x174d06){var _0xd55a4f={'raw':!![],'where':{'id':_0x120511['params']['id']}},_0x16d439={};_0x16d439[_0x6715('0x3b')]=_[_0x6715('0x4f')](db[_0x6715('0x37')][_0x6715('0x38')]);_0x16d439[_0x6715('0x3c')]=_[_0x6715('0x4f')](_0x120511[_0x6715('0x3c')]);_0x16d439['filters']=_[_0x6715('0x3e')](_0x16d439[_0x6715('0x3b')],_0x16d439[_0x6715('0x3c')]);_0xd55a4f['attributes']=_[_0x6715('0x3e')](_0x16d439[_0x6715('0x3b')],qs[_0x6715('0x40')](_0x120511['query'][_0x6715('0x40')]));_0xd55a4f[_0x6715('0x3f')]=_0xd55a4f[_0x6715('0x3f')]['length']?_0xd55a4f['attributes']:_0x16d439[_0x6715('0x3b')];if(_0x120511[_0x6715('0x3c')][_0x6715('0x49')]){_0xd55a4f['include']=[{'all':!![]}];}_0xd55a4f=_['merge']({},_0xd55a4f,_0x120511[_0x6715('0x50')]);return db[_0x6715('0x37')][_0x6715('0x51')](_0xd55a4f)['then'](handleEntityNotFound(_0x174d06,null))[_0x6715('0x2f')](respondWithResult(_0x174d06,null))['catch'](handleError(_0x174d06,null));};exports['create']=function(_0x3b90c3,_0x466a97){return db[_0x6715('0x37')][_0x6715('0x52')](_0x3b90c3[_0x6715('0x53')],{})[_0x6715('0x2f')](function(_0x10a262){var _0x2af9d9=_0x3b90c3['user'][_0x6715('0x54')]({'plain':!![]});if(!_0x2af9d9)throw new Error(_0x6715('0x55'));if(_0x2af9d9['role']==='user'){var _0x2c6cd1=_0x10a262[_0x6715('0x54')]({'plain':!![]});var _0x446b0d=_0x6715('0x56');return db[_0x6715('0x57')][_0x6715('0x51')]({'where':{'name':_0x446b0d,'userProfileId':_0x2af9d9['userProfileId']},'raw':!![]})[_0x6715('0x2f')](function(_0x47f1f0){if(_0x47f1f0&&_0x47f1f0['autoAssociation']===0x0){return db['UserProfileResource'][_0x6715('0x52')]({'name':_0x2c6cd1[_0x6715('0x33')],'resourceId':_0x2c6cd1['id'],'type':_0x47f1f0[_0x6715('0x33')],'sectionId':_0x47f1f0['id']},{})['then'](function(){return _0x10a262;});}else{return _0x10a262;}})[_0x6715('0x4d')](function(_0x34419c){logger['error'](_0x6715('0x58'),_0x34419c);throw _0x34419c;});}return _0x10a262;})[_0x6715('0x2f')](respondWithResult(_0x466a97,0xc9))['catch'](handleError(_0x466a97,null));};exports['update']=function(_0x32dd54,_0x1dbec5){if(_0x32dd54[_0x6715('0x53')]['id']){delete _0x32dd54[_0x6715('0x53')]['id'];}return db[_0x6715('0x37')]['find']({'where':{'id':_0x32dd54[_0x6715('0x59')]['id']}})['then'](handleEntityNotFound(_0x1dbec5,null))[_0x6715('0x2f')](saveUpdates(_0x32dd54[_0x6715('0x53')],null))[_0x6715('0x2f')](respondWithResult(_0x1dbec5,null))[_0x6715('0x4d')](handleError(_0x1dbec5,null));};exports[_0x6715('0x30')]=function(_0x33d484,_0x29bece){return db[_0x6715('0x37')][_0x6715('0x51')]({'where':{'id':_0x33d484[_0x6715('0x59')]['id']}})[_0x6715('0x2f')](handleEntityNotFound(_0x29bece,null))[_0x6715('0x2f')](removeEntity(_0x29bece,null))[_0x6715('0x4d')](handleError(_0x29bece,null));};exports[_0x6715('0x5a')]=function(_0x5e58ac,_0x1ae1f7){return db[_0x6715('0x37')][_0x6715('0x5a')]()[_0x6715('0x2f')](respondWithResult(_0x1ae1f7,null))[_0x6715('0x4d')](handleError(_0x1ae1f7,null));};exports[_0x6715('0x5b')]=function(_0x154f83,_0x19cf0f,_0xe6811b){var _0x1406d8={'raw':!![],'where':{}},_0x599302={},_0x41e665;return db['FaxQueue']['findOne']({'where':{'id':_0x154f83[_0x6715('0x59')]['id']}})['then'](handleEntityNotFound(_0x19cf0f,null))[_0x6715('0x2f')](function(_0x55c583){if(_0x55c583){_0x41e665=_0x55c583['get']({'plain':!![]});_0x599302[_0x6715('0x3b')]=_[_0x6715('0x4f')](db[_0x6715('0x5c')][_0x6715('0x38')]);_0x599302[_0x6715('0x3c')]=_[_0x6715('0x4f')](_0x154f83[_0x6715('0x3c')]);_0x599302[_0x6715('0x3d')]=_[_0x6715('0x3e')](_0x599302[_0x6715('0x3b')],_0x599302[_0x6715('0x3c')]);_0x1406d8['attributes']=_[_0x6715('0x3e')](_0x599302[_0x6715('0x3b')],qs['fields'](_0x154f83['query'][_0x6715('0x40')]));_0x1406d8[_0x6715('0x3f')]=_0x1406d8[_0x6715('0x3f')][_0x6715('0x5d')]?_0x1406d8['attributes']:_0x599302['model'];if(!_0x154f83[_0x6715('0x3c')]['hasOwnProperty'](_0x6715('0x42'))){_0x1406d8[_0x6715('0x27')]=qs[_0x6715('0x27')](_0x154f83[_0x6715('0x3c')][_0x6715('0x27')]);_0x1406d8['offset']=qs['offset'](_0x154f83[_0x6715('0x3c')][_0x6715('0x25')]);}_0x1406d8[_0x6715('0x43')]=qs[_0x6715('0x44')](_0x154f83[_0x6715('0x3c')][_0x6715('0x44')]);_0x1406d8[_0x6715('0x45')]=qs[_0x6715('0x3d')](_[_0x6715('0x46')](_0x154f83[_0x6715('0x3c')],_0x599302[_0x6715('0x3d')]));_0x1406d8[_0x6715('0x45')][_0x6715('0x5e')]=_0x55c583['id'];if(_0x154f83[_0x6715('0x3c')]['filter']){_0x1406d8[_0x6715('0x45')]=_[_0x6715('0x48')](_0x1406d8[_0x6715('0x45')],{'$or':_[_0x6715('0x36')](_0x1406d8['attributes'],function(_0x38b85f){var _0x33e0aa={};_0x33e0aa[_0x38b85f]={'$like':'%'+_0x154f83[_0x6715('0x3c')][_0x6715('0x47')]+'%'};return _0x33e0aa;})});}_0x1406d8=_['merge']({},_0x1406d8,_0x154f83['options']);return db['UserFaxQueue'][_0x6715('0x4b')](_0x1406d8);}})['then'](function(_0x3f7b47){if(_0x3f7b47){return db[_0x6715('0x5f')]['findAndCountAll']({'where':{'id':_[_0x6715('0x36')](_0x3f7b47,'UserId'),'role':'agent'},'attributes':['id','name',_0x6715('0x60'),_0x6715('0x61'),_0x6715('0x62')]});}})[_0x6715('0x2f')](function(_0x31f1c0){if(_0x31f1c0){return{'count':_0x31f1c0[_0x6715('0x28')],'rows':_[_0x6715('0x36')](_0x31f1c0[_0x6715('0x4c')],function(_0xa00cd6){return{'membername':_0xa00cd6[_0x6715('0x33')],'UserId':_0xa00cd6['id'],'queue_name':_0x41e665['name'],'FaxQueueId':_0x41e665['id'],'interface':util[_0x6715('0x63')](_0x6715('0x64'),_0x6715('0x65'),_0xa00cd6['name']),'penalty':0x0,'paused':_0xa00cd6[_0x6715('0x60')],'createdAt':_0xa00cd6[_0x6715('0x62')],'updatedAt':_0xa00cd6[_0x6715('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6715('0x2f')](respondWithFilteredResult(_0x19cf0f,_0x1406d8))[_0x6715('0x4d')](handleError(_0x19cf0f,null));};exports[_0x6715('0x66')]=function(_0x10ae84,_0xaef9d4,_0x4db64d){var _0x56590d={};var _0x1ac9e3={};var _0x1e1cd1;var _0x3b1528;return db[_0x6715('0x37')][_0x6715('0x67')]({'where':{'id':_0x10ae84[_0x6715('0x59')]['id']}})['then'](handleEntityNotFound(_0xaef9d4,null))[_0x6715('0x2f')](function(_0x565c4b){if(_0x565c4b){_0x1e1cd1=_0x565c4b;_0x1ac9e3[_0x6715('0x3b')]=_['keys'](db['Team']['rawAttributes']);_0x1ac9e3['query']=_[_0x6715('0x4f')](_0x10ae84[_0x6715('0x3c')]);_0x1ac9e3[_0x6715('0x3d')]=_[_0x6715('0x3e')](_0x1ac9e3['model'],_0x1ac9e3['query']);_0x56590d['attributes']=_[_0x6715('0x3e')](_0x1ac9e3[_0x6715('0x3b')],qs[_0x6715('0x40')](_0x10ae84[_0x6715('0x3c')]['fields']));_0x56590d[_0x6715('0x3f')]=_0x56590d['attributes'][_0x6715('0x5d')]?_0x56590d['attributes']:_0x1ac9e3[_0x6715('0x3b')];_0x56590d[_0x6715('0x43')]=qs[_0x6715('0x44')](_0x10ae84['query']['sort']);_0x56590d['where']=qs[_0x6715('0x3d')](_['pick'](_0x10ae84[_0x6715('0x3c')],_0x1ac9e3[_0x6715('0x3d')]));if(_0x10ae84[_0x6715('0x3c')][_0x6715('0x47')]){_0x56590d[_0x6715('0x45')]=_[_0x6715('0x48')](_0x56590d[_0x6715('0x45')],{'$or':_['map'](_0x56590d['attributes'],function(_0x57c634){var _0x378a0b={};_0x378a0b[_0x57c634]={'$like':'%'+_0x10ae84[_0x6715('0x3c')][_0x6715('0x47')]+'%'};return _0x378a0b;})});}_0x56590d=_[_0x6715('0x48')]({},_0x56590d,_0x10ae84[_0x6715('0x50')]);return _0x1e1cd1['getTeams'](_0x56590d);}})[_0x6715('0x2f')](function(_0x2c591e){if(_0x2c591e){_0x3b1528=_0x2c591e[_0x6715('0x5d')];if(!_0x10ae84['query'][_0x6715('0x41')]('nolimit')){_0x56590d[_0x6715('0x27')]=qs[_0x6715('0x27')](_0x10ae84[_0x6715('0x3c')]['limit']);_0x56590d[_0x6715('0x25')]=qs[_0x6715('0x25')](_0x10ae84[_0x6715('0x3c')][_0x6715('0x25')]);}return _0x1e1cd1[_0x6715('0x66')](_0x56590d);}})[_0x6715('0x2f')](function(_0x5ade77){if(_0x5ade77){return _0x5ade77?{'count':_0x3b1528,'rows':_0x5ade77}:null;}})[_0x6715('0x2f')](respondWithResult(_0xaef9d4,null))[_0x6715('0x4d')](handleError(_0xaef9d4,null));};exports[_0x6715('0x68')]=function(_0x1a24db,_0x47b143,_0x2fae9b){var _0x5f3dac=_0x1a24db[_0x6715('0x53')][_0x6715('0x69')];return db[_0x6715('0x6a')][_0x6715('0x4b')]({'where':{'id':_0x5f3dac},'attributes':['id'],'include':[{'model':db[_0x6715('0x5f')],'as':_0x6715('0x6b'),'attributes':['id',_0x6715('0x33'),_0x6715('0x6c'),'voicePause',_0x6715('0x6d')],'raw':!![]}]})['then'](function(_0x28ddda){if(_0x28ddda){var _0x5876a4=_['flatMap'](_0x28ddda,function(_0x54d819){var _0x4921bd=_0x54d819['get']({'plain':!![]});return _0x4921bd[_0x6715('0x6b')];});return db['FaxQueue'][_0x6715('0x51')]({'where':{'id':_0x1a24db[_0x6715('0x59')]['id']}})[_0x6715('0x2f')](function(_0x102b16){return db[_0x6715('0x6e')]['transaction'](function(_0x1d07ad){return _0x102b16['addTeams'](_0x5f3dac,{'transaction':_0x1d07ad})['then'](function(){return BPromise[_0x6715('0x6f')](_0x5876a4,function(_0x350b82){return db[_0x6715('0x5c')][_0x6715('0x70')]({'where':{'UserId':_0x350b82['id'],'FaxQueueId':_0x1a24db[_0x6715('0x59')]['id']},'transaction':_0x1d07ad});});})[_0x6715('0x2f')](function(){_0x5876a4[_0x6715('0x71')](function(_0x276306){socket[_0x6715('0x72')]('userFaxQueue:save',{'UserId':_0x276306['id'],'FaxQueueId':_0x102b16['id']});});});});});}})[_0x6715('0x2f')](respondWithStatusCode(_0x47b143,null))[_0x6715('0x4d')](handleError(_0x47b143,null));};exports[_0x6715('0x73')]=function(_0x3bf07a,_0x271095,_0xa4d2f6){return db['Team'][_0x6715('0x4b')]({'where':{'id':_0x3bf07a['query'][_0x6715('0x69')]},'attributes':['id'],'include':[{'model':db[_0x6715('0x5f')],'as':_0x6715('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x6715('0x2f')](handleEntityNotFound(_0x271095,null))[_0x6715('0x2f')](function(_0x2f82d0){var _0x36b0d6=_[_0x6715('0x36')](_0x2f82d0,'id');var _0x126fcc=[];var _0x54978f=[];var _0x59db2d=squel[_0x6715('0x74')]();_0x59db2d['field'](_0x6715('0x75'))['from'](_0x6715('0x76'),'tq')[_0x6715('0x77')](_0x6715('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6715('0x45')]('FaxQueueId\x20=\x20?',_0x3bf07a['params']['id']);for(var _0x33f8f8=0x0;_0x33f8f8<_0x2f82d0[_0x6715('0x5d')];_0x33f8f8+=0x1){let _0x7850c5=_0x2f82d0[_0x33f8f8];for(var _0x511fb2=0x0;_0x511fb2<_0x7850c5['Agents']['length'];_0x511fb2+=0x1){let _0x5b28d4=_0x7850c5['Agents'][_0x511fb2];var _0x90592f=_0x59db2d[_0x6715('0x79')]();_0x90592f['where'](_0x6715('0x7a'),_0x5b28d4['id']);_0x54978f['push'](db[_0x6715('0x6e')][_0x6715('0x3c')](_0x90592f[_0x6715('0x7b')](),{'type':db[_0x6715('0x6e')]['QueryTypes'][_0x6715('0x7c')]})[_0x6715('0x2f')](function(_0x327aec){if(_0x327aec[_0x6715('0x5d')]===0x1){return _0x5b28d4['id'];}else{var _0x3991f3=_[_0x6715('0x7d')](_['map'](_0x327aec,_0x6715('0x7e')),function(_0x47338b){return _[_0x6715('0x7f')](_0x36b0d6,_0x47338b);});if(_0x3991f3){return _0x5b28d4['id'];}}}));}}return BPromise[_0x6715('0x80')](_0x54978f)['then'](function(_0x1d9e60){_0x126fcc=_(_0x126fcc)[_0x6715('0x81')](_0x1d9e60)[_0x6715('0x82')]()[_0x6715('0x83')]();return db[_0x6715('0x37')][_0x6715('0x51')]({'where':{'id':_0x3bf07a[_0x6715('0x59')]['id']}})[_0x6715('0x2f')](function(_0x21f007){return db[_0x6715('0x6e')][_0x6715('0x84')](function(_0x223ed7){return _0x21f007[_0x6715('0x73')](_0x3bf07a[_0x6715('0x3c')][_0x6715('0x69')],{'transaction':_0x223ed7})[_0x6715('0x2f')](function(){if(!_[_0x6715('0x85')](_0x126fcc)){return _0x21f007[_0x6715('0x86')](_0x126fcc,{'transaction':_0x223ed7});}})[_0x6715('0x2f')](function(){_0x126fcc[_0x6715('0x71')](function(_0x20d4c3){socket[_0x6715('0x72')](_0x6715('0x87'),{'UserId':_0x20d4c3,'FaxQueueId':_0x21f007['id']});});});});});});})[_0x6715('0x2f')](respondWithStatusCode(_0x271095,null))[_0x6715('0x4d')](handleError(_0x271095,null));};exports[_0x6715('0x88')]=function(_0x4f33ae,_0x4932b8,_0x2854a1){return db[_0x6715('0x37')]['find']({'where':{'id':_0x4f33ae[_0x6715('0x59')]['id']}})[_0x6715('0x2f')](handleEntityNotFound(_0x4932b8,null))['then'](function(_0x4cf758){if(_0x4cf758){return _0x4cf758[_0x6715('0x88')](_0x4f33ae[_0x6715('0x53')][_0x6715('0x69')],_['omit'](_0x4f33ae[_0x6715('0x53')],['ids','id'])||{})[_0x6715('0x89')](function(_0x1eb338){for(var _0x10edfd=0x0;_0x10edfd<_0x4f33ae[_0x6715('0x53')]['ids'][_0x6715('0x5d')];_0x10edfd+=0x1){socket[_0x6715('0x72')](_0x6715('0x8a'),{'UserId':Number(_0x4f33ae[_0x6715('0x53')][_0x6715('0x69')][_0x10edfd]),'FaxQueueId':Number(_0x4f33ae[_0x6715('0x59')]['id'])});}return _0x1eb338;});}})[_0x6715('0x2f')](respondWithResult(_0x4932b8,null))['catch'](handleError(_0x4932b8,null));};exports[_0x6715('0x86')]=function(_0x4701d9,_0x10967d,_0x59df89){return db[_0x6715('0x37')]['find']({'where':{'id':_0x4701d9['params']['id']}})[_0x6715('0x2f')](handleEntityNotFound(_0x10967d,null))[_0x6715('0x2f')](function(_0x6a3903){if(_0x6a3903){return _0x6a3903[_0x6715('0x86')](_0x4701d9[_0x6715('0x3c')][_0x6715('0x69')])[_0x6715('0x2f')](function(){if(_['isArray'](_0x4701d9[_0x6715('0x3c')]['ids'])){for(var _0x51be90=0x0;_0x51be90<_0x4701d9[_0x6715('0x3c')][_0x6715('0x69')][_0x6715('0x5d')];_0x51be90+=0x1){socket[_0x6715('0x72')](_0x6715('0x87'),{'UserId':Number(_0x4701d9['query'][_0x6715('0x69')][_0x51be90]),'FaxQueueId':Number(_0x4701d9['params']['id'])});}}else{socket['emit'](_0x6715('0x87'),{'UserId':Number(_0x4701d9[_0x6715('0x3c')]['ids']),'FaxQueueId':Number(_0x4701d9[_0x6715('0x59')]['id'])});}});}})[_0x6715('0x2f')](respondWithStatusCode(_0x10967d,null))[_0x6715('0x4d')](handleError(_0x10967d,null));};exports[_0x6715('0x8b')]=function(_0x362a4e,_0x2905a2,_0x588a2c){var _0x48f2a7={};var _0x13f1a4={};var _0x231bbd;var _0x552b88;return db['FaxQueue']['findOne']({'where':{'id':_0x362a4e[_0x6715('0x59')]['id']}})[_0x6715('0x2f')](handleEntityNotFound(_0x2905a2,null))[_0x6715('0x2f')](function(_0x14af5a){if(_0x14af5a){_0x231bbd=_0x14af5a;_0x13f1a4[_0x6715('0x3b')]=_['keys'](db[_0x6715('0x5f')][_0x6715('0x38')]);_0x13f1a4[_0x6715('0x3c')]=_[_0x6715('0x4f')](_0x362a4e[_0x6715('0x3c')]);_0x13f1a4['filters']=_['intersection'](_0x13f1a4['model'],_0x13f1a4[_0x6715('0x3c')]);_0x48f2a7[_0x6715('0x3f')]=_[_0x6715('0x3e')](_0x13f1a4[_0x6715('0x3b')],qs[_0x6715('0x40')](_0x362a4e['query']['fields']));_0x48f2a7[_0x6715('0x3f')]=_0x48f2a7[_0x6715('0x3f')][_0x6715('0x5d')]?_0x48f2a7[_0x6715('0x3f')]:_0x13f1a4[_0x6715('0x3b')];_0x48f2a7[_0x6715('0x43')]=qs['sort'](_0x362a4e['query'][_0x6715('0x44')]);_0x48f2a7[_0x6715('0x45')]=qs[_0x6715('0x3d')](_['pick'](_0x362a4e['query'],_0x13f1a4['filters']));if(_0x362a4e[_0x6715('0x3c')][_0x6715('0x47')]){_0x48f2a7['where']=_[_0x6715('0x48')](_0x48f2a7[_0x6715('0x45')],{'$or':_[_0x6715('0x36')](_0x48f2a7[_0x6715('0x3f')],function(_0x1eba4b){var _0x3bd383={};_0x3bd383[_0x1eba4b]={'$like':'%'+_0x362a4e[_0x6715('0x3c')][_0x6715('0x47')]+'%'};return _0x3bd383;})});}_0x48f2a7=_[_0x6715('0x48')]({},_0x48f2a7,_0x362a4e[_0x6715('0x50')]);return _0x231bbd[_0x6715('0x8b')](_0x48f2a7);}})[_0x6715('0x2f')](function(_0xcc5e5a){if(_0xcc5e5a){_0x552b88=_0xcc5e5a[_0x6715('0x5d')];if(!_0x362a4e[_0x6715('0x3c')]['hasOwnProperty']('nolimit')){_0x48f2a7[_0x6715('0x27')]=qs[_0x6715('0x27')](_0x362a4e[_0x6715('0x3c')][_0x6715('0x27')]);_0x48f2a7[_0x6715('0x25')]=qs[_0x6715('0x25')](_0x362a4e['query'][_0x6715('0x25')]);}return _0x231bbd[_0x6715('0x8b')](_0x48f2a7);}})[_0x6715('0x2f')](function(_0x26d876){if(_0x26d876){return _0x26d876?{'count':_0x552b88,'rows':_0x26d876}:null;}})[_0x6715('0x2f')](respondWithResult(_0x2905a2,null))[_0x6715('0x4d')](handleError(_0x2905a2,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f7f1a69..081d0b8 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 _0x1fb9=['save','update','remove','emit','hasOwnProperty','events','FaxQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fb9,0x1cd));var _0x91fb=function(_0x40570d,_0x173745){_0x40570d=_0x40570d-0x0;var _0x53bc05=_0x1fb9[_0x40570d];return _0x53bc05;};'use strict';var EventEmitter=require(_0x91fb('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x91fb('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x91fb('0x2')](0x0);var events={'afterCreate':_0x91fb('0x3'),'afterUpdate':_0x91fb('0x4'),'afterDestroy':_0x91fb('0x5')};function emitEvent(_0x3b7fe3){return function(_0x47c099,_0x2c3c7c,_0x1f0865){FaxQueueEvents[_0x91fb('0x6')](_0x3b7fe3+':'+_0x47c099['id'],_0x47c099);FaxQueueEvents[_0x91fb('0x6')](_0x3b7fe3,_0x47c099);_0x1f0865(null);};}for(var e in events){if(events[_0x91fb('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xd79a=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','save'];(function(_0x3032e2,_0x26a4e8){var _0x427aef=function(_0x4b9281){while(--_0x4b9281){_0x3032e2['push'](_0x3032e2['shift']());}};_0x427aef(++_0x26a4e8);}(_0xd79a,0x17d));var _0xad79=function(_0x4fbe00,_0x3bb8a8){_0x4fbe00=_0x4fbe00-0x0;var _0x80e6c3=_0xd79a[_0x4fbe00];return _0x80e6c3;};'use strict';var EventEmitter=require(_0xad79('0x0'));var FaxQueue=require(_0xad79('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xad79('0x2'),'afterUpdate':_0xad79('0x3'),'afterDestroy':_0xad79('0x4')};function emitEvent(_0x1e987a){return function(_0x19a27d,_0x359aab,_0x5b144a){FaxQueueEvents[_0xad79('0x5')](_0x1e987a+':'+_0x19a27d['id'],_0x19a27d);FaxQueueEvents[_0xad79('0x5')](_0x1e987a,_0x19a27d);_0x5b144a(null);};}for(var e in events){if(events[_0xad79('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xad79('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 71adb66..fad5ef4 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 _0xae2e=['../../config/logger','api','moment','bluebird','request-promise','./faxQueue.attributes','exports','FaxQueue','fax_queues','lodash','util'];(function(_0x4144d3,_0x1127fc){var _0x332dfa=function(_0x5a2b39){while(--_0x5a2b39){_0x4144d3['push'](_0x4144d3['shift']());}};_0x332dfa(++_0x1127fc);}(_0xae2e,0x153));var _0xeae2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xae2e[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xeae2('0x0'));var util=require(_0xeae2('0x1'));var logger=require(_0xeae2('0x2'))(_0xeae2('0x3'));var moment=require(_0xeae2('0x4'));var BPromise=require(_0xeae2('0x5'));var rp=require(_0xeae2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeae2('0x7'));module[_0xeae2('0x8')]=function(_0x87f6ab,_0x429526){return _0x87f6ab['define'](_0xeae2('0x9'),attributes,{'tableName':_0xeae2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x192e=['exports','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes'];(function(_0x18b02a,_0x36a97d){var _0x1fc6c7=function(_0x2f2661){while(--_0x2f2661){_0x18b02a['push'](_0x18b02a['shift']());}};_0x1fc6c7(++_0x36a97d);}(_0x192e,0x1a1));var _0xe192=function(_0xa9e5e7,_0x42a424){_0xa9e5e7=_0xa9e5e7-0x0;var _0x284c77=_0x192e[_0xa9e5e7];return _0x284c77;};'use strict';var _=require(_0xe192('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe192('0x1'));var rp=require(_0xe192('0x2'));var fs=require('fs');var path=require(_0xe192('0x3'));var rimraf=require(_0xe192('0x4'));var config=require(_0xe192('0x5'));var attributes=require(_0xe192('0x6'));module[_0xe192('0x7')]=function(_0x444bd2,_0x50f18e){return _0x444bd2['define']('FaxQueue',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 ca34207..a7934f6 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 _0xe6c3=['FaxQueue','find','ShowFaxQueue','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetFaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch'];(function(_0x3a75eb,_0x1efec7){var _0x29375a=function(_0x2ca5f3){while(--_0x2ca5f3){_0x3a75eb['push'](_0x3a75eb['shift']());}};_0x29375a(++_0x1efec7);}(_0xe6c3,0xe7));var _0x3e6c=function(_0x4d14d1,_0x161707){_0x4d14d1=_0x4d14d1-0x0;var _0x5cf04c=_0xe6c3[_0x4d14d1];return _0x5cf04c;};'use strict';var _=require(_0x3e6c('0x0'));var util=require(_0x3e6c('0x1'));var moment=require('moment');var BPromise=require(_0x3e6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e6c('0x3'));var db=require(_0x3e6c('0x4'))['db'];var utils=require(_0x3e6c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3e6c('0x6'));var client=jayson[_0x3e6c('0x7')][_0x3e6c('0x8')]({'port':0x232a});config[_0x3e6c('0x9')]=_[_0x3e6c('0xa')](config[_0x3e6c('0x9')],{'host':_0x3e6c('0xb'),'port':0x18eb});var socket=require(_0x3e6c('0xc'))(new Redis(config[_0x3e6c('0x9')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0xd38ae8,_0x4a0a84,_0xab537){return new BPromise(function(_0x36c949,_0xb6bd3){return client[_0x3e6c('0xd')](_0xd38ae8,_0xab537)[_0x3e6c('0xe')](function(_0x58c1bf){logger[_0x3e6c('0xf')](_0x3e6c('0x10'),_0x4a0a84,'request\x20sent');logger[_0x3e6c('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x4a0a84,_0x3e6c('0x12'),JSON[_0x3e6c('0x13')](_0x58c1bf));if(_0x58c1bf[_0x3e6c('0x14')]){if(_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x15')]===0x1f4){logger['error'](_0x3e6c('0x10'),_0x4a0a84,_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x16')]);return _0xb6bd3(_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x16')]);}logger[_0x3e6c('0x14')](_0x3e6c('0x10'),_0x4a0a84,_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x16')]);return _0x36c949(_0x58c1bf[_0x3e6c('0x14')][_0x3e6c('0x16')]);}else{logger[_0x3e6c('0xf')](_0x3e6c('0x10'),_0x4a0a84,_0x3e6c('0x12'));_0x36c949(_0x58c1bf[_0x3e6c('0x17')]['message']);}})['catch'](function(_0x42e68c){logger[_0x3e6c('0x14')](_0x3e6c('0x10'),_0x4a0a84,_0x42e68c);_0xb6bd3(_0x42e68c);});});}exports[_0x3e6c('0x18')]=function(_0x3e541a){var _0x40961c=this;return new Promise(function(_0x16a359,_0x52d520){return db['FaxQueue'][_0x3e6c('0x19')]({'raw':_0x3e541a[_0x3e6c('0x1a')]?_0x3e541a[_0x3e6c('0x1a')][_0x3e6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e541a['options']?_0x3e541a[_0x3e6c('0x1a')][_0x3e6c('0x1c')]||null:null,'attributes':_0x3e541a[_0x3e6c('0x1a')]?_0x3e541a[_0x3e6c('0x1a')][_0x3e6c('0x1d')]||null:null,'limit':_0x3e541a['options']?_0x3e541a['options'][_0x3e6c('0x1e')]||null:null,'include':_0x3e541a[_0x3e6c('0x1a')]?_0x3e541a['options']['include']?_[_0x3e6c('0x1f')](_0x3e541a[_0x3e6c('0x1a')][_0x3e6c('0x20')],function(_0x28f5c3){return{'model':db[_0x28f5c3[_0x3e6c('0x21')]],'as':_0x28f5c3['as'],'attributes':_0x28f5c3[_0x3e6c('0x1d')],'include':_0x28f5c3[_0x3e6c('0x20')]?_[_0x3e6c('0x1f')](_0x28f5c3[_0x3e6c('0x20')],function(_0xc31004){return{'model':db[_0xc31004[_0x3e6c('0x21')]],'as':_0xc31004['as'],'attributes':_0xc31004[_0x3e6c('0x1d')],'include':_0xc31004['include']?_[_0x3e6c('0x1f')](_0xc31004[_0x3e6c('0x20')],function(_0x3208c2){return{'model':db[_0x3208c2[_0x3e6c('0x21')]],'as':_0x3208c2['as'],'attributes':_0x3208c2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ffebd){logger[_0x3e6c('0xf')](_0x3e6c('0x18'),_0x3e541a);logger[_0x3e6c('0x11')](_0x3e6c('0x18'),_0x3e541a,JSON[_0x3e6c('0x13')](_0x1ffebd));_0x16a359(_0x1ffebd);})[_0x3e6c('0x22')](function(_0x5d769e){logger['error'](_0x3e6c('0x18'),_0x5d769e[_0x3e6c('0x16')],_0x3e541a);_0x52d520(_0x40961c[_0x3e6c('0x14')](0x1f4,_0x5d769e[_0x3e6c('0x16')]));});});};exports['ShowFaxQueue']=function(_0x1d7d59){var _0x2440e4=this;return new Promise(function(_0x1fcaf0,_0x38a8ae){return db[_0x3e6c('0x23')][_0x3e6c('0x24')]({'raw':_0x1d7d59['options']?_0x1d7d59['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d7d59[_0x3e6c('0x1a')]?_0x1d7d59[_0x3e6c('0x1a')]['where']||null:null,'attributes':_0x1d7d59[_0x3e6c('0x1a')]?_0x1d7d59['options'][_0x3e6c('0x1d')]||null:null,'include':_0x1d7d59[_0x3e6c('0x1a')]?_0x1d7d59['options'][_0x3e6c('0x20')]?_[_0x3e6c('0x1f')](_0x1d7d59[_0x3e6c('0x1a')][_0x3e6c('0x20')],function(_0x2f16c5){return{'model':db[_0x2f16c5[_0x3e6c('0x21')]],'as':_0x2f16c5['as'],'attributes':_0x2f16c5[_0x3e6c('0x1d')],'include':_0x2f16c5['include']?_['map'](_0x2f16c5['include'],function(_0x3633a8){return{'model':db[_0x3633a8[_0x3e6c('0x21')]],'as':_0x3633a8['as'],'attributes':_0x3633a8['attributes'],'include':_0x3633a8[_0x3e6c('0x20')]?_[_0x3e6c('0x1f')](_0x3633a8[_0x3e6c('0x20')],function(_0xb8a073){return{'model':db[_0xb8a073[_0x3e6c('0x21')]],'as':_0xb8a073['as'],'attributes':_0xb8a073[_0x3e6c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x456861){logger[_0x3e6c('0xf')](_0x3e6c('0x25'),_0x1d7d59);logger[_0x3e6c('0x11')](_0x3e6c('0x25'),_0x1d7d59,JSON[_0x3e6c('0x13')](_0x456861));_0x1fcaf0(_0x456861);})['catch'](function(_0x7cf5af){logger[_0x3e6c('0x14')](_0x3e6c('0x25'),_0x7cf5af[_0x3e6c('0x16')],_0x1d7d59);_0x38a8ae(_0x2440e4['error'](0x1f4,_0x7cf5af['message']));});});}; \ No newline at end of file +var _0x93d9=['error','code','message','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','catch','ShowFaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1e7f42,_0x38f2ca){var _0x56e163=function(_0x1a1c93){while(--_0x1a1c93){_0x1e7f42['push'](_0x1e7f42['shift']());}};_0x56e163(++_0x38f2ca);}(_0x93d9,0x199));var _0x993d=function(_0x29cd53,_0x50cb98){_0x29cd53=_0x29cd53-0x0;var _0x56ef69=_0x93d9[_0x29cd53];return _0x56ef69;};'use strict';var _=require('lodash');var util=require(_0x993d('0x0'));var moment=require(_0x993d('0x1'));var BPromise=require(_0x993d('0x2'));var rs=require(_0x993d('0x3'));var fs=require('fs');var Redis=require(_0x993d('0x4'));var db=require(_0x993d('0x5'))['db'];var utils=require(_0x993d('0x6'));var logger=require(_0x993d('0x7'))(_0x993d('0x8'));var config=require(_0x993d('0x9'));var jayson=require(_0x993d('0xa'));var client=jayson[_0x993d('0xb')]['http']({'port':0x232a});config[_0x993d('0xc')]=_['defaults'](config[_0x993d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x993d('0xd'))['register'](socket);function respondWithRpcPromise(_0x308aaa,_0x3cd74e,_0x1a7f29){return new BPromise(function(_0x5d1198,_0x27a291){return client[_0x993d('0xe')](_0x308aaa,_0x1a7f29)[_0x993d('0xf')](function(_0x532954){logger[_0x993d('0x10')](_0x993d('0x11'),_0x3cd74e,'request\x20sent');logger['debug'](_0x993d('0x12'),_0x3cd74e,_0x993d('0x13'),JSON['stringify'](_0x532954));if(_0x532954[_0x993d('0x14')]){if(_0x532954['error'][_0x993d('0x15')]===0x1f4){logger[_0x993d('0x14')](_0x993d('0x11'),_0x3cd74e,_0x532954['error']['message']);return _0x27a291(_0x532954['error'][_0x993d('0x16')]);}logger[_0x993d('0x14')](_0x993d('0x11'),_0x3cd74e,_0x532954[_0x993d('0x14')]['message']);return _0x5d1198(_0x532954[_0x993d('0x14')][_0x993d('0x16')]);}else{logger[_0x993d('0x10')](_0x993d('0x11'),_0x3cd74e,_0x993d('0x13'));_0x5d1198(_0x532954[_0x993d('0x17')][_0x993d('0x16')]);}})['catch'](function(_0x325a4f){logger[_0x993d('0x14')]('FaxQueue,\x20%s,\x20%s',_0x3cd74e,_0x325a4f);_0x27a291(_0x325a4f);});});}exports[_0x993d('0x18')]=function(_0x582e00){var _0x2901cf=this;return new Promise(function(_0x348225,_0x440797){return db[_0x993d('0x19')][_0x993d('0x1a')]({'raw':_0x582e00[_0x993d('0x1b')]?_0x582e00[_0x993d('0x1b')][_0x993d('0x1c')]===undefined?!![]:![]:!![],'where':_0x582e00[_0x993d('0x1b')]?_0x582e00[_0x993d('0x1b')][_0x993d('0x1d')]||null:null,'attributes':_0x582e00[_0x993d('0x1b')]?_0x582e00['options']['attributes']||null:null,'limit':_0x582e00[_0x993d('0x1b')]?_0x582e00[_0x993d('0x1b')][_0x993d('0x1e')]||null:null,'include':_0x582e00[_0x993d('0x1b')]?_0x582e00[_0x993d('0x1b')]['include']?_[_0x993d('0x1f')](_0x582e00[_0x993d('0x1b')][_0x993d('0x20')],function(_0x68d00f){return{'model':db[_0x68d00f[_0x993d('0x21')]],'as':_0x68d00f['as'],'attributes':_0x68d00f[_0x993d('0x22')],'include':_0x68d00f[_0x993d('0x20')]?_[_0x993d('0x1f')](_0x68d00f[_0x993d('0x20')],function(_0x121865){return{'model':db[_0x121865[_0x993d('0x21')]],'as':_0x121865['as'],'attributes':_0x121865['attributes'],'include':_0x121865['include']?_['map'](_0x121865[_0x993d('0x20')],function(_0x5c2da7){return{'model':db[_0x5c2da7['model']],'as':_0x5c2da7['as'],'attributes':_0x5c2da7[_0x993d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x993d('0xf')](function(_0x50fe5e){logger[_0x993d('0x10')](_0x993d('0x18'),_0x582e00);logger[_0x993d('0x23')]('GetFaxQueue',_0x582e00,JSON['stringify'](_0x50fe5e));_0x348225(_0x50fe5e);})[_0x993d('0x24')](function(_0x2f8c18){logger['error']('GetFaxQueue',_0x2f8c18[_0x993d('0x16')],_0x582e00);_0x440797(_0x2901cf[_0x993d('0x14')](0x1f4,_0x2f8c18[_0x993d('0x16')]));});});};exports[_0x993d('0x25')]=function(_0x25009d){var _0x788c02=this;return new Promise(function(_0x25380e,_0x57af66){return db[_0x993d('0x19')][_0x993d('0x26')]({'raw':_0x25009d[_0x993d('0x1b')]?_0x25009d[_0x993d('0x1b')][_0x993d('0x1c')]===undefined?!![]:![]:!![],'where':_0x25009d[_0x993d('0x1b')]?_0x25009d[_0x993d('0x1b')][_0x993d('0x1d')]||null:null,'attributes':_0x25009d[_0x993d('0x1b')]?_0x25009d[_0x993d('0x1b')][_0x993d('0x22')]||null:null,'include':_0x25009d['options']?_0x25009d[_0x993d('0x1b')][_0x993d('0x20')]?_['map'](_0x25009d[_0x993d('0x1b')]['include'],function(_0x3e827f){return{'model':db[_0x3e827f[_0x993d('0x21')]],'as':_0x3e827f['as'],'attributes':_0x3e827f[_0x993d('0x22')],'include':_0x3e827f[_0x993d('0x20')]?_[_0x993d('0x1f')](_0x3e827f[_0x993d('0x20')],function(_0x3d862c){return{'model':db[_0x3d862c[_0x993d('0x21')]],'as':_0x3d862c['as'],'attributes':_0x3d862c[_0x993d('0x22')],'include':_0x3d862c[_0x993d('0x20')]?_[_0x993d('0x1f')](_0x3d862c[_0x993d('0x20')],function(_0x3f1f7b){return{'model':db[_0x3f1f7b['model']],'as':_0x3f1f7b['as'],'attributes':_0x3f1f7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x993d('0xf')](function(_0x391f4a){logger[_0x993d('0x10')]('ShowFaxQueue',_0x25009d);logger[_0x993d('0x23')](_0x993d('0x25'),_0x25009d,JSON['stringify'](_0x391f4a));_0x25380e(_0x391f4a);})[_0x993d('0x24')](function(_0x59a137){logger[_0x993d('0x14')](_0x993d('0x25'),_0x59a137[_0x993d('0x16')],_0x25009d);_0x57af66(_0x788c02[_0x993d('0x14')](0x1f4,_0x59a137['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 2066cfd..4610ece 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 _0x663f=['remove','emit','register','length','faxQueue:','save'];(function(_0x5b9e24,_0x2265f9){var _0x1cbf61=function(_0xa9128d){while(--_0xa9128d){_0x5b9e24['push'](_0x5b9e24['shift']());}};_0x1cbf61(++_0x2265f9);}(_0x663f,0xdd));var _0xf663=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0x663f[_0xdd0313];return _0x2bd7e8;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf663('0x0'),_0xf663('0x1'),'update'];function createListener(_0x51df07,_0x135c57){return function(_0x1ec9ed){_0x135c57[_0xf663('0x2')](_0x51df07,_0x1ec9ed);};}function removeListener(_0x42c2f1,_0x354f0e){return function(){FaxQueueEvents['removeListener'](_0x42c2f1,_0x354f0e);};}exports[_0xf663('0x3')]=function(_0x11e449){for(var _0x725397=0x0,_0x5647af=events[_0xf663('0x4')];_0x725397<_0x5647af;_0x725397++){var _0x20bbca=events[_0x725397];var _0x363e57=createListener(_0xf663('0x5')+_0x20bbca,_0x11e449);FaxQueueEvents['on'](_0x20bbca,_0x363e57);}}; \ No newline at end of file +var _0x1b15=['register','length','faxQueue:','./faxQueue.events','save','remove','emit'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0x1b15,0x81));var _0x51b1=function(_0x512b2f,_0x2bd3a6){_0x512b2f=_0x512b2f-0x0;var _0x258764=_0x1b15[_0x512b2f];return _0x258764;};'use strict';var FaxQueueEvents=require(_0x51b1('0x0'));var events=[_0x51b1('0x1'),_0x51b1('0x2'),'update'];function createListener(_0x285f42,_0x77f306){return function(_0x638cc1){_0x77f306[_0x51b1('0x3')](_0x285f42,_0x638cc1);};}function removeListener(_0x30f3f9,_0x3c7805){return function(){FaxQueueEvents['removeListener'](_0x30f3f9,_0x3c7805);};}exports[_0x51b1('0x4')]=function(_0x52f185){for(var _0x16d0a4=0x0,_0x46b3ea=events[_0x51b1('0x5')];_0x16d0a4<_0x46b3ea;_0x16d0a4++){var _0xe69605=events[_0x16d0a4];var _0x37d594=createListener(_0x51b1('0x6')+_0xe69605,_0x52f185);FaxQueueEvents['on'](_0xe69605,_0x37d594);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 64b8c68..a15bff8 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 _0x9bd9=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x7d70ca,_0x35d51a){var _0x4dd0fc=function(_0x15d987){while(--_0x15d987){_0x7d70ca['push'](_0x7d70ca['shift']());}};_0x4dd0fc(++_0x35d51a);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0x9bd9[_0x401b3e];return _0x4f290f;};'use strict';var multer=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var path=require(_0x99bd('0x2'));var timeout=require(_0x99bd('0x3'));var express=require(_0x99bd('0x4'));var router=express[_0x99bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x99bd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x99bd('0x7'));var controller=require(_0x99bd('0x8'));router['get']('/',auth[_0x99bd('0x9')](),controller[_0x99bd('0xa')]);router[_0x99bd('0xb')](_0x99bd('0xc'),auth[_0x99bd('0x9')](),controller[_0x99bd('0xd')]);router[_0x99bd('0xb')](_0x99bd('0xe'),auth[_0x99bd('0x9')](),controller[_0x99bd('0xf')]);router[_0x99bd('0xb')](_0x99bd('0x10'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x11')]);router['get'](_0x99bd('0x12'),auth['isAuthenticated'](),controller[_0x99bd('0x13')]);router['get'](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller['getAgents']);router[_0x99bd('0x15')]('/',auth['isAuthenticated'](),controller[_0x99bd('0x16')]);router['post'](_0x99bd('0x12'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x17')]);router['post'](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x18')]);router[_0x99bd('0x19')](_0x99bd('0xe'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x1a')]);router[_0x99bd('0x1b')](_0x99bd('0xe'),auth['isAuthenticated'](),controller[_0x99bd('0x1c')]);router[_0x99bd('0x1b')](_0x99bd('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x99bd('0x1b')](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x1d')]);module[_0x99bd('0x1e')]=router; \ No newline at end of file +var _0xaa64=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x22596b,_0x3ee4a6){var _0x4963c1=function(_0x5ec1e7){while(--_0x5ec1e7){_0x22596b['push'](_0x22596b['shift']());}};_0x4963c1(++_0x3ee4a6);}(_0xaa64,0xf7));var _0x4aa6=function(_0x3ab715,_0x23e45f){_0x3ab715=_0x3ab715-0x0;var _0x3d013b=_0xaa64[_0x3ab715];return _0x3d013b;};'use strict';var multer=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var path=require('path');var timeout=require(_0x4aa6('0x2'));var express=require('express');var router=express[_0x4aa6('0x3')]();var fs_extra=require(_0x4aa6('0x4'));var auth=require(_0x4aa6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4aa6('0x6'));var controller=require(_0x4aa6('0x7'));router[_0x4aa6('0x8')]('/',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0xa')]);router[_0x4aa6('0x8')](_0x4aa6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4aa6('0x8')](_0x4aa6('0xc'),auth['isAuthenticated'](),controller[_0x4aa6('0xd')]);router['get'](_0x4aa6('0xe'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0xf')]);router[_0x4aa6('0x8')]('/:id/teams',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x10')]);router[_0x4aa6('0x8')](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x12')]);router[_0x4aa6('0x13')]('/',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x14')]);router[_0x4aa6('0x13')]('/:id/teams',auth[_0x4aa6('0x9')](),controller['addTeams']);router['post'](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x15')]);router[_0x4aa6('0x16')](_0x4aa6('0xc'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x17')]);router[_0x4aa6('0x18')]('/:id',auth[_0x4aa6('0x9')](),controller['destroy']);router[_0x4aa6('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4aa6('0x19')]);router[_0x4aa6('0x18')](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x1a')]);module[_0x4aa6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 5299468..1dec7e9 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 _0xbceb=['DATE','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbceb,0x10d));var _0xbbce=function(_0x2f0220,_0x153318){_0x2f0220=_0x2f0220-0x0;var _0x4d4b45=_0xbceb[_0x2f0220];return _0x4d4b45;};'use strict';var moment=require('moment');var Sequelize=require(_0xbbce('0x0'));module[_0xbbce('0x1')]={'uniqueid':{'type':Sequelize[_0xbbce('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbbce('0x2')]},'joinAt':{'type':Sequelize[_0xbbce('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbbce('0x3')]},'reason':{'type':Sequelize[_0xbbce('0x2')]}}; \ No newline at end of file +var _0xa14b=['sequelize','exports','DATE','STRING','moment'];(function(_0x4a174c,_0x1c582c){var _0x2411ad=function(_0x483d02){while(--_0x483d02){_0x4a174c['push'](_0x4a174c['shift']());}};_0x2411ad(++_0x1c582c);}(_0xa14b,0x68));var _0xba14=function(_0x59a2fc,_0x474f45){_0x59a2fc=_0x59a2fc-0x0;var _0x1e0888=_0xa14b[_0x59a2fc];return _0x1e0888;};'use strict';var moment=require(_0xba14('0x0'));var Sequelize=require(_0xba14('0x1'));module[_0xba14('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xba14('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xba14('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xba14('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 58cabba..9d5ff02 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 _0x95c5=['stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','include','create','body','find','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','save','update','then','error'];(function(_0x56f935,_0xbb3e13){var _0x25ff2f=function(_0x3d0fad){while(--_0x3d0fad){_0x56f935['push'](_0x56f935['shift']());}};_0x25ff2f(++_0xbb3e13);}(_0x95c5,0x153));var _0x595c=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x95c5[_0x316904];return _0xfa9a21;};'use strict';var emlformat=require(_0x595c('0x0'));var rimraf=require(_0x595c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x595c('0x2'));var rp=require(_0x595c('0x3'));var moment=require(_0x595c('0x4'));var BPromise=require(_0x595c('0x5'));var Mustache=require(_0x595c('0x6'));var util=require(_0x595c('0x7'));var path=require(_0x595c('0x8'));var sox=require(_0x595c('0x9'));var csv=require(_0x595c('0xa'));var ejs=require(_0x595c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x595c('0xc'));var crypto=require(_0x595c('0xd'));var jsforce=require(_0x595c('0xe'));var deskjs=require(_0x595c('0xf'));var toCsv=require(_0x595c('0xa'));var querystring=require(_0x595c('0x10'));var Papa=require(_0x595c('0x11'));var Redis=require(_0x595c('0x12'));var authService=require(_0x595c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x595c('0x14'));var hardwareService=require(_0x595c('0x15'));var logger=require(_0x595c('0x16'))('api');var utils=require(_0x595c('0x17'));var config=require(_0x595c('0x18'));var licenseUtil=require(_0x595c('0x19'));var db=require(_0x595c('0x1a'))['db'];function respondWithStatusCode(_0x913a30,_0x1bae2a){_0x1bae2a=_0x1bae2a||0xcc;return function(_0x3c73e8){if(_0x3c73e8){return _0x913a30[_0x595c('0x1b')](_0x1bae2a);}return _0x913a30[_0x595c('0x1c')](_0x1bae2a)[_0x595c('0x1d')]();};}function respondWithResult(_0x31c568,_0x7b2bcd){_0x7b2bcd=_0x7b2bcd||0xc8;return function(_0x35b622){if(_0x35b622){return _0x31c568[_0x595c('0x1c')](_0x7b2bcd)['json'](_0x35b622);}};}function respondWithFilteredResult(_0x17c053,_0x3243f9){return function(_0x3bf9be){if(_0x3bf9be){var _0x28c2ed=typeof _0x3243f9['offset']==='undefined'&&typeof _0x3243f9[_0x595c('0x1e')]==='undefined';var _0x505f0c=_0x3bf9be[_0x595c('0x1f')];var _0xe45721=_0x28c2ed?0x0:_0x3243f9[_0x595c('0x20')];var _0x4f9936=_0x28c2ed?_0x3bf9be[_0x595c('0x1f')]:_0x3243f9[_0x595c('0x20')]+_0x3243f9['limit'];var _0x2bb744;if(_0x4f9936>=_0x505f0c){_0x4f9936=_0x505f0c;_0x2bb744=0xc8;}else{_0x2bb744=0xce;}_0x17c053[_0x595c('0x1c')](_0x2bb744);return _0x17c053[_0x595c('0x21')](_0x595c('0x22'),_0xe45721+'-'+_0x4f9936+'/'+_0x505f0c)[_0x595c('0x23')](_0x3bf9be);}return null;};}function patchUpdates(_0x3195b8){return function(_0x2d59d4){try{jsonpatch[_0x595c('0x24')](_0x2d59d4,_0x3195b8,!![]);}catch(_0x83573f){return BPromise['reject'](_0x83573f);}return _0x2d59d4[_0x595c('0x25')]();};}function saveUpdates(_0x589c35,_0x378eaf){return function(_0x4b0cb1){if(_0x4b0cb1){return _0x4b0cb1[_0x595c('0x26')](_0x589c35)[_0x595c('0x27')](function(_0x3d7668){return _0x3d7668;});}return null;};}function removeEntity(_0x3d64a8,_0x3f58c4){return function(_0x1eb0ff){if(_0x1eb0ff){return _0x1eb0ff['destroy']()[_0x595c('0x27')](function(){_0x3d64a8['status'](0xcc)[_0x595c('0x1d')]();});}};}function handleEntityNotFound(_0x4970a1,_0x3df8ed){return function(_0x1c3d72){if(!_0x1c3d72){_0x4970a1['sendStatus'](0x194);}return _0x1c3d72;};}function handleError(_0x195df7,_0x99622){_0x99622=_0x99622||0x1f4;return function(_0x1998da){logger[_0x595c('0x28')](_0x1998da[_0x595c('0x29')]);if(_0x1998da[_0x595c('0x2a')]){delete _0x1998da[_0x595c('0x2a')];}_0x195df7['status'](_0x99622)[_0x595c('0x2b')](_0x1998da);};}exports['index']=function(_0x306b16,_0x4afafb){var _0x19001a={},_0x4a6278={},_0x5b7d81={'count':0x0,'rows':[]};var _0x1b8414=_[_0x595c('0x2c')](db[_0x595c('0x2d')][_0x595c('0x2e')],function(_0x5e51c1){return{'name':_0x5e51c1[_0x595c('0x2f')],'type':_0x5e51c1[_0x595c('0x30')][_0x595c('0x31')]};});_0x4a6278[_0x595c('0x32')]=_[_0x595c('0x2c')](_0x1b8414,'name');_0x4a6278['query']=_[_0x595c('0x33')](_0x306b16[_0x595c('0x34')]);_0x4a6278[_0x595c('0x35')]=_['intersection'](_0x4a6278[_0x595c('0x32')],_0x4a6278[_0x595c('0x34')]);_0x19001a['attributes']=_[_0x595c('0x36')](_0x4a6278[_0x595c('0x32')],qs[_0x595c('0x37')](_0x306b16[_0x595c('0x34')]['fields']));_0x19001a[_0x595c('0x38')]=_0x19001a['attributes'][_0x595c('0x39')]?_0x19001a['attributes']:_0x4a6278[_0x595c('0x32')];if(!_0x306b16[_0x595c('0x34')]['hasOwnProperty']('nolimit')){_0x19001a[_0x595c('0x1e')]=qs[_0x595c('0x1e')](_0x306b16[_0x595c('0x34')][_0x595c('0x1e')]);_0x19001a[_0x595c('0x20')]=qs[_0x595c('0x20')](_0x306b16['query'][_0x595c('0x20')]);}_0x19001a[_0x595c('0x3a')]=qs['sort'](_0x306b16['query'][_0x595c('0x3b')]);_0x19001a[_0x595c('0x3c')]=qs[_0x595c('0x35')](_[_0x595c('0x3d')](_0x306b16[_0x595c('0x34')],_0x4a6278['filters']),_0x1b8414);if(_0x306b16[_0x595c('0x34')][_0x595c('0x3e')]){_0x19001a['where']=_[_0x595c('0x3f')](_0x19001a['where'],{'$or':_[_0x595c('0x2c')](_0x1b8414,function(_0x2b841b){if(_0x2b841b['type']!==_0x595c('0x40')){var _0x9eb193={};_0x9eb193[_0x2b841b[_0x595c('0x2a')]]={'$like':'%'+_0x306b16['query'][_0x595c('0x3e')]+'%'};return _0x9eb193;}})});}_0x19001a=_['merge']({},_0x19001a,_0x306b16[_0x595c('0x41')]);var _0x23b636={'where':_0x19001a[_0x595c('0x3c')]};return db[_0x595c('0x2d')][_0x595c('0x1f')](_0x23b636)[_0x595c('0x27')](function(_0x46f1e0){_0x5b7d81['count']=_0x46f1e0;if(_0x306b16[_0x595c('0x34')]['includeAll']){_0x19001a['include']=[{'all':!![]}];}return db[_0x595c('0x2d')][_0x595c('0x42')](_0x19001a);})[_0x595c('0x27')](function(_0xcf14e7){_0x5b7d81['rows']=_0xcf14e7;return _0x5b7d81;})[_0x595c('0x27')](respondWithFilteredResult(_0x4afafb,_0x19001a))[_0x595c('0x43')](handleError(_0x4afafb,null));};exports[_0x595c('0x44')]=function(_0x21fbf5,_0x28cd01){var _0x528780={'raw':!![],'where':{'id':_0x21fbf5['params']['id']}},_0x5359e6={};_0x5359e6[_0x595c('0x32')]=_['keys'](db[_0x595c('0x2d')][_0x595c('0x2e')]);_0x5359e6[_0x595c('0x34')]=_[_0x595c('0x33')](_0x21fbf5[_0x595c('0x34')]);_0x5359e6['filters']=_['intersection'](_0x5359e6['model'],_0x5359e6[_0x595c('0x34')]);_0x528780[_0x595c('0x38')]=_[_0x595c('0x36')](_0x5359e6['model'],qs[_0x595c('0x37')](_0x21fbf5['query']['fields']));_0x528780[_0x595c('0x38')]=_0x528780['attributes'][_0x595c('0x39')]?_0x528780[_0x595c('0x38')]:_0x5359e6['model'];if(_0x21fbf5[_0x595c('0x34')]['includeAll']){_0x528780[_0x595c('0x45')]=[{'all':!![]}];}_0x528780=_['merge']({},_0x528780,_0x21fbf5[_0x595c('0x41')]);return db[_0x595c('0x2d')]['find'](_0x528780)[_0x595c('0x27')](handleEntityNotFound(_0x28cd01,null))[_0x595c('0x27')](respondWithResult(_0x28cd01,null))['catch'](handleError(_0x28cd01,null));};exports[_0x595c('0x46')]=function(_0x1aaa69,_0x126b9e){return db[_0x595c('0x2d')]['create'](_0x1aaa69[_0x595c('0x47')],{})[_0x595c('0x27')](respondWithResult(_0x126b9e,0xc9))[_0x595c('0x43')](handleError(_0x126b9e,null));};exports[_0x595c('0x26')]=function(_0x23cdfe,_0x18aa82){if(_0x23cdfe[_0x595c('0x47')]['id']){delete _0x23cdfe[_0x595c('0x47')]['id'];}return db[_0x595c('0x2d')][_0x595c('0x48')]({'where':{'id':_0x23cdfe[_0x595c('0x49')]['id']}})[_0x595c('0x27')](handleEntityNotFound(_0x18aa82,null))[_0x595c('0x27')](saveUpdates(_0x23cdfe[_0x595c('0x47')],null))[_0x595c('0x27')](respondWithResult(_0x18aa82,null))[_0x595c('0x43')](handleError(_0x18aa82,null));};exports[_0x595c('0x4a')]=function(_0x379d16,_0x1e42a4){return db[_0x595c('0x2d')][_0x595c('0x48')]({'where':{'id':_0x379d16['params']['id']}})[_0x595c('0x27')](handleEntityNotFound(_0x1e42a4,null))[_0x595c('0x27')](removeEntity(_0x1e42a4,null))[_0x595c('0x43')](handleError(_0x1e42a4,null));};exports[_0x595c('0x4b')]=function(_0x1796d1,_0x74dea8){return db[_0x595c('0x2d')][_0x595c('0x4b')]()[_0x595c('0x27')](respondWithResult(_0x74dea8,null))[_0x595c('0x43')](handleError(_0x74dea8,null));}; \ No newline at end of file +var _0x43fd=['name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','query','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','reject','then','destroy','error','stack'];(function(_0x160bd8,_0x45855c){var _0x3dd8fb=function(_0x50b713){while(--_0x50b713){_0x160bd8['push'](_0x160bd8['shift']());}};_0x3dd8fb(++_0x45855c);}(_0x43fd,0x150));var _0xd43f=function(_0x13b997,_0x2dc918){_0x13b997=_0x13b997-0x0;var _0x1ab2b6=_0x43fd[_0x13b997];return _0x1ab2b6;};'use strict';var emlformat=require(_0xd43f('0x0'));var rimraf=require(_0xd43f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd43f('0x2'));var rp=require('request-promise');var moment=require(_0xd43f('0x3'));var BPromise=require(_0xd43f('0x4'));var Mustache=require(_0xd43f('0x5'));var util=require(_0xd43f('0x6'));var path=require(_0xd43f('0x7'));var sox=require(_0xd43f('0x8'));var csv=require(_0xd43f('0x9'));var ejs=require(_0xd43f('0xa'));var fs=require('fs');var fs_extra=require(_0xd43f('0xb'));var _=require(_0xd43f('0xc'));var squel=require(_0xd43f('0xd'));var crypto=require(_0xd43f('0xe'));var jsforce=require(_0xd43f('0xf'));var deskjs=require(_0xd43f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd43f('0x11'));var Papa=require(_0xd43f('0x12'));var Redis=require(_0xd43f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd43f('0x14'));var as=require(_0xd43f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd43f('0x16'))(_0xd43f('0x17'));var utils=require(_0xd43f('0x18'));var config=require(_0xd43f('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3be74e,_0xed42ff){_0xed42ff=_0xed42ff||0xcc;return function(_0x5b90a7){if(_0x5b90a7){return _0x3be74e[_0xd43f('0x1a')](_0xed42ff);}return _0x3be74e['status'](_0xed42ff)['end']();};}function respondWithResult(_0x28fe2d,_0x12bd82){_0x12bd82=_0x12bd82||0xc8;return function(_0x568087){if(_0x568087){return _0x28fe2d[_0xd43f('0x1b')](_0x12bd82)[_0xd43f('0x1c')](_0x568087);}};}function respondWithFilteredResult(_0x54f136,_0x229f81){return function(_0x351c9c){if(_0x351c9c){var _0x10f584=typeof _0x229f81[_0xd43f('0x1d')]===_0xd43f('0x1e')&&typeof _0x229f81['limit']==='undefined';var _0x5c03a6=_0x351c9c[_0xd43f('0x1f')];var _0x22d86f=_0x10f584?0x0:_0x229f81[_0xd43f('0x1d')];var _0x2e2396=_0x10f584?_0x351c9c['count']:_0x229f81[_0xd43f('0x1d')]+_0x229f81[_0xd43f('0x20')];var _0x263e9a;if(_0x2e2396>=_0x5c03a6){_0x2e2396=_0x5c03a6;_0x263e9a=0xc8;}else{_0x263e9a=0xce;}_0x54f136[_0xd43f('0x1b')](_0x263e9a);return _0x54f136[_0xd43f('0x21')]('Content-Range',_0x22d86f+'-'+_0x2e2396+'/'+_0x5c03a6)[_0xd43f('0x1c')](_0x351c9c);}return null;};}function patchUpdates(_0x5bae9e){return function(_0x1ad9d3){try{jsonpatch['apply'](_0x1ad9d3,_0x5bae9e,!![]);}catch(_0x1ce702){return BPromise[_0xd43f('0x22')](_0x1ce702);}return _0x1ad9d3['save']();};}function saveUpdates(_0x37da4a,_0x1c79b8){return function(_0x15a7d9){if(_0x15a7d9){return _0x15a7d9['update'](_0x37da4a)[_0xd43f('0x23')](function(_0x51c68c){return _0x51c68c;});}return null;};}function removeEntity(_0x3ff3dc,_0x4646c2){return function(_0x1bf18d){if(_0x1bf18d){return _0x1bf18d[_0xd43f('0x24')]()[_0xd43f('0x23')](function(){_0x3ff3dc[_0xd43f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cf19f,_0x4750c3){return function(_0x30d7a3){if(!_0x30d7a3){_0x3cf19f[_0xd43f('0x1a')](0x194);}return _0x30d7a3;};}function handleError(_0x3381b6,_0x2f7769){_0x2f7769=_0x2f7769||0x1f4;return function(_0x2df5b4){logger[_0xd43f('0x25')](_0x2df5b4[_0xd43f('0x26')]);if(_0x2df5b4[_0xd43f('0x27')]){delete _0x2df5b4['name'];}_0x3381b6[_0xd43f('0x1b')](_0x2f7769)[_0xd43f('0x28')](_0x2df5b4);};}exports[_0xd43f('0x29')]=function(_0x1215cf,_0x82103b){var _0x30d1dc={},_0x4efdb5={},_0x23293d={'count':0x0,'rows':[]};var _0x2442ea=_[_0xd43f('0x2a')](db[_0xd43f('0x2b')][_0xd43f('0x2c')],function(_0x136b99){return{'name':_0x136b99[_0xd43f('0x2d')],'type':_0x136b99[_0xd43f('0x2e')][_0xd43f('0x2f')]};});_0x4efdb5['model']=_[_0xd43f('0x2a')](_0x2442ea,_0xd43f('0x27'));_0x4efdb5['query']=_[_0xd43f('0x30')](_0x1215cf['query']);_0x4efdb5[_0xd43f('0x31')]=_['intersection'](_0x4efdb5[_0xd43f('0x32')],_0x4efdb5['query']);_0x30d1dc[_0xd43f('0x33')]=_['intersection'](_0x4efdb5[_0xd43f('0x32')],qs[_0xd43f('0x34')](_0x1215cf['query'][_0xd43f('0x34')]));_0x30d1dc[_0xd43f('0x33')]=_0x30d1dc[_0xd43f('0x33')][_0xd43f('0x35')]?_0x30d1dc[_0xd43f('0x33')]:_0x4efdb5[_0xd43f('0x32')];if(!_0x1215cf['query'][_0xd43f('0x36')](_0xd43f('0x37'))){_0x30d1dc['limit']=qs[_0xd43f('0x20')](_0x1215cf[_0xd43f('0x38')][_0xd43f('0x20')]);_0x30d1dc[_0xd43f('0x1d')]=qs[_0xd43f('0x1d')](_0x1215cf['query'][_0xd43f('0x1d')]);}_0x30d1dc['order']=qs[_0xd43f('0x39')](_0x1215cf[_0xd43f('0x38')][_0xd43f('0x39')]);_0x30d1dc[_0xd43f('0x3a')]=qs[_0xd43f('0x31')](_[_0xd43f('0x3b')](_0x1215cf['query'],_0x4efdb5[_0xd43f('0x31')]),_0x2442ea);if(_0x1215cf[_0xd43f('0x38')]['filter']){_0x30d1dc[_0xd43f('0x3a')]=_[_0xd43f('0x3c')](_0x30d1dc[_0xd43f('0x3a')],{'$or':_['map'](_0x2442ea,function(_0xdd4f62){if(_0xdd4f62['type']!==_0xd43f('0x3d')){var _0x24e341={};_0x24e341[_0xdd4f62['name']]={'$like':'%'+_0x1215cf[_0xd43f('0x38')]['filter']+'%'};return _0x24e341;}})});}_0x30d1dc=_[_0xd43f('0x3c')]({},_0x30d1dc,_0x1215cf[_0xd43f('0x3e')]);var _0x4b9404={'where':_0x30d1dc['where']};return db['FaxQueueReport']['count'](_0x4b9404)[_0xd43f('0x23')](function(_0xf08193){_0x23293d[_0xd43f('0x1f')]=_0xf08193;if(_0x1215cf[_0xd43f('0x38')][_0xd43f('0x3f')]){_0x30d1dc[_0xd43f('0x40')]=[{'all':!![]}];}return db[_0xd43f('0x2b')][_0xd43f('0x41')](_0x30d1dc);})['then'](function(_0x5f01a1){_0x23293d[_0xd43f('0x42')]=_0x5f01a1;return _0x23293d;})[_0xd43f('0x23')](respondWithFilteredResult(_0x82103b,_0x30d1dc))[_0xd43f('0x43')](handleError(_0x82103b,null));};exports[_0xd43f('0x44')]=function(_0xac3fe,_0xe676e5){var _0x239339={'raw':!![],'where':{'id':_0xac3fe[_0xd43f('0x45')]['id']}},_0x335315={};_0x335315['model']=_[_0xd43f('0x30')](db[_0xd43f('0x2b')][_0xd43f('0x2c')]);_0x335315[_0xd43f('0x38')]=_[_0xd43f('0x30')](_0xac3fe[_0xd43f('0x38')]);_0x335315[_0xd43f('0x31')]=_[_0xd43f('0x46')](_0x335315['model'],_0x335315[_0xd43f('0x38')]);_0x239339['attributes']=_[_0xd43f('0x46')](_0x335315[_0xd43f('0x32')],qs[_0xd43f('0x34')](_0xac3fe['query']['fields']));_0x239339[_0xd43f('0x33')]=_0x239339['attributes'][_0xd43f('0x35')]?_0x239339[_0xd43f('0x33')]:_0x335315['model'];if(_0xac3fe[_0xd43f('0x38')][_0xd43f('0x3f')]){_0x239339[_0xd43f('0x40')]=[{'all':!![]}];}_0x239339=_[_0xd43f('0x3c')]({},_0x239339,_0xac3fe[_0xd43f('0x3e')]);return db['FaxQueueReport'][_0xd43f('0x47')](_0x239339)[_0xd43f('0x23')](handleEntityNotFound(_0xe676e5,null))[_0xd43f('0x23')](respondWithResult(_0xe676e5,null))['catch'](handleError(_0xe676e5,null));};exports[_0xd43f('0x48')]=function(_0x44e112,_0x58aa4a){return db[_0xd43f('0x2b')][_0xd43f('0x48')](_0x44e112[_0xd43f('0x49')],{})[_0xd43f('0x23')](respondWithResult(_0x58aa4a,0xc9))[_0xd43f('0x43')](handleError(_0x58aa4a,null));};exports['update']=function(_0x4ae991,_0x13f856){if(_0x4ae991[_0xd43f('0x49')]['id']){delete _0x4ae991['body']['id'];}return db[_0xd43f('0x2b')][_0xd43f('0x47')]({'where':{'id':_0x4ae991[_0xd43f('0x45')]['id']}})[_0xd43f('0x23')](handleEntityNotFound(_0x13f856,null))[_0xd43f('0x23')](saveUpdates(_0x4ae991[_0xd43f('0x49')],null))['then'](respondWithResult(_0x13f856,null))['catch'](handleError(_0x13f856,null));};exports[_0xd43f('0x24')]=function(_0x2625c6,_0xa5f195){return db['FaxQueueReport'][_0xd43f('0x47')]({'where':{'id':_0x2625c6['params']['id']}})[_0xd43f('0x23')](handleEntityNotFound(_0xa5f195,null))['then'](removeEntity(_0xa5f195,null))[_0xd43f('0x43')](handleError(_0xa5f195,null));};exports['describe']=function(_0x89f548,_0x5041a6){return db[_0xd43f('0x2b')][_0xd43f('0x4a')]()['then'](respondWithResult(_0x5041a6,null))[_0xd43f('0x43')](handleError(_0x5041a6,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 11ff446..520c54a 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x493e31,_0x33cc81){var _0x103b84=function(_0x8de80e){while(--_0x8de80e){_0x493e31['push'](_0x493e31['shift']());}};_0x103b84(++_0x33cc81);}(_0xf494,0x1c6));var _0x4f49=function(_0x54dc7b,_0x592c0f){_0x54dc7b=_0x54dc7b-0x0;var _0x4711ee=_0xf494[_0x54dc7b];return _0x4711ee;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0x5e6461,_0x50e6d7){var _0x235661=function(_0x5eb4b9){while(--_0x5eb4b9){_0x5e6461['push'](_0x5e6461['shift']());}};_0x235661(++_0x50e6d7);}(_0x0295,0x1f0));var _0x5029=function(_0x568ae7,_0x2b5fa3){_0x568ae7=_0x568ae7-0x0;var _0x257050=_0x0295[_0x568ae7];return _0x257050;};'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')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 9620973..d9d2431 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 _0xcdee=['catch','CreateFaxQueueReport','create','body','options','FaxQueueReport','update','raw','where','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x25923f,_0x5415b8){var _0x207b18=function(_0x29af9a){while(--_0x29af9a){_0x25923f['push'](_0x25923f['shift']());}};_0x207b18(++_0x5415b8);}(_0xcdee,0x176));var _0xecde=function(_0x356f98,_0x552c1c){_0x356f98=_0x356f98-0x0;var _0x3c40f0=_0xcdee[_0x356f98];return _0x3c40f0;};'use strict';var _=require(_0xecde('0x0'));var util=require(_0xecde('0x1'));var moment=require('moment');var BPromise=require(_0xecde('0x2'));var rs=require(_0xecde('0x3'));var fs=require('fs');var Redis=require(_0xecde('0x4'));var db=require(_0xecde('0x5'))['db'];var utils=require(_0xecde('0x6'));var logger=require(_0xecde('0x7'))(_0xecde('0x8'));var config=require(_0xecde('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xecde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x409ea9,_0x420d54,_0x1288b5){return new BPromise(function(_0x11e586,_0x38616){return client[_0xecde('0xb')](_0x409ea9,_0x1288b5)[_0xecde('0xc')](function(_0x53c282){logger['info'](_0xecde('0xd'),_0x420d54,_0xecde('0xe'));logger[_0xecde('0xf')](_0xecde('0x10'),_0x420d54,_0xecde('0xe'),JSON[_0xecde('0x11')](_0x53c282));if(_0x53c282[_0xecde('0x12')]){if(_0x53c282[_0xecde('0x12')]['code']===0x1f4){logger[_0xecde('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x420d54,_0x53c282[_0xecde('0x12')][_0xecde('0x13')]);return _0x38616(_0x53c282['error'][_0xecde('0x13')]);}logger[_0xecde('0x12')](_0xecde('0xd'),_0x420d54,_0x53c282['error'][_0xecde('0x13')]);return _0x11e586(_0x53c282['error'][_0xecde('0x13')]);}else{logger[_0xecde('0x14')](_0xecde('0xd'),_0x420d54,_0xecde('0xe'));_0x11e586(_0x53c282[_0xecde('0x15')][_0xecde('0x13')]);}})[_0xecde('0x16')](function(_0x43525e){logger[_0xecde('0x12')](_0xecde('0xd'),_0x420d54,_0x43525e);_0x38616(_0x43525e);});});}exports[_0xecde('0x17')]=function(_0x4f029d){var _0xf5fb0f=this;return new Promise(function(_0x52209c,_0x221acc){return db['FaxQueueReport'][_0xecde('0x18')](_0x4f029d[_0xecde('0x19')],{'raw':_0x4f029d[_0xecde('0x1a')]?_0x4f029d['options']['raw']===undefined?!![]:![]:!![]})[_0xecde('0xc')](function(_0xd4cc5e){logger[_0xecde('0x14')]('CreateFaxQueueReport',_0x4f029d);logger[_0xecde('0xf')](_0xecde('0x17'),_0x4f029d,JSON['stringify'](_0xd4cc5e));_0x52209c(_0xd4cc5e);})[_0xecde('0x16')](function(_0x3defdd){logger[_0xecde('0x12')](_0xecde('0x17'),_0x3defdd['message'],_0x4f029d);_0x221acc(_0xf5fb0f[_0xecde('0x12')](0x1f4,_0x3defdd['message']));});});};exports['UpdateFaxQueueReport']=function(_0x50cabf){var _0x184120=this;return new Promise(function(_0x38591c,_0x2d22e2){return db[_0xecde('0x1b')][_0xecde('0x1c')](_0x50cabf[_0xecde('0x19')],{'raw':_0x50cabf['options']?_0x50cabf[_0xecde('0x1a')][_0xecde('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50cabf[_0xecde('0x1a')]?_0x50cabf[_0xecde('0x1a')][_0xecde('0x1e')]||null:null,'attributes':_0x50cabf[_0xecde('0x1a')]?_0x50cabf[_0xecde('0x1a')]['attributes']||null:null,'limit':_0x50cabf[_0xecde('0x1a')]?_0x50cabf[_0xecde('0x1a')][_0xecde('0x1f')]||null:null})[_0xecde('0xc')](function(_0x261077){logger[_0xecde('0x14')](_0xecde('0x20'),_0x50cabf);logger['debug'](_0xecde('0x20'),_0x50cabf,JSON[_0xecde('0x11')](_0x261077));_0x38591c(_0x261077);})[_0xecde('0x16')](function(_0x32fc79){logger[_0xecde('0x12')](_0xecde('0x20'),_0x32fc79[_0xecde('0x13')],_0x50cabf);_0x2d22e2(_0x184120['error'](0x1f4,_0x32fc79['message']));});});}; \ No newline at end of file +var _0xcd65=['UpdateFaxQueueReport','update','raw','where','attributes','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CreateFaxQueueReport','FaxQueueReport','create','body','options','then','catch'];(function(_0x461225,_0x4944be){var _0x5cbacb=function(_0x5068aa){while(--_0x5068aa){_0x461225['push'](_0x461225['shift']());}};_0x5cbacb(++_0x4944be);}(_0xcd65,0x16d));var _0x5cd6=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0xcd65[_0x3522c8];return _0x22f498;};'use strict';var _=require(_0x5cd6('0x0'));var util=require(_0x5cd6('0x1'));var moment=require(_0x5cd6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5cd6('0x3'));var logger=require(_0x5cd6('0x4'))(_0x5cd6('0x5'));var config=require(_0x5cd6('0x6'));var jayson=require(_0x5cd6('0x7'));var client=jayson['client'][_0x5cd6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b5873,_0x1bc1d6,_0x52fce9){return new BPromise(function(_0x2a4583,_0x3f31ae){return client[_0x5cd6('0x9')](_0x2b5873,_0x52fce9)['then'](function(_0x409b4b){logger[_0x5cd6('0xa')](_0x5cd6('0xb'),_0x1bc1d6,'request\x20sent');logger[_0x5cd6('0xc')](_0x5cd6('0xd'),_0x1bc1d6,_0x5cd6('0xe'),JSON[_0x5cd6('0xf')](_0x409b4b));if(_0x409b4b[_0x5cd6('0x10')]){if(_0x409b4b[_0x5cd6('0x10')]['code']===0x1f4){logger['error'](_0x5cd6('0xb'),_0x1bc1d6,_0x409b4b[_0x5cd6('0x10')]['message']);return _0x3f31ae(_0x409b4b[_0x5cd6('0x10')]['message']);}logger[_0x5cd6('0x10')](_0x5cd6('0xb'),_0x1bc1d6,_0x409b4b['error'][_0x5cd6('0x11')]);return _0x2a4583(_0x409b4b[_0x5cd6('0x10')][_0x5cd6('0x11')]);}else{logger[_0x5cd6('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x1bc1d6,_0x5cd6('0xe'));_0x2a4583(_0x409b4b['result']['message']);}})['catch'](function(_0x33a870){logger['error'](_0x5cd6('0xb'),_0x1bc1d6,_0x33a870);_0x3f31ae(_0x33a870);});});}exports[_0x5cd6('0x12')]=function(_0x3eda02){var _0x423eb2=this;return new Promise(function(_0x23be9f,_0x205bba){return db[_0x5cd6('0x13')][_0x5cd6('0x14')](_0x3eda02[_0x5cd6('0x15')],{'raw':_0x3eda02[_0x5cd6('0x16')]?_0x3eda02[_0x5cd6('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x5cd6('0x17')](function(_0x38fc45){logger[_0x5cd6('0xa')](_0x5cd6('0x12'),_0x3eda02);logger[_0x5cd6('0xc')](_0x5cd6('0x12'),_0x3eda02,JSON[_0x5cd6('0xf')](_0x38fc45));_0x23be9f(_0x38fc45);})[_0x5cd6('0x18')](function(_0x29cd35){logger[_0x5cd6('0x10')](_0x5cd6('0x12'),_0x29cd35['message'],_0x3eda02);_0x205bba(_0x423eb2[_0x5cd6('0x10')](0x1f4,_0x29cd35['message']));});});};exports[_0x5cd6('0x19')]=function(_0x111780){var _0x1faeaa=this;return new Promise(function(_0x392c2a,_0x46b13d){return db[_0x5cd6('0x13')][_0x5cd6('0x1a')](_0x111780[_0x5cd6('0x15')],{'raw':_0x111780[_0x5cd6('0x16')]?_0x111780[_0x5cd6('0x16')][_0x5cd6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x111780[_0x5cd6('0x16')]?_0x111780[_0x5cd6('0x16')][_0x5cd6('0x1c')]||null:null,'attributes':_0x111780[_0x5cd6('0x16')]?_0x111780[_0x5cd6('0x16')][_0x5cd6('0x1d')]||null:null,'limit':_0x111780[_0x5cd6('0x16')]?_0x111780['options']['limit']||null:null})[_0x5cd6('0x17')](function(_0x2d6bc5){logger['info'](_0x5cd6('0x19'),_0x111780);logger['debug']('UpdateFaxQueueReport',_0x111780,JSON[_0x5cd6('0xf')](_0x2d6bc5));_0x392c2a(_0x2d6bc5);})[_0x5cd6('0x18')](function(_0x4e3642){logger['error'](_0x5cd6('0x19'),_0x4e3642['message'],_0x111780);_0x46b13d(_0x1faeaa['error'](0x1f4,_0x4e3642[_0x5cd6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 1259274..2be7921 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 _0xe57c=['isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe57c,0x83));var _0xce57=function(_0x105073,_0x2cb6d1){_0x105073=_0x105073-0x0;var _0x4feeed=_0xe57c[_0x105073];return _0x4feeed;};'use strict';var multer=require(_0xce57('0x0'));var util=require(_0xce57('0x1'));var path=require('path');var timeout=require(_0xce57('0x2'));var express=require(_0xce57('0x3'));var router=express[_0xce57('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xce57('0x5'));var interaction=require(_0xce57('0x6'));var config=require('../../config/environment');var controller=require(_0xce57('0x7'));router[_0xce57('0x8')]('/',auth[_0xce57('0x9')](),controller[_0xce57('0xa')]);router[_0xce57('0x8')]('/describe',auth[_0xce57('0x9')](),controller[_0xce57('0xb')]);router[_0xce57('0x8')](_0xce57('0xc'),auth[_0xce57('0x9')](),controller[_0xce57('0xd')]);router['post']('/',auth[_0xce57('0x9')](),controller[_0xce57('0xe')]);router[_0xce57('0xf')](_0xce57('0xc'),auth['isAuthenticated'](),controller[_0xce57('0x10')]);router[_0xce57('0x11')](_0xce57('0xc'),auth[_0xce57('0x9')](),controller[_0xce57('0x12')]);module[_0xce57('0x13')]=router; \ No newline at end of file +var _0x6d10=['express','Router','fs-extra','get','isAuthenticated','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6d10,0x12f));var _0x06d1=function(_0x5c12ac,_0xfc55a){_0x5c12ac=_0x5c12ac-0x0;var _0x3ab8b7=_0x6d10[_0x5c12ac];return _0x3ab8b7;};'use strict';var multer=require(_0x06d1('0x0'));var util=require(_0x06d1('0x1'));var path=require(_0x06d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x06d1('0x3'));var router=express[_0x06d1('0x4')]();var fs_extra=require(_0x06d1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x06d1('0x6')]('/',auth[_0x06d1('0x7')](),controller['index']);router[_0x06d1('0x6')](_0x06d1('0x8'),auth[_0x06d1('0x7')](),controller['describe']);router['get'](_0x06d1('0x9'),auth[_0x06d1('0x7')](),controller[_0x06d1('0xa')]);router[_0x06d1('0xb')]('/',auth[_0x06d1('0x7')](),controller[_0x06d1('0xc')]);router[_0x06d1('0xd')](_0x06d1('0x9'),auth[_0x06d1('0x7')](),controller['update']);router[_0x06d1('0xe')](_0x06d1('0x9'),auth['isAuthenticated'](),controller[_0x06d1('0xf')]);module[_0x06d1('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 6d9b346..78e4a59 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x22a1e0,_0x279d8b){var _0x5d0dc7=function(_0x421aff){while(--_0x421aff){_0x22a1e0['push'](_0x22a1e0['shift']());}};_0x5d0dc7(++_0x279d8b);}(_0x34e8,0x12c));var _0x834e=function(_0x1f7ab8,_0x4ff838){_0x1f7ab8=_0x1f7ab8-0x0;var _0x223af8=_0x34e8[_0x1f7ab8];return _0x223af8;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0xb43b,0x1b2));var _0xbb43=function(_0x332e22,_0x81dd67){_0x332e22=_0x332e22-0x0;var _0xcad44b=_0xb43b[_0x332e22];return _0xcad44b;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 65685b2..b0c4d16 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 _0xcac8=['offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','name','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x4a498f,_0x33fa4c){var _0x3fde32=function(_0x534eec){while(--_0x534eec){_0x4a498f['push'](_0x4a498f['shift']());}};_0x3fde32(++_0x33fa4c);}(_0xcac8,0x10c));var _0x8cac=function(_0x4183ed,_0x4725b3){_0x4183ed=_0x4183ed-0x0;var _0x388a2b=_0xcac8[_0x4183ed];return _0x388a2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8cac('0x0'));var jsonpatch=require(_0x8cac('0x1'));var rp=require('request-promise');var moment=require(_0x8cac('0x2'));var BPromise=require(_0x8cac('0x3'));var Mustache=require(_0x8cac('0x4'));var util=require('util');var path=require(_0x8cac('0x5'));var sox=require(_0x8cac('0x6'));var csv=require(_0x8cac('0x7'));var ejs=require(_0x8cac('0x8'));var fs=require('fs');var fs_extra=require(_0x8cac('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8cac('0xa'));var jsforce=require(_0x8cac('0xb'));var deskjs=require(_0x8cac('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8cac('0xd'));var Papa=require('papaparse');var Redis=require(_0x8cac('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8cac('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cac('0x10'));var logger=require('../../config/logger')(_0x8cac('0x11'));var utils=require('../../config/utils');var config=require(_0x8cac('0x12'));var licenseUtil=require(_0x8cac('0x13'));var db=require(_0x8cac('0x14'))['db'];function respondWithStatusCode(_0x2418bb,_0x54777d){_0x54777d=_0x54777d||0xcc;return function(_0x3e1de3){if(_0x3e1de3){return _0x2418bb[_0x8cac('0x15')](_0x54777d);}return _0x2418bb['status'](_0x54777d)[_0x8cac('0x16')]();};}function respondWithResult(_0x5be9be,_0x52f872){_0x52f872=_0x52f872||0xc8;return function(_0xab49ab){if(_0xab49ab){return _0x5be9be[_0x8cac('0x17')](_0x52f872)['json'](_0xab49ab);}};}function respondWithFilteredResult(_0x2fe8fd,_0x670d18){return function(_0x5c5c59){if(_0x5c5c59){var _0x9c0732=typeof _0x670d18[_0x8cac('0x18')]===_0x8cac('0x19')&&typeof _0x670d18[_0x8cac('0x1a')]===_0x8cac('0x19');var _0xec6d75=_0x5c5c59[_0x8cac('0x1b')];var _0x3a7328=_0x9c0732?0x0:_0x670d18['offset'];var _0x184feb=_0x9c0732?_0x5c5c59[_0x8cac('0x1b')]:_0x670d18[_0x8cac('0x18')]+_0x670d18[_0x8cac('0x1a')];var _0x2e3797;if(_0x184feb>=_0xec6d75){_0x184feb=_0xec6d75;_0x2e3797=0xc8;}else{_0x2e3797=0xce;}_0x2fe8fd['status'](_0x2e3797);return _0x2fe8fd['set'](_0x8cac('0x1c'),_0x3a7328+'-'+_0x184feb+'/'+_0xec6d75)[_0x8cac('0x1d')](_0x5c5c59);}return null;};}function patchUpdates(_0x38af6b){return function(_0xca4b23){try{jsonpatch['apply'](_0xca4b23,_0x38af6b,!![]);}catch(_0x181edf){return BPromise[_0x8cac('0x1e')](_0x181edf);}return _0xca4b23[_0x8cac('0x1f')]();};}function saveUpdates(_0x1cf6c6,_0x2153cb){return function(_0x43bfc3){if(_0x43bfc3){return _0x43bfc3[_0x8cac('0x20')](_0x1cf6c6)[_0x8cac('0x21')](function(_0x1f452b){return _0x1f452b;});}return null;};}function removeEntity(_0x33ee01,_0x337fd6){return function(_0x4ad011){if(_0x4ad011){return _0x4ad011[_0x8cac('0x22')]()['then'](function(){_0x33ee01[_0x8cac('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5036e8,_0x3d3f8a){return function(_0x95d4c7){if(!_0x95d4c7){_0x5036e8[_0x8cac('0x15')](0x194);}return _0x95d4c7;};}function handleError(_0x58ecd2,_0x3d2726){_0x3d2726=_0x3d2726||0x1f4;return function(_0x15cc83){logger[_0x8cac('0x23')](_0x15cc83[_0x8cac('0x24')]);if(_0x15cc83['name']){delete _0x15cc83['name'];}_0x58ecd2[_0x8cac('0x17')](_0x3d2726)[_0x8cac('0x25')](_0x15cc83);};}exports['index']=function(_0x5cbdda,_0x17c893){var _0xd6857f={},_0x58a517={},_0x42939e={'count':0x0,'rows':[]};var _0x3d3719=_[_0x8cac('0x26')](db[_0x8cac('0x27')][_0x8cac('0x28')],function(_0x119d6b){return{'name':_0x119d6b[_0x8cac('0x29')],'type':_0x119d6b[_0x8cac('0x2a')][_0x8cac('0x2b')]};});_0x58a517['model']=_['map'](_0x3d3719,_0x8cac('0x2c'));_0x58a517['query']=_[_0x8cac('0x2d')](_0x5cbdda[_0x8cac('0x2e')]);_0x58a517[_0x8cac('0x2f')]=_['intersection'](_0x58a517[_0x8cac('0x30')],_0x58a517[_0x8cac('0x2e')]);_0xd6857f[_0x8cac('0x31')]=_[_0x8cac('0x32')](_0x58a517[_0x8cac('0x30')],qs[_0x8cac('0x33')](_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x33')]));_0xd6857f[_0x8cac('0x31')]=_0xd6857f[_0x8cac('0x31')][_0x8cac('0x34')]?_0xd6857f[_0x8cac('0x31')]:_0x58a517[_0x8cac('0x30')];if(!_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x35')](_0x8cac('0x36'))){_0xd6857f['limit']=qs[_0x8cac('0x1a')](_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x1a')]);_0xd6857f[_0x8cac('0x18')]=qs[_0x8cac('0x18')](_0x5cbdda[_0x8cac('0x2e')]['offset']);}_0xd6857f[_0x8cac('0x37')]=qs[_0x8cac('0x38')](_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x38')]);_0xd6857f[_0x8cac('0x39')]=qs[_0x8cac('0x2f')](_[_0x8cac('0x3a')](_0x5cbdda[_0x8cac('0x2e')],_0x58a517[_0x8cac('0x2f')]),_0x3d3719);if(_0x5cbdda[_0x8cac('0x2e')]['filter']){_0xd6857f['where']=_[_0x8cac('0x3b')](_0xd6857f['where'],{'$or':_['map'](_0x3d3719,function(_0x3fbf74){if(_0x3fbf74[_0x8cac('0x2a')]!==_0x8cac('0x3c')){var _0x9449dc={};_0x9449dc[_0x3fbf74[_0x8cac('0x2c')]]={'$like':'%'+_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x3d')]+'%'};return _0x9449dc;}})});}_0xd6857f=_[_0x8cac('0x3b')]({},_0xd6857f,_0x5cbdda[_0x8cac('0x3e')]);var _0x22073c={'where':_0xd6857f[_0x8cac('0x39')]};return db['FaxTransferReport'][_0x8cac('0x1b')](_0x22073c)[_0x8cac('0x21')](function(_0x187b84){_0x42939e['count']=_0x187b84;if(_0x5cbdda[_0x8cac('0x2e')][_0x8cac('0x3f')]){_0xd6857f[_0x8cac('0x40')]=[{'all':!![]}];}return db[_0x8cac('0x27')][_0x8cac('0x41')](_0xd6857f);})['then'](function(_0x30aeda){_0x42939e[_0x8cac('0x42')]=_0x30aeda;return _0x42939e;})[_0x8cac('0x21')](respondWithFilteredResult(_0x17c893,_0xd6857f))['catch'](handleError(_0x17c893,null));};exports['show']=function(_0x563efb,_0x2b7e88){var _0x1d3524={'raw':!![],'where':{'id':_0x563efb[_0x8cac('0x43')]['id']}},_0x205f0e={};_0x205f0e[_0x8cac('0x30')]=_[_0x8cac('0x2d')](db['FaxTransferReport']['rawAttributes']);_0x205f0e[_0x8cac('0x2e')]=_[_0x8cac('0x2d')](_0x563efb['query']);_0x205f0e[_0x8cac('0x2f')]=_[_0x8cac('0x32')](_0x205f0e[_0x8cac('0x30')],_0x205f0e['query']);_0x1d3524[_0x8cac('0x31')]=_[_0x8cac('0x32')](_0x205f0e[_0x8cac('0x30')],qs[_0x8cac('0x33')](_0x563efb['query'][_0x8cac('0x33')]));_0x1d3524[_0x8cac('0x31')]=_0x1d3524[_0x8cac('0x31')][_0x8cac('0x34')]?_0x1d3524[_0x8cac('0x31')]:_0x205f0e['model'];if(_0x563efb[_0x8cac('0x2e')][_0x8cac('0x3f')]){_0x1d3524[_0x8cac('0x40')]=[{'all':!![]}];}_0x1d3524=_[_0x8cac('0x3b')]({},_0x1d3524,_0x563efb['options']);return db['FaxTransferReport'][_0x8cac('0x44')](_0x1d3524)['then'](handleEntityNotFound(_0x2b7e88,null))['then'](respondWithResult(_0x2b7e88,null))[_0x8cac('0x45')](handleError(_0x2b7e88,null));};exports['create']=function(_0x5c4065,_0x536715){return db[_0x8cac('0x27')][_0x8cac('0x46')](_0x5c4065[_0x8cac('0x47')],{})[_0x8cac('0x21')](respondWithResult(_0x536715,0xc9))[_0x8cac('0x45')](handleError(_0x536715,null));};exports[_0x8cac('0x20')]=function(_0x103c96,_0x489962){if(_0x103c96[_0x8cac('0x47')]['id']){delete _0x103c96[_0x8cac('0x47')]['id'];}return db[_0x8cac('0x27')][_0x8cac('0x44')]({'where':{'id':_0x103c96[_0x8cac('0x43')]['id']}})['then'](handleEntityNotFound(_0x489962,null))[_0x8cac('0x21')](saveUpdates(_0x103c96[_0x8cac('0x47')],null))[_0x8cac('0x21')](respondWithResult(_0x489962,null))[_0x8cac('0x45')](handleError(_0x489962,null));};exports[_0x8cac('0x22')]=function(_0x52a209,_0x259779){return db[_0x8cac('0x27')][_0x8cac('0x44')]({'where':{'id':_0x52a209[_0x8cac('0x43')]['id']}})['then'](handleEntityNotFound(_0x259779,null))[_0x8cac('0x21')](removeEntity(_0x259779,null))['catch'](handleError(_0x259779,null));};exports[_0x8cac('0x48')]=function(_0x10f6a7,_0x3d7a68){return db[_0x8cac('0x27')][_0x8cac('0x48')]()[_0x8cac('0x21')](respondWithResult(_0x3d7a68,null))['catch'](handleError(_0x3d7a68,null));}; \ No newline at end of file +var _0x0b4b=['path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','FaxTransferReport','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x0b4b,0x16b));var _0xb0b4=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x0b4b[_0x4c7935];return _0x30651d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0b4('0x0'));var zipdir=require(_0xb0b4('0x1'));var jsonpatch=require(_0xb0b4('0x2'));var rp=require('request-promise');var moment=require(_0xb0b4('0x3'));var BPromise=require(_0xb0b4('0x4'));var Mustache=require(_0xb0b4('0x5'));var util=require(_0xb0b4('0x6'));var path=require(_0xb0b4('0x7'));var sox=require(_0xb0b4('0x8'));var csv=require(_0xb0b4('0x9'));var ejs=require(_0xb0b4('0xa'));var fs=require('fs');var fs_extra=require(_0xb0b4('0xb'));var _=require(_0xb0b4('0xc'));var squel=require(_0xb0b4('0xd'));var crypto=require('crypto');var jsforce=require(_0xb0b4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb0b4('0x9'));var querystring=require(_0xb0b4('0xf'));var Papa=require(_0xb0b4('0x10'));var Redis=require(_0xb0b4('0x11'));var authService=require(_0xb0b4('0x12'));var qs=require(_0xb0b4('0x13'));var as=require(_0xb0b4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0b4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb0b4('0x16'));var licenseUtil=require(_0xb0b4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fecba,_0x1b1d53){_0x1b1d53=_0x1b1d53||0xcc;return function(_0xf77b92){if(_0xf77b92){return _0x1fecba[_0xb0b4('0x18')](_0x1b1d53);}return _0x1fecba[_0xb0b4('0x19')](_0x1b1d53)[_0xb0b4('0x1a')]();};}function respondWithResult(_0x5a7cbc,_0x21dbd5){_0x21dbd5=_0x21dbd5||0xc8;return function(_0x1eb802){if(_0x1eb802){return _0x5a7cbc[_0xb0b4('0x19')](_0x21dbd5)[_0xb0b4('0x1b')](_0x1eb802);}};}function respondWithFilteredResult(_0x568437,_0x1711ad){return function(_0x3d42d6){if(_0x3d42d6){var _0x1531a2=typeof _0x1711ad[_0xb0b4('0x1c')]===_0xb0b4('0x1d')&&typeof _0x1711ad['limit']==='undefined';var _0x38ef43=_0x3d42d6[_0xb0b4('0x1e')];var _0xe61e=_0x1531a2?0x0:_0x1711ad[_0xb0b4('0x1c')];var _0x3f8965=_0x1531a2?_0x3d42d6['count']:_0x1711ad[_0xb0b4('0x1c')]+_0x1711ad['limit'];var _0x4b221c;if(_0x3f8965>=_0x38ef43){_0x3f8965=_0x38ef43;_0x4b221c=0xc8;}else{_0x4b221c=0xce;}_0x568437['status'](_0x4b221c);return _0x568437[_0xb0b4('0x1f')](_0xb0b4('0x20'),_0xe61e+'-'+_0x3f8965+'/'+_0x38ef43)[_0xb0b4('0x1b')](_0x3d42d6);}return null;};}function patchUpdates(_0x505089){return function(_0x305d89){try{jsonpatch['apply'](_0x305d89,_0x505089,!![]);}catch(_0x1aef58){return BPromise[_0xb0b4('0x21')](_0x1aef58);}return _0x305d89[_0xb0b4('0x22')]();};}function saveUpdates(_0x1596fb,_0x588d71){return function(_0x2cd319){if(_0x2cd319){return _0x2cd319[_0xb0b4('0x23')](_0x1596fb)[_0xb0b4('0x24')](function(_0x1bf2e0){return _0x1bf2e0;});}return null;};}function removeEntity(_0x7a71a9,_0x2506d7){return function(_0x55d6ee){if(_0x55d6ee){return _0x55d6ee[_0xb0b4('0x25')]()['then'](function(){_0x7a71a9[_0xb0b4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5d48,_0x350f10){return function(_0x4f50e5){if(!_0x4f50e5){_0x1c5d48[_0xb0b4('0x18')](0x194);}return _0x4f50e5;};}function handleError(_0x567dee,_0x48e65c){_0x48e65c=_0x48e65c||0x1f4;return function(_0x2b9e9e){logger[_0xb0b4('0x26')](_0x2b9e9e[_0xb0b4('0x27')]);if(_0x2b9e9e['name']){delete _0x2b9e9e['name'];}_0x567dee[_0xb0b4('0x19')](_0x48e65c)[_0xb0b4('0x28')](_0x2b9e9e);};}exports[_0xb0b4('0x29')]=function(_0x686d5d,_0x229e12){var _0x529328={},_0x129f3c={},_0x59f094={'count':0x0,'rows':[]};var _0x24efb6=_['map'](db[_0xb0b4('0x2a')]['rawAttributes'],function(_0x47f555){return{'name':_0x47f555[_0xb0b4('0x2b')],'type':_0x47f555[_0xb0b4('0x2c')]['key']};});_0x129f3c[_0xb0b4('0x2d')]=_[_0xb0b4('0x2e')](_0x24efb6,_0xb0b4('0x2f'));_0x129f3c[_0xb0b4('0x30')]=_[_0xb0b4('0x31')](_0x686d5d[_0xb0b4('0x30')]);_0x129f3c['filters']=_[_0xb0b4('0x32')](_0x129f3c[_0xb0b4('0x2d')],_0x129f3c[_0xb0b4('0x30')]);_0x529328[_0xb0b4('0x33')]=_['intersection'](_0x129f3c[_0xb0b4('0x2d')],qs[_0xb0b4('0x34')](_0x686d5d[_0xb0b4('0x30')][_0xb0b4('0x34')]));_0x529328[_0xb0b4('0x33')]=_0x529328[_0xb0b4('0x33')]['length']?_0x529328[_0xb0b4('0x33')]:_0x129f3c[_0xb0b4('0x2d')];if(!_0x686d5d[_0xb0b4('0x30')][_0xb0b4('0x35')](_0xb0b4('0x36'))){_0x529328[_0xb0b4('0x37')]=qs[_0xb0b4('0x37')](_0x686d5d[_0xb0b4('0x30')][_0xb0b4('0x37')]);_0x529328[_0xb0b4('0x1c')]=qs[_0xb0b4('0x1c')](_0x686d5d[_0xb0b4('0x30')]['offset']);}_0x529328[_0xb0b4('0x38')]=qs['sort'](_0x686d5d[_0xb0b4('0x30')][_0xb0b4('0x39')]);_0x529328[_0xb0b4('0x3a')]=qs['filters'](_['pick'](_0x686d5d[_0xb0b4('0x30')],_0x129f3c[_0xb0b4('0x3b')]),_0x24efb6);if(_0x686d5d[_0xb0b4('0x30')][_0xb0b4('0x3c')]){_0x529328[_0xb0b4('0x3a')]=_[_0xb0b4('0x3d')](_0x529328[_0xb0b4('0x3a')],{'$or':_[_0xb0b4('0x2e')](_0x24efb6,function(_0x2567d7){if(_0x2567d7[_0xb0b4('0x2c')]!=='VIRTUAL'){var _0xec1416={};_0xec1416[_0x2567d7[_0xb0b4('0x2f')]]={'$like':'%'+_0x686d5d['query'][_0xb0b4('0x3c')]+'%'};return _0xec1416;}})});}_0x529328=_[_0xb0b4('0x3d')]({},_0x529328,_0x686d5d['options']);var _0x6d17b7={'where':_0x529328[_0xb0b4('0x3a')]};return db['FaxTransferReport'][_0xb0b4('0x1e')](_0x6d17b7)['then'](function(_0x35a34f){_0x59f094[_0xb0b4('0x1e')]=_0x35a34f;if(_0x686d5d[_0xb0b4('0x30')][_0xb0b4('0x3e')]){_0x529328['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xb0b4('0x3f')](_0x529328);})[_0xb0b4('0x24')](function(_0x2ff6a9){_0x59f094[_0xb0b4('0x40')]=_0x2ff6a9;return _0x59f094;})[_0xb0b4('0x24')](respondWithFilteredResult(_0x229e12,_0x529328))[_0xb0b4('0x41')](handleError(_0x229e12,null));};exports[_0xb0b4('0x42')]=function(_0x33902f,_0x44673b){var _0x1ee282={'raw':!![],'where':{'id':_0x33902f['params']['id']}},_0x5d2c83={};_0x5d2c83[_0xb0b4('0x2d')]=_[_0xb0b4('0x31')](db[_0xb0b4('0x2a')]['rawAttributes']);_0x5d2c83[_0xb0b4('0x30')]=_[_0xb0b4('0x31')](_0x33902f[_0xb0b4('0x30')]);_0x5d2c83[_0xb0b4('0x3b')]=_[_0xb0b4('0x32')](_0x5d2c83['model'],_0x5d2c83[_0xb0b4('0x30')]);_0x1ee282[_0xb0b4('0x33')]=_[_0xb0b4('0x32')](_0x5d2c83[_0xb0b4('0x2d')],qs[_0xb0b4('0x34')](_0x33902f[_0xb0b4('0x30')][_0xb0b4('0x34')]));_0x1ee282[_0xb0b4('0x33')]=_0x1ee282['attributes'][_0xb0b4('0x43')]?_0x1ee282[_0xb0b4('0x33')]:_0x5d2c83[_0xb0b4('0x2d')];if(_0x33902f[_0xb0b4('0x30')][_0xb0b4('0x3e')]){_0x1ee282[_0xb0b4('0x44')]=[{'all':!![]}];}_0x1ee282=_[_0xb0b4('0x3d')]({},_0x1ee282,_0x33902f['options']);return db[_0xb0b4('0x2a')][_0xb0b4('0x45')](_0x1ee282)[_0xb0b4('0x24')](handleEntityNotFound(_0x44673b,null))[_0xb0b4('0x24')](respondWithResult(_0x44673b,null))[_0xb0b4('0x41')](handleError(_0x44673b,null));};exports[_0xb0b4('0x46')]=function(_0x143fcf,_0x2f0f0d){return db[_0xb0b4('0x2a')][_0xb0b4('0x46')](_0x143fcf[_0xb0b4('0x47')],{})['then'](respondWithResult(_0x2f0f0d,0xc9))[_0xb0b4('0x41')](handleError(_0x2f0f0d,null));};exports[_0xb0b4('0x23')]=function(_0x4c99e0,_0x29423f){if(_0x4c99e0[_0xb0b4('0x47')]['id']){delete _0x4c99e0[_0xb0b4('0x47')]['id'];}return db[_0xb0b4('0x2a')][_0xb0b4('0x45')]({'where':{'id':_0x4c99e0[_0xb0b4('0x48')]['id']}})[_0xb0b4('0x24')](handleEntityNotFound(_0x29423f,null))[_0xb0b4('0x24')](saveUpdates(_0x4c99e0[_0xb0b4('0x47')],null))[_0xb0b4('0x24')](respondWithResult(_0x29423f,null))[_0xb0b4('0x41')](handleError(_0x29423f,null));};exports[_0xb0b4('0x25')]=function(_0x230aba,_0x26c40a){return db[_0xb0b4('0x2a')][_0xb0b4('0x45')]({'where':{'id':_0x230aba[_0xb0b4('0x48')]['id']}})[_0xb0b4('0x24')](handleEntityNotFound(_0x26c40a,null))[_0xb0b4('0x24')](removeEntity(_0x26c40a,null))[_0xb0b4('0x41')](handleError(_0x26c40a,null));};exports['describe']=function(_0x298a9e,_0xb46dc){return db[_0xb0b4('0x2a')][_0xb0b4('0x49')]()[_0xb0b4('0x24')](respondWithResult(_0xb46dc,null))[_0xb0b4('0x41')](handleError(_0xb46dc,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 36dab4a..3711438 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 _0xf2d3=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0xf2d3,0x1ec));var _0x3f2d=function(_0x5c5a2d,_0x2fc4df){_0x5c5a2d=_0x5c5a2d-0x0;var _0x13a954=_0xf2d3[_0x5c5a2d];return _0x13a954;};'use strict';var _=require(_0x3f2d('0x0'));var util=require(_0x3f2d('0x1'));var logger=require(_0x3f2d('0x2'))('api');var moment=require(_0x3f2d('0x3'));var BPromise=require('bluebird');var rp=require(_0x3f2d('0x4'));var fs=require('fs');var path=require(_0x3f2d('0x5'));var rimraf=require(_0x3f2d('0x6'));var config=require(_0x3f2d('0x7'));var attributes=require(_0x3f2d('0x8'));module[_0x3f2d('0x9')]=function(_0x12d9ec,_0x345593){return _0x12d9ec[_0x3f2d('0xa')](_0x3f2d('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x3f2d('0xc'),'fields':[_0x3f2d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x960c=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x518ef2,_0x286e2e){var _0x44521c=function(_0x2a63f1){while(--_0x2a63f1){_0x518ef2['push'](_0x518ef2['shift']());}};_0x44521c(++_0x286e2e);}(_0x960c,0x8f));var _0xc960=function(_0x250c07,_0x5d3cca){_0x250c07=_0x250c07-0x0;var _0x308707=_0x960c[_0x250c07];return _0x308707;};'use strict';var _=require(_0xc960('0x0'));var util=require('util');var logger=require(_0xc960('0x1'))(_0xc960('0x2'));var moment=require(_0xc960('0x3'));var BPromise=require(_0xc960('0x4'));var rp=require(_0xc960('0x5'));var fs=require('fs');var path=require(_0xc960('0x6'));var rimraf=require(_0xc960('0x7'));var config=require('../../config/environment');var attributes=require(_0xc960('0x8'));module[_0xc960('0x9')]=function(_0x51efaf,_0x1e7a6f){return _0x51efaf['define'](_0xc960('0xa'),attributes,{'tableName':_0xc960('0xb'),'paranoid':![],'indexes':[{'name':_0xc960('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 098d641..1b12b57 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 _0x3739=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3739,0x1b4));var _0x9373=function(_0x252a30,_0x14fcb7){_0x252a30=_0x252a30-0x0;var _0x1e4b58=_0x3739[_0x252a30];return _0x1e4b58;};'use strict';var _=require('lodash');var util=require(_0x9373('0x0'));var moment=require(_0x9373('0x1'));var BPromise=require(_0x9373('0x2'));var rs=require(_0x9373('0x3'));var fs=require('fs');var Redis=require(_0x9373('0x4'));var db=require(_0x9373('0x5'))['db'];var utils=require(_0x9373('0x6'));var logger=require(_0x9373('0x7'))(_0x9373('0x8'));var config=require(_0x9373('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9373('0xa')][_0x9373('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b70c9,_0x56f711,_0x40fd10){return new BPromise(function(_0x576d10,_0x312e11){return client[_0x9373('0xc')](_0x4b70c9,_0x40fd10)[_0x9373('0xd')](function(_0x4b3258){logger[_0x9373('0xe')](_0x9373('0xf'),_0x56f711,_0x9373('0x10'));logger[_0x9373('0x11')](_0x9373('0x12'),_0x56f711,_0x9373('0x10'),JSON[_0x9373('0x13')](_0x4b3258));if(_0x4b3258['error']){if(_0x4b3258[_0x9373('0x14')][_0x9373('0x15')]===0x1f4){logger[_0x9373('0x14')](_0x9373('0xf'),_0x56f711,_0x4b3258['error'][_0x9373('0x16')]);return _0x312e11(_0x4b3258['error'][_0x9373('0x16')]);}logger[_0x9373('0x14')](_0x9373('0xf'),_0x56f711,_0x4b3258['error']['message']);return _0x576d10(_0x4b3258[_0x9373('0x14')]['message']);}else{logger[_0x9373('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x56f711,_0x9373('0x10'));_0x576d10(_0x4b3258[_0x9373('0x17')][_0x9373('0x16')]);}})[_0x9373('0x18')](function(_0x207d85){logger[_0x9373('0x14')](_0x9373('0xf'),_0x56f711,_0x207d85);_0x312e11(_0x207d85);});});} \ No newline at end of file +var _0x16e8=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x51baa0,_0xd121f3){var _0x2cc102=function(_0x1400df){while(--_0x1400df){_0x51baa0['push'](_0x51baa0['shift']());}};_0x2cc102(++_0xd121f3);}(_0x16e8,0x12c));var _0x816e=function(_0x2a767b,_0x381d6b){_0x2a767b=_0x2a767b-0x0;var _0x6c3d17=_0x16e8[_0x2a767b];return _0x6c3d17;};'use strict';var _=require('lodash');var util=require(_0x816e('0x0'));var moment=require('moment');var BPromise=require(_0x816e('0x1'));var rs=require(_0x816e('0x2'));var fs=require('fs');var Redis=require(_0x816e('0x3'));var db=require(_0x816e('0x4'))['db'];var utils=require(_0x816e('0x5'));var logger=require(_0x816e('0x6'))('rpc');var config=require(_0x816e('0x7'));var jayson=require(_0x816e('0x8'));var client=jayson[_0x816e('0x9')][_0x816e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5eff15,_0x37628b,_0x2db390){return new BPromise(function(_0x323783,_0x3891ae){return client['request'](_0x5eff15,_0x2db390)['then'](function(_0x7f8a9e){logger[_0x816e('0xb')](_0x816e('0xc'),_0x37628b,_0x816e('0xd'));logger[_0x816e('0xe')](_0x816e('0xf'),_0x37628b,_0x816e('0xd'),JSON['stringify'](_0x7f8a9e));if(_0x7f8a9e[_0x816e('0x10')]){if(_0x7f8a9e[_0x816e('0x10')][_0x816e('0x11')]===0x1f4){logger[_0x816e('0x10')](_0x816e('0xc'),_0x37628b,_0x7f8a9e[_0x816e('0x10')]['message']);return _0x3891ae(_0x7f8a9e[_0x816e('0x10')][_0x816e('0x12')]);}logger['error'](_0x816e('0xc'),_0x37628b,_0x7f8a9e['error'][_0x816e('0x12')]);return _0x323783(_0x7f8a9e['error']['message']);}else{logger[_0x816e('0xb')](_0x816e('0xc'),_0x37628b,_0x816e('0xd'));_0x323783(_0x7f8a9e[_0x816e('0x13')][_0x816e('0x12')]);}})['catch'](function(_0x964333){logger[_0x816e('0x10')](_0x816e('0xc'),_0x37628b,_0x964333);_0x3891ae(_0x964333);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index a8584c5..daafbc6 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 _0x3c22=['get','isAuthenticated','/describe','describe','/:id','post','put','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f797d,_0x262d51){var _0x1fc012=function(_0x270870){while(--_0x270870){_0x3f797d['push'](_0x3f797d['shift']());}};_0x1fc012(++_0x262d51);}(_0x3c22,0x1cb));var _0x23c2=function(_0x9941e1,_0x1523ac){_0x9941e1=_0x9941e1-0x0;var _0x290931=_0x3c22[_0x9941e1];return _0x290931;};'use strict';var multer=require(_0x23c2('0x0'));var util=require(_0x23c2('0x1'));var path=require(_0x23c2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x23c2('0x3'));var auth=require(_0x23c2('0x4'));var interaction=require(_0x23c2('0x5'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x23c2('0x6')]('/',auth[_0x23c2('0x7')](),controller['index']);router[_0x23c2('0x6')](_0x23c2('0x8'),auth[_0x23c2('0x7')](),controller[_0x23c2('0x9')]);router['get'](_0x23c2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x23c2('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x23c2('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x23c2('0xd')]('/:id',auth[_0x23c2('0x7')](),controller['destroy']);module[_0x23c2('0xe')]=router; \ No newline at end of file +var _0x54fe=['/describe','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index'];(function(_0x539587,_0x71b591){var _0x305e15=function(_0x168891){while(--_0x168891){_0x539587['push'](_0x539587['shift']());}};_0x305e15(++_0x71b591);}(_0x54fe,0x1c3));var _0xe54f=function(_0x113a1a,_0x22a2c9){_0x113a1a=_0x113a1a-0x0;var _0x14d16e=_0x54fe[_0x113a1a];return _0x14d16e;};'use strict';var multer=require(_0xe54f('0x0'));var util=require(_0xe54f('0x1'));var path=require(_0xe54f('0x2'));var timeout=require(_0xe54f('0x3'));var express=require(_0xe54f('0x4'));var router=express[_0xe54f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe54f('0x6'));var controller=require(_0xe54f('0x7'));router[_0xe54f('0x8')]('/',auth[_0xe54f('0x9')](),controller[_0xe54f('0xa')]);router[_0xe54f('0x8')](_0xe54f('0xb'),auth[_0xe54f('0x9')](),controller[_0xe54f('0xc')]);router[_0xe54f('0x8')]('/:id',auth[_0xe54f('0x9')](),controller[_0xe54f('0xd')]);router[_0xe54f('0xe')]('/',auth[_0xe54f('0x9')](),controller[_0xe54f('0xf')]);router[_0xe54f('0x10')](_0xe54f('0x11'),auth['isAuthenticated'](),controller[_0xe54f('0x12')]);router[_0xe54f('0x13')](_0xe54f('0x11'),auth[_0xe54f('0x9')](),controller['destroy']);module[_0xe54f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index d50f518..f65fcd0 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 _0x53c5=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x53c5,0x8f));var _0x553c=function(_0x463c41,_0x44291f){_0x463c41=_0x463c41-0x0;var _0x39463b=_0x53c5[_0x463c41];return _0x39463b;};'use strict';var multer=require(_0x553c('0x0'));var util=require(_0x553c('0x1'));var path=require(_0x553c('0x2'));var timeout=require(_0x553c('0x3'));var express=require('express');var router=express[_0x553c('0x4')]();var fs_extra=require(_0x553c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x553c('0x6'));var config=require(_0x553c('0x7'));var controller=require('./intDeskAccount.controller');router[_0x553c('0x8')]('/',auth[_0x553c('0x9')](),controller[_0x553c('0xa')]);router[_0x553c('0x8')](_0x553c('0xb'),auth['isAuthenticated'](),controller[_0x553c('0xc')]);router[_0x553c('0x8')](_0x553c('0xd'),auth[_0x553c('0x9')](),controller[_0x553c('0xe')]);router['get']('/:id/fields',auth[_0x553c('0x9')](),controller[_0x553c('0xf')]);router[_0x553c('0x10')]('/',auth[_0x553c('0x9')](),controller[_0x553c('0x11')]);router[_0x553c('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x553c('0x12')]('/:id',auth[_0x553c('0x9')](),controller[_0x553c('0x13')]);router[_0x553c('0x14')](_0x553c('0xb'),auth[_0x553c('0x9')](),controller[_0x553c('0x15')]);module[_0x553c('0x16')]=router; \ No newline at end of file +var _0x2772=['get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x2a56cc,_0xa378fa){var _0x76108b=function(_0x2dbf88){while(--_0x2dbf88){_0x2a56cc['push'](_0x2a56cc['shift']());}};_0x76108b(++_0xa378fa);}(_0x2772,0x1dc));var _0x2277=function(_0x1206be,_0x3f10ca){_0x1206be=_0x1206be-0x0;var _0x45bff6=_0x2772[_0x1206be];return _0x45bff6;};'use strict';var multer=require(_0x2277('0x0'));var util=require(_0x2277('0x1'));var path=require(_0x2277('0x2'));var timeout=require('connect-timeout');var express=require(_0x2277('0x3'));var router=express[_0x2277('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2277('0x5'));var config=require(_0x2277('0x6'));var controller=require(_0x2277('0x7'));router[_0x2277('0x8')]('/',auth[_0x2277('0x9')](),controller[_0x2277('0xa')]);router['get'](_0x2277('0xb'),auth[_0x2277('0x9')](),controller[_0x2277('0xc')]);router[_0x2277('0x8')]('/:id/configurations',auth[_0x2277('0x9')](),controller[_0x2277('0xd')]);router[_0x2277('0x8')]('/:id/fields',auth[_0x2277('0x9')](),controller[_0x2277('0xe')]);router[_0x2277('0xf')]('/',auth[_0x2277('0x9')](),controller[_0x2277('0x10')]);router[_0x2277('0xf')](_0x2277('0x11'),auth[_0x2277('0x9')](),controller[_0x2277('0x12')]);router[_0x2277('0x13')](_0x2277('0xb'),auth[_0x2277('0x9')](),controller[_0x2277('0x14')]);router['delete'](_0x2277('0xb'),auth[_0x2277('0x9')](),controller['destroy']);module[_0x2277('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 398724f..8bd73c1 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 _0x21ef=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x21ef,0x1cb));var _0xf21e=function(_0xc62eb0,_0x3169b6){_0xc62eb0=_0xc62eb0-0x0;var _0x215c9a=_0x21ef[_0xc62eb0];return _0x215c9a;};'use strict';var Sequelize=require(_0xf21e('0x0'));module[_0xf21e('0x1')]={'name':{'type':Sequelize[_0xf21e('0x2')]},'description':{'type':Sequelize[_0xf21e('0x2')]},'username':{'type':Sequelize[_0xf21e('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xf21e('0x3')]('basic'),'defaultValue':_0xf21e('0x4')},'password':{'type':Sequelize[_0xf21e('0x2')]},'consumerKey':{'type':Sequelize[_0xf21e('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xf21e('0x2')]},'serverUrl':{'type':Sequelize[_0xf21e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf21e('0x3')](_0xf21e('0x5'),_0xf21e('0x6')),'defaultValue':_0xf21e('0x5')}}; \ No newline at end of file +var _0xf428=['exports','STRING','basic','ENUM','newTab','integrationTab'];(function(_0x4eb13e,_0x832e7b){var _0xca6e0=function(_0x3c4e28){while(--_0x3c4e28){_0x4eb13e['push'](_0x4eb13e['shift']());}};_0xca6e0(++_0x832e7b);}(_0xf428,0xba));var _0x8f42=function(_0x3f2718,_0xca081e){_0x3f2718=_0x3f2718-0x0;var _0x4cd4b5=_0xf428[_0x3f2718];return _0x4cd4b5;};'use strict';var Sequelize=require('sequelize');module[_0x8f42('0x0')]={'name':{'type':Sequelize[_0x8f42('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8f42('0x1')]},'remoteUri':{'type':Sequelize[_0x8f42('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x8f42('0x2')),'defaultValue':_0x8f42('0x2')},'password':{'type':Sequelize[_0x8f42('0x1')]},'consumerKey':{'type':Sequelize[_0x8f42('0x1')]},'consumerSecret':{'type':Sequelize[_0x8f42('0x1')]},'token':{'type':Sequelize[_0x8f42('0x1')]},'tokenSecret':{'type':Sequelize[_0x8f42('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8f42('0x3')]('integrationTab',_0x8f42('0x4')),'defaultValue':_0x8f42('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index fbb7406..1b0daff 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 _0x2078=['key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','DeskAccount','include','catch','params','keys','rawAttributes','includeAll','find','create','update','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','getSubjects','getDescriptions','channel','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','basic','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','undefined','limit','count','offset','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','fieldName','type'];(function(_0x312a7f,_0x509e83){var _0x2fb5ba=function(_0x3dcdea){while(--_0x3dcdea){_0x312a7f['push'](_0x312a7f['shift']());}};_0x2fb5ba(++_0x509e83);}(_0x2078,0xaf));var _0x8207=function(_0x1ddb6b,_0x22f207){_0x1ddb6b=_0x1ddb6b-0x0;var _0x34220c=_0x2078[_0x1ddb6b];return _0x34220c;};'use strict';var emlformat=require(_0x8207('0x0'));var rimraf=require(_0x8207('0x1'));var zipdir=require(_0x8207('0x2'));var jsonpatch=require(_0x8207('0x3'));var rp=require('request-promise');var moment=require(_0x8207('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8207('0x5'));var util=require(_0x8207('0x6'));var path=require(_0x8207('0x7'));var sox=require(_0x8207('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8207('0x9'));var squel=require(_0x8207('0xa'));var crypto=require(_0x8207('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8207('0xc'));var toCsv=require(_0x8207('0xd'));var querystring=require(_0x8207('0xe'));var Papa=require(_0x8207('0xf'));var Redis=require('ioredis');var authService=require(_0x8207('0x10'));var qs=require(_0x8207('0x11'));var as=require(_0x8207('0x12'));var hardwareService=require(_0x8207('0x13'));var logger=require(_0x8207('0x14'))(_0x8207('0x15'));var utils=require('../../config/utils');var config=require(_0x8207('0x16'));var licenseUtil=require(_0x8207('0x17'));var db=require(_0x8207('0x18'))['db'];var integrations=require(_0x8207('0x19'));function respondWithStatusCode(_0x1dfde1,_0x2be7b2){_0x2be7b2=_0x2be7b2||0xcc;return function(_0x2230a7){if(_0x2230a7){return _0x1dfde1['sendStatus'](_0x2be7b2);}return _0x1dfde1['status'](_0x2be7b2)[_0x8207('0x1a')]();};}function respondWithResult(_0x49a709,_0x4c5a4b){_0x4c5a4b=_0x4c5a4b||0xc8;return function(_0x46e5a4){if(_0x46e5a4){return _0x49a709[_0x8207('0x1b')](_0x4c5a4b)[_0x8207('0x1c')](_0x46e5a4);}};}function respondWithFilteredResult(_0x3ba62c,_0x43037e){return function(_0x5bfc2a){if(_0x5bfc2a){var _0x2da49c=typeof _0x43037e['offset']===_0x8207('0x1d')&&typeof _0x43037e[_0x8207('0x1e')]===_0x8207('0x1d');var _0x14c7a5=_0x5bfc2a['count'];var _0x3aef40=_0x2da49c?0x0:_0x43037e['offset'];var _0x271b0c=_0x2da49c?_0x5bfc2a[_0x8207('0x1f')]:_0x43037e[_0x8207('0x20')]+_0x43037e[_0x8207('0x1e')];var _0x2ca482;if(_0x271b0c>=_0x14c7a5){_0x271b0c=_0x14c7a5;_0x2ca482=0xc8;}else{_0x2ca482=0xce;}_0x3ba62c[_0x8207('0x1b')](_0x2ca482);return _0x3ba62c[_0x8207('0x21')]('Content-Range',_0x3aef40+'-'+_0x271b0c+'/'+_0x14c7a5)[_0x8207('0x1c')](_0x5bfc2a);}return null;};}function patchUpdates(_0x1437ca){return function(_0x2c8698){try{jsonpatch[_0x8207('0x22')](_0x2c8698,_0x1437ca,!![]);}catch(_0xe8e5c){return BPromise[_0x8207('0x23')](_0xe8e5c);}return _0x2c8698['save']();};}function saveUpdates(_0x322d3c,_0x44bb9c){return function(_0x325eed){if(_0x325eed){return _0x325eed['update'](_0x322d3c)[_0x8207('0x24')](function(_0x11ac64){return _0x11ac64;});}return null;};}function removeEntity(_0x4a2e68,_0x540b9d){return function(_0x48bcf1){if(_0x48bcf1){return _0x48bcf1[_0x8207('0x25')]()[_0x8207('0x24')](function(){_0x4a2e68[_0x8207('0x1b')](0xcc)[_0x8207('0x1a')]();});}};}function handleEntityNotFound(_0x138152,_0x159c0c){return function(_0x1e957b){if(!_0x1e957b){_0x138152[_0x8207('0x26')](0x194);}return _0x1e957b;};}function handleError(_0x30ec31,_0x18a1dc){_0x18a1dc=_0x18a1dc||0x1f4;return function(_0x2cb1c7){logger[_0x8207('0x27')](_0x2cb1c7[_0x8207('0x28')]);if(_0x2cb1c7[_0x8207('0x29')]){delete _0x2cb1c7['name'];}_0x30ec31[_0x8207('0x1b')](_0x18a1dc)[_0x8207('0x2a')](_0x2cb1c7);};}exports['index']=function(_0x5e7e19,_0x367b13){var _0x464ecf={},_0x264eb6={},_0x3c3e65={'count':0x0,'rows':[]};var _0xedda00=_['map'](db['DeskAccount']['rawAttributes'],function(_0x3f1d5d){return{'name':_0x3f1d5d[_0x8207('0x2b')],'type':_0x3f1d5d[_0x8207('0x2c')][_0x8207('0x2d')]};});_0x264eb6[_0x8207('0x2e')]=_['map'](_0xedda00,_0x8207('0x29'));_0x264eb6[_0x8207('0x2f')]=_['keys'](_0x5e7e19[_0x8207('0x2f')]);_0x264eb6[_0x8207('0x30')]=_[_0x8207('0x31')](_0x264eb6[_0x8207('0x2e')],_0x264eb6['query']);_0x464ecf[_0x8207('0x32')]=_[_0x8207('0x31')](_0x264eb6['model'],qs['fields'](_0x5e7e19[_0x8207('0x2f')][_0x8207('0x33')]));_0x464ecf[_0x8207('0x32')]=_0x464ecf[_0x8207('0x32')][_0x8207('0x34')]?_0x464ecf['attributes']:_0x264eb6[_0x8207('0x2e')];if(!_0x5e7e19[_0x8207('0x2f')]['hasOwnProperty'](_0x8207('0x35'))){_0x464ecf[_0x8207('0x1e')]=qs[_0x8207('0x1e')](_0x5e7e19['query'][_0x8207('0x1e')]);_0x464ecf[_0x8207('0x20')]=qs['offset'](_0x5e7e19[_0x8207('0x2f')]['offset']);}_0x464ecf['order']=qs[_0x8207('0x36')](_0x5e7e19[_0x8207('0x2f')][_0x8207('0x36')]);_0x464ecf[_0x8207('0x37')]=qs[_0x8207('0x30')](_[_0x8207('0x38')](_0x5e7e19[_0x8207('0x2f')],_0x264eb6[_0x8207('0x30')]),_0xedda00);if(_0x5e7e19['query'][_0x8207('0x39')]){_0x464ecf[_0x8207('0x37')]=_[_0x8207('0x3a')](_0x464ecf[_0x8207('0x37')],{'$or':_[_0x8207('0x3b')](_0xedda00,function(_0x5dff51){if(_0x5dff51[_0x8207('0x2c')]!==_0x8207('0x3c')){var _0x403da6={};_0x403da6[_0x5dff51[_0x8207('0x29')]]={'$like':'%'+_0x5e7e19['query']['filter']+'%'};return _0x403da6;}})});}_0x464ecf=_[_0x8207('0x3a')]({},_0x464ecf,_0x5e7e19[_0x8207('0x3d')]);var _0xa343ca={'where':_0x464ecf[_0x8207('0x37')]};return db[_0x8207('0x3e')]['count'](_0xa343ca)[_0x8207('0x24')](function(_0x10e79d){_0x3c3e65[_0x8207('0x1f')]=_0x10e79d;if(_0x5e7e19[_0x8207('0x2f')]['includeAll']){_0x464ecf[_0x8207('0x3f')]=[{'all':!![]}];}return db[_0x8207('0x3e')]['findAll'](_0x464ecf);})['then'](function(_0x574c47){_0x3c3e65['rows']=_0x574c47;return _0x3c3e65;})['then'](respondWithFilteredResult(_0x367b13,_0x464ecf))[_0x8207('0x40')](handleError(_0x367b13,null));};exports['show']=function(_0x566c5a,_0x90e766){var _0x31c681={'raw':![],'where':{'id':_0x566c5a[_0x8207('0x41')]['id']}},_0x41d974={};_0x41d974[_0x8207('0x2e')]=_[_0x8207('0x42')](db[_0x8207('0x3e')][_0x8207('0x43')]);_0x41d974['query']=_[_0x8207('0x42')](_0x566c5a[_0x8207('0x2f')]);_0x41d974[_0x8207('0x30')]=_[_0x8207('0x31')](_0x41d974[_0x8207('0x2e')],_0x41d974[_0x8207('0x2f')]);_0x31c681[_0x8207('0x32')]=_[_0x8207('0x31')](_0x41d974[_0x8207('0x2e')],qs['fields'](_0x566c5a[_0x8207('0x2f')][_0x8207('0x33')]));_0x31c681[_0x8207('0x32')]=_0x31c681[_0x8207('0x32')][_0x8207('0x34')]?_0x31c681[_0x8207('0x32')]:_0x41d974[_0x8207('0x2e')];if(_0x566c5a[_0x8207('0x2f')][_0x8207('0x44')]){_0x31c681[_0x8207('0x3f')]=[{'all':!![]}];}_0x31c681=_[_0x8207('0x3a')]({},_0x31c681,_0x566c5a['options']);return db[_0x8207('0x3e')][_0x8207('0x45')](_0x31c681)[_0x8207('0x24')](handleEntityNotFound(_0x90e766,null))[_0x8207('0x24')](respondWithResult(_0x90e766,null))['catch'](handleError(_0x90e766,null));};exports['create']=function(_0x347d96,_0xbb736f){return db[_0x8207('0x3e')][_0x8207('0x46')](_0x347d96['body'],{})['then'](respondWithResult(_0xbb736f,0xc9))[_0x8207('0x40')](handleError(_0xbb736f,null));};exports[_0x8207('0x47')]=function(_0x584920,_0x3d6094){if(_0x584920[_0x8207('0x48')]['id']){delete _0x584920['body']['id'];}return db['DeskAccount'][_0x8207('0x45')]({'where':{'id':_0x584920['params']['id']}})[_0x8207('0x24')](handleEntityNotFound(_0x3d6094,null))[_0x8207('0x24')](saveUpdates(_0x584920[_0x8207('0x48')],null))['then'](respondWithResult(_0x3d6094,null))[_0x8207('0x40')](handleError(_0x3d6094,null));};exports[_0x8207('0x25')]=function(_0xce8f04,_0x1351dd){return db[_0x8207('0x3e')][_0x8207('0x45')]({'where':{'id':_0xce8f04[_0x8207('0x41')]['id']}})[_0x8207('0x24')](handleEntityNotFound(_0x1351dd,null))['then'](removeEntity(_0x1351dd,null))['catch'](handleError(_0x1351dd,null));};exports[_0x8207('0x49')]=function(_0xeb0ae4,_0x59aaf6,_0x45f3f1){var _0x1a2e4a={};var _0x5b713a={};var _0x16791f;var _0x233454;return db[_0x8207('0x3e')][_0x8207('0x4a')]({'where':{'id':_0xeb0ae4[_0x8207('0x41')]['id']}})[_0x8207('0x24')](handleEntityNotFound(_0x59aaf6,null))[_0x8207('0x24')](function(_0x1e0cd0){if(_0x1e0cd0){_0x16791f=_0x1e0cd0;_0x5b713a[_0x8207('0x2e')]=_['keys'](db[_0x8207('0x4b')][_0x8207('0x43')]);_0x5b713a[_0x8207('0x2f')]=_[_0x8207('0x42')](_0xeb0ae4[_0x8207('0x2f')]);_0x5b713a[_0x8207('0x30')]=_[_0x8207('0x31')](_0x5b713a[_0x8207('0x2e')],_0x5b713a[_0x8207('0x2f')]);_0x1a2e4a['attributes']=_[_0x8207('0x31')](_0x5b713a[_0x8207('0x2e')],qs[_0x8207('0x33')](_0xeb0ae4['query']['fields']));_0x1a2e4a[_0x8207('0x32')]=_0x1a2e4a['attributes'][_0x8207('0x34')]?_0x1a2e4a[_0x8207('0x32')]:_0x5b713a[_0x8207('0x2e')];_0x1a2e4a['order']=qs[_0x8207('0x36')](_0xeb0ae4[_0x8207('0x2f')]['sort']);_0x1a2e4a[_0x8207('0x37')]=qs[_0x8207('0x30')](_['pick'](_0xeb0ae4['query'],_0x5b713a[_0x8207('0x30')]));if(_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x39')]){_0x1a2e4a[_0x8207('0x37')]=_['merge'](_0x1a2e4a['where'],{'$or':_[_0x8207('0x3b')](_0x1a2e4a[_0x8207('0x32')],function(_0x30c1e6){var _0x1766e2={};_0x1766e2[_0x30c1e6]={'$like':'%'+_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x39')]+'%'};return _0x1766e2;})});}_0x1a2e4a=_[_0x8207('0x3a')]({},_0x1a2e4a,_0xeb0ae4[_0x8207('0x3d')]);return _0x16791f[_0x8207('0x49')](_0x1a2e4a);}})[_0x8207('0x24')](function(_0x558463){if(_0x558463){_0x233454=_0x558463[_0x8207('0x34')];if(!_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x4c')](_0x8207('0x35'))){_0x1a2e4a[_0x8207('0x1e')]=qs[_0x8207('0x1e')](_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x1e')]);_0x1a2e4a[_0x8207('0x20')]=qs['offset'](_0xeb0ae4[_0x8207('0x2f')][_0x8207('0x20')]);}return _0x16791f[_0x8207('0x49')](_0x1a2e4a);}})[_0x8207('0x24')](function(_0xbb5477){if(_0xbb5477){return _0xbb5477?{'count':_0x233454,'rows':_0xbb5477}:null;}})[_0x8207('0x24')](respondWithResult(_0x59aaf6,null))[_0x8207('0x40')](handleError(_0x59aaf6,null));};exports['addConfiguration']=function(_0x1a0a2e,_0x13f7d2,_0x3a2a42){if(_0x1a0a2e[_0x8207('0x48')]['id']){delete _0x1a0a2e['body']['id'];}return db['DeskAccount'][_0x8207('0x4a')]({'where':{'id':_0x1a0a2e[_0x8207('0x41')]['id']}})[_0x8207('0x24')](handleEntityNotFound(_0x13f7d2,null))['then'](function(_0x159b8b){if(_0x159b8b){_0x1a0a2e[_0x8207('0x48')]['AccountId']=_0x159b8b['id'];_0x1a0a2e[_0x8207('0x48')]['Subjects']=integrations[_0x8207('0x4d')](_0x1a0a2e[_0x8207('0x48')]['channel'],_0x1a0a2e[_0x8207('0x48')][_0x8207('0x2c')]);_0x1a0a2e[_0x8207('0x48')]['Descriptions']=integrations[_0x8207('0x4e')](_0x1a0a2e['body'][_0x8207('0x4f')],_0x1a0a2e['body'][_0x8207('0x2c')]);return db[_0x8207('0x4b')][_0x8207('0x46')](_0x1a0a2e[_0x8207('0x48')],{'include':[{'model':db[_0x8207('0x50')],'as':'Subjects'},{'model':db[_0x8207('0x50')],'as':_0x8207('0x51')}]});}return null;})[_0x8207('0x24')](respondWithResult(_0x13f7d2,null))[_0x8207('0x40')](handleError(_0x13f7d2,null));};exports[_0x8207('0x52')]=function(_0x370aeb,_0x32c8cc,_0x447e22){var _0x7ce912=[{'name':_0x8207('0x53'),'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 _0x5a43da='';return db[_0x8207('0x3e')]['findOne']({'where':{'id':_0x370aeb[_0x8207('0x41')]['id']},'attributes':['id',_0x8207('0x54'),_0x8207('0x55'),_0x8207('0x56'),_0x8207('0x57'),'consumerKey','consumerSecret',_0x8207('0x58'),_0x8207('0x59')]})[_0x8207('0x24')](handleEntityNotFound(_0x32c8cc,null))[_0x8207('0x24')](function(_0x4459ae){if(_0x4459ae){_0x5a43da=_0x4459ae[_0x8207('0x54')];var _0x1f6016=_0x5a43da[_0x8207('0x5a')](-0x1);if(_0x1f6016==='/'){_0x5a43da=_0x5a43da[_0x8207('0x5b')](0x0,_0x5a43da[_0x8207('0x5c')](_0x1f6016));}var _0x5b642f={'method':_0x8207('0x5d'),'uri':util[_0x8207('0x5e')](_0x8207('0x5f'),_0x5a43da),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x4459ae['authType']===_0x8207('0x60')){_0x5b642f[_0x8207('0x61')]['Authorization']=util[_0x8207('0x5e')](_0x8207('0x62'),new Buffer(util['format'](_0x8207('0x63'),_0x4459ae[_0x8207('0x56')],_0x4459ae[_0x8207('0x57')]))[_0x8207('0x64')](_0x8207('0x65')));}return rp(_0x5b642f)[_0x8207('0x24')](function(_0x16e52a){return _0x7ce912[_0x8207('0x66')](_[_0x8207('0x3b')](_0x16e52a[_0x8207('0x67')][_0x8207('0x68')],function(_0x129b7f){return{'id':_0x129b7f[_0x8207('0x29')],'name':_0x129b7f[_0x8207('0x29')],'type':_0x129b7f[_0x8207('0x2c')],'active':_0x129b7f['active'],'label':_0x129b7f['label'],'custom':!![]};}));});}})['then'](function(_0x287c0f){return{'count':_0x287c0f[_0x8207('0x34')],'rows':_0x287c0f};})[_0x8207('0x24')](respondWithResult(_0x32c8cc,null))['catch'](function(_0x546bec){var _0x2c938c=_0x370aeb[_0x8207('0x2f')][_0x8207('0x69')]?0x1f4:_0x546bec[_0x8207('0x6a')]||0x1f4;logger[_0x8207('0x27')](_0x8207('0x6b'),_0x8207('0x52'),_0x2c938c,JSON[_0x8207('0x6c')](_0x546bec));delete _0x546bec[_0x8207('0x29')];if(_0x2c938c===0x191){_0x2c938c=0x190;}_0x32c8cc[_0x8207('0x1b')](_0x2c938c)['send'](_0x370aeb[_0x8207('0x2f')][_0x8207('0x69')]?{'message':_0x8207('0x6d'),'statusCode':_0x546bec[_0x8207('0x6a')]}:_0x546bec);});}; \ No newline at end of file +var _0x1f2d=['show','rawAttributes','find','create','body','update','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getFields','priority','authType','username','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','application/json','headers','Authorization','Basic\x20%s','%s:%s','password','concat','_embedded','entries','active','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','DeskAccount','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x23579a,_0x21e424){var _0x37be22=function(_0x5a46e3){while(--_0x5a46e3){_0x23579a['push'](_0x23579a['shift']());}};_0x37be22(++_0x21e424);}(_0x1f2d,0x1ef));var _0xd1f2=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0x1f2d[_0x4c73ac];return _0x9839ee;};'use strict';var emlformat=require(_0xd1f2('0x0'));var rimraf=require(_0xd1f2('0x1'));var zipdir=require(_0xd1f2('0x2'));var jsonpatch=require(_0xd1f2('0x3'));var rp=require(_0xd1f2('0x4'));var moment=require(_0xd1f2('0x5'));var BPromise=require(_0xd1f2('0x6'));var Mustache=require(_0xd1f2('0x7'));var util=require(_0xd1f2('0x8'));var path=require(_0xd1f2('0x9'));var sox=require(_0xd1f2('0xa'));var csv=require(_0xd1f2('0xb'));var ejs=require(_0xd1f2('0xc'));var fs=require('fs');var fs_extra=require(_0xd1f2('0xd'));var _=require(_0xd1f2('0xe'));var squel=require(_0xd1f2('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd1f2('0xb'));var querystring=require(_0xd1f2('0x10'));var Papa=require(_0xd1f2('0x11'));var Redis=require(_0xd1f2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd1f2('0x13'));var as=require(_0xd1f2('0x14'));var hardwareService=require(_0xd1f2('0x15'));var logger=require(_0xd1f2('0x16'))(_0xd1f2('0x17'));var utils=require(_0xd1f2('0x18'));var config=require(_0xd1f2('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd1f2('0x1a'));function respondWithStatusCode(_0x596b87,_0x97ab07){_0x97ab07=_0x97ab07||0xcc;return function(_0x321c8f){if(_0x321c8f){return _0x596b87[_0xd1f2('0x1b')](_0x97ab07);}return _0x596b87['status'](_0x97ab07)[_0xd1f2('0x1c')]();};}function respondWithResult(_0x28047e,_0x56a012){_0x56a012=_0x56a012||0xc8;return function(_0x53168b){if(_0x53168b){return _0x28047e[_0xd1f2('0x1d')](_0x56a012)['json'](_0x53168b);}};}function respondWithFilteredResult(_0x5f2a5c,_0x23efa2){return function(_0x21cfec){if(_0x21cfec){var _0x44f8bb=typeof _0x23efa2[_0xd1f2('0x1e')]===_0xd1f2('0x1f')&&typeof _0x23efa2[_0xd1f2('0x20')]===_0xd1f2('0x1f');var _0x4762bd=_0x21cfec[_0xd1f2('0x21')];var _0x489321=_0x44f8bb?0x0:_0x23efa2[_0xd1f2('0x1e')];var _0x4529dd=_0x44f8bb?_0x21cfec['count']:_0x23efa2[_0xd1f2('0x1e')]+_0x23efa2[_0xd1f2('0x20')];var _0x58039b;if(_0x4529dd>=_0x4762bd){_0x4529dd=_0x4762bd;_0x58039b=0xc8;}else{_0x58039b=0xce;}_0x5f2a5c[_0xd1f2('0x1d')](_0x58039b);return _0x5f2a5c[_0xd1f2('0x22')]('Content-Range',_0x489321+'-'+_0x4529dd+'/'+_0x4762bd)[_0xd1f2('0x23')](_0x21cfec);}return null;};}function patchUpdates(_0x2107c1){return function(_0x147db8){try{jsonpatch[_0xd1f2('0x24')](_0x147db8,_0x2107c1,!![]);}catch(_0x418509){return BPromise[_0xd1f2('0x25')](_0x418509);}return _0x147db8[_0xd1f2('0x26')]();};}function saveUpdates(_0x593406,_0x36d7f2){return function(_0x4e3c12){if(_0x4e3c12){return _0x4e3c12['update'](_0x593406)[_0xd1f2('0x27')](function(_0x329a15){return _0x329a15;});}return null;};}function removeEntity(_0x15d757,_0x497e4a){return function(_0x6a12d9){if(_0x6a12d9){return _0x6a12d9[_0xd1f2('0x28')]()[_0xd1f2('0x27')](function(){_0x15d757[_0xd1f2('0x1d')](0xcc)[_0xd1f2('0x1c')]();});}};}function handleEntityNotFound(_0x4bbb64,_0x1bdfc3){return function(_0x3a25ae){if(!_0x3a25ae){_0x4bbb64[_0xd1f2('0x1b')](0x194);}return _0x3a25ae;};}function handleError(_0x56624c,_0x45c740){_0x45c740=_0x45c740||0x1f4;return function(_0x145d90){logger[_0xd1f2('0x29')](_0x145d90[_0xd1f2('0x2a')]);if(_0x145d90[_0xd1f2('0x2b')]){delete _0x145d90[_0xd1f2('0x2b')];}_0x56624c['status'](_0x45c740)['send'](_0x145d90);};}exports[_0xd1f2('0x2c')]=function(_0x158700,_0x20215e){var _0x459460={},_0x581222={},_0x380b80={'count':0x0,'rows':[]};var _0x3762dd=_[_0xd1f2('0x2d')](db[_0xd1f2('0x2e')]['rawAttributes'],function(_0x53f8cf){return{'name':_0x53f8cf['fieldName'],'type':_0x53f8cf[_0xd1f2('0x2f')]['key']};});_0x581222[_0xd1f2('0x30')]=_[_0xd1f2('0x2d')](_0x3762dd,_0xd1f2('0x2b'));_0x581222[_0xd1f2('0x31')]=_[_0xd1f2('0x32')](_0x158700[_0xd1f2('0x31')]);_0x581222[_0xd1f2('0x33')]=_[_0xd1f2('0x34')](_0x581222[_0xd1f2('0x30')],_0x581222[_0xd1f2('0x31')]);_0x459460[_0xd1f2('0x35')]=_[_0xd1f2('0x34')](_0x581222[_0xd1f2('0x30')],qs[_0xd1f2('0x36')](_0x158700[_0xd1f2('0x31')][_0xd1f2('0x36')]));_0x459460['attributes']=_0x459460[_0xd1f2('0x35')][_0xd1f2('0x37')]?_0x459460[_0xd1f2('0x35')]:_0x581222[_0xd1f2('0x30')];if(!_0x158700['query'][_0xd1f2('0x38')](_0xd1f2('0x39'))){_0x459460['limit']=qs['limit'](_0x158700[_0xd1f2('0x31')][_0xd1f2('0x20')]);_0x459460[_0xd1f2('0x1e')]=qs[_0xd1f2('0x1e')](_0x158700[_0xd1f2('0x31')][_0xd1f2('0x1e')]);}_0x459460[_0xd1f2('0x3a')]=qs['sort'](_0x158700['query'][_0xd1f2('0x3b')]);_0x459460[_0xd1f2('0x3c')]=qs[_0xd1f2('0x33')](_[_0xd1f2('0x3d')](_0x158700[_0xd1f2('0x31')],_0x581222['filters']),_0x3762dd);if(_0x158700[_0xd1f2('0x31')][_0xd1f2('0x3e')]){_0x459460['where']=_[_0xd1f2('0x3f')](_0x459460[_0xd1f2('0x3c')],{'$or':_[_0xd1f2('0x2d')](_0x3762dd,function(_0x58b6f6){if(_0x58b6f6[_0xd1f2('0x2f')]!=='VIRTUAL'){var _0x344812={};_0x344812[_0x58b6f6[_0xd1f2('0x2b')]]={'$like':'%'+_0x158700[_0xd1f2('0x31')][_0xd1f2('0x3e')]+'%'};return _0x344812;}})});}_0x459460=_[_0xd1f2('0x3f')]({},_0x459460,_0x158700[_0xd1f2('0x40')]);var _0x360609={'where':_0x459460['where']};return db[_0xd1f2('0x2e')][_0xd1f2('0x21')](_0x360609)['then'](function(_0x4461fe){_0x380b80[_0xd1f2('0x21')]=_0x4461fe;if(_0x158700['query'][_0xd1f2('0x41')]){_0x459460[_0xd1f2('0x42')]=[{'all':!![]}];}return db[_0xd1f2('0x2e')][_0xd1f2('0x43')](_0x459460);})[_0xd1f2('0x27')](function(_0x24a293){_0x380b80[_0xd1f2('0x44')]=_0x24a293;return _0x380b80;})[_0xd1f2('0x27')](respondWithFilteredResult(_0x20215e,_0x459460))[_0xd1f2('0x45')](handleError(_0x20215e,null));};exports[_0xd1f2('0x46')]=function(_0x219244,_0x2ef57a){var _0x136e7b={'raw':![],'where':{'id':_0x219244['params']['id']}},_0x383322={};_0x383322[_0xd1f2('0x30')]=_[_0xd1f2('0x32')](db[_0xd1f2('0x2e')][_0xd1f2('0x47')]);_0x383322['query']=_[_0xd1f2('0x32')](_0x219244['query']);_0x383322[_0xd1f2('0x33')]=_[_0xd1f2('0x34')](_0x383322[_0xd1f2('0x30')],_0x383322[_0xd1f2('0x31')]);_0x136e7b['attributes']=_['intersection'](_0x383322[_0xd1f2('0x30')],qs[_0xd1f2('0x36')](_0x219244[_0xd1f2('0x31')][_0xd1f2('0x36')]));_0x136e7b[_0xd1f2('0x35')]=_0x136e7b['attributes'][_0xd1f2('0x37')]?_0x136e7b[_0xd1f2('0x35')]:_0x383322[_0xd1f2('0x30')];if(_0x219244[_0xd1f2('0x31')][_0xd1f2('0x41')]){_0x136e7b[_0xd1f2('0x42')]=[{'all':!![]}];}_0x136e7b=_['merge']({},_0x136e7b,_0x219244[_0xd1f2('0x40')]);return db[_0xd1f2('0x2e')][_0xd1f2('0x48')](_0x136e7b)['then'](handleEntityNotFound(_0x2ef57a,null))[_0xd1f2('0x27')](respondWithResult(_0x2ef57a,null))[_0xd1f2('0x45')](handleError(_0x2ef57a,null));};exports[_0xd1f2('0x49')]=function(_0x2286e7,_0x291c12){return db['DeskAccount'][_0xd1f2('0x49')](_0x2286e7[_0xd1f2('0x4a')],{})[_0xd1f2('0x27')](respondWithResult(_0x291c12,0xc9))[_0xd1f2('0x45')](handleError(_0x291c12,null));};exports[_0xd1f2('0x4b')]=function(_0x5b7b9d,_0x1d6af1){if(_0x5b7b9d['body']['id']){delete _0x5b7b9d[_0xd1f2('0x4a')]['id'];}return db[_0xd1f2('0x2e')][_0xd1f2('0x48')]({'where':{'id':_0x5b7b9d[_0xd1f2('0x4c')]['id']}})[_0xd1f2('0x27')](handleEntityNotFound(_0x1d6af1,null))[_0xd1f2('0x27')](saveUpdates(_0x5b7b9d['body'],null))['then'](respondWithResult(_0x1d6af1,null))[_0xd1f2('0x45')](handleError(_0x1d6af1,null));};exports[_0xd1f2('0x28')]=function(_0x4ad268,_0x2637ff){return db[_0xd1f2('0x2e')]['find']({'where':{'id':_0x4ad268[_0xd1f2('0x4c')]['id']}})[_0xd1f2('0x27')](handleEntityNotFound(_0x2637ff,null))['then'](removeEntity(_0x2637ff,null))[_0xd1f2('0x45')](handleError(_0x2637ff,null));};exports[_0xd1f2('0x4d')]=function(_0x460d26,_0x3a4f95,_0x4ceffc){var _0x5cf5df={};var _0x148839={};var _0x330de9;var _0xb2ee0a;return db[_0xd1f2('0x2e')][_0xd1f2('0x4e')]({'where':{'id':_0x460d26[_0xd1f2('0x4c')]['id']}})[_0xd1f2('0x27')](handleEntityNotFound(_0x3a4f95,null))[_0xd1f2('0x27')](function(_0x5652c0){if(_0x5652c0){_0x330de9=_0x5652c0;_0x148839[_0xd1f2('0x30')]=_[_0xd1f2('0x32')](db['DeskConfiguration'][_0xd1f2('0x47')]);_0x148839[_0xd1f2('0x31')]=_['keys'](_0x460d26[_0xd1f2('0x31')]);_0x148839[_0xd1f2('0x33')]=_[_0xd1f2('0x34')](_0x148839[_0xd1f2('0x30')],_0x148839['query']);_0x5cf5df[_0xd1f2('0x35')]=_[_0xd1f2('0x34')](_0x148839[_0xd1f2('0x30')],qs['fields'](_0x460d26[_0xd1f2('0x31')][_0xd1f2('0x36')]));_0x5cf5df[_0xd1f2('0x35')]=_0x5cf5df['attributes'][_0xd1f2('0x37')]?_0x5cf5df['attributes']:_0x148839['model'];_0x5cf5df[_0xd1f2('0x3a')]=qs[_0xd1f2('0x3b')](_0x460d26[_0xd1f2('0x31')][_0xd1f2('0x3b')]);_0x5cf5df[_0xd1f2('0x3c')]=qs[_0xd1f2('0x33')](_[_0xd1f2('0x3d')](_0x460d26[_0xd1f2('0x31')],_0x148839['filters']));if(_0x460d26[_0xd1f2('0x31')][_0xd1f2('0x3e')]){_0x5cf5df['where']=_['merge'](_0x5cf5df[_0xd1f2('0x3c')],{'$or':_[_0xd1f2('0x2d')](_0x5cf5df[_0xd1f2('0x35')],function(_0x5d2a93){var _0x3adebd={};_0x3adebd[_0x5d2a93]={'$like':'%'+_0x460d26[_0xd1f2('0x31')][_0xd1f2('0x3e')]+'%'};return _0x3adebd;})});}_0x5cf5df=_[_0xd1f2('0x3f')]({},_0x5cf5df,_0x460d26[_0xd1f2('0x40')]);return _0x330de9['getConfigurations'](_0x5cf5df);}})['then'](function(_0x5e1214){if(_0x5e1214){_0xb2ee0a=_0x5e1214[_0xd1f2('0x37')];if(!_0x460d26[_0xd1f2('0x31')][_0xd1f2('0x38')](_0xd1f2('0x39'))){_0x5cf5df['limit']=qs[_0xd1f2('0x20')](_0x460d26[_0xd1f2('0x31')][_0xd1f2('0x20')]);_0x5cf5df['offset']=qs[_0xd1f2('0x1e')](_0x460d26[_0xd1f2('0x31')][_0xd1f2('0x1e')]);}return _0x330de9[_0xd1f2('0x4d')](_0x5cf5df);}})['then'](function(_0x5a7103){if(_0x5a7103){return _0x5a7103?{'count':_0xb2ee0a,'rows':_0x5a7103}:null;}})[_0xd1f2('0x27')](respondWithResult(_0x3a4f95,null))[_0xd1f2('0x45')](handleError(_0x3a4f95,null));};exports[_0xd1f2('0x4f')]=function(_0xfd8ee7,_0x370953,_0x14a0d2){if(_0xfd8ee7[_0xd1f2('0x4a')]['id']){delete _0xfd8ee7[_0xd1f2('0x4a')]['id'];}return db[_0xd1f2('0x2e')]['findOne']({'where':{'id':_0xfd8ee7[_0xd1f2('0x4c')]['id']}})[_0xd1f2('0x27')](handleEntityNotFound(_0x370953,null))[_0xd1f2('0x27')](function(_0x1fb980){if(_0x1fb980){_0xfd8ee7[_0xd1f2('0x4a')][_0xd1f2('0x50')]=_0x1fb980['id'];_0xfd8ee7[_0xd1f2('0x4a')][_0xd1f2('0x51')]=integrations[_0xd1f2('0x52')](_0xfd8ee7['body'][_0xd1f2('0x53')],_0xfd8ee7[_0xd1f2('0x4a')][_0xd1f2('0x2f')]);_0xfd8ee7['body'][_0xd1f2('0x54')]=integrations['getDescriptions'](_0xfd8ee7['body']['channel'],_0xfd8ee7[_0xd1f2('0x4a')][_0xd1f2('0x2f')]);return db['DeskConfiguration'][_0xd1f2('0x49')](_0xfd8ee7[_0xd1f2('0x4a')],{'include':[{'model':db['DeskField'],'as':_0xd1f2('0x51')},{'model':db['DeskField'],'as':_0xd1f2('0x54')}]});}return null;})[_0xd1f2('0x27')](respondWithResult(_0x370953,null))[_0xd1f2('0x45')](handleError(_0x370953,null));};exports[_0xd1f2('0x55')]=function(_0xa91129,_0x34cc22,_0x5a2738){var _0x3a88f9=[{'name':_0xd1f2('0x56'),'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 _0x456e11='';return db[_0xd1f2('0x2e')][_0xd1f2('0x4e')]({'where':{'id':_0xa91129['params']['id']},'attributes':['id','remoteUri',_0xd1f2('0x57'),_0xd1f2('0x58'),'password',_0xd1f2('0x59'),_0xd1f2('0x5a'),_0xd1f2('0x5b'),_0xd1f2('0x5c')]})['then'](handleEntityNotFound(_0x34cc22,null))['then'](function(_0x1b2936){if(_0x1b2936){_0x456e11=_0x1b2936[_0xd1f2('0x5d')];var _0x30c045=_0x456e11[_0xd1f2('0x5e')](-0x1);if(_0x30c045==='/'){_0x456e11=_0x456e11[_0xd1f2('0x5f')](0x0,_0x456e11[_0xd1f2('0x60')](_0x30c045));}var _0x9c148={'method':_0xd1f2('0x61'),'uri':util[_0xd1f2('0x62')]('%s/custom_fields',_0x456e11),'headers':{'Content-Type':_0xd1f2('0x63'),'Accept':_0xd1f2('0x63')},'json':!![]};if(_0x1b2936[_0xd1f2('0x57')]==='basic'){_0x9c148[_0xd1f2('0x64')][_0xd1f2('0x65')]=util[_0xd1f2('0x62')](_0xd1f2('0x66'),new Buffer(util[_0xd1f2('0x62')](_0xd1f2('0x67'),_0x1b2936['username'],_0x1b2936[_0xd1f2('0x68')]))['toString']('base64'));}return rp(_0x9c148)['then'](function(_0x45b5be){return _0x3a88f9[_0xd1f2('0x69')](_['map'](_0x45b5be[_0xd1f2('0x6a')][_0xd1f2('0x6b')],function(_0x373bef){return{'id':_0x373bef[_0xd1f2('0x2b')],'name':_0x373bef['name'],'type':_0x373bef[_0xd1f2('0x2f')],'active':_0x373bef[_0xd1f2('0x6c')],'label':_0x373bef['label'],'custom':!![]};}));});}})[_0xd1f2('0x27')](function(_0x4d616c){return{'count':_0x4d616c['length'],'rows':_0x4d616c};})['then'](respondWithResult(_0x34cc22,null))['catch'](function(_0x3e70ce){var _0x3e0e5f=_0xa91129[_0xd1f2('0x31')]['test']?0x1f4:_0x3e70ce['statusCode']||0x1f4;logger[_0xd1f2('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xd1f2('0x55'),_0x3e0e5f,JSON['stringify'](_0x3e70ce));delete _0x3e70ce[_0xd1f2('0x2b')];if(_0x3e0e5f===0x191){_0x3e0e5f=0x190;}_0x34cc22['status'](_0x3e0e5f)[_0xd1f2('0x6d')](_0xa91129[_0xd1f2('0x31')][_0xd1f2('0x6e')]?{'message':_0xd1f2('0x6f'),'statusCode':_0x3e70ce[_0xd1f2('0x70')]}:_0x3e70ce);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index a187635..fb9ec0c 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 _0xeebc=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x15dacd,_0x8b58e4){var _0x30f78c=function(_0x400b4a){while(--_0x400b4a){_0x15dacd['push'](_0x15dacd['shift']());}};_0x30f78c(++_0x8b58e4);}(_0xeebc,0x180));var _0xceeb=function(_0x146ccf,_0x3aa6fa){_0x146ccf=_0x146ccf-0x0;var _0x5e75df=_0xeebc[_0x146ccf];return _0x5e75df;};'use strict';var _=require(_0xceeb('0x0'));var util=require(_0xceeb('0x1'));var logger=require(_0xceeb('0x2'))('api');var moment=require(_0xceeb('0x3'));var BPromise=require(_0xceeb('0x4'));var rp=require(_0xceeb('0x5'));var fs=require('fs');var path=require(_0xceeb('0x6'));var rimraf=require(_0xceeb('0x7'));var config=require(_0xceeb('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xceeb('0x9'));module[_0xceeb('0xa')]=function(_0x3b1347,_0x2ea2db){return _0x3b1347[_0xceeb('0xb')](_0xceeb('0xc'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa006=['lodash','util','../../config/logger','moment','bluebird','path','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts'];(function(_0xd723be,_0x3c5571){var _0x3d1e14=function(_0x29a978){while(--_0x29a978){_0xd723be['push'](_0xd723be['shift']());}};_0x3d1e14(++_0x3c5571);}(_0xa006,0xc6));var _0x6a00=function(_0x27c004,_0x2c9905){_0x27c004=_0x27c004-0x0;var _0x1f3a9f=_0xa006[_0x27c004];return _0x1f3a9f;};'use strict';var _=require(_0x6a00('0x0'));var util=require(_0x6a00('0x1'));var logger=require(_0x6a00('0x2'))('api');var moment=require(_0x6a00('0x3'));var BPromise=require(_0x6a00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a00('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6a00('0x6'));var integrations=require(_0x6a00('0x7'));module['exports']=function(_0x4bb9e3,_0x57a64e){return _0x4bb9e3[_0x6a00('0x8')](_0x6a00('0x9'),attributes,{'tableName':_0x6a00('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 2e8228c..12ac1be 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 _0x72fa=['code','message','DeskAccount','options','where','attributes','limit','include','map','model','GetDeskAccount','catch','ShowDeskAccount','find','raw','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x72fa,0x72));var _0xa72f=function(_0x241b92,_0x1526dd){_0x241b92=_0x241b92-0x0;var _0x575bb4=_0x72fa[_0x241b92];return _0x575bb4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa72f('0x0'));var BPromise=require(_0xa72f('0x1'));var rs=require(_0xa72f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa72f('0x3'))['db'];var utils=require(_0xa72f('0x4'));var logger=require(_0xa72f('0x5'))(_0xa72f('0x6'));var config=require(_0xa72f('0x7'));var jayson=require(_0xa72f('0x8'));var client=jayson[_0xa72f('0x9')][_0xa72f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510afa,_0x12d5ed,_0x502350){return new BPromise(function(_0x209c53,_0x5dcf75){return client['request'](_0x510afa,_0x502350)[_0xa72f('0xb')](function(_0x45e569){logger[_0xa72f('0xc')](_0xa72f('0xd'),_0x12d5ed,_0xa72f('0xe'));logger[_0xa72f('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x12d5ed,_0xa72f('0xe'),JSON[_0xa72f('0x10')](_0x45e569));if(_0x45e569[_0xa72f('0x11')]){if(_0x45e569['error'][_0xa72f('0x12')]===0x1f4){logger[_0xa72f('0x11')](_0xa72f('0xd'),_0x12d5ed,_0x45e569['error'][_0xa72f('0x13')]);return _0x5dcf75(_0x45e569[_0xa72f('0x11')][_0xa72f('0x13')]);}logger[_0xa72f('0x11')]('DeskAccount,\x20%s,\x20%s',_0x12d5ed,_0x45e569[_0xa72f('0x11')][_0xa72f('0x13')]);return _0x209c53(_0x45e569[_0xa72f('0x11')]['message']);}else{logger[_0xa72f('0xc')](_0xa72f('0xd'),_0x12d5ed,_0xa72f('0xe'));_0x209c53(_0x45e569['result']['message']);}})['catch'](function(_0x5768fd){logger[_0xa72f('0x11')](_0xa72f('0xd'),_0x12d5ed,_0x5768fd);_0x5dcf75(_0x5768fd);});});}exports['GetDeskAccount']=function(_0x2aad4d){var _0x3329e8=this;return new Promise(function(_0x5b63ff,_0x414940){return db[_0xa72f('0x14')]['findAll']({'raw':_0x2aad4d[_0xa72f('0x15')]?_0x2aad4d[_0xa72f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2aad4d[_0xa72f('0x15')]?_0x2aad4d[_0xa72f('0x15')][_0xa72f('0x16')]||null:null,'attributes':_0x2aad4d['options']?_0x2aad4d[_0xa72f('0x15')][_0xa72f('0x17')]||null:null,'limit':_0x2aad4d[_0xa72f('0x15')]?_0x2aad4d[_0xa72f('0x15')][_0xa72f('0x18')]||null:null,'include':_0x2aad4d[_0xa72f('0x15')]?_0x2aad4d[_0xa72f('0x15')][_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x2aad4d['options'][_0xa72f('0x19')],function(_0x3f5adb){return{'model':db[_0x3f5adb['model']],'as':_0x3f5adb['as'],'attributes':_0x3f5adb[_0xa72f('0x17')],'include':_0x3f5adb[_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x3f5adb[_0xa72f('0x19')],function(_0x249255){return{'model':db[_0x249255['model']],'as':_0x249255['as'],'attributes':_0x249255[_0xa72f('0x17')],'include':_0x249255[_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x249255[_0xa72f('0x19')],function(_0x3b17b4){return{'model':db[_0x3b17b4[_0xa72f('0x1b')]],'as':_0x3b17b4['as'],'attributes':_0x3b17b4[_0xa72f('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa72f('0xb')](function(_0x5eea4e){logger[_0xa72f('0xc')]('GetDeskAccount',_0x2aad4d);logger[_0xa72f('0xf')](_0xa72f('0x1c'),_0x2aad4d,JSON[_0xa72f('0x10')](_0x5eea4e));_0x5b63ff(_0x5eea4e);})[_0xa72f('0x1d')](function(_0x4d150f){logger[_0xa72f('0x11')]('GetDeskAccount',_0x4d150f['message'],_0x2aad4d);_0x414940(_0x3329e8['error'](0x1f4,_0x4d150f[_0xa72f('0x13')]));});});};exports[_0xa72f('0x1e')]=function(_0x4f1aa5){var _0x5c1a7b=this;return new Promise(function(_0x1b9284,_0x1624fc){return db[_0xa72f('0x14')][_0xa72f('0x1f')]({'raw':_0x4f1aa5[_0xa72f('0x15')]?_0x4f1aa5['options'][_0xa72f('0x20')]===undefined?!![]:![]:!![],'where':_0x4f1aa5[_0xa72f('0x15')]?_0x4f1aa5[_0xa72f('0x15')]['where']||null:null,'attributes':_0x4f1aa5[_0xa72f('0x15')]?_0x4f1aa5[_0xa72f('0x15')][_0xa72f('0x17')]||null:null,'include':_0x4f1aa5[_0xa72f('0x15')]?_0x4f1aa5[_0xa72f('0x15')][_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x4f1aa5[_0xa72f('0x15')][_0xa72f('0x19')],function(_0x41dd9b){return{'model':db[_0x41dd9b['model']],'as':_0x41dd9b['as'],'attributes':_0x41dd9b[_0xa72f('0x17')],'include':_0x41dd9b[_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x41dd9b[_0xa72f('0x19')],function(_0x32d24a){return{'model':db[_0x32d24a['model']],'as':_0x32d24a['as'],'attributes':_0x32d24a[_0xa72f('0x17')],'include':_0x32d24a[_0xa72f('0x19')]?_[_0xa72f('0x1a')](_0x32d24a[_0xa72f('0x19')],function(_0x20f15d){return{'model':db[_0x20f15d['model']],'as':_0x20f15d['as'],'attributes':_0x20f15d[_0xa72f('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3240dd){logger['info'](_0xa72f('0x1e'),_0x4f1aa5);logger[_0xa72f('0xf')]('ShowDeskAccount',_0x4f1aa5,JSON[_0xa72f('0x10')](_0x3240dd));_0x1b9284(_0x3240dd);})['catch'](function(_0x2e423e){logger[_0xa72f('0x11')]('ShowDeskAccount',_0x2e423e[_0xa72f('0x13')],_0x4f1aa5);_0x1624fc(_0x5c1a7b[_0xa72f('0x11')](0x1f4,_0x2e423e[_0xa72f('0x13')]));});});}; \ No newline at end of file +var _0x1c9f=['info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','findAll','options','raw','attributes','include','map','model','ShowDeskAccount','DeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x44f831,_0x277c8e){var _0x455aac=function(_0x290785){while(--_0x290785){_0x44f831['push'](_0x44f831['shift']());}};_0x455aac(++_0x277c8e);}(_0x1c9f,0x7b));var _0xf1c9=function(_0x3dd912,_0x680668){_0x3dd912=_0x3dd912-0x0;var _0x36f201=_0x1c9f[_0x3dd912];return _0x36f201;};'use strict';var _=require(_0xf1c9('0x0'));var util=require(_0xf1c9('0x1'));var moment=require(_0xf1c9('0x2'));var BPromise=require(_0xf1c9('0x3'));var rs=require(_0xf1c9('0x4'));var fs=require('fs');var Redis=require(_0xf1c9('0x5'));var db=require(_0xf1c9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1c9('0x7'))(_0xf1c9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf1c9('0x9')][_0xf1c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14e85e,_0x23bee8,_0x17ba6d){return new BPromise(function(_0x4bdc89,_0x3c22c0){return client[_0xf1c9('0xb')](_0x14e85e,_0x17ba6d)[_0xf1c9('0xc')](function(_0x1c2ca3){logger[_0xf1c9('0xd')](_0xf1c9('0xe'),_0x23bee8,'request\x20sent');logger[_0xf1c9('0xf')](_0xf1c9('0x10'),_0x23bee8,'request\x20sent',JSON[_0xf1c9('0x11')](_0x1c2ca3));if(_0x1c2ca3[_0xf1c9('0x12')]){if(_0x1c2ca3[_0xf1c9('0x12')]['code']===0x1f4){logger[_0xf1c9('0x12')](_0xf1c9('0xe'),_0x23bee8,_0x1c2ca3[_0xf1c9('0x12')][_0xf1c9('0x13')]);return _0x3c22c0(_0x1c2ca3[_0xf1c9('0x12')]['message']);}logger[_0xf1c9('0x12')]('DeskAccount,\x20%s,\x20%s',_0x23bee8,_0x1c2ca3['error'][_0xf1c9('0x13')]);return _0x4bdc89(_0x1c2ca3[_0xf1c9('0x12')][_0xf1c9('0x13')]);}else{logger[_0xf1c9('0xd')](_0xf1c9('0xe'),_0x23bee8,'request\x20sent');_0x4bdc89(_0x1c2ca3[_0xf1c9('0x14')][_0xf1c9('0x13')]);}})[_0xf1c9('0x15')](function(_0x292d30){logger[_0xf1c9('0x12')](_0xf1c9('0xe'),_0x23bee8,_0x292d30);_0x3c22c0(_0x292d30);});});}exports[_0xf1c9('0x16')]=function(_0x3eaf99){var _0x153194=this;return new Promise(function(_0x41df3c,_0xbe341){return db['DeskAccount'][_0xf1c9('0x17')]({'raw':_0x3eaf99[_0xf1c9('0x18')]?_0x3eaf99['options'][_0xf1c9('0x19')]===undefined?!![]:![]:!![],'where':_0x3eaf99[_0xf1c9('0x18')]?_0x3eaf99[_0xf1c9('0x18')]['where']||null:null,'attributes':_0x3eaf99[_0xf1c9('0x18')]?_0x3eaf99[_0xf1c9('0x18')][_0xf1c9('0x1a')]||null:null,'limit':_0x3eaf99[_0xf1c9('0x18')]?_0x3eaf99[_0xf1c9('0x18')]['limit']||null:null,'include':_0x3eaf99[_0xf1c9('0x18')]?_0x3eaf99[_0xf1c9('0x18')][_0xf1c9('0x1b')]?_['map'](_0x3eaf99['options'][_0xf1c9('0x1b')],function(_0x2aea54){return{'model':db[_0x2aea54['model']],'as':_0x2aea54['as'],'attributes':_0x2aea54[_0xf1c9('0x1a')],'include':_0x2aea54['include']?_[_0xf1c9('0x1c')](_0x2aea54['include'],function(_0x1140f0){return{'model':db[_0x1140f0[_0xf1c9('0x1d')]],'as':_0x1140f0['as'],'attributes':_0x1140f0[_0xf1c9('0x1a')],'include':_0x1140f0[_0xf1c9('0x1b')]?_[_0xf1c9('0x1c')](_0x1140f0[_0xf1c9('0x1b')],function(_0x1b929a){return{'model':db[_0x1b929a[_0xf1c9('0x1d')]],'as':_0x1b929a['as'],'attributes':_0x1b929a[_0xf1c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf1c9('0xc')](function(_0x6e676a){logger[_0xf1c9('0xd')]('GetDeskAccount',_0x3eaf99);logger[_0xf1c9('0xf')](_0xf1c9('0x16'),_0x3eaf99,JSON[_0xf1c9('0x11')](_0x6e676a));_0x41df3c(_0x6e676a);})[_0xf1c9('0x15')](function(_0x16081f){logger[_0xf1c9('0x12')](_0xf1c9('0x16'),_0x16081f['message'],_0x3eaf99);_0xbe341(_0x153194[_0xf1c9('0x12')](0x1f4,_0x16081f['message']));});});};exports[_0xf1c9('0x1e')]=function(_0x29c108){var _0x5c4662=this;return new Promise(function(_0x19327e,_0x5e2d4a){return db[_0xf1c9('0x1f')][_0xf1c9('0x20')]({'raw':_0x29c108['options']?_0x29c108[_0xf1c9('0x18')][_0xf1c9('0x19')]===undefined?!![]:![]:!![],'where':_0x29c108['options']?_0x29c108['options'][_0xf1c9('0x21')]||null:null,'attributes':_0x29c108[_0xf1c9('0x18')]?_0x29c108['options'][_0xf1c9('0x1a')]||null:null,'include':_0x29c108['options']?_0x29c108[_0xf1c9('0x18')][_0xf1c9('0x1b')]?_[_0xf1c9('0x1c')](_0x29c108[_0xf1c9('0x18')][_0xf1c9('0x1b')],function(_0x57edb8){return{'model':db[_0x57edb8[_0xf1c9('0x1d')]],'as':_0x57edb8['as'],'attributes':_0x57edb8[_0xf1c9('0x1a')],'include':_0x57edb8['include']?_[_0xf1c9('0x1c')](_0x57edb8[_0xf1c9('0x1b')],function(_0x715654){return{'model':db[_0x715654[_0xf1c9('0x1d')]],'as':_0x715654['as'],'attributes':_0x715654[_0xf1c9('0x1a')],'include':_0x715654['include']?_[_0xf1c9('0x1c')](_0x715654[_0xf1c9('0x1b')],function(_0x3cf128){return{'model':db[_0x3cf128['model']],'as':_0x3cf128['as'],'attributes':_0x3cf128[_0xf1c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf1c9('0xc')](function(_0x122c59){logger[_0xf1c9('0xd')](_0xf1c9('0x1e'),_0x29c108);logger[_0xf1c9('0xf')]('ShowDeskAccount',_0x29c108,JSON['stringify'](_0x122c59));_0x19327e(_0x122c59);})[_0xf1c9('0x15')](function(_0x5e6f57){logger['error'](_0xf1c9('0x1e'),_0x5e6f57[_0xf1c9('0x13')],_0x29c108);_0x5e2d4a(_0x5c4662[_0xf1c9('0x12')](0x1f4,_0x5e6f57[_0xf1c9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5ca5e96..31e0476 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x28f814,_0x1c61e1){var _0x4b39b1=function(_0x17323d){while(--_0x17323d){_0x28f814['push'](_0x28f814['shift']());}};_0x4b39b1(++_0x1c61e1);}(_0x7217,0x19e));var _0x7721=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7217[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x68116e,_0x3f938c){var _0x12c3d6=function(_0x5bf1b3){while(--_0x5bf1b3){_0x68116e['push'](_0x68116e['shift']());}};_0x12c3d6(++_0x3f938c);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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 f365a12..5e5ed3f 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 _0x5a03=['sequelize','exports','STRING'];(function(_0x428f32,_0xba79ad){var _0x9e6f89=function(_0x5cf6c8){while(--_0x5cf6c8){_0x428f32['push'](_0x428f32['shift']());}};_0x9e6f89(++_0xba79ad);}(_0x5a03,0x1d1));var _0x35a0=function(_0x503162,_0x25ea26){_0x503162=_0x503162-0x0;var _0x23495d=_0x5a03[_0x503162];return _0x23495d;};'use strict';var Sequelize=require(_0x35a0('0x0'));module[_0x35a0('0x1')]={'name':{'type':Sequelize[_0x35a0('0x2')]},'description':{'type':Sequelize[_0x35a0('0x2')]}}; \ No newline at end of file +var _0x9b13=['exports','STRING','sequelize'];(function(_0x198b58,_0x5c4199){var _0x2719f7=function(_0x1dac8a){while(--_0x1dac8a){_0x198b58['push'](_0x198b58['shift']());}};_0x2719f7(++_0x5c4199);}(_0x9b13,0x11f));var _0x39b1=function(_0x1183af,_0x196d23){_0x1183af=_0x1183af-0x0;var _0x6fe5d6=_0x9b13[_0x1183af];return _0x6fe5d6;};'use strict';var Sequelize=require(_0x39b1('0x0'));module[_0x39b1('0x1')]={'name':{'type':Sequelize[_0x39b1('0x2')]},'description':{'type':Sequelize[_0x39b1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 055b257..e460b9e 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 _0xfbde=['show','params','find','create','body','catch','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x6075dd,_0x5e63dc){var _0xba97b8=function(_0x4263cc){while(--_0x4263cc){_0x6075dd['push'](_0x6075dd['shift']());}};_0xba97b8(++_0x5e63dc);}(_0xfbde,0x65));var _0xefbd=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xfbde[_0x468b0f];return _0x3e74d9;};'use strict';var emlformat=require(_0xefbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xefbd('0x1'));var jsonpatch=require(_0xefbd('0x2'));var rp=require(_0xefbd('0x3'));var moment=require(_0xefbd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xefbd('0x5'));var util=require(_0xefbd('0x6'));var path=require('path');var sox=require(_0xefbd('0x7'));var csv=require(_0xefbd('0x8'));var ejs=require(_0xefbd('0x9'));var fs=require('fs');var fs_extra=require(_0xefbd('0xa'));var _=require(_0xefbd('0xb'));var squel=require(_0xefbd('0xc'));var crypto=require(_0xefbd('0xd'));var jsforce=require(_0xefbd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xefbd('0x8'));var querystring=require(_0xefbd('0xf'));var Papa=require('papaparse');var Redis=require(_0xefbd('0x10'));var authService=require(_0xefbd('0x11'));var qs=require(_0xefbd('0x12'));var as=require(_0xefbd('0x13'));var hardwareService=require(_0xefbd('0x14'));var logger=require(_0xefbd('0x15'))('api');var utils=require(_0xefbd('0x16'));var config=require(_0xefbd('0x17'));var licenseUtil=require(_0xefbd('0x18'));var db=require(_0xefbd('0x19'))['db'];function respondWithStatusCode(_0x107c91,_0x5b9fce){_0x5b9fce=_0x5b9fce||0xcc;return function(_0x473f59){if(_0x473f59){return _0x107c91['sendStatus'](_0x5b9fce);}return _0x107c91[_0xefbd('0x1a')](_0x5b9fce)['end']();};}function respondWithResult(_0x4c244f,_0x115923){_0x115923=_0x115923||0xc8;return function(_0x274fcb){if(_0x274fcb){return _0x4c244f[_0xefbd('0x1a')](_0x115923)[_0xefbd('0x1b')](_0x274fcb);}};}function respondWithFilteredResult(_0x468978,_0x388eb9){return function(_0x2092f2){if(_0x2092f2){var _0x102707=typeof _0x388eb9['offset']==='undefined'&&typeof _0x388eb9[_0xefbd('0x1c')]===_0xefbd('0x1d');var _0x99eee9=_0x2092f2['count'];var _0x2af426=_0x102707?0x0:_0x388eb9[_0xefbd('0x1e')];var _0x15d6af=_0x102707?_0x2092f2[_0xefbd('0x1f')]:_0x388eb9['offset']+_0x388eb9[_0xefbd('0x1c')];var _0x5c3af0;if(_0x15d6af>=_0x99eee9){_0x15d6af=_0x99eee9;_0x5c3af0=0xc8;}else{_0x5c3af0=0xce;}_0x468978[_0xefbd('0x1a')](_0x5c3af0);return _0x468978[_0xefbd('0x20')](_0xefbd('0x21'),_0x2af426+'-'+_0x15d6af+'/'+_0x99eee9)[_0xefbd('0x1b')](_0x2092f2);}return null;};}function patchUpdates(_0x2e634c){return function(_0x2103f0){try{jsonpatch[_0xefbd('0x22')](_0x2103f0,_0x2e634c,!![]);}catch(_0x5492ce){return BPromise[_0xefbd('0x23')](_0x5492ce);}return _0x2103f0['save']();};}function saveUpdates(_0x523a0f,_0x5673d9){return function(_0x397ed0){if(_0x397ed0){return _0x397ed0[_0xefbd('0x24')](_0x523a0f)[_0xefbd('0x25')](function(_0x5339f6){return _0x5339f6;});}return null;};}function removeEntity(_0x3a1bc4,_0xeb1042){return function(_0x498203){if(_0x498203){return _0x498203[_0xefbd('0x26')]()['then'](function(){_0x3a1bc4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x203a13,_0x4655ba){return function(_0x2b9597){if(!_0x2b9597){_0x203a13[_0xefbd('0x27')](0x194);}return _0x2b9597;};}function handleError(_0x26f010,_0x51d12f){_0x51d12f=_0x51d12f||0x1f4;return function(_0x5f8dba){logger[_0xefbd('0x28')](_0x5f8dba[_0xefbd('0x29')]);if(_0x5f8dba[_0xefbd('0x2a')]){delete _0x5f8dba['name'];}_0x26f010[_0xefbd('0x1a')](_0x51d12f)['send'](_0x5f8dba);};}exports[_0xefbd('0x2b')]=function(_0x41d28e,_0x2e68ed){var _0x441bd4={},_0x45ab78={},_0x1338aa={'count':0x0,'rows':[]};var _0x4ec6be=_[_0xefbd('0x2c')](db[_0xefbd('0x2d')][_0xefbd('0x2e')],function(_0x4aebfb){return{'name':_0x4aebfb[_0xefbd('0x2f')],'type':_0x4aebfb[_0xefbd('0x30')][_0xefbd('0x31')]};});_0x45ab78['model']=_[_0xefbd('0x2c')](_0x4ec6be,_0xefbd('0x2a'));_0x45ab78['query']=_[_0xefbd('0x32')](_0x41d28e[_0xefbd('0x33')]);_0x45ab78[_0xefbd('0x34')]=_[_0xefbd('0x35')](_0x45ab78[_0xefbd('0x36')],_0x45ab78[_0xefbd('0x33')]);_0x441bd4['attributes']=_['intersection'](_0x45ab78['model'],qs[_0xefbd('0x37')](_0x41d28e[_0xefbd('0x33')][_0xefbd('0x37')]));_0x441bd4[_0xefbd('0x38')]=_0x441bd4[_0xefbd('0x38')][_0xefbd('0x39')]?_0x441bd4[_0xefbd('0x38')]:_0x45ab78[_0xefbd('0x36')];if(!_0x41d28e[_0xefbd('0x33')][_0xefbd('0x3a')](_0xefbd('0x3b'))){_0x441bd4[_0xefbd('0x1c')]=qs['limit'](_0x41d28e[_0xefbd('0x33')][_0xefbd('0x1c')]);_0x441bd4[_0xefbd('0x1e')]=qs[_0xefbd('0x1e')](_0x41d28e[_0xefbd('0x33')][_0xefbd('0x1e')]);}_0x441bd4[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x41d28e[_0xefbd('0x33')][_0xefbd('0x3d')]);_0x441bd4[_0xefbd('0x3e')]=qs['filters'](_[_0xefbd('0x3f')](_0x41d28e['query'],_0x45ab78['filters']),_0x4ec6be);if(_0x41d28e['query'][_0xefbd('0x40')]){_0x441bd4[_0xefbd('0x3e')]=_['merge'](_0x441bd4['where'],{'$or':_[_0xefbd('0x2c')](_0x4ec6be,function(_0x5504eb){if(_0x5504eb[_0xefbd('0x30')]!=='VIRTUAL'){var _0x3e63b0={};_0x3e63b0[_0x5504eb[_0xefbd('0x2a')]]={'$like':'%'+_0x41d28e[_0xefbd('0x33')][_0xefbd('0x40')]+'%'};return _0x3e63b0;}})});}_0x441bd4=_[_0xefbd('0x41')]({},_0x441bd4,_0x41d28e[_0xefbd('0x42')]);var _0x3707a9={'where':_0x441bd4['where']};return db[_0xefbd('0x2d')][_0xefbd('0x1f')](_0x3707a9)[_0xefbd('0x25')](function(_0x35e39a){_0x1338aa[_0xefbd('0x1f')]=_0x35e39a;if(_0x41d28e[_0xefbd('0x33')][_0xefbd('0x43')]){_0x441bd4[_0xefbd('0x44')]=[{'all':!![]}];}return db[_0xefbd('0x2d')][_0xefbd('0x45')](_0x441bd4);})[_0xefbd('0x25')](function(_0x3b5288){_0x1338aa[_0xefbd('0x46')]=_0x3b5288;return _0x1338aa;})['then'](respondWithFilteredResult(_0x2e68ed,_0x441bd4))['catch'](handleError(_0x2e68ed,null));};exports[_0xefbd('0x47')]=function(_0x7efca1,_0x2ce4cc){var _0x37f68b={'raw':![],'where':{'id':_0x7efca1[_0xefbd('0x48')]['id']}},_0x408cf7={};_0x408cf7[_0xefbd('0x36')]=_['keys'](db[_0xefbd('0x2d')][_0xefbd('0x2e')]);_0x408cf7[_0xefbd('0x33')]=_[_0xefbd('0x32')](_0x7efca1[_0xefbd('0x33')]);_0x408cf7['filters']=_[_0xefbd('0x35')](_0x408cf7[_0xefbd('0x36')],_0x408cf7['query']);_0x37f68b[_0xefbd('0x38')]=_[_0xefbd('0x35')](_0x408cf7['model'],qs[_0xefbd('0x37')](_0x7efca1['query'][_0xefbd('0x37')]));_0x37f68b[_0xefbd('0x38')]=_0x37f68b[_0xefbd('0x38')][_0xefbd('0x39')]?_0x37f68b[_0xefbd('0x38')]:_0x408cf7[_0xefbd('0x36')];if(_0x7efca1[_0xefbd('0x33')][_0xefbd('0x43')]){_0x37f68b[_0xefbd('0x44')]=[{'all':!![]}];}_0x37f68b=_[_0xefbd('0x41')]({},_0x37f68b,_0x7efca1[_0xefbd('0x42')]);return db['DeskConfiguration'][_0xefbd('0x49')](_0x37f68b)[_0xefbd('0x25')](handleEntityNotFound(_0x2ce4cc,null))[_0xefbd('0x25')](respondWithResult(_0x2ce4cc,null))['catch'](handleError(_0x2ce4cc,null));};exports[_0xefbd('0x4a')]=function(_0x4cc963,_0x3b1d11){return db[_0xefbd('0x2d')]['create'](_0x4cc963[_0xefbd('0x4b')],{})[_0xefbd('0x25')](respondWithResult(_0x3b1d11,0xc9))[_0xefbd('0x4c')](handleError(_0x3b1d11,null));};exports[_0xefbd('0x24')]=function(_0x2dc4c7,_0x42e44f){if(_0x2dc4c7[_0xefbd('0x4b')]['id']){delete _0x2dc4c7[_0xefbd('0x4b')]['id'];}return db['DeskConfiguration'][_0xefbd('0x49')]({'where':{'id':_0x2dc4c7[_0xefbd('0x48')]['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0x42e44f,null))[_0xefbd('0x25')](saveUpdates(_0x2dc4c7[_0xefbd('0x4b')],null))['then'](respondWithResult(_0x42e44f,null))['catch'](handleError(_0x42e44f,null));};exports[_0xefbd('0x26')]=function(_0x5b2c21,_0x5c37e3){return db[_0xefbd('0x2d')]['find']({'where':{'id':_0x5b2c21[_0xefbd('0x48')]['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0x5c37e3,null))['then'](removeEntity(_0x5c37e3,null))[_0xefbd('0x4c')](handleError(_0x5c37e3,null));};exports[_0xefbd('0x4d')]=function(_0x43c192,_0x2365e9,_0x3bddfe){var _0x101a2b={};var _0x38795c={};var _0x42c8ba;var _0x281401;return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0x43c192['params']['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0x2365e9,null))[_0xefbd('0x25')](function(_0x3e2f37){if(_0x3e2f37){_0x42c8ba=_0x3e2f37;_0x38795c[_0xefbd('0x36')]=_[_0xefbd('0x32')](db[_0xefbd('0x4f')]['rawAttributes']);_0x38795c[_0xefbd('0x33')]=_[_0xefbd('0x32')](_0x43c192[_0xefbd('0x33')]);_0x38795c[_0xefbd('0x34')]=_[_0xefbd('0x35')](_0x38795c['model'],_0x38795c[_0xefbd('0x33')]);_0x101a2b['attributes']=_[_0xefbd('0x35')](_0x38795c[_0xefbd('0x36')],qs[_0xefbd('0x37')](_0x43c192[_0xefbd('0x33')][_0xefbd('0x37')]));_0x101a2b['attributes']=_0x101a2b[_0xefbd('0x38')]['length']?_0x101a2b[_0xefbd('0x38')]:_0x38795c[_0xefbd('0x36')];_0x101a2b[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x43c192[_0xefbd('0x33')]['sort']);_0x101a2b[_0xefbd('0x3e')]=qs[_0xefbd('0x34')](_['pick'](_0x43c192['query'],_0x38795c[_0xefbd('0x34')]));if(_0x43c192['query']['filter']){_0x101a2b['where']=_[_0xefbd('0x41')](_0x101a2b[_0xefbd('0x3e')],{'$or':_[_0xefbd('0x2c')](_0x101a2b[_0xefbd('0x38')],function(_0x3e342b){var _0x2230bc={};_0x2230bc[_0x3e342b]={'$like':'%'+_0x43c192[_0xefbd('0x33')][_0xefbd('0x40')]+'%'};return _0x2230bc;})});}_0x101a2b=_['merge']({},_0x101a2b,_0x43c192[_0xefbd('0x42')]);return _0x42c8ba['getFields'](_0x101a2b);}})[_0xefbd('0x25')](function(_0x4880d7){if(_0x4880d7){_0x281401=_0x4880d7['length'];if(!_0x43c192[_0xefbd('0x33')][_0xefbd('0x3a')](_0xefbd('0x3b'))){_0x101a2b[_0xefbd('0x1c')]=qs[_0xefbd('0x1c')](_0x43c192[_0xefbd('0x33')][_0xefbd('0x1c')]);_0x101a2b['offset']=qs[_0xefbd('0x1e')](_0x43c192[_0xefbd('0x33')][_0xefbd('0x1e')]);}return _0x42c8ba['getFields'](_0x101a2b);}})['then'](function(_0x1e07f4){if(_0x1e07f4){return _0x1e07f4?{'count':_0x281401,'rows':_0x1e07f4}:null;}})[_0xefbd('0x25')](respondWithResult(_0x2365e9,null))[_0xefbd('0x4c')](handleError(_0x2365e9,null));};exports[_0xefbd('0x50')]=function(_0x491323,_0x2686c1,_0x1b7715){var _0x39f57f={};var _0x507dc8={};var _0x2f0829;var _0x388de4;return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0x491323['params']['id']}})['then'](handleEntityNotFound(_0x2686c1,null))[_0xefbd('0x25')](function(_0x21719d){if(_0x21719d){_0x2f0829=_0x21719d;_0x507dc8['model']=_[_0xefbd('0x32')](db['DeskField']['rawAttributes']);_0x507dc8['query']=_[_0xefbd('0x32')](_0x491323['query']);_0x507dc8[_0xefbd('0x34')]=_['intersection'](_0x507dc8[_0xefbd('0x36')],_0x507dc8[_0xefbd('0x33')]);_0x39f57f[_0xefbd('0x38')]=_[_0xefbd('0x35')](_0x507dc8[_0xefbd('0x36')],qs[_0xefbd('0x37')](_0x491323[_0xefbd('0x33')][_0xefbd('0x37')]));_0x39f57f[_0xefbd('0x38')]=_0x39f57f[_0xefbd('0x38')][_0xefbd('0x39')]?_0x39f57f[_0xefbd('0x38')]:_0x507dc8[_0xefbd('0x36')];_0x39f57f[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x491323[_0xefbd('0x33')]['sort']);_0x39f57f['where']=qs[_0xefbd('0x34')](_[_0xefbd('0x3f')](_0x491323['query'],_0x507dc8[_0xefbd('0x34')]));if(_0x491323[_0xefbd('0x33')][_0xefbd('0x40')]){_0x39f57f['where']=_[_0xefbd('0x41')](_0x39f57f[_0xefbd('0x3e')],{'$or':_[_0xefbd('0x2c')](_0x39f57f[_0xefbd('0x38')],function(_0x392d65){var _0x2e0a09={};_0x2e0a09[_0x392d65]={'$like':'%'+_0x491323[_0xefbd('0x33')][_0xefbd('0x40')]+'%'};return _0x2e0a09;})});}_0x39f57f=_['merge']({},_0x39f57f,_0x491323[_0xefbd('0x42')]);return _0x2f0829[_0xefbd('0x50')](_0x39f57f);}})[_0xefbd('0x25')](function(_0xba5e74){if(_0xba5e74){_0x388de4=_0xba5e74[_0xefbd('0x39')];if(!_0x491323[_0xefbd('0x33')][_0xefbd('0x3a')](_0xefbd('0x3b'))){_0x39f57f[_0xefbd('0x1c')]=qs[_0xefbd('0x1c')](_0x491323[_0xefbd('0x33')][_0xefbd('0x1c')]);_0x39f57f[_0xefbd('0x1e')]=qs[_0xefbd('0x1e')](_0x491323[_0xefbd('0x33')][_0xefbd('0x1e')]);}return _0x2f0829[_0xefbd('0x50')](_0x39f57f);}})['then'](function(_0x30b35b){if(_0x30b35b){return _0x30b35b?{'count':_0x388de4,'rows':_0x30b35b}:null;}})[_0xefbd('0x25')](respondWithResult(_0x2686c1,null))[_0xefbd('0x4c')](handleError(_0x2686c1,null));};exports[_0xefbd('0x51')]=function(_0xe64f48,_0x2429bc,_0x109c91){var _0x4dd762={};var _0x202e34={};var _0x169eff;var _0x375b54;return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0xe64f48[_0xefbd('0x48')]['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0x2429bc,null))[_0xefbd('0x25')](function(_0x1a2587){if(_0x1a2587){_0x169eff=_0x1a2587;_0x202e34[_0xefbd('0x36')]=_[_0xefbd('0x32')](db['DeskField'][_0xefbd('0x2e')]);_0x202e34[_0xefbd('0x33')]=_[_0xefbd('0x32')](_0xe64f48[_0xefbd('0x33')]);_0x202e34[_0xefbd('0x34')]=_['intersection'](_0x202e34[_0xefbd('0x36')],_0x202e34[_0xefbd('0x33')]);_0x4dd762[_0xefbd('0x38')]=_[_0xefbd('0x35')](_0x202e34[_0xefbd('0x36')],qs[_0xefbd('0x37')](_0xe64f48[_0xefbd('0x33')][_0xefbd('0x37')]));_0x4dd762['attributes']=_0x4dd762[_0xefbd('0x38')][_0xefbd('0x39')]?_0x4dd762[_0xefbd('0x38')]:_0x202e34[_0xefbd('0x36')];_0x4dd762[_0xefbd('0x3c')]=qs['sort'](_0xe64f48['query'][_0xefbd('0x3d')]);_0x4dd762[_0xefbd('0x3e')]=qs['filters'](_[_0xefbd('0x3f')](_0xe64f48[_0xefbd('0x33')],_0x202e34[_0xefbd('0x34')]));if(_0xe64f48[_0xefbd('0x33')]['filter']){_0x4dd762[_0xefbd('0x3e')]=_['merge'](_0x4dd762['where'],{'$or':_[_0xefbd('0x2c')](_0x4dd762[_0xefbd('0x38')],function(_0x450893){var _0x220098={};_0x220098[_0x450893]={'$like':'%'+_0xe64f48[_0xefbd('0x33')]['filter']+'%'};return _0x220098;})});}_0x4dd762=_['merge']({},_0x4dd762,_0xe64f48[_0xefbd('0x42')]);return _0x169eff[_0xefbd('0x51')](_0x4dd762);}})[_0xefbd('0x25')](function(_0x4ba0b6){if(_0x4ba0b6){_0x375b54=_0x4ba0b6[_0xefbd('0x39')];if(!_0xe64f48['query']['hasOwnProperty'](_0xefbd('0x3b'))){_0x4dd762[_0xefbd('0x1c')]=qs[_0xefbd('0x1c')](_0xe64f48['query'][_0xefbd('0x1c')]);_0x4dd762[_0xefbd('0x1e')]=qs[_0xefbd('0x1e')](_0xe64f48[_0xefbd('0x33')][_0xefbd('0x1e')]);}return _0x169eff[_0xefbd('0x51')](_0x4dd762);}})[_0xefbd('0x25')](function(_0x46fb4a){if(_0x46fb4a){return _0x46fb4a?{'count':_0x375b54,'rows':_0x46fb4a}:null;}})[_0xefbd('0x25')](respondWithResult(_0x2429bc,null))[_0xefbd('0x4c')](handleError(_0x2429bc,null));};exports[_0xefbd('0x52')]=function(_0x5c1b72,_0xd99eab,_0x24e3b7){var _0x22028f={};var _0x48021d={};var _0x5cfa9a;var _0x43ac68;return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0x5c1b72[_0xefbd('0x48')]['id']}})[_0xefbd('0x25')](handleEntityNotFound(_0xd99eab,null))['then'](function(_0x32ea31){if(_0x32ea31){_0x5cfa9a=_0x32ea31;_0x48021d[_0xefbd('0x36')]=_[_0xefbd('0x32')](db[_0xefbd('0x53')]['rawAttributes']);_0x48021d[_0xefbd('0x33')]=_['keys'](_0x5c1b72[_0xefbd('0x33')]);_0x48021d[_0xefbd('0x34')]=_[_0xefbd('0x35')](_0x48021d[_0xefbd('0x36')],_0x48021d['query']);_0x22028f['attributes']=_[_0xefbd('0x35')](_0x48021d[_0xefbd('0x36')],qs[_0xefbd('0x37')](_0x5c1b72['query']['fields']));_0x22028f['attributes']=_0x22028f[_0xefbd('0x38')]['length']?_0x22028f[_0xefbd('0x38')]:_0x48021d[_0xefbd('0x36')];_0x22028f[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x5c1b72[_0xefbd('0x33')][_0xefbd('0x3d')]);_0x22028f['where']=qs[_0xefbd('0x34')](_[_0xefbd('0x3f')](_0x5c1b72[_0xefbd('0x33')],_0x48021d[_0xefbd('0x34')]));if(_0x5c1b72[_0xefbd('0x33')][_0xefbd('0x40')]){_0x22028f['where']=_[_0xefbd('0x41')](_0x22028f[_0xefbd('0x3e')],{'$or':_[_0xefbd('0x2c')](_0x22028f[_0xefbd('0x38')],function(_0x26a6fe){var _0x38e614={};_0x38e614[_0x26a6fe]={'$like':'%'+_0x5c1b72[_0xefbd('0x33')]['filter']+'%'};return _0x38e614;})});}_0x22028f=_[_0xefbd('0x41')]({},_0x22028f,_0x5c1b72[_0xefbd('0x42')]);return _0x5cfa9a[_0xefbd('0x52')](_0x22028f);}})[_0xefbd('0x25')](function(_0x6b42c4){if(_0x6b42c4){_0x43ac68=_0x6b42c4[_0xefbd('0x39')];if(!_0x5c1b72[_0xefbd('0x33')][_0xefbd('0x3a')](_0xefbd('0x3b'))){_0x22028f['limit']=qs['limit'](_0x5c1b72['query'][_0xefbd('0x1c')]);_0x22028f[_0xefbd('0x1e')]=qs[_0xefbd('0x1e')](_0x5c1b72[_0xefbd('0x33')][_0xefbd('0x1e')]);}return _0x5cfa9a[_0xefbd('0x52')](_0x22028f);}})['then'](function(_0x1010c7){if(_0x1010c7){return _0x1010c7?{'count':_0x43ac68,'rows':_0x1010c7}:null;}})[_0xefbd('0x25')](respondWithResult(_0xd99eab,null))[_0xefbd('0x4c')](handleError(_0xd99eab,null));};exports[_0xefbd('0x54')]=function(_0xc2e2db,_0x55b6d3,_0x4ad6ab){if(_0xc2e2db['body']['id']){delete _0xc2e2db['body']['id'];}return db[_0xefbd('0x2d')][_0xefbd('0x4e')]({'where':{'id':_0xc2e2db['params']['id']}})['then'](handleEntityNotFound(_0x55b6d3,null))[_0xefbd('0x25')](function(_0x573da9){if(_0x573da9){return _0x573da9[_0xefbd('0x54')](_0xc2e2db[_0xefbd('0x4b')][_0xefbd('0x55')]||[]);}return null;})[_0xefbd('0x25')](respondWithResult(_0x55b6d3,null))['catch'](handleError(_0x55b6d3,null));}; \ No newline at end of file +var _0xbbdd=['findOne','DeskField','order','pick','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','mustache','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','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','sendStatus','error','stack','name','index','DeskConfiguration','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','sort','where','filter','merge','type','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x43bc23,_0x5db262){var _0x5bd9e3=function(_0x3d9a97){while(--_0x3d9a97){_0x43bc23['push'](_0x43bc23['shift']());}};_0x5bd9e3(++_0x5db262);}(_0xbbdd,0x1f3));var _0xdbbd=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xbbdd[_0x3c8e9a];return _0x2d4c57;};'use strict';var emlformat=require(_0xdbbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbbd('0x1'));var jsonpatch=require(_0xdbbd('0x2'));var rp=require('request-promise');var moment=require(_0xdbbd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdbbd('0x4'));var util=require('util');var path=require(_0xdbbd('0x5'));var sox=require(_0xdbbd('0x6'));var csv=require(_0xdbbd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbbd('0x8'));var _=require('lodash');var squel=require(_0xdbbd('0x9'));var crypto=require(_0xdbbd('0xa'));var jsforce=require(_0xdbbd('0xb'));var deskjs=require(_0xdbbd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdbbd('0xd'));var Papa=require(_0xdbbd('0xe'));var Redis=require(_0xdbbd('0xf'));var authService=require(_0xdbbd('0x10'));var qs=require(_0xdbbd('0x11'));var as=require(_0xdbbd('0x12'));var hardwareService=require(_0xdbbd('0x13'));var logger=require(_0xdbbd('0x14'))(_0xdbbd('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdbbd('0x16'))['db'];function respondWithStatusCode(_0x23f0e9,_0x3820ad){_0x3820ad=_0x3820ad||0xcc;return function(_0x4a25bf){if(_0x4a25bf){return _0x23f0e9['sendStatus'](_0x3820ad);}return _0x23f0e9['status'](_0x3820ad)[_0xdbbd('0x17')]();};}function respondWithResult(_0x9b9874,_0x5e757a){_0x5e757a=_0x5e757a||0xc8;return function(_0x432321){if(_0x432321){return _0x9b9874[_0xdbbd('0x18')](_0x5e757a)['json'](_0x432321);}};}function respondWithFilteredResult(_0x11bafc,_0x1b1b11){return function(_0x459b8f){if(_0x459b8f){var _0xff839e=typeof _0x1b1b11[_0xdbbd('0x19')]===_0xdbbd('0x1a')&&typeof _0x1b1b11[_0xdbbd('0x1b')]==='undefined';var _0x263b60=_0x459b8f['count'];var _0x2496b7=_0xff839e?0x0:_0x1b1b11['offset'];var _0x2b0256=_0xff839e?_0x459b8f[_0xdbbd('0x1c')]:_0x1b1b11[_0xdbbd('0x19')]+_0x1b1b11[_0xdbbd('0x1b')];var _0x42e7af;if(_0x2b0256>=_0x263b60){_0x2b0256=_0x263b60;_0x42e7af=0xc8;}else{_0x42e7af=0xce;}_0x11bafc[_0xdbbd('0x18')](_0x42e7af);return _0x11bafc[_0xdbbd('0x1d')](_0xdbbd('0x1e'),_0x2496b7+'-'+_0x2b0256+'/'+_0x263b60)[_0xdbbd('0x1f')](_0x459b8f);}return null;};}function patchUpdates(_0x10ef3c){return function(_0xa6952d){try{jsonpatch[_0xdbbd('0x20')](_0xa6952d,_0x10ef3c,!![]);}catch(_0x238656){return BPromise['reject'](_0x238656);}return _0xa6952d['save']();};}function saveUpdates(_0x2cfefc,_0x16f324){return function(_0x42719c){if(_0x42719c){return _0x42719c[_0xdbbd('0x21')](_0x2cfefc)['then'](function(_0x92df33){return _0x92df33;});}return null;};}function removeEntity(_0x42d63b,_0x30e368){return function(_0x37498e){if(_0x37498e){return _0x37498e['destroy']()['then'](function(){_0x42d63b['status'](0xcc)[_0xdbbd('0x17')]();});}};}function handleEntityNotFound(_0x35b671,_0x4b74da){return function(_0x1b81b8){if(!_0x1b81b8){_0x35b671[_0xdbbd('0x22')](0x194);}return _0x1b81b8;};}function handleError(_0x2bf85a,_0x513824){_0x513824=_0x513824||0x1f4;return function(_0x206b95){logger[_0xdbbd('0x23')](_0x206b95[_0xdbbd('0x24')]);if(_0x206b95[_0xdbbd('0x25')]){delete _0x206b95[_0xdbbd('0x25')];}_0x2bf85a[_0xdbbd('0x18')](_0x513824)['send'](_0x206b95);};}exports[_0xdbbd('0x26')]=function(_0x52d574,_0x51e0fa){var _0x1ea4e0={},_0x4b7671={},_0x191dfa={'count':0x0,'rows':[]};var _0x406a12=_['map'](db[_0xdbbd('0x27')][_0xdbbd('0x28')],function(_0x4a3027){return{'name':_0x4a3027['fieldName'],'type':_0x4a3027['type'][_0xdbbd('0x29')]};});_0x4b7671[_0xdbbd('0x2a')]=_[_0xdbbd('0x2b')](_0x406a12,'name');_0x4b7671['query']=_[_0xdbbd('0x2c')](_0x52d574[_0xdbbd('0x2d')]);_0x4b7671[_0xdbbd('0x2e')]=_[_0xdbbd('0x2f')](_0x4b7671[_0xdbbd('0x2a')],_0x4b7671[_0xdbbd('0x2d')]);_0x1ea4e0[_0xdbbd('0x30')]=_['intersection'](_0x4b7671[_0xdbbd('0x2a')],qs['fields'](_0x52d574[_0xdbbd('0x2d')][_0xdbbd('0x31')]));_0x1ea4e0['attributes']=_0x1ea4e0[_0xdbbd('0x30')][_0xdbbd('0x32')]?_0x1ea4e0['attributes']:_0x4b7671[_0xdbbd('0x2a')];if(!_0x52d574[_0xdbbd('0x2d')]['hasOwnProperty']('nolimit')){_0x1ea4e0[_0xdbbd('0x1b')]=qs[_0xdbbd('0x1b')](_0x52d574[_0xdbbd('0x2d')][_0xdbbd('0x1b')]);_0x1ea4e0[_0xdbbd('0x19')]=qs[_0xdbbd('0x19')](_0x52d574[_0xdbbd('0x2d')]['offset']);}_0x1ea4e0['order']=qs[_0xdbbd('0x33')](_0x52d574[_0xdbbd('0x2d')]['sort']);_0x1ea4e0[_0xdbbd('0x34')]=qs['filters'](_['pick'](_0x52d574[_0xdbbd('0x2d')],_0x4b7671[_0xdbbd('0x2e')]),_0x406a12);if(_0x52d574[_0xdbbd('0x2d')][_0xdbbd('0x35')]){_0x1ea4e0['where']=_[_0xdbbd('0x36')](_0x1ea4e0[_0xdbbd('0x34')],{'$or':_[_0xdbbd('0x2b')](_0x406a12,function(_0x331740){if(_0x331740[_0xdbbd('0x37')]!=='VIRTUAL'){var _0x5dea1b={};_0x5dea1b[_0x331740['name']]={'$like':'%'+_0x52d574['query'][_0xdbbd('0x35')]+'%'};return _0x5dea1b;}})});}_0x1ea4e0=_[_0xdbbd('0x36')]({},_0x1ea4e0,_0x52d574[_0xdbbd('0x38')]);var _0x144e7c={'where':_0x1ea4e0[_0xdbbd('0x34')]};return db[_0xdbbd('0x27')][_0xdbbd('0x1c')](_0x144e7c)[_0xdbbd('0x39')](function(_0x4a56f9){_0x191dfa[_0xdbbd('0x1c')]=_0x4a56f9;if(_0x52d574[_0xdbbd('0x2d')][_0xdbbd('0x3a')]){_0x1ea4e0[_0xdbbd('0x3b')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xdbbd('0x3c')](_0x1ea4e0);})[_0xdbbd('0x39')](function(_0x43dc61){_0x191dfa[_0xdbbd('0x3d')]=_0x43dc61;return _0x191dfa;})[_0xdbbd('0x39')](respondWithFilteredResult(_0x51e0fa,_0x1ea4e0))[_0xdbbd('0x3e')](handleError(_0x51e0fa,null));};exports[_0xdbbd('0x3f')]=function(_0x22ca4f,_0x2e65de){var _0xe59226={'raw':![],'where':{'id':_0x22ca4f[_0xdbbd('0x40')]['id']}},_0x25f923={};_0x25f923[_0xdbbd('0x2a')]=_[_0xdbbd('0x2c')](db[_0xdbbd('0x27')][_0xdbbd('0x28')]);_0x25f923['query']=_[_0xdbbd('0x2c')](_0x22ca4f[_0xdbbd('0x2d')]);_0x25f923[_0xdbbd('0x2e')]=_['intersection'](_0x25f923['model'],_0x25f923[_0xdbbd('0x2d')]);_0xe59226[_0xdbbd('0x30')]=_[_0xdbbd('0x2f')](_0x25f923['model'],qs[_0xdbbd('0x31')](_0x22ca4f[_0xdbbd('0x2d')][_0xdbbd('0x31')]));_0xe59226[_0xdbbd('0x30')]=_0xe59226[_0xdbbd('0x30')][_0xdbbd('0x32')]?_0xe59226[_0xdbbd('0x30')]:_0x25f923[_0xdbbd('0x2a')];if(_0x22ca4f[_0xdbbd('0x2d')][_0xdbbd('0x3a')]){_0xe59226[_0xdbbd('0x3b')]=[{'all':!![]}];}_0xe59226=_[_0xdbbd('0x36')]({},_0xe59226,_0x22ca4f['options']);return db[_0xdbbd('0x27')][_0xdbbd('0x41')](_0xe59226)[_0xdbbd('0x39')](handleEntityNotFound(_0x2e65de,null))[_0xdbbd('0x39')](respondWithResult(_0x2e65de,null))['catch'](handleError(_0x2e65de,null));};exports[_0xdbbd('0x42')]=function(_0x2c0a51,_0x2fef9e){return db[_0xdbbd('0x27')][_0xdbbd('0x42')](_0x2c0a51['body'],{})['then'](respondWithResult(_0x2fef9e,0xc9))['catch'](handleError(_0x2fef9e,null));};exports[_0xdbbd('0x21')]=function(_0x3fe014,_0xf9e5a4){if(_0x3fe014[_0xdbbd('0x43')]['id']){delete _0x3fe014[_0xdbbd('0x43')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x3fe014[_0xdbbd('0x40')]['id']}})[_0xdbbd('0x39')](handleEntityNotFound(_0xf9e5a4,null))[_0xdbbd('0x39')](saveUpdates(_0x3fe014[_0xdbbd('0x43')],null))['then'](respondWithResult(_0xf9e5a4,null))['catch'](handleError(_0xf9e5a4,null));};exports['destroy']=function(_0x46fbc2,_0x584ffa){return db['DeskConfiguration'][_0xdbbd('0x41')]({'where':{'id':_0x46fbc2[_0xdbbd('0x40')]['id']}})[_0xdbbd('0x39')](handleEntityNotFound(_0x584ffa,null))[_0xdbbd('0x39')](removeEntity(_0x584ffa,null))[_0xdbbd('0x3e')](handleError(_0x584ffa,null));};exports['getFields']=function(_0x3f0cc9,_0x236cff,_0x406203){var _0x1ac2f6={};var _0x3d58cd={};var _0x340c9d;var _0x15bf7e;return db['DeskConfiguration'][_0xdbbd('0x44')]({'where':{'id':_0x3f0cc9[_0xdbbd('0x40')]['id']}})['then'](handleEntityNotFound(_0x236cff,null))[_0xdbbd('0x39')](function(_0x3edcb7){if(_0x3edcb7){_0x340c9d=_0x3edcb7;_0x3d58cd[_0xdbbd('0x2a')]=_['keys'](db[_0xdbbd('0x45')][_0xdbbd('0x28')]);_0x3d58cd[_0xdbbd('0x2d')]=_[_0xdbbd('0x2c')](_0x3f0cc9[_0xdbbd('0x2d')]);_0x3d58cd[_0xdbbd('0x2e')]=_[_0xdbbd('0x2f')](_0x3d58cd[_0xdbbd('0x2a')],_0x3d58cd['query']);_0x1ac2f6[_0xdbbd('0x30')]=_[_0xdbbd('0x2f')](_0x3d58cd[_0xdbbd('0x2a')],qs[_0xdbbd('0x31')](_0x3f0cc9[_0xdbbd('0x2d')]['fields']));_0x1ac2f6['attributes']=_0x1ac2f6['attributes'][_0xdbbd('0x32')]?_0x1ac2f6[_0xdbbd('0x30')]:_0x3d58cd[_0xdbbd('0x2a')];_0x1ac2f6[_0xdbbd('0x46')]=qs[_0xdbbd('0x33')](_0x3f0cc9[_0xdbbd('0x2d')][_0xdbbd('0x33')]);_0x1ac2f6[_0xdbbd('0x34')]=qs[_0xdbbd('0x2e')](_[_0xdbbd('0x47')](_0x3f0cc9[_0xdbbd('0x2d')],_0x3d58cd[_0xdbbd('0x2e')]));if(_0x3f0cc9[_0xdbbd('0x2d')][_0xdbbd('0x35')]){_0x1ac2f6[_0xdbbd('0x34')]=_[_0xdbbd('0x36')](_0x1ac2f6[_0xdbbd('0x34')],{'$or':_[_0xdbbd('0x2b')](_0x1ac2f6[_0xdbbd('0x30')],function(_0x376938){var _0xa9f9d1={};_0xa9f9d1[_0x376938]={'$like':'%'+_0x3f0cc9[_0xdbbd('0x2d')][_0xdbbd('0x35')]+'%'};return _0xa9f9d1;})});}_0x1ac2f6=_[_0xdbbd('0x36')]({},_0x1ac2f6,_0x3f0cc9[_0xdbbd('0x38')]);return _0x340c9d[_0xdbbd('0x48')](_0x1ac2f6);}})['then'](function(_0x58967b){if(_0x58967b){_0x15bf7e=_0x58967b[_0xdbbd('0x32')];if(!_0x3f0cc9[_0xdbbd('0x2d')][_0xdbbd('0x49')](_0xdbbd('0x4a'))){_0x1ac2f6['limit']=qs[_0xdbbd('0x1b')](_0x3f0cc9[_0xdbbd('0x2d')][_0xdbbd('0x1b')]);_0x1ac2f6['offset']=qs[_0xdbbd('0x19')](_0x3f0cc9[_0xdbbd('0x2d')][_0xdbbd('0x19')]);}return _0x340c9d[_0xdbbd('0x48')](_0x1ac2f6);}})[_0xdbbd('0x39')](function(_0x1e8f76){if(_0x1e8f76){return _0x1e8f76?{'count':_0x15bf7e,'rows':_0x1e8f76}:null;}})[_0xdbbd('0x39')](respondWithResult(_0x236cff,null))[_0xdbbd('0x3e')](handleError(_0x236cff,null));};exports[_0xdbbd('0x4b')]=function(_0xd82792,_0x5dee7b,_0x2c0342){var _0x483ed5={};var _0x1e549f={};var _0x5b1f8e;var _0x4b151a;return db[_0xdbbd('0x27')]['findOne']({'where':{'id':_0xd82792['params']['id']}})['then'](handleEntityNotFound(_0x5dee7b,null))[_0xdbbd('0x39')](function(_0x498461){if(_0x498461){_0x5b1f8e=_0x498461;_0x1e549f[_0xdbbd('0x2a')]=_[_0xdbbd('0x2c')](db['DeskField'][_0xdbbd('0x28')]);_0x1e549f[_0xdbbd('0x2d')]=_[_0xdbbd('0x2c')](_0xd82792[_0xdbbd('0x2d')]);_0x1e549f['filters']=_[_0xdbbd('0x2f')](_0x1e549f[_0xdbbd('0x2a')],_0x1e549f[_0xdbbd('0x2d')]);_0x483ed5[_0xdbbd('0x30')]=_[_0xdbbd('0x2f')](_0x1e549f[_0xdbbd('0x2a')],qs['fields'](_0xd82792[_0xdbbd('0x2d')][_0xdbbd('0x31')]));_0x483ed5[_0xdbbd('0x30')]=_0x483ed5['attributes']['length']?_0x483ed5[_0xdbbd('0x30')]:_0x1e549f[_0xdbbd('0x2a')];_0x483ed5[_0xdbbd('0x46')]=qs[_0xdbbd('0x33')](_0xd82792['query']['sort']);_0x483ed5[_0xdbbd('0x34')]=qs['filters'](_[_0xdbbd('0x47')](_0xd82792[_0xdbbd('0x2d')],_0x1e549f[_0xdbbd('0x2e')]));if(_0xd82792[_0xdbbd('0x2d')][_0xdbbd('0x35')]){_0x483ed5[_0xdbbd('0x34')]=_[_0xdbbd('0x36')](_0x483ed5[_0xdbbd('0x34')],{'$or':_['map'](_0x483ed5[_0xdbbd('0x30')],function(_0x541985){var _0x32095f={};_0x32095f[_0x541985]={'$like':'%'+_0xd82792[_0xdbbd('0x2d')][_0xdbbd('0x35')]+'%'};return _0x32095f;})});}_0x483ed5=_[_0xdbbd('0x36')]({},_0x483ed5,_0xd82792[_0xdbbd('0x38')]);return _0x5b1f8e[_0xdbbd('0x4b')](_0x483ed5);}})['then'](function(_0xfb2d44){if(_0xfb2d44){_0x4b151a=_0xfb2d44['length'];if(!_0xd82792[_0xdbbd('0x2d')][_0xdbbd('0x49')](_0xdbbd('0x4a'))){_0x483ed5['limit']=qs[_0xdbbd('0x1b')](_0xd82792[_0xdbbd('0x2d')][_0xdbbd('0x1b')]);_0x483ed5[_0xdbbd('0x19')]=qs[_0xdbbd('0x19')](_0xd82792[_0xdbbd('0x2d')]['offset']);}return _0x5b1f8e['getSubjects'](_0x483ed5);}})[_0xdbbd('0x39')](function(_0x5e5ebd){if(_0x5e5ebd){return _0x5e5ebd?{'count':_0x4b151a,'rows':_0x5e5ebd}:null;}})['then'](respondWithResult(_0x5dee7b,null))[_0xdbbd('0x3e')](handleError(_0x5dee7b,null));};exports[_0xdbbd('0x4c')]=function(_0x3bd788,_0xc44746,_0x6000f3){var _0x12a715={};var _0x276d85={};var _0x2aa835;var _0x514b58;return db[_0xdbbd('0x27')][_0xdbbd('0x44')]({'where':{'id':_0x3bd788[_0xdbbd('0x40')]['id']}})[_0xdbbd('0x39')](handleEntityNotFound(_0xc44746,null))[_0xdbbd('0x39')](function(_0x50e447){if(_0x50e447){_0x2aa835=_0x50e447;_0x276d85['model']=_['keys'](db[_0xdbbd('0x45')][_0xdbbd('0x28')]);_0x276d85[_0xdbbd('0x2d')]=_['keys'](_0x3bd788[_0xdbbd('0x2d')]);_0x276d85[_0xdbbd('0x2e')]=_[_0xdbbd('0x2f')](_0x276d85[_0xdbbd('0x2a')],_0x276d85[_0xdbbd('0x2d')]);_0x12a715[_0xdbbd('0x30')]=_['intersection'](_0x276d85['model'],qs['fields'](_0x3bd788[_0xdbbd('0x2d')][_0xdbbd('0x31')]));_0x12a715[_0xdbbd('0x30')]=_0x12a715[_0xdbbd('0x30')]['length']?_0x12a715[_0xdbbd('0x30')]:_0x276d85['model'];_0x12a715[_0xdbbd('0x46')]=qs[_0xdbbd('0x33')](_0x3bd788['query']['sort']);_0x12a715[_0xdbbd('0x34')]=qs[_0xdbbd('0x2e')](_[_0xdbbd('0x47')](_0x3bd788[_0xdbbd('0x2d')],_0x276d85['filters']));if(_0x3bd788[_0xdbbd('0x2d')][_0xdbbd('0x35')]){_0x12a715['where']=_[_0xdbbd('0x36')](_0x12a715['where'],{'$or':_[_0xdbbd('0x2b')](_0x12a715[_0xdbbd('0x30')],function(_0x2f8c63){var _0x38e2bd={};_0x38e2bd[_0x2f8c63]={'$like':'%'+_0x3bd788['query'][_0xdbbd('0x35')]+'%'};return _0x38e2bd;})});}_0x12a715=_['merge']({},_0x12a715,_0x3bd788[_0xdbbd('0x38')]);return _0x2aa835['getDescriptions'](_0x12a715);}})[_0xdbbd('0x39')](function(_0xf01cda){if(_0xf01cda){_0x514b58=_0xf01cda[_0xdbbd('0x32')];if(!_0x3bd788[_0xdbbd('0x2d')][_0xdbbd('0x49')](_0xdbbd('0x4a'))){_0x12a715[_0xdbbd('0x1b')]=qs[_0xdbbd('0x1b')](_0x3bd788[_0xdbbd('0x2d')][_0xdbbd('0x1b')]);_0x12a715[_0xdbbd('0x19')]=qs[_0xdbbd('0x19')](_0x3bd788[_0xdbbd('0x2d')][_0xdbbd('0x19')]);}return _0x2aa835[_0xdbbd('0x4c')](_0x12a715);}})['then'](function(_0x4244cb){if(_0x4244cb){return _0x4244cb?{'count':_0x514b58,'rows':_0x4244cb}:null;}})[_0xdbbd('0x39')](respondWithResult(_0xc44746,null))['catch'](handleError(_0xc44746,null));};exports['getTags']=function(_0x5665c2,_0x28b4be,_0x377bac){var _0x5800e7={};var _0x8d3605={};var _0x4fd5d2;var _0x26ceb9;return db['DeskConfiguration'][_0xdbbd('0x44')]({'where':{'id':_0x5665c2[_0xdbbd('0x40')]['id']}})[_0xdbbd('0x39')](handleEntityNotFound(_0x28b4be,null))[_0xdbbd('0x39')](function(_0x5483b4){if(_0x5483b4){_0x4fd5d2=_0x5483b4;_0x8d3605[_0xdbbd('0x2a')]=_[_0xdbbd('0x2c')](db[_0xdbbd('0x4d')][_0xdbbd('0x28')]);_0x8d3605['query']=_[_0xdbbd('0x2c')](_0x5665c2[_0xdbbd('0x2d')]);_0x8d3605[_0xdbbd('0x2e')]=_[_0xdbbd('0x2f')](_0x8d3605[_0xdbbd('0x2a')],_0x8d3605[_0xdbbd('0x2d')]);_0x5800e7[_0xdbbd('0x30')]=_[_0xdbbd('0x2f')](_0x8d3605[_0xdbbd('0x2a')],qs[_0xdbbd('0x31')](_0x5665c2[_0xdbbd('0x2d')][_0xdbbd('0x31')]));_0x5800e7['attributes']=_0x5800e7['attributes']['length']?_0x5800e7[_0xdbbd('0x30')]:_0x8d3605[_0xdbbd('0x2a')];_0x5800e7['order']=qs[_0xdbbd('0x33')](_0x5665c2[_0xdbbd('0x2d')][_0xdbbd('0x33')]);_0x5800e7['where']=qs[_0xdbbd('0x2e')](_[_0xdbbd('0x47')](_0x5665c2[_0xdbbd('0x2d')],_0x8d3605[_0xdbbd('0x2e')]));if(_0x5665c2[_0xdbbd('0x2d')][_0xdbbd('0x35')]){_0x5800e7[_0xdbbd('0x34')]=_[_0xdbbd('0x36')](_0x5800e7[_0xdbbd('0x34')],{'$or':_[_0xdbbd('0x2b')](_0x5800e7[_0xdbbd('0x30')],function(_0x3dfe12){var _0x427d33={};_0x427d33[_0x3dfe12]={'$like':'%'+_0x5665c2[_0xdbbd('0x2d')][_0xdbbd('0x35')]+'%'};return _0x427d33;})});}_0x5800e7=_[_0xdbbd('0x36')]({},_0x5800e7,_0x5665c2[_0xdbbd('0x38')]);return _0x4fd5d2[_0xdbbd('0x4e')](_0x5800e7);}})[_0xdbbd('0x39')](function(_0xf64080){if(_0xf64080){_0x26ceb9=_0xf64080[_0xdbbd('0x32')];if(!_0x5665c2['query']['hasOwnProperty'](_0xdbbd('0x4a'))){_0x5800e7[_0xdbbd('0x1b')]=qs[_0xdbbd('0x1b')](_0x5665c2['query'][_0xdbbd('0x1b')]);_0x5800e7[_0xdbbd('0x19')]=qs[_0xdbbd('0x19')](_0x5665c2[_0xdbbd('0x2d')][_0xdbbd('0x19')]);}return _0x4fd5d2[_0xdbbd('0x4e')](_0x5800e7);}})['then'](function(_0x8b507c){if(_0x8b507c){return _0x8b507c?{'count':_0x26ceb9,'rows':_0x8b507c}:null;}})[_0xdbbd('0x39')](respondWithResult(_0x28b4be,null))[_0xdbbd('0x3e')](handleError(_0x28b4be,null));};exports[_0xdbbd('0x4f')]=function(_0x2b0e69,_0xcc72aa,_0x387c04){if(_0x2b0e69[_0xdbbd('0x43')]['id']){delete _0x2b0e69[_0xdbbd('0x43')]['id'];}return db[_0xdbbd('0x27')][_0xdbbd('0x44')]({'where':{'id':_0x2b0e69[_0xdbbd('0x40')]['id']}})['then'](handleEntityNotFound(_0xcc72aa,null))['then'](function(_0x20fe00){if(_0x20fe00){return _0x20fe00[_0xdbbd('0x4f')](_0x2b0e69[_0xdbbd('0x43')][_0xdbbd('0x50')]||[]);}return null;})[_0xdbbd('0x39')](respondWithResult(_0xcc72aa,null))[_0xdbbd('0x3e')](handleError(_0xcc72aa,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index a4a2dc5..904c907 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 _0x06b1=['path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','int_desk_configurations','util','../../config/logger','moment','request-promise'];(function(_0x49acee,_0x49c7ab){var _0x18a8f8=function(_0x18fb2a){while(--_0x18fb2a){_0x49acee['push'](_0x49acee['shift']());}};_0x18a8f8(++_0x49c7ab);}(_0x06b1,0x15a));var _0x106b=function(_0x348d75,_0x1bee06){_0x348d75=_0x348d75-0x0;var _0x57893c=_0x06b1[_0x348d75];return _0x57893c;};'use strict';var _=require('lodash');var util=require(_0x106b('0x0'));var logger=require(_0x106b('0x1'))('api');var moment=require(_0x106b('0x2'));var BPromise=require('bluebird');var rp=require(_0x106b('0x3'));var fs=require('fs');var path=require(_0x106b('0x4'));var rimraf=require(_0x106b('0x5'));var config=require(_0x106b('0x6'));var attributes=require(_0x106b('0x7'));module[_0x106b('0x8')]=function(_0x56319b,_0x42df6a){return _0x56319b['define']('DeskConfiguration',attributes,{'tableName':_0x106b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65e6=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','../../config/logger','api'];(function(_0xab7fa1,_0x17e146){var _0x44094a=function(_0x3a2840){while(--_0x3a2840){_0xab7fa1['push'](_0xab7fa1['shift']());}};_0x44094a(++_0x17e146);}(_0x65e6,0x106));var _0x665e=function(_0x23dbf3,_0x4f0438){_0x23dbf3=_0x23dbf3-0x0;var _0xdef680=_0x65e6[_0x23dbf3];return _0xdef680;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x665e('0x0'))(_0x665e('0x1'));var moment=require('moment');var BPromise=require(_0x665e('0x2'));var rp=require(_0x665e('0x3'));var fs=require('fs');var path=require(_0x665e('0x4'));var rimraf=require(_0x665e('0x5'));var config=require(_0x665e('0x6'));var attributes=require(_0x665e('0x7'));module[_0x665e('0x8')]=function(_0x27eb3d,_0x392620){return _0x27eb3d[_0x665e('0x9')](_0x665e('0xa'),attributes,{'tableName':_0x665e('0xb'),'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 f02e806..f87028d 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 _0xcc6d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','request','then','DeskConfiguration,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result'];(function(_0xe26bb8,_0x4c7683){var _0x1af4ec=function(_0x143879){while(--_0x143879){_0xe26bb8['push'](_0xe26bb8['shift']());}};_0x1af4ec(++_0x4c7683);}(_0xcc6d,0x1a9));var _0xdcc6=function(_0x5a54e7,_0x539e10){_0x5a54e7=_0x5a54e7-0x0;var _0x5be15f=_0xcc6d[_0x5a54e7];return _0x5be15f;};'use strict';var _=require(_0xdcc6('0x0'));var util=require(_0xdcc6('0x1'));var moment=require(_0xdcc6('0x2'));var BPromise=require(_0xdcc6('0x3'));var rs=require(_0xdcc6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcc6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcc6('0x6'));var config=require('../../config/environment');var jayson=require(_0xdcc6('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47ec37,_0x226e34,_0x47cc5a){return new BPromise(function(_0x393524,_0x13a583){return client[_0xdcc6('0x8')](_0x47ec37,_0x47cc5a)[_0xdcc6('0x9')](function(_0x45fa41){logger['info'](_0xdcc6('0xa'),_0x226e34,'request\x20sent');logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x226e34,'request\x20sent',JSON[_0xdcc6('0xb')](_0x45fa41));if(_0x45fa41['error']){if(_0x45fa41['error'][_0xdcc6('0xc')]===0x1f4){logger[_0xdcc6('0xd')](_0xdcc6('0xa'),_0x226e34,_0x45fa41[_0xdcc6('0xd')][_0xdcc6('0xe')]);return _0x13a583(_0x45fa41[_0xdcc6('0xd')][_0xdcc6('0xe')]);}logger[_0xdcc6('0xd')](_0xdcc6('0xa'),_0x226e34,_0x45fa41[_0xdcc6('0xd')]['message']);return _0x393524(_0x45fa41['error'][_0xdcc6('0xe')]);}else{logger['info'](_0xdcc6('0xa'),_0x226e34,_0xdcc6('0xf'));_0x393524(_0x45fa41[_0xdcc6('0x10')][_0xdcc6('0xe')]);}})['catch'](function(_0x36a485){logger[_0xdcc6('0xd')](_0xdcc6('0xa'),_0x226e34,_0x36a485);_0x13a583(_0x36a485);});});} \ No newline at end of file +var _0xd08d=['http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x106377,_0x5bf749){var _0x26d00b=function(_0x54d08b){while(--_0x54d08b){_0x106377['push'](_0x106377['shift']());}};_0x26d00b(++_0x5bf749);}(_0xd08d,0x81));var _0xdd08=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xd08d[_0x5c9307];return _0x373e29;};'use strict';var _=require('lodash');var util=require(_0xdd08('0x0'));var moment=require(_0xdd08('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd08('0x2'));var fs=require('fs');var Redis=require(_0xdd08('0x3'));var db=require(_0xdd08('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x5'))(_0xdd08('0x6'));var config=require(_0xdd08('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd08('0x8')][_0xdd08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13999f,_0x28d59c,_0x147a23){return new BPromise(function(_0x54a5a3,_0x15416b){return client[_0xdd08('0xa')](_0x13999f,_0x147a23)[_0xdd08('0xb')](function(_0x51ce97){logger[_0xdd08('0xc')](_0xdd08('0xd'),_0x28d59c,_0xdd08('0xe'));logger[_0xdd08('0xf')](_0xdd08('0x10'),_0x28d59c,_0xdd08('0xe'),JSON[_0xdd08('0x11')](_0x51ce97));if(_0x51ce97[_0xdd08('0x12')]){if(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x13')]===0x1f4){logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x51ce97['error'][_0xdd08('0x14')]);return _0x15416b(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);}logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);return _0x54a5a3(_0x51ce97[_0xdd08('0x12')][_0xdd08('0x14')]);}else{logger[_0xdd08('0xc')](_0xdd08('0xd'),_0x28d59c,_0xdd08('0xe'));_0x54a5a3(_0x51ce97[_0xdd08('0x15')][_0xdd08('0x14')]);}})[_0xdd08('0x16')](function(_0x278f5e){logger[_0xdd08('0x12')](_0xdd08('0xd'),_0x28d59c,_0x278f5e);_0x15416b(_0x278f5e);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2a3f03d..74c6640 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 _0x75c2=['multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post','put','destroy','exports'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x75c2,0x1a0));var _0x275c=function(_0x40e130,_0x11203c){_0x40e130=_0x40e130-0x0;var _0x3dbb41=_0x75c2[_0x40e130];return _0x3dbb41;};'use strict';var multer=require(_0x275c('0x0'));var util=require(_0x275c('0x1'));var path=require(_0x275c('0x2'));var timeout=require(_0x275c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x275c('0x4'));var config=require(_0x275c('0x5'));var controller=require(_0x275c('0x6'));router['get']('/',auth[_0x275c('0x7')](),controller[_0x275c('0x8')]);router[_0x275c('0x9')](_0x275c('0xa'),auth[_0x275c('0x7')](),controller[_0x275c('0xb')]);router[_0x275c('0xc')]('/',auth[_0x275c('0x7')](),controller['create']);router[_0x275c('0xd')](_0x275c('0xa'),auth[_0x275c('0x7')](),controller['update']);router['delete'](_0x275c('0xa'),auth[_0x275c('0x7')](),controller[_0x275c('0xe')]);module[_0x275c('0xf')]=router; \ No newline at end of file +var _0x3c8e=['./intDeskField.controller','get','index','/:id','isAuthenticated','show','put','update','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x20dcf2,_0x2177c4){var _0x281abb=function(_0x256d01){while(--_0x256d01){_0x20dcf2['push'](_0x20dcf2['shift']());}};_0x281abb(++_0x2177c4);}(_0x3c8e,0x89));var _0xe3c8=function(_0x3d0e25,_0xb7d2e7){_0x3d0e25=_0x3d0e25-0x0;var _0x3b5cb9=_0x3c8e[_0x3d0e25];return _0x3b5cb9;};'use strict';var multer=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe3c8('0x2'));var router=express[_0xe3c8('0x3')]();var fs_extra=require(_0xe3c8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe3c8('0x5'));var config=require(_0xe3c8('0x6'));var controller=require(_0xe3c8('0x7'));router[_0xe3c8('0x8')]('/',auth['isAuthenticated'](),controller[_0xe3c8('0x9')]);router[_0xe3c8('0x8')](_0xe3c8('0xa'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0xc')]);router['post']('/',auth[_0xe3c8('0xb')](),controller['create']);router[_0xe3c8('0xd')](_0xe3c8('0xa'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0xe')]);router['delete'](_0xe3c8('0xa'),auth[_0xe3c8('0xb')](),controller[_0xe3c8('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 0b85b15..d711062 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 _0x1ed7=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x38b21e,_0x1453cb){var _0x5f2472=function(_0x34ba89){while(--_0x34ba89){_0x38b21e['push'](_0x38b21e['shift']());}};_0x5f2472(++_0x1453cb);}(_0x1ed7,0x6f));var _0x71ed=function(_0x1be053,_0x4efb28){_0x1be053=_0x1be053-0x0;var _0x1b5814=_0x1ed7[_0x1be053];return _0x1b5814;};'use strict';var Sequelize=require(_0x71ed('0x0'));module[_0x71ed('0x1')]={'type':{'type':Sequelize[_0x71ed('0x2')](_0x71ed('0x3'),_0x71ed('0x4'),_0x71ed('0x5'),_0x71ed('0x6'),_0x71ed('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x71ed('0x8')]},'key':{'type':Sequelize[_0x71ed('0x8')]},'keyType':{'type':Sequelize[_0x71ed('0x2')](_0x71ed('0x3'),_0x71ed('0x4'),_0x71ed('0x5'))},'keyContent':{'type':Sequelize[_0x71ed('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x71ed('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x71ed('0x8')]}}; \ No newline at end of file +var _0x96a3=['exports','ENUM','variable','keyValue','STRING','string','customVariable','BOOLEAN','sequelize'];(function(_0x16086a,_0x476bd1){var _0x9568e3=function(_0x49b6cc){while(--_0x49b6cc){_0x16086a['push'](_0x16086a['shift']());}};_0x9568e3(++_0x476bd1);}(_0x96a3,0x6b));var _0x396a=function(_0x569485,_0x3b7cf3){_0x569485=_0x569485-0x0;var _0x40d1c7=_0x96a3[_0x569485];return _0x40d1c7;};'use strict';var Sequelize=require(_0x396a('0x0'));module[_0x396a('0x1')]={'type':{'type':Sequelize[_0x396a('0x2')]('string',_0x396a('0x3'),'customVariable',_0x396a('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x396a('0x5')]},'keyType':{'type':Sequelize[_0x396a('0x2')](_0x396a('0x6'),_0x396a('0x3'),_0x396a('0x7'))},'keyContent':{'type':Sequelize[_0x396a('0x5')]},'idField':{'type':Sequelize[_0x396a('0x5')]},'nameField':{'type':Sequelize[_0x396a('0x5')]},'customField':{'type':Sequelize[_0x396a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7a65501..16c3e5c 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 _0x0adf=['include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','DeskField','count','includeAll'];(function(_0x25c2df,_0x2b08ef){var _0x524bec=function(_0x3564d4){while(--_0x3564d4){_0x25c2df['push'](_0x25c2df['shift']());}};_0x524bec(++_0x2b08ef);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x40b374,_0x4d0a2d){_0x40b374=_0x40b374-0x0;var _0x2db84c=_0x0adf[_0x40b374];return _0x2db84c;};'use strict';var emlformat=require(_0xf0ad('0x0'));var rimraf=require(_0xf0ad('0x1'));var zipdir=require(_0xf0ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0ad('0x3'));var moment=require(_0xf0ad('0x4'));var BPromise=require(_0xf0ad('0x5'));var Mustache=require(_0xf0ad('0x6'));var util=require(_0xf0ad('0x7'));var path=require(_0xf0ad('0x8'));var sox=require(_0xf0ad('0x9'));var csv=require('to-csv');var ejs=require(_0xf0ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0ad('0xb'));var squel=require(_0xf0ad('0xc'));var crypto=require(_0xf0ad('0xd'));var jsforce=require(_0xf0ad('0xe'));var deskjs=require(_0xf0ad('0xf'));var toCsv=require(_0xf0ad('0x10'));var querystring=require(_0xf0ad('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf0ad('0x13'));var as=require(_0xf0ad('0x14'));var hardwareService=require(_0xf0ad('0x15'));var logger=require(_0xf0ad('0x16'))(_0xf0ad('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0ad('0x18'));var db=require(_0xf0ad('0x19'))['db'];function respondWithStatusCode(_0x3646a2,_0x238c3b){_0x238c3b=_0x238c3b||0xcc;return function(_0x597c40){if(_0x597c40){return _0x3646a2[_0xf0ad('0x1a')](_0x238c3b);}return _0x3646a2[_0xf0ad('0x1b')](_0x238c3b)['end']();};}function respondWithResult(_0x49df92,_0x5332e9){_0x5332e9=_0x5332e9||0xc8;return function(_0x221d7b){if(_0x221d7b){return _0x49df92['status'](_0x5332e9)[_0xf0ad('0x1c')](_0x221d7b);}};}function respondWithFilteredResult(_0x313ad6,_0xfa544c){return function(_0xfa829e){if(_0xfa829e){var _0x237dd9=typeof _0xfa544c['offset']===_0xf0ad('0x1d')&&typeof _0xfa544c[_0xf0ad('0x1e')]===_0xf0ad('0x1d');var _0x1c9fac=_0xfa829e['count'];var _0x4e9970=_0x237dd9?0x0:_0xfa544c[_0xf0ad('0x1f')];var _0x46fb20=_0x237dd9?_0xfa829e['count']:_0xfa544c[_0xf0ad('0x1f')]+_0xfa544c[_0xf0ad('0x1e')];var _0x9a95bf;if(_0x46fb20>=_0x1c9fac){_0x46fb20=_0x1c9fac;_0x9a95bf=0xc8;}else{_0x9a95bf=0xce;}_0x313ad6[_0xf0ad('0x1b')](_0x9a95bf);return _0x313ad6['set']('Content-Range',_0x4e9970+'-'+_0x46fb20+'/'+_0x1c9fac)[_0xf0ad('0x1c')](_0xfa829e);}return null;};}function patchUpdates(_0x2da425){return function(_0x37b968){try{jsonpatch[_0xf0ad('0x20')](_0x37b968,_0x2da425,!![]);}catch(_0x2ac8ba){return BPromise[_0xf0ad('0x21')](_0x2ac8ba);}return _0x37b968['save']();};}function saveUpdates(_0x33c95d,_0x16e62a){return function(_0x31635b){if(_0x31635b){return _0x31635b[_0xf0ad('0x22')](_0x33c95d)[_0xf0ad('0x23')](function(_0x88b47b){return _0x88b47b;});}return null;};}function removeEntity(_0xb91769,_0x276322){return function(_0x3fc97e){if(_0x3fc97e){return _0x3fc97e[_0xf0ad('0x24')]()[_0xf0ad('0x23')](function(){_0xb91769[_0xf0ad('0x1b')](0xcc)[_0xf0ad('0x25')]();});}};}function handleEntityNotFound(_0x456f81,_0x879f89){return function(_0x557f90){if(!_0x557f90){_0x456f81[_0xf0ad('0x1a')](0x194);}return _0x557f90;};}function handleError(_0x1507a3,_0x248794){_0x248794=_0x248794||0x1f4;return function(_0x7377d7){logger[_0xf0ad('0x26')](_0x7377d7[_0xf0ad('0x27')]);if(_0x7377d7['name']){delete _0x7377d7[_0xf0ad('0x28')];}_0x1507a3[_0xf0ad('0x1b')](_0x248794)[_0xf0ad('0x29')](_0x7377d7);};}exports[_0xf0ad('0x2a')]=function(_0x1b6880,_0x1ac25c){var _0x267b7a={},_0x1bee71={},_0x2386e8={'count':0x0,'rows':[]};var _0x39c46c=_[_0xf0ad('0x2b')](db['DeskField'][_0xf0ad('0x2c')],function(_0x5f5115){return{'name':_0x5f5115[_0xf0ad('0x2d')],'type':_0x5f5115['type'][_0xf0ad('0x2e')]};});_0x1bee71[_0xf0ad('0x2f')]=_[_0xf0ad('0x2b')](_0x39c46c,_0xf0ad('0x28'));_0x1bee71[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x1b6880[_0xf0ad('0x30')]);_0x1bee71[_0xf0ad('0x32')]=_['intersection'](_0x1bee71['model'],_0x1bee71[_0xf0ad('0x30')]);_0x267b7a[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1bee71[_0xf0ad('0x2f')],qs['fields'](_0x1b6880[_0xf0ad('0x30')]['fields']));_0x267b7a[_0xf0ad('0x33')]=_0x267b7a['attributes'][_0xf0ad('0x35')]?_0x267b7a['attributes']:_0x1bee71[_0xf0ad('0x2f')];if(!_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x36')](_0xf0ad('0x37'))){_0x267b7a[_0xf0ad('0x1e')]=qs[_0xf0ad('0x1e')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x1e')]);_0x267b7a['offset']=qs[_0xf0ad('0x1f')](_0x1b6880['query'][_0xf0ad('0x1f')]);}_0x267b7a['order']=qs[_0xf0ad('0x38')](_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x38')]);_0x267b7a[_0xf0ad('0x39')]=qs[_0xf0ad('0x32')](_['pick'](_0x1b6880[_0xf0ad('0x30')],_0x1bee71[_0xf0ad('0x32')]),_0x39c46c);if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]){_0x267b7a[_0xf0ad('0x39')]=_[_0xf0ad('0x3b')](_0x267b7a[_0xf0ad('0x39')],{'$or':_['map'](_0x39c46c,function(_0x2e0c7a){if(_0x2e0c7a[_0xf0ad('0x3c')]!==_0xf0ad('0x3d')){var _0x189f67={};_0x189f67[_0x2e0c7a[_0xf0ad('0x28')]]={'$like':'%'+_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x3a')]+'%'};return _0x189f67;}})});}_0x267b7a=_[_0xf0ad('0x3b')]({},_0x267b7a,_0x1b6880[_0xf0ad('0x3e')]);var _0x5dd631={'where':_0x267b7a[_0xf0ad('0x39')]};return db[_0xf0ad('0x3f')][_0xf0ad('0x40')](_0x5dd631)['then'](function(_0x510f54){_0x2386e8['count']=_0x510f54;if(_0x1b6880[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x267b7a[_0xf0ad('0x42')]=[{'all':!![]}];}return db[_0xf0ad('0x3f')][_0xf0ad('0x43')](_0x267b7a);})[_0xf0ad('0x23')](function(_0x39083d){_0x2386e8[_0xf0ad('0x44')]=_0x39083d;return _0x2386e8;})[_0xf0ad('0x23')](respondWithFilteredResult(_0x1ac25c,_0x267b7a))[_0xf0ad('0x45')](handleError(_0x1ac25c,null));};exports[_0xf0ad('0x46')]=function(_0x516a72,_0x4ea947){var _0x5cd1dc={'raw':!![],'where':{'id':_0x516a72[_0xf0ad('0x47')]['id']}},_0x1c0609={};_0x1c0609['model']=_[_0xf0ad('0x31')](db[_0xf0ad('0x3f')]['rawAttributes']);_0x1c0609[_0xf0ad('0x30')]=_[_0xf0ad('0x31')](_0x516a72[_0xf0ad('0x30')]);_0x1c0609[_0xf0ad('0x32')]=_['intersection'](_0x1c0609[_0xf0ad('0x2f')],_0x1c0609[_0xf0ad('0x30')]);_0x5cd1dc[_0xf0ad('0x33')]=_[_0xf0ad('0x34')](_0x1c0609[_0xf0ad('0x2f')],qs[_0xf0ad('0x48')](_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x48')]));_0x5cd1dc[_0xf0ad('0x33')]=_0x5cd1dc[_0xf0ad('0x33')][_0xf0ad('0x35')]?_0x5cd1dc['attributes']:_0x1c0609[_0xf0ad('0x2f')];if(_0x516a72[_0xf0ad('0x30')][_0xf0ad('0x41')]){_0x5cd1dc['include']=[{'all':!![]}];}_0x5cd1dc=_['merge']({},_0x5cd1dc,_0x516a72[_0xf0ad('0x3e')]);return db[_0xf0ad('0x3f')][_0xf0ad('0x49')](_0x5cd1dc)[_0xf0ad('0x23')](handleEntityNotFound(_0x4ea947,null))[_0xf0ad('0x23')](respondWithResult(_0x4ea947,null))[_0xf0ad('0x45')](handleError(_0x4ea947,null));};exports[_0xf0ad('0x4a')]=function(_0x561f2a,_0x1e35ce){return db['DeskField'][_0xf0ad('0x4a')](_0x561f2a[_0xf0ad('0x4b')],{})[_0xf0ad('0x23')](respondWithResult(_0x1e35ce,0xc9))[_0xf0ad('0x45')](handleError(_0x1e35ce,null));};exports[_0xf0ad('0x22')]=function(_0x5b18a7,_0x4e8ef5){if(_0x5b18a7[_0xf0ad('0x4b')]['id']){delete _0x5b18a7[_0xf0ad('0x4b')]['id'];}return db[_0xf0ad('0x3f')][_0xf0ad('0x49')]({'where':{'id':_0x5b18a7[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x4e8ef5,null))[_0xf0ad('0x23')](saveUpdates(_0x5b18a7['body'],null))[_0xf0ad('0x23')](respondWithResult(_0x4e8ef5,null))[_0xf0ad('0x45')](handleError(_0x4e8ef5,null));};exports[_0xf0ad('0x24')]=function(_0xda0e52,_0x2cb082){return db['DeskField'][_0xf0ad('0x49')]({'where':{'id':_0xda0e52[_0xf0ad('0x47')]['id']}})[_0xf0ad('0x23')](handleEntityNotFound(_0x2cb082,null))[_0xf0ad('0x23')](removeEntity(_0x2cb082,null))[_0xf0ad('0x45')](handleError(_0x2cb082,null));}; \ No newline at end of file +var _0xf0c2=['destroy','error','stack','name','index','DeskField','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then'];(function(_0x30f89e,_0x439e3d){var _0x17b7ef=function(_0x229a5d){while(--_0x229a5d){_0x30f89e['push'](_0x30f89e['shift']());}};_0x17b7ef(++_0x439e3d);}(_0xf0c2,0x6e));var _0x2f0c=function(_0x293023,_0x4ac622){_0x293023=_0x293023-0x0;var _0x49751d=_0xf0c2[_0x293023];return _0x49751d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f0c('0x0'));var zipdir=require(_0x2f0c('0x1'));var jsonpatch=require(_0x2f0c('0x2'));var rp=require(_0x2f0c('0x3'));var moment=require(_0x2f0c('0x4'));var BPromise=require(_0x2f0c('0x5'));var Mustache=require(_0x2f0c('0x6'));var util=require(_0x2f0c('0x7'));var path=require(_0x2f0c('0x8'));var sox=require(_0x2f0c('0x9'));var csv=require(_0x2f0c('0xa'));var ejs=require(_0x2f0c('0xb'));var fs=require('fs');var fs_extra=require(_0x2f0c('0xc'));var _=require('lodash');var squel=require(_0x2f0c('0xd'));var crypto=require(_0x2f0c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2f0c('0xf'));var toCsv=require(_0x2f0c('0xa'));var querystring=require(_0x2f0c('0x10'));var Papa=require(_0x2f0c('0x11'));var Redis=require(_0x2f0c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2f0c('0x13'));var as=require(_0x2f0c('0x14'));var hardwareService=require(_0x2f0c('0x15'));var logger=require(_0x2f0c('0x16'))(_0x2f0c('0x17'));var utils=require(_0x2f0c('0x18'));var config=require(_0x2f0c('0x19'));var licenseUtil=require(_0x2f0c('0x1a'));var db=require(_0x2f0c('0x1b'))['db'];function respondWithStatusCode(_0x19882e,_0x2431b3){_0x2431b3=_0x2431b3||0xcc;return function(_0xecea3b){if(_0xecea3b){return _0x19882e[_0x2f0c('0x1c')](_0x2431b3);}return _0x19882e['status'](_0x2431b3)['end']();};}function respondWithResult(_0x12237f,_0x1175d1){_0x1175d1=_0x1175d1||0xc8;return function(_0x147501){if(_0x147501){return _0x12237f[_0x2f0c('0x1d')](_0x1175d1)['json'](_0x147501);}};}function respondWithFilteredResult(_0x1e30b8,_0x3f4ca0){return function(_0xa3f8e2){if(_0xa3f8e2){var _0x31ab32=typeof _0x3f4ca0[_0x2f0c('0x1e')]==='undefined'&&typeof _0x3f4ca0[_0x2f0c('0x1f')]===_0x2f0c('0x20');var _0x5dad52=_0xa3f8e2[_0x2f0c('0x21')];var _0x32642e=_0x31ab32?0x0:_0x3f4ca0['offset'];var _0x54e503=_0x31ab32?_0xa3f8e2[_0x2f0c('0x21')]:_0x3f4ca0[_0x2f0c('0x1e')]+_0x3f4ca0[_0x2f0c('0x1f')];var _0x37d913;if(_0x54e503>=_0x5dad52){_0x54e503=_0x5dad52;_0x37d913=0xc8;}else{_0x37d913=0xce;}_0x1e30b8[_0x2f0c('0x1d')](_0x37d913);return _0x1e30b8[_0x2f0c('0x22')](_0x2f0c('0x23'),_0x32642e+'-'+_0x54e503+'/'+_0x5dad52)[_0x2f0c('0x24')](_0xa3f8e2);}return null;};}function patchUpdates(_0x4441de){return function(_0x220eda){try{jsonpatch[_0x2f0c('0x25')](_0x220eda,_0x4441de,!![]);}catch(_0x46763c){return BPromise[_0x2f0c('0x26')](_0x46763c);}return _0x220eda['save']();};}function saveUpdates(_0x3c8bec,_0x3783e1){return function(_0x4f6370){if(_0x4f6370){return _0x4f6370['update'](_0x3c8bec)[_0x2f0c('0x27')](function(_0x93c4c){return _0x93c4c;});}return null;};}function removeEntity(_0x2471b9,_0x2385e5){return function(_0x15b98b){if(_0x15b98b){return _0x15b98b[_0x2f0c('0x28')]()[_0x2f0c('0x27')](function(){_0x2471b9[_0x2f0c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9053,_0x5ddbfa){return function(_0x14df63){if(!_0x14df63){_0x2d9053[_0x2f0c('0x1c')](0x194);}return _0x14df63;};}function handleError(_0x337f8e,_0x3b8e02){_0x3b8e02=_0x3b8e02||0x1f4;return function(_0x55cd10){logger[_0x2f0c('0x29')](_0x55cd10[_0x2f0c('0x2a')]);if(_0x55cd10[_0x2f0c('0x2b')]){delete _0x55cd10[_0x2f0c('0x2b')];}_0x337f8e['status'](_0x3b8e02)['send'](_0x55cd10);};}exports[_0x2f0c('0x2c')]=function(_0x415c7a,_0x41a4f1){var _0x25c683={},_0x1c5638={},_0x2552e5={'count':0x0,'rows':[]};var _0x326e73=_['map'](db[_0x2f0c('0x2d')][_0x2f0c('0x2e')],function(_0x3a3885){return{'name':_0x3a3885['fieldName'],'type':_0x3a3885[_0x2f0c('0x2f')][_0x2f0c('0x30')]};});_0x1c5638[_0x2f0c('0x31')]=_[_0x2f0c('0x32')](_0x326e73,'name');_0x1c5638[_0x2f0c('0x33')]=_['keys'](_0x415c7a[_0x2f0c('0x33')]);_0x1c5638[_0x2f0c('0x34')]=_[_0x2f0c('0x35')](_0x1c5638[_0x2f0c('0x31')],_0x1c5638[_0x2f0c('0x33')]);_0x25c683[_0x2f0c('0x36')]=_['intersection'](_0x1c5638[_0x2f0c('0x31')],qs[_0x2f0c('0x37')](_0x415c7a[_0x2f0c('0x33')][_0x2f0c('0x37')]));_0x25c683['attributes']=_0x25c683[_0x2f0c('0x36')][_0x2f0c('0x38')]?_0x25c683['attributes']:_0x1c5638[_0x2f0c('0x31')];if(!_0x415c7a[_0x2f0c('0x33')][_0x2f0c('0x39')]('nolimit')){_0x25c683[_0x2f0c('0x1f')]=qs[_0x2f0c('0x1f')](_0x415c7a[_0x2f0c('0x33')]['limit']);_0x25c683[_0x2f0c('0x1e')]=qs['offset'](_0x415c7a['query']['offset']);}_0x25c683[_0x2f0c('0x3a')]=qs['sort'](_0x415c7a[_0x2f0c('0x33')]['sort']);_0x25c683[_0x2f0c('0x3b')]=qs[_0x2f0c('0x34')](_[_0x2f0c('0x3c')](_0x415c7a['query'],_0x1c5638[_0x2f0c('0x34')]),_0x326e73);if(_0x415c7a[_0x2f0c('0x33')][_0x2f0c('0x3d')]){_0x25c683[_0x2f0c('0x3b')]=_['merge'](_0x25c683[_0x2f0c('0x3b')],{'$or':_[_0x2f0c('0x32')](_0x326e73,function(_0x475270){if(_0x475270['type']!==_0x2f0c('0x3e')){var _0x59cd57={};_0x59cd57[_0x475270[_0x2f0c('0x2b')]]={'$like':'%'+_0x415c7a[_0x2f0c('0x33')][_0x2f0c('0x3d')]+'%'};return _0x59cd57;}})});}_0x25c683=_[_0x2f0c('0x3f')]({},_0x25c683,_0x415c7a[_0x2f0c('0x40')]);var _0x41010d={'where':_0x25c683['where']};return db[_0x2f0c('0x2d')]['count'](_0x41010d)[_0x2f0c('0x27')](function(_0x27fea4){_0x2552e5[_0x2f0c('0x21')]=_0x27fea4;if(_0x415c7a[_0x2f0c('0x33')]['includeAll']){_0x25c683[_0x2f0c('0x41')]=[{'all':!![]}];}return db[_0x2f0c('0x2d')][_0x2f0c('0x42')](_0x25c683);})[_0x2f0c('0x27')](function(_0x3231f4){_0x2552e5[_0x2f0c('0x43')]=_0x3231f4;return _0x2552e5;})['then'](respondWithFilteredResult(_0x41a4f1,_0x25c683))[_0x2f0c('0x44')](handleError(_0x41a4f1,null));};exports[_0x2f0c('0x45')]=function(_0x8ac487,_0x38de48){var _0xf31f21={'raw':!![],'where':{'id':_0x8ac487[_0x2f0c('0x46')]['id']}},_0x298820={};_0x298820[_0x2f0c('0x31')]=_[_0x2f0c('0x47')](db[_0x2f0c('0x2d')]['rawAttributes']);_0x298820[_0x2f0c('0x33')]=_['keys'](_0x8ac487[_0x2f0c('0x33')]);_0x298820[_0x2f0c('0x34')]=_[_0x2f0c('0x35')](_0x298820['model'],_0x298820['query']);_0xf31f21['attributes']=_[_0x2f0c('0x35')](_0x298820[_0x2f0c('0x31')],qs[_0x2f0c('0x37')](_0x8ac487[_0x2f0c('0x33')][_0x2f0c('0x37')]));_0xf31f21['attributes']=_0xf31f21[_0x2f0c('0x36')][_0x2f0c('0x38')]?_0xf31f21[_0x2f0c('0x36')]:_0x298820[_0x2f0c('0x31')];if(_0x8ac487[_0x2f0c('0x33')][_0x2f0c('0x48')]){_0xf31f21['include']=[{'all':!![]}];}_0xf31f21=_['merge']({},_0xf31f21,_0x8ac487[_0x2f0c('0x40')]);return db['DeskField'][_0x2f0c('0x49')](_0xf31f21)[_0x2f0c('0x27')](handleEntityNotFound(_0x38de48,null))[_0x2f0c('0x27')](respondWithResult(_0x38de48,null))[_0x2f0c('0x44')](handleError(_0x38de48,null));};exports['create']=function(_0x4178a7,_0x38c880){return db[_0x2f0c('0x2d')]['create'](_0x4178a7[_0x2f0c('0x4a')],{})[_0x2f0c('0x27')](respondWithResult(_0x38c880,0xc9))[_0x2f0c('0x44')](handleError(_0x38c880,null));};exports['update']=function(_0xf344db,_0x28b99b){if(_0xf344db[_0x2f0c('0x4a')]['id']){delete _0xf344db[_0x2f0c('0x4a')]['id'];}return db['DeskField'][_0x2f0c('0x49')]({'where':{'id':_0xf344db[_0x2f0c('0x46')]['id']}})[_0x2f0c('0x27')](handleEntityNotFound(_0x28b99b,null))['then'](saveUpdates(_0xf344db[_0x2f0c('0x4a')],null))[_0x2f0c('0x27')](respondWithResult(_0x28b99b,null))[_0x2f0c('0x44')](handleError(_0x28b99b,null));};exports[_0x2f0c('0x28')]=function(_0x23456a,_0x17f747){return db[_0x2f0c('0x2d')][_0x2f0c('0x49')]({'where':{'id':_0x23456a[_0x2f0c('0x46')]['id']}})[_0x2f0c('0x27')](handleEntityNotFound(_0x17f747,null))[_0x2f0c('0x27')](removeEntity(_0x17f747,null))['catch'](handleError(_0x17f747,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index b728319..26ccf01 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 _0xf540=['desk_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields'];(function(_0x19bef1,_0x53c40d){var _0x32de66=function(_0xa75bb9){while(--_0xa75bb9){_0x19bef1['push'](_0x19bef1['shift']());}};_0x32de66(++_0x53c40d);}(_0xf540,0x84));var _0x0f54=function(_0x218540,_0x55466d){_0x218540=_0x218540-0x0;var _0x41654c=_0xf540[_0x218540];return _0x41654c;};'use strict';var _=require(_0x0f54('0x0'));var util=require('util');var logger=require(_0x0f54('0x1'))('api');var moment=require(_0x0f54('0x2'));var BPromise=require(_0x0f54('0x3'));var rp=require(_0x0f54('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0f54('0x5'));var attributes=require(_0x0f54('0x6'));module[_0x0f54('0x7')]=function(_0x1336ea,_0xd62d90){return _0x1336ea[_0x0f54('0x8')](_0x0f54('0x9'),attributes,{'tableName':_0x0f54('0xa'),'paranoid':![],'indexes':[{'name':_0x0f54('0xb'),'fields':['idField',_0x0f54('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf77=['DeskField','desk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xcf77,0x7b));var _0x7cf7=function(_0x83f8de,_0x4b094b){_0x83f8de=_0x83f8de-0x0;var _0x12ef7c=_0xcf77[_0x83f8de];return _0x12ef7c;};'use strict';var _=require(_0x7cf7('0x0'));var util=require(_0x7cf7('0x1'));var logger=require(_0x7cf7('0x2'))(_0x7cf7('0x3'));var moment=require(_0x7cf7('0x4'));var BPromise=require(_0x7cf7('0x5'));var rp=require(_0x7cf7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cf7('0x7'));var config=require(_0x7cf7('0x8'));var attributes=require(_0x7cf7('0x9'));module[_0x7cf7('0xa')]=function(_0xa14c73,_0x5f2fad){return _0xa14c73[_0x7cf7('0xb')](_0x7cf7('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x7cf7('0xd'),'fields':[_0x7cf7('0xe'),'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 5215d6b..dd444bb 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 _0xab4a=['debug','stringify','error','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x48564d,_0x2c1c8c){var _0x2ad779=function(_0x4490dd){while(--_0x4490dd){_0x48564d['push'](_0x48564d['shift']());}};_0x2ad779(++_0x2c1c8c);}(_0xab4a,0x1e0));var _0xaab4=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0xab4a[_0x231b2e];return _0x3feb2a;};'use strict';var _=require('lodash');var util=require(_0xaab4('0x0'));var moment=require(_0xaab4('0x1'));var BPromise=require(_0xaab4('0x2'));var rs=require(_0xaab4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaab4('0x4'));var logger=require(_0xaab4('0x5'))(_0xaab4('0x6'));var config=require(_0xaab4('0x7'));var jayson=require(_0xaab4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42fe79,_0x36a4af,_0x26b5b1){return new BPromise(function(_0x29c965,_0xadd23){return client[_0xaab4('0x9')](_0x42fe79,_0x26b5b1)[_0xaab4('0xa')](function(_0x25c779){logger[_0xaab4('0xb')](_0xaab4('0xc'),_0x36a4af,_0xaab4('0xd'));logger[_0xaab4('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x36a4af,_0xaab4('0xd'),JSON[_0xaab4('0xf')](_0x25c779));if(_0x25c779['error']){if(_0x25c779[_0xaab4('0x10')]['code']===0x1f4){logger[_0xaab4('0x10')](_0xaab4('0xc'),_0x36a4af,_0x25c779['error'][_0xaab4('0x11')]);return _0xadd23(_0x25c779[_0xaab4('0x10')][_0xaab4('0x11')]);}logger[_0xaab4('0x10')]('DeskField,\x20%s,\x20%s',_0x36a4af,_0x25c779[_0xaab4('0x10')]['message']);return _0x29c965(_0x25c779[_0xaab4('0x10')]['message']);}else{logger['info'](_0xaab4('0xc'),_0x36a4af,'request\x20sent');_0x29c965(_0x25c779[_0xaab4('0x12')][_0xaab4('0x11')]);}})['catch'](function(_0xffe6ee){logger[_0xaab4('0x10')](_0xaab4('0xc'),_0x36a4af,_0xffe6ee);_0xadd23(_0xffe6ee);});});} \ No newline at end of file +var _0x1a67=['info','DeskField,\x20%s,\x20%s','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x928f2b,_0x2e6810){var _0x1cbddd=function(_0x1bf232){while(--_0x1bf232){_0x928f2b['push'](_0x928f2b['shift']());}};_0x1cbddd(++_0x2e6810);}(_0x1a67,0xb2));var _0x71a6=function(_0x5ce349,_0x56b81b){_0x5ce349=_0x5ce349-0x0;var _0x1d4ed2=_0x1a67[_0x5ce349];return _0x1d4ed2;};'use strict';var _=require(_0x71a6('0x0'));var util=require(_0x71a6('0x1'));var moment=require(_0x71a6('0x2'));var BPromise=require(_0x71a6('0x3'));var rs=require(_0x71a6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71a6('0x5'))['db'];var utils=require(_0x71a6('0x6'));var logger=require(_0x71a6('0x7'))('rpc');var config=require(_0x71a6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x71a6('0x9')][_0x71a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a7361,_0x5b4ea5,_0x5324dd){return new BPromise(function(_0x5b31d9,_0x40a4bc){return client[_0x71a6('0xb')](_0x4a7361,_0x5324dd)['then'](function(_0x2e4419){logger[_0x71a6('0xc')](_0x71a6('0xd'),_0x5b4ea5,'request\x20sent');logger['debug'](_0x71a6('0xe'),_0x5b4ea5,_0x71a6('0xf'),JSON['stringify'](_0x2e4419));if(_0x2e4419[_0x71a6('0x10')]){if(_0x2e4419[_0x71a6('0x10')]['code']===0x1f4){logger['error'](_0x71a6('0xd'),_0x5b4ea5,_0x2e4419[_0x71a6('0x10')]['message']);return _0x40a4bc(_0x2e4419[_0x71a6('0x10')][_0x71a6('0x11')]);}logger[_0x71a6('0x10')](_0x71a6('0xd'),_0x5b4ea5,_0x2e4419[_0x71a6('0x10')][_0x71a6('0x11')]);return _0x5b31d9(_0x2e4419[_0x71a6('0x10')][_0x71a6('0x11')]);}else{logger[_0x71a6('0xc')](_0x71a6('0xd'),_0x5b4ea5,'request\x20sent');_0x5b31d9(_0x2e4419[_0x71a6('0x12')]['message']);}})['catch'](function(_0x5ca671){logger[_0x71a6('0x10')](_0x71a6('0xd'),_0x5b4ea5,_0x5ca671);_0x40a4bc(_0x5ca671);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index e4e0ba4..e642d4e 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 _0x1c4f=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show'];(function(_0x20deba,_0x41295e){var _0x1f79f6=function(_0x4dcb27){while(--_0x4dcb27){_0x20deba['push'](_0x20deba['shift']());}};_0x1f79f6(++_0x41295e);}(_0x1c4f,0x89));var _0xf1c4=function(_0xb5f37a,_0x1c0cf9){_0xb5f37a=_0xb5f37a-0x0;var _0x325beb=_0x1c4f[_0xb5f37a];return _0x325beb;};'use strict';var multer=require('multer');var util=require(_0xf1c4('0x0'));var path=require(_0xf1c4('0x1'));var timeout=require(_0xf1c4('0x2'));var express=require('express');var router=express[_0xf1c4('0x3')]();var fs_extra=require(_0xf1c4('0x4'));var auth=require(_0xf1c4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf1c4('0x6'));var controller=require(_0xf1c4('0x7'));router[_0xf1c4('0x8')]('/',auth[_0xf1c4('0x9')](),controller[_0xf1c4('0xa')]);router[_0xf1c4('0x8')](_0xf1c4('0xb'),auth['isAuthenticated'](),controller[_0xf1c4('0xc')]);router['get'](_0xf1c4('0xd'),auth['isAuthenticated'](),controller[_0xf1c4('0xe')]);router[_0xf1c4('0x8')](_0xf1c4('0xf'),auth['isAuthenticated'](),controller[_0xf1c4('0x10')]);router[_0xf1c4('0x11')]('/',auth[_0xf1c4('0x9')](),controller[_0xf1c4('0x12')]);router[_0xf1c4('0x11')](_0xf1c4('0xd'),auth[_0xf1c4('0x9')](),controller[_0xf1c4('0x13')]);router[_0xf1c4('0x14')](_0xf1c4('0xb'),auth[_0xf1c4('0x9')](),controller[_0xf1c4('0x15')]);router[_0xf1c4('0x16')](_0xf1c4('0xb'),auth[_0xf1c4('0x9')](),controller[_0xf1c4('0x17')]);module[_0xf1c4('0x18')]=router; \ No newline at end of file +var _0x1aa1=['addConfiguration','/:id','update','exports','multer','util','path','express','fs-extra','../../config/environment','./intDynamics365Account.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','create'];(function(_0x2d7e07,_0x407113){var _0x220695=function(_0x7ba115){while(--_0x7ba115){_0x2d7e07['push'](_0x2d7e07['shift']());}};_0x220695(++_0x407113);}(_0x1aa1,0x121));var _0x11aa=function(_0x25f4f6,_0x45cb8d){_0x25f4f6=_0x25f4f6-0x0;var _0x5f19c9=_0x1aa1[_0x25f4f6];return _0x5f19c9;};'use strict';var multer=require(_0x11aa('0x0'));var util=require(_0x11aa('0x1'));var path=require(_0x11aa('0x2'));var timeout=require('connect-timeout');var express=require(_0x11aa('0x3'));var router=express['Router']();var fs_extra=require(_0x11aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x11aa('0x5'));var controller=require(_0x11aa('0x6'));router[_0x11aa('0x7')]('/',auth['isAuthenticated'](),controller[_0x11aa('0x8')]);router['get']('/:id',auth[_0x11aa('0x9')](),controller['show']);router['get'](_0x11aa('0xa'),auth[_0x11aa('0x9')](),controller[_0x11aa('0xb')]);router[_0x11aa('0x7')](_0x11aa('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x11aa('0xd')]('/',auth['isAuthenticated'](),controller[_0x11aa('0xe')]);router[_0x11aa('0xd')]('/:id/configurations',auth[_0x11aa('0x9')](),controller[_0x11aa('0xf')]);router['put'](_0x11aa('0x10'),auth[_0x11aa('0x9')](),controller[_0x11aa('0x11')]);router['delete'](_0x11aa('0x10'),auth[_0x11aa('0x9')](),controller['destroy']);module[_0x11aa('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 7e3ec12..74e38dd 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 _0x871e=['exports','STRING','sequelize'];(function(_0x4b67a3,_0x328d94){var _0x4e08b1=function(_0x5873eb){while(--_0x5873eb){_0x4b67a3['push'](_0x4b67a3['shift']());}};_0x4e08b1(++_0x328d94);}(_0x871e,0x185));var _0xe871=function(_0x312e96,_0x2ca8af){_0x312e96=_0x312e96-0x0;var _0x55a2b7=_0x871e[_0x312e96];return _0x55a2b7;};'use strict';var Sequelize=require(_0xe871('0x0'));module[_0xe871('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe871('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe871('0x2')]},'clientSecret':{'type':Sequelize[_0xe871('0x2')]},'serverUrl':{'type':Sequelize[_0xe871('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe871('0x2')]}}; \ No newline at end of file +var _0x0ea7=['STRING','sequelize','exports'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x0ea7,0x8b));var _0x70ea=function(_0x181de7,_0x47bb0b){_0x181de7=_0x181de7-0x0;var _0x256612=_0x0ea7[_0x181de7];return _0x256612;};'use strict';var Sequelize=require(_0x70ea('0x0'));module[_0x70ea('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x70ea('0x2')]},'password':{'type':Sequelize[_0x70ea('0x2')]},'remoteUri':{'type':Sequelize[_0x70ea('0x2')]},'tenantId':{'type':Sequelize[_0x70ea('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x70ea('0x2')]},'serverUrl':{'type':Sequelize[_0x70ea('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x70ea('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index e495ecf..13c9d69 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 _0x292e=['bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','stack','name','index','map','Dynamics365Account','fieldName','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','rawAttributes','intersection','options','find','create','body','catch','destroy','getConfigurations','Dynamics365Configuration','addConfiguration','Subjects','getSubjects','channel','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','importsequencenumber','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','findOne','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','error','send','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','UserLocalizedLabel','false',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x292e,0xcb));var _0xe292=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x292e[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0xe292('0x0'));var rimraf=require(_0xe292('0x1'));var zipdir=require(_0xe292('0x2'));var jsonpatch=require(_0xe292('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe292('0x4'));var Mustache=require(_0xe292('0x5'));var util=require(_0xe292('0x6'));var path=require(_0xe292('0x7'));var sox=require('sox');var csv=require(_0xe292('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe292('0x9'));var _=require(_0xe292('0xa'));var squel=require(_0xe292('0xb'));var crypto=require(_0xe292('0xc'));var jsforce=require(_0xe292('0xd'));var deskjs=require(_0xe292('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe292('0xf'));var Redis=require(_0xe292('0x10'));var authService=require(_0xe292('0x11'));var qs=require(_0xe292('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe292('0x13'));var logger=require(_0xe292('0x14'))('api');var utils=require(_0xe292('0x15'));var config=require(_0xe292('0x16'));var licenseUtil=require(_0xe292('0x17'));var db=require(_0xe292('0x18'))['db'];var integrations=require(_0xe292('0x19'));function respondWithStatusCode(_0x3c73ea,_0x52ae8b){_0x52ae8b=_0x52ae8b||0xcc;return function(_0x278967){if(_0x278967){return _0x3c73ea[_0xe292('0x1a')](_0x52ae8b);}return _0x3c73ea[_0xe292('0x1b')](_0x52ae8b)[_0xe292('0x1c')]();};}function respondWithResult(_0x1df3da,_0x2512fd){_0x2512fd=_0x2512fd||0xc8;return function(_0x3a2a83){if(_0x3a2a83){return _0x1df3da['status'](_0x2512fd)[_0xe292('0x1d')](_0x3a2a83);}};}function respondWithFilteredResult(_0x1de9ec,_0x51fa78){return function(_0x582549){if(_0x582549){var _0x46593f=typeof _0x51fa78[_0xe292('0x1e')]===_0xe292('0x1f')&&typeof _0x51fa78[_0xe292('0x20')]==='undefined';var _0x1a6e9e=_0x582549['count'];var _0x1ba5bb=_0x46593f?0x0:_0x51fa78[_0xe292('0x1e')];var _0x57b0f7=_0x46593f?_0x582549[_0xe292('0x21')]:_0x51fa78[_0xe292('0x1e')]+_0x51fa78[_0xe292('0x20')];var _0x4c68c9;if(_0x57b0f7>=_0x1a6e9e){_0x57b0f7=_0x1a6e9e;_0x4c68c9=0xc8;}else{_0x4c68c9=0xce;}_0x1de9ec[_0xe292('0x1b')](_0x4c68c9);return _0x1de9ec[_0xe292('0x22')]('Content-Range',_0x1ba5bb+'-'+_0x57b0f7+'/'+_0x1a6e9e)[_0xe292('0x1d')](_0x582549);}return null;};}function patchUpdates(_0x6298f5){return function(_0x3c8d7f){try{jsonpatch[_0xe292('0x23')](_0x3c8d7f,_0x6298f5,!![]);}catch(_0x1052a7){return BPromise[_0xe292('0x24')](_0x1052a7);}return _0x3c8d7f['save']();};}function saveUpdates(_0x1589eb,_0x47813d){return function(_0x16d60c){if(_0x16d60c){return _0x16d60c[_0xe292('0x25')](_0x1589eb)[_0xe292('0x26')](function(_0x3677c4){return _0x3677c4;});}return null;};}function removeEntity(_0x83d82e,_0x13ae73){return function(_0x8370db){if(_0x8370db){return _0x8370db['destroy']()[_0xe292('0x26')](function(){_0x83d82e[_0xe292('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x488c76,_0x145044){return function(_0x22af74){if(!_0x22af74){_0x488c76[_0xe292('0x1a')](0x194);}return _0x22af74;};}function handleError(_0x24cfe5,_0x3c8b85){_0x3c8b85=_0x3c8b85||0x1f4;return function(_0x25de38){logger['error'](_0x25de38[_0xe292('0x27')]);if(_0x25de38[_0xe292('0x28')]){delete _0x25de38[_0xe292('0x28')];}_0x24cfe5[_0xe292('0x1b')](_0x3c8b85)['send'](_0x25de38);};}exports[_0xe292('0x29')]=function(_0x56d1bb,_0x358ed5){var _0xcdf2d={},_0x35f8c8={},_0x458ecf={'count':0x0,'rows':[]};var _0xf6362a=_[_0xe292('0x2a')](db[_0xe292('0x2b')]['rawAttributes'],function(_0x42d441){return{'name':_0x42d441[_0xe292('0x2c')],'type':_0x42d441[_0xe292('0x2d')][_0xe292('0x2e')]};});_0x35f8c8['model']=_[_0xe292('0x2a')](_0xf6362a,_0xe292('0x28'));_0x35f8c8[_0xe292('0x2f')]=_['keys'](_0x56d1bb[_0xe292('0x2f')]);_0x35f8c8[_0xe292('0x30')]=_['intersection'](_0x35f8c8[_0xe292('0x31')],_0x35f8c8[_0xe292('0x2f')]);_0xcdf2d['attributes']=_['intersection'](_0x35f8c8[_0xe292('0x31')],qs[_0xe292('0x32')](_0x56d1bb['query']['fields']));_0xcdf2d[_0xe292('0x33')]=_0xcdf2d[_0xe292('0x33')][_0xe292('0x34')]?_0xcdf2d[_0xe292('0x33')]:_0x35f8c8[_0xe292('0x31')];if(!_0x56d1bb['query'][_0xe292('0x35')](_0xe292('0x36'))){_0xcdf2d['limit']=qs[_0xe292('0x20')](_0x56d1bb['query'][_0xe292('0x20')]);_0xcdf2d[_0xe292('0x1e')]=qs[_0xe292('0x1e')](_0x56d1bb['query'][_0xe292('0x1e')]);}_0xcdf2d['order']=qs[_0xe292('0x37')](_0x56d1bb[_0xe292('0x2f')][_0xe292('0x37')]);_0xcdf2d[_0xe292('0x38')]=qs[_0xe292('0x30')](_[_0xe292('0x39')](_0x56d1bb[_0xe292('0x2f')],_0x35f8c8[_0xe292('0x30')]),_0xf6362a);if(_0x56d1bb[_0xe292('0x2f')][_0xe292('0x3a')]){_0xcdf2d[_0xe292('0x38')]=_[_0xe292('0x3b')](_0xcdf2d[_0xe292('0x38')],{'$or':_[_0xe292('0x2a')](_0xf6362a,function(_0x37285a){if(_0x37285a[_0xe292('0x2d')]!==_0xe292('0x3c')){var _0x596cc9={};_0x596cc9[_0x37285a[_0xe292('0x28')]]={'$like':'%'+_0x56d1bb[_0xe292('0x2f')][_0xe292('0x3a')]+'%'};return _0x596cc9;}})});}_0xcdf2d=_['merge']({},_0xcdf2d,_0x56d1bb['options']);var _0x22d372={'where':_0xcdf2d[_0xe292('0x38')]};return db[_0xe292('0x2b')]['count'](_0x22d372)['then'](function(_0x335efe){_0x458ecf[_0xe292('0x21')]=_0x335efe;if(_0x56d1bb[_0xe292('0x2f')][_0xe292('0x3d')]){_0xcdf2d[_0xe292('0x3e')]=[{'all':!![]}];}return db[_0xe292('0x2b')]['findAll'](_0xcdf2d);})[_0xe292('0x26')](function(_0x56a909){_0x458ecf[_0xe292('0x3f')]=_0x56a909;return _0x458ecf;})[_0xe292('0x26')](respondWithFilteredResult(_0x358ed5,_0xcdf2d))['catch'](handleError(_0x358ed5,null));};exports[_0xe292('0x40')]=function(_0x554346,_0x4a57ce){var _0xe39fb4={'raw':![],'where':{'id':_0x554346[_0xe292('0x41')]['id']}},_0x3e3606={};_0x3e3606[_0xe292('0x31')]=_[_0xe292('0x42')](db[_0xe292('0x2b')][_0xe292('0x43')]);_0x3e3606[_0xe292('0x2f')]=_['keys'](_0x554346['query']);_0x3e3606[_0xe292('0x30')]=_[_0xe292('0x44')](_0x3e3606[_0xe292('0x31')],_0x3e3606[_0xe292('0x2f')]);_0xe39fb4[_0xe292('0x33')]=_[_0xe292('0x44')](_0x3e3606[_0xe292('0x31')],qs['fields'](_0x554346[_0xe292('0x2f')][_0xe292('0x32')]));_0xe39fb4['attributes']=_0xe39fb4['attributes'][_0xe292('0x34')]?_0xe39fb4[_0xe292('0x33')]:_0x3e3606[_0xe292('0x31')];if(_0x554346['query'][_0xe292('0x3d')]){_0xe39fb4[_0xe292('0x3e')]=[{'all':!![]}];}_0xe39fb4=_[_0xe292('0x3b')]({},_0xe39fb4,_0x554346[_0xe292('0x45')]);return db[_0xe292('0x2b')][_0xe292('0x46')](_0xe39fb4)[_0xe292('0x26')](handleEntityNotFound(_0x4a57ce,null))[_0xe292('0x26')](respondWithResult(_0x4a57ce,null))['catch'](handleError(_0x4a57ce,null));};exports[_0xe292('0x47')]=function(_0xc57ae7,_0x440018){return db[_0xe292('0x2b')][_0xe292('0x47')](_0xc57ae7[_0xe292('0x48')],{})[_0xe292('0x26')](respondWithResult(_0x440018,0xc9))['catch'](handleError(_0x440018,null));};exports[_0xe292('0x25')]=function(_0x59ee5e,_0x4ede4e){if(_0x59ee5e[_0xe292('0x48')]['id']){delete _0x59ee5e[_0xe292('0x48')]['id'];}return db['Dynamics365Account'][_0xe292('0x46')]({'where':{'id':_0x59ee5e[_0xe292('0x41')]['id']}})[_0xe292('0x26')](handleEntityNotFound(_0x4ede4e,null))[_0xe292('0x26')](saveUpdates(_0x59ee5e[_0xe292('0x48')],null))['then'](respondWithResult(_0x4ede4e,null))[_0xe292('0x49')](handleError(_0x4ede4e,null));};exports[_0xe292('0x4a')]=function(_0x5733a7,_0x5cee6c){return db[_0xe292('0x2b')][_0xe292('0x46')]({'where':{'id':_0x5733a7['params']['id']}})[_0xe292('0x26')](handleEntityNotFound(_0x5cee6c,null))[_0xe292('0x26')](removeEntity(_0x5cee6c,null))['catch'](handleError(_0x5cee6c,null));};exports[_0xe292('0x4b')]=function(_0x2997d2,_0x46c2bb,_0x39b840){var _0x4615c4={};var _0xc513dc={};var _0x20a287;var _0x3e236f;return db[_0xe292('0x2b')]['findOne']({'where':{'id':_0x2997d2[_0xe292('0x41')]['id']}})[_0xe292('0x26')](handleEntityNotFound(_0x46c2bb,null))['then'](function(_0x460b83){if(_0x460b83){_0x20a287=_0x460b83;_0xc513dc[_0xe292('0x31')]=_[_0xe292('0x42')](db[_0xe292('0x4c')]['rawAttributes']);_0xc513dc[_0xe292('0x2f')]=_[_0xe292('0x42')](_0x2997d2[_0xe292('0x2f')]);_0xc513dc[_0xe292('0x30')]=_[_0xe292('0x44')](_0xc513dc[_0xe292('0x31')],_0xc513dc['query']);_0x4615c4[_0xe292('0x33')]=_[_0xe292('0x44')](_0xc513dc['model'],qs[_0xe292('0x32')](_0x2997d2[_0xe292('0x2f')]['fields']));_0x4615c4[_0xe292('0x33')]=_0x4615c4[_0xe292('0x33')]['length']?_0x4615c4['attributes']:_0xc513dc[_0xe292('0x31')];_0x4615c4['order']=qs['sort'](_0x2997d2[_0xe292('0x2f')][_0xe292('0x37')]);_0x4615c4[_0xe292('0x38')]=qs[_0xe292('0x30')](_['pick'](_0x2997d2[_0xe292('0x2f')],_0xc513dc['filters']));if(_0x2997d2['query'][_0xe292('0x3a')]){_0x4615c4[_0xe292('0x38')]=_[_0xe292('0x3b')](_0x4615c4[_0xe292('0x38')],{'$or':_['map'](_0x4615c4['attributes'],function(_0x863e8f){var _0x1765b4={};_0x1765b4[_0x863e8f]={'$like':'%'+_0x2997d2['query'][_0xe292('0x3a')]+'%'};return _0x1765b4;})});}_0x4615c4=_[_0xe292('0x3b')]({},_0x4615c4,_0x2997d2[_0xe292('0x45')]);return _0x20a287[_0xe292('0x4b')](_0x4615c4);}})['then'](function(_0x57062c){if(_0x57062c){_0x3e236f=_0x57062c[_0xe292('0x34')];if(!_0x2997d2['query'][_0xe292('0x35')](_0xe292('0x36'))){_0x4615c4[_0xe292('0x20')]=qs[_0xe292('0x20')](_0x2997d2[_0xe292('0x2f')]['limit']);_0x4615c4[_0xe292('0x1e')]=qs[_0xe292('0x1e')](_0x2997d2[_0xe292('0x2f')]['offset']);}return _0x20a287[_0xe292('0x4b')](_0x4615c4);}})[_0xe292('0x26')](function(_0x3b3afe){if(_0x3b3afe){return _0x3b3afe?{'count':_0x3e236f,'rows':_0x3b3afe}:null;}})['then'](respondWithResult(_0x46c2bb,null))[_0xe292('0x49')](handleError(_0x46c2bb,null));};exports[_0xe292('0x4d')]=function(_0x2b3601,_0x158994,_0x2bbdcb){if(_0x2b3601[_0xe292('0x48')]['id']){delete _0x2b3601[_0xe292('0x48')]['id'];}return db[_0xe292('0x2b')]['findOne']({'where':{'id':_0x2b3601[_0xe292('0x41')]['id']}})[_0xe292('0x26')](handleEntityNotFound(_0x158994,null))[_0xe292('0x26')](function(_0x1eed93){if(_0x1eed93){_0x2b3601['body']['AccountId']=_0x1eed93['id'];_0x2b3601[_0xe292('0x48')][_0xe292('0x4e')]=integrations[_0xe292('0x4f')](_0x2b3601['body'][_0xe292('0x50')],_0x2b3601[_0xe292('0x48')][_0xe292('0x2d')]);_0x2b3601[_0xe292('0x48')]['Descriptions']=integrations['getDescriptions'](_0x2b3601['body'][_0xe292('0x50')],_0x2b3601['body']['type']);return db['Dynamics365Configuration']['create'](_0x2b3601[_0xe292('0x48')],{'include':[{'model':db['Dynamics365Field'],'as':_0xe292('0x4e')},{'model':db[_0xe292('0x51')],'as':_0xe292('0x52')}]});}return null;})[_0xe292('0x26')](respondWithResult(_0x158994,null))[_0xe292('0x49')](handleError(_0x158994,null));};exports[_0xe292('0x53')]=function(_0x2b52cb,_0x358e95,_0xd41cb0){var _0x48fb92=_0x2b52cb[_0xe292('0x2f')][_0xe292('0x54')];var _0x320339=_0x48fb92===_0xe292('0x55')?_0xe292('0x56'):_0xe292('0x57');var _0x186d18='';var _0xfd6f88='';var _0x2b72cf='';var _0x49918d='';var _0x5456fd='';var _0x19a220='';var _0x7bd0cd='';var _0x3fbc0e='';var _0xb935b0=[_0xe292('0x58'),'description',_0xe292('0x59'),_0xe292('0x5a'),_0xe292('0x5b'),_0xe292('0x5c'),_0xe292('0x5d'),_0xe292('0x5e'),'directioncode',_0xe292('0x5f')];var _0x53bb42=[_0xe292('0x60'),_0xe292('0x61'),'actualserviceunits',_0xe292('0x62'),_0xe292('0x63'),'contactidyominame','contractdetailidname',_0xe292('0x64'),_0xe292('0x65'),'createdbyexternalpartyyominame',_0xe292('0x66'),_0xe292('0x67'),_0xe292('0x68'),_0xe292('0x69'),_0xe292('0x6a'),_0xe292('0x6b'),'customeridtype',_0xe292('0x6c'),'emailaddress',_0xe292('0x6d'),_0xe292('0x6e'),_0xe292('0x6f'),_0xe292('0x70'),'exchangerate',_0xe292('0x71'),'followupby',_0xe292('0x72'),'influencescore','kbarticleidname',_0xe292('0x73'),'masteridname',_0xe292('0x74'),_0xe292('0x75'),_0xe292('0x76'),_0xe292('0x77'),_0xe292('0x78'),_0xe292('0x79'),'modifiedonbehalfbyyominame',_0xe292('0x7a'),_0xe292('0x7b'),_0xe292('0x7c'),'onholdtime',_0xe292('0x7d'),_0xe292('0x7e'),_0xe292('0x7f'),_0xe292('0x80'),_0xe292('0x81'),_0xe292('0x82'),'primarycontactidyominame',_0xe292('0x83'),'productidname',_0xe292('0x84'),'resolveby',_0xe292('0x85'),_0xe292('0x86'),_0xe292('0x87'),'responsiblecontactidyominame',_0xe292('0x88'),'slainvokedidname',_0xe292('0x89'),_0xe292('0x8a'),'statecode','statuscode',_0xe292('0x8b'),_0xe292('0x8c'),_0xe292('0x8d'),_0xe292('0x8e'),_0xe292('0x8f'),'utcconversiontimezonecode',_0xe292('0x90')];var _0x455d76=_0xb935b0[_0xe292('0x91')](_0x53bb42);return db[_0xe292('0x2b')][_0xe292('0x92')]({'where':{'id':_0x2b52cb['params']['id']},'attributes':['id',_0xe292('0x93'),_0xe292('0x94'),_0xe292('0x95'),_0xe292('0x96'),_0xe292('0x97'),_0xe292('0x98')]})[_0xe292('0x26')](handleEntityNotFound(_0x358e95,null))[_0xe292('0x26')](function(_0x1e21b4){if(_0x1e21b4){_0x3fbc0e=_0x1e21b4[_0xe292('0x95')];var _0x4ed2b1=_0x3fbc0e[_0xe292('0x99')](-0x1);if(_0x4ed2b1==='/'){_0x3fbc0e=_0x3fbc0e[_0xe292('0x9a')](0x0,_0x3fbc0e['lastIndexOf'](_0x4ed2b1));}_0x7bd0cd=util[_0xe292('0x9b')](_0xe292('0x9c'),_0x3fbc0e);var _0x5dc252={'method':_0xe292('0x9d'),'uri':_0xe292('0x9e')+_0x1e21b4['tenantId']+_0xe292('0x9f'),'form':{'client_id':_0x1e21b4[_0xe292('0x97')],'resource':_0x3fbc0e,'username':_0x1e21b4[_0xe292('0x93')],'password':_0x1e21b4['password'],'grant_type':_0xe292('0x94'),'client_secret':_0x1e21b4[_0xe292('0x98')]},'json':!![]};return rp(_0x5dc252);}})[_0xe292('0x26')](function(_0x540526){_0x19a220=_0x540526['access_token'];var _0x244a22={'method':_0xe292('0xa0'),'uri':encodeURI(_0x7bd0cd+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x320339+'\x27'),'headers':{'Authorization':_0xe292('0xa1')+_0x19a220,'If-None-Match':null,'OData-Version':_0xe292('0xa2')},'json':!![]};return rp(_0x244a22);})[_0xe292('0x26')](function(_0xea27fc){var _0x458fb3=_0xea27fc[_0xe292('0xa3')][0x0];var _0x22c9de=_0x458fb3[_0xe292('0xa4')];var _0x3f95d4={'method':_0xe292('0xa0'),'uri':_0x7bd0cd+_0xe292('0xa5')+_0x22c9de+_0xe292('0xa6'),'headers':{'Authorization':_0xe292('0xa1')+_0x19a220,'If-None-Match':null,'OData-Version':_0xe292('0xa2')},'json':!![]};return rp(_0x3f95d4);})[_0xe292('0x26')](function(_0x4ff130){_0x186d18=_0x4ff130;_0xfd6f88=_0x186d18[_0xe292('0xa7')];_0xfd6f88=_[_0xe292('0xa8')](_0xfd6f88,function(_0xf92b55){return!_0x455d76[_0xe292('0xa9')](_0xf92b55['LogicalName']);});var _0x46507a=[];var _0x5ad7c9=[];_0xfd6f88[_0xe292('0xaa')](function(_0x2cc9){if(_0x2cc9['@odata.type']){var _0x2fd9ff=_0x2cc9[_0xe292('0xab')][_0xe292('0x9a')](_0x2cc9[_0xe292('0xab')]['lastIndexOf']('.')+0x1);if(_0x2fd9ff===_0xe292('0xac')){_0x46507a[_0xe292('0xad')](getSelectList(_0x7bd0cd,_0x48fb92,_0x5ad7c9,_0x186d18[_0xe292('0xa4')],_0x2cc9['MetadataId'],_0x19a220));}}});return Promise[_0xe292('0xae')](_0x46507a);})[_0xe292('0x26')](function(_0x205912){_0x2b72cf=_0x205912[0x0];var _0x28663a=[];var _0x531e04=[];_0xfd6f88[_0xe292('0xaa')](function(_0x2634c7){if(!_[_0xe292('0xaf')](_0x2634c7[_0xe292('0xab')])){var _0x5962ae=_0x2634c7[_0xe292('0xab')][_0xe292('0x9a')](_0x2634c7['@odata.type'][_0xe292('0xb0')]('.')+0x1);if(_0x5962ae===_0xe292('0xb1')){_0x28663a['push'](getBooleanList(_0x7bd0cd,_0x48fb92,_0x531e04,_0x186d18['MetadataId'],_0x2634c7['MetadataId'],_0x19a220));}}});return Promise[_0xe292('0xae')](_0x28663a);})[_0xe292('0x26')](function(_0xe1b3dc){_0x49918d=_0xe1b3dc[0x0];var _0x313812=[];var _0x1727f0=[];_0xfd6f88[_0xe292('0xaa')](function(_0x4ede3a){if(_0x4ede3a[_0xe292('0xab')]){var _0x88e206=_0x4ede3a[_0xe292('0xab')][_0xe292('0x9a')](_0x4ede3a[_0xe292('0xab')][_0xe292('0xb0')]('.')+0x1);if(_0x88e206===_0xe292('0xb2')||_0x88e206===_0xe292('0xb3')||_0x88e206===_0xe292('0xb4')||_0x88e206===_0xe292('0xb5')||_0x88e206===_0xe292('0xb6')||_0x88e206===_0xe292('0xb7')||_0x88e206===_0xe292('0xb8')||_0x88e206===_0xe292('0xb9')||_0x88e206===_0xe292('0xba')||_0x88e206==='DecimalAttributeMetadata'){_0x313812[_0xe292('0xad')](getInputList(_0x7bd0cd,_0x48fb92,_0x88e206,_0x1727f0,_0x186d18['MetadataId'],_0x4ede3a[_0xe292('0xa4')],_0x19a220));}}});return Promise[_0xe292('0xae')](_0x313812);})[_0xe292('0x26')](function(_0x4aacf1){_0x5456fd=_0x4aacf1[0x0];var _0x1b55d8=_0x2b72cf[_0xe292('0x91')](_0x49918d)[_0xe292('0x91')](_0x5456fd);var _0x35d00b={'count':_0x1b55d8['length'],'rows':_0x1b55d8};return _0x35d00b;})['then'](respondWithResult(_0x358e95,null))['catch'](function(_0x4aff3a){var _0x1072bc=_0x2b52cb[_0xe292('0x2f')][_0xe292('0xbb')]?0x1f4:_0x4aff3a['statusCode']||0x1f4;logger[_0xe292('0xbc')](_0x4aff3a[_0xe292('0x27')]);delete _0x4aff3a[_0xe292('0x28')];if(_0x1072bc===0x191){_0x1072bc=0x190;}_0x358e95[_0xe292('0x1b')](_0x1072bc)[_0xe292('0xbd')](_0x2b52cb[_0xe292('0x2f')][_0xe292('0xbb')]?{'message':_0xe292('0xbe'),'statusCode':_0x4aff3a[_0xe292('0xbf')]}:_0x4aff3a);});};function getSelectList(_0x40a3c7,_0x43a9c5,_0x44254a,_0x19fd36,_0x5f253c,_0x4af120){var _0x21c50f={'method':_0xe292('0xa0'),'uri':_0x40a3c7+'EntityDefinitions('+_0x19fd36+_0xe292('0xc0')+_0x5f253c+_0xe292('0xc1')+_0xe292('0xc2'),'headers':{'Authorization':_0xe292('0xa1')+_0x4af120,'If-None-Match':null,'OData-Version':_0xe292('0xa2')},'json':!![]};return rp(_0x21c50f)[_0xe292('0x26')](function(_0x25107d){var _0x10db0f=[];var _0x56d128=_0x25107d[_0xe292('0xc3')][_0xe292('0xc4')];_0x56d128[_0xe292('0xaa')](function(_0x289022){_0x10db0f[_0xe292('0xad')]({'name':_0x289022[_0xe292('0xc5')]['UserLocalizedLabel']['Label'],'value':String(_0x289022[_0xe292('0xc6')])});});var _0x2dfaf0={'id':_0x43a9c5+'_'+_0x25107d[_0xe292('0xc7')],'name':_0x25107d[_0xe292('0xc8')]['UserLocalizedLabel'][_0xe292('0xc5')],'custom':![],'options':_0x10db0f};_0x44254a[_0xe292('0xad')](_0x2dfaf0);return _0x44254a;});}function getBooleanList(_0x58c040,_0x9f882f,_0xc68445,_0x3f7452,_0x4bf449,_0x3c4032){var _0x401e5d={'method':_0xe292('0xa0'),'uri':_0x58c040+_0xe292('0xa5')+_0x3f7452+')/Attributes('+_0x4bf449+_0xe292('0xc9'),'headers':{'Authorization':_0xe292('0xa1')+_0x3c4032,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x401e5d)[_0xe292('0x26')](function(_0x146d04){var _0x5f1fc8=[];_0x5f1fc8[_0xe292('0xad')]({'name':_0x146d04['OptionSet'][_0xe292('0xca')][_0xe292('0xc5')]['UserLocalizedLabel']['Label'],'value':'true'},{'name':_0x146d04[_0xe292('0xc3')][_0xe292('0xcb')][_0xe292('0xc5')][_0xe292('0xcc')]['Label'],'value':_0xe292('0xcd')});var _0x1681d9={'id':_0x9f882f+'_'+_0x146d04[_0xe292('0xc7')],'name':_0x146d04[_0xe292('0xc8')][_0xe292('0xcc')][_0xe292('0xc5')],'custom':![],'options':_0x5f1fc8};_0xc68445[_0xe292('0xad')](_0x1681d9);return _0xc68445;});}function getInputList(_0x14f25e,_0x380abb,_0x327c65,_0xe4b682,_0x3aed2c,_0x29ec23,_0x5d3f52){var _0x4b7c8a={'method':_0xe292('0xa0'),'uri':_0x14f25e+_0xe292('0xa5')+_0x3aed2c+_0xe292('0xc0')+_0x29ec23+_0xe292('0xce')+_0x327c65+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xe292('0xa1')+_0x5d3f52,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4b7c8a)['then'](function(_0x742176){var _0x47e417={'id':_0x380abb+'_'+_0x742176[_0xe292('0xc7')],'name':_0x742176['DisplayName'][_0xe292('0xcc')]?_0x742176[_0xe292('0xc8')][_0xe292('0xcc')][_0xe292('0xc5')]:_0x742176['LogicalName'],'custom':![],'options':[]};_0xe4b682[_0xe292('0xad')](_0x47e417);return _0xe4b682;});} \ No newline at end of file +var _0x00b3=['VIRTUAL','filter','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','merge','nolimit','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','clientId','clientSecret','remoteUri','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Attributes(',')/Microsoft.Dynamics.CRM.','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','Dynamics365Account','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','type'];(function(_0x598fd5,_0x15e464){var _0x1d6da1=function(_0x740706){while(--_0x740706){_0x598fd5['push'](_0x598fd5['shift']());}};_0x1d6da1(++_0x15e464);}(_0x00b3,0x97));var _0x300b=function(_0x1d1f59,_0xe26f12){_0x1d1f59=_0x1d1f59-0x0;var _0x3fbaf4=_0x00b3[_0x1d1f59];return _0x3fbaf4;};'use strict';var emlformat=require(_0x300b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x300b('0x1'));var rp=require(_0x300b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x300b('0x3'));var util=require(_0x300b('0x4'));var path=require(_0x300b('0x5'));var sox=require('sox');var csv=require(_0x300b('0x6'));var ejs=require(_0x300b('0x7'));var fs=require('fs');var fs_extra=require(_0x300b('0x8'));var _=require(_0x300b('0x9'));var squel=require(_0x300b('0xa'));var crypto=require(_0x300b('0xb'));var jsforce=require(_0x300b('0xc'));var deskjs=require(_0x300b('0xd'));var toCsv=require(_0x300b('0x6'));var querystring=require(_0x300b('0xe'));var Papa=require(_0x300b('0xf'));var Redis=require(_0x300b('0x10'));var authService=require(_0x300b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x300b('0x12'));var hardwareService=require(_0x300b('0x13'));var logger=require(_0x300b('0x14'))('api');var utils=require(_0x300b('0x15'));var config=require(_0x300b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x300b('0x17'));function respondWithStatusCode(_0x51b8fc,_0x12b3b0){_0x12b3b0=_0x12b3b0||0xcc;return function(_0x14d823){if(_0x14d823){return _0x51b8fc[_0x300b('0x18')](_0x12b3b0);}return _0x51b8fc[_0x300b('0x19')](_0x12b3b0)[_0x300b('0x1a')]();};}function respondWithResult(_0x1edb37,_0x5c507b){_0x5c507b=_0x5c507b||0xc8;return function(_0x59dd20){if(_0x59dd20){return _0x1edb37[_0x300b('0x19')](_0x5c507b)[_0x300b('0x1b')](_0x59dd20);}};}function respondWithFilteredResult(_0x14cba0,_0x19ac43){return function(_0x349a29){if(_0x349a29){var _0x34dd89=typeof _0x19ac43[_0x300b('0x1c')]===_0x300b('0x1d')&&typeof _0x19ac43['limit']===_0x300b('0x1d');var _0x28c866=_0x349a29['count'];var _0x34edc1=_0x34dd89?0x0:_0x19ac43[_0x300b('0x1c')];var _0x3c180d=_0x34dd89?_0x349a29[_0x300b('0x1e')]:_0x19ac43['offset']+_0x19ac43[_0x300b('0x1f')];var _0x148572;if(_0x3c180d>=_0x28c866){_0x3c180d=_0x28c866;_0x148572=0xc8;}else{_0x148572=0xce;}_0x14cba0[_0x300b('0x19')](_0x148572);return _0x14cba0[_0x300b('0x20')]('Content-Range',_0x34edc1+'-'+_0x3c180d+'/'+_0x28c866)['json'](_0x349a29);}return null;};}function patchUpdates(_0x5d60c0){return function(_0x5e6874){try{jsonpatch[_0x300b('0x21')](_0x5e6874,_0x5d60c0,!![]);}catch(_0x2e786f){return BPromise[_0x300b('0x22')](_0x2e786f);}return _0x5e6874[_0x300b('0x23')]();};}function saveUpdates(_0x5e7937,_0x2724de){return function(_0x1b2d07){if(_0x1b2d07){return _0x1b2d07[_0x300b('0x24')](_0x5e7937)[_0x300b('0x25')](function(_0x3a87d7){return _0x3a87d7;});}return null;};}function removeEntity(_0x5e4093,_0x105982){return function(_0x25f6c1){if(_0x25f6c1){return _0x25f6c1[_0x300b('0x26')]()[_0x300b('0x25')](function(){_0x5e4093[_0x300b('0x19')](0xcc)[_0x300b('0x1a')]();});}};}function handleEntityNotFound(_0x21b8cf,_0xa913e8){return function(_0x3d0775){if(!_0x3d0775){_0x21b8cf['sendStatus'](0x194);}return _0x3d0775;};}function handleError(_0x5385e6,_0xaa84aa){_0xaa84aa=_0xaa84aa||0x1f4;return function(_0x499499){logger[_0x300b('0x27')](_0x499499[_0x300b('0x28')]);if(_0x499499[_0x300b('0x29')]){delete _0x499499[_0x300b('0x29')];}_0x5385e6['status'](_0xaa84aa)[_0x300b('0x2a')](_0x499499);};}exports[_0x300b('0x2b')]=function(_0x4fcf53,_0x9eb721){var _0x1cff38={},_0x9ba13a={},_0x150ebe={'count':0x0,'rows':[]};var _0x555a21=_['map'](db[_0x300b('0x2c')][_0x300b('0x2d')],function(_0x101fa2){return{'name':_0x101fa2['fieldName'],'type':_0x101fa2['type'][_0x300b('0x2e')]};});_0x9ba13a[_0x300b('0x2f')]=_[_0x300b('0x30')](_0x555a21,_0x300b('0x29'));_0x9ba13a[_0x300b('0x31')]=_[_0x300b('0x32')](_0x4fcf53['query']);_0x9ba13a[_0x300b('0x33')]=_[_0x300b('0x34')](_0x9ba13a[_0x300b('0x2f')],_0x9ba13a[_0x300b('0x31')]);_0x1cff38[_0x300b('0x35')]=_['intersection'](_0x9ba13a['model'],qs[_0x300b('0x36')](_0x4fcf53[_0x300b('0x31')]['fields']));_0x1cff38[_0x300b('0x35')]=_0x1cff38[_0x300b('0x35')]['length']?_0x1cff38[_0x300b('0x35')]:_0x9ba13a['model'];if(!_0x4fcf53[_0x300b('0x31')][_0x300b('0x37')]('nolimit')){_0x1cff38[_0x300b('0x1f')]=qs[_0x300b('0x1f')](_0x4fcf53[_0x300b('0x31')][_0x300b('0x1f')]);_0x1cff38[_0x300b('0x1c')]=qs[_0x300b('0x1c')](_0x4fcf53[_0x300b('0x31')][_0x300b('0x1c')]);}_0x1cff38[_0x300b('0x38')]=qs[_0x300b('0x39')](_0x4fcf53[_0x300b('0x31')][_0x300b('0x39')]);_0x1cff38['where']=qs[_0x300b('0x33')](_['pick'](_0x4fcf53['query'],_0x9ba13a[_0x300b('0x33')]),_0x555a21);if(_0x4fcf53[_0x300b('0x31')]['filter']){_0x1cff38[_0x300b('0x3a')]=_['merge'](_0x1cff38[_0x300b('0x3a')],{'$or':_[_0x300b('0x30')](_0x555a21,function(_0x598aa8){if(_0x598aa8[_0x300b('0x3b')]!==_0x300b('0x3c')){var _0x2e17a8={};_0x2e17a8[_0x598aa8[_0x300b('0x29')]]={'$like':'%'+_0x4fcf53[_0x300b('0x31')][_0x300b('0x3d')]+'%'};return _0x2e17a8;}})});}_0x1cff38=_['merge']({},_0x1cff38,_0x4fcf53[_0x300b('0x3e')]);var _0xf0d316={'where':_0x1cff38[_0x300b('0x3a')]};return db['Dynamics365Account']['count'](_0xf0d316)[_0x300b('0x25')](function(_0x9b9e0){_0x150ebe[_0x300b('0x1e')]=_0x9b9e0;if(_0x4fcf53['query'][_0x300b('0x3f')]){_0x1cff38['include']=[{'all':!![]}];}return db[_0x300b('0x2c')][_0x300b('0x40')](_0x1cff38);})['then'](function(_0x3ac962){_0x150ebe[_0x300b('0x41')]=_0x3ac962;return _0x150ebe;})['then'](respondWithFilteredResult(_0x9eb721,_0x1cff38))['catch'](handleError(_0x9eb721,null));};exports[_0x300b('0x42')]=function(_0x2037bb,_0x5b0c07){var _0x49fe13={'raw':![],'where':{'id':_0x2037bb[_0x300b('0x43')]['id']}},_0x50bd5a={};_0x50bd5a[_0x300b('0x2f')]=_[_0x300b('0x32')](db[_0x300b('0x2c')][_0x300b('0x2d')]);_0x50bd5a[_0x300b('0x31')]=_['keys'](_0x2037bb[_0x300b('0x31')]);_0x50bd5a[_0x300b('0x33')]=_[_0x300b('0x34')](_0x50bd5a[_0x300b('0x2f')],_0x50bd5a[_0x300b('0x31')]);_0x49fe13[_0x300b('0x35')]=_[_0x300b('0x34')](_0x50bd5a['model'],qs[_0x300b('0x36')](_0x2037bb[_0x300b('0x31')][_0x300b('0x36')]));_0x49fe13[_0x300b('0x35')]=_0x49fe13['attributes'][_0x300b('0x44')]?_0x49fe13[_0x300b('0x35')]:_0x50bd5a[_0x300b('0x2f')];if(_0x2037bb[_0x300b('0x31')]['includeAll']){_0x49fe13[_0x300b('0x45')]=[{'all':!![]}];}_0x49fe13=_['merge']({},_0x49fe13,_0x2037bb['options']);return db['Dynamics365Account'][_0x300b('0x46')](_0x49fe13)[_0x300b('0x25')](handleEntityNotFound(_0x5b0c07,null))['then'](respondWithResult(_0x5b0c07,null))[_0x300b('0x47')](handleError(_0x5b0c07,null));};exports[_0x300b('0x48')]=function(_0x531666,_0x588416){return db[_0x300b('0x2c')][_0x300b('0x48')](_0x531666[_0x300b('0x49')],{})[_0x300b('0x25')](respondWithResult(_0x588416,0xc9))['catch'](handleError(_0x588416,null));};exports['update']=function(_0x58a114,_0x4fde6f){if(_0x58a114[_0x300b('0x49')]['id']){delete _0x58a114[_0x300b('0x49')]['id'];}return db[_0x300b('0x2c')][_0x300b('0x46')]({'where':{'id':_0x58a114[_0x300b('0x43')]['id']}})[_0x300b('0x25')](handleEntityNotFound(_0x4fde6f,null))[_0x300b('0x25')](saveUpdates(_0x58a114[_0x300b('0x49')],null))['then'](respondWithResult(_0x4fde6f,null))[_0x300b('0x47')](handleError(_0x4fde6f,null));};exports[_0x300b('0x26')]=function(_0x5ec462,_0x1ba443){return db['Dynamics365Account']['find']({'where':{'id':_0x5ec462[_0x300b('0x43')]['id']}})[_0x300b('0x25')](handleEntityNotFound(_0x1ba443,null))['then'](removeEntity(_0x1ba443,null))[_0x300b('0x47')](handleError(_0x1ba443,null));};exports[_0x300b('0x4a')]=function(_0x1215a9,_0x4dc0fe,_0xdb8d13){var _0x9250b={};var _0x4f8536={};var _0x18f4ee;var _0x4cfad6;return db[_0x300b('0x2c')][_0x300b('0x4b')]({'where':{'id':_0x1215a9[_0x300b('0x43')]['id']}})[_0x300b('0x25')](handleEntityNotFound(_0x4dc0fe,null))['then'](function(_0x18f731){if(_0x18f731){_0x18f4ee=_0x18f731;_0x4f8536['model']=_['keys'](db[_0x300b('0x4c')][_0x300b('0x2d')]);_0x4f8536[_0x300b('0x31')]=_[_0x300b('0x32')](_0x1215a9['query']);_0x4f8536['filters']=_[_0x300b('0x34')](_0x4f8536['model'],_0x4f8536[_0x300b('0x31')]);_0x9250b[_0x300b('0x35')]=_[_0x300b('0x34')](_0x4f8536['model'],qs[_0x300b('0x36')](_0x1215a9[_0x300b('0x31')][_0x300b('0x36')]));_0x9250b['attributes']=_0x9250b[_0x300b('0x35')][_0x300b('0x44')]?_0x9250b[_0x300b('0x35')]:_0x4f8536[_0x300b('0x2f')];_0x9250b['order']=qs['sort'](_0x1215a9['query'][_0x300b('0x39')]);_0x9250b['where']=qs[_0x300b('0x33')](_['pick'](_0x1215a9[_0x300b('0x31')],_0x4f8536[_0x300b('0x33')]));if(_0x1215a9['query'][_0x300b('0x3d')]){_0x9250b[_0x300b('0x3a')]=_[_0x300b('0x4d')](_0x9250b[_0x300b('0x3a')],{'$or':_[_0x300b('0x30')](_0x9250b[_0x300b('0x35')],function(_0x24893e){var _0x5c1557={};_0x5c1557[_0x24893e]={'$like':'%'+_0x1215a9[_0x300b('0x31')][_0x300b('0x3d')]+'%'};return _0x5c1557;})});}_0x9250b=_[_0x300b('0x4d')]({},_0x9250b,_0x1215a9[_0x300b('0x3e')]);return _0x18f4ee['getConfigurations'](_0x9250b);}})[_0x300b('0x25')](function(_0x956846){if(_0x956846){_0x4cfad6=_0x956846[_0x300b('0x44')];if(!_0x1215a9[_0x300b('0x31')][_0x300b('0x37')](_0x300b('0x4e'))){_0x9250b[_0x300b('0x1f')]=qs[_0x300b('0x1f')](_0x1215a9[_0x300b('0x31')][_0x300b('0x1f')]);_0x9250b['offset']=qs[_0x300b('0x1c')](_0x1215a9[_0x300b('0x31')]['offset']);}return _0x18f4ee['getConfigurations'](_0x9250b);}})['then'](function(_0x3690f4){if(_0x3690f4){return _0x3690f4?{'count':_0x4cfad6,'rows':_0x3690f4}:null;}})[_0x300b('0x25')](respondWithResult(_0x4dc0fe,null))[_0x300b('0x47')](handleError(_0x4dc0fe,null));};exports['addConfiguration']=function(_0x96585f,_0x5c0fbd,_0xa55bc){if(_0x96585f['body']['id']){delete _0x96585f['body']['id'];}return db['Dynamics365Account'][_0x300b('0x4b')]({'where':{'id':_0x96585f[_0x300b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c0fbd,null))[_0x300b('0x25')](function(_0x544bc5){if(_0x544bc5){_0x96585f['body']['AccountId']=_0x544bc5['id'];_0x96585f['body'][_0x300b('0x4f')]=integrations[_0x300b('0x50')](_0x96585f[_0x300b('0x49')][_0x300b('0x51')],_0x96585f['body'][_0x300b('0x3b')]);_0x96585f[_0x300b('0x49')][_0x300b('0x52')]=integrations[_0x300b('0x53')](_0x96585f['body'][_0x300b('0x51')],_0x96585f['body']['type']);return db[_0x300b('0x4c')]['create'](_0x96585f[_0x300b('0x49')],{'include':[{'model':db[_0x300b('0x54')],'as':_0x300b('0x4f')},{'model':db['Dynamics365Field'],'as':_0x300b('0x52')}]});}return null;})[_0x300b('0x25')](respondWithResult(_0x5c0fbd,null))[_0x300b('0x47')](handleError(_0x5c0fbd,null));};exports[_0x300b('0x55')]=function(_0x49945d,_0x104a59,_0x1c252c){var _0x2b1cca=_0x49945d[_0x300b('0x31')][_0x300b('0x56')];var _0x1f5b86=_0x2b1cca===_0x300b('0x57')?_0x300b('0x58'):_0x300b('0x59');var _0x11d840='';var _0x48ce05='';var _0x38e06c='';var _0x26310f='';var _0x2caf45='';var _0x8ccca3='';var _0x53a9c4='';var _0x260680='';var _0x37e8fd=[_0x300b('0x5a'),_0x300b('0x5b'),_0x300b('0x5c'),_0x300b('0x5d'),_0x300b('0x5e'),_0x300b('0x5f'),_0x300b('0x60'),_0x300b('0x61'),_0x300b('0x62'),'phonecall_activity_parties'];var _0xb42fc9=[_0x300b('0x63'),'accountidyominame',_0x300b('0x64'),_0x300b('0x65'),_0x300b('0x66'),_0x300b('0x67'),_0x300b('0x68'),_0x300b('0x69'),_0x300b('0x6a'),_0x300b('0x6b'),_0x300b('0x6c'),'createdbyyominame',_0x300b('0x6d'),_0x300b('0x6e'),_0x300b('0x6f'),_0x300b('0x70'),_0x300b('0x71'),'customeridyominame',_0x300b('0x72'),_0x300b('0x73'),_0x300b('0x74'),'entityimage_url','escalatedon',_0x300b('0x75'),_0x300b('0x76'),'followupby',_0x300b('0x77'),_0x300b('0x78'),'kbarticleidname','lastonholdtime',_0x300b('0x79'),_0x300b('0x7a'),_0x300b('0x7b'),_0x300b('0x7c'),'modifiedbyyominame','modifiedon',_0x300b('0x7d'),_0x300b('0x7e'),_0x300b('0x7f'),_0x300b('0x80'),_0x300b('0x81'),'onholdtime',_0x300b('0x82'),_0x300b('0x83'),'owneridtype',_0x300b('0x84'),_0x300b('0x85'),_0x300b('0x86'),_0x300b('0x87'),_0x300b('0x88'),_0x300b('0x89'),_0x300b('0x8a'),_0x300b('0x8b'),_0x300b('0x8c'),_0x300b('0x8d'),_0x300b('0x8e'),_0x300b('0x8f'),_0x300b('0x90'),_0x300b('0x91'),_0x300b('0x92'),_0x300b('0x93'),'statecode',_0x300b('0x94'),_0x300b('0x95'),'ticketnumber','timezoneruleversionnumber',_0x300b('0x96'),_0x300b('0x97'),'utcconversiontimezonecode',_0x300b('0x98')];var _0x10e47f=_0x37e8fd[_0x300b('0x99')](_0xb42fc9);return db['Dynamics365Account'][_0x300b('0x4b')]({'where':{'id':_0x49945d[_0x300b('0x43')]['id']},'attributes':['id',_0x300b('0x9a'),_0x300b('0x9b'),'remoteUri','tenantId',_0x300b('0x9c'),_0x300b('0x9d')]})[_0x300b('0x25')](handleEntityNotFound(_0x104a59,null))[_0x300b('0x25')](function(_0x28d099){if(_0x28d099){_0x260680=_0x28d099[_0x300b('0x9e')];var _0x4e90bc=_0x260680[_0x300b('0x9f')](-0x1);if(_0x4e90bc==='/'){_0x260680=_0x260680['substring'](0x0,_0x260680[_0x300b('0xa0')](_0x4e90bc));}_0x53a9c4=util[_0x300b('0xa1')](_0x300b('0xa2'),_0x260680);var _0x20a0d5={'method':_0x300b('0xa3'),'uri':_0x300b('0xa4')+_0x28d099[_0x300b('0xa5')]+'/oauth2/token','form':{'client_id':_0x28d099[_0x300b('0x9c')],'resource':_0x260680,'username':_0x28d099[_0x300b('0x9a')],'password':_0x28d099[_0x300b('0x9b')],'grant_type':_0x300b('0x9b'),'client_secret':_0x28d099[_0x300b('0x9d')]},'json':!![]};return rp(_0x20a0d5);}})[_0x300b('0x25')](function(_0x51f1a7){_0x8ccca3=_0x51f1a7[_0x300b('0xa6')];var _0x465f24={'method':_0x300b('0xa7'),'uri':encodeURI(_0x53a9c4+_0x300b('0xa8')+_0x1f5b86+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x8ccca3,'If-None-Match':null,'OData-Version':_0x300b('0xa9')},'json':!![]};return rp(_0x465f24);})[_0x300b('0x25')](function(_0x176049){var _0x4c75b3=_0x176049[_0x300b('0xaa')][0x0];var _0x6e62fe=_0x4c75b3[_0x300b('0xab')];var _0x12328a={'method':'GET','uri':_0x53a9c4+_0x300b('0xac')+_0x6e62fe+_0x300b('0xad'),'headers':{'Authorization':_0x300b('0xae')+_0x8ccca3,'If-None-Match':null,'OData-Version':_0x300b('0xa9')},'json':!![]};return rp(_0x12328a);})[_0x300b('0x25')](function(_0x45f46c){_0x11d840=_0x45f46c;_0x48ce05=_0x11d840[_0x300b('0xaf')];_0x48ce05=_[_0x300b('0xb0')](_0x48ce05,function(_0x155454){return!_0x10e47f[_0x300b('0xb1')](_0x155454[_0x300b('0xb2')]);});var _0x438cab=[];var _0x853b9c=[];_0x48ce05[_0x300b('0xb3')](function(_0x1a0cd2){if(_0x1a0cd2[_0x300b('0xb4')]){var _0x29506e=_0x1a0cd2[_0x300b('0xb4')][_0x300b('0xb5')](_0x1a0cd2[_0x300b('0xb4')][_0x300b('0xa0')]('.')+0x1);if(_0x29506e===_0x300b('0xb6')){_0x438cab[_0x300b('0xb7')](getSelectList(_0x53a9c4,_0x2b1cca,_0x853b9c,_0x11d840[_0x300b('0xab')],_0x1a0cd2[_0x300b('0xab')],_0x8ccca3));}}});return Promise[_0x300b('0xb8')](_0x438cab);})[_0x300b('0x25')](function(_0x2d252d){_0x38e06c=_0x2d252d[0x0];var _0x327706=[];var _0x25e850=[];_0x48ce05['forEach'](function(_0x51d225){if(!_[_0x300b('0xb9')](_0x51d225['@odata.type'])){var _0x3dd3a8=_0x51d225[_0x300b('0xb4')][_0x300b('0xb5')](_0x51d225[_0x300b('0xb4')][_0x300b('0xa0')]('.')+0x1);if(_0x3dd3a8===_0x300b('0xba')){_0x327706[_0x300b('0xb7')](getBooleanList(_0x53a9c4,_0x2b1cca,_0x25e850,_0x11d840['MetadataId'],_0x51d225[_0x300b('0xab')],_0x8ccca3));}}});return Promise[_0x300b('0xb8')](_0x327706);})['then'](function(_0x50fd64){_0x26310f=_0x50fd64[0x0];var _0x570366=[];var _0x428657=[];_0x48ce05[_0x300b('0xb3')](function(_0x57ad6d){if(_0x57ad6d['@odata.type']){var _0x468f79=_0x57ad6d[_0x300b('0xb4')]['substring'](_0x57ad6d['@odata.type'][_0x300b('0xa0')]('.')+0x1);if(_0x468f79===_0x300b('0xbb')||_0x468f79===_0x300b('0xbc')||_0x468f79===_0x300b('0xbd')||_0x468f79===_0x300b('0xbe')||_0x468f79===_0x300b('0xbf')||_0x468f79===_0x300b('0xc0')||_0x468f79==='StatusAttributeMetadata'||_0x468f79===_0x300b('0xc1')||_0x468f79===_0x300b('0xc2')||_0x468f79===_0x300b('0xc3')){_0x570366[_0x300b('0xb7')](getInputList(_0x53a9c4,_0x2b1cca,_0x468f79,_0x428657,_0x11d840['MetadataId'],_0x57ad6d[_0x300b('0xab')],_0x8ccca3));}}});return Promise[_0x300b('0xb8')](_0x570366);})[_0x300b('0x25')](function(_0x3c53a6){_0x2caf45=_0x3c53a6[0x0];var _0x26820b=_0x38e06c['concat'](_0x26310f)[_0x300b('0x99')](_0x2caf45);var _0x4aa0d1={'count':_0x26820b[_0x300b('0x44')],'rows':_0x26820b};return _0x4aa0d1;})['then'](respondWithResult(_0x104a59,null))[_0x300b('0x47')](function(_0x5371cc){var _0x5d981f=_0x49945d[_0x300b('0x31')][_0x300b('0xc4')]?0x1f4:_0x5371cc[_0x300b('0xc5')]||0x1f4;logger[_0x300b('0x27')](_0x5371cc[_0x300b('0x28')]);delete _0x5371cc[_0x300b('0x29')];if(_0x5d981f===0x191){_0x5d981f=0x190;}_0x104a59[_0x300b('0x19')](_0x5d981f)[_0x300b('0x2a')](_0x49945d[_0x300b('0x31')][_0x300b('0xc4')]?{'message':_0x300b('0xc6'),'statusCode':_0x5371cc[_0x300b('0xc5')]}:_0x5371cc);});};function getSelectList(_0x55c906,_0x39420c,_0x57736f,_0xe3352b,_0x42ba0b,_0x34d40d){var _0x3f0b95={'method':_0x300b('0xa7'),'uri':_0x55c906+_0x300b('0xac')+_0xe3352b+')/Attributes('+_0x42ba0b+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x300b('0xae')+_0x34d40d,'If-None-Match':null,'OData-Version':_0x300b('0xa9')},'json':!![]};return rp(_0x3f0b95)[_0x300b('0x25')](function(_0x507620){var _0x38f6ea=[];var _0x224a41=_0x507620[_0x300b('0xc7')]['Options'];_0x224a41[_0x300b('0xb3')](function(_0x1a5f84){_0x38f6ea[_0x300b('0xb7')]({'name':_0x1a5f84[_0x300b('0xc8')][_0x300b('0xc9')][_0x300b('0xc8')],'value':String(_0x1a5f84[_0x300b('0xca')])});});var _0x4affe6={'id':_0x39420c+'_'+_0x507620[_0x300b('0xb2')],'name':_0x507620[_0x300b('0xcb')][_0x300b('0xc9')][_0x300b('0xc8')],'custom':![],'options':_0x38f6ea};_0x57736f[_0x300b('0xb7')](_0x4affe6);return _0x57736f;});}function getBooleanList(_0xb55af6,_0x1ea021,_0xed26c9,_0x5359be,_0x4fa163,_0x56ef74){var _0xb56994={'method':_0x300b('0xa7'),'uri':_0xb55af6+'EntityDefinitions('+_0x5359be+')/Attributes('+_0x4fa163+_0x300b('0xcc'),'headers':{'Authorization':_0x300b('0xae')+_0x56ef74,'If-None-Match':null,'OData-Version':_0x300b('0xa9')},'json':!![]};return rp(_0xb56994)['then'](function(_0x30b118){var _0x1eac22=[];_0x1eac22[_0x300b('0xb7')]({'name':_0x30b118['OptionSet'][_0x300b('0xcd')]['Label'][_0x300b('0xc9')][_0x300b('0xc8')],'value':_0x300b('0xce')},{'name':_0x30b118[_0x300b('0xc7')][_0x300b('0xcf')][_0x300b('0xc8')][_0x300b('0xc9')][_0x300b('0xc8')],'value':_0x300b('0xd0')});var _0xb3f62a={'id':_0x1ea021+'_'+_0x30b118[_0x300b('0xb2')],'name':_0x30b118[_0x300b('0xcb')][_0x300b('0xc9')][_0x300b('0xc8')],'custom':![],'options':_0x1eac22};_0xed26c9[_0x300b('0xb7')](_0xb3f62a);return _0xed26c9;});}function getInputList(_0xdc672b,_0x55fd16,_0x3e3c92,_0x288784,_0x326e50,_0x17d171,_0x497428){var _0x3eee77={'method':'GET','uri':_0xdc672b+'EntityDefinitions('+_0x326e50+_0x300b('0xd1')+_0x17d171+_0x300b('0xd2')+_0x3e3c92+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x497428,'If-None-Match':null,'OData-Version':_0x300b('0xa9')},'json':!![]};return rp(_0x3eee77)['then'](function(_0x22ec9c){var _0x226c41={'id':_0x55fd16+'_'+_0x22ec9c['LogicalName'],'name':_0x22ec9c[_0x300b('0xcb')][_0x300b('0xc9')]?_0x22ec9c[_0x300b('0xcb')][_0x300b('0xc9')]['Label']:_0x22ec9c['LogicalName'],'custom':![],'options':[]};_0x288784[_0x300b('0xb7')](_0x226c41);return _0x288784;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c6b08b5..51bc9fa 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x2cbf11,_0x407d5d){var _0x5691d0=function(_0x30d0e5){while(--_0x30d0e5){_0x2cbf11['push'](_0x2cbf11['shift']());}};_0x5691d0(++_0x407d5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x53c5e1,_0x55647e){var _0x6d5835=function(_0x36bf6f){while(--_0x36bf6f){_0x53c5e1['push'](_0x53c5e1['shift']());}};_0x6d5835(++_0x55647e);}(_0x757a,0xde));var _0xa757=function(_0x4a6740,_0x41733a){_0x4a6740=_0x4a6740-0x0;var _0x3433bb=_0x757a[_0x4a6740];return _0x3433bb;};'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 fbb3277..6250dcb 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 _0x1ce0=['Dynamics365Account','where','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDynamics365Account','options','raw','map','include','model','attributes','ShowDynamics365Account'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x1ce0,0x1a7));var _0x01ce=function(_0x4b416c,_0x53ef9e){_0x4b416c=_0x4b416c-0x0;var _0x2037fa=_0x1ce0[_0x4b416c];return _0x2037fa;};'use strict';var _=require(_0x01ce('0x0'));var util=require(_0x01ce('0x1'));var moment=require(_0x01ce('0x2'));var BPromise=require(_0x01ce('0x3'));var rs=require(_0x01ce('0x4'));var fs=require('fs');var Redis=require(_0x01ce('0x5'));var db=require(_0x01ce('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x01ce('0x7'))(_0x01ce('0x8'));var config=require(_0x01ce('0x9'));var jayson=require(_0x01ce('0xa'));var client=jayson[_0x01ce('0xb')][_0x01ce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c86af,_0x1afc98,_0x1354ab){return new BPromise(function(_0xc634a8,_0xc3aeef){return client[_0x01ce('0xd')](_0x4c86af,_0x1354ab)[_0x01ce('0xe')](function(_0x3fd490){logger[_0x01ce('0xf')](_0x01ce('0x10'),_0x1afc98,_0x01ce('0x11'));logger[_0x01ce('0x12')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1afc98,_0x01ce('0x11'),JSON[_0x01ce('0x13')](_0x3fd490));if(_0x3fd490[_0x01ce('0x14')]){if(_0x3fd490[_0x01ce('0x14')][_0x01ce('0x15')]===0x1f4){logger[_0x01ce('0x14')](_0x01ce('0x10'),_0x1afc98,_0x3fd490[_0x01ce('0x14')][_0x01ce('0x16')]);return _0xc3aeef(_0x3fd490[_0x01ce('0x14')]['message']);}logger['error'](_0x01ce('0x10'),_0x1afc98,_0x3fd490[_0x01ce('0x14')]['message']);return _0xc634a8(_0x3fd490[_0x01ce('0x14')][_0x01ce('0x16')]);}else{logger[_0x01ce('0xf')](_0x01ce('0x10'),_0x1afc98,_0x01ce('0x11'));_0xc634a8(_0x3fd490[_0x01ce('0x17')]['message']);}})['catch'](function(_0x1879b3){logger[_0x01ce('0x14')](_0x01ce('0x10'),_0x1afc98,_0x1879b3);_0xc3aeef(_0x1879b3);});});}exports[_0x01ce('0x18')]=function(_0x24688a){var _0x418b98=this;return new Promise(function(_0x4ea71e,_0xc77116){return db['Dynamics365Account']['findAll']({'raw':_0x24688a[_0x01ce('0x19')]?_0x24688a[_0x01ce('0x19')][_0x01ce('0x1a')]===undefined?!![]:![]:!![],'where':_0x24688a[_0x01ce('0x19')]?_0x24688a[_0x01ce('0x19')]['where']||null:null,'attributes':_0x24688a[_0x01ce('0x19')]?_0x24688a['options']['attributes']||null:null,'limit':_0x24688a[_0x01ce('0x19')]?_0x24688a[_0x01ce('0x19')]['limit']||null:null,'include':_0x24688a[_0x01ce('0x19')]?_0x24688a[_0x01ce('0x19')]['include']?_[_0x01ce('0x1b')](_0x24688a[_0x01ce('0x19')][_0x01ce('0x1c')],function(_0x571a80){return{'model':db[_0x571a80[_0x01ce('0x1d')]],'as':_0x571a80['as'],'attributes':_0x571a80[_0x01ce('0x1e')],'include':_0x571a80[_0x01ce('0x1c')]?_[_0x01ce('0x1b')](_0x571a80[_0x01ce('0x1c')],function(_0x49c987){return{'model':db[_0x49c987[_0x01ce('0x1d')]],'as':_0x49c987['as'],'attributes':_0x49c987[_0x01ce('0x1e')],'include':_0x49c987[_0x01ce('0x1c')]?_[_0x01ce('0x1b')](_0x49c987[_0x01ce('0x1c')],function(_0x164aa7){return{'model':db[_0x164aa7[_0x01ce('0x1d')]],'as':_0x164aa7['as'],'attributes':_0x164aa7[_0x01ce('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01ce('0xe')](function(_0x310133){logger['info'](_0x01ce('0x18'),_0x24688a);logger['debug'](_0x01ce('0x18'),_0x24688a,JSON['stringify'](_0x310133));_0x4ea71e(_0x310133);})['catch'](function(_0x37ff64){logger['error'](_0x01ce('0x18'),_0x37ff64[_0x01ce('0x16')],_0x24688a);_0xc77116(_0x418b98[_0x01ce('0x14')](0x1f4,_0x37ff64[_0x01ce('0x16')]));});});};exports[_0x01ce('0x1f')]=function(_0x2248b2){var _0x4cfb5=this;return new Promise(function(_0x72bc04,_0x58f2af){return db[_0x01ce('0x20')]['find']({'raw':_0x2248b2[_0x01ce('0x19')]?_0x2248b2[_0x01ce('0x19')][_0x01ce('0x1a')]===undefined?!![]:![]:!![],'where':_0x2248b2['options']?_0x2248b2[_0x01ce('0x19')][_0x01ce('0x21')]||null:null,'attributes':_0x2248b2[_0x01ce('0x19')]?_0x2248b2[_0x01ce('0x19')]['attributes']||null:null,'include':_0x2248b2[_0x01ce('0x19')]?_0x2248b2[_0x01ce('0x19')][_0x01ce('0x1c')]?_[_0x01ce('0x1b')](_0x2248b2[_0x01ce('0x19')][_0x01ce('0x1c')],function(_0x681aba){return{'model':db[_0x681aba[_0x01ce('0x1d')]],'as':_0x681aba['as'],'attributes':_0x681aba[_0x01ce('0x1e')],'include':_0x681aba['include']?_[_0x01ce('0x1b')](_0x681aba['include'],function(_0x5750de){return{'model':db[_0x5750de[_0x01ce('0x1d')]],'as':_0x5750de['as'],'attributes':_0x5750de[_0x01ce('0x1e')],'include':_0x5750de['include']?_[_0x01ce('0x1b')](_0x5750de[_0x01ce('0x1c')],function(_0x4ae0da){return{'model':db[_0x4ae0da['model']],'as':_0x4ae0da['as'],'attributes':_0x4ae0da[_0x01ce('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01ce('0xe')](function(_0x553aa2){logger[_0x01ce('0xf')]('ShowDynamics365Account',_0x2248b2);logger['debug'](_0x01ce('0x1f'),_0x2248b2,JSON[_0x01ce('0x13')](_0x553aa2));_0x72bc04(_0x553aa2);})[_0x01ce('0x22')](function(_0x4bc609){logger['error'](_0x01ce('0x1f'),_0x4bc609[_0x01ce('0x16')],_0x2248b2);_0x58f2af(_0x4cfb5[_0x01ce('0x14')](0x1f4,_0x4bc609[_0x01ce('0x16')]));});});}; \ No newline at end of file +var _0x22e0=['moment','bluebird','../../mysqldb','../../config/utils','rpc','client','then','request\x20sent','debug','stringify','code','error','Dynamics365Account,\x20%s,\x20%s','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','ShowDynamics365Account','lodash'];(function(_0x4f7e48,_0x46c49f){var _0x5132f8=function(_0x5be19b){while(--_0x5be19b){_0x4f7e48['push'](_0x4f7e48['shift']());}};_0x5132f8(++_0x46c49f);}(_0x22e0,0x167));var _0x022e=function(_0x542459,_0x3ce143){_0x542459=_0x542459-0x0;var _0xaec421=_0x22e0[_0x542459];return _0xaec421;};'use strict';var _=require(_0x022e('0x0'));var util=require('util');var moment=require(_0x022e('0x1'));var BPromise=require(_0x022e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x022e('0x3'))['db'];var utils=require(_0x022e('0x4'));var logger=require('../../config/logger')(_0x022e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x022e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364662,_0x5cdad0,_0x41184c){return new BPromise(function(_0x5b0a2b,_0x4d42d7){return client['request'](_0x364662,_0x41184c)[_0x022e('0x7')](function(_0x2ae1b7){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x5cdad0,_0x022e('0x8'));logger[_0x022e('0x9')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5cdad0,_0x022e('0x8'),JSON[_0x022e('0xa')](_0x2ae1b7));if(_0x2ae1b7['error']){if(_0x2ae1b7['error'][_0x022e('0xb')]===0x1f4){logger[_0x022e('0xc')](_0x022e('0xd'),_0x5cdad0,_0x2ae1b7[_0x022e('0xc')][_0x022e('0xe')]);return _0x4d42d7(_0x2ae1b7[_0x022e('0xc')][_0x022e('0xe')]);}logger[_0x022e('0xc')](_0x022e('0xd'),_0x5cdad0,_0x2ae1b7[_0x022e('0xc')][_0x022e('0xe')]);return _0x5b0a2b(_0x2ae1b7[_0x022e('0xc')][_0x022e('0xe')]);}else{logger[_0x022e('0xf')](_0x022e('0xd'),_0x5cdad0,'request\x20sent');_0x5b0a2b(_0x2ae1b7[_0x022e('0x10')][_0x022e('0xe')]);}})[_0x022e('0x11')](function(_0x22f2ec){logger[_0x022e('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x5cdad0,_0x22f2ec);_0x4d42d7(_0x22f2ec);});});}exports[_0x022e('0x12')]=function(_0x4b5346){var _0xa11bcc=this;return new Promise(function(_0x5c7f53,_0x414d42){return db[_0x022e('0x13')][_0x022e('0x14')]({'raw':_0x4b5346[_0x022e('0x15')]?_0x4b5346['options'][_0x022e('0x16')]===undefined?!![]:![]:!![],'where':_0x4b5346[_0x022e('0x15')]?_0x4b5346[_0x022e('0x15')][_0x022e('0x17')]||null:null,'attributes':_0x4b5346[_0x022e('0x15')]?_0x4b5346[_0x022e('0x15')]['attributes']||null:null,'limit':_0x4b5346[_0x022e('0x15')]?_0x4b5346[_0x022e('0x15')][_0x022e('0x18')]||null:null,'include':_0x4b5346[_0x022e('0x15')]?_0x4b5346[_0x022e('0x15')][_0x022e('0x19')]?_[_0x022e('0x1a')](_0x4b5346[_0x022e('0x15')][_0x022e('0x19')],function(_0x6ee339){return{'model':db[_0x6ee339[_0x022e('0x1b')]],'as':_0x6ee339['as'],'attributes':_0x6ee339['attributes'],'include':_0x6ee339[_0x022e('0x19')]?_[_0x022e('0x1a')](_0x6ee339[_0x022e('0x19')],function(_0x566d10){return{'model':db[_0x566d10['model']],'as':_0x566d10['as'],'attributes':_0x566d10['attributes'],'include':_0x566d10['include']?_['map'](_0x566d10[_0x022e('0x19')],function(_0x27efd2){return{'model':db[_0x27efd2[_0x022e('0x1b')]],'as':_0x27efd2['as'],'attributes':_0x27efd2[_0x022e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x022e('0x7')](function(_0x125637){logger['info'](_0x022e('0x12'),_0x4b5346);logger[_0x022e('0x9')]('GetDynamics365Account',_0x4b5346,JSON[_0x022e('0xa')](_0x125637));_0x5c7f53(_0x125637);})[_0x022e('0x11')](function(_0xdc400e){logger[_0x022e('0xc')](_0x022e('0x12'),_0xdc400e[_0x022e('0xe')],_0x4b5346);_0x414d42(_0xa11bcc[_0x022e('0xc')](0x1f4,_0xdc400e[_0x022e('0xe')]));});});};exports[_0x022e('0x1d')]=function(_0x4b1cc5){var _0x5887d1=this;return new Promise(function(_0x422631,_0x7f83c1){return db[_0x022e('0x13')]['find']({'raw':_0x4b1cc5[_0x022e('0x15')]?_0x4b1cc5['options'][_0x022e('0x16')]===undefined?!![]:![]:!![],'where':_0x4b1cc5[_0x022e('0x15')]?_0x4b1cc5[_0x022e('0x15')][_0x022e('0x17')]||null:null,'attributes':_0x4b1cc5['options']?_0x4b1cc5[_0x022e('0x15')][_0x022e('0x1c')]||null:null,'include':_0x4b1cc5[_0x022e('0x15')]?_0x4b1cc5[_0x022e('0x15')][_0x022e('0x19')]?_[_0x022e('0x1a')](_0x4b1cc5[_0x022e('0x15')][_0x022e('0x19')],function(_0x24977b){return{'model':db[_0x24977b[_0x022e('0x1b')]],'as':_0x24977b['as'],'attributes':_0x24977b[_0x022e('0x1c')],'include':_0x24977b['include']?_['map'](_0x24977b[_0x022e('0x19')],function(_0x80afb1){return{'model':db[_0x80afb1[_0x022e('0x1b')]],'as':_0x80afb1['as'],'attributes':_0x80afb1[_0x022e('0x1c')],'include':_0x80afb1[_0x022e('0x19')]?_[_0x022e('0x1a')](_0x80afb1[_0x022e('0x19')],function(_0x465642){return{'model':db[_0x465642['model']],'as':_0x465642['as'],'attributes':_0x465642[_0x022e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x022e('0x7')](function(_0xd29af0){logger['info'](_0x022e('0x1d'),_0x4b1cc5);logger[_0x022e('0x9')](_0x022e('0x1d'),_0x4b1cc5,JSON[_0x022e('0xa')](_0xd29af0));_0x422631(_0xd29af0);})[_0x022e('0x11')](function(_0x3d6769){logger['error'](_0x022e('0x1d'),_0x3d6769['message'],_0x4b1cc5);_0x7f83c1(_0x5887d1[_0x022e('0xc')](0x1f4,_0x3d6769[_0x022e('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index bcddb86..db9ed28 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 _0xab95=['getDescriptions','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects'];(function(_0x5ccff8,_0x3d85cc){var _0x5a97d9=function(_0x3da675){while(--_0x3da675){_0x5ccff8['push'](_0x5ccff8['shift']());}};_0x5a97d9(++_0x3d85cc);}(_0xab95,0x1d5));var _0x5ab9=function(_0x182da8,_0x59191e){_0x182da8=_0x182da8-0x0;var _0x5285a1=_0xab95[_0x182da8];return _0x5285a1;};'use strict';var multer=require(_0x5ab9('0x0'));var util=require(_0x5ab9('0x1'));var path=require(_0x5ab9('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ab9('0x3'));var router=express[_0x5ab9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5ab9('0x5'));var config=require(_0x5ab9('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0x5ab9('0x7')]('/',auth[_0x5ab9('0x8')](),controller['index']);router[_0x5ab9('0x7')](_0x5ab9('0x9'),auth['isAuthenticated'](),controller[_0x5ab9('0xa')]);router[_0x5ab9('0x7')](_0x5ab9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x5ab9('0x7')](_0x5ab9('0xc'),auth[_0x5ab9('0x8')](),controller[_0x5ab9('0xd')]);router[_0x5ab9('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x5ab9('0xe')]);router[_0x5ab9('0xf')]('/',auth['isAuthenticated'](),controller[_0x5ab9('0x10')]);router['put'](_0x5ab9('0x9'),auth[_0x5ab9('0x8')](),controller[_0x5ab9('0x11')]);router[_0x5ab9('0x12')](_0x5ab9('0x9'),auth['isAuthenticated'](),controller[_0x5ab9('0x13')]);module[_0x5ab9('0x14')]=router; \ No newline at end of file +var _0x19e1=['../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0x19e1,0x163));var _0x119e=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0x19e1[_0x548d7d];return _0xb1c878;};'use strict';var multer=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var path=require(_0x119e('0x2'));var timeout=require(_0x119e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x119e('0x4'));var auth=require(_0x119e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x119e('0x6'));var controller=require(_0x119e('0x7'));router['get']('/',auth[_0x119e('0x8')](),controller['index']);router[_0x119e('0x9')](_0x119e('0xa'),auth[_0x119e('0x8')](),controller[_0x119e('0xb')]);router['get'](_0x119e('0xc'),auth[_0x119e('0x8')](),controller[_0x119e('0xd')]);router['get']('/:id/subjects',auth[_0x119e('0x8')](),controller[_0x119e('0xe')]);router[_0x119e('0x9')](_0x119e('0xf'),auth[_0x119e('0x8')](),controller[_0x119e('0x10')]);router[_0x119e('0x11')]('/',auth['isAuthenticated'](),controller[_0x119e('0x12')]);router[_0x119e('0x13')](_0x119e('0xa'),auth[_0x119e('0x8')](),controller[_0x119e('0x14')]);router[_0x119e('0x15')]('/:id',auth[_0x119e('0x8')](),controller[_0x119e('0x16')]);module[_0x119e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 8d7b6ad..228fa88 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 _0xc811=['exports','STRING','ENUM','incident','phonecall','sequelize'];(function(_0x30c48d,_0x4ba1db){var _0x394ba1=function(_0x1fdd9e){while(--_0x1fdd9e){_0x30c48d['push'](_0x30c48d['shift']());}};_0x394ba1(++_0x4ba1db);}(_0xc811,0x125));var _0x1c81=function(_0x6db0e,_0x48212e){_0x6db0e=_0x6db0e-0x0;var _0xe297d2=_0xc811[_0x6db0e];return _0xe297d2;};'use strict';var Sequelize=require(_0x1c81('0x0'));module[_0x1c81('0x1')]={'name':{'type':Sequelize[_0x1c81('0x2')]},'description':{'type':Sequelize[_0x1c81('0x2')]},'ticketType':{'type':Sequelize[_0x1c81('0x3')](_0x1c81('0x4'),_0x1c81('0x5')),'defaultValue':_0x1c81('0x4')}}; \ No newline at end of file +var _0x6494=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0x6494,0xf7));var _0x4649=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6494[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4649('0x0'));module[_0x4649('0x1')]={'name':{'type':Sequelize[_0x4649('0x2')]},'description':{'type':Sequelize[_0x4649('0x2')]},'ticketType':{'type':Sequelize[_0x4649('0x3')](_0x4649('0x4'),_0x4649('0x5')),'defaultValue':_0x4649('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ff24d2c..4f8d072 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 _0xa26e=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','stack','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','Dynamics365Configuration','find','catch','create','body','params','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0xeb1c75,_0x5a1a4a){var _0x476467=function(_0x239acf){while(--_0x239acf){_0xeb1c75['push'](_0xeb1c75['shift']());}};_0x476467(++_0x5a1a4a);}(_0xa26e,0x1c4));var _0xea26=function(_0x344c19,_0x570604){_0x344c19=_0x344c19-0x0;var _0x27e315=_0xa26e[_0x344c19];return _0x27e315;};'use strict';var emlformat=require(_0xea26('0x0'));var rimraf=require(_0xea26('0x1'));var zipdir=require(_0xea26('0x2'));var jsonpatch=require(_0xea26('0x3'));var rp=require(_0xea26('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xea26('0x5'));var util=require(_0xea26('0x6'));var path=require(_0xea26('0x7'));var sox=require(_0xea26('0x8'));var csv=require(_0xea26('0x9'));var ejs=require(_0xea26('0xa'));var fs=require('fs');var fs_extra=require(_0xea26('0xb'));var _=require(_0xea26('0xc'));var squel=require(_0xea26('0xd'));var crypto=require('crypto');var jsforce=require(_0xea26('0xe'));var deskjs=require(_0xea26('0xf'));var toCsv=require('to-csv');var querystring=require(_0xea26('0x10'));var Papa=require(_0xea26('0x11'));var Redis=require('ioredis');var authService=require(_0xea26('0x12'));var qs=require(_0xea26('0x13'));var as=require(_0xea26('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xea26('0x15'));var utils=require(_0xea26('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xea26('0x17'));var db=require(_0xea26('0x18'))['db'];function respondWithStatusCode(_0x5e76bc,_0x2903b6){_0x2903b6=_0x2903b6||0xcc;return function(_0x4b8a2b){if(_0x4b8a2b){return _0x5e76bc['sendStatus'](_0x2903b6);}return _0x5e76bc['status'](_0x2903b6)[_0xea26('0x19')]();};}function respondWithResult(_0x580c5e,_0x2b1588){_0x2b1588=_0x2b1588||0xc8;return function(_0x276607){if(_0x276607){return _0x580c5e[_0xea26('0x1a')](_0x2b1588)[_0xea26('0x1b')](_0x276607);}};}function respondWithFilteredResult(_0x2b4338,_0x162a89){return function(_0x10a13e){if(_0x10a13e){var _0x852f05=typeof _0x162a89['offset']===_0xea26('0x1c')&&typeof _0x162a89[_0xea26('0x1d')]==='undefined';var _0x50afc3=_0x10a13e[_0xea26('0x1e')];var _0x2368fa=_0x852f05?0x0:_0x162a89[_0xea26('0x1f')];var _0x1d759e=_0x852f05?_0x10a13e['count']:_0x162a89[_0xea26('0x1f')]+_0x162a89[_0xea26('0x1d')];var _0x3a6cc1;if(_0x1d759e>=_0x50afc3){_0x1d759e=_0x50afc3;_0x3a6cc1=0xc8;}else{_0x3a6cc1=0xce;}_0x2b4338[_0xea26('0x1a')](_0x3a6cc1);return _0x2b4338[_0xea26('0x20')](_0xea26('0x21'),_0x2368fa+'-'+_0x1d759e+'/'+_0x50afc3)[_0xea26('0x1b')](_0x10a13e);}return null;};}function patchUpdates(_0x3b6469){return function(_0x5d30cf){try{jsonpatch[_0xea26('0x22')](_0x5d30cf,_0x3b6469,!![]);}catch(_0x10c477){return BPromise['reject'](_0x10c477);}return _0x5d30cf[_0xea26('0x23')]();};}function saveUpdates(_0x7ede3c,_0x4cb82c){return function(_0x2815b6){if(_0x2815b6){return _0x2815b6['update'](_0x7ede3c)[_0xea26('0x24')](function(_0x79ce4d){return _0x79ce4d;});}return null;};}function removeEntity(_0x28a810,_0x3ca604){return function(_0x194a89){if(_0x194a89){return _0x194a89[_0xea26('0x25')]()[_0xea26('0x24')](function(){_0x28a810[_0xea26('0x1a')](0xcc)[_0xea26('0x19')]();});}};}function handleEntityNotFound(_0x14e487,_0x4587ec){return function(_0x577e53){if(!_0x577e53){_0x14e487['sendStatus'](0x194);}return _0x577e53;};}function handleError(_0x232067,_0x93ba8b){_0x93ba8b=_0x93ba8b||0x1f4;return function(_0x407330){logger['error'](_0x407330[_0xea26('0x26')]);if(_0x407330[_0xea26('0x27')]){delete _0x407330[_0xea26('0x27')];}_0x232067[_0xea26('0x1a')](_0x93ba8b)['send'](_0x407330);};}exports['index']=function(_0x5b9561,_0x41e49a){var _0x327828={},_0x40dc39={},_0x129dd8={'count':0x0,'rows':[]};var _0x3ed337=_['map'](db['Dynamics365Configuration'][_0xea26('0x28')],function(_0x107541){return{'name':_0x107541[_0xea26('0x29')],'type':_0x107541[_0xea26('0x2a')][_0xea26('0x2b')]};});_0x40dc39[_0xea26('0x2c')]=_[_0xea26('0x2d')](_0x3ed337,_0xea26('0x27'));_0x40dc39[_0xea26('0x2e')]=_[_0xea26('0x2f')](_0x5b9561[_0xea26('0x2e')]);_0x40dc39[_0xea26('0x30')]=_[_0xea26('0x31')](_0x40dc39[_0xea26('0x2c')],_0x40dc39[_0xea26('0x2e')]);_0x327828['attributes']=_[_0xea26('0x31')](_0x40dc39['model'],qs[_0xea26('0x32')](_0x5b9561[_0xea26('0x2e')][_0xea26('0x32')]));_0x327828[_0xea26('0x33')]=_0x327828['attributes'][_0xea26('0x34')]?_0x327828['attributes']:_0x40dc39[_0xea26('0x2c')];if(!_0x5b9561['query'][_0xea26('0x35')](_0xea26('0x36'))){_0x327828['limit']=qs['limit'](_0x5b9561[_0xea26('0x2e')][_0xea26('0x1d')]);_0x327828[_0xea26('0x1f')]=qs['offset'](_0x5b9561['query']['offset']);}_0x327828[_0xea26('0x37')]=qs[_0xea26('0x38')](_0x5b9561[_0xea26('0x2e')][_0xea26('0x38')]);_0x327828[_0xea26('0x39')]=qs[_0xea26('0x30')](_[_0xea26('0x3a')](_0x5b9561[_0xea26('0x2e')],_0x40dc39[_0xea26('0x30')]),_0x3ed337);if(_0x5b9561[_0xea26('0x2e')][_0xea26('0x3b')]){_0x327828[_0xea26('0x39')]=_[_0xea26('0x3c')](_0x327828[_0xea26('0x39')],{'$or':_[_0xea26('0x2d')](_0x3ed337,function(_0xa437a3){if(_0xa437a3['type']!==_0xea26('0x3d')){var _0x1f1c07={};_0x1f1c07[_0xa437a3[_0xea26('0x27')]]={'$like':'%'+_0x5b9561[_0xea26('0x2e')][_0xea26('0x3b')]+'%'};return _0x1f1c07;}})});}_0x327828=_[_0xea26('0x3c')]({},_0x327828,_0x5b9561[_0xea26('0x3e')]);var _0x5f0fa0={'where':_0x327828[_0xea26('0x39')]};return db['Dynamics365Configuration']['count'](_0x5f0fa0)[_0xea26('0x24')](function(_0x5890be){_0x129dd8['count']=_0x5890be;if(_0x5b9561['query'][_0xea26('0x3f')]){_0x327828[_0xea26('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x327828);})[_0xea26('0x24')](function(_0x22b829){_0x129dd8[_0xea26('0x41')]=_0x22b829;return _0x129dd8;})['then'](respondWithFilteredResult(_0x41e49a,_0x327828))['catch'](handleError(_0x41e49a,null));};exports[_0xea26('0x42')]=function(_0x1fbe75,_0x465ac1){var _0x29c3da={'raw':![],'where':{'id':_0x1fbe75['params']['id']}},_0x12a24c={};_0x12a24c[_0xea26('0x2c')]=_[_0xea26('0x2f')](db[_0xea26('0x43')]['rawAttributes']);_0x12a24c[_0xea26('0x2e')]=_[_0xea26('0x2f')](_0x1fbe75['query']);_0x12a24c[_0xea26('0x30')]=_['intersection'](_0x12a24c['model'],_0x12a24c[_0xea26('0x2e')]);_0x29c3da['attributes']=_[_0xea26('0x31')](_0x12a24c[_0xea26('0x2c')],qs['fields'](_0x1fbe75[_0xea26('0x2e')][_0xea26('0x32')]));_0x29c3da[_0xea26('0x33')]=_0x29c3da[_0xea26('0x33')]['length']?_0x29c3da['attributes']:_0x12a24c[_0xea26('0x2c')];if(_0x1fbe75[_0xea26('0x2e')][_0xea26('0x3f')]){_0x29c3da[_0xea26('0x40')]=[{'all':!![]}];}_0x29c3da=_[_0xea26('0x3c')]({},_0x29c3da,_0x1fbe75[_0xea26('0x3e')]);return db[_0xea26('0x43')][_0xea26('0x44')](_0x29c3da)[_0xea26('0x24')](handleEntityNotFound(_0x465ac1,null))[_0xea26('0x24')](respondWithResult(_0x465ac1,null))[_0xea26('0x45')](handleError(_0x465ac1,null));};exports['create']=function(_0x268b4f,_0x148cb2){return db[_0xea26('0x43')][_0xea26('0x46')](_0x268b4f[_0xea26('0x47')],{})['then'](respondWithResult(_0x148cb2,0xc9))['catch'](handleError(_0x148cb2,null));};exports['update']=function(_0x32dc21,_0x1ae9cf){if(_0x32dc21[_0xea26('0x47')]['id']){delete _0x32dc21['body']['id'];}return db[_0xea26('0x43')][_0xea26('0x44')]({'where':{'id':_0x32dc21[_0xea26('0x48')]['id']}})[_0xea26('0x24')](handleEntityNotFound(_0x1ae9cf,null))[_0xea26('0x24')](saveUpdates(_0x32dc21[_0xea26('0x47')],null))[_0xea26('0x24')](respondWithResult(_0x1ae9cf,null))[_0xea26('0x45')](handleError(_0x1ae9cf,null));};exports[_0xea26('0x25')]=function(_0x5e6fb2,_0x462559){return db[_0xea26('0x43')]['find']({'where':{'id':_0x5e6fb2[_0xea26('0x48')]['id']}})[_0xea26('0x24')](handleEntityNotFound(_0x462559,null))[_0xea26('0x24')](removeEntity(_0x462559,null))[_0xea26('0x45')](handleError(_0x462559,null));};exports['getFields']=function(_0x4e96ee,_0xad40e0,_0x4f3d1c){var _0x345989={};var _0xbc07fa={};var _0x449b94;var _0x1b82c9;return db[_0xea26('0x43')][_0xea26('0x49')]({'where':{'id':_0x4e96ee[_0xea26('0x48')]['id']}})['then'](handleEntityNotFound(_0xad40e0,null))[_0xea26('0x24')](function(_0x17bfd6){if(_0x17bfd6){_0x449b94=_0x17bfd6;_0xbc07fa['model']=_[_0xea26('0x2f')](db[_0xea26('0x4a')]['rawAttributes']);_0xbc07fa[_0xea26('0x2e')]=_[_0xea26('0x2f')](_0x4e96ee[_0xea26('0x2e')]);_0xbc07fa[_0xea26('0x30')]=_[_0xea26('0x31')](_0xbc07fa[_0xea26('0x2c')],_0xbc07fa[_0xea26('0x2e')]);_0x345989[_0xea26('0x33')]=_[_0xea26('0x31')](_0xbc07fa[_0xea26('0x2c')],qs[_0xea26('0x32')](_0x4e96ee[_0xea26('0x2e')][_0xea26('0x32')]));_0x345989[_0xea26('0x33')]=_0x345989['attributes'][_0xea26('0x34')]?_0x345989[_0xea26('0x33')]:_0xbc07fa['model'];_0x345989['order']=qs[_0xea26('0x38')](_0x4e96ee[_0xea26('0x2e')][_0xea26('0x38')]);_0x345989['where']=qs[_0xea26('0x30')](_[_0xea26('0x3a')](_0x4e96ee[_0xea26('0x2e')],_0xbc07fa['filters']));if(_0x4e96ee[_0xea26('0x2e')][_0xea26('0x3b')]){_0x345989[_0xea26('0x39')]=_[_0xea26('0x3c')](_0x345989[_0xea26('0x39')],{'$or':_[_0xea26('0x2d')](_0x345989['attributes'],function(_0x3e3b56){var _0x1d3821={};_0x1d3821[_0x3e3b56]={'$like':'%'+_0x4e96ee['query'][_0xea26('0x3b')]+'%'};return _0x1d3821;})});}_0x345989=_['merge']({},_0x345989,_0x4e96ee[_0xea26('0x3e')]);return _0x449b94['getFields'](_0x345989);}})['then'](function(_0x1aa7b3){if(_0x1aa7b3){_0x1b82c9=_0x1aa7b3[_0xea26('0x34')];if(!_0x4e96ee[_0xea26('0x2e')][_0xea26('0x35')](_0xea26('0x36'))){_0x345989[_0xea26('0x1d')]=qs[_0xea26('0x1d')](_0x4e96ee[_0xea26('0x2e')][_0xea26('0x1d')]);_0x345989[_0xea26('0x1f')]=qs['offset'](_0x4e96ee[_0xea26('0x2e')][_0xea26('0x1f')]);}return _0x449b94[_0xea26('0x4b')](_0x345989);}})[_0xea26('0x24')](function(_0x56e01f){if(_0x56e01f){return _0x56e01f?{'count':_0x1b82c9,'rows':_0x56e01f}:null;}})[_0xea26('0x24')](respondWithResult(_0xad40e0,null))[_0xea26('0x45')](handleError(_0xad40e0,null));};exports['getSubjects']=function(_0x5d5130,_0x18d5e6,_0xe937c){var _0x4e402b={};var _0x578e06={};var _0x5040c9;var _0xc1231e;return db[_0xea26('0x43')]['findOne']({'where':{'id':_0x5d5130[_0xea26('0x48')]['id']}})[_0xea26('0x24')](handleEntityNotFound(_0x18d5e6,null))['then'](function(_0xdd5008){if(_0xdd5008){_0x5040c9=_0xdd5008;_0x578e06[_0xea26('0x2c')]=_[_0xea26('0x2f')](db[_0xea26('0x4a')][_0xea26('0x28')]);_0x578e06[_0xea26('0x2e')]=_[_0xea26('0x2f')](_0x5d5130['query']);_0x578e06[_0xea26('0x30')]=_[_0xea26('0x31')](_0x578e06[_0xea26('0x2c')],_0x578e06[_0xea26('0x2e')]);_0x4e402b['attributes']=_[_0xea26('0x31')](_0x578e06[_0xea26('0x2c')],qs[_0xea26('0x32')](_0x5d5130[_0xea26('0x2e')]['fields']));_0x4e402b['attributes']=_0x4e402b[_0xea26('0x33')]['length']?_0x4e402b[_0xea26('0x33')]:_0x578e06[_0xea26('0x2c')];_0x4e402b[_0xea26('0x37')]=qs['sort'](_0x5d5130['query'][_0xea26('0x38')]);_0x4e402b[_0xea26('0x39')]=qs['filters'](_[_0xea26('0x3a')](_0x5d5130[_0xea26('0x2e')],_0x578e06[_0xea26('0x30')]));if(_0x5d5130[_0xea26('0x2e')][_0xea26('0x3b')]){_0x4e402b[_0xea26('0x39')]=_['merge'](_0x4e402b[_0xea26('0x39')],{'$or':_['map'](_0x4e402b[_0xea26('0x33')],function(_0x44e561){var _0x2e2cc9={};_0x2e2cc9[_0x44e561]={'$like':'%'+_0x5d5130[_0xea26('0x2e')][_0xea26('0x3b')]+'%'};return _0x2e2cc9;})});}_0x4e402b=_[_0xea26('0x3c')]({},_0x4e402b,_0x5d5130['options']);return _0x5040c9[_0xea26('0x4c')](_0x4e402b);}})['then'](function(_0x42d6a2){if(_0x42d6a2){_0xc1231e=_0x42d6a2[_0xea26('0x34')];if(!_0x5d5130[_0xea26('0x2e')][_0xea26('0x35')](_0xea26('0x36'))){_0x4e402b[_0xea26('0x1d')]=qs[_0xea26('0x1d')](_0x5d5130[_0xea26('0x2e')][_0xea26('0x1d')]);_0x4e402b[_0xea26('0x1f')]=qs[_0xea26('0x1f')](_0x5d5130[_0xea26('0x2e')][_0xea26('0x1f')]);}return _0x5040c9[_0xea26('0x4c')](_0x4e402b);}})[_0xea26('0x24')](function(_0x3202c9){if(_0x3202c9){return _0x3202c9?{'count':_0xc1231e,'rows':_0x3202c9}:null;}})[_0xea26('0x24')](respondWithResult(_0x18d5e6,null))['catch'](handleError(_0x18d5e6,null));};exports[_0xea26('0x4d')]=function(_0xe1e7ef,_0x147001,_0xa26094){var _0x532638={};var _0x208a25={};var _0x4f25c7;var _0x3aced5;return db[_0xea26('0x43')][_0xea26('0x49')]({'where':{'id':_0xe1e7ef[_0xea26('0x48')]['id']}})[_0xea26('0x24')](handleEntityNotFound(_0x147001,null))[_0xea26('0x24')](function(_0x21a041){if(_0x21a041){_0x4f25c7=_0x21a041;_0x208a25['model']=_[_0xea26('0x2f')](db[_0xea26('0x4a')]['rawAttributes']);_0x208a25[_0xea26('0x2e')]=_['keys'](_0xe1e7ef[_0xea26('0x2e')]);_0x208a25[_0xea26('0x30')]=_[_0xea26('0x31')](_0x208a25[_0xea26('0x2c')],_0x208a25['query']);_0x532638[_0xea26('0x33')]=_[_0xea26('0x31')](_0x208a25[_0xea26('0x2c')],qs[_0xea26('0x32')](_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x32')]));_0x532638[_0xea26('0x33')]=_0x532638[_0xea26('0x33')][_0xea26('0x34')]?_0x532638['attributes']:_0x208a25[_0xea26('0x2c')];_0x532638['order']=qs[_0xea26('0x38')](_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x38')]);_0x532638['where']=qs[_0xea26('0x30')](_[_0xea26('0x3a')](_0xe1e7ef[_0xea26('0x2e')],_0x208a25[_0xea26('0x30')]));if(_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x3b')]){_0x532638[_0xea26('0x39')]=_[_0xea26('0x3c')](_0x532638['where'],{'$or':_['map'](_0x532638['attributes'],function(_0x1aa123){var _0x3b3d38={};_0x3b3d38[_0x1aa123]={'$like':'%'+_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x3b')]+'%'};return _0x3b3d38;})});}_0x532638=_[_0xea26('0x3c')]({},_0x532638,_0xe1e7ef[_0xea26('0x3e')]);return _0x4f25c7[_0xea26('0x4d')](_0x532638);}})[_0xea26('0x24')](function(_0x2a943a){if(_0x2a943a){_0x3aced5=_0x2a943a['length'];if(!_0xe1e7ef['query'][_0xea26('0x35')](_0xea26('0x36'))){_0x532638[_0xea26('0x1d')]=qs[_0xea26('0x1d')](_0xe1e7ef[_0xea26('0x2e')][_0xea26('0x1d')]);_0x532638['offset']=qs[_0xea26('0x1f')](_0xe1e7ef['query'][_0xea26('0x1f')]);}return _0x4f25c7['getDescriptions'](_0x532638);}})[_0xea26('0x24')](function(_0x33f5ca){if(_0x33f5ca){return _0x33f5ca?{'count':_0x3aced5,'rows':_0x33f5ca}:null;}})['then'](respondWithResult(_0x147001,null))[_0xea26('0x45')](handleError(_0x147001,null));}; \ No newline at end of file +var _0xaecd=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration'];(function(_0x762c59,_0x5e21c9){var _0x27c6f3=function(_0x5b409f){while(--_0x5b409f){_0x762c59['push'](_0x762c59['shift']());}};_0x27c6f3(++_0x5e21c9);}(_0xaecd,0x64));var _0xdaec=function(_0x5265b4,_0x54845c){_0x5265b4=_0x5265b4-0x0;var _0x104284=_0xaecd[_0x5265b4];return _0x104284;};'use strict';var emlformat=require(_0xdaec('0x0'));var rimraf=require(_0xdaec('0x1'));var zipdir=require(_0xdaec('0x2'));var jsonpatch=require(_0xdaec('0x3'));var rp=require(_0xdaec('0x4'));var moment=require('moment');var BPromise=require(_0xdaec('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdaec('0x6'));var sox=require(_0xdaec('0x7'));var csv=require('to-csv');var ejs=require(_0xdaec('0x8'));var fs=require('fs');var fs_extra=require(_0xdaec('0x9'));var _=require(_0xdaec('0xa'));var squel=require(_0xdaec('0xb'));var crypto=require('crypto');var jsforce=require(_0xdaec('0xc'));var deskjs=require(_0xdaec('0xd'));var toCsv=require(_0xdaec('0xe'));var querystring=require('querystring');var Papa=require(_0xdaec('0xf'));var Redis=require(_0xdaec('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdaec('0x11'));var as=require(_0xdaec('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdaec('0x13'))(_0xdaec('0x14'));var utils=require(_0xdaec('0x15'));var config=require(_0xdaec('0x16'));var licenseUtil=require(_0xdaec('0x17'));var db=require(_0xdaec('0x18'))['db'];function respondWithStatusCode(_0x4dd9d4,_0x9bc902){_0x9bc902=_0x9bc902||0xcc;return function(_0x1cc6c5){if(_0x1cc6c5){return _0x4dd9d4[_0xdaec('0x19')](_0x9bc902);}return _0x4dd9d4[_0xdaec('0x1a')](_0x9bc902)[_0xdaec('0x1b')]();};}function respondWithResult(_0x40317c,_0x51c739){_0x51c739=_0x51c739||0xc8;return function(_0x211d99){if(_0x211d99){return _0x40317c[_0xdaec('0x1a')](_0x51c739)[_0xdaec('0x1c')](_0x211d99);}};}function respondWithFilteredResult(_0x4e8beb,_0x318f16){return function(_0x35c0d5){if(_0x35c0d5){var _0x1b6560=typeof _0x318f16[_0xdaec('0x1d')]==='undefined'&&typeof _0x318f16[_0xdaec('0x1e')]===_0xdaec('0x1f');var _0x49aa66=_0x35c0d5[_0xdaec('0x20')];var _0x52865f=_0x1b6560?0x0:_0x318f16[_0xdaec('0x1d')];var _0x7f2633=_0x1b6560?_0x35c0d5[_0xdaec('0x20')]:_0x318f16[_0xdaec('0x1d')]+_0x318f16[_0xdaec('0x1e')];var _0x22cc10;if(_0x7f2633>=_0x49aa66){_0x7f2633=_0x49aa66;_0x22cc10=0xc8;}else{_0x22cc10=0xce;}_0x4e8beb[_0xdaec('0x1a')](_0x22cc10);return _0x4e8beb[_0xdaec('0x21')](_0xdaec('0x22'),_0x52865f+'-'+_0x7f2633+'/'+_0x49aa66)[_0xdaec('0x1c')](_0x35c0d5);}return null;};}function patchUpdates(_0x32e0f5){return function(_0x26322e){try{jsonpatch[_0xdaec('0x23')](_0x26322e,_0x32e0f5,!![]);}catch(_0x286e4f){return BPromise[_0xdaec('0x24')](_0x286e4f);}return _0x26322e[_0xdaec('0x25')]();};}function saveUpdates(_0x270228,_0x2fc2c5){return function(_0x72046){if(_0x72046){return _0x72046[_0xdaec('0x26')](_0x270228)[_0xdaec('0x27')](function(_0x49158d){return _0x49158d;});}return null;};}function removeEntity(_0x2bf24e,_0x3c85b9){return function(_0x1a956d){if(_0x1a956d){return _0x1a956d[_0xdaec('0x28')]()['then'](function(){_0x2bf24e['status'](0xcc)[_0xdaec('0x1b')]();});}};}function handleEntityNotFound(_0x5a08ed,_0x2f210c){return function(_0x3d753b){if(!_0x3d753b){_0x5a08ed['sendStatus'](0x194);}return _0x3d753b;};}function handleError(_0x4dfdd4,_0x46257a){_0x46257a=_0x46257a||0x1f4;return function(_0x4d29b1){logger[_0xdaec('0x29')](_0x4d29b1['stack']);if(_0x4d29b1[_0xdaec('0x2a')]){delete _0x4d29b1[_0xdaec('0x2a')];}_0x4dfdd4[_0xdaec('0x1a')](_0x46257a)[_0xdaec('0x2b')](_0x4d29b1);};}exports[_0xdaec('0x2c')]=function(_0x268d70,_0x3555d2){var _0x385d1a={},_0x12adb6={},_0xfa823e={'count':0x0,'rows':[]};var _0x848250=_[_0xdaec('0x2d')](db['Dynamics365Configuration']['rawAttributes'],function(_0x303129){return{'name':_0x303129[_0xdaec('0x2e')],'type':_0x303129[_0xdaec('0x2f')][_0xdaec('0x30')]};});_0x12adb6['model']=_['map'](_0x848250,_0xdaec('0x2a'));_0x12adb6[_0xdaec('0x31')]=_[_0xdaec('0x32')](_0x268d70[_0xdaec('0x31')]);_0x12adb6[_0xdaec('0x33')]=_[_0xdaec('0x34')](_0x12adb6[_0xdaec('0x35')],_0x12adb6['query']);_0x385d1a['attributes']=_['intersection'](_0x12adb6['model'],qs[_0xdaec('0x36')](_0x268d70[_0xdaec('0x31')]['fields']));_0x385d1a['attributes']=_0x385d1a['attributes'][_0xdaec('0x37')]?_0x385d1a[_0xdaec('0x38')]:_0x12adb6[_0xdaec('0x35')];if(!_0x268d70[_0xdaec('0x31')][_0xdaec('0x39')](_0xdaec('0x3a'))){_0x385d1a[_0xdaec('0x1e')]=qs[_0xdaec('0x1e')](_0x268d70[_0xdaec('0x31')]['limit']);_0x385d1a[_0xdaec('0x1d')]=qs[_0xdaec('0x1d')](_0x268d70[_0xdaec('0x31')][_0xdaec('0x1d')]);}_0x385d1a[_0xdaec('0x3b')]=qs[_0xdaec('0x3c')](_0x268d70[_0xdaec('0x31')][_0xdaec('0x3c')]);_0x385d1a[_0xdaec('0x3d')]=qs[_0xdaec('0x33')](_[_0xdaec('0x3e')](_0x268d70[_0xdaec('0x31')],_0x12adb6[_0xdaec('0x33')]),_0x848250);if(_0x268d70['query'][_0xdaec('0x3f')]){_0x385d1a[_0xdaec('0x3d')]=_[_0xdaec('0x40')](_0x385d1a[_0xdaec('0x3d')],{'$or':_['map'](_0x848250,function(_0x514fae){if(_0x514fae[_0xdaec('0x2f')]!==_0xdaec('0x41')){var _0x47ac97={};_0x47ac97[_0x514fae[_0xdaec('0x2a')]]={'$like':'%'+_0x268d70[_0xdaec('0x31')]['filter']+'%'};return _0x47ac97;}})});}_0x385d1a=_[_0xdaec('0x40')]({},_0x385d1a,_0x268d70[_0xdaec('0x42')]);var _0x44f805={'where':_0x385d1a[_0xdaec('0x3d')]};return db[_0xdaec('0x43')][_0xdaec('0x20')](_0x44f805)[_0xdaec('0x27')](function(_0xefa8d1){_0xfa823e['count']=_0xefa8d1;if(_0x268d70[_0xdaec('0x31')][_0xdaec('0x44')]){_0x385d1a[_0xdaec('0x45')]=[{'all':!![]}];}return db[_0xdaec('0x43')][_0xdaec('0x46')](_0x385d1a);})[_0xdaec('0x27')](function(_0x451f87){_0xfa823e[_0xdaec('0x47')]=_0x451f87;return _0xfa823e;})['then'](respondWithFilteredResult(_0x3555d2,_0x385d1a))[_0xdaec('0x48')](handleError(_0x3555d2,null));};exports[_0xdaec('0x49')]=function(_0x16e451,_0x3f5516){var _0x39570f={'raw':![],'where':{'id':_0x16e451[_0xdaec('0x4a')]['id']}},_0x4edeff={};_0x4edeff[_0xdaec('0x35')]=_[_0xdaec('0x32')](db['Dynamics365Configuration'][_0xdaec('0x4b')]);_0x4edeff[_0xdaec('0x31')]=_[_0xdaec('0x32')](_0x16e451[_0xdaec('0x31')]);_0x4edeff[_0xdaec('0x33')]=_[_0xdaec('0x34')](_0x4edeff['model'],_0x4edeff['query']);_0x39570f[_0xdaec('0x38')]=_['intersection'](_0x4edeff[_0xdaec('0x35')],qs[_0xdaec('0x36')](_0x16e451[_0xdaec('0x31')][_0xdaec('0x36')]));_0x39570f['attributes']=_0x39570f[_0xdaec('0x38')][_0xdaec('0x37')]?_0x39570f[_0xdaec('0x38')]:_0x4edeff[_0xdaec('0x35')];if(_0x16e451[_0xdaec('0x31')]['includeAll']){_0x39570f[_0xdaec('0x45')]=[{'all':!![]}];}_0x39570f=_[_0xdaec('0x40')]({},_0x39570f,_0x16e451['options']);return db[_0xdaec('0x43')]['find'](_0x39570f)[_0xdaec('0x27')](handleEntityNotFound(_0x3f5516,null))['then'](respondWithResult(_0x3f5516,null))[_0xdaec('0x48')](handleError(_0x3f5516,null));};exports['create']=function(_0x4ad6b4,_0xbab27a){return db[_0xdaec('0x43')][_0xdaec('0x4c')](_0x4ad6b4[_0xdaec('0x4d')],{})[_0xdaec('0x27')](respondWithResult(_0xbab27a,0xc9))['catch'](handleError(_0xbab27a,null));};exports[_0xdaec('0x26')]=function(_0x281700,_0x24a51d){if(_0x281700[_0xdaec('0x4d')]['id']){delete _0x281700['body']['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x281700[_0xdaec('0x4a')]['id']}})[_0xdaec('0x27')](handleEntityNotFound(_0x24a51d,null))[_0xdaec('0x27')](saveUpdates(_0x281700[_0xdaec('0x4d')],null))[_0xdaec('0x27')](respondWithResult(_0x24a51d,null))[_0xdaec('0x48')](handleError(_0x24a51d,null));};exports[_0xdaec('0x28')]=function(_0x5830d5,_0x10198e){return db[_0xdaec('0x43')][_0xdaec('0x4e')]({'where':{'id':_0x5830d5[_0xdaec('0x4a')]['id']}})[_0xdaec('0x27')](handleEntityNotFound(_0x10198e,null))[_0xdaec('0x27')](removeEntity(_0x10198e,null))['catch'](handleError(_0x10198e,null));};exports[_0xdaec('0x4f')]=function(_0x54fdae,_0xbfcfa5,_0x4e80b9){var _0x386d97={};var _0x13d59d={};var _0x5609ec;var _0x4c1e4a;return db[_0xdaec('0x43')][_0xdaec('0x50')]({'where':{'id':_0x54fdae['params']['id']}})[_0xdaec('0x27')](handleEntityNotFound(_0xbfcfa5,null))['then'](function(_0x1af5be){if(_0x1af5be){_0x5609ec=_0x1af5be;_0x13d59d['model']=_[_0xdaec('0x32')](db[_0xdaec('0x51')][_0xdaec('0x4b')]);_0x13d59d[_0xdaec('0x31')]=_[_0xdaec('0x32')](_0x54fdae[_0xdaec('0x31')]);_0x13d59d[_0xdaec('0x33')]=_[_0xdaec('0x34')](_0x13d59d['model'],_0x13d59d[_0xdaec('0x31')]);_0x386d97[_0xdaec('0x38')]=_['intersection'](_0x13d59d[_0xdaec('0x35')],qs[_0xdaec('0x36')](_0x54fdae['query'][_0xdaec('0x36')]));_0x386d97['attributes']=_0x386d97[_0xdaec('0x38')]['length']?_0x386d97[_0xdaec('0x38')]:_0x13d59d[_0xdaec('0x35')];_0x386d97[_0xdaec('0x3b')]=qs[_0xdaec('0x3c')](_0x54fdae['query'][_0xdaec('0x3c')]);_0x386d97[_0xdaec('0x3d')]=qs[_0xdaec('0x33')](_[_0xdaec('0x3e')](_0x54fdae['query'],_0x13d59d[_0xdaec('0x33')]));if(_0x54fdae[_0xdaec('0x31')]['filter']){_0x386d97['where']=_[_0xdaec('0x40')](_0x386d97['where'],{'$or':_[_0xdaec('0x2d')](_0x386d97[_0xdaec('0x38')],function(_0x2b37fb){var _0x443787={};_0x443787[_0x2b37fb]={'$like':'%'+_0x54fdae[_0xdaec('0x31')][_0xdaec('0x3f')]+'%'};return _0x443787;})});}_0x386d97=_[_0xdaec('0x40')]({},_0x386d97,_0x54fdae[_0xdaec('0x42')]);return _0x5609ec[_0xdaec('0x4f')](_0x386d97);}})[_0xdaec('0x27')](function(_0x12053d){if(_0x12053d){_0x4c1e4a=_0x12053d[_0xdaec('0x37')];if(!_0x54fdae[_0xdaec('0x31')][_0xdaec('0x39')](_0xdaec('0x3a'))){_0x386d97[_0xdaec('0x1e')]=qs[_0xdaec('0x1e')](_0x54fdae['query'][_0xdaec('0x1e')]);_0x386d97['offset']=qs[_0xdaec('0x1d')](_0x54fdae[_0xdaec('0x31')]['offset']);}return _0x5609ec[_0xdaec('0x4f')](_0x386d97);}})[_0xdaec('0x27')](function(_0x211b0b){if(_0x211b0b){return _0x211b0b?{'count':_0x4c1e4a,'rows':_0x211b0b}:null;}})[_0xdaec('0x27')](respondWithResult(_0xbfcfa5,null))[_0xdaec('0x48')](handleError(_0xbfcfa5,null));};exports[_0xdaec('0x52')]=function(_0x16b758,_0x57438d,_0x4a3e9f){var _0x4c911b={};var _0x26af90={};var _0x47e48f;var _0x1f97ce;return db[_0xdaec('0x43')][_0xdaec('0x50')]({'where':{'id':_0x16b758[_0xdaec('0x4a')]['id']}})[_0xdaec('0x27')](handleEntityNotFound(_0x57438d,null))[_0xdaec('0x27')](function(_0x2cde71){if(_0x2cde71){_0x47e48f=_0x2cde71;_0x26af90[_0xdaec('0x35')]=_[_0xdaec('0x32')](db[_0xdaec('0x51')][_0xdaec('0x4b')]);_0x26af90[_0xdaec('0x31')]=_[_0xdaec('0x32')](_0x16b758[_0xdaec('0x31')]);_0x26af90['filters']=_[_0xdaec('0x34')](_0x26af90[_0xdaec('0x35')],_0x26af90['query']);_0x4c911b['attributes']=_[_0xdaec('0x34')](_0x26af90[_0xdaec('0x35')],qs[_0xdaec('0x36')](_0x16b758['query'][_0xdaec('0x36')]));_0x4c911b[_0xdaec('0x38')]=_0x4c911b[_0xdaec('0x38')]['length']?_0x4c911b[_0xdaec('0x38')]:_0x26af90[_0xdaec('0x35')];_0x4c911b[_0xdaec('0x3b')]=qs['sort'](_0x16b758['query'][_0xdaec('0x3c')]);_0x4c911b['where']=qs[_0xdaec('0x33')](_[_0xdaec('0x3e')](_0x16b758[_0xdaec('0x31')],_0x26af90['filters']));if(_0x16b758['query']['filter']){_0x4c911b['where']=_[_0xdaec('0x40')](_0x4c911b['where'],{'$or':_[_0xdaec('0x2d')](_0x4c911b['attributes'],function(_0x27574c){var _0x23db52={};_0x23db52[_0x27574c]={'$like':'%'+_0x16b758[_0xdaec('0x31')]['filter']+'%'};return _0x23db52;})});}_0x4c911b=_[_0xdaec('0x40')]({},_0x4c911b,_0x16b758[_0xdaec('0x42')]);return _0x47e48f[_0xdaec('0x52')](_0x4c911b);}})[_0xdaec('0x27')](function(_0x5c19d7){if(_0x5c19d7){_0x1f97ce=_0x5c19d7[_0xdaec('0x37')];if(!_0x16b758[_0xdaec('0x31')]['hasOwnProperty'](_0xdaec('0x3a'))){_0x4c911b[_0xdaec('0x1e')]=qs[_0xdaec('0x1e')](_0x16b758[_0xdaec('0x31')]['limit']);_0x4c911b[_0xdaec('0x1d')]=qs[_0xdaec('0x1d')](_0x16b758['query'][_0xdaec('0x1d')]);}return _0x47e48f[_0xdaec('0x52')](_0x4c911b);}})[_0xdaec('0x27')](function(_0x361852){if(_0x361852){return _0x361852?{'count':_0x1f97ce,'rows':_0x361852}:null;}})['then'](respondWithResult(_0x57438d,null))[_0xdaec('0x48')](handleError(_0x57438d,null));};exports['getDescriptions']=function(_0x4f0001,_0x36a03d,_0x1defca){var _0x3228d1={};var _0x219131={};var _0x463f90;var _0x1839ec;return db[_0xdaec('0x43')][_0xdaec('0x50')]({'where':{'id':_0x4f0001[_0xdaec('0x4a')]['id']}})[_0xdaec('0x27')](handleEntityNotFound(_0x36a03d,null))['then'](function(_0x101acf){if(_0x101acf){_0x463f90=_0x101acf;_0x219131['model']=_['keys'](db[_0xdaec('0x51')][_0xdaec('0x4b')]);_0x219131['query']=_[_0xdaec('0x32')](_0x4f0001[_0xdaec('0x31')]);_0x219131[_0xdaec('0x33')]=_[_0xdaec('0x34')](_0x219131[_0xdaec('0x35')],_0x219131[_0xdaec('0x31')]);_0x3228d1['attributes']=_[_0xdaec('0x34')](_0x219131[_0xdaec('0x35')],qs['fields'](_0x4f0001[_0xdaec('0x31')][_0xdaec('0x36')]));_0x3228d1[_0xdaec('0x38')]=_0x3228d1[_0xdaec('0x38')][_0xdaec('0x37')]?_0x3228d1[_0xdaec('0x38')]:_0x219131[_0xdaec('0x35')];_0x3228d1[_0xdaec('0x3b')]=qs[_0xdaec('0x3c')](_0x4f0001[_0xdaec('0x31')]['sort']);_0x3228d1[_0xdaec('0x3d')]=qs['filters'](_[_0xdaec('0x3e')](_0x4f0001[_0xdaec('0x31')],_0x219131[_0xdaec('0x33')]));if(_0x4f0001[_0xdaec('0x31')][_0xdaec('0x3f')]){_0x3228d1[_0xdaec('0x3d')]=_[_0xdaec('0x40')](_0x3228d1[_0xdaec('0x3d')],{'$or':_['map'](_0x3228d1['attributes'],function(_0x5bc515){var _0x51d962={};_0x51d962[_0x5bc515]={'$like':'%'+_0x4f0001[_0xdaec('0x31')]['filter']+'%'};return _0x51d962;})});}_0x3228d1=_[_0xdaec('0x40')]({},_0x3228d1,_0x4f0001[_0xdaec('0x42')]);return _0x463f90[_0xdaec('0x53')](_0x3228d1);}})[_0xdaec('0x27')](function(_0x266083){if(_0x266083){_0x1839ec=_0x266083[_0xdaec('0x37')];if(!_0x4f0001['query'][_0xdaec('0x39')]('nolimit')){_0x3228d1[_0xdaec('0x1e')]=qs[_0xdaec('0x1e')](_0x4f0001[_0xdaec('0x31')][_0xdaec('0x1e')]);_0x3228d1['offset']=qs['offset'](_0x4f0001[_0xdaec('0x31')][_0xdaec('0x1d')]);}return _0x463f90[_0xdaec('0x53')](_0x3228d1);}})[_0xdaec('0x27')](function(_0x321560){if(_0x321560){return _0x321560?{'count':_0x1839ec,'rows':_0x321560}:null;}})[_0xdaec('0x27')](respondWithResult(_0x36a03d,null))['catch'](handleError(_0x36a03d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 8f7b74e..8693af1 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 _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x456183,_0x3aebef){var _0x518f74=function(_0x3904f7){while(--_0x3904f7){_0x456183['push'](_0x456183['shift']());}};_0x518f74(++_0x3aebef);}(_0xa41a,0x6b));var _0xaa41=function(_0x54709d,_0x27fe3b){_0x54709d=_0x54709d-0x0;var _0x5280e7=_0xa41a[_0x54709d];return _0x5280e7;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xace887,_0x1d3e65){var _0x1f18af=function(_0x5c14ca){while(--_0x5c14ca){_0xace887['push'](_0xace887['shift']());}};_0x1f18af(++_0x1d3e65);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0xb4e6[_0x398294];return _0x2a872d;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index a7b47c0..5285e23 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 _0x50c9=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x50c9,0xc7));var _0x950c=function(_0xe98045,_0x15eee6){_0xe98045=_0xe98045-0x0;var _0x2b84bc=_0x50c9[_0xe98045];return _0x2b84bc;};'use strict';var _=require(_0x950c('0x0'));var util=require(_0x950c('0x1'));var moment=require(_0x950c('0x2'));var BPromise=require(_0x950c('0x3'));var rs=require(_0x950c('0x4'));var fs=require('fs');var Redis=require(_0x950c('0x5'));var db=require(_0x950c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x950c('0x7'));var config=require(_0x950c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x950c('0x9')][_0x950c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x369ae6,_0x2f490b,_0x357787){return new BPromise(function(_0x333d3d,_0x3267eb){return client['request'](_0x369ae6,_0x357787)[_0x950c('0xb')](function(_0x2df382){logger[_0x950c('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2f490b,_0x950c('0xd'));logger[_0x950c('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2f490b,_0x950c('0xd'),JSON[_0x950c('0xf')](_0x2df382));if(_0x2df382[_0x950c('0x10')]){if(_0x2df382[_0x950c('0x10')][_0x950c('0x11')]===0x1f4){logger['error'](_0x950c('0x12'),_0x2f490b,_0x2df382['error']['message']);return _0x3267eb(_0x2df382[_0x950c('0x10')][_0x950c('0x13')]);}logger[_0x950c('0x10')](_0x950c('0x12'),_0x2f490b,_0x2df382[_0x950c('0x10')][_0x950c('0x13')]);return _0x333d3d(_0x2df382[_0x950c('0x10')][_0x950c('0x13')]);}else{logger[_0x950c('0xc')](_0x950c('0x12'),_0x2f490b,'request\x20sent');_0x333d3d(_0x2df382[_0x950c('0x14')][_0x950c('0x13')]);}})[_0x950c('0x15')](function(_0xecb372){logger[_0x950c('0x10')](_0x950c('0x12'),_0x2f490b,_0xecb372);_0x3267eb(_0xecb372);});});} \ No newline at end of file +var _0x1d5c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x55d9f3,_0x55a1f4){var _0x4d01fb=function(_0x30e63b){while(--_0x30e63b){_0x55d9f3['push'](_0x55d9f3['shift']());}};_0x4d01fb(++_0x55a1f4);}(_0x1d5c,0x1f3));var _0xc1d5=function(_0x1cde38,_0x4b85b9){_0x1cde38=_0x1cde38-0x0;var _0x42af72=_0x1d5c[_0x1cde38];return _0x42af72;};'use strict';var _=require(_0xc1d5('0x0'));var util=require(_0xc1d5('0x1'));var moment=require(_0xc1d5('0x2'));var BPromise=require(_0xc1d5('0x3'));var rs=require(_0xc1d5('0x4'));var fs=require('fs');var Redis=require(_0xc1d5('0x5'));var db=require(_0xc1d5('0x6'))['db'];var utils=require(_0xc1d5('0x7'));var logger=require(_0xc1d5('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc1d5('0x9'));var client=jayson[_0xc1d5('0xa')][_0xc1d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x535d71,_0x553239,_0x53619f){return new BPromise(function(_0x59a8d9,_0x1c0dfe){return client[_0xc1d5('0xc')](_0x535d71,_0x53619f)['then'](function(_0x149bc1){logger['info'](_0xc1d5('0xd'),_0x553239,_0xc1d5('0xe'));logger[_0xc1d5('0xf')](_0xc1d5('0x10'),_0x553239,'request\x20sent',JSON['stringify'](_0x149bc1));if(_0x149bc1[_0xc1d5('0x11')]){if(_0x149bc1[_0xc1d5('0x11')]['code']===0x1f4){logger[_0xc1d5('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x553239,_0x149bc1['error'][_0xc1d5('0x12')]);return _0x1c0dfe(_0x149bc1[_0xc1d5('0x11')][_0xc1d5('0x12')]);}logger[_0xc1d5('0x11')](_0xc1d5('0xd'),_0x553239,_0x149bc1[_0xc1d5('0x11')]['message']);return _0x59a8d9(_0x149bc1[_0xc1d5('0x11')][_0xc1d5('0x12')]);}else{logger[_0xc1d5('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x553239,'request\x20sent');_0x59a8d9(_0x149bc1[_0xc1d5('0x14')]['message']);}})['catch'](function(_0x4dc31b){logger['error'](_0xc1d5('0xd'),_0x553239,_0x4dc31b);_0x1c0dfe(_0x4dc31b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index d3d4148..f49933e 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 _0xea79=['../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x215b41,_0x55c9a5){var _0x37f0a7=function(_0x5d948b){while(--_0x5d948b){_0x215b41['push'](_0x215b41['shift']());}};_0x37f0a7(++_0x55c9a5);}(_0xea79,0x1f2));var _0x9ea7=function(_0x54cca3,_0x3b297d){_0x54cca3=_0x54cca3-0x0;var _0x348fde=_0xea79[_0x54cca3];return _0x348fde;};'use strict';var multer=require('multer');var util=require(_0x9ea7('0x0'));var path=require(_0x9ea7('0x1'));var timeout=require(_0x9ea7('0x2'));var express=require(_0x9ea7('0x3'));var router=express[_0x9ea7('0x4')]();var fs_extra=require(_0x9ea7('0x5'));var auth=require(_0x9ea7('0x6'));var interaction=require(_0x9ea7('0x7'));var config=require(_0x9ea7('0x8'));var controller=require(_0x9ea7('0x9'));router[_0x9ea7('0xa')]('/',auth['isAuthenticated'](),controller[_0x9ea7('0xb')]);router[_0x9ea7('0xa')](_0x9ea7('0xc'),auth[_0x9ea7('0xd')](),controller[_0x9ea7('0xe')]);router[_0x9ea7('0xf')]('/',auth[_0x9ea7('0xd')](),controller[_0x9ea7('0x10')]);router[_0x9ea7('0x11')](_0x9ea7('0xc'),auth['isAuthenticated'](),controller[_0x9ea7('0x12')]);router[_0x9ea7('0x13')]('/:id',auth[_0x9ea7('0xd')](),controller[_0x9ea7('0x14')]);module[_0x9ea7('0x15')]=router; \ No newline at end of file +var _0x312f=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x13d93b,_0x577f4b){var _0x2aa740=function(_0x31af30){while(--_0x31af30){_0x13d93b['push'](_0x13d93b['shift']());}};_0x2aa740(++_0x577f4b);}(_0x312f,0x109));var _0xf312=function(_0x3e11b2,_0x4545c7){_0x3e11b2=_0x3e11b2-0x0;var _0x3f469d=_0x312f[_0x3e11b2];return _0x3f469d;};'use strict';var multer=require('multer');var util=require(_0xf312('0x0'));var path=require(_0xf312('0x1'));var timeout=require(_0xf312('0x2'));var express=require(_0xf312('0x3'));var router=express[_0xf312('0x4')]();var fs_extra=require(_0xf312('0x5'));var auth=require(_0xf312('0x6'));var interaction=require(_0xf312('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xf312('0x8')]('/',auth[_0xf312('0x9')](),controller[_0xf312('0xa')]);router[_0xf312('0x8')](_0xf312('0xb'),auth[_0xf312('0x9')](),controller[_0xf312('0xc')]);router[_0xf312('0xd')]('/',auth[_0xf312('0x9')](),controller[_0xf312('0xe')]);router['put']('/:id',auth[_0xf312('0x9')](),controller[_0xf312('0xf')]);router[_0xf312('0x10')](_0xf312('0xb'),auth[_0xf312('0x9')](),controller[_0xf312('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 d54829e..eb3f127 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 _0x36c2=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x4ed482,_0x12d35f){var _0x2540b6=function(_0x111822){while(--_0x111822){_0x4ed482['push'](_0x4ed482['shift']());}};_0x2540b6(++_0x12d35f);}(_0x36c2,0x114));var _0x236c=function(_0x59de16,_0x1020a1){_0x59de16=_0x59de16-0x0;var _0x4dc86b=_0x36c2[_0x59de16];return _0x4dc86b;};'use strict';var Sequelize=require(_0x236c('0x0'));module[_0x236c('0x1')]={'type':{'type':Sequelize[_0x236c('0x2')]('string',_0x236c('0x3'),_0x236c('0x4'),_0x236c('0x5'),_0x236c('0x6')),'defaultValue':_0x236c('0x7')},'content':{'type':Sequelize[_0x236c('0x8')]},'key':{'type':Sequelize[_0x236c('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x236c('0x7'),_0x236c('0x3'),_0x236c('0x4'))},'keyContent':{'type':Sequelize[_0x236c('0x8')]},'idField':{'type':Sequelize[_0x236c('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x236c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x236c('0x8')]}}; \ No newline at end of file +var _0xe5f8=['BOOLEAN','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x11864a,_0x31ef75){var _0x2943f7=function(_0x4d7f95){while(--_0x4d7f95){_0x11864a['push'](_0x11864a['shift']());}};_0x2943f7(++_0x31ef75);}(_0xe5f8,0x181));var _0x8e5f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe5f8[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x8e5f('0x0')]={'type':{'type':Sequelize[_0x8e5f('0x1')](_0x8e5f('0x2'),_0x8e5f('0x3'),_0x8e5f('0x4'),'keyValue',_0x8e5f('0x5')),'defaultValue':_0x8e5f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8e5f('0x6')]},'keyType':{'type':Sequelize[_0x8e5f('0x1')](_0x8e5f('0x2'),_0x8e5f('0x3'),_0x8e5f('0x4'))},'keyContent':{'type':Sequelize[_0x8e5f('0x6')]},'idField':{'type':Sequelize[_0x8e5f('0x6')]},'nameField':{'type':Sequelize[_0x8e5f('0x6')]},'customField':{'type':Sequelize[_0x8e5f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8e5f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index b0becb8..4c55f95 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 _0xdf90=['destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','then','catch','show','params','length','find','create','body'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0xdf90,0x131));var _0x0df9=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0xdf90[_0x154940];return _0x401409;};'use strict';var emlformat=require(_0x0df9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0df9('0x1'));var jsonpatch=require(_0x0df9('0x2'));var rp=require(_0x0df9('0x3'));var moment=require(_0x0df9('0x4'));var BPromise=require(_0x0df9('0x5'));var Mustache=require('mustache');var util=require(_0x0df9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0df9('0x7'));var ejs=require(_0x0df9('0x8'));var fs=require('fs');var fs_extra=require(_0x0df9('0x9'));var _=require(_0x0df9('0xa'));var squel=require(_0x0df9('0xb'));var crypto=require('crypto');var jsforce=require(_0x0df9('0xc'));var deskjs=require(_0x0df9('0xd'));var toCsv=require(_0x0df9('0x7'));var querystring=require('querystring');var Papa=require(_0x0df9('0xe'));var Redis=require(_0x0df9('0xf'));var authService=require(_0x0df9('0x10'));var qs=require(_0x0df9('0x11'));var as=require(_0x0df9('0x12'));var hardwareService=require(_0x0df9('0x13'));var logger=require(_0x0df9('0x14'))('api');var utils=require(_0x0df9('0x15'));var config=require(_0x0df9('0x16'));var licenseUtil=require(_0x0df9('0x17'));var db=require(_0x0df9('0x18'))['db'];function respondWithStatusCode(_0x5bb6f0,_0x4884de){_0x4884de=_0x4884de||0xcc;return function(_0x371011){if(_0x371011){return _0x5bb6f0[_0x0df9('0x19')](_0x4884de);}return _0x5bb6f0[_0x0df9('0x1a')](_0x4884de)[_0x0df9('0x1b')]();};}function respondWithResult(_0x26d5e3,_0x2e3454){_0x2e3454=_0x2e3454||0xc8;return function(_0x26f438){if(_0x26f438){return _0x26d5e3[_0x0df9('0x1a')](_0x2e3454)[_0x0df9('0x1c')](_0x26f438);}};}function respondWithFilteredResult(_0x59a009,_0x5248cc){return function(_0x2b5055){if(_0x2b5055){var _0x5d8094=typeof _0x5248cc[_0x0df9('0x1d')]===_0x0df9('0x1e')&&typeof _0x5248cc[_0x0df9('0x1f')]===_0x0df9('0x1e');var _0x3b2bee=_0x2b5055['count'];var _0x29371d=_0x5d8094?0x0:_0x5248cc[_0x0df9('0x1d')];var _0x1c415e=_0x5d8094?_0x2b5055['count']:_0x5248cc['offset']+_0x5248cc[_0x0df9('0x1f')];var _0xb82c24;if(_0x1c415e>=_0x3b2bee){_0x1c415e=_0x3b2bee;_0xb82c24=0xc8;}else{_0xb82c24=0xce;}_0x59a009[_0x0df9('0x1a')](_0xb82c24);return _0x59a009[_0x0df9('0x20')](_0x0df9('0x21'),_0x29371d+'-'+_0x1c415e+'/'+_0x3b2bee)[_0x0df9('0x1c')](_0x2b5055);}return null;};}function patchUpdates(_0x47ce23){return function(_0x1d93e2){try{jsonpatch[_0x0df9('0x22')](_0x1d93e2,_0x47ce23,!![]);}catch(_0x372719){return BPromise[_0x0df9('0x23')](_0x372719);}return _0x1d93e2[_0x0df9('0x24')]();};}function saveUpdates(_0x15e775,_0x488e66){return function(_0x49113a){if(_0x49113a){return _0x49113a[_0x0df9('0x25')](_0x15e775)['then'](function(_0x41aa8a){return _0x41aa8a;});}return null;};}function removeEntity(_0x527e33,_0x342792){return function(_0x8d177f){if(_0x8d177f){return _0x8d177f['destroy']()['then'](function(){_0x527e33[_0x0df9('0x1a')](0xcc)[_0x0df9('0x1b')]();});}};}function handleEntityNotFound(_0x5303b5,_0x27edc9){return function(_0x257044){if(!_0x257044){_0x5303b5[_0x0df9('0x19')](0x194);}return _0x257044;};}function handleError(_0x7b9a03,_0x590360){_0x590360=_0x590360||0x1f4;return function(_0x3601b4){logger[_0x0df9('0x26')](_0x3601b4[_0x0df9('0x27')]);if(_0x3601b4[_0x0df9('0x28')]){delete _0x3601b4[_0x0df9('0x28')];}_0x7b9a03[_0x0df9('0x1a')](_0x590360)[_0x0df9('0x29')](_0x3601b4);};}exports[_0x0df9('0x2a')]=function(_0x403a2e,_0x486e36){var _0x1c227f={},_0x10acbd={},_0x1bc323={'count':0x0,'rows':[]};var _0x238799=_[_0x0df9('0x2b')](db[_0x0df9('0x2c')][_0x0df9('0x2d')],function(_0x2858ae){return{'name':_0x2858ae['fieldName'],'type':_0x2858ae[_0x0df9('0x2e')][_0x0df9('0x2f')]};});_0x10acbd['model']=_[_0x0df9('0x2b')](_0x238799,_0x0df9('0x28'));_0x10acbd[_0x0df9('0x30')]=_[_0x0df9('0x31')](_0x403a2e['query']);_0x10acbd[_0x0df9('0x32')]=_[_0x0df9('0x33')](_0x10acbd[_0x0df9('0x34')],_0x10acbd[_0x0df9('0x30')]);_0x1c227f[_0x0df9('0x35')]=_[_0x0df9('0x33')](_0x10acbd[_0x0df9('0x34')],qs[_0x0df9('0x36')](_0x403a2e[_0x0df9('0x30')]['fields']));_0x1c227f[_0x0df9('0x35')]=_0x1c227f[_0x0df9('0x35')]['length']?_0x1c227f[_0x0df9('0x35')]:_0x10acbd['model'];if(!_0x403a2e[_0x0df9('0x30')][_0x0df9('0x37')]('nolimit')){_0x1c227f[_0x0df9('0x1f')]=qs[_0x0df9('0x1f')](_0x403a2e[_0x0df9('0x30')][_0x0df9('0x1f')]);_0x1c227f[_0x0df9('0x1d')]=qs[_0x0df9('0x1d')](_0x403a2e[_0x0df9('0x30')][_0x0df9('0x1d')]);}_0x1c227f['order']=qs['sort'](_0x403a2e[_0x0df9('0x30')][_0x0df9('0x38')]);_0x1c227f[_0x0df9('0x39')]=qs[_0x0df9('0x32')](_[_0x0df9('0x3a')](_0x403a2e['query'],_0x10acbd[_0x0df9('0x32')]),_0x238799);if(_0x403a2e['query']['filter']){_0x1c227f[_0x0df9('0x39')]=_[_0x0df9('0x3b')](_0x1c227f[_0x0df9('0x39')],{'$or':_[_0x0df9('0x2b')](_0x238799,function(_0x2e7930){if(_0x2e7930[_0x0df9('0x2e')]!==_0x0df9('0x3c')){var _0x3af0c1={};_0x3af0c1[_0x2e7930[_0x0df9('0x28')]]={'$like':'%'+_0x403a2e[_0x0df9('0x30')]['filter']+'%'};return _0x3af0c1;}})});}_0x1c227f=_[_0x0df9('0x3b')]({},_0x1c227f,_0x403a2e[_0x0df9('0x3d')]);var _0x13e8df={'where':_0x1c227f[_0x0df9('0x39')]};return db[_0x0df9('0x2c')][_0x0df9('0x3e')](_0x13e8df)['then'](function(_0x4e73f4){_0x1bc323[_0x0df9('0x3e')]=_0x4e73f4;if(_0x403a2e['query'][_0x0df9('0x3f')]){_0x1c227f[_0x0df9('0x40')]=[{'all':!![]}];}return db[_0x0df9('0x2c')][_0x0df9('0x41')](_0x1c227f);})['then'](function(_0x5ec9a5){_0x1bc323[_0x0df9('0x42')]=_0x5ec9a5;return _0x1bc323;})[_0x0df9('0x43')](respondWithFilteredResult(_0x486e36,_0x1c227f))[_0x0df9('0x44')](handleError(_0x486e36,null));};exports[_0x0df9('0x45')]=function(_0xa0c9e1,_0x16e157){var _0x588a20={'raw':!![],'where':{'id':_0xa0c9e1[_0x0df9('0x46')]['id']}},_0x46972f={};_0x46972f[_0x0df9('0x34')]=_[_0x0df9('0x31')](db[_0x0df9('0x2c')]['rawAttributes']);_0x46972f[_0x0df9('0x30')]=_[_0x0df9('0x31')](_0xa0c9e1[_0x0df9('0x30')]);_0x46972f[_0x0df9('0x32')]=_[_0x0df9('0x33')](_0x46972f[_0x0df9('0x34')],_0x46972f[_0x0df9('0x30')]);_0x588a20[_0x0df9('0x35')]=_[_0x0df9('0x33')](_0x46972f[_0x0df9('0x34')],qs[_0x0df9('0x36')](_0xa0c9e1[_0x0df9('0x30')]['fields']));_0x588a20[_0x0df9('0x35')]=_0x588a20[_0x0df9('0x35')][_0x0df9('0x47')]?_0x588a20[_0x0df9('0x35')]:_0x46972f[_0x0df9('0x34')];if(_0xa0c9e1[_0x0df9('0x30')]['includeAll']){_0x588a20[_0x0df9('0x40')]=[{'all':!![]}];}_0x588a20=_[_0x0df9('0x3b')]({},_0x588a20,_0xa0c9e1['options']);return db[_0x0df9('0x2c')][_0x0df9('0x48')](_0x588a20)[_0x0df9('0x43')](handleEntityNotFound(_0x16e157,null))[_0x0df9('0x43')](respondWithResult(_0x16e157,null))[_0x0df9('0x44')](handleError(_0x16e157,null));};exports[_0x0df9('0x49')]=function(_0xaeb1b2,_0x23b054){return db['Dynamics365Field'][_0x0df9('0x49')](_0xaeb1b2[_0x0df9('0x4a')],{})[_0x0df9('0x43')](respondWithResult(_0x23b054,0xc9))['catch'](handleError(_0x23b054,null));};exports['update']=function(_0x56f70b,_0x5c8d58){if(_0x56f70b[_0x0df9('0x4a')]['id']){delete _0x56f70b['body']['id'];}return db[_0x0df9('0x2c')][_0x0df9('0x48')]({'where':{'id':_0x56f70b[_0x0df9('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c8d58,null))[_0x0df9('0x43')](saveUpdates(_0x56f70b[_0x0df9('0x4a')],null))[_0x0df9('0x43')](respondWithResult(_0x5c8d58,null))['catch'](handleError(_0x5c8d58,null));};exports[_0x0df9('0x4b')]=function(_0xd479f9,_0x235e32){return db[_0x0df9('0x2c')][_0x0df9('0x48')]({'where':{'id':_0xd479f9['params']['id']}})[_0x0df9('0x43')](handleEntityNotFound(_0x235e32,null))[_0x0df9('0x43')](removeEntity(_0x235e32,null))[_0x0df9('0x44')](handleError(_0x235e32,null));}; \ No newline at end of file +var _0xd827=['fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','Dynamics365Field','findAll','catch','params','rawAttributes','length','includeAll','include','find','create','body','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','index'];(function(_0x330664,_0x352e40){var _0x398793=function(_0x441a1c){while(--_0x441a1c){_0x330664['push'](_0x330664['shift']());}};_0x398793(++_0x352e40);}(_0xd827,0x18c));var _0x7d82=function(_0x186861,_0x2311c7){_0x186861=_0x186861-0x0;var _0x5be31f=_0xd827[_0x186861];return _0x5be31f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d82('0x0'));var zipdir=require(_0x7d82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d82('0x2'));var moment=require('moment');var BPromise=require(_0x7d82('0x3'));var Mustache=require('mustache');var util=require(_0x7d82('0x4'));var path=require(_0x7d82('0x5'));var sox=require(_0x7d82('0x6'));var csv=require(_0x7d82('0x7'));var ejs=require(_0x7d82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d82('0x9'));var squel=require(_0x7d82('0xa'));var crypto=require(_0x7d82('0xb'));var jsforce=require(_0x7d82('0xc'));var deskjs=require(_0x7d82('0xd'));var toCsv=require(_0x7d82('0x7'));var querystring=require(_0x7d82('0xe'));var Papa=require('papaparse');var Redis=require(_0x7d82('0xf'));var authService=require(_0x7d82('0x10'));var qs=require(_0x7d82('0x11'));var as=require(_0x7d82('0x12'));var hardwareService=require(_0x7d82('0x13'));var logger=require(_0x7d82('0x14'))('api');var utils=require(_0x7d82('0x15'));var config=require(_0x7d82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d82('0x17'))['db'];function respondWithStatusCode(_0x334fa6,_0x48f83c){_0x48f83c=_0x48f83c||0xcc;return function(_0xbfaf79){if(_0xbfaf79){return _0x334fa6[_0x7d82('0x18')](_0x48f83c);}return _0x334fa6['status'](_0x48f83c)[_0x7d82('0x19')]();};}function respondWithResult(_0x5bfe55,_0x178716){_0x178716=_0x178716||0xc8;return function(_0x3ae139){if(_0x3ae139){return _0x5bfe55[_0x7d82('0x1a')](_0x178716)['json'](_0x3ae139);}};}function respondWithFilteredResult(_0x3bbb44,_0x4c4cc5){return function(_0x4b732b){if(_0x4b732b){var _0x47567d=typeof _0x4c4cc5['offset']===_0x7d82('0x1b')&&typeof _0x4c4cc5[_0x7d82('0x1c')]===_0x7d82('0x1b');var _0x465249=_0x4b732b[_0x7d82('0x1d')];var _0x59f7fa=_0x47567d?0x0:_0x4c4cc5[_0x7d82('0x1e')];var _0x566ce2=_0x47567d?_0x4b732b[_0x7d82('0x1d')]:_0x4c4cc5[_0x7d82('0x1e')]+_0x4c4cc5['limit'];var _0x7bd7f0;if(_0x566ce2>=_0x465249){_0x566ce2=_0x465249;_0x7bd7f0=0xc8;}else{_0x7bd7f0=0xce;}_0x3bbb44[_0x7d82('0x1a')](_0x7bd7f0);return _0x3bbb44[_0x7d82('0x1f')](_0x7d82('0x20'),_0x59f7fa+'-'+_0x566ce2+'/'+_0x465249)['json'](_0x4b732b);}return null;};}function patchUpdates(_0xd4ec17){return function(_0xa9ec39){try{jsonpatch['apply'](_0xa9ec39,_0xd4ec17,!![]);}catch(_0x104e47){return BPromise['reject'](_0x104e47);}return _0xa9ec39[_0x7d82('0x21')]();};}function saveUpdates(_0x3bca9e,_0x1bc273){return function(_0x380f0c){if(_0x380f0c){return _0x380f0c[_0x7d82('0x22')](_0x3bca9e)[_0x7d82('0x23')](function(_0x919008){return _0x919008;});}return null;};}function removeEntity(_0x2da5a3,_0x3df452){return function(_0x48cccc){if(_0x48cccc){return _0x48cccc[_0x7d82('0x24')]()[_0x7d82('0x23')](function(){_0x2da5a3[_0x7d82('0x1a')](0xcc)[_0x7d82('0x19')]();});}};}function handleEntityNotFound(_0x183909,_0x2873ee){return function(_0x27b554){if(!_0x27b554){_0x183909['sendStatus'](0x194);}return _0x27b554;};}function handleError(_0x5de6d7,_0x269fcd){_0x269fcd=_0x269fcd||0x1f4;return function(_0x2b4317){logger[_0x7d82('0x25')](_0x2b4317[_0x7d82('0x26')]);if(_0x2b4317['name']){delete _0x2b4317[_0x7d82('0x27')];}_0x5de6d7[_0x7d82('0x1a')](_0x269fcd)[_0x7d82('0x28')](_0x2b4317);};}exports[_0x7d82('0x29')]=function(_0xf62b89,_0x530d52){var _0x4edd62={},_0x577aff={},_0xda952c={'count':0x0,'rows':[]};var _0x53cf9e=_['map'](db['Dynamics365Field']['rawAttributes'],function(_0x33995f){return{'name':_0x33995f[_0x7d82('0x2a')],'type':_0x33995f[_0x7d82('0x2b')][_0x7d82('0x2c')]};});_0x577aff[_0x7d82('0x2d')]=_[_0x7d82('0x2e')](_0x53cf9e,_0x7d82('0x27'));_0x577aff[_0x7d82('0x2f')]=_[_0x7d82('0x30')](_0xf62b89['query']);_0x577aff['filters']=_[_0x7d82('0x31')](_0x577aff['model'],_0x577aff[_0x7d82('0x2f')]);_0x4edd62[_0x7d82('0x32')]=_[_0x7d82('0x31')](_0x577aff[_0x7d82('0x2d')],qs['fields'](_0xf62b89['query'][_0x7d82('0x33')]));_0x4edd62[_0x7d82('0x32')]=_0x4edd62[_0x7d82('0x32')]['length']?_0x4edd62['attributes']:_0x577aff[_0x7d82('0x2d')];if(!_0xf62b89['query'][_0x7d82('0x34')](_0x7d82('0x35'))){_0x4edd62[_0x7d82('0x1c')]=qs[_0x7d82('0x1c')](_0xf62b89[_0x7d82('0x2f')]['limit']);_0x4edd62[_0x7d82('0x1e')]=qs[_0x7d82('0x1e')](_0xf62b89[_0x7d82('0x2f')]['offset']);}_0x4edd62[_0x7d82('0x36')]=qs[_0x7d82('0x37')](_0xf62b89[_0x7d82('0x2f')][_0x7d82('0x37')]);_0x4edd62[_0x7d82('0x38')]=qs[_0x7d82('0x39')](_[_0x7d82('0x3a')](_0xf62b89[_0x7d82('0x2f')],_0x577aff['filters']),_0x53cf9e);if(_0xf62b89[_0x7d82('0x2f')][_0x7d82('0x3b')]){_0x4edd62[_0x7d82('0x38')]=_[_0x7d82('0x3c')](_0x4edd62[_0x7d82('0x38')],{'$or':_[_0x7d82('0x2e')](_0x53cf9e,function(_0x5095d8){if(_0x5095d8[_0x7d82('0x2b')]!=='VIRTUAL'){var _0x1d0910={};_0x1d0910[_0x5095d8['name']]={'$like':'%'+_0xf62b89['query'][_0x7d82('0x3b')]+'%'};return _0x1d0910;}})});}_0x4edd62=_['merge']({},_0x4edd62,_0xf62b89[_0x7d82('0x3d')]);var _0x13ff82={'where':_0x4edd62[_0x7d82('0x38')]};return db[_0x7d82('0x3e')]['count'](_0x13ff82)[_0x7d82('0x23')](function(_0x3178aa){_0xda952c[_0x7d82('0x1d')]=_0x3178aa;if(_0xf62b89[_0x7d82('0x2f')]['includeAll']){_0x4edd62['include']=[{'all':!![]}];}return db[_0x7d82('0x3e')][_0x7d82('0x3f')](_0x4edd62);})[_0x7d82('0x23')](function(_0x1b3ec7){_0xda952c['rows']=_0x1b3ec7;return _0xda952c;})['then'](respondWithFilteredResult(_0x530d52,_0x4edd62))[_0x7d82('0x40')](handleError(_0x530d52,null));};exports['show']=function(_0x514f8b,_0x55bc01){var _0x280aba={'raw':!![],'where':{'id':_0x514f8b[_0x7d82('0x41')]['id']}},_0x422be9={};_0x422be9[_0x7d82('0x2d')]=_[_0x7d82('0x30')](db['Dynamics365Field'][_0x7d82('0x42')]);_0x422be9[_0x7d82('0x2f')]=_[_0x7d82('0x30')](_0x514f8b[_0x7d82('0x2f')]);_0x422be9[_0x7d82('0x39')]=_['intersection'](_0x422be9[_0x7d82('0x2d')],_0x422be9[_0x7d82('0x2f')]);_0x280aba[_0x7d82('0x32')]=_['intersection'](_0x422be9[_0x7d82('0x2d')],qs[_0x7d82('0x33')](_0x514f8b['query']['fields']));_0x280aba['attributes']=_0x280aba[_0x7d82('0x32')][_0x7d82('0x43')]?_0x280aba['attributes']:_0x422be9['model'];if(_0x514f8b['query'][_0x7d82('0x44')]){_0x280aba[_0x7d82('0x45')]=[{'all':!![]}];}_0x280aba=_[_0x7d82('0x3c')]({},_0x280aba,_0x514f8b[_0x7d82('0x3d')]);return db[_0x7d82('0x3e')][_0x7d82('0x46')](_0x280aba)[_0x7d82('0x23')](handleEntityNotFound(_0x55bc01,null))[_0x7d82('0x23')](respondWithResult(_0x55bc01,null))[_0x7d82('0x40')](handleError(_0x55bc01,null));};exports[_0x7d82('0x47')]=function(_0x2c3c61,_0x2ffe33){return db[_0x7d82('0x3e')][_0x7d82('0x47')](_0x2c3c61['body'],{})[_0x7d82('0x23')](respondWithResult(_0x2ffe33,0xc9))['catch'](handleError(_0x2ffe33,null));};exports[_0x7d82('0x22')]=function(_0x508524,_0x1676e2){if(_0x508524[_0x7d82('0x48')]['id']){delete _0x508524['body']['id'];}return db[_0x7d82('0x3e')][_0x7d82('0x46')]({'where':{'id':_0x508524[_0x7d82('0x41')]['id']}})[_0x7d82('0x23')](handleEntityNotFound(_0x1676e2,null))[_0x7d82('0x23')](saveUpdates(_0x508524[_0x7d82('0x48')],null))[_0x7d82('0x23')](respondWithResult(_0x1676e2,null))[_0x7d82('0x40')](handleError(_0x1676e2,null));};exports[_0x7d82('0x24')]=function(_0x47158f,_0x19c7b6){return db[_0x7d82('0x3e')][_0x7d82('0x46')]({'where':{'id':_0x47158f[_0x7d82('0x41')]['id']}})[_0x7d82('0x23')](handleEntityNotFound(_0x19c7b6,null))[_0x7d82('0x23')](removeEntity(_0x19c7b6,null))[_0x7d82('0x40')](handleError(_0x19c7b6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 6147fb7..a078ebf 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 _0x1dee=['dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x1dee,0x14d));var _0xe1de=function(_0x201e29,_0x362efd){_0x201e29=_0x201e29-0x0;var _0x34d5f3=_0x1dee[_0x201e29];return _0x34d5f3;};'use strict';var _=require(_0xe1de('0x0'));var util=require(_0xe1de('0x1'));var logger=require(_0xe1de('0x2'))('api');var moment=require(_0xe1de('0x3'));var BPromise=require(_0xe1de('0x4'));var rp=require(_0xe1de('0x5'));var fs=require('fs');var path=require(_0xe1de('0x6'));var rimraf=require(_0xe1de('0x7'));var config=require(_0xe1de('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0xe1de('0x9')]=function(_0x3e8bf7,_0x46d853){return _0x3e8bf7[_0xe1de('0xa')](_0xe1de('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xe1de('0xc'),'fields':[_0xe1de('0xd'),_0xe1de('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9990=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x34b26f,_0xaa81d5){var _0x4f1536=function(_0x1ff693){while(--_0x1ff693){_0x34b26f['push'](_0x34b26f['shift']());}};_0x4f1536(++_0xaa81d5);}(_0x9990,0x7b));var _0x0999=function(_0x1a0717,_0x5273a8){_0x1a0717=_0x1a0717-0x0;var _0xa5f7a3=_0x9990[_0x1a0717];return _0xa5f7a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0999('0x0'))(_0x0999('0x1'));var moment=require(_0x0999('0x2'));var BPromise=require(_0x0999('0x3'));var rp=require(_0x0999('0x4'));var fs=require('fs');var path=require(_0x0999('0x5'));var rimraf=require(_0x0999('0x6'));var config=require(_0x0999('0x7'));var attributes=require(_0x0999('0x8'));module[_0x0999('0x9')]=function(_0x5c5468,_0xffdb17){return _0x5c5468[_0x0999('0xa')](_0x0999('0xb'),attributes,{'tableName':_0x0999('0xc'),'paranoid':![],'indexes':[{'name':_0x0999('0xd'),'fields':[_0x0999('0xe'),_0x0999('0xf')],'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 63fd3de..2c51f3f 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 _0xb84b=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x2ccbed,_0x30ad47){var _0x6a5b5=function(_0x2e0552){while(--_0x2e0552){_0x2ccbed['push'](_0x2ccbed['shift']());}};_0x6a5b5(++_0x30ad47);}(_0xb84b,0xf4));var _0xbb84=function(_0x3d6036,_0x262482){_0x3d6036=_0x3d6036-0x0;var _0x24bbaa=_0xb84b[_0x3d6036];return _0x24bbaa;};'use strict';var _=require(_0xbb84('0x0'));var util=require(_0xbb84('0x1'));var moment=require('moment');var BPromise=require(_0xbb84('0x2'));var rs=require(_0xbb84('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbb84('0x4'));var logger=require(_0xbb84('0x5'))(_0xbb84('0x6'));var config=require('../../config/environment');var jayson=require(_0xbb84('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b514a,_0x39b04a,_0x320132){return new BPromise(function(_0x226dc1,_0x4fb7e2){return client['request'](_0x4b514a,_0x320132)[_0xbb84('0x8')](function(_0x31904c){logger[_0xbb84('0x9')](_0xbb84('0xa'),_0x39b04a,_0xbb84('0xb'));logger[_0xbb84('0xc')](_0xbb84('0xd'),_0x39b04a,_0xbb84('0xb'),JSON['stringify'](_0x31904c));if(_0x31904c[_0xbb84('0xe')]){if(_0x31904c[_0xbb84('0xe')][_0xbb84('0xf')]===0x1f4){logger['error'](_0xbb84('0xa'),_0x39b04a,_0x31904c[_0xbb84('0xe')]['message']);return _0x4fb7e2(_0x31904c['error']['message']);}logger[_0xbb84('0xe')](_0xbb84('0xa'),_0x39b04a,_0x31904c['error'][_0xbb84('0x10')]);return _0x226dc1(_0x31904c[_0xbb84('0xe')][_0xbb84('0x10')]);}else{logger[_0xbb84('0x9')](_0xbb84('0xa'),_0x39b04a,_0xbb84('0xb'));_0x226dc1(_0x31904c[_0xbb84('0x11')]['message']);}})[_0xbb84('0x12')](function(_0x2ddb5c){logger[_0xbb84('0xe')](_0xbb84('0xa'),_0x39b04a,_0x2ddb5c);_0x4fb7e2(_0x2ddb5c);});});} \ No newline at end of file +var _0xe718=['randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x39ca7d,_0x922005){var _0x3ec63c=function(_0x409cce){while(--_0x409cce){_0x39ca7d['push'](_0x39ca7d['shift']());}};_0x3ec63c(++_0x922005);}(_0xe718,0x1dc));var _0x8e71=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0xe718[_0x420513];return _0x1b44ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e71('0x0'));var fs=require('fs');var Redis=require(_0x8e71('0x1'));var db=require(_0x8e71('0x2'))['db'];var utils=require(_0x8e71('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8e71('0x4')]({'port':0x232a});function respondWithRpcPromise(_0xa3873d,_0x2aa899,_0x398cec){return new BPromise(function(_0x51565a,_0x22bfad){return client[_0x8e71('0x5')](_0xa3873d,_0x398cec)[_0x8e71('0x6')](function(_0x104078){logger[_0x8e71('0x7')](_0x8e71('0x8'),_0x2aa899,_0x8e71('0x9'));logger[_0x8e71('0xa')](_0x8e71('0xb'),_0x2aa899,'request\x20sent',JSON[_0x8e71('0xc')](_0x104078));if(_0x104078[_0x8e71('0xd')]){if(_0x104078[_0x8e71('0xd')]['code']===0x1f4){logger[_0x8e71('0xd')](_0x8e71('0x8'),_0x2aa899,_0x104078[_0x8e71('0xd')][_0x8e71('0xe')]);return _0x22bfad(_0x104078[_0x8e71('0xd')]['message']);}logger[_0x8e71('0xd')](_0x8e71('0x8'),_0x2aa899,_0x104078['error'][_0x8e71('0xe')]);return _0x51565a(_0x104078[_0x8e71('0xd')][_0x8e71('0xe')]);}else{logger['info'](_0x8e71('0x8'),_0x2aa899,_0x8e71('0x9'));_0x51565a(_0x104078[_0x8e71('0xf')][_0x8e71('0xe')]);}})[_0x8e71('0x10')](function(_0x2bc339){logger[_0x8e71('0xd')](_0x8e71('0x8'),_0x2aa899,_0x2bc339);_0x22bfad(_0x2bc339);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index d08dee4..32d04fc 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 _0xc6f7=['express','Router','../../components/auth/service','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','exports','multer','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc6f7,0x115));var _0x7c6f=function(_0x42b18a,_0x2ff3bf){_0x42b18a=_0x42b18a-0x0;var _0x4f80be=_0xc6f7[_0x42b18a];return _0x4f80be;};'use strict';var multer=require(_0x7c6f('0x0'));var util=require('util');var path=require(_0x7c6f('0x1'));var timeout=require(_0x7c6f('0x2'));var express=require(_0x7c6f('0x3'));var router=express[_0x7c6f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7c6f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x7c6f('0x6')]('/',auth[_0x7c6f('0x7')](),controller[_0x7c6f('0x8')]);router['get']('/:id',auth[_0x7c6f('0x7')](),controller[_0x7c6f('0x9')]);router['get'](_0x7c6f('0xa'),auth[_0x7c6f('0x7')](),controller[_0x7c6f('0xb')]);router[_0x7c6f('0x6')](_0x7c6f('0xc'),auth[_0x7c6f('0x7')](),controller[_0x7c6f('0xd')]);router[_0x7c6f('0xe')]('/',auth[_0x7c6f('0x7')](),controller[_0x7c6f('0xf')]);router[_0x7c6f('0xe')]('/:id/configurations',auth[_0x7c6f('0x7')](),controller[_0x7c6f('0x10')]);router[_0x7c6f('0x11')](_0x7c6f('0x12'),auth[_0x7c6f('0x7')](),controller['update']);router['delete'](_0x7c6f('0x12'),auth[_0x7c6f('0x7')](),controller['destroy']);module[_0x7c6f('0x13')]=router; \ No newline at end of file +var _0x63aa=['put','/:id','update','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x63aa,0x88));var _0xa63a=function(_0x1c9e7a,_0x4fbfbf){_0x1c9e7a=_0x1c9e7a-0x0;var _0x3db960=_0x63aa[_0x1c9e7a];return _0x3db960;};'use strict';var multer=require(_0xa63a('0x0'));var util=require(_0xa63a('0x1'));var path=require('path');var timeout=require(_0xa63a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa63a('0x3'));var auth=require(_0xa63a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa63a('0x5'));var controller=require(_0xa63a('0x6'));router[_0xa63a('0x7')]('/',auth[_0xa63a('0x8')](),controller[_0xa63a('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa63a('0xa')]);router[_0xa63a('0x7')](_0xa63a('0xb'),auth[_0xa63a('0x8')](),controller[_0xa63a('0xc')]);router[_0xa63a('0x7')](_0xa63a('0xd'),auth[_0xa63a('0x8')](),controller[_0xa63a('0xe')]);router[_0xa63a('0xf')]('/',auth['isAuthenticated'](),controller[_0xa63a('0x10')]);router[_0xa63a('0xf')](_0xa63a('0xb'),auth[_0xa63a('0x8')](),controller[_0xa63a('0x11')]);router[_0xa63a('0x12')](_0xa63a('0x13'),auth[_0xa63a('0x8')](),controller[_0xa63a('0x14')]);router['delete'](_0xa63a('0x13'),auth[_0xa63a('0x8')](),controller['destroy']);module[_0xa63a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 9b86faa..3065939 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 _0x1967=['STRING','username','remoteUri','exports'];(function(_0x34366b,_0x248c3c){var _0x33921b=function(_0x55946a){while(--_0x55946a){_0x34366b['push'](_0x34366b['shift']());}};_0x33921b(++_0x248c3c);}(_0x1967,0x173));var _0x7196=function(_0x1f3453,_0x1edb31){_0x1f3453=_0x1f3453-0x0;var _0xd5403b=_0x1967[_0x1f3453];return _0xd5403b;};'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 +var _0x3423=['username','remoteUri','STRING'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')]},'description':{'type':Sequelize[_0x3342('0x0')]},'username':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1')},'apiKey':{'type':Sequelize[_0x3342('0x0')]},'remoteUri':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x2')},'serverUrl':{'type':Sequelize[_0x3342('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 2cdb449..e1bb2b9 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 _0x7072=['model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskAccount','count','includeAll','findAll','catch','show','fields','length','include','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','substring','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','custom_text','custom_dropdown','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x2ae489,_0x9f8183){var _0x144cd2=function(_0x3a62b7){while(--_0x3a62b7){_0x2ae489['push'](_0x2ae489['shift']());}};_0x144cd2(++_0x9f8183);}(_0x7072,0x138));var _0x2707=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x7072[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];var integrations=require(_0x2707('0x1a'));function respondWithStatusCode(_0x40d370,_0x5bf16e){_0x5bf16e=_0x5bf16e||0xcc;return function(_0x44c1d7){if(_0x44c1d7){return _0x40d370['sendStatus'](_0x5bf16e);}return _0x40d370[_0x2707('0x1b')](_0x5bf16e)[_0x2707('0x1c')]();};}function respondWithResult(_0xfe975c,_0x3a67f2){_0x3a67f2=_0x3a67f2||0xc8;return function(_0x13d9ac){if(_0x13d9ac){return _0xfe975c['status'](_0x3a67f2)[_0x2707('0x1d')](_0x13d9ac);}};}function respondWithFilteredResult(_0x1a687a,_0x2f6381){return function(_0x5d523f){if(_0x5d523f){var _0x1153d7=typeof _0x2f6381[_0x2707('0x1e')]===_0x2707('0x1f')&&typeof _0x2f6381[_0x2707('0x20')]===_0x2707('0x1f');var _0x27a3ea=_0x5d523f['count'];var _0x119ac4=_0x1153d7?0x0:_0x2f6381[_0x2707('0x1e')];var _0x4009f3=_0x1153d7?_0x5d523f['count']:_0x2f6381['offset']+_0x2f6381['limit'];var _0x1da4a6;if(_0x4009f3>=_0x27a3ea){_0x4009f3=_0x27a3ea;_0x1da4a6=0xc8;}else{_0x1da4a6=0xce;}_0x1a687a[_0x2707('0x1b')](_0x1da4a6);return _0x1a687a[_0x2707('0x21')](_0x2707('0x22'),_0x119ac4+'-'+_0x4009f3+'/'+_0x27a3ea)[_0x2707('0x1d')](_0x5d523f);}return null;};}function patchUpdates(_0x3c2935){return function(_0xab87f1){try{jsonpatch[_0x2707('0x23')](_0xab87f1,_0x3c2935,!![]);}catch(_0x1e50ea){return BPromise[_0x2707('0x24')](_0x1e50ea);}return _0xab87f1[_0x2707('0x25')]();};}function saveUpdates(_0x119df4,_0x454fde){return function(_0x1c0ffe){if(_0x1c0ffe){return _0x1c0ffe['update'](_0x119df4)[_0x2707('0x26')](function(_0x3b030a){return _0x3b030a;});}return null;};}function removeEntity(_0x46259e,_0x369e3a){return function(_0x378ca4){if(_0x378ca4){return _0x378ca4[_0x2707('0x27')]()['then'](function(){_0x46259e[_0x2707('0x1b')](0xcc)[_0x2707('0x1c')]();});}};}function handleEntityNotFound(_0x171add,_0x2ad386){return function(_0x5b763f){if(!_0x5b763f){_0x171add['sendStatus'](0x194);}return _0x5b763f;};}function handleError(_0x2dce16,_0x4ca05d){_0x4ca05d=_0x4ca05d||0x1f4;return function(_0x29dad2){logger[_0x2707('0x28')](_0x29dad2[_0x2707('0x29')]);if(_0x29dad2['name']){delete _0x29dad2[_0x2707('0x2a')];}_0x2dce16[_0x2707('0x1b')](_0x4ca05d)[_0x2707('0x2b')](_0x29dad2);};}exports['index']=function(_0x31e990,_0x42adf8){var _0x4a99ce={},_0xd63d3f={},_0x497c92={'count':0x0,'rows':[]};var _0x5aaffb=_[_0x2707('0x2c')](db['FreshdeskAccount'][_0x2707('0x2d')],function(_0x3f153d){return{'name':_0x3f153d[_0x2707('0x2e')],'type':_0x3f153d[_0x2707('0x2f')]['key']};});_0xd63d3f[_0x2707('0x30')]=_[_0x2707('0x2c')](_0x5aaffb,_0x2707('0x2a'));_0xd63d3f[_0x2707('0x31')]=_[_0x2707('0x32')](_0x31e990[_0x2707('0x31')]);_0xd63d3f[_0x2707('0x33')]=_[_0x2707('0x34')](_0xd63d3f[_0x2707('0x30')],_0xd63d3f['query']);_0x4a99ce[_0x2707('0x35')]=_[_0x2707('0x34')](_0xd63d3f['model'],qs['fields'](_0x31e990['query']['fields']));_0x4a99ce['attributes']=_0x4a99ce[_0x2707('0x35')]['length']?_0x4a99ce['attributes']:_0xd63d3f[_0x2707('0x30')];if(!_0x31e990[_0x2707('0x31')]['hasOwnProperty'](_0x2707('0x36'))){_0x4a99ce[_0x2707('0x20')]=qs['limit'](_0x31e990['query'][_0x2707('0x20')]);_0x4a99ce[_0x2707('0x1e')]=qs['offset'](_0x31e990['query'][_0x2707('0x1e')]);}_0x4a99ce[_0x2707('0x37')]=qs['sort'](_0x31e990[_0x2707('0x31')][_0x2707('0x38')]);_0x4a99ce[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x31e990[_0x2707('0x31')],_0xd63d3f['filters']),_0x5aaffb);if(_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]){_0x4a99ce[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x4a99ce[_0x2707('0x39')],{'$or':_[_0x2707('0x2c')](_0x5aaffb,function(_0x2700bf){if(_0x2700bf['type']!==_0x2707('0x3d')){var _0x2473e3={};_0x2473e3[_0x2700bf[_0x2707('0x2a')]]={'$like':'%'+_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x2473e3;}})});}_0x4a99ce=_[_0x2707('0x3c')]({},_0x4a99ce,_0x31e990[_0x2707('0x3e')]);var _0x39d9f6={'where':_0x4a99ce[_0x2707('0x39')]};return db[_0x2707('0x3f')][_0x2707('0x40')](_0x39d9f6)[_0x2707('0x26')](function(_0x2a221c){_0x497c92[_0x2707('0x40')]=_0x2a221c;if(_0x31e990[_0x2707('0x31')][_0x2707('0x41')]){_0x4a99ce['include']=[{'all':!![]}];}return db[_0x2707('0x3f')][_0x2707('0x42')](_0x4a99ce);})['then'](function(_0x358aa8){_0x497c92['rows']=_0x358aa8;return _0x497c92;})[_0x2707('0x26')](respondWithFilteredResult(_0x42adf8,_0x4a99ce))[_0x2707('0x43')](handleError(_0x42adf8,null));};exports[_0x2707('0x44')]=function(_0x1d69d3,_0x13e1c0){var _0xdeec24={'raw':![],'where':{'id':_0x1d69d3['params']['id']}},_0x26b464={};_0x26b464[_0x2707('0x30')]=_[_0x2707('0x32')](db['FreshdeskAccount'][_0x2707('0x2d')]);_0x26b464[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1d69d3['query']);_0x26b464['filters']=_[_0x2707('0x34')](_0x26b464[_0x2707('0x30')],_0x26b464['query']);_0xdeec24[_0x2707('0x35')]=_['intersection'](_0x26b464[_0x2707('0x30')],qs[_0x2707('0x45')](_0x1d69d3[_0x2707('0x31')][_0x2707('0x45')]));_0xdeec24['attributes']=_0xdeec24[_0x2707('0x35')][_0x2707('0x46')]?_0xdeec24[_0x2707('0x35')]:_0x26b464[_0x2707('0x30')];if(_0x1d69d3[_0x2707('0x31')][_0x2707('0x41')]){_0xdeec24[_0x2707('0x47')]=[{'all':!![]}];}_0xdeec24=_['merge']({},_0xdeec24,_0x1d69d3[_0x2707('0x3e')]);return db[_0x2707('0x3f')][_0x2707('0x48')](_0xdeec24)[_0x2707('0x26')](handleEntityNotFound(_0x13e1c0,null))[_0x2707('0x26')](respondWithResult(_0x13e1c0,null))['catch'](handleError(_0x13e1c0,null));};exports[_0x2707('0x49')]=function(_0x4a6eea,_0xf96f41){return db[_0x2707('0x3f')]['create'](_0x4a6eea[_0x2707('0x4a')],{})[_0x2707('0x26')](respondWithResult(_0xf96f41,0xc9))[_0x2707('0x43')](handleError(_0xf96f41,null));};exports['update']=function(_0x1a8034,_0x59c60f){if(_0x1a8034[_0x2707('0x4a')]['id']){delete _0x1a8034[_0x2707('0x4a')]['id'];}return db['FreshdeskAccount'][_0x2707('0x48')]({'where':{'id':_0x1a8034[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x59c60f,null))['then'](saveUpdates(_0x1a8034['body'],null))[_0x2707('0x26')](respondWithResult(_0x59c60f,null))[_0x2707('0x43')](handleError(_0x59c60f,null));};exports[_0x2707('0x27')]=function(_0x2515dc,_0x463bf){return db['FreshdeskAccount']['find']({'where':{'id':_0x2515dc['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x463bf,null))[_0x2707('0x26')](removeEntity(_0x463bf,null))[_0x2707('0x43')](handleError(_0x463bf,null));};exports[_0x2707('0x4c')]=function(_0x1ffcce,_0x5b622c,_0xa2c4c0){var _0x2df682={};var _0x5c99fd={};var _0x482ed1;var _0x3b41b2;return db[_0x2707('0x3f')][_0x2707('0x4d')]({'where':{'id':_0x1ffcce['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x5b622c,null))[_0x2707('0x26')](function(_0x2a2a71){if(_0x2a2a71){_0x482ed1=_0x2a2a71;_0x5c99fd[_0x2707('0x30')]=_['keys'](db[_0x2707('0x4e')][_0x2707('0x2d')]);_0x5c99fd[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1ffcce[_0x2707('0x31')]);_0x5c99fd[_0x2707('0x33')]=_[_0x2707('0x34')](_0x5c99fd[_0x2707('0x30')],_0x5c99fd[_0x2707('0x31')]);_0x2df682[_0x2707('0x35')]=_['intersection'](_0x5c99fd[_0x2707('0x30')],qs['fields'](_0x1ffcce['query'][_0x2707('0x45')]));_0x2df682['attributes']=_0x2df682['attributes'][_0x2707('0x46')]?_0x2df682[_0x2707('0x35')]:_0x5c99fd[_0x2707('0x30')];_0x2df682[_0x2707('0x37')]=qs[_0x2707('0x38')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x38')]);_0x2df682[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x1ffcce[_0x2707('0x31')],_0x5c99fd['filters']));if(_0x1ffcce['query']['filter']){_0x2df682[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x2df682[_0x2707('0x39')],{'$or':_['map'](_0x2df682['attributes'],function(_0x33ce37){var _0x39c9b4={};_0x39c9b4[_0x33ce37]={'$like':'%'+_0x1ffcce[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x39c9b4;})});}_0x2df682=_[_0x2707('0x3c')]({},_0x2df682,_0x1ffcce['options']);return _0x482ed1['getConfigurations'](_0x2df682);}})[_0x2707('0x26')](function(_0x6a3e8d){if(_0x6a3e8d){_0x3b41b2=_0x6a3e8d[_0x2707('0x46')];if(!_0x1ffcce[_0x2707('0x31')][_0x2707('0x4f')](_0x2707('0x36'))){_0x2df682[_0x2707('0x20')]=qs[_0x2707('0x20')](_0x1ffcce[_0x2707('0x31')]['limit']);_0x2df682[_0x2707('0x1e')]=qs[_0x2707('0x1e')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x1e')]);}return _0x482ed1[_0x2707('0x4c')](_0x2df682);}})[_0x2707('0x26')](function(_0x519042){if(_0x519042){return _0x519042?{'count':_0x3b41b2,'rows':_0x519042}:null;}})['then'](respondWithResult(_0x5b622c,null))[_0x2707('0x43')](handleError(_0x5b622c,null));};exports[_0x2707('0x50')]=function(_0x4eb8eb,_0x58fefc,_0x4f14e0){if(_0x4eb8eb['body']['id']){delete _0x4eb8eb[_0x2707('0x4a')]['id'];}return db[_0x2707('0x3f')]['findOne']({'where':{'id':_0x4eb8eb[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x58fefc,null))[_0x2707('0x26')](function(_0x5bad5a){if(_0x5bad5a){_0x4eb8eb['body'][_0x2707('0x51')]=_0x5bad5a['id'];_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x52')]=integrations[_0x2707('0x53')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x55')]=integrations[_0x2707('0x56')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);return db[_0x2707('0x4e')][_0x2707('0x49')](_0x4eb8eb[_0x2707('0x4a')],{'include':[{'model':db[_0x2707('0x57')],'as':_0x2707('0x52')},{'model':db[_0x2707('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x58fefc,null))[_0x2707('0x43')](handleError(_0x58fefc,null));};exports[_0x2707('0x58')]=function(_0x354322,_0x42da4e,_0x3ae5c6){var _0x2af149='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x354322[_0x2707('0x4b')]['id']},'attributes':['id','remoteUri',_0x2707('0x59')]})[_0x2707('0x26')](handleEntityNotFound(_0x42da4e,null))[_0x2707('0x26')](function(_0x3015d4){if(_0x3015d4){_0x2af149=_0x3015d4[_0x2707('0x5a')];var _0x1783e1=_0x2af149['slice'](-0x1);if(_0x1783e1==='/'){_0x2af149=_0x2af149[_0x2707('0x5b')](0x0,_0x2af149['lastIndexOf'](_0x1783e1));}return rp({'method':_0x2707('0x5c'),'uri':util[_0x2707('0x5d')]('%s/%s',_0x2af149,_0x2707('0x5e')),'headers':{'Authorization':util[_0x2707('0x5d')](_0x2707('0x5f'),new Buffer(util[_0x2707('0x5d')](_0x2707('0x60'),_0x3015d4['apiKey']))[_0x2707('0x61')](_0x2707('0x62')))},'json':!![]});}})[_0x2707('0x26')](function(_0x44f340){if(_0x44f340){var _0x7e505c=[_0x2707('0x63'),_0x2707('0x64'),_0x2707('0x65'),_0x2707('0x66'),_0x2707('0x1b'),_0x2707('0x67'),_0x2707('0x68'),_0x2707('0x69'),_0x2707('0x6a'),_0x2707('0x68'),_0x2707('0x6b')];_[_0x2707('0x6c')](_0x44f340,function(_0x43830c){return _0x7e505c['includes'](_0x43830c[_0x2707('0x2a')])||!_0x43830c['default']&&_0x43830c['type']!==_0x2707('0x6d')&&_0x43830c[_0x2707('0x2f')]!==_0x2707('0x6e');});return{'count':_0x44f340[_0x2707('0x46')],'rows':_[_0x2707('0x2c')](_0x44f340,function(_0x2e04e6){return{'id':_0x2e04e6['name'],'name':_0x2e04e6[_0x2707('0x6f')],'custom':!_0x2e04e6[_0x2707('0x70')],'options':_0x2e04e6[_0x2707('0x71')]?_['map'](_0x2e04e6[_0x2707('0x71')],function(_0x378f14){return{'name':_[_0x2707('0x72')](_0x378f14),'value':_0x378f14};}):[]};})};}})[_0x2707('0x26')](respondWithResult(_0x42da4e,null))['catch'](function(_0xc091da){var _0x5c68d6=_0x354322[_0x2707('0x31')][_0x2707('0x73')]?0x1f4:_0xc091da[_0x2707('0x74')]||0x1f4;logger[_0x2707('0x28')](_0x2707('0x75'),_0x2707('0x58'),_0x5c68d6,JSON[_0x2707('0x76')](_0xc091da));delete _0xc091da[_0x2707('0x2a')];if(_0x5c68d6===0x191){_0x5c68d6=0x190;}_0x42da4e[_0x2707('0x1b')](_0x5c68d6)['send'](_0x354322[_0x2707('0x31')]['test']?{'message':_0x2707('0x77'),'statusCode':_0xc091da[_0x2707('0x74')]}:_0xc091da);});}; \ No newline at end of file +var _0xbaf0=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','pick','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','requester','subject','agent','description','priority','group','company','remove','includes','default','custom_dropdown','label','choices','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model'];(function(_0x23c414,_0x384264){var _0x50915f=function(_0x427d2){while(--_0x427d2){_0x23c414['push'](_0x23c414['shift']());}};_0x50915f(++_0x384264);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0baf('0x1b'));function respondWithStatusCode(_0xe4378c,_0x5db689){_0x5db689=_0x5db689||0xcc;return function(_0x13df17){if(_0x13df17){return _0xe4378c['sendStatus'](_0x5db689);}return _0xe4378c[_0x0baf('0x1c')](_0x5db689)['end']();};}function respondWithResult(_0x1c76a8,_0x1f50c3){_0x1f50c3=_0x1f50c3||0xc8;return function(_0x7fbf67){if(_0x7fbf67){return _0x1c76a8[_0x0baf('0x1c')](_0x1f50c3)[_0x0baf('0x1d')](_0x7fbf67);}};}function respondWithFilteredResult(_0x469599,_0x4f80a8){return function(_0x4cd79d){if(_0x4cd79d){var _0x2312c7=typeof _0x4f80a8[_0x0baf('0x1e')]===_0x0baf('0x1f')&&typeof _0x4f80a8[_0x0baf('0x20')]===_0x0baf('0x1f');var _0x288a98=_0x4cd79d['count'];var _0x63c820=_0x2312c7?0x0:_0x4f80a8[_0x0baf('0x1e')];var _0x1ef0e5=_0x2312c7?_0x4cd79d[_0x0baf('0x21')]:_0x4f80a8[_0x0baf('0x1e')]+_0x4f80a8[_0x0baf('0x20')];var _0x4ff793;if(_0x1ef0e5>=_0x288a98){_0x1ef0e5=_0x288a98;_0x4ff793=0xc8;}else{_0x4ff793=0xce;}_0x469599['status'](_0x4ff793);return _0x469599[_0x0baf('0x22')](_0x0baf('0x23'),_0x63c820+'-'+_0x1ef0e5+'/'+_0x288a98)[_0x0baf('0x1d')](_0x4cd79d);}return null;};}function patchUpdates(_0x1848e8){return function(_0x1fa92b){try{jsonpatch[_0x0baf('0x24')](_0x1fa92b,_0x1848e8,!![]);}catch(_0x210cd8){return BPromise[_0x0baf('0x25')](_0x210cd8);}return _0x1fa92b[_0x0baf('0x26')]();};}function saveUpdates(_0x15a2c3,_0x54f2fa){return function(_0x334bd6){if(_0x334bd6){return _0x334bd6['update'](_0x15a2c3)[_0x0baf('0x27')](function(_0x5dbf00){return _0x5dbf00;});}return null;};}function removeEntity(_0x4de74c,_0x2ef0aa){return function(_0x48a0e9){if(_0x48a0e9){return _0x48a0e9['destroy']()[_0x0baf('0x27')](function(){_0x4de74c[_0x0baf('0x1c')](0xcc)[_0x0baf('0x28')]();});}};}function handleEntityNotFound(_0x19d9fd,_0x3a1ba1){return function(_0x56b299){if(!_0x56b299){_0x19d9fd[_0x0baf('0x29')](0x194);}return _0x56b299;};}function handleError(_0x4681c5,_0x1ca35a){_0x1ca35a=_0x1ca35a||0x1f4;return function(_0x366e71){logger[_0x0baf('0x2a')](_0x366e71[_0x0baf('0x2b')]);if(_0x366e71[_0x0baf('0x2c')]){delete _0x366e71['name'];}_0x4681c5[_0x0baf('0x1c')](_0x1ca35a)[_0x0baf('0x2d')](_0x366e71);};}exports[_0x0baf('0x2e')]=function(_0x265915,_0x55c715){var _0x29dbdf={},_0x34a58a={},_0x5d9d7f={'count':0x0,'rows':[]};var _0x44ec31=_[_0x0baf('0x2f')](db[_0x0baf('0x30')][_0x0baf('0x31')],function(_0xd14f0f){return{'name':_0xd14f0f[_0x0baf('0x32')],'type':_0xd14f0f[_0x0baf('0x33')]['key']};});_0x34a58a[_0x0baf('0x34')]=_[_0x0baf('0x2f')](_0x44ec31,_0x0baf('0x2c'));_0x34a58a[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x265915[_0x0baf('0x35')]);_0x34a58a[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x34a58a[_0x0baf('0x34')],_0x34a58a[_0x0baf('0x35')]);_0x29dbdf[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x34a58a[_0x0baf('0x34')],qs[_0x0baf('0x3a')](_0x265915['query'][_0x0baf('0x3a')]));_0x29dbdf['attributes']=_0x29dbdf[_0x0baf('0x39')][_0x0baf('0x3b')]?_0x29dbdf[_0x0baf('0x39')]:_0x34a58a[_0x0baf('0x34')];if(!_0x265915['query'][_0x0baf('0x3c')](_0x0baf('0x3d'))){_0x29dbdf['limit']=qs[_0x0baf('0x20')](_0x265915[_0x0baf('0x35')][_0x0baf('0x20')]);_0x29dbdf[_0x0baf('0x1e')]=qs[_0x0baf('0x1e')](_0x265915[_0x0baf('0x35')][_0x0baf('0x1e')]);}_0x29dbdf[_0x0baf('0x3e')]=qs['sort'](_0x265915[_0x0baf('0x35')][_0x0baf('0x3f')]);_0x29dbdf['where']=qs[_0x0baf('0x37')](_['pick'](_0x265915['query'],_0x34a58a[_0x0baf('0x37')]),_0x44ec31);if(_0x265915[_0x0baf('0x35')]['filter']){_0x29dbdf['where']=_[_0x0baf('0x40')](_0x29dbdf[_0x0baf('0x41')],{'$or':_[_0x0baf('0x2f')](_0x44ec31,function(_0xb2d9ab){if(_0xb2d9ab[_0x0baf('0x33')]!==_0x0baf('0x42')){var _0x290464={};_0x290464[_0xb2d9ab[_0x0baf('0x2c')]]={'$like':'%'+_0x265915[_0x0baf('0x35')][_0x0baf('0x43')]+'%'};return _0x290464;}})});}_0x29dbdf=_[_0x0baf('0x40')]({},_0x29dbdf,_0x265915[_0x0baf('0x44')]);var _0x354cb1={'where':_0x29dbdf[_0x0baf('0x41')]};return db['FreshdeskAccount'][_0x0baf('0x21')](_0x354cb1)[_0x0baf('0x27')](function(_0x4f1de9){_0x5d9d7f[_0x0baf('0x21')]=_0x4f1de9;if(_0x265915[_0x0baf('0x35')][_0x0baf('0x45')]){_0x29dbdf[_0x0baf('0x46')]=[{'all':!![]}];}return db[_0x0baf('0x30')][_0x0baf('0x47')](_0x29dbdf);})['then'](function(_0x23ad34){_0x5d9d7f[_0x0baf('0x48')]=_0x23ad34;return _0x5d9d7f;})['then'](respondWithFilteredResult(_0x55c715,_0x29dbdf))[_0x0baf('0x49')](handleError(_0x55c715,null));};exports[_0x0baf('0x4a')]=function(_0x45c6aa,_0x57903e){var _0x504031={'raw':![],'where':{'id':_0x45c6aa[_0x0baf('0x4b')]['id']}},_0x193fd3={};_0x193fd3[_0x0baf('0x34')]=_[_0x0baf('0x36')](db[_0x0baf('0x30')][_0x0baf('0x31')]);_0x193fd3[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x45c6aa[_0x0baf('0x35')]);_0x193fd3[_0x0baf('0x37')]=_['intersection'](_0x193fd3[_0x0baf('0x34')],_0x193fd3[_0x0baf('0x35')]);_0x504031[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x193fd3[_0x0baf('0x34')],qs['fields'](_0x45c6aa[_0x0baf('0x35')][_0x0baf('0x3a')]));_0x504031[_0x0baf('0x39')]=_0x504031[_0x0baf('0x39')][_0x0baf('0x3b')]?_0x504031['attributes']:_0x193fd3[_0x0baf('0x34')];if(_0x45c6aa[_0x0baf('0x35')][_0x0baf('0x45')]){_0x504031[_0x0baf('0x46')]=[{'all':!![]}];}_0x504031=_[_0x0baf('0x40')]({},_0x504031,_0x45c6aa[_0x0baf('0x44')]);return db[_0x0baf('0x30')]['find'](_0x504031)[_0x0baf('0x27')](handleEntityNotFound(_0x57903e,null))[_0x0baf('0x27')](respondWithResult(_0x57903e,null))[_0x0baf('0x49')](handleError(_0x57903e,null));};exports['create']=function(_0x3c9de3,_0x2222b6){return db[_0x0baf('0x30')][_0x0baf('0x4c')](_0x3c9de3[_0x0baf('0x4d')],{})[_0x0baf('0x27')](respondWithResult(_0x2222b6,0xc9))[_0x0baf('0x49')](handleError(_0x2222b6,null));};exports['update']=function(_0x22c451,_0x428c9b){if(_0x22c451[_0x0baf('0x4d')]['id']){delete _0x22c451[_0x0baf('0x4d')]['id'];}return db[_0x0baf('0x30')][_0x0baf('0x4e')]({'where':{'id':_0x22c451[_0x0baf('0x4b')]['id']}})[_0x0baf('0x27')](handleEntityNotFound(_0x428c9b,null))[_0x0baf('0x27')](saveUpdates(_0x22c451[_0x0baf('0x4d')],null))[_0x0baf('0x27')](respondWithResult(_0x428c9b,null))['catch'](handleError(_0x428c9b,null));};exports['destroy']=function(_0x354329,_0x3d6b19){return db[_0x0baf('0x30')][_0x0baf('0x4e')]({'where':{'id':_0x354329[_0x0baf('0x4b')]['id']}})[_0x0baf('0x27')](handleEntityNotFound(_0x3d6b19,null))[_0x0baf('0x27')](removeEntity(_0x3d6b19,null))['catch'](handleError(_0x3d6b19,null));};exports[_0x0baf('0x4f')]=function(_0x2ef4c1,_0xf2424,_0x16d9fb){var _0x3fdb41={};var _0x1e2671={};var _0x5e1849;var _0x3eebe5;return db['FreshdeskAccount'][_0x0baf('0x50')]({'where':{'id':_0x2ef4c1['params']['id']}})[_0x0baf('0x27')](handleEntityNotFound(_0xf2424,null))['then'](function(_0x35b1a5){if(_0x35b1a5){_0x5e1849=_0x35b1a5;_0x1e2671['model']=_[_0x0baf('0x36')](db[_0x0baf('0x51')][_0x0baf('0x31')]);_0x1e2671[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x2ef4c1['query']);_0x1e2671[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x1e2671[_0x0baf('0x34')],_0x1e2671[_0x0baf('0x35')]);_0x3fdb41[_0x0baf('0x39')]=_[_0x0baf('0x38')](_0x1e2671['model'],qs[_0x0baf('0x3a')](_0x2ef4c1[_0x0baf('0x35')][_0x0baf('0x3a')]));_0x3fdb41[_0x0baf('0x39')]=_0x3fdb41[_0x0baf('0x39')][_0x0baf('0x3b')]?_0x3fdb41[_0x0baf('0x39')]:_0x1e2671['model'];_0x3fdb41['order']=qs[_0x0baf('0x3f')](_0x2ef4c1[_0x0baf('0x35')][_0x0baf('0x3f')]);_0x3fdb41[_0x0baf('0x41')]=qs[_0x0baf('0x37')](_[_0x0baf('0x52')](_0x2ef4c1[_0x0baf('0x35')],_0x1e2671[_0x0baf('0x37')]));if(_0x2ef4c1[_0x0baf('0x35')]['filter']){_0x3fdb41[_0x0baf('0x41')]=_[_0x0baf('0x40')](_0x3fdb41[_0x0baf('0x41')],{'$or':_[_0x0baf('0x2f')](_0x3fdb41[_0x0baf('0x39')],function(_0xebfc0c){var _0x26f5c9={};_0x26f5c9[_0xebfc0c]={'$like':'%'+_0x2ef4c1['query'][_0x0baf('0x43')]+'%'};return _0x26f5c9;})});}_0x3fdb41=_[_0x0baf('0x40')]({},_0x3fdb41,_0x2ef4c1[_0x0baf('0x44')]);return _0x5e1849[_0x0baf('0x4f')](_0x3fdb41);}})[_0x0baf('0x27')](function(_0x1a6d22){if(_0x1a6d22){_0x3eebe5=_0x1a6d22[_0x0baf('0x3b')];if(!_0x2ef4c1[_0x0baf('0x35')]['hasOwnProperty'](_0x0baf('0x3d'))){_0x3fdb41['limit']=qs[_0x0baf('0x20')](_0x2ef4c1['query']['limit']);_0x3fdb41[_0x0baf('0x1e')]=qs['offset'](_0x2ef4c1[_0x0baf('0x35')][_0x0baf('0x1e')]);}return _0x5e1849['getConfigurations'](_0x3fdb41);}})[_0x0baf('0x27')](function(_0xfb6708){if(_0xfb6708){return _0xfb6708?{'count':_0x3eebe5,'rows':_0xfb6708}:null;}})[_0x0baf('0x27')](respondWithResult(_0xf2424,null))['catch'](handleError(_0xf2424,null));};exports['addConfiguration']=function(_0x2438df,_0x7e8946,_0x6d789f){if(_0x2438df[_0x0baf('0x4d')]['id']){delete _0x2438df[_0x0baf('0x4d')]['id'];}return db['FreshdeskAccount'][_0x0baf('0x50')]({'where':{'id':_0x2438df['params']['id']}})['then'](handleEntityNotFound(_0x7e8946,null))['then'](function(_0x427ed1){if(_0x427ed1){_0x2438df['body']['AccountId']=_0x427ed1['id'];_0x2438df[_0x0baf('0x4d')][_0x0baf('0x53')]=integrations[_0x0baf('0x54')](_0x2438df[_0x0baf('0x4d')][_0x0baf('0x55')],_0x2438df[_0x0baf('0x4d')]['type']);_0x2438df[_0x0baf('0x4d')][_0x0baf('0x56')]=integrations[_0x0baf('0x57')](_0x2438df[_0x0baf('0x4d')][_0x0baf('0x55')],_0x2438df[_0x0baf('0x4d')]['type']);return db[_0x0baf('0x51')][_0x0baf('0x4c')](_0x2438df[_0x0baf('0x4d')],{'include':[{'model':db['FreshdeskField'],'as':_0x0baf('0x53')},{'model':db[_0x0baf('0x58')],'as':_0x0baf('0x56')}]});}return null;})[_0x0baf('0x27')](respondWithResult(_0x7e8946,null))[_0x0baf('0x49')](handleError(_0x7e8946,null));};exports[_0x0baf('0x59')]=function(_0x4cc046,_0x5874cc,_0x54353a){var _0x4b7caa='';return db[_0x0baf('0x30')][_0x0baf('0x50')]({'where':{'id':_0x4cc046[_0x0baf('0x4b')]['id']},'attributes':['id',_0x0baf('0x5a'),_0x0baf('0x5b')]})[_0x0baf('0x27')](handleEntityNotFound(_0x5874cc,null))['then'](function(_0x591ea6){if(_0x591ea6){_0x4b7caa=_0x591ea6[_0x0baf('0x5a')];var _0x519b30=_0x4b7caa[_0x0baf('0x5c')](-0x1);if(_0x519b30==='/'){_0x4b7caa=_0x4b7caa[_0x0baf('0x5d')](0x0,_0x4b7caa['lastIndexOf'](_0x519b30));}return rp({'method':_0x0baf('0x5e'),'uri':util[_0x0baf('0x5f')](_0x0baf('0x60'),_0x4b7caa,_0x0baf('0x61')),'headers':{'Authorization':util[_0x0baf('0x5f')](_0x0baf('0x62'),new Buffer(util[_0x0baf('0x5f')](_0x0baf('0x63'),_0x591ea6[_0x0baf('0x5b')]))['toString']('base64'))},'json':!![]});}})['then'](function(_0x493784){if(_0x493784){var _0x5361a5=[_0x0baf('0x64'),_0x0baf('0x65'),_0x0baf('0x66'),_0x0baf('0x67'),'status',_0x0baf('0x68'),_0x0baf('0x69'),'source','ticket_type',_0x0baf('0x69'),_0x0baf('0x6a')];_[_0x0baf('0x6b')](_0x493784,function(_0x442e5f){return _0x5361a5[_0x0baf('0x6c')](_0x442e5f[_0x0baf('0x2c')])||!_0x442e5f[_0x0baf('0x6d')]&&_0x442e5f[_0x0baf('0x33')]!=='custom_text'&&_0x442e5f[_0x0baf('0x33')]!==_0x0baf('0x6e');});return{'count':_0x493784['length'],'rows':_[_0x0baf('0x2f')](_0x493784,function(_0x2db4ec){return{'id':_0x2db4ec['name'],'name':_0x2db4ec[_0x0baf('0x6f')],'custom':!_0x2db4ec[_0x0baf('0x6d')],'options':_0x2db4ec[_0x0baf('0x70')]?_[_0x0baf('0x2f')](_0x2db4ec[_0x0baf('0x70')],function(_0x4fc5af){return{'name':_['capitalize'](_0x4fc5af),'value':_0x4fc5af};}):[]};})};}})[_0x0baf('0x27')](respondWithResult(_0x5874cc,null))[_0x0baf('0x49')](function(_0x5dcd9e){var _0x28bc1c=_0x4cc046[_0x0baf('0x35')][_0x0baf('0x71')]?0x1f4:_0x5dcd9e['statusCode']||0x1f4;logger[_0x0baf('0x2a')](_0x0baf('0x72'),_0x0baf('0x59'),_0x28bc1c,JSON['stringify'](_0x5dcd9e));delete _0x5dcd9e[_0x0baf('0x2c')];if(_0x28bc1c===0x191){_0x28bc1c=0x190;}_0x5874cc['status'](_0x28bc1c)[_0x0baf('0x2d')](_0x4cc046[_0x0baf('0x35')][_0x0baf('0x71')]?{'message':_0x0baf('0x73'),'statusCode':_0x5dcd9e[_0x0baf('0x74')]}:_0x5dcd9e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 027f84b..2240116 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 _0x4440=['path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api','bluebird','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4440,0xe0));var _0x0444=function(_0x444f22,_0x5bda95){_0x444f22=_0x444f22-0x0;var _0x44a969=_0x4440[_0x444f22];return _0x44a969;};'use strict';var _=require(_0x0444('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0444('0x1'));var moment=require('moment');var BPromise=require(_0x0444('0x2'));var rp=require(_0x0444('0x3'));var fs=require('fs');var path=require(_0x0444('0x4'));var rimraf=require('rimraf');var config=require(_0x0444('0x5'));var attributes=require(_0x0444('0x6'));var integrations=require(_0x0444('0x7'));module[_0x0444('0x8')]=function(_0x24a6da,_0x3e1738){return _0x24a6da[_0x0444('0x9')](_0x0444('0xa'),attributes,{'tableName':_0x0444('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79e7=['exports','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x79e7,0x1a5));var _0x779e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x79e7[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x779e('0x0'));var logger=require(_0x779e('0x1'))(_0x779e('0x2'));var moment=require(_0x779e('0x3'));var BPromise=require(_0x779e('0x4'));var rp=require(_0x779e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x779e('0x6'));var attributes=require(_0x779e('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x779e('0x8')]=function(_0x8d98a8,_0x42c164){return _0x8d98a8['define'](_0x779e('0x9'),attributes,{'tableName':_0x779e('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 82f8059..5d8c33b 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 _0xc414=['debug','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','map','include','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x5acf93,_0x1ddebe){var _0x468fa0=function(_0x5e3016){while(--_0x5e3016){_0x5acf93['push'](_0x5acf93['shift']());}};_0x468fa0(++_0x1ddebe);}(_0xc414,0x1c0));var _0x4c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc414[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c41('0x0'));var util=require(_0x4c41('0x1'));var moment=require(_0x4c41('0x2'));var BPromise=require(_0x4c41('0x3'));var rs=require(_0x4c41('0x4'));var fs=require('fs');var Redis=require(_0x4c41('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c41('0x6'))(_0x4c41('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4c41('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e8f13,_0x5b898f,_0x436807){return new BPromise(function(_0x33f718,_0x2c50da){return client[_0x4c41('0x9')](_0x2e8f13,_0x436807)[_0x4c41('0xa')](function(_0x197b14){logger[_0x4c41('0xb')](_0x4c41('0xc'),_0x5b898f,_0x4c41('0xd'));logger[_0x4c41('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5b898f,_0x4c41('0xd'),JSON[_0x4c41('0xf')](_0x197b14));if(_0x197b14[_0x4c41('0x10')]){if(_0x197b14[_0x4c41('0x10')][_0x4c41('0x11')]===0x1f4){logger[_0x4c41('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x5b898f,_0x197b14[_0x4c41('0x10')]['message']);return _0x2c50da(_0x197b14[_0x4c41('0x10')][_0x4c41('0x12')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x5b898f,_0x197b14[_0x4c41('0x10')][_0x4c41('0x12')]);return _0x33f718(_0x197b14['error'][_0x4c41('0x12')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x5b898f,_0x4c41('0xd'));_0x33f718(_0x197b14[_0x4c41('0x13')]['message']);}})[_0x4c41('0x14')](function(_0x2abaa7){logger['error'](_0x4c41('0xc'),_0x5b898f,_0x2abaa7);_0x2c50da(_0x2abaa7);});});}exports[_0x4c41('0x15')]=function(_0x118cc4){var _0x18243b=this;return new Promise(function(_0x4c8997,_0x44bf0a){return db[_0x4c41('0x16')][_0x4c41('0x17')]({'raw':_0x118cc4[_0x4c41('0x18')]?_0x118cc4[_0x4c41('0x18')][_0x4c41('0x19')]===undefined?!![]:![]:!![],'where':_0x118cc4[_0x4c41('0x18')]?_0x118cc4['options'][_0x4c41('0x1a')]||null:null,'attributes':_0x118cc4[_0x4c41('0x18')]?_0x118cc4['options'][_0x4c41('0x1b')]||null:null,'limit':_0x118cc4[_0x4c41('0x18')]?_0x118cc4[_0x4c41('0x18')]['limit']||null:null,'include':_0x118cc4[_0x4c41('0x18')]?_0x118cc4[_0x4c41('0x18')]['include']?_[_0x4c41('0x1c')](_0x118cc4[_0x4c41('0x18')][_0x4c41('0x1d')],function(_0x29dc74){return{'model':db[_0x29dc74[_0x4c41('0x1e')]],'as':_0x29dc74['as'],'attributes':_0x29dc74[_0x4c41('0x1b')],'include':_0x29dc74[_0x4c41('0x1d')]?_[_0x4c41('0x1c')](_0x29dc74[_0x4c41('0x1d')],function(_0x59d08a){return{'model':db[_0x59d08a[_0x4c41('0x1e')]],'as':_0x59d08a['as'],'attributes':_0x59d08a[_0x4c41('0x1b')],'include':_0x59d08a['include']?_['map'](_0x59d08a[_0x4c41('0x1d')],function(_0x4b5909){return{'model':db[_0x4b5909[_0x4c41('0x1e')]],'as':_0x4b5909['as'],'attributes':_0x4b5909[_0x4c41('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4c41('0xa')](function(_0x4d0cef){logger[_0x4c41('0xb')](_0x4c41('0x15'),_0x118cc4);logger['debug']('GetFreshdeskAccount',_0x118cc4,JSON[_0x4c41('0xf')](_0x4d0cef));_0x4c8997(_0x4d0cef);})[_0x4c41('0x14')](function(_0xc636b0){logger[_0x4c41('0x10')]('GetFreshdeskAccount',_0xc636b0[_0x4c41('0x12')],_0x118cc4);_0x44bf0a(_0x18243b[_0x4c41('0x10')](0x1f4,_0xc636b0[_0x4c41('0x12')]));});});};exports[_0x4c41('0x1f')]=function(_0x6c85){var _0x2aab80=this;return new Promise(function(_0x335e01,_0x1470e7){return db[_0x4c41('0x16')][_0x4c41('0x20')]({'raw':_0x6c85[_0x4c41('0x18')]?_0x6c85[_0x4c41('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x6c85['options']?_0x6c85[_0x4c41('0x18')][_0x4c41('0x1a')]||null:null,'attributes':_0x6c85[_0x4c41('0x18')]?_0x6c85[_0x4c41('0x18')][_0x4c41('0x1b')]||null:null,'include':_0x6c85[_0x4c41('0x18')]?_0x6c85[_0x4c41('0x18')]['include']?_[_0x4c41('0x1c')](_0x6c85[_0x4c41('0x18')][_0x4c41('0x1d')],function(_0x487cb7){return{'model':db[_0x487cb7[_0x4c41('0x1e')]],'as':_0x487cb7['as'],'attributes':_0x487cb7[_0x4c41('0x1b')],'include':_0x487cb7['include']?_[_0x4c41('0x1c')](_0x487cb7[_0x4c41('0x1d')],function(_0x31aaec){return{'model':db[_0x31aaec[_0x4c41('0x1e')]],'as':_0x31aaec['as'],'attributes':_0x31aaec[_0x4c41('0x1b')],'include':_0x31aaec[_0x4c41('0x1d')]?_[_0x4c41('0x1c')](_0x31aaec[_0x4c41('0x1d')],function(_0x517142){return{'model':db[_0x517142[_0x4c41('0x1e')]],'as':_0x517142['as'],'attributes':_0x517142[_0x4c41('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4c41('0xa')](function(_0x2b1a2a){logger[_0x4c41('0xb')]('ShowFreshdeskAccount',_0x6c85);logger[_0x4c41('0xe')](_0x4c41('0x1f'),_0x6c85,JSON['stringify'](_0x2b1a2a));_0x335e01(_0x2b1a2a);})[_0x4c41('0x14')](function(_0x54c134){logger[_0x4c41('0x10')](_0x4c41('0x1f'),_0x54c134[_0x4c41('0x12')],_0x6c85);_0x1470e7(_0x2aab80[_0x4c41('0x10')](0x1f4,_0x54c134[_0x4c41('0x12')]));});});}; \ No newline at end of file +var _0xeca3=['limit','include','map','model','stringify','ShowFreshdeskAccount','FreshdeskAccount','where','then','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','findAll','options','raw','attributes'];(function(_0x410884,_0x261d01){var _0x1e86aa=function(_0x272e9a){while(--_0x272e9a){_0x410884['push'](_0x410884['shift']());}};_0x1e86aa(++_0x261d01);}(_0xeca3,0x8d));var _0x3eca=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xeca3[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3eca('0x0'));var BPromise=require(_0x3eca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3eca('0x2'));var db=require(_0x3eca('0x3'))['db'];var utils=require(_0x3eca('0x4'));var logger=require(_0x3eca('0x5'))('rpc');var config=require(_0x3eca('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3eca('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2808,_0x2732ff,_0x787b1){return new BPromise(function(_0x1286cd,_0x76a0ca){return client[_0x3eca('0x8')](_0x3a2808,_0x787b1)['then'](function(_0x4929a2){logger[_0x3eca('0x9')]('FreshdeskAccount,\x20%s,\x20%s',_0x2732ff,_0x3eca('0xa'));logger[_0x3eca('0xb')](_0x3eca('0xc'),_0x2732ff,_0x3eca('0xa'),JSON['stringify'](_0x4929a2));if(_0x4929a2['error']){if(_0x4929a2[_0x3eca('0xd')][_0x3eca('0xe')]===0x1f4){logger[_0x3eca('0xd')](_0x3eca('0xf'),_0x2732ff,_0x4929a2[_0x3eca('0xd')][_0x3eca('0x10')]);return _0x76a0ca(_0x4929a2[_0x3eca('0xd')]['message']);}logger[_0x3eca('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x2732ff,_0x4929a2['error']['message']);return _0x1286cd(_0x4929a2[_0x3eca('0xd')]['message']);}else{logger[_0x3eca('0x9')](_0x3eca('0xf'),_0x2732ff,_0x3eca('0xa'));_0x1286cd(_0x4929a2[_0x3eca('0x11')][_0x3eca('0x10')]);}})[_0x3eca('0x12')](function(_0x2ac977){logger[_0x3eca('0xd')](_0x3eca('0xf'),_0x2732ff,_0x2ac977);_0x76a0ca(_0x2ac977);});});}exports[_0x3eca('0x13')]=function(_0x165d58){var _0x221e10=this;return new Promise(function(_0x5a6db5,_0x2e6402){return db['FreshdeskAccount'][_0x3eca('0x14')]({'raw':_0x165d58[_0x3eca('0x15')]?_0x165d58[_0x3eca('0x15')][_0x3eca('0x16')]===undefined?!![]:![]:!![],'where':_0x165d58['options']?_0x165d58[_0x3eca('0x15')]['where']||null:null,'attributes':_0x165d58['options']?_0x165d58[_0x3eca('0x15')][_0x3eca('0x17')]||null:null,'limit':_0x165d58[_0x3eca('0x15')]?_0x165d58[_0x3eca('0x15')][_0x3eca('0x18')]||null:null,'include':_0x165d58[_0x3eca('0x15')]?_0x165d58[_0x3eca('0x15')][_0x3eca('0x19')]?_[_0x3eca('0x1a')](_0x165d58['options'][_0x3eca('0x19')],function(_0xbf0de5){return{'model':db[_0xbf0de5[_0x3eca('0x1b')]],'as':_0xbf0de5['as'],'attributes':_0xbf0de5[_0x3eca('0x17')],'include':_0xbf0de5[_0x3eca('0x19')]?_[_0x3eca('0x1a')](_0xbf0de5[_0x3eca('0x19')],function(_0x254a05){return{'model':db[_0x254a05['model']],'as':_0x254a05['as'],'attributes':_0x254a05[_0x3eca('0x17')],'include':_0x254a05[_0x3eca('0x19')]?_[_0x3eca('0x1a')](_0x254a05[_0x3eca('0x19')],function(_0x25272a){return{'model':db[_0x25272a[_0x3eca('0x1b')]],'as':_0x25272a['as'],'attributes':_0x25272a[_0x3eca('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1710f0){logger[_0x3eca('0x9')](_0x3eca('0x13'),_0x165d58);logger[_0x3eca('0xb')](_0x3eca('0x13'),_0x165d58,JSON[_0x3eca('0x1c')](_0x1710f0));_0x5a6db5(_0x1710f0);})[_0x3eca('0x12')](function(_0x4e12ed){logger['error'](_0x3eca('0x13'),_0x4e12ed['message'],_0x165d58);_0x2e6402(_0x221e10[_0x3eca('0xd')](0x1f4,_0x4e12ed['message']));});});};exports[_0x3eca('0x1d')]=function(_0x4484c2){var _0x55dccc=this;return new Promise(function(_0x3671fe,_0x513226){return db[_0x3eca('0x1e')]['find']({'raw':_0x4484c2[_0x3eca('0x15')]?_0x4484c2[_0x3eca('0x15')][_0x3eca('0x16')]===undefined?!![]:![]:!![],'where':_0x4484c2[_0x3eca('0x15')]?_0x4484c2[_0x3eca('0x15')][_0x3eca('0x1f')]||null:null,'attributes':_0x4484c2[_0x3eca('0x15')]?_0x4484c2[_0x3eca('0x15')]['attributes']||null:null,'include':_0x4484c2['options']?_0x4484c2['options'][_0x3eca('0x19')]?_['map'](_0x4484c2['options']['include'],function(_0x341113){return{'model':db[_0x341113[_0x3eca('0x1b')]],'as':_0x341113['as'],'attributes':_0x341113['attributes'],'include':_0x341113[_0x3eca('0x19')]?_[_0x3eca('0x1a')](_0x341113['include'],function(_0x7cb29f){return{'model':db[_0x7cb29f[_0x3eca('0x1b')]],'as':_0x7cb29f['as'],'attributes':_0x7cb29f['attributes'],'include':_0x7cb29f[_0x3eca('0x19')]?_[_0x3eca('0x1a')](_0x7cb29f[_0x3eca('0x19')],function(_0x39bbd3){return{'model':db[_0x39bbd3[_0x3eca('0x1b')]],'as':_0x39bbd3['as'],'attributes':_0x39bbd3[_0x3eca('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3eca('0x20')](function(_0x1c7a6a){logger['info']('ShowFreshdeskAccount',_0x4484c2);logger[_0x3eca('0xb')](_0x3eca('0x1d'),_0x4484c2,JSON[_0x3eca('0x1c')](_0x1c7a6a));_0x3671fe(_0x1c7a6a);})[_0x3eca('0x12')](function(_0x1ad877){logger[_0x3eca('0xd')](_0x3eca('0x1d'),_0x1ad877[_0x3eca('0x10')],_0x4484c2);_0x513226(_0x55dccc[_0x3eca('0xd')](0x1f4,_0x1ad877[_0x3eca('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 61156d9..5eeacd6 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 _0xc2e1=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','create','put','/:id','update'];(function(_0x46db9b,_0x1cd099){var _0x399090=function(_0x47d323){while(--_0x47d323){_0x46db9b['push'](_0x46db9b['shift']());}};_0x399090(++_0x1cd099);}(_0xc2e1,0x116));var _0x1c2e=function(_0xfd6940,_0x594df7){_0xfd6940=_0xfd6940-0x0;var _0x28d966=_0xc2e1[_0xfd6940];return _0x28d966;};'use strict';var multer=require(_0x1c2e('0x0'));var util=require('util');var path=require(_0x1c2e('0x1'));var timeout=require(_0x1c2e('0x2'));var express=require(_0x1c2e('0x3'));var router=express[_0x1c2e('0x4')]();var fs_extra=require(_0x1c2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1c2e('0x6'));var config=require(_0x1c2e('0x7'));var controller=require(_0x1c2e('0x8'));router[_0x1c2e('0x9')]('/',auth[_0x1c2e('0xa')](),controller['index']);router[_0x1c2e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1c2e('0xb')]);router[_0x1c2e('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1c2e('0xc')]);router['get'](_0x1c2e('0xd'),auth[_0x1c2e('0xa')](),controller[_0x1c2e('0xe')]);router[_0x1c2e('0x9')](_0x1c2e('0xf'),auth[_0x1c2e('0xa')](),controller['getDescriptions']);router[_0x1c2e('0x9')](_0x1c2e('0x10'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth[_0x1c2e('0xa')](),controller[_0x1c2e('0x11')]);router['post'](_0x1c2e('0x10'),auth[_0x1c2e('0xa')](),controller['setTags']);router[_0x1c2e('0x12')](_0x1c2e('0x13'),auth[_0x1c2e('0xa')](),controller[_0x1c2e('0x14')]);router[_0x1c2e('0x15')]('/:id',auth[_0x1c2e('0xa')](),controller['destroy']);module[_0x1c2e('0x16')]=router; \ No newline at end of file +var _0x7a61=['./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x457519,_0x18a39f){var _0x6c1449=function(_0x3574d5){while(--_0x3574d5){_0x457519['push'](_0x457519['shift']());}};_0x6c1449(++_0x18a39f);}(_0x7a61,0x119));var _0x17a6=function(_0x5c0aa3,_0x4d1d5a){_0x5c0aa3=_0x5c0aa3-0x0;var _0x2d5080=_0x7a61[_0x5c0aa3];return _0x2d5080;};'use strict';var multer=require('multer');var util=require(_0x17a6('0x0'));var path=require(_0x17a6('0x1'));var timeout=require(_0x17a6('0x2'));var express=require('express');var router=express[_0x17a6('0x3')]();var fs_extra=require(_0x17a6('0x4'));var auth=require(_0x17a6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x17a6('0x6'));var controller=require(_0x17a6('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x17a6('0x8')](_0x17a6('0x9'),auth[_0x17a6('0xa')](),controller[_0x17a6('0xb')]);router[_0x17a6('0x8')](_0x17a6('0xc'),auth[_0x17a6('0xa')](),controller[_0x17a6('0xd')]);router[_0x17a6('0x8')]('/:id/subjects',auth[_0x17a6('0xa')](),controller['getSubjects']);router[_0x17a6('0x8')](_0x17a6('0xe'),auth['isAuthenticated'](),controller[_0x17a6('0xf')]);router[_0x17a6('0x8')](_0x17a6('0x10'),auth[_0x17a6('0xa')](),controller[_0x17a6('0x11')]);router[_0x17a6('0x12')]('/',auth[_0x17a6('0xa')](),controller[_0x17a6('0x13')]);router[_0x17a6('0x12')]('/:id/tags',auth[_0x17a6('0xa')](),controller[_0x17a6('0x14')]);router[_0x17a6('0x15')]('/:id',auth[_0x17a6('0xa')](),controller['update']);router[_0x17a6('0x16')](_0x17a6('0x9'),auth[_0x17a6('0xa')](),controller[_0x17a6('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 087517c..700bb55 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 _0xc409=['exports','STRING','sequelize'];(function(_0xeed861,_0x144453){var _0x2d161e=function(_0x103b51){while(--_0x103b51){_0xeed861['push'](_0xeed861['shift']());}};_0x2d161e(++_0x144453);}(_0xc409,0x1a0));var _0x9c40=function(_0x5d8b2b,_0x57264f){_0x5d8b2b=_0x5d8b2b-0x0;var _0xb0f56=_0xc409[_0x5d8b2b];return _0xb0f56;};'use strict';var Sequelize=require(_0x9c40('0x0'));module[_0x9c40('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9c40('0x2')]}}; \ No newline at end of file +var _0x7c98=['exports','STRING','sequelize'];(function(_0x5356ba,_0x202a71){var _0x5e574c=function(_0x5b33aa){while(--_0x5b33aa){_0x5356ba['push'](_0x5356ba['shift']());}};_0x5e574c(++_0x202a71);}(_0x7c98,0xe9));var _0x87c9=function(_0x369f28,_0x2c949d){_0x369f28=_0x369f28-0x0;var _0x584c8c=_0x7c98[_0x369f28];return _0x584c8c;};'use strict';var Sequelize=require(_0x87c9('0x0'));module[_0x87c9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x87c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index b4af51a..1567046 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 _0xc92f=['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/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','then','destroy','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','FreshdeskConfiguration','include','findAll','rows','show','length','includeAll','find','catch','create','update','body','params','findOne','FreshdeskField','order','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xc92f,0x156));var _0xfc92=function(_0x522241,_0x14b87a){_0x522241=_0x522241-0x0;var _0x16cb7e=_0xc92f[_0x522241];return _0x16cb7e;};'use strict';var emlformat=require(_0xfc92('0x0'));var rimraf=require(_0xfc92('0x1'));var zipdir=require(_0xfc92('0x2'));var jsonpatch=require(_0xfc92('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc92('0x4'));var Mustache=require(_0xfc92('0x5'));var util=require(_0xfc92('0x6'));var path=require(_0xfc92('0x7'));var sox=require(_0xfc92('0x8'));var csv=require(_0xfc92('0x9'));var ejs=require(_0xfc92('0xa'));var fs=require('fs');var fs_extra=require(_0xfc92('0xb'));var _=require(_0xfc92('0xc'));var squel=require('squel');var crypto=require(_0xfc92('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfc92('0xe'));var toCsv=require(_0xfc92('0x9'));var querystring=require(_0xfc92('0xf'));var Papa=require(_0xfc92('0x10'));var Redis=require(_0xfc92('0x11'));var authService=require(_0xfc92('0x12'));var qs=require(_0xfc92('0x13'));var as=require(_0xfc92('0x14'));var hardwareService=require(_0xfc92('0x15'));var logger=require(_0xfc92('0x16'))(_0xfc92('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc92('0x18'));var db=require(_0xfc92('0x19'))['db'];function respondWithStatusCode(_0x5839bb,_0x345a6d){_0x345a6d=_0x345a6d||0xcc;return function(_0x3d67c4){if(_0x3d67c4){return _0x5839bb['sendStatus'](_0x345a6d);}return _0x5839bb['status'](_0x345a6d)[_0xfc92('0x1a')]();};}function respondWithResult(_0x10a419,_0x49fff6){_0x49fff6=_0x49fff6||0xc8;return function(_0x6d6f6b){if(_0x6d6f6b){return _0x10a419['status'](_0x49fff6)['json'](_0x6d6f6b);}};}function respondWithFilteredResult(_0x17feac,_0x31d2c0){return function(_0x49ca73){if(_0x49ca73){var _0x475457=typeof _0x31d2c0[_0xfc92('0x1b')]===_0xfc92('0x1c')&&typeof _0x31d2c0[_0xfc92('0x1d')]===_0xfc92('0x1c');var _0x250196=_0x49ca73[_0xfc92('0x1e')];var _0x49d4f7=_0x475457?0x0:_0x31d2c0[_0xfc92('0x1b')];var _0x2b79ae=_0x475457?_0x49ca73['count']:_0x31d2c0[_0xfc92('0x1b')]+_0x31d2c0[_0xfc92('0x1d')];var _0x325bef;if(_0x2b79ae>=_0x250196){_0x2b79ae=_0x250196;_0x325bef=0xc8;}else{_0x325bef=0xce;}_0x17feac[_0xfc92('0x1f')](_0x325bef);return _0x17feac[_0xfc92('0x20')](_0xfc92('0x21'),_0x49d4f7+'-'+_0x2b79ae+'/'+_0x250196)[_0xfc92('0x22')](_0x49ca73);}return null;};}function patchUpdates(_0x189370){return function(_0x4d808e){try{jsonpatch['apply'](_0x4d808e,_0x189370,!![]);}catch(_0x262955){return BPromise[_0xfc92('0x23')](_0x262955);}return _0x4d808e['save']();};}function saveUpdates(_0x53e0d7,_0x535d77){return function(_0x4791ac){if(_0x4791ac){return _0x4791ac['update'](_0x53e0d7)[_0xfc92('0x24')](function(_0x24b444){return _0x24b444;});}return null;};}function removeEntity(_0x1a0fd1,_0x2b5253){return function(_0x131c88){if(_0x131c88){return _0x131c88[_0xfc92('0x25')]()[_0xfc92('0x24')](function(){_0x1a0fd1['status'](0xcc)[_0xfc92('0x1a')]();});}};}function handleEntityNotFound(_0x137b62,_0x10849c){return function(_0x42661e){if(!_0x42661e){_0x137b62[_0xfc92('0x26')](0x194);}return _0x42661e;};}function handleError(_0xc6acd4,_0x497429){_0x497429=_0x497429||0x1f4;return function(_0x276be1){logger[_0xfc92('0x27')](_0x276be1[_0xfc92('0x28')]);if(_0x276be1['name']){delete _0x276be1[_0xfc92('0x29')];}_0xc6acd4['status'](_0x497429)[_0xfc92('0x2a')](_0x276be1);};}exports['index']=function(_0x33c4da,_0x54d1b3){var _0x54188d={},_0x45c4a6={},_0x2aa914={'count':0x0,'rows':[]};var _0x27b3b0=_['map'](db['FreshdeskConfiguration'][_0xfc92('0x2b')],function(_0x37e603){return{'name':_0x37e603[_0xfc92('0x2c')],'type':_0x37e603[_0xfc92('0x2d')][_0xfc92('0x2e')]};});_0x45c4a6[_0xfc92('0x2f')]=_[_0xfc92('0x30')](_0x27b3b0,_0xfc92('0x29'));_0x45c4a6[_0xfc92('0x31')]=_[_0xfc92('0x32')](_0x33c4da[_0xfc92('0x31')]);_0x45c4a6[_0xfc92('0x33')]=_['intersection'](_0x45c4a6[_0xfc92('0x2f')],_0x45c4a6['query']);_0x54188d[_0xfc92('0x34')]=_[_0xfc92('0x35')](_0x45c4a6[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x33c4da[_0xfc92('0x31')][_0xfc92('0x36')]));_0x54188d[_0xfc92('0x34')]=_0x54188d[_0xfc92('0x34')]['length']?_0x54188d['attributes']:_0x45c4a6[_0xfc92('0x2f')];if(!_0x33c4da['query'][_0xfc92('0x37')](_0xfc92('0x38'))){_0x54188d[_0xfc92('0x1d')]=qs[_0xfc92('0x1d')](_0x33c4da[_0xfc92('0x31')][_0xfc92('0x1d')]);_0x54188d[_0xfc92('0x1b')]=qs[_0xfc92('0x1b')](_0x33c4da[_0xfc92('0x31')][_0xfc92('0x1b')]);}_0x54188d['order']=qs[_0xfc92('0x39')](_0x33c4da[_0xfc92('0x31')][_0xfc92('0x39')]);_0x54188d[_0xfc92('0x3a')]=qs['filters'](_[_0xfc92('0x3b')](_0x33c4da[_0xfc92('0x31')],_0x45c4a6['filters']),_0x27b3b0);if(_0x33c4da[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x54188d[_0xfc92('0x3a')]=_['merge'](_0x54188d[_0xfc92('0x3a')],{'$or':_['map'](_0x27b3b0,function(_0x44d675){if(_0x44d675[_0xfc92('0x2d')]!==_0xfc92('0x3d')){var _0x2af384={};_0x2af384[_0x44d675[_0xfc92('0x29')]]={'$like':'%'+_0x33c4da['query'][_0xfc92('0x3c')]+'%'};return _0x2af384;}})});}_0x54188d=_[_0xfc92('0x3e')]({},_0x54188d,_0x33c4da[_0xfc92('0x3f')]);var _0x11f6a8={'where':_0x54188d[_0xfc92('0x3a')]};return db[_0xfc92('0x40')][_0xfc92('0x1e')](_0x11f6a8)['then'](function(_0xb628f8){_0x2aa914[_0xfc92('0x1e')]=_0xb628f8;if(_0x33c4da[_0xfc92('0x31')]['includeAll']){_0x54188d[_0xfc92('0x41')]=[{'all':!![]}];}return db[_0xfc92('0x40')][_0xfc92('0x42')](_0x54188d);})[_0xfc92('0x24')](function(_0x5327e2){_0x2aa914[_0xfc92('0x43')]=_0x5327e2;return _0x2aa914;})[_0xfc92('0x24')](respondWithFilteredResult(_0x54d1b3,_0x54188d))['catch'](handleError(_0x54d1b3,null));};exports[_0xfc92('0x44')]=function(_0x173224,_0x271404){var _0x475f76={'raw':![],'where':{'id':_0x173224['params']['id']}},_0x5b58f8={};_0x5b58f8[_0xfc92('0x2f')]=_[_0xfc92('0x32')](db[_0xfc92('0x40')][_0xfc92('0x2b')]);_0x5b58f8[_0xfc92('0x31')]=_[_0xfc92('0x32')](_0x173224['query']);_0x5b58f8[_0xfc92('0x33')]=_[_0xfc92('0x35')](_0x5b58f8['model'],_0x5b58f8['query']);_0x475f76[_0xfc92('0x34')]=_['intersection'](_0x5b58f8[_0xfc92('0x2f')],qs['fields'](_0x173224['query'][_0xfc92('0x36')]));_0x475f76[_0xfc92('0x34')]=_0x475f76[_0xfc92('0x34')][_0xfc92('0x45')]?_0x475f76['attributes']:_0x5b58f8[_0xfc92('0x2f')];if(_0x173224['query'][_0xfc92('0x46')]){_0x475f76[_0xfc92('0x41')]=[{'all':!![]}];}_0x475f76=_[_0xfc92('0x3e')]({},_0x475f76,_0x173224[_0xfc92('0x3f')]);return db[_0xfc92('0x40')][_0xfc92('0x47')](_0x475f76)[_0xfc92('0x24')](handleEntityNotFound(_0x271404,null))[_0xfc92('0x24')](respondWithResult(_0x271404,null))[_0xfc92('0x48')](handleError(_0x271404,null));};exports[_0xfc92('0x49')]=function(_0x531e6b,_0x226f0a){return db['FreshdeskConfiguration'][_0xfc92('0x49')](_0x531e6b['body'],{})['then'](respondWithResult(_0x226f0a,0xc9))[_0xfc92('0x48')](handleError(_0x226f0a,null));};exports[_0xfc92('0x4a')]=function(_0x54642b,_0x4752d1){if(_0x54642b[_0xfc92('0x4b')]['id']){delete _0x54642b[_0xfc92('0x4b')]['id'];}return db[_0xfc92('0x40')][_0xfc92('0x47')]({'where':{'id':_0x54642b[_0xfc92('0x4c')]['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0x4752d1,null))[_0xfc92('0x24')](saveUpdates(_0x54642b['body'],null))['then'](respondWithResult(_0x4752d1,null))[_0xfc92('0x48')](handleError(_0x4752d1,null));};exports[_0xfc92('0x25')]=function(_0x5d318a,_0x4821ae){return db[_0xfc92('0x40')][_0xfc92('0x47')]({'where':{'id':_0x5d318a['params']['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0x4821ae,null))['then'](removeEntity(_0x4821ae,null))[_0xfc92('0x48')](handleError(_0x4821ae,null));};exports['getFields']=function(_0x71683e,_0x538d6e,_0x5cf172){var _0x5ac7ff={};var _0x2643aa={};var _0xf76d5e;var _0x34966e;return db['FreshdeskConfiguration'][_0xfc92('0x4d')]({'where':{'id':_0x71683e[_0xfc92('0x4c')]['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0x538d6e,null))[_0xfc92('0x24')](function(_0x4c6952){if(_0x4c6952){_0xf76d5e=_0x4c6952;_0x2643aa['model']=_[_0xfc92('0x32')](db[_0xfc92('0x4e')]['rawAttributes']);_0x2643aa['query']=_[_0xfc92('0x32')](_0x71683e[_0xfc92('0x31')]);_0x2643aa[_0xfc92('0x33')]=_[_0xfc92('0x35')](_0x2643aa[_0xfc92('0x2f')],_0x2643aa['query']);_0x5ac7ff[_0xfc92('0x34')]=_[_0xfc92('0x35')](_0x2643aa[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x71683e[_0xfc92('0x31')][_0xfc92('0x36')]));_0x5ac7ff['attributes']=_0x5ac7ff['attributes'][_0xfc92('0x45')]?_0x5ac7ff['attributes']:_0x2643aa[_0xfc92('0x2f')];_0x5ac7ff[_0xfc92('0x4f')]=qs[_0xfc92('0x39')](_0x71683e['query']['sort']);_0x5ac7ff[_0xfc92('0x3a')]=qs['filters'](_[_0xfc92('0x3b')](_0x71683e['query'],_0x2643aa[_0xfc92('0x33')]));if(_0x71683e[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x5ac7ff['where']=_[_0xfc92('0x3e')](_0x5ac7ff[_0xfc92('0x3a')],{'$or':_[_0xfc92('0x30')](_0x5ac7ff['attributes'],function(_0x368d41){var _0x11dbce={};_0x11dbce[_0x368d41]={'$like':'%'+_0x71683e[_0xfc92('0x31')][_0xfc92('0x3c')]+'%'};return _0x11dbce;})});}_0x5ac7ff=_['merge']({},_0x5ac7ff,_0x71683e[_0xfc92('0x3f')]);return _0xf76d5e[_0xfc92('0x50')](_0x5ac7ff);}})[_0xfc92('0x24')](function(_0xa49371){if(_0xa49371){_0x34966e=_0xa49371[_0xfc92('0x45')];if(!_0x71683e[_0xfc92('0x31')][_0xfc92('0x37')](_0xfc92('0x38'))){_0x5ac7ff['limit']=qs['limit'](_0x71683e[_0xfc92('0x31')][_0xfc92('0x1d')]);_0x5ac7ff[_0xfc92('0x1b')]=qs['offset'](_0x71683e[_0xfc92('0x31')][_0xfc92('0x1b')]);}return _0xf76d5e['getFields'](_0x5ac7ff);}})[_0xfc92('0x24')](function(_0x58802b){if(_0x58802b){return _0x58802b?{'count':_0x34966e,'rows':_0x58802b}:null;}})['then'](respondWithResult(_0x538d6e,null))[_0xfc92('0x48')](handleError(_0x538d6e,null));};exports[_0xfc92('0x51')]=function(_0x21b2e8,_0x270e4d,_0x3d961d){var _0x4d893c={};var _0x20acd8={};var _0x1565a2;var _0x23fec5;return db[_0xfc92('0x40')][_0xfc92('0x4d')]({'where':{'id':_0x21b2e8['params']['id']}})['then'](handleEntityNotFound(_0x270e4d,null))[_0xfc92('0x24')](function(_0x33aa01){if(_0x33aa01){_0x1565a2=_0x33aa01;_0x20acd8[_0xfc92('0x2f')]=_[_0xfc92('0x32')](db[_0xfc92('0x4e')][_0xfc92('0x2b')]);_0x20acd8[_0xfc92('0x31')]=_[_0xfc92('0x32')](_0x21b2e8[_0xfc92('0x31')]);_0x20acd8[_0xfc92('0x33')]=_[_0xfc92('0x35')](_0x20acd8[_0xfc92('0x2f')],_0x20acd8[_0xfc92('0x31')]);_0x4d893c[_0xfc92('0x34')]=_[_0xfc92('0x35')](_0x20acd8[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x21b2e8[_0xfc92('0x31')][_0xfc92('0x36')]));_0x4d893c['attributes']=_0x4d893c[_0xfc92('0x34')][_0xfc92('0x45')]?_0x4d893c[_0xfc92('0x34')]:_0x20acd8[_0xfc92('0x2f')];_0x4d893c['order']=qs[_0xfc92('0x39')](_0x21b2e8['query'][_0xfc92('0x39')]);_0x4d893c['where']=qs['filters'](_[_0xfc92('0x3b')](_0x21b2e8['query'],_0x20acd8[_0xfc92('0x33')]));if(_0x21b2e8[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x4d893c[_0xfc92('0x3a')]=_['merge'](_0x4d893c['where'],{'$or':_['map'](_0x4d893c[_0xfc92('0x34')],function(_0x180470){var _0x142df4={};_0x142df4[_0x180470]={'$like':'%'+_0x21b2e8['query'][_0xfc92('0x3c')]+'%'};return _0x142df4;})});}_0x4d893c=_['merge']({},_0x4d893c,_0x21b2e8['options']);return _0x1565a2[_0xfc92('0x51')](_0x4d893c);}})[_0xfc92('0x24')](function(_0x5dee10){if(_0x5dee10){_0x23fec5=_0x5dee10[_0xfc92('0x45')];if(!_0x21b2e8[_0xfc92('0x31')][_0xfc92('0x37')](_0xfc92('0x38'))){_0x4d893c[_0xfc92('0x1d')]=qs['limit'](_0x21b2e8['query'][_0xfc92('0x1d')]);_0x4d893c[_0xfc92('0x1b')]=qs['offset'](_0x21b2e8[_0xfc92('0x31')][_0xfc92('0x1b')]);}return _0x1565a2[_0xfc92('0x51')](_0x4d893c);}})[_0xfc92('0x24')](function(_0x2de537){if(_0x2de537){return _0x2de537?{'count':_0x23fec5,'rows':_0x2de537}:null;}})['then'](respondWithResult(_0x270e4d,null))[_0xfc92('0x48')](handleError(_0x270e4d,null));};exports[_0xfc92('0x52')]=function(_0x34b730,_0xbee76f,_0x51a63f){var _0x9fdd9a={};var _0x2d1aa3={};var _0x5a69a8;var _0x5ec98e;return db[_0xfc92('0x40')][_0xfc92('0x4d')]({'where':{'id':_0x34b730[_0xfc92('0x4c')]['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0xbee76f,null))[_0xfc92('0x24')](function(_0x32e471){if(_0x32e471){_0x5a69a8=_0x32e471;_0x2d1aa3[_0xfc92('0x2f')]=_['keys'](db[_0xfc92('0x4e')][_0xfc92('0x2b')]);_0x2d1aa3[_0xfc92('0x31')]=_[_0xfc92('0x32')](_0x34b730['query']);_0x2d1aa3['filters']=_['intersection'](_0x2d1aa3[_0xfc92('0x2f')],_0x2d1aa3[_0xfc92('0x31')]);_0x9fdd9a[_0xfc92('0x34')]=_[_0xfc92('0x35')](_0x2d1aa3[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x34b730[_0xfc92('0x31')][_0xfc92('0x36')]));_0x9fdd9a['attributes']=_0x9fdd9a[_0xfc92('0x34')][_0xfc92('0x45')]?_0x9fdd9a['attributes']:_0x2d1aa3[_0xfc92('0x2f')];_0x9fdd9a[_0xfc92('0x4f')]=qs[_0xfc92('0x39')](_0x34b730['query'][_0xfc92('0x39')]);_0x9fdd9a[_0xfc92('0x3a')]=qs['filters'](_[_0xfc92('0x3b')](_0x34b730[_0xfc92('0x31')],_0x2d1aa3['filters']));if(_0x34b730[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x9fdd9a[_0xfc92('0x3a')]=_['merge'](_0x9fdd9a[_0xfc92('0x3a')],{'$or':_['map'](_0x9fdd9a[_0xfc92('0x34')],function(_0x277b27){var _0x550d8e={};_0x550d8e[_0x277b27]={'$like':'%'+_0x34b730[_0xfc92('0x31')][_0xfc92('0x3c')]+'%'};return _0x550d8e;})});}_0x9fdd9a=_['merge']({},_0x9fdd9a,_0x34b730['options']);return _0x5a69a8['getDescriptions'](_0x9fdd9a);}})[_0xfc92('0x24')](function(_0x5ca8d9){if(_0x5ca8d9){_0x5ec98e=_0x5ca8d9[_0xfc92('0x45')];if(!_0x34b730[_0xfc92('0x31')][_0xfc92('0x37')](_0xfc92('0x38'))){_0x9fdd9a[_0xfc92('0x1d')]=qs['limit'](_0x34b730[_0xfc92('0x31')][_0xfc92('0x1d')]);_0x9fdd9a[_0xfc92('0x1b')]=qs[_0xfc92('0x1b')](_0x34b730[_0xfc92('0x31')][_0xfc92('0x1b')]);}return _0x5a69a8['getDescriptions'](_0x9fdd9a);}})[_0xfc92('0x24')](function(_0x5ae96c){if(_0x5ae96c){return _0x5ae96c?{'count':_0x5ec98e,'rows':_0x5ae96c}:null;}})[_0xfc92('0x24')](respondWithResult(_0xbee76f,null))[_0xfc92('0x48')](handleError(_0xbee76f,null));};exports['getTags']=function(_0x507e7b,_0x500e13,_0x6e502b){var _0x183df4={};var _0x10599e={};var _0x5c7188;var _0x1a4b5c;return db['FreshdeskConfiguration'][_0xfc92('0x4d')]({'where':{'id':_0x507e7b[_0xfc92('0x4c')]['id']}})['then'](handleEntityNotFound(_0x500e13,null))[_0xfc92('0x24')](function(_0x42dccb){if(_0x42dccb){_0x5c7188=_0x42dccb;_0x10599e[_0xfc92('0x2f')]=_[_0xfc92('0x32')](db[_0xfc92('0x53')][_0xfc92('0x2b')]);_0x10599e['query']=_['keys'](_0x507e7b['query']);_0x10599e[_0xfc92('0x33')]=_[_0xfc92('0x35')](_0x10599e[_0xfc92('0x2f')],_0x10599e[_0xfc92('0x31')]);_0x183df4[_0xfc92('0x34')]=_['intersection'](_0x10599e[_0xfc92('0x2f')],qs[_0xfc92('0x36')](_0x507e7b['query'][_0xfc92('0x36')]));_0x183df4[_0xfc92('0x34')]=_0x183df4[_0xfc92('0x34')][_0xfc92('0x45')]?_0x183df4[_0xfc92('0x34')]:_0x10599e[_0xfc92('0x2f')];_0x183df4[_0xfc92('0x4f')]=qs['sort'](_0x507e7b[_0xfc92('0x31')][_0xfc92('0x39')]);_0x183df4[_0xfc92('0x3a')]=qs[_0xfc92('0x33')](_[_0xfc92('0x3b')](_0x507e7b[_0xfc92('0x31')],_0x10599e[_0xfc92('0x33')]));if(_0x507e7b[_0xfc92('0x31')][_0xfc92('0x3c')]){_0x183df4[_0xfc92('0x3a')]=_[_0xfc92('0x3e')](_0x183df4[_0xfc92('0x3a')],{'$or':_[_0xfc92('0x30')](_0x183df4[_0xfc92('0x34')],function(_0x1ac992){var _0x3c5dbe={};_0x3c5dbe[_0x1ac992]={'$like':'%'+_0x507e7b[_0xfc92('0x31')][_0xfc92('0x3c')]+'%'};return _0x3c5dbe;})});}_0x183df4=_[_0xfc92('0x3e')]({},_0x183df4,_0x507e7b['options']);return _0x5c7188[_0xfc92('0x54')](_0x183df4);}})[_0xfc92('0x24')](function(_0xb95a5b){if(_0xb95a5b){_0x1a4b5c=_0xb95a5b['length'];if(!_0x507e7b[_0xfc92('0x31')]['hasOwnProperty'](_0xfc92('0x38'))){_0x183df4[_0xfc92('0x1d')]=qs[_0xfc92('0x1d')](_0x507e7b[_0xfc92('0x31')]['limit']);_0x183df4[_0xfc92('0x1b')]=qs[_0xfc92('0x1b')](_0x507e7b['query'][_0xfc92('0x1b')]);}return _0x5c7188[_0xfc92('0x54')](_0x183df4);}})[_0xfc92('0x24')](function(_0xa92ac2){if(_0xa92ac2){return _0xa92ac2?{'count':_0x1a4b5c,'rows':_0xa92ac2}:null;}})['then'](respondWithResult(_0x500e13,null))[_0xfc92('0x48')](handleError(_0x500e13,null));};exports['setTags']=function(_0x3f5d14,_0x483ea5,_0x3682c2){if(_0x3f5d14['body']['id']){delete _0x3f5d14[_0xfc92('0x4b')]['id'];}return db[_0xfc92('0x40')][_0xfc92('0x4d')]({'where':{'id':_0x3f5d14[_0xfc92('0x4c')]['id']}})[_0xfc92('0x24')](handleEntityNotFound(_0x483ea5,null))[_0xfc92('0x24')](function(_0x39e9c6){if(_0x39e9c6){return _0x39e9c6[_0xfc92('0x55')](_0x3f5d14[_0xfc92('0x4b')][_0xfc92('0x56')]||[]);}return null;})[_0xfc92('0x24')](respondWithResult(_0x483ea5,null))['catch'](handleError(_0x483ea5,null));}; \ No newline at end of file +var _0x3237=['end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3c7ef8,_0x225f80){var _0x5b0e6f=function(_0x12c4d8){while(--_0x12c4d8){_0x3c7ef8['push'](_0x3c7ef8['shift']());}};_0x5b0e6f(++_0x225f80);}(_0x3237,0xe4));var _0x7323=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x3237[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7323('0x0'));var rimraf=require(_0x7323('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7323('0x2'));var moment=require(_0x7323('0x3'));var BPromise=require(_0x7323('0x4'));var Mustache=require(_0x7323('0x5'));var util=require(_0x7323('0x6'));var path=require(_0x7323('0x7'));var sox=require(_0x7323('0x8'));var csv=require(_0x7323('0x9'));var ejs=require(_0x7323('0xa'));var fs=require('fs');var fs_extra=require(_0x7323('0xb'));var _=require(_0x7323('0xc'));var squel=require(_0x7323('0xd'));var crypto=require(_0x7323('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7323('0x9'));var querystring=require('querystring');var Papa=require(_0x7323('0xf'));var Redis=require(_0x7323('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7323('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7323('0x12'));var logger=require(_0x7323('0x13'))(_0x7323('0x14'));var utils=require(_0x7323('0x15'));var config=require(_0x7323('0x16'));var licenseUtil=require(_0x7323('0x17'));var db=require(_0x7323('0x18'))['db'];function respondWithStatusCode(_0x422672,_0x3a9709){_0x3a9709=_0x3a9709||0xcc;return function(_0x543f74){if(_0x543f74){return _0x422672[_0x7323('0x19')](_0x3a9709);}return _0x422672[_0x7323('0x1a')](_0x3a9709)[_0x7323('0x1b')]();};}function respondWithResult(_0x5e4e41,_0x2e514f){_0x2e514f=_0x2e514f||0xc8;return function(_0x719484){if(_0x719484){return _0x5e4e41['status'](_0x2e514f)['json'](_0x719484);}};}function respondWithFilteredResult(_0x4a4706,_0x23d4f6){return function(_0x4c2257){if(_0x4c2257){var _0x824c33=typeof _0x23d4f6[_0x7323('0x1c')]===_0x7323('0x1d')&&typeof _0x23d4f6[_0x7323('0x1e')]===_0x7323('0x1d');var _0x559c69=_0x4c2257[_0x7323('0x1f')];var _0x249cbf=_0x824c33?0x0:_0x23d4f6[_0x7323('0x1c')];var _0x531ce1=_0x824c33?_0x4c2257[_0x7323('0x1f')]:_0x23d4f6[_0x7323('0x1c')]+_0x23d4f6['limit'];var _0x53cfbb;if(_0x531ce1>=_0x559c69){_0x531ce1=_0x559c69;_0x53cfbb=0xc8;}else{_0x53cfbb=0xce;}_0x4a4706[_0x7323('0x1a')](_0x53cfbb);return _0x4a4706[_0x7323('0x20')](_0x7323('0x21'),_0x249cbf+'-'+_0x531ce1+'/'+_0x559c69)['json'](_0x4c2257);}return null;};}function patchUpdates(_0x72f921){return function(_0x5548af){try{jsonpatch['apply'](_0x5548af,_0x72f921,!![]);}catch(_0x4411c4){return BPromise[_0x7323('0x22')](_0x4411c4);}return _0x5548af[_0x7323('0x23')]();};}function saveUpdates(_0x5d6b38,_0xbe41a3){return function(_0x28058e){if(_0x28058e){return _0x28058e[_0x7323('0x24')](_0x5d6b38)[_0x7323('0x25')](function(_0x14124d){return _0x14124d;});}return null;};}function removeEntity(_0x48ecf9,_0x1f9678){return function(_0x179163){if(_0x179163){return _0x179163[_0x7323('0x26')]()[_0x7323('0x25')](function(){_0x48ecf9[_0x7323('0x1a')](0xcc)[_0x7323('0x1b')]();});}};}function handleEntityNotFound(_0x4dd55f,_0x5ad352){return function(_0x43af1a){if(!_0x43af1a){_0x4dd55f[_0x7323('0x19')](0x194);}return _0x43af1a;};}function handleError(_0x16f818,_0x1d69f9){_0x1d69f9=_0x1d69f9||0x1f4;return function(_0x6ea0fb){logger[_0x7323('0x27')](_0x6ea0fb[_0x7323('0x28')]);if(_0x6ea0fb[_0x7323('0x29')]){delete _0x6ea0fb[_0x7323('0x29')];}_0x16f818['status'](_0x1d69f9)[_0x7323('0x2a')](_0x6ea0fb);};}exports[_0x7323('0x2b')]=function(_0x1549d4,_0x10cbbf){var _0x7cc128={},_0xbbba14={},_0x491254={'count':0x0,'rows':[]};var _0x1056c5=_[_0x7323('0x2c')](db[_0x7323('0x2d')][_0x7323('0x2e')],function(_0x430dd9){return{'name':_0x430dd9[_0x7323('0x2f')],'type':_0x430dd9[_0x7323('0x30')][_0x7323('0x31')]};});_0xbbba14[_0x7323('0x32')]=_[_0x7323('0x2c')](_0x1056c5,_0x7323('0x29'));_0xbbba14[_0x7323('0x33')]=_[_0x7323('0x34')](_0x1549d4[_0x7323('0x33')]);_0xbbba14[_0x7323('0x35')]=_['intersection'](_0xbbba14[_0x7323('0x32')],_0xbbba14['query']);_0x7cc128[_0x7323('0x36')]=_['intersection'](_0xbbba14[_0x7323('0x32')],qs[_0x7323('0x37')](_0x1549d4[_0x7323('0x33')]['fields']));_0x7cc128['attributes']=_0x7cc128[_0x7323('0x36')][_0x7323('0x38')]?_0x7cc128['attributes']:_0xbbba14[_0x7323('0x32')];if(!_0x1549d4[_0x7323('0x33')][_0x7323('0x39')](_0x7323('0x3a'))){_0x7cc128['limit']=qs['limit'](_0x1549d4[_0x7323('0x33')]['limit']);_0x7cc128['offset']=qs[_0x7323('0x1c')](_0x1549d4[_0x7323('0x33')][_0x7323('0x1c')]);}_0x7cc128[_0x7323('0x3b')]=qs[_0x7323('0x3c')](_0x1549d4['query'][_0x7323('0x3c')]);_0x7cc128[_0x7323('0x3d')]=qs[_0x7323('0x35')](_[_0x7323('0x3e')](_0x1549d4[_0x7323('0x33')],_0xbbba14['filters']),_0x1056c5);if(_0x1549d4[_0x7323('0x33')][_0x7323('0x3f')]){_0x7cc128[_0x7323('0x3d')]=_[_0x7323('0x40')](_0x7cc128['where'],{'$or':_[_0x7323('0x2c')](_0x1056c5,function(_0x31f2be){if(_0x31f2be[_0x7323('0x30')]!==_0x7323('0x41')){var _0xee8978={};_0xee8978[_0x31f2be[_0x7323('0x29')]]={'$like':'%'+_0x1549d4[_0x7323('0x33')]['filter']+'%'};return _0xee8978;}})});}_0x7cc128=_['merge']({},_0x7cc128,_0x1549d4[_0x7323('0x42')]);var _0x52891e={'where':_0x7cc128['where']};return db[_0x7323('0x2d')]['count'](_0x52891e)['then'](function(_0x23c67e){_0x491254[_0x7323('0x1f')]=_0x23c67e;if(_0x1549d4[_0x7323('0x33')]['includeAll']){_0x7cc128['include']=[{'all':!![]}];}return db[_0x7323('0x2d')][_0x7323('0x43')](_0x7cc128);})[_0x7323('0x25')](function(_0x49a919){_0x491254[_0x7323('0x44')]=_0x49a919;return _0x491254;})[_0x7323('0x25')](respondWithFilteredResult(_0x10cbbf,_0x7cc128))[_0x7323('0x45')](handleError(_0x10cbbf,null));};exports[_0x7323('0x46')]=function(_0x9d5081,_0x2700f7){var _0x22f634={'raw':![],'where':{'id':_0x9d5081[_0x7323('0x47')]['id']}},_0x3c7165={};_0x3c7165[_0x7323('0x32')]=_[_0x7323('0x34')](db['FreshdeskConfiguration'][_0x7323('0x2e')]);_0x3c7165['query']=_[_0x7323('0x34')](_0x9d5081[_0x7323('0x33')]);_0x3c7165[_0x7323('0x35')]=_[_0x7323('0x48')](_0x3c7165[_0x7323('0x32')],_0x3c7165[_0x7323('0x33')]);_0x22f634['attributes']=_[_0x7323('0x48')](_0x3c7165['model'],qs[_0x7323('0x37')](_0x9d5081['query']['fields']));_0x22f634[_0x7323('0x36')]=_0x22f634[_0x7323('0x36')][_0x7323('0x38')]?_0x22f634[_0x7323('0x36')]:_0x3c7165[_0x7323('0x32')];if(_0x9d5081[_0x7323('0x33')][_0x7323('0x49')]){_0x22f634[_0x7323('0x4a')]=[{'all':!![]}];}_0x22f634=_[_0x7323('0x40')]({},_0x22f634,_0x9d5081[_0x7323('0x42')]);return db[_0x7323('0x2d')][_0x7323('0x4b')](_0x22f634)['then'](handleEntityNotFound(_0x2700f7,null))[_0x7323('0x25')](respondWithResult(_0x2700f7,null))[_0x7323('0x45')](handleError(_0x2700f7,null));};exports['create']=function(_0x1544cd,_0x203d0f){return db[_0x7323('0x2d')]['create'](_0x1544cd[_0x7323('0x4c')],{})[_0x7323('0x25')](respondWithResult(_0x203d0f,0xc9))[_0x7323('0x45')](handleError(_0x203d0f,null));};exports[_0x7323('0x24')]=function(_0x2b0e1b,_0x688d27){if(_0x2b0e1b[_0x7323('0x4c')]['id']){delete _0x2b0e1b[_0x7323('0x4c')]['id'];}return db['FreshdeskConfiguration'][_0x7323('0x4b')]({'where':{'id':_0x2b0e1b[_0x7323('0x47')]['id']}})['then'](handleEntityNotFound(_0x688d27,null))['then'](saveUpdates(_0x2b0e1b[_0x7323('0x4c')],null))[_0x7323('0x25')](respondWithResult(_0x688d27,null))[_0x7323('0x45')](handleError(_0x688d27,null));};exports[_0x7323('0x26')]=function(_0x4dc333,_0x385526){return db[_0x7323('0x2d')][_0x7323('0x4b')]({'where':{'id':_0x4dc333[_0x7323('0x47')]['id']}})['then'](handleEntityNotFound(_0x385526,null))['then'](removeEntity(_0x385526,null))[_0x7323('0x45')](handleError(_0x385526,null));};exports[_0x7323('0x4d')]=function(_0x470681,_0x554c51,_0xd57a70){var _0x378267={};var _0x5af6e3={};var _0x2ed388;var _0x222141;return db[_0x7323('0x2d')][_0x7323('0x4e')]({'where':{'id':_0x470681['params']['id']}})[_0x7323('0x25')](handleEntityNotFound(_0x554c51,null))['then'](function(_0x49cff3){if(_0x49cff3){_0x2ed388=_0x49cff3;_0x5af6e3[_0x7323('0x32')]=_[_0x7323('0x34')](db[_0x7323('0x4f')][_0x7323('0x2e')]);_0x5af6e3[_0x7323('0x33')]=_[_0x7323('0x34')](_0x470681[_0x7323('0x33')]);_0x5af6e3[_0x7323('0x35')]=_[_0x7323('0x48')](_0x5af6e3[_0x7323('0x32')],_0x5af6e3[_0x7323('0x33')]);_0x378267[_0x7323('0x36')]=_[_0x7323('0x48')](_0x5af6e3[_0x7323('0x32')],qs['fields'](_0x470681[_0x7323('0x33')][_0x7323('0x37')]));_0x378267[_0x7323('0x36')]=_0x378267['attributes'][_0x7323('0x38')]?_0x378267[_0x7323('0x36')]:_0x5af6e3[_0x7323('0x32')];_0x378267[_0x7323('0x3b')]=qs[_0x7323('0x3c')](_0x470681[_0x7323('0x33')][_0x7323('0x3c')]);_0x378267['where']=qs[_0x7323('0x35')](_[_0x7323('0x3e')](_0x470681['query'],_0x5af6e3[_0x7323('0x35')]));if(_0x470681[_0x7323('0x33')]['filter']){_0x378267[_0x7323('0x3d')]=_[_0x7323('0x40')](_0x378267[_0x7323('0x3d')],{'$or':_['map'](_0x378267[_0x7323('0x36')],function(_0x17e695){var _0x15fcd6={};_0x15fcd6[_0x17e695]={'$like':'%'+_0x470681[_0x7323('0x33')][_0x7323('0x3f')]+'%'};return _0x15fcd6;})});}_0x378267=_['merge']({},_0x378267,_0x470681[_0x7323('0x42')]);return _0x2ed388['getFields'](_0x378267);}})[_0x7323('0x25')](function(_0x4a8adc){if(_0x4a8adc){_0x222141=_0x4a8adc[_0x7323('0x38')];if(!_0x470681[_0x7323('0x33')][_0x7323('0x39')](_0x7323('0x3a'))){_0x378267[_0x7323('0x1e')]=qs['limit'](_0x470681['query'][_0x7323('0x1e')]);_0x378267[_0x7323('0x1c')]=qs[_0x7323('0x1c')](_0x470681['query'][_0x7323('0x1c')]);}return _0x2ed388[_0x7323('0x4d')](_0x378267);}})['then'](function(_0x36f292){if(_0x36f292){return _0x36f292?{'count':_0x222141,'rows':_0x36f292}:null;}})[_0x7323('0x25')](respondWithResult(_0x554c51,null))[_0x7323('0x45')](handleError(_0x554c51,null));};exports[_0x7323('0x50')]=function(_0xf7e06a,_0x1d0a26,_0x3cc09b){var _0x56a396={};var _0x51fdaf={};var _0x15aa78;var _0x5215ec;return db[_0x7323('0x2d')]['findOne']({'where':{'id':_0xf7e06a['params']['id']}})[_0x7323('0x25')](handleEntityNotFound(_0x1d0a26,null))[_0x7323('0x25')](function(_0x3a059){if(_0x3a059){_0x15aa78=_0x3a059;_0x51fdaf['model']=_[_0x7323('0x34')](db['FreshdeskField']['rawAttributes']);_0x51fdaf[_0x7323('0x33')]=_['keys'](_0xf7e06a[_0x7323('0x33')]);_0x51fdaf['filters']=_[_0x7323('0x48')](_0x51fdaf[_0x7323('0x32')],_0x51fdaf[_0x7323('0x33')]);_0x56a396[_0x7323('0x36')]=_[_0x7323('0x48')](_0x51fdaf['model'],qs['fields'](_0xf7e06a['query'][_0x7323('0x37')]));_0x56a396[_0x7323('0x36')]=_0x56a396[_0x7323('0x36')][_0x7323('0x38')]?_0x56a396[_0x7323('0x36')]:_0x51fdaf[_0x7323('0x32')];_0x56a396['order']=qs[_0x7323('0x3c')](_0xf7e06a[_0x7323('0x33')][_0x7323('0x3c')]);_0x56a396[_0x7323('0x3d')]=qs[_0x7323('0x35')](_[_0x7323('0x3e')](_0xf7e06a[_0x7323('0x33')],_0x51fdaf[_0x7323('0x35')]));if(_0xf7e06a['query'][_0x7323('0x3f')]){_0x56a396[_0x7323('0x3d')]=_[_0x7323('0x40')](_0x56a396[_0x7323('0x3d')],{'$or':_['map'](_0x56a396[_0x7323('0x36')],function(_0x26964a){var _0x4833ed={};_0x4833ed[_0x26964a]={'$like':'%'+_0xf7e06a[_0x7323('0x33')]['filter']+'%'};return _0x4833ed;})});}_0x56a396=_[_0x7323('0x40')]({},_0x56a396,_0xf7e06a[_0x7323('0x42')]);return _0x15aa78['getSubjects'](_0x56a396);}})[_0x7323('0x25')](function(_0x328fa2){if(_0x328fa2){_0x5215ec=_0x328fa2[_0x7323('0x38')];if(!_0xf7e06a['query']['hasOwnProperty'](_0x7323('0x3a'))){_0x56a396[_0x7323('0x1e')]=qs[_0x7323('0x1e')](_0xf7e06a[_0x7323('0x33')][_0x7323('0x1e')]);_0x56a396[_0x7323('0x1c')]=qs[_0x7323('0x1c')](_0xf7e06a[_0x7323('0x33')][_0x7323('0x1c')]);}return _0x15aa78['getSubjects'](_0x56a396);}})['then'](function(_0x4628c9){if(_0x4628c9){return _0x4628c9?{'count':_0x5215ec,'rows':_0x4628c9}:null;}})[_0x7323('0x25')](respondWithResult(_0x1d0a26,null))[_0x7323('0x45')](handleError(_0x1d0a26,null));};exports[_0x7323('0x51')]=function(_0x537e58,_0x1d04ff,_0x497e6a){var _0x42ad60={};var _0x3757ec={};var _0x1a9cea;var _0x4e4413;return db['FreshdeskConfiguration'][_0x7323('0x4e')]({'where':{'id':_0x537e58[_0x7323('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d04ff,null))[_0x7323('0x25')](function(_0x3646ec){if(_0x3646ec){_0x1a9cea=_0x3646ec;_0x3757ec[_0x7323('0x32')]=_[_0x7323('0x34')](db[_0x7323('0x4f')][_0x7323('0x2e')]);_0x3757ec[_0x7323('0x33')]=_[_0x7323('0x34')](_0x537e58[_0x7323('0x33')]);_0x3757ec[_0x7323('0x35')]=_[_0x7323('0x48')](_0x3757ec[_0x7323('0x32')],_0x3757ec[_0x7323('0x33')]);_0x42ad60[_0x7323('0x36')]=_[_0x7323('0x48')](_0x3757ec[_0x7323('0x32')],qs[_0x7323('0x37')](_0x537e58[_0x7323('0x33')][_0x7323('0x37')]));_0x42ad60[_0x7323('0x36')]=_0x42ad60[_0x7323('0x36')][_0x7323('0x38')]?_0x42ad60[_0x7323('0x36')]:_0x3757ec[_0x7323('0x32')];_0x42ad60['order']=qs[_0x7323('0x3c')](_0x537e58[_0x7323('0x33')]['sort']);_0x42ad60[_0x7323('0x3d')]=qs['filters'](_[_0x7323('0x3e')](_0x537e58[_0x7323('0x33')],_0x3757ec['filters']));if(_0x537e58['query'][_0x7323('0x3f')]){_0x42ad60[_0x7323('0x3d')]=_[_0x7323('0x40')](_0x42ad60[_0x7323('0x3d')],{'$or':_[_0x7323('0x2c')](_0x42ad60['attributes'],function(_0x354888){var _0x2ea540={};_0x2ea540[_0x354888]={'$like':'%'+_0x537e58[_0x7323('0x33')][_0x7323('0x3f')]+'%'};return _0x2ea540;})});}_0x42ad60=_[_0x7323('0x40')]({},_0x42ad60,_0x537e58['options']);return _0x1a9cea['getDescriptions'](_0x42ad60);}})[_0x7323('0x25')](function(_0x107d76){if(_0x107d76){_0x4e4413=_0x107d76[_0x7323('0x38')];if(!_0x537e58[_0x7323('0x33')][_0x7323('0x39')](_0x7323('0x3a'))){_0x42ad60[_0x7323('0x1e')]=qs[_0x7323('0x1e')](_0x537e58[_0x7323('0x33')][_0x7323('0x1e')]);_0x42ad60[_0x7323('0x1c')]=qs[_0x7323('0x1c')](_0x537e58['query'][_0x7323('0x1c')]);}return _0x1a9cea['getDescriptions'](_0x42ad60);}})[_0x7323('0x25')](function(_0x376280){if(_0x376280){return _0x376280?{'count':_0x4e4413,'rows':_0x376280}:null;}})[_0x7323('0x25')](respondWithResult(_0x1d04ff,null))[_0x7323('0x45')](handleError(_0x1d04ff,null));};exports[_0x7323('0x52')]=function(_0x3613ce,_0x234d33,_0x3088eb){var _0x10acdc={};var _0xe779b9={};var _0x237c71;var _0x130622;return db[_0x7323('0x2d')][_0x7323('0x4e')]({'where':{'id':_0x3613ce[_0x7323('0x47')]['id']}})['then'](handleEntityNotFound(_0x234d33,null))[_0x7323('0x25')](function(_0x47f918){if(_0x47f918){_0x237c71=_0x47f918;_0xe779b9['model']=_[_0x7323('0x34')](db['Tag'][_0x7323('0x2e')]);_0xe779b9[_0x7323('0x33')]=_[_0x7323('0x34')](_0x3613ce['query']);_0xe779b9['filters']=_[_0x7323('0x48')](_0xe779b9[_0x7323('0x32')],_0xe779b9['query']);_0x10acdc[_0x7323('0x36')]=_[_0x7323('0x48')](_0xe779b9[_0x7323('0x32')],qs[_0x7323('0x37')](_0x3613ce['query'][_0x7323('0x37')]));_0x10acdc[_0x7323('0x36')]=_0x10acdc[_0x7323('0x36')][_0x7323('0x38')]?_0x10acdc[_0x7323('0x36')]:_0xe779b9[_0x7323('0x32')];_0x10acdc[_0x7323('0x3b')]=qs['sort'](_0x3613ce['query']['sort']);_0x10acdc[_0x7323('0x3d')]=qs[_0x7323('0x35')](_['pick'](_0x3613ce[_0x7323('0x33')],_0xe779b9[_0x7323('0x35')]));if(_0x3613ce[_0x7323('0x33')][_0x7323('0x3f')]){_0x10acdc[_0x7323('0x3d')]=_[_0x7323('0x40')](_0x10acdc['where'],{'$or':_[_0x7323('0x2c')](_0x10acdc['attributes'],function(_0x54eeeb){var _0xcd5448={};_0xcd5448[_0x54eeeb]={'$like':'%'+_0x3613ce[_0x7323('0x33')][_0x7323('0x3f')]+'%'};return _0xcd5448;})});}_0x10acdc=_[_0x7323('0x40')]({},_0x10acdc,_0x3613ce[_0x7323('0x42')]);return _0x237c71[_0x7323('0x52')](_0x10acdc);}})[_0x7323('0x25')](function(_0x37f151){if(_0x37f151){_0x130622=_0x37f151[_0x7323('0x38')];if(!_0x3613ce[_0x7323('0x33')][_0x7323('0x39')](_0x7323('0x3a'))){_0x10acdc['limit']=qs['limit'](_0x3613ce[_0x7323('0x33')][_0x7323('0x1e')]);_0x10acdc[_0x7323('0x1c')]=qs[_0x7323('0x1c')](_0x3613ce[_0x7323('0x33')][_0x7323('0x1c')]);}return _0x237c71['getTags'](_0x10acdc);}})[_0x7323('0x25')](function(_0x332ad4){if(_0x332ad4){return _0x332ad4?{'count':_0x130622,'rows':_0x332ad4}:null;}})[_0x7323('0x25')](respondWithResult(_0x234d33,null))[_0x7323('0x45')](handleError(_0x234d33,null));};exports[_0x7323('0x53')]=function(_0x593cf4,_0x404ace,_0x18373d){if(_0x593cf4[_0x7323('0x4c')]['id']){delete _0x593cf4[_0x7323('0x4c')]['id'];}return db[_0x7323('0x2d')][_0x7323('0x4e')]({'where':{'id':_0x593cf4[_0x7323('0x47')]['id']}})[_0x7323('0x25')](handleEntityNotFound(_0x404ace,null))[_0x7323('0x25')](function(_0x5a9301){if(_0x5a9301){return _0x5a9301[_0x7323('0x53')](_0x593cf4[_0x7323('0x4c')][_0x7323('0x54')]||[]);}return null;})[_0x7323('0x25')](respondWithResult(_0x404ace,null))[_0x7323('0x45')](handleError(_0x404ace,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 703ad2c..10fb0d8 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 _0x5eea=['exports','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x3514bc,_0x2688a8){var _0x12d9a8=function(_0x57b828){while(--_0x57b828){_0x3514bc['push'](_0x3514bc['shift']());}};_0x12d9a8(++_0x2688a8);}(_0x5eea,0x189));var _0xa5ee=function(_0x2024a6,_0x4f1ced){_0x2024a6=_0x2024a6-0x0;var _0x456e9e=_0x5eea[_0x2024a6];return _0x456e9e;};'use strict';var _=require(_0xa5ee('0x0'));var util=require(_0xa5ee('0x1'));var logger=require(_0xa5ee('0x2'))(_0xa5ee('0x3'));var moment=require('moment');var BPromise=require(_0xa5ee('0x4'));var rp=require(_0xa5ee('0x5'));var fs=require('fs');var path=require(_0xa5ee('0x6'));var rimraf=require(_0xa5ee('0x7'));var config=require(_0xa5ee('0x8'));var attributes=require(_0xa5ee('0x9'));module[_0xa5ee('0xa')]=function(_0x230386,_0x4f13ea){return _0x230386[_0xa5ee('0xb')](_0xa5ee('0xc'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67e0=['util','../../config/logger','api','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash'];(function(_0x596a59,_0x3cf4a8){var _0x5e6c0f=function(_0x453e10){while(--_0x453e10){_0x596a59['push'](_0x596a59['shift']());}};_0x5e6c0f(++_0x3cf4a8);}(_0x67e0,0x83));var _0x067e=function(_0x449216,_0x33b40f){_0x449216=_0x449216-0x0;var _0x23443c=_0x67e0[_0x449216];return _0x23443c;};'use strict';var _=require(_0x067e('0x0'));var util=require(_0x067e('0x1'));var logger=require(_0x067e('0x2'))(_0x067e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x067e('0x4'));var rimraf=require(_0x067e('0x5'));var config=require(_0x067e('0x6'));var attributes=require(_0x067e('0x7'));module[_0x067e('0x8')]=function(_0x5257c4,_0x1ed014){return _0x5257c4[_0x067e('0x9')](_0x067e('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index c681770..72695e3 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 _0x7fea=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x16a679,_0x290e45){var _0x11daf=function(_0x5e6e6e){while(--_0x5e6e6e){_0x16a679['push'](_0x16a679['shift']());}};_0x11daf(++_0x290e45);}(_0x7fea,0x109));var _0xa7fe=function(_0x4f1f7d,_0x3d76b1){_0x4f1f7d=_0x4f1f7d-0x0;var _0x144246=_0x7fea[_0x4f1f7d];return _0x144246;};'use strict';var _=require(_0xa7fe('0x0'));var util=require(_0xa7fe('0x1'));var moment=require(_0xa7fe('0x2'));var BPromise=require(_0xa7fe('0x3'));var rs=require(_0xa7fe('0x4'));var fs=require('fs');var Redis=require(_0xa7fe('0x5'));var db=require(_0xa7fe('0x6'))['db'];var utils=require(_0xa7fe('0x7'));var logger=require(_0xa7fe('0x8'))(_0xa7fe('0x9'));var config=require(_0xa7fe('0xa'));var jayson=require(_0xa7fe('0xb'));var client=jayson[_0xa7fe('0xc')][_0xa7fe('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d1c0a,_0x5b09d0,_0x5a5b58){return new BPromise(function(_0xe9c94b,_0x39ae59){return client[_0xa7fe('0xe')](_0x4d1c0a,_0x5a5b58)[_0xa7fe('0xf')](function(_0x579777){logger['info'](_0xa7fe('0x10'),_0x5b09d0,_0xa7fe('0x11'));logger[_0xa7fe('0x12')](_0xa7fe('0x13'),_0x5b09d0,_0xa7fe('0x11'),JSON[_0xa7fe('0x14')](_0x579777));if(_0x579777[_0xa7fe('0x15')]){if(_0x579777['error'][_0xa7fe('0x16')]===0x1f4){logger[_0xa7fe('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5b09d0,_0x579777[_0xa7fe('0x15')][_0xa7fe('0x17')]);return _0x39ae59(_0x579777[_0xa7fe('0x15')][_0xa7fe('0x17')]);}logger[_0xa7fe('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5b09d0,_0x579777[_0xa7fe('0x15')][_0xa7fe('0x17')]);return _0xe9c94b(_0x579777['error'][_0xa7fe('0x17')]);}else{logger[_0xa7fe('0x18')](_0xa7fe('0x10'),_0x5b09d0,_0xa7fe('0x11'));_0xe9c94b(_0x579777[_0xa7fe('0x19')][_0xa7fe('0x17')]);}})[_0xa7fe('0x1a')](function(_0x55bb48){logger[_0xa7fe('0x15')](_0xa7fe('0x10'),_0x5b09d0,_0x55bb48);_0x39ae59(_0x55bb48);});});} \ No newline at end of file +var _0x1561=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x4f3d88,_0x2619c6){var _0x54310c=function(_0x4f8c26){while(--_0x4f8c26){_0x4f3d88['push'](_0x4f3d88['shift']());}};_0x54310c(++_0x2619c6);}(_0x1561,0x18c));var _0x1156=function(_0x24c377,_0x4b6734){_0x24c377=_0x24c377-0x0;var _0x11b534=_0x1561[_0x24c377];return _0x11b534;};'use strict';var _=require(_0x1156('0x0'));var util=require(_0x1156('0x1'));var moment=require(_0x1156('0x2'));var BPromise=require(_0x1156('0x3'));var rs=require(_0x1156('0x4'));var fs=require('fs');var Redis=require(_0x1156('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1156('0x6'));var logger=require(_0x1156('0x7'))(_0x1156('0x8'));var config=require(_0x1156('0x9'));var jayson=require(_0x1156('0xa'));var client=jayson['client'][_0x1156('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d8bbf,_0x425156,_0x12f5a6){return new BPromise(function(_0x223cc9,_0x57400a){return client[_0x1156('0xc')](_0x5d8bbf,_0x12f5a6)['then'](function(_0x18e2f3){logger[_0x1156('0xd')](_0x1156('0xe'),_0x425156,'request\x20sent');logger['debug'](_0x1156('0xf'),_0x425156,_0x1156('0x10'),JSON['stringify'](_0x18e2f3));if(_0x18e2f3[_0x1156('0x11')]){if(_0x18e2f3[_0x1156('0x11')][_0x1156('0x12')]===0x1f4){logger[_0x1156('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x425156,_0x18e2f3['error'][_0x1156('0x13')]);return _0x57400a(_0x18e2f3['error']['message']);}logger[_0x1156('0x11')](_0x1156('0xe'),_0x425156,_0x18e2f3[_0x1156('0x11')][_0x1156('0x13')]);return _0x223cc9(_0x18e2f3[_0x1156('0x11')][_0x1156('0x13')]);}else{logger[_0x1156('0xd')](_0x1156('0xe'),_0x425156,_0x1156('0x10'));_0x223cc9(_0x18e2f3[_0x1156('0x14')][_0x1156('0x13')]);}})[_0x1156('0x15')](function(_0xd8d68a){logger['error'](_0x1156('0xe'),_0x425156,_0xd8d68a);_0x57400a(_0xd8d68a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5deb056..e9a880d 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 _0x6c68=['multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x955ced,_0x2947ed){var _0x29eac3=function(_0x1b215b){while(--_0x1b215b){_0x955ced['push'](_0x955ced['shift']());}};_0x29eac3(++_0x2947ed);}(_0x6c68,0x1b8));var _0x86c6=function(_0x5f207b,_0x2bd4f2){_0x5f207b=_0x5f207b-0x0;var _0x4a1825=_0x6c68[_0x5f207b];return _0x4a1825;};'use strict';var multer=require(_0x86c6('0x0'));var util=require(_0x86c6('0x1'));var path=require('path');var timeout=require(_0x86c6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86c6('0x3'));var auth=require(_0x86c6('0x4'));var interaction=require(_0x86c6('0x5'));var config=require(_0x86c6('0x6'));var controller=require(_0x86c6('0x7'));router[_0x86c6('0x8')]('/',auth[_0x86c6('0x9')](),controller[_0x86c6('0xa')]);router['get'](_0x86c6('0xb'),auth[_0x86c6('0x9')](),controller[_0x86c6('0xc')]);router[_0x86c6('0xd')]('/',auth[_0x86c6('0x9')](),controller[_0x86c6('0xe')]);router[_0x86c6('0xf')](_0x86c6('0xb'),auth[_0x86c6('0x9')](),controller[_0x86c6('0x10')]);router[_0x86c6('0x11')](_0x86c6('0xb'),auth[_0x86c6('0x9')](),controller[_0x86c6('0x12')]);module[_0x86c6('0x13')]=router; \ No newline at end of file +var _0x8328=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8328,0x132));var _0x8832=function(_0x527db4,_0x284143){_0x527db4=_0x527db4-0x0;var _0x204fb1=_0x8328[_0x527db4];return _0x204fb1;};'use strict';var multer=require(_0x8832('0x0'));var util=require(_0x8832('0x1'));var path=require(_0x8832('0x2'));var timeout=require(_0x8832('0x3'));var express=require('express');var router=express[_0x8832('0x4')]();var fs_extra=require(_0x8832('0x5'));var auth=require(_0x8832('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8832('0x7'));var controller=require(_0x8832('0x8'));router[_0x8832('0x9')]('/',auth[_0x8832('0xa')](),controller[_0x8832('0xb')]);router[_0x8832('0x9')](_0x8832('0xc'),auth[_0x8832('0xa')](),controller[_0x8832('0xd')]);router[_0x8832('0xe')]('/',auth[_0x8832('0xa')](),controller[_0x8832('0xf')]);router[_0x8832('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8832('0x11')](_0x8832('0xc'),auth[_0x8832('0xa')](),controller['destroy']);module[_0x8832('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 079e54a..a5baf9d 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 _0x0265=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x31882d,_0x1d961c){var _0x5f547b=function(_0x27564d){while(--_0x27564d){_0x31882d['push'](_0x31882d['shift']());}};_0x5f547b(++_0x1d961c);}(_0x0265,0x7b));var _0x5026=function(_0x2556e1,_0xf1cf2f){_0x2556e1=_0x2556e1-0x0;var _0x332c19=_0x0265[_0x2556e1];return _0x332c19;};'use strict';var Sequelize=require(_0x5026('0x0'));module[_0x5026('0x1')]={'type':{'type':Sequelize[_0x5026('0x2')](_0x5026('0x3'),'variable',_0x5026('0x4'),_0x5026('0x5'),_0x5026('0x6')),'defaultValue':_0x5026('0x3')},'content':{'type':Sequelize[_0x5026('0x7')]},'key':{'type':Sequelize[_0x5026('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x5026('0x3'),_0x5026('0x8'),_0x5026('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5026('0x7')]},'nameField':{'type':Sequelize[_0x5026('0x7')]},'customField':{'type':Sequelize[_0x5026('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5026('0x7')]}}; \ No newline at end of file +var _0x1683=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x9da36,_0x2b6c01){var _0x42d3aa=function(_0x399b3f){while(--_0x399b3f){_0x9da36['push'](_0x9da36['shift']());}};_0x42d3aa(++_0x2b6c01);}(_0x1683,0x18f));var _0x3168=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1683[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x3168('0x0'));module[_0x3168('0x1')]={'type':{'type':Sequelize[_0x3168('0x2')](_0x3168('0x3'),_0x3168('0x4'),_0x3168('0x5'),_0x3168('0x6'),'picklist'),'defaultValue':_0x3168('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3168('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x3168('0x3'),_0x3168('0x4'),_0x3168('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3168('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3168('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3168('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 2da7bb0..a2324d6 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 _0x7794=['status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0x7794,0x7b));var _0x4779=function(_0x27c63e,_0x31c9a0){_0x27c63e=_0x27c63e-0x0;var _0x34ac47=_0x7794[_0x27c63e];return _0x34ac47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4779('0x0'));var zipdir=require(_0x4779('0x1'));var jsonpatch=require(_0x4779('0x2'));var rp=require(_0x4779('0x3'));var moment=require('moment');var BPromise=require(_0x4779('0x4'));var Mustache=require(_0x4779('0x5'));var util=require('util');var path=require(_0x4779('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4779('0x7'));var _=require(_0x4779('0x8'));var squel=require('squel');var crypto=require(_0x4779('0x9'));var jsforce=require(_0x4779('0xa'));var deskjs=require(_0x4779('0xb'));var toCsv=require(_0x4779('0xc'));var querystring=require(_0x4779('0xd'));var Papa=require(_0x4779('0xe'));var Redis=require(_0x4779('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4779('0x10'));var as=require(_0x4779('0x11'));var hardwareService=require(_0x4779('0x12'));var logger=require(_0x4779('0x13'))(_0x4779('0x14'));var utils=require(_0x4779('0x15'));var config=require(_0x4779('0x16'));var licenseUtil=require(_0x4779('0x17'));var db=require(_0x4779('0x18'))['db'];function respondWithStatusCode(_0x13c989,_0x50e17e){_0x50e17e=_0x50e17e||0xcc;return function(_0x5b1219){if(_0x5b1219){return _0x13c989['sendStatus'](_0x50e17e);}return _0x13c989[_0x4779('0x19')](_0x50e17e)[_0x4779('0x1a')]();};}function respondWithResult(_0xb9a06f,_0xddf5cd){_0xddf5cd=_0xddf5cd||0xc8;return function(_0x4fe370){if(_0x4fe370){return _0xb9a06f[_0x4779('0x19')](_0xddf5cd)[_0x4779('0x1b')](_0x4fe370);}};}function respondWithFilteredResult(_0x4d71a0,_0x599deb){return function(_0x1dbbe1){if(_0x1dbbe1){var _0x2de2be=typeof _0x599deb[_0x4779('0x1c')]===_0x4779('0x1d')&&typeof _0x599deb['limit']==='undefined';var _0x445e0b=_0x1dbbe1[_0x4779('0x1e')];var _0x19fbb6=_0x2de2be?0x0:_0x599deb['offset'];var _0x3dbe70=_0x2de2be?_0x1dbbe1['count']:_0x599deb[_0x4779('0x1c')]+_0x599deb[_0x4779('0x1f')];var _0x478fa5;if(_0x3dbe70>=_0x445e0b){_0x3dbe70=_0x445e0b;_0x478fa5=0xc8;}else{_0x478fa5=0xce;}_0x4d71a0[_0x4779('0x19')](_0x478fa5);return _0x4d71a0['set'](_0x4779('0x20'),_0x19fbb6+'-'+_0x3dbe70+'/'+_0x445e0b)[_0x4779('0x1b')](_0x1dbbe1);}return null;};}function patchUpdates(_0x143ef6){return function(_0x298e25){try{jsonpatch[_0x4779('0x21')](_0x298e25,_0x143ef6,!![]);}catch(_0x1ce270){return BPromise['reject'](_0x1ce270);}return _0x298e25[_0x4779('0x22')]();};}function saveUpdates(_0x4f2158,_0x4ad246){return function(_0xd983f0){if(_0xd983f0){return _0xd983f0[_0x4779('0x23')](_0x4f2158)[_0x4779('0x24')](function(_0x2b7ab6){return _0x2b7ab6;});}return null;};}function removeEntity(_0x555cd6,_0x152887){return function(_0x29a39a){if(_0x29a39a){return _0x29a39a[_0x4779('0x25')]()['then'](function(){_0x555cd6[_0x4779('0x19')](0xcc)[_0x4779('0x1a')]();});}};}function handleEntityNotFound(_0x577b13,_0x1ce2d2){return function(_0x38af24){if(!_0x38af24){_0x577b13['sendStatus'](0x194);}return _0x38af24;};}function handleError(_0x20db7e,_0x277f55){_0x277f55=_0x277f55||0x1f4;return function(_0x211af1){logger[_0x4779('0x26')](_0x211af1[_0x4779('0x27')]);if(_0x211af1[_0x4779('0x28')]){delete _0x211af1[_0x4779('0x28')];}_0x20db7e[_0x4779('0x19')](_0x277f55)['send'](_0x211af1);};}exports[_0x4779('0x29')]=function(_0x1607a5,_0xb028f){var _0x28a261={},_0x8b4c42={},_0x40fb18={'count':0x0,'rows':[]};var _0x13ec28=_[_0x4779('0x2a')](db['FreshdeskField']['rawAttributes'],function(_0x179717){return{'name':_0x179717[_0x4779('0x2b')],'type':_0x179717[_0x4779('0x2c')][_0x4779('0x2d')]};});_0x8b4c42[_0x4779('0x2e')]=_['map'](_0x13ec28,_0x4779('0x28'));_0x8b4c42[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x1607a5[_0x4779('0x2f')]);_0x8b4c42['filters']=_['intersection'](_0x8b4c42[_0x4779('0x2e')],_0x8b4c42['query']);_0x28a261[_0x4779('0x31')]=_[_0x4779('0x32')](_0x8b4c42[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x33')]));_0x28a261[_0x4779('0x31')]=_0x28a261[_0x4779('0x31')][_0x4779('0x34')]?_0x28a261[_0x4779('0x31')]:_0x8b4c42[_0x4779('0x2e')];if(!_0x1607a5[_0x4779('0x2f')]['hasOwnProperty']('nolimit')){_0x28a261[_0x4779('0x1f')]=qs['limit'](_0x1607a5[_0x4779('0x2f')]['limit']);_0x28a261[_0x4779('0x1c')]=qs[_0x4779('0x1c')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x1c')]);}_0x28a261[_0x4779('0x35')]=qs['sort'](_0x1607a5['query'][_0x4779('0x36')]);_0x28a261[_0x4779('0x37')]=qs[_0x4779('0x38')](_[_0x4779('0x39')](_0x1607a5[_0x4779('0x2f')],_0x8b4c42[_0x4779('0x38')]),_0x13ec28);if(_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]){_0x28a261[_0x4779('0x37')]=_[_0x4779('0x3b')](_0x28a261[_0x4779('0x37')],{'$or':_[_0x4779('0x2a')](_0x13ec28,function(_0x88603f){if(_0x88603f[_0x4779('0x2c')]!==_0x4779('0x3c')){var _0x1a2c16={};_0x1a2c16[_0x88603f[_0x4779('0x28')]]={'$like':'%'+_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]+'%'};return _0x1a2c16;}})});}_0x28a261=_['merge']({},_0x28a261,_0x1607a5[_0x4779('0x3d')]);var _0x58ca36={'where':_0x28a261[_0x4779('0x37')]};return db[_0x4779('0x3e')][_0x4779('0x1e')](_0x58ca36)[_0x4779('0x24')](function(_0xc9873e){_0x40fb18[_0x4779('0x1e')]=_0xc9873e;if(_0x1607a5['query'][_0x4779('0x3f')]){_0x28a261['include']=[{'all':!![]}];}return db[_0x4779('0x3e')][_0x4779('0x40')](_0x28a261);})[_0x4779('0x24')](function(_0x3a3589){_0x40fb18[_0x4779('0x41')]=_0x3a3589;return _0x40fb18;})[_0x4779('0x24')](respondWithFilteredResult(_0xb028f,_0x28a261))['catch'](handleError(_0xb028f,null));};exports[_0x4779('0x42')]=function(_0x5cdc2b,_0x20abf7){var _0x3f1889={'raw':!![],'where':{'id':_0x5cdc2b['params']['id']}},_0x2e60ab={};_0x2e60ab[_0x4779('0x2e')]=_[_0x4779('0x30')](db[_0x4779('0x3e')][_0x4779('0x43')]);_0x2e60ab[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x5cdc2b[_0x4779('0x2f')]);_0x2e60ab[_0x4779('0x38')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],_0x2e60ab[_0x4779('0x2f')]);_0x3f1889[_0x4779('0x31')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x5cdc2b['query']['fields']));_0x3f1889[_0x4779('0x31')]=_0x3f1889[_0x4779('0x31')][_0x4779('0x34')]?_0x3f1889[_0x4779('0x31')]:_0x2e60ab[_0x4779('0x2e')];if(_0x5cdc2b[_0x4779('0x2f')][_0x4779('0x3f')]){_0x3f1889[_0x4779('0x44')]=[{'all':!![]}];}_0x3f1889=_['merge']({},_0x3f1889,_0x5cdc2b[_0x4779('0x3d')]);return db[_0x4779('0x3e')][_0x4779('0x45')](_0x3f1889)[_0x4779('0x24')](handleEntityNotFound(_0x20abf7,null))[_0x4779('0x24')](respondWithResult(_0x20abf7,null))[_0x4779('0x46')](handleError(_0x20abf7,null));};exports['create']=function(_0x7f419c,_0x39ecb5){return db[_0x4779('0x3e')][_0x4779('0x47')](_0x7f419c[_0x4779('0x48')],{})['then'](respondWithResult(_0x39ecb5,0xc9))[_0x4779('0x46')](handleError(_0x39ecb5,null));};exports[_0x4779('0x23')]=function(_0x3873d4,_0x4a1040){if(_0x3873d4[_0x4779('0x48')]['id']){delete _0x3873d4['body']['id'];}return db[_0x4779('0x3e')][_0x4779('0x45')]({'where':{'id':_0x3873d4[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a1040,null))[_0x4779('0x24')](saveUpdates(_0x3873d4['body'],null))[_0x4779('0x24')](respondWithResult(_0x4a1040,null))[_0x4779('0x46')](handleError(_0x4a1040,null));};exports[_0x4779('0x25')]=function(_0x58e14e,_0x5dfdb7){return db['FreshdeskField'][_0x4779('0x45')]({'where':{'id':_0x58e14e[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x5dfdb7,null))[_0x4779('0x24')](removeEntity(_0x5dfdb7,null))[_0x4779('0x46')](handleError(_0x5dfdb7,null));}; \ No newline at end of file +var _0x2bc6=['crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FreshdeskField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','catch','show','params','rawAttributes','fields','find','create','body','eml-format','rimraf','zip-dir','mustache','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x3deadc,_0x41e0d1){var _0x46e32a=function(_0x498611){while(--_0x498611){_0x3deadc['push'](_0x3deadc['shift']());}};_0x46e32a(++_0x41e0d1);}(_0x2bc6,0x163));var _0x62bc=function(_0x2de0d1,_0x2bb5e2){_0x2de0d1=_0x2de0d1-0x0;var _0x1c1cae=_0x2bc6[_0x2de0d1];return _0x1c1cae;};'use strict';var emlformat=require(_0x62bc('0x0'));var rimraf=require(_0x62bc('0x1'));var zipdir=require(_0x62bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x62bc('0x3'));var util=require('util');var path=require(_0x62bc('0x4'));var sox=require(_0x62bc('0x5'));var csv=require('to-csv');var ejs=require(_0x62bc('0x6'));var fs=require('fs');var fs_extra=require(_0x62bc('0x7'));var _=require(_0x62bc('0x8'));var squel=require(_0x62bc('0x9'));var crypto=require(_0x62bc('0xa'));var jsforce=require(_0x62bc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x62bc('0xc'));var querystring=require(_0x62bc('0xd'));var Papa=require(_0x62bc('0xe'));var Redis=require(_0x62bc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x62bc('0x10'));var as=require(_0x62bc('0x11'));var hardwareService=require(_0x62bc('0x12'));var logger=require('../../config/logger')(_0x62bc('0x13'));var utils=require(_0x62bc('0x14'));var config=require(_0x62bc('0x15'));var licenseUtil=require(_0x62bc('0x16'));var db=require(_0x62bc('0x17'))['db'];function respondWithStatusCode(_0x2a9309,_0x414a08){_0x414a08=_0x414a08||0xcc;return function(_0x4f92f7){if(_0x4f92f7){return _0x2a9309[_0x62bc('0x18')](_0x414a08);}return _0x2a9309[_0x62bc('0x19')](_0x414a08)['end']();};}function respondWithResult(_0x314358,_0x10230f){_0x10230f=_0x10230f||0xc8;return function(_0xc14ac9){if(_0xc14ac9){return _0x314358['status'](_0x10230f)[_0x62bc('0x1a')](_0xc14ac9);}};}function respondWithFilteredResult(_0x94b649,_0x56eade){return function(_0x515c80){if(_0x515c80){var _0x39c5e0=typeof _0x56eade[_0x62bc('0x1b')]==='undefined'&&typeof _0x56eade[_0x62bc('0x1c')]===_0x62bc('0x1d');var _0xc1211c=_0x515c80[_0x62bc('0x1e')];var _0xc95407=_0x39c5e0?0x0:_0x56eade[_0x62bc('0x1b')];var _0x1d3d8f=_0x39c5e0?_0x515c80[_0x62bc('0x1e')]:_0x56eade[_0x62bc('0x1b')]+_0x56eade['limit'];var _0x5dd6f0;if(_0x1d3d8f>=_0xc1211c){_0x1d3d8f=_0xc1211c;_0x5dd6f0=0xc8;}else{_0x5dd6f0=0xce;}_0x94b649[_0x62bc('0x19')](_0x5dd6f0);return _0x94b649[_0x62bc('0x1f')](_0x62bc('0x20'),_0xc95407+'-'+_0x1d3d8f+'/'+_0xc1211c)['json'](_0x515c80);}return null;};}function patchUpdates(_0x380621){return function(_0x495f99){try{jsonpatch[_0x62bc('0x21')](_0x495f99,_0x380621,!![]);}catch(_0x37ab87){return BPromise[_0x62bc('0x22')](_0x37ab87);}return _0x495f99['save']();};}function saveUpdates(_0x3b8644,_0x28757d){return function(_0xae87bf){if(_0xae87bf){return _0xae87bf[_0x62bc('0x23')](_0x3b8644)[_0x62bc('0x24')](function(_0x3b2eb0){return _0x3b2eb0;});}return null;};}function removeEntity(_0x5b2e16,_0x70e428){return function(_0xb0d0fb){if(_0xb0d0fb){return _0xb0d0fb[_0x62bc('0x25')]()[_0x62bc('0x24')](function(){_0x5b2e16[_0x62bc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52ca86,_0xcd4b0){return function(_0x58e76a){if(!_0x58e76a){_0x52ca86[_0x62bc('0x18')](0x194);}return _0x58e76a;};}function handleError(_0x36af97,_0x1e046d){_0x1e046d=_0x1e046d||0x1f4;return function(_0x4a72d6){logger[_0x62bc('0x26')](_0x4a72d6[_0x62bc('0x27')]);if(_0x4a72d6[_0x62bc('0x28')]){delete _0x4a72d6['name'];}_0x36af97['status'](_0x1e046d)[_0x62bc('0x29')](_0x4a72d6);};}exports[_0x62bc('0x2a')]=function(_0x23817c,_0x4df640){var _0x4313ba={},_0x1f2985={},_0x44600f={'count':0x0,'rows':[]};var _0x444267=_['map'](db[_0x62bc('0x2b')]['rawAttributes'],function(_0x26701b){return{'name':_0x26701b[_0x62bc('0x2c')],'type':_0x26701b[_0x62bc('0x2d')][_0x62bc('0x2e')]};});_0x1f2985[_0x62bc('0x2f')]=_[_0x62bc('0x30')](_0x444267,_0x62bc('0x28'));_0x1f2985[_0x62bc('0x31')]=_[_0x62bc('0x32')](_0x23817c[_0x62bc('0x31')]);_0x1f2985[_0x62bc('0x33')]=_[_0x62bc('0x34')](_0x1f2985[_0x62bc('0x2f')],_0x1f2985[_0x62bc('0x31')]);_0x4313ba[_0x62bc('0x35')]=_[_0x62bc('0x34')](_0x1f2985[_0x62bc('0x2f')],qs['fields'](_0x23817c[_0x62bc('0x31')]['fields']));_0x4313ba['attributes']=_0x4313ba[_0x62bc('0x35')]['length']?_0x4313ba['attributes']:_0x1f2985['model'];if(!_0x23817c[_0x62bc('0x31')][_0x62bc('0x36')](_0x62bc('0x37'))){_0x4313ba['limit']=qs['limit'](_0x23817c['query'][_0x62bc('0x1c')]);_0x4313ba[_0x62bc('0x1b')]=qs['offset'](_0x23817c['query'][_0x62bc('0x1b')]);}_0x4313ba[_0x62bc('0x38')]=qs[_0x62bc('0x39')](_0x23817c['query'][_0x62bc('0x39')]);_0x4313ba[_0x62bc('0x3a')]=qs[_0x62bc('0x33')](_[_0x62bc('0x3b')](_0x23817c['query'],_0x1f2985[_0x62bc('0x33')]),_0x444267);if(_0x23817c[_0x62bc('0x31')]['filter']){_0x4313ba[_0x62bc('0x3a')]=_[_0x62bc('0x3c')](_0x4313ba[_0x62bc('0x3a')],{'$or':_[_0x62bc('0x30')](_0x444267,function(_0x599aed){if(_0x599aed[_0x62bc('0x2d')]!=='VIRTUAL'){var _0x38230a={};_0x38230a[_0x599aed[_0x62bc('0x28')]]={'$like':'%'+_0x23817c[_0x62bc('0x31')][_0x62bc('0x3d')]+'%'};return _0x38230a;}})});}_0x4313ba=_['merge']({},_0x4313ba,_0x23817c[_0x62bc('0x3e')]);var _0x5c806b={'where':_0x4313ba[_0x62bc('0x3a')]};return db[_0x62bc('0x2b')][_0x62bc('0x1e')](_0x5c806b)[_0x62bc('0x24')](function(_0x9011f2){_0x44600f[_0x62bc('0x1e')]=_0x9011f2;if(_0x23817c[_0x62bc('0x31')][_0x62bc('0x3f')]){_0x4313ba[_0x62bc('0x40')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x4313ba);})[_0x62bc('0x24')](function(_0x400779){_0x44600f['rows']=_0x400779;return _0x44600f;})[_0x62bc('0x24')](respondWithFilteredResult(_0x4df640,_0x4313ba))[_0x62bc('0x41')](handleError(_0x4df640,null));};exports[_0x62bc('0x42')]=function(_0xedc9f3,_0xbd8c7e){var _0x5f3752={'raw':!![],'where':{'id':_0xedc9f3[_0x62bc('0x43')]['id']}},_0x3bf043={};_0x3bf043['model']=_['keys'](db[_0x62bc('0x2b')][_0x62bc('0x44')]);_0x3bf043[_0x62bc('0x31')]=_['keys'](_0xedc9f3[_0x62bc('0x31')]);_0x3bf043[_0x62bc('0x33')]=_[_0x62bc('0x34')](_0x3bf043[_0x62bc('0x2f')],_0x3bf043[_0x62bc('0x31')]);_0x5f3752[_0x62bc('0x35')]=_['intersection'](_0x3bf043[_0x62bc('0x2f')],qs['fields'](_0xedc9f3[_0x62bc('0x31')][_0x62bc('0x45')]));_0x5f3752[_0x62bc('0x35')]=_0x5f3752['attributes']['length']?_0x5f3752['attributes']:_0x3bf043[_0x62bc('0x2f')];if(_0xedc9f3['query'][_0x62bc('0x3f')]){_0x5f3752[_0x62bc('0x40')]=[{'all':!![]}];}_0x5f3752=_['merge']({},_0x5f3752,_0xedc9f3['options']);return db['FreshdeskField'][_0x62bc('0x46')](_0x5f3752)[_0x62bc('0x24')](handleEntityNotFound(_0xbd8c7e,null))[_0x62bc('0x24')](respondWithResult(_0xbd8c7e,null))[_0x62bc('0x41')](handleError(_0xbd8c7e,null));};exports[_0x62bc('0x47')]=function(_0x49389f,_0x3834b2){return db[_0x62bc('0x2b')]['create'](_0x49389f[_0x62bc('0x48')],{})['then'](respondWithResult(_0x3834b2,0xc9))[_0x62bc('0x41')](handleError(_0x3834b2,null));};exports[_0x62bc('0x23')]=function(_0x17e0ec,_0xca6190){if(_0x17e0ec[_0x62bc('0x48')]['id']){delete _0x17e0ec[_0x62bc('0x48')]['id'];}return db[_0x62bc('0x2b')]['find']({'where':{'id':_0x17e0ec[_0x62bc('0x43')]['id']}})[_0x62bc('0x24')](handleEntityNotFound(_0xca6190,null))['then'](saveUpdates(_0x17e0ec[_0x62bc('0x48')],null))['then'](respondWithResult(_0xca6190,null))[_0x62bc('0x41')](handleError(_0xca6190,null));};exports[_0x62bc('0x25')]=function(_0x4bec08,_0x6c2969){return db[_0x62bc('0x2b')][_0x62bc('0x46')]({'where':{'id':_0x4bec08['params']['id']}})[_0x62bc('0x24')](handleEntityNotFound(_0x6c2969,null))[_0x62bc('0x24')](removeEntity(_0x6c2969,null))[_0x62bc('0x41')](handleError(_0x6c2969,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index a2470ec..fa863b9 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 _0xebec=['path','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4b49c9,_0x290d55){var _0xab2d67=function(_0x3a8e9c){while(--_0x3a8e9c){_0x4b49c9['push'](_0x4b49c9['shift']());}};_0xab2d67(++_0x290d55);}(_0xebec,0x135));var _0xcebe=function(_0x4e02bc,_0x5aa8ea){_0x4e02bc=_0x4e02bc-0x0;var _0x38f644=_0xebec[_0x4e02bc];return _0x38f644;};'use strict';var _=require(_0xcebe('0x0'));var util=require(_0xcebe('0x1'));var logger=require(_0xcebe('0x2'))('api');var moment=require(_0xcebe('0x3'));var BPromise=require(_0xcebe('0x4'));var rp=require(_0xcebe('0x5'));var fs=require('fs');var path=require(_0xcebe('0x6'));var rimraf=require('rimraf');var config=require(_0xcebe('0x7'));var attributes=require(_0xcebe('0x8'));module[_0xcebe('0x9')]=function(_0x348d0c,_0x45c7c9){return _0x348d0c[_0xcebe('0xa')](_0xcebe('0xb'),attributes,{'tableName':_0xcebe('0xc'),'paranoid':![],'indexes':[{'name':_0xcebe('0xd'),'fields':['idField',_0xcebe('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ec8=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2ec8,0x185));var _0x82ec=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2ec8[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x82ec('0x0'));var logger=require(_0x82ec('0x1'))(_0x82ec('0x2'));var moment=require('moment');var BPromise=require(_0x82ec('0x3'));var rp=require(_0x82ec('0x4'));var fs=require('fs');var path=require(_0x82ec('0x5'));var rimraf=require(_0x82ec('0x6'));var config=require(_0x82ec('0x7'));var attributes=require(_0x82ec('0x8'));module[_0x82ec('0x9')]=function(_0x15cd9c,_0x5da57e){return _0x15cd9c[_0x82ec('0xa')](_0x82ec('0xb'),attributes,{'tableName':_0x82ec('0xc'),'paranoid':![],'indexes':[{'name':_0x82ec('0xd'),'fields':[_0x82ec('0xe'),_0x82ec('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 86c378d..eb3e462 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 _0xed80=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xed80,0x113));var _0x0ed8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xed80[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x0ed8('0x0'));var moment=require(_0x0ed8('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ed8('0x2'));var fs=require('fs');var Redis=require(_0x0ed8('0x3'));var db=require(_0x0ed8('0x4'))['db'];var utils=require(_0x0ed8('0x5'));var logger=require(_0x0ed8('0x6'))(_0x0ed8('0x7'));var config=require(_0x0ed8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0ed8('0x9')][_0x0ed8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3519de,_0x4a1c38,_0x35cd78){return new BPromise(function(_0x3396a5,_0x510d09){return client[_0x0ed8('0xb')](_0x3519de,_0x35cd78)['then'](function(_0x34c009){logger[_0x0ed8('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x4a1c38,_0x0ed8('0xd'));logger[_0x0ed8('0xe')](_0x0ed8('0xf'),_0x4a1c38,_0x0ed8('0xd'),JSON[_0x0ed8('0x10')](_0x34c009));if(_0x34c009[_0x0ed8('0x11')]){if(_0x34c009[_0x0ed8('0x11')]['code']===0x1f4){logger[_0x0ed8('0x11')](_0x0ed8('0x12'),_0x4a1c38,_0x34c009['error']['message']);return _0x510d09(_0x34c009[_0x0ed8('0x11')]['message']);}logger[_0x0ed8('0x11')](_0x0ed8('0x12'),_0x4a1c38,_0x34c009[_0x0ed8('0x11')][_0x0ed8('0x13')]);return _0x3396a5(_0x34c009[_0x0ed8('0x11')][_0x0ed8('0x13')]);}else{logger[_0x0ed8('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x4a1c38,_0x0ed8('0xd'));_0x3396a5(_0x34c009['result'][_0x0ed8('0x13')]);}})['catch'](function(_0x588e49){logger[_0x0ed8('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x4a1c38,_0x588e49);_0x510d09(_0x588e49);});});} \ No newline at end of file +var _0x41ca=['client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x41ca,0x15d));var _0xa41c=function(_0x39757d,_0x5dd295){_0x39757d=_0x39757d-0x0;var _0x5e5862=_0x41ca[_0x39757d];return _0x5e5862;};'use strict';var _=require(_0xa41c('0x0'));var util=require(_0xa41c('0x1'));var moment=require(_0xa41c('0x2'));var BPromise=require(_0xa41c('0x3'));var rs=require(_0xa41c('0x4'));var fs=require('fs');var Redis=require(_0xa41c('0x5'));var db=require(_0xa41c('0x6'))['db'];var utils=require(_0xa41c('0x7'));var logger=require(_0xa41c('0x8'))(_0xa41c('0x9'));var config=require('../../config/environment');var jayson=require(_0xa41c('0xa'));var client=jayson[_0xa41c('0xb')][_0xa41c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9ea53b,_0x1beda,_0x444219){return new BPromise(function(_0x235606,_0x352b9b){return client[_0xa41c('0xd')](_0x9ea53b,_0x444219)[_0xa41c('0xe')](function(_0x3641a7){logger[_0xa41c('0xf')](_0xa41c('0x10'),_0x1beda,_0xa41c('0x11'));logger[_0xa41c('0x12')](_0xa41c('0x13'),_0x1beda,_0xa41c('0x11'),JSON[_0xa41c('0x14')](_0x3641a7));if(_0x3641a7[_0xa41c('0x15')]){if(_0x3641a7[_0xa41c('0x15')]['code']===0x1f4){logger[_0xa41c('0x15')](_0xa41c('0x10'),_0x1beda,_0x3641a7[_0xa41c('0x15')][_0xa41c('0x16')]);return _0x352b9b(_0x3641a7['error']['message']);}logger[_0xa41c('0x15')](_0xa41c('0x10'),_0x1beda,_0x3641a7[_0xa41c('0x15')][_0xa41c('0x16')]);return _0x235606(_0x3641a7[_0xa41c('0x15')][_0xa41c('0x16')]);}else{logger[_0xa41c('0xf')](_0xa41c('0x10'),_0x1beda,_0xa41c('0x11'));_0x235606(_0x3641a7[_0xa41c('0x17')]['message']);}})['catch'](function(_0x40e7e8){logger[_0xa41c('0x15')](_0xa41c('0x10'),_0x1beda,_0x40e7e8);_0x352b9b(_0x40e7e8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 9dc92ac..de3d9a2 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 _0x3f8c=['index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f8c,0x104));var _0xc3f8=function(_0x9d14f6,_0x1b4cce){_0x9d14f6=_0x9d14f6-0x0;var _0x258b6e=_0x3f8c[_0x9d14f6];return _0x258b6e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3f8('0x0'));var timeout=require(_0xc3f8('0x1'));var express=require(_0xc3f8('0x2'));var router=express[_0xc3f8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xc3f8('0x4')]('/',auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x6')]);router[_0xc3f8('0x4')](_0xc3f8('0x7'),auth[_0xc3f8('0x5')](),controller['show']);router[_0xc3f8('0x4')](_0xc3f8('0x8'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x9')]);router[_0xc3f8('0x4')](_0xc3f8('0xa'),auth[_0xc3f8('0x5')](),controller['getFields']);router[_0xc3f8('0xb')]('/',auth[_0xc3f8('0x5')](),controller[_0xc3f8('0xc')]);router[_0xc3f8('0xb')]('/:id/configurations',auth[_0xc3f8('0x5')](),controller[_0xc3f8('0xd')]);router[_0xc3f8('0xe')](_0xc3f8('0x7'),auth['isAuthenticated'](),controller[_0xc3f8('0xf')]);router[_0xc3f8('0x10')](_0xc3f8('0x7'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x11')]);module[_0xc3f8('0x12')]=router; \ No newline at end of file +var _0xe205=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xe205,0xa7));var _0x5e20=function(_0x4e8bec,_0x5198ba){_0x4e8bec=_0x4e8bec-0x0;var _0x4b464e=_0xe205[_0x4e8bec];return _0x4b464e;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var fs_extra=require(_0x5e20('0x6'));var auth=require(_0x5e20('0x7'));var interaction=require(_0x5e20('0x8'));var config=require('../../config/environment');var controller=require(_0x5e20('0x9'));router[_0x5e20('0xa')]('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0xc')]);router['get']('/:id',auth[_0x5e20('0xb')](),controller['show']);router['get'](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['getConfigurations']);router[_0x5e20('0xa')](_0x5e20('0xe'),auth[_0x5e20('0xb')](),controller[_0x5e20('0xf')]);router['post']('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0x10')]);router[_0x5e20('0x11')](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x12')]);router['put'](_0x5e20('0x13'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x14')]);router['delete'](_0x5e20('0x13'),auth['isAuthenticated'](),controller[_0x5e20('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 62d708c..f58538a 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 _0x32b6=['remoteUri','sequelize','exports','STRING'];(function(_0x27d443,_0x4ee5ec){var _0x21b822=function(_0x4c6296){while(--_0x4c6296){_0x27d443['push'](_0x27d443['shift']());}};_0x21b822(++_0x4ee5ec);}(_0x32b6,0x1d1));var _0x632b=function(_0x509d6e,_0x1de6e0){_0x509d6e=_0x509d6e-0x0;var _0x1dcc7f=_0x32b6[_0x509d6e];return _0x1dcc7f;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x632b('0x2')]},'username':{'type':Sequelize[_0x632b('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x632b('0x2')],'unique':_0x632b('0x3')},'serverUrl':{'type':Sequelize[_0x632b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x896e=['exports','STRING','username','remoteUri','sequelize'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0x896e,0x1e9));var _0xe896=function(_0x151d01,_0x98e0a0){_0x151d01=_0x151d01-0x0;var _0x1bf789=_0x896e[_0x151d01];return _0x1bf789;};'use strict';var Sequelize=require(_0xe896('0x0'));module[_0xe896('0x1')]={'name':{'type':Sequelize[_0xe896('0x2')]},'description':{'type':Sequelize[_0xe896('0x2')]},'username':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x3')},'apiKey':{'type':Sequelize[_0xe896('0x2')]},'remoteUri':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x4')},'serverUrl':{'type':Sequelize[_0xe896('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 39d3db0..cdf99d1 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 _0x28e4=['%s%s','Token\x20token=','apiKey','users','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','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','index','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','FreshsalesAccount','includeAll','include','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','pick','options','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format'];(function(_0x15eb24,_0x3d50d0){var _0x549ec9=function(_0x3e7c89){while(--_0x3e7c89){_0x15eb24['push'](_0x15eb24['shift']());}};_0x549ec9(++_0x3d50d0);}(_0x28e4,0x1ae));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x428e('0x0'));var rimraf=require(_0x428e('0x1'));var zipdir=require(_0x428e('0x2'));var jsonpatch=require(_0x428e('0x3'));var rp=require(_0x428e('0x4'));var moment=require(_0x428e('0x5'));var BPromise=require(_0x428e('0x6'));var Mustache=require(_0x428e('0x7'));var util=require(_0x428e('0x8'));var path=require('path');var sox=require(_0x428e('0x9'));var csv=require(_0x428e('0xa'));var ejs=require(_0x428e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x428e('0xc'));var squel=require(_0x428e('0xd'));var crypto=require('crypto');var jsforce=require(_0x428e('0xe'));var deskjs=require(_0x428e('0xf'));var toCsv=require(_0x428e('0xa'));var querystring=require(_0x428e('0x10'));var Papa=require(_0x428e('0x11'));var Redis=require(_0x428e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x428e('0x13'));var as=require(_0x428e('0x14'));var hardwareService=require(_0x428e('0x15'));var logger=require('../../config/logger')(_0x428e('0x16'));var utils=require(_0x428e('0x17'));var config=require(_0x428e('0x18'));var licenseUtil=require(_0x428e('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x428e('0x1a'));function respondWithStatusCode(_0x544c40,_0x22903c){_0x22903c=_0x22903c||0xcc;return function(_0x3721a4){if(_0x3721a4){return _0x544c40[_0x428e('0x1b')](_0x22903c);}return _0x544c40['status'](_0x22903c)[_0x428e('0x1c')]();};}function respondWithResult(_0x8ea4b3,_0x15b206){_0x15b206=_0x15b206||0xc8;return function(_0x50109d){if(_0x50109d){return _0x8ea4b3[_0x428e('0x1d')](_0x15b206)[_0x428e('0x1e')](_0x50109d);}};}function respondWithFilteredResult(_0x474102,_0xb7b979){return function(_0x357e2e){if(_0x357e2e){var _0x28870d=typeof _0xb7b979[_0x428e('0x1f')]===_0x428e('0x20')&&typeof _0xb7b979[_0x428e('0x21')]===_0x428e('0x20');var _0x31d2ed=_0x357e2e[_0x428e('0x22')];var _0x126b72=_0x28870d?0x0:_0xb7b979[_0x428e('0x1f')];var _0x5dbd0d=_0x28870d?_0x357e2e[_0x428e('0x22')]:_0xb7b979[_0x428e('0x1f')]+_0xb7b979['limit'];var _0x1e8708;if(_0x5dbd0d>=_0x31d2ed){_0x5dbd0d=_0x31d2ed;_0x1e8708=0xc8;}else{_0x1e8708=0xce;}_0x474102[_0x428e('0x1d')](_0x1e8708);return _0x474102[_0x428e('0x23')](_0x428e('0x24'),_0x126b72+'-'+_0x5dbd0d+'/'+_0x31d2ed)[_0x428e('0x1e')](_0x357e2e);}return null;};}function patchUpdates(_0xdf8fd7){return function(_0x24bc04){try{jsonpatch[_0x428e('0x25')](_0x24bc04,_0xdf8fd7,!![]);}catch(_0x56af62){return BPromise[_0x428e('0x26')](_0x56af62);}return _0x24bc04[_0x428e('0x27')]();};}function saveUpdates(_0x3518fc,_0xa507d4){return function(_0x3ea728){if(_0x3ea728){return _0x3ea728['update'](_0x3518fc)[_0x428e('0x28')](function(_0x4cfca4){return _0x4cfca4;});}return null;};}function removeEntity(_0x1007b0,_0x2c9b05){return function(_0x418607){if(_0x418607){return _0x418607[_0x428e('0x29')]()[_0x428e('0x28')](function(){_0x1007b0['status'](0xcc)[_0x428e('0x1c')]();});}};}function handleEntityNotFound(_0x134f86,_0x5c88bf){return function(_0x4a064c){if(!_0x4a064c){_0x134f86['sendStatus'](0x194);}return _0x4a064c;};}function handleError(_0x313fea,_0x2204d0){_0x2204d0=_0x2204d0||0x1f4;return function(_0x5f5190){logger[_0x428e('0x2a')](_0x5f5190['stack']);if(_0x5f5190[_0x428e('0x2b')]){delete _0x5f5190[_0x428e('0x2b')];}_0x313fea[_0x428e('0x1d')](_0x2204d0)['send'](_0x5f5190);};}exports[_0x428e('0x2c')]=function(_0x3f7712,_0x13d10c){var _0x43daf5={},_0x480f14={},_0x2d7b81={'count':0x0,'rows':[]};var _0x94e0fd=_['map'](db['FreshsalesAccount'][_0x428e('0x2d')],function(_0xf175ca){return{'name':_0xf175ca[_0x428e('0x2e')],'type':_0xf175ca['type']['key']};});_0x480f14[_0x428e('0x2f')]=_[_0x428e('0x30')](_0x94e0fd,_0x428e('0x2b'));_0x480f14[_0x428e('0x31')]=_[_0x428e('0x32')](_0x3f7712['query']);_0x480f14['filters']=_[_0x428e('0x33')](_0x480f14['model'],_0x480f14[_0x428e('0x31')]);_0x43daf5[_0x428e('0x34')]=_[_0x428e('0x33')](_0x480f14['model'],qs[_0x428e('0x35')](_0x3f7712['query'][_0x428e('0x35')]));_0x43daf5['attributes']=_0x43daf5[_0x428e('0x34')]['length']?_0x43daf5[_0x428e('0x34')]:_0x480f14['model'];if(!_0x3f7712[_0x428e('0x31')][_0x428e('0x36')](_0x428e('0x37'))){_0x43daf5[_0x428e('0x21')]=qs[_0x428e('0x21')](_0x3f7712[_0x428e('0x31')][_0x428e('0x21')]);_0x43daf5[_0x428e('0x1f')]=qs[_0x428e('0x1f')](_0x3f7712[_0x428e('0x31')][_0x428e('0x1f')]);}_0x43daf5[_0x428e('0x38')]=qs[_0x428e('0x39')](_0x3f7712[_0x428e('0x31')][_0x428e('0x39')]);_0x43daf5[_0x428e('0x3a')]=qs[_0x428e('0x3b')](_['pick'](_0x3f7712[_0x428e('0x31')],_0x480f14[_0x428e('0x3b')]),_0x94e0fd);if(_0x3f7712['query'][_0x428e('0x3c')]){_0x43daf5[_0x428e('0x3a')]=_[_0x428e('0x3d')](_0x43daf5[_0x428e('0x3a')],{'$or':_[_0x428e('0x30')](_0x94e0fd,function(_0x36f221){if(_0x36f221[_0x428e('0x3e')]!==_0x428e('0x3f')){var _0x167976={};_0x167976[_0x36f221['name']]={'$like':'%'+_0x3f7712['query'][_0x428e('0x3c')]+'%'};return _0x167976;}})});}_0x43daf5=_[_0x428e('0x3d')]({},_0x43daf5,_0x3f7712['options']);var _0xc43d30={'where':_0x43daf5[_0x428e('0x3a')]};return db[_0x428e('0x40')][_0x428e('0x22')](_0xc43d30)['then'](function(_0x582821){_0x2d7b81['count']=_0x582821;if(_0x3f7712['query'][_0x428e('0x41')]){_0x43daf5[_0x428e('0x42')]=[{'all':!![]}];}return db[_0x428e('0x40')]['findAll'](_0x43daf5);})[_0x428e('0x28')](function(_0x50b2b1){_0x2d7b81[_0x428e('0x43')]=_0x50b2b1;return _0x2d7b81;})[_0x428e('0x28')](respondWithFilteredResult(_0x13d10c,_0x43daf5))[_0x428e('0x44')](handleError(_0x13d10c,null));};exports[_0x428e('0x45')]=function(_0x21a5a1,_0x25354e){var _0x4a788e={'raw':![],'where':{'id':_0x21a5a1['params']['id']}},_0x21b84c={};_0x21b84c[_0x428e('0x2f')]=_[_0x428e('0x32')](db[_0x428e('0x40')][_0x428e('0x2d')]);_0x21b84c['query']=_[_0x428e('0x32')](_0x21a5a1[_0x428e('0x31')]);_0x21b84c[_0x428e('0x3b')]=_[_0x428e('0x33')](_0x21b84c[_0x428e('0x2f')],_0x21b84c[_0x428e('0x31')]);_0x4a788e[_0x428e('0x34')]=_[_0x428e('0x33')](_0x21b84c['model'],qs[_0x428e('0x35')](_0x21a5a1['query'][_0x428e('0x35')]));_0x4a788e[_0x428e('0x34')]=_0x4a788e[_0x428e('0x34')][_0x428e('0x46')]?_0x4a788e[_0x428e('0x34')]:_0x21b84c[_0x428e('0x2f')];if(_0x21a5a1[_0x428e('0x31')][_0x428e('0x41')]){_0x4a788e[_0x428e('0x42')]=[{'all':!![]}];}_0x4a788e=_['merge']({},_0x4a788e,_0x21a5a1['options']);return db[_0x428e('0x40')][_0x428e('0x47')](_0x4a788e)[_0x428e('0x28')](handleEntityNotFound(_0x25354e,null))[_0x428e('0x28')](respondWithResult(_0x25354e,null))[_0x428e('0x44')](handleError(_0x25354e,null));};exports[_0x428e('0x48')]=function(_0xd52d9f,_0x177c2f){return db[_0x428e('0x40')][_0x428e('0x48')](_0xd52d9f[_0x428e('0x49')],{})[_0x428e('0x28')](respondWithResult(_0x177c2f,0xc9))[_0x428e('0x44')](handleError(_0x177c2f,null));};exports['update']=function(_0x2c84fe,_0x45dd1d){if(_0x2c84fe['body']['id']){delete _0x2c84fe[_0x428e('0x49')]['id'];}return db['FreshsalesAccount'][_0x428e('0x47')]({'where':{'id':_0x2c84fe[_0x428e('0x4a')]['id']}})[_0x428e('0x28')](handleEntityNotFound(_0x45dd1d,null))[_0x428e('0x28')](saveUpdates(_0x2c84fe[_0x428e('0x49')],null))[_0x428e('0x28')](respondWithResult(_0x45dd1d,null))[_0x428e('0x44')](handleError(_0x45dd1d,null));};exports['destroy']=function(_0x232247,_0x5bce41){return db[_0x428e('0x40')][_0x428e('0x47')]({'where':{'id':_0x232247['params']['id']}})[_0x428e('0x28')](handleEntityNotFound(_0x5bce41,null))[_0x428e('0x28')](removeEntity(_0x5bce41,null))['catch'](handleError(_0x5bce41,null));};exports[_0x428e('0x4b')]=function(_0x2527eb,_0xffd22f,_0x404e48){var _0x11de3f={};var _0x4dcbbb={};var _0x49d2e6;var _0x3c993c;return db[_0x428e('0x40')][_0x428e('0x4c')]({'where':{'id':_0x2527eb['params']['id']}})['then'](handleEntityNotFound(_0xffd22f,null))[_0x428e('0x28')](function(_0x3a4e57){if(_0x3a4e57){_0x49d2e6=_0x3a4e57;_0x4dcbbb[_0x428e('0x2f')]=_[_0x428e('0x32')](db[_0x428e('0x4d')][_0x428e('0x2d')]);_0x4dcbbb[_0x428e('0x31')]=_[_0x428e('0x32')](_0x2527eb['query']);_0x4dcbbb[_0x428e('0x3b')]=_[_0x428e('0x33')](_0x4dcbbb['model'],_0x4dcbbb[_0x428e('0x31')]);_0x11de3f[_0x428e('0x34')]=_[_0x428e('0x33')](_0x4dcbbb[_0x428e('0x2f')],qs[_0x428e('0x35')](_0x2527eb['query'][_0x428e('0x35')]));_0x11de3f[_0x428e('0x34')]=_0x11de3f[_0x428e('0x34')][_0x428e('0x46')]?_0x11de3f[_0x428e('0x34')]:_0x4dcbbb[_0x428e('0x2f')];_0x11de3f['order']=qs['sort'](_0x2527eb['query'][_0x428e('0x39')]);_0x11de3f[_0x428e('0x3a')]=qs['filters'](_[_0x428e('0x4e')](_0x2527eb[_0x428e('0x31')],_0x4dcbbb[_0x428e('0x3b')]));if(_0x2527eb[_0x428e('0x31')]['filter']){_0x11de3f[_0x428e('0x3a')]=_[_0x428e('0x3d')](_0x11de3f[_0x428e('0x3a')],{'$or':_[_0x428e('0x30')](_0x11de3f['attributes'],function(_0xcbdaf5){var _0x20fb06={};_0x20fb06[_0xcbdaf5]={'$like':'%'+_0x2527eb[_0x428e('0x31')][_0x428e('0x3c')]+'%'};return _0x20fb06;})});}_0x11de3f=_[_0x428e('0x3d')]({},_0x11de3f,_0x2527eb[_0x428e('0x4f')]);return _0x49d2e6[_0x428e('0x4b')](_0x11de3f);}})[_0x428e('0x28')](function(_0x4093ff){if(_0x4093ff){_0x3c993c=_0x4093ff['length'];if(!_0x2527eb[_0x428e('0x31')][_0x428e('0x36')](_0x428e('0x37'))){_0x11de3f[_0x428e('0x21')]=qs[_0x428e('0x21')](_0x2527eb['query'][_0x428e('0x21')]);_0x11de3f['offset']=qs[_0x428e('0x1f')](_0x2527eb[_0x428e('0x31')][_0x428e('0x1f')]);}return _0x49d2e6[_0x428e('0x4b')](_0x11de3f);}})[_0x428e('0x28')](function(_0x416955){if(_0x416955){return _0x416955?{'count':_0x3c993c,'rows':_0x416955}:null;}})['then'](respondWithResult(_0xffd22f,null))[_0x428e('0x44')](handleError(_0xffd22f,null));};exports[_0x428e('0x50')]=function(_0x38a712,_0x260767,_0x3463b3){if(_0x38a712[_0x428e('0x49')]['id']){delete _0x38a712['body']['id'];}return db[_0x428e('0x40')]['findOne']({'where':{'id':_0x38a712[_0x428e('0x4a')]['id']}})[_0x428e('0x28')](handleEntityNotFound(_0x260767,null))[_0x428e('0x28')](function(_0x64bace){if(_0x64bace){_0x38a712[_0x428e('0x49')][_0x428e('0x51')]=_0x64bace['id'];_0x38a712[_0x428e('0x49')][_0x428e('0x52')]=integrations['getSubjects'](_0x38a712[_0x428e('0x49')][_0x428e('0x53')],_0x38a712[_0x428e('0x49')][_0x428e('0x3e')]);_0x38a712[_0x428e('0x49')][_0x428e('0x54')]=integrations[_0x428e('0x55')](_0x38a712[_0x428e('0x49')][_0x428e('0x53')],_0x38a712[_0x428e('0x49')][_0x428e('0x3e')]);return db[_0x428e('0x4d')][_0x428e('0x48')](_0x38a712[_0x428e('0x49')],{'include':[{'model':db[_0x428e('0x56')],'as':'Subjects'},{'model':db[_0x428e('0x56')],'as':_0x428e('0x54')}]});}return null;})[_0x428e('0x28')](respondWithResult(_0x260767,null))[_0x428e('0x44')](handleError(_0x260767,null));};exports[_0x428e('0x57')]=function(_0x263e75,_0x4bc266,_0x1ee031){var _0x158ccf='';var _0x50da15='';return db[_0x428e('0x40')][_0x428e('0x4c')]({'where':{'id':_0x263e75[_0x428e('0x4a')]['id']},'attributes':['id',_0x428e('0x58'),_0x428e('0x59'),'apiKey']})[_0x428e('0x28')](handleEntityNotFound(_0x4bc266,null))[_0x428e('0x28')](function(_0x1c9b65){if(_0x1c9b65){_0x50da15=_0x1c9b65[_0x428e('0x58')];_0x158ccf=_0x1c9b65[_0x428e('0x59')];var _0x55a9f9=_0x1c9b65['remoteUri'][_0x428e('0x5a')](-0x1);if(_0x55a9f9==='/'){_0x158ccf=_0x158ccf[_0x428e('0x5b')](0x0,_0x158ccf[_0x428e('0x5c')](_0x55a9f9));}return rp({'method':_0x428e('0x5d'),'uri':util[_0x428e('0x5e')](_0x428e('0x5f'),_0x158ccf,'/api/selector/owners'),'headers':{'Authorization':_0x428e('0x60')+_0x1c9b65[_0x428e('0x61')]},'json':!![]});}})[_0x428e('0x28')](function(_0x5d11d5){if(_0x5d11d5){var _0x1a3ba9=_0x5d11d5[_0x428e('0x62')];var _0xddc545=![];var _0x5e1878=null;for(_0x5e1878=0x0;_0x5e1878<_0x1a3ba9[_0x428e('0x46')];_0x5e1878++){if(_0x1a3ba9[_0x5e1878]['email']===_0x50da15){_0xddc545=!![];}}if(_0xddc545){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x428e('0x28')](respondWithResult(_0x4bc266,null))['catch'](function(_0x2a8f38){var _0x2cb6d4=_0x263e75[_0x428e('0x31')][_0x428e('0x63')]?0x1f4:_0x2a8f38[_0x428e('0x64')]||0x1f4;logger['error'](_0x428e('0x65'),'getFields',_0x2cb6d4,JSON[_0x428e('0x66')](_0x2a8f38));delete _0x2a8f38['name'];if(_0x2cb6d4===0x191){_0x2cb6d4=0x190;}_0x4bc266['status'](_0x2cb6d4)[_0x428e('0x67')](_0x263e75[_0x428e('0x31')][_0x428e('0x63')]?{'message':_0x428e('0x68'),'statusCode':_0x2a8f38[_0x428e('0x64')]}:_0x2a8f38);});}; \ No newline at end of file +var _0x21d8=['../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshsalesField','Subjects','Descriptions','getFields','username','remoteUri','substring','lastIndexOf','format','/api/selector/owners','Token\x20token=','apiKey','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1e7c7a,_0x15ee56){var _0x16a846=function(_0x1e0ac0){while(--_0x1e0ac0){_0x1e7c7a['push'](_0x1e7c7a['shift']());}};_0x16a846(++_0x15ee56);}(_0x21d8,0x121));var _0x821d=function(_0x1eb5df,_0x27a6a1){_0x1eb5df=_0x1eb5df-0x0;var _0xd6325c=_0x21d8[_0x1eb5df];return _0xd6325c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x821d('0x0'));var zipdir=require(_0x821d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x821d('0x2'));var moment=require(_0x821d('0x3'));var BPromise=require(_0x821d('0x4'));var Mustache=require(_0x821d('0x5'));var util=require(_0x821d('0x6'));var path=require(_0x821d('0x7'));var sox=require(_0x821d('0x8'));var csv=require(_0x821d('0x9'));var ejs=require(_0x821d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x821d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x821d('0xc'));var toCsv=require(_0x821d('0x9'));var querystring=require(_0x821d('0xd'));var Papa=require(_0x821d('0xe'));var Redis=require(_0x821d('0xf'));var authService=require(_0x821d('0x10'));var qs=require(_0x821d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x821d('0x12'));var logger=require('../../config/logger')(_0x821d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x821d('0x14'));var db=require(_0x821d('0x15'))['db'];var integrations=require(_0x821d('0x16'));function respondWithStatusCode(_0x2fbf45,_0x3ca1fd){_0x3ca1fd=_0x3ca1fd||0xcc;return function(_0x4b1a35){if(_0x4b1a35){return _0x2fbf45[_0x821d('0x17')](_0x3ca1fd);}return _0x2fbf45[_0x821d('0x18')](_0x3ca1fd)[_0x821d('0x19')]();};}function respondWithResult(_0x2c743f,_0x387d2c){_0x387d2c=_0x387d2c||0xc8;return function(_0x37f6fc){if(_0x37f6fc){return _0x2c743f[_0x821d('0x18')](_0x387d2c)[_0x821d('0x1a')](_0x37f6fc);}};}function respondWithFilteredResult(_0x2facd6,_0x5d870b){return function(_0x2d8636){if(_0x2d8636){var _0x274f48=typeof _0x5d870b[_0x821d('0x1b')]===_0x821d('0x1c')&&typeof _0x5d870b[_0x821d('0x1d')]==='undefined';var _0x5c505f=_0x2d8636['count'];var _0x4d0447=_0x274f48?0x0:_0x5d870b[_0x821d('0x1b')];var _0x4b41b1=_0x274f48?_0x2d8636[_0x821d('0x1e')]:_0x5d870b[_0x821d('0x1b')]+_0x5d870b['limit'];var _0x189e78;if(_0x4b41b1>=_0x5c505f){_0x4b41b1=_0x5c505f;_0x189e78=0xc8;}else{_0x189e78=0xce;}_0x2facd6[_0x821d('0x18')](_0x189e78);return _0x2facd6[_0x821d('0x1f')](_0x821d('0x20'),_0x4d0447+'-'+_0x4b41b1+'/'+_0x5c505f)['json'](_0x2d8636);}return null;};}function patchUpdates(_0x2135fb){return function(_0x55131d){try{jsonpatch[_0x821d('0x21')](_0x55131d,_0x2135fb,!![]);}catch(_0x3b2899){return BPromise[_0x821d('0x22')](_0x3b2899);}return _0x55131d[_0x821d('0x23')]();};}function saveUpdates(_0x50d7f2,_0x45a281){return function(_0x5d7f48){if(_0x5d7f48){return _0x5d7f48['update'](_0x50d7f2)[_0x821d('0x24')](function(_0x4279c8){return _0x4279c8;});}return null;};}function removeEntity(_0x404282,_0x924247){return function(_0x5d6e27){if(_0x5d6e27){return _0x5d6e27['destroy']()[_0x821d('0x24')](function(){_0x404282[_0x821d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aad8c,_0x21d624){return function(_0x2f58fe){if(!_0x2f58fe){_0x2aad8c[_0x821d('0x17')](0x194);}return _0x2f58fe;};}function handleError(_0x40fd38,_0x1e0960){_0x1e0960=_0x1e0960||0x1f4;return function(_0x327dfd){logger['error'](_0x327dfd[_0x821d('0x25')]);if(_0x327dfd[_0x821d('0x26')]){delete _0x327dfd[_0x821d('0x26')];}_0x40fd38['status'](_0x1e0960)[_0x821d('0x27')](_0x327dfd);};}exports[_0x821d('0x28')]=function(_0x2cf055,_0x50176a){var _0xb3da9c={},_0x18aa85={},_0x4e6a2f={'count':0x0,'rows':[]};var _0xf819bc=_['map'](db[_0x821d('0x29')][_0x821d('0x2a')],function(_0x21eff2){return{'name':_0x21eff2[_0x821d('0x2b')],'type':_0x21eff2['type']['key']};});_0x18aa85[_0x821d('0x2c')]=_[_0x821d('0x2d')](_0xf819bc,'name');_0x18aa85[_0x821d('0x2e')]=_[_0x821d('0x2f')](_0x2cf055[_0x821d('0x2e')]);_0x18aa85['filters']=_[_0x821d('0x30')](_0x18aa85['model'],_0x18aa85['query']);_0xb3da9c['attributes']=_[_0x821d('0x30')](_0x18aa85[_0x821d('0x2c')],qs[_0x821d('0x31')](_0x2cf055[_0x821d('0x2e')][_0x821d('0x31')]));_0xb3da9c[_0x821d('0x32')]=_0xb3da9c[_0x821d('0x32')][_0x821d('0x33')]?_0xb3da9c[_0x821d('0x32')]:_0x18aa85['model'];if(!_0x2cf055[_0x821d('0x2e')][_0x821d('0x34')](_0x821d('0x35'))){_0xb3da9c[_0x821d('0x1d')]=qs[_0x821d('0x1d')](_0x2cf055[_0x821d('0x2e')][_0x821d('0x1d')]);_0xb3da9c[_0x821d('0x1b')]=qs[_0x821d('0x1b')](_0x2cf055['query'][_0x821d('0x1b')]);}_0xb3da9c[_0x821d('0x36')]=qs[_0x821d('0x37')](_0x2cf055[_0x821d('0x2e')]['sort']);_0xb3da9c[_0x821d('0x38')]=qs[_0x821d('0x39')](_[_0x821d('0x3a')](_0x2cf055[_0x821d('0x2e')],_0x18aa85['filters']),_0xf819bc);if(_0x2cf055[_0x821d('0x2e')]['filter']){_0xb3da9c['where']=_['merge'](_0xb3da9c[_0x821d('0x38')],{'$or':_[_0x821d('0x2d')](_0xf819bc,function(_0x2fd9b4){if(_0x2fd9b4[_0x821d('0x3b')]!==_0x821d('0x3c')){var _0x3245f1={};_0x3245f1[_0x2fd9b4[_0x821d('0x26')]]={'$like':'%'+_0x2cf055['query'][_0x821d('0x3d')]+'%'};return _0x3245f1;}})});}_0xb3da9c=_[_0x821d('0x3e')]({},_0xb3da9c,_0x2cf055[_0x821d('0x3f')]);var _0x2a1fc0={'where':_0xb3da9c[_0x821d('0x38')]};return db[_0x821d('0x29')][_0x821d('0x1e')](_0x2a1fc0)[_0x821d('0x24')](function(_0x5bed55){_0x4e6a2f[_0x821d('0x1e')]=_0x5bed55;if(_0x2cf055['query'][_0x821d('0x40')]){_0xb3da9c[_0x821d('0x41')]=[{'all':!![]}];}return db[_0x821d('0x29')][_0x821d('0x42')](_0xb3da9c);})[_0x821d('0x24')](function(_0x4641d8){_0x4e6a2f['rows']=_0x4641d8;return _0x4e6a2f;})[_0x821d('0x24')](respondWithFilteredResult(_0x50176a,_0xb3da9c))[_0x821d('0x43')](handleError(_0x50176a,null));};exports[_0x821d('0x44')]=function(_0x2a6498,_0x4cb9b3){var _0x4fce17={'raw':![],'where':{'id':_0x2a6498[_0x821d('0x45')]['id']}},_0x781b06={};_0x781b06['model']=_['keys'](db[_0x821d('0x29')][_0x821d('0x2a')]);_0x781b06['query']=_[_0x821d('0x2f')](_0x2a6498[_0x821d('0x2e')]);_0x781b06[_0x821d('0x39')]=_[_0x821d('0x30')](_0x781b06['model'],_0x781b06[_0x821d('0x2e')]);_0x4fce17[_0x821d('0x32')]=_[_0x821d('0x30')](_0x781b06[_0x821d('0x2c')],qs[_0x821d('0x31')](_0x2a6498[_0x821d('0x2e')][_0x821d('0x31')]));_0x4fce17[_0x821d('0x32')]=_0x4fce17['attributes']['length']?_0x4fce17[_0x821d('0x32')]:_0x781b06[_0x821d('0x2c')];if(_0x2a6498[_0x821d('0x2e')][_0x821d('0x40')]){_0x4fce17[_0x821d('0x41')]=[{'all':!![]}];}_0x4fce17=_[_0x821d('0x3e')]({},_0x4fce17,_0x2a6498[_0x821d('0x3f')]);return db[_0x821d('0x29')][_0x821d('0x46')](_0x4fce17)[_0x821d('0x24')](handleEntityNotFound(_0x4cb9b3,null))[_0x821d('0x24')](respondWithResult(_0x4cb9b3,null))[_0x821d('0x43')](handleError(_0x4cb9b3,null));};exports[_0x821d('0x47')]=function(_0x5d81c4,_0x8329e9){return db['FreshsalesAccount'][_0x821d('0x47')](_0x5d81c4[_0x821d('0x48')],{})[_0x821d('0x24')](respondWithResult(_0x8329e9,0xc9))[_0x821d('0x43')](handleError(_0x8329e9,null));};exports['update']=function(_0x119e86,_0x4b4743){if(_0x119e86[_0x821d('0x48')]['id']){delete _0x119e86[_0x821d('0x48')]['id'];}return db[_0x821d('0x29')][_0x821d('0x46')]({'where':{'id':_0x119e86[_0x821d('0x45')]['id']}})[_0x821d('0x24')](handleEntityNotFound(_0x4b4743,null))['then'](saveUpdates(_0x119e86[_0x821d('0x48')],null))['then'](respondWithResult(_0x4b4743,null))[_0x821d('0x43')](handleError(_0x4b4743,null));};exports[_0x821d('0x49')]=function(_0x27addb,_0x183dcd){return db[_0x821d('0x29')][_0x821d('0x46')]({'where':{'id':_0x27addb['params']['id']}})[_0x821d('0x24')](handleEntityNotFound(_0x183dcd,null))[_0x821d('0x24')](removeEntity(_0x183dcd,null))[_0x821d('0x43')](handleError(_0x183dcd,null));};exports[_0x821d('0x4a')]=function(_0x29aa7c,_0x3b8b39,_0x1819e3){var _0x409435={};var _0x453432={};var _0x5c2acc;var _0x115439;return db[_0x821d('0x29')][_0x821d('0x4b')]({'where':{'id':_0x29aa7c[_0x821d('0x45')]['id']}})[_0x821d('0x24')](handleEntityNotFound(_0x3b8b39,null))[_0x821d('0x24')](function(_0x5cfde6){if(_0x5cfde6){_0x5c2acc=_0x5cfde6;_0x453432[_0x821d('0x2c')]=_[_0x821d('0x2f')](db[_0x821d('0x4c')][_0x821d('0x2a')]);_0x453432[_0x821d('0x2e')]=_[_0x821d('0x2f')](_0x29aa7c[_0x821d('0x2e')]);_0x453432[_0x821d('0x39')]=_['intersection'](_0x453432[_0x821d('0x2c')],_0x453432[_0x821d('0x2e')]);_0x409435['attributes']=_[_0x821d('0x30')](_0x453432[_0x821d('0x2c')],qs['fields'](_0x29aa7c[_0x821d('0x2e')][_0x821d('0x31')]));_0x409435[_0x821d('0x32')]=_0x409435['attributes']['length']?_0x409435[_0x821d('0x32')]:_0x453432[_0x821d('0x2c')];_0x409435['order']=qs['sort'](_0x29aa7c[_0x821d('0x2e')]['sort']);_0x409435[_0x821d('0x38')]=qs[_0x821d('0x39')](_['pick'](_0x29aa7c[_0x821d('0x2e')],_0x453432[_0x821d('0x39')]));if(_0x29aa7c[_0x821d('0x2e')][_0x821d('0x3d')]){_0x409435['where']=_['merge'](_0x409435[_0x821d('0x38')],{'$or':_['map'](_0x409435['attributes'],function(_0x2d74d7){var _0x4b259a={};_0x4b259a[_0x2d74d7]={'$like':'%'+_0x29aa7c[_0x821d('0x2e')][_0x821d('0x3d')]+'%'};return _0x4b259a;})});}_0x409435=_[_0x821d('0x3e')]({},_0x409435,_0x29aa7c[_0x821d('0x3f')]);return _0x5c2acc[_0x821d('0x4a')](_0x409435);}})[_0x821d('0x24')](function(_0x5b416e){if(_0x5b416e){_0x115439=_0x5b416e['length'];if(!_0x29aa7c['query']['hasOwnProperty'](_0x821d('0x35'))){_0x409435[_0x821d('0x1d')]=qs[_0x821d('0x1d')](_0x29aa7c[_0x821d('0x2e')]['limit']);_0x409435[_0x821d('0x1b')]=qs[_0x821d('0x1b')](_0x29aa7c['query'][_0x821d('0x1b')]);}return _0x5c2acc[_0x821d('0x4a')](_0x409435);}})['then'](function(_0x2523e3){if(_0x2523e3){return _0x2523e3?{'count':_0x115439,'rows':_0x2523e3}:null;}})['then'](respondWithResult(_0x3b8b39,null))[_0x821d('0x43')](handleError(_0x3b8b39,null));};exports[_0x821d('0x4d')]=function(_0xe14ef7,_0x2ca7d6,_0x3ffa9c){if(_0xe14ef7[_0x821d('0x48')]['id']){delete _0xe14ef7[_0x821d('0x48')]['id'];}return db[_0x821d('0x29')]['findOne']({'where':{'id':_0xe14ef7[_0x821d('0x45')]['id']}})[_0x821d('0x24')](handleEntityNotFound(_0x2ca7d6,null))[_0x821d('0x24')](function(_0x3594d0){if(_0x3594d0){_0xe14ef7[_0x821d('0x48')][_0x821d('0x4e')]=_0x3594d0['id'];_0xe14ef7[_0x821d('0x48')]['Subjects']=integrations[_0x821d('0x4f')](_0xe14ef7[_0x821d('0x48')][_0x821d('0x50')],_0xe14ef7['body'][_0x821d('0x3b')]);_0xe14ef7['body']['Descriptions']=integrations[_0x821d('0x51')](_0xe14ef7[_0x821d('0x48')][_0x821d('0x50')],_0xe14ef7[_0x821d('0x48')]['type']);return db[_0x821d('0x4c')]['create'](_0xe14ef7[_0x821d('0x48')],{'include':[{'model':db[_0x821d('0x52')],'as':_0x821d('0x53')},{'model':db[_0x821d('0x52')],'as':_0x821d('0x54')}]});}return null;})['then'](respondWithResult(_0x2ca7d6,null))[_0x821d('0x43')](handleError(_0x2ca7d6,null));};exports[_0x821d('0x55')]=function(_0x256b70,_0x70650a,_0x436b04){var _0x32cd36='';var _0x2fb0c1='';return db[_0x821d('0x29')][_0x821d('0x4b')]({'where':{'id':_0x256b70[_0x821d('0x45')]['id']},'attributes':['id',_0x821d('0x56'),_0x821d('0x57'),'apiKey']})['then'](handleEntityNotFound(_0x70650a,null))[_0x821d('0x24')](function(_0x1dbb8e){if(_0x1dbb8e){_0x2fb0c1=_0x1dbb8e[_0x821d('0x56')];_0x32cd36=_0x1dbb8e[_0x821d('0x57')];var _0xcd289a=_0x1dbb8e[_0x821d('0x57')]['slice'](-0x1);if(_0xcd289a==='/'){_0x32cd36=_0x32cd36[_0x821d('0x58')](0x0,_0x32cd36[_0x821d('0x59')](_0xcd289a));}return rp({'method':'GET','uri':util[_0x821d('0x5a')]('%s%s',_0x32cd36,_0x821d('0x5b')),'headers':{'Authorization':_0x821d('0x5c')+_0x1dbb8e[_0x821d('0x5d')]},'json':!![]});}})[_0x821d('0x24')](function(_0x4e2e54){if(_0x4e2e54){var _0x30fd4b=_0x4e2e54['users'];var _0x30d076=![];var _0x5d2600=null;for(_0x5d2600=0x0;_0x5d2600<_0x30fd4b[_0x821d('0x33')];_0x5d2600++){if(_0x30fd4b[_0x5d2600][_0x821d('0x5e')]===_0x2fb0c1){_0x30d076=!![];}}if(_0x30d076){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x821d('0x5f')});}}})['then'](respondWithResult(_0x70650a,null))[_0x821d('0x43')](function(_0x446f58){var _0x3d63b9=_0x256b70[_0x821d('0x2e')][_0x821d('0x60')]?0x1f4:_0x446f58[_0x821d('0x61')]||0x1f4;logger[_0x821d('0x62')](_0x821d('0x63'),_0x821d('0x55'),_0x3d63b9,JSON[_0x821d('0x64')](_0x446f58));delete _0x446f58[_0x821d('0x26')];if(_0x3d63b9===0x191){_0x3d63b9=0x190;}_0x70650a[_0x821d('0x18')](_0x3d63b9)['send'](_0x256b70[_0x821d('0x2e')][_0x821d('0x60')]?{'message':_0x821d('0x65'),'statusCode':_0x446f58[_0x821d('0x61')]}:_0x446f58);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index b3d5ccf..ccda5fc 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 _0x57ca=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x57ca,0x108));var _0xa57c=function(_0x446869,_0x1bfc0c){_0x446869=_0x446869-0x0;var _0x2c9a3a=_0x57ca[_0x446869];return _0x2c9a3a;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));var integrations=require(_0xa57c('0x8'));module[_0xa57c('0x9')]=function(_0x19473f,_0xbdfffb){return _0x19473f[_0xa57c('0xa')](_0xa57c('0xb'),attributes,{'tableName':_0xa57c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x583c=['define','int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshsalesAccount.attributes','exports'];(function(_0x3e5f3b,_0x31e8cd){var _0x33827c=function(_0x5bb434){while(--_0x5bb434){_0x3e5f3b['push'](_0x3e5f3b['shift']());}};_0x33827c(++_0x31e8cd);}(_0x583c,0x12b));var _0xc583=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x583c[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var logger=require(_0xc583('0x2'))(_0xc583('0x3'));var moment=require('moment');var BPromise=require(_0xc583('0x4'));var rp=require(_0xc583('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc583('0x6'));var attributes=require(_0xc583('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xc583('0x8')]=function(_0x365ed6,_0x2719df){return _0x365ed6[_0xc583('0x9')]('FreshsalesAccount',attributes,{'tableName':_0xc583('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 08c40dd..133250e 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 _0x01d9=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshsalesAccount','find','where','stringify','lodash','util','moment'];(function(_0x2ceed4,_0x25ccd9){var _0x1b3081=function(_0x2711ff){while(--_0x2711ff){_0x2ceed4['push'](_0x2ceed4['shift']());}};_0x1b3081(++_0x25ccd9);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}exports[_0x901d('0x17')]=function(_0x285353){var _0x403db9=this;return new Promise(function(_0x38f42b,_0x414171){return db[_0x901d('0x18')][_0x901d('0x19')]({'raw':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x285353['options']?_0x285353['options']['where']||null:null,'attributes':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1c')]||null:null,'limit':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1d')]||null:null,'include':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x285353[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1818d3){return{'model':db[_0x1818d3[_0x901d('0x20')]],'as':_0x1818d3['as'],'attributes':_0x1818d3[_0x901d('0x1c')],'include':_0x1818d3['include']?_[_0x901d('0x1f')](_0x1818d3[_0x901d('0x1e')],function(_0xbc89a5){return{'model':db[_0xbc89a5[_0x901d('0x20')]],'as':_0xbc89a5['as'],'attributes':_0xbc89a5['attributes'],'include':_0xbc89a5[_0x901d('0x1e')]?_[_0x901d('0x1f')](_0xbc89a5[_0x901d('0x1e')],function(_0x3cbe43){return{'model':db[_0x3cbe43[_0x901d('0x20')]],'as':_0x3cbe43['as'],'attributes':_0x3cbe43['attributes']};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0xc52d0f){logger[_0x901d('0xe')](_0x901d('0x17'),_0x285353);logger[_0x901d('0x11')](_0x901d('0x17'),_0x285353,JSON['stringify'](_0xc52d0f));_0x38f42b(_0xc52d0f);})[_0x901d('0x16')](function(_0x533038){logger[_0x901d('0x12')](_0x901d('0x17'),_0x533038[_0x901d('0x14')],_0x285353);_0x414171(_0x403db9[_0x901d('0x12')](0x1f4,_0x533038[_0x901d('0x14')]));});});};exports[_0x901d('0x21')]=function(_0x4137b7){var _0x115676=this;return new Promise(function(_0x530c4b,_0x336f28){return db[_0x901d('0x18')][_0x901d('0x22')]({'raw':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4137b7['options']?_0x4137b7[_0x901d('0x1a')][_0x901d('0x23')]||null:null,'attributes':_0x4137b7[_0x901d('0x1a')]?_0x4137b7['options'][_0x901d('0x1c')]||null:null,'include':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1b8d3){return{'model':db[_0x1b8d3[_0x901d('0x20')]],'as':_0x1b8d3['as'],'attributes':_0x1b8d3[_0x901d('0x1c')],'include':_0x1b8d3['include']?_['map'](_0x1b8d3[_0x901d('0x1e')],function(_0x4e66b4){return{'model':db[_0x4e66b4[_0x901d('0x20')]],'as':_0x4e66b4['as'],'attributes':_0x4e66b4[_0x901d('0x1c')],'include':_0x4e66b4['include']?_[_0x901d('0x1f')](_0x4e66b4[_0x901d('0x1e')],function(_0x2f5e22){return{'model':db[_0x2f5e22['model']],'as':_0x2f5e22['as'],'attributes':_0x2f5e22[_0x901d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0x1a1f9c){logger[_0x901d('0xe')](_0x901d('0x21'),_0x4137b7);logger[_0x901d('0x11')](_0x901d('0x21'),_0x4137b7,JSON[_0x901d('0x24')](_0x1a1f9c));_0x530c4b(_0x1a1f9c);})[_0x901d('0x16')](function(_0x384d82){logger[_0x901d('0x12')](_0x901d('0x21'),_0x384d82[_0x901d('0x14')],_0x4137b7);_0x336f28(_0x115676[_0x901d('0x12')](0x1f4,_0x384d82[_0x901d('0x14')]));});});}; \ No newline at end of file +var _0x4888=['FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowFreshsalesAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshsalesAccount'];(function(_0x379ea6,_0xd92125){var _0x229c7b=function(_0x14505a){while(--_0x14505a){_0x379ea6['push'](_0x379ea6['shift']());}};_0x229c7b(++_0xd92125);}(_0x4888,0x198));var _0x8488=function(_0x1cc2a9,_0x2c5885){_0x1cc2a9=_0x1cc2a9-0x0;var _0xdcc257=_0x4888[_0x1cc2a9];return _0xdcc257;};'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});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});}exports[_0x8488('0x17')]=function(_0x60ae2f){var _0x39775f=this;return new Promise(function(_0x1aedb1,_0x27c62a){return db[_0x8488('0x18')][_0x8488('0x19')]({'raw':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1b')]===undefined?!![]:![]:!![],'where':_0x60ae2f['options']?_0x60ae2f['options'][_0x8488('0x1c')]||null:null,'attributes':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1d')]||null:null,'limit':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1e')]||null:null,'include':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')]['include']?_[_0x8488('0x1f')](_0x60ae2f[_0x8488('0x1a')][_0x8488('0x20')],function(_0x1361a6){return{'model':db[_0x1361a6[_0x8488('0x21')]],'as':_0x1361a6['as'],'attributes':_0x1361a6['attributes'],'include':_0x1361a6['include']?_['map'](_0x1361a6['include'],function(_0x472624){return{'model':db[_0x472624['model']],'as':_0x472624['as'],'attributes':_0x472624['attributes'],'include':_0x472624[_0x8488('0x20')]?_[_0x8488('0x1f')](_0x472624[_0x8488('0x20')],function(_0x6ebee0){return{'model':db[_0x6ebee0[_0x8488('0x21')]],'as':_0x6ebee0['as'],'attributes':_0x6ebee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x8488('0xd')](function(_0x38c137){logger[_0x8488('0xe')](_0x8488('0x17'),_0x60ae2f);logger[_0x8488('0x11')](_0x8488('0x17'),_0x60ae2f,JSON[_0x8488('0x12')](_0x38c137));_0x1aedb1(_0x38c137);})[_0x8488('0x22')](function(_0x368f9c){logger[_0x8488('0x13')](_0x8488('0x17'),_0x368f9c['message'],_0x60ae2f);_0x27c62a(_0x39775f['error'](0x1f4,_0x368f9c['message']));});});};exports[_0x8488('0x23')]=function(_0x408c36){var _0x19cf42=this;return new Promise(function(_0x121dcc,_0x117321){return db[_0x8488('0x18')]['find']({'raw':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')][_0x8488('0x1b')]===undefined?!![]:![]:!![],'where':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')]['where']||null:null,'attributes':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')]['attributes']||null:null,'include':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')][_0x8488('0x20')]?_[_0x8488('0x1f')](_0x408c36[_0x8488('0x1a')]['include'],function(_0x44c8f3){return{'model':db[_0x44c8f3[_0x8488('0x21')]],'as':_0x44c8f3['as'],'attributes':_0x44c8f3[_0x8488('0x1d')],'include':_0x44c8f3['include']?_[_0x8488('0x1f')](_0x44c8f3['include'],function(_0x205ccc){return{'model':db[_0x205ccc[_0x8488('0x21')]],'as':_0x205ccc['as'],'attributes':_0x205ccc[_0x8488('0x1d')],'include':_0x205ccc[_0x8488('0x20')]?_['map'](_0x205ccc[_0x8488('0x20')],function(_0xe71bd9){return{'model':db[_0xe71bd9[_0x8488('0x21')]],'as':_0xe71bd9['as'],'attributes':_0xe71bd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8488('0xd')](function(_0x17bfea){logger[_0x8488('0xe')](_0x8488('0x23'),_0x408c36);logger[_0x8488('0x11')](_0x8488('0x23'),_0x408c36,JSON[_0x8488('0x12')](_0x17bfea));_0x121dcc(_0x17bfea);})[_0x8488('0x22')](function(_0x1a8235){logger[_0x8488('0x13')](_0x8488('0x23'),_0x1a8235['message'],_0x408c36);_0x117321(_0x19cf42['error'](0x1f4,_0x1a8235[_0x8488('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 4ec42b0..8d7801e 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 _0xc412=['getDescriptions','/:id/fields','post','create','put','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions'];(function(_0x5e3f55,_0x2d0ff3){var _0x10411f=function(_0xcc903b){while(--_0xcc903b){_0x5e3f55['push'](_0x5e3f55['shift']());}};_0x10411f(++_0x2d0ff3);}(_0xc412,0x1d6));var _0x2c41=function(_0x298b79,_0x43534d){_0x298b79=_0x298b79-0x0;var _0x2c8b35=_0xc412[_0x298b79];return _0x2c8b35;};'use strict';var multer=require(_0x2c41('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2c41('0x1'));var router=express[_0x2c41('0x2')]();var fs_extra=require(_0x2c41('0x3'));var auth=require(_0x2c41('0x4'));var interaction=require(_0x2c41('0x5'));var config=require(_0x2c41('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x2c41('0x7')]('/',auth[_0x2c41('0x8')](),controller[_0x2c41('0x9')]);router['get'](_0x2c41('0xa'),auth['isAuthenticated'](),controller[_0x2c41('0xb')]);router[_0x2c41('0x7')]('/:id/subjects',auth[_0x2c41('0x8')](),controller[_0x2c41('0xc')]);router['get'](_0x2c41('0xd'),auth[_0x2c41('0x8')](),controller[_0x2c41('0xe')]);router[_0x2c41('0x7')](_0x2c41('0xf'),auth[_0x2c41('0x8')](),controller['getFields']);router[_0x2c41('0x10')]('/',auth[_0x2c41('0x8')](),controller[_0x2c41('0x11')]);router[_0x2c41('0x12')](_0x2c41('0xa'),auth[_0x2c41('0x8')](),controller['update']);router[_0x2c41('0x13')](_0x2c41('0xa'),auth[_0x2c41('0x8')](),controller[_0x2c41('0x14')]);module[_0x2c41('0x15')]=router; \ No newline at end of file +var _0xab4d=['isAuthenticated','index','/:id','getSubjects','/:id/descriptions','/:id/fields','getFields','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get'];(function(_0x2db45c,_0x37f8cd){var _0x47711e=function(_0x367a8e){while(--_0x367a8e){_0x2db45c['push'](_0x2db45c['shift']());}};_0x47711e(++_0x37f8cd);}(_0xab4d,0x115));var _0xdab4=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0xab4d[_0x21c6b8];return _0x39d474;};'use strict';var multer=require(_0xdab4('0x0'));var util=require(_0xdab4('0x1'));var path=require(_0xdab4('0x2'));var timeout=require(_0xdab4('0x3'));var express=require(_0xdab4('0x4'));var router=express[_0xdab4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdab4('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xdab4('0x7')]('/',auth[_0xdab4('0x8')](),controller[_0xdab4('0x9')]);router[_0xdab4('0x7')](_0xdab4('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xdab4('0x7')]('/:id/subjects',auth[_0xdab4('0x8')](),controller[_0xdab4('0xb')]);router[_0xdab4('0x7')](_0xdab4('0xc'),auth[_0xdab4('0x8')](),controller['getDescriptions']);router[_0xdab4('0x7')](_0xdab4('0xd'),auth[_0xdab4('0x8')](),controller[_0xdab4('0xe')]);router['post']('/',auth[_0xdab4('0x8')](),controller[_0xdab4('0xf')]);router['put'](_0xdab4('0xa'),auth[_0xdab4('0x8')](),controller['update']);router[_0xdab4('0x10')](_0xdab4('0xa'),auth[_0xdab4('0x8')](),controller[_0xdab4('0x11')]);module[_0xdab4('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 5aba68a..8b44ea0 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 _0xa7c3=['exports','STRING'];(function(_0x5aa2ed,_0x2836b4){var _0x26f014=function(_0x2f6ca4){while(--_0x2f6ca4){_0x5aa2ed['push'](_0x5aa2ed['shift']());}};_0x26f014(++_0x2836b4);}(_0xa7c3,0x1ea));var _0x3a7c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa7c3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x3a7c('0x0')]={'name':{'type':Sequelize[_0x3a7c('0x1')]},'description':{'type':Sequelize[_0x3a7c('0x1')]}}; \ No newline at end of file +var _0xe374=['STRING','sequelize'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xe374,0x179));var _0x4e37=function(_0x3d342a,_0x3ad16e){_0x3d342a=_0x3d342a-0x0;var _0x3538b9=_0xe374[_0x3d342a];return _0x3538b9;};'use strict';var Sequelize=require(_0x4e37('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e37('0x1')]},'description':{'type':Sequelize[_0x4e37('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index a0d14fb..000c27c 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 _0xb8ab=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','FreshsalesConfiguration','rawAttributes','type','key','map','query','keys','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getSubjects','findOne','FreshsalesField','nolimit','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0xb8ab,0x96));var _0xbb8a=function(_0x210418,_0x5e9db4){_0x210418=_0x210418-0x0;var _0x5f6ae=_0xb8ab[_0x210418];return _0x5f6ae;};'use strict';var emlformat=require(_0xbb8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb8a('0x1'));var jsonpatch=require(_0xbb8a('0x2'));var rp=require(_0xbb8a('0x3'));var moment=require(_0xbb8a('0x4'));var BPromise=require(_0xbb8a('0x5'));var Mustache=require(_0xbb8a('0x6'));var util=require(_0xbb8a('0x7'));var path=require(_0xbb8a('0x8'));var sox=require(_0xbb8a('0x9'));var csv=require(_0xbb8a('0xa'));var ejs=require(_0xbb8a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb8a('0xc'));var squel=require(_0xbb8a('0xd'));var crypto=require(_0xbb8a('0xe'));var jsforce=require(_0xbb8a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbb8a('0xa'));var querystring=require(_0xbb8a('0x10'));var Papa=require(_0xbb8a('0x11'));var Redis=require('ioredis');var authService=require(_0xbb8a('0x12'));var qs=require(_0xbb8a('0x13'));var as=require(_0xbb8a('0x14'));var hardwareService=require(_0xbb8a('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xbb8a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb8a('0x17'));var db=require(_0xbb8a('0x18'))['db'];function respondWithStatusCode(_0x85b815,_0x54271e){_0x54271e=_0x54271e||0xcc;return function(_0x321b5c){if(_0x321b5c){return _0x85b815[_0xbb8a('0x19')](_0x54271e);}return _0x85b815[_0xbb8a('0x1a')](_0x54271e)['end']();};}function respondWithResult(_0x5ac7a8,_0x20673a){_0x20673a=_0x20673a||0xc8;return function(_0x343452){if(_0x343452){return _0x5ac7a8[_0xbb8a('0x1a')](_0x20673a)[_0xbb8a('0x1b')](_0x343452);}};}function respondWithFilteredResult(_0x49f670,_0x5ed1fa){return function(_0x1d4531){if(_0x1d4531){var _0x539060=typeof _0x5ed1fa[_0xbb8a('0x1c')]===_0xbb8a('0x1d')&&typeof _0x5ed1fa[_0xbb8a('0x1e')]===_0xbb8a('0x1d');var _0x1edc89=_0x1d4531[_0xbb8a('0x1f')];var _0x1e755d=_0x539060?0x0:_0x5ed1fa[_0xbb8a('0x1c')];var _0x23393f=_0x539060?_0x1d4531[_0xbb8a('0x1f')]:_0x5ed1fa['offset']+_0x5ed1fa[_0xbb8a('0x1e')];var _0x44e537;if(_0x23393f>=_0x1edc89){_0x23393f=_0x1edc89;_0x44e537=0xc8;}else{_0x44e537=0xce;}_0x49f670[_0xbb8a('0x1a')](_0x44e537);return _0x49f670[_0xbb8a('0x20')](_0xbb8a('0x21'),_0x1e755d+'-'+_0x23393f+'/'+_0x1edc89)[_0xbb8a('0x1b')](_0x1d4531);}return null;};}function patchUpdates(_0x160519){return function(_0x327c94){try{jsonpatch[_0xbb8a('0x22')](_0x327c94,_0x160519,!![]);}catch(_0x3f33d5){return BPromise[_0xbb8a('0x23')](_0x3f33d5);}return _0x327c94[_0xbb8a('0x24')]();};}function saveUpdates(_0x559050,_0x2fbf75){return function(_0x56a037){if(_0x56a037){return _0x56a037[_0xbb8a('0x25')](_0x559050)[_0xbb8a('0x26')](function(_0x3af278){return _0x3af278;});}return null;};}function removeEntity(_0x1d1c11,_0x2b1885){return function(_0x8714b2){if(_0x8714b2){return _0x8714b2['destroy']()[_0xbb8a('0x26')](function(){_0x1d1c11[_0xbb8a('0x1a')](0xcc)[_0xbb8a('0x27')]();});}};}function handleEntityNotFound(_0x580e39,_0x475116){return function(_0x34f869){if(!_0x34f869){_0x580e39[_0xbb8a('0x19')](0x194);}return _0x34f869;};}function handleError(_0x187769,_0x317925){_0x317925=_0x317925||0x1f4;return function(_0x55a688){logger[_0xbb8a('0x28')](_0x55a688[_0xbb8a('0x29')]);if(_0x55a688['name']){delete _0x55a688[_0xbb8a('0x2a')];}_0x187769['status'](_0x317925)[_0xbb8a('0x2b')](_0x55a688);};}exports['index']=function(_0x58cedd,_0x4ab849){var _0x1031d8={},_0x1b3b80={},_0x1809da={'count':0x0,'rows':[]};var _0x4fa956=_['map'](db[_0xbb8a('0x2c')][_0xbb8a('0x2d')],function(_0x3a31b0){return{'name':_0x3a31b0['fieldName'],'type':_0x3a31b0[_0xbb8a('0x2e')][_0xbb8a('0x2f')]};});_0x1b3b80['model']=_[_0xbb8a('0x30')](_0x4fa956,'name');_0x1b3b80[_0xbb8a('0x31')]=_[_0xbb8a('0x32')](_0x58cedd[_0xbb8a('0x31')]);_0x1b3b80['filters']=_[_0xbb8a('0x33')](_0x1b3b80[_0xbb8a('0x34')],_0x1b3b80[_0xbb8a('0x31')]);_0x1031d8['attributes']=_['intersection'](_0x1b3b80[_0xbb8a('0x34')],qs[_0xbb8a('0x35')](_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x35')]));_0x1031d8['attributes']=_0x1031d8['attributes'][_0xbb8a('0x36')]?_0x1031d8[_0xbb8a('0x37')]:_0x1b3b80['model'];if(!_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x38')]('nolimit')){_0x1031d8[_0xbb8a('0x1e')]=qs[_0xbb8a('0x1e')](_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x1e')]);_0x1031d8['offset']=qs[_0xbb8a('0x1c')](_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x1c')]);}_0x1031d8[_0xbb8a('0x39')]=qs[_0xbb8a('0x3a')](_0x58cedd[_0xbb8a('0x31')]['sort']);_0x1031d8['where']=qs[_0xbb8a('0x3b')](_[_0xbb8a('0x3c')](_0x58cedd['query'],_0x1b3b80['filters']),_0x4fa956);if(_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x3d')]){_0x1031d8[_0xbb8a('0x3e')]=_[_0xbb8a('0x3f')](_0x1031d8[_0xbb8a('0x3e')],{'$or':_[_0xbb8a('0x30')](_0x4fa956,function(_0x21dd9d){if(_0x21dd9d[_0xbb8a('0x2e')]!==_0xbb8a('0x40')){var _0x373c92={};_0x373c92[_0x21dd9d[_0xbb8a('0x2a')]]={'$like':'%'+_0x58cedd['query']['filter']+'%'};return _0x373c92;}})});}_0x1031d8=_[_0xbb8a('0x3f')]({},_0x1031d8,_0x58cedd['options']);var _0x37b257={'where':_0x1031d8[_0xbb8a('0x3e')]};return db['FreshsalesConfiguration'][_0xbb8a('0x1f')](_0x37b257)[_0xbb8a('0x26')](function(_0x3ed575){_0x1809da[_0xbb8a('0x1f')]=_0x3ed575;if(_0x58cedd[_0xbb8a('0x31')][_0xbb8a('0x41')]){_0x1031d8[_0xbb8a('0x42')]=[{'all':!![]}];}return db[_0xbb8a('0x2c')][_0xbb8a('0x43')](_0x1031d8);})[_0xbb8a('0x26')](function(_0x455f9a){_0x1809da[_0xbb8a('0x44')]=_0x455f9a;return _0x1809da;})[_0xbb8a('0x26')](respondWithFilteredResult(_0x4ab849,_0x1031d8))[_0xbb8a('0x45')](handleError(_0x4ab849,null));};exports[_0xbb8a('0x46')]=function(_0x410dc0,_0x3e68fd){var _0x9fd113={'raw':![],'where':{'id':_0x410dc0[_0xbb8a('0x47')]['id']}},_0x5bd663={};_0x5bd663[_0xbb8a('0x34')]=_[_0xbb8a('0x32')](db[_0xbb8a('0x2c')][_0xbb8a('0x2d')]);_0x5bd663[_0xbb8a('0x31')]=_[_0xbb8a('0x32')](_0x410dc0[_0xbb8a('0x31')]);_0x5bd663[_0xbb8a('0x3b')]=_[_0xbb8a('0x33')](_0x5bd663[_0xbb8a('0x34')],_0x5bd663[_0xbb8a('0x31')]);_0x9fd113[_0xbb8a('0x37')]=_[_0xbb8a('0x33')](_0x5bd663[_0xbb8a('0x34')],qs[_0xbb8a('0x35')](_0x410dc0['query'][_0xbb8a('0x35')]));_0x9fd113['attributes']=_0x9fd113[_0xbb8a('0x37')][_0xbb8a('0x36')]?_0x9fd113[_0xbb8a('0x37')]:_0x5bd663[_0xbb8a('0x34')];if(_0x410dc0[_0xbb8a('0x31')][_0xbb8a('0x41')]){_0x9fd113[_0xbb8a('0x42')]=[{'all':!![]}];}_0x9fd113=_[_0xbb8a('0x3f')]({},_0x9fd113,_0x410dc0[_0xbb8a('0x48')]);return db[_0xbb8a('0x2c')][_0xbb8a('0x49')](_0x9fd113)[_0xbb8a('0x26')](handleEntityNotFound(_0x3e68fd,null))['then'](respondWithResult(_0x3e68fd,null))[_0xbb8a('0x45')](handleError(_0x3e68fd,null));};exports[_0xbb8a('0x4a')]=function(_0x29cdb7,_0x5a8e95){return db[_0xbb8a('0x2c')][_0xbb8a('0x4a')](_0x29cdb7[_0xbb8a('0x4b')],{})[_0xbb8a('0x26')](respondWithResult(_0x5a8e95,0xc9))['catch'](handleError(_0x5a8e95,null));};exports[_0xbb8a('0x25')]=function(_0x3367c9,_0x47ed44){if(_0x3367c9[_0xbb8a('0x4b')]['id']){delete _0x3367c9['body']['id'];}return db['FreshsalesConfiguration'][_0xbb8a('0x49')]({'where':{'id':_0x3367c9[_0xbb8a('0x47')]['id']}})[_0xbb8a('0x26')](handleEntityNotFound(_0x47ed44,null))['then'](saveUpdates(_0x3367c9[_0xbb8a('0x4b')],null))[_0xbb8a('0x26')](respondWithResult(_0x47ed44,null))[_0xbb8a('0x45')](handleError(_0x47ed44,null));};exports[_0xbb8a('0x4c')]=function(_0xe7e673,_0x308c24){return db[_0xbb8a('0x2c')][_0xbb8a('0x49')]({'where':{'id':_0xe7e673['params']['id']}})[_0xbb8a('0x26')](handleEntityNotFound(_0x308c24,null))[_0xbb8a('0x26')](removeEntity(_0x308c24,null))[_0xbb8a('0x45')](handleError(_0x308c24,null));};exports[_0xbb8a('0x4d')]=function(_0x1e05de,_0x590cb9,_0x451d68){var _0x4e8f9c={};var _0xc36d8e={};var _0x30c588;var _0x42bd15;return db['FreshsalesConfiguration'][_0xbb8a('0x4e')]({'where':{'id':_0x1e05de[_0xbb8a('0x47')]['id']}})[_0xbb8a('0x26')](handleEntityNotFound(_0x590cb9,null))[_0xbb8a('0x26')](function(_0x172cf1){if(_0x172cf1){_0x30c588=_0x172cf1;_0xc36d8e[_0xbb8a('0x34')]=_[_0xbb8a('0x32')](db[_0xbb8a('0x4f')][_0xbb8a('0x2d')]);_0xc36d8e[_0xbb8a('0x31')]=_[_0xbb8a('0x32')](_0x1e05de['query']);_0xc36d8e[_0xbb8a('0x3b')]=_[_0xbb8a('0x33')](_0xc36d8e[_0xbb8a('0x34')],_0xc36d8e[_0xbb8a('0x31')]);_0x4e8f9c[_0xbb8a('0x37')]=_[_0xbb8a('0x33')](_0xc36d8e['model'],qs['fields'](_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x35')]));_0x4e8f9c[_0xbb8a('0x37')]=_0x4e8f9c['attributes'][_0xbb8a('0x36')]?_0x4e8f9c[_0xbb8a('0x37')]:_0xc36d8e[_0xbb8a('0x34')];_0x4e8f9c[_0xbb8a('0x39')]=qs[_0xbb8a('0x3a')](_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x3a')]);_0x4e8f9c[_0xbb8a('0x3e')]=qs['filters'](_[_0xbb8a('0x3c')](_0x1e05de['query'],_0xc36d8e[_0xbb8a('0x3b')]));if(_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x3d')]){_0x4e8f9c[_0xbb8a('0x3e')]=_['merge'](_0x4e8f9c[_0xbb8a('0x3e')],{'$or':_['map'](_0x4e8f9c[_0xbb8a('0x37')],function(_0x1b0c9c){var _0x2e0ec9={};_0x2e0ec9[_0x1b0c9c]={'$like':'%'+_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x3d')]+'%'};return _0x2e0ec9;})});}_0x4e8f9c=_[_0xbb8a('0x3f')]({},_0x4e8f9c,_0x1e05de[_0xbb8a('0x48')]);return _0x30c588[_0xbb8a('0x4d')](_0x4e8f9c);}})[_0xbb8a('0x26')](function(_0x24ca80){if(_0x24ca80){_0x42bd15=_0x24ca80[_0xbb8a('0x36')];if(!_0x1e05de['query']['hasOwnProperty'](_0xbb8a('0x50'))){_0x4e8f9c[_0xbb8a('0x1e')]=qs[_0xbb8a('0x1e')](_0x1e05de[_0xbb8a('0x31')][_0xbb8a('0x1e')]);_0x4e8f9c[_0xbb8a('0x1c')]=qs[_0xbb8a('0x1c')](_0x1e05de[_0xbb8a('0x31')]['offset']);}return _0x30c588[_0xbb8a('0x4d')](_0x4e8f9c);}})[_0xbb8a('0x26')](function(_0x401ccb){if(_0x401ccb){return _0x401ccb?{'count':_0x42bd15,'rows':_0x401ccb}:null;}})[_0xbb8a('0x26')](respondWithResult(_0x590cb9,null))[_0xbb8a('0x45')](handleError(_0x590cb9,null));};exports[_0xbb8a('0x51')]=function(_0x530aab,_0x1e975c,_0x1fc62b){var _0x5bbcee={};var _0x24a7d9={};var _0x15f43d;var _0x37c53b;return db[_0xbb8a('0x2c')][_0xbb8a('0x4e')]({'where':{'id':_0x530aab['params']['id']}})['then'](handleEntityNotFound(_0x1e975c,null))['then'](function(_0x485aeb){if(_0x485aeb){_0x15f43d=_0x485aeb;_0x24a7d9[_0xbb8a('0x34')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x24a7d9['query']=_[_0xbb8a('0x32')](_0x530aab[_0xbb8a('0x31')]);_0x24a7d9[_0xbb8a('0x3b')]=_[_0xbb8a('0x33')](_0x24a7d9['model'],_0x24a7d9['query']);_0x5bbcee[_0xbb8a('0x37')]=_[_0xbb8a('0x33')](_0x24a7d9['model'],qs[_0xbb8a('0x35')](_0x530aab[_0xbb8a('0x31')]['fields']));_0x5bbcee['attributes']=_0x5bbcee[_0xbb8a('0x37')]['length']?_0x5bbcee[_0xbb8a('0x37')]:_0x24a7d9[_0xbb8a('0x34')];_0x5bbcee[_0xbb8a('0x39')]=qs[_0xbb8a('0x3a')](_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x3a')]);_0x5bbcee[_0xbb8a('0x3e')]=qs[_0xbb8a('0x3b')](_[_0xbb8a('0x3c')](_0x530aab[_0xbb8a('0x31')],_0x24a7d9[_0xbb8a('0x3b')]));if(_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x3d')]){_0x5bbcee[_0xbb8a('0x3e')]=_[_0xbb8a('0x3f')](_0x5bbcee[_0xbb8a('0x3e')],{'$or':_[_0xbb8a('0x30')](_0x5bbcee[_0xbb8a('0x37')],function(_0x3865cf){var _0x49f395={};_0x49f395[_0x3865cf]={'$like':'%'+_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x3d')]+'%'};return _0x49f395;})});}_0x5bbcee=_[_0xbb8a('0x3f')]({},_0x5bbcee,_0x530aab[_0xbb8a('0x48')]);return _0x15f43d[_0xbb8a('0x51')](_0x5bbcee);}})[_0xbb8a('0x26')](function(_0x5f4339){if(_0x5f4339){_0x37c53b=_0x5f4339[_0xbb8a('0x36')];if(!_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x38')](_0xbb8a('0x50'))){_0x5bbcee['limit']=qs['limit'](_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x1e')]);_0x5bbcee['offset']=qs['offset'](_0x530aab[_0xbb8a('0x31')][_0xbb8a('0x1c')]);}return _0x15f43d[_0xbb8a('0x51')](_0x5bbcee);}})[_0xbb8a('0x26')](function(_0x2b16cd){if(_0x2b16cd){return _0x2b16cd?{'count':_0x37c53b,'rows':_0x2b16cd}:null;}})[_0xbb8a('0x26')](respondWithResult(_0x1e975c,null))[_0xbb8a('0x45')](handleError(_0x1e975c,null));};exports['getFields']=function(_0xd71203,_0x2d9ed7,_0x23f80c){var _0x411d5f={};var _0x40e4ec={};var _0x1264d4;var _0x5a34ed;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0xd71203[_0xbb8a('0x47')]['id']}})[_0xbb8a('0x26')](handleEntityNotFound(_0x2d9ed7,null))[_0xbb8a('0x26')](function(_0x572690){if(_0x572690){_0x1264d4=_0x572690;_0x40e4ec[_0xbb8a('0x34')]=_[_0xbb8a('0x32')](db['FreshsalesField']['rawAttributes']);_0x40e4ec[_0xbb8a('0x31')]=_['keys'](_0xd71203[_0xbb8a('0x31')]);_0x40e4ec[_0xbb8a('0x3b')]=_[_0xbb8a('0x33')](_0x40e4ec[_0xbb8a('0x34')],_0x40e4ec[_0xbb8a('0x31')]);_0x411d5f[_0xbb8a('0x37')]=_[_0xbb8a('0x33')](_0x40e4ec[_0xbb8a('0x34')],qs[_0xbb8a('0x35')](_0xd71203['query'][_0xbb8a('0x35')]));_0x411d5f[_0xbb8a('0x37')]=_0x411d5f[_0xbb8a('0x37')][_0xbb8a('0x36')]?_0x411d5f[_0xbb8a('0x37')]:_0x40e4ec[_0xbb8a('0x34')];_0x411d5f['order']=qs['sort'](_0xd71203[_0xbb8a('0x31')][_0xbb8a('0x3a')]);_0x411d5f[_0xbb8a('0x3e')]=qs[_0xbb8a('0x3b')](_[_0xbb8a('0x3c')](_0xd71203[_0xbb8a('0x31')],_0x40e4ec['filters']));if(_0xd71203[_0xbb8a('0x31')]['filter']){_0x411d5f[_0xbb8a('0x3e')]=_[_0xbb8a('0x3f')](_0x411d5f[_0xbb8a('0x3e')],{'$or':_[_0xbb8a('0x30')](_0x411d5f[_0xbb8a('0x37')],function(_0x436595){var _0x47d0de={};_0x47d0de[_0x436595]={'$like':'%'+_0xd71203[_0xbb8a('0x31')]['filter']+'%'};return _0x47d0de;})});}_0x411d5f=_['merge']({},_0x411d5f,_0xd71203[_0xbb8a('0x48')]);return _0x1264d4[_0xbb8a('0x52')](_0x411d5f);}})['then'](function(_0x3e749a){if(_0x3e749a){_0x5a34ed=_0x3e749a[_0xbb8a('0x36')];if(!_0xd71203[_0xbb8a('0x31')][_0xbb8a('0x38')](_0xbb8a('0x50'))){_0x411d5f[_0xbb8a('0x1e')]=qs[_0xbb8a('0x1e')](_0xd71203[_0xbb8a('0x31')]['limit']);_0x411d5f['offset']=qs[_0xbb8a('0x1c')](_0xd71203[_0xbb8a('0x31')][_0xbb8a('0x1c')]);}return _0x1264d4[_0xbb8a('0x52')](_0x411d5f);}})[_0xbb8a('0x26')](function(_0x486faa){if(_0x486faa){return _0x486faa?{'count':_0x5a34ed,'rows':_0x486faa}:null;}})[_0xbb8a('0x26')](respondWithResult(_0x2d9ed7,null))[_0xbb8a('0x45')](handleError(_0x2d9ed7,null));}; \ No newline at end of file +var _0xc016=['crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','filter','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x42c5e1,_0x58562a){var _0x456424=function(_0x21078b){while(--_0x21078b){_0x42c5e1['push'](_0x42c5e1['shift']());}};_0x456424(++_0x58562a);}(_0xc016,0x1c2));var _0x6c01=function(_0x504431,_0x25a6ea){_0x504431=_0x504431-0x0;var _0x35f879=_0xc016[_0x504431];return _0x35f879;};'use strict';var emlformat=require(_0x6c01('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6c01('0x1'));var rp=require('request-promise');var moment=require(_0x6c01('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6c01('0x3'));var util=require(_0x6c01('0x4'));var path=require(_0x6c01('0x5'));var sox=require(_0x6c01('0x6'));var csv=require(_0x6c01('0x7'));var ejs=require(_0x6c01('0x8'));var fs=require('fs');var fs_extra=require(_0x6c01('0x9'));var _=require(_0x6c01('0xa'));var squel=require(_0x6c01('0xb'));var crypto=require(_0x6c01('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6c01('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6c01('0xe'));var Papa=require(_0x6c01('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c01('0x10'));var as=require(_0x6c01('0x11'));var hardwareService=require(_0x6c01('0x12'));var logger=require(_0x6c01('0x13'))('api');var utils=require(_0x6c01('0x14'));var config=require(_0x6c01('0x15'));var licenseUtil=require(_0x6c01('0x16'));var db=require(_0x6c01('0x17'))['db'];function respondWithStatusCode(_0x20ccaf,_0x2bdace){_0x2bdace=_0x2bdace||0xcc;return function(_0x2e6054){if(_0x2e6054){return _0x20ccaf['sendStatus'](_0x2bdace);}return _0x20ccaf[_0x6c01('0x18')](_0x2bdace)[_0x6c01('0x19')]();};}function respondWithResult(_0x40e71f,_0x5e1453){_0x5e1453=_0x5e1453||0xc8;return function(_0x4a0cff){if(_0x4a0cff){return _0x40e71f[_0x6c01('0x18')](_0x5e1453)['json'](_0x4a0cff);}};}function respondWithFilteredResult(_0x16e7df,_0x2d6427){return function(_0x5ec7a2){if(_0x5ec7a2){var _0x5eac2b=typeof _0x2d6427['offset']==='undefined'&&typeof _0x2d6427[_0x6c01('0x1a')]==='undefined';var _0x59e2ca=_0x5ec7a2[_0x6c01('0x1b')];var _0x299a13=_0x5eac2b?0x0:_0x2d6427['offset'];var _0xe96909=_0x5eac2b?_0x5ec7a2['count']:_0x2d6427[_0x6c01('0x1c')]+_0x2d6427[_0x6c01('0x1a')];var _0x2964ae;if(_0xe96909>=_0x59e2ca){_0xe96909=_0x59e2ca;_0x2964ae=0xc8;}else{_0x2964ae=0xce;}_0x16e7df[_0x6c01('0x18')](_0x2964ae);return _0x16e7df[_0x6c01('0x1d')]('Content-Range',_0x299a13+'-'+_0xe96909+'/'+_0x59e2ca)['json'](_0x5ec7a2);}return null;};}function patchUpdates(_0x8f5fdf){return function(_0x5acb97){try{jsonpatch[_0x6c01('0x1e')](_0x5acb97,_0x8f5fdf,!![]);}catch(_0xc04c34){return BPromise[_0x6c01('0x1f')](_0xc04c34);}return _0x5acb97[_0x6c01('0x20')]();};}function saveUpdates(_0xb7f17d,_0x144245){return function(_0x42dac5){if(_0x42dac5){return _0x42dac5[_0x6c01('0x21')](_0xb7f17d)[_0x6c01('0x22')](function(_0x3b8b6d){return _0x3b8b6d;});}return null;};}function removeEntity(_0x287db4,_0x48176e){return function(_0x1741f5){if(_0x1741f5){return _0x1741f5[_0x6c01('0x23')]()[_0x6c01('0x22')](function(){_0x287db4[_0x6c01('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x543190,_0x528986){return function(_0x5d67a7){if(!_0x5d67a7){_0x543190[_0x6c01('0x24')](0x194);}return _0x5d67a7;};}function handleError(_0x4490e2,_0x5c2513){_0x5c2513=_0x5c2513||0x1f4;return function(_0x5d1ba8){logger[_0x6c01('0x25')](_0x5d1ba8[_0x6c01('0x26')]);if(_0x5d1ba8[_0x6c01('0x27')]){delete _0x5d1ba8[_0x6c01('0x27')];}_0x4490e2[_0x6c01('0x18')](_0x5c2513)[_0x6c01('0x28')](_0x5d1ba8);};}exports['index']=function(_0x262bce,_0x243466){var _0x515837={},_0x30263d={},_0xf1b02c={'count':0x0,'rows':[]};var _0x4d8257=_[_0x6c01('0x29')](db['FreshsalesConfiguration'][_0x6c01('0x2a')],function(_0x5a03ad){return{'name':_0x5a03ad['fieldName'],'type':_0x5a03ad[_0x6c01('0x2b')]['key']};});_0x30263d[_0x6c01('0x2c')]=_[_0x6c01('0x29')](_0x4d8257,_0x6c01('0x27'));_0x30263d[_0x6c01('0x2d')]=_[_0x6c01('0x2e')](_0x262bce['query']);_0x30263d['filters']=_[_0x6c01('0x2f')](_0x30263d[_0x6c01('0x2c')],_0x30263d['query']);_0x515837[_0x6c01('0x30')]=_['intersection'](_0x30263d[_0x6c01('0x2c')],qs[_0x6c01('0x31')](_0x262bce[_0x6c01('0x2d')][_0x6c01('0x31')]));_0x515837[_0x6c01('0x30')]=_0x515837['attributes']['length']?_0x515837[_0x6c01('0x30')]:_0x30263d[_0x6c01('0x2c')];if(!_0x262bce[_0x6c01('0x2d')]['hasOwnProperty'](_0x6c01('0x32'))){_0x515837['limit']=qs[_0x6c01('0x1a')](_0x262bce['query'][_0x6c01('0x1a')]);_0x515837[_0x6c01('0x1c')]=qs[_0x6c01('0x1c')](_0x262bce['query'][_0x6c01('0x1c')]);}_0x515837[_0x6c01('0x33')]=qs[_0x6c01('0x34')](_0x262bce[_0x6c01('0x2d')][_0x6c01('0x34')]);_0x515837[_0x6c01('0x35')]=qs[_0x6c01('0x36')](_[_0x6c01('0x37')](_0x262bce[_0x6c01('0x2d')],_0x30263d[_0x6c01('0x36')]),_0x4d8257);if(_0x262bce['query']['filter']){_0x515837[_0x6c01('0x35')]=_[_0x6c01('0x38')](_0x515837['where'],{'$or':_[_0x6c01('0x29')](_0x4d8257,function(_0x12e6c9){if(_0x12e6c9[_0x6c01('0x2b')]!=='VIRTUAL'){var _0x2c8268={};_0x2c8268[_0x12e6c9[_0x6c01('0x27')]]={'$like':'%'+_0x262bce[_0x6c01('0x2d')][_0x6c01('0x39')]+'%'};return _0x2c8268;}})});}_0x515837=_['merge']({},_0x515837,_0x262bce[_0x6c01('0x3a')]);var _0x2b0e46={'where':_0x515837[_0x6c01('0x35')]};return db[_0x6c01('0x3b')][_0x6c01('0x1b')](_0x2b0e46)[_0x6c01('0x22')](function(_0x1e65c0){_0xf1b02c['count']=_0x1e65c0;if(_0x262bce[_0x6c01('0x2d')][_0x6c01('0x3c')]){_0x515837[_0x6c01('0x3d')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x6c01('0x3e')](_0x515837);})[_0x6c01('0x22')](function(_0x174c24){_0xf1b02c[_0x6c01('0x3f')]=_0x174c24;return _0xf1b02c;})[_0x6c01('0x22')](respondWithFilteredResult(_0x243466,_0x515837))[_0x6c01('0x40')](handleError(_0x243466,null));};exports[_0x6c01('0x41')]=function(_0x1ca999,_0x23eaf4){var _0x5c10b3={'raw':![],'where':{'id':_0x1ca999[_0x6c01('0x42')]['id']}},_0x31b8e9={};_0x31b8e9['model']=_[_0x6c01('0x2e')](db[_0x6c01('0x3b')][_0x6c01('0x2a')]);_0x31b8e9[_0x6c01('0x2d')]=_[_0x6c01('0x2e')](_0x1ca999['query']);_0x31b8e9['filters']=_[_0x6c01('0x2f')](_0x31b8e9[_0x6c01('0x2c')],_0x31b8e9[_0x6c01('0x2d')]);_0x5c10b3['attributes']=_[_0x6c01('0x2f')](_0x31b8e9[_0x6c01('0x2c')],qs['fields'](_0x1ca999['query'][_0x6c01('0x31')]));_0x5c10b3[_0x6c01('0x30')]=_0x5c10b3[_0x6c01('0x30')][_0x6c01('0x43')]?_0x5c10b3[_0x6c01('0x30')]:_0x31b8e9[_0x6c01('0x2c')];if(_0x1ca999['query'][_0x6c01('0x3c')]){_0x5c10b3[_0x6c01('0x3d')]=[{'all':!![]}];}_0x5c10b3=_[_0x6c01('0x38')]({},_0x5c10b3,_0x1ca999[_0x6c01('0x3a')]);return db[_0x6c01('0x3b')][_0x6c01('0x44')](_0x5c10b3)[_0x6c01('0x22')](handleEntityNotFound(_0x23eaf4,null))[_0x6c01('0x22')](respondWithResult(_0x23eaf4,null))[_0x6c01('0x40')](handleError(_0x23eaf4,null));};exports[_0x6c01('0x45')]=function(_0x7efa37,_0x3a596d){return db['FreshsalesConfiguration'][_0x6c01('0x45')](_0x7efa37[_0x6c01('0x46')],{})[_0x6c01('0x22')](respondWithResult(_0x3a596d,0xc9))['catch'](handleError(_0x3a596d,null));};exports[_0x6c01('0x21')]=function(_0x1dcc2f,_0xd677ca){if(_0x1dcc2f[_0x6c01('0x46')]['id']){delete _0x1dcc2f[_0x6c01('0x46')]['id'];}return db[_0x6c01('0x3b')]['find']({'where':{'id':_0x1dcc2f[_0x6c01('0x42')]['id']}})['then'](handleEntityNotFound(_0xd677ca,null))[_0x6c01('0x22')](saveUpdates(_0x1dcc2f[_0x6c01('0x46')],null))['then'](respondWithResult(_0xd677ca,null))[_0x6c01('0x40')](handleError(_0xd677ca,null));};exports['destroy']=function(_0x98a252,_0x8afd4d){return db[_0x6c01('0x3b')][_0x6c01('0x44')]({'where':{'id':_0x98a252[_0x6c01('0x42')]['id']}})[_0x6c01('0x22')](handleEntityNotFound(_0x8afd4d,null))['then'](removeEntity(_0x8afd4d,null))[_0x6c01('0x40')](handleError(_0x8afd4d,null));};exports[_0x6c01('0x47')]=function(_0x6366e7,_0x2f43d8,_0x2ebab6){var _0x1288ac={};var _0x2d8ecd={};var _0x3ecfec;var _0x3264a6;return db[_0x6c01('0x3b')][_0x6c01('0x48')]({'where':{'id':_0x6366e7[_0x6c01('0x42')]['id']}})[_0x6c01('0x22')](handleEntityNotFound(_0x2f43d8,null))['then'](function(_0x230da6){if(_0x230da6){_0x3ecfec=_0x230da6;_0x2d8ecd['model']=_[_0x6c01('0x2e')](db[_0x6c01('0x49')][_0x6c01('0x2a')]);_0x2d8ecd[_0x6c01('0x2d')]=_['keys'](_0x6366e7[_0x6c01('0x2d')]);_0x2d8ecd[_0x6c01('0x36')]=_[_0x6c01('0x2f')](_0x2d8ecd[_0x6c01('0x2c')],_0x2d8ecd[_0x6c01('0x2d')]);_0x1288ac[_0x6c01('0x30')]=_[_0x6c01('0x2f')](_0x2d8ecd[_0x6c01('0x2c')],qs['fields'](_0x6366e7[_0x6c01('0x2d')][_0x6c01('0x31')]));_0x1288ac[_0x6c01('0x30')]=_0x1288ac[_0x6c01('0x30')][_0x6c01('0x43')]?_0x1288ac['attributes']:_0x2d8ecd['model'];_0x1288ac[_0x6c01('0x33')]=qs['sort'](_0x6366e7['query'][_0x6c01('0x34')]);_0x1288ac[_0x6c01('0x35')]=qs[_0x6c01('0x36')](_[_0x6c01('0x37')](_0x6366e7[_0x6c01('0x2d')],_0x2d8ecd['filters']));if(_0x6366e7[_0x6c01('0x2d')][_0x6c01('0x39')]){_0x1288ac[_0x6c01('0x35')]=_[_0x6c01('0x38')](_0x1288ac[_0x6c01('0x35')],{'$or':_[_0x6c01('0x29')](_0x1288ac[_0x6c01('0x30')],function(_0x1049cb){var _0xe6723d={};_0xe6723d[_0x1049cb]={'$like':'%'+_0x6366e7['query'][_0x6c01('0x39')]+'%'};return _0xe6723d;})});}_0x1288ac=_[_0x6c01('0x38')]({},_0x1288ac,_0x6366e7[_0x6c01('0x3a')]);return _0x3ecfec[_0x6c01('0x47')](_0x1288ac);}})[_0x6c01('0x22')](function(_0x1d33ee){if(_0x1d33ee){_0x3264a6=_0x1d33ee[_0x6c01('0x43')];if(!_0x6366e7[_0x6c01('0x2d')][_0x6c01('0x4a')](_0x6c01('0x32'))){_0x1288ac[_0x6c01('0x1a')]=qs[_0x6c01('0x1a')](_0x6366e7[_0x6c01('0x2d')]['limit']);_0x1288ac[_0x6c01('0x1c')]=qs[_0x6c01('0x1c')](_0x6366e7[_0x6c01('0x2d')]['offset']);}return _0x3ecfec[_0x6c01('0x47')](_0x1288ac);}})['then'](function(_0x23164a){if(_0x23164a){return _0x23164a?{'count':_0x3264a6,'rows':_0x23164a}:null;}})[_0x6c01('0x22')](respondWithResult(_0x2f43d8,null))['catch'](handleError(_0x2f43d8,null));};exports[_0x6c01('0x4b')]=function(_0x477338,_0x4c12d0,_0x19fac0){var _0x31f745={};var _0x4f6af5={};var _0x5f73e8;var _0x3c7ee6;return db[_0x6c01('0x3b')]['findOne']({'where':{'id':_0x477338[_0x6c01('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c12d0,null))['then'](function(_0x424736){if(_0x424736){_0x5f73e8=_0x424736;_0x4f6af5[_0x6c01('0x2c')]=_[_0x6c01('0x2e')](db['FreshsalesField'][_0x6c01('0x2a')]);_0x4f6af5[_0x6c01('0x2d')]=_[_0x6c01('0x2e')](_0x477338[_0x6c01('0x2d')]);_0x4f6af5[_0x6c01('0x36')]=_[_0x6c01('0x2f')](_0x4f6af5[_0x6c01('0x2c')],_0x4f6af5[_0x6c01('0x2d')]);_0x31f745[_0x6c01('0x30')]=_[_0x6c01('0x2f')](_0x4f6af5[_0x6c01('0x2c')],qs[_0x6c01('0x31')](_0x477338[_0x6c01('0x2d')][_0x6c01('0x31')]));_0x31f745[_0x6c01('0x30')]=_0x31f745[_0x6c01('0x30')][_0x6c01('0x43')]?_0x31f745['attributes']:_0x4f6af5[_0x6c01('0x2c')];_0x31f745[_0x6c01('0x33')]=qs[_0x6c01('0x34')](_0x477338[_0x6c01('0x2d')][_0x6c01('0x34')]);_0x31f745[_0x6c01('0x35')]=qs['filters'](_[_0x6c01('0x37')](_0x477338[_0x6c01('0x2d')],_0x4f6af5[_0x6c01('0x36')]));if(_0x477338['query'][_0x6c01('0x39')]){_0x31f745[_0x6c01('0x35')]=_[_0x6c01('0x38')](_0x31f745[_0x6c01('0x35')],{'$or':_[_0x6c01('0x29')](_0x31f745['attributes'],function(_0x5af303){var _0x2e8612={};_0x2e8612[_0x5af303]={'$like':'%'+_0x477338[_0x6c01('0x2d')][_0x6c01('0x39')]+'%'};return _0x2e8612;})});}_0x31f745=_['merge']({},_0x31f745,_0x477338[_0x6c01('0x3a')]);return _0x5f73e8[_0x6c01('0x4b')](_0x31f745);}})[_0x6c01('0x22')](function(_0x50721b){if(_0x50721b){_0x3c7ee6=_0x50721b[_0x6c01('0x43')];if(!_0x477338[_0x6c01('0x2d')][_0x6c01('0x4a')](_0x6c01('0x32'))){_0x31f745[_0x6c01('0x1a')]=qs['limit'](_0x477338[_0x6c01('0x2d')][_0x6c01('0x1a')]);_0x31f745['offset']=qs[_0x6c01('0x1c')](_0x477338['query'][_0x6c01('0x1c')]);}return _0x5f73e8[_0x6c01('0x4b')](_0x31f745);}})[_0x6c01('0x22')](function(_0x11f952){if(_0x11f952){return _0x11f952?{'count':_0x3c7ee6,'rows':_0x11f952}:null;}})['then'](respondWithResult(_0x4c12d0,null))[_0x6c01('0x40')](handleError(_0x4c12d0,null));};exports[_0x6c01('0x4c')]=function(_0x267b6d,_0x8fad61,_0x5ed187){var _0x100521={};var _0x2d5a61={};var _0x31ec8f;var _0x2edaa0;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x267b6d['params']['id']}})[_0x6c01('0x22')](handleEntityNotFound(_0x8fad61,null))[_0x6c01('0x22')](function(_0x5c96da){if(_0x5c96da){_0x31ec8f=_0x5c96da;_0x2d5a61['model']=_[_0x6c01('0x2e')](db[_0x6c01('0x49')][_0x6c01('0x2a')]);_0x2d5a61['query']=_[_0x6c01('0x2e')](_0x267b6d['query']);_0x2d5a61[_0x6c01('0x36')]=_[_0x6c01('0x2f')](_0x2d5a61[_0x6c01('0x2c')],_0x2d5a61[_0x6c01('0x2d')]);_0x100521[_0x6c01('0x30')]=_[_0x6c01('0x2f')](_0x2d5a61[_0x6c01('0x2c')],qs[_0x6c01('0x31')](_0x267b6d[_0x6c01('0x2d')][_0x6c01('0x31')]));_0x100521[_0x6c01('0x30')]=_0x100521['attributes'][_0x6c01('0x43')]?_0x100521[_0x6c01('0x30')]:_0x2d5a61[_0x6c01('0x2c')];_0x100521[_0x6c01('0x33')]=qs[_0x6c01('0x34')](_0x267b6d[_0x6c01('0x2d')]['sort']);_0x100521['where']=qs[_0x6c01('0x36')](_[_0x6c01('0x37')](_0x267b6d[_0x6c01('0x2d')],_0x2d5a61[_0x6c01('0x36')]));if(_0x267b6d['query']['filter']){_0x100521['where']=_[_0x6c01('0x38')](_0x100521['where'],{'$or':_['map'](_0x100521[_0x6c01('0x30')],function(_0x32250e){var _0x2cb541={};_0x2cb541[_0x32250e]={'$like':'%'+_0x267b6d[_0x6c01('0x2d')]['filter']+'%'};return _0x2cb541;})});}_0x100521=_[_0x6c01('0x38')]({},_0x100521,_0x267b6d[_0x6c01('0x3a')]);return _0x31ec8f[_0x6c01('0x4c')](_0x100521);}})[_0x6c01('0x22')](function(_0xc14e87){if(_0xc14e87){_0x2edaa0=_0xc14e87[_0x6c01('0x43')];if(!_0x267b6d[_0x6c01('0x2d')][_0x6c01('0x4a')](_0x6c01('0x32'))){_0x100521[_0x6c01('0x1a')]=qs[_0x6c01('0x1a')](_0x267b6d['query']['limit']);_0x100521[_0x6c01('0x1c')]=qs[_0x6c01('0x1c')](_0x267b6d[_0x6c01('0x2d')][_0x6c01('0x1c')]);}return _0x31ec8f['getFields'](_0x100521);}})[_0x6c01('0x22')](function(_0x4cc9dc){if(_0x4cc9dc){return _0x4cc9dc?{'count':_0x2edaa0,'rows':_0x4cc9dc}:null;}})[_0x6c01('0x22')](respondWithResult(_0x8fad61,null))[_0x6c01('0x40')](handleError(_0x8fad61,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 613b001..d66d826 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 _0x021c=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x6f8972,_0x343da7){var _0x5677d9=function(_0x5eb51f){while(--_0x5eb51f){_0x6f8972['push'](_0x6f8972['shift']());}};_0x5677d9(++_0x343da7);}(_0x021c,0x1eb));var _0xc021=function(_0x3e8f4d,_0x2973ed){_0x3e8f4d=_0x3e8f4d-0x0;var _0x590a2e=_0x021c[_0x3e8f4d];return _0x590a2e;};'use strict';var _=require(_0xc021('0x0'));var util=require(_0xc021('0x1'));var logger=require(_0xc021('0x2'))(_0xc021('0x3'));var moment=require('moment');var BPromise=require(_0xc021('0x4'));var rp=require(_0xc021('0x5'));var fs=require('fs');var path=require(_0xc021('0x6'));var rimraf=require(_0xc021('0x7'));var config=require(_0xc021('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xc021('0x9')]=function(_0x5f3c5c,_0x1ca669){return _0x5f3c5c[_0xc021('0xa')](_0xc021('0xb'),attributes,{'tableName':_0xc021('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x296e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger'];(function(_0x25932f,_0x58172c){var _0x58c2ab=function(_0x1807d1){while(--_0x1807d1){_0x25932f['push'](_0x25932f['shift']());}};_0x58c2ab(++_0x58172c);}(_0x296e,0x16a));var _0xe296=function(_0x753c5a,_0x13503b){_0x753c5a=_0x753c5a-0x0;var _0x1ebd15=_0x296e[_0x753c5a];return _0x1ebd15;};'use strict';var _=require('lodash');var util=require(_0xe296('0x0'));var logger=require(_0xe296('0x1'))('api');var moment=require(_0xe296('0x2'));var BPromise=require(_0xe296('0x3'));var rp=require(_0xe296('0x4'));var fs=require('fs');var path=require(_0xe296('0x5'));var rimraf=require(_0xe296('0x6'));var config=require(_0xe296('0x7'));var attributes=require(_0xe296('0x8'));module[_0xe296('0x9')]=function(_0x2f948c,_0x19f1b1){return _0x2f948c[_0xe296('0xa')](_0xe296('0xb'),attributes,{'tableName':_0xe296('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 0914d58..d697084 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 _0xadb7=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','request\x20sent','debug'];(function(_0x55a8d0,_0x3d6044){var _0x4726b3=function(_0x16ec11){while(--_0x16ec11){_0x55a8d0['push'](_0x55a8d0['shift']());}};_0x4726b3(++_0x3d6044);}(_0xadb7,0x71));var _0x7adb=function(_0x1f5ba9,_0x5ae73e){_0x1f5ba9=_0x1f5ba9-0x0;var _0x653277=_0xadb7[_0x1f5ba9];return _0x653277;};'use strict';var _=require(_0x7adb('0x0'));var util=require(_0x7adb('0x1'));var moment=require('moment');var BPromise=require(_0x7adb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7adb('0x3'));var db=require(_0x7adb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7adb('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7adb('0x6')][_0x7adb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e6b76,_0x21b0ea,_0x3eece8){return new BPromise(function(_0x5b38df,_0x1790a9){return client[_0x7adb('0x8')](_0x4e6b76,_0x3eece8)[_0x7adb('0x9')](function(_0x57698f){logger[_0x7adb('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x21b0ea,_0x7adb('0xb'));logger[_0x7adb('0xc')](_0x7adb('0xd'),_0x21b0ea,_0x7adb('0xb'),JSON[_0x7adb('0xe')](_0x57698f));if(_0x57698f[_0x7adb('0xf')]){if(_0x57698f[_0x7adb('0xf')][_0x7adb('0x10')]===0x1f4){logger[_0x7adb('0xf')](_0x7adb('0x11'),_0x21b0ea,_0x57698f[_0x7adb('0xf')][_0x7adb('0x12')]);return _0x1790a9(_0x57698f['error']['message']);}logger[_0x7adb('0xf')](_0x7adb('0x11'),_0x21b0ea,_0x57698f[_0x7adb('0xf')][_0x7adb('0x12')]);return _0x5b38df(_0x57698f[_0x7adb('0xf')][_0x7adb('0x12')]);}else{logger[_0x7adb('0xa')](_0x7adb('0x11'),_0x21b0ea,'request\x20sent');_0x5b38df(_0x57698f[_0x7adb('0x13')]['message']);}})[_0x7adb('0x14')](function(_0x475490){logger[_0x7adb('0xf')](_0x7adb('0x11'),_0x21b0ea,_0x475490);_0x1790a9(_0x475490);});});} \ No newline at end of file +var _0x11f0=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x11f0,0xd1));var _0x011f=function(_0x2d098d,_0x2e876b){_0x2d098d=_0x2d098d-0x0;var _0xdc0ff7=_0x11f0[_0x2d098d];return _0xdc0ff7;};'use strict';var _=require(_0x011f('0x0'));var util=require(_0x011f('0x1'));var moment=require('moment');var BPromise=require(_0x011f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x011f('0x3'));var db=require(_0x011f('0x4'))['db'];var utils=require(_0x011f('0x5'));var logger=require(_0x011f('0x6'))(_0x011f('0x7'));var config=require('../../config/environment');var jayson=require(_0x011f('0x8'));var client=jayson[_0x011f('0x9')][_0x011f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a0d9,_0x5056ec,_0x4af78e){return new BPromise(function(_0x1aa699,_0x8ea618){return client[_0x011f('0xb')](_0x13a0d9,_0x4af78e)[_0x011f('0xc')](function(_0xe76d86){logger['info'](_0x011f('0xd'),_0x5056ec,_0x011f('0xe'));logger[_0x011f('0xf')](_0x011f('0x10'),_0x5056ec,_0x011f('0xe'),JSON[_0x011f('0x11')](_0xe76d86));if(_0xe76d86[_0x011f('0x12')]){if(_0xe76d86[_0x011f('0x12')][_0x011f('0x13')]===0x1f4){logger[_0x011f('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5056ec,_0xe76d86[_0x011f('0x12')]['message']);return _0x8ea618(_0xe76d86['error'][_0x011f('0x14')]);}logger[_0x011f('0x12')](_0x011f('0xd'),_0x5056ec,_0xe76d86[_0x011f('0x12')][_0x011f('0x14')]);return _0x1aa699(_0xe76d86[_0x011f('0x12')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x5056ec,_0x011f('0xe'));_0x1aa699(_0xe76d86['result']['message']);}})['catch'](function(_0x2a8e1e){logger[_0x011f('0x12')](_0x011f('0xd'),_0x5056ec,_0x2a8e1e);_0x8ea618(_0x2a8e1e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index d746b31..3855422 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 _0x9a62=['delete','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','put','/:id','update'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x9a62,0x1bc));var _0x29a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9a62[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x29a6('0x0'));var path=require(_0x29a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x29a6('0x2'));var router=express[_0x29a6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29a6('0x4'));var config=require(_0x29a6('0x5'));var controller=require(_0x29a6('0x6'));router[_0x29a6('0x7')]('/',auth[_0x29a6('0x8')](),controller[_0x29a6('0x9')]);router[_0x29a6('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x29a6('0xa')]);router[_0x29a6('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x29a6('0xc')](_0x29a6('0xd'),auth[_0x29a6('0x8')](),controller[_0x29a6('0xe')]);router[_0x29a6('0xf')](_0x29a6('0xd'),auth[_0x29a6('0x8')](),controller['destroy']);module[_0x29a6('0x10')]=router; \ No newline at end of file +var _0x292b=['post','put','isAuthenticated','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show'];(function(_0x45dde1,_0x51af1a){var _0x2c6b23=function(_0x29b14a){while(--_0x29b14a){_0x45dde1['push'](_0x45dde1['shift']());}};_0x2c6b23(++_0x51af1a);}(_0x292b,0x64));var _0xb292=function(_0x4d399b,_0x3bd4a4){_0x4d399b=_0x4d399b-0x0;var _0x4435e5=_0x292b[_0x4d399b];return _0x4435e5;};'use strict';var multer=require(_0xb292('0x0'));var util=require(_0xb292('0x1'));var path=require(_0xb292('0x2'));var timeout=require(_0xb292('0x3'));var express=require(_0xb292('0x4'));var router=express[_0xb292('0x5')]();var fs_extra=require(_0xb292('0x6'));var auth=require(_0xb292('0x7'));var interaction=require(_0xb292('0x8'));var config=require(_0xb292('0x9'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb292('0xa')]);router[_0xb292('0xb')](_0xb292('0xc'),auth['isAuthenticated'](),controller[_0xb292('0xd')]);router[_0xb292('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb292('0xf')](_0xb292('0xc'),auth[_0xb292('0x10')](),controller['update']);router[_0xb292('0x11')](_0xb292('0xc'),auth[_0xb292('0x10')](),controller[_0xb292('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 5e235f4..7ed49ae 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 _0x8def=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x4a4760,_0x7ce6b4){var _0x3c2c17=function(_0x201577){while(--_0x201577){_0x4a4760['push'](_0x4a4760['shift']());}};_0x3c2c17(++_0x7ce6b4);}(_0x8def,0x1f2));var _0xf8de=function(_0x1de7f3,_0x4d0ba0){_0x1de7f3=_0x1de7f3-0x0;var _0x52df61=_0x8def[_0x1de7f3];return _0x52df61;};'use strict';var Sequelize=require(_0xf8de('0x0'));module[_0xf8de('0x1')]={'type':{'type':Sequelize[_0xf8de('0x2')](_0xf8de('0x3'),'variable',_0xf8de('0x4'),_0xf8de('0x5'),_0xf8de('0x6')),'defaultValue':_0xf8de('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf8de('0x7')]},'keyType':{'type':Sequelize[_0xf8de('0x2')](_0xf8de('0x3'),_0xf8de('0x8'),_0xf8de('0x4'))},'keyContent':{'type':Sequelize[_0xf8de('0x7')]},'idField':{'type':Sequelize[_0xf8de('0x7')]},'nameField':{'type':Sequelize[_0xf8de('0x7')]},'customField':{'type':Sequelize[_0xf8de('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf8de('0x7')]}}; \ No newline at end of file +var _0xade5=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM'];(function(_0x14bd50,_0x41fec1){var _0x14998e=function(_0x421eaa){while(--_0x421eaa){_0x14bd50['push'](_0x14bd50['shift']());}};_0x14998e(++_0x41fec1);}(_0xade5,0xbe));var _0x5ade=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xade5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5ade('0x0'));module[_0x5ade('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5ade('0x2'),_0x5ade('0x3'),'customVariable',_0x5ade('0x4'),_0x5ade('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5ade('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5ade('0x7')](_0x5ade('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5ade('0x6')]},'nameField':{'type':Sequelize[_0x5ade('0x6')]},'customField':{'type':Sequelize[_0x5ade('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 90925a9..39b0f7b 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 _0xe218=['find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','FreshsalesField','includeAll','include','findAll','catch','show','params'];(function(_0x5942cb,_0x4ae1df){var _0x375d21=function(_0x30fc10){while(--_0x30fc10){_0x5942cb['push'](_0x5942cb['shift']());}};_0x375d21(++_0x4ae1df);}(_0xe218,0xd9));var _0x8e21=function(_0x509880,_0x462c05){_0x509880=_0x509880-0x0;var _0x243e82=_0xe218[_0x509880];return _0x243e82;};'use strict';var emlformat=require(_0x8e21('0x0'));var rimraf=require(_0x8e21('0x1'));var zipdir=require(_0x8e21('0x2'));var jsonpatch=require(_0x8e21('0x3'));var rp=require('request-promise');var moment=require(_0x8e21('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8e21('0x5'));var util=require(_0x8e21('0x6'));var path=require('path');var sox=require(_0x8e21('0x7'));var csv=require(_0x8e21('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e21('0x9'));var _=require(_0x8e21('0xa'));var squel=require(_0x8e21('0xb'));var crypto=require(_0x8e21('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8e21('0xd'));var toCsv=require(_0x8e21('0x8'));var querystring=require('querystring');var Papa=require(_0x8e21('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8e21('0xf'));var as=require(_0x8e21('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8e21('0x11'));var config=require(_0x8e21('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e21('0x13'))['db'];function respondWithStatusCode(_0x4025e3,_0x4bb266){_0x4bb266=_0x4bb266||0xcc;return function(_0x5e0e98){if(_0x5e0e98){return _0x4025e3[_0x8e21('0x14')](_0x4bb266);}return _0x4025e3[_0x8e21('0x15')](_0x4bb266)[_0x8e21('0x16')]();};}function respondWithResult(_0x480493,_0x4860cf){_0x4860cf=_0x4860cf||0xc8;return function(_0x59424e){if(_0x59424e){return _0x480493[_0x8e21('0x15')](_0x4860cf)['json'](_0x59424e);}};}function respondWithFilteredResult(_0x166415,_0x1fd6ca){return function(_0x3e8bf9){if(_0x3e8bf9){var _0x1b8f06=typeof _0x1fd6ca[_0x8e21('0x17')]===_0x8e21('0x18')&&typeof _0x1fd6ca[_0x8e21('0x19')]===_0x8e21('0x18');var _0x5c1338=_0x3e8bf9[_0x8e21('0x1a')];var _0x4b102e=_0x1b8f06?0x0:_0x1fd6ca[_0x8e21('0x17')];var _0x49392c=_0x1b8f06?_0x3e8bf9[_0x8e21('0x1a')]:_0x1fd6ca[_0x8e21('0x17')]+_0x1fd6ca[_0x8e21('0x19')];var _0x602900;if(_0x49392c>=_0x5c1338){_0x49392c=_0x5c1338;_0x602900=0xc8;}else{_0x602900=0xce;}_0x166415[_0x8e21('0x15')](_0x602900);return _0x166415[_0x8e21('0x1b')](_0x8e21('0x1c'),_0x4b102e+'-'+_0x49392c+'/'+_0x5c1338)[_0x8e21('0x1d')](_0x3e8bf9);}return null;};}function patchUpdates(_0x2218e1){return function(_0x4495e1){try{jsonpatch[_0x8e21('0x1e')](_0x4495e1,_0x2218e1,!![]);}catch(_0x329318){return BPromise[_0x8e21('0x1f')](_0x329318);}return _0x4495e1[_0x8e21('0x20')]();};}function saveUpdates(_0x155f07,_0x7cc43b){return function(_0x2f3d5c){if(_0x2f3d5c){return _0x2f3d5c['update'](_0x155f07)[_0x8e21('0x21')](function(_0x25a653){return _0x25a653;});}return null;};}function removeEntity(_0xec1d07,_0x481261){return function(_0x2e3e03){if(_0x2e3e03){return _0x2e3e03['destroy']()[_0x8e21('0x21')](function(){_0xec1d07['status'](0xcc)[_0x8e21('0x16')]();});}};}function handleEntityNotFound(_0x5a89f4,_0x53fd5e){return function(_0x26c181){if(!_0x26c181){_0x5a89f4[_0x8e21('0x14')](0x194);}return _0x26c181;};}function handleError(_0x2c2070,_0x1b132e){_0x1b132e=_0x1b132e||0x1f4;return function(_0x3d2825){logger['error'](_0x3d2825[_0x8e21('0x22')]);if(_0x3d2825['name']){delete _0x3d2825[_0x8e21('0x23')];}_0x2c2070[_0x8e21('0x15')](_0x1b132e)[_0x8e21('0x24')](_0x3d2825);};}exports[_0x8e21('0x25')]=function(_0x1c36c5,_0x8034ca){var _0x4d66ef={},_0x565b7f={},_0x4f2695={'count':0x0,'rows':[]};var _0x3a9032=_[_0x8e21('0x26')](db['FreshsalesField']['rawAttributes'],function(_0x226cf6){return{'name':_0x226cf6[_0x8e21('0x27')],'type':_0x226cf6[_0x8e21('0x28')][_0x8e21('0x29')]};});_0x565b7f['model']=_[_0x8e21('0x26')](_0x3a9032,_0x8e21('0x23'));_0x565b7f['query']=_[_0x8e21('0x2a')](_0x1c36c5[_0x8e21('0x2b')]);_0x565b7f[_0x8e21('0x2c')]=_[_0x8e21('0x2d')](_0x565b7f[_0x8e21('0x2e')],_0x565b7f[_0x8e21('0x2b')]);_0x4d66ef[_0x8e21('0x2f')]=_[_0x8e21('0x2d')](_0x565b7f[_0x8e21('0x2e')],qs[_0x8e21('0x30')](_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x30')]));_0x4d66ef[_0x8e21('0x2f')]=_0x4d66ef[_0x8e21('0x2f')][_0x8e21('0x31')]?_0x4d66ef[_0x8e21('0x2f')]:_0x565b7f[_0x8e21('0x2e')];if(!_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x32')](_0x8e21('0x33'))){_0x4d66ef[_0x8e21('0x19')]=qs[_0x8e21('0x19')](_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x19')]);_0x4d66ef[_0x8e21('0x17')]=qs[_0x8e21('0x17')](_0x1c36c5[_0x8e21('0x2b')]['offset']);}_0x4d66ef[_0x8e21('0x34')]=qs[_0x8e21('0x35')](_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x35')]);_0x4d66ef['where']=qs[_0x8e21('0x2c')](_[_0x8e21('0x36')](_0x1c36c5[_0x8e21('0x2b')],_0x565b7f[_0x8e21('0x2c')]),_0x3a9032);if(_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x37')]){_0x4d66ef[_0x8e21('0x38')]=_['merge'](_0x4d66ef[_0x8e21('0x38')],{'$or':_[_0x8e21('0x26')](_0x3a9032,function(_0x522c36){if(_0x522c36[_0x8e21('0x28')]!==_0x8e21('0x39')){var _0x139008={};_0x139008[_0x522c36[_0x8e21('0x23')]]={'$like':'%'+_0x1c36c5[_0x8e21('0x2b')][_0x8e21('0x37')]+'%'};return _0x139008;}})});}_0x4d66ef=_[_0x8e21('0x3a')]({},_0x4d66ef,_0x1c36c5[_0x8e21('0x3b')]);var _0x3cc62f={'where':_0x4d66ef[_0x8e21('0x38')]};return db[_0x8e21('0x3c')][_0x8e21('0x1a')](_0x3cc62f)['then'](function(_0x1f3b74){_0x4f2695[_0x8e21('0x1a')]=_0x1f3b74;if(_0x1c36c5['query'][_0x8e21('0x3d')]){_0x4d66ef[_0x8e21('0x3e')]=[{'all':!![]}];}return db[_0x8e21('0x3c')][_0x8e21('0x3f')](_0x4d66ef);})[_0x8e21('0x21')](function(_0x2236f4){_0x4f2695['rows']=_0x2236f4;return _0x4f2695;})[_0x8e21('0x21')](respondWithFilteredResult(_0x8034ca,_0x4d66ef))[_0x8e21('0x40')](handleError(_0x8034ca,null));};exports[_0x8e21('0x41')]=function(_0x315645,_0xcaab6){var _0x4b559b={'raw':!![],'where':{'id':_0x315645[_0x8e21('0x42')]['id']}},_0x1c4c7b={};_0x1c4c7b[_0x8e21('0x2e')]=_[_0x8e21('0x2a')](db[_0x8e21('0x3c')]['rawAttributes']);_0x1c4c7b['query']=_[_0x8e21('0x2a')](_0x315645[_0x8e21('0x2b')]);_0x1c4c7b[_0x8e21('0x2c')]=_[_0x8e21('0x2d')](_0x1c4c7b[_0x8e21('0x2e')],_0x1c4c7b[_0x8e21('0x2b')]);_0x4b559b[_0x8e21('0x2f')]=_['intersection'](_0x1c4c7b[_0x8e21('0x2e')],qs['fields'](_0x315645[_0x8e21('0x2b')][_0x8e21('0x30')]));_0x4b559b['attributes']=_0x4b559b[_0x8e21('0x2f')][_0x8e21('0x31')]?_0x4b559b[_0x8e21('0x2f')]:_0x1c4c7b[_0x8e21('0x2e')];if(_0x315645['query'][_0x8e21('0x3d')]){_0x4b559b[_0x8e21('0x3e')]=[{'all':!![]}];}_0x4b559b=_[_0x8e21('0x3a')]({},_0x4b559b,_0x315645[_0x8e21('0x3b')]);return db[_0x8e21('0x3c')][_0x8e21('0x43')](_0x4b559b)[_0x8e21('0x21')](handleEntityNotFound(_0xcaab6,null))[_0x8e21('0x21')](respondWithResult(_0xcaab6,null))['catch'](handleError(_0xcaab6,null));};exports[_0x8e21('0x44')]=function(_0x3572ef,_0x1db877){return db['FreshsalesField'][_0x8e21('0x44')](_0x3572ef['body'],{})[_0x8e21('0x21')](respondWithResult(_0x1db877,0xc9))[_0x8e21('0x40')](handleError(_0x1db877,null));};exports['update']=function(_0x490d9b,_0x4844ad){if(_0x490d9b[_0x8e21('0x45')]['id']){delete _0x490d9b[_0x8e21('0x45')]['id'];}return db[_0x8e21('0x3c')][_0x8e21('0x43')]({'where':{'id':_0x490d9b[_0x8e21('0x42')]['id']}})['then'](handleEntityNotFound(_0x4844ad,null))[_0x8e21('0x21')](saveUpdates(_0x490d9b[_0x8e21('0x45')],null))['then'](respondWithResult(_0x4844ad,null))[_0x8e21('0x40')](handleError(_0x4844ad,null));};exports[_0x8e21('0x46')]=function(_0x34c83e,_0x11a40a){return db[_0x8e21('0x3c')][_0x8e21('0x43')]({'where':{'id':_0x34c83e['params']['id']}})[_0x8e21('0x21')](handleEntityNotFound(_0x11a40a,null))['then'](removeEntity(_0x11a40a,null))['catch'](handleError(_0x11a40a,null));}; \ No newline at end of file +var _0x31cb=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','type','key'];(function(_0xcfd46,_0x79e870){var _0x5d111=function(_0x44c57b){while(--_0x44c57b){_0xcfd46['push'](_0xcfd46['shift']());}};_0x5d111(++_0x79e870);}(_0x31cb,0x189));var _0xb31c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x31cb[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xb31c('0x0'));var rimraf=require(_0xb31c('0x1'));var zipdir=require(_0xb31c('0x2'));var jsonpatch=require(_0xb31c('0x3'));var rp=require(_0xb31c('0x4'));var moment=require(_0xb31c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb31c('0x6'));var util=require(_0xb31c('0x7'));var path=require('path');var sox=require(_0xb31c('0x8'));var csv=require(_0xb31c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb31c('0xa'));var _=require(_0xb31c('0xb'));var squel=require(_0xb31c('0xc'));var crypto=require('crypto');var jsforce=require(_0xb31c('0xd'));var deskjs=require(_0xb31c('0xe'));var toCsv=require(_0xb31c('0x9'));var querystring=require(_0xb31c('0xf'));var Papa=require(_0xb31c('0x10'));var Redis=require('ioredis');var authService=require(_0xb31c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb31c('0x12'));var logger=require('../../config/logger')(_0xb31c('0x13'));var utils=require('../../config/utils');var config=require(_0xb31c('0x14'));var licenseUtil=require(_0xb31c('0x15'));var db=require(_0xb31c('0x16'))['db'];function respondWithStatusCode(_0x16604a,_0x4c3522){_0x4c3522=_0x4c3522||0xcc;return function(_0x18b5f6){if(_0x18b5f6){return _0x16604a[_0xb31c('0x17')](_0x4c3522);}return _0x16604a[_0xb31c('0x18')](_0x4c3522)[_0xb31c('0x19')]();};}function respondWithResult(_0xef0954,_0x2b47e0){_0x2b47e0=_0x2b47e0||0xc8;return function(_0x5f3003){if(_0x5f3003){return _0xef0954[_0xb31c('0x18')](_0x2b47e0)[_0xb31c('0x1a')](_0x5f3003);}};}function respondWithFilteredResult(_0x3dd22d,_0x25b530){return function(_0x4e477f){if(_0x4e477f){var _0x3752ae=typeof _0x25b530['offset']===_0xb31c('0x1b')&&typeof _0x25b530[_0xb31c('0x1c')]==='undefined';var _0x193968=_0x4e477f[_0xb31c('0x1d')];var _0x88343=_0x3752ae?0x0:_0x25b530[_0xb31c('0x1e')];var _0x490e59=_0x3752ae?_0x4e477f[_0xb31c('0x1d')]:_0x25b530[_0xb31c('0x1e')]+_0x25b530[_0xb31c('0x1c')];var _0x30c61f;if(_0x490e59>=_0x193968){_0x490e59=_0x193968;_0x30c61f=0xc8;}else{_0x30c61f=0xce;}_0x3dd22d[_0xb31c('0x18')](_0x30c61f);return _0x3dd22d[_0xb31c('0x1f')](_0xb31c('0x20'),_0x88343+'-'+_0x490e59+'/'+_0x193968)['json'](_0x4e477f);}return null;};}function patchUpdates(_0x57ac93){return function(_0x37fe80){try{jsonpatch[_0xb31c('0x21')](_0x37fe80,_0x57ac93,!![]);}catch(_0x502720){return BPromise[_0xb31c('0x22')](_0x502720);}return _0x37fe80[_0xb31c('0x23')]();};}function saveUpdates(_0xec653e,_0x3ec4ac){return function(_0x2d7962){if(_0x2d7962){return _0x2d7962[_0xb31c('0x24')](_0xec653e)[_0xb31c('0x25')](function(_0x1763f8){return _0x1763f8;});}return null;};}function removeEntity(_0x253123,_0x23a313){return function(_0xec11d6){if(_0xec11d6){return _0xec11d6[_0xb31c('0x26')]()[_0xb31c('0x25')](function(){_0x253123['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x407cf1,_0x14f873){return function(_0x375f34){if(!_0x375f34){_0x407cf1[_0xb31c('0x17')](0x194);}return _0x375f34;};}function handleError(_0x509d6a,_0x15579f){_0x15579f=_0x15579f||0x1f4;return function(_0x36c126){logger[_0xb31c('0x27')](_0x36c126['stack']);if(_0x36c126[_0xb31c('0x28')]){delete _0x36c126[_0xb31c('0x28')];}_0x509d6a[_0xb31c('0x18')](_0x15579f)['send'](_0x36c126);};}exports[_0xb31c('0x29')]=function(_0x381c68,_0x3330ea){var _0x3d839f={},_0x8897c1={},_0x782fb3={'count':0x0,'rows':[]};var _0x3b634b=_[_0xb31c('0x2a')](db['FreshsalesField']['rawAttributes'],function(_0x4e8493){return{'name':_0x4e8493['fieldName'],'type':_0x4e8493[_0xb31c('0x2b')][_0xb31c('0x2c')]};});_0x8897c1[_0xb31c('0x2d')]=_[_0xb31c('0x2a')](_0x3b634b,_0xb31c('0x28'));_0x8897c1['query']=_[_0xb31c('0x2e')](_0x381c68[_0xb31c('0x2f')]);_0x8897c1[_0xb31c('0x30')]=_['intersection'](_0x8897c1['model'],_0x8897c1[_0xb31c('0x2f')]);_0x3d839f['attributes']=_[_0xb31c('0x31')](_0x8897c1[_0xb31c('0x2d')],qs[_0xb31c('0x32')](_0x381c68['query']['fields']));_0x3d839f[_0xb31c('0x33')]=_0x3d839f[_0xb31c('0x33')][_0xb31c('0x34')]?_0x3d839f[_0xb31c('0x33')]:_0x8897c1[_0xb31c('0x2d')];if(!_0x381c68[_0xb31c('0x2f')][_0xb31c('0x35')]('nolimit')){_0x3d839f[_0xb31c('0x1c')]=qs[_0xb31c('0x1c')](_0x381c68[_0xb31c('0x2f')][_0xb31c('0x1c')]);_0x3d839f[_0xb31c('0x1e')]=qs[_0xb31c('0x1e')](_0x381c68[_0xb31c('0x2f')][_0xb31c('0x1e')]);}_0x3d839f[_0xb31c('0x36')]=qs[_0xb31c('0x37')](_0x381c68[_0xb31c('0x2f')][_0xb31c('0x37')]);_0x3d839f[_0xb31c('0x38')]=qs[_0xb31c('0x30')](_[_0xb31c('0x39')](_0x381c68[_0xb31c('0x2f')],_0x8897c1[_0xb31c('0x30')]),_0x3b634b);if(_0x381c68['query'][_0xb31c('0x3a')]){_0x3d839f[_0xb31c('0x38')]=_[_0xb31c('0x3b')](_0x3d839f[_0xb31c('0x38')],{'$or':_['map'](_0x3b634b,function(_0x2c679b){if(_0x2c679b[_0xb31c('0x2b')]!==_0xb31c('0x3c')){var _0x4d21a0={};_0x4d21a0[_0x2c679b[_0xb31c('0x28')]]={'$like':'%'+_0x381c68[_0xb31c('0x2f')]['filter']+'%'};return _0x4d21a0;}})});}_0x3d839f=_[_0xb31c('0x3b')]({},_0x3d839f,_0x381c68[_0xb31c('0x3d')]);var _0x4ddaad={'where':_0x3d839f['where']};return db[_0xb31c('0x3e')][_0xb31c('0x1d')](_0x4ddaad)[_0xb31c('0x25')](function(_0x2c3133){_0x782fb3[_0xb31c('0x1d')]=_0x2c3133;if(_0x381c68[_0xb31c('0x2f')][_0xb31c('0x3f')]){_0x3d839f['include']=[{'all':!![]}];}return db['FreshsalesField'][_0xb31c('0x40')](_0x3d839f);})['then'](function(_0x230402){_0x782fb3[_0xb31c('0x41')]=_0x230402;return _0x782fb3;})['then'](respondWithFilteredResult(_0x3330ea,_0x3d839f))[_0xb31c('0x42')](handleError(_0x3330ea,null));};exports[_0xb31c('0x43')]=function(_0x1f19c5,_0x3f64ff){var _0x3ef70b={'raw':!![],'where':{'id':_0x1f19c5[_0xb31c('0x44')]['id']}},_0x383bee={};_0x383bee[_0xb31c('0x2d')]=_['keys'](db['FreshsalesField'][_0xb31c('0x45')]);_0x383bee[_0xb31c('0x2f')]=_[_0xb31c('0x2e')](_0x1f19c5[_0xb31c('0x2f')]);_0x383bee[_0xb31c('0x30')]=_[_0xb31c('0x31')](_0x383bee[_0xb31c('0x2d')],_0x383bee[_0xb31c('0x2f')]);_0x3ef70b[_0xb31c('0x33')]=_[_0xb31c('0x31')](_0x383bee['model'],qs[_0xb31c('0x32')](_0x1f19c5[_0xb31c('0x2f')][_0xb31c('0x32')]));_0x3ef70b[_0xb31c('0x33')]=_0x3ef70b[_0xb31c('0x33')]['length']?_0x3ef70b[_0xb31c('0x33')]:_0x383bee[_0xb31c('0x2d')];if(_0x1f19c5[_0xb31c('0x2f')]['includeAll']){_0x3ef70b['include']=[{'all':!![]}];}_0x3ef70b=_['merge']({},_0x3ef70b,_0x1f19c5[_0xb31c('0x3d')]);return db[_0xb31c('0x3e')][_0xb31c('0x46')](_0x3ef70b)['then'](handleEntityNotFound(_0x3f64ff,null))[_0xb31c('0x25')](respondWithResult(_0x3f64ff,null))[_0xb31c('0x42')](handleError(_0x3f64ff,null));};exports[_0xb31c('0x47')]=function(_0x28b790,_0x3a9d7c){return db[_0xb31c('0x3e')][_0xb31c('0x47')](_0x28b790[_0xb31c('0x48')],{})[_0xb31c('0x25')](respondWithResult(_0x3a9d7c,0xc9))[_0xb31c('0x42')](handleError(_0x3a9d7c,null));};exports[_0xb31c('0x24')]=function(_0xf7ff8b,_0x57d0b2){if(_0xf7ff8b[_0xb31c('0x48')]['id']){delete _0xf7ff8b[_0xb31c('0x48')]['id'];}return db[_0xb31c('0x3e')][_0xb31c('0x46')]({'where':{'id':_0xf7ff8b[_0xb31c('0x44')]['id']}})[_0xb31c('0x25')](handleEntityNotFound(_0x57d0b2,null))['then'](saveUpdates(_0xf7ff8b['body'],null))[_0xb31c('0x25')](respondWithResult(_0x57d0b2,null))['catch'](handleError(_0x57d0b2,null));};exports[_0xb31c('0x26')]=function(_0x18a51a,_0x27e90b){return db[_0xb31c('0x3e')]['find']({'where':{'id':_0x18a51a[_0xb31c('0x44')]['id']}})['then'](handleEntityNotFound(_0x27e90b,null))['then'](removeEntity(_0x27e90b,null))[_0xb31c('0x42')](handleError(_0x27e90b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index ede7faa..a7e518e 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 _0xfd49=['idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','int_freshsales_fields'];(function(_0x2c8904,_0x222507){var _0xac620f=function(_0x3d0ccb){while(--_0x3d0ccb){_0x2c8904['push'](_0x2c8904['shift']());}};_0xac620f(++_0x222507);}(_0xfd49,0x121));var _0x9fd4=function(_0x38ae31,_0x3b3d51){_0x38ae31=_0x38ae31-0x0;var _0x55589a=_0xfd49[_0x38ae31];return _0x55589a;};'use strict';var _=require(_0x9fd4('0x0'));var util=require(_0x9fd4('0x1'));var logger=require(_0x9fd4('0x2'))(_0x9fd4('0x3'));var moment=require(_0x9fd4('0x4'));var BPromise=require('bluebird');var rp=require(_0x9fd4('0x5'));var fs=require('fs');var path=require(_0x9fd4('0x6'));var rimraf=require(_0x9fd4('0x7'));var config=require(_0x9fd4('0x8'));var attributes=require(_0x9fd4('0x9'));module['exports']=function(_0x5d8420,_0x89e59b){return _0x5d8420['define']('FreshsalesField',attributes,{'tableName':_0x9fd4('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x9fd4('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdcdb=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x82b6c8,_0x366965){var _0xb21068=function(_0x40cf8d){while(--_0x40cf8d){_0x82b6c8['push'](_0x82b6c8['shift']());}};_0xb21068(++_0x366965);}(_0xdcdb,0x64));var _0xbdcd=function(_0x3a5e31,_0x3fdf58){_0x3a5e31=_0x3a5e31-0x0;var _0x4d4d79=_0xdcdb[_0x3a5e31];return _0x4d4d79;};'use strict';var _=require(_0xbdcd('0x0'));var util=require(_0xbdcd('0x1'));var logger=require(_0xbdcd('0x2'))(_0xbdcd('0x3'));var moment=require(_0xbdcd('0x4'));var BPromise=require(_0xbdcd('0x5'));var rp=require(_0xbdcd('0x6'));var fs=require('fs');var path=require(_0xbdcd('0x7'));var rimraf=require(_0xbdcd('0x8'));var config=require(_0xbdcd('0x9'));var attributes=require(_0xbdcd('0xa'));module[_0xbdcd('0xb')]=function(_0x3a8b0d,_0x471f46){return _0x3a8b0d[_0xbdcd('0xc')](_0xbdcd('0xd'),attributes,{'tableName':_0xbdcd('0xe'),'paranoid':![],'indexes':[{'name':_0xbdcd('0xf'),'fields':[_0xbdcd('0x10'),_0xbdcd('0x11')],'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 ebecc1f..2518481 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x53ec,0x192));var _0xc53e=function(_0x3f52d9,_0x1d748c){_0x3f52d9=_0x3f52d9-0x0;var _0x21e01f=_0x53ec[_0x3f52d9];return _0x21e01f;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _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(_0x2e7f1e,_0x32f286){var _0x3dffa5=function(_0x920dc5){while(--_0x920dc5){_0x2e7f1e['push'](_0x2e7f1e['shift']());}};_0x3dffa5(++_0x32f286);}(_0x5d58,0x187));var _0x85d5=function(_0x3e0641,_0x50999f){_0x3e0641=_0x3e0641-0x0;var _0x395839=_0x5d58[_0x3e0641];return _0x395839;};'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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5d2f42b..a118c95 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(_0x33b034,_0x369348){var _0x3a6f82=function(_0x3712a8){while(--_0x3712a8){_0x33b034['push'](_0x33b034['shift']());}};_0x3a6f82(++_0x369348);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x1649be,_0x28c35c){var _0x49f209=function(_0x500833){while(--_0x500833){_0x1649be['push'](_0x1649be['shift']());}};_0x49f209(++_0x28c35c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 2b96c83..8b59c1b 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 _0xf1d4=['newTab','integrationTab','sequelize','STRING','username','ENUM'];(function(_0x247b94,_0x57ed01){var _0x50029f=function(_0x51013d){while(--_0x51013d){_0x247b94['push'](_0x247b94['shift']());}};_0x50029f(++_0x57ed01);}(_0xf1d4,0x158));var _0x4f1d=function(_0x4d2089,_0x46e360){_0x4d2089=_0x4d2089-0x0;var _0x10c1fb=_0xf1d4[_0x4d2089];return _0x10c1fb;};'use strict';var Sequelize=require(_0x4f1d('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f1d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4f1d('0x1')],'unique':_0x4f1d('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4f1d('0x1')]},'clientId':{'type':Sequelize[_0x4f1d('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4f1d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4f1d('0x3')]('integrationTab',_0x4f1d('0x4')),'defaultValue':_0x4f1d('0x5')}}; \ No newline at end of file +var _0xfae3=['exports','STRING','username','ENUM','integrationTab','sequelize'];(function(_0x586b7d,_0x15c574){var _0x24385d=function(_0x493b7d){while(--_0x493b7d){_0x586b7d['push'](_0x586b7d['shift']());}};_0x24385d(++_0x15c574);}(_0xfae3,0xa1));var _0x3fae=function(_0x8a2dae,_0x2a21a7){_0x8a2dae=_0x8a2dae-0x0;var _0x308f20=_0xfae3[_0x8a2dae];return _0x308f20;};'use strict';var Sequelize=require(_0x3fae('0x0'));module[_0x3fae('0x1')]={'name':{'type':Sequelize[_0x3fae('0x2')]},'description':{'type':Sequelize[_0x3fae('0x2')]},'username':{'type':Sequelize[_0x3fae('0x2')],'unique':_0x3fae('0x3')},'remoteUri':{'type':Sequelize[_0x3fae('0x2')]},'password':{'type':Sequelize[_0x3fae('0x2')]},'clientId':{'type':Sequelize[_0x3fae('0x2')]},'clientSecret':{'type':Sequelize[_0x3fae('0x2')]},'securityToken':{'type':Sequelize[_0x3fae('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3fae('0x4')](_0x3fae('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index eedd20e..914b3fc 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 _0xff5f=['sendStatus','error','stack','name','send','index','SalesforceAccount','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','catch','params','length','include','options','find','create','body','getConfigurations','findOne','SalesforceConfiguration','AccountId','getSubjects','channel','SalesforceField','Subjects','Descriptions','getFields','Task','clientId','username','password','securityToken','remoteUri','substring','lastIndexOf','Connection','clientSecret','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','Subject','int','picklist','boolean','phone','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','status','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x20bbd3,_0x2fbaa4){var _0x3fe1f1=function(_0x40950c){while(--_0x40950c){_0x20bbd3['push'](_0x20bbd3['shift']());}};_0x3fe1f1(++_0x2fbaa4);}(_0xff5f,0x1cc));var _0xfff5=function(_0x38626b,_0x4a615d){_0x38626b=_0x38626b-0x0;var _0x4f9913=_0xff5f[_0x38626b];return _0x4f9913;};'use strict';var emlformat=require(_0xfff5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfff5('0x1'));var rp=require(_0xfff5('0x2'));var moment=require(_0xfff5('0x3'));var BPromise=require(_0xfff5('0x4'));var Mustache=require(_0xfff5('0x5'));var util=require(_0xfff5('0x6'));var path=require(_0xfff5('0x7'));var sox=require(_0xfff5('0x8'));var csv=require(_0xfff5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfff5('0xa'));var _=require(_0xfff5('0xb'));var squel=require(_0xfff5('0xc'));var crypto=require(_0xfff5('0xd'));var jsforce=require(_0xfff5('0xe'));var deskjs=require(_0xfff5('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfff5('0x10'));var Papa=require(_0xfff5('0x11'));var Redis=require(_0xfff5('0x12'));var authService=require(_0xfff5('0x13'));var qs=require(_0xfff5('0x14'));var as=require(_0xfff5('0x15'));var hardwareService=require(_0xfff5('0x16'));var logger=require(_0xfff5('0x17'))(_0xfff5('0x18'));var utils=require(_0xfff5('0x19'));var config=require(_0xfff5('0x1a'));var licenseUtil=require(_0xfff5('0x1b'));var db=require(_0xfff5('0x1c'))['db'];var integrations=require(_0xfff5('0x1d'));function respondWithStatusCode(_0x5d99b7,_0x291cb0){_0x291cb0=_0x291cb0||0xcc;return function(_0x38bf54){if(_0x38bf54){return _0x5d99b7['sendStatus'](_0x291cb0);}return _0x5d99b7['status'](_0x291cb0)[_0xfff5('0x1e')]();};}function respondWithResult(_0x192d97,_0x59c157){_0x59c157=_0x59c157||0xc8;return function(_0x887160){if(_0x887160){return _0x192d97['status'](_0x59c157)[_0xfff5('0x1f')](_0x887160);}};}function respondWithFilteredResult(_0x74b661,_0x49273b){return function(_0x4f1924){if(_0x4f1924){var _0x56a9e8=typeof _0x49273b[_0xfff5('0x20')]===_0xfff5('0x21')&&typeof _0x49273b[_0xfff5('0x22')]===_0xfff5('0x21');var _0x3790f2=_0x4f1924[_0xfff5('0x23')];var _0x4407f1=_0x56a9e8?0x0:_0x49273b['offset'];var _0x143bec=_0x56a9e8?_0x4f1924[_0xfff5('0x23')]:_0x49273b[_0xfff5('0x20')]+_0x49273b[_0xfff5('0x22')];var _0x28c9f3;if(_0x143bec>=_0x3790f2){_0x143bec=_0x3790f2;_0x28c9f3=0xc8;}else{_0x28c9f3=0xce;}_0x74b661['status'](_0x28c9f3);return _0x74b661[_0xfff5('0x24')](_0xfff5('0x25'),_0x4407f1+'-'+_0x143bec+'/'+_0x3790f2)[_0xfff5('0x1f')](_0x4f1924);}return null;};}function patchUpdates(_0x316f92){return function(_0x141075){try{jsonpatch[_0xfff5('0x26')](_0x141075,_0x316f92,!![]);}catch(_0x174f26){return BPromise[_0xfff5('0x27')](_0x174f26);}return _0x141075[_0xfff5('0x28')]();};}function saveUpdates(_0xcc4884,_0x7aee21){return function(_0x2a0b18){if(_0x2a0b18){return _0x2a0b18[_0xfff5('0x29')](_0xcc4884)['then'](function(_0x383691){return _0x383691;});}return null;};}function removeEntity(_0x4b369b,_0x176049){return function(_0x18f211){if(_0x18f211){return _0x18f211[_0xfff5('0x2a')]()[_0xfff5('0x2b')](function(){_0x4b369b['status'](0xcc)[_0xfff5('0x1e')]();});}};}function handleEntityNotFound(_0x298b9c,_0x345d8d){return function(_0x19f6ec){if(!_0x19f6ec){_0x298b9c[_0xfff5('0x2c')](0x194);}return _0x19f6ec;};}function handleError(_0x27b06d,_0x44858b){_0x44858b=_0x44858b||0x1f4;return function(_0x178b97){logger[_0xfff5('0x2d')](_0x178b97[_0xfff5('0x2e')]);if(_0x178b97[_0xfff5('0x2f')]){delete _0x178b97[_0xfff5('0x2f')];}_0x27b06d['status'](_0x44858b)[_0xfff5('0x30')](_0x178b97);};}exports[_0xfff5('0x31')]=function(_0x7aa619,_0x10c78b){var _0x5286ae={},_0x2639af={},_0x1db454={'count':0x0,'rows':[]};var _0x3281c6=_['map'](db[_0xfff5('0x32')][_0xfff5('0x33')],function(_0x4c634d){return{'name':_0x4c634d['fieldName'],'type':_0x4c634d[_0xfff5('0x34')]['key']};});_0x2639af[_0xfff5('0x35')]=_['map'](_0x3281c6,'name');_0x2639af['query']=_[_0xfff5('0x36')](_0x7aa619[_0xfff5('0x37')]);_0x2639af[_0xfff5('0x38')]=_[_0xfff5('0x39')](_0x2639af[_0xfff5('0x35')],_0x2639af['query']);_0x5286ae[_0xfff5('0x3a')]=_[_0xfff5('0x39')](_0x2639af[_0xfff5('0x35')],qs[_0xfff5('0x3b')](_0x7aa619[_0xfff5('0x37')]['fields']));_0x5286ae[_0xfff5('0x3a')]=_0x5286ae['attributes']['length']?_0x5286ae[_0xfff5('0x3a')]:_0x2639af['model'];if(!_0x7aa619[_0xfff5('0x37')][_0xfff5('0x3c')](_0xfff5('0x3d'))){_0x5286ae[_0xfff5('0x22')]=qs[_0xfff5('0x22')](_0x7aa619[_0xfff5('0x37')][_0xfff5('0x22')]);_0x5286ae['offset']=qs[_0xfff5('0x20')](_0x7aa619[_0xfff5('0x37')][_0xfff5('0x20')]);}_0x5286ae[_0xfff5('0x3e')]=qs[_0xfff5('0x3f')](_0x7aa619[_0xfff5('0x37')]['sort']);_0x5286ae[_0xfff5('0x40')]=qs['filters'](_[_0xfff5('0x41')](_0x7aa619[_0xfff5('0x37')],_0x2639af['filters']),_0x3281c6);if(_0x7aa619['query'][_0xfff5('0x42')]){_0x5286ae[_0xfff5('0x40')]=_[_0xfff5('0x43')](_0x5286ae['where'],{'$or':_[_0xfff5('0x44')](_0x3281c6,function(_0x4ee303){if(_0x4ee303['type']!==_0xfff5('0x45')){var _0x1f2918={};_0x1f2918[_0x4ee303[_0xfff5('0x2f')]]={'$like':'%'+_0x7aa619[_0xfff5('0x37')][_0xfff5('0x42')]+'%'};return _0x1f2918;}})});}_0x5286ae=_['merge']({},_0x5286ae,_0x7aa619['options']);var _0x2b24d5={'where':_0x5286ae['where']};return db[_0xfff5('0x32')][_0xfff5('0x23')](_0x2b24d5)[_0xfff5('0x2b')](function(_0x3db551){_0x1db454[_0xfff5('0x23')]=_0x3db551;if(_0x7aa619[_0xfff5('0x37')][_0xfff5('0x46')]){_0x5286ae['include']=[{'all':!![]}];}return db[_0xfff5('0x32')][_0xfff5('0x47')](_0x5286ae);})['then'](function(_0xf42737){_0x1db454['rows']=_0xf42737;return _0x1db454;})[_0xfff5('0x2b')](respondWithFilteredResult(_0x10c78b,_0x5286ae))[_0xfff5('0x48')](handleError(_0x10c78b,null));};exports['show']=function(_0x2bcc45,_0x1cd401){var _0x1741c9={'raw':![],'where':{'id':_0x2bcc45[_0xfff5('0x49')]['id']}},_0x4c0de5={};_0x4c0de5[_0xfff5('0x35')]=_[_0xfff5('0x36')](db[_0xfff5('0x32')][_0xfff5('0x33')]);_0x4c0de5[_0xfff5('0x37')]=_[_0xfff5('0x36')](_0x2bcc45[_0xfff5('0x37')]);_0x4c0de5[_0xfff5('0x38')]=_[_0xfff5('0x39')](_0x4c0de5[_0xfff5('0x35')],_0x4c0de5[_0xfff5('0x37')]);_0x1741c9[_0xfff5('0x3a')]=_[_0xfff5('0x39')](_0x4c0de5[_0xfff5('0x35')],qs[_0xfff5('0x3b')](_0x2bcc45[_0xfff5('0x37')][_0xfff5('0x3b')]));_0x1741c9[_0xfff5('0x3a')]=_0x1741c9[_0xfff5('0x3a')][_0xfff5('0x4a')]?_0x1741c9[_0xfff5('0x3a')]:_0x4c0de5[_0xfff5('0x35')];if(_0x2bcc45['query']['includeAll']){_0x1741c9[_0xfff5('0x4b')]=[{'all':!![]}];}_0x1741c9=_[_0xfff5('0x43')]({},_0x1741c9,_0x2bcc45[_0xfff5('0x4c')]);return db[_0xfff5('0x32')][_0xfff5('0x4d')](_0x1741c9)[_0xfff5('0x2b')](handleEntityNotFound(_0x1cd401,null))[_0xfff5('0x2b')](respondWithResult(_0x1cd401,null))[_0xfff5('0x48')](handleError(_0x1cd401,null));};exports[_0xfff5('0x4e')]=function(_0x3f9f00,_0x582791){return db['SalesforceAccount']['create'](_0x3f9f00[_0xfff5('0x4f')],{})[_0xfff5('0x2b')](respondWithResult(_0x582791,0xc9))[_0xfff5('0x48')](handleError(_0x582791,null));};exports[_0xfff5('0x29')]=function(_0x4087c4,_0x1b43ef){if(_0x4087c4[_0xfff5('0x4f')]['id']){delete _0x4087c4[_0xfff5('0x4f')]['id'];}return db[_0xfff5('0x32')][_0xfff5('0x4d')]({'where':{'id':_0x4087c4[_0xfff5('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b43ef,null))[_0xfff5('0x2b')](saveUpdates(_0x4087c4[_0xfff5('0x4f')],null))[_0xfff5('0x2b')](respondWithResult(_0x1b43ef,null))[_0xfff5('0x48')](handleError(_0x1b43ef,null));};exports[_0xfff5('0x2a')]=function(_0x151506,_0x4aaf0f){return db['SalesforceAccount'][_0xfff5('0x4d')]({'where':{'id':_0x151506['params']['id']}})[_0xfff5('0x2b')](handleEntityNotFound(_0x4aaf0f,null))[_0xfff5('0x2b')](removeEntity(_0x4aaf0f,null))[_0xfff5('0x48')](handleError(_0x4aaf0f,null));};exports[_0xfff5('0x50')]=function(_0x4bbf93,_0x60b957,_0xd5ed57){var _0x26272e={};var _0x10d246={};var _0x2d94fb;var _0x1a69be;return db[_0xfff5('0x32')][_0xfff5('0x51')]({'where':{'id':_0x4bbf93[_0xfff5('0x49')]['id']}})[_0xfff5('0x2b')](handleEntityNotFound(_0x60b957,null))[_0xfff5('0x2b')](function(_0x286f7a){if(_0x286f7a){_0x2d94fb=_0x286f7a;_0x10d246['model']=_['keys'](db[_0xfff5('0x52')][_0xfff5('0x33')]);_0x10d246[_0xfff5('0x37')]=_[_0xfff5('0x36')](_0x4bbf93[_0xfff5('0x37')]);_0x10d246[_0xfff5('0x38')]=_[_0xfff5('0x39')](_0x10d246[_0xfff5('0x35')],_0x10d246[_0xfff5('0x37')]);_0x26272e['attributes']=_['intersection'](_0x10d246[_0xfff5('0x35')],qs[_0xfff5('0x3b')](_0x4bbf93[_0xfff5('0x37')]['fields']));_0x26272e[_0xfff5('0x3a')]=_0x26272e[_0xfff5('0x3a')][_0xfff5('0x4a')]?_0x26272e[_0xfff5('0x3a')]:_0x10d246[_0xfff5('0x35')];_0x26272e[_0xfff5('0x3e')]=qs[_0xfff5('0x3f')](_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x3f')]);_0x26272e[_0xfff5('0x40')]=qs[_0xfff5('0x38')](_[_0xfff5('0x41')](_0x4bbf93[_0xfff5('0x37')],_0x10d246['filters']));if(_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x42')]){_0x26272e['where']=_['merge'](_0x26272e[_0xfff5('0x40')],{'$or':_[_0xfff5('0x44')](_0x26272e['attributes'],function(_0x406544){var _0x12e9e0={};_0x12e9e0[_0x406544]={'$like':'%'+_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x42')]+'%'};return _0x12e9e0;})});}_0x26272e=_[_0xfff5('0x43')]({},_0x26272e,_0x4bbf93[_0xfff5('0x4c')]);return _0x2d94fb[_0xfff5('0x50')](_0x26272e);}})[_0xfff5('0x2b')](function(_0x463175){if(_0x463175){_0x1a69be=_0x463175[_0xfff5('0x4a')];if(!_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x3c')]('nolimit')){_0x26272e[_0xfff5('0x22')]=qs[_0xfff5('0x22')](_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x22')]);_0x26272e[_0xfff5('0x20')]=qs[_0xfff5('0x20')](_0x4bbf93[_0xfff5('0x37')][_0xfff5('0x20')]);}return _0x2d94fb[_0xfff5('0x50')](_0x26272e);}})[_0xfff5('0x2b')](function(_0x488aeb){if(_0x488aeb){return _0x488aeb?{'count':_0x1a69be,'rows':_0x488aeb}:null;}})['then'](respondWithResult(_0x60b957,null))['catch'](handleError(_0x60b957,null));};exports['addConfiguration']=function(_0x3b3e79,_0x434a53,_0x14c6eb){if(_0x3b3e79['body']['id']){delete _0x3b3e79[_0xfff5('0x4f')]['id'];}return db[_0xfff5('0x32')][_0xfff5('0x51')]({'where':{'id':_0x3b3e79[_0xfff5('0x49')]['id']}})[_0xfff5('0x2b')](handleEntityNotFound(_0x434a53,null))['then'](function(_0x19a29b){if(_0x19a29b){_0x3b3e79[_0xfff5('0x4f')][_0xfff5('0x53')]=_0x19a29b['id'];_0x3b3e79[_0xfff5('0x4f')]['Subjects']=integrations[_0xfff5('0x54')](_0x3b3e79['body'][_0xfff5('0x55')],_0x3b3e79['body'][_0xfff5('0x34')]);_0x3b3e79[_0xfff5('0x4f')]['Descriptions']=integrations['getDescriptions'](_0x3b3e79['body'][_0xfff5('0x55')],_0x3b3e79[_0xfff5('0x4f')][_0xfff5('0x34')]);return db[_0xfff5('0x52')][_0xfff5('0x4e')](_0x3b3e79[_0xfff5('0x4f')],{'include':[{'model':db[_0xfff5('0x56')],'as':_0xfff5('0x57')},{'model':db[_0xfff5('0x56')],'as':_0xfff5('0x58')}]});}return null;})[_0xfff5('0x2b')](respondWithResult(_0x434a53,null))[_0xfff5('0x48')](handleError(_0x434a53,null));};exports[_0xfff5('0x59')]=function(_0x4f0e10,_0xd8372f,_0x5df0e9){var _0x3cc63b;var _0x3e11af='';var _0x27011e=_0xfff5('0x5a');return db[_0xfff5('0x32')][_0xfff5('0x51')]({'where':{'id':_0x4f0e10['params']['id']},'attributes':['id','remoteUri',_0xfff5('0x5b'),'clientSecret',_0xfff5('0x5c'),_0xfff5('0x5d'),_0xfff5('0x5e')]})[_0xfff5('0x2b')](handleEntityNotFound(_0xd8372f,null))[_0xfff5('0x2b')](function(_0xc60095){if(_0xc60095){_0x3e11af=_0xc60095[_0xfff5('0x5f')];var _0x5cb531=_0x3e11af['slice'](-0x1);if(_0x5cb531==='/'){_0x3e11af=_0x3e11af[_0xfff5('0x60')](0x0,_0x3e11af[_0xfff5('0x61')](_0x5cb531));}_0x3cc63b=new jsforce[(_0xfff5('0x62'))]({'oauth2':{'loginUrl':_0x3e11af,'clientId':_0xc60095[_0xfff5('0x5b')],'clientSecret':_0xc60095[_0xfff5('0x63')]}});return _0x3cc63b[_0xfff5('0x64')](_0xc60095[_0xfff5('0x5c')],_0xc60095[_0xfff5('0x5d')][_0xfff5('0x65')](_0xc60095[_0xfff5('0x5e')]));}})['then'](function(_0x34c868){if(_0x34c868){if(!_[_0xfff5('0x66')](_0x4f0e10[_0xfff5('0x37')]['ticketType'])){_0x27011e=_0x4f0e10['query'][_0xfff5('0x67')];}return _0x3cc63b[_0xfff5('0x68')](_0x27011e)['describe']();}})[_0xfff5('0x2b')](function(_0x39dff5){var _0x50a919=[_0xfff5('0x69'),_0xfff5('0x6a'),_0xfff5('0x6b'),'IsRecurrence',_0xfff5('0x6c'),'Description'];var _0x2144cd=['string',_0xfff5('0x6d'),_0xfff5('0x6e'),_0xfff5('0x6f'),'email','textarea',_0xfff5('0x70')];if(_0x39dff5){_['remove'](_0x39dff5[_0xfff5('0x3b')],function(_0x4a4e79){return _0x50a919[_0xfff5('0x71')](_0x4a4e79[_0xfff5('0x2f')])||!_0x2144cd[_0xfff5('0x71')](_0x4a4e79[_0xfff5('0x34')]);});return{'count':_0x39dff5[_0xfff5('0x3b')][_0xfff5('0x4a')],'rows':_[_0xfff5('0x44')](_0x39dff5[_0xfff5('0x3b')],function(_0x2c65cc){return{'id':_0x2c65cc['name'],'name':_0x2c65cc[_0xfff5('0x72')],'custom':_0x2c65cc[_0xfff5('0x73')],'options':_0x2c65cc['picklistValues']['length']>0x0?_['map'](_0x2c65cc[_0xfff5('0x74')],function(_0x446c64){return{'name':_0x446c64[_0xfff5('0x72')],'value':_0x446c64['value']};}):_0x2c65cc[_0xfff5('0x34')]==_0xfff5('0x6f')?[{'name':_0xfff5('0x75'),'value':_0xfff5('0x76')},{'name':_0xfff5('0x77'),'value':_0xfff5('0x78')}]:[]};})};}})[_0xfff5('0x2b')](respondWithResult(_0xd8372f,null))[_0xfff5('0x48')](function(_0x138638){var _0x54e205=_0x4f0e10[_0xfff5('0x37')][_0xfff5('0x79')]?0x1f4:_0x138638[_0xfff5('0x7a')]||0x1f4;logger['error'](_0xfff5('0x7b'),_0xfff5('0x59'),_0x54e205,JSON['stringify'](_0x138638));delete _0x138638[_0xfff5('0x2f')];if(_0x54e205===0x191){_0x54e205=0x190;}_0xd8372f[_0xfff5('0x7c')](_0x54e205)[_0xfff5('0x30')](_0x4f0e10[_0xfff5('0x37')][_0xfff5('0x79')]?{'message':_0xfff5('0x7d'),'statusCode':_0x138638[_0xfff5('0x7a')]}:_0x138638);});}; \ No newline at end of file +var _0x6042=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','getConfigurations','findOne','SalesforceConfiguration','AccountId','getSubjects','Descriptions','channel','SalesforceField','Subjects','getFields','remoteUri','clientSecret','username','password','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','map','SalesforceAccount','rawAttributes','key','query'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0x6042,0xc7));var _0x2604=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6042[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x2604('0x0'));var rimraf=require(_0x2604('0x1'));var zipdir=require(_0x2604('0x2'));var jsonpatch=require(_0x2604('0x3'));var rp=require('request-promise');var moment=require(_0x2604('0x4'));var BPromise=require(_0x2604('0x5'));var Mustache=require(_0x2604('0x6'));var util=require('util');var path=require(_0x2604('0x7'));var sox=require('sox');var csv=require(_0x2604('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2604('0x9'));var _=require(_0x2604('0xa'));var squel=require(_0x2604('0xb'));var crypto=require(_0x2604('0xc'));var jsforce=require(_0x2604('0xd'));var deskjs=require(_0x2604('0xe'));var toCsv=require(_0x2604('0x8'));var querystring=require(_0x2604('0xf'));var Papa=require(_0x2604('0x10'));var Redis=require(_0x2604('0x11'));var authService=require(_0x2604('0x12'));var qs=require(_0x2604('0x13'));var as=require(_0x2604('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2604('0x15'))(_0x2604('0x16'));var utils=require(_0x2604('0x17'));var config=require(_0x2604('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2604('0x19'));function respondWithStatusCode(_0x23384d,_0x2558fb){_0x2558fb=_0x2558fb||0xcc;return function(_0x26ec85){if(_0x26ec85){return _0x23384d[_0x2604('0x1a')](_0x2558fb);}return _0x23384d[_0x2604('0x1b')](_0x2558fb)[_0x2604('0x1c')]();};}function respondWithResult(_0x2d8ea5,_0x4d9368){_0x4d9368=_0x4d9368||0xc8;return function(_0x4a026c){if(_0x4a026c){return _0x2d8ea5[_0x2604('0x1b')](_0x4d9368)[_0x2604('0x1d')](_0x4a026c);}};}function respondWithFilteredResult(_0x18cd86,_0xb2432){return function(_0x12818c){if(_0x12818c){var _0x55c275=typeof _0xb2432[_0x2604('0x1e')]===_0x2604('0x1f')&&typeof _0xb2432[_0x2604('0x20')]==='undefined';var _0x203e5b=_0x12818c[_0x2604('0x21')];var _0x3e47ce=_0x55c275?0x0:_0xb2432[_0x2604('0x1e')];var _0x452cdc=_0x55c275?_0x12818c['count']:_0xb2432[_0x2604('0x1e')]+_0xb2432[_0x2604('0x20')];var _0x53c93d;if(_0x452cdc>=_0x203e5b){_0x452cdc=_0x203e5b;_0x53c93d=0xc8;}else{_0x53c93d=0xce;}_0x18cd86['status'](_0x53c93d);return _0x18cd86[_0x2604('0x22')](_0x2604('0x23'),_0x3e47ce+'-'+_0x452cdc+'/'+_0x203e5b)[_0x2604('0x1d')](_0x12818c);}return null;};}function patchUpdates(_0x1f4ee3){return function(_0x7e1782){try{jsonpatch['apply'](_0x7e1782,_0x1f4ee3,!![]);}catch(_0x364480){return BPromise[_0x2604('0x24')](_0x364480);}return _0x7e1782[_0x2604('0x25')]();};}function saveUpdates(_0x58275d,_0xa75478){return function(_0x2d1c8e){if(_0x2d1c8e){return _0x2d1c8e[_0x2604('0x26')](_0x58275d)['then'](function(_0x75e9bb){return _0x75e9bb;});}return null;};}function removeEntity(_0x6cffa9,_0x17d915){return function(_0x2b6c72){if(_0x2b6c72){return _0x2b6c72[_0x2604('0x27')]()[_0x2604('0x28')](function(){_0x6cffa9[_0x2604('0x1b')](0xcc)[_0x2604('0x1c')]();});}};}function handleEntityNotFound(_0x1f90a5,_0x23aa25){return function(_0x18cf18){if(!_0x18cf18){_0x1f90a5['sendStatus'](0x194);}return _0x18cf18;};}function handleError(_0x34aa6f,_0x8c545){_0x8c545=_0x8c545||0x1f4;return function(_0x2e9a2e){logger[_0x2604('0x29')](_0x2e9a2e['stack']);if(_0x2e9a2e['name']){delete _0x2e9a2e[_0x2604('0x2a')];}_0x34aa6f[_0x2604('0x1b')](_0x8c545)[_0x2604('0x2b')](_0x2e9a2e);};}exports['index']=function(_0x59a9ad,_0x5d0e23){var _0x29ad42={},_0x498872={},_0x4e519c={'count':0x0,'rows':[]};var _0x37823f=_[_0x2604('0x2c')](db[_0x2604('0x2d')][_0x2604('0x2e')],function(_0x4524b7){return{'name':_0x4524b7['fieldName'],'type':_0x4524b7['type'][_0x2604('0x2f')]};});_0x498872['model']=_[_0x2604('0x2c')](_0x37823f,'name');_0x498872[_0x2604('0x30')]=_[_0x2604('0x31')](_0x59a9ad[_0x2604('0x30')]);_0x498872[_0x2604('0x32')]=_[_0x2604('0x33')](_0x498872[_0x2604('0x34')],_0x498872['query']);_0x29ad42[_0x2604('0x35')]=_[_0x2604('0x33')](_0x498872[_0x2604('0x34')],qs[_0x2604('0x36')](_0x59a9ad['query']['fields']));_0x29ad42[_0x2604('0x35')]=_0x29ad42[_0x2604('0x35')][_0x2604('0x37')]?_0x29ad42[_0x2604('0x35')]:_0x498872[_0x2604('0x34')];if(!_0x59a9ad[_0x2604('0x30')][_0x2604('0x38')](_0x2604('0x39'))){_0x29ad42['limit']=qs[_0x2604('0x20')](_0x59a9ad[_0x2604('0x30')][_0x2604('0x20')]);_0x29ad42[_0x2604('0x1e')]=qs[_0x2604('0x1e')](_0x59a9ad[_0x2604('0x30')][_0x2604('0x1e')]);}_0x29ad42[_0x2604('0x3a')]=qs['sort'](_0x59a9ad[_0x2604('0x30')][_0x2604('0x3b')]);_0x29ad42[_0x2604('0x3c')]=qs[_0x2604('0x32')](_[_0x2604('0x3d')](_0x59a9ad[_0x2604('0x30')],_0x498872[_0x2604('0x32')]),_0x37823f);if(_0x59a9ad[_0x2604('0x30')][_0x2604('0x3e')]){_0x29ad42['where']=_[_0x2604('0x3f')](_0x29ad42[_0x2604('0x3c')],{'$or':_['map'](_0x37823f,function(_0x3e37b2){if(_0x3e37b2[_0x2604('0x40')]!==_0x2604('0x41')){var _0x270f48={};_0x270f48[_0x3e37b2[_0x2604('0x2a')]]={'$like':'%'+_0x59a9ad[_0x2604('0x30')][_0x2604('0x3e')]+'%'};return _0x270f48;}})});}_0x29ad42=_[_0x2604('0x3f')]({},_0x29ad42,_0x59a9ad[_0x2604('0x42')]);var _0x4d3f0e={'where':_0x29ad42['where']};return db[_0x2604('0x2d')][_0x2604('0x21')](_0x4d3f0e)[_0x2604('0x28')](function(_0x4cffb9){_0x4e519c[_0x2604('0x21')]=_0x4cffb9;if(_0x59a9ad['query'][_0x2604('0x43')]){_0x29ad42['include']=[{'all':!![]}];}return db[_0x2604('0x2d')][_0x2604('0x44')](_0x29ad42);})[_0x2604('0x28')](function(_0x52fd8b){_0x4e519c['rows']=_0x52fd8b;return _0x4e519c;})[_0x2604('0x28')](respondWithFilteredResult(_0x5d0e23,_0x29ad42))[_0x2604('0x45')](handleError(_0x5d0e23,null));};exports[_0x2604('0x46')]=function(_0x2623c3,_0x24d35d){var _0x9c4c97={'raw':![],'where':{'id':_0x2623c3[_0x2604('0x47')]['id']}},_0x5ba2d3={};_0x5ba2d3[_0x2604('0x34')]=_[_0x2604('0x31')](db[_0x2604('0x2d')]['rawAttributes']);_0x5ba2d3[_0x2604('0x30')]=_[_0x2604('0x31')](_0x2623c3[_0x2604('0x30')]);_0x5ba2d3['filters']=_[_0x2604('0x33')](_0x5ba2d3['model'],_0x5ba2d3[_0x2604('0x30')]);_0x9c4c97[_0x2604('0x35')]=_[_0x2604('0x33')](_0x5ba2d3[_0x2604('0x34')],qs[_0x2604('0x36')](_0x2623c3[_0x2604('0x30')][_0x2604('0x36')]));_0x9c4c97[_0x2604('0x35')]=_0x9c4c97[_0x2604('0x35')][_0x2604('0x37')]?_0x9c4c97['attributes']:_0x5ba2d3['model'];if(_0x2623c3[_0x2604('0x30')][_0x2604('0x43')]){_0x9c4c97[_0x2604('0x48')]=[{'all':!![]}];}_0x9c4c97=_[_0x2604('0x3f')]({},_0x9c4c97,_0x2623c3[_0x2604('0x42')]);return db[_0x2604('0x2d')]['find'](_0x9c4c97)['then'](handleEntityNotFound(_0x24d35d,null))[_0x2604('0x28')](respondWithResult(_0x24d35d,null))['catch'](handleError(_0x24d35d,null));};exports[_0x2604('0x49')]=function(_0x21f0e7,_0x5b99f4){return db[_0x2604('0x2d')][_0x2604('0x49')](_0x21f0e7[_0x2604('0x4a')],{})['then'](respondWithResult(_0x5b99f4,0xc9))[_0x2604('0x45')](handleError(_0x5b99f4,null));};exports[_0x2604('0x26')]=function(_0x433871,_0x2c0c95){if(_0x433871[_0x2604('0x4a')]['id']){delete _0x433871[_0x2604('0x4a')]['id'];}return db['SalesforceAccount'][_0x2604('0x4b')]({'where':{'id':_0x433871[_0x2604('0x47')]['id']}})[_0x2604('0x28')](handleEntityNotFound(_0x2c0c95,null))[_0x2604('0x28')](saveUpdates(_0x433871[_0x2604('0x4a')],null))[_0x2604('0x28')](respondWithResult(_0x2c0c95,null))[_0x2604('0x45')](handleError(_0x2c0c95,null));};exports[_0x2604('0x27')]=function(_0x3ff685,_0x56efe7){return db[_0x2604('0x2d')][_0x2604('0x4b')]({'where':{'id':_0x3ff685[_0x2604('0x47')]['id']}})['then'](handleEntityNotFound(_0x56efe7,null))['then'](removeEntity(_0x56efe7,null))[_0x2604('0x45')](handleError(_0x56efe7,null));};exports[_0x2604('0x4c')]=function(_0x19199b,_0x58800f,_0xb9af61){var _0x4b083d={};var _0x4f6ff9={};var _0x308998;var _0x48c471;return db['SalesforceAccount'][_0x2604('0x4d')]({'where':{'id':_0x19199b[_0x2604('0x47')]['id']}})[_0x2604('0x28')](handleEntityNotFound(_0x58800f,null))['then'](function(_0x20d178){if(_0x20d178){_0x308998=_0x20d178;_0x4f6ff9[_0x2604('0x34')]=_[_0x2604('0x31')](db[_0x2604('0x4e')][_0x2604('0x2e')]);_0x4f6ff9['query']=_[_0x2604('0x31')](_0x19199b[_0x2604('0x30')]);_0x4f6ff9['filters']=_[_0x2604('0x33')](_0x4f6ff9[_0x2604('0x34')],_0x4f6ff9[_0x2604('0x30')]);_0x4b083d[_0x2604('0x35')]=_[_0x2604('0x33')](_0x4f6ff9[_0x2604('0x34')],qs[_0x2604('0x36')](_0x19199b[_0x2604('0x30')][_0x2604('0x36')]));_0x4b083d[_0x2604('0x35')]=_0x4b083d['attributes'][_0x2604('0x37')]?_0x4b083d[_0x2604('0x35')]:_0x4f6ff9[_0x2604('0x34')];_0x4b083d[_0x2604('0x3a')]=qs['sort'](_0x19199b[_0x2604('0x30')][_0x2604('0x3b')]);_0x4b083d[_0x2604('0x3c')]=qs[_0x2604('0x32')](_[_0x2604('0x3d')](_0x19199b[_0x2604('0x30')],_0x4f6ff9[_0x2604('0x32')]));if(_0x19199b[_0x2604('0x30')][_0x2604('0x3e')]){_0x4b083d[_0x2604('0x3c')]=_[_0x2604('0x3f')](_0x4b083d['where'],{'$or':_[_0x2604('0x2c')](_0x4b083d[_0x2604('0x35')],function(_0x2a59fc){var _0x4cec32={};_0x4cec32[_0x2a59fc]={'$like':'%'+_0x19199b[_0x2604('0x30')][_0x2604('0x3e')]+'%'};return _0x4cec32;})});}_0x4b083d=_['merge']({},_0x4b083d,_0x19199b[_0x2604('0x42')]);return _0x308998['getConfigurations'](_0x4b083d);}})['then'](function(_0x53db27){if(_0x53db27){_0x48c471=_0x53db27['length'];if(!_0x19199b[_0x2604('0x30')]['hasOwnProperty'](_0x2604('0x39'))){_0x4b083d['limit']=qs[_0x2604('0x20')](_0x19199b[_0x2604('0x30')]['limit']);_0x4b083d[_0x2604('0x1e')]=qs[_0x2604('0x1e')](_0x19199b['query'][_0x2604('0x1e')]);}return _0x308998[_0x2604('0x4c')](_0x4b083d);}})[_0x2604('0x28')](function(_0x40bfad){if(_0x40bfad){return _0x40bfad?{'count':_0x48c471,'rows':_0x40bfad}:null;}})[_0x2604('0x28')](respondWithResult(_0x58800f,null))[_0x2604('0x45')](handleError(_0x58800f,null));};exports['addConfiguration']=function(_0x5e469e,_0x2b6365,_0x58fe3d){if(_0x5e469e[_0x2604('0x4a')]['id']){delete _0x5e469e[_0x2604('0x4a')]['id'];}return db[_0x2604('0x2d')][_0x2604('0x4d')]({'where':{'id':_0x5e469e[_0x2604('0x47')]['id']}})[_0x2604('0x28')](handleEntityNotFound(_0x2b6365,null))['then'](function(_0x16f1e4){if(_0x16f1e4){_0x5e469e[_0x2604('0x4a')][_0x2604('0x4f')]=_0x16f1e4['id'];_0x5e469e[_0x2604('0x4a')]['Subjects']=integrations[_0x2604('0x50')](_0x5e469e[_0x2604('0x4a')]['channel'],_0x5e469e[_0x2604('0x4a')][_0x2604('0x40')]);_0x5e469e['body'][_0x2604('0x51')]=integrations['getDescriptions'](_0x5e469e['body'][_0x2604('0x52')],_0x5e469e[_0x2604('0x4a')]['type']);return db[_0x2604('0x4e')][_0x2604('0x49')](_0x5e469e[_0x2604('0x4a')],{'include':[{'model':db[_0x2604('0x53')],'as':_0x2604('0x54')},{'model':db[_0x2604('0x53')],'as':_0x2604('0x51')}]});}return null;})['then'](respondWithResult(_0x2b6365,null))[_0x2604('0x45')](handleError(_0x2b6365,null));};exports[_0x2604('0x55')]=function(_0x4912bd,_0x3b37c2,_0x2995fa){var _0x3e0748;var _0x514d22='';var _0x5e5927='Task';return db['SalesforceAccount'][_0x2604('0x4d')]({'where':{'id':_0x4912bd['params']['id']},'attributes':['id',_0x2604('0x56'),'clientId',_0x2604('0x57'),_0x2604('0x58'),_0x2604('0x59'),'securityToken']})[_0x2604('0x28')](handleEntityNotFound(_0x3b37c2,null))[_0x2604('0x28')](function(_0x3f1869){if(_0x3f1869){_0x514d22=_0x3f1869[_0x2604('0x56')];var _0x14f6b1=_0x514d22[_0x2604('0x5a')](-0x1);if(_0x14f6b1==='/'){_0x514d22=_0x514d22[_0x2604('0x5b')](0x0,_0x514d22[_0x2604('0x5c')](_0x14f6b1));}_0x3e0748=new jsforce[(_0x2604('0x5d'))]({'oauth2':{'loginUrl':_0x514d22,'clientId':_0x3f1869['clientId'],'clientSecret':_0x3f1869[_0x2604('0x57')]}});return _0x3e0748['login'](_0x3f1869[_0x2604('0x58')],_0x3f1869[_0x2604('0x59')][_0x2604('0x5e')](_0x3f1869['securityToken']));}})[_0x2604('0x28')](function(_0x167dfd){if(_0x167dfd){if(!_[_0x2604('0x5f')](_0x4912bd[_0x2604('0x30')][_0x2604('0x60')])){_0x5e5927=_0x4912bd['query'][_0x2604('0x60')];}return _0x3e0748[_0x2604('0x61')](_0x5e5927)[_0x2604('0x62')]();}})[_0x2604('0x28')](function(_0x474cd2){var _0xd2624d=[_0x2604('0x63'),_0x2604('0x64'),_0x2604('0x65'),_0x2604('0x66'),_0x2604('0x67'),_0x2604('0x68')];var _0x218853=['string',_0x2604('0x69'),_0x2604('0x6a'),_0x2604('0x6b'),_0x2604('0x6c'),_0x2604('0x6d'),_0x2604('0x6e')];if(_0x474cd2){_[_0x2604('0x6f')](_0x474cd2[_0x2604('0x36')],function(_0x2c8b15){return _0xd2624d[_0x2604('0x70')](_0x2c8b15[_0x2604('0x2a')])||!_0x218853[_0x2604('0x70')](_0x2c8b15[_0x2604('0x40')]);});return{'count':_0x474cd2[_0x2604('0x36')][_0x2604('0x37')],'rows':_[_0x2604('0x2c')](_0x474cd2[_0x2604('0x36')],function(_0x19f2e5){return{'id':_0x19f2e5[_0x2604('0x2a')],'name':_0x19f2e5[_0x2604('0x71')],'custom':_0x19f2e5[_0x2604('0x72')],'options':_0x19f2e5['picklistValues'][_0x2604('0x37')]>0x0?_['map'](_0x19f2e5[_0x2604('0x73')],function(_0x2067b0){return{'name':_0x2067b0[_0x2604('0x71')],'value':_0x2067b0[_0x2604('0x74')]};}):_0x19f2e5['type']=='boolean'?[{'name':_0x2604('0x75'),'value':_0x2604('0x76')},{'name':'False','value':_0x2604('0x77')}]:[]};})};}})[_0x2604('0x28')](respondWithResult(_0x3b37c2,null))['catch'](function(_0xdf0c63){var _0xbb74cc=_0x4912bd[_0x2604('0x30')]['test']?0x1f4:_0xdf0c63[_0x2604('0x78')]||0x1f4;logger['error'](_0x2604('0x79'),_0x2604('0x55'),_0xbb74cc,JSON['stringify'](_0xdf0c63));delete _0xdf0c63[_0x2604('0x2a')];if(_0xbb74cc===0x191){_0xbb74cc=0x190;}_0x3b37c2[_0x2604('0x1b')](_0xbb74cc)[_0x2604('0x2b')](_0x4912bd['query'][_0x2604('0x7a')]?{'message':_0x2604('0x7b'),'statusCode':_0xdf0c63[_0x2604('0x78')]}:_0xdf0c63);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 40a88bb..bddb98c 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 _0x5e49=['path','rimraf','./intSalesforceAccount.attributes','define','SalesforceAccount','lodash','util','../../config/logger','bluebird'];(function(_0x109638,_0x3e2ddf){var _0x2af141=function(_0xc47504){while(--_0xc47504){_0x109638['push'](_0x109638['shift']());}};_0x2af141(++_0x3e2ddf);}(_0x5e49,0x152));var _0x95e4=function(_0x3dc190,_0xa6c975){_0x3dc190=_0x3dc190-0x0;var _0x5bde76=_0x5e49[_0x3dc190];return _0x5bde76;};'use strict';var _=require(_0x95e4('0x0'));var util=require(_0x95e4('0x1'));var logger=require(_0x95e4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x95e4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95e4('0x4'));var rimraf=require(_0x95e4('0x5'));var config=require('../../config/environment');var attributes=require(_0x95e4('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x515e57,_0x1c5ba0){return _0x515e57[_0x95e4('0x7')](_0x95e4('0x8'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc65=['rimraf','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1cd745,_0x1ba570){var _0x50d356=function(_0x25c166){while(--_0x25c166){_0x1cd745['push'](_0x1cd745['shift']());}};_0x50d356(++_0x1ba570);}(_0xfc65,0x1b4));var _0x5fc6=function(_0x11c89a,_0x306026){_0x11c89a=_0x11c89a-0x0;var _0x563c7a=_0xfc65[_0x11c89a];return _0x563c7a;};'use strict';var _=require(_0x5fc6('0x0'));var util=require(_0x5fc6('0x1'));var logger=require(_0x5fc6('0x2'))(_0x5fc6('0x3'));var moment=require(_0x5fc6('0x4'));var BPromise=require(_0x5fc6('0x5'));var rp=require(_0x5fc6('0x6'));var fs=require('fs');var path=require(_0x5fc6('0x7'));var rimraf=require(_0x5fc6('0x8'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x5fc6('0x9'));module[_0x5fc6('0xa')]=function(_0x3e9bf3,_0x26d89e){return _0x3e9bf3[_0x5fc6('0xb')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 02c1619..589a438 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 _0x860c=['catch','SalesforceAccount','find','where','ShowSalesforceAccount','lodash','moment','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetSalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','debug'];(function(_0x493e2c,_0x4ba39c){var _0x5ec0d8=function(_0x465107){while(--_0x465107){_0x493e2c['push'](_0x493e2c['shift']());}};_0x5ec0d8(++_0x4ba39c);}(_0x860c,0x14f));var _0xc860=function(_0x344fc3,_0x2612ed){_0x344fc3=_0x344fc3-0x0;var _0x1c8a58=_0x860c[_0x344fc3];return _0x1c8a58;};'use strict';var _=require(_0xc860('0x0'));var util=require('util');var moment=require(_0xc860('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc860('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc860('0x3'));var logger=require('../../config/logger')(_0xc860('0x4'));var config=require('../../config/environment');var jayson=require(_0xc860('0x5'));var client=jayson[_0xc860('0x6')][_0xc860('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfc9741,_0x3557e1,_0x266441){return new BPromise(function(_0x38f86c,_0x106dda){return client[_0xc860('0x8')](_0xfc9741,_0x266441)[_0xc860('0x9')](function(_0x344047){logger[_0xc860('0xa')](_0xc860('0xb'),_0x3557e1,'request\x20sent');logger['debug'](_0xc860('0xc'),_0x3557e1,_0xc860('0xd'),JSON[_0xc860('0xe')](_0x344047));if(_0x344047[_0xc860('0xf')]){if(_0x344047[_0xc860('0xf')][_0xc860('0x10')]===0x1f4){logger[_0xc860('0xf')](_0xc860('0xb'),_0x3557e1,_0x344047['error'][_0xc860('0x11')]);return _0x106dda(_0x344047[_0xc860('0xf')][_0xc860('0x11')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x3557e1,_0x344047['error'][_0xc860('0x11')]);return _0x38f86c(_0x344047[_0xc860('0xf')][_0xc860('0x11')]);}else{logger[_0xc860('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x3557e1,'request\x20sent');_0x38f86c(_0x344047['result'][_0xc860('0x11')]);}})['catch'](function(_0x4069c7){logger[_0xc860('0xf')](_0xc860('0xb'),_0x3557e1,_0x4069c7);_0x106dda(_0x4069c7);});});}exports[_0xc860('0x12')]=function(_0x19f244){var _0x4c06a8=this;return new Promise(function(_0x2241dc,_0x28a99c){return db['SalesforceAccount'][_0xc860('0x13')]({'raw':_0x19f244[_0xc860('0x14')]?_0x19f244[_0xc860('0x14')][_0xc860('0x15')]===undefined?!![]:![]:!![],'where':_0x19f244['options']?_0x19f244[_0xc860('0x14')]['where']||null:null,'attributes':_0x19f244[_0xc860('0x14')]?_0x19f244[_0xc860('0x14')][_0xc860('0x16')]||null:null,'limit':_0x19f244[_0xc860('0x14')]?_0x19f244[_0xc860('0x14')][_0xc860('0x17')]||null:null,'include':_0x19f244['options']?_0x19f244[_0xc860('0x14')][_0xc860('0x18')]?_[_0xc860('0x19')](_0x19f244['options'][_0xc860('0x18')],function(_0x4688cd){return{'model':db[_0x4688cd['model']],'as':_0x4688cd['as'],'attributes':_0x4688cd[_0xc860('0x16')],'include':_0x4688cd[_0xc860('0x18')]?_[_0xc860('0x19')](_0x4688cd[_0xc860('0x18')],function(_0x424a55){return{'model':db[_0x424a55[_0xc860('0x1a')]],'as':_0x424a55['as'],'attributes':_0x424a55['attributes'],'include':_0x424a55['include']?_[_0xc860('0x19')](_0x424a55[_0xc860('0x18')],function(_0x47a39e){return{'model':db[_0x47a39e[_0xc860('0x1a')]],'as':_0x47a39e['as'],'attributes':_0x47a39e[_0xc860('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc860('0x9')](function(_0x16e404){logger['info'](_0xc860('0x12'),_0x19f244);logger[_0xc860('0x1b')](_0xc860('0x12'),_0x19f244,JSON[_0xc860('0xe')](_0x16e404));_0x2241dc(_0x16e404);})[_0xc860('0x1c')](function(_0x439d21){logger[_0xc860('0xf')](_0xc860('0x12'),_0x439d21[_0xc860('0x11')],_0x19f244);_0x28a99c(_0x4c06a8['error'](0x1f4,_0x439d21['message']));});});};exports['ShowSalesforceAccount']=function(_0x530ad4){var _0x1f28c2=this;return new Promise(function(_0x41b095,_0x63b583){return db[_0xc860('0x1d')][_0xc860('0x1e')]({'raw':_0x530ad4[_0xc860('0x14')]?_0x530ad4[_0xc860('0x14')][_0xc860('0x15')]===undefined?!![]:![]:!![],'where':_0x530ad4[_0xc860('0x14')]?_0x530ad4[_0xc860('0x14')][_0xc860('0x1f')]||null:null,'attributes':_0x530ad4[_0xc860('0x14')]?_0x530ad4[_0xc860('0x14')][_0xc860('0x16')]||null:null,'include':_0x530ad4[_0xc860('0x14')]?_0x530ad4[_0xc860('0x14')]['include']?_[_0xc860('0x19')](_0x530ad4[_0xc860('0x14')][_0xc860('0x18')],function(_0x1146d6){return{'model':db[_0x1146d6[_0xc860('0x1a')]],'as':_0x1146d6['as'],'attributes':_0x1146d6[_0xc860('0x16')],'include':_0x1146d6[_0xc860('0x18')]?_['map'](_0x1146d6[_0xc860('0x18')],function(_0x17d57e){return{'model':db[_0x17d57e[_0xc860('0x1a')]],'as':_0x17d57e['as'],'attributes':_0x17d57e[_0xc860('0x16')],'include':_0x17d57e[_0xc860('0x18')]?_[_0xc860('0x19')](_0x17d57e[_0xc860('0x18')],function(_0x58f6e0){return{'model':db[_0x58f6e0[_0xc860('0x1a')]],'as':_0x58f6e0['as'],'attributes':_0x58f6e0['attributes']};}):[]};}):[]};}):[]:[]})[_0xc860('0x9')](function(_0xf90fde){logger[_0xc860('0xa')](_0xc860('0x20'),_0x530ad4);logger[_0xc860('0x1b')]('ShowSalesforceAccount',_0x530ad4,JSON[_0xc860('0xe')](_0xf90fde));_0x41b095(_0xf90fde);})[_0xc860('0x1c')](function(_0x47fe21){logger[_0xc860('0xf')](_0xc860('0x20'),_0x47fe21['message'],_0x530ad4);_0x63b583(_0x1f28c2[_0xc860('0xf')](0x1f4,_0x47fe21['message']));});});}; \ No newline at end of file +var _0xae7f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','include','model','map','stringify','ShowSalesforceAccount','find','debug','lodash'];(function(_0x25070c,_0x43bb62){var _0x36c950=function(_0x9e8e94){while(--_0x9e8e94){_0x25070c['push'](_0x25070c['shift']());}};_0x36c950(++_0x43bb62);}(_0xae7f,0x185));var _0xfae7=function(_0x34a370,_0x48f0f7){_0x34a370=_0x34a370-0x0;var _0xa1905f=_0xae7f[_0x34a370];return _0xa1905f;};'use strict';var _=require(_0xfae7('0x0'));var util=require(_0xfae7('0x1'));var moment=require(_0xfae7('0x2'));var BPromise=require(_0xfae7('0x3'));var rs=require(_0xfae7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfae7('0x5'))['db'];var utils=require(_0xfae7('0x6'));var logger=require('../../config/logger')(_0xfae7('0x7'));var config=require(_0xfae7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfae7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547142,_0xdbfdb4,_0x5b41c5){return new BPromise(function(_0x43ff24,_0x2acb8f){return client['request'](_0x547142,_0x5b41c5)[_0xfae7('0xa')](function(_0x5be02d){logger[_0xfae7('0xb')](_0xfae7('0xc'),_0xdbfdb4,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0xdbfdb4,_0xfae7('0xd'),JSON['stringify'](_0x5be02d));if(_0x5be02d[_0xfae7('0xe')]){if(_0x5be02d[_0xfae7('0xe')]['code']===0x1f4){logger[_0xfae7('0xe')](_0xfae7('0xc'),_0xdbfdb4,_0x5be02d[_0xfae7('0xe')][_0xfae7('0xf')]);return _0x2acb8f(_0x5be02d['error'][_0xfae7('0xf')]);}logger[_0xfae7('0xe')](_0xfae7('0xc'),_0xdbfdb4,_0x5be02d[_0xfae7('0xe')][_0xfae7('0xf')]);return _0x43ff24(_0x5be02d[_0xfae7('0xe')][_0xfae7('0xf')]);}else{logger[_0xfae7('0xb')](_0xfae7('0xc'),_0xdbfdb4,_0xfae7('0xd'));_0x43ff24(_0x5be02d[_0xfae7('0x10')]['message']);}})[_0xfae7('0x11')](function(_0x3a5763){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0xdbfdb4,_0x3a5763);_0x2acb8f(_0x3a5763);});});}exports[_0xfae7('0x12')]=function(_0x57a136){var _0xc33a26=this;return new Promise(function(_0x413948,_0x385076){return db[_0xfae7('0x13')][_0xfae7('0x14')]({'raw':_0x57a136['options']?_0x57a136[_0xfae7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x57a136['options']?_0x57a136[_0xfae7('0x15')]['where']||null:null,'attributes':_0x57a136[_0xfae7('0x15')]?_0x57a136['options'][_0xfae7('0x16')]||null:null,'limit':_0x57a136['options']?_0x57a136[_0xfae7('0x15')]['limit']||null:null,'include':_0x57a136['options']?_0x57a136[_0xfae7('0x15')]['include']?_['map'](_0x57a136[_0xfae7('0x15')][_0xfae7('0x17')],function(_0x23d228){return{'model':db[_0x23d228[_0xfae7('0x18')]],'as':_0x23d228['as'],'attributes':_0x23d228[_0xfae7('0x16')],'include':_0x23d228[_0xfae7('0x17')]?_[_0xfae7('0x19')](_0x23d228[_0xfae7('0x17')],function(_0x18f1d6){return{'model':db[_0x18f1d6[_0xfae7('0x18')]],'as':_0x18f1d6['as'],'attributes':_0x18f1d6[_0xfae7('0x16')],'include':_0x18f1d6[_0xfae7('0x17')]?_[_0xfae7('0x19')](_0x18f1d6[_0xfae7('0x17')],function(_0x3ee0fe){return{'model':db[_0x3ee0fe[_0xfae7('0x18')]],'as':_0x3ee0fe['as'],'attributes':_0x3ee0fe['attributes']};}):[]};}):[]};}):[]:[]})[_0xfae7('0xa')](function(_0x12874b){logger[_0xfae7('0xb')]('GetSalesforceAccount',_0x57a136);logger['debug']('GetSalesforceAccount',_0x57a136,JSON[_0xfae7('0x1a')](_0x12874b));_0x413948(_0x12874b);})[_0xfae7('0x11')](function(_0x221d06){logger[_0xfae7('0xe')](_0xfae7('0x12'),_0x221d06[_0xfae7('0xf')],_0x57a136);_0x385076(_0xc33a26[_0xfae7('0xe')](0x1f4,_0x221d06['message']));});});};exports[_0xfae7('0x1b')]=function(_0xd79a44){var _0x35817a=this;return new Promise(function(_0x2a70b7,_0x285aa9){return db[_0xfae7('0x13')][_0xfae7('0x1c')]({'raw':_0xd79a44['options']?_0xd79a44['options']['raw']===undefined?!![]:![]:!![],'where':_0xd79a44[_0xfae7('0x15')]?_0xd79a44[_0xfae7('0x15')]['where']||null:null,'attributes':_0xd79a44[_0xfae7('0x15')]?_0xd79a44[_0xfae7('0x15')][_0xfae7('0x16')]||null:null,'include':_0xd79a44[_0xfae7('0x15')]?_0xd79a44[_0xfae7('0x15')][_0xfae7('0x17')]?_[_0xfae7('0x19')](_0xd79a44[_0xfae7('0x15')][_0xfae7('0x17')],function(_0x39c7bc){return{'model':db[_0x39c7bc['model']],'as':_0x39c7bc['as'],'attributes':_0x39c7bc[_0xfae7('0x16')],'include':_0x39c7bc[_0xfae7('0x17')]?_[_0xfae7('0x19')](_0x39c7bc[_0xfae7('0x17')],function(_0x5d52dd){return{'model':db[_0x5d52dd['model']],'as':_0x5d52dd['as'],'attributes':_0x5d52dd[_0xfae7('0x16')],'include':_0x5d52dd['include']?_[_0xfae7('0x19')](_0x5d52dd['include'],function(_0x2551f8){return{'model':db[_0x2551f8[_0xfae7('0x18')]],'as':_0x2551f8['as'],'attributes':_0x2551f8[_0xfae7('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b74b9){logger[_0xfae7('0xb')](_0xfae7('0x1b'),_0xd79a44);logger[_0xfae7('0x1d')](_0xfae7('0x1b'),_0xd79a44,JSON['stringify'](_0x1b74b9));_0x2a70b7(_0x1b74b9);})[_0xfae7('0x11')](function(_0x3af2cd){logger['error'](_0xfae7('0x1b'),_0x3af2cd[_0xfae7('0xf')],_0xd79a44);_0x285aa9(_0x35817a[_0xfae7('0xe')](0x1f4,_0x3af2cd[_0xfae7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 30a24f4..63862b2 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x0b0e,0x187));var _0xe0b0=function(_0x25f805,_0x59caf3){_0x25f805=_0x25f805-0x0;var _0xf6628f=_0x0b0e[_0x25f805];return _0xf6628f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x5255ef,_0x5da288){var _0x4e457b=function(_0x5be6bf){while(--_0x5be6bf){_0x5255ef['push'](_0x5255ef['shift']());}};_0x4e457b(++_0x5da288);}(_0x7a54,0x106));var _0x47a5=function(_0xee1bd6,_0x15b004){_0xee1bd6=_0xee1bd6-0x0;var _0x414997=_0x7a54[_0xee1bd6];return _0x414997;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 30d9533..aababd1 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 _0xe90f=['lead','account_contact_lead','nothing','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x1230ea,_0x499a33){var _0xe946e2=function(_0x29a4e9){while(--_0x29a4e9){_0x1230ea['push'](_0x1230ea['shift']());}};_0xe946e2(++_0x499a33);}(_0xe90f,0xc9));var _0xfe90=function(_0x27c021,_0x190f72){_0x27c021=_0x27c021-0x0;var _0x1d0700=_0xe90f[_0x27c021];return _0x1d0700;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfe90('0x0')]},'description':{'type':Sequelize[_0xfe90('0x0')]},'ticketType':{'type':Sequelize[_0xfe90('0x1')](_0xfe90('0x2'),_0xfe90('0x3')),'defaultValue':_0xfe90('0x2')},'moduleSearch':{'type':Sequelize[_0xfe90('0x1')](_0xfe90('0x4'),_0xfe90('0x5'),_0xfe90('0x6'),_0xfe90('0x7'),'account'),'defaultValue':_0xfe90('0x4')},'moduleCreate':{'type':Sequelize[_0xfe90('0x1')](_0xfe90('0x8'),'contact','lead','account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xfe90('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0xfe90('0x0')]},'additionalSearchContact':{'type':Sequelize[_0xfe90('0x0')]},'additionalSearchLead':{'type':Sequelize[_0xfe90('0x0')]}}; \ No newline at end of file +var _0xd601=['ENUM','contact','account_contact_lead','account','contact_lead','nothing','lead','sequelize','exports','STRING','Task','Case'];(function(_0x108ebc,_0x3e1ddb){var _0x2b3bae=function(_0x3b27bd){while(--_0x3b27bd){_0x108ebc['push'](_0x108ebc['shift']());}};_0x2b3bae(++_0x3e1ddb);}(_0xd601,0x1db));var _0x1d60=function(_0x1d6d73,_0xecd542){_0x1d6d73=_0x1d6d73-0x0;var _0x11445a=_0xd601[_0x1d6d73];return _0x11445a;};'use strict';var Sequelize=require(_0x1d60('0x0'));module[_0x1d60('0x1')]={'name':{'type':Sequelize[_0x1d60('0x2')]},'description':{'type':Sequelize[_0x1d60('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x1d60('0x3'),_0x1d60('0x4')),'defaultValue':_0x1d60('0x3')},'moduleSearch':{'type':Sequelize[_0x1d60('0x5')]('contact_lead',_0x1d60('0x6'),'lead',_0x1d60('0x7'),_0x1d60('0x8')),'defaultValue':_0x1d60('0x9')},'moduleCreate':{'type':Sequelize[_0x1d60('0x5')](_0x1d60('0xa'),_0x1d60('0x6'),_0x1d60('0xb'),_0x1d60('0x8')),'defaultValue':_0x1d60('0xb')},'leadId':{'type':Sequelize[_0x1d60('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x1d60('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x1d60('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index a2bc245..dea6001 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 _0x2cca=['getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','merge','where','VIRTUAL','options','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getFields','findOne','length','pick','hasOwnProperty','SalesforceField'];(function(_0x577421,_0x560726){var _0x4daac7=function(_0xcd00aa){while(--_0xcd00aa){_0x577421['push'](_0x577421['shift']());}};_0x4daac7(++_0x560726);}(_0x2cca,0xa4));var _0xa2cc=function(_0x2a0e75,_0x313149){_0x2a0e75=_0x2a0e75-0x0;var _0x396e82=_0x2cca[_0x2a0e75];return _0x396e82;};'use strict';var emlformat=require(_0xa2cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa2cc('0x1'));var jsonpatch=require(_0xa2cc('0x2'));var rp=require(_0xa2cc('0x3'));var moment=require(_0xa2cc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa2cc('0x5'));var path=require(_0xa2cc('0x6'));var sox=require(_0xa2cc('0x7'));var csv=require(_0xa2cc('0x8'));var ejs=require(_0xa2cc('0x9'));var fs=require('fs');var fs_extra=require(_0xa2cc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa2cc('0xb'));var deskjs=require(_0xa2cc('0xc'));var toCsv=require(_0xa2cc('0x8'));var querystring=require(_0xa2cc('0xd'));var Papa=require(_0xa2cc('0xe'));var Redis=require(_0xa2cc('0xf'));var authService=require(_0xa2cc('0x10'));var qs=require(_0xa2cc('0x11'));var as=require(_0xa2cc('0x12'));var hardwareService=require(_0xa2cc('0x13'));var logger=require('../../config/logger')(_0xa2cc('0x14'));var utils=require('../../config/utils');var config=require(_0xa2cc('0x15'));var licenseUtil=require(_0xa2cc('0x16'));var db=require(_0xa2cc('0x17'))['db'];function respondWithStatusCode(_0x51e82a,_0x2301c5){_0x2301c5=_0x2301c5||0xcc;return function(_0x4615bb){if(_0x4615bb){return _0x51e82a['sendStatus'](_0x2301c5);}return _0x51e82a[_0xa2cc('0x18')](_0x2301c5)[_0xa2cc('0x19')]();};}function respondWithResult(_0x4765c7,_0x10cfd0){_0x10cfd0=_0x10cfd0||0xc8;return function(_0xe8bd31){if(_0xe8bd31){return _0x4765c7[_0xa2cc('0x18')](_0x10cfd0)[_0xa2cc('0x1a')](_0xe8bd31);}};}function respondWithFilteredResult(_0x4418cf,_0x21f5f7){return function(_0x9d9847){if(_0x9d9847){var _0x299c3e=typeof _0x21f5f7[_0xa2cc('0x1b')]==='undefined'&&typeof _0x21f5f7[_0xa2cc('0x1c')]==='undefined';var _0x392a89=_0x9d9847[_0xa2cc('0x1d')];var _0x11a3ae=_0x299c3e?0x0:_0x21f5f7['offset'];var _0x2610b0=_0x299c3e?_0x9d9847[_0xa2cc('0x1d')]:_0x21f5f7[_0xa2cc('0x1b')]+_0x21f5f7[_0xa2cc('0x1c')];var _0x1fb9ac;if(_0x2610b0>=_0x392a89){_0x2610b0=_0x392a89;_0x1fb9ac=0xc8;}else{_0x1fb9ac=0xce;}_0x4418cf[_0xa2cc('0x18')](_0x1fb9ac);return _0x4418cf[_0xa2cc('0x1e')](_0xa2cc('0x1f'),_0x11a3ae+'-'+_0x2610b0+'/'+_0x392a89)['json'](_0x9d9847);}return null;};}function patchUpdates(_0xd46c38){return function(_0x283736){try{jsonpatch[_0xa2cc('0x20')](_0x283736,_0xd46c38,!![]);}catch(_0x274124){return BPromise[_0xa2cc('0x21')](_0x274124);}return _0x283736[_0xa2cc('0x22')]();};}function saveUpdates(_0x3407d4,_0x58b197){return function(_0x2a16ab){if(_0x2a16ab){return _0x2a16ab['update'](_0x3407d4)[_0xa2cc('0x23')](function(_0x278de9){return _0x278de9;});}return null;};}function removeEntity(_0x561f32,_0xf8c404){return function(_0x1afb8f){if(_0x1afb8f){return _0x1afb8f[_0xa2cc('0x24')]()[_0xa2cc('0x23')](function(){_0x561f32[_0xa2cc('0x18')](0xcc)[_0xa2cc('0x19')]();});}};}function handleEntityNotFound(_0x394ea8,_0x4def0f){return function(_0x4c6592){if(!_0x4c6592){_0x394ea8[_0xa2cc('0x25')](0x194);}return _0x4c6592;};}function handleError(_0x3b2123,_0x3a478b){_0x3a478b=_0x3a478b||0x1f4;return function(_0x1b8309){logger[_0xa2cc('0x26')](_0x1b8309['stack']);if(_0x1b8309['name']){delete _0x1b8309['name'];}_0x3b2123['status'](_0x3a478b)[_0xa2cc('0x27')](_0x1b8309);};}exports[_0xa2cc('0x28')]=function(_0x5a6b3c,_0x1d8217){var _0x2077b4={},_0x234171={},_0x2186d3={'count':0x0,'rows':[]};var _0x5a833c=_[_0xa2cc('0x29')](db['SalesforceConfiguration'][_0xa2cc('0x2a')],function(_0x3b93e6){return{'name':_0x3b93e6['fieldName'],'type':_0x3b93e6[_0xa2cc('0x2b')][_0xa2cc('0x2c')]};});_0x234171[_0xa2cc('0x2d')]=_['map'](_0x5a833c,_0xa2cc('0x2e'));_0x234171[_0xa2cc('0x2f')]=_[_0xa2cc('0x30')](_0x5a6b3c[_0xa2cc('0x2f')]);_0x234171[_0xa2cc('0x31')]=_[_0xa2cc('0x32')](_0x234171[_0xa2cc('0x2d')],_0x234171[_0xa2cc('0x2f')]);_0x2077b4[_0xa2cc('0x33')]=_[_0xa2cc('0x32')](_0x234171[_0xa2cc('0x2d')],qs[_0xa2cc('0x34')](_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x34')]));_0x2077b4[_0xa2cc('0x33')]=_0x2077b4[_0xa2cc('0x33')]['length']?_0x2077b4['attributes']:_0x234171[_0xa2cc('0x2d')];if(!_0x5a6b3c['query']['hasOwnProperty'](_0xa2cc('0x35'))){_0x2077b4[_0xa2cc('0x1c')]=qs[_0xa2cc('0x1c')](_0x5a6b3c['query']['limit']);_0x2077b4['offset']=qs[_0xa2cc('0x1b')](_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x1b')]);}_0x2077b4[_0xa2cc('0x36')]=qs['sort'](_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x37')]);_0x2077b4['where']=qs[_0xa2cc('0x31')](_['pick'](_0x5a6b3c['query'],_0x234171[_0xa2cc('0x31')]),_0x5a833c);if(_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x38')]){_0x2077b4['where']=_[_0xa2cc('0x39')](_0x2077b4[_0xa2cc('0x3a')],{'$or':_[_0xa2cc('0x29')](_0x5a833c,function(_0x490958){if(_0x490958['type']!==_0xa2cc('0x3b')){var _0x3e0b8b={};_0x3e0b8b[_0x490958['name']]={'$like':'%'+_0x5a6b3c[_0xa2cc('0x2f')]['filter']+'%'};return _0x3e0b8b;}})});}_0x2077b4=_['merge']({},_0x2077b4,_0x5a6b3c[_0xa2cc('0x3c')]);var _0x50a900={'where':_0x2077b4[_0xa2cc('0x3a')]};return db[_0xa2cc('0x3d')][_0xa2cc('0x1d')](_0x50a900)[_0xa2cc('0x23')](function(_0x23d181){_0x2186d3[_0xa2cc('0x1d')]=_0x23d181;if(_0x5a6b3c[_0xa2cc('0x2f')][_0xa2cc('0x3e')]){_0x2077b4[_0xa2cc('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xa2cc('0x40')](_0x2077b4);})[_0xa2cc('0x23')](function(_0x460890){_0x2186d3[_0xa2cc('0x41')]=_0x460890;return _0x2186d3;})[_0xa2cc('0x23')](respondWithFilteredResult(_0x1d8217,_0x2077b4))[_0xa2cc('0x42')](handleError(_0x1d8217,null));};exports[_0xa2cc('0x43')]=function(_0x1b6b22,_0x5b4630){var _0x432db4={'raw':![],'where':{'id':_0x1b6b22[_0xa2cc('0x44')]['id']}},_0xd4710d={};_0xd4710d[_0xa2cc('0x2d')]=_[_0xa2cc('0x30')](db[_0xa2cc('0x3d')][_0xa2cc('0x2a')]);_0xd4710d[_0xa2cc('0x2f')]=_['keys'](_0x1b6b22[_0xa2cc('0x2f')]);_0xd4710d['filters']=_[_0xa2cc('0x32')](_0xd4710d[_0xa2cc('0x2d')],_0xd4710d['query']);_0x432db4[_0xa2cc('0x33')]=_[_0xa2cc('0x32')](_0xd4710d['model'],qs['fields'](_0x1b6b22['query'][_0xa2cc('0x34')]));_0x432db4[_0xa2cc('0x33')]=_0x432db4[_0xa2cc('0x33')]['length']?_0x432db4[_0xa2cc('0x33')]:_0xd4710d[_0xa2cc('0x2d')];if(_0x1b6b22[_0xa2cc('0x2f')][_0xa2cc('0x3e')]){_0x432db4['include']=[{'all':!![]}];}_0x432db4=_['merge']({},_0x432db4,_0x1b6b22['options']);return db[_0xa2cc('0x3d')][_0xa2cc('0x45')](_0x432db4)[_0xa2cc('0x23')](handleEntityNotFound(_0x5b4630,null))[_0xa2cc('0x23')](respondWithResult(_0x5b4630,null))['catch'](handleError(_0x5b4630,null));};exports['create']=function(_0xcaaaaf,_0xf5c13e){return db[_0xa2cc('0x3d')][_0xa2cc('0x46')](_0xcaaaaf[_0xa2cc('0x47')],{})[_0xa2cc('0x23')](respondWithResult(_0xf5c13e,0xc9))[_0xa2cc('0x42')](handleError(_0xf5c13e,null));};exports[_0xa2cc('0x48')]=function(_0xb625,_0x4a6235){if(_0xb625[_0xa2cc('0x47')]['id']){delete _0xb625['body']['id'];}return db[_0xa2cc('0x3d')]['find']({'where':{'id':_0xb625[_0xa2cc('0x44')]['id']}})[_0xa2cc('0x23')](handleEntityNotFound(_0x4a6235,null))['then'](saveUpdates(_0xb625[_0xa2cc('0x47')],null))[_0xa2cc('0x23')](respondWithResult(_0x4a6235,null))[_0xa2cc('0x42')](handleError(_0x4a6235,null));};exports['destroy']=function(_0xb06878,_0x28825a){return db['SalesforceConfiguration']['find']({'where':{'id':_0xb06878['params']['id']}})['then'](handleEntityNotFound(_0x28825a,null))[_0xa2cc('0x23')](removeEntity(_0x28825a,null))['catch'](handleError(_0x28825a,null));};exports[_0xa2cc('0x49')]=function(_0x4463d9,_0x369b44,_0x4842f3){var _0x31e26e={};var _0x4d0088={};var _0x31609c;var _0x1ff94c;return db['SalesforceConfiguration'][_0xa2cc('0x4a')]({'where':{'id':_0x4463d9['params']['id']}})[_0xa2cc('0x23')](handleEntityNotFound(_0x369b44,null))[_0xa2cc('0x23')](function(_0x52fb7f){if(_0x52fb7f){_0x31609c=_0x52fb7f;_0x4d0088[_0xa2cc('0x2d')]=_[_0xa2cc('0x30')](db['SalesforceField'][_0xa2cc('0x2a')]);_0x4d0088[_0xa2cc('0x2f')]=_['keys'](_0x4463d9[_0xa2cc('0x2f')]);_0x4d0088[_0xa2cc('0x31')]=_[_0xa2cc('0x32')](_0x4d0088['model'],_0x4d0088[_0xa2cc('0x2f')]);_0x31e26e['attributes']=_['intersection'](_0x4d0088['model'],qs['fields'](_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x34')]));_0x31e26e[_0xa2cc('0x33')]=_0x31e26e[_0xa2cc('0x33')][_0xa2cc('0x4b')]?_0x31e26e['attributes']:_0x4d0088['model'];_0x31e26e[_0xa2cc('0x36')]=qs[_0xa2cc('0x37')](_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x37')]);_0x31e26e['where']=qs[_0xa2cc('0x31')](_[_0xa2cc('0x4c')](_0x4463d9[_0xa2cc('0x2f')],_0x4d0088[_0xa2cc('0x31')]));if(_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x38')]){_0x31e26e['where']=_['merge'](_0x31e26e[_0xa2cc('0x3a')],{'$or':_['map'](_0x31e26e['attributes'],function(_0x64ebe7){var _0x5ede46={};_0x5ede46[_0x64ebe7]={'$like':'%'+_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x38')]+'%'};return _0x5ede46;})});}_0x31e26e=_['merge']({},_0x31e26e,_0x4463d9[_0xa2cc('0x3c')]);return _0x31609c[_0xa2cc('0x49')](_0x31e26e);}})[_0xa2cc('0x23')](function(_0x56dda9){if(_0x56dda9){_0x1ff94c=_0x56dda9[_0xa2cc('0x4b')];if(!_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x4d')](_0xa2cc('0x35'))){_0x31e26e[_0xa2cc('0x1c')]=qs[_0xa2cc('0x1c')](_0x4463d9[_0xa2cc('0x2f')][_0xa2cc('0x1c')]);_0x31e26e[_0xa2cc('0x1b')]=qs[_0xa2cc('0x1b')](_0x4463d9['query'][_0xa2cc('0x1b')]);}return _0x31609c[_0xa2cc('0x49')](_0x31e26e);}})[_0xa2cc('0x23')](function(_0x285455){if(_0x285455){return _0x285455?{'count':_0x1ff94c,'rows':_0x285455}:null;}})[_0xa2cc('0x23')](respondWithResult(_0x369b44,null))[_0xa2cc('0x42')](handleError(_0x369b44,null));};exports['getSubjects']=function(_0x696e3e,_0x273279,_0x166baa){var _0x1b1b9c={};var _0x41d290={};var _0x28deea;var _0x219708;return db[_0xa2cc('0x3d')]['findOne']({'where':{'id':_0x696e3e[_0xa2cc('0x44')]['id']}})['then'](handleEntityNotFound(_0x273279,null))[_0xa2cc('0x23')](function(_0x38c4b9){if(_0x38c4b9){_0x28deea=_0x38c4b9;_0x41d290['model']=_[_0xa2cc('0x30')](db[_0xa2cc('0x4e')][_0xa2cc('0x2a')]);_0x41d290[_0xa2cc('0x2f')]=_[_0xa2cc('0x30')](_0x696e3e[_0xa2cc('0x2f')]);_0x41d290[_0xa2cc('0x31')]=_['intersection'](_0x41d290[_0xa2cc('0x2d')],_0x41d290['query']);_0x1b1b9c[_0xa2cc('0x33')]=_[_0xa2cc('0x32')](_0x41d290['model'],qs[_0xa2cc('0x34')](_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x34')]));_0x1b1b9c[_0xa2cc('0x33')]=_0x1b1b9c[_0xa2cc('0x33')]['length']?_0x1b1b9c[_0xa2cc('0x33')]:_0x41d290[_0xa2cc('0x2d')];_0x1b1b9c[_0xa2cc('0x36')]=qs[_0xa2cc('0x37')](_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x37')]);_0x1b1b9c[_0xa2cc('0x3a')]=qs[_0xa2cc('0x31')](_['pick'](_0x696e3e[_0xa2cc('0x2f')],_0x41d290['filters']));if(_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x38')]){_0x1b1b9c[_0xa2cc('0x3a')]=_[_0xa2cc('0x39')](_0x1b1b9c[_0xa2cc('0x3a')],{'$or':_[_0xa2cc('0x29')](_0x1b1b9c[_0xa2cc('0x33')],function(_0x1d5b7b){var _0x27bc44={};_0x27bc44[_0x1d5b7b]={'$like':'%'+_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x38')]+'%'};return _0x27bc44;})});}_0x1b1b9c=_[_0xa2cc('0x39')]({},_0x1b1b9c,_0x696e3e[_0xa2cc('0x3c')]);return _0x28deea['getSubjects'](_0x1b1b9c);}})[_0xa2cc('0x23')](function(_0x3dc6b6){if(_0x3dc6b6){_0x219708=_0x3dc6b6['length'];if(!_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x4d')]('nolimit')){_0x1b1b9c[_0xa2cc('0x1c')]=qs[_0xa2cc('0x1c')](_0x696e3e[_0xa2cc('0x2f')]['limit']);_0x1b1b9c[_0xa2cc('0x1b')]=qs['offset'](_0x696e3e[_0xa2cc('0x2f')][_0xa2cc('0x1b')]);}return _0x28deea[_0xa2cc('0x4f')](_0x1b1b9c);}})[_0xa2cc('0x23')](function(_0x3b8310){if(_0x3b8310){return _0x3b8310?{'count':_0x219708,'rows':_0x3b8310}:null;}})[_0xa2cc('0x23')](respondWithResult(_0x273279,null))[_0xa2cc('0x42')](handleError(_0x273279,null));};exports[_0xa2cc('0x50')]=function(_0x22d423,_0x23360f,_0xac2efe){var _0x15caf4={};var _0x12f941={};var _0x16b212;var _0x106974;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x22d423[_0xa2cc('0x44')]['id']}})['then'](handleEntityNotFound(_0x23360f,null))['then'](function(_0x2d0153){if(_0x2d0153){_0x16b212=_0x2d0153;_0x12f941[_0xa2cc('0x2d')]=_['keys'](db[_0xa2cc('0x4e')][_0xa2cc('0x2a')]);_0x12f941[_0xa2cc('0x2f')]=_[_0xa2cc('0x30')](_0x22d423[_0xa2cc('0x2f')]);_0x12f941['filters']=_[_0xa2cc('0x32')](_0x12f941[_0xa2cc('0x2d')],_0x12f941[_0xa2cc('0x2f')]);_0x15caf4[_0xa2cc('0x33')]=_['intersection'](_0x12f941[_0xa2cc('0x2d')],qs[_0xa2cc('0x34')](_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x34')]));_0x15caf4['attributes']=_0x15caf4[_0xa2cc('0x33')][_0xa2cc('0x4b')]?_0x15caf4[_0xa2cc('0x33')]:_0x12f941[_0xa2cc('0x2d')];_0x15caf4[_0xa2cc('0x36')]=qs[_0xa2cc('0x37')](_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x37')]);_0x15caf4[_0xa2cc('0x3a')]=qs[_0xa2cc('0x31')](_['pick'](_0x22d423[_0xa2cc('0x2f')],_0x12f941[_0xa2cc('0x31')]));if(_0x22d423[_0xa2cc('0x2f')]['filter']){_0x15caf4[_0xa2cc('0x3a')]=_['merge'](_0x15caf4[_0xa2cc('0x3a')],{'$or':_[_0xa2cc('0x29')](_0x15caf4['attributes'],function(_0x4784ae){var _0x2b7d22={};_0x2b7d22[_0x4784ae]={'$like':'%'+_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x38')]+'%'};return _0x2b7d22;})});}_0x15caf4=_[_0xa2cc('0x39')]({},_0x15caf4,_0x22d423[_0xa2cc('0x3c')]);return _0x16b212[_0xa2cc('0x50')](_0x15caf4);}})['then'](function(_0x519773){if(_0x519773){_0x106974=_0x519773['length'];if(!_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x4d')](_0xa2cc('0x35'))){_0x15caf4[_0xa2cc('0x1c')]=qs['limit'](_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x1c')]);_0x15caf4['offset']=qs[_0xa2cc('0x1b')](_0x22d423[_0xa2cc('0x2f')][_0xa2cc('0x1b')]);}return _0x16b212['getDescriptions'](_0x15caf4);}})[_0xa2cc('0x23')](function(_0x46f3aa){if(_0x46f3aa){return _0x46f3aa?{'count':_0x106974,'rows':_0x46f3aa}:null;}})[_0xa2cc('0x23')](respondWithResult(_0x23360f,null))[_0xa2cc('0x42')](handleError(_0x23360f,null));}; \ No newline at end of file +var _0xc11a=['squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','findOne','SalesforceField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3f7e52,_0x2c556f){var _0x43a04a=function(_0x18e235){while(--_0x18e235){_0x3f7e52['push'](_0x3f7e52['shift']());}};_0x43a04a(++_0x2c556f);}(_0xc11a,0x1d5));var _0xac11=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0xc11a[_0x5ad771];return _0x5b5dce;};'use strict';var emlformat=require(_0xac11('0x0'));var rimraf=require(_0xac11('0x1'));var zipdir=require(_0xac11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xac11('0x3'));var BPromise=require(_0xac11('0x4'));var Mustache=require('mustache');var util=require(_0xac11('0x5'));var path=require(_0xac11('0x6'));var sox=require(_0xac11('0x7'));var csv=require(_0xac11('0x8'));var ejs=require(_0xac11('0x9'));var fs=require('fs');var fs_extra=require(_0xac11('0xa'));var _=require('lodash');var squel=require(_0xac11('0xb'));var crypto=require(_0xac11('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xac11('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xac11('0xe'));var Redis=require(_0xac11('0xf'));var authService=require(_0xac11('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xac11('0x11'));var hardwareService=require(_0xac11('0x12'));var logger=require(_0xac11('0x13'))(_0xac11('0x14'));var utils=require(_0xac11('0x15'));var config=require(_0xac11('0x16'));var licenseUtil=require(_0xac11('0x17'));var db=require(_0xac11('0x18'))['db'];function respondWithStatusCode(_0x2283e4,_0x124b45){_0x124b45=_0x124b45||0xcc;return function(_0x5d2094){if(_0x5d2094){return _0x2283e4[_0xac11('0x19')](_0x124b45);}return _0x2283e4[_0xac11('0x1a')](_0x124b45)[_0xac11('0x1b')]();};}function respondWithResult(_0x5cb793,_0x20fa71){_0x20fa71=_0x20fa71||0xc8;return function(_0x4a644d){if(_0x4a644d){return _0x5cb793[_0xac11('0x1a')](_0x20fa71)['json'](_0x4a644d);}};}function respondWithFilteredResult(_0x39f5c3,_0x5cb2c7){return function(_0x5da683){if(_0x5da683){var _0x2c5a35=typeof _0x5cb2c7['offset']===_0xac11('0x1c')&&typeof _0x5cb2c7[_0xac11('0x1d')]===_0xac11('0x1c');var _0x5cbb62=_0x5da683['count'];var _0x1695f6=_0x2c5a35?0x0:_0x5cb2c7[_0xac11('0x1e')];var _0x2453b8=_0x2c5a35?_0x5da683[_0xac11('0x1f')]:_0x5cb2c7[_0xac11('0x1e')]+_0x5cb2c7[_0xac11('0x1d')];var _0x1e20c6;if(_0x2453b8>=_0x5cbb62){_0x2453b8=_0x5cbb62;_0x1e20c6=0xc8;}else{_0x1e20c6=0xce;}_0x39f5c3[_0xac11('0x1a')](_0x1e20c6);return _0x39f5c3[_0xac11('0x20')](_0xac11('0x21'),_0x1695f6+'-'+_0x2453b8+'/'+_0x5cbb62)['json'](_0x5da683);}return null;};}function patchUpdates(_0x4b953d){return function(_0x11fbff){try{jsonpatch[_0xac11('0x22')](_0x11fbff,_0x4b953d,!![]);}catch(_0x416f44){return BPromise[_0xac11('0x23')](_0x416f44);}return _0x11fbff['save']();};}function saveUpdates(_0x1404c2,_0x5ebb9d){return function(_0x49e672){if(_0x49e672){return _0x49e672['update'](_0x1404c2)[_0xac11('0x24')](function(_0x24a026){return _0x24a026;});}return null;};}function removeEntity(_0x264e03,_0xccaf2b){return function(_0x19db02){if(_0x19db02){return _0x19db02['destroy']()[_0xac11('0x24')](function(){_0x264e03[_0xac11('0x1a')](0xcc)[_0xac11('0x1b')]();});}};}function handleEntityNotFound(_0x7f957e,_0x535adc){return function(_0xf09a28){if(!_0xf09a28){_0x7f957e[_0xac11('0x19')](0x194);}return _0xf09a28;};}function handleError(_0x7afc48,_0x389ac4){_0x389ac4=_0x389ac4||0x1f4;return function(_0x4c7c4a){logger[_0xac11('0x25')](_0x4c7c4a[_0xac11('0x26')]);if(_0x4c7c4a[_0xac11('0x27')]){delete _0x4c7c4a[_0xac11('0x27')];}_0x7afc48[_0xac11('0x1a')](_0x389ac4)[_0xac11('0x28')](_0x4c7c4a);};}exports[_0xac11('0x29')]=function(_0x3df8a9,_0x23d259){var _0x51e37d={},_0x528354={},_0x34b944={'count':0x0,'rows':[]};var _0x392efb=_[_0xac11('0x2a')](db[_0xac11('0x2b')][_0xac11('0x2c')],function(_0x19d34b){return{'name':_0x19d34b['fieldName'],'type':_0x19d34b[_0xac11('0x2d')][_0xac11('0x2e')]};});_0x528354[_0xac11('0x2f')]=_[_0xac11('0x2a')](_0x392efb,_0xac11('0x27'));_0x528354[_0xac11('0x30')]=_['keys'](_0x3df8a9[_0xac11('0x30')]);_0x528354[_0xac11('0x31')]=_[_0xac11('0x32')](_0x528354[_0xac11('0x2f')],_0x528354[_0xac11('0x30')]);_0x51e37d[_0xac11('0x33')]=_[_0xac11('0x32')](_0x528354[_0xac11('0x2f')],qs['fields'](_0x3df8a9[_0xac11('0x30')][_0xac11('0x34')]));_0x51e37d[_0xac11('0x33')]=_0x51e37d['attributes'][_0xac11('0x35')]?_0x51e37d[_0xac11('0x33')]:_0x528354[_0xac11('0x2f')];if(!_0x3df8a9[_0xac11('0x30')][_0xac11('0x36')](_0xac11('0x37'))){_0x51e37d[_0xac11('0x1d')]=qs[_0xac11('0x1d')](_0x3df8a9[_0xac11('0x30')][_0xac11('0x1d')]);_0x51e37d[_0xac11('0x1e')]=qs['offset'](_0x3df8a9['query'][_0xac11('0x1e')]);}_0x51e37d[_0xac11('0x38')]=qs[_0xac11('0x39')](_0x3df8a9[_0xac11('0x30')][_0xac11('0x39')]);_0x51e37d[_0xac11('0x3a')]=qs['filters'](_[_0xac11('0x3b')](_0x3df8a9['query'],_0x528354[_0xac11('0x31')]),_0x392efb);if(_0x3df8a9['query'][_0xac11('0x3c')]){_0x51e37d[_0xac11('0x3a')]=_[_0xac11('0x3d')](_0x51e37d[_0xac11('0x3a')],{'$or':_[_0xac11('0x2a')](_0x392efb,function(_0x5b8d19){if(_0x5b8d19[_0xac11('0x2d')]!==_0xac11('0x3e')){var _0x18bb19={};_0x18bb19[_0x5b8d19[_0xac11('0x27')]]={'$like':'%'+_0x3df8a9['query'][_0xac11('0x3c')]+'%'};return _0x18bb19;}})});}_0x51e37d=_[_0xac11('0x3d')]({},_0x51e37d,_0x3df8a9[_0xac11('0x3f')]);var _0x4e981e={'where':_0x51e37d[_0xac11('0x3a')]};return db[_0xac11('0x2b')][_0xac11('0x1f')](_0x4e981e)['then'](function(_0x45b6e3){_0x34b944['count']=_0x45b6e3;if(_0x3df8a9[_0xac11('0x30')][_0xac11('0x40')]){_0x51e37d[_0xac11('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xac11('0x42')](_0x51e37d);})['then'](function(_0x4811a4){_0x34b944['rows']=_0x4811a4;return _0x34b944;})[_0xac11('0x24')](respondWithFilteredResult(_0x23d259,_0x51e37d))[_0xac11('0x43')](handleError(_0x23d259,null));};exports[_0xac11('0x44')]=function(_0x36fba2,_0x355ca3){var _0x1693de={'raw':![],'where':{'id':_0x36fba2[_0xac11('0x45')]['id']}},_0x8c5ae0={};_0x8c5ae0[_0xac11('0x2f')]=_['keys'](db[_0xac11('0x2b')][_0xac11('0x2c')]);_0x8c5ae0[_0xac11('0x30')]=_[_0xac11('0x46')](_0x36fba2[_0xac11('0x30')]);_0x8c5ae0['filters']=_['intersection'](_0x8c5ae0[_0xac11('0x2f')],_0x8c5ae0[_0xac11('0x30')]);_0x1693de[_0xac11('0x33')]=_['intersection'](_0x8c5ae0[_0xac11('0x2f')],qs[_0xac11('0x34')](_0x36fba2['query'][_0xac11('0x34')]));_0x1693de[_0xac11('0x33')]=_0x1693de[_0xac11('0x33')][_0xac11('0x35')]?_0x1693de[_0xac11('0x33')]:_0x8c5ae0[_0xac11('0x2f')];if(_0x36fba2[_0xac11('0x30')][_0xac11('0x40')]){_0x1693de[_0xac11('0x41')]=[{'all':!![]}];}_0x1693de=_[_0xac11('0x3d')]({},_0x1693de,_0x36fba2[_0xac11('0x3f')]);return db['SalesforceConfiguration'][_0xac11('0x47')](_0x1693de)['then'](handleEntityNotFound(_0x355ca3,null))['then'](respondWithResult(_0x355ca3,null))[_0xac11('0x43')](handleError(_0x355ca3,null));};exports[_0xac11('0x48')]=function(_0x228451,_0x2afaf0){return db['SalesforceConfiguration'][_0xac11('0x48')](_0x228451[_0xac11('0x49')],{})['then'](respondWithResult(_0x2afaf0,0xc9))[_0xac11('0x43')](handleError(_0x2afaf0,null));};exports[_0xac11('0x4a')]=function(_0x4733e3,_0x338272){if(_0x4733e3['body']['id']){delete _0x4733e3[_0xac11('0x49')]['id'];}return db['SalesforceConfiguration'][_0xac11('0x47')]({'where':{'id':_0x4733e3[_0xac11('0x45')]['id']}})[_0xac11('0x24')](handleEntityNotFound(_0x338272,null))['then'](saveUpdates(_0x4733e3[_0xac11('0x49')],null))[_0xac11('0x24')](respondWithResult(_0x338272,null))['catch'](handleError(_0x338272,null));};exports['destroy']=function(_0x4672d2,_0x3a6271){return db[_0xac11('0x2b')]['find']({'where':{'id':_0x4672d2[_0xac11('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a6271,null))[_0xac11('0x24')](removeEntity(_0x3a6271,null))['catch'](handleError(_0x3a6271,null));};exports['getFields']=function(_0x1734ce,_0x1d1e85,_0x4f28b4){var _0x41c33c={};var _0x597820={};var _0x37259b;var _0x341169;return db[_0xac11('0x2b')][_0xac11('0x4b')]({'where':{'id':_0x1734ce[_0xac11('0x45')]['id']}})[_0xac11('0x24')](handleEntityNotFound(_0x1d1e85,null))[_0xac11('0x24')](function(_0x19add2){if(_0x19add2){_0x37259b=_0x19add2;_0x597820[_0xac11('0x2f')]=_['keys'](db[_0xac11('0x4c')][_0xac11('0x2c')]);_0x597820['query']=_[_0xac11('0x46')](_0x1734ce[_0xac11('0x30')]);_0x597820[_0xac11('0x31')]=_['intersection'](_0x597820[_0xac11('0x2f')],_0x597820['query']);_0x41c33c[_0xac11('0x33')]=_[_0xac11('0x32')](_0x597820['model'],qs['fields'](_0x1734ce[_0xac11('0x30')]['fields']));_0x41c33c[_0xac11('0x33')]=_0x41c33c['attributes'][_0xac11('0x35')]?_0x41c33c['attributes']:_0x597820[_0xac11('0x2f')];_0x41c33c[_0xac11('0x38')]=qs['sort'](_0x1734ce[_0xac11('0x30')][_0xac11('0x39')]);_0x41c33c[_0xac11('0x3a')]=qs[_0xac11('0x31')](_[_0xac11('0x3b')](_0x1734ce[_0xac11('0x30')],_0x597820[_0xac11('0x31')]));if(_0x1734ce[_0xac11('0x30')]['filter']){_0x41c33c[_0xac11('0x3a')]=_['merge'](_0x41c33c[_0xac11('0x3a')],{'$or':_[_0xac11('0x2a')](_0x41c33c[_0xac11('0x33')],function(_0x6328a6){var _0x41b6bb={};_0x41b6bb[_0x6328a6]={'$like':'%'+_0x1734ce[_0xac11('0x30')][_0xac11('0x3c')]+'%'};return _0x41b6bb;})});}_0x41c33c=_[_0xac11('0x3d')]({},_0x41c33c,_0x1734ce['options']);return _0x37259b[_0xac11('0x4d')](_0x41c33c);}})[_0xac11('0x24')](function(_0x1261a1){if(_0x1261a1){_0x341169=_0x1261a1['length'];if(!_0x1734ce[_0xac11('0x30')]['hasOwnProperty'](_0xac11('0x37'))){_0x41c33c['limit']=qs[_0xac11('0x1d')](_0x1734ce[_0xac11('0x30')][_0xac11('0x1d')]);_0x41c33c['offset']=qs['offset'](_0x1734ce[_0xac11('0x30')][_0xac11('0x1e')]);}return _0x37259b[_0xac11('0x4d')](_0x41c33c);}})['then'](function(_0x26c166){if(_0x26c166){return _0x26c166?{'count':_0x341169,'rows':_0x26c166}:null;}})[_0xac11('0x24')](respondWithResult(_0x1d1e85,null))[_0xac11('0x43')](handleError(_0x1d1e85,null));};exports[_0xac11('0x4e')]=function(_0x51cee2,_0x4c2f51,_0x13272c){var _0x4e1a96={};var _0x37dbb0={};var _0x1d652c;var _0x1d8525;return db[_0xac11('0x2b')][_0xac11('0x4b')]({'where':{'id':_0x51cee2[_0xac11('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c2f51,null))[_0xac11('0x24')](function(_0x308d5c){if(_0x308d5c){_0x1d652c=_0x308d5c;_0x37dbb0[_0xac11('0x2f')]=_['keys'](db[_0xac11('0x4c')][_0xac11('0x2c')]);_0x37dbb0['query']=_[_0xac11('0x46')](_0x51cee2[_0xac11('0x30')]);_0x37dbb0['filters']=_[_0xac11('0x32')](_0x37dbb0[_0xac11('0x2f')],_0x37dbb0[_0xac11('0x30')]);_0x4e1a96[_0xac11('0x33')]=_[_0xac11('0x32')](_0x37dbb0['model'],qs[_0xac11('0x34')](_0x51cee2['query'][_0xac11('0x34')]));_0x4e1a96[_0xac11('0x33')]=_0x4e1a96[_0xac11('0x33')][_0xac11('0x35')]?_0x4e1a96[_0xac11('0x33')]:_0x37dbb0[_0xac11('0x2f')];_0x4e1a96[_0xac11('0x38')]=qs[_0xac11('0x39')](_0x51cee2[_0xac11('0x30')][_0xac11('0x39')]);_0x4e1a96['where']=qs['filters'](_['pick'](_0x51cee2[_0xac11('0x30')],_0x37dbb0['filters']));if(_0x51cee2[_0xac11('0x30')][_0xac11('0x3c')]){_0x4e1a96[_0xac11('0x3a')]=_[_0xac11('0x3d')](_0x4e1a96[_0xac11('0x3a')],{'$or':_[_0xac11('0x2a')](_0x4e1a96[_0xac11('0x33')],function(_0xe0b8ec){var _0xa6dfb2={};_0xa6dfb2[_0xe0b8ec]={'$like':'%'+_0x51cee2[_0xac11('0x30')][_0xac11('0x3c')]+'%'};return _0xa6dfb2;})});}_0x4e1a96=_[_0xac11('0x3d')]({},_0x4e1a96,_0x51cee2[_0xac11('0x3f')]);return _0x1d652c[_0xac11('0x4e')](_0x4e1a96);}})['then'](function(_0xd45205){if(_0xd45205){_0x1d8525=_0xd45205[_0xac11('0x35')];if(!_0x51cee2['query']['hasOwnProperty']('nolimit')){_0x4e1a96[_0xac11('0x1d')]=qs[_0xac11('0x1d')](_0x51cee2[_0xac11('0x30')][_0xac11('0x1d')]);_0x4e1a96[_0xac11('0x1e')]=qs[_0xac11('0x1e')](_0x51cee2[_0xac11('0x30')]['offset']);}return _0x1d652c['getSubjects'](_0x4e1a96);}})[_0xac11('0x24')](function(_0x5ae90a){if(_0x5ae90a){return _0x5ae90a?{'count':_0x1d8525,'rows':_0x5ae90a}:null;}})[_0xac11('0x24')](respondWithResult(_0x4c2f51,null))['catch'](handleError(_0x4c2f51,null));};exports[_0xac11('0x4f')]=function(_0x58fd28,_0x41c799,_0x36011e){var _0x300520={};var _0x301d8c={};var _0x185fb7;var _0xcc22d9;return db[_0xac11('0x2b')][_0xac11('0x4b')]({'where':{'id':_0x58fd28[_0xac11('0x45')]['id']}})[_0xac11('0x24')](handleEntityNotFound(_0x41c799,null))[_0xac11('0x24')](function(_0x426067){if(_0x426067){_0x185fb7=_0x426067;_0x301d8c['model']=_[_0xac11('0x46')](db[_0xac11('0x4c')][_0xac11('0x2c')]);_0x301d8c['query']=_['keys'](_0x58fd28[_0xac11('0x30')]);_0x301d8c[_0xac11('0x31')]=_[_0xac11('0x32')](_0x301d8c[_0xac11('0x2f')],_0x301d8c[_0xac11('0x30')]);_0x300520[_0xac11('0x33')]=_['intersection'](_0x301d8c['model'],qs[_0xac11('0x34')](_0x58fd28[_0xac11('0x30')]['fields']));_0x300520[_0xac11('0x33')]=_0x300520[_0xac11('0x33')][_0xac11('0x35')]?_0x300520[_0xac11('0x33')]:_0x301d8c[_0xac11('0x2f')];_0x300520[_0xac11('0x38')]=qs[_0xac11('0x39')](_0x58fd28[_0xac11('0x30')][_0xac11('0x39')]);_0x300520['where']=qs[_0xac11('0x31')](_['pick'](_0x58fd28[_0xac11('0x30')],_0x301d8c[_0xac11('0x31')]));if(_0x58fd28[_0xac11('0x30')][_0xac11('0x3c')]){_0x300520[_0xac11('0x3a')]=_['merge'](_0x300520[_0xac11('0x3a')],{'$or':_[_0xac11('0x2a')](_0x300520[_0xac11('0x33')],function(_0x380238){var _0x22752f={};_0x22752f[_0x380238]={'$like':'%'+_0x58fd28['query']['filter']+'%'};return _0x22752f;})});}_0x300520=_[_0xac11('0x3d')]({},_0x300520,_0x58fd28[_0xac11('0x3f')]);return _0x185fb7[_0xac11('0x4f')](_0x300520);}})[_0xac11('0x24')](function(_0x5e7879){if(_0x5e7879){_0xcc22d9=_0x5e7879[_0xac11('0x35')];if(!_0x58fd28[_0xac11('0x30')][_0xac11('0x36')]('nolimit')){_0x300520['limit']=qs[_0xac11('0x1d')](_0x58fd28[_0xac11('0x30')]['limit']);_0x300520[_0xac11('0x1e')]=qs[_0xac11('0x1e')](_0x58fd28[_0xac11('0x30')][_0xac11('0x1e')]);}return _0x185fb7['getDescriptions'](_0x300520);}})[_0xac11('0x24')](function(_0x5b6c98){if(_0x5b6c98){return _0x5b6c98?{'count':_0xcc22d9,'rows':_0x5b6c98}:null;}})['then'](respondWithResult(_0x41c799,null))[_0xac11('0x43')](handleError(_0x41c799,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 47c3a42..abfb3db 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 _0xf87b=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x4f9993,_0x5e6642){var _0x51e017=function(_0x1ef350){while(--_0x1ef350){_0x4f9993['push'](_0x4f9993['shift']());}};_0x51e017(++_0x5e6642);}(_0xf87b,0x195));var _0xbf87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf87b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbf87('0x0'));var util=require(_0xbf87('0x1'));var logger=require(_0xbf87('0x2'))('api');var moment=require(_0xbf87('0x3'));var BPromise=require(_0xbf87('0x4'));var rp=require(_0xbf87('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf87('0x6'));var config=require(_0xbf87('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xbf87('0x8')]=function(_0x11952e,_0x3443d5){return _0x11952e[_0xbf87('0x9')](_0xbf87('0xa'),attributes,{'tableName':_0xbf87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3410=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x3410,0x91));var _0x0341=function(_0x45de83,_0x32f2e8){_0x45de83=_0x45de83-0x0;var _0x4af908=_0x3410[_0x45de83];return _0x4af908;};'use strict';var _=require(_0x0341('0x0'));var util=require('util');var logger=require(_0x0341('0x1'))('api');var moment=require(_0x0341('0x2'));var BPromise=require(_0x0341('0x3'));var rp=require(_0x0341('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0341('0x5'));var attributes=require(_0x0341('0x6'));module[_0x0341('0x7')]=function(_0x2dc3cf,_0x3e6dbf){return _0x2dc3cf[_0x0341('0x8')](_0x0341('0x9'),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 a3f219b..f04f942 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 _0x5f04=['request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5f04,0x1a4));var _0x45f0=function(_0x1a8132,_0x1d4978){_0x1a8132=_0x1a8132-0x0;var _0x5b9329=_0x5f04[_0x1a8132];return _0x5b9329;};'use strict';var _=require(_0x45f0('0x0'));var util=require(_0x45f0('0x1'));var moment=require('moment');var BPromise=require(_0x45f0('0x2'));var rs=require(_0x45f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45f0('0x4'))['db'];var utils=require(_0x45f0('0x5'));var logger=require(_0x45f0('0x6'))(_0x45f0('0x7'));var config=require(_0x45f0('0x8'));var jayson=require(_0x45f0('0x9'));var client=jayson[_0x45f0('0xa')][_0x45f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6237,_0x3a077c,_0x670dba){return new BPromise(function(_0x475577,_0x501e8b){return client[_0x45f0('0xc')](_0x4c6237,_0x670dba)[_0x45f0('0xd')](function(_0x335c2f){logger[_0x45f0('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3a077c,_0x45f0('0xf'));logger[_0x45f0('0x10')](_0x45f0('0x11'),_0x3a077c,_0x45f0('0xf'),JSON[_0x45f0('0x12')](_0x335c2f));if(_0x335c2f[_0x45f0('0x13')]){if(_0x335c2f[_0x45f0('0x13')][_0x45f0('0x14')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x3a077c,_0x335c2f[_0x45f0('0x13')]['message']);return _0x501e8b(_0x335c2f[_0x45f0('0x13')][_0x45f0('0x15')]);}logger[_0x45f0('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3a077c,_0x335c2f['error']['message']);return _0x475577(_0x335c2f[_0x45f0('0x13')]['message']);}else{logger[_0x45f0('0xe')](_0x45f0('0x16'),_0x3a077c,_0x45f0('0xf'));_0x475577(_0x335c2f['result'][_0x45f0('0x15')]);}})[_0x45f0('0x17')](function(_0x53d442){logger[_0x45f0('0x13')](_0x45f0('0x16'),_0x3a077c,_0x53d442);_0x501e8b(_0x53d442);});});} \ No newline at end of file +var _0xb34d=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2880d8,_0x284ded){var _0x51f5a9=function(_0xafd747){while(--_0xafd747){_0x2880d8['push'](_0x2880d8['shift']());}};_0x51f5a9(++_0x284ded);}(_0xb34d,0x1ec));var _0xdb34=function(_0x50ed02,_0x1884e2){_0x50ed02=_0x50ed02-0x0;var _0x206f61=_0xb34d[_0x50ed02];return _0x206f61;};'use strict';var _=require(_0xdb34('0x0'));var util=require(_0xdb34('0x1'));var moment=require(_0xdb34('0x2'));var BPromise=require(_0xdb34('0x3'));var rs=require(_0xdb34('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb34('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb34('0x6'))(_0xdb34('0x7'));var config=require(_0xdb34('0x8'));var jayson=require(_0xdb34('0x9'));var client=jayson[_0xdb34('0xa')][_0xdb34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aeabd,_0x2fe93a,_0x3ed8f8){return new BPromise(function(_0x1ed296,_0x217dcf){return client['request'](_0x4aeabd,_0x3ed8f8)[_0xdb34('0xc')](function(_0x43f973){logger[_0xdb34('0xd')](_0xdb34('0xe'),_0x2fe93a,_0xdb34('0xf'));logger[_0xdb34('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2fe93a,_0xdb34('0xf'),JSON['stringify'](_0x43f973));if(_0x43f973[_0xdb34('0x11')]){if(_0x43f973[_0xdb34('0x11')][_0xdb34('0x12')]===0x1f4){logger[_0xdb34('0x11')](_0xdb34('0xe'),_0x2fe93a,_0x43f973[_0xdb34('0x11')][_0xdb34('0x13')]);return _0x217dcf(_0x43f973['error'][_0xdb34('0x13')]);}logger[_0xdb34('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2fe93a,_0x43f973[_0xdb34('0x11')][_0xdb34('0x13')]);return _0x1ed296(_0x43f973[_0xdb34('0x11')]['message']);}else{logger[_0xdb34('0xd')](_0xdb34('0xe'),_0x2fe93a,_0xdb34('0xf'));_0x1ed296(_0x43f973[_0xdb34('0x14')]['message']);}})[_0xdb34('0x15')](function(_0x4c3247){logger[_0xdb34('0x11')](_0xdb34('0xe'),_0x2fe93a,_0x4c3247);_0x217dcf(_0x4c3247);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 6f76aad..af07d56 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 _0x57ba=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','/:id','show','post'];(function(_0x28ee74,_0x376b00){var _0x2ada79=function(_0x2ee2bc){while(--_0x2ee2bc){_0x28ee74['push'](_0x28ee74['shift']());}};_0x2ada79(++_0x376b00);}(_0x57ba,0x15c));var _0xa57b=function(_0x566a86,_0x1e19da){_0x566a86=_0x566a86-0x0;var _0x448990=_0x57ba[_0x566a86];return _0x448990;};'use strict';var multer=require(_0xa57b('0x0'));var util=require(_0xa57b('0x1'));var path=require(_0xa57b('0x2'));var timeout=require('connect-timeout');var express=require(_0xa57b('0x3'));var router=express[_0xa57b('0x4')]();var fs_extra=require(_0xa57b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa57b('0x6'));var controller=require(_0xa57b('0x7'));router['get']('/',auth[_0xa57b('0x8')](),controller[_0xa57b('0x9')]);router['get'](_0xa57b('0xa'),auth[_0xa57b('0x8')](),controller[_0xa57b('0xb')]);router[_0xa57b('0xc')]('/',auth[_0xa57b('0x8')](),controller[_0xa57b('0xd')]);router[_0xa57b('0xe')](_0xa57b('0xa'),auth[_0xa57b('0x8')](),controller[_0xa57b('0xf')]);router[_0xa57b('0x10')](_0xa57b('0xa'),auth['isAuthenticated'](),controller[_0xa57b('0x11')]);module[_0xa57b('0x12')]=router; \ No newline at end of file +var _0xb07f=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xb07f,0x15e));var _0xfb07=function(_0xae5724,_0x503b9d){_0xae5724=_0xae5724-0x0;var _0x33051c=_0xb07f[_0xae5724];return _0x33051c;};'use strict';var multer=require(_0xfb07('0x0'));var util=require('util');var path=require(_0xfb07('0x1'));var timeout=require(_0xfb07('0x2'));var express=require(_0xfb07('0x3'));var router=express[_0xfb07('0x4')]();var fs_extra=require(_0xfb07('0x5'));var auth=require(_0xfb07('0x6'));var interaction=require(_0xfb07('0x7'));var config=require(_0xfb07('0x8'));var controller=require(_0xfb07('0x9'));router[_0xfb07('0xa')]('/',auth[_0xfb07('0xb')](),controller[_0xfb07('0xc')]);router[_0xfb07('0xa')](_0xfb07('0xd'),auth[_0xfb07('0xb')](),controller[_0xfb07('0xe')]);router['post']('/',auth[_0xfb07('0xb')](),controller[_0xfb07('0xf')]);router[_0xfb07('0x10')]('/:id',auth[_0xfb07('0xb')](),controller[_0xfb07('0x11')]);router[_0xfb07('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xfb07('0x13')]);module[_0xfb07('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 692e141..4ee6347 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 _0x90dc=['variable','keyValue','picklist','STRING','ENUM','string'];(function(_0x1ec6ec,_0x2528f9){var _0xf1363=function(_0xfd0aea){while(--_0xfd0aea){_0x1ec6ec['push'](_0x1ec6ec['shift']());}};_0xf1363(++_0x2528f9);}(_0x90dc,0x1de));var _0xc90d=function(_0x9b7e86,_0x1ea146){_0x9b7e86=_0x9b7e86-0x0;var _0x43d3aa=_0x90dc[_0x9b7e86];return _0x43d3aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc90d('0x0')](_0xc90d('0x1'),_0xc90d('0x2'),'customVariable',_0xc90d('0x3'),_0xc90d('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc90d('0x5')]},'key':{'type':Sequelize[_0xc90d('0x5')]},'keyType':{'type':Sequelize[_0xc90d('0x0')]('string',_0xc90d('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc90d('0x5')]},'idField':{'type':Sequelize[_0xc90d('0x5')]},'variableName':{'type':Sequelize[_0xc90d('0x5')]}}; \ No newline at end of file +var _0x8fea=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0xb10578,_0x5502a6){var _0x576d19=function(_0x542ef4){while(--_0x542ef4){_0xb10578['push'](_0xb10578['shift']());}};_0x576d19(++_0x5502a6);}(_0x8fea,0x191));var _0xa8fe=function(_0x20e13b,_0x3f7cd9){_0x20e13b=_0x20e13b-0x0;var _0x44d9d3=_0x8fea[_0x20e13b];return _0x44d9d3;};'use strict';var Sequelize=require(_0xa8fe('0x0'));module[_0xa8fe('0x1')]={'type':{'type':Sequelize[_0xa8fe('0x2')](_0xa8fe('0x3'),_0xa8fe('0x4'),_0xa8fe('0x5'),_0xa8fe('0x6'),_0xa8fe('0x7')),'defaultValue':_0xa8fe('0x3')},'content':{'type':Sequelize[_0xa8fe('0x8')]},'key':{'type':Sequelize[_0xa8fe('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa8fe('0x4'),_0xa8fe('0x5'))},'keyContent':{'type':Sequelize[_0xa8fe('0x8')]},'idField':{'type':Sequelize[_0xa8fe('0x8')]},'variableName':{'type':Sequelize[_0xa8fe('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index ff32859..d321ed9 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 _0xe845=['SalesforceField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','name','send','map'];(function(_0x3f8364,_0xc5bb3){var _0x1590fa=function(_0x16cf02){while(--_0x16cf02){_0x3f8364['push'](_0x3f8364['shift']());}};_0x1590fa(++_0xc5bb3);}(_0xe845,0xab));var _0x5e84=function(_0x4181a6,_0x43536a){_0x4181a6=_0x4181a6-0x0;var _0x18d67c=_0xe845[_0x4181a6];return _0x18d67c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e84('0x0'));var zipdir=require(_0x5e84('0x1'));var jsonpatch=require(_0x5e84('0x2'));var rp=require(_0x5e84('0x3'));var moment=require(_0x5e84('0x4'));var BPromise=require(_0x5e84('0x5'));var Mustache=require(_0x5e84('0x6'));var util=require(_0x5e84('0x7'));var path=require(_0x5e84('0x8'));var sox=require(_0x5e84('0x9'));var csv=require(_0x5e84('0xa'));var ejs=require(_0x5e84('0xb'));var fs=require('fs');var fs_extra=require(_0x5e84('0xc'));var _=require(_0x5e84('0xd'));var squel=require(_0x5e84('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e84('0xf'));var toCsv=require(_0x5e84('0xa'));var querystring=require('querystring');var Papa=require(_0x5e84('0x10'));var Redis=require(_0x5e84('0x11'));var authService=require(_0x5e84('0x12'));var qs=require(_0x5e84('0x13'));var as=require(_0x5e84('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5e84('0x15'));var utils=require(_0x5e84('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5e84('0x17'));var db=require(_0x5e84('0x18'))['db'];function respondWithStatusCode(_0x1d025a,_0x41125a){_0x41125a=_0x41125a||0xcc;return function(_0x1eeeee){if(_0x1eeeee){return _0x1d025a[_0x5e84('0x19')](_0x41125a);}return _0x1d025a[_0x5e84('0x1a')](_0x41125a)['end']();};}function respondWithResult(_0x4c0a96,_0x20ceb1){_0x20ceb1=_0x20ceb1||0xc8;return function(_0x3189cd){if(_0x3189cd){return _0x4c0a96[_0x5e84('0x1a')](_0x20ceb1)['json'](_0x3189cd);}};}function respondWithFilteredResult(_0x41dc17,_0x50147f){return function(_0x2dc943){if(_0x2dc943){var _0x3057e1=typeof _0x50147f[_0x5e84('0x1b')]==='undefined'&&typeof _0x50147f[_0x5e84('0x1c')]===_0x5e84('0x1d');var _0x46b7be=_0x2dc943[_0x5e84('0x1e')];var _0x40e863=_0x3057e1?0x0:_0x50147f[_0x5e84('0x1b')];var _0xc96e2b=_0x3057e1?_0x2dc943[_0x5e84('0x1e')]:_0x50147f[_0x5e84('0x1b')]+_0x50147f[_0x5e84('0x1c')];var _0x1610bb;if(_0xc96e2b>=_0x46b7be){_0xc96e2b=_0x46b7be;_0x1610bb=0xc8;}else{_0x1610bb=0xce;}_0x41dc17[_0x5e84('0x1a')](_0x1610bb);return _0x41dc17[_0x5e84('0x1f')](_0x5e84('0x20'),_0x40e863+'-'+_0xc96e2b+'/'+_0x46b7be)[_0x5e84('0x21')](_0x2dc943);}return null;};}function patchUpdates(_0x13dec6){return function(_0x35e627){try{jsonpatch[_0x5e84('0x22')](_0x35e627,_0x13dec6,!![]);}catch(_0x505b58){return BPromise['reject'](_0x505b58);}return _0x35e627[_0x5e84('0x23')]();};}function saveUpdates(_0x650fb2,_0x33c2f4){return function(_0x17f50e){if(_0x17f50e){return _0x17f50e[_0x5e84('0x24')](_0x650fb2)[_0x5e84('0x25')](function(_0x351e5a){return _0x351e5a;});}return null;};}function removeEntity(_0x5c25ba,_0x5d7d9d){return function(_0x3c166d){if(_0x3c166d){return _0x3c166d[_0x5e84('0x26')]()[_0x5e84('0x25')](function(){_0x5c25ba[_0x5e84('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56bb54,_0x4c4504){return function(_0x47ebdd){if(!_0x47ebdd){_0x56bb54[_0x5e84('0x19')](0x194);}return _0x47ebdd;};}function handleError(_0x4af6e5,_0x902e68){_0x902e68=_0x902e68||0x1f4;return function(_0x34b8e2){logger['error'](_0x34b8e2['stack']);if(_0x34b8e2[_0x5e84('0x27')]){delete _0x34b8e2['name'];}_0x4af6e5['status'](_0x902e68)[_0x5e84('0x28')](_0x34b8e2);};}exports['index']=function(_0x99acd1,_0x241d50){var _0x48c833={},_0x40e209={},_0x1aa947={'count':0x0,'rows':[]};var _0x386531=_[_0x5e84('0x29')](db[_0x5e84('0x2a')][_0x5e84('0x2b')],function(_0x1848e8){return{'name':_0x1848e8[_0x5e84('0x2c')],'type':_0x1848e8['type'][_0x5e84('0x2d')]};});_0x40e209[_0x5e84('0x2e')]=_['map'](_0x386531,_0x5e84('0x27'));_0x40e209[_0x5e84('0x2f')]=_['keys'](_0x99acd1[_0x5e84('0x2f')]);_0x40e209[_0x5e84('0x30')]=_[_0x5e84('0x31')](_0x40e209[_0x5e84('0x2e')],_0x40e209['query']);_0x48c833[_0x5e84('0x32')]=_[_0x5e84('0x31')](_0x40e209[_0x5e84('0x2e')],qs[_0x5e84('0x33')](_0x99acd1[_0x5e84('0x2f')]['fields']));_0x48c833[_0x5e84('0x32')]=_0x48c833[_0x5e84('0x32')][_0x5e84('0x34')]?_0x48c833[_0x5e84('0x32')]:_0x40e209['model'];if(!_0x99acd1['query'][_0x5e84('0x35')]('nolimit')){_0x48c833[_0x5e84('0x1c')]=qs[_0x5e84('0x1c')](_0x99acd1['query'][_0x5e84('0x1c')]);_0x48c833[_0x5e84('0x1b')]=qs[_0x5e84('0x1b')](_0x99acd1[_0x5e84('0x2f')][_0x5e84('0x1b')]);}_0x48c833['order']=qs[_0x5e84('0x36')](_0x99acd1[_0x5e84('0x2f')][_0x5e84('0x36')]);_0x48c833[_0x5e84('0x37')]=qs[_0x5e84('0x30')](_[_0x5e84('0x38')](_0x99acd1['query'],_0x40e209['filters']),_0x386531);if(_0x99acd1[_0x5e84('0x2f')][_0x5e84('0x39')]){_0x48c833[_0x5e84('0x37')]=_[_0x5e84('0x3a')](_0x48c833[_0x5e84('0x37')],{'$or':_[_0x5e84('0x29')](_0x386531,function(_0x18202a){if(_0x18202a['type']!==_0x5e84('0x3b')){var _0x4f56e8={};_0x4f56e8[_0x18202a[_0x5e84('0x27')]]={'$like':'%'+_0x99acd1['query'][_0x5e84('0x39')]+'%'};return _0x4f56e8;}})});}_0x48c833=_[_0x5e84('0x3a')]({},_0x48c833,_0x99acd1[_0x5e84('0x3c')]);var _0x45f4aa={'where':_0x48c833[_0x5e84('0x37')]};return db[_0x5e84('0x2a')][_0x5e84('0x1e')](_0x45f4aa)[_0x5e84('0x25')](function(_0x5798c8){_0x1aa947[_0x5e84('0x1e')]=_0x5798c8;if(_0x99acd1[_0x5e84('0x2f')][_0x5e84('0x3d')]){_0x48c833[_0x5e84('0x3e')]=[{'all':!![]}];}return db[_0x5e84('0x2a')][_0x5e84('0x3f')](_0x48c833);})[_0x5e84('0x25')](function(_0x3ab319){_0x1aa947['rows']=_0x3ab319;return _0x1aa947;})[_0x5e84('0x25')](respondWithFilteredResult(_0x241d50,_0x48c833))[_0x5e84('0x40')](handleError(_0x241d50,null));};exports[_0x5e84('0x41')]=function(_0x418101,_0x2d9e80){var _0x4954d7={'raw':!![],'where':{'id':_0x418101[_0x5e84('0x42')]['id']}},_0x5dcdbf={};_0x5dcdbf[_0x5e84('0x2e')]=_[_0x5e84('0x43')](db['SalesforceField'][_0x5e84('0x2b')]);_0x5dcdbf[_0x5e84('0x2f')]=_['keys'](_0x418101[_0x5e84('0x2f')]);_0x5dcdbf[_0x5e84('0x30')]=_[_0x5e84('0x31')](_0x5dcdbf[_0x5e84('0x2e')],_0x5dcdbf[_0x5e84('0x2f')]);_0x4954d7[_0x5e84('0x32')]=_['intersection'](_0x5dcdbf[_0x5e84('0x2e')],qs[_0x5e84('0x33')](_0x418101[_0x5e84('0x2f')][_0x5e84('0x33')]));_0x4954d7[_0x5e84('0x32')]=_0x4954d7[_0x5e84('0x32')][_0x5e84('0x34')]?_0x4954d7[_0x5e84('0x32')]:_0x5dcdbf['model'];if(_0x418101[_0x5e84('0x2f')][_0x5e84('0x3d')]){_0x4954d7[_0x5e84('0x3e')]=[{'all':!![]}];}_0x4954d7=_[_0x5e84('0x3a')]({},_0x4954d7,_0x418101[_0x5e84('0x3c')]);return db[_0x5e84('0x2a')][_0x5e84('0x44')](_0x4954d7)[_0x5e84('0x25')](handleEntityNotFound(_0x2d9e80,null))[_0x5e84('0x25')](respondWithResult(_0x2d9e80,null))[_0x5e84('0x40')](handleError(_0x2d9e80,null));};exports['create']=function(_0x3b7b9e,_0x1c6707){return db[_0x5e84('0x2a')][_0x5e84('0x45')](_0x3b7b9e['body'],{})['then'](respondWithResult(_0x1c6707,0xc9))[_0x5e84('0x40')](handleError(_0x1c6707,null));};exports[_0x5e84('0x24')]=function(_0x5b3f27,_0x1a77b8){if(_0x5b3f27[_0x5e84('0x46')]['id']){delete _0x5b3f27[_0x5e84('0x46')]['id'];}return db['SalesforceField'][_0x5e84('0x44')]({'where':{'id':_0x5b3f27[_0x5e84('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a77b8,null))['then'](saveUpdates(_0x5b3f27[_0x5e84('0x46')],null))[_0x5e84('0x25')](respondWithResult(_0x1a77b8,null))['catch'](handleError(_0x1a77b8,null));};exports[_0x5e84('0x26')]=function(_0x4b864a,_0x68d273){return db[_0x5e84('0x2a')]['find']({'where':{'id':_0x4b864a[_0x5e84('0x42')]['id']}})['then'](handleEntityNotFound(_0x68d273,null))[_0x5e84('0x25')](removeEntity(_0x68d273,null))[_0x5e84('0x40')](handleError(_0x68d273,null));}; \ No newline at end of file +var _0xda47=['order','sort','where','filters','pick','filter','merge','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','reject','save','update','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x4294b5,_0x1b33df){var _0xc80d91=function(_0x347b61){while(--_0x347b61){_0x4294b5['push'](_0x4294b5['shift']());}};_0xc80d91(++_0x1b33df);}(_0xda47,0x1ce));var _0x7da4=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0xda47[_0x471448];return _0x38190b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7da4('0x0'));var jsonpatch=require(_0x7da4('0x1'));var rp=require(_0x7da4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7da4('0x3'));var util=require(_0x7da4('0x4'));var path=require(_0x7da4('0x5'));var sox=require(_0x7da4('0x6'));var csv=require(_0x7da4('0x7'));var ejs=require(_0x7da4('0x8'));var fs=require('fs');var fs_extra=require(_0x7da4('0x9'));var _=require(_0x7da4('0xa'));var squel=require(_0x7da4('0xb'));var crypto=require(_0x7da4('0xc'));var jsforce=require(_0x7da4('0xd'));var deskjs=require(_0x7da4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7da4('0xf'));var Papa=require(_0x7da4('0x10'));var Redis=require(_0x7da4('0x11'));var authService=require(_0x7da4('0x12'));var qs=require(_0x7da4('0x13'));var as=require(_0x7da4('0x14'));var hardwareService=require(_0x7da4('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7da4('0x16'));var config=require(_0x7da4('0x17'));var licenseUtil=require(_0x7da4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cabc9,_0x5f200c){_0x5f200c=_0x5f200c||0xcc;return function(_0x22ed0a){if(_0x22ed0a){return _0x3cabc9[_0x7da4('0x19')](_0x5f200c);}return _0x3cabc9[_0x7da4('0x1a')](_0x5f200c)[_0x7da4('0x1b')]();};}function respondWithResult(_0x2db0cb,_0x843bf){_0x843bf=_0x843bf||0xc8;return function(_0x4c981a){if(_0x4c981a){return _0x2db0cb[_0x7da4('0x1a')](_0x843bf)['json'](_0x4c981a);}};}function respondWithFilteredResult(_0xee0749,_0x2e3be2){return function(_0x2877f4){if(_0x2877f4){var _0x18fb75=typeof _0x2e3be2[_0x7da4('0x1c')]===_0x7da4('0x1d')&&typeof _0x2e3be2['limit']===_0x7da4('0x1d');var _0x165371=_0x2877f4['count'];var _0x3e5270=_0x18fb75?0x0:_0x2e3be2['offset'];var _0x17087c=_0x18fb75?_0x2877f4[_0x7da4('0x1e')]:_0x2e3be2['offset']+_0x2e3be2[_0x7da4('0x1f')];var _0x19f97d;if(_0x17087c>=_0x165371){_0x17087c=_0x165371;_0x19f97d=0xc8;}else{_0x19f97d=0xce;}_0xee0749[_0x7da4('0x1a')](_0x19f97d);return _0xee0749['set'](_0x7da4('0x20'),_0x3e5270+'-'+_0x17087c+'/'+_0x165371)['json'](_0x2877f4);}return null;};}function patchUpdates(_0x3a74bd){return function(_0x1fde8d){try{jsonpatch['apply'](_0x1fde8d,_0x3a74bd,!![]);}catch(_0x180f8f){return BPromise[_0x7da4('0x21')](_0x180f8f);}return _0x1fde8d[_0x7da4('0x22')]();};}function saveUpdates(_0x428bfb,_0x6c275c){return function(_0x37e462){if(_0x37e462){return _0x37e462[_0x7da4('0x23')](_0x428bfb)[_0x7da4('0x24')](function(_0x5088d5){return _0x5088d5;});}return null;};}function removeEntity(_0x5e5a7a,_0x5892c3){return function(_0x1799c4){if(_0x1799c4){return _0x1799c4['destroy']()['then'](function(){_0x5e5a7a[_0x7da4('0x1a')](0xcc)[_0x7da4('0x1b')]();});}};}function handleEntityNotFound(_0x287db4,_0x29dd2e){return function(_0x3e717d){if(!_0x3e717d){_0x287db4[_0x7da4('0x19')](0x194);}return _0x3e717d;};}function handleError(_0x1364be,_0x449f12){_0x449f12=_0x449f12||0x1f4;return function(_0x1a2726){logger[_0x7da4('0x25')](_0x1a2726[_0x7da4('0x26')]);if(_0x1a2726[_0x7da4('0x27')]){delete _0x1a2726[_0x7da4('0x27')];}_0x1364be[_0x7da4('0x1a')](_0x449f12)[_0x7da4('0x28')](_0x1a2726);};}exports[_0x7da4('0x29')]=function(_0x21dffa,_0x395b4e){var _0x38c4c5={},_0x16bf99={},_0x2e8f42={'count':0x0,'rows':[]};var _0xa7628f=_[_0x7da4('0x2a')](db[_0x7da4('0x2b')][_0x7da4('0x2c')],function(_0xbb4462){return{'name':_0xbb4462[_0x7da4('0x2d')],'type':_0xbb4462[_0x7da4('0x2e')][_0x7da4('0x2f')]};});_0x16bf99[_0x7da4('0x30')]=_[_0x7da4('0x2a')](_0xa7628f,_0x7da4('0x27'));_0x16bf99[_0x7da4('0x31')]=_[_0x7da4('0x32')](_0x21dffa[_0x7da4('0x31')]);_0x16bf99['filters']=_[_0x7da4('0x33')](_0x16bf99[_0x7da4('0x30')],_0x16bf99['query']);_0x38c4c5[_0x7da4('0x34')]=_[_0x7da4('0x33')](_0x16bf99['model'],qs[_0x7da4('0x35')](_0x21dffa[_0x7da4('0x31')][_0x7da4('0x35')]));_0x38c4c5['attributes']=_0x38c4c5[_0x7da4('0x34')]['length']?_0x38c4c5[_0x7da4('0x34')]:_0x16bf99['model'];if(!_0x21dffa[_0x7da4('0x31')][_0x7da4('0x36')](_0x7da4('0x37'))){_0x38c4c5[_0x7da4('0x1f')]=qs['limit'](_0x21dffa[_0x7da4('0x31')][_0x7da4('0x1f')]);_0x38c4c5[_0x7da4('0x1c')]=qs[_0x7da4('0x1c')](_0x21dffa['query'][_0x7da4('0x1c')]);}_0x38c4c5[_0x7da4('0x38')]=qs[_0x7da4('0x39')](_0x21dffa['query']['sort']);_0x38c4c5[_0x7da4('0x3a')]=qs[_0x7da4('0x3b')](_[_0x7da4('0x3c')](_0x21dffa[_0x7da4('0x31')],_0x16bf99['filters']),_0xa7628f);if(_0x21dffa[_0x7da4('0x31')][_0x7da4('0x3d')]){_0x38c4c5[_0x7da4('0x3a')]=_[_0x7da4('0x3e')](_0x38c4c5[_0x7da4('0x3a')],{'$or':_['map'](_0xa7628f,function(_0x490623){if(_0x490623[_0x7da4('0x2e')]!=='VIRTUAL'){var _0x3b6e5f={};_0x3b6e5f[_0x490623[_0x7da4('0x27')]]={'$like':'%'+_0x21dffa[_0x7da4('0x31')][_0x7da4('0x3d')]+'%'};return _0x3b6e5f;}})});}_0x38c4c5=_[_0x7da4('0x3e')]({},_0x38c4c5,_0x21dffa[_0x7da4('0x3f')]);var _0x494dac={'where':_0x38c4c5[_0x7da4('0x3a')]};return db['SalesforceField'][_0x7da4('0x1e')](_0x494dac)[_0x7da4('0x24')](function(_0x56c27a){_0x2e8f42['count']=_0x56c27a;if(_0x21dffa[_0x7da4('0x31')]['includeAll']){_0x38c4c5['include']=[{'all':!![]}];}return db[_0x7da4('0x2b')][_0x7da4('0x40')](_0x38c4c5);})[_0x7da4('0x24')](function(_0x2837cc){_0x2e8f42[_0x7da4('0x41')]=_0x2837cc;return _0x2e8f42;})[_0x7da4('0x24')](respondWithFilteredResult(_0x395b4e,_0x38c4c5))['catch'](handleError(_0x395b4e,null));};exports[_0x7da4('0x42')]=function(_0x381de4,_0x2706e9){var _0x4cc3a5={'raw':!![],'where':{'id':_0x381de4[_0x7da4('0x43')]['id']}},_0x33b88c={};_0x33b88c[_0x7da4('0x30')]=_[_0x7da4('0x32')](db[_0x7da4('0x2b')][_0x7da4('0x2c')]);_0x33b88c[_0x7da4('0x31')]=_[_0x7da4('0x32')](_0x381de4[_0x7da4('0x31')]);_0x33b88c['filters']=_['intersection'](_0x33b88c[_0x7da4('0x30')],_0x33b88c[_0x7da4('0x31')]);_0x4cc3a5[_0x7da4('0x34')]=_[_0x7da4('0x33')](_0x33b88c['model'],qs[_0x7da4('0x35')](_0x381de4['query'][_0x7da4('0x35')]));_0x4cc3a5[_0x7da4('0x34')]=_0x4cc3a5[_0x7da4('0x34')]['length']?_0x4cc3a5['attributes']:_0x33b88c[_0x7da4('0x30')];if(_0x381de4['query'][_0x7da4('0x44')]){_0x4cc3a5[_0x7da4('0x45')]=[{'all':!![]}];}_0x4cc3a5=_[_0x7da4('0x3e')]({},_0x4cc3a5,_0x381de4['options']);return db[_0x7da4('0x2b')][_0x7da4('0x46')](_0x4cc3a5)[_0x7da4('0x24')](handleEntityNotFound(_0x2706e9,null))['then'](respondWithResult(_0x2706e9,null))[_0x7da4('0x47')](handleError(_0x2706e9,null));};exports[_0x7da4('0x48')]=function(_0x1efbc9,_0x892930){return db['SalesforceField'][_0x7da4('0x48')](_0x1efbc9['body'],{})[_0x7da4('0x24')](respondWithResult(_0x892930,0xc9))[_0x7da4('0x47')](handleError(_0x892930,null));};exports[_0x7da4('0x23')]=function(_0x1322a2,_0x2e16af){if(_0x1322a2[_0x7da4('0x49')]['id']){delete _0x1322a2[_0x7da4('0x49')]['id'];}return db[_0x7da4('0x2b')][_0x7da4('0x46')]({'where':{'id':_0x1322a2['params']['id']}})[_0x7da4('0x24')](handleEntityNotFound(_0x2e16af,null))[_0x7da4('0x24')](saveUpdates(_0x1322a2[_0x7da4('0x49')],null))['then'](respondWithResult(_0x2e16af,null))[_0x7da4('0x47')](handleError(_0x2e16af,null));};exports['destroy']=function(_0x310b67,_0x332e9a){return db['SalesforceField'][_0x7da4('0x46')]({'where':{'id':_0x310b67[_0x7da4('0x43')]['id']}})['then'](handleEntityNotFound(_0x332e9a,null))[_0x7da4('0x24')](removeEntity(_0x332e9a,null))[_0x7da4('0x47')](handleError(_0x332e9a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index bfac50b..52940d6 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 _0xd9df=['api','moment','bluebird','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x11360b,_0x5a55aa){var _0x169c46=function(_0x53504e){while(--_0x53504e){_0x11360b['push'](_0x11360b['shift']());}};_0x169c46(++_0x5a55aa);}(_0xd9df,0xd0));var _0xfd9d=function(_0x18d51a,_0x538984){_0x18d51a=_0x18d51a-0x0;var _0x5780bc=_0xd9df[_0x18d51a];return _0x5780bc;};'use strict';var _=require(_0xfd9d('0x0'));var util=require('util');var logger=require(_0xfd9d('0x1'))(_0xfd9d('0x2'));var moment=require(_0xfd9d('0x3'));var BPromise=require(_0xfd9d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfd9d('0x5'));var config=require(_0xfd9d('0x6'));var attributes=require(_0xfd9d('0x7'));module[_0xfd9d('0x8')]=function(_0xa015e5,_0x44a4e9){return _0xa015e5['define'](_0xfd9d('0x9'),attributes,{'tableName':_0xfd9d('0xa'),'paranoid':![],'indexes':[{'name':_0xfd9d('0xb'),'fields':[_0xfd9d('0xc'),_0xfd9d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x84e8=['../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1dfe96,_0xacd7bf){var _0x23bb8a=function(_0x2f9f1a){while(--_0x2f9f1a){_0x1dfe96['push'](_0x1dfe96['shift']());}};_0x23bb8a(++_0xacd7bf);}(_0x84e8,0x1d8));var _0x884e=function(_0x310d47,_0xe27a55){_0x310d47=_0x310d47-0x0;var _0x5d65df=_0x84e8[_0x310d47];return _0x5d65df;};'use strict';var _=require(_0x884e('0x0'));var util=require(_0x884e('0x1'));var logger=require(_0x884e('0x2'))(_0x884e('0x3'));var moment=require(_0x884e('0x4'));var BPromise=require(_0x884e('0x5'));var rp=require(_0x884e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x884e('0x7'));var config=require(_0x884e('0x8'));var attributes=require(_0x884e('0x9'));module[_0x884e('0xa')]=function(_0xde268e,_0x30c32d){return _0xde268e[_0x884e('0xb')]('SalesforceField',attributes,{'tableName':_0x884e('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x884e('0xd'),_0x884e('0xe')],'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 48e98f0..f35cd1e 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 _0x101f=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x508926,_0xa05b4f){var _0x49ab00=function(_0x360b74){while(--_0x360b74){_0x508926['push'](_0x508926['shift']());}};_0x49ab00(++_0xa05b4f);}(_0x101f,0xa3));var _0xf101=function(_0xabe2c0,_0x4c4e5f){_0xabe2c0=_0xabe2c0-0x0;var _0x26791f=_0x101f[_0xabe2c0];return _0x26791f;};'use strict';var _=require(_0xf101('0x0'));var util=require('util');var moment=require(_0xf101('0x1'));var BPromise=require(_0xf101('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf101('0x3'));var db=require(_0xf101('0x4'))['db'];var utils=require(_0xf101('0x5'));var logger=require(_0xf101('0x6'))('rpc');var config=require(_0xf101('0x7'));var jayson=require(_0xf101('0x8'));var client=jayson[_0xf101('0x9')][_0xf101('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ec246,_0x155066,_0x1ab516){return new BPromise(function(_0x38ea4d,_0x3f97d8){return client[_0xf101('0xb')](_0x2ec246,_0x1ab516)[_0xf101('0xc')](function(_0xfdb07d){logger[_0xf101('0xd')](_0xf101('0xe'),_0x155066,'request\x20sent');logger['debug'](_0xf101('0xf'),_0x155066,_0xf101('0x10'),JSON['stringify'](_0xfdb07d));if(_0xfdb07d[_0xf101('0x11')]){if(_0xfdb07d[_0xf101('0x11')][_0xf101('0x12')]===0x1f4){logger['error'](_0xf101('0xe'),_0x155066,_0xfdb07d[_0xf101('0x11')][_0xf101('0x13')]);return _0x3f97d8(_0xfdb07d[_0xf101('0x11')]['message']);}logger[_0xf101('0x11')](_0xf101('0xe'),_0x155066,_0xfdb07d['error']['message']);return _0x38ea4d(_0xfdb07d[_0xf101('0x11')][_0xf101('0x13')]);}else{logger['info'](_0xf101('0xe'),_0x155066,_0xf101('0x10'));_0x38ea4d(_0xfdb07d['result'][_0xf101('0x13')]);}})[_0xf101('0x14')](function(_0x15043d){logger[_0xf101('0x11')]('SalesforceField,\x20%s,\x20%s',_0x155066,_0x15043d);_0x3f97d8(_0x15043d);});});} \ No newline at end of file +var _0x080f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x16b8ac,_0x24c5ef){var _0x2f02bf=function(_0x3e82b9){while(--_0x3e82b9){_0x16b8ac['push'](_0x16b8ac['shift']());}};_0x2f02bf(++_0x24c5ef);}(_0x080f,0x1d6));var _0xf080=function(_0x287195,_0x42c912){_0x287195=_0x287195-0x0;var _0x49a88c=_0x080f[_0x287195];return _0x49a88c;};'use strict';var _=require('lodash');var util=require(_0xf080('0x0'));var moment=require(_0xf080('0x1'));var BPromise=require('bluebird');var rs=require(_0xf080('0x2'));var fs=require('fs');var Redis=require(_0xf080('0x3'));var db=require(_0xf080('0x4'))['db'];var utils=require(_0xf080('0x5'));var logger=require(_0xf080('0x6'))(_0xf080('0x7'));var config=require(_0xf080('0x8'));var jayson=require(_0xf080('0x9'));var client=jayson[_0xf080('0xa')][_0xf080('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16f56b,_0x1937c1,_0x361351){return new BPromise(function(_0x4ae3d9,_0x3036ab){return client[_0xf080('0xc')](_0x16f56b,_0x361351)[_0xf080('0xd')](function(_0xeb8e16){logger[_0xf080('0xe')](_0xf080('0xf'),_0x1937c1,_0xf080('0x10'));logger[_0xf080('0x11')](_0xf080('0x12'),_0x1937c1,_0xf080('0x10'),JSON[_0xf080('0x13')](_0xeb8e16));if(_0xeb8e16[_0xf080('0x14')]){if(_0xeb8e16[_0xf080('0x14')][_0xf080('0x15')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x1937c1,_0xeb8e16[_0xf080('0x14')][_0xf080('0x16')]);return _0x3036ab(_0xeb8e16[_0xf080('0x14')][_0xf080('0x16')]);}logger[_0xf080('0x14')](_0xf080('0xf'),_0x1937c1,_0xeb8e16['error']['message']);return _0x4ae3d9(_0xeb8e16[_0xf080('0x14')][_0xf080('0x16')]);}else{logger[_0xf080('0xe')](_0xf080('0xf'),_0x1937c1,_0xf080('0x10'));_0x4ae3d9(_0xeb8e16[_0xf080('0x17')][_0xf080('0x16')]);}})[_0xf080('0x18')](function(_0x95bb5a){logger[_0xf080('0x14')](_0xf080('0xf'),_0x1937c1,_0x95bb5a);_0x3036ab(_0x95bb5a);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index e1b67e6..5c1bb26 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 _0xdff8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','/:id','isAuthenticated','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','multer','util','path'];(function(_0x22594f,_0x32c4b1){var _0x4a03e8=function(_0x321def){while(--_0x321def){_0x22594f['push'](_0x22594f['shift']());}};_0x4a03e8(++_0x32c4b1);}(_0xdff8,0xc3));var _0x8dff=function(_0x2b950c,_0x57cc37){_0x2b950c=_0x2b950c-0x0;var _0x592648=_0xdff8[_0x2b950c];return _0x592648;};'use strict';var multer=require(_0x8dff('0x0'));var util=require(_0x8dff('0x1'));var path=require(_0x8dff('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8dff('0x3')]();var fs_extra=require(_0x8dff('0x4'));var auth=require(_0x8dff('0x5'));var interaction=require(_0x8dff('0x6'));var config=require(_0x8dff('0x7'));var controller=require(_0x8dff('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8dff('0x9')]);router['get'](_0x8dff('0xa'),auth[_0x8dff('0xb')](),controller['show']);router[_0x8dff('0xc')](_0x8dff('0xd'),auth['isAuthenticated'](),controller[_0x8dff('0xe')]);router['get'](_0x8dff('0xf'),auth[_0x8dff('0xb')](),controller[_0x8dff('0x10')]);router[_0x8dff('0x11')]('/',auth[_0x8dff('0xb')](),controller['create']);router[_0x8dff('0x11')]('/:id/configurations',auth[_0x8dff('0xb')](),controller[_0x8dff('0x12')]);router['put'](_0x8dff('0xa'),auth['isAuthenticated'](),controller[_0x8dff('0x13')]);router[_0x8dff('0x14')](_0x8dff('0xa'),auth[_0x8dff('0xb')](),controller[_0x8dff('0x15')]);module['exports']=router; \ No newline at end of file +var _0x791d=['./intServicenowAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21dc46,_0x29afed){var _0x15ccaf=function(_0x393f02){while(--_0x393f02){_0x21dc46['push'](_0x21dc46['shift']());}};_0x15ccaf(++_0x29afed);}(_0x791d,0x1f4));var _0xd791=function(_0x4ecc32,_0x5eaf99){_0x4ecc32=_0x4ecc32-0x0;var _0x55e72b=_0x791d[_0x4ecc32];return _0x55e72b;};'use strict';var multer=require(_0xd791('0x0'));var util=require(_0xd791('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd791('0x2'));var auth=require(_0xd791('0x3'));var interaction=require(_0xd791('0x4'));var config=require(_0xd791('0x5'));var controller=require(_0xd791('0x6'));router[_0xd791('0x7')]('/',auth['isAuthenticated'](),controller[_0xd791('0x8')]);router[_0xd791('0x7')](_0xd791('0x9'),auth['isAuthenticated'](),controller[_0xd791('0xa')]);router[_0xd791('0x7')](_0xd791('0xb'),auth[_0xd791('0xc')](),controller[_0xd791('0xd')]);router['get'](_0xd791('0xe'),auth[_0xd791('0xc')](),controller[_0xd791('0xf')]);router['post']('/',auth[_0xd791('0xc')](),controller['create']);router[_0xd791('0x10')]('/:id/configurations',auth[_0xd791('0xc')](),controller['addConfiguration']);router[_0xd791('0x11')](_0xd791('0x9'),auth[_0xd791('0xc')](),controller[_0xd791('0x12')]);router[_0xd791('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xd791('0x14')]);module[_0xd791('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f9d97c3..f08706a 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 _0xa9e3=['sequelize','exports','STRING','username','remoteUri'];(function(_0x551b81,_0x1d23b5){var _0xe0b2d6=function(_0x1ee5d9){while(--_0x1ee5d9){_0x551b81['push'](_0x551b81['shift']());}};_0xe0b2d6(++_0x1d23b5);}(_0xa9e3,0x113));var _0x3a9e=function(_0x46e40f,_0x6794d4){_0x46e40f=_0x46e40f-0x0;var _0x3f2663=_0xa9e3[_0x46e40f];return _0x3f2663;};'use strict';var Sequelize=require(_0x3a9e('0x0'));module[_0x3a9e('0x1')]={'name':{'type':Sequelize[_0x3a9e('0x2')]},'description':{'type':Sequelize[_0x3a9e('0x2')]},'username':{'type':Sequelize[_0x3a9e('0x2')],'unique':_0x3a9e('0x3')},'password':{'type':Sequelize[_0x3a9e('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3a9e('0x2')],'unique':_0x3a9e('0x4')},'serverUrl':{'type':Sequelize[_0x3a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe9ad=['STRING','remoteUri','sequelize','exports'];(function(_0x32eaf4,_0x4629b8){var _0x52c5a8=function(_0x1e4dba){while(--_0x1e4dba){_0x32eaf4['push'](_0x32eaf4['shift']());}};_0x52c5a8(++_0x4629b8);}(_0xe9ad,0x126));var _0xde9a=function(_0x3a49ed,_0x5942c0){_0x3a49ed=_0x3a49ed-0x0;var _0xfc681=_0xe9ad[_0x3a49ed];return _0xfc681;};'use strict';var Sequelize=require(_0xde9a('0x0'));module[_0xde9a('0x1')]={'name':{'type':Sequelize[_0xde9a('0x2')]},'description':{'type':Sequelize[_0xde9a('0x2')]},'username':{'type':Sequelize[_0xde9a('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xde9a('0x2')]},'email':{'type':Sequelize[_0xde9a('0x2')]},'remoteUri':{'type':Sequelize[_0xde9a('0x2')],'unique':_0xde9a('0x3')},'serverUrl':{'type':Sequelize[_0xde9a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index b879ad8..9b6f0e0 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 _0x91b6=['filter','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','correlation_id','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','concat','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','findOne','ServicenowConfiguration'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x91b6,0x130));var _0x691b=function(_0xf89dab,_0x3aed37){_0xf89dab=_0xf89dab-0x0;var _0x548c35=_0x91b6[_0xf89dab];return _0x548c35;};'use strict';var emlformat=require(_0x691b('0x0'));var rimraf=require(_0x691b('0x1'));var zipdir=require(_0x691b('0x2'));var jsonpatch=require(_0x691b('0x3'));var rp=require(_0x691b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x691b('0x5'));var util=require(_0x691b('0x6'));var path=require(_0x691b('0x7'));var sox=require(_0x691b('0x8'));var csv=require(_0x691b('0x9'));var ejs=require(_0x691b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x691b('0xb'));var crypto=require(_0x691b('0xc'));var jsforce=require(_0x691b('0xd'));var deskjs=require(_0x691b('0xe'));var toCsv=require(_0x691b('0x9'));var querystring=require(_0x691b('0xf'));var Papa=require(_0x691b('0x10'));var Redis=require(_0x691b('0x11'));var authService=require(_0x691b('0x12'));var qs=require(_0x691b('0x13'));var as=require(_0x691b('0x14'));var hardwareService=require(_0x691b('0x15'));var logger=require(_0x691b('0x16'))(_0x691b('0x17'));var utils=require(_0x691b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x691b('0x19'));var db=require(_0x691b('0x1a'))['db'];var integrations=require(_0x691b('0x1b'));function respondWithStatusCode(_0x1d766e,_0x122e3f){_0x122e3f=_0x122e3f||0xcc;return function(_0x1a912c){if(_0x1a912c){return _0x1d766e[_0x691b('0x1c')](_0x122e3f);}return _0x1d766e[_0x691b('0x1d')](_0x122e3f)[_0x691b('0x1e')]();};}function respondWithResult(_0xbe1117,_0x12d7c7){_0x12d7c7=_0x12d7c7||0xc8;return function(_0x3b48b8){if(_0x3b48b8){return _0xbe1117[_0x691b('0x1d')](_0x12d7c7)['json'](_0x3b48b8);}};}function respondWithFilteredResult(_0x49e0c5,_0x3ee738){return function(_0x214652){if(_0x214652){var _0x58495c=typeof _0x3ee738[_0x691b('0x1f')]===_0x691b('0x20')&&typeof _0x3ee738['limit']==='undefined';var _0x53f940=_0x214652['count'];var _0x507d9d=_0x58495c?0x0:_0x3ee738[_0x691b('0x1f')];var _0x17778f=_0x58495c?_0x214652[_0x691b('0x21')]:_0x3ee738[_0x691b('0x1f')]+_0x3ee738[_0x691b('0x22')];var _0x12709d;if(_0x17778f>=_0x53f940){_0x17778f=_0x53f940;_0x12709d=0xc8;}else{_0x12709d=0xce;}_0x49e0c5['status'](_0x12709d);return _0x49e0c5[_0x691b('0x23')](_0x691b('0x24'),_0x507d9d+'-'+_0x17778f+'/'+_0x53f940)[_0x691b('0x25')](_0x214652);}return null;};}function patchUpdates(_0x5de500){return function(_0x3ec3b5){try{jsonpatch['apply'](_0x3ec3b5,_0x5de500,!![]);}catch(_0x1eb272){return BPromise['reject'](_0x1eb272);}return _0x3ec3b5['save']();};}function saveUpdates(_0x369fd1,_0x1bb741){return function(_0x5ca5ac){if(_0x5ca5ac){return _0x5ca5ac[_0x691b('0x26')](_0x369fd1)[_0x691b('0x27')](function(_0x258bb1){return _0x258bb1;});}return null;};}function removeEntity(_0xa0e35a,_0x4107d6){return function(_0x3103d8){if(_0x3103d8){return _0x3103d8[_0x691b('0x28')]()[_0x691b('0x27')](function(){_0xa0e35a[_0x691b('0x1d')](0xcc)[_0x691b('0x1e')]();});}};}function handleEntityNotFound(_0x2d782f,_0x4183d2){return function(_0x578cda){if(!_0x578cda){_0x2d782f['sendStatus'](0x194);}return _0x578cda;};}function handleError(_0x28210f,_0x5018cc){_0x5018cc=_0x5018cc||0x1f4;return function(_0x1ef755){logger[_0x691b('0x29')](_0x1ef755['stack']);if(_0x1ef755[_0x691b('0x2a')]){delete _0x1ef755[_0x691b('0x2a')];}_0x28210f[_0x691b('0x1d')](_0x5018cc)[_0x691b('0x2b')](_0x1ef755);};}exports[_0x691b('0x2c')]=function(_0x40369b,_0x2ff5f1){var _0x4cb177={},_0xe7d9f8={},_0x551313={'count':0x0,'rows':[]};var _0xe7b98a=_[_0x691b('0x2d')](db[_0x691b('0x2e')][_0x691b('0x2f')],function(_0x523ff7){return{'name':_0x523ff7[_0x691b('0x30')],'type':_0x523ff7['type'][_0x691b('0x31')]};});_0xe7d9f8['model']=_[_0x691b('0x2d')](_0xe7b98a,_0x691b('0x2a'));_0xe7d9f8['query']=_['keys'](_0x40369b['query']);_0xe7d9f8['filters']=_['intersection'](_0xe7d9f8['model'],_0xe7d9f8[_0x691b('0x32')]);_0x4cb177[_0x691b('0x33')]=_[_0x691b('0x34')](_0xe7d9f8[_0x691b('0x35')],qs['fields'](_0x40369b['query'][_0x691b('0x36')]));_0x4cb177[_0x691b('0x33')]=_0x4cb177[_0x691b('0x33')][_0x691b('0x37')]?_0x4cb177[_0x691b('0x33')]:_0xe7d9f8['model'];if(!_0x40369b[_0x691b('0x32')][_0x691b('0x38')](_0x691b('0x39'))){_0x4cb177['limit']=qs[_0x691b('0x22')](_0x40369b[_0x691b('0x32')][_0x691b('0x22')]);_0x4cb177[_0x691b('0x1f')]=qs[_0x691b('0x1f')](_0x40369b[_0x691b('0x32')][_0x691b('0x1f')]);}_0x4cb177[_0x691b('0x3a')]=qs[_0x691b('0x3b')](_0x40369b[_0x691b('0x32')]['sort']);_0x4cb177[_0x691b('0x3c')]=qs[_0x691b('0x3d')](_[_0x691b('0x3e')](_0x40369b[_0x691b('0x32')],_0xe7d9f8[_0x691b('0x3d')]),_0xe7b98a);if(_0x40369b[_0x691b('0x32')]['filter']){_0x4cb177[_0x691b('0x3c')]=_[_0x691b('0x3f')](_0x4cb177[_0x691b('0x3c')],{'$or':_['map'](_0xe7b98a,function(_0x211442){if(_0x211442['type']!==_0x691b('0x40')){var _0xe4bde3={};_0xe4bde3[_0x211442[_0x691b('0x2a')]]={'$like':'%'+_0x40369b['query']['filter']+'%'};return _0xe4bde3;}})});}_0x4cb177=_[_0x691b('0x3f')]({},_0x4cb177,_0x40369b[_0x691b('0x41')]);var _0x2853da={'where':_0x4cb177['where']};return db['ServicenowAccount']['count'](_0x2853da)['then'](function(_0x46e767){_0x551313[_0x691b('0x21')]=_0x46e767;if(_0x40369b[_0x691b('0x32')][_0x691b('0x42')]){_0x4cb177['include']=[{'all':!![]}];}return db[_0x691b('0x2e')][_0x691b('0x43')](_0x4cb177);})[_0x691b('0x27')](function(_0xd0075f){_0x551313[_0x691b('0x44')]=_0xd0075f;return _0x551313;})[_0x691b('0x27')](respondWithFilteredResult(_0x2ff5f1,_0x4cb177))[_0x691b('0x45')](handleError(_0x2ff5f1,null));};exports[_0x691b('0x46')]=function(_0x5f5408,_0x44cbd2){var _0x101ec2={'raw':![],'where':{'id':_0x5f5408[_0x691b('0x47')]['id']}},_0xdc3ba={};_0xdc3ba['model']=_[_0x691b('0x48')](db[_0x691b('0x2e')][_0x691b('0x2f')]);_0xdc3ba[_0x691b('0x32')]=_['keys'](_0x5f5408[_0x691b('0x32')]);_0xdc3ba[_0x691b('0x3d')]=_[_0x691b('0x34')](_0xdc3ba[_0x691b('0x35')],_0xdc3ba['query']);_0x101ec2[_0x691b('0x33')]=_['intersection'](_0xdc3ba[_0x691b('0x35')],qs[_0x691b('0x36')](_0x5f5408['query']['fields']));_0x101ec2['attributes']=_0x101ec2['attributes']['length']?_0x101ec2['attributes']:_0xdc3ba[_0x691b('0x35')];if(_0x5f5408[_0x691b('0x32')][_0x691b('0x42')]){_0x101ec2['include']=[{'all':!![]}];}_0x101ec2=_[_0x691b('0x3f')]({},_0x101ec2,_0x5f5408[_0x691b('0x41')]);return db[_0x691b('0x2e')][_0x691b('0x49')](_0x101ec2)[_0x691b('0x27')](handleEntityNotFound(_0x44cbd2,null))[_0x691b('0x27')](respondWithResult(_0x44cbd2,null))[_0x691b('0x45')](handleError(_0x44cbd2,null));};exports[_0x691b('0x4a')]=function(_0x332f74,_0x4f3831){return db[_0x691b('0x2e')][_0x691b('0x4a')](_0x332f74[_0x691b('0x4b')],{})[_0x691b('0x27')](respondWithResult(_0x4f3831,0xc9))[_0x691b('0x45')](handleError(_0x4f3831,null));};exports[_0x691b('0x26')]=function(_0x16ecf,_0x5a01f7){if(_0x16ecf[_0x691b('0x4b')]['id']){delete _0x16ecf[_0x691b('0x4b')]['id'];}return db[_0x691b('0x2e')][_0x691b('0x49')]({'where':{'id':_0x16ecf['params']['id']}})[_0x691b('0x27')](handleEntityNotFound(_0x5a01f7,null))[_0x691b('0x27')](saveUpdates(_0x16ecf['body'],null))[_0x691b('0x27')](respondWithResult(_0x5a01f7,null))[_0x691b('0x45')](handleError(_0x5a01f7,null));};exports[_0x691b('0x28')]=function(_0x3d0f37,_0x1df423){return db[_0x691b('0x2e')][_0x691b('0x49')]({'where':{'id':_0x3d0f37[_0x691b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1df423,null))[_0x691b('0x27')](removeEntity(_0x1df423,null))[_0x691b('0x45')](handleError(_0x1df423,null));};exports['getConfigurations']=function(_0x21ba6a,_0x54db37,_0x37da0a){var _0x12eab5={};var _0x57ed01={};var _0x1b3c21;var _0x5e1b78;return db[_0x691b('0x2e')][_0x691b('0x4c')]({'where':{'id':_0x21ba6a[_0x691b('0x47')]['id']}})['then'](handleEntityNotFound(_0x54db37,null))['then'](function(_0x50785f){if(_0x50785f){_0x1b3c21=_0x50785f;_0x57ed01['model']=_[_0x691b('0x48')](db[_0x691b('0x4d')][_0x691b('0x2f')]);_0x57ed01[_0x691b('0x32')]=_['keys'](_0x21ba6a[_0x691b('0x32')]);_0x57ed01[_0x691b('0x3d')]=_[_0x691b('0x34')](_0x57ed01['model'],_0x57ed01['query']);_0x12eab5[_0x691b('0x33')]=_[_0x691b('0x34')](_0x57ed01[_0x691b('0x35')],qs[_0x691b('0x36')](_0x21ba6a[_0x691b('0x32')][_0x691b('0x36')]));_0x12eab5[_0x691b('0x33')]=_0x12eab5[_0x691b('0x33')][_0x691b('0x37')]?_0x12eab5[_0x691b('0x33')]:_0x57ed01['model'];_0x12eab5[_0x691b('0x3a')]=qs[_0x691b('0x3b')](_0x21ba6a['query']['sort']);_0x12eab5['where']=qs['filters'](_['pick'](_0x21ba6a['query'],_0x57ed01[_0x691b('0x3d')]));if(_0x21ba6a[_0x691b('0x32')][_0x691b('0x4e')]){_0x12eab5[_0x691b('0x3c')]=_[_0x691b('0x3f')](_0x12eab5[_0x691b('0x3c')],{'$or':_[_0x691b('0x2d')](_0x12eab5[_0x691b('0x33')],function(_0x54f10b){var _0x2940a8={};_0x2940a8[_0x54f10b]={'$like':'%'+_0x21ba6a[_0x691b('0x32')][_0x691b('0x4e')]+'%'};return _0x2940a8;})});}_0x12eab5=_[_0x691b('0x3f')]({},_0x12eab5,_0x21ba6a[_0x691b('0x41')]);return _0x1b3c21[_0x691b('0x4f')](_0x12eab5);}})[_0x691b('0x27')](function(_0x523176){if(_0x523176){_0x5e1b78=_0x523176[_0x691b('0x37')];if(!_0x21ba6a['query']['hasOwnProperty'](_0x691b('0x39'))){_0x12eab5[_0x691b('0x22')]=qs['limit'](_0x21ba6a[_0x691b('0x32')][_0x691b('0x22')]);_0x12eab5[_0x691b('0x1f')]=qs[_0x691b('0x1f')](_0x21ba6a[_0x691b('0x32')][_0x691b('0x1f')]);}return _0x1b3c21[_0x691b('0x4f')](_0x12eab5);}})[_0x691b('0x27')](function(_0x2d28f8){if(_0x2d28f8){return _0x2d28f8?{'count':_0x5e1b78,'rows':_0x2d28f8}:null;}})[_0x691b('0x27')](respondWithResult(_0x54db37,null))[_0x691b('0x45')](handleError(_0x54db37,null));};exports[_0x691b('0x50')]=function(_0x1ad1b4,_0x28de99,_0x4e14dd){if(_0x1ad1b4[_0x691b('0x4b')]['id']){delete _0x1ad1b4[_0x691b('0x4b')]['id'];}return db[_0x691b('0x2e')][_0x691b('0x4c')]({'where':{'id':_0x1ad1b4['params']['id']}})[_0x691b('0x27')](handleEntityNotFound(_0x28de99,null))[_0x691b('0x27')](function(_0x4d9620){if(_0x4d9620){_0x1ad1b4['body'][_0x691b('0x51')]=_0x4d9620['id'];_0x1ad1b4[_0x691b('0x4b')][_0x691b('0x52')]=integrations[_0x691b('0x53')](_0x1ad1b4['body'][_0x691b('0x54')],_0x1ad1b4[_0x691b('0x4b')][_0x691b('0x55')]);_0x1ad1b4[_0x691b('0x4b')][_0x691b('0x56')]=integrations[_0x691b('0x57')](_0x1ad1b4['body']['channel'],_0x1ad1b4[_0x691b('0x4b')][_0x691b('0x55')]);return db[_0x691b('0x4d')][_0x691b('0x4a')](_0x1ad1b4[_0x691b('0x4b')],{'include':[{'model':db[_0x691b('0x58')],'as':_0x691b('0x52')},{'model':db[_0x691b('0x58')],'as':_0x691b('0x56')}]});}return null;})[_0x691b('0x27')](respondWithResult(_0x28de99,null))[_0x691b('0x45')](handleError(_0x28de99,null));};exports[_0x691b('0x59')]=function(_0x2ad481,_0x21e65a,_0x1889f3){var _0x2049b=[_0x691b('0x5a'),_0x691b('0x5b'),'knowledge',_0x691b('0x5c'),_0x691b('0x5d'),_0x691b('0x5e'),_0x691b('0x5f'),_0x691b('0x60'),_0x691b('0x61')];var _0x537748=[_0x691b('0x62'),_0x691b('0x5a'),'caused_by',_0x691b('0x63'),_0x691b('0x64'),_0x691b('0x65'),_0x691b('0x66'),'hold_reason',_0x691b('0x67'),_0x691b('0x68'),_0x691b('0x69'),_0x691b('0x6a'),_0x691b('0x6b'),'user_input',_0x691b('0x6c'),_0x691b('0x6d'),_0x691b('0x6e'),_0x691b('0x6f'),_0x691b('0x70'),_0x691b('0x3a'),_0x691b('0x71'),_0x691b('0x72'),_0x691b('0x73'),'delivery_plan',_0x691b('0x74'),_0x691b('0x75'),_0x691b('0x76'),_0x691b('0x77'),_0x691b('0x78'),_0x691b('0x79'),_0x691b('0x7a'),_0x691b('0x7b'),_0x691b('0x7c'),_0x691b('0x7d'),_0x691b('0x7e'),_0x691b('0x7f'),_0x691b('0x80'),_0x691b('0x81'),_0x691b('0x82'),_0x691b('0x83'),_0x691b('0x84'),'subcategory',_0x691b('0x85'),_0x691b('0x86'),_0x691b('0x5d'),_0x691b('0x87'),_0x691b('0x88'),'work_start',_0x691b('0x89'),_0x691b('0x8a'),_0x691b('0x8b'),_0x691b('0x8c'),_0x691b('0x8d'),_0x691b('0x5e'),_0x691b('0x8e'),_0x691b('0x8f'),_0x691b('0x90'),'follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency',_0x691b('0x91'),_0x691b('0x92'),_0x691b('0x93'),_0x691b('0x94'),_0x691b('0x95'),_0x691b('0x60'),_0x691b('0x96'),_0x691b('0x97'),'approval',_0x691b('0x98'),_0x691b('0x99'),_0x691b('0x9a'),_0x691b('0x9b'),'sys_tags',_0x691b('0x9c'),'upon_approval',_0x691b('0x9d'),'location',_0x691b('0x61')];var _0x588c45='';var _0x453f6c='';var _0x17e2ee=[];var _0x2bbe89='';var _0x946bac='';var _0x1afbb6=[];var _0x4466d8='';var _0x3a17ae='';var _0x169144={};var _0x2b8086='';return db[_0x691b('0x2e')][_0x691b('0x4c')]({'where':{'id':_0x2ad481[_0x691b('0x47')]['id']},'attributes':['id','username','password',_0x691b('0x9e'),_0x691b('0x9f'),_0x691b('0xa0')]})[_0x691b('0x27')](handleEntityNotFound(_0x21e65a,null))[_0x691b('0x27')](function(_0x58d71e){if(_0x58d71e){_0x2b8086=_0x58d71e[_0x691b('0x9f')];var _0x557db7=_0x2b8086[_0x691b('0xa1')](-0x1);if(_0x557db7==='/'){_0x2b8086=_0x2b8086['substring'](0x0,_0x2b8086[_0x691b('0xa2')](_0x557db7));}_0x3a17ae=util[_0x691b('0xa3')](_0x691b('0xa4'),_0x2b8086);_0x4466d8=util[_0x691b('0xa3')]('%s/api/now/table/',_0x2b8086);_0x169144={'user':_0x58d71e[_0x691b('0xa5')],'pass':_0x58d71e['password']};var _0x5a0d23={'method':_0x691b('0xa6'),'uri':_0x3a17ae+_0x691b('0xa7'),'auth':_0x169144,'json':!![]};return rp(_0x5a0d23);}})[_0x691b('0x27')](function(_0xa59fb8){if(_0xa59fb8['result'][_0x691b('0x37')]>0x0){_0x588c45=_0xa59fb8[_0x691b('0xa8')];}console[_0x691b('0xa9')](_0x691b('0xaa'),_0x588c45);_0x1afbb6=[];_0x453f6c=Object['assign']([],_0x588c45);_[_0x691b('0xab')](_0x453f6c,function(_0x58abe5){return!_0x2049b[_0x691b('0xac')](_0x58abe5[_0x691b('0x2a')]);});_0x453f6c[_0x691b('0xad')](function(_0x5cce21){var _0x253e87=createFieldObject(_0x4466d8,_0x169144,_0x5cce21[_0x691b('0xae')],_0x5cce21[_0x691b('0x2a')],_0x5cce21[_0x691b('0xaf')],![]);_0x1afbb6[_0x691b('0xb0')](_0x253e87);});return Promise['all'](_0x1afbb6);})[_0x691b('0x27')](function(_0x12857f){_0x17e2ee=_0x12857f;_0x2bbe89=Object['assign']([],_0x588c45);console['log']('TCL:\x20_object',_0x588c45);_[_0x691b('0xab')](_0x2bbe89,function(_0x1a671d){return _0x537748['includes'](_0x1a671d[_0x691b('0x2a')]);});console[_0x691b('0xa9')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2bbe89);_0x1afbb6=[];_0x2bbe89[_0x691b('0xad')](function(_0x689573){var _0x567f67=createFieldObject(_0x4466d8,_0x169144,_0x689573[_0x691b('0xae')],_0x689573[_0x691b('0x2a')],_0x689573['label'],!![]);_0x1afbb6[_0x691b('0xb0')](_0x567f67);});return Promise[_0x691b('0xb1')](_0x1afbb6);})[_0x691b('0x27')](function(_0x188c46){_0x946bac=_0x188c46;var _0x46cbf4=_0x17e2ee[_0x691b('0xb2')](_0x946bac);return{'count':_0x46cbf4[_0x691b('0x37')],'rows':_0x46cbf4};})[_0x691b('0x27')](respondWithResult(_0x21e65a,null))[_0x691b('0x45')](function(_0x1e9965){console[_0x691b('0xa9')](_0x691b('0xb3')+_0x1e9965);var _0x2e4852=_0x2ad481[_0x691b('0x32')][_0x691b('0xb4')]?0x1f4:_0x1e9965['statusCode']||0x1f4;logger[_0x691b('0x29')](_0x1e9965[_0x691b('0xb5')]);delete _0x1e9965['name'];if(_0x2e4852===0x191){_0x2e4852=0x190;}_0x21e65a['status'](_0x2e4852)[_0x691b('0x2b')](_0x2ad481[_0x691b('0x32')][_0x691b('0xb4')]?{'message':_0x691b('0xb6'),'statusCode':_0x1e9965[_0x691b('0xb7')]}:_0x1e9965);});};function createFieldObject(_0x578a6c,_0x403a14,_0x4975de,_0x297f2f,_0x3523be,_0x54823b){return new Promise(function(_0x589712,_0x5bf14b){var _0x2c16ba={'id':_0x297f2f,'name':_0x3523be,'custom':_0x54823b};if(_0x4975de===_0x691b('0xb8')){_0x2c16ba[_0x691b('0x41')]=[{'name':_0x691b('0xb9'),'value':_0x691b('0xba')},{'name':_0x691b('0xbb'),'value':_0x691b('0xbc')}];_0x589712(_0x2c16ba);}else{var _0x4f9744={'method':_0x691b('0xa6'),'uri':_0x578a6c+_0x691b('0xbd')+_0x297f2f,'auth':_0x403a14,'json':!![]};return rp(_0x4f9744)[_0x691b('0x27')](function(_0x2b1d92){var _0x169a2d=[];if(_0x2b1d92[_0x691b('0xa8')][_0x691b('0x37')]>0x0){_0x2b1d92[_0x691b('0xa8')][_0x691b('0xad')](function(_0x5a0853){if(_0x5a0853[_0x691b('0xbe')]===_0x691b('0xbc')){var _0x3d5f75={'name':_0x5a0853[_0x691b('0xaf')],'value':_0x5a0853['value']};_0x169a2d[_0x691b('0xb0')](_0x3d5f75);}});}_0x2c16ba[_0x691b('0x41')]=_0x169a2d;if(_0x2c16ba[_0x691b('0x41')][_0x691b('0x37')]>0x0){_0x589712(_0x2c16ba);}else{if(_0x54823b==![]){_0x589712();}else{_0x589712(_0x2c16ba);}}});}});} \ No newline at end of file +var _0x33c6=['save','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','show','params','length','options','find','create','body','catch','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','subcategory','close_code','severity','category','parent','made_sla','watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','notify','sys_class_name','close_notes','follow_up','contact_type','reopened_by','incident_state','company','reassignment_count','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','serverUrl','remoteUri','slice','substring','%s/api/now/doc/table/schema/','format','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','eml-format','mustache','util','path','to-csv','fs-extra','lodash','crypto','querystring','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','offset','undefined','limit','count','set','json','apply','reject'];(function(_0x239915,_0x428ab8){var _0x3d0cb9=function(_0x31f768){while(--_0x31f768){_0x239915['push'](_0x239915['shift']());}};_0x3d0cb9(++_0x428ab8);}(_0x33c6,0x97));var _0x633c=function(_0x5e0866,_0x1ded2d){_0x5e0866=_0x5e0866-0x0;var _0x3f62e1=_0x33c6[_0x5e0866];return _0x3f62e1;};'use strict';var emlformat=require(_0x633c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x633c('0x1'));var util=require(_0x633c('0x2'));var path=require(_0x633c('0x3'));var sox=require('sox');var csv=require(_0x633c('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x633c('0x5'));var _=require(_0x633c('0x6'));var squel=require('squel');var crypto=require(_0x633c('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x633c('0x4'));var querystring=require(_0x633c('0x8'));var Papa=require(_0x633c('0x9'));var Redis=require(_0x633c('0xa'));var authService=require(_0x633c('0xb'));var qs=require(_0x633c('0xc'));var as=require(_0x633c('0xd'));var hardwareService=require(_0x633c('0xe'));var logger=require(_0x633c('0xf'))('api');var utils=require(_0x633c('0x10'));var config=require(_0x633c('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x633c('0x12'))['db'];var integrations=require(_0x633c('0x13'));function respondWithStatusCode(_0x16ae4f,_0x4898d9){_0x4898d9=_0x4898d9||0xcc;return function(_0x533a37){if(_0x533a37){return _0x16ae4f[_0x633c('0x14')](_0x4898d9);}return _0x16ae4f[_0x633c('0x15')](_0x4898d9)['end']();};}function respondWithResult(_0x1941a2,_0x50b267){_0x50b267=_0x50b267||0xc8;return function(_0x1e5e49){if(_0x1e5e49){return _0x1941a2[_0x633c('0x15')](_0x50b267)['json'](_0x1e5e49);}};}function respondWithFilteredResult(_0x34792e,_0x45c85b){return function(_0x51849f){if(_0x51849f){var _0x2e9278=typeof _0x45c85b[_0x633c('0x16')]===_0x633c('0x17')&&typeof _0x45c85b[_0x633c('0x18')]===_0x633c('0x17');var _0x5aaf03=_0x51849f[_0x633c('0x19')];var _0x2e9e84=_0x2e9278?0x0:_0x45c85b[_0x633c('0x16')];var _0x976aac=_0x2e9278?_0x51849f['count']:_0x45c85b['offset']+_0x45c85b[_0x633c('0x18')];var _0x505884;if(_0x976aac>=_0x5aaf03){_0x976aac=_0x5aaf03;_0x505884=0xc8;}else{_0x505884=0xce;}_0x34792e[_0x633c('0x15')](_0x505884);return _0x34792e[_0x633c('0x1a')]('Content-Range',_0x2e9e84+'-'+_0x976aac+'/'+_0x5aaf03)[_0x633c('0x1b')](_0x51849f);}return null;};}function patchUpdates(_0x301d63){return function(_0x577ced){try{jsonpatch[_0x633c('0x1c')](_0x577ced,_0x301d63,!![]);}catch(_0x2ba072){return BPromise[_0x633c('0x1d')](_0x2ba072);}return _0x577ced[_0x633c('0x1e')]();};}function saveUpdates(_0x5ad1e0,_0x5c7ac5){return function(_0x497c4f){if(_0x497c4f){return _0x497c4f['update'](_0x5ad1e0)['then'](function(_0x3d286e){return _0x3d286e;});}return null;};}function removeEntity(_0x4fa115,_0x26f89a){return function(_0x1920b0){if(_0x1920b0){return _0x1920b0[_0x633c('0x1f')]()['then'](function(){_0x4fa115[_0x633c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a7965,_0x1eb323){return function(_0xcc802a){if(!_0xcc802a){_0x2a7965[_0x633c('0x14')](0x194);}return _0xcc802a;};}function handleError(_0x147dae,_0x2a3f8d){_0x2a3f8d=_0x2a3f8d||0x1f4;return function(_0x3d9778){logger[_0x633c('0x20')](_0x3d9778[_0x633c('0x21')]);if(_0x3d9778[_0x633c('0x22')]){delete _0x3d9778[_0x633c('0x22')];}_0x147dae[_0x633c('0x15')](_0x2a3f8d)[_0x633c('0x23')](_0x3d9778);};}exports[_0x633c('0x24')]=function(_0x2ab849,_0x562693){var _0x300955={},_0x1a5666={},_0x204ffc={'count':0x0,'rows':[]};var _0x3886f6=_[_0x633c('0x25')](db[_0x633c('0x26')][_0x633c('0x27')],function(_0x13232f){return{'name':_0x13232f[_0x633c('0x28')],'type':_0x13232f[_0x633c('0x29')]['key']};});_0x1a5666['model']=_[_0x633c('0x25')](_0x3886f6,_0x633c('0x22'));_0x1a5666['query']=_[_0x633c('0x2a')](_0x2ab849[_0x633c('0x2b')]);_0x1a5666['filters']=_[_0x633c('0x2c')](_0x1a5666[_0x633c('0x2d')],_0x1a5666[_0x633c('0x2b')]);_0x300955['attributes']=_[_0x633c('0x2c')](_0x1a5666[_0x633c('0x2d')],qs['fields'](_0x2ab849[_0x633c('0x2b')][_0x633c('0x2e')]));_0x300955[_0x633c('0x2f')]=_0x300955['attributes']['length']?_0x300955['attributes']:_0x1a5666['model'];if(!_0x2ab849[_0x633c('0x2b')][_0x633c('0x30')](_0x633c('0x31'))){_0x300955[_0x633c('0x18')]=qs[_0x633c('0x18')](_0x2ab849[_0x633c('0x2b')][_0x633c('0x18')]);_0x300955[_0x633c('0x16')]=qs[_0x633c('0x16')](_0x2ab849[_0x633c('0x2b')]['offset']);}_0x300955[_0x633c('0x32')]=qs['sort'](_0x2ab849['query'][_0x633c('0x33')]);_0x300955['where']=qs['filters'](_[_0x633c('0x34')](_0x2ab849[_0x633c('0x2b')],_0x1a5666[_0x633c('0x35')]),_0x3886f6);if(_0x2ab849[_0x633c('0x2b')][_0x633c('0x36')]){_0x300955[_0x633c('0x37')]=_[_0x633c('0x38')](_0x300955[_0x633c('0x37')],{'$or':_[_0x633c('0x25')](_0x3886f6,function(_0x310fc8){if(_0x310fc8[_0x633c('0x29')]!==_0x633c('0x39')){var _0x11eae3={};_0x11eae3[_0x310fc8[_0x633c('0x22')]]={'$like':'%'+_0x2ab849[_0x633c('0x2b')]['filter']+'%'};return _0x11eae3;}})});}_0x300955=_[_0x633c('0x38')]({},_0x300955,_0x2ab849['options']);var _0x364712={'where':_0x300955[_0x633c('0x37')]};return db['ServicenowAccount']['count'](_0x364712)[_0x633c('0x3a')](function(_0xfb3312){_0x204ffc[_0x633c('0x19')]=_0xfb3312;if(_0x2ab849[_0x633c('0x2b')][_0x633c('0x3b')]){_0x300955[_0x633c('0x3c')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x633c('0x3d')](_0x300955);})[_0x633c('0x3a')](function(_0x4fca44){_0x204ffc[_0x633c('0x3e')]=_0x4fca44;return _0x204ffc;})[_0x633c('0x3a')](respondWithFilteredResult(_0x562693,_0x300955))['catch'](handleError(_0x562693,null));};exports[_0x633c('0x3f')]=function(_0x39c0a7,_0x34d4d2){var _0x56f06b={'raw':![],'where':{'id':_0x39c0a7[_0x633c('0x40')]['id']}},_0x25a855={};_0x25a855['model']=_[_0x633c('0x2a')](db[_0x633c('0x26')][_0x633c('0x27')]);_0x25a855['query']=_[_0x633c('0x2a')](_0x39c0a7[_0x633c('0x2b')]);_0x25a855[_0x633c('0x35')]=_[_0x633c('0x2c')](_0x25a855['model'],_0x25a855[_0x633c('0x2b')]);_0x56f06b[_0x633c('0x2f')]=_[_0x633c('0x2c')](_0x25a855[_0x633c('0x2d')],qs[_0x633c('0x2e')](_0x39c0a7['query']['fields']));_0x56f06b['attributes']=_0x56f06b[_0x633c('0x2f')][_0x633c('0x41')]?_0x56f06b['attributes']:_0x25a855['model'];if(_0x39c0a7[_0x633c('0x2b')][_0x633c('0x3b')]){_0x56f06b[_0x633c('0x3c')]=[{'all':!![]}];}_0x56f06b=_[_0x633c('0x38')]({},_0x56f06b,_0x39c0a7[_0x633c('0x42')]);return db[_0x633c('0x26')][_0x633c('0x43')](_0x56f06b)['then'](handleEntityNotFound(_0x34d4d2,null))[_0x633c('0x3a')](respondWithResult(_0x34d4d2,null))['catch'](handleError(_0x34d4d2,null));};exports[_0x633c('0x44')]=function(_0x540c99,_0x47dc86){return db['ServicenowAccount'][_0x633c('0x44')](_0x540c99[_0x633c('0x45')],{})['then'](respondWithResult(_0x47dc86,0xc9))[_0x633c('0x46')](handleError(_0x47dc86,null));};exports['update']=function(_0x189029,_0x1498e0){if(_0x189029[_0x633c('0x45')]['id']){delete _0x189029[_0x633c('0x45')]['id'];}return db[_0x633c('0x26')][_0x633c('0x43')]({'where':{'id':_0x189029[_0x633c('0x40')]['id']}})['then'](handleEntityNotFound(_0x1498e0,null))[_0x633c('0x3a')](saveUpdates(_0x189029[_0x633c('0x45')],null))[_0x633c('0x3a')](respondWithResult(_0x1498e0,null))[_0x633c('0x46')](handleError(_0x1498e0,null));};exports[_0x633c('0x1f')]=function(_0x4338ce,_0x49da15){return db[_0x633c('0x26')][_0x633c('0x43')]({'where':{'id':_0x4338ce[_0x633c('0x40')]['id']}})['then'](handleEntityNotFound(_0x49da15,null))['then'](removeEntity(_0x49da15,null))[_0x633c('0x46')](handleError(_0x49da15,null));};exports[_0x633c('0x47')]=function(_0x1cc1d5,_0x14b31e,_0x25bf17){var _0x11e8ba={};var _0xcd622e={};var _0x3ed040;var _0x346a45;return db[_0x633c('0x26')][_0x633c('0x48')]({'where':{'id':_0x1cc1d5[_0x633c('0x40')]['id']}})[_0x633c('0x3a')](handleEntityNotFound(_0x14b31e,null))[_0x633c('0x3a')](function(_0x333577){if(_0x333577){_0x3ed040=_0x333577;_0xcd622e[_0x633c('0x2d')]=_['keys'](db['ServicenowConfiguration'][_0x633c('0x27')]);_0xcd622e[_0x633c('0x2b')]=_[_0x633c('0x2a')](_0x1cc1d5[_0x633c('0x2b')]);_0xcd622e[_0x633c('0x35')]=_[_0x633c('0x2c')](_0xcd622e[_0x633c('0x2d')],_0xcd622e['query']);_0x11e8ba[_0x633c('0x2f')]=_[_0x633c('0x2c')](_0xcd622e[_0x633c('0x2d')],qs[_0x633c('0x2e')](_0x1cc1d5[_0x633c('0x2b')][_0x633c('0x2e')]));_0x11e8ba[_0x633c('0x2f')]=_0x11e8ba['attributes']['length']?_0x11e8ba[_0x633c('0x2f')]:_0xcd622e['model'];_0x11e8ba[_0x633c('0x32')]=qs['sort'](_0x1cc1d5[_0x633c('0x2b')][_0x633c('0x33')]);_0x11e8ba[_0x633c('0x37')]=qs[_0x633c('0x35')](_[_0x633c('0x34')](_0x1cc1d5[_0x633c('0x2b')],_0xcd622e[_0x633c('0x35')]));if(_0x1cc1d5[_0x633c('0x2b')]['filter']){_0x11e8ba[_0x633c('0x37')]=_['merge'](_0x11e8ba[_0x633c('0x37')],{'$or':_[_0x633c('0x25')](_0x11e8ba[_0x633c('0x2f')],function(_0x208040){var _0x212c29={};_0x212c29[_0x208040]={'$like':'%'+_0x1cc1d5[_0x633c('0x2b')][_0x633c('0x36')]+'%'};return _0x212c29;})});}_0x11e8ba=_[_0x633c('0x38')]({},_0x11e8ba,_0x1cc1d5[_0x633c('0x42')]);return _0x3ed040[_0x633c('0x47')](_0x11e8ba);}})['then'](function(_0x31b711){if(_0x31b711){_0x346a45=_0x31b711['length'];if(!_0x1cc1d5[_0x633c('0x2b')][_0x633c('0x30')]('nolimit')){_0x11e8ba[_0x633c('0x18')]=qs[_0x633c('0x18')](_0x1cc1d5[_0x633c('0x2b')]['limit']);_0x11e8ba[_0x633c('0x16')]=qs[_0x633c('0x16')](_0x1cc1d5[_0x633c('0x2b')][_0x633c('0x16')]);}return _0x3ed040['getConfigurations'](_0x11e8ba);}})[_0x633c('0x3a')](function(_0x5afc44){if(_0x5afc44){return _0x5afc44?{'count':_0x346a45,'rows':_0x5afc44}:null;}})[_0x633c('0x3a')](respondWithResult(_0x14b31e,null))[_0x633c('0x46')](handleError(_0x14b31e,null));};exports[_0x633c('0x49')]=function(_0x4f3ec,_0x4f78ea,_0x38c948){if(_0x4f3ec[_0x633c('0x45')]['id']){delete _0x4f3ec['body']['id'];}return db[_0x633c('0x26')][_0x633c('0x48')]({'where':{'id':_0x4f3ec[_0x633c('0x40')]['id']}})[_0x633c('0x3a')](handleEntityNotFound(_0x4f78ea,null))[_0x633c('0x3a')](function(_0x362fb0){if(_0x362fb0){_0x4f3ec[_0x633c('0x45')][_0x633c('0x4a')]=_0x362fb0['id'];_0x4f3ec[_0x633c('0x45')][_0x633c('0x4b')]=integrations[_0x633c('0x4c')](_0x4f3ec[_0x633c('0x45')][_0x633c('0x4d')],_0x4f3ec[_0x633c('0x45')][_0x633c('0x29')]);_0x4f3ec[_0x633c('0x45')][_0x633c('0x4e')]=integrations[_0x633c('0x4f')](_0x4f3ec['body'][_0x633c('0x4d')],_0x4f3ec[_0x633c('0x45')][_0x633c('0x29')]);return db['ServicenowConfiguration'][_0x633c('0x44')](_0x4f3ec[_0x633c('0x45')],{'include':[{'model':db['ServicenowField'],'as':_0x633c('0x4b')},{'model':db[_0x633c('0x50')],'as':_0x633c('0x4e')}]});}return null;})[_0x633c('0x3a')](respondWithResult(_0x4f78ea,null))[_0x633c('0x46')](handleError(_0x4f78ea,null));};exports[_0x633c('0x51')]=function(_0x10a889,_0x5b2b3b,_0x1421f7){var _0x27eecd=['made_sla','hold_reason',_0x633c('0x52'),_0x633c('0x53'),_0x633c('0x54'),'notify','incident_state',_0x633c('0x55'),_0x633c('0x56')];var _0x3213c7=[_0x633c('0x57'),_0x633c('0x58'),'caused_by',_0x633c('0x59'),_0x633c('0x5a'),_0x633c('0x5b'),'child_incidents',_0x633c('0x5c'),_0x633c('0x5d'),_0x633c('0x5e'),_0x633c('0x5f'),_0x633c('0x60'),_0x633c('0x61'),_0x633c('0x62'),'sys_created_on',_0x633c('0x63'),'state','sys_created_by','knowledge',_0x633c('0x32'),_0x633c('0x64'),_0x633c('0x65'),_0x633c('0x66'),_0x633c('0x67'),_0x633c('0x68'),_0x633c('0x69'),_0x633c('0x6a'),_0x633c('0x6b'),'priority',_0x633c('0x6c'),_0x633c('0x6d'),_0x633c('0x6e'),_0x633c('0x6f'),_0x633c('0x70'),'business_duration',_0x633c('0x71'),_0x633c('0x72'),_0x633c('0x73'),'resolved_at',_0x633c('0x74'),_0x633c('0x75'),'subcategory',_0x633c('0x76'),'short_description','close_code',_0x633c('0x77'),_0x633c('0x78'),_0x633c('0x79'),_0x633c('0x7a'),_0x633c('0x7b'),_0x633c('0x7c'),'description',_0x633c('0x7d'),_0x633c('0x7e'),_0x633c('0x7f'),_0x633c('0x80'),'closed_by',_0x633c('0x81'),'parent_incident','sys_id',_0x633c('0x82'),_0x633c('0x83'),_0x633c('0x84'),'urgency','problem_id',_0x633c('0x85'),_0x633c('0x86'),'activity_due',_0x633c('0x87'),_0x633c('0x55'),_0x633c('0x88'),_0x633c('0x89'),_0x633c('0x8a'),_0x633c('0x8b'),_0x633c('0x8c'),_0x633c('0x8d'),_0x633c('0x8e'),_0x633c('0x8f'),_0x633c('0x90'),_0x633c('0x91'),_0x633c('0x92'),'location',_0x633c('0x56')];var _0x33bd30='';var _0x449055='';var _0x2612cb=[];var _0x13234a='';var _0x59247a='';var _0x1a6378=[];var _0x97fee3='';var _0x268cee='';var _0x3deee8={};var _0x4c958a='';return db['ServicenowAccount'][_0x633c('0x48')]({'where':{'id':_0x10a889[_0x633c('0x40')]['id']},'attributes':['id',_0x633c('0x93'),_0x633c('0x94'),_0x633c('0x95'),'remoteUri',_0x633c('0x96')]})[_0x633c('0x3a')](handleEntityNotFound(_0x5b2b3b,null))[_0x633c('0x3a')](function(_0x29a36a){if(_0x29a36a){_0x4c958a=_0x29a36a[_0x633c('0x97')];var _0x37c711=_0x4c958a[_0x633c('0x98')](-0x1);if(_0x37c711==='/'){_0x4c958a=_0x4c958a[_0x633c('0x99')](0x0,_0x4c958a['lastIndexOf'](_0x37c711));}_0x268cee=util['format'](_0x633c('0x9a'),_0x4c958a);_0x97fee3=util[_0x633c('0x9b')]('%s/api/now/table/',_0x4c958a);_0x3deee8={'user':_0x29a36a[_0x633c('0x93')],'pass':_0x29a36a[_0x633c('0x94')]};var _0x3c6c9f={'method':_0x633c('0x9c'),'uri':_0x268cee+_0x633c('0x9d'),'auth':_0x3deee8,'json':!![]};return rp(_0x3c6c9f);}})[_0x633c('0x3a')](function(_0x422ebe){if(_0x422ebe['result'][_0x633c('0x41')]>0x0){_0x33bd30=_0x422ebe[_0x633c('0x9e')];}console[_0x633c('0x9f')](_0x633c('0xa0'),_0x33bd30);_0x1a6378=[];_0x449055=Object[_0x633c('0xa1')]([],_0x33bd30);_[_0x633c('0xa2')](_0x449055,function(_0x5e51ab){return!_0x27eecd[_0x633c('0xa3')](_0x5e51ab['name']);});_0x449055[_0x633c('0xa4')](function(_0x16f921){var _0x56949c=createFieldObject(_0x97fee3,_0x3deee8,_0x16f921[_0x633c('0xa5')],_0x16f921[_0x633c('0x22')],_0x16f921[_0x633c('0xa6')],![]);_0x1a6378[_0x633c('0xa7')](_0x56949c);});return Promise[_0x633c('0xa8')](_0x1a6378);})[_0x633c('0x3a')](function(_0x25f153){_0x2612cb=_0x25f153;_0x13234a=Object[_0x633c('0xa1')]([],_0x33bd30);console['log'](_0x633c('0xa9'),_0x33bd30);_[_0x633c('0xa2')](_0x13234a,function(_0xc0a224){return _0x3213c7[_0x633c('0xa3')](_0xc0a224['name']);});console[_0x633c('0x9f')](_0x633c('0xaa'),_0x13234a);_0x1a6378=[];_0x13234a['forEach'](function(_0x4dd3a7){var _0x5ce43f=createFieldObject(_0x97fee3,_0x3deee8,_0x4dd3a7[_0x633c('0xa5')],_0x4dd3a7[_0x633c('0x22')],_0x4dd3a7[_0x633c('0xa6')],!![]);_0x1a6378[_0x633c('0xa7')](_0x5ce43f);});return Promise[_0x633c('0xa8')](_0x1a6378);})[_0x633c('0x3a')](function(_0x3aeb8c){_0x59247a=_0x3aeb8c;var _0x95bec4=_0x2612cb[_0x633c('0xab')](_0x59247a);return{'count':_0x95bec4[_0x633c('0x41')],'rows':_0x95bec4};})[_0x633c('0x3a')](respondWithResult(_0x5b2b3b,null))[_0x633c('0x46')](function(_0x3004e4){console[_0x633c('0x9f')](_0x633c('0xac')+_0x3004e4);var _0x457639=_0x10a889['query'][_0x633c('0xad')]?0x1f4:_0x3004e4[_0x633c('0xae')]||0x1f4;logger[_0x633c('0x20')](_0x3004e4[_0x633c('0x21')]);delete _0x3004e4['name'];if(_0x457639===0x191){_0x457639=0x190;}_0x5b2b3b[_0x633c('0x15')](_0x457639)[_0x633c('0x23')](_0x10a889[_0x633c('0x2b')][_0x633c('0xad')]?{'message':_0x633c('0xaf'),'statusCode':_0x3004e4['statusCode']}:_0x3004e4);});};function createFieldObject(_0x4ea82b,_0x3f174d,_0x35928f,_0x32cae0,_0x35bc4d,_0x18b0a5){return new Promise(function(_0x131198,_0x24d6ef){var _0x11856f={'id':_0x32cae0,'name':_0x35bc4d,'custom':_0x18b0a5};if(_0x35928f===_0x633c('0xb0')){_0x11856f['options']=[{'name':_0x633c('0xb1'),'value':'true'},{'name':_0x633c('0xb2'),'value':_0x633c('0xb3')}];_0x131198(_0x11856f);}else{var _0x373f96={'method':_0x633c('0x9c'),'uri':_0x4ea82b+_0x633c('0xb4')+_0x32cae0,'auth':_0x3f174d,'json':!![]};return rp(_0x373f96)[_0x633c('0x3a')](function(_0x5dabb0){var _0x371fbf=[];if(_0x5dabb0['result'][_0x633c('0x41')]>0x0){_0x5dabb0[_0x633c('0x9e')]['forEach'](function(_0x5e755e){if(_0x5e755e['inactive']===_0x633c('0xb3')){var _0x51539b={'name':_0x5e755e[_0x633c('0xa6')],'value':_0x5e755e['value']};_0x371fbf['push'](_0x51539b);}});}_0x11856f[_0x633c('0x42')]=_0x371fbf;if(_0x11856f[_0x633c('0x42')][_0x633c('0x41')]>0x0){_0x131198(_0x11856f);}else{if(_0x18b0a5==![]){_0x131198();}else{_0x131198(_0x11856f);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 27c8f20..8bef36a 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 _0x1623=['path','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','api','moment','bluebird','request-promise'];(function(_0x354892,_0x5ccbc6){var _0x81d20b=function(_0x50eb5a){while(--_0x50eb5a){_0x354892['push'](_0x354892['shift']());}};_0x81d20b(++_0x5ccbc6);}(_0x1623,0xab));var _0x3162=function(_0x435558,_0x1f5d50){_0x435558=_0x435558-0x0;var _0x2898a1=_0x1623[_0x435558];return _0x2898a1;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3162('0x7')]=function(_0x428de6,_0x53260d){return _0x428de6[_0x3162('0x8')](_0x3162('0x9'),attributes,{'tableName':_0x3162('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts'];(function(_0x582caa,_0x33bab3){var _0xc0b39b=function(_0x5e2caa){while(--_0x5e2caa){_0x582caa['push'](_0x582caa['shift']());}};_0xc0b39b(++_0x33bab3);}(_0x1261,0x144));var _0x1126=function(_0x3dbd6d,_0x3ee9d7){_0x3dbd6d=_0x3dbd6d-0x0;var _0x1216f1=_0x1261[_0x3dbd6d];return _0x1216f1;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('0xb'),'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 1be2e7c..9f244db 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 _0x4100=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x348fdc,_0x509cf0){var _0x479630=function(_0x3568be){while(--_0x3568be){_0x348fdc['push'](_0x348fdc['shift']());}};_0x479630(++_0x509cf0);}(_0x4100,0x1d5));var _0x0410=function(_0x2444e0,_0x58b3f3){_0x2444e0=_0x2444e0-0x0;var _0x3c253c=_0x4100[_0x2444e0];return _0x3c253c;};'use strict';var _=require('lodash');var util=require(_0x0410('0x0'));var moment=require(_0x0410('0x1'));var BPromise=require(_0x0410('0x2'));var rs=require(_0x0410('0x3'));var fs=require('fs');var Redis=require(_0x0410('0x4'));var db=require(_0x0410('0x5'))['db'];var utils=require(_0x0410('0x6'));var logger=require(_0x0410('0x7'))(_0x0410('0x8'));var config=require(_0x0410('0x9'));var jayson=require(_0x0410('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27f9a9,_0x31a244,_0x44d1cb){return new BPromise(function(_0x1d9fe1,_0xb8c74b){return client[_0x0410('0xb')](_0x27f9a9,_0x44d1cb)[_0x0410('0xc')](function(_0x1129ab){logger[_0x0410('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x31a244,_0x0410('0xe'));logger[_0x0410('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x31a244,_0x0410('0xe'),JSON['stringify'](_0x1129ab));if(_0x1129ab[_0x0410('0x10')]){if(_0x1129ab[_0x0410('0x10')][_0x0410('0x11')]===0x1f4){logger[_0x0410('0x10')](_0x0410('0x12'),_0x31a244,_0x1129ab[_0x0410('0x10')][_0x0410('0x13')]);return _0xb8c74b(_0x1129ab[_0x0410('0x10')][_0x0410('0x13')]);}logger['error'](_0x0410('0x12'),_0x31a244,_0x1129ab[_0x0410('0x10')][_0x0410('0x13')]);return _0x1d9fe1(_0x1129ab[_0x0410('0x10')][_0x0410('0x13')]);}else{logger[_0x0410('0xd')](_0x0410('0x12'),_0x31a244,'request\x20sent');_0x1d9fe1(_0x1129ab[_0x0410('0x14')][_0x0410('0x13')]);}})[_0x0410('0x15')](function(_0x3954ea){logger[_0x0410('0x10')](_0x0410('0x12'),_0x31a244,_0x3954ea);_0xb8c74b(_0x3954ea);});});}exports[_0x0410('0x16')]=function(_0xf510fd){var _0x92e9ac=this;return new Promise(function(_0x4eff2b,_0xd4041f){return db[_0x0410('0x17')]['findAll']({'raw':_0xf510fd[_0x0410('0x18')]?_0xf510fd[_0x0410('0x18')][_0x0410('0x19')]===undefined?!![]:![]:!![],'where':_0xf510fd[_0x0410('0x18')]?_0xf510fd[_0x0410('0x18')][_0x0410('0x1a')]||null:null,'attributes':_0xf510fd[_0x0410('0x18')]?_0xf510fd['options'][_0x0410('0x1b')]||null:null,'limit':_0xf510fd[_0x0410('0x18')]?_0xf510fd[_0x0410('0x18')][_0x0410('0x1c')]||null:null,'include':_0xf510fd['options']?_0xf510fd[_0x0410('0x18')][_0x0410('0x1d')]?_[_0x0410('0x1e')](_0xf510fd['options'][_0x0410('0x1d')],function(_0x16745f){return{'model':db[_0x16745f['model']],'as':_0x16745f['as'],'attributes':_0x16745f[_0x0410('0x1b')],'include':_0x16745f[_0x0410('0x1d')]?_[_0x0410('0x1e')](_0x16745f[_0x0410('0x1d')],function(_0x52d927){return{'model':db[_0x52d927['model']],'as':_0x52d927['as'],'attributes':_0x52d927['attributes'],'include':_0x52d927['include']?_[_0x0410('0x1e')](_0x52d927[_0x0410('0x1d')],function(_0x1388fe){return{'model':db[_0x1388fe[_0x0410('0x1f')]],'as':_0x1388fe['as'],'attributes':_0x1388fe[_0x0410('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0410('0xc')](function(_0x155529){logger[_0x0410('0xd')](_0x0410('0x16'),_0xf510fd);logger['debug'](_0x0410('0x16'),_0xf510fd,JSON['stringify'](_0x155529));_0x4eff2b(_0x155529);})[_0x0410('0x15')](function(_0x35ee3a){logger['error']('GetServicenowAccount',_0x35ee3a[_0x0410('0x13')],_0xf510fd);_0xd4041f(_0x92e9ac[_0x0410('0x10')](0x1f4,_0x35ee3a[_0x0410('0x13')]));});});};exports[_0x0410('0x20')]=function(_0x229a2d){var _0x46f74e=this;return new Promise(function(_0x1ec265,_0x34fc97){return db[_0x0410('0x17')]['find']({'raw':_0x229a2d[_0x0410('0x18')]?_0x229a2d[_0x0410('0x18')][_0x0410('0x19')]===undefined?!![]:![]:!![],'where':_0x229a2d[_0x0410('0x18')]?_0x229a2d[_0x0410('0x18')][_0x0410('0x1a')]||null:null,'attributes':_0x229a2d['options']?_0x229a2d[_0x0410('0x18')][_0x0410('0x1b')]||null:null,'include':_0x229a2d[_0x0410('0x18')]?_0x229a2d[_0x0410('0x18')][_0x0410('0x1d')]?_[_0x0410('0x1e')](_0x229a2d[_0x0410('0x18')][_0x0410('0x1d')],function(_0x3695fe){return{'model':db[_0x3695fe[_0x0410('0x1f')]],'as':_0x3695fe['as'],'attributes':_0x3695fe['attributes'],'include':_0x3695fe['include']?_[_0x0410('0x1e')](_0x3695fe[_0x0410('0x1d')],function(_0x402592){return{'model':db[_0x402592['model']],'as':_0x402592['as'],'attributes':_0x402592[_0x0410('0x1b')],'include':_0x402592[_0x0410('0x1d')]?_['map'](_0x402592[_0x0410('0x1d')],function(_0x1bba38){return{'model':db[_0x1bba38[_0x0410('0x1f')]],'as':_0x1bba38['as'],'attributes':_0x1bba38[_0x0410('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0410('0xc')](function(_0x45f39b){logger[_0x0410('0xd')](_0x0410('0x20'),_0x229a2d);logger[_0x0410('0xf')]('ShowServicenowAccount',_0x229a2d,JSON[_0x0410('0x21')](_0x45f39b));_0x1ec265(_0x45f39b);})[_0x0410('0x15')](function(_0xd504c6){logger[_0x0410('0x10')](_0x0410('0x20'),_0xd504c6[_0x0410('0x13')],_0x229a2d);_0x34fc97(_0x46f74e[_0x0410('0x10')](0x1f4,_0xd504c6[_0x0410('0x13')]));});});}; \ No newline at end of file +var _0x8d02=['rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetServicenowAccount','options','raw','where','attributes','include','map','model','ShowServicenowAccount','ServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d02,0xa4));var _0x28d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8d02[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x28d0('0x0'));var util=require(_0x28d0('0x1'));var moment=require('moment');var BPromise=require(_0x28d0('0x2'));var rs=require(_0x28d0('0x3'));var fs=require('fs');var Redis=require(_0x28d0('0x4'));var db=require(_0x28d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x28d0('0x6'));var config=require(_0x28d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x28d0('0x8')][_0x28d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39f716,_0x39f8fb,_0x2a5265){return new BPromise(function(_0x11c405,_0x3c22a5){return client[_0x28d0('0xa')](_0x39f716,_0x2a5265)[_0x28d0('0xb')](function(_0x52333b){logger[_0x28d0('0xc')](_0x28d0('0xd'),_0x39f8fb,_0x28d0('0xe'));logger[_0x28d0('0xf')](_0x28d0('0x10'),_0x39f8fb,'request\x20sent',JSON[_0x28d0('0x11')](_0x52333b));if(_0x52333b['error']){if(_0x52333b['error'][_0x28d0('0x12')]===0x1f4){logger['error'](_0x28d0('0xd'),_0x39f8fb,_0x52333b[_0x28d0('0x13')][_0x28d0('0x14')]);return _0x3c22a5(_0x52333b['error'][_0x28d0('0x14')]);}logger[_0x28d0('0x13')](_0x28d0('0xd'),_0x39f8fb,_0x52333b['error']['message']);return _0x11c405(_0x52333b[_0x28d0('0x13')][_0x28d0('0x14')]);}else{logger[_0x28d0('0xc')](_0x28d0('0xd'),_0x39f8fb,_0x28d0('0xe'));_0x11c405(_0x52333b[_0x28d0('0x15')][_0x28d0('0x14')]);}})[_0x28d0('0x16')](function(_0x57a3ef){logger['error'](_0x28d0('0xd'),_0x39f8fb,_0x57a3ef);_0x3c22a5(_0x57a3ef);});});}exports[_0x28d0('0x17')]=function(_0x1e4011){var _0x203207=this;return new Promise(function(_0x1fa573,_0x2026f8){return db['ServicenowAccount']['findAll']({'raw':_0x1e4011[_0x28d0('0x18')]?_0x1e4011[_0x28d0('0x18')][_0x28d0('0x19')]===undefined?!![]:![]:!![],'where':_0x1e4011[_0x28d0('0x18')]?_0x1e4011[_0x28d0('0x18')][_0x28d0('0x1a')]||null:null,'attributes':_0x1e4011[_0x28d0('0x18')]?_0x1e4011[_0x28d0('0x18')][_0x28d0('0x1b')]||null:null,'limit':_0x1e4011[_0x28d0('0x18')]?_0x1e4011[_0x28d0('0x18')]['limit']||null:null,'include':_0x1e4011[_0x28d0('0x18')]?_0x1e4011['options'][_0x28d0('0x1c')]?_[_0x28d0('0x1d')](_0x1e4011['options'][_0x28d0('0x1c')],function(_0x4e0d93){return{'model':db[_0x4e0d93[_0x28d0('0x1e')]],'as':_0x4e0d93['as'],'attributes':_0x4e0d93[_0x28d0('0x1b')],'include':_0x4e0d93['include']?_[_0x28d0('0x1d')](_0x4e0d93['include'],function(_0xf2d9fc){return{'model':db[_0xf2d9fc['model']],'as':_0xf2d9fc['as'],'attributes':_0xf2d9fc['attributes'],'include':_0xf2d9fc[_0x28d0('0x1c')]?_[_0x28d0('0x1d')](_0xf2d9fc[_0x28d0('0x1c')],function(_0x5e57b4){return{'model':db[_0x5e57b4['model']],'as':_0x5e57b4['as'],'attributes':_0x5e57b4[_0x28d0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x28d0('0xb')](function(_0x559bc0){logger[_0x28d0('0xc')](_0x28d0('0x17'),_0x1e4011);logger[_0x28d0('0xf')](_0x28d0('0x17'),_0x1e4011,JSON['stringify'](_0x559bc0));_0x1fa573(_0x559bc0);})[_0x28d0('0x16')](function(_0x5c20c3){logger[_0x28d0('0x13')](_0x28d0('0x17'),_0x5c20c3['message'],_0x1e4011);_0x2026f8(_0x203207[_0x28d0('0x13')](0x1f4,_0x5c20c3[_0x28d0('0x14')]));});});};exports[_0x28d0('0x1f')]=function(_0x11881f){var _0xb57108=this;return new Promise(function(_0xc90e05,_0x7ec72e){return db[_0x28d0('0x20')][_0x28d0('0x21')]({'raw':_0x11881f['options']?_0x11881f[_0x28d0('0x18')][_0x28d0('0x19')]===undefined?!![]:![]:!![],'where':_0x11881f['options']?_0x11881f[_0x28d0('0x18')][_0x28d0('0x1a')]||null:null,'attributes':_0x11881f[_0x28d0('0x18')]?_0x11881f[_0x28d0('0x18')][_0x28d0('0x1b')]||null:null,'include':_0x11881f[_0x28d0('0x18')]?_0x11881f[_0x28d0('0x18')][_0x28d0('0x1c')]?_[_0x28d0('0x1d')](_0x11881f['options']['include'],function(_0x4d8f8b){return{'model':db[_0x4d8f8b[_0x28d0('0x1e')]],'as':_0x4d8f8b['as'],'attributes':_0x4d8f8b['attributes'],'include':_0x4d8f8b['include']?_[_0x28d0('0x1d')](_0x4d8f8b[_0x28d0('0x1c')],function(_0x1ee8dc){return{'model':db[_0x1ee8dc[_0x28d0('0x1e')]],'as':_0x1ee8dc['as'],'attributes':_0x1ee8dc[_0x28d0('0x1b')],'include':_0x1ee8dc['include']?_[_0x28d0('0x1d')](_0x1ee8dc['include'],function(_0x51116a){return{'model':db[_0x51116a[_0x28d0('0x1e')]],'as':_0x51116a['as'],'attributes':_0x51116a[_0x28d0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x28d0('0xb')](function(_0x52962e){logger[_0x28d0('0xc')]('ShowServicenowAccount',_0x11881f);logger['debug'](_0x28d0('0x1f'),_0x11881f,JSON[_0x28d0('0x11')](_0x52962e));_0xc90e05(_0x52962e);})['catch'](function(_0x31c8b9){logger[_0x28d0('0x13')]('ShowServicenowAccount',_0x31c8b9['message'],_0x11881f);_0x7ec72e(_0xb57108['error'](0x1f4,_0x31c8b9['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 777a018..f6d0bcd 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 _0x9b3c=['index','/:id','show','/:id/fields','/:id/subjects','getDescriptions','create','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated'];(function(_0x5e5ba8,_0x40cab6){var _0x3633ef=function(_0xa5a0a8){while(--_0xa5a0a8){_0x5e5ba8['push'](_0x5e5ba8['shift']());}};_0x3633ef(++_0x40cab6);}(_0x9b3c,0x1d8));var _0xc9b3=function(_0x15268c,_0x52ca76){_0x15268c=_0x15268c-0x0;var _0x496f25=_0x9b3c[_0x15268c];return _0x496f25;};'use strict';var multer=require(_0xc9b3('0x0'));var util=require('util');var path=require(_0xc9b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9b3('0x2'));var router=express[_0xc9b3('0x3')]();var fs_extra=require(_0xc9b3('0x4'));var auth=require(_0xc9b3('0x5'));var interaction=require(_0xc9b3('0x6'));var config=require(_0xc9b3('0x7'));var controller=require(_0xc9b3('0x8'));router[_0xc9b3('0x9')]('/',auth[_0xc9b3('0xa')](),controller[_0xc9b3('0xb')]);router[_0xc9b3('0x9')](_0xc9b3('0xc'),auth[_0xc9b3('0xa')](),controller[_0xc9b3('0xd')]);router[_0xc9b3('0x9')](_0xc9b3('0xe'),auth[_0xc9b3('0xa')](),controller['getFields']);router['get'](_0xc9b3('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xc9b3('0x9')]('/:id/descriptions',auth[_0xc9b3('0xa')](),controller[_0xc9b3('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc9b3('0x11')]);router[_0xc9b3('0x12')](_0xc9b3('0xc'),auth[_0xc9b3('0xa')](),controller['update']);router[_0xc9b3('0x13')](_0xc9b3('0xc'),auth['isAuthenticated'](),controller[_0xc9b3('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4890=['post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x406619,_0x507b6b){var _0x26ada1=function(_0x3072da){while(--_0x3072da){_0x406619['push'](_0x406619['shift']());}};_0x26ada1(++_0x507b6b);}(_0x4890,0x109));var _0x0489=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x4890[_0x10004e];return _0x5af990;};'use strict';var multer=require(_0x0489('0x0'));var util=require(_0x0489('0x1'));var path=require(_0x0489('0x2'));var timeout=require(_0x0489('0x3'));var express=require(_0x0489('0x4'));var router=express[_0x0489('0x5')]();var fs_extra=require(_0x0489('0x6'));var auth=require(_0x0489('0x7'));var interaction=require(_0x0489('0x8'));var config=require(_0x0489('0x9'));var controller=require(_0x0489('0xa'));router['get']('/',auth[_0x0489('0xb')](),controller[_0x0489('0xc')]);router[_0x0489('0xd')](_0x0489('0xe'),auth['isAuthenticated'](),controller[_0x0489('0xf')]);router[_0x0489('0xd')](_0x0489('0x10'),auth['isAuthenticated'](),controller[_0x0489('0x11')]);router[_0x0489('0xd')](_0x0489('0x12'),auth[_0x0489('0xb')](),controller[_0x0489('0x13')]);router['get'](_0x0489('0x14'),auth[_0x0489('0xb')](),controller['getDescriptions']);router[_0x0489('0x15')]('/',auth[_0x0489('0xb')](),controller[_0x0489('0x16')]);router[_0x0489('0x17')](_0x0489('0xe'),auth[_0x0489('0xb')](),controller[_0x0489('0x18')]);router[_0x0489('0x19')](_0x0489('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index acc8c4b..138d8d6 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 _0x2ce8=['sequelize','exports'];(function(_0x2e68db,_0x275d04){var _0x12df4c=function(_0x1b6701){while(--_0x1b6701){_0x2e68db['push'](_0x2e68db['shift']());}};_0x12df4c(++_0x275d04);}(_0x2ce8,0xb6));var _0x82ce=function(_0x32007b,_0x16a2f5){_0x32007b=_0x32007b-0x0;var _0x1bd22a=_0x2ce8[_0x32007b];return _0x1bd22a;};'use strict';var Sequelize=require(_0x82ce('0x0'));module[_0x82ce('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3a8f=['sequelize','exports','STRING'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x3a8f,0x183));var _0xf3a8=function(_0x2c03bc,_0x347fb1){_0x2c03bc=_0x2c03bc-0x0;var _0x5e49b6=_0x3a8f[_0x2c03bc];return _0x5e49b6;};'use strict';var Sequelize=require(_0xf3a8('0x0'));module[_0xf3a8('0x1')]={'name':{'type':Sequelize[_0xf3a8('0x2')]},'description':{'type':Sequelize[_0xf3a8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ceeae92..25bae02 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 _0x85e8=['undefined','limit','count','set','apply','save','update','then','destroy','end','sendStatus','error','name','send','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','ServicenowConfiguration','include','findAll','catch','show','params','includeAll','find','create','body','findOne','ServicenowField','order','pick','getFields','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset'];(function(_0x3dac40,_0xd87b79){var _0x3183e9=function(_0xde3aec){while(--_0xde3aec){_0x3dac40['push'](_0x3dac40['shift']());}};_0x3183e9(++_0xd87b79);}(_0x85e8,0x114));var _0x885e=function(_0x4ab9a7,_0x291df1){_0x4ab9a7=_0x4ab9a7-0x0;var _0xd08799=_0x85e8[_0x4ab9a7];return _0xd08799;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x885e('0x0'));var zipdir=require(_0x885e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x885e('0x2'));var moment=require(_0x885e('0x3'));var BPromise=require(_0x885e('0x4'));var Mustache=require(_0x885e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x885e('0x6'));var csv=require(_0x885e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x885e('0x8'));var _=require('lodash');var squel=require(_0x885e('0x9'));var crypto=require(_0x885e('0xa'));var jsforce=require(_0x885e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x885e('0x7'));var querystring=require(_0x885e('0xc'));var Papa=require(_0x885e('0xd'));var Redis=require(_0x885e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x885e('0xf'));var as=require(_0x885e('0x10'));var hardwareService=require(_0x885e('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x885e('0x12'));var licenseUtil=require(_0x885e('0x13'));var db=require(_0x885e('0x14'))['db'];function respondWithStatusCode(_0x36f6d3,_0x1c46bc){_0x1c46bc=_0x1c46bc||0xcc;return function(_0x4f7b7a){if(_0x4f7b7a){return _0x36f6d3['sendStatus'](_0x1c46bc);}return _0x36f6d3[_0x885e('0x15')](_0x1c46bc)['end']();};}function respondWithResult(_0x1d2bf3,_0x20941b){_0x20941b=_0x20941b||0xc8;return function(_0x2628e0){if(_0x2628e0){return _0x1d2bf3[_0x885e('0x15')](_0x20941b)[_0x885e('0x16')](_0x2628e0);}};}function respondWithFilteredResult(_0x32a491,_0x23613e){return function(_0x28ccb6){if(_0x28ccb6){var _0x4063f5=typeof _0x23613e[_0x885e('0x17')]===_0x885e('0x18')&&typeof _0x23613e[_0x885e('0x19')]==='undefined';var _0x2d3a9d=_0x28ccb6[_0x885e('0x1a')];var _0x2f493a=_0x4063f5?0x0:_0x23613e['offset'];var _0x49a429=_0x4063f5?_0x28ccb6[_0x885e('0x1a')]:_0x23613e[_0x885e('0x17')]+_0x23613e['limit'];var _0x4bc471;if(_0x49a429>=_0x2d3a9d){_0x49a429=_0x2d3a9d;_0x4bc471=0xc8;}else{_0x4bc471=0xce;}_0x32a491[_0x885e('0x15')](_0x4bc471);return _0x32a491[_0x885e('0x1b')]('Content-Range',_0x2f493a+'-'+_0x49a429+'/'+_0x2d3a9d)[_0x885e('0x16')](_0x28ccb6);}return null;};}function patchUpdates(_0x205114){return function(_0xb64dc8){try{jsonpatch[_0x885e('0x1c')](_0xb64dc8,_0x205114,!![]);}catch(_0x1ebab9){return BPromise['reject'](_0x1ebab9);}return _0xb64dc8[_0x885e('0x1d')]();};}function saveUpdates(_0x21fde1,_0x3e45e5){return function(_0x3460a3){if(_0x3460a3){return _0x3460a3[_0x885e('0x1e')](_0x21fde1)[_0x885e('0x1f')](function(_0x20a290){return _0x20a290;});}return null;};}function removeEntity(_0x10a5e8,_0x3b8a36){return function(_0x37e1b7){if(_0x37e1b7){return _0x37e1b7[_0x885e('0x20')]()[_0x885e('0x1f')](function(){_0x10a5e8[_0x885e('0x15')](0xcc)[_0x885e('0x21')]();});}};}function handleEntityNotFound(_0x1a420a,_0x107fc0){return function(_0x44b2be){if(!_0x44b2be){_0x1a420a[_0x885e('0x22')](0x194);}return _0x44b2be;};}function handleError(_0x22749b,_0x5da3c4){_0x5da3c4=_0x5da3c4||0x1f4;return function(_0x4ceb32){logger[_0x885e('0x23')](_0x4ceb32['stack']);if(_0x4ceb32[_0x885e('0x24')]){delete _0x4ceb32[_0x885e('0x24')];}_0x22749b[_0x885e('0x15')](_0x5da3c4)[_0x885e('0x25')](_0x4ceb32);};}exports['index']=function(_0x3ab3a8,_0xa546a7){var _0x3536e7={},_0x373bb7={},_0x2db03f={'count':0x0,'rows':[]};var _0x22ef33=_[_0x885e('0x26')](db['ServicenowConfiguration'][_0x885e('0x27')],function(_0x2e9309){return{'name':_0x2e9309['fieldName'],'type':_0x2e9309['type'][_0x885e('0x28')]};});_0x373bb7[_0x885e('0x29')]=_[_0x885e('0x26')](_0x22ef33,_0x885e('0x24'));_0x373bb7[_0x885e('0x2a')]=_[_0x885e('0x2b')](_0x3ab3a8[_0x885e('0x2a')]);_0x373bb7['filters']=_[_0x885e('0x2c')](_0x373bb7[_0x885e('0x29')],_0x373bb7['query']);_0x3536e7[_0x885e('0x2d')]=_['intersection'](_0x373bb7['model'],qs[_0x885e('0x2e')](_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x2e')]));_0x3536e7[_0x885e('0x2d')]=_0x3536e7[_0x885e('0x2d')][_0x885e('0x2f')]?_0x3536e7['attributes']:_0x373bb7['model'];if(!_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x30')](_0x885e('0x31'))){_0x3536e7[_0x885e('0x19')]=qs[_0x885e('0x19')](_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x19')]);_0x3536e7[_0x885e('0x17')]=qs[_0x885e('0x17')](_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x17')]);}_0x3536e7['order']=qs[_0x885e('0x32')](_0x3ab3a8[_0x885e('0x2a')][_0x885e('0x32')]);_0x3536e7[_0x885e('0x33')]=qs[_0x885e('0x34')](_['pick'](_0x3ab3a8[_0x885e('0x2a')],_0x373bb7['filters']),_0x22ef33);if(_0x3ab3a8['query'][_0x885e('0x35')]){_0x3536e7[_0x885e('0x33')]=_[_0x885e('0x36')](_0x3536e7['where'],{'$or':_['map'](_0x22ef33,function(_0x2b81f8){if(_0x2b81f8[_0x885e('0x37')]!==_0x885e('0x38')){var _0x495bdb={};_0x495bdb[_0x2b81f8[_0x885e('0x24')]]={'$like':'%'+_0x3ab3a8[_0x885e('0x2a')]['filter']+'%'};return _0x495bdb;}})});}_0x3536e7=_[_0x885e('0x36')]({},_0x3536e7,_0x3ab3a8[_0x885e('0x39')]);var _0x3bfa85={'where':_0x3536e7[_0x885e('0x33')]};return db[_0x885e('0x3a')]['count'](_0x3bfa85)[_0x885e('0x1f')](function(_0x473080){_0x2db03f['count']=_0x473080;if(_0x3ab3a8[_0x885e('0x2a')]['includeAll']){_0x3536e7[_0x885e('0x3b')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x885e('0x3c')](_0x3536e7);})[_0x885e('0x1f')](function(_0x482162){_0x2db03f['rows']=_0x482162;return _0x2db03f;})['then'](respondWithFilteredResult(_0xa546a7,_0x3536e7))[_0x885e('0x3d')](handleError(_0xa546a7,null));};exports[_0x885e('0x3e')]=function(_0x233c10,_0x3f2481){var _0x326c30={'raw':![],'where':{'id':_0x233c10[_0x885e('0x3f')]['id']}},_0x55b390={};_0x55b390['model']=_[_0x885e('0x2b')](db[_0x885e('0x3a')][_0x885e('0x27')]);_0x55b390[_0x885e('0x2a')]=_[_0x885e('0x2b')](_0x233c10['query']);_0x55b390[_0x885e('0x34')]=_[_0x885e('0x2c')](_0x55b390[_0x885e('0x29')],_0x55b390[_0x885e('0x2a')]);_0x326c30['attributes']=_[_0x885e('0x2c')](_0x55b390['model'],qs[_0x885e('0x2e')](_0x233c10['query'][_0x885e('0x2e')]));_0x326c30[_0x885e('0x2d')]=_0x326c30[_0x885e('0x2d')][_0x885e('0x2f')]?_0x326c30[_0x885e('0x2d')]:_0x55b390[_0x885e('0x29')];if(_0x233c10[_0x885e('0x2a')][_0x885e('0x40')]){_0x326c30[_0x885e('0x3b')]=[{'all':!![]}];}_0x326c30=_[_0x885e('0x36')]({},_0x326c30,_0x233c10[_0x885e('0x39')]);return db[_0x885e('0x3a')][_0x885e('0x41')](_0x326c30)[_0x885e('0x1f')](handleEntityNotFound(_0x3f2481,null))[_0x885e('0x1f')](respondWithResult(_0x3f2481,null))[_0x885e('0x3d')](handleError(_0x3f2481,null));};exports['create']=function(_0x19989,_0x12844e){return db[_0x885e('0x3a')][_0x885e('0x42')](_0x19989[_0x885e('0x43')],{})[_0x885e('0x1f')](respondWithResult(_0x12844e,0xc9))[_0x885e('0x3d')](handleError(_0x12844e,null));};exports[_0x885e('0x1e')]=function(_0x1a3c97,_0x46359c){if(_0x1a3c97['body']['id']){delete _0x1a3c97[_0x885e('0x43')]['id'];}return db[_0x885e('0x3a')]['find']({'where':{'id':_0x1a3c97[_0x885e('0x3f')]['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x46359c,null))[_0x885e('0x1f')](saveUpdates(_0x1a3c97[_0x885e('0x43')],null))['then'](respondWithResult(_0x46359c,null))['catch'](handleError(_0x46359c,null));};exports[_0x885e('0x20')]=function(_0x2cfe95,_0x4d0c74){return db['ServicenowConfiguration']['find']({'where':{'id':_0x2cfe95['params']['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x4d0c74,null))['then'](removeEntity(_0x4d0c74,null))[_0x885e('0x3d')](handleError(_0x4d0c74,null));};exports['getFields']=function(_0x573e4a,_0x41067a,_0xb687d4){var _0x5cc27b={};var _0x2bc303={};var _0x11ac39;var _0x1858f6;return db[_0x885e('0x3a')][_0x885e('0x44')]({'where':{'id':_0x573e4a[_0x885e('0x3f')]['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x41067a,null))[_0x885e('0x1f')](function(_0x4b243e){if(_0x4b243e){_0x11ac39=_0x4b243e;_0x2bc303[_0x885e('0x29')]=_[_0x885e('0x2b')](db[_0x885e('0x45')][_0x885e('0x27')]);_0x2bc303[_0x885e('0x2a')]=_[_0x885e('0x2b')](_0x573e4a[_0x885e('0x2a')]);_0x2bc303[_0x885e('0x34')]=_[_0x885e('0x2c')](_0x2bc303[_0x885e('0x29')],_0x2bc303[_0x885e('0x2a')]);_0x5cc27b[_0x885e('0x2d')]=_[_0x885e('0x2c')](_0x2bc303[_0x885e('0x29')],qs[_0x885e('0x2e')](_0x573e4a[_0x885e('0x2a')][_0x885e('0x2e')]));_0x5cc27b[_0x885e('0x2d')]=_0x5cc27b[_0x885e('0x2d')][_0x885e('0x2f')]?_0x5cc27b[_0x885e('0x2d')]:_0x2bc303[_0x885e('0x29')];_0x5cc27b[_0x885e('0x46')]=qs[_0x885e('0x32')](_0x573e4a[_0x885e('0x2a')][_0x885e('0x32')]);_0x5cc27b[_0x885e('0x33')]=qs[_0x885e('0x34')](_[_0x885e('0x47')](_0x573e4a['query'],_0x2bc303[_0x885e('0x34')]));if(_0x573e4a['query']['filter']){_0x5cc27b['where']=_[_0x885e('0x36')](_0x5cc27b[_0x885e('0x33')],{'$or':_[_0x885e('0x26')](_0x5cc27b[_0x885e('0x2d')],function(_0x554185){var _0xc1d6a7={};_0xc1d6a7[_0x554185]={'$like':'%'+_0x573e4a[_0x885e('0x2a')][_0x885e('0x35')]+'%'};return _0xc1d6a7;})});}_0x5cc27b=_[_0x885e('0x36')]({},_0x5cc27b,_0x573e4a[_0x885e('0x39')]);return _0x11ac39[_0x885e('0x48')](_0x5cc27b);}})['then'](function(_0x4eb244){if(_0x4eb244){_0x1858f6=_0x4eb244[_0x885e('0x2f')];if(!_0x573e4a[_0x885e('0x2a')]['hasOwnProperty'](_0x885e('0x31'))){_0x5cc27b[_0x885e('0x19')]=qs['limit'](_0x573e4a[_0x885e('0x2a')][_0x885e('0x19')]);_0x5cc27b[_0x885e('0x17')]=qs[_0x885e('0x17')](_0x573e4a[_0x885e('0x2a')][_0x885e('0x17')]);}return _0x11ac39[_0x885e('0x48')](_0x5cc27b);}})[_0x885e('0x1f')](function(_0x4c9736){if(_0x4c9736){return _0x4c9736?{'count':_0x1858f6,'rows':_0x4c9736}:null;}})['then'](respondWithResult(_0x41067a,null))[_0x885e('0x3d')](handleError(_0x41067a,null));};exports[_0x885e('0x49')]=function(_0x596266,_0x4594bc,_0x2866c8){var _0x10fb50={};var _0x837e60={};var _0x2f9698;var _0x756d9a;return db[_0x885e('0x3a')]['findOne']({'where':{'id':_0x596266[_0x885e('0x3f')]['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x4594bc,null))[_0x885e('0x1f')](function(_0xc322f5){if(_0xc322f5){_0x2f9698=_0xc322f5;_0x837e60[_0x885e('0x29')]=_['keys'](db['ServicenowField'][_0x885e('0x27')]);_0x837e60[_0x885e('0x2a')]=_['keys'](_0x596266[_0x885e('0x2a')]);_0x837e60[_0x885e('0x34')]=_['intersection'](_0x837e60['model'],_0x837e60[_0x885e('0x2a')]);_0x10fb50[_0x885e('0x2d')]=_[_0x885e('0x2c')](_0x837e60[_0x885e('0x29')],qs[_0x885e('0x2e')](_0x596266[_0x885e('0x2a')][_0x885e('0x2e')]));_0x10fb50[_0x885e('0x2d')]=_0x10fb50[_0x885e('0x2d')][_0x885e('0x2f')]?_0x10fb50[_0x885e('0x2d')]:_0x837e60['model'];_0x10fb50[_0x885e('0x46')]=qs[_0x885e('0x32')](_0x596266[_0x885e('0x2a')][_0x885e('0x32')]);_0x10fb50['where']=qs[_0x885e('0x34')](_[_0x885e('0x47')](_0x596266[_0x885e('0x2a')],_0x837e60[_0x885e('0x34')]));if(_0x596266[_0x885e('0x2a')][_0x885e('0x35')]){_0x10fb50[_0x885e('0x33')]=_[_0x885e('0x36')](_0x10fb50[_0x885e('0x33')],{'$or':_['map'](_0x10fb50[_0x885e('0x2d')],function(_0x4460a5){var _0x5ba403={};_0x5ba403[_0x4460a5]={'$like':'%'+_0x596266['query'][_0x885e('0x35')]+'%'};return _0x5ba403;})});}_0x10fb50=_['merge']({},_0x10fb50,_0x596266[_0x885e('0x39')]);return _0x2f9698[_0x885e('0x49')](_0x10fb50);}})[_0x885e('0x1f')](function(_0xe6817e){if(_0xe6817e){_0x756d9a=_0xe6817e['length'];if(!_0x596266[_0x885e('0x2a')][_0x885e('0x30')](_0x885e('0x31'))){_0x10fb50[_0x885e('0x19')]=qs[_0x885e('0x19')](_0x596266['query'][_0x885e('0x19')]);_0x10fb50[_0x885e('0x17')]=qs[_0x885e('0x17')](_0x596266[_0x885e('0x2a')][_0x885e('0x17')]);}return _0x2f9698[_0x885e('0x49')](_0x10fb50);}})[_0x885e('0x1f')](function(_0x4fa234){if(_0x4fa234){return _0x4fa234?{'count':_0x756d9a,'rows':_0x4fa234}:null;}})[_0x885e('0x1f')](respondWithResult(_0x4594bc,null))[_0x885e('0x3d')](handleError(_0x4594bc,null));};exports[_0x885e('0x4a')]=function(_0x596ef5,_0x352d92,_0x30038b){var _0x5d6564={};var _0x2bf42c={};var _0x51be14;var _0xac6dd7;return db['ServicenowConfiguration'][_0x885e('0x44')]({'where':{'id':_0x596ef5[_0x885e('0x3f')]['id']}})[_0x885e('0x1f')](handleEntityNotFound(_0x352d92,null))['then'](function(_0x3704af){if(_0x3704af){_0x51be14=_0x3704af;_0x2bf42c[_0x885e('0x29')]=_[_0x885e('0x2b')](db[_0x885e('0x45')][_0x885e('0x27')]);_0x2bf42c['query']=_['keys'](_0x596ef5[_0x885e('0x2a')]);_0x2bf42c['filters']=_[_0x885e('0x2c')](_0x2bf42c['model'],_0x2bf42c[_0x885e('0x2a')]);_0x5d6564[_0x885e('0x2d')]=_[_0x885e('0x2c')](_0x2bf42c[_0x885e('0x29')],qs[_0x885e('0x2e')](_0x596ef5[_0x885e('0x2a')][_0x885e('0x2e')]));_0x5d6564[_0x885e('0x2d')]=_0x5d6564[_0x885e('0x2d')][_0x885e('0x2f')]?_0x5d6564[_0x885e('0x2d')]:_0x2bf42c[_0x885e('0x29')];_0x5d6564[_0x885e('0x46')]=qs[_0x885e('0x32')](_0x596ef5[_0x885e('0x2a')][_0x885e('0x32')]);_0x5d6564['where']=qs[_0x885e('0x34')](_[_0x885e('0x47')](_0x596ef5[_0x885e('0x2a')],_0x2bf42c[_0x885e('0x34')]));if(_0x596ef5[_0x885e('0x2a')][_0x885e('0x35')]){_0x5d6564[_0x885e('0x33')]=_[_0x885e('0x36')](_0x5d6564[_0x885e('0x33')],{'$or':_[_0x885e('0x26')](_0x5d6564['attributes'],function(_0x8253bf){var _0x99d4ec={};_0x99d4ec[_0x8253bf]={'$like':'%'+_0x596ef5[_0x885e('0x2a')]['filter']+'%'};return _0x99d4ec;})});}_0x5d6564=_[_0x885e('0x36')]({},_0x5d6564,_0x596ef5['options']);return _0x51be14[_0x885e('0x4a')](_0x5d6564);}})[_0x885e('0x1f')](function(_0x41ee19){if(_0x41ee19){_0xac6dd7=_0x41ee19[_0x885e('0x2f')];if(!_0x596ef5['query'][_0x885e('0x30')](_0x885e('0x31'))){_0x5d6564[_0x885e('0x19')]=qs[_0x885e('0x19')](_0x596ef5['query'][_0x885e('0x19')]);_0x5d6564[_0x885e('0x17')]=qs['offset'](_0x596ef5['query'][_0x885e('0x17')]);}return _0x51be14[_0x885e('0x4a')](_0x5d6564);}})[_0x885e('0x1f')](function(_0x50c8eb){if(_0x50c8eb){return _0x50c8eb?{'count':_0xac6dd7,'rows':_0x50c8eb}:null;}})['then'](respondWithResult(_0x352d92,null))[_0x885e('0x3d')](handleError(_0x352d92,null));}; \ No newline at end of file +var _0x9941=['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','limit','undefined','count','offset','Content-Range','json','reject','update','then','destroy','end','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','create','body','find','getFields','ServicenowField','sort','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x3c62f4,_0x467fb5){var _0x31db2b=function(_0x2819ff){while(--_0x2819ff){_0x3c62f4['push'](_0x3c62f4['shift']());}};_0x31db2b(++_0x467fb5);}(_0x9941,0x92));var _0x1994=function(_0xda1de5,_0x231f2c){_0xda1de5=_0xda1de5-0x0;var _0x52079b=_0x9941[_0xda1de5];return _0x52079b;};'use strict';var emlformat=require(_0x1994('0x0'));var rimraf=require(_0x1994('0x1'));var zipdir=require(_0x1994('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1994('0x3'));var moment=require(_0x1994('0x4'));var BPromise=require(_0x1994('0x5'));var Mustache=require(_0x1994('0x6'));var util=require(_0x1994('0x7'));var path=require(_0x1994('0x8'));var sox=require(_0x1994('0x9'));var csv=require(_0x1994('0xa'));var ejs=require(_0x1994('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1994('0xc'));var squel=require(_0x1994('0xd'));var crypto=require(_0x1994('0xe'));var jsforce=require(_0x1994('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1994('0xa'));var querystring=require(_0x1994('0x10'));var Papa=require(_0x1994('0x11'));var Redis=require(_0x1994('0x12'));var authService=require(_0x1994('0x13'));var qs=require(_0x1994('0x14'));var as=require(_0x1994('0x15'));var hardwareService=require(_0x1994('0x16'));var logger=require(_0x1994('0x17'))(_0x1994('0x18'));var utils=require(_0x1994('0x19'));var config=require(_0x1994('0x1a'));var licenseUtil=require(_0x1994('0x1b'));var db=require(_0x1994('0x1c'))['db'];function respondWithStatusCode(_0x4028c2,_0x377650){_0x377650=_0x377650||0xcc;return function(_0x3db54d){if(_0x3db54d){return _0x4028c2[_0x1994('0x1d')](_0x377650);}return _0x4028c2[_0x1994('0x1e')](_0x377650)['end']();};}function respondWithResult(_0x53c7f0,_0x58a96d){_0x58a96d=_0x58a96d||0xc8;return function(_0x4bb283){if(_0x4bb283){return _0x53c7f0[_0x1994('0x1e')](_0x58a96d)['json'](_0x4bb283);}};}function respondWithFilteredResult(_0x29320d,_0x7215d9){return function(_0x1d5609){if(_0x1d5609){var _0x589b1a=typeof _0x7215d9['offset']==='undefined'&&typeof _0x7215d9[_0x1994('0x1f')]===_0x1994('0x20');var _0x13de3f=_0x1d5609[_0x1994('0x21')];var _0x23f500=_0x589b1a?0x0:_0x7215d9['offset'];var _0x1e7e12=_0x589b1a?_0x1d5609[_0x1994('0x21')]:_0x7215d9[_0x1994('0x22')]+_0x7215d9[_0x1994('0x1f')];var _0x23be50;if(_0x1e7e12>=_0x13de3f){_0x1e7e12=_0x13de3f;_0x23be50=0xc8;}else{_0x23be50=0xce;}_0x29320d[_0x1994('0x1e')](_0x23be50);return _0x29320d['set'](_0x1994('0x23'),_0x23f500+'-'+_0x1e7e12+'/'+_0x13de3f)[_0x1994('0x24')](_0x1d5609);}return null;};}function patchUpdates(_0x20073d){return function(_0x246d33){try{jsonpatch['apply'](_0x246d33,_0x20073d,!![]);}catch(_0x4c280c){return BPromise[_0x1994('0x25')](_0x4c280c);}return _0x246d33['save']();};}function saveUpdates(_0x107478,_0x16a10a){return function(_0x3990b8){if(_0x3990b8){return _0x3990b8[_0x1994('0x26')](_0x107478)[_0x1994('0x27')](function(_0x3c89b5){return _0x3c89b5;});}return null;};}function removeEntity(_0x128c1f,_0x4f3832){return function(_0xa10707){if(_0xa10707){return _0xa10707[_0x1994('0x28')]()[_0x1994('0x27')](function(){_0x128c1f[_0x1994('0x1e')](0xcc)[_0x1994('0x29')]();});}};}function handleEntityNotFound(_0x3b3289,_0x1996e3){return function(_0x2b0131){if(!_0x2b0131){_0x3b3289[_0x1994('0x1d')](0x194);}return _0x2b0131;};}function handleError(_0x53c6df,_0x4bac2f){_0x4bac2f=_0x4bac2f||0x1f4;return function(_0x1935ba){logger[_0x1994('0x2a')](_0x1935ba['stack']);if(_0x1935ba['name']){delete _0x1935ba[_0x1994('0x2b')];}_0x53c6df['status'](_0x4bac2f)[_0x1994('0x2c')](_0x1935ba);};}exports[_0x1994('0x2d')]=function(_0x35d3c6,_0x390f62){var _0x38354f={},_0xf07625={},_0x45a93d={'count':0x0,'rows':[]};var _0x53ec83=_[_0x1994('0x2e')](db[_0x1994('0x2f')][_0x1994('0x30')],function(_0x140f20){return{'name':_0x140f20[_0x1994('0x31')],'type':_0x140f20[_0x1994('0x32')]['key']};});_0xf07625[_0x1994('0x33')]=_[_0x1994('0x2e')](_0x53ec83,_0x1994('0x2b'));_0xf07625[_0x1994('0x34')]=_['keys'](_0x35d3c6['query']);_0xf07625[_0x1994('0x35')]=_[_0x1994('0x36')](_0xf07625[_0x1994('0x33')],_0xf07625[_0x1994('0x34')]);_0x38354f[_0x1994('0x37')]=_[_0x1994('0x36')](_0xf07625[_0x1994('0x33')],qs[_0x1994('0x38')](_0x35d3c6[_0x1994('0x34')][_0x1994('0x38')]));_0x38354f[_0x1994('0x37')]=_0x38354f[_0x1994('0x37')][_0x1994('0x39')]?_0x38354f[_0x1994('0x37')]:_0xf07625[_0x1994('0x33')];if(!_0x35d3c6['query'][_0x1994('0x3a')](_0x1994('0x3b'))){_0x38354f[_0x1994('0x1f')]=qs[_0x1994('0x1f')](_0x35d3c6[_0x1994('0x34')][_0x1994('0x1f')]);_0x38354f[_0x1994('0x22')]=qs[_0x1994('0x22')](_0x35d3c6[_0x1994('0x34')][_0x1994('0x22')]);}_0x38354f[_0x1994('0x3c')]=qs['sort'](_0x35d3c6[_0x1994('0x34')]['sort']);_0x38354f['where']=qs[_0x1994('0x35')](_[_0x1994('0x3d')](_0x35d3c6[_0x1994('0x34')],_0xf07625[_0x1994('0x35')]),_0x53ec83);if(_0x35d3c6['query'][_0x1994('0x3e')]){_0x38354f[_0x1994('0x3f')]=_[_0x1994('0x40')](_0x38354f[_0x1994('0x3f')],{'$or':_[_0x1994('0x2e')](_0x53ec83,function(_0x5d5aaa){if(_0x5d5aaa[_0x1994('0x32')]!==_0x1994('0x41')){var _0x5e5241={};_0x5e5241[_0x5d5aaa[_0x1994('0x2b')]]={'$like':'%'+_0x35d3c6['query']['filter']+'%'};return _0x5e5241;}})});}_0x38354f=_[_0x1994('0x40')]({},_0x38354f,_0x35d3c6[_0x1994('0x42')]);var _0xf0dbdb={'where':_0x38354f[_0x1994('0x3f')]};return db[_0x1994('0x2f')][_0x1994('0x21')](_0xf0dbdb)[_0x1994('0x27')](function(_0x249a39){_0x45a93d[_0x1994('0x21')]=_0x249a39;if(_0x35d3c6[_0x1994('0x34')][_0x1994('0x43')]){_0x38354f[_0x1994('0x44')]=[{'all':!![]}];}return db[_0x1994('0x2f')][_0x1994('0x45')](_0x38354f);})[_0x1994('0x27')](function(_0x2cc52){_0x45a93d['rows']=_0x2cc52;return _0x45a93d;})[_0x1994('0x27')](respondWithFilteredResult(_0x390f62,_0x38354f))[_0x1994('0x46')](handleError(_0x390f62,null));};exports['show']=function(_0x545fa5,_0x49e64a){var _0x5f4f7f={'raw':![],'where':{'id':_0x545fa5[_0x1994('0x47')]['id']}},_0x2411b0={};_0x2411b0[_0x1994('0x33')]=_['keys'](db[_0x1994('0x2f')][_0x1994('0x30')]);_0x2411b0[_0x1994('0x34')]=_[_0x1994('0x48')](_0x545fa5[_0x1994('0x34')]);_0x2411b0['filters']=_[_0x1994('0x36')](_0x2411b0[_0x1994('0x33')],_0x2411b0[_0x1994('0x34')]);_0x5f4f7f[_0x1994('0x37')]=_[_0x1994('0x36')](_0x2411b0[_0x1994('0x33')],qs[_0x1994('0x38')](_0x545fa5['query'][_0x1994('0x38')]));_0x5f4f7f['attributes']=_0x5f4f7f['attributes'][_0x1994('0x39')]?_0x5f4f7f[_0x1994('0x37')]:_0x2411b0[_0x1994('0x33')];if(_0x545fa5[_0x1994('0x34')][_0x1994('0x43')]){_0x5f4f7f[_0x1994('0x44')]=[{'all':!![]}];}_0x5f4f7f=_[_0x1994('0x40')]({},_0x5f4f7f,_0x545fa5[_0x1994('0x42')]);return db[_0x1994('0x2f')]['find'](_0x5f4f7f)[_0x1994('0x27')](handleEntityNotFound(_0x49e64a,null))[_0x1994('0x27')](respondWithResult(_0x49e64a,null))[_0x1994('0x46')](handleError(_0x49e64a,null));};exports[_0x1994('0x49')]=function(_0x8b029,_0x1900ee){return db['ServicenowConfiguration'][_0x1994('0x49')](_0x8b029[_0x1994('0x4a')],{})[_0x1994('0x27')](respondWithResult(_0x1900ee,0xc9))[_0x1994('0x46')](handleError(_0x1900ee,null));};exports['update']=function(_0x5d887c,_0x4e37de){if(_0x5d887c['body']['id']){delete _0x5d887c[_0x1994('0x4a')]['id'];}return db[_0x1994('0x2f')]['find']({'where':{'id':_0x5d887c[_0x1994('0x47')]['id']}})[_0x1994('0x27')](handleEntityNotFound(_0x4e37de,null))[_0x1994('0x27')](saveUpdates(_0x5d887c[_0x1994('0x4a')],null))['then'](respondWithResult(_0x4e37de,null))[_0x1994('0x46')](handleError(_0x4e37de,null));};exports[_0x1994('0x28')]=function(_0x3caa73,_0x20d1aa){return db[_0x1994('0x2f')][_0x1994('0x4b')]({'where':{'id':_0x3caa73[_0x1994('0x47')]['id']}})[_0x1994('0x27')](handleEntityNotFound(_0x20d1aa,null))[_0x1994('0x27')](removeEntity(_0x20d1aa,null))[_0x1994('0x46')](handleError(_0x20d1aa,null));};exports[_0x1994('0x4c')]=function(_0x504726,_0x18151f,_0x49c27f){var _0x2d4ca8={};var _0x116af9={};var _0x52e184;var _0x401335;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x504726[_0x1994('0x47')]['id']}})[_0x1994('0x27')](handleEntityNotFound(_0x18151f,null))[_0x1994('0x27')](function(_0x36a65a){if(_0x36a65a){_0x52e184=_0x36a65a;_0x116af9[_0x1994('0x33')]=_['keys'](db[_0x1994('0x4d')][_0x1994('0x30')]);_0x116af9[_0x1994('0x34')]=_['keys'](_0x504726['query']);_0x116af9[_0x1994('0x35')]=_[_0x1994('0x36')](_0x116af9['model'],_0x116af9[_0x1994('0x34')]);_0x2d4ca8[_0x1994('0x37')]=_[_0x1994('0x36')](_0x116af9[_0x1994('0x33')],qs[_0x1994('0x38')](_0x504726['query']['fields']));_0x2d4ca8[_0x1994('0x37')]=_0x2d4ca8[_0x1994('0x37')][_0x1994('0x39')]?_0x2d4ca8[_0x1994('0x37')]:_0x116af9[_0x1994('0x33')];_0x2d4ca8[_0x1994('0x3c')]=qs[_0x1994('0x4e')](_0x504726[_0x1994('0x34')]['sort']);_0x2d4ca8[_0x1994('0x3f')]=qs[_0x1994('0x35')](_['pick'](_0x504726[_0x1994('0x34')],_0x116af9['filters']));if(_0x504726[_0x1994('0x34')][_0x1994('0x3e')]){_0x2d4ca8[_0x1994('0x3f')]=_[_0x1994('0x40')](_0x2d4ca8['where'],{'$or':_[_0x1994('0x2e')](_0x2d4ca8[_0x1994('0x37')],function(_0x2bf1bb){var _0x2c4415={};_0x2c4415[_0x2bf1bb]={'$like':'%'+_0x504726[_0x1994('0x34')]['filter']+'%'};return _0x2c4415;})});}_0x2d4ca8=_['merge']({},_0x2d4ca8,_0x504726[_0x1994('0x42')]);return _0x52e184[_0x1994('0x4c')](_0x2d4ca8);}})[_0x1994('0x27')](function(_0x4504a4){if(_0x4504a4){_0x401335=_0x4504a4[_0x1994('0x39')];if(!_0x504726[_0x1994('0x34')][_0x1994('0x3a')](_0x1994('0x3b'))){_0x2d4ca8[_0x1994('0x1f')]=qs['limit'](_0x504726[_0x1994('0x34')][_0x1994('0x1f')]);_0x2d4ca8[_0x1994('0x22')]=qs[_0x1994('0x22')](_0x504726[_0x1994('0x34')]['offset']);}return _0x52e184[_0x1994('0x4c')](_0x2d4ca8);}})[_0x1994('0x27')](function(_0x4faa27){if(_0x4faa27){return _0x4faa27?{'count':_0x401335,'rows':_0x4faa27}:null;}})[_0x1994('0x27')](respondWithResult(_0x18151f,null))['catch'](handleError(_0x18151f,null));};exports[_0x1994('0x4f')]=function(_0x375db2,_0x391f4b,_0x3a6cb5){var _0x7b8f44={};var _0x3871a2={};var _0x5ae456;var _0x6fdd25;return db['ServicenowConfiguration'][_0x1994('0x50')]({'where':{'id':_0x375db2[_0x1994('0x47')]['id']}})[_0x1994('0x27')](handleEntityNotFound(_0x391f4b,null))[_0x1994('0x27')](function(_0x281d00){if(_0x281d00){_0x5ae456=_0x281d00;_0x3871a2[_0x1994('0x33')]=_[_0x1994('0x48')](db['ServicenowField'][_0x1994('0x30')]);_0x3871a2[_0x1994('0x34')]=_[_0x1994('0x48')](_0x375db2[_0x1994('0x34')]);_0x3871a2[_0x1994('0x35')]=_['intersection'](_0x3871a2[_0x1994('0x33')],_0x3871a2[_0x1994('0x34')]);_0x7b8f44[_0x1994('0x37')]=_[_0x1994('0x36')](_0x3871a2['model'],qs[_0x1994('0x38')](_0x375db2[_0x1994('0x34')][_0x1994('0x38')]));_0x7b8f44[_0x1994('0x37')]=_0x7b8f44[_0x1994('0x37')][_0x1994('0x39')]?_0x7b8f44[_0x1994('0x37')]:_0x3871a2['model'];_0x7b8f44[_0x1994('0x3c')]=qs[_0x1994('0x4e')](_0x375db2[_0x1994('0x34')][_0x1994('0x4e')]);_0x7b8f44[_0x1994('0x3f')]=qs[_0x1994('0x35')](_[_0x1994('0x3d')](_0x375db2[_0x1994('0x34')],_0x3871a2[_0x1994('0x35')]));if(_0x375db2[_0x1994('0x34')][_0x1994('0x3e')]){_0x7b8f44[_0x1994('0x3f')]=_[_0x1994('0x40')](_0x7b8f44['where'],{'$or':_[_0x1994('0x2e')](_0x7b8f44[_0x1994('0x37')],function(_0x35c08c){var _0x52435d={};_0x52435d[_0x35c08c]={'$like':'%'+_0x375db2['query']['filter']+'%'};return _0x52435d;})});}_0x7b8f44=_[_0x1994('0x40')]({},_0x7b8f44,_0x375db2[_0x1994('0x42')]);return _0x5ae456[_0x1994('0x4f')](_0x7b8f44);}})[_0x1994('0x27')](function(_0xa7da29){if(_0xa7da29){_0x6fdd25=_0xa7da29['length'];if(!_0x375db2['query'][_0x1994('0x3a')](_0x1994('0x3b'))){_0x7b8f44[_0x1994('0x1f')]=qs[_0x1994('0x1f')](_0x375db2[_0x1994('0x34')][_0x1994('0x1f')]);_0x7b8f44[_0x1994('0x22')]=qs[_0x1994('0x22')](_0x375db2['query'][_0x1994('0x22')]);}return _0x5ae456[_0x1994('0x4f')](_0x7b8f44);}})[_0x1994('0x27')](function(_0x5ade6c){if(_0x5ade6c){return _0x5ade6c?{'count':_0x6fdd25,'rows':_0x5ade6c}:null;}})[_0x1994('0x27')](respondWithResult(_0x391f4b,null))[_0x1994('0x46')](handleError(_0x391f4b,null));};exports['getDescriptions']=function(_0x20483e,_0x40f8c9,_0x4b4942){var _0x36aa9f={};var _0xb7bb10={};var _0x95c986;var _0x272f1c;return db[_0x1994('0x2f')]['findOne']({'where':{'id':_0x20483e[_0x1994('0x47')]['id']}})['then'](handleEntityNotFound(_0x40f8c9,null))[_0x1994('0x27')](function(_0x15643f){if(_0x15643f){_0x95c986=_0x15643f;_0xb7bb10[_0x1994('0x33')]=_[_0x1994('0x48')](db['ServicenowField']['rawAttributes']);_0xb7bb10['query']=_[_0x1994('0x48')](_0x20483e[_0x1994('0x34')]);_0xb7bb10[_0x1994('0x35')]=_['intersection'](_0xb7bb10[_0x1994('0x33')],_0xb7bb10[_0x1994('0x34')]);_0x36aa9f['attributes']=_[_0x1994('0x36')](_0xb7bb10[_0x1994('0x33')],qs[_0x1994('0x38')](_0x20483e[_0x1994('0x34')][_0x1994('0x38')]));_0x36aa9f[_0x1994('0x37')]=_0x36aa9f[_0x1994('0x37')][_0x1994('0x39')]?_0x36aa9f[_0x1994('0x37')]:_0xb7bb10[_0x1994('0x33')];_0x36aa9f[_0x1994('0x3c')]=qs[_0x1994('0x4e')](_0x20483e[_0x1994('0x34')]['sort']);_0x36aa9f[_0x1994('0x3f')]=qs[_0x1994('0x35')](_[_0x1994('0x3d')](_0x20483e[_0x1994('0x34')],_0xb7bb10['filters']));if(_0x20483e[_0x1994('0x34')][_0x1994('0x3e')]){_0x36aa9f['where']=_[_0x1994('0x40')](_0x36aa9f[_0x1994('0x3f')],{'$or':_[_0x1994('0x2e')](_0x36aa9f[_0x1994('0x37')],function(_0x24af60){var _0x12b51e={};_0x12b51e[_0x24af60]={'$like':'%'+_0x20483e[_0x1994('0x34')]['filter']+'%'};return _0x12b51e;})});}_0x36aa9f=_[_0x1994('0x40')]({},_0x36aa9f,_0x20483e[_0x1994('0x42')]);return _0x95c986[_0x1994('0x51')](_0x36aa9f);}})[_0x1994('0x27')](function(_0x4ee2db){if(_0x4ee2db){_0x272f1c=_0x4ee2db[_0x1994('0x39')];if(!_0x20483e[_0x1994('0x34')][_0x1994('0x3a')](_0x1994('0x3b'))){_0x36aa9f[_0x1994('0x1f')]=qs['limit'](_0x20483e[_0x1994('0x34')][_0x1994('0x1f')]);_0x36aa9f[_0x1994('0x22')]=qs['offset'](_0x20483e['query'][_0x1994('0x22')]);}return _0x95c986[_0x1994('0x51')](_0x36aa9f);}})[_0x1994('0x27')](function(_0x57a98b){if(_0x57a98b){return _0x57a98b?{'count':_0x272f1c,'rows':_0x57a98b}:null;}})[_0x1994('0x27')](respondWithResult(_0x40f8c9,null))['catch'](handleError(_0x40f8c9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 949ebe0..01a2a33 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 _0x85f8=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x53e6f2,_0x5e87ce){var _0xb45883=function(_0xa0ea91){while(--_0xa0ea91){_0x53e6f2['push'](_0x53e6f2['shift']());}};_0xb45883(++_0x5e87ce);}(_0x85f8,0xd7));var _0x885f=function(_0x1337ed,_0x3c321d){_0x1337ed=_0x1337ed-0x0;var _0x3677cb=_0x85f8[_0x1337ed];return _0x3677cb;};'use strict';var _=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var logger=require(_0x885f('0x2'))(_0x885f('0x3'));var moment=require(_0x885f('0x4'));var BPromise=require(_0x885f('0x5'));var rp=require(_0x885f('0x6'));var fs=require('fs');var path=require(_0x885f('0x7'));var rimraf=require('rimraf');var config=require(_0x885f('0x8'));var attributes=require(_0x885f('0x9'));module[_0x885f('0xa')]=function(_0x52404d,_0x3800c6){return _0x52404d[_0x885f('0xb')](_0x885f('0xc'),attributes,{'tableName':_0x885f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7275=['./intServicenowConfiguration.attributes','define','int_servicenow_configurations','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x3b9007,_0x482404){var _0xfe01e7=function(_0x199ebf){while(--_0x199ebf){_0x3b9007['push'](_0x3b9007['shift']());}};_0xfe01e7(++_0x482404);}(_0x7275,0x143));var _0x5727=function(_0x5c0f0f,_0x3c991d){_0x5c0f0f=_0x5c0f0f-0x0;var _0x52e8f=_0x7275[_0x5c0f0f];return _0x52e8f;};'use strict';var _=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var logger=require(_0x5727('0x2'))('api');var moment=require(_0x5727('0x3'));var BPromise=require('bluebird');var rp=require(_0x5727('0x4'));var fs=require('fs');var path=require(_0x5727('0x5'));var rimraf=require('rimraf');var config=require(_0x5727('0x6'));var attributes=require(_0x5727('0x7'));module['exports']=function(_0x4c509e,_0x4872ba){return _0x4c509e[_0x5727('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x5727('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 363f53d..8f78df1 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 _0xc00e=['error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc00e,0xe1));var _0xec00=function(_0x5e90f4,_0xa3ce1d){_0x5e90f4=_0x5e90f4-0x0;var _0x56613a=_0xc00e[_0x5e90f4];return _0x56613a;};'use strict';var _=require(_0xec00('0x0'));var util=require(_0xec00('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xec00('0x2'));var fs=require('fs');var Redis=require(_0xec00('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xec00('0x4'))('rpc');var config=require(_0xec00('0x5'));var jayson=require(_0xec00('0x6'));var client=jayson[_0xec00('0x7')][_0xec00('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x743aa3,_0x5e33c3,_0x5791b1){return new BPromise(function(_0x545cbc,_0xf45578){return client[_0xec00('0x9')](_0x743aa3,_0x5791b1)[_0xec00('0xa')](function(_0x1e3b7c){logger[_0xec00('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e33c3,_0xec00('0xc'));logger['debug'](_0xec00('0xd'),_0x5e33c3,_0xec00('0xc'),JSON[_0xec00('0xe')](_0x1e3b7c));if(_0x1e3b7c['error']){if(_0x1e3b7c[_0xec00('0xf')][_0xec00('0x10')]===0x1f4){logger['error'](_0xec00('0x11'),_0x5e33c3,_0x1e3b7c[_0xec00('0xf')][_0xec00('0x12')]);return _0xf45578(_0x1e3b7c[_0xec00('0xf')][_0xec00('0x12')]);}logger[_0xec00('0xf')](_0xec00('0x11'),_0x5e33c3,_0x1e3b7c[_0xec00('0xf')][_0xec00('0x12')]);return _0x545cbc(_0x1e3b7c[_0xec00('0xf')]['message']);}else{logger[_0xec00('0xb')](_0xec00('0x11'),_0x5e33c3,'request\x20sent');_0x545cbc(_0x1e3b7c[_0xec00('0x13')][_0xec00('0x12')]);}})['catch'](function(_0x5441bd){logger[_0xec00('0xf')](_0xec00('0x11'),_0x5e33c3,_0x5441bd);_0xf45578(_0x5441bd);});});} \ No newline at end of file +var _0x3800=['code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3800,0x1a2));var _0x0380=function(_0xa3c72d,_0x830ba9){_0xa3c72d=_0xa3c72d-0x0;var _0xe49020=_0x3800[_0xa3c72d];return _0xe49020;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0380('0x0'));var BPromise=require(_0x0380('0x1'));var rs=require(_0x0380('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0380('0x3'))['db'];var utils=require(_0x0380('0x4'));var logger=require(_0x0380('0x5'))(_0x0380('0x6'));var config=require(_0x0380('0x7'));var jayson=require(_0x0380('0x8'));var client=jayson[_0x0380('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301d5f,_0x15e17e,_0x4fe5e3){return new BPromise(function(_0x14af97,_0x5beaff){return client[_0x0380('0xa')](_0x301d5f,_0x4fe5e3)[_0x0380('0xb')](function(_0x4debcd){logger[_0x0380('0xc')](_0x0380('0xd'),_0x15e17e,'request\x20sent');logger[_0x0380('0xe')](_0x0380('0xf'),_0x15e17e,_0x0380('0x10'),JSON[_0x0380('0x11')](_0x4debcd));if(_0x4debcd[_0x0380('0x12')]){if(_0x4debcd['error'][_0x0380('0x13')]===0x1f4){logger[_0x0380('0x12')](_0x0380('0xd'),_0x15e17e,_0x4debcd['error'][_0x0380('0x14')]);return _0x5beaff(_0x4debcd[_0x0380('0x12')]['message']);}logger[_0x0380('0x12')](_0x0380('0xd'),_0x15e17e,_0x4debcd[_0x0380('0x12')]['message']);return _0x14af97(_0x4debcd[_0x0380('0x12')][_0x0380('0x14')]);}else{logger[_0x0380('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x15e17e,'request\x20sent');_0x14af97(_0x4debcd[_0x0380('0x15')][_0x0380('0x14')]);}})[_0x0380('0x16')](function(_0xd2b418){logger[_0x0380('0x12')](_0x0380('0xd'),_0x15e17e,_0xd2b418);_0x5beaff(_0xd2b418);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index fc1e354..785db95 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 _0x7246=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','update','destroy','exports'];(function(_0x552c49,_0xecf1a8){var _0x1cdc85=function(_0x5d9566){while(--_0x5d9566){_0x552c49['push'](_0x552c49['shift']());}};_0x1cdc85(++_0xecf1a8);}(_0x7246,0xc6));var _0x6724=function(_0x10e7d9,_0x217ead){_0x10e7d9=_0x10e7d9-0x0;var _0x2e0ba5=_0x7246[_0x10e7d9];return _0x2e0ba5;};'use strict';var multer=require(_0x6724('0x0'));var util=require('util');var path=require(_0x6724('0x1'));var timeout=require(_0x6724('0x2'));var express=require('express');var router=express[_0x6724('0x3')]();var fs_extra=require(_0x6724('0x4'));var auth=require(_0x6724('0x5'));var interaction=require(_0x6724('0x6'));var config=require(_0x6724('0x7'));var controller=require(_0x6724('0x8'));router['get']('/',auth[_0x6724('0x9')](),controller[_0x6724('0xa')]);router[_0x6724('0xb')](_0x6724('0xc'),auth[_0x6724('0x9')](),controller[_0x6724('0xd')]);router[_0x6724('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6724('0xc'),auth[_0x6724('0x9')](),controller[_0x6724('0xf')]);router['delete'](_0x6724('0xc'),auth[_0x6724('0x9')](),controller[_0x6724('0x10')]);module[_0x6724('0x11')]=router; \ No newline at end of file +var _0xd6f0=['show','create','put','delete','destroy','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated'];(function(_0x59af65,_0x186086){var _0x5bb1ad=function(_0x584350){while(--_0x584350){_0x59af65['push'](_0x59af65['shift']());}};_0x5bb1ad(++_0x186086);}(_0xd6f0,0x175));var _0x0d6f=function(_0x46ad9e,_0x203184){_0x46ad9e=_0x46ad9e-0x0;var _0x5727cb=_0xd6f0[_0x46ad9e];return _0x5727cb;};'use strict';var multer=require(_0x0d6f('0x0'));var util=require('util');var path=require(_0x0d6f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0d6f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0d6f('0x3'));var interaction=require(_0x0d6f('0x4'));var config=require(_0x0d6f('0x5'));var controller=require(_0x0d6f('0x6'));router[_0x0d6f('0x7')]('/',auth['isAuthenticated'](),controller[_0x0d6f('0x8')]);router[_0x0d6f('0x7')](_0x0d6f('0x9'),auth[_0x0d6f('0xa')](),controller[_0x0d6f('0xb')]);router['post']('/',auth[_0x0d6f('0xa')](),controller[_0x0d6f('0xc')]);router[_0x0d6f('0xd')](_0x0d6f('0x9'),auth[_0x0d6f('0xa')](),controller['update']);router[_0x0d6f('0xe')]('/:id',auth[_0x0d6f('0xa')](),controller[_0x0d6f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 6444bfe..17b9ae1 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 _0x7d8c=['exports','ENUM','variable','keyValue','picklist','string','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x5c73c8,_0x34d882){var _0x5dcf7e=function(_0x59857f){while(--_0x59857f){_0x5c73c8['push'](_0x5c73c8['shift']());}};_0x5dcf7e(++_0x34d882);}(_0x7d8c,0x121));var _0xc7d8=function(_0x175f6f,_0x4561fe){_0x175f6f=_0x175f6f-0x0;var _0x5a9bc4=_0x7d8c[_0x175f6f];return _0x5a9bc4;};'use strict';var Sequelize=require(_0xc7d8('0x0'));module[_0xc7d8('0x1')]={'type':{'type':Sequelize[_0xc7d8('0x2')]('string',_0xc7d8('0x3'),'customVariable',_0xc7d8('0x4'),_0xc7d8('0x5')),'defaultValue':_0xc7d8('0x6')},'content':{'type':Sequelize[_0xc7d8('0x7')]},'key':{'type':Sequelize[_0xc7d8('0x7')]},'keyType':{'type':Sequelize[_0xc7d8('0x2')](_0xc7d8('0x6'),_0xc7d8('0x3'),_0xc7d8('0x8'))},'keyContent':{'type':Sequelize[_0xc7d8('0x7')]},'idField':{'type':Sequelize[_0xc7d8('0x7')]},'nameField':{'type':Sequelize[_0xc7d8('0x7')]},'customField':{'type':Sequelize[_0xc7d8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7b59=['variable','sequelize','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7b59,0x1a1));var _0x97b5=function(_0x2c36af,_0x33c9de){_0x2c36af=_0x2c36af-0x0;var _0x3439a4=_0x7b59[_0x2c36af];return _0x3439a4;};'use strict';var Sequelize=require(_0x97b5('0x0'));module[_0x97b5('0x1')]={'type':{'type':Sequelize[_0x97b5('0x2')](_0x97b5('0x3'),'variable',_0x97b5('0x4'),_0x97b5('0x5'),'picklist'),'defaultValue':_0x97b5('0x3')},'content':{'type':Sequelize[_0x97b5('0x6')]},'key':{'type':Sequelize[_0x97b5('0x6')]},'keyType':{'type':Sequelize[_0x97b5('0x2')](_0x97b5('0x3'),_0x97b5('0x7'),_0x97b5('0x4'))},'keyContent':{'type':Sequelize[_0x97b5('0x6')]},'idField':{'type':Sequelize[_0x97b5('0x6')]},'nameField':{'type':Sequelize[_0x97b5('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x97b5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 87a4137..23c5c21 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 _0xc0bc=['includeAll','include','findAll','rows','catch','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','type','options','ServicenowField'];(function(_0x30cfdc,_0x5a0260){var _0x54e0ac=function(_0x5497d3){while(--_0x5497d3){_0x30cfdc['push'](_0x30cfdc['shift']());}};_0x54e0ac(++_0x5a0260);}(_0xc0bc,0xee));var _0xcc0b=function(_0xc4b67f,_0x2539ac){_0xc4b67f=_0xc4b67f-0x0;var _0x361aed=_0xc0bc[_0xc4b67f];return _0x361aed;};'use strict';var emlformat=require(_0xcc0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc0b('0x1'));var jsonpatch=require(_0xcc0b('0x2'));var rp=require(_0xcc0b('0x3'));var moment=require('moment');var BPromise=require(_0xcc0b('0x4'));var Mustache=require(_0xcc0b('0x5'));var util=require(_0xcc0b('0x6'));var path=require('path');var sox=require(_0xcc0b('0x7'));var csv=require('to-csv');var ejs=require(_0xcc0b('0x8'));var fs=require('fs');var fs_extra=require(_0xcc0b('0x9'));var _=require(_0xcc0b('0xa'));var squel=require(_0xcc0b('0xb'));var crypto=require(_0xcc0b('0xc'));var jsforce=require(_0xcc0b('0xd'));var deskjs=require(_0xcc0b('0xe'));var toCsv=require(_0xcc0b('0xf'));var querystring=require(_0xcc0b('0x10'));var Papa=require(_0xcc0b('0x11'));var Redis=require(_0xcc0b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcc0b('0x13'));var as=require(_0xcc0b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc0b('0x15'))('api');var utils=require(_0xcc0b('0x16'));var config=require(_0xcc0b('0x17'));var licenseUtil=require(_0xcc0b('0x18'));var db=require(_0xcc0b('0x19'))['db'];function respondWithStatusCode(_0x4b0626,_0xc4b4f2){_0xc4b4f2=_0xc4b4f2||0xcc;return function(_0x5cebc3){if(_0x5cebc3){return _0x4b0626[_0xcc0b('0x1a')](_0xc4b4f2);}return _0x4b0626[_0xcc0b('0x1b')](_0xc4b4f2)[_0xcc0b('0x1c')]();};}function respondWithResult(_0x3ad862,_0x249ae7){_0x249ae7=_0x249ae7||0xc8;return function(_0x496bc5){if(_0x496bc5){return _0x3ad862[_0xcc0b('0x1b')](_0x249ae7)[_0xcc0b('0x1d')](_0x496bc5);}};}function respondWithFilteredResult(_0x372457,_0x380a81){return function(_0x161214){if(_0x161214){var _0x1157b5=typeof _0x380a81['offset']==='undefined'&&typeof _0x380a81[_0xcc0b('0x1e')]===_0xcc0b('0x1f');var _0x44aab9=_0x161214['count'];var _0x313d22=_0x1157b5?0x0:_0x380a81[_0xcc0b('0x20')];var _0x36bbbe=_0x1157b5?_0x161214[_0xcc0b('0x21')]:_0x380a81[_0xcc0b('0x20')]+_0x380a81[_0xcc0b('0x1e')];var _0x4fc016;if(_0x36bbbe>=_0x44aab9){_0x36bbbe=_0x44aab9;_0x4fc016=0xc8;}else{_0x4fc016=0xce;}_0x372457[_0xcc0b('0x1b')](_0x4fc016);return _0x372457['set'](_0xcc0b('0x22'),_0x313d22+'-'+_0x36bbbe+'/'+_0x44aab9)[_0xcc0b('0x1d')](_0x161214);}return null;};}function patchUpdates(_0x2cc4ce){return function(_0x5139d9){try{jsonpatch[_0xcc0b('0x23')](_0x5139d9,_0x2cc4ce,!![]);}catch(_0x594dd2){return BPromise[_0xcc0b('0x24')](_0x594dd2);}return _0x5139d9[_0xcc0b('0x25')]();};}function saveUpdates(_0xb0e1e7,_0x1f554b){return function(_0x20bf75){if(_0x20bf75){return _0x20bf75['update'](_0xb0e1e7)[_0xcc0b('0x26')](function(_0x2769c8){return _0x2769c8;});}return null;};}function removeEntity(_0x19e165,_0xa634d7){return function(_0x2b73bf){if(_0x2b73bf){return _0x2b73bf[_0xcc0b('0x27')]()[_0xcc0b('0x26')](function(){_0x19e165[_0xcc0b('0x1b')](0xcc)[_0xcc0b('0x1c')]();});}};}function handleEntityNotFound(_0x4849df,_0xc8284b){return function(_0x51e6a0){if(!_0x51e6a0){_0x4849df[_0xcc0b('0x1a')](0x194);}return _0x51e6a0;};}function handleError(_0xaa48c6,_0x421f3c){_0x421f3c=_0x421f3c||0x1f4;return function(_0x40c04d){logger[_0xcc0b('0x28')](_0x40c04d[_0xcc0b('0x29')]);if(_0x40c04d[_0xcc0b('0x2a')]){delete _0x40c04d[_0xcc0b('0x2a')];}_0xaa48c6[_0xcc0b('0x1b')](_0x421f3c)[_0xcc0b('0x2b')](_0x40c04d);};}exports[_0xcc0b('0x2c')]=function(_0x25c601,_0x491a23){var _0x1cc064={},_0x125401={},_0x1661b2={'count':0x0,'rows':[]};var _0x554d8a=_[_0xcc0b('0x2d')](db['ServicenowField'][_0xcc0b('0x2e')],function(_0x1ae6ce){return{'name':_0x1ae6ce[_0xcc0b('0x2f')],'type':_0x1ae6ce['type']['key']};});_0x125401['model']=_[_0xcc0b('0x2d')](_0x554d8a,'name');_0x125401[_0xcc0b('0x30')]=_[_0xcc0b('0x31')](_0x25c601[_0xcc0b('0x30')]);_0x125401['filters']=_[_0xcc0b('0x32')](_0x125401[_0xcc0b('0x33')],_0x125401['query']);_0x1cc064[_0xcc0b('0x34')]=_[_0xcc0b('0x32')](_0x125401['model'],qs[_0xcc0b('0x35')](_0x25c601['query'][_0xcc0b('0x35')]));_0x1cc064[_0xcc0b('0x34')]=_0x1cc064[_0xcc0b('0x34')][_0xcc0b('0x36')]?_0x1cc064['attributes']:_0x125401[_0xcc0b('0x33')];if(!_0x25c601[_0xcc0b('0x30')]['hasOwnProperty'](_0xcc0b('0x37'))){_0x1cc064[_0xcc0b('0x1e')]=qs['limit'](_0x25c601['query']['limit']);_0x1cc064[_0xcc0b('0x20')]=qs['offset'](_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x20')]);}_0x1cc064[_0xcc0b('0x38')]=qs[_0xcc0b('0x39')](_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x39')]);_0x1cc064[_0xcc0b('0x3a')]=qs['filters'](_[_0xcc0b('0x3b')](_0x25c601[_0xcc0b('0x30')],_0x125401[_0xcc0b('0x3c')]),_0x554d8a);if(_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x3d')]){_0x1cc064[_0xcc0b('0x3a')]=_[_0xcc0b('0x3e')](_0x1cc064[_0xcc0b('0x3a')],{'$or':_[_0xcc0b('0x2d')](_0x554d8a,function(_0x255a65){if(_0x255a65[_0xcc0b('0x3f')]!=='VIRTUAL'){var _0x13fa0b={};_0x13fa0b[_0x255a65[_0xcc0b('0x2a')]]={'$like':'%'+_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x3d')]+'%'};return _0x13fa0b;}})});}_0x1cc064=_[_0xcc0b('0x3e')]({},_0x1cc064,_0x25c601[_0xcc0b('0x40')]);var _0x30f21e={'where':_0x1cc064[_0xcc0b('0x3a')]};return db[_0xcc0b('0x41')][_0xcc0b('0x21')](_0x30f21e)[_0xcc0b('0x26')](function(_0x417161){_0x1661b2[_0xcc0b('0x21')]=_0x417161;if(_0x25c601[_0xcc0b('0x30')][_0xcc0b('0x42')]){_0x1cc064[_0xcc0b('0x43')]=[{'all':!![]}];}return db[_0xcc0b('0x41')][_0xcc0b('0x44')](_0x1cc064);})['then'](function(_0x960fd9){_0x1661b2[_0xcc0b('0x45')]=_0x960fd9;return _0x1661b2;})[_0xcc0b('0x26')](respondWithFilteredResult(_0x491a23,_0x1cc064))[_0xcc0b('0x46')](handleError(_0x491a23,null));};exports['show']=function(_0x43a9ff,_0x392a2a){var _0x5f1310={'raw':!![],'where':{'id':_0x43a9ff[_0xcc0b('0x47')]['id']}},_0x251752={};_0x251752[_0xcc0b('0x33')]=_[_0xcc0b('0x31')](db[_0xcc0b('0x41')][_0xcc0b('0x2e')]);_0x251752['query']=_[_0xcc0b('0x31')](_0x43a9ff[_0xcc0b('0x30')]);_0x251752[_0xcc0b('0x3c')]=_['intersection'](_0x251752[_0xcc0b('0x33')],_0x251752[_0xcc0b('0x30')]);_0x5f1310[_0xcc0b('0x34')]=_['intersection'](_0x251752['model'],qs[_0xcc0b('0x35')](_0x43a9ff['query'][_0xcc0b('0x35')]));_0x5f1310[_0xcc0b('0x34')]=_0x5f1310[_0xcc0b('0x34')]['length']?_0x5f1310['attributes']:_0x251752[_0xcc0b('0x33')];if(_0x43a9ff[_0xcc0b('0x30')][_0xcc0b('0x42')]){_0x5f1310[_0xcc0b('0x43')]=[{'all':!![]}];}_0x5f1310=_[_0xcc0b('0x3e')]({},_0x5f1310,_0x43a9ff['options']);return db[_0xcc0b('0x41')][_0xcc0b('0x48')](_0x5f1310)[_0xcc0b('0x26')](handleEntityNotFound(_0x392a2a,null))[_0xcc0b('0x26')](respondWithResult(_0x392a2a,null))[_0xcc0b('0x46')](handleError(_0x392a2a,null));};exports[_0xcc0b('0x49')]=function(_0x570235,_0x7f6306){return db[_0xcc0b('0x41')]['create'](_0x570235[_0xcc0b('0x4a')],{})['then'](respondWithResult(_0x7f6306,0xc9))[_0xcc0b('0x46')](handleError(_0x7f6306,null));};exports[_0xcc0b('0x4b')]=function(_0x4592b3,_0x221f06){if(_0x4592b3[_0xcc0b('0x4a')]['id']){delete _0x4592b3[_0xcc0b('0x4a')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x4592b3[_0xcc0b('0x47')]['id']}})[_0xcc0b('0x26')](handleEntityNotFound(_0x221f06,null))[_0xcc0b('0x26')](saveUpdates(_0x4592b3['body'],null))[_0xcc0b('0x26')](respondWithResult(_0x221f06,null))['catch'](handleError(_0x221f06,null));};exports[_0xcc0b('0x27')]=function(_0x44d4d7,_0x1e6e7b){return db[_0xcc0b('0x41')][_0xcc0b('0x48')]({'where':{'id':_0x44d4d7[_0xcc0b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e6e7b,null))[_0xcc0b('0x26')](removeEntity(_0x1e6e7b,null))['catch'](handleError(_0x1e6e7b,null));}; \ No newline at end of file +var _0x0eee=['set','apply','save','then','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ServicenowField','findAll','catch','show','params','keys','find','create','body','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x0eee,0x101));var _0xe0ee=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x0eee[_0xa6cc5c];return _0x44803d;};'use strict';var emlformat=require(_0xe0ee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe0ee('0x1'));var rp=require(_0xe0ee('0x2'));var moment=require(_0xe0ee('0x3'));var BPromise=require(_0xe0ee('0x4'));var Mustache=require('mustache');var util=require(_0xe0ee('0x5'));var path=require(_0xe0ee('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0ee('0x7'));var _=require('lodash');var squel=require(_0xe0ee('0x8'));var crypto=require('crypto');var jsforce=require(_0xe0ee('0x9'));var deskjs=require(_0xe0ee('0xa'));var toCsv=require(_0xe0ee('0xb'));var querystring=require(_0xe0ee('0xc'));var Papa=require(_0xe0ee('0xd'));var Redis=require(_0xe0ee('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe0ee('0xf'));var as=require(_0xe0ee('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0ee('0x11'))(_0xe0ee('0x12'));var utils=require(_0xe0ee('0x13'));var config=require(_0xe0ee('0x14'));var licenseUtil=require(_0xe0ee('0x15'));var db=require(_0xe0ee('0x16'))['db'];function respondWithStatusCode(_0x203a20,_0xe2d089){_0xe2d089=_0xe2d089||0xcc;return function(_0x2723a0){if(_0x2723a0){return _0x203a20[_0xe0ee('0x17')](_0xe2d089);}return _0x203a20['status'](_0xe2d089)[_0xe0ee('0x18')]();};}function respondWithResult(_0x453139,_0x262b0c){_0x262b0c=_0x262b0c||0xc8;return function(_0x9e2267){if(_0x9e2267){return _0x453139[_0xe0ee('0x19')](_0x262b0c)[_0xe0ee('0x1a')](_0x9e2267);}};}function respondWithFilteredResult(_0x5456c1,_0x25c8a6){return function(_0x280439){if(_0x280439){var _0x1fc911=typeof _0x25c8a6[_0xe0ee('0x1b')]==='undefined'&&typeof _0x25c8a6[_0xe0ee('0x1c')]===_0xe0ee('0x1d');var _0x20aa34=_0x280439[_0xe0ee('0x1e')];var _0x4f5489=_0x1fc911?0x0:_0x25c8a6[_0xe0ee('0x1b')];var _0x489222=_0x1fc911?_0x280439[_0xe0ee('0x1e')]:_0x25c8a6['offset']+_0x25c8a6[_0xe0ee('0x1c')];var _0x1189c5;if(_0x489222>=_0x20aa34){_0x489222=_0x20aa34;_0x1189c5=0xc8;}else{_0x1189c5=0xce;}_0x5456c1['status'](_0x1189c5);return _0x5456c1[_0xe0ee('0x1f')]('Content-Range',_0x4f5489+'-'+_0x489222+'/'+_0x20aa34)[_0xe0ee('0x1a')](_0x280439);}return null;};}function patchUpdates(_0x43592d){return function(_0x2df56c){try{jsonpatch[_0xe0ee('0x20')](_0x2df56c,_0x43592d,!![]);}catch(_0x17cd3f){return BPromise['reject'](_0x17cd3f);}return _0x2df56c[_0xe0ee('0x21')]();};}function saveUpdates(_0x8c488e,_0x143948){return function(_0x28e0bb){if(_0x28e0bb){return _0x28e0bb['update'](_0x8c488e)[_0xe0ee('0x22')](function(_0xd904ed){return _0xd904ed;});}return null;};}function removeEntity(_0x2432aa,_0x138e60){return function(_0x295e40){if(_0x295e40){return _0x295e40['destroy']()['then'](function(){_0x2432aa['status'](0xcc)[_0xe0ee('0x18')]();});}};}function handleEntityNotFound(_0x2fd635,_0x11d83b){return function(_0x1ff218){if(!_0x1ff218){_0x2fd635['sendStatus'](0x194);}return _0x1ff218;};}function handleError(_0x521dd2,_0x4e6192){_0x4e6192=_0x4e6192||0x1f4;return function(_0x19edb8){logger['error'](_0x19edb8['stack']);if(_0x19edb8[_0xe0ee('0x23')]){delete _0x19edb8[_0xe0ee('0x23')];}_0x521dd2['status'](_0x4e6192)[_0xe0ee('0x24')](_0x19edb8);};}exports[_0xe0ee('0x25')]=function(_0x3c752b,_0x3f9c44){var _0x1e3c5e={},_0x37df4d={},_0x2962a8={'count':0x0,'rows':[]};var _0xe4b8b2=_[_0xe0ee('0x26')](db['ServicenowField'][_0xe0ee('0x27')],function(_0x2fd3d7){return{'name':_0x2fd3d7[_0xe0ee('0x28')],'type':_0x2fd3d7[_0xe0ee('0x29')][_0xe0ee('0x2a')]};});_0x37df4d[_0xe0ee('0x2b')]=_[_0xe0ee('0x26')](_0xe4b8b2,_0xe0ee('0x23'));_0x37df4d[_0xe0ee('0x2c')]=_['keys'](_0x3c752b[_0xe0ee('0x2c')]);_0x37df4d[_0xe0ee('0x2d')]=_[_0xe0ee('0x2e')](_0x37df4d[_0xe0ee('0x2b')],_0x37df4d[_0xe0ee('0x2c')]);_0x1e3c5e[_0xe0ee('0x2f')]=_[_0xe0ee('0x2e')](_0x37df4d[_0xe0ee('0x2b')],qs[_0xe0ee('0x30')](_0x3c752b[_0xe0ee('0x2c')][_0xe0ee('0x30')]));_0x1e3c5e[_0xe0ee('0x2f')]=_0x1e3c5e[_0xe0ee('0x2f')][_0xe0ee('0x31')]?_0x1e3c5e[_0xe0ee('0x2f')]:_0x37df4d[_0xe0ee('0x2b')];if(!_0x3c752b[_0xe0ee('0x2c')][_0xe0ee('0x32')]('nolimit')){_0x1e3c5e[_0xe0ee('0x1c')]=qs[_0xe0ee('0x1c')](_0x3c752b['query']['limit']);_0x1e3c5e[_0xe0ee('0x1b')]=qs[_0xe0ee('0x1b')](_0x3c752b[_0xe0ee('0x2c')]['offset']);}_0x1e3c5e[_0xe0ee('0x33')]=qs[_0xe0ee('0x34')](_0x3c752b[_0xe0ee('0x2c')][_0xe0ee('0x34')]);_0x1e3c5e[_0xe0ee('0x35')]=qs[_0xe0ee('0x2d')](_[_0xe0ee('0x36')](_0x3c752b[_0xe0ee('0x2c')],_0x37df4d['filters']),_0xe4b8b2);if(_0x3c752b[_0xe0ee('0x2c')][_0xe0ee('0x37')]){_0x1e3c5e[_0xe0ee('0x35')]=_[_0xe0ee('0x38')](_0x1e3c5e[_0xe0ee('0x35')],{'$or':_[_0xe0ee('0x26')](_0xe4b8b2,function(_0x15af93){if(_0x15af93['type']!==_0xe0ee('0x39')){var _0x596d7a={};_0x596d7a[_0x15af93['name']]={'$like':'%'+_0x3c752b['query'][_0xe0ee('0x37')]+'%'};return _0x596d7a;}})});}_0x1e3c5e=_[_0xe0ee('0x38')]({},_0x1e3c5e,_0x3c752b[_0xe0ee('0x3a')]);var _0x141f16={'where':_0x1e3c5e[_0xe0ee('0x35')]};return db['ServicenowField'][_0xe0ee('0x1e')](_0x141f16)['then'](function(_0x21c941){_0x2962a8[_0xe0ee('0x1e')]=_0x21c941;if(_0x3c752b[_0xe0ee('0x2c')][_0xe0ee('0x3b')]){_0x1e3c5e[_0xe0ee('0x3c')]=[{'all':!![]}];}return db[_0xe0ee('0x3d')][_0xe0ee('0x3e')](_0x1e3c5e);})[_0xe0ee('0x22')](function(_0x5d340f){_0x2962a8['rows']=_0x5d340f;return _0x2962a8;})[_0xe0ee('0x22')](respondWithFilteredResult(_0x3f9c44,_0x1e3c5e))[_0xe0ee('0x3f')](handleError(_0x3f9c44,null));};exports[_0xe0ee('0x40')]=function(_0x16e302,_0x4372d3){var _0x19086f={'raw':!![],'where':{'id':_0x16e302[_0xe0ee('0x41')]['id']}},_0x2ca836={};_0x2ca836[_0xe0ee('0x2b')]=_['keys'](db[_0xe0ee('0x3d')]['rawAttributes']);_0x2ca836[_0xe0ee('0x2c')]=_[_0xe0ee('0x42')](_0x16e302[_0xe0ee('0x2c')]);_0x2ca836[_0xe0ee('0x2d')]=_[_0xe0ee('0x2e')](_0x2ca836[_0xe0ee('0x2b')],_0x2ca836[_0xe0ee('0x2c')]);_0x19086f[_0xe0ee('0x2f')]=_[_0xe0ee('0x2e')](_0x2ca836[_0xe0ee('0x2b')],qs[_0xe0ee('0x30')](_0x16e302[_0xe0ee('0x2c')]['fields']));_0x19086f[_0xe0ee('0x2f')]=_0x19086f[_0xe0ee('0x2f')][_0xe0ee('0x31')]?_0x19086f[_0xe0ee('0x2f')]:_0x2ca836[_0xe0ee('0x2b')];if(_0x16e302[_0xe0ee('0x2c')][_0xe0ee('0x3b')]){_0x19086f[_0xe0ee('0x3c')]=[{'all':!![]}];}_0x19086f=_[_0xe0ee('0x38')]({},_0x19086f,_0x16e302[_0xe0ee('0x3a')]);return db[_0xe0ee('0x3d')][_0xe0ee('0x43')](_0x19086f)[_0xe0ee('0x22')](handleEntityNotFound(_0x4372d3,null))[_0xe0ee('0x22')](respondWithResult(_0x4372d3,null))['catch'](handleError(_0x4372d3,null));};exports[_0xe0ee('0x44')]=function(_0x2353e9,_0x3ef0d8){return db[_0xe0ee('0x3d')][_0xe0ee('0x44')](_0x2353e9[_0xe0ee('0x45')],{})['then'](respondWithResult(_0x3ef0d8,0xc9))[_0xe0ee('0x3f')](handleError(_0x3ef0d8,null));};exports[_0xe0ee('0x46')]=function(_0x383000,_0x1ac079){if(_0x383000['body']['id']){delete _0x383000['body']['id'];}return db[_0xe0ee('0x3d')][_0xe0ee('0x43')]({'where':{'id':_0x383000['params']['id']}})['then'](handleEntityNotFound(_0x1ac079,null))['then'](saveUpdates(_0x383000[_0xe0ee('0x45')],null))[_0xe0ee('0x22')](respondWithResult(_0x1ac079,null))[_0xe0ee('0x3f')](handleError(_0x1ac079,null));};exports[_0xe0ee('0x47')]=function(_0xc46593,_0x44a675){return db[_0xe0ee('0x3d')][_0xe0ee('0x43')]({'where':{'id':_0xc46593['params']['id']}})[_0xe0ee('0x22')](handleEntityNotFound(_0x44a675,null))[_0xe0ee('0x22')](removeEntity(_0x44a675,null))[_0xe0ee('0x3f')](handleError(_0x44a675,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c7f3ce4..a487b45 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 _0x9a1c=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields'];(function(_0x1ada4f,_0x1ad6fe){var _0x5336ca=function(_0x41bad2){while(--_0x41bad2){_0x1ada4f['push'](_0x1ada4f['shift']());}};_0x5336ca(++_0x1ad6fe);}(_0x9a1c,0xec));var _0xc9a1=function(_0x3cd803,_0x1dd6ef){_0x3cd803=_0x3cd803-0x0;var _0x46f497=_0x9a1c[_0x3cd803];return _0x46f497;};'use strict';var _=require(_0xc9a1('0x0'));var util=require(_0xc9a1('0x1'));var logger=require(_0xc9a1('0x2'))(_0xc9a1('0x3'));var moment=require('moment');var BPromise=require(_0xc9a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9a1('0x5'));var rimraf=require(_0xc9a1('0x6'));var config=require('../../config/environment');var attributes=require(_0xc9a1('0x7'));module['exports']=function(_0x51ff16,_0x890b66){return _0x51ff16[_0xc9a1('0x8')](_0xc9a1('0x9'),attributes,{'tableName':_0xc9a1('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xc9a1('0xb'),_0xc9a1('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf550=['./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xcfd5cf,_0x196d54){var _0x4610d8=function(_0xecd4aa){while(--_0xecd4aa){_0xcfd5cf['push'](_0xcfd5cf['shift']());}};_0x4610d8(++_0x196d54);}(_0xf550,0x1d9));var _0x0f55=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xf550[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require(_0x0f55('0x0'));var util=require(_0x0f55('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0f55('0x2'));var BPromise=require(_0x0f55('0x3'));var rp=require(_0x0f55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f55('0x5'));var config=require(_0x0f55('0x6'));var attributes=require(_0x0f55('0x7'));module[_0x0f55('0x8')]=function(_0x52cd88,_0x11c73e){return _0x52cd88[_0x0f55('0x9')](_0x0f55('0xa'),attributes,{'tableName':_0x0f55('0xb'),'paranoid':![],'indexes':[{'name':_0x0f55('0xc'),'fields':[_0x0f55('0xd'),_0x0f55('0xe')],'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 4ad154c..4005f0e 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5005f8,_0x224a58){var _0x31f0f2=function(_0x3deaf2){while(--_0x3deaf2){_0x5005f8['push'](_0x5005f8['shift']());}};_0x31f0f2(++_0x224a58);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5d5722,_0x12c42e){_0x5d5722=_0x5d5722-0x0;var _0x456902=_0xb43b[_0x5d5722];return _0x456902;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2b4cd0,_0x457878){var _0x474616=function(_0x435315){while(--_0x435315){_0x2b4cd0['push'](_0x2b4cd0['shift']());}};_0x474616(++_0x457878);}(_0xaa88,0x137));var _0x8aa8=function(_0x414655,_0x79d916){_0x414655=_0x414655-0x0;var _0x237884=_0xaa88[_0x414655];return _0x237884;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 742c72b..21a4f8b 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(_0x43fcb1,_0x59f11b){var _0x528a61=function(_0x4874d8){while(--_0x4874d8){_0x43fcb1['push'](_0x43fcb1['shift']());}};_0x528a61(++_0x59f11b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xe01a45,_0x4ab55a){var _0x290f12=function(_0x5d1123){while(--_0x5d1123){_0xe01a45['push'](_0xe01a45['shift']());}};_0x290f12(++_0x4ab55a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index a4a5f48..c7ab856 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(_0x5ca455,_0x2da58d){var _0x224f52=function(_0x5071b2){while(--_0x5071b2){_0x5ca455['push'](_0x5ca455['shift']());}};_0x224f52(++_0x2da58d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x34b3cb,_0x540bfb){var _0x5c3c6f=function(_0x3e42d1){while(--_0x3e42d1){_0x34b3cb['push'](_0x34b3cb['shift']());}};_0x5c3c6f(++_0x540bfb);}(_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 bbbd277..a329566 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 _0x45ea=['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','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','include','catch','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0x8b10df,_0x3e8405){var _0x3cb4e8=function(_0x2a65ed){while(--_0x2a65ed){_0x8b10df['push'](_0x8b10df['shift']());}};_0x3cb4e8(++_0x3e8405);}(_0x45ea,0x160));var _0xa45e=function(_0x2f7825,_0x361076){_0x2f7825=_0x2f7825-0x0;var _0xa89e46=_0x45ea[_0x2f7825];return _0xa89e46;};'use strict';var emlformat=require(_0xa45e('0x0'));var rimraf=require(_0xa45e('0x1'));var zipdir=require(_0xa45e('0x2'));var jsonpatch=require(_0xa45e('0x3'));var rp=require(_0xa45e('0x4'));var moment=require(_0xa45e('0x5'));var BPromise=require(_0xa45e('0x6'));var Mustache=require('mustache');var util=require(_0xa45e('0x7'));var path=require(_0xa45e('0x8'));var sox=require(_0xa45e('0x9'));var csv=require(_0xa45e('0xa'));var ejs=require(_0xa45e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa45e('0xc'));var squel=require(_0xa45e('0xd'));var crypto=require(_0xa45e('0xe'));var jsforce=require(_0xa45e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa45e('0xa'));var querystring=require(_0xa45e('0x10'));var Papa=require(_0xa45e('0x11'));var Redis=require(_0xa45e('0x12'));var authService=require(_0xa45e('0x13'));var qs=require(_0xa45e('0x14'));var as=require(_0xa45e('0x15'));var hardwareService=require(_0xa45e('0x16'));var logger=require(_0xa45e('0x17'))(_0xa45e('0x18'));var utils=require(_0xa45e('0x19'));var config=require(_0xa45e('0x1a'));var licenseUtil=require(_0xa45e('0x1b'));var db=require(_0xa45e('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x373aed,_0x1c7664){_0x1c7664=_0x1c7664||0xcc;return function(_0x559940){if(_0x559940){return _0x373aed[_0xa45e('0x1d')](_0x1c7664);}return _0x373aed[_0xa45e('0x1e')](_0x1c7664)[_0xa45e('0x1f')]();};}function respondWithResult(_0x5d118e,_0x27344b){_0x27344b=_0x27344b||0xc8;return function(_0x1e63c2){if(_0x1e63c2){return _0x5d118e[_0xa45e('0x1e')](_0x27344b)[_0xa45e('0x20')](_0x1e63c2);}};}function respondWithFilteredResult(_0x5a39e6,_0x59925d){return function(_0x912a97){if(_0x912a97){var _0x23691c=typeof _0x59925d['offset']===_0xa45e('0x21')&&typeof _0x59925d[_0xa45e('0x22')]===_0xa45e('0x21');var _0x2012f8=_0x912a97[_0xa45e('0x23')];var _0x170d07=_0x23691c?0x0:_0x59925d[_0xa45e('0x24')];var _0x2136c2=_0x23691c?_0x912a97[_0xa45e('0x23')]:_0x59925d[_0xa45e('0x24')]+_0x59925d[_0xa45e('0x22')];var _0x38f915;if(_0x2136c2>=_0x2012f8){_0x2136c2=_0x2012f8;_0x38f915=0xc8;}else{_0x38f915=0xce;}_0x5a39e6[_0xa45e('0x1e')](_0x38f915);return _0x5a39e6['set']('Content-Range',_0x170d07+'-'+_0x2136c2+'/'+_0x2012f8)[_0xa45e('0x20')](_0x912a97);}return null;};}function patchUpdates(_0x4506bd){return function(_0x12d100){try{jsonpatch[_0xa45e('0x25')](_0x12d100,_0x4506bd,!![]);}catch(_0x106f98){return BPromise[_0xa45e('0x26')](_0x106f98);}return _0x12d100[_0xa45e('0x27')]();};}function saveUpdates(_0x1db5f6,_0x3c35eb){return function(_0x5ad888){if(_0x5ad888){return _0x5ad888[_0xa45e('0x28')](_0x1db5f6)[_0xa45e('0x29')](function(_0x52a8a1){return _0x52a8a1;});}return null;};}function removeEntity(_0x22c935,_0x445259){return function(_0x1c5193){if(_0x1c5193){return _0x1c5193[_0xa45e('0x2a')]()[_0xa45e('0x29')](function(){_0x22c935[_0xa45e('0x1e')](0xcc)[_0xa45e('0x1f')]();});}};}function handleEntityNotFound(_0x3c7605,_0x619451){return function(_0x62775f){if(!_0x62775f){_0x3c7605[_0xa45e('0x1d')](0x194);}return _0x62775f;};}function handleError(_0x21f082,_0x5e13f7){_0x5e13f7=_0x5e13f7||0x1f4;return function(_0x1a7f33){logger[_0xa45e('0x2b')](_0x1a7f33[_0xa45e('0x2c')]);if(_0x1a7f33[_0xa45e('0x2d')]){delete _0x1a7f33['name'];}_0x21f082[_0xa45e('0x1e')](_0x5e13f7)[_0xa45e('0x2e')](_0x1a7f33);};}exports[_0xa45e('0x2f')]=function(_0x3e6e5d,_0x450ddf){var _0x47101f={},_0x3d2de6={},_0x59eda0={'count':0x0,'rows':[]};var _0x2b300f=_[_0xa45e('0x30')](db[_0xa45e('0x31')]['rawAttributes'],function(_0x3bf9ff){return{'name':_0x3bf9ff['fieldName'],'type':_0x3bf9ff[_0xa45e('0x32')][_0xa45e('0x33')]};});_0x3d2de6[_0xa45e('0x34')]=_[_0xa45e('0x30')](_0x2b300f,'name');_0x3d2de6[_0xa45e('0x35')]=_[_0xa45e('0x36')](_0x3e6e5d['query']);_0x3d2de6[_0xa45e('0x37')]=_[_0xa45e('0x38')](_0x3d2de6[_0xa45e('0x34')],_0x3d2de6['query']);_0x47101f[_0xa45e('0x39')]=_[_0xa45e('0x38')](_0x3d2de6[_0xa45e('0x34')],qs[_0xa45e('0x3a')](_0x3e6e5d['query'][_0xa45e('0x3a')]));_0x47101f[_0xa45e('0x39')]=_0x47101f[_0xa45e('0x39')][_0xa45e('0x3b')]?_0x47101f['attributes']:_0x3d2de6[_0xa45e('0x34')];if(!_0x3e6e5d[_0xa45e('0x35')][_0xa45e('0x3c')](_0xa45e('0x3d'))){_0x47101f[_0xa45e('0x22')]=qs['limit'](_0x3e6e5d['query'][_0xa45e('0x22')]);_0x47101f[_0xa45e('0x24')]=qs[_0xa45e('0x24')](_0x3e6e5d[_0xa45e('0x35')]['offset']);}_0x47101f['order']=qs[_0xa45e('0x3e')](_0x3e6e5d[_0xa45e('0x35')][_0xa45e('0x3e')]);_0x47101f[_0xa45e('0x3f')]=qs[_0xa45e('0x37')](_[_0xa45e('0x40')](_0x3e6e5d[_0xa45e('0x35')],_0x3d2de6['filters']),_0x2b300f);if(_0x3e6e5d['query']['filter']){_0x47101f[_0xa45e('0x3f')]=_['merge'](_0x47101f[_0xa45e('0x3f')],{'$or':_[_0xa45e('0x30')](_0x2b300f,function(_0x2fef74){if(_0x2fef74['type']!==_0xa45e('0x41')){var _0x39f0dc={};_0x39f0dc[_0x2fef74[_0xa45e('0x2d')]]={'$like':'%'+_0x3e6e5d[_0xa45e('0x35')][_0xa45e('0x42')]+'%'};return _0x39f0dc;}})});}_0x47101f=_[_0xa45e('0x43')]({},_0x47101f,_0x3e6e5d[_0xa45e('0x44')]);var _0x2268b8={'where':_0x47101f[_0xa45e('0x3f')]};return db[_0xa45e('0x31')][_0xa45e('0x23')](_0x2268b8)[_0xa45e('0x29')](function(_0x502c7d){_0x59eda0[_0xa45e('0x23')]=_0x502c7d;if(_0x3e6e5d[_0xa45e('0x35')]['includeAll']){_0x47101f[_0xa45e('0x45')]=[{'all':!![]}];}return db[_0xa45e('0x31')]['findAll'](_0x47101f);})[_0xa45e('0x29')](function(_0x3dde25){_0x59eda0['rows']=_0x3dde25;return _0x59eda0;})[_0xa45e('0x29')](respondWithFilteredResult(_0x450ddf,_0x47101f))[_0xa45e('0x46')](handleError(_0x450ddf,null));};exports['show']=function(_0x2f7f2e,_0x452432){var _0x589527={'raw':![],'where':{'id':_0x2f7f2e[_0xa45e('0x47')]['id']}},_0x15463b={};_0x15463b[_0xa45e('0x34')]=_['keys'](db[_0xa45e('0x31')][_0xa45e('0x48')]);_0x15463b['query']=_['keys'](_0x2f7f2e['query']);_0x15463b[_0xa45e('0x37')]=_[_0xa45e('0x38')](_0x15463b[_0xa45e('0x34')],_0x15463b['query']);_0x589527[_0xa45e('0x39')]=_['intersection'](_0x15463b['model'],qs[_0xa45e('0x3a')](_0x2f7f2e[_0xa45e('0x35')][_0xa45e('0x3a')]));_0x589527[_0xa45e('0x39')]=_0x589527[_0xa45e('0x39')][_0xa45e('0x3b')]?_0x589527[_0xa45e('0x39')]:_0x15463b[_0xa45e('0x34')];if(_0x2f7f2e[_0xa45e('0x35')][_0xa45e('0x49')]){_0x589527[_0xa45e('0x45')]=[{'all':!![]}];}_0x589527=_[_0xa45e('0x43')]({},_0x589527,_0x2f7f2e[_0xa45e('0x44')]);return db[_0xa45e('0x31')][_0xa45e('0x4a')](_0x589527)[_0xa45e('0x29')](handleEntityNotFound(_0x452432,null))[_0xa45e('0x29')](respondWithResult(_0x452432,null))[_0xa45e('0x46')](handleError(_0x452432,null));};exports[_0xa45e('0x4b')]=function(_0x324479,_0xa25a92){return db[_0xa45e('0x31')]['create'](_0x324479[_0xa45e('0x4c')],{})[_0xa45e('0x29')](respondWithResult(_0xa25a92,0xc9))['catch'](handleError(_0xa25a92,null));};exports[_0xa45e('0x28')]=function(_0x49e42d,_0x484d4c){if(_0x49e42d[_0xa45e('0x4c')]['id']){delete _0x49e42d[_0xa45e('0x4c')]['id'];}return db[_0xa45e('0x31')]['find']({'where':{'id':_0x49e42d['params']['id']}})[_0xa45e('0x29')](handleEntityNotFound(_0x484d4c,null))['then'](saveUpdates(_0x49e42d['body'],null))[_0xa45e('0x29')](respondWithResult(_0x484d4c,null))['catch'](handleError(_0x484d4c,null));};exports[_0xa45e('0x2a')]=function(_0x21da8c,_0x102b5a){return db[_0xa45e('0x31')][_0xa45e('0x4a')]({'where':{'id':_0x21da8c[_0xa45e('0x47')]['id']}})['then'](handleEntityNotFound(_0x102b5a,null))[_0xa45e('0x29')](removeEntity(_0x102b5a,null))[_0xa45e('0x46')](handleError(_0x102b5a,null));};exports[_0xa45e('0x4d')]=function(_0x5a7ff0,_0x13a4e8,_0x28ad6c){var _0x52c9fb={};var _0x5442ef={};var _0x4951e4;var _0x17d503;return db[_0xa45e('0x31')][_0xa45e('0x4e')]({'where':{'id':_0x5a7ff0[_0xa45e('0x47')]['id']}})[_0xa45e('0x29')](handleEntityNotFound(_0x13a4e8,null))[_0xa45e('0x29')](function(_0x18fbf5){if(_0x18fbf5){_0x4951e4=_0x18fbf5;_0x5442ef[_0xa45e('0x34')]=_[_0xa45e('0x36')](db[_0xa45e('0x4f')]['rawAttributes']);_0x5442ef[_0xa45e('0x35')]=_[_0xa45e('0x36')](_0x5a7ff0[_0xa45e('0x35')]);_0x5442ef[_0xa45e('0x37')]=_[_0xa45e('0x38')](_0x5442ef['model'],_0x5442ef['query']);_0x52c9fb['attributes']=_['intersection'](_0x5442ef[_0xa45e('0x34')],qs[_0xa45e('0x3a')](_0x5a7ff0[_0xa45e('0x35')]['fields']));_0x52c9fb[_0xa45e('0x39')]=_0x52c9fb[_0xa45e('0x39')]['length']?_0x52c9fb['attributes']:_0x5442ef[_0xa45e('0x34')];_0x52c9fb[_0xa45e('0x50')]=qs[_0xa45e('0x3e')](_0x5a7ff0[_0xa45e('0x35')][_0xa45e('0x3e')]);_0x52c9fb[_0xa45e('0x3f')]=qs[_0xa45e('0x37')](_[_0xa45e('0x40')](_0x5a7ff0[_0xa45e('0x35')],_0x5442ef[_0xa45e('0x37')]));if(_0x5a7ff0[_0xa45e('0x35')]['filter']){_0x52c9fb[_0xa45e('0x3f')]=_[_0xa45e('0x43')](_0x52c9fb['where'],{'$or':_[_0xa45e('0x30')](_0x52c9fb[_0xa45e('0x39')],function(_0x783136){var _0x4b5042={};_0x4b5042[_0x783136]={'$like':'%'+_0x5a7ff0[_0xa45e('0x35')][_0xa45e('0x42')]+'%'};return _0x4b5042;})});}_0x52c9fb=_['merge']({},_0x52c9fb,_0x5a7ff0[_0xa45e('0x44')]);return _0x4951e4[_0xa45e('0x4d')](_0x52c9fb);}})['then'](function(_0x319dd7){if(_0x319dd7){_0x17d503=_0x319dd7[_0xa45e('0x3b')];if(!_0x5a7ff0[_0xa45e('0x35')][_0xa45e('0x3c')](_0xa45e('0x3d'))){_0x52c9fb['limit']=qs[_0xa45e('0x22')](_0x5a7ff0[_0xa45e('0x35')][_0xa45e('0x22')]);_0x52c9fb[_0xa45e('0x24')]=qs[_0xa45e('0x24')](_0x5a7ff0['query'][_0xa45e('0x24')]);}return _0x4951e4['getConfigurations'](_0x52c9fb);}})[_0xa45e('0x29')](function(_0x317947){if(_0x317947){return _0x317947?{'count':_0x17d503,'rows':_0x317947}:null;}})[_0xa45e('0x29')](respondWithResult(_0x13a4e8,null))[_0xa45e('0x46')](handleError(_0x13a4e8,null));};exports['addConfiguration']=function(_0x1f8ba2,_0x359b15,_0x17e334){if(_0x1f8ba2[_0xa45e('0x4c')]['id']){delete _0x1f8ba2[_0xa45e('0x4c')]['id'];}return db[_0xa45e('0x31')]['findOne']({'where':{'id':_0x1f8ba2[_0xa45e('0x47')]['id']}})[_0xa45e('0x29')](handleEntityNotFound(_0x359b15,null))['then'](function(_0x1316cb){if(_0x1316cb){_0x1f8ba2['body'][_0xa45e('0x51')]=_0x1316cb['id'];_0x1f8ba2[_0xa45e('0x4c')]['Subjects']=integrations[_0xa45e('0x52')](_0x1f8ba2[_0xa45e('0x4c')][_0xa45e('0x53')],_0x1f8ba2[_0xa45e('0x4c')][_0xa45e('0x32')]);_0x1f8ba2[_0xa45e('0x4c')][_0xa45e('0x54')]=integrations[_0xa45e('0x55')](_0x1f8ba2[_0xa45e('0x4c')][_0xa45e('0x53')],_0x1f8ba2[_0xa45e('0x4c')]['type']);return db[_0xa45e('0x4f')][_0xa45e('0x4b')](_0x1f8ba2['body'],{'include':[{'model':db[_0xa45e('0x56')],'as':'Subjects'},{'model':db[_0xa45e('0x56')],'as':_0xa45e('0x54')}]});}return null;})[_0xa45e('0x29')](respondWithResult(_0x359b15,null))[_0xa45e('0x46')](handleError(_0x359b15,null));};exports[_0xa45e('0x57')]=function(_0x2447e3,_0x2ae35a,_0x3ef2c3){var _0x1515c9='';var _0x635271=['id',_0xa45e('0x2d'),_0xa45e('0x58'),_0xa45e('0x59'),_0xa45e('0x5a'),_0xa45e('0x5b'),_0xa45e('0x5c'),_0xa45e('0x5d'),_0xa45e('0x5e'),_0xa45e('0x5f'),_0xa45e('0x60'),_0xa45e('0x61')];return db[_0xa45e('0x31')][_0xa45e('0x4e')]({'where':{'id':_0x2447e3['params']['id']},'attributes':['id',_0xa45e('0x62'),_0xa45e('0x63'),_0xa45e('0x64')]})[_0xa45e('0x29')](handleEntityNotFound(_0x2ae35a,null))['then'](function(_0x38ab2f){if(_0x38ab2f){_0x1515c9=_0x38ab2f[_0xa45e('0x64')];var _0x3f0195=_0x1515c9[_0xa45e('0x65')](-0x1);if(_0x3f0195==='/'){_0x1515c9=_0x1515c9[_0xa45e('0x66')](0x0,_0x1515c9[_0xa45e('0x67')](_0x3f0195));}return rp({'method':_0xa45e('0x68'),'uri':util['format'](_0xa45e('0x69'),_0x1515c9,_0xa45e('0x6a')),'json':!![],'form':{'method':_0xa45e('0x6b'),'input_type':_0xa45e('0x6c'),'response_type':_0xa45e('0x6c'),'rest_data':JSON[_0xa45e('0x6d')]({'user_auth':{'user_name':_0x38ab2f['username'],'password':_0x38ab2f['password'],'encryption':_0xa45e('0x6e')},'application':_0xa45e('0x6f')})}});}})[_0xa45e('0x29')](function(_0x4e385f){if(_0x4e385f&&_0x4e385f[_0xa45e('0x2d')]!=='Invalid\x20Login'&&_0x4e385f['name']!==_0xa45e('0x70')){return rp({'method':'POST','uri':util['format']('%s%s',_0x1515c9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa45e('0x71'),'input_type':'JSON','response_type':_0xa45e('0x6c'),'rest_data':JSON['stringify']({'session':_0x4e385f['id'],'module_name':_0xa45e('0x72')})}})[_0xa45e('0x29')](function(_0x26b250){if(_0x26b250){var _0x915800=_[_0xa45e('0x73')](_0x26b250[_0xa45e('0x74')]);_[_0xa45e('0x75')](_0x915800,function(_0x156e0d){return _0x635271['includes'](_0x156e0d[_0xa45e('0x2d')]);});return{'count':_0x915800[_0xa45e('0x3b')],'rows':_[_0xa45e('0x30')](_0x915800,function(_0x49a71c){return{'id':_0x49a71c[_0xa45e('0x2d')],'name':_0x49a71c['label'],'custom':_[_0xa45e('0x76')](_0x49a71c['name'],'_c')?!![]:![],'options':_0x49a71c['options']?_[_0xa45e('0x30')](_[_0xa45e('0x73')](_0x49a71c[_0xa45e('0x44')]),function(_0x2b0970){return{'name':_0x2b0970[_0xa45e('0x77')],'value':_0x2b0970[_0xa45e('0x2d')]};}):[]};})};}})[_0xa45e('0x29')](respondWithResult(_0x2ae35a,null))[_0xa45e('0x46')](function(_0x43a786){var _0x134ba9=_0x2447e3[_0xa45e('0x35')][_0xa45e('0x78')]?0x1f4:_0x43a786[_0xa45e('0x79')]||0x1f4;logger[_0xa45e('0x2b')](_0xa45e('0x7a'),_0xa45e('0x57'),_0x134ba9,JSON['stringify'](_0x43a786));delete _0x43a786[_0xa45e('0x2d')];if(_0x134ba9===0x191){_0x134ba9=0x190;}_0x2ae35a[_0xa45e('0x1e')](_0x134ba9)[_0xa45e('0x2e')](_0x2447e3[_0xa45e('0x35')][_0xa45e('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x43a786[_0xa45e('0x79')]}:_0x43a786);});}else{var _0x4a88e9=0x1f4;_0x2ae35a[_0xa45e('0x1e')](_0x4a88e9)[_0xa45e('0x2e')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x4403=['filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','remove','label','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','stack','index','SugarcrmAccount','type','key','map','name','query'];(function(_0x1aef5c,_0x2b4286){var _0x5cecaf=function(_0x278f6a){while(--_0x278f6a){_0x1aef5c['push'](_0x1aef5c['shift']());}};_0x5cecaf(++_0x2b4286);}(_0x4403,0x137));var _0x3440=function(_0x5b5209,_0x3cbed2){_0x5b5209=_0x5b5209-0x0;var _0x3ed5f5=_0x4403[_0x5b5209];return _0x3ed5f5;};'use strict';var emlformat=require(_0x3440('0x0'));var rimraf=require(_0x3440('0x1'));var zipdir=require(_0x3440('0x2'));var jsonpatch=require(_0x3440('0x3'));var rp=require(_0x3440('0x4'));var moment=require(_0x3440('0x5'));var BPromise=require(_0x3440('0x6'));var Mustache=require(_0x3440('0x7'));var util=require(_0x3440('0x8'));var path=require(_0x3440('0x9'));var sox=require('sox');var csv=require(_0x3440('0xa'));var ejs=require(_0x3440('0xb'));var fs=require('fs');var fs_extra=require(_0x3440('0xc'));var _=require(_0x3440('0xd'));var squel=require('squel');var crypto=require(_0x3440('0xe'));var jsforce=require(_0x3440('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3440('0xa'));var querystring=require(_0x3440('0x10'));var Papa=require(_0x3440('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3440('0x12'));var as=require(_0x3440('0x13'));var hardwareService=require(_0x3440('0x14'));var logger=require(_0x3440('0x15'))(_0x3440('0x16'));var utils=require('../../config/utils');var config=require(_0x3440('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3440('0x18'))['db'];var integrations=require(_0x3440('0x19'));function respondWithStatusCode(_0x574207,_0x5d2459){_0x5d2459=_0x5d2459||0xcc;return function(_0x4ef750){if(_0x4ef750){return _0x574207['sendStatus'](_0x5d2459);}return _0x574207[_0x3440('0x1a')](_0x5d2459)['end']();};}function respondWithResult(_0x15bad8,_0x41d233){_0x41d233=_0x41d233||0xc8;return function(_0x2564e6){if(_0x2564e6){return _0x15bad8[_0x3440('0x1a')](_0x41d233)[_0x3440('0x1b')](_0x2564e6);}};}function respondWithFilteredResult(_0x195aaf,_0x111192){return function(_0x1cc967){if(_0x1cc967){var _0x5c724f=typeof _0x111192[_0x3440('0x1c')]===_0x3440('0x1d')&&typeof _0x111192[_0x3440('0x1e')]===_0x3440('0x1d');var _0x507a48=_0x1cc967['count'];var _0x286394=_0x5c724f?0x0:_0x111192[_0x3440('0x1c')];var _0x45e942=_0x5c724f?_0x1cc967[_0x3440('0x1f')]:_0x111192[_0x3440('0x1c')]+_0x111192[_0x3440('0x1e')];var _0xcb86a3;if(_0x45e942>=_0x507a48){_0x45e942=_0x507a48;_0xcb86a3=0xc8;}else{_0xcb86a3=0xce;}_0x195aaf['status'](_0xcb86a3);return _0x195aaf[_0x3440('0x20')]('Content-Range',_0x286394+'-'+_0x45e942+'/'+_0x507a48)[_0x3440('0x1b')](_0x1cc967);}return null;};}function patchUpdates(_0x5375fb){return function(_0x5ec70f){try{jsonpatch[_0x3440('0x21')](_0x5ec70f,_0x5375fb,!![]);}catch(_0x137da1){return BPromise[_0x3440('0x22')](_0x137da1);}return _0x5ec70f[_0x3440('0x23')]();};}function saveUpdates(_0x25b95c,_0x1e3108){return function(_0x2055b6){if(_0x2055b6){return _0x2055b6[_0x3440('0x24')](_0x25b95c)['then'](function(_0x341231){return _0x341231;});}return null;};}function removeEntity(_0x2196c7,_0x511fae){return function(_0x14b351){if(_0x14b351){return _0x14b351[_0x3440('0x25')]()[_0x3440('0x26')](function(){_0x2196c7[_0x3440('0x1a')](0xcc)[_0x3440('0x27')]();});}};}function handleEntityNotFound(_0x32581b,_0xb7c5){return function(_0x2e86e3){if(!_0x2e86e3){_0x32581b['sendStatus'](0x194);}return _0x2e86e3;};}function handleError(_0x4771f6,_0x35fb05){_0x35fb05=_0x35fb05||0x1f4;return function(_0x5b0d2d){logger[_0x3440('0x28')](_0x5b0d2d[_0x3440('0x29')]);if(_0x5b0d2d['name']){delete _0x5b0d2d['name'];}_0x4771f6[_0x3440('0x1a')](_0x35fb05)['send'](_0x5b0d2d);};}exports[_0x3440('0x2a')]=function(_0x9f88e4,_0x439985){var _0x22bda8={},_0x320b63={},_0x34a00c={'count':0x0,'rows':[]};var _0x4da5fd=_['map'](db[_0x3440('0x2b')]['rawAttributes'],function(_0x230f8c){return{'name':_0x230f8c['fieldName'],'type':_0x230f8c[_0x3440('0x2c')][_0x3440('0x2d')]};});_0x320b63['model']=_[_0x3440('0x2e')](_0x4da5fd,_0x3440('0x2f'));_0x320b63[_0x3440('0x30')]=_['keys'](_0x9f88e4['query']);_0x320b63[_0x3440('0x31')]=_[_0x3440('0x32')](_0x320b63[_0x3440('0x33')],_0x320b63[_0x3440('0x30')]);_0x22bda8['attributes']=_[_0x3440('0x32')](_0x320b63[_0x3440('0x33')],qs[_0x3440('0x34')](_0x9f88e4['query']['fields']));_0x22bda8[_0x3440('0x35')]=_0x22bda8[_0x3440('0x35')][_0x3440('0x36')]?_0x22bda8[_0x3440('0x35')]:_0x320b63['model'];if(!_0x9f88e4['query']['hasOwnProperty'](_0x3440('0x37'))){_0x22bda8[_0x3440('0x1e')]=qs['limit'](_0x9f88e4['query'][_0x3440('0x1e')]);_0x22bda8[_0x3440('0x1c')]=qs[_0x3440('0x1c')](_0x9f88e4['query'][_0x3440('0x1c')]);}_0x22bda8[_0x3440('0x38')]=qs[_0x3440('0x39')](_0x9f88e4[_0x3440('0x30')]['sort']);_0x22bda8[_0x3440('0x3a')]=qs[_0x3440('0x31')](_[_0x3440('0x3b')](_0x9f88e4[_0x3440('0x30')],_0x320b63['filters']),_0x4da5fd);if(_0x9f88e4[_0x3440('0x30')][_0x3440('0x3c')]){_0x22bda8['where']=_[_0x3440('0x3d')](_0x22bda8['where'],{'$or':_[_0x3440('0x2e')](_0x4da5fd,function(_0x5eaafa){if(_0x5eaafa[_0x3440('0x2c')]!==_0x3440('0x3e')){var _0x2ae6ea={};_0x2ae6ea[_0x5eaafa[_0x3440('0x2f')]]={'$like':'%'+_0x9f88e4[_0x3440('0x30')][_0x3440('0x3c')]+'%'};return _0x2ae6ea;}})});}_0x22bda8=_[_0x3440('0x3d')]({},_0x22bda8,_0x9f88e4[_0x3440('0x3f')]);var _0x281fce={'where':_0x22bda8[_0x3440('0x3a')]};return db['SugarcrmAccount']['count'](_0x281fce)[_0x3440('0x26')](function(_0x180a2a){_0x34a00c[_0x3440('0x1f')]=_0x180a2a;if(_0x9f88e4[_0x3440('0x30')][_0x3440('0x40')]){_0x22bda8['include']=[{'all':!![]}];}return db[_0x3440('0x2b')][_0x3440('0x41')](_0x22bda8);})['then'](function(_0x3040a1){_0x34a00c[_0x3440('0x42')]=_0x3040a1;return _0x34a00c;})[_0x3440('0x26')](respondWithFilteredResult(_0x439985,_0x22bda8))[_0x3440('0x43')](handleError(_0x439985,null));};exports[_0x3440('0x44')]=function(_0x29b850,_0xa3935e){var _0x23d732={'raw':![],'where':{'id':_0x29b850[_0x3440('0x45')]['id']}},_0x16f664={};_0x16f664[_0x3440('0x33')]=_[_0x3440('0x46')](db[_0x3440('0x2b')][_0x3440('0x47')]);_0x16f664[_0x3440('0x30')]=_[_0x3440('0x46')](_0x29b850[_0x3440('0x30')]);_0x16f664[_0x3440('0x31')]=_[_0x3440('0x32')](_0x16f664[_0x3440('0x33')],_0x16f664[_0x3440('0x30')]);_0x23d732['attributes']=_[_0x3440('0x32')](_0x16f664[_0x3440('0x33')],qs[_0x3440('0x34')](_0x29b850[_0x3440('0x30')][_0x3440('0x34')]));_0x23d732[_0x3440('0x35')]=_0x23d732[_0x3440('0x35')][_0x3440('0x36')]?_0x23d732[_0x3440('0x35')]:_0x16f664[_0x3440('0x33')];if(_0x29b850['query'][_0x3440('0x40')]){_0x23d732[_0x3440('0x48')]=[{'all':!![]}];}_0x23d732=_[_0x3440('0x3d')]({},_0x23d732,_0x29b850[_0x3440('0x3f')]);return db['SugarcrmAccount']['find'](_0x23d732)[_0x3440('0x26')](handleEntityNotFound(_0xa3935e,null))[_0x3440('0x26')](respondWithResult(_0xa3935e,null))[_0x3440('0x43')](handleError(_0xa3935e,null));};exports[_0x3440('0x49')]=function(_0xd35edd,_0x4cd2db){return db[_0x3440('0x2b')][_0x3440('0x49')](_0xd35edd[_0x3440('0x4a')],{})['then'](respondWithResult(_0x4cd2db,0xc9))[_0x3440('0x43')](handleError(_0x4cd2db,null));};exports[_0x3440('0x24')]=function(_0x16f20b,_0x49a722){if(_0x16f20b[_0x3440('0x4a')]['id']){delete _0x16f20b[_0x3440('0x4a')]['id'];}return db[_0x3440('0x2b')][_0x3440('0x4b')]({'where':{'id':_0x16f20b[_0x3440('0x45')]['id']}})['then'](handleEntityNotFound(_0x49a722,null))['then'](saveUpdates(_0x16f20b[_0x3440('0x4a')],null))[_0x3440('0x26')](respondWithResult(_0x49a722,null))[_0x3440('0x43')](handleError(_0x49a722,null));};exports[_0x3440('0x25')]=function(_0x36a5ed,_0x863f8b){return db[_0x3440('0x2b')][_0x3440('0x4b')]({'where':{'id':_0x36a5ed[_0x3440('0x45')]['id']}})[_0x3440('0x26')](handleEntityNotFound(_0x863f8b,null))[_0x3440('0x26')](removeEntity(_0x863f8b,null))[_0x3440('0x43')](handleError(_0x863f8b,null));};exports[_0x3440('0x4c')]=function(_0x4c6cfe,_0x1d16f1,_0x54ab36){var _0x834184={};var _0x5186b3={};var _0x3a1a32;var _0x5f3655;return db[_0x3440('0x2b')][_0x3440('0x4d')]({'where':{'id':_0x4c6cfe[_0x3440('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d16f1,null))[_0x3440('0x26')](function(_0x16e7cf){if(_0x16e7cf){_0x3a1a32=_0x16e7cf;_0x5186b3[_0x3440('0x33')]=_[_0x3440('0x46')](db[_0x3440('0x4e')][_0x3440('0x47')]);_0x5186b3[_0x3440('0x30')]=_[_0x3440('0x46')](_0x4c6cfe[_0x3440('0x30')]);_0x5186b3[_0x3440('0x31')]=_[_0x3440('0x32')](_0x5186b3[_0x3440('0x33')],_0x5186b3[_0x3440('0x30')]);_0x834184['attributes']=_['intersection'](_0x5186b3['model'],qs[_0x3440('0x34')](_0x4c6cfe[_0x3440('0x30')][_0x3440('0x34')]));_0x834184['attributes']=_0x834184[_0x3440('0x35')]['length']?_0x834184['attributes']:_0x5186b3[_0x3440('0x33')];_0x834184[_0x3440('0x38')]=qs[_0x3440('0x39')](_0x4c6cfe[_0x3440('0x30')][_0x3440('0x39')]);_0x834184[_0x3440('0x3a')]=qs[_0x3440('0x31')](_[_0x3440('0x3b')](_0x4c6cfe[_0x3440('0x30')],_0x5186b3[_0x3440('0x31')]));if(_0x4c6cfe[_0x3440('0x30')][_0x3440('0x3c')]){_0x834184[_0x3440('0x3a')]=_[_0x3440('0x3d')](_0x834184[_0x3440('0x3a')],{'$or':_['map'](_0x834184[_0x3440('0x35')],function(_0x119542){var _0x167c93={};_0x167c93[_0x119542]={'$like':'%'+_0x4c6cfe[_0x3440('0x30')][_0x3440('0x3c')]+'%'};return _0x167c93;})});}_0x834184=_[_0x3440('0x3d')]({},_0x834184,_0x4c6cfe[_0x3440('0x3f')]);return _0x3a1a32[_0x3440('0x4c')](_0x834184);}})[_0x3440('0x26')](function(_0x32222a){if(_0x32222a){_0x5f3655=_0x32222a[_0x3440('0x36')];if(!_0x4c6cfe['query'][_0x3440('0x4f')]('nolimit')){_0x834184['limit']=qs[_0x3440('0x1e')](_0x4c6cfe[_0x3440('0x30')][_0x3440('0x1e')]);_0x834184[_0x3440('0x1c')]=qs[_0x3440('0x1c')](_0x4c6cfe[_0x3440('0x30')][_0x3440('0x1c')]);}return _0x3a1a32[_0x3440('0x4c')](_0x834184);}})[_0x3440('0x26')](function(_0x3129ed){if(_0x3129ed){return _0x3129ed?{'count':_0x5f3655,'rows':_0x3129ed}:null;}})[_0x3440('0x26')](respondWithResult(_0x1d16f1,null))[_0x3440('0x43')](handleError(_0x1d16f1,null));};exports[_0x3440('0x50')]=function(_0x5f534f,_0x39a8e4,_0x55db33){if(_0x5f534f[_0x3440('0x4a')]['id']){delete _0x5f534f['body']['id'];}return db[_0x3440('0x2b')]['findOne']({'where':{'id':_0x5f534f['params']['id']}})[_0x3440('0x26')](handleEntityNotFound(_0x39a8e4,null))[_0x3440('0x26')](function(_0x52887b){if(_0x52887b){_0x5f534f[_0x3440('0x4a')][_0x3440('0x51')]=_0x52887b['id'];_0x5f534f['body'][_0x3440('0x52')]=integrations[_0x3440('0x53')](_0x5f534f[_0x3440('0x4a')]['channel'],_0x5f534f['body'][_0x3440('0x2c')]);_0x5f534f[_0x3440('0x4a')][_0x3440('0x54')]=integrations[_0x3440('0x55')](_0x5f534f[_0x3440('0x4a')][_0x3440('0x56')],_0x5f534f[_0x3440('0x4a')][_0x3440('0x2c')]);return db[_0x3440('0x4e')]['create'](_0x5f534f['body'],{'include':[{'model':db[_0x3440('0x57')],'as':_0x3440('0x52')},{'model':db['SugarcrmField'],'as':_0x3440('0x54')}]});}return null;})[_0x3440('0x26')](respondWithResult(_0x39a8e4,null))[_0x3440('0x43')](handleError(_0x39a8e4,null));};exports[_0x3440('0x58')]=function(_0x4ba625,_0xac75d5,_0x5e6322){var _0x559ec9='';var _0x2b04de=['id',_0x3440('0x2f'),_0x3440('0x59'),_0x3440('0x5a'),'description',_0x3440('0x5b'),_0x3440('0x5c'),'duration_minutes',_0x3440('0x5d'),_0x3440('0x5e'),_0x3440('0x5f'),'direction'];return db[_0x3440('0x2b')]['findOne']({'where':{'id':_0x4ba625['params']['id']},'attributes':['id',_0x3440('0x60'),_0x3440('0x61'),'remoteUri']})[_0x3440('0x26')](handleEntityNotFound(_0xac75d5,null))[_0x3440('0x26')](function(_0x20d93d){if(_0x20d93d){_0x559ec9=_0x20d93d[_0x3440('0x62')];var _0x46398b=_0x559ec9[_0x3440('0x63')](-0x1);if(_0x46398b==='/'){_0x559ec9=_0x559ec9[_0x3440('0x64')](0x0,_0x559ec9[_0x3440('0x65')](_0x46398b));}return rp({'method':'POST','uri':util['format'](_0x3440('0x66'),_0x559ec9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x3440('0x67'),'input_type':_0x3440('0x68'),'response_type':'JSON','rest_data':JSON[_0x3440('0x69')]({'user_auth':{'user_name':_0x20d93d[_0x3440('0x60')],'password':_0x20d93d['password'],'encryption':_0x3440('0x6a')},'application':_0x3440('0x6b')})}});}})[_0x3440('0x26')](function(_0x244784){if(_0x244784&&_0x244784['name']!==_0x3440('0x6c')&&_0x244784['name']!==_0x3440('0x6d')){return rp({'method':'POST','uri':util['format']('%s%s',_0x559ec9,_0x3440('0x6e')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x3440('0x68'),'response_type':_0x3440('0x68'),'rest_data':JSON[_0x3440('0x69')]({'session':_0x244784['id'],'module_name':'Calls'})}})[_0x3440('0x26')](function(_0xfa49bc){if(_0xfa49bc){var _0x2e2ddc=_['values'](_0xfa49bc['module_fields']);_[_0x3440('0x6f')](_0x2e2ddc,function(_0x4740d8){return _0x2b04de['includes'](_0x4740d8['name']);});return{'count':_0x2e2ddc[_0x3440('0x36')],'rows':_[_0x3440('0x2e')](_0x2e2ddc,function(_0x4ca8aa){return{'id':_0x4ca8aa['name'],'name':_0x4ca8aa[_0x3440('0x70')],'custom':_['endsWith'](_0x4ca8aa[_0x3440('0x2f')],'_c')?!![]:![],'options':_0x4ca8aa[_0x3440('0x3f')]?_['map'](_[_0x3440('0x71')](_0x4ca8aa[_0x3440('0x3f')]),function(_0x1a0e6a){return{'name':_0x1a0e6a[_0x3440('0x72')],'value':_0x1a0e6a[_0x3440('0x2f')]};}):[]};})};}})[_0x3440('0x26')](respondWithResult(_0xac75d5,null))['catch'](function(_0x11dfc2){var _0xf3c723=_0x4ba625['query'][_0x3440('0x73')]?0x1f4:_0x11dfc2[_0x3440('0x74')]||0x1f4;logger['error'](_0x3440('0x75'),_0x3440('0x58'),_0xf3c723,JSON[_0x3440('0x69')](_0x11dfc2));delete _0x11dfc2[_0x3440('0x2f')];if(_0xf3c723===0x191){_0xf3c723=0x190;}_0xac75d5['status'](_0xf3c723)[_0x3440('0x76')](_0x4ba625[_0x3440('0x30')][_0x3440('0x73')]?{'message':_0x3440('0x77'),'statusCode':_0x11dfc2['statusCode']}:_0x11dfc2);});}else{var _0x1e6c86=0x1f4;_0xac75d5[_0x3440('0x1a')](_0x1e6c86)[_0x3440('0x76')]({'message':'Wrong\x20credentials','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 8310c5c..4b4a274 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 _0x431c=['SugarcrmAccount','int_sugarcrm_accounts','util','api','moment','bluebird','request-promise','./intSugarcrmAccount.attributes','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x431c,0x1e8));var _0xc431=function(_0x440a1d,_0x32107a){_0x440a1d=_0x440a1d-0x0;var _0x2f4ee1=_0x431c[_0x440a1d];return _0x2f4ee1;};'use strict';var _=require('lodash');var util=require(_0xc431('0x0'));var logger=require('../../config/logger')(_0xc431('0x1'));var moment=require(_0xc431('0x2'));var BPromise=require(_0xc431('0x3'));var rp=require(_0xc431('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc431('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5e8dad,_0x422995){return _0x5e8dad[_0xc431('0x6')](_0xc431('0x7'),attributes,{'tableName':_0xc431('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84e5=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','util','api'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x84e5,0x111));var _0x584e=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x84e5[_0x3203a1];return _0x24215e;};'use strict';var _=require('lodash');var util=require(_0x584e('0x0'));var logger=require('../../config/logger')(_0x584e('0x1'));var moment=require(_0x584e('0x2'));var BPromise=require(_0x584e('0x3'));var rp=require(_0x584e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x584e('0x5'));var config=require(_0x584e('0x6'));var attributes=require(_0x584e('0x7'));var integrations=require(_0x584e('0x8'));module[_0x584e('0x9')]=function(_0x233deb,_0x376152){return _0x233deb['define'](_0x584e('0xa'),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 5dc430e..4fb70f0 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 _0xec17=['moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','ShowSugarcrmAccount','find','where','lodash'];(function(_0x1927da,_0x470064){var _0x1d41ae=function(_0x1d4ae4){while(--_0x1d4ae4){_0x1927da['push'](_0x1927da['shift']());}};_0x1d41ae(++_0x470064);}(_0xec17,0xe6));var _0x7ec1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xec17[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7ec1('0x0'));var util=require('util');var moment=require(_0x7ec1('0x1'));var BPromise=require(_0x7ec1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7ec1('0x3'))(_0x7ec1('0x4'));var config=require(_0x7ec1('0x5'));var jayson=require(_0x7ec1('0x6'));var client=jayson['client'][_0x7ec1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f0bc7,_0x145204,_0x458616){return new BPromise(function(_0x48fe87,_0x566505){return client[_0x7ec1('0x8')](_0x1f0bc7,_0x458616)[_0x7ec1('0x9')](function(_0x49d730){logger[_0x7ec1('0xa')](_0x7ec1('0xb'),_0x145204,_0x7ec1('0xc'));logger[_0x7ec1('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x145204,_0x7ec1('0xc'),JSON[_0x7ec1('0xe')](_0x49d730));if(_0x49d730[_0x7ec1('0xf')]){if(_0x49d730[_0x7ec1('0xf')][_0x7ec1('0x10')]===0x1f4){logger['error'](_0x7ec1('0xb'),_0x145204,_0x49d730['error'][_0x7ec1('0x11')]);return _0x566505(_0x49d730[_0x7ec1('0xf')]['message']);}logger[_0x7ec1('0xf')](_0x7ec1('0xb'),_0x145204,_0x49d730[_0x7ec1('0xf')][_0x7ec1('0x11')]);return _0x48fe87(_0x49d730['error'][_0x7ec1('0x11')]);}else{logger[_0x7ec1('0xa')](_0x7ec1('0xb'),_0x145204,'request\x20sent');_0x48fe87(_0x49d730[_0x7ec1('0x12')][_0x7ec1('0x11')]);}})[_0x7ec1('0x13')](function(_0x2f5857){logger[_0x7ec1('0xf')](_0x7ec1('0xb'),_0x145204,_0x2f5857);_0x566505(_0x2f5857);});});}exports[_0x7ec1('0x14')]=function(_0x2d3b62){var _0x43bbd7=this;return new Promise(function(_0x93aab5,_0x255f7c){return db[_0x7ec1('0x15')][_0x7ec1('0x16')]({'raw':_0x2d3b62[_0x7ec1('0x17')]?_0x2d3b62[_0x7ec1('0x17')][_0x7ec1('0x18')]===undefined?!![]:![]:!![],'where':_0x2d3b62[_0x7ec1('0x17')]?_0x2d3b62[_0x7ec1('0x17')]['where']||null:null,'attributes':_0x2d3b62['options']?_0x2d3b62[_0x7ec1('0x17')][_0x7ec1('0x19')]||null:null,'limit':_0x2d3b62[_0x7ec1('0x17')]?_0x2d3b62[_0x7ec1('0x17')][_0x7ec1('0x1a')]||null:null,'include':_0x2d3b62[_0x7ec1('0x17')]?_0x2d3b62[_0x7ec1('0x17')][_0x7ec1('0x1b')]?_[_0x7ec1('0x1c')](_0x2d3b62['options'][_0x7ec1('0x1b')],function(_0x5376f8){return{'model':db[_0x5376f8[_0x7ec1('0x1d')]],'as':_0x5376f8['as'],'attributes':_0x5376f8[_0x7ec1('0x19')],'include':_0x5376f8['include']?_['map'](_0x5376f8[_0x7ec1('0x1b')],function(_0x561d6e){return{'model':db[_0x561d6e[_0x7ec1('0x1d')]],'as':_0x561d6e['as'],'attributes':_0x561d6e['attributes'],'include':_0x561d6e[_0x7ec1('0x1b')]?_[_0x7ec1('0x1c')](_0x561d6e[_0x7ec1('0x1b')],function(_0x4370e0){return{'model':db[_0x4370e0[_0x7ec1('0x1d')]],'as':_0x4370e0['as'],'attributes':_0x4370e0[_0x7ec1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x485daf){logger[_0x7ec1('0xa')]('GetSugarcrmAccount',_0x2d3b62);logger[_0x7ec1('0xd')](_0x7ec1('0x14'),_0x2d3b62,JSON[_0x7ec1('0xe')](_0x485daf));_0x93aab5(_0x485daf);})[_0x7ec1('0x13')](function(_0x267122){logger[_0x7ec1('0xf')](_0x7ec1('0x14'),_0x267122[_0x7ec1('0x11')],_0x2d3b62);_0x255f7c(_0x43bbd7[_0x7ec1('0xf')](0x1f4,_0x267122['message']));});});};exports[_0x7ec1('0x1e')]=function(_0x380050){var _0xd9f36=this;return new Promise(function(_0x683304,_0x53e8da){return db[_0x7ec1('0x15')][_0x7ec1('0x1f')]({'raw':_0x380050[_0x7ec1('0x17')]?_0x380050[_0x7ec1('0x17')][_0x7ec1('0x18')]===undefined?!![]:![]:!![],'where':_0x380050[_0x7ec1('0x17')]?_0x380050[_0x7ec1('0x17')][_0x7ec1('0x20')]||null:null,'attributes':_0x380050[_0x7ec1('0x17')]?_0x380050[_0x7ec1('0x17')][_0x7ec1('0x19')]||null:null,'include':_0x380050[_0x7ec1('0x17')]?_0x380050[_0x7ec1('0x17')][_0x7ec1('0x1b')]?_[_0x7ec1('0x1c')](_0x380050[_0x7ec1('0x17')][_0x7ec1('0x1b')],function(_0x39aa6c){return{'model':db[_0x39aa6c[_0x7ec1('0x1d')]],'as':_0x39aa6c['as'],'attributes':_0x39aa6c['attributes'],'include':_0x39aa6c[_0x7ec1('0x1b')]?_[_0x7ec1('0x1c')](_0x39aa6c[_0x7ec1('0x1b')],function(_0xa99ec1){return{'model':db[_0xa99ec1[_0x7ec1('0x1d')]],'as':_0xa99ec1['as'],'attributes':_0xa99ec1['attributes'],'include':_0xa99ec1['include']?_[_0x7ec1('0x1c')](_0xa99ec1['include'],function(_0x3f5bcf){return{'model':db[_0x3f5bcf[_0x7ec1('0x1d')]],'as':_0x3f5bcf['as'],'attributes':_0x3f5bcf[_0x7ec1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7ec1('0x9')](function(_0x2c4875){logger[_0x7ec1('0xa')]('ShowSugarcrmAccount',_0x380050);logger['debug']('ShowSugarcrmAccount',_0x380050,JSON['stringify'](_0x2c4875));_0x683304(_0x2c4875);})[_0x7ec1('0x13')](function(_0x38d2a9){logger['error']('ShowSugarcrmAccount',_0x38d2a9[_0x7ec1('0x11')],_0x380050);_0x53e8da(_0xd9f36[_0x7ec1('0xf')](0x1f4,_0x38d2a9[_0x7ec1('0x11')]));});});}; \ No newline at end of file +var _0x2206=['message','catch','GetSugarcrmAccount','findAll','options','attributes','limit','include','map','model','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','raw','where','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3d7af9,_0x15177c){var _0x194d61=function(_0x762127){while(--_0x762127){_0x3d7af9['push'](_0x3d7af9['shift']());}};_0x194d61(++_0x15177c);}(_0x2206,0x1cb));var _0x6220=function(_0x125be9,_0x1dfe6d){_0x125be9=_0x125be9-0x0;var _0x356d4c=_0x2206[_0x125be9];return _0x356d4c;};'use strict';var _=require(_0x6220('0x0'));var util=require(_0x6220('0x1'));var moment=require(_0x6220('0x2'));var BPromise=require(_0x6220('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6220('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6220('0x5'))(_0x6220('0x6'));var config=require('../../config/environment');var jayson=require(_0x6220('0x7'));var client=jayson[_0x6220('0x8')][_0x6220('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16c8a1,_0x80f7e2,_0x1bb77a){return new BPromise(function(_0x1b5866,_0x3da019){return client[_0x6220('0xa')](_0x16c8a1,_0x1bb77a)[_0x6220('0xb')](function(_0x5a3d38){logger[_0x6220('0xc')](_0x6220('0xd'),_0x80f7e2,_0x6220('0xe'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x80f7e2,_0x6220('0xe'),JSON['stringify'](_0x5a3d38));if(_0x5a3d38[_0x6220('0xf')]){if(_0x5a3d38[_0x6220('0xf')][_0x6220('0x10')]===0x1f4){logger[_0x6220('0xf')](_0x6220('0xd'),_0x80f7e2,_0x5a3d38[_0x6220('0xf')][_0x6220('0x11')]);return _0x3da019(_0x5a3d38[_0x6220('0xf')][_0x6220('0x11')]);}logger['error'](_0x6220('0xd'),_0x80f7e2,_0x5a3d38[_0x6220('0xf')]['message']);return _0x1b5866(_0x5a3d38[_0x6220('0xf')]['message']);}else{logger[_0x6220('0xc')](_0x6220('0xd'),_0x80f7e2,'request\x20sent');_0x1b5866(_0x5a3d38['result']['message']);}})[_0x6220('0x12')](function(_0x2b05c7){logger[_0x6220('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x80f7e2,_0x2b05c7);_0x3da019(_0x2b05c7);});});}exports[_0x6220('0x13')]=function(_0x193baa){var _0x16ac9a=this;return new Promise(function(_0x533c5f,_0x53e339){return db['SugarcrmAccount'][_0x6220('0x14')]({'raw':_0x193baa[_0x6220('0x15')]?_0x193baa['options']['raw']===undefined?!![]:![]:!![],'where':_0x193baa['options']?_0x193baa[_0x6220('0x15')]['where']||null:null,'attributes':_0x193baa['options']?_0x193baa['options'][_0x6220('0x16')]||null:null,'limit':_0x193baa[_0x6220('0x15')]?_0x193baa[_0x6220('0x15')][_0x6220('0x17')]||null:null,'include':_0x193baa[_0x6220('0x15')]?_0x193baa['options'][_0x6220('0x18')]?_[_0x6220('0x19')](_0x193baa[_0x6220('0x15')][_0x6220('0x18')],function(_0x8ec568){return{'model':db[_0x8ec568[_0x6220('0x1a')]],'as':_0x8ec568['as'],'attributes':_0x8ec568[_0x6220('0x16')],'include':_0x8ec568['include']?_['map'](_0x8ec568[_0x6220('0x18')],function(_0x1a7995){return{'model':db[_0x1a7995['model']],'as':_0x1a7995['as'],'attributes':_0x1a7995[_0x6220('0x16')],'include':_0x1a7995[_0x6220('0x18')]?_[_0x6220('0x19')](_0x1a7995['include'],function(_0x5a400c){return{'model':db[_0x5a400c[_0x6220('0x1a')]],'as':_0x5a400c['as'],'attributes':_0x5a400c[_0x6220('0x16')]};}):[]};}):[]};}):[]:[]})[_0x6220('0xb')](function(_0x3e3fdd){logger[_0x6220('0xc')]('GetSugarcrmAccount',_0x193baa);logger['debug'](_0x6220('0x13'),_0x193baa,JSON[_0x6220('0x1b')](_0x3e3fdd));_0x533c5f(_0x3e3fdd);})[_0x6220('0x12')](function(_0x455204){logger[_0x6220('0xf')](_0x6220('0x13'),_0x455204[_0x6220('0x11')],_0x193baa);_0x53e339(_0x16ac9a['error'](0x1f4,_0x455204['message']));});});};exports[_0x6220('0x1c')]=function(_0xc6d729){var _0x2d61fb=this;return new Promise(function(_0x1bb35a,_0x340121){return db[_0x6220('0x1d')][_0x6220('0x1e')]({'raw':_0xc6d729[_0x6220('0x15')]?_0xc6d729[_0x6220('0x15')][_0x6220('0x1f')]===undefined?!![]:![]:!![],'where':_0xc6d729[_0x6220('0x15')]?_0xc6d729[_0x6220('0x15')][_0x6220('0x20')]||null:null,'attributes':_0xc6d729[_0x6220('0x15')]?_0xc6d729['options'][_0x6220('0x16')]||null:null,'include':_0xc6d729[_0x6220('0x15')]?_0xc6d729['options'][_0x6220('0x18')]?_['map'](_0xc6d729['options'][_0x6220('0x18')],function(_0x183a92){return{'model':db[_0x183a92[_0x6220('0x1a')]],'as':_0x183a92['as'],'attributes':_0x183a92[_0x6220('0x16')],'include':_0x183a92[_0x6220('0x18')]?_[_0x6220('0x19')](_0x183a92[_0x6220('0x18')],function(_0x4cfd84){return{'model':db[_0x4cfd84['model']],'as':_0x4cfd84['as'],'attributes':_0x4cfd84[_0x6220('0x16')],'include':_0x4cfd84[_0x6220('0x18')]?_[_0x6220('0x19')](_0x4cfd84[_0x6220('0x18')],function(_0x198f84){return{'model':db[_0x198f84['model']],'as':_0x198f84['as'],'attributes':_0x198f84[_0x6220('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25a5cc){logger[_0x6220('0xc')](_0x6220('0x1c'),_0xc6d729);logger[_0x6220('0x21')](_0x6220('0x1c'),_0xc6d729,JSON[_0x6220('0x1b')](_0x25a5cc));_0x1bb35a(_0x25a5cc);})[_0x6220('0x12')](function(_0x3cfb70){logger[_0x6220('0xf')](_0x6220('0x1c'),_0x3cfb70[_0x6220('0x11')],_0xc6d729);_0x340121(_0x2d61fb[_0x6220('0xf')](0x1f4,_0x3cfb70[_0x6220('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index f01691d..b620717 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 _0x9691=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','create','put'];(function(_0x554c40,_0x35674b){var _0x1cc873=function(_0x1f24d7){while(--_0x1f24d7){_0x554c40['push'](_0x554c40['shift']());}};_0x1cc873(++_0x35674b);}(_0x9691,0x6d));var _0x1969=function(_0x15871b,_0x2044f5){_0x15871b=_0x15871b-0x0;var _0x450516=_0x9691[_0x15871b];return _0x450516;};'use strict';var multer=require('multer');var util=require(_0x1969('0x0'));var path=require('path');var timeout=require(_0x1969('0x1'));var express=require(_0x1969('0x2'));var router=express[_0x1969('0x3')]();var fs_extra=require(_0x1969('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1969('0x5'));var config=require('../../config/environment');var controller=require(_0x1969('0x6'));router[_0x1969('0x7')]('/',auth[_0x1969('0x8')](),controller['index']);router['get'](_0x1969('0x9'),auth[_0x1969('0x8')](),controller[_0x1969('0xa')]);router[_0x1969('0x7')](_0x1969('0xb'),auth[_0x1969('0x8')](),controller[_0x1969('0xc')]);router[_0x1969('0x7')](_0x1969('0xd'),auth[_0x1969('0x8')](),controller[_0x1969('0xe')]);router[_0x1969('0x7')]('/:id/descriptions',auth[_0x1969('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x1969('0x8')](),controller[_0x1969('0xf')]);router[_0x1969('0x10')]('/:id',auth[_0x1969('0x8')](),controller[_0x1969('0x11')]);router[_0x1969('0x12')](_0x1969('0x9'),auth['isAuthenticated'](),controller[_0x1969('0x13')]);module[_0x1969('0x14')]=router; \ No newline at end of file +var _0xb91b=['update','delete','exports','connect-timeout','express','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','/:id','isAuthenticated','show','/:id/fields','getFields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb91b,0x7b));var _0xbb91=function(_0x285a40,_0x2d4264){_0x285a40=_0x285a40-0x0;var _0x272cbd=_0xb91b[_0x285a40];return _0x272cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbb91('0x0'));var express=require(_0xbb91('0x1'));var router=express['Router']();var fs_extra=require(_0xbb91('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xbb91('0x3'));var config=require('../../config/environment');var controller=require(_0xbb91('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xbb91('0x5'),auth[_0xbb91('0x6')](),controller[_0xbb91('0x7')]);router['get'](_0xbb91('0x8'),auth['isAuthenticated'](),controller[_0xbb91('0x9')]);router[_0xbb91('0xa')](_0xbb91('0xb'),auth[_0xbb91('0x6')](),controller[_0xbb91('0xc')]);router[_0xbb91('0xa')](_0xbb91('0xd'),auth['isAuthenticated'](),controller[_0xbb91('0xe')]);router[_0xbb91('0xf')]('/',auth[_0xbb91('0x6')](),controller['create']);router[_0xbb91('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbb91('0x11')]);router[_0xbb91('0x12')](_0xbb91('0x5'),auth[_0xbb91('0x6')](),controller['destroy']);module[_0xbb91('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 88aca89..1b6bde7 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 _0x8690=['STRING','exports'];(function(_0x5580ef,_0x7c8842){var _0x2d5e26=function(_0x4d0c53){while(--_0x4d0c53){_0x5580ef['push'](_0x5580ef['shift']());}};_0x2d5e26(++_0x7c8842);}(_0x8690,0x19d));var _0x0869=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x8690[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require('sequelize');module[_0x0869('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0869('0x1')]}}; \ No newline at end of file +var _0x71b5=['exports','STRING'];(function(_0x5a9b6c,_0x30ccd0){var _0x72bed=function(_0x1468ea){while(--_0x1468ea){_0x5a9b6c['push'](_0x5a9b6c['shift']());}};_0x72bed(++_0x30ccd0);}(_0x71b5,0x1ea));var _0x571b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71b5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x571b('0x0')]={'name':{'type':Sequelize[_0x571b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c630e0b..f8f910a 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 _0xbcc9=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','SugarcrmConfiguration','rows','catch','show','params','keys','find','create','body','update','destroy','getFields','findOne','length','getSubjects','order','getDescriptions','SugarcrmField','eml-format','rimraf','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2bef51,_0x3549d3){var _0x29097d=function(_0x29ca79){while(--_0x29ca79){_0x2bef51['push'](_0x2bef51['shift']());}};_0x29097d(++_0x3549d3);}(_0xbcc9,0x85));var _0x9bcc=function(_0x2fe50f,_0x292fbf){_0x2fe50f=_0x2fe50f-0x0;var _0x5d5033=_0xbcc9[_0x2fe50f];return _0x5d5033;};'use strict';var emlformat=require(_0x9bcc('0x0'));var rimraf=require(_0x9bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9bcc('0x2'));var moment=require(_0x9bcc('0x3'));var BPromise=require(_0x9bcc('0x4'));var Mustache=require(_0x9bcc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9bcc('0x6'));var ejs=require(_0x9bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x9bcc('0x8'));var _=require(_0x9bcc('0x9'));var squel=require(_0x9bcc('0xa'));var crypto=require(_0x9bcc('0xb'));var jsforce=require(_0x9bcc('0xc'));var deskjs=require(_0x9bcc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9bcc('0xe'));var Papa=require('papaparse');var Redis=require(_0x9bcc('0xf'));var authService=require(_0x9bcc('0x10'));var qs=require(_0x9bcc('0x11'));var as=require(_0x9bcc('0x12'));var hardwareService=require(_0x9bcc('0x13'));var logger=require('../../config/logger')(_0x9bcc('0x14'));var utils=require('../../config/utils');var config=require(_0x9bcc('0x15'));var licenseUtil=require(_0x9bcc('0x16'));var db=require(_0x9bcc('0x17'))['db'];function respondWithStatusCode(_0x2f3173,_0x411a8e){_0x411a8e=_0x411a8e||0xcc;return function(_0x433034){if(_0x433034){return _0x2f3173[_0x9bcc('0x18')](_0x411a8e);}return _0x2f3173[_0x9bcc('0x19')](_0x411a8e)[_0x9bcc('0x1a')]();};}function respondWithResult(_0x4c92ce,_0x52bab9){_0x52bab9=_0x52bab9||0xc8;return function(_0x3c7bc0){if(_0x3c7bc0){return _0x4c92ce[_0x9bcc('0x19')](_0x52bab9)[_0x9bcc('0x1b')](_0x3c7bc0);}};}function respondWithFilteredResult(_0x4eee56,_0x20ff9e){return function(_0xbd4b1f){if(_0xbd4b1f){var _0x1f1faf=typeof _0x20ff9e['offset']===_0x9bcc('0x1c')&&typeof _0x20ff9e[_0x9bcc('0x1d')]===_0x9bcc('0x1c');var _0x3e2b10=_0xbd4b1f[_0x9bcc('0x1e')];var _0x332077=_0x1f1faf?0x0:_0x20ff9e[_0x9bcc('0x1f')];var _0x5d7d9a=_0x1f1faf?_0xbd4b1f[_0x9bcc('0x1e')]:_0x20ff9e['offset']+_0x20ff9e[_0x9bcc('0x1d')];var _0x527ab2;if(_0x5d7d9a>=_0x3e2b10){_0x5d7d9a=_0x3e2b10;_0x527ab2=0xc8;}else{_0x527ab2=0xce;}_0x4eee56[_0x9bcc('0x19')](_0x527ab2);return _0x4eee56[_0x9bcc('0x20')](_0x9bcc('0x21'),_0x332077+'-'+_0x5d7d9a+'/'+_0x3e2b10)['json'](_0xbd4b1f);}return null;};}function patchUpdates(_0x2ac1f5){return function(_0x73b8f0){try{jsonpatch[_0x9bcc('0x22')](_0x73b8f0,_0x2ac1f5,!![]);}catch(_0x370117){return BPromise[_0x9bcc('0x23')](_0x370117);}return _0x73b8f0[_0x9bcc('0x24')]();};}function saveUpdates(_0x4fd668,_0x499bae){return function(_0x2474f4){if(_0x2474f4){return _0x2474f4['update'](_0x4fd668)[_0x9bcc('0x25')](function(_0x2aaf45){return _0x2aaf45;});}return null;};}function removeEntity(_0x39a87c,_0x1a6dc1){return function(_0x4fbd4a){if(_0x4fbd4a){return _0x4fbd4a['destroy']()[_0x9bcc('0x25')](function(){_0x39a87c[_0x9bcc('0x19')](0xcc)[_0x9bcc('0x1a')]();});}};}function handleEntityNotFound(_0x5340a2,_0x528b3e){return function(_0x3626e0){if(!_0x3626e0){_0x5340a2['sendStatus'](0x194);}return _0x3626e0;};}function handleError(_0x46d983,_0x17afaf){_0x17afaf=_0x17afaf||0x1f4;return function(_0x1c5760){logger['error'](_0x1c5760['stack']);if(_0x1c5760[_0x9bcc('0x26')]){delete _0x1c5760[_0x9bcc('0x26')];}_0x46d983['status'](_0x17afaf)[_0x9bcc('0x27')](_0x1c5760);};}exports[_0x9bcc('0x28')]=function(_0x14c9bd,_0x214501){var _0x272818={},_0x4f0f5a={},_0x390f74={'count':0x0,'rows':[]};var _0x1bd804=_[_0x9bcc('0x29')](db['SugarcrmConfiguration'][_0x9bcc('0x2a')],function(_0xafe151){return{'name':_0xafe151[_0x9bcc('0x2b')],'type':_0xafe151[_0x9bcc('0x2c')][_0x9bcc('0x2d')]};});_0x4f0f5a[_0x9bcc('0x2e')]=_[_0x9bcc('0x29')](_0x1bd804,_0x9bcc('0x26'));_0x4f0f5a[_0x9bcc('0x2f')]=_['keys'](_0x14c9bd[_0x9bcc('0x2f')]);_0x4f0f5a[_0x9bcc('0x30')]=_[_0x9bcc('0x31')](_0x4f0f5a[_0x9bcc('0x2e')],_0x4f0f5a[_0x9bcc('0x2f')]);_0x272818[_0x9bcc('0x32')]=_['intersection'](_0x4f0f5a['model'],qs[_0x9bcc('0x33')](_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x33')]));_0x272818['attributes']=_0x272818[_0x9bcc('0x32')]['length']?_0x272818[_0x9bcc('0x32')]:_0x4f0f5a['model'];if(!_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x34')](_0x9bcc('0x35'))){_0x272818['limit']=qs['limit'](_0x14c9bd['query']['limit']);_0x272818['offset']=qs[_0x9bcc('0x1f')](_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x1f')]);}_0x272818['order']=qs['sort'](_0x14c9bd['query'][_0x9bcc('0x36')]);_0x272818[_0x9bcc('0x37')]=qs['filters'](_[_0x9bcc('0x38')](_0x14c9bd[_0x9bcc('0x2f')],_0x4f0f5a['filters']),_0x1bd804);if(_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x39')]){_0x272818[_0x9bcc('0x37')]=_[_0x9bcc('0x3a')](_0x272818[_0x9bcc('0x37')],{'$or':_[_0x9bcc('0x29')](_0x1bd804,function(_0x3cc69e){if(_0x3cc69e[_0x9bcc('0x2c')]!=='VIRTUAL'){var _0x92407b={};_0x92407b[_0x3cc69e['name']]={'$like':'%'+_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x39')]+'%'};return _0x92407b;}})});}_0x272818=_[_0x9bcc('0x3a')]({},_0x272818,_0x14c9bd[_0x9bcc('0x3b')]);var _0x1457ce={'where':_0x272818[_0x9bcc('0x37')]};return db['SugarcrmConfiguration'][_0x9bcc('0x1e')](_0x1457ce)[_0x9bcc('0x25')](function(_0x598832){_0x390f74[_0x9bcc('0x1e')]=_0x598832;if(_0x14c9bd[_0x9bcc('0x2f')][_0x9bcc('0x3c')]){_0x272818[_0x9bcc('0x3d')]=[{'all':!![]}];}return db[_0x9bcc('0x3e')]['findAll'](_0x272818);})['then'](function(_0x3e138e){_0x390f74[_0x9bcc('0x3f')]=_0x3e138e;return _0x390f74;})[_0x9bcc('0x25')](respondWithFilteredResult(_0x214501,_0x272818))[_0x9bcc('0x40')](handleError(_0x214501,null));};exports[_0x9bcc('0x41')]=function(_0x46e105,_0x5ac685){var _0x51668a={'raw':![],'where':{'id':_0x46e105[_0x9bcc('0x42')]['id']}},_0x1d8462={};_0x1d8462['model']=_[_0x9bcc('0x43')](db[_0x9bcc('0x3e')]['rawAttributes']);_0x1d8462[_0x9bcc('0x2f')]=_[_0x9bcc('0x43')](_0x46e105[_0x9bcc('0x2f')]);_0x1d8462[_0x9bcc('0x30')]=_['intersection'](_0x1d8462['model'],_0x1d8462[_0x9bcc('0x2f')]);_0x51668a[_0x9bcc('0x32')]=_['intersection'](_0x1d8462['model'],qs['fields'](_0x46e105[_0x9bcc('0x2f')]['fields']));_0x51668a['attributes']=_0x51668a['attributes']['length']?_0x51668a[_0x9bcc('0x32')]:_0x1d8462[_0x9bcc('0x2e')];if(_0x46e105['query']['includeAll']){_0x51668a['include']=[{'all':!![]}];}_0x51668a=_[_0x9bcc('0x3a')]({},_0x51668a,_0x46e105[_0x9bcc('0x3b')]);return db[_0x9bcc('0x3e')][_0x9bcc('0x44')](_0x51668a)[_0x9bcc('0x25')](handleEntityNotFound(_0x5ac685,null))[_0x9bcc('0x25')](respondWithResult(_0x5ac685,null))[_0x9bcc('0x40')](handleError(_0x5ac685,null));};exports[_0x9bcc('0x45')]=function(_0x237f61,_0x551055){return db[_0x9bcc('0x3e')]['create'](_0x237f61[_0x9bcc('0x46')],{})[_0x9bcc('0x25')](respondWithResult(_0x551055,0xc9))[_0x9bcc('0x40')](handleError(_0x551055,null));};exports[_0x9bcc('0x47')]=function(_0x43850d,_0x46d2f8){if(_0x43850d['body']['id']){delete _0x43850d['body']['id'];}return db[_0x9bcc('0x3e')][_0x9bcc('0x44')]({'where':{'id':_0x43850d[_0x9bcc('0x42')]['id']}})[_0x9bcc('0x25')](handleEntityNotFound(_0x46d2f8,null))[_0x9bcc('0x25')](saveUpdates(_0x43850d['body'],null))[_0x9bcc('0x25')](respondWithResult(_0x46d2f8,null))[_0x9bcc('0x40')](handleError(_0x46d2f8,null));};exports[_0x9bcc('0x48')]=function(_0x240a14,_0x25bcd6){return db[_0x9bcc('0x3e')][_0x9bcc('0x44')]({'where':{'id':_0x240a14[_0x9bcc('0x42')]['id']}})['then'](handleEntityNotFound(_0x25bcd6,null))[_0x9bcc('0x25')](removeEntity(_0x25bcd6,null))['catch'](handleError(_0x25bcd6,null));};exports[_0x9bcc('0x49')]=function(_0x5081c5,_0x289699,_0x47d2e2){var _0x189f50={};var _0x44f4d9={};var _0x16c730;var _0x15909f;return db[_0x9bcc('0x3e')][_0x9bcc('0x4a')]({'where':{'id':_0x5081c5['params']['id']}})['then'](handleEntityNotFound(_0x289699,null))[_0x9bcc('0x25')](function(_0x237e2d){if(_0x237e2d){_0x16c730=_0x237e2d;_0x44f4d9['model']=_[_0x9bcc('0x43')](db['SugarcrmField']['rawAttributes']);_0x44f4d9['query']=_[_0x9bcc('0x43')](_0x5081c5[_0x9bcc('0x2f')]);_0x44f4d9[_0x9bcc('0x30')]=_[_0x9bcc('0x31')](_0x44f4d9[_0x9bcc('0x2e')],_0x44f4d9['query']);_0x189f50[_0x9bcc('0x32')]=_[_0x9bcc('0x31')](_0x44f4d9[_0x9bcc('0x2e')],qs[_0x9bcc('0x33')](_0x5081c5[_0x9bcc('0x2f')][_0x9bcc('0x33')]));_0x189f50[_0x9bcc('0x32')]=_0x189f50['attributes'][_0x9bcc('0x4b')]?_0x189f50[_0x9bcc('0x32')]:_0x44f4d9[_0x9bcc('0x2e')];_0x189f50['order']=qs[_0x9bcc('0x36')](_0x5081c5[_0x9bcc('0x2f')][_0x9bcc('0x36')]);_0x189f50[_0x9bcc('0x37')]=qs['filters'](_[_0x9bcc('0x38')](_0x5081c5['query'],_0x44f4d9[_0x9bcc('0x30')]));if(_0x5081c5[_0x9bcc('0x2f')]['filter']){_0x189f50[_0x9bcc('0x37')]=_[_0x9bcc('0x3a')](_0x189f50[_0x9bcc('0x37')],{'$or':_[_0x9bcc('0x29')](_0x189f50[_0x9bcc('0x32')],function(_0x5dfbdb){var _0x29970e={};_0x29970e[_0x5dfbdb]={'$like':'%'+_0x5081c5[_0x9bcc('0x2f')]['filter']+'%'};return _0x29970e;})});}_0x189f50=_[_0x9bcc('0x3a')]({},_0x189f50,_0x5081c5[_0x9bcc('0x3b')]);return _0x16c730[_0x9bcc('0x49')](_0x189f50);}})[_0x9bcc('0x25')](function(_0x1f67d0){if(_0x1f67d0){_0x15909f=_0x1f67d0[_0x9bcc('0x4b')];if(!_0x5081c5[_0x9bcc('0x2f')][_0x9bcc('0x34')](_0x9bcc('0x35'))){_0x189f50[_0x9bcc('0x1d')]=qs['limit'](_0x5081c5['query'][_0x9bcc('0x1d')]);_0x189f50[_0x9bcc('0x1f')]=qs[_0x9bcc('0x1f')](_0x5081c5[_0x9bcc('0x2f')]['offset']);}return _0x16c730[_0x9bcc('0x49')](_0x189f50);}})[_0x9bcc('0x25')](function(_0x532770){if(_0x532770){return _0x532770?{'count':_0x15909f,'rows':_0x532770}:null;}})[_0x9bcc('0x25')](respondWithResult(_0x289699,null))[_0x9bcc('0x40')](handleError(_0x289699,null));};exports[_0x9bcc('0x4c')]=function(_0x450fa9,_0x111de9,_0x2abe14){var _0x32bce0={};var _0x28ab6f={};var _0x1474e0;var _0x5bb286;return db[_0x9bcc('0x3e')][_0x9bcc('0x4a')]({'where':{'id':_0x450fa9['params']['id']}})['then'](handleEntityNotFound(_0x111de9,null))[_0x9bcc('0x25')](function(_0x1ad0bf){if(_0x1ad0bf){_0x1474e0=_0x1ad0bf;_0x28ab6f[_0x9bcc('0x2e')]=_['keys'](db['SugarcrmField'][_0x9bcc('0x2a')]);_0x28ab6f[_0x9bcc('0x2f')]=_[_0x9bcc('0x43')](_0x450fa9[_0x9bcc('0x2f')]);_0x28ab6f[_0x9bcc('0x30')]=_[_0x9bcc('0x31')](_0x28ab6f[_0x9bcc('0x2e')],_0x28ab6f[_0x9bcc('0x2f')]);_0x32bce0['attributes']=_[_0x9bcc('0x31')](_0x28ab6f['model'],qs['fields'](_0x450fa9[_0x9bcc('0x2f')][_0x9bcc('0x33')]));_0x32bce0['attributes']=_0x32bce0['attributes']['length']?_0x32bce0[_0x9bcc('0x32')]:_0x28ab6f['model'];_0x32bce0[_0x9bcc('0x4d')]=qs[_0x9bcc('0x36')](_0x450fa9[_0x9bcc('0x2f')][_0x9bcc('0x36')]);_0x32bce0['where']=qs[_0x9bcc('0x30')](_['pick'](_0x450fa9[_0x9bcc('0x2f')],_0x28ab6f['filters']));if(_0x450fa9['query'][_0x9bcc('0x39')]){_0x32bce0[_0x9bcc('0x37')]=_[_0x9bcc('0x3a')](_0x32bce0[_0x9bcc('0x37')],{'$or':_[_0x9bcc('0x29')](_0x32bce0[_0x9bcc('0x32')],function(_0x3a0f2d){var _0x1e017b={};_0x1e017b[_0x3a0f2d]={'$like':'%'+_0x450fa9['query'][_0x9bcc('0x39')]+'%'};return _0x1e017b;})});}_0x32bce0=_[_0x9bcc('0x3a')]({},_0x32bce0,_0x450fa9[_0x9bcc('0x3b')]);return _0x1474e0[_0x9bcc('0x4c')](_0x32bce0);}})[_0x9bcc('0x25')](function(_0x31da42){if(_0x31da42){_0x5bb286=_0x31da42[_0x9bcc('0x4b')];if(!_0x450fa9['query']['hasOwnProperty']('nolimit')){_0x32bce0[_0x9bcc('0x1d')]=qs['limit'](_0x450fa9[_0x9bcc('0x2f')][_0x9bcc('0x1d')]);_0x32bce0[_0x9bcc('0x1f')]=qs['offset'](_0x450fa9['query']['offset']);}return _0x1474e0[_0x9bcc('0x4c')](_0x32bce0);}})[_0x9bcc('0x25')](function(_0x2db804){if(_0x2db804){return _0x2db804?{'count':_0x5bb286,'rows':_0x2db804}:null;}})[_0x9bcc('0x25')](respondWithResult(_0x111de9,null))[_0x9bcc('0x40')](handleError(_0x111de9,null));};exports[_0x9bcc('0x4e')]=function(_0x8dd12c,_0x30749f,_0x10b80e){var _0x5db8e2={};var _0x5c35a1={};var _0xc2a1f0;var _0x26bd45;return db[_0x9bcc('0x3e')]['findOne']({'where':{'id':_0x8dd12c[_0x9bcc('0x42')]['id']}})[_0x9bcc('0x25')](handleEntityNotFound(_0x30749f,null))[_0x9bcc('0x25')](function(_0x585c64){if(_0x585c64){_0xc2a1f0=_0x585c64;_0x5c35a1[_0x9bcc('0x2e')]=_[_0x9bcc('0x43')](db[_0x9bcc('0x4f')][_0x9bcc('0x2a')]);_0x5c35a1[_0x9bcc('0x2f')]=_[_0x9bcc('0x43')](_0x8dd12c[_0x9bcc('0x2f')]);_0x5c35a1[_0x9bcc('0x30')]=_['intersection'](_0x5c35a1[_0x9bcc('0x2e')],_0x5c35a1['query']);_0x5db8e2[_0x9bcc('0x32')]=_[_0x9bcc('0x31')](_0x5c35a1[_0x9bcc('0x2e')],qs[_0x9bcc('0x33')](_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x33')]));_0x5db8e2[_0x9bcc('0x32')]=_0x5db8e2[_0x9bcc('0x32')][_0x9bcc('0x4b')]?_0x5db8e2[_0x9bcc('0x32')]:_0x5c35a1['model'];_0x5db8e2[_0x9bcc('0x4d')]=qs[_0x9bcc('0x36')](_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x36')]);_0x5db8e2[_0x9bcc('0x37')]=qs[_0x9bcc('0x30')](_[_0x9bcc('0x38')](_0x8dd12c['query'],_0x5c35a1[_0x9bcc('0x30')]));if(_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x39')]){_0x5db8e2['where']=_['merge'](_0x5db8e2[_0x9bcc('0x37')],{'$or':_[_0x9bcc('0x29')](_0x5db8e2[_0x9bcc('0x32')],function(_0x477eb7){var _0x19e05b={};_0x19e05b[_0x477eb7]={'$like':'%'+_0x8dd12c[_0x9bcc('0x2f')]['filter']+'%'};return _0x19e05b;})});}_0x5db8e2=_[_0x9bcc('0x3a')]({},_0x5db8e2,_0x8dd12c['options']);return _0xc2a1f0[_0x9bcc('0x4e')](_0x5db8e2);}})['then'](function(_0x7976ea){if(_0x7976ea){_0x26bd45=_0x7976ea['length'];if(!_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x34')]('nolimit')){_0x5db8e2['limit']=qs[_0x9bcc('0x1d')](_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x1d')]);_0x5db8e2['offset']=qs[_0x9bcc('0x1f')](_0x8dd12c[_0x9bcc('0x2f')][_0x9bcc('0x1f')]);}return _0xc2a1f0[_0x9bcc('0x4e')](_0x5db8e2);}})[_0x9bcc('0x25')](function(_0x447af9){if(_0x447af9){return _0x447af9?{'count':_0x26bd45,'rows':_0x447af9}:null;}})[_0x9bcc('0x25')](respondWithResult(_0x30749f,null))[_0x9bcc('0x40')](handleError(_0x30749f,null));}; \ No newline at end of file +var _0x759a=['status','end','offset','undefined','limit','count','reject','save','then','destroy','sendStatus','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','catch','params','intersection','include','options','find','create','body','update','getFields','findOne','SugarcrmField','getSubjects','pick','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb'];(function(_0xdf5a03,_0xe1a11c){var _0x555eed=function(_0x9d9c01){while(--_0x9d9c01){_0xdf5a03['push'](_0xdf5a03['shift']());}};_0x555eed(++_0xe1a11c);}(_0x759a,0x82));var _0xa759=function(_0x38493b,_0x1b5ac6){_0x38493b=_0x38493b-0x0;var _0x4c124a=_0x759a[_0x38493b];return _0x4c124a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa759('0x0'));var zipdir=require(_0xa759('0x1'));var jsonpatch=require(_0xa759('0x2'));var rp=require(_0xa759('0x3'));var moment=require(_0xa759('0x4'));var BPromise=require(_0xa759('0x5'));var Mustache=require(_0xa759('0x6'));var util=require(_0xa759('0x7'));var path=require(_0xa759('0x8'));var sox=require(_0xa759('0x9'));var csv=require(_0xa759('0xa'));var ejs=require(_0xa759('0xb'));var fs=require('fs');var fs_extra=require(_0xa759('0xc'));var _=require(_0xa759('0xd'));var squel=require(_0xa759('0xe'));var crypto=require(_0xa759('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa759('0xa'));var querystring=require(_0xa759('0x10'));var Papa=require(_0xa759('0x11'));var Redis=require(_0xa759('0x12'));var authService=require(_0xa759('0x13'));var qs=require(_0xa759('0x14'));var as=require(_0xa759('0x15'));var hardwareService=require(_0xa759('0x16'));var logger=require(_0xa759('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa759('0x18'));var db=require(_0xa759('0x19'))['db'];function respondWithStatusCode(_0x40b66b,_0x39d0b1){_0x39d0b1=_0x39d0b1||0xcc;return function(_0x3bd207){if(_0x3bd207){return _0x40b66b['sendStatus'](_0x39d0b1);}return _0x40b66b[_0xa759('0x1a')](_0x39d0b1)[_0xa759('0x1b')]();};}function respondWithResult(_0x282614,_0x14c1fc){_0x14c1fc=_0x14c1fc||0xc8;return function(_0x249d0c){if(_0x249d0c){return _0x282614[_0xa759('0x1a')](_0x14c1fc)['json'](_0x249d0c);}};}function respondWithFilteredResult(_0x52e5af,_0x49c58c){return function(_0x56148e){if(_0x56148e){var _0x2585f7=typeof _0x49c58c[_0xa759('0x1c')]===_0xa759('0x1d')&&typeof _0x49c58c[_0xa759('0x1e')]===_0xa759('0x1d');var _0x13506e=_0x56148e['count'];var _0x5e4487=_0x2585f7?0x0:_0x49c58c[_0xa759('0x1c')];var _0x1921b8=_0x2585f7?_0x56148e[_0xa759('0x1f')]:_0x49c58c[_0xa759('0x1c')]+_0x49c58c[_0xa759('0x1e')];var _0x6f2267;if(_0x1921b8>=_0x13506e){_0x1921b8=_0x13506e;_0x6f2267=0xc8;}else{_0x6f2267=0xce;}_0x52e5af['status'](_0x6f2267);return _0x52e5af['set']('Content-Range',_0x5e4487+'-'+_0x1921b8+'/'+_0x13506e)['json'](_0x56148e);}return null;};}function patchUpdates(_0x5c6091){return function(_0x5b28e2){try{jsonpatch['apply'](_0x5b28e2,_0x5c6091,!![]);}catch(_0x1abe6f){return BPromise[_0xa759('0x20')](_0x1abe6f);}return _0x5b28e2[_0xa759('0x21')]();};}function saveUpdates(_0x221368,_0x141615){return function(_0x1067e7){if(_0x1067e7){return _0x1067e7['update'](_0x221368)[_0xa759('0x22')](function(_0x34a73d){return _0x34a73d;});}return null;};}function removeEntity(_0x71ade8,_0xb47eac){return function(_0x48857e){if(_0x48857e){return _0x48857e[_0xa759('0x23')]()['then'](function(){_0x71ade8[_0xa759('0x1a')](0xcc)[_0xa759('0x1b')]();});}};}function handleEntityNotFound(_0x44fecf,_0x37fc7c){return function(_0x5d0488){if(!_0x5d0488){_0x44fecf[_0xa759('0x24')](0x194);}return _0x5d0488;};}function handleError(_0x81ecf1,_0x2c831f){_0x2c831f=_0x2c831f||0x1f4;return function(_0x206999){logger[_0xa759('0x25')](_0x206999[_0xa759('0x26')]);if(_0x206999['name']){delete _0x206999[_0xa759('0x27')];}_0x81ecf1[_0xa759('0x1a')](_0x2c831f)['send'](_0x206999);};}exports[_0xa759('0x28')]=function(_0x5669a1,_0x450efb){var _0x30084c={},_0x4f7988={},_0x1406f5={'count':0x0,'rows':[]};var _0x2647a7=_[_0xa759('0x29')](db[_0xa759('0x2a')][_0xa759('0x2b')],function(_0x6e67d1){return{'name':_0x6e67d1[_0xa759('0x2c')],'type':_0x6e67d1[_0xa759('0x2d')][_0xa759('0x2e')]};});_0x4f7988[_0xa759('0x2f')]=_[_0xa759('0x29')](_0x2647a7,_0xa759('0x27'));_0x4f7988[_0xa759('0x30')]=_[_0xa759('0x31')](_0x5669a1[_0xa759('0x30')]);_0x4f7988[_0xa759('0x32')]=_['intersection'](_0x4f7988['model'],_0x4f7988[_0xa759('0x30')]);_0x30084c[_0xa759('0x33')]=_['intersection'](_0x4f7988[_0xa759('0x2f')],qs[_0xa759('0x34')](_0x5669a1[_0xa759('0x30')][_0xa759('0x34')]));_0x30084c['attributes']=_0x30084c['attributes'][_0xa759('0x35')]?_0x30084c[_0xa759('0x33')]:_0x4f7988[_0xa759('0x2f')];if(!_0x5669a1['query'][_0xa759('0x36')](_0xa759('0x37'))){_0x30084c[_0xa759('0x1e')]=qs[_0xa759('0x1e')](_0x5669a1[_0xa759('0x30')][_0xa759('0x1e')]);_0x30084c[_0xa759('0x1c')]=qs[_0xa759('0x1c')](_0x5669a1[_0xa759('0x30')][_0xa759('0x1c')]);}_0x30084c['order']=qs[_0xa759('0x38')](_0x5669a1[_0xa759('0x30')][_0xa759('0x38')]);_0x30084c[_0xa759('0x39')]=qs['filters'](_['pick'](_0x5669a1[_0xa759('0x30')],_0x4f7988[_0xa759('0x32')]),_0x2647a7);if(_0x5669a1[_0xa759('0x30')][_0xa759('0x3a')]){_0x30084c[_0xa759('0x39')]=_['merge'](_0x30084c['where'],{'$or':_[_0xa759('0x29')](_0x2647a7,function(_0x305bf3){if(_0x305bf3[_0xa759('0x2d')]!==_0xa759('0x3b')){var _0x43cd9f={};_0x43cd9f[_0x305bf3[_0xa759('0x27')]]={'$like':'%'+_0x5669a1['query'][_0xa759('0x3a')]+'%'};return _0x43cd9f;}})});}_0x30084c=_[_0xa759('0x3c')]({},_0x30084c,_0x5669a1['options']);var _0x2b61ac={'where':_0x30084c[_0xa759('0x39')]};return db[_0xa759('0x2a')]['count'](_0x2b61ac)[_0xa759('0x22')](function(_0x5a2827){_0x1406f5[_0xa759('0x1f')]=_0x5a2827;if(_0x5669a1['query'][_0xa759('0x3d')]){_0x30084c['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xa759('0x3e')](_0x30084c);})['then'](function(_0x26e3aa){_0x1406f5['rows']=_0x26e3aa;return _0x1406f5;})[_0xa759('0x22')](respondWithFilteredResult(_0x450efb,_0x30084c))[_0xa759('0x3f')](handleError(_0x450efb,null));};exports['show']=function(_0x37af98,_0x572287){var _0x42e9fb={'raw':![],'where':{'id':_0x37af98[_0xa759('0x40')]['id']}},_0x3ae707={};_0x3ae707[_0xa759('0x2f')]=_[_0xa759('0x31')](db[_0xa759('0x2a')][_0xa759('0x2b')]);_0x3ae707[_0xa759('0x30')]=_[_0xa759('0x31')](_0x37af98['query']);_0x3ae707[_0xa759('0x32')]=_[_0xa759('0x41')](_0x3ae707['model'],_0x3ae707[_0xa759('0x30')]);_0x42e9fb[_0xa759('0x33')]=_[_0xa759('0x41')](_0x3ae707[_0xa759('0x2f')],qs[_0xa759('0x34')](_0x37af98[_0xa759('0x30')]['fields']));_0x42e9fb[_0xa759('0x33')]=_0x42e9fb[_0xa759('0x33')][_0xa759('0x35')]?_0x42e9fb[_0xa759('0x33')]:_0x3ae707['model'];if(_0x37af98[_0xa759('0x30')][_0xa759('0x3d')]){_0x42e9fb[_0xa759('0x42')]=[{'all':!![]}];}_0x42e9fb=_[_0xa759('0x3c')]({},_0x42e9fb,_0x37af98[_0xa759('0x43')]);return db[_0xa759('0x2a')][_0xa759('0x44')](_0x42e9fb)['then'](handleEntityNotFound(_0x572287,null))[_0xa759('0x22')](respondWithResult(_0x572287,null))[_0xa759('0x3f')](handleError(_0x572287,null));};exports[_0xa759('0x45')]=function(_0x3305c9,_0x47836a){return db[_0xa759('0x2a')][_0xa759('0x45')](_0x3305c9[_0xa759('0x46')],{})['then'](respondWithResult(_0x47836a,0xc9))['catch'](handleError(_0x47836a,null));};exports[_0xa759('0x47')]=function(_0x446154,_0x27a327){if(_0x446154[_0xa759('0x46')]['id']){delete _0x446154['body']['id'];}return db[_0xa759('0x2a')][_0xa759('0x44')]({'where':{'id':_0x446154[_0xa759('0x40')]['id']}})['then'](handleEntityNotFound(_0x27a327,null))[_0xa759('0x22')](saveUpdates(_0x446154['body'],null))[_0xa759('0x22')](respondWithResult(_0x27a327,null))[_0xa759('0x3f')](handleError(_0x27a327,null));};exports['destroy']=function(_0x5431b8,_0x54fdff){return db[_0xa759('0x2a')][_0xa759('0x44')]({'where':{'id':_0x5431b8[_0xa759('0x40')]['id']}})[_0xa759('0x22')](handleEntityNotFound(_0x54fdff,null))[_0xa759('0x22')](removeEntity(_0x54fdff,null))[_0xa759('0x3f')](handleError(_0x54fdff,null));};exports[_0xa759('0x48')]=function(_0x4291f1,_0xae454a,_0x2ee772){var _0x399a6b={};var _0x49d7e7={};var _0x22f0bb;var _0x441306;return db['SugarcrmConfiguration'][_0xa759('0x49')]({'where':{'id':_0x4291f1[_0xa759('0x40')]['id']}})[_0xa759('0x22')](handleEntityNotFound(_0xae454a,null))[_0xa759('0x22')](function(_0x5490dc){if(_0x5490dc){_0x22f0bb=_0x5490dc;_0x49d7e7[_0xa759('0x2f')]=_[_0xa759('0x31')](db[_0xa759('0x4a')][_0xa759('0x2b')]);_0x49d7e7[_0xa759('0x30')]=_[_0xa759('0x31')](_0x4291f1['query']);_0x49d7e7[_0xa759('0x32')]=_[_0xa759('0x41')](_0x49d7e7[_0xa759('0x2f')],_0x49d7e7['query']);_0x399a6b[_0xa759('0x33')]=_[_0xa759('0x41')](_0x49d7e7[_0xa759('0x2f')],qs[_0xa759('0x34')](_0x4291f1[_0xa759('0x30')][_0xa759('0x34')]));_0x399a6b['attributes']=_0x399a6b[_0xa759('0x33')]['length']?_0x399a6b['attributes']:_0x49d7e7['model'];_0x399a6b['order']=qs['sort'](_0x4291f1[_0xa759('0x30')]['sort']);_0x399a6b[_0xa759('0x39')]=qs[_0xa759('0x32')](_['pick'](_0x4291f1[_0xa759('0x30')],_0x49d7e7[_0xa759('0x32')]));if(_0x4291f1[_0xa759('0x30')]['filter']){_0x399a6b[_0xa759('0x39')]=_[_0xa759('0x3c')](_0x399a6b[_0xa759('0x39')],{'$or':_[_0xa759('0x29')](_0x399a6b['attributes'],function(_0x285058){var _0x2de468={};_0x2de468[_0x285058]={'$like':'%'+_0x4291f1[_0xa759('0x30')][_0xa759('0x3a')]+'%'};return _0x2de468;})});}_0x399a6b=_['merge']({},_0x399a6b,_0x4291f1[_0xa759('0x43')]);return _0x22f0bb[_0xa759('0x48')](_0x399a6b);}})[_0xa759('0x22')](function(_0x4cf8e5){if(_0x4cf8e5){_0x441306=_0x4cf8e5[_0xa759('0x35')];if(!_0x4291f1['query']['hasOwnProperty'](_0xa759('0x37'))){_0x399a6b[_0xa759('0x1e')]=qs[_0xa759('0x1e')](_0x4291f1['query'][_0xa759('0x1e')]);_0x399a6b['offset']=qs[_0xa759('0x1c')](_0x4291f1[_0xa759('0x30')]['offset']);}return _0x22f0bb[_0xa759('0x48')](_0x399a6b);}})['then'](function(_0x4375e7){if(_0x4375e7){return _0x4375e7?{'count':_0x441306,'rows':_0x4375e7}:null;}})[_0xa759('0x22')](respondWithResult(_0xae454a,null))[_0xa759('0x3f')](handleError(_0xae454a,null));};exports[_0xa759('0x4b')]=function(_0x38f8af,_0x2e21d0,_0x3446fd){var _0x42a0f3={};var _0x4d6299={};var _0x4e0f99;var _0x36a05b;return db['SugarcrmConfiguration'][_0xa759('0x49')]({'where':{'id':_0x38f8af[_0xa759('0x40')]['id']}})[_0xa759('0x22')](handleEntityNotFound(_0x2e21d0,null))[_0xa759('0x22')](function(_0x3bd7f2){if(_0x3bd7f2){_0x4e0f99=_0x3bd7f2;_0x4d6299[_0xa759('0x2f')]=_[_0xa759('0x31')](db[_0xa759('0x4a')]['rawAttributes']);_0x4d6299[_0xa759('0x30')]=_[_0xa759('0x31')](_0x38f8af[_0xa759('0x30')]);_0x4d6299[_0xa759('0x32')]=_[_0xa759('0x41')](_0x4d6299['model'],_0x4d6299['query']);_0x42a0f3[_0xa759('0x33')]=_[_0xa759('0x41')](_0x4d6299[_0xa759('0x2f')],qs[_0xa759('0x34')](_0x38f8af['query'][_0xa759('0x34')]));_0x42a0f3[_0xa759('0x33')]=_0x42a0f3[_0xa759('0x33')][_0xa759('0x35')]?_0x42a0f3[_0xa759('0x33')]:_0x4d6299[_0xa759('0x2f')];_0x42a0f3['order']=qs['sort'](_0x38f8af[_0xa759('0x30')][_0xa759('0x38')]);_0x42a0f3[_0xa759('0x39')]=qs['filters'](_[_0xa759('0x4c')](_0x38f8af[_0xa759('0x30')],_0x4d6299[_0xa759('0x32')]));if(_0x38f8af['query'][_0xa759('0x3a')]){_0x42a0f3[_0xa759('0x39')]=_[_0xa759('0x3c')](_0x42a0f3[_0xa759('0x39')],{'$or':_[_0xa759('0x29')](_0x42a0f3[_0xa759('0x33')],function(_0x1d4016){var _0x3656a7={};_0x3656a7[_0x1d4016]={'$like':'%'+_0x38f8af[_0xa759('0x30')][_0xa759('0x3a')]+'%'};return _0x3656a7;})});}_0x42a0f3=_[_0xa759('0x3c')]({},_0x42a0f3,_0x38f8af['options']);return _0x4e0f99[_0xa759('0x4b')](_0x42a0f3);}})[_0xa759('0x22')](function(_0x310834){if(_0x310834){_0x36a05b=_0x310834[_0xa759('0x35')];if(!_0x38f8af['query'][_0xa759('0x36')](_0xa759('0x37'))){_0x42a0f3[_0xa759('0x1e')]=qs[_0xa759('0x1e')](_0x38f8af['query'][_0xa759('0x1e')]);_0x42a0f3[_0xa759('0x1c')]=qs['offset'](_0x38f8af[_0xa759('0x30')][_0xa759('0x1c')]);}return _0x4e0f99[_0xa759('0x4b')](_0x42a0f3);}})['then'](function(_0x24099b){if(_0x24099b){return _0x24099b?{'count':_0x36a05b,'rows':_0x24099b}:null;}})['then'](respondWithResult(_0x2e21d0,null))['catch'](handleError(_0x2e21d0,null));};exports[_0xa759('0x4d')]=function(_0x50580c,_0x1c35a2,_0x8501ca){var _0x1b4d8e={};var _0x4700b5={};var _0xd03fe8;var _0x417938;return db[_0xa759('0x2a')][_0xa759('0x49')]({'where':{'id':_0x50580c['params']['id']}})['then'](handleEntityNotFound(_0x1c35a2,null))[_0xa759('0x22')](function(_0x49dc7e){if(_0x49dc7e){_0xd03fe8=_0x49dc7e;_0x4700b5[_0xa759('0x2f')]=_[_0xa759('0x31')](db[_0xa759('0x4a')][_0xa759('0x2b')]);_0x4700b5[_0xa759('0x30')]=_['keys'](_0x50580c[_0xa759('0x30')]);_0x4700b5[_0xa759('0x32')]=_[_0xa759('0x41')](_0x4700b5[_0xa759('0x2f')],_0x4700b5[_0xa759('0x30')]);_0x1b4d8e[_0xa759('0x33')]=_[_0xa759('0x41')](_0x4700b5[_0xa759('0x2f')],qs['fields'](_0x50580c[_0xa759('0x30')]['fields']));_0x1b4d8e['attributes']=_0x1b4d8e[_0xa759('0x33')][_0xa759('0x35')]?_0x1b4d8e['attributes']:_0x4700b5['model'];_0x1b4d8e['order']=qs[_0xa759('0x38')](_0x50580c[_0xa759('0x30')][_0xa759('0x38')]);_0x1b4d8e[_0xa759('0x39')]=qs[_0xa759('0x32')](_[_0xa759('0x4c')](_0x50580c['query'],_0x4700b5[_0xa759('0x32')]));if(_0x50580c[_0xa759('0x30')][_0xa759('0x3a')]){_0x1b4d8e['where']=_[_0xa759('0x3c')](_0x1b4d8e['where'],{'$or':_[_0xa759('0x29')](_0x1b4d8e['attributes'],function(_0x171ebf){var _0x575261={};_0x575261[_0x171ebf]={'$like':'%'+_0x50580c['query']['filter']+'%'};return _0x575261;})});}_0x1b4d8e=_[_0xa759('0x3c')]({},_0x1b4d8e,_0x50580c[_0xa759('0x43')]);return _0xd03fe8[_0xa759('0x4d')](_0x1b4d8e);}})[_0xa759('0x22')](function(_0x398f7e){if(_0x398f7e){_0x417938=_0x398f7e['length'];if(!_0x50580c['query'][_0xa759('0x36')](_0xa759('0x37'))){_0x1b4d8e[_0xa759('0x1e')]=qs[_0xa759('0x1e')](_0x50580c[_0xa759('0x30')][_0xa759('0x1e')]);_0x1b4d8e[_0xa759('0x1c')]=qs[_0xa759('0x1c')](_0x50580c[_0xa759('0x30')][_0xa759('0x1c')]);}return _0xd03fe8['getDescriptions'](_0x1b4d8e);}})[_0xa759('0x22')](function(_0x47b343){if(_0x47b343){return _0x47b343?{'count':_0x417938,'rows':_0x47b343}:null;}})[_0xa759('0x22')](respondWithResult(_0x1c35a2,null))[_0xa759('0x3f')](handleError(_0x1c35a2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 51b2b2b..bbb5d6f 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 _0xb82a=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x1b24eb,_0x39029e){var _0x157b17=function(_0x2ddb83){while(--_0x2ddb83){_0x1b24eb['push'](_0x1b24eb['shift']());}};_0x157b17(++_0x39029e);}(_0xb82a,0xbe));var _0xab82=function(_0x1dfab5,_0x41cc42){_0x1dfab5=_0x1dfab5-0x0;var _0x425a53=_0xb82a[_0x1dfab5];return _0x425a53;};'use strict';var _=require(_0xab82('0x0'));var util=require(_0xab82('0x1'));var logger=require(_0xab82('0x2'))(_0xab82('0x3'));var moment=require(_0xab82('0x4'));var BPromise=require('bluebird');var rp=require(_0xab82('0x5'));var fs=require('fs');var path=require(_0xab82('0x6'));var rimraf=require(_0xab82('0x7'));var config=require(_0xab82('0x8'));var attributes=require(_0xab82('0x9'));module[_0xab82('0xa')]=function(_0x3d88c6,_0x2d0080){return _0x3d88c6[_0xab82('0xb')](_0xab82('0xc'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24aa=['moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api'];(function(_0x1c51e7,_0x463478){var _0x2b8849=function(_0x216bfa){while(--_0x216bfa){_0x1c51e7['push'](_0x1c51e7['shift']());}};_0x2b8849(++_0x463478);}(_0x24aa,0x105));var _0xa24a=function(_0x20895e,_0x1f7d3c){_0x20895e=_0x20895e-0x0;var _0x1a7806=_0x24aa[_0x20895e];return _0x1a7806;};'use strict';var _=require(_0xa24a('0x0'));var util=require(_0xa24a('0x1'));var logger=require('../../config/logger')(_0xa24a('0x2'));var moment=require(_0xa24a('0x3'));var BPromise=require(_0xa24a('0x4'));var rp=require(_0xa24a('0x5'));var fs=require('fs');var path=require(_0xa24a('0x6'));var rimraf=require('rimraf');var config=require(_0xa24a('0x7'));var attributes=require(_0xa24a('0x8'));module['exports']=function(_0x434061,_0x397da3){return _0x434061['define'](_0xa24a('0x9'),attributes,{'tableName':_0xa24a('0xa'),'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 32be02f..42a6fc0 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 _0x4d1b=['../../config/environment','jayson/promise','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x4d1b,0x186));var _0xb4d1=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x4d1b[_0x56ba92];return _0x8fe94d;};'use strict';var _=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var moment=require(_0xb4d1('0x2'));var BPromise=require(_0xb4d1('0x3'));var rs=require(_0xb4d1('0x4'));var fs=require('fs');var Redis=require(_0xb4d1('0x5'));var db=require(_0xb4d1('0x6'))['db'];var utils=require(_0xb4d1('0x7'));var logger=require(_0xb4d1('0x8'))('rpc');var config=require(_0xb4d1('0x9'));var jayson=require(_0xb4d1('0xa'));var client=jayson[_0xb4d1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24fc78,_0x4ed9cf,_0x4c408b){return new BPromise(function(_0x15a974,_0x39caeb){return client[_0xb4d1('0xc')](_0x24fc78,_0x4c408b)['then'](function(_0xebd1c1){logger[_0xb4d1('0xd')](_0xb4d1('0xe'),_0x4ed9cf,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4ed9cf,_0xb4d1('0xf'),JSON['stringify'](_0xebd1c1));if(_0xebd1c1[_0xb4d1('0x10')]){if(_0xebd1c1[_0xb4d1('0x10')][_0xb4d1('0x11')]===0x1f4){logger[_0xb4d1('0x10')](_0xb4d1('0xe'),_0x4ed9cf,_0xebd1c1[_0xb4d1('0x10')][_0xb4d1('0x12')]);return _0x39caeb(_0xebd1c1[_0xb4d1('0x10')][_0xb4d1('0x12')]);}logger[_0xb4d1('0x10')](_0xb4d1('0xe'),_0x4ed9cf,_0xebd1c1['error'][_0xb4d1('0x12')]);return _0x15a974(_0xebd1c1[_0xb4d1('0x10')]['message']);}else{logger[_0xb4d1('0xd')](_0xb4d1('0xe'),_0x4ed9cf,_0xb4d1('0xf'));_0x15a974(_0xebd1c1[_0xb4d1('0x13')][_0xb4d1('0x12')]);}})[_0xb4d1('0x14')](function(_0x27bef5){logger[_0xb4d1('0x10')](_0xb4d1('0xe'),_0x4ed9cf,_0x27bef5);_0x39caeb(_0x27bef5);});});} \ No newline at end of file +var _0xdb9d=['request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x171831,_0x5cbeaf){var _0x23a2a5=function(_0x1b59f9){while(--_0x1b59f9){_0x171831['push'](_0x171831['shift']());}};_0x23a2a5(++_0x5cbeaf);}(_0xdb9d,0x144));var _0xddb9=function(_0x5f0f7a,_0x244c53){_0x5f0f7a=_0x5f0f7a-0x0;var _0x8742e7=_0xdb9d[_0x5f0f7a];return _0x8742e7;};'use strict';var _=require(_0xddb9('0x0'));var util=require(_0xddb9('0x1'));var moment=require(_0xddb9('0x2'));var BPromise=require(_0xddb9('0x3'));var rs=require(_0xddb9('0x4'));var fs=require('fs');var Redis=require(_0xddb9('0x5'));var db=require(_0xddb9('0x6'))['db'];var utils=require(_0xddb9('0x7'));var logger=require(_0xddb9('0x8'))(_0xddb9('0x9'));var config=require(_0xddb9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xddb9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x610e77,_0x3169ab,_0x5352c6){return new BPromise(function(_0x4c02d8,_0x491a2a){return client[_0xddb9('0xc')](_0x610e77,_0x5352c6)[_0xddb9('0xd')](function(_0x23e6ed){logger[_0xddb9('0xe')](_0xddb9('0xf'),_0x3169ab,_0xddb9('0x10'));logger[_0xddb9('0x11')](_0xddb9('0x12'),_0x3169ab,_0xddb9('0x10'),JSON[_0xddb9('0x13')](_0x23e6ed));if(_0x23e6ed['error']){if(_0x23e6ed['error'][_0xddb9('0x14')]===0x1f4){logger[_0xddb9('0x15')](_0xddb9('0xf'),_0x3169ab,_0x23e6ed[_0xddb9('0x15')][_0xddb9('0x16')]);return _0x491a2a(_0x23e6ed['error'][_0xddb9('0x16')]);}logger['error'](_0xddb9('0xf'),_0x3169ab,_0x23e6ed[_0xddb9('0x15')][_0xddb9('0x16')]);return _0x4c02d8(_0x23e6ed[_0xddb9('0x15')]['message']);}else{logger[_0xddb9('0xe')](_0xddb9('0xf'),_0x3169ab,'request\x20sent');_0x4c02d8(_0x23e6ed[_0xddb9('0x17')][_0xddb9('0x16')]);}})['catch'](function(_0xa58991){logger[_0xddb9('0x15')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3169ab,_0xa58991);_0x491a2a(_0xa58991);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 331a8c1..f63cc03 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 _0xa164=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util','path','express'];(function(_0x41cd72,_0x21ec2d){var _0x135784=function(_0x2ab205){while(--_0x2ab205){_0x41cd72['push'](_0x41cd72['shift']());}};_0x135784(++_0x21ec2d);}(_0xa164,0x106));var _0x4a16=function(_0x1af1e8,_0x3527e9){_0x1af1e8=_0x1af1e8-0x0;var _0x4659ae=_0xa164[_0x1af1e8];return _0x4659ae;};'use strict';var multer=require(_0x4a16('0x0'));var util=require(_0x4a16('0x1'));var path=require(_0x4a16('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a16('0x3'));var router=express[_0x4a16('0x4')]();var fs_extra=require(_0x4a16('0x5'));var auth=require(_0x4a16('0x6'));var interaction=require(_0x4a16('0x7'));var config=require(_0x4a16('0x8'));var controller=require(_0x4a16('0x9'));router[_0x4a16('0xa')]('/',auth[_0x4a16('0xb')](),controller['index']);router[_0x4a16('0xa')](_0x4a16('0xc'),auth[_0x4a16('0xb')](),controller[_0x4a16('0xd')]);router[_0x4a16('0xe')]('/',auth[_0x4a16('0xb')](),controller[_0x4a16('0xf')]);router['put'](_0x4a16('0xc'),auth[_0x4a16('0xb')](),controller[_0x4a16('0x10')]);router['delete']('/:id',auth[_0x4a16('0xb')](),controller[_0x4a16('0x11')]);module[_0x4a16('0x12')]=router; \ No newline at end of file +var _0xe1a6=['../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xdb017c,_0x5416a2){var _0x4778da=function(_0x38d35f){while(--_0x38d35f){_0xdb017c['push'](_0xdb017c['shift']());}};_0x4778da(++_0x5416a2);}(_0xe1a6,0x76));var _0x6e1a=function(_0x2a1ca1,_0x5f9bb){_0x2a1ca1=_0x2a1ca1-0x0;var _0x54fda7=_0xe1a6[_0x2a1ca1];return _0x54fda7;};'use strict';var multer=require(_0x6e1a('0x0'));var util=require(_0x6e1a('0x1'));var path=require(_0x6e1a('0x2'));var timeout=require(_0x6e1a('0x3'));var express=require(_0x6e1a('0x4'));var router=express[_0x6e1a('0x5')]();var fs_extra=require(_0x6e1a('0x6'));var auth=require(_0x6e1a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6e1a('0x8'));var controller=require(_0x6e1a('0x9'));router[_0x6e1a('0xa')]('/',auth[_0x6e1a('0xb')](),controller[_0x6e1a('0xc')]);router['get'](_0x6e1a('0xd'),auth['isAuthenticated'](),controller[_0x6e1a('0xe')]);router[_0x6e1a('0xf')]('/',auth[_0x6e1a('0xb')](),controller[_0x6e1a('0x10')]);router[_0x6e1a('0x11')](_0x6e1a('0xd'),auth[_0x6e1a('0xb')](),controller[_0x6e1a('0x12')]);router[_0x6e1a('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6e1a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index a099fea..679e875 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 _0x53ab=['customVariable','picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x53ab,0x75));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb53a('0x0'));module['exports']={'type':{'type':Sequelize[_0xb53a('0x1')]('string',_0xb53a('0x2'),_0xb53a('0x3'),'keyValue',_0xb53a('0x4')),'defaultValue':_0xb53a('0x5')},'content':{'type':Sequelize[_0xb53a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb53a('0x1')](_0xb53a('0x5'),_0xb53a('0x2'),_0xb53a('0x3'))},'keyContent':{'type':Sequelize[_0xb53a('0x6')]},'idField':{'type':Sequelize[_0xb53a('0x6')]},'nameField':{'type':Sequelize[_0xb53a('0x6')]},'customField':{'type':Sequelize[_0xb53a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb53a('0x6')]}}; \ No newline at end of file +var _0x2249=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0x2249,0x10a));var _0x9224=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x2249[_0x3299d1];return _0x44356e;};'use strict';var Sequelize=require(_0x9224('0x0'));module[_0x9224('0x1')]={'type':{'type':Sequelize[_0x9224('0x2')]('string',_0x9224('0x3'),_0x9224('0x4'),_0x9224('0x5'),_0x9224('0x6')),'defaultValue':_0x9224('0x7')},'content':{'type':Sequelize[_0x9224('0x8')]},'key':{'type':Sequelize[_0x9224('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x9224('0x7'),_0x9224('0x3'),_0x9224('0x4'))},'keyContent':{'type':Sequelize[_0x9224('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9224('0x8')]},'customField':{'type':Sequelize[_0x9224('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9224('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 9f055e5..0ad268b 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 _0xd9ca=['end','undefined','count','offset','limit','set','json','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','sort','where','filter','merge','VIRTUAL','options','includeAll','include','SugarcrmField','findAll','rows','catch','show','params','length','create','body','find','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status'];(function(_0x2a7aeb,_0x1c6f4e){var _0x3dd4d6=function(_0x238e36){while(--_0x238e36){_0x2a7aeb['push'](_0x2a7aeb['shift']());}};_0x3dd4d6(++_0x1c6f4e);}(_0xd9ca,0xaf));var _0xad9c=function(_0x53f800,_0x562d45){_0x53f800=_0x53f800-0x0;var _0x3cbaa5=_0xd9ca[_0x53f800];return _0x3cbaa5;};'use strict';var emlformat=require(_0xad9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad9c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad9c('0x2'));var moment=require('moment');var BPromise=require(_0xad9c('0x3'));var Mustache=require(_0xad9c('0x4'));var util=require('util');var path=require(_0xad9c('0x5'));var sox=require(_0xad9c('0x6'));var csv=require(_0xad9c('0x7'));var ejs=require(_0xad9c('0x8'));var fs=require('fs');var fs_extra=require(_0xad9c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xad9c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xad9c('0xb'));var toCsv=require(_0xad9c('0x7'));var querystring=require(_0xad9c('0xc'));var Papa=require(_0xad9c('0xd'));var Redis=require(_0xad9c('0xe'));var authService=require(_0xad9c('0xf'));var qs=require(_0xad9c('0x10'));var as=require(_0xad9c('0x11'));var hardwareService=require(_0xad9c('0x12'));var logger=require('../../config/logger')(_0xad9c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xad9c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f9f09,_0xf1b201){_0xf1b201=_0xf1b201||0xcc;return function(_0x3ea273){if(_0x3ea273){return _0x4f9f09[_0xad9c('0x15')](_0xf1b201);}return _0x4f9f09[_0xad9c('0x16')](_0xf1b201)[_0xad9c('0x17')]();};}function respondWithResult(_0x34673a,_0x2d60ce){_0x2d60ce=_0x2d60ce||0xc8;return function(_0x44a89a){if(_0x44a89a){return _0x34673a[_0xad9c('0x16')](_0x2d60ce)['json'](_0x44a89a);}};}function respondWithFilteredResult(_0x448671,_0x281668){return function(_0x3c0fda){if(_0x3c0fda){var _0x2c7e00=typeof _0x281668['offset']===_0xad9c('0x18')&&typeof _0x281668['limit']==='undefined';var _0x1171c6=_0x3c0fda[_0xad9c('0x19')];var _0x22faaf=_0x2c7e00?0x0:_0x281668[_0xad9c('0x1a')];var _0x58acb9=_0x2c7e00?_0x3c0fda[_0xad9c('0x19')]:_0x281668[_0xad9c('0x1a')]+_0x281668[_0xad9c('0x1b')];var _0x27080d;if(_0x58acb9>=_0x1171c6){_0x58acb9=_0x1171c6;_0x27080d=0xc8;}else{_0x27080d=0xce;}_0x448671[_0xad9c('0x16')](_0x27080d);return _0x448671[_0xad9c('0x1c')]('Content-Range',_0x22faaf+'-'+_0x58acb9+'/'+_0x1171c6)[_0xad9c('0x1d')](_0x3c0fda);}return null;};}function patchUpdates(_0x2c1fb5){return function(_0x964bf2){try{jsonpatch['apply'](_0x964bf2,_0x2c1fb5,!![]);}catch(_0x334616){return BPromise['reject'](_0x334616);}return _0x964bf2[_0xad9c('0x1e')]();};}function saveUpdates(_0x2cd0b8,_0xda17be){return function(_0x50b33c){if(_0x50b33c){return _0x50b33c[_0xad9c('0x1f')](_0x2cd0b8)[_0xad9c('0x20')](function(_0x4d1fa5){return _0x4d1fa5;});}return null;};}function removeEntity(_0x1cd284,_0x5a9453){return function(_0x4458c4){if(_0x4458c4){return _0x4458c4[_0xad9c('0x21')]()[_0xad9c('0x20')](function(){_0x1cd284[_0xad9c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2866dd,_0x1680ba){return function(_0x314212){if(!_0x314212){_0x2866dd[_0xad9c('0x15')](0x194);}return _0x314212;};}function handleError(_0x113b7b,_0x415f41){_0x415f41=_0x415f41||0x1f4;return function(_0x2ed2e0){logger[_0xad9c('0x22')](_0x2ed2e0[_0xad9c('0x23')]);if(_0x2ed2e0['name']){delete _0x2ed2e0[_0xad9c('0x24')];}_0x113b7b[_0xad9c('0x16')](_0x415f41)['send'](_0x2ed2e0);};}exports[_0xad9c('0x25')]=function(_0x4d2f02,_0x1ca399){var _0x27c9d3={},_0x450548={},_0x232ef8={'count':0x0,'rows':[]};var _0x426fdd=_[_0xad9c('0x26')](db['SugarcrmField'][_0xad9c('0x27')],function(_0xda3559){return{'name':_0xda3559[_0xad9c('0x28')],'type':_0xda3559[_0xad9c('0x29')]['key']};});_0x450548[_0xad9c('0x2a')]=_[_0xad9c('0x26')](_0x426fdd,_0xad9c('0x24'));_0x450548[_0xad9c('0x2b')]=_['keys'](_0x4d2f02[_0xad9c('0x2b')]);_0x450548[_0xad9c('0x2c')]=_[_0xad9c('0x2d')](_0x450548['model'],_0x450548[_0xad9c('0x2b')]);_0x27c9d3[_0xad9c('0x2e')]=_[_0xad9c('0x2d')](_0x450548[_0xad9c('0x2a')],qs[_0xad9c('0x2f')](_0x4d2f02['query']['fields']));_0x27c9d3['attributes']=_0x27c9d3[_0xad9c('0x2e')]['length']?_0x27c9d3['attributes']:_0x450548['model'];if(!_0x4d2f02['query']['hasOwnProperty']('nolimit')){_0x27c9d3['limit']=qs[_0xad9c('0x1b')](_0x4d2f02[_0xad9c('0x2b')]['limit']);_0x27c9d3['offset']=qs['offset'](_0x4d2f02['query']['offset']);}_0x27c9d3['order']=qs[_0xad9c('0x30')](_0x4d2f02[_0xad9c('0x2b')][_0xad9c('0x30')]);_0x27c9d3[_0xad9c('0x31')]=qs[_0xad9c('0x2c')](_['pick'](_0x4d2f02[_0xad9c('0x2b')],_0x450548['filters']),_0x426fdd);if(_0x4d2f02[_0xad9c('0x2b')][_0xad9c('0x32')]){_0x27c9d3[_0xad9c('0x31')]=_[_0xad9c('0x33')](_0x27c9d3['where'],{'$or':_[_0xad9c('0x26')](_0x426fdd,function(_0x13dd36){if(_0x13dd36['type']!==_0xad9c('0x34')){var _0x353ebd={};_0x353ebd[_0x13dd36['name']]={'$like':'%'+_0x4d2f02[_0xad9c('0x2b')][_0xad9c('0x32')]+'%'};return _0x353ebd;}})});}_0x27c9d3=_[_0xad9c('0x33')]({},_0x27c9d3,_0x4d2f02[_0xad9c('0x35')]);var _0x3ae0d1={'where':_0x27c9d3['where']};return db['SugarcrmField']['count'](_0x3ae0d1)[_0xad9c('0x20')](function(_0x165757){_0x232ef8[_0xad9c('0x19')]=_0x165757;if(_0x4d2f02['query'][_0xad9c('0x36')]){_0x27c9d3[_0xad9c('0x37')]=[{'all':!![]}];}return db[_0xad9c('0x38')][_0xad9c('0x39')](_0x27c9d3);})[_0xad9c('0x20')](function(_0x4edfb2){_0x232ef8[_0xad9c('0x3a')]=_0x4edfb2;return _0x232ef8;})[_0xad9c('0x20')](respondWithFilteredResult(_0x1ca399,_0x27c9d3))[_0xad9c('0x3b')](handleError(_0x1ca399,null));};exports[_0xad9c('0x3c')]=function(_0x4a3e73,_0x2d7efc){var _0x3d2c04={'raw':!![],'where':{'id':_0x4a3e73[_0xad9c('0x3d')]['id']}},_0x3dab58={};_0x3dab58[_0xad9c('0x2a')]=_['keys'](db[_0xad9c('0x38')]['rawAttributes']);_0x3dab58[_0xad9c('0x2b')]=_['keys'](_0x4a3e73[_0xad9c('0x2b')]);_0x3dab58['filters']=_[_0xad9c('0x2d')](_0x3dab58[_0xad9c('0x2a')],_0x3dab58['query']);_0x3d2c04[_0xad9c('0x2e')]=_[_0xad9c('0x2d')](_0x3dab58[_0xad9c('0x2a')],qs[_0xad9c('0x2f')](_0x4a3e73[_0xad9c('0x2b')]['fields']));_0x3d2c04[_0xad9c('0x2e')]=_0x3d2c04[_0xad9c('0x2e')][_0xad9c('0x3e')]?_0x3d2c04[_0xad9c('0x2e')]:_0x3dab58[_0xad9c('0x2a')];if(_0x4a3e73[_0xad9c('0x2b')]['includeAll']){_0x3d2c04[_0xad9c('0x37')]=[{'all':!![]}];}_0x3d2c04=_[_0xad9c('0x33')]({},_0x3d2c04,_0x4a3e73[_0xad9c('0x35')]);return db['SugarcrmField']['find'](_0x3d2c04)['then'](handleEntityNotFound(_0x2d7efc,null))[_0xad9c('0x20')](respondWithResult(_0x2d7efc,null))[_0xad9c('0x3b')](handleError(_0x2d7efc,null));};exports['create']=function(_0x5e012a,_0x10c59a){return db['SugarcrmField'][_0xad9c('0x3f')](_0x5e012a[_0xad9c('0x40')],{})[_0xad9c('0x20')](respondWithResult(_0x10c59a,0xc9))[_0xad9c('0x3b')](handleError(_0x10c59a,null));};exports['update']=function(_0xba6ea0,_0x3e612f){if(_0xba6ea0[_0xad9c('0x40')]['id']){delete _0xba6ea0[_0xad9c('0x40')]['id'];}return db[_0xad9c('0x38')]['find']({'where':{'id':_0xba6ea0[_0xad9c('0x3d')]['id']}})[_0xad9c('0x20')](handleEntityNotFound(_0x3e612f,null))[_0xad9c('0x20')](saveUpdates(_0xba6ea0[_0xad9c('0x40')],null))['then'](respondWithResult(_0x3e612f,null))[_0xad9c('0x3b')](handleError(_0x3e612f,null));};exports[_0xad9c('0x21')]=function(_0x57e218,_0x3a5bee){return db[_0xad9c('0x38')][_0xad9c('0x41')]({'where':{'id':_0x57e218[_0xad9c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3a5bee,null))['then'](removeEntity(_0x3a5bee,null))[_0xad9c('0x3b')](handleError(_0x3a5bee,null));}; \ No newline at end of file +var _0x98c8=['eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','update','then','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','include','findAll','rows','catch','params','includeAll','options','create','body','find','destroy'];(function(_0x289874,_0x1b6752){var _0x2f8bbb=function(_0x23ee80){while(--_0x23ee80){_0x289874['push'](_0x289874['shift']());}};_0x2f8bbb(++_0x1b6752);}(_0x98c8,0x1a4));var _0x898c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x98c8[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x898c('0x0'));var rimraf=require(_0x898c('0x1'));var zipdir=require(_0x898c('0x2'));var jsonpatch=require(_0x898c('0x3'));var rp=require('request-promise');var moment=require(_0x898c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x898c('0x5'));var sox=require(_0x898c('0x6'));var csv=require('to-csv');var ejs=require(_0x898c('0x7'));var fs=require('fs');var fs_extra=require(_0x898c('0x8'));var _=require(_0x898c('0x9'));var squel=require(_0x898c('0xa'));var crypto=require(_0x898c('0xb'));var jsforce=require(_0x898c('0xc'));var deskjs=require(_0x898c('0xd'));var toCsv=require(_0x898c('0xe'));var querystring=require(_0x898c('0xf'));var Papa=require(_0x898c('0x10'));var Redis=require(_0x898c('0x11'));var authService=require(_0x898c('0x12'));var qs=require(_0x898c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x898c('0x14'));var logger=require(_0x898c('0x15'))('api');var utils=require(_0x898c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x898c('0x17'));var db=require(_0x898c('0x18'))['db'];function respondWithStatusCode(_0x5d76a5,_0x555261){_0x555261=_0x555261||0xcc;return function(_0x4aaa11){if(_0x4aaa11){return _0x5d76a5[_0x898c('0x19')](_0x555261);}return _0x5d76a5[_0x898c('0x1a')](_0x555261)['end']();};}function respondWithResult(_0x4b5bdb,_0x1ecd9f){_0x1ecd9f=_0x1ecd9f||0xc8;return function(_0x3c11b1){if(_0x3c11b1){return _0x4b5bdb[_0x898c('0x1a')](_0x1ecd9f)[_0x898c('0x1b')](_0x3c11b1);}};}function respondWithFilteredResult(_0x125917,_0x5e75e4){return function(_0x5cb4fd){if(_0x5cb4fd){var _0x10990e=typeof _0x5e75e4[_0x898c('0x1c')]==='undefined'&&typeof _0x5e75e4[_0x898c('0x1d')]==='undefined';var _0x5e307b=_0x5cb4fd['count'];var _0x47797b=_0x10990e?0x0:_0x5e75e4['offset'];var _0x23544f=_0x10990e?_0x5cb4fd[_0x898c('0x1e')]:_0x5e75e4['offset']+_0x5e75e4['limit'];var _0x3f1ca2;if(_0x23544f>=_0x5e307b){_0x23544f=_0x5e307b;_0x3f1ca2=0xc8;}else{_0x3f1ca2=0xce;}_0x125917['status'](_0x3f1ca2);return _0x125917[_0x898c('0x1f')](_0x898c('0x20'),_0x47797b+'-'+_0x23544f+'/'+_0x5e307b)[_0x898c('0x1b')](_0x5cb4fd);}return null;};}function patchUpdates(_0x1f3da7){return function(_0x2177b9){try{jsonpatch['apply'](_0x2177b9,_0x1f3da7,!![]);}catch(_0x4c68b2){return BPromise[_0x898c('0x21')](_0x4c68b2);}return _0x2177b9['save']();};}function saveUpdates(_0x1fbeb,_0x4aa639){return function(_0x558e11){if(_0x558e11){return _0x558e11[_0x898c('0x22')](_0x1fbeb)[_0x898c('0x23')](function(_0x39d4d0){return _0x39d4d0;});}return null;};}function removeEntity(_0x2a87d2,_0x4fbab3){return function(_0x1af4e1){if(_0x1af4e1){return _0x1af4e1['destroy']()['then'](function(){_0x2a87d2[_0x898c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22487c,_0x542f37){return function(_0x1ce7ca){if(!_0x1ce7ca){_0x22487c[_0x898c('0x19')](0x194);}return _0x1ce7ca;};}function handleError(_0x2b753b,_0x2822bd){_0x2822bd=_0x2822bd||0x1f4;return function(_0x59afdd){logger['error'](_0x59afdd[_0x898c('0x24')]);if(_0x59afdd[_0x898c('0x25')]){delete _0x59afdd['name'];}_0x2b753b[_0x898c('0x1a')](_0x2822bd)['send'](_0x59afdd);};}exports[_0x898c('0x26')]=function(_0x5b8740,_0x8080e){var _0x17624d={},_0xcd216e={},_0xff9605={'count':0x0,'rows':[]};var _0x3fbb72=_[_0x898c('0x27')](db[_0x898c('0x28')][_0x898c('0x29')],function(_0x5c080f){return{'name':_0x5c080f[_0x898c('0x2a')],'type':_0x5c080f[_0x898c('0x2b')]['key']};});_0xcd216e[_0x898c('0x2c')]=_[_0x898c('0x27')](_0x3fbb72,_0x898c('0x25'));_0xcd216e[_0x898c('0x2d')]=_[_0x898c('0x2e')](_0x5b8740[_0x898c('0x2d')]);_0xcd216e[_0x898c('0x2f')]=_[_0x898c('0x30')](_0xcd216e['model'],_0xcd216e[_0x898c('0x2d')]);_0x17624d[_0x898c('0x31')]=_[_0x898c('0x30')](_0xcd216e[_0x898c('0x2c')],qs[_0x898c('0x32')](_0x5b8740[_0x898c('0x2d')][_0x898c('0x32')]));_0x17624d['attributes']=_0x17624d[_0x898c('0x31')][_0x898c('0x33')]?_0x17624d['attributes']:_0xcd216e['model'];if(!_0x5b8740[_0x898c('0x2d')][_0x898c('0x34')](_0x898c('0x35'))){_0x17624d[_0x898c('0x1d')]=qs[_0x898c('0x1d')](_0x5b8740[_0x898c('0x2d')]['limit']);_0x17624d[_0x898c('0x1c')]=qs[_0x898c('0x1c')](_0x5b8740[_0x898c('0x2d')][_0x898c('0x1c')]);}_0x17624d['order']=qs['sort'](_0x5b8740[_0x898c('0x2d')][_0x898c('0x36')]);_0x17624d['where']=qs['filters'](_[_0x898c('0x37')](_0x5b8740[_0x898c('0x2d')],_0xcd216e['filters']),_0x3fbb72);if(_0x5b8740[_0x898c('0x2d')]['filter']){_0x17624d[_0x898c('0x38')]=_[_0x898c('0x39')](_0x17624d[_0x898c('0x38')],{'$or':_[_0x898c('0x27')](_0x3fbb72,function(_0x55e3fc){if(_0x55e3fc[_0x898c('0x2b')]!=='VIRTUAL'){var _0x329eaf={};_0x329eaf[_0x55e3fc['name']]={'$like':'%'+_0x5b8740[_0x898c('0x2d')][_0x898c('0x3a')]+'%'};return _0x329eaf;}})});}_0x17624d=_[_0x898c('0x39')]({},_0x17624d,_0x5b8740['options']);var _0x4ad3bc={'where':_0x17624d[_0x898c('0x38')]};return db['SugarcrmField'][_0x898c('0x1e')](_0x4ad3bc)[_0x898c('0x23')](function(_0x444b88){_0xff9605[_0x898c('0x1e')]=_0x444b88;if(_0x5b8740[_0x898c('0x2d')]['includeAll']){_0x17624d[_0x898c('0x3b')]=[{'all':!![]}];}return db[_0x898c('0x28')][_0x898c('0x3c')](_0x17624d);})[_0x898c('0x23')](function(_0x48d18){_0xff9605[_0x898c('0x3d')]=_0x48d18;return _0xff9605;})[_0x898c('0x23')](respondWithFilteredResult(_0x8080e,_0x17624d))[_0x898c('0x3e')](handleError(_0x8080e,null));};exports['show']=function(_0xf8d729,_0x394979){var _0x51feae={'raw':!![],'where':{'id':_0xf8d729[_0x898c('0x3f')]['id']}},_0x348bed={};_0x348bed[_0x898c('0x2c')]=_[_0x898c('0x2e')](db[_0x898c('0x28')][_0x898c('0x29')]);_0x348bed['query']=_[_0x898c('0x2e')](_0xf8d729['query']);_0x348bed[_0x898c('0x2f')]=_[_0x898c('0x30')](_0x348bed['model'],_0x348bed[_0x898c('0x2d')]);_0x51feae[_0x898c('0x31')]=_[_0x898c('0x30')](_0x348bed[_0x898c('0x2c')],qs['fields'](_0xf8d729[_0x898c('0x2d')][_0x898c('0x32')]));_0x51feae['attributes']=_0x51feae[_0x898c('0x31')]['length']?_0x51feae[_0x898c('0x31')]:_0x348bed[_0x898c('0x2c')];if(_0xf8d729[_0x898c('0x2d')][_0x898c('0x40')]){_0x51feae[_0x898c('0x3b')]=[{'all':!![]}];}_0x51feae=_['merge']({},_0x51feae,_0xf8d729[_0x898c('0x41')]);return db[_0x898c('0x28')]['find'](_0x51feae)[_0x898c('0x23')](handleEntityNotFound(_0x394979,null))[_0x898c('0x23')](respondWithResult(_0x394979,null))[_0x898c('0x3e')](handleError(_0x394979,null));};exports[_0x898c('0x42')]=function(_0x41e225,_0x5173da){return db['SugarcrmField'][_0x898c('0x42')](_0x41e225[_0x898c('0x43')],{})['then'](respondWithResult(_0x5173da,0xc9))[_0x898c('0x3e')](handleError(_0x5173da,null));};exports[_0x898c('0x22')]=function(_0x4cc36d,_0x58e10e){if(_0x4cc36d[_0x898c('0x43')]['id']){delete _0x4cc36d[_0x898c('0x43')]['id'];}return db[_0x898c('0x28')][_0x898c('0x44')]({'where':{'id':_0x4cc36d[_0x898c('0x3f')]['id']}})[_0x898c('0x23')](handleEntityNotFound(_0x58e10e,null))[_0x898c('0x23')](saveUpdates(_0x4cc36d['body'],null))['then'](respondWithResult(_0x58e10e,null))['catch'](handleError(_0x58e10e,null));};exports[_0x898c('0x45')]=function(_0x39319e,_0x3a3ba2){return db['SugarcrmField']['find']({'where':{'id':_0x39319e[_0x898c('0x3f')]['id']}})[_0x898c('0x23')](handleEntityNotFound(_0x3a3ba2,null))[_0x898c('0x23')](removeEntity(_0x3a3ba2,null))[_0x898c('0x3e')](handleError(_0x3a3ba2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index cfe4d83..07de33e 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 _0xd6f9=['int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField'];(function(_0xd05f88,_0x32d7ff){var _0x350b5d=function(_0x220566){while(--_0x220566){_0xd05f88['push'](_0xd05f88['shift']());}};_0x350b5d(++_0x32d7ff);}(_0xd6f9,0x198));var _0x9d6f=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xd6f9[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0x9d6f('0x0'));var util=require(_0x9d6f('0x1'));var logger=require(_0x9d6f('0x2'))(_0x9d6f('0x3'));var moment=require(_0x9d6f('0x4'));var BPromise=require(_0x9d6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d6f('0x6'));var rimraf=require(_0x9d6f('0x7'));var config=require(_0x9d6f('0x8'));var attributes=require(_0x9d6f('0x9'));module[_0x9d6f('0xa')]=function(_0x4d737b,_0x58e447){return _0x4d737b['define'](_0x9d6f('0xb'),attributes,{'tableName':_0x9d6f('0xc'),'paranoid':![],'indexes':[{'name':_0x9d6f('0xd'),'fields':[_0x9d6f('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c92=['api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util'];(function(_0x1692fb,_0x192cf0){var _0x2381e2=function(_0x14d295){while(--_0x14d295){_0x1692fb['push'](_0x1692fb['shift']());}};_0x2381e2(++_0x192cf0);}(_0x6c92,0x184));var _0x26c9=function(_0x590f79,_0x3e71ef){_0x590f79=_0x590f79-0x0;var _0x165372=_0x6c92[_0x590f79];return _0x165372;};'use strict';var _=require(_0x26c9('0x0'));var util=require(_0x26c9('0x1'));var logger=require('../../config/logger')(_0x26c9('0x2'));var moment=require(_0x26c9('0x3'));var BPromise=require('bluebird');var rp=require(_0x26c9('0x4'));var fs=require('fs');var path=require(_0x26c9('0x5'));var rimraf=require(_0x26c9('0x6'));var config=require(_0x26c9('0x7'));var attributes=require(_0x26c9('0x8'));module[_0x26c9('0x9')]=function(_0x70094,_0x23dafb){return _0x70094['define'](_0x26c9('0xa'),attributes,{'tableName':_0x26c9('0xb'),'paranoid':![],'indexes':[{'name':_0x26c9('0xc'),'fields':[_0x26c9('0xd'),_0x26c9('0xe')],'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 7662c7b..adf8bc7 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 _0xb404=['stringify','error','code','message','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x4de579,_0x254d42){var _0x455490=function(_0x3a7df8){while(--_0x3a7df8){_0x4de579['push'](_0x4de579['shift']());}};_0x455490(++_0x254d42);}(_0xb404,0x155));var _0x4b40=function(_0x14c879,_0x12d49e){_0x14c879=_0x14c879-0x0;var _0x10ad52=_0xb404[_0x14c879];return _0x10ad52;};'use strict';var _=require('lodash');var util=require(_0x4b40('0x0'));var moment=require(_0x4b40('0x1'));var BPromise=require(_0x4b40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4b40('0x3'));var logger=require(_0x4b40('0x4'))(_0x4b40('0x5'));var config=require(_0x4b40('0x6'));var jayson=require(_0x4b40('0x7'));var client=jayson[_0x4b40('0x8')][_0x4b40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3390d9,_0x4faf62,_0x4f857d){return new BPromise(function(_0x19d6f6,_0x6998a6){return client['request'](_0x3390d9,_0x4f857d)[_0x4b40('0xa')](function(_0x477881){logger[_0x4b40('0xb')](_0x4b40('0xc'),_0x4faf62,_0x4b40('0xd'));logger[_0x4b40('0xe')](_0x4b40('0xf'),_0x4faf62,_0x4b40('0xd'),JSON[_0x4b40('0x10')](_0x477881));if(_0x477881['error']){if(_0x477881[_0x4b40('0x11')][_0x4b40('0x12')]===0x1f4){logger[_0x4b40('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x4faf62,_0x477881[_0x4b40('0x11')]['message']);return _0x6998a6(_0x477881[_0x4b40('0x11')][_0x4b40('0x13')]);}logger['error'](_0x4b40('0xc'),_0x4faf62,_0x477881[_0x4b40('0x11')][_0x4b40('0x13')]);return _0x19d6f6(_0x477881[_0x4b40('0x11')][_0x4b40('0x13')]);}else{logger[_0x4b40('0xb')](_0x4b40('0xc'),_0x4faf62,_0x4b40('0xd'));_0x19d6f6(_0x477881['result'][_0x4b40('0x13')]);}})[_0x4b40('0x14')](function(_0x1c1586){logger[_0x4b40('0x11')](_0x4b40('0xc'),_0x4faf62,_0x1c1586);_0x6998a6(_0x1c1586);});});} \ No newline at end of file +var _0xc299=['then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1bfe28,_0x4869d5){var _0x107679=function(_0x1e65a9){while(--_0x1e65a9){_0x1bfe28['push'](_0x1bfe28['shift']());}};_0x107679(++_0x4869d5);}(_0xc299,0x12e));var _0x9c29=function(_0x232eb7,_0x199b07){_0x232eb7=_0x232eb7-0x0;var _0xd7fb8=_0xc299[_0x232eb7];return _0xd7fb8;};'use strict';var _=require(_0x9c29('0x0'));var util=require(_0x9c29('0x1'));var moment=require('moment');var BPromise=require(_0x9c29('0x2'));var rs=require(_0x9c29('0x3'));var fs=require('fs');var Redis=require(_0x9c29('0x4'));var db=require(_0x9c29('0x5'))['db'];var utils=require(_0x9c29('0x6'));var logger=require(_0x9c29('0x7'))(_0x9c29('0x8'));var config=require(_0x9c29('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9c29('0xa')][_0x9c29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f3b8f,_0x6aa083,_0x464e7c){return new BPromise(function(_0x3cf3bd,_0x3127f){return client[_0x9c29('0xc')](_0x3f3b8f,_0x464e7c)[_0x9c29('0xd')](function(_0x2c9db4){logger[_0x9c29('0xe')](_0x9c29('0xf'),_0x6aa083,_0x9c29('0x10'));logger[_0x9c29('0x11')](_0x9c29('0x12'),_0x6aa083,'request\x20sent',JSON['stringify'](_0x2c9db4));if(_0x2c9db4[_0x9c29('0x13')]){if(_0x2c9db4[_0x9c29('0x13')]['code']===0x1f4){logger[_0x9c29('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x6aa083,_0x2c9db4['error'][_0x9c29('0x14')]);return _0x3127f(_0x2c9db4[_0x9c29('0x13')]['message']);}logger[_0x9c29('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x6aa083,_0x2c9db4[_0x9c29('0x13')]['message']);return _0x3cf3bd(_0x2c9db4[_0x9c29('0x13')][_0x9c29('0x14')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x6aa083,_0x9c29('0x10'));_0x3cf3bd(_0x2c9db4['result'][_0x9c29('0x14')]);}})['catch'](function(_0x57684f){logger['error'](_0x9c29('0xf'),_0x6aa083,_0x57684f);_0x3127f(_0x57684f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 8066ae0..22506be 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 _0xa952=['post','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields'];(function(_0x4c6ad2,_0x51092b){var _0x215c13=function(_0xf76c84){while(--_0xf76c84){_0x4c6ad2['push'](_0x4c6ad2['shift']());}};_0x215c13(++_0x51092b);}(_0xa952,0x98));var _0x2a95=function(_0x2a87fe,_0x52c61c){_0x2a87fe=_0x2a87fe-0x0;var _0x539085=_0xa952[_0x2a87fe];return _0x539085;};'use strict';var multer=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var path=require(_0x2a95('0x2'));var timeout=require(_0x2a95('0x3'));var express=require(_0x2a95('0x4'));var router=express['Router']();var fs_extra=require(_0x2a95('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a95('0x6'));var config=require(_0x2a95('0x7'));var controller=require(_0x2a95('0x8'));router[_0x2a95('0x9')]('/',auth[_0x2a95('0xa')](),controller[_0x2a95('0xb')]);router[_0x2a95('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2a95('0xc')]);router['get'](_0x2a95('0xd'),auth[_0x2a95('0xa')](),controller['getConfigurations']);router['get'](_0x2a95('0xe'),auth['isAuthenticated'](),controller[_0x2a95('0xf')]);router[_0x2a95('0x10')]('/',auth[_0x2a95('0xa')](),controller['create']);router[_0x2a95('0x10')](_0x2a95('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x2a95('0x11'),auth['isAuthenticated'](),controller[_0x2a95('0x12')]);router[_0x2a95('0x13')](_0x2a95('0x11'),auth[_0x2a95('0xa')](),controller[_0x2a95('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5e67=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x5395a1,_0x3e3d9e){var _0x5aa90a=function(_0x411bc6){while(--_0x411bc6){_0x5395a1['push'](_0x5395a1['shift']());}};_0x5aa90a(++_0x3e3d9e);}(_0x5e67,0x70));var _0x75e6=function(_0x1c3dce,_0x41ccd7){_0x1c3dce=_0x1c3dce-0x0;var _0x54c630=_0x5e67[_0x1c3dce];return _0x54c630;};'use strict';var multer=require(_0x75e6('0x0'));var util=require(_0x75e6('0x1'));var path=require(_0x75e6('0x2'));var timeout=require(_0x75e6('0x3'));var express=require(_0x75e6('0x4'));var router=express[_0x75e6('0x5')]();var fs_extra=require(_0x75e6('0x6'));var auth=require(_0x75e6('0x7'));var interaction=require(_0x75e6('0x8'));var config=require(_0x75e6('0x9'));var controller=require(_0x75e6('0xa'));router[_0x75e6('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x75e6('0xc')](),controller['show']);router[_0x75e6('0xb')](_0x75e6('0xd'),auth[_0x75e6('0xc')](),controller[_0x75e6('0xe')]);router['get'](_0x75e6('0xf'),auth[_0x75e6('0xc')](),controller[_0x75e6('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x75e6('0x11')]);router[_0x75e6('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x75e6('0x13')]);router[_0x75e6('0x14')](_0x75e6('0x15'),auth[_0x75e6('0xc')](),controller[_0x75e6('0x16')]);router[_0x75e6('0x17')](_0x75e6('0x15'),auth[_0x75e6('0xc')](),controller['destroy']);module[_0x75e6('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 759e14e..7eba188 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 _0xfeb3=['STRING','sequelize','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfeb3,0x160));var _0x3feb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfeb3[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x3feb('0x0'));module[_0x3feb('0x1')]={'name':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3feb('0x2')]},'username':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3feb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb5d0=['STRING','HelpDesk','exports'];(function(_0x5a9db2,_0x2aace7){var _0x2ce378=function(_0x349c0e){while(--_0x349c0e){_0x5a9db2['push'](_0x5a9db2['shift']());}};_0x2ce378(++_0x2aace7);}(_0xb5d0,0x17f));var _0x0b5d=function(_0x3d9cfa,_0x596edc){_0x3d9cfa=_0x3d9cfa-0x0;var _0x21d89d=_0xb5d0[_0x3d9cfa];return _0x21d89d;};'use strict';var Sequelize=require('sequelize');module[_0x0b5d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0b5d('0x1')]},'username':{'type':Sequelize[_0x0b5d('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0b5d('0x2')},'remoteUri':{'type':Sequelize[_0x0b5d('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0b5d('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0b5d('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 1302f13..eff8491 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 _0xebe4=['undefined','count','limit','status','set','Content-Range','apply','update','destroy','error','name','send','map','VtigerAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','create','body','getConfigurations','VtigerConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','VtigerField','md5','getFields','findOne','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','GET','success','POST','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','picklistValues','label','value','log','vTiger\x20error:\x20','statusCode','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xebe4,0xc5));var _0x4ebe=function(_0x363232,_0x2b5c48){_0x363232=_0x363232-0x0;var _0x2d12d5=_0xebe4[_0x363232];return _0x2d12d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ebe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ebe('0x1'));var rp=require(_0x4ebe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ebe('0x3'));var util=require(_0x4ebe('0x4'));var path=require(_0x4ebe('0x5'));var sox=require(_0x4ebe('0x6'));var csv=require('to-csv');var ejs=require(_0x4ebe('0x7'));var fs=require('fs');var fs_extra=require(_0x4ebe('0x8'));var _=require(_0x4ebe('0x9'));var squel=require(_0x4ebe('0xa'));var crypto=require(_0x4ebe('0xb'));var jsforce=require(_0x4ebe('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4ebe('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4ebe('0xe'));var qs=require(_0x4ebe('0xf'));var as=require(_0x4ebe('0x10'));var hardwareService=require(_0x4ebe('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x4ebe('0x12'));var config=require(_0x4ebe('0x13'));var licenseUtil=require(_0x4ebe('0x14'));var db=require(_0x4ebe('0x15'))['db'];var integrations=require(_0x4ebe('0x16'));function respondWithStatusCode(_0x3b0037,_0x427f4e){_0x427f4e=_0x427f4e||0xcc;return function(_0x5b9f7d){if(_0x5b9f7d){return _0x3b0037[_0x4ebe('0x17')](_0x427f4e);}return _0x3b0037['status'](_0x427f4e)[_0x4ebe('0x18')]();};}function respondWithResult(_0x1fdef7,_0x13d7b0){_0x13d7b0=_0x13d7b0||0xc8;return function(_0x34e12a){if(_0x34e12a){return _0x1fdef7['status'](_0x13d7b0)[_0x4ebe('0x19')](_0x34e12a);}};}function respondWithFilteredResult(_0x3ec83d,_0x1ecf6c){return function(_0x90f8bf){if(_0x90f8bf){var _0x132269=typeof _0x1ecf6c[_0x4ebe('0x1a')]===_0x4ebe('0x1b')&&typeof _0x1ecf6c['limit']===_0x4ebe('0x1b');var _0x4b403f=_0x90f8bf['count'];var _0x256ddc=_0x132269?0x0:_0x1ecf6c[_0x4ebe('0x1a')];var _0x46a718=_0x132269?_0x90f8bf[_0x4ebe('0x1c')]:_0x1ecf6c[_0x4ebe('0x1a')]+_0x1ecf6c[_0x4ebe('0x1d')];var _0x27243e;if(_0x46a718>=_0x4b403f){_0x46a718=_0x4b403f;_0x27243e=0xc8;}else{_0x27243e=0xce;}_0x3ec83d[_0x4ebe('0x1e')](_0x27243e);return _0x3ec83d[_0x4ebe('0x1f')](_0x4ebe('0x20'),_0x256ddc+'-'+_0x46a718+'/'+_0x4b403f)[_0x4ebe('0x19')](_0x90f8bf);}return null;};}function patchUpdates(_0x1a4943){return function(_0x1129ee){try{jsonpatch[_0x4ebe('0x21')](_0x1129ee,_0x1a4943,!![]);}catch(_0x2e0a23){return BPromise['reject'](_0x2e0a23);}return _0x1129ee['save']();};}function saveUpdates(_0x3bfe4c,_0x12d903){return function(_0x1d0029){if(_0x1d0029){return _0x1d0029[_0x4ebe('0x22')](_0x3bfe4c)['then'](function(_0x388ef7){return _0x388ef7;});}return null;};}function removeEntity(_0x5c8a1e,_0x1f9db9){return function(_0x5dfccf){if(_0x5dfccf){return _0x5dfccf[_0x4ebe('0x23')]()['then'](function(){_0x5c8a1e[_0x4ebe('0x1e')](0xcc)[_0x4ebe('0x18')]();});}};}function handleEntityNotFound(_0x4376e3,_0x41b652){return function(_0x27aa55){if(!_0x27aa55){_0x4376e3[_0x4ebe('0x17')](0x194);}return _0x27aa55;};}function handleError(_0x5523a9,_0x2963cb){_0x2963cb=_0x2963cb||0x1f4;return function(_0x53d6a3){logger[_0x4ebe('0x24')](_0x53d6a3['stack']);if(_0x53d6a3['name']){delete _0x53d6a3[_0x4ebe('0x25')];}_0x5523a9['status'](_0x2963cb)[_0x4ebe('0x26')](_0x53d6a3);};}exports['index']=function(_0x52370c,_0x139197){var _0x4759fd={},_0x102593={},_0x25ed7e={'count':0x0,'rows':[]};var _0xbeac14=_[_0x4ebe('0x27')](db[_0x4ebe('0x28')][_0x4ebe('0x29')],function(_0x4bfd4e){return{'name':_0x4bfd4e['fieldName'],'type':_0x4bfd4e['type'][_0x4ebe('0x2a')]};});_0x102593[_0x4ebe('0x2b')]=_[_0x4ebe('0x27')](_0xbeac14,_0x4ebe('0x25'));_0x102593[_0x4ebe('0x2c')]=_[_0x4ebe('0x2d')](_0x52370c[_0x4ebe('0x2c')]);_0x102593['filters']=_[_0x4ebe('0x2e')](_0x102593['model'],_0x102593[_0x4ebe('0x2c')]);_0x4759fd[_0x4ebe('0x2f')]=_['intersection'](_0x102593[_0x4ebe('0x2b')],qs[_0x4ebe('0x30')](_0x52370c['query'][_0x4ebe('0x30')]));_0x4759fd['attributes']=_0x4759fd[_0x4ebe('0x2f')][_0x4ebe('0x31')]?_0x4759fd['attributes']:_0x102593[_0x4ebe('0x2b')];if(!_0x52370c[_0x4ebe('0x2c')]['hasOwnProperty']('nolimit')){_0x4759fd[_0x4ebe('0x1d')]=qs[_0x4ebe('0x1d')](_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x1d')]);_0x4759fd[_0x4ebe('0x1a')]=qs[_0x4ebe('0x1a')](_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x1a')]);}_0x4759fd[_0x4ebe('0x32')]=qs[_0x4ebe('0x33')](_0x52370c['query'][_0x4ebe('0x33')]);_0x4759fd[_0x4ebe('0x34')]=qs[_0x4ebe('0x35')](_[_0x4ebe('0x36')](_0x52370c['query'],_0x102593[_0x4ebe('0x35')]),_0xbeac14);if(_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x37')]){_0x4759fd[_0x4ebe('0x34')]=_[_0x4ebe('0x38')](_0x4759fd[_0x4ebe('0x34')],{'$or':_[_0x4ebe('0x27')](_0xbeac14,function(_0xfced02){if(_0xfced02[_0x4ebe('0x39')]!==_0x4ebe('0x3a')){var _0x4b5ed3={};_0x4b5ed3[_0xfced02[_0x4ebe('0x25')]]={'$like':'%'+_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x37')]+'%'};return _0x4b5ed3;}})});}_0x4759fd=_[_0x4ebe('0x38')]({},_0x4759fd,_0x52370c[_0x4ebe('0x3b')]);var _0x386364={'where':_0x4759fd[_0x4ebe('0x34')]};return db[_0x4ebe('0x28')][_0x4ebe('0x1c')](_0x386364)[_0x4ebe('0x3c')](function(_0x2d002e){_0x25ed7e[_0x4ebe('0x1c')]=_0x2d002e;if(_0x52370c[_0x4ebe('0x2c')][_0x4ebe('0x3d')]){_0x4759fd[_0x4ebe('0x3e')]=[{'all':!![]}];}return db['VtigerAccount'][_0x4ebe('0x3f')](_0x4759fd);})['then'](function(_0x2386fa){_0x25ed7e[_0x4ebe('0x40')]=_0x2386fa;return _0x25ed7e;})[_0x4ebe('0x3c')](respondWithFilteredResult(_0x139197,_0x4759fd))[_0x4ebe('0x41')](handleError(_0x139197,null));};exports['show']=function(_0x19ab8c,_0x167629){var _0x555ea5={'raw':![],'where':{'id':_0x19ab8c[_0x4ebe('0x42')]['id']}},_0x4f95ad={};_0x4f95ad[_0x4ebe('0x2b')]=_[_0x4ebe('0x2d')](db[_0x4ebe('0x28')][_0x4ebe('0x29')]);_0x4f95ad['query']=_[_0x4ebe('0x2d')](_0x19ab8c['query']);_0x4f95ad[_0x4ebe('0x35')]=_['intersection'](_0x4f95ad['model'],_0x4f95ad[_0x4ebe('0x2c')]);_0x555ea5[_0x4ebe('0x2f')]=_['intersection'](_0x4f95ad[_0x4ebe('0x2b')],qs['fields'](_0x19ab8c[_0x4ebe('0x2c')]['fields']));_0x555ea5['attributes']=_0x555ea5['attributes'][_0x4ebe('0x31')]?_0x555ea5[_0x4ebe('0x2f')]:_0x4f95ad['model'];if(_0x19ab8c['query'][_0x4ebe('0x3d')]){_0x555ea5[_0x4ebe('0x3e')]=[{'all':!![]}];}_0x555ea5=_[_0x4ebe('0x38')]({},_0x555ea5,_0x19ab8c['options']);return db[_0x4ebe('0x28')]['find'](_0x555ea5)['then'](handleEntityNotFound(_0x167629,null))['then'](respondWithResult(_0x167629,null))['catch'](handleError(_0x167629,null));};exports[_0x4ebe('0x43')]=function(_0x4211a0,_0xdb79ce){return db[_0x4ebe('0x28')]['create'](_0x4211a0['body'],{})['then'](respondWithResult(_0xdb79ce,0xc9))[_0x4ebe('0x41')](handleError(_0xdb79ce,null));};exports[_0x4ebe('0x22')]=function(_0x567c68,_0x2d343b){if(_0x567c68[_0x4ebe('0x44')]['id']){delete _0x567c68[_0x4ebe('0x44')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x567c68['params']['id']}})[_0x4ebe('0x3c')](handleEntityNotFound(_0x2d343b,null))[_0x4ebe('0x3c')](saveUpdates(_0x567c68[_0x4ebe('0x44')],null))[_0x4ebe('0x3c')](respondWithResult(_0x2d343b,null))[_0x4ebe('0x41')](handleError(_0x2d343b,null));};exports[_0x4ebe('0x23')]=function(_0xfb3949,_0x2abc2d){return db[_0x4ebe('0x28')]['find']({'where':{'id':_0xfb3949[_0x4ebe('0x42')]['id']}})['then'](handleEntityNotFound(_0x2abc2d,null))[_0x4ebe('0x3c')](removeEntity(_0x2abc2d,null))['catch'](handleError(_0x2abc2d,null));};exports[_0x4ebe('0x45')]=function(_0x401e59,_0x3304a9,_0x35221a){var _0xb7427c={};var _0x3a117b={};var _0x2b2e73;var _0x2bf2a1;return db[_0x4ebe('0x28')]['findOne']({'where':{'id':_0x401e59[_0x4ebe('0x42')]['id']}})[_0x4ebe('0x3c')](handleEntityNotFound(_0x3304a9,null))['then'](function(_0x5251a6){if(_0x5251a6){_0x2b2e73=_0x5251a6;_0x3a117b[_0x4ebe('0x2b')]=_[_0x4ebe('0x2d')](db[_0x4ebe('0x46')]['rawAttributes']);_0x3a117b[_0x4ebe('0x2c')]=_[_0x4ebe('0x2d')](_0x401e59[_0x4ebe('0x2c')]);_0x3a117b['filters']=_['intersection'](_0x3a117b['model'],_0x3a117b[_0x4ebe('0x2c')]);_0xb7427c[_0x4ebe('0x2f')]=_[_0x4ebe('0x2e')](_0x3a117b[_0x4ebe('0x2b')],qs[_0x4ebe('0x30')](_0x401e59['query'][_0x4ebe('0x30')]));_0xb7427c[_0x4ebe('0x2f')]=_0xb7427c[_0x4ebe('0x2f')][_0x4ebe('0x31')]?_0xb7427c[_0x4ebe('0x2f')]:_0x3a117b['model'];_0xb7427c[_0x4ebe('0x32')]=qs[_0x4ebe('0x33')](_0x401e59['query'][_0x4ebe('0x33')]);_0xb7427c[_0x4ebe('0x34')]=qs['filters'](_[_0x4ebe('0x36')](_0x401e59[_0x4ebe('0x2c')],_0x3a117b[_0x4ebe('0x35')]));if(_0x401e59[_0x4ebe('0x2c')][_0x4ebe('0x37')]){_0xb7427c[_0x4ebe('0x34')]=_[_0x4ebe('0x38')](_0xb7427c[_0x4ebe('0x34')],{'$or':_[_0x4ebe('0x27')](_0xb7427c[_0x4ebe('0x2f')],function(_0x40c2ad){var _0x29b182={};_0x29b182[_0x40c2ad]={'$like':'%'+_0x401e59['query'][_0x4ebe('0x37')]+'%'};return _0x29b182;})});}_0xb7427c=_['merge']({},_0xb7427c,_0x401e59[_0x4ebe('0x3b')]);return _0x2b2e73[_0x4ebe('0x45')](_0xb7427c);}})[_0x4ebe('0x3c')](function(_0x1c2d37){if(_0x1c2d37){_0x2bf2a1=_0x1c2d37[_0x4ebe('0x31')];if(!_0x401e59['query'][_0x4ebe('0x47')](_0x4ebe('0x48'))){_0xb7427c['limit']=qs['limit'](_0x401e59[_0x4ebe('0x2c')][_0x4ebe('0x1d')]);_0xb7427c[_0x4ebe('0x1a')]=qs['offset'](_0x401e59[_0x4ebe('0x2c')][_0x4ebe('0x1a')]);}return _0x2b2e73['getConfigurations'](_0xb7427c);}})[_0x4ebe('0x3c')](function(_0x3e6e4f){if(_0x3e6e4f){return _0x3e6e4f?{'count':_0x2bf2a1,'rows':_0x3e6e4f}:null;}})[_0x4ebe('0x3c')](respondWithResult(_0x3304a9,null))[_0x4ebe('0x41')](handleError(_0x3304a9,null));};exports[_0x4ebe('0x49')]=function(_0x4d75bc,_0x28153d,_0x554443){if(_0x4d75bc[_0x4ebe('0x44')]['id']){delete _0x4d75bc[_0x4ebe('0x44')]['id'];}return db[_0x4ebe('0x28')]['findOne']({'where':{'id':_0x4d75bc['params']['id']}})[_0x4ebe('0x3c')](handleEntityNotFound(_0x28153d,null))[_0x4ebe('0x3c')](function(_0x37259e){if(_0x37259e){_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x4a')]=_0x37259e['id'];_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x4b')]=integrations['getSubjects'](_0x4d75bc[_0x4ebe('0x44')]['channel'],_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x39')]);_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x4c')]=integrations[_0x4ebe('0x4d')](_0x4d75bc[_0x4ebe('0x44')]['channel'],_0x4d75bc[_0x4ebe('0x44')][_0x4ebe('0x39')]);return db[_0x4ebe('0x46')]['create'](_0x4d75bc[_0x4ebe('0x44')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x4ebe('0x4e')],'as':'Descriptions'}]});}return null;})[_0x4ebe('0x3c')](respondWithResult(_0x28153d,null))['catch'](handleError(_0x28153d,null));};var md5=require(_0x4ebe('0x4f'));exports[_0x4ebe('0x50')]=function(_0x32be3f,_0x66b382,_0x24c00d){var _0x388ede=null;var _0x5aa268=null;var _0x40def4=null;var _0x142609=null;var _0x4a8145='';return db[_0x4ebe('0x28')][_0x4ebe('0x51')]({'where':{'id':_0x32be3f[_0x4ebe('0x42')]['id']},'attributes':['id',_0x4ebe('0x25'),_0x4ebe('0x52'),'description',_0x4ebe('0x53'),_0x4ebe('0x54'),_0x4ebe('0x55'),'accessKey']})['then'](handleEntityNotFound(_0x66b382,null))[_0x4ebe('0x3c')](function(_0x44a6cb){if(_0x44a6cb){_0x388ede=_0x44a6cb[_0x4ebe('0x52')];_0x5aa268=_0x44a6cb[_0x4ebe('0x56')];_0x40def4=_0x44a6cb[_0x4ebe('0x53')];_0x4a8145=_0x44a6cb['remoteUri'];var _0x49d579=_0x4a8145[_0x4ebe('0x57')](-0x1);if(_0x49d579==='/'){_0x4a8145=_0x4a8145[_0x4ebe('0x58')](0x0,_0x4a8145['lastIndexOf'](_0x49d579));}_0x142609=util[_0x4ebe('0x59')](_0x4ebe('0x5a'),_0x4a8145);var _0x4d93ff={'method':_0x4ebe('0x5b'),'uri':_0x142609,'qs':{'operation':'getchallenge','username':_0x44a6cb[_0x4ebe('0x52')]},'json':!![]};return rp(_0x4d93ff);}})[_0x4ebe('0x3c')](function(_0x26b051){if(_0x26b051[_0x4ebe('0x5c')]){var _0x5b3e02={'method':_0x4ebe('0x5d'),'uri':_0x142609,'form':{'operation':'login','username':_0x388ede,'accessKey':md5(_0x26b051[_0x4ebe('0x5e')][_0x4ebe('0x5f')]+_0x5aa268)},'json':!![]};return rp(_0x5b3e02);}})[_0x4ebe('0x3c')](function(_0x3df061){if(_0x3df061['success']){var _0x12fcba={'method':'GET','uri':_0x142609,'qs':{'operation':_0x4ebe('0x60'),'username':_0x388ede,'sessionName':_0x3df061[_0x4ebe('0x5e')][_0x4ebe('0x61')],'elementType':_0x40def4},'json':!![]};return rp(_0x12fcba);}})[_0x4ebe('0x3c')](function(_0x1663ec){if(_0x1663ec[_0x4ebe('0x5c')]){var _0x5d18a5=[_0x4ebe('0x62'),_0x4ebe('0x63'),_0x4ebe('0x64')];_[_0x4ebe('0x65')](_0x1663ec[_0x4ebe('0x5e')][_0x4ebe('0x30')],function(_0x3d0560){return _0x5d18a5[_0x4ebe('0x66')](_0x3d0560[_0x4ebe('0x39')]['name']);});_[_0x4ebe('0x65')](_0x1663ec[_0x4ebe('0x5e')][_0x4ebe('0x30')],function(_0x1279b5){return _0x1279b5['editable']==='false';});return{'count':_0x1663ec['result'][_0x4ebe('0x30')][_0x4ebe('0x31')],'rows':_[_0x4ebe('0x27')](_0x1663ec[_0x4ebe('0x5e')]['fields'],function(_0x5d7b25){return{'id':_0x5d7b25[_0x4ebe('0x25')],'name':_0x5d7b25['label'],'custom':_['startsWith'](_0x5d7b25[_0x4ebe('0x25')],'cf_')?!![]:![],'options':_0x5d7b25[_0x4ebe('0x39')][_0x4ebe('0x25')]==='picklist'&&_0x5d7b25[_0x4ebe('0x39')][_0x4ebe('0x67')][_0x4ebe('0x31')]>0x0?_[_0x4ebe('0x27')](_0x5d7b25['type']['picklistValues'],function(_0x8353bf){return{'name':_0x8353bf[_0x4ebe('0x68')],'value':_0x8353bf[_0x4ebe('0x69')]};}):[]};})};}})['then'](respondWithResult(_0x66b382,null))['catch'](function(_0x2c9c81){console[_0x4ebe('0x6a')](_0x4ebe('0x6b')+_0x2c9c81);var _0x1ebed2=_0x32be3f[_0x4ebe('0x2c')]['test']?0x1f4:_0x2c9c81[_0x4ebe('0x6c')]||0x1f4;logger[_0x4ebe('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x4ebe('0x50'),_0x1ebed2,JSON[_0x4ebe('0x6d')](_0x2c9c81));delete _0x2c9c81['name'];if(_0x1ebed2===0x191){_0x1ebed2=0x190;}_0x66b382['status'](_0x1ebed2)['send'](_0x32be3f[_0x4ebe('0x2c')][_0x4ebe('0x6e')]?{'message':_0x4ebe('0x6f'),'statusCode':_0x2c9c81[_0x4ebe('0x6c')]}:_0x2c9c81);});}; \ No newline at end of file +var _0x6cf3=['options','includeAll','include','VtigerAccount','findAll','catch','show','params','find','create','body','update','findOne','VtigerConfiguration','hasOwnProperty','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','login','result','token','GET','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','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','destroy','then','error','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge'];(function(_0x2cf5ec,_0x885805){var _0x452fa6=function(_0x174119){while(--_0x174119){_0x2cf5ec['push'](_0x2cf5ec['shift']());}};_0x452fa6(++_0x885805);}(_0x6cf3,0x132));var _0x36cf=function(_0x2e8792,_0x32fb99){_0x2e8792=_0x2e8792-0x0;var _0x47683b=_0x6cf3[_0x2e8792];return _0x47683b;};'use strict';var emlformat=require(_0x36cf('0x0'));var rimraf=require(_0x36cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36cf('0x2'));var rp=require(_0x36cf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x36cf('0x4'));var util=require(_0x36cf('0x5'));var path=require(_0x36cf('0x6'));var sox=require(_0x36cf('0x7'));var csv=require(_0x36cf('0x8'));var ejs=require(_0x36cf('0x9'));var fs=require('fs');var fs_extra=require(_0x36cf('0xa'));var _=require(_0x36cf('0xb'));var squel=require('squel');var crypto=require(_0x36cf('0xc'));var jsforce=require(_0x36cf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x36cf('0x8'));var querystring=require(_0x36cf('0xe'));var Papa=require(_0x36cf('0xf'));var Redis=require(_0x36cf('0x10'));var authService=require(_0x36cf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x36cf('0x12'));var hardwareService=require(_0x36cf('0x13'));var logger=require(_0x36cf('0x14'))(_0x36cf('0x15'));var utils=require(_0x36cf('0x16'));var config=require(_0x36cf('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x36cf('0x18'))['db'];var integrations=require(_0x36cf('0x19'));function respondWithStatusCode(_0x57cdcc,_0x45f7fa){_0x45f7fa=_0x45f7fa||0xcc;return function(_0x4a1fd6){if(_0x4a1fd6){return _0x57cdcc[_0x36cf('0x1a')](_0x45f7fa);}return _0x57cdcc[_0x36cf('0x1b')](_0x45f7fa)[_0x36cf('0x1c')]();};}function respondWithResult(_0x3871b0,_0x41c7c5){_0x41c7c5=_0x41c7c5||0xc8;return function(_0x1cfb60){if(_0x1cfb60){return _0x3871b0[_0x36cf('0x1b')](_0x41c7c5)[_0x36cf('0x1d')](_0x1cfb60);}};}function respondWithFilteredResult(_0x358062,_0x187b71){return function(_0x1b5d2a){if(_0x1b5d2a){var _0x3649e7=typeof _0x187b71[_0x36cf('0x1e')]==='undefined'&&typeof _0x187b71[_0x36cf('0x1f')]===_0x36cf('0x20');var _0x1b4a79=_0x1b5d2a['count'];var _0xdc4670=_0x3649e7?0x0:_0x187b71['offset'];var _0x2c8360=_0x3649e7?_0x1b5d2a[_0x36cf('0x21')]:_0x187b71[_0x36cf('0x1e')]+_0x187b71['limit'];var _0x135919;if(_0x2c8360>=_0x1b4a79){_0x2c8360=_0x1b4a79;_0x135919=0xc8;}else{_0x135919=0xce;}_0x358062[_0x36cf('0x1b')](_0x135919);return _0x358062['set']('Content-Range',_0xdc4670+'-'+_0x2c8360+'/'+_0x1b4a79)[_0x36cf('0x1d')](_0x1b5d2a);}return null;};}function patchUpdates(_0x41d0fa){return function(_0x5bfece){try{jsonpatch[_0x36cf('0x22')](_0x5bfece,_0x41d0fa,!![]);}catch(_0x30b6a6){return BPromise[_0x36cf('0x23')](_0x30b6a6);}return _0x5bfece[_0x36cf('0x24')]();};}function saveUpdates(_0x139b36,_0x152682){return function(_0x43aa05){if(_0x43aa05){return _0x43aa05['update'](_0x139b36)['then'](function(_0x192f03){return _0x192f03;});}return null;};}function removeEntity(_0x19508d,_0x290c57){return function(_0x4fe412){if(_0x4fe412){return _0x4fe412[_0x36cf('0x25')]()[_0x36cf('0x26')](function(){_0x19508d[_0x36cf('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x245e48,_0x22d740){return function(_0x2b6ab7){if(!_0x2b6ab7){_0x245e48[_0x36cf('0x1a')](0x194);}return _0x2b6ab7;};}function handleError(_0x4eef79,_0x2a60a8){_0x2a60a8=_0x2a60a8||0x1f4;return function(_0x1c66e2){logger[_0x36cf('0x27')](_0x1c66e2['stack']);if(_0x1c66e2[_0x36cf('0x28')]){delete _0x1c66e2[_0x36cf('0x28')];}_0x4eef79[_0x36cf('0x1b')](_0x2a60a8)[_0x36cf('0x29')](_0x1c66e2);};}exports[_0x36cf('0x2a')]=function(_0x255f9f,_0x26932f){var _0x5008d9={},_0x1e5701={},_0x3d06f1={'count':0x0,'rows':[]};var _0x3c535a=_[_0x36cf('0x2b')](db['VtigerAccount'][_0x36cf('0x2c')],function(_0x36358e){return{'name':_0x36358e['fieldName'],'type':_0x36358e[_0x36cf('0x2d')][_0x36cf('0x2e')]};});_0x1e5701['model']=_[_0x36cf('0x2b')](_0x3c535a,_0x36cf('0x28'));_0x1e5701['query']=_[_0x36cf('0x2f')](_0x255f9f[_0x36cf('0x30')]);_0x1e5701[_0x36cf('0x31')]=_[_0x36cf('0x32')](_0x1e5701[_0x36cf('0x33')],_0x1e5701[_0x36cf('0x30')]);_0x5008d9[_0x36cf('0x34')]=_[_0x36cf('0x32')](_0x1e5701[_0x36cf('0x33')],qs[_0x36cf('0x35')](_0x255f9f[_0x36cf('0x30')][_0x36cf('0x35')]));_0x5008d9[_0x36cf('0x34')]=_0x5008d9[_0x36cf('0x34')][_0x36cf('0x36')]?_0x5008d9[_0x36cf('0x34')]:_0x1e5701[_0x36cf('0x33')];if(!_0x255f9f[_0x36cf('0x30')]['hasOwnProperty'](_0x36cf('0x37'))){_0x5008d9[_0x36cf('0x1f')]=qs[_0x36cf('0x1f')](_0x255f9f['query'][_0x36cf('0x1f')]);_0x5008d9['offset']=qs[_0x36cf('0x1e')](_0x255f9f[_0x36cf('0x30')]['offset']);}_0x5008d9[_0x36cf('0x38')]=qs[_0x36cf('0x39')](_0x255f9f[_0x36cf('0x30')]['sort']);_0x5008d9['where']=qs[_0x36cf('0x31')](_[_0x36cf('0x3a')](_0x255f9f[_0x36cf('0x30')],_0x1e5701[_0x36cf('0x31')]),_0x3c535a);if(_0x255f9f[_0x36cf('0x30')][_0x36cf('0x3b')]){_0x5008d9[_0x36cf('0x3c')]=_['merge'](_0x5008d9[_0x36cf('0x3c')],{'$or':_[_0x36cf('0x2b')](_0x3c535a,function(_0x19fc0b){if(_0x19fc0b[_0x36cf('0x2d')]!==_0x36cf('0x3d')){var _0x2b5efa={};_0x2b5efa[_0x19fc0b[_0x36cf('0x28')]]={'$like':'%'+_0x255f9f[_0x36cf('0x30')][_0x36cf('0x3b')]+'%'};return _0x2b5efa;}})});}_0x5008d9=_[_0x36cf('0x3e')]({},_0x5008d9,_0x255f9f[_0x36cf('0x3f')]);var _0x1b6d3f={'where':_0x5008d9[_0x36cf('0x3c')]};return db['VtigerAccount'][_0x36cf('0x21')](_0x1b6d3f)[_0x36cf('0x26')](function(_0x938607){_0x3d06f1[_0x36cf('0x21')]=_0x938607;if(_0x255f9f['query'][_0x36cf('0x40')]){_0x5008d9[_0x36cf('0x41')]=[{'all':!![]}];}return db[_0x36cf('0x42')][_0x36cf('0x43')](_0x5008d9);})['then'](function(_0x4b035d){_0x3d06f1['rows']=_0x4b035d;return _0x3d06f1;})[_0x36cf('0x26')](respondWithFilteredResult(_0x26932f,_0x5008d9))[_0x36cf('0x44')](handleError(_0x26932f,null));};exports[_0x36cf('0x45')]=function(_0x3a3e1f,_0x2121bf){var _0x29e6e1={'raw':![],'where':{'id':_0x3a3e1f[_0x36cf('0x46')]['id']}},_0x317d87={};_0x317d87[_0x36cf('0x33')]=_[_0x36cf('0x2f')](db[_0x36cf('0x42')][_0x36cf('0x2c')]);_0x317d87[_0x36cf('0x30')]=_[_0x36cf('0x2f')](_0x3a3e1f[_0x36cf('0x30')]);_0x317d87[_0x36cf('0x31')]=_[_0x36cf('0x32')](_0x317d87[_0x36cf('0x33')],_0x317d87[_0x36cf('0x30')]);_0x29e6e1['attributes']=_[_0x36cf('0x32')](_0x317d87[_0x36cf('0x33')],qs['fields'](_0x3a3e1f[_0x36cf('0x30')][_0x36cf('0x35')]));_0x29e6e1[_0x36cf('0x34')]=_0x29e6e1['attributes']['length']?_0x29e6e1['attributes']:_0x317d87[_0x36cf('0x33')];if(_0x3a3e1f['query'][_0x36cf('0x40')]){_0x29e6e1[_0x36cf('0x41')]=[{'all':!![]}];}_0x29e6e1=_[_0x36cf('0x3e')]({},_0x29e6e1,_0x3a3e1f[_0x36cf('0x3f')]);return db[_0x36cf('0x42')][_0x36cf('0x47')](_0x29e6e1)[_0x36cf('0x26')](handleEntityNotFound(_0x2121bf,null))[_0x36cf('0x26')](respondWithResult(_0x2121bf,null))['catch'](handleError(_0x2121bf,null));};exports[_0x36cf('0x48')]=function(_0x2b3a5e,_0xf563e6){return db[_0x36cf('0x42')][_0x36cf('0x48')](_0x2b3a5e[_0x36cf('0x49')],{})[_0x36cf('0x26')](respondWithResult(_0xf563e6,0xc9))[_0x36cf('0x44')](handleError(_0xf563e6,null));};exports[_0x36cf('0x4a')]=function(_0x33e18d,_0x2923ef){if(_0x33e18d['body']['id']){delete _0x33e18d[_0x36cf('0x49')]['id'];}return db[_0x36cf('0x42')]['find']({'where':{'id':_0x33e18d[_0x36cf('0x46')]['id']}})['then'](handleEntityNotFound(_0x2923ef,null))['then'](saveUpdates(_0x33e18d[_0x36cf('0x49')],null))[_0x36cf('0x26')](respondWithResult(_0x2923ef,null))[_0x36cf('0x44')](handleError(_0x2923ef,null));};exports['destroy']=function(_0x52a4d9,_0x40269c){return db[_0x36cf('0x42')][_0x36cf('0x47')]({'where':{'id':_0x52a4d9[_0x36cf('0x46')]['id']}})[_0x36cf('0x26')](handleEntityNotFound(_0x40269c,null))[_0x36cf('0x26')](removeEntity(_0x40269c,null))[_0x36cf('0x44')](handleError(_0x40269c,null));};exports['getConfigurations']=function(_0x3061f5,_0x4bb2a0,_0x287b29){var _0x233224={};var _0x27efd3={};var _0x3ee29f;var _0x4caf67;return db[_0x36cf('0x42')][_0x36cf('0x4b')]({'where':{'id':_0x3061f5[_0x36cf('0x46')]['id']}})[_0x36cf('0x26')](handleEntityNotFound(_0x4bb2a0,null))['then'](function(_0x4fae89){if(_0x4fae89){_0x3ee29f=_0x4fae89;_0x27efd3[_0x36cf('0x33')]=_[_0x36cf('0x2f')](db[_0x36cf('0x4c')][_0x36cf('0x2c')]);_0x27efd3[_0x36cf('0x30')]=_['keys'](_0x3061f5[_0x36cf('0x30')]);_0x27efd3[_0x36cf('0x31')]=_['intersection'](_0x27efd3[_0x36cf('0x33')],_0x27efd3[_0x36cf('0x30')]);_0x233224[_0x36cf('0x34')]=_[_0x36cf('0x32')](_0x27efd3[_0x36cf('0x33')],qs[_0x36cf('0x35')](_0x3061f5[_0x36cf('0x30')][_0x36cf('0x35')]));_0x233224[_0x36cf('0x34')]=_0x233224[_0x36cf('0x34')][_0x36cf('0x36')]?_0x233224['attributes']:_0x27efd3[_0x36cf('0x33')];_0x233224[_0x36cf('0x38')]=qs[_0x36cf('0x39')](_0x3061f5[_0x36cf('0x30')][_0x36cf('0x39')]);_0x233224[_0x36cf('0x3c')]=qs[_0x36cf('0x31')](_[_0x36cf('0x3a')](_0x3061f5[_0x36cf('0x30')],_0x27efd3[_0x36cf('0x31')]));if(_0x3061f5[_0x36cf('0x30')][_0x36cf('0x3b')]){_0x233224[_0x36cf('0x3c')]=_[_0x36cf('0x3e')](_0x233224['where'],{'$or':_[_0x36cf('0x2b')](_0x233224[_0x36cf('0x34')],function(_0x55b8f2){var _0x335432={};_0x335432[_0x55b8f2]={'$like':'%'+_0x3061f5[_0x36cf('0x30')]['filter']+'%'};return _0x335432;})});}_0x233224=_['merge']({},_0x233224,_0x3061f5[_0x36cf('0x3f')]);return _0x3ee29f['getConfigurations'](_0x233224);}})[_0x36cf('0x26')](function(_0x526c9f){if(_0x526c9f){_0x4caf67=_0x526c9f[_0x36cf('0x36')];if(!_0x3061f5[_0x36cf('0x30')][_0x36cf('0x4d')]('nolimit')){_0x233224['limit']=qs['limit'](_0x3061f5[_0x36cf('0x30')]['limit']);_0x233224[_0x36cf('0x1e')]=qs[_0x36cf('0x1e')](_0x3061f5[_0x36cf('0x30')]['offset']);}return _0x3ee29f[_0x36cf('0x4e')](_0x233224);}})[_0x36cf('0x26')](function(_0xd6a32){if(_0xd6a32){return _0xd6a32?{'count':_0x4caf67,'rows':_0xd6a32}:null;}})[_0x36cf('0x26')](respondWithResult(_0x4bb2a0,null))[_0x36cf('0x44')](handleError(_0x4bb2a0,null));};exports[_0x36cf('0x4f')]=function(_0x5cdc4f,_0x5c1f15,_0x1f1fa3){if(_0x5cdc4f[_0x36cf('0x49')]['id']){delete _0x5cdc4f['body']['id'];}return db[_0x36cf('0x42')][_0x36cf('0x4b')]({'where':{'id':_0x5cdc4f['params']['id']}})[_0x36cf('0x26')](handleEntityNotFound(_0x5c1f15,null))[_0x36cf('0x26')](function(_0x7ed428){if(_0x7ed428){_0x5cdc4f['body'][_0x36cf('0x50')]=_0x7ed428['id'];_0x5cdc4f['body'][_0x36cf('0x51')]=integrations[_0x36cf('0x52')](_0x5cdc4f[_0x36cf('0x49')][_0x36cf('0x53')],_0x5cdc4f[_0x36cf('0x49')]['type']);_0x5cdc4f[_0x36cf('0x49')]['Descriptions']=integrations['getDescriptions'](_0x5cdc4f[_0x36cf('0x49')][_0x36cf('0x53')],_0x5cdc4f[_0x36cf('0x49')][_0x36cf('0x2d')]);return db[_0x36cf('0x4c')]['create'](_0x5cdc4f['body'],{'include':[{'model':db['VtigerField'],'as':_0x36cf('0x51')},{'model':db['VtigerField'],'as':_0x36cf('0x54')}]});}return null;})['then'](respondWithResult(_0x5c1f15,null))['catch'](handleError(_0x5c1f15,null));};var md5=require(_0x36cf('0x55'));exports[_0x36cf('0x56')]=function(_0x45bc4b,_0x32c1fd,_0x479038){var _0x469776=null;var _0x426515=null;var _0x322413=null;var _0x84dee9=null;var _0x49a6f3='';return db[_0x36cf('0x42')][_0x36cf('0x4b')]({'where':{'id':_0x45bc4b['params']['id']},'attributes':['id',_0x36cf('0x28'),_0x36cf('0x57'),_0x36cf('0x58'),'moduleName',_0x36cf('0x59'),_0x36cf('0x5a'),_0x36cf('0x5b')]})[_0x36cf('0x26')](handleEntityNotFound(_0x32c1fd,null))['then'](function(_0x4d7a7b){if(_0x4d7a7b){_0x469776=_0x4d7a7b[_0x36cf('0x57')];_0x426515=_0x4d7a7b[_0x36cf('0x5b')];_0x322413=_0x4d7a7b[_0x36cf('0x5c')];_0x49a6f3=_0x4d7a7b[_0x36cf('0x59')];var _0x38c0c9=_0x49a6f3[_0x36cf('0x5d')](-0x1);if(_0x38c0c9==='/'){_0x49a6f3=_0x49a6f3[_0x36cf('0x5e')](0x0,_0x49a6f3[_0x36cf('0x5f')](_0x38c0c9));}_0x84dee9=util[_0x36cf('0x60')](_0x36cf('0x61'),_0x49a6f3);var _0x35b453={'method':'GET','uri':_0x84dee9,'qs':{'operation':_0x36cf('0x62'),'username':_0x4d7a7b['username']},'json':!![]};return rp(_0x35b453);}})[_0x36cf('0x26')](function(_0x32032b){if(_0x32032b[_0x36cf('0x63')]){var _0x15f374={'method':'POST','uri':_0x84dee9,'form':{'operation':_0x36cf('0x64'),'username':_0x469776,'accessKey':md5(_0x32032b[_0x36cf('0x65')][_0x36cf('0x66')]+_0x426515)},'json':!![]};return rp(_0x15f374);}})['then'](function(_0x49400d){if(_0x49400d[_0x36cf('0x63')]){var _0x268b41={'method':_0x36cf('0x67'),'uri':_0x84dee9,'qs':{'operation':_0x36cf('0x68'),'username':_0x469776,'sessionName':_0x49400d[_0x36cf('0x65')]['sessionName'],'elementType':_0x322413},'json':!![]};return rp(_0x268b41);}})[_0x36cf('0x26')](function(_0xd28b2){if(_0xd28b2[_0x36cf('0x63')]){var _0x1a5d95=[_0x36cf('0x69'),_0x36cf('0x6a'),_0x36cf('0x6b')];_[_0x36cf('0x6c')](_0xd28b2[_0x36cf('0x65')][_0x36cf('0x35')],function(_0x231d08){return _0x1a5d95[_0x36cf('0x6d')](_0x231d08[_0x36cf('0x2d')][_0x36cf('0x28')]);});_['remove'](_0xd28b2[_0x36cf('0x65')]['fields'],function(_0x459fae){return _0x459fae[_0x36cf('0x6e')]==='false';});return{'count':_0xd28b2['result'][_0x36cf('0x35')][_0x36cf('0x36')],'rows':_[_0x36cf('0x2b')](_0xd28b2[_0x36cf('0x65')][_0x36cf('0x35')],function(_0x76e7a1){return{'id':_0x76e7a1[_0x36cf('0x28')],'name':_0x76e7a1[_0x36cf('0x6f')],'custom':_[_0x36cf('0x70')](_0x76e7a1[_0x36cf('0x28')],_0x36cf('0x71'))?!![]:![],'options':_0x76e7a1[_0x36cf('0x2d')][_0x36cf('0x28')]==='picklist'&&_0x76e7a1[_0x36cf('0x2d')][_0x36cf('0x72')][_0x36cf('0x36')]>0x0?_[_0x36cf('0x2b')](_0x76e7a1['type'][_0x36cf('0x72')],function(_0x2fd04f){return{'name':_0x2fd04f[_0x36cf('0x6f')],'value':_0x2fd04f[_0x36cf('0x73')]};}):[]};})};}})[_0x36cf('0x26')](respondWithResult(_0x32c1fd,null))[_0x36cf('0x44')](function(_0x5581d4){console[_0x36cf('0x74')](_0x36cf('0x75')+_0x5581d4);var _0x51655d=_0x45bc4b['query'][_0x36cf('0x76')]?0x1f4:_0x5581d4[_0x36cf('0x77')]||0x1f4;logger[_0x36cf('0x27')](_0x36cf('0x78'),'getFields',_0x51655d,JSON[_0x36cf('0x79')](_0x5581d4));delete _0x5581d4[_0x36cf('0x28')];if(_0x51655d===0x191){_0x51655d=0x190;}_0x32c1fd['status'](_0x51655d)[_0x36cf('0x29')](_0x45bc4b[_0x36cf('0x30')][_0x36cf('0x76')]?{'message':_0x36cf('0x7a'),'statusCode':_0x5581d4[_0x36cf('0x77')]}:_0x5581d4);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index da77934..d0cb90c 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 _0x75d4=['moment','bluebird','request-promise','./intVtigerAccount.attributes','../../components/integrations/configuration','VtigerAccount','lodash','../../config/logger','api'];(function(_0x560662,_0x2e7bd4){var _0x2ebf15=function(_0x4f6250){while(--_0x4f6250){_0x560662['push'](_0x560662['shift']());}};_0x2ebf15(++_0x2e7bd4);}(_0x75d4,0xcc));var _0x475d=function(_0x406310,_0x16f727){_0x406310=_0x406310-0x0;var _0x565691=_0x75d4[_0x406310];return _0x565691;};'use strict';var _=require(_0x475d('0x0'));var util=require('util');var logger=require(_0x475d('0x1'))(_0x475d('0x2'));var moment=require(_0x475d('0x3'));var BPromise=require(_0x475d('0x4'));var rp=require(_0x475d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x475d('0x6'));var integrations=require(_0x475d('0x7'));module['exports']=function(_0x1397d7,_0x39aaf0){return _0x1397d7['define'](_0x475d('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb39b=['request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api'];(function(_0x7c4cb3,_0x204bf6){var _0x116344=function(_0x1bfef4){while(--_0x1bfef4){_0x7c4cb3['push'](_0x7c4cb3['shift']());}};_0x116344(++_0x204bf6);}(_0xb39b,0x99));var _0xbb39=function(_0x56a780,_0x3269a3){_0x56a780=_0x56a780-0x0;var _0x3ec7a2=_0xb39b[_0x56a780];return _0x3ec7a2;};'use strict';var _=require(_0xbb39('0x0'));var util=require(_0xbb39('0x1'));var logger=require('../../config/logger')(_0xbb39('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbb39('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb39('0x4'));var config=require(_0xbb39('0x5'));var attributes=require(_0xbb39('0x6'));var integrations=require(_0xbb39('0x7'));module[_0xbb39('0x8')]=function(_0x2daa8e,_0x3347bc){return _0x2daa8e[_0xbb39('0x9')](_0xbb39('0xa'),attributes,{'tableName':_0xbb39('0xb'),'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 1a8b74d..dcf748a 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 _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','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','result','catch','GetVtigerAccount','VtigerAccount'];(function(_0x4b89d3,_0x7e2294){var _0x301a41=function(_0x407aaa){while(--_0x407aaa){_0x4b89d3['push'](_0x4b89d3['shift']());}};_0x301a41(++_0x7e2294);}(_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 BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetVtigerAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowVtigerAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file +var _0xefda=['options','raw','attributes','include','map','model','ShowVtigerAccount','VtigerAccount','find','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','GetVtigerAccount','findAll'];(function(_0xb2f5b1,_0x5054e1){var _0x5cb22a=function(_0x3986f0){while(--_0x3986f0){_0xb2f5b1['push'](_0xb2f5b1['shift']());}};_0x5cb22a(++_0x5054e1);}(_0xefda,0x96));var _0xaefd=function(_0x290062,_0x97edf3){_0x290062=_0x290062-0x0;var _0x1f520e=_0xefda[_0x290062];return _0x1f520e;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['VtigerAccount'][_0xaefd('0x18')]({'raw':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['where']||null:null,'attributes':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'limit':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['limit']||null:null,'include':_0x9748f4['options']?_0x9748f4['options'][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x9748f4[_0xaefd('0x19')]['include'],function(_0x23060f){return{'model':db[_0x23060f['model']],'as':_0x23060f['as'],'attributes':_0x23060f[_0xaefd('0x1b')],'include':_0x23060f[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x23060f['include'],function(_0x435413){return{'model':db[_0x435413[_0xaefd('0x1e')]],'as':_0x435413['as'],'attributes':_0x435413[_0xaefd('0x1b')],'include':_0x435413[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x435413['include'],function(_0x2fe27e){return{'model':db[_0x2fe27e['model']],'as':_0x2fe27e['as'],'attributes':_0x2fe27e[_0xaefd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x5470bd){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger['debug'](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5470bd));_0x2db61b(_0x5470bd);})[_0xaefd('0x16')](function(_0x4c0898){logger[_0xaefd('0x10')]('GetVtigerAccount',_0x4c0898[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1['error'](0x1f4,_0x4c0898['message']));});});};exports[_0xaefd('0x1f')]=function(_0x1b470c){var _0x4a032d=this;return new Promise(function(_0x578378,_0x4ee0c1){return db[_0xaefd('0x20')][_0xaefd('0x21')]({'raw':_0x1b470c['options']?_0x1b470c['options'][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x22')]||null:null,'attributes':_0x1b470c['options']?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'include':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')],function(_0x3e3fe2){return{'model':db[_0x3e3fe2[_0xaefd('0x1e')]],'as':_0x3e3fe2['as'],'attributes':_0x3e3fe2[_0xaefd('0x1b')],'include':_0x3e3fe2[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x3e3fe2[_0xaefd('0x1c')],function(_0x1ffec4){return{'model':db[_0x1ffec4[_0xaefd('0x1e')]],'as':_0x1ffec4['as'],'attributes':_0x1ffec4['attributes'],'include':_0x1ffec4[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1ffec4[_0xaefd('0x1c')],function(_0x59aec9){return{'model':db[_0x59aec9[_0xaefd('0x1e')]],'as':_0x59aec9['as'],'attributes':_0x59aec9['attributes']};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x3498d9){logger[_0xaefd('0x14')](_0xaefd('0x1f'),_0x1b470c);logger[_0xaefd('0xd')](_0xaefd('0x1f'),_0x1b470c,JSON[_0xaefd('0xf')](_0x3498d9));_0x578378(_0x3498d9);})[_0xaefd('0x16')](function(_0x407bea){logger[_0xaefd('0x10')](_0xaefd('0x1f'),_0x407bea[_0xaefd('0x13')],_0x1b470c);_0x4ee0c1(_0x4a032d[_0xaefd('0x10')](0x1f4,_0x407bea[_0xaefd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 3db84d4..12f3e36 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 _0x036f=['create','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x036f,0x7a));var _0xf036=function(_0x58d8d7,_0x108377){_0x58d8d7=_0x58d8d7-0x0;var _0x339d20=_0x036f[_0x58d8d7];return _0x339d20;};'use strict';var multer=require('multer');var util=require(_0xf036('0x0'));var path=require(_0xf036('0x1'));var timeout=require(_0xf036('0x2'));var express=require('express');var router=express[_0xf036('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf036('0x4'));var interaction=require(_0xf036('0x5'));var config=require(_0xf036('0x6'));var controller=require(_0xf036('0x7'));router[_0xf036('0x8')]('/',auth[_0xf036('0x9')](),controller[_0xf036('0xa')]);router[_0xf036('0x8')](_0xf036('0xb'),auth[_0xf036('0x9')](),controller[_0xf036('0xc')]);router[_0xf036('0x8')](_0xf036('0xd'),auth['isAuthenticated'](),controller[_0xf036('0xe')]);router[_0xf036('0x8')](_0xf036('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf036('0x8')](_0xf036('0x10'),auth[_0xf036('0x9')](),controller['getDescriptions']);router[_0xf036('0x11')]('/',auth[_0xf036('0x9')](),controller[_0xf036('0x12')]);router['put'](_0xf036('0xb'),auth[_0xf036('0x9')](),controller['update']);router['delete'](_0xf036('0xb'),auth[_0xf036('0x9')](),controller[_0xf036('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2990=['index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x2990,0xe8));var _0x0299=function(_0x4c08a2,_0x3c808f){_0x4c08a2=_0x4c08a2-0x0;var _0x1f1fd6=_0x2990[_0x4c08a2];return _0x1f1fd6;};'use strict';var multer=require('multer');var util=require(_0x0299('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0299('0x1'));var router=express[_0x0299('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0299('0x3'));var config=require(_0x0299('0x4'));var controller=require(_0x0299('0x5'));router[_0x0299('0x6')]('/',auth[_0x0299('0x7')](),controller[_0x0299('0x8')]);router[_0x0299('0x6')](_0x0299('0x9'),auth[_0x0299('0x7')](),controller[_0x0299('0xa')]);router['get'](_0x0299('0xb'),auth[_0x0299('0x7')](),controller['getFields']);router[_0x0299('0x6')](_0x0299('0xc'),auth['isAuthenticated'](),controller[_0x0299('0xd')]);router[_0x0299('0x6')](_0x0299('0xe'),auth[_0x0299('0x7')](),controller[_0x0299('0xf')]);router[_0x0299('0x10')]('/',auth[_0x0299('0x7')](),controller['create']);router['put'](_0x0299('0x9'),auth[_0x0299('0x7')](),controller[_0x0299('0x11')]);router['delete'](_0x0299('0x9'),auth[_0x0299('0x7')](),controller[_0x0299('0x12')]);module[_0x0299('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index e4be0f3..ae5adc1 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 _0xdef1=['STRING','sequelize','exports'];(function(_0x12f737,_0x12679a){var _0x451cb2=function(_0x44fcf8){while(--_0x44fcf8){_0x12f737['push'](_0x12f737['shift']());}};_0x451cb2(++_0x12679a);}(_0xdef1,0x16f));var _0x1def=function(_0x1bb4b7,_0x33bd90){_0x1bb4b7=_0x1bb4b7-0x0;var _0x2c7daf=_0xdef1[_0x1bb4b7];return _0x2c7daf;};'use strict';var Sequelize=require(_0x1def('0x0'));module[_0x1def('0x1')]={'name':{'type':Sequelize[_0x1def('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x95b0=['exports','STRING','sequelize'];(function(_0x2ffe7e,_0x53f37d){var _0x22a4dd=function(_0x5ec338){while(--_0x5ec338){_0x2ffe7e['push'](_0x2ffe7e['shift']());}};_0x22a4dd(++_0x53f37d);}(_0x95b0,0x1a3));var _0x095b=function(_0x17f44a,_0xbc7c47){_0x17f44a=_0x17f44a-0x0;var _0x30530f=_0x95b0[_0x17f44a];return _0x30530f;};'use strict';var Sequelize=require(_0x095b('0x0'));module[_0x095b('0x1')]={'name':{'type':Sequelize[_0x095b('0x2')]},'description':{'type':Sequelize[_0x095b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 91457e2..af914c9 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 _0x18a5=['save','update','then','error','stack','name','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','VtigerConfiguration','includeAll','findAll','rows','show','params','include','find','catch','body','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range'];(function(_0x10ec15,_0x4ecd1f){var _0x4ce0b6=function(_0xef9325){while(--_0xef9325){_0x10ec15['push'](_0x10ec15['shift']());}};_0x4ce0b6(++_0x4ecd1f);}(_0x18a5,0x164));var _0x518a=function(_0x5068b7,_0x5b6769){_0x5068b7=_0x5068b7-0x0;var _0x7cc981=_0x18a5[_0x5068b7];return _0x7cc981;};'use strict';var emlformat=require(_0x518a('0x0'));var rimraf=require(_0x518a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x518a('0x2'));var moment=require('moment');var BPromise=require(_0x518a('0x3'));var Mustache=require(_0x518a('0x4'));var util=require(_0x518a('0x5'));var path=require(_0x518a('0x6'));var sox=require(_0x518a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x518a('0x8'));var squel=require(_0x518a('0x9'));var crypto=require(_0x518a('0xa'));var jsforce=require(_0x518a('0xb'));var deskjs=require(_0x518a('0xc'));var toCsv=require(_0x518a('0xd'));var querystring=require(_0x518a('0xe'));var Papa=require(_0x518a('0xf'));var Redis=require(_0x518a('0x10'));var authService=require(_0x518a('0x11'));var qs=require(_0x518a('0x12'));var as=require(_0x518a('0x13'));var hardwareService=require(_0x518a('0x14'));var logger=require(_0x518a('0x15'))(_0x518a('0x16'));var utils=require('../../config/utils');var config=require(_0x518a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x518a('0x18'))['db'];function respondWithStatusCode(_0x484d2e,_0x225187){_0x225187=_0x225187||0xcc;return function(_0x311f58){if(_0x311f58){return _0x484d2e[_0x518a('0x19')](_0x225187);}return _0x484d2e[_0x518a('0x1a')](_0x225187)[_0x518a('0x1b')]();};}function respondWithResult(_0x3e33c8,_0x3aa005){_0x3aa005=_0x3aa005||0xc8;return function(_0x583997){if(_0x583997){return _0x3e33c8[_0x518a('0x1a')](_0x3aa005)[_0x518a('0x1c')](_0x583997);}};}function respondWithFilteredResult(_0x95d482,_0x4ca80a){return function(_0x3b19ed){if(_0x3b19ed){var _0x301ecd=typeof _0x4ca80a['offset']==='undefined'&&typeof _0x4ca80a[_0x518a('0x1d')]==='undefined';var _0x3cf359=_0x3b19ed[_0x518a('0x1e')];var _0x244e66=_0x301ecd?0x0:_0x4ca80a[_0x518a('0x1f')];var _0xa5f6ac=_0x301ecd?_0x3b19ed[_0x518a('0x1e')]:_0x4ca80a[_0x518a('0x1f')]+_0x4ca80a[_0x518a('0x1d')];var _0xee7a42;if(_0xa5f6ac>=_0x3cf359){_0xa5f6ac=_0x3cf359;_0xee7a42=0xc8;}else{_0xee7a42=0xce;}_0x95d482[_0x518a('0x1a')](_0xee7a42);return _0x95d482[_0x518a('0x20')](_0x518a('0x21'),_0x244e66+'-'+_0xa5f6ac+'/'+_0x3cf359)[_0x518a('0x1c')](_0x3b19ed);}return null;};}function patchUpdates(_0x551ef7){return function(_0x152b49){try{jsonpatch['apply'](_0x152b49,_0x551ef7,!![]);}catch(_0x6b63c5){return BPromise['reject'](_0x6b63c5);}return _0x152b49[_0x518a('0x22')]();};}function saveUpdates(_0x8ed234,_0x3a857a){return function(_0x387c50){if(_0x387c50){return _0x387c50[_0x518a('0x23')](_0x8ed234)[_0x518a('0x24')](function(_0x4abb59){return _0x4abb59;});}return null;};}function removeEntity(_0x586f58,_0x590fc2){return function(_0x3b0f89){if(_0x3b0f89){return _0x3b0f89['destroy']()[_0x518a('0x24')](function(){_0x586f58[_0x518a('0x1a')](0xcc)[_0x518a('0x1b')]();});}};}function handleEntityNotFound(_0x941f58,_0x297d5d){return function(_0x1abf92){if(!_0x1abf92){_0x941f58[_0x518a('0x19')](0x194);}return _0x1abf92;};}function handleError(_0x16fae6,_0x1e4291){_0x1e4291=_0x1e4291||0x1f4;return function(_0x262260){logger[_0x518a('0x25')](_0x262260[_0x518a('0x26')]);if(_0x262260[_0x518a('0x27')]){delete _0x262260[_0x518a('0x27')];}_0x16fae6['status'](_0x1e4291)['send'](_0x262260);};}exports['index']=function(_0x112837,_0x3949c8){var _0x13abcc={},_0x4cf043={},_0x4aeccb={'count':0x0,'rows':[]};var _0x1b58e2=_['map'](db['VtigerConfiguration'][_0x518a('0x28')],function(_0x45d5dd){return{'name':_0x45d5dd['fieldName'],'type':_0x45d5dd['type'][_0x518a('0x29')]};});_0x4cf043[_0x518a('0x2a')]=_[_0x518a('0x2b')](_0x1b58e2,_0x518a('0x27'));_0x4cf043[_0x518a('0x2c')]=_[_0x518a('0x2d')](_0x112837[_0x518a('0x2c')]);_0x4cf043[_0x518a('0x2e')]=_['intersection'](_0x4cf043[_0x518a('0x2a')],_0x4cf043[_0x518a('0x2c')]);_0x13abcc['attributes']=_[_0x518a('0x2f')](_0x4cf043[_0x518a('0x2a')],qs[_0x518a('0x30')](_0x112837[_0x518a('0x2c')][_0x518a('0x30')]));_0x13abcc[_0x518a('0x31')]=_0x13abcc[_0x518a('0x31')][_0x518a('0x32')]?_0x13abcc['attributes']:_0x4cf043[_0x518a('0x2a')];if(!_0x112837['query'][_0x518a('0x33')](_0x518a('0x34'))){_0x13abcc[_0x518a('0x1d')]=qs[_0x518a('0x1d')](_0x112837['query']['limit']);_0x13abcc['offset']=qs['offset'](_0x112837[_0x518a('0x2c')][_0x518a('0x1f')]);}_0x13abcc[_0x518a('0x35')]=qs[_0x518a('0x36')](_0x112837[_0x518a('0x2c')][_0x518a('0x36')]);_0x13abcc[_0x518a('0x37')]=qs[_0x518a('0x2e')](_[_0x518a('0x38')](_0x112837[_0x518a('0x2c')],_0x4cf043[_0x518a('0x2e')]),_0x1b58e2);if(_0x112837[_0x518a('0x2c')][_0x518a('0x39')]){_0x13abcc[_0x518a('0x37')]=_['merge'](_0x13abcc[_0x518a('0x37')],{'$or':_[_0x518a('0x2b')](_0x1b58e2,function(_0x22c361){if(_0x22c361[_0x518a('0x3a')]!==_0x518a('0x3b')){var _0x1f5d4a={};_0x1f5d4a[_0x22c361[_0x518a('0x27')]]={'$like':'%'+_0x112837[_0x518a('0x2c')]['filter']+'%'};return _0x1f5d4a;}})});}_0x13abcc=_[_0x518a('0x3c')]({},_0x13abcc,_0x112837[_0x518a('0x3d')]);var _0x2c2714={'where':_0x13abcc[_0x518a('0x37')]};return db[_0x518a('0x3e')][_0x518a('0x1e')](_0x2c2714)[_0x518a('0x24')](function(_0x150d9f){_0x4aeccb[_0x518a('0x1e')]=_0x150d9f;if(_0x112837[_0x518a('0x2c')][_0x518a('0x3f')]){_0x13abcc['include']=[{'all':!![]}];}return db[_0x518a('0x3e')][_0x518a('0x40')](_0x13abcc);})['then'](function(_0x2a79b5){_0x4aeccb[_0x518a('0x41')]=_0x2a79b5;return _0x4aeccb;})[_0x518a('0x24')](respondWithFilteredResult(_0x3949c8,_0x13abcc))['catch'](handleError(_0x3949c8,null));};exports[_0x518a('0x42')]=function(_0x57cb2f,_0x4360ff){var _0x45e370={'raw':![],'where':{'id':_0x57cb2f[_0x518a('0x43')]['id']}},_0x58ad49={};_0x58ad49['model']=_['keys'](db[_0x518a('0x3e')][_0x518a('0x28')]);_0x58ad49[_0x518a('0x2c')]=_[_0x518a('0x2d')](_0x57cb2f[_0x518a('0x2c')]);_0x58ad49['filters']=_[_0x518a('0x2f')](_0x58ad49['model'],_0x58ad49['query']);_0x45e370[_0x518a('0x31')]=_[_0x518a('0x2f')](_0x58ad49[_0x518a('0x2a')],qs[_0x518a('0x30')](_0x57cb2f[_0x518a('0x2c')][_0x518a('0x30')]));_0x45e370['attributes']=_0x45e370[_0x518a('0x31')][_0x518a('0x32')]?_0x45e370[_0x518a('0x31')]:_0x58ad49['model'];if(_0x57cb2f[_0x518a('0x2c')]['includeAll']){_0x45e370[_0x518a('0x44')]=[{'all':!![]}];}_0x45e370=_[_0x518a('0x3c')]({},_0x45e370,_0x57cb2f[_0x518a('0x3d')]);return db[_0x518a('0x3e')][_0x518a('0x45')](_0x45e370)['then'](handleEntityNotFound(_0x4360ff,null))[_0x518a('0x24')](respondWithResult(_0x4360ff,null))[_0x518a('0x46')](handleError(_0x4360ff,null));};exports['create']=function(_0x2473bf,_0x5877e5){return db[_0x518a('0x3e')]['create'](_0x2473bf['body'],{})[_0x518a('0x24')](respondWithResult(_0x5877e5,0xc9))[_0x518a('0x46')](handleError(_0x5877e5,null));};exports[_0x518a('0x23')]=function(_0x46562e,_0x38c0d0){if(_0x46562e[_0x518a('0x47')]['id']){delete _0x46562e['body']['id'];}return db[_0x518a('0x3e')][_0x518a('0x45')]({'where':{'id':_0x46562e[_0x518a('0x43')]['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x38c0d0,null))[_0x518a('0x24')](saveUpdates(_0x46562e[_0x518a('0x47')],null))['then'](respondWithResult(_0x38c0d0,null))[_0x518a('0x46')](handleError(_0x38c0d0,null));};exports[_0x518a('0x48')]=function(_0x43acf8,_0x2ea7ef){return db['VtigerConfiguration']['find']({'where':{'id':_0x43acf8[_0x518a('0x43')]['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x2ea7ef,null))[_0x518a('0x24')](removeEntity(_0x2ea7ef,null))['catch'](handleError(_0x2ea7ef,null));};exports[_0x518a('0x49')]=function(_0xd27cca,_0x5f1981,_0x833ccb){var _0x248495={};var _0x3ca5f6={};var _0x4ea542;var _0x44cc91;return db[_0x518a('0x3e')][_0x518a('0x4a')]({'where':{'id':_0xd27cca['params']['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x5f1981,null))[_0x518a('0x24')](function(_0x2ad53e){if(_0x2ad53e){_0x4ea542=_0x2ad53e;_0x3ca5f6[_0x518a('0x2a')]=_[_0x518a('0x2d')](db[_0x518a('0x4b')][_0x518a('0x28')]);_0x3ca5f6['query']=_[_0x518a('0x2d')](_0xd27cca[_0x518a('0x2c')]);_0x3ca5f6['filters']=_['intersection'](_0x3ca5f6['model'],_0x3ca5f6['query']);_0x248495[_0x518a('0x31')]=_['intersection'](_0x3ca5f6[_0x518a('0x2a')],qs[_0x518a('0x30')](_0xd27cca['query'][_0x518a('0x30')]));_0x248495[_0x518a('0x31')]=_0x248495['attributes']['length']?_0x248495[_0x518a('0x31')]:_0x3ca5f6['model'];_0x248495[_0x518a('0x35')]=qs[_0x518a('0x36')](_0xd27cca[_0x518a('0x2c')][_0x518a('0x36')]);_0x248495['where']=qs[_0x518a('0x2e')](_[_0x518a('0x38')](_0xd27cca[_0x518a('0x2c')],_0x3ca5f6[_0x518a('0x2e')]));if(_0xd27cca[_0x518a('0x2c')][_0x518a('0x39')]){_0x248495[_0x518a('0x37')]=_[_0x518a('0x3c')](_0x248495[_0x518a('0x37')],{'$or':_[_0x518a('0x2b')](_0x248495[_0x518a('0x31')],function(_0x15ab82){var _0x28d0da={};_0x28d0da[_0x15ab82]={'$like':'%'+_0xd27cca[_0x518a('0x2c')]['filter']+'%'};return _0x28d0da;})});}_0x248495=_[_0x518a('0x3c')]({},_0x248495,_0xd27cca[_0x518a('0x3d')]);return _0x4ea542[_0x518a('0x49')](_0x248495);}})[_0x518a('0x24')](function(_0x3d2fa4){if(_0x3d2fa4){_0x44cc91=_0x3d2fa4[_0x518a('0x32')];if(!_0xd27cca[_0x518a('0x2c')][_0x518a('0x33')]('nolimit')){_0x248495[_0x518a('0x1d')]=qs[_0x518a('0x1d')](_0xd27cca[_0x518a('0x2c')][_0x518a('0x1d')]);_0x248495[_0x518a('0x1f')]=qs[_0x518a('0x1f')](_0xd27cca[_0x518a('0x2c')][_0x518a('0x1f')]);}return _0x4ea542[_0x518a('0x49')](_0x248495);}})[_0x518a('0x24')](function(_0x14c7f2){if(_0x14c7f2){return _0x14c7f2?{'count':_0x44cc91,'rows':_0x14c7f2}:null;}})[_0x518a('0x24')](respondWithResult(_0x5f1981,null))[_0x518a('0x46')](handleError(_0x5f1981,null));};exports[_0x518a('0x4c')]=function(_0x1e5f66,_0x531e6c,_0x35df5a){var _0x402d5a={};var _0x165c0c={};var _0xa48187;var _0x27d6c3;return db[_0x518a('0x3e')][_0x518a('0x4a')]({'where':{'id':_0x1e5f66[_0x518a('0x43')]['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x531e6c,null))[_0x518a('0x24')](function(_0x4033d0){if(_0x4033d0){_0xa48187=_0x4033d0;_0x165c0c['model']=_[_0x518a('0x2d')](db[_0x518a('0x4b')]['rawAttributes']);_0x165c0c['query']=_[_0x518a('0x2d')](_0x1e5f66[_0x518a('0x2c')]);_0x165c0c[_0x518a('0x2e')]=_[_0x518a('0x2f')](_0x165c0c[_0x518a('0x2a')],_0x165c0c[_0x518a('0x2c')]);_0x402d5a[_0x518a('0x31')]=_['intersection'](_0x165c0c[_0x518a('0x2a')],qs[_0x518a('0x30')](_0x1e5f66[_0x518a('0x2c')]['fields']));_0x402d5a['attributes']=_0x402d5a[_0x518a('0x31')][_0x518a('0x32')]?_0x402d5a[_0x518a('0x31')]:_0x165c0c[_0x518a('0x2a')];_0x402d5a[_0x518a('0x35')]=qs['sort'](_0x1e5f66[_0x518a('0x2c')]['sort']);_0x402d5a['where']=qs['filters'](_[_0x518a('0x38')](_0x1e5f66['query'],_0x165c0c['filters']));if(_0x1e5f66[_0x518a('0x2c')][_0x518a('0x39')]){_0x402d5a[_0x518a('0x37')]=_[_0x518a('0x3c')](_0x402d5a[_0x518a('0x37')],{'$or':_[_0x518a('0x2b')](_0x402d5a[_0x518a('0x31')],function(_0x598e1d){var _0x552f89={};_0x552f89[_0x598e1d]={'$like':'%'+_0x1e5f66['query']['filter']+'%'};return _0x552f89;})});}_0x402d5a=_[_0x518a('0x3c')]({},_0x402d5a,_0x1e5f66['options']);return _0xa48187['getSubjects'](_0x402d5a);}})[_0x518a('0x24')](function(_0x335cd2){if(_0x335cd2){_0x27d6c3=_0x335cd2[_0x518a('0x32')];if(!_0x1e5f66['query']['hasOwnProperty']('nolimit')){_0x402d5a['limit']=qs[_0x518a('0x1d')](_0x1e5f66[_0x518a('0x2c')][_0x518a('0x1d')]);_0x402d5a[_0x518a('0x1f')]=qs[_0x518a('0x1f')](_0x1e5f66['query']['offset']);}return _0xa48187[_0x518a('0x4c')](_0x402d5a);}})[_0x518a('0x24')](function(_0x3e742d){if(_0x3e742d){return _0x3e742d?{'count':_0x27d6c3,'rows':_0x3e742d}:null;}})[_0x518a('0x24')](respondWithResult(_0x531e6c,null))['catch'](handleError(_0x531e6c,null));};exports[_0x518a('0x4d')]=function(_0x21f853,_0x25559e,_0x5cd227){var _0x74a887={};var _0x466aa2={};var _0x42d1aa;var _0x203b0f;return db['VtigerConfiguration'][_0x518a('0x4a')]({'where':{'id':_0x21f853['params']['id']}})[_0x518a('0x24')](handleEntityNotFound(_0x25559e,null))[_0x518a('0x24')](function(_0x14ae8e){if(_0x14ae8e){_0x42d1aa=_0x14ae8e;_0x466aa2[_0x518a('0x2a')]=_[_0x518a('0x2d')](db['VtigerField'][_0x518a('0x28')]);_0x466aa2['query']=_[_0x518a('0x2d')](_0x21f853[_0x518a('0x2c')]);_0x466aa2[_0x518a('0x2e')]=_['intersection'](_0x466aa2[_0x518a('0x2a')],_0x466aa2[_0x518a('0x2c')]);_0x74a887[_0x518a('0x31')]=_['intersection'](_0x466aa2[_0x518a('0x2a')],qs[_0x518a('0x30')](_0x21f853[_0x518a('0x2c')][_0x518a('0x30')]));_0x74a887[_0x518a('0x31')]=_0x74a887['attributes'][_0x518a('0x32')]?_0x74a887[_0x518a('0x31')]:_0x466aa2[_0x518a('0x2a')];_0x74a887[_0x518a('0x35')]=qs[_0x518a('0x36')](_0x21f853[_0x518a('0x2c')][_0x518a('0x36')]);_0x74a887[_0x518a('0x37')]=qs['filters'](_['pick'](_0x21f853[_0x518a('0x2c')],_0x466aa2['filters']));if(_0x21f853['query'][_0x518a('0x39')]){_0x74a887[_0x518a('0x37')]=_[_0x518a('0x3c')](_0x74a887[_0x518a('0x37')],{'$or':_[_0x518a('0x2b')](_0x74a887['attributes'],function(_0x44ad5c){var _0x1a076f={};_0x1a076f[_0x44ad5c]={'$like':'%'+_0x21f853[_0x518a('0x2c')][_0x518a('0x39')]+'%'};return _0x1a076f;})});}_0x74a887=_[_0x518a('0x3c')]({},_0x74a887,_0x21f853[_0x518a('0x3d')]);return _0x42d1aa[_0x518a('0x4d')](_0x74a887);}})[_0x518a('0x24')](function(_0x3eb3fc){if(_0x3eb3fc){_0x203b0f=_0x3eb3fc['length'];if(!_0x21f853[_0x518a('0x2c')][_0x518a('0x33')]('nolimit')){_0x74a887['limit']=qs[_0x518a('0x1d')](_0x21f853[_0x518a('0x2c')][_0x518a('0x1d')]);_0x74a887['offset']=qs[_0x518a('0x1f')](_0x21f853[_0x518a('0x2c')][_0x518a('0x1f')]);}return _0x42d1aa['getDescriptions'](_0x74a887);}})['then'](function(_0x5ce2af){if(_0x5ce2af){return _0x5ce2af?{'count':_0x203b0f,'rows':_0x5ce2af}:null;}})['then'](respondWithResult(_0x25559e,null))[_0x518a('0x46')](handleError(_0x25559e,null));}; \ No newline at end of file +var _0xed8a=['VtigerConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','index','map'];(function(_0x1c29c3,_0x118ba0){var _0x361ea3=function(_0x28a0b4){while(--_0x28a0b4){_0x1c29c3['push'](_0x1c29c3['shift']());}};_0x361ea3(++_0x118ba0);}(_0xed8a,0xc5));var _0xaed8=function(_0x267a0a,_0x3a0404){_0x267a0a=_0x267a0a-0x0;var _0x221f07=_0xed8a[_0x267a0a];return _0x221f07;};'use strict';var emlformat=require(_0xaed8('0x0'));var rimraf=require(_0xaed8('0x1'));var zipdir=require(_0xaed8('0x2'));var jsonpatch=require(_0xaed8('0x3'));var rp=require('request-promise');var moment=require(_0xaed8('0x4'));var BPromise=require(_0xaed8('0x5'));var Mustache=require('mustache');var util=require(_0xaed8('0x6'));var path=require(_0xaed8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaed8('0x8'));var fs=require('fs');var fs_extra=require(_0xaed8('0x9'));var _=require(_0xaed8('0xa'));var squel=require(_0xaed8('0xb'));var crypto=require(_0xaed8('0xc'));var jsforce=require(_0xaed8('0xd'));var deskjs=require(_0xaed8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaed8('0xf'));var Papa=require(_0xaed8('0x10'));var Redis=require(_0xaed8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaed8('0x12'));var as=require(_0xaed8('0x13'));var hardwareService=require(_0xaed8('0x14'));var logger=require(_0xaed8('0x15'))(_0xaed8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaed8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eed24,_0x36c833){_0x36c833=_0x36c833||0xcc;return function(_0x129051){if(_0x129051){return _0x3eed24[_0xaed8('0x18')](_0x36c833);}return _0x3eed24['status'](_0x36c833)[_0xaed8('0x19')]();};}function respondWithResult(_0x273de5,_0x3a7aab){_0x3a7aab=_0x3a7aab||0xc8;return function(_0x248cd7){if(_0x248cd7){return _0x273de5[_0xaed8('0x1a')](_0x3a7aab)[_0xaed8('0x1b')](_0x248cd7);}};}function respondWithFilteredResult(_0x54ae7b,_0xefac0c){return function(_0x4a7448){if(_0x4a7448){var _0x4593c1=typeof _0xefac0c[_0xaed8('0x1c')]==='undefined'&&typeof _0xefac0c[_0xaed8('0x1d')]===_0xaed8('0x1e');var _0x1ef875=_0x4a7448[_0xaed8('0x1f')];var _0x427d37=_0x4593c1?0x0:_0xefac0c[_0xaed8('0x1c')];var _0x42eae7=_0x4593c1?_0x4a7448[_0xaed8('0x1f')]:_0xefac0c[_0xaed8('0x1c')]+_0xefac0c[_0xaed8('0x1d')];var _0x2d32ce;if(_0x42eae7>=_0x1ef875){_0x42eae7=_0x1ef875;_0x2d32ce=0xc8;}else{_0x2d32ce=0xce;}_0x54ae7b[_0xaed8('0x1a')](_0x2d32ce);return _0x54ae7b[_0xaed8('0x20')](_0xaed8('0x21'),_0x427d37+'-'+_0x42eae7+'/'+_0x1ef875)[_0xaed8('0x1b')](_0x4a7448);}return null;};}function patchUpdates(_0x48828f){return function(_0x5cd103){try{jsonpatch[_0xaed8('0x22')](_0x5cd103,_0x48828f,!![]);}catch(_0x5bafaf){return BPromise[_0xaed8('0x23')](_0x5bafaf);}return _0x5cd103[_0xaed8('0x24')]();};}function saveUpdates(_0x2ec32e,_0x344949){return function(_0x5a69aa){if(_0x5a69aa){return _0x5a69aa['update'](_0x2ec32e)['then'](function(_0x1a1acb){return _0x1a1acb;});}return null;};}function removeEntity(_0x4437aa,_0x448ef9){return function(_0x38a3f1){if(_0x38a3f1){return _0x38a3f1[_0xaed8('0x25')]()[_0xaed8('0x26')](function(){_0x4437aa[_0xaed8('0x1a')](0xcc)[_0xaed8('0x19')]();});}};}function handleEntityNotFound(_0x10c1fa,_0x57898b){return function(_0x33d3ea){if(!_0x33d3ea){_0x10c1fa[_0xaed8('0x18')](0x194);}return _0x33d3ea;};}function handleError(_0x32cd74,_0x14cd92){_0x14cd92=_0x14cd92||0x1f4;return function(_0x349736){logger[_0xaed8('0x27')](_0x349736['stack']);if(_0x349736[_0xaed8('0x28')]){delete _0x349736['name'];}_0x32cd74[_0xaed8('0x1a')](_0x14cd92)['send'](_0x349736);};}exports[_0xaed8('0x29')]=function(_0x4b25d9,_0x2fc145){var _0x475974={},_0x284c6a={},_0x601d8d={'count':0x0,'rows':[]};var _0x3dbe7e=_[_0xaed8('0x2a')](db[_0xaed8('0x2b')][_0xaed8('0x2c')],function(_0x16263d){return{'name':_0x16263d[_0xaed8('0x2d')],'type':_0x16263d['type'][_0xaed8('0x2e')]};});_0x284c6a[_0xaed8('0x2f')]=_[_0xaed8('0x2a')](_0x3dbe7e,_0xaed8('0x28'));_0x284c6a[_0xaed8('0x30')]=_['keys'](_0x4b25d9[_0xaed8('0x30')]);_0x284c6a[_0xaed8('0x31')]=_[_0xaed8('0x32')](_0x284c6a[_0xaed8('0x2f')],_0x284c6a[_0xaed8('0x30')]);_0x475974[_0xaed8('0x33')]=_['intersection'](_0x284c6a['model'],qs[_0xaed8('0x34')](_0x4b25d9[_0xaed8('0x30')][_0xaed8('0x34')]));_0x475974['attributes']=_0x475974['attributes'][_0xaed8('0x35')]?_0x475974[_0xaed8('0x33')]:_0x284c6a[_0xaed8('0x2f')];if(!_0x4b25d9['query'][_0xaed8('0x36')](_0xaed8('0x37'))){_0x475974[_0xaed8('0x1d')]=qs['limit'](_0x4b25d9[_0xaed8('0x30')][_0xaed8('0x1d')]);_0x475974[_0xaed8('0x1c')]=qs[_0xaed8('0x1c')](_0x4b25d9[_0xaed8('0x30')][_0xaed8('0x1c')]);}_0x475974[_0xaed8('0x38')]=qs[_0xaed8('0x39')](_0x4b25d9[_0xaed8('0x30')]['sort']);_0x475974[_0xaed8('0x3a')]=qs[_0xaed8('0x31')](_[_0xaed8('0x3b')](_0x4b25d9[_0xaed8('0x30')],_0x284c6a['filters']),_0x3dbe7e);if(_0x4b25d9[_0xaed8('0x30')][_0xaed8('0x3c')]){_0x475974[_0xaed8('0x3a')]=_[_0xaed8('0x3d')](_0x475974[_0xaed8('0x3a')],{'$or':_[_0xaed8('0x2a')](_0x3dbe7e,function(_0x2a7eca){if(_0x2a7eca[_0xaed8('0x3e')]!=='VIRTUAL'){var _0x429ad0={};_0x429ad0[_0x2a7eca[_0xaed8('0x28')]]={'$like':'%'+_0x4b25d9['query'][_0xaed8('0x3c')]+'%'};return _0x429ad0;}})});}_0x475974=_['merge']({},_0x475974,_0x4b25d9[_0xaed8('0x3f')]);var _0x47557e={'where':_0x475974['where']};return db[_0xaed8('0x2b')][_0xaed8('0x1f')](_0x47557e)['then'](function(_0x472cd5){_0x601d8d[_0xaed8('0x1f')]=_0x472cd5;if(_0x4b25d9['query'][_0xaed8('0x40')]){_0x475974[_0xaed8('0x41')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xaed8('0x42')](_0x475974);})['then'](function(_0x2aa6da){_0x601d8d[_0xaed8('0x43')]=_0x2aa6da;return _0x601d8d;})[_0xaed8('0x26')](respondWithFilteredResult(_0x2fc145,_0x475974))['catch'](handleError(_0x2fc145,null));};exports['show']=function(_0x285c9a,_0x263bc4){var _0x4ddb0f={'raw':![],'where':{'id':_0x285c9a[_0xaed8('0x44')]['id']}},_0x22ddd8={};_0x22ddd8[_0xaed8('0x2f')]=_[_0xaed8('0x45')](db[_0xaed8('0x2b')][_0xaed8('0x2c')]);_0x22ddd8[_0xaed8('0x30')]=_[_0xaed8('0x45')](_0x285c9a[_0xaed8('0x30')]);_0x22ddd8[_0xaed8('0x31')]=_['intersection'](_0x22ddd8[_0xaed8('0x2f')],_0x22ddd8['query']);_0x4ddb0f[_0xaed8('0x33')]=_[_0xaed8('0x32')](_0x22ddd8['model'],qs[_0xaed8('0x34')](_0x285c9a[_0xaed8('0x30')][_0xaed8('0x34')]));_0x4ddb0f['attributes']=_0x4ddb0f[_0xaed8('0x33')][_0xaed8('0x35')]?_0x4ddb0f['attributes']:_0x22ddd8[_0xaed8('0x2f')];if(_0x285c9a[_0xaed8('0x30')][_0xaed8('0x40')]){_0x4ddb0f[_0xaed8('0x41')]=[{'all':!![]}];}_0x4ddb0f=_[_0xaed8('0x3d')]({},_0x4ddb0f,_0x285c9a[_0xaed8('0x3f')]);return db['VtigerConfiguration'][_0xaed8('0x46')](_0x4ddb0f)[_0xaed8('0x26')](handleEntityNotFound(_0x263bc4,null))[_0xaed8('0x26')](respondWithResult(_0x263bc4,null))[_0xaed8('0x47')](handleError(_0x263bc4,null));};exports[_0xaed8('0x48')]=function(_0x1f6208,_0x560a69){return db[_0xaed8('0x2b')][_0xaed8('0x48')](_0x1f6208[_0xaed8('0x49')],{})[_0xaed8('0x26')](respondWithResult(_0x560a69,0xc9))[_0xaed8('0x47')](handleError(_0x560a69,null));};exports[_0xaed8('0x4a')]=function(_0x940feb,_0x26c015){if(_0x940feb[_0xaed8('0x49')]['id']){delete _0x940feb[_0xaed8('0x49')]['id'];}return db['VtigerConfiguration'][_0xaed8('0x46')]({'where':{'id':_0x940feb[_0xaed8('0x44')]['id']}})['then'](handleEntityNotFound(_0x26c015,null))[_0xaed8('0x26')](saveUpdates(_0x940feb[_0xaed8('0x49')],null))[_0xaed8('0x26')](respondWithResult(_0x26c015,null))['catch'](handleError(_0x26c015,null));};exports[_0xaed8('0x25')]=function(_0x3b6a26,_0x4a4eac){return db[_0xaed8('0x2b')][_0xaed8('0x46')]({'where':{'id':_0x3b6a26[_0xaed8('0x44')]['id']}})[_0xaed8('0x26')](handleEntityNotFound(_0x4a4eac,null))[_0xaed8('0x26')](removeEntity(_0x4a4eac,null))[_0xaed8('0x47')](handleError(_0x4a4eac,null));};exports[_0xaed8('0x4b')]=function(_0x5e8b3f,_0x1fa6a6,_0x1f40ff){var _0x4468d8={};var _0x45b03c={};var _0x14483d;var _0x143ce0;return db[_0xaed8('0x2b')][_0xaed8('0x4c')]({'where':{'id':_0x5e8b3f['params']['id']}})[_0xaed8('0x26')](handleEntityNotFound(_0x1fa6a6,null))[_0xaed8('0x26')](function(_0x2a713d){if(_0x2a713d){_0x14483d=_0x2a713d;_0x45b03c[_0xaed8('0x2f')]=_[_0xaed8('0x45')](db[_0xaed8('0x4d')][_0xaed8('0x2c')]);_0x45b03c[_0xaed8('0x30')]=_['keys'](_0x5e8b3f['query']);_0x45b03c[_0xaed8('0x31')]=_[_0xaed8('0x32')](_0x45b03c[_0xaed8('0x2f')],_0x45b03c[_0xaed8('0x30')]);_0x4468d8[_0xaed8('0x33')]=_[_0xaed8('0x32')](_0x45b03c[_0xaed8('0x2f')],qs[_0xaed8('0x34')](_0x5e8b3f[_0xaed8('0x30')][_0xaed8('0x34')]));_0x4468d8[_0xaed8('0x33')]=_0x4468d8[_0xaed8('0x33')][_0xaed8('0x35')]?_0x4468d8[_0xaed8('0x33')]:_0x45b03c[_0xaed8('0x2f')];_0x4468d8['order']=qs[_0xaed8('0x39')](_0x5e8b3f[_0xaed8('0x30')][_0xaed8('0x39')]);_0x4468d8[_0xaed8('0x3a')]=qs['filters'](_[_0xaed8('0x3b')](_0x5e8b3f['query'],_0x45b03c[_0xaed8('0x31')]));if(_0x5e8b3f[_0xaed8('0x30')][_0xaed8('0x3c')]){_0x4468d8[_0xaed8('0x3a')]=_[_0xaed8('0x3d')](_0x4468d8[_0xaed8('0x3a')],{'$or':_[_0xaed8('0x2a')](_0x4468d8[_0xaed8('0x33')],function(_0x39c64c){var _0x35900f={};_0x35900f[_0x39c64c]={'$like':'%'+_0x5e8b3f['query'][_0xaed8('0x3c')]+'%'};return _0x35900f;})});}_0x4468d8=_[_0xaed8('0x3d')]({},_0x4468d8,_0x5e8b3f['options']);return _0x14483d[_0xaed8('0x4b')](_0x4468d8);}})[_0xaed8('0x26')](function(_0x507f53){if(_0x507f53){_0x143ce0=_0x507f53[_0xaed8('0x35')];if(!_0x5e8b3f['query'][_0xaed8('0x36')]('nolimit')){_0x4468d8[_0xaed8('0x1d')]=qs['limit'](_0x5e8b3f[_0xaed8('0x30')][_0xaed8('0x1d')]);_0x4468d8[_0xaed8('0x1c')]=qs['offset'](_0x5e8b3f['query'][_0xaed8('0x1c')]);}return _0x14483d[_0xaed8('0x4b')](_0x4468d8);}})[_0xaed8('0x26')](function(_0x5c3f74){if(_0x5c3f74){return _0x5c3f74?{'count':_0x143ce0,'rows':_0x5c3f74}:null;}})[_0xaed8('0x26')](respondWithResult(_0x1fa6a6,null))['catch'](handleError(_0x1fa6a6,null));};exports[_0xaed8('0x4e')]=function(_0x22e934,_0x136cae,_0x5320c2){var _0xbed924={};var _0x29e278={};var _0x52fdfe;var _0x343388;return db['VtigerConfiguration'][_0xaed8('0x4c')]({'where':{'id':_0x22e934[_0xaed8('0x44')]['id']}})[_0xaed8('0x26')](handleEntityNotFound(_0x136cae,null))[_0xaed8('0x26')](function(_0x2acaaa){if(_0x2acaaa){_0x52fdfe=_0x2acaaa;_0x29e278[_0xaed8('0x2f')]=_[_0xaed8('0x45')](db['VtigerField'][_0xaed8('0x2c')]);_0x29e278[_0xaed8('0x30')]=_['keys'](_0x22e934['query']);_0x29e278['filters']=_['intersection'](_0x29e278[_0xaed8('0x2f')],_0x29e278[_0xaed8('0x30')]);_0xbed924[_0xaed8('0x33')]=_[_0xaed8('0x32')](_0x29e278[_0xaed8('0x2f')],qs[_0xaed8('0x34')](_0x22e934[_0xaed8('0x30')][_0xaed8('0x34')]));_0xbed924[_0xaed8('0x33')]=_0xbed924[_0xaed8('0x33')][_0xaed8('0x35')]?_0xbed924[_0xaed8('0x33')]:_0x29e278['model'];_0xbed924[_0xaed8('0x38')]=qs[_0xaed8('0x39')](_0x22e934[_0xaed8('0x30')][_0xaed8('0x39')]);_0xbed924['where']=qs[_0xaed8('0x31')](_[_0xaed8('0x3b')](_0x22e934[_0xaed8('0x30')],_0x29e278[_0xaed8('0x31')]));if(_0x22e934[_0xaed8('0x30')]['filter']){_0xbed924[_0xaed8('0x3a')]=_[_0xaed8('0x3d')](_0xbed924[_0xaed8('0x3a')],{'$or':_[_0xaed8('0x2a')](_0xbed924[_0xaed8('0x33')],function(_0x285522){var _0x42caf8={};_0x42caf8[_0x285522]={'$like':'%'+_0x22e934[_0xaed8('0x30')][_0xaed8('0x3c')]+'%'};return _0x42caf8;})});}_0xbed924=_[_0xaed8('0x3d')]({},_0xbed924,_0x22e934[_0xaed8('0x3f')]);return _0x52fdfe[_0xaed8('0x4e')](_0xbed924);}})['then'](function(_0x3ec645){if(_0x3ec645){_0x343388=_0x3ec645['length'];if(!_0x22e934[_0xaed8('0x30')][_0xaed8('0x36')](_0xaed8('0x37'))){_0xbed924['limit']=qs[_0xaed8('0x1d')](_0x22e934['query'][_0xaed8('0x1d')]);_0xbed924[_0xaed8('0x1c')]=qs[_0xaed8('0x1c')](_0x22e934['query'][_0xaed8('0x1c')]);}return _0x52fdfe[_0xaed8('0x4e')](_0xbed924);}})['then'](function(_0x3715b6){if(_0x3715b6){return _0x3715b6?{'count':_0x343388,'rows':_0x3715b6}:null;}})[_0xaed8('0x26')](respondWithResult(_0x136cae,null))['catch'](handleError(_0x136cae,null));};exports[_0xaed8('0x4f')]=function(_0x40152,_0x5c0047,_0xeb69a1){var _0x422f3c={};var _0x48f7a0={};var _0x46ebe6;var _0x327d3f;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x40152[_0xaed8('0x44')]['id']}})[_0xaed8('0x26')](handleEntityNotFound(_0x5c0047,null))[_0xaed8('0x26')](function(_0x1cd180){if(_0x1cd180){_0x46ebe6=_0x1cd180;_0x48f7a0['model']=_[_0xaed8('0x45')](db[_0xaed8('0x4d')][_0xaed8('0x2c')]);_0x48f7a0[_0xaed8('0x30')]=_[_0xaed8('0x45')](_0x40152[_0xaed8('0x30')]);_0x48f7a0[_0xaed8('0x31')]=_['intersection'](_0x48f7a0[_0xaed8('0x2f')],_0x48f7a0[_0xaed8('0x30')]);_0x422f3c[_0xaed8('0x33')]=_[_0xaed8('0x32')](_0x48f7a0[_0xaed8('0x2f')],qs['fields'](_0x40152[_0xaed8('0x30')][_0xaed8('0x34')]));_0x422f3c[_0xaed8('0x33')]=_0x422f3c[_0xaed8('0x33')][_0xaed8('0x35')]?_0x422f3c[_0xaed8('0x33')]:_0x48f7a0[_0xaed8('0x2f')];_0x422f3c[_0xaed8('0x38')]=qs[_0xaed8('0x39')](_0x40152[_0xaed8('0x30')][_0xaed8('0x39')]);_0x422f3c['where']=qs[_0xaed8('0x31')](_['pick'](_0x40152['query'],_0x48f7a0[_0xaed8('0x31')]));if(_0x40152[_0xaed8('0x30')][_0xaed8('0x3c')]){_0x422f3c[_0xaed8('0x3a')]=_['merge'](_0x422f3c[_0xaed8('0x3a')],{'$or':_[_0xaed8('0x2a')](_0x422f3c['attributes'],function(_0x125a52){var _0x2b5a5a={};_0x2b5a5a[_0x125a52]={'$like':'%'+_0x40152['query'][_0xaed8('0x3c')]+'%'};return _0x2b5a5a;})});}_0x422f3c=_['merge']({},_0x422f3c,_0x40152[_0xaed8('0x3f')]);return _0x46ebe6[_0xaed8('0x4f')](_0x422f3c);}})['then'](function(_0x458f41){if(_0x458f41){_0x327d3f=_0x458f41[_0xaed8('0x35')];if(!_0x40152[_0xaed8('0x30')][_0xaed8('0x36')](_0xaed8('0x37'))){_0x422f3c[_0xaed8('0x1d')]=qs['limit'](_0x40152[_0xaed8('0x30')][_0xaed8('0x1d')]);_0x422f3c['offset']=qs[_0xaed8('0x1c')](_0x40152['query'][_0xaed8('0x1c')]);}return _0x46ebe6[_0xaed8('0x4f')](_0x422f3c);}})[_0xaed8('0x26')](function(_0xe8e844){if(_0xe8e844){return _0xe8e844?{'count':_0x327d3f,'rows':_0xe8e844}:null;}})['then'](respondWithResult(_0x5c0047,null))['catch'](handleError(_0x5c0047,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 0089b3b..14770ca 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 _0x47f9=['exports','define','int_vtiger_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x33b520,_0x251c55){var _0x1a9e40=function(_0x43dd92){while(--_0x43dd92){_0x33b520['push'](_0x33b520['shift']());}};_0x1a9e40(++_0x251c55);}(_0x47f9,0xe7));var _0x947f=function(_0x77fbf8,_0x31cf3f){_0x77fbf8=_0x77fbf8-0x0;var _0x2df250=_0x47f9[_0x77fbf8];return _0x2df250;};'use strict';var _=require(_0x947f('0x0'));var util=require('util');var logger=require(_0x947f('0x1'))(_0x947f('0x2'));var moment=require(_0x947f('0x3'));var BPromise=require('bluebird');var rp=require(_0x947f('0x4'));var fs=require('fs');var path=require(_0x947f('0x5'));var rimraf=require(_0x947f('0x6'));var config=require(_0x947f('0x7'));var attributes=require(_0x947f('0x8'));module[_0x947f('0x9')]=function(_0x94976b,_0x15b4a7){return _0x94976b[_0x947f('0xa')]('VtigerConfiguration',attributes,{'tableName':_0x947f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a38=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0x512075,_0xb26216){var _0x56fe7e=function(_0xcf6c6b){while(--_0xcf6c6b){_0x512075['push'](_0x512075['shift']());}};_0x56fe7e(++_0xb26216);}(_0x2a38,0x8d));var _0x82a3=function(_0x1f0c1c,_0x2c39cf){_0x1f0c1c=_0x1f0c1c-0x0;var _0x155e88=_0x2a38[_0x1f0c1c];return _0x155e88;};'use strict';var _=require(_0x82a3('0x0'));var util=require(_0x82a3('0x1'));var logger=require(_0x82a3('0x2'))(_0x82a3('0x3'));var moment=require(_0x82a3('0x4'));var BPromise=require(_0x82a3('0x5'));var rp=require(_0x82a3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x82a3('0x7'));var attributes=require(_0x82a3('0x8'));module[_0x82a3('0x9')]=function(_0x32c273,_0x20255e){return _0x32c273[_0x82a3('0xa')](_0x82a3('0xb'),attributes,{'tableName':_0x82a3('0xc'),'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 d7ea677..6642bd0 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 _0xecce=['client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x510aac,_0x18d1b6){var _0x2d2a51=function(_0x4c55f9){while(--_0x4c55f9){_0x510aac['push'](_0x510aac['shift']());}};_0x2d2a51(++_0x18d1b6);}(_0xecce,0xbd));var _0xeecc=function(_0x495f0b,_0x499f83){_0x495f0b=_0x495f0b-0x0;var _0xef44be=_0xecce[_0x495f0b];return _0xef44be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeecc('0x0'));var BPromise=require(_0xeecc('0x1'));var rs=require(_0xeecc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeecc('0x3'))['db'];var utils=require(_0xeecc('0x4'));var logger=require(_0xeecc('0x5'))(_0xeecc('0x6'));var config=require(_0xeecc('0x7'));var jayson=require(_0xeecc('0x8'));var client=jayson[_0xeecc('0x9')][_0xeecc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x80f2ad,_0x64eb4e,_0x3000f3){return new BPromise(function(_0x4027bf,_0x1e61d8){return client[_0xeecc('0xb')](_0x80f2ad,_0x3000f3)[_0xeecc('0xc')](function(_0x515368){logger[_0xeecc('0xd')](_0xeecc('0xe'),_0x64eb4e,_0xeecc('0xf'));logger['debug'](_0xeecc('0x10'),_0x64eb4e,_0xeecc('0xf'),JSON[_0xeecc('0x11')](_0x515368));if(_0x515368[_0xeecc('0x12')]){if(_0x515368['error'][_0xeecc('0x13')]===0x1f4){logger['error'](_0xeecc('0xe'),_0x64eb4e,_0x515368['error'][_0xeecc('0x14')]);return _0x1e61d8(_0x515368[_0xeecc('0x12')]['message']);}logger[_0xeecc('0x12')](_0xeecc('0xe'),_0x64eb4e,_0x515368[_0xeecc('0x12')][_0xeecc('0x14')]);return _0x4027bf(_0x515368['error'][_0xeecc('0x14')]);}else{logger[_0xeecc('0xd')](_0xeecc('0xe'),_0x64eb4e,'request\x20sent');_0x4027bf(_0x515368['result'][_0xeecc('0x14')]);}})[_0xeecc('0x15')](function(_0x4c991a){logger[_0xeecc('0x12')](_0xeecc('0xe'),_0x64eb4e,_0x4c991a);_0x1e61d8(_0x4c991a);});});} \ No newline at end of file +var _0x4ce2=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x28b98c,_0x5bf1a0){var _0x54ca6b=function(_0x2eabcd){while(--_0x2eabcd){_0x28b98c['push'](_0x28b98c['shift']());}};_0x54ca6b(++_0x5bf1a0);}(_0x4ce2,0xe8));var _0x24ce=function(_0x58a658,_0x42951e){_0x58a658=_0x58a658-0x0;var _0x4cc536=_0x4ce2[_0x58a658];return _0x4cc536;};'use strict';var _=require('lodash');var util=require(_0x24ce('0x0'));var moment=require(_0x24ce('0x1'));var BPromise=require(_0x24ce('0x2'));var rs=require(_0x24ce('0x3'));var fs=require('fs');var Redis=require(_0x24ce('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x24ce('0x5'));var logger=require(_0x24ce('0x6'))('rpc');var config=require(_0x24ce('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x24ce('0x8')][_0x24ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191006,_0x15f482,_0x4fa1de){return new BPromise(function(_0x9790ca,_0x37d955){return client[_0x24ce('0xa')](_0x191006,_0x4fa1de)['then'](function(_0x41623d){logger[_0x24ce('0xb')](_0x24ce('0xc'),_0x15f482,_0x24ce('0xd'));logger[_0x24ce('0xe')](_0x24ce('0xf'),_0x15f482,'request\x20sent',JSON[_0x24ce('0x10')](_0x41623d));if(_0x41623d['error']){if(_0x41623d[_0x24ce('0x11')][_0x24ce('0x12')]===0x1f4){logger[_0x24ce('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x15f482,_0x41623d['error'][_0x24ce('0x13')]);return _0x37d955(_0x41623d[_0x24ce('0x11')][_0x24ce('0x13')]);}logger[_0x24ce('0x11')](_0x24ce('0xc'),_0x15f482,_0x41623d['error']['message']);return _0x9790ca(_0x41623d['error'][_0x24ce('0x13')]);}else{logger[_0x24ce('0xb')](_0x24ce('0xc'),_0x15f482,'request\x20sent');_0x9790ca(_0x41623d['result'][_0x24ce('0x13')]);}})[_0x24ce('0x14')](function(_0xf30511){logger['error'](_0x24ce('0xc'),_0x15f482,_0xf30511);_0x37d955(_0xf30511);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 2518490..46424c0 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 _0x64b2=['get','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','./intVtigerField.controller','isAuthenticated','index'];(function(_0x363b89,_0x2f2e75){var _0x2ffc54=function(_0x314260){while(--_0x314260){_0x363b89['push'](_0x363b89['shift']());}};_0x2ffc54(++_0x2f2e75);}(_0x64b2,0x129));var _0x264b=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x64b2[_0x5834bc];return _0x3e183a;};'use strict';var multer=require(_0x264b('0x0'));var util=require(_0x264b('0x1'));var path=require(_0x264b('0x2'));var timeout=require(_0x264b('0x3'));var express=require(_0x264b('0x4'));var router=express[_0x264b('0x5')]();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(_0x264b('0x6'));router['get']('/',auth[_0x264b('0x7')](),controller[_0x264b('0x8')]);router[_0x264b('0x9')](_0x264b('0xa'),auth[_0x264b('0x7')](),controller['show']);router[_0x264b('0xb')]('/',auth[_0x264b('0x7')](),controller['create']);router[_0x264b('0xc')](_0x264b('0xa'),auth['isAuthenticated'](),controller[_0x264b('0xd')]);router[_0x264b('0xe')](_0x264b('0xa'),auth[_0x264b('0x7')](),controller[_0x264b('0xf')]);module[_0x264b('0x10')]=router; \ No newline at end of file +var _0xc091=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','post','put','/:id','delete','destroy','multer','util','path'];(function(_0xe482c2,_0x5198ae){var _0x5ddb21=function(_0x143cf8){while(--_0x143cf8){_0xe482c2['push'](_0xe482c2['shift']());}};_0x5ddb21(++_0x5198ae);}(_0xc091,0x1c5));var _0x1c09=function(_0x145995,_0x4c8300){_0x145995=_0x145995-0x0;var _0x5aafd2=_0xc091[_0x145995];return _0x5aafd2;};'use strict';var multer=require(_0x1c09('0x0'));var util=require(_0x1c09('0x1'));var path=require(_0x1c09('0x2'));var timeout=require(_0x1c09('0x3'));var express=require(_0x1c09('0x4'));var router=express[_0x1c09('0x5')]();var fs_extra=require(_0x1c09('0x6'));var auth=require(_0x1c09('0x7'));var interaction=require(_0x1c09('0x8'));var config=require(_0x1c09('0x9'));var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1c09('0xa')]);router[_0x1c09('0xb')]('/:id',auth[_0x1c09('0xc')](),controller[_0x1c09('0xd')]);router[_0x1c09('0xe')]('/',auth[_0x1c09('0xc')](),controller['create']);router[_0x1c09('0xf')](_0x1c09('0x10'),auth[_0x1c09('0xc')](),controller['update']);router[_0x1c09('0x11')]('/:id',auth[_0x1c09('0xc')](),controller[_0x1c09('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index a2a4304..1880a38 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 _0x1bdb=['keyValue','string','STRING','variable','BOOLEAN','exports','ENUM','customVariable'];(function(_0x32c0dc,_0x2d16bb){var _0xbb5fb3=function(_0x1e57a6){while(--_0x1e57a6){_0x32c0dc['push'](_0x32c0dc['shift']());}};_0xbb5fb3(++_0x2d16bb);}(_0x1bdb,0x1dd));var _0xb1bd=function(_0x1e58e5,_0x414034){_0x1e58e5=_0x1e58e5-0x0;var _0x3b7576=_0x1bdb[_0x1e58e5];return _0x3b7576;};'use strict';var Sequelize=require('sequelize');module[_0xb1bd('0x0')]={'type':{'type':Sequelize[_0xb1bd('0x1')]('string','variable',_0xb1bd('0x2'),_0xb1bd('0x3'),'picklist'),'defaultValue':_0xb1bd('0x4')},'content':{'type':Sequelize[_0xb1bd('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb1bd('0x1')](_0xb1bd('0x4'),_0xb1bd('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xb1bd('0x5')]},'idField':{'type':Sequelize[_0xb1bd('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb1bd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x374b=['string','keyValue','STRING','ENUM','variable','customVariable','BOOLEAN','exports'];(function(_0x341717,_0x1fd63e){var _0x5cb9e0=function(_0x7ac903){while(--_0x7ac903){_0x341717['push'](_0x341717['shift']());}};_0x5cb9e0(++_0x1fd63e);}(_0x374b,0x167));var _0xb374=function(_0x135866,_0x2f70ce){_0x135866=_0x135866-0x0;var _0x2223d9=_0x374b[_0x135866];return _0x2223d9;};'use strict';var Sequelize=require('sequelize');module[_0xb374('0x0')]={'type':{'type':Sequelize['ENUM'](_0xb374('0x1'),'variable','customVariable',_0xb374('0x2'),'picklist'),'defaultValue':_0xb374('0x1')},'content':{'type':Sequelize[_0xb374('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb374('0x4')](_0xb374('0x1'),_0xb374('0x5'),_0xb374('0x6'))},'keyContent':{'type':Sequelize[_0xb374('0x3')]},'idField':{'type':Sequelize[_0xb374('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb374('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb374('0x3')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 7562aca..def1653 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 _0x4b27=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','VtigerField','type','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b27,0x19f));var _0x74b2=function(_0x351a39,_0x42326c){_0x351a39=_0x351a39-0x0;var _0x255618=_0x4b27[_0x351a39];return _0x255618;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74b2('0x1'));var rp=require(_0x74b2('0x2'));var moment=require(_0x74b2('0x3'));var BPromise=require(_0x74b2('0x4'));var Mustache=require(_0x74b2('0x5'));var util=require(_0x74b2('0x6'));var path=require(_0x74b2('0x7'));var sox=require('sox');var csv=require(_0x74b2('0x8'));var ejs=require(_0x74b2('0x9'));var fs=require('fs');var fs_extra=require(_0x74b2('0xa'));var _=require(_0x74b2('0xb'));var squel=require(_0x74b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x74b2('0xd'));var deskjs=require(_0x74b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x74b2('0xf'));var Papa=require(_0x74b2('0x10'));var Redis=require('ioredis');var authService=require(_0x74b2('0x11'));var qs=require(_0x74b2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74b2('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x74b2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554cda,_0x4476c3){_0x4476c3=_0x4476c3||0xcc;return function(_0x5909c0){if(_0x5909c0){return _0x554cda[_0x74b2('0x15')](_0x4476c3);}return _0x554cda['status'](_0x4476c3)[_0x74b2('0x16')]();};}function respondWithResult(_0xb80845,_0x1e450b){_0x1e450b=_0x1e450b||0xc8;return function(_0x397be7){if(_0x397be7){return _0xb80845[_0x74b2('0x17')](_0x1e450b)[_0x74b2('0x18')](_0x397be7);}};}function respondWithFilteredResult(_0x160393,_0x21864a){return function(_0x285430){if(_0x285430){var _0x35ebbf=typeof _0x21864a['offset']==='undefined'&&typeof _0x21864a[_0x74b2('0x19')]===_0x74b2('0x1a');var _0x3368c2=_0x285430[_0x74b2('0x1b')];var _0x14879f=_0x35ebbf?0x0:_0x21864a[_0x74b2('0x1c')];var _0x3f1ad4=_0x35ebbf?_0x285430['count']:_0x21864a['offset']+_0x21864a[_0x74b2('0x19')];var _0x3be14c;if(_0x3f1ad4>=_0x3368c2){_0x3f1ad4=_0x3368c2;_0x3be14c=0xc8;}else{_0x3be14c=0xce;}_0x160393['status'](_0x3be14c);return _0x160393[_0x74b2('0x1d')](_0x74b2('0x1e'),_0x14879f+'-'+_0x3f1ad4+'/'+_0x3368c2)['json'](_0x285430);}return null;};}function patchUpdates(_0x25dfc6){return function(_0xaf0734){try{jsonpatch[_0x74b2('0x1f')](_0xaf0734,_0x25dfc6,!![]);}catch(_0x59ec95){return BPromise[_0x74b2('0x20')](_0x59ec95);}return _0xaf0734['save']();};}function saveUpdates(_0x3d85d9,_0x544953){return function(_0x3fb96d){if(_0x3fb96d){return _0x3fb96d[_0x74b2('0x21')](_0x3d85d9)[_0x74b2('0x22')](function(_0xa8bf4b){return _0xa8bf4b;});}return null;};}function removeEntity(_0x24deea,_0x2e9c25){return function(_0x4479cc){if(_0x4479cc){return _0x4479cc[_0x74b2('0x23')]()[_0x74b2('0x22')](function(){_0x24deea['status'](0xcc)[_0x74b2('0x16')]();});}};}function handleEntityNotFound(_0x370ac9,_0xbdcc94){return function(_0x5ec93a){if(!_0x5ec93a){_0x370ac9[_0x74b2('0x15')](0x194);}return _0x5ec93a;};}function handleError(_0x39a21f,_0x80be03){_0x80be03=_0x80be03||0x1f4;return function(_0x333491){logger[_0x74b2('0x24')](_0x333491[_0x74b2('0x25')]);if(_0x333491[_0x74b2('0x26')]){delete _0x333491['name'];}_0x39a21f['status'](_0x80be03)['send'](_0x333491);};}exports[_0x74b2('0x27')]=function(_0x27250a,_0x4feaf4){var _0x344587={},_0x1b611e={},_0x2fa322={'count':0x0,'rows':[]};var _0x39bda7=_['map'](db[_0x74b2('0x28')]['rawAttributes'],function(_0x3232fa){return{'name':_0x3232fa['fieldName'],'type':_0x3232fa[_0x74b2('0x29')]['key']};});_0x1b611e['model']=_[_0x74b2('0x2a')](_0x39bda7,'name');_0x1b611e[_0x74b2('0x2b')]=_[_0x74b2('0x2c')](_0x27250a['query']);_0x1b611e[_0x74b2('0x2d')]=_['intersection'](_0x1b611e[_0x74b2('0x2e')],_0x1b611e[_0x74b2('0x2b')]);_0x344587['attributes']=_[_0x74b2('0x2f')](_0x1b611e[_0x74b2('0x2e')],qs[_0x74b2('0x30')](_0x27250a['query'][_0x74b2('0x30')]));_0x344587['attributes']=_0x344587[_0x74b2('0x31')]['length']?_0x344587['attributes']:_0x1b611e['model'];if(!_0x27250a[_0x74b2('0x2b')][_0x74b2('0x32')](_0x74b2('0x33'))){_0x344587[_0x74b2('0x19')]=qs[_0x74b2('0x19')](_0x27250a[_0x74b2('0x2b')][_0x74b2('0x19')]);_0x344587[_0x74b2('0x1c')]=qs[_0x74b2('0x1c')](_0x27250a[_0x74b2('0x2b')][_0x74b2('0x1c')]);}_0x344587['order']=qs[_0x74b2('0x34')](_0x27250a['query']['sort']);_0x344587['where']=qs[_0x74b2('0x2d')](_['pick'](_0x27250a['query'],_0x1b611e['filters']),_0x39bda7);if(_0x27250a[_0x74b2('0x2b')][_0x74b2('0x35')]){_0x344587[_0x74b2('0x36')]=_['merge'](_0x344587[_0x74b2('0x36')],{'$or':_[_0x74b2('0x2a')](_0x39bda7,function(_0x4d81cd){if(_0x4d81cd[_0x74b2('0x29')]!==_0x74b2('0x37')){var _0x285545={};_0x285545[_0x4d81cd['name']]={'$like':'%'+_0x27250a[_0x74b2('0x2b')][_0x74b2('0x35')]+'%'};return _0x285545;}})});}_0x344587=_[_0x74b2('0x38')]({},_0x344587,_0x27250a[_0x74b2('0x39')]);var _0x480f75={'where':_0x344587['where']};return db[_0x74b2('0x28')][_0x74b2('0x1b')](_0x480f75)[_0x74b2('0x22')](function(_0x3988d6){_0x2fa322[_0x74b2('0x1b')]=_0x3988d6;if(_0x27250a['query'][_0x74b2('0x3a')]){_0x344587[_0x74b2('0x3b')]=[{'all':!![]}];}return db[_0x74b2('0x28')][_0x74b2('0x3c')](_0x344587);})[_0x74b2('0x22')](function(_0x150358){_0x2fa322[_0x74b2('0x3d')]=_0x150358;return _0x2fa322;})[_0x74b2('0x22')](respondWithFilteredResult(_0x4feaf4,_0x344587))[_0x74b2('0x3e')](handleError(_0x4feaf4,null));};exports[_0x74b2('0x3f')]=function(_0xf4e60b,_0x592636){var _0x2fe4af={'raw':!![],'where':{'id':_0xf4e60b[_0x74b2('0x40')]['id']}},_0x82d1fb={};_0x82d1fb[_0x74b2('0x2e')]=_['keys'](db[_0x74b2('0x28')][_0x74b2('0x41')]);_0x82d1fb[_0x74b2('0x2b')]=_[_0x74b2('0x2c')](_0xf4e60b['query']);_0x82d1fb[_0x74b2('0x2d')]=_[_0x74b2('0x2f')](_0x82d1fb[_0x74b2('0x2e')],_0x82d1fb[_0x74b2('0x2b')]);_0x2fe4af[_0x74b2('0x31')]=_[_0x74b2('0x2f')](_0x82d1fb['model'],qs['fields'](_0xf4e60b['query'][_0x74b2('0x30')]));_0x2fe4af[_0x74b2('0x31')]=_0x2fe4af[_0x74b2('0x31')][_0x74b2('0x42')]?_0x2fe4af[_0x74b2('0x31')]:_0x82d1fb[_0x74b2('0x2e')];if(_0xf4e60b['query']['includeAll']){_0x2fe4af['include']=[{'all':!![]}];}_0x2fe4af=_[_0x74b2('0x38')]({},_0x2fe4af,_0xf4e60b[_0x74b2('0x39')]);return db[_0x74b2('0x28')][_0x74b2('0x43')](_0x2fe4af)['then'](handleEntityNotFound(_0x592636,null))['then'](respondWithResult(_0x592636,null))[_0x74b2('0x3e')](handleError(_0x592636,null));};exports[_0x74b2('0x44')]=function(_0x529a86,_0x52204f){return db[_0x74b2('0x28')][_0x74b2('0x44')](_0x529a86[_0x74b2('0x45')],{})[_0x74b2('0x22')](respondWithResult(_0x52204f,0xc9))['catch'](handleError(_0x52204f,null));};exports[_0x74b2('0x21')]=function(_0x1a599f,_0x56bd81){if(_0x1a599f[_0x74b2('0x45')]['id']){delete _0x1a599f[_0x74b2('0x45')]['id'];}return db[_0x74b2('0x28')]['find']({'where':{'id':_0x1a599f['params']['id']}})[_0x74b2('0x22')](handleEntityNotFound(_0x56bd81,null))['then'](saveUpdates(_0x1a599f[_0x74b2('0x45')],null))['then'](respondWithResult(_0x56bd81,null))[_0x74b2('0x3e')](handleError(_0x56bd81,null));};exports['destroy']=function(_0x289911,_0x13083c){return db[_0x74b2('0x28')]['find']({'where':{'id':_0x289911[_0x74b2('0x40')]['id']}})[_0x74b2('0x22')](handleEntityNotFound(_0x13083c,null))[_0x74b2('0x22')](removeEntity(_0x13083c,null))[_0x74b2('0x3e')](handleError(_0x13083c,null));}; \ No newline at end of file +var _0x7dcc=['type','key','model','map','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','VtigerField','rawAttributes'];(function(_0x4abb10,_0x26897f){var _0x2494fe=function(_0x44c085){while(--_0x44c085){_0x4abb10['push'](_0x4abb10['shift']());}};_0x2494fe(++_0x26897f);}(_0x7dcc,0xb9));var _0xc7dc=function(_0x4934e3,_0x124098){_0x4934e3=_0x4934e3-0x0;var _0x86a0c3=_0x7dcc[_0x4934e3];return _0x86a0c3;};'use strict';var emlformat=require(_0xc7dc('0x0'));var rimraf=require(_0xc7dc('0x1'));var zipdir=require(_0xc7dc('0x2'));var jsonpatch=require(_0xc7dc('0x3'));var rp=require(_0xc7dc('0x4'));var moment=require('moment');var BPromise=require(_0xc7dc('0x5'));var Mustache=require(_0xc7dc('0x6'));var util=require(_0xc7dc('0x7'));var path=require(_0xc7dc('0x8'));var sox=require(_0xc7dc('0x9'));var csv=require(_0xc7dc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc7dc('0xb'));var _=require(_0xc7dc('0xc'));var squel=require(_0xc7dc('0xd'));var crypto=require(_0xc7dc('0xe'));var jsforce=require(_0xc7dc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc7dc('0xa'));var querystring=require(_0xc7dc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc7dc('0x11'));var qs=require(_0xc7dc('0x12'));var as=require(_0xc7dc('0x13'));var hardwareService=require(_0xc7dc('0x14'));var logger=require(_0xc7dc('0x15'))('api');var utils=require(_0xc7dc('0x16'));var config=require(_0xc7dc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc7dc('0x18'))['db'];function respondWithStatusCode(_0x17543e,_0x57c782){_0x57c782=_0x57c782||0xcc;return function(_0x35e5a0){if(_0x35e5a0){return _0x17543e[_0xc7dc('0x19')](_0x57c782);}return _0x17543e[_0xc7dc('0x1a')](_0x57c782)[_0xc7dc('0x1b')]();};}function respondWithResult(_0x55fbf2,_0xa63f60){_0xa63f60=_0xa63f60||0xc8;return function(_0x3e2f91){if(_0x3e2f91){return _0x55fbf2[_0xc7dc('0x1a')](_0xa63f60)[_0xc7dc('0x1c')](_0x3e2f91);}};}function respondWithFilteredResult(_0x170531,_0x10c8cf){return function(_0x758375){if(_0x758375){var _0x32ce4e=typeof _0x10c8cf[_0xc7dc('0x1d')]===_0xc7dc('0x1e')&&typeof _0x10c8cf[_0xc7dc('0x1f')]===_0xc7dc('0x1e');var _0x462e14=_0x758375[_0xc7dc('0x20')];var _0x226efe=_0x32ce4e?0x0:_0x10c8cf[_0xc7dc('0x1d')];var _0x331c34=_0x32ce4e?_0x758375['count']:_0x10c8cf[_0xc7dc('0x1d')]+_0x10c8cf[_0xc7dc('0x1f')];var _0x292c6a;if(_0x331c34>=_0x462e14){_0x331c34=_0x462e14;_0x292c6a=0xc8;}else{_0x292c6a=0xce;}_0x170531[_0xc7dc('0x1a')](_0x292c6a);return _0x170531[_0xc7dc('0x21')]('Content-Range',_0x226efe+'-'+_0x331c34+'/'+_0x462e14)[_0xc7dc('0x1c')](_0x758375);}return null;};}function patchUpdates(_0x34edf8){return function(_0x4a31bd){try{jsonpatch[_0xc7dc('0x22')](_0x4a31bd,_0x34edf8,!![]);}catch(_0x4ea764){return BPromise[_0xc7dc('0x23')](_0x4ea764);}return _0x4a31bd['save']();};}function saveUpdates(_0x55d421,_0x26c1d1){return function(_0x3fbca8){if(_0x3fbca8){return _0x3fbca8[_0xc7dc('0x24')](_0x55d421)[_0xc7dc('0x25')](function(_0x4c7a14){return _0x4c7a14;});}return null;};}function removeEntity(_0x4440dd,_0xba8e70){return function(_0x11dc89){if(_0x11dc89){return _0x11dc89[_0xc7dc('0x26')]()['then'](function(){_0x4440dd[_0xc7dc('0x1a')](0xcc)[_0xc7dc('0x1b')]();});}};}function handleEntityNotFound(_0x3796c0,_0x5e17d5){return function(_0x5af883){if(!_0x5af883){_0x3796c0['sendStatus'](0x194);}return _0x5af883;};}function handleError(_0x38eb26,_0x35b1f3){_0x35b1f3=_0x35b1f3||0x1f4;return function(_0x244c12){logger[_0xc7dc('0x27')](_0x244c12[_0xc7dc('0x28')]);if(_0x244c12[_0xc7dc('0x29')]){delete _0x244c12['name'];}_0x38eb26[_0xc7dc('0x1a')](_0x35b1f3)[_0xc7dc('0x2a')](_0x244c12);};}exports[_0xc7dc('0x2b')]=function(_0x509358,_0x1c51e2){var _0x46d9ba={},_0x5aa7c2={},_0x2c8a20={'count':0x0,'rows':[]};var _0x987af=_['map'](db[_0xc7dc('0x2c')][_0xc7dc('0x2d')],function(_0x2e8a61){return{'name':_0x2e8a61['fieldName'],'type':_0x2e8a61[_0xc7dc('0x2e')][_0xc7dc('0x2f')]};});_0x5aa7c2[_0xc7dc('0x30')]=_[_0xc7dc('0x31')](_0x987af,_0xc7dc('0x29'));_0x5aa7c2['query']=_[_0xc7dc('0x32')](_0x509358[_0xc7dc('0x33')]);_0x5aa7c2['filters']=_[_0xc7dc('0x34')](_0x5aa7c2['model'],_0x5aa7c2[_0xc7dc('0x33')]);_0x46d9ba['attributes']=_['intersection'](_0x5aa7c2[_0xc7dc('0x30')],qs[_0xc7dc('0x35')](_0x509358[_0xc7dc('0x33')][_0xc7dc('0x35')]));_0x46d9ba['attributes']=_0x46d9ba['attributes'][_0xc7dc('0x36')]?_0x46d9ba[_0xc7dc('0x37')]:_0x5aa7c2[_0xc7dc('0x30')];if(!_0x509358[_0xc7dc('0x33')][_0xc7dc('0x38')](_0xc7dc('0x39'))){_0x46d9ba[_0xc7dc('0x1f')]=qs[_0xc7dc('0x1f')](_0x509358['query']['limit']);_0x46d9ba['offset']=qs[_0xc7dc('0x1d')](_0x509358['query'][_0xc7dc('0x1d')]);}_0x46d9ba[_0xc7dc('0x3a')]=qs[_0xc7dc('0x3b')](_0x509358[_0xc7dc('0x33')][_0xc7dc('0x3b')]);_0x46d9ba['where']=qs[_0xc7dc('0x3c')](_[_0xc7dc('0x3d')](_0x509358[_0xc7dc('0x33')],_0x5aa7c2[_0xc7dc('0x3c')]),_0x987af);if(_0x509358['query']['filter']){_0x46d9ba['where']=_[_0xc7dc('0x3e')](_0x46d9ba[_0xc7dc('0x3f')],{'$or':_['map'](_0x987af,function(_0x636976){if(_0x636976[_0xc7dc('0x2e')]!==_0xc7dc('0x40')){var _0x2c7823={};_0x2c7823[_0x636976['name']]={'$like':'%'+_0x509358[_0xc7dc('0x33')][_0xc7dc('0x41')]+'%'};return _0x2c7823;}})});}_0x46d9ba=_[_0xc7dc('0x3e')]({},_0x46d9ba,_0x509358['options']);var _0xc5e16e={'where':_0x46d9ba['where']};return db[_0xc7dc('0x2c')][_0xc7dc('0x20')](_0xc5e16e)[_0xc7dc('0x25')](function(_0xa57535){_0x2c8a20[_0xc7dc('0x20')]=_0xa57535;if(_0x509358['query'][_0xc7dc('0x42')]){_0x46d9ba[_0xc7dc('0x43')]=[{'all':!![]}];}return db[_0xc7dc('0x2c')][_0xc7dc('0x44')](_0x46d9ba);})[_0xc7dc('0x25')](function(_0x5b91de){_0x2c8a20[_0xc7dc('0x45')]=_0x5b91de;return _0x2c8a20;})[_0xc7dc('0x25')](respondWithFilteredResult(_0x1c51e2,_0x46d9ba))['catch'](handleError(_0x1c51e2,null));};exports[_0xc7dc('0x46')]=function(_0x37da21,_0x5c905c){var _0x1e21e9={'raw':!![],'where':{'id':_0x37da21[_0xc7dc('0x47')]['id']}},_0x241213={};_0x241213[_0xc7dc('0x30')]=_[_0xc7dc('0x32')](db[_0xc7dc('0x2c')]['rawAttributes']);_0x241213['query']=_['keys'](_0x37da21[_0xc7dc('0x33')]);_0x241213['filters']=_['intersection'](_0x241213[_0xc7dc('0x30')],_0x241213[_0xc7dc('0x33')]);_0x1e21e9[_0xc7dc('0x37')]=_[_0xc7dc('0x34')](_0x241213[_0xc7dc('0x30')],qs[_0xc7dc('0x35')](_0x37da21[_0xc7dc('0x33')][_0xc7dc('0x35')]));_0x1e21e9[_0xc7dc('0x37')]=_0x1e21e9[_0xc7dc('0x37')][_0xc7dc('0x36')]?_0x1e21e9['attributes']:_0x241213[_0xc7dc('0x30')];if(_0x37da21[_0xc7dc('0x33')]['includeAll']){_0x1e21e9[_0xc7dc('0x43')]=[{'all':!![]}];}_0x1e21e9=_[_0xc7dc('0x3e')]({},_0x1e21e9,_0x37da21[_0xc7dc('0x48')]);return db[_0xc7dc('0x2c')]['find'](_0x1e21e9)[_0xc7dc('0x25')](handleEntityNotFound(_0x5c905c,null))[_0xc7dc('0x25')](respondWithResult(_0x5c905c,null))[_0xc7dc('0x49')](handleError(_0x5c905c,null));};exports[_0xc7dc('0x4a')]=function(_0x311408,_0x1dc181){return db[_0xc7dc('0x2c')][_0xc7dc('0x4a')](_0x311408['body'],{})[_0xc7dc('0x25')](respondWithResult(_0x1dc181,0xc9))[_0xc7dc('0x49')](handleError(_0x1dc181,null));};exports[_0xc7dc('0x24')]=function(_0x1642db,_0xa0d189){if(_0x1642db[_0xc7dc('0x4b')]['id']){delete _0x1642db[_0xc7dc('0x4b')]['id'];}return db[_0xc7dc('0x2c')][_0xc7dc('0x4c')]({'where':{'id':_0x1642db[_0xc7dc('0x47')]['id']}})[_0xc7dc('0x25')](handleEntityNotFound(_0xa0d189,null))['then'](saveUpdates(_0x1642db[_0xc7dc('0x4b')],null))['then'](respondWithResult(_0xa0d189,null))[_0xc7dc('0x49')](handleError(_0xa0d189,null));};exports[_0xc7dc('0x26')]=function(_0x5d8c77,_0x48aed7){return db[_0xc7dc('0x2c')][_0xc7dc('0x4c')]({'where':{'id':_0x5d8c77[_0xc7dc('0x47')]['id']}})[_0xc7dc('0x25')](handleEntityNotFound(_0x48aed7,null))[_0xc7dc('0x25')](removeEntity(_0x48aed7,null))[_0xc7dc('0x49')](handleError(_0x48aed7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 7d966f7..1ac9df3 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 _0x673e=['rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','util','api','bluebird','request-promise','path'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x673e,0x1d7));var _0xe673=function(_0x55c479,_0x3459e0){_0x55c479=_0x55c479-0x0;var _0x617df5=_0x673e[_0x55c479];return _0x617df5;};'use strict';var _=require('lodash');var util=require(_0xe673('0x0'));var logger=require('../../config/logger')(_0xe673('0x1'));var moment=require('moment');var BPromise=require(_0xe673('0x2'));var rp=require(_0xe673('0x3'));var fs=require('fs');var path=require(_0xe673('0x4'));var rimraf=require(_0xe673('0x5'));var config=require(_0xe673('0x6'));var attributes=require(_0xe673('0x7'));module[_0xe673('0x8')]=function(_0xc2caa0,_0x51379f){return _0xc2caa0[_0xe673('0x9')](_0xe673('0xa'),attributes,{'tableName':_0xe673('0xb'),'paranoid':![],'indexes':[{'name':_0xe673('0xc'),'fields':['idField',_0xe673('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7867=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x53e03f,_0x5dc7f1){var _0x4f1705=function(_0x460c1a){while(--_0x460c1a){_0x53e03f['push'](_0x53e03f['shift']());}};_0x4f1705(++_0x5dc7f1);}(_0x7867,0x79));var _0x7786=function(_0x1497f8,_0x1d5928){_0x1497f8=_0x1497f8-0x0;var _0x51c961=_0x7867[_0x1497f8];return _0x51c961;};'use strict';var _=require(_0x7786('0x0'));var util=require(_0x7786('0x1'));var logger=require(_0x7786('0x2'))(_0x7786('0x3'));var moment=require(_0x7786('0x4'));var BPromise=require(_0x7786('0x5'));var rp=require(_0x7786('0x6'));var fs=require('fs');var path=require(_0x7786('0x7'));var rimraf=require(_0x7786('0x8'));var config=require(_0x7786('0x9'));var attributes=require('./intVtigerField.attributes');module[_0x7786('0xa')]=function(_0x4217ac,_0x305a16){return _0x4217ac[_0x7786('0xb')](_0x7786('0xc'),attributes,{'tableName':_0x7786('0xd'),'paranoid':![],'indexes':[{'name':_0x7786('0xe'),'fields':[_0x7786('0xf'),_0x7786('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 685f58f..339f452 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 _0x9cb4=['client','request','then','info','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4d9c78,_0x112034){var _0x555bea=function(_0x247b8b){while(--_0x247b8b){_0x4d9c78['push'](_0x4d9c78['shift']());}};_0x555bea(++_0x112034);}(_0x9cb4,0xe7));var _0x49cb=function(_0x1c619b,_0x1e367f){_0x1c619b=_0x1c619b-0x0;var _0x111f0c=_0x9cb4[_0x1c619b];return _0x111f0c;};'use strict';var _=require(_0x49cb('0x0'));var util=require(_0x49cb('0x1'));var moment=require('moment');var BPromise=require(_0x49cb('0x2'));var rs=require(_0x49cb('0x3'));var fs=require('fs');var Redis=require(_0x49cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x49cb('0x5'))(_0x49cb('0x6'));var config=require(_0x49cb('0x7'));var jayson=require(_0x49cb('0x8'));var client=jayson[_0x49cb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3de180,_0x432782,_0x26c144){return new BPromise(function(_0x4b3c4c,_0x40f359){return client[_0x49cb('0xa')](_0x3de180,_0x26c144)[_0x49cb('0xb')](function(_0x3b1bec){logger[_0x49cb('0xc')]('VtigerField,\x20%s,\x20%s',_0x432782,'request\x20sent');logger['debug'](_0x49cb('0xd'),_0x432782,_0x49cb('0xe'),JSON['stringify'](_0x3b1bec));if(_0x3b1bec[_0x49cb('0xf')]){if(_0x3b1bec[_0x49cb('0xf')]['code']===0x1f4){logger['error'](_0x49cb('0x10'),_0x432782,_0x3b1bec[_0x49cb('0xf')][_0x49cb('0x11')]);return _0x40f359(_0x3b1bec[_0x49cb('0xf')][_0x49cb('0x11')]);}logger[_0x49cb('0xf')](_0x49cb('0x10'),_0x432782,_0x3b1bec[_0x49cb('0xf')][_0x49cb('0x11')]);return _0x4b3c4c(_0x3b1bec[_0x49cb('0xf')][_0x49cb('0x11')]);}else{logger[_0x49cb('0xc')](_0x49cb('0x10'),_0x432782,_0x49cb('0xe'));_0x4b3c4c(_0x3b1bec[_0x49cb('0x12')][_0x49cb('0x11')]);}})[_0x49cb('0x13')](function(_0x54725a){logger[_0x49cb('0xf')](_0x49cb('0x10'),_0x432782,_0x54725a);_0x40f359(_0x54725a);});});} \ No newline at end of file +var _0xe904=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','info','result','catch'];(function(_0xf3897e,_0x3ac8b7){var _0x26b187=function(_0x320783){while(--_0x320783){_0xf3897e['push'](_0xf3897e['shift']());}};_0x26b187(++_0x3ac8b7);}(_0xe904,0x180));var _0x4e90=function(_0x10eb40,_0x3f5002){_0x10eb40=_0x10eb40-0x0;var _0x36e2d1=_0xe904[_0x10eb40];return _0x36e2d1;};'use strict';var _=require(_0x4e90('0x0'));var util=require(_0x4e90('0x1'));var moment=require(_0x4e90('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e90('0x3'));var fs=require('fs');var Redis=require(_0x4e90('0x4'));var db=require(_0x4e90('0x5'))['db'];var utils=require(_0x4e90('0x6'));var logger=require(_0x4e90('0x7'))(_0x4e90('0x8'));var config=require('../../config/environment');var jayson=require(_0x4e90('0x9'));var client=jayson[_0x4e90('0xa')][_0x4e90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e4a81,_0x4a4dd2,_0x17a348){return new BPromise(function(_0x38e205,_0x30776a){return client['request'](_0x4e4a81,_0x17a348)[_0x4e90('0xc')](function(_0x5d847d){logger['info']('VtigerField,\x20%s,\x20%s',_0x4a4dd2,_0x4e90('0xd'));logger[_0x4e90('0xe')](_0x4e90('0xf'),_0x4a4dd2,_0x4e90('0xd'),JSON[_0x4e90('0x10')](_0x5d847d));if(_0x5d847d['error']){if(_0x5d847d[_0x4e90('0x11')][_0x4e90('0x12')]===0x1f4){logger[_0x4e90('0x11')](_0x4e90('0x13'),_0x4a4dd2,_0x5d847d[_0x4e90('0x11')]['message']);return _0x30776a(_0x5d847d[_0x4e90('0x11')][_0x4e90('0x14')]);}logger['error'](_0x4e90('0x13'),_0x4a4dd2,_0x5d847d[_0x4e90('0x11')][_0x4e90('0x14')]);return _0x38e205(_0x5d847d[_0x4e90('0x11')][_0x4e90('0x14')]);}else{logger[_0x4e90('0x15')](_0x4e90('0x13'),_0x4a4dd2,_0x4e90('0xd'));_0x38e205(_0x5d847d[_0x4e90('0x16')]['message']);}})[_0x4e90('0x17')](function(_0x47bdf7){logger[_0x4e90('0x11')](_0x4e90('0x13'),_0x4a4dd2,_0x47bdf7);_0x30776a(_0x47bdf7);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index df710a4..b70f805 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 _0xa2c5=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54d46c,_0x18a0b7){var _0x1f0cae=function(_0x4e70b2){while(--_0x4e70b2){_0x54d46c['push'](_0x54d46c['shift']());}};_0x1f0cae(++_0x18a0b7);}(_0xa2c5,0x10c));var _0x5a2c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa2c5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5a2c('0x0'));var util=require(_0x5a2c('0x1'));var path=require(_0x5a2c('0x2'));var timeout=require('connect-timeout');var express=require(_0x5a2c('0x3'));var router=express[_0x5a2c('0x4')]();var fs_extra=require(_0x5a2c('0x5'));var auth=require(_0x5a2c('0x6'));var interaction=require(_0x5a2c('0x7'));var config=require(_0x5a2c('0x8'));var controller=require(_0x5a2c('0x9'));router[_0x5a2c('0xa')]('/',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0xc')]);router['get']('/:id',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0xd')]);router[_0x5a2c('0xa')](_0x5a2c('0xe'),auth[_0x5a2c('0xb')](),controller[_0x5a2c('0xf')]);router[_0x5a2c('0xa')](_0x5a2c('0x10'),auth[_0x5a2c('0xb')](),controller['getFields']);router[_0x5a2c('0x11')]('/',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0x12')]);router[_0x5a2c('0x11')]('/:id/configurations',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0x13')]);router[_0x5a2c('0x14')]('/:id',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0x15')]);router[_0x5a2c('0x16')]('/:id',auth[_0x5a2c('0xb')](),controller[_0x5a2c('0x17')]);module[_0x5a2c('0x18')]=router; \ No newline at end of file +var _0xaee6=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1f7fb7,_0x431df6){var _0x55e721=function(_0x43c8d3){while(--_0x43c8d3){_0x1f7fb7['push'](_0x1f7fb7['shift']());}};_0x55e721(++_0x431df6);}(_0xaee6,0x187));var _0x6aee=function(_0x19b066,_0x393e71){_0x19b066=_0x19b066-0x0;var _0x10d9ab=_0xaee6[_0x19b066];return _0x10d9ab;};'use strict';var multer=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var path=require(_0x6aee('0x2'));var timeout=require(_0x6aee('0x3'));var express=require(_0x6aee('0x4'));var router=express[_0x6aee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6aee('0x6'));var interaction=require(_0x6aee('0x7'));var config=require(_0x6aee('0x8'));var controller=require('./intZendeskAccount.controller');router[_0x6aee('0x9')]('/',auth[_0x6aee('0xa')](),controller[_0x6aee('0xb')]);router[_0x6aee('0x9')](_0x6aee('0xc'),auth[_0x6aee('0xa')](),controller[_0x6aee('0xd')]);router['get']('/:id/configurations',auth[_0x6aee('0xa')](),controller['getConfigurations']);router[_0x6aee('0x9')](_0x6aee('0xe'),auth[_0x6aee('0xa')](),controller['getFields']);router[_0x6aee('0xf')]('/',auth[_0x6aee('0xa')](),controller[_0x6aee('0x10')]);router[_0x6aee('0xf')]('/:id/configurations',auth[_0x6aee('0xa')](),controller['addConfiguration']);router[_0x6aee('0x11')](_0x6aee('0xc'),auth[_0x6aee('0xa')](),controller[_0x6aee('0x12')]);router[_0x6aee('0x13')]('/:id',auth[_0x6aee('0xa')](),controller[_0x6aee('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b45d789..52448eb 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 _0x187d=['password','integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM','token'];(function(_0x273f7f,_0x153b7c){var _0x51eb0e=function(_0x115b2f){while(--_0x115b2f){_0x273f7f['push'](_0x273f7f['shift']());}};_0x51eb0e(++_0x153b7c);}(_0x187d,0x93));var _0xd187=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x187d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xd187('0x0'));module['exports']={'name':{'type':Sequelize[_0xd187('0x1')]},'description':{'type':Sequelize[_0xd187('0x1')]},'username':{'type':Sequelize[_0xd187('0x1')],'unique':_0xd187('0x2')},'password':{'type':Sequelize[_0xd187('0x1')]},'token':{'type':Sequelize[_0xd187('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd187('0x3')},'authType':{'type':Sequelize[_0xd187('0x4')]('password',_0xd187('0x5')),'defaultValue':_0xd187('0x6')},'serverUrl':{'type':Sequelize[_0xd187('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd187('0x4')](_0xd187('0x7'),_0xd187('0x8')),'defaultValue':_0xd187('0x7')}}; \ No newline at end of file +var _0xa3e8=['exports','STRING','username','token','password','integrationTab','newTab','sequelize'];(function(_0x195de8,_0x3f728d){var _0x3c7e1d=function(_0x6e2636){while(--_0x6e2636){_0x195de8['push'](_0x195de8['shift']());}};_0x3c7e1d(++_0x3f728d);}(_0xa3e8,0x127));var _0x8a3e=function(_0x25eceb,_0x4a5e45){_0x25eceb=_0x25eceb-0x0;var _0x526ebd=_0xa3e8[_0x25eceb];return _0x526ebd;};'use strict';var Sequelize=require(_0x8a3e('0x0'));module[_0x8a3e('0x1')]={'name':{'type':Sequelize[_0x8a3e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8a3e('0x2')],'unique':_0x8a3e('0x3')},'password':{'type':Sequelize[_0x8a3e('0x2')]},'token':{'type':Sequelize[_0x8a3e('0x2')]},'remoteUri':{'type':Sequelize[_0x8a3e('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password',_0x8a3e('0x4')),'defaultValue':_0x8a3e('0x5')},'serverUrl':{'type':Sequelize[_0x8a3e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8a3e('0x6'),_0x8a3e('0x7')),'defaultValue':_0x8a3e('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 2e65360..14fafe3 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 _0x9ffd=['catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','findOne','username','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','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','set','update','then','stack','name','index','map','ZendeskAccount','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x12ee46,_0x316fd4){var _0x218f80=function(_0x2f81c8){while(--_0x2f81c8){_0x12ee46['push'](_0x12ee46['shift']());}};_0x218f80(++_0x316fd4);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x27754d,_0x11511a){_0x27754d=_0x27754d-0x0;var _0x211607=_0x9ffd[_0x27754d];return _0x211607;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47b0d7,_0xaaf7af){_0xaaf7af=_0xaaf7af||0xcc;return function(_0x16a0d9){if(_0x16a0d9){return _0x47b0d7[_0xd9ff('0x1a')](_0xaaf7af);}return _0x47b0d7[_0xd9ff('0x1b')](_0xaaf7af)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x556aa4,_0x2f78c1){_0x2f78c1=_0x2f78c1||0xc8;return function(_0x3c9ace){if(_0x3c9ace){return _0x556aa4['status'](_0x2f78c1)[_0xd9ff('0x1d')](_0x3c9ace);}};}function respondWithFilteredResult(_0x5db010,_0x4ffe54){return function(_0x547e28){if(_0x547e28){var _0x4c5718=typeof _0x4ffe54[_0xd9ff('0x1e')]==='undefined'&&typeof _0x4ffe54[_0xd9ff('0x1f')]===_0xd9ff('0x20');var _0x39c6ce=_0x547e28[_0xd9ff('0x21')];var _0x5f45c4=_0x4c5718?0x0:_0x4ffe54[_0xd9ff('0x1e')];var _0x3ccf15=_0x4c5718?_0x547e28[_0xd9ff('0x21')]:_0x4ffe54[_0xd9ff('0x1e')]+_0x4ffe54[_0xd9ff('0x1f')];var _0x3ea97d;if(_0x3ccf15>=_0x39c6ce){_0x3ccf15=_0x39c6ce;_0x3ea97d=0xc8;}else{_0x3ea97d=0xce;}_0x5db010[_0xd9ff('0x1b')](_0x3ea97d);return _0x5db010[_0xd9ff('0x22')]('Content-Range',_0x5f45c4+'-'+_0x3ccf15+'/'+_0x39c6ce)['json'](_0x547e28);}return null;};}function patchUpdates(_0x264a3d){return function(_0x3eed13){try{jsonpatch['apply'](_0x3eed13,_0x264a3d,!![]);}catch(_0x588151){return BPromise['reject'](_0x588151);}return _0x3eed13['save']();};}function saveUpdates(_0x1f4d9e,_0x58eb5f){return function(_0x4c486a){if(_0x4c486a){return _0x4c486a[_0xd9ff('0x23')](_0x1f4d9e)[_0xd9ff('0x24')](function(_0x9f074e){return _0x9f074e;});}return null;};}function removeEntity(_0x278b66,_0x42a828){return function(_0x4b058a){if(_0x4b058a){return _0x4b058a['destroy']()[_0xd9ff('0x24')](function(){_0x278b66['status'](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x4d86fe,_0x285002){return function(_0x5d45b3){if(!_0x5d45b3){_0x4d86fe[_0xd9ff('0x1a')](0x194);}return _0x5d45b3;};}function handleError(_0x159e56,_0x2138b4){_0x2138b4=_0x2138b4||0x1f4;return function(_0x2970e8){logger['error'](_0x2970e8[_0xd9ff('0x25')]);if(_0x2970e8[_0xd9ff('0x26')]){delete _0x2970e8[_0xd9ff('0x26')];}_0x159e56[_0xd9ff('0x1b')](_0x2138b4)['send'](_0x2970e8);};}exports[_0xd9ff('0x27')]=function(_0x3792d9,_0x44b5a7){var _0x45fb63={},_0x263d3a={},_0xe516e2={'count':0x0,'rows':[]};var _0x420ffa=_[_0xd9ff('0x28')](db[_0xd9ff('0x29')]['rawAttributes'],function(_0xcea5db){return{'name':_0xcea5db['fieldName'],'type':_0xcea5db[_0xd9ff('0x2a')][_0xd9ff('0x2b')]};});_0x263d3a[_0xd9ff('0x2c')]=_['map'](_0x420ffa,_0xd9ff('0x26'));_0x263d3a[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x3792d9[_0xd9ff('0x2d')]);_0x263d3a['filters']=_[_0xd9ff('0x2f')](_0x263d3a['model'],_0x263d3a[_0xd9ff('0x2d')]);_0x45fb63[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x263d3a[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x45fb63[_0xd9ff('0x30')]=_0x45fb63[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x45fb63[_0xd9ff('0x30')]:_0x263d3a[_0xd9ff('0x2c')];if(!_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x33')]('nolimit')){_0x45fb63[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3792d9[_0xd9ff('0x2d')]['limit']);_0x45fb63[_0xd9ff('0x1e')]=qs['offset'](_0x3792d9[_0xd9ff('0x2d')]['offset']);}_0x45fb63[_0xd9ff('0x34')]=qs['sort'](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x45fb63[_0xd9ff('0x36')]=qs['filters'](_['pick'](_0x3792d9['query'],_0x263d3a[_0xd9ff('0x37')]),_0x420ffa);if(_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x45fb63[_0xd9ff('0x36')]=_[_0xd9ff('0x39')](_0x45fb63[_0xd9ff('0x36')],{'$or':_['map'](_0x420ffa,function(_0x4c00c2){if(_0x4c00c2['type']!==_0xd9ff('0x3a')){var _0x252edc={};_0x252edc[_0x4c00c2[_0xd9ff('0x26')]]={'$like':'%'+_0x3792d9[_0xd9ff('0x2d')]['filter']+'%'};return _0x252edc;}})});}_0x45fb63=_[_0xd9ff('0x39')]({},_0x45fb63,_0x3792d9['options']);var _0x3cff52={'where':_0x45fb63[_0xd9ff('0x36')]};return db[_0xd9ff('0x29')][_0xd9ff('0x21')](_0x3cff52)['then'](function(_0x1e34da){_0xe516e2[_0xd9ff('0x21')]=_0x1e34da;if(_0x3792d9['query'][_0xd9ff('0x3b')]){_0x45fb63[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x29')][_0xd9ff('0x3d')](_0x45fb63);})[_0xd9ff('0x24')](function(_0x1cc848){_0xe516e2['rows']=_0x1cc848;return _0xe516e2;})[_0xd9ff('0x24')](respondWithFilteredResult(_0x44b5a7,_0x45fb63))[_0xd9ff('0x3e')](handleError(_0x44b5a7,null));};exports[_0xd9ff('0x3f')]=function(_0x39fbbb,_0x472724){var _0x52aab8={'raw':![],'where':{'id':_0x39fbbb[_0xd9ff('0x40')]['id']}},_0x3178cd={};_0x3178cd[_0xd9ff('0x2c')]=_['keys'](db['ZendeskAccount'][_0xd9ff('0x41')]);_0x3178cd[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x39fbbb[_0xd9ff('0x2d')]);_0x3178cd[_0xd9ff('0x37')]=_[_0xd9ff('0x2f')](_0x3178cd['model'],_0x3178cd[_0xd9ff('0x2d')]);_0x52aab8[_0xd9ff('0x30')]=_['intersection'](_0x3178cd[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x39fbbb[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x52aab8[_0xd9ff('0x30')]=_0x52aab8['attributes']['length']?_0x52aab8['attributes']:_0x3178cd[_0xd9ff('0x2c')];if(_0x39fbbb['query'][_0xd9ff('0x3b')]){_0x52aab8[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x52aab8=_[_0xd9ff('0x39')]({},_0x52aab8,_0x39fbbb['options']);return db[_0xd9ff('0x29')][_0xd9ff('0x42')](_0x52aab8)['then'](handleEntityNotFound(_0x472724,null))[_0xd9ff('0x24')](respondWithResult(_0x472724,null))[_0xd9ff('0x3e')](handleError(_0x472724,null));};exports[_0xd9ff('0x43')]=function(_0x316854,_0x559101){return db[_0xd9ff('0x29')]['create'](_0x316854[_0xd9ff('0x44')],{})['then'](respondWithResult(_0x559101,0xc9))[_0xd9ff('0x3e')](handleError(_0x559101,null));};exports[_0xd9ff('0x23')]=function(_0x2bf37a,_0x1760c3){if(_0x2bf37a[_0xd9ff('0x44')]['id']){delete _0x2bf37a['body']['id'];}return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x2bf37a[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x1760c3,null))['then'](saveUpdates(_0x2bf37a['body'],null))['then'](respondWithResult(_0x1760c3,null))[_0xd9ff('0x3e')](handleError(_0x1760c3,null));};exports[_0xd9ff('0x45')]=function(_0x29c6bd,_0x572618){return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x29c6bd[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x572618,null))[_0xd9ff('0x24')](removeEntity(_0x572618,null))[_0xd9ff('0x3e')](handleError(_0x572618,null));};exports[_0xd9ff('0x46')]=function(_0x1e1364,_0x1ad160,_0x10d9d0){var _0x5dcb5={};var _0x3d6143={};var _0x2533d7;var _0x487b07;return db[_0xd9ff('0x29')]['findOne']({'where':{'id':_0x1e1364[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ad160,null))[_0xd9ff('0x24')](function(_0x49623d){if(_0x49623d){_0x2533d7=_0x49623d;_0x3d6143[_0xd9ff('0x2c')]=_['keys'](db[_0xd9ff('0x47')]['rawAttributes']);_0x3d6143[_0xd9ff('0x2d')]=_['keys'](_0x1e1364[_0xd9ff('0x2d')]);_0x3d6143['filters']=_[_0xd9ff('0x2f')](_0x3d6143[_0xd9ff('0x2c')],_0x3d6143[_0xd9ff('0x2d')]);_0x5dcb5[_0xd9ff('0x30')]=_['intersection'](_0x3d6143[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x1e1364[_0xd9ff('0x2d')]['fields']));_0x5dcb5[_0xd9ff('0x30')]=_0x5dcb5[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x5dcb5[_0xd9ff('0x30')]:_0x3d6143[_0xd9ff('0x2c')];_0x5dcb5['order']=qs[_0xd9ff('0x35')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5dcb5[_0xd9ff('0x36')]=qs[_0xd9ff('0x37')](_[_0xd9ff('0x48')](_0x1e1364[_0xd9ff('0x2d')],_0x3d6143['filters']));if(_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x5dcb5['where']=_[_0xd9ff('0x39')](_0x5dcb5[_0xd9ff('0x36')],{'$or':_['map'](_0x5dcb5[_0xd9ff('0x30')],function(_0x36d5c2){var _0x25d8d1={};_0x25d8d1[_0x36d5c2]={'$like':'%'+_0x1e1364['query']['filter']+'%'};return _0x25d8d1;})});}_0x5dcb5=_[_0xd9ff('0x39')]({},_0x5dcb5,_0x1e1364['options']);return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x31907e){if(_0x31907e){_0x487b07=_0x31907e[_0xd9ff('0x32')];if(!_0x1e1364['query']['hasOwnProperty']('nolimit')){_0x5dcb5[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x1f')]);_0x5dcb5[_0xd9ff('0x1e')]=qs['offset'](_0x1e1364[_0xd9ff('0x2d')]['offset']);}return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x3f92c3){if(_0x3f92c3){return _0x3f92c3?{'count':_0x487b07,'rows':_0x3f92c3}:null;}})[_0xd9ff('0x24')](respondWithResult(_0x1ad160,null))[_0xd9ff('0x3e')](handleError(_0x1ad160,null));};exports[_0xd9ff('0x49')]=function(_0xed12df,_0xfcafbe,_0x5d633b){if(_0xed12df[_0xd9ff('0x44')]['id']){delete _0xed12df[_0xd9ff('0x44')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0xed12df[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0xfcafbe,null))[_0xd9ff('0x24')](function(_0x34fca4){if(_0x34fca4){_0xed12df['body'][_0xd9ff('0x4a')]=_0x34fca4['id'];_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4b')]=integrations[_0xd9ff('0x4c')](_0xed12df[_0xd9ff('0x44')]['channel'],_0xed12df[_0xd9ff('0x44')]['type']);_0xed12df['body'][_0xd9ff('0x4d')]=integrations[_0xd9ff('0x4e')](_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4f')],_0xed12df['body'][_0xd9ff('0x2a')]);return db[_0xd9ff('0x47')][_0xd9ff('0x43')](_0xed12df[_0xd9ff('0x44')],{'include':[{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4b')},{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4d')}]});}return null;})['then'](respondWithResult(_0xfcafbe,null))['catch'](handleError(_0xfcafbe,null));};exports['getFields']=function(_0x275fb9,_0x31db27,_0x514d59){var _0x196670='';return db[_0xd9ff('0x29')][_0xd9ff('0x51')]({'where':{'id':_0x275fb9[_0xd9ff('0x40')]['id']},'attributes':['id',_0xd9ff('0x52'),_0xd9ff('0x53'),_0xd9ff('0x54'),_0xd9ff('0x55'),'remoteUri']})[_0xd9ff('0x24')](handleEntityNotFound(_0x31db27,null))[_0xd9ff('0x24')](function(_0x228413){if(_0x228413){_0x196670=_0x228413['remoteUri'];var _0x14e936=_0x196670['slice'](-0x1);if(_0x14e936==='/'){_0x196670=_0x196670[_0xd9ff('0x56')](0x0,_0x196670[_0xd9ff('0x57')](_0x14e936));}var _0x25ee82={'method':'GET','uri':util[_0xd9ff('0x58')](_0xd9ff('0x59'),_0x196670,_0xd9ff('0x5a')),'json':!![]};switch(_0x228413[_0xd9ff('0x55')]){case'password':_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5d'),_0x228413[_0xd9ff('0x52')],_0x228413[_0xd9ff('0x53')]))['toString'](_0xd9ff('0x5e')))};break;case _0xd9ff('0x54'):_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5f'),_0x228413[_0xd9ff('0x52')],_0x228413['token']))[_0xd9ff('0x60')](_0xd9ff('0x5e')))};break;default:throw new db[(_0xd9ff('0x61'))]['ValidationError'](_0xd9ff('0x62'));}return rp(_0x25ee82);}})['then'](function(_0x1e46fc){if(_0x1e46fc){var _0x478e0d=[_0xd9ff('0x63'),_0xd9ff('0x64'),_0xd9ff('0x65'),_0xd9ff('0x66')];_[_0xd9ff('0x67')](_0x1e46fc[_0xd9ff('0x5a')],function(_0xda0003){return _0x478e0d[_0xd9ff('0x68')](_0xda0003[_0xd9ff('0x2a')]);});return{'count':_0x1e46fc[_0xd9ff('0x5a')]['length'],'rows':_[_0xd9ff('0x28')](_0x1e46fc[_0xd9ff('0x5a')],function(_0x1f6cb9){return{'id':_0x1f6cb9['id'],'name':_0x1f6cb9[_0xd9ff('0x69')]>0x7?_0x1f6cb9[_0xd9ff('0x6a')]:_0x1f6cb9[_0xd9ff('0x2a')],'custom':_0x1f6cb9['position']>0x7?!![]:![],'options':_0x1f6cb9['system_field_options']?_0x1f6cb9[_0xd9ff('0x6b')]:_0x1f6cb9[_0xd9ff('0x6c')]?_0x1f6cb9[_0xd9ff('0x6c')]:[]};})};}})[_0xd9ff('0x24')](respondWithResult(_0x31db27,null))[_0xd9ff('0x3e')](function(_0x183199){var _0x5b234c=_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?0x1f4:_0x183199[_0xd9ff('0x6e')]||0x1f4;logger[_0xd9ff('0x6f')](_0xd9ff('0x70'),_0xd9ff('0x71'),_0x5b234c,JSON['stringify'](_0x183199));delete _0x183199[_0xd9ff('0x26')];if(_0x5b234c===0x191){_0x5b234c=0x190;}_0x31db27[_0xd9ff('0x1b')](_0x5b234c)[_0xd9ff('0x72')](_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?{'message':_0xd9ff('0x73'),'statusCode':_0x183199[_0xd9ff('0x6e')]}:_0x183199);});}; \ No newline at end of file +var _0xb9be=['count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','order','AccountId','getSubjects','type','Descriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined'];(function(_0x1cd555,_0x4a1338){var _0x4ced8a=function(_0x5df937){while(--_0x5df937){_0x1cd555['push'](_0x1cd555['shift']());}};_0x4ced8a(++_0x4a1338);}(_0xb9be,0xc5));var _0xeb9b=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0xb9be[_0x51bda1];return _0x1ce08c;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];var integrations=require(_0xeb9b('0x19'));function respondWithStatusCode(_0x2a01df,_0x51598f){_0x51598f=_0x51598f||0xcc;return function(_0x5e94e3){if(_0x5e94e3){return _0x2a01df['sendStatus'](_0x51598f);}return _0x2a01df[_0xeb9b('0x1a')](_0x51598f)[_0xeb9b('0x1b')]();};}function respondWithResult(_0x2674e6,_0x4ec46d){_0x4ec46d=_0x4ec46d||0xc8;return function(_0x5926e1){if(_0x5926e1){return _0x2674e6['status'](_0x4ec46d)[_0xeb9b('0x1c')](_0x5926e1);}};}function respondWithFilteredResult(_0x1a5f27,_0x406afd){return function(_0x3fa308){if(_0x3fa308){var _0x2c9aa6=typeof _0x406afd[_0xeb9b('0x1d')]===_0xeb9b('0x1e')&&typeof _0x406afd['limit']===_0xeb9b('0x1e');var _0x36e871=_0x3fa308[_0xeb9b('0x1f')];var _0x3a11e3=_0x2c9aa6?0x0:_0x406afd[_0xeb9b('0x1d')];var _0x1a140c=_0x2c9aa6?_0x3fa308[_0xeb9b('0x1f')]:_0x406afd[_0xeb9b('0x1d')]+_0x406afd[_0xeb9b('0x20')];var _0x26e312;if(_0x1a140c>=_0x36e871){_0x1a140c=_0x36e871;_0x26e312=0xc8;}else{_0x26e312=0xce;}_0x1a5f27['status'](_0x26e312);return _0x1a5f27[_0xeb9b('0x21')]('Content-Range',_0x3a11e3+'-'+_0x1a140c+'/'+_0x36e871)['json'](_0x3fa308);}return null;};}function patchUpdates(_0x580498){return function(_0x703f0b){try{jsonpatch['apply'](_0x703f0b,_0x580498,!![]);}catch(_0xbed5ce){return BPromise[_0xeb9b('0x22')](_0xbed5ce);}return _0x703f0b[_0xeb9b('0x23')]();};}function saveUpdates(_0x37d7e0,_0x3c8be7){return function(_0x43dab8){if(_0x43dab8){return _0x43dab8[_0xeb9b('0x24')](_0x37d7e0)[_0xeb9b('0x25')](function(_0x142d1c){return _0x142d1c;});}return null;};}function removeEntity(_0x46df93,_0x61c86d){return function(_0x296f95){if(_0x296f95){return _0x296f95[_0xeb9b('0x26')]()[_0xeb9b('0x25')](function(){_0x46df93[_0xeb9b('0x1a')](0xcc)[_0xeb9b('0x1b')]();});}};}function handleEntityNotFound(_0x4c997e,_0xd57390){return function(_0x4ed960){if(!_0x4ed960){_0x4c997e[_0xeb9b('0x27')](0x194);}return _0x4ed960;};}function handleError(_0x5d6846,_0x347ec1){_0x347ec1=_0x347ec1||0x1f4;return function(_0x4361b9){logger[_0xeb9b('0x28')](_0x4361b9[_0xeb9b('0x29')]);if(_0x4361b9['name']){delete _0x4361b9[_0xeb9b('0x2a')];}_0x5d6846[_0xeb9b('0x1a')](_0x347ec1)['send'](_0x4361b9);};}exports[_0xeb9b('0x2b')]=function(_0x33bb1d,_0x5ce745){var _0x2a4b51={},_0x2ea20f={},_0x4188d5={'count':0x0,'rows':[]};var _0x48c5f4=_[_0xeb9b('0x2c')](db['ZendeskAccount'][_0xeb9b('0x2d')],function(_0x4c1331){return{'name':_0x4c1331[_0xeb9b('0x2e')],'type':_0x4c1331['type'][_0xeb9b('0x2f')]};});_0x2ea20f['model']=_[_0xeb9b('0x2c')](_0x48c5f4,'name');_0x2ea20f[_0xeb9b('0x30')]=_[_0xeb9b('0x31')](_0x33bb1d[_0xeb9b('0x30')]);_0x2ea20f[_0xeb9b('0x32')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],_0x2ea20f[_0xeb9b('0x30')]);_0x2a4b51[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],qs['fields'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x2a4b51[_0xeb9b('0x35')]=_0x2a4b51[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x2a4b51[_0xeb9b('0x35')]:_0x2ea20f[_0xeb9b('0x34')];if(!_0x33bb1d['query'][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x2a4b51[_0xeb9b('0x20')]=qs['limit'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x20')]);_0x2a4b51[_0xeb9b('0x1d')]=qs[_0xeb9b('0x1d')](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}_0x2a4b51['order']=qs[_0xeb9b('0x3a')](_0x33bb1d[_0xeb9b('0x30')]['sort']);_0x2a4b51[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x33bb1d[_0xeb9b('0x30')],_0x2ea20f[_0xeb9b('0x32')]),_0x48c5f4);if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x3d')]){_0x2a4b51['where']=_[_0xeb9b('0x3e')](_0x2a4b51[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x48c5f4,function(_0x53d2f7){if(_0x53d2f7['type']!=='VIRTUAL'){var _0x26dc71={};_0x26dc71[_0x53d2f7[_0xeb9b('0x2a')]]={'$like':'%'+_0x33bb1d[_0xeb9b('0x30')]['filter']+'%'};return _0x26dc71;}})});}_0x2a4b51=_[_0xeb9b('0x3e')]({},_0x2a4b51,_0x33bb1d[_0xeb9b('0x3f')]);var _0x240d8d={'where':_0x2a4b51[_0xeb9b('0x3b')]};return db[_0xeb9b('0x40')][_0xeb9b('0x1f')](_0x240d8d)[_0xeb9b('0x25')](function(_0x492122){_0x4188d5[_0xeb9b('0x1f')]=_0x492122;if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0x2a4b51['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xeb9b('0x42')](_0x2a4b51);})[_0xeb9b('0x25')](function(_0x495998){_0x4188d5[_0xeb9b('0x43')]=_0x495998;return _0x4188d5;})['then'](respondWithFilteredResult(_0x5ce745,_0x2a4b51))[_0xeb9b('0x44')](handleError(_0x5ce745,null));};exports[_0xeb9b('0x45')]=function(_0x28b075,_0x300565){var _0xbee63e={'raw':![],'where':{'id':_0x28b075[_0xeb9b('0x46')]['id']}},_0x10f483={};_0x10f483[_0xeb9b('0x34')]=_[_0xeb9b('0x31')](db[_0xeb9b('0x40')][_0xeb9b('0x2d')]);_0x10f483[_0xeb9b('0x30')]=_['keys'](_0x28b075['query']);_0x10f483[_0xeb9b('0x32')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],_0x10f483[_0xeb9b('0x30')]);_0xbee63e[_0xeb9b('0x35')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],qs[_0xeb9b('0x36')](_0x28b075['query'][_0xeb9b('0x36')]));_0xbee63e[_0xeb9b('0x35')]=_0xbee63e[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0xbee63e[_0xeb9b('0x35')]:_0x10f483[_0xeb9b('0x34')];if(_0x28b075[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0xbee63e['include']=[{'all':!![]}];}_0xbee63e=_['merge']({},_0xbee63e,_0x28b075[_0xeb9b('0x3f')]);return db['ZendeskAccount']['find'](_0xbee63e)[_0xeb9b('0x25')](handleEntityNotFound(_0x300565,null))[_0xeb9b('0x25')](respondWithResult(_0x300565,null))[_0xeb9b('0x44')](handleError(_0x300565,null));};exports[_0xeb9b('0x47')]=function(_0x45bc74,_0x2fd6ee){return db['ZendeskAccount']['create'](_0x45bc74['body'],{})[_0xeb9b('0x25')](respondWithResult(_0x2fd6ee,0xc9))['catch'](handleError(_0x2fd6ee,null));};exports[_0xeb9b('0x24')]=function(_0x2ee59c,_0x2ae9bf){if(_0x2ee59c[_0xeb9b('0x48')]['id']){delete _0x2ee59c[_0xeb9b('0x48')]['id'];}return db[_0xeb9b('0x40')][_0xeb9b('0x49')]({'where':{'id':_0x2ee59c[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x2ae9bf,null))[_0xeb9b('0x25')](saveUpdates(_0x2ee59c['body'],null))['then'](respondWithResult(_0x2ae9bf,null))[_0xeb9b('0x44')](handleError(_0x2ae9bf,null));};exports[_0xeb9b('0x26')]=function(_0x542ef4,_0x19bfe9){return db['ZendeskAccount'][_0xeb9b('0x49')]({'where':{'id':_0x542ef4[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x19bfe9,null))['then'](removeEntity(_0x19bfe9,null))['catch'](handleError(_0x19bfe9,null));};exports[_0xeb9b('0x4a')]=function(_0x32d8cd,_0x263453,_0x4fe9d0){var _0x4ded40={};var _0x471161={};var _0x1833c2;var _0x3e6e73;return db[_0xeb9b('0x40')][_0xeb9b('0x4b')]({'where':{'id':_0x32d8cd[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x263453,null))[_0xeb9b('0x25')](function(_0x1fab7a){if(_0x1fab7a){_0x1833c2=_0x1fab7a;_0x471161['model']=_[_0xeb9b('0x31')](db['ZendeskConfiguration'][_0xeb9b('0x2d')]);_0x471161[_0xeb9b('0x30')]=_['keys'](_0x32d8cd[_0xeb9b('0x30')]);_0x471161['filters']=_[_0xeb9b('0x33')](_0x471161[_0xeb9b('0x34')],_0x471161[_0xeb9b('0x30')]);_0x4ded40[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x471161['model'],qs[_0xeb9b('0x36')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x4ded40['attributes']=_0x4ded40[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x4ded40[_0xeb9b('0x35')]:_0x471161[_0xeb9b('0x34')];_0x4ded40[_0xeb9b('0x4c')]=qs[_0xeb9b('0x3a')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3a')]);_0x4ded40[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x32d8cd['query'],_0x471161['filters']));if(_0x32d8cd['query'][_0xeb9b('0x3d')]){_0x4ded40['where']=_[_0xeb9b('0x3e')](_0x4ded40[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x4ded40['attributes'],function(_0x27deea){var _0xb29d24={};_0xb29d24[_0x27deea]={'$like':'%'+_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3d')]+'%'};return _0xb29d24;})});}_0x4ded40=_[_0xeb9b('0x3e')]({},_0x4ded40,_0x32d8cd[_0xeb9b('0x3f')]);return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x58a3e2){if(_0x58a3e2){_0x3e6e73=_0x58a3e2['length'];if(!_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x4ded40['limit']=qs[_0xeb9b('0x20')](_0x32d8cd['query'][_0xeb9b('0x20')]);_0x4ded40['offset']=qs[_0xeb9b('0x1d')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x4be938){if(_0x4be938){return _0x4be938?{'count':_0x3e6e73,'rows':_0x4be938}:null;}})[_0xeb9b('0x25')](respondWithResult(_0x263453,null))[_0xeb9b('0x44')](handleError(_0x263453,null));};exports['addConfiguration']=function(_0x5a690a,_0x436470,_0x39c248){if(_0x5a690a['body']['id']){delete _0x5a690a[_0xeb9b('0x48')]['id'];}return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x5a690a['params']['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x436470,null))[_0xeb9b('0x25')](function(_0x417221){if(_0x417221){_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4d')]=_0x417221['id'];_0x5a690a[_0xeb9b('0x48')]['Subjects']=integrations[_0xeb9b('0x4e')](_0x5a690a[_0xeb9b('0x48')]['channel'],_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4f')]);_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x50')]=integrations['getDescriptions'](_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x51')],_0x5a690a['body'][_0xeb9b('0x4f')]);return db[_0xeb9b('0x52')][_0xeb9b('0x47')](_0x5a690a[_0xeb9b('0x48')],{'include':[{'model':db[_0xeb9b('0x53')],'as':_0xeb9b('0x54')},{'model':db[_0xeb9b('0x53')],'as':'Descriptions'}]});}return null;})[_0xeb9b('0x25')](respondWithResult(_0x436470,null))[_0xeb9b('0x44')](handleError(_0x436470,null));};exports['getFields']=function(_0x289654,_0x6a85fd,_0x2fb07e){var _0x25398e='';return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x289654[_0xeb9b('0x46')]['id']},'attributes':['id',_0xeb9b('0x55'),_0xeb9b('0x56'),_0xeb9b('0x57'),_0xeb9b('0x58'),_0xeb9b('0x59')]})[_0xeb9b('0x25')](handleEntityNotFound(_0x6a85fd,null))[_0xeb9b('0x25')](function(_0x128d43){if(_0x128d43){_0x25398e=_0x128d43[_0xeb9b('0x59')];var _0xbbde9c=_0x25398e[_0xeb9b('0x5a')](-0x1);if(_0xbbde9c==='/'){_0x25398e=_0x25398e[_0xeb9b('0x5b')](0x0,_0x25398e[_0xeb9b('0x5c')](_0xbbde9c));}var _0xd619ca={'method':'GET','uri':util[_0xeb9b('0x5d')](_0xeb9b('0x5e'),_0x25398e,_0xeb9b('0x5f')),'json':!![]};switch(_0x128d43['authType']){case'password':_0xd619ca[_0xeb9b('0x60')]={'Authorization':util['format'](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')](_0xeb9b('0x62'),_0x128d43[_0xeb9b('0x55')],_0x128d43[_0xeb9b('0x56')]))[_0xeb9b('0x63')](_0xeb9b('0x64')))};break;case _0xeb9b('0x57'):_0xd619ca[_0xeb9b('0x60')]={'Authorization':util[_0xeb9b('0x5d')](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')]('%s/token:%s',_0x128d43['username'],_0x128d43[_0xeb9b('0x57')]))['toString']('base64'))};break;default:throw new db[(_0xeb9b('0x65'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0xd619ca);}})['then'](function(_0x346ba9){if(_0x346ba9){var _0x3147bc=[_0xeb9b('0x66'),_0xeb9b('0x67'),'group',_0xeb9b('0x68')];_[_0xeb9b('0x69')](_0x346ba9[_0xeb9b('0x5f')],function(_0x4e5cfb){return _0x3147bc['includes'](_0x4e5cfb[_0xeb9b('0x4f')]);});return{'count':_0x346ba9['ticket_fields'][_0xeb9b('0x37')],'rows':_['map'](_0x346ba9['ticket_fields'],function(_0xa7e9c3){return{'id':_0xa7e9c3['id'],'name':_0xa7e9c3['position']>0x7?_0xa7e9c3[_0xeb9b('0x6a')]:_0xa7e9c3['type'],'custom':_0xa7e9c3['position']>0x7?!![]:![],'options':_0xa7e9c3[_0xeb9b('0x6b')]?_0xa7e9c3[_0xeb9b('0x6b')]:_0xa7e9c3[_0xeb9b('0x6c')]?_0xa7e9c3[_0xeb9b('0x6c')]:[]};})};}})['then'](respondWithResult(_0x6a85fd,null))[_0xeb9b('0x44')](function(_0x31de58){var _0x3f395a=_0x289654[_0xeb9b('0x30')][_0xeb9b('0x6d')]?0x1f4:_0x31de58[_0xeb9b('0x6e')]||0x1f4;logger['error'](_0xeb9b('0x6f'),'getFields',_0x3f395a,JSON[_0xeb9b('0x70')](_0x31de58));delete _0x31de58[_0xeb9b('0x2a')];if(_0x3f395a===0x191){_0x3f395a=0x190;}_0x6a85fd['status'](_0x3f395a)[_0xeb9b('0x71')](_0x289654['query'][_0xeb9b('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x31de58[_0xeb9b('0x6e')]}:_0x31de58);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 67e9ba2..64f286b 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 _0x1472=['../../config/logger','api','bluebird','request-promise','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1472,0x107));var _0x2147=function(_0x90e575,_0x48c2ec){_0x90e575=_0x90e575-0x0;var _0x1aae60=_0x1472[_0x90e575];return _0x1aae60;};'use strict';var _=require(_0x2147('0x0'));var util=require('util');var logger=require(_0x2147('0x1'))(_0x2147('0x2'));var moment=require('moment');var BPromise=require(_0x2147('0x3'));var rp=require(_0x2147('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2147('0x5'));var config=require('../../config/environment');var attributes=require(_0x2147('0x6'));var integrations=require(_0x2147('0x7'));module[_0x2147('0x8')]=function(_0x12b49d,_0x28bc93){return _0x12b49d[_0x2147('0x9')](_0x2147('0xa'),attributes,{'tableName':_0x2147('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67b1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0xbf0221,_0x8fed8d){var _0x311bb8=function(_0x13b053){while(--_0x13b053){_0xbf0221['push'](_0xbf0221['shift']());}};_0x311bb8(++_0x8fed8d);}(_0x67b1,0x191));var _0x167b=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0x67b1[_0x3048ea];return _0x1a13c4;};'use strict';var _=require(_0x167b('0x0'));var util=require(_0x167b('0x1'));var logger=require(_0x167b('0x2'))(_0x167b('0x3'));var moment=require(_0x167b('0x4'));var BPromise=require(_0x167b('0x5'));var rp=require(_0x167b('0x6'));var fs=require('fs');var path=require(_0x167b('0x7'));var rimraf=require(_0x167b('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x167b('0x9'));module[_0x167b('0xa')]=function(_0x43df36,_0x468558){return _0x43df36['define'](_0x167b('0xb'),attributes,{'tableName':_0x167b('0xc'),'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 c4435d5..994852f 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 _0x873e=['result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x873e,0x141));var _0xe873=function(_0xc05531,_0x3a57fe){_0xc05531=_0xc05531-0x0;var _0x273103=_0x873e[_0xc05531];return _0x273103;};'use strict';var _=require(_0xe873('0x0'));var util=require(_0xe873('0x1'));var moment=require(_0xe873('0x2'));var BPromise=require(_0xe873('0x3'));var rs=require(_0xe873('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe873('0x5'));var config=require(_0xe873('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe873('0x7')][_0xe873('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e82f9,_0xe089f1,_0xbdca0e){return new BPromise(function(_0x440748,_0x56d55a){return client[_0xe873('0x9')](_0x4e82f9,_0xbdca0e)[_0xe873('0xa')](function(_0x1d2141){logger['info'](_0xe873('0xb'),_0xe089f1,_0xe873('0xc'));logger[_0xe873('0xd')](_0xe873('0xe'),_0xe089f1,_0xe873('0xc'),JSON[_0xe873('0xf')](_0x1d2141));if(_0x1d2141[_0xe873('0x10')]){if(_0x1d2141[_0xe873('0x10')][_0xe873('0x11')]===0x1f4){logger[_0xe873('0x10')](_0xe873('0xb'),_0xe089f1,_0x1d2141[_0xe873('0x10')][_0xe873('0x12')]);return _0x56d55a(_0x1d2141[_0xe873('0x10')]['message']);}logger[_0xe873('0x10')](_0xe873('0xb'),_0xe089f1,_0x1d2141[_0xe873('0x10')][_0xe873('0x12')]);return _0x440748(_0x1d2141[_0xe873('0x10')][_0xe873('0x12')]);}else{logger['info'](_0xe873('0xb'),_0xe089f1,_0xe873('0xc'));_0x440748(_0x1d2141[_0xe873('0x13')][_0xe873('0x12')]);}})[_0xe873('0x14')](function(_0x27b5e8){logger[_0xe873('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0xe089f1,_0x27b5e8);_0x56d55a(_0x27b5e8);});});}exports[_0xe873('0x15')]=function(_0x284338){var _0x3bcd6c=this;return new Promise(function(_0x1fd766,_0x1e9e84){return db[_0xe873('0x16')][_0xe873('0x17')]({'raw':_0x284338[_0xe873('0x18')]?_0x284338[_0xe873('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x284338['options']?_0x284338[_0xe873('0x18')][_0xe873('0x19')]||null:null,'attributes':_0x284338[_0xe873('0x18')]?_0x284338[_0xe873('0x18')][_0xe873('0x1a')]||null:null,'limit':_0x284338[_0xe873('0x18')]?_0x284338[_0xe873('0x18')][_0xe873('0x1b')]||null:null,'include':_0x284338[_0xe873('0x18')]?_0x284338[_0xe873('0x18')][_0xe873('0x1c')]?_[_0xe873('0x1d')](_0x284338[_0xe873('0x18')][_0xe873('0x1c')],function(_0x10b469){return{'model':db[_0x10b469[_0xe873('0x1e')]],'as':_0x10b469['as'],'attributes':_0x10b469[_0xe873('0x1a')],'include':_0x10b469['include']?_[_0xe873('0x1d')](_0x10b469['include'],function(_0x1e02fa){return{'model':db[_0x1e02fa[_0xe873('0x1e')]],'as':_0x1e02fa['as'],'attributes':_0x1e02fa['attributes'],'include':_0x1e02fa[_0xe873('0x1c')]?_['map'](_0x1e02fa[_0xe873('0x1c')],function(_0x1fad34){return{'model':db[_0x1fad34[_0xe873('0x1e')]],'as':_0x1fad34['as'],'attributes':_0x1fad34[_0xe873('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe873('0xa')](function(_0x38eac3){logger['info'](_0xe873('0x15'),_0x284338);logger[_0xe873('0xd')]('GetZendeskAccount',_0x284338,JSON[_0xe873('0xf')](_0x38eac3));_0x1fd766(_0x38eac3);})[_0xe873('0x14')](function(_0x3998c3){logger[_0xe873('0x10')](_0xe873('0x15'),_0x3998c3['message'],_0x284338);_0x1e9e84(_0x3bcd6c[_0xe873('0x10')](0x1f4,_0x3998c3['message']));});});};exports['ShowZendeskAccount']=function(_0x9ab5f8){var _0x2658fd=this;return new Promise(function(_0x45908c,_0x238eb0){return db[_0xe873('0x16')][_0xe873('0x1f')]({'raw':_0x9ab5f8['options']?_0x9ab5f8['options'][_0xe873('0x20')]===undefined?!![]:![]:!![],'where':_0x9ab5f8[_0xe873('0x18')]?_0x9ab5f8[_0xe873('0x18')]['where']||null:null,'attributes':_0x9ab5f8[_0xe873('0x18')]?_0x9ab5f8[_0xe873('0x18')][_0xe873('0x1a')]||null:null,'include':_0x9ab5f8[_0xe873('0x18')]?_0x9ab5f8[_0xe873('0x18')][_0xe873('0x1c')]?_['map'](_0x9ab5f8[_0xe873('0x18')][_0xe873('0x1c')],function(_0x5d8c63){return{'model':db[_0x5d8c63['model']],'as':_0x5d8c63['as'],'attributes':_0x5d8c63[_0xe873('0x1a')],'include':_0x5d8c63['include']?_[_0xe873('0x1d')](_0x5d8c63[_0xe873('0x1c')],function(_0x258d0b){return{'model':db[_0x258d0b[_0xe873('0x1e')]],'as':_0x258d0b['as'],'attributes':_0x258d0b[_0xe873('0x1a')],'include':_0x258d0b[_0xe873('0x1c')]?_[_0xe873('0x1d')](_0x258d0b[_0xe873('0x1c')],function(_0x495bd2){return{'model':db[_0x495bd2['model']],'as':_0x495bd2['as'],'attributes':_0x495bd2[_0xe873('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe873('0xa')](function(_0x4e1d1b){logger['info'](_0xe873('0x21'),_0x9ab5f8);logger['debug'](_0xe873('0x21'),_0x9ab5f8,JSON['stringify'](_0x4e1d1b));_0x45908c(_0x4e1d1b);})[_0xe873('0x14')](function(_0x4c5bb1){logger['error'](_0xe873('0x21'),_0x4c5bb1[_0xe873('0x12')],_0x9ab5f8);_0x238eb0(_0x2658fd['error'](0x1f4,_0x4c5bb1[_0xe873('0x12')]));});});}; \ No newline at end of file +var _0x7d55=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','ZendeskAccount','lodash','util','moment','randomstring','ioredis'];(function(_0xe9e6cf,_0x395f6d){var _0x2b8851=function(_0x4d6bd4){while(--_0x4d6bd4){_0xe9e6cf['push'](_0xe9e6cf['shift']());}};_0x2b8851(++_0x395f6d);}(_0x7d55,0x1ad));var _0x57d5=function(_0x50e40c,_0x2689c8){_0x50e40c=_0x50e40c-0x0;var _0x201c44=_0x7d55[_0x50e40c];return _0x201c44;};'use strict';var _=require(_0x57d5('0x0'));var util=require(_0x57d5('0x1'));var moment=require(_0x57d5('0x2'));var BPromise=require('bluebird');var rs=require(_0x57d5('0x3'));var fs=require('fs');var Redis=require(_0x57d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x57d5('0x5'));var logger=require(_0x57d5('0x6'))('rpc');var config=require(_0x57d5('0x7'));var jayson=require(_0x57d5('0x8'));var client=jayson[_0x57d5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5535f9,_0x5b6c4f,_0x142b8e){return new BPromise(function(_0x5c235b,_0x317230){return client[_0x57d5('0xa')](_0x5535f9,_0x142b8e)[_0x57d5('0xb')](function(_0x54b401){logger[_0x57d5('0xc')](_0x57d5('0xd'),_0x5b6c4f,_0x57d5('0xe'));logger[_0x57d5('0xf')](_0x57d5('0x10'),_0x5b6c4f,_0x57d5('0xe'),JSON[_0x57d5('0x11')](_0x54b401));if(_0x54b401[_0x57d5('0x12')]){if(_0x54b401[_0x57d5('0x12')]['code']===0x1f4){logger[_0x57d5('0x12')](_0x57d5('0xd'),_0x5b6c4f,_0x54b401[_0x57d5('0x12')][_0x57d5('0x13')]);return _0x317230(_0x54b401[_0x57d5('0x12')][_0x57d5('0x13')]);}logger[_0x57d5('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x5b6c4f,_0x54b401['error'][_0x57d5('0x13')]);return _0x5c235b(_0x54b401['error'][_0x57d5('0x13')]);}else{logger[_0x57d5('0xc')](_0x57d5('0xd'),_0x5b6c4f,_0x57d5('0xe'));_0x5c235b(_0x54b401['result']['message']);}})[_0x57d5('0x14')](function(_0x5a0d09){logger[_0x57d5('0x12')](_0x57d5('0xd'),_0x5b6c4f,_0x5a0d09);_0x317230(_0x5a0d09);});});}exports[_0x57d5('0x15')]=function(_0x4bb12a){var _0x33785c=this;return new Promise(function(_0x20f0e9,_0x378d4c){return db['ZendeskAccount']['findAll']({'raw':_0x4bb12a[_0x57d5('0x16')]?_0x4bb12a[_0x57d5('0x16')][_0x57d5('0x17')]===undefined?!![]:![]:!![],'where':_0x4bb12a[_0x57d5('0x16')]?_0x4bb12a[_0x57d5('0x16')]['where']||null:null,'attributes':_0x4bb12a[_0x57d5('0x16')]?_0x4bb12a[_0x57d5('0x16')][_0x57d5('0x18')]||null:null,'limit':_0x4bb12a[_0x57d5('0x16')]?_0x4bb12a[_0x57d5('0x16')][_0x57d5('0x19')]||null:null,'include':_0x4bb12a[_0x57d5('0x16')]?_0x4bb12a[_0x57d5('0x16')][_0x57d5('0x1a')]?_[_0x57d5('0x1b')](_0x4bb12a[_0x57d5('0x16')][_0x57d5('0x1a')],function(_0x535bf9){return{'model':db[_0x535bf9[_0x57d5('0x1c')]],'as':_0x535bf9['as'],'attributes':_0x535bf9['attributes'],'include':_0x535bf9[_0x57d5('0x1a')]?_['map'](_0x535bf9[_0x57d5('0x1a')],function(_0x12c8ea){return{'model':db[_0x12c8ea[_0x57d5('0x1c')]],'as':_0x12c8ea['as'],'attributes':_0x12c8ea['attributes'],'include':_0x12c8ea[_0x57d5('0x1a')]?_[_0x57d5('0x1b')](_0x12c8ea['include'],function(_0x40ba92){return{'model':db[_0x40ba92[_0x57d5('0x1c')]],'as':_0x40ba92['as'],'attributes':_0x40ba92[_0x57d5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x57d5('0xb')](function(_0x51ad59){logger['info'](_0x57d5('0x15'),_0x4bb12a);logger[_0x57d5('0xf')](_0x57d5('0x15'),_0x4bb12a,JSON[_0x57d5('0x11')](_0x51ad59));_0x20f0e9(_0x51ad59);})[_0x57d5('0x14')](function(_0x1d03b0){logger[_0x57d5('0x12')](_0x57d5('0x15'),_0x1d03b0['message'],_0x4bb12a);_0x378d4c(_0x33785c[_0x57d5('0x12')](0x1f4,_0x1d03b0[_0x57d5('0x13')]));});});};exports[_0x57d5('0x1d')]=function(_0x49434a){var _0x3a3b0d=this;return new Promise(function(_0x9f2d5,_0x4e1847){return db[_0x57d5('0x1e')]['find']({'raw':_0x49434a[_0x57d5('0x16')]?_0x49434a[_0x57d5('0x16')][_0x57d5('0x17')]===undefined?!![]:![]:!![],'where':_0x49434a[_0x57d5('0x16')]?_0x49434a['options']['where']||null:null,'attributes':_0x49434a[_0x57d5('0x16')]?_0x49434a[_0x57d5('0x16')][_0x57d5('0x18')]||null:null,'include':_0x49434a['options']?_0x49434a[_0x57d5('0x16')]['include']?_['map'](_0x49434a[_0x57d5('0x16')][_0x57d5('0x1a')],function(_0x4c09f7){return{'model':db[_0x4c09f7[_0x57d5('0x1c')]],'as':_0x4c09f7['as'],'attributes':_0x4c09f7['attributes'],'include':_0x4c09f7[_0x57d5('0x1a')]?_['map'](_0x4c09f7[_0x57d5('0x1a')],function(_0x2e2485){return{'model':db[_0x2e2485[_0x57d5('0x1c')]],'as':_0x2e2485['as'],'attributes':_0x2e2485[_0x57d5('0x18')],'include':_0x2e2485['include']?_['map'](_0x2e2485['include'],function(_0xfc9207){return{'model':db[_0xfc9207['model']],'as':_0xfc9207['as'],'attributes':_0xfc9207[_0x57d5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x57d5('0xb')](function(_0x49d09b){logger[_0x57d5('0xc')](_0x57d5('0x1d'),_0x49434a);logger[_0x57d5('0xf')](_0x57d5('0x1d'),_0x49434a,JSON[_0x57d5('0x11')](_0x49d09b));_0x9f2d5(_0x49d09b);})[_0x57d5('0x14')](function(_0x282122){logger[_0x57d5('0x12')](_0x57d5('0x1d'),_0x282122[_0x57d5('0x13')],_0x49434a);_0x4e1847(_0x3a3b0d[_0x57d5('0x12')](0x1f4,_0x282122[_0x57d5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index b524afe..fd605fc 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 _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x417505,_0x56ecfe){var _0x5ac87d=function(_0x13e009){while(--_0x13e009){_0x417505['push'](_0x417505['shift']());}};_0x5ac87d(++_0x56ecfe);}(_0x4fc2,0x111));var _0x24fc=function(_0x57957f,_0x4e70f7){_0x57957f=_0x57957f-0x0;var _0x46c750=_0x4fc2[_0x57957f];return _0x46c750;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file +var _0x9ffd=['update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put'];(function(_0x1d6dea,_0x1f8978){var _0x1b5967=function(_0x4a95f6){while(--_0x4a95f6){_0x1d6dea['push'](_0x1d6dea['shift']());}};_0x1b5967(++_0x1f8978);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x32162c,_0x34a4d9){_0x32162c=_0x32162c-0x0;var _0x20df9d=_0x9ffd[_0x32162c];return _0x20df9d;};'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('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0xb')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['getTags']);router['post']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['setTags']);router[_0xd9ff('0x15')](_0xd9ff('0xc'),auth['isAuthenticated'](),controller[_0xd9ff('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd9ff('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index b833cf0..78bda40 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 _0xc475=['sequelize','exports','STRING'];(function(_0x41a4e9,_0x3d1124){var _0x43cf9a=function(_0x361990){while(--_0x361990){_0x41a4e9['push'](_0x41a4e9['shift']());}};_0x43cf9a(++_0x3d1124);}(_0xc475,0xe4));var _0x5c47=function(_0x510329,_0x1ea936){_0x510329=_0x510329-0x0;var _0xf772f3=_0xc475[_0x510329];return _0xf772f3;};'use strict';var Sequelize=require(_0x5c47('0x0'));module[_0x5c47('0x1')]={'name':{'type':Sequelize[_0x5c47('0x2')]},'description':{'type':Sequelize[_0x5c47('0x2')]}}; \ No newline at end of file +var _0x1e68=['STRING','sequelize','exports'];(function(_0x33c619,_0x4f7c37){var _0xde7647=function(_0x660662){while(--_0x660662){_0x33c619['push'](_0x33c619['shift']());}};_0xde7647(++_0x4f7c37);}(_0x1e68,0x1ed));var _0x81e6=function(_0x2476e6,_0x47e762){_0x2476e6=_0x2476e6-0x0;var _0x6a2ebf=_0x1e68[_0x2476e6];return _0x6a2ebf;};'use strict';var Sequelize=require(_0x81e6('0x0'));module[_0x81e6('0x1')]={'name':{'type':Sequelize[_0x81e6('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 e8282ea..477f1a6 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 _0x366a=['getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','findOne','ZendeskField'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0x366a,0x144));var _0xa366=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x366a[_0x1f5887];return _0x21774b;};'use strict';var emlformat=require(_0xa366('0x0'));var rimraf=require(_0xa366('0x1'));var zipdir=require(_0xa366('0x2'));var jsonpatch=require(_0xa366('0x3'));var rp=require(_0xa366('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa366('0x5'));var util=require(_0xa366('0x6'));var path=require(_0xa366('0x7'));var sox=require('sox');var csv=require(_0xa366('0x8'));var ejs=require(_0xa366('0x9'));var fs=require('fs');var fs_extra=require(_0xa366('0xa'));var _=require(_0xa366('0xb'));var squel=require('squel');var crypto=require(_0xa366('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa366('0x8'));var querystring=require(_0xa366('0xd'));var Papa=require(_0xa366('0xe'));var Redis=require(_0xa366('0xf'));var authService=require(_0xa366('0x10'));var qs=require(_0xa366('0x11'));var as=require(_0xa366('0x12'));var hardwareService=require(_0xa366('0x13'));var logger=require(_0xa366('0x14'))(_0xa366('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa366('0x16'))['db'];function respondWithStatusCode(_0x114801,_0xee73d0){_0xee73d0=_0xee73d0||0xcc;return function(_0x345016){if(_0x345016){return _0x114801[_0xa366('0x17')](_0xee73d0);}return _0x114801[_0xa366('0x18')](_0xee73d0)['end']();};}function respondWithResult(_0xeb83dd,_0x257819){_0x257819=_0x257819||0xc8;return function(_0x169381){if(_0x169381){return _0xeb83dd[_0xa366('0x18')](_0x257819)[_0xa366('0x19')](_0x169381);}};}function respondWithFilteredResult(_0x3230dc,_0xada482){return function(_0x506f24){if(_0x506f24){var _0x2d553e=typeof _0xada482[_0xa366('0x1a')]===_0xa366('0x1b')&&typeof _0xada482[_0xa366('0x1c')]===_0xa366('0x1b');var _0x401610=_0x506f24[_0xa366('0x1d')];var _0x42b0b0=_0x2d553e?0x0:_0xada482[_0xa366('0x1a')];var _0x36cbf7=_0x2d553e?_0x506f24[_0xa366('0x1d')]:_0xada482[_0xa366('0x1a')]+_0xada482[_0xa366('0x1c')];var _0x397521;if(_0x36cbf7>=_0x401610){_0x36cbf7=_0x401610;_0x397521=0xc8;}else{_0x397521=0xce;}_0x3230dc[_0xa366('0x18')](_0x397521);return _0x3230dc[_0xa366('0x1e')](_0xa366('0x1f'),_0x42b0b0+'-'+_0x36cbf7+'/'+_0x401610)[_0xa366('0x19')](_0x506f24);}return null;};}function patchUpdates(_0x5af2eb){return function(_0x143136){try{jsonpatch[_0xa366('0x20')](_0x143136,_0x5af2eb,!![]);}catch(_0x1f2f38){return BPromise['reject'](_0x1f2f38);}return _0x143136[_0xa366('0x21')]();};}function saveUpdates(_0xf6e1f5,_0x96214d){return function(_0x3fd648){if(_0x3fd648){return _0x3fd648['update'](_0xf6e1f5)[_0xa366('0x22')](function(_0x3643e2){return _0x3643e2;});}return null;};}function removeEntity(_0x5d8439,_0x55f8b8){return function(_0x5144de){if(_0x5144de){return _0x5144de[_0xa366('0x23')]()[_0xa366('0x22')](function(){_0x5d8439[_0xa366('0x18')](0xcc)[_0xa366('0x24')]();});}};}function handleEntityNotFound(_0x4611c7,_0x460aa4){return function(_0x193c9c){if(!_0x193c9c){_0x4611c7[_0xa366('0x17')](0x194);}return _0x193c9c;};}function handleError(_0xe376c2,_0x41ef31){_0x41ef31=_0x41ef31||0x1f4;return function(_0x1343af){logger[_0xa366('0x25')](_0x1343af[_0xa366('0x26')]);if(_0x1343af[_0xa366('0x27')]){delete _0x1343af['name'];}_0xe376c2[_0xa366('0x18')](_0x41ef31)[_0xa366('0x28')](_0x1343af);};}exports[_0xa366('0x29')]=function(_0xf44afd,_0x4b12e2){var _0x538c9a={},_0x178aa2={},_0x50000c={'count':0x0,'rows':[]};var _0x4bc658=_[_0xa366('0x2a')](db['ZendeskConfiguration'][_0xa366('0x2b')],function(_0x52dc80){return{'name':_0x52dc80['fieldName'],'type':_0x52dc80[_0xa366('0x2c')][_0xa366('0x2d')]};});_0x178aa2[_0xa366('0x2e')]=_[_0xa366('0x2a')](_0x4bc658,_0xa366('0x27'));_0x178aa2[_0xa366('0x2f')]=_[_0xa366('0x30')](_0xf44afd[_0xa366('0x2f')]);_0x178aa2[_0xa366('0x31')]=_[_0xa366('0x32')](_0x178aa2[_0xa366('0x2e')],_0x178aa2[_0xa366('0x2f')]);_0x538c9a[_0xa366('0x33')]=_[_0xa366('0x32')](_0x178aa2['model'],qs['fields'](_0xf44afd[_0xa366('0x2f')][_0xa366('0x34')]));_0x538c9a['attributes']=_0x538c9a[_0xa366('0x33')][_0xa366('0x35')]?_0x538c9a['attributes']:_0x178aa2[_0xa366('0x2e')];if(!_0xf44afd[_0xa366('0x2f')][_0xa366('0x36')](_0xa366('0x37'))){_0x538c9a[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0xf44afd[_0xa366('0x2f')][_0xa366('0x1c')]);_0x538c9a['offset']=qs[_0xa366('0x1a')](_0xf44afd[_0xa366('0x2f')][_0xa366('0x1a')]);}_0x538c9a[_0xa366('0x38')]=qs['sort'](_0xf44afd[_0xa366('0x2f')][_0xa366('0x39')]);_0x538c9a[_0xa366('0x3a')]=qs[_0xa366('0x31')](_[_0xa366('0x3b')](_0xf44afd[_0xa366('0x2f')],_0x178aa2[_0xa366('0x31')]),_0x4bc658);if(_0xf44afd[_0xa366('0x2f')][_0xa366('0x3c')]){_0x538c9a[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0x538c9a['where'],{'$or':_['map'](_0x4bc658,function(_0x4eb5a0){if(_0x4eb5a0[_0xa366('0x2c')]!==_0xa366('0x3e')){var _0x49965f={};_0x49965f[_0x4eb5a0[_0xa366('0x27')]]={'$like':'%'+_0xf44afd[_0xa366('0x2f')][_0xa366('0x3c')]+'%'};return _0x49965f;}})});}_0x538c9a=_[_0xa366('0x3d')]({},_0x538c9a,_0xf44afd[_0xa366('0x3f')]);var _0x2f0c26={'where':_0x538c9a['where']};return db[_0xa366('0x40')]['count'](_0x2f0c26)['then'](function(_0x15f6b9){_0x50000c[_0xa366('0x1d')]=_0x15f6b9;if(_0xf44afd[_0xa366('0x2f')][_0xa366('0x41')]){_0x538c9a[_0xa366('0x42')]=[{'all':!![]}];}return db[_0xa366('0x40')][_0xa366('0x43')](_0x538c9a);})[_0xa366('0x22')](function(_0x32def3){_0x50000c[_0xa366('0x44')]=_0x32def3;return _0x50000c;})[_0xa366('0x22')](respondWithFilteredResult(_0x4b12e2,_0x538c9a))[_0xa366('0x45')](handleError(_0x4b12e2,null));};exports['show']=function(_0x3fb591,_0xc450ed){var _0x4721e0={'raw':![],'where':{'id':_0x3fb591[_0xa366('0x46')]['id']}},_0xa00a47={};_0xa00a47[_0xa366('0x2e')]=_['keys'](db[_0xa366('0x40')]['rawAttributes']);_0xa00a47['query']=_[_0xa366('0x30')](_0x3fb591['query']);_0xa00a47[_0xa366('0x31')]=_[_0xa366('0x32')](_0xa00a47['model'],_0xa00a47['query']);_0x4721e0[_0xa366('0x33')]=_[_0xa366('0x32')](_0xa00a47['model'],qs[_0xa366('0x34')](_0x3fb591[_0xa366('0x2f')][_0xa366('0x34')]));_0x4721e0['attributes']=_0x4721e0[_0xa366('0x33')]['length']?_0x4721e0[_0xa366('0x33')]:_0xa00a47[_0xa366('0x2e')];if(_0x3fb591[_0xa366('0x2f')][_0xa366('0x41')]){_0x4721e0[_0xa366('0x42')]=[{'all':!![]}];}_0x4721e0=_[_0xa366('0x3d')]({},_0x4721e0,_0x3fb591[_0xa366('0x3f')]);return db[_0xa366('0x40')][_0xa366('0x47')](_0x4721e0)[_0xa366('0x22')](handleEntityNotFound(_0xc450ed,null))[_0xa366('0x22')](respondWithResult(_0xc450ed,null))[_0xa366('0x45')](handleError(_0xc450ed,null));};exports[_0xa366('0x48')]=function(_0xbcf8e1,_0x4da2d9){return db[_0xa366('0x40')][_0xa366('0x48')](_0xbcf8e1[_0xa366('0x49')],{})[_0xa366('0x22')](respondWithResult(_0x4da2d9,0xc9))[_0xa366('0x45')](handleError(_0x4da2d9,null));};exports['update']=function(_0x193a24,_0x58cb7d){if(_0x193a24[_0xa366('0x49')]['id']){delete _0x193a24['body']['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x193a24[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x58cb7d,null))[_0xa366('0x22')](saveUpdates(_0x193a24[_0xa366('0x49')],null))[_0xa366('0x22')](respondWithResult(_0x58cb7d,null))[_0xa366('0x45')](handleError(_0x58cb7d,null));};exports[_0xa366('0x23')]=function(_0x557bea,_0x1b1a7b){return db[_0xa366('0x40')][_0xa366('0x47')]({'where':{'id':_0x557bea[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x1b1a7b,null))[_0xa366('0x22')](removeEntity(_0x1b1a7b,null))['catch'](handleError(_0x1b1a7b,null));};exports['getFields']=function(_0x3de849,_0x511461,_0x4899de){var _0x336220={};var _0x5a09b5={};var _0x3c401f;var _0x427f35;return db[_0xa366('0x40')][_0xa366('0x4a')]({'where':{'id':_0x3de849[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x511461,null))[_0xa366('0x22')](function(_0x2ade78){if(_0x2ade78){_0x3c401f=_0x2ade78;_0x5a09b5['model']=_[_0xa366('0x30')](db[_0xa366('0x4b')]['rawAttributes']);_0x5a09b5[_0xa366('0x2f')]=_[_0xa366('0x30')](_0x3de849[_0xa366('0x2f')]);_0x5a09b5[_0xa366('0x31')]=_[_0xa366('0x32')](_0x5a09b5['model'],_0x5a09b5['query']);_0x336220[_0xa366('0x33')]=_[_0xa366('0x32')](_0x5a09b5[_0xa366('0x2e')],qs[_0xa366('0x34')](_0x3de849[_0xa366('0x2f')]['fields']));_0x336220[_0xa366('0x33')]=_0x336220[_0xa366('0x33')][_0xa366('0x35')]?_0x336220['attributes']:_0x5a09b5['model'];_0x336220[_0xa366('0x38')]=qs[_0xa366('0x39')](_0x3de849[_0xa366('0x2f')]['sort']);_0x336220['where']=qs[_0xa366('0x31')](_[_0xa366('0x3b')](_0x3de849[_0xa366('0x2f')],_0x5a09b5['filters']));if(_0x3de849[_0xa366('0x2f')][_0xa366('0x3c')]){_0x336220[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0x336220['where'],{'$or':_['map'](_0x336220[_0xa366('0x33')],function(_0xfd53f0){var _0xccad4d={};_0xccad4d[_0xfd53f0]={'$like':'%'+_0x3de849['query'][_0xa366('0x3c')]+'%'};return _0xccad4d;})});}_0x336220=_['merge']({},_0x336220,_0x3de849[_0xa366('0x3f')]);return _0x3c401f['getFields'](_0x336220);}})['then'](function(_0x570554){if(_0x570554){_0x427f35=_0x570554['length'];if(!_0x3de849[_0xa366('0x2f')][_0xa366('0x36')](_0xa366('0x37'))){_0x336220[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x3de849[_0xa366('0x2f')][_0xa366('0x1c')]);_0x336220[_0xa366('0x1a')]=qs['offset'](_0x3de849['query']['offset']);}return _0x3c401f['getFields'](_0x336220);}})[_0xa366('0x22')](function(_0x1404af){if(_0x1404af){return _0x1404af?{'count':_0x427f35,'rows':_0x1404af}:null;}})[_0xa366('0x22')](respondWithResult(_0x511461,null))[_0xa366('0x45')](handleError(_0x511461,null));};exports['getSubjects']=function(_0x4851c6,_0x21faa0,_0x58a00f){var _0x3b6154={};var _0x99f2c={};var _0x12ac56;var _0x57e3a7;return db[_0xa366('0x40')][_0xa366('0x4a')]({'where':{'id':_0x4851c6[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x21faa0,null))['then'](function(_0x2e7221){if(_0x2e7221){_0x12ac56=_0x2e7221;_0x99f2c[_0xa366('0x2e')]=_[_0xa366('0x30')](db[_0xa366('0x4b')][_0xa366('0x2b')]);_0x99f2c[_0xa366('0x2f')]=_['keys'](_0x4851c6[_0xa366('0x2f')]);_0x99f2c[_0xa366('0x31')]=_[_0xa366('0x32')](_0x99f2c['model'],_0x99f2c[_0xa366('0x2f')]);_0x3b6154['attributes']=_['intersection'](_0x99f2c[_0xa366('0x2e')],qs['fields'](_0x4851c6[_0xa366('0x2f')]['fields']));_0x3b6154[_0xa366('0x33')]=_0x3b6154[_0xa366('0x33')][_0xa366('0x35')]?_0x3b6154[_0xa366('0x33')]:_0x99f2c['model'];_0x3b6154['order']=qs[_0xa366('0x39')](_0x4851c6[_0xa366('0x2f')][_0xa366('0x39')]);_0x3b6154['where']=qs['filters'](_['pick'](_0x4851c6['query'],_0x99f2c['filters']));if(_0x4851c6[_0xa366('0x2f')][_0xa366('0x3c')]){_0x3b6154[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0x3b6154[_0xa366('0x3a')],{'$or':_['map'](_0x3b6154['attributes'],function(_0x1c6272){var _0xda0486={};_0xda0486[_0x1c6272]={'$like':'%'+_0x4851c6[_0xa366('0x2f')][_0xa366('0x3c')]+'%'};return _0xda0486;})});}_0x3b6154=_['merge']({},_0x3b6154,_0x4851c6[_0xa366('0x3f')]);return _0x12ac56['getSubjects'](_0x3b6154);}})[_0xa366('0x22')](function(_0x1a1d8d){if(_0x1a1d8d){_0x57e3a7=_0x1a1d8d['length'];if(!_0x4851c6[_0xa366('0x2f')]['hasOwnProperty'](_0xa366('0x37'))){_0x3b6154[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x4851c6[_0xa366('0x2f')]['limit']);_0x3b6154[_0xa366('0x1a')]=qs[_0xa366('0x1a')](_0x4851c6['query'][_0xa366('0x1a')]);}return _0x12ac56['getSubjects'](_0x3b6154);}})[_0xa366('0x22')](function(_0x16328c){if(_0x16328c){return _0x16328c?{'count':_0x57e3a7,'rows':_0x16328c}:null;}})['then'](respondWithResult(_0x21faa0,null))['catch'](handleError(_0x21faa0,null));};exports[_0xa366('0x4c')]=function(_0x2abea9,_0x57fa3b,_0x705dd){var _0xebdd4f={};var _0x5b26ce={};var _0x10abaf;var _0x435639;return db[_0xa366('0x40')][_0xa366('0x4a')]({'where':{'id':_0x2abea9[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x57fa3b,null))[_0xa366('0x22')](function(_0x5a8bf9){if(_0x5a8bf9){_0x10abaf=_0x5a8bf9;_0x5b26ce[_0xa366('0x2e')]=_['keys'](db[_0xa366('0x4b')][_0xa366('0x2b')]);_0x5b26ce['query']=_['keys'](_0x2abea9[_0xa366('0x2f')]);_0x5b26ce[_0xa366('0x31')]=_[_0xa366('0x32')](_0x5b26ce[_0xa366('0x2e')],_0x5b26ce[_0xa366('0x2f')]);_0xebdd4f[_0xa366('0x33')]=_[_0xa366('0x32')](_0x5b26ce[_0xa366('0x2e')],qs[_0xa366('0x34')](_0x2abea9['query']['fields']));_0xebdd4f[_0xa366('0x33')]=_0xebdd4f[_0xa366('0x33')][_0xa366('0x35')]?_0xebdd4f[_0xa366('0x33')]:_0x5b26ce[_0xa366('0x2e')];_0xebdd4f[_0xa366('0x38')]=qs[_0xa366('0x39')](_0x2abea9['query'][_0xa366('0x39')]);_0xebdd4f[_0xa366('0x3a')]=qs[_0xa366('0x31')](_[_0xa366('0x3b')](_0x2abea9['query'],_0x5b26ce['filters']));if(_0x2abea9[_0xa366('0x2f')][_0xa366('0x3c')]){_0xebdd4f[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0xebdd4f[_0xa366('0x3a')],{'$or':_[_0xa366('0x2a')](_0xebdd4f['attributes'],function(_0x113c97){var _0x180f40={};_0x180f40[_0x113c97]={'$like':'%'+_0x2abea9[_0xa366('0x2f')][_0xa366('0x3c')]+'%'};return _0x180f40;})});}_0xebdd4f=_[_0xa366('0x3d')]({},_0xebdd4f,_0x2abea9[_0xa366('0x3f')]);return _0x10abaf[_0xa366('0x4c')](_0xebdd4f);}})[_0xa366('0x22')](function(_0x47ea4a){if(_0x47ea4a){_0x435639=_0x47ea4a[_0xa366('0x35')];if(!_0x2abea9[_0xa366('0x2f')][_0xa366('0x36')](_0xa366('0x37'))){_0xebdd4f[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x2abea9[_0xa366('0x2f')][_0xa366('0x1c')]);_0xebdd4f['offset']=qs[_0xa366('0x1a')](_0x2abea9[_0xa366('0x2f')]['offset']);}return _0x10abaf[_0xa366('0x4c')](_0xebdd4f);}})[_0xa366('0x22')](function(_0x3292ae){if(_0x3292ae){return _0x3292ae?{'count':_0x435639,'rows':_0x3292ae}:null;}})[_0xa366('0x22')](respondWithResult(_0x57fa3b,null))[_0xa366('0x45')](handleError(_0x57fa3b,null));};exports[_0xa366('0x4d')]=function(_0x30de06,_0x5c53c3,_0xaabdf7){var _0x7a8a2={};var _0x5994e3={};var _0xd5edcd;var _0x4e1c87;return db[_0xa366('0x40')]['findOne']({'where':{'id':_0x30de06[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x5c53c3,null))['then'](function(_0xb248e3){if(_0xb248e3){_0xd5edcd=_0xb248e3;_0x5994e3['model']=_[_0xa366('0x30')](db[_0xa366('0x4e')]['rawAttributes']);_0x5994e3[_0xa366('0x2f')]=_[_0xa366('0x30')](_0x30de06[_0xa366('0x2f')]);_0x5994e3[_0xa366('0x31')]=_[_0xa366('0x32')](_0x5994e3[_0xa366('0x2e')],_0x5994e3[_0xa366('0x2f')]);_0x7a8a2[_0xa366('0x33')]=_[_0xa366('0x32')](_0x5994e3['model'],qs['fields'](_0x30de06[_0xa366('0x2f')][_0xa366('0x34')]));_0x7a8a2[_0xa366('0x33')]=_0x7a8a2['attributes'][_0xa366('0x35')]?_0x7a8a2[_0xa366('0x33')]:_0x5994e3[_0xa366('0x2e')];_0x7a8a2['order']=qs[_0xa366('0x39')](_0x30de06[_0xa366('0x2f')][_0xa366('0x39')]);_0x7a8a2[_0xa366('0x3a')]=qs[_0xa366('0x31')](_[_0xa366('0x3b')](_0x30de06[_0xa366('0x2f')],_0x5994e3['filters']));if(_0x30de06['query']['filter']){_0x7a8a2[_0xa366('0x3a')]=_[_0xa366('0x3d')](_0x7a8a2[_0xa366('0x3a')],{'$or':_['map'](_0x7a8a2[_0xa366('0x33')],function(_0x599456){var _0x11e1a3={};_0x11e1a3[_0x599456]={'$like':'%'+_0x30de06[_0xa366('0x2f')][_0xa366('0x3c')]+'%'};return _0x11e1a3;})});}_0x7a8a2=_['merge']({},_0x7a8a2,_0x30de06[_0xa366('0x3f')]);return _0xd5edcd['getTags'](_0x7a8a2);}})[_0xa366('0x22')](function(_0x28bdf6){if(_0x28bdf6){_0x4e1c87=_0x28bdf6[_0xa366('0x35')];if(!_0x30de06['query'][_0xa366('0x36')](_0xa366('0x37'))){_0x7a8a2[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x30de06[_0xa366('0x2f')][_0xa366('0x1c')]);_0x7a8a2[_0xa366('0x1a')]=qs[_0xa366('0x1a')](_0x30de06[_0xa366('0x2f')][_0xa366('0x1a')]);}return _0xd5edcd[_0xa366('0x4d')](_0x7a8a2);}})[_0xa366('0x22')](function(_0x18a0fc){if(_0x18a0fc){return _0x18a0fc?{'count':_0x4e1c87,'rows':_0x18a0fc}:null;}})[_0xa366('0x22')](respondWithResult(_0x5c53c3,null))[_0xa366('0x45')](handleError(_0x5c53c3,null));};exports['setTags']=function(_0x294a99,_0x1426d1,_0x3fe3e7){if(_0x294a99['body']['id']){delete _0x294a99[_0xa366('0x49')]['id'];}return db[_0xa366('0x40')]['findOne']({'where':{'id':_0x294a99[_0xa366('0x46')]['id']}})[_0xa366('0x22')](handleEntityNotFound(_0x1426d1,null))['then'](function(_0x43bf7e){if(_0x43bf7e){return _0x43bf7e[_0xa366('0x4f')](_0x294a99[_0xa366('0x49')]['ids']||[]);}return null;})['then'](respondWithResult(_0x1426d1,null))['catch'](handleError(_0x1426d1,null));}; \ No newline at end of file +var _0xf4c2=['findAll','catch','show','params','create','body','find','getFields','findOne','ZendeskField','length','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','util','path','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/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x51c6ce,_0x19f801){var _0x476cf7=function(_0x366deb){while(--_0x366deb){_0x51c6ce['push'](_0x51c6ce['shift']());}};_0x476cf7(++_0x19f801);}(_0xf4c2,0x165));var _0x2f4c=function(_0xaa3fa2,_0x50f446){_0xaa3fa2=_0xaa3fa2-0x0;var _0x2d680b=_0xf4c2[_0xaa3fa2];return _0x2d680b;};'use strict';var emlformat=require(_0x2f4c('0x0'));var rimraf=require(_0x2f4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2f4c('0x2'));var moment=require(_0x2f4c('0x3'));var BPromise=require(_0x2f4c('0x4'));var Mustache=require('mustache');var util=require(_0x2f4c('0x5'));var path=require(_0x2f4c('0x6'));var sox=require('sox');var csv=require(_0x2f4c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f4c('0x8'));var squel=require(_0x2f4c('0x9'));var crypto=require('crypto');var jsforce=require(_0x2f4c('0xa'));var deskjs=require(_0x2f4c('0xb'));var toCsv=require(_0x2f4c('0x7'));var querystring=require(_0x2f4c('0xc'));var Papa=require(_0x2f4c('0xd'));var Redis=require(_0x2f4c('0xe'));var authService=require(_0x2f4c('0xf'));var qs=require(_0x2f4c('0x10'));var as=require(_0x2f4c('0x11'));var hardwareService=require(_0x2f4c('0x12'));var logger=require(_0x2f4c('0x13'))(_0x2f4c('0x14'));var utils=require(_0x2f4c('0x15'));var config=require(_0x2f4c('0x16'));var licenseUtil=require(_0x2f4c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2612b4,_0x3eedb7){_0x3eedb7=_0x3eedb7||0xcc;return function(_0x6debc7){if(_0x6debc7){return _0x2612b4[_0x2f4c('0x18')](_0x3eedb7);}return _0x2612b4['status'](_0x3eedb7)[_0x2f4c('0x19')]();};}function respondWithResult(_0x3f1678,_0x233a43){_0x233a43=_0x233a43||0xc8;return function(_0x4af622){if(_0x4af622){return _0x3f1678[_0x2f4c('0x1a')](_0x233a43)[_0x2f4c('0x1b')](_0x4af622);}};}function respondWithFilteredResult(_0x3b395b,_0x24d55d){return function(_0x23f38c){if(_0x23f38c){var _0x1cae8b=typeof _0x24d55d['offset']===_0x2f4c('0x1c')&&typeof _0x24d55d['limit']===_0x2f4c('0x1c');var _0x49c871=_0x23f38c['count'];var _0x29bc3e=_0x1cae8b?0x0:_0x24d55d[_0x2f4c('0x1d')];var _0x447ec7=_0x1cae8b?_0x23f38c[_0x2f4c('0x1e')]:_0x24d55d[_0x2f4c('0x1d')]+_0x24d55d[_0x2f4c('0x1f')];var _0x40c327;if(_0x447ec7>=_0x49c871){_0x447ec7=_0x49c871;_0x40c327=0xc8;}else{_0x40c327=0xce;}_0x3b395b[_0x2f4c('0x1a')](_0x40c327);return _0x3b395b[_0x2f4c('0x20')](_0x2f4c('0x21'),_0x29bc3e+'-'+_0x447ec7+'/'+_0x49c871)[_0x2f4c('0x1b')](_0x23f38c);}return null;};}function patchUpdates(_0x28364a){return function(_0x270392){try{jsonpatch[_0x2f4c('0x22')](_0x270392,_0x28364a,!![]);}catch(_0x177780){return BPromise[_0x2f4c('0x23')](_0x177780);}return _0x270392[_0x2f4c('0x24')]();};}function saveUpdates(_0x45becb,_0x58137d){return function(_0x4b76e3){if(_0x4b76e3){return _0x4b76e3[_0x2f4c('0x25')](_0x45becb)[_0x2f4c('0x26')](function(_0x5ad3db){return _0x5ad3db;});}return null;};}function removeEntity(_0x232cd9,_0xeb905a){return function(_0x18a136){if(_0x18a136){return _0x18a136[_0x2f4c('0x27')]()[_0x2f4c('0x26')](function(){_0x232cd9[_0x2f4c('0x1a')](0xcc)[_0x2f4c('0x19')]();});}};}function handleEntityNotFound(_0x4d8c91,_0xfe4ea3){return function(_0x518096){if(!_0x518096){_0x4d8c91['sendStatus'](0x194);}return _0x518096;};}function handleError(_0x8a8385,_0x35a657){_0x35a657=_0x35a657||0x1f4;return function(_0x1dd86e){logger['error'](_0x1dd86e[_0x2f4c('0x28')]);if(_0x1dd86e[_0x2f4c('0x29')]){delete _0x1dd86e[_0x2f4c('0x29')];}_0x8a8385[_0x2f4c('0x1a')](_0x35a657)[_0x2f4c('0x2a')](_0x1dd86e);};}exports[_0x2f4c('0x2b')]=function(_0x407949,_0x5aa3b4){var _0xf77c20={},_0x11aba3={},_0x40776d={'count':0x0,'rows':[]};var _0x429a9a=_[_0x2f4c('0x2c')](db[_0x2f4c('0x2d')][_0x2f4c('0x2e')],function(_0x4b000b){return{'name':_0x4b000b[_0x2f4c('0x2f')],'type':_0x4b000b[_0x2f4c('0x30')]['key']};});_0x11aba3[_0x2f4c('0x31')]=_['map'](_0x429a9a,'name');_0x11aba3['query']=_[_0x2f4c('0x32')](_0x407949[_0x2f4c('0x33')]);_0x11aba3[_0x2f4c('0x34')]=_[_0x2f4c('0x35')](_0x11aba3[_0x2f4c('0x31')],_0x11aba3[_0x2f4c('0x33')]);_0xf77c20[_0x2f4c('0x36')]=_['intersection'](_0x11aba3[_0x2f4c('0x31')],qs[_0x2f4c('0x37')](_0x407949[_0x2f4c('0x33')][_0x2f4c('0x37')]));_0xf77c20['attributes']=_0xf77c20['attributes']['length']?_0xf77c20[_0x2f4c('0x36')]:_0x11aba3['model'];if(!_0x407949[_0x2f4c('0x33')][_0x2f4c('0x38')](_0x2f4c('0x39'))){_0xf77c20[_0x2f4c('0x1f')]=qs[_0x2f4c('0x1f')](_0x407949[_0x2f4c('0x33')][_0x2f4c('0x1f')]);_0xf77c20['offset']=qs[_0x2f4c('0x1d')](_0x407949[_0x2f4c('0x33')][_0x2f4c('0x1d')]);}_0xf77c20[_0x2f4c('0x3a')]=qs[_0x2f4c('0x3b')](_0x407949[_0x2f4c('0x33')][_0x2f4c('0x3b')]);_0xf77c20['where']=qs[_0x2f4c('0x34')](_[_0x2f4c('0x3c')](_0x407949['query'],_0x11aba3['filters']),_0x429a9a);if(_0x407949[_0x2f4c('0x33')][_0x2f4c('0x3d')]){_0xf77c20[_0x2f4c('0x3e')]=_[_0x2f4c('0x3f')](_0xf77c20[_0x2f4c('0x3e')],{'$or':_[_0x2f4c('0x2c')](_0x429a9a,function(_0x42a567){if(_0x42a567[_0x2f4c('0x30')]!==_0x2f4c('0x40')){var _0xfe572b={};_0xfe572b[_0x42a567['name']]={'$like':'%'+_0x407949[_0x2f4c('0x33')][_0x2f4c('0x3d')]+'%'};return _0xfe572b;}})});}_0xf77c20=_['merge']({},_0xf77c20,_0x407949[_0x2f4c('0x41')]);var _0x58da46={'where':_0xf77c20['where']};return db[_0x2f4c('0x2d')][_0x2f4c('0x1e')](_0x58da46)['then'](function(_0x5cbf0a){_0x40776d['count']=_0x5cbf0a;if(_0x407949[_0x2f4c('0x33')][_0x2f4c('0x42')]){_0xf77c20[_0x2f4c('0x43')]=[{'all':!![]}];}return db[_0x2f4c('0x2d')][_0x2f4c('0x44')](_0xf77c20);})['then'](function(_0x4d0bed){_0x40776d['rows']=_0x4d0bed;return _0x40776d;})[_0x2f4c('0x26')](respondWithFilteredResult(_0x5aa3b4,_0xf77c20))[_0x2f4c('0x45')](handleError(_0x5aa3b4,null));};exports[_0x2f4c('0x46')]=function(_0x5eacdd,_0x440376){var _0x3afce9={'raw':![],'where':{'id':_0x5eacdd[_0x2f4c('0x47')]['id']}},_0x15618e={};_0x15618e[_0x2f4c('0x31')]=_[_0x2f4c('0x32')](db[_0x2f4c('0x2d')][_0x2f4c('0x2e')]);_0x15618e['query']=_[_0x2f4c('0x32')](_0x5eacdd['query']);_0x15618e[_0x2f4c('0x34')]=_['intersection'](_0x15618e[_0x2f4c('0x31')],_0x15618e[_0x2f4c('0x33')]);_0x3afce9[_0x2f4c('0x36')]=_[_0x2f4c('0x35')](_0x15618e['model'],qs['fields'](_0x5eacdd[_0x2f4c('0x33')][_0x2f4c('0x37')]));_0x3afce9[_0x2f4c('0x36')]=_0x3afce9[_0x2f4c('0x36')]['length']?_0x3afce9[_0x2f4c('0x36')]:_0x15618e[_0x2f4c('0x31')];if(_0x5eacdd[_0x2f4c('0x33')][_0x2f4c('0x42')]){_0x3afce9[_0x2f4c('0x43')]=[{'all':!![]}];}_0x3afce9=_[_0x2f4c('0x3f')]({},_0x3afce9,_0x5eacdd[_0x2f4c('0x41')]);return db[_0x2f4c('0x2d')]['find'](_0x3afce9)[_0x2f4c('0x26')](handleEntityNotFound(_0x440376,null))['then'](respondWithResult(_0x440376,null))[_0x2f4c('0x45')](handleError(_0x440376,null));};exports[_0x2f4c('0x48')]=function(_0x2fb8aa,_0x53800f){return db['ZendeskConfiguration']['create'](_0x2fb8aa[_0x2f4c('0x49')],{})[_0x2f4c('0x26')](respondWithResult(_0x53800f,0xc9))[_0x2f4c('0x45')](handleError(_0x53800f,null));};exports['update']=function(_0x25181f,_0x5659af){if(_0x25181f['body']['id']){delete _0x25181f[_0x2f4c('0x49')]['id'];}return db[_0x2f4c('0x2d')][_0x2f4c('0x4a')]({'where':{'id':_0x25181f[_0x2f4c('0x47')]['id']}})[_0x2f4c('0x26')](handleEntityNotFound(_0x5659af,null))[_0x2f4c('0x26')](saveUpdates(_0x25181f[_0x2f4c('0x49')],null))['then'](respondWithResult(_0x5659af,null))['catch'](handleError(_0x5659af,null));};exports[_0x2f4c('0x27')]=function(_0x4587e8,_0x1ddae3){return db[_0x2f4c('0x2d')]['find']({'where':{'id':_0x4587e8[_0x2f4c('0x47')]['id']}})[_0x2f4c('0x26')](handleEntityNotFound(_0x1ddae3,null))[_0x2f4c('0x26')](removeEntity(_0x1ddae3,null))[_0x2f4c('0x45')](handleError(_0x1ddae3,null));};exports[_0x2f4c('0x4b')]=function(_0x88d343,_0x2b4c05,_0x2842bc){var _0x2d612c={};var _0x72cec6={};var _0x2f4aa9;var _0x33286d;return db[_0x2f4c('0x2d')][_0x2f4c('0x4c')]({'where':{'id':_0x88d343[_0x2f4c('0x47')]['id']}})[_0x2f4c('0x26')](handleEntityNotFound(_0x2b4c05,null))[_0x2f4c('0x26')](function(_0x3f0184){if(_0x3f0184){_0x2f4aa9=_0x3f0184;_0x72cec6[_0x2f4c('0x31')]=_[_0x2f4c('0x32')](db[_0x2f4c('0x4d')]['rawAttributes']);_0x72cec6[_0x2f4c('0x33')]=_[_0x2f4c('0x32')](_0x88d343[_0x2f4c('0x33')]);_0x72cec6[_0x2f4c('0x34')]=_['intersection'](_0x72cec6['model'],_0x72cec6[_0x2f4c('0x33')]);_0x2d612c[_0x2f4c('0x36')]=_[_0x2f4c('0x35')](_0x72cec6[_0x2f4c('0x31')],qs[_0x2f4c('0x37')](_0x88d343[_0x2f4c('0x33')][_0x2f4c('0x37')]));_0x2d612c[_0x2f4c('0x36')]=_0x2d612c[_0x2f4c('0x36')][_0x2f4c('0x4e')]?_0x2d612c['attributes']:_0x72cec6[_0x2f4c('0x31')];_0x2d612c[_0x2f4c('0x3a')]=qs[_0x2f4c('0x3b')](_0x88d343[_0x2f4c('0x33')][_0x2f4c('0x3b')]);_0x2d612c[_0x2f4c('0x3e')]=qs[_0x2f4c('0x34')](_[_0x2f4c('0x3c')](_0x88d343[_0x2f4c('0x33')],_0x72cec6[_0x2f4c('0x34')]));if(_0x88d343[_0x2f4c('0x33')][_0x2f4c('0x3d')]){_0x2d612c['where']=_[_0x2f4c('0x3f')](_0x2d612c[_0x2f4c('0x3e')],{'$or':_['map'](_0x2d612c[_0x2f4c('0x36')],function(_0x85d043){var _0x4ab8b3={};_0x4ab8b3[_0x85d043]={'$like':'%'+_0x88d343['query']['filter']+'%'};return _0x4ab8b3;})});}_0x2d612c=_['merge']({},_0x2d612c,_0x88d343[_0x2f4c('0x41')]);return _0x2f4aa9['getFields'](_0x2d612c);}})[_0x2f4c('0x26')](function(_0x6f7c88){if(_0x6f7c88){_0x33286d=_0x6f7c88[_0x2f4c('0x4e')];if(!_0x88d343[_0x2f4c('0x33')]['hasOwnProperty'](_0x2f4c('0x39'))){_0x2d612c[_0x2f4c('0x1f')]=qs[_0x2f4c('0x1f')](_0x88d343['query']['limit']);_0x2d612c['offset']=qs[_0x2f4c('0x1d')](_0x88d343[_0x2f4c('0x33')]['offset']);}return _0x2f4aa9[_0x2f4c('0x4b')](_0x2d612c);}})[_0x2f4c('0x26')](function(_0x1bf9b6){if(_0x1bf9b6){return _0x1bf9b6?{'count':_0x33286d,'rows':_0x1bf9b6}:null;}})[_0x2f4c('0x26')](respondWithResult(_0x2b4c05,null))[_0x2f4c('0x45')](handleError(_0x2b4c05,null));};exports['getSubjects']=function(_0x37b4a0,_0x4737e1,_0x53584c){var _0x420832={};var _0x36c443={};var _0x131b17;var _0x5b8d55;return db[_0x2f4c('0x2d')][_0x2f4c('0x4c')]({'where':{'id':_0x37b4a0[_0x2f4c('0x47')]['id']}})[_0x2f4c('0x26')](handleEntityNotFound(_0x4737e1,null))['then'](function(_0x33180b){if(_0x33180b){_0x131b17=_0x33180b;_0x36c443['model']=_['keys'](db[_0x2f4c('0x4d')][_0x2f4c('0x2e')]);_0x36c443[_0x2f4c('0x33')]=_[_0x2f4c('0x32')](_0x37b4a0[_0x2f4c('0x33')]);_0x36c443[_0x2f4c('0x34')]=_[_0x2f4c('0x35')](_0x36c443[_0x2f4c('0x31')],_0x36c443[_0x2f4c('0x33')]);_0x420832['attributes']=_[_0x2f4c('0x35')](_0x36c443[_0x2f4c('0x31')],qs[_0x2f4c('0x37')](_0x37b4a0[_0x2f4c('0x33')][_0x2f4c('0x37')]));_0x420832['attributes']=_0x420832['attributes'][_0x2f4c('0x4e')]?_0x420832[_0x2f4c('0x36')]:_0x36c443[_0x2f4c('0x31')];_0x420832[_0x2f4c('0x3a')]=qs['sort'](_0x37b4a0[_0x2f4c('0x33')][_0x2f4c('0x3b')]);_0x420832[_0x2f4c('0x3e')]=qs[_0x2f4c('0x34')](_['pick'](_0x37b4a0[_0x2f4c('0x33')],_0x36c443[_0x2f4c('0x34')]));if(_0x37b4a0[_0x2f4c('0x33')][_0x2f4c('0x3d')]){_0x420832['where']=_[_0x2f4c('0x3f')](_0x420832[_0x2f4c('0x3e')],{'$or':_[_0x2f4c('0x2c')](_0x420832['attributes'],function(_0x351840){var _0x436e47={};_0x436e47[_0x351840]={'$like':'%'+_0x37b4a0[_0x2f4c('0x33')]['filter']+'%'};return _0x436e47;})});}_0x420832=_[_0x2f4c('0x3f')]({},_0x420832,_0x37b4a0[_0x2f4c('0x41')]);return _0x131b17[_0x2f4c('0x4f')](_0x420832);}})[_0x2f4c('0x26')](function(_0x596bbc){if(_0x596bbc){_0x5b8d55=_0x596bbc[_0x2f4c('0x4e')];if(!_0x37b4a0[_0x2f4c('0x33')][_0x2f4c('0x38')](_0x2f4c('0x39'))){_0x420832[_0x2f4c('0x1f')]=qs[_0x2f4c('0x1f')](_0x37b4a0['query'][_0x2f4c('0x1f')]);_0x420832[_0x2f4c('0x1d')]=qs[_0x2f4c('0x1d')](_0x37b4a0[_0x2f4c('0x33')][_0x2f4c('0x1d')]);}return _0x131b17[_0x2f4c('0x4f')](_0x420832);}})[_0x2f4c('0x26')](function(_0x16a801){if(_0x16a801){return _0x16a801?{'count':_0x5b8d55,'rows':_0x16a801}:null;}})[_0x2f4c('0x26')](respondWithResult(_0x4737e1,null))['catch'](handleError(_0x4737e1,null));};exports['getDescriptions']=function(_0x4208c0,_0x4b6065,_0x2f4545){var _0x5569c4={};var _0x540884={};var _0x1179b6;var _0x382478;return db['ZendeskConfiguration'][_0x2f4c('0x4c')]({'where':{'id':_0x4208c0[_0x2f4c('0x47')]['id']}})[_0x2f4c('0x26')](handleEntityNotFound(_0x4b6065,null))[_0x2f4c('0x26')](function(_0x1e93d7){if(_0x1e93d7){_0x1179b6=_0x1e93d7;_0x540884[_0x2f4c('0x31')]=_['keys'](db[_0x2f4c('0x4d')][_0x2f4c('0x2e')]);_0x540884[_0x2f4c('0x33')]=_['keys'](_0x4208c0['query']);_0x540884['filters']=_[_0x2f4c('0x35')](_0x540884['model'],_0x540884['query']);_0x5569c4['attributes']=_[_0x2f4c('0x35')](_0x540884['model'],qs[_0x2f4c('0x37')](_0x4208c0[_0x2f4c('0x33')]['fields']));_0x5569c4[_0x2f4c('0x36')]=_0x5569c4['attributes']['length']?_0x5569c4[_0x2f4c('0x36')]:_0x540884[_0x2f4c('0x31')];_0x5569c4[_0x2f4c('0x3a')]=qs[_0x2f4c('0x3b')](_0x4208c0[_0x2f4c('0x33')]['sort']);_0x5569c4[_0x2f4c('0x3e')]=qs[_0x2f4c('0x34')](_[_0x2f4c('0x3c')](_0x4208c0[_0x2f4c('0x33')],_0x540884['filters']));if(_0x4208c0[_0x2f4c('0x33')]['filter']){_0x5569c4[_0x2f4c('0x3e')]=_[_0x2f4c('0x3f')](_0x5569c4[_0x2f4c('0x3e')],{'$or':_['map'](_0x5569c4['attributes'],function(_0x2300ba){var _0x2a68f1={};_0x2a68f1[_0x2300ba]={'$like':'%'+_0x4208c0[_0x2f4c('0x33')][_0x2f4c('0x3d')]+'%'};return _0x2a68f1;})});}_0x5569c4=_[_0x2f4c('0x3f')]({},_0x5569c4,_0x4208c0[_0x2f4c('0x41')]);return _0x1179b6['getDescriptions'](_0x5569c4);}})[_0x2f4c('0x26')](function(_0x1eb4ec){if(_0x1eb4ec){_0x382478=_0x1eb4ec[_0x2f4c('0x4e')];if(!_0x4208c0[_0x2f4c('0x33')]['hasOwnProperty'](_0x2f4c('0x39'))){_0x5569c4[_0x2f4c('0x1f')]=qs[_0x2f4c('0x1f')](_0x4208c0[_0x2f4c('0x33')]['limit']);_0x5569c4[_0x2f4c('0x1d')]=qs[_0x2f4c('0x1d')](_0x4208c0[_0x2f4c('0x33')]['offset']);}return _0x1179b6[_0x2f4c('0x50')](_0x5569c4);}})[_0x2f4c('0x26')](function(_0x380172){if(_0x380172){return _0x380172?{'count':_0x382478,'rows':_0x380172}:null;}})['then'](respondWithResult(_0x4b6065,null))[_0x2f4c('0x45')](handleError(_0x4b6065,null));};exports[_0x2f4c('0x51')]=function(_0x440ed2,_0x4f57aa,_0x1bdd5e){var _0x1b2780={};var _0x446629={};var _0x68af55;var _0x4be021;return db[_0x2f4c('0x2d')][_0x2f4c('0x4c')]({'where':{'id':_0x440ed2[_0x2f4c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f57aa,null))[_0x2f4c('0x26')](function(_0x5b05d5){if(_0x5b05d5){_0x68af55=_0x5b05d5;_0x446629[_0x2f4c('0x31')]=_[_0x2f4c('0x32')](db[_0x2f4c('0x52')][_0x2f4c('0x2e')]);_0x446629[_0x2f4c('0x33')]=_[_0x2f4c('0x32')](_0x440ed2[_0x2f4c('0x33')]);_0x446629[_0x2f4c('0x34')]=_['intersection'](_0x446629[_0x2f4c('0x31')],_0x446629['query']);_0x1b2780[_0x2f4c('0x36')]=_[_0x2f4c('0x35')](_0x446629[_0x2f4c('0x31')],qs[_0x2f4c('0x37')](_0x440ed2[_0x2f4c('0x33')][_0x2f4c('0x37')]));_0x1b2780['attributes']=_0x1b2780['attributes'][_0x2f4c('0x4e')]?_0x1b2780['attributes']:_0x446629['model'];_0x1b2780[_0x2f4c('0x3a')]=qs[_0x2f4c('0x3b')](_0x440ed2['query'][_0x2f4c('0x3b')]);_0x1b2780[_0x2f4c('0x3e')]=qs['filters'](_[_0x2f4c('0x3c')](_0x440ed2[_0x2f4c('0x33')],_0x446629[_0x2f4c('0x34')]));if(_0x440ed2['query'][_0x2f4c('0x3d')]){_0x1b2780[_0x2f4c('0x3e')]=_[_0x2f4c('0x3f')](_0x1b2780['where'],{'$or':_[_0x2f4c('0x2c')](_0x1b2780[_0x2f4c('0x36')],function(_0x113d95){var _0xc65742={};_0xc65742[_0x113d95]={'$like':'%'+_0x440ed2[_0x2f4c('0x33')][_0x2f4c('0x3d')]+'%'};return _0xc65742;})});}_0x1b2780=_['merge']({},_0x1b2780,_0x440ed2[_0x2f4c('0x41')]);return _0x68af55[_0x2f4c('0x51')](_0x1b2780);}})[_0x2f4c('0x26')](function(_0x28453d){if(_0x28453d){_0x4be021=_0x28453d[_0x2f4c('0x4e')];if(!_0x440ed2[_0x2f4c('0x33')][_0x2f4c('0x38')](_0x2f4c('0x39'))){_0x1b2780[_0x2f4c('0x1f')]=qs[_0x2f4c('0x1f')](_0x440ed2[_0x2f4c('0x33')]['limit']);_0x1b2780[_0x2f4c('0x1d')]=qs[_0x2f4c('0x1d')](_0x440ed2[_0x2f4c('0x33')][_0x2f4c('0x1d')]);}return _0x68af55[_0x2f4c('0x51')](_0x1b2780);}})[_0x2f4c('0x26')](function(_0xbb125c){if(_0xbb125c){return _0xbb125c?{'count':_0x4be021,'rows':_0xbb125c}:null;}})['then'](respondWithResult(_0x4f57aa,null))['catch'](handleError(_0x4f57aa,null));};exports[_0x2f4c('0x53')]=function(_0x66dd13,_0x15459a,_0x266d27){if(_0x66dd13[_0x2f4c('0x49')]['id']){delete _0x66dd13[_0x2f4c('0x49')]['id'];}return db[_0x2f4c('0x2d')]['findOne']({'where':{'id':_0x66dd13[_0x2f4c('0x47')]['id']}})[_0x2f4c('0x26')](handleEntityNotFound(_0x15459a,null))[_0x2f4c('0x26')](function(_0x16bd55){if(_0x16bd55){return _0x16bd55[_0x2f4c('0x53')](_0x66dd13[_0x2f4c('0x49')][_0x2f4c('0x54')]||[]);}return null;})[_0x2f4c('0x26')](respondWithResult(_0x15459a,null))['catch'](handleError(_0x15459a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 9986603..d714ab1 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 _0x4213=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x50c866,_0x5871d2){var _0x488728=function(_0x293a32){while(--_0x293a32){_0x50c866['push'](_0x50c866['shift']());}};_0x488728(++_0x5871d2);}(_0x4213,0x77));var _0x3421=function(_0x5b4a97,_0x345d91){_0x5b4a97=_0x5b4a97-0x0;var _0x20ae1f=_0x4213[_0x5b4a97];return _0x20ae1f;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3421('0x7'));var config=require('../../config/environment');var attributes=require(_0x3421('0x8'));module[_0x3421('0x9')]=function(_0x2155f8,_0x2a04e0){return _0x2155f8['define'](_0x3421('0xa'),attributes,{'tableName':_0x3421('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8c=['exports','define','ZendeskConfiguration','int_zendesk_configurations','../../config/logger','api','moment','bluebird'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x3f8c,0x104));var _0xc3f8=function(_0x331272,_0x19f22a){_0x331272=_0x331272-0x0;var _0x2396fa=_0x3f8c[_0x331272];return _0x2396fa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3f8('0x0'))(_0xc3f8('0x1'));var moment=require(_0xc3f8('0x2'));var BPromise=require(_0xc3f8('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('./intZendeskConfiguration.attributes');module[_0xc3f8('0x4')]=function(_0x1a6976,_0x3a4e2f){return _0x1a6976[_0xc3f8('0x5')](_0xc3f8('0x6'),attributes,{'tableName':_0xc3f8('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 d00b228..38d5f32 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 _0xe6d4=['request','then','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x5e5d7f,_0x3ce4ca){var _0x6b660f=function(_0x30dd28){while(--_0x30dd28){_0x5e5d7f['push'](_0x5e5d7f['shift']());}};_0x6b660f(++_0x3ce4ca);}(_0xe6d4,0x69));var _0x4e6d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe6d4[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x4e6d('0x0'));var util=require('util');var moment=require(_0x4e6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e6d('0x2'));var fs=require('fs');var Redis=require(_0x4e6d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e6d('0x4'));var logger=require(_0x4e6d('0x5'))(_0x4e6d('0x6'));var config=require('../../config/environment');var jayson=require(_0x4e6d('0x7'));var client=jayson['client'][_0x4e6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27175e,_0x2fab3c,_0x16ab99){return new BPromise(function(_0x2ba325,_0x1b92ff){return client[_0x4e6d('0x9')](_0x27175e,_0x16ab99)[_0x4e6d('0xa')](function(_0x33bb7c){logger[_0x4e6d('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2fab3c,_0x4e6d('0xc'));logger['debug'](_0x4e6d('0xd'),_0x2fab3c,_0x4e6d('0xc'),JSON[_0x4e6d('0xe')](_0x33bb7c));if(_0x33bb7c['error']){if(_0x33bb7c[_0x4e6d('0xf')][_0x4e6d('0x10')]===0x1f4){logger['error'](_0x4e6d('0x11'),_0x2fab3c,_0x33bb7c[_0x4e6d('0xf')][_0x4e6d('0x12')]);return _0x1b92ff(_0x33bb7c[_0x4e6d('0xf')][_0x4e6d('0x12')]);}logger[_0x4e6d('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2fab3c,_0x33bb7c[_0x4e6d('0xf')][_0x4e6d('0x12')]);return _0x2ba325(_0x33bb7c['error'][_0x4e6d('0x12')]);}else{logger['info'](_0x4e6d('0x11'),_0x2fab3c,_0x4e6d('0xc'));_0x2ba325(_0x33bb7c['result'][_0x4e6d('0x12')]);}})['catch'](function(_0x54112d){logger[_0x4e6d('0xf')](_0x4e6d('0x11'),_0x2fab3c,_0x54112d);_0x1b92ff(_0x54112d);});});} \ No newline at end of file +var _0x924f=['client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x41bd26,_0x317bfa){var _0x10fa83=function(_0x4a223d){while(--_0x4a223d){_0x41bd26['push'](_0x41bd26['shift']());}};_0x10fa83(++_0x317bfa);}(_0x924f,0x10a));var _0xf924=function(_0x295ea9,_0x19d658){_0x295ea9=_0x295ea9-0x0;var _0x59a3fe=_0x924f[_0x295ea9];return _0x59a3fe;};'use strict';var _=require(_0xf924('0x0'));var util=require('util');var moment=require(_0xf924('0x1'));var BPromise=require(_0xf924('0x2'));var rs=require(_0xf924('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf924('0x4'))['db'];var utils=require(_0xf924('0x5'));var logger=require(_0xf924('0x6'))(_0xf924('0x7'));var config=require(_0xf924('0x8'));var jayson=require(_0xf924('0x9'));var client=jayson[_0xf924('0xa')][_0xf924('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d6533,_0x128e48,_0x408d91){return new BPromise(function(_0x5b70ca,_0xf0c820){return client[_0xf924('0xc')](_0x2d6533,_0x408d91)[_0xf924('0xd')](function(_0x5747b0){logger[_0xf924('0xe')](_0xf924('0xf'),_0x128e48,_0xf924('0x10'));logger['debug'](_0xf924('0x11'),_0x128e48,_0xf924('0x10'),JSON['stringify'](_0x5747b0));if(_0x5747b0[_0xf924('0x12')]){if(_0x5747b0[_0xf924('0x12')][_0xf924('0x13')]===0x1f4){logger[_0xf924('0x12')](_0xf924('0xf'),_0x128e48,_0x5747b0['error'][_0xf924('0x14')]);return _0xf0c820(_0x5747b0['error'][_0xf924('0x14')]);}logger[_0xf924('0x12')](_0xf924('0xf'),_0x128e48,_0x5747b0['error'][_0xf924('0x14')]);return _0x5b70ca(_0x5747b0[_0xf924('0x12')]['message']);}else{logger[_0xf924('0xe')](_0xf924('0xf'),_0x128e48,_0xf924('0x10'));_0x5b70ca(_0x5747b0[_0xf924('0x15')][_0xf924('0x14')]);}})[_0xf924('0x16')](function(_0x51bf97){logger['error'](_0xf924('0xf'),_0x128e48,_0x51bf97);_0xf0c820(_0x51bf97);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index d289ad0..22d3730 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 _0x0dfd=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x3d740d,_0x373d2a){var _0x3e32be=function(_0x5438e5){while(--_0x5438e5){_0x3d740d['push'](_0x3d740d['shift']());}};_0x3e32be(++_0x373d2a);}(_0x0dfd,0x7a));var _0xd0df=function(_0x4dd532,_0x11241b){_0x4dd532=_0x4dd532-0x0;var _0x53602a=_0x0dfd[_0x4dd532];return _0x53602a;};'use strict';var multer=require(_0xd0df('0x0'));var util=require(_0xd0df('0x1'));var path=require('path');var timeout=require(_0xd0df('0x2'));var express=require(_0xd0df('0x3'));var router=express[_0xd0df('0x4')]();var fs_extra=require(_0xd0df('0x5'));var auth=require(_0xd0df('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0df('0x7'));var controller=require('./intZendeskField.controller');router[_0xd0df('0x8')]('/',auth[_0xd0df('0x9')](),controller[_0xd0df('0xa')]);router[_0xd0df('0x8')](_0xd0df('0xb'),auth[_0xd0df('0x9')](),controller[_0xd0df('0xc')]);router[_0xd0df('0xd')]('/',auth[_0xd0df('0x9')](),controller['create']);router[_0xd0df('0xe')](_0xd0df('0xb'),auth[_0xd0df('0x9')](),controller[_0xd0df('0xf')]);router[_0xd0df('0x10')](_0xd0df('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd0df('0x11')]=router; \ No newline at end of file +var _0x5832=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path'];(function(_0x83dbcc,_0x10fb35){var _0x808d67=function(_0x6fbf40){while(--_0x6fbf40){_0x83dbcc['push'](_0x83dbcc['shift']());}};_0x808d67(++_0x10fb35);}(_0x5832,0xcf));var _0x2583=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x5832[_0x29e2af];return _0x1ea06a;};'use strict';var multer=require('multer');var util=require(_0x2583('0x0'));var path=require(_0x2583('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2583('0x2')]();var fs_extra=require(_0x2583('0x3'));var auth=require(_0x2583('0x4'));var interaction=require(_0x2583('0x5'));var config=require(_0x2583('0x6'));var controller=require(_0x2583('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2583('0x8')]);router[_0x2583('0x9')](_0x2583('0xa'),auth[_0x2583('0xb')](),controller[_0x2583('0xc')]);router[_0x2583('0xd')]('/',auth[_0x2583('0xb')](),controller[_0x2583('0xe')]);router[_0x2583('0xf')](_0x2583('0xa'),auth['isAuthenticated'](),controller[_0x2583('0x10')]);router[_0x2583('0x11')](_0x2583('0xa'),auth[_0x2583('0xb')](),controller['destroy']);module[_0x2583('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2344d2e..475e8fb 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 _0x3473=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x541be5,_0xfd1657){var _0x5f256f=function(_0x44f20f){while(--_0x44f20f){_0x541be5['push'](_0x541be5['shift']());}};_0x5f256f(++_0xfd1657);}(_0x3473,0x16b));var _0x3347=function(_0x5645ad,_0x580ea3){_0x5645ad=_0x5645ad-0x0;var _0x17d292=_0x3473[_0x5645ad];return _0x17d292;};'use strict';var Sequelize=require(_0x3347('0x0'));module[_0x3347('0x1')]={'type':{'type':Sequelize[_0x3347('0x2')]('string',_0x3347('0x3'),_0x3347('0x4'),_0x3347('0x5'),_0x3347('0x6')),'defaultValue':_0x3347('0x7')},'content':{'type':Sequelize[_0x3347('0x8')]},'key':{'type':Sequelize[_0x3347('0x8')]},'keyType':{'type':Sequelize[_0x3347('0x2')](_0x3347('0x7'),_0x3347('0x3'),_0x3347('0x4'))},'keyContent':{'type':Sequelize[_0x3347('0x8')]},'idField':{'type':Sequelize[_0x3347('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3347('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3347('0x8')]}}; \ No newline at end of file +var _0x11b6=['keyValue','picklist','STRING','ENUM','customVariable','sequelize','exports','string','variable'];(function(_0x2b3478,_0x58afd7){var _0x1c106f=function(_0x4f12a1){while(--_0x4f12a1){_0x2b3478['push'](_0x2b3478['shift']());}};_0x1c106f(++_0x58afd7);}(_0x11b6,0x101));var _0x611b=function(_0x2a4460,_0x426c25){_0x2a4460=_0x2a4460-0x0;var _0x48de44=_0x11b6[_0x2a4460];return _0x48de44;};'use strict';var Sequelize=require(_0x611b('0x0'));module[_0x611b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x611b('0x2'),_0x611b('0x3'),'customVariable',_0x611b('0x4'),_0x611b('0x5')),'defaultValue':_0x611b('0x2')},'content':{'type':Sequelize[_0x611b('0x6')]},'key':{'type':Sequelize[_0x611b('0x6')]},'keyType':{'type':Sequelize[_0x611b('0x7')](_0x611b('0x2'),'variable',_0x611b('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x611b('0x6')]},'nameField':{'type':Sequelize[_0x611b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x611b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 052eeba..e58211a 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 _0x4b74=['json','apply','reject','save','then','destroy','stack','name','send','index','map','ZendeskField','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','keys','includeAll','catch','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range'];(function(_0x4062b9,_0x16bcb1){var _0x106fea=function(_0x4d5cb3){while(--_0x4d5cb3){_0x4062b9['push'](_0x4062b9['shift']());}};_0x106fea(++_0x16bcb1);}(_0x4b74,0x111));var _0x44b7=function(_0x1d5c36,_0x3e35ba){_0x1d5c36=_0x1d5c36-0x0;var _0x52d00e=_0x4b74[_0x1d5c36];return _0x52d00e;};'use strict';var emlformat=require(_0x44b7('0x0'));var rimraf=require(_0x44b7('0x1'));var zipdir=require(_0x44b7('0x2'));var jsonpatch=require(_0x44b7('0x3'));var rp=require(_0x44b7('0x4'));var moment=require(_0x44b7('0x5'));var BPromise=require(_0x44b7('0x6'));var Mustache=require(_0x44b7('0x7'));var util=require(_0x44b7('0x8'));var path=require(_0x44b7('0x9'));var sox=require(_0x44b7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b7('0xb'));var _=require(_0x44b7('0xc'));var squel=require(_0x44b7('0xd'));var crypto=require(_0x44b7('0xe'));var jsforce=require(_0x44b7('0xf'));var deskjs=require(_0x44b7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x44b7('0x11'));var authService=require(_0x44b7('0x12'));var qs=require(_0x44b7('0x13'));var as=require(_0x44b7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x44b7('0x15'));var utils=require(_0x44b7('0x16'));var config=require(_0x44b7('0x17'));var licenseUtil=require(_0x44b7('0x18'));var db=require(_0x44b7('0x19'))['db'];function respondWithStatusCode(_0x4a6c54,_0x38f2f5){_0x38f2f5=_0x38f2f5||0xcc;return function(_0x1f18b5){if(_0x1f18b5){return _0x4a6c54[_0x44b7('0x1a')](_0x38f2f5);}return _0x4a6c54['status'](_0x38f2f5)[_0x44b7('0x1b')]();};}function respondWithResult(_0x3f635b,_0x31417e){_0x31417e=_0x31417e||0xc8;return function(_0x335123){if(_0x335123){return _0x3f635b[_0x44b7('0x1c')](_0x31417e)['json'](_0x335123);}};}function respondWithFilteredResult(_0x524229,_0x10d5c9){return function(_0x1370a3){if(_0x1370a3){var _0x58c8d7=typeof _0x10d5c9[_0x44b7('0x1d')]===_0x44b7('0x1e')&&typeof _0x10d5c9['limit']===_0x44b7('0x1e');var _0x3557c8=_0x1370a3[_0x44b7('0x1f')];var _0x41542e=_0x58c8d7?0x0:_0x10d5c9[_0x44b7('0x1d')];var _0xa0e71d=_0x58c8d7?_0x1370a3[_0x44b7('0x1f')]:_0x10d5c9[_0x44b7('0x1d')]+_0x10d5c9[_0x44b7('0x20')];var _0x1ef38f;if(_0xa0e71d>=_0x3557c8){_0xa0e71d=_0x3557c8;_0x1ef38f=0xc8;}else{_0x1ef38f=0xce;}_0x524229['status'](_0x1ef38f);return _0x524229[_0x44b7('0x21')](_0x44b7('0x22'),_0x41542e+'-'+_0xa0e71d+'/'+_0x3557c8)[_0x44b7('0x23')](_0x1370a3);}return null;};}function patchUpdates(_0x4b2a37){return function(_0x17842a){try{jsonpatch[_0x44b7('0x24')](_0x17842a,_0x4b2a37,!![]);}catch(_0x3ab41f){return BPromise[_0x44b7('0x25')](_0x3ab41f);}return _0x17842a[_0x44b7('0x26')]();};}function saveUpdates(_0x3f2dfd,_0xe3f082){return function(_0x3b37c3){if(_0x3b37c3){return _0x3b37c3['update'](_0x3f2dfd)[_0x44b7('0x27')](function(_0x4e6ab3){return _0x4e6ab3;});}return null;};}function removeEntity(_0x4cb04c,_0xd5cc41){return function(_0x37088d){if(_0x37088d){return _0x37088d[_0x44b7('0x28')]()[_0x44b7('0x27')](function(){_0x4cb04c[_0x44b7('0x1c')](0xcc)[_0x44b7('0x1b')]();});}};}function handleEntityNotFound(_0xa8afd7,_0x318b6f){return function(_0xa0fb66){if(!_0xa0fb66){_0xa8afd7[_0x44b7('0x1a')](0x194);}return _0xa0fb66;};}function handleError(_0x7d7b3b,_0x3080b9){_0x3080b9=_0x3080b9||0x1f4;return function(_0x21e26f){logger['error'](_0x21e26f[_0x44b7('0x29')]);if(_0x21e26f[_0x44b7('0x2a')]){delete _0x21e26f[_0x44b7('0x2a')];}_0x7d7b3b[_0x44b7('0x1c')](_0x3080b9)[_0x44b7('0x2b')](_0x21e26f);};}exports[_0x44b7('0x2c')]=function(_0x3e138b,_0x59ae73){var _0x4433ff={},_0x56f890={},_0x3d6969={'count':0x0,'rows':[]};var _0x12ad31=_[_0x44b7('0x2d')](db[_0x44b7('0x2e')][_0x44b7('0x2f')],function(_0x468799){return{'name':_0x468799['fieldName'],'type':_0x468799['type']['key']};});_0x56f890[_0x44b7('0x30')]=_[_0x44b7('0x2d')](_0x12ad31,'name');_0x56f890[_0x44b7('0x31')]=_['keys'](_0x3e138b[_0x44b7('0x31')]);_0x56f890[_0x44b7('0x32')]=_[_0x44b7('0x33')](_0x56f890[_0x44b7('0x30')],_0x56f890[_0x44b7('0x31')]);_0x4433ff['attributes']=_[_0x44b7('0x33')](_0x56f890['model'],qs[_0x44b7('0x34')](_0x3e138b['query'][_0x44b7('0x34')]));_0x4433ff[_0x44b7('0x35')]=_0x4433ff[_0x44b7('0x35')][_0x44b7('0x36')]?_0x4433ff[_0x44b7('0x35')]:_0x56f890[_0x44b7('0x30')];if(!_0x3e138b[_0x44b7('0x31')][_0x44b7('0x37')](_0x44b7('0x38'))){_0x4433ff['limit']=qs[_0x44b7('0x20')](_0x3e138b[_0x44b7('0x31')]['limit']);_0x4433ff[_0x44b7('0x1d')]=qs['offset'](_0x3e138b[_0x44b7('0x31')][_0x44b7('0x1d')]);}_0x4433ff[_0x44b7('0x39')]=qs[_0x44b7('0x3a')](_0x3e138b[_0x44b7('0x31')][_0x44b7('0x3a')]);_0x4433ff[_0x44b7('0x3b')]=qs['filters'](_[_0x44b7('0x3c')](_0x3e138b[_0x44b7('0x31')],_0x56f890[_0x44b7('0x32')]),_0x12ad31);if(_0x3e138b[_0x44b7('0x31')][_0x44b7('0x3d')]){_0x4433ff[_0x44b7('0x3b')]=_[_0x44b7('0x3e')](_0x4433ff['where'],{'$or':_[_0x44b7('0x2d')](_0x12ad31,function(_0x59930e){if(_0x59930e[_0x44b7('0x3f')]!==_0x44b7('0x40')){var _0x1579ae={};_0x1579ae[_0x59930e['name']]={'$like':'%'+_0x3e138b[_0x44b7('0x31')]['filter']+'%'};return _0x1579ae;}})});}_0x4433ff=_[_0x44b7('0x3e')]({},_0x4433ff,_0x3e138b[_0x44b7('0x41')]);var _0x38e653={'where':_0x4433ff[_0x44b7('0x3b')]};return db[_0x44b7('0x2e')][_0x44b7('0x1f')](_0x38e653)[_0x44b7('0x27')](function(_0x310bb0){_0x3d6969['count']=_0x310bb0;if(_0x3e138b[_0x44b7('0x31')]['includeAll']){_0x4433ff[_0x44b7('0x42')]=[{'all':!![]}];}return db[_0x44b7('0x2e')][_0x44b7('0x43')](_0x4433ff);})[_0x44b7('0x27')](function(_0x37c07e){_0x3d6969['rows']=_0x37c07e;return _0x3d6969;})[_0x44b7('0x27')](respondWithFilteredResult(_0x59ae73,_0x4433ff))['catch'](handleError(_0x59ae73,null));};exports[_0x44b7('0x44')]=function(_0x44f320,_0x479cb4){var _0x3fe76f={'raw':!![],'where':{'id':_0x44f320[_0x44b7('0x45')]['id']}},_0xc3a653={};_0xc3a653[_0x44b7('0x30')]=_[_0x44b7('0x46')](db['ZendeskField'][_0x44b7('0x2f')]);_0xc3a653[_0x44b7('0x31')]=_[_0x44b7('0x46')](_0x44f320[_0x44b7('0x31')]);_0xc3a653[_0x44b7('0x32')]=_[_0x44b7('0x33')](_0xc3a653['model'],_0xc3a653[_0x44b7('0x31')]);_0x3fe76f[_0x44b7('0x35')]=_[_0x44b7('0x33')](_0xc3a653[_0x44b7('0x30')],qs['fields'](_0x44f320['query'][_0x44b7('0x34')]));_0x3fe76f[_0x44b7('0x35')]=_0x3fe76f[_0x44b7('0x35')][_0x44b7('0x36')]?_0x3fe76f['attributes']:_0xc3a653['model'];if(_0x44f320['query'][_0x44b7('0x47')]){_0x3fe76f[_0x44b7('0x42')]=[{'all':!![]}];}_0x3fe76f=_[_0x44b7('0x3e')]({},_0x3fe76f,_0x44f320[_0x44b7('0x41')]);return db[_0x44b7('0x2e')]['find'](_0x3fe76f)['then'](handleEntityNotFound(_0x479cb4,null))[_0x44b7('0x27')](respondWithResult(_0x479cb4,null))[_0x44b7('0x48')](handleError(_0x479cb4,null));};exports[_0x44b7('0x49')]=function(_0x3770e8,_0x1c5e6f){return db[_0x44b7('0x2e')][_0x44b7('0x49')](_0x3770e8[_0x44b7('0x4a')],{})['then'](respondWithResult(_0x1c5e6f,0xc9))[_0x44b7('0x48')](handleError(_0x1c5e6f,null));};exports[_0x44b7('0x4b')]=function(_0x35e043,_0x1631cf){if(_0x35e043['body']['id']){delete _0x35e043[_0x44b7('0x4a')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x35e043[_0x44b7('0x45')]['id']}})[_0x44b7('0x27')](handleEntityNotFound(_0x1631cf,null))[_0x44b7('0x27')](saveUpdates(_0x35e043[_0x44b7('0x4a')],null))[_0x44b7('0x27')](respondWithResult(_0x1631cf,null))[_0x44b7('0x48')](handleError(_0x1631cf,null));};exports[_0x44b7('0x28')]=function(_0x402617,_0x505011){return db['ZendeskField'][_0x44b7('0x4c')]({'where':{'id':_0x402617[_0x44b7('0x45')]['id']}})[_0x44b7('0x27')](handleEntityNotFound(_0x505011,null))[_0x44b7('0x27')](removeEntity(_0x505011,null))[_0x44b7('0x48')](handleError(_0x505011,null));}; \ No newline at end of file +var _0xf95d=['filter','merge','includeAll','include','ZendeskField','findAll','rows','catch','show','rawAttributes','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL'];(function(_0x1922e1,_0x5178b2){var _0xee605c=function(_0x37ad2e){while(--_0x37ad2e){_0x1922e1['push'](_0x1922e1['shift']());}};_0xee605c(++_0x5178b2);}(_0xf95d,0x14e));var _0xdf95=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xf95d[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0xdf95('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf95('0x1'));var jsonpatch=require(_0xdf95('0x2'));var rp=require(_0xdf95('0x3'));var moment=require(_0xdf95('0x4'));var BPromise=require(_0xdf95('0x5'));var Mustache=require('mustache');var util=require(_0xdf95('0x6'));var path=require(_0xdf95('0x7'));var sox=require(_0xdf95('0x8'));var csv=require(_0xdf95('0x9'));var ejs=require(_0xdf95('0xa'));var fs=require('fs');var fs_extra=require(_0xdf95('0xb'));var _=require('lodash');var squel=require(_0xdf95('0xc'));var crypto=require(_0xdf95('0xd'));var jsforce=require(_0xdf95('0xe'));var deskjs=require(_0xdf95('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdf95('0x10'));var Papa=require(_0xdf95('0x11'));var Redis=require(_0xdf95('0x12'));var authService=require(_0xdf95('0x13'));var qs=require(_0xdf95('0x14'));var as=require(_0xdf95('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf95('0x16'))(_0xdf95('0x17'));var utils=require('../../config/utils');var config=require(_0xdf95('0x18'));var licenseUtil=require(_0xdf95('0x19'));var db=require(_0xdf95('0x1a'))['db'];function respondWithStatusCode(_0x32250c,_0x3f919b){_0x3f919b=_0x3f919b||0xcc;return function(_0x199249){if(_0x199249){return _0x32250c[_0xdf95('0x1b')](_0x3f919b);}return _0x32250c[_0xdf95('0x1c')](_0x3f919b)[_0xdf95('0x1d')]();};}function respondWithResult(_0x2c9f08,_0x2e555e){_0x2e555e=_0x2e555e||0xc8;return function(_0x293d87){if(_0x293d87){return _0x2c9f08['status'](_0x2e555e)['json'](_0x293d87);}};}function respondWithFilteredResult(_0x3aff95,_0x31e0e7){return function(_0x3be6a0){if(_0x3be6a0){var _0xf83c96=typeof _0x31e0e7['offset']===_0xdf95('0x1e')&&typeof _0x31e0e7['limit']===_0xdf95('0x1e');var _0x2755e8=_0x3be6a0['count'];var _0x4f62c9=_0xf83c96?0x0:_0x31e0e7[_0xdf95('0x1f')];var _0x1259f4=_0xf83c96?_0x3be6a0[_0xdf95('0x20')]:_0x31e0e7[_0xdf95('0x1f')]+_0x31e0e7[_0xdf95('0x21')];var _0xfc9c28;if(_0x1259f4>=_0x2755e8){_0x1259f4=_0x2755e8;_0xfc9c28=0xc8;}else{_0xfc9c28=0xce;}_0x3aff95[_0xdf95('0x1c')](_0xfc9c28);return _0x3aff95[_0xdf95('0x22')](_0xdf95('0x23'),_0x4f62c9+'-'+_0x1259f4+'/'+_0x2755e8)[_0xdf95('0x24')](_0x3be6a0);}return null;};}function patchUpdates(_0x17c049){return function(_0x243be2){try{jsonpatch[_0xdf95('0x25')](_0x243be2,_0x17c049,!![]);}catch(_0x399c8e){return BPromise[_0xdf95('0x26')](_0x399c8e);}return _0x243be2[_0xdf95('0x27')]();};}function saveUpdates(_0x5ec7ce,_0x19af22){return function(_0x51e1e3){if(_0x51e1e3){return _0x51e1e3[_0xdf95('0x28')](_0x5ec7ce)[_0xdf95('0x29')](function(_0x4fe26d){return _0x4fe26d;});}return null;};}function removeEntity(_0x3f9868,_0xe7944){return function(_0x1bac06){if(_0x1bac06){return _0x1bac06[_0xdf95('0x2a')]()[_0xdf95('0x29')](function(){_0x3f9868[_0xdf95('0x1c')](0xcc)[_0xdf95('0x1d')]();});}};}function handleEntityNotFound(_0x1d3494,_0x2b8048){return function(_0x3be90c){if(!_0x3be90c){_0x1d3494[_0xdf95('0x1b')](0x194);}return _0x3be90c;};}function handleError(_0x22aedc,_0x375e8d){_0x375e8d=_0x375e8d||0x1f4;return function(_0x2f3380){logger[_0xdf95('0x2b')](_0x2f3380[_0xdf95('0x2c')]);if(_0x2f3380[_0xdf95('0x2d')]){delete _0x2f3380[_0xdf95('0x2d')];}_0x22aedc[_0xdf95('0x1c')](_0x375e8d)[_0xdf95('0x2e')](_0x2f3380);};}exports[_0xdf95('0x2f')]=function(_0x17e7c8,_0xc3af58){var _0x23b758={},_0x42bd7e={},_0x3686b4={'count':0x0,'rows':[]};var _0x30e4bc=_[_0xdf95('0x30')](db['ZendeskField']['rawAttributes'],function(_0x320009){return{'name':_0x320009[_0xdf95('0x31')],'type':_0x320009[_0xdf95('0x32')][_0xdf95('0x33')]};});_0x42bd7e['model']=_[_0xdf95('0x30')](_0x30e4bc,'name');_0x42bd7e['query']=_[_0xdf95('0x34')](_0x17e7c8[_0xdf95('0x35')]);_0x42bd7e[_0xdf95('0x36')]=_[_0xdf95('0x37')](_0x42bd7e['model'],_0x42bd7e['query']);_0x23b758['attributes']=_[_0xdf95('0x37')](_0x42bd7e[_0xdf95('0x38')],qs[_0xdf95('0x39')](_0x17e7c8[_0xdf95('0x35')][_0xdf95('0x39')]));_0x23b758[_0xdf95('0x3a')]=_0x23b758[_0xdf95('0x3a')][_0xdf95('0x3b')]?_0x23b758[_0xdf95('0x3a')]:_0x42bd7e[_0xdf95('0x38')];if(!_0x17e7c8[_0xdf95('0x35')][_0xdf95('0x3c')]('nolimit')){_0x23b758[_0xdf95('0x21')]=qs[_0xdf95('0x21')](_0x17e7c8['query']['limit']);_0x23b758[_0xdf95('0x1f')]=qs[_0xdf95('0x1f')](_0x17e7c8[_0xdf95('0x35')]['offset']);}_0x23b758[_0xdf95('0x3d')]=qs[_0xdf95('0x3e')](_0x17e7c8['query'][_0xdf95('0x3e')]);_0x23b758[_0xdf95('0x3f')]=qs[_0xdf95('0x36')](_[_0xdf95('0x40')](_0x17e7c8[_0xdf95('0x35')],_0x42bd7e['filters']),_0x30e4bc);if(_0x17e7c8['query']['filter']){_0x23b758[_0xdf95('0x3f')]=_['merge'](_0x23b758[_0xdf95('0x3f')],{'$or':_['map'](_0x30e4bc,function(_0x9733d0){if(_0x9733d0[_0xdf95('0x32')]!==_0xdf95('0x41')){var _0x1103dd={};_0x1103dd[_0x9733d0['name']]={'$like':'%'+_0x17e7c8[_0xdf95('0x35')][_0xdf95('0x42')]+'%'};return _0x1103dd;}})});}_0x23b758=_[_0xdf95('0x43')]({},_0x23b758,_0x17e7c8['options']);var _0x1fabc6={'where':_0x23b758['where']};return db['ZendeskField']['count'](_0x1fabc6)[_0xdf95('0x29')](function(_0x380f15){_0x3686b4['count']=_0x380f15;if(_0x17e7c8[_0xdf95('0x35')][_0xdf95('0x44')]){_0x23b758[_0xdf95('0x45')]=[{'all':!![]}];}return db[_0xdf95('0x46')][_0xdf95('0x47')](_0x23b758);})['then'](function(_0x4b198e){_0x3686b4[_0xdf95('0x48')]=_0x4b198e;return _0x3686b4;})['then'](respondWithFilteredResult(_0xc3af58,_0x23b758))[_0xdf95('0x49')](handleError(_0xc3af58,null));};exports[_0xdf95('0x4a')]=function(_0x37a8ec,_0x21d312){var _0x22af00={'raw':!![],'where':{'id':_0x37a8ec['params']['id']}},_0x263e66={};_0x263e66[_0xdf95('0x38')]=_[_0xdf95('0x34')](db[_0xdf95('0x46')][_0xdf95('0x4b')]);_0x263e66['query']=_[_0xdf95('0x34')](_0x37a8ec[_0xdf95('0x35')]);_0x263e66[_0xdf95('0x36')]=_[_0xdf95('0x37')](_0x263e66[_0xdf95('0x38')],_0x263e66[_0xdf95('0x35')]);_0x22af00[_0xdf95('0x3a')]=_['intersection'](_0x263e66[_0xdf95('0x38')],qs[_0xdf95('0x39')](_0x37a8ec['query'][_0xdf95('0x39')]));_0x22af00[_0xdf95('0x3a')]=_0x22af00[_0xdf95('0x3a')][_0xdf95('0x3b')]?_0x22af00['attributes']:_0x263e66[_0xdf95('0x38')];if(_0x37a8ec[_0xdf95('0x35')][_0xdf95('0x44')]){_0x22af00[_0xdf95('0x45')]=[{'all':!![]}];}_0x22af00=_[_0xdf95('0x43')]({},_0x22af00,_0x37a8ec['options']);return db[_0xdf95('0x46')]['find'](_0x22af00)[_0xdf95('0x29')](handleEntityNotFound(_0x21d312,null))[_0xdf95('0x29')](respondWithResult(_0x21d312,null))['catch'](handleError(_0x21d312,null));};exports['create']=function(_0x52d83d,_0x31f085){return db[_0xdf95('0x46')][_0xdf95('0x4c')](_0x52d83d[_0xdf95('0x4d')],{})['then'](respondWithResult(_0x31f085,0xc9))['catch'](handleError(_0x31f085,null));};exports[_0xdf95('0x28')]=function(_0x194776,_0x2a430d){if(_0x194776['body']['id']){delete _0x194776[_0xdf95('0x4d')]['id'];}return db[_0xdf95('0x46')][_0xdf95('0x4e')]({'where':{'id':_0x194776[_0xdf95('0x4f')]['id']}})[_0xdf95('0x29')](handleEntityNotFound(_0x2a430d,null))[_0xdf95('0x29')](saveUpdates(_0x194776[_0xdf95('0x4d')],null))['then'](respondWithResult(_0x2a430d,null))[_0xdf95('0x49')](handleError(_0x2a430d,null));};exports['destroy']=function(_0x5a47f9,_0x3bb5d8){return db[_0xdf95('0x46')][_0xdf95('0x4e')]({'where':{'id':_0x5a47f9[_0xdf95('0x4f')]['id']}})[_0xdf95('0x29')](handleEntityNotFound(_0x3bb5d8,null))[_0xdf95('0x29')](removeEntity(_0x3bb5d8,null))[_0xdf95('0x49')](handleError(_0x3bb5d8,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 3be3337..f596ee3 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 _0xa01f=['lodash','api','moment','bluebird','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x4ab440,_0x36e5a){var _0x1d44ac=function(_0x18563b){while(--_0x18563b){_0x4ab440['push'](_0x4ab440['shift']());}};_0x1d44ac(++_0x36e5a);}(_0xa01f,0x186));var _0xfa01=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xa01f[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xfa01('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfa01('0x1'));var moment=require(_0xfa01('0x2'));var BPromise=require(_0xfa01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfa01('0x4'));var config=require(_0xfa01('0x5'));var attributes=require(_0xfa01('0x6'));module[_0xfa01('0x7')]=function(_0x1a0861,_0x417f13){return _0x1a0861[_0xfa01('0x8')](_0xfa01('0x9'),attributes,{'tableName':_0xfa01('0xa'),'paranoid':![],'indexes':[{'name':_0xfa01('0xb'),'fields':[_0xfa01('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf099=['rimraf','../../config/environment','exports','ZendeskField','zendesk_unique_index','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x371b25,_0x224870){var _0x5588e8=function(_0x4e10b1){while(--_0x4e10b1){_0x371b25['push'](_0x371b25['shift']());}};_0x5588e8(++_0x224870);}(_0xf099,0xad));var _0x9f09=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0xf099[_0x3c4062];return _0x3f5bf3;};'use strict';var _=require(_0x9f09('0x0'));var util=require(_0x9f09('0x1'));var logger=require(_0x9f09('0x2'))(_0x9f09('0x3'));var moment=require(_0x9f09('0x4'));var BPromise=require(_0x9f09('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f09('0x6'));var rimraf=require(_0x9f09('0x7'));var config=require(_0x9f09('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x9f09('0x9')]=function(_0xb1bd0b,_0x3e0cf7){return _0xb1bd0b['define'](_0x9f09('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x9f09('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index b568585..3e872b5 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 _0x39af=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x485701,_0x7f0974){var _0x299bf8=function(_0x4393aa){while(--_0x4393aa){_0x485701['push'](_0x485701['shift']());}};_0x299bf8(++_0x7f0974);}(_0x39af,0x71));var _0xf39a=function(_0xc83573,_0x379370){_0xc83573=_0xc83573-0x0;var _0x4856e0=_0x39af[_0xc83573];return _0x4856e0;};'use strict';var _=require('lodash');var util=require(_0xf39a('0x0'));var moment=require('moment');var BPromise=require(_0xf39a('0x1'));var rs=require(_0xf39a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf39a('0x3'))['db'];var utils=require(_0xf39a('0x4'));var logger=require(_0xf39a('0x5'))('rpc');var config=require(_0xf39a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf39a('0x7')][_0xf39a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47642f,_0x32535d,_0x6c226a){return new BPromise(function(_0x20a1a7,_0x4bc761){return client[_0xf39a('0x9')](_0x47642f,_0x6c226a)['then'](function(_0x351e39){logger[_0xf39a('0xa')](_0xf39a('0xb'),_0x32535d,_0xf39a('0xc'));logger[_0xf39a('0xd')](_0xf39a('0xe'),_0x32535d,'request\x20sent',JSON[_0xf39a('0xf')](_0x351e39));if(_0x351e39[_0xf39a('0x10')]){if(_0x351e39[_0xf39a('0x10')][_0xf39a('0x11')]===0x1f4){logger[_0xf39a('0x10')](_0xf39a('0xb'),_0x32535d,_0x351e39['error'][_0xf39a('0x12')]);return _0x4bc761(_0x351e39[_0xf39a('0x10')]['message']);}logger[_0xf39a('0x10')](_0xf39a('0xb'),_0x32535d,_0x351e39['error'][_0xf39a('0x12')]);return _0x20a1a7(_0x351e39[_0xf39a('0x10')][_0xf39a('0x12')]);}else{logger['info'](_0xf39a('0xb'),_0x32535d,_0xf39a('0xc'));_0x20a1a7(_0x351e39[_0xf39a('0x13')][_0xf39a('0x12')]);}})[_0xf39a('0x14')](function(_0x1b436e){logger[_0xf39a('0x10')](_0xf39a('0xb'),_0x32535d,_0x1b436e);_0x4bc761(_0x1b436e);});});} \ No newline at end of file +var _0xf53e=['jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x1c7eaf,_0x1f7036){var _0x2a7d93=function(_0x52e97a){while(--_0x52e97a){_0x1c7eaf['push'](_0x1c7eaf['shift']());}};_0x2a7d93(++_0x1f7036);}(_0xf53e,0x65));var _0xef53=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf53e[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xef53('0x0'));var moment=require('moment');var BPromise=require(_0xef53('0x1'));var rs=require(_0xef53('0x2'));var fs=require('fs');var Redis=require(_0xef53('0x3'));var db=require(_0xef53('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef53('0x5'))('rpc');var config=require(_0xef53('0x6'));var jayson=require(_0xef53('0x7'));var client=jayson['client'][_0xef53('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7ef7ab,_0x26ab1f,_0x74b9c0){return new BPromise(function(_0x125744,_0x2da1ac){return client[_0xef53('0x9')](_0x7ef7ab,_0x74b9c0)['then'](function(_0x2ee3da){logger[_0xef53('0xa')](_0xef53('0xb'),_0x26ab1f,_0xef53('0xc'));logger['debug'](_0xef53('0xd'),_0x26ab1f,_0xef53('0xc'),JSON[_0xef53('0xe')](_0x2ee3da));if(_0x2ee3da['error']){if(_0x2ee3da[_0xef53('0xf')]['code']===0x1f4){logger[_0xef53('0xf')](_0xef53('0xb'),_0x26ab1f,_0x2ee3da[_0xef53('0xf')][_0xef53('0x10')]);return _0x2da1ac(_0x2ee3da[_0xef53('0xf')][_0xef53('0x10')]);}logger['error'](_0xef53('0xb'),_0x26ab1f,_0x2ee3da['error'][_0xef53('0x10')]);return _0x125744(_0x2ee3da[_0xef53('0xf')][_0xef53('0x10')]);}else{logger[_0xef53('0xa')](_0xef53('0xb'),_0x26ab1f,_0xef53('0xc'));_0x125744(_0x2ee3da['result'][_0xef53('0x10')]);}})[_0xef53('0x11')](function(_0x4d4bba){logger[_0xef53('0xf')]('ZendeskField,\x20%s,\x20%s',_0x26ab1f,_0x4d4bba);_0x2da1ac(_0x4d4bba);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 62b1b96..ec10681 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 _0x15b6=['/:id/fields','getFields','post','create','update','/:id','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations'];(function(_0x43fa62,_0x3cff47){var _0x30fbf8=function(_0x52136a){while(--_0x52136a){_0x43fa62['push'](_0x43fa62['shift']());}};_0x30fbf8(++_0x3cff47);}(_0x15b6,0x1aa));var _0x615b=function(_0x37af90,_0x3fe010){_0x37af90=_0x37af90-0x0;var _0x51a27d=_0x15b6[_0x37af90];return _0x51a27d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x615b('0x0'));var timeout=require(_0x615b('0x1'));var express=require(_0x615b('0x2'));var router=express[_0x615b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x615b('0x4'));var interaction=require(_0x615b('0x5'));var config=require(_0x615b('0x6'));var controller=require(_0x615b('0x7'));router[_0x615b('0x8')]('/',auth[_0x615b('0x9')](),controller[_0x615b('0xa')]);router[_0x615b('0x8')]('/:id',auth[_0x615b('0x9')](),controller[_0x615b('0xb')]);router[_0x615b('0x8')](_0x615b('0xc'),auth[_0x615b('0x9')](),controller[_0x615b('0xd')]);router[_0x615b('0x8')](_0x615b('0xe'),auth['isAuthenticated'](),controller[_0x615b('0xf')]);router[_0x615b('0x10')]('/',auth[_0x615b('0x9')](),controller[_0x615b('0x11')]);router['post']('/:id/configurations',auth[_0x615b('0x9')](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x615b('0x12')]);router['delete'](_0x615b('0x13'),auth[_0x615b('0x9')](),controller[_0x615b('0x14')]);module[_0x615b('0x15')]=router; \ No newline at end of file +var _0xafea=['getConfigurations','getFields','post','addConfiguration','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','show','/:id/configurations'];(function(_0x25b411,_0x200686){var _0xc2830c=function(_0x3a3415){while(--_0x3a3415){_0x25b411['push'](_0x25b411['shift']());}};_0xc2830c(++_0x200686);}(_0xafea,0xee));var _0xaafe=function(_0x654733,_0x268e63){_0x654733=_0x654733-0x0;var _0x588e8f=_0xafea[_0x654733];return _0x588e8f;};'use strict';var multer=require(_0xaafe('0x0'));var util=require(_0xaafe('0x1'));var path=require(_0xaafe('0x2'));var timeout=require(_0xaafe('0x3'));var express=require(_0xaafe('0x4'));var router=express[_0xaafe('0x5')]();var fs_extra=require(_0xaafe('0x6'));var auth=require(_0xaafe('0x7'));var interaction=require(_0xaafe('0x8'));var config=require(_0xaafe('0x9'));var controller=require(_0xaafe('0xa'));router[_0xaafe('0xb')]('/',auth[_0xaafe('0xc')](),controller['index']);router[_0xaafe('0xb')]('/:id',auth[_0xaafe('0xc')](),controller[_0xaafe('0xd')]);router[_0xaafe('0xb')](_0xaafe('0xe'),auth[_0xaafe('0xc')](),controller[_0xaafe('0xf')]);router[_0xaafe('0xb')]('/:id/fields',auth[_0xaafe('0xc')](),controller[_0xaafe('0x10')]);router[_0xaafe('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaafe('0x11')]('/:id/configurations',auth[_0xaafe('0xc')](),controller[_0xaafe('0x12')]);router['put'](_0xaafe('0x13'),auth[_0xaafe('0xc')](),controller[_0xaafe('0x14')]);router[_0xaafe('0x15')](_0xaafe('0x13'),auth[_0xaafe('0xc')](),controller['destroy']);module[_0xaafe('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index a922c7a..e89de5d 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 _0x9bde=['STRING','exports'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x104b31,_0x5de982){_0x104b31=_0x104b31-0x0;var _0xbacd69=_0x9bde[_0x104b31];return _0xbacd69;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}}; \ No newline at end of file +var _0xb821=['STRING','exports'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xb821,0xa7));var _0x1b82=function(_0x25ed50,_0x1f7811){_0x25ed50=_0x25ed50-0x0;var _0x55525b=_0xb821[_0x25ed50];return _0x55525b;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'name':{'type':Sequelize[_0x1b82('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x1b82('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1b82('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x1b82('0x1')]},'refreshToken':{'type':Sequelize[_0x1b82('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index ec3bf90..9413738 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 _0xfd8f=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','code','host','zoho.eu','serverUrl','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x4fdbc3,_0x2aa95d){var _0x4bfbbc=function(_0x1f198e){while(--_0x1f198e){_0x4fdbc3['push'](_0x4fdbc3['shift']());}};_0x4bfbbc(++_0x2aa95d);}(_0xfd8f,0x76));var _0xffd8=function(_0xa34ef6,_0x252618){_0xa34ef6=_0xa34ef6-0x0;var _0x3dff5f=_0xfd8f[_0xa34ef6];return _0x3dff5f;};'use strict';var emlformat=require(_0xffd8('0x0'));var rimraf=require(_0xffd8('0x1'));var zipdir=require(_0xffd8('0x2'));var jsonpatch=require(_0xffd8('0x3'));var rp=require(_0xffd8('0x4'));var moment=require(_0xffd8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xffd8('0x6'));var util=require(_0xffd8('0x7'));var path=require(_0xffd8('0x8'));var sox=require(_0xffd8('0x9'));var csv=require(_0xffd8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffd8('0xb'));var squel=require(_0xffd8('0xc'));var crypto=require(_0xffd8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xffd8('0xe'));var toCsv=require(_0xffd8('0xa'));var querystring=require(_0xffd8('0xf'));var Papa=require(_0xffd8('0x10'));var Redis=require(_0xffd8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xffd8('0x12'));var as=require(_0xffd8('0x13'));var hardwareService=require(_0xffd8('0x14'));var logger=require(_0xffd8('0x15'))(_0xffd8('0x16'));var utils=require(_0xffd8('0x17'));var config=require(_0xffd8('0x18'));var licenseUtil=require(_0xffd8('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xffd8('0x1a'));function respondWithStatusCode(_0x4a5046,_0x3ecb05){_0x3ecb05=_0x3ecb05||0xcc;return function(_0x8703b7){if(_0x8703b7){return _0x4a5046['sendStatus'](_0x3ecb05);}return _0x4a5046[_0xffd8('0x1b')](_0x3ecb05)[_0xffd8('0x1c')]();};}function respondWithResult(_0x4c9a9e,_0x5d8bf1){_0x5d8bf1=_0x5d8bf1||0xc8;return function(_0x1ff9fd){if(_0x1ff9fd){return _0x4c9a9e[_0xffd8('0x1b')](_0x5d8bf1)[_0xffd8('0x1d')](_0x1ff9fd);}};}function respondWithFilteredResult(_0xed1e34,_0x28c404){return function(_0x455a17){if(_0x455a17){var _0x24d7c3=typeof _0x28c404[_0xffd8('0x1e')]===_0xffd8('0x1f')&&typeof _0x28c404[_0xffd8('0x20')]==='undefined';var _0x25e012=_0x455a17['count'];var _0x3ffffb=_0x24d7c3?0x0:_0x28c404['offset'];var _0x1c61ab=_0x24d7c3?_0x455a17[_0xffd8('0x21')]:_0x28c404[_0xffd8('0x1e')]+_0x28c404[_0xffd8('0x20')];var _0x1e6c92;if(_0x1c61ab>=_0x25e012){_0x1c61ab=_0x25e012;_0x1e6c92=0xc8;}else{_0x1e6c92=0xce;}_0xed1e34['status'](_0x1e6c92);return _0xed1e34[_0xffd8('0x22')](_0xffd8('0x23'),_0x3ffffb+'-'+_0x1c61ab+'/'+_0x25e012)[_0xffd8('0x1d')](_0x455a17);}return null;};}function patchUpdates(_0x5228d3){return function(_0x371df4){try{jsonpatch[_0xffd8('0x24')](_0x371df4,_0x5228d3,!![]);}catch(_0x1bc151){return BPromise['reject'](_0x1bc151);}return _0x371df4[_0xffd8('0x25')]();};}function saveUpdates(_0x56ec38,_0x4ad965){return function(_0x16c77f){if(_0x16c77f){return _0x16c77f[_0xffd8('0x26')](_0x56ec38)[_0xffd8('0x27')](function(_0x1e7e4f){return _0x1e7e4f;});}return null;};}function removeEntity(_0x566895,_0x2a6bc3){return function(_0x33e633){if(_0x33e633){return _0x33e633[_0xffd8('0x28')]()[_0xffd8('0x27')](function(){_0x566895[_0xffd8('0x1b')](0xcc)[_0xffd8('0x1c')]();});}};}function handleEntityNotFound(_0x227f34,_0x111eef){return function(_0x235345){if(!_0x235345){_0x227f34[_0xffd8('0x29')](0x194);}return _0x235345;};}function handleError(_0x2396d9,_0x4e7ab2){_0x4e7ab2=_0x4e7ab2||0x1f4;return function(_0xd61d0b){logger[_0xffd8('0x2a')](_0xd61d0b[_0xffd8('0x2b')]);if(_0xd61d0b['name']){delete _0xd61d0b[_0xffd8('0x2c')];}_0x2396d9[_0xffd8('0x1b')](_0x4e7ab2)['send'](_0xd61d0b);};}exports[_0xffd8('0x2d')]=function(_0x16aec6,_0x4f9fd0){var _0x418e0d={},_0x27f1a6={},_0x6945b2={'count':0x0,'rows':[]};var _0x587f2d=_[_0xffd8('0x2e')](db['ZohoAccount'][_0xffd8('0x2f')],function(_0x1ae06c){return{'name':_0x1ae06c[_0xffd8('0x30')],'type':_0x1ae06c[_0xffd8('0x31')][_0xffd8('0x32')]};});_0x27f1a6[_0xffd8('0x33')]=_['map'](_0x587f2d,'name');_0x27f1a6[_0xffd8('0x34')]=_[_0xffd8('0x35')](_0x16aec6[_0xffd8('0x34')]);_0x27f1a6[_0xffd8('0x36')]=_[_0xffd8('0x37')](_0x27f1a6[_0xffd8('0x33')],_0x27f1a6[_0xffd8('0x34')]);_0x418e0d[_0xffd8('0x38')]=_[_0xffd8('0x37')](_0x27f1a6[_0xffd8('0x33')],qs['fields'](_0x16aec6['query'][_0xffd8('0x39')]));_0x418e0d[_0xffd8('0x38')]=_0x418e0d[_0xffd8('0x38')][_0xffd8('0x3a')]?_0x418e0d['attributes']:_0x27f1a6['model'];if(!_0x16aec6[_0xffd8('0x34')]['hasOwnProperty'](_0xffd8('0x3b'))){_0x418e0d[_0xffd8('0x20')]=qs[_0xffd8('0x20')](_0x16aec6[_0xffd8('0x34')][_0xffd8('0x20')]);_0x418e0d[_0xffd8('0x1e')]=qs[_0xffd8('0x1e')](_0x16aec6['query'][_0xffd8('0x1e')]);}_0x418e0d['order']=qs[_0xffd8('0x3c')](_0x16aec6[_0xffd8('0x34')][_0xffd8('0x3c')]);_0x418e0d[_0xffd8('0x3d')]=qs[_0xffd8('0x36')](_['pick'](_0x16aec6['query'],_0x27f1a6[_0xffd8('0x36')]),_0x587f2d);if(_0x16aec6['query'][_0xffd8('0x3e')]){_0x418e0d['where']=_[_0xffd8('0x3f')](_0x418e0d[_0xffd8('0x3d')],{'$or':_[_0xffd8('0x2e')](_0x587f2d,function(_0x2e6e25){if(_0x2e6e25[_0xffd8('0x31')]!==_0xffd8('0x40')){var _0x342629={};_0x342629[_0x2e6e25[_0xffd8('0x2c')]]={'$like':'%'+_0x16aec6[_0xffd8('0x34')][_0xffd8('0x3e')]+'%'};return _0x342629;}})});}_0x418e0d=_[_0xffd8('0x3f')]({},_0x418e0d,_0x16aec6[_0xffd8('0x41')]);var _0xe2de29={'where':_0x418e0d[_0xffd8('0x3d')]};return db[_0xffd8('0x42')][_0xffd8('0x21')](_0xe2de29)[_0xffd8('0x27')](function(_0x3a9539){_0x6945b2[_0xffd8('0x21')]=_0x3a9539;if(_0x16aec6[_0xffd8('0x34')][_0xffd8('0x43')]){_0x418e0d[_0xffd8('0x44')]=[{'all':!![]}];}return db[_0xffd8('0x42')][_0xffd8('0x45')](_0x418e0d);})[_0xffd8('0x27')](function(_0x3f7742){_0x6945b2[_0xffd8('0x46')]=_0x3f7742;return _0x6945b2;})[_0xffd8('0x27')](respondWithFilteredResult(_0x4f9fd0,_0x418e0d))[_0xffd8('0x47')](handleError(_0x4f9fd0,null));};exports[_0xffd8('0x48')]=function(_0x408a33,_0x594354){var _0x18868a={'raw':![],'where':{'id':_0x408a33[_0xffd8('0x49')]['id']}},_0x4a0a6f={};_0x4a0a6f[_0xffd8('0x33')]=_['keys'](db[_0xffd8('0x42')][_0xffd8('0x2f')]);_0x4a0a6f[_0xffd8('0x34')]=_['keys'](_0x408a33['query']);_0x4a0a6f[_0xffd8('0x36')]=_[_0xffd8('0x37')](_0x4a0a6f[_0xffd8('0x33')],_0x4a0a6f[_0xffd8('0x34')]);_0x18868a[_0xffd8('0x38')]=_[_0xffd8('0x37')](_0x4a0a6f[_0xffd8('0x33')],qs[_0xffd8('0x39')](_0x408a33[_0xffd8('0x34')][_0xffd8('0x39')]));_0x18868a[_0xffd8('0x38')]=_0x18868a[_0xffd8('0x38')]['length']?_0x18868a[_0xffd8('0x38')]:_0x4a0a6f[_0xffd8('0x33')];if(_0x408a33[_0xffd8('0x34')][_0xffd8('0x43')]){_0x18868a[_0xffd8('0x44')]=[{'all':!![]}];}_0x18868a=_[_0xffd8('0x3f')]({},_0x18868a,_0x408a33[_0xffd8('0x41')]);return db[_0xffd8('0x42')][_0xffd8('0x4a')](_0x18868a)['then'](handleEntityNotFound(_0x594354,null))[_0xffd8('0x27')](respondWithResult(_0x594354,null))[_0xffd8('0x47')](handleError(_0x594354,null));};exports[_0xffd8('0x4b')]=function(_0x3594c7,_0xcc3735){return db['ZohoAccount']['create'](_0x3594c7[_0xffd8('0x4c')],{})[_0xffd8('0x27')](respondWithResult(_0xcc3735,0xc9))['catch'](handleError(_0xcc3735,null));};exports[_0xffd8('0x26')]=function(_0x51b5bf,_0x88f24b){if(_0x51b5bf[_0xffd8('0x4c')]['id']){delete _0x51b5bf[_0xffd8('0x4c')]['id'];}return db[_0xffd8('0x42')][_0xffd8('0x4a')]({'where':{'id':_0x51b5bf[_0xffd8('0x49')]['id']}})['then'](handleEntityNotFound(_0x88f24b,null))['then'](saveUpdates(_0x51b5bf[_0xffd8('0x4c')],null))[_0xffd8('0x27')](respondWithResult(_0x88f24b,null))[_0xffd8('0x47')](handleError(_0x88f24b,null));};exports[_0xffd8('0x28')]=function(_0x2d1f3,_0x37938e){return db['ZohoAccount'][_0xffd8('0x4a')]({'where':{'id':_0x2d1f3[_0xffd8('0x49')]['id']}})[_0xffd8('0x27')](handleEntityNotFound(_0x37938e,null))[_0xffd8('0x27')](removeEntity(_0x37938e,null))[_0xffd8('0x47')](handleError(_0x37938e,null));};exports[_0xffd8('0x4d')]=function(_0x50a921,_0x1bbfce,_0x316668){var _0x28e12a={};var _0x2231c2={};var _0x55f0d2;var _0x5e85bb;return db[_0xffd8('0x42')]['findOne']({'where':{'id':_0x50a921[_0xffd8('0x49')]['id']}})['then'](handleEntityNotFound(_0x1bbfce,null))[_0xffd8('0x27')](function(_0x4bba83){if(_0x4bba83){_0x55f0d2=_0x4bba83;_0x2231c2[_0xffd8('0x33')]=_[_0xffd8('0x35')](db['ZohoConfiguration'][_0xffd8('0x2f')]);_0x2231c2[_0xffd8('0x34')]=_[_0xffd8('0x35')](_0x50a921[_0xffd8('0x34')]);_0x2231c2[_0xffd8('0x36')]=_[_0xffd8('0x37')](_0x2231c2[_0xffd8('0x33')],_0x2231c2[_0xffd8('0x34')]);_0x28e12a[_0xffd8('0x38')]=_['intersection'](_0x2231c2['model'],qs[_0xffd8('0x39')](_0x50a921[_0xffd8('0x34')][_0xffd8('0x39')]));_0x28e12a['attributes']=_0x28e12a[_0xffd8('0x38')][_0xffd8('0x3a')]?_0x28e12a[_0xffd8('0x38')]:_0x2231c2['model'];_0x28e12a[_0xffd8('0x4e')]=qs[_0xffd8('0x3c')](_0x50a921[_0xffd8('0x34')][_0xffd8('0x3c')]);_0x28e12a[_0xffd8('0x3d')]=qs[_0xffd8('0x36')](_['pick'](_0x50a921['query'],_0x2231c2[_0xffd8('0x36')]));if(_0x50a921[_0xffd8('0x34')]['filter']){_0x28e12a['where']=_[_0xffd8('0x3f')](_0x28e12a[_0xffd8('0x3d')],{'$or':_[_0xffd8('0x2e')](_0x28e12a[_0xffd8('0x38')],function(_0x2b02ba){var _0x195380={};_0x195380[_0x2b02ba]={'$like':'%'+_0x50a921[_0xffd8('0x34')][_0xffd8('0x3e')]+'%'};return _0x195380;})});}_0x28e12a=_['merge']({},_0x28e12a,_0x50a921[_0xffd8('0x41')]);return _0x55f0d2[_0xffd8('0x4d')](_0x28e12a);}})['then'](function(_0x49b09c){if(_0x49b09c){_0x5e85bb=_0x49b09c[_0xffd8('0x3a')];if(!_0x50a921[_0xffd8('0x34')][_0xffd8('0x4f')](_0xffd8('0x3b'))){_0x28e12a['limit']=qs[_0xffd8('0x20')](_0x50a921[_0xffd8('0x34')]['limit']);_0x28e12a['offset']=qs[_0xffd8('0x1e')](_0x50a921[_0xffd8('0x34')][_0xffd8('0x1e')]);}return _0x55f0d2[_0xffd8('0x4d')](_0x28e12a);}})[_0xffd8('0x27')](function(_0x464124){if(_0x464124){return _0x464124?{'count':_0x5e85bb,'rows':_0x464124}:null;}})[_0xffd8('0x27')](respondWithResult(_0x1bbfce,null))[_0xffd8('0x47')](handleError(_0x1bbfce,null));};exports[_0xffd8('0x50')]=function(_0x3ce590,_0x12bdba,_0xb37c9a){if(_0x3ce590[_0xffd8('0x4c')]['id']){delete _0x3ce590[_0xffd8('0x4c')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x3ce590[_0xffd8('0x49')]['id']}})[_0xffd8('0x27')](handleEntityNotFound(_0x12bdba,null))['then'](function(_0x22fcc4){if(_0x22fcc4){_0x3ce590['body'][_0xffd8('0x51')]=_0x22fcc4['id'];_0x3ce590[_0xffd8('0x4c')][_0xffd8('0x52')]=integrations[_0xffd8('0x53')](_0x3ce590[_0xffd8('0x4c')][_0xffd8('0x54')],_0x3ce590[_0xffd8('0x4c')][_0xffd8('0x31')]);_0x3ce590[_0xffd8('0x4c')][_0xffd8('0x55')]=integrations[_0xffd8('0x56')](_0x3ce590['body'][_0xffd8('0x54')],_0x3ce590['body'][_0xffd8('0x31')]);return db[_0xffd8('0x57')][_0xffd8('0x4b')](_0x3ce590[_0xffd8('0x4c')],{'include':[{'model':db[_0xffd8('0x58')],'as':_0xffd8('0x52')},{'model':db[_0xffd8('0x58')],'as':_0xffd8('0x55')}]});}return null;})['then'](respondWithResult(_0x12bdba,null))[_0xffd8('0x47')](handleError(_0x12bdba,null));};function getAccessToken(_0x23a55f){return new Promise(function(_0x3ea40c,_0x5cd8b9){var _0x4ba480;switch(_0x23a55f[_0xffd8('0x59')]){case'US':_0x4ba480=_0xffd8('0x5a');break;case'AU':_0x4ba480=_0xffd8('0x5b');break;case'EU':_0x4ba480=_0xffd8('0x5c');break;case'IN':_0x4ba480=_0xffd8('0x5d');break;case'CN':_0x4ba480=_0xffd8('0x5e');break;default:_0x4ba480=_0xffd8('0x5c');break;}var _0xe83af8={'method':_0xffd8('0x5f'),'uri':_0x4ba480+'/oauth/v2/token','qs':{'refresh_token':_0x23a55f[_0xffd8('0x60')],'client_id':_0x23a55f[_0xffd8('0x61')],'client_secret':_0x23a55f[_0xffd8('0x62')],'grant_type':_0xffd8('0x63')},'json':!![]};return rp(_0xe83af8)[_0xffd8('0x27')](function(_0x286031){if(_0x286031['access_token']){_0x3ea40c(_0x286031[_0xffd8('0x64')]);}else{_0x5cd8b9(_0xffd8('0x65'));}})[_0xffd8('0x47')](function(_0x28f9da){_0x5cd8b9(_0x28f9da);});});}exports[_0xffd8('0x66')]=function(_0x1115c0,_0x495242,_0x57eb57){var _0x1b2bb3,_0x28096f,_0x149fc9,_0x324907,_0x2c14a5;return db[_0xffd8('0x42')][_0xffd8('0x67')]({'where':{'id':_0x1115c0[_0xffd8('0x49')]['id']},'attributes':['id','host',_0xffd8('0x59'),_0xffd8('0x61'),_0xffd8('0x62'),'serverUrl',_0xffd8('0x68'),_0xffd8('0x60')]})['then'](handleEntityNotFound(_0x495242,null))[_0xffd8('0x27')](function(_0x37685b){_0x2c14a5=_0x37685b;_0x1b2bb3=_0x2c14a5[_0xffd8('0x69')];_0x28096f=_0x1b2bb3===_0xffd8('0x6a')?'eu':'com';_0x149fc9=_0x2c14a5[_0xffd8('0x6b')];var _0x36a46b=_0x149fc9[_0xffd8('0x6c')](-0x1);if(_0x36a46b==='/'||_0x36a46b==='\x5c'||_0x36a46b===':'){_0x149fc9=_0x149fc9[_0xffd8('0x6d')](0x0,_0x149fc9['lastIndexOf'](_0x36a46b));}if(!_0x2c14a5[_0xffd8('0x60')]){throw new Error(_0xffd8('0x6e'));}return getAccessToken(_0x2c14a5);})['then'](function(_0x2f3f3c){if(_0x2f3f3c){return rp({'method':_0xffd8('0x6f'),'uri':util[_0xffd8('0x70')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x28096f),'qs':{'module':_0xffd8('0x71')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2f3f3c},'json':!![]});}})[_0xffd8('0x27')](function(_0x4a7fe2){if(_0x4a7fe2){if(_0x4a7fe2[_0xffd8('0x72')]&&_0x4a7fe2[_0xffd8('0x72')][_0xffd8('0x2a')]){throw new Error(_0x4a7fe2[_0xffd8('0x72')][_0xffd8('0x2a')][_0xffd8('0x73')]);}var _0x2b4f56=[];var _0x643963=[];var _0x1e9382=[_0xffd8('0x74'),_0xffd8('0x75'),_0xffd8('0x76'),'WhoId',_0xffd8('0x77'),_0xffd8('0x78'),_0xffd8('0x79'),_0xffd8('0x7a')];_0x643963=_[_0xffd8('0x7b')](_0x4a7fe2['fields'],function(_0x168eb9){return _0x1e9382[_0xffd8('0x7c')](_0x168eb9['api_name']);});for(var _0x3ba99e=0x0;_0x3ba99e<_0x643963[_0xffd8('0x3a')];_0x3ba99e++){if(_0x643963[_0x3ba99e][_0xffd8('0x7d')]===![]){_0x2b4f56[_0xffd8('0x7e')]({'id':_0x643963[_0x3ba99e]['id'],'name':_0x643963[_0x3ba99e][_0xffd8('0x7f')],'custom':_0x643963[_0x3ba99e][_0xffd8('0x80')],'options':_0x643963[_0x3ba99e][_0xffd8('0x81')]==='picklist'&&_0x643963[_0x3ba99e][_0xffd8('0x82')][_0xffd8('0x3a')]>-0x1?_['map'](_0x643963[_0x3ba99e][_0xffd8('0x82')],function(_0x3fd37d){return{'name':_0x3fd37d,'value':_0x3fd37d};}):[]});}}return{'count':_0x2b4f56['length'],'rows':_0x2b4f56};}else{return{'count':0x0,'rows':[]};}})[_0xffd8('0x27')](respondWithResult(_0x495242,null))[_0xffd8('0x47')](function(_0xa85b7f){var _0x119771=_0x1115c0[_0xffd8('0x34')]['test']?0x1f4:_0xa85b7f[_0xffd8('0x83')]||0x1f4;logger[_0xffd8('0x2a')](_0xffd8('0x84'),_0xffd8('0x66'),_0x119771,JSON[_0xffd8('0x85')](_0xa85b7f));delete _0xa85b7f['name'];if(_0x119771===0x191){_0x119771=0x190;}_0x495242['status'](_0x119771)[_0xffd8('0x86')](_0x1115c0[_0xffd8('0x34')][_0xffd8('0x87')]?{'message':_0xffd8('0x88'),'statusCode':_0xa85b7f[_0xffd8('0x83')]}:_0xa85b7f);});}; \ No newline at end of file +var _0xc1b2=['send','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','update','then','destroy','stack','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','ZohoAccount','findAll','rows','show','includeAll','include','options','find','catch','create','body','params','findOne','ZohoConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','refreshToken','host','com','serverUrl','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','stringify'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0xc1b2,0x17f));var _0x2c1b=function(_0x49a204,_0x2b1f83){_0x49a204=_0x49a204-0x0;var _0x33a7bc=_0xc1b2[_0x49a204];return _0x33a7bc;};'use strict';var emlformat=require(_0x2c1b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2c1b('0x1'));var rp=require(_0x2c1b('0x2'));var moment=require(_0x2c1b('0x3'));var BPromise=require(_0x2c1b('0x4'));var Mustache=require(_0x2c1b('0x5'));var util=require('util');var path=require(_0x2c1b('0x6'));var sox=require(_0x2c1b('0x7'));var csv=require(_0x2c1b('0x8'));var ejs=require(_0x2c1b('0x9'));var fs=require('fs');var fs_extra=require(_0x2c1b('0xa'));var _=require(_0x2c1b('0xb'));var squel=require(_0x2c1b('0xc'));var crypto=require(_0x2c1b('0xd'));var jsforce=require(_0x2c1b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2c1b('0x8'));var querystring=require(_0x2c1b('0xf'));var Papa=require(_0x2c1b('0x10'));var Redis=require('ioredis');var authService=require(_0x2c1b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2c1b('0x12'));var hardwareService=require(_0x2c1b('0x13'));var logger=require('../../config/logger')(_0x2c1b('0x14'));var utils=require(_0x2c1b('0x15'));var config=require(_0x2c1b('0x16'));var licenseUtil=require(_0x2c1b('0x17'));var db=require(_0x2c1b('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x498ad8,_0x405a85){_0x405a85=_0x405a85||0xcc;return function(_0x3e0ef4){if(_0x3e0ef4){return _0x498ad8[_0x2c1b('0x19')](_0x405a85);}return _0x498ad8['status'](_0x405a85)['end']();};}function respondWithResult(_0x12d96e,_0x2fb3b9){_0x2fb3b9=_0x2fb3b9||0xc8;return function(_0x421f6a){if(_0x421f6a){return _0x12d96e[_0x2c1b('0x1a')](_0x2fb3b9)[_0x2c1b('0x1b')](_0x421f6a);}};}function respondWithFilteredResult(_0x122d97,_0x3036f9){return function(_0x7c3f42){if(_0x7c3f42){var _0x990264=typeof _0x3036f9['offset']==='undefined'&&typeof _0x3036f9[_0x2c1b('0x1c')]===_0x2c1b('0x1d');var _0x14a405=_0x7c3f42[_0x2c1b('0x1e')];var _0x1372c4=_0x990264?0x0:_0x3036f9[_0x2c1b('0x1f')];var _0x236c06=_0x990264?_0x7c3f42['count']:_0x3036f9[_0x2c1b('0x1f')]+_0x3036f9[_0x2c1b('0x1c')];var _0x4adf15;if(_0x236c06>=_0x14a405){_0x236c06=_0x14a405;_0x4adf15=0xc8;}else{_0x4adf15=0xce;}_0x122d97[_0x2c1b('0x1a')](_0x4adf15);return _0x122d97[_0x2c1b('0x20')](_0x2c1b('0x21'),_0x1372c4+'-'+_0x236c06+'/'+_0x14a405)[_0x2c1b('0x1b')](_0x7c3f42);}return null;};}function patchUpdates(_0x25a5e1){return function(_0x14e67d){try{jsonpatch['apply'](_0x14e67d,_0x25a5e1,!![]);}catch(_0x5331b7){return BPromise['reject'](_0x5331b7);}return _0x14e67d['save']();};}function saveUpdates(_0x1000f7,_0x2fc6a0){return function(_0x18ba17){if(_0x18ba17){return _0x18ba17[_0x2c1b('0x22')](_0x1000f7)[_0x2c1b('0x23')](function(_0x22e244){return _0x22e244;});}return null;};}function removeEntity(_0x46a404,_0x2af9b5){return function(_0x5af38e){if(_0x5af38e){return _0x5af38e[_0x2c1b('0x24')]()[_0x2c1b('0x23')](function(){_0x46a404['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13012a,_0x147101){return function(_0x356c85){if(!_0x356c85){_0x13012a[_0x2c1b('0x19')](0x194);}return _0x356c85;};}function handleError(_0x131a3,_0x3e189b){_0x3e189b=_0x3e189b||0x1f4;return function(_0x3009fa){logger['error'](_0x3009fa[_0x2c1b('0x25')]);if(_0x3009fa[_0x2c1b('0x26')]){delete _0x3009fa[_0x2c1b('0x26')];}_0x131a3[_0x2c1b('0x1a')](_0x3e189b)['send'](_0x3009fa);};}exports[_0x2c1b('0x27')]=function(_0x56b6cd,_0x35d260){var _0x973ba1={},_0x5e2f47={},_0x3636b4={'count':0x0,'rows':[]};var _0x2be6e7=_[_0x2c1b('0x28')](db['ZohoAccount'][_0x2c1b('0x29')],function(_0x35a2d4){return{'name':_0x35a2d4['fieldName'],'type':_0x35a2d4[_0x2c1b('0x2a')][_0x2c1b('0x2b')]};});_0x5e2f47[_0x2c1b('0x2c')]=_[_0x2c1b('0x28')](_0x2be6e7,'name');_0x5e2f47['query']=_[_0x2c1b('0x2d')](_0x56b6cd[_0x2c1b('0x2e')]);_0x5e2f47[_0x2c1b('0x2f')]=_[_0x2c1b('0x30')](_0x5e2f47[_0x2c1b('0x2c')],_0x5e2f47[_0x2c1b('0x2e')]);_0x973ba1['attributes']=_[_0x2c1b('0x30')](_0x5e2f47[_0x2c1b('0x2c')],qs[_0x2c1b('0x31')](_0x56b6cd['query'][_0x2c1b('0x31')]));_0x973ba1[_0x2c1b('0x32')]=_0x973ba1[_0x2c1b('0x32')][_0x2c1b('0x33')]?_0x973ba1[_0x2c1b('0x32')]:_0x5e2f47['model'];if(!_0x56b6cd[_0x2c1b('0x2e')][_0x2c1b('0x34')]('nolimit')){_0x973ba1[_0x2c1b('0x1c')]=qs['limit'](_0x56b6cd[_0x2c1b('0x2e')][_0x2c1b('0x1c')]);_0x973ba1[_0x2c1b('0x1f')]=qs[_0x2c1b('0x1f')](_0x56b6cd[_0x2c1b('0x2e')][_0x2c1b('0x1f')]);}_0x973ba1[_0x2c1b('0x35')]=qs[_0x2c1b('0x36')](_0x56b6cd[_0x2c1b('0x2e')]['sort']);_0x973ba1[_0x2c1b('0x37')]=qs[_0x2c1b('0x2f')](_[_0x2c1b('0x38')](_0x56b6cd[_0x2c1b('0x2e')],_0x5e2f47[_0x2c1b('0x2f')]),_0x2be6e7);if(_0x56b6cd[_0x2c1b('0x2e')]['filter']){_0x973ba1[_0x2c1b('0x37')]=_[_0x2c1b('0x39')](_0x973ba1[_0x2c1b('0x37')],{'$or':_[_0x2c1b('0x28')](_0x2be6e7,function(_0x68223){if(_0x68223[_0x2c1b('0x2a')]!==_0x2c1b('0x3a')){var _0x4e2a99={};_0x4e2a99[_0x68223['name']]={'$like':'%'+_0x56b6cd['query'][_0x2c1b('0x3b')]+'%'};return _0x4e2a99;}})});}_0x973ba1=_[_0x2c1b('0x39')]({},_0x973ba1,_0x56b6cd['options']);var _0x4ec150={'where':_0x973ba1[_0x2c1b('0x37')]};return db[_0x2c1b('0x3c')]['count'](_0x4ec150)['then'](function(_0x81a397){_0x3636b4['count']=_0x81a397;if(_0x56b6cd[_0x2c1b('0x2e')]['includeAll']){_0x973ba1['include']=[{'all':!![]}];}return db[_0x2c1b('0x3c')][_0x2c1b('0x3d')](_0x973ba1);})[_0x2c1b('0x23')](function(_0x23ad3c){_0x3636b4[_0x2c1b('0x3e')]=_0x23ad3c;return _0x3636b4;})[_0x2c1b('0x23')](respondWithFilteredResult(_0x35d260,_0x973ba1))['catch'](handleError(_0x35d260,null));};exports[_0x2c1b('0x3f')]=function(_0x187c48,_0xcf2324){var _0x7a3849={'raw':![],'where':{'id':_0x187c48['params']['id']}},_0x4bcfc7={};_0x4bcfc7['model']=_['keys'](db[_0x2c1b('0x3c')]['rawAttributes']);_0x4bcfc7[_0x2c1b('0x2e')]=_[_0x2c1b('0x2d')](_0x187c48['query']);_0x4bcfc7[_0x2c1b('0x2f')]=_['intersection'](_0x4bcfc7['model'],_0x4bcfc7[_0x2c1b('0x2e')]);_0x7a3849[_0x2c1b('0x32')]=_[_0x2c1b('0x30')](_0x4bcfc7[_0x2c1b('0x2c')],qs[_0x2c1b('0x31')](_0x187c48[_0x2c1b('0x2e')][_0x2c1b('0x31')]));_0x7a3849[_0x2c1b('0x32')]=_0x7a3849['attributes'][_0x2c1b('0x33')]?_0x7a3849['attributes']:_0x4bcfc7[_0x2c1b('0x2c')];if(_0x187c48[_0x2c1b('0x2e')][_0x2c1b('0x40')]){_0x7a3849[_0x2c1b('0x41')]=[{'all':!![]}];}_0x7a3849=_[_0x2c1b('0x39')]({},_0x7a3849,_0x187c48[_0x2c1b('0x42')]);return db[_0x2c1b('0x3c')][_0x2c1b('0x43')](_0x7a3849)[_0x2c1b('0x23')](handleEntityNotFound(_0xcf2324,null))[_0x2c1b('0x23')](respondWithResult(_0xcf2324,null))[_0x2c1b('0x44')](handleError(_0xcf2324,null));};exports[_0x2c1b('0x45')]=function(_0x2ad424,_0x1f666a){return db['ZohoAccount']['create'](_0x2ad424[_0x2c1b('0x46')],{})['then'](respondWithResult(_0x1f666a,0xc9))['catch'](handleError(_0x1f666a,null));};exports[_0x2c1b('0x22')]=function(_0x3301cf,_0x514f68){if(_0x3301cf[_0x2c1b('0x46')]['id']){delete _0x3301cf[_0x2c1b('0x46')]['id'];}return db[_0x2c1b('0x3c')][_0x2c1b('0x43')]({'where':{'id':_0x3301cf[_0x2c1b('0x47')]['id']}})[_0x2c1b('0x23')](handleEntityNotFound(_0x514f68,null))['then'](saveUpdates(_0x3301cf[_0x2c1b('0x46')],null))[_0x2c1b('0x23')](respondWithResult(_0x514f68,null))[_0x2c1b('0x44')](handleError(_0x514f68,null));};exports['destroy']=function(_0x7cb0e2,_0x10ce43){return db['ZohoAccount'][_0x2c1b('0x43')]({'where':{'id':_0x7cb0e2['params']['id']}})[_0x2c1b('0x23')](handleEntityNotFound(_0x10ce43,null))[_0x2c1b('0x23')](removeEntity(_0x10ce43,null))[_0x2c1b('0x44')](handleError(_0x10ce43,null));};exports['getConfigurations']=function(_0x3b867b,_0x53485e,_0x5a06a9){var _0x4446c7={};var _0x4b771b={};var _0x4e3f0d;var _0x31edc9;return db[_0x2c1b('0x3c')][_0x2c1b('0x48')]({'where':{'id':_0x3b867b[_0x2c1b('0x47')]['id']}})[_0x2c1b('0x23')](handleEntityNotFound(_0x53485e,null))['then'](function(_0x5b120f){if(_0x5b120f){_0x4e3f0d=_0x5b120f;_0x4b771b['model']=_[_0x2c1b('0x2d')](db[_0x2c1b('0x49')]['rawAttributes']);_0x4b771b[_0x2c1b('0x2e')]=_[_0x2c1b('0x2d')](_0x3b867b['query']);_0x4b771b[_0x2c1b('0x2f')]=_[_0x2c1b('0x30')](_0x4b771b[_0x2c1b('0x2c')],_0x4b771b[_0x2c1b('0x2e')]);_0x4446c7[_0x2c1b('0x32')]=_[_0x2c1b('0x30')](_0x4b771b[_0x2c1b('0x2c')],qs[_0x2c1b('0x31')](_0x3b867b['query']['fields']));_0x4446c7['attributes']=_0x4446c7['attributes']['length']?_0x4446c7[_0x2c1b('0x32')]:_0x4b771b['model'];_0x4446c7['order']=qs[_0x2c1b('0x36')](_0x3b867b[_0x2c1b('0x2e')]['sort']);_0x4446c7['where']=qs['filters'](_[_0x2c1b('0x38')](_0x3b867b['query'],_0x4b771b[_0x2c1b('0x2f')]));if(_0x3b867b['query'][_0x2c1b('0x3b')]){_0x4446c7['where']=_[_0x2c1b('0x39')](_0x4446c7[_0x2c1b('0x37')],{'$or':_[_0x2c1b('0x28')](_0x4446c7[_0x2c1b('0x32')],function(_0x3bfc60){var _0x27afc2={};_0x27afc2[_0x3bfc60]={'$like':'%'+_0x3b867b['query'][_0x2c1b('0x3b')]+'%'};return _0x27afc2;})});}_0x4446c7=_['merge']({},_0x4446c7,_0x3b867b[_0x2c1b('0x42')]);return _0x4e3f0d[_0x2c1b('0x4a')](_0x4446c7);}})[_0x2c1b('0x23')](function(_0x259c89){if(_0x259c89){_0x31edc9=_0x259c89[_0x2c1b('0x33')];if(!_0x3b867b[_0x2c1b('0x2e')][_0x2c1b('0x34')](_0x2c1b('0x4b'))){_0x4446c7[_0x2c1b('0x1c')]=qs[_0x2c1b('0x1c')](_0x3b867b[_0x2c1b('0x2e')]['limit']);_0x4446c7['offset']=qs[_0x2c1b('0x1f')](_0x3b867b[_0x2c1b('0x2e')]['offset']);}return _0x4e3f0d[_0x2c1b('0x4a')](_0x4446c7);}})[_0x2c1b('0x23')](function(_0x28f9a8){if(_0x28f9a8){return _0x28f9a8?{'count':_0x31edc9,'rows':_0x28f9a8}:null;}})['then'](respondWithResult(_0x53485e,null))['catch'](handleError(_0x53485e,null));};exports[_0x2c1b('0x4c')]=function(_0xc8a24e,_0x214840,_0x3a443f){if(_0xc8a24e[_0x2c1b('0x46')]['id']){delete _0xc8a24e['body']['id'];}return db['ZohoAccount'][_0x2c1b('0x48')]({'where':{'id':_0xc8a24e[_0x2c1b('0x47')]['id']}})[_0x2c1b('0x23')](handleEntityNotFound(_0x214840,null))[_0x2c1b('0x23')](function(_0x50c995){if(_0x50c995){_0xc8a24e[_0x2c1b('0x46')][_0x2c1b('0x4d')]=_0x50c995['id'];_0xc8a24e['body'][_0x2c1b('0x4e')]=integrations['getSubjects'](_0xc8a24e[_0x2c1b('0x46')][_0x2c1b('0x4f')],_0xc8a24e[_0x2c1b('0x46')][_0x2c1b('0x2a')]);_0xc8a24e['body']['Descriptions']=integrations['getDescriptions'](_0xc8a24e[_0x2c1b('0x46')]['channel'],_0xc8a24e[_0x2c1b('0x46')][_0x2c1b('0x2a')]);return db['ZohoConfiguration'][_0x2c1b('0x45')](_0xc8a24e[_0x2c1b('0x46')],{'include':[{'model':db['ZohoField'],'as':_0x2c1b('0x4e')},{'model':db[_0x2c1b('0x50')],'as':_0x2c1b('0x51')}]});}return null;})[_0x2c1b('0x23')](respondWithResult(_0x214840,null))[_0x2c1b('0x44')](handleError(_0x214840,null));};function getAccessToken(_0x4c50cc){return new Promise(function(_0x5b946c,_0x15c2d9){var _0x44e5b0;switch(_0x4c50cc[_0x2c1b('0x52')]){case'US':_0x44e5b0=_0x2c1b('0x53');break;case'AU':_0x44e5b0='https://accounts.zoho.com.au';break;case'EU':_0x44e5b0=_0x2c1b('0x54');break;case'IN':_0x44e5b0=_0x2c1b('0x55');break;case'CN':_0x44e5b0=_0x2c1b('0x56');break;default:_0x44e5b0=_0x2c1b('0x54');break;}var _0x3e6fde={'method':'POST','uri':_0x44e5b0+'/oauth/v2/token','qs':{'refresh_token':_0x4c50cc['refreshToken'],'client_id':_0x4c50cc[_0x2c1b('0x57')],'client_secret':_0x4c50cc['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3e6fde)[_0x2c1b('0x23')](function(_0xee6961){if(_0xee6961[_0x2c1b('0x58')]){_0x5b946c(_0xee6961[_0x2c1b('0x58')]);}else{_0x15c2d9(_0x2c1b('0x59'));}})[_0x2c1b('0x44')](function(_0x45d1f7){_0x15c2d9(_0x45d1f7);});});}exports[_0x2c1b('0x5a')]=function(_0x216de9,_0x2e4bf8,_0x5ffe6){var _0x3d0f02,_0x4af96b,_0x36ba09,_0x1afc06,_0x4d757c;return db[_0x2c1b('0x3c')][_0x2c1b('0x48')]({'where':{'id':_0x216de9[_0x2c1b('0x47')]['id']},'attributes':['id','host',_0x2c1b('0x52'),'clientId',_0x2c1b('0x5b'),'serverUrl','code',_0x2c1b('0x5c')]})['then'](handleEntityNotFound(_0x2e4bf8,null))[_0x2c1b('0x23')](function(_0xffc71d){_0x4d757c=_0xffc71d;_0x3d0f02=_0x4d757c[_0x2c1b('0x5d')];_0x4af96b=_0x3d0f02==='zoho.eu'?'eu':_0x2c1b('0x5e');_0x36ba09=_0x4d757c[_0x2c1b('0x5f')];var _0x1c0401=_0x36ba09[_0x2c1b('0x60')](-0x1);if(_0x1c0401==='/'||_0x1c0401==='\x5c'||_0x1c0401===':'){_0x36ba09=_0x36ba09['substring'](0x0,_0x36ba09[_0x2c1b('0x61')](_0x1c0401));}if(!_0x4d757c[_0x2c1b('0x5c')]){throw new Error(_0x2c1b('0x62'));}return getAccessToken(_0x4d757c);})[_0x2c1b('0x23')](function(_0x55d8b0){if(_0x55d8b0){return rp({'method':_0x2c1b('0x63'),'uri':util[_0x2c1b('0x64')](_0x2c1b('0x65'),_0x4af96b),'qs':{'module':_0x2c1b('0x66')},'headers':{'Authorization':_0x2c1b('0x67')+_0x55d8b0},'json':!![]});}})[_0x2c1b('0x23')](function(_0x21bfc8){if(_0x21bfc8){if(_0x21bfc8[_0x2c1b('0x68')]&&_0x21bfc8[_0x2c1b('0x68')][_0x2c1b('0x69')]){throw new Error(_0x21bfc8['response']['error'][_0x2c1b('0x6a')]);}var _0x40284e=[];var _0x37df64=[];var _0x526b12=[_0x2c1b('0x6b'),_0x2c1b('0x6c'),_0x2c1b('0x6d'),'WhoId',_0x2c1b('0x6e'),_0x2c1b('0x6f'),'Call_Start_Time',_0x2c1b('0x70')];_0x37df64=_[_0x2c1b('0x71')](_0x21bfc8[_0x2c1b('0x31')],function(_0x646cad){return _0x526b12[_0x2c1b('0x72')](_0x646cad[_0x2c1b('0x73')]);});for(var _0x396287=0x0;_0x396287<_0x37df64[_0x2c1b('0x33')];_0x396287++){if(_0x37df64[_0x396287]['system_mandatory']===![]){_0x40284e[_0x2c1b('0x74')]({'id':_0x37df64[_0x396287]['id'],'name':_0x37df64[_0x396287][_0x2c1b('0x75')],'custom':_0x37df64[_0x396287][_0x2c1b('0x76')],'options':_0x37df64[_0x396287][_0x2c1b('0x77')]===_0x2c1b('0x78')&&_0x37df64[_0x396287]['pick_list_values'][_0x2c1b('0x33')]>-0x1?_['map'](_0x37df64[_0x396287][_0x2c1b('0x79')],function(_0xab5b60){return{'name':_0xab5b60,'value':_0xab5b60};}):[]});}}return{'count':_0x40284e[_0x2c1b('0x33')],'rows':_0x40284e};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x2e4bf8,null))['catch'](function(_0x326d64){var _0x185869=_0x216de9[_0x2c1b('0x2e')][_0x2c1b('0x7a')]?0x1f4:_0x326d64[_0x2c1b('0x7b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x2c1b('0x5a'),_0x185869,JSON[_0x2c1b('0x7c')](_0x326d64));delete _0x326d64[_0x2c1b('0x26')];if(_0x185869===0x191){_0x185869=0x190;}_0x2e4bf8[_0x2c1b('0x1a')](_0x185869)[_0x2c1b('0x7d')](_0x216de9[_0x2c1b('0x2e')]['test']?{'message':_0x2c1b('0x7e'),'statusCode':_0x326d64['statusCode']}:_0x326d64);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index ba1f2e3..b7df346 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 _0x6f57=['then','parse','refreshToken','refresh_token','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','zone','slice','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','serverUrl','clientId','changed','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','clientSecret','code','application/x-www-form-urlencoded'];(function(_0x4194d6,_0x3ab3e5){var _0x33ddab=function(_0x43ceb7){while(--_0x43ceb7){_0x4194d6['push'](_0x4194d6['shift']());}};_0x33ddab(++_0x3ab3e5);}(_0x6f57,0x171));var _0x76f5=function(_0x5777da,_0x16a7f6){_0x5777da=_0x5777da-0x0;var _0x36f031=_0x6f57[_0x5777da];return _0x36f031;};'use strict';var _=require(_0x76f5('0x0'));var util=require(_0x76f5('0x1'));var logger=require('../../config/logger')(_0x76f5('0x2'));var moment=require(_0x76f5('0x3'));var BPromise=require('bluebird');var rp=require(_0x76f5('0x4'));var fs=require('fs');var path=require(_0x76f5('0x5'));var rimraf=require(_0x76f5('0x6'));var config=require(_0x76f5('0x7'));var attributes=require(_0x76f5('0x8'));var integrations=require(_0x76f5('0x9'));module['exports']=function(_0x4ee091,_0x2f402e){return _0x4ee091[_0x76f5('0xa')](_0x76f5('0xb'),attributes,{'tableName':_0x76f5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b3648,_0x119217,_0x3af3a1){if(_0x2b3648['changed']('zone')||_0x2b3648['changed'](_0x76f5('0xd'))||_0x2b3648['changed'](_0x76f5('0xe'))||_0x2b3648[_0x76f5('0xf')]('clientSecret')||_0x2b3648[_0x76f5('0xf')]('code')||_0x2b3648[_0x76f5('0xf')](_0x76f5('0x10'))){var _0x51930b,_0x38a5ae;_0x51930b=_0x2b3648[_0x76f5('0xd')];var _0x216005=_0x51930b['slice'](-0x1);if(_0x216005==='/'||_0x216005==='\x5c'||_0x216005===':'){_0x51930b=_0x51930b[_0x76f5('0x11')](0x0,_0x51930b[_0x76f5('0x12')](_0x216005));}switch(_0x2b3648['zone']){case'US':_0x38a5ae=_0x76f5('0x13');break;case'AU':_0x38a5ae='https://accounts.zoho.com.au';break;case'IN':_0x38a5ae=_0x76f5('0x14');break;case'CN':_0x38a5ae=_0x76f5('0x15');break;default:_0x38a5ae='https://accounts.zoho.eu';break;}var _0x2c44ff={'method':'POST','uri':_0x38a5ae+_0x76f5('0x16'),'form':{'grant_type':_0x76f5('0x17'),'client_id':_0x2b3648[_0x76f5('0xe')],'client_secret':_0x2b3648[_0x76f5('0x18')],'redirect_uri':_0x2b3648[_0x76f5('0xd')],'code':_0x2b3648[_0x76f5('0x19')]},'headers':{'Content-Type':_0x76f5('0x1a')}};return rp(_0x2c44ff)[_0x76f5('0x1b')](function(_0x336e82){var _0x4feb25=JSON[_0x76f5('0x1c')](_0x336e82);if(_0x4feb25['refresh_token']){_0x2b3648[_0x76f5('0x1d')]=_0x4feb25[_0x76f5('0x1e')];logger[_0x76f5('0x1f')](util[_0x76f5('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2b3648[_0x76f5('0x21')],_0x2b3648['id']));}else{logger[_0x76f5('0x22')](util['format'](_0x76f5('0x23'),_0x2b3648[_0x76f5('0x21')],_0x2b3648['id']),util[_0x76f5('0x24')](_0x4feb25,{'showHidden':![],'depth':null}));}return _0x3af3a1(null,_0x119217);})[_0x76f5('0x25')](function(_0x2bd89f){logger[_0x76f5('0x22')](util[_0x76f5('0x20')](_0x76f5('0x23'),_0x2b3648[_0x76f5('0x21')],_0x2b3648['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3af3a1(_0x2bd89f);});}else{return _0x3af3a1(null,_0x119217);}},'beforeUpdate':function(_0x4eb664,_0x36fb91,_0x193d09){if(_0x4eb664[_0x76f5('0xf')](_0x76f5('0x26'))||_0x4eb664['changed'](_0x76f5('0xd'))||_0x4eb664[_0x76f5('0xf')](_0x76f5('0xe'))||_0x4eb664[_0x76f5('0xf')]('clientSecret')||_0x4eb664[_0x76f5('0xf')](_0x76f5('0x19'))||_0x4eb664[_0x76f5('0xf')](_0x76f5('0x10'))){var _0x29d2e5,_0x53be60;_0x29d2e5=_0x4eb664[_0x76f5('0xd')];var _0x328f3c=_0x29d2e5[_0x76f5('0x27')](-0x1);if(_0x328f3c==='/'||_0x328f3c==='\x5c'||_0x328f3c===':'){_0x29d2e5=_0x29d2e5[_0x76f5('0x11')](0x0,_0x29d2e5[_0x76f5('0x12')](_0x328f3c));}switch(_0x4eb664[_0x76f5('0x26')]){case'US':_0x53be60=_0x76f5('0x13');break;case'AU':_0x53be60=_0x76f5('0x28');break;case'IN':_0x53be60=_0x76f5('0x14');break;case'CN':_0x53be60='https://accounts.zoho.com.cn';break;default:_0x53be60=_0x76f5('0x29');break;}var _0x103b79={'method':_0x76f5('0x2a'),'uri':_0x53be60+_0x76f5('0x16'),'form':{'grant_type':_0x76f5('0x17'),'client_id':_0x4eb664[_0x76f5('0xe')],'client_secret':_0x4eb664[_0x76f5('0x18')],'redirect_uri':_0x4eb664['serverUrl'],'code':_0x4eb664['code']},'headers':{'Content-Type':_0x76f5('0x1a')}};return rp(_0x103b79)[_0x76f5('0x1b')](function(_0x2d117b){var _0x3200d4=JSON[_0x76f5('0x1c')](_0x2d117b);if(_0x3200d4[_0x76f5('0x1e')]){_0x4eb664[_0x76f5('0x1d')]=_0x3200d4['refresh_token'];logger['info'](util['format'](_0x76f5('0x2b'),_0x4eb664[_0x76f5('0x21')],_0x4eb664['id']));}else{logger[_0x76f5('0x22')](util[_0x76f5('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4eb664['name'],_0x4eb664['id']),util['inspect'](_0x3200d4,{'showHidden':![],'depth':null}));}return _0x193d09(null,_0x36fb91);})['catch'](function(_0x28e0eb){logger[_0x76f5('0x22')](util['format'](_0x76f5('0x23'),_0x4eb664['name'],_0x4eb664['id']),util[_0x76f5('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x193d09(_0x28e0eb);});}else{return _0x193d09(null,_0x36fb91);}}}});}; \ No newline at end of file +var _0x9539=['name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','format','POST','authorization_code','parse','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','ZohoAccount','changed','zone','serverUrl','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','clientId','application/x-www-form-urlencoded','then','refreshToken','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x5a6e7b,_0x18905f){var _0x4af6ff=function(_0x232bac){while(--_0x232bac){_0x5a6e7b['push'](_0x5a6e7b['shift']());}};_0x4af6ff(++_0x18905f);}(_0x9539,0x1a3));var _0x9953=function(_0x4a6468,_0x407398){_0x4a6468=_0x4a6468-0x0;var _0x40b5c3=_0x9539[_0x4a6468];return _0x40b5c3;};'use strict';var _=require(_0x9953('0x0'));var util=require(_0x9953('0x1'));var logger=require(_0x9953('0x2'))(_0x9953('0x3'));var moment=require(_0x9953('0x4'));var BPromise=require(_0x9953('0x5'));var rp=require(_0x9953('0x6'));var fs=require('fs');var path=require(_0x9953('0x7'));var rimraf=require(_0x9953('0x8'));var config=require(_0x9953('0x9'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x9953('0xa'));module['exports']=function(_0x1ce32c,_0x2ab3ea){return _0x1ce32c['define'](_0x9953('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xc2e0b9,_0x59437b,_0x553816){if(_0xc2e0b9[_0x9953('0xc')](_0x9953('0xd'))||_0xc2e0b9[_0x9953('0xc')](_0x9953('0xe'))||_0xc2e0b9[_0x9953('0xc')]('clientId')||_0xc2e0b9['changed'](_0x9953('0xf'))||_0xc2e0b9[_0x9953('0xc')](_0x9953('0x10'))||_0xc2e0b9[_0x9953('0xc')](_0x9953('0x11'))){var _0x2f88e1,_0x63be7b;_0x2f88e1=_0xc2e0b9[_0x9953('0xe')];var _0x3a2dca=_0x2f88e1['slice'](-0x1);if(_0x3a2dca==='/'||_0x3a2dca==='\x5c'||_0x3a2dca===':'){_0x2f88e1=_0x2f88e1[_0x9953('0x12')](0x0,_0x2f88e1[_0x9953('0x13')](_0x3a2dca));}switch(_0xc2e0b9[_0x9953('0xd')]){case'US':_0x63be7b=_0x9953('0x14');break;case'AU':_0x63be7b=_0x9953('0x15');break;case'IN':_0x63be7b=_0x9953('0x16');break;case'CN':_0x63be7b=_0x9953('0x17');break;default:_0x63be7b=_0x9953('0x18');break;}var _0x1aed00={'method':'POST','uri':_0x63be7b+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0xc2e0b9[_0x9953('0x19')],'client_secret':_0xc2e0b9[_0x9953('0xf')],'redirect_uri':_0xc2e0b9[_0x9953('0xe')],'code':_0xc2e0b9['code']},'headers':{'Content-Type':_0x9953('0x1a')}};return rp(_0x1aed00)[_0x9953('0x1b')](function(_0x6b51ef){var _0x503b9a=JSON['parse'](_0x6b51ef);if(_0x503b9a['refresh_token']){_0xc2e0b9[_0x9953('0x1c')]=_0x503b9a[_0x9953('0x1d')];logger[_0x9953('0x1e')](util['format'](_0x9953('0x1f'),_0xc2e0b9[_0x9953('0x20')],_0xc2e0b9['id']));}else{logger[_0x9953('0x21')](util['format'](_0x9953('0x22'),_0xc2e0b9[_0x9953('0x20')],_0xc2e0b9['id']),util[_0x9953('0x23')](_0x503b9a,{'showHidden':![],'depth':null}));}return _0x553816(null,_0x59437b);})[_0x9953('0x24')](function(_0xee6241){logger['error'](util[_0x9953('0x25')](_0x9953('0x22'),_0xc2e0b9[_0x9953('0x20')],_0xc2e0b9['id']),util[_0x9953('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x553816(_0xee6241);});}else{return _0x553816(null,_0x59437b);}},'beforeUpdate':function(_0x4ae5a6,_0x1da64d,_0x4a216a){if(_0x4ae5a6[_0x9953('0xc')]('zone')||_0x4ae5a6[_0x9953('0xc')]('serverUrl')||_0x4ae5a6[_0x9953('0xc')](_0x9953('0x19'))||_0x4ae5a6[_0x9953('0xc')](_0x9953('0xf'))||_0x4ae5a6[_0x9953('0xc')](_0x9953('0x10'))||_0x4ae5a6[_0x9953('0xc')](_0x9953('0x11'))){var _0x150a4e,_0x2170cf;_0x150a4e=_0x4ae5a6[_0x9953('0xe')];var _0x41d3e9=_0x150a4e['slice'](-0x1);if(_0x41d3e9==='/'||_0x41d3e9==='\x5c'||_0x41d3e9===':'){_0x150a4e=_0x150a4e[_0x9953('0x12')](0x0,_0x150a4e[_0x9953('0x13')](_0x41d3e9));}switch(_0x4ae5a6[_0x9953('0xd')]){case'US':_0x2170cf=_0x9953('0x14');break;case'AU':_0x2170cf='https://accounts.zoho.com.au';break;case'IN':_0x2170cf=_0x9953('0x16');break;case'CN':_0x2170cf='https://accounts.zoho.com.cn';break;default:_0x2170cf=_0x9953('0x18');break;}var _0x58ebde={'method':_0x9953('0x26'),'uri':_0x2170cf+'/oauth/v2/token','form':{'grant_type':_0x9953('0x27'),'client_id':_0x4ae5a6['clientId'],'client_secret':_0x4ae5a6['clientSecret'],'redirect_uri':_0x4ae5a6[_0x9953('0xe')],'code':_0x4ae5a6['code']},'headers':{'Content-Type':_0x9953('0x1a')}};return rp(_0x58ebde)[_0x9953('0x1b')](function(_0xe0304e){var _0x284be3=JSON[_0x9953('0x28')](_0xe0304e);if(_0x284be3['refresh_token']){_0x4ae5a6['refreshToken']=_0x284be3[_0x9953('0x1d')];logger['info'](util['format'](_0x9953('0x1f'),_0x4ae5a6[_0x9953('0x20')],_0x4ae5a6['id']));}else{logger['error'](util[_0x9953('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4ae5a6[_0x9953('0x20')],_0x4ae5a6['id']),util[_0x9953('0x23')](_0x284be3,{'showHidden':![],'depth':null}));}return _0x4a216a(null,_0x1da64d);})[_0x9953('0x24')](function(_0x1beefe){logger[_0x9953('0x21')](util[_0x9953('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4ae5a6[_0x9953('0x20')],_0x4ae5a6['id']),util[_0x9953('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x4a216a(_0x1beefe);});}else{return _0x4a216a(null,_0x1da64d);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 05f8794..8df2dee 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 _0xcefd=['ShowZohoAccount','find','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','ZohoAccount','options','raw','where','attributes','limit','map','model','include','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcefd,0x1bd));var _0xdcef=function(_0x417383,_0x1d8a41){_0x417383=_0x417383-0x0;var _0x3ed230=_0xcefd[_0x417383];return _0x3ed230;};'use strict';var _=require('lodash');var util=require(_0xdcef('0x0'));var moment=require(_0xdcef('0x1'));var BPromise=require(_0xdcef('0x2'));var rs=require(_0xdcef('0x3'));var fs=require('fs');var Redis=require(_0xdcef('0x4'));var db=require(_0xdcef('0x5'))['db'];var utils=require(_0xdcef('0x6'));var logger=require('../../config/logger')(_0xdcef('0x7'));var config=require(_0xdcef('0x8'));var jayson=require(_0xdcef('0x9'));var client=jayson[_0xdcef('0xa')][_0xdcef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ba458,_0x3b9fec,_0x25dfd5){return new BPromise(function(_0x3dc2b0,_0x11a5a6){return client['request'](_0x4ba458,_0x25dfd5)[_0xdcef('0xc')](function(_0xbb7067){logger[_0xdcef('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x3b9fec,_0xdcef('0xe'));logger['debug'](_0xdcef('0xf'),_0x3b9fec,_0xdcef('0xe'),JSON[_0xdcef('0x10')](_0xbb7067));if(_0xbb7067[_0xdcef('0x11')]){if(_0xbb7067[_0xdcef('0x11')]['code']===0x1f4){logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0xbb7067['error'][_0xdcef('0x13')]);return _0x11a5a6(_0xbb7067['error'][_0xdcef('0x13')]);}logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0xbb7067[_0xdcef('0x11')]['message']);return _0x3dc2b0(_0xbb7067[_0xdcef('0x11')][_0xdcef('0x13')]);}else{logger['info'](_0xdcef('0x12'),_0x3b9fec,_0xdcef('0xe'));_0x3dc2b0(_0xbb7067[_0xdcef('0x14')]['message']);}})['catch'](function(_0x386368){logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0x386368);_0x11a5a6(_0x386368);});});}exports['GetZohoAccount']=function(_0x1a79f8){var _0x3e2df7=this;return new Promise(function(_0x4d97ae,_0x54cc61){return db[_0xdcef('0x15')]['findAll']({'raw':_0x1a79f8[_0xdcef('0x16')]?_0x1a79f8[_0xdcef('0x16')][_0xdcef('0x17')]===undefined?!![]:![]:!![],'where':_0x1a79f8[_0xdcef('0x16')]?_0x1a79f8[_0xdcef('0x16')][_0xdcef('0x18')]||null:null,'attributes':_0x1a79f8[_0xdcef('0x16')]?_0x1a79f8[_0xdcef('0x16')][_0xdcef('0x19')]||null:null,'limit':_0x1a79f8['options']?_0x1a79f8[_0xdcef('0x16')][_0xdcef('0x1a')]||null:null,'include':_0x1a79f8[_0xdcef('0x16')]?_0x1a79f8[_0xdcef('0x16')]['include']?_[_0xdcef('0x1b')](_0x1a79f8[_0xdcef('0x16')]['include'],function(_0x32eeac){return{'model':db[_0x32eeac[_0xdcef('0x1c')]],'as':_0x32eeac['as'],'attributes':_0x32eeac[_0xdcef('0x19')],'include':_0x32eeac[_0xdcef('0x1d')]?_['map'](_0x32eeac[_0xdcef('0x1d')],function(_0x4dc915){return{'model':db[_0x4dc915['model']],'as':_0x4dc915['as'],'attributes':_0x4dc915[_0xdcef('0x19')],'include':_0x4dc915[_0xdcef('0x1d')]?_[_0xdcef('0x1b')](_0x4dc915[_0xdcef('0x1d')],function(_0x27b6bb){return{'model':db[_0x27b6bb[_0xdcef('0x1c')]],'as':_0x27b6bb['as'],'attributes':_0x27b6bb[_0xdcef('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdcef('0xc')](function(_0x38e03f){logger[_0xdcef('0xd')]('GetZohoAccount',_0x1a79f8);logger[_0xdcef('0x1e')]('GetZohoAccount',_0x1a79f8,JSON[_0xdcef('0x10')](_0x38e03f));_0x4d97ae(_0x38e03f);})['catch'](function(_0x3dfcc8){logger['error']('GetZohoAccount',_0x3dfcc8[_0xdcef('0x13')],_0x1a79f8);_0x54cc61(_0x3e2df7[_0xdcef('0x11')](0x1f4,_0x3dfcc8[_0xdcef('0x13')]));});});};exports[_0xdcef('0x1f')]=function(_0x23f68e){var _0x538866=this;return new Promise(function(_0x4952e1,_0x58849e){return db[_0xdcef('0x15')][_0xdcef('0x20')]({'raw':_0x23f68e[_0xdcef('0x16')]?_0x23f68e[_0xdcef('0x16')][_0xdcef('0x17')]===undefined?!![]:![]:!![],'where':_0x23f68e[_0xdcef('0x16')]?_0x23f68e['options'][_0xdcef('0x18')]||null:null,'attributes':_0x23f68e[_0xdcef('0x16')]?_0x23f68e[_0xdcef('0x16')]['attributes']||null:null,'include':_0x23f68e[_0xdcef('0x16')]?_0x23f68e[_0xdcef('0x16')]['include']?_[_0xdcef('0x1b')](_0x23f68e['options'][_0xdcef('0x1d')],function(_0x3c71a8){return{'model':db[_0x3c71a8[_0xdcef('0x1c')]],'as':_0x3c71a8['as'],'attributes':_0x3c71a8[_0xdcef('0x19')],'include':_0x3c71a8[_0xdcef('0x1d')]?_['map'](_0x3c71a8['include'],function(_0x51d1aa){return{'model':db[_0x51d1aa[_0xdcef('0x1c')]],'as':_0x51d1aa['as'],'attributes':_0x51d1aa[_0xdcef('0x19')],'include':_0x51d1aa[_0xdcef('0x1d')]?_[_0xdcef('0x1b')](_0x51d1aa['include'],function(_0x46a0a2){return{'model':db[_0x46a0a2[_0xdcef('0x1c')]],'as':_0x46a0a2['as'],'attributes':_0x46a0a2[_0xdcef('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdcef('0xc')](function(_0x47589f){logger[_0xdcef('0xd')](_0xdcef('0x1f'),_0x23f68e);logger[_0xdcef('0x1e')](_0xdcef('0x1f'),_0x23f68e,JSON['stringify'](_0x47589f));_0x4952e1(_0x47589f);})[_0xdcef('0x21')](function(_0x14516d){logger[_0xdcef('0x11')](_0xdcef('0x1f'),_0x14516d['message'],_0x23f68e);_0x58849e(_0x538866[_0xdcef('0x11')](0x1f4,_0x14516d['message']));});});}; \ No newline at end of file +var _0x0a93=['findAll','options','where','include','map','attributes','model','then','ShowZohoAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount'];(function(_0x55b0ce,_0x7f8d5b){var _0x2e17ff=function(_0x6d78d3){while(--_0x6d78d3){_0x55b0ce['push'](_0x55b0ce['shift']());}};_0x2e17ff(++_0x7f8d5b);}(_0x0a93,0x6a));var _0x30a9=function(_0x120e98,_0x996098){_0x120e98=_0x120e98-0x0;var _0x10599c=_0x0a93[_0x120e98];return _0x10599c;};'use strict';var _=require(_0x30a9('0x0'));var util=require(_0x30a9('0x1'));var moment=require(_0x30a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x30a9('0x3'));var fs=require('fs');var Redis=require(_0x30a9('0x4'));var db=require(_0x30a9('0x5'))['db'];var utils=require(_0x30a9('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x30a9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c46fb,_0x5ae289,_0x5ed9b4){return new BPromise(function(_0x312a90,_0x3a3f7e){return client[_0x30a9('0x8')](_0x1c46fb,_0x5ed9b4)['then'](function(_0x146fae){logger[_0x30a9('0x9')](_0x30a9('0xa'),_0x5ae289,_0x30a9('0xb'));logger[_0x30a9('0xc')](_0x30a9('0xd'),_0x5ae289,_0x30a9('0xb'),JSON[_0x30a9('0xe')](_0x146fae));if(_0x146fae[_0x30a9('0xf')]){if(_0x146fae['error'][_0x30a9('0x10')]===0x1f4){logger[_0x30a9('0xf')](_0x30a9('0xa'),_0x5ae289,_0x146fae[_0x30a9('0xf')]['message']);return _0x3a3f7e(_0x146fae[_0x30a9('0xf')]['message']);}logger[_0x30a9('0xf')](_0x30a9('0xa'),_0x5ae289,_0x146fae['error']['message']);return _0x312a90(_0x146fae[_0x30a9('0xf')][_0x30a9('0x11')]);}else{logger['info'](_0x30a9('0xa'),_0x5ae289,_0x30a9('0xb'));_0x312a90(_0x146fae[_0x30a9('0x12')][_0x30a9('0x11')]);}})[_0x30a9('0x13')](function(_0x1e7927){logger['error'](_0x30a9('0xa'),_0x5ae289,_0x1e7927);_0x3a3f7e(_0x1e7927);});});}exports[_0x30a9('0x14')]=function(_0x1a3c7a){var _0x145868=this;return new Promise(function(_0x103441,_0x2ca694){return db[_0x30a9('0x15')][_0x30a9('0x16')]({'raw':_0x1a3c7a[_0x30a9('0x17')]?_0x1a3c7a[_0x30a9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1a3c7a[_0x30a9('0x17')]?_0x1a3c7a[_0x30a9('0x17')][_0x30a9('0x18')]||null:null,'attributes':_0x1a3c7a[_0x30a9('0x17')]?_0x1a3c7a['options']['attributes']||null:null,'limit':_0x1a3c7a[_0x30a9('0x17')]?_0x1a3c7a[_0x30a9('0x17')]['limit']||null:null,'include':_0x1a3c7a[_0x30a9('0x17')]?_0x1a3c7a['options'][_0x30a9('0x19')]?_[_0x30a9('0x1a')](_0x1a3c7a['options'][_0x30a9('0x19')],function(_0x41792d){return{'model':db[_0x41792d['model']],'as':_0x41792d['as'],'attributes':_0x41792d[_0x30a9('0x1b')],'include':_0x41792d['include']?_[_0x30a9('0x1a')](_0x41792d[_0x30a9('0x19')],function(_0x20b2c7){return{'model':db[_0x20b2c7[_0x30a9('0x1c')]],'as':_0x20b2c7['as'],'attributes':_0x20b2c7[_0x30a9('0x1b')],'include':_0x20b2c7[_0x30a9('0x19')]?_[_0x30a9('0x1a')](_0x20b2c7['include'],function(_0x4146c9){return{'model':db[_0x4146c9[_0x30a9('0x1c')]],'as':_0x4146c9['as'],'attributes':_0x4146c9[_0x30a9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x30a9('0x1d')](function(_0x9d7e73){logger[_0x30a9('0x9')](_0x30a9('0x14'),_0x1a3c7a);logger[_0x30a9('0xc')](_0x30a9('0x14'),_0x1a3c7a,JSON[_0x30a9('0xe')](_0x9d7e73));_0x103441(_0x9d7e73);})['catch'](function(_0x41fb30){logger['error'](_0x30a9('0x14'),_0x41fb30[_0x30a9('0x11')],_0x1a3c7a);_0x2ca694(_0x145868[_0x30a9('0xf')](0x1f4,_0x41fb30[_0x30a9('0x11')]));});});};exports[_0x30a9('0x1e')]=function(_0xdf878e){var _0x2f9a5c=this;return new Promise(function(_0x44e4d9,_0x15f6ea){return db[_0x30a9('0x15')]['find']({'raw':_0xdf878e[_0x30a9('0x17')]?_0xdf878e['options'][_0x30a9('0x1f')]===undefined?!![]:![]:!![],'where':_0xdf878e[_0x30a9('0x17')]?_0xdf878e[_0x30a9('0x17')]['where']||null:null,'attributes':_0xdf878e[_0x30a9('0x17')]?_0xdf878e[_0x30a9('0x17')][_0x30a9('0x1b')]||null:null,'include':_0xdf878e[_0x30a9('0x17')]?_0xdf878e['options'][_0x30a9('0x19')]?_['map'](_0xdf878e['options'][_0x30a9('0x19')],function(_0x53ae93){return{'model':db[_0x53ae93[_0x30a9('0x1c')]],'as':_0x53ae93['as'],'attributes':_0x53ae93[_0x30a9('0x1b')],'include':_0x53ae93[_0x30a9('0x19')]?_['map'](_0x53ae93[_0x30a9('0x19')],function(_0x3b456a){return{'model':db[_0x3b456a[_0x30a9('0x1c')]],'as':_0x3b456a['as'],'attributes':_0x3b456a[_0x30a9('0x1b')],'include':_0x3b456a['include']?_[_0x30a9('0x1a')](_0x3b456a[_0x30a9('0x19')],function(_0x5cef2c){return{'model':db[_0x5cef2c[_0x30a9('0x1c')]],'as':_0x5cef2c['as'],'attributes':_0x5cef2c[_0x30a9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x30a9('0x1d')](function(_0x5b3f9f){logger[_0x30a9('0x9')]('ShowZohoAccount',_0xdf878e);logger[_0x30a9('0xc')](_0x30a9('0x1e'),_0xdf878e,JSON[_0x30a9('0xe')](_0x5b3f9f));_0x44e4d9(_0x5b3f9f);})[_0x30a9('0x13')](function(_0x1d77d1){logger['error'](_0x30a9('0x1e'),_0x1d77d1[_0x30a9('0x11')],_0xdf878e);_0x15f6ea(_0x2f9a5c['error'](0x1f4,_0x1d77d1[_0x30a9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 12043e8..41cb9dc 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 _0xe61f=['create','put','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post'];(function(_0x38a7c9,_0x5cb247){var _0x52b3b2=function(_0x87907e){while(--_0x87907e){_0x38a7c9['push'](_0x38a7c9['shift']());}};_0x52b3b2(++_0x5cb247);}(_0xe61f,0x1bc));var _0xfe61=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe61f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xfe61('0x0'));var path=require(_0xfe61('0x1'));var timeout=require(_0xfe61('0x2'));var express=require(_0xfe61('0x3'));var router=express['Router']();var fs_extra=require(_0xfe61('0x4'));var auth=require(_0xfe61('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe61('0x6'));var controller=require(_0xfe61('0x7'));router[_0xfe61('0x8')]('/',auth[_0xfe61('0x9')](),controller[_0xfe61('0xa')]);router[_0xfe61('0x8')](_0xfe61('0xb'),auth[_0xfe61('0x9')](),controller[_0xfe61('0xc')]);router[_0xfe61('0x8')](_0xfe61('0xd'),auth[_0xfe61('0x9')](),controller[_0xfe61('0xe')]);router['get']('/:id/subjects',auth[_0xfe61('0x9')](),controller['getSubjects']);router[_0xfe61('0x8')](_0xfe61('0xf'),auth[_0xfe61('0x9')](),controller[_0xfe61('0x10')]);router[_0xfe61('0x11')]('/',auth[_0xfe61('0x9')](),controller[_0xfe61('0x12')]);router[_0xfe61('0x13')](_0xfe61('0xb'),auth[_0xfe61('0x9')](),controller[_0xfe61('0x14')]);router['delete'](_0xfe61('0xb'),auth[_0xfe61('0x9')](),controller[_0xfe61('0x15')]);module['exports']=router; \ No newline at end of file +var _0x04e0=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','/:id','show','/:id/fields','getFields','get','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x04e0,0x184));var _0x004e=function(_0x537a42,_0x1e6a99){_0x537a42=_0x537a42-0x0;var _0x2ed48b=_0x04e0[_0x537a42];return _0x2ed48b;};'use strict';var multer=require(_0x004e('0x0'));var util=require(_0x004e('0x1'));var path=require(_0x004e('0x2'));var timeout=require(_0x004e('0x3'));var express=require(_0x004e('0x4'));var router=express['Router']();var fs_extra=require(_0x004e('0x5'));var auth=require(_0x004e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x004e('0x7'));var controller=require(_0x004e('0x8'));router['get']('/',auth[_0x004e('0x9')](),controller['index']);router['get'](_0x004e('0xa'),auth[_0x004e('0x9')](),controller[_0x004e('0xb')]);router['get'](_0x004e('0xc'),auth[_0x004e('0x9')](),controller[_0x004e('0xd')]);router[_0x004e('0xe')](_0x004e('0xf'),auth[_0x004e('0x9')](),controller[_0x004e('0x10')]);router[_0x004e('0xe')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x004e('0x11')]);router[_0x004e('0x12')]('/',auth[_0x004e('0x9')](),controller[_0x004e('0x13')]);router['put'](_0x004e('0xa'),auth[_0x004e('0x9')](),controller[_0x004e('0x14')]);router[_0x004e('0x15')](_0x004e('0xa'),auth['isAuthenticated'](),controller[_0x004e('0x16')]);module[_0x004e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 17a096d..65e1813 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 _0x1d99=['contact','nothing','contact_lead','exports','STRING','ENUM','lead'];(function(_0x5c07bf,_0x3abb20){var _0x5490e0=function(_0x14aaa5){while(--_0x14aaa5){_0x5c07bf['push'](_0x5c07bf['shift']());}};_0x5490e0(++_0x3abb20);}(_0x1d99,0x16f));var _0x91d9=function(_0x57010f,_0x2dccba){_0x57010f=_0x57010f-0x0;var _0x1538c5=_0x1d99[_0x57010f];return _0x1538c5;};'use strict';var Sequelize=require('sequelize');module[_0x91d9('0x0')]={'name':{'type':Sequelize[_0x91d9('0x1')]},'moduleCreate':{'type':Sequelize[_0x91d9('0x2')](_0x91d9('0x3'),_0x91d9('0x4'),_0x91d9('0x5')),'defaultValue':_0x91d9('0x3')},'moduleSearch':{'type':Sequelize[_0x91d9('0x2')](_0x91d9('0x6'),_0x91d9('0x4'),_0x91d9('0x3')),'defaultValue':_0x91d9('0x6')},'description':{'type':Sequelize[_0x91d9('0x1')]}}; \ No newline at end of file +var _0x04f5=['contact_lead','sequelize','exports','STRING','contact','nothing','lead','ENUM'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x04f5,0x1a9));var _0x504f=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x04f5[_0x4da356];return _0x321b07;};'use strict';var Sequelize=require(_0x504f('0x0'));module[_0x504f('0x1')]={'name':{'type':Sequelize[_0x504f('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x504f('0x3'),_0x504f('0x4')),'defaultValue':_0x504f('0x5')},'moduleSearch':{'type':Sequelize[_0x504f('0x6')](_0x504f('0x7'),_0x504f('0x3'),_0x504f('0x5')),'defaultValue':_0x504f('0x7')},'description':{'type':Sequelize[_0x504f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index d9be6b0..3ab5d01 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 _0xd4e6=['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','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ZohoConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','ZohoField','length','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x349743,_0x2b67cd){var _0x48eabd=function(_0xc29b05){while(--_0xc29b05){_0x349743['push'](_0x349743['shift']());}};_0x48eabd(++_0x2b67cd);}(_0xd4e6,0x199));var _0x6d4e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xd4e6[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x6d4e('0x0'));var rimraf=require(_0x6d4e('0x1'));var zipdir=require(_0x6d4e('0x2'));var jsonpatch=require(_0x6d4e('0x3'));var rp=require(_0x6d4e('0x4'));var moment=require(_0x6d4e('0x5'));var BPromise=require(_0x6d4e('0x6'));var Mustache=require(_0x6d4e('0x7'));var util=require(_0x6d4e('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6d4e('0x9'));var ejs=require(_0x6d4e('0xa'));var fs=require('fs');var fs_extra=require(_0x6d4e('0xb'));var _=require(_0x6d4e('0xc'));var squel=require(_0x6d4e('0xd'));var crypto=require(_0x6d4e('0xe'));var jsforce=require(_0x6d4e('0xf'));var deskjs=require(_0x6d4e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6d4e('0x11'));var Papa=require(_0x6d4e('0x12'));var Redis=require(_0x6d4e('0x13'));var authService=require(_0x6d4e('0x14'));var qs=require(_0x6d4e('0x15'));var as=require(_0x6d4e('0x16'));var hardwareService=require(_0x6d4e('0x17'));var logger=require(_0x6d4e('0x18'))(_0x6d4e('0x19'));var utils=require(_0x6d4e('0x1a'));var config=require(_0x6d4e('0x1b'));var licenseUtil=require(_0x6d4e('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51ce63,_0x4b9d3b){_0x4b9d3b=_0x4b9d3b||0xcc;return function(_0x313ab0){if(_0x313ab0){return _0x51ce63[_0x6d4e('0x1d')](_0x4b9d3b);}return _0x51ce63['status'](_0x4b9d3b)[_0x6d4e('0x1e')]();};}function respondWithResult(_0x233929,_0xf40809){_0xf40809=_0xf40809||0xc8;return function(_0xc51979){if(_0xc51979){return _0x233929[_0x6d4e('0x1f')](_0xf40809)[_0x6d4e('0x20')](_0xc51979);}};}function respondWithFilteredResult(_0x427ce2,_0x245a92){return function(_0x18ba3b){if(_0x18ba3b){var _0x35a663=typeof _0x245a92['offset']===_0x6d4e('0x21')&&typeof _0x245a92['limit']===_0x6d4e('0x21');var _0x3eda60=_0x18ba3b[_0x6d4e('0x22')];var _0x4570b0=_0x35a663?0x0:_0x245a92[_0x6d4e('0x23')];var _0x4e4745=_0x35a663?_0x18ba3b[_0x6d4e('0x22')]:_0x245a92[_0x6d4e('0x23')]+_0x245a92[_0x6d4e('0x24')];var _0x14626a;if(_0x4e4745>=_0x3eda60){_0x4e4745=_0x3eda60;_0x14626a=0xc8;}else{_0x14626a=0xce;}_0x427ce2[_0x6d4e('0x1f')](_0x14626a);return _0x427ce2[_0x6d4e('0x25')](_0x6d4e('0x26'),_0x4570b0+'-'+_0x4e4745+'/'+_0x3eda60)[_0x6d4e('0x20')](_0x18ba3b);}return null;};}function patchUpdates(_0x2e7f05){return function(_0x126035){try{jsonpatch[_0x6d4e('0x27')](_0x126035,_0x2e7f05,!![]);}catch(_0x6d4b02){return BPromise['reject'](_0x6d4b02);}return _0x126035[_0x6d4e('0x28')]();};}function saveUpdates(_0x35dca1,_0x2de652){return function(_0x24c76f){if(_0x24c76f){return _0x24c76f[_0x6d4e('0x29')](_0x35dca1)[_0x6d4e('0x2a')](function(_0x3d3caf){return _0x3d3caf;});}return null;};}function removeEntity(_0x81597b,_0x546633){return function(_0x4e6a94){if(_0x4e6a94){return _0x4e6a94[_0x6d4e('0x2b')]()[_0x6d4e('0x2a')](function(){_0x81597b['status'](0xcc)[_0x6d4e('0x1e')]();});}};}function handleEntityNotFound(_0x43e9a7,_0x159a27){return function(_0x1fc514){if(!_0x1fc514){_0x43e9a7[_0x6d4e('0x1d')](0x194);}return _0x1fc514;};}function handleError(_0x2b946b,_0x1d44a2){_0x1d44a2=_0x1d44a2||0x1f4;return function(_0x184551){logger['error'](_0x184551[_0x6d4e('0x2c')]);if(_0x184551[_0x6d4e('0x2d')]){delete _0x184551[_0x6d4e('0x2d')];}_0x2b946b['status'](_0x1d44a2)['send'](_0x184551);};}exports[_0x6d4e('0x2e')]=function(_0x31d7b7,_0x44885e){var _0x41750d={},_0xfe56c5={},_0x33a365={'count':0x0,'rows':[]};var _0x321bcd=_[_0x6d4e('0x2f')](db['ZohoConfiguration'][_0x6d4e('0x30')],function(_0x4cecbf){return{'name':_0x4cecbf[_0x6d4e('0x31')],'type':_0x4cecbf[_0x6d4e('0x32')][_0x6d4e('0x33')]};});_0xfe56c5[_0x6d4e('0x34')]=_[_0x6d4e('0x2f')](_0x321bcd,_0x6d4e('0x2d'));_0xfe56c5[_0x6d4e('0x35')]=_[_0x6d4e('0x36')](_0x31d7b7['query']);_0xfe56c5['filters']=_[_0x6d4e('0x37')](_0xfe56c5[_0x6d4e('0x34')],_0xfe56c5['query']);_0x41750d[_0x6d4e('0x38')]=_['intersection'](_0xfe56c5['model'],qs[_0x6d4e('0x39')](_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x39')]));_0x41750d[_0x6d4e('0x38')]=_0x41750d['attributes']['length']?_0x41750d['attributes']:_0xfe56c5[_0x6d4e('0x34')];if(!_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x3a')]('nolimit')){_0x41750d[_0x6d4e('0x24')]=qs[_0x6d4e('0x24')](_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x24')]);_0x41750d[_0x6d4e('0x23')]=qs[_0x6d4e('0x23')](_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x23')]);}_0x41750d[_0x6d4e('0x3b')]=qs['sort'](_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x3c')]);_0x41750d[_0x6d4e('0x3d')]=qs[_0x6d4e('0x3e')](_[_0x6d4e('0x3f')](_0x31d7b7[_0x6d4e('0x35')],_0xfe56c5[_0x6d4e('0x3e')]),_0x321bcd);if(_0x31d7b7[_0x6d4e('0x35')][_0x6d4e('0x40')]){_0x41750d[_0x6d4e('0x3d')]=_['merge'](_0x41750d[_0x6d4e('0x3d')],{'$or':_[_0x6d4e('0x2f')](_0x321bcd,function(_0x3a1551){if(_0x3a1551[_0x6d4e('0x32')]!==_0x6d4e('0x41')){var _0x34b25a={};_0x34b25a[_0x3a1551[_0x6d4e('0x2d')]]={'$like':'%'+_0x31d7b7[_0x6d4e('0x35')]['filter']+'%'};return _0x34b25a;}})});}_0x41750d=_[_0x6d4e('0x42')]({},_0x41750d,_0x31d7b7[_0x6d4e('0x43')]);var _0x26980d={'where':_0x41750d[_0x6d4e('0x3d')]};return db[_0x6d4e('0x44')][_0x6d4e('0x22')](_0x26980d)[_0x6d4e('0x2a')](function(_0x5ebd55){_0x33a365['count']=_0x5ebd55;if(_0x31d7b7['query'][_0x6d4e('0x45')]){_0x41750d['include']=[{'all':!![]}];}return db[_0x6d4e('0x44')][_0x6d4e('0x46')](_0x41750d);})[_0x6d4e('0x2a')](function(_0x2be5d5){_0x33a365[_0x6d4e('0x47')]=_0x2be5d5;return _0x33a365;})[_0x6d4e('0x2a')](respondWithFilteredResult(_0x44885e,_0x41750d))[_0x6d4e('0x48')](handleError(_0x44885e,null));};exports[_0x6d4e('0x49')]=function(_0x19b497,_0x44dc5e){var _0x3935a9={'raw':![],'where':{'id':_0x19b497[_0x6d4e('0x4a')]['id']}},_0x328f8d={};_0x328f8d[_0x6d4e('0x34')]=_['keys'](db['ZohoConfiguration'][_0x6d4e('0x30')]);_0x328f8d['query']=_[_0x6d4e('0x36')](_0x19b497[_0x6d4e('0x35')]);_0x328f8d[_0x6d4e('0x3e')]=_[_0x6d4e('0x37')](_0x328f8d[_0x6d4e('0x34')],_0x328f8d['query']);_0x3935a9[_0x6d4e('0x38')]=_[_0x6d4e('0x37')](_0x328f8d[_0x6d4e('0x34')],qs[_0x6d4e('0x39')](_0x19b497[_0x6d4e('0x35')][_0x6d4e('0x39')]));_0x3935a9[_0x6d4e('0x38')]=_0x3935a9['attributes']['length']?_0x3935a9[_0x6d4e('0x38')]:_0x328f8d[_0x6d4e('0x34')];if(_0x19b497['query'][_0x6d4e('0x45')]){_0x3935a9[_0x6d4e('0x4b')]=[{'all':!![]}];}_0x3935a9=_[_0x6d4e('0x42')]({},_0x3935a9,_0x19b497[_0x6d4e('0x43')]);return db[_0x6d4e('0x44')][_0x6d4e('0x4c')](_0x3935a9)[_0x6d4e('0x2a')](handleEntityNotFound(_0x44dc5e,null))['then'](respondWithResult(_0x44dc5e,null))[_0x6d4e('0x48')](handleError(_0x44dc5e,null));};exports[_0x6d4e('0x4d')]=function(_0x25f9e6,_0x214ec7){return db[_0x6d4e('0x44')]['create'](_0x25f9e6[_0x6d4e('0x4e')],{})[_0x6d4e('0x2a')](respondWithResult(_0x214ec7,0xc9))[_0x6d4e('0x48')](handleError(_0x214ec7,null));};exports[_0x6d4e('0x29')]=function(_0x3ac41e,_0x398b26){if(_0x3ac41e[_0x6d4e('0x4e')]['id']){delete _0x3ac41e[_0x6d4e('0x4e')]['id'];}return db[_0x6d4e('0x44')][_0x6d4e('0x4c')]({'where':{'id':_0x3ac41e[_0x6d4e('0x4a')]['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x398b26,null))[_0x6d4e('0x2a')](saveUpdates(_0x3ac41e[_0x6d4e('0x4e')],null))['then'](respondWithResult(_0x398b26,null))['catch'](handleError(_0x398b26,null));};exports[_0x6d4e('0x2b')]=function(_0x2d6922,_0x5d3c12){return db[_0x6d4e('0x44')][_0x6d4e('0x4c')]({'where':{'id':_0x2d6922[_0x6d4e('0x4a')]['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x5d3c12,null))['then'](removeEntity(_0x5d3c12,null))[_0x6d4e('0x48')](handleError(_0x5d3c12,null));};exports[_0x6d4e('0x4f')]=function(_0x387f16,_0x1bc673,_0x24baa8){var _0x49a8ed={};var _0x50e489={};var _0x40bd5a;var _0x73cbc8;return db[_0x6d4e('0x44')]['findOne']({'where':{'id':_0x387f16[_0x6d4e('0x4a')]['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x1bc673,null))[_0x6d4e('0x2a')](function(_0x21b776){if(_0x21b776){_0x40bd5a=_0x21b776;_0x50e489[_0x6d4e('0x34')]=_['keys'](db[_0x6d4e('0x50')][_0x6d4e('0x30')]);_0x50e489[_0x6d4e('0x35')]=_[_0x6d4e('0x36')](_0x387f16[_0x6d4e('0x35')]);_0x50e489['filters']=_[_0x6d4e('0x37')](_0x50e489[_0x6d4e('0x34')],_0x50e489[_0x6d4e('0x35')]);_0x49a8ed[_0x6d4e('0x38')]=_['intersection'](_0x50e489[_0x6d4e('0x34')],qs[_0x6d4e('0x39')](_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x39')]));_0x49a8ed[_0x6d4e('0x38')]=_0x49a8ed[_0x6d4e('0x38')][_0x6d4e('0x51')]?_0x49a8ed[_0x6d4e('0x38')]:_0x50e489['model'];_0x49a8ed[_0x6d4e('0x3b')]=qs[_0x6d4e('0x3c')](_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x3c')]);_0x49a8ed[_0x6d4e('0x3d')]=qs[_0x6d4e('0x3e')](_[_0x6d4e('0x3f')](_0x387f16[_0x6d4e('0x35')],_0x50e489[_0x6d4e('0x3e')]));if(_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x40')]){_0x49a8ed[_0x6d4e('0x3d')]=_['merge'](_0x49a8ed['where'],{'$or':_['map'](_0x49a8ed[_0x6d4e('0x38')],function(_0x5aea4f){var _0x4ae29e={};_0x4ae29e[_0x5aea4f]={'$like':'%'+_0x387f16[_0x6d4e('0x35')]['filter']+'%'};return _0x4ae29e;})});}_0x49a8ed=_['merge']({},_0x49a8ed,_0x387f16[_0x6d4e('0x43')]);return _0x40bd5a[_0x6d4e('0x4f')](_0x49a8ed);}})[_0x6d4e('0x2a')](function(_0x47f042){if(_0x47f042){_0x73cbc8=_0x47f042[_0x6d4e('0x51')];if(!_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x3a')](_0x6d4e('0x52'))){_0x49a8ed[_0x6d4e('0x24')]=qs[_0x6d4e('0x24')](_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x24')]);_0x49a8ed['offset']=qs[_0x6d4e('0x23')](_0x387f16[_0x6d4e('0x35')][_0x6d4e('0x23')]);}return _0x40bd5a[_0x6d4e('0x4f')](_0x49a8ed);}})['then'](function(_0x2bb2e8){if(_0x2bb2e8){return _0x2bb2e8?{'count':_0x73cbc8,'rows':_0x2bb2e8}:null;}})['then'](respondWithResult(_0x1bc673,null))[_0x6d4e('0x48')](handleError(_0x1bc673,null));};exports[_0x6d4e('0x53')]=function(_0x141455,_0x1dcbcc,_0x28c9f3){var _0x499595={};var _0x5bb504={};var _0x5f251e;var _0x17030a;return db[_0x6d4e('0x44')]['findOne']({'where':{'id':_0x141455[_0x6d4e('0x4a')]['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x1dcbcc,null))[_0x6d4e('0x2a')](function(_0xe8b72e){if(_0xe8b72e){_0x5f251e=_0xe8b72e;_0x5bb504[_0x6d4e('0x34')]=_[_0x6d4e('0x36')](db[_0x6d4e('0x50')]['rawAttributes']);_0x5bb504['query']=_[_0x6d4e('0x36')](_0x141455[_0x6d4e('0x35')]);_0x5bb504[_0x6d4e('0x3e')]=_[_0x6d4e('0x37')](_0x5bb504['model'],_0x5bb504['query']);_0x499595[_0x6d4e('0x38')]=_['intersection'](_0x5bb504[_0x6d4e('0x34')],qs[_0x6d4e('0x39')](_0x141455[_0x6d4e('0x35')]['fields']));_0x499595[_0x6d4e('0x38')]=_0x499595[_0x6d4e('0x38')][_0x6d4e('0x51')]?_0x499595['attributes']:_0x5bb504[_0x6d4e('0x34')];_0x499595['order']=qs[_0x6d4e('0x3c')](_0x141455[_0x6d4e('0x35')][_0x6d4e('0x3c')]);_0x499595[_0x6d4e('0x3d')]=qs['filters'](_[_0x6d4e('0x3f')](_0x141455[_0x6d4e('0x35')],_0x5bb504[_0x6d4e('0x3e')]));if(_0x141455[_0x6d4e('0x35')][_0x6d4e('0x40')]){_0x499595[_0x6d4e('0x3d')]=_[_0x6d4e('0x42')](_0x499595[_0x6d4e('0x3d')],{'$or':_[_0x6d4e('0x2f')](_0x499595[_0x6d4e('0x38')],function(_0x22beed){var _0x40b9d0={};_0x40b9d0[_0x22beed]={'$like':'%'+_0x141455[_0x6d4e('0x35')]['filter']+'%'};return _0x40b9d0;})});}_0x499595=_['merge']({},_0x499595,_0x141455[_0x6d4e('0x43')]);return _0x5f251e[_0x6d4e('0x53')](_0x499595);}})[_0x6d4e('0x2a')](function(_0x1f8ccd){if(_0x1f8ccd){_0x17030a=_0x1f8ccd[_0x6d4e('0x51')];if(!_0x141455[_0x6d4e('0x35')][_0x6d4e('0x3a')](_0x6d4e('0x52'))){_0x499595[_0x6d4e('0x24')]=qs[_0x6d4e('0x24')](_0x141455[_0x6d4e('0x35')][_0x6d4e('0x24')]);_0x499595[_0x6d4e('0x23')]=qs[_0x6d4e('0x23')](_0x141455[_0x6d4e('0x35')]['offset']);}return _0x5f251e[_0x6d4e('0x53')](_0x499595);}})['then'](function(_0x1b27a7){if(_0x1b27a7){return _0x1b27a7?{'count':_0x17030a,'rows':_0x1b27a7}:null;}})['then'](respondWithResult(_0x1dcbcc,null))[_0x6d4e('0x48')](handleError(_0x1dcbcc,null));};exports[_0x6d4e('0x54')]=function(_0x27bc4d,_0x1b8901,_0x9c3dd6){var _0x1ea6f5={};var _0x2119b5={};var _0x2163fe;var _0x53da42;return db[_0x6d4e('0x44')]['findOne']({'where':{'id':_0x27bc4d['params']['id']}})[_0x6d4e('0x2a')](handleEntityNotFound(_0x1b8901,null))['then'](function(_0x2ad264){if(_0x2ad264){_0x2163fe=_0x2ad264;_0x2119b5[_0x6d4e('0x34')]=_[_0x6d4e('0x36')](db['ZohoField'][_0x6d4e('0x30')]);_0x2119b5[_0x6d4e('0x35')]=_[_0x6d4e('0x36')](_0x27bc4d[_0x6d4e('0x35')]);_0x2119b5[_0x6d4e('0x3e')]=_['intersection'](_0x2119b5['model'],_0x2119b5[_0x6d4e('0x35')]);_0x1ea6f5[_0x6d4e('0x38')]=_[_0x6d4e('0x37')](_0x2119b5[_0x6d4e('0x34')],qs[_0x6d4e('0x39')](_0x27bc4d['query']['fields']));_0x1ea6f5['attributes']=_0x1ea6f5['attributes'][_0x6d4e('0x51')]?_0x1ea6f5[_0x6d4e('0x38')]:_0x2119b5['model'];_0x1ea6f5[_0x6d4e('0x3b')]=qs[_0x6d4e('0x3c')](_0x27bc4d[_0x6d4e('0x35')]['sort']);_0x1ea6f5[_0x6d4e('0x3d')]=qs[_0x6d4e('0x3e')](_[_0x6d4e('0x3f')](_0x27bc4d[_0x6d4e('0x35')],_0x2119b5[_0x6d4e('0x3e')]));if(_0x27bc4d[_0x6d4e('0x35')]['filter']){_0x1ea6f5[_0x6d4e('0x3d')]=_[_0x6d4e('0x42')](_0x1ea6f5[_0x6d4e('0x3d')],{'$or':_[_0x6d4e('0x2f')](_0x1ea6f5[_0x6d4e('0x38')],function(_0x1aee7d){var _0x34c6fe={};_0x34c6fe[_0x1aee7d]={'$like':'%'+_0x27bc4d[_0x6d4e('0x35')][_0x6d4e('0x40')]+'%'};return _0x34c6fe;})});}_0x1ea6f5=_[_0x6d4e('0x42')]({},_0x1ea6f5,_0x27bc4d[_0x6d4e('0x43')]);return _0x2163fe[_0x6d4e('0x54')](_0x1ea6f5);}})[_0x6d4e('0x2a')](function(_0x4de3da){if(_0x4de3da){_0x53da42=_0x4de3da['length'];if(!_0x27bc4d[_0x6d4e('0x35')][_0x6d4e('0x3a')](_0x6d4e('0x52'))){_0x1ea6f5[_0x6d4e('0x24')]=qs['limit'](_0x27bc4d[_0x6d4e('0x35')][_0x6d4e('0x24')]);_0x1ea6f5[_0x6d4e('0x23')]=qs['offset'](_0x27bc4d['query'][_0x6d4e('0x23')]);}return _0x2163fe[_0x6d4e('0x54')](_0x1ea6f5);}})[_0x6d4e('0x2a')](function(_0x4f98db){if(_0x4f98db){return _0x4f98db?{'count':_0x53da42,'rows':_0x4f98db}:null;}})['then'](respondWithResult(_0x1b8901,null))['catch'](handleError(_0x1b8901,null));}; \ No newline at end of file +var _0xf592=['api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','ZohoConfiguration','rawAttributes','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0xf592,0x11d));var _0x2f59=function(_0x227377,_0x3204cd){_0x227377=_0x227377-0x0;var _0x5dc3c3=_0xf592[_0x227377];return _0x5dc3c3;};'use strict';var emlformat=require(_0x2f59('0x0'));var rimraf=require(_0x2f59('0x1'));var zipdir=require(_0x2f59('0x2'));var jsonpatch=require(_0x2f59('0x3'));var rp=require('request-promise');var moment=require(_0x2f59('0x4'));var BPromise=require(_0x2f59('0x5'));var Mustache=require(_0x2f59('0x6'));var util=require(_0x2f59('0x7'));var path=require(_0x2f59('0x8'));var sox=require(_0x2f59('0x9'));var csv=require(_0x2f59('0xa'));var ejs=require(_0x2f59('0xb'));var fs=require('fs');var fs_extra=require(_0x2f59('0xc'));var _=require(_0x2f59('0xd'));var squel=require(_0x2f59('0xe'));var crypto=require(_0x2f59('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2f59('0x10'));var toCsv=require(_0x2f59('0xa'));var querystring=require(_0x2f59('0x11'));var Papa=require(_0x2f59('0x12'));var Redis=require('ioredis');var authService=require(_0x2f59('0x13'));var qs=require(_0x2f59('0x14'));var as=require(_0x2f59('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f59('0x16'))(_0x2f59('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2f59('0x18'))['db'];function respondWithStatusCode(_0x10f270,_0x2f112e){_0x2f112e=_0x2f112e||0xcc;return function(_0x4f2072){if(_0x4f2072){return _0x10f270[_0x2f59('0x19')](_0x2f112e);}return _0x10f270[_0x2f59('0x1a')](_0x2f112e)[_0x2f59('0x1b')]();};}function respondWithResult(_0x2b150e,_0x567643){_0x567643=_0x567643||0xc8;return function(_0x11fd33){if(_0x11fd33){return _0x2b150e[_0x2f59('0x1a')](_0x567643)[_0x2f59('0x1c')](_0x11fd33);}};}function respondWithFilteredResult(_0x2b7cd2,_0x42907c){return function(_0x3362d6){if(_0x3362d6){var _0xe2a636=typeof _0x42907c['offset']===_0x2f59('0x1d')&&typeof _0x42907c[_0x2f59('0x1e')]===_0x2f59('0x1d');var _0x1f1a9f=_0x3362d6[_0x2f59('0x1f')];var _0x4f1a59=_0xe2a636?0x0:_0x42907c[_0x2f59('0x20')];var _0x2c1941=_0xe2a636?_0x3362d6[_0x2f59('0x1f')]:_0x42907c['offset']+_0x42907c[_0x2f59('0x1e')];var _0x3257b1;if(_0x2c1941>=_0x1f1a9f){_0x2c1941=_0x1f1a9f;_0x3257b1=0xc8;}else{_0x3257b1=0xce;}_0x2b7cd2[_0x2f59('0x1a')](_0x3257b1);return _0x2b7cd2[_0x2f59('0x21')](_0x2f59('0x22'),_0x4f1a59+'-'+_0x2c1941+'/'+_0x1f1a9f)[_0x2f59('0x1c')](_0x3362d6);}return null;};}function patchUpdates(_0x447bdf){return function(_0x5d358f){try{jsonpatch[_0x2f59('0x23')](_0x5d358f,_0x447bdf,!![]);}catch(_0xae8e9e){return BPromise['reject'](_0xae8e9e);}return _0x5d358f[_0x2f59('0x24')]();};}function saveUpdates(_0x1e36c0,_0x31442b){return function(_0x1e6f40){if(_0x1e6f40){return _0x1e6f40[_0x2f59('0x25')](_0x1e36c0)[_0x2f59('0x26')](function(_0x4d7376){return _0x4d7376;});}return null;};}function removeEntity(_0x5e5805,_0x345ed2){return function(_0x43dd61){if(_0x43dd61){return _0x43dd61[_0x2f59('0x27')]()[_0x2f59('0x26')](function(){_0x5e5805['status'](0xcc)[_0x2f59('0x1b')]();});}};}function handleEntityNotFound(_0x424a2b,_0x2f8c73){return function(_0x5c7463){if(!_0x5c7463){_0x424a2b[_0x2f59('0x19')](0x194);}return _0x5c7463;};}function handleError(_0x4d1c08,_0x25a9d3){_0x25a9d3=_0x25a9d3||0x1f4;return function(_0x3c5212){logger[_0x2f59('0x28')](_0x3c5212['stack']);if(_0x3c5212[_0x2f59('0x29')]){delete _0x3c5212[_0x2f59('0x29')];}_0x4d1c08['status'](_0x25a9d3)[_0x2f59('0x2a')](_0x3c5212);};}exports['index']=function(_0x4784e5,_0x452690){var _0x44974e={},_0x3867d0={},_0x5a7425={'count':0x0,'rows':[]};var _0x2434a8=_[_0x2f59('0x2b')](db[_0x2f59('0x2c')][_0x2f59('0x2d')],function(_0x4554e8){return{'name':_0x4554e8['fieldName'],'type':_0x4554e8[_0x2f59('0x2e')]['key']};});_0x3867d0['model']=_[_0x2f59('0x2b')](_0x2434a8,_0x2f59('0x29'));_0x3867d0['query']=_['keys'](_0x4784e5[_0x2f59('0x2f')]);_0x3867d0[_0x2f59('0x30')]=_[_0x2f59('0x31')](_0x3867d0[_0x2f59('0x32')],_0x3867d0[_0x2f59('0x2f')]);_0x44974e['attributes']=_[_0x2f59('0x31')](_0x3867d0[_0x2f59('0x32')],qs[_0x2f59('0x33')](_0x4784e5[_0x2f59('0x2f')][_0x2f59('0x33')]));_0x44974e[_0x2f59('0x34')]=_0x44974e[_0x2f59('0x34')][_0x2f59('0x35')]?_0x44974e[_0x2f59('0x34')]:_0x3867d0[_0x2f59('0x32')];if(!_0x4784e5[_0x2f59('0x2f')][_0x2f59('0x36')](_0x2f59('0x37'))){_0x44974e[_0x2f59('0x1e')]=qs[_0x2f59('0x1e')](_0x4784e5['query'][_0x2f59('0x1e')]);_0x44974e[_0x2f59('0x20')]=qs['offset'](_0x4784e5[_0x2f59('0x2f')][_0x2f59('0x20')]);}_0x44974e[_0x2f59('0x38')]=qs[_0x2f59('0x39')](_0x4784e5[_0x2f59('0x2f')][_0x2f59('0x39')]);_0x44974e[_0x2f59('0x3a')]=qs[_0x2f59('0x30')](_[_0x2f59('0x3b')](_0x4784e5[_0x2f59('0x2f')],_0x3867d0['filters']),_0x2434a8);if(_0x4784e5[_0x2f59('0x2f')][_0x2f59('0x3c')]){_0x44974e[_0x2f59('0x3a')]=_[_0x2f59('0x3d')](_0x44974e[_0x2f59('0x3a')],{'$or':_[_0x2f59('0x2b')](_0x2434a8,function(_0x34d8cf){if(_0x34d8cf[_0x2f59('0x2e')]!==_0x2f59('0x3e')){var _0x158801={};_0x158801[_0x34d8cf[_0x2f59('0x29')]]={'$like':'%'+_0x4784e5['query'][_0x2f59('0x3c')]+'%'};return _0x158801;}})});}_0x44974e=_[_0x2f59('0x3d')]({},_0x44974e,_0x4784e5[_0x2f59('0x3f')]);var _0x2c4087={'where':_0x44974e[_0x2f59('0x3a')]};return db[_0x2f59('0x2c')][_0x2f59('0x1f')](_0x2c4087)[_0x2f59('0x26')](function(_0x89bc78){_0x5a7425[_0x2f59('0x1f')]=_0x89bc78;if(_0x4784e5[_0x2f59('0x2f')][_0x2f59('0x40')]){_0x44974e[_0x2f59('0x41')]=[{'all':!![]}];}return db[_0x2f59('0x2c')][_0x2f59('0x42')](_0x44974e);})[_0x2f59('0x26')](function(_0x501714){_0x5a7425['rows']=_0x501714;return _0x5a7425;})[_0x2f59('0x26')](respondWithFilteredResult(_0x452690,_0x44974e))[_0x2f59('0x43')](handleError(_0x452690,null));};exports['show']=function(_0x2e5943,_0x13094f){var _0x520251={'raw':![],'where':{'id':_0x2e5943[_0x2f59('0x44')]['id']}},_0x4b6f2c={};_0x4b6f2c['model']=_[_0x2f59('0x45')](db['ZohoConfiguration'][_0x2f59('0x2d')]);_0x4b6f2c[_0x2f59('0x2f')]=_['keys'](_0x2e5943[_0x2f59('0x2f')]);_0x4b6f2c[_0x2f59('0x30')]=_[_0x2f59('0x31')](_0x4b6f2c[_0x2f59('0x32')],_0x4b6f2c['query']);_0x520251['attributes']=_['intersection'](_0x4b6f2c['model'],qs['fields'](_0x2e5943[_0x2f59('0x2f')][_0x2f59('0x33')]));_0x520251['attributes']=_0x520251[_0x2f59('0x34')]['length']?_0x520251[_0x2f59('0x34')]:_0x4b6f2c[_0x2f59('0x32')];if(_0x2e5943[_0x2f59('0x2f')][_0x2f59('0x40')]){_0x520251[_0x2f59('0x41')]=[{'all':!![]}];}_0x520251=_[_0x2f59('0x3d')]({},_0x520251,_0x2e5943['options']);return db[_0x2f59('0x2c')][_0x2f59('0x46')](_0x520251)[_0x2f59('0x26')](handleEntityNotFound(_0x13094f,null))[_0x2f59('0x26')](respondWithResult(_0x13094f,null))[_0x2f59('0x43')](handleError(_0x13094f,null));};exports['create']=function(_0x1f7904,_0x2e2963){return db[_0x2f59('0x2c')]['create'](_0x1f7904[_0x2f59('0x47')],{})[_0x2f59('0x26')](respondWithResult(_0x2e2963,0xc9))['catch'](handleError(_0x2e2963,null));};exports[_0x2f59('0x25')]=function(_0x360a8c,_0x3ad176){if(_0x360a8c[_0x2f59('0x47')]['id']){delete _0x360a8c[_0x2f59('0x47')]['id'];}return db[_0x2f59('0x2c')][_0x2f59('0x46')]({'where':{'id':_0x360a8c[_0x2f59('0x44')]['id']}})[_0x2f59('0x26')](handleEntityNotFound(_0x3ad176,null))['then'](saveUpdates(_0x360a8c['body'],null))[_0x2f59('0x26')](respondWithResult(_0x3ad176,null))[_0x2f59('0x43')](handleError(_0x3ad176,null));};exports[_0x2f59('0x27')]=function(_0x317d84,_0x27d8fd){return db[_0x2f59('0x2c')][_0x2f59('0x46')]({'where':{'id':_0x317d84[_0x2f59('0x44')]['id']}})[_0x2f59('0x26')](handleEntityNotFound(_0x27d8fd,null))[_0x2f59('0x26')](removeEntity(_0x27d8fd,null))[_0x2f59('0x43')](handleError(_0x27d8fd,null));};exports[_0x2f59('0x48')]=function(_0x2a8158,_0x2c7ae1,_0x27a340){var _0x4da2d1={};var _0x28ee3b={};var _0x12a86f;var _0x52bf7e;return db[_0x2f59('0x2c')][_0x2f59('0x49')]({'where':{'id':_0x2a8158[_0x2f59('0x44')]['id']}})[_0x2f59('0x26')](handleEntityNotFound(_0x2c7ae1,null))['then'](function(_0x4d3700){if(_0x4d3700){_0x12a86f=_0x4d3700;_0x28ee3b[_0x2f59('0x32')]=_[_0x2f59('0x45')](db[_0x2f59('0x4a')][_0x2f59('0x2d')]);_0x28ee3b[_0x2f59('0x2f')]=_['keys'](_0x2a8158[_0x2f59('0x2f')]);_0x28ee3b[_0x2f59('0x30')]=_[_0x2f59('0x31')](_0x28ee3b[_0x2f59('0x32')],_0x28ee3b[_0x2f59('0x2f')]);_0x4da2d1[_0x2f59('0x34')]=_[_0x2f59('0x31')](_0x28ee3b[_0x2f59('0x32')],qs[_0x2f59('0x33')](_0x2a8158['query']['fields']));_0x4da2d1[_0x2f59('0x34')]=_0x4da2d1['attributes'][_0x2f59('0x35')]?_0x4da2d1[_0x2f59('0x34')]:_0x28ee3b[_0x2f59('0x32')];_0x4da2d1[_0x2f59('0x38')]=qs['sort'](_0x2a8158[_0x2f59('0x2f')]['sort']);_0x4da2d1['where']=qs[_0x2f59('0x30')](_[_0x2f59('0x3b')](_0x2a8158[_0x2f59('0x2f')],_0x28ee3b[_0x2f59('0x30')]));if(_0x2a8158[_0x2f59('0x2f')][_0x2f59('0x3c')]){_0x4da2d1['where']=_[_0x2f59('0x3d')](_0x4da2d1[_0x2f59('0x3a')],{'$or':_[_0x2f59('0x2b')](_0x4da2d1[_0x2f59('0x34')],function(_0x36cf82){var _0x3d4d5c={};_0x3d4d5c[_0x36cf82]={'$like':'%'+_0x2a8158[_0x2f59('0x2f')]['filter']+'%'};return _0x3d4d5c;})});}_0x4da2d1=_[_0x2f59('0x3d')]({},_0x4da2d1,_0x2a8158[_0x2f59('0x3f')]);return _0x12a86f['getFields'](_0x4da2d1);}})[_0x2f59('0x26')](function(_0x29d36c){if(_0x29d36c){_0x52bf7e=_0x29d36c[_0x2f59('0x35')];if(!_0x2a8158[_0x2f59('0x2f')][_0x2f59('0x36')]('nolimit')){_0x4da2d1['limit']=qs[_0x2f59('0x1e')](_0x2a8158[_0x2f59('0x2f')][_0x2f59('0x1e')]);_0x4da2d1[_0x2f59('0x20')]=qs[_0x2f59('0x20')](_0x2a8158[_0x2f59('0x2f')]['offset']);}return _0x12a86f[_0x2f59('0x48')](_0x4da2d1);}})[_0x2f59('0x26')](function(_0x50e6db){if(_0x50e6db){return _0x50e6db?{'count':_0x52bf7e,'rows':_0x50e6db}:null;}})['then'](respondWithResult(_0x2c7ae1,null))[_0x2f59('0x43')](handleError(_0x2c7ae1,null));};exports[_0x2f59('0x4b')]=function(_0x40bc85,_0x3ec2a6,_0x204989){var _0x111103={};var _0x4f9f58={};var _0x250689;var _0x28ff86;return db['ZohoConfiguration'][_0x2f59('0x49')]({'where':{'id':_0x40bc85['params']['id']}})[_0x2f59('0x26')](handleEntityNotFound(_0x3ec2a6,null))['then'](function(_0xdcfafd){if(_0xdcfafd){_0x250689=_0xdcfafd;_0x4f9f58[_0x2f59('0x32')]=_[_0x2f59('0x45')](db[_0x2f59('0x4a')][_0x2f59('0x2d')]);_0x4f9f58[_0x2f59('0x2f')]=_['keys'](_0x40bc85['query']);_0x4f9f58['filters']=_[_0x2f59('0x31')](_0x4f9f58[_0x2f59('0x32')],_0x4f9f58[_0x2f59('0x2f')]);_0x111103[_0x2f59('0x34')]=_[_0x2f59('0x31')](_0x4f9f58[_0x2f59('0x32')],qs[_0x2f59('0x33')](_0x40bc85['query'][_0x2f59('0x33')]));_0x111103[_0x2f59('0x34')]=_0x111103['attributes']['length']?_0x111103[_0x2f59('0x34')]:_0x4f9f58[_0x2f59('0x32')];_0x111103[_0x2f59('0x38')]=qs[_0x2f59('0x39')](_0x40bc85[_0x2f59('0x2f')]['sort']);_0x111103[_0x2f59('0x3a')]=qs['filters'](_[_0x2f59('0x3b')](_0x40bc85[_0x2f59('0x2f')],_0x4f9f58['filters']));if(_0x40bc85[_0x2f59('0x2f')][_0x2f59('0x3c')]){_0x111103[_0x2f59('0x3a')]=_[_0x2f59('0x3d')](_0x111103[_0x2f59('0x3a')],{'$or':_[_0x2f59('0x2b')](_0x111103[_0x2f59('0x34')],function(_0x15d2cc){var _0x4653cc={};_0x4653cc[_0x15d2cc]={'$like':'%'+_0x40bc85[_0x2f59('0x2f')][_0x2f59('0x3c')]+'%'};return _0x4653cc;})});}_0x111103=_[_0x2f59('0x3d')]({},_0x111103,_0x40bc85[_0x2f59('0x3f')]);return _0x250689[_0x2f59('0x4b')](_0x111103);}})[_0x2f59('0x26')](function(_0xd8bd9d){if(_0xd8bd9d){_0x28ff86=_0xd8bd9d['length'];if(!_0x40bc85[_0x2f59('0x2f')][_0x2f59('0x36')](_0x2f59('0x37'))){_0x111103[_0x2f59('0x1e')]=qs[_0x2f59('0x1e')](_0x40bc85[_0x2f59('0x2f')]['limit']);_0x111103['offset']=qs[_0x2f59('0x20')](_0x40bc85[_0x2f59('0x2f')][_0x2f59('0x20')]);}return _0x250689[_0x2f59('0x4b')](_0x111103);}})[_0x2f59('0x26')](function(_0x45476e){if(_0x45476e){return _0x45476e?{'count':_0x28ff86,'rows':_0x45476e}:null;}})['then'](respondWithResult(_0x3ec2a6,null))[_0x2f59('0x43')](handleError(_0x3ec2a6,null));};exports['getDescriptions']=function(_0x36b862,_0x3f66cd,_0x1d3e62){var _0x2e76c9={};var _0x12d4cd={};var _0xfe6491;var _0x296ecf;return db[_0x2f59('0x2c')]['findOne']({'where':{'id':_0x36b862[_0x2f59('0x44')]['id']}})[_0x2f59('0x26')](handleEntityNotFound(_0x3f66cd,null))[_0x2f59('0x26')](function(_0x249bd0){if(_0x249bd0){_0xfe6491=_0x249bd0;_0x12d4cd[_0x2f59('0x32')]=_[_0x2f59('0x45')](db[_0x2f59('0x4a')]['rawAttributes']);_0x12d4cd[_0x2f59('0x2f')]=_[_0x2f59('0x45')](_0x36b862['query']);_0x12d4cd[_0x2f59('0x30')]=_[_0x2f59('0x31')](_0x12d4cd[_0x2f59('0x32')],_0x12d4cd[_0x2f59('0x2f')]);_0x2e76c9[_0x2f59('0x34')]=_[_0x2f59('0x31')](_0x12d4cd['model'],qs[_0x2f59('0x33')](_0x36b862[_0x2f59('0x2f')][_0x2f59('0x33')]));_0x2e76c9[_0x2f59('0x34')]=_0x2e76c9['attributes'][_0x2f59('0x35')]?_0x2e76c9[_0x2f59('0x34')]:_0x12d4cd['model'];_0x2e76c9[_0x2f59('0x38')]=qs[_0x2f59('0x39')](_0x36b862[_0x2f59('0x2f')][_0x2f59('0x39')]);_0x2e76c9[_0x2f59('0x3a')]=qs[_0x2f59('0x30')](_[_0x2f59('0x3b')](_0x36b862['query'],_0x12d4cd[_0x2f59('0x30')]));if(_0x36b862[_0x2f59('0x2f')]['filter']){_0x2e76c9[_0x2f59('0x3a')]=_[_0x2f59('0x3d')](_0x2e76c9['where'],{'$or':_[_0x2f59('0x2b')](_0x2e76c9[_0x2f59('0x34')],function(_0x577157){var _0x201dad={};_0x201dad[_0x577157]={'$like':'%'+_0x36b862[_0x2f59('0x2f')][_0x2f59('0x3c')]+'%'};return _0x201dad;})});}_0x2e76c9=_[_0x2f59('0x3d')]({},_0x2e76c9,_0x36b862[_0x2f59('0x3f')]);return _0xfe6491[_0x2f59('0x4c')](_0x2e76c9);}})[_0x2f59('0x26')](function(_0x34933c){if(_0x34933c){_0x296ecf=_0x34933c[_0x2f59('0x35')];if(!_0x36b862['query'][_0x2f59('0x36')](_0x2f59('0x37'))){_0x2e76c9[_0x2f59('0x1e')]=qs[_0x2f59('0x1e')](_0x36b862[_0x2f59('0x2f')][_0x2f59('0x1e')]);_0x2e76c9[_0x2f59('0x20')]=qs['offset'](_0x36b862[_0x2f59('0x2f')]['offset']);}return _0xfe6491[_0x2f59('0x4c')](_0x2e76c9);}})[_0x2f59('0x26')](function(_0x1cfb1a){if(_0x1cfb1a){return _0x1cfb1a?{'count':_0x296ecf,'rows':_0x1cfb1a}:null;}})[_0x2f59('0x26')](respondWithResult(_0x3f66cd,null))[_0x2f59('0x43')](handleError(_0x3f66cd,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 62d1b10..0762fea 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 _0x7e95=['exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','./intZohoConfiguration.attributes'];(function(_0x190343,_0x42789b){var _0x53556a=function(_0x159fa2){while(--_0x159fa2){_0x190343['push'](_0x190343['shift']());}};_0x53556a(++_0x42789b);}(_0x7e95,0x184));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x57e9('0x0'));var util=require(_0x57e9('0x1'));var logger=require(_0x57e9('0x2'))(_0x57e9('0x3'));var moment=require('moment');var BPromise=require(_0x57e9('0x4'));var rp=require(_0x57e9('0x5'));var fs=require('fs');var path=require(_0x57e9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x57e9('0x7'));module[_0x57e9('0x8')]=function(_0x309a2b,_0x4230d3){return _0x309a2b['define'](_0x57e9('0x9'),attributes,{'tableName':_0x57e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1b7=['define','ZohoConfiguration','int_zoho_configurations','../../config/logger','moment','bluebird','request-promise','path','./intZohoConfiguration.attributes','exports'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xa1b7,0x12f));var _0x7a1b=function(_0x52bf10,_0x5e72fb){_0x52bf10=_0x52bf10-0x0;var _0x32d8fd=_0xa1b7[_0x52bf10];return _0x32d8fd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a1b('0x0'))('api');var moment=require(_0x7a1b('0x1'));var BPromise=require(_0x7a1b('0x2'));var rp=require(_0x7a1b('0x3'));var fs=require('fs');var path=require(_0x7a1b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7a1b('0x5'));module[_0x7a1b('0x6')]=function(_0x61d6c4,_0x1d5250){return _0x61d6c4[_0x7a1b('0x7')](_0x7a1b('0x8'),attributes,{'tableName':_0x7a1b('0x9'),'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 d226d14..8765536 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 _0x5f34=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x584270,_0x2ef074){var _0x5f11e7=function(_0x353126){while(--_0x353126){_0x584270['push'](_0x584270['shift']());}};_0x5f11e7(++_0x2ef074);}(_0x5f34,0x1e3));var _0x45f3=function(_0x21e50b,_0x59dfc0){_0x21e50b=_0x21e50b-0x0;var _0x281315=_0x5f34[_0x21e50b];return _0x281315;};'use strict';var _=require(_0x45f3('0x0'));var util=require(_0x45f3('0x1'));var moment=require(_0x45f3('0x2'));var BPromise=require(_0x45f3('0x3'));var rs=require(_0x45f3('0x4'));var fs=require('fs');var Redis=require(_0x45f3('0x5'));var db=require(_0x45f3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x45f3('0x7'))('rpc');var config=require(_0x45f3('0x8'));var jayson=require(_0x45f3('0x9'));var client=jayson[_0x45f3('0xa')][_0x45f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a53cf,_0x1fe37e,_0x44a42a){return new BPromise(function(_0x3cb77e,_0x3707fb){return client[_0x45f3('0xc')](_0x3a53cf,_0x44a42a)[_0x45f3('0xd')](function(_0x154876){logger[_0x45f3('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x1fe37e,_0x45f3('0xf'));logger[_0x45f3('0x10')](_0x45f3('0x11'),_0x1fe37e,'request\x20sent',JSON[_0x45f3('0x12')](_0x154876));if(_0x154876[_0x45f3('0x13')]){if(_0x154876[_0x45f3('0x13')][_0x45f3('0x14')]===0x1f4){logger[_0x45f3('0x13')](_0x45f3('0x15'),_0x1fe37e,_0x154876[_0x45f3('0x13')][_0x45f3('0x16')]);return _0x3707fb(_0x154876['error'][_0x45f3('0x16')]);}logger[_0x45f3('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x1fe37e,_0x154876['error'][_0x45f3('0x16')]);return _0x3cb77e(_0x154876[_0x45f3('0x13')][_0x45f3('0x16')]);}else{logger[_0x45f3('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x1fe37e,_0x45f3('0xf'));_0x3cb77e(_0x154876[_0x45f3('0x17')][_0x45f3('0x16')]);}})[_0x45f3('0x18')](function(_0x44bdfc){logger['error'](_0x45f3('0x15'),_0x1fe37e,_0x44bdfc);_0x3707fb(_0x44bdfc);});});} \ No newline at end of file +var _0x1a0e=['bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','lodash','util','moment'];(function(_0x13c329,_0x356551){var _0xc215ba=function(_0x539620){while(--_0x539620){_0x13c329['push'](_0x13c329['shift']());}};_0xc215ba(++_0x356551);}(_0x1a0e,0xed));var _0xe1a0=function(_0x12ef9a,_0x5dfbf7){_0x12ef9a=_0x12ef9a-0x0;var _0x3a6833=_0x1a0e[_0x12ef9a];return _0x3a6833;};'use strict';var _=require(_0xe1a0('0x0'));var util=require(_0xe1a0('0x1'));var moment=require(_0xe1a0('0x2'));var BPromise=require(_0xe1a0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe1a0('0x4'));var logger=require(_0xe1a0('0x5'))(_0xe1a0('0x6'));var config=require('../../config/environment');var jayson=require(_0xe1a0('0x7'));var client=jayson[_0xe1a0('0x8')][_0xe1a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59993f,_0x19fe62,_0x43e9af){return new BPromise(function(_0x5bedef,_0x12581a){return client[_0xe1a0('0xa')](_0x59993f,_0x43e9af)[_0xe1a0('0xb')](function(_0x9c5544){logger['info'](_0xe1a0('0xc'),_0x19fe62,_0xe1a0('0xd'));logger[_0xe1a0('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x19fe62,_0xe1a0('0xd'),JSON[_0xe1a0('0xf')](_0x9c5544));if(_0x9c5544['error']){if(_0x9c5544[_0xe1a0('0x10')][_0xe1a0('0x11')]===0x1f4){logger[_0xe1a0('0x10')](_0xe1a0('0xc'),_0x19fe62,_0x9c5544['error']['message']);return _0x12581a(_0x9c5544[_0xe1a0('0x10')][_0xe1a0('0x12')]);}logger[_0xe1a0('0x10')](_0xe1a0('0xc'),_0x19fe62,_0x9c5544['error'][_0xe1a0('0x12')]);return _0x5bedef(_0x9c5544[_0xe1a0('0x10')][_0xe1a0('0x12')]);}else{logger[_0xe1a0('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x19fe62,_0xe1a0('0xd'));_0x5bedef(_0x9c5544['result'][_0xe1a0('0x12')]);}})['catch'](function(_0x5f5841){logger['error'](_0xe1a0('0xc'),_0x19fe62,_0x5f5841);_0x12581a(_0x5f5841);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index cb7c3c8..dc3d64b 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 _0x60f0=['show','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x60f0,0x1ab));var _0x060f=function(_0x192474,_0x2f1866){_0x192474=_0x192474-0x0;var _0xbfd1ed=_0x60f0[_0x192474];return _0xbfd1ed;};'use strict';var multer=require(_0x060f('0x0'));var util=require('util');var path=require(_0x060f('0x1'));var timeout=require('connect-timeout');var express=require(_0x060f('0x2'));var router=express[_0x060f('0x3')]();var fs_extra=require(_0x060f('0x4'));var auth=require(_0x060f('0x5'));var interaction=require(_0x060f('0x6'));var config=require(_0x060f('0x7'));var controller=require(_0x060f('0x8'));router[_0x060f('0x9')]('/',auth[_0x060f('0xa')](),controller[_0x060f('0xb')]);router['get'](_0x060f('0xc'),auth[_0x060f('0xa')](),controller[_0x060f('0xd')]);router[_0x060f('0xe')]('/',auth[_0x060f('0xa')](),controller[_0x060f('0xf')]);router['put'](_0x060f('0xc'),auth[_0x060f('0xa')](),controller[_0x060f('0x10')]);router[_0x060f('0x11')](_0x060f('0xc'),auth[_0x060f('0xa')](),controller[_0x060f('0x12')]);module[_0x060f('0x13')]=router; \ No newline at end of file +var _0xc32e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','create','put','update','destroy','util'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xc32e,0x168));var _0xec32=function(_0x782894,_0x2d079d){_0x782894=_0x782894-0x0;var _0x2b6ec0=_0xc32e[_0x782894];return _0x2b6ec0;};'use strict';var multer=require('multer');var util=require(_0xec32('0x0'));var path=require(_0xec32('0x1'));var timeout=require(_0xec32('0x2'));var express=require(_0xec32('0x3'));var router=express[_0xec32('0x4')]();var fs_extra=require(_0xec32('0x5'));var auth=require(_0xec32('0x6'));var interaction=require(_0xec32('0x7'));var config=require(_0xec32('0x8'));var controller=require(_0xec32('0x9'));router['get']('/',auth[_0xec32('0xa')](),controller[_0xec32('0xb')]);router[_0xec32('0xc')](_0xec32('0xd'),auth['isAuthenticated'](),controller[_0xec32('0xe')]);router['post']('/',auth[_0xec32('0xa')](),controller[_0xec32('0xf')]);router[_0xec32('0x10')](_0xec32('0xd'),auth[_0xec32('0xa')](),controller[_0xec32('0x11')]);router['delete'](_0xec32('0xd'),auth[_0xec32('0xa')](),controller[_0xec32('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 0ebe9cc..8e092a3 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 _0x7276=['customVariable','picklist','string','STRING','BOOLEAN','exports','variable'];(function(_0x7bc444,_0x1280c9){var _0xfe9695=function(_0x5612f5){while(--_0x5612f5){_0x7bc444['push'](_0x7bc444['shift']());}};_0xfe9695(++_0x1280c9);}(_0x7276,0x1be));var _0x6727=function(_0x1b7e0c,_0x318d81){_0x1b7e0c=_0x1b7e0c-0x0;var _0x20548d=_0x7276[_0x1b7e0c];return _0x20548d;};'use strict';var Sequelize=require('sequelize');module[_0x6727('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x6727('0x1'),_0x6727('0x2'),'keyValue',_0x6727('0x3')),'defaultValue':_0x6727('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6727('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x6727('0x4'),_0x6727('0x1'),_0x6727('0x2'))},'keyContent':{'type':Sequelize[_0x6727('0x5')]},'idField':{'type':Sequelize[_0x6727('0x5')]},'nameField':{'type':Sequelize[_0x6727('0x5')]},'customField':{'type':Sequelize[_0x6727('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6727('0x5')]}}; \ No newline at end of file +var _0xe116=['variable','customVariable','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x237419,_0x123322){var _0x42ea47=function(_0x147431){while(--_0x147431){_0x237419['push'](_0x237419['shift']());}};_0x42ea47(++_0x123322);}(_0xe116,0x1cc));var _0x6e11=function(_0x429bc0,_0x244ced){_0x429bc0=_0x429bc0-0x0;var _0x4be5bb=_0xe116[_0x429bc0];return _0x4be5bb;};'use strict';var Sequelize=require(_0x6e11('0x0'));module[_0x6e11('0x1')]={'type':{'type':Sequelize[_0x6e11('0x2')](_0x6e11('0x3'),_0x6e11('0x4'),_0x6e11('0x5'),'keyValue',_0x6e11('0x6')),'defaultValue':_0x6e11('0x3')},'content':{'type':Sequelize[_0x6e11('0x7')]},'key':{'type':Sequelize[_0x6e11('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6e11('0x4'),_0x6e11('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6e11('0x7')]},'nameField':{'type':Sequelize[_0x6e11('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e11('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 02816cb..272d8a5 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 _0xb22f=['options','find','create','body','destroy','eml-format','rimraf','fast-json-patch','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','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','end','error','stack','index','ZohoField','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params'];(function(_0x459912,_0x58250c){var _0x1b83a8=function(_0x1f854d){while(--_0x1f854d){_0x459912['push'](_0x459912['shift']());}};_0x1b83a8(++_0x58250c);}(_0xb22f,0x141));var _0xfb22=function(_0x3c6a7d,_0x343e60){_0x3c6a7d=_0x3c6a7d-0x0;var _0x554bb1=_0xb22f[_0x3c6a7d];return _0x554bb1;};'use strict';var emlformat=require(_0xfb22('0x0'));var rimraf=require(_0xfb22('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb22('0x2'));var rp=require(_0xfb22('0x3'));var moment=require('moment');var BPromise=require(_0xfb22('0x4'));var Mustache=require(_0xfb22('0x5'));var util=require(_0xfb22('0x6'));var path=require(_0xfb22('0x7'));var sox=require(_0xfb22('0x8'));var csv=require(_0xfb22('0x9'));var ejs=require(_0xfb22('0xa'));var fs=require('fs');var fs_extra=require(_0xfb22('0xb'));var _=require(_0xfb22('0xc'));var squel=require(_0xfb22('0xd'));var crypto=require(_0xfb22('0xe'));var jsforce=require(_0xfb22('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfb22('0x9'));var querystring=require(_0xfb22('0x10'));var Papa=require(_0xfb22('0x11'));var Redis=require(_0xfb22('0x12'));var authService=require(_0xfb22('0x13'));var qs=require(_0xfb22('0x14'));var as=require(_0xfb22('0x15'));var hardwareService=require(_0xfb22('0x16'));var logger=require(_0xfb22('0x17'))(_0xfb22('0x18'));var utils=require(_0xfb22('0x19'));var config=require(_0xfb22('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb22('0x1b'))['db'];function respondWithStatusCode(_0x30559a,_0x25db1b){_0x25db1b=_0x25db1b||0xcc;return function(_0x19a8aa){if(_0x19a8aa){return _0x30559a[_0xfb22('0x1c')](_0x25db1b);}return _0x30559a['status'](_0x25db1b)['end']();};}function respondWithResult(_0x2d7c49,_0x547b73){_0x547b73=_0x547b73||0xc8;return function(_0x4d28b7){if(_0x4d28b7){return _0x2d7c49[_0xfb22('0x1d')](_0x547b73)[_0xfb22('0x1e')](_0x4d28b7);}};}function respondWithFilteredResult(_0x11295f,_0x1ff940){return function(_0x3cd98c){if(_0x3cd98c){var _0xe0cd54=typeof _0x1ff940[_0xfb22('0x1f')]==='undefined'&&typeof _0x1ff940['limit']===_0xfb22('0x20');var _0x579d82=_0x3cd98c['count'];var _0x4c2d98=_0xe0cd54?0x0:_0x1ff940[_0xfb22('0x1f')];var _0x4a42b9=_0xe0cd54?_0x3cd98c[_0xfb22('0x21')]:_0x1ff940[_0xfb22('0x1f')]+_0x1ff940['limit'];var _0x15c547;if(_0x4a42b9>=_0x579d82){_0x4a42b9=_0x579d82;_0x15c547=0xc8;}else{_0x15c547=0xce;}_0x11295f['status'](_0x15c547);return _0x11295f[_0xfb22('0x22')](_0xfb22('0x23'),_0x4c2d98+'-'+_0x4a42b9+'/'+_0x579d82)['json'](_0x3cd98c);}return null;};}function patchUpdates(_0x2b17d8){return function(_0x528ccc){try{jsonpatch[_0xfb22('0x24')](_0x528ccc,_0x2b17d8,!![]);}catch(_0x49bd71){return BPromise[_0xfb22('0x25')](_0x49bd71);}return _0x528ccc['save']();};}function saveUpdates(_0x7a5cad,_0x25ae0c){return function(_0x2f5442){if(_0x2f5442){return _0x2f5442[_0xfb22('0x26')](_0x7a5cad)[_0xfb22('0x27')](function(_0x450b0e){return _0x450b0e;});}return null;};}function removeEntity(_0x56421c,_0x34fc28){return function(_0xe13db6){if(_0xe13db6){return _0xe13db6['destroy']()[_0xfb22('0x27')](function(){_0x56421c[_0xfb22('0x1d')](0xcc)[_0xfb22('0x28')]();});}};}function handleEntityNotFound(_0x5b852b,_0x4da339){return function(_0x4ac9cd){if(!_0x4ac9cd){_0x5b852b[_0xfb22('0x1c')](0x194);}return _0x4ac9cd;};}function handleError(_0x408ded,_0xeef9d4){_0xeef9d4=_0xeef9d4||0x1f4;return function(_0x372ef8){logger[_0xfb22('0x29')](_0x372ef8[_0xfb22('0x2a')]);if(_0x372ef8['name']){delete _0x372ef8['name'];}_0x408ded[_0xfb22('0x1d')](_0xeef9d4)['send'](_0x372ef8);};}exports[_0xfb22('0x2b')]=function(_0x3dc13b,_0x1ccdbc){var _0x1582e6={},_0x615bd1={},_0x3228b6={'count':0x0,'rows':[]};var _0x189f79=_['map'](db[_0xfb22('0x2c')][_0xfb22('0x2d')],function(_0x56b8a8){return{'name':_0x56b8a8[_0xfb22('0x2e')],'type':_0x56b8a8[_0xfb22('0x2f')][_0xfb22('0x30')]};});_0x615bd1[_0xfb22('0x31')]=_[_0xfb22('0x32')](_0x189f79,_0xfb22('0x33'));_0x615bd1[_0xfb22('0x34')]=_[_0xfb22('0x35')](_0x3dc13b['query']);_0x615bd1[_0xfb22('0x36')]=_[_0xfb22('0x37')](_0x615bd1[_0xfb22('0x31')],_0x615bd1['query']);_0x1582e6[_0xfb22('0x38')]=_['intersection'](_0x615bd1['model'],qs[_0xfb22('0x39')](_0x3dc13b['query']['fields']));_0x1582e6[_0xfb22('0x38')]=_0x1582e6['attributes'][_0xfb22('0x3a')]?_0x1582e6[_0xfb22('0x38')]:_0x615bd1['model'];if(!_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x3b')](_0xfb22('0x3c'))){_0x1582e6['limit']=qs['limit'](_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x3d')]);_0x1582e6[_0xfb22('0x1f')]=qs[_0xfb22('0x1f')](_0x3dc13b[_0xfb22('0x34')]['offset']);}_0x1582e6[_0xfb22('0x3e')]=qs[_0xfb22('0x3f')](_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x3f')]);_0x1582e6[_0xfb22('0x40')]=qs[_0xfb22('0x36')](_['pick'](_0x3dc13b[_0xfb22('0x34')],_0x615bd1[_0xfb22('0x36')]),_0x189f79);if(_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x41')]){_0x1582e6[_0xfb22('0x40')]=_[_0xfb22('0x42')](_0x1582e6[_0xfb22('0x40')],{'$or':_[_0xfb22('0x32')](_0x189f79,function(_0x393e16){if(_0x393e16[_0xfb22('0x2f')]!==_0xfb22('0x43')){var _0xa0a0fb={};_0xa0a0fb[_0x393e16[_0xfb22('0x33')]]={'$like':'%'+_0x3dc13b[_0xfb22('0x34')]['filter']+'%'};return _0xa0a0fb;}})});}_0x1582e6=_[_0xfb22('0x42')]({},_0x1582e6,_0x3dc13b['options']);var _0x3c2bbe={'where':_0x1582e6[_0xfb22('0x40')]};return db[_0xfb22('0x2c')][_0xfb22('0x21')](_0x3c2bbe)[_0xfb22('0x27')](function(_0x45813e){_0x3228b6[_0xfb22('0x21')]=_0x45813e;if(_0x3dc13b[_0xfb22('0x34')][_0xfb22('0x44')]){_0x1582e6[_0xfb22('0x45')]=[{'all':!![]}];}return db[_0xfb22('0x2c')][_0xfb22('0x46')](_0x1582e6);})[_0xfb22('0x27')](function(_0x5a248b){_0x3228b6['rows']=_0x5a248b;return _0x3228b6;})[_0xfb22('0x27')](respondWithFilteredResult(_0x1ccdbc,_0x1582e6))[_0xfb22('0x47')](handleError(_0x1ccdbc,null));};exports[_0xfb22('0x48')]=function(_0x42a46f,_0xae8d02){var _0x268c8f={'raw':!![],'where':{'id':_0x42a46f[_0xfb22('0x49')]['id']}},_0x5048ed={};_0x5048ed['model']=_[_0xfb22('0x35')](db[_0xfb22('0x2c')][_0xfb22('0x2d')]);_0x5048ed[_0xfb22('0x34')]=_[_0xfb22('0x35')](_0x42a46f[_0xfb22('0x34')]);_0x5048ed[_0xfb22('0x36')]=_['intersection'](_0x5048ed['model'],_0x5048ed[_0xfb22('0x34')]);_0x268c8f[_0xfb22('0x38')]=_[_0xfb22('0x37')](_0x5048ed['model'],qs[_0xfb22('0x39')](_0x42a46f[_0xfb22('0x34')][_0xfb22('0x39')]));_0x268c8f[_0xfb22('0x38')]=_0x268c8f[_0xfb22('0x38')][_0xfb22('0x3a')]?_0x268c8f[_0xfb22('0x38')]:_0x5048ed['model'];if(_0x42a46f[_0xfb22('0x34')][_0xfb22('0x44')]){_0x268c8f['include']=[{'all':!![]}];}_0x268c8f=_['merge']({},_0x268c8f,_0x42a46f[_0xfb22('0x4a')]);return db[_0xfb22('0x2c')][_0xfb22('0x4b')](_0x268c8f)['then'](handleEntityNotFound(_0xae8d02,null))[_0xfb22('0x27')](respondWithResult(_0xae8d02,null))[_0xfb22('0x47')](handleError(_0xae8d02,null));};exports[_0xfb22('0x4c')]=function(_0x4eb126,_0x1a9b42){return db[_0xfb22('0x2c')]['create'](_0x4eb126[_0xfb22('0x4d')],{})[_0xfb22('0x27')](respondWithResult(_0x1a9b42,0xc9))[_0xfb22('0x47')](handleError(_0x1a9b42,null));};exports[_0xfb22('0x26')]=function(_0x32ff59,_0x378afe){if(_0x32ff59[_0xfb22('0x4d')]['id']){delete _0x32ff59[_0xfb22('0x4d')]['id'];}return db[_0xfb22('0x2c')]['find']({'where':{'id':_0x32ff59['params']['id']}})[_0xfb22('0x27')](handleEntityNotFound(_0x378afe,null))[_0xfb22('0x27')](saveUpdates(_0x32ff59[_0xfb22('0x4d')],null))[_0xfb22('0x27')](respondWithResult(_0x378afe,null))[_0xfb22('0x47')](handleError(_0x378afe,null));};exports[_0xfb22('0x4e')]=function(_0x19bb66,_0x5c0146){return db['ZohoField'][_0xfb22('0x4b')]({'where':{'id':_0x19bb66[_0xfb22('0x49')]['id']}})[_0xfb22('0x27')](handleEntityNotFound(_0x5c0146,null))[_0xfb22('0x27')](removeEntity(_0x5c0146,null))[_0xfb22('0x47')](handleError(_0x5c0146,null));}; \ No newline at end of file +var _0x52a7=['request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoField','includeAll','findAll','catch','show','params','find','create','body','destroy','zip-dir','fast-json-patch'];(function(_0xb5fc3e,_0x234703){var _0x2efc3c=function(_0x4e4e44){while(--_0x4e4e44){_0xb5fc3e['push'](_0xb5fc3e['shift']());}};_0x2efc3c(++_0x234703);}(_0x52a7,0x16b));var _0x752a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x52a7[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x752a('0x0'));var jsonpatch=require(_0x752a('0x1'));var rp=require(_0x752a('0x2'));var moment=require(_0x752a('0x3'));var BPromise=require(_0x752a('0x4'));var Mustache=require(_0x752a('0x5'));var util=require(_0x752a('0x6'));var path=require('path');var sox=require(_0x752a('0x7'));var csv=require(_0x752a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x752a('0x9'));var _=require('lodash');var squel=require(_0x752a('0xa'));var crypto=require(_0x752a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x752a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x752a('0xd'));var Papa=require(_0x752a('0xe'));var Redis=require(_0x752a('0xf'));var authService=require(_0x752a('0x10'));var qs=require(_0x752a('0x11'));var as=require(_0x752a('0x12'));var hardwareService=require(_0x752a('0x13'));var logger=require('../../config/logger')(_0x752a('0x14'));var utils=require(_0x752a('0x15'));var config=require(_0x752a('0x16'));var licenseUtil=require(_0x752a('0x17'));var db=require(_0x752a('0x18'))['db'];function respondWithStatusCode(_0x1fd312,_0x387cf4){_0x387cf4=_0x387cf4||0xcc;return function(_0x5bdad1){if(_0x5bdad1){return _0x1fd312[_0x752a('0x19')](_0x387cf4);}return _0x1fd312[_0x752a('0x1a')](_0x387cf4)['end']();};}function respondWithResult(_0x12aefd,_0x47d693){_0x47d693=_0x47d693||0xc8;return function(_0x9ea6e0){if(_0x9ea6e0){return _0x12aefd[_0x752a('0x1a')](_0x47d693)[_0x752a('0x1b')](_0x9ea6e0);}};}function respondWithFilteredResult(_0x1091e5,_0x2ad947){return function(_0x1d967a){if(_0x1d967a){var _0x4e2b56=typeof _0x2ad947[_0x752a('0x1c')]===_0x752a('0x1d')&&typeof _0x2ad947[_0x752a('0x1e')]===_0x752a('0x1d');var _0x52f175=_0x1d967a[_0x752a('0x1f')];var _0x4973ef=_0x4e2b56?0x0:_0x2ad947[_0x752a('0x1c')];var _0x3db53d=_0x4e2b56?_0x1d967a[_0x752a('0x1f')]:_0x2ad947[_0x752a('0x1c')]+_0x2ad947[_0x752a('0x1e')];var _0x5248c2;if(_0x3db53d>=_0x52f175){_0x3db53d=_0x52f175;_0x5248c2=0xc8;}else{_0x5248c2=0xce;}_0x1091e5[_0x752a('0x1a')](_0x5248c2);return _0x1091e5[_0x752a('0x20')](_0x752a('0x21'),_0x4973ef+'-'+_0x3db53d+'/'+_0x52f175)[_0x752a('0x1b')](_0x1d967a);}return null;};}function patchUpdates(_0x9056a5){return function(_0x4d276d){try{jsonpatch['apply'](_0x4d276d,_0x9056a5,!![]);}catch(_0x30cb6c){return BPromise[_0x752a('0x22')](_0x30cb6c);}return _0x4d276d[_0x752a('0x23')]();};}function saveUpdates(_0x24c10c,_0x58f48b){return function(_0xb71478){if(_0xb71478){return _0xb71478[_0x752a('0x24')](_0x24c10c)[_0x752a('0x25')](function(_0x2cf269){return _0x2cf269;});}return null;};}function removeEntity(_0x2f0d04,_0x54cdbf){return function(_0x3ba924){if(_0x3ba924){return _0x3ba924['destroy']()[_0x752a('0x25')](function(){_0x2f0d04[_0x752a('0x1a')](0xcc)[_0x752a('0x26')]();});}};}function handleEntityNotFound(_0x3ca500,_0xf1ff32){return function(_0x5b1f1a){if(!_0x5b1f1a){_0x3ca500['sendStatus'](0x194);}return _0x5b1f1a;};}function handleError(_0xd6ba41,_0x50fb40){_0x50fb40=_0x50fb40||0x1f4;return function(_0xf7e979){logger['error'](_0xf7e979[_0x752a('0x27')]);if(_0xf7e979[_0x752a('0x28')]){delete _0xf7e979[_0x752a('0x28')];}_0xd6ba41['status'](_0x50fb40)['send'](_0xf7e979);};}exports['index']=function(_0x455e3a,_0x38d78f){var _0x2f5059={},_0x4db606={},_0x520183={'count':0x0,'rows':[]};var _0x17495f=_[_0x752a('0x29')](db['ZohoField'][_0x752a('0x2a')],function(_0x43c946){return{'name':_0x43c946[_0x752a('0x2b')],'type':_0x43c946[_0x752a('0x2c')]['key']};});_0x4db606[_0x752a('0x2d')]=_['map'](_0x17495f,_0x752a('0x28'));_0x4db606[_0x752a('0x2e')]=_[_0x752a('0x2f')](_0x455e3a[_0x752a('0x2e')]);_0x4db606[_0x752a('0x30')]=_[_0x752a('0x31')](_0x4db606[_0x752a('0x2d')],_0x4db606[_0x752a('0x2e')]);_0x2f5059['attributes']=_[_0x752a('0x31')](_0x4db606[_0x752a('0x2d')],qs[_0x752a('0x32')](_0x455e3a[_0x752a('0x2e')]['fields']));_0x2f5059['attributes']=_0x2f5059[_0x752a('0x33')][_0x752a('0x34')]?_0x2f5059[_0x752a('0x33')]:_0x4db606[_0x752a('0x2d')];if(!_0x455e3a['query'][_0x752a('0x35')](_0x752a('0x36'))){_0x2f5059[_0x752a('0x1e')]=qs[_0x752a('0x1e')](_0x455e3a['query'][_0x752a('0x1e')]);_0x2f5059[_0x752a('0x1c')]=qs[_0x752a('0x1c')](_0x455e3a[_0x752a('0x2e')][_0x752a('0x1c')]);}_0x2f5059[_0x752a('0x37')]=qs[_0x752a('0x38')](_0x455e3a[_0x752a('0x2e')][_0x752a('0x38')]);_0x2f5059['where']=qs[_0x752a('0x30')](_[_0x752a('0x39')](_0x455e3a[_0x752a('0x2e')],_0x4db606[_0x752a('0x30')]),_0x17495f);if(_0x455e3a['query'][_0x752a('0x3a')]){_0x2f5059[_0x752a('0x3b')]=_[_0x752a('0x3c')](_0x2f5059[_0x752a('0x3b')],{'$or':_['map'](_0x17495f,function(_0x4563be){if(_0x4563be['type']!==_0x752a('0x3d')){var _0x585bf3={};_0x585bf3[_0x4563be[_0x752a('0x28')]]={'$like':'%'+_0x455e3a[_0x752a('0x2e')]['filter']+'%'};return _0x585bf3;}})});}_0x2f5059=_['merge']({},_0x2f5059,_0x455e3a[_0x752a('0x3e')]);var _0x13a128={'where':_0x2f5059[_0x752a('0x3b')]};return db[_0x752a('0x3f')]['count'](_0x13a128)['then'](function(_0x25f24e){_0x520183['count']=_0x25f24e;if(_0x455e3a[_0x752a('0x2e')][_0x752a('0x40')]){_0x2f5059['include']=[{'all':!![]}];}return db[_0x752a('0x3f')][_0x752a('0x41')](_0x2f5059);})[_0x752a('0x25')](function(_0x2c8a36){_0x520183['rows']=_0x2c8a36;return _0x520183;})[_0x752a('0x25')](respondWithFilteredResult(_0x38d78f,_0x2f5059))[_0x752a('0x42')](handleError(_0x38d78f,null));};exports[_0x752a('0x43')]=function(_0x89fe1f,_0x3f44b6){var _0x45f4a8={'raw':!![],'where':{'id':_0x89fe1f[_0x752a('0x44')]['id']}},_0x4fc67f={};_0x4fc67f['model']=_[_0x752a('0x2f')](db[_0x752a('0x3f')][_0x752a('0x2a')]);_0x4fc67f[_0x752a('0x2e')]=_[_0x752a('0x2f')](_0x89fe1f[_0x752a('0x2e')]);_0x4fc67f[_0x752a('0x30')]=_[_0x752a('0x31')](_0x4fc67f[_0x752a('0x2d')],_0x4fc67f[_0x752a('0x2e')]);_0x45f4a8[_0x752a('0x33')]=_[_0x752a('0x31')](_0x4fc67f['model'],qs[_0x752a('0x32')](_0x89fe1f['query'][_0x752a('0x32')]));_0x45f4a8[_0x752a('0x33')]=_0x45f4a8[_0x752a('0x33')][_0x752a('0x34')]?_0x45f4a8[_0x752a('0x33')]:_0x4fc67f['model'];if(_0x89fe1f['query'][_0x752a('0x40')]){_0x45f4a8['include']=[{'all':!![]}];}_0x45f4a8=_[_0x752a('0x3c')]({},_0x45f4a8,_0x89fe1f['options']);return db[_0x752a('0x3f')][_0x752a('0x45')](_0x45f4a8)[_0x752a('0x25')](handleEntityNotFound(_0x3f44b6,null))['then'](respondWithResult(_0x3f44b6,null))[_0x752a('0x42')](handleError(_0x3f44b6,null));};exports['create']=function(_0x320ce8,_0x407214){return db['ZohoField'][_0x752a('0x46')](_0x320ce8['body'],{})[_0x752a('0x25')](respondWithResult(_0x407214,0xc9))['catch'](handleError(_0x407214,null));};exports[_0x752a('0x24')]=function(_0x35be0c,_0x16b5ba){if(_0x35be0c[_0x752a('0x47')]['id']){delete _0x35be0c['body']['id'];}return db[_0x752a('0x3f')][_0x752a('0x45')]({'where':{'id':_0x35be0c[_0x752a('0x44')]['id']}})[_0x752a('0x25')](handleEntityNotFound(_0x16b5ba,null))[_0x752a('0x25')](saveUpdates(_0x35be0c[_0x752a('0x47')],null))['then'](respondWithResult(_0x16b5ba,null))[_0x752a('0x42')](handleError(_0x16b5ba,null));};exports[_0x752a('0x48')]=function(_0xc4413c,_0x53b2fe){return db['ZohoField'][_0x752a('0x45')]({'where':{'id':_0xc4413c['params']['id']}})[_0x752a('0x25')](handleEntityNotFound(_0x53b2fe,null))[_0x752a('0x25')](removeEntity(_0x53b2fe,null))[_0x752a('0x42')](handleError(_0x53b2fe,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 797ceed..06c8f95 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 _0x5f2f=['bluebird','request-promise','path','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x2f4779,_0x4b8c48){var _0x251396=function(_0xfe34ec){while(--_0xfe34ec){_0x2f4779['push'](_0x2f4779['shift']());}};_0x251396(++_0x4b8c48);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1587f9,_0x253d0c){_0x1587f9=_0x1587f9-0x0;var _0x3dc02e=_0x5f2f[_0x1587f9];return _0x3dc02e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xf5f2('0xc'),'fields':[_0xf5f2('0xd'),_0xf5f2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2542=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x2542,0x169));var _0x2254=function(_0x359e4f,_0x25d8e9){_0x359e4f=_0x359e4f-0x0;var _0x47036a=_0x2542[_0x359e4f];return _0x47036a;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xe'),_0x2254('0xf')],'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 713f60c..7516563 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 _0x37e2=['info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x37e2,0x191));var _0x237e=function(_0x891ee5,_0x54cca6){_0x891ee5=_0x891ee5-0x0;var _0x58ce79=_0x37e2[_0x891ee5];return _0x58ce79;};'use strict';var _=require(_0x237e('0x0'));var util=require(_0x237e('0x1'));var moment=require('moment');var BPromise=require(_0x237e('0x2'));var rs=require(_0x237e('0x3'));var fs=require('fs');var Redis=require(_0x237e('0x4'));var db=require(_0x237e('0x5'))['db'];var utils=require(_0x237e('0x6'));var logger=require('../../config/logger')(_0x237e('0x7'));var config=require('../../config/environment');var jayson=require(_0x237e('0x8'));var client=jayson[_0x237e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43e229,_0x197e9c,_0x50f011){return new BPromise(function(_0x4f4778,_0x2266eb){return client['request'](_0x43e229,_0x50f011)[_0x237e('0xa')](function(_0x2600e0){logger['info']('ZohoField,\x20%s,\x20%s',_0x197e9c,'request\x20sent');logger[_0x237e('0xb')](_0x237e('0xc'),_0x197e9c,_0x237e('0xd'),JSON[_0x237e('0xe')](_0x2600e0));if(_0x2600e0['error']){if(_0x2600e0[_0x237e('0xf')][_0x237e('0x10')]===0x1f4){logger[_0x237e('0xf')](_0x237e('0x11'),_0x197e9c,_0x2600e0[_0x237e('0xf')][_0x237e('0x12')]);return _0x2266eb(_0x2600e0['error'][_0x237e('0x12')]);}logger[_0x237e('0xf')](_0x237e('0x11'),_0x197e9c,_0x2600e0['error']['message']);return _0x4f4778(_0x2600e0[_0x237e('0xf')][_0x237e('0x12')]);}else{logger[_0x237e('0x13')]('ZohoField,\x20%s,\x20%s',_0x197e9c,_0x237e('0xd'));_0x4f4778(_0x2600e0['result'][_0x237e('0x12')]);}})['catch'](function(_0x1e40e9){logger[_0x237e('0xf')](_0x237e('0x11'),_0x197e9c,_0x1e40e9);_0x2266eb(_0x1e40e9);});});} \ No newline at end of file +var _0xd9d2=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xd9d2,0x8c));var _0x2d9d=function(_0x2764d4,_0x30f13c){_0x2764d4=_0x2764d4-0x0;var _0x825090=_0xd9d2[_0x2764d4];return _0x825090;};'use strict';var _=require(_0x2d9d('0x0'));var util=require(_0x2d9d('0x1'));var moment=require(_0x2d9d('0x2'));var BPromise=require(_0x2d9d('0x3'));var rs=require(_0x2d9d('0x4'));var fs=require('fs');var Redis=require(_0x2d9d('0x5'));var db=require(_0x2d9d('0x6'))['db'];var utils=require(_0x2d9d('0x7'));var logger=require(_0x2d9d('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2d9d('0x9'));var client=jayson[_0x2d9d('0xa')][_0x2d9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4219cf,_0x14610a,_0x17cb98){return new BPromise(function(_0x41cc30,_0x4213ea){return client[_0x2d9d('0xc')](_0x4219cf,_0x17cb98)['then'](function(_0x2daa44){logger[_0x2d9d('0xd')](_0x2d9d('0xe'),_0x14610a,_0x2d9d('0xf'));logger[_0x2d9d('0x10')](_0x2d9d('0x11'),_0x14610a,'request\x20sent',JSON[_0x2d9d('0x12')](_0x2daa44));if(_0x2daa44[_0x2d9d('0x13')]){if(_0x2daa44[_0x2d9d('0x13')][_0x2d9d('0x14')]===0x1f4){logger[_0x2d9d('0x13')](_0x2d9d('0xe'),_0x14610a,_0x2daa44[_0x2d9d('0x13')]['message']);return _0x4213ea(_0x2daa44[_0x2d9d('0x13')][_0x2d9d('0x15')]);}logger['error'](_0x2d9d('0xe'),_0x14610a,_0x2daa44['error'][_0x2d9d('0x15')]);return _0x41cc30(_0x2daa44[_0x2d9d('0x13')]['message']);}else{logger[_0x2d9d('0xd')](_0x2d9d('0xe'),_0x14610a,_0x2d9d('0xf'));_0x41cc30(_0x2daa44[_0x2d9d('0x16')][_0x2d9d('0x15')]);}})['catch'](function(_0x2a3b73){logger[_0x2d9d('0x13')](_0x2d9d('0xe'),_0x14610a,_0x2a3b73);_0x4213ea(_0x2a3b73);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index c37a758..6f708b8 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x69209b,_0x6859f1){var _0x425388=function(_0x3b6542){while(--_0x3b6542){_0x69209b['push'](_0x69209b['shift']());}};_0x425388(++_0x6859f1);}(_0x70e0,0x17b));var _0x070e=function(_0x28504a,_0x26e351){_0x28504a=_0x28504a-0x0;var _0x434667=_0x70e0[_0x28504a];return _0x434667;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x37c47c,_0x291244){var _0x48b697=function(_0x18ce07){while(--_0x18ce07){_0x37c47c['push'](_0x37c47c['shift']());}};_0x48b697(++_0x291244);}(_0xedd9,0xfc));var _0x9edd=function(_0x17c2c9,_0x514905){_0x17c2c9=_0x17c2c9-0x0;var _0x1c57c0=_0xedd9[_0x17c2c9];return _0x1c57c0;};'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 6bb0a81..5f43430 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 _0xada1=['INTEGER','BOOLEAN','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x2522b7,_0x491e1e){var _0x5bb952=function(_0x44f1c4){while(--_0x44f1c4){_0x2522b7['push'](_0x2522b7['shift']());}};_0x5bb952(++_0x491e1e);}(_0xada1,0xfe));var _0x1ada=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xada1[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0x1ada('0x0'));module[_0x1ada('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1ada('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x1ada('0x3')],'defaultValue':_0x1ada('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x1ada('0x3')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x1ada('0x5')]},'active':{'type':Sequelize[_0x1ada('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x1ada('0x3')],'unique':'state'},'description':{'type':Sequelize[_0x1ada('0x3')]},'title':{'type':Sequelize[_0x1ada('0x3')]},'remoteUri':{'type':Sequelize[_0x1ada('0x3')]},'link':{'type':Sequelize[_0x1ada('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x3129=['BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING'];(function(_0x3b13f1,_0x41058a){var _0xd036e6=function(_0x1b3bcb){while(--_0x1b3bcb){_0x3b13f1['push'](_0x3b13f1['shift']());}};_0xd036e6(++_0x41058a);}(_0x3129,0x1dc));var _0x9312=function(_0x4c39d6,_0x776615){_0x4c39d6=_0x4c39d6-0x0;var _0x4c85c9=_0x3129[_0x4c39d6];return _0x4c85c9;};'use strict';var Sequelize=require(_0x9312('0x0'));module[_0x9312('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9312('0x2')},'main':{'type':Sequelize[_0x9312('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x9312('0x3')]},'path':{'type':Sequelize[_0x9312('0x3')]},'type':{'type':Sequelize[_0x9312('0x3')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x9312('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x9312('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x9312('0x3')],'unique':_0x9312('0x5')},'description':{'type':Sequelize[_0x9312('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index f91f606..53e8136 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(_0x4967cd,_0x2fee96){var _0x1a6fd5=function(_0x33d73f){while(--_0x33d73f){_0x4967cd['push'](_0x4967cd['shift']());}};_0x1a6fd5(++_0x2fee96);}(_0x57ca,0x108));var _0xa57c=function(_0x274668,_0x554174){_0x274668=_0x274668-0x0;var _0x3cfb24=_0x57ca[_0x274668];return _0x3cfb24;};'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 _0x5496=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../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','Integration','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x5496,0x175));var _0x6549=function(_0x4c54b1,_0x22f7f3){_0x4c54b1=_0x4c54b1-0x0;var _0x1d4476=_0x5496[_0x4c54b1];return _0x1d4476;};'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['Integration'][_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));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d366c7f..d47b5e5 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 _0x18ee=['integrations','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x18ee,0xfe));var _0xe18e=function(_0x212e3a,_0x396549){_0x212e3a=_0x212e3a-0x0;var _0x3882d7=_0x18ee[_0x212e3a];return _0x3882d7;};'use strict';var _=require('lodash');var util=require(_0xe18e('0x0'));var logger=require('../../config/logger')(_0xe18e('0x1'));var moment=require(_0xe18e('0x2'));var BPromise=require(_0xe18e('0x3'));var rp=require(_0xe18e('0x4'));var fs=require('fs');var path=require(_0xe18e('0x5'));var rimraf=require(_0xe18e('0x6'));var config=require(_0xe18e('0x7'));var attributes=require('./integration.attributes');module[_0xe18e('0x8')]=function(_0x4296bd,_0x5ad5fc){return _0x4296bd[_0xe18e('0x9')]('Integration',attributes,{'tableName':_0xe18e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec6a=['path','rimraf','../../config/environment','./integration.attributes','define','Integration','../../config/logger','api','bluebird','request-promise'];(function(_0x52e94f,_0x22e52d){var _0x127d43=function(_0x423f67){while(--_0x423f67){_0x52e94f['push'](_0x52e94f['shift']());}};_0x127d43(++_0x22e52d);}(_0xec6a,0xd8));var _0xaec6=function(_0x22d282,_0x39543c){_0x22d282=_0x22d282-0x0;var _0x5abed6=_0xec6a[_0x22d282];return _0x5abed6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaec6('0x0'))(_0xaec6('0x1'));var moment=require('moment');var BPromise=require(_0xaec6('0x2'));var rp=require(_0xaec6('0x3'));var fs=require('fs');var path=require(_0xaec6('0x4'));var rimraf=require(_0xaec6('0x5'));var config=require(_0xaec6('0x6'));var attributes=require(_0xaec6('0x7'));module['exports']=function(_0x47cbb3,_0x5d2f4e){return _0x47cbb3[_0xaec6('0x8')](_0xaec6('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index a78b321..55d1956 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 _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0xe261f8,_0x4925ef){var _0x4afc23=function(_0x521616){while(--_0x521616){_0xe261f8['push'](_0xe261f8['shift']());}};_0x4afc23(++_0x4925ef);}(_0x1a85,0x178));var _0x51a8=function(_0x54abca,_0x105466){_0x54abca=_0x54abca-0x0;var _0x83d195=_0x1a85[_0x54abca];return _0x83d195;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Integration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x308181,_0xefe059){var _0x2e9898=function(_0x36a66f){while(--_0x36a66f){_0x308181['push'](_0x308181['shift']());}};_0x2e9898(++_0xefe059);}(_0xdb28,0x106));var _0x8db2=function(_0x47f7ff,_0x6a353a){_0x47f7ff=_0x47f7ff-0x0;var _0x5a378c=_0xdb28[_0x47f7ff];return _0x5a378c;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 954d26d..76ddf0f 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 _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x1b4846,_0x107dbd){var _0x221422=function(_0x10afc6){while(--_0x10afc6){_0x1b4846['push'](_0x1b4846['shift']());}};_0x221422(++_0x107dbd);}(_0x7880,0x1f4));var _0x0788=function(_0x336a6e,_0x4c454f){_0x336a6e=_0x336a6e-0x0;var _0x4c0b21=_0x7880[_0x336a6e];return _0x4c0b21;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x405e1a,_0x59ec1d){var _0x56e7d5=function(_0x5de6a2){while(--_0x5de6a2){_0x405e1a['push'](_0x405e1a['shift']());}};_0x56e7d5(++_0x59ec1d);}(_0x7a54,0x106));var _0x47a5=function(_0x35aba1,_0x43bff7){_0x35aba1=_0x35aba1-0x0;var _0x25c68d=_0x7a54[_0x35aba1];return _0x25c68d;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index b4d0e9a..6f36334 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 _0xd7d6=['SENDING','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x288b6c,_0x39742c){var _0x1b905=function(_0x13b48b){while(--_0x13b48b){_0x288b6c['push'](_0x288b6c['shift']());}};_0x1b905(++_0x39742c);}(_0xd7d6,0xf4));var _0x6d7d=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0xd7d6[_0x2ed7d1];return _0x38ae3c;};'use strict';var Sequelize=require(_0x6d7d('0x0'));module[_0x6d7d('0x1')]={'integration':{'type':Sequelize[_0x6d7d('0x2')]},'eventChannel':{'type':Sequelize[_0x6d7d('0x2')]},'exitStatus':{'type':Sequelize[_0x6d7d('0x2')]},'ticketId':{'type':Sequelize[_0x6d7d('0x2')]},'integrationId':{'type':Sequelize[_0x6d7d('0x3')]},'contacts':{'type':Sequelize[_0x6d7d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6d7d('0x2')]},'calleridname':{'type':Sequelize[_0x6d7d('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x6d7d('0x2')]},'membername':{'type':Sequelize[_0x6d7d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6d7d('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6d7d('0x4')]},'holdtime':{'type':Sequelize[_0x6d7d('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6d7d('0x4')]},'talktime':{'type':Sequelize[_0x6d7d('0x3')]},'agentacw':{'type':Sequelize[_0x6d7d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x6d7d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6d7d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6d7d('0x4')]},'agentdump':{'type':Sequelize[_0x6d7d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6d7d('0x4')]},'lastevent':{'type':Sequelize[_0x6d7d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6d7d('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6d7d('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6d7d('0x2')]},'accountcode':{'type':Sequelize[_0x6d7d('0x2')]},'context':{'type':Sequelize[_0x6d7d('0x2')]},'exten':{'type':Sequelize[_0x6d7d('0x2')]},'priority':{'type':Sequelize[_0x6d7d('0x2')]},'destchannel':{'type':Sequelize[_0x6d7d('0x2')]},'destchannelstate':{'type':Sequelize[_0x6d7d('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x6d7d('0x2')]},'destcalleridname':{'type':Sequelize[_0x6d7d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6d7d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6d7d('0x2')]},'destlanguage':{'type':Sequelize[_0x6d7d('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6d7d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6d7d('0x2')]},'destuniqueid':{'type':Sequelize[_0x6d7d('0x2')]},'messageId':{'type':Sequelize[_0x6d7d('0x2')]},'inReplyTo':{'type':Sequelize[_0x6d7d('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x6d7d('0x2')]},'to':{'type':Sequelize[_0x6d7d('0x2')]},'cc':{'type':Sequelize[_0x6d7d('0x2')]},'attachment':{'type':Sequelize[_0x6d7d('0x6')]},'html':{'type':Sequelize[_0x6d7d('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x6d7d('0x7'),_0x6d7d('0x8'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x6d7d('0x2')]},'app':{'type':Sequelize[_0x6d7d('0x2')]},'appdata':{'type':Sequelize[_0x6d7d('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x536d=['DATE','BOOLEAN','TEXT','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x39fc4f,_0x5b9b02){var _0x7a732=function(_0x8e61e){while(--_0x8e61e){_0x39fc4f['push'](_0x39fc4f['shift']());}};_0x7a732(++_0x5b9b02);}(_0x536d,0xe2));var _0xd536=function(_0x5d0bb8,_0x5e87a2){_0x5d0bb8=_0x5d0bb8-0x0;var _0x2b97d3=_0x536d[_0x5d0bb8];return _0x2b97d3;};'use strict';var Sequelize=require(_0xd536('0x0'));module[_0xd536('0x1')]={'integration':{'type':Sequelize[_0xd536('0x2')]},'eventChannel':{'type':Sequelize[_0xd536('0x2')]},'exitStatus':{'type':Sequelize[_0xd536('0x2')]},'ticketId':{'type':Sequelize[_0xd536('0x2')]},'integrationId':{'type':Sequelize[_0xd536('0x3')]},'contacts':{'type':Sequelize[_0xd536('0x2')]},'uniqueid':{'type':Sequelize[_0xd536('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd536('0x2')]},'queue':{'type':Sequelize[_0xd536('0x2')]},'interface':{'type':Sequelize[_0xd536('0x2')]},'membername':{'type':Sequelize[_0xd536('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd536('0x4')]},'holdtime':{'type':Sequelize[_0xd536('0x3')]},'agentcomplete':{'type':Sequelize[_0xd536('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xd536('0x4')]},'talktime':{'type':Sequelize[_0xd536('0x3')]},'agentacw':{'type':Sequelize[_0xd536('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd536('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xd536('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xd536('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xd536('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd536('0x2')]},'channelstate':{'type':Sequelize[_0xd536('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd536('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd536('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd536('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd536('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd536('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xd536('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xd536('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xd536('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xd536('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xd536('0x2')]},'destexten':{'type':Sequelize[_0xd536('0x2')]},'destpriority':{'type':Sequelize[_0xd536('0x2')]},'destuniqueid':{'type':Sequelize[_0xd536('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xd536('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xd536('0x2')]},'to':{'type':Sequelize[_0xd536('0x2')]},'cc':{'type':Sequelize[_0xd536('0x2')]},'attachment':{'type':Sequelize[_0xd536('0x6')]},'html':{'type':Sequelize[_0xd536('0x6')]},'text':{'type':Sequelize[_0xd536('0x6')]},'status':{'type':Sequelize['ENUM'](_0xd536('0x7'),'SENDING',_0xd536('0x8'),_0xd536('0x9'))},'url':{'type':Sequelize[_0xd536('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xd536('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index a902b47..6824f3b 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 _0x6415=['json','undefined','limit','count','offset','status','set','Content-Range','reject','update','then','error','stack','name','map','IntegrationReport','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x6415,0x19b));var _0x5641=function(_0xd00657,_0x54aeb1){_0xd00657=_0xd00657-0x0;var _0x4946b6=_0x6415[_0xd00657];return _0x4946b6;};'use strict';var emlformat=require(_0x5641('0x0'));var rimraf=require(_0x5641('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5641('0x2'));var rp=require(_0x5641('0x3'));var moment=require(_0x5641('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5641('0x5'));var util=require(_0x5641('0x6'));var path=require(_0x5641('0x7'));var sox=require(_0x5641('0x8'));var csv=require(_0x5641('0x9'));var ejs=require(_0x5641('0xa'));var fs=require('fs');var fs_extra=require(_0x5641('0xb'));var _=require(_0x5641('0xc'));var squel=require('squel');var crypto=require(_0x5641('0xd'));var jsforce=require(_0x5641('0xe'));var deskjs=require(_0x5641('0xf'));var toCsv=require(_0x5641('0x9'));var querystring=require('querystring');var Papa=require(_0x5641('0x10'));var Redis=require(_0x5641('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5641('0x12'));var hardwareService=require(_0x5641('0x13'));var logger=require(_0x5641('0x14'))('api');var utils=require(_0x5641('0x15'));var config=require(_0x5641('0x16'));var licenseUtil=require(_0x5641('0x17'));var db=require(_0x5641('0x18'))['db'];function respondWithStatusCode(_0x4b2253,_0x3ea4bf){_0x3ea4bf=_0x3ea4bf||0xcc;return function(_0x212951){if(_0x212951){return _0x4b2253[_0x5641('0x19')](_0x3ea4bf);}return _0x4b2253['status'](_0x3ea4bf)[_0x5641('0x1a')]();};}function respondWithResult(_0x4c4b02,_0x1f9e78){_0x1f9e78=_0x1f9e78||0xc8;return function(_0x184544){if(_0x184544){return _0x4c4b02['status'](_0x1f9e78)[_0x5641('0x1b')](_0x184544);}};}function respondWithFilteredResult(_0x4ea9df,_0x95d4f3){return function(_0x3539b4){if(_0x3539b4){var _0x399111=typeof _0x95d4f3['offset']===_0x5641('0x1c')&&typeof _0x95d4f3[_0x5641('0x1d')]===_0x5641('0x1c');var _0xc37f31=_0x3539b4[_0x5641('0x1e')];var _0x2b9662=_0x399111?0x0:_0x95d4f3[_0x5641('0x1f')];var _0x4238d5=_0x399111?_0x3539b4[_0x5641('0x1e')]:_0x95d4f3[_0x5641('0x1f')]+_0x95d4f3[_0x5641('0x1d')];var _0x56ac42;if(_0x4238d5>=_0xc37f31){_0x4238d5=_0xc37f31;_0x56ac42=0xc8;}else{_0x56ac42=0xce;}_0x4ea9df[_0x5641('0x20')](_0x56ac42);return _0x4ea9df[_0x5641('0x21')](_0x5641('0x22'),_0x2b9662+'-'+_0x4238d5+'/'+_0xc37f31)[_0x5641('0x1b')](_0x3539b4);}return null;};}function patchUpdates(_0x19387f){return function(_0x52f753){try{jsonpatch['apply'](_0x52f753,_0x19387f,!![]);}catch(_0x5438f6){return BPromise[_0x5641('0x23')](_0x5438f6);}return _0x52f753['save']();};}function saveUpdates(_0x21c315,_0x5d8263){return function(_0x77499b){if(_0x77499b){return _0x77499b[_0x5641('0x24')](_0x21c315)['then'](function(_0x5c91be){return _0x5c91be;});}return null;};}function removeEntity(_0x5d1eed,_0x8f560d){return function(_0x304ba2){if(_0x304ba2){return _0x304ba2['destroy']()[_0x5641('0x25')](function(){_0x5d1eed[_0x5641('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ca981,_0x57fae3){return function(_0x2a61f3){if(!_0x2a61f3){_0x1ca981[_0x5641('0x19')](0x194);}return _0x2a61f3;};}function handleError(_0x23e462,_0xc54a47){_0xc54a47=_0xc54a47||0x1f4;return function(_0x53b957){logger[_0x5641('0x26')](_0x53b957[_0x5641('0x27')]);if(_0x53b957[_0x5641('0x28')]){delete _0x53b957[_0x5641('0x28')];}_0x23e462[_0x5641('0x20')](_0xc54a47)['send'](_0x53b957);};}exports['index']=function(_0x4e760c,_0x182520){var _0x589273={},_0x1e2f2a={},_0xfa52a2={'count':0x0,'rows':[]};var _0x3fe940=_[_0x5641('0x29')](db[_0x5641('0x2a')]['rawAttributes'],function(_0x1bf726){return{'name':_0x1bf726[_0x5641('0x2b')],'type':_0x1bf726['type']['key']};});_0x1e2f2a[_0x5641('0x2c')]=_[_0x5641('0x29')](_0x3fe940,'name');_0x1e2f2a[_0x5641('0x2d')]=_[_0x5641('0x2e')](_0x4e760c['query']);_0x1e2f2a[_0x5641('0x2f')]=_['intersection'](_0x1e2f2a['model'],_0x1e2f2a[_0x5641('0x2d')]);_0x589273[_0x5641('0x30')]=_['intersection'](_0x1e2f2a[_0x5641('0x2c')],qs[_0x5641('0x31')](_0x4e760c[_0x5641('0x2d')][_0x5641('0x31')]));_0x589273['attributes']=_0x589273[_0x5641('0x30')][_0x5641('0x32')]?_0x589273[_0x5641('0x30')]:_0x1e2f2a[_0x5641('0x2c')];if(!_0x4e760c['query'][_0x5641('0x33')](_0x5641('0x34'))){_0x589273['limit']=qs['limit'](_0x4e760c[_0x5641('0x2d')][_0x5641('0x1d')]);_0x589273[_0x5641('0x1f')]=qs[_0x5641('0x1f')](_0x4e760c[_0x5641('0x2d')][_0x5641('0x1f')]);}_0x589273[_0x5641('0x35')]=qs[_0x5641('0x36')](_0x4e760c['query']['sort']);_0x589273['where']=qs[_0x5641('0x2f')](_['pick'](_0x4e760c[_0x5641('0x2d')],_0x1e2f2a[_0x5641('0x2f')]),_0x3fe940);if(_0x4e760c[_0x5641('0x2d')][_0x5641('0x37')]){_0x589273[_0x5641('0x38')]=_[_0x5641('0x39')](_0x589273[_0x5641('0x38')],{'$or':_[_0x5641('0x29')](_0x3fe940,function(_0x364860){if(_0x364860[_0x5641('0x3a')]!=='VIRTUAL'){var _0x4e6c26={};_0x4e6c26[_0x364860[_0x5641('0x28')]]={'$like':'%'+_0x4e760c['query'][_0x5641('0x37')]+'%'};return _0x4e6c26;}})});}_0x589273=_[_0x5641('0x39')]({},_0x589273,_0x4e760c[_0x5641('0x3b')]);var _0x304867={'where':_0x589273[_0x5641('0x38')]};return db['IntegrationReport']['count'](_0x304867)[_0x5641('0x25')](function(_0x2e84e2){_0xfa52a2[_0x5641('0x1e')]=_0x2e84e2;if(_0x4e760c[_0x5641('0x2d')][_0x5641('0x3c')]){_0x589273[_0x5641('0x3d')]=[{'all':!![]}];}return db[_0x5641('0x2a')][_0x5641('0x3e')](_0x589273);})['then'](function(_0x2a52cd){_0xfa52a2[_0x5641('0x3f')]=_0x2a52cd;return _0xfa52a2;})[_0x5641('0x25')](respondWithFilteredResult(_0x182520,_0x589273))[_0x5641('0x40')](handleError(_0x182520,null));};exports[_0x5641('0x41')]=function(_0x59cdd7,_0x997cb6){var _0x24513e={'raw':![],'where':{'id':_0x59cdd7[_0x5641('0x42')]['id']}},_0x337b65={};_0x337b65[_0x5641('0x2c')]=_[_0x5641('0x2e')](db['IntegrationReport'][_0x5641('0x43')]);_0x337b65[_0x5641('0x2d')]=_['keys'](_0x59cdd7['query']);_0x337b65['filters']=_['intersection'](_0x337b65[_0x5641('0x2c')],_0x337b65[_0x5641('0x2d')]);_0x24513e[_0x5641('0x30')]=_[_0x5641('0x44')](_0x337b65['model'],qs[_0x5641('0x31')](_0x59cdd7[_0x5641('0x2d')][_0x5641('0x31')]));_0x24513e[_0x5641('0x30')]=_0x24513e['attributes'][_0x5641('0x32')]?_0x24513e[_0x5641('0x30')]:_0x337b65[_0x5641('0x2c')];if(_0x59cdd7['query']['includeAll']){_0x24513e[_0x5641('0x3d')]=[{'all':!![]}];}_0x24513e=_['merge']({},_0x24513e,_0x59cdd7[_0x5641('0x3b')]);return db[_0x5641('0x2a')][_0x5641('0x45')](_0x24513e)[_0x5641('0x25')](handleEntityNotFound(_0x997cb6,null))[_0x5641('0x25')](respondWithResult(_0x997cb6,null))[_0x5641('0x40')](handleError(_0x997cb6,null));};exports['create']=function(_0x28b0fc,_0x3202dc){return db[_0x5641('0x2a')][_0x5641('0x46')](_0x28b0fc[_0x5641('0x47')],{})[_0x5641('0x25')](respondWithResult(_0x3202dc,0xc9))[_0x5641('0x40')](handleError(_0x3202dc,null));};exports['update']=function(_0x1aa40f,_0x1ebb8c){if(_0x1aa40f[_0x5641('0x47')]['id']){delete _0x1aa40f['body']['id'];}return db[_0x5641('0x2a')][_0x5641('0x45')]({'where':{'id':_0x1aa40f[_0x5641('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ebb8c,null))[_0x5641('0x25')](saveUpdates(_0x1aa40f[_0x5641('0x47')],null))['then'](respondWithResult(_0x1ebb8c,null))[_0x5641('0x40')](handleError(_0x1ebb8c,null));};exports['destroy']=function(_0x2ca986,_0x5605e1){return db[_0x5641('0x2a')]['find']({'where':{'id':_0x2ca986[_0x5641('0x42')]['id']}})[_0x5641('0x25')](handleEntityNotFound(_0x5605e1,null))[_0x5641('0x25')](removeEntity(_0x5605e1,null))[_0x5641('0x40')](handleError(_0x5605e1,null));};exports[_0x5641('0x48')]=function(_0x3421f5,_0x3783b2){return db[_0x5641('0x2a')][_0x5641('0x48')]()[_0x5641('0x25')](respondWithResult(_0x3783b2,null))[_0x5641('0x40')](handleError(_0x3783b2,null));}; \ No newline at end of file +var _0xc87d=['include','findAll','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xc87d,0xa6));var _0xdc87=function(_0x2696ec,_0x11a87f){_0x2696ec=_0x2696ec-0x0;var _0x1af23a=_0xc87d[_0x2696ec];return _0x1af23a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc87('0x0'));var zipdir=require(_0xdc87('0x1'));var jsonpatch=require(_0xdc87('0x2'));var rp=require(_0xdc87('0x3'));var moment=require('moment');var BPromise=require(_0xdc87('0x4'));var Mustache=require(_0xdc87('0x5'));var util=require(_0xdc87('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdc87('0x7'));var ejs=require(_0xdc87('0x8'));var fs=require('fs');var fs_extra=require(_0xdc87('0x9'));var _=require(_0xdc87('0xa'));var squel=require(_0xdc87('0xb'));var crypto=require(_0xdc87('0xc'));var jsforce=require(_0xdc87('0xd'));var deskjs=require(_0xdc87('0xe'));var toCsv=require(_0xdc87('0x7'));var querystring=require(_0xdc87('0xf'));var Papa=require(_0xdc87('0x10'));var Redis=require(_0xdc87('0x11'));var authService=require(_0xdc87('0x12'));var qs=require(_0xdc87('0x13'));var as=require(_0xdc87('0x14'));var hardwareService=require(_0xdc87('0x15'));var logger=require('../../config/logger')(_0xdc87('0x16'));var utils=require(_0xdc87('0x17'));var config=require(_0xdc87('0x18'));var licenseUtil=require(_0xdc87('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x630c05,_0x112bbe){_0x112bbe=_0x112bbe||0xcc;return function(_0x43e2a6){if(_0x43e2a6){return _0x630c05[_0xdc87('0x1a')](_0x112bbe);}return _0x630c05[_0xdc87('0x1b')](_0x112bbe)['end']();};}function respondWithResult(_0x15270f,_0x21fa81){_0x21fa81=_0x21fa81||0xc8;return function(_0x3ab24e){if(_0x3ab24e){return _0x15270f['status'](_0x21fa81)[_0xdc87('0x1c')](_0x3ab24e);}};}function respondWithFilteredResult(_0xb94145,_0x43f0cb){return function(_0xb2b678){if(_0xb2b678){var _0x3ff9fd=typeof _0x43f0cb[_0xdc87('0x1d')]===_0xdc87('0x1e')&&typeof _0x43f0cb[_0xdc87('0x1f')]===_0xdc87('0x1e');var _0x541224=_0xb2b678[_0xdc87('0x20')];var _0x1aa997=_0x3ff9fd?0x0:_0x43f0cb[_0xdc87('0x1d')];var _0x22648b=_0x3ff9fd?_0xb2b678[_0xdc87('0x20')]:_0x43f0cb['offset']+_0x43f0cb[_0xdc87('0x1f')];var _0xe80798;if(_0x22648b>=_0x541224){_0x22648b=_0x541224;_0xe80798=0xc8;}else{_0xe80798=0xce;}_0xb94145[_0xdc87('0x1b')](_0xe80798);return _0xb94145[_0xdc87('0x21')](_0xdc87('0x22'),_0x1aa997+'-'+_0x22648b+'/'+_0x541224)['json'](_0xb2b678);}return null;};}function patchUpdates(_0xa3a9d9){return function(_0x3a29dc){try{jsonpatch[_0xdc87('0x23')](_0x3a29dc,_0xa3a9d9,!![]);}catch(_0x2c5ffa){return BPromise['reject'](_0x2c5ffa);}return _0x3a29dc[_0xdc87('0x24')]();};}function saveUpdates(_0x207f36,_0x58d313){return function(_0x209e99){if(_0x209e99){return _0x209e99[_0xdc87('0x25')](_0x207f36)[_0xdc87('0x26')](function(_0x717c7){return _0x717c7;});}return null;};}function removeEntity(_0x10fc57,_0x1d19d0){return function(_0x56398a){if(_0x56398a){return _0x56398a[_0xdc87('0x27')]()[_0xdc87('0x26')](function(){_0x10fc57[_0xdc87('0x1b')](0xcc)[_0xdc87('0x28')]();});}};}function handleEntityNotFound(_0x46df9e,_0x294775){return function(_0x52c9a7){if(!_0x52c9a7){_0x46df9e[_0xdc87('0x1a')](0x194);}return _0x52c9a7;};}function handleError(_0x2d0824,_0x1e81d9){_0x1e81d9=_0x1e81d9||0x1f4;return function(_0x278291){logger[_0xdc87('0x29')](_0x278291[_0xdc87('0x2a')]);if(_0x278291[_0xdc87('0x2b')]){delete _0x278291[_0xdc87('0x2b')];}_0x2d0824[_0xdc87('0x1b')](_0x1e81d9)[_0xdc87('0x2c')](_0x278291);};}exports['index']=function(_0x5a526f,_0x4c59b8){var _0x1a5723={},_0x47e895={},_0x88a94c={'count':0x0,'rows':[]};var _0x2fea44=_[_0xdc87('0x2d')](db[_0xdc87('0x2e')][_0xdc87('0x2f')],function(_0x38cdd5){return{'name':_0x38cdd5[_0xdc87('0x30')],'type':_0x38cdd5[_0xdc87('0x31')][_0xdc87('0x32')]};});_0x47e895[_0xdc87('0x33')]=_[_0xdc87('0x2d')](_0x2fea44,'name');_0x47e895[_0xdc87('0x34')]=_[_0xdc87('0x35')](_0x5a526f[_0xdc87('0x34')]);_0x47e895[_0xdc87('0x36')]=_[_0xdc87('0x37')](_0x47e895[_0xdc87('0x33')],_0x47e895[_0xdc87('0x34')]);_0x1a5723[_0xdc87('0x38')]=_['intersection'](_0x47e895[_0xdc87('0x33')],qs[_0xdc87('0x39')](_0x5a526f[_0xdc87('0x34')]['fields']));_0x1a5723[_0xdc87('0x38')]=_0x1a5723[_0xdc87('0x38')]['length']?_0x1a5723[_0xdc87('0x38')]:_0x47e895[_0xdc87('0x33')];if(!_0x5a526f[_0xdc87('0x34')][_0xdc87('0x3a')](_0xdc87('0x3b'))){_0x1a5723[_0xdc87('0x1f')]=qs['limit'](_0x5a526f['query'][_0xdc87('0x1f')]);_0x1a5723[_0xdc87('0x1d')]=qs[_0xdc87('0x1d')](_0x5a526f['query'][_0xdc87('0x1d')]);}_0x1a5723[_0xdc87('0x3c')]=qs[_0xdc87('0x3d')](_0x5a526f[_0xdc87('0x34')][_0xdc87('0x3d')]);_0x1a5723[_0xdc87('0x3e')]=qs[_0xdc87('0x36')](_[_0xdc87('0x3f')](_0x5a526f['query'],_0x47e895[_0xdc87('0x36')]),_0x2fea44);if(_0x5a526f['query'][_0xdc87('0x40')]){_0x1a5723['where']=_[_0xdc87('0x41')](_0x1a5723[_0xdc87('0x3e')],{'$or':_[_0xdc87('0x2d')](_0x2fea44,function(_0x32092a){if(_0x32092a[_0xdc87('0x31')]!==_0xdc87('0x42')){var _0x4dba88={};_0x4dba88[_0x32092a['name']]={'$like':'%'+_0x5a526f[_0xdc87('0x34')][_0xdc87('0x40')]+'%'};return _0x4dba88;}})});}_0x1a5723=_[_0xdc87('0x41')]({},_0x1a5723,_0x5a526f['options']);var _0x2abc0e={'where':_0x1a5723['where']};return db[_0xdc87('0x2e')][_0xdc87('0x20')](_0x2abc0e)[_0xdc87('0x26')](function(_0x16fad3){_0x88a94c[_0xdc87('0x20')]=_0x16fad3;if(_0x5a526f[_0xdc87('0x34')][_0xdc87('0x43')]){_0x1a5723[_0xdc87('0x44')]=[{'all':!![]}];}return db[_0xdc87('0x2e')][_0xdc87('0x45')](_0x1a5723);})[_0xdc87('0x26')](function(_0x49e5df){_0x88a94c['rows']=_0x49e5df;return _0x88a94c;})['then'](respondWithFilteredResult(_0x4c59b8,_0x1a5723))[_0xdc87('0x46')](handleError(_0x4c59b8,null));};exports[_0xdc87('0x47')]=function(_0x2517e2,_0xa4e60e){var _0x4b328b={'raw':![],'where':{'id':_0x2517e2[_0xdc87('0x48')]['id']}},_0x396140={};_0x396140['model']=_[_0xdc87('0x35')](db['IntegrationReport'][_0xdc87('0x2f')]);_0x396140[_0xdc87('0x34')]=_['keys'](_0x2517e2['query']);_0x396140['filters']=_[_0xdc87('0x37')](_0x396140[_0xdc87('0x33')],_0x396140[_0xdc87('0x34')]);_0x4b328b[_0xdc87('0x38')]=_[_0xdc87('0x37')](_0x396140[_0xdc87('0x33')],qs[_0xdc87('0x39')](_0x2517e2[_0xdc87('0x34')][_0xdc87('0x39')]));_0x4b328b['attributes']=_0x4b328b[_0xdc87('0x38')][_0xdc87('0x49')]?_0x4b328b[_0xdc87('0x38')]:_0x396140[_0xdc87('0x33')];if(_0x2517e2[_0xdc87('0x34')][_0xdc87('0x43')]){_0x4b328b[_0xdc87('0x44')]=[{'all':!![]}];}_0x4b328b=_['merge']({},_0x4b328b,_0x2517e2['options']);return db[_0xdc87('0x2e')][_0xdc87('0x4a')](_0x4b328b)[_0xdc87('0x26')](handleEntityNotFound(_0xa4e60e,null))[_0xdc87('0x26')](respondWithResult(_0xa4e60e,null))[_0xdc87('0x46')](handleError(_0xa4e60e,null));};exports[_0xdc87('0x4b')]=function(_0x44c944,_0x504b29){return db[_0xdc87('0x2e')][_0xdc87('0x4b')](_0x44c944['body'],{})[_0xdc87('0x26')](respondWithResult(_0x504b29,0xc9))['catch'](handleError(_0x504b29,null));};exports[_0xdc87('0x25')]=function(_0x40bd36,_0x52e0d1){if(_0x40bd36[_0xdc87('0x4c')]['id']){delete _0x40bd36[_0xdc87('0x4c')]['id'];}return db[_0xdc87('0x2e')][_0xdc87('0x4a')]({'where':{'id':_0x40bd36[_0xdc87('0x48')]['id']}})[_0xdc87('0x26')](handleEntityNotFound(_0x52e0d1,null))[_0xdc87('0x26')](saveUpdates(_0x40bd36[_0xdc87('0x4c')],null))[_0xdc87('0x26')](respondWithResult(_0x52e0d1,null))['catch'](handleError(_0x52e0d1,null));};exports[_0xdc87('0x27')]=function(_0x4a4b88,_0x2adc53){return db[_0xdc87('0x2e')][_0xdc87('0x4a')]({'where':{'id':_0x4a4b88[_0xdc87('0x48')]['id']}})[_0xdc87('0x26')](handleEntityNotFound(_0x2adc53,null))[_0xdc87('0x26')](removeEntity(_0x2adc53,null))[_0xdc87('0x46')](handleError(_0x2adc53,null));};exports[_0xdc87('0x4d')]=function(_0x2b5516,_0x5152c3){return db[_0xdc87('0x2e')]['describe']()[_0xdc87('0x26')](respondWithResult(_0x5152c3,null))[_0xdc87('0x46')](handleError(_0x5152c3,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 38db8ba..378f15a 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 _0xd250=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','util'];(function(_0x172478,_0x1c736d){var _0x574ce1=function(_0x551aae){while(--_0x551aae){_0x172478['push'](_0x172478['shift']());}};_0x574ce1(++_0x1c736d);}(_0xd250,0x1da));var _0x0d25=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xd250[_0x434783];return _0x13efcf;};'use strict';var _=require(_0x0d25('0x0'));var util=require(_0x0d25('0x1'));var logger=require(_0x0d25('0x2'))(_0x0d25('0x3'));var moment=require(_0x0d25('0x4'));var BPromise=require(_0x0d25('0x5'));var rp=require(_0x0d25('0x6'));var fs=require('fs');var path=require(_0x0d25('0x7'));var rimraf=require(_0x0d25('0x8'));var config=require(_0x0d25('0x9'));var attributes=require(_0x0d25('0xa'));module[_0x0d25('0xb')]=function(_0x1a8f03,_0x2f0718){return _0x1a8f03[_0x0d25('0xc')]('IntegrationReport',attributes,{'tableName':_0x0d25('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f17=['define','IntegrationReport','report_integration','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8f17,0x117));var _0x78f1=function(_0xd10b43,_0x440ec1){_0xd10b43=_0xd10b43-0x0;var _0x369090=_0x8f17[_0xd10b43];return _0x369090;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x78f1('0x0'))(_0x78f1('0x1'));var moment=require(_0x78f1('0x2'));var BPromise=require(_0x78f1('0x3'));var rp=require(_0x78f1('0x4'));var fs=require('fs');var path=require(_0x78f1('0x5'));var rimraf=require(_0x78f1('0x6'));var config=require(_0x78f1('0x7'));var attributes=require('./integrationReport.attributes');module[_0x78f1('0x8')]=function(_0xd9944a,_0x4b48f4){return _0xd9944a[_0x78f1('0x9')](_0x78f1('0xa'),attributes,{'tableName':_0x78f1('0xb'),'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 e25f134..cd4d1a0 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +var _0x2542=['info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x12db54,_0x5c9204){var _0x91423b=function(_0x388561){while(--_0x388561){_0x12db54['push'](_0x12db54['shift']());}};_0x91423b(++_0x5c9204);}(_0x2542,0x169));var _0x2254=function(_0x3b06dd,_0xb782f){_0x3b06dd=_0x3b06dd-0x0;var _0x268997=_0x2542[_0x3b06dd];return _0x268997;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 8b6a7f4..e64d1c2 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 _0x7b27=['isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./interval.controller','get'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x7b27,0x186));var _0x77b2=function(_0xc2c01d,_0x4fab5c){_0xc2c01d=_0xc2c01d-0x0;var _0x157abd=_0x7b27[_0xc2c01d];return _0x157abd;};'use strict';var multer=require(_0x77b2('0x0'));var util=require('util');var path=require(_0x77b2('0x1'));var timeout=require(_0x77b2('0x2'));var express=require(_0x77b2('0x3'));var router=express[_0x77b2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x77b2('0x5'));var interaction=require(_0x77b2('0x6'));var config=require('../../config/environment');var controller=require(_0x77b2('0x7'));router[_0x77b2('0x8')]('/',auth[_0x77b2('0x9')](),controller['index']);router[_0x77b2('0x8')](_0x77b2('0xa'),auth[_0x77b2('0x9')](),controller[_0x77b2('0xb')]);router['get'](_0x77b2('0xc'),auth[_0x77b2('0x9')](),controller[_0x77b2('0xd')]);router[_0x77b2('0xe')]('/',auth[_0x77b2('0x9')](),controller[_0x77b2('0xf')]);router[_0x77b2('0xe')](_0x77b2('0xc'),auth['isAuthenticated'](),controller[_0x77b2('0x10')]);router[_0x77b2('0xe')]('/:id/sub_intervals/create_many',auth[_0x77b2('0x9')](),controller['addIntervals']);router[_0x77b2('0x11')](_0x77b2('0xa'),auth['isAuthenticated'](),controller[_0x77b2('0x12')]);router['delete'](_0x77b2('0xa'),auth[_0x77b2('0x9')](),controller[_0x77b2('0x13')]);module[_0x77b2('0x14')]=router; \ No newline at end of file +var _0xc2b2=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xc2b2,0xd3));var _0x2c2b=function(_0x33fe71,_0x3438e6){_0x33fe71=_0x33fe71-0x0;var _0x2a2740=_0xc2b2[_0x33fe71];return _0x2a2740;};'use strict';var multer=require(_0x2c2b('0x0'));var util=require(_0x2c2b('0x1'));var path=require(_0x2c2b('0x2'));var timeout=require(_0x2c2b('0x3'));var express=require(_0x2c2b('0x4'));var router=express[_0x2c2b('0x5')]();var fs_extra=require(_0x2c2b('0x6'));var auth=require(_0x2c2b('0x7'));var interaction=require(_0x2c2b('0x8'));var config=require('../../config/environment');var controller=require(_0x2c2b('0x9'));router[_0x2c2b('0xa')]('/',auth[_0x2c2b('0xb')](),controller[_0x2c2b('0xc')]);router[_0x2c2b('0xa')]('/:id',auth[_0x2c2b('0xb')](),controller[_0x2c2b('0xd')]);router['get'](_0x2c2b('0xe'),auth[_0x2c2b('0xb')](),controller[_0x2c2b('0xf')]);router[_0x2c2b('0x10')]('/',auth[_0x2c2b('0xb')](),controller[_0x2c2b('0x11')]);router[_0x2c2b('0x10')]('/:id/sub_intervals',auth[_0x2c2b('0xb')](),controller[_0x2c2b('0x12')]);router[_0x2c2b('0x10')](_0x2c2b('0x13'),auth[_0x2c2b('0xb')](),controller[_0x2c2b('0x14')]);router[_0x2c2b('0x15')]('/:id',auth[_0x2c2b('0xb')](),controller[_0x2c2b('0x16')]);router[_0x2c2b('0x17')]('/:id',auth[_0x2c2b('0xb')](),controller[_0x2c2b('0x18')]);module[_0x2c2b('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index b5b403a..d0c2327 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 _0xdd17=['sequelize','STRING'];(function(_0x4c8e59,_0x39016e){var _0x124f73=function(_0x1357c2){while(--_0x1357c2){_0x4c8e59['push'](_0x4c8e59['shift']());}};_0x124f73(++_0x39016e);}(_0xdd17,0x112));var _0x7dd1=function(_0x1e7777,_0x4874d3){_0x1e7777=_0x1e7777-0x0;var _0x21eaca=_0xdd17[_0x1e7777];return _0x21eaca;};'use strict';var Sequelize=require(_0x7dd1('0x0'));module['exports']={'name':{'type':Sequelize[_0x7dd1('0x1')]},'description':{'type':Sequelize[_0x7dd1('0x1')]},'interval':{'type':Sequelize[_0x7dd1('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xd7e0=['exports','STRING','sequelize'];(function(_0x13ef0c,_0xb65fd5){var _0xd9a2fc=function(_0xa7204a){while(--_0xa7204a){_0x13ef0c['push'](_0x13ef0c['shift']());}};_0xd9a2fc(++_0xb65fd5);}(_0xd7e0,0x15e));var _0x0d7e=function(_0x216bc8,_0x33d5cb){_0x216bc8=_0x216bc8-0x0;var _0x5cb355=_0xd7e0[_0x216bc8];return _0x5cb355;};'use strict';var Sequelize=require(_0x0d7e('0x0'));module[_0x0d7e('0x1')]={'name':{'type':Sequelize[_0x0d7e('0x2')]},'description':{'type':Sequelize[_0x0d7e('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 2ba996e..617fec4 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 _0xb291=['name','send','map','Interval','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','sequelize','transaction','findAll','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','end','stack'];(function(_0x165d3c,_0x3ba20d){var _0xc27339=function(_0x1f279f){while(--_0x1f279f){_0x165d3c['push'](_0x165d3c['shift']());}};_0xc27339(++_0x3ba20d);}(_0xb291,0xe4));var _0x1b29=function(_0x464cee,_0x302661){_0x464cee=_0x464cee-0x0;var _0x1f6d44=_0xb291[_0x464cee];return _0x1f6d44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b29('0x0'));var zipdir=require(_0x1b29('0x1'));var jsonpatch=require(_0x1b29('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b29('0x3'));var path=require(_0x1b29('0x4'));var sox=require(_0x1b29('0x5'));var csv=require(_0x1b29('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b29('0x7'));var _=require(_0x1b29('0x8'));var squel=require(_0x1b29('0x9'));var crypto=require(_0x1b29('0xa'));var jsforce=require(_0x1b29('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1b29('0x6'));var querystring=require(_0x1b29('0xc'));var Papa=require(_0x1b29('0xd'));var Redis=require('ioredis');var authService=require(_0x1b29('0xe'));var qs=require(_0x1b29('0xf'));var as=require(_0x1b29('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b29('0x11'))(_0x1b29('0x12'));var utils=require(_0x1b29('0x13'));var config=require(_0x1b29('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b29('0x15'))['db'];var extensions=require(_0x1b29('0x16'));function respondWithStatusCode(_0xc756a4,_0x523d2f){_0x523d2f=_0x523d2f||0xcc;return function(_0x3369c0){if(_0x3369c0){return _0xc756a4[_0x1b29('0x17')](_0x523d2f);}return _0xc756a4[_0x1b29('0x18')](_0x523d2f)['end']();};}function respondWithResult(_0x58bb8f,_0x35094b){_0x35094b=_0x35094b||0xc8;return function(_0x2dc7d6){if(_0x2dc7d6){return _0x58bb8f[_0x1b29('0x18')](_0x35094b)[_0x1b29('0x19')](_0x2dc7d6);}};}function respondWithFilteredResult(_0x26762a,_0x10232d){return function(_0x524f9c){if(_0x524f9c){var _0x241426=typeof _0x10232d['offset']===_0x1b29('0x1a')&&typeof _0x10232d['limit']===_0x1b29('0x1a');var _0x4acc8c=_0x524f9c['count'];var _0xcaad2b=_0x241426?0x0:_0x10232d[_0x1b29('0x1b')];var _0x32c2b6=_0x241426?_0x524f9c[_0x1b29('0x1c')]:_0x10232d['offset']+_0x10232d[_0x1b29('0x1d')];var _0x5bbdf6;if(_0x32c2b6>=_0x4acc8c){_0x32c2b6=_0x4acc8c;_0x5bbdf6=0xc8;}else{_0x5bbdf6=0xce;}_0x26762a['status'](_0x5bbdf6);return _0x26762a[_0x1b29('0x1e')](_0x1b29('0x1f'),_0xcaad2b+'-'+_0x32c2b6+'/'+_0x4acc8c)[_0x1b29('0x19')](_0x524f9c);}return null;};}function patchUpdates(_0x40fcf2){return function(_0x5e5541){try{jsonpatch[_0x1b29('0x20')](_0x5e5541,_0x40fcf2,!![]);}catch(_0x431476){return BPromise['reject'](_0x431476);}return _0x5e5541[_0x1b29('0x21')]();};}function saveUpdates(_0x3aabe4,_0x2b7fc9){return function(_0x56892c){if(_0x56892c){return _0x56892c[_0x1b29('0x22')](_0x3aabe4)[_0x1b29('0x23')](function(_0x494457){return _0x494457;});}return null;};}function removeEntity(_0x56f9a9,_0x41b3cd){return function(_0x58e102){if(_0x58e102){return _0x58e102[_0x1b29('0x24')]()['then'](function(){var _0x11f2b5=_0x58e102[_0x1b29('0x25')]({'plain':!![]});var _0x5a04a1=_0x1b29('0x26');return db[_0x1b29('0x27')][_0x1b29('0x24')]({'where':{'type':_0x5a04a1,'resourceId':_0x11f2b5['id']}})['then'](function(){return _0x58e102;});})[_0x1b29('0x23')](function(){_0x56f9a9[_0x1b29('0x18')](0xcc)[_0x1b29('0x28')]();});}};}function handleEntityNotFound(_0x2ef6f0,_0x2a23ec){return function(_0x571c7e){if(!_0x571c7e){_0x2ef6f0[_0x1b29('0x17')](0x194);}return _0x571c7e;};}function handleError(_0x41366d,_0x2a9bed){_0x2a9bed=_0x2a9bed||0x1f4;return function(_0x14951b){logger['error'](_0x14951b[_0x1b29('0x29')]);if(_0x14951b[_0x1b29('0x2a')]){delete _0x14951b[_0x1b29('0x2a')];}_0x41366d[_0x1b29('0x18')](_0x2a9bed)[_0x1b29('0x2b')](_0x14951b);};}exports['index']=function(_0x2d31c8,_0x3dc76a){var _0x2967aa={},_0x293f5e={},_0x5e9148={'count':0x0,'rows':[]};var _0x1ed5f2=_[_0x1b29('0x2c')](db[_0x1b29('0x2d')][_0x1b29('0x2e')],function(_0x3e01b2){return{'name':_0x3e01b2[_0x1b29('0x2f')],'type':_0x3e01b2[_0x1b29('0x30')][_0x1b29('0x31')]};});_0x293f5e['model']=_['map'](_0x1ed5f2,_0x1b29('0x2a'));_0x293f5e[_0x1b29('0x32')]=_['keys'](_0x2d31c8['query']);_0x293f5e[_0x1b29('0x33')]=_[_0x1b29('0x34')](_0x293f5e[_0x1b29('0x35')],_0x293f5e[_0x1b29('0x32')]);_0x2967aa[_0x1b29('0x36')]=_[_0x1b29('0x34')](_0x293f5e[_0x1b29('0x35')],qs[_0x1b29('0x37')](_0x2d31c8['query'][_0x1b29('0x37')]));_0x2967aa['attributes']=_0x2967aa[_0x1b29('0x36')][_0x1b29('0x38')]?_0x2967aa[_0x1b29('0x36')]:_0x293f5e[_0x1b29('0x35')];if(!_0x2d31c8[_0x1b29('0x32')][_0x1b29('0x39')](_0x1b29('0x3a'))){_0x2967aa[_0x1b29('0x1d')]=qs[_0x1b29('0x1d')](_0x2d31c8[_0x1b29('0x32')]['limit']);_0x2967aa[_0x1b29('0x1b')]=qs[_0x1b29('0x1b')](_0x2d31c8['query'][_0x1b29('0x1b')]);}_0x2967aa['order']=qs[_0x1b29('0x3b')](_0x2d31c8[_0x1b29('0x32')]['sort']);_0x2967aa[_0x1b29('0x3c')]=qs[_0x1b29('0x33')](_[_0x1b29('0x3d')](_0x2d31c8['query'],_0x293f5e[_0x1b29('0x33')]),_0x1ed5f2);if(_0x2d31c8[_0x1b29('0x32')][_0x1b29('0x3e')]){_0x2967aa[_0x1b29('0x3c')]=_[_0x1b29('0x3f')](_0x2967aa['where'],{'$or':_[_0x1b29('0x2c')](_0x1ed5f2,function(_0x35e2b8){if(_0x35e2b8[_0x1b29('0x30')]!=='VIRTUAL'){var _0x423d33={};_0x423d33[_0x35e2b8['name']]={'$like':'%'+_0x2d31c8[_0x1b29('0x32')]['filter']+'%'};return _0x423d33;}})});}_0x2967aa=_[_0x1b29('0x3f')]({},_0x2967aa,_0x2d31c8[_0x1b29('0x40')]);var _0x2628fc={'where':_0x2967aa[_0x1b29('0x3c')]};return db[_0x1b29('0x2d')][_0x1b29('0x1c')](_0x2628fc)[_0x1b29('0x23')](function(_0x3cd81b){_0x5e9148['count']=_0x3cd81b;if(_0x2d31c8['query'][_0x1b29('0x41')]){_0x2967aa[_0x1b29('0x42')]=[{'all':!![]}];}return db[_0x1b29('0x2d')]['findAll'](_0x2967aa);})[_0x1b29('0x23')](function(_0x4d7005){_0x5e9148['rows']=_0x4d7005;return _0x5e9148;})['then'](respondWithFilteredResult(_0x3dc76a,_0x2967aa))[_0x1b29('0x43')](handleError(_0x3dc76a,null));};exports[_0x1b29('0x44')]=function(_0x180cab,_0x2664fd){var _0x3f953a={'raw':!![],'where':{'id':_0x180cab[_0x1b29('0x45')]['id']}},_0x9f44ae={};_0x9f44ae['model']=_[_0x1b29('0x46')](db[_0x1b29('0x2d')][_0x1b29('0x2e')]);_0x9f44ae['query']=_[_0x1b29('0x46')](_0x180cab[_0x1b29('0x32')]);_0x9f44ae[_0x1b29('0x33')]=_[_0x1b29('0x34')](_0x9f44ae[_0x1b29('0x35')],_0x9f44ae[_0x1b29('0x32')]);_0x3f953a['attributes']=_['intersection'](_0x9f44ae[_0x1b29('0x35')],qs[_0x1b29('0x37')](_0x180cab[_0x1b29('0x32')][_0x1b29('0x37')]));_0x3f953a[_0x1b29('0x36')]=_0x3f953a[_0x1b29('0x36')][_0x1b29('0x38')]?_0x3f953a[_0x1b29('0x36')]:_0x9f44ae[_0x1b29('0x35')];if(_0x180cab['query'][_0x1b29('0x41')]){_0x3f953a['include']=[{'all':!![]}];}_0x3f953a=_[_0x1b29('0x3f')]({},_0x3f953a,_0x180cab[_0x1b29('0x40')]);return db[_0x1b29('0x2d')][_0x1b29('0x47')](_0x3f953a)[_0x1b29('0x23')](handleEntityNotFound(_0x2664fd,null))[_0x1b29('0x23')](respondWithResult(_0x2664fd,null))[_0x1b29('0x43')](handleError(_0x2664fd,null));};exports['create']=function(_0x1004eb,_0x556d96){return db['Interval'][_0x1b29('0x48')](_0x1004eb[_0x1b29('0x49')],{})[_0x1b29('0x23')](function(_0x1f054b){var _0x48cef2=_0x1004eb[_0x1b29('0x4a')]['get']({'plain':!![]});if(!_0x48cef2)throw new Error(_0x1b29('0x4b'));if(_0x48cef2[_0x1b29('0x4c')]===_0x1b29('0x4a')){var _0x56ec89=_0x1f054b['get']({'plain':!![]});var _0x4b5fd7=_0x1b29('0x26');return db[_0x1b29('0x4d')][_0x1b29('0x47')]({'where':{'name':_0x4b5fd7,'userProfileId':_0x48cef2[_0x1b29('0x4e')]},'raw':!![]})['then'](function(_0x3f48d5){if(_0x3f48d5&&_0x3f48d5[_0x1b29('0x4f')]===0x0){return db[_0x1b29('0x27')][_0x1b29('0x48')]({'name':_0x56ec89[_0x1b29('0x2a')],'resourceId':_0x56ec89['id'],'type':_0x3f48d5[_0x1b29('0x2a')],'sectionId':_0x3f48d5['id']},{})['then'](function(){return _0x1f054b;});}else{return _0x1f054b;}})[_0x1b29('0x43')](function(_0xbabdf1){logger['error'](_0x1b29('0x50'),_0xbabdf1);throw _0xbabdf1;});}return _0x1f054b;})[_0x1b29('0x23')](respondWithResult(_0x556d96,0xc9))['catch'](handleError(_0x556d96,null));};exports[_0x1b29('0x22')]=function(_0x4bbd54,_0x13c712){if(_0x4bbd54[_0x1b29('0x49')]['id']){delete _0x4bbd54['body']['id'];}return db[_0x1b29('0x2d')][_0x1b29('0x47')]({'where':{'id':_0x4bbd54[_0x1b29('0x45')]['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x13c712,null))[_0x1b29('0x23')](saveUpdates(_0x4bbd54['body'],null))[_0x1b29('0x23')](respondWithResult(_0x13c712,null))['catch'](handleError(_0x13c712,null));};exports[_0x1b29('0x24')]=function(_0x1a22fb,_0x4156b1){return db[_0x1b29('0x2d')][_0x1b29('0x47')]({'where':{'id':_0x1a22fb[_0x1b29('0x45')]['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x4156b1,null))[_0x1b29('0x23')](removeEntity(_0x4156b1,null))[_0x1b29('0x43')](handleError(_0x4156b1,null));};exports[_0x1b29('0x51')]=function(_0x3a7ad8,_0x5d7ac4,_0x5c734c){if(_0x3a7ad8[_0x1b29('0x49')]['id']){delete _0x3a7ad8[_0x1b29('0x49')]['id'];}return db[_0x1b29('0x2d')][_0x1b29('0x47')]({'where':{'id':_0x3a7ad8[_0x1b29('0x45')]['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x5d7ac4,null))['then'](function(_0x464042){if(_0x464042){_0x3a7ad8[_0x1b29('0x49')][_0x1b29('0x52')]=_0x464042['id'];return db[_0x1b29('0x2d')][_0x1b29('0x48')](_0x3a7ad8[_0x1b29('0x49')]);}})[_0x1b29('0x23')](respondWithResult(_0x5d7ac4,null))[_0x1b29('0x43')](handleError(_0x5d7ac4,null));};exports[_0x1b29('0x53')]=function(_0x3cdb08,_0x3ca87c,_0x28ca22){var _0x586c1c={};var _0x4bc446={};var _0x12a1c3;var _0x283184;return db[_0x1b29('0x2d')][_0x1b29('0x54')]({'where':{'id':_0x3cdb08['params']['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x3ca87c,null))['then'](function(_0x39891c){if(_0x39891c){_0x12a1c3=_0x39891c;_0x4bc446[_0x1b29('0x35')]=_[_0x1b29('0x46')](db[_0x1b29('0x2d')][_0x1b29('0x2e')]);_0x4bc446[_0x1b29('0x32')]=_[_0x1b29('0x46')](_0x3cdb08[_0x1b29('0x32')]);_0x4bc446[_0x1b29('0x33')]=_[_0x1b29('0x34')](_0x4bc446[_0x1b29('0x35')],_0x4bc446['query']);_0x586c1c[_0x1b29('0x36')]=_[_0x1b29('0x34')](_0x4bc446['model'],qs[_0x1b29('0x37')](_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x37')]));_0x586c1c[_0x1b29('0x36')]=_0x586c1c[_0x1b29('0x36')][_0x1b29('0x38')]?_0x586c1c[_0x1b29('0x36')]:_0x4bc446[_0x1b29('0x35')];_0x586c1c[_0x1b29('0x55')]=qs[_0x1b29('0x3b')](_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x3b')]);_0x586c1c[_0x1b29('0x3c')]=qs[_0x1b29('0x33')](_[_0x1b29('0x3d')](_0x3cdb08[_0x1b29('0x32')],_0x4bc446[_0x1b29('0x33')]));if(_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x3e')]){_0x586c1c[_0x1b29('0x3c')]=_[_0x1b29('0x3f')](_0x586c1c[_0x1b29('0x3c')],{'$or':_['map'](_0x586c1c[_0x1b29('0x36')],function(_0x11247a){var _0x29d633={};_0x29d633[_0x11247a]={'$like':'%'+_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x3e')]+'%'};return _0x29d633;})});}_0x586c1c=_[_0x1b29('0x3f')]({},_0x586c1c,_0x3cdb08['options']);return _0x12a1c3[_0x1b29('0x53')](_0x586c1c);}})[_0x1b29('0x23')](function(_0x2a6c78){if(_0x2a6c78){_0x283184=_0x2a6c78[_0x1b29('0x38')];if(!_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x39')](_0x1b29('0x3a'))){_0x586c1c['limit']=qs['limit'](_0x3cdb08['query'][_0x1b29('0x1d')]);_0x586c1c[_0x1b29('0x1b')]=qs['offset'](_0x3cdb08[_0x1b29('0x32')][_0x1b29('0x1b')]);}return _0x12a1c3[_0x1b29('0x53')](_0x586c1c);}})[_0x1b29('0x23')](function(_0x38259f){if(_0x38259f){return _0x38259f?{'count':_0x283184,'rows':_0x38259f}:null;}})['then'](respondWithResult(_0x3ca87c,null))[_0x1b29('0x43')](handleError(_0x3ca87c,null));};exports[_0x1b29('0x56')]=function(_0x177920,_0x46d5b3,_0x139a46){return db[_0x1b29('0x2d')][_0x1b29('0x54')]({'where':{'id':_0x177920[_0x1b29('0x45')]['id']}})[_0x1b29('0x23')](handleEntityNotFound(_0x46d5b3,null))[_0x1b29('0x23')](function(_0x5a8593){if(_0x5a8593){return db[_0x1b29('0x57')][_0x1b29('0x58')](function(_0x2948f4){return db['Interval'][_0x1b29('0x24')]({'where':{'IntervalId':_0x177920[_0x1b29('0x45')]['id']},'transaction':_0x2948f4})['then'](function(_0x10275d){var _0x3abc0f=_[_0x1b29('0x2c')](_0x177920['body'],function(_0x33aad2){delete _0x33aad2['id'];_0x33aad2[_0x1b29('0x52')]=_0x177920[_0x1b29('0x45')]['id'];return _0x33aad2;});return db[_0x1b29('0x2d')]['bulkCreate'](_0x3abc0f,{'transaction':_0x2948f4});});})[_0x1b29('0x23')](function(){return db[_0x1b29('0x2d')][_0x1b29('0x59')]({'where':{'IntervalId':_0x177920['params']['id']}});});}})[_0x1b29('0x23')](respondWithResult(_0x46d5b3,null))[_0x1b29('0x43')](handleError(_0x46d5b3,null));}; \ No newline at end of file +var _0xfcd5=['undefined','count','set','Content-Range','apply','save','then','destroy','get','Intervals','UserProfileResource','end','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','IntervalId','getIntervals','findOne','addIntervals','sequelize','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset'];(function(_0x30dec0,_0x483c97){var _0x37d890=function(_0x2ed7f2){while(--_0x2ed7f2){_0x30dec0['push'](_0x30dec0['shift']());}};_0x37d890(++_0x483c97);}(_0xfcd5,0x1a9));var _0x5fcd=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xfcd5[_0x28669c];return _0x4a3af6;};'use strict';var emlformat=require(_0x5fcd('0x0'));var rimraf=require(_0x5fcd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5fcd('0x2'));var rp=require(_0x5fcd('0x3'));var moment=require('moment');var BPromise=require(_0x5fcd('0x4'));var Mustache=require(_0x5fcd('0x5'));var util=require(_0x5fcd('0x6'));var path=require(_0x5fcd('0x7'));var sox=require(_0x5fcd('0x8'));var csv=require(_0x5fcd('0x9'));var ejs=require(_0x5fcd('0xa'));var fs=require('fs');var fs_extra=require(_0x5fcd('0xb'));var _=require(_0x5fcd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5fcd('0xd'));var deskjs=require(_0x5fcd('0xe'));var toCsv=require(_0x5fcd('0x9'));var querystring=require(_0x5fcd('0xf'));var Papa=require(_0x5fcd('0x10'));var Redis=require(_0x5fcd('0x11'));var authService=require(_0x5fcd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5fcd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fcd('0x14'))(_0x5fcd('0x15'));var utils=require(_0x5fcd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5fcd('0x17'));var db=require(_0x5fcd('0x18'))['db'];var extensions=require(_0x5fcd('0x19'));function respondWithStatusCode(_0x3da488,_0x36141d){_0x36141d=_0x36141d||0xcc;return function(_0x17dacf){if(_0x17dacf){return _0x3da488[_0x5fcd('0x1a')](_0x36141d);}return _0x3da488[_0x5fcd('0x1b')](_0x36141d)['end']();};}function respondWithResult(_0x21802e,_0x18207b){_0x18207b=_0x18207b||0xc8;return function(_0xa77d64){if(_0xa77d64){return _0x21802e[_0x5fcd('0x1b')](_0x18207b)[_0x5fcd('0x1c')](_0xa77d64);}};}function respondWithFilteredResult(_0x2be8d5,_0x92fa54){return function(_0xf23f1){if(_0xf23f1){var _0x28af1d=typeof _0x92fa54[_0x5fcd('0x1d')]===_0x5fcd('0x1e')&&typeof _0x92fa54['limit']===_0x5fcd('0x1e');var _0x4f36a3=_0xf23f1[_0x5fcd('0x1f')];var _0x5f578e=_0x28af1d?0x0:_0x92fa54[_0x5fcd('0x1d')];var _0x353cf5=_0x28af1d?_0xf23f1[_0x5fcd('0x1f')]:_0x92fa54['offset']+_0x92fa54['limit'];var _0x5f1332;if(_0x353cf5>=_0x4f36a3){_0x353cf5=_0x4f36a3;_0x5f1332=0xc8;}else{_0x5f1332=0xce;}_0x2be8d5[_0x5fcd('0x1b')](_0x5f1332);return _0x2be8d5[_0x5fcd('0x20')](_0x5fcd('0x21'),_0x5f578e+'-'+_0x353cf5+'/'+_0x4f36a3)['json'](_0xf23f1);}return null;};}function patchUpdates(_0x4f802f){return function(_0x11a570){try{jsonpatch[_0x5fcd('0x22')](_0x11a570,_0x4f802f,!![]);}catch(_0x524d18){return BPromise['reject'](_0x524d18);}return _0x11a570[_0x5fcd('0x23')]();};}function saveUpdates(_0x40048d,_0x54f7e1){return function(_0x5b2d83){if(_0x5b2d83){return _0x5b2d83['update'](_0x40048d)[_0x5fcd('0x24')](function(_0x5b72e8){return _0x5b72e8;});}return null;};}function removeEntity(_0x57956b,_0x1c82aa){return function(_0x4bbdf5){if(_0x4bbdf5){return _0x4bbdf5[_0x5fcd('0x25')]()[_0x5fcd('0x24')](function(){var _0x1d6859=_0x4bbdf5[_0x5fcd('0x26')]({'plain':!![]});var _0x2c50ab=_0x5fcd('0x27');return db[_0x5fcd('0x28')][_0x5fcd('0x25')]({'where':{'type':_0x2c50ab,'resourceId':_0x1d6859['id']}})[_0x5fcd('0x24')](function(){return _0x4bbdf5;});})[_0x5fcd('0x24')](function(){_0x57956b[_0x5fcd('0x1b')](0xcc)[_0x5fcd('0x29')]();});}};}function handleEntityNotFound(_0x511fa1,_0x167fc1){return function(_0x1efd0b){if(!_0x1efd0b){_0x511fa1['sendStatus'](0x194);}return _0x1efd0b;};}function handleError(_0xbbceb5,_0x2dbcee){_0x2dbcee=_0x2dbcee||0x1f4;return function(_0x1703d3){logger['error'](_0x1703d3['stack']);if(_0x1703d3['name']){delete _0x1703d3[_0x5fcd('0x2a')];}_0xbbceb5[_0x5fcd('0x1b')](_0x2dbcee)[_0x5fcd('0x2b')](_0x1703d3);};}exports[_0x5fcd('0x2c')]=function(_0x150e84,_0x5bcff2){var _0x35c76a={},_0x2ab053={},_0x4389e5={'count':0x0,'rows':[]};var _0x5418d9=_[_0x5fcd('0x2d')](db[_0x5fcd('0x2e')][_0x5fcd('0x2f')],function(_0x7e3fc3){return{'name':_0x7e3fc3[_0x5fcd('0x30')],'type':_0x7e3fc3[_0x5fcd('0x31')][_0x5fcd('0x32')]};});_0x2ab053[_0x5fcd('0x33')]=_[_0x5fcd('0x2d')](_0x5418d9,_0x5fcd('0x2a'));_0x2ab053['query']=_[_0x5fcd('0x34')](_0x150e84[_0x5fcd('0x35')]);_0x2ab053[_0x5fcd('0x36')]=_[_0x5fcd('0x37')](_0x2ab053[_0x5fcd('0x33')],_0x2ab053[_0x5fcd('0x35')]);_0x35c76a[_0x5fcd('0x38')]=_[_0x5fcd('0x37')](_0x2ab053[_0x5fcd('0x33')],qs[_0x5fcd('0x39')](_0x150e84[_0x5fcd('0x35')][_0x5fcd('0x39')]));_0x35c76a[_0x5fcd('0x38')]=_0x35c76a[_0x5fcd('0x38')][_0x5fcd('0x3a')]?_0x35c76a['attributes']:_0x2ab053['model'];if(!_0x150e84[_0x5fcd('0x35')][_0x5fcd('0x3b')]('nolimit')){_0x35c76a['limit']=qs[_0x5fcd('0x3c')](_0x150e84['query']['limit']);_0x35c76a[_0x5fcd('0x1d')]=qs[_0x5fcd('0x1d')](_0x150e84[_0x5fcd('0x35')]['offset']);}_0x35c76a[_0x5fcd('0x3d')]=qs[_0x5fcd('0x3e')](_0x150e84[_0x5fcd('0x35')]['sort']);_0x35c76a[_0x5fcd('0x3f')]=qs[_0x5fcd('0x36')](_[_0x5fcd('0x40')](_0x150e84[_0x5fcd('0x35')],_0x2ab053['filters']),_0x5418d9);if(_0x150e84[_0x5fcd('0x35')][_0x5fcd('0x41')]){_0x35c76a[_0x5fcd('0x3f')]=_['merge'](_0x35c76a['where'],{'$or':_[_0x5fcd('0x2d')](_0x5418d9,function(_0x34afea){if(_0x34afea['type']!==_0x5fcd('0x42')){var _0x198d90={};_0x198d90[_0x34afea[_0x5fcd('0x2a')]]={'$like':'%'+_0x150e84['query'][_0x5fcd('0x41')]+'%'};return _0x198d90;}})});}_0x35c76a=_[_0x5fcd('0x43')]({},_0x35c76a,_0x150e84[_0x5fcd('0x44')]);var _0x1d7a85={'where':_0x35c76a['where']};return db[_0x5fcd('0x2e')][_0x5fcd('0x1f')](_0x1d7a85)[_0x5fcd('0x24')](function(_0x4a531c){_0x4389e5[_0x5fcd('0x1f')]=_0x4a531c;if(_0x150e84[_0x5fcd('0x35')][_0x5fcd('0x45')]){_0x35c76a['include']=[{'all':!![]}];}return db['Interval'][_0x5fcd('0x46')](_0x35c76a);})[_0x5fcd('0x24')](function(_0x7f8286){_0x4389e5['rows']=_0x7f8286;return _0x4389e5;})[_0x5fcd('0x24')](respondWithFilteredResult(_0x5bcff2,_0x35c76a))[_0x5fcd('0x47')](handleError(_0x5bcff2,null));};exports[_0x5fcd('0x48')]=function(_0x366a91,_0x534559){var _0x3f2115={'raw':!![],'where':{'id':_0x366a91[_0x5fcd('0x49')]['id']}},_0x1778ea={};_0x1778ea[_0x5fcd('0x33')]=_['keys'](db[_0x5fcd('0x2e')]['rawAttributes']);_0x1778ea[_0x5fcd('0x35')]=_[_0x5fcd('0x34')](_0x366a91[_0x5fcd('0x35')]);_0x1778ea[_0x5fcd('0x36')]=_[_0x5fcd('0x37')](_0x1778ea[_0x5fcd('0x33')],_0x1778ea[_0x5fcd('0x35')]);_0x3f2115[_0x5fcd('0x38')]=_['intersection'](_0x1778ea[_0x5fcd('0x33')],qs[_0x5fcd('0x39')](_0x366a91[_0x5fcd('0x35')][_0x5fcd('0x39')]));_0x3f2115[_0x5fcd('0x38')]=_0x3f2115[_0x5fcd('0x38')][_0x5fcd('0x3a')]?_0x3f2115[_0x5fcd('0x38')]:_0x1778ea[_0x5fcd('0x33')];if(_0x366a91[_0x5fcd('0x35')][_0x5fcd('0x45')]){_0x3f2115['include']=[{'all':!![]}];}_0x3f2115=_[_0x5fcd('0x43')]({},_0x3f2115,_0x366a91['options']);return db['Interval'][_0x5fcd('0x4a')](_0x3f2115)[_0x5fcd('0x24')](handleEntityNotFound(_0x534559,null))[_0x5fcd('0x24')](respondWithResult(_0x534559,null))[_0x5fcd('0x47')](handleError(_0x534559,null));};exports[_0x5fcd('0x4b')]=function(_0x47368d,_0x32f160){return db[_0x5fcd('0x2e')][_0x5fcd('0x4b')](_0x47368d['body'],{})[_0x5fcd('0x24')](function(_0x59e402){var _0x268331=_0x47368d[_0x5fcd('0x4c')][_0x5fcd('0x26')]({'plain':!![]});if(!_0x268331)throw new Error(_0x5fcd('0x4d'));if(_0x268331[_0x5fcd('0x4e')]==='user'){var _0x41e28a=_0x59e402[_0x5fcd('0x26')]({'plain':!![]});var _0x3ac751=_0x5fcd('0x27');return db['UserProfileSection'][_0x5fcd('0x4a')]({'where':{'name':_0x3ac751,'userProfileId':_0x268331[_0x5fcd('0x4f')]},'raw':!![]})['then'](function(_0x3c210e){if(_0x3c210e&&_0x3c210e[_0x5fcd('0x50')]===0x0){return db['UserProfileResource'][_0x5fcd('0x4b')]({'name':_0x41e28a[_0x5fcd('0x2a')],'resourceId':_0x41e28a['id'],'type':_0x3c210e[_0x5fcd('0x2a')],'sectionId':_0x3c210e['id']},{})[_0x5fcd('0x24')](function(){return _0x59e402;});}else{return _0x59e402;}})['catch'](function(_0x33576e){logger[_0x5fcd('0x51')](_0x5fcd('0x52'),_0x33576e);throw _0x33576e;});}return _0x59e402;})[_0x5fcd('0x24')](respondWithResult(_0x32f160,0xc9))[_0x5fcd('0x47')](handleError(_0x32f160,null));};exports[_0x5fcd('0x53')]=function(_0x461201,_0x168aa3){if(_0x461201[_0x5fcd('0x54')]['id']){delete _0x461201[_0x5fcd('0x54')]['id'];}return db[_0x5fcd('0x2e')][_0x5fcd('0x4a')]({'where':{'id':_0x461201[_0x5fcd('0x49')]['id']}})['then'](handleEntityNotFound(_0x168aa3,null))['then'](saveUpdates(_0x461201[_0x5fcd('0x54')],null))[_0x5fcd('0x24')](respondWithResult(_0x168aa3,null))['catch'](handleError(_0x168aa3,null));};exports[_0x5fcd('0x25')]=function(_0x393c24,_0x539d3f){return db[_0x5fcd('0x2e')][_0x5fcd('0x4a')]({'where':{'id':_0x393c24[_0x5fcd('0x49')]['id']}})[_0x5fcd('0x24')](handleEntityNotFound(_0x539d3f,null))[_0x5fcd('0x24')](removeEntity(_0x539d3f,null))['catch'](handleError(_0x539d3f,null));};exports['addInterval']=function(_0x1a450e,_0x7a00f1,_0x4ea94a){if(_0x1a450e['body']['id']){delete _0x1a450e[_0x5fcd('0x54')]['id'];}return db[_0x5fcd('0x2e')][_0x5fcd('0x4a')]({'where':{'id':_0x1a450e[_0x5fcd('0x49')]['id']}})[_0x5fcd('0x24')](handleEntityNotFound(_0x7a00f1,null))[_0x5fcd('0x24')](function(_0x1ae4f6){if(_0x1ae4f6){_0x1a450e[_0x5fcd('0x54')][_0x5fcd('0x55')]=_0x1ae4f6['id'];return db[_0x5fcd('0x2e')][_0x5fcd('0x4b')](_0x1a450e['body']);}})[_0x5fcd('0x24')](respondWithResult(_0x7a00f1,null))[_0x5fcd('0x47')](handleError(_0x7a00f1,null));};exports[_0x5fcd('0x56')]=function(_0xf2c321,_0xa8cfd6,_0x1b8dfc){var _0x3c838c={};var _0x1bfa77={};var _0x154e65;var _0x34425e;return db['Interval'][_0x5fcd('0x57')]({'where':{'id':_0xf2c321['params']['id']}})[_0x5fcd('0x24')](handleEntityNotFound(_0xa8cfd6,null))[_0x5fcd('0x24')](function(_0x1ed7b4){if(_0x1ed7b4){_0x154e65=_0x1ed7b4;_0x1bfa77['model']=_[_0x5fcd('0x34')](db[_0x5fcd('0x2e')][_0x5fcd('0x2f')]);_0x1bfa77['query']=_['keys'](_0xf2c321['query']);_0x1bfa77[_0x5fcd('0x36')]=_[_0x5fcd('0x37')](_0x1bfa77[_0x5fcd('0x33')],_0x1bfa77[_0x5fcd('0x35')]);_0x3c838c[_0x5fcd('0x38')]=_[_0x5fcd('0x37')](_0x1bfa77[_0x5fcd('0x33')],qs[_0x5fcd('0x39')](_0xf2c321['query'][_0x5fcd('0x39')]));_0x3c838c[_0x5fcd('0x38')]=_0x3c838c['attributes']['length']?_0x3c838c[_0x5fcd('0x38')]:_0x1bfa77[_0x5fcd('0x33')];_0x3c838c['order']=qs[_0x5fcd('0x3e')](_0xf2c321[_0x5fcd('0x35')][_0x5fcd('0x3e')]);_0x3c838c[_0x5fcd('0x3f')]=qs[_0x5fcd('0x36')](_['pick'](_0xf2c321[_0x5fcd('0x35')],_0x1bfa77[_0x5fcd('0x36')]));if(_0xf2c321[_0x5fcd('0x35')]['filter']){_0x3c838c[_0x5fcd('0x3f')]=_['merge'](_0x3c838c[_0x5fcd('0x3f')],{'$or':_[_0x5fcd('0x2d')](_0x3c838c['attributes'],function(_0x413a58){var _0x3924fc={};_0x3924fc[_0x413a58]={'$like':'%'+_0xf2c321['query'][_0x5fcd('0x41')]+'%'};return _0x3924fc;})});}_0x3c838c=_[_0x5fcd('0x43')]({},_0x3c838c,_0xf2c321[_0x5fcd('0x44')]);return _0x154e65[_0x5fcd('0x56')](_0x3c838c);}})['then'](function(_0x5f1f20){if(_0x5f1f20){_0x34425e=_0x5f1f20[_0x5fcd('0x3a')];if(!_0xf2c321[_0x5fcd('0x35')][_0x5fcd('0x3b')]('nolimit')){_0x3c838c[_0x5fcd('0x3c')]=qs['limit'](_0xf2c321[_0x5fcd('0x35')][_0x5fcd('0x3c')]);_0x3c838c[_0x5fcd('0x1d')]=qs[_0x5fcd('0x1d')](_0xf2c321[_0x5fcd('0x35')][_0x5fcd('0x1d')]);}return _0x154e65[_0x5fcd('0x56')](_0x3c838c);}})['then'](function(_0x8ef158){if(_0x8ef158){return _0x8ef158?{'count':_0x34425e,'rows':_0x8ef158}:null;}})[_0x5fcd('0x24')](respondWithResult(_0xa8cfd6,null))[_0x5fcd('0x47')](handleError(_0xa8cfd6,null));};exports[_0x5fcd('0x58')]=function(_0x367f66,_0x676c6,_0x297450){return db[_0x5fcd('0x2e')][_0x5fcd('0x57')]({'where':{'id':_0x367f66[_0x5fcd('0x49')]['id']}})[_0x5fcd('0x24')](handleEntityNotFound(_0x676c6,null))[_0x5fcd('0x24')](function(_0x27c210){if(_0x27c210){return db[_0x5fcd('0x59')]['transaction'](function(_0x3ae1fc){return db['Interval'][_0x5fcd('0x25')]({'where':{'IntervalId':_0x367f66[_0x5fcd('0x49')]['id']},'transaction':_0x3ae1fc})[_0x5fcd('0x24')](function(_0x4cfbb2){var _0x346f55=_[_0x5fcd('0x2d')](_0x367f66[_0x5fcd('0x54')],function(_0x4f1596){delete _0x4f1596['id'];_0x4f1596['IntervalId']=_0x367f66['params']['id'];return _0x4f1596;});return db[_0x5fcd('0x2e')][_0x5fcd('0x5a')](_0x346f55,{'transaction':_0x3ae1fc});});})[_0x5fcd('0x24')](function(){return db[_0x5fcd('0x2e')][_0x5fcd('0x46')]({'where':{'IntervalId':_0x367f66[_0x5fcd('0x49')]['id']}});});}})[_0x5fcd('0x24')](respondWithResult(_0x676c6,null))[_0x5fcd('0x47')](handleError(_0x676c6,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 15a63b2..bafeaf7 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 _0x2558=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Interval','tools_intervals','rewrite'];(function(_0x261174,_0x33d545){var _0x20dfbd=function(_0x49c140){while(--_0x49c140){_0x261174['push'](_0x261174['shift']());}};_0x20dfbd(++_0x33d545);}(_0x2558,0x1a0));var _0x8255=function(_0x490d09,_0x4d9eed){_0x490d09=_0x490d09-0x0;var _0x5a9666=_0x2558[_0x490d09];return _0x5a9666;};'use strict';var _=require('lodash');var util=require(_0x8255('0x0'));var logger=require(_0x8255('0x1'))(_0x8255('0x2'));var moment=require(_0x8255('0x3'));var BPromise=require(_0x8255('0x4'));var rp=require(_0x8255('0x5'));var fs=require('fs');var path=require(_0x8255('0x6'));var rimraf=require(_0x8255('0x7'));var config=require(_0x8255('0x8'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x29ab2b,_0x4792c9){return _0x29ab2b[_0x8255('0x9')](_0x8255('0xa'),attributes,{'tableName':_0x8255('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58d27b,_0x51fd5d){extensions[_0x8255('0xc')](_0x29ab2b,_0x58d27b);},'afterBulkCreate':function(_0x5e0c4c,_0x3496e9,_0x56b08f){_0x56b08f();extensions['rewrite'](_0x29ab2b,_0x5e0c4c[0x0]);},'afterUpdate':function(_0xc555da,_0x132425){extensions[_0x8255('0xc')](_0x29ab2b,_0xc555da);},'afterDestroy':function(_0x794695,_0x28ba88){extensions[_0x8255('0xc')](_0x29ab2b,_0x794695);}}});}; \ No newline at end of file +var _0x4451=['exports','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x48da1c,_0x1b183a){var _0x233efc=function(_0x24787e){while(--_0x24787e){_0x48da1c['push'](_0x48da1c['shift']());}};_0x233efc(++_0x1b183a);}(_0x4451,0xf4));var _0x1445=function(_0x553a07,_0x23c1db){_0x553a07=_0x553a07-0x0;var _0x469598=_0x4451[_0x553a07];return _0x469598;};'use strict';var _=require(_0x1445('0x0'));var util=require(_0x1445('0x1'));var logger=require(_0x1445('0x2'))(_0x1445('0x3'));var moment=require('moment');var BPromise=require(_0x1445('0x4'));var rp=require(_0x1445('0x5'));var fs=require('fs');var path=require(_0x1445('0x6'));var rimraf=require(_0x1445('0x7'));var config=require(_0x1445('0x8'));var attributes=require(_0x1445('0x9'));var extensions=require(_0x1445('0xa'));module[_0x1445('0xb')]=function(_0x144a32,_0x453b07){return _0x144a32['define'](_0x1445('0xc'),attributes,{'tableName':_0x1445('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c611e,_0x8cd930){extensions[_0x1445('0xe')](_0x144a32,_0x1c611e);},'afterBulkCreate':function(_0x452bff,_0x4f585e,_0x54195f){_0x54195f();extensions[_0x1445('0xe')](_0x144a32,_0x452bff[0x0]);},'afterUpdate':function(_0x21bbb6,_0xa1fa39){extensions['rewrite'](_0x144a32,_0x21bbb6);},'afterDestroy':function(_0x4b3bdd,_0x1389aa){extensions[_0x1445('0xe')](_0x144a32,_0x4b3bdd);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c077d32..c6dab63 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(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 85abaa3..79110d6 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0x0b0e[_0x6978c0];return _0x361377;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x5ea889,_0x70f687){var _0x8171d5=function(_0x95184f){while(--_0x95184f){_0x5ea889['push'](_0x5ea889['shift']());}};_0x8171d5(++_0x70f687);}(_0x2032,0xd9));var _0x2203=function(_0x1c8396,_0x447fcb){_0x1c8396=_0x1c8396-0x0;var _0x3d8d7a=_0x2032[_0x1c8396];return _0x3d8d7a;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index a06c239..6bec5a8 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 _0xf138=['customfield_11501','oldToken','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','request','setEncoding','utf8','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','https','api','support','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','email','fields'];(function(_0xade445,_0x2e53c4){var _0x5519d3=function(_0x286be3){while(--_0x286be3){_0xade445['push'](_0xade445['shift']());}};_0x5519d3(++_0x2e53c4);}(_0xf138,0x12b));var _0x8f13=function(_0x45ea10,_0xd51e0e){_0x45ea10=_0x45ea10-0x0;var _0x4cece8=_0xf138[_0x45ea10];return _0x4cece8;};'use strict';var BPromise=require(_0x8f13('0x0'));var https=require(_0x8f13('0x1'));var logger=require('../../config/logger')(_0x8f13('0x2'));var USERNAME=_0x8f13('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0xecba5b,_0x361ef7){var _0x2cc44c={'fields':{'project':{'key':_0xecba5b[_0x8f13('0x4')]||_0x8f13('0x5')},'summary':(_0xecba5b[_0x8f13('0x6')]||_0x8f13('0x7'))+_0x8f13('0x8')+_0xecba5b['ip'],'description':_0xecba5b[_0x8f13('0x9')]||JSON[_0x8f13('0xa')](_0xecba5b),'issuetype':{'name':_0xecba5b[_0x8f13('0xb')]||_0x8f13('0xc')}}};_0x2cc44c['fields'][_0x8f13('0xd')]=_0xecba5b[_0x8f13('0xe')];_0x2cc44c[_0x8f13('0xf')][_0x8f13('0x10')]=_0xecba5b[_0x8f13('0x11')];_0x2cc44c['fields']['customfield_11502']=_0xecba5b[_0x8f13('0x12')];_0x2cc44c['fields'][_0x8f13('0x13')]=_0xecba5b[_0x8f13('0x14')];_0x2cc44c['fields']['customfield_11504']=_0xecba5b['reason'];_0x2cc44c['fields'][_0x8f13('0x15')]=_0xecba5b['ip'];var _0xe2a264={'host':_0x8f13('0x16'),'port':0x1bb,'path':_0x8f13('0x17'),'method':_0x8f13('0x18'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x8f13('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x8f13('0x1a')]('base64')}};var _0x17accc=JSON[_0x8f13('0xa')](_0x2cc44c);var _0x3f482d=https[_0x8f13('0x1b')](_0xe2a264,function(_0x3ffd61){_0x3ffd61[_0x8f13('0x1c')](_0x8f13('0x1d'));var _0x38d5c2='';_0x3ffd61['on'](_0x8f13('0x1e'),function(_0x945061){_0x38d5c2+=_0x945061;});_0x3ffd61['on'](_0x8f13('0x1f'),function(){if(_0x361ef7){return _0x361ef7[_0x8f13('0x20')](_0x3ffd61[_0x8f13('0x21')])[_0x8f13('0x22')](JSON[_0x8f13('0x23')](_0x38d5c2));}});});_0x3f482d['on']('error',function(_0x1aeda8){if(_0x361ef7){return _0x361ef7['status'](0x1f4)[_0x8f13('0x22')]({'errors':[{'message':_0x8f13('0x24'),'type':'api.jira'}]});}});_0x3f482d[_0x8f13('0x25')](_0x17accc);_0x3f482d['end']();}exports[_0x8f13('0x26')]=openIssue;exports[_0x8f13('0x27')]=function(_0x556248,_0x4bc245){_0x556248[_0x8f13('0x28')]['ip']=_0x556248[_0x8f13('0x29')]['x-forwarded-for']||_0x556248[_0x8f13('0x2a')]['remoteAddress']||_0x556248['socket'][_0x8f13('0x2b')]||_0x556248[_0x8f13('0x2a')][_0x8f13('0x2c')]['remoteAddress'];return openIssue(_0x556248[_0x8f13('0x28')],_0x4bc245);}; \ No newline at end of file +var _0x1d72=['MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','application/json','Basic\x20','toString','base64','request','end','parse','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','socket','connection','remoteAddress','https','api','support','3eAmWpBVP0','key'];(function(_0x5d51f5,_0x2f69a0){var _0x64f86b=function(_0x914a9){while(--_0x914a9){_0x5d51f5['push'](_0x5d51f5['shift']());}};_0x64f86b(++_0x2f69a0);}(_0x1d72,0x19f));var _0x21d7=function(_0x5f26a7,_0x3dbba5){_0x5f26a7=_0x5f26a7-0x0;var _0x4ebc43=_0x1d72[_0x5f26a7];return _0x4ebc43;};'use strict';var BPromise=require('bluebird');var https=require(_0x21d7('0x0'));var logger=require('../../config/logger')(_0x21d7('0x1'));var USERNAME=_0x21d7('0x2');var PASSWORD=_0x21d7('0x3');function openIssue(_0x97ef3e,_0x277293){var _0x372317={'fields':{'project':{'key':_0x97ef3e[_0x21d7('0x4')]||_0x21d7('0x5')},'summary':(_0x97ef3e[_0x21d7('0x6')]||_0x21d7('0x7'))+_0x21d7('0x8')+_0x97ef3e['ip'],'description':_0x97ef3e[_0x21d7('0x9')]||JSON[_0x21d7('0xa')](_0x97ef3e),'issuetype':{'name':_0x97ef3e['issuetype']||_0x21d7('0xb')}}};_0x372317[_0x21d7('0xc')][_0x21d7('0xd')]=_0x97ef3e[_0x21d7('0xe')];_0x372317[_0x21d7('0xc')]['customfield_11501']=_0x97ef3e['oldToken'];_0x372317[_0x21d7('0xc')][_0x21d7('0xf')]=_0x97ef3e[_0x21d7('0x10')];_0x372317[_0x21d7('0xc')][_0x21d7('0x11')]=_0x97ef3e[_0x21d7('0x12')];_0x372317[_0x21d7('0xc')]['customfield_11504']=_0x97ef3e[_0x21d7('0x13')];_0x372317['fields'][_0x21d7('0x14')]=_0x97ef3e['ip'];var _0x16d93e={'host':_0x21d7('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x21d7('0x16'),'Authorization':_0x21d7('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x21d7('0x18')](_0x21d7('0x19'))}};var _0x4004b3=JSON['stringify'](_0x372317);var _0x3ce8bf=https[_0x21d7('0x1a')](_0x16d93e,function(_0x56cb8a){_0x56cb8a['setEncoding']('utf8');var _0x4b50cd='';_0x56cb8a['on']('data',function(_0x25d763){_0x4b50cd+=_0x25d763;});_0x56cb8a['on'](_0x21d7('0x1b'),function(){if(_0x277293){return _0x277293['status'](_0x56cb8a['statusCode'])['json'](JSON[_0x21d7('0x1c')](_0x4b50cd));}});});_0x3ce8bf['on'](_0x21d7('0x1d'),function(_0x41b803){if(_0x277293){return _0x277293[_0x21d7('0x1e')](0x1f4)[_0x21d7('0x1f')]({'errors':[{'message':_0x21d7('0x20'),'type':'api.jira'}]});}});_0x3ce8bf[_0x21d7('0x21')](_0x4004b3);_0x3ce8bf['end']();}exports[_0x21d7('0x22')]=openIssue;exports[_0x21d7('0x23')]=function(_0x2d6abb,_0x22edc9){_0x2d6abb[_0x21d7('0x24')]['ip']=_0x2d6abb[_0x21d7('0x25')][_0x21d7('0x26')]||_0x2d6abb['connection']['remoteAddress']||_0x2d6abb[_0x21d7('0x27')]['remoteAddress']||_0x2d6abb[_0x21d7('0x28')][_0x21d7('0x27')][_0x21d7('0x29')];return openIssue(_0x2d6abb['body'],_0x22edc9);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 204c66c..b07eeb2 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 _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2dae,0xc3));var _0xe2da=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2dae[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6f0d=['post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','show'];(function(_0x281b5d,_0x42cccb){var _0x1c581d=function(_0x242e2b){while(--_0x242e2b){_0x281b5d['push'](_0x281b5d['shift']());}};_0x1c581d(++_0x42cccb);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x49b797,_0x5020eb){_0x49b797=_0x49b797-0x0;var _0x202242=_0x6f0d[_0x49b797];return _0x202242;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xc')]);router['get']('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xe')]('/',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xf')]);router['put'](_0xd6f0('0x10'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x11')]);router[_0xd6f0('0x12')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x13')]);module[_0xd6f0('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 9e11a4a..0bd0c6f 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x2b047a,_0x1b7abe){_0x2b047a=_0x2b047a-0x0;var _0x1f5549=_0x7a54[_0x2b047a];return _0x1f5549;};'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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x245924,_0x2017ea){_0x245924=_0x245924-0x0;var _0x3e05cc=_0x7a54[_0x245924];return _0x3e05cc;};'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 6e89956..253f1d6 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 _0xdb70=['catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','key','map','query','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find'];(function(_0x3ed9ed,_0x5841b0){var _0x4e9106=function(_0x20949b){while(--_0x20949b){_0x3ed9ed['push'](_0x3ed9ed['shift']());}};_0x4e9106(++_0x5841b0);}(_0xdb70,0xa0));var _0x0db7=function(_0x2ec1a1,_0x2e6e6e){_0x2ec1a1=_0x2ec1a1-0x0;var _0x3f1ccb=_0xdb70[_0x2ec1a1];return _0x3f1ccb;};'use strict';var emlformat=require(_0x0db7('0x0'));var rimraf=require(_0x0db7('0x1'));var zipdir=require(_0x0db7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0db7('0x3'));var moment=require(_0x0db7('0x4'));var BPromise=require(_0x0db7('0x5'));var Mustache=require(_0x0db7('0x6'));var util=require(_0x0db7('0x7'));var path=require(_0x0db7('0x8'));var sox=require(_0x0db7('0x9'));var csv=require(_0x0db7('0xa'));var ejs=require(_0x0db7('0xb'));var fs=require('fs');var fs_extra=require(_0x0db7('0xc'));var _=require(_0x0db7('0xd'));var squel=require('squel');var crypto=require(_0x0db7('0xe'));var jsforce=require(_0x0db7('0xf'));var deskjs=require(_0x0db7('0x10'));var toCsv=require(_0x0db7('0xa'));var querystring=require(_0x0db7('0x11'));var Papa=require(_0x0db7('0x12'));var Redis=require('ioredis');var authService=require(_0x0db7('0x13'));var qs=require(_0x0db7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0db7('0x15'));var logger=require(_0x0db7('0x16'))(_0x0db7('0x17'));var utils=require(_0x0db7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0db7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9aed4f,_0x2959a2){_0x2959a2=_0x2959a2||0xcc;return function(_0x33ec07){if(_0x33ec07){return _0x9aed4f[_0x0db7('0x1a')](_0x2959a2);}return _0x9aed4f[_0x0db7('0x1b')](_0x2959a2)['end']();};}function respondWithResult(_0x76c036,_0x195556){_0x195556=_0x195556||0xc8;return function(_0x45f594){if(_0x45f594){return _0x76c036[_0x0db7('0x1b')](_0x195556)[_0x0db7('0x1c')](_0x45f594);}};}function respondWithFilteredResult(_0x446448,_0x41b2b3){return function(_0x2edbe9){if(_0x2edbe9){var _0xb9127d=typeof _0x41b2b3[_0x0db7('0x1d')]==='undefined'&&typeof _0x41b2b3[_0x0db7('0x1e')]===_0x0db7('0x1f');var _0x18cf37=_0x2edbe9[_0x0db7('0x20')];var _0x31082b=_0xb9127d?0x0:_0x41b2b3[_0x0db7('0x1d')];var _0x52e95e=_0xb9127d?_0x2edbe9['count']:_0x41b2b3[_0x0db7('0x1d')]+_0x41b2b3[_0x0db7('0x1e')];var _0xe9a55d;if(_0x52e95e>=_0x18cf37){_0x52e95e=_0x18cf37;_0xe9a55d=0xc8;}else{_0xe9a55d=0xce;}_0x446448['status'](_0xe9a55d);return _0x446448[_0x0db7('0x21')](_0x0db7('0x22'),_0x31082b+'-'+_0x52e95e+'/'+_0x18cf37)[_0x0db7('0x1c')](_0x2edbe9);}return null;};}function patchUpdates(_0x211fc0){return function(_0x5a0b04){try{jsonpatch[_0x0db7('0x23')](_0x5a0b04,_0x211fc0,!![]);}catch(_0x48feb2){return BPromise[_0x0db7('0x24')](_0x48feb2);}return _0x5a0b04['save']();};}function saveUpdates(_0x59b7e4,_0x135429){return function(_0x156aaa){if(_0x156aaa){return _0x156aaa[_0x0db7('0x25')](_0x59b7e4)[_0x0db7('0x26')](function(_0x18fc1c){return _0x18fc1c;});}return null;};}function removeEntity(_0x368243,_0xc05009){return function(_0x274bf1){if(_0x274bf1){return _0x274bf1[_0x0db7('0x27')]()[_0x0db7('0x26')](function(){_0x368243[_0x0db7('0x1b')](0xcc)[_0x0db7('0x28')]();});}};}function handleEntityNotFound(_0x299c22,_0x55f339){return function(_0x521565){if(!_0x521565){_0x299c22['sendStatus'](0x194);}return _0x521565;};}function handleError(_0x594e6a,_0x568e60){_0x568e60=_0x568e60||0x1f4;return function(_0x5d2e46){logger[_0x0db7('0x29')](_0x5d2e46[_0x0db7('0x2a')]);if(_0x5d2e46[_0x0db7('0x2b')]){delete _0x5d2e46['name'];}_0x594e6a['status'](_0x568e60)[_0x0db7('0x2c')](_0x5d2e46);};}exports[_0x0db7('0x2d')]=function(_0x3f2169,_0x37ade4){var _0x29ed0a={},_0xfc7311={},_0x4ca418={'count':0x0,'rows':[]};var _0x2de626=_['map'](db[_0x0db7('0x2e')][_0x0db7('0x2f')],function(_0x1481aa){return{'name':_0x1481aa[_0x0db7('0x30')],'type':_0x1481aa['type'][_0x0db7('0x31')]};});_0xfc7311['model']=_[_0x0db7('0x32')](_0x2de626,_0x0db7('0x2b'));_0xfc7311[_0x0db7('0x33')]=_['keys'](_0x3f2169[_0x0db7('0x33')]);_0xfc7311[_0x0db7('0x34')]=_['intersection'](_0xfc7311['model'],_0xfc7311[_0x0db7('0x33')]);_0x29ed0a[_0x0db7('0x35')]=_[_0x0db7('0x36')](_0xfc7311['model'],qs['fields'](_0x3f2169[_0x0db7('0x33')][_0x0db7('0x37')]));_0x29ed0a[_0x0db7('0x35')]=_0x29ed0a['attributes'][_0x0db7('0x38')]?_0x29ed0a[_0x0db7('0x35')]:_0xfc7311[_0x0db7('0x39')];if(!_0x3f2169[_0x0db7('0x33')]['hasOwnProperty'](_0x0db7('0x3a'))){_0x29ed0a['limit']=qs[_0x0db7('0x1e')](_0x3f2169['query'][_0x0db7('0x1e')]);_0x29ed0a[_0x0db7('0x1d')]=qs[_0x0db7('0x1d')](_0x3f2169['query']['offset']);}_0x29ed0a[_0x0db7('0x3b')]=qs[_0x0db7('0x3c')](_0x3f2169[_0x0db7('0x33')][_0x0db7('0x3c')]);_0x29ed0a[_0x0db7('0x3d')]=qs[_0x0db7('0x34')](_['pick'](_0x3f2169[_0x0db7('0x33')],_0xfc7311[_0x0db7('0x34')]),_0x2de626);if(_0x3f2169['query'][_0x0db7('0x3e')]){_0x29ed0a['where']=_[_0x0db7('0x3f')](_0x29ed0a['where'],{'$or':_[_0x0db7('0x32')](_0x2de626,function(_0x27ed23){if(_0x27ed23['type']!==_0x0db7('0x40')){var _0x100ef9={};_0x100ef9[_0x27ed23['name']]={'$like':'%'+_0x3f2169[_0x0db7('0x33')]['filter']+'%'};return _0x100ef9;}})});}_0x29ed0a=_[_0x0db7('0x3f')]({},_0x29ed0a,_0x3f2169[_0x0db7('0x41')]);var _0x32c295={'where':_0x29ed0a[_0x0db7('0x3d')]};return db[_0x0db7('0x2e')]['count'](_0x32c295)[_0x0db7('0x26')](function(_0x2545bf){_0x4ca418[_0x0db7('0x20')]=_0x2545bf;if(_0x3f2169[_0x0db7('0x33')][_0x0db7('0x42')]){_0x29ed0a[_0x0db7('0x43')]=[{'all':!![]}];}return db[_0x0db7('0x2e')][_0x0db7('0x44')](_0x29ed0a);})[_0x0db7('0x26')](function(_0x4591fe){_0x4ca418[_0x0db7('0x45')]=_0x4591fe;return _0x4ca418;})[_0x0db7('0x26')](respondWithFilteredResult(_0x37ade4,_0x29ed0a))['catch'](handleError(_0x37ade4,null));};exports[_0x0db7('0x46')]=function(_0x4a9066,_0x23558a){var _0x150936={'raw':!![],'where':{'id':_0x4a9066[_0x0db7('0x47')]['id']}},_0x55732f={};_0x55732f['model']=_[_0x0db7('0x48')](db[_0x0db7('0x2e')][_0x0db7('0x2f')]);_0x55732f[_0x0db7('0x33')]=_[_0x0db7('0x48')](_0x4a9066[_0x0db7('0x33')]);_0x55732f[_0x0db7('0x34')]=_[_0x0db7('0x36')](_0x55732f[_0x0db7('0x39')],_0x55732f['query']);_0x150936['attributes']=_['intersection'](_0x55732f[_0x0db7('0x39')],qs[_0x0db7('0x37')](_0x4a9066[_0x0db7('0x33')][_0x0db7('0x37')]));_0x150936[_0x0db7('0x35')]=_0x150936[_0x0db7('0x35')]['length']?_0x150936[_0x0db7('0x35')]:_0x55732f[_0x0db7('0x39')];if(_0x4a9066['query'][_0x0db7('0x42')]){_0x150936[_0x0db7('0x43')]=[{'all':!![]}];}_0x150936=_[_0x0db7('0x3f')]({},_0x150936,_0x4a9066['options']);return db[_0x0db7('0x2e')][_0x0db7('0x49')](_0x150936)[_0x0db7('0x26')](handleEntityNotFound(_0x23558a,null))[_0x0db7('0x26')](respondWithResult(_0x23558a,null))[_0x0db7('0x4a')](handleError(_0x23558a,null));};exports['create']=function(_0x23d9b3,_0x2388fa){return db[_0x0db7('0x2e')][_0x0db7('0x4b')](_0x23d9b3['body'],{})['then'](respondWithResult(_0x2388fa,0xc9))[_0x0db7('0x4a')](handleError(_0x2388fa,null));};exports['update']=function(_0x534daa,_0x3281bd){if(_0x534daa[_0x0db7('0x4c')]['id']){delete _0x534daa['body']['id'];}return db[_0x0db7('0x2e')][_0x0db7('0x49')]({'where':{'id':_0x534daa[_0x0db7('0x47')]['id']}})[_0x0db7('0x26')](handleEntityNotFound(_0x3281bd,null))['then'](saveUpdates(_0x534daa['body'],null))['then'](respondWithResult(_0x3281bd,null))[_0x0db7('0x4a')](handleError(_0x3281bd,null));};exports[_0x0db7('0x27')]=function(_0x1ac5df,_0x10863b){return db['JscriptyAnswerReport'][_0x0db7('0x49')]({'where':{'id':_0x1ac5df['params']['id']}})['then'](handleEntityNotFound(_0x10863b,null))['then'](removeEntity(_0x10863b,null))[_0x0db7('0x4a')](handleError(_0x10863b,null));};exports[_0x0db7('0x4d')]=function(_0x12bfda,_0x31f2a7){return db[_0x0db7('0x2e')]['describe']()[_0x0db7('0x26')](respondWithResult(_0x31f2a7,null))[_0x0db7('0x4a')](handleError(_0x31f2a7,null));}; \ No newline at end of file +var _0x5a5a=['options','where','JscriptyAnswerReport','includeAll','include','rows','show','keys','catch','create','body','update','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','error','stack','send','index','map','rawAttributes','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','type'];(function(_0x4a3ee3,_0x304512){var _0x56d16d=function(_0x280251){while(--_0x280251){_0x4a3ee3['push'](_0x4a3ee3['shift']());}};_0x56d16d(++_0x304512);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x4529b3,_0x390ebb){_0x4529b3=_0x4529b3-0x0;var _0x21e907=_0x5a5a[_0x4529b3];return _0x21e907;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5a5('0x0'));var zipdir=require(_0xa5a5('0x1'));var jsonpatch=require(_0xa5a5('0x2'));var rp=require(_0xa5a5('0x3'));var moment=require(_0xa5a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5a5('0x5'));var util=require(_0xa5a5('0x6'));var path=require(_0xa5a5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa5a5('0x8'));var fs=require('fs');var fs_extra=require(_0xa5a5('0x9'));var _=require('lodash');var squel=require(_0xa5a5('0xa'));var crypto=require(_0xa5a5('0xb'));var jsforce=require(_0xa5a5('0xc'));var deskjs=require(_0xa5a5('0xd'));var toCsv=require(_0xa5a5('0xe'));var querystring=require('querystring');var Papa=require(_0xa5a5('0xf'));var Redis=require(_0xa5a5('0x10'));var authService=require(_0xa5a5('0x11'));var qs=require(_0xa5a5('0x12'));var as=require(_0xa5a5('0x13'));var hardwareService=require(_0xa5a5('0x14'));var logger=require(_0xa5a5('0x15'))(_0xa5a5('0x16'));var utils=require(_0xa5a5('0x17'));var config=require(_0xa5a5('0x18'));var licenseUtil=require(_0xa5a5('0x19'));var db=require(_0xa5a5('0x1a'))['db'];function respondWithStatusCode(_0x567d9b,_0x245a65){_0x245a65=_0x245a65||0xcc;return function(_0x420b1d){if(_0x420b1d){return _0x567d9b[_0xa5a5('0x1b')](_0x245a65);}return _0x567d9b[_0xa5a5('0x1c')](_0x245a65)[_0xa5a5('0x1d')]();};}function respondWithResult(_0xa81eeb,_0x5d71e4){_0x5d71e4=_0x5d71e4||0xc8;return function(_0x3382c6){if(_0x3382c6){return _0xa81eeb[_0xa5a5('0x1c')](_0x5d71e4)[_0xa5a5('0x1e')](_0x3382c6);}};}function respondWithFilteredResult(_0x15370d,_0x2daae6){return function(_0x38305a){if(_0x38305a){var _0x1464d9=typeof _0x2daae6[_0xa5a5('0x1f')]==='undefined'&&typeof _0x2daae6[_0xa5a5('0x20')]===_0xa5a5('0x21');var _0x4571f5=_0x38305a[_0xa5a5('0x22')];var _0x3c4cae=_0x1464d9?0x0:_0x2daae6[_0xa5a5('0x1f')];var _0x28c89f=_0x1464d9?_0x38305a['count']:_0x2daae6[_0xa5a5('0x1f')]+_0x2daae6[_0xa5a5('0x20')];var _0x21488a;if(_0x28c89f>=_0x4571f5){_0x28c89f=_0x4571f5;_0x21488a=0xc8;}else{_0x21488a=0xce;}_0x15370d[_0xa5a5('0x1c')](_0x21488a);return _0x15370d['set'](_0xa5a5('0x23'),_0x3c4cae+'-'+_0x28c89f+'/'+_0x4571f5)['json'](_0x38305a);}return null;};}function patchUpdates(_0x2554c0){return function(_0x22774d){try{jsonpatch[_0xa5a5('0x24')](_0x22774d,_0x2554c0,!![]);}catch(_0x379f0d){return BPromise['reject'](_0x379f0d);}return _0x22774d['save']();};}function saveUpdates(_0x2001ed,_0x1a258f){return function(_0x417df3){if(_0x417df3){return _0x417df3['update'](_0x2001ed)[_0xa5a5('0x25')](function(_0x4b4613){return _0x4b4613;});}return null;};}function removeEntity(_0x337e52,_0x4996b3){return function(_0x4c0ff2){if(_0x4c0ff2){return _0x4c0ff2[_0xa5a5('0x26')]()[_0xa5a5('0x25')](function(){_0x337e52[_0xa5a5('0x1c')](0xcc)[_0xa5a5('0x1d')]();});}};}function handleEntityNotFound(_0x55ed28,_0x3583b1){return function(_0x54dfdc){if(!_0x54dfdc){_0x55ed28[_0xa5a5('0x1b')](0x194);}return _0x54dfdc;};}function handleError(_0xd37524,_0x516ccf){_0x516ccf=_0x516ccf||0x1f4;return function(_0x5ccc1e){logger[_0xa5a5('0x27')](_0x5ccc1e[_0xa5a5('0x28')]);if(_0x5ccc1e['name']){delete _0x5ccc1e['name'];}_0xd37524[_0xa5a5('0x1c')](_0x516ccf)[_0xa5a5('0x29')](_0x5ccc1e);};}exports[_0xa5a5('0x2a')]=function(_0x4d1201,_0x16fdd4){var _0x3bdd0a={},_0x58dc9e={},_0x122e3f={'count':0x0,'rows':[]};var _0x4d1eef=_[_0xa5a5('0x2b')](db['JscriptyAnswerReport'][_0xa5a5('0x2c')],function(_0x190a33){return{'name':_0x190a33['fieldName'],'type':_0x190a33['type']['key']};});_0x58dc9e[_0xa5a5('0x2d')]=_['map'](_0x4d1eef,_0xa5a5('0x2e'));_0x58dc9e[_0xa5a5('0x2f')]=_['keys'](_0x4d1201[_0xa5a5('0x2f')]);_0x58dc9e[_0xa5a5('0x30')]=_['intersection'](_0x58dc9e[_0xa5a5('0x2d')],_0x58dc9e[_0xa5a5('0x2f')]);_0x3bdd0a[_0xa5a5('0x31')]=_[_0xa5a5('0x32')](_0x58dc9e[_0xa5a5('0x2d')],qs[_0xa5a5('0x33')](_0x4d1201[_0xa5a5('0x2f')]['fields']));_0x3bdd0a[_0xa5a5('0x31')]=_0x3bdd0a[_0xa5a5('0x31')][_0xa5a5('0x34')]?_0x3bdd0a[_0xa5a5('0x31')]:_0x58dc9e[_0xa5a5('0x2d')];if(!_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x35')](_0xa5a5('0x36'))){_0x3bdd0a[_0xa5a5('0x20')]=qs[_0xa5a5('0x20')](_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x20')]);_0x3bdd0a[_0xa5a5('0x1f')]=qs[_0xa5a5('0x1f')](_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x1f')]);}_0x3bdd0a[_0xa5a5('0x37')]=qs['sort'](_0x4d1201[_0xa5a5('0x2f')]['sort']);_0x3bdd0a['where']=qs['filters'](_[_0xa5a5('0x38')](_0x4d1201['query'],_0x58dc9e[_0xa5a5('0x30')]),_0x4d1eef);if(_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x39')]){_0x3bdd0a['where']=_[_0xa5a5('0x3a')](_0x3bdd0a['where'],{'$or':_['map'](_0x4d1eef,function(_0x43c2ff){if(_0x43c2ff[_0xa5a5('0x3b')]!=='VIRTUAL'){var _0x421255={};_0x421255[_0x43c2ff['name']]={'$like':'%'+_0x4d1201['query'][_0xa5a5('0x39')]+'%'};return _0x421255;}})});}_0x3bdd0a=_['merge']({},_0x3bdd0a,_0x4d1201[_0xa5a5('0x3c')]);var _0x53fe36={'where':_0x3bdd0a[_0xa5a5('0x3d')]};return db[_0xa5a5('0x3e')][_0xa5a5('0x22')](_0x53fe36)[_0xa5a5('0x25')](function(_0x71fb38){_0x122e3f[_0xa5a5('0x22')]=_0x71fb38;if(_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x3f')]){_0x3bdd0a[_0xa5a5('0x40')]=[{'all':!![]}];}return db[_0xa5a5('0x3e')]['findAll'](_0x3bdd0a);})[_0xa5a5('0x25')](function(_0x491532){_0x122e3f[_0xa5a5('0x41')]=_0x491532;return _0x122e3f;})[_0xa5a5('0x25')](respondWithFilteredResult(_0x16fdd4,_0x3bdd0a))['catch'](handleError(_0x16fdd4,null));};exports[_0xa5a5('0x42')]=function(_0x2717b3,_0x2373f4){var _0x3a2e7e={'raw':!![],'where':{'id':_0x2717b3['params']['id']}},_0x4780b9={};_0x4780b9[_0xa5a5('0x2d')]=_[_0xa5a5('0x43')](db['JscriptyAnswerReport'][_0xa5a5('0x2c')]);_0x4780b9[_0xa5a5('0x2f')]=_[_0xa5a5('0x43')](_0x2717b3[_0xa5a5('0x2f')]);_0x4780b9[_0xa5a5('0x30')]=_[_0xa5a5('0x32')](_0x4780b9[_0xa5a5('0x2d')],_0x4780b9['query']);_0x3a2e7e[_0xa5a5('0x31')]=_['intersection'](_0x4780b9[_0xa5a5('0x2d')],qs['fields'](_0x2717b3['query'][_0xa5a5('0x33')]));_0x3a2e7e[_0xa5a5('0x31')]=_0x3a2e7e[_0xa5a5('0x31')]['length']?_0x3a2e7e[_0xa5a5('0x31')]:_0x4780b9['model'];if(_0x2717b3['query'][_0xa5a5('0x3f')]){_0x3a2e7e[_0xa5a5('0x40')]=[{'all':!![]}];}_0x3a2e7e=_[_0xa5a5('0x3a')]({},_0x3a2e7e,_0x2717b3['options']);return db[_0xa5a5('0x3e')]['find'](_0x3a2e7e)['then'](handleEntityNotFound(_0x2373f4,null))[_0xa5a5('0x25')](respondWithResult(_0x2373f4,null))[_0xa5a5('0x44')](handleError(_0x2373f4,null));};exports[_0xa5a5('0x45')]=function(_0x25091f,_0x268cfb){return db[_0xa5a5('0x3e')][_0xa5a5('0x45')](_0x25091f[_0xa5a5('0x46')],{})['then'](respondWithResult(_0x268cfb,0xc9))[_0xa5a5('0x44')](handleError(_0x268cfb,null));};exports[_0xa5a5('0x47')]=function(_0x2db032,_0x232bc5){if(_0x2db032[_0xa5a5('0x46')]['id']){delete _0x2db032[_0xa5a5('0x46')]['id'];}return db['JscriptyAnswerReport'][_0xa5a5('0x48')]({'where':{'id':_0x2db032[_0xa5a5('0x49')]['id']}})['then'](handleEntityNotFound(_0x232bc5,null))[_0xa5a5('0x25')](saveUpdates(_0x2db032[_0xa5a5('0x46')],null))[_0xa5a5('0x25')](respondWithResult(_0x232bc5,null))['catch'](handleError(_0x232bc5,null));};exports[_0xa5a5('0x26')]=function(_0x337949,_0x6ad8c9){return db[_0xa5a5('0x3e')]['find']({'where':{'id':_0x337949['params']['id']}})[_0xa5a5('0x25')](handleEntityNotFound(_0x6ad8c9,null))[_0xa5a5('0x25')](removeEntity(_0x6ad8c9,null))[_0xa5a5('0x44')](handleError(_0x6ad8c9,null));};exports['describe']=function(_0xe2dd58,_0x12d908){return db[_0xa5a5('0x3e')][_0xa5a5('0x4a')]()[_0xa5a5('0x25')](respondWithResult(_0x12d908,null))[_0xa5a5('0x44')](handleError(_0x12d908,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4ef0b93..1042737 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 _0x9489=['util','api','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x301402,_0x448b7c){var _0x742adc=function(_0x1c4f69){while(--_0x1c4f69){_0x301402['push'](_0x301402['shift']());}};_0x742adc(++_0x448b7c);}(_0x9489,0x18b));var _0x9948=function(_0x54bf8f,_0x51f523){_0x54bf8f=_0x54bf8f-0x0;var _0x5541d6=_0x9489[_0x54bf8f];return _0x5541d6;};'use strict';var _=require(_0x9948('0x0'));var util=require(_0x9948('0x1'));var logger=require('../../config/logger')(_0x9948('0x2'));var moment=require('moment');var BPromise=require(_0x9948('0x3'));var rp=require(_0x9948('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9948('0x5'));var config=require(_0x9948('0x6'));var attributes=require(_0x9948('0x7'));module[_0x9948('0x8')]=function(_0x228808,_0x5abfce){return _0x228808[_0x9948('0x9')](_0x9948('0xa'),attributes,{'tableName':_0x9948('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b7b=['rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x576739,_0x15364f){var _0x14c048=function(_0x10a881){while(--_0x10a881){_0x576739['push'](_0x576739['shift']());}};_0x14c048(++_0x15364f);}(_0x4b7b,0x162));var _0xb4b7=function(_0x4f5cfe,_0x5e6c23){_0x4f5cfe=_0x4f5cfe-0x0;var _0x533d7c=_0x4b7b[_0x4f5cfe];return _0x533d7c;};'use strict';var _=require(_0xb4b7('0x0'));var util=require('util');var logger=require(_0xb4b7('0x1'))(_0xb4b7('0x2'));var moment=require(_0xb4b7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb4b7('0x4'));var fs=require('fs');var path=require(_0xb4b7('0x5'));var rimraf=require(_0xb4b7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4b7('0x7'));module[_0xb4b7('0x8')]=function(_0x387694,_0x3a2601){return _0x387694[_0xb4b7('0x9')](_0xb4b7('0xa'),attributes,{'tableName':_0xb4b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index df70dcc..6e1e490 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 _0x4c2c=['../../config/environment','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x35ccf1,_0x29037b){var _0x9c5dd5=function(_0x30f50c){while(--_0x30f50c){_0x35ccf1['push'](_0x35ccf1['shift']());}};_0x9c5dd5(++_0x29037b);}(_0x4c2c,0x1c1));var _0xc4c2=function(_0x1fb94f,_0x2812e7){_0x1fb94f=_0x1fb94f-0x0;var _0x2a1bd0=_0x4c2c[_0x1fb94f];return _0x2a1bd0;};'use strict';var _=require(_0xc4c2('0x0'));var util=require('util');var moment=require(_0xc4c2('0x1'));var BPromise=require(_0xc4c2('0x2'));var rs=require(_0xc4c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4c2('0x5'))(_0xc4c2('0x6'));var config=require(_0xc4c2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc4c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f55c5,_0x4b5bb5,_0x3e93d0){return new BPromise(function(_0x244e8e,_0xf2f83){return client[_0xc4c2('0x9')](_0x4f55c5,_0x3e93d0)[_0xc4c2('0xa')](function(_0x166b08){logger['info'](_0xc4c2('0xb'),_0x4b5bb5,_0xc4c2('0xc'));logger[_0xc4c2('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4b5bb5,_0xc4c2('0xc'),JSON[_0xc4c2('0xe')](_0x166b08));if(_0x166b08[_0xc4c2('0xf')]){if(_0x166b08['error'][_0xc4c2('0x10')]===0x1f4){logger['error'](_0xc4c2('0xb'),_0x4b5bb5,_0x166b08['error'][_0xc4c2('0x11')]);return _0xf2f83(_0x166b08[_0xc4c2('0xf')][_0xc4c2('0x11')]);}logger[_0xc4c2('0xf')](_0xc4c2('0xb'),_0x4b5bb5,_0x166b08[_0xc4c2('0xf')]['message']);return _0x244e8e(_0x166b08[_0xc4c2('0xf')][_0xc4c2('0x11')]);}else{logger['info'](_0xc4c2('0xb'),_0x4b5bb5,'request\x20sent');_0x244e8e(_0x166b08[_0xc4c2('0x12')][_0xc4c2('0x11')]);}})['catch'](function(_0x1214e2){logger[_0xc4c2('0xf')](_0xc4c2('0xb'),_0x4b5bb5,_0x1214e2);_0xf2f83(_0x1214e2);});});} \ No newline at end of file +var _0x5e19=['JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','stringify','error','code'];(function(_0x43cb92,_0xb90ed3){var _0x43f395=function(_0x48a4f0){while(--_0x48a4f0){_0x43cb92['push'](_0x43cb92['shift']());}};_0x43f395(++_0xb90ed3);}(_0x5e19,0xf4));var _0x95e1=function(_0x5d0513,_0x5a30b8){_0x5d0513=_0x5d0513-0x0;var _0x571c52=_0x5e19[_0x5d0513];return _0x571c52;};'use strict';var _=require(_0x95e1('0x0'));var util=require('util');var moment=require(_0x95e1('0x1'));var BPromise=require('bluebird');var rs=require(_0x95e1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95e1('0x3'))['db'];var utils=require(_0x95e1('0x4'));var logger=require(_0x95e1('0x5'))(_0x95e1('0x6'));var config=require(_0x95e1('0x7'));var jayson=require(_0x95e1('0x8'));var client=jayson['client'][_0x95e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45821b,_0x539983,_0x15b482){return new BPromise(function(_0x1a93ce,_0x295337){return client[_0x95e1('0xa')](_0x45821b,_0x15b482)['then'](function(_0x535f33){logger[_0x95e1('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x539983,_0x95e1('0xc'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x539983,'request\x20sent',JSON[_0x95e1('0xd')](_0x535f33));if(_0x535f33['error']){if(_0x535f33[_0x95e1('0xe')][_0x95e1('0xf')]===0x1f4){logger[_0x95e1('0xe')](_0x95e1('0x10'),_0x539983,_0x535f33['error'][_0x95e1('0x11')]);return _0x295337(_0x535f33[_0x95e1('0xe')][_0x95e1('0x11')]);}logger[_0x95e1('0xe')](_0x95e1('0x10'),_0x539983,_0x535f33['error']['message']);return _0x1a93ce(_0x535f33['error']['message']);}else{logger['info'](_0x95e1('0x10'),_0x539983,_0x95e1('0xc'));_0x1a93ce(_0x535f33[_0x95e1('0x12')]['message']);}})[_0x95e1('0x13')](function(_0x31f7f0){logger[_0x95e1('0xe')](_0x95e1('0x10'),_0x539983,_0x31f7f0);_0x295337(_0x31f7f0);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 1cb9730..baeb516 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 _0xda28=['show','/:id/sessions','/:id/answers','getAnswers','getSummary','post','/:id/clone','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xda28,0xfc));var _0x8da2=function(_0x2b36b0,_0x331282){_0x2b36b0=_0x2b36b0-0x0;var _0x3c0a23=_0xda28[_0x2b36b0];return _0x3c0a23;};'use strict';var multer=require(_0x8da2('0x0'));var util=require(_0x8da2('0x1'));var path=require('path');var timeout=require(_0x8da2('0x2'));var express=require(_0x8da2('0x3'));var router=express[_0x8da2('0x4')]();var fs_extra=require(_0x8da2('0x5'));var auth=require(_0x8da2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8da2('0x7'));var controller=require(_0x8da2('0x8'));router[_0x8da2('0x9')]('/',auth[_0x8da2('0xa')](),controller[_0x8da2('0xb')]);router[_0x8da2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8da2('0xc')]);router[_0x8da2('0x9')](_0x8da2('0xd'),auth['isAuthenticated'](),controller['getSessions']);router[_0x8da2('0x9')](_0x8da2('0xe'),auth[_0x8da2('0xa')](),controller[_0x8da2('0xf')]);router['get']('/:id/summary',auth[_0x8da2('0xa')](),timeout('30s'),controller[_0x8da2('0x10')]);router[_0x8da2('0x11')]('/',auth[_0x8da2('0xa')](),controller['create']);router[_0x8da2('0x11')](_0x8da2('0x12'),auth['isAuthenticated'](),controller['clone']);router['put'](_0x8da2('0x13'),auth['isAuthenticated'](),controller[_0x8da2('0x14')]);router[_0x8da2('0x15')](_0x8da2('0x13'),auth['isAuthenticated'](),controller[_0x8da2('0x16')]);module[_0x8da2('0x17')]=router; \ No newline at end of file +var _0x8fcd=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','put','update','destroy','exports','multer','util'];(function(_0xd802,_0x2fd572){var _0x520d0=function(_0x5ce1ae){while(--_0x5ce1ae){_0xd802['push'](_0xd802['shift']());}};_0x520d0(++_0x2fd572);}(_0x8fcd,0x1ae));var _0xd8fc=function(_0x5f3a6c,_0x3b01ee){_0x5f3a6c=_0x5f3a6c-0x0;var _0x2c2d08=_0x8fcd[_0x5f3a6c];return _0x2c2d08;};'use strict';var multer=require(_0xd8fc('0x0'));var util=require(_0xd8fc('0x1'));var path=require(_0xd8fc('0x2'));var timeout=require(_0xd8fc('0x3'));var express=require(_0xd8fc('0x4'));var router=express[_0xd8fc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd8fc('0x6'));var interaction=require(_0xd8fc('0x7'));var config=require(_0xd8fc('0x8'));var controller=require(_0xd8fc('0x9'));router[_0xd8fc('0xa')]('/',auth[_0xd8fc('0xb')](),controller[_0xd8fc('0xc')]);router[_0xd8fc('0xa')](_0xd8fc('0xd'),auth[_0xd8fc('0xb')](),controller['show']);router[_0xd8fc('0xa')]('/:id/sessions',auth[_0xd8fc('0xb')](),controller['getSessions']);router[_0xd8fc('0xa')](_0xd8fc('0xe'),auth['isAuthenticated'](),controller[_0xd8fc('0xf')]);router[_0xd8fc('0xa')](_0xd8fc('0x10'),auth[_0xd8fc('0xb')](),timeout(_0xd8fc('0x11')),controller[_0xd8fc('0x12')]);router['post']('/',auth[_0xd8fc('0xb')](),controller[_0xd8fc('0x13')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0xd8fc('0x14')](_0xd8fc('0xd'),auth[_0xd8fc('0xb')](),controller[_0xd8fc('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd8fc('0x16')]);module[_0xd8fc('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index f6de107..2166974 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 _0xf4c6=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','long','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x13a0cb,_0x5bf463){var _0x415fe3=function(_0x2fbc7d){while(--_0x2fbc7d){_0x13a0cb['push'](_0x13a0cb['shift']());}};_0x415fe3(++_0x5bf463);}(_0xf4c6,0xc1));var _0x6f4c=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xf4c6[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0x6f4c('0x0'));var _=require(_0x6f4c('0x1'));var util=require(_0x6f4c('0x2'));module[_0x6f4c('0x3')]={'name':{'type':Sequelize[_0x6f4c('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x6f4c('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x6f4c('0x5')),'set':function(_0x49f6bd){if(_[_0x6f4c('0x6')](_0x49f6bd)){this[_0x6f4c('0x7')](_0x6f4c('0x8'),JSON[_0x6f4c('0x9')](_0x49f6bd));}else if(_[_0x6f4c('0xa')](_0x49f6bd)){this['setDataValue']('formData',_0x49f6bd);}else{this[_0x6f4c('0x7')](_0x6f4c('0x8'),util[_0x6f4c('0xb')](_0x6f4c('0xc'),this[_0x6f4c('0xd')](_0x6f4c('0xe'))||'',this[_0x6f4c('0xd')](_0x6f4c('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6f4c('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6f4c('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x4d3e=['stringify','format','getDataValue','name','description','BOOLEAN','lodash','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x4280b5,_0x2954d5){var _0x16b6b9=function(_0x4ee2dc){while(--_0x4ee2dc){_0x4280b5['push'](_0x4280b5['shift']());}};_0x16b6b9(++_0x2954d5);}(_0x4d3e,0x1f0));var _0xe4d3=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x4d3e[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe4d3('0x0'));var util=require('util');module[_0xe4d3('0x1')]={'name':{'type':Sequelize[_0xe4d3('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xe4d3('0x3')](_0xe4d3('0x4')),'set':function(_0x5ec636){if(_[_0xe4d3('0x5')](_0x5ec636)){this[_0xe4d3('0x6')](_0xe4d3('0x7'),JSON[_0xe4d3('0x8')](_0x5ec636));}else if(_['isString'](_0x5ec636)){this[_0xe4d3('0x6')](_0xe4d3('0x7'),_0x5ec636);}else{this['setDataValue']('formData',util[_0xe4d3('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xe4d3('0xa')](_0xe4d3('0xb'))||'',this[_0xe4d3('0xa')](_0xe4d3('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe4d3('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe4d3('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 397d44c..687f282 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 _0x0598=['pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','body','createdAt','updatedAt','UserProfileSection','autoAssociation','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','rows','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','limit','count','offset','set','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0x0598,0x19e));var _0x8059=function(_0x1ca4d5,_0x261e11){_0x1ca4d5=_0x1ca4d5-0x0;var _0x236fbb=_0x0598[_0x1ca4d5];return _0x236fbb;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8059('0x1'));var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8059('0x3'));var util=require(_0x8059('0x4'));var path=require(_0x8059('0x5'));var sox=require(_0x8059('0x6'));var csv=require(_0x8059('0x7'));var ejs=require(_0x8059('0x8'));var fs=require('fs');var fs_extra=require(_0x8059('0x9'));var _=require('lodash');var squel=require(_0x8059('0xa'));var crypto=require(_0x8059('0xb'));var jsforce=require(_0x8059('0xc'));var deskjs=require(_0x8059('0xd'));var toCsv=require(_0x8059('0x7'));var querystring=require('querystring');var Papa=require(_0x8059('0xe'));var Redis=require('ioredis');var authService=require(_0x8059('0xf'));var qs=require(_0x8059('0x10'));var as=require(_0x8059('0x11'));var hardwareService=require(_0x8059('0x12'));var logger=require(_0x8059('0x13'))(_0x8059('0x14'));var utils=require(_0x8059('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8059('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x403d4e,_0x1e3f7d){_0x1e3f7d=_0x1e3f7d||0xcc;return function(_0x256943){if(_0x256943){return _0x403d4e['sendStatus'](_0x1e3f7d);}return _0x403d4e[_0x8059('0x17')](_0x1e3f7d)['end']();};}function respondWithResult(_0x47ab03,_0x1f0470){_0x1f0470=_0x1f0470||0xc8;return function(_0x34a816){if(_0x34a816){return _0x47ab03['status'](_0x1f0470)[_0x8059('0x18')](_0x34a816);}};}function respondWithFilteredResult(_0x78a304,_0x47a863){return function(_0x572260){if(_0x572260){var _0x1a14da=typeof _0x47a863['offset']==='undefined'&&typeof _0x47a863[_0x8059('0x19')]==='undefined';var _0x3c4421=_0x572260[_0x8059('0x1a')];var _0x2514da=_0x1a14da?0x0:_0x47a863[_0x8059('0x1b')];var _0x465414=_0x1a14da?_0x572260[_0x8059('0x1a')]:_0x47a863[_0x8059('0x1b')]+_0x47a863[_0x8059('0x19')];var _0x10bdc4;if(_0x465414>=_0x3c4421){_0x465414=_0x3c4421;_0x10bdc4=0xc8;}else{_0x10bdc4=0xce;}_0x78a304['status'](_0x10bdc4);return _0x78a304[_0x8059('0x1c')]('Content-Range',_0x2514da+'-'+_0x465414+'/'+_0x3c4421)['json'](_0x572260);}return null;};}function patchUpdates(_0xe52f75){return function(_0xec2b4a){try{jsonpatch[_0x8059('0x1d')](_0xec2b4a,_0xe52f75,!![]);}catch(_0x1f05ec){return BPromise[_0x8059('0x1e')](_0x1f05ec);}return _0xec2b4a[_0x8059('0x1f')]();};}function saveUpdates(_0x5c81af,_0x5bd347){return function(_0x202706){if(_0x202706){return _0x202706[_0x8059('0x20')](_0x5c81af)[_0x8059('0x21')](function(_0x93078c){return _0x93078c;});}return null;};}function removeEntity(_0x3241d0,_0x244c8b){return function(_0x285396){if(_0x285396){return _0x285396[_0x8059('0x22')]()[_0x8059('0x21')](function(){var _0x2e02d4=_0x285396[_0x8059('0x23')]({'plain':!![]});var _0x3cdb8a=_0x8059('0x24');return db[_0x8059('0x25')][_0x8059('0x22')]({'where':{'type':_0x3cdb8a,'resourceId':_0x2e02d4['id']}})['then'](function(){return _0x285396;});})[_0x8059('0x21')](function(){_0x3241d0['status'](0xcc)[_0x8059('0x26')]();});}};}function handleEntityNotFound(_0x5696e0,_0x5bd428){return function(_0x2820e6){if(!_0x2820e6){_0x5696e0[_0x8059('0x27')](0x194);}return _0x2820e6;};}function handleError(_0x1efb6c,_0x4af7f2){_0x4af7f2=_0x4af7f2||0x1f4;return function(_0xc6dcb6){logger[_0x8059('0x28')](_0xc6dcb6[_0x8059('0x29')]);if(_0xc6dcb6[_0x8059('0x2a')]){delete _0xc6dcb6[_0x8059('0x2a')];}_0x1efb6c[_0x8059('0x17')](_0x4af7f2)[_0x8059('0x2b')](_0xc6dcb6);};}exports[_0x8059('0x2c')]=function(_0x12fdf8,_0x2621f5){var _0x162a9={},_0xbb1c09={},_0x296995={'count':0x0,'rows':[]};var _0x5cd879=_[_0x8059('0x2d')](db[_0x8059('0x2e')][_0x8059('0x2f')],function(_0x2764b2){return{'name':_0x2764b2[_0x8059('0x30')],'type':_0x2764b2['type'][_0x8059('0x31')]};});_0xbb1c09['model']=_[_0x8059('0x2d')](_0x5cd879,_0x8059('0x2a'));_0xbb1c09[_0x8059('0x32')]=_['keys'](_0x12fdf8[_0x8059('0x32')]);_0xbb1c09[_0x8059('0x33')]=_[_0x8059('0x34')](_0xbb1c09[_0x8059('0x35')],_0xbb1c09['query']);_0x162a9[_0x8059('0x36')]=_[_0x8059('0x34')](_0xbb1c09['model'],qs[_0x8059('0x37')](_0x12fdf8[_0x8059('0x32')][_0x8059('0x37')]));_0x162a9[_0x8059('0x36')]=_0x162a9[_0x8059('0x36')][_0x8059('0x38')]?_0x162a9[_0x8059('0x36')]:_0xbb1c09[_0x8059('0x35')];if(!_0x12fdf8[_0x8059('0x32')][_0x8059('0x39')](_0x8059('0x3a'))){_0x162a9[_0x8059('0x19')]=qs[_0x8059('0x19')](_0x12fdf8[_0x8059('0x32')][_0x8059('0x19')]);_0x162a9[_0x8059('0x1b')]=qs[_0x8059('0x1b')](_0x12fdf8[_0x8059('0x32')][_0x8059('0x1b')]);}_0x162a9[_0x8059('0x3b')]=qs[_0x8059('0x3c')](_0x12fdf8[_0x8059('0x32')][_0x8059('0x3c')]);_0x162a9[_0x8059('0x3d')]=qs['filters'](_[_0x8059('0x3e')](_0x12fdf8[_0x8059('0x32')],_0xbb1c09[_0x8059('0x33')]),_0x5cd879);if(_0x12fdf8[_0x8059('0x32')][_0x8059('0x3f')]){_0x162a9[_0x8059('0x3d')]=_[_0x8059('0x40')](_0x162a9['where'],{'$or':_['map'](_0x5cd879,function(_0xc730a2){if(_0xc730a2[_0x8059('0x41')]!==_0x8059('0x42')){var _0x11a77b={};_0x11a77b[_0xc730a2['name']]={'$like':'%'+_0x12fdf8[_0x8059('0x32')][_0x8059('0x3f')]+'%'};return _0x11a77b;}})});}_0x162a9=_[_0x8059('0x40')]({},_0x162a9,_0x12fdf8[_0x8059('0x43')]);var _0x19cf88={'where':_0x162a9[_0x8059('0x3d')]};return db[_0x8059('0x2e')][_0x8059('0x1a')](_0x19cf88)[_0x8059('0x21')](function(_0x3cd03f){_0x296995[_0x8059('0x1a')]=_0x3cd03f;if(_0x12fdf8[_0x8059('0x32')][_0x8059('0x44')]){_0x162a9['include']=[{'all':!![]}];}return db[_0x8059('0x2e')][_0x8059('0x45')](_0x162a9);})[_0x8059('0x21')](function(_0x5df832){_0x296995['rows']=_0x5df832;return _0x296995;})['then'](respondWithFilteredResult(_0x2621f5,_0x162a9))[_0x8059('0x46')](handleError(_0x2621f5,null));};exports[_0x8059('0x47')]=function(_0x19c6a7,_0x1b514d){var _0xb28c07={'raw':![],'where':{'id':_0x19c6a7['params']['id']}},_0x5e500e={};_0x5e500e['model']=_[_0x8059('0x48')](db['JscriptyProject'][_0x8059('0x2f')]);_0x5e500e[_0x8059('0x32')]=_[_0x8059('0x48')](_0x19c6a7[_0x8059('0x32')]);_0x5e500e[_0x8059('0x33')]=_['intersection'](_0x5e500e['model'],_0x5e500e[_0x8059('0x32')]);_0xb28c07[_0x8059('0x36')]=_[_0x8059('0x34')](_0x5e500e['model'],qs[_0x8059('0x37')](_0x19c6a7[_0x8059('0x32')][_0x8059('0x37')]));_0xb28c07[_0x8059('0x36')]=_0xb28c07[_0x8059('0x36')][_0x8059('0x38')]?_0xb28c07[_0x8059('0x36')]:_0x5e500e['model'];if(_0x19c6a7[_0x8059('0x32')][_0x8059('0x44')]){_0xb28c07[_0x8059('0x49')]=[{'all':!![]}];}_0xb28c07=_[_0x8059('0x40')]({},_0xb28c07,_0x19c6a7[_0x8059('0x43')]);return db[_0x8059('0x2e')][_0x8059('0x4a')](_0xb28c07)[_0x8059('0x21')](handleEntityNotFound(_0x1b514d,null))['then'](respondWithResult(_0x1b514d,null))[_0x8059('0x46')](handleError(_0x1b514d,null));};exports[_0x8059('0x4b')]=function(_0x43603a,_0x3a21c1){return db[_0x8059('0x2e')][_0x8059('0x4b')](_0x43603a['body'],{})[_0x8059('0x21')](function(_0x199588){var _0x52405e=_0x43603a[_0x8059('0x4c')][_0x8059('0x23')]({'plain':!![]});if(!_0x52405e)throw new Error(_0x8059('0x4d'));if(_0x52405e[_0x8059('0x4e')]===_0x8059('0x4c')){var _0x2eea90=_0x199588[_0x8059('0x23')]({'plain':!![]});var _0x2a3fb0=_0x8059('0x24');return db['UserProfileSection'][_0x8059('0x4a')]({'where':{'name':_0x2a3fb0,'userProfileId':_0x52405e[_0x8059('0x4f')]},'raw':!![]})['then'](function(_0x102b01){if(_0x102b01&&_0x102b01['autoAssociation']===0x0){return db[_0x8059('0x25')][_0x8059('0x4b')]({'name':_0x2eea90[_0x8059('0x2a')],'resourceId':_0x2eea90['id'],'type':_0x102b01[_0x8059('0x2a')],'sectionId':_0x102b01['id']},{})[_0x8059('0x21')](function(){return _0x199588;});}else{return _0x199588;}})[_0x8059('0x46')](function(_0x2c74f3){logger[_0x8059('0x28')](_0x8059('0x50'),_0x2c74f3);throw _0x2c74f3;});}return _0x199588;})[_0x8059('0x21')](respondWithResult(_0x3a21c1,0xc9))[_0x8059('0x46')](handleError(_0x3a21c1,null));};exports[_0x8059('0x51')]=function(_0x451f03,_0x5993f4){var _0x4b4465={'where':{'id':_0x451f03[_0x8059('0x52')]['id']}},_0x2ee2b5={};_0x2ee2b5[_0x8059('0x35')]=_[_0x8059('0x48')](db[_0x8059('0x2e')][_0x8059('0x2f')]);_0x4b4465[_0x8059('0x36')]=_[_0x8059('0x34')](_0x2ee2b5[_0x8059('0x35')],qs[_0x8059('0x37')](_0x451f03[_0x8059('0x32')][_0x8059('0x37')]));_0x4b4465[_0x8059('0x36')]=_0x4b4465[_0x8059('0x36')]['length']?_0x4b4465[_0x8059('0x36')]:_0x2ee2b5['model'];if(_0x451f03[_0x8059('0x32')]['includeAll']){_0x4b4465[_0x8059('0x49')]=[{'all':!![]}];}_0x4b4465=_['merge']({},_0x4b4465,_0x451f03['options']);return db[_0x8059('0x2e')][_0x8059('0x4a')](_0x4b4465)[_0x8059('0x21')](handleEntityNotFound(_0x5993f4,null))[_0x8059('0x21')](function(_0x31b56a){if(_0x31b56a){var _0x3d6baf=_0x31b56a[_0x8059('0x23')]({'plain':!![]});_0x3d6baf=qs[_0x8059('0x53')](_0x3d6baf,['id','createdAt','updatedAt']);_0x451f03['body']=_[_0x8059('0x53')](_0x451f03[_0x8059('0x54')],['id',_0x8059('0x55'),_0x8059('0x56')]);return db[_0x8059('0x2e')][_0x8059('0x4b')](_['merge'](_0x3d6baf,_0x451f03['body']),{'include':_0x451f03[_0x8059('0x32')][_0x8059('0x44')]?[{'all':!![]}]:undefined})[_0x8059('0x21')](function(_0x19cde3){var _0x2fe950=_0x451f03[_0x8059('0x4c')]['get']({'plain':!![]});if(!_0x2fe950)throw new Error(_0x8059('0x4d'));if(_0x2fe950[_0x8059('0x4e')]==='user'){var _0x31218a=_0x19cde3[_0x8059('0x23')]({'plain':!![]});var _0x3406a7=_0x8059('0x24');return db[_0x8059('0x57')]['find']({'where':{'name':_0x3406a7,'userProfileId':_0x2fe950[_0x8059('0x4f')]},'raw':!![]})[_0x8059('0x21')](function(_0x5f3479){if(_0x5f3479&&_0x5f3479[_0x8059('0x58')]===0x0){return db['UserProfileResource'][_0x8059('0x4b')]({'name':_0x31218a[_0x8059('0x2a')],'resourceId':_0x31218a['id'],'type':_0x5f3479[_0x8059('0x2a')],'sectionId':_0x5f3479['id']},{})[_0x8059('0x21')](function(){return _0x19cde3;});}else{return _0x19cde3;}})[_0x8059('0x46')](function(_0x41a599){logger['error'](_0x8059('0x50'),_0x41a599);throw _0x41a599;});}return _0x19cde3;});}})['then'](respondWithResult(_0x5993f4,0xc9))[_0x8059('0x46')](handleError(_0x5993f4,null));};exports[_0x8059('0x20')]=function(_0x3f4cac,_0x48c0fb){if(_0x3f4cac[_0x8059('0x54')]['id']){delete _0x3f4cac[_0x8059('0x54')]['id'];}return db[_0x8059('0x2e')][_0x8059('0x4a')]({'where':{'id':_0x3f4cac[_0x8059('0x52')]['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x48c0fb,null))[_0x8059('0x21')](saveUpdates(_0x3f4cac[_0x8059('0x54')],null))[_0x8059('0x21')](respondWithResult(_0x48c0fb,null))[_0x8059('0x46')](handleError(_0x48c0fb,null));};exports[_0x8059('0x22')]=function(_0x50da4f,_0x274d7f){return db[_0x8059('0x2e')][_0x8059('0x4a')]({'where':{'id':_0x50da4f[_0x8059('0x52')]['id']}})['then'](handleEntityNotFound(_0x274d7f,null))[_0x8059('0x21')](removeEntity(_0x274d7f,null))[_0x8059('0x46')](handleError(_0x274d7f,null));};exports[_0x8059('0x59')]=function(_0x596974,_0x5be542,_0x185287){var _0x423133={'raw':!![],'where':{}};var _0x3a9f83={};var _0x47a599={'count':0x0,'rows':[]};return db[_0x8059('0x2e')][_0x8059('0x5a')]({'where':{'id':_0x596974[_0x8059('0x52')]['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x5be542,null))[_0x8059('0x21')](function(_0x2c9ab3){if(_0x2c9ab3){_0x3a9f83[_0x8059('0x35')]=_[_0x8059('0x48')](db[_0x8059('0x5b')][_0x8059('0x2f')]);_0x3a9f83[_0x8059('0x32')]=_[_0x8059('0x48')](_0x596974[_0x8059('0x32')]);_0x3a9f83[_0x8059('0x33')]=_['intersection'](_0x3a9f83['model'],_0x3a9f83[_0x8059('0x32')]);_0x423133[_0x8059('0x36')]=_['intersection'](_0x3a9f83[_0x8059('0x35')],qs[_0x8059('0x37')](_0x596974[_0x8059('0x32')][_0x8059('0x37')]));_0x423133['attributes']=_0x423133[_0x8059('0x36')][_0x8059('0x38')]?_0x423133[_0x8059('0x36')]:_0x3a9f83['model'];if(!_0x596974[_0x8059('0x32')][_0x8059('0x39')](_0x8059('0x3a'))){_0x423133[_0x8059('0x19')]=qs[_0x8059('0x19')](_0x596974[_0x8059('0x32')][_0x8059('0x19')]);_0x423133[_0x8059('0x1b')]=qs[_0x8059('0x1b')](_0x596974[_0x8059('0x32')][_0x8059('0x1b')]);}_0x423133[_0x8059('0x3b')]=qs[_0x8059('0x3c')](_0x596974[_0x8059('0x32')][_0x8059('0x3c')]);_0x423133['where']=qs[_0x8059('0x33')](_[_0x8059('0x3e')](_0x596974[_0x8059('0x32')],_0x3a9f83[_0x8059('0x33')]));_0x423133[_0x8059('0x3d')][_0x8059('0x5c')]=_0x2c9ab3['id'];if(_0x596974[_0x8059('0x32')][_0x8059('0x3f')]){_0x423133[_0x8059('0x3d')]=_[_0x8059('0x40')](_0x423133[_0x8059('0x3d')],{'$or':_[_0x8059('0x2d')](_0x423133[_0x8059('0x36')],function(_0x458c2d){var _0x1dc840={};_0x1dc840[_0x458c2d]={'$like':'%'+_0x596974[_0x8059('0x32')][_0x8059('0x3f')]+'%'};return _0x1dc840;})});}_0x423133=_[_0x8059('0x40')]({},_0x423133,_0x596974[_0x8059('0x43')]);return db[_0x8059('0x5b')]['count']({'where':_0x423133[_0x8059('0x3d')]})[_0x8059('0x21')](function(_0x4a8249){_0x47a599[_0x8059('0x1a')]=_0x4a8249;if(_0x596974[_0x8059('0x32')][_0x8059('0x44')]){_0x423133[_0x8059('0x49')]=[{'all':!![]}];}return db[_0x8059('0x5b')][_0x8059('0x45')](_0x423133);})[_0x8059('0x21')](function(_0x20c6fe){_0x47a599['rows']=_0x20c6fe;return _0x47a599;});}})['then'](respondWithFilteredResult(_0x5be542,_0x423133))[_0x8059('0x46')](handleError(_0x5be542,null));};exports[_0x8059('0x5d')]=function(_0x1739cb,_0x43765c,_0x297d13){var _0x29a42f={'raw':!![],'where':{}};var _0x1c7b00={};var _0x22ce95={'count':0x0,'rows':[]};return db[_0x8059('0x2e')][_0x8059('0x5a')]({'where':{'id':_0x1739cb[_0x8059('0x52')]['id']}})['then'](handleEntityNotFound(_0x43765c,null))['then'](function(_0x4e940b){if(_0x4e940b){_0x1c7b00[_0x8059('0x35')]=_[_0x8059('0x48')](db[_0x8059('0x5e')][_0x8059('0x2f')]);_0x1c7b00[_0x8059('0x32')]=_[_0x8059('0x48')](_0x1739cb[_0x8059('0x32')]);_0x1c7b00[_0x8059('0x33')]=_[_0x8059('0x34')](_0x1c7b00[_0x8059('0x35')],_0x1c7b00[_0x8059('0x32')]);_0x29a42f[_0x8059('0x36')]=_[_0x8059('0x34')](_0x1c7b00[_0x8059('0x35')],qs[_0x8059('0x37')](_0x1739cb['query'][_0x8059('0x37')]));_0x29a42f['attributes']=_0x29a42f[_0x8059('0x36')][_0x8059('0x38')]?_0x29a42f[_0x8059('0x36')]:_0x1c7b00['model'];if(!_0x1739cb[_0x8059('0x32')][_0x8059('0x39')](_0x8059('0x3a'))){_0x29a42f['limit']=qs[_0x8059('0x19')](_0x1739cb[_0x8059('0x32')][_0x8059('0x19')]);_0x29a42f['offset']=qs['offset'](_0x1739cb['query'][_0x8059('0x1b')]);}_0x29a42f[_0x8059('0x3b')]=qs[_0x8059('0x3c')](_0x1739cb[_0x8059('0x32')]['sort']);_0x29a42f['where']=qs[_0x8059('0x33')](_['pick'](_0x1739cb[_0x8059('0x32')],_0x1c7b00[_0x8059('0x33')]));_0x29a42f[_0x8059('0x3d')][_0x8059('0x5c')]=_0x4e940b['id'];if(_0x1739cb[_0x8059('0x32')][_0x8059('0x3f')]){_0x29a42f[_0x8059('0x3d')]=_[_0x8059('0x40')](_0x29a42f['where'],{'$or':_['map'](_0x29a42f[_0x8059('0x36')],function(_0x243e3a){var _0x437e68={};_0x437e68[_0x243e3a]={'$like':'%'+_0x1739cb[_0x8059('0x32')][_0x8059('0x3f')]+'%'};return _0x437e68;})});}_0x29a42f=_['merge']({},_0x29a42f,_0x1739cb[_0x8059('0x43')]);return db[_0x8059('0x5e')]['count']({'where':_0x29a42f[_0x8059('0x3d')]})[_0x8059('0x21')](function(_0x3f5fd8){_0x22ce95['count']=_0x3f5fd8;if(_0x1739cb[_0x8059('0x32')]['includeAll']){_0x29a42f[_0x8059('0x49')]=[{'all':!![]}];}return db[_0x8059('0x5e')]['findAll'](_0x29a42f);})[_0x8059('0x21')](function(_0x34b4be){_0x22ce95[_0x8059('0x5f')]=_0x34b4be;return _0x22ce95;});}})[_0x8059('0x21')](respondWithFilteredResult(_0x43765c,_0x29a42f))[_0x8059('0x46')](handleError(_0x43765c,null));};function char(_0xca3425){return'number'===typeof _0xca3425?String[_0x8059('0x60')][_0x8059('0x1d')](null,arguments):_0xca3425;}function needsEncapsulation(_0x15c8ca){return!!_0x15c8ca&&(_0x15c8ca[_0x8059('0x61')]()['indexOf'](char(0xd))>=0x0||_0x15c8ca[_0x8059('0x61')]()['indexOf'](char(0xa))>=0x0||_0x15c8ca[_0x8059('0x61')]()[_0x8059('0x62')](char(0x2c))>=0x0||_0x15c8ca[_0x8059('0x61')]()[_0x8059('0x62')](char(0x22))>=0x0);}function encapsulate(_0x9a0410){var _0x39181c=char(0x22),_0x44f9e1='\x5c'+char(0x22),_0x22438f=_0x9a0410[_0x8059('0x61')]()[_0x8059('0x63')](new RegExp(_0x39181c,'g'),_0x44f9e1);return _0x39181c+_0x22438f+_0x39181c;}exports[_0x8059('0x64')]=function(_0x2885f0,_0x589760,_0x7fd63c){var _0x4d077c,_0x3c05f8;var _0x578749={'where':{'ProjectId':_0x2885f0[_0x8059('0x52')]['id']}};if(_0x2885f0[_0x8059('0x32')]['startTime']){_0x578749[_0x8059('0x3d')][_0x8059('0x65')]=JSON[_0x8059('0x66')](_0x2885f0[_0x8059('0x32')][_0x8059('0x67')]);}return db[_0x8059('0x5b')][_0x8059('0x45')](_0x578749)[_0x8059('0x21')](handleEntityNotFound(_0x589760,null))[_0x8059('0x21')](function(_0x51ab15){if(_0x51ab15){_0x4d077c=_0x51ab15;return db['JscriptyQuestionReport'][_0x8059('0x45')]({'where':{'SessionId':{'$in':_[_0x8059('0x2d')](_0x4d077c,'id')},'ProjectId':_0x2885f0[_0x8059('0x52')]['id']},'order':'-createdAt'});}})[_0x8059('0x21')](handleEntityNotFound(_0x589760,null))['then'](function(_0xf785b4){if(_0xf785b4){_0x3c05f8=_0xf785b4;var _0x352883={};for(var _0x3aee8b=0x0,_0x32ce71=_0x3c05f8[_0x8059('0x38')];_0x3aee8b<_0x32ce71;_0x3aee8b++){if(!_0x352883[_0x8059('0x39')](_0x3c05f8[_0x3aee8b][_0x8059('0x68')])){_0x352883[_0x3c05f8[_0x3aee8b][_0x8059('0x68')]]=needsEncapsulation(_0x3c05f8[_0x3aee8b][_0x8059('0x69')])?encapsulate(_0x3c05f8[_0x3aee8b][_0x8059('0x69')]):_0x3c05f8[_0x3aee8b][_0x8059('0x69')];}}var _0x28bdfd=[],_0x3b2b36={};for(var _0x54749d=0x0,_0x280652=_0x4d077c[_0x8059('0x38')];_0x54749d<_0x280652;_0x54749d++){_0x3b2b36={'ProjectId':_0x2885f0[_0x8059('0x52')]['id'],'SessionId':_0x4d077c[_0x54749d]['id'],'StartTime':moment(_0x4d077c[_0x54749d][_0x8059('0x65')])[_0x8059('0x6a')](_0x8059('0x6b'))};for(var _0x44b2fb=0x0,_0x3e341e=_0x3c05f8[_0x8059('0x38')];_0x44b2fb<_0x3e341e;_0x44b2fb++){if(_0x3c05f8[_0x44b2fb][_0x8059('0x6c')]==_0x4d077c[_0x54749d]['id']&&_0x352883[_0x8059('0x39')](_0x3c05f8[_0x44b2fb][_0x8059('0x68')])){_0x3b2b36[_0x352883[_0x3c05f8[_0x44b2fb][_0x8059('0x68')]]]=_0x3c05f8[_0x44b2fb][_0x8059('0x6d')];}}for(var _0x178e4d in _0x352883){if(!_0x3b2b36[_0x8059('0x39')](_0x352883[_0x178e4d])){_0x3b2b36[_0x352883[_0x178e4d]]=null;}}_0x28bdfd[_0x8059('0x6e')](_0x3b2b36);}return _0x28bdfd;}})[_0x8059('0x21')](function(_0x3708d2){if(!_[_0x8059('0x6f')](_0x3708d2)){var _0x1fe485=toCsv(_0x3708d2);var _0x5aec47=Date['now']();fs[_0x8059('0x70')](util[_0x8059('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2885f0[_0x8059('0x52')]['id'],_0x5aec47),_0x1fe485);_0x589760['setHeader'](_0x8059('0x71'),'attachment;\x20filename='+util[_0x8059('0x6a')](_0x8059('0x72'),_0x2885f0['params']['id'],_0x5aec47));_0x589760['setHeader'](_0x8059('0x73'),_0x8059('0x74'));return _0x589760[_0x8059('0x75')](util[_0x8059('0x6a')](_0x8059('0x76'),_0x2885f0[_0x8059('0x52')]['id'],_0x5aec47));}else{return _0x589760[_0x8059('0x27')](0xcc);}})[_0x8059('0x46')](handleError(_0x589760,null));}; \ No newline at end of file +var _0x0e0f=['isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','undefined','limit','offset','save','then','destroy','get','Projects','UserProfileResource','end','error','stack','name','index','map','JscriptyProject','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','show','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','autoAssociation','params','omit','createdAt','updatedAt','body','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','ProjectId','JscriptySessionReport','findAll','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','parse','startTime','JscriptyQuestionReport','questionId','question','format','answer','push'];(function(_0x5ea846,_0x1e75c1){var _0x3e8a35=function(_0x1c34f2){while(--_0x1c34f2){_0x5ea846['push'](_0x5ea846['shift']());}};_0x3e8a35(++_0x1e75c1);}(_0x0e0f,0xe5));var _0xf0e0=function(_0x58f4b1,_0x483e98){_0x58f4b1=_0x58f4b1-0x0;var _0x37922d=_0x0e0f[_0x58f4b1];return _0x37922d;};'use strict';var emlformat=require(_0xf0e0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf0e0('0x1'));var rp=require(_0xf0e0('0x2'));var moment=require(_0xf0e0('0x3'));var BPromise=require(_0xf0e0('0x4'));var Mustache=require(_0xf0e0('0x5'));var util=require('util');var path=require(_0xf0e0('0x6'));var sox=require(_0xf0e0('0x7'));var csv=require('to-csv');var ejs=require(_0xf0e0('0x8'));var fs=require('fs');var fs_extra=require(_0xf0e0('0x9'));var _=require(_0xf0e0('0xa'));var squel=require(_0xf0e0('0xb'));var crypto=require(_0xf0e0('0xc'));var jsforce=require(_0xf0e0('0xd'));var deskjs=require(_0xf0e0('0xe'));var toCsv=require(_0xf0e0('0xf'));var querystring=require(_0xf0e0('0x10'));var Papa=require('papaparse');var Redis=require(_0xf0e0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf0e0('0x12'));var as=require(_0xf0e0('0x13'));var hardwareService=require(_0xf0e0('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0e0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501c86,_0x24d3a9){_0x24d3a9=_0x24d3a9||0xcc;return function(_0x5bd0ab){if(_0x5bd0ab){return _0x501c86[_0xf0e0('0x16')](_0x24d3a9);}return _0x501c86[_0xf0e0('0x17')](_0x24d3a9)['end']();};}function respondWithResult(_0x552683,_0x457bfc){_0x457bfc=_0x457bfc||0xc8;return function(_0x5b3719){if(_0x5b3719){return _0x552683[_0xf0e0('0x17')](_0x457bfc)['json'](_0x5b3719);}};}function respondWithFilteredResult(_0x3357f0,_0x55e350){return function(_0x40d87b){if(_0x40d87b){var _0x186e92=typeof _0x55e350['offset']===_0xf0e0('0x18')&&typeof _0x55e350[_0xf0e0('0x19')]===_0xf0e0('0x18');var _0x36206d=_0x40d87b['count'];var _0x3d725b=_0x186e92?0x0:_0x55e350[_0xf0e0('0x1a')];var _0x5e221e=_0x186e92?_0x40d87b['count']:_0x55e350[_0xf0e0('0x1a')]+_0x55e350[_0xf0e0('0x19')];var _0x51c8c8;if(_0x5e221e>=_0x36206d){_0x5e221e=_0x36206d;_0x51c8c8=0xc8;}else{_0x51c8c8=0xce;}_0x3357f0[_0xf0e0('0x17')](_0x51c8c8);return _0x3357f0['set']('Content-Range',_0x3d725b+'-'+_0x5e221e+'/'+_0x36206d)['json'](_0x40d87b);}return null;};}function patchUpdates(_0x350649){return function(_0x3ed3f8){try{jsonpatch['apply'](_0x3ed3f8,_0x350649,!![]);}catch(_0x54e139){return BPromise['reject'](_0x54e139);}return _0x3ed3f8[_0xf0e0('0x1b')]();};}function saveUpdates(_0x52e518,_0x586ef0){return function(_0x48b789){if(_0x48b789){return _0x48b789['update'](_0x52e518)[_0xf0e0('0x1c')](function(_0x357e3a){return _0x357e3a;});}return null;};}function removeEntity(_0x1a1cdb,_0x211d1c){return function(_0x507c66){if(_0x507c66){return _0x507c66[_0xf0e0('0x1d')]()[_0xf0e0('0x1c')](function(){var _0x4b3d0a=_0x507c66[_0xf0e0('0x1e')]({'plain':!![]});var _0x50cb6e=_0xf0e0('0x1f');return db[_0xf0e0('0x20')]['destroy']({'where':{'type':_0x50cb6e,'resourceId':_0x4b3d0a['id']}})[_0xf0e0('0x1c')](function(){return _0x507c66;});})[_0xf0e0('0x1c')](function(){_0x1a1cdb['status'](0xcc)[_0xf0e0('0x21')]();});}};}function handleEntityNotFound(_0x3eda84,_0x596241){return function(_0x33b5e1){if(!_0x33b5e1){_0x3eda84[_0xf0e0('0x16')](0x194);}return _0x33b5e1;};}function handleError(_0x2ac9d3,_0x658ca1){_0x658ca1=_0x658ca1||0x1f4;return function(_0x3b4a3b){logger[_0xf0e0('0x22')](_0x3b4a3b[_0xf0e0('0x23')]);if(_0x3b4a3b[_0xf0e0('0x24')]){delete _0x3b4a3b['name'];}_0x2ac9d3[_0xf0e0('0x17')](_0x658ca1)['send'](_0x3b4a3b);};}exports[_0xf0e0('0x25')]=function(_0x5c9850,_0x22996c){var _0x3d5330={},_0x2f6b9d={},_0x3c9b24={'count':0x0,'rows':[]};var _0x5b21f2=_[_0xf0e0('0x26')](db[_0xf0e0('0x27')][_0xf0e0('0x28')],function(_0x2ca25b){return{'name':_0x2ca25b['fieldName'],'type':_0x2ca25b[_0xf0e0('0x29')][_0xf0e0('0x2a')]};});_0x2f6b9d[_0xf0e0('0x2b')]=_[_0xf0e0('0x26')](_0x5b21f2,_0xf0e0('0x24'));_0x2f6b9d['query']=_[_0xf0e0('0x2c')](_0x5c9850[_0xf0e0('0x2d')]);_0x2f6b9d[_0xf0e0('0x2e')]=_[_0xf0e0('0x2f')](_0x2f6b9d[_0xf0e0('0x2b')],_0x2f6b9d['query']);_0x3d5330[_0xf0e0('0x30')]=_[_0xf0e0('0x2f')](_0x2f6b9d['model'],qs[_0xf0e0('0x31')](_0x5c9850[_0xf0e0('0x2d')][_0xf0e0('0x31')]));_0x3d5330[_0xf0e0('0x30')]=_0x3d5330[_0xf0e0('0x30')][_0xf0e0('0x32')]?_0x3d5330[_0xf0e0('0x30')]:_0x2f6b9d['model'];if(!_0x5c9850[_0xf0e0('0x2d')][_0xf0e0('0x33')](_0xf0e0('0x34'))){_0x3d5330[_0xf0e0('0x19')]=qs[_0xf0e0('0x19')](_0x5c9850[_0xf0e0('0x2d')]['limit']);_0x3d5330['offset']=qs[_0xf0e0('0x1a')](_0x5c9850['query'][_0xf0e0('0x1a')]);}_0x3d5330[_0xf0e0('0x35')]=qs[_0xf0e0('0x36')](_0x5c9850[_0xf0e0('0x2d')]['sort']);_0x3d5330['where']=qs[_0xf0e0('0x2e')](_[_0xf0e0('0x37')](_0x5c9850[_0xf0e0('0x2d')],_0x2f6b9d[_0xf0e0('0x2e')]),_0x5b21f2);if(_0x5c9850[_0xf0e0('0x2d')][_0xf0e0('0x38')]){_0x3d5330[_0xf0e0('0x39')]=_[_0xf0e0('0x3a')](_0x3d5330[_0xf0e0('0x39')],{'$or':_[_0xf0e0('0x26')](_0x5b21f2,function(_0x53cb3c){if(_0x53cb3c['type']!==_0xf0e0('0x3b')){var _0x377ee3={};_0x377ee3[_0x53cb3c[_0xf0e0('0x24')]]={'$like':'%'+_0x5c9850[_0xf0e0('0x2d')][_0xf0e0('0x38')]+'%'};return _0x377ee3;}})});}_0x3d5330=_[_0xf0e0('0x3a')]({},_0x3d5330,_0x5c9850[_0xf0e0('0x3c')]);var _0x395b02={'where':_0x3d5330[_0xf0e0('0x39')]};return db['JscriptyProject'][_0xf0e0('0x3d')](_0x395b02)[_0xf0e0('0x1c')](function(_0x58a046){_0x3c9b24[_0xf0e0('0x3d')]=_0x58a046;if(_0x5c9850[_0xf0e0('0x2d')][_0xf0e0('0x3e')]){_0x3d5330['include']=[{'all':!![]}];}return db[_0xf0e0('0x27')]['findAll'](_0x3d5330);})['then'](function(_0x557025){_0x3c9b24['rows']=_0x557025;return _0x3c9b24;})[_0xf0e0('0x1c')](respondWithFilteredResult(_0x22996c,_0x3d5330))['catch'](handleError(_0x22996c,null));};exports[_0xf0e0('0x3f')]=function(_0x2c1c1e,_0x32fba3){var _0x5c654e={'raw':![],'where':{'id':_0x2c1c1e['params']['id']}},_0x2b3eec={};_0x2b3eec['model']=_[_0xf0e0('0x2c')](db['JscriptyProject']['rawAttributes']);_0x2b3eec[_0xf0e0('0x2d')]=_[_0xf0e0('0x2c')](_0x2c1c1e['query']);_0x2b3eec['filters']=_['intersection'](_0x2b3eec[_0xf0e0('0x2b')],_0x2b3eec[_0xf0e0('0x2d')]);_0x5c654e[_0xf0e0('0x30')]=_[_0xf0e0('0x2f')](_0x2b3eec[_0xf0e0('0x2b')],qs[_0xf0e0('0x31')](_0x2c1c1e[_0xf0e0('0x2d')]['fields']));_0x5c654e[_0xf0e0('0x30')]=_0x5c654e[_0xf0e0('0x30')][_0xf0e0('0x32')]?_0x5c654e[_0xf0e0('0x30')]:_0x2b3eec[_0xf0e0('0x2b')];if(_0x2c1c1e['query'][_0xf0e0('0x3e')]){_0x5c654e[_0xf0e0('0x40')]=[{'all':!![]}];}_0x5c654e=_['merge']({},_0x5c654e,_0x2c1c1e['options']);return db[_0xf0e0('0x27')]['find'](_0x5c654e)['then'](handleEntityNotFound(_0x32fba3,null))[_0xf0e0('0x1c')](respondWithResult(_0x32fba3,null))[_0xf0e0('0x41')](handleError(_0x32fba3,null));};exports[_0xf0e0('0x42')]=function(_0x47bc00,_0xec7588){return db['JscriptyProject'][_0xf0e0('0x42')](_0x47bc00['body'],{})[_0xf0e0('0x1c')](function(_0x268222){var _0x4a4a82=_0x47bc00['user'][_0xf0e0('0x1e')]({'plain':!![]});if(!_0x4a4a82)throw new Error(_0xf0e0('0x43'));if(_0x4a4a82['role']===_0xf0e0('0x44')){var _0x38edd0=_0x268222[_0xf0e0('0x1e')]({'plain':!![]});var _0xba4121=_0xf0e0('0x1f');return db['UserProfileSection'][_0xf0e0('0x45')]({'where':{'name':_0xba4121,'userProfileId':_0x4a4a82['userProfileId']},'raw':!![]})[_0xf0e0('0x1c')](function(_0x30dda4){if(_0x30dda4&&_0x30dda4[_0xf0e0('0x46')]===0x0){return db[_0xf0e0('0x20')]['create']({'name':_0x38edd0[_0xf0e0('0x24')],'resourceId':_0x38edd0['id'],'type':_0x30dda4[_0xf0e0('0x24')],'sectionId':_0x30dda4['id']},{})['then'](function(){return _0x268222;});}else{return _0x268222;}})[_0xf0e0('0x41')](function(_0x466370){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x466370);throw _0x466370;});}return _0x268222;})[_0xf0e0('0x1c')](respondWithResult(_0xec7588,0xc9))[_0xf0e0('0x41')](handleError(_0xec7588,null));};exports['clone']=function(_0x424a4c,_0x246026){var _0x5bf278={'where':{'id':_0x424a4c[_0xf0e0('0x47')]['id']}},_0x32ed15={};_0x32ed15[_0xf0e0('0x2b')]=_[_0xf0e0('0x2c')](db[_0xf0e0('0x27')][_0xf0e0('0x28')]);_0x5bf278[_0xf0e0('0x30')]=_[_0xf0e0('0x2f')](_0x32ed15[_0xf0e0('0x2b')],qs['fields'](_0x424a4c[_0xf0e0('0x2d')][_0xf0e0('0x31')]));_0x5bf278['attributes']=_0x5bf278[_0xf0e0('0x30')][_0xf0e0('0x32')]?_0x5bf278[_0xf0e0('0x30')]:_0x32ed15[_0xf0e0('0x2b')];if(_0x424a4c[_0xf0e0('0x2d')]['includeAll']){_0x5bf278[_0xf0e0('0x40')]=[{'all':!![]}];}_0x5bf278=_[_0xf0e0('0x3a')]({},_0x5bf278,_0x424a4c[_0xf0e0('0x3c')]);return db[_0xf0e0('0x27')][_0xf0e0('0x45')](_0x5bf278)['then'](handleEntityNotFound(_0x246026,null))[_0xf0e0('0x1c')](function(_0x202b4d){if(_0x202b4d){var _0x4c36ad=_0x202b4d[_0xf0e0('0x1e')]({'plain':!![]});_0x4c36ad=qs[_0xf0e0('0x48')](_0x4c36ad,['id',_0xf0e0('0x49'),_0xf0e0('0x4a')]);_0x424a4c[_0xf0e0('0x4b')]=_[_0xf0e0('0x48')](_0x424a4c[_0xf0e0('0x4b')],['id',_0xf0e0('0x49'),_0xf0e0('0x4a')]);return db['JscriptyProject']['create'](_[_0xf0e0('0x3a')](_0x4c36ad,_0x424a4c[_0xf0e0('0x4b')]),{'include':_0x424a4c[_0xf0e0('0x2d')][_0xf0e0('0x3e')]?[{'all':!![]}]:undefined})[_0xf0e0('0x1c')](function(_0x52716d){var _0x2bb319=_0x424a4c[_0xf0e0('0x44')][_0xf0e0('0x1e')]({'plain':!![]});if(!_0x2bb319)throw new Error(_0xf0e0('0x43'));if(_0x2bb319['role']===_0xf0e0('0x44')){var _0x4043ae=_0x52716d[_0xf0e0('0x1e')]({'plain':!![]});var _0x270f74='Projects';return db[_0xf0e0('0x4c')][_0xf0e0('0x45')]({'where':{'name':_0x270f74,'userProfileId':_0x2bb319[_0xf0e0('0x4d')]},'raw':!![]})[_0xf0e0('0x1c')](function(_0x576303){if(_0x576303&&_0x576303[_0xf0e0('0x46')]===0x0){return db[_0xf0e0('0x20')]['create']({'name':_0x4043ae[_0xf0e0('0x24')],'resourceId':_0x4043ae['id'],'type':_0x576303[_0xf0e0('0x24')],'sectionId':_0x576303['id']},{})[_0xf0e0('0x1c')](function(){return _0x52716d;});}else{return _0x52716d;}})[_0xf0e0('0x41')](function(_0x41dec1){logger['error'](_0xf0e0('0x4e'),_0x41dec1);throw _0x41dec1;});}return _0x52716d;});}})[_0xf0e0('0x1c')](respondWithResult(_0x246026,0xc9))[_0xf0e0('0x41')](handleError(_0x246026,null));};exports['update']=function(_0x285925,_0x50d4ee){if(_0x285925[_0xf0e0('0x4b')]['id']){delete _0x285925[_0xf0e0('0x4b')]['id'];}return db[_0xf0e0('0x27')][_0xf0e0('0x45')]({'where':{'id':_0x285925[_0xf0e0('0x47')]['id']}})[_0xf0e0('0x1c')](handleEntityNotFound(_0x50d4ee,null))['then'](saveUpdates(_0x285925[_0xf0e0('0x4b')],null))[_0xf0e0('0x1c')](respondWithResult(_0x50d4ee,null))[_0xf0e0('0x41')](handleError(_0x50d4ee,null));};exports['destroy']=function(_0x1b8024,_0x396eb5){return db['JscriptyProject']['find']({'where':{'id':_0x1b8024['params']['id']}})['then'](handleEntityNotFound(_0x396eb5,null))[_0xf0e0('0x1c')](removeEntity(_0x396eb5,null))[_0xf0e0('0x41')](handleError(_0x396eb5,null));};exports['getSessions']=function(_0x480beb,_0x3b80fd,_0x5b6840){var _0x27afba={'raw':!![],'where':{}};var _0xf09874={};var _0x3a09ad={'count':0x0,'rows':[]};return db[_0xf0e0('0x27')][_0xf0e0('0x4f')]({'where':{'id':_0x480beb[_0xf0e0('0x47')]['id']}})[_0xf0e0('0x1c')](handleEntityNotFound(_0x3b80fd,null))[_0xf0e0('0x1c')](function(_0x387c3d){if(_0x387c3d){_0xf09874[_0xf0e0('0x2b')]=_['keys'](db['JscriptySessionReport'][_0xf0e0('0x28')]);_0xf09874[_0xf0e0('0x2d')]=_[_0xf0e0('0x2c')](_0x480beb['query']);_0xf09874[_0xf0e0('0x2e')]=_[_0xf0e0('0x2f')](_0xf09874[_0xf0e0('0x2b')],_0xf09874['query']);_0x27afba[_0xf0e0('0x30')]=_['intersection'](_0xf09874[_0xf0e0('0x2b')],qs[_0xf0e0('0x31')](_0x480beb[_0xf0e0('0x2d')][_0xf0e0('0x31')]));_0x27afba[_0xf0e0('0x30')]=_0x27afba[_0xf0e0('0x30')]['length']?_0x27afba['attributes']:_0xf09874[_0xf0e0('0x2b')];if(!_0x480beb[_0xf0e0('0x2d')][_0xf0e0('0x33')](_0xf0e0('0x34'))){_0x27afba[_0xf0e0('0x19')]=qs[_0xf0e0('0x19')](_0x480beb[_0xf0e0('0x2d')][_0xf0e0('0x19')]);_0x27afba[_0xf0e0('0x1a')]=qs[_0xf0e0('0x1a')](_0x480beb[_0xf0e0('0x2d')][_0xf0e0('0x1a')]);}_0x27afba['order']=qs[_0xf0e0('0x36')](_0x480beb[_0xf0e0('0x2d')][_0xf0e0('0x36')]);_0x27afba['where']=qs[_0xf0e0('0x2e')](_[_0xf0e0('0x37')](_0x480beb[_0xf0e0('0x2d')],_0xf09874['filters']));_0x27afba['where'][_0xf0e0('0x50')]=_0x387c3d['id'];if(_0x480beb['query'][_0xf0e0('0x38')]){_0x27afba[_0xf0e0('0x39')]=_[_0xf0e0('0x3a')](_0x27afba[_0xf0e0('0x39')],{'$or':_[_0xf0e0('0x26')](_0x27afba[_0xf0e0('0x30')],function(_0x54e615){var _0x5f0033={};_0x5f0033[_0x54e615]={'$like':'%'+_0x480beb[_0xf0e0('0x2d')][_0xf0e0('0x38')]+'%'};return _0x5f0033;})});}_0x27afba=_[_0xf0e0('0x3a')]({},_0x27afba,_0x480beb[_0xf0e0('0x3c')]);return db[_0xf0e0('0x51')]['count']({'where':_0x27afba[_0xf0e0('0x39')]})[_0xf0e0('0x1c')](function(_0x25ec4f){_0x3a09ad[_0xf0e0('0x3d')]=_0x25ec4f;if(_0x480beb[_0xf0e0('0x2d')]['includeAll']){_0x27afba[_0xf0e0('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xf0e0('0x52')](_0x27afba);})[_0xf0e0('0x1c')](function(_0x4aff7e){_0x3a09ad[_0xf0e0('0x53')]=_0x4aff7e;return _0x3a09ad;});}})[_0xf0e0('0x1c')](respondWithFilteredResult(_0x3b80fd,_0x27afba))[_0xf0e0('0x41')](handleError(_0x3b80fd,null));};exports[_0xf0e0('0x54')]=function(_0x30dcc5,_0x3c73e9,_0x547a52){var _0x4ae602={'raw':!![],'where':{}};var _0x5b788f={};var _0x32a7ce={'count':0x0,'rows':[]};return db[_0xf0e0('0x27')][_0xf0e0('0x4f')]({'where':{'id':_0x30dcc5[_0xf0e0('0x47')]['id']}})[_0xf0e0('0x1c')](handleEntityNotFound(_0x3c73e9,null))[_0xf0e0('0x1c')](function(_0x751548){if(_0x751548){_0x5b788f[_0xf0e0('0x2b')]=_[_0xf0e0('0x2c')](db[_0xf0e0('0x55')][_0xf0e0('0x28')]);_0x5b788f[_0xf0e0('0x2d')]=_[_0xf0e0('0x2c')](_0x30dcc5[_0xf0e0('0x2d')]);_0x5b788f[_0xf0e0('0x2e')]=_[_0xf0e0('0x2f')](_0x5b788f[_0xf0e0('0x2b')],_0x5b788f[_0xf0e0('0x2d')]);_0x4ae602[_0xf0e0('0x30')]=_[_0xf0e0('0x2f')](_0x5b788f['model'],qs[_0xf0e0('0x31')](_0x30dcc5[_0xf0e0('0x2d')][_0xf0e0('0x31')]));_0x4ae602[_0xf0e0('0x30')]=_0x4ae602[_0xf0e0('0x30')][_0xf0e0('0x32')]?_0x4ae602[_0xf0e0('0x30')]:_0x5b788f[_0xf0e0('0x2b')];if(!_0x30dcc5[_0xf0e0('0x2d')][_0xf0e0('0x33')](_0xf0e0('0x34'))){_0x4ae602[_0xf0e0('0x19')]=qs[_0xf0e0('0x19')](_0x30dcc5[_0xf0e0('0x2d')][_0xf0e0('0x19')]);_0x4ae602[_0xf0e0('0x1a')]=qs[_0xf0e0('0x1a')](_0x30dcc5[_0xf0e0('0x2d')]['offset']);}_0x4ae602[_0xf0e0('0x35')]=qs[_0xf0e0('0x36')](_0x30dcc5['query'][_0xf0e0('0x36')]);_0x4ae602[_0xf0e0('0x39')]=qs[_0xf0e0('0x2e')](_[_0xf0e0('0x37')](_0x30dcc5['query'],_0x5b788f[_0xf0e0('0x2e')]));_0x4ae602[_0xf0e0('0x39')][_0xf0e0('0x50')]=_0x751548['id'];if(_0x30dcc5[_0xf0e0('0x2d')][_0xf0e0('0x38')]){_0x4ae602[_0xf0e0('0x39')]=_[_0xf0e0('0x3a')](_0x4ae602[_0xf0e0('0x39')],{'$or':_[_0xf0e0('0x26')](_0x4ae602[_0xf0e0('0x30')],function(_0x98b134){var _0x4d14f7={};_0x4d14f7[_0x98b134]={'$like':'%'+_0x30dcc5['query'][_0xf0e0('0x38')]+'%'};return _0x4d14f7;})});}_0x4ae602=_['merge']({},_0x4ae602,_0x30dcc5[_0xf0e0('0x3c')]);return db['JscriptyAnswerReport'][_0xf0e0('0x3d')]({'where':_0x4ae602['where']})['then'](function(_0x3edc45){_0x32a7ce[_0xf0e0('0x3d')]=_0x3edc45;if(_0x30dcc5[_0xf0e0('0x2d')][_0xf0e0('0x3e')]){_0x4ae602[_0xf0e0('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xf0e0('0x52')](_0x4ae602);})['then'](function(_0x59dde8){_0x32a7ce[_0xf0e0('0x53')]=_0x59dde8;return _0x32a7ce;});}})[_0xf0e0('0x1c')](respondWithFilteredResult(_0x3c73e9,_0x4ae602))[_0xf0e0('0x41')](handleError(_0x3c73e9,null));};function char(_0x2d3ede){return _0xf0e0('0x56')===typeof _0x2d3ede?String[_0xf0e0('0x57')][_0xf0e0('0x58')](null,arguments):_0x2d3ede;}function needsEncapsulation(_0x16604a){return!!_0x16604a&&(_0x16604a[_0xf0e0('0x59')]()['indexOf'](char(0xd))>=0x0||_0x16604a[_0xf0e0('0x59')]()[_0xf0e0('0x5a')](char(0xa))>=0x0||_0x16604a[_0xf0e0('0x59')]()['indexOf'](char(0x2c))>=0x0||_0x16604a[_0xf0e0('0x59')]()[_0xf0e0('0x5a')](char(0x22))>=0x0);}function encapsulate(_0x4daf97){var _0x374830=char(0x22),_0xd412a0='\x5c'+char(0x22),_0xadc36b=_0x4daf97[_0xf0e0('0x59')]()[_0xf0e0('0x5b')](new RegExp(_0x374830,'g'),_0xd412a0);return _0x374830+_0xadc36b+_0x374830;}exports[_0xf0e0('0x5c')]=function(_0x46b495,_0x2b9d18,_0x529464){var _0x2cb173,_0x1ce122;var _0x444216={'where':{'ProjectId':_0x46b495[_0xf0e0('0x47')]['id']}};if(_0x46b495[_0xf0e0('0x2d')]['startTime']){_0x444216['where']['starttime']=JSON[_0xf0e0('0x5d')](_0x46b495[_0xf0e0('0x2d')][_0xf0e0('0x5e')]);}return db[_0xf0e0('0x51')][_0xf0e0('0x52')](_0x444216)[_0xf0e0('0x1c')](handleEntityNotFound(_0x2b9d18,null))[_0xf0e0('0x1c')](function(_0x33838b){if(_0x33838b){_0x2cb173=_0x33838b;return db[_0xf0e0('0x5f')][_0xf0e0('0x52')]({'where':{'SessionId':{'$in':_[_0xf0e0('0x26')](_0x2cb173,'id')},'ProjectId':_0x46b495[_0xf0e0('0x47')]['id']},'order':'-createdAt'});}})[_0xf0e0('0x1c')](handleEntityNotFound(_0x2b9d18,null))['then'](function(_0x17dc2a){if(_0x17dc2a){_0x1ce122=_0x17dc2a;var _0xa75245={};for(var _0x494fca=0x0,_0x516c01=_0x1ce122[_0xf0e0('0x32')];_0x494fca<_0x516c01;_0x494fca++){if(!_0xa75245['hasOwnProperty'](_0x1ce122[_0x494fca][_0xf0e0('0x60')])){_0xa75245[_0x1ce122[_0x494fca][_0xf0e0('0x60')]]=needsEncapsulation(_0x1ce122[_0x494fca]['question'])?encapsulate(_0x1ce122[_0x494fca][_0xf0e0('0x61')]):_0x1ce122[_0x494fca]['question'];}}var _0x5d9192=[],_0x33130e={};for(var _0x2ef457=0x0,_0x9a951b=_0x2cb173[_0xf0e0('0x32')];_0x2ef457<_0x9a951b;_0x2ef457++){_0x33130e={'ProjectId':_0x46b495[_0xf0e0('0x47')]['id'],'SessionId':_0x2cb173[_0x2ef457]['id'],'StartTime':moment(_0x2cb173[_0x2ef457]['starttime'])[_0xf0e0('0x62')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x4193a7=0x0,_0x58659d=_0x1ce122['length'];_0x4193a7<_0x58659d;_0x4193a7++){if(_0x1ce122[_0x4193a7]['SessionId']==_0x2cb173[_0x2ef457]['id']&&_0xa75245[_0xf0e0('0x33')](_0x1ce122[_0x4193a7][_0xf0e0('0x60')])){_0x33130e[_0xa75245[_0x1ce122[_0x4193a7][_0xf0e0('0x60')]]]=_0x1ce122[_0x4193a7][_0xf0e0('0x63')];}}for(var _0x24d212 in _0xa75245){if(!_0x33130e[_0xf0e0('0x33')](_0xa75245[_0x24d212])){_0x33130e[_0xa75245[_0x24d212]]=null;}}_0x5d9192[_0xf0e0('0x64')](_0x33130e);}return _0x5d9192;}})[_0xf0e0('0x1c')](function(_0x49b276){if(!_[_0xf0e0('0x65')](_0x49b276)){var _0x4d6934=toCsv(_0x49b276);var _0xc4d653=Date[_0xf0e0('0x66')]();fs[_0xf0e0('0x67')](util[_0xf0e0('0x62')](_0xf0e0('0x68'),_0x46b495[_0xf0e0('0x47')]['id'],_0xc4d653),_0x4d6934);_0x2b9d18[_0xf0e0('0x69')](_0xf0e0('0x6a'),_0xf0e0('0x6b')+util[_0xf0e0('0x62')](_0xf0e0('0x6c'),_0x46b495['params']['id'],_0xc4d653));_0x2b9d18[_0xf0e0('0x69')]('Content-type',_0xf0e0('0x6d'));return _0x2b9d18['download'](util['format'](_0xf0e0('0x68'),_0x46b495[_0xf0e0('0x47')]['id'],_0xc4d653));}else{return _0x2b9d18['sendStatus'](0xcc);}})[_0xf0e0('0x41')](handleError(_0x2b9d18,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 37bfe04..479220f 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 _0x67a2=['define','jscripty_projects','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4acf63,_0x2a7330){var _0x26bcd0=function(_0x3b3b18){while(--_0x3b3b18){_0x4acf63['push'](_0x4acf63['shift']());}};_0x26bcd0(++_0x2a7330);}(_0x67a2,0xd3));var _0x267a=function(_0xdcec58,_0x3e2028){_0xdcec58=_0xdcec58-0x0;var _0x23931c=_0x67a2[_0xdcec58];return _0x23931c;};'use strict';var _=require(_0x267a('0x0'));var util=require(_0x267a('0x1'));var logger=require('../../config/logger')(_0x267a('0x2'));var moment=require(_0x267a('0x3'));var BPromise=require(_0x267a('0x4'));var rp=require(_0x267a('0x5'));var fs=require('fs');var path=require(_0x267a('0x6'));var rimraf=require(_0x267a('0x7'));var config=require(_0x267a('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x17090d,_0x3539d5){return _0x17090d[_0x267a('0x9')]('JscriptyProject',attributes,{'tableName':_0x267a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bac=['../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5f47aa,_0x320085){var _0x8830a=function(_0x4af198){while(--_0x4af198){_0x5f47aa['push'](_0x5f47aa['shift']());}};_0x8830a(++_0x320085);}(_0x6bac,0xa5));var _0xc6ba=function(_0x54cc10,_0x3a14d8){_0x54cc10=_0x54cc10-0x0;var _0x545750=_0x6bac[_0x54cc10];return _0x545750;};'use strict';var _=require(_0xc6ba('0x0'));var util=require('util');var logger=require(_0xc6ba('0x1'))(_0xc6ba('0x2'));var moment=require(_0xc6ba('0x3'));var BPromise=require(_0xc6ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6ba('0x5'));var attributes=require(_0xc6ba('0x6'));module['exports']=function(_0x222f20,_0x2a16af){return _0x222f20[_0xc6ba('0x7')](_0xc6ba('0x8'),attributes,{'tableName':_0xc6ba('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 13ac871..4cffdd8 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x9e575,_0x5894d4){var _0x522277=function(_0x1f5458){while(--_0x1f5458){_0x9e575['push'](_0x9e575['shift']());}};_0x522277(++_0x5894d4);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1943d6,_0x4a961c){var _0x317768=function(_0x39469f){while(--_0x39469f){_0x1943d6['push'](_0x1943d6['shift']());}};_0x317768(++_0x4a961c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index ba9243a..d8685b7 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 _0x14bf=['isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get'];(function(_0x56683a,_0x335f95){var _0x13c620=function(_0x31027b){while(--_0x31027b){_0x56683a['push'](_0x56683a['shift']());}};_0x13c620(++_0x335f95);}(_0x14bf,0x89));var _0xf14b=function(_0x1227d9,_0x396428){_0x1227d9=_0x1227d9-0x0;var _0x2e329e=_0x14bf[_0x1227d9];return _0x2e329e;};'use strict';var multer=require(_0xf14b('0x0'));var util=require(_0xf14b('0x1'));var path=require('path');var timeout=require(_0xf14b('0x2'));var express=require(_0xf14b('0x3'));var router=express[_0xf14b('0x4')]();var fs_extra=require(_0xf14b('0x5'));var auth=require(_0xf14b('0x6'));var interaction=require(_0xf14b('0x7'));var config=require('../../config/environment');var controller=require(_0xf14b('0x8'));router[_0xf14b('0x9')]('/',auth[_0xf14b('0xa')](),controller[_0xf14b('0xb')]);router[_0xf14b('0x9')](_0xf14b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xf14b('0x9')](_0xf14b('0xd'),auth[_0xf14b('0xa')](),controller[_0xf14b('0xe')]);router[_0xf14b('0xf')]('/',auth['isAuthenticated'](),controller[_0xf14b('0x10')]);router[_0xf14b('0x11')](_0xf14b('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf14b('0x12')](_0xf14b('0xd'),auth['isAuthenticated'](),controller[_0xf14b('0x13')]);module[_0xf14b('0x14')]=router; \ No newline at end of file +var _0x7876=['isAuthenticated','index','get','describe','show','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller'];(function(_0xcc3caf,_0x11800f){var _0x5d1173=function(_0x398db1){while(--_0x398db1){_0xcc3caf['push'](_0xcc3caf['shift']());}};_0x5d1173(++_0x11800f);}(_0x7876,0x11a));var _0x6787=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x7876[_0x319cb9];return _0x1735fc;};'use strict';var multer=require('multer');var util=require(_0x6787('0x0'));var path=require(_0x6787('0x1'));var timeout=require(_0x6787('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6787('0x3'));var interaction=require(_0x6787('0x4'));var config=require('../../config/environment');var controller=require(_0x6787('0x5'));router['get']('/',auth[_0x6787('0x6')](),controller[_0x6787('0x7')]);router[_0x6787('0x8')]('/describe',auth[_0x6787('0x6')](),controller[_0x6787('0x9')]);router[_0x6787('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6787('0xa')]);router[_0x6787('0xb')]('/',auth[_0x6787('0x6')](),controller['create']);router[_0x6787('0xc')](_0x6787('0xd'),auth[_0x6787('0x6')](),controller[_0x6787('0xe')]);router[_0x6787('0xf')](_0x6787('0xd'),auth[_0x6787('0x6')](),controller[_0x6787('0x10')]);module[_0x6787('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 8060f21..f2516a7 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x107d8f,_0x47d401){_0x107d8f=_0x107d8f-0x0;var _0x3cf3b8=_0x7a54[_0x107d8f];return _0x3cf3b8;};'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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x510a72,_0xfd82bb){_0x510a72=_0x510a72-0x0;var _0x57780f=_0x7a54[_0x510a72];return _0x57780f;};'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 f1852bd..6dc5286 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 _0xaef2=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','stack','name','map','JscriptyQuestionReport','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs'];(function(_0x235326,_0x251051){var _0x43a1d7=function(_0x1e79d9){while(--_0x1e79d9){_0x235326['push'](_0x235326['shift']());}};_0x43a1d7(++_0x251051);}(_0xaef2,0x169));var _0x2aef=function(_0x45d8b0,_0x42b4ea){_0x45d8b0=_0x45d8b0-0x0;var _0x4b04c8=_0xaef2[_0x45d8b0];return _0x4b04c8;};'use strict';var emlformat=require(_0x2aef('0x0'));var rimraf=require(_0x2aef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2aef('0x2'));var moment=require(_0x2aef('0x3'));var BPromise=require(_0x2aef('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2aef('0x5'));var sox=require(_0x2aef('0x6'));var csv=require(_0x2aef('0x7'));var ejs=require(_0x2aef('0x8'));var fs=require('fs');var fs_extra=require(_0x2aef('0x9'));var _=require('lodash');var squel=require(_0x2aef('0xa'));var crypto=require(_0x2aef('0xb'));var jsforce=require(_0x2aef('0xc'));var deskjs=require(_0x2aef('0xd'));var toCsv=require(_0x2aef('0x7'));var querystring=require(_0x2aef('0xe'));var Papa=require(_0x2aef('0xf'));var Redis=require('ioredis');var authService=require(_0x2aef('0x10'));var qs=require(_0x2aef('0x11'));var as=require(_0x2aef('0x12'));var hardwareService=require(_0x2aef('0x13'));var logger=require(_0x2aef('0x14'))('api');var utils=require(_0x2aef('0x15'));var config=require(_0x2aef('0x16'));var licenseUtil=require(_0x2aef('0x17'));var db=require(_0x2aef('0x18'))['db'];function respondWithStatusCode(_0x38e36b,_0x4cc0c6){_0x4cc0c6=_0x4cc0c6||0xcc;return function(_0x5311fa){if(_0x5311fa){return _0x38e36b[_0x2aef('0x19')](_0x4cc0c6);}return _0x38e36b[_0x2aef('0x1a')](_0x4cc0c6)[_0x2aef('0x1b')]();};}function respondWithResult(_0x35749b,_0x316f9b){_0x316f9b=_0x316f9b||0xc8;return function(_0x253cc0){if(_0x253cc0){return _0x35749b['status'](_0x316f9b)[_0x2aef('0x1c')](_0x253cc0);}};}function respondWithFilteredResult(_0x122972,_0x1162ee){return function(_0x525141){if(_0x525141){var _0x15409b=typeof _0x1162ee['offset']===_0x2aef('0x1d')&&typeof _0x1162ee[_0x2aef('0x1e')]===_0x2aef('0x1d');var _0x3469c7=_0x525141['count'];var _0x3bd59a=_0x15409b?0x0:_0x1162ee[_0x2aef('0x1f')];var _0x21706e=_0x15409b?_0x525141[_0x2aef('0x20')]:_0x1162ee[_0x2aef('0x1f')]+_0x1162ee[_0x2aef('0x1e')];var _0x805394;if(_0x21706e>=_0x3469c7){_0x21706e=_0x3469c7;_0x805394=0xc8;}else{_0x805394=0xce;}_0x122972[_0x2aef('0x1a')](_0x805394);return _0x122972['set'](_0x2aef('0x21'),_0x3bd59a+'-'+_0x21706e+'/'+_0x3469c7)[_0x2aef('0x1c')](_0x525141);}return null;};}function patchUpdates(_0x16a967){return function(_0x4044e9){try{jsonpatch[_0x2aef('0x22')](_0x4044e9,_0x16a967,!![]);}catch(_0x4af020){return BPromise[_0x2aef('0x23')](_0x4af020);}return _0x4044e9[_0x2aef('0x24')]();};}function saveUpdates(_0x2d25c2,_0x1b9900){return function(_0x5df463){if(_0x5df463){return _0x5df463[_0x2aef('0x25')](_0x2d25c2)['then'](function(_0x2ad495){return _0x2ad495;});}return null;};}function removeEntity(_0x226314,_0x26c2ac){return function(_0x675f3){if(_0x675f3){return _0x675f3[_0x2aef('0x26')]()['then'](function(){_0x226314[_0x2aef('0x1a')](0xcc)[_0x2aef('0x1b')]();});}};}function handleEntityNotFound(_0x2eb081,_0x475752){return function(_0x130ad7){if(!_0x130ad7){_0x2eb081[_0x2aef('0x19')](0x194);}return _0x130ad7;};}function handleError(_0x52423c,_0x95aabf){_0x95aabf=_0x95aabf||0x1f4;return function(_0x2e1b34){logger['error'](_0x2e1b34[_0x2aef('0x27')]);if(_0x2e1b34[_0x2aef('0x28')]){delete _0x2e1b34[_0x2aef('0x28')];}_0x52423c[_0x2aef('0x1a')](_0x95aabf)['send'](_0x2e1b34);};}exports['index']=function(_0x8b7c44,_0x2b8deb){var _0x6e8150={},_0x1ce6ab={},_0x5215a1={'count':0x0,'rows':[]};var _0x3bc273=_[_0x2aef('0x29')](db[_0x2aef('0x2a')]['rawAttributes'],function(_0x1c1805){return{'name':_0x1c1805[_0x2aef('0x2b')],'type':_0x1c1805['type'][_0x2aef('0x2c')]};});_0x1ce6ab[_0x2aef('0x2d')]=_[_0x2aef('0x29')](_0x3bc273,_0x2aef('0x28'));_0x1ce6ab['query']=_[_0x2aef('0x2e')](_0x8b7c44[_0x2aef('0x2f')]);_0x1ce6ab[_0x2aef('0x30')]=_[_0x2aef('0x31')](_0x1ce6ab[_0x2aef('0x2d')],_0x1ce6ab['query']);_0x6e8150[_0x2aef('0x32')]=_[_0x2aef('0x31')](_0x1ce6ab['model'],qs['fields'](_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x33')]));_0x6e8150[_0x2aef('0x32')]=_0x6e8150['attributes'][_0x2aef('0x34')]?_0x6e8150[_0x2aef('0x32')]:_0x1ce6ab['model'];if(!_0x8b7c44['query'][_0x2aef('0x35')](_0x2aef('0x36'))){_0x6e8150['limit']=qs['limit'](_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x1e')]);_0x6e8150['offset']=qs[_0x2aef('0x1f')](_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x1f')]);}_0x6e8150[_0x2aef('0x37')]=qs[_0x2aef('0x38')](_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x38')]);_0x6e8150[_0x2aef('0x39')]=qs[_0x2aef('0x30')](_[_0x2aef('0x3a')](_0x8b7c44[_0x2aef('0x2f')],_0x1ce6ab[_0x2aef('0x30')]),_0x3bc273);if(_0x8b7c44[_0x2aef('0x2f')][_0x2aef('0x3b')]){_0x6e8150[_0x2aef('0x39')]=_[_0x2aef('0x3c')](_0x6e8150[_0x2aef('0x39')],{'$or':_[_0x2aef('0x29')](_0x3bc273,function(_0x280613){if(_0x280613['type']!==_0x2aef('0x3d')){var _0x44266f={};_0x44266f[_0x280613[_0x2aef('0x28')]]={'$like':'%'+_0x8b7c44['query'][_0x2aef('0x3b')]+'%'};return _0x44266f;}})});}_0x6e8150=_[_0x2aef('0x3c')]({},_0x6e8150,_0x8b7c44[_0x2aef('0x3e')]);var _0x7904eb={'where':_0x6e8150[_0x2aef('0x39')]};return db[_0x2aef('0x2a')][_0x2aef('0x20')](_0x7904eb)[_0x2aef('0x3f')](function(_0x5b491d){_0x5215a1[_0x2aef('0x20')]=_0x5b491d;if(_0x8b7c44[_0x2aef('0x2f')]['includeAll']){_0x6e8150[_0x2aef('0x40')]=[{'all':!![]}];}return db[_0x2aef('0x2a')]['findAll'](_0x6e8150);})['then'](function(_0x386e70){_0x5215a1['rows']=_0x386e70;return _0x5215a1;})[_0x2aef('0x3f')](respondWithFilteredResult(_0x2b8deb,_0x6e8150))[_0x2aef('0x41')](handleError(_0x2b8deb,null));};exports[_0x2aef('0x42')]=function(_0x8f616f,_0xc07c21){var _0x2e39b9={'raw':!![],'where':{'id':_0x8f616f[_0x2aef('0x43')]['id']}},_0x20f91a={};_0x20f91a[_0x2aef('0x2d')]=_[_0x2aef('0x2e')](db['JscriptyQuestionReport'][_0x2aef('0x44')]);_0x20f91a['query']=_[_0x2aef('0x2e')](_0x8f616f[_0x2aef('0x2f')]);_0x20f91a[_0x2aef('0x30')]=_[_0x2aef('0x31')](_0x20f91a['model'],_0x20f91a[_0x2aef('0x2f')]);_0x2e39b9[_0x2aef('0x32')]=_[_0x2aef('0x31')](_0x20f91a[_0x2aef('0x2d')],qs[_0x2aef('0x33')](_0x8f616f['query'][_0x2aef('0x33')]));_0x2e39b9['attributes']=_0x2e39b9[_0x2aef('0x32')][_0x2aef('0x34')]?_0x2e39b9[_0x2aef('0x32')]:_0x20f91a['model'];if(_0x8f616f[_0x2aef('0x2f')][_0x2aef('0x45')]){_0x2e39b9['include']=[{'all':!![]}];}_0x2e39b9=_['merge']({},_0x2e39b9,_0x8f616f[_0x2aef('0x3e')]);return db[_0x2aef('0x2a')][_0x2aef('0x46')](_0x2e39b9)[_0x2aef('0x3f')](handleEntityNotFound(_0xc07c21,null))[_0x2aef('0x3f')](respondWithResult(_0xc07c21,null))[_0x2aef('0x41')](handleError(_0xc07c21,null));};exports['create']=function(_0x20a7d2,_0x34a82d){return db[_0x2aef('0x2a')][_0x2aef('0x47')](_0x20a7d2[_0x2aef('0x48')],{})[_0x2aef('0x3f')](respondWithResult(_0x34a82d,0xc9))[_0x2aef('0x41')](handleError(_0x34a82d,null));};exports['update']=function(_0x1a5966,_0x572638){if(_0x1a5966[_0x2aef('0x48')]['id']){delete _0x1a5966[_0x2aef('0x48')]['id'];}return db[_0x2aef('0x2a')]['find']({'where':{'id':_0x1a5966['params']['id']}})[_0x2aef('0x3f')](handleEntityNotFound(_0x572638,null))[_0x2aef('0x3f')](saveUpdates(_0x1a5966['body'],null))[_0x2aef('0x3f')](respondWithResult(_0x572638,null))[_0x2aef('0x41')](handleError(_0x572638,null));};exports[_0x2aef('0x26')]=function(_0x5c849c,_0x9c994f){return db['JscriptyQuestionReport'][_0x2aef('0x46')]({'where':{'id':_0x5c849c[_0x2aef('0x43')]['id']}})['then'](handleEntityNotFound(_0x9c994f,null))[_0x2aef('0x3f')](removeEntity(_0x9c994f,null))[_0x2aef('0x41')](handleError(_0x9c994f,null));};exports[_0x2aef('0x49')]=function(_0xc6aba3,_0x2878e2){return db[_0x2aef('0x2a')]['describe']()['then'](respondWithResult(_0x2878e2,null))[_0x2aef('0x41')](handleError(_0x2878e2,null));}; \ No newline at end of file +var _0xb76a=['options','includeAll','include','findAll','rows','params','find','create','body','catch','destroy','describe','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','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','sendStatus','error','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter'];(function(_0x2888a4,_0x1fc157){var _0x7f650c=function(_0x5e1880){while(--_0x5e1880){_0x2888a4['push'](_0x2888a4['shift']());}};_0x7f650c(++_0x1fc157);}(_0xb76a,0x150));var _0xab76=function(_0x120a6e,_0x4f49d6){_0x120a6e=_0x120a6e-0x0;var _0x56add1=_0xb76a[_0x120a6e];return _0x56add1;};'use strict';var emlformat=require(_0xab76('0x0'));var rimraf=require(_0xab76('0x1'));var zipdir=require(_0xab76('0x2'));var jsonpatch=require(_0xab76('0x3'));var rp=require(_0xab76('0x4'));var moment=require(_0xab76('0x5'));var BPromise=require(_0xab76('0x6'));var Mustache=require(_0xab76('0x7'));var util=require(_0xab76('0x8'));var path=require(_0xab76('0x9'));var sox=require(_0xab76('0xa'));var csv=require('to-csv');var ejs=require(_0xab76('0xb'));var fs=require('fs');var fs_extra=require(_0xab76('0xc'));var _=require(_0xab76('0xd'));var squel=require(_0xab76('0xe'));var crypto=require(_0xab76('0xf'));var jsforce=require(_0xab76('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xab76('0x11'));var querystring=require(_0xab76('0x12'));var Papa=require(_0xab76('0x13'));var Redis=require(_0xab76('0x14'));var authService=require(_0xab76('0x15'));var qs=require(_0xab76('0x16'));var as=require(_0xab76('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab76('0x18'))(_0xab76('0x19'));var utils=require('../../config/utils');var config=require(_0xab76('0x1a'));var licenseUtil=require(_0xab76('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d6cf,_0xf691d4){_0xf691d4=_0xf691d4||0xcc;return function(_0x3f1c0d){if(_0x3f1c0d){return _0x25d6cf['sendStatus'](_0xf691d4);}return _0x25d6cf[_0xab76('0x1c')](_0xf691d4)[_0xab76('0x1d')]();};}function respondWithResult(_0xcc24b1,_0x3a94cc){_0x3a94cc=_0x3a94cc||0xc8;return function(_0x1252c3){if(_0x1252c3){return _0xcc24b1[_0xab76('0x1c')](_0x3a94cc)['json'](_0x1252c3);}};}function respondWithFilteredResult(_0x5ea2f4,_0x5c95fb){return function(_0x468a26){if(_0x468a26){var _0x3459f4=typeof _0x5c95fb[_0xab76('0x1e')]===_0xab76('0x1f')&&typeof _0x5c95fb['limit']===_0xab76('0x1f');var _0x3a26a1=_0x468a26[_0xab76('0x20')];var _0x1ebc16=_0x3459f4?0x0:_0x5c95fb[_0xab76('0x1e')];var _0xee7517=_0x3459f4?_0x468a26['count']:_0x5c95fb[_0xab76('0x1e')]+_0x5c95fb['limit'];var _0x5f4dfa;if(_0xee7517>=_0x3a26a1){_0xee7517=_0x3a26a1;_0x5f4dfa=0xc8;}else{_0x5f4dfa=0xce;}_0x5ea2f4['status'](_0x5f4dfa);return _0x5ea2f4[_0xab76('0x21')](_0xab76('0x22'),_0x1ebc16+'-'+_0xee7517+'/'+_0x3a26a1)[_0xab76('0x23')](_0x468a26);}return null;};}function patchUpdates(_0x3bfb57){return function(_0x479a81){try{jsonpatch['apply'](_0x479a81,_0x3bfb57,!![]);}catch(_0x319aa3){return BPromise[_0xab76('0x24')](_0x319aa3);}return _0x479a81[_0xab76('0x25')]();};}function saveUpdates(_0x36cb66,_0x49623e){return function(_0x2a7065){if(_0x2a7065){return _0x2a7065[_0xab76('0x26')](_0x36cb66)['then'](function(_0x23aed4){return _0x23aed4;});}return null;};}function removeEntity(_0x11673a,_0x2ee1b3){return function(_0x3a8c4){if(_0x3a8c4){return _0x3a8c4['destroy']()[_0xab76('0x27')](function(){_0x11673a['status'](0xcc)[_0xab76('0x1d')]();});}};}function handleEntityNotFound(_0x2e9012,_0x3808b4){return function(_0x3796e5){if(!_0x3796e5){_0x2e9012[_0xab76('0x28')](0x194);}return _0x3796e5;};}function handleError(_0x3775fd,_0x33cd29){_0x33cd29=_0x33cd29||0x1f4;return function(_0x2a0e82){logger[_0xab76('0x29')](_0x2a0e82['stack']);if(_0x2a0e82[_0xab76('0x2a')]){delete _0x2a0e82[_0xab76('0x2a')];}_0x3775fd[_0xab76('0x1c')](_0x33cd29)[_0xab76('0x2b')](_0x2a0e82);};}exports[_0xab76('0x2c')]=function(_0x4820f7,_0x390c23){var _0x5e7963={},_0x14cf41={},_0x16de3c={'count':0x0,'rows':[]};var _0x2ca357=_['map'](db[_0xab76('0x2d')][_0xab76('0x2e')],function(_0x115158){return{'name':_0x115158[_0xab76('0x2f')],'type':_0x115158[_0xab76('0x30')][_0xab76('0x31')]};});_0x14cf41[_0xab76('0x32')]=_[_0xab76('0x33')](_0x2ca357,'name');_0x14cf41['query']=_[_0xab76('0x34')](_0x4820f7['query']);_0x14cf41['filters']=_[_0xab76('0x35')](_0x14cf41[_0xab76('0x32')],_0x14cf41[_0xab76('0x36')]);_0x5e7963[_0xab76('0x37')]=_[_0xab76('0x35')](_0x14cf41[_0xab76('0x32')],qs[_0xab76('0x38')](_0x4820f7[_0xab76('0x36')]['fields']));_0x5e7963[_0xab76('0x37')]=_0x5e7963[_0xab76('0x37')][_0xab76('0x39')]?_0x5e7963['attributes']:_0x14cf41[_0xab76('0x32')];if(!_0x4820f7['query'][_0xab76('0x3a')](_0xab76('0x3b'))){_0x5e7963[_0xab76('0x3c')]=qs[_0xab76('0x3c')](_0x4820f7['query']['limit']);_0x5e7963[_0xab76('0x1e')]=qs[_0xab76('0x1e')](_0x4820f7[_0xab76('0x36')][_0xab76('0x1e')]);}_0x5e7963[_0xab76('0x3d')]=qs[_0xab76('0x3e')](_0x4820f7[_0xab76('0x36')][_0xab76('0x3e')]);_0x5e7963[_0xab76('0x3f')]=qs[_0xab76('0x40')](_[_0xab76('0x41')](_0x4820f7[_0xab76('0x36')],_0x14cf41[_0xab76('0x40')]),_0x2ca357);if(_0x4820f7['query']['filter']){_0x5e7963['where']=_[_0xab76('0x42')](_0x5e7963[_0xab76('0x3f')],{'$or':_['map'](_0x2ca357,function(_0x2a01ac){if(_0x2a01ac[_0xab76('0x30')]!==_0xab76('0x43')){var _0x31a63c={};_0x31a63c[_0x2a01ac[_0xab76('0x2a')]]={'$like':'%'+_0x4820f7[_0xab76('0x36')][_0xab76('0x44')]+'%'};return _0x31a63c;}})});}_0x5e7963=_[_0xab76('0x42')]({},_0x5e7963,_0x4820f7[_0xab76('0x45')]);var _0x41a7a0={'where':_0x5e7963['where']};return db[_0xab76('0x2d')][_0xab76('0x20')](_0x41a7a0)[_0xab76('0x27')](function(_0x5e05b4){_0x16de3c[_0xab76('0x20')]=_0x5e05b4;if(_0x4820f7[_0xab76('0x36')][_0xab76('0x46')]){_0x5e7963[_0xab76('0x47')]=[{'all':!![]}];}return db[_0xab76('0x2d')][_0xab76('0x48')](_0x5e7963);})[_0xab76('0x27')](function(_0x2566c6){_0x16de3c[_0xab76('0x49')]=_0x2566c6;return _0x16de3c;})[_0xab76('0x27')](respondWithFilteredResult(_0x390c23,_0x5e7963))['catch'](handleError(_0x390c23,null));};exports['show']=function(_0x44d718,_0x30ea01){var _0x34e92b={'raw':!![],'where':{'id':_0x44d718[_0xab76('0x4a')]['id']}},_0x1de187={};_0x1de187[_0xab76('0x32')]=_[_0xab76('0x34')](db['JscriptyQuestionReport'][_0xab76('0x2e')]);_0x1de187[_0xab76('0x36')]=_[_0xab76('0x34')](_0x44d718[_0xab76('0x36')]);_0x1de187[_0xab76('0x40')]=_[_0xab76('0x35')](_0x1de187[_0xab76('0x32')],_0x1de187[_0xab76('0x36')]);_0x34e92b[_0xab76('0x37')]=_['intersection'](_0x1de187[_0xab76('0x32')],qs[_0xab76('0x38')](_0x44d718['query'][_0xab76('0x38')]));_0x34e92b[_0xab76('0x37')]=_0x34e92b[_0xab76('0x37')][_0xab76('0x39')]?_0x34e92b[_0xab76('0x37')]:_0x1de187[_0xab76('0x32')];if(_0x44d718[_0xab76('0x36')][_0xab76('0x46')]){_0x34e92b[_0xab76('0x47')]=[{'all':!![]}];}_0x34e92b=_['merge']({},_0x34e92b,_0x44d718[_0xab76('0x45')]);return db[_0xab76('0x2d')][_0xab76('0x4b')](_0x34e92b)['then'](handleEntityNotFound(_0x30ea01,null))[_0xab76('0x27')](respondWithResult(_0x30ea01,null))['catch'](handleError(_0x30ea01,null));};exports[_0xab76('0x4c')]=function(_0x151f21,_0x9d0616){return db[_0xab76('0x2d')][_0xab76('0x4c')](_0x151f21[_0xab76('0x4d')],{})[_0xab76('0x27')](respondWithResult(_0x9d0616,0xc9))['catch'](handleError(_0x9d0616,null));};exports[_0xab76('0x26')]=function(_0x12c9e1,_0x1137fc){if(_0x12c9e1[_0xab76('0x4d')]['id']){delete _0x12c9e1[_0xab76('0x4d')]['id'];}return db[_0xab76('0x2d')][_0xab76('0x4b')]({'where':{'id':_0x12c9e1[_0xab76('0x4a')]['id']}})[_0xab76('0x27')](handleEntityNotFound(_0x1137fc,null))[_0xab76('0x27')](saveUpdates(_0x12c9e1[_0xab76('0x4d')],null))['then'](respondWithResult(_0x1137fc,null))[_0xab76('0x4e')](handleError(_0x1137fc,null));};exports[_0xab76('0x4f')]=function(_0x54f1a1,_0x486b72){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x54f1a1[_0xab76('0x4a')]['id']}})['then'](handleEntityNotFound(_0x486b72,null))[_0xab76('0x27')](removeEntity(_0x486b72,null))['catch'](handleError(_0x486b72,null));};exports[_0xab76('0x50')]=function(_0x196015,_0x42bcce){return db[_0xab76('0x2d')][_0xab76('0x50')]()[_0xab76('0x27')](respondWithResult(_0x42bcce,null))[_0xab76('0x4e')](handleError(_0x42bcce,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 2847b6b..60088b6 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 _0xafb3=['exports','JscriptyQuestionReport','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xafb3,0xb6));var _0x3afb=function(_0x37f740,_0x30f03c){_0x37f740=_0x37f740-0x0;var _0x2e4df7=_0xafb3[_0x37f740];return _0x2e4df7;};'use strict';var _=require(_0x3afb('0x0'));var util=require(_0x3afb('0x1'));var logger=require(_0x3afb('0x2'))(_0x3afb('0x3'));var moment=require('moment');var BPromise=require(_0x3afb('0x4'));var rp=require(_0x3afb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3afb('0x6'));var attributes=require(_0x3afb('0x7'));module[_0x3afb('0x8')]=function(_0x136444,_0x1c939f){return _0x136444['define'](_0x3afb('0x9'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce9e=['api','moment','bluebird','request-promise','path','rimraf','exports','define','JscriptyQuestionReport','lodash','util','../../config/logger'];(function(_0x413426,_0x4f7814){var _0x5576e2=function(_0x260c9a){while(--_0x260c9a){_0x413426['push'](_0x413426['shift']());}};_0x5576e2(++_0x4f7814);}(_0xce9e,0x1c5));var _0xece9=function(_0x1fa38a,_0x4fbe90){_0x1fa38a=_0x1fa38a-0x0;var _0x262fd0=_0xce9e[_0x1fa38a];return _0x262fd0;};'use strict';var _=require(_0xece9('0x0'));var util=require(_0xece9('0x1'));var logger=require(_0xece9('0x2'))(_0xece9('0x3'));var moment=require(_0xece9('0x4'));var BPromise=require(_0xece9('0x5'));var rp=require(_0xece9('0x6'));var fs=require('fs');var path=require(_0xece9('0x7'));var rimraf=require(_0xece9('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xece9('0x9')]=function(_0x3576c4,_0x31921c){return _0x3576c4[_0xece9('0xa')](_0xece9('0xb'),attributes,{'tableName':'report_jscripty_questions','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 101850c..c467ea3 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 _0x974f=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x974f,0xc2));var _0xf974=function(_0x5238f3,_0x3e3669){_0x5238f3=_0x5238f3-0x0;var _0x52dd5f=_0x974f[_0x5238f3];return _0x52dd5f;};'use strict';var _=require(_0xf974('0x0'));var util=require(_0xf974('0x1'));var moment=require(_0xf974('0x2'));var BPromise=require('bluebird');var rs=require(_0xf974('0x3'));var fs=require('fs');var Redis=require(_0xf974('0x4'));var db=require(_0xf974('0x5'))['db'];var utils=require(_0xf974('0x6'));var logger=require(_0xf974('0x7'))(_0xf974('0x8'));var config=require(_0xf974('0x9'));var jayson=require(_0xf974('0xa'));var client=jayson[_0xf974('0xb')][_0xf974('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57302e,_0x2dd491,_0x3d0147){return new BPromise(function(_0x1355cb,_0x2eec58){return client[_0xf974('0xd')](_0x57302e,_0x3d0147)['then'](function(_0x2ea9f1){logger[_0xf974('0xe')](_0xf974('0xf'),_0x2dd491,_0xf974('0x10'));logger[_0xf974('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2dd491,_0xf974('0x10'),JSON[_0xf974('0x12')](_0x2ea9f1));if(_0x2ea9f1['error']){if(_0x2ea9f1['error'][_0xf974('0x13')]===0x1f4){logger[_0xf974('0x14')](_0xf974('0xf'),_0x2dd491,_0x2ea9f1[_0xf974('0x14')]['message']);return _0x2eec58(_0x2ea9f1[_0xf974('0x14')][_0xf974('0x15')]);}logger[_0xf974('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2dd491,_0x2ea9f1['error'][_0xf974('0x15')]);return _0x1355cb(_0x2ea9f1['error'][_0xf974('0x15')]);}else{logger[_0xf974('0xe')](_0xf974('0xf'),_0x2dd491,'request\x20sent');_0x1355cb(_0x2ea9f1[_0xf974('0x16')]['message']);}})[_0xf974('0x17')](function(_0x45c741){logger[_0xf974('0x14')](_0xf974('0xf'),_0x2dd491,_0x45c741);_0x2eec58(_0x45c741);});});} \ No newline at end of file +var _0xdd6b=['http','request','then','info','request\x20sent','debug','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x10c80e,_0x50a895){var _0x4c7293=function(_0x49382d){while(--_0x49382d){_0x10c80e['push'](_0x10c80e['shift']());}};_0x4c7293(++_0x50a895);}(_0xdd6b,0x19a));var _0xbdd6=function(_0x4008b2,_0x37b189){_0x4008b2=_0x4008b2-0x0;var _0x14396e=_0xdd6b[_0x4008b2];return _0x14396e;};'use strict';var _=require(_0xbdd6('0x0'));var util=require(_0xbdd6('0x1'));var moment=require(_0xbdd6('0x2'));var BPromise=require(_0xbdd6('0x3'));var rs=require(_0xbdd6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdd6('0x5'))['db'];var utils=require(_0xbdd6('0x6'));var logger=require(_0xbdd6('0x7'))(_0xbdd6('0x8'));var config=require('../../config/environment');var jayson=require(_0xbdd6('0x9'));var client=jayson['client'][_0xbdd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x441c1a,_0x53acc6,_0x578c67){return new BPromise(function(_0x708e55,_0x19ba80){return client[_0xbdd6('0xb')](_0x441c1a,_0x578c67)[_0xbdd6('0xc')](function(_0x39b713){logger[_0xbdd6('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x53acc6,_0xbdd6('0xe'));logger[_0xbdd6('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x53acc6,_0xbdd6('0xe'),JSON['stringify'](_0x39b713));if(_0x39b713['error']){if(_0x39b713[_0xbdd6('0x10')][_0xbdd6('0x11')]===0x1f4){logger[_0xbdd6('0x10')](_0xbdd6('0x12'),_0x53acc6,_0x39b713[_0xbdd6('0x10')][_0xbdd6('0x13')]);return _0x19ba80(_0x39b713['error']['message']);}logger[_0xbdd6('0x10')](_0xbdd6('0x12'),_0x53acc6,_0x39b713[_0xbdd6('0x10')][_0xbdd6('0x13')]);return _0x708e55(_0x39b713['error']['message']);}else{logger[_0xbdd6('0xd')](_0xbdd6('0x12'),_0x53acc6,_0xbdd6('0xe'));_0x708e55(_0x39b713['result'][_0xbdd6('0x13')]);}})['catch'](function(_0x1dca14){logger[_0xbdd6('0x10')](_0xbdd6('0x12'),_0x53acc6,_0x1dca14);_0x19ba80(_0x1dca14);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 0f96dea..fe54465 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 _0x2845=['/:id/questions','getQuestions','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x1bda5d,_0x473011){var _0x2f045c=function(_0x36d67c){while(--_0x36d67c){_0x1bda5d['push'](_0x1bda5d['shift']());}};_0x2f045c(++_0x473011);}(_0x2845,0xd8));var _0x5284=function(_0x22ee96,_0x348cb5){_0x22ee96=_0x22ee96-0x0;var _0xf0c37b=_0x2845[_0x22ee96];return _0xf0c37b;};'use strict';var multer=require(_0x5284('0x0'));var util=require('util');var path=require(_0x5284('0x1'));var timeout=require(_0x5284('0x2'));var express=require(_0x5284('0x3'));var router=express['Router']();var fs_extra=require(_0x5284('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5284('0x5'));var config=require(_0x5284('0x6'));var controller=require(_0x5284('0x7'));router[_0x5284('0x8')]('/',auth[_0x5284('0x9')](),controller[_0x5284('0xa')]);router['get'](_0x5284('0xb'),auth['isAuthenticated'](),controller[_0x5284('0xc')]);router[_0x5284('0x8')]('/:id',auth[_0x5284('0x9')](),controller[_0x5284('0xd')]);router['get'](_0x5284('0xe'),auth[_0x5284('0x9')](),controller[_0x5284('0xf')]);router['post']('/',auth[_0x5284('0x9')](),controller[_0x5284('0x10')]);router[_0x5284('0x11')]('/:id',auth[_0x5284('0x9')](),controller[_0x5284('0x12')]);router[_0x5284('0x13')](_0x5284('0x14'),auth['isAuthenticated'](),controller[_0x5284('0x15')]);module[_0x5284('0x16')]=router; \ No newline at end of file +var _0xac07=['isAuthenticated','index','get','/:id','show','/:id/questions','getQuestions','post','create','put','update','destroy','exports','multer','util','connect-timeout','../../components/interaction/service','./jscriptySessionReport.controller'];(function(_0x54a24b,_0x423b2b){var _0x3c8bec=function(_0xfc3221){while(--_0xfc3221){_0x54a24b['push'](_0x54a24b['shift']());}};_0x3c8bec(++_0x423b2b);}(_0xac07,0xe5));var _0x7ac0=function(_0x2cfb7b,_0xe6b3a){_0x2cfb7b=_0x2cfb7b-0x0;var _0x42a3d5=_0xac07[_0x2cfb7b];return _0x42a3d5;};'use strict';var multer=require(_0x7ac0('0x0'));var util=require(_0x7ac0('0x1'));var path=require('path');var timeout=require(_0x7ac0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7ac0('0x3'));var config=require('../../config/environment');var controller=require(_0x7ac0('0x4'));router['get']('/',auth[_0x7ac0('0x5')](),controller[_0x7ac0('0x6')]);router[_0x7ac0('0x7')]('/describe',auth[_0x7ac0('0x5')](),controller['describe']);router[_0x7ac0('0x7')](_0x7ac0('0x8'),auth[_0x7ac0('0x5')](),controller[_0x7ac0('0x9')]);router[_0x7ac0('0x7')](_0x7ac0('0xa'),auth['isAuthenticated'](),controller[_0x7ac0('0xb')]);router[_0x7ac0('0xc')]('/',auth[_0x7ac0('0x5')](),controller[_0x7ac0('0xd')]);router[_0x7ac0('0xe')](_0x7ac0('0x8'),auth[_0x7ac0('0x5')](),controller[_0x7ac0('0xf')]);router['delete'](_0x7ac0('0x8'),auth[_0x7ac0('0x5')](),controller[_0x7ac0('0x10')]);module[_0x7ac0('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ffe3d03..017a2cf 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 _0x6c4b=['starttime','format','STRING','BOOLEAN','moment','DATE','setDataValue'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6c4b,0x9e));var _0xb6c4=function(_0x5ae09f,_0x33a81b){_0x5ae09f=_0x5ae09f-0x0;var _0x5cdc22=_0x6c4b[_0x5ae09f];return _0x5cdc22;};'use strict';var moment=require(_0xb6c4('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xb6c4('0x1')],'set':function(_0x2e7b19){this[_0xb6c4('0x2')](_0xb6c4('0x3'),_0x2e7b19);this[_0xb6c4('0x2')]('endtime',moment()[_0xb6c4('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xb6c4('0x5')]},'projectname':{'type':Sequelize[_0xb6c4('0x5')]},'queue':{'type':Sequelize[_0xb6c4('0x5')]},'uniqueid':{'type':Sequelize[_0xb6c4('0x5')]},'calleridname':{'type':Sequelize[_0xb6c4('0x5')]},'calleridnum':{'type':Sequelize[_0xb6c4('0x5')]},'completed':{'type':Sequelize[_0xb6c4('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xad07=['format','STRING','BOOLEAN','moment','sequelize','DATE','setDataValue','endtime'];(function(_0x5c1b05,_0x213768){var _0x1a65e7=function(_0x2845d7){while(--_0x2845d7){_0x5c1b05['push'](_0x5c1b05['shift']());}};_0x1a65e7(++_0x213768);}(_0xad07,0xe3));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x7ad0('0x0'));var Sequelize=require(_0x7ad0('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x7ad0('0x2')],'set':function(_0x9f58da){this['setDataValue']('starttime',_0x9f58da);this[_0x7ad0('0x3')](_0x7ad0('0x4'),moment()[_0x7ad0('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x7ad0('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7ad0('0x6')]},'uniqueid':{'type':Sequelize[_0x7ad0('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x7ad0('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 6ef1da6..86f8cf5 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 _0xacbe=['sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','sort','where','merge','VIRTUAL','filter','JscriptySessionReport','include','findAll','catch','show','keys','includeAll','options','create','body','find','params','describe','findOne','hasOwnProperty','JscriptyQuestionReport','rows','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x57fc2a,_0x14bbe5){var _0xa839b=function(_0x26572c){while(--_0x26572c){_0x57fc2a['push'](_0x57fc2a['shift']());}};_0xa839b(++_0x14bbe5);}(_0xacbe,0x82));var _0xeacb=function(_0x1337ef,_0x3963f6){_0x1337ef=_0x1337ef-0x0;var _0x532a6d=_0xacbe[_0x1337ef];return _0x532a6d;};'use strict';var emlformat=require(_0xeacb('0x0'));var rimraf=require(_0xeacb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeacb('0x2'));var rp=require(_0xeacb('0x3'));var moment=require(_0xeacb('0x4'));var BPromise=require(_0xeacb('0x5'));var Mustache=require(_0xeacb('0x6'));var util=require(_0xeacb('0x7'));var path=require('path');var sox=require(_0xeacb('0x8'));var csv=require(_0xeacb('0x9'));var ejs=require(_0xeacb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeacb('0xb'));var squel=require(_0xeacb('0xc'));var crypto=require(_0xeacb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeacb('0xe'));var toCsv=require(_0xeacb('0x9'));var querystring=require(_0xeacb('0xf'));var Papa=require(_0xeacb('0x10'));var Redis=require('ioredis');var authService=require(_0xeacb('0x11'));var qs=require(_0xeacb('0x12'));var as=require(_0xeacb('0x13'));var hardwareService=require(_0xeacb('0x14'));var logger=require(_0xeacb('0x15'))(_0xeacb('0x16'));var utils=require('../../config/utils');var config=require(_0xeacb('0x17'));var licenseUtil=require(_0xeacb('0x18'));var db=require(_0xeacb('0x19'))['db'];function respondWithStatusCode(_0x58e681,_0x346bed){_0x346bed=_0x346bed||0xcc;return function(_0x8bd73d){if(_0x8bd73d){return _0x58e681[_0xeacb('0x1a')](_0x346bed);}return _0x58e681['status'](_0x346bed)[_0xeacb('0x1b')]();};}function respondWithResult(_0x2da589,_0xcf2970){_0xcf2970=_0xcf2970||0xc8;return function(_0x35f9af){if(_0x35f9af){return _0x2da589[_0xeacb('0x1c')](_0xcf2970)[_0xeacb('0x1d')](_0x35f9af);}};}function respondWithFilteredResult(_0x488e3e,_0x2200a0){return function(_0x395fc0){if(_0x395fc0){var _0xd28aec=typeof _0x2200a0[_0xeacb('0x1e')]===_0xeacb('0x1f')&&typeof _0x2200a0[_0xeacb('0x20')]===_0xeacb('0x1f');var _0x504be8=_0x395fc0[_0xeacb('0x21')];var _0x1b1fee=_0xd28aec?0x0:_0x2200a0['offset'];var _0x2e1f97=_0xd28aec?_0x395fc0[_0xeacb('0x21')]:_0x2200a0['offset']+_0x2200a0['limit'];var _0x389d4b;if(_0x2e1f97>=_0x504be8){_0x2e1f97=_0x504be8;_0x389d4b=0xc8;}else{_0x389d4b=0xce;}_0x488e3e[_0xeacb('0x1c')](_0x389d4b);return _0x488e3e[_0xeacb('0x22')]('Content-Range',_0x1b1fee+'-'+_0x2e1f97+'/'+_0x504be8)[_0xeacb('0x1d')](_0x395fc0);}return null;};}function patchUpdates(_0x4ff796){return function(_0x26ffbc){try{jsonpatch[_0xeacb('0x23')](_0x26ffbc,_0x4ff796,!![]);}catch(_0xd9805f){return BPromise['reject'](_0xd9805f);}return _0x26ffbc[_0xeacb('0x24')]();};}function saveUpdates(_0x2554f3,_0x15b37b){return function(_0x8d1bf9){if(_0x8d1bf9){return _0x8d1bf9[_0xeacb('0x25')](_0x2554f3)[_0xeacb('0x26')](function(_0x276a31){return _0x276a31;});}return null;};}function removeEntity(_0x30a517,_0x127997){return function(_0x25b66b){if(_0x25b66b){return _0x25b66b[_0xeacb('0x27')]()['then'](function(){_0x30a517[_0xeacb('0x1c')](0xcc)[_0xeacb('0x1b')]();});}};}function handleEntityNotFound(_0x2eaa75,_0x2f325f){return function(_0x2f5b7f){if(!_0x2f5b7f){_0x2eaa75[_0xeacb('0x1a')](0x194);}return _0x2f5b7f;};}function handleError(_0x46d6c5,_0x415bab){_0x415bab=_0x415bab||0x1f4;return function(_0x2e17a1){logger[_0xeacb('0x28')](_0x2e17a1[_0xeacb('0x29')]);if(_0x2e17a1[_0xeacb('0x2a')]){delete _0x2e17a1['name'];}_0x46d6c5[_0xeacb('0x1c')](_0x415bab)['send'](_0x2e17a1);};}exports[_0xeacb('0x2b')]=function(_0x211c09,_0x31ec8d){var _0x339b2d={},_0x5b5255={},_0x479447={'count':0x0,'rows':[]};var _0x38fbfb=_[_0xeacb('0x2c')](db['JscriptySessionReport'][_0xeacb('0x2d')],function(_0x1bfae9){return{'name':_0x1bfae9[_0xeacb('0x2e')],'type':_0x1bfae9[_0xeacb('0x2f')][_0xeacb('0x30')]};});_0x5b5255[_0xeacb('0x31')]=_[_0xeacb('0x2c')](_0x38fbfb,'name');_0x5b5255[_0xeacb('0x32')]=_['keys'](_0x211c09[_0xeacb('0x32')]);_0x5b5255[_0xeacb('0x33')]=_['intersection'](_0x5b5255[_0xeacb('0x31')],_0x5b5255[_0xeacb('0x32')]);_0x339b2d[_0xeacb('0x34')]=_[_0xeacb('0x35')](_0x5b5255[_0xeacb('0x31')],qs[_0xeacb('0x36')](_0x211c09[_0xeacb('0x32')][_0xeacb('0x36')]));_0x339b2d[_0xeacb('0x34')]=_0x339b2d[_0xeacb('0x34')][_0xeacb('0x37')]?_0x339b2d[_0xeacb('0x34')]:_0x5b5255[_0xeacb('0x31')];if(!_0x211c09[_0xeacb('0x32')]['hasOwnProperty']('nolimit')){_0x339b2d[_0xeacb('0x20')]=qs[_0xeacb('0x20')](_0x211c09[_0xeacb('0x32')][_0xeacb('0x20')]);_0x339b2d['offset']=qs[_0xeacb('0x1e')](_0x211c09[_0xeacb('0x32')][_0xeacb('0x1e')]);}_0x339b2d['order']=qs[_0xeacb('0x38')](_0x211c09[_0xeacb('0x32')][_0xeacb('0x38')]);_0x339b2d['where']=qs['filters'](_['pick'](_0x211c09[_0xeacb('0x32')],_0x5b5255[_0xeacb('0x33')]),_0x38fbfb);if(_0x211c09[_0xeacb('0x32')]['filter']){_0x339b2d[_0xeacb('0x39')]=_[_0xeacb('0x3a')](_0x339b2d[_0xeacb('0x39')],{'$or':_[_0xeacb('0x2c')](_0x38fbfb,function(_0x433d92){if(_0x433d92[_0xeacb('0x2f')]!==_0xeacb('0x3b')){var _0x42564f={};_0x42564f[_0x433d92[_0xeacb('0x2a')]]={'$like':'%'+_0x211c09[_0xeacb('0x32')][_0xeacb('0x3c')]+'%'};return _0x42564f;}})});}_0x339b2d=_[_0xeacb('0x3a')]({},_0x339b2d,_0x211c09['options']);var _0x2c3611={'where':_0x339b2d[_0xeacb('0x39')]};return db[_0xeacb('0x3d')][_0xeacb('0x21')](_0x2c3611)[_0xeacb('0x26')](function(_0xb50bfe){_0x479447['count']=_0xb50bfe;if(_0x211c09[_0xeacb('0x32')]['includeAll']){_0x339b2d[_0xeacb('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xeacb('0x3f')](_0x339b2d);})['then'](function(_0x3974ed){_0x479447['rows']=_0x3974ed;return _0x479447;})[_0xeacb('0x26')](respondWithFilteredResult(_0x31ec8d,_0x339b2d))[_0xeacb('0x40')](handleError(_0x31ec8d,null));};exports[_0xeacb('0x41')]=function(_0x819483,_0x32f9cc){var _0x3abc19={'raw':!![],'where':{'id':_0x819483['params']['id']}},_0x40e6ca={};_0x40e6ca['model']=_[_0xeacb('0x42')](db['JscriptySessionReport']['rawAttributes']);_0x40e6ca['query']=_[_0xeacb('0x42')](_0x819483[_0xeacb('0x32')]);_0x40e6ca['filters']=_[_0xeacb('0x35')](_0x40e6ca[_0xeacb('0x31')],_0x40e6ca[_0xeacb('0x32')]);_0x3abc19[_0xeacb('0x34')]=_[_0xeacb('0x35')](_0x40e6ca[_0xeacb('0x31')],qs[_0xeacb('0x36')](_0x819483[_0xeacb('0x32')]['fields']));_0x3abc19[_0xeacb('0x34')]=_0x3abc19[_0xeacb('0x34')][_0xeacb('0x37')]?_0x3abc19['attributes']:_0x40e6ca[_0xeacb('0x31')];if(_0x819483['query'][_0xeacb('0x43')]){_0x3abc19[_0xeacb('0x3e')]=[{'all':!![]}];}_0x3abc19=_[_0xeacb('0x3a')]({},_0x3abc19,_0x819483[_0xeacb('0x44')]);return db['JscriptySessionReport']['find'](_0x3abc19)[_0xeacb('0x26')](handleEntityNotFound(_0x32f9cc,null))['then'](respondWithResult(_0x32f9cc,null))[_0xeacb('0x40')](handleError(_0x32f9cc,null));};exports[_0xeacb('0x45')]=function(_0x19f509,_0x5e449c){return db['JscriptySessionReport'][_0xeacb('0x45')](_0x19f509[_0xeacb('0x46')],{})[_0xeacb('0x26')](respondWithResult(_0x5e449c,0xc9))['catch'](handleError(_0x5e449c,null));};exports['update']=function(_0x1aa8b9,_0x5016c0){if(_0x1aa8b9[_0xeacb('0x46')]['id']){delete _0x1aa8b9[_0xeacb('0x46')]['id'];}return db[_0xeacb('0x3d')][_0xeacb('0x47')]({'where':{'id':_0x1aa8b9[_0xeacb('0x48')]['id']}})[_0xeacb('0x26')](handleEntityNotFound(_0x5016c0,null))[_0xeacb('0x26')](saveUpdates(_0x1aa8b9['body'],null))[_0xeacb('0x26')](respondWithResult(_0x5016c0,null))['catch'](handleError(_0x5016c0,null));};exports['destroy']=function(_0x1e3052,_0x135997){return db[_0xeacb('0x3d')]['find']({'where':{'id':_0x1e3052[_0xeacb('0x48')]['id']}})['then'](handleEntityNotFound(_0x135997,null))['then'](removeEntity(_0x135997,null))[_0xeacb('0x40')](handleError(_0x135997,null));};exports[_0xeacb('0x49')]=function(_0x597290,_0x4bade9){return db['JscriptySessionReport'][_0xeacb('0x49')]()[_0xeacb('0x26')](respondWithResult(_0x4bade9,null))[_0xeacb('0x40')](handleError(_0x4bade9,null));};exports['getQuestions']=function(_0x40bfb9,_0x3da2b1,_0x9501e8){var _0x18ac46={'raw':!![],'where':{}};var _0x47a27f={};var _0x5be749={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xeacb('0x4a')]({'where':{'id':_0x40bfb9[_0xeacb('0x48')]['id']}})[_0xeacb('0x26')](handleEntityNotFound(_0x3da2b1,null))[_0xeacb('0x26')](function(_0x5870dd){if(_0x5870dd){_0x47a27f[_0xeacb('0x31')]=_[_0xeacb('0x42')](db['JscriptyQuestionReport']['rawAttributes']);_0x47a27f[_0xeacb('0x32')]=_['keys'](_0x40bfb9[_0xeacb('0x32')]);_0x47a27f[_0xeacb('0x33')]=_['intersection'](_0x47a27f[_0xeacb('0x31')],_0x47a27f['query']);_0x18ac46[_0xeacb('0x34')]=_[_0xeacb('0x35')](_0x47a27f[_0xeacb('0x31')],qs['fields'](_0x40bfb9[_0xeacb('0x32')][_0xeacb('0x36')]));_0x18ac46[_0xeacb('0x34')]=_0x18ac46['attributes'][_0xeacb('0x37')]?_0x18ac46[_0xeacb('0x34')]:_0x47a27f[_0xeacb('0x31')];if(!_0x40bfb9['query'][_0xeacb('0x4b')]('nolimit')){_0x18ac46['limit']=qs[_0xeacb('0x20')](_0x40bfb9[_0xeacb('0x32')][_0xeacb('0x20')]);_0x18ac46[_0xeacb('0x1e')]=qs[_0xeacb('0x1e')](_0x40bfb9[_0xeacb('0x32')]['offset']);}_0x18ac46['order']=qs['sort'](_0x40bfb9[_0xeacb('0x32')]['sort']);_0x18ac46['where']=qs['filters'](_['pick'](_0x40bfb9[_0xeacb('0x32')],_0x47a27f['filters']));_0x18ac46['where']['SessionId']=_0x5870dd['id'];if(_0x40bfb9[_0xeacb('0x32')][_0xeacb('0x3c')]){_0x18ac46[_0xeacb('0x39')]=_[_0xeacb('0x3a')](_0x18ac46[_0xeacb('0x39')],{'$or':_[_0xeacb('0x2c')](_0x18ac46[_0xeacb('0x34')],function(_0x3de4a3){var _0xa0b83f={};_0xa0b83f[_0x3de4a3]={'$like':'%'+_0x40bfb9[_0xeacb('0x32')][_0xeacb('0x3c')]+'%'};return _0xa0b83f;})});}_0x18ac46=_['merge']({},_0x18ac46,_0x40bfb9[_0xeacb('0x44')]);return db[_0xeacb('0x4c')][_0xeacb('0x21')]({'where':_0x18ac46[_0xeacb('0x39')]})[_0xeacb('0x26')](function(_0x2d912b){_0x5be749[_0xeacb('0x21')]=_0x2d912b;if(_0x40bfb9[_0xeacb('0x32')]['includeAll']){_0x18ac46['include']=[{'all':!![]}];}return db[_0xeacb('0x4c')][_0xeacb('0x3f')](_0x18ac46);})['then'](function(_0x4a07cd){_0x5be749[_0xeacb('0x4d')]=_0x4a07cd;return _0x5be749;});}})[_0xeacb('0x26')](respondWithFilteredResult(_0x3da2b1,_0x18ac46))[_0xeacb('0x40')](handleError(_0x3da2b1,null));}; \ No newline at end of file +var _0x6d69=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','status','sendStatus','error','stack','send','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','show','params','merge','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','pick','SessionId','rimraf'];(function(_0x134798,_0xd30a2e){var _0x58f124=function(_0x211fcd){while(--_0x211fcd){_0x134798['push'](_0x134798['shift']());}};_0x58f124(++_0xd30a2e);}(_0x6d69,0x147));var _0x96d6=function(_0x13e22c,_0x16b31e){_0x13e22c=_0x13e22c-0x0;var _0x1e9936=_0x6d69[_0x13e22c];return _0x1e9936;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x96d6('0x0'));var zipdir=require(_0x96d6('0x1'));var jsonpatch=require(_0x96d6('0x2'));var rp=require(_0x96d6('0x3'));var moment=require(_0x96d6('0x4'));var BPromise=require(_0x96d6('0x5'));var Mustache=require(_0x96d6('0x6'));var util=require(_0x96d6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x96d6('0x8'));var ejs=require(_0x96d6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x96d6('0xa'));var crypto=require(_0x96d6('0xb'));var jsforce=require(_0x96d6('0xc'));var deskjs=require(_0x96d6('0xd'));var toCsv=require(_0x96d6('0x8'));var querystring=require(_0x96d6('0xe'));var Papa=require(_0x96d6('0xf'));var Redis=require('ioredis');var authService=require(_0x96d6('0x10'));var qs=require(_0x96d6('0x11'));var as=require(_0x96d6('0x12'));var hardwareService=require(_0x96d6('0x13'));var logger=require(_0x96d6('0x14'))(_0x96d6('0x15'));var utils=require(_0x96d6('0x16'));var config=require(_0x96d6('0x17'));var licenseUtil=require(_0x96d6('0x18'));var db=require(_0x96d6('0x19'))['db'];function respondWithStatusCode(_0x35aa43,_0x523c5c){_0x523c5c=_0x523c5c||0xcc;return function(_0x1d54e1){if(_0x1d54e1){return _0x35aa43['sendStatus'](_0x523c5c);}return _0x35aa43['status'](_0x523c5c)[_0x96d6('0x1a')]();};}function respondWithResult(_0x9d3a0e,_0x3dc12c){_0x3dc12c=_0x3dc12c||0xc8;return function(_0x56cbb1){if(_0x56cbb1){return _0x9d3a0e['status'](_0x3dc12c)[_0x96d6('0x1b')](_0x56cbb1);}};}function respondWithFilteredResult(_0x358a37,_0x14b4ec){return function(_0x38cc6b){if(_0x38cc6b){var _0x50bf06=typeof _0x14b4ec['offset']==='undefined'&&typeof _0x14b4ec[_0x96d6('0x1c')]===_0x96d6('0x1d');var _0x126b5d=_0x38cc6b[_0x96d6('0x1e')];var _0x1fd646=_0x50bf06?0x0:_0x14b4ec['offset'];var _0x2f3428=_0x50bf06?_0x38cc6b[_0x96d6('0x1e')]:_0x14b4ec[_0x96d6('0x1f')]+_0x14b4ec[_0x96d6('0x1c')];var _0x2aa285;if(_0x2f3428>=_0x126b5d){_0x2f3428=_0x126b5d;_0x2aa285=0xc8;}else{_0x2aa285=0xce;}_0x358a37['status'](_0x2aa285);return _0x358a37[_0x96d6('0x20')](_0x96d6('0x21'),_0x1fd646+'-'+_0x2f3428+'/'+_0x126b5d)[_0x96d6('0x1b')](_0x38cc6b);}return null;};}function patchUpdates(_0x182771){return function(_0x45afe8){try{jsonpatch['apply'](_0x45afe8,_0x182771,!![]);}catch(_0x21df55){return BPromise[_0x96d6('0x22')](_0x21df55);}return _0x45afe8[_0x96d6('0x23')]();};}function saveUpdates(_0x141d11,_0x4c5531){return function(_0x4678f1){if(_0x4678f1){return _0x4678f1[_0x96d6('0x24')](_0x141d11)[_0x96d6('0x25')](function(_0x470471){return _0x470471;});}return null;};}function removeEntity(_0xccbc23,_0x4c9fb4){return function(_0x4f12b9){if(_0x4f12b9){return _0x4f12b9[_0x96d6('0x26')]()[_0x96d6('0x25')](function(){_0xccbc23[_0x96d6('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x230aab,_0x4d15ac){return function(_0x5ee121){if(!_0x5ee121){_0x230aab[_0x96d6('0x28')](0x194);}return _0x5ee121;};}function handleError(_0x1483da,_0x25ddfc){_0x25ddfc=_0x25ddfc||0x1f4;return function(_0x5de26f){logger[_0x96d6('0x29')](_0x5de26f[_0x96d6('0x2a')]);if(_0x5de26f['name']){delete _0x5de26f['name'];}_0x1483da[_0x96d6('0x27')](_0x25ddfc)[_0x96d6('0x2b')](_0x5de26f);};}exports['index']=function(_0x5bcead,_0x1381cd){var _0x4ca928={},_0x237323={},_0x3af0d6={'count':0x0,'rows':[]};var _0x499e4f=_['map'](db['JscriptySessionReport'][_0x96d6('0x2c')],function(_0x67ff72){return{'name':_0x67ff72[_0x96d6('0x2d')],'type':_0x67ff72['type'][_0x96d6('0x2e')]};});_0x237323[_0x96d6('0x2f')]=_[_0x96d6('0x30')](_0x499e4f,_0x96d6('0x31'));_0x237323[_0x96d6('0x32')]=_[_0x96d6('0x33')](_0x5bcead[_0x96d6('0x32')]);_0x237323[_0x96d6('0x34')]=_[_0x96d6('0x35')](_0x237323[_0x96d6('0x2f')],_0x237323[_0x96d6('0x32')]);_0x4ca928[_0x96d6('0x36')]=_['intersection'](_0x237323[_0x96d6('0x2f')],qs[_0x96d6('0x37')](_0x5bcead[_0x96d6('0x32')]['fields']));_0x4ca928[_0x96d6('0x36')]=_0x4ca928[_0x96d6('0x36')][_0x96d6('0x38')]?_0x4ca928[_0x96d6('0x36')]:_0x237323[_0x96d6('0x2f')];if(!_0x5bcead[_0x96d6('0x32')][_0x96d6('0x39')](_0x96d6('0x3a'))){_0x4ca928[_0x96d6('0x1c')]=qs[_0x96d6('0x1c')](_0x5bcead[_0x96d6('0x32')][_0x96d6('0x1c')]);_0x4ca928['offset']=qs[_0x96d6('0x1f')](_0x5bcead[_0x96d6('0x32')][_0x96d6('0x1f')]);}_0x4ca928['order']=qs[_0x96d6('0x3b')](_0x5bcead[_0x96d6('0x32')]['sort']);_0x4ca928[_0x96d6('0x3c')]=qs[_0x96d6('0x34')](_['pick'](_0x5bcead[_0x96d6('0x32')],_0x237323[_0x96d6('0x34')]),_0x499e4f);if(_0x5bcead[_0x96d6('0x32')][_0x96d6('0x3d')]){_0x4ca928['where']=_['merge'](_0x4ca928[_0x96d6('0x3c')],{'$or':_['map'](_0x499e4f,function(_0x50c94c){if(_0x50c94c[_0x96d6('0x3e')]!=='VIRTUAL'){var _0x2717fa={};_0x2717fa[_0x50c94c[_0x96d6('0x31')]]={'$like':'%'+_0x5bcead[_0x96d6('0x32')]['filter']+'%'};return _0x2717fa;}})});}_0x4ca928=_['merge']({},_0x4ca928,_0x5bcead[_0x96d6('0x3f')]);var _0x364864={'where':_0x4ca928[_0x96d6('0x3c')]};return db[_0x96d6('0x40')][_0x96d6('0x1e')](_0x364864)[_0x96d6('0x25')](function(_0xb73d95){_0x3af0d6[_0x96d6('0x1e')]=_0xb73d95;if(_0x5bcead[_0x96d6('0x32')][_0x96d6('0x41')]){_0x4ca928[_0x96d6('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x96d6('0x43')](_0x4ca928);})[_0x96d6('0x25')](function(_0x5a84df){_0x3af0d6[_0x96d6('0x44')]=_0x5a84df;return _0x3af0d6;})[_0x96d6('0x25')](respondWithFilteredResult(_0x1381cd,_0x4ca928))[_0x96d6('0x45')](handleError(_0x1381cd,null));};exports[_0x96d6('0x46')]=function(_0x34ff2e,_0x4d8dbe){var _0x160c7e={'raw':!![],'where':{'id':_0x34ff2e[_0x96d6('0x47')]['id']}},_0x3ab530={};_0x3ab530['model']=_[_0x96d6('0x33')](db[_0x96d6('0x40')]['rawAttributes']);_0x3ab530[_0x96d6('0x32')]=_['keys'](_0x34ff2e['query']);_0x3ab530[_0x96d6('0x34')]=_['intersection'](_0x3ab530['model'],_0x3ab530[_0x96d6('0x32')]);_0x160c7e[_0x96d6('0x36')]=_[_0x96d6('0x35')](_0x3ab530[_0x96d6('0x2f')],qs['fields'](_0x34ff2e[_0x96d6('0x32')][_0x96d6('0x37')]));_0x160c7e[_0x96d6('0x36')]=_0x160c7e[_0x96d6('0x36')]['length']?_0x160c7e[_0x96d6('0x36')]:_0x3ab530[_0x96d6('0x2f')];if(_0x34ff2e[_0x96d6('0x32')][_0x96d6('0x41')]){_0x160c7e[_0x96d6('0x42')]=[{'all':!![]}];}_0x160c7e=_[_0x96d6('0x48')]({},_0x160c7e,_0x34ff2e[_0x96d6('0x3f')]);return db[_0x96d6('0x40')]['find'](_0x160c7e)[_0x96d6('0x25')](handleEntityNotFound(_0x4d8dbe,null))[_0x96d6('0x25')](respondWithResult(_0x4d8dbe,null))[_0x96d6('0x45')](handleError(_0x4d8dbe,null));};exports[_0x96d6('0x49')]=function(_0x2c250e,_0x2bc998){return db[_0x96d6('0x40')][_0x96d6('0x49')](_0x2c250e[_0x96d6('0x4a')],{})[_0x96d6('0x25')](respondWithResult(_0x2bc998,0xc9))[_0x96d6('0x45')](handleError(_0x2bc998,null));};exports[_0x96d6('0x24')]=function(_0x5cabfa,_0x233348){if(_0x5cabfa[_0x96d6('0x4a')]['id']){delete _0x5cabfa[_0x96d6('0x4a')]['id'];}return db['JscriptySessionReport'][_0x96d6('0x4b')]({'where':{'id':_0x5cabfa[_0x96d6('0x47')]['id']}})[_0x96d6('0x25')](handleEntityNotFound(_0x233348,null))['then'](saveUpdates(_0x5cabfa[_0x96d6('0x4a')],null))[_0x96d6('0x25')](respondWithResult(_0x233348,null))[_0x96d6('0x45')](handleError(_0x233348,null));};exports[_0x96d6('0x26')]=function(_0x23b7b6,_0x13fea7){return db[_0x96d6('0x40')][_0x96d6('0x4b')]({'where':{'id':_0x23b7b6[_0x96d6('0x47')]['id']}})[_0x96d6('0x25')](handleEntityNotFound(_0x13fea7,null))['then'](removeEntity(_0x13fea7,null))[_0x96d6('0x45')](handleError(_0x13fea7,null));};exports['describe']=function(_0x3b6c30,_0x981d8b){return db[_0x96d6('0x40')][_0x96d6('0x4c')]()['then'](respondWithResult(_0x981d8b,null))['catch'](handleError(_0x981d8b,null));};exports[_0x96d6('0x4d')]=function(_0x3e4c31,_0x190c2a,_0x4619a7){var _0xce1fb6={'raw':!![],'where':{}};var _0x388e13={};var _0x15c254={'count':0x0,'rows':[]};return db[_0x96d6('0x40')][_0x96d6('0x4e')]({'where':{'id':_0x3e4c31[_0x96d6('0x47')]['id']}})[_0x96d6('0x25')](handleEntityNotFound(_0x190c2a,null))['then'](function(_0x20a488){if(_0x20a488){_0x388e13[_0x96d6('0x2f')]=_['keys'](db[_0x96d6('0x4f')]['rawAttributes']);_0x388e13[_0x96d6('0x32')]=_[_0x96d6('0x33')](_0x3e4c31[_0x96d6('0x32')]);_0x388e13[_0x96d6('0x34')]=_[_0x96d6('0x35')](_0x388e13[_0x96d6('0x2f')],_0x388e13['query']);_0xce1fb6[_0x96d6('0x36')]=_[_0x96d6('0x35')](_0x388e13[_0x96d6('0x2f')],qs[_0x96d6('0x37')](_0x3e4c31[_0x96d6('0x32')][_0x96d6('0x37')]));_0xce1fb6[_0x96d6('0x36')]=_0xce1fb6[_0x96d6('0x36')][_0x96d6('0x38')]?_0xce1fb6[_0x96d6('0x36')]:_0x388e13[_0x96d6('0x2f')];if(!_0x3e4c31['query']['hasOwnProperty']('nolimit')){_0xce1fb6[_0x96d6('0x1c')]=qs[_0x96d6('0x1c')](_0x3e4c31['query'][_0x96d6('0x1c')]);_0xce1fb6[_0x96d6('0x1f')]=qs[_0x96d6('0x1f')](_0x3e4c31['query']['offset']);}_0xce1fb6['order']=qs[_0x96d6('0x3b')](_0x3e4c31[_0x96d6('0x32')]['sort']);_0xce1fb6['where']=qs[_0x96d6('0x34')](_[_0x96d6('0x50')](_0x3e4c31[_0x96d6('0x32')],_0x388e13[_0x96d6('0x34')]));_0xce1fb6[_0x96d6('0x3c')][_0x96d6('0x51')]=_0x20a488['id'];if(_0x3e4c31[_0x96d6('0x32')]['filter']){_0xce1fb6[_0x96d6('0x3c')]=_[_0x96d6('0x48')](_0xce1fb6['where'],{'$or':_[_0x96d6('0x30')](_0xce1fb6['attributes'],function(_0x4fb4de){var _0x40a8ef={};_0x40a8ef[_0x4fb4de]={'$like':'%'+_0x3e4c31[_0x96d6('0x32')]['filter']+'%'};return _0x40a8ef;})});}_0xce1fb6=_[_0x96d6('0x48')]({},_0xce1fb6,_0x3e4c31[_0x96d6('0x3f')]);return db[_0x96d6('0x4f')]['count']({'where':_0xce1fb6[_0x96d6('0x3c')]})[_0x96d6('0x25')](function(_0x3b8e09){_0x15c254[_0x96d6('0x1e')]=_0x3b8e09;if(_0x3e4c31[_0x96d6('0x32')]['includeAll']){_0xce1fb6[_0x96d6('0x42')]=[{'all':!![]}];}return db[_0x96d6('0x4f')][_0x96d6('0x43')](_0xce1fb6);})[_0x96d6('0x25')](function(_0x1df912){_0x15c254[_0x96d6('0x44')]=_0x1df912;return _0x15c254;});}})[_0x96d6('0x25')](respondWithFilteredResult(_0x190c2a,_0xce1fb6))['catch'](handleError(_0x190c2a,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d5b5016..bf7778d 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 _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x42be10,_0xe19651){var _0x4174f3=function(_0x285b30){while(--_0x285b30){_0x42be10['push'](_0x42be10['shift']());}};_0x4174f3(++_0xe19651);}(_0x6050,0x196));var _0x0605=function(_0x4b735c,_0x52f2b5){_0x4b735c=_0x4b735c-0x0;var _0x34daaf=_0x6050[_0x4b735c];return _0x34daaf;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6455=['request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird'];(function(_0x44c9ef,_0x32128c){var _0xae3879=function(_0x3d2015){while(--_0x3d2015){_0x44c9ef['push'](_0x44c9ef['shift']());}};_0xae3879(++_0x32128c);}(_0x6455,0x97));var _0x5645=function(_0xaee5b,_0x34bec6){_0xaee5b=_0xaee5b-0x0;var _0x389276=_0x6455[_0xaee5b];return _0x389276;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));module[_0x5645('0x9')]=function(_0x9400a8,_0x3a635d){return _0x9400a8[_0x5645('0xa')](_0x5645('0xb'),attributes,{'tableName':_0x5645('0xc'),'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 be8222c..939b76c 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 _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch'];(function(_0xfdd79e,_0x4f3a03){var _0x190157=function(_0x1859ec){while(--_0x1859ec){_0xfdd79e['push'](_0xfdd79e['shift']());}};_0x190157(++_0x4f3a03);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});} \ No newline at end of file +var _0x6050=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x15318c,_0x2e50e4){var _0x10d3ce=function(_0x2fecdd){while(--_0x2fecdd){_0x15318c['push'](_0x15318c['shift']());}};_0x10d3ce(++_0x2e50e4);}(_0x6050,0x196));var _0x0605=function(_0xb1cc5,_0x301888){_0xb1cc5=_0xb1cc5-0x0;var _0x2ba7f1=_0x6050[_0xb1cc5];return _0x2ba7f1;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578623,_0x58f7d2,_0x5660ad){return new BPromise(function(_0x1629bf,_0x11b8b5){return client[_0x0605('0xa')](_0x578623,_0x5660ad)[_0x0605('0xb')](function(_0x44fdd3){logger['info'](_0x0605('0xc'),_0x58f7d2,_0x0605('0xd'));logger[_0x0605('0xe')](_0x0605('0xf'),_0x58f7d2,_0x0605('0xd'),JSON[_0x0605('0x10')](_0x44fdd3));if(_0x44fdd3[_0x0605('0x11')]){if(_0x44fdd3[_0x0605('0x11')][_0x0605('0x12')]===0x1f4){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x11b8b5(_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);}logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x1629bf(_0x44fdd3['error'][_0x0605('0x13')]);}else{logger[_0x0605('0x14')](_0x0605('0xc'),_0x58f7d2,'request\x20sent');_0x1629bf(_0x44fdd3['result'][_0x0605('0x13')]);}})[_0x0605('0x15')](function(_0xa83443){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0xa83443);_0x11b8b5(_0xa83443);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d504ccf..7a9f488 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 _0xcb70=['../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update','exports','multer','util','fs-extra','../../components/auth/service'];(function(_0x4e81eb,_0x1a1e7c){var _0x4f52e3=function(_0x509e73){while(--_0x509e73){_0x4e81eb['push'](_0x4e81eb['shift']());}};_0x4f52e3(++_0x1a1e7c);}(_0xcb70,0xf3));var _0x0cb7=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xcb70[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x0cb7('0x0'));var util=require(_0x0cb7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0cb7('0x2'));var auth=require(_0x0cb7('0x3'));var interaction=require(_0x0cb7('0x4'));var config=require(_0x0cb7('0x5'));var controller=require(_0x0cb7('0x6'));router[_0x0cb7('0x7')]('/',controller[_0x0cb7('0x8')]);router['put'](_0x0cb7('0x9'),auth[_0x0cb7('0xa')](),controller[_0x0cb7('0xb')]);module[_0x0cb7('0xc')]=router; \ No newline at end of file +var _0x6934=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','put','/:id','isAuthenticated','update','exports','multer'];(function(_0x3c9d39,_0xf996ec){var _0x13113d=function(_0x15e33a){while(--_0x15e33a){_0x3c9d39['push'](_0x3c9d39['shift']());}};_0x13113d(++_0xf996ec);}(_0x6934,0x17f));var _0x4693=function(_0x6bf731,_0x48cad2){_0x6bf731=_0x6bf731-0x0;var _0x141b26=_0x6934[_0x6bf731];return _0x141b26;};'use strict';var multer=require(_0x4693('0x0'));var util=require(_0x4693('0x1'));var path=require(_0x4693('0x2'));var timeout=require(_0x4693('0x3'));var express=require(_0x4693('0x4'));var router=express['Router']();var fs_extra=require(_0x4693('0x5'));var auth=require(_0x4693('0x6'));var interaction=require(_0x4693('0x7'));var config=require(_0x4693('0x8'));var controller=require('./license.controller');router[_0x4693('0x9')]('/',controller[_0x4693('0xa')]);router[_0x4693('0xb')](_0x4693('0xc'),auth[_0x4693('0xd')](),controller[_0x4693('0xe')]);module[_0x4693('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 6ebcb4e..73e575f 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 _0x8649=['STRING','exports','TEXT'];(function(_0x52b3c2,_0x2890a9){var _0x1ff3b9=function(_0x257ac1){while(--_0x257ac1){_0x52b3c2['push'](_0x52b3c2['shift']());}};_0x1ff3b9(++_0x2890a9);}(_0x8649,0xa9));var _0x9864=function(_0x3d8637,_0x29e08d){_0x3d8637=_0x3d8637-0x0;var _0x11381d=_0x8649[_0x3d8637];return _0x11381d;};'use strict';var Sequelize=require('sequelize');module[_0x9864('0x0')]={'license':{'type':Sequelize[_0x9864('0x1')]},'data1':{'type':Sequelize[_0x9864('0x2')]},'data2':{'type':Sequelize[_0x9864('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0c8a=['TEXT','sequelize','exports'];(function(_0x311a4a,_0x1047a7){var _0x42cb29=function(_0x56e422){while(--_0x56e422){_0x311a4a['push'](_0x311a4a['shift']());}};_0x42cb29(++_0x1047a7);}(_0x0c8a,0xb2));var _0xa0c8=function(_0x25f746,_0x19db34){_0x25f746=_0x25f746-0x0;var _0x1c626d=_0x0c8a[_0x25f746];return _0x1c626d;};'use strict';var Sequelize=require(_0xa0c8('0x0'));module[_0xa0c8('0x1')]={'license':{'type':Sequelize[_0xa0c8('0x2')]},'data1':{'type':Sequelize['STRING']},'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 5806ceb..7b6407b 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(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf494,0x1c6));var _0x4f49=function(_0x465614,_0x477fb3){_0x465614=_0x465614-0x0;var _0x5a0074=_0xf494[_0x465614];return _0x5a0074;};'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 _0x57ca=['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','model','keys','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','get','checkLicense','key','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ca,0x108));var _0xa57c=function(_0x42d5c2,_0x2dbb76){_0x42d5c2=_0x42d5c2-0x0;var _0x58aee1=_0x57ca[_0x42d5c2];return _0x58aee1;};'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);};}var utilLicense=require(_0xa57c('0x15'));exports['index']=function(_0x54a18b,_0x257661){var _0x7d10ec={'raw':!![],'where':{'id':0x1}},_0x5a3e03={};_0x5a3e03[_0xa57c('0x28')]=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes']);_0x5a3e03[_0xa57c('0x2b')]=_['keys'](_0x54a18b[_0xa57c('0x2b')]);_0x5a3e03['filters']=_[_0xa57c('0x2c')](_0x5a3e03['model'],_0x5a3e03[_0xa57c('0x2b')]);_0x7d10ec['attributes']=_[_0xa57c('0x2c')](_0x5a3e03[_0xa57c('0x28')],qs[_0xa57c('0x2d')](_0x54a18b[_0xa57c('0x2b')][_0xa57c('0x2d')]));_0x7d10ec[_0xa57c('0x2e')]=_0x7d10ec[_0xa57c('0x2e')]['length']?_0x7d10ec[_0xa57c('0x2e')]:_0x5a3e03['model'];_0x7d10ec=_[_0xa57c('0x2f')]({},_0x7d10ec,_0x54a18b[_0xa57c('0x30')]);return utilLicense[_0xa57c('0x31')](_0x7d10ec)['then'](respondWithResult(_0x257661,null))[_0xa57c('0x32')](handleError(_0x257661,null));};exports['update']=function(_0x24a087,_0x501a4c){if(_0x24a087[_0xa57c('0x33')]['id']){delete _0x24a087['body']['id'];}return db[_0xa57c('0x2a')][_0xa57c('0x34')]({'where':{'id':_0x24a087['params']['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x501a4c,null))['then'](function(_0x1eeeb8){var _0x5c56d3=_0x1eeeb8[_0xa57c('0x35')]({'plain':!![]});return utilLicense[_0xa57c('0x36')](_0x5c56d3,_0x24a087[_0xa57c('0x33')][_0xa57c('0x37')]);})[_0xa57c('0x21')](function(_0x44350f){if(!_0x44350f['demo']){return saveUpdates(_0x24a087['body'],null);}return _0x44350f;})[_0xa57c('0x21')](respondWithResult(_0x501a4c,null))[_0xa57c('0x32')](handleError(_0x501a4c,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 83ce9ce..0d006f1 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 _0xafbc=['rimraf','../../config/environment','./license.attributes','define','util','api','moment','bluebird','request-promise'];(function(_0x23f3a2,_0x329e9e){var _0x455aa9=function(_0x304471){while(--_0x304471){_0x23f3a2['push'](_0x23f3a2['shift']());}};_0x455aa9(++_0x329e9e);}(_0xafbc,0x1ab));var _0xcafb=function(_0xf19155,_0x161362){_0xf19155=_0xf19155-0x0;var _0x5365ab=_0xafbc[_0xf19155];return _0x5365ab;};'use strict';var _=require('lodash');var util=require(_0xcafb('0x0'));var logger=require('../../config/logger')(_0xcafb('0x1'));var moment=require(_0xcafb('0x2'));var BPromise=require(_0xcafb('0x3'));var rp=require(_0xcafb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcafb('0x5'));var config=require(_0xcafb('0x6'));var attributes=require(_0xcafb('0x7'));module['exports']=function(_0xad038f,_0x474427){return _0xad038f[_0xcafb('0x8')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe549=['bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','License','util','../../config/logger','api','moment'];(function(_0x2edc03,_0x257c20){var _0xd2d157=function(_0x3faeef){while(--_0x3faeef){_0x2edc03['push'](_0x2edc03['shift']());}};_0xd2d157(++_0x257c20);}(_0xe549,0x128));var _0x9e54=function(_0xf4d29d,_0x5ea667){_0xf4d29d=_0xf4d29d-0x0;var _0x5555de=_0xe549[_0xf4d29d];return _0x5555de;};'use strict';var _=require('lodash');var util=require(_0x9e54('0x0'));var logger=require(_0x9e54('0x1'))(_0x9e54('0x2'));var moment=require(_0x9e54('0x3'));var BPromise=require(_0x9e54('0x4'));var rp=require(_0x9e54('0x5'));var fs=require('fs');var path=require(_0x9e54('0x6'));var rimraf=require(_0x9e54('0x7'));var config=require(_0x9e54('0x8'));var attributes=require(_0x9e54('0x9'));module[_0x9e54('0xa')]=function(_0x4b0f01,_0x48283e){return _0x4b0f01['define'](_0x9e54('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 8258bba..73b6411 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 _0xbca0=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ece53,_0x485cb4){var _0x4fcc68=function(_0x566d96){while(--_0x566d96){_0x4ece53['push'](_0x4ece53['shift']());}};_0x4fcc68(++_0x485cb4);}(_0xbca0,0xa1));var _0x0bca=function(_0x3b1917,_0x49d088){_0x3b1917=_0x3b1917-0x0;var _0x16d449=_0xbca0[_0x3b1917];return _0x16d449;};'use strict';var _=require(_0x0bca('0x0'));var util=require(_0x0bca('0x1'));var moment=require('moment');var BPromise=require(_0x0bca('0x2'));var rs=require(_0x0bca('0x3'));var fs=require('fs');var Redis=require(_0x0bca('0x4'));var db=require(_0x0bca('0x5'))['db'];var utils=require(_0x0bca('0x6'));var logger=require(_0x0bca('0x7'))('rpc');var config=require(_0x0bca('0x8'));var jayson=require(_0x0bca('0x9'));var client=jayson[_0x0bca('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4825eb,_0x490988,_0x3aaae2){return new BPromise(function(_0x56528d,_0x2c7e74){return client[_0x0bca('0xb')](_0x4825eb,_0x3aaae2)[_0x0bca('0xc')](function(_0x179b0f){logger[_0x0bca('0xd')](_0x0bca('0xe'),_0x490988,_0x0bca('0xf'));logger[_0x0bca('0x10')](_0x0bca('0x11'),_0x490988,_0x0bca('0xf'),JSON[_0x0bca('0x12')](_0x179b0f));if(_0x179b0f[_0x0bca('0x13')]){if(_0x179b0f[_0x0bca('0x13')][_0x0bca('0x14')]===0x1f4){logger[_0x0bca('0x13')](_0x0bca('0xe'),_0x490988,_0x179b0f[_0x0bca('0x13')][_0x0bca('0x15')]);return _0x2c7e74(_0x179b0f[_0x0bca('0x13')][_0x0bca('0x15')]);}logger[_0x0bca('0x13')](_0x0bca('0xe'),_0x490988,_0x179b0f[_0x0bca('0x13')][_0x0bca('0x15')]);return _0x56528d(_0x179b0f[_0x0bca('0x13')][_0x0bca('0x15')]);}else{logger[_0x0bca('0xd')](_0x0bca('0xe'),_0x490988,_0x0bca('0xf'));_0x56528d(_0x179b0f[_0x0bca('0x16')][_0x0bca('0x15')]);}})[_0x0bca('0x17')](function(_0x3ce6cc){logger[_0x0bca('0x13')](_0x0bca('0xe'),_0x490988,_0x3ce6cc);_0x2c7e74(_0x3ce6cc);});});} \ No newline at end of file +var _0xeada=['request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeada,0x1f0));var _0xaead=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xeada[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xaead('0x0'));var moment=require(_0xaead('0x1'));var BPromise=require('bluebird');var rs=require(_0xaead('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaead('0x3'))['db'];var utils=require(_0xaead('0x4'));var logger=require('../../config/logger')(_0xaead('0x5'));var config=require(_0xaead('0x6'));var jayson=require(_0xaead('0x7'));var client=jayson[_0xaead('0x8')][_0xaead('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b62d5,_0xb65e5,_0x551190){return new BPromise(function(_0x3db8be,_0x16412a){return client[_0xaead('0xa')](_0x4b62d5,_0x551190)[_0xaead('0xb')](function(_0xef59c7){logger[_0xaead('0xc')](_0xaead('0xd'),_0xb65e5,_0xaead('0xe'));logger[_0xaead('0xf')](_0xaead('0x10'),_0xb65e5,_0xaead('0xe'),JSON['stringify'](_0xef59c7));if(_0xef59c7[_0xaead('0x11')]){if(_0xef59c7[_0xaead('0x11')][_0xaead('0x12')]===0x1f4){logger[_0xaead('0x11')](_0xaead('0xd'),_0xb65e5,_0xef59c7[_0xaead('0x11')][_0xaead('0x13')]);return _0x16412a(_0xef59c7[_0xaead('0x11')][_0xaead('0x13')]);}logger['error'](_0xaead('0xd'),_0xb65e5,_0xef59c7[_0xaead('0x11')]['message']);return _0x3db8be(_0xef59c7['error'][_0xaead('0x13')]);}else{logger['info'](_0xaead('0xd'),_0xb65e5,_0xaead('0xe'));_0x3db8be(_0xef59c7[_0xaead('0x14')]['message']);}})[_0xaead('0x15')](function(_0x23acaf){logger[_0xaead('0x11')](_0xaead('0xd'),_0xb65e5,_0x23acaf);_0x16412a(_0x23acaf);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 8451b23..7fdb09d 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 _0xc32f=['/:id','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','/:id/canned_answers','addAnswer','post','create','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc32f,0x84));var _0xfc32=function(_0x4f2c32,_0x14a8d7){_0x4f2c32=_0x4f2c32-0x0;var _0x33a857=_0xc32f[_0x4f2c32];return _0x33a857;};'use strict';var multer=require(_0xfc32('0x0'));var util=require('util');var path=require(_0xfc32('0x1'));var timeout=require('connect-timeout');var express=require(_0xfc32('0x2'));var router=express[_0xfc32('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc32('0x4'));var interaction=require(_0xfc32('0x5'));var config=require(_0xfc32('0x6'));var controller=require(_0xfc32('0x7'));router[_0xfc32('0x8')]('/',auth[_0xfc32('0x9')](),controller[_0xfc32('0xa')]);router[_0xfc32('0x8')]('/describe',auth[_0xfc32('0x9')](),controller[_0xfc32('0xb')]);router[_0xfc32('0x8')](_0xfc32('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfc32('0x8')](_0xfc32('0xd'),auth[_0xfc32('0x9')](),controller[_0xfc32('0xe')]);router[_0xfc32('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xfc32('0xf')]);router[_0xfc32('0x8')](_0xfc32('0x10'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x11')]);router[_0xfc32('0x8')](_0xfc32('0x12'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x13')]);router[_0xfc32('0x8')](_0xfc32('0x14'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x15')]);router[_0xfc32('0x8')](_0xfc32('0x16'),auth['isAuthenticated'](),controller[_0xfc32('0x17')]);router[_0xfc32('0x8')](_0xfc32('0x18'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x19')]);router['get'](_0xfc32('0x1a'),auth[_0xfc32('0x9')](),controller['verifySmtp']);router[_0xfc32('0x8')](_0xfc32('0x1b'),auth[_0xfc32('0x9')](),controller['getAgents']);router['post'](_0xfc32('0xd'),auth[_0xfc32('0x9')](),controller['addDisposition']);router['post'](_0xfc32('0x1c'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x1d')]);router[_0xfc32('0x1e')]('/',auth[_0xfc32('0x9')](),controller[_0xfc32('0x1f')]);router[_0xfc32('0x1e')]('/:id/in_servers',auth[_0xfc32('0x9')](),controller['addImap']);router[_0xfc32('0x1e')](_0xfc32('0x12'),auth['isAuthenticated'](),controller[_0xfc32('0x20')]);router[_0xfc32('0x1e')](_0xfc32('0x14'),auth['isAuthenticated'](),controller[_0xfc32('0x21')]);router[_0xfc32('0x1e')]('/:id/applications',auth[_0xfc32('0x9')](),controller[_0xfc32('0x22')]);router[_0xfc32('0x1e')](_0xfc32('0x23'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x24')]);router[_0xfc32('0x1e')](_0xfc32('0x1b'),auth['isAuthenticated'](),controller[_0xfc32('0x25')]);router[_0xfc32('0x26')](_0xfc32('0xc'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x27')]);router['delete'](_0xfc32('0xd'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x28')]);router[_0xfc32('0x29')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xfc32('0x2a')]);router['delete'](_0xfc32('0x10'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x2b')]);router['delete'](_0xfc32('0x12'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x2c')]);router[_0xfc32('0x29')](_0xfc32('0xc'),auth['isAuthenticated'](),controller[_0xfc32('0x2d')]);router[_0xfc32('0x29')](_0xfc32('0x1b'),auth[_0xfc32('0x9')](),controller[_0xfc32('0x2e')]);module[_0xfc32('0x2f')]=router; \ No newline at end of file +var _0x9448=['/:id/in_servers','addImap','/:id/out_servers','addInteraction','addApplications','/:id/send','send','addAgents','put','delete','removeAnswers','destroy','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','/:id/dispositions','addDisposition','addAnswer','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9448,0x1be));var _0x8944=function(_0xf7a9cf,_0x2cfa33){_0xf7a9cf=_0xf7a9cf-0x0;var _0x7fdc45=_0x9448[_0xf7a9cf];return _0x7fdc45;};'use strict';var multer=require(_0x8944('0x0'));var util=require(_0x8944('0x1'));var path=require(_0x8944('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8944('0x3')]();var fs_extra=require(_0x8944('0x4'));var auth=require(_0x8944('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8944('0x6'));var controller=require(_0x8944('0x7'));router[_0x8944('0x8')]('/',auth[_0x8944('0x9')](),controller[_0x8944('0xa')]);router[_0x8944('0x8')](_0x8944('0xb'),auth[_0x8944('0x9')](),controller[_0x8944('0xc')]);router['get'](_0x8944('0xd'),auth['isAuthenticated'](),controller[_0x8944('0xe')]);router[_0x8944('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8944('0xf')]);router[_0x8944('0x8')](_0x8944('0x10'),auth[_0x8944('0x9')](),controller[_0x8944('0x11')]);router['get']('/:id/in_servers',auth[_0x8944('0x9')](),controller[_0x8944('0x12')]);router[_0x8944('0x8')]('/:id/out_servers',auth[_0x8944('0x9')](),controller[_0x8944('0x13')]);router[_0x8944('0x8')](_0x8944('0x14'),auth['isAuthenticated'](),controller[_0x8944('0x15')]);router[_0x8944('0x8')](_0x8944('0x16'),auth['isAuthenticated'](),controller[_0x8944('0x17')]);router[_0x8944('0x8')](_0x8944('0x18'),auth['isAuthenticated'](),controller[_0x8944('0x19')]);router[_0x8944('0x8')](_0x8944('0x1a'),auth[_0x8944('0x9')](),controller[_0x8944('0x1b')]);router[_0x8944('0x8')](_0x8944('0x1c'),auth[_0x8944('0x9')](),controller['getAgents']);router['post'](_0x8944('0x1d'),auth['isAuthenticated'](),controller[_0x8944('0x1e')]);router['post'](_0x8944('0x10'),auth[_0x8944('0x9')](),controller[_0x8944('0x1f')]);router[_0x8944('0x20')]('/',auth[_0x8944('0x9')](),controller[_0x8944('0x21')]);router[_0x8944('0x20')](_0x8944('0x22'),auth[_0x8944('0x9')](),controller[_0x8944('0x23')]);router['post'](_0x8944('0x24'),auth[_0x8944('0x9')](),controller['addSmtp']);router[_0x8944('0x20')](_0x8944('0x14'),auth[_0x8944('0x9')](),controller[_0x8944('0x25')]);router[_0x8944('0x20')]('/:id/applications',auth[_0x8944('0x9')](),controller[_0x8944('0x26')]);router['post'](_0x8944('0x27'),auth['isAuthenticated'](),controller[_0x8944('0x28')]);router['post'](_0x8944('0x1c'),auth[_0x8944('0x9')](),controller[_0x8944('0x29')]);router[_0x8944('0x2a')](_0x8944('0xd'),auth[_0x8944('0x9')](),controller['update']);router[_0x8944('0x2b')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x8944('0x2b')](_0x8944('0x10'),auth['isAuthenticated'](),controller[_0x8944('0x2c')]);router['delete']('/:id/in_servers',auth[_0x8944('0x9')](),controller['removeImap']);router['delete'](_0x8944('0x24'),auth[_0x8944('0x9')](),controller['removeSmtp']);router[_0x8944('0x2b')](_0x8944('0xd'),auth['isAuthenticated'](),controller[_0x8944('0x2d')]);router['delete'](_0x8944('0x1c'),auth[_0x8944('0x9')](),controller[_0x8944('0x2e')]);module[_0x8944('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 74a37d4..8f8d82e 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 _0x089f=['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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports'];(function(_0x2a2f10,_0x1b2ce0){var _0x2984e9=function(_0x208e1a){while(--_0x208e1a){_0x2a2f10['push'](_0x2a2f10['shift']());}};_0x2984e9(++_0x1b2ce0);}(_0x089f,0x1c7));var _0xf089=function(_0x93d132,_0x2f5249){_0x93d132=_0x93d132-0x0;var _0x17578b=_0x089f[_0x93d132];return _0x17578b;};'use strict';var Sequelize=require('sequelize');module[_0xf089('0x0')]={'description':{'type':Sequelize[_0xf089('0x1')]},'name':{'type':Sequelize[_0xf089('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xf089('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xf089('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xf089('0x3')]},'markAsUnread':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf089('0x4')},'fontSize':{'type':Sequelize[_0xf089('0x5')](0x2)[_0xf089('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf089('0x7');}},'notificationSound':{'type':Sequelize[_0xf089('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf089('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf089('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf089('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf089('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xf089('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf089('0x9'),'set':function(_0x2221a4){if(!_0x2221a4)this[_0xf089('0xa')]('mandatoryDispositionPauseId',null);this[_0xf089('0xa')](_0xf089('0xb'),_0x2221a4);}}}; \ No newline at end of file +var _0x6c84=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x5092a6,_0x11560c){var _0x3519be=function(_0x3ac76c){while(--_0x3ac76c){_0x5092a6['push'](_0x5092a6['shift']());}};_0x3519be(++_0x11560c);}(_0x6c84,0x112));var _0x46c8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6c84[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x46c8('0x0'));module[_0x46c8('0x1')]={'description':{'type':Sequelize[_0x46c8('0x2')]},'name':{'type':Sequelize[_0x46c8('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x46c8('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x46c8('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x46c8('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x46c8('0x5')},'fontSize':{'type':Sequelize[_0x46c8('0x6')](0x2)[_0x46c8('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x46c8('0x4')],'defaultValue':function(){return _0x46c8('0x8');}},'notificationSound':{'type':Sequelize[_0x46c8('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x46c8('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x46c8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x46c8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x46c8('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x46c8('0xa'),'set':function(_0x38bd85){if(!_0x38bd85)this[_0x46c8('0xb')](_0x46c8('0xc'),null);this[_0x46c8('0xb')](_0x46c8('0xd'),_0x38bd85);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index ea81647..13385ff 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 _0xb564=['role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','send','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','MailAccounts','UserProfileResource','stack','name','index','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','MailServerIn','merge','find','body','Smtp','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','email','isNil','active','description','cservice','user','cuser','password','authentication','host','port','service','pass','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0xb564,0x1d9));var _0x4b56=function(_0x2e05fc,_0x528437){_0x2e05fc=_0x2e05fc-0x0;var _0x21820c=_0xb564[_0x2e05fc];return _0x21820c;};'use strict';var emlformat=require(_0x4b56('0x0'));var rimraf=require(_0x4b56('0x1'));var zipdir=require(_0x4b56('0x2'));var jsonpatch=require(_0x4b56('0x3'));var rp=require(_0x4b56('0x4'));var moment=require(_0x4b56('0x5'));var BPromise=require(_0x4b56('0x6'));var Mustache=require(_0x4b56('0x7'));var util=require(_0x4b56('0x8'));var path=require(_0x4b56('0x9'));var sox=require(_0x4b56('0xa'));var csv=require(_0x4b56('0xb'));var ejs=require(_0x4b56('0xc'));var fs=require('fs');var fs_extra=require(_0x4b56('0xd'));var _=require('lodash');var squel=require(_0x4b56('0xe'));var crypto=require(_0x4b56('0xf'));var jsforce=require(_0x4b56('0x10'));var deskjs=require(_0x4b56('0x11'));var toCsv=require(_0x4b56('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0x4b56('0x12'));var juice=require(_0x4b56('0x13'));var Redis=require(_0x4b56('0x14'));var authService=require(_0x4b56('0x15'));var qs=require(_0x4b56('0x16'));var as=require(_0x4b56('0x17'));var hardwareService=require(_0x4b56('0x18'));var logger=require('../../config/logger')(_0x4b56('0x19'));var utils=require(_0x4b56('0x1a'));var config=require(_0x4b56('0x1b'));var licenseUtil=require(_0x4b56('0x1c'));var db=require('../../mysqldb')['db'];config[_0x4b56('0x1d')]=_[_0x4b56('0x1e')](config['redis'],{'host':_0x4b56('0x1f'),'port':0x18eb});var socket=require(_0x4b56('0x20'))(new Redis(config[_0x4b56('0x1d')]));require(_0x4b56('0x21'))[_0x4b56('0x22')](socket);var jayson=require(_0x4b56('0x23'));var client=jayson[_0x4b56('0x24')][_0x4b56('0x25')]({'port':0x232b});function respondWithRpcPromise(_0x1d9951,_0x386a3f,_0x2d4e66,_0x90d210){return new BPromise(function(_0x1da126,_0x31a0fd){var _0x520860=_0x90d210||client;return _0x520860[_0x4b56('0x26')](_0x1d9951,_0x2d4e66)['then'](function(_0x5d9044){logger[_0x4b56('0x27')](_0x4b56('0x28'),_0x386a3f,_0x4b56('0x29'));logger[_0x4b56('0x2a')](_0x4b56('0x2b'),_0x386a3f,_0x4b56('0x29'),JSON[_0x4b56('0x2c')](_0x5d9044));if(_0x5d9044[_0x4b56('0x2d')]){if(_0x5d9044['error'][_0x4b56('0x2e')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x386a3f,_0x5d9044[_0x4b56('0x2d')][_0x4b56('0x2f')]);return _0x31a0fd(_0x5d9044[_0x4b56('0x2d')]['message']);}logger['error'](_0x4b56('0x28'),_0x386a3f,_0x5d9044['error'][_0x4b56('0x2f')]);return _0x1da126(_0x5d9044[_0x4b56('0x2d')][_0x4b56('0x2f')]);}else{logger[_0x4b56('0x27')](_0x4b56('0x28'),_0x386a3f,_0x4b56('0x29'));_0x1da126(_0x5d9044[_0x4b56('0x30')][_0x4b56('0x2f')]);}})[_0x4b56('0x31')](function(_0x2fbdc5){logger[_0x4b56('0x2d')]('MailAccount,\x20%s,\x20%s',_0x386a3f,_0x2fbdc5);_0x31a0fd(_0x2fbdc5);});});}function respondWithStatusCode(_0x18f46a,_0x249aea){_0x249aea=_0x249aea||0xcc;return function(_0x528b73){if(_0x528b73){return _0x18f46a[_0x4b56('0x32')](_0x249aea);}return _0x18f46a[_0x4b56('0x33')](_0x249aea)[_0x4b56('0x34')]();};}function respondWithResult(_0x5ca7c1,_0x8db296){_0x8db296=_0x8db296||0xc8;return function(_0x8c76be){if(_0x8c76be){return _0x5ca7c1[_0x4b56('0x33')](_0x8db296)[_0x4b56('0x35')](_0x8c76be);}};}function respondWithFilteredResult(_0x272c98,_0x3c9756){return function(_0x50c2ba){if(_0x50c2ba){var _0x499669=typeof _0x3c9756['offset']===_0x4b56('0x36')&&typeof _0x3c9756[_0x4b56('0x37')]===_0x4b56('0x36');var _0x48cdbc=_0x50c2ba[_0x4b56('0x38')];var _0x265aa4=_0x499669?0x0:_0x3c9756[_0x4b56('0x39')];var _0x472961=_0x499669?_0x50c2ba['count']:_0x3c9756['offset']+_0x3c9756[_0x4b56('0x37')];var _0x288410;if(_0x472961>=_0x48cdbc){_0x472961=_0x48cdbc;_0x288410=0xc8;}else{_0x288410=0xce;}_0x272c98['status'](_0x288410);return _0x272c98[_0x4b56('0x3a')](_0x4b56('0x3b'),_0x265aa4+'-'+_0x472961+'/'+_0x48cdbc)['json'](_0x50c2ba);}return null;};}function patchUpdates(_0x594ab5){return function(_0x4f541f){try{jsonpatch[_0x4b56('0x3c')](_0x4f541f,_0x594ab5,!![]);}catch(_0x15d11d){return BPromise['reject'](_0x15d11d);}return _0x4f541f[_0x4b56('0x3d')]();};}function saveUpdates(_0x3454ef,_0x56ea63){return function(_0x5a2ee5){if(_0x5a2ee5){return _0x5a2ee5[_0x4b56('0x3e')](_0x3454ef)[_0x4b56('0x3f')](function(_0x46fff4){return _0x46fff4;});}return null;};}function removeEntity(_0x47f957,_0x2837d2){return function(_0xb96386){if(_0xb96386){return _0xb96386[_0x4b56('0x40')]()[_0x4b56('0x3f')](function(){var _0xd682c3=_0xb96386[_0x4b56('0x41')]({'plain':!![]});var _0x1a6f55=_0x4b56('0x42');return db[_0x4b56('0x43')][_0x4b56('0x40')]({'where':{'type':_0x1a6f55,'resourceId':_0xd682c3['id']}})[_0x4b56('0x3f')](function(){return _0xb96386;});})[_0x4b56('0x3f')](function(){_0x47f957[_0x4b56('0x33')](0xcc)[_0x4b56('0x34')]();});}};}function handleEntityNotFound(_0x2226cf,_0x4339c1){return function(_0x53149f){if(!_0x53149f){_0x2226cf['sendStatus'](0x194);}return _0x53149f;};}function handleError(_0x2fc621,_0x192e30){_0x192e30=_0x192e30||0x1f4;return function(_0x5ec64e){logger[_0x4b56('0x2d')](_0x5ec64e[_0x4b56('0x44')]);if(_0x5ec64e['name']){delete _0x5ec64e[_0x4b56('0x45')];}_0x2fc621[_0x4b56('0x33')](_0x192e30)['send'](_0x5ec64e);};}exports[_0x4b56('0x46')]=function(_0xb4dbc8,_0xf5db24){var _0x1d8dc7={'include':[{'model':db['MailServerIn'],'as':_0x4b56('0x47')},{'model':db[_0x4b56('0x48')],'as':'Smtp'},{'model':db[_0x4b56('0x49')],'as':_0x4b56('0x4a')}]},_0x383f36={},_0x4d76e2={'count':0x0,'rows':[]};var _0x3fe798=_[_0x4b56('0x4b')](db[_0x4b56('0x4c')][_0x4b56('0x4d')],function(_0x2161c5){return{'name':_0x2161c5[_0x4b56('0x4e')],'type':_0x2161c5[_0x4b56('0x4f')][_0x4b56('0x50')]};});_0x383f36[_0x4b56('0x51')]=_[_0x4b56('0x4b')](_0x3fe798,_0x4b56('0x45'));_0x383f36[_0x4b56('0x52')]=_[_0x4b56('0x53')](_0xb4dbc8[_0x4b56('0x52')]);_0x383f36[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x383f36[_0x4b56('0x51')],_0x383f36[_0x4b56('0x52')]);_0x1d8dc7[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x383f36[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x57')]));_0x1d8dc7[_0x4b56('0x56')]=_0x1d8dc7[_0x4b56('0x56')][_0x4b56('0x58')]?_0x1d8dc7[_0x4b56('0x56')]:_0x383f36['model'];if(!_0xb4dbc8['query'][_0x4b56('0x59')]('nolimit')){_0x1d8dc7['limit']=qs[_0x4b56('0x37')](_0xb4dbc8[_0x4b56('0x52')]['limit']);_0x1d8dc7[_0x4b56('0x39')]=qs[_0x4b56('0x39')](_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x39')]);}_0x1d8dc7[_0x4b56('0x5a')]=qs[_0x4b56('0x5b')](_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x5b')]);_0x1d8dc7[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_[_0x4b56('0x5d')](_0xb4dbc8[_0x4b56('0x52')],_0x383f36[_0x4b56('0x54')]),_0x3fe798);if(_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x5e')]){_0x1d8dc7['where']=_['merge'](_0x1d8dc7[_0x4b56('0x5c')],{'$or':_['map'](_0x3fe798,function(_0x39cc68){if(_0x39cc68[_0x4b56('0x4f')]!==_0x4b56('0x5f')){var _0x3b5c5b={};_0x3b5c5b[_0x39cc68[_0x4b56('0x45')]]={'$like':'%'+_0xb4dbc8[_0x4b56('0x52')]['filter']+'%'};return _0x3b5c5b;}})});}_0x1d8dc7=_['merge']({},_0x1d8dc7,_0xb4dbc8[_0x4b56('0x60')]);var _0x2437cc={'where':_0x1d8dc7[_0x4b56('0x5c')]};return db[_0x4b56('0x4c')][_0x4b56('0x38')](_0x2437cc)[_0x4b56('0x3f')](function(_0x5202af){_0x4d76e2[_0x4b56('0x38')]=_0x5202af;if(_0xb4dbc8[_0x4b56('0x52')][_0x4b56('0x61')]){_0x1d8dc7[_0x4b56('0x62')]=[{'all':!![]}];}return db[_0x4b56('0x4c')][_0x4b56('0x63')](_0x1d8dc7);})[_0x4b56('0x3f')](function(_0x28de27){_0x4d76e2[_0x4b56('0x64')]=_0x28de27;return _0x4d76e2;})['then'](respondWithFilteredResult(_0xf5db24,_0x1d8dc7))['catch'](handleError(_0xf5db24,null));};exports[_0x4b56('0x65')]=function(_0x49e47a,_0x50ff56){var _0x31e453={'raw':![],'where':{'id':_0x49e47a[_0x4b56('0x66')]['id']},'include':[{'model':db[_0x4b56('0x67')],'as':_0x4b56('0x47')},{'model':db[_0x4b56('0x48')],'as':'Smtp'},{'model':db[_0x4b56('0x49')],'as':_0x4b56('0x4a')}]},_0x33d179={};_0x33d179['model']=_[_0x4b56('0x53')](db[_0x4b56('0x4c')]['rawAttributes']);_0x33d179[_0x4b56('0x52')]=_['keys'](_0x49e47a[_0x4b56('0x52')]);_0x33d179[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x33d179[_0x4b56('0x51')],_0x33d179[_0x4b56('0x52')]);_0x31e453[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x33d179[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0x49e47a['query'][_0x4b56('0x57')]));_0x31e453[_0x4b56('0x56')]=_0x31e453[_0x4b56('0x56')][_0x4b56('0x58')]?_0x31e453[_0x4b56('0x56')]:_0x33d179['model'];if(_0x49e47a[_0x4b56('0x52')]['includeAll']){_0x31e453['include']=[{'all':!![]}];}_0x31e453=_[_0x4b56('0x68')]({},_0x31e453,_0x49e47a[_0x4b56('0x60')]);return db['MailAccount'][_0x4b56('0x69')](_0x31e453)['then'](handleEntityNotFound(_0x50ff56,null))['then'](respondWithResult(_0x50ff56,null))['catch'](handleError(_0x50ff56,null));};exports[_0x4b56('0x3e')]=function(_0x5f9534,_0x305a40){if(_0x5f9534[_0x4b56('0x6a')]['id']){delete _0x5f9534['body']['id'];}return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x5f9534[_0x4b56('0x66')]['id']},'include':[{'model':db[_0x4b56('0x67')],'as':_0x4b56('0x47')},{'model':db['MailServerOut'],'as':_0x4b56('0x6b')},{'model':db[_0x4b56('0x49')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x305a40,null))[_0x4b56('0x3f')](saveUpdates(_0x5f9534[_0x4b56('0x6a')],null))[_0x4b56('0x3f')](function(_0x78be57){if(_0x78be57&&_0x5f9534[_0x4b56('0x6a')][_0x4b56('0x47')]){return db[_0x4b56('0x67')][_0x4b56('0x3e')](_0x5f9534['body'][_0x4b56('0x47')],{'where':{'MailAccountId':_0x78be57['id']}})['then'](function(){return _0x78be57;});}return _0x78be57;})[_0x4b56('0x3f')](function(_0x27380c){if(_0x27380c&&_0x5f9534['body'][_0x4b56('0x6b')]){return db[_0x4b56('0x48')]['update'](_0x5f9534['body'][_0x4b56('0x6b')],{'where':{'MailAccountId':_0x27380c['id']}})[_0x4b56('0x3f')](function(){return _0x27380c;});}return _0x27380c;})[_0x4b56('0x3f')](respondWithResult(_0x305a40,null))[_0x4b56('0x31')](handleError(_0x305a40,null));};exports['describe']=function(_0x5093e9,_0x1d162c){return db[_0x4b56('0x4c')][_0x4b56('0x6c')]()[_0x4b56('0x3f')](respondWithResult(_0x1d162c,null))[_0x4b56('0x31')](handleError(_0x1d162c,null));};exports[_0x4b56('0x6d')]=function(_0x419048,_0x436060,_0x25cd9c){if(_0x419048['body']['id']){delete _0x419048['body']['id'];}return db[_0x4b56('0x4c')]['find']({'where':{'id':_0x419048[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x436060,null))['then'](function(_0x446210){if(_0x446210){_0x419048[_0x4b56('0x6a')][_0x4b56('0x6e')]=_0x446210['id'];return db[_0x4b56('0x6f')][_0x4b56('0x70')](_0x419048[_0x4b56('0x6a')]);}})[_0x4b56('0x3f')](respondWithResult(_0x436060,null))[_0x4b56('0x31')](handleError(_0x436060,null));};exports[_0x4b56('0x71')]=function(_0x58c06a,_0x59c812,_0x109e41){var _0x5b7f8d={'raw':![],'where':{}};var _0x57e281={};var _0x5118f9={'count':0x0,'rows':[]};return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x58c06a['params']['id']}})['then'](handleEntityNotFound(_0x59c812,null))[_0x4b56('0x3f')](function(_0x374528){if(_0x374528){_0x57e281[_0x4b56('0x51')]=_[_0x4b56('0x53')](db[_0x4b56('0x6f')][_0x4b56('0x4d')]);_0x57e281[_0x4b56('0x52')]=_[_0x4b56('0x53')](_0x58c06a['query']);_0x57e281[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x57e281[_0x4b56('0x51')],_0x57e281['query']);_0x5b7f8d[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x57e281[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0x58c06a['query'][_0x4b56('0x57')]));_0x5b7f8d[_0x4b56('0x56')]=_0x5b7f8d['attributes']['length']?_0x5b7f8d[_0x4b56('0x56')]:_0x57e281[_0x4b56('0x51')];if(!_0x58c06a[_0x4b56('0x52')][_0x4b56('0x59')](_0x4b56('0x73'))){_0x5b7f8d[_0x4b56('0x37')]=qs[_0x4b56('0x37')](_0x58c06a[_0x4b56('0x52')][_0x4b56('0x37')]);_0x5b7f8d[_0x4b56('0x39')]=qs[_0x4b56('0x39')](_0x58c06a['query'][_0x4b56('0x39')]);}_0x5b7f8d[_0x4b56('0x5a')]=qs[_0x4b56('0x5b')](_0x58c06a['query'][_0x4b56('0x5b')]);_0x5b7f8d[_0x4b56('0x5c')]=qs['filters'](_[_0x4b56('0x5d')](_0x58c06a[_0x4b56('0x52')],_0x57e281[_0x4b56('0x54')]));_0x5b7f8d[_0x4b56('0x5c')][_0x4b56('0x6e')]=_0x374528['id'];if(_0x58c06a[_0x4b56('0x52')][_0x4b56('0x5e')]){_0x5b7f8d['where']=_[_0x4b56('0x68')](_0x5b7f8d['where'],{'$or':_[_0x4b56('0x4b')](_0x5b7f8d[_0x4b56('0x56')],function(_0x46666d){var _0x1b343c={};_0x1b343c[_0x46666d]={'$like':'%'+_0x58c06a['query'][_0x4b56('0x5e')]+'%'};return _0x1b343c;})});}_0x5b7f8d=_[_0x4b56('0x68')]({},_0x5b7f8d,_0x58c06a[_0x4b56('0x60')]);return db[_0x4b56('0x6f')][_0x4b56('0x38')]({'where':_0x5b7f8d['where']})[_0x4b56('0x3f')](function(_0x16865a){_0x5118f9['count']=_0x16865a;if(_0x58c06a[_0x4b56('0x52')]['includeAll']){_0x5b7f8d[_0x4b56('0x62')]=[{'all':!![]}];}return db[_0x4b56('0x6f')][_0x4b56('0x63')](_0x5b7f8d);})['then'](function(_0x47ebb2){_0x5118f9[_0x4b56('0x64')]=_0x47ebb2;return _0x5118f9;});}})['then'](respondWithFilteredResult(_0x59c812,_0x5b7f8d))[_0x4b56('0x31')](handleError(_0x59c812,null));};exports[_0x4b56('0x74')]=function(_0x341875,_0x4a272d,_0x375958){return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x341875['params']['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x4a272d,null))[_0x4b56('0x3f')](function(_0x2b3d12){if(_0x2b3d12){return _0x2b3d12[_0x4b56('0x74')](_0x341875['query'][_0x4b56('0x75')]);}})['then'](respondWithStatusCode(_0x4a272d,null))[_0x4b56('0x31')](handleError(_0x4a272d,null));};exports[_0x4b56('0x76')]=function(_0x31ce56,_0x3442c0,_0x480cbb){if(_0x31ce56[_0x4b56('0x6a')]['id']){delete _0x31ce56['body']['id'];}return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x31ce56[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x3442c0,null))[_0x4b56('0x3f')](function(_0x510492){if(_0x510492){_0x31ce56[_0x4b56('0x6a')][_0x4b56('0x6e')]=_0x510492['id'];return db[_0x4b56('0x77')][_0x4b56('0x70')](_0x31ce56['body']);}})['then'](respondWithResult(_0x3442c0,null))['catch'](handleError(_0x3442c0,null));};exports['getAnswers']=function(_0x2279df,_0x116ba8,_0x3518c2){var _0x359557={'raw':![],'where':{}};var _0x4257ea={};var _0xde410d={'count':0x0,'rows':[]};return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x2279df[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x116ba8,null))[_0x4b56('0x3f')](function(_0x4ef344){if(_0x4ef344){_0x4257ea[_0x4b56('0x51')]=_[_0x4b56('0x53')](db[_0x4b56('0x77')]['rawAttributes']);_0x4257ea[_0x4b56('0x52')]=_[_0x4b56('0x53')](_0x2279df[_0x4b56('0x52')]);_0x4257ea[_0x4b56('0x54')]=_['intersection'](_0x4257ea[_0x4b56('0x51')],_0x4257ea[_0x4b56('0x52')]);_0x359557[_0x4b56('0x56')]=_['intersection'](_0x4257ea[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0x2279df[_0x4b56('0x52')]['fields']));_0x359557[_0x4b56('0x56')]=_0x359557[_0x4b56('0x56')][_0x4b56('0x58')]?_0x359557[_0x4b56('0x56')]:_0x4257ea[_0x4b56('0x51')];if(!_0x2279df[_0x4b56('0x52')][_0x4b56('0x59')](_0x4b56('0x73'))){_0x359557['limit']=qs[_0x4b56('0x37')](_0x2279df[_0x4b56('0x52')][_0x4b56('0x37')]);_0x359557['offset']=qs[_0x4b56('0x39')](_0x2279df[_0x4b56('0x52')]['offset']);}_0x359557['order']=qs[_0x4b56('0x5b')](_0x2279df['query'][_0x4b56('0x5b')]);_0x359557[_0x4b56('0x5c')]=qs['filters'](_[_0x4b56('0x5d')](_0x2279df[_0x4b56('0x52')],_0x4257ea[_0x4b56('0x54')]));_0x359557['where'][_0x4b56('0x6e')]=_0x4ef344['id'];if(_0x2279df['query'][_0x4b56('0x5e')]){_0x359557['where']=_[_0x4b56('0x68')](_0x359557[_0x4b56('0x5c')],{'$or':_[_0x4b56('0x4b')](_0x359557['attributes'],function(_0x289c42){var _0x14ee2c={};_0x14ee2c[_0x289c42]={'$like':'%'+_0x2279df[_0x4b56('0x52')]['filter']+'%'};return _0x14ee2c;})});}_0x359557=_['merge']({},_0x359557,_0x2279df['options']);return db[_0x4b56('0x77')][_0x4b56('0x38')]({'where':_0x359557['where']})[_0x4b56('0x3f')](function(_0x244396){_0xde410d['count']=_0x244396;if(_0x2279df[_0x4b56('0x52')][_0x4b56('0x61')]){_0x359557['include']=[{'all':!![]}];}return db[_0x4b56('0x77')][_0x4b56('0x63')](_0x359557);})[_0x4b56('0x3f')](function(_0x4075ab){_0xde410d[_0x4b56('0x64')]=_0x4075ab;return _0xde410d;});}})[_0x4b56('0x3f')](respondWithFilteredResult(_0x116ba8,_0x359557))[_0x4b56('0x31')](handleError(_0x116ba8,null));};exports[_0x4b56('0x78')]=function(_0x1a1e5a,_0x56fd51,_0x199fa4){return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x1a1e5a[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x56fd51,null))[_0x4b56('0x3f')](function(_0x31b9e6){if(_0x31b9e6){return _0x31b9e6[_0x4b56('0x78')](_0x1a1e5a['query'][_0x4b56('0x75')]);}})[_0x4b56('0x3f')](respondWithStatusCode(_0x56fd51,null))[_0x4b56('0x31')](handleError(_0x56fd51,null));};exports[_0x4b56('0x70')]=function(_0x227e62,_0x5835a3){var _0x2dc108={'name':_0x227e62['body']['name'],'key':_0x227e62[_0x4b56('0x6a')]['key'],'email':_0x227e62[_0x4b56('0x6a')][_0x4b56('0x79')],'ListId':_0x227e62['body']['ListId'],'active':!_[_0x4b56('0x7a')](_0x227e62[_0x4b56('0x6a')]['active'])?_0x227e62['body'][_0x4b56('0x7b')]:!![],'description':_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7c')]||null,'Imap':{},'Smtp':{}};if(_[_0x4b56('0x7a')](_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7d')])){if(_0x227e62[_0x4b56('0x6a')]['cauthentication']){_0x2dc108[_0x4b56('0x47')][_0x4b56('0x7e')]=_0x2dc108['Smtp'][_0x4b56('0x7e')]=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7f')];_0x2dc108[_0x4b56('0x47')][_0x4b56('0x80')]=_0x2dc108['Smtp']['pass']=_0x227e62[_0x4b56('0x6a')]['cpassword'];}else{_0x2dc108[_0x4b56('0x47')]['authentication']=_0x2dc108[_0x4b56('0x6b')][_0x4b56('0x81')]=![];}_0x2dc108['Imap'][_0x4b56('0x82')]=_0x227e62['body'][_0x4b56('0x47')][_0x4b56('0x82')];_0x2dc108[_0x4b56('0x47')][_0x4b56('0x83')]=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x47')][_0x4b56('0x83')];_0x2dc108[_0x4b56('0x6b')]['host']=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x6b')][_0x4b56('0x82')];_0x2dc108[_0x4b56('0x6b')][_0x4b56('0x83')]=_0x227e62['body'][_0x4b56('0x6b')][_0x4b56('0x83')];}else{_0x2dc108[_0x4b56('0x47')][_0x4b56('0x84')]=_0x2dc108[_0x4b56('0x6b')]['service']=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7d')];_0x2dc108[_0x4b56('0x47')]['user']=_0x2dc108[_0x4b56('0x6b')][_0x4b56('0x7e')]=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x7f')];_0x2dc108['Imap']['password']=_0x2dc108[_0x4b56('0x6b')][_0x4b56('0x85')]=_0x227e62[_0x4b56('0x6a')][_0x4b56('0x86')];}return db[_0x4b56('0x4c')][_0x4b56('0x70')](_0x2dc108,{'include':[{'model':db[_0x4b56('0x48')],'as':_0x4b56('0x6b')},{'model':db[_0x4b56('0x67')],'as':_0x4b56('0x47')}]})[_0x4b56('0x3f')](function(_0x546f04){var _0x5ec89f=_0x227e62['user'][_0x4b56('0x41')]({'plain':!![]});if(!_0x5ec89f)throw new Error(_0x4b56('0x87'));if(_0x5ec89f[_0x4b56('0x88')]===_0x4b56('0x7e')){var _0x5ba8de=_0x546f04[_0x4b56('0x41')]({'plain':!![]});return db['UserProfileSection'][_0x4b56('0x69')]({'where':{'name':_0x4b56('0x42'),'userProfileId':_0x5ec89f[_0x4b56('0x89')]},'raw':!![]})[_0x4b56('0x3f')](function(_0x4a4426){if(_0x4a4426&&_0x4a4426['autoAssociation']===0x0){return db[_0x4b56('0x43')]['create']({'name':_0x5ba8de[_0x4b56('0x45')],'resourceId':_0x5ba8de['id'],'type':_0x4a4426[_0x4b56('0x45')],'sectionId':_0x4a4426['id']},{})[_0x4b56('0x3f')](function(){return _0x546f04;});}else{return _0x546f04;}})[_0x4b56('0x31')](function(_0x5485ce){logger[_0x4b56('0x2d')](_0x4b56('0x8a'),_0x5485ce);throw _0x5485ce;});}return _0x546f04;})[_0x4b56('0x3f')](respondWithResult(_0x5835a3,0xc9))[_0x4b56('0x31')](handleError(_0x5835a3,null));};exports[_0x4b56('0x8b')]=function(_0x19baf4,_0x5a96c2,_0x852f4a){return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x19baf4[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x5a96c2,null))['then'](function(_0x39a9c1){if(_0x39a9c1){return _0x39a9c1[_0x4b56('0x8b')]();}return null;})['then'](respondWithResult(_0x5a96c2,null))[_0x4b56('0x31')](handleError(_0x5a96c2,null));};exports['addImap']=function(_0x50108f,_0x425998,_0x45e578){if(_0x50108f['body']['id']){delete _0x50108f[_0x4b56('0x6a')]['id'];}return db[_0x4b56('0x4c')]['find']({'where':{'id':_0x50108f['params']['id']}})['then'](handleEntityNotFound(_0x425998,null))['then'](function(_0x4dbe4a){if(_0x4dbe4a){_0x50108f[_0x4b56('0x6a')][_0x4b56('0x6e')]=_0x4dbe4a['id'];return db[_0x4b56('0x67')][_0x4b56('0x70')](_0x50108f[_0x4b56('0x6a')]);}})['then'](respondWithResult(_0x425998,null))[_0x4b56('0x31')](handleError(_0x425998,null));};exports['removeImap']=function(_0x20efe2,_0x35a67f,_0x111e6d){return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x20efe2['params']['id']}})['then'](handleEntityNotFound(_0x35a67f,null))[_0x4b56('0x3f')](function(_0xeee40f){if(_0xeee40f){return _0xeee40f[_0x4b56('0x8c')](null);}return null;})[_0x4b56('0x3f')](respondWithStatusCode(_0x35a67f,null))[_0x4b56('0x31')](handleError(_0x35a67f,null));};exports['getSmtp']=function(_0x22952c,_0xc13975,_0xaf3553){return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x22952c[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0xc13975,null))[_0x4b56('0x3f')](function(_0x32e4b7){if(_0x32e4b7){return _0x32e4b7[_0x4b56('0x8d')]();}return null;})[_0x4b56('0x3f')](respondWithResult(_0xc13975,null))['catch'](handleError(_0xc13975,null));};exports[_0x4b56('0x8e')]=function(_0x42f2f9,_0x275ed8,_0x24150f){if(_0x42f2f9[_0x4b56('0x6a')]['id']){delete _0x42f2f9[_0x4b56('0x6a')]['id'];}return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x42f2f9[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x275ed8,null))[_0x4b56('0x3f')](function(_0x43749c){if(_0x43749c){_0x42f2f9[_0x4b56('0x6a')][_0x4b56('0x6e')]=_0x43749c['id'];return db[_0x4b56('0x48')]['create'](_0x42f2f9[_0x4b56('0x6a')]);}})[_0x4b56('0x3f')](respondWithResult(_0x275ed8,null))['catch'](handleError(_0x275ed8,null));};exports[_0x4b56('0x8f')]=function(_0x187572,_0xfe2b46,_0x2ca9e6){return db[_0x4b56('0x4c')]['findOne']({'where':{'id':_0x187572[_0x4b56('0x66')]['id']}})['then'](handleEntityNotFound(_0xfe2b46,null))[_0x4b56('0x3f')](function(_0x25c228){if(_0x25c228){return _0x25c228[_0x4b56('0x90')](null);}return null;})[_0x4b56('0x3f')](respondWithStatusCode(_0xfe2b46,null))[_0x4b56('0x31')](handleError(_0xfe2b46,null));};exports[_0x4b56('0x91')]=function(_0x1d04a7,_0x35dbcf,_0x487454){return db['MailInteraction']['find']({'where':{'id':_0x1d04a7[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x35dbcf,null))[_0x4b56('0x3f')](function(_0x25954e){if(_0x25954e){return _0x25954e['addInteraction'](_0x1d04a7['body'][_0x4b56('0x75')],_[_0x4b56('0x92')](_0x1d04a7[_0x4b56('0x6a')],[_0x4b56('0x75'),'id'])||{});}})[_0x4b56('0x3f')](respondWithResult(_0x35dbcf,null))[_0x4b56('0x31')](handleError(_0x35dbcf,null));};exports[_0x4b56('0x93')]=function(_0x4fc01c,_0x365cbe,_0x292670){var _0x4d5c1a={'raw':![],'where':{}};var _0x18c557={};var _0x293ac2={'count':0x0,'rows':[]};return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x4fc01c[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x365cbe,null))[_0x4b56('0x3f')](function(_0x32fce7){if(_0x32fce7){_0x18c557[_0x4b56('0x51')]=_['keys'](db[_0x4b56('0x94')][_0x4b56('0x4d')]);_0x18c557['query']=_['keys'](_0x4fc01c[_0x4b56('0x52')]);_0x18c557[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x18c557['model'],_0x18c557[_0x4b56('0x52')]);_0x4d5c1a['attributes']=_[_0x4b56('0x55')](_0x18c557[_0x4b56('0x51')],qs['fields'](_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x57')]));_0x4d5c1a[_0x4b56('0x56')]=_0x4d5c1a[_0x4b56('0x56')]['length']?_0x4d5c1a[_0x4b56('0x56')]:_0x18c557[_0x4b56('0x51')];if(!_0x4fc01c['query'][_0x4b56('0x59')](_0x4b56('0x73'))){_0x4d5c1a[_0x4b56('0x37')]=qs[_0x4b56('0x37')](_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x37')]);_0x4d5c1a['offset']=qs[_0x4b56('0x39')](_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x39')]);}_0x4d5c1a['order']=qs[_0x4b56('0x5b')](_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x5b')]);_0x4d5c1a[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_[_0x4b56('0x5d')](_0x4fc01c[_0x4b56('0x52')],_0x18c557['filters']));_0x4d5c1a['where']['MailAccountId']=_0x32fce7['id'];if(_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x5e')]){_0x4d5c1a[_0x4b56('0x5c')]=_[_0x4b56('0x68')](_0x4d5c1a['where'],{'$or':_['map'](_0x4d5c1a[_0x4b56('0x56')],function(_0x4a4e7b){var _0x4cfba7={};_0x4cfba7[_0x4a4e7b]={'$like':'%'+_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x5e')]+'%'};return _0x4cfba7;})});}_0x4d5c1a=_[_0x4b56('0x68')]({},_0x4d5c1a,_0x4fc01c[_0x4b56('0x60')]);return db[_0x4b56('0x94')][_0x4b56('0x38')]({'where':_0x4d5c1a[_0x4b56('0x5c')]})[_0x4b56('0x3f')](function(_0x3039c8){_0x293ac2[_0x4b56('0x38')]=_0x3039c8;if(_0x4fc01c[_0x4b56('0x52')]['includeAll']){_0x4d5c1a['include']=[{'model':db[_0x4b56('0x95')],'as':_0x4b56('0x96'),'required':![]},{'model':db[_0x4b56('0x97')],'as':_0x4b56('0x98'),'attributes':['name',_0x4b56('0x99'),'internal'],'required':![]},{'model':db[_0x4b56('0x9a')],'as':_0x4b56('0x9b'),'attributes':['id','name',_0x4b56('0x9c')],'where':_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x9d')]?{'id':_0x4fc01c[_0x4b56('0x52')][_0x4b56('0x9d')]}:undefined,'required':_0x4fc01c[_0x4b56('0x52')]['tag']?!![]:![]}];}return db[_0x4b56('0x94')][_0x4b56('0x63')](_0x4d5c1a);})[_0x4b56('0x3f')](function(_0x32deaa){_0x293ac2['rows']=_0x32deaa;return _0x293ac2;});}})['then'](respondWithFilteredResult(_0x365cbe,_0x4d5c1a))[_0x4b56('0x31')](handleError(_0x365cbe,null));};exports[_0x4b56('0x9e')]=function(_0x2bdc75,_0x4bdcbc,_0x28f500){return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x2bdc75['params']['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x4bdcbc,null))[_0x4b56('0x3f')](function(_0x45f7e2){if(_0x45f7e2){return db['sequelize'][_0x4b56('0x9f')](function(_0x94e241){return db[_0x4b56('0xa0')][_0x4b56('0x40')]({'where':{'MailAccountId':_0x2bdc75['params']['id']},'transaction':_0x94e241})[_0x4b56('0x3f')](function(_0x5e9e0a){var _0x2f861c=_[_0x4b56('0x4b')](_0x2bdc75[_0x4b56('0x6a')],function(_0xb29f76){_0xb29f76[_0x4b56('0x6e')]=_0x2bdc75[_0x4b56('0x66')]['id'];return _0xb29f76;});return db[_0x4b56('0xa0')]['bulkCreate'](_0x2f861c,{'transaction':_0x94e241});});})[_0x4b56('0x3f')](function(){return db[_0x4b56('0xa0')][_0x4b56('0xa1')]({'where':{'MailAccountId':_0x2bdc75[_0x4b56('0x66')]['id']},'order':_0x4b56('0xa2')});});}})['then'](respondWithResult(_0x4bdcbc,null))[_0x4b56('0x31')](handleError(_0x4bdcbc,null));};exports[_0x4b56('0xa3')]=function(_0x3a96c7,_0x13e294,_0x4e12e6){var _0x433ece={};var _0x104e1a={};var _0x186e05;var _0x15f50e;return db[_0x4b56('0x4c')]['findOne']({'where':{'id':_0x3a96c7[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x13e294,null))[_0x4b56('0x3f')](function(_0x1c67f6){if(_0x1c67f6){_0x186e05=_0x1c67f6;_0x104e1a[_0x4b56('0x51')]=_[_0x4b56('0x53')](db[_0x4b56('0xa0')][_0x4b56('0x4d')]);_0x104e1a[_0x4b56('0x52')]=_['keys'](_0x3a96c7[_0x4b56('0x52')]);_0x104e1a['filters']=_['intersection'](_0x104e1a[_0x4b56('0x51')],_0x104e1a[_0x4b56('0x52')]);_0x433ece[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x104e1a[_0x4b56('0x51')],qs[_0x4b56('0x57')](_0x3a96c7[_0x4b56('0x52')][_0x4b56('0x57')]));_0x433ece['attributes']=_0x433ece[_0x4b56('0x56')][_0x4b56('0x58')]?_0x433ece[_0x4b56('0x56')]:_0x104e1a['model'];_0x433ece['order']=qs['sort'](_0x3a96c7[_0x4b56('0x52')][_0x4b56('0x5b')]);_0x433ece[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_['pick'](_0x3a96c7['query'],_0x104e1a['filters']));if(_0x3a96c7[_0x4b56('0x52')]['filter']){_0x433ece[_0x4b56('0x5c')]=_[_0x4b56('0x68')](_0x433ece[_0x4b56('0x5c')],{'$or':_['map'](_0x433ece[_0x4b56('0x56')],function(_0x5e7786){var _0x3c88e2={};_0x3c88e2[_0x5e7786]={'$like':'%'+_0x3a96c7[_0x4b56('0x52')][_0x4b56('0x5e')]+'%'};return _0x3c88e2;})});}_0x433ece=_[_0x4b56('0x68')]({},_0x433ece,_0x3a96c7['options']);return _0x186e05['getApplications'](_0x433ece);}})[_0x4b56('0x3f')](function(_0x1cc394){if(_0x1cc394){_0x15f50e=_0x1cc394['length'];if(!_0x3a96c7['query'][_0x4b56('0x59')](_0x4b56('0x73'))){_0x433ece[_0x4b56('0x37')]=qs['limit'](_0x3a96c7['query'][_0x4b56('0x37')]);_0x433ece[_0x4b56('0x39')]=qs[_0x4b56('0x39')](_0x3a96c7[_0x4b56('0x52')][_0x4b56('0x39')]);}return _0x186e05[_0x4b56('0xa3')](_0x433ece);}})['then'](function(_0x5675e4){if(_0x5675e4){return _0x5675e4?{'count':_0x15f50e,'rows':_0x5675e4}:null;}})[_0x4b56('0x3f')](respondWithResult(_0x13e294,null))['catch'](handleError(_0x13e294,null));};exports[_0x4b56('0xa4')]=function(_0x3f57ac,_0x2d6823,_0x19c1ed){var _0x3ece96={'raw':!![],'where':{}};var _0x141cb3={};var _0x5a6d53={'count':0x0,'rows':[]};return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x3f57ac[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x2d6823,null))[_0x4b56('0x3f')](function(_0x4b1040){if(_0x4b1040){_0x141cb3[_0x4b56('0x51')]=_[_0x4b56('0x53')](db[_0x4b56('0xa5')][_0x4b56('0x4d')]);_0x141cb3[_0x4b56('0x52')]=_[_0x4b56('0x53')](_0x3f57ac['query']);_0x141cb3['filters']=_[_0x4b56('0x55')](_0x141cb3[_0x4b56('0x51')],_0x141cb3[_0x4b56('0x52')]);_0x3ece96[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x141cb3[_0x4b56('0x51')],qs['fields'](_0x3f57ac[_0x4b56('0x52')][_0x4b56('0x57')]));_0x3ece96[_0x4b56('0x56')]=_0x3ece96[_0x4b56('0x56')][_0x4b56('0x58')]?_0x3ece96[_0x4b56('0x56')]:_0x141cb3[_0x4b56('0x51')];if(!_0x3f57ac[_0x4b56('0x52')][_0x4b56('0x59')](_0x4b56('0x73'))){_0x3ece96['limit']=qs[_0x4b56('0x37')](_0x3f57ac['query'][_0x4b56('0x37')]);_0x3ece96[_0x4b56('0x39')]=qs[_0x4b56('0x39')](_0x3f57ac['query']['offset']);}_0x3ece96['order']=qs['sort'](_0x3f57ac[_0x4b56('0x52')]['sort']);_0x3ece96[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_[_0x4b56('0x5d')](_0x3f57ac[_0x4b56('0x52')],_0x141cb3[_0x4b56('0x54')]));_0x3ece96['where']['MailAccountId']=_0x4b1040['id'];if(_0x3f57ac['query'][_0x4b56('0x5e')]){_0x3ece96['where']=_['merge'](_0x3ece96[_0x4b56('0x5c')],{'$or':_[_0x4b56('0x4b')](_0x3ece96['attributes'],function(_0x171dca){var _0x555f22={};_0x555f22[_0x171dca]={'$like':'%'+_0x3f57ac['query'][_0x4b56('0x5e')]+'%'};return _0x555f22;})});}if(_0x3f57ac[_0x4b56('0x52')][_0x4b56('0xa6')]){var _0x4bb06f=_0x3f57ac[_0x4b56('0x52')][_0x4b56('0xa6')][_0x4b56('0xa7')](',');var _0x4c1584={};_0x4c1584[_0x4bb06f[0x0]]={'$gte':moment(_0x4bb06f[0x1])[_0x4b56('0xa8')](_0x4b56('0xa9'))};_0x3ece96['where']=_[_0x4b56('0x68')](_0x3ece96[_0x4b56('0x5c')],_0x4c1584);}_0x3ece96=_['merge']({},_0x3ece96,_0x3f57ac[_0x4b56('0x60')]);return db[_0x4b56('0xa5')][_0x4b56('0x38')]({'where':_0x3ece96[_0x4b56('0x5c')]})[_0x4b56('0x3f')](function(_0x29667a){_0x5a6d53[_0x4b56('0x38')]=_0x29667a;if(_0x3f57ac['query']['includeAll']){_0x3ece96[_0x4b56('0x62')]=[{'all':!![]}];}return db[_0x4b56('0xa5')][_0x4b56('0x63')](_0x3ece96);})['then'](function(_0x178d93){if(_0x3f57ac[_0x4b56('0x52')][_0x4b56('0xaa')]===_0x4b56('0xab')){for(var _0x1a3673=0x0;_0x1a3673<_0x178d93[_0x4b56('0x58')];_0x1a3673++){_0x178d93[_0x1a3673][_0x4b56('0x6a')]=juice(_0x178d93[_0x1a3673][_0x4b56('0x6a')]);}}_0x5a6d53[_0x4b56('0x64')]=_0x178d93;return _0x5a6d53;});}})[_0x4b56('0x3f')](respondWithFilteredResult(_0x2d6823,_0x3ece96))[_0x4b56('0x31')](handleError(_0x2d6823,null));};exports[_0x4b56('0xac')]=function(_0x2f02be,_0x1221c9,_0x5f2a3e){var _0x1cdde8,_0x401596={},_0x22030b;if(_0x2f02be['body']['to']){_0x22030b=_0x2f02be[_0x4b56('0x6a')]['to'][_0x4b56('0xa7')](',')[0x0];}return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x2f02be[_0x4b56('0x66')]['id']},'include':[{'model':db[_0x4b56('0xad')],'as':_0x4b56('0xae'),'include':[{'model':db[_0x4b56('0x95')],'as':_0x4b56('0xaf'),'where':{'email':_0x22030b},'limit':0x1,'order':[[_0x4b56('0xb0'),_0x4b56('0xb1')]]}]},{'model':db['MailServerOut'],'as':_0x4b56('0x6b'),'raw':!![]}]})[_0x4b56('0x3f')](handleEntityNotFound(_0x1221c9,null))['then'](function(_0x21134a){if(_0x21134a){_0x1cdde8=_0x21134a;if(_0x21134a[_0x4b56('0x6b')]){if(_[_0x4b56('0x7a')](_0x2f02be['body'][_0x4b56('0xb2')])){_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xb2')]=util['format'](_0x4b56('0xb3'),_0x21134a[_0x4b56('0x45')],_0x21134a[_0x4b56('0x79')]||_0x21134a[_0x4b56('0x6b')][_0x4b56('0x7e')]);}if(_0x2f02be['body'][_0x4b56('0xb4')]&&_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xb4')][_0x4b56('0x58')]){for(var _0x232692=0x0;_0x232692<_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xb4')]['length'];_0x232692+=0x1){_0x2f02be['body'][_0x4b56('0xb4')][_0x232692]={'filename':_0x2f02be['body'][_0x4b56('0xb4')][_0x232692][_0x4b56('0x45')],'path':path[_0x4b56('0xb5')](config['root'],_0x4b56('0xb6'),_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xb4')][_0x232692][_0x4b56('0xb7')])};}}var _0x1d81a0={'tls':{'rejectUnauthorized':![]}};if(_[_0x4b56('0x7a')](_0x21134a[_0x4b56('0x6b')][_0x4b56('0x84')])){if(_0x21134a[_0x4b56('0x6b')][_0x4b56('0x81')]){_0x1d81a0[_0x4b56('0xb8')]={'user':_0x21134a['Smtp'][_0x4b56('0x7e')],'pass':_0x21134a[_0x4b56('0x6b')][_0x4b56('0x85')]};}_0x1d81a0['host']=_0x21134a[_0x4b56('0x6b')]['host'];_0x1d81a0[_0x4b56('0x83')]=_0x21134a[_0x4b56('0x6b')]['port'];_0x1d81a0[_0x4b56('0xb9')]=_0x21134a[_0x4b56('0x6b')][_0x4b56('0xb9')];}else{_0x1d81a0['service']=_0x21134a[_0x4b56('0x6b')]['service'];_0x1d81a0['auth']={'user':_0x21134a[_0x4b56('0x6b')]['user'],'pass':_0x21134a[_0x4b56('0x6b')][_0x4b56('0x85')]};}return respondWithRpcPromise(_0x4b56('0xba'),'sendMail',{'account':_0x1d81a0,'message':_0x2f02be[_0x4b56('0x6a')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x5419ff){if(_0x5419ff){_0x401596=_0x5419ff;if(_0x1cdde8['List']){if(_0x1cdde8[_0x4b56('0xae')][_0x4b56('0xaf')][_0x4b56('0x58')]){return _0x1cdde8[_0x4b56('0xae')][_0x4b56('0xaf')][0x0];}else{return db[_0x4b56('0x95')][_0x4b56('0x70')](_['defaults'](_0x2f02be[_0x4b56('0x6a')],{'firstName':_0x2f02be[_0x4b56('0x6a')]['to'],'email':_0x2f02be[_0x4b56('0x6a')]['to'],'phone':_0x2f02be['body']['to'],'ListId':_0x1cdde8['ListId']}));}}else{throw new Error(_0x4b56('0xbb'));}}})[_0x4b56('0x3f')](function(_0x2056be){if(_0x2056be){var _0x4df62c={'UserId':_0x2f02be['user']['id'],'ContactId':_0x2056be['id'],'MailAccountId':_0x1cdde8['id'],'inReplyTo':_0x401596[_0x4b56('0xbc')],'to':_0x2f02be['body']['from'],'cc':_0x2f02be[_0x4b56('0x6a')]['cc'],'subject':_0x2f02be['body'][_0x4b56('0xbd')],'attach':_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xbe')],'firstMsgDirection':_0x4b56('0xbf'),'lastMsgAt':moment()[_0x4b56('0xa8')](_0x4b56('0xa9')),'lastMsgDirection':_0x4b56('0xbf'),'Messages':[_['merge'](_0x2f02be[_0x4b56('0x6a')],{'messageId':_0x401596[_0x4b56('0xbc')],'sentAt':moment()['format'](_0x4b56('0xa9')),'read':!![],'MailAccountId':_0x1cdde8['id'],'UserId':_0x2f02be['user']['id'],'ContactId':_0x2056be['id']})]};if(_0x2f02be[_0x4b56('0x6a')][_0x4b56('0xc0')]){_0x4df62c=_[_0x4b56('0x68')](_0x4df62c,_0x2f02be[_0x4b56('0x6a')]['Interaction']);}return db[_0x4b56('0x94')][_0x4b56('0x70')](_0x4df62c,{'include':[{'model':db[_0x4b56('0xa5')],'as':_0x4b56('0xc1')}]});}})[_0x4b56('0x3f')](respondWithResult(_0x1221c9,null))[_0x4b56('0x31')](handleError(_0x1221c9,null));};exports[_0x4b56('0xc2')]=function(_0x434c2d,_0x3a8813,_0x4ad171){return db['MailAccount'][_0x4b56('0x69')]({'where':{'id':_0x434c2d[_0x4b56('0x66')]['id']},'include':[{'model':db[_0x4b56('0x48')],'as':_0x4b56('0x6b'),'raw':!![]}]})[_0x4b56('0x3f')](handleEntityNotFound(_0x3a8813,null))[_0x4b56('0x3f')](function(_0xb626fe){if(_0xb626fe&&_0xb626fe[_0x4b56('0x6b')]){var _0x1abc47={'id':_0xb626fe['id'],'tls':{'rejectUnauthorized':![]}};if(_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x84')]){_0x1abc47[_0x4b56('0x84')]=_0xb626fe['Smtp'][_0x4b56('0x84')];}else{_0x1abc47[_0x4b56('0x82')]=_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x82')];_0x1abc47[_0x4b56('0x83')]=_0xb626fe['Smtp'][_0x4b56('0x83')];_0x1abc47[_0x4b56('0xb9')]=_0xb626fe[_0x4b56('0x6b')][_0x4b56('0xb9')];}if(_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x81')]){_0x1abc47['auth']={'user':_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x7e')],'pass':_0xb626fe[_0x4b56('0x6b')][_0x4b56('0x85')]};}return respondWithRpcPromise(_0x4b56('0xc3'),_0x4b56('0xc2'),{'account':_0x1abc47});}})[_0x4b56('0x3f')](respondWithResult(_0x3a8813,null))[_0x4b56('0x31')](handleError(_0x3a8813,null));};exports[_0x4b56('0x40')]=function(_0x199842,_0x436a68){return db['MailAccount']['find']({'where':{'id':_0x199842['params']['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x436a68,null))[_0x4b56('0x3f')](function(_0x167786){if(_0x167786&&_0x167786[_0x4b56('0x84')]){throw new db['Sequelize']['ValidationError'](_0x4b56('0xc4'));}return _0x167786;})['then'](removeEntity(_0x436a68,null))[_0x4b56('0x31')](handleError(_0x436a68,null));};exports['addAgents']=function(_0xaaa29e,_0x369ae8,_0x4c4a6a){return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0xaaa29e[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x369ae8,null))['then'](function(_0x41d71c){if(_0x41d71c){return _0x41d71c[_0x4b56('0xc5')](_0xaaa29e[_0x4b56('0x6a')][_0x4b56('0x75')],_['omit'](_0xaaa29e[_0x4b56('0x6a')],[_0x4b56('0x75'),'id'])||{})[_0x4b56('0xc6')](function(_0x4a7acd){for(var _0x3b1e5b=0x0;_0x3b1e5b<_0xaaa29e[_0x4b56('0x6a')]['ids'][_0x4b56('0x58')];_0x3b1e5b+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0xaaa29e[_0x4b56('0x6a')]['ids'][_0x3b1e5b]),'MailAccountId':Number(_0xaaa29e[_0x4b56('0x66')]['id'])});}return _0x4a7acd;});}})[_0x4b56('0x3f')](respondWithResult(_0x369ae8,null))[_0x4b56('0x31')](handleError(_0x369ae8,null));};exports[_0x4b56('0xc7')]=function(_0x572768,_0x1ba800,_0x2c53a2){return db[_0x4b56('0x4c')][_0x4b56('0x69')]({'where':{'id':_0x572768[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x1ba800,null))[_0x4b56('0x3f')](function(_0x38a2b4){if(_0x38a2b4){return _0x38a2b4[_0x4b56('0xc7')](_0x572768[_0x4b56('0x52')][_0x4b56('0x75')])['then'](function(){if(_[_0x4b56('0xc8')](_0x572768[_0x4b56('0x52')][_0x4b56('0x75')])){for(var _0x4fe9d5=0x0;_0x4fe9d5<_0x572768[_0x4b56('0x52')][_0x4b56('0x75')][_0x4b56('0x58')];_0x4fe9d5+=0x1){socket['emit'](_0x4b56('0xc9'),{'UserId':Number(_0x572768[_0x4b56('0x52')]['ids'][_0x4fe9d5]),'MailAccountId':Number(_0x572768['params']['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x572768[_0x4b56('0x52')]['ids']),'MailAccountId':Number(_0x572768[_0x4b56('0x66')]['id'])});}});}})[_0x4b56('0x3f')](respondWithStatusCode(_0x1ba800,null))[_0x4b56('0x31')](handleError(_0x1ba800,null));};exports['getAgents']=function(_0x16fa4d,_0x3586d4,_0x16ed38){var _0x3bd2a5={};var _0x2b89e0={};var _0x603f3;var _0x22706f;return db[_0x4b56('0x4c')][_0x4b56('0x72')]({'where':{'id':_0x16fa4d[_0x4b56('0x66')]['id']}})[_0x4b56('0x3f')](handleEntityNotFound(_0x3586d4,null))[_0x4b56('0x3f')](function(_0x50e856){if(_0x50e856){_0x603f3=_0x50e856;_0x2b89e0['model']=_[_0x4b56('0x53')](db[_0x4b56('0x97')][_0x4b56('0x4d')]);_0x2b89e0['query']=_['keys'](_0x16fa4d[_0x4b56('0x52')]);_0x2b89e0[_0x4b56('0x54')]=_[_0x4b56('0x55')](_0x2b89e0[_0x4b56('0x51')],_0x2b89e0['query']);_0x3bd2a5[_0x4b56('0x56')]=_[_0x4b56('0x55')](_0x2b89e0['model'],qs[_0x4b56('0x57')](_0x16fa4d[_0x4b56('0x52')][_0x4b56('0x57')]));_0x3bd2a5[_0x4b56('0x56')]=_0x3bd2a5[_0x4b56('0x56')][_0x4b56('0x58')]?_0x3bd2a5[_0x4b56('0x56')]:_0x2b89e0['model'];_0x3bd2a5[_0x4b56('0x5a')]=qs[_0x4b56('0x5b')](_0x16fa4d['query']['sort']);_0x3bd2a5[_0x4b56('0x5c')]=qs[_0x4b56('0x54')](_[_0x4b56('0x5d')](_0x16fa4d[_0x4b56('0x52')],_0x2b89e0[_0x4b56('0x54')]));if(_0x16fa4d[_0x4b56('0x52')][_0x4b56('0x5e')]){_0x3bd2a5[_0x4b56('0x5c')]=_[_0x4b56('0x68')](_0x3bd2a5[_0x4b56('0x5c')],{'$or':_[_0x4b56('0x4b')](_0x3bd2a5[_0x4b56('0x56')],function(_0x34d532){var _0x53afd2={};_0x53afd2[_0x34d532]={'$like':'%'+_0x16fa4d[_0x4b56('0x52')][_0x4b56('0x5e')]+'%'};return _0x53afd2;})});}_0x3bd2a5=_[_0x4b56('0x68')]({},_0x3bd2a5,_0x16fa4d['options']);return _0x603f3[_0x4b56('0xca')](_0x3bd2a5);}})[_0x4b56('0x3f')](function(_0x12371b){if(_0x12371b){_0x22706f=_0x12371b['length'];if(!_0x16fa4d[_0x4b56('0x52')][_0x4b56('0x59')](_0x4b56('0x73'))){_0x3bd2a5[_0x4b56('0x37')]=qs[_0x4b56('0x37')](_0x16fa4d[_0x4b56('0x52')]['limit']);_0x3bd2a5['offset']=qs[_0x4b56('0x39')](_0x16fa4d['query']['offset']);}return _0x603f3[_0x4b56('0xca')](_0x3bd2a5);}})[_0x4b56('0x3f')](function(_0x4cd64f){if(_0x4cd64f){return _0x4cd64f?{'count':_0x22706f,'rows':_0x4cd64f}:null;}})['then'](respondWithResult(_0x3586d4,null))[_0x4b56('0x31')](handleError(_0x3586d4,null));}; \ No newline at end of file +var _0xa7b0=['attributes','fields','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','merge','find','body','describe','findOne','Disposition','length','nolimit','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','email','ListId','active','description','isNil','cauthentication','user','password','cpassword','authentication','host','port','service','pass','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','CmContact','Contact','User','Owner','internal','Tags','tag','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','out','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','key','model','map','keys','query','filters','intersection'];(function(_0x5aa4f4,_0x295c4f){var _0x404170=function(_0x178a5c){while(--_0x178a5c){_0x5aa4f4['push'](_0x5aa4f4['shift']());}};_0x404170(++_0x295c4f);}(_0xa7b0,0x68));var _0x0a7b=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xa7b0[_0x4ea413];return _0x51cf25;};'use strict';var emlformat=require(_0x0a7b('0x0'));var rimraf=require(_0x0a7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a7b('0x2'));var moment=require(_0x0a7b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a7b('0x4'));var util=require(_0x0a7b('0x5'));var path=require(_0x0a7b('0x6'));var sox=require(_0x0a7b('0x7'));var csv=require(_0x0a7b('0x8'));var ejs=require(_0x0a7b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a7b('0xa'));var squel=require('squel');var crypto=require(_0x0a7b('0xb'));var jsforce=require(_0x0a7b('0xc'));var deskjs=require(_0x0a7b('0xd'));var toCsv=require(_0x0a7b('0x8'));var querystring=require('querystring');var Papa=require(_0x0a7b('0xe'));var htmlToText=require(_0x0a7b('0xf'));var juice=require(_0x0a7b('0x10'));var Redis=require(_0x0a7b('0x11'));var authService=require(_0x0a7b('0x12'));var qs=require(_0x0a7b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a7b('0x14'))('api');var utils=require(_0x0a7b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0a7b('0x16'));var db=require(_0x0a7b('0x17'))['db'];config[_0x0a7b('0x18')]=_[_0x0a7b('0x19')](config['redis'],{'host':_0x0a7b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a7b('0x18')]));require(_0x0a7b('0x1b'))[_0x0a7b('0x1c')](socket);var jayson=require(_0x0a7b('0x1d'));var client=jayson[_0x0a7b('0x1e')][_0x0a7b('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x9fafef,_0xb240cf,_0x50aeb3,_0x50f98d){return new BPromise(function(_0x3fb95e,_0x345869){var _0x295b97=_0x50f98d||client;return _0x295b97[_0x0a7b('0x20')](_0x9fafef,_0x50aeb3)[_0x0a7b('0x21')](function(_0x4cbf21){logger[_0x0a7b('0x22')](_0x0a7b('0x23'),_0xb240cf,'request\x20sent');logger[_0x0a7b('0x24')](_0x0a7b('0x25'),_0xb240cf,_0x0a7b('0x26'),JSON[_0x0a7b('0x27')](_0x4cbf21));if(_0x4cbf21['error']){if(_0x4cbf21['error'][_0x0a7b('0x28')]===0x1f4){logger[_0x0a7b('0x29')](_0x0a7b('0x23'),_0xb240cf,_0x4cbf21[_0x0a7b('0x29')][_0x0a7b('0x2a')]);return _0x345869(_0x4cbf21['error'][_0x0a7b('0x2a')]);}logger[_0x0a7b('0x29')](_0x0a7b('0x23'),_0xb240cf,_0x4cbf21[_0x0a7b('0x29')]['message']);return _0x3fb95e(_0x4cbf21['error'][_0x0a7b('0x2a')]);}else{logger[_0x0a7b('0x22')]('MailAccount,\x20%s,\x20%s',_0xb240cf,'request\x20sent');_0x3fb95e(_0x4cbf21[_0x0a7b('0x2b')][_0x0a7b('0x2a')]);}})[_0x0a7b('0x2c')](function(_0x203377){logger[_0x0a7b('0x29')](_0x0a7b('0x23'),_0xb240cf,_0x203377);_0x345869(_0x203377);});});}function respondWithStatusCode(_0x1b8983,_0x375ebf){_0x375ebf=_0x375ebf||0xcc;return function(_0x2b0967){if(_0x2b0967){return _0x1b8983[_0x0a7b('0x2d')](_0x375ebf);}return _0x1b8983['status'](_0x375ebf)[_0x0a7b('0x2e')]();};}function respondWithResult(_0xe9f827,_0x379166){_0x379166=_0x379166||0xc8;return function(_0x13093a){if(_0x13093a){return _0xe9f827[_0x0a7b('0x2f')](_0x379166)['json'](_0x13093a);}};}function respondWithFilteredResult(_0x113a39,_0x5dc5e9){return function(_0x18639c){if(_0x18639c){var _0x59b6c8=typeof _0x5dc5e9[_0x0a7b('0x30')]===_0x0a7b('0x31')&&typeof _0x5dc5e9[_0x0a7b('0x32')]==='undefined';var _0x32b760=_0x18639c[_0x0a7b('0x33')];var _0x2b2894=_0x59b6c8?0x0:_0x5dc5e9[_0x0a7b('0x30')];var _0x2de6f4=_0x59b6c8?_0x18639c[_0x0a7b('0x33')]:_0x5dc5e9[_0x0a7b('0x30')]+_0x5dc5e9[_0x0a7b('0x32')];var _0x54dc47;if(_0x2de6f4>=_0x32b760){_0x2de6f4=_0x32b760;_0x54dc47=0xc8;}else{_0x54dc47=0xce;}_0x113a39['status'](_0x54dc47);return _0x113a39[_0x0a7b('0x34')](_0x0a7b('0x35'),_0x2b2894+'-'+_0x2de6f4+'/'+_0x32b760)[_0x0a7b('0x36')](_0x18639c);}return null;};}function patchUpdates(_0x4e8ba3){return function(_0x6eec80){try{jsonpatch[_0x0a7b('0x37')](_0x6eec80,_0x4e8ba3,!![]);}catch(_0x23ace1){return BPromise[_0x0a7b('0x38')](_0x23ace1);}return _0x6eec80[_0x0a7b('0x39')]();};}function saveUpdates(_0x1c0b8b,_0x3a5442){return function(_0x3a49ac){if(_0x3a49ac){return _0x3a49ac[_0x0a7b('0x3a')](_0x1c0b8b)[_0x0a7b('0x21')](function(_0x55e357){return _0x55e357;});}return null;};}function removeEntity(_0x24d644,_0x40819e){return function(_0x45f882){if(_0x45f882){return _0x45f882[_0x0a7b('0x3b')]()[_0x0a7b('0x21')](function(){var _0x47e366=_0x45f882['get']({'plain':!![]});var _0x186e3b=_0x0a7b('0x3c');return db[_0x0a7b('0x3d')][_0x0a7b('0x3b')]({'where':{'type':_0x186e3b,'resourceId':_0x47e366['id']}})['then'](function(){return _0x45f882;});})['then'](function(){_0x24d644['status'](0xcc)[_0x0a7b('0x2e')]();});}};}function handleEntityNotFound(_0x27a710,_0x5bd080){return function(_0x8f2cb7){if(!_0x8f2cb7){_0x27a710[_0x0a7b('0x2d')](0x194);}return _0x8f2cb7;};}function handleError(_0x121b12,_0x56bdf4){_0x56bdf4=_0x56bdf4||0x1f4;return function(_0x41bb84){logger[_0x0a7b('0x29')](_0x41bb84[_0x0a7b('0x3e')]);if(_0x41bb84[_0x0a7b('0x3f')]){delete _0x41bb84[_0x0a7b('0x3f')];}_0x121b12[_0x0a7b('0x2f')](_0x56bdf4)[_0x0a7b('0x40')](_0x41bb84);};}exports[_0x0a7b('0x41')]=function(_0x51ffde,_0x43793d){var _0x312ee6={'include':[{'model':db[_0x0a7b('0x42')],'as':_0x0a7b('0x43')},{'model':db[_0x0a7b('0x44')],'as':_0x0a7b('0x45')},{'model':db[_0x0a7b('0x46')],'as':_0x0a7b('0x47')}]},_0x29c200={},_0x3f9213={'count':0x0,'rows':[]};var _0x1c94f4=_['map'](db[_0x0a7b('0x48')][_0x0a7b('0x49')],function(_0x23f6ea){return{'name':_0x23f6ea['fieldName'],'type':_0x23f6ea['type'][_0x0a7b('0x4a')]};});_0x29c200[_0x0a7b('0x4b')]=_[_0x0a7b('0x4c')](_0x1c94f4,_0x0a7b('0x3f'));_0x29c200['query']=_[_0x0a7b('0x4d')](_0x51ffde[_0x0a7b('0x4e')]);_0x29c200[_0x0a7b('0x4f')]=_[_0x0a7b('0x50')](_0x29c200[_0x0a7b('0x4b')],_0x29c200[_0x0a7b('0x4e')]);_0x312ee6[_0x0a7b('0x51')]=_[_0x0a7b('0x50')](_0x29c200[_0x0a7b('0x4b')],qs['fields'](_0x51ffde[_0x0a7b('0x4e')][_0x0a7b('0x52')]));_0x312ee6[_0x0a7b('0x51')]=_0x312ee6[_0x0a7b('0x51')]['length']?_0x312ee6[_0x0a7b('0x51')]:_0x29c200['model'];if(!_0x51ffde[_0x0a7b('0x4e')][_0x0a7b('0x53')]('nolimit')){_0x312ee6['limit']=qs['limit'](_0x51ffde[_0x0a7b('0x4e')][_0x0a7b('0x32')]);_0x312ee6[_0x0a7b('0x30')]=qs[_0x0a7b('0x30')](_0x51ffde[_0x0a7b('0x4e')][_0x0a7b('0x30')]);}_0x312ee6[_0x0a7b('0x54')]=qs[_0x0a7b('0x55')](_0x51ffde[_0x0a7b('0x4e')][_0x0a7b('0x55')]);_0x312ee6[_0x0a7b('0x56')]=qs[_0x0a7b('0x4f')](_[_0x0a7b('0x57')](_0x51ffde[_0x0a7b('0x4e')],_0x29c200[_0x0a7b('0x4f')]),_0x1c94f4);if(_0x51ffde[_0x0a7b('0x4e')]['filter']){_0x312ee6[_0x0a7b('0x56')]=_['merge'](_0x312ee6[_0x0a7b('0x56')],{'$or':_[_0x0a7b('0x4c')](_0x1c94f4,function(_0x11f5c4){if(_0x11f5c4[_0x0a7b('0x58')]!==_0x0a7b('0x59')){var _0x2f32e7={};_0x2f32e7[_0x11f5c4[_0x0a7b('0x3f')]]={'$like':'%'+_0x51ffde[_0x0a7b('0x4e')][_0x0a7b('0x5a')]+'%'};return _0x2f32e7;}})});}_0x312ee6=_['merge']({},_0x312ee6,_0x51ffde[_0x0a7b('0x5b')]);var _0x28897a={'where':_0x312ee6[_0x0a7b('0x56')]};return db['MailAccount'][_0x0a7b('0x33')](_0x28897a)[_0x0a7b('0x21')](function(_0x380109){_0x3f9213[_0x0a7b('0x33')]=_0x380109;if(_0x51ffde['query'][_0x0a7b('0x5c')]){_0x312ee6[_0x0a7b('0x5d')]=[{'all':!![]}];}return db[_0x0a7b('0x48')][_0x0a7b('0x5e')](_0x312ee6);})[_0x0a7b('0x21')](function(_0x23482d){_0x3f9213[_0x0a7b('0x5f')]=_0x23482d;return _0x3f9213;})[_0x0a7b('0x21')](respondWithFilteredResult(_0x43793d,_0x312ee6))[_0x0a7b('0x2c')](handleError(_0x43793d,null));};exports['show']=function(_0x45af8f,_0x21d1c8){var _0x3453ba={'raw':![],'where':{'id':_0x45af8f[_0x0a7b('0x60')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x0a7b('0x43')},{'model':db[_0x0a7b('0x44')],'as':_0x0a7b('0x45')},{'model':db[_0x0a7b('0x46')],'as':'mandatoryDispositionPause'}]},_0x578216={};_0x578216['model']=_['keys'](db[_0x0a7b('0x48')][_0x0a7b('0x49')]);_0x578216[_0x0a7b('0x4e')]=_['keys'](_0x45af8f[_0x0a7b('0x4e')]);_0x578216['filters']=_['intersection'](_0x578216[_0x0a7b('0x4b')],_0x578216[_0x0a7b('0x4e')]);_0x3453ba[_0x0a7b('0x51')]=_[_0x0a7b('0x50')](_0x578216[_0x0a7b('0x4b')],qs[_0x0a7b('0x52')](_0x45af8f[_0x0a7b('0x4e')]['fields']));_0x3453ba[_0x0a7b('0x51')]=_0x3453ba['attributes']['length']?_0x3453ba[_0x0a7b('0x51')]:_0x578216[_0x0a7b('0x4b')];if(_0x45af8f[_0x0a7b('0x4e')]['includeAll']){_0x3453ba[_0x0a7b('0x5d')]=[{'all':!![]}];}_0x3453ba=_[_0x0a7b('0x61')]({},_0x3453ba,_0x45af8f[_0x0a7b('0x5b')]);return db[_0x0a7b('0x48')][_0x0a7b('0x62')](_0x3453ba)[_0x0a7b('0x21')](handleEntityNotFound(_0x21d1c8,null))[_0x0a7b('0x21')](respondWithResult(_0x21d1c8,null))[_0x0a7b('0x2c')](handleError(_0x21d1c8,null));};exports['update']=function(_0x2ba0cd,_0x150d21){if(_0x2ba0cd['body']['id']){delete _0x2ba0cd[_0x0a7b('0x63')]['id'];}return db[_0x0a7b('0x48')][_0x0a7b('0x62')]({'where':{'id':_0x2ba0cd[_0x0a7b('0x60')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x0a7b('0x43')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x0a7b('0x46')],'as':_0x0a7b('0x47')}]})[_0x0a7b('0x21')](handleEntityNotFound(_0x150d21,null))[_0x0a7b('0x21')](saveUpdates(_0x2ba0cd[_0x0a7b('0x63')],null))['then'](function(_0x35443e){if(_0x35443e&&_0x2ba0cd[_0x0a7b('0x63')][_0x0a7b('0x43')]){return db['MailServerIn'][_0x0a7b('0x3a')](_0x2ba0cd[_0x0a7b('0x63')][_0x0a7b('0x43')],{'where':{'MailAccountId':_0x35443e['id']}})[_0x0a7b('0x21')](function(){return _0x35443e;});}return _0x35443e;})[_0x0a7b('0x21')](function(_0x51993e){if(_0x51993e&&_0x2ba0cd[_0x0a7b('0x63')][_0x0a7b('0x45')]){return db[_0x0a7b('0x44')]['update'](_0x2ba0cd[_0x0a7b('0x63')]['Smtp'],{'where':{'MailAccountId':_0x51993e['id']}})[_0x0a7b('0x21')](function(){return _0x51993e;});}return _0x51993e;})['then'](respondWithResult(_0x150d21,null))[_0x0a7b('0x2c')](handleError(_0x150d21,null));};exports['describe']=function(_0x1753e3,_0x3b2d9d){return db['MailAccount'][_0x0a7b('0x64')]()[_0x0a7b('0x21')](respondWithResult(_0x3b2d9d,null))[_0x0a7b('0x2c')](handleError(_0x3b2d9d,null));};exports['addDisposition']=function(_0x41972c,_0x11e1dc,_0x591073){if(_0x41972c[_0x0a7b('0x63')]['id']){delete _0x41972c[_0x0a7b('0x63')]['id'];}return db[_0x0a7b('0x48')]['find']({'where':{'id':_0x41972c[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x11e1dc,null))[_0x0a7b('0x21')](function(_0x1769f9){if(_0x1769f9){_0x41972c[_0x0a7b('0x63')]['MailAccountId']=_0x1769f9['id'];return db['Disposition']['create'](_0x41972c[_0x0a7b('0x63')]);}})[_0x0a7b('0x21')](respondWithResult(_0x11e1dc,null))['catch'](handleError(_0x11e1dc,null));};exports['getDispositions']=function(_0x4faaee,_0x2a0b0d,_0x1e6da8){var _0x260f81={'raw':![],'where':{}};var _0x58a6a7={};var _0xae7718={'count':0x0,'rows':[]};return db[_0x0a7b('0x48')][_0x0a7b('0x65')]({'where':{'id':_0x4faaee['params']['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x2a0b0d,null))[_0x0a7b('0x21')](function(_0x4b4c2e){if(_0x4b4c2e){_0x58a6a7[_0x0a7b('0x4b')]=_[_0x0a7b('0x4d')](db[_0x0a7b('0x66')][_0x0a7b('0x49')]);_0x58a6a7[_0x0a7b('0x4e')]=_[_0x0a7b('0x4d')](_0x4faaee[_0x0a7b('0x4e')]);_0x58a6a7['filters']=_['intersection'](_0x58a6a7[_0x0a7b('0x4b')],_0x58a6a7[_0x0a7b('0x4e')]);_0x260f81[_0x0a7b('0x51')]=_[_0x0a7b('0x50')](_0x58a6a7['model'],qs[_0x0a7b('0x52')](_0x4faaee[_0x0a7b('0x4e')][_0x0a7b('0x52')]));_0x260f81['attributes']=_0x260f81[_0x0a7b('0x51')][_0x0a7b('0x67')]?_0x260f81['attributes']:_0x58a6a7[_0x0a7b('0x4b')];if(!_0x4faaee[_0x0a7b('0x4e')][_0x0a7b('0x53')](_0x0a7b('0x68'))){_0x260f81[_0x0a7b('0x32')]=qs[_0x0a7b('0x32')](_0x4faaee[_0x0a7b('0x4e')]['limit']);_0x260f81[_0x0a7b('0x30')]=qs[_0x0a7b('0x30')](_0x4faaee['query'][_0x0a7b('0x30')]);}_0x260f81[_0x0a7b('0x54')]=qs[_0x0a7b('0x55')](_0x4faaee[_0x0a7b('0x4e')][_0x0a7b('0x55')]);_0x260f81['where']=qs[_0x0a7b('0x4f')](_[_0x0a7b('0x57')](_0x4faaee[_0x0a7b('0x4e')],_0x58a6a7[_0x0a7b('0x4f')]));_0x260f81[_0x0a7b('0x56')][_0x0a7b('0x69')]=_0x4b4c2e['id'];if(_0x4faaee[_0x0a7b('0x4e')][_0x0a7b('0x5a')]){_0x260f81[_0x0a7b('0x56')]=_['merge'](_0x260f81[_0x0a7b('0x56')],{'$or':_[_0x0a7b('0x4c')](_0x260f81['attributes'],function(_0x2b1c92){var _0x3defb5={};_0x3defb5[_0x2b1c92]={'$like':'%'+_0x4faaee['query'][_0x0a7b('0x5a')]+'%'};return _0x3defb5;})});}_0x260f81=_['merge']({},_0x260f81,_0x4faaee[_0x0a7b('0x5b')]);return db[_0x0a7b('0x66')][_0x0a7b('0x33')]({'where':_0x260f81[_0x0a7b('0x56')]})[_0x0a7b('0x21')](function(_0x336c88){_0xae7718[_0x0a7b('0x33')]=_0x336c88;if(_0x4faaee['query']['includeAll']){_0x260f81[_0x0a7b('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0x0a7b('0x5e')](_0x260f81);})[_0x0a7b('0x21')](function(_0x1a0d4e){_0xae7718['rows']=_0x1a0d4e;return _0xae7718;});}})[_0x0a7b('0x21')](respondWithFilteredResult(_0x2a0b0d,_0x260f81))[_0x0a7b('0x2c')](handleError(_0x2a0b0d,null));};exports[_0x0a7b('0x6a')]=function(_0x30f572,_0x3cca41,_0x1ec7a1){return db['MailAccount'][_0x0a7b('0x62')]({'where':{'id':_0x30f572['params']['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x3cca41,null))[_0x0a7b('0x21')](function(_0xe60ada){if(_0xe60ada){return _0xe60ada[_0x0a7b('0x6a')](_0x30f572[_0x0a7b('0x4e')][_0x0a7b('0x6b')]);}})[_0x0a7b('0x21')](respondWithStatusCode(_0x3cca41,null))['catch'](handleError(_0x3cca41,null));};exports[_0x0a7b('0x6c')]=function(_0x3d8377,_0x4be8b9,_0x2a7b35){if(_0x3d8377[_0x0a7b('0x63')]['id']){delete _0x3d8377[_0x0a7b('0x63')]['id'];}return db[_0x0a7b('0x48')][_0x0a7b('0x62')]({'where':{'id':_0x3d8377['params']['id']}})['then'](handleEntityNotFound(_0x4be8b9,null))['then'](function(_0x231983){if(_0x231983){_0x3d8377[_0x0a7b('0x63')][_0x0a7b('0x69')]=_0x231983['id'];return db[_0x0a7b('0x6d')][_0x0a7b('0x6e')](_0x3d8377['body']);}})[_0x0a7b('0x21')](respondWithResult(_0x4be8b9,null))[_0x0a7b('0x2c')](handleError(_0x4be8b9,null));};exports[_0x0a7b('0x6f')]=function(_0x1fa4b5,_0x410228,_0x16d595){var _0x305434={'raw':![],'where':{}};var _0x24b277={};var _0x5e00c8={'count':0x0,'rows':[]};return db[_0x0a7b('0x48')][_0x0a7b('0x65')]({'where':{'id':_0x1fa4b5[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x410228,null))[_0x0a7b('0x21')](function(_0x3f26c2){if(_0x3f26c2){_0x24b277[_0x0a7b('0x4b')]=_[_0x0a7b('0x4d')](db['CannedAnswer'][_0x0a7b('0x49')]);_0x24b277[_0x0a7b('0x4e')]=_[_0x0a7b('0x4d')](_0x1fa4b5[_0x0a7b('0x4e')]);_0x24b277[_0x0a7b('0x4f')]=_['intersection'](_0x24b277[_0x0a7b('0x4b')],_0x24b277[_0x0a7b('0x4e')]);_0x305434['attributes']=_[_0x0a7b('0x50')](_0x24b277[_0x0a7b('0x4b')],qs[_0x0a7b('0x52')](_0x1fa4b5[_0x0a7b('0x4e')]['fields']));_0x305434['attributes']=_0x305434['attributes'][_0x0a7b('0x67')]?_0x305434[_0x0a7b('0x51')]:_0x24b277['model'];if(!_0x1fa4b5['query'][_0x0a7b('0x53')](_0x0a7b('0x68'))){_0x305434[_0x0a7b('0x32')]=qs[_0x0a7b('0x32')](_0x1fa4b5['query']['limit']);_0x305434[_0x0a7b('0x30')]=qs[_0x0a7b('0x30')](_0x1fa4b5[_0x0a7b('0x4e')][_0x0a7b('0x30')]);}_0x305434[_0x0a7b('0x54')]=qs[_0x0a7b('0x55')](_0x1fa4b5[_0x0a7b('0x4e')][_0x0a7b('0x55')]);_0x305434['where']=qs[_0x0a7b('0x4f')](_[_0x0a7b('0x57')](_0x1fa4b5[_0x0a7b('0x4e')],_0x24b277['filters']));_0x305434[_0x0a7b('0x56')]['MailAccountId']=_0x3f26c2['id'];if(_0x1fa4b5[_0x0a7b('0x4e')]['filter']){_0x305434[_0x0a7b('0x56')]=_['merge'](_0x305434[_0x0a7b('0x56')],{'$or':_[_0x0a7b('0x4c')](_0x305434[_0x0a7b('0x51')],function(_0x491297){var _0x1dcd43={};_0x1dcd43[_0x491297]={'$like':'%'+_0x1fa4b5[_0x0a7b('0x4e')][_0x0a7b('0x5a')]+'%'};return _0x1dcd43;})});}_0x305434=_['merge']({},_0x305434,_0x1fa4b5['options']);return db['CannedAnswer'][_0x0a7b('0x33')]({'where':_0x305434[_0x0a7b('0x56')]})['then'](function(_0x26c463){_0x5e00c8[_0x0a7b('0x33')]=_0x26c463;if(_0x1fa4b5[_0x0a7b('0x4e')][_0x0a7b('0x5c')]){_0x305434[_0x0a7b('0x5d')]=[{'all':!![]}];}return db[_0x0a7b('0x6d')][_0x0a7b('0x5e')](_0x305434);})['then'](function(_0x5a11fc){_0x5e00c8['rows']=_0x5a11fc;return _0x5e00c8;});}})['then'](respondWithFilteredResult(_0x410228,_0x305434))['catch'](handleError(_0x410228,null));};exports[_0x0a7b('0x70')]=function(_0x443413,_0x122ebe,_0x531299){return db[_0x0a7b('0x48')]['find']({'where':{'id':_0x443413[_0x0a7b('0x60')]['id']}})['then'](handleEntityNotFound(_0x122ebe,null))[_0x0a7b('0x21')](function(_0x14f04){if(_0x14f04){return _0x14f04[_0x0a7b('0x70')](_0x443413['query']['ids']);}})[_0x0a7b('0x21')](respondWithStatusCode(_0x122ebe,null))[_0x0a7b('0x2c')](handleError(_0x122ebe,null));};exports[_0x0a7b('0x6e')]=function(_0x1bea6e,_0x41f700){var _0x19bdc4={'name':_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x3f')],'key':_0x1bea6e['body'][_0x0a7b('0x4a')],'email':_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x71')],'ListId':_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x72')],'active':!_['isNil'](_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x73')])?_0x1bea6e['body']['active']:!![],'description':_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0x0a7b('0x75')](_0x1bea6e[_0x0a7b('0x63')]['cservice'])){if(_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x76')]){_0x19bdc4[_0x0a7b('0x43')][_0x0a7b('0x77')]=_0x19bdc4[_0x0a7b('0x45')][_0x0a7b('0x77')]=_0x1bea6e[_0x0a7b('0x63')]['cuser'];_0x19bdc4[_0x0a7b('0x43')][_0x0a7b('0x78')]=_0x19bdc4['Smtp']['pass']=_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x79')];}else{_0x19bdc4['Imap'][_0x0a7b('0x7a')]=_0x19bdc4[_0x0a7b('0x45')][_0x0a7b('0x7a')]=![];}_0x19bdc4[_0x0a7b('0x43')][_0x0a7b('0x7b')]=_0x1bea6e['body']['Imap'][_0x0a7b('0x7b')];_0x19bdc4['Imap']['port']=_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x43')][_0x0a7b('0x7c')];_0x19bdc4['Smtp']['host']=_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x45')][_0x0a7b('0x7b')];_0x19bdc4[_0x0a7b('0x45')][_0x0a7b('0x7c')]=_0x1bea6e[_0x0a7b('0x63')][_0x0a7b('0x45')][_0x0a7b('0x7c')];}else{_0x19bdc4['Imap'][_0x0a7b('0x7d')]=_0x19bdc4[_0x0a7b('0x45')][_0x0a7b('0x7d')]=_0x1bea6e[_0x0a7b('0x63')]['cservice'];_0x19bdc4[_0x0a7b('0x43')][_0x0a7b('0x77')]=_0x19bdc4[_0x0a7b('0x45')][_0x0a7b('0x77')]=_0x1bea6e[_0x0a7b('0x63')]['cuser'];_0x19bdc4[_0x0a7b('0x43')][_0x0a7b('0x78')]=_0x19bdc4['Smtp'][_0x0a7b('0x7e')]=_0x1bea6e['body'][_0x0a7b('0x79')];}return db[_0x0a7b('0x48')][_0x0a7b('0x6e')](_0x19bdc4,{'include':[{'model':db['MailServerOut'],'as':_0x0a7b('0x45')},{'model':db[_0x0a7b('0x42')],'as':'Imap'}]})['then'](function(_0x27a43d){var _0x7b7687=_0x1bea6e[_0x0a7b('0x77')]['get']({'plain':!![]});if(!_0x7b7687)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7b7687[_0x0a7b('0x7f')]==='user'){var _0x54365=_0x27a43d[_0x0a7b('0x80')]({'plain':!![]});return db[_0x0a7b('0x81')][_0x0a7b('0x62')]({'where':{'name':_0x0a7b('0x3c'),'userProfileId':_0x7b7687['userProfileId']},'raw':!![]})[_0x0a7b('0x21')](function(_0x3733bf){if(_0x3733bf&&_0x3733bf['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a7b('0x6e')]({'name':_0x54365['name'],'resourceId':_0x54365['id'],'type':_0x3733bf[_0x0a7b('0x3f')],'sectionId':_0x3733bf['id']},{})[_0x0a7b('0x21')](function(){return _0x27a43d;});}else{return _0x27a43d;}})[_0x0a7b('0x2c')](function(_0x3808dc){logger[_0x0a7b('0x29')](_0x0a7b('0x82'),_0x3808dc);throw _0x3808dc;});}return _0x27a43d;})[_0x0a7b('0x21')](respondWithResult(_0x41f700,0xc9))[_0x0a7b('0x2c')](handleError(_0x41f700,null));};exports[_0x0a7b('0x83')]=function(_0x3b6ab2,_0x3a1baf,_0x9257e1){return db[_0x0a7b('0x48')]['findOne']({'where':{'id':_0x3b6ab2[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x3a1baf,null))['then'](function(_0x5cde4c){if(_0x5cde4c){return _0x5cde4c[_0x0a7b('0x83')]();}return null;})['then'](respondWithResult(_0x3a1baf,null))['catch'](handleError(_0x3a1baf,null));};exports[_0x0a7b('0x84')]=function(_0x3209b9,_0x50bc89,_0x5b69e3){if(_0x3209b9[_0x0a7b('0x63')]['id']){delete _0x3209b9['body']['id'];}return db[_0x0a7b('0x48')][_0x0a7b('0x62')]({'where':{'id':_0x3209b9[_0x0a7b('0x60')]['id']}})['then'](handleEntityNotFound(_0x50bc89,null))[_0x0a7b('0x21')](function(_0x4b2966){if(_0x4b2966){_0x3209b9[_0x0a7b('0x63')][_0x0a7b('0x69')]=_0x4b2966['id'];return db[_0x0a7b('0x42')]['create'](_0x3209b9['body']);}})['then'](respondWithResult(_0x50bc89,null))[_0x0a7b('0x2c')](handleError(_0x50bc89,null));};exports['removeImap']=function(_0x3defc4,_0xa898f0,_0x6a425a){return db[_0x0a7b('0x48')][_0x0a7b('0x65')]({'where':{'id':_0x3defc4[_0x0a7b('0x60')]['id']}})['then'](handleEntityNotFound(_0xa898f0,null))[_0x0a7b('0x21')](function(_0x11791a){if(_0x11791a){return _0x11791a['setImap'](null);}return null;})[_0x0a7b('0x21')](respondWithStatusCode(_0xa898f0,null))[_0x0a7b('0x2c')](handleError(_0xa898f0,null));};exports[_0x0a7b('0x85')]=function(_0x53facb,_0xe0bee6,_0x3a7b16){return db[_0x0a7b('0x48')][_0x0a7b('0x65')]({'where':{'id':_0x53facb[_0x0a7b('0x60')]['id']}})['then'](handleEntityNotFound(_0xe0bee6,null))[_0x0a7b('0x21')](function(_0x46dc9b){if(_0x46dc9b){return _0x46dc9b[_0x0a7b('0x85')]();}return null;})['then'](respondWithResult(_0xe0bee6,null))['catch'](handleError(_0xe0bee6,null));};exports[_0x0a7b('0x86')]=function(_0x119d8d,_0x236e91,_0xde0db8){if(_0x119d8d[_0x0a7b('0x63')]['id']){delete _0x119d8d[_0x0a7b('0x63')]['id'];}return db[_0x0a7b('0x48')]['find']({'where':{'id':_0x119d8d[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x236e91,null))[_0x0a7b('0x21')](function(_0x4dad98){if(_0x4dad98){_0x119d8d['body']['MailAccountId']=_0x4dad98['id'];return db[_0x0a7b('0x44')][_0x0a7b('0x6e')](_0x119d8d[_0x0a7b('0x63')]);}})['then'](respondWithResult(_0x236e91,null))['catch'](handleError(_0x236e91,null));};exports['removeSmtp']=function(_0x1af823,_0x5bc5bb,_0x27fd05){return db['MailAccount']['findOne']({'where':{'id':_0x1af823['params']['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x5bc5bb,null))[_0x0a7b('0x21')](function(_0x240f78){if(_0x240f78){return _0x240f78[_0x0a7b('0x87')](null);}return null;})[_0x0a7b('0x21')](respondWithStatusCode(_0x5bc5bb,null))['catch'](handleError(_0x5bc5bb,null));};exports[_0x0a7b('0x88')]=function(_0x330561,_0x41a757,_0x30b49b){return db['MailInteraction'][_0x0a7b('0x62')]({'where':{'id':_0x330561[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x41a757,null))[_0x0a7b('0x21')](function(_0x27dc50){if(_0x27dc50){return _0x27dc50[_0x0a7b('0x88')](_0x330561[_0x0a7b('0x63')][_0x0a7b('0x6b')],_['omit'](_0x330561[_0x0a7b('0x63')],[_0x0a7b('0x6b'),'id'])||{});}})[_0x0a7b('0x21')](respondWithResult(_0x41a757,null))[_0x0a7b('0x2c')](handleError(_0x41a757,null));};exports['getInteractions']=function(_0x453e4d,_0x880daf,_0x6bc299){var _0x5b2648={'raw':![],'where':{}};var _0x2374ec={};var _0xefa9dc={'count':0x0,'rows':[]};return db[_0x0a7b('0x48')]['findOne']({'where':{'id':_0x453e4d[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x880daf,null))[_0x0a7b('0x21')](function(_0x110ed2){if(_0x110ed2){_0x2374ec[_0x0a7b('0x4b')]=_[_0x0a7b('0x4d')](db['MailInteraction'][_0x0a7b('0x49')]);_0x2374ec[_0x0a7b('0x4e')]=_[_0x0a7b('0x4d')](_0x453e4d['query']);_0x2374ec[_0x0a7b('0x4f')]=_[_0x0a7b('0x50')](_0x2374ec[_0x0a7b('0x4b')],_0x2374ec['query']);_0x5b2648['attributes']=_[_0x0a7b('0x50')](_0x2374ec[_0x0a7b('0x4b')],qs[_0x0a7b('0x52')](_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x52')]));_0x5b2648[_0x0a7b('0x51')]=_0x5b2648[_0x0a7b('0x51')][_0x0a7b('0x67')]?_0x5b2648[_0x0a7b('0x51')]:_0x2374ec['model'];if(!_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x53')](_0x0a7b('0x68'))){_0x5b2648[_0x0a7b('0x32')]=qs[_0x0a7b('0x32')](_0x453e4d['query']['limit']);_0x5b2648[_0x0a7b('0x30')]=qs[_0x0a7b('0x30')](_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x30')]);}_0x5b2648[_0x0a7b('0x54')]=qs[_0x0a7b('0x55')](_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x55')]);_0x5b2648[_0x0a7b('0x56')]=qs[_0x0a7b('0x4f')](_[_0x0a7b('0x57')](_0x453e4d[_0x0a7b('0x4e')],_0x2374ec[_0x0a7b('0x4f')]));_0x5b2648['where']['MailAccountId']=_0x110ed2['id'];if(_0x453e4d[_0x0a7b('0x4e')]['filter']){_0x5b2648['where']=_[_0x0a7b('0x61')](_0x5b2648['where'],{'$or':_[_0x0a7b('0x4c')](_0x5b2648[_0x0a7b('0x51')],function(_0x2fa02c){var _0x249228={};_0x249228[_0x2fa02c]={'$like':'%'+_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x5a')]+'%'};return _0x249228;})});}_0x5b2648=_[_0x0a7b('0x61')]({},_0x5b2648,_0x453e4d[_0x0a7b('0x5b')]);return db[_0x0a7b('0x89')][_0x0a7b('0x33')]({'where':_0x5b2648[_0x0a7b('0x56')]})[_0x0a7b('0x21')](function(_0x23b18){_0xefa9dc[_0x0a7b('0x33')]=_0x23b18;if(_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x5c')]){_0x5b2648[_0x0a7b('0x5d')]=[{'model':db[_0x0a7b('0x8a')],'as':_0x0a7b('0x8b'),'required':![]},{'model':db[_0x0a7b('0x8c')],'as':_0x0a7b('0x8d'),'attributes':[_0x0a7b('0x3f'),'fullname',_0x0a7b('0x8e')],'required':![]},{'model':db['Tag'],'as':_0x0a7b('0x8f'),'attributes':['id','name','color'],'where':_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x90')]?{'id':_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x90')]}:undefined,'required':_0x453e4d[_0x0a7b('0x4e')][_0x0a7b('0x90')]?!![]:![]}];}return db[_0x0a7b('0x89')][_0x0a7b('0x5e')](_0x5b2648);})[_0x0a7b('0x21')](function(_0x39134e){_0xefa9dc[_0x0a7b('0x5f')]=_0x39134e;return _0xefa9dc;});}})[_0x0a7b('0x21')](respondWithFilteredResult(_0x880daf,_0x5b2648))[_0x0a7b('0x2c')](handleError(_0x880daf,null));};exports['addApplications']=function(_0x2eec5e,_0x4c9ac7,_0x158746){return db[_0x0a7b('0x48')][_0x0a7b('0x65')]({'where':{'id':_0x2eec5e[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x4c9ac7,null))[_0x0a7b('0x21')](function(_0x5f4e85){if(_0x5f4e85){return db['sequelize'][_0x0a7b('0x91')](function(_0x452482){return db[_0x0a7b('0x92')][_0x0a7b('0x3b')]({'where':{'MailAccountId':_0x2eec5e[_0x0a7b('0x60')]['id']},'transaction':_0x452482})[_0x0a7b('0x21')](function(_0x22284f){var _0x3660e4=_[_0x0a7b('0x4c')](_0x2eec5e[_0x0a7b('0x63')],function(_0x12f8e0){_0x12f8e0[_0x0a7b('0x69')]=_0x2eec5e['params']['id'];return _0x12f8e0;});return db[_0x0a7b('0x92')][_0x0a7b('0x93')](_0x3660e4,{'transaction':_0x452482});});})[_0x0a7b('0x21')](function(){return db[_0x0a7b('0x92')]['findAndCountAll']({'where':{'MailAccountId':_0x2eec5e['params']['id']},'order':_0x0a7b('0x94')});});}})[_0x0a7b('0x21')](respondWithResult(_0x4c9ac7,null))['catch'](handleError(_0x4c9ac7,null));};exports['getApplications']=function(_0x32a63a,_0x3f36e7,_0x41664f){var _0x57e086={};var _0x4f6a7f={};var _0x587359;var _0x1ae265;return db[_0x0a7b('0x48')][_0x0a7b('0x65')]({'where':{'id':_0x32a63a[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x3f36e7,null))[_0x0a7b('0x21')](function(_0x20bb9f){if(_0x20bb9f){_0x587359=_0x20bb9f;_0x4f6a7f['model']=_[_0x0a7b('0x4d')](db[_0x0a7b('0x92')][_0x0a7b('0x49')]);_0x4f6a7f[_0x0a7b('0x4e')]=_['keys'](_0x32a63a[_0x0a7b('0x4e')]);_0x4f6a7f[_0x0a7b('0x4f')]=_[_0x0a7b('0x50')](_0x4f6a7f[_0x0a7b('0x4b')],_0x4f6a7f[_0x0a7b('0x4e')]);_0x57e086['attributes']=_[_0x0a7b('0x50')](_0x4f6a7f[_0x0a7b('0x4b')],qs[_0x0a7b('0x52')](_0x32a63a[_0x0a7b('0x4e')]['fields']));_0x57e086[_0x0a7b('0x51')]=_0x57e086[_0x0a7b('0x51')][_0x0a7b('0x67')]?_0x57e086[_0x0a7b('0x51')]:_0x4f6a7f[_0x0a7b('0x4b')];_0x57e086['order']=qs[_0x0a7b('0x55')](_0x32a63a[_0x0a7b('0x4e')][_0x0a7b('0x55')]);_0x57e086[_0x0a7b('0x56')]=qs['filters'](_[_0x0a7b('0x57')](_0x32a63a[_0x0a7b('0x4e')],_0x4f6a7f['filters']));if(_0x32a63a[_0x0a7b('0x4e')][_0x0a7b('0x5a')]){_0x57e086['where']=_[_0x0a7b('0x61')](_0x57e086[_0x0a7b('0x56')],{'$or':_[_0x0a7b('0x4c')](_0x57e086[_0x0a7b('0x51')],function(_0x30c0a3){var _0x3efa6b={};_0x3efa6b[_0x30c0a3]={'$like':'%'+_0x32a63a[_0x0a7b('0x4e')][_0x0a7b('0x5a')]+'%'};return _0x3efa6b;})});}_0x57e086=_[_0x0a7b('0x61')]({},_0x57e086,_0x32a63a[_0x0a7b('0x5b')]);return _0x587359[_0x0a7b('0x95')](_0x57e086);}})['then'](function(_0x26ddcd){if(_0x26ddcd){_0x1ae265=_0x26ddcd[_0x0a7b('0x67')];if(!_0x32a63a['query'][_0x0a7b('0x53')]('nolimit')){_0x57e086['limit']=qs[_0x0a7b('0x32')](_0x32a63a['query'][_0x0a7b('0x32')]);_0x57e086['offset']=qs[_0x0a7b('0x30')](_0x32a63a[_0x0a7b('0x4e')][_0x0a7b('0x30')]);}return _0x587359[_0x0a7b('0x95')](_0x57e086);}})[_0x0a7b('0x21')](function(_0x392eac){if(_0x392eac){return _0x392eac?{'count':_0x1ae265,'rows':_0x392eac}:null;}})[_0x0a7b('0x21')](respondWithResult(_0x3f36e7,null))[_0x0a7b('0x2c')](handleError(_0x3f36e7,null));};exports[_0x0a7b('0x96')]=function(_0x37d1a2,_0x3cb38f,_0x2fa706){var _0x1a2218={'raw':!![],'where':{}};var _0x3bf07a={};var _0x5a7e07={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x37d1a2['params']['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x3cb38f,null))[_0x0a7b('0x21')](function(_0x4f9f75){if(_0x4f9f75){_0x3bf07a[_0x0a7b('0x4b')]=_['keys'](db['MailMessage']['rawAttributes']);_0x3bf07a[_0x0a7b('0x4e')]=_['keys'](_0x37d1a2[_0x0a7b('0x4e')]);_0x3bf07a[_0x0a7b('0x4f')]=_[_0x0a7b('0x50')](_0x3bf07a[_0x0a7b('0x4b')],_0x3bf07a[_0x0a7b('0x4e')]);_0x1a2218[_0x0a7b('0x51')]=_[_0x0a7b('0x50')](_0x3bf07a[_0x0a7b('0x4b')],qs[_0x0a7b('0x52')](_0x37d1a2[_0x0a7b('0x4e')][_0x0a7b('0x52')]));_0x1a2218[_0x0a7b('0x51')]=_0x1a2218[_0x0a7b('0x51')][_0x0a7b('0x67')]?_0x1a2218[_0x0a7b('0x51')]:_0x3bf07a['model'];if(!_0x37d1a2['query'][_0x0a7b('0x53')](_0x0a7b('0x68'))){_0x1a2218[_0x0a7b('0x32')]=qs[_0x0a7b('0x32')](_0x37d1a2['query'][_0x0a7b('0x32')]);_0x1a2218[_0x0a7b('0x30')]=qs['offset'](_0x37d1a2[_0x0a7b('0x4e')][_0x0a7b('0x30')]);}_0x1a2218['order']=qs['sort'](_0x37d1a2[_0x0a7b('0x4e')][_0x0a7b('0x55')]);_0x1a2218[_0x0a7b('0x56')]=qs[_0x0a7b('0x4f')](_[_0x0a7b('0x57')](_0x37d1a2['query'],_0x3bf07a['filters']));_0x1a2218[_0x0a7b('0x56')]['MailAccountId']=_0x4f9f75['id'];if(_0x37d1a2[_0x0a7b('0x4e')][_0x0a7b('0x5a')]){_0x1a2218[_0x0a7b('0x56')]=_[_0x0a7b('0x61')](_0x1a2218[_0x0a7b('0x56')],{'$or':_['map'](_0x1a2218['attributes'],function(_0x26c2af){var _0x34d906={};_0x34d906[_0x26c2af]={'$like':'%'+_0x37d1a2['query'][_0x0a7b('0x5a')]+'%'};return _0x34d906;})});}if(_0x37d1a2['query']['$gte']){var _0x5280d0=_0x37d1a2[_0x0a7b('0x4e')][_0x0a7b('0x97')]['split'](',');var _0x43e8fd={};_0x43e8fd[_0x5280d0[0x0]]={'$gte':moment(_0x5280d0[0x1])[_0x0a7b('0x98')](_0x0a7b('0x99'))};_0x1a2218[_0x0a7b('0x56')]=_[_0x0a7b('0x61')](_0x1a2218[_0x0a7b('0x56')],_0x43e8fd);}_0x1a2218=_[_0x0a7b('0x61')]({},_0x1a2218,_0x37d1a2[_0x0a7b('0x5b')]);return db[_0x0a7b('0x9a')][_0x0a7b('0x33')]({'where':_0x1a2218[_0x0a7b('0x56')]})['then'](function(_0x53ef0f){_0x5a7e07[_0x0a7b('0x33')]=_0x53ef0f;if(_0x37d1a2[_0x0a7b('0x4e')][_0x0a7b('0x5c')]){_0x1a2218[_0x0a7b('0x5d')]=[{'all':!![]}];}return db['MailMessage'][_0x0a7b('0x5e')](_0x1a2218);})[_0x0a7b('0x21')](function(_0x4b9904){if(_0x37d1a2[_0x0a7b('0x4e')][_0x0a7b('0x9b')]==='true'){for(var _0x3bdea7=0x0;_0x3bdea7<_0x4b9904[_0x0a7b('0x67')];_0x3bdea7++){_0x4b9904[_0x3bdea7][_0x0a7b('0x63')]=juice(_0x4b9904[_0x3bdea7][_0x0a7b('0x63')]);}}_0x5a7e07[_0x0a7b('0x5f')]=_0x4b9904;return _0x5a7e07;});}})[_0x0a7b('0x21')](respondWithFilteredResult(_0x3cb38f,_0x1a2218))[_0x0a7b('0x2c')](handleError(_0x3cb38f,null));};exports[_0x0a7b('0x40')]=function(_0x139776,_0x1d5ef0,_0x43dd7c){var _0x264607,_0x653a21={},_0x30a3c4;if(_0x139776[_0x0a7b('0x63')]['to']){_0x30a3c4=_0x139776[_0x0a7b('0x63')]['to']['split'](',')[0x0];}return db[_0x0a7b('0x48')][_0x0a7b('0x62')]({'where':{'id':_0x139776['params']['id']},'include':[{'model':db[_0x0a7b('0x9c')],'as':_0x0a7b('0x9d'),'include':[{'model':db[_0x0a7b('0x8a')],'as':'Contacts','where':{'email':_0x30a3c4},'limit':0x1,'order':[[_0x0a7b('0x9e'),_0x0a7b('0x9f')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x0a7b('0x21')](handleEntityNotFound(_0x1d5ef0,null))[_0x0a7b('0x21')](function(_0x51214a){if(_0x51214a){_0x264607=_0x51214a;if(_0x51214a[_0x0a7b('0x45')]){if(_[_0x0a7b('0x75')](_0x139776[_0x0a7b('0x63')][_0x0a7b('0xa0')])){_0x139776[_0x0a7b('0x63')][_0x0a7b('0xa0')]=util[_0x0a7b('0x98')](_0x0a7b('0xa1'),_0x51214a[_0x0a7b('0x3f')],_0x51214a[_0x0a7b('0x71')]||_0x51214a[_0x0a7b('0x45')]['user']);}if(_0x139776[_0x0a7b('0x63')]['attachments']&&_0x139776[_0x0a7b('0x63')][_0x0a7b('0xa2')]['length']){for(var _0x494a05=0x0;_0x494a05<_0x139776['body'][_0x0a7b('0xa2')]['length'];_0x494a05+=0x1){_0x139776[_0x0a7b('0x63')][_0x0a7b('0xa2')][_0x494a05]={'filename':_0x139776[_0x0a7b('0x63')]['attachments'][_0x494a05]['name'],'path':path[_0x0a7b('0xa3')](config[_0x0a7b('0xa4')],_0x0a7b('0xa5'),_0x139776[_0x0a7b('0x63')][_0x0a7b('0xa2')][_0x494a05][_0x0a7b('0xa6')])};}}var _0x55441f={'tls':{'rejectUnauthorized':![]}};if(_[_0x0a7b('0x75')](_0x51214a[_0x0a7b('0x45')][_0x0a7b('0x7d')])){if(_0x51214a['Smtp'][_0x0a7b('0x7a')]){_0x55441f['auth']={'user':_0x51214a[_0x0a7b('0x45')][_0x0a7b('0x77')],'pass':_0x51214a[_0x0a7b('0x45')]['pass']};}_0x55441f[_0x0a7b('0x7b')]=_0x51214a[_0x0a7b('0x45')][_0x0a7b('0x7b')];_0x55441f[_0x0a7b('0x7c')]=_0x51214a[_0x0a7b('0x45')]['port'];_0x55441f[_0x0a7b('0xa7')]=_0x51214a[_0x0a7b('0x45')][_0x0a7b('0xa7')];}else{_0x55441f[_0x0a7b('0x7d')]=_0x51214a['Smtp'][_0x0a7b('0x7d')];_0x55441f[_0x0a7b('0xa8')]={'user':_0x51214a[_0x0a7b('0x45')][_0x0a7b('0x77')],'pass':_0x51214a[_0x0a7b('0x45')][_0x0a7b('0x7e')]};}return respondWithRpcPromise(_0x0a7b('0xa9'),_0x0a7b('0xaa'),{'account':_0x55441f,'message':_0x139776[_0x0a7b('0x63')]});}else{throw new Error(_0x0a7b('0xab'));}}})[_0x0a7b('0x21')](function(_0x536d6f){if(_0x536d6f){_0x653a21=_0x536d6f;if(_0x264607['List']){if(_0x264607['List']['Contacts'][_0x0a7b('0x67')]){return _0x264607[_0x0a7b('0x9d')][_0x0a7b('0xac')][0x0];}else{return db[_0x0a7b('0x8a')][_0x0a7b('0x6e')](_[_0x0a7b('0x19')](_0x139776['body'],{'firstName':_0x139776[_0x0a7b('0x63')]['to'],'email':_0x139776[_0x0a7b('0x63')]['to'],'phone':_0x139776[_0x0a7b('0x63')]['to'],'ListId':_0x264607[_0x0a7b('0x72')]}));}}else{throw new Error(_0x0a7b('0xab'));}}})[_0x0a7b('0x21')](function(_0x65405b){if(_0x65405b){var _0x1d0343={'UserId':_0x139776['user']['id'],'ContactId':_0x65405b['id'],'MailAccountId':_0x264607['id'],'inReplyTo':_0x653a21[_0x0a7b('0xad')],'to':_0x139776[_0x0a7b('0x63')][_0x0a7b('0xa0')],'cc':_0x139776['body']['cc'],'subject':_0x139776[_0x0a7b('0x63')]['subject'],'attach':_0x139776[_0x0a7b('0x63')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x0a7b('0x98')](_0x0a7b('0x99')),'lastMsgDirection':_0x0a7b('0xae'),'Messages':[_[_0x0a7b('0x61')](_0x139776[_0x0a7b('0x63')],{'messageId':_0x653a21[_0x0a7b('0xad')],'sentAt':moment()[_0x0a7b('0x98')](_0x0a7b('0x99')),'read':!![],'MailAccountId':_0x264607['id'],'UserId':_0x139776[_0x0a7b('0x77')]['id'],'ContactId':_0x65405b['id']})]};if(_0x139776[_0x0a7b('0x63')][_0x0a7b('0xaf')]){_0x1d0343=_['merge'](_0x1d0343,_0x139776[_0x0a7b('0x63')][_0x0a7b('0xaf')]);}return db['MailInteraction'][_0x0a7b('0x6e')](_0x1d0343,{'include':[{'model':db[_0x0a7b('0x9a')],'as':_0x0a7b('0xb0')}]});}})[_0x0a7b('0x21')](respondWithResult(_0x1d5ef0,null))[_0x0a7b('0x2c')](handleError(_0x1d5ef0,null));};exports[_0x0a7b('0xb1')]=function(_0x3cc08d,_0x482d64,_0x1b86de){return db['MailAccount']['find']({'where':{'id':_0x3cc08d[_0x0a7b('0x60')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x482d64,null))[_0x0a7b('0x21')](function(_0x35f5e7){if(_0x35f5e7&&_0x35f5e7['Smtp']){var _0x54e247={'id':_0x35f5e7['id'],'tls':{'rejectUnauthorized':![]}};if(_0x35f5e7['Smtp'][_0x0a7b('0x7d')]){_0x54e247[_0x0a7b('0x7d')]=_0x35f5e7[_0x0a7b('0x45')][_0x0a7b('0x7d')];}else{_0x54e247[_0x0a7b('0x7b')]=_0x35f5e7['Smtp'][_0x0a7b('0x7b')];_0x54e247[_0x0a7b('0x7c')]=_0x35f5e7['Smtp'][_0x0a7b('0x7c')];_0x54e247['secure']=_0x35f5e7[_0x0a7b('0x45')][_0x0a7b('0xa7')];}if(_0x35f5e7[_0x0a7b('0x45')][_0x0a7b('0x7a')]){_0x54e247['auth']={'user':_0x35f5e7[_0x0a7b('0x45')][_0x0a7b('0x77')],'pass':_0x35f5e7['Smtp']['pass']};}return respondWithRpcPromise(_0x0a7b('0xb2'),_0x0a7b('0xb1'),{'account':_0x54e247});}})[_0x0a7b('0x21')](respondWithResult(_0x482d64,null))[_0x0a7b('0x2c')](handleError(_0x482d64,null));};exports[_0x0a7b('0x3b')]=function(_0x3e2655,_0xc111f6){return db[_0x0a7b('0x48')][_0x0a7b('0x62')]({'where':{'id':_0x3e2655[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0xc111f6,null))[_0x0a7b('0x21')](function(_0x54f342){if(_0x54f342&&_0x54f342['service']){throw new db['Sequelize']['ValidationError'](_0x0a7b('0xb3'));}return _0x54f342;})['then'](removeEntity(_0xc111f6,null))[_0x0a7b('0x2c')](handleError(_0xc111f6,null));};exports[_0x0a7b('0xb4')]=function(_0x419d3f,_0x51fe16,_0x357b90){return db[_0x0a7b('0x48')]['find']({'where':{'id':_0x419d3f[_0x0a7b('0x60')]['id']}})['then'](handleEntityNotFound(_0x51fe16,null))[_0x0a7b('0x21')](function(_0x1e0260){if(_0x1e0260){return _0x1e0260[_0x0a7b('0xb4')](_0x419d3f[_0x0a7b('0x63')]['ids'],_['omit'](_0x419d3f[_0x0a7b('0x63')],[_0x0a7b('0x6b'),'id'])||{})['spread'](function(_0x4f2fc4){for(var _0x48b28a=0x0;_0x48b28a<_0x419d3f[_0x0a7b('0x63')][_0x0a7b('0x6b')][_0x0a7b('0x67')];_0x48b28a+=0x1){socket[_0x0a7b('0xb5')](_0x0a7b('0xb6'),{'UserId':Number(_0x419d3f['body']['ids'][_0x48b28a]),'MailAccountId':Number(_0x419d3f[_0x0a7b('0x60')]['id'])});}return _0x4f2fc4;});}})[_0x0a7b('0x21')](respondWithResult(_0x51fe16,null))[_0x0a7b('0x2c')](handleError(_0x51fe16,null));};exports['removeAgents']=function(_0xb5a117,_0x34fbe7,_0x4cc978){return db['MailAccount'][_0x0a7b('0x62')]({'where':{'id':_0xb5a117[_0x0a7b('0x60')]['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x34fbe7,null))[_0x0a7b('0x21')](function(_0x2899e6){if(_0x2899e6){return _0x2899e6[_0x0a7b('0xb7')](_0xb5a117['query']['ids'])[_0x0a7b('0x21')](function(){if(_['isArray'](_0xb5a117[_0x0a7b('0x4e')][_0x0a7b('0x6b')])){for(var _0x5cfca0=0x0;_0x5cfca0<_0xb5a117[_0x0a7b('0x4e')]['ids'][_0x0a7b('0x67')];_0x5cfca0+=0x1){socket[_0x0a7b('0xb5')]('userMailAccount:remove',{'UserId':Number(_0xb5a117[_0x0a7b('0x4e')][_0x0a7b('0x6b')][_0x5cfca0]),'MailAccountId':Number(_0xb5a117['params']['id'])});}}else{socket[_0x0a7b('0xb5')]('userMailAccount:remove',{'UserId':Number(_0xb5a117[_0x0a7b('0x4e')][_0x0a7b('0x6b')]),'MailAccountId':Number(_0xb5a117[_0x0a7b('0x60')]['id'])});}});}})[_0x0a7b('0x21')](respondWithStatusCode(_0x34fbe7,null))[_0x0a7b('0x2c')](handleError(_0x34fbe7,null));};exports['getAgents']=function(_0x42ae4b,_0x1c8456,_0x3553f9){var _0x4780a0={};var _0x3caa8d={};var _0x28add7;var _0x4a8dff;return db['MailAccount'][_0x0a7b('0x65')]({'where':{'id':_0x42ae4b['params']['id']}})[_0x0a7b('0x21')](handleEntityNotFound(_0x1c8456,null))[_0x0a7b('0x21')](function(_0x45c6bd){if(_0x45c6bd){_0x28add7=_0x45c6bd;_0x3caa8d[_0x0a7b('0x4b')]=_[_0x0a7b('0x4d')](db[_0x0a7b('0x8c')][_0x0a7b('0x49')]);_0x3caa8d[_0x0a7b('0x4e')]=_['keys'](_0x42ae4b[_0x0a7b('0x4e')]);_0x3caa8d[_0x0a7b('0x4f')]=_[_0x0a7b('0x50')](_0x3caa8d[_0x0a7b('0x4b')],_0x3caa8d[_0x0a7b('0x4e')]);_0x4780a0[_0x0a7b('0x51')]=_[_0x0a7b('0x50')](_0x3caa8d['model'],qs[_0x0a7b('0x52')](_0x42ae4b[_0x0a7b('0x4e')]['fields']));_0x4780a0[_0x0a7b('0x51')]=_0x4780a0['attributes'][_0x0a7b('0x67')]?_0x4780a0[_0x0a7b('0x51')]:_0x3caa8d[_0x0a7b('0x4b')];_0x4780a0[_0x0a7b('0x54')]=qs['sort'](_0x42ae4b[_0x0a7b('0x4e')]['sort']);_0x4780a0[_0x0a7b('0x56')]=qs['filters'](_[_0x0a7b('0x57')](_0x42ae4b[_0x0a7b('0x4e')],_0x3caa8d[_0x0a7b('0x4f')]));if(_0x42ae4b[_0x0a7b('0x4e')][_0x0a7b('0x5a')]){_0x4780a0[_0x0a7b('0x56')]=_[_0x0a7b('0x61')](_0x4780a0[_0x0a7b('0x56')],{'$or':_[_0x0a7b('0x4c')](_0x4780a0[_0x0a7b('0x51')],function(_0x5cab2b){var _0x106a5b={};_0x106a5b[_0x5cab2b]={'$like':'%'+_0x42ae4b['query'][_0x0a7b('0x5a')]+'%'};return _0x106a5b;})});}_0x4780a0=_[_0x0a7b('0x61')]({},_0x4780a0,_0x42ae4b[_0x0a7b('0x5b')]);return _0x28add7[_0x0a7b('0xb8')](_0x4780a0);}})[_0x0a7b('0x21')](function(_0x4c1dac){if(_0x4c1dac){_0x4a8dff=_0x4c1dac[_0x0a7b('0x67')];if(!_0x42ae4b[_0x0a7b('0x4e')][_0x0a7b('0x53')]('nolimit')){_0x4780a0[_0x0a7b('0x32')]=qs[_0x0a7b('0x32')](_0x42ae4b[_0x0a7b('0x4e')][_0x0a7b('0x32')]);_0x4780a0[_0x0a7b('0x30')]=qs[_0x0a7b('0x30')](_0x42ae4b[_0x0a7b('0x4e')][_0x0a7b('0x30')]);}return _0x28add7[_0x0a7b('0xb8')](_0x4780a0);}})[_0x0a7b('0x21')](function(_0x2c0bd6){if(_0x2c0bd6){return _0x2c0bd6?{'count':_0x4a8dff,'rows':_0x2c0bd6}:null;}})[_0x0a7b('0x21')](respondWithResult(_0x1c8456,null))[_0x0a7b('0x2c')](handleError(_0x1c8456,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 8daabd1..f2e75dc 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 _0xc3f3=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x41c76c,_0x35ea63){var _0x1ef927=function(_0x1b814b){while(--_0x1b814b){_0x41c76c['push'](_0x41c76c['shift']());}};_0x1ef927(++_0x35ea63);}(_0xc3f3,0xd2));var _0x3c3f=function(_0x7814cd,_0x44b892){_0x7814cd=_0x7814cd-0x0;var _0x482941=_0xc3f3[_0x7814cd];return _0x482941;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x3c3f('0x0'))['db'][_0x3c3f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3c3f('0x2')](0x0);var events={'afterCreate':_0x3c3f('0x3'),'afterUpdate':_0x3c3f('0x4'),'afterDestroy':_0x3c3f('0x5')};function emitEvent(_0x377170){return function(_0x3a901e,_0x3ec810,_0x199c58){MailAccountEvents[_0x3c3f('0x6')](_0x377170+':'+_0x3a901e['id'],_0x3a901e);MailAccountEvents[_0x3c3f('0x6')](_0x377170,_0x3a901e);_0x199c58(null);};}for(var e in events){if(events[_0x3c3f('0x7')](e)){var event=events[e];MailAccount[_0x3c3f('0x8')](e,emitEvent(event));}}module[_0x3c3f('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xb145=['remove','emit','hook','events','../../mysqldb','MailAccount','update'];(function(_0x1716fe,_0x4dc1cd){var _0x162ffa=function(_0x271fda){while(--_0x271fda){_0x1716fe['push'](_0x1716fe['shift']());}};_0x162ffa(++_0x4dc1cd);}(_0xb145,0x168));var _0x5b14=function(_0x42fcae,_0x9de6d1){_0x42fcae=_0x42fcae-0x0;var _0x4a901b=_0xb145[_0x42fcae];return _0x4a901b;};'use strict';var EventEmitter=require(_0x5b14('0x0'));var MailAccount=require(_0x5b14('0x1'))['db'][_0x5b14('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b14('0x3'),'afterDestroy':_0x5b14('0x4')};function emitEvent(_0x5dbdfb){return function(_0x4d3cb8,_0x58af31,_0x84fe45){MailAccountEvents[_0x5b14('0x5')](_0x5dbdfb+':'+_0x4d3cb8['id'],_0x4d3cb8);MailAccountEvents['emit'](_0x5dbdfb,_0x4d3cb8);_0x84fe45(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x5b14('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2f9c0bf..930c3de 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 _0x1ee4=['exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./mailAccount.attributes'];(function(_0x321730,_0x1fb230){var _0x4344eb=function(_0x33163a){while(--_0x33163a){_0x321730['push'](_0x321730['shift']());}};_0x4344eb(++_0x1fb230);}(_0x1ee4,0x1c7));var _0x41ee=function(_0x183c58,_0x57c42f){_0x183c58=_0x183c58-0x0;var _0x41b2cd=_0x1ee4[_0x183c58];return _0x41b2cd;};'use strict';var _=require(_0x41ee('0x0'));var util=require('util');var logger=require(_0x41ee('0x1'))(_0x41ee('0x2'));var moment=require('moment');var BPromise=require(_0x41ee('0x3'));var rp=require(_0x41ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x41ee('0x5'));var attributes=require(_0x41ee('0x6'));module[_0x41ee('0x7')]=function(_0x32289b,_0x206e6c){return _0x32289b[_0x41ee('0x8')](_0x41ee('0x9'),attributes,{'tableName':_0x41ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc4f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts','lodash'];(function(_0x3ef9a2,_0x3cd67f){var _0x52a458=function(_0x4b53ab){while(--_0x4b53ab){_0x3ef9a2['push'](_0x3ef9a2['shift']());}};_0x52a458(++_0x3cd67f);}(_0xfc4f,0x6b));var _0xffc4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfc4f[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xffc4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xffc4('0x1'));var moment=require(_0xffc4('0x2'));var BPromise=require(_0xffc4('0x3'));var rp=require(_0xffc4('0x4'));var fs=require('fs');var path=require(_0xffc4('0x5'));var rimraf=require(_0xffc4('0x6'));var config=require(_0xffc4('0x7'));var attributes=require(_0xffc4('0x8'));module[_0xffc4('0x9')]=function(_0x2eeee9,_0x6643b5){return _0x2eeee9['define'](_0xffc4('0xa'),attributes,{'tableName':_0xffc4('0xb'),'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 653e979..9f4bfd2 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 _0x27a0=['format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetMailAccount','MailAccount','findAll','options','raw','map','include','attributes','model','then','debug','stringify','catch','ShowMailAccount','find','NotifyMailAccount','body','keys','CmContact','rawAttributes','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','get','applications','list','orderBy','priority','asc','autoclose','push','length','close','contact','messageId','generate','subject'];(function(_0x3391a2,_0x4daa14){var _0x1c4da1=function(_0x2528fa){while(--_0x2528fa){_0x3391a2['push'](_0x3391a2['shift']());}};_0x1c4da1(++_0x4daa14);}(_0x27a0,0x145));var _0x027a=function(_0x592821,_0x3c0090){_0x592821=_0x592821-0x0;var _0x1c2d87=_0x27a0[_0x592821];return _0x1c2d87;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require('bluebird');var rs=require(_0x027a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x027a('0x3'));var logger=require(_0x027a('0x4'))('rpc');var config=require(_0x027a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x027a('0x6')]({'port':0x232c});config['redis']=_[_0x027a('0x7')](config[_0x027a('0x8')],{'host':_0x027a('0x9'),'port':0x18eb});var socket=require(_0x027a('0xa'))(new Redis(config[_0x027a('0x8')]));require('./mailAccount.socket')[_0x027a('0xb')](socket);function respondWithRpcPromise(_0x456f34,_0x2fe6c5,_0x432158){return new BPromise(function(_0x569588,_0x3949a6){return client[_0x027a('0xc')](_0x456f34,_0x432158)['then'](function(_0x2f2a9d){logger[_0x027a('0xd')](_0x027a('0xe'),_0x2fe6c5,_0x027a('0xf'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x2fe6c5,'request\x20sent',JSON['stringify'](_0x2f2a9d));if(_0x2f2a9d[_0x027a('0x10')]){if(_0x2f2a9d['error'][_0x027a('0x11')]===0x1f4){logger[_0x027a('0x10')](_0x027a('0xe'),_0x2fe6c5,_0x2f2a9d['error'][_0x027a('0x12')]);return _0x3949a6(_0x2f2a9d[_0x027a('0x10')][_0x027a('0x12')]);}logger[_0x027a('0x10')](_0x027a('0xe'),_0x2fe6c5,_0x2f2a9d[_0x027a('0x10')]['message']);return _0x569588(_0x2f2a9d['error'][_0x027a('0x12')]);}else{logger[_0x027a('0xd')]('MailAccount,\x20%s,\x20%s',_0x2fe6c5,_0x027a('0xf'));_0x569588(_0x2f2a9d[_0x027a('0x13')]['message']);}})['catch'](function(_0x364591){logger[_0x027a('0x10')](_0x027a('0xe'),_0x2fe6c5,_0x364591);_0x3949a6(_0x364591);});});}exports[_0x027a('0x14')]=function(_0x1a8a57){var _0x4b71af=this;return new Promise(function(_0x5e6694,_0x575ba9){return db[_0x027a('0x15')][_0x027a('0x16')]({'raw':_0x1a8a57[_0x027a('0x17')]?_0x1a8a57[_0x027a('0x17')][_0x027a('0x18')]===undefined?!![]:![]:!![],'where':_0x1a8a57['options']?_0x1a8a57[_0x027a('0x17')]['where']||null:null,'attributes':_0x1a8a57[_0x027a('0x17')]?_0x1a8a57[_0x027a('0x17')]['attributes']||null:null,'limit':_0x1a8a57[_0x027a('0x17')]?_0x1a8a57['options']['limit']||null:null,'include':_0x1a8a57[_0x027a('0x17')]?_0x1a8a57[_0x027a('0x17')]['include']?_[_0x027a('0x19')](_0x1a8a57[_0x027a('0x17')][_0x027a('0x1a')],function(_0xed3700){return{'model':db[_0xed3700['model']],'as':_0xed3700['as'],'attributes':_0xed3700[_0x027a('0x1b')],'include':_0xed3700['include']?_[_0x027a('0x19')](_0xed3700[_0x027a('0x1a')],function(_0x2a1bba){return{'model':db[_0x2a1bba[_0x027a('0x1c')]],'as':_0x2a1bba['as'],'attributes':_0x2a1bba['attributes'],'include':_0x2a1bba['include']?_[_0x027a('0x19')](_0x2a1bba[_0x027a('0x1a')],function(_0x2fd795){return{'model':db[_0x2fd795['model']],'as':_0x2fd795['as'],'attributes':_0x2fd795[_0x027a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x027a('0x1d')](function(_0x4d4510){logger['info'](_0x027a('0x14'),_0x1a8a57);logger[_0x027a('0x1e')](_0x027a('0x14'),_0x1a8a57,JSON[_0x027a('0x1f')](_0x4d4510));_0x5e6694(_0x4d4510);})[_0x027a('0x20')](function(_0x53efed){logger[_0x027a('0x10')](_0x027a('0x14'),_0x53efed[_0x027a('0x12')],_0x1a8a57);_0x575ba9(_0x4b71af[_0x027a('0x10')](0x1f4,_0x53efed[_0x027a('0x12')]));});});};exports[_0x027a('0x21')]=function(_0x29182c){var _0x1e3ffa=this;return new Promise(function(_0x3ed46e,_0x1de787){return db[_0x027a('0x15')][_0x027a('0x22')]({'raw':_0x29182c['options']?_0x29182c['options'][_0x027a('0x18')]===undefined?!![]:![]:!![],'where':_0x29182c[_0x027a('0x17')]?_0x29182c[_0x027a('0x17')]['where']||null:null,'attributes':_0x29182c[_0x027a('0x17')]?_0x29182c[_0x027a('0x17')]['attributes']||null:null,'include':_0x29182c[_0x027a('0x17')]?_0x29182c[_0x027a('0x17')][_0x027a('0x1a')]?_[_0x027a('0x19')](_0x29182c['options'][_0x027a('0x1a')],function(_0x27f324){return{'model':db[_0x27f324[_0x027a('0x1c')]],'as':_0x27f324['as'],'attributes':_0x27f324[_0x027a('0x1b')],'include':_0x27f324[_0x027a('0x1a')]?_[_0x027a('0x19')](_0x27f324['include'],function(_0x488348){return{'model':db[_0x488348[_0x027a('0x1c')]],'as':_0x488348['as'],'attributes':_0x488348[_0x027a('0x1b')],'include':_0x488348[_0x027a('0x1a')]?_[_0x027a('0x19')](_0x488348['include'],function(_0x408eb6){return{'model':db[_0x408eb6[_0x027a('0x1c')]],'as':_0x408eb6['as'],'attributes':_0x408eb6['attributes']};}):[]};}):[]};}):[]:[]})[_0x027a('0x1d')](function(_0x499b36){logger['info'](_0x027a('0x21'),_0x29182c);logger['debug'](_0x027a('0x21'),_0x29182c,JSON[_0x027a('0x1f')](_0x499b36));_0x3ed46e(_0x499b36);})[_0x027a('0x20')](function(_0x4da565){logger[_0x027a('0x10')](_0x027a('0x21'),_0x4da565[_0x027a('0x12')],_0x29182c);_0x1de787(_0x1e3ffa[_0x027a('0x10')](0x1f4,_0x4da565['message']));});});};exports[_0x027a('0x23')]=function(_0x54dd53){var _0x461f7a=this;return new Promise(function(_0x1037c2,_0x51e092){var _0x1487f6={'body':_0x54dd53[_0x027a('0x24')],'channel':'mail'};var _0x251c7f=_['difference'](_[_0x027a('0x25')](db[_0x027a('0x26')][_0x027a('0x27')]),['createdAt','updatedAt',_0x027a('0x28'),_0x027a('0x29')]);var _0x137eb8=![];if(_0x54dd53[_0x027a('0x24')]['id']){delete _0x54dd53[_0x027a('0x24')]['id'];}if(_[_0x027a('0x2a')](_0x54dd53[_0x027a('0x24')][_0x027a('0x2b')])){return _0x51e092(_0x461f7a[_0x027a('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x027a('0x2a')](_0x54dd53[_0x027a('0x24')]['body'])||_0x54dd53['body'][_0x027a('0x24')]===''){return _0x51e092(_0x461f7a[_0x027a('0x10')](0x1f4,_0x027a('0x2c')));}if(_['isNil'](_0x54dd53[_0x027a('0x24')][_0x027a('0x2d')])){return _0x51e092(_0x461f7a[_0x027a('0x10')](0x1f4,_0x027a('0x2e')+_0x251c7f));}if(!_['includes'](_0x251c7f,_0x54dd53['body'][_0x027a('0x2d')])){return _0x51e092(_0x461f7a['error'](0x1f4,_0x027a('0x2f')+_0x251c7f));}var _0x32ba00={};_0x32ba00[_0x54dd53[_0x027a('0x24')][_0x027a('0x2d')]]=_0x54dd53[_0x027a('0x24')]['from'];return db[_0x027a('0x15')]['find']({'where':{'id':_0x54dd53[_0x027a('0x30')]['id']},'include':[{'model':db['CmList'],'as':_0x027a('0x31'),'include':[{'model':db[_0x027a('0x26')],'as':_0x027a('0x32'),'where':_0x32ba00,'limit':0x1,'order':[[_0x027a('0x33'),_0x027a('0x34')]]}]},{'model':db[_0x027a('0x35')],'as':_0x027a('0x36')},{'model':db[_0x027a('0x37')],'as':_0x027a('0x38')}]})[_0x027a('0x1d')](function(_0x2cd3d8){if(_0x2cd3d8&&_0x2cd3d8[_0x027a('0x31')]){var _0x28ad93=_0x2cd3d8[_0x027a('0x39')]({'plain':!![]});_0x1487f6[_0x027a('0x30')]=_['omit'](_0x28ad93,[_0x027a('0x36'),_0x027a('0x31')]);_0x1487f6[_0x027a('0x3a')]=_0x28ad93[_0x027a('0x36')];_0x1487f6[_0x027a('0x3b')]=_0x28ad93[_0x027a('0x31')];_0x1487f6['applications']=_[_0x027a('0x3c')](_0x1487f6['applications'],[_0x027a('0x3d')],[_0x027a('0x3e')]);if(_0x1487f6[_0x027a('0x30')]&&_0x1487f6['account'][_0x027a('0x3f')]){_0x1487f6[_0x027a('0x3a')][_0x027a('0x40')]({'id':0x0,'priority':_0x1487f6[_0x027a('0x3a')][_0x027a('0x41')]+0x1,'app':_0x027a('0x42'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x1487f6[_0x027a('0x30')][_0x027a('0x36')]){delete _0x1487f6['account'][_0x027a('0x36')];}if(_0x1487f6[_0x027a('0x30')]['List']){delete _0x1487f6[_0x027a('0x30')][_0x027a('0x31')];}if(_0x28ad93[_0x027a('0x31')][_0x027a('0x32')]['length']){return _0x28ad93[_0x027a('0x31')][_0x027a('0x32')][0x0];}var _0x39a905=_['defaults'](_0x54dd53[_0x027a('0x24')],{'firstName':_0x54dd53[_0x027a('0x24')][_0x027a('0x2b')],'ListId':_0x28ad93[_0x027a('0x29')]});_0x39a905[_0x54dd53[_0x027a('0x24')][_0x027a('0x2d')]]=_0x54dd53[_0x027a('0x24')][_0x027a('0x2b')];return db[_0x027a('0x26')]['create'](_0x39a905);}else{throw new Error('List\x20not\x20found');}})[_0x027a('0x1d')](function(_0x416e9d){_0x1487f6[_0x027a('0x43')]=_0x416e9d;if(_0x416e9d){if(!_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x44')]){_0x54dd53[_0x027a('0x24')]['message']['messageId']=rs[_0x027a('0x45')]()+'\x20'+_0x54dd53['body'][_0x027a('0x12')][_0x027a('0x2b')];}var _0x1b73da={'ContactId':_0x416e9d['id'],'MailAccountId':_0x54dd53[_0x027a('0x30')]['id'],'inReplyTo':_0x54dd53['body'][_0x027a('0x12')][_0x027a('0x44')],'to':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['from'],'cc':_0x54dd53[_0x027a('0x24')]['message']['cc'],'subject':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x46')],'attach':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['attach'],'lastMsgAt':moment()[_0x027a('0x47')](_0x027a('0x48')),'lastMsgDirection':'in'};return db[_0x027a('0x49')][_0x027a('0x22')]({'where':{'closed':![],'MailAccountId':_0x54dd53[_0x027a('0x30')]['id']},'include':[{'model':db[_0x027a('0x4a')],'as':_0x027a('0x4b'),'attributes':['messageId'],'where':{'messageId':_0x54dd53[_0x027a('0x24')]['message'][_0x027a('0x4c')]}}]})[_0x027a('0x1d')](function(_0xea1ac5){if(_0xea1ac5){return[_0xea1ac5,![]];}return db[_0x027a('0x49')][_0x027a('0x4d')](_0x1b73da)[_0x027a('0x1d')](function(_0x9d4c4f){return[_0x9d4c4f,!![]];});});}else{throw new Error(_0x027a('0x4e'));}})[_0x027a('0x4f')](function(_0xcd9357,_0x920096){if(_0xcd9357){_0x137eb8=_0x920096;if(!_0x920096){return _0xcd9357['update']({'inReplyTo':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['messageId'],'to':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['from'],'cc':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['cc'],'subject':_0x54dd53['body']['message'][_0x027a('0x46')],'attach':_0xcd9357[_0x027a('0x50')]?_0xcd9357[_0x027a('0x50')]:_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['attach'],'substatus':null,'substatusAt':moment()[_0x027a('0x47')](_0x027a('0x48')),'lastMsgAt':moment()[_0x027a('0x47')](_0x027a('0x48')),'lastMsgDirection':'in'});}else{return _0xcd9357;}}})[_0x027a('0x1d')](function(_0x2feaa0){_0x1487f6[_0x027a('0x51')]=_0x2feaa0[_0x027a('0x39')]({'plain':!![]});_0x1487f6[_0x027a('0x51')][_0x027a('0x52')]=_0x137eb8;return db[_0x027a('0x4a')][_0x027a('0x4d')]({'body':_0x54dd53['body']['body'],'MailAccountId':_0x54dd53['account']['id'],'MailInteractionId':_0x2feaa0['id'],'direction':'in','ContactId':_0x1487f6[_0x027a('0x43')]['id'],'messageId':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x44')],'from':_0x54dd53['body'][_0x027a('0x12')]['from'],'to':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['to'],'cc':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')]['cc'],'subject':_0x54dd53[_0x027a('0x24')]['message']['subject'],'attach':_0x54dd53['body'][_0x027a('0x12')]['attach'],'Attachments':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x53')],'originTo':_0x54dd53[_0x027a('0x24')][_0x027a('0x12')][_0x027a('0x54')],'originCc':_0x54dd53[_0x027a('0x24')]['message'][_0x027a('0x55')],'bcc':_0x54dd53[_0x027a('0x24')]['message'][_0x027a('0x56')],'ChatWebsiteId':_0x54dd53['body']['message'][_0x027a('0x57')]||null,'originChannel':_0x54dd53[_0x027a('0x24')]['message'][_0x027a('0x58')]||'Email','ChatOfflineMessageId':_0x54dd53['body'][_0x027a('0x12')][_0x027a('0x59')]||null},{'include':[{'model':db[_0x027a('0x5a')],'as':'Attachments'}]});})[_0x027a('0x1d')](function(_0x1b49cf){_0x1487f6[_0x027a('0x12')]=_0x1b49cf;if(_0x1487f6[_0x027a('0x51')][_0x027a('0x5b')]){return db[_0x027a('0x5c')][_0x027a('0x22')]({'attributes':['id',_0x027a('0x5d')],'where':{'id':_0x1487f6[_0x027a('0x51')]['UserId']}})[_0x027a('0x1d')](function(_0x4681f7){if(_0x4681f7){_0x1487f6['applications'][_0x027a('0x5e')]({'id':0x0,'priority':0x0,'app':_0x027a('0x5f'),'appdata':_0x4681f7[_0x027a('0x5d')]+','+(_0x1487f6[_0x027a('0x30')][_0x027a('0x60')]||0xa),'interval':_0x027a('0x61')});}return respondWithRpcPromise('Start','startRouting',_0x1487f6);});}return respondWithRpcPromise(_0x027a('0x62'),'startRouting',_0x1487f6);})['then'](function(_0x4405a5){_0x1037c2(_0x4405a5);})[_0x027a('0x20')](function(_0x279075){_0x51e092(_0x461f7a[_0x027a('0x10')](0x1f4,_0x279075['message']));});});}; \ No newline at end of file +var _0xdf16=['startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./mailAccount.socket','request','info','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','limit','include','map','model','attributes','then','ShowMailAccount','find','raw','where','debug','NotifyMailAccount','mail','CmContact','rawAttributes','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','includes','account','List','DESC','MailApplication','Applications','MailServerOut','get','omit','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','spread','update','format','interaction','created','MailMessage','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','agent','waitForTheAssignedAgent','Start'];(function(_0x1d58f7,_0x5cb1f1){var _0x1394ee=function(_0x352965){while(--_0x352965){_0x1d58f7['push'](_0x1d58f7['shift']());}};_0x1394ee(++_0x5cb1f1);}(_0xdf16,0x66));var _0x6df1=function(_0x38aa1d,_0x4faf18){_0x38aa1d=_0x38aa1d-0x0;var _0x2fb75d=_0xdf16[_0x38aa1d];return _0x2fb75d;};'use strict';var _=require('lodash');var util=require(_0x6df1('0x0'));var moment=require(_0x6df1('0x1'));var BPromise=require(_0x6df1('0x2'));var rs=require(_0x6df1('0x3'));var fs=require('fs');var Redis=require(_0x6df1('0x4'));var db=require(_0x6df1('0x5'))['db'];var utils=require(_0x6df1('0x6'));var logger=require(_0x6df1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6df1('0x8')][_0x6df1('0x9')]({'port':0x232c});config[_0x6df1('0xa')]=_[_0x6df1('0xb')](config['redis'],{'host':_0x6df1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6df1('0xa')]));require(_0x6df1('0xd'))['register'](socket);function respondWithRpcPromise(_0x39a449,_0xe0745e,_0x3c147f){return new BPromise(function(_0x249c8d,_0x13ab37){return client[_0x6df1('0xe')](_0x39a449,_0x3c147f)['then'](function(_0x1dadc2){logger[_0x6df1('0xf')]('MailAccount,\x20%s,\x20%s',_0xe0745e,_0x6df1('0x10'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0xe0745e,_0x6df1('0x10'),JSON[_0x6df1('0x11')](_0x1dadc2));if(_0x1dadc2[_0x6df1('0x12')]){if(_0x1dadc2[_0x6df1('0x12')][_0x6df1('0x13')]===0x1f4){logger['error'](_0x6df1('0x14'),_0xe0745e,_0x1dadc2[_0x6df1('0x12')][_0x6df1('0x15')]);return _0x13ab37(_0x1dadc2[_0x6df1('0x12')][_0x6df1('0x15')]);}logger[_0x6df1('0x12')](_0x6df1('0x14'),_0xe0745e,_0x1dadc2[_0x6df1('0x12')][_0x6df1('0x15')]);return _0x249c8d(_0x1dadc2[_0x6df1('0x12')][_0x6df1('0x15')]);}else{logger[_0x6df1('0xf')]('MailAccount,\x20%s,\x20%s',_0xe0745e,_0x6df1('0x10'));_0x249c8d(_0x1dadc2[_0x6df1('0x16')]['message']);}})[_0x6df1('0x17')](function(_0x32b4e6){logger[_0x6df1('0x12')](_0x6df1('0x14'),_0xe0745e,_0x32b4e6);_0x13ab37(_0x32b4e6);});});}exports[_0x6df1('0x18')]=function(_0x3b7297){var _0x535137=this;return new Promise(function(_0xdb0429,_0x46f99b){return db[_0x6df1('0x19')][_0x6df1('0x1a')]({'raw':_0x3b7297['options']?_0x3b7297[_0x6df1('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3b7297[_0x6df1('0x1b')]?_0x3b7297[_0x6df1('0x1b')]['where']||null:null,'attributes':_0x3b7297[_0x6df1('0x1b')]?_0x3b7297[_0x6df1('0x1b')]['attributes']||null:null,'limit':_0x3b7297[_0x6df1('0x1b')]?_0x3b7297[_0x6df1('0x1b')][_0x6df1('0x1c')]||null:null,'include':_0x3b7297['options']?_0x3b7297[_0x6df1('0x1b')][_0x6df1('0x1d')]?_[_0x6df1('0x1e')](_0x3b7297[_0x6df1('0x1b')][_0x6df1('0x1d')],function(_0x44bed4){return{'model':db[_0x44bed4['model']],'as':_0x44bed4['as'],'attributes':_0x44bed4['attributes'],'include':_0x44bed4[_0x6df1('0x1d')]?_['map'](_0x44bed4[_0x6df1('0x1d')],function(_0x13de76){return{'model':db[_0x13de76[_0x6df1('0x1f')]],'as':_0x13de76['as'],'attributes':_0x13de76[_0x6df1('0x20')],'include':_0x13de76[_0x6df1('0x1d')]?_[_0x6df1('0x1e')](_0x13de76[_0x6df1('0x1d')],function(_0x4602a5){return{'model':db[_0x4602a5[_0x6df1('0x1f')]],'as':_0x4602a5['as'],'attributes':_0x4602a5[_0x6df1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6df1('0x21')](function(_0x2c1cd7){logger[_0x6df1('0xf')](_0x6df1('0x18'),_0x3b7297);logger['debug'](_0x6df1('0x18'),_0x3b7297,JSON[_0x6df1('0x11')](_0x2c1cd7));_0xdb0429(_0x2c1cd7);})[_0x6df1('0x17')](function(_0x197580){logger['error'](_0x6df1('0x18'),_0x197580[_0x6df1('0x15')],_0x3b7297);_0x46f99b(_0x535137[_0x6df1('0x12')](0x1f4,_0x197580[_0x6df1('0x15')]));});});};exports[_0x6df1('0x22')]=function(_0x1e8378){var _0x2dd499=this;return new Promise(function(_0x593512,_0x47bbeb){return db[_0x6df1('0x19')][_0x6df1('0x23')]({'raw':_0x1e8378[_0x6df1('0x1b')]?_0x1e8378['options'][_0x6df1('0x24')]===undefined?!![]:![]:!![],'where':_0x1e8378[_0x6df1('0x1b')]?_0x1e8378[_0x6df1('0x1b')][_0x6df1('0x25')]||null:null,'attributes':_0x1e8378[_0x6df1('0x1b')]?_0x1e8378['options'][_0x6df1('0x20')]||null:null,'include':_0x1e8378[_0x6df1('0x1b')]?_0x1e8378[_0x6df1('0x1b')][_0x6df1('0x1d')]?_[_0x6df1('0x1e')](_0x1e8378['options'][_0x6df1('0x1d')],function(_0x1715c6){return{'model':db[_0x1715c6[_0x6df1('0x1f')]],'as':_0x1715c6['as'],'attributes':_0x1715c6['attributes'],'include':_0x1715c6[_0x6df1('0x1d')]?_[_0x6df1('0x1e')](_0x1715c6[_0x6df1('0x1d')],function(_0x4c1eef){return{'model':db[_0x4c1eef[_0x6df1('0x1f')]],'as':_0x4c1eef['as'],'attributes':_0x4c1eef[_0x6df1('0x20')],'include':_0x4c1eef[_0x6df1('0x1d')]?_[_0x6df1('0x1e')](_0x4c1eef[_0x6df1('0x1d')],function(_0x277cc8){return{'model':db[_0x277cc8[_0x6df1('0x1f')]],'as':_0x277cc8['as'],'attributes':_0x277cc8[_0x6df1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x529a6e){logger['info'](_0x6df1('0x22'),_0x1e8378);logger[_0x6df1('0x26')]('ShowMailAccount',_0x1e8378,JSON['stringify'](_0x529a6e));_0x593512(_0x529a6e);})[_0x6df1('0x17')](function(_0x1889f8){logger['error'](_0x6df1('0x22'),_0x1889f8['message'],_0x1e8378);_0x47bbeb(_0x2dd499[_0x6df1('0x12')](0x1f4,_0x1889f8['message']));});});};exports[_0x6df1('0x27')]=function(_0x402393){var _0x11dd43=this;return new Promise(function(_0x5b8b00,_0x2bf0f5){var _0x311d6c={'body':_0x402393['body'],'channel':_0x6df1('0x28')};var _0x58a332=_['difference'](_['keys'](db[_0x6df1('0x29')][_0x6df1('0x2a')]),['createdAt',_0x6df1('0x2b'),_0x6df1('0x2c'),_0x6df1('0x2d')]);var _0x276980=![];if(_0x402393['body']['id']){delete _0x402393[_0x6df1('0x2e')]['id'];}if(_[_0x6df1('0x2f')](_0x402393[_0x6df1('0x2e')][_0x6df1('0x30')])){return _0x2bf0f5(_0x11dd43[_0x6df1('0x12')](0x1f4,_0x6df1('0x31')));}if(_[_0x6df1('0x2f')](_0x402393[_0x6df1('0x2e')][_0x6df1('0x2e')])||_0x402393['body'][_0x6df1('0x2e')]===''){return _0x2bf0f5(_0x11dd43[_0x6df1('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x6df1('0x2f')](_0x402393[_0x6df1('0x2e')][_0x6df1('0x32')])){return _0x2bf0f5(_0x11dd43[_0x6df1('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x58a332));}if(!_[_0x6df1('0x33')](_0x58a332,_0x402393[_0x6df1('0x2e')][_0x6df1('0x32')])){return _0x2bf0f5(_0x11dd43['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x58a332));}var _0x4d3da7={};_0x4d3da7[_0x402393[_0x6df1('0x2e')]['mapKey']]=_0x402393[_0x6df1('0x2e')][_0x6df1('0x30')];return db['MailAccount']['find']({'where':{'id':_0x402393[_0x6df1('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0x6df1('0x35'),'include':[{'model':db[_0x6df1('0x29')],'as':'Contacts','where':_0x4d3da7,'limit':0x1,'order':[[_0x6df1('0x2b'),_0x6df1('0x36')]]}]},{'model':db[_0x6df1('0x37')],'as':_0x6df1('0x38')},{'model':db[_0x6df1('0x39')],'as':'Smtp'}]})['then'](function(_0x1d8320){if(_0x1d8320&&_0x1d8320[_0x6df1('0x35')]){var _0x598d0e=_0x1d8320[_0x6df1('0x3a')]({'plain':!![]});_0x311d6c[_0x6df1('0x34')]=_[_0x6df1('0x3b')](_0x598d0e,['Applications',_0x6df1('0x35')]);_0x311d6c[_0x6df1('0x3c')]=_0x598d0e[_0x6df1('0x38')];_0x311d6c[_0x6df1('0x3d')]=_0x598d0e[_0x6df1('0x35')];_0x311d6c[_0x6df1('0x3c')]=_[_0x6df1('0x3e')](_0x311d6c[_0x6df1('0x3c')],[_0x6df1('0x3f')],['asc']);if(_0x311d6c[_0x6df1('0x34')]&&_0x311d6c['account'][_0x6df1('0x40')]){_0x311d6c[_0x6df1('0x3c')][_0x6df1('0x41')]({'id':0x0,'priority':_0x311d6c[_0x6df1('0x3c')][_0x6df1('0x42')]+0x1,'app':_0x6df1('0x43'),'appdata':_0x6df1('0x40'),'interval':_0x6df1('0x44')});}if(_0x311d6c[_0x6df1('0x34')]['Applications']){delete _0x311d6c['account'][_0x6df1('0x38')];}if(_0x311d6c[_0x6df1('0x34')][_0x6df1('0x35')]){delete _0x311d6c[_0x6df1('0x34')]['List'];}if(_0x598d0e['List'][_0x6df1('0x45')][_0x6df1('0x42')]){return _0x598d0e[_0x6df1('0x35')][_0x6df1('0x45')][0x0];}var _0x554fef=_[_0x6df1('0xb')](_0x402393[_0x6df1('0x2e')],{'firstName':_0x402393[_0x6df1('0x2e')][_0x6df1('0x30')],'ListId':_0x598d0e[_0x6df1('0x2d')]});_0x554fef[_0x402393[_0x6df1('0x2e')][_0x6df1('0x32')]]=_0x402393['body'][_0x6df1('0x30')];return db['CmContact'][_0x6df1('0x46')](_0x554fef);}else{throw new Error(_0x6df1('0x47'));}})[_0x6df1('0x21')](function(_0x401c1f){_0x311d6c[_0x6df1('0x48')]=_0x401c1f;if(_0x401c1f){if(!_0x402393['body'][_0x6df1('0x15')][_0x6df1('0x49')]){_0x402393['body'][_0x6df1('0x15')][_0x6df1('0x49')]=rs[_0x6df1('0x4a')]()+'\x20'+_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')][_0x6df1('0x30')];}var _0x450a06={'ContactId':_0x401c1f['id'],'MailAccountId':_0x402393[_0x6df1('0x34')]['id'],'inReplyTo':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')][_0x6df1('0x49')],'to':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')]['from'],'cc':_0x402393[_0x6df1('0x2e')]['message']['cc'],'subject':_0x402393[_0x6df1('0x2e')]['message'][_0x6df1('0x4b')],'attach':_0x402393['body']['message'][_0x6df1('0x4c')],'lastMsgAt':moment()['format'](_0x6df1('0x4d')),'lastMsgDirection':'in'};return db[_0x6df1('0x4e')][_0x6df1('0x23')]({'where':{'closed':![],'MailAccountId':_0x402393[_0x6df1('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0x6df1('0x4f'),'attributes':[_0x6df1('0x49')],'where':{'messageId':_0x402393['body'][_0x6df1('0x15')][_0x6df1('0x50')]}}]})[_0x6df1('0x21')](function(_0x1e6067){if(_0x1e6067){return[_0x1e6067,![]];}return db[_0x6df1('0x4e')]['create'](_0x450a06)[_0x6df1('0x21')](function(_0x18f6e7){return[_0x18f6e7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x6df1('0x51')](function(_0x276fe4,_0xb781ae){if(_0x276fe4){_0x276980=_0xb781ae;if(!_0xb781ae){return _0x276fe4[_0x6df1('0x52')]({'inReplyTo':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')][_0x6df1('0x49')],'to':_0x402393[_0x6df1('0x2e')]['message'][_0x6df1('0x30')],'cc':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')]['cc'],'subject':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')]['subject'],'attach':_0x276fe4[_0x6df1('0x4c')]?_0x276fe4[_0x6df1('0x4c')]:_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x6df1('0x53')](_0x6df1('0x4d')),'lastMsgAt':moment()[_0x6df1('0x53')](_0x6df1('0x4d')),'lastMsgDirection':'in'});}else{return _0x276fe4;}}})[_0x6df1('0x21')](function(_0x349ad3){_0x311d6c['interaction']=_0x349ad3[_0x6df1('0x3a')]({'plain':!![]});_0x311d6c[_0x6df1('0x54')][_0x6df1('0x55')]=_0x276980;return db[_0x6df1('0x56')]['create']({'body':_0x402393[_0x6df1('0x2e')]['body'],'MailAccountId':_0x402393['account']['id'],'MailInteractionId':_0x349ad3['id'],'direction':'in','ContactId':_0x311d6c[_0x6df1('0x48')]['id'],'messageId':_0x402393['body'][_0x6df1('0x15')]['messageId'],'from':_0x402393[_0x6df1('0x2e')]['message']['from'],'to':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')]['to'],'cc':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')]['cc'],'subject':_0x402393['body'][_0x6df1('0x15')][_0x6df1('0x4b')],'attach':_0x402393['body'][_0x6df1('0x15')][_0x6df1('0x4c')],'Attachments':_0x402393[_0x6df1('0x2e')]['message']['attachments'],'originTo':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')][_0x6df1('0x57')],'originCc':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')][_0x6df1('0x58')],'bcc':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')]['bcc'],'ChatWebsiteId':_0x402393[_0x6df1('0x2e')][_0x6df1('0x15')][_0x6df1('0x59')]||null,'originChannel':_0x402393['body'][_0x6df1('0x15')][_0x6df1('0x5a')]||'Email','ChatOfflineMessageId':_0x402393[_0x6df1('0x2e')]['message'][_0x6df1('0x5b')]||null},{'include':[{'model':db[_0x6df1('0x5c')],'as':_0x6df1('0x5d')}]});})[_0x6df1('0x21')](function(_0x155567){_0x311d6c[_0x6df1('0x15')]=_0x155567;if(_0x311d6c['interaction']['UserId']){return db[_0x6df1('0x5e')][_0x6df1('0x23')]({'attributes':['id',_0x6df1('0x5f')],'where':{'id':_0x311d6c[_0x6df1('0x54')][_0x6df1('0x60')]}})[_0x6df1('0x21')](function(_0x3637cb){if(_0x3637cb){_0x311d6c[_0x6df1('0x3c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6df1('0x61'),'appdata':_0x3637cb['name']+','+(_0x311d6c[_0x6df1('0x34')][_0x6df1('0x62')]||0xa),'interval':_0x6df1('0x44')});}return respondWithRpcPromise(_0x6df1('0x63'),_0x6df1('0x64'),_0x311d6c);});}return respondWithRpcPromise('Start',_0x6df1('0x64'),_0x311d6c);})[_0x6df1('0x21')](function(_0x40aab8){_0x5b8b00(_0x40aab8);})[_0x6df1('0x17')](function(_0x2a9f23){_0x2bf0f5(_0x11dd43['error'](0x1f4,_0x2a9f23[_0x6df1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 200d073..9a6ca06 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 _0xfddb=['remove','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x2e7ef1,_0x50221d){var _0x39fa56=function(_0x3559d4){while(--_0x3559d4){_0x2e7ef1['push'](_0x2e7ef1['shift']());}};_0x39fa56(++_0x50221d);}(_0xfddb,0x1ea));var _0xbfdd=function(_0x49db31,_0x561cc9){_0x49db31=_0x49db31-0x0;var _0x23e28f=_0xfddb[_0x49db31];return _0x23e28f;};'use strict';var MailAccountEvents=require(_0xbfdd('0x0'));var events=[_0xbfdd('0x1'),_0xbfdd('0x2'),'update'];function createListener(_0x1b48cf,_0x4dbf55){return function(_0x503db0){_0x4dbf55['emit'](_0x1b48cf,_0x503db0);};}function removeListener(_0x5b2d47,_0x3ac703){return function(){MailAccountEvents['removeListener'](_0x5b2d47,_0x3ac703);};}exports[_0xbfdd('0x3')]=function(_0x113b76){for(var _0x99f0a8=0x0,_0x1be58d=events[_0xbfdd('0x4')];_0x99f0a8<_0x1be58d;_0x99f0a8++){var _0x3505ad=events[_0x99f0a8];var _0x1b2b3e=createListener(_0xbfdd('0x5')+_0x3505ad,_0x113b76);MailAccountEvents['on'](_0x3505ad,_0x1b2b3e);}}; \ No newline at end of file +var _0x58a0=['remove','update','emit','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x58a0,0x6e));var _0x058a=function(_0x5c08cb,_0x456960){_0x5c08cb=_0x5c08cb-0x0;var _0x147907=_0x58a0[_0x5c08cb];return _0x147907;};'use strict';var MailAccountEvents=require(_0x058a('0x0'));var events=[_0x058a('0x1'),_0x058a('0x2'),_0x058a('0x3')];function createListener(_0x9a3287,_0x5b589f){return function(_0x379965){_0x5b589f[_0x058a('0x4')](_0x9a3287,_0x379965);};}function removeListener(_0x1367f8,_0x54b72c){return function(){MailAccountEvents['removeListener'](_0x1367f8,_0x54b72c);};}exports[_0x058a('0x5')]=function(_0x57287a){for(var _0x3854a9=0x0,_0x424f92=events[_0x058a('0x6')];_0x3854a9<_0x424f92;_0x3854a9++){var _0x18899d=events[_0x3854a9];var _0x8c039e=createListener(_0x058a('0x7')+_0x18899d,_0x57287a);MailAccountEvents['on'](_0x18899d,_0x8c039e);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3791b00..359188d 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 _0x3c78=['../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x3259ef,_0x2eb118){var _0x4a923f=function(_0x5c3835){while(--_0x5c3835){_0x3259ef['push'](_0x3259ef['shift']());}};_0x4a923f(++_0x2eb118);}(_0x3c78,0x162));var _0x83c7=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0x3c78[_0x3fa37f];return _0x5a01d5;};'use strict';var multer=require(_0x83c7('0x0'));var util=require(_0x83c7('0x1'));var path=require(_0x83c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x83c7('0x3'));var router=express['Router']();var fs_extra=require(_0x83c7('0x4'));var auth=require(_0x83c7('0x5'));var interaction=require(_0x83c7('0x6'));var config=require('../../config/environment');var controller=require(_0x83c7('0x7'));router['get'](_0x83c7('0x8'),auth[_0x83c7('0x9')](),controller[_0x83c7('0xa')]);router[_0x83c7('0xb')](_0x83c7('0x8'),auth[_0x83c7('0x9')](),controller[_0x83c7('0xc')]);router[_0x83c7('0xd')](_0x83c7('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x83c7('0xe')]=router; \ No newline at end of file +var _0x77bd=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x2b8377,_0x3be14b){var _0x3164ed=function(_0x321d72){while(--_0x321d72){_0x2b8377['push'](_0x2b8377['shift']());}};_0x3164ed(++_0x3be14b);}(_0x77bd,0xfe));var _0xd77b=function(_0x4f7588,_0x399e6b){_0x4f7588=_0x4f7588-0x0;var _0x535c70=_0x77bd[_0x4f7588];return _0x535c70;};'use strict';var multer=require(_0xd77b('0x0'));var util=require(_0xd77b('0x1'));var path=require('path');var timeout=require(_0xd77b('0x2'));var express=require('express');var router=express[_0xd77b('0x3')]();var fs_extra=require(_0xd77b('0x4'));var auth=require(_0xd77b('0x5'));var interaction=require(_0xd77b('0x6'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xd77b('0x7')]('/:id',auth[_0xd77b('0x8')](),controller[_0xd77b('0x9')]);router[_0xd77b('0xa')](_0xd77b('0xb'),auth[_0xd77b('0x8')](),controller[_0xd77b('0xc')]);router[_0xd77b('0xd')](_0xd77b('0xb'),auth[_0xd77b('0x8')](),controller[_0xd77b('0xe')]);module[_0xd77b('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 143f318..fcc0157 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 _0xe209=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x46c657,_0x2bd0bc){var _0x4381f1=function(_0x60212d){while(--_0x60212d){_0x46c657['push'](_0x46c657['shift']());}};_0x4381f1(++_0x2bd0bc);}(_0xe209,0x92));var _0x9e20=function(_0x2f865f,_0x43c2df){_0x2f865f=_0x2f865f-0x0;var _0x15f18f=_0xe209[_0x2f865f];return _0x15f18f;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9e20('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9e20('0x1')],'allowNull':![],'defaultValue':_0x9e20('0x2')},'appdata':{'type':Sequelize[_0x9e20('0x3')]()},'description':{'type':Sequelize[_0x9e20('0x1')]},'interval':{'type':Sequelize[_0x9e20('0x1')],'defaultValue':_0x9e20('0x4')}}; \ No newline at end of file +var _0x33fc=['STRING','*,*,*,*','INTEGER'];(function(_0x4671c7,_0x3416dd){var _0x2312ff=function(_0x17ed13){while(--_0x17ed13){_0x4671c7['push'](_0x4671c7['shift']());}};_0x2312ff(++_0x3416dd);}(_0x33fc,0x7a));var _0xc33f=function(_0x16683a,_0x460dca){_0x16683a=_0x16683a-0x0;var _0x480406=_0x33fc[_0x16683a];return _0x480406;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xc33f('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xc33f('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc33f('0x1')]},'interval':{'type':Sequelize[_0xc33f('0x1')],'defaultValue':_0xc33f('0x2')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index ab622b4..6029e42 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 _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(_0x4e6af9,_0x1fc28f){var _0x57033d=function(_0x21d7f8){while(--_0x21d7f8){_0x4e6af9['push'](_0x4e6af9['shift']());}};_0x57033d(++_0x1fc28f);}(_0xac4a,0x13f));var _0xaac4=function(_0x280568,_0x1acbba){_0x280568=_0x280568-0x0;var _0x11842f=_0xac4a[_0x280568];return _0x11842f;};'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 +var _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x3bddc9,_0x2a40f0){var _0x3ac6dc=function(_0x5e1765){while(--_0x5e1765){_0x3bddc9['push'](_0x3bddc9['shift']());}};_0x3ac6dc(++_0x2a40f0);}(_0xf4eb,0xec));var _0xbf4e=function(_0xdc50b,_0x517b1d){_0xdc50b=_0xdc50b-0x0;var _0x4c6d86=_0xf4eb[_0xdc50b];return _0x4c6d86;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index bede960..7282e8b 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 _0x4d66=['lodash','util','api','request-promise','rimraf','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4_unicode_ci'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x4d66,0x8f));var _0x64d6=function(_0x3c719e,_0x19719d){_0x3c719e=_0x3c719e-0x0;var _0x2d09af=_0x4d66[_0x3c719e];return _0x2d09af;};'use strict';var _=require(_0x64d6('0x0'));var util=require(_0x64d6('0x1'));var logger=require('../../config/logger')(_0x64d6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x64d6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64d6('0x4'));var config=require(_0x64d6('0x5'));var attributes=require(_0x64d6('0x6'));module['exports']=function(_0x1b30ed,_0x304b19){return _0x1b30ed[_0x64d6('0x7')](_0x64d6('0x8'),attributes,{'tableName':_0x64d6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x64d6('0xa')});}; \ No newline at end of file +var _0x67d1=['mail_applications','utf8mb4','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x5c10fc,_0x1116d9){var _0x44391b=function(_0x2de5b2){while(--_0x2de5b2){_0x5c10fc['push'](_0x5c10fc['shift']());}};_0x44391b(++_0x1116d9);}(_0x67d1,0xe9));var _0x167d=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x67d1[_0x2aea9e];return _0x430b92;};'use strict';var _=require('lodash');var util=require(_0x167d('0x0'));var logger=require(_0x167d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x167d('0x2'));var rp=require(_0x167d('0x3'));var fs=require('fs');var path=require(_0x167d('0x4'));var rimraf=require('rimraf');var config=require(_0x167d('0x5'));var attributes=require(_0x167d('0x6'));module[_0x167d('0x7')]=function(_0x35d935,_0x28b263){return _0x35d935[_0x167d('0x8')]('MailApplication',attributes,{'tableName':_0x167d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x167d('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index e2de59c..7e25ab6 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 _0xf87b=['error','code','message','MailApplication,\x20%s,\x20%s','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x58f758,_0x1ef3e9){var _0x152b43=function(_0x24cc04){while(--_0x24cc04){_0x58f758['push'](_0x58f758['shift']());}};_0x152b43(++_0x1ef3e9);}(_0xf87b,0x102));var _0xbf87=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf87b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbf87('0x0'));var util=require('util');var moment=require(_0xbf87('0x1'));var BPromise=require(_0xbf87('0x2'));var rs=require(_0xbf87('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf87('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbf87('0x5'));var client=jayson[_0xbf87('0x6')][_0xbf87('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52ee42,_0x5eee62,_0x132fb2){return new BPromise(function(_0x45b1d4,_0x132be5){return client['request'](_0x52ee42,_0x132fb2)[_0xbf87('0x8')](function(_0x3a1706){logger[_0xbf87('0x9')]('MailApplication,\x20%s,\x20%s',_0x5eee62,_0xbf87('0xa'));logger[_0xbf87('0xb')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5eee62,_0xbf87('0xa'),JSON['stringify'](_0x3a1706));if(_0x3a1706[_0xbf87('0xc')]){if(_0x3a1706['error'][_0xbf87('0xd')]===0x1f4){logger[_0xbf87('0xc')]('MailApplication,\x20%s,\x20%s',_0x5eee62,_0x3a1706[_0xbf87('0xc')]['message']);return _0x132be5(_0x3a1706[_0xbf87('0xc')][_0xbf87('0xe')]);}logger['error'](_0xbf87('0xf'),_0x5eee62,_0x3a1706[_0xbf87('0xc')][_0xbf87('0xe')]);return _0x45b1d4(_0x3a1706[_0xbf87('0xc')][_0xbf87('0xe')]);}else{logger[_0xbf87('0x9')]('MailApplication,\x20%s,\x20%s',_0x5eee62,_0xbf87('0xa'));_0x45b1d4(_0x3a1706['result'][_0xbf87('0xe')]);}})[_0xbf87('0x10')](function(_0x17ce1a){logger['error'](_0xbf87('0xf'),_0x5eee62,_0x17ce1a);_0x132be5(_0x17ce1a);});});}exports[_0xbf87('0x11')]=function(_0x29e307){var _0x5b8e0d=this;return new Promise(function(_0x2119c4,_0x43aa33){return db[_0xbf87('0x12')][_0xbf87('0x13')](_0x29e307[_0xbf87('0x14')],{'raw':_0x29e307['options']?_0x29e307[_0xbf87('0x15')][_0xbf87('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29e307[_0xbf87('0x15')]?_0x29e307[_0xbf87('0x15')][_0xbf87('0x17')]||null:null,'attributes':_0x29e307[_0xbf87('0x15')]?_0x29e307['options'][_0xbf87('0x18')]||null:null,'limit':_0x29e307[_0xbf87('0x15')]?_0x29e307['options'][_0xbf87('0x19')]||null:null})['then'](function(_0x5f2341){logger[_0xbf87('0x9')]('UpdateMailApplication',_0x29e307);logger[_0xbf87('0xb')](_0xbf87('0x11'),_0x29e307,JSON[_0xbf87('0x1a')](_0x5f2341));_0x2119c4(_0x5f2341);})[_0xbf87('0x10')](function(_0x44f882){logger[_0xbf87('0xc')](_0xbf87('0x11'),_0x44f882[_0xbf87('0xe')],_0x29e307);_0x43aa33(_0x5b8e0d['error'](0x1f4,_0x44f882[_0xbf87('0xe')]));});});}; \ No newline at end of file +var _0xb396=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','MailApplication','update','body','raw','options','attributes','UpdateMailApplication','lodash','util','moment'];(function(_0x5cb7dd,_0x290cfb){var _0x5ee23e=function(_0x594d25){while(--_0x594d25){_0x5cb7dd['push'](_0x5cb7dd['shift']());}};_0x5ee23e(++_0x290cfb);}(_0xb396,0x102));var _0x6b39=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb396[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6b39('0x0'));var util=require(_0x6b39('0x1'));var moment=require(_0x6b39('0x2'));var BPromise=require(_0x6b39('0x3'));var rs=require(_0x6b39('0x4'));var fs=require('fs');var Redis=require(_0x6b39('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b39('0x6'));var logger=require(_0x6b39('0x7'))('rpc');var config=require(_0x6b39('0x8'));var jayson=require(_0x6b39('0x9'));var client=jayson[_0x6b39('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1a53,_0x4a4126,_0x17e165){return new BPromise(function(_0x117387,_0x38b0fd){return client['request'](_0x4d1a53,_0x17e165)[_0x6b39('0xb')](function(_0x2cbb30){logger[_0x6b39('0xc')](_0x6b39('0xd'),_0x4a4126,'request\x20sent');logger[_0x6b39('0xe')](_0x6b39('0xf'),_0x4a4126,_0x6b39('0x10'),JSON[_0x6b39('0x11')](_0x2cbb30));if(_0x2cbb30['error']){if(_0x2cbb30['error']['code']===0x1f4){logger[_0x6b39('0x12')](_0x6b39('0xd'),_0x4a4126,_0x2cbb30['error'][_0x6b39('0x13')]);return _0x38b0fd(_0x2cbb30[_0x6b39('0x12')]['message']);}logger[_0x6b39('0x12')](_0x6b39('0xd'),_0x4a4126,_0x2cbb30[_0x6b39('0x12')]['message']);return _0x117387(_0x2cbb30[_0x6b39('0x12')][_0x6b39('0x13')]);}else{logger[_0x6b39('0xc')](_0x6b39('0xd'),_0x4a4126,_0x6b39('0x10'));_0x117387(_0x2cbb30[_0x6b39('0x14')][_0x6b39('0x13')]);}})[_0x6b39('0x15')](function(_0x3e7eb0){logger[_0x6b39('0x12')](_0x6b39('0xd'),_0x4a4126,_0x3e7eb0);_0x38b0fd(_0x3e7eb0);});});}exports['UpdateMailApplication']=function(_0x5b2ab5){var _0x1d94b8=this;return new Promise(function(_0x1706e7,_0x59558b){return db[_0x6b39('0x16')][_0x6b39('0x17')](_0x5b2ab5[_0x6b39('0x18')],{'raw':_0x5b2ab5['options']?_0x5b2ab5['options'][_0x6b39('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b2ab5[_0x6b39('0x1a')]?_0x5b2ab5['options']['where']||null:null,'attributes':_0x5b2ab5[_0x6b39('0x1a')]?_0x5b2ab5['options'][_0x6b39('0x1b')]||null:null,'limit':_0x5b2ab5['options']?_0x5b2ab5[_0x6b39('0x1a')]['limit']||null:null})[_0x6b39('0xb')](function(_0xcc76c0){logger[_0x6b39('0xc')](_0x6b39('0x1c'),_0x5b2ab5);logger[_0x6b39('0xe')](_0x6b39('0x1c'),_0x5b2ab5,JSON[_0x6b39('0x11')](_0xcc76c0));_0x1706e7(_0xcc76c0);})[_0x6b39('0x15')](function(_0x110661){logger[_0x6b39('0x12')](_0x6b39('0x1c'),_0x110661[_0x6b39('0x13')],_0x5b2ab5);_0x59558b(_0x1d94b8[_0x6b39('0x12')](0x1f4,_0x110661['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d70543d..c9ad961 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 _0x3fd5=['index','get','/describe','describe','isAuthenticated','show','/:id/messages','download','post','create','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports','express','Router','../../components/auth/service'];(function(_0x5b5c04,_0x4ec7a0){var _0x63631b=function(_0x312f60){while(--_0x312f60){_0x5b5c04['push'](_0x5b5c04['shift']());}};_0x63631b(++_0x4ec7a0);}(_0x3fd5,0xac));var _0x53fd=function(_0x1e1a6c,_0xae65bf){_0x1e1a6c=_0x1e1a6c-0x0;var _0x32d55c=_0x3fd5[_0x1e1a6c];return _0x32d55c;};'use strict';var express=require(_0x53fd('0x0'));var router=express[_0x53fd('0x1')]();var auth=require(_0x53fd('0x2'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x53fd('0x3')]);router[_0x53fd('0x4')](_0x53fd('0x5'),auth['isAuthenticated'](),controller[_0x53fd('0x6')]);router[_0x53fd('0x4')]('/:id',auth[_0x53fd('0x7')](),controller[_0x53fd('0x8')]);router['get'](_0x53fd('0x9'),auth[_0x53fd('0x7')](),controller['getMessages']);router[_0x53fd('0x4')]('/:id/download',auth[_0x53fd('0x7')](),controller[_0x53fd('0xa')]);router[_0x53fd('0xb')]('/',auth[_0x53fd('0x7')](),controller[_0x53fd('0xc')]);router[_0x53fd('0xb')]('/:id/messages',auth[_0x53fd('0x7')](),controller[_0x53fd('0xd')]);router['post']('/:id/tags',auth[_0x53fd('0x7')](),interaction[_0x53fd('0xe')](_0x53fd('0xf'),_0x53fd('0x10')),controller[_0x53fd('0x11')]);router[_0x53fd('0x12')]('/:id',auth[_0x53fd('0x7')](),interaction[_0x53fd('0xe')](_0x53fd('0xf'),_0x53fd('0x13')),controller[_0x53fd('0x14')]);router[_0x53fd('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0x53fd('0xe')](_0x53fd('0xf'),_0x53fd('0x16')),controller['destroy']);router[_0x53fd('0x15')]('/:id/tags',auth[_0x53fd('0x7')](),controller[_0x53fd('0x17')]);module[_0x53fd('0x18')]=router; \ No newline at end of file +var _0x6329=['removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','describe','get','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','delete','/:id','mailinteraction:destroy'];(function(_0x33c953,_0x1f9762){var _0x41dd49=function(_0x56d3bc){while(--_0x56d3bc){_0x33c953['push'](_0x33c953['shift']());}};_0x41dd49(++_0x1f9762);}(_0x6329,0x8e));var _0x9632=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6329[_0x3bf83f];return _0x22c4a9;};'use strict';var express=require(_0x9632('0x0'));var router=express[_0x9632('0x1')]();var auth=require(_0x9632('0x2'));var interaction=require(_0x9632('0x3'));var controller=require(_0x9632('0x4'));router['get']('/',auth[_0x9632('0x5')](),controller[_0x9632('0x6')]);router['get']('/describe',auth[_0x9632('0x5')](),controller[_0x9632('0x7')]);router[_0x9632('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9632('0x9')]);router[_0x9632('0x8')](_0x9632('0xa'),auth['isAuthenticated'](),controller[_0x9632('0xb')]);router[_0x9632('0x8')](_0x9632('0xc'),auth[_0x9632('0x5')](),controller[_0x9632('0xd')]);router[_0x9632('0xe')]('/',auth[_0x9632('0x5')](),controller[_0x9632('0xf')]);router[_0x9632('0xe')](_0x9632('0xa'),auth[_0x9632('0x5')](),controller[_0x9632('0x10')]);router[_0x9632('0xe')](_0x9632('0x11'),auth[_0x9632('0x5')](),interaction[_0x9632('0x12')](_0x9632('0x13'),_0x9632('0x14')),controller[_0x9632('0x15')]);router[_0x9632('0x16')]('/:id',auth[_0x9632('0x5')](),interaction[_0x9632('0x12')]('mail','mailinteraction:update'),controller['update']);router[_0x9632('0x17')](_0x9632('0x18'),auth['isAuthenticated'](),interaction[_0x9632('0x12')](_0x9632('0x13'),_0x9632('0x19')),controller['destroy']);router['delete'](_0x9632('0x11'),auth['isAuthenticated'](),controller[_0x9632('0x1a')]);module[_0x9632('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a4aa090..9e6d1cd 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 _0x5885=['DATE','STRING','TEXT','long','ENUM','out','BOOLEAN','sequelize','iconv','exports'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0x5885,0x1f1));var _0x5588=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5885[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5588('0x0'));var iconv=require(_0x5588('0x1'));module[_0x5588('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5588('0x3')]},'disposition':{'type':Sequelize[_0x5588('0x4')]},'secondDisposition':{'type':Sequelize[_0x5588('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5588('0x4')]},'note':{'type':Sequelize[_0x5588('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x5588('0x4')]},'cc':{'type':Sequelize[_0x5588('0x5')](_0x5588('0x6'))},'subject':{'type':Sequelize[_0x5588('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5588('0x3')]},'substatus':{'type':Sequelize[_0x5588('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x5588('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5588('0x7')]('in',_0x5588('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5588('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5588('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5588('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x9567=['BOOLEAN','DATE','ENUM','out','iconv','exports','STRING','TEXT','long'];(function(_0x3732ac,_0x1ff4d2){var _0x50aae6=function(_0x5179b2){while(--_0x5179b2){_0x3732ac['push'](_0x3732ac['shift']());}};_0x50aae6(++_0x1ff4d2);}(_0x9567,0x67));var _0x7956=function(_0x2a99f1,_0x198fd7){_0x2a99f1=_0x2a99f1-0x0;var _0x6948e5=_0x9567[_0x2a99f1];return _0x6948e5;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x7956('0x0'));module[_0x7956('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7956('0x2')]},'secondDisposition':{'type':Sequelize[_0x7956('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7956('0x2')]},'inReplyTo':{'type':Sequelize[_0x7956('0x2')](0x1fe)},'to':{'type':Sequelize[_0x7956('0x2')]},'cc':{'type':Sequelize[_0x7956('0x3')](_0x7956('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x7956('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x7956('0x6')]},'substatus':{'type':Sequelize[_0x7956('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x7956('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x7956('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7956('0x7')]('in',_0x7956('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index a8fb746..7d36ca1 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(_0x36ceb0,_0x400094){var _0x36498a=function(_0x3b0f19){while(--_0x3b0f19){_0x36ceb0['push'](_0x36ceb0['shift']());}};_0x36498a(++_0x400094);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xb10b,0x12a));var _0xbb10=function(_0x9d53fb,_0x4b898b){_0x9d53fb=_0x9d53fb-0x0;var _0x12f955=_0xb10b[_0x9d53fb];return _0x12f955;};'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 d15dcc0..47308cf 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 _0xa022=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','setDataValue','map','findAll','then','unreadMessages','length'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xa022,0x1d9));var _0x2a02=function(_0x58d47d,_0x3bf136){_0x58d47d=_0x58d47d-0x0;var _0x5a3030=_0xa022[_0x58d47d];return _0x5a3030;};'use strict';var EventEmitter=require(_0x2a02('0x0'));var MailInteraction=require(_0x2a02('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x2a02('0x1'))['db'][_0x2a02('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2a02('0x3')](0x0);var events={'afterCreate':_0x2a02('0x4'),'afterUpdate':_0x2a02('0x5'),'afterDestroy':_0x2a02('0x6')};function emitEvent(_0x5a6ebe){return function(_0x35a562,_0x22348e,_0x898dee){_0x35a562['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x28ff31){_0x35a562[_0x2a02('0x7')]('Users',_0x28ff31[_0x2a02('0x8')](function(_0x271d81){return{'id':_0x271d81['id']};}));return MailMessage[_0x2a02('0x9')]({'where':{'MailInteractionId':_0x35a562['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2a02('0xa')](function(_0x59fb5){_0x35a562[_0x2a02('0x7')](_0x2a02('0xb'),_0x59fb5[_0x2a02('0xc')]);MailInteractionEvents[_0x2a02('0xd')](_0x5a6ebe+':'+_0x35a562['id'],_0x35a562);MailInteractionEvents[_0x2a02('0xd')](_0x5a6ebe,_0x35a562);_0x898dee(null);})[_0x2a02('0xe')](_0x898dee(null));};}for(var e in events){if(events[_0x2a02('0xf')](e)){var event=events[e];MailInteraction[_0x2a02('0x10')](e,emitEvent(event));}}module[_0x2a02('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x8289=['setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','MailMessage'];(function(_0x362c21,_0x1e6c72){var _0xa75ff=function(_0x23d792){while(--_0x23d792){_0x362c21['push'](_0x362c21['shift']());}};_0xa75ff(++_0x1e6c72);}(_0x8289,0xf8));var _0x9828=function(_0xbd333a,_0x56d1ff){_0xbd333a=_0xbd333a-0x0;var _0x1f1f7e=_0x8289[_0xbd333a];return _0x1f1f7e;};'use strict';var EventEmitter=require(_0x9828('0x0'));var MailInteraction=require(_0x9828('0x1'))['db'][_0x9828('0x2')];var MailMessage=require(_0x9828('0x1'))['db'][_0x9828('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9828('0x4')](0x0);var events={'afterCreate':_0x9828('0x5'),'afterUpdate':_0x9828('0x6'),'afterDestroy':'remove'};function emitEvent(_0x3e5a97){return function(_0x302066,_0x3bfb25,_0x200696){_0x302066[_0x9828('0x7')]({'attributes':['id'],'raw':!![]})[_0x9828('0x8')](function(_0x187714){_0x302066[_0x9828('0x9')](_0x9828('0xa'),_0x187714[_0x9828('0xb')](function(_0x429101){return{'id':_0x429101['id']};}));return MailMessage[_0x9828('0xc')]({'where':{'MailInteractionId':_0x302066['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9828('0x8')](function(_0x149a14){_0x302066[_0x9828('0x9')](_0x9828('0xd'),_0x149a14[_0x9828('0xe')]);MailInteractionEvents[_0x9828('0xf')](_0x3e5a97+':'+_0x302066['id'],_0x302066);MailInteractionEvents[_0x9828('0xf')](_0x3e5a97,_0x302066);_0x200696(null);})['catch'](_0x200696(null));};}for(var e in events){if(events[_0x9828('0x10')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x9828('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 0acf06b..79baf30 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 _0xb1a1=['FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','substatus','changed','closedAt','models','get','MailMessage','update','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions','subject'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0xb1a1,0x74));var _0x1b1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb1a1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1b1a('0x0'));var util=require(_0x1b1a('0x1'));var logger=require(_0x1b1a('0x2'))(_0x1b1a('0x3'));var moment=require('moment');var BPromise=require(_0x1b1a('0x4'));var rp=require(_0x1b1a('0x5'));var fs=require('fs');var path=require(_0x1b1a('0x6'));var rimraf=require(_0x1b1a('0x7'));var config=require(_0x1b1a('0x8'));var attributes=require(_0x1b1a('0x9'));module[_0x1b1a('0xa')]=function(_0x4b0273,_0x4eab19){return _0x4b0273['define'](_0x1b1a('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x1b1a('0xc'),'fields':[_0x1b1a('0xd'),'to'],'type':_0x1b1a('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10cd2f,_0x1a5f09,_0x3ca8e8){if(_0x10cd2f['substatus']){_0x10cd2f[_0x1b1a('0xf')]=moment()[_0x1b1a('0x10')](_0x1b1a('0x11'));}if(_0x10cd2f['closed']){_0x10cd2f['closedAt']=moment()[_0x1b1a('0x10')](_0x1b1a('0x11'));}_0x3ca8e8(null,_0x1a5f09);},'beforeUpdate':function(_0x26ffd0,_0x75c7bf,_0x118fc0){if(_0x26ffd0['changed'](_0x1b1a('0x12'))){_0x26ffd0[_0x1b1a('0xf')]=_0x26ffd0['substatus']?moment()['format'](_0x1b1a('0x11')):null;}if(_0x26ffd0[_0x1b1a('0x13')]('closed')){_0x26ffd0[_0x1b1a('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x26ffd0['substatus']=null;_0x26ffd0[_0x1b1a('0xf')]=null;}_0x118fc0(null,_0x26ffd0);},'afterUpdate':function(_0x4722d7,_0x14773a,_0x354a95){var _0x43adad=_0x4b0273[_0x1b1a('0x15')];var _0x522796=_0x4722d7[_0x1b1a('0x16')]({'plain':!![]});if(_0x522796['closed']){return _0x43adad[_0x1b1a('0x17')][_0x1b1a('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x522796['id']}})['then'](function(){_0x354a95();})['catch'](function(_0x356684){_0x354a95(_0x356684);});}else{_0x354a95();}}},'charset':_0x1b1a('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x892d=['models','get','closed','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x539237,_0x112a6b){var _0x29eb9e=function(_0x173651){while(--_0x173651){_0x539237['push'](_0x539237['shift']());}};_0x29eb9e(++_0x112a6b);}(_0x892d,0x8c));var _0xd892=function(_0x5770b0,_0x190b07){_0x5770b0=_0x5770b0-0x0;var _0x2f21f4=_0x892d[_0x5770b0];return _0x2f21f4;};'use strict';var _=require('lodash');var util=require(_0xd892('0x0'));var logger=require(_0xd892('0x1'))(_0xd892('0x2'));var moment=require(_0xd892('0x3'));var BPromise=require(_0xd892('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x5ae347,_0x1a13cb){return _0x5ae347['define'](_0xd892('0x5'),attributes,{'tableName':_0xd892('0x6'),'paranoid':![],'indexes':[{'name':_0xd892('0x7'),'fields':['subject','to'],'type':_0xd892('0x8')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x212709,_0x19982d,_0x454a13){if(_0x212709[_0xd892('0x9')]){_0x212709[_0xd892('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x212709['closed']){_0x212709[_0xd892('0xb')]=moment()[_0xd892('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x454a13(null,_0x19982d);},'beforeUpdate':function(_0x422069,_0x6f2ddf,_0x92a966){if(_0x422069['changed'](_0xd892('0x9'))){_0x422069[_0xd892('0xa')]=_0x422069[_0xd892('0x9')]?moment()[_0xd892('0xc')](_0xd892('0xd')):null;}if(_0x422069['changed']('closed')){_0x422069['closedAt']=moment()['format'](_0xd892('0xd'));_0x422069['substatus']=null;_0x422069[_0xd892('0xa')]=null;}_0x92a966(null,_0x422069);},'afterUpdate':function(_0x315913,_0x3500a2,_0x534fa9){var _0x2b8521=_0x5ae347[_0xd892('0xe')];var _0x43b694=_0x315913[_0xd892('0xf')]({'plain':!![]});if(_0x43b694[_0xd892('0x10')]){return _0x2b8521['MailMessage'][_0xd892('0x11')]({'read':!![]},{'where':{'MailInteractionId':_0x43b694['id']}})[_0xd892('0x12')](function(){_0x534fa9();})[_0xd892('0x13')](function(_0x18bec3){_0x534fa9(_0x18bec3);});}else{_0x534fa9();}}},'charset':_0xd892('0x14'),'collate':_0xd892('0x15')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 5eb8feb..c42f186 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 _0x3dd7=['client','redis','localhost','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ef48d,_0x203c73){var _0x450096=function(_0x1df6b9){while(--_0x1df6b9){_0x1ef48d['push'](_0x1ef48d['shift']());}};_0x450096(++_0x203c73);}(_0x3dd7,0x1f2));var _0x73dd=function(_0x259beb,_0x4cc158){_0x259beb=_0x259beb-0x0;var _0x34e1cd=_0x3dd7[_0x259beb];return _0x34e1cd;};'use strict';var _=require('lodash');var util=require(_0x73dd('0x0'));var moment=require(_0x73dd('0x1'));var BPromise=require(_0x73dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73dd('0x3'))['db'];var utils=require(_0x73dd('0x4'));var logger=require(_0x73dd('0x5'))(_0x73dd('0x6'));var config=require(_0x73dd('0x7'));var jayson=require(_0x73dd('0x8'));var client=jayson[_0x73dd('0x9')]['http']({'port':0x232a});config[_0x73dd('0xa')]=_['defaults'](config[_0x73dd('0xa')],{'host':_0x73dd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73dd('0xa')]));require(_0x73dd('0xc'))['register'](socket);function respondWithRpcPromise(_0x10a0a9,_0x288fe3,_0x57edaa){return new BPromise(function(_0x116063,_0x42bfec){return client['request'](_0x10a0a9,_0x57edaa)[_0x73dd('0xd')](function(_0x5db71c){logger[_0x73dd('0xe')](_0x73dd('0xf'),_0x288fe3,_0x73dd('0x10'));logger[_0x73dd('0x11')](_0x73dd('0x12'),_0x288fe3,_0x73dd('0x10'),JSON[_0x73dd('0x13')](_0x5db71c));if(_0x5db71c[_0x73dd('0x14')]){if(_0x5db71c['error'][_0x73dd('0x15')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x288fe3,_0x5db71c['error'][_0x73dd('0x16')]);return _0x42bfec(_0x5db71c[_0x73dd('0x14')][_0x73dd('0x16')]);}logger[_0x73dd('0x14')](_0x73dd('0xf'),_0x288fe3,_0x5db71c[_0x73dd('0x14')][_0x73dd('0x16')]);return _0x116063(_0x5db71c['error'][_0x73dd('0x16')]);}else{logger['info'](_0x73dd('0xf'),_0x288fe3,'request\x20sent');_0x116063(_0x5db71c[_0x73dd('0x17')][_0x73dd('0x16')]);}})[_0x73dd('0x18')](function(_0x3137bd){logger[_0x73dd('0x14')](_0x73dd('0xf'),_0x288fe3,_0x3137bd);_0x42bfec(_0x3137bd);});});}exports[_0x73dd('0x19')]=function(_0x4b07b7){var _0x65eb=this;return new Promise(function(_0x5f491f,_0x103c7c){return db[_0x73dd('0x1a')]['update'](_0x4b07b7[_0x73dd('0x1b')],{'raw':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7['options'][_0x73dd('0x1e')]||null:null,'attributes':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x1f')]||null:null,'limit':_0x4b07b7[_0x73dd('0x1c')]?_0x4b07b7[_0x73dd('0x1c')][_0x73dd('0x20')]||null:null})[_0x73dd('0xd')](function(_0x21e8a6){logger[_0x73dd('0xe')](_0x73dd('0x19'),_0x4b07b7);logger[_0x73dd('0x11')](_0x73dd('0x19'),_0x4b07b7,JSON[_0x73dd('0x13')](_0x21e8a6));_0x5f491f(_0x21e8a6);})[_0x73dd('0x18')](function(_0x1b3886){logger['error'](_0x73dd('0x19'),_0x1b3886[_0x73dd('0x16')],_0x4b07b7);_0x103c7c(_0x65eb[_0x73dd('0x14')](0x1f4,_0x1b3886['message']));});});};exports[_0x73dd('0x21')]=function(_0x8d669b){return new Promise(function(_0x450548,_0x26dabe){return db[_0x73dd('0x1a')]['find']({'where':_0x8d669b[_0x73dd('0x1c')]?_0x8d669b[_0x73dd('0x1c')][_0x73dd('0x1e')]||null:null})['then'](function(_0x49acb1){if(_0x49acb1){return _0x49acb1[_0x73dd('0x22')](_0x8d669b[_0x73dd('0x1b')][_0x73dd('0x23')],_[_0x73dd('0x24')](_0x8d669b[_0x73dd('0x1b')],['ids','id'])||{});}})[_0x73dd('0x25')](function(_0x153ed9){logger[_0x73dd('0xe')](_0x73dd('0x26'),_0x8d669b);logger['debug'](_0x73dd('0x26'),_0x8d669b,JSON[_0x73dd('0x13')](_0x153ed9));_0x450548(_0x153ed9);})['catch'](function(_0x5b2741){logger['error'](_0x73dd('0x26'),_0x5b2741[_0x73dd('0x16')],_0x8d669b);_0x26dabe(_this[_0x73dd('0x14')](0x1f4,_0x5b2741[_0x73dd('0x16')]));});});}; \ No newline at end of file +var _0xd087=['request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','debug','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s'];(function(_0x39b9b3,_0x3e9a66){var _0x4977c8=function(_0x2610c9){while(--_0x2610c9){_0x39b9b3['push'](_0x39b9b3['shift']());}};_0x4977c8(++_0x3e9a66);}(_0xd087,0x6f));var _0x7d08=function(_0x2f7c44,_0x22434d){_0x2f7c44=_0x2f7c44-0x0;var _0xa27ff9=_0xd087[_0x2f7c44];return _0xa27ff9;};'use strict';var _=require(_0x7d08('0x0'));var util=require(_0x7d08('0x1'));var moment=require(_0x7d08('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d08('0x3'));var fs=require('fs');var Redis=require(_0x7d08('0x4'));var db=require(_0x7d08('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d08('0x6'))(_0x7d08('0x7'));var config=require(_0x7d08('0x8'));var jayson=require(_0x7d08('0x9'));var client=jayson['client'][_0x7d08('0xa')]({'port':0x232a});config[_0x7d08('0xb')]=_[_0x7d08('0xc')](config[_0x7d08('0xb')],{'host':_0x7d08('0xd'),'port':0x18eb});var socket=require(_0x7d08('0xe'))(new Redis(config['redis']));require(_0x7d08('0xf'))[_0x7d08('0x10')](socket);function respondWithRpcPromise(_0x5bbbf3,_0x4a596a,_0x472a43){return new BPromise(function(_0x45bd17,_0x30d932){return client[_0x7d08('0x11')](_0x5bbbf3,_0x472a43)[_0x7d08('0x12')](function(_0x53f050){logger[_0x7d08('0x13')](_0x7d08('0x14'),_0x4a596a,_0x7d08('0x15'));logger['debug'](_0x7d08('0x16'),_0x4a596a,_0x7d08('0x15'),JSON[_0x7d08('0x17')](_0x53f050));if(_0x53f050[_0x7d08('0x18')]){if(_0x53f050[_0x7d08('0x18')][_0x7d08('0x19')]===0x1f4){logger[_0x7d08('0x18')](_0x7d08('0x14'),_0x4a596a,_0x53f050[_0x7d08('0x18')][_0x7d08('0x1a')]);return _0x30d932(_0x53f050[_0x7d08('0x18')]['message']);}logger[_0x7d08('0x18')](_0x7d08('0x14'),_0x4a596a,_0x53f050[_0x7d08('0x18')][_0x7d08('0x1a')]);return _0x45bd17(_0x53f050['error'][_0x7d08('0x1a')]);}else{logger[_0x7d08('0x13')](_0x7d08('0x14'),_0x4a596a,_0x7d08('0x15'));_0x45bd17(_0x53f050[_0x7d08('0x1b')][_0x7d08('0x1a')]);}})[_0x7d08('0x1c')](function(_0x3cf9d1){logger[_0x7d08('0x18')](_0x7d08('0x14'),_0x4a596a,_0x3cf9d1);_0x30d932(_0x3cf9d1);});});}exports[_0x7d08('0x1d')]=function(_0x2eeb2f){var _0x22152e=this;return new Promise(function(_0x47e294,_0xdd82cf){return db[_0x7d08('0x1e')][_0x7d08('0x1f')](_0x2eeb2f[_0x7d08('0x20')],{'raw':_0x2eeb2f[_0x7d08('0x21')]?_0x2eeb2f[_0x7d08('0x21')][_0x7d08('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eeb2f[_0x7d08('0x21')]?_0x2eeb2f[_0x7d08('0x21')][_0x7d08('0x23')]||null:null,'attributes':_0x2eeb2f[_0x7d08('0x21')]?_0x2eeb2f['options'][_0x7d08('0x24')]||null:null,'limit':_0x2eeb2f[_0x7d08('0x21')]?_0x2eeb2f['options']['limit']||null:null})[_0x7d08('0x12')](function(_0x46fa14){logger[_0x7d08('0x13')]('UpdateMailInteraction',_0x2eeb2f);logger[_0x7d08('0x25')]('UpdateMailInteraction',_0x2eeb2f,JSON[_0x7d08('0x17')](_0x46fa14));_0x47e294(_0x46fa14);})[_0x7d08('0x1c')](function(_0x3fd4ee){logger[_0x7d08('0x18')](_0x7d08('0x1d'),_0x3fd4ee[_0x7d08('0x1a')],_0x2eeb2f);_0xdd82cf(_0x22152e[_0x7d08('0x18')](0x1f4,_0x3fd4ee['message']));});});};exports['AddTagsToMailInteraction']=function(_0x39d47f){return new Promise(function(_0x45d7f6,_0x1fc461){return db['MailInteraction'][_0x7d08('0x26')]({'where':_0x39d47f['options']?_0x39d47f[_0x7d08('0x21')][_0x7d08('0x23')]||null:null})['then'](function(_0x467119){if(_0x467119){return _0x467119[_0x7d08('0x27')](_0x39d47f[_0x7d08('0x20')][_0x7d08('0x28')],_[_0x7d08('0x29')](_0x39d47f[_0x7d08('0x20')],[_0x7d08('0x28'),'id'])||{});}})[_0x7d08('0x2a')](function(_0x14206a){logger[_0x7d08('0x13')](_0x7d08('0x2b'),_0x39d47f);logger[_0x7d08('0x25')]('AddTags',_0x39d47f,JSON[_0x7d08('0x17')](_0x14206a));_0x45d7f6(_0x14206a);})[_0x7d08('0x1c')](function(_0xd6f63c){logger[_0x7d08('0x18')](_0x7d08('0x2b'),_0xd6f63c[_0x7d08('0x1a')],_0x39d47f);_0x1fc461(_this[_0x7d08('0x18')](0x1f4,_0xd6f63c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 68b92f2..0cc6b0b 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 _0x4a3e=['remove','emit','removeListener','length','mailInteraction:','save'];(function(_0x5eab9b,_0x113241){var _0x16bbc5=function(_0x523fae){while(--_0x523fae){_0x5eab9b['push'](_0x5eab9b['shift']());}};_0x16bbc5(++_0x113241);}(_0x4a3e,0x17f));var _0xe4a3=function(_0x16b519,_0x52560c){_0x16b519=_0x16b519-0x0;var _0x40e913=_0x4a3e[_0x16b519];return _0x40e913;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xe4a3('0x0'),_0xe4a3('0x1'),'update'];function createListener(_0x461aa0,_0x246dad){return function(_0x1572e6){_0x246dad[_0xe4a3('0x2')](_0x461aa0,_0x1572e6);};}function removeListener(_0x5e260a,_0x280c11){return function(){MailInteractionEvents[_0xe4a3('0x3')](_0x5e260a,_0x280c11);};}exports['register']=function(_0x8a1b98){for(var _0x5207f5=0x0,_0x2fbf7a=events[_0xe4a3('0x4')];_0x5207f5<_0x2fbf7a;_0x5207f5++){var _0x332f01=events[_0x5207f5];var _0x3c7d64=createListener(_0xe4a3('0x5')+_0x332f01,_0x8a1b98);MailInteractionEvents['on'](_0x332f01,_0x3c7d64);}}; \ No newline at end of file +var _0x5710=['save','update','emit','removeListener','register','./mailInteraction.events'];(function(_0x5c2f30,_0x25c8d9){var _0x500aa7=function(_0x4b769a){while(--_0x4b769a){_0x5c2f30['push'](_0x5c2f30['shift']());}};_0x500aa7(++_0x25c8d9);}(_0x5710,0x1c7));var _0x0571=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5710[_0x618414];return _0x21c19a;};'use strict';var MailInteractionEvents=require(_0x0571('0x0'));var events=[_0x0571('0x1'),'remove',_0x0571('0x2')];function createListener(_0x493632,_0x3d5735){return function(_0x1b5851){_0x3d5735[_0x0571('0x3')](_0x493632,_0x1b5851);};}function removeListener(_0xf8dddf,_0x422760){return function(){MailInteractionEvents[_0x0571('0x4')](_0xf8dddf,_0x422760);};}exports[_0x0571('0x5')]=function(_0x2ba465){for(var _0x506972=0x0,_0x533625=events['length'];_0x506972<_0x533625;_0x506972++){var _0x53371b=events[_0x506972];var _0x54257a=createListener('mailInteraction:'+_0x53371b,_0x2ba465);MailInteractionEvents['on'](_0x53371b,_0x54257a);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 9cb6bf0..e141c3b 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 _0x4dd2=['/:id','update','/:id/accept','/:id/reject','reject','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','describe','show','/:id/download','post','tracked','mail','mailmessage:create','create','put'];(function(_0x2950aa,_0x44b792){var _0x16b37b=function(_0x205837){while(--_0x205837){_0x2950aa['push'](_0x2950aa['shift']());}};_0x16b37b(++_0x44b792);}(_0x4dd2,0xf1));var _0x24dd=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0x4dd2[_0xf34b0a];return _0x5021e1;};'use strict';var multer=require('multer');var util=require(_0x24dd('0x0'));var path=require(_0x24dd('0x1'));var timeout=require(_0x24dd('0x2'));var express=require('express');var router=express[_0x24dd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x24dd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x24dd('0x5'));var controller=require(_0x24dd('0x6'));router[_0x24dd('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x24dd('0x7')](_0x24dd('0x8'),auth[_0x24dd('0x9')](),controller[_0x24dd('0xa')]);router[_0x24dd('0x7')]('/:id',auth[_0x24dd('0x9')](),controller[_0x24dd('0xb')]);router[_0x24dd('0x7')](_0x24dd('0xc'),auth[_0x24dd('0x9')](),controller['download']);router[_0x24dd('0xd')]('/',auth[_0x24dd('0x9')](),interaction[_0x24dd('0xe')](_0x24dd('0xf'),_0x24dd('0x10')),controller[_0x24dd('0x11')]);router[_0x24dd('0x12')](_0x24dd('0x13'),auth['isAuthenticated'](),controller[_0x24dd('0x14')]);router['put'](_0x24dd('0x15'),auth[_0x24dd('0x9')](),controller['accept']);router['put'](_0x24dd('0x16'),auth[_0x24dd('0x9')](),controller[_0x24dd('0x17')]);router['delete'](_0x24dd('0x13'),auth['isAuthenticated'](),controller[_0x24dd('0x18')]);module[_0x24dd('0x19')]=router; \ No newline at end of file +var _0x93e6=['mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','download'];(function(_0x3c623f,_0x55efeb){var _0xcd5f57=function(_0x47b121){while(--_0x47b121){_0x3c623f['push'](_0x3c623f['shift']());}};_0xcd5f57(++_0x55efeb);}(_0x93e6,0x11e));var _0x693e=function(_0x254fed,_0x30cf21){_0x254fed=_0x254fed-0x0;var _0x480085=_0x93e6[_0x254fed];return _0x480085;};'use strict';var multer=require(_0x693e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x693e('0x1'));var express=require('express');var router=express[_0x693e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x693e('0x3'));var interaction=require(_0x693e('0x4'));var config=require(_0x693e('0x5'));var controller=require('./mailMessage.controller');router[_0x693e('0x6')]('/',auth[_0x693e('0x7')](),controller[_0x693e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x693e('0x9')]);router['get'](_0x693e('0xa'),auth[_0x693e('0x7')](),controller[_0x693e('0xb')]);router['get'](_0x693e('0xc'),auth['isAuthenticated'](),controller[_0x693e('0xd')]);router['post']('/',auth[_0x693e('0x7')](),interaction['tracked']('mail',_0x693e('0xe')),controller[_0x693e('0xf')]);router[_0x693e('0x10')](_0x693e('0xa'),auth['isAuthenticated'](),controller[_0x693e('0x11')]);router[_0x693e('0x10')](_0x693e('0x12'),auth[_0x693e('0x7')](),controller[_0x693e('0x13')]);router[_0x693e('0x10')](_0x693e('0x14'),auth['isAuthenticated'](),controller[_0x693e('0x15')]);router[_0x693e('0x16')](_0x693e('0xa'),auth['isAuthenticated'](),controller[_0x693e('0x17')]);module[_0x693e('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 9959f98..3e29948 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 _0x8bd6=['sequelize','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x8bd6,0x1e0));var _0x68bd=function(_0x5f3056,_0x3dd505){_0x5f3056=_0x5f3056-0x0;var _0x585675=_0x8bd6[_0x5f3056];return _0x585675;};'use strict';var Sequelize=require(_0x68bd('0x0'));var _=require('lodash');module[_0x68bd('0x1')]={'body':{'type':Sequelize[_0x68bd('0x2')](_0x68bd('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x68bd('0x2')](_0x68bd('0x4'))},'read':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x68bd('0x6')]('in',_0x68bd('0x7')),'defaultValue':_0x68bd('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x68bd('0x8')](0x1fe)},'from':{'type':Sequelize[_0x68bd('0x8')]},'to':{'type':Sequelize[_0x68bd('0x2')](_0x68bd('0x3'))},'cc':{'type':Sequelize[_0x68bd('0x2')]('long')},'bcc':{'type':Sequelize[_0x68bd('0x2')]('long')},'subject':{'type':Sequelize[_0x68bd('0x2')]},'sentAt':{'type':Sequelize[_0x68bd('0x9')]},'attach':{'type':Sequelize[_0x68bd('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x68bd('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x68bd('0x2')](_0x68bd('0x3'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x68bd('0x6')]('Email','Chat'),'defaultValue':_0x68bd('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x153f=['long','medium','out','STRING','DATE','BOOLEAN','ENUM','Chat','Email','sequelize','lodash','exports','TEXT'];(function(_0x550230,_0x316076){var _0x13f7c9=function(_0x2efd47){while(--_0x2efd47){_0x550230['push'](_0x550230['shift']());}};_0x13f7c9(++_0x316076);}(_0x153f,0x10d));var _0xf153=function(_0x43e27c,_0x3e5667){_0x43e27c=_0x43e27c-0x0;var _0x3f2482=_0x153f[_0x43e27c];return _0x3f2482;};'use strict';var Sequelize=require(_0xf153('0x0'));var _=require(_0xf153('0x1'));module[_0xf153('0x2')]={'body':{'type':Sequelize[_0xf153('0x3')](_0xf153('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf153('0x3')](_0xf153('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf153('0x6')),'defaultValue':_0xf153('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xf153('0x7')]},'to':{'type':Sequelize[_0xf153('0x3')](_0xf153('0x4'))},'cc':{'type':Sequelize['TEXT'](_0xf153('0x4'))},'bcc':{'type':Sequelize[_0xf153('0x3')]('long')},'subject':{'type':Sequelize[_0xf153('0x3')]},'sentAt':{'type':Sequelize[_0xf153('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf153('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf153('0x8')]},'originTo':{'type':Sequelize[_0xf153('0x3')](_0xf153('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0xf153('0x4'))},'originChannel':{'type':Sequelize[_0xf153('0xa')]('Email',_0xf153('0xb')),'defaultValue':_0xf153('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 58f193f..4a39581 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 _0x486d=['List','CmContact','MailServerOut','Smtp','host','port','secure','auth','user','pass','service','join','attachments','Contacts','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','read','UserId','agent','get','MailInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','accept','fromString','EventManager','acceptmessage','reject','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','event','rejectmessage','download','unix','toString','server','files','root','message-%s.eml','from','bcc','createdAt','Attachment','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','jayson/promise','client','http','info','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','json','offset','undefined','count','limit','status','set','Content-Range','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','fields','update','body','find','describe','create','out','split','findOne','MailAccountId'];(function(_0x564644,_0x464acb){var _0x2c70f7=function(_0x3f14b5){while(--_0x3f14b5){_0x564644['push'](_0x564644['shift']());}};_0x2c70f7(++_0x464acb);}(_0x486d,0xea));var _0xd486=function(_0x253517,_0x4047e1){_0x253517=_0x253517-0x0;var _0x5b5960=_0x486d[_0x253517];return _0x5b5960;};'use strict';var emlformat=require(_0xd486('0x0'));var moment=require(_0xd486('0x1'));var BPromise=require(_0xd486('0x2'));var util=require(_0xd486('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xd486('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xd486('0x5'));var qs=require(_0xd486('0x6'));var logger=require(_0xd486('0x7'))(_0xd486('0x8'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0xd486('0x9'));var db=require(_0xd486('0xa'))['db'];config[_0xd486('0xb')]=_['defaults'](config[_0xd486('0xb')],{'host':_0xd486('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd486('0xb')]));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xd486('0xd'));var client=jayson[_0xd486('0xe')]['http']({'port':0x232c});var client9003=jayson[_0xd486('0xe')]['http']({'port':0x232b});var client9002=jayson[_0xd486('0xe')][_0xd486('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x5771f2,_0x3fe144,_0x17259f,_0x2e4f61){return new BPromise(function(_0xa65cd6,_0x2c2d55){var _0x43c27f=_0x2e4f61||client;return _0x43c27f['request'](_0x5771f2,_0x17259f)['then'](function(_0x10352f){logger[_0xd486('0x10')]('MailMessage,\x20%s,\x20%s',_0x3fe144,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x3fe144,_0xd486('0x11'),JSON[_0xd486('0x12')](_0x10352f));if(_0x10352f['error']){if(_0x10352f[_0xd486('0x13')][_0xd486('0x14')]===0x1f4){logger[_0xd486('0x13')](_0xd486('0x15'),_0x3fe144,_0x10352f[_0xd486('0x13')]['message']);return _0x2c2d55(_0x10352f[_0xd486('0x13')]['message']);}logger[_0xd486('0x13')](_0xd486('0x15'),_0x3fe144,_0x10352f[_0xd486('0x13')][_0xd486('0x16')]);return _0xa65cd6(_0x10352f[_0xd486('0x13')]['message']);}else{logger[_0xd486('0x10')]('MailMessage,\x20%s,\x20%s',_0x3fe144,_0xd486('0x11'));_0xa65cd6(_0x10352f[_0xd486('0x17')]['message']);}})[_0xd486('0x18')](function(_0x3b1650){logger[_0xd486('0x13')](_0xd486('0x15'),_0x3fe144,_0x3b1650);_0x2c2d55(_0x3b1650);});});}function respondWithResult(_0x28674e,_0x4bdd44){_0x4bdd44=_0x4bdd44||0xc8;return function(_0x524ce9){if(_0x524ce9){return _0x28674e['status'](_0x4bdd44)[_0xd486('0x19')](_0x524ce9);}};}function respondWithFilteredResult(_0x18cda5,_0x5990c4){return function(_0x38a38c){if(_0x38a38c){var _0xf39078=typeof _0x5990c4[_0xd486('0x1a')]==='undefined'&&typeof _0x5990c4['limit']===_0xd486('0x1b');var _0xdc7533=_0x38a38c['count'];var _0x10b6c4=_0xf39078?0x0:_0x5990c4[_0xd486('0x1a')];var _0x41b999=_0xf39078?_0x38a38c[_0xd486('0x1c')]:_0x5990c4[_0xd486('0x1a')]+_0x5990c4[_0xd486('0x1d')];var _0x3d50cb;if(_0x41b999>=_0xdc7533){_0x41b999=_0xdc7533;_0x3d50cb=0xc8;}else{_0x3d50cb=0xce;}_0x18cda5[_0xd486('0x1e')](_0x3d50cb);return _0x18cda5[_0xd486('0x1f')](_0xd486('0x20'),_0x10b6c4+'-'+_0x41b999+'/'+_0xdc7533)[_0xd486('0x19')](_0x38a38c);}return null;};}function saveUpdates(_0x11b912){return function(_0x53722e){if(_0x53722e){return _0x53722e['update'](_0x11b912)[_0xd486('0x21')](function(_0x5c97ad){return _0x5c97ad;});}return null;};}function removeEntity(_0x2454fc){return function(_0x11556d){if(_0x11556d){return _0x11556d[_0xd486('0x22')]()[_0xd486('0x21')](function(){_0x2454fc[_0xd486('0x1e')](0xcc)[_0xd486('0x23')]();});}};}function handleEntityNotFound(_0x11c6da){return function(_0x156bd9){if(!_0x156bd9){_0x11c6da[_0xd486('0x24')](0x194);}return _0x156bd9;};}function handleError(_0xbe6d83,_0x10b59c){_0x10b59c=_0x10b59c||0x1f4;return function(_0x1ac5ef){logger['error'](_0x1ac5ef[_0xd486('0x25')]);if(_0x1ac5ef[_0xd486('0x26')]){delete _0x1ac5ef['name'];}_0xbe6d83[_0xd486('0x1e')](_0x10b59c)[_0xd486('0x27')](_0x1ac5ef);};}exports[_0xd486('0x28')]=function(_0xd8fcc8,_0x510fcb){var _0x2acac4={},_0x9a1858={},_0x58276b={'count':0x0,'rows':[]};var _0x28ac7a=_[_0xd486('0x29')](db[_0xd486('0x2a')][_0xd486('0x2b')],function(_0x4a7d36){return{'name':_0x4a7d36['fieldName'],'type':_0x4a7d36[_0xd486('0x2c')][_0xd486('0x2d')]};});_0x9a1858[_0xd486('0x2e')]=_[_0xd486('0x29')](_0x28ac7a,'name');_0x9a1858[_0xd486('0x2f')]=_[_0xd486('0x30')](_0xd8fcc8[_0xd486('0x2f')]);_0x9a1858[_0xd486('0x31')]=_[_0xd486('0x32')](_0x9a1858[_0xd486('0x2e')],_0x9a1858[_0xd486('0x2f')]);_0x2acac4[_0xd486('0x33')]=_[_0xd486('0x32')](_0x9a1858['model'],qs['fields'](_0xd8fcc8['query']['fields']));_0x2acac4[_0xd486('0x33')]=_0x2acac4[_0xd486('0x33')][_0xd486('0x34')]?_0x2acac4[_0xd486('0x33')]:_0x9a1858[_0xd486('0x2e')];if(!_0xd8fcc8['query'][_0xd486('0x35')](_0xd486('0x36'))){_0x2acac4[_0xd486('0x1d')]=qs['limit'](_0xd8fcc8[_0xd486('0x2f')][_0xd486('0x1d')]);_0x2acac4[_0xd486('0x1a')]=qs[_0xd486('0x1a')](_0xd8fcc8[_0xd486('0x2f')]['offset']);}_0x2acac4[_0xd486('0x37')]=qs[_0xd486('0x38')](_0xd8fcc8[_0xd486('0x2f')]['sort']);_0x2acac4[_0xd486('0x39')]=qs[_0xd486('0x31')](_[_0xd486('0x3a')](_0xd8fcc8[_0xd486('0x2f')],_0x9a1858[_0xd486('0x31')]),_0x28ac7a);if(_0xd8fcc8[_0xd486('0x2f')][_0xd486('0x3b')]){_0x2acac4['where']=_[_0xd486('0x3c')](_0x2acac4[_0xd486('0x39')],{'$or':_[_0xd486('0x29')](_0x28ac7a,function(_0x32d48a){if(_0x32d48a[_0xd486('0x2c')]!==_0xd486('0x3d')){var _0x2a2e2e={};_0x2a2e2e[_0x32d48a[_0xd486('0x26')]]={'$like':'%'+_0xd8fcc8[_0xd486('0x2f')][_0xd486('0x3b')]+'%'};return _0x2a2e2e;}})});}_0x2acac4=_[_0xd486('0x3c')]({},_0x2acac4,_0xd8fcc8[_0xd486('0x3e')]);var _0x46b358={'where':_0x2acac4[_0xd486('0x39')]};return db['MailMessage'][_0xd486('0x1c')](_0x46b358)[_0xd486('0x21')](function(_0x27ad39){_0x58276b['count']=_0x27ad39;if(_0xd8fcc8[_0xd486('0x2f')]['includeAll']){_0x2acac4[_0xd486('0x3f')]=[{'all':!![]}];}return db['MailMessage'][_0xd486('0x40')](_0x2acac4);})[_0xd486('0x21')](function(_0x100422){_0x58276b[_0xd486('0x41')]=_0x100422;return _0x58276b;})['then'](respondWithFilteredResult(_0x510fcb,_0x2acac4))[_0xd486('0x18')](handleError(_0x510fcb,null));};exports[_0xd486('0x42')]=function(_0x3764b2,_0x10a5d2){var _0x3da748={'raw':!![],'where':{'id':_0x3764b2[_0xd486('0x43')]['id']}},_0x3c12bd={};_0x3c12bd[_0xd486('0x2e')]=_[_0xd486('0x30')](db[_0xd486('0x2a')][_0xd486('0x2b')]);_0x3c12bd['query']=_['keys'](_0x3764b2['query']);_0x3c12bd[_0xd486('0x31')]=_[_0xd486('0x32')](_0x3c12bd['model'],_0x3c12bd['query']);_0x3da748['attributes']=_[_0xd486('0x32')](_0x3c12bd['model'],qs[_0xd486('0x44')](_0x3764b2[_0xd486('0x2f')][_0xd486('0x44')]));_0x3da748['attributes']=_0x3da748['attributes'][_0xd486('0x34')]?_0x3da748[_0xd486('0x33')]:_0x3c12bd[_0xd486('0x2e')];if(_0x3764b2[_0xd486('0x2f')]['includeAll']){_0x3da748[_0xd486('0x3f')]=[{'all':!![]}];}_0x3da748=_[_0xd486('0x3c')]({},_0x3da748,_0x3764b2[_0xd486('0x3e')]);return db[_0xd486('0x2a')]['find'](_0x3da748)['then'](handleEntityNotFound(_0x10a5d2,null))[_0xd486('0x21')](respondWithResult(_0x10a5d2,null))[_0xd486('0x18')](handleError(_0x10a5d2,null));};exports[_0xd486('0x45')]=function(_0x4e54ec,_0x51ef4b){if(_0x4e54ec[_0xd486('0x46')]['id']){delete _0x4e54ec[_0xd486('0x46')]['id'];}return db[_0xd486('0x2a')][_0xd486('0x47')]({'where':{'id':_0x4e54ec[_0xd486('0x43')]['id']}})[_0xd486('0x21')](handleEntityNotFound(_0x51ef4b,null))['then'](saveUpdates(_0x4e54ec[_0xd486('0x46')],null))[_0xd486('0x21')](respondWithResult(_0x51ef4b,null))['catch'](handleError(_0x51ef4b,null));};exports[_0xd486('0x22')]=function(_0x436f27,_0x235cfe){return db[_0xd486('0x2a')]['find']({'where':{'id':_0x436f27[_0xd486('0x43')]['id']}})['then'](handleEntityNotFound(_0x235cfe,null))[_0xd486('0x21')](removeEntity(_0x235cfe,null))['catch'](handleError(_0x235cfe,null));};exports[_0xd486('0x48')]=function(_0x50c313,_0x30343a){return db[_0xd486('0x2a')][_0xd486('0x48')]()[_0xd486('0x21')](respondWithResult(_0x30343a,null))[_0xd486('0x18')](handleError(_0x30343a,null));};exports[_0xd486('0x49')]=function(_0x3bb9ce,_0x2727ed){return db[_0xd486('0x2a')][_0xd486('0x49')](_0x3bb9ce[_0xd486('0x46')])[_0xd486('0x21')](function(_0x340050){if(_0x340050){if(_0x340050['direction']===_0xd486('0x4a')&&!_0x340050['secret']){var _0x40df35,_0x2e4133,_0x410bdc;if(_0x3bb9ce[_0xd486('0x46')]['to']){_0x2e4133=_0x3bb9ce[_0xd486('0x46')]['to'][_0xd486('0x4b')](',')[0x0];}return db['MailAccount'][_0xd486('0x4c')]({'where':{'id':_0x340050[_0xd486('0x4d')]},'include':[{'model':db['CmList'],'as':_0xd486('0x4e'),'include':[{'model':db[_0xd486('0x4f')],'as':'Contacts','where':{'email':_0x2e4133},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xd486('0x50')],'as':_0xd486('0x51'),'raw':!![]}]})[_0xd486('0x21')](function(_0x4ab5b9){_0x40df35=_0x4ab5b9;if(_0x40df35&&_0x40df35['Smtp']){var _0xba4c9={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x40df35['Smtp']['service'])){_0xba4c9[_0xd486('0x52')]=_0x40df35[_0xd486('0x51')][_0xd486('0x52')];_0xba4c9[_0xd486('0x53')]=_0x40df35[_0xd486('0x51')][_0xd486('0x53')];_0xba4c9[_0xd486('0x54')]=_0x40df35[_0xd486('0x51')][_0xd486('0x54')];if(_0x40df35[_0xd486('0x51')]['authentication']){_0xba4c9[_0xd486('0x55')]={'user':_0x40df35[_0xd486('0x51')][_0xd486('0x56')],'pass':_0x40df35[_0xd486('0x51')][_0xd486('0x57')]};}}else{_0xba4c9[_0xd486('0x58')]=_0x40df35[_0xd486('0x51')][_0xd486('0x58')];_0xba4c9[_0xd486('0x55')]={'user':_0x40df35[_0xd486('0x51')]['user'],'pass':_0x40df35[_0xd486('0x51')][_0xd486('0x57')]};_0xba4c9[_0xd486('0x54')]=_0x40df35['Smtp'][_0xd486('0x54')];}if(_0x3bb9ce[_0xd486('0x46')]['attachments']&&_0x3bb9ce[_0xd486('0x46')]['attachments'][_0xd486('0x34')]){for(var _0x30d632=0x0;_0x30d632<_0x3bb9ce['body']['attachments'][_0xd486('0x34')];_0x30d632+=0x1){_0x3bb9ce[_0xd486('0x46')]['attachments'][_0x30d632]={'filename':_0x3bb9ce['body']['attachments'][_0x30d632][_0xd486('0x26')],'path':path[_0xd486('0x59')](config['root'],'server/files/attachments',_0x3bb9ce[_0xd486('0x46')][_0xd486('0x5a')][_0x30d632]['basename'])};}}_0x410bdc={'account':_0xba4c9,'message':_0x3bb9ce[_0xd486('0x46')]};return;}})[_0xd486('0x21')](function(){if(_0x40df35[_0xd486('0x4e')]){if(_0x40df35[_0xd486('0x4e')]['Contacts'][_0xd486('0x34')]){return _0x40df35[_0xd486('0x4e')][_0xd486('0x5b')][0x0];}else{return db[_0xd486('0x4f')]['create'](_['defaults'](_0x3bb9ce['body'],{'firstName':_0x3bb9ce[_0xd486('0x46')]['to'],'email':_0x3bb9ce[_0xd486('0x46')]['to'],'phone':_0x3bb9ce[_0xd486('0x46')]['to'],'ListId':_0x40df35[_0xd486('0x5c')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xd486('0x21')](function(){if(_0x410bdc){return respondWithRpcPromise(_0xd486('0x5d'),'sendMail',_0x410bdc,client9003)[_0xd486('0x21')](function(_0x20a17d){return _0x340050[_0xd486('0x45')]({'read':!![],'messageId':_0x20a17d[_0xd486('0x5e')],'sentAt':moment()[_0xd486('0x5f')](_0xd486('0x60'))});})[_0xd486('0x18')](function(_0x9b761){logger[_0xd486('0x13')]('%s',JSON[_0xd486('0x12')](_0x9b761));return _0x340050;});}return _0x340050;});}return _0x340050;}})['then'](respondWithResult(_0x2727ed,0xc9))['catch'](handleError(_0x2727ed,null));};exports['accept']=function(_0x157697,_0x5a0a48){var _0x1feb0d={'agent':{},'channel':'mail'};if(_0x157697['body']['id']){delete _0x157697[_0xd486('0x46')]['id'];}_0x157697['body'][_0xd486('0x61')]=!![];_0x157697[_0xd486('0x46')]['readAt']=moment()[_0xd486('0x5f')](_0xd486('0x60'));_0x157697['body'][_0xd486('0x62')]=_0x157697['body'][_0xd486('0x62')]||_0x157697[_0xd486('0x56')]['id'];_0x1feb0d[_0xd486('0x63')]['id']=_0x157697[_0xd486('0x46')]['UserId'];return db[_0xd486('0x2a')][_0xd486('0x47')]({'where':{'id':_0x157697['params']['id'],'UserId':null}})[_0xd486('0x21')](handleEntityNotFound(_0x5a0a48,null))[_0xd486('0x21')](saveUpdates(_0x157697[_0xd486('0x46')],null))[_0xd486('0x21')](function(_0x112b9c){if(_0x112b9c){_0x1feb0d[_0xd486('0x16')]=_0x112b9c[_0xd486('0x64')]({'plain':!![]});return db[_0xd486('0x65')]['find']({'where':{'id':_0x112b9c['MailInteractionId']}});}return null;})[_0xd486('0x21')](handleEntityNotFound(_0x5a0a48,null))['then'](function(_0x2edfe2){if(_0x2edfe2){return _0x2edfe2[_0xd486('0x45')]({'UserId':_0x157697['body']['UserId'],'read1stAt':_[_0xd486('0x66')](_0x2edfe2[_0xd486('0x67')])?moment()['format'](_0xd486('0x60')):undefined});}return null;})[_0xd486('0x21')](function(_0x1d5093){if(_0x1d5093){_0x1feb0d[_0xd486('0x68')]=_0x1d5093[_0xd486('0x64')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x157697['user']['id'],_0x157697[_0xd486('0x56')][_0xd486('0x26')],_0x157697[_0xd486('0x56')][_0xd486('0x69')],_0x1feb0d[_0xd486('0x68')]['id'],_0x157697[_0xd486('0x46')]?JSON['stringify'](_0x157697['body']):_0xd486('0x6a'));return respondWithRpcPromise(_0xd486('0x6b'),_0xd486('0x6c'),_0x1feb0d);}return null;})['then'](function(_0x4020f3){var _0x31f9cf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4020f3[_0xd486('0x16')][_0xd486('0x6d')];return db[_0xd486('0x6e')][_0xd486('0x2f')](_0x31f9cf,{'type':db[_0xd486('0x6f')][_0xd486('0x70')][_0xd486('0x71')],'raw':!![]})['then'](function(_0x54b001){return _0x54b001;});})[_0xd486('0x21')](function(_0x759361){if(_0x759361){_0x1feb0d[_0xd486('0x16')][_0xd486('0x72')]=_0x759361[0x0];if(!_0x157697[_0xd486('0x46')][_0xd486('0x62')])return;return db[_0xd486('0x73')][_0xd486('0x47')]({'where':{'id':_0x157697['body'][_0xd486('0x62')],'role':_0xd486('0x63')},'attributes':['id','name',_0xd486('0x74'),'email',_0xd486('0x75')],'raw':!![]});}return null;})['then'](function(_0xf5e04){if(!_0xf5e04)return null;_0x1feb0d[_0xd486('0x16')][_0xd486('0x63')]=_0xf5e04;return _0x1feb0d;})[_0xd486('0x21')](function(_0x30ca53){if(_0x30ca53){if(_0x157697['body'][_0xd486('0x76')]){_0x1feb0d['message']['interface']=util[_0xd486('0x5f')](_0xd486('0x77'),_0x157697[_0xd486('0x56')]['name']);_0x1feb0d[_0xd486('0x16')][_0xd486('0x78')]=_0x1feb0d[_0xd486('0x78')];_0x1feb0d[_0xd486('0x16')][_0xd486('0x79')]=_0x1feb0d[_0xd486('0x78')];_0x1feb0d[_0xd486('0x16')]['event']=_0xd486('0x7a');_0x1feb0d[_0xd486('0x16')][_0xd486('0x46')]=htmlToText[_0xd486('0x7b')](_0x1feb0d[_0xd486('0x16')][_0xd486('0x46')]);return respondWithRpcPromise(_0xd486('0x7c'),_0xd486('0x7c'),{'event':_0xd486('0x7d'),'message':_0x1feb0d[_0xd486('0x16')]},client9002)[_0xd486('0x21')](function(){return _0x1feb0d;});}return _0x1feb0d;}return null;})[_0xd486('0x21')](respondWithResult(_0x5a0a48,null))[_0xd486('0x18')](handleError(_0x5a0a48,null));};exports[_0xd486('0x7e')]=function(_0x47a4b8,_0x5eb415){var _0x570ced={'agent':{},'channel':_0xd486('0x7f')};if(_0x47a4b8[_0xd486('0x46')]['id']){delete _0x47a4b8['body']['id'];}_0x47a4b8[_0xd486('0x46')][_0xd486('0x62')]=_0x47a4b8['body']['UserId']||_0x47a4b8[_0xd486('0x56')]['id'];_0x570ced['agent']['id']=_0x47a4b8['body'][_0xd486('0x62')];return db[_0xd486('0x2a')][_0xd486('0x47')]({'where':{'id':_0x47a4b8[_0xd486('0x43')]['id'],'UserId':null}})[_0xd486('0x21')](handleEntityNotFound(_0x5eb415,null))['then'](function(_0x169fda){if(_0x169fda){_0x570ced[_0xd486('0x16')]=_0x169fda[_0xd486('0x64')]({'plain':!![]});return db[_0xd486('0x65')][_0xd486('0x47')]({'where':{'id':_0x169fda[_0xd486('0x80')]}});}return null;})[_0xd486('0x21')](handleEntityNotFound(_0x5eb415,null))[_0xd486('0x21')](function(_0x18ae03){if(_0x18ae03){_0x570ced[_0xd486('0x68')]=_0x18ae03[_0xd486('0x64')]({'plain':!![]});interaction_log[_0xd486('0x10')](_0xd486('0x81'),_0x47a4b8['user']['id'],_0x47a4b8['user']['name'],_0x47a4b8[_0xd486('0x56')][_0xd486('0x69')],_0x570ced['interaction']['id'],_0x47a4b8['body']?JSON[_0xd486('0x12')](_0x47a4b8[_0xd486('0x46')]):_0xd486('0x6a'));return respondWithRpcPromise(_0xd486('0x82'),'rejectMessage',_0x570ced);}return null;})[_0xd486('0x21')](function(_0x2e2a2e){var _0x50064f=_0xd486('0x83')+_0x2e2a2e[_0xd486('0x16')][_0xd486('0x6d')];return db[_0xd486('0x6e')][_0xd486('0x2f')](_0x50064f,{'type':db[_0xd486('0x6f')]['QueryTypes'][_0xd486('0x71')],'raw':!![]})['then'](function(_0x11418d){return _0x11418d;});})['then'](function(_0x1c022e){if(_0x1c022e){_0x570ced[_0xd486('0x16')][_0xd486('0x72')]=_0x1c022e[0x0];if(!_0x47a4b8[_0xd486('0x46')][_0xd486('0x62')])return;return db['User']['find']({'where':{'id':_0x47a4b8[_0xd486('0x46')][_0xd486('0x62')],'role':'agent'},'attributes':['id','name',_0xd486('0x74'),_0xd486('0x84'),_0xd486('0x75')],'raw':!![]});}return null;})[_0xd486('0x21')](function(_0x4c7fcf){if(!_0x4c7fcf)return null;_0x570ced[_0xd486('0x16')]['agent']=_0x4c7fcf;return _0x570ced;})['then'](function(_0x3e4a41){if(_0x3e4a41){_0x3e4a41[_0xd486('0x16')]['interface']=util[_0xd486('0x5f')](_0xd486('0x77'),_0x47a4b8[_0xd486('0x56')][_0xd486('0x26')]);_0x3e4a41['message']['channel']=_0x570ced['channel'];_0x3e4a41[_0xd486('0x16')]['motionChannel']=_0x570ced['channel'];_0x3e4a41['message'][_0xd486('0x85')]=_0xd486('0x7e');_0x3e4a41[_0xd486('0x16')][_0xd486('0x46')]=htmlToText[_0xd486('0x7b')](_0x570ced[_0xd486('0x16')][_0xd486('0x46')]);respondWithRpcPromise(_0xd486('0x7c'),_0xd486('0x7c'),{'event':_0xd486('0x86'),'message':_0x3e4a41['message']},client9002);return _0x570ced;}return null;})[_0xd486('0x21')](respondWithResult(_0x5eb415,null))[_0xd486('0x18')](handleError(_0x5eb415,null));};exports[_0xd486('0x87')]=function(_0x2263d5,_0x1bb4f3){var _0x7ac065=moment()[_0xd486('0x88')]()[_0xd486('0x89')]();var _0x47c5bd=path[_0xd486('0x59')](config['root'],_0xd486('0x8a'),_0xd486('0x8b'),'tmp');var _0x1c9eb8=path[_0xd486('0x59')](config[_0xd486('0x8c')],_0xd486('0x8a'),_0xd486('0x8b'),_0xd486('0x5a'));var _0x20f923=util[_0xd486('0x5f')](_0xd486('0x8d'),_0x7ac065);return db[_0xd486('0x2a')]['find']({'where':{'id':_0x2263d5['params']['id']},'attributes':['id',_0xd486('0x46'),_0xd486('0x8e'),'to','cc',_0xd486('0x8f'),'subject',_0xd486('0x90')],'include':_0x2263d5[_0xd486('0x2f')]['attachments']?[{'model':db[_0xd486('0x91')],'as':'Attachments'}]:undefined})[_0xd486('0x21')](handleEntityNotFound(_0x1bb4f3,null))[_0xd486('0x21')](function(_0x422030){if(_0x422030){var _0x54107d=_0x422030;var _0x4b8a4a={'from':_0x54107d[_0xd486('0x8e')],'to':_0x54107d['to'],'subject':_0x54107d[_0xd486('0x92')],'html':_0x54107d['body'],'headers':{'Date':moment(_0x54107d['createdAt'])[_0xd486('0x5f')](_0xd486('0x93'))},'attachments':[]};if(_0x422030['cc']){_0x4b8a4a[_0xd486('0x94')]['Cc']=_0x422030['cc'];}if(_0x422030[_0xd486('0x8f')]){_0x4b8a4a['headers'][_0xd486('0x95')]=_0x422030[_0xd486('0x8f')];}return new BPromise(function(_0x4e2ffa,_0x20edf8){if(_0x422030[_0xd486('0x96')]){for(var _0x1020f5=0x0;_0x1020f5<_0x422030['Attachments'][_0xd486('0x34')];_0x1020f5++){var _0x49314a=_0x422030[_0xd486('0x96')][_0x1020f5];var _0x5d83d2=path[_0xd486('0x59')](_0x1c9eb8,_0x49314a['basename']);if(fs[_0xd486('0x97')](_0x5d83d2)){_0x4b8a4a[_0xd486('0x5a')][_0xd486('0x98')]({'name':_0x49314a[_0xd486('0x26')],'contentType':_0x49314a[_0xd486('0x2c')],'data':fs['readFileSync'](_0x5d83d2)});}}}emlformat[_0xd486('0x99')](_0x4b8a4a,function(_0x425f99,_0x355131){if(_0x425f99)return _0x20edf8(_0x425f99);fs[_0xd486('0x9a')](path[_0xd486('0x59')](_0x47c5bd,_0x20f923),_0x355131);return _0x4e2ffa(_0x355131);});});}})[_0xd486('0x21')](function(_0xe09849){if(_0xe09849){return _0x1bb4f3[_0xd486('0x87')](path[_0xd486('0x59')](_0x47c5bd,_0x20f923),_0x20f923,function(_0x4de852){if(!_0x4de852)fs[_0xd486('0x9b')](path[_0xd486('0x59')](_0x47c5bd,_0x20f923));});}})['catch'](handleError(_0x1bb4f3,null));}; \ No newline at end of file +var _0x0a19=['error','code','message','info','result','status','json','undefined','count','offset','set','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','keys','fields','options','find','update','body','describe','create','direction','secret','split','MailAccount','CmList','CmContact','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','basename','List','Contacts','ListId','List\x20not\x20found','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','readAt','agent','UserId','get','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','SIP/%s','rejectmessage','unix','server','tmp','files','message-%s.eml','from','bcc','Attachment','Attachments','subject','headers','Bcc','writeFileSync','download','unlinkSync','eml-format','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0a19,0x86));var _0x90a1=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x0a19[_0x55821d];return _0x58ea8a;};'use strict';var emlformat=require(_0x90a1('0x0'));var moment=require('moment');var BPromise=require(_0x90a1('0x1'));var util=require('util');var path=require(_0x90a1('0x2'));var fs=require('fs');var _=require(_0x90a1('0x3'));var Redis=require(_0x90a1('0x4'));var htmlToText=require(_0x90a1('0x5'));var qs=require(_0x90a1('0x6'));var logger=require(_0x90a1('0x7'))(_0x90a1('0x8'));var interaction_log=require(_0x90a1('0x7'))(_0x90a1('0x9'));var config=require(_0x90a1('0xa'));var db=require('../../mysqldb')['db'];config[_0x90a1('0xb')]=_[_0x90a1('0xc')](config[_0x90a1('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x90a1('0xb')]));require(_0x90a1('0xd'))[_0x90a1('0xe')](socket);var jayson=require(_0x90a1('0xf'));var client=jayson[_0x90a1('0x10')][_0x90a1('0x11')]({'port':0x232c});var client9003=jayson[_0x90a1('0x10')]['http']({'port':0x232b});var client9002=jayson['client'][_0x90a1('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x222c62,_0x14ccee,_0x55da47,_0x1fb3e6){return new BPromise(function(_0x5af29b,_0x43138f){var _0x1f5b3d=_0x1fb3e6||client;return _0x1f5b3d[_0x90a1('0x12')](_0x222c62,_0x55da47)[_0x90a1('0x13')](function(_0x3877e7){logger['info'](_0x90a1('0x14'),_0x14ccee,_0x90a1('0x15'));logger[_0x90a1('0x16')](_0x90a1('0x17'),_0x14ccee,_0x90a1('0x15'),JSON['stringify'](_0x3877e7));if(_0x3877e7[_0x90a1('0x18')]){if(_0x3877e7['error'][_0x90a1('0x19')]===0x1f4){logger[_0x90a1('0x18')](_0x90a1('0x14'),_0x14ccee,_0x3877e7[_0x90a1('0x18')][_0x90a1('0x1a')]);return _0x43138f(_0x3877e7[_0x90a1('0x18')]['message']);}logger[_0x90a1('0x18')](_0x90a1('0x14'),_0x14ccee,_0x3877e7[_0x90a1('0x18')]['message']);return _0x5af29b(_0x3877e7[_0x90a1('0x18')][_0x90a1('0x1a')]);}else{logger[_0x90a1('0x1b')](_0x90a1('0x14'),_0x14ccee,_0x90a1('0x15'));_0x5af29b(_0x3877e7[_0x90a1('0x1c')][_0x90a1('0x1a')]);}})['catch'](function(_0x985f8e){logger['error'](_0x90a1('0x14'),_0x14ccee,_0x985f8e);_0x43138f(_0x985f8e);});});}function respondWithResult(_0x9d2e6f,_0x2ff1b1){_0x2ff1b1=_0x2ff1b1||0xc8;return function(_0x2a64c4){if(_0x2a64c4){return _0x9d2e6f[_0x90a1('0x1d')](_0x2ff1b1)[_0x90a1('0x1e')](_0x2a64c4);}};}function respondWithFilteredResult(_0x4cb4e5,_0x13cd3f){return function(_0x524421){if(_0x524421){var _0x4631ac=typeof _0x13cd3f['offset']===_0x90a1('0x1f')&&typeof _0x13cd3f['limit']==='undefined';var _0x50dfd0=_0x524421[_0x90a1('0x20')];var _0x1a0d76=_0x4631ac?0x0:_0x13cd3f[_0x90a1('0x21')];var _0x70dcbe=_0x4631ac?_0x524421['count']:_0x13cd3f[_0x90a1('0x21')]+_0x13cd3f['limit'];var _0xbf0923;if(_0x70dcbe>=_0x50dfd0){_0x70dcbe=_0x50dfd0;_0xbf0923=0xc8;}else{_0xbf0923=0xce;}_0x4cb4e5[_0x90a1('0x1d')](_0xbf0923);return _0x4cb4e5[_0x90a1('0x22')]('Content-Range',_0x1a0d76+'-'+_0x70dcbe+'/'+_0x50dfd0)['json'](_0x524421);}return null;};}function saveUpdates(_0xb973fa){return function(_0x4209be){if(_0x4209be){return _0x4209be['update'](_0xb973fa)[_0x90a1('0x13')](function(_0x6fe00d){return _0x6fe00d;});}return null;};}function removeEntity(_0x2136fc){return function(_0x29d656){if(_0x29d656){return _0x29d656[_0x90a1('0x23')]()[_0x90a1('0x13')](function(){_0x2136fc[_0x90a1('0x1d')](0xcc)[_0x90a1('0x24')]();});}};}function handleEntityNotFound(_0x240956){return function(_0x34a98a){if(!_0x34a98a){_0x240956[_0x90a1('0x25')](0x194);}return _0x34a98a;};}function handleError(_0x100819,_0x18f5e3){_0x18f5e3=_0x18f5e3||0x1f4;return function(_0x2f661d){logger[_0x90a1('0x18')](_0x2f661d[_0x90a1('0x26')]);if(_0x2f661d[_0x90a1('0x27')]){delete _0x2f661d[_0x90a1('0x27')];}_0x100819['status'](_0x18f5e3)[_0x90a1('0x28')](_0x2f661d);};}exports[_0x90a1('0x29')]=function(_0x15bd93,_0x22ac5c){var _0x480441={},_0x42be42={},_0x5cf27f={'count':0x0,'rows':[]};var _0x497ca5=_[_0x90a1('0x2a')](db[_0x90a1('0x2b')]['rawAttributes'],function(_0xe12f45){return{'name':_0xe12f45[_0x90a1('0x2c')],'type':_0xe12f45[_0x90a1('0x2d')][_0x90a1('0x2e')]};});_0x42be42['model']=_['map'](_0x497ca5,'name');_0x42be42[_0x90a1('0x2f')]=_['keys'](_0x15bd93[_0x90a1('0x2f')]);_0x42be42[_0x90a1('0x30')]=_[_0x90a1('0x31')](_0x42be42[_0x90a1('0x32')],_0x42be42[_0x90a1('0x2f')]);_0x480441[_0x90a1('0x33')]=_['intersection'](_0x42be42[_0x90a1('0x32')],qs['fields'](_0x15bd93['query']['fields']));_0x480441[_0x90a1('0x33')]=_0x480441[_0x90a1('0x33')][_0x90a1('0x34')]?_0x480441[_0x90a1('0x33')]:_0x42be42[_0x90a1('0x32')];if(!_0x15bd93[_0x90a1('0x2f')][_0x90a1('0x35')](_0x90a1('0x36'))){_0x480441[_0x90a1('0x37')]=qs[_0x90a1('0x37')](_0x15bd93[_0x90a1('0x2f')][_0x90a1('0x37')]);_0x480441[_0x90a1('0x21')]=qs['offset'](_0x15bd93['query']['offset']);}_0x480441[_0x90a1('0x38')]=qs['sort'](_0x15bd93[_0x90a1('0x2f')][_0x90a1('0x39')]);_0x480441[_0x90a1('0x3a')]=qs[_0x90a1('0x30')](_['pick'](_0x15bd93[_0x90a1('0x2f')],_0x42be42[_0x90a1('0x30')]),_0x497ca5);if(_0x15bd93[_0x90a1('0x2f')]['filter']){_0x480441['where']=_[_0x90a1('0x3b')](_0x480441['where'],{'$or':_[_0x90a1('0x2a')](_0x497ca5,function(_0x3eedeb){if(_0x3eedeb[_0x90a1('0x2d')]!==_0x90a1('0x3c')){var _0x2c28d3={};_0x2c28d3[_0x3eedeb[_0x90a1('0x27')]]={'$like':'%'+_0x15bd93[_0x90a1('0x2f')][_0x90a1('0x3d')]+'%'};return _0x2c28d3;}})});}_0x480441=_[_0x90a1('0x3b')]({},_0x480441,_0x15bd93['options']);var _0x31cd6e={'where':_0x480441[_0x90a1('0x3a')]};return db[_0x90a1('0x2b')]['count'](_0x31cd6e)[_0x90a1('0x13')](function(_0x3479d7){_0x5cf27f[_0x90a1('0x20')]=_0x3479d7;if(_0x15bd93[_0x90a1('0x2f')][_0x90a1('0x3e')]){_0x480441[_0x90a1('0x3f')]=[{'all':!![]}];}return db[_0x90a1('0x2b')][_0x90a1('0x40')](_0x480441);})[_0x90a1('0x13')](function(_0x47b739){_0x5cf27f[_0x90a1('0x41')]=_0x47b739;return _0x5cf27f;})[_0x90a1('0x13')](respondWithFilteredResult(_0x22ac5c,_0x480441))[_0x90a1('0x42')](handleError(_0x22ac5c,null));};exports['show']=function(_0x258fde,_0x330c39){var _0x3e54f6={'raw':!![],'where':{'id':_0x258fde[_0x90a1('0x43')]['id']}},_0x17a49c={};_0x17a49c[_0x90a1('0x32')]=_[_0x90a1('0x44')](db['MailMessage']['rawAttributes']);_0x17a49c['query']=_[_0x90a1('0x44')](_0x258fde[_0x90a1('0x2f')]);_0x17a49c[_0x90a1('0x30')]=_[_0x90a1('0x31')](_0x17a49c[_0x90a1('0x32')],_0x17a49c['query']);_0x3e54f6[_0x90a1('0x33')]=_[_0x90a1('0x31')](_0x17a49c[_0x90a1('0x32')],qs[_0x90a1('0x45')](_0x258fde['query']['fields']));_0x3e54f6[_0x90a1('0x33')]=_0x3e54f6[_0x90a1('0x33')][_0x90a1('0x34')]?_0x3e54f6[_0x90a1('0x33')]:_0x17a49c['model'];if(_0x258fde[_0x90a1('0x2f')][_0x90a1('0x3e')]){_0x3e54f6['include']=[{'all':!![]}];}_0x3e54f6=_[_0x90a1('0x3b')]({},_0x3e54f6,_0x258fde[_0x90a1('0x46')]);return db['MailMessage'][_0x90a1('0x47')](_0x3e54f6)[_0x90a1('0x13')](handleEntityNotFound(_0x330c39,null))[_0x90a1('0x13')](respondWithResult(_0x330c39,null))[_0x90a1('0x42')](handleError(_0x330c39,null));};exports[_0x90a1('0x48')]=function(_0x4dd35a,_0xd8b3ad){if(_0x4dd35a[_0x90a1('0x49')]['id']){delete _0x4dd35a[_0x90a1('0x49')]['id'];}return db[_0x90a1('0x2b')][_0x90a1('0x47')]({'where':{'id':_0x4dd35a['params']['id']}})[_0x90a1('0x13')](handleEntityNotFound(_0xd8b3ad,null))['then'](saveUpdates(_0x4dd35a[_0x90a1('0x49')],null))[_0x90a1('0x13')](respondWithResult(_0xd8b3ad,null))['catch'](handleError(_0xd8b3ad,null));};exports[_0x90a1('0x23')]=function(_0x67bec,_0x28760e){return db[_0x90a1('0x2b')][_0x90a1('0x47')]({'where':{'id':_0x67bec[_0x90a1('0x43')]['id']}})['then'](handleEntityNotFound(_0x28760e,null))['then'](removeEntity(_0x28760e,null))['catch'](handleError(_0x28760e,null));};exports[_0x90a1('0x4a')]=function(_0x2b688c,_0x2288d1){return db[_0x90a1('0x2b')][_0x90a1('0x4a')]()[_0x90a1('0x13')](respondWithResult(_0x2288d1,null))[_0x90a1('0x42')](handleError(_0x2288d1,null));};exports[_0x90a1('0x4b')]=function(_0x4709fb,_0x4dfdce){return db[_0x90a1('0x2b')][_0x90a1('0x4b')](_0x4709fb[_0x90a1('0x49')])[_0x90a1('0x13')](function(_0x27b220){if(_0x27b220){if(_0x27b220[_0x90a1('0x4c')]==='out'&&!_0x27b220[_0x90a1('0x4d')]){var _0x47b3eb,_0xf59a60,_0x26182a;if(_0x4709fb[_0x90a1('0x49')]['to']){_0xf59a60=_0x4709fb['body']['to'][_0x90a1('0x4e')](',')[0x0];}return db[_0x90a1('0x4f')]['findOne']({'where':{'id':_0x27b220['MailAccountId']},'include':[{'model':db[_0x90a1('0x50')],'as':'List','include':[{'model':db[_0x90a1('0x51')],'as':'Contacts','where':{'email':_0xf59a60},'limit':0x1,'order':[['updatedAt',_0x90a1('0x52')]]}]},{'model':db[_0x90a1('0x53')],'as':_0x90a1('0x54'),'raw':!![]}]})[_0x90a1('0x13')](function(_0x1cdcb6){_0x47b3eb=_0x1cdcb6;if(_0x47b3eb&&_0x47b3eb[_0x90a1('0x54')]){var _0x2c92e7={'tls':{'rejectUnauthorized':![]}};if(_[_0x90a1('0x55')](_0x47b3eb[_0x90a1('0x54')][_0x90a1('0x56')])){_0x2c92e7[_0x90a1('0x57')]=_0x47b3eb[_0x90a1('0x54')][_0x90a1('0x57')];_0x2c92e7[_0x90a1('0x58')]=_0x47b3eb[_0x90a1('0x54')][_0x90a1('0x58')];_0x2c92e7[_0x90a1('0x59')]=_0x47b3eb['Smtp'][_0x90a1('0x59')];if(_0x47b3eb[_0x90a1('0x54')]['authentication']){_0x2c92e7[_0x90a1('0x5a')]={'user':_0x47b3eb['Smtp'][_0x90a1('0x5b')],'pass':_0x47b3eb[_0x90a1('0x54')]['pass']};}}else{_0x2c92e7[_0x90a1('0x56')]=_0x47b3eb[_0x90a1('0x54')][_0x90a1('0x56')];_0x2c92e7[_0x90a1('0x5a')]={'user':_0x47b3eb[_0x90a1('0x54')][_0x90a1('0x5b')],'pass':_0x47b3eb[_0x90a1('0x54')][_0x90a1('0x5c')]};_0x2c92e7['secure']=_0x47b3eb[_0x90a1('0x54')]['secure'];}if(_0x4709fb['body'][_0x90a1('0x5d')]&&_0x4709fb[_0x90a1('0x49')][_0x90a1('0x5d')][_0x90a1('0x34')]){for(var _0x17115b=0x0;_0x17115b<_0x4709fb[_0x90a1('0x49')][_0x90a1('0x5d')][_0x90a1('0x34')];_0x17115b+=0x1){_0x4709fb[_0x90a1('0x49')][_0x90a1('0x5d')][_0x17115b]={'filename':_0x4709fb[_0x90a1('0x49')]['attachments'][_0x17115b][_0x90a1('0x27')],'path':path[_0x90a1('0x5e')](config[_0x90a1('0x5f')],_0x90a1('0x60'),_0x4709fb[_0x90a1('0x49')][_0x90a1('0x5d')][_0x17115b][_0x90a1('0x61')])};}}_0x26182a={'account':_0x2c92e7,'message':_0x4709fb[_0x90a1('0x49')]};return;}})['then'](function(){if(_0x47b3eb[_0x90a1('0x62')]){if(_0x47b3eb[_0x90a1('0x62')][_0x90a1('0x63')][_0x90a1('0x34')]){return _0x47b3eb[_0x90a1('0x62')][_0x90a1('0x63')][0x0];}else{return db[_0x90a1('0x51')][_0x90a1('0x4b')](_[_0x90a1('0xc')](_0x4709fb['body'],{'firstName':_0x4709fb['body']['to'],'email':_0x4709fb['body']['to'],'phone':_0x4709fb[_0x90a1('0x49')]['to'],'ListId':_0x47b3eb[_0x90a1('0x64')]}));}}else{throw new Error(_0x90a1('0x65'));}})[_0x90a1('0x13')](function(){if(_0x26182a){return respondWithRpcPromise('SendMail','sendMail',_0x26182a,client9003)[_0x90a1('0x13')](function(_0x3797d7){return _0x27b220[_0x90a1('0x48')]({'read':!![],'messageId':_0x3797d7[_0x90a1('0x66')],'sentAt':moment()[_0x90a1('0x67')](_0x90a1('0x68'))});})['catch'](function(_0x2e5810){logger[_0x90a1('0x18')]('%s',JSON[_0x90a1('0x69')](_0x2e5810));return _0x27b220;});}return _0x27b220;});}return _0x27b220;}})[_0x90a1('0x13')](respondWithResult(_0x4dfdce,0xc9))['catch'](handleError(_0x4dfdce,null));};exports[_0x90a1('0x6a')]=function(_0x4bf9a,_0x433974){var _0x3a294c={'agent':{},'channel':_0x90a1('0x6b')};if(_0x4bf9a[_0x90a1('0x49')]['id']){delete _0x4bf9a[_0x90a1('0x49')]['id'];}_0x4bf9a[_0x90a1('0x49')]['read']=!![];_0x4bf9a[_0x90a1('0x49')][_0x90a1('0x6c')]=moment()[_0x90a1('0x67')](_0x90a1('0x68'));_0x4bf9a['body']['UserId']=_0x4bf9a[_0x90a1('0x49')]['UserId']||_0x4bf9a[_0x90a1('0x5b')]['id'];_0x3a294c[_0x90a1('0x6d')]['id']=_0x4bf9a[_0x90a1('0x49')][_0x90a1('0x6e')];return db[_0x90a1('0x2b')][_0x90a1('0x47')]({'where':{'id':_0x4bf9a[_0x90a1('0x43')]['id'],'UserId':null}})[_0x90a1('0x13')](handleEntityNotFound(_0x433974,null))[_0x90a1('0x13')](saveUpdates(_0x4bf9a[_0x90a1('0x49')],null))[_0x90a1('0x13')](function(_0x4b7c48){if(_0x4b7c48){_0x3a294c[_0x90a1('0x1a')]=_0x4b7c48[_0x90a1('0x6f')]({'plain':!![]});return db['MailInteraction'][_0x90a1('0x47')]({'where':{'id':_0x4b7c48['MailInteractionId']}});}return null;})[_0x90a1('0x13')](handleEntityNotFound(_0x433974,null))[_0x90a1('0x13')](function(_0x5d0820){if(_0x5d0820){return _0x5d0820[_0x90a1('0x48')]({'UserId':_0x4bf9a['body'][_0x90a1('0x6e')],'read1stAt':_[_0x90a1('0x55')](_0x5d0820[_0x90a1('0x70')])?moment()[_0x90a1('0x67')](_0x90a1('0x68')):undefined});}return null;})[_0x90a1('0x13')](function(_0x23a03c){if(_0x23a03c){_0x3a294c['interaction']=_0x23a03c['get']({'plain':!![]});interaction_log[_0x90a1('0x1b')](_0x90a1('0x71'),_0x4bf9a[_0x90a1('0x5b')]['id'],_0x4bf9a[_0x90a1('0x5b')][_0x90a1('0x27')],_0x4bf9a['user'][_0x90a1('0x72')],_0x3a294c['interaction']['id'],_0x4bf9a['body']?JSON['stringify'](_0x4bf9a[_0x90a1('0x49')]):_0x90a1('0x73'));return respondWithRpcPromise(_0x90a1('0x74'),_0x90a1('0x75'),_0x3a294c);}return null;})[_0x90a1('0x13')](function(_0xc9865d){var _0x2b45e2=_0x90a1('0x76')+_0xc9865d[_0x90a1('0x1a')][_0x90a1('0x77')];return db[_0x90a1('0x78')][_0x90a1('0x2f')](_0x2b45e2,{'type':db[_0x90a1('0x79')][_0x90a1('0x7a')][_0x90a1('0x7b')],'raw':!![]})[_0x90a1('0x13')](function(_0x411351){return _0x411351;});})['then'](function(_0x1097ba){if(_0x1097ba){_0x3a294c[_0x90a1('0x1a')]['contact']=_0x1097ba[0x0];if(!_0x4bf9a[_0x90a1('0x49')][_0x90a1('0x6e')])return;return db[_0x90a1('0x7c')][_0x90a1('0x47')]({'where':{'id':_0x4bf9a['body'][_0x90a1('0x6e')],'role':'agent'},'attributes':['id',_0x90a1('0x27'),_0x90a1('0x7d'),_0x90a1('0x7e'),'internal'],'raw':!![]});}return null;})[_0x90a1('0x13')](function(_0xec15c8){if(!_0xec15c8)return null;_0x3a294c[_0x90a1('0x1a')][_0x90a1('0x6d')]=_0xec15c8;return _0x3a294c;})[_0x90a1('0x13')](function(_0x2a2d9f){if(_0x2a2d9f){if(_0x4bf9a[_0x90a1('0x49')][_0x90a1('0x7f')]){_0x3a294c['message'][_0x90a1('0x80')]=util[_0x90a1('0x67')]('SIP/%s',_0x4bf9a[_0x90a1('0x5b')][_0x90a1('0x27')]);_0x3a294c[_0x90a1('0x1a')][_0x90a1('0x81')]=_0x3a294c['channel'];_0x3a294c[_0x90a1('0x1a')][_0x90a1('0x82')]=_0x3a294c[_0x90a1('0x81')];_0x3a294c[_0x90a1('0x1a')][_0x90a1('0x83')]=_0x90a1('0x6a');_0x3a294c['message']['body']=htmlToText[_0x90a1('0x84')](_0x3a294c['message'][_0x90a1('0x49')]);return respondWithRpcPromise(_0x90a1('0x85'),_0x90a1('0x85'),{'event':_0x90a1('0x86'),'message':_0x3a294c['message']},client9002)['then'](function(){return _0x3a294c;});}return _0x3a294c;}return null;})[_0x90a1('0x13')](respondWithResult(_0x433974,null))[_0x90a1('0x42')](handleError(_0x433974,null));};exports[_0x90a1('0x87')]=function(_0x4ab075,_0x24c241){var _0x456837={'agent':{},'channel':'mail'};if(_0x4ab075[_0x90a1('0x49')]['id']){delete _0x4ab075['body']['id'];}_0x4ab075[_0x90a1('0x49')][_0x90a1('0x6e')]=_0x4ab075['body'][_0x90a1('0x6e')]||_0x4ab075[_0x90a1('0x5b')]['id'];_0x456837[_0x90a1('0x6d')]['id']=_0x4ab075[_0x90a1('0x49')][_0x90a1('0x6e')];return db[_0x90a1('0x2b')][_0x90a1('0x47')]({'where':{'id':_0x4ab075['params']['id'],'UserId':null}})[_0x90a1('0x13')](handleEntityNotFound(_0x24c241,null))[_0x90a1('0x13')](function(_0x5f4793){if(_0x5f4793){_0x456837['message']=_0x5f4793['get']({'plain':!![]});return db['MailInteraction'][_0x90a1('0x47')]({'where':{'id':_0x5f4793['MailInteractionId']}});}return null;})[_0x90a1('0x13')](handleEntityNotFound(_0x24c241,null))[_0x90a1('0x13')](function(_0x42392e){if(_0x42392e){_0x456837[_0x90a1('0x88')]=_0x42392e[_0x90a1('0x6f')]({'plain':!![]});interaction_log['info'](_0x90a1('0x89'),_0x4ab075['user']['id'],_0x4ab075[_0x90a1('0x5b')][_0x90a1('0x27')],_0x4ab075[_0x90a1('0x5b')][_0x90a1('0x72')],_0x456837[_0x90a1('0x88')]['id'],_0x4ab075['body']?JSON[_0x90a1('0x69')](_0x4ab075[_0x90a1('0x49')]):_0x90a1('0x73'));return respondWithRpcPromise(_0x90a1('0x8a'),_0x90a1('0x8b'),_0x456837);}return null;})[_0x90a1('0x13')](function(_0x16c039){var _0x536315=_0x90a1('0x76')+_0x16c039['message']['ContactId'];return db[_0x90a1('0x78')]['query'](_0x536315,{'type':db['Sequelize'][_0x90a1('0x7a')][_0x90a1('0x7b')],'raw':!![]})[_0x90a1('0x13')](function(_0x445cfd){return _0x445cfd;});})['then'](function(_0x1e748e){if(_0x1e748e){_0x456837[_0x90a1('0x1a')][_0x90a1('0x8c')]=_0x1e748e[0x0];if(!_0x4ab075[_0x90a1('0x49')]['UserId'])return;return db['User'][_0x90a1('0x47')]({'where':{'id':_0x4ab075['body'][_0x90a1('0x6e')],'role':_0x90a1('0x6d')},'attributes':['id',_0x90a1('0x27'),_0x90a1('0x7d'),_0x90a1('0x7e'),'internal'],'raw':!![]});}return null;})[_0x90a1('0x13')](function(_0x18bcf4){if(!_0x18bcf4)return null;_0x456837[_0x90a1('0x1a')][_0x90a1('0x6d')]=_0x18bcf4;return _0x456837;})[_0x90a1('0x13')](function(_0x361404){if(_0x361404){_0x361404['message']['interface']=util[_0x90a1('0x67')](_0x90a1('0x8d'),_0x4ab075[_0x90a1('0x5b')]['name']);_0x361404['message'][_0x90a1('0x81')]=_0x456837['channel'];_0x361404[_0x90a1('0x1a')]['motionChannel']=_0x456837[_0x90a1('0x81')];_0x361404[_0x90a1('0x1a')][_0x90a1('0x83')]=_0x90a1('0x87');_0x361404[_0x90a1('0x1a')]['body']=htmlToText['fromString'](_0x456837[_0x90a1('0x1a')]['body']);respondWithRpcPromise(_0x90a1('0x85'),_0x90a1('0x85'),{'event':_0x90a1('0x8e'),'message':_0x361404[_0x90a1('0x1a')]},client9002);return _0x456837;}return null;})[_0x90a1('0x13')](respondWithResult(_0x24c241,null))['catch'](handleError(_0x24c241,null));};exports['download']=function(_0x7beaae,_0x5f2b36){var _0xc25521=moment()[_0x90a1('0x8f')]()['toString']();var _0x16fc4e=path[_0x90a1('0x5e')](config['root'],_0x90a1('0x90'),'files',_0x90a1('0x91'));var _0x44cdcd=path[_0x90a1('0x5e')](config[_0x90a1('0x5f')],_0x90a1('0x90'),_0x90a1('0x92'),_0x90a1('0x5d'));var _0xe217d=util[_0x90a1('0x67')](_0x90a1('0x93'),_0xc25521);return db[_0x90a1('0x2b')][_0x90a1('0x47')]({'where':{'id':_0x7beaae[_0x90a1('0x43')]['id']},'attributes':['id',_0x90a1('0x49'),_0x90a1('0x94'),'to','cc',_0x90a1('0x95'),'subject','createdAt'],'include':_0x7beaae[_0x90a1('0x2f')][_0x90a1('0x5d')]?[{'model':db[_0x90a1('0x96')],'as':_0x90a1('0x97')}]:undefined})[_0x90a1('0x13')](handleEntityNotFound(_0x5f2b36,null))[_0x90a1('0x13')](function(_0x2300c2){if(_0x2300c2){var _0x354638=_0x2300c2;var _0x4165be={'from':_0x354638[_0x90a1('0x94')],'to':_0x354638['to'],'subject':_0x354638[_0x90a1('0x98')],'html':_0x354638[_0x90a1('0x49')],'headers':{'Date':moment(_0x354638['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2300c2['cc']){_0x4165be['headers']['Cc']=_0x2300c2['cc'];}if(_0x2300c2[_0x90a1('0x95')]){_0x4165be[_0x90a1('0x99')][_0x90a1('0x9a')]=_0x2300c2[_0x90a1('0x95')];}return new BPromise(function(_0x3cd40b,_0x309acc){if(_0x2300c2[_0x90a1('0x97')]){for(var _0x26dc4c=0x0;_0x26dc4c<_0x2300c2[_0x90a1('0x97')][_0x90a1('0x34')];_0x26dc4c++){var _0x4ba35e=_0x2300c2[_0x90a1('0x97')][_0x26dc4c];var _0x3ff8c8=path[_0x90a1('0x5e')](_0x44cdcd,_0x4ba35e[_0x90a1('0x61')]);if(fs['existsSync'](_0x3ff8c8)){_0x4165be['attachments']['push']({'name':_0x4ba35e[_0x90a1('0x27')],'contentType':_0x4ba35e[_0x90a1('0x2d')],'data':fs['readFileSync'](_0x3ff8c8)});}}}emlformat['build'](_0x4165be,function(_0x1a2c28,_0x3bfb6c){if(_0x1a2c28)return _0x309acc(_0x1a2c28);fs[_0x90a1('0x9b')](path['join'](_0x16fc4e,_0xe217d),_0x3bfb6c);return _0x3cd40b(_0x3bfb6c);});});}})[_0x90a1('0x13')](function(_0x41b85a){if(_0x41b85a){return _0x5f2b36[_0x90a1('0x9c')](path[_0x90a1('0x5e')](_0x16fc4e,_0xe217d),_0xe217d,function(_0x43c588){if(!_0x43c588)fs[_0x90a1('0x9d')](path['join'](_0x16fc4e,_0xe217d));});}})['catch'](handleError(_0x5f2b36,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 452a089..7c2f3f5 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 _0x0969=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x47936b,_0x55eda3){var _0x2183d5=function(_0x3bede0){while(--_0x3bede0){_0x47936b['push'](_0x47936b['shift']());}};_0x2183d5(++_0x55eda3);}(_0x0969,0x1c5));var _0x9096=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x0969[_0x134c2e];return _0x2825db;};'use strict';var EventEmitter=require(_0x9096('0x0'));var MailMessage=require(_0x9096('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9096('0x2')](0x0);var events={'afterCreate':_0x9096('0x3'),'afterUpdate':_0x9096('0x4'),'afterDestroy':_0x9096('0x5')};function emitEvent(_0x4f0def){return function(_0x7f1c7a,_0x226b40,_0x2976b5){MailMessageEvents[_0x9096('0x6')](_0x4f0def+':'+_0x7f1c7a['id'],_0x7f1c7a);MailMessageEvents[_0x9096('0x6')](_0x4f0def,_0x7f1c7a);_0x2976b5(null);};}for(var e in events){if(events[_0x9096('0x7')](e)){var event=events[e];MailMessage[_0x9096('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xad48=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x777641,_0x19607d){var _0x54a378=function(_0x501b92){while(--_0x501b92){_0x777641['push'](_0x777641['shift']());}};_0x54a378(++_0x19607d);}(_0xad48,0x188));var _0x8ad4=function(_0x17d059,_0x912265){_0x17d059=_0x17d059-0x0;var _0x44ba97=_0xad48[_0x17d059];return _0x44ba97;};'use strict';var EventEmitter=require(_0x8ad4('0x0'));var MailMessage=require(_0x8ad4('0x1'))['db'][_0x8ad4('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x8ad4('0x3')](0x0);var events={'afterCreate':_0x8ad4('0x4'),'afterUpdate':_0x8ad4('0x5'),'afterDestroy':_0x8ad4('0x6')};function emitEvent(_0x57535d){return function(_0x11e862,_0x23a19d,_0x5006aa){MailMessageEvents[_0x8ad4('0x7')](_0x57535d+':'+_0x11e862['id'],_0x11e862);MailMessageEvents[_0x8ad4('0x7')](_0x57535d,_0x11e862);_0x5006aa(null);};}for(var e in events){if(events[_0x8ad4('0x8')](e)){var event=events[e];MailMessage[_0x8ad4('0x9')](e,emitEvent(event));}}module[_0x8ad4('0xa')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index eed812b..faca0e2 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 _0xe4a1=['bluebird','rimraf','../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','fromString','body','models','get','direction','toLowerCase','isNil','MailInteraction','findOne','then','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x11ad65,_0x352d3c){var _0x35590c=function(_0x2c3845){while(--_0x2c3845){_0x11ad65['push'](_0x11ad65['shift']());}};_0x35590c(++_0x352d3c);}(_0xe4a1,0x1c7));var _0x1e4a=function(_0x17479d,_0x593129){_0x17479d=_0x17479d-0x0;var _0x2d461c=_0xe4a1[_0x17479d];return _0x2d461c;};'use strict';var _=require(_0x1e4a('0x0'));var util=require(_0x1e4a('0x1'));var logger=require(_0x1e4a('0x2'))('api');var moment=require(_0x1e4a('0x3'));var BPromise=require(_0x1e4a('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x1e4a('0x5'));var config=require(_0x1e4a('0x6'));var attributes=require(_0x1e4a('0x7'));module['exports']=function(_0x5cbda6,_0x17fa5d){return _0x5cbda6[_0x1e4a('0x8')]('MailMessage',attributes,{'tableName':_0x1e4a('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1e4a('0xa')]},{'name':_0x1e4a('0xb'),'fields':[_0x1e4a('0xc'),'subject'],'type':_0x1e4a('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x57904e,_0xef06c6,_0x34f6db){if(_0x57904e['body']){_0x57904e[_0x1e4a('0xc')]=htmlToText[_0x1e4a('0xe')](_0x57904e[_0x1e4a('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x34f6db(null,_0xef06c6);},'afterCreate':function(_0x334b4b,_0x51655b,_0xf8cb26){var _0x4628eb=_0x5cbda6[_0x1e4a('0x10')];var _0x16b02c=_0x334b4b[_0x1e4a('0x11')]({'plain':!![]});if(_0x16b02c[_0x1e4a('0x12')][_0x1e4a('0x13')]()==='in'||_0x16b02c[_0x1e4a('0x12')]['toLowerCase']()==='out'&&!_0x16b02c['secret']&&!_[_0x1e4a('0x14')](_0x16b02c['UserId'])){_0x4628eb[_0x1e4a('0x15')][_0x1e4a('0x16')]({'where':{'id':_0x16b02c['MailInteractionId']}})[_0x1e4a('0x17')](function(_0x59e7fd){if(_0x59e7fd){_0x59e7fd['update']({'lastMsgAt':_0x16b02c[_0x1e4a('0x18')],'lastMsgDirection':_0x16b02c[_0x1e4a('0x12')]['toLowerCase']()});}})['catch'](function(_0x5217b0){console['error'](_0x5217b0);});}_0xf8cb26();}},'charset':_0x1e4a('0x19'),'collate':_0x1e4a('0x1a')});}; \ No newline at end of file +var _0x1e14=['define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','out','UserId','MailInteraction','MailInteractionId','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x8872e8,_0x505470){var _0x52c22a=function(_0x4f658b){while(--_0x4f658b){_0x8872e8['push'](_0x8872e8['shift']());}};_0x52c22a(++_0x505470);}(_0x1e14,0x12e));var _0x41e1=function(_0x5ba582,_0x41e27e){_0x5ba582=_0x5ba582-0x0;var _0x5da022=_0x1e14[_0x5ba582];return _0x5da022;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x41e1('0x0'))('api');var moment=require('moment');var BPromise=require(_0x41e1('0x1'));var rp=require(_0x41e1('0x2'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x41e1('0x3'));var rimraf=require('rimraf');var config=require(_0x41e1('0x4'));var attributes=require('./mailMessage.attributes');module[_0x41e1('0x5')]=function(_0xd5cd81,_0x552eda){return _0xd5cd81[_0x41e1('0x6')](_0x41e1('0x7'),attributes,{'tableName':_0x41e1('0x8'),'paranoid':![],'indexes':[{'name':_0x41e1('0x9'),'fields':['messageId']},{'name':_0x41e1('0xa'),'fields':[_0x41e1('0xb'),_0x41e1('0xc')],'type':_0x41e1('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xfce922,_0x51ffd7,_0x1e56e2){if(_0xfce922[_0x41e1('0xe')]){_0xfce922['plainBody']=htmlToText[_0x41e1('0xf')](_0xfce922[_0x41e1('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1e56e2(null,_0x51ffd7);},'afterCreate':function(_0x36aa99,_0x481f49,_0x5e0552){var _0x21bb4d=_0xd5cd81[_0x41e1('0x10')];var _0x394be4=_0x36aa99['get']({'plain':!![]});if(_0x394be4[_0x41e1('0x11')]['toLowerCase']()==='in'||_0x394be4[_0x41e1('0x11')][_0x41e1('0x12')]()===_0x41e1('0x13')&&!_0x394be4['secret']&&!_['isNil'](_0x394be4[_0x41e1('0x14')])){_0x21bb4d[_0x41e1('0x15')]['findOne']({'where':{'id':_0x394be4[_0x41e1('0x16')]}})[_0x41e1('0x17')](function(_0x1a339b){if(_0x1a339b){_0x1a339b['update']({'lastMsgAt':_0x394be4[_0x41e1('0x18')],'lastMsgDirection':_0x394be4[_0x41e1('0x11')][_0x41e1('0x12')]()});}})['catch'](function(_0x164369){console[_0x41e1('0x19')](_0x164369);});}_0x5e0552();}},'charset':_0x41e1('0x1a'),'collate':_0x41e1('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 2010dd0..6da560c 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 _0x0972=['message','catch','CreateMailMessage','MailMessage','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14b62c,_0x23d29f){var _0x36f174=function(_0x32e66d){while(--_0x32e66d){_0x14b62c['push'](_0x14b62c['shift']());}};_0x36f174(++_0x23d29f);}(_0x0972,0x64));var _0x2097=function(_0x33b9c6,_0x2837c8){_0x33b9c6=_0x33b9c6-0x0;var _0x50e998=_0x0972[_0x33b9c6];return _0x50e998;};'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});config[_0x2097('0xa')]=_['defaults'](config[_0x2097('0xa')],{'host':_0x2097('0xb'),'port':0x18eb});var socket=require(_0x2097('0xc'))(new Redis(config[_0x2097('0xa')]));require(_0x2097('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e0024,_0x3b8b76,_0x131f06){return new BPromise(function(_0x430754,_0x7baeb3){return client[_0x2097('0xe')](_0x2e0024,_0x131f06)[_0x2097('0xf')](function(_0x1d1166){logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));logger[_0x2097('0x13')](_0x2097('0x14'),_0x3b8b76,_0x2097('0x12'),JSON[_0x2097('0x15')](_0x1d1166));if(_0x1d1166[_0x2097('0x16')]){if(_0x1d1166[_0x2097('0x16')][_0x2097('0x17')]===0x1f4){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x1d1166['error'][_0x2097('0x18')]);return _0x7baeb3(_0x1d1166[_0x2097('0x16')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3b8b76,_0x1d1166[_0x2097('0x16')]['message']);return _0x430754(_0x1d1166[_0x2097('0x16')][_0x2097('0x18')]);}else{logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));_0x430754(_0x1d1166['result'][_0x2097('0x18')]);}})[_0x2097('0x19')](function(_0x451584){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x451584);_0x7baeb3(_0x451584);});});}exports[_0x2097('0x1a')]=function(_0x253f5d){var _0x46b5e0=this;return new Promise(function(_0x5d8b9e,_0x4d957e){return db[_0x2097('0x1b')]['create'](_0x253f5d[_0x2097('0x1c')],{'raw':_0x253f5d[_0x2097('0x1d')]?_0x253f5d['options'][_0x2097('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x2e17c8){logger[_0x2097('0x10')](_0x2097('0x1a'),_0x253f5d);logger[_0x2097('0x13')](_0x2097('0x1a'),_0x253f5d,JSON[_0x2097('0x15')](_0x2e17c8));_0x5d8b9e(_0x2e17c8);})['catch'](function(_0xae5f9){logger['error'](_0x2097('0x1a'),_0xae5f9[_0x2097('0x18')],_0x253f5d);_0x4d957e(_0x46b5e0[_0x2097('0x16')](0x1f4,_0xae5f9[_0x2097('0x18')]));});});}; \ No newline at end of file +var _0x3266=['result','catch','CreateMailMessage','MailMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4fda88,_0x1a4d19){var _0xe37511=function(_0x51f461){while(--_0x51f461){_0x4fda88['push'](_0x4fda88['shift']());}};_0xe37511(++_0x1a4d19);}(_0x3266,0x6a));var _0x6326=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3266[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));var BPromise=require(_0x6326('0x3'));var rs=require(_0x6326('0x4'));var fs=require('fs');var Redis=require(_0x6326('0x5'));var db=require(_0x6326('0x6'))['db'];var utils=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('rpc');var config=require(_0x6326('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6326('0xa')][_0x6326('0xb')]({'port':0x232a});config[_0x6326('0xc')]=_['defaults'](config[_0x6326('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6326('0xd'))(new Redis(config[_0x6326('0xc')]));require(_0x6326('0xe'))[_0x6326('0xf')](socket);function respondWithRpcPromise(_0x37a23d,_0x53c3e1,_0x1b45a7){return new BPromise(function(_0x464a36,_0x3590ab){return client[_0x6326('0x10')](_0x37a23d,_0x1b45a7)[_0x6326('0x11')](function(_0x3b056c){logger[_0x6326('0x12')](_0x6326('0x13'),_0x53c3e1,_0x6326('0x14'));logger[_0x6326('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x53c3e1,'request\x20sent',JSON[_0x6326('0x16')](_0x3b056c));if(_0x3b056c[_0x6326('0x17')]){if(_0x3b056c['error'][_0x6326('0x18')]===0x1f4){logger['error'](_0x6326('0x13'),_0x53c3e1,_0x3b056c[_0x6326('0x17')][_0x6326('0x19')]);return _0x3590ab(_0x3b056c[_0x6326('0x17')][_0x6326('0x19')]);}logger[_0x6326('0x17')]('MailMessage,\x20%s,\x20%s',_0x53c3e1,_0x3b056c[_0x6326('0x17')]['message']);return _0x464a36(_0x3b056c['error']['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x53c3e1,'request\x20sent');_0x464a36(_0x3b056c[_0x6326('0x1a')][_0x6326('0x19')]);}})[_0x6326('0x1b')](function(_0x556c4e){logger['error'](_0x6326('0x13'),_0x53c3e1,_0x556c4e);_0x3590ab(_0x556c4e);});});}exports[_0x6326('0x1c')]=function(_0x272b5c){var _0x3db834=this;return new Promise(function(_0x3c08db,_0x25957a){return db[_0x6326('0x1d')]['create'](_0x272b5c[_0x6326('0x1e')],{'raw':_0x272b5c['options']?_0x272b5c[_0x6326('0x1f')][_0x6326('0x20')]===undefined?!![]:![]:!![]})[_0x6326('0x11')](function(_0x24fb78){logger[_0x6326('0x12')](_0x6326('0x1c'),_0x272b5c);logger[_0x6326('0x15')](_0x6326('0x1c'),_0x272b5c,JSON[_0x6326('0x16')](_0x24fb78));_0x3c08db(_0x24fb78);})[_0x6326('0x1b')](function(_0x34954b){logger['error'](_0x6326('0x1c'),_0x34954b[_0x6326('0x19')],_0x272b5c);_0x25957a(_0x3db834['error'](0x1f4,_0x34954b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 0be791c..f007db0 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 _0x07fb=['remove','update','removeListener','register','mailMessage:','./mailMessage.events','save'];(function(_0x3b66ab,_0x21df36){var _0x1ab3c8=function(_0x3b0bc2){while(--_0x3b0bc2){_0x3b66ab['push'](_0x3b66ab['shift']());}};_0x1ab3c8(++_0x21df36);}(_0x07fb,0x10f));var _0xb07f=function(_0x4c30a3,_0x2e393e){_0x4c30a3=_0x4c30a3-0x0;var _0x28d428=_0x07fb[_0x4c30a3];return _0x28d428;};'use strict';var MailMessageEvents=require(_0xb07f('0x0'));var events=[_0xb07f('0x1'),_0xb07f('0x2'),_0xb07f('0x3')];function createListener(_0x178fe8,_0x2e07c2){return function(_0x51a115){_0x2e07c2['emit'](_0x178fe8,_0x51a115);};}function removeListener(_0x1b7ba8,_0x4ef90f){return function(){MailMessageEvents[_0xb07f('0x4')](_0x1b7ba8,_0x4ef90f);};}exports[_0xb07f('0x5')]=function(_0x245faf){for(var _0xbd8ec3=0x0,_0x282684=events['length'];_0xbd8ec3<_0x282684;_0xbd8ec3++){var _0xfcec7c=events[_0xbd8ec3];var _0x1d337d=createListener(_0xb07f('0x6')+_0xfcec7c,_0x245faf);MailMessageEvents['on'](_0xfcec7c,_0x1d337d);}}; \ No newline at end of file +var _0x6ff5=['register','length','mailMessage:','./mailMessage.events','emit','removeListener'];(function(_0x14e15a,_0x6c5f0d){var _0x5d01c0=function(_0xd4e48b){while(--_0xd4e48b){_0x14e15a['push'](_0x14e15a['shift']());}};_0x5d01c0(++_0x6c5f0d);}(_0x6ff5,0xab));var _0x56ff=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6ff5[_0x138adb];return _0x1b27f2;};'use strict';var MailMessageEvents=require(_0x56ff('0x0'));var events=['save','remove','update'];function createListener(_0x2902ee,_0x5734b7){return function(_0x252f85){_0x5734b7[_0x56ff('0x1')](_0x2902ee,_0x252f85);};}function removeListener(_0x576916,_0x58cce6){return function(){MailMessageEvents[_0x56ff('0x2')](_0x576916,_0x58cce6);};}exports[_0x56ff('0x3')]=function(_0x3f6fb8){for(var _0x3f06be=0x0,_0x1f7c30=events[_0x56ff('0x4')];_0x3f06be<_0x1f7c30;_0x3f06be++){var _0x2fbf8d=events[_0x3f06be];var _0x4183ab=createListener(_0x56ff('0x5')+_0x2fbf8d,_0x3f6fb8);MailMessageEvents['on'](_0x2fbf8d,_0x4183ab);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 47fe985..3f63b47 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 _0xc308=['/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','index','/describe','get','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x408e97,_0x4b23e2){var _0x227b62=function(_0x5477a4){while(--_0x5477a4){_0x408e97['push'](_0x408e97['shift']());}};_0x227b62(++_0x4b23e2);}(_0xc308,0x1bd));var _0x8c30=function(_0x582e18,_0x4fd856){_0x582e18=_0x582e18-0x0;var _0x445d03=_0xc308[_0x582e18];return _0x445d03;};'use strict';var multer=require(_0x8c30('0x0'));var util=require(_0x8c30('0x1'));var path=require(_0x8c30('0x2'));var timeout=require(_0x8c30('0x3'));var express=require(_0x8c30('0x4'));var router=express[_0x8c30('0x5')]();var fs_extra=require(_0x8c30('0x6'));var auth=require(_0x8c30('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8c30('0x8'));var controller=require(_0x8c30('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8c30('0xa')]);router['get'](_0x8c30('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8c30('0xc')](_0x8c30('0xd'),auth[_0x8c30('0xe')](),controller[_0x8c30('0xf')]);router[_0x8c30('0xc')](_0x8c30('0x10'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x11')]);router[_0x8c30('0xc')](_0x8c30('0x12'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x13')]);router[_0x8c30('0xc')](_0x8c30('0x14'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x15')]);router[_0x8c30('0x16')]('/',auth[_0x8c30('0xe')](),controller[_0x8c30('0x17')]);router[_0x8c30('0x16')]('/:id/teams',auth[_0x8c30('0xe')](),controller[_0x8c30('0x18')]);router[_0x8c30('0x16')](_0x8c30('0x14'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x19')]);router[_0x8c30('0x1a')](_0x8c30('0xd'),auth[_0x8c30('0xe')](),controller['update']);router[_0x8c30('0x1b')](_0x8c30('0xd'),auth[_0x8c30('0xe')](),controller['destroy']);router[_0x8c30('0x1b')](_0x8c30('0x12'),auth[_0x8c30('0xe')](),controller[_0x8c30('0x1c')]);router[_0x8c30('0x1b')](_0x8c30('0x14'),auth['isAuthenticated'](),controller[_0x8c30('0x1d')]);module[_0x8c30('0x1e')]=router; \ No newline at end of file +var _0x90de=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','update','destroy','delete','removeTeams'];(function(_0x59a117,_0x3c2c9c){var _0x5d0001=function(_0x27ec9c){while(--_0x27ec9c){_0x59a117['push'](_0x59a117['shift']());}};_0x5d0001(++_0x3c2c9c);}(_0x90de,0x12a));var _0xe90d=function(_0x371b29,_0x2d33ed){_0x371b29=_0x371b29-0x0;var _0x434d79=_0x90de[_0x371b29];return _0x434d79;};'use strict';var multer=require(_0xe90d('0x0'));var util=require(_0xe90d('0x1'));var path=require('path');var timeout=require(_0xe90d('0x2'));var express=require('express');var router=express[_0xe90d('0x3')]();var fs_extra=require(_0xe90d('0x4'));var auth=require(_0xe90d('0x5'));var interaction=require(_0xe90d('0x6'));var config=require(_0xe90d('0x7'));var controller=require('./mailQueue.controller');router[_0xe90d('0x8')]('/',auth[_0xe90d('0x9')](),controller['index']);router[_0xe90d('0x8')](_0xe90d('0xa'),auth[_0xe90d('0x9')](),controller['describe']);router['get'](_0xe90d('0xb'),auth[_0xe90d('0x9')](),controller[_0xe90d('0xc')]);router['get'](_0xe90d('0xd'),auth[_0xe90d('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth[_0xe90d('0x9')](),controller[_0xe90d('0xe')]);router[_0xe90d('0x8')](_0xe90d('0xf'),auth[_0xe90d('0x9')](),controller[_0xe90d('0x10')]);router[_0xe90d('0x11')]('/',auth[_0xe90d('0x9')](),controller[_0xe90d('0x12')]);router[_0xe90d('0x11')](_0xe90d('0x13'),auth[_0xe90d('0x9')](),controller[_0xe90d('0x14')]);router[_0xe90d('0x11')](_0xe90d('0xf'),auth[_0xe90d('0x9')](),controller['addAgents']);router[_0xe90d('0x15')](_0xe90d('0xb'),auth[_0xe90d('0x9')](),controller[_0xe90d('0x16')]);router['delete'](_0xe90d('0xb'),auth[_0xe90d('0x9')](),controller[_0xe90d('0x17')]);router[_0xe90d('0x18')]('/:id/teams',auth[_0xe90d('0x9')](),controller[_0xe90d('0x19')]);router['delete'](_0xe90d('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xe90d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 6fe716f..ee92945 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 _0x9360=['roundrobin','sequelize','exports','rrmemory','beepall'];(function(_0x59efe6,_0x3e0ca2){var _0x9660fa=function(_0x496fd0){while(--_0x496fd0){_0x59efe6['push'](_0x59efe6['shift']());}};_0x9660fa(++_0x3e0ca2);}(_0x9360,0x16e));var _0x0936=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9360[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x0936('0x0'));module[_0x0936('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0936('0x2'),_0x0936('0x3'),_0x0936('0x4'))}}; \ No newline at end of file +var _0x8d97=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER','ENUM'];(function(_0x5de685,_0x1c0bce){var _0xca91b=function(_0x1eae3d){while(--_0x1eae3d){_0x5de685['push'](_0x5de685['shift']());}};_0xca91b(++_0x1c0bce);}(_0x8d97,0xb9));var _0x78d9=function(_0x54490e,_0x2f18d8){_0x54490e=_0x54490e-0x0;var _0x334a9d=_0x8d97[_0x54490e];return _0x334a9d;};'use strict';var Sequelize=require(_0x78d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x78d9('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x78d9('0x1')]},'timeout':{'type':Sequelize[_0x78d9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78d9('0x3')](_0x78d9('0x4'),_0x78d9('0x5'),_0x78d9('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4fba2e6..7c66d5b 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 _0x142b=['mailPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','User','online','voicePause','Agents','sequelize','transaction','each','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','hasOwnProperty','order','agent'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x142b,0x1bb));var _0xb142=function(_0xc8a1c5,_0x2c0c9a){_0xc8a1c5=_0xc8a1c5-0x0;var _0x14b5ae=_0x142b[_0xc8a1c5];return _0x14b5ae;};'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(_0xb142('0x0'));var moment=require(_0xb142('0x1'));var BPromise=require(_0xb142('0x2'));var Mustache=require(_0xb142('0x3'));var util=require(_0xb142('0x4'));var path=require('path');var sox=require(_0xb142('0x5'));var csv=require(_0xb142('0x6'));var ejs=require(_0xb142('0x7'));var fs=require('fs');var fs_extra=require(_0xb142('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb142('0x9'));var jsforce=require(_0xb142('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb142('0x6'));var querystring=require(_0xb142('0xb'));var Papa=require(_0xb142('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb142('0xd'));var hardwareService=require(_0xb142('0xe'));var logger=require(_0xb142('0xf'))('api');var utils=require(_0xb142('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb142('0x11')]=_[_0xb142('0x12')](config['redis'],{'host':_0xb142('0x13'),'port':0x18eb});var socket=require(_0xb142('0x14'))(new Redis(config[_0xb142('0x11')]));require('./mailQueue.socket')[_0xb142('0x15')](socket);function respondWithStatusCode(_0x2e5219,_0x12211d){_0x12211d=_0x12211d||0xcc;return function(_0x53673a){if(_0x53673a){return _0x2e5219[_0xb142('0x16')](_0x12211d);}return _0x2e5219['status'](_0x12211d)[_0xb142('0x17')]();};}function respondWithResult(_0x4c8539,_0x49984a){_0x49984a=_0x49984a||0xc8;return function(_0x579b83){if(_0x579b83){return _0x4c8539[_0xb142('0x18')](_0x49984a)[_0xb142('0x19')](_0x579b83);}};}function respondWithFilteredResult(_0x2b85fe,_0x4b4fb6){return function(_0x3f6313){if(_0x3f6313){var _0x16465d=typeof _0x4b4fb6[_0xb142('0x1a')]===_0xb142('0x1b')&&typeof _0x4b4fb6[_0xb142('0x1c')]===_0xb142('0x1b');var _0x284e59=_0x3f6313[_0xb142('0x1d')];var _0x77852c=_0x16465d?0x0:_0x4b4fb6['offset'];var _0x38b982=_0x16465d?_0x3f6313[_0xb142('0x1d')]:_0x4b4fb6[_0xb142('0x1a')]+_0x4b4fb6[_0xb142('0x1c')];var _0x5bc5b8;if(_0x38b982>=_0x284e59){_0x38b982=_0x284e59;_0x5bc5b8=0xc8;}else{_0x5bc5b8=0xce;}_0x2b85fe['status'](_0x5bc5b8);return _0x2b85fe['set'](_0xb142('0x1e'),_0x77852c+'-'+_0x38b982+'/'+_0x284e59)['json'](_0x3f6313);}return null;};}function patchUpdates(_0x320b14){return function(_0x109358){try{jsonpatch[_0xb142('0x1f')](_0x109358,_0x320b14,!![]);}catch(_0x251805){return BPromise[_0xb142('0x20')](_0x251805);}return _0x109358[_0xb142('0x21')]();};}function saveUpdates(_0xf7c23d,_0xd27bc8){return function(_0x49521a){if(_0x49521a){return _0x49521a[_0xb142('0x22')](_0xf7c23d)[_0xb142('0x23')](function(_0x2985fb){return _0x2985fb;});}return null;};}function removeEntity(_0x490abc,_0x5ed608){return function(_0x4c103e){if(_0x4c103e){return _0x4c103e[_0xb142('0x24')]()[_0xb142('0x23')](function(){var _0x34463c=_0x4c103e[_0xb142('0x25')]({'plain':!![]});var _0x1a6827=_0xb142('0x26');return db['UserProfileResource'][_0xb142('0x24')]({'where':{'type':_0x1a6827,'resourceId':_0x34463c['id']}})[_0xb142('0x23')](function(){return _0x4c103e;});})['then'](function(){_0x490abc[_0xb142('0x18')](0xcc)[_0xb142('0x17')]();});}};}function handleEntityNotFound(_0x5dad4f,_0xdafdb1){return function(_0x19aa42){if(!_0x19aa42){_0x5dad4f[_0xb142('0x16')](0x194);}return _0x19aa42;};}function handleError(_0x517cb3,_0x3d3752){_0x3d3752=_0x3d3752||0x1f4;return function(_0x137d0d){logger[_0xb142('0x27')](_0x137d0d[_0xb142('0x28')]);if(_0x137d0d[_0xb142('0x29')]){delete _0x137d0d[_0xb142('0x29')];}_0x517cb3[_0xb142('0x18')](_0x3d3752)[_0xb142('0x2a')](_0x137d0d);};}exports['index']=function(_0x30a35f,_0x441d5f){var _0x3a298a={},_0x3eb0b9={},_0x5e98dc={'count':0x0,'rows':[]};var _0x4de48d=_['map'](db[_0xb142('0x2b')][_0xb142('0x2c')],function(_0x5d5e3e){return{'name':_0x5d5e3e[_0xb142('0x2d')],'type':_0x5d5e3e[_0xb142('0x2e')]['key']};});_0x3eb0b9[_0xb142('0x2f')]=_[_0xb142('0x30')](_0x4de48d,'name');_0x3eb0b9[_0xb142('0x31')]=_[_0xb142('0x32')](_0x30a35f['query']);_0x3eb0b9[_0xb142('0x33')]=_['intersection'](_0x3eb0b9[_0xb142('0x2f')],_0x3eb0b9[_0xb142('0x31')]);_0x3a298a[_0xb142('0x34')]=_['intersection'](_0x3eb0b9['model'],qs['fields'](_0x30a35f[_0xb142('0x31')][_0xb142('0x35')]));_0x3a298a[_0xb142('0x34')]=_0x3a298a[_0xb142('0x34')][_0xb142('0x36')]?_0x3a298a[_0xb142('0x34')]:_0x3eb0b9[_0xb142('0x2f')];if(!_0x30a35f[_0xb142('0x31')]['hasOwnProperty'](_0xb142('0x37'))){_0x3a298a[_0xb142('0x1c')]=qs[_0xb142('0x1c')](_0x30a35f[_0xb142('0x31')][_0xb142('0x1c')]);_0x3a298a[_0xb142('0x1a')]=qs[_0xb142('0x1a')](_0x30a35f[_0xb142('0x31')][_0xb142('0x1a')]);}_0x3a298a['order']=qs[_0xb142('0x38')](_0x30a35f[_0xb142('0x31')][_0xb142('0x38')]);_0x3a298a[_0xb142('0x39')]=qs['filters'](_[_0xb142('0x3a')](_0x30a35f[_0xb142('0x31')],_0x3eb0b9['filters']),_0x4de48d);if(_0x30a35f[_0xb142('0x31')][_0xb142('0x3b')]){_0x3a298a['where']=_[_0xb142('0x3c')](_0x3a298a['where'],{'$or':_['map'](_0x4de48d,function(_0x1cff97){if(_0x1cff97[_0xb142('0x2e')]!=='VIRTUAL'){var _0x307eeb={};_0x307eeb[_0x1cff97['name']]={'$like':'%'+_0x30a35f[_0xb142('0x31')][_0xb142('0x3b')]+'%'};return _0x307eeb;}})});}_0x3a298a=_[_0xb142('0x3c')]({},_0x3a298a,_0x30a35f[_0xb142('0x3d')]);var _0x19f2f2={'where':_0x3a298a[_0xb142('0x39')]};return db['MailQueue'][_0xb142('0x1d')](_0x19f2f2)[_0xb142('0x23')](function(_0xf37f8d){_0x5e98dc[_0xb142('0x1d')]=_0xf37f8d;if(_0x30a35f[_0xb142('0x31')][_0xb142('0x3e')]){_0x3a298a[_0xb142('0x3f')]=[{'all':!![]}];}return db[_0xb142('0x2b')][_0xb142('0x40')](_0x3a298a);})[_0xb142('0x23')](function(_0x2f4807){_0x5e98dc[_0xb142('0x41')]=_0x2f4807;return _0x5e98dc;})[_0xb142('0x23')](respondWithFilteredResult(_0x441d5f,_0x3a298a))[_0xb142('0x42')](handleError(_0x441d5f,null));};exports['show']=function(_0x3613fe,_0x5f52b3){var _0x1b6205={'raw':!![],'where':{'id':_0x3613fe[_0xb142('0x43')]['id']}},_0x4112b2={};_0x4112b2[_0xb142('0x2f')]=_[_0xb142('0x32')](db['MailQueue'][_0xb142('0x2c')]);_0x4112b2['query']=_[_0xb142('0x32')](_0x3613fe[_0xb142('0x31')]);_0x4112b2[_0xb142('0x33')]=_[_0xb142('0x44')](_0x4112b2[_0xb142('0x2f')],_0x4112b2[_0xb142('0x31')]);_0x1b6205[_0xb142('0x34')]=_[_0xb142('0x44')](_0x4112b2[_0xb142('0x2f')],qs[_0xb142('0x35')](_0x3613fe[_0xb142('0x31')]['fields']));_0x1b6205[_0xb142('0x34')]=_0x1b6205[_0xb142('0x34')][_0xb142('0x36')]?_0x1b6205[_0xb142('0x34')]:_0x4112b2[_0xb142('0x2f')];if(_0x3613fe[_0xb142('0x31')][_0xb142('0x3e')]){_0x1b6205['include']=[{'all':!![]}];}_0x1b6205=_[_0xb142('0x3c')]({},_0x1b6205,_0x3613fe[_0xb142('0x3d')]);return db[_0xb142('0x2b')][_0xb142('0x45')](_0x1b6205)['then'](handleEntityNotFound(_0x5f52b3,null))[_0xb142('0x23')](respondWithResult(_0x5f52b3,null))[_0xb142('0x42')](handleError(_0x5f52b3,null));};exports[_0xb142('0x46')]=function(_0x2653e1,_0x5ea023){return db[_0xb142('0x2b')][_0xb142('0x46')](_0x2653e1[_0xb142('0x47')],{})[_0xb142('0x23')](function(_0x339bd0){var _0x456f92=_0x2653e1['user'][_0xb142('0x25')]({'plain':!![]});if(!_0x456f92)throw new Error(_0xb142('0x48'));if(_0x456f92[_0xb142('0x49')]===_0xb142('0x4a')){var _0x5c6eeb=_0x339bd0[_0xb142('0x25')]({'plain':!![]});var _0x2629a7=_0xb142('0x26');return db[_0xb142('0x4b')][_0xb142('0x45')]({'where':{'name':_0x2629a7,'userProfileId':_0x456f92[_0xb142('0x4c')]},'raw':!![]})[_0xb142('0x23')](function(_0x30ed36){if(_0x30ed36&&_0x30ed36[_0xb142('0x4d')]===0x0){return db['UserProfileResource'][_0xb142('0x46')]({'name':_0x5c6eeb[_0xb142('0x29')],'resourceId':_0x5c6eeb['id'],'type':_0x30ed36[_0xb142('0x29')],'sectionId':_0x30ed36['id']},{})['then'](function(){return _0x339bd0;});}else{return _0x339bd0;}})[_0xb142('0x42')](function(_0x515c47){logger['error'](_0xb142('0x4e'),_0x515c47);throw _0x515c47;});}return _0x339bd0;})[_0xb142('0x23')](respondWithResult(_0x5ea023,0xc9))[_0xb142('0x42')](handleError(_0x5ea023,null));};exports['update']=function(_0x264fb4,_0x4cb62a){if(_0x264fb4[_0xb142('0x47')]['id']){delete _0x264fb4[_0xb142('0x47')]['id'];}return db[_0xb142('0x2b')]['find']({'where':{'id':_0x264fb4[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x4cb62a,null))['then'](saveUpdates(_0x264fb4[_0xb142('0x47')],null))[_0xb142('0x23')](respondWithResult(_0x4cb62a,null))[_0xb142('0x42')](handleError(_0x4cb62a,null));};exports['destroy']=function(_0x680f7f,_0x225967){return db['MailQueue']['find']({'where':{'id':_0x680f7f[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x225967,null))[_0xb142('0x23')](removeEntity(_0x225967,null))['catch'](handleError(_0x225967,null));};exports['describe']=function(_0x51e0e3,_0x40addd){return db['MailQueue'][_0xb142('0x4f')]()[_0xb142('0x23')](respondWithResult(_0x40addd,null))[_0xb142('0x42')](handleError(_0x40addd,null));};exports[_0xb142('0x50')]=function(_0x4b9bfa,_0x169f37,_0x4f0136){var _0x4cb46a={'raw':!![],'where':{}},_0x4bde45={},_0x3e3df6;return db[_0xb142('0x2b')]['findOne']({'where':{'id':_0x4b9bfa[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x169f37,null))[_0xb142('0x23')](function(_0x2d1412){if(_0x2d1412){_0x3e3df6=_0x2d1412[_0xb142('0x25')]({'plain':!![]});_0x4bde45[_0xb142('0x2f')]=_[_0xb142('0x32')](db[_0xb142('0x51')]['rawAttributes']);_0x4bde45['query']=_[_0xb142('0x32')](_0x4b9bfa[_0xb142('0x31')]);_0x4bde45[_0xb142('0x33')]=_[_0xb142('0x44')](_0x4bde45[_0xb142('0x2f')],_0x4bde45['query']);_0x4cb46a[_0xb142('0x34')]=_[_0xb142('0x44')](_0x4bde45[_0xb142('0x2f')],qs['fields'](_0x4b9bfa[_0xb142('0x31')][_0xb142('0x35')]));_0x4cb46a[_0xb142('0x34')]=_0x4cb46a['attributes'][_0xb142('0x36')]?_0x4cb46a[_0xb142('0x34')]:_0x4bde45[_0xb142('0x2f')];if(!_0x4b9bfa[_0xb142('0x31')][_0xb142('0x52')]('nolimit')){_0x4cb46a[_0xb142('0x1c')]=qs[_0xb142('0x1c')](_0x4b9bfa[_0xb142('0x31')][_0xb142('0x1c')]);_0x4cb46a[_0xb142('0x1a')]=qs[_0xb142('0x1a')](_0x4b9bfa['query'][_0xb142('0x1a')]);}_0x4cb46a[_0xb142('0x53')]=qs[_0xb142('0x38')](_0x4b9bfa[_0xb142('0x31')][_0xb142('0x38')]);_0x4cb46a['where']=qs[_0xb142('0x33')](_[_0xb142('0x3a')](_0x4b9bfa[_0xb142('0x31')],_0x4bde45['filters']));_0x4cb46a[_0xb142('0x39')]['MailQueueId']=_0x2d1412['id'];if(_0x4b9bfa[_0xb142('0x31')][_0xb142('0x3b')]){_0x4cb46a[_0xb142('0x39')]=_[_0xb142('0x3c')](_0x4cb46a[_0xb142('0x39')],{'$or':_[_0xb142('0x30')](_0x4cb46a['attributes'],function(_0x247c4b){var _0x278773={};_0x278773[_0x247c4b]={'$like':'%'+_0x4b9bfa['query']['filter']+'%'};return _0x278773;})});}_0x4cb46a=_['merge']({},_0x4cb46a,_0x4b9bfa[_0xb142('0x3d')]);return db[_0xb142('0x51')]['findAll'](_0x4cb46a);}})[_0xb142('0x23')](function(_0x459a70){if(_0x459a70){return db['User']['findAndCountAll']({'where':{'id':_[_0xb142('0x30')](_0x459a70,'UserId'),'role':_0xb142('0x54')},'attributes':['id','name',_0xb142('0x55'),_0xb142('0x56'),_0xb142('0x57')]});}})[_0xb142('0x23')](function(_0x31b69d){if(_0x31b69d){return{'count':_0x31b69d[_0xb142('0x1d')],'rows':_['map'](_0x31b69d[_0xb142('0x41')],function(_0x50af23){return{'membername':_0x50af23[_0xb142('0x29')],'UserId':_0x50af23['id'],'queue_name':_0x3e3df6[_0xb142('0x29')],'MailQueueId':_0x3e3df6['id'],'interface':util[_0xb142('0x58')](_0xb142('0x59'),'SIP',_0x50af23[_0xb142('0x29')]),'penalty':0x0,'paused':_0x50af23[_0xb142('0x55')],'createdAt':_0x50af23[_0xb142('0x57')],'updatedAt':_0x50af23[_0xb142('0x56')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb142('0x23')](respondWithFilteredResult(_0x169f37,_0x4cb46a))[_0xb142('0x42')](handleError(_0x169f37,null));};exports[_0xb142('0x5a')]=function(_0x46c9d5,_0x3176e4,_0x51be38){var _0x50f178={};var _0x3212e3={};var _0xeca79c;var _0x5ec2c1;return db[_0xb142('0x2b')][_0xb142('0x5b')]({'where':{'id':_0x46c9d5[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x3176e4,null))[_0xb142('0x23')](function(_0x4bf9cd){if(_0x4bf9cd){_0xeca79c=_0x4bf9cd;_0x3212e3[_0xb142('0x2f')]=_[_0xb142('0x32')](db[_0xb142('0x5c')][_0xb142('0x2c')]);_0x3212e3['query']=_[_0xb142('0x32')](_0x46c9d5[_0xb142('0x31')]);_0x3212e3[_0xb142('0x33')]=_[_0xb142('0x44')](_0x3212e3['model'],_0x3212e3[_0xb142('0x31')]);_0x50f178['attributes']=_[_0xb142('0x44')](_0x3212e3['model'],qs[_0xb142('0x35')](_0x46c9d5[_0xb142('0x31')][_0xb142('0x35')]));_0x50f178[_0xb142('0x34')]=_0x50f178[_0xb142('0x34')]['length']?_0x50f178[_0xb142('0x34')]:_0x3212e3[_0xb142('0x2f')];_0x50f178[_0xb142('0x53')]=qs[_0xb142('0x38')](_0x46c9d5[_0xb142('0x31')][_0xb142('0x38')]);_0x50f178[_0xb142('0x39')]=qs['filters'](_[_0xb142('0x3a')](_0x46c9d5[_0xb142('0x31')],_0x3212e3['filters']));if(_0x46c9d5[_0xb142('0x31')][_0xb142('0x3b')]){_0x50f178['where']=_['merge'](_0x50f178[_0xb142('0x39')],{'$or':_[_0xb142('0x30')](_0x50f178[_0xb142('0x34')],function(_0x3a1c44){var _0x145c58={};_0x145c58[_0x3a1c44]={'$like':'%'+_0x46c9d5[_0xb142('0x31')]['filter']+'%'};return _0x145c58;})});}_0x50f178=_[_0xb142('0x3c')]({},_0x50f178,_0x46c9d5['options']);return _0xeca79c[_0xb142('0x5a')](_0x50f178);}})[_0xb142('0x23')](function(_0x24a054){if(_0x24a054){_0x5ec2c1=_0x24a054[_0xb142('0x36')];if(!_0x46c9d5[_0xb142('0x31')][_0xb142('0x52')]('nolimit')){_0x50f178['limit']=qs[_0xb142('0x1c')](_0x46c9d5[_0xb142('0x31')][_0xb142('0x1c')]);_0x50f178[_0xb142('0x1a')]=qs['offset'](_0x46c9d5[_0xb142('0x31')][_0xb142('0x1a')]);}return _0xeca79c[_0xb142('0x5a')](_0x50f178);}})['then'](function(_0x23a72d){if(_0x23a72d){return _0x23a72d?{'count':_0x5ec2c1,'rows':_0x23a72d}:null;}})[_0xb142('0x23')](respondWithResult(_0x3176e4,null))[_0xb142('0x42')](handleError(_0x3176e4,null));};exports[_0xb142('0x5d')]=function(_0x19d74c,_0x41c14a,_0x5ad74b){var _0x859488=_0x19d74c[_0xb142('0x47')][_0xb142('0x5e')];return db[_0xb142('0x5c')]['findAll']({'where':{'id':_0x859488},'attributes':['id'],'include':[{'model':db[_0xb142('0x5f')],'as':'Agents','attributes':['id',_0xb142('0x29'),_0xb142('0x60'),_0xb142('0x61'),'interface'],'raw':!![]}]})[_0xb142('0x23')](function(_0x37c785){if(_0x37c785){var _0xa6e22b=_['flatMap'](_0x37c785,function(_0x28b6a1){var _0x250a58=_0x28b6a1[_0xb142('0x25')]({'plain':!![]});return _0x250a58[_0xb142('0x62')];});return db['MailQueue'][_0xb142('0x45')]({'where':{'id':_0x19d74c[_0xb142('0x43')]['id']}})[_0xb142('0x23')](function(_0x46810d){return db[_0xb142('0x63')][_0xb142('0x64')](function(_0x119bd9){return _0x46810d[_0xb142('0x5d')](_0x859488,{'transaction':_0x119bd9})['then'](function(){return BPromise[_0xb142('0x65')](_0xa6e22b,function(_0x3410ef){return db[_0xb142('0x51')]['findOrCreate']({'where':{'UserId':_0x3410ef['id'],'MailQueueId':_0x19d74c['params']['id']},'transaction':_0x119bd9});});})[_0xb142('0x23')](function(){_0xa6e22b[_0xb142('0x66')](function(_0x5e2285){socket['emit'](_0xb142('0x67'),{'UserId':_0x5e2285['id'],'MailQueueId':_0x46810d['id']});});});});});}})[_0xb142('0x23')](respondWithStatusCode(_0x41c14a,null))['catch'](handleError(_0x41c14a,null));};exports[_0xb142('0x68')]=function(_0x49a69e,_0x2e970d,_0x51871d){return db[_0xb142('0x5c')][_0xb142('0x40')]({'where':{'id':_0x49a69e[_0xb142('0x31')][_0xb142('0x5e')]},'attributes':['id'],'include':[{'model':db[_0xb142('0x5f')],'as':_0xb142('0x62'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e970d,null))[_0xb142('0x23')](function(_0x44568d){var _0xedb2a=_['map'](_0x44568d,'id');var _0x58481b=[];var _0x2ff781=[];var _0x439d95=squel[_0xb142('0x69')]();_0x439d95[_0xb142('0x6a')](_0xb142('0x6b'))[_0xb142('0x6c')](_0xb142('0x6d'),'tq')[_0xb142('0x6e')](_0xb142('0x6f'),'ut',_0xb142('0x70'))[_0xb142('0x39')](_0xb142('0x71'),_0x49a69e[_0xb142('0x43')]['id']);for(var _0x4f10e3=0x0;_0x4f10e3<_0x44568d[_0xb142('0x36')];_0x4f10e3+=0x1){let _0x10aace=_0x44568d[_0x4f10e3];for(var _0x161870=0x0;_0x161870<_0x10aace['Agents'][_0xb142('0x36')];_0x161870+=0x1){let _0x553504=_0x10aace[_0xb142('0x62')][_0x161870];var _0x577454=_0x439d95[_0xb142('0x72')]();_0x577454[_0xb142('0x39')](_0xb142('0x73'),_0x553504['id']);_0x2ff781['push'](db['sequelize'][_0xb142('0x31')](_0x577454[_0xb142('0x74')](),{'type':db[_0xb142('0x63')][_0xb142('0x75')][_0xb142('0x76')]})[_0xb142('0x23')](function(_0x3668fd){if(_0x3668fd['length']===0x1){return _0x553504['id'];}else{var _0x1e167a=_['every'](_[_0xb142('0x30')](_0x3668fd,'TeamId'),function(_0x3174a2){return _[_0xb142('0x77')](_0xedb2a,_0x3174a2);});if(_0x1e167a){return _0x553504['id'];}}}));}}return BPromise[_0xb142('0x78')](_0x2ff781)['then'](function(_0x2518d3){_0x58481b=_(_0x58481b)['union'](_0x2518d3)[_0xb142('0x79')]()[_0xb142('0x7a')]();return db[_0xb142('0x2b')][_0xb142('0x45')]({'where':{'id':_0x49a69e[_0xb142('0x43')]['id']}})[_0xb142('0x23')](function(_0x290a24){return db[_0xb142('0x63')][_0xb142('0x64')](function(_0x3a4509){return _0x290a24[_0xb142('0x68')](_0x49a69e[_0xb142('0x31')][_0xb142('0x5e')],{'transaction':_0x3a4509})[_0xb142('0x23')](function(){if(!_[_0xb142('0x7b')](_0x58481b)){return _0x290a24[_0xb142('0x7c')](_0x58481b,{'transaction':_0x3a4509});}})[_0xb142('0x23')](function(){_0x58481b['forEach'](function(_0x29607d){socket[_0xb142('0x7d')](_0xb142('0x7e'),{'UserId':_0x29607d,'MailQueueId':_0x290a24['id']});});});});});});})[_0xb142('0x23')](respondWithStatusCode(_0x2e970d,null))[_0xb142('0x42')](handleError(_0x2e970d,null));};exports[_0xb142('0x7f')]=function(_0x208a0b,_0x558581,_0x79433a){return db['MailQueue'][_0xb142('0x45')]({'where':{'id':_0x208a0b[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x558581,null))[_0xb142('0x23')](function(_0x3881f7){if(_0x3881f7){return _0x3881f7[_0xb142('0x7f')](_0x208a0b[_0xb142('0x47')][_0xb142('0x5e')],_[_0xb142('0x80')](_0x208a0b[_0xb142('0x47')],['ids','id'])||{})[_0xb142('0x81')](function(_0x493e16){for(var _0x491085=0x0;_0x491085<_0x208a0b[_0xb142('0x47')]['ids'][_0xb142('0x36')];_0x491085+=0x1){socket[_0xb142('0x7d')]('userMailQueue:save',{'UserId':Number(_0x208a0b[_0xb142('0x47')][_0xb142('0x5e')][_0x491085]),'MailQueueId':Number(_0x208a0b[_0xb142('0x43')]['id'])});}return _0x493e16;});}})[_0xb142('0x23')](respondWithResult(_0x558581,null))['catch'](handleError(_0x558581,null));};exports['removeAgents']=function(_0x47f9b4,_0x3deafa,_0x4ff803){return db[_0xb142('0x2b')]['find']({'where':{'id':_0x47f9b4[_0xb142('0x43')]['id']}})['then'](handleEntityNotFound(_0x3deafa,null))['then'](function(_0x45d968){if(_0x45d968){return _0x45d968[_0xb142('0x7c')](_0x47f9b4['query'][_0xb142('0x5e')])['then'](function(){if(_[_0xb142('0x82')](_0x47f9b4[_0xb142('0x31')][_0xb142('0x5e')])){for(var _0xd795e6=0x0;_0xd795e6<_0x47f9b4['query'][_0xb142('0x5e')]['length'];_0xd795e6+=0x1){socket[_0xb142('0x7d')](_0xb142('0x7e'),{'UserId':Number(_0x47f9b4[_0xb142('0x31')][_0xb142('0x5e')][_0xd795e6]),'MailQueueId':Number(_0x47f9b4[_0xb142('0x43')]['id'])});}}else{socket[_0xb142('0x7d')](_0xb142('0x7e'),{'UserId':Number(_0x47f9b4[_0xb142('0x31')][_0xb142('0x5e')]),'MailQueueId':Number(_0x47f9b4[_0xb142('0x43')]['id'])});}});}})[_0xb142('0x23')](respondWithStatusCode(_0x3deafa,null))[_0xb142('0x42')](handleError(_0x3deafa,null));};exports[_0xb142('0x83')]=function(_0x246a9a,_0x2f0ae2,_0x12cb94){var _0x4bfc53={};var _0x3d6739={};var _0x4a00b9;var _0x9ffc58;return db[_0xb142('0x2b')]['findOne']({'where':{'id':_0x246a9a[_0xb142('0x43')]['id']}})[_0xb142('0x23')](handleEntityNotFound(_0x2f0ae2,null))['then'](function(_0x4c3376){if(_0x4c3376){_0x4a00b9=_0x4c3376;_0x3d6739[_0xb142('0x2f')]=_['keys'](db[_0xb142('0x5f')][_0xb142('0x2c')]);_0x3d6739[_0xb142('0x31')]=_[_0xb142('0x32')](_0x246a9a[_0xb142('0x31')]);_0x3d6739[_0xb142('0x33')]=_[_0xb142('0x44')](_0x3d6739[_0xb142('0x2f')],_0x3d6739[_0xb142('0x31')]);_0x4bfc53[_0xb142('0x34')]=_[_0xb142('0x44')](_0x3d6739['model'],qs[_0xb142('0x35')](_0x246a9a['query']['fields']));_0x4bfc53[_0xb142('0x34')]=_0x4bfc53[_0xb142('0x34')][_0xb142('0x36')]?_0x4bfc53['attributes']:_0x3d6739[_0xb142('0x2f')];_0x4bfc53[_0xb142('0x53')]=qs[_0xb142('0x38')](_0x246a9a[_0xb142('0x31')]['sort']);_0x4bfc53[_0xb142('0x39')]=qs[_0xb142('0x33')](_['pick'](_0x246a9a[_0xb142('0x31')],_0x3d6739[_0xb142('0x33')]));if(_0x246a9a['query']['filter']){_0x4bfc53[_0xb142('0x39')]=_['merge'](_0x4bfc53[_0xb142('0x39')],{'$or':_['map'](_0x4bfc53[_0xb142('0x34')],function(_0x12c445){var _0x494d75={};_0x494d75[_0x12c445]={'$like':'%'+_0x246a9a[_0xb142('0x31')][_0xb142('0x3b')]+'%'};return _0x494d75;})});}_0x4bfc53=_[_0xb142('0x3c')]({},_0x4bfc53,_0x246a9a[_0xb142('0x3d')]);return _0x4a00b9['getAgents'](_0x4bfc53);}})['then'](function(_0xaeadfc){if(_0xaeadfc){_0x9ffc58=_0xaeadfc[_0xb142('0x36')];if(!_0x246a9a['query'][_0xb142('0x52')]('nolimit')){_0x4bfc53['limit']=qs[_0xb142('0x1c')](_0x246a9a[_0xb142('0x31')][_0xb142('0x1c')]);_0x4bfc53[_0xb142('0x1a')]=qs[_0xb142('0x1a')](_0x246a9a[_0xb142('0x31')][_0xb142('0x1a')]);}return _0x4a00b9[_0xb142('0x83')](_0x4bfc53);}})[_0xb142('0x23')](function(_0x38ea7d){if(_0x38ea7d){return _0x38ea7d?{'count':_0x9ffc58,'rows':_0x38ea7d}:null;}})['then'](respondWithResult(_0x2f0ae2,null))['catch'](handleError(_0x2f0ae2,null));}; \ No newline at end of file +var _0xe3ee=['union','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','zip-dir','fast-json-patch','bluebird','path','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','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply','update','destroy','then','get','UserProfileResource','end','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','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','describe','getMembers','findOne','params','UserMailQueue','order','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','SIP','getTeams','Team','addTeams','ids','Agents','interface','flatMap','transaction','each','forEach','emit','userMailQueue:save','field','from','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','every','TeamId'];(function(_0x1c3af1,_0x139737){var _0x46c492=function(_0x57796b){while(--_0x57796b){_0x1c3af1['push'](_0x1c3af1['shift']());}};_0x46c492(++_0x139737);}(_0xe3ee,0x116));var _0xee3e=function(_0x51bde3,_0x35bfc7){_0x51bde3=_0x51bde3-0x0;var _0x324433=_0xe3ee[_0x51bde3];return _0x324433;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee3e('0x0'));var jsonpatch=require(_0xee3e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xee3e('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xee3e('0x3'));var sox=require('sox');var csv=require(_0xee3e('0x4'));var ejs=require(_0xee3e('0x5'));var fs=require('fs');var fs_extra=require(_0xee3e('0x6'));var _=require(_0xee3e('0x7'));var squel=require(_0xee3e('0x8'));var crypto=require(_0xee3e('0x9'));var jsforce=require(_0xee3e('0xa'));var deskjs=require(_0xee3e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xee3e('0xc'));var Papa=require(_0xee3e('0xd'));var Redis=require('ioredis');var authService=require(_0xee3e('0xe'));var qs=require(_0xee3e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee3e('0x10'));var logger=require(_0xee3e('0x11'))(_0xee3e('0x12'));var utils=require(_0xee3e('0x13'));var config=require(_0xee3e('0x14'));var licenseUtil=require(_0xee3e('0x15'));var db=require(_0xee3e('0x16'))['db'];config[_0xee3e('0x17')]=_['defaults'](config['redis'],{'host':_0xee3e('0x18'),'port':0x18eb});var socket=require(_0xee3e('0x19'))(new Redis(config['redis']));require(_0xee3e('0x1a'))[_0xee3e('0x1b')](socket);function respondWithStatusCode(_0xccec54,_0x55e5a0){_0x55e5a0=_0x55e5a0||0xcc;return function(_0x1af079){if(_0x1af079){return _0xccec54[_0xee3e('0x1c')](_0x55e5a0);}return _0xccec54['status'](_0x55e5a0)['end']();};}function respondWithResult(_0x370f32,_0x450c5b){_0x450c5b=_0x450c5b||0xc8;return function(_0x266449){if(_0x266449){return _0x370f32['status'](_0x450c5b)['json'](_0x266449);}};}function respondWithFilteredResult(_0x4e4903,_0x5f576a){return function(_0x2589c0){if(_0x2589c0){var _0x23cd1f=typeof _0x5f576a[_0xee3e('0x1d')]===_0xee3e('0x1e')&&typeof _0x5f576a[_0xee3e('0x1f')]==='undefined';var _0x2d1f93=_0x2589c0[_0xee3e('0x20')];var _0x2200f1=_0x23cd1f?0x0:_0x5f576a[_0xee3e('0x1d')];var _0x39a262=_0x23cd1f?_0x2589c0[_0xee3e('0x20')]:_0x5f576a['offset']+_0x5f576a[_0xee3e('0x1f')];var _0x12d555;if(_0x39a262>=_0x2d1f93){_0x39a262=_0x2d1f93;_0x12d555=0xc8;}else{_0x12d555=0xce;}_0x4e4903[_0xee3e('0x21')](_0x12d555);return _0x4e4903[_0xee3e('0x22')](_0xee3e('0x23'),_0x2200f1+'-'+_0x39a262+'/'+_0x2d1f93)[_0xee3e('0x24')](_0x2589c0);}return null;};}function patchUpdates(_0x374847){return function(_0x19f0ee){try{jsonpatch[_0xee3e('0x25')](_0x19f0ee,_0x374847,!![]);}catch(_0x17666d){return BPromise['reject'](_0x17666d);}return _0x19f0ee['save']();};}function saveUpdates(_0x4b0d94,_0x4aaf22){return function(_0x24891a){if(_0x24891a){return _0x24891a[_0xee3e('0x26')](_0x4b0d94)['then'](function(_0xbfc488){return _0xbfc488;});}return null;};}function removeEntity(_0x29a2d4,_0x2338fa){return function(_0x4e8a32){if(_0x4e8a32){return _0x4e8a32[_0xee3e('0x27')]()[_0xee3e('0x28')](function(){var _0x2b96b8=_0x4e8a32[_0xee3e('0x29')]({'plain':!![]});var _0x5ec872='MailQueues';return db[_0xee3e('0x2a')][_0xee3e('0x27')]({'where':{'type':_0x5ec872,'resourceId':_0x2b96b8['id']}})[_0xee3e('0x28')](function(){return _0x4e8a32;});})['then'](function(){_0x29a2d4['status'](0xcc)[_0xee3e('0x2b')]();});}};}function handleEntityNotFound(_0x31f7ea,_0x179406){return function(_0x1a0c3e){if(!_0x1a0c3e){_0x31f7ea[_0xee3e('0x1c')](0x194);}return _0x1a0c3e;};}function handleError(_0x59312a,_0x2d5715){_0x2d5715=_0x2d5715||0x1f4;return function(_0x4e4fff){logger['error'](_0x4e4fff[_0xee3e('0x2c')]);if(_0x4e4fff[_0xee3e('0x2d')]){delete _0x4e4fff['name'];}_0x59312a[_0xee3e('0x21')](_0x2d5715)['send'](_0x4e4fff);};}exports[_0xee3e('0x2e')]=function(_0x1f8995,_0x413f3d){var _0x3306c2={},_0x565afb={},_0x43c9b6={'count':0x0,'rows':[]};var _0x25ad72=_[_0xee3e('0x2f')](db[_0xee3e('0x30')][_0xee3e('0x31')],function(_0x30f634){return{'name':_0x30f634[_0xee3e('0x32')],'type':_0x30f634[_0xee3e('0x33')][_0xee3e('0x34')]};});_0x565afb['model']=_[_0xee3e('0x2f')](_0x25ad72,_0xee3e('0x2d'));_0x565afb[_0xee3e('0x35')]=_[_0xee3e('0x36')](_0x1f8995[_0xee3e('0x35')]);_0x565afb[_0xee3e('0x37')]=_[_0xee3e('0x38')](_0x565afb[_0xee3e('0x39')],_0x565afb[_0xee3e('0x35')]);_0x3306c2[_0xee3e('0x3a')]=_[_0xee3e('0x38')](_0x565afb['model'],qs[_0xee3e('0x3b')](_0x1f8995[_0xee3e('0x35')]['fields']));_0x3306c2[_0xee3e('0x3a')]=_0x3306c2[_0xee3e('0x3a')][_0xee3e('0x3c')]?_0x3306c2[_0xee3e('0x3a')]:_0x565afb['model'];if(!_0x1f8995[_0xee3e('0x35')][_0xee3e('0x3d')](_0xee3e('0x3e'))){_0x3306c2[_0xee3e('0x1f')]=qs[_0xee3e('0x1f')](_0x1f8995[_0xee3e('0x35')]['limit']);_0x3306c2[_0xee3e('0x1d')]=qs['offset'](_0x1f8995[_0xee3e('0x35')][_0xee3e('0x1d')]);}_0x3306c2['order']=qs['sort'](_0x1f8995[_0xee3e('0x35')][_0xee3e('0x3f')]);_0x3306c2[_0xee3e('0x40')]=qs['filters'](_[_0xee3e('0x41')](_0x1f8995['query'],_0x565afb[_0xee3e('0x37')]),_0x25ad72);if(_0x1f8995[_0xee3e('0x35')]['filter']){_0x3306c2[_0xee3e('0x40')]=_[_0xee3e('0x42')](_0x3306c2[_0xee3e('0x40')],{'$or':_['map'](_0x25ad72,function(_0x29c267){if(_0x29c267[_0xee3e('0x33')]!=='VIRTUAL'){var _0xd96d03={};_0xd96d03[_0x29c267[_0xee3e('0x2d')]]={'$like':'%'+_0x1f8995[_0xee3e('0x35')][_0xee3e('0x43')]+'%'};return _0xd96d03;}})});}_0x3306c2=_[_0xee3e('0x42')]({},_0x3306c2,_0x1f8995[_0xee3e('0x44')]);var _0x1669fc={'where':_0x3306c2['where']};return db[_0xee3e('0x30')][_0xee3e('0x20')](_0x1669fc)[_0xee3e('0x28')](function(_0x4ffd0c){_0x43c9b6[_0xee3e('0x20')]=_0x4ffd0c;if(_0x1f8995[_0xee3e('0x35')][_0xee3e('0x45')]){_0x3306c2[_0xee3e('0x46')]=[{'all':!![]}];}return db[_0xee3e('0x30')][_0xee3e('0x47')](_0x3306c2);})['then'](function(_0x25bec7){_0x43c9b6['rows']=_0x25bec7;return _0x43c9b6;})[_0xee3e('0x28')](respondWithFilteredResult(_0x413f3d,_0x3306c2))[_0xee3e('0x48')](handleError(_0x413f3d,null));};exports[_0xee3e('0x49')]=function(_0x1781ed,_0x104cdf){var _0x4b6220={'raw':!![],'where':{'id':_0x1781ed['params']['id']}},_0x5e2fe6={};_0x5e2fe6[_0xee3e('0x39')]=_[_0xee3e('0x36')](db[_0xee3e('0x30')][_0xee3e('0x31')]);_0x5e2fe6['query']=_[_0xee3e('0x36')](_0x1781ed['query']);_0x5e2fe6[_0xee3e('0x37')]=_[_0xee3e('0x38')](_0x5e2fe6[_0xee3e('0x39')],_0x5e2fe6[_0xee3e('0x35')]);_0x4b6220[_0xee3e('0x3a')]=_[_0xee3e('0x38')](_0x5e2fe6[_0xee3e('0x39')],qs['fields'](_0x1781ed[_0xee3e('0x35')][_0xee3e('0x3b')]));_0x4b6220['attributes']=_0x4b6220['attributes']['length']?_0x4b6220['attributes']:_0x5e2fe6[_0xee3e('0x39')];if(_0x1781ed['query']['includeAll']){_0x4b6220[_0xee3e('0x46')]=[{'all':!![]}];}_0x4b6220=_[_0xee3e('0x42')]({},_0x4b6220,_0x1781ed[_0xee3e('0x44')]);return db[_0xee3e('0x30')][_0xee3e('0x4a')](_0x4b6220)[_0xee3e('0x28')](handleEntityNotFound(_0x104cdf,null))['then'](respondWithResult(_0x104cdf,null))[_0xee3e('0x48')](handleError(_0x104cdf,null));};exports[_0xee3e('0x4b')]=function(_0x3473a3,_0x1c1435){return db[_0xee3e('0x30')]['create'](_0x3473a3['body'],{})[_0xee3e('0x28')](function(_0x46ca92){var _0x1b7ad7=_0x3473a3[_0xee3e('0x4c')][_0xee3e('0x29')]({'plain':!![]});if(!_0x1b7ad7)throw new Error(_0xee3e('0x4d'));if(_0x1b7ad7[_0xee3e('0x4e')]===_0xee3e('0x4c')){var _0x2b32f3=_0x46ca92[_0xee3e('0x29')]({'plain':!![]});var _0xfb1468='MailQueues';return db[_0xee3e('0x4f')][_0xee3e('0x4a')]({'where':{'name':_0xfb1468,'userProfileId':_0x1b7ad7[_0xee3e('0x50')]},'raw':!![]})['then'](function(_0x2f1602){if(_0x2f1602&&_0x2f1602[_0xee3e('0x51')]===0x0){return db[_0xee3e('0x2a')][_0xee3e('0x4b')]({'name':_0x2b32f3[_0xee3e('0x2d')],'resourceId':_0x2b32f3['id'],'type':_0x2f1602[_0xee3e('0x2d')],'sectionId':_0x2f1602['id']},{})[_0xee3e('0x28')](function(){return _0x46ca92;});}else{return _0x46ca92;}})[_0xee3e('0x48')](function(_0x195725){logger[_0xee3e('0x52')](_0xee3e('0x53'),_0x195725);throw _0x195725;});}return _0x46ca92;})[_0xee3e('0x28')](respondWithResult(_0x1c1435,0xc9))[_0xee3e('0x48')](handleError(_0x1c1435,null));};exports[_0xee3e('0x26')]=function(_0x53e8ee,_0x56b41e){if(_0x53e8ee['body']['id']){delete _0x53e8ee[_0xee3e('0x54')]['id'];}return db[_0xee3e('0x30')]['find']({'where':{'id':_0x53e8ee['params']['id']}})[_0xee3e('0x28')](handleEntityNotFound(_0x56b41e,null))['then'](saveUpdates(_0x53e8ee[_0xee3e('0x54')],null))[_0xee3e('0x28')](respondWithResult(_0x56b41e,null))[_0xee3e('0x48')](handleError(_0x56b41e,null));};exports['destroy']=function(_0x104805,_0x397089){return db[_0xee3e('0x30')]['find']({'where':{'id':_0x104805['params']['id']}})[_0xee3e('0x28')](handleEntityNotFound(_0x397089,null))[_0xee3e('0x28')](removeEntity(_0x397089,null))[_0xee3e('0x48')](handleError(_0x397089,null));};exports[_0xee3e('0x55')]=function(_0x25aa1b,_0x170451){return db['MailQueue']['describe']()[_0xee3e('0x28')](respondWithResult(_0x170451,null))['catch'](handleError(_0x170451,null));};exports[_0xee3e('0x56')]=function(_0x489587,_0x5c0297,_0x741ec){var _0x59af6f={'raw':!![],'where':{}},_0x537b97={},_0x5d3beb;return db[_0xee3e('0x30')][_0xee3e('0x57')]({'where':{'id':_0x489587[_0xee3e('0x58')]['id']}})[_0xee3e('0x28')](handleEntityNotFound(_0x5c0297,null))[_0xee3e('0x28')](function(_0x149f33){if(_0x149f33){_0x5d3beb=_0x149f33['get']({'plain':!![]});_0x537b97[_0xee3e('0x39')]=_['keys'](db[_0xee3e('0x59')]['rawAttributes']);_0x537b97['query']=_['keys'](_0x489587[_0xee3e('0x35')]);_0x537b97[_0xee3e('0x37')]=_[_0xee3e('0x38')](_0x537b97[_0xee3e('0x39')],_0x537b97['query']);_0x59af6f[_0xee3e('0x3a')]=_['intersection'](_0x537b97[_0xee3e('0x39')],qs[_0xee3e('0x3b')](_0x489587['query']['fields']));_0x59af6f[_0xee3e('0x3a')]=_0x59af6f[_0xee3e('0x3a')]['length']?_0x59af6f[_0xee3e('0x3a')]:_0x537b97[_0xee3e('0x39')];if(!_0x489587[_0xee3e('0x35')][_0xee3e('0x3d')](_0xee3e('0x3e'))){_0x59af6f['limit']=qs[_0xee3e('0x1f')](_0x489587[_0xee3e('0x35')][_0xee3e('0x1f')]);_0x59af6f['offset']=qs[_0xee3e('0x1d')](_0x489587[_0xee3e('0x35')][_0xee3e('0x1d')]);}_0x59af6f[_0xee3e('0x5a')]=qs[_0xee3e('0x3f')](_0x489587[_0xee3e('0x35')][_0xee3e('0x3f')]);_0x59af6f[_0xee3e('0x40')]=qs['filters'](_['pick'](_0x489587[_0xee3e('0x35')],_0x537b97[_0xee3e('0x37')]));_0x59af6f[_0xee3e('0x40')][_0xee3e('0x5b')]=_0x149f33['id'];if(_0x489587[_0xee3e('0x35')][_0xee3e('0x43')]){_0x59af6f[_0xee3e('0x40')]=_[_0xee3e('0x42')](_0x59af6f[_0xee3e('0x40')],{'$or':_[_0xee3e('0x2f')](_0x59af6f['attributes'],function(_0x5eec66){var _0x49dc2a={};_0x49dc2a[_0x5eec66]={'$like':'%'+_0x489587[_0xee3e('0x35')][_0xee3e('0x43')]+'%'};return _0x49dc2a;})});}_0x59af6f=_[_0xee3e('0x42')]({},_0x59af6f,_0x489587['options']);return db[_0xee3e('0x59')]['findAll'](_0x59af6f);}})[_0xee3e('0x28')](function(_0x4ed167){if(_0x4ed167){return db[_0xee3e('0x5c')][_0xee3e('0x5d')]({'where':{'id':_[_0xee3e('0x2f')](_0x4ed167,_0xee3e('0x5e')),'role':_0xee3e('0x5f')},'attributes':['id',_0xee3e('0x2d'),_0xee3e('0x60'),_0xee3e('0x61'),_0xee3e('0x62')]});}})[_0xee3e('0x28')](function(_0x32186c){if(_0x32186c){return{'count':_0x32186c[_0xee3e('0x20')],'rows':_['map'](_0x32186c[_0xee3e('0x63')],function(_0x2b79f2){return{'membername':_0x2b79f2[_0xee3e('0x2d')],'UserId':_0x2b79f2['id'],'queue_name':_0x5d3beb['name'],'MailQueueId':_0x5d3beb['id'],'interface':util['format']('%s/%s',_0xee3e('0x64'),_0x2b79f2[_0xee3e('0x2d')]),'penalty':0x0,'paused':_0x2b79f2['mailPause'],'createdAt':_0x2b79f2[_0xee3e('0x62')],'updatedAt':_0x2b79f2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xee3e('0x28')](respondWithFilteredResult(_0x5c0297,_0x59af6f))[_0xee3e('0x48')](handleError(_0x5c0297,null));};exports[_0xee3e('0x65')]=function(_0x3acb75,_0x580c25,_0x2c3a2a){var _0x44195f={};var _0x4d1a83={};var _0x570e47;var _0x192699;return db[_0xee3e('0x30')][_0xee3e('0x57')]({'where':{'id':_0x3acb75[_0xee3e('0x58')]['id']}})[_0xee3e('0x28')](handleEntityNotFound(_0x580c25,null))['then'](function(_0x4acd9f){if(_0x4acd9f){_0x570e47=_0x4acd9f;_0x4d1a83[_0xee3e('0x39')]=_['keys'](db[_0xee3e('0x66')][_0xee3e('0x31')]);_0x4d1a83['query']=_[_0xee3e('0x36')](_0x3acb75['query']);_0x4d1a83['filters']=_[_0xee3e('0x38')](_0x4d1a83[_0xee3e('0x39')],_0x4d1a83[_0xee3e('0x35')]);_0x44195f['attributes']=_[_0xee3e('0x38')](_0x4d1a83[_0xee3e('0x39')],qs['fields'](_0x3acb75[_0xee3e('0x35')][_0xee3e('0x3b')]));_0x44195f['attributes']=_0x44195f['attributes'][_0xee3e('0x3c')]?_0x44195f[_0xee3e('0x3a')]:_0x4d1a83[_0xee3e('0x39')];_0x44195f[_0xee3e('0x5a')]=qs[_0xee3e('0x3f')](_0x3acb75['query'][_0xee3e('0x3f')]);_0x44195f[_0xee3e('0x40')]=qs[_0xee3e('0x37')](_[_0xee3e('0x41')](_0x3acb75[_0xee3e('0x35')],_0x4d1a83['filters']));if(_0x3acb75[_0xee3e('0x35')]['filter']){_0x44195f[_0xee3e('0x40')]=_[_0xee3e('0x42')](_0x44195f[_0xee3e('0x40')],{'$or':_['map'](_0x44195f[_0xee3e('0x3a')],function(_0x29fcd9){var _0x711176={};_0x711176[_0x29fcd9]={'$like':'%'+_0x3acb75[_0xee3e('0x35')][_0xee3e('0x43')]+'%'};return _0x711176;})});}_0x44195f=_[_0xee3e('0x42')]({},_0x44195f,_0x3acb75[_0xee3e('0x44')]);return _0x570e47[_0xee3e('0x65')](_0x44195f);}})[_0xee3e('0x28')](function(_0x431903){if(_0x431903){_0x192699=_0x431903['length'];if(!_0x3acb75[_0xee3e('0x35')][_0xee3e('0x3d')](_0xee3e('0x3e'))){_0x44195f['limit']=qs[_0xee3e('0x1f')](_0x3acb75[_0xee3e('0x35')][_0xee3e('0x1f')]);_0x44195f[_0xee3e('0x1d')]=qs[_0xee3e('0x1d')](_0x3acb75[_0xee3e('0x35')][_0xee3e('0x1d')]);}return _0x570e47[_0xee3e('0x65')](_0x44195f);}})[_0xee3e('0x28')](function(_0x28a351){if(_0x28a351){return _0x28a351?{'count':_0x192699,'rows':_0x28a351}:null;}})[_0xee3e('0x28')](respondWithResult(_0x580c25,null))[_0xee3e('0x48')](handleError(_0x580c25,null));};exports[_0xee3e('0x67')]=function(_0x2f1a70,_0x1b6cae,_0x44da2b){var _0x2048c8=_0x2f1a70[_0xee3e('0x54')][_0xee3e('0x68')];return db[_0xee3e('0x66')][_0xee3e('0x47')]({'where':{'id':_0x2048c8},'attributes':['id'],'include':[{'model':db['User'],'as':_0xee3e('0x69'),'attributes':['id',_0xee3e('0x2d'),'online','voicePause',_0xee3e('0x6a')],'raw':!![]}]})['then'](function(_0x54dec4){if(_0x54dec4){var _0x4cdc70=_[_0xee3e('0x6b')](_0x54dec4,function(_0x35b79f){var _0x2ebb30=_0x35b79f[_0xee3e('0x29')]({'plain':!![]});return _0x2ebb30[_0xee3e('0x69')];});return db[_0xee3e('0x30')][_0xee3e('0x4a')]({'where':{'id':_0x2f1a70[_0xee3e('0x58')]['id']}})[_0xee3e('0x28')](function(_0x1914ff){return db['sequelize'][_0xee3e('0x6c')](function(_0x204ee6){return _0x1914ff[_0xee3e('0x67')](_0x2048c8,{'transaction':_0x204ee6})[_0xee3e('0x28')](function(){return BPromise[_0xee3e('0x6d')](_0x4cdc70,function(_0x2ea29a){return db[_0xee3e('0x59')]['findOrCreate']({'where':{'UserId':_0x2ea29a['id'],'MailQueueId':_0x2f1a70[_0xee3e('0x58')]['id']},'transaction':_0x204ee6});});})[_0xee3e('0x28')](function(){_0x4cdc70[_0xee3e('0x6e')](function(_0xb57d31){socket[_0xee3e('0x6f')](_0xee3e('0x70'),{'UserId':_0xb57d31['id'],'MailQueueId':_0x1914ff['id']});});});});});}})[_0xee3e('0x28')](respondWithStatusCode(_0x1b6cae,null))[_0xee3e('0x48')](handleError(_0x1b6cae,null));};exports['removeTeams']=function(_0x32ccdf,_0x9ef712,_0x5e0566){return db[_0xee3e('0x66')]['findAll']({'where':{'id':_0x32ccdf[_0xee3e('0x35')][_0xee3e('0x68')]},'attributes':['id'],'include':[{'model':db[_0xee3e('0x5c')],'as':_0xee3e('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x9ef712,null))[_0xee3e('0x28')](function(_0x46f6cb){var _0x1c9c87=_[_0xee3e('0x2f')](_0x46f6cb,'id');var _0x48327e=[];var _0x285173=[];var _0x33348a=squel['select']();_0x33348a[_0xee3e('0x71')]('tq.TeamId')[_0xee3e('0x72')](_0xee3e('0x73'),'tq')['join'](_0xee3e('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xee3e('0x75'),_0x32ccdf[_0xee3e('0x58')]['id']);for(var _0x5dc005=0x0;_0x5dc005<_0x46f6cb[_0xee3e('0x3c')];_0x5dc005+=0x1){let _0x55bd53=_0x46f6cb[_0x5dc005];for(var _0x1b8863=0x0;_0x1b8863<_0x55bd53[_0xee3e('0x69')]['length'];_0x1b8863+=0x1){let _0x5befb7=_0x55bd53[_0xee3e('0x69')][_0x1b8863];var _0x2f5b5b=_0x33348a[_0xee3e('0x76')]();_0x2f5b5b[_0xee3e('0x40')](_0xee3e('0x77'),_0x5befb7['id']);_0x285173[_0xee3e('0x78')](db[_0xee3e('0x79')][_0xee3e('0x35')](_0x2f5b5b['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x17e17d){if(_0x17e17d[_0xee3e('0x3c')]===0x1){return _0x5befb7['id'];}else{var _0xcda856=_[_0xee3e('0x7a')](_[_0xee3e('0x2f')](_0x17e17d,_0xee3e('0x7b')),function(_0x44dd4e){return _['includes'](_0x1c9c87,_0x44dd4e);});if(_0xcda856){return _0x5befb7['id'];}}}));}}return BPromise['all'](_0x285173)['then'](function(_0x52da65){_0x48327e=_(_0x48327e)[_0xee3e('0x7c')](_0x52da65)['compact']()[_0xee3e('0x7d')]();return db[_0xee3e('0x30')][_0xee3e('0x4a')]({'where':{'id':_0x32ccdf[_0xee3e('0x58')]['id']}})[_0xee3e('0x28')](function(_0x20415d){return db[_0xee3e('0x79')][_0xee3e('0x6c')](function(_0xd75e18){return _0x20415d[_0xee3e('0x7e')](_0x32ccdf['query'][_0xee3e('0x68')],{'transaction':_0xd75e18})[_0xee3e('0x28')](function(){if(!_[_0xee3e('0x7f')](_0x48327e)){return _0x20415d[_0xee3e('0x80')](_0x48327e,{'transaction':_0xd75e18});}})[_0xee3e('0x28')](function(){_0x48327e['forEach'](function(_0x4fabe4){socket[_0xee3e('0x6f')](_0xee3e('0x81'),{'UserId':_0x4fabe4,'MailQueueId':_0x20415d['id']});});});});});});})['then'](respondWithStatusCode(_0x9ef712,null))[_0xee3e('0x48')](handleError(_0x9ef712,null));};exports[_0xee3e('0x82')]=function(_0x465bfe,_0x51da91,_0x4029f4){return db[_0xee3e('0x30')]['find']({'where':{'id':_0x465bfe['params']['id']}})['then'](handleEntityNotFound(_0x51da91,null))['then'](function(_0x59534e){if(_0x59534e){return _0x59534e[_0xee3e('0x82')](_0x465bfe['body'][_0xee3e('0x68')],_[_0xee3e('0x83')](_0x465bfe['body'],[_0xee3e('0x68'),'id'])||{})[_0xee3e('0x84')](function(_0x5d45ca){for(var _0x18f241=0x0;_0x18f241<_0x465bfe[_0xee3e('0x54')]['ids'][_0xee3e('0x3c')];_0x18f241+=0x1){socket['emit'](_0xee3e('0x70'),{'UserId':Number(_0x465bfe[_0xee3e('0x54')][_0xee3e('0x68')][_0x18f241]),'MailQueueId':Number(_0x465bfe[_0xee3e('0x58')]['id'])});}return _0x5d45ca;});}})[_0xee3e('0x28')](respondWithResult(_0x51da91,null))['catch'](handleError(_0x51da91,null));};exports['removeAgents']=function(_0x23b3dc,_0x3b3433,_0x2bb1eb){return db['MailQueue'][_0xee3e('0x4a')]({'where':{'id':_0x23b3dc[_0xee3e('0x58')]['id']}})[_0xee3e('0x28')](handleEntityNotFound(_0x3b3433,null))[_0xee3e('0x28')](function(_0x5d4a36){if(_0x5d4a36){return _0x5d4a36[_0xee3e('0x80')](_0x23b3dc[_0xee3e('0x35')][_0xee3e('0x68')])['then'](function(){if(_['isArray'](_0x23b3dc['query'][_0xee3e('0x68')])){for(var _0x3b06fe=0x0;_0x3b06fe<_0x23b3dc[_0xee3e('0x35')][_0xee3e('0x68')]['length'];_0x3b06fe+=0x1){socket['emit'](_0xee3e('0x81'),{'UserId':Number(_0x23b3dc['query']['ids'][_0x3b06fe]),'MailQueueId':Number(_0x23b3dc[_0xee3e('0x58')]['id'])});}}else{socket['emit'](_0xee3e('0x81'),{'UserId':Number(_0x23b3dc['query'][_0xee3e('0x68')]),'MailQueueId':Number(_0x23b3dc[_0xee3e('0x58')]['id'])});}});}})[_0xee3e('0x28')](respondWithStatusCode(_0x3b3433,null))['catch'](handleError(_0x3b3433,null));};exports[_0xee3e('0x85')]=function(_0x3147de,_0x1b15e9,_0x127e48){var _0x4d0357={};var _0xbcab4c={};var _0x298136;var _0x470a7e;return db['MailQueue']['findOne']({'where':{'id':_0x3147de['params']['id']}})[_0xee3e('0x28')](handleEntityNotFound(_0x1b15e9,null))[_0xee3e('0x28')](function(_0xe1fb2b){if(_0xe1fb2b){_0x298136=_0xe1fb2b;_0xbcab4c[_0xee3e('0x39')]=_[_0xee3e('0x36')](db[_0xee3e('0x5c')]['rawAttributes']);_0xbcab4c[_0xee3e('0x35')]=_[_0xee3e('0x36')](_0x3147de[_0xee3e('0x35')]);_0xbcab4c[_0xee3e('0x37')]=_['intersection'](_0xbcab4c[_0xee3e('0x39')],_0xbcab4c['query']);_0x4d0357[_0xee3e('0x3a')]=_[_0xee3e('0x38')](_0xbcab4c[_0xee3e('0x39')],qs[_0xee3e('0x3b')](_0x3147de[_0xee3e('0x35')][_0xee3e('0x3b')]));_0x4d0357[_0xee3e('0x3a')]=_0x4d0357['attributes'][_0xee3e('0x3c')]?_0x4d0357['attributes']:_0xbcab4c['model'];_0x4d0357['order']=qs[_0xee3e('0x3f')](_0x3147de[_0xee3e('0x35')][_0xee3e('0x3f')]);_0x4d0357['where']=qs[_0xee3e('0x37')](_[_0xee3e('0x41')](_0x3147de[_0xee3e('0x35')],_0xbcab4c[_0xee3e('0x37')]));if(_0x3147de[_0xee3e('0x35')][_0xee3e('0x43')]){_0x4d0357[_0xee3e('0x40')]=_[_0xee3e('0x42')](_0x4d0357['where'],{'$or':_['map'](_0x4d0357[_0xee3e('0x3a')],function(_0x29a715){var _0x7e5988={};_0x7e5988[_0x29a715]={'$like':'%'+_0x3147de[_0xee3e('0x35')][_0xee3e('0x43')]+'%'};return _0x7e5988;})});}_0x4d0357=_['merge']({},_0x4d0357,_0x3147de[_0xee3e('0x44')]);return _0x298136[_0xee3e('0x85')](_0x4d0357);}})[_0xee3e('0x28')](function(_0x53e987){if(_0x53e987){_0x470a7e=_0x53e987[_0xee3e('0x3c')];if(!_0x3147de[_0xee3e('0x35')][_0xee3e('0x3d')]('nolimit')){_0x4d0357[_0xee3e('0x1f')]=qs[_0xee3e('0x1f')](_0x3147de['query']['limit']);_0x4d0357[_0xee3e('0x1d')]=qs[_0xee3e('0x1d')](_0x3147de[_0xee3e('0x35')][_0xee3e('0x1d')]);}return _0x298136[_0xee3e('0x85')](_0x4d0357);}})[_0xee3e('0x28')](function(_0x2654b5){if(_0x2654b5){return _0x2654b5?{'count':_0x470a7e,'rows':_0x2654b5}:null;}})[_0xee3e('0x28')](respondWithResult(_0x1b15e9,null))[_0xee3e('0x48')](handleError(_0x1b15e9,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 936972b..1ef7e01 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 _0x7090=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x12d040,_0x328000){var _0x3b5e0c=function(_0x35e4be){while(--_0x35e4be){_0x12d040['push'](_0x12d040['shift']());}};_0x3b5e0c(++_0x328000);}(_0x7090,0x151));var _0x0709=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0x7090[_0x3c487b];return _0x1d65f6;};'use strict';var EventEmitter=require(_0x0709('0x0'));var MailQueue=require(_0x0709('0x1'))['db'][_0x0709('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0709('0x3'),'afterUpdate':_0x0709('0x4'),'afterDestroy':_0x0709('0x5')};function emitEvent(_0x55d0e2){return function(_0x390fb9,_0x50053a,_0xc0221){MailQueueEvents[_0x0709('0x6')](_0x55d0e2+':'+_0x390fb9['id'],_0x390fb9);MailQueueEvents[_0x0709('0x6')](_0x55d0e2,_0x390fb9);_0xc0221(null);};}for(var e in events){if(events[_0x0709('0x7')](e)){var event=events[e];MailQueue[_0x0709('0x8')](e,emitEvent(event));}}module[_0x0709('0x9')]=MailQueueEvents; \ No newline at end of file +var _0xb597=['exports','events','../../mysqldb','save','remove','emit','hasOwnProperty','hook'];(function(_0x3e70b0,_0x2b748c){var _0x49493f=function(_0x34abc3){while(--_0x34abc3){_0x3e70b0['push'](_0x3e70b0['shift']());}};_0x49493f(++_0x2b748c);}(_0xb597,0xa1));var _0x7b59=function(_0x5e8a06,_0x424283){_0x5e8a06=_0x5e8a06-0x0;var _0x1dd6ed=_0xb597[_0x5e8a06];return _0x1dd6ed;};'use strict';var EventEmitter=require(_0x7b59('0x0'));var MailQueue=require(_0x7b59('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7b59('0x2'),'afterUpdate':'update','afterDestroy':_0x7b59('0x3')};function emitEvent(_0x1c49ff){return function(_0x1ccfc7,_0x1e3335,_0x37c828){MailQueueEvents[_0x7b59('0x4')](_0x1c49ff+':'+_0x1ccfc7['id'],_0x1ccfc7);MailQueueEvents[_0x7b59('0x4')](_0x1c49ff,_0x1ccfc7);_0x37c828(null);};}for(var e in events){if(events[_0x7b59('0x5')](e)){var event=events[e];MailQueue[_0x7b59('0x6')](e,emitEvent(event));}}module[_0x7b59('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 25c845b..fe6d83a 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 _0x009f=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4ecbaf,_0x2c1e70){var _0xe2e141=function(_0x51d03e){while(--_0x51d03e){_0x4ecbaf['push'](_0x4ecbaf['shift']());}};_0xe2e141(++_0x2c1e70);}(_0x009f,0x15f));var _0xf009=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0x009f[_0x1269c6];return _0x4868c7;};'use strict';var _=require(_0xf009('0x0'));var util=require(_0xf009('0x1'));var logger=require(_0xf009('0x2'))(_0xf009('0x3'));var moment=require(_0xf009('0x4'));var BPromise=require(_0xf009('0x5'));var rp=require(_0xf009('0x6'));var fs=require('fs');var path=require(_0xf009('0x7'));var rimraf=require(_0xf009('0x8'));var config=require(_0xf009('0x9'));var attributes=require(_0xf009('0xa'));module[_0xf009('0xb')]=function(_0x8331f4,_0x5c6a55){return _0x8331f4[_0xf009('0xc')](_0xf009('0xd'),attributes,{'tableName':_0xf009('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e26=['./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x49d886,_0x133fe8){var _0x32ff8f=function(_0x1c10b4){while(--_0x1c10b4){_0x49d886['push'](_0x49d886['shift']());}};_0x32ff8f(++_0x133fe8);}(_0x2e26,0x190));var _0x62e2=function(_0x10d8c7,_0xa80d12){_0x10d8c7=_0x10d8c7-0x0;var _0x4105b9=_0x2e26[_0x10d8c7];return _0x4105b9;};'use strict';var _=require(_0x62e2('0x0'));var util=require(_0x62e2('0x1'));var logger=require(_0x62e2('0x2'))('api');var moment=require(_0x62e2('0x3'));var BPromise=require('bluebird');var rp=require(_0x62e2('0x4'));var fs=require('fs');var path=require(_0x62e2('0x5'));var rimraf=require(_0x62e2('0x6'));var config=require(_0x62e2('0x7'));var attributes=require(_0x62e2('0x8'));module[_0x62e2('0x9')]=function(_0x32d3f5,_0x58762f){return _0x32d3f5[_0x62e2('0xa')](_0x62e2('0xb'),attributes,{'tableName':'mail_queues','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 585d793..57988a3 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 _0x61a3=['ShowMailQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0x61a3,0x1ef));var _0x361a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x61a3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x361a('0x0'));var util=require(_0x361a('0x1'));var moment=require(_0x361a('0x2'));var BPromise=require('bluebird');var rs=require(_0x361a('0x3'));var fs=require('fs');var Redis=require(_0x361a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x361a('0x5'));var logger=require(_0x361a('0x6'))(_0x361a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x361a('0x8')][_0x361a('0x9')]({'port':0x232a});config['redis']=_[_0x361a('0xa')](config[_0x361a('0xb')],{'host':_0x361a('0xc'),'port':0x18eb});var socket=require(_0x361a('0xd'))(new Redis(config['redis']));require(_0x361a('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a6831,_0x467920,_0x55cfd7){return new BPromise(function(_0x4ec0a3,_0x32a99e){return client[_0x361a('0xf')](_0x4a6831,_0x55cfd7)[_0x361a('0x10')](function(_0x3fff96){logger[_0x361a('0x11')](_0x361a('0x12'),_0x467920,'request\x20sent');logger[_0x361a('0x13')](_0x361a('0x14'),_0x467920,_0x361a('0x15'),JSON[_0x361a('0x16')](_0x3fff96));if(_0x3fff96[_0x361a('0x17')]){if(_0x3fff96[_0x361a('0x17')]['code']===0x1f4){logger[_0x361a('0x17')](_0x361a('0x12'),_0x467920,_0x3fff96['error'][_0x361a('0x18')]);return _0x32a99e(_0x3fff96[_0x361a('0x17')][_0x361a('0x18')]);}logger[_0x361a('0x17')]('MailQueue,\x20%s,\x20%s',_0x467920,_0x3fff96[_0x361a('0x17')]['message']);return _0x4ec0a3(_0x3fff96[_0x361a('0x17')]['message']);}else{logger[_0x361a('0x11')](_0x361a('0x12'),_0x467920,_0x361a('0x15'));_0x4ec0a3(_0x3fff96[_0x361a('0x19')][_0x361a('0x18')]);}})[_0x361a('0x1a')](function(_0x12423e){logger[_0x361a('0x17')](_0x361a('0x12'),_0x467920,_0x12423e);_0x32a99e(_0x12423e);});});}exports[_0x361a('0x1b')]=function(_0x6b2ecb){var _0x5eb846=this;return new Promise(function(_0x2e61a8,_0x114032){return db[_0x361a('0x1c')][_0x361a('0x1d')]({'raw':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb[_0x361a('0x1e')][_0x361a('0x1f')]===undefined?!![]:![]:!![],'where':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb[_0x361a('0x1e')][_0x361a('0x20')]||null:null,'attributes':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb['options'][_0x361a('0x21')]||null:null,'limit':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb[_0x361a('0x1e')]['limit']||null:null,'include':_0x6b2ecb[_0x361a('0x1e')]?_0x6b2ecb[_0x361a('0x1e')][_0x361a('0x22')]?_[_0x361a('0x23')](_0x6b2ecb[_0x361a('0x1e')][_0x361a('0x22')],function(_0x4789a1){return{'model':db[_0x4789a1[_0x361a('0x24')]],'as':_0x4789a1['as'],'attributes':_0x4789a1[_0x361a('0x21')],'include':_0x4789a1['include']?_[_0x361a('0x23')](_0x4789a1[_0x361a('0x22')],function(_0x4f65d7){return{'model':db[_0x4f65d7[_0x361a('0x24')]],'as':_0x4f65d7['as'],'attributes':_0x4f65d7[_0x361a('0x21')],'include':_0x4f65d7[_0x361a('0x22')]?_[_0x361a('0x23')](_0x4f65d7[_0x361a('0x22')],function(_0x4179c4){return{'model':db[_0x4179c4['model']],'as':_0x4179c4['as'],'attributes':_0x4179c4[_0x361a('0x21')]};}):[]};}):[]};}):[]:[]})[_0x361a('0x10')](function(_0x3895a1){logger[_0x361a('0x11')]('GetMailQueue',_0x6b2ecb);logger[_0x361a('0x13')](_0x361a('0x1b'),_0x6b2ecb,JSON['stringify'](_0x3895a1));_0x2e61a8(_0x3895a1);})[_0x361a('0x1a')](function(_0x309bd8){logger['error'](_0x361a('0x1b'),_0x309bd8[_0x361a('0x18')],_0x6b2ecb);_0x114032(_0x5eb846[_0x361a('0x17')](0x1f4,_0x309bd8['message']));});});};exports['ShowMailQueue']=function(_0x4d1775){var _0x1cef5e=this;return new Promise(function(_0x110441,_0xe0b267){return db['MailQueue']['find']({'raw':_0x4d1775['options']?_0x4d1775[_0x361a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4d1775[_0x361a('0x1e')]?_0x4d1775[_0x361a('0x1e')][_0x361a('0x20')]||null:null,'attributes':_0x4d1775[_0x361a('0x1e')]?_0x4d1775[_0x361a('0x1e')][_0x361a('0x21')]||null:null,'include':_0x4d1775[_0x361a('0x1e')]?_0x4d1775[_0x361a('0x1e')][_0x361a('0x22')]?_['map'](_0x4d1775['options'][_0x361a('0x22')],function(_0x370e15){return{'model':db[_0x370e15[_0x361a('0x24')]],'as':_0x370e15['as'],'attributes':_0x370e15['attributes'],'include':_0x370e15['include']?_[_0x361a('0x23')](_0x370e15['include'],function(_0x4119d7){return{'model':db[_0x4119d7[_0x361a('0x24')]],'as':_0x4119d7['as'],'attributes':_0x4119d7[_0x361a('0x21')],'include':_0x4119d7[_0x361a('0x22')]?_['map'](_0x4119d7[_0x361a('0x22')],function(_0x1b4401){return{'model':db[_0x1b4401['model']],'as':_0x1b4401['as'],'attributes':_0x1b4401['attributes']};}):[]};}):[]};}):[]:[]})[_0x361a('0x10')](function(_0xb5695){logger['info'](_0x361a('0x25'),_0x4d1775);logger['debug'](_0x361a('0x25'),_0x4d1775,JSON[_0x361a('0x16')](_0xb5695));_0x110441(_0xb5695);})[_0x361a('0x1a')](function(_0x5b4c32){logger[_0x361a('0x17')](_0x361a('0x25'),_0x5b4c32[_0x361a('0x18')],_0x4d1775);_0xe0b267(_0x1cef5e[_0x361a('0x17')](0x1f4,_0x5b4c32['message']));});});}; \ No newline at end of file +var _0x24f1=['model','ShowMailQueue','MailQueue','raw','info','debug','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','findAll','options','where','attributes','limit','include','map'];(function(_0xedf145,_0x54c4d9){var _0xd6f9b9=function(_0x21eb75){while(--_0x21eb75){_0xedf145['push'](_0xedf145['shift']());}};_0xd6f9b9(++_0x54c4d9);}(_0x24f1,0xf0));var _0x124f=function(_0x2655c3,_0x15f530){_0x2655c3=_0x2655c3-0x0;var _0x512269=_0x24f1[_0x2655c3];return _0x512269;};'use strict';var _=require(_0x124f('0x0'));var util=require(_0x124f('0x1'));var moment=require(_0x124f('0x2'));var BPromise=require(_0x124f('0x3'));var rs=require(_0x124f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x124f('0x5'))('rpc');var config=require(_0x124f('0x6'));var jayson=require(_0x124f('0x7'));var client=jayson[_0x124f('0x8')]['http']({'port':0x232a});config[_0x124f('0x9')]=_[_0x124f('0xa')](config[_0x124f('0x9')],{'host':_0x124f('0xb'),'port':0x18eb});var socket=require(_0x124f('0xc'))(new Redis(config[_0x124f('0x9')]));require(_0x124f('0xd'))[_0x124f('0xe')](socket);function respondWithRpcPromise(_0x3de8af,_0x22de1b,_0x30d5a7){return new BPromise(function(_0x2d6e74,_0x5f23b8){return client[_0x124f('0xf')](_0x3de8af,_0x30d5a7)[_0x124f('0x10')](function(_0x2c7742){logger['info']('MailQueue,\x20%s,\x20%s',_0x22de1b,'request\x20sent');logger['debug'](_0x124f('0x11'),_0x22de1b,_0x124f('0x12'),JSON[_0x124f('0x13')](_0x2c7742));if(_0x2c7742[_0x124f('0x14')]){if(_0x2c7742[_0x124f('0x14')]['code']===0x1f4){logger[_0x124f('0x14')](_0x124f('0x15'),_0x22de1b,_0x2c7742[_0x124f('0x14')]['message']);return _0x5f23b8(_0x2c7742[_0x124f('0x14')]['message']);}logger[_0x124f('0x14')]('MailQueue,\x20%s,\x20%s',_0x22de1b,_0x2c7742[_0x124f('0x14')][_0x124f('0x16')]);return _0x2d6e74(_0x2c7742[_0x124f('0x14')]['message']);}else{logger['info'](_0x124f('0x15'),_0x22de1b,'request\x20sent');_0x2d6e74(_0x2c7742[_0x124f('0x17')][_0x124f('0x16')]);}})[_0x124f('0x18')](function(_0x512be8){logger[_0x124f('0x14')]('MailQueue,\x20%s,\x20%s',_0x22de1b,_0x512be8);_0x5f23b8(_0x512be8);});});}exports[_0x124f('0x19')]=function(_0x578c28){var _0x477ee=this;return new Promise(function(_0x2a43a3,_0x4521d9){return db['MailQueue'][_0x124f('0x1a')]({'raw':_0x578c28[_0x124f('0x1b')]?_0x578c28['options']['raw']===undefined?!![]:![]:!![],'where':_0x578c28[_0x124f('0x1b')]?_0x578c28[_0x124f('0x1b')][_0x124f('0x1c')]||null:null,'attributes':_0x578c28['options']?_0x578c28[_0x124f('0x1b')][_0x124f('0x1d')]||null:null,'limit':_0x578c28[_0x124f('0x1b')]?_0x578c28[_0x124f('0x1b')][_0x124f('0x1e')]||null:null,'include':_0x578c28[_0x124f('0x1b')]?_0x578c28[_0x124f('0x1b')][_0x124f('0x1f')]?_[_0x124f('0x20')](_0x578c28[_0x124f('0x1b')][_0x124f('0x1f')],function(_0x2bc23a){return{'model':db[_0x2bc23a[_0x124f('0x21')]],'as':_0x2bc23a['as'],'attributes':_0x2bc23a['attributes'],'include':_0x2bc23a[_0x124f('0x1f')]?_[_0x124f('0x20')](_0x2bc23a[_0x124f('0x1f')],function(_0x9e71be){return{'model':db[_0x9e71be[_0x124f('0x21')]],'as':_0x9e71be['as'],'attributes':_0x9e71be[_0x124f('0x1d')],'include':_0x9e71be[_0x124f('0x1f')]?_[_0x124f('0x20')](_0x9e71be[_0x124f('0x1f')],function(_0x5efafc){return{'model':db[_0x5efafc[_0x124f('0x21')]],'as':_0x5efafc['as'],'attributes':_0x5efafc['attributes']};}):[]};}):[]};}):[]:[]})[_0x124f('0x10')](function(_0x5a1f1d){logger['info'](_0x124f('0x19'),_0x578c28);logger['debug'](_0x124f('0x19'),_0x578c28,JSON['stringify'](_0x5a1f1d));_0x2a43a3(_0x5a1f1d);})[_0x124f('0x18')](function(_0x185e42){logger['error'](_0x124f('0x19'),_0x185e42[_0x124f('0x16')],_0x578c28);_0x4521d9(_0x477ee[_0x124f('0x14')](0x1f4,_0x185e42[_0x124f('0x16')]));});});};exports[_0x124f('0x22')]=function(_0x42cd7d){var _0x3c1105=this;return new Promise(function(_0x378061,_0x2c751e){return db[_0x124f('0x23')]['find']({'raw':_0x42cd7d['options']?_0x42cd7d[_0x124f('0x1b')][_0x124f('0x24')]===undefined?!![]:![]:!![],'where':_0x42cd7d[_0x124f('0x1b')]?_0x42cd7d[_0x124f('0x1b')][_0x124f('0x1c')]||null:null,'attributes':_0x42cd7d[_0x124f('0x1b')]?_0x42cd7d[_0x124f('0x1b')][_0x124f('0x1d')]||null:null,'include':_0x42cd7d[_0x124f('0x1b')]?_0x42cd7d[_0x124f('0x1b')]['include']?_[_0x124f('0x20')](_0x42cd7d['options'][_0x124f('0x1f')],function(_0x445a17){return{'model':db[_0x445a17['model']],'as':_0x445a17['as'],'attributes':_0x445a17[_0x124f('0x1d')],'include':_0x445a17[_0x124f('0x1f')]?_[_0x124f('0x20')](_0x445a17['include'],function(_0x169e06){return{'model':db[_0x169e06[_0x124f('0x21')]],'as':_0x169e06['as'],'attributes':_0x169e06[_0x124f('0x1d')],'include':_0x169e06[_0x124f('0x1f')]?_[_0x124f('0x20')](_0x169e06[_0x124f('0x1f')],function(_0x4a82bd){return{'model':db[_0x4a82bd['model']],'as':_0x4a82bd['as'],'attributes':_0x4a82bd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42d4a9){logger[_0x124f('0x25')](_0x124f('0x22'),_0x42cd7d);logger[_0x124f('0x26')](_0x124f('0x22'),_0x42cd7d,JSON['stringify'](_0x42d4a9));_0x378061(_0x42d4a9);})[_0x124f('0x18')](function(_0x37b936){logger[_0x124f('0x14')](_0x124f('0x22'),_0x37b936[_0x124f('0x16')],_0x42cd7d);_0x2c751e(_0x3c1105['error'](0x1f4,_0x37b936[_0x124f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index fab1000..10d90fb 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 _0x0630=['remove','update','emit','register','mailQueue:','./mailQueue.events','save'];(function(_0x17549e,_0x42dfdb){var _0x55d0e3=function(_0x283eeb){while(--_0x283eeb){_0x17549e['push'](_0x17549e['shift']());}};_0x55d0e3(++_0x42dfdb);}(_0x0630,0xde));var _0x0063=function(_0x5edeb9,_0x1221d3){_0x5edeb9=_0x5edeb9-0x0;var _0xf78954=_0x0630[_0x5edeb9];return _0xf78954;};'use strict';var MailQueueEvents=require(_0x0063('0x0'));var events=[_0x0063('0x1'),_0x0063('0x2'),_0x0063('0x3')];function createListener(_0x1d8469,_0x252b42){return function(_0x4d9183){_0x252b42[_0x0063('0x4')](_0x1d8469,_0x4d9183);};}function removeListener(_0x1490f7,_0x389dec){return function(){MailQueueEvents['removeListener'](_0x1490f7,_0x389dec);};}exports[_0x0063('0x5')]=function(_0x57a966){for(var _0x14ff3d=0x0,_0x51e3e2=events['length'];_0x14ff3d<_0x51e3e2;_0x14ff3d++){var _0x19aeb2=events[_0x14ff3d];var _0x5c3dda=createListener(_0x0063('0x6')+_0x19aeb2,_0x57a966);MailQueueEvents['on'](_0x19aeb2,_0x5c3dda);}}; \ No newline at end of file +var _0x62ff=['save','update','emit','register','mailQueue:','./mailQueue.events'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x62ff,0x1e5));var _0xf62f=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x62ff[_0x2b9b7f];return _0x4ed19a;};'use strict';var MailQueueEvents=require(_0xf62f('0x0'));var events=[_0xf62f('0x1'),'remove',_0xf62f('0x2')];function createListener(_0x387324,_0x30ba33){return function(_0x155496){_0x30ba33[_0xf62f('0x3')](_0x387324,_0x155496);};}function removeListener(_0x1b9b6a,_0x768aa7){return function(){MailQueueEvents['removeListener'](_0x1b9b6a,_0x768aa7);};}exports[_0xf62f('0x4')]=function(_0x184856){for(var _0x462e35=0x0,_0x4da9c1=events['length'];_0x462e35<_0x4da9c1;_0x462e35++){var _0x4c3b89=events[_0x462e35];var _0x245306=createListener(_0xf62f('0x5')+_0x4c3b89,_0x184856);MailQueueEvents['on'](_0x4c3b89,_0x245306);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ccf7bd1..70c0079 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 _0x2e6c=['../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x579eba,_0x42c908){var _0x385fd4=function(_0x1ba91b){while(--_0x1ba91b){_0x579eba['push'](_0x579eba['shift']());}};_0x385fd4(++_0x42c908);}(_0x2e6c,0xc6));var _0xc2e6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2e6c[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xc2e6('0x0'));var util=require(_0xc2e6('0x1'));var path=require(_0xc2e6('0x2'));var timeout=require(_0xc2e6('0x3'));var express=require(_0xc2e6('0x4'));var router=express[_0xc2e6('0x5')]();var fs_extra=require(_0xc2e6('0x6'));var auth=require(_0xc2e6('0x7'));var interaction=require(_0xc2e6('0x8'));var config=require(_0xc2e6('0x9'));var controller=require(_0xc2e6('0xa'));router[_0xc2e6('0xb')]('/',auth[_0xc2e6('0xc')](),controller[_0xc2e6('0xd')]);router[_0xc2e6('0xb')](_0xc2e6('0xe'),auth['isAuthenticated'](),controller[_0xc2e6('0xf')]);router[_0xc2e6('0xb')]('/:id',auth[_0xc2e6('0xc')](),controller[_0xc2e6('0x10')]);router['post']('/',auth[_0xc2e6('0xc')](),controller[_0xc2e6('0x11')]);router[_0xc2e6('0x12')](_0xc2e6('0x13'),auth[_0xc2e6('0xc')](),controller[_0xc2e6('0x14')]);router[_0xc2e6('0x15')](_0xc2e6('0x13'),auth[_0xc2e6('0xc')](),controller[_0xc2e6('0x16')]);module['exports']=router; \ No newline at end of file +var _0xfe12=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b834f,_0x23172e){var _0x4b95d9=function(_0x166690){while(--_0x166690){_0x4b834f['push'](_0x4b834f['shift']());}};_0x4b95d9(++_0x23172e);}(_0xfe12,0x15c));var _0x2fe1=function(_0x3a9083,_0x3c9f8d){_0x3a9083=_0x3a9083-0x0;var _0x160306=_0xfe12[_0x3a9083];return _0x160306;};'use strict';var multer=require(_0x2fe1('0x0'));var util=require(_0x2fe1('0x1'));var path=require(_0x2fe1('0x2'));var timeout=require(_0x2fe1('0x3'));var express=require(_0x2fe1('0x4'));var router=express['Router']();var fs_extra=require(_0x2fe1('0x5'));var auth=require(_0x2fe1('0x6'));var interaction=require(_0x2fe1('0x7'));var config=require(_0x2fe1('0x8'));var controller=require('./mailQueueReport.controller');router[_0x2fe1('0x9')]('/',auth[_0x2fe1('0xa')](),controller[_0x2fe1('0xb')]);router[_0x2fe1('0x9')](_0x2fe1('0xc'),auth[_0x2fe1('0xa')](),controller[_0x2fe1('0xd')]);router[_0x2fe1('0x9')](_0x2fe1('0xe'),auth[_0x2fe1('0xa')](),controller[_0x2fe1('0xf')]);router[_0x2fe1('0x10')]('/',auth['isAuthenticated'](),controller[_0x2fe1('0x11')]);router[_0x2fe1('0x12')](_0x2fe1('0xe'),auth[_0x2fe1('0xa')](),controller['update']);router[_0x2fe1('0x13')](_0x2fe1('0xe'),auth[_0x2fe1('0xa')](),controller['destroy']);module[_0x2fe1('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index d83e29d..5799a9d 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 _0x7e44=['moment','sequelize','exports','DATE'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x7e44,0x114));var _0x47e4=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0x7e44[_0x3457b4];return _0xaa8fa9;};'use strict';var moment=require(_0x47e4('0x0'));var Sequelize=require(_0x47e4('0x1'));module[_0x47e4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47e4('0x3')]},'leaveAt':{'type':Sequelize[_0x47e4('0x3')]},'acceptAt':{'type':Sequelize[_0x47e4('0x3')]},'exitAt':{'type':Sequelize[_0x47e4('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a6b=['sequelize','exports','STRING','DATE','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9a6b,0x77));var _0xb9a6=function(_0x49933b,_0x3d9e32){_0x49933b=_0x49933b-0x0;var _0x402d1d=_0x9a6b[_0x49933b];return _0x402d1d;};'use strict';var moment=require(_0xb9a6('0x0'));var Sequelize=require(_0xb9a6('0x1'));module[_0xb9a6('0x2')]={'uniqueid':{'type':Sequelize[_0xb9a6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb9a6('0x3')]},'joinAt':{'type':Sequelize[_0xb9a6('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb9a6('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb9a6('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 8339475..add6023 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 _0x90b1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','MailQueueReport','includeAll','rows','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','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','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x162c32,_0x1bbbbb){var _0xfb6f69=function(_0xf394f8){while(--_0xf394f8){_0x162c32['push'](_0x162c32['shift']());}};_0xfb6f69(++_0x1bbbbb);}(_0x90b1,0x1bb));var _0x190b=function(_0x13b3f2,_0x1f230e){_0x13b3f2=_0x13b3f2-0x0;var _0x476495=_0x90b1[_0x13b3f2];return _0x476495;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['MailQueueReport'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['MailQueueReport'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};exports[_0x190b('0x45')]=function(_0x33cc78,_0x2ea1c8){return db[_0x190b('0x3d')][_0x190b('0x45')]()[_0x190b('0x22')](respondWithResult(_0x2ea1c8,null))['catch'](handleError(_0x2ea1c8,null));}; \ No newline at end of file +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(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x258e34,_0x5d51f6){_0x258e34=_0x258e34-0x0;var _0x4ab218=_0xa6b0[_0x258e34];return _0x4ab218;};'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 diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ec791f5..40259e9 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 _0x395b=['lodash','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid'];(function(_0x1bebe5,_0x32e0d3){var _0x568429=function(_0x2306f0){while(--_0x2306f0){_0x1bebe5['push'](_0x1bebe5['shift']());}};_0x568429(++_0x32e0d3);}(_0x395b,0x79));var _0xb395=function(_0x246cbe,_0x19305c){_0x246cbe=_0x246cbe-0x0;var _0x855b0=_0x395b[_0x246cbe];return _0x855b0;};'use strict';var _=require(_0xb395('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb395('0x1'));var BPromise=require(_0xb395('0x2'));var rp=require(_0xb395('0x3'));var fs=require('fs');var path=require(_0xb395('0x4'));var rimraf=require(_0xb395('0x5'));var config=require('../../config/environment');var attributes=require(_0xb395('0x6'));module[_0xb395('0x7')]=function(_0x14b806,_0x4bb8fa){return _0x14b806[_0xb395('0x8')]('MailQueueReport',attributes,{'tableName':_0xb395('0x9'),'paranoid':![],'indexes':[{'name':_0xb395('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x55f6=['../../config/environment','./mailQueueReport.attributes','exports','define','uniqueid','../../config/logger','api','moment','path','rimraf'];(function(_0x376eb0,_0x397838){var _0x20cb6b=function(_0x44c6f3){while(--_0x44c6f3){_0x376eb0['push'](_0x376eb0['shift']());}};_0x20cb6b(++_0x397838);}(_0x55f6,0x159));var _0x655f=function(_0x29a8f8,_0x3b4263){_0x29a8f8=_0x29a8f8-0x0;var _0x5bf4c8=_0x55f6[_0x29a8f8];return _0x5bf4c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x655f('0x0'))(_0x655f('0x1'));var moment=require(_0x655f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x655f('0x3'));var rimraf=require(_0x655f('0x4'));var config=require(_0x655f('0x5'));var attributes=require(_0x655f('0x6'));module[_0x655f('0x7')]=function(_0x175cb8,_0x4d6baa){return _0x175cb8[_0x655f('0x8')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x655f('0x9'),'fields':[_0x655f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b16604c..95c6303 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 _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(_0x58e30d,_0x52a0a0){var _0x4732d8=function(_0x232642){while(--_0x232642){_0x58e30d['push'](_0x58e30d['shift']());}};_0x4732d8(++_0x52a0a0);}(_0x7a54,0x106));var _0x47a5=function(_0x59e23b,_0x4a84c1){_0x59e23b=_0x59e23b-0x0;var _0x5b0826=_0x7a54[_0x59e23b];return _0x5b0826;};'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 +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(_0x2f922f,_0x34a14f){var _0x4a63d4=function(_0x251b57){while(--_0x251b57){_0x2f922f['push'](_0x2f922f['shift']());}};_0x4a63d4(++_0x34a14f);}(_0x2ef3,0xba));var _0x32ef=function(_0x3088ce,_0x12a902){_0x3088ce=_0x3088ce-0x0;var _0x323117=_0x2ef3[_0x3088ce];return _0x323117;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 985a9b3..1374716 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x29682e,_0x45ba07){var _0x2a2617=function(_0x16874b){while(--_0x16874b){_0x29682e['push'](_0x29682e['shift']());}};_0x2a2617(++_0x45ba07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x505b1,_0x3f2a5d){var _0x6f5380=function(_0x439bda){while(--_0x439bda){_0x505b1['push'](_0x505b1['shift']());}};_0x6f5380(++_0x3f2a5d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 0a7685a..f1eb8b8 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 _0xd4f4=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x16c87d,_0xdd8e34){var _0x2b577e=function(_0x4f20f2){while(--_0x4f20f2){_0x16c87d['push'](_0x16c87d['shift']());}};_0x2b577e(++_0xdd8e34);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x51a3a8,_0x279784){_0x51a3a8=_0x51a3a8-0x0;var _0x5e5d7b=_0xd4f4[_0x51a3a8];return _0x5e5d7b;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'description':{'type':Sequelize[_0x4d4f('0x2')]},'host':{'type':Sequelize[_0x4d4f('0x2')]},'authentication':{'type':Sequelize[_0x4d4f('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4d4f('0x2')]},'password':{'type':Sequelize[_0x4d4f('0x2')]},'port':{'type':Sequelize[_0x4d4f('0x4')]},'tls':{'type':Sequelize[_0x4d4f('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4d4f('0x2')],'defaultValue':_0x4d4f('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0427=['INTEGER','BOOLEAN','INBOX','STRING'];(function(_0x27419b,_0x3be7c3){var _0x13f68e=function(_0x4f2f57){while(--_0x4f2f57){_0x27419b['push'](_0x27419b['shift']());}};_0x13f68e(++_0x3be7c3);}(_0x0427,0x137));var _0x7042=function(_0x419053,_0x29b2e8){_0x419053=_0x419053-0x0;var _0x4cf8a8=_0x0427[_0x419053];return _0x4cf8a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7042('0x0')]},'host':{'type':Sequelize[_0x7042('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x7042('0x0')]},'password':{'type':Sequelize[_0x7042('0x0')]},'port':{'type':Sequelize[_0x7042('0x1')]},'tls':{'type':Sequelize[_0x7042('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7042('0x0')],'defaultValue':_0x7042('0x3')},'connTimeout':{'type':Sequelize[_0x7042('0x1')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x7042('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 38a6dd4..53f570e 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 _0x6b03=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in'];(function(_0x2966c1,_0x529da1){var _0xfd97d0=function(_0x455efe){while(--_0x455efe){_0x2966c1['push'](_0x2966c1['shift']());}};_0xfd97d0(++_0x529da1);}(_0x6b03,0x70));var _0x36b0=function(_0x317821,_0x28b1c7){_0x317821=_0x317821-0x0;var _0xd6a558=_0x6b03[_0x317821];return _0xd6a558;};'use strict';var _=require(_0x36b0('0x0'));var util=require(_0x36b0('0x1'));var logger=require(_0x36b0('0x2'))(_0x36b0('0x3'));var moment=require(_0x36b0('0x4'));var BPromise=require(_0x36b0('0x5'));var rp=require(_0x36b0('0x6'));var fs=require('fs');var path=require(_0x36b0('0x7'));var rimraf=require('rimraf');var config=require(_0x36b0('0x8'));var attributes=require(_0x36b0('0x9'));module[_0x36b0('0xa')]=function(_0x59f170,_0x271a67){return _0x59f170[_0x36b0('0xb')](_0x36b0('0xc'),attributes,{'tableName':_0x36b0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbbb=['util','../../config/logger','api','moment','request-promise','path','exports','MailServerIn','mail_servers_in','lodash'];(function(_0x4ba773,_0x5cab80){var _0x4068c4=function(_0x26b14b){while(--_0x26b14b){_0x4ba773['push'](_0x4ba773['shift']());}};_0x4068c4(++_0x5cab80);}(_0xdbbb,0x1a3));var _0xbdbb=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0xdbbb[_0x57966a];return _0x191765;};'use strict';var _=require(_0xbdbb('0x0'));var util=require(_0xbdbb('0x1'));var logger=require(_0xbdbb('0x2'))(_0xbdbb('0x3'));var moment=require(_0xbdbb('0x4'));var BPromise=require('bluebird');var rp=require(_0xbdbb('0x5'));var fs=require('fs');var path=require(_0xbdbb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0xbdbb('0x7')]=function(_0x5e9a13,_0x1b092c){return _0x5e9a13['define'](_0xbdbb('0x8'),attributes,{'tableName':_0xbdbb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 620c3bb..06bc026 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 _0x851d=['options','raw','where','attributes','limit','include','map','model','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','GetMailServerIn','findAll'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd851('0x0'));var util=require('util');var moment=require(_0xd851('0x1'));var BPromise=require(_0xd851('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd851('0x3'));var db=require(_0xd851('0x4'))['db'];var utils=require(_0xd851('0x5'));var logger=require(_0xd851('0x6'))(_0xd851('0x7'));var config=require(_0xd851('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd851('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b63e4,_0x3d2383,_0x2f9540){return new BPromise(function(_0x60bef0,_0x4554d8){return client['request'](_0x2b63e4,_0x2f9540)[_0xd851('0xa')](function(_0x51bf16){logger[_0xd851('0xb')](_0xd851('0xc'),_0x3d2383,'request\x20sent');logger[_0xd851('0xd')](_0xd851('0xe'),_0x3d2383,_0xd851('0xf'),JSON[_0xd851('0x10')](_0x51bf16));if(_0x51bf16['error']){if(_0x51bf16['error'][_0xd851('0x11')]===0x1f4){logger[_0xd851('0x12')](_0xd851('0xc'),_0x3d2383,_0x51bf16[_0xd851('0x12')]['message']);return _0x4554d8(_0x51bf16[_0xd851('0x12')][_0xd851('0x13')]);}logger['error'](_0xd851('0xc'),_0x3d2383,_0x51bf16[_0xd851('0x12')][_0xd851('0x13')]);return _0x60bef0(_0x51bf16['error'][_0xd851('0x13')]);}else{logger[_0xd851('0xb')](_0xd851('0xc'),_0x3d2383,_0xd851('0xf'));_0x60bef0(_0x51bf16[_0xd851('0x14')][_0xd851('0x13')]);}})['catch'](function(_0x448e31){logger[_0xd851('0x12')](_0xd851('0xc'),_0x3d2383,_0x448e31);_0x4554d8(_0x448e31);});});}exports[_0xd851('0x15')]=function(_0x12b309){var _0x2be9c9=this;return new Promise(function(_0x3559a1,_0x5e7bb0){return db['MailServerIn'][_0xd851('0x16')]({'raw':_0x12b309[_0xd851('0x17')]?_0x12b309[_0xd851('0x17')][_0xd851('0x18')]===undefined?!![]:![]:!![],'where':_0x12b309[_0xd851('0x17')]?_0x12b309[_0xd851('0x17')][_0xd851('0x19')]||null:null,'attributes':_0x12b309[_0xd851('0x17')]?_0x12b309[_0xd851('0x17')][_0xd851('0x1a')]||null:null,'limit':_0x12b309[_0xd851('0x17')]?_0x12b309[_0xd851('0x17')][_0xd851('0x1b')]||null:null,'include':_0x12b309['options']?_0x12b309[_0xd851('0x17')][_0xd851('0x1c')]?_['map'](_0x12b309[_0xd851('0x17')][_0xd851('0x1c')],function(_0x2f888e){return{'model':db[_0x2f888e['model']],'as':_0x2f888e['as'],'attributes':_0x2f888e['attributes'],'include':_0x2f888e['include']?_[_0xd851('0x1d')](_0x2f888e[_0xd851('0x1c')],function(_0x2f2009){return{'model':db[_0x2f2009[_0xd851('0x1e')]],'as':_0x2f2009['as'],'attributes':_0x2f2009[_0xd851('0x1a')],'include':_0x2f2009['include']?_[_0xd851('0x1d')](_0x2f2009['include'],function(_0x412bbc){return{'model':db[_0x412bbc[_0xd851('0x1e')]],'as':_0x412bbc['as'],'attributes':_0x412bbc[_0xd851('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd851('0xa')](function(_0x337da5){logger[_0xd851('0xb')]('GetMailServerIn',_0x12b309);logger[_0xd851('0xd')](_0xd851('0x15'),_0x12b309,JSON[_0xd851('0x10')](_0x337da5));_0x3559a1(_0x337da5);})[_0xd851('0x1f')](function(_0x6c52fb){logger[_0xd851('0x12')](_0xd851('0x15'),_0x6c52fb[_0xd851('0x13')],_0x12b309);_0x5e7bb0(_0x2be9c9[_0xd851('0x12')](0x1f4,_0x6c52fb[_0xd851('0x13')]));});});}; \ No newline at end of file +var _0xcbe1=['message','info','result','findAll','options','raw','where','include','map','model','attributes','GetMailServerIn','catch','util','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x33aefe,_0x371ccd){_0x33aefe=_0x33aefe-0x0;var _0x471d19=_0xcbe1[_0x33aefe];return _0x471d19;};'use strict';var _=require('lodash');var util=require(_0x1cbe('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cbe('0x1'))['db'];var utils=require(_0x1cbe('0x2'));var logger=require('../../config/logger')(_0x1cbe('0x3'));var config=require('../../config/environment');var jayson=require(_0x1cbe('0x4'));var client=jayson[_0x1cbe('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a02c7,_0x21342a,_0x3882e1){return new BPromise(function(_0x18e76b,_0x21b2a5){return client[_0x1cbe('0x6')](_0x1a02c7,_0x3882e1)[_0x1cbe('0x7')](function(_0x42232d){logger['info'](_0x1cbe('0x8'),_0x21342a,'request\x20sent');logger[_0x1cbe('0x9')](_0x1cbe('0xa'),_0x21342a,_0x1cbe('0xb'),JSON[_0x1cbe('0xc')](_0x42232d));if(_0x42232d['error']){if(_0x42232d[_0x1cbe('0xd')]['code']===0x1f4){logger[_0x1cbe('0xd')](_0x1cbe('0x8'),_0x21342a,_0x42232d['error'][_0x1cbe('0xe')]);return _0x21b2a5(_0x42232d[_0x1cbe('0xd')][_0x1cbe('0xe')]);}logger['error'](_0x1cbe('0x8'),_0x21342a,_0x42232d[_0x1cbe('0xd')][_0x1cbe('0xe')]);return _0x18e76b(_0x42232d[_0x1cbe('0xd')][_0x1cbe('0xe')]);}else{logger[_0x1cbe('0xf')](_0x1cbe('0x8'),_0x21342a,_0x1cbe('0xb'));_0x18e76b(_0x42232d[_0x1cbe('0x10')][_0x1cbe('0xe')]);}})['catch'](function(_0x228488){logger[_0x1cbe('0xd')](_0x1cbe('0x8'),_0x21342a,_0x228488);_0x21b2a5(_0x228488);});});}exports['GetMailServerIn']=function(_0x1836a7){var _0x406d54=this;return new Promise(function(_0x45268b,_0x5022c4){return db['MailServerIn'][_0x1cbe('0x11')]({'raw':_0x1836a7[_0x1cbe('0x12')]?_0x1836a7[_0x1cbe('0x12')][_0x1cbe('0x13')]===undefined?!![]:![]:!![],'where':_0x1836a7['options']?_0x1836a7['options'][_0x1cbe('0x14')]||null:null,'attributes':_0x1836a7[_0x1cbe('0x12')]?_0x1836a7[_0x1cbe('0x12')]['attributes']||null:null,'limit':_0x1836a7['options']?_0x1836a7[_0x1cbe('0x12')]['limit']||null:null,'include':_0x1836a7[_0x1cbe('0x12')]?_0x1836a7[_0x1cbe('0x12')][_0x1cbe('0x15')]?_[_0x1cbe('0x16')](_0x1836a7[_0x1cbe('0x12')][_0x1cbe('0x15')],function(_0x2aedba){return{'model':db[_0x2aedba[_0x1cbe('0x17')]],'as':_0x2aedba['as'],'attributes':_0x2aedba[_0x1cbe('0x18')],'include':_0x2aedba['include']?_[_0x1cbe('0x16')](_0x2aedba['include'],function(_0x1fb6aa){return{'model':db[_0x1fb6aa[_0x1cbe('0x17')]],'as':_0x1fb6aa['as'],'attributes':_0x1fb6aa[_0x1cbe('0x18')],'include':_0x1fb6aa['include']?_[_0x1cbe('0x16')](_0x1fb6aa[_0x1cbe('0x15')],function(_0x1b391d){return{'model':db[_0x1b391d[_0x1cbe('0x17')]],'as':_0x1b391d['as'],'attributes':_0x1b391d[_0x1cbe('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1cbe('0x7')](function(_0x493872){logger[_0x1cbe('0xf')](_0x1cbe('0x19'),_0x1836a7);logger[_0x1cbe('0x9')]('GetMailServerIn',_0x1836a7,JSON['stringify'](_0x493872));_0x45268b(_0x493872);})[_0x1cbe('0x1a')](function(_0x52d0d5){logger[_0x1cbe('0xd')]('GetMailServerIn',_0x52d0d5[_0x1cbe('0xe')],_0x1836a7);_0x5022c4(_0x406d54[_0x1cbe('0xd')](0x1f4,_0x52d0d5[_0x1cbe('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 62cd1dd..72ad9c2 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x25ba2a,_0x406834){_0x25ba2a=_0x25ba2a-0x0;var _0x979e1e=_0x7a54[_0x25ba2a];return _0x979e1e;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x7a54,0x106));var _0x47a5=function(_0x58ab04,_0x5c0687){_0x58ab04=_0x58ab04-0x0;var _0xa0b3f8=_0x7a54[_0x58ab04];return _0xa0b3f8;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index c1fc582..1febd71 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 _0x1673=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x54caec,_0xb1a2ff){var _0x3d564a=function(_0x3263a2){while(--_0x3263a2){_0x54caec['push'](_0x54caec['shift']());}};_0x3d564a(++_0xb1a2ff);}(_0x1673,0xf1));var _0x3167=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1673[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3167('0x0')]={'description':{'type':Sequelize[_0x3167('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x3167('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3167('0x2')]},'secure':{'type':Sequelize[_0x3167('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x3167('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xca2c=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x3e7b0d,_0x518d41){var _0x4028d7=function(_0x210f0b){while(--_0x210f0b){_0x3e7b0d['push'](_0x3e7b0d['shift']());}};_0x4028d7(++_0x518d41);}(_0xca2c,0x93));var _0xcca2=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xca2c[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0xcca2('0x0'));module[_0xcca2('0x1')]={'description':{'type':Sequelize[_0xcca2('0x2')]},'host':{'type':Sequelize[_0xcca2('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xcca2('0x3')]},'secure':{'type':Sequelize[_0xcca2('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xcca2('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 73077eb..a0d9a57 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 _0x2f0a=['attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','MailServerOut','includeAll','include','findAll','rows','catch','params','keys','filters','options','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection'];(function(_0x4da6ba,_0x554ea7){var _0x4b8317=function(_0x573de2){while(--_0x573de2){_0x4da6ba['push'](_0x4da6ba['shift']());}};_0x4b8317(++_0x554ea7);}(_0x2f0a,0x148));var _0xa2f0=function(_0x357f44,_0x4c0d19){_0x357f44=_0x357f44-0x0;var _0x5d4680=_0x2f0a[_0x357f44];return _0x5d4680;};'use strict';var emlformat=require(_0xa2f0('0x0'));var rimraf=require(_0xa2f0('0x1'));var zipdir=require(_0xa2f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa2f0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa2f0('0x4'));var util=require(_0xa2f0('0x5'));var path=require(_0xa2f0('0x6'));var sox=require(_0xa2f0('0x7'));var csv=require(_0xa2f0('0x8'));var ejs=require(_0xa2f0('0x9'));var fs=require('fs');var fs_extra=require(_0xa2f0('0xa'));var _=require(_0xa2f0('0xb'));var squel=require(_0xa2f0('0xc'));var crypto=require('crypto');var jsforce=require(_0xa2f0('0xd'));var deskjs=require(_0xa2f0('0xe'));var toCsv=require(_0xa2f0('0x8'));var querystring=require(_0xa2f0('0xf'));var Papa=require(_0xa2f0('0x10'));var Redis=require(_0xa2f0('0x11'));var authService=require(_0xa2f0('0x12'));var qs=require(_0xa2f0('0x13'));var as=require(_0xa2f0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa2f0('0x15'));var utils=require(_0xa2f0('0x16'));var config=require(_0xa2f0('0x17'));var licenseUtil=require(_0xa2f0('0x18'));var db=require(_0xa2f0('0x19'))['db'];function respondWithStatusCode(_0xebeb3e,_0x5a99e8){_0x5a99e8=_0x5a99e8||0xcc;return function(_0x4b72c4){if(_0x4b72c4){return _0xebeb3e[_0xa2f0('0x1a')](_0x5a99e8);}return _0xebeb3e[_0xa2f0('0x1b')](_0x5a99e8)[_0xa2f0('0x1c')]();};}function respondWithResult(_0x2c3f5c,_0x1094b0){_0x1094b0=_0x1094b0||0xc8;return function(_0x2875fb){if(_0x2875fb){return _0x2c3f5c['status'](_0x1094b0)[_0xa2f0('0x1d')](_0x2875fb);}};}function respondWithFilteredResult(_0x89ed15,_0x48407d){return function(_0x353566){if(_0x353566){var _0x60c7d7=typeof _0x48407d['offset']===_0xa2f0('0x1e')&&typeof _0x48407d[_0xa2f0('0x1f')]===_0xa2f0('0x1e');var _0x48501e=_0x353566[_0xa2f0('0x20')];var _0x5f0a3b=_0x60c7d7?0x0:_0x48407d[_0xa2f0('0x21')];var _0x4ccf6f=_0x60c7d7?_0x353566[_0xa2f0('0x20')]:_0x48407d[_0xa2f0('0x21')]+_0x48407d[_0xa2f0('0x1f')];var _0x3bdceb;if(_0x4ccf6f>=_0x48501e){_0x4ccf6f=_0x48501e;_0x3bdceb=0xc8;}else{_0x3bdceb=0xce;}_0x89ed15[_0xa2f0('0x1b')](_0x3bdceb);return _0x89ed15['set'](_0xa2f0('0x22'),_0x5f0a3b+'-'+_0x4ccf6f+'/'+_0x48501e)[_0xa2f0('0x1d')](_0x353566);}return null;};}function patchUpdates(_0x5b7e36){return function(_0x408dc7){try{jsonpatch[_0xa2f0('0x23')](_0x408dc7,_0x5b7e36,!![]);}catch(_0x4c4571){return BPromise[_0xa2f0('0x24')](_0x4c4571);}return _0x408dc7[_0xa2f0('0x25')]();};}function saveUpdates(_0x3ae04f,_0x2e67bb){return function(_0x2b7ef9){if(_0x2b7ef9){return _0x2b7ef9[_0xa2f0('0x26')](_0x3ae04f)[_0xa2f0('0x27')](function(_0x2f6459){return _0x2f6459;});}return null;};}function removeEntity(_0x325caf,_0x59105a){return function(_0x4a11ee){if(_0x4a11ee){return _0x4a11ee[_0xa2f0('0x28')]()[_0xa2f0('0x27')](function(){_0x325caf[_0xa2f0('0x1b')](0xcc)[_0xa2f0('0x1c')]();});}};}function handleEntityNotFound(_0x146869,_0x13399e){return function(_0x285174){if(!_0x285174){_0x146869[_0xa2f0('0x1a')](0x194);}return _0x285174;};}function handleError(_0x2c79d0,_0x4890b4){_0x4890b4=_0x4890b4||0x1f4;return function(_0x11faf2){logger['error'](_0x11faf2[_0xa2f0('0x29')]);if(_0x11faf2['name']){delete _0x11faf2[_0xa2f0('0x2a')];}_0x2c79d0[_0xa2f0('0x1b')](_0x4890b4)[_0xa2f0('0x2b')](_0x11faf2);};}exports['index']=function(_0xd635a,_0x285967){var _0xe4410c={},_0x59a259={},_0x1f831c={'count':0x0,'rows':[]};var _0x3c8e67=_[_0xa2f0('0x2c')](db['MailServerOut'][_0xa2f0('0x2d')],function(_0x333aae){return{'name':_0x333aae[_0xa2f0('0x2e')],'type':_0x333aae[_0xa2f0('0x2f')][_0xa2f0('0x30')]};});_0x59a259[_0xa2f0('0x31')]=_[_0xa2f0('0x2c')](_0x3c8e67,_0xa2f0('0x2a'));_0x59a259[_0xa2f0('0x32')]=_['keys'](_0xd635a[_0xa2f0('0x32')]);_0x59a259['filters']=_[_0xa2f0('0x33')](_0x59a259['model'],_0x59a259['query']);_0xe4410c[_0xa2f0('0x34')]=_['intersection'](_0x59a259[_0xa2f0('0x31')],qs[_0xa2f0('0x35')](_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x35')]));_0xe4410c['attributes']=_0xe4410c[_0xa2f0('0x34')][_0xa2f0('0x36')]?_0xe4410c[_0xa2f0('0x34')]:_0x59a259[_0xa2f0('0x31')];if(!_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x37')](_0xa2f0('0x38'))){_0xe4410c[_0xa2f0('0x1f')]=qs[_0xa2f0('0x1f')](_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x1f')]);_0xe4410c[_0xa2f0('0x21')]=qs[_0xa2f0('0x21')](_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x21')]);}_0xe4410c[_0xa2f0('0x39')]=qs['sort'](_0xd635a[_0xa2f0('0x32')]['sort']);_0xe4410c[_0xa2f0('0x3a')]=qs['filters'](_[_0xa2f0('0x3b')](_0xd635a[_0xa2f0('0x32')],_0x59a259['filters']),_0x3c8e67);if(_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x3c')]){_0xe4410c[_0xa2f0('0x3a')]=_[_0xa2f0('0x3d')](_0xe4410c[_0xa2f0('0x3a')],{'$or':_[_0xa2f0('0x2c')](_0x3c8e67,function(_0x5790a7){if(_0x5790a7[_0xa2f0('0x2f')]!==_0xa2f0('0x3e')){var _0x2cddbd={};_0x2cddbd[_0x5790a7[_0xa2f0('0x2a')]]={'$like':'%'+_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x3c')]+'%'};return _0x2cddbd;}})});}_0xe4410c=_[_0xa2f0('0x3d')]({},_0xe4410c,_0xd635a['options']);var _0x410b01={'where':_0xe4410c[_0xa2f0('0x3a')]};return db[_0xa2f0('0x3f')][_0xa2f0('0x20')](_0x410b01)[_0xa2f0('0x27')](function(_0x5a10af){_0x1f831c[_0xa2f0('0x20')]=_0x5a10af;if(_0xd635a[_0xa2f0('0x32')][_0xa2f0('0x40')]){_0xe4410c[_0xa2f0('0x41')]=[{'all':!![]}];}return db[_0xa2f0('0x3f')][_0xa2f0('0x42')](_0xe4410c);})[_0xa2f0('0x27')](function(_0x273d69){_0x1f831c[_0xa2f0('0x43')]=_0x273d69;return _0x1f831c;})[_0xa2f0('0x27')](respondWithFilteredResult(_0x285967,_0xe4410c))[_0xa2f0('0x44')](handleError(_0x285967,null));};exports['show']=function(_0x1cb61a,_0x2bad9e){var _0x2b45ed={'raw':!![],'where':{'id':_0x1cb61a[_0xa2f0('0x45')]['id']}},_0x112cdd={};_0x112cdd[_0xa2f0('0x31')]=_[_0xa2f0('0x46')](db[_0xa2f0('0x3f')]['rawAttributes']);_0x112cdd[_0xa2f0('0x32')]=_[_0xa2f0('0x46')](_0x1cb61a['query']);_0x112cdd[_0xa2f0('0x47')]=_[_0xa2f0('0x33')](_0x112cdd['model'],_0x112cdd[_0xa2f0('0x32')]);_0x2b45ed[_0xa2f0('0x34')]=_[_0xa2f0('0x33')](_0x112cdd[_0xa2f0('0x31')],qs[_0xa2f0('0x35')](_0x1cb61a[_0xa2f0('0x32')]['fields']));_0x2b45ed[_0xa2f0('0x34')]=_0x2b45ed[_0xa2f0('0x34')][_0xa2f0('0x36')]?_0x2b45ed[_0xa2f0('0x34')]:_0x112cdd[_0xa2f0('0x31')];if(_0x1cb61a['query'][_0xa2f0('0x40')]){_0x2b45ed[_0xa2f0('0x41')]=[{'all':!![]}];}_0x2b45ed=_[_0xa2f0('0x3d')]({},_0x2b45ed,_0x1cb61a[_0xa2f0('0x48')]);return db[_0xa2f0('0x3f')][_0xa2f0('0x49')](_0x2b45ed)[_0xa2f0('0x27')](handleEntityNotFound(_0x2bad9e,null))[_0xa2f0('0x27')](respondWithResult(_0x2bad9e,null))[_0xa2f0('0x44')](handleError(_0x2bad9e,null));};exports[_0xa2f0('0x4a')]=function(_0x154b60,_0x45bd5c){return db['MailServerOut'][_0xa2f0('0x4a')](_0x154b60[_0xa2f0('0x4b')],{})['then'](respondWithResult(_0x45bd5c,0xc9))['catch'](handleError(_0x45bd5c,null));};exports[_0xa2f0('0x26')]=function(_0x18877c,_0x4ac620){if(_0x18877c[_0xa2f0('0x4b')]['id']){delete _0x18877c[_0xa2f0('0x4b')]['id'];}return db[_0xa2f0('0x3f')][_0xa2f0('0x49')]({'where':{'id':_0x18877c[_0xa2f0('0x45')]['id']}})[_0xa2f0('0x27')](handleEntityNotFound(_0x4ac620,null))[_0xa2f0('0x27')](saveUpdates(_0x18877c[_0xa2f0('0x4b')],null))[_0xa2f0('0x27')](respondWithResult(_0x4ac620,null))[_0xa2f0('0x44')](handleError(_0x4ac620,null));};exports[_0xa2f0('0x28')]=function(_0x27bc8a,_0x59de78){return db[_0xa2f0('0x3f')][_0xa2f0('0x49')]({'where':{'id':_0x27bc8a[_0xa2f0('0x45')]['id']}})[_0xa2f0('0x27')](handleEntityNotFound(_0x59de78,null))[_0xa2f0('0x27')](removeEntity(_0x59de78,null))[_0xa2f0('0x44')](handleError(_0x59de78,null));}; \ No newline at end of file +var _0x503a=['find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x503a,0xd8));var _0xa503=function(_0x32917a,_0x3559ea){_0x32917a=_0x32917a-0x0;var _0x1881e1=_0x503a[_0x32917a];return _0x1881e1;};'use strict';var emlformat=require(_0xa503('0x0'));var rimraf=require(_0xa503('0x1'));var zipdir=require(_0xa503('0x2'));var jsonpatch=require(_0xa503('0x3'));var rp=require('request-promise');var moment=require(_0xa503('0x4'));var BPromise=require(_0xa503('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa503('0x6'));var sox=require(_0xa503('0x7'));var csv=require(_0xa503('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa503('0x9'));var jsforce=require(_0xa503('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa503('0xb'));var Papa=require(_0xa503('0xc'));var Redis=require(_0xa503('0xd'));var authService=require(_0xa503('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa503('0xf'));var logger=require('../../config/logger')(_0xa503('0x10'));var utils=require(_0xa503('0x11'));var config=require(_0xa503('0x12'));var licenseUtil=require(_0xa503('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f61f8,_0xfd207d){_0xfd207d=_0xfd207d||0xcc;return function(_0x43c9e3){if(_0x43c9e3){return _0x4f61f8[_0xa503('0x14')](_0xfd207d);}return _0x4f61f8[_0xa503('0x15')](_0xfd207d)[_0xa503('0x16')]();};}function respondWithResult(_0x32177d,_0x483f4f){_0x483f4f=_0x483f4f||0xc8;return function(_0x10b511){if(_0x10b511){return _0x32177d[_0xa503('0x15')](_0x483f4f)[_0xa503('0x17')](_0x10b511);}};}function respondWithFilteredResult(_0x30eb18,_0xa1ab47){return function(_0x4be885){if(_0x4be885){var _0x339c71=typeof _0xa1ab47[_0xa503('0x18')]===_0xa503('0x19')&&typeof _0xa1ab47[_0xa503('0x1a')]===_0xa503('0x19');var _0x4a1c3c=_0x4be885[_0xa503('0x1b')];var _0xfac888=_0x339c71?0x0:_0xa1ab47[_0xa503('0x18')];var _0x2b9622=_0x339c71?_0x4be885[_0xa503('0x1b')]:_0xa1ab47[_0xa503('0x18')]+_0xa1ab47[_0xa503('0x1a')];var _0x393c01;if(_0x2b9622>=_0x4a1c3c){_0x2b9622=_0x4a1c3c;_0x393c01=0xc8;}else{_0x393c01=0xce;}_0x30eb18[_0xa503('0x15')](_0x393c01);return _0x30eb18[_0xa503('0x1c')]('Content-Range',_0xfac888+'-'+_0x2b9622+'/'+_0x4a1c3c)[_0xa503('0x17')](_0x4be885);}return null;};}function patchUpdates(_0x52ba0a){return function(_0x5dbacb){try{jsonpatch[_0xa503('0x1d')](_0x5dbacb,_0x52ba0a,!![]);}catch(_0x2efec9){return BPromise[_0xa503('0x1e')](_0x2efec9);}return _0x5dbacb[_0xa503('0x1f')]();};}function saveUpdates(_0x4a54ed,_0x1d8ed0){return function(_0x1f82db){if(_0x1f82db){return _0x1f82db['update'](_0x4a54ed)[_0xa503('0x20')](function(_0x5b4737){return _0x5b4737;});}return null;};}function removeEntity(_0x507771,_0x293ad0){return function(_0x4c00ce){if(_0x4c00ce){return _0x4c00ce[_0xa503('0x21')]()[_0xa503('0x20')](function(){_0x507771[_0xa503('0x15')](0xcc)[_0xa503('0x16')]();});}};}function handleEntityNotFound(_0x3a6b03,_0x5abc49){return function(_0x325d67){if(!_0x325d67){_0x3a6b03[_0xa503('0x14')](0x194);}return _0x325d67;};}function handleError(_0x1639a6,_0x331c3c){_0x331c3c=_0x331c3c||0x1f4;return function(_0x77750f){logger[_0xa503('0x22')](_0x77750f[_0xa503('0x23')]);if(_0x77750f[_0xa503('0x24')]){delete _0x77750f[_0xa503('0x24')];}_0x1639a6[_0xa503('0x15')](_0x331c3c)[_0xa503('0x25')](_0x77750f);};}exports[_0xa503('0x26')]=function(_0x21d15f,_0x4b9cfd){var _0x31f70e={},_0x349b62={},_0x275a93={'count':0x0,'rows':[]};var _0x5edf7f=_['map'](db[_0xa503('0x27')][_0xa503('0x28')],function(_0x28e1b7){return{'name':_0x28e1b7[_0xa503('0x29')],'type':_0x28e1b7[_0xa503('0x2a')][_0xa503('0x2b')]};});_0x349b62['model']=_[_0xa503('0x2c')](_0x5edf7f,_0xa503('0x24'));_0x349b62[_0xa503('0x2d')]=_[_0xa503('0x2e')](_0x21d15f['query']);_0x349b62[_0xa503('0x2f')]=_[_0xa503('0x30')](_0x349b62[_0xa503('0x31')],_0x349b62[_0xa503('0x2d')]);_0x31f70e['attributes']=_[_0xa503('0x30')](_0x349b62[_0xa503('0x31')],qs[_0xa503('0x32')](_0x21d15f[_0xa503('0x2d')]['fields']));_0x31f70e[_0xa503('0x33')]=_0x31f70e['attributes'][_0xa503('0x34')]?_0x31f70e['attributes']:_0x349b62['model'];if(!_0x21d15f[_0xa503('0x2d')]['hasOwnProperty']('nolimit')){_0x31f70e[_0xa503('0x1a')]=qs[_0xa503('0x1a')](_0x21d15f[_0xa503('0x2d')][_0xa503('0x1a')]);_0x31f70e[_0xa503('0x18')]=qs[_0xa503('0x18')](_0x21d15f['query'][_0xa503('0x18')]);}_0x31f70e[_0xa503('0x35')]=qs['sort'](_0x21d15f[_0xa503('0x2d')][_0xa503('0x36')]);_0x31f70e['where']=qs[_0xa503('0x2f')](_[_0xa503('0x37')](_0x21d15f['query'],_0x349b62[_0xa503('0x2f')]),_0x5edf7f);if(_0x21d15f[_0xa503('0x2d')][_0xa503('0x38')]){_0x31f70e[_0xa503('0x39')]=_[_0xa503('0x3a')](_0x31f70e['where'],{'$or':_[_0xa503('0x2c')](_0x5edf7f,function(_0x5c3b31){if(_0x5c3b31[_0xa503('0x2a')]!==_0xa503('0x3b')){var _0x311e02={};_0x311e02[_0x5c3b31[_0xa503('0x24')]]={'$like':'%'+_0x21d15f[_0xa503('0x2d')][_0xa503('0x38')]+'%'};return _0x311e02;}})});}_0x31f70e=_[_0xa503('0x3a')]({},_0x31f70e,_0x21d15f[_0xa503('0x3c')]);var _0x3d6b09={'where':_0x31f70e[_0xa503('0x39')]};return db[_0xa503('0x27')][_0xa503('0x1b')](_0x3d6b09)['then'](function(_0x3282d3){_0x275a93[_0xa503('0x1b')]=_0x3282d3;if(_0x21d15f['query'][_0xa503('0x3d')]){_0x31f70e[_0xa503('0x3e')]=[{'all':!![]}];}return db[_0xa503('0x27')][_0xa503('0x3f')](_0x31f70e);})[_0xa503('0x20')](function(_0x138a9a){_0x275a93[_0xa503('0x40')]=_0x138a9a;return _0x275a93;})[_0xa503('0x20')](respondWithFilteredResult(_0x4b9cfd,_0x31f70e))[_0xa503('0x41')](handleError(_0x4b9cfd,null));};exports[_0xa503('0x42')]=function(_0x3e950e,_0x1de7eb){var _0x20e7b3={'raw':!![],'where':{'id':_0x3e950e[_0xa503('0x43')]['id']}},_0xde69f={};_0xde69f[_0xa503('0x31')]=_[_0xa503('0x2e')](db[_0xa503('0x27')][_0xa503('0x28')]);_0xde69f[_0xa503('0x2d')]=_[_0xa503('0x2e')](_0x3e950e[_0xa503('0x2d')]);_0xde69f[_0xa503('0x2f')]=_['intersection'](_0xde69f[_0xa503('0x31')],_0xde69f[_0xa503('0x2d')]);_0x20e7b3[_0xa503('0x33')]=_['intersection'](_0xde69f[_0xa503('0x31')],qs[_0xa503('0x32')](_0x3e950e[_0xa503('0x2d')][_0xa503('0x32')]));_0x20e7b3[_0xa503('0x33')]=_0x20e7b3[_0xa503('0x33')]['length']?_0x20e7b3[_0xa503('0x33')]:_0xde69f['model'];if(_0x3e950e['query'][_0xa503('0x3d')]){_0x20e7b3[_0xa503('0x3e')]=[{'all':!![]}];}_0x20e7b3=_[_0xa503('0x3a')]({},_0x20e7b3,_0x3e950e[_0xa503('0x3c')]);return db[_0xa503('0x27')][_0xa503('0x44')](_0x20e7b3)['then'](handleEntityNotFound(_0x1de7eb,null))['then'](respondWithResult(_0x1de7eb,null))[_0xa503('0x41')](handleError(_0x1de7eb,null));};exports['create']=function(_0x3c4640,_0x271a3f){return db[_0xa503('0x27')][_0xa503('0x45')](_0x3c4640['body'],{})['then'](respondWithResult(_0x271a3f,0xc9))[_0xa503('0x41')](handleError(_0x271a3f,null));};exports['update']=function(_0x453388,_0x5db458){if(_0x453388[_0xa503('0x46')]['id']){delete _0x453388[_0xa503('0x46')]['id'];}return db[_0xa503('0x27')][_0xa503('0x44')]({'where':{'id':_0x453388['params']['id']}})[_0xa503('0x20')](handleEntityNotFound(_0x5db458,null))[_0xa503('0x20')](saveUpdates(_0x453388[_0xa503('0x46')],null))[_0xa503('0x20')](respondWithResult(_0x5db458,null))[_0xa503('0x41')](handleError(_0x5db458,null));};exports[_0xa503('0x21')]=function(_0x4c7d5d,_0x35d023){return db['MailServerOut']['find']({'where':{'id':_0x4c7d5d['params']['id']}})[_0xa503('0x20')](handleEntityNotFound(_0x35d023,null))[_0xa503('0x20')](removeEntity(_0x35d023,null))[_0xa503('0x41')](handleError(_0x35d023,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index e70806e..ed53f7e 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 _0x8337=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','mail_servers_out'];(function(_0x13a1ff,_0x43588e){var _0x33477c=function(_0x519b21){while(--_0x519b21){_0x13a1ff['push'](_0x13a1ff['shift']());}};_0x33477c(++_0x43588e);}(_0x8337,0x84));var _0x7833=function(_0x13c787,_0x3fa0eb){_0x13c787=_0x13c787-0x0;var _0x1a0324=_0x8337[_0x13c787];return _0x1a0324;};'use strict';var _=require('lodash');var util=require(_0x7833('0x0'));var logger=require(_0x7833('0x1'))(_0x7833('0x2'));var moment=require(_0x7833('0x3'));var BPromise=require('bluebird');var rp=require(_0x7833('0x4'));var fs=require('fs');var path=require(_0x7833('0x5'));var rimraf=require(_0x7833('0x6'));var config=require(_0x7833('0x7'));var attributes=require(_0x7833('0x8'));module[_0x7833('0x9')]=function(_0x47e389,_0x3ffb91){return _0x47e389['define']('MailServerOut',attributes,{'tableName':_0x7833('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ad1=['request-promise','path','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ad1,0x103));var _0x19ad=function(_0x33eb8f,_0x533618){_0x33eb8f=_0x33eb8f-0x0;var _0x13441a=_0x9ad1[_0x33eb8f];return _0x13441a;};'use strict';var _=require(_0x19ad('0x0'));var util=require(_0x19ad('0x1'));var logger=require(_0x19ad('0x2'))(_0x19ad('0x3'));var moment=require(_0x19ad('0x4'));var BPromise=require('bluebird');var rp=require(_0x19ad('0x5'));var fs=require('fs');var path=require(_0x19ad('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x19ad('0x7'));module[_0x19ad('0x8')]=function(_0x5a0c63,_0x2b1c4a){return _0x5a0c63[_0x19ad('0x9')]('MailServerOut',attributes,{'tableName':_0x19ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 98d556d..90d871c 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x598efc,_0x5e971c){var _0x435e4f=function(_0x3e0596){while(--_0x3e0596){_0x598efc['push'](_0x598efc['shift']());}};_0x435e4f(++_0x5e971c);}(_0xadb5,0xad));var _0x5adb=function(_0x429ffc,_0x549dd6){_0x429ffc=_0x429ffc-0x0;var _0x44b539=_0xadb5[_0x429ffc];return _0x44b539;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1164ff,_0x4a140e){var _0x50a1a1=function(_0x59c228){while(--_0x59c228){_0x1164ff['push'](_0x1164ff['shift']());}};_0x50a1a1(++_0x4a140e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 99344a2..77edc4b 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 _0xab60=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2b2d29,_0x126419){var _0x3c370a=function(_0x9d5e54){while(--_0x9d5e54){_0x2b2d29['push'](_0x2b2d29['shift']());}};_0x3c370a(++_0x126419);}(_0xab60,0x1f4));var _0x0ab6=function(_0x399869,_0x11b444){_0x399869=_0x399869-0x0;var _0x4ff731=_0xab60[_0x399869];return _0x4ff731;};'use strict';var multer=require(_0x0ab6('0x0'));var util=require(_0x0ab6('0x1'));var path=require(_0x0ab6('0x2'));var timeout=require(_0x0ab6('0x3'));var express=require(_0x0ab6('0x4'));var router=express[_0x0ab6('0x5')]();var fs_extra=require(_0x0ab6('0x6'));var auth=require(_0x0ab6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0ab6('0x8'));var controller=require('./mailSubstatus.controller');router[_0x0ab6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0ab6('0xa'),auth[_0x0ab6('0xb')](),controller[_0x0ab6('0xc')]);router['get'](_0x0ab6('0xd'),auth[_0x0ab6('0xb')](),controller[_0x0ab6('0xe')]);router[_0x0ab6('0xf')]('/',auth[_0x0ab6('0xb')](),controller[_0x0ab6('0x10')]);router[_0x0ab6('0x11')](_0x0ab6('0xd'),auth[_0x0ab6('0xb')](),controller['update']);router[_0x0ab6('0x12')](_0x0ab6('0xd'),auth['isAuthenticated'](),controller[_0x0ab6('0x13')]);module[_0x0ab6('0x14')]=router; \ No newline at end of file +var _0xe5e1=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x1786fb,_0x76f76f){var _0x50d9c0=function(_0x1d3d3a){while(--_0x1d3d3a){_0x1786fb['push'](_0x1786fb['shift']());}};_0x50d9c0(++_0x76f76f);}(_0xe5e1,0x191));var _0x1e5e=function(_0x4967e7,_0x20bc3e){_0x4967e7=_0x4967e7-0x0;var _0x2a8c34=_0xe5e1[_0x4967e7];return _0x2a8c34;};'use strict';var multer=require(_0x1e5e('0x0'));var util=require(_0x1e5e('0x1'));var path=require(_0x1e5e('0x2'));var timeout=require(_0x1e5e('0x3'));var express=require(_0x1e5e('0x4'));var router=express[_0x1e5e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1e5e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e5e('0x7'));var controller=require('./mailSubstatus.controller');router[_0x1e5e('0x8')]('/',auth[_0x1e5e('0x9')](),controller[_0x1e5e('0xa')]);router[_0x1e5e('0x8')](_0x1e5e('0xb'),auth['isAuthenticated'](),controller[_0x1e5e('0xc')]);router[_0x1e5e('0x8')](_0x1e5e('0xd'),auth[_0x1e5e('0x9')](),controller[_0x1e5e('0xe')]);router[_0x1e5e('0xf')]('/',auth[_0x1e5e('0x9')](),controller[_0x1e5e('0x10')]);router[_0x1e5e('0x11')](_0x1e5e('0xd'),auth[_0x1e5e('0x9')](),controller[_0x1e5e('0x12')]);router[_0x1e5e('0x13')](_0x1e5e('0xd'),auth[_0x1e5e('0x9')](),controller[_0x1e5e('0x14')]);module[_0x1e5e('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 3f13e0c..74fc95e 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 _0xe944=['sequelize','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe944,0x174));var _0x4e94=function(_0x436a9a,_0x13a559){_0x436a9a=_0x436a9a-0x0;var _0x49279b=_0xe944[_0x436a9a];return _0x49279b;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4e94('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6657=['STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x6657[_0x258fb0];return _0x4d1afe;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'name':{'type':Sequelize[_0x7665('0x1')],'unique':_0x7665('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7665('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1741ebf..38c2646 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 _0xd7b0=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','findAll','rows','show','params','rawAttributes','includeAll','include','merge','options','find','catch','create','body','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','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','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','MailSubstatus','fieldName','type','model','query','keys','filters'];(function(_0x52d7fe,_0x4792c6){var _0x44b22a=function(_0x22bfca){while(--_0x22bfca){_0x52d7fe['push'](_0x52d7fe['shift']());}};_0x44b22a(++_0x4792c6);}(_0xd7b0,0x139));var _0x0d7b=function(_0x4b236d,_0x5eed49){_0x4b236d=_0x4b236d-0x0;var _0x32420b=_0xd7b0[_0x4b236d];return _0x32420b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0d7b('0x0'));var rp=require(_0x0d7b('0x1'));var moment=require('moment');var BPromise=require(_0x0d7b('0x2'));var Mustache=require(_0x0d7b('0x3'));var util=require(_0x0d7b('0x4'));var path=require(_0x0d7b('0x5'));var sox=require('sox');var csv=require(_0x0d7b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d7b('0x7'));var _=require('lodash');var squel=require(_0x0d7b('0x8'));var crypto=require(_0x0d7b('0x9'));var jsforce=require(_0x0d7b('0xa'));var deskjs=require(_0x0d7b('0xb'));var toCsv=require(_0x0d7b('0x6'));var querystring=require(_0x0d7b('0xc'));var Papa=require(_0x0d7b('0xd'));var Redis=require(_0x0d7b('0xe'));var authService=require(_0x0d7b('0xf'));var qs=require(_0x0d7b('0x10'));var as=require(_0x0d7b('0x11'));var hardwareService=require(_0x0d7b('0x12'));var logger=require(_0x0d7b('0x13'))('api');var utils=require(_0x0d7b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0d7b('0x15'))['db'];function respondWithStatusCode(_0xc522d3,_0x5c422c){_0x5c422c=_0x5c422c||0xcc;return function(_0x2593ef){if(_0x2593ef){return _0xc522d3[_0x0d7b('0x16')](_0x5c422c);}return _0xc522d3[_0x0d7b('0x17')](_0x5c422c)[_0x0d7b('0x18')]();};}function respondWithResult(_0x5052a7,_0x5d128f){_0x5d128f=_0x5d128f||0xc8;return function(_0x1f3699){if(_0x1f3699){return _0x5052a7[_0x0d7b('0x17')](_0x5d128f)['json'](_0x1f3699);}};}function respondWithFilteredResult(_0x365113,_0x189cee){return function(_0x5bb037){if(_0x5bb037){var _0x321dc5=typeof _0x189cee[_0x0d7b('0x19')]==='undefined'&&typeof _0x189cee[_0x0d7b('0x1a')]==='undefined';var _0x36ad7f=_0x5bb037[_0x0d7b('0x1b')];var _0x1edad1=_0x321dc5?0x0:_0x189cee[_0x0d7b('0x19')];var _0x36a103=_0x321dc5?_0x5bb037[_0x0d7b('0x1b')]:_0x189cee[_0x0d7b('0x19')]+_0x189cee[_0x0d7b('0x1a')];var _0x5c9638;if(_0x36a103>=_0x36ad7f){_0x36a103=_0x36ad7f;_0x5c9638=0xc8;}else{_0x5c9638=0xce;}_0x365113[_0x0d7b('0x17')](_0x5c9638);return _0x365113[_0x0d7b('0x1c')]('Content-Range',_0x1edad1+'-'+_0x36a103+'/'+_0x36ad7f)[_0x0d7b('0x1d')](_0x5bb037);}return null;};}function patchUpdates(_0x218db3){return function(_0x112d12){try{jsonpatch['apply'](_0x112d12,_0x218db3,!![]);}catch(_0x525b43){return BPromise[_0x0d7b('0x1e')](_0x525b43);}return _0x112d12[_0x0d7b('0x1f')]();};}function saveUpdates(_0x126491,_0x53b22c){return function(_0x3e1250){if(_0x3e1250){return _0x3e1250[_0x0d7b('0x20')](_0x126491)[_0x0d7b('0x21')](function(_0x3913ca){return _0x3913ca;});}return null;};}function removeEntity(_0x2c74f9,_0x392334){return function(_0x3bf686){if(_0x3bf686){return _0x3bf686[_0x0d7b('0x22')]()[_0x0d7b('0x21')](function(){_0x2c74f9[_0x0d7b('0x17')](0xcc)[_0x0d7b('0x18')]();});}};}function handleEntityNotFound(_0x5cd6ab,_0x36015e){return function(_0x2894b9){if(!_0x2894b9){_0x5cd6ab[_0x0d7b('0x16')](0x194);}return _0x2894b9;};}function handleError(_0x34c6ea,_0x4da6a1){_0x4da6a1=_0x4da6a1||0x1f4;return function(_0x26b7bd){logger[_0x0d7b('0x23')](_0x26b7bd['stack']);if(_0x26b7bd['name']){delete _0x26b7bd[_0x0d7b('0x24')];}_0x34c6ea[_0x0d7b('0x17')](_0x4da6a1)[_0x0d7b('0x25')](_0x26b7bd);};}exports[_0x0d7b('0x26')]=function(_0x3672f7,_0x1270de){var _0x991640={},_0xe0725d={},_0x285624={'count':0x0,'rows':[]};var _0xd395fe=_[_0x0d7b('0x27')](db[_0x0d7b('0x28')]['rawAttributes'],function(_0xc71f2a){return{'name':_0xc71f2a[_0x0d7b('0x29')],'type':_0xc71f2a[_0x0d7b('0x2a')]['key']};});_0xe0725d[_0x0d7b('0x2b')]=_[_0x0d7b('0x27')](_0xd395fe,_0x0d7b('0x24'));_0xe0725d[_0x0d7b('0x2c')]=_[_0x0d7b('0x2d')](_0x3672f7[_0x0d7b('0x2c')]);_0xe0725d[_0x0d7b('0x2e')]=_['intersection'](_0xe0725d['model'],_0xe0725d[_0x0d7b('0x2c')]);_0x991640[_0x0d7b('0x2f')]=_[_0x0d7b('0x30')](_0xe0725d['model'],qs[_0x0d7b('0x31')](_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x31')]));_0x991640['attributes']=_0x991640[_0x0d7b('0x2f')][_0x0d7b('0x32')]?_0x991640[_0x0d7b('0x2f')]:_0xe0725d[_0x0d7b('0x2b')];if(!_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x33')](_0x0d7b('0x34'))){_0x991640[_0x0d7b('0x1a')]=qs[_0x0d7b('0x1a')](_0x3672f7['query'][_0x0d7b('0x1a')]);_0x991640[_0x0d7b('0x19')]=qs[_0x0d7b('0x19')](_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x19')]);}_0x991640[_0x0d7b('0x35')]=qs[_0x0d7b('0x36')](_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x36')]);_0x991640[_0x0d7b('0x37')]=qs[_0x0d7b('0x2e')](_['pick'](_0x3672f7[_0x0d7b('0x2c')],_0xe0725d[_0x0d7b('0x2e')]),_0xd395fe);if(_0x3672f7[_0x0d7b('0x2c')]['filter']){_0x991640[_0x0d7b('0x37')]=_['merge'](_0x991640[_0x0d7b('0x37')],{'$or':_[_0x0d7b('0x27')](_0xd395fe,function(_0x2f403f){if(_0x2f403f[_0x0d7b('0x2a')]!==_0x0d7b('0x38')){var _0x222735={};_0x222735[_0x2f403f[_0x0d7b('0x24')]]={'$like':'%'+_0x3672f7[_0x0d7b('0x2c')][_0x0d7b('0x39')]+'%'};return _0x222735;}})});}_0x991640=_['merge']({},_0x991640,_0x3672f7['options']);var _0x488805={'where':_0x991640['where']};return db[_0x0d7b('0x28')]['count'](_0x488805)[_0x0d7b('0x21')](function(_0x2a5356){_0x285624[_0x0d7b('0x1b')]=_0x2a5356;if(_0x3672f7[_0x0d7b('0x2c')]['includeAll']){_0x991640['include']=[{'all':!![]}];}return db[_0x0d7b('0x28')][_0x0d7b('0x3a')](_0x991640);})[_0x0d7b('0x21')](function(_0x1ee39b){_0x285624[_0x0d7b('0x3b')]=_0x1ee39b;return _0x285624;})['then'](respondWithFilteredResult(_0x1270de,_0x991640))['catch'](handleError(_0x1270de,null));};exports[_0x0d7b('0x3c')]=function(_0x490cd1,_0x52ef2e){var _0x2f51e7={'raw':!![],'where':{'id':_0x490cd1[_0x0d7b('0x3d')]['id']}},_0x6d2b6f={};_0x6d2b6f[_0x0d7b('0x2b')]=_[_0x0d7b('0x2d')](db['MailSubstatus'][_0x0d7b('0x3e')]);_0x6d2b6f[_0x0d7b('0x2c')]=_[_0x0d7b('0x2d')](_0x490cd1[_0x0d7b('0x2c')]);_0x6d2b6f['filters']=_[_0x0d7b('0x30')](_0x6d2b6f[_0x0d7b('0x2b')],_0x6d2b6f[_0x0d7b('0x2c')]);_0x2f51e7[_0x0d7b('0x2f')]=_[_0x0d7b('0x30')](_0x6d2b6f[_0x0d7b('0x2b')],qs[_0x0d7b('0x31')](_0x490cd1[_0x0d7b('0x2c')][_0x0d7b('0x31')]));_0x2f51e7[_0x0d7b('0x2f')]=_0x2f51e7[_0x0d7b('0x2f')]['length']?_0x2f51e7[_0x0d7b('0x2f')]:_0x6d2b6f[_0x0d7b('0x2b')];if(_0x490cd1[_0x0d7b('0x2c')][_0x0d7b('0x3f')]){_0x2f51e7[_0x0d7b('0x40')]=[{'all':!![]}];}_0x2f51e7=_[_0x0d7b('0x41')]({},_0x2f51e7,_0x490cd1[_0x0d7b('0x42')]);return db[_0x0d7b('0x28')][_0x0d7b('0x43')](_0x2f51e7)['then'](handleEntityNotFound(_0x52ef2e,null))[_0x0d7b('0x21')](respondWithResult(_0x52ef2e,null))[_0x0d7b('0x44')](handleError(_0x52ef2e,null));};exports['create']=function(_0xe38c42,_0x5428e7){return db['MailSubstatus'][_0x0d7b('0x45')](_0xe38c42['body'],{})['then'](respondWithResult(_0x5428e7,0xc9))[_0x0d7b('0x44')](handleError(_0x5428e7,null));};exports[_0x0d7b('0x20')]=function(_0x47a244,_0x3ba541){if(_0x47a244[_0x0d7b('0x46')]['id']){delete _0x47a244[_0x0d7b('0x46')]['id'];}return db['MailSubstatus'][_0x0d7b('0x43')]({'where':{'id':_0x47a244['params']['id']}})[_0x0d7b('0x21')](handleEntityNotFound(_0x3ba541,null))[_0x0d7b('0x21')](saveUpdates(_0x47a244[_0x0d7b('0x46')],null))[_0x0d7b('0x21')](respondWithResult(_0x3ba541,null))[_0x0d7b('0x44')](handleError(_0x3ba541,null));};exports[_0x0d7b('0x22')]=function(_0x106ef3,_0x1d89cc){return db['MailSubstatus'][_0x0d7b('0x43')]({'where':{'id':_0x106ef3[_0x0d7b('0x3d')]['id']}})[_0x0d7b('0x21')](handleEntityNotFound(_0x1d89cc,null))[_0x0d7b('0x21')](removeEntity(_0x1d89cc,null))[_0x0d7b('0x44')](handleError(_0x1d89cc,null));};exports['describe']=function(_0x1acfca,_0x499021){return db[_0x0d7b('0x28')][_0x0d7b('0x47')]()['then'](respondWithResult(_0x499021,null))[_0x0d7b('0x44')](handleError(_0x499021,null));}; \ No newline at end of file +var _0xaa19=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','MailSubstatus','fieldName','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','show','params','rawAttributes','keys','fields','includeAll','find','catch','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1ec283,_0x1ad101){var _0x11b4c8=function(_0x232149){while(--_0x232149){_0x1ec283['push'](_0x1ec283['shift']());}};_0x11b4c8(++_0x1ad101);}(_0xaa19,0x12f));var _0x9aa1=function(_0x283d9b,_0x3d499e){_0x283d9b=_0x283d9b-0x0;var _0x528ab3=_0xaa19[_0x283d9b];return _0x528ab3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9aa1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9aa1('0x1'));var rp=require(_0x9aa1('0x2'));var moment=require(_0x9aa1('0x3'));var BPromise=require(_0x9aa1('0x4'));var Mustache=require(_0x9aa1('0x5'));var util=require(_0x9aa1('0x6'));var path=require(_0x9aa1('0x7'));var sox=require(_0x9aa1('0x8'));var csv=require(_0x9aa1('0x9'));var ejs=require(_0x9aa1('0xa'));var fs=require('fs');var fs_extra=require(_0x9aa1('0xb'));var _=require(_0x9aa1('0xc'));var squel=require(_0x9aa1('0xd'));var crypto=require(_0x9aa1('0xe'));var jsforce=require(_0x9aa1('0xf'));var deskjs=require(_0x9aa1('0x10'));var toCsv=require(_0x9aa1('0x9'));var querystring=require('querystring');var Papa=require(_0x9aa1('0x11'));var Redis=require(_0x9aa1('0x12'));var authService=require(_0x9aa1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9aa1('0x14'));var logger=require(_0x9aa1('0x15'))(_0x9aa1('0x16'));var utils=require(_0x9aa1('0x17'));var config=require(_0x9aa1('0x18'));var licenseUtil=require(_0x9aa1('0x19'));var db=require(_0x9aa1('0x1a'))['db'];function respondWithStatusCode(_0x280e3a,_0x126677){_0x126677=_0x126677||0xcc;return function(_0x582d4f){if(_0x582d4f){return _0x280e3a['sendStatus'](_0x126677);}return _0x280e3a[_0x9aa1('0x1b')](_0x126677)[_0x9aa1('0x1c')]();};}function respondWithResult(_0x4fdc4d,_0x2f5998){_0x2f5998=_0x2f5998||0xc8;return function(_0x5ac127){if(_0x5ac127){return _0x4fdc4d[_0x9aa1('0x1b')](_0x2f5998)[_0x9aa1('0x1d')](_0x5ac127);}};}function respondWithFilteredResult(_0x50df3c,_0x1cc61a){return function(_0x36c4f0){if(_0x36c4f0){var _0x5efe89=typeof _0x1cc61a['offset']===_0x9aa1('0x1e')&&typeof _0x1cc61a[_0x9aa1('0x1f')]===_0x9aa1('0x1e');var _0x4aa520=_0x36c4f0[_0x9aa1('0x20')];var _0x276f42=_0x5efe89?0x0:_0x1cc61a['offset'];var _0x52ba05=_0x5efe89?_0x36c4f0[_0x9aa1('0x20')]:_0x1cc61a[_0x9aa1('0x21')]+_0x1cc61a[_0x9aa1('0x1f')];var _0x197a66;if(_0x52ba05>=_0x4aa520){_0x52ba05=_0x4aa520;_0x197a66=0xc8;}else{_0x197a66=0xce;}_0x50df3c[_0x9aa1('0x1b')](_0x197a66);return _0x50df3c[_0x9aa1('0x22')](_0x9aa1('0x23'),_0x276f42+'-'+_0x52ba05+'/'+_0x4aa520)[_0x9aa1('0x1d')](_0x36c4f0);}return null;};}function patchUpdates(_0x56d4f3){return function(_0x591e49){try{jsonpatch[_0x9aa1('0x24')](_0x591e49,_0x56d4f3,!![]);}catch(_0x5d4e34){return BPromise[_0x9aa1('0x25')](_0x5d4e34);}return _0x591e49[_0x9aa1('0x26')]();};}function saveUpdates(_0x5c4838,_0x4eaa81){return function(_0x49d98f){if(_0x49d98f){return _0x49d98f[_0x9aa1('0x27')](_0x5c4838)[_0x9aa1('0x28')](function(_0x5a80ba){return _0x5a80ba;});}return null;};}function removeEntity(_0x435468,_0xc23fb1){return function(_0x30b333){if(_0x30b333){return _0x30b333[_0x9aa1('0x29')]()[_0x9aa1('0x28')](function(){_0x435468[_0x9aa1('0x1b')](0xcc)[_0x9aa1('0x1c')]();});}};}function handleEntityNotFound(_0x4d60e0,_0x151b6f){return function(_0x2afebc){if(!_0x2afebc){_0x4d60e0[_0x9aa1('0x2a')](0x194);}return _0x2afebc;};}function handleError(_0x1a13f8,_0x4625c0){_0x4625c0=_0x4625c0||0x1f4;return function(_0x10a0d0){logger['error'](_0x10a0d0[_0x9aa1('0x2b')]);if(_0x10a0d0[_0x9aa1('0x2c')]){delete _0x10a0d0[_0x9aa1('0x2c')];}_0x1a13f8[_0x9aa1('0x1b')](_0x4625c0)[_0x9aa1('0x2d')](_0x10a0d0);};}exports[_0x9aa1('0x2e')]=function(_0x330b21,_0xd33a2d){var _0x516fac={},_0x5e2ea5={},_0x54828f={'count':0x0,'rows':[]};var _0x4346b1=_['map'](db[_0x9aa1('0x2f')]['rawAttributes'],function(_0x8c38c7){return{'name':_0x8c38c7[_0x9aa1('0x30')],'type':_0x8c38c7['type'][_0x9aa1('0x31')]};});_0x5e2ea5[_0x9aa1('0x32')]=_[_0x9aa1('0x33')](_0x4346b1,'name');_0x5e2ea5[_0x9aa1('0x34')]=_['keys'](_0x330b21[_0x9aa1('0x34')]);_0x5e2ea5[_0x9aa1('0x35')]=_[_0x9aa1('0x36')](_0x5e2ea5[_0x9aa1('0x32')],_0x5e2ea5[_0x9aa1('0x34')]);_0x516fac[_0x9aa1('0x37')]=_['intersection'](_0x5e2ea5['model'],qs['fields'](_0x330b21[_0x9aa1('0x34')]['fields']));_0x516fac['attributes']=_0x516fac[_0x9aa1('0x37')][_0x9aa1('0x38')]?_0x516fac[_0x9aa1('0x37')]:_0x5e2ea5[_0x9aa1('0x32')];if(!_0x330b21[_0x9aa1('0x34')][_0x9aa1('0x39')]('nolimit')){_0x516fac['limit']=qs[_0x9aa1('0x1f')](_0x330b21[_0x9aa1('0x34')][_0x9aa1('0x1f')]);_0x516fac[_0x9aa1('0x21')]=qs['offset'](_0x330b21[_0x9aa1('0x34')]['offset']);}_0x516fac[_0x9aa1('0x3a')]=qs[_0x9aa1('0x3b')](_0x330b21['query'][_0x9aa1('0x3b')]);_0x516fac['where']=qs[_0x9aa1('0x35')](_[_0x9aa1('0x3c')](_0x330b21[_0x9aa1('0x34')],_0x5e2ea5[_0x9aa1('0x35')]),_0x4346b1);if(_0x330b21['query']['filter']){_0x516fac[_0x9aa1('0x3d')]=_[_0x9aa1('0x3e')](_0x516fac['where'],{'$or':_[_0x9aa1('0x33')](_0x4346b1,function(_0x3f3654){if(_0x3f3654[_0x9aa1('0x3f')]!==_0x9aa1('0x40')){var _0xc4c7d1={};_0xc4c7d1[_0x3f3654[_0x9aa1('0x2c')]]={'$like':'%'+_0x330b21[_0x9aa1('0x34')][_0x9aa1('0x41')]+'%'};return _0xc4c7d1;}})});}_0x516fac=_[_0x9aa1('0x3e')]({},_0x516fac,_0x330b21[_0x9aa1('0x42')]);var _0x36dd8f={'where':_0x516fac[_0x9aa1('0x3d')]};return db[_0x9aa1('0x2f')][_0x9aa1('0x20')](_0x36dd8f)['then'](function(_0x548c71){_0x54828f['count']=_0x548c71;if(_0x330b21[_0x9aa1('0x34')]['includeAll']){_0x516fac[_0x9aa1('0x43')]=[{'all':!![]}];}return db[_0x9aa1('0x2f')]['findAll'](_0x516fac);})[_0x9aa1('0x28')](function(_0x85f2ee){_0x54828f[_0x9aa1('0x44')]=_0x85f2ee;return _0x54828f;})['then'](respondWithFilteredResult(_0xd33a2d,_0x516fac))['catch'](handleError(_0xd33a2d,null));};exports[_0x9aa1('0x45')]=function(_0x96ffd4,_0x1fbe2f){var _0x4bc20b={'raw':!![],'where':{'id':_0x96ffd4[_0x9aa1('0x46')]['id']}},_0x910a5e={};_0x910a5e['model']=_['keys'](db[_0x9aa1('0x2f')][_0x9aa1('0x47')]);_0x910a5e['query']=_[_0x9aa1('0x48')](_0x96ffd4[_0x9aa1('0x34')]);_0x910a5e['filters']=_[_0x9aa1('0x36')](_0x910a5e[_0x9aa1('0x32')],_0x910a5e[_0x9aa1('0x34')]);_0x4bc20b['attributes']=_[_0x9aa1('0x36')](_0x910a5e[_0x9aa1('0x32')],qs[_0x9aa1('0x49')](_0x96ffd4[_0x9aa1('0x34')][_0x9aa1('0x49')]));_0x4bc20b['attributes']=_0x4bc20b[_0x9aa1('0x37')][_0x9aa1('0x38')]?_0x4bc20b['attributes']:_0x910a5e['model'];if(_0x96ffd4[_0x9aa1('0x34')][_0x9aa1('0x4a')]){_0x4bc20b[_0x9aa1('0x43')]=[{'all':!![]}];}_0x4bc20b=_['merge']({},_0x4bc20b,_0x96ffd4[_0x9aa1('0x42')]);return db[_0x9aa1('0x2f')][_0x9aa1('0x4b')](_0x4bc20b)[_0x9aa1('0x28')](handleEntityNotFound(_0x1fbe2f,null))[_0x9aa1('0x28')](respondWithResult(_0x1fbe2f,null))[_0x9aa1('0x4c')](handleError(_0x1fbe2f,null));};exports[_0x9aa1('0x4d')]=function(_0x47245a,_0x5db4b7){return db['MailSubstatus']['create'](_0x47245a[_0x9aa1('0x4e')],{})[_0x9aa1('0x28')](respondWithResult(_0x5db4b7,0xc9))[_0x9aa1('0x4c')](handleError(_0x5db4b7,null));};exports[_0x9aa1('0x27')]=function(_0x1e1ff8,_0x4fd226){if(_0x1e1ff8[_0x9aa1('0x4e')]['id']){delete _0x1e1ff8[_0x9aa1('0x4e')]['id'];}return db['MailSubstatus'][_0x9aa1('0x4b')]({'where':{'id':_0x1e1ff8[_0x9aa1('0x46')]['id']}})[_0x9aa1('0x28')](handleEntityNotFound(_0x4fd226,null))[_0x9aa1('0x28')](saveUpdates(_0x1e1ff8[_0x9aa1('0x4e')],null))['then'](respondWithResult(_0x4fd226,null))[_0x9aa1('0x4c')](handleError(_0x4fd226,null));};exports[_0x9aa1('0x29')]=function(_0xe596d3,_0x434fd1){return db[_0x9aa1('0x2f')][_0x9aa1('0x4b')]({'where':{'id':_0xe596d3[_0x9aa1('0x46')]['id']}})[_0x9aa1('0x28')](handleEntityNotFound(_0x434fd1,null))['then'](removeEntity(_0x434fd1,null))[_0x9aa1('0x4c')](handleError(_0x434fd1,null));};exports[_0x9aa1('0x4f')]=function(_0x34f20d,_0x4a6198){return db[_0x9aa1('0x2f')][_0x9aa1('0x4f')]()[_0x9aa1('0x28')](respondWithResult(_0x4a6198,null))['catch'](handleError(_0x4a6198,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ba6a437..a927e60 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 _0x3406=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x734a6,_0x4d8531){var _0x3933a5=function(_0x294599){while(--_0x294599){_0x734a6['push'](_0x734a6['shift']());}};_0x3933a5(++_0x4d8531);}(_0x3406,0x19a));var _0x6340=function(_0x2fdeaf,_0x1777c9){_0x2fdeaf=_0x2fdeaf-0x0;var _0x27e551=_0x3406[_0x2fdeaf];return _0x27e551;};'use strict';var _=require(_0x6340('0x0'));var util=require(_0x6340('0x1'));var logger=require(_0x6340('0x2'))(_0x6340('0x3'));var moment=require(_0x6340('0x4'));var BPromise=require(_0x6340('0x5'));var rp=require(_0x6340('0x6'));var fs=require('fs');var path=require(_0x6340('0x7'));var rimraf=require(_0x6340('0x8'));var config=require(_0x6340('0x9'));var attributes=require(_0x6340('0xa'));module['exports']=function(_0x25f4b7,_0x22dd56){return _0x25f4b7[_0x6340('0xb')]('MailSubstatus',attributes,{'tableName':_0x6340('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10cc=['./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x10cc,0x17d));var _0xc10c=function(_0x1b74f8,_0x3db06a){_0x1b74f8=_0x1b74f8-0x0;var _0x49836c=_0x10cc[_0x1b74f8];return _0x49836c;};'use strict';var _=require(_0xc10c('0x0'));var util=require(_0xc10c('0x1'));var logger=require(_0xc10c('0x2'))(_0xc10c('0x3'));var moment=require(_0xc10c('0x4'));var BPromise=require(_0xc10c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc10c('0x6'));var rimraf=require(_0xc10c('0x7'));var config=require(_0xc10c('0x8'));var attributes=require(_0xc10c('0x9'));module[_0xc10c('0xa')]=function(_0x1c2bcc,_0x2b9913){return _0x1c2bcc[_0xc10c('0xb')](_0xc10c('0xc'),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 1033ec1..7ec01fc 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 _0x20fb=['request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','MailSubstatus,\x20%s,\x20%s','debug'];(function(_0xa50370,_0x58aa74){var _0x38d6ff=function(_0x58844c){while(--_0x58844c){_0xa50370['push'](_0xa50370['shift']());}};_0x38d6ff(++_0x58aa74);}(_0x20fb,0x1ea));var _0xb20f=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x20fb[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xb20f('0x0'));var util=require(_0xb20f('0x1'));var moment=require(_0xb20f('0x2'));var BPromise=require(_0xb20f('0x3'));var rs=require(_0xb20f('0x4'));var fs=require('fs');var Redis=require(_0xb20f('0x5'));var db=require(_0xb20f('0x6'))['db'];var utils=require(_0xb20f('0x7'));var logger=require(_0xb20f('0x8'))(_0xb20f('0x9'));var config=require(_0xb20f('0xa'));var jayson=require(_0xb20f('0xb'));var client=jayson[_0xb20f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353b4b,_0x1200f3,_0x312764){return new BPromise(function(_0x558436,_0xb29acb){return client[_0xb20f('0xd')](_0x353b4b,_0x312764)['then'](function(_0x2cbb49){logger['info'](_0xb20f('0xe'),_0x1200f3,'request\x20sent');logger[_0xb20f('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1200f3,_0xb20f('0x10'),JSON[_0xb20f('0x11')](_0x2cbb49));if(_0x2cbb49[_0xb20f('0x12')]){if(_0x2cbb49[_0xb20f('0x12')][_0xb20f('0x13')]===0x1f4){logger[_0xb20f('0x12')](_0xb20f('0xe'),_0x1200f3,_0x2cbb49[_0xb20f('0x12')]['message']);return _0xb29acb(_0x2cbb49[_0xb20f('0x12')][_0xb20f('0x14')]);}logger[_0xb20f('0x12')](_0xb20f('0xe'),_0x1200f3,_0x2cbb49['error'][_0xb20f('0x14')]);return _0x558436(_0x2cbb49[_0xb20f('0x12')]['message']);}else{logger[_0xb20f('0x15')]('MailSubstatus,\x20%s,\x20%s',_0x1200f3,_0xb20f('0x10'));_0x558436(_0x2cbb49['result'][_0xb20f('0x14')]);}})[_0xb20f('0x16')](function(_0x245169){logger['error'](_0xb20f('0xe'),_0x1200f3,_0x245169);_0xb29acb(_0x245169);});});} \ No newline at end of file +var _0x66aa=['http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xca62e8,_0x462dcf){var _0x4658ff=function(_0x388040){while(--_0x388040){_0xca62e8['push'](_0xca62e8['shift']());}};_0x4658ff(++_0x462dcf);}(_0x66aa,0xbc));var _0xa66a=function(_0x4d5743,_0x542802){_0x4d5743=_0x4d5743-0x0;var _0x42ef16=_0x66aa[_0x4d5743];return _0x42ef16;};'use strict';var _=require(_0xa66a('0x0'));var util=require(_0xa66a('0x1'));var moment=require(_0xa66a('0x2'));var BPromise=require(_0xa66a('0x3'));var rs=require(_0xa66a('0x4'));var fs=require('fs');var Redis=require(_0xa66a('0x5'));var db=require(_0xa66a('0x6'))['db'];var utils=require(_0xa66a('0x7'));var logger=require('../../config/logger')(_0xa66a('0x8'));var config=require(_0xa66a('0x9'));var jayson=require(_0xa66a('0xa'));var client=jayson[_0xa66a('0xb')][_0xa66a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f42ce,_0x4b4f6a,_0x6b4082){return new BPromise(function(_0x2c2d3d,_0x50aaca){return client[_0xa66a('0xd')](_0x2f42ce,_0x6b4082)[_0xa66a('0xe')](function(_0x1e0107){logger[_0xa66a('0xf')](_0xa66a('0x10'),_0x4b4f6a,_0xa66a('0x11'));logger[_0xa66a('0x12')](_0xa66a('0x13'),_0x4b4f6a,_0xa66a('0x11'),JSON[_0xa66a('0x14')](_0x1e0107));if(_0x1e0107[_0xa66a('0x15')]){if(_0x1e0107[_0xa66a('0x15')]['code']===0x1f4){logger[_0xa66a('0x15')](_0xa66a('0x10'),_0x4b4f6a,_0x1e0107['error']['message']);return _0x50aaca(_0x1e0107[_0xa66a('0x15')][_0xa66a('0x16')]);}logger[_0xa66a('0x15')](_0xa66a('0x10'),_0x4b4f6a,_0x1e0107[_0xa66a('0x15')][_0xa66a('0x16')]);return _0x2c2d3d(_0x1e0107[_0xa66a('0x15')][_0xa66a('0x16')]);}else{logger[_0xa66a('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x4b4f6a,'request\x20sent');_0x2c2d3d(_0x1e0107[_0xa66a('0x17')][_0xa66a('0x16')]);}})[_0xa66a('0x18')](function(_0x509487){logger[_0xa66a('0x15')](_0xa66a('0x10'),_0x4b4f6a,_0x509487);_0x50aaca(_0x509487);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index de51fd2..7c45f46 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 _0x290c=['express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x290c,0x11d));var _0xc290=function(_0x4dd648,_0x23d7bb){_0x4dd648=_0x4dd648-0x0;var _0xdf9546=_0x290c[_0x4dd648];return _0xdf9546;};'use strict';var multer=require('multer');var util=require(_0xc290('0x0'));var path=require(_0xc290('0x1'));var timeout=require(_0xc290('0x2'));var express=require(_0xc290('0x3'));var router=express[_0xc290('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc290('0x5'));var interaction=require(_0xc290('0x6'));var config=require('../../config/environment');var controller=require(_0xc290('0x7'));router[_0xc290('0x8')]('/',auth[_0xc290('0x9')](),controller[_0xc290('0xa')]);router['get'](_0xc290('0xb'),auth['isAuthenticated'](),controller[_0xc290('0xc')]);router[_0xc290('0x8')](_0xc290('0xd'),auth[_0xc290('0x9')](),controller['show']);router['post']('/',auth[_0xc290('0x9')](),controller['create']);router[_0xc290('0xe')](_0xc290('0xd'),auth[_0xc290('0x9')](),controller[_0xc290('0xf')]);router['delete']('/:id',auth[_0xc290('0x9')](),controller[_0xc290('0x10')]);module[_0xc290('0x11')]=router; \ No newline at end of file +var _0xf56d=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','update','delete'];(function(_0x58b0bf,_0x527a7c){var _0x599631=function(_0x1c3d30){while(--_0x1c3d30){_0x58b0bf['push'](_0x58b0bf['shift']());}};_0x599631(++_0x527a7c);}(_0xf56d,0xdd));var _0xdf56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf56d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdf56('0x0'));var util=require(_0xdf56('0x1'));var path=require(_0xdf56('0x2'));var timeout=require(_0xdf56('0x3'));var express=require(_0xdf56('0x4'));var router=express[_0xdf56('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf56('0x6'));var interaction=require(_0xdf56('0x7'));var config=require('../../config/environment');var controller=require(_0xdf56('0x8'));router[_0xdf56('0x9')]('/',auth['isAuthenticated'](),controller[_0xdf56('0xa')]);router[_0xdf56('0x9')](_0xdf56('0xb'),auth['isAuthenticated'](),controller[_0xdf56('0xc')]);router[_0xdf56('0x9')](_0xdf56('0xd'),auth[_0xdf56('0xe')](),controller[_0xdf56('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdf56('0x10')]);router['put'](_0xdf56('0xd'),auth[_0xdf56('0xe')](),controller[_0xdf56('0x11')]);router[_0xdf56('0x12')](_0xdf56('0xd'),auth['isAuthenticated'](),controller[_0xdf56('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 67eb59f..c08fd32 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x5d1c9d,_0x8bb82d){var _0x8edfe4=function(_0x30fdc4){while(--_0x30fdc4){_0x5d1c9d['push'](_0x5d1c9d['shift']());}};_0x8edfe4(++_0x8bb82d);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1348a1,_0x3e918e){var _0x48f062=function(_0x3b3595){while(--_0x3b3595){_0x1348a1['push'](_0x1348a1['shift']());}};_0x48f062(++_0x3e918e);}(_0x008c,0x188));var _0xc008=function(_0x105598,_0xe7dd46){_0x105598=_0x105598-0x0;var _0x1b8b5a=_0x008c[_0x105598];return _0x1b8b5a;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 0124327..7705949 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 _0x669d=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise'];(function(_0x13e2d4,_0x1593a3){var _0x48146c=function(_0x5eae48){while(--_0x5eae48){_0x13e2d4['push'](_0x13e2d4['shift']());}};_0x48146c(++_0x1593a3);}(_0x669d,0x1dc));var _0xd669=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x669d[_0x122096];return _0x3d1966;};'use strict';var emlformat=require(_0xd669('0x0'));var rimraf=require(_0xd669('0x1'));var zipdir=require(_0xd669('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd669('0x3'));var moment=require('moment');var BPromise=require(_0xd669('0x4'));var Mustache=require(_0xd669('0x5'));var util=require(_0xd669('0x6'));var path=require(_0xd669('0x7'));var sox=require('sox');var csv=require(_0xd669('0x8'));var ejs=require(_0xd669('0x9'));var fs=require('fs');var fs_extra=require(_0xd669('0xa'));var _=require(_0xd669('0xb'));var squel=require(_0xd669('0xc'));var crypto=require(_0xd669('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd669('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd669('0xf'));var Papa=require(_0xd669('0x10'));var Redis=require('ioredis');var authService=require(_0xd669('0x11'));var qs=require(_0xd669('0x12'));var as=require(_0xd669('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd669('0x14'))(_0xd669('0x15'));var utils=require(_0xd669('0x16'));var config=require(_0xd669('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd669('0x18'))['db'];function respondWithStatusCode(_0x2ea942,_0x2cc8e5){_0x2cc8e5=_0x2cc8e5||0xcc;return function(_0x4b1969){if(_0x4b1969){return _0x2ea942[_0xd669('0x19')](_0x2cc8e5);}return _0x2ea942[_0xd669('0x1a')](_0x2cc8e5)[_0xd669('0x1b')]();};}function respondWithResult(_0x38006e,_0x5597f4){_0x5597f4=_0x5597f4||0xc8;return function(_0xb6e23e){if(_0xb6e23e){return _0x38006e[_0xd669('0x1a')](_0x5597f4)[_0xd669('0x1c')](_0xb6e23e);}};}function respondWithFilteredResult(_0x4815c4,_0xac229a){return function(_0x5cecc9){if(_0x5cecc9){var _0x411eb6=typeof _0xac229a['offset']===_0xd669('0x1d')&&typeof _0xac229a[_0xd669('0x1e')]===_0xd669('0x1d');var _0x30a7c1=_0x5cecc9[_0xd669('0x1f')];var _0x3c3f0a=_0x411eb6?0x0:_0xac229a[_0xd669('0x20')];var _0x488487=_0x411eb6?_0x5cecc9[_0xd669('0x1f')]:_0xac229a[_0xd669('0x20')]+_0xac229a[_0xd669('0x1e')];var _0xef9325;if(_0x488487>=_0x30a7c1){_0x488487=_0x30a7c1;_0xef9325=0xc8;}else{_0xef9325=0xce;}_0x4815c4[_0xd669('0x1a')](_0xef9325);return _0x4815c4[_0xd669('0x21')](_0xd669('0x22'),_0x3c3f0a+'-'+_0x488487+'/'+_0x30a7c1)[_0xd669('0x1c')](_0x5cecc9);}return null;};}function patchUpdates(_0x4c366d){return function(_0x20e3ce){try{jsonpatch[_0xd669('0x23')](_0x20e3ce,_0x4c366d,!![]);}catch(_0xd897cd){return BPromise[_0xd669('0x24')](_0xd897cd);}return _0x20e3ce[_0xd669('0x25')]();};}function saveUpdates(_0x4380ff,_0x3a9228){return function(_0x269db8){if(_0x269db8){return _0x269db8[_0xd669('0x26')](_0x4380ff)[_0xd669('0x27')](function(_0xe0ffa9){return _0xe0ffa9;});}return null;};}function removeEntity(_0x152827,_0x3552e8){return function(_0x4454e0){if(_0x4454e0){return _0x4454e0[_0xd669('0x28')]()[_0xd669('0x27')](function(){_0x152827[_0xd669('0x1a')](0xcc)[_0xd669('0x1b')]();});}};}function handleEntityNotFound(_0x3247fe,_0xf43442){return function(_0x47c908){if(!_0x47c908){_0x3247fe['sendStatus'](0x194);}return _0x47c908;};}function handleError(_0x55b01d,_0xc20cf0){_0xc20cf0=_0xc20cf0||0x1f4;return function(_0x5a927f){logger[_0xd669('0x29')](_0x5a927f['stack']);if(_0x5a927f[_0xd669('0x2a')]){delete _0x5a927f[_0xd669('0x2a')];}_0x55b01d['status'](_0xc20cf0)[_0xd669('0x2b')](_0x5a927f);};}exports[_0xd669('0x2c')]=function(_0x5e14f3,_0x2c6a23){var _0x86d194={},_0x225b5f={},_0x29d65e={'count':0x0,'rows':[]};var _0x43d031=_[_0xd669('0x2d')](db[_0xd669('0x2e')][_0xd669('0x2f')],function(_0x433acb){return{'name':_0x433acb[_0xd669('0x30')],'type':_0x433acb[_0xd669('0x31')][_0xd669('0x32')]};});_0x225b5f[_0xd669('0x33')]=_[_0xd669('0x2d')](_0x43d031,_0xd669('0x2a'));_0x225b5f[_0xd669('0x34')]=_[_0xd669('0x35')](_0x5e14f3[_0xd669('0x34')]);_0x225b5f[_0xd669('0x36')]=_[_0xd669('0x37')](_0x225b5f['model'],_0x225b5f['query']);_0x86d194[_0xd669('0x38')]=_['intersection'](_0x225b5f['model'],qs[_0xd669('0x39')](_0x5e14f3[_0xd669('0x34')][_0xd669('0x39')]));_0x86d194[_0xd669('0x38')]=_0x86d194[_0xd669('0x38')][_0xd669('0x3a')]?_0x86d194[_0xd669('0x38')]:_0x225b5f[_0xd669('0x33')];if(!_0x5e14f3[_0xd669('0x34')][_0xd669('0x3b')](_0xd669('0x3c'))){_0x86d194[_0xd669('0x1e')]=qs[_0xd669('0x1e')](_0x5e14f3[_0xd669('0x34')][_0xd669('0x1e')]);_0x86d194[_0xd669('0x20')]=qs['offset'](_0x5e14f3['query'][_0xd669('0x20')]);}_0x86d194[_0xd669('0x3d')]=qs[_0xd669('0x3e')](_0x5e14f3[_0xd669('0x34')][_0xd669('0x3e')]);_0x86d194[_0xd669('0x3f')]=qs[_0xd669('0x36')](_[_0xd669('0x40')](_0x5e14f3[_0xd669('0x34')],_0x225b5f[_0xd669('0x36')]),_0x43d031);if(_0x5e14f3[_0xd669('0x34')][_0xd669('0x41')]){_0x86d194[_0xd669('0x3f')]=_[_0xd669('0x42')](_0x86d194[_0xd669('0x3f')],{'$or':_[_0xd669('0x2d')](_0x43d031,function(_0x4fa7ab){if(_0x4fa7ab['type']!==_0xd669('0x43')){var _0x2bc67d={};_0x2bc67d[_0x4fa7ab['name']]={'$like':'%'+_0x5e14f3[_0xd669('0x34')][_0xd669('0x41')]+'%'};return _0x2bc67d;}})});}_0x86d194=_[_0xd669('0x42')]({},_0x86d194,_0x5e14f3[_0xd669('0x44')]);var _0x235892={'where':_0x86d194['where']};return db[_0xd669('0x2e')]['count'](_0x235892)[_0xd669('0x27')](function(_0x4b61e1){_0x29d65e[_0xd669('0x1f')]=_0x4b61e1;if(_0x5e14f3[_0xd669('0x34')][_0xd669('0x45')]){_0x86d194[_0xd669('0x46')]=[{'all':!![]}];}return db['MailTransferReport'][_0xd669('0x47')](_0x86d194);})[_0xd669('0x27')](function(_0x3c7729){_0x29d65e[_0xd669('0x48')]=_0x3c7729;return _0x29d65e;})[_0xd669('0x27')](respondWithFilteredResult(_0x2c6a23,_0x86d194))[_0xd669('0x49')](handleError(_0x2c6a23,null));};exports[_0xd669('0x4a')]=function(_0x31dcc3,_0x40ac98){var _0x155b6a={'raw':!![],'where':{'id':_0x31dcc3[_0xd669('0x4b')]['id']}},_0xbb005={};_0xbb005[_0xd669('0x33')]=_['keys'](db[_0xd669('0x2e')][_0xd669('0x2f')]);_0xbb005[_0xd669('0x34')]=_[_0xd669('0x35')](_0x31dcc3[_0xd669('0x34')]);_0xbb005['filters']=_['intersection'](_0xbb005[_0xd669('0x33')],_0xbb005[_0xd669('0x34')]);_0x155b6a['attributes']=_['intersection'](_0xbb005[_0xd669('0x33')],qs[_0xd669('0x39')](_0x31dcc3[_0xd669('0x34')]['fields']));_0x155b6a[_0xd669('0x38')]=_0x155b6a['attributes']['length']?_0x155b6a[_0xd669('0x38')]:_0xbb005[_0xd669('0x33')];if(_0x31dcc3[_0xd669('0x34')][_0xd669('0x45')]){_0x155b6a[_0xd669('0x46')]=[{'all':!![]}];}_0x155b6a=_[_0xd669('0x42')]({},_0x155b6a,_0x31dcc3[_0xd669('0x44')]);return db['MailTransferReport'][_0xd669('0x4c')](_0x155b6a)[_0xd669('0x27')](handleEntityNotFound(_0x40ac98,null))[_0xd669('0x27')](respondWithResult(_0x40ac98,null))[_0xd669('0x49')](handleError(_0x40ac98,null));};exports[_0xd669('0x4d')]=function(_0x2ee108,_0x10fa26){return db['MailTransferReport'][_0xd669('0x4d')](_0x2ee108[_0xd669('0x4e')],{})[_0xd669('0x27')](respondWithResult(_0x10fa26,0xc9))[_0xd669('0x49')](handleError(_0x10fa26,null));};exports[_0xd669('0x26')]=function(_0x104999,_0xcd8676){if(_0x104999[_0xd669('0x4e')]['id']){delete _0x104999[_0xd669('0x4e')]['id'];}return db[_0xd669('0x2e')][_0xd669('0x4c')]({'where':{'id':_0x104999[_0xd669('0x4b')]['id']}})[_0xd669('0x27')](handleEntityNotFound(_0xcd8676,null))[_0xd669('0x27')](saveUpdates(_0x104999[_0xd669('0x4e')],null))['then'](respondWithResult(_0xcd8676,null))[_0xd669('0x49')](handleError(_0xcd8676,null));};exports[_0xd669('0x28')]=function(_0x2bf900,_0xb5294d){return db['MailTransferReport'][_0xd669('0x4c')]({'where':{'id':_0x2bf900['params']['id']}})['then'](handleEntityNotFound(_0xb5294d,null))[_0xd669('0x27')](removeEntity(_0xb5294d,null))[_0xd669('0x49')](handleError(_0xb5294d,null));};exports[_0xd669('0x4f')]=function(_0x24d350,_0x286b34){return db[_0xd669('0x2e')][_0xd669('0x4f')]()['then'](respondWithResult(_0x286b34,null))['catch'](handleError(_0x286b34,null));}; \ No newline at end of file +var _0xad1e=['model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','eml-format','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','name','send','MailTransferReport','rawAttributes','type','key'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xad1e,0x1c0));var _0xead1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xad1e[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xead1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xead1('0x1'));var moment=require('moment');var BPromise=require(_0xead1('0x2'));var Mustache=require(_0xead1('0x3'));var util=require(_0xead1('0x4'));var path=require('path');var sox=require(_0xead1('0x5'));var csv=require(_0xead1('0x6'));var ejs=require(_0xead1('0x7'));var fs=require('fs');var fs_extra=require(_0xead1('0x8'));var _=require(_0xead1('0x9'));var squel=require(_0xead1('0xa'));var crypto=require(_0xead1('0xb'));var jsforce=require(_0xead1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xead1('0x6'));var querystring=require(_0xead1('0xd'));var Papa=require(_0xead1('0xe'));var Redis=require('ioredis');var authService=require(_0xead1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xead1('0x10'));var hardwareService=require(_0xead1('0x11'));var logger=require(_0xead1('0x12'))('api');var utils=require(_0xead1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xead1('0x14'))['db'];function respondWithStatusCode(_0x854465,_0x37ee70){_0x37ee70=_0x37ee70||0xcc;return function(_0x2d3a52){if(_0x2d3a52){return _0x854465['sendStatus'](_0x37ee70);}return _0x854465[_0xead1('0x15')](_0x37ee70)[_0xead1('0x16')]();};}function respondWithResult(_0x452dc0,_0x19a4b3){_0x19a4b3=_0x19a4b3||0xc8;return function(_0x481953){if(_0x481953){return _0x452dc0[_0xead1('0x15')](_0x19a4b3)[_0xead1('0x17')](_0x481953);}};}function respondWithFilteredResult(_0x41fed1,_0x5ddc30){return function(_0xcd9008){if(_0xcd9008){var _0x3a85dd=typeof _0x5ddc30[_0xead1('0x18')]===_0xead1('0x19')&&typeof _0x5ddc30[_0xead1('0x1a')]===_0xead1('0x19');var _0x34a83b=_0xcd9008[_0xead1('0x1b')];var _0x1f1b2d=_0x3a85dd?0x0:_0x5ddc30[_0xead1('0x18')];var _0x57c577=_0x3a85dd?_0xcd9008[_0xead1('0x1b')]:_0x5ddc30[_0xead1('0x18')]+_0x5ddc30[_0xead1('0x1a')];var _0x718b29;if(_0x57c577>=_0x34a83b){_0x57c577=_0x34a83b;_0x718b29=0xc8;}else{_0x718b29=0xce;}_0x41fed1['status'](_0x718b29);return _0x41fed1[_0xead1('0x1c')](_0xead1('0x1d'),_0x1f1b2d+'-'+_0x57c577+'/'+_0x34a83b)[_0xead1('0x17')](_0xcd9008);}return null;};}function patchUpdates(_0x4cd043){return function(_0x53412e){try{jsonpatch['apply'](_0x53412e,_0x4cd043,!![]);}catch(_0x1fc54a){return BPromise[_0xead1('0x1e')](_0x1fc54a);}return _0x53412e[_0xead1('0x1f')]();};}function saveUpdates(_0x4d0542,_0x35cb6b){return function(_0x3915da){if(_0x3915da){return _0x3915da[_0xead1('0x20')](_0x4d0542)[_0xead1('0x21')](function(_0xaa9c67){return _0xaa9c67;});}return null;};}function removeEntity(_0x31ad24,_0x12b8c1){return function(_0x3deffc){if(_0x3deffc){return _0x3deffc['destroy']()['then'](function(){_0x31ad24[_0xead1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x328d70,_0x2907b6){return function(_0x46d865){if(!_0x46d865){_0x328d70[_0xead1('0x22')](0x194);}return _0x46d865;};}function handleError(_0x56f8b5,_0x2dad83){_0x2dad83=_0x2dad83||0x1f4;return function(_0x58eea2){logger[_0xead1('0x23')](_0x58eea2['stack']);if(_0x58eea2['name']){delete _0x58eea2[_0xead1('0x24')];}_0x56f8b5['status'](_0x2dad83)[_0xead1('0x25')](_0x58eea2);};}exports['index']=function(_0x4641ab,_0x1acdca){var _0xa71339={},_0x24a401={},_0x2badae={'count':0x0,'rows':[]};var _0x34059e=_['map'](db[_0xead1('0x26')][_0xead1('0x27')],function(_0x758168){return{'name':_0x758168['fieldName'],'type':_0x758168[_0xead1('0x28')][_0xead1('0x29')]};});_0x24a401[_0xead1('0x2a')]=_[_0xead1('0x2b')](_0x34059e,_0xead1('0x24'));_0x24a401['query']=_[_0xead1('0x2c')](_0x4641ab[_0xead1('0x2d')]);_0x24a401[_0xead1('0x2e')]=_[_0xead1('0x2f')](_0x24a401[_0xead1('0x2a')],_0x24a401[_0xead1('0x2d')]);_0xa71339[_0xead1('0x30')]=_[_0xead1('0x2f')](_0x24a401[_0xead1('0x2a')],qs[_0xead1('0x31')](_0x4641ab[_0xead1('0x2d')][_0xead1('0x31')]));_0xa71339[_0xead1('0x30')]=_0xa71339[_0xead1('0x30')][_0xead1('0x32')]?_0xa71339[_0xead1('0x30')]:_0x24a401[_0xead1('0x2a')];if(!_0x4641ab[_0xead1('0x2d')][_0xead1('0x33')](_0xead1('0x34'))){_0xa71339[_0xead1('0x1a')]=qs['limit'](_0x4641ab[_0xead1('0x2d')][_0xead1('0x1a')]);_0xa71339[_0xead1('0x18')]=qs[_0xead1('0x18')](_0x4641ab[_0xead1('0x2d')][_0xead1('0x18')]);}_0xa71339[_0xead1('0x35')]=qs[_0xead1('0x36')](_0x4641ab[_0xead1('0x2d')]['sort']);_0xa71339[_0xead1('0x37')]=qs['filters'](_['pick'](_0x4641ab[_0xead1('0x2d')],_0x24a401['filters']),_0x34059e);if(_0x4641ab['query'][_0xead1('0x38')]){_0xa71339[_0xead1('0x37')]=_[_0xead1('0x39')](_0xa71339[_0xead1('0x37')],{'$or':_[_0xead1('0x2b')](_0x34059e,function(_0x106bc9){if(_0x106bc9[_0xead1('0x28')]!=='VIRTUAL'){var _0x1e61d2={};_0x1e61d2[_0x106bc9[_0xead1('0x24')]]={'$like':'%'+_0x4641ab[_0xead1('0x2d')][_0xead1('0x38')]+'%'};return _0x1e61d2;}})});}_0xa71339=_[_0xead1('0x39')]({},_0xa71339,_0x4641ab[_0xead1('0x3a')]);var _0x12d43b={'where':_0xa71339[_0xead1('0x37')]};return db[_0xead1('0x26')][_0xead1('0x1b')](_0x12d43b)[_0xead1('0x21')](function(_0x1b2dc5){_0x2badae['count']=_0x1b2dc5;if(_0x4641ab[_0xead1('0x2d')][_0xead1('0x3b')]){_0xa71339[_0xead1('0x3c')]=[{'all':!![]}];}return db[_0xead1('0x26')][_0xead1('0x3d')](_0xa71339);})[_0xead1('0x21')](function(_0x2937e0){_0x2badae[_0xead1('0x3e')]=_0x2937e0;return _0x2badae;})[_0xead1('0x21')](respondWithFilteredResult(_0x1acdca,_0xa71339))['catch'](handleError(_0x1acdca,null));};exports[_0xead1('0x3f')]=function(_0x1947fa,_0x246c76){var _0x41ac1f={'raw':!![],'where':{'id':_0x1947fa[_0xead1('0x40')]['id']}},_0x1d43d9={};_0x1d43d9['model']=_[_0xead1('0x2c')](db['MailTransferReport'][_0xead1('0x27')]);_0x1d43d9[_0xead1('0x2d')]=_['keys'](_0x1947fa[_0xead1('0x2d')]);_0x1d43d9[_0xead1('0x2e')]=_[_0xead1('0x2f')](_0x1d43d9[_0xead1('0x2a')],_0x1d43d9[_0xead1('0x2d')]);_0x41ac1f[_0xead1('0x30')]=_['intersection'](_0x1d43d9[_0xead1('0x2a')],qs[_0xead1('0x31')](_0x1947fa[_0xead1('0x2d')][_0xead1('0x31')]));_0x41ac1f[_0xead1('0x30')]=_0x41ac1f[_0xead1('0x30')][_0xead1('0x32')]?_0x41ac1f[_0xead1('0x30')]:_0x1d43d9[_0xead1('0x2a')];if(_0x1947fa[_0xead1('0x2d')][_0xead1('0x3b')]){_0x41ac1f[_0xead1('0x3c')]=[{'all':!![]}];}_0x41ac1f=_[_0xead1('0x39')]({},_0x41ac1f,_0x1947fa[_0xead1('0x3a')]);return db[_0xead1('0x26')][_0xead1('0x41')](_0x41ac1f)[_0xead1('0x21')](handleEntityNotFound(_0x246c76,null))[_0xead1('0x21')](respondWithResult(_0x246c76,null))[_0xead1('0x42')](handleError(_0x246c76,null));};exports[_0xead1('0x43')]=function(_0x121d83,_0x103005){return db[_0xead1('0x26')][_0xead1('0x43')](_0x121d83[_0xead1('0x44')],{})['then'](respondWithResult(_0x103005,0xc9))['catch'](handleError(_0x103005,null));};exports[_0xead1('0x20')]=function(_0x24b24a,_0x1a6991){if(_0x24b24a['body']['id']){delete _0x24b24a[_0xead1('0x44')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x24b24a['params']['id']}})['then'](handleEntityNotFound(_0x1a6991,null))[_0xead1('0x21')](saveUpdates(_0x24b24a[_0xead1('0x44')],null))['then'](respondWithResult(_0x1a6991,null))[_0xead1('0x42')](handleError(_0x1a6991,null));};exports[_0xead1('0x45')]=function(_0x3ae80e,_0x5dfd80){return db[_0xead1('0x26')]['find']({'where':{'id':_0x3ae80e['params']['id']}})[_0xead1('0x21')](handleEntityNotFound(_0x5dfd80,null))['then'](removeEntity(_0x5dfd80,null))[_0xead1('0x42')](handleError(_0x5dfd80,null));};exports['describe']=function(_0x489e0d,_0x13fd93){return db[_0xead1('0x26')]['describe']()['then'](respondWithResult(_0x13fd93,null))[_0xead1('0x42')](handleError(_0x13fd93,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 7a8a575..648487b 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 _0x0ab2=['report_mail_transfer','uniqueid','../../config/logger','moment','bluebird','rimraf','./mailTransferReport.attributes','define','MailTransferReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0ab2,0x92));var _0x20ab=function(_0x23af8d,_0x5f0e9c){_0x23af8d=_0x23af8d-0x0;var _0x164819=_0x0ab2[_0x23af8d];return _0x164819;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x20ab('0x0'))('api');var moment=require(_0x20ab('0x1'));var BPromise=require(_0x20ab('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20ab('0x3'));var config=require('../../config/environment');var attributes=require(_0x20ab('0x4'));module['exports']=function(_0x44fdb2,_0x259548){return _0x44fdb2[_0x20ab('0x5')](_0x20ab('0x6'),attributes,{'tableName':_0x20ab('0x7'),'paranoid':![],'indexes':[{'name':_0x20ab('0x8'),'fields':[_0x20ab('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x536e=['../../config/environment','./mailTransferReport.attributes','exports','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x31ec9c,_0x2887b5){var _0x4b8c56=function(_0x5a3311){while(--_0x5a3311){_0x31ec9c['push'](_0x31ec9c['shift']());}};_0x4b8c56(++_0x2887b5);}(_0x536e,0x155));var _0xe536=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0x536e[_0x24679e];return _0x291f21;};'use strict';var _=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var logger=require(_0xe536('0x2'))(_0xe536('0x3'));var moment=require(_0xe536('0x4'));var BPromise=require(_0xe536('0x5'));var rp=require(_0xe536('0x6'));var fs=require('fs');var path=require(_0xe536('0x7'));var rimraf=require(_0xe536('0x8'));var config=require(_0xe536('0x9'));var attributes=require(_0xe536('0xa'));module[_0xe536('0xb')]=function(_0x263c4f,_0x2991af){return _0x263c4f['define']('MailTransferReport',attributes,{'tableName':_0xe536('0xc'),'paranoid':![],'indexes':[{'name':_0xe536('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 955db8a..fd99bd8 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 _0x3bd3=['jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x425036,_0x39bebc){var _0x7fc880=function(_0x54493c){while(--_0x54493c){_0x425036['push'](_0x425036['shift']());}};_0x7fc880(++_0x39bebc);}(_0x3bd3,0x1b0));var _0x33bd=function(_0x71ef5c,_0x7b5528){_0x71ef5c=_0x71ef5c-0x0;var _0x1d34d0=_0x3bd3[_0x71ef5c];return _0x1d34d0;};'use strict';var _=require(_0x33bd('0x0'));var util=require('util');var moment=require(_0x33bd('0x1'));var BPromise=require(_0x33bd('0x2'));var rs=require(_0x33bd('0x3'));var fs=require('fs');var Redis=require(_0x33bd('0x4'));var db=require(_0x33bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x33bd('0x6'));var config=require(_0x33bd('0x7'));var jayson=require(_0x33bd('0x8'));var client=jayson[_0x33bd('0x9')][_0x33bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a410,_0x575a05,_0x467d9f){return new BPromise(function(_0x45cd29,_0x122778){return client[_0x33bd('0xb')](_0x49a410,_0x467d9f)[_0x33bd('0xc')](function(_0x79d682){logger[_0x33bd('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x575a05,'request\x20sent');logger['debug'](_0x33bd('0xe'),_0x575a05,_0x33bd('0xf'),JSON[_0x33bd('0x10')](_0x79d682));if(_0x79d682[_0x33bd('0x11')]){if(_0x79d682['error']['code']===0x1f4){logger['error'](_0x33bd('0x12'),_0x575a05,_0x79d682['error']['message']);return _0x122778(_0x79d682[_0x33bd('0x11')][_0x33bd('0x13')]);}logger[_0x33bd('0x11')](_0x33bd('0x12'),_0x575a05,_0x79d682['error']['message']);return _0x45cd29(_0x79d682[_0x33bd('0x11')]['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x575a05,_0x33bd('0xf'));_0x45cd29(_0x79d682[_0x33bd('0x14')][_0x33bd('0x13')]);}})[_0x33bd('0x15')](function(_0x143feb){logger[_0x33bd('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x575a05,_0x143feb);_0x122778(_0x143feb);});});} \ No newline at end of file +var _0x6787=['client','request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise'];(function(_0x1c976c,_0xa5539d){var _0x356ca7=function(_0x2c3198){while(--_0x2c3198){_0x1c976c['push'](_0x1c976c['shift']());}};_0x356ca7(++_0xa5539d);}(_0x6787,0xc9));var _0x7678=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x6787[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x7678('0x0'));var util=require(_0x7678('0x1'));var moment=require(_0x7678('0x2'));var BPromise=require(_0x7678('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7678('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7678('0x5'))(_0x7678('0x6'));var config=require('../../config/environment');var jayson=require(_0x7678('0x7'));var client=jayson[_0x7678('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3defa0,_0x2922c1,_0x332d26){return new BPromise(function(_0x275e1f,_0x3744b7){return client[_0x7678('0x9')](_0x3defa0,_0x332d26)['then'](function(_0x5482be){logger[_0x7678('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x2922c1,_0x7678('0xb'));logger[_0x7678('0xc')](_0x7678('0xd'),_0x2922c1,_0x7678('0xb'),JSON['stringify'](_0x5482be));if(_0x5482be['error']){if(_0x5482be[_0x7678('0xe')][_0x7678('0xf')]===0x1f4){logger[_0x7678('0xe')](_0x7678('0x10'),_0x2922c1,_0x5482be[_0x7678('0xe')][_0x7678('0x11')]);return _0x3744b7(_0x5482be[_0x7678('0xe')][_0x7678('0x11')]);}logger[_0x7678('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2922c1,_0x5482be[_0x7678('0xe')][_0x7678('0x11')]);return _0x275e1f(_0x5482be[_0x7678('0xe')][_0x7678('0x11')]);}else{logger['info'](_0x7678('0x10'),_0x2922c1,_0x7678('0xb'));_0x275e1f(_0x5482be['result'][_0x7678('0x11')]);}})[_0x7678('0x12')](function(_0x568d68){logger[_0x7678('0xe')](_0x7678('0x10'),_0x2922c1,_0x568d68);_0x3744b7(_0x568d68);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a765567..1ee8aef 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 _0x62f9=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','show','put','update','delete','/:id','destroy','exports','multer'];(function(_0x351cef,_0x2355ac){var _0x2d5c2a=function(_0x236a83){while(--_0x236a83){_0x351cef['push'](_0x351cef['shift']());}};_0x2d5c2a(++_0x2355ac);}(_0x62f9,0x109));var _0x962f=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x62f9[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x962f('0x0'));var util=require(_0x962f('0x1'));var path=require('path');var timeout=require(_0x962f('0x2'));var express=require(_0x962f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x962f('0x4'));var interaction=require(_0x962f('0x5'));var config=require(_0x962f('0x6'));var controller=require(_0x962f('0x7'));router[_0x962f('0x8')]('/',auth['isAuthenticated'](),controller[_0x962f('0x9')]);router['get'](_0x962f('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x962f('0xb')](),controller[_0x962f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x962f('0xd')]('/:id',auth[_0x962f('0xb')](),controller[_0x962f('0xe')]);router[_0x962f('0xf')](_0x962f('0x10'),auth[_0x962f('0xb')](),controller[_0x962f('0x11')]);module[_0x962f('0x12')]=router; \ No newline at end of file +var _0x849f=['update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x849f,0x13c));var _0xf849=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x849f[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0xf849('0x0'));var util=require(_0xf849('0x1'));var path=require(_0xf849('0x2'));var timeout=require(_0xf849('0x3'));var express=require(_0xf849('0x4'));var router=express[_0xf849('0x5')]();var fs_extra=require(_0xf849('0x6'));var auth=require(_0xf849('0x7'));var interaction=require(_0xf849('0x8'));var config=require(_0xf849('0x9'));var controller=require(_0xf849('0xa'));router[_0xf849('0xb')]('/',auth[_0xf849('0xc')](),controller[_0xf849('0xd')]);router[_0xf849('0xb')](_0xf849('0xe'),auth[_0xf849('0xc')](),controller[_0xf849('0xf')]);router[_0xf849('0xb')](_0xf849('0x10'),auth[_0xf849('0xc')](),controller['show']);router[_0xf849('0x11')]('/',auth[_0xf849('0xc')](),controller[_0xf849('0x12')]);router[_0xf849('0x13')](_0xf849('0x10'),auth[_0xf849('0xc')](),controller[_0xf849('0x14')]);router['delete'](_0xf849('0x10'),auth[_0xf849('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 77fe267..c8c0b61 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 _0xd110=['DATE','getDataValue','diff','seconds','setDataValue','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd110,0x1e8));var _0x0d11=function(_0x36c79c,_0x441e3f){_0x36c79c=_0x36c79c-0x0;var _0x38230a=_0xd110[_0x36c79c];return _0x38230a;};'use strict';var Sequelize=require(_0x0d11('0x0'));var moment=require(_0x0d11('0x1'));module[_0x0d11('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0d11('0x3')]},'interface':{'type':Sequelize[_0x0d11('0x3')]},'type':{'type':Sequelize[_0x0d11('0x3')],'defaultValue':_0x0d11('0x4'),'comment':_0x0d11('0x5')},'duration':{'type':Sequelize[_0x0d11('0x6')]},'enterAt':{'type':Sequelize[_0x0d11('0x7')]},'exitAt':{'type':Sequelize[_0x0d11('0x7')],'set':function(_0x578537){var _0xf61dad=moment(_0x578537);var _0x5a889c=moment(this[_0x0d11('0x8')]('enterAt'));var _0x47a493=_0xf61dad[_0x0d11('0x9')](_0x5a889c,_0x0d11('0xa'));this[_0x0d11('0xb')]('exitAt',_0x578537);this[_0x0d11('0xb')]('duration',_0x47a493||null);}},'data1':{'type':Sequelize[_0x0d11('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x0d11('0x3')],'comment':_0x0d11('0xc')},'data3':{'type':Sequelize[_0x0d11('0x3')],'comment':_0x0d11('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x0d11('0xe')},'data5':{'type':Sequelize[_0x0d11('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x0d11('0x3')]},'internal':{'type':Sequelize[_0x0d11('0x6')]},'uniqueid':{'type':Sequelize[_0x0d11('0x3')]}}; \ No newline at end of file +var _0x9c5e=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x99aacc,_0x1f913a){var _0xca3516=function(_0x4eeb76){while(--_0x4eeb76){_0x99aacc['push'](_0x99aacc['shift']());}};_0xca3516(++_0x1f913a);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x2a6ea8,_0x150a79){_0x2a6ea8=_0x2a6ea8-0x0;var _0x4ca660=_0x9c5e[_0x2a6ea8];return _0x4ca660;};'use strict';var Sequelize=require(_0xe9c5('0x0'));var moment=require(_0xe9c5('0x1'));module[_0xe9c5('0x2')]={'channel':{'type':Sequelize[_0xe9c5('0x3')]},'membername':{'type':Sequelize[_0xe9c5('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xe9c5('0x4')},'duration':{'type':Sequelize[_0xe9c5('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe9c5('0x6')],'set':function(_0x5c11e5){var _0x1e6a31=moment(_0x5c11e5);var _0x6f6045=moment(this['getDataValue'](_0xe9c5('0x7')));var _0x34ee69=_0x1e6a31[_0xe9c5('0x8')](_0x6f6045,_0xe9c5('0x9'));this['setDataValue']('exitAt',_0x5c11e5);this[_0xe9c5('0xa')](_0xe9c5('0xb'),_0x34ee69||null);}},'data1':{'type':Sequelize[_0xe9c5('0x3')],'comment':_0xe9c5('0xc')},'data2':{'type':Sequelize[_0xe9c5('0x3')],'comment':_0xe9c5('0xd')},'data3':{'type':Sequelize[_0xe9c5('0x3')],'comment':_0xe9c5('0xe')},'data4':{'type':Sequelize[_0xe9c5('0x3')],'comment':_0xe9c5('0xf')},'data5':{'type':Sequelize[_0xe9c5('0x3')],'comment':_0xe9c5('0x10')},'role':{'type':Sequelize[_0xe9c5('0x3')]},'internal':{'type':Sequelize[_0xe9c5('0x5')]},'uniqueid':{'type':Sequelize[_0xe9c5('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 9d98d57..57d2550 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 _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(_0x2304ce,_0x5e2bb0){var _0x503964=function(_0x13e9f2){while(--_0x13e9f2){_0x2304ce['push'](_0x2304ce['shift']());}};_0x503964(++_0x5e2bb0);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['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 +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(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x34e8,0x12c));var _0x834e=function(_0x320aa8,_0x111a10){_0x320aa8=_0x320aa8-0x0;var _0x58e5c1=_0x34e8[_0x320aa8];return _0x58e5c1;};'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 diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 1cbaa8b..e07e1f3 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 _0x8afd=['../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername','interface','lodash','util','api','moment','bluebird','path'];(function(_0x27f146,_0x5515bf){var _0xd45e2a=function(_0x51dce2){while(--_0x51dce2){_0x27f146['push'](_0x27f146['shift']());}};_0xd45e2a(++_0x5515bf);}(_0x8afd,0xf1));var _0xd8af=function(_0x12ed4e,_0x16c05c){_0x12ed4e=_0x12ed4e-0x0;var _0x1f71a9=_0x8afd[_0x12ed4e];return _0x1f71a9;};'use strict';var _=require(_0xd8af('0x0'));var util=require(_0xd8af('0x1'));var logger=require('../../config/logger')(_0xd8af('0x2'));var moment=require(_0xd8af('0x3'));var BPromise=require(_0xd8af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8af('0x5'));var rimraf=require('rimraf');var config=require(_0xd8af('0x6'));var attributes=require(_0xd8af('0x7'));module['exports']=function(_0x54a2b8,_0x44d69c){return _0x54a2b8[_0xd8af('0x8')](_0xd8af('0x9'),attributes,{'tableName':_0xd8af('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xd8af('0xb'),_0xd8af('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfc4f=['moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','util','../../config/logger','api'];(function(_0x38d03d,_0x141e9d){var _0x1f1fc2=function(_0x51e15d){while(--_0x51e15d){_0x38d03d['push'](_0x38d03d['shift']());}};_0x1f1fc2(++_0x141e9d);}(_0xfc4f,0x192));var _0xffc4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfc4f[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xffc4('0x0'));var logger=require(_0xffc4('0x1'))(_0xffc4('0x2'));var moment=require(_0xffc4('0x3'));var BPromise=require(_0xffc4('0x4'));var rp=require(_0xffc4('0x5'));var fs=require('fs');var path=require(_0xffc4('0x6'));var rimraf=require('rimraf');var config=require(_0xffc4('0x7'));var attributes=require(_0xffc4('0x8'));module[_0xffc4('0x9')]=function(_0x2efa5f,_0x4cd469){return _0x2efa5f[_0xffc4('0xa')](_0xffc4('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xffc4('0xc'),'fields':[_0xffc4('0xd'),_0xffc4('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 82997b8..095cbf2 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 _0xcd05=['MemberReport','create','body','UpdateMemberReport','update','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','map','include','model','GetMemberReport','catch','CreateMemberReport'];(function(_0x49a4b6,_0x170c9e){var _0x3d1f88=function(_0xbf0cb2){while(--_0xbf0cb2){_0x49a4b6['push'](_0x49a4b6['shift']());}};_0x3d1f88(++_0x170c9e);}(_0xcd05,0x163));var _0x5cd0=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xcd05[_0x363ef8];return _0x148822;};'use strict';var _=require(_0x5cd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5cd0('0x1'));var fs=require('fs');var Redis=require(_0x5cd0('0x2'));var db=require(_0x5cd0('0x3'))['db'];var utils=require(_0x5cd0('0x4'));var logger=require('../../config/logger')(_0x5cd0('0x5'));var config=require(_0x5cd0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10fd06,_0x3cfb51,_0x3f609e){return new BPromise(function(_0x2a95a6,_0x3c0593){return client[_0x5cd0('0x7')](_0x10fd06,_0x3f609e)[_0x5cd0('0x8')](function(_0x5b5682){logger[_0x5cd0('0x9')](_0x5cd0('0xa'),_0x3cfb51,_0x5cd0('0xb'));logger[_0x5cd0('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3cfb51,_0x5cd0('0xb'),JSON[_0x5cd0('0xd')](_0x5b5682));if(_0x5b5682[_0x5cd0('0xe')]){if(_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0xf')]===0x1f4){logger[_0x5cd0('0xe')](_0x5cd0('0xa'),_0x3cfb51,_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0x10')]);return _0x3c0593(_0x5b5682[_0x5cd0('0xe')]['message']);}logger['error']('MemberReport,\x20%s,\x20%s',_0x3cfb51,_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0x10')]);return _0x2a95a6(_0x5b5682['error'][_0x5cd0('0x10')]);}else{logger['info'](_0x5cd0('0xa'),_0x3cfb51,_0x5cd0('0xb'));_0x2a95a6(_0x5b5682[_0x5cd0('0x11')]['message']);}})['catch'](function(_0x489f62){logger[_0x5cd0('0xe')](_0x5cd0('0xa'),_0x3cfb51,_0x489f62);_0x3c0593(_0x489f62);});});}exports['GetMemberReport']=function(_0x57d81d){var _0x4b7dac=this;return new Promise(function(_0x1847dd,_0x106c1e){return db['MemberReport'][_0x5cd0('0x12')]({'raw':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x14')]===undefined?!![]:![]:!![],'where':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x15')]||null:null,'attributes':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x16')]||null:null,'limit':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x17')]||null:null,'include':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d['options']['include']?_[_0x5cd0('0x18')](_0x57d81d['options'][_0x5cd0('0x19')],function(_0x2e01b6){return{'model':db[_0x2e01b6[_0x5cd0('0x1a')]],'as':_0x2e01b6['as'],'attributes':_0x2e01b6[_0x5cd0('0x16')],'include':_0x2e01b6[_0x5cd0('0x19')]?_[_0x5cd0('0x18')](_0x2e01b6[_0x5cd0('0x19')],function(_0x5385db){return{'model':db[_0x5385db['model']],'as':_0x5385db['as'],'attributes':_0x5385db[_0x5cd0('0x16')],'include':_0x5385db[_0x5cd0('0x19')]?_[_0x5cd0('0x18')](_0x5385db[_0x5cd0('0x19')],function(_0x5bff8a){return{'model':db[_0x5bff8a[_0x5cd0('0x1a')]],'as':_0x5bff8a['as'],'attributes':_0x5bff8a[_0x5cd0('0x16')]};}):[]};}):[]};}):[]:[]})[_0x5cd0('0x8')](function(_0x53a6cf){logger['info'](_0x5cd0('0x1b'),_0x57d81d);logger[_0x5cd0('0xc')]('GetMemberReport',_0x57d81d,JSON[_0x5cd0('0xd')](_0x53a6cf));_0x1847dd(_0x53a6cf);})[_0x5cd0('0x1c')](function(_0x2dfb5d){logger[_0x5cd0('0xe')](_0x5cd0('0x1b'),_0x2dfb5d[_0x5cd0('0x10')],_0x57d81d);_0x106c1e(_0x4b7dac[_0x5cd0('0xe')](0x1f4,_0x2dfb5d['message']));});});};exports[_0x5cd0('0x1d')]=function(_0x1621f9){var _0x1b88ac=this;return new Promise(function(_0x3a4b2f,_0x400148){return db[_0x5cd0('0x1e')][_0x5cd0('0x1f')](_0x1621f9[_0x5cd0('0x20')],{'raw':_0x1621f9[_0x5cd0('0x13')]?_0x1621f9[_0x5cd0('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x5cd0('0x8')](function(_0x3fb346){logger['info'](_0x5cd0('0x1d'),_0x1621f9);logger['debug'](_0x5cd0('0x1d'),_0x1621f9,JSON[_0x5cd0('0xd')](_0x3fb346));_0x3a4b2f(_0x3fb346);})['catch'](function(_0x42974c){logger['error'](_0x5cd0('0x1d'),_0x42974c[_0x5cd0('0x10')],_0x1621f9);_0x400148(_0x1b88ac[_0x5cd0('0xe')](0x1f4,_0x42974c['message']));});});};exports[_0x5cd0('0x21')]=function(_0x5368ff){var _0xa84bd2=this;return new Promise(function(_0x1a4855,_0x599355){return db[_0x5cd0('0x1e')][_0x5cd0('0x22')](_0x5368ff[_0x5cd0('0x20')],{'raw':_0x5368ff[_0x5cd0('0x13')]?_0x5368ff[_0x5cd0('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5368ff['options']?_0x5368ff[_0x5cd0('0x13')][_0x5cd0('0x15')]||null:null,'attributes':_0x5368ff['options']?_0x5368ff[_0x5cd0('0x13')][_0x5cd0('0x16')]||null:null,'limit':_0x5368ff[_0x5cd0('0x13')]?_0x5368ff[_0x5cd0('0x13')][_0x5cd0('0x17')]||null:null})['then'](function(_0x2a67e6){logger[_0x5cd0('0x9')](_0x5cd0('0x21'),_0x5368ff);logger[_0x5cd0('0xc')](_0x5cd0('0x21'),_0x5368ff,JSON[_0x5cd0('0xd')](_0x2a67e6));_0x1a4855(_0x2a67e6);})[_0x5cd0('0x1c')](function(_0x1dc8e4){logger[_0x5cd0('0xe')](_0x5cd0('0x21'),_0x1dc8e4[_0x5cd0('0x10')],_0x5368ff);_0x599355(_0xa84bd2[_0x5cd0('0xe')](0x1f4,_0x1dc8e4[_0x5cd0('0x10')]));});});}; \ No newline at end of file +var _0xfa9f=['catch','GetMemberReport','findAll','options','raw','attributes','limit','include','model','map','CreateMemberReport','MemberReport','create','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x44ac56,_0x4b2296){var _0x2b70bc=function(_0x87a87c){while(--_0x87a87c){_0x44ac56['push'](_0x44ac56['shift']());}};_0x2b70bc(++_0x4b2296);}(_0xfa9f,0x93));var _0xffa9=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xfa9f[_0x52666e];return _0x515330;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var moment=require(_0xffa9('0x1'));var BPromise=require(_0xffa9('0x2'));var rs=require(_0xffa9('0x3'));var fs=require('fs');var Redis=require(_0xffa9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffa9('0x5'));var logger=require('../../config/logger')(_0xffa9('0x6'));var config=require(_0xffa9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xffa9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4948c0,_0x1fe01a,_0x1fe931){return new BPromise(function(_0x249501,_0x13c3d0){return client['request'](_0x4948c0,_0x1fe931)[_0xffa9('0x9')](function(_0x1685c7){logger[_0xffa9('0xa')](_0xffa9('0xb'),_0x1fe01a,_0xffa9('0xc'));logger[_0xffa9('0xd')](_0xffa9('0xe'),_0x1fe01a,_0xffa9('0xc'),JSON[_0xffa9('0xf')](_0x1685c7));if(_0x1685c7[_0xffa9('0x10')]){if(_0x1685c7[_0xffa9('0x10')]['code']===0x1f4){logger[_0xffa9('0x10')](_0xffa9('0xb'),_0x1fe01a,_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);return _0x13c3d0(_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);}logger[_0xffa9('0x10')](_0xffa9('0xb'),_0x1fe01a,_0x1685c7[_0xffa9('0x10')][_0xffa9('0x11')]);return _0x249501(_0x1685c7['error'][_0xffa9('0x11')]);}else{logger['info'](_0xffa9('0xb'),_0x1fe01a,_0xffa9('0xc'));_0x249501(_0x1685c7['result'][_0xffa9('0x11')]);}})[_0xffa9('0x12')](function(_0x1ce6c3){logger['error'](_0xffa9('0xb'),_0x1fe01a,_0x1ce6c3);_0x13c3d0(_0x1ce6c3);});});}exports[_0xffa9('0x13')]=function(_0x3cd552){var _0x2e87a8=this;return new Promise(function(_0x4fbe1c,_0x2ee445){return db['MemberReport'][_0xffa9('0x14')]({'raw':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x16')]===undefined?!![]:![]:!![],'where':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')]['where']||null:null,'attributes':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x17')]||null:null,'limit':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x18')]||null:null,'include':_0x3cd552[_0xffa9('0x15')]?_0x3cd552[_0xffa9('0x15')][_0xffa9('0x19')]?_['map'](_0x3cd552['options'][_0xffa9('0x19')],function(_0x19655d){return{'model':db[_0x19655d[_0xffa9('0x1a')]],'as':_0x19655d['as'],'attributes':_0x19655d['attributes'],'include':_0x19655d['include']?_[_0xffa9('0x1b')](_0x19655d[_0xffa9('0x19')],function(_0xb22ae3){return{'model':db[_0xb22ae3['model']],'as':_0xb22ae3['as'],'attributes':_0xb22ae3['attributes'],'include':_0xb22ae3[_0xffa9('0x19')]?_['map'](_0xb22ae3[_0xffa9('0x19')],function(_0x2a2ceb){return{'model':db[_0x2a2ceb[_0xffa9('0x1a')]],'as':_0x2a2ceb['as'],'attributes':_0x2a2ceb[_0xffa9('0x17')]};}):[]};}):[]};}):[]:[]})[_0xffa9('0x9')](function(_0x1aa814){logger[_0xffa9('0xa')]('GetMemberReport',_0x3cd552);logger[_0xffa9('0xd')](_0xffa9('0x13'),_0x3cd552,JSON[_0xffa9('0xf')](_0x1aa814));_0x4fbe1c(_0x1aa814);})[_0xffa9('0x12')](function(_0x5ee60d){logger[_0xffa9('0x10')]('GetMemberReport',_0x5ee60d['message'],_0x3cd552);_0x2ee445(_0x2e87a8[_0xffa9('0x10')](0x1f4,_0x5ee60d[_0xffa9('0x11')]));});});};exports[_0xffa9('0x1c')]=function(_0x45a8a4){var _0xd353c4=this;return new Promise(function(_0x1a8703,_0x70cf75){return db[_0xffa9('0x1d')][_0xffa9('0x1e')](_0x45a8a4['body'],{'raw':_0x45a8a4[_0xffa9('0x15')]?_0x45a8a4[_0xffa9('0x15')][_0xffa9('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x475eba){logger[_0xffa9('0xa')](_0xffa9('0x1c'),_0x45a8a4);logger['debug'](_0xffa9('0x1c'),_0x45a8a4,JSON[_0xffa9('0xf')](_0x475eba));_0x1a8703(_0x475eba);})[_0xffa9('0x12')](function(_0x4c06e5){logger[_0xffa9('0x10')]('CreateMemberReport',_0x4c06e5['message'],_0x45a8a4);_0x70cf75(_0xd353c4[_0xffa9('0x10')](0x1f4,_0x4c06e5['message']));});});};exports[_0xffa9('0x1f')]=function(_0x14b965){var _0x31a325=this;return new Promise(function(_0x35babd,_0x2f7cce){return db['MemberReport'][_0xffa9('0x20')](_0x14b965['body'],{'raw':_0x14b965['options']?_0x14b965[_0xffa9('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14b965[_0xffa9('0x15')]?_0x14b965[_0xffa9('0x15')]['where']||null:null,'attributes':_0x14b965['options']?_0x14b965[_0xffa9('0x15')]['attributes']||null:null,'limit':_0x14b965[_0xffa9('0x15')]?_0x14b965[_0xffa9('0x15')]['limit']||null:null})['then'](function(_0x4827a6){logger['info'](_0xffa9('0x1f'),_0x14b965);logger[_0xffa9('0xd')](_0xffa9('0x1f'),_0x14b965,JSON['stringify'](_0x4827a6));_0x35babd(_0x4827a6);})[_0xffa9('0x12')](function(_0x3d9cd7){logger[_0xffa9('0x10')](_0xffa9('0x1f'),_0x3d9cd7[_0xffa9('0x11')],_0x14b965);_0x2f7cce(_0x31a325['error'](0x1f4,_0x3d9cd7['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4723aff..869d6f4 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 _0x28e1=['index','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x14d617,_0x1a2060){var _0x2967b6=function(_0x511e92){while(--_0x511e92){_0x14d617['push'](_0x14d617['shift']());}};_0x2967b6(++_0x1a2060);}(_0x28e1,0x85));var _0x128e=function(_0x9fe54,_0x55944a){_0x9fe54=_0x9fe54-0x0;var _0x5ef6d6=_0x28e1[_0x9fe54];return _0x5ef6d6;};'use strict';var multer=require(_0x128e('0x0'));var util=require('util');var path=require(_0x128e('0x1'));var timeout=require(_0x128e('0x2'));var express=require(_0x128e('0x3'));var router=express[_0x128e('0x4')]();var fs_extra=require(_0x128e('0x5'));var auth=require(_0x128e('0x6'));var interaction=require(_0x128e('0x7'));var config=require(_0x128e('0x8'));var controller=require('./migration.controller');router[_0x128e('0x9')]('/',controller[_0x128e('0xa')]);module['exports']=router; \ No newline at end of file +var _0x0e5d=['index','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x0e5d,0x152));var _0xd0e5=function(_0x131cc,_0x157ea9){_0x131cc=_0x131cc-0x0;var _0x36e23b=_0x0e5d[_0x131cc];return _0x36e23b;};'use strict';var multer=require(_0xd0e5('0x0'));var util=require(_0xd0e5('0x1'));var path=require('path');var timeout=require(_0xd0e5('0x2'));var express=require(_0xd0e5('0x3'));var router=express[_0xd0e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd0e5('0x5'));var interaction=require(_0xd0e5('0x6'));var config=require(_0xd0e5('0x7'));var controller=require(_0xd0e5('0x8'));router[_0xd0e5('0x9')]('/',controller[_0xd0e5('0xa')]);module[_0xd0e5('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 1b62225..9d8a403 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 _0xaa89=['sequelize','exports','STRING','version'];(function(_0x1aae33,_0x110a80){var _0x2e91e9=function(_0x218767){while(--_0x218767){_0x1aae33['push'](_0x1aae33['shift']());}};_0x2e91e9(++_0x110a80);}(_0xaa89,0x178));var _0x9aa8=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0xaa89[_0x168127];return _0x4c99ad;};'use strict';var Sequelize=require(_0x9aa8('0x0'));module[_0x9aa8('0x1')]={'version':{'type':Sequelize[_0x9aa8('0x2')],'unique':_0x9aa8('0x3')}}; \ No newline at end of file +var _0x63c8=['STRING','version','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63c8,0x9e));var _0x863c=function(_0x1b4a6f,_0x3b02d5){_0x1b4a6f=_0x1b4a6f-0x0;var _0x4e5d1a=_0x63c8[_0x1b4a6f];return _0x4e5d1a;};'use strict';var Sequelize=require(_0x863c('0x0'));module['exports']={'version':{'type':Sequelize[_0x863c('0x1')],'unique':_0x863c('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1c711b6..a107cd2 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 _0xc3c7=['options','includeAll','include','rows','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','Migration','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xc3c7,0x159));var _0x7c3c=function(_0x441d3a,_0x49bed8){_0x441d3a=_0x441d3a-0x0;var _0x32a7c3=_0xc3c7[_0x441d3a];return _0x32a7c3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c3c('0x0'));var jsonpatch=require(_0x7c3c('0x1'));var rp=require(_0x7c3c('0x2'));var moment=require(_0x7c3c('0x3'));var BPromise=require(_0x7c3c('0x4'));var Mustache=require(_0x7c3c('0x5'));var util=require(_0x7c3c('0x6'));var path=require(_0x7c3c('0x7'));var sox=require(_0x7c3c('0x8'));var csv=require(_0x7c3c('0x9'));var ejs=require(_0x7c3c('0xa'));var fs=require('fs');var fs_extra=require(_0x7c3c('0xb'));var _=require(_0x7c3c('0xc'));var squel=require('squel');var crypto=require(_0x7c3c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c3c('0xe'));var toCsv=require(_0x7c3c('0x9'));var querystring=require(_0x7c3c('0xf'));var Papa=require(_0x7c3c('0x10'));var Redis=require(_0x7c3c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7c3c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7c3c('0x13'));var config=require(_0x7c3c('0x14'));var licenseUtil=require(_0x7c3c('0x15'));var db=require(_0x7c3c('0x16'))['db'];function respondWithStatusCode(_0xa51a72,_0x334934){_0x334934=_0x334934||0xcc;return function(_0x81d4ba){if(_0x81d4ba){return _0xa51a72['sendStatus'](_0x334934);}return _0xa51a72[_0x7c3c('0x17')](_0x334934)['end']();};}function respondWithResult(_0x115ecd,_0x3ba8f5){_0x3ba8f5=_0x3ba8f5||0xc8;return function(_0x1c5740){if(_0x1c5740){return _0x115ecd['status'](_0x3ba8f5)['json'](_0x1c5740);}};}function respondWithFilteredResult(_0x2454bd,_0x43c91e){return function(_0x29df9e){if(_0x29df9e){var _0x2d1231=typeof _0x43c91e['offset']===_0x7c3c('0x18')&&typeof _0x43c91e[_0x7c3c('0x19')]===_0x7c3c('0x18');var _0x3a439b=_0x29df9e[_0x7c3c('0x1a')];var _0x4fce42=_0x2d1231?0x0:_0x43c91e['offset'];var _0x4b9a14=_0x2d1231?_0x29df9e[_0x7c3c('0x1a')]:_0x43c91e[_0x7c3c('0x1b')]+_0x43c91e['limit'];var _0x1006c4;if(_0x4b9a14>=_0x3a439b){_0x4b9a14=_0x3a439b;_0x1006c4=0xc8;}else{_0x1006c4=0xce;}_0x2454bd[_0x7c3c('0x17')](_0x1006c4);return _0x2454bd[_0x7c3c('0x1c')](_0x7c3c('0x1d'),_0x4fce42+'-'+_0x4b9a14+'/'+_0x3a439b)['json'](_0x29df9e);}return null;};}function patchUpdates(_0x576e18){return function(_0x25a057){try{jsonpatch['apply'](_0x25a057,_0x576e18,!![]);}catch(_0x50a282){return BPromise[_0x7c3c('0x1e')](_0x50a282);}return _0x25a057[_0x7c3c('0x1f')]();};}function saveUpdates(_0x5abfe1,_0x3a5235){return function(_0x1815a2){if(_0x1815a2){return _0x1815a2['update'](_0x5abfe1)[_0x7c3c('0x20')](function(_0x567a53){return _0x567a53;});}return null;};}function removeEntity(_0xf8f613,_0x16ef61){return function(_0xded16){if(_0xded16){return _0xded16[_0x7c3c('0x21')]()['then'](function(){_0xf8f613[_0x7c3c('0x17')](0xcc)[_0x7c3c('0x22')]();});}};}function handleEntityNotFound(_0x10dffa,_0x4d56bc){return function(_0x3e3566){if(!_0x3e3566){_0x10dffa[_0x7c3c('0x23')](0x194);}return _0x3e3566;};}function handleError(_0x16d926,_0xba7b68){_0xba7b68=_0xba7b68||0x1f4;return function(_0x477207){logger[_0x7c3c('0x24')](_0x477207[_0x7c3c('0x25')]);if(_0x477207['name']){delete _0x477207[_0x7c3c('0x26')];}_0x16d926[_0x7c3c('0x17')](_0xba7b68)[_0x7c3c('0x27')](_0x477207);};}exports[_0x7c3c('0x28')]=function(_0x26f258,_0x538533){var _0x98106b={},_0x3341ab={},_0x5bb148={'count':0x0,'rows':[]};var _0x211de6=_[_0x7c3c('0x29')](db[_0x7c3c('0x2a')]['rawAttributes'],function(_0x5ce728){return{'name':_0x5ce728[_0x7c3c('0x2b')],'type':_0x5ce728['type'][_0x7c3c('0x2c')]};});_0x3341ab[_0x7c3c('0x2d')]=_[_0x7c3c('0x29')](_0x211de6,_0x7c3c('0x26'));_0x3341ab[_0x7c3c('0x2e')]=_[_0x7c3c('0x2f')](_0x26f258[_0x7c3c('0x2e')]);_0x3341ab[_0x7c3c('0x30')]=_['intersection'](_0x3341ab[_0x7c3c('0x2d')],_0x3341ab[_0x7c3c('0x2e')]);_0x98106b[_0x7c3c('0x31')]=_[_0x7c3c('0x32')](_0x3341ab['model'],qs[_0x7c3c('0x33')](_0x26f258['query'][_0x7c3c('0x33')]));_0x98106b['attributes']=_0x98106b[_0x7c3c('0x31')][_0x7c3c('0x34')]?_0x98106b[_0x7c3c('0x31')]:_0x3341ab[_0x7c3c('0x2d')];if(!_0x26f258[_0x7c3c('0x2e')][_0x7c3c('0x35')](_0x7c3c('0x36'))){_0x98106b[_0x7c3c('0x19')]=qs['limit'](_0x26f258[_0x7c3c('0x2e')][_0x7c3c('0x19')]);_0x98106b[_0x7c3c('0x1b')]=qs[_0x7c3c('0x1b')](_0x26f258[_0x7c3c('0x2e')][_0x7c3c('0x1b')]);}_0x98106b[_0x7c3c('0x37')]=qs[_0x7c3c('0x38')](_0x26f258['query'][_0x7c3c('0x38')]);_0x98106b[_0x7c3c('0x39')]=qs[_0x7c3c('0x30')](_[_0x7c3c('0x3a')](_0x26f258[_0x7c3c('0x2e')],_0x3341ab[_0x7c3c('0x30')]),_0x211de6);if(_0x26f258['query']['filter']){_0x98106b[_0x7c3c('0x39')]=_[_0x7c3c('0x3b')](_0x98106b['where'],{'$or':_[_0x7c3c('0x29')](_0x211de6,function(_0x23464f){if(_0x23464f[_0x7c3c('0x3c')]!==_0x7c3c('0x3d')){var _0x159479={};_0x159479[_0x23464f['name']]={'$like':'%'+_0x26f258[_0x7c3c('0x2e')][_0x7c3c('0x3e')]+'%'};return _0x159479;}})});}_0x98106b=_[_0x7c3c('0x3b')]({},_0x98106b,_0x26f258[_0x7c3c('0x3f')]);var _0x3f0ba9={'where':_0x98106b[_0x7c3c('0x39')]};return db[_0x7c3c('0x2a')][_0x7c3c('0x1a')](_0x3f0ba9)[_0x7c3c('0x20')](function(_0x356034){_0x5bb148[_0x7c3c('0x1a')]=_0x356034;if(_0x26f258['query'][_0x7c3c('0x40')]){_0x98106b[_0x7c3c('0x41')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x98106b);})[_0x7c3c('0x20')](function(_0x3ea35d){_0x5bb148[_0x7c3c('0x42')]=_0x3ea35d;return _0x5bb148;})[_0x7c3c('0x20')](respondWithFilteredResult(_0x538533,_0x98106b))[_0x7c3c('0x43')](handleError(_0x538533,null));}; \ No newline at end of file +var _0xa786=['rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Migration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa786,0xea));var _0x6a78=function(_0x7bf493,_0xf26698){_0x7bf493=_0x7bf493-0x0;var _0xf1210a=_0xa786[_0x7bf493];return _0xf1210a;};'use strict';var emlformat=require(_0x6a78('0x0'));var rimraf=require(_0x6a78('0x1'));var zipdir=require(_0x6a78('0x2'));var jsonpatch=require(_0x6a78('0x3'));var rp=require(_0x6a78('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a78('0x5'));var util=require('util');var path=require(_0x6a78('0x6'));var sox=require(_0x6a78('0x7'));var csv=require('to-csv');var ejs=require(_0x6a78('0x8'));var fs=require('fs');var fs_extra=require(_0x6a78('0x9'));var _=require(_0x6a78('0xa'));var squel=require(_0x6a78('0xb'));var crypto=require('crypto');var jsforce=require(_0x6a78('0xc'));var deskjs=require(_0x6a78('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6a78('0xe'));var Papa=require(_0x6a78('0xf'));var Redis=require(_0x6a78('0x10'));var authService=require(_0x6a78('0x11'));var qs=require(_0x6a78('0x12'));var as=require(_0x6a78('0x13'));var hardwareService=require(_0x6a78('0x14'));var logger=require(_0x6a78('0x15'))(_0x6a78('0x16'));var utils=require(_0x6a78('0x17'));var config=require(_0x6a78('0x18'));var licenseUtil=require(_0x6a78('0x19'));var db=require(_0x6a78('0x1a'))['db'];function respondWithStatusCode(_0x49a0d0,_0x4238c1){_0x4238c1=_0x4238c1||0xcc;return function(_0x4e0bb6){if(_0x4e0bb6){return _0x49a0d0[_0x6a78('0x1b')](_0x4238c1);}return _0x49a0d0[_0x6a78('0x1c')](_0x4238c1)[_0x6a78('0x1d')]();};}function respondWithResult(_0xc84c35,_0x2c8829){_0x2c8829=_0x2c8829||0xc8;return function(_0x2e9e38){if(_0x2e9e38){return _0xc84c35[_0x6a78('0x1c')](_0x2c8829)[_0x6a78('0x1e')](_0x2e9e38);}};}function respondWithFilteredResult(_0x289269,_0x9750cd){return function(_0x11d22f){if(_0x11d22f){var _0x1120a9=typeof _0x9750cd[_0x6a78('0x1f')]===_0x6a78('0x20')&&typeof _0x9750cd[_0x6a78('0x21')]==='undefined';var _0x4132bf=_0x11d22f[_0x6a78('0x22')];var _0x3287ad=_0x1120a9?0x0:_0x9750cd[_0x6a78('0x1f')];var _0xaae867=_0x1120a9?_0x11d22f[_0x6a78('0x22')]:_0x9750cd[_0x6a78('0x1f')]+_0x9750cd['limit'];var _0x46223e;if(_0xaae867>=_0x4132bf){_0xaae867=_0x4132bf;_0x46223e=0xc8;}else{_0x46223e=0xce;}_0x289269['status'](_0x46223e);return _0x289269[_0x6a78('0x23')](_0x6a78('0x24'),_0x3287ad+'-'+_0xaae867+'/'+_0x4132bf)[_0x6a78('0x1e')](_0x11d22f);}return null;};}function patchUpdates(_0x27d9db){return function(_0x45af8f){try{jsonpatch[_0x6a78('0x25')](_0x45af8f,_0x27d9db,!![]);}catch(_0x60c350){return BPromise[_0x6a78('0x26')](_0x60c350);}return _0x45af8f[_0x6a78('0x27')]();};}function saveUpdates(_0x5a5ead,_0x50cf7c){return function(_0x356601){if(_0x356601){return _0x356601[_0x6a78('0x28')](_0x5a5ead)['then'](function(_0x3700df){return _0x3700df;});}return null;};}function removeEntity(_0x527b64,_0x5ae5ed){return function(_0x33fe92){if(_0x33fe92){return _0x33fe92[_0x6a78('0x29')]()[_0x6a78('0x2a')](function(){_0x527b64[_0x6a78('0x1c')](0xcc)[_0x6a78('0x1d')]();});}};}function handleEntityNotFound(_0x55c3ce,_0x304c80){return function(_0x4e2dde){if(!_0x4e2dde){_0x55c3ce[_0x6a78('0x1b')](0x194);}return _0x4e2dde;};}function handleError(_0x54f9d4,_0x15b20a){_0x15b20a=_0x15b20a||0x1f4;return function(_0x57b5af){logger[_0x6a78('0x2b')](_0x57b5af[_0x6a78('0x2c')]);if(_0x57b5af[_0x6a78('0x2d')]){delete _0x57b5af[_0x6a78('0x2d')];}_0x54f9d4[_0x6a78('0x1c')](_0x15b20a)[_0x6a78('0x2e')](_0x57b5af);};}exports[_0x6a78('0x2f')]=function(_0x55d85b,_0x4c3528){var _0x382893={},_0x182ad1={},_0x1436ae={'count':0x0,'rows':[]};var _0x5084fd=_[_0x6a78('0x30')](db[_0x6a78('0x31')][_0x6a78('0x32')],function(_0x34f1a0){return{'name':_0x34f1a0[_0x6a78('0x33')],'type':_0x34f1a0[_0x6a78('0x34')]['key']};});_0x182ad1[_0x6a78('0x35')]=_[_0x6a78('0x30')](_0x5084fd,_0x6a78('0x2d'));_0x182ad1[_0x6a78('0x36')]=_['keys'](_0x55d85b['query']);_0x182ad1[_0x6a78('0x37')]=_['intersection'](_0x182ad1[_0x6a78('0x35')],_0x182ad1[_0x6a78('0x36')]);_0x382893[_0x6a78('0x38')]=_[_0x6a78('0x39')](_0x182ad1['model'],qs[_0x6a78('0x3a')](_0x55d85b['query'][_0x6a78('0x3a')]));_0x382893[_0x6a78('0x38')]=_0x382893[_0x6a78('0x38')][_0x6a78('0x3b')]?_0x382893['attributes']:_0x182ad1[_0x6a78('0x35')];if(!_0x55d85b[_0x6a78('0x36')][_0x6a78('0x3c')](_0x6a78('0x3d'))){_0x382893[_0x6a78('0x21')]=qs[_0x6a78('0x21')](_0x55d85b['query'][_0x6a78('0x21')]);_0x382893[_0x6a78('0x1f')]=qs['offset'](_0x55d85b[_0x6a78('0x36')][_0x6a78('0x1f')]);}_0x382893['order']=qs[_0x6a78('0x3e')](_0x55d85b[_0x6a78('0x36')][_0x6a78('0x3e')]);_0x382893['where']=qs[_0x6a78('0x37')](_[_0x6a78('0x3f')](_0x55d85b['query'],_0x182ad1[_0x6a78('0x37')]),_0x5084fd);if(_0x55d85b['query'][_0x6a78('0x40')]){_0x382893[_0x6a78('0x41')]=_[_0x6a78('0x42')](_0x382893[_0x6a78('0x41')],{'$or':_[_0x6a78('0x30')](_0x5084fd,function(_0x904908){if(_0x904908[_0x6a78('0x34')]!=='VIRTUAL'){var _0x4def90={};_0x4def90[_0x904908[_0x6a78('0x2d')]]={'$like':'%'+_0x55d85b['query']['filter']+'%'};return _0x4def90;}})});}_0x382893=_[_0x6a78('0x42')]({},_0x382893,_0x55d85b[_0x6a78('0x43')]);var _0x54523f={'where':_0x382893[_0x6a78('0x41')]};return db[_0x6a78('0x31')][_0x6a78('0x22')](_0x54523f)[_0x6a78('0x2a')](function(_0x162fb2){_0x1436ae[_0x6a78('0x22')]=_0x162fb2;if(_0x55d85b['query'][_0x6a78('0x44')]){_0x382893[_0x6a78('0x45')]=[{'all':!![]}];}return db[_0x6a78('0x31')][_0x6a78('0x46')](_0x382893);})[_0x6a78('0x2a')](function(_0x3612e){_0x1436ae['rows']=_0x3612e;return _0x1436ae;})[_0x6a78('0x2a')](respondWithFilteredResult(_0x4c3528,_0x382893))['catch'](handleError(_0x4c3528,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 4501f7d..3c10c79 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 _0xc729=['../../config/logger','request-promise','path','../../config/environment','exports','define','migrations','util'];(function(_0x5a8c8a,_0x1d9810){var _0x5c4493=function(_0x15c688){while(--_0x15c688){_0x5a8c8a['push'](_0x5a8c8a['shift']());}};_0x5c4493(++_0x1d9810);}(_0xc729,0x1bf));var _0x9c72=function(_0x11a4d4,_0x4ac6c8){_0x11a4d4=_0x11a4d4-0x0;var _0x55c2f9=_0xc729[_0x11a4d4];return _0x55c2f9;};'use strict';var _=require('lodash');var util=require(_0x9c72('0x0'));var logger=require(_0x9c72('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c72('0x2'));var fs=require('fs');var path=require(_0x9c72('0x3'));var rimraf=require('rimraf');var config=require(_0x9c72('0x4'));var attributes=require('./migration.attributes');module[_0x9c72('0x5')]=function(_0x5ae7a3,_0xe487f){return _0x5ae7a3[_0x9c72('0x6')]('Migration',attributes,{'tableName':_0x9c72('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f5d=['moment','bluebird','request-promise','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util'];(function(_0x5c965a,_0x42cc16){var _0x3b6bd9=function(_0x3ba393){while(--_0x3ba393){_0x5c965a['push'](_0x5c965a['shift']());}};_0x3b6bd9(++_0x42cc16);}(_0x8f5d,0x1e2));var _0xd8f5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f5d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd8f5('0x0'));var util=require(_0xd8f5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd8f5('0x2'));var BPromise=require(_0xd8f5('0x3'));var rp=require(_0xd8f5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8f5('0x5'));var attributes=require(_0xd8f5('0x6'));module[_0xd8f5('0x7')]=function(_0x423705,_0x1e24f4){return _0x423705[_0xd8f5('0x8')](_0xd8f5('0x9'),attributes,{'tableName':_0xd8f5('0xa'),'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 3db60b5..2787a20 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 _0x19c3=['message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0x19c3,0xf9));var _0x319c=function(_0x1b8ffb,_0x88a3ca){_0x1b8ffb=_0x1b8ffb-0x0;var _0xb1280e=_0x19c3[_0x1b8ffb];return _0xb1280e;};'use strict';var _=require(_0x319c('0x0'));var util=require('util');var moment=require(_0x319c('0x1'));var BPromise=require(_0x319c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x319c('0x3'));var db=require(_0x319c('0x4'))['db'];var utils=require(_0x319c('0x5'));var logger=require(_0x319c('0x6'))(_0x319c('0x7'));var config=require(_0x319c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x319c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e38c4,_0x2df1a9,_0x9a5cf8){return new BPromise(function(_0x306a4b,_0x3662ed){return client['request'](_0x2e38c4,_0x9a5cf8)[_0x319c('0xa')](function(_0x1b7ffd){logger[_0x319c('0xb')](_0x319c('0xc'),_0x2df1a9,_0x319c('0xd'));logger[_0x319c('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x2df1a9,_0x319c('0xd'),JSON['stringify'](_0x1b7ffd));if(_0x1b7ffd[_0x319c('0xf')]){if(_0x1b7ffd[_0x319c('0xf')][_0x319c('0x10')]===0x1f4){logger[_0x319c('0xf')](_0x319c('0xc'),_0x2df1a9,_0x1b7ffd[_0x319c('0xf')][_0x319c('0x11')]);return _0x3662ed(_0x1b7ffd['error']['message']);}logger[_0x319c('0xf')](_0x319c('0xc'),_0x2df1a9,_0x1b7ffd['error'][_0x319c('0x11')]);return _0x306a4b(_0x1b7ffd[_0x319c('0xf')][_0x319c('0x11')]);}else{logger[_0x319c('0xb')](_0x319c('0xc'),_0x2df1a9,_0x319c('0xd'));_0x306a4b(_0x1b7ffd[_0x319c('0x12')]['message']);}})['catch'](function(_0x9415a5){logger[_0x319c('0xf')]('Migration,\x20%s,\x20%s',_0x2df1a9,_0x9415a5);_0x3662ed(_0x9415a5);});});} \ No newline at end of file +var _0x3276=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','stringify','error','code','Migration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x3276,0xc7));var _0x6327=function(_0x369dcb,_0x3cfbd6){_0x369dcb=_0x369dcb-0x0;var _0x3b586d=_0x3276[_0x369dcb];return _0x3b586d;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6327('0x1'));var rs=require(_0x6327('0x2'));var fs=require('fs');var Redis=require(_0x6327('0x3'));var db=require(_0x6327('0x4'))['db'];var utils=require(_0x6327('0x5'));var logger=require(_0x6327('0x6'))(_0x6327('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6327('0x8')][_0x6327('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e6278,_0x498821,_0x29ba24){return new BPromise(function(_0x3e9616,_0x36eef9){return client[_0x6327('0xa')](_0x1e6278,_0x29ba24)['then'](function(_0x1314d0){logger[_0x6327('0xb')]('Migration,\x20%s,\x20%s',_0x498821,_0x6327('0xc'));logger[_0x6327('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x498821,_0x6327('0xc'),JSON[_0x6327('0xe')](_0x1314d0));if(_0x1314d0[_0x6327('0xf')]){if(_0x1314d0['error'][_0x6327('0x10')]===0x1f4){logger[_0x6327('0xf')](_0x6327('0x11'),_0x498821,_0x1314d0[_0x6327('0xf')][_0x6327('0x12')]);return _0x36eef9(_0x1314d0[_0x6327('0xf')][_0x6327('0x12')]);}logger[_0x6327('0xf')](_0x6327('0x11'),_0x498821,_0x1314d0[_0x6327('0xf')]['message']);return _0x3e9616(_0x1314d0[_0x6327('0xf')]['message']);}else{logger[_0x6327('0xb')](_0x6327('0x11'),_0x498821,_0x6327('0xc'));_0x3e9616(_0x1314d0['result'][_0x6327('0x12')]);}})[_0x6327('0x13')](function(_0xdbd021){logger[_0x6327('0xf')](_0x6327('0x11'),_0x498821,_0xdbd021);_0x36eef9(_0xdbd021);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3b065bb..cb51079 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 _0xcb22=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','post','put','update','delete','exports'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0xcb22,0xc8));var _0x2cb2=function(_0x24fdc7,_0x13b25d){_0x24fdc7=_0x24fdc7-0x0;var _0x321a1f=_0xcb22[_0x24fdc7];return _0x321a1f;};'use strict';var multer=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var path=require(_0x2cb2('0x2'));var timeout=require(_0x2cb2('0x3'));var express=require(_0x2cb2('0x4'));var router=express[_0x2cb2('0x5')]();var fs_extra=require(_0x2cb2('0x6'));var auth=require(_0x2cb2('0x7'));var interaction=require(_0x2cb2('0x8'));var config=require(_0x2cb2('0x9'));var controller=require(_0x2cb2('0xa'));router['get']('/',auth[_0x2cb2('0xb')](),controller[_0x2cb2('0xc')]);router[_0x2cb2('0xd')](_0x2cb2('0xe'),auth[_0x2cb2('0xb')](),controller['show']);router[_0x2cb2('0xf')]('/',auth[_0x2cb2('0xb')](),controller['create']);router[_0x2cb2('0x10')](_0x2cb2('0xe'),auth[_0x2cb2('0xb')](),controller[_0x2cb2('0x11')]);router[_0x2cb2('0x12')](_0x2cb2('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x2cb2('0x13')]=router; \ No newline at end of file +var _0x8d0a=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x244f7b,_0x2e41ab){var _0x214414=function(_0x35398f){while(--_0x35398f){_0x244f7b['push'](_0x244f7b['shift']());}};_0x214414(++_0x2e41ab);}(_0x8d0a,0x172));var _0xa8d0=function(_0x562f71,_0x41169b){_0x562f71=_0x562f71-0x0;var _0x1d24a9=_0x8d0a[_0x562f71];return _0x1d24a9;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require(_0xa8d0('0x1'));var path=require(_0xa8d0('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa8d0('0x5'));var interaction=require(_0xa8d0('0x6'));var config=require(_0xa8d0('0x7'));var controller=require('./network.controller');router[_0xa8d0('0x8')]('/',auth[_0xa8d0('0x9')](),controller[_0xa8d0('0xa')]);router[_0xa8d0('0x8')](_0xa8d0('0xb'),auth[_0xa8d0('0x9')](),controller[_0xa8d0('0xc')]);router[_0xa8d0('0xd')]('/',auth[_0xa8d0('0x9')](),controller[_0xa8d0('0xe')]);router[_0xa8d0('0xf')](_0xa8d0('0xb'),auth[_0xa8d0('0x9')](),controller[_0xa8d0('0x10')]);router[_0xa8d0('0x11')](_0xa8d0('0xb'),auth[_0xa8d0('0x9')](),controller[_0xa8d0('0x12')]);module[_0xa8d0('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 413ec52..ef266e6 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 _0x15fe=['sequelize','exports','ENUM','localnet','stun','turn','STRING'];(function(_0x2fab5d,_0x531fbf){var _0x5e20c6=function(_0x3de054){while(--_0x3de054){_0x2fab5d['push'](_0x2fab5d['shift']());}};_0x5e20c6(++_0x531fbf);}(_0x15fe,0x150));var _0xe15f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x15fe[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xe15f('0x0'));module[_0xe15f('0x1')]={'type':{'type':Sequelize[_0xe15f('0x2')](_0xe15f('0x3'),'externip',_0xe15f('0x4'),_0xe15f('0x5'))},'value':{'type':Sequelize[_0xe15f('0x6')]},'username':{'type':Sequelize[_0xe15f('0x6')]},'password':{'type':Sequelize[_0xe15f('0x6')]}}; \ No newline at end of file +var _0xd597=['ENUM','localnet','externip','turn','STRING','sequelize','exports'];(function(_0x27f069,_0x2e4f53){var _0x15d360=function(_0x52715a){while(--_0x52715a){_0x27f069['push'](_0x27f069['shift']());}};_0x15d360(++_0x2e4f53);}(_0xd597,0x1e8));var _0x7d59=function(_0x5b9798,_0x5e7603){_0x5b9798=_0x5b9798-0x0;var _0x59e236=_0xd597[_0x5b9798];return _0x59e236;};'use strict';var Sequelize=require(_0x7d59('0x0'));module[_0x7d59('0x1')]={'type':{'type':Sequelize[_0x7d59('0x2')](_0x7d59('0x3'),_0x7d59('0x4'),'stun',_0x7d59('0x5'))},'value':{'type':Sequelize[_0x7d59('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7d59('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 15c3ece..af55747 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 _0xf50a=['readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','sequelize','transaction','/etc/asterisk/turn_xcally.conf','toLowerCase','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','Network','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','show','params','rawAttributes','includeAll','find','create','body','findAll','toUpperCase','STUN'];(function(_0x208aee,_0x17ac5b){var _0x4a5846=function(_0x18d385){while(--_0x18d385){_0x208aee['push'](_0x208aee['shift']());}};_0x4a5846(++_0x17ac5b);}(_0xf50a,0x1b8));var _0xaf50=function(_0x1ebe53,_0x35cc29){_0x1ebe53=_0x1ebe53-0x0;var _0x56cb47=_0xf50a[_0x1ebe53];return _0x56cb47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf50('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf50('0x1'));var rp=require('request-promise');var moment=require(_0xaf50('0x2'));var BPromise=require(_0xaf50('0x3'));var Mustache=require(_0xaf50('0x4'));var util=require('util');var path=require(_0xaf50('0x5'));var sox=require(_0xaf50('0x6'));var csv=require('to-csv');var ejs=require(_0xaf50('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf50('0x8'));var squel=require(_0xaf50('0x9'));var crypto=require(_0xaf50('0xa'));var jsforce=require(_0xaf50('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaf50('0xc'));var querystring=require(_0xaf50('0xd'));var Papa=require(_0xaf50('0xe'));var Redis=require(_0xaf50('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf50('0x10'));var logger=require(_0xaf50('0x11'))('api');var utils=require(_0xaf50('0x12'));var config=require(_0xaf50('0x13'));var licenseUtil=require(_0xaf50('0x14'));var db=require(_0xaf50('0x15'))['db'];var jayson=require(_0xaf50('0x16'));var client=jayson[_0xaf50('0x17')][_0xaf50('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x50a26c,_0x20e0a7,_0x34e30b,_0x3b4a85){return new BPromise(function(_0x23c74c,_0x3bbf3b){var _0x5b5dea=_0x3b4a85||client;return _0x5b5dea[_0xaf50('0x19')](_0x50a26c,_0x34e30b)['then'](function(_0x16355d){logger[_0xaf50('0x1a')](_0xaf50('0x1b'),_0x20e0a7,'request\x20sent');logger['debug'](_0xaf50('0x1c'),_0x20e0a7,_0xaf50('0x1d'),JSON['stringify'](_0x16355d));if(_0x16355d['error']){if(_0x16355d[_0xaf50('0x1e')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x20e0a7,_0x16355d[_0xaf50('0x1e')][_0xaf50('0x1f')]);return _0x3bbf3b(_0x16355d[_0xaf50('0x1e')]['message']);}logger['error'](_0xaf50('0x1b'),_0x20e0a7,_0x16355d[_0xaf50('0x1e')][_0xaf50('0x1f')]);return _0x23c74c(_0x16355d[_0xaf50('0x1e')][_0xaf50('0x1f')]);}else{logger['info'](_0xaf50('0x1b'),_0x20e0a7,'request\x20sent');_0x23c74c(_0x16355d[_0xaf50('0x20')]['message']);}})[_0xaf50('0x21')](function(_0x15f717){logger[_0xaf50('0x1e')](_0xaf50('0x1b'),_0x20e0a7,_0x15f717);_0x3bbf3b(_0x15f717);});});}function respondWithStatusCode(_0x13b337,_0x2480d1){_0x2480d1=_0x2480d1||0xcc;return function(_0x4acb49){if(_0x4acb49){return _0x13b337[_0xaf50('0x22')](_0x2480d1);}return _0x13b337['status'](_0x2480d1)[_0xaf50('0x23')]();};}function respondWithResult(_0x2fd1c9,_0x26f919){_0x26f919=_0x26f919||0xc8;return function(_0x3faaf6){if(_0x3faaf6){return _0x2fd1c9['status'](_0x26f919)['json'](_0x3faaf6);}};}function respondWithFilteredResult(_0x294c7f,_0x2a8c2b){return function(_0x58169f){if(_0x58169f){var _0x39fa7d=typeof _0x2a8c2b[_0xaf50('0x24')]===_0xaf50('0x25')&&typeof _0x2a8c2b[_0xaf50('0x26')]===_0xaf50('0x25');var _0x235a01=_0x58169f[_0xaf50('0x27')];var _0x3cbdc4=_0x39fa7d?0x0:_0x2a8c2b[_0xaf50('0x24')];var _0x586a19=_0x39fa7d?_0x58169f[_0xaf50('0x27')]:_0x2a8c2b['offset']+_0x2a8c2b[_0xaf50('0x26')];var _0x53a071;if(_0x586a19>=_0x235a01){_0x586a19=_0x235a01;_0x53a071=0xc8;}else{_0x53a071=0xce;}_0x294c7f[_0xaf50('0x28')](_0x53a071);return _0x294c7f['set'](_0xaf50('0x29'),_0x3cbdc4+'-'+_0x586a19+'/'+_0x235a01)[_0xaf50('0x2a')](_0x58169f);}return null;};}function patchUpdates(_0xbe8d68){return function(_0x3dfbb0){try{jsonpatch[_0xaf50('0x2b')](_0x3dfbb0,_0xbe8d68,!![]);}catch(_0x263d4d){return BPromise[_0xaf50('0x2c')](_0x263d4d);}return _0x3dfbb0[_0xaf50('0x2d')]();};}function saveUpdates(_0x41ba01,_0x1eff85){return function(_0x3f93db){if(_0x3f93db){return _0x3f93db[_0xaf50('0x2e')](_0x41ba01)[_0xaf50('0x2f')](function(_0x139552){return _0x139552;});}return null;};}function removeEntity(_0x33d830,_0x4c0b1d){return function(_0x1a80cf){if(_0x1a80cf){return _0x1a80cf[_0xaf50('0x30')]()[_0xaf50('0x2f')](function(){_0x33d830[_0xaf50('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5494f3,_0x1af5c2){return function(_0x409dc7){if(!_0x409dc7){_0x5494f3[_0xaf50('0x22')](0x194);}return _0x409dc7;};}function handleError(_0x1c08a3,_0x1e63aa){_0x1e63aa=_0x1e63aa||0x1f4;return function(_0xa74de9){logger[_0xaf50('0x1e')](_0xa74de9[_0xaf50('0x31')]);if(_0xa74de9[_0xaf50('0x32')]){delete _0xa74de9['name'];}_0x1c08a3[_0xaf50('0x28')](_0x1e63aa)[_0xaf50('0x33')](_0xa74de9);};}exports['index']=function(_0x56e002,_0x49576a){var _0x158383={},_0xe6e4e3={},_0x2b2fe2={'count':0x0,'rows':[]};var _0x134b3f=_[_0xaf50('0x34')](db[_0xaf50('0x35')]['rawAttributes'],function(_0x13563d){return{'name':_0x13563d[_0xaf50('0x36')],'type':_0x13563d[_0xaf50('0x37')][_0xaf50('0x38')]};});_0xe6e4e3[_0xaf50('0x39')]=_[_0xaf50('0x34')](_0x134b3f,_0xaf50('0x32'));_0xe6e4e3[_0xaf50('0x3a')]=_[_0xaf50('0x3b')](_0x56e002[_0xaf50('0x3a')]);_0xe6e4e3[_0xaf50('0x3c')]=_[_0xaf50('0x3d')](_0xe6e4e3[_0xaf50('0x39')],_0xe6e4e3[_0xaf50('0x3a')]);_0x158383['attributes']=_[_0xaf50('0x3d')](_0xe6e4e3[_0xaf50('0x39')],qs['fields'](_0x56e002[_0xaf50('0x3a')][_0xaf50('0x3e')]));_0x158383[_0xaf50('0x3f')]=_0x158383[_0xaf50('0x3f')][_0xaf50('0x40')]?_0x158383[_0xaf50('0x3f')]:_0xe6e4e3[_0xaf50('0x39')];if(!_0x56e002[_0xaf50('0x3a')][_0xaf50('0x41')](_0xaf50('0x42'))){_0x158383[_0xaf50('0x26')]=qs['limit'](_0x56e002[_0xaf50('0x3a')][_0xaf50('0x26')]);_0x158383[_0xaf50('0x24')]=qs['offset'](_0x56e002[_0xaf50('0x3a')]['offset']);}_0x158383[_0xaf50('0x43')]=qs[_0xaf50('0x44')](_0x56e002[_0xaf50('0x3a')][_0xaf50('0x44')]);_0x158383['where']=qs['filters'](_['pick'](_0x56e002[_0xaf50('0x3a')],_0xe6e4e3[_0xaf50('0x3c')]),_0x134b3f);if(_0x56e002[_0xaf50('0x3a')][_0xaf50('0x45')]){_0x158383[_0xaf50('0x46')]=_[_0xaf50('0x47')](_0x158383[_0xaf50('0x46')],{'$or':_[_0xaf50('0x34')](_0x134b3f,function(_0x206590){if(_0x206590[_0xaf50('0x37')]!=='VIRTUAL'){var _0x5e39d7={};_0x5e39d7[_0x206590[_0xaf50('0x32')]]={'$like':'%'+_0x56e002[_0xaf50('0x3a')][_0xaf50('0x45')]+'%'};return _0x5e39d7;}})});}_0x158383=_[_0xaf50('0x47')]({},_0x158383,_0x56e002[_0xaf50('0x48')]);var _0x5c462b={'where':_0x158383['where']};return db['Network'][_0xaf50('0x27')](_0x5c462b)['then'](function(_0x470063){_0x2b2fe2['count']=_0x470063;if(_0x56e002[_0xaf50('0x3a')]['includeAll']){_0x158383[_0xaf50('0x49')]=[{'all':!![]}];}return db[_0xaf50('0x35')]['findAll'](_0x158383);})[_0xaf50('0x2f')](function(_0x161646){_0x2b2fe2[_0xaf50('0x4a')]=_0x161646;return _0x2b2fe2;})[_0xaf50('0x2f')](respondWithFilteredResult(_0x49576a,_0x158383))['catch'](handleError(_0x49576a,null));};exports[_0xaf50('0x4b')]=function(_0x578286,_0x98688f){var _0x500975={'raw':!![],'where':{'id':_0x578286[_0xaf50('0x4c')]['id']}},_0x1e0ec0={};_0x1e0ec0[_0xaf50('0x39')]=_[_0xaf50('0x3b')](db[_0xaf50('0x35')][_0xaf50('0x4d')]);_0x1e0ec0['query']=_[_0xaf50('0x3b')](_0x578286[_0xaf50('0x3a')]);_0x1e0ec0[_0xaf50('0x3c')]=_[_0xaf50('0x3d')](_0x1e0ec0['model'],_0x1e0ec0[_0xaf50('0x3a')]);_0x500975[_0xaf50('0x3f')]=_[_0xaf50('0x3d')](_0x1e0ec0[_0xaf50('0x39')],qs['fields'](_0x578286[_0xaf50('0x3a')][_0xaf50('0x3e')]));_0x500975['attributes']=_0x500975['attributes'][_0xaf50('0x40')]?_0x500975[_0xaf50('0x3f')]:_0x1e0ec0['model'];if(_0x578286[_0xaf50('0x3a')][_0xaf50('0x4e')]){_0x500975['include']=[{'all':!![]}];}_0x500975=_[_0xaf50('0x47')]({},_0x500975,_0x578286[_0xaf50('0x48')]);return db[_0xaf50('0x35')][_0xaf50('0x4f')](_0x500975)[_0xaf50('0x2f')](handleEntityNotFound(_0x98688f,null))[_0xaf50('0x2f')](respondWithResult(_0x98688f,null))[_0xaf50('0x21')](handleError(_0x98688f,null));};exports[_0xaf50('0x50')]=function(_0xd2d966,_0x5e33e4,_0x442633){var _0x2531fe;return db['sequelize']['transaction'](function(_0x392e6d){return db[_0xaf50('0x35')][_0xaf50('0x50')](_0xd2d966[_0xaf50('0x51')],{'raw':!![]})[_0xaf50('0x2f')](function(_0x171e79){_0x2531fe=_0x171e79;return db['Network'][_0xaf50('0x52')]({'where':{'type':_0xd2d966[_0xaf50('0x51')][_0xaf50('0x37')]},'raw':!![]});})[_0xaf50('0x2f')](function(_0x4dac62){if(_0x2531fe[_0xaf50('0x37')][_0xaf50('0x53')]()==_0xaf50('0x54')){var _0x35efb7=fs[_0xaf50('0x55')](path['join'](config[_0xaf50('0x56')],_0xaf50('0x57')),_0xaf50('0x58'));var _0x13908a=ejs[_0xaf50('0x59')](_0x35efb7,{'networks':_0x4dac62||[]});fs[_0xaf50('0x5a')](_0xaf50('0x5b'),_0x13908a);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x50'),{'module':_0xaf50('0x5d')});}else if(_0x2531fe[_0xaf50('0x37')]['toUpperCase']()==_0xaf50('0x5e')){var _0x157cf4=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],_0xaf50('0x60')),'utf8');var _0x43c5e6=ejs[_0xaf50('0x59')](_0x157cf4,{'networks':_0x4dac62||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x43c5e6);return respondWithRpcPromise('Reload',_0xaf50('0x50'),{'module':_0xaf50('0x5d')});}else{var _0x4b3721=fs[_0xaf50('0x55')](path['join'](config[_0xaf50('0x56')],_0xaf50('0x61')),'utf8');var _0x35f854=ejs[_0xaf50('0x59')](_0x4b3721,{'networks':_0x4dac62||[]});fs[_0xaf50('0x5a')](util[_0xaf50('0x62')](_0xaf50('0x63'),_0xd2d966['body']['type']['toLowerCase']()),_0x35f854);return respondWithRpcPromise('Reload',_0xaf50('0x50'),{'module':_0xaf50('0x64')});}return null;})['then'](function(){return _0x2531fe;});})[_0xaf50('0x2f')](respondWithResult(_0x5e33e4,0xc9))[_0xaf50('0x21')](handleError(_0x5e33e4,null));};exports[_0xaf50('0x2e')]=function(_0xd5514d,_0x272f52,_0x918520){var _0x2091ac;return db[_0xaf50('0x65')][_0xaf50('0x66')](function(_0x214ec5){return db[_0xaf50('0x35')][_0xaf50('0x4f')]({'where':{'id':_0xd5514d['params']['id']}})[_0xaf50('0x2f')](handleEntityNotFound(_0x272f52,null))[_0xaf50('0x2f')](saveUpdates(_0xd5514d[_0xaf50('0x51')],null))['then'](function(_0x445b37){if(_0x445b37){_0x2091ac=_0x445b37;return db[_0xaf50('0x35')][_0xaf50('0x52')]({'where':{'type':_0x2091ac['type']},'raw':!![]});}return null;})[_0xaf50('0x2f')](function(_0x563f90){if(_0x2091ac[_0xaf50('0x37')]['toUpperCase']()==_0xaf50('0x54')){var _0x547a80=fs[_0xaf50('0x55')](path['join'](config[_0xaf50('0x56')],_0xaf50('0x57')),'utf8');var _0x598b4c=ejs[_0xaf50('0x59')](_0x547a80,{'networks':_0x563f90||[]});fs[_0xaf50('0x5a')](_0xaf50('0x5b'),_0x598b4c);return respondWithRpcPromise(_0xaf50('0x5c'),'update',{'module':_0xaf50('0x5d')});}else if(_0x2091ac[_0xaf50('0x37')][_0xaf50('0x53')]()==_0xaf50('0x5e')){var _0x5c6c0f=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],_0xaf50('0x60')),_0xaf50('0x58'));var _0x1acad2=ejs[_0xaf50('0x59')](_0x5c6c0f,{'networks':_0x563f90||[]});fs['writeFileSync'](_0xaf50('0x67'),_0x1acad2);return respondWithRpcPromise('Reload',_0xaf50('0x2e'),{'module':_0xaf50('0x5d')});}else{var _0x2e5a33=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],'server/files/templates/network.ejs'),_0xaf50('0x58'));var _0x214a07=ejs['render'](_0x2e5a33,{'networks':_0x563f90||[]});fs[_0xaf50('0x5a')](util['format'](_0xaf50('0x63'),_0xd5514d[_0xaf50('0x51')][_0xaf50('0x37')][_0xaf50('0x68')]()),_0x214a07);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x2e'),{'module':_0xaf50('0x64')});}return null;})[_0xaf50('0x2f')](function(_0x1aea63){if(_0x1aea63){return _0x2091ac;}return null;});})[_0xaf50('0x2f')](respondWithResult(_0x272f52,null))[_0xaf50('0x21')](handleError(_0x272f52,null));};exports[_0xaf50('0x30')]=function(_0x470843,_0x40ae98,_0x205268){var _0x312fab;return db[_0xaf50('0x35')]['find']({'where':{'id':_0x470843['params']['id']}})[_0xaf50('0x2f')](function(_0x56f6a5){_0x312fab=_0x56f6a5;return _0x56f6a5;})[_0xaf50('0x2f')](handleEntityNotFound(_0x40ae98,null))[_0xaf50('0x2f')](removeEntity(_0x40ae98,null))[_0xaf50('0x2f')](function(){if(_0x312fab){return db[_0xaf50('0x35')][_0xaf50('0x52')]({'where':{'type':_0x312fab[_0xaf50('0x37')]},'raw':!![]});}})[_0xaf50('0x2f')](function(_0x45df4a){if(_0x312fab[_0xaf50('0x37')][_0xaf50('0x53')]()=='STUN'){var _0x89526f=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],_0xaf50('0x57')),_0xaf50('0x58'));var _0x56544c=ejs['render'](_0x89526f,{'networks':_0x45df4a||[]});fs[_0xaf50('0x5a')](_0xaf50('0x5b'),_0x56544c);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x30'),{'module':_0xaf50('0x5d')});}else if(_0x312fab[_0xaf50('0x37')][_0xaf50('0x53')]()==_0xaf50('0x5e')){var _0x4303d8=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config['root'],_0xaf50('0x60')),_0xaf50('0x58'));var _0x32883c=ejs[_0xaf50('0x59')](_0x4303d8,{'networks':_0x45df4a||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x32883c);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x30'),{'module':_0xaf50('0x5d')});}else{var _0x1dcb9b=fs[_0xaf50('0x55')](path[_0xaf50('0x5f')](config[_0xaf50('0x56')],_0xaf50('0x61')),'utf8');var _0x559300=ejs['render'](_0x1dcb9b,{'networks':_0x45df4a||[]});fs[_0xaf50('0x5a')](util[_0xaf50('0x62')](_0xaf50('0x63'),_0x470843[_0xaf50('0x51')][_0xaf50('0x37')][_0xaf50('0x68')]()),_0x559300);return respondWithRpcPromise(_0xaf50('0x5c'),_0xaf50('0x30'),{'module':_0xaf50('0x64')});}return null;})[_0xaf50('0x21')](handleError(_0x40ae98,null));}; \ No newline at end of file +var _0x68ef=['fieldName','key','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','catch','show','params','include','find','create','transaction','findAll','body','toUpperCase','STUN','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','readFileSync','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','TURN','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','Network','rawAttributes'];(function(_0x48dd93,_0x357df0){var _0x2dc695=function(_0x10950f){while(--_0x10950f){_0x48dd93['push'](_0x48dd93['shift']());}};_0x2dc695(++_0x357df0);}(_0x68ef,0x1d7));var _0xf68e=function(_0x407716,_0x5f4fea){_0x407716=_0x407716-0x0;var _0x29b04e=_0x68ef[_0x407716];return _0x29b04e;};'use strict';var emlformat=require(_0xf68e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf68e('0x1'));var moment=require(_0xf68e('0x2'));var BPromise=require(_0xf68e('0x3'));var Mustache=require(_0xf68e('0x4'));var util=require(_0xf68e('0x5'));var path=require(_0xf68e('0x6'));var sox=require(_0xf68e('0x7'));var csv=require(_0xf68e('0x8'));var ejs=require(_0xf68e('0x9'));var fs=require('fs');var fs_extra=require(_0xf68e('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf68e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf68e('0xc'));var toCsv=require(_0xf68e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf68e('0xd'));var qs=require(_0xf68e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf68e('0xf'));var logger=require(_0xf68e('0x10'))(_0xf68e('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf68e('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf68e('0x13'));var client=jayson[_0xf68e('0x14')][_0xf68e('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x44abaf,_0x54ec60,_0x5cca44,_0x1dc06b){return new BPromise(function(_0x53efd9,_0x1011a5){var _0x443f18=_0x1dc06b||client;return _0x443f18['request'](_0x44abaf,_0x5cca44)[_0xf68e('0x16')](function(_0x536516){logger[_0xf68e('0x17')](_0xf68e('0x18'),_0x54ec60,'request\x20sent');logger[_0xf68e('0x19')](_0xf68e('0x1a'),_0x54ec60,'request\x20sent',JSON[_0xf68e('0x1b')](_0x536516));if(_0x536516[_0xf68e('0x1c')]){if(_0x536516[_0xf68e('0x1c')][_0xf68e('0x1d')]===0x1f4){logger['error'](_0xf68e('0x18'),_0x54ec60,_0x536516[_0xf68e('0x1c')]['message']);return _0x1011a5(_0x536516[_0xf68e('0x1c')][_0xf68e('0x1e')]);}logger[_0xf68e('0x1c')]('Network,\x20%s,\x20%s',_0x54ec60,_0x536516[_0xf68e('0x1c')][_0xf68e('0x1e')]);return _0x53efd9(_0x536516['error']['message']);}else{logger[_0xf68e('0x17')](_0xf68e('0x18'),_0x54ec60,'request\x20sent');_0x53efd9(_0x536516[_0xf68e('0x1f')][_0xf68e('0x1e')]);}})['catch'](function(_0x210e73){logger[_0xf68e('0x1c')](_0xf68e('0x18'),_0x54ec60,_0x210e73);_0x1011a5(_0x210e73);});});}function respondWithStatusCode(_0x63c71f,_0x119712){_0x119712=_0x119712||0xcc;return function(_0x5089c1){if(_0x5089c1){return _0x63c71f['sendStatus'](_0x119712);}return _0x63c71f[_0xf68e('0x20')](_0x119712)[_0xf68e('0x21')]();};}function respondWithResult(_0x72c1a6,_0x489f64){_0x489f64=_0x489f64||0xc8;return function(_0x46752f){if(_0x46752f){return _0x72c1a6[_0xf68e('0x20')](_0x489f64)[_0xf68e('0x22')](_0x46752f);}};}function respondWithFilteredResult(_0x465d5e,_0x36f381){return function(_0x3d8584){if(_0x3d8584){var _0x2b0c1e=typeof _0x36f381[_0xf68e('0x23')]===_0xf68e('0x24')&&typeof _0x36f381[_0xf68e('0x25')]===_0xf68e('0x24');var _0x17f8e8=_0x3d8584[_0xf68e('0x26')];var _0x2930a4=_0x2b0c1e?0x0:_0x36f381[_0xf68e('0x23')];var _0x1e57c5=_0x2b0c1e?_0x3d8584[_0xf68e('0x26')]:_0x36f381[_0xf68e('0x23')]+_0x36f381[_0xf68e('0x25')];var _0x539c64;if(_0x1e57c5>=_0x17f8e8){_0x1e57c5=_0x17f8e8;_0x539c64=0xc8;}else{_0x539c64=0xce;}_0x465d5e[_0xf68e('0x20')](_0x539c64);return _0x465d5e[_0xf68e('0x27')](_0xf68e('0x28'),_0x2930a4+'-'+_0x1e57c5+'/'+_0x17f8e8)[_0xf68e('0x22')](_0x3d8584);}return null;};}function patchUpdates(_0x3661b1){return function(_0x2aebcc){try{jsonpatch[_0xf68e('0x29')](_0x2aebcc,_0x3661b1,!![]);}catch(_0x35abdc){return BPromise[_0xf68e('0x2a')](_0x35abdc);}return _0x2aebcc[_0xf68e('0x2b')]();};}function saveUpdates(_0x7f5c95,_0x54c1c1){return function(_0x143380){if(_0x143380){return _0x143380[_0xf68e('0x2c')](_0x7f5c95)[_0xf68e('0x16')](function(_0x6ec5fa){return _0x6ec5fa;});}return null;};}function removeEntity(_0xc0295,_0x2c3edc){return function(_0x32bfef){if(_0x32bfef){return _0x32bfef[_0xf68e('0x2d')]()[_0xf68e('0x16')](function(){_0xc0295['status'](0xcc)[_0xf68e('0x21')]();});}};}function handleEntityNotFound(_0xb52bb3,_0x88c027){return function(_0x523a87){if(!_0x523a87){_0xb52bb3[_0xf68e('0x2e')](0x194);}return _0x523a87;};}function handleError(_0x4bc352,_0x2cf817){_0x2cf817=_0x2cf817||0x1f4;return function(_0x2d6495){logger['error'](_0x2d6495[_0xf68e('0x2f')]);if(_0x2d6495[_0xf68e('0x30')]){delete _0x2d6495[_0xf68e('0x30')];}_0x4bc352[_0xf68e('0x20')](_0x2cf817)[_0xf68e('0x31')](_0x2d6495);};}exports[_0xf68e('0x32')]=function(_0x1dfc56,_0x109703){var _0x51cd1f={},_0x3f98f0={},_0xcafceb={'count':0x0,'rows':[]};var _0x2aaa9e=_[_0xf68e('0x33')](db[_0xf68e('0x34')][_0xf68e('0x35')],function(_0x3aa728){return{'name':_0x3aa728[_0xf68e('0x36')],'type':_0x3aa728['type'][_0xf68e('0x37')]};});_0x3f98f0['model']=_[_0xf68e('0x33')](_0x2aaa9e,_0xf68e('0x30'));_0x3f98f0['query']=_[_0xf68e('0x38')](_0x1dfc56['query']);_0x3f98f0[_0xf68e('0x39')]=_[_0xf68e('0x3a')](_0x3f98f0[_0xf68e('0x3b')],_0x3f98f0['query']);_0x51cd1f[_0xf68e('0x3c')]=_[_0xf68e('0x3a')](_0x3f98f0[_0xf68e('0x3b')],qs['fields'](_0x1dfc56[_0xf68e('0x3d')][_0xf68e('0x3e')]));_0x51cd1f['attributes']=_0x51cd1f[_0xf68e('0x3c')][_0xf68e('0x3f')]?_0x51cd1f[_0xf68e('0x3c')]:_0x3f98f0['model'];if(!_0x1dfc56[_0xf68e('0x3d')][_0xf68e('0x40')](_0xf68e('0x41'))){_0x51cd1f[_0xf68e('0x25')]=qs[_0xf68e('0x25')](_0x1dfc56[_0xf68e('0x3d')][_0xf68e('0x25')]);_0x51cd1f[_0xf68e('0x23')]=qs[_0xf68e('0x23')](_0x1dfc56[_0xf68e('0x3d')][_0xf68e('0x23')]);}_0x51cd1f['order']=qs[_0xf68e('0x42')](_0x1dfc56['query'][_0xf68e('0x42')]);_0x51cd1f[_0xf68e('0x43')]=qs[_0xf68e('0x39')](_[_0xf68e('0x44')](_0x1dfc56[_0xf68e('0x3d')],_0x3f98f0[_0xf68e('0x39')]),_0x2aaa9e);if(_0x1dfc56[_0xf68e('0x3d')][_0xf68e('0x45')]){_0x51cd1f[_0xf68e('0x43')]=_[_0xf68e('0x46')](_0x51cd1f[_0xf68e('0x43')],{'$or':_['map'](_0x2aaa9e,function(_0xe6b777){if(_0xe6b777[_0xf68e('0x47')]!==_0xf68e('0x48')){var _0x483099={};_0x483099[_0xe6b777[_0xf68e('0x30')]]={'$like':'%'+_0x1dfc56[_0xf68e('0x3d')]['filter']+'%'};return _0x483099;}})});}_0x51cd1f=_[_0xf68e('0x46')]({},_0x51cd1f,_0x1dfc56[_0xf68e('0x49')]);var _0x2b90f7={'where':_0x51cd1f[_0xf68e('0x43')]};return db[_0xf68e('0x34')][_0xf68e('0x26')](_0x2b90f7)['then'](function(_0x5ef06e){_0xcafceb['count']=_0x5ef06e;if(_0x1dfc56[_0xf68e('0x3d')][_0xf68e('0x4a')]){_0x51cd1f['include']=[{'all':!![]}];}return db[_0xf68e('0x34')]['findAll'](_0x51cd1f);})[_0xf68e('0x16')](function(_0xd56bc4){_0xcafceb['rows']=_0xd56bc4;return _0xcafceb;})[_0xf68e('0x16')](respondWithFilteredResult(_0x109703,_0x51cd1f))[_0xf68e('0x4b')](handleError(_0x109703,null));};exports[_0xf68e('0x4c')]=function(_0x56c88d,_0x4b729f){var _0x3f94c3={'raw':!![],'where':{'id':_0x56c88d[_0xf68e('0x4d')]['id']}},_0x35a6de={};_0x35a6de[_0xf68e('0x3b')]=_[_0xf68e('0x38')](db['Network'][_0xf68e('0x35')]);_0x35a6de[_0xf68e('0x3d')]=_[_0xf68e('0x38')](_0x56c88d[_0xf68e('0x3d')]);_0x35a6de[_0xf68e('0x39')]=_['intersection'](_0x35a6de['model'],_0x35a6de['query']);_0x3f94c3[_0xf68e('0x3c')]=_[_0xf68e('0x3a')](_0x35a6de[_0xf68e('0x3b')],qs[_0xf68e('0x3e')](_0x56c88d['query'][_0xf68e('0x3e')]));_0x3f94c3[_0xf68e('0x3c')]=_0x3f94c3['attributes']['length']?_0x3f94c3[_0xf68e('0x3c')]:_0x35a6de[_0xf68e('0x3b')];if(_0x56c88d['query'][_0xf68e('0x4a')]){_0x3f94c3[_0xf68e('0x4e')]=[{'all':!![]}];}_0x3f94c3=_['merge']({},_0x3f94c3,_0x56c88d[_0xf68e('0x49')]);return db[_0xf68e('0x34')][_0xf68e('0x4f')](_0x3f94c3)[_0xf68e('0x16')](handleEntityNotFound(_0x4b729f,null))[_0xf68e('0x16')](respondWithResult(_0x4b729f,null))[_0xf68e('0x4b')](handleError(_0x4b729f,null));};exports[_0xf68e('0x50')]=function(_0x51a273,_0x2e3ebc,_0x5e5e53){var _0x1b0401;return db['sequelize'][_0xf68e('0x51')](function(_0x252c30){return db[_0xf68e('0x34')]['create'](_0x51a273['body'],{'raw':!![]})[_0xf68e('0x16')](function(_0x42932c){_0x1b0401=_0x42932c;return db[_0xf68e('0x34')][_0xf68e('0x52')]({'where':{'type':_0x51a273[_0xf68e('0x53')][_0xf68e('0x47')]},'raw':!![]});})[_0xf68e('0x16')](function(_0x1bf435){if(_0x1b0401[_0xf68e('0x47')][_0xf68e('0x54')]()==_0xf68e('0x55')){var _0x2c67de=fs['readFileSync'](path['join'](config[_0xf68e('0x56')],_0xf68e('0x57')),_0xf68e('0x58'));var _0x1b98a4=ejs[_0xf68e('0x59')](_0x2c67de,{'networks':_0x1bf435||[]});fs[_0xf68e('0x5a')](_0xf68e('0x5b'),_0x1b98a4);return respondWithRpcPromise(_0xf68e('0x5c'),_0xf68e('0x50'),{'module':_0xf68e('0x5d')});}else if(_0x1b0401[_0xf68e('0x47')][_0xf68e('0x54')]()=='TURN'){var _0x5002d5=fs[_0xf68e('0x5e')](path[_0xf68e('0x5f')](config['root'],_0xf68e('0x60')),_0xf68e('0x58'));var _0x29d9a1=ejs[_0xf68e('0x59')](_0x5002d5,{'networks':_0x1bf435||[]});fs[_0xf68e('0x5a')](_0xf68e('0x61'),_0x29d9a1);return respondWithRpcPromise(_0xf68e('0x5c'),_0xf68e('0x50'),{'module':_0xf68e('0x5d')});}else{var _0x12e69a=fs['readFileSync'](path[_0xf68e('0x5f')](config[_0xf68e('0x56')],_0xf68e('0x62')),'utf8');var _0x560ce2=ejs[_0xf68e('0x59')](_0x12e69a,{'networks':_0x1bf435||[]});fs[_0xf68e('0x5a')](util[_0xf68e('0x63')](_0xf68e('0x64'),_0x51a273['body']['type'][_0xf68e('0x65')]()),_0x560ce2);return respondWithRpcPromise(_0xf68e('0x5c'),_0xf68e('0x50'),{'module':_0xf68e('0x66')});}return null;})[_0xf68e('0x16')](function(){return _0x1b0401;});})['then'](respondWithResult(_0x2e3ebc,0xc9))['catch'](handleError(_0x2e3ebc,null));};exports['update']=function(_0x42fb3b,_0x19be52,_0x1bd908){var _0x563513;return db[_0xf68e('0x67')]['transaction'](function(_0x4d288f){return db[_0xf68e('0x34')][_0xf68e('0x4f')]({'where':{'id':_0x42fb3b[_0xf68e('0x4d')]['id']}})[_0xf68e('0x16')](handleEntityNotFound(_0x19be52,null))['then'](saveUpdates(_0x42fb3b[_0xf68e('0x53')],null))[_0xf68e('0x16')](function(_0x4d8ecd){if(_0x4d8ecd){_0x563513=_0x4d8ecd;return db[_0xf68e('0x34')][_0xf68e('0x52')]({'where':{'type':_0x563513[_0xf68e('0x47')]},'raw':!![]});}return null;})[_0xf68e('0x16')](function(_0x4435ee){if(_0x563513[_0xf68e('0x47')]['toUpperCase']()=='STUN'){var _0x53a8dc=fs[_0xf68e('0x5e')](path[_0xf68e('0x5f')](config[_0xf68e('0x56')],'server/files/templates/stun_multiple.ejs'),_0xf68e('0x58'));var _0x30e2c6=ejs[_0xf68e('0x59')](_0x53a8dc,{'networks':_0x4435ee||[]});fs[_0xf68e('0x5a')](_0xf68e('0x5b'),_0x30e2c6);return respondWithRpcPromise(_0xf68e('0x5c'),_0xf68e('0x2c'),{'module':_0xf68e('0x5d')});}else if(_0x563513[_0xf68e('0x47')][_0xf68e('0x54')]()==_0xf68e('0x68')){var _0xb5014e=fs[_0xf68e('0x5e')](path[_0xf68e('0x5f')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xf68e('0x58'));var _0xd59a2f=ejs[_0xf68e('0x59')](_0xb5014e,{'networks':_0x4435ee||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0xd59a2f);return respondWithRpcPromise(_0xf68e('0x5c'),_0xf68e('0x2c'),{'module':_0xf68e('0x5d')});}else{var _0x4c159d=fs[_0xf68e('0x5e')](path[_0xf68e('0x5f')](config[_0xf68e('0x56')],_0xf68e('0x62')),_0xf68e('0x58'));var _0x1c3f8a=ejs[_0xf68e('0x59')](_0x4c159d,{'networks':_0x4435ee||[]});fs[_0xf68e('0x5a')](util[_0xf68e('0x63')](_0xf68e('0x64'),_0x42fb3b['body'][_0xf68e('0x47')][_0xf68e('0x65')]()),_0x1c3f8a);return respondWithRpcPromise(_0xf68e('0x5c'),_0xf68e('0x2c'),{'module':_0xf68e('0x66')});}return null;})[_0xf68e('0x16')](function(_0x15cfdf){if(_0x15cfdf){return _0x563513;}return null;});})[_0xf68e('0x16')](respondWithResult(_0x19be52,null))['catch'](handleError(_0x19be52,null));};exports[_0xf68e('0x2d')]=function(_0x56766d,_0x43eb6f,_0x5b3f45){var _0x4a77cd;return db[_0xf68e('0x34')][_0xf68e('0x4f')]({'where':{'id':_0x56766d[_0xf68e('0x4d')]['id']}})['then'](function(_0x2db75b){_0x4a77cd=_0x2db75b;return _0x2db75b;})['then'](handleEntityNotFound(_0x43eb6f,null))[_0xf68e('0x16')](removeEntity(_0x43eb6f,null))[_0xf68e('0x16')](function(){if(_0x4a77cd){return db[_0xf68e('0x34')][_0xf68e('0x52')]({'where':{'type':_0x4a77cd[_0xf68e('0x47')]},'raw':!![]});}})[_0xf68e('0x16')](function(_0x3fcad5){if(_0x4a77cd[_0xf68e('0x47')]['toUpperCase']()==_0xf68e('0x55')){var _0x4aeec3=fs[_0xf68e('0x5e')](path[_0xf68e('0x5f')](config['root'],'server/files/templates/stun_multiple.ejs'),_0xf68e('0x58'));var _0x177fc1=ejs['render'](_0x4aeec3,{'networks':_0x3fcad5||[]});fs[_0xf68e('0x5a')](_0xf68e('0x5b'),_0x177fc1);return respondWithRpcPromise('Reload',_0xf68e('0x2d'),{'module':_0xf68e('0x5d')});}else if(_0x4a77cd[_0xf68e('0x47')][_0xf68e('0x54')]()=='TURN'){var _0x48f411=fs[_0xf68e('0x5e')](path['join'](config[_0xf68e('0x56')],'server/files/templates/turn_multiple.ejs'),_0xf68e('0x58'));var _0x5ab4fe=ejs[_0xf68e('0x59')](_0x48f411,{'networks':_0x3fcad5||[]});fs[_0xf68e('0x5a')](_0xf68e('0x61'),_0x5ab4fe);return respondWithRpcPromise(_0xf68e('0x5c'),'destroy',{'module':_0xf68e('0x5d')});}else{var _0x47120a=fs[_0xf68e('0x5e')](path[_0xf68e('0x5f')](config[_0xf68e('0x56')],'server/files/templates/network.ejs'),_0xf68e('0x58'));var _0x425478=ejs[_0xf68e('0x59')](_0x47120a,{'networks':_0x3fcad5||[]});fs['writeFileSync'](util[_0xf68e('0x63')](_0xf68e('0x64'),_0x56766d[_0xf68e('0x53')]['type'][_0xf68e('0x65')]()),_0x425478);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x43eb6f,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 50d3219..457729a 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 _0x68fc=['bluebird','path','./network.attributes','exports','network','lodash','util','../../config/logger'];(function(_0xd12b3e,_0x583290){var _0x3fc263=function(_0x5ae0b8){while(--_0x5ae0b8){_0xd12b3e['push'](_0xd12b3e['shift']());}};_0x3fc263(++_0x583290);}(_0x68fc,0xa5));var _0xc68f=function(_0x5f45c6,_0x4717f5){_0x5f45c6=_0x5f45c6-0x0;var _0x5380d4=_0x68fc[_0x5f45c6];return _0x5380d4;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var logger=require(_0xc68f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc68f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc68f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc68f('0x5'));module[_0xc68f('0x6')]=function(_0x1c6df9,_0x363cdf){return _0x1c6df9['define']('Network',attributes,{'tableName':_0xc68f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76dc=['rimraf','exports','network','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x76dc,0x1f2));var _0xc76d=function(_0x40f9f7,_0x1fea29){_0x40f9f7=_0x40f9f7-0x0;var _0x44363f=_0x76dc[_0x40f9f7];return _0x44363f;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var logger=require(_0xc76d('0x2'))(_0xc76d('0x3'));var moment=require('moment');var BPromise=require(_0xc76d('0x4'));var rp=require(_0xc76d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc76d('0x6'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xc76d('0x7')]=function(_0x29ab70,_0x1c86fc){return _0x29ab70['define']('Network',attributes,{'tableName':_0xc76d('0x8'),'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 b1ee2ff..325b3a3 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x1fb952,_0x570bf8){_0x1fb952=_0x1fb952-0x0;var _0x45f1a0=_0x7a54[_0x1fb952];return _0x45f1a0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2652dc,_0x2b64b1){var _0x2bee7d=function(_0x306eae){while(--_0x306eae){_0x2652dc['push'](_0x2652dc['shift']());}};_0x2bee7d(++_0x2b64b1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 62d772f..515467e 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 _0xcdb2=['addAnswer','/:id/notify','addApplications','/:id/users','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','describe','get','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create'];(function(_0x4f8a90,_0xe31f20){var _0x2e3efa=function(_0x88bff1){while(--_0x88bff1){_0x4f8a90['push'](_0x4f8a90['shift']());}};_0x2e3efa(++_0xe31f20);}(_0xcdb2,0x17f));var _0x2cdb=function(_0x30bff8,_0x3faceb){_0x30bff8=_0x30bff8-0x0;var _0x128b60=_0xcdb2[_0x30bff8];return _0x128b60;};'use strict';var multer=require(_0x2cdb('0x0'));var util=require(_0x2cdb('0x1'));var path=require(_0x2cdb('0x2'));var timeout=require('connect-timeout');var express=require(_0x2cdb('0x3'));var router=express[_0x2cdb('0x4')]();var fs_extra=require(_0x2cdb('0x5'));var auth=require(_0x2cdb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2cdb('0x7'));var controller=require(_0x2cdb('0x8'));router['get']('/',auth[_0x2cdb('0x9')](),controller['index']);router['get']('/describe',auth[_0x2cdb('0x9')](),controller[_0x2cdb('0xa')]);router[_0x2cdb('0xb')](_0x2cdb('0xc'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0xd')]);router[_0x2cdb('0xb')](_0x2cdb('0xe'),auth[_0x2cdb('0x9')](),controller['getDispositions']);router[_0x2cdb('0xb')](_0x2cdb('0xf'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x10')]);router[_0x2cdb('0xb')](_0x2cdb('0x11'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x12')]);router[_0x2cdb('0xb')](_0x2cdb('0x13'),auth['isAuthenticated'](),controller[_0x2cdb('0x14')]);router[_0x2cdb('0xb')]('/:id/users',auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x15')]);router[_0x2cdb('0x16')]('/',auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x17')]);router[_0x2cdb('0x16')](_0x2cdb('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x2cdb('0xf'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x18')]);router[_0x2cdb('0x16')](_0x2cdb('0x19'),controller['notify']);router['post'](_0x2cdb('0x11'),auth['isAuthenticated'](),controller[_0x2cdb('0x1a')]);router[_0x2cdb('0x16')](_0x2cdb('0x1b'),auth[_0x2cdb('0x9')](),controller['addAgents']);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x2cdb('0x1c')]);router[_0x2cdb('0x1d')](_0x2cdb('0xc'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x1e')]);router[_0x2cdb('0x1f')](_0x2cdb('0xc'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x20')]);router['delete'](_0x2cdb('0xe'),auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x21')]);router['delete'](_0x2cdb('0xf'),auth['isAuthenticated'](),controller[_0x2cdb('0x22')]);router[_0x2cdb('0x1f')]('/:id/users',auth[_0x2cdb('0x9')](),controller[_0x2cdb('0x23')]);module[_0x2cdb('0x24')]=router; \ No newline at end of file +var _0xa5d7=['getInteractions','/:id/users','post','create','/:id/canned_answers','/:id/notify','notify','addApplications','addAgents','send','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/applications'];(function(_0x4f96f6,_0x44da5d){var _0x2a3c5b=function(_0x2eca42){while(--_0x2eca42){_0x4f96f6['push'](_0x4f96f6['shift']());}};_0x2a3c5b(++_0x44da5d);}(_0xa5d7,0x13a));var _0x7a5d=function(_0x14774d,_0x38d99f){_0x14774d=_0x14774d-0x0;var _0x617dc=_0xa5d7[_0x14774d];return _0x617dc;};'use strict';var multer=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var path=require(_0x7a5d('0x2'));var timeout=require(_0x7a5d('0x3'));var express=require(_0x7a5d('0x4'));var router=express['Router']();var fs_extra=require(_0x7a5d('0x5'));var auth=require(_0x7a5d('0x6'));var interaction=require(_0x7a5d('0x7'));var config=require(_0x7a5d('0x8'));var controller=require(_0x7a5d('0x9'));router[_0x7a5d('0xa')]('/',auth['isAuthenticated'](),controller[_0x7a5d('0xb')]);router[_0x7a5d('0xa')](_0x7a5d('0xc'),auth[_0x7a5d('0xd')](),controller[_0x7a5d('0xe')]);router['get']('/:id',auth[_0x7a5d('0xd')](),controller[_0x7a5d('0xf')]);router[_0x7a5d('0xa')](_0x7a5d('0x10'),auth[_0x7a5d('0xd')](),controller[_0x7a5d('0x11')]);router[_0x7a5d('0xa')]('/:id/canned_answers',auth[_0x7a5d('0xd')](),controller['getAnswers']);router[_0x7a5d('0xa')](_0x7a5d('0x12'),auth[_0x7a5d('0xd')](),controller['getApplications']);router['get']('/:id/interactions',auth[_0x7a5d('0xd')](),controller[_0x7a5d('0x13')]);router['get'](_0x7a5d('0x14'),auth[_0x7a5d('0xd')](),controller['getAgents']);router[_0x7a5d('0x15')]('/',auth[_0x7a5d('0xd')](),controller[_0x7a5d('0x16')]);router[_0x7a5d('0x15')](_0x7a5d('0x10'),auth[_0x7a5d('0xd')](),controller['addDisposition']);router['post'](_0x7a5d('0x17'),auth[_0x7a5d('0xd')](),controller['addAnswer']);router[_0x7a5d('0x15')](_0x7a5d('0x18'),controller[_0x7a5d('0x19')]);router[_0x7a5d('0x15')](_0x7a5d('0x12'),auth[_0x7a5d('0xd')](),controller[_0x7a5d('0x1a')]);router[_0x7a5d('0x15')]('/:id/users',auth[_0x7a5d('0xd')](),controller[_0x7a5d('0x1b')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x7a5d('0x1c')]);router[_0x7a5d('0x1d')](_0x7a5d('0x1e'),auth[_0x7a5d('0xd')](),controller[_0x7a5d('0x1f')]);router[_0x7a5d('0x20')](_0x7a5d('0x1e'),auth['isAuthenticated'](),controller['destroy']);router[_0x7a5d('0x20')](_0x7a5d('0x10'),auth[_0x7a5d('0xd')](),controller[_0x7a5d('0x21')]);router[_0x7a5d('0x20')](_0x7a5d('0x17'),auth['isAuthenticated'](),controller[_0x7a5d('0x22')]);router[_0x7a5d('0x20')]('/:id/users',auth[_0x7a5d('0xd')](),controller[_0x7a5d('0x23')]);module[_0x7a5d('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 6989831..3d28960 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 _0x778d=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name'];(function(_0x588bd1,_0x1c6010){var _0x1d5d27=function(_0x2ce03a){while(--_0x2ce03a){_0x588bd1['push'](_0x588bd1['shift']());}};_0x1d5d27(++_0x1c6010);}(_0x778d,0xf9));var _0xd778=function(_0x398b9d,_0x41737){_0x398b9d=_0x398b9d-0x0;var _0x5ee77a=_0x778d[_0x398b9d];return _0x5ee77a;};'use strict';var Sequelize=require(_0xd778('0x0'));var rs=require(_0xd778('0x1'));module['exports']={'name':{'type':Sequelize[_0xd778('0x2')],'unique':_0xd778('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd778('0x2')]},'token':{'type':Sequelize[_0xd778('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd778('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd778('0x4');}},'notificationSound':{'type':Sequelize[_0xd778('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd778('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd778('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xd778('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd778('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd778('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd778('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xd778('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4bfe09){if(!_0x4bfe09)this[_0xd778('0x8')](_0xd778('0x9'),null);this[_0xd778('0x8')](_0xd778('0xa'),_0x4bfe09);}}}; \ No newline at end of file +var _0x1184=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x2d64fc,_0x42b2a7){var _0x2c8556=function(_0x4b29da){while(--_0x4b29da){_0x2d64fc['push'](_0x2d64fc['shift']());}};_0x2c8556(++_0x42b2a7);}(_0x1184,0x13c));var _0x4118=function(_0x15436f,_0x5e6751){_0x15436f=_0x15436f-0x0;var _0x4ee03c=_0x1184[_0x15436f];return _0x4ee03c;};'use strict';var Sequelize=require(_0x4118('0x0'));var rs=require(_0x4118('0x1'));module[_0x4118('0x2')]={'name':{'type':Sequelize[_0x4118('0x3')],'unique':_0x4118('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x4118('0x3')]},'token':{'type':Sequelize[_0x4118('0x3')],'defaultValue':function(){return rs[_0x4118('0x5')]();}},'replyUri':{'type':Sequelize[_0x4118('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4118('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4118('0x6')],'defaultValue':function(){return _0x4118('0x7');}},'notificationSound':{'type':Sequelize[_0x4118('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4118('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4118('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x4118('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4118('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4118('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4118('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4118('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x4118('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x4118('0x8')],'defaultValue':![],'comment':_0x4118('0xb'),'set':function(_0x54755a){if(!_0x54755a)this[_0x4118('0xc')](_0x4118('0xd'),null);this[_0x4118('0xc')](_0x4118('0xe'),_0x54755a);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index ca5c9d2..b0b818c 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 _0x8572=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','params','mandatoryDispositionPause','length','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','ValidationError','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','Applications','list','applications','orderBy','priority','asc','account','Contacts','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','push','rimraf','zip-dir','moment','mustache'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x8572,0x17a));var _0x2857=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x8572[_0xc0a3d3];return _0x3386e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2857('0x0'));var zipdir=require(_0x2857('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2857('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2857('0x3'));var util=require(_0x2857('0x4'));var path=require(_0x2857('0x5'));var sox=require(_0x2857('0x6'));var csv=require(_0x2857('0x7'));var ejs=require(_0x2857('0x8'));var fs=require('fs');var fs_extra=require(_0x2857('0x9'));var _=require(_0x2857('0xa'));var squel=require(_0x2857('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2857('0xc'));var toCsv=require(_0x2857('0x7'));var querystring=require(_0x2857('0xd'));var Papa=require(_0x2857('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2857('0xf'));var hardwareService=require(_0x2857('0x10'));var logger=require('../../config/logger')(_0x2857('0x11'));var utils=require(_0x2857('0x12'));var config=require(_0x2857('0x13'));var licenseUtil=require(_0x2857('0x14'));var db=require(_0x2857('0x15'))['db'];config[_0x2857('0x16')]=_[_0x2857('0x17')](config[_0x2857('0x16')],{'host':_0x2857('0x18'),'port':0x18eb});var socket=require(_0x2857('0x19'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2857('0x1a')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c43d4,_0x36684b,_0x5f209b,_0x51d0cd){return new BPromise(function(_0x4463fa,_0x3a9d86){var _0x11e008=_0x51d0cd||client;return _0x11e008[_0x2857('0x1b')](_0x2c43d4,_0x5f209b)[_0x2857('0x1c')](function(_0x18610a){logger[_0x2857('0x1d')](_0x2857('0x1e'),_0x36684b,_0x2857('0x1f'));logger[_0x2857('0x20')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x36684b,_0x2857('0x1f'),JSON[_0x2857('0x21')](_0x18610a));if(_0x18610a[_0x2857('0x22')]){if(_0x18610a[_0x2857('0x22')][_0x2857('0x23')]===0x1f4){logger['error'](_0x2857('0x1e'),_0x36684b,_0x18610a['error']['message']);return _0x3a9d86(_0x18610a[_0x2857('0x22')][_0x2857('0x24')]);}logger['error'](_0x2857('0x1e'),_0x36684b,_0x18610a[_0x2857('0x22')][_0x2857('0x24')]);return _0x4463fa(_0x18610a[_0x2857('0x22')][_0x2857('0x24')]);}else{logger['info'](_0x2857('0x1e'),_0x36684b,_0x2857('0x1f'));_0x4463fa(_0x18610a[_0x2857('0x25')][_0x2857('0x24')]);}})[_0x2857('0x26')](function(_0x41ced8){logger[_0x2857('0x22')](_0x2857('0x1e'),_0x36684b,_0x41ced8);_0x3a9d86(_0x41ced8);});});}function respondWithStatusCode(_0x45e178,_0x3cd526){_0x3cd526=_0x3cd526||0xcc;return function(_0x4a7133){if(_0x4a7133){return _0x45e178['sendStatus'](_0x3cd526);}return _0x45e178[_0x2857('0x27')](_0x3cd526)[_0x2857('0x28')]();};}function respondWithResult(_0x5ca2e3,_0x46c6ad){_0x46c6ad=_0x46c6ad||0xc8;return function(_0xda29d0){if(_0xda29d0){return _0x5ca2e3[_0x2857('0x27')](_0x46c6ad)[_0x2857('0x29')](_0xda29d0);}};}function respondWithFilteredResult(_0x3091b4,_0x3d9146){return function(_0x103454){if(_0x103454){var _0x3dfd82=typeof _0x3d9146[_0x2857('0x2a')]===_0x2857('0x2b')&&typeof _0x3d9146['limit']==='undefined';var _0x1090d5=_0x103454['count'];var _0xc3f078=_0x3dfd82?0x0:_0x3d9146[_0x2857('0x2a')];var _0x3aca53=_0x3dfd82?_0x103454[_0x2857('0x2c')]:_0x3d9146[_0x2857('0x2a')]+_0x3d9146[_0x2857('0x2d')];var _0x3d9829;if(_0x3aca53>=_0x1090d5){_0x3aca53=_0x1090d5;_0x3d9829=0xc8;}else{_0x3d9829=0xce;}_0x3091b4[_0x2857('0x27')](_0x3d9829);return _0x3091b4[_0x2857('0x2e')](_0x2857('0x2f'),_0xc3f078+'-'+_0x3aca53+'/'+_0x1090d5)[_0x2857('0x29')](_0x103454);}return null;};}function patchUpdates(_0x5176d3){return function(_0x40d639){try{jsonpatch[_0x2857('0x30')](_0x40d639,_0x5176d3,!![]);}catch(_0x39dd2c){return BPromise[_0x2857('0x31')](_0x39dd2c);}return _0x40d639[_0x2857('0x32')]();};}function saveUpdates(_0x270fe7,_0x5d47b2){return function(_0x113ef5){if(_0x113ef5){return _0x113ef5[_0x2857('0x33')](_0x270fe7)[_0x2857('0x1c')](function(_0x525a37){return _0x525a37;});}return null;};}function removeEntity(_0xeaffb3,_0x47a37e){return function(_0x1afff6){if(_0x1afff6){return _0x1afff6[_0x2857('0x34')]()[_0x2857('0x1c')](function(){var _0x4a9f96=_0x1afff6[_0x2857('0x35')]({'plain':!![]});var _0x15c027=_0x2857('0x36');return db[_0x2857('0x37')][_0x2857('0x34')]({'where':{'type':_0x15c027,'resourceId':_0x4a9f96['id']}})[_0x2857('0x1c')](function(){return _0x1afff6;});})['then'](function(){_0xeaffb3[_0x2857('0x27')](0xcc)[_0x2857('0x28')]();});}};}function handleEntityNotFound(_0x21079e,_0x25817d){return function(_0x3daeeb){if(!_0x3daeeb){_0x21079e[_0x2857('0x38')](0x194);}return _0x3daeeb;};}function handleError(_0x4bd951,_0x539ac9){_0x539ac9=_0x539ac9||0x1f4;return function(_0x137f7b){logger[_0x2857('0x22')](_0x137f7b[_0x2857('0x39')]);if(_0x137f7b['name']){delete _0x137f7b[_0x2857('0x3a')];}_0x4bd951[_0x2857('0x27')](_0x539ac9)[_0x2857('0x3b')](_0x137f7b);};}exports[_0x2857('0x3c')]=function(_0x3c90be,_0x23e4c8){var _0x54c234={'include':[{'model':db[_0x2857('0x3d')],'as':'mandatoryDispositionPause'}]},_0x15ab52={},_0x14e903={'count':0x0,'rows':[]};var _0x94584b=_[_0x2857('0x3e')](db[_0x2857('0x3f')][_0x2857('0x40')],function(_0x3b5b17){return{'name':_0x3b5b17[_0x2857('0x41')],'type':_0x3b5b17[_0x2857('0x42')][_0x2857('0x43')]};});_0x15ab52[_0x2857('0x44')]=_[_0x2857('0x3e')](_0x94584b,_0x2857('0x3a'));_0x15ab52['query']=_[_0x2857('0x45')](_0x3c90be[_0x2857('0x46')]);_0x15ab52[_0x2857('0x47')]=_['intersection'](_0x15ab52[_0x2857('0x44')],_0x15ab52['query']);_0x54c234[_0x2857('0x48')]=_[_0x2857('0x49')](_0x15ab52['model'],qs[_0x2857('0x4a')](_0x3c90be[_0x2857('0x46')]['fields']));_0x54c234[_0x2857('0x48')]=_0x54c234[_0x2857('0x48')]['length']?_0x54c234['attributes']:_0x15ab52[_0x2857('0x44')];if(!_0x3c90be[_0x2857('0x46')][_0x2857('0x4b')](_0x2857('0x4c'))){_0x54c234[_0x2857('0x2d')]=qs[_0x2857('0x2d')](_0x3c90be[_0x2857('0x46')][_0x2857('0x2d')]);_0x54c234[_0x2857('0x2a')]=qs[_0x2857('0x2a')](_0x3c90be[_0x2857('0x46')][_0x2857('0x2a')]);}_0x54c234[_0x2857('0x4d')]=qs[_0x2857('0x4e')](_0x3c90be[_0x2857('0x46')]['sort']);_0x54c234[_0x2857('0x4f')]=qs['filters'](_[_0x2857('0x50')](_0x3c90be[_0x2857('0x46')],_0x15ab52[_0x2857('0x47')]),_0x94584b);if(_0x3c90be[_0x2857('0x46')]['filter']){_0x54c234[_0x2857('0x4f')]=_[_0x2857('0x51')](_0x54c234[_0x2857('0x4f')],{'$or':_[_0x2857('0x3e')](_0x94584b,function(_0x5176de){if(_0x5176de[_0x2857('0x42')]!==_0x2857('0x52')){var _0x2a7f60={};_0x2a7f60[_0x5176de['name']]={'$like':'%'+_0x3c90be[_0x2857('0x46')][_0x2857('0x53')]+'%'};return _0x2a7f60;}})});}_0x54c234=_[_0x2857('0x51')]({},_0x54c234,_0x3c90be[_0x2857('0x54')]);var _0x20c78f={'where':_0x54c234['where']};return db['OpenchannelAccount'][_0x2857('0x2c')](_0x20c78f)[_0x2857('0x1c')](function(_0x388be3){_0x14e903[_0x2857('0x2c')]=_0x388be3;if(_0x3c90be['query']['includeAll']){_0x54c234[_0x2857('0x55')]=[{'all':!![]}];}return db[_0x2857('0x3f')]['findAll'](_0x54c234);})['then'](function(_0x223c3a){_0x14e903[_0x2857('0x56')]=_0x223c3a;return _0x14e903;})[_0x2857('0x1c')](respondWithFilteredResult(_0x23e4c8,_0x54c234))[_0x2857('0x26')](handleError(_0x23e4c8,null));};exports['show']=function(_0x2c83c1,_0x267129){var _0x300add={'raw':![],'where':{'id':_0x2c83c1[_0x2857('0x57')]['id']},'include':[{'model':db[_0x2857('0x3d')],'as':_0x2857('0x58')}]},_0x4c1c08={};_0x4c1c08[_0x2857('0x44')]=_[_0x2857('0x45')](db[_0x2857('0x3f')]['rawAttributes']);_0x4c1c08[_0x2857('0x46')]=_[_0x2857('0x45')](_0x2c83c1[_0x2857('0x46')]);_0x4c1c08[_0x2857('0x47')]=_['intersection'](_0x4c1c08[_0x2857('0x44')],_0x4c1c08[_0x2857('0x46')]);_0x300add[_0x2857('0x48')]=_[_0x2857('0x49')](_0x4c1c08[_0x2857('0x44')],qs[_0x2857('0x4a')](_0x2c83c1[_0x2857('0x46')][_0x2857('0x4a')]));_0x300add[_0x2857('0x48')]=_0x300add[_0x2857('0x48')][_0x2857('0x59')]?_0x300add[_0x2857('0x48')]:_0x4c1c08[_0x2857('0x44')];if(_0x2c83c1['query'][_0x2857('0x5a')]){_0x300add[_0x2857('0x55')]=[{'all':!![]}];}_0x300add=_[_0x2857('0x51')]({},_0x300add,_0x2c83c1['options']);return db[_0x2857('0x3f')]['find'](_0x300add)[_0x2857('0x1c')](handleEntityNotFound(_0x267129,null))[_0x2857('0x1c')](respondWithResult(_0x267129,null))[_0x2857('0x26')](handleError(_0x267129,null));};exports[_0x2857('0x5b')]=function(_0x4ad363,_0x211bef){return db['OpenchannelAccount'][_0x2857('0x5b')](_0x4ad363['body'],{})[_0x2857('0x1c')](function(_0x16e39d){var _0x36dd88=_0x4ad363[_0x2857('0x5c')][_0x2857('0x35')]({'plain':!![]});if(!_0x36dd88)throw new Error(_0x2857('0x5d'));if(_0x36dd88[_0x2857('0x5e')]===_0x2857('0x5c')){var _0x3bf527=_0x16e39d[_0x2857('0x35')]({'plain':!![]});var _0x4affb0='OpenchannelAccounts';return db[_0x2857('0x5f')][_0x2857('0x60')]({'where':{'name':_0x4affb0,'userProfileId':_0x36dd88[_0x2857('0x61')]},'raw':!![]})[_0x2857('0x1c')](function(_0x391f3f){if(_0x391f3f&&_0x391f3f['autoAssociation']===0x0){return db[_0x2857('0x37')][_0x2857('0x5b')]({'name':_0x3bf527[_0x2857('0x3a')],'resourceId':_0x3bf527['id'],'type':_0x391f3f[_0x2857('0x3a')],'sectionId':_0x391f3f['id']},{})[_0x2857('0x1c')](function(){return _0x16e39d;});}else{return _0x16e39d;}})[_0x2857('0x26')](function(_0x45efbd){logger[_0x2857('0x22')](_0x2857('0x62'),_0x45efbd);throw _0x45efbd;});}return _0x16e39d;})[_0x2857('0x1c')](respondWithResult(_0x211bef,0xc9))[_0x2857('0x26')](handleError(_0x211bef,null));};exports[_0x2857('0x33')]=function(_0x3f3346,_0x539b67){if(_0x3f3346[_0x2857('0x63')]['id']){delete _0x3f3346[_0x2857('0x63')]['id'];}return db[_0x2857('0x3f')]['find']({'where':{'id':_0x3f3346[_0x2857('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x539b67,null))[_0x2857('0x1c')](saveUpdates(_0x3f3346['body'],null))[_0x2857('0x1c')](respondWithResult(_0x539b67,null))[_0x2857('0x26')](handleError(_0x539b67,null));};exports['destroy']=function(_0x50ac7f,_0x4b9956){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x50ac7f[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x4b9956,null))['then'](removeEntity(_0x4b9956,null))['catch'](handleError(_0x4b9956,null));};exports[_0x2857('0x64')]=function(_0x4b1690,_0x434beb){return db['OpenchannelAccount'][_0x2857('0x64')]()[_0x2857('0x1c')](respondWithResult(_0x434beb,null))[_0x2857('0x26')](handleError(_0x434beb,null));};exports['addDisposition']=function(_0x1d29b5,_0x376365,_0xcec02e){if(_0x1d29b5[_0x2857('0x63')]['id']){delete _0x1d29b5['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x1d29b5[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x376365,null))[_0x2857('0x1c')](function(_0x98eb7f){if(_0x98eb7f){_0x1d29b5['body'][_0x2857('0x65')]=_0x98eb7f['id'];return db[_0x2857('0x66')][_0x2857('0x5b')](_0x1d29b5[_0x2857('0x63')]);}})[_0x2857('0x1c')](respondWithResult(_0x376365,null))[_0x2857('0x26')](handleError(_0x376365,null));};exports[_0x2857('0x67')]=function(_0x318a0b,_0x534e2c,_0x2dcafd){var _0x384c95={'raw':![],'where':{}};var _0x2c49db={};var _0x4d0e6c={'count':0x0,'rows':[]};return db[_0x2857('0x3f')][_0x2857('0x68')]({'where':{'id':_0x318a0b['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x534e2c,null))[_0x2857('0x1c')](function(_0x725c0c){if(_0x725c0c){_0x2c49db[_0x2857('0x44')]=_[_0x2857('0x45')](db[_0x2857('0x66')]['rawAttributes']);_0x2c49db[_0x2857('0x46')]=_[_0x2857('0x45')](_0x318a0b[_0x2857('0x46')]);_0x2c49db[_0x2857('0x47')]=_[_0x2857('0x49')](_0x2c49db[_0x2857('0x44')],_0x2c49db['query']);_0x384c95[_0x2857('0x48')]=_[_0x2857('0x49')](_0x2c49db['model'],qs['fields'](_0x318a0b[_0x2857('0x46')][_0x2857('0x4a')]));_0x384c95[_0x2857('0x48')]=_0x384c95[_0x2857('0x48')][_0x2857('0x59')]?_0x384c95[_0x2857('0x48')]:_0x2c49db[_0x2857('0x44')];if(!_0x318a0b['query']['hasOwnProperty'](_0x2857('0x4c'))){_0x384c95['limit']=qs[_0x2857('0x2d')](_0x318a0b[_0x2857('0x46')][_0x2857('0x2d')]);_0x384c95[_0x2857('0x2a')]=qs[_0x2857('0x2a')](_0x318a0b[_0x2857('0x46')][_0x2857('0x2a')]);}_0x384c95[_0x2857('0x4d')]=qs[_0x2857('0x4e')](_0x318a0b[_0x2857('0x46')][_0x2857('0x4e')]);_0x384c95[_0x2857('0x4f')]=qs[_0x2857('0x47')](_[_0x2857('0x50')](_0x318a0b[_0x2857('0x46')],_0x2c49db[_0x2857('0x47')]));_0x384c95[_0x2857('0x4f')]['OpenchannelAccountId']=_0x725c0c['id'];if(_0x318a0b[_0x2857('0x46')]['filter']){_0x384c95['where']=_['merge'](_0x384c95[_0x2857('0x4f')],{'$or':_['map'](_0x384c95[_0x2857('0x48')],function(_0x10a553){var _0x42abd8={};_0x42abd8[_0x10a553]={'$like':'%'+_0x318a0b[_0x2857('0x46')][_0x2857('0x53')]+'%'};return _0x42abd8;})});}_0x384c95=_[_0x2857('0x51')]({},_0x384c95,_0x318a0b[_0x2857('0x54')]);return db['Disposition'][_0x2857('0x2c')]({'where':_0x384c95[_0x2857('0x4f')]})[_0x2857('0x1c')](function(_0x5592f9){_0x4d0e6c[_0x2857('0x2c')]=_0x5592f9;if(_0x318a0b['query'][_0x2857('0x5a')]){_0x384c95['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x384c95);})[_0x2857('0x1c')](function(_0x5883ef){_0x4d0e6c['rows']=_0x5883ef;return _0x4d0e6c;});}})[_0x2857('0x1c')](respondWithFilteredResult(_0x534e2c,_0x384c95))[_0x2857('0x26')](handleError(_0x534e2c,null));};exports[_0x2857('0x69')]=function(_0x1efbaf,_0x14b38b,_0x544e57){return db['OpenchannelAccount'][_0x2857('0x60')]({'where':{'id':_0x1efbaf[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x14b38b,null))[_0x2857('0x1c')](function(_0x251fb2){if(_0x251fb2){return _0x251fb2['removeDispositions'](_0x1efbaf[_0x2857('0x46')][_0x2857('0x6a')]);}})[_0x2857('0x1c')](respondWithStatusCode(_0x14b38b,null))[_0x2857('0x26')](handleError(_0x14b38b,null));};exports[_0x2857('0x6b')]=function(_0x375c17,_0x4fc757,_0x24a8be){if(_0x375c17['body']['id']){delete _0x375c17['body']['id'];}return db['OpenchannelAccount'][_0x2857('0x60')]({'where':{'id':_0x375c17[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x4fc757,null))[_0x2857('0x1c')](function(_0x5bb684){if(_0x5bb684){_0x375c17[_0x2857('0x63')]['OpenchannelAccountId']=_0x5bb684['id'];return db['CannedAnswer']['create'](_0x375c17[_0x2857('0x63')]);}})[_0x2857('0x1c')](respondWithResult(_0x4fc757,null))['catch'](handleError(_0x4fc757,null));};exports[_0x2857('0x6c')]=function(_0x565644,_0x51c9b3,_0x1c32d8){var _0x3c3869={'raw':![],'where':{}};var _0x2d37ab={};var _0x543a5e={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2857('0x68')]({'where':{'id':_0x565644['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x51c9b3,null))[_0x2857('0x1c')](function(_0x4edddb){if(_0x4edddb){_0x2d37ab[_0x2857('0x44')]=_[_0x2857('0x45')](db[_0x2857('0x6d')][_0x2857('0x40')]);_0x2d37ab[_0x2857('0x46')]=_[_0x2857('0x45')](_0x565644['query']);_0x2d37ab[_0x2857('0x47')]=_[_0x2857('0x49')](_0x2d37ab[_0x2857('0x44')],_0x2d37ab[_0x2857('0x46')]);_0x3c3869[_0x2857('0x48')]=_['intersection'](_0x2d37ab[_0x2857('0x44')],qs[_0x2857('0x4a')](_0x565644[_0x2857('0x46')][_0x2857('0x4a')]));_0x3c3869['attributes']=_0x3c3869[_0x2857('0x48')][_0x2857('0x59')]?_0x3c3869[_0x2857('0x48')]:_0x2d37ab[_0x2857('0x44')];if(!_0x565644[_0x2857('0x46')][_0x2857('0x4b')]('nolimit')){_0x3c3869[_0x2857('0x2d')]=qs[_0x2857('0x2d')](_0x565644[_0x2857('0x46')][_0x2857('0x2d')]);_0x3c3869[_0x2857('0x2a')]=qs['offset'](_0x565644[_0x2857('0x46')]['offset']);}_0x3c3869[_0x2857('0x4d')]=qs[_0x2857('0x4e')](_0x565644[_0x2857('0x46')][_0x2857('0x4e')]);_0x3c3869[_0x2857('0x4f')]=qs[_0x2857('0x47')](_['pick'](_0x565644[_0x2857('0x46')],_0x2d37ab[_0x2857('0x47')]));_0x3c3869['where'][_0x2857('0x65')]=_0x4edddb['id'];if(_0x565644[_0x2857('0x46')][_0x2857('0x53')]){_0x3c3869[_0x2857('0x4f')]=_[_0x2857('0x51')](_0x3c3869[_0x2857('0x4f')],{'$or':_[_0x2857('0x3e')](_0x3c3869[_0x2857('0x48')],function(_0x34c952){var _0x9bddee={};_0x9bddee[_0x34c952]={'$like':'%'+_0x565644[_0x2857('0x46')]['filter']+'%'};return _0x9bddee;})});}_0x3c3869=_['merge']({},_0x3c3869,_0x565644[_0x2857('0x54')]);return db[_0x2857('0x6d')][_0x2857('0x2c')]({'where':_0x3c3869[_0x2857('0x4f')]})['then'](function(_0x4bdc01){_0x543a5e[_0x2857('0x2c')]=_0x4bdc01;if(_0x565644[_0x2857('0x46')][_0x2857('0x5a')]){_0x3c3869['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3c3869);})[_0x2857('0x1c')](function(_0x31bec9){_0x543a5e[_0x2857('0x56')]=_0x31bec9;return _0x543a5e;});}})[_0x2857('0x1c')](respondWithFilteredResult(_0x51c9b3,_0x3c3869))[_0x2857('0x26')](handleError(_0x51c9b3,null));};exports[_0x2857('0x6e')]=function(_0x388eb6,_0x2989ca,_0x5e6f48){return db[_0x2857('0x3f')]['find']({'where':{'id':_0x388eb6[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x2989ca,null))['then'](function(_0x468e40){if(_0x468e40){return _0x468e40[_0x2857('0x6e')](_0x388eb6[_0x2857('0x46')][_0x2857('0x6a')]);}})[_0x2857('0x1c')](respondWithStatusCode(_0x2989ca,null))[_0x2857('0x26')](handleError(_0x2989ca,null));};exports[_0x2857('0x6f')]=function(_0x29f4ee,_0x5299d3,_0x240f2f){var _0x1f810b={'body':_0x29f4ee[_0x2857('0x63')],'channel':_0x2857('0x70')};var _0x5c73cd=[];var _0x2625d0=[];var _0x3f3c5e={};var _0x4f0449=![];return db[_0x2857('0x71')][_0x2857('0x64')]()[_0x2857('0x1c')](function(_0x1af67a){if(!_0x1af67a){throw new db[(_0x2857('0x72'))]['ValidationError'](_0x2857('0x73'));}_0x5c73cd=_[_0x2857('0x74')](_[_0x2857('0x45')](_0x1af67a),[_0x2857('0x75'),'updatedAt']);_0x2625d0=_[_0x2857('0x74')](_[_0x2857('0x45')](_0x1af67a),['createdAt',_0x2857('0x76'),_0x2857('0x77'),_0x2857('0x78')]);if(_0x29f4ee['body']['id']){delete _0x29f4ee[_0x2857('0x63')]['id'];}if(_['isNil'](_0x29f4ee[_0x2857('0x63')][_0x2857('0x79')])){throw new db[(_0x2857('0x72'))]['ValidationError'](_0x2857('0x7a'));}if(_[_0x2857('0x7b')](_0x29f4ee['body'][_0x2857('0x63')])||_0x29f4ee[_0x2857('0x63')]['body']===''){throw new db[(_0x2857('0x72'))][(_0x2857('0x7c'))](_0x2857('0x7d'));}if(_[_0x2857('0x7b')](_0x29f4ee['body'][_0x2857('0x7e')])){throw new db[(_0x2857('0x72'))]['ValidationError'](_0x2857('0x7f')+_0x2625d0);}if(!_['includes'](_0x2625d0,_0x29f4ee['body'][_0x2857('0x7e')])){throw new db[(_0x2857('0x72'))][(_0x2857('0x7c'))](_0x2857('0x80')+_0x2625d0);}_0x3f3c5e[_0x29f4ee[_0x2857('0x63')][_0x2857('0x7e')]]=_0x29f4ee['body'][_0x2857('0x79')];})[_0x2857('0x1c')](function(){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x29f4ee[_0x2857('0x57')]['id']},'include':[{'model':db[_0x2857('0x81')],'as':'List','include':[{'model':db[_0x2857('0x71')],'as':'Contacts','where':_0x3f3c5e,'limit':0x1,'order':[[_0x2857('0x76'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x2857('0x1c')](handleEntityNotFound(_0x5299d3,null))[_0x2857('0x1c')](function(_0x4f9cb8){if(_0x4f9cb8&&_0x4f9cb8[_0x2857('0x82')]){_0x1f810b['account']=_0x4f9cb8;_0x1f810b['applications']=_0x4f9cb8[_0x2857('0x83')];_0x1f810b[_0x2857('0x84')]=_0x4f9cb8[_0x2857('0x82')];_0x1f810b[_0x2857('0x85')]=_[_0x2857('0x86')](_0x1f810b[_0x2857('0x85')],[_0x2857('0x87')],[_0x2857('0x88')]);if(_0x1f810b[_0x2857('0x89')]['Applications']){delete _0x1f810b['account'][_0x2857('0x83')];}if(_0x1f810b[_0x2857('0x89')][_0x2857('0x82')]&&_0x1f810b[_0x2857('0x89')][_0x2857('0x82')][_0x2857('0x8a')]['length']){return _0x1f810b[_0x2857('0x89')][_0x2857('0x82')]['Contacts'][0x0];}var _0x20cd3a=_['defaults'](_0x29f4ee['body'],{'firstName':_0x29f4ee[_0x2857('0x63')]['from'],'ListId':_0x4f9cb8['ListId']});_0x20cd3a[_0x29f4ee[_0x2857('0x63')][_0x2857('0x7e')]]=_0x29f4ee['body']['from'];return db[_0x2857('0x71')][_0x2857('0x5b')](_0x20cd3a,{'fields':_0x5c73cd,'raw':!![]});}})[_0x2857('0x1c')](handleEntityNotFound(_0x5299d3,null))[_0x2857('0x1c')](function(_0x36db44){_0x1f810b['contact']=_0x36db44;if(_0x36db44){var _0x3f7800={'ContactId':_0x36db44['id'],'OpenchannelAccountId':_0x29f4ee[_0x2857('0x57')]['id'],'from':(_0x36db44[_0x2857('0x8b')]||'')+'\x20'+(_0x36db44[_0x2857('0x8c')]||'')};var _0x5efb91={'OpenchannelAccountId':_0x29f4ee[_0x2857('0x57')]['id'],'closed':![]};if(_0x29f4ee[_0x2857('0x63')][_0x2857('0x8d')]){_0x5efb91[_0x2857('0x8d')]=_0x29f4ee['body']['threadId'];return db['OpenchannelInteraction'][_0x2857('0x60')]({'where':_0x5efb91})[_0x2857('0x1c')](function(_0x481d0a){if(_0x481d0a){return[_0x481d0a,![]];}_0x3f7800['threadId']=_0x29f4ee['body']['threadId'];_0x3f7800[_0x2857('0x8e')]=_0x29f4ee[_0x2857('0x63')][_0x2857('0x8e')];return db[_0x2857('0x8f')][_0x2857('0x5b')](_0x3f7800)[_0x2857('0x1c')](function(_0x4b8003){return[_0x4b8003,!![]];});});}else{_0x5efb91[_0x2857('0x8d')]=null;}_0x5efb91[_0x2857('0x90')]=_0x36db44['id'];return db[_0x2857('0x8f')][_0x2857('0x60')]({'where':_0x5efb91})['then'](function(_0xf1d066){if(_0xf1d066){return[_0xf1d066,![]];}return db['OpenchannelInteraction'][_0x2857('0x5b')](_0x3f7800)[_0x2857('0x1c')](function(_0x4475e7){return[_0x4475e7,!![]];});});}})[_0x2857('0x91')](function(_0x44e319,_0x333204){if(_0x44e319){_0x4f0449=_0x333204;if(!_0x333204){var _0x7c9676={'from':(_0x1f810b[_0x2857('0x92')][_0x2857('0x8b')]||'')+'\x20'+(_0x1f810b[_0x2857('0x92')][_0x2857('0x8c')]||'')};if(_0x29f4ee[_0x2857('0x63')][_0x2857('0x8d')]&&_0x29f4ee[_0x2857('0x63')][_0x2857('0x93')]&&_0x29f4ee[_0x2857('0x63')]['threadId']!=_0x29f4ee['body'][_0x2857('0x93')]){_0x7c9676[_0x2857('0x8d')]=_0x29f4ee[_0x2857('0x63')][_0x2857('0x93')];}return _0x44e319[_0x2857('0x33')](_0x7c9676);}else{return _0x44e319;}}})[_0x2857('0x1c')](function(_0x1a3ba6){_0x1f810b[_0x2857('0x94')]=_0x1a3ba6[_0x2857('0x35')]({'plain':!![]});_0x1f810b[_0x2857('0x94')][_0x2857('0x95')]=_0x4f0449;if(_0x1f810b[_0x2857('0x94')][_0x2857('0x95')]){if(_0x1f810b['account'][_0x2857('0x96')]){_0x1f810b[_0x2857('0x85')]['push']({'id':0x0,'priority':_0x1f810b[_0x2857('0x85')][_0x2857('0x59')]+0x1,'app':_0x2857('0x97'),'appdata':_0x2857('0x98'),'interval':_0x2857('0x99')});}}return db[_0x2857('0x9a')][_0x2857('0x5b')]({'body':_0x29f4ee[_0x2857('0x63')]['body'],'OpenchannelAccountId':_0x29f4ee[_0x2857('0x57')]['id'],'OpenchannelInteractionId':_0x1a3ba6['id'],'direction':'in','ContactId':_0x1f810b[_0x2857('0x92')]['id'],'AttachmentId':_0x29f4ee[_0x2857('0x63')][_0x2857('0x9b')]});})[_0x2857('0x1c')](function(_0x516903){_0x1f810b['message']=_0x516903;if(_0x1f810b[_0x2857('0x94')]['UserId']){return db[_0x2857('0x9c')][_0x2857('0x60')]({'attributes':['id',_0x2857('0x3a')],'where':{'id':_0x1f810b[_0x2857('0x94')][_0x2857('0x9d')]}})[_0x2857('0x1c')](function(_0x449617){if(_0x449617){_0x1f810b['applications'][_0x2857('0x9e')]({'id':0x0,'priority':0x0,'app':_0x2857('0x9f'),'appdata':_0x449617[_0x2857('0x3a')]+','+(_0x1f810b[_0x2857('0x89')][_0x2857('0xa0')]||0xa),'interval':_0x2857('0x99')});_0x1f810b[_0x2857('0xa1')]=![];}return respondWithRpcPromise(_0x2857('0xa2'),_0x2857('0xa3'),_0x1f810b);});}return respondWithRpcPromise(_0x2857('0xa2'),'startRouting',_0x1f810b);})[_0x2857('0x1c')](function(_0x343237){respondWithRpcPromise(_0x2857('0xa4'),_0x2857('0xa4'),{'event':_0x2857('0x6f'),'message':_0x343237},client9002);return _0x343237;})['then'](respondWithResult(_0x5299d3,null))[_0x2857('0x26')](handleError(_0x5299d3,null));};exports[_0x2857('0xa5')]=function(_0x1a0860,_0x3165fb,_0x24d9ec){return db['OpenchannelAccount'][_0x2857('0x68')]({'where':{'id':_0x1a0860['params']['id']}})['then'](handleEntityNotFound(_0x3165fb,null))[_0x2857('0x1c')](function(_0x1ac7d7){if(_0x1ac7d7){return db[_0x2857('0xa6')][_0x2857('0xa7')](function(_0x2db43f){return db[_0x2857('0xa8')][_0x2857('0x34')]({'where':{'OpenchannelAccountId':_0x1a0860['params']['id']},'transaction':_0x2db43f})[_0x2857('0x1c')](function(_0x572cfe){var _0x150052=_[_0x2857('0x3e')](_0x1a0860[_0x2857('0x63')],function(_0x53aff9){_0x53aff9['OpenchannelAccountId']=_0x1a0860[_0x2857('0x57')]['id'];return _0x53aff9;});return db[_0x2857('0xa8')]['bulkCreate'](_0x150052,{'transaction':_0x2db43f});});})[_0x2857('0x1c')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1a0860['params']['id']},'order':_0x2857('0x87')});});}})[_0x2857('0x1c')](respondWithResult(_0x3165fb,null))[_0x2857('0x26')](handleError(_0x3165fb,null));};exports[_0x2857('0xa9')]=function(_0x10bf7a,_0x554754,_0x5391bf){var _0x28218c={};var _0x4c7a9b={};var _0x54f460;var _0x823126;return db['OpenchannelAccount'][_0x2857('0x68')]({'where':{'id':_0x10bf7a[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x554754,null))['then'](function(_0x54a83e){if(_0x54a83e){_0x54f460=_0x54a83e;_0x4c7a9b[_0x2857('0x44')]=_[_0x2857('0x45')](db[_0x2857('0xa8')][_0x2857('0x40')]);_0x4c7a9b[_0x2857('0x46')]=_['keys'](_0x10bf7a[_0x2857('0x46')]);_0x4c7a9b[_0x2857('0x47')]=_['intersection'](_0x4c7a9b[_0x2857('0x44')],_0x4c7a9b[_0x2857('0x46')]);_0x28218c[_0x2857('0x48')]=_['intersection'](_0x4c7a9b[_0x2857('0x44')],qs[_0x2857('0x4a')](_0x10bf7a['query'][_0x2857('0x4a')]));_0x28218c[_0x2857('0x48')]=_0x28218c['attributes'][_0x2857('0x59')]?_0x28218c[_0x2857('0x48')]:_0x4c7a9b[_0x2857('0x44')];_0x28218c[_0x2857('0x4d')]=qs['sort'](_0x10bf7a[_0x2857('0x46')][_0x2857('0x4e')]);_0x28218c[_0x2857('0x4f')]=qs[_0x2857('0x47')](_[_0x2857('0x50')](_0x10bf7a['query'],_0x4c7a9b[_0x2857('0x47')]));if(_0x10bf7a[_0x2857('0x46')][_0x2857('0x53')]){_0x28218c[_0x2857('0x4f')]=_[_0x2857('0x51')](_0x28218c[_0x2857('0x4f')],{'$or':_['map'](_0x28218c[_0x2857('0x48')],function(_0x5bfdfc){var _0x51046b={};_0x51046b[_0x5bfdfc]={'$like':'%'+_0x10bf7a[_0x2857('0x46')][_0x2857('0x53')]+'%'};return _0x51046b;})});}_0x28218c=_[_0x2857('0x51')]({},_0x28218c,_0x10bf7a[_0x2857('0x54')]);return _0x54f460[_0x2857('0xa9')](_0x28218c);}})[_0x2857('0x1c')](function(_0xf43ba4){if(_0xf43ba4){_0x823126=_0xf43ba4[_0x2857('0x59')];if(!_0x10bf7a['query']['hasOwnProperty'](_0x2857('0x4c'))){_0x28218c[_0x2857('0x2d')]=qs['limit'](_0x10bf7a['query']['limit']);_0x28218c[_0x2857('0x2a')]=qs[_0x2857('0x2a')](_0x10bf7a[_0x2857('0x46')]['offset']);}return _0x54f460[_0x2857('0xa9')](_0x28218c);}})[_0x2857('0x1c')](function(_0x3bd6fd){if(_0x3bd6fd){return _0x3bd6fd?{'count':_0x823126,'rows':_0x3bd6fd}:null;}})[_0x2857('0x1c')](respondWithResult(_0x554754,null))[_0x2857('0x26')](handleError(_0x554754,null));};exports[_0x2857('0xaa')]=function(_0x2f5108,_0x403443,_0x2950dc){var _0x2f167a={'raw':![],'where':{}};var _0x4e57d4={};var _0x34d2c4={'count':0x0,'rows':[]};return db[_0x2857('0x3f')][_0x2857('0x68')]({'where':{'id':_0x2f5108['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x403443,null))['then'](function(_0x276a5e){if(_0x276a5e){_0x4e57d4['model']=_[_0x2857('0x45')](db['OpenchannelInteraction'][_0x2857('0x40')]);_0x4e57d4['query']=_[_0x2857('0x45')](_0x2f5108[_0x2857('0x46')]);_0x4e57d4[_0x2857('0x47')]=_[_0x2857('0x49')](_0x4e57d4[_0x2857('0x44')],_0x4e57d4[_0x2857('0x46')]);_0x2f167a[_0x2857('0x48')]=_[_0x2857('0x49')](_0x4e57d4['model'],qs[_0x2857('0x4a')](_0x2f5108[_0x2857('0x46')][_0x2857('0x4a')]));_0x2f167a[_0x2857('0x48')]=_0x2f167a[_0x2857('0x48')]['length']?_0x2f167a[_0x2857('0x48')]:_0x4e57d4[_0x2857('0x44')];if(!_0x2f5108[_0x2857('0x46')][_0x2857('0x4b')]('nolimit')){_0x2f167a[_0x2857('0x2d')]=qs[_0x2857('0x2d')](_0x2f5108['query']['limit']);_0x2f167a[_0x2857('0x2a')]=qs[_0x2857('0x2a')](_0x2f5108[_0x2857('0x46')][_0x2857('0x2a')]);}_0x2f167a['order']=qs[_0x2857('0x4e')](_0x2f5108[_0x2857('0x46')][_0x2857('0x4e')]);_0x2f167a[_0x2857('0x4f')]=qs[_0x2857('0x47')](_[_0x2857('0x50')](_0x2f5108[_0x2857('0x46')],_0x4e57d4[_0x2857('0x47')]));_0x2f167a[_0x2857('0x4f')][_0x2857('0x65')]=_0x276a5e['id'];if(_0x2f5108[_0x2857('0x46')][_0x2857('0x53')]){_0x2f167a['where']=_[_0x2857('0x51')](_0x2f167a[_0x2857('0x4f')],{'$or':_[_0x2857('0x3e')](_0x2f167a[_0x2857('0x48')],function(_0x565c22){var _0xd9243c={};_0xd9243c[_0x565c22]={'$like':'%'+_0x2f5108['query'][_0x2857('0x53')]+'%'};return _0xd9243c;})});}_0x2f167a=_[_0x2857('0x51')]({},_0x2f167a,_0x2f5108[_0x2857('0x54')]);return db[_0x2857('0x8f')][_0x2857('0x2c')]({'where':_0x2f167a[_0x2857('0x4f')]})[_0x2857('0x1c')](function(_0x42f5b3){_0x34d2c4['count']=_0x42f5b3;if(_0x2f5108[_0x2857('0x46')][_0x2857('0x5a')]){_0x2f167a[_0x2857('0x55')]=[{'model':db[_0x2857('0x71')],'as':_0x2857('0xab'),'required':![]},{'model':db[_0x2857('0x9c')],'as':'Owner','attributes':[_0x2857('0x3a'),_0x2857('0xac'),_0x2857('0xad')],'required':![]},{'model':db[_0x2857('0xae')],'as':_0x2857('0xaf'),'attributes':['id',_0x2857('0x3a'),_0x2857('0xb0')],'where':_0x2f5108[_0x2857('0x46')]['tag']?{'id':_0x2f5108[_0x2857('0x46')][_0x2857('0xb1')]}:undefined,'required':_0x2f5108[_0x2857('0x46')]['tag']?!![]:![]}];}return db[_0x2857('0x8f')]['findAll'](_0x2f167a);})[_0x2857('0x1c')](function(_0x55df4d){_0x34d2c4['rows']=_0x55df4d;return _0x34d2c4;});}})[_0x2857('0x1c')](respondWithFilteredResult(_0x403443,_0x2f167a))[_0x2857('0x26')](handleError(_0x403443,null));};exports[_0x2857('0xb2')]=function(_0x4a6ce4,_0x90ea0,_0x5d8b9d){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x4a6ce4['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x90ea0,null))[_0x2857('0x1c')](function(_0x19960f){if(_0x19960f){return _0x19960f[_0x2857('0xb2')](_0x4a6ce4[_0x2857('0x63')]['ids'],_[_0x2857('0xb3')](_0x4a6ce4[_0x2857('0x63')],['ids','id'])||{})['spread'](function(_0xdd63c9){for(var _0x385f7a=0x0;_0x385f7a<_0x4a6ce4[_0x2857('0x63')]['ids'][_0x2857('0x59')];_0x385f7a+=0x1){socket[_0x2857('0xb4')](_0x2857('0xb5'),{'UserId':Number(_0x4a6ce4['body'][_0x2857('0x6a')][_0x385f7a]),'OpenchannelAccountId':Number(_0x4a6ce4[_0x2857('0x57')]['id'])});}return _0xdd63c9;});}})[_0x2857('0x1c')](respondWithResult(_0x90ea0,null))['catch'](handleError(_0x90ea0,null));};exports[_0x2857('0xb6')]=function(_0x225766,_0x3ced61,_0x5b648f){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x225766[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x3ced61,null))[_0x2857('0x1c')](function(_0x39dce3){if(_0x39dce3){return _0x39dce3['removeAgents'](_0x225766[_0x2857('0x46')][_0x2857('0x6a')])['then'](function(){if(_[_0x2857('0xb7')](_0x225766[_0x2857('0x46')][_0x2857('0x6a')])){for(var _0x192d0b=0x0;_0x192d0b<_0x225766[_0x2857('0x46')][_0x2857('0x6a')][_0x2857('0x59')];_0x192d0b+=0x1){socket[_0x2857('0xb4')](_0x2857('0xb8'),{'UserId':Number(_0x225766[_0x2857('0x46')][_0x2857('0x6a')][_0x192d0b]),'OpenchannelAccountId':Number(_0x225766[_0x2857('0x57')]['id'])});}}else{socket[_0x2857('0xb4')](_0x2857('0xb8'),{'UserId':Number(_0x225766[_0x2857('0x46')]['ids']),'OpenchannelAccountId':Number(_0x225766[_0x2857('0x57')]['id'])});}});}})[_0x2857('0x1c')](respondWithStatusCode(_0x3ced61,null))['catch'](handleError(_0x3ced61,null));};exports['getAgents']=function(_0x46fde3,_0xb9dd08,_0x4bd581){var _0x5d7ba6={};var _0x114f27={};var _0x2549c5;var _0x4ea189;return db['OpenchannelAccount'][_0x2857('0x68')]({'where':{'id':_0x46fde3[_0x2857('0x57')]['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0xb9dd08,null))[_0x2857('0x1c')](function(_0x48c556){if(_0x48c556){_0x2549c5=_0x48c556;_0x114f27[_0x2857('0x44')]=_[_0x2857('0x45')](db['User']['rawAttributes']);_0x114f27['query']=_[_0x2857('0x45')](_0x46fde3[_0x2857('0x46')]);_0x114f27['filters']=_[_0x2857('0x49')](_0x114f27[_0x2857('0x44')],_0x114f27[_0x2857('0x46')]);_0x5d7ba6[_0x2857('0x48')]=_[_0x2857('0x49')](_0x114f27[_0x2857('0x44')],qs['fields'](_0x46fde3['query'][_0x2857('0x4a')]));_0x5d7ba6[_0x2857('0x48')]=_0x5d7ba6['attributes'][_0x2857('0x59')]?_0x5d7ba6[_0x2857('0x48')]:_0x114f27[_0x2857('0x44')];_0x5d7ba6[_0x2857('0x4d')]=qs[_0x2857('0x4e')](_0x46fde3['query'][_0x2857('0x4e')]);_0x5d7ba6[_0x2857('0x4f')]=qs[_0x2857('0x47')](_[_0x2857('0x50')](_0x46fde3['query'],_0x114f27['filters']));if(_0x46fde3[_0x2857('0x46')][_0x2857('0x53')]){_0x5d7ba6[_0x2857('0x4f')]=_[_0x2857('0x51')](_0x5d7ba6[_0x2857('0x4f')],{'$or':_['map'](_0x5d7ba6['attributes'],function(_0xc4dc85){var _0x4a3174={};_0x4a3174[_0xc4dc85]={'$like':'%'+_0x46fde3[_0x2857('0x46')]['filter']+'%'};return _0x4a3174;})});}_0x5d7ba6=_[_0x2857('0x51')]({},_0x5d7ba6,_0x46fde3[_0x2857('0x54')]);return _0x2549c5[_0x2857('0xb9')](_0x5d7ba6);}})[_0x2857('0x1c')](function(_0x2a89dd){if(_0x2a89dd){_0x4ea189=_0x2a89dd[_0x2857('0x59')];if(!_0x46fde3[_0x2857('0x46')][_0x2857('0x4b')](_0x2857('0x4c'))){_0x5d7ba6[_0x2857('0x2d')]=qs['limit'](_0x46fde3[_0x2857('0x46')][_0x2857('0x2d')]);_0x5d7ba6['offset']=qs[_0x2857('0x2a')](_0x46fde3['query'][_0x2857('0x2a')]);}return _0x2549c5[_0x2857('0xb9')](_0x5d7ba6);}})[_0x2857('0x1c')](function(_0x1cd731){if(_0x1cd731){return _0x1cd731?{'count':_0x4ea189,'rows':_0x1cd731}:null;}})[_0x2857('0x1c')](respondWithResult(_0xb9dd08,null))[_0x2857('0x26')](handleError(_0xb9dd08,null));};exports[_0x2857('0x3b')]=function(_0x3f8a21,_0x5da302,_0x8c5ca9){var _0x4fb07d,_0x286757,_0x5192db;if(_['isNil'](_0x3f8a21['body']['body'])||_0x3f8a21[_0x2857('0x63')][_0x2857('0x63')]===''){throw new db[(_0x2857('0x72'))][(_0x2857('0x7c'))](_0x2857('0x7d'));}if(_[_0x2857('0x7b')](_0x3f8a21[_0x2857('0x63')]['to'])){}_0x4fb07d=_0x3f8a21[_0x2857('0x63')]['to'];return db[_0x2857('0x3f')][_0x2857('0x68')]({'where':{'id':_0x3f8a21['params']['id']}})[_0x2857('0x1c')](handleEntityNotFound(_0x5da302,null))[_0x2857('0x1c')](function(_0x4e45e7){if(_0x4e45e7){return db[_0x2857('0x3f')][_0x2857('0x60')]({'where':{'id':_0x4e45e7['id']},'include':[{'model':db[_0x2857('0x81')],'as':_0x2857('0x82'),'include':[{'model':db[_0x2857('0x71')],'as':_0x2857('0x8a'),'where':{[_0x4e45e7[_0x2857('0x7e')]]:_0x4fb07d},'limit':0x1,'order':[[_0x2857('0x76'),_0x2857('0xba')]]}]}]})[_0x2857('0x1c')](handleEntityNotFound(_0x5da302,null))[_0x2857('0x1c')](function(_0x3201e0){if(_0x3201e0&&_0x3201e0[_0x2857('0x82')]){_0x286757=_0x3201e0[_0x2857('0x35')]({'plain':!![]});if(_0x286757[_0x2857('0x82')]&&_0x286757[_0x2857('0x82')]['Contacts'][_0x2857('0x59')]){return _0x286757[_0x2857('0x82')][_0x2857('0x8a')][0x0];}return db['CmContact'][_0x2857('0x5b')](_[_0x2857('0x17')](_0x3f8a21[_0x2857('0x63')],{'firstName':_0x4fb07d,[_0x3201e0['mapKey']]:_0x4fb07d,'phone':_0x4fb07d,'ListId':_0x286757[_0x2857('0x78')]}));}})['then'](handleEntityNotFound(_0x5da302,null))['then'](function(_0x290c9c){if(_0x290c9c){_0x5192db=_0x290c9c;return db[_0x2857('0x8f')]['find']({'where':{'ContactId':_0x5192db['id'],'closed':![],'OpenchannelAccountId':_0x286757['id']}})[_0x2857('0x1c')](function(_0x19a768){if(_0x19a768){return[_0x19a768,![]];}return db[_0x2857('0x8f')]['create']({'UserId':_0x3f8a21[_0x2857('0x5c')]['id'],'ContactId':_0x5192db['id'],'OpenchannelAccountId':_0x286757['id'],'lastMsgDirection':_0x2857('0xbb'),'Messages':[_['merge'](_0x3f8a21[_0x2857('0x63')],{'read':![],'body':_0x3f8a21['body'][_0x2857('0x63')],'OpenchannelAccountId':_0x286757['id'],'UserId':_0x3f8a21[_0x2857('0x5c')]['id'],'ContactId':_0x5192db['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x2857('0xbc')}]})['then'](function(_0x559b01){return[_0x559b01,!![]];});});}})[_0x2857('0x91')](function(_0x453ba7,_0x4db466){if(_0x4db466){return _0x453ba7;}return db[_0x2857('0x9a')]['create'](_['merge'](_0x3f8a21[_0x2857('0x63')],{'read':![],'body':_0x3f8a21['body']['body'],'OpenchannelAccountId':_0x286757['id'],'OpenchannelInteractionId':_0x453ba7['id'],'UserId':_0x3f8a21[_0x2857('0x5c')]['id'],'ContactId':_0x5192db['id']}))[_0x2857('0x1c')](function(_0x58869a){_0x453ba7['dataValues'][_0x2857('0xbc')]=[];_0x453ba7[_0x2857('0xbd')][_0x2857('0xbc')][_0x2857('0xbe')](_0x58869a[_0x2857('0xbd')]);return _0x453ba7;});});}})[_0x2857('0x1c')](respondWithResult(_0x5da302,null))[_0x2857('0x26')](handleError(_0x5da302,null));}; \ No newline at end of file +var _0xb063=['count','offset','limit','Content-Range','apply','reject','save','then','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','stack','index','map','OpenchannelAccount','rawAttributes','type','key','model','name','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','Pause','mandatoryDispositionPause','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','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','from','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','asc','contact','threadId','externalUrl','OpenchannelInteraction','spread','firstName','lastName','messageId','interaction','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','Contact','Owner','internal','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','CmList','DESC','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','undefined'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xb063,0x14f));var _0x3b06=function(_0x2101f2,_0x120c2b){_0x2101f2=_0x2101f2-0x0;var _0x47e643=_0xb063[_0x2101f2];return _0x47e643;};'use strict';var emlformat=require(_0x3b06('0x0'));var rimraf=require(_0x3b06('0x1'));var zipdir=require(_0x3b06('0x2'));var jsonpatch=require(_0x3b06('0x3'));var rp=require(_0x3b06('0x4'));var moment=require(_0x3b06('0x5'));var BPromise=require(_0x3b06('0x6'));var Mustache=require(_0x3b06('0x7'));var util=require(_0x3b06('0x8'));var path=require(_0x3b06('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3b06('0xa'));var fs=require('fs');var fs_extra=require(_0x3b06('0xb'));var _=require(_0x3b06('0xc'));var squel=require(_0x3b06('0xd'));var crypto=require(_0x3b06('0xe'));var jsforce=require(_0x3b06('0xf'));var deskjs=require(_0x3b06('0x10'));var toCsv=require(_0x3b06('0x11'));var querystring=require(_0x3b06('0x12'));var Papa=require(_0x3b06('0x13'));var Redis=require(_0x3b06('0x14'));var authService=require(_0x3b06('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x3b06('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b06('0x17'))('api');var utils=require(_0x3b06('0x18'));var config=require(_0x3b06('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b06('0x1a'))['db'];config[_0x3b06('0x1b')]=_[_0x3b06('0x1c')](config[_0x3b06('0x1b')],{'host':_0x3b06('0x1d'),'port':0x18eb});var socket=require(_0x3b06('0x1e'))(new Redis(config[_0x3b06('0x1b')]));require(_0x3b06('0x1f'))[_0x3b06('0x20')](socket);var jayson=require(_0x3b06('0x21'));var client=jayson['client'][_0x3b06('0x22')]({'port':0x232c});var client9002=jayson[_0x3b06('0x23')][_0x3b06('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x26a707,_0x49ea51,_0x1de679,_0x47c287){return new BPromise(function(_0x48ce75,_0x11094e){var _0x594a97=_0x47c287||client;return _0x594a97[_0x3b06('0x24')](_0x26a707,_0x1de679)['then'](function(_0x1adf0c){logger[_0x3b06('0x25')](_0x3b06('0x26'),_0x49ea51,_0x3b06('0x27'));logger[_0x3b06('0x28')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x49ea51,'request\x20sent',JSON[_0x3b06('0x29')](_0x1adf0c));if(_0x1adf0c[_0x3b06('0x2a')]){if(_0x1adf0c[_0x3b06('0x2a')][_0x3b06('0x2b')]===0x1f4){logger[_0x3b06('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x49ea51,_0x1adf0c[_0x3b06('0x2a')]['message']);return _0x11094e(_0x1adf0c['error']['message']);}logger[_0x3b06('0x2a')](_0x3b06('0x26'),_0x49ea51,_0x1adf0c[_0x3b06('0x2a')][_0x3b06('0x2c')]);return _0x48ce75(_0x1adf0c[_0x3b06('0x2a')][_0x3b06('0x2c')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x49ea51,_0x3b06('0x27'));_0x48ce75(_0x1adf0c[_0x3b06('0x2d')]['message']);}})[_0x3b06('0x2e')](function(_0x45381b){logger[_0x3b06('0x2a')](_0x3b06('0x26'),_0x49ea51,_0x45381b);_0x11094e(_0x45381b);});});}function respondWithStatusCode(_0x1265bc,_0x17b05d){_0x17b05d=_0x17b05d||0xcc;return function(_0x2cf383){if(_0x2cf383){return _0x1265bc['sendStatus'](_0x17b05d);}return _0x1265bc[_0x3b06('0x2f')](_0x17b05d)[_0x3b06('0x30')]();};}function respondWithResult(_0x57482c,_0x3217b0){_0x3217b0=_0x3217b0||0xc8;return function(_0x5a3afe){if(_0x5a3afe){return _0x57482c[_0x3b06('0x2f')](_0x3217b0)[_0x3b06('0x31')](_0x5a3afe);}};}function respondWithFilteredResult(_0x39847a,_0x2c9251){return function(_0x279a95){if(_0x279a95){var _0x3262e3=typeof _0x2c9251['offset']===_0x3b06('0x32')&&typeof _0x2c9251['limit']===_0x3b06('0x32');var _0x257ce1=_0x279a95[_0x3b06('0x33')];var _0xfc4b6=_0x3262e3?0x0:_0x2c9251[_0x3b06('0x34')];var _0x221a19=_0x3262e3?_0x279a95[_0x3b06('0x33')]:_0x2c9251[_0x3b06('0x34')]+_0x2c9251[_0x3b06('0x35')];var _0x77d7eb;if(_0x221a19>=_0x257ce1){_0x221a19=_0x257ce1;_0x77d7eb=0xc8;}else{_0x77d7eb=0xce;}_0x39847a[_0x3b06('0x2f')](_0x77d7eb);return _0x39847a['set'](_0x3b06('0x36'),_0xfc4b6+'-'+_0x221a19+'/'+_0x257ce1)[_0x3b06('0x31')](_0x279a95);}return null;};}function patchUpdates(_0x3cac04){return function(_0x1b329b){try{jsonpatch[_0x3b06('0x37')](_0x1b329b,_0x3cac04,!![]);}catch(_0x57b7c7){return BPromise[_0x3b06('0x38')](_0x57b7c7);}return _0x1b329b[_0x3b06('0x39')]();};}function saveUpdates(_0x50bd09,_0xca3438){return function(_0x3039f6){if(_0x3039f6){return _0x3039f6['update'](_0x50bd09)[_0x3b06('0x3a')](function(_0x2ad0cd){return _0x2ad0cd;});}return null;};}function removeEntity(_0x12920b,_0x1d1d20){return function(_0x3665db){if(_0x3665db){return _0x3665db['destroy']()['then'](function(){var _0x1bb88b=_0x3665db[_0x3b06('0x3b')]({'plain':!![]});var _0x3a0354=_0x3b06('0x3c');return db[_0x3b06('0x3d')][_0x3b06('0x3e')]({'where':{'type':_0x3a0354,'resourceId':_0x1bb88b['id']}})[_0x3b06('0x3a')](function(){return _0x3665db;});})['then'](function(){_0x12920b[_0x3b06('0x2f')](0xcc)[_0x3b06('0x30')]();});}};}function handleEntityNotFound(_0x21bdc5,_0x310edd){return function(_0x3e76c1){if(!_0x3e76c1){_0x21bdc5[_0x3b06('0x3f')](0x194);}return _0x3e76c1;};}function handleError(_0x5782da,_0x44233f){_0x44233f=_0x44233f||0x1f4;return function(_0x4543f4){logger[_0x3b06('0x2a')](_0x4543f4[_0x3b06('0x40')]);if(_0x4543f4['name']){delete _0x4543f4['name'];}_0x5782da['status'](_0x44233f)['send'](_0x4543f4);};}exports[_0x3b06('0x41')]=function(_0x15940a,_0x2e91c3){var _0x42b294={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x42375b={},_0x2bf5c6={'count':0x0,'rows':[]};var _0x46d86d=_[_0x3b06('0x42')](db[_0x3b06('0x43')][_0x3b06('0x44')],function(_0x3def45){return{'name':_0x3def45['fieldName'],'type':_0x3def45[_0x3b06('0x45')][_0x3b06('0x46')]};});_0x42375b[_0x3b06('0x47')]=_['map'](_0x46d86d,_0x3b06('0x48'));_0x42375b['query']=_[_0x3b06('0x49')](_0x15940a[_0x3b06('0x4a')]);_0x42375b[_0x3b06('0x4b')]=_['intersection'](_0x42375b['model'],_0x42375b[_0x3b06('0x4a')]);_0x42b294[_0x3b06('0x4c')]=_[_0x3b06('0x4d')](_0x42375b[_0x3b06('0x47')],qs[_0x3b06('0x4e')](_0x15940a['query'][_0x3b06('0x4e')]));_0x42b294[_0x3b06('0x4c')]=_0x42b294['attributes'][_0x3b06('0x4f')]?_0x42b294[_0x3b06('0x4c')]:_0x42375b['model'];if(!_0x15940a['query'][_0x3b06('0x50')](_0x3b06('0x51'))){_0x42b294['limit']=qs['limit'](_0x15940a[_0x3b06('0x4a')][_0x3b06('0x35')]);_0x42b294[_0x3b06('0x34')]=qs[_0x3b06('0x34')](_0x15940a[_0x3b06('0x4a')]['offset']);}_0x42b294[_0x3b06('0x52')]=qs['sort'](_0x15940a['query'][_0x3b06('0x53')]);_0x42b294[_0x3b06('0x54')]=qs[_0x3b06('0x4b')](_[_0x3b06('0x55')](_0x15940a[_0x3b06('0x4a')],_0x42375b['filters']),_0x46d86d);if(_0x15940a[_0x3b06('0x4a')][_0x3b06('0x56')]){_0x42b294[_0x3b06('0x54')]=_[_0x3b06('0x57')](_0x42b294[_0x3b06('0x54')],{'$or':_['map'](_0x46d86d,function(_0x4faa1b){if(_0x4faa1b[_0x3b06('0x45')]!==_0x3b06('0x58')){var _0x36f2f9={};_0x36f2f9[_0x4faa1b['name']]={'$like':'%'+_0x15940a['query'][_0x3b06('0x56')]+'%'};return _0x36f2f9;}})});}_0x42b294=_[_0x3b06('0x57')]({},_0x42b294,_0x15940a[_0x3b06('0x59')]);var _0x1565bd={'where':_0x42b294['where']};return db['OpenchannelAccount'][_0x3b06('0x33')](_0x1565bd)['then'](function(_0x2cd7b8){_0x2bf5c6[_0x3b06('0x33')]=_0x2cd7b8;if(_0x15940a['query'][_0x3b06('0x5a')]){_0x42b294[_0x3b06('0x5b')]=[{'all':!![]}];}return db[_0x3b06('0x43')][_0x3b06('0x5c')](_0x42b294);})['then'](function(_0x502cb0){_0x2bf5c6['rows']=_0x502cb0;return _0x2bf5c6;})[_0x3b06('0x3a')](respondWithFilteredResult(_0x2e91c3,_0x42b294))['catch'](handleError(_0x2e91c3,null));};exports[_0x3b06('0x5d')]=function(_0x296800,_0x3338da){var _0x33df0b={'raw':![],'where':{'id':_0x296800[_0x3b06('0x5e')]['id']},'include':[{'model':db[_0x3b06('0x5f')],'as':_0x3b06('0x60')}]},_0x4ffbb6={};_0x4ffbb6['model']=_[_0x3b06('0x49')](db[_0x3b06('0x43')][_0x3b06('0x44')]);_0x4ffbb6[_0x3b06('0x4a')]=_[_0x3b06('0x49')](_0x296800[_0x3b06('0x4a')]);_0x4ffbb6[_0x3b06('0x4b')]=_[_0x3b06('0x4d')](_0x4ffbb6[_0x3b06('0x47')],_0x4ffbb6[_0x3b06('0x4a')]);_0x33df0b['attributes']=_[_0x3b06('0x4d')](_0x4ffbb6[_0x3b06('0x47')],qs[_0x3b06('0x4e')](_0x296800[_0x3b06('0x4a')][_0x3b06('0x4e')]));_0x33df0b[_0x3b06('0x4c')]=_0x33df0b['attributes']['length']?_0x33df0b[_0x3b06('0x4c')]:_0x4ffbb6[_0x3b06('0x47')];if(_0x296800['query'][_0x3b06('0x5a')]){_0x33df0b['include']=[{'all':!![]}];}_0x33df0b=_['merge']({},_0x33df0b,_0x296800['options']);return db[_0x3b06('0x43')]['find'](_0x33df0b)[_0x3b06('0x3a')](handleEntityNotFound(_0x3338da,null))[_0x3b06('0x3a')](respondWithResult(_0x3338da,null))[_0x3b06('0x2e')](handleError(_0x3338da,null));};exports[_0x3b06('0x61')]=function(_0x321420,_0x571038){return db[_0x3b06('0x43')][_0x3b06('0x61')](_0x321420[_0x3b06('0x62')],{})[_0x3b06('0x3a')](function(_0x100746){var _0x55f6dd=_0x321420[_0x3b06('0x63')][_0x3b06('0x3b')]({'plain':!![]});if(!_0x55f6dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55f6dd[_0x3b06('0x64')]===_0x3b06('0x63')){var _0x5bcde8=_0x100746[_0x3b06('0x3b')]({'plain':!![]});var _0x3f45b0=_0x3b06('0x3c');return db['UserProfileSection']['find']({'where':{'name':_0x3f45b0,'userProfileId':_0x55f6dd['userProfileId']},'raw':!![]})[_0x3b06('0x3a')](function(_0xa5dcff){if(_0xa5dcff&&_0xa5dcff[_0x3b06('0x65')]===0x0){return db[_0x3b06('0x3d')]['create']({'name':_0x5bcde8[_0x3b06('0x48')],'resourceId':_0x5bcde8['id'],'type':_0xa5dcff[_0x3b06('0x48')],'sectionId':_0xa5dcff['id']},{})['then'](function(){return _0x100746;});}else{return _0x100746;}})[_0x3b06('0x2e')](function(_0x21569f){logger[_0x3b06('0x2a')](_0x3b06('0x66'),_0x21569f);throw _0x21569f;});}return _0x100746;})[_0x3b06('0x3a')](respondWithResult(_0x571038,0xc9))['catch'](handleError(_0x571038,null));};exports[_0x3b06('0x67')]=function(_0x4efb97,_0x119664){if(_0x4efb97['body']['id']){delete _0x4efb97[_0x3b06('0x62')]['id'];}return db[_0x3b06('0x43')]['find']({'where':{'id':_0x4efb97[_0x3b06('0x5e')]['id']},'include':[{'model':db[_0x3b06('0x5f')],'as':'mandatoryDispositionPause'}]})[_0x3b06('0x3a')](handleEntityNotFound(_0x119664,null))[_0x3b06('0x3a')](saveUpdates(_0x4efb97[_0x3b06('0x62')],null))[_0x3b06('0x3a')](respondWithResult(_0x119664,null))[_0x3b06('0x2e')](handleError(_0x119664,null));};exports[_0x3b06('0x3e')]=function(_0x56a8c2,_0x5e28d){return db[_0x3b06('0x43')][_0x3b06('0x68')]({'where':{'id':_0x56a8c2[_0x3b06('0x5e')]['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x5e28d,null))[_0x3b06('0x3a')](removeEntity(_0x5e28d,null))[_0x3b06('0x2e')](handleError(_0x5e28d,null));};exports[_0x3b06('0x69')]=function(_0x36dc7a,_0x55c70d){return db['OpenchannelAccount'][_0x3b06('0x69')]()['then'](respondWithResult(_0x55c70d,null))[_0x3b06('0x2e')](handleError(_0x55c70d,null));};exports[_0x3b06('0x6a')]=function(_0x2403be,_0x2ff307,_0x519f4b){if(_0x2403be['body']['id']){delete _0x2403be['body']['id'];}return db['OpenchannelAccount'][_0x3b06('0x68')]({'where':{'id':_0x2403be['params']['id']}})['then'](handleEntityNotFound(_0x2ff307,null))['then'](function(_0x48e649){if(_0x48e649){_0x2403be[_0x3b06('0x62')][_0x3b06('0x6b')]=_0x48e649['id'];return db[_0x3b06('0x6c')][_0x3b06('0x61')](_0x2403be[_0x3b06('0x62')]);}})[_0x3b06('0x3a')](respondWithResult(_0x2ff307,null))[_0x3b06('0x2e')](handleError(_0x2ff307,null));};exports[_0x3b06('0x6d')]=function(_0x37d24,_0x14e007,_0x585db6){var _0x11fc17={'raw':![],'where':{}};var _0x415b35={};var _0x543b16={'count':0x0,'rows':[]};return db[_0x3b06('0x43')][_0x3b06('0x6e')]({'where':{'id':_0x37d24[_0x3b06('0x5e')]['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x14e007,null))[_0x3b06('0x3a')](function(_0x11e3c2){if(_0x11e3c2){_0x415b35[_0x3b06('0x47')]=_['keys'](db[_0x3b06('0x6c')][_0x3b06('0x44')]);_0x415b35[_0x3b06('0x4a')]=_[_0x3b06('0x49')](_0x37d24[_0x3b06('0x4a')]);_0x415b35['filters']=_[_0x3b06('0x4d')](_0x415b35[_0x3b06('0x47')],_0x415b35[_0x3b06('0x4a')]);_0x11fc17[_0x3b06('0x4c')]=_[_0x3b06('0x4d')](_0x415b35[_0x3b06('0x47')],qs[_0x3b06('0x4e')](_0x37d24['query']['fields']));_0x11fc17[_0x3b06('0x4c')]=_0x11fc17['attributes'][_0x3b06('0x4f')]?_0x11fc17['attributes']:_0x415b35[_0x3b06('0x47')];if(!_0x37d24[_0x3b06('0x4a')][_0x3b06('0x50')]('nolimit')){_0x11fc17[_0x3b06('0x35')]=qs['limit'](_0x37d24[_0x3b06('0x4a')][_0x3b06('0x35')]);_0x11fc17[_0x3b06('0x34')]=qs[_0x3b06('0x34')](_0x37d24[_0x3b06('0x4a')]['offset']);}_0x11fc17[_0x3b06('0x52')]=qs[_0x3b06('0x53')](_0x37d24['query']['sort']);_0x11fc17['where']=qs['filters'](_[_0x3b06('0x55')](_0x37d24[_0x3b06('0x4a')],_0x415b35[_0x3b06('0x4b')]));_0x11fc17[_0x3b06('0x54')]['OpenchannelAccountId']=_0x11e3c2['id'];if(_0x37d24[_0x3b06('0x4a')][_0x3b06('0x56')]){_0x11fc17[_0x3b06('0x54')]=_['merge'](_0x11fc17['where'],{'$or':_['map'](_0x11fc17[_0x3b06('0x4c')],function(_0x404482){var _0x1379b4={};_0x1379b4[_0x404482]={'$like':'%'+_0x37d24[_0x3b06('0x4a')][_0x3b06('0x56')]+'%'};return _0x1379b4;})});}_0x11fc17=_['merge']({},_0x11fc17,_0x37d24['options']);return db[_0x3b06('0x6c')][_0x3b06('0x33')]({'where':_0x11fc17['where']})['then'](function(_0x2bf63f){_0x543b16[_0x3b06('0x33')]=_0x2bf63f;if(_0x37d24[_0x3b06('0x4a')]['includeAll']){_0x11fc17['include']=[{'all':!![]}];}return db[_0x3b06('0x6c')][_0x3b06('0x5c')](_0x11fc17);})[_0x3b06('0x3a')](function(_0x110a2e){_0x543b16[_0x3b06('0x6f')]=_0x110a2e;return _0x543b16;});}})[_0x3b06('0x3a')](respondWithFilteredResult(_0x14e007,_0x11fc17))[_0x3b06('0x2e')](handleError(_0x14e007,null));};exports[_0x3b06('0x70')]=function(_0x1fa295,_0x5473f3,_0x167c95){return db[_0x3b06('0x43')][_0x3b06('0x68')]({'where':{'id':_0x1fa295[_0x3b06('0x5e')]['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x5473f3,null))[_0x3b06('0x3a')](function(_0x67b432){if(_0x67b432){return _0x67b432[_0x3b06('0x70')](_0x1fa295[_0x3b06('0x4a')][_0x3b06('0x71')]);}})[_0x3b06('0x3a')](respondWithStatusCode(_0x5473f3,null))[_0x3b06('0x2e')](handleError(_0x5473f3,null));};exports[_0x3b06('0x72')]=function(_0x422bfe,_0xbc9224,_0x528579){if(_0x422bfe['body']['id']){delete _0x422bfe[_0x3b06('0x62')]['id'];}return db[_0x3b06('0x43')][_0x3b06('0x68')]({'where':{'id':_0x422bfe[_0x3b06('0x5e')]['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0xbc9224,null))[_0x3b06('0x3a')](function(_0x6382bc){if(_0x6382bc){_0x422bfe[_0x3b06('0x62')]['OpenchannelAccountId']=_0x6382bc['id'];return db[_0x3b06('0x73')][_0x3b06('0x61')](_0x422bfe[_0x3b06('0x62')]);}})[_0x3b06('0x3a')](respondWithResult(_0xbc9224,null))[_0x3b06('0x2e')](handleError(_0xbc9224,null));};exports[_0x3b06('0x74')]=function(_0x412e95,_0x53ba34,_0x46da22){var _0x16e84a={'raw':![],'where':{}};var _0x4c38b7={};var _0x680b34={'count':0x0,'rows':[]};return db[_0x3b06('0x43')]['findOne']({'where':{'id':_0x412e95['params']['id']}})['then'](handleEntityNotFound(_0x53ba34,null))[_0x3b06('0x3a')](function(_0x2b2e7d){if(_0x2b2e7d){_0x4c38b7['model']=_[_0x3b06('0x49')](db[_0x3b06('0x73')][_0x3b06('0x44')]);_0x4c38b7[_0x3b06('0x4a')]=_['keys'](_0x412e95[_0x3b06('0x4a')]);_0x4c38b7[_0x3b06('0x4b')]=_[_0x3b06('0x4d')](_0x4c38b7['model'],_0x4c38b7[_0x3b06('0x4a')]);_0x16e84a[_0x3b06('0x4c')]=_[_0x3b06('0x4d')](_0x4c38b7[_0x3b06('0x47')],qs[_0x3b06('0x4e')](_0x412e95[_0x3b06('0x4a')][_0x3b06('0x4e')]));_0x16e84a[_0x3b06('0x4c')]=_0x16e84a[_0x3b06('0x4c')][_0x3b06('0x4f')]?_0x16e84a[_0x3b06('0x4c')]:_0x4c38b7['model'];if(!_0x412e95['query']['hasOwnProperty']('nolimit')){_0x16e84a['limit']=qs[_0x3b06('0x35')](_0x412e95[_0x3b06('0x4a')][_0x3b06('0x35')]);_0x16e84a[_0x3b06('0x34')]=qs['offset'](_0x412e95[_0x3b06('0x4a')][_0x3b06('0x34')]);}_0x16e84a[_0x3b06('0x52')]=qs['sort'](_0x412e95[_0x3b06('0x4a')][_0x3b06('0x53')]);_0x16e84a['where']=qs[_0x3b06('0x4b')](_[_0x3b06('0x55')](_0x412e95[_0x3b06('0x4a')],_0x4c38b7[_0x3b06('0x4b')]));_0x16e84a[_0x3b06('0x54')][_0x3b06('0x6b')]=_0x2b2e7d['id'];if(_0x412e95[_0x3b06('0x4a')][_0x3b06('0x56')]){_0x16e84a[_0x3b06('0x54')]=_[_0x3b06('0x57')](_0x16e84a[_0x3b06('0x54')],{'$or':_['map'](_0x16e84a[_0x3b06('0x4c')],function(_0x55e4b8){var _0x3d6ad6={};_0x3d6ad6[_0x55e4b8]={'$like':'%'+_0x412e95['query'][_0x3b06('0x56')]+'%'};return _0x3d6ad6;})});}_0x16e84a=_[_0x3b06('0x57')]({},_0x16e84a,_0x412e95[_0x3b06('0x59')]);return db['CannedAnswer'][_0x3b06('0x33')]({'where':_0x16e84a[_0x3b06('0x54')]})['then'](function(_0x578055){_0x680b34['count']=_0x578055;if(_0x412e95[_0x3b06('0x4a')][_0x3b06('0x5a')]){_0x16e84a[_0x3b06('0x5b')]=[{'all':!![]}];}return db[_0x3b06('0x73')][_0x3b06('0x5c')](_0x16e84a);})[_0x3b06('0x3a')](function(_0x224cc9){_0x680b34[_0x3b06('0x6f')]=_0x224cc9;return _0x680b34;});}})[_0x3b06('0x3a')](respondWithFilteredResult(_0x53ba34,_0x16e84a))[_0x3b06('0x2e')](handleError(_0x53ba34,null));};exports[_0x3b06('0x75')]=function(_0x4a6eca,_0x106976,_0xc181a2){return db[_0x3b06('0x43')]['find']({'where':{'id':_0x4a6eca['params']['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x106976,null))[_0x3b06('0x3a')](function(_0xf8fb3f){if(_0xf8fb3f){return _0xf8fb3f[_0x3b06('0x75')](_0x4a6eca['query'][_0x3b06('0x71')]);}})[_0x3b06('0x3a')](respondWithStatusCode(_0x106976,null))[_0x3b06('0x2e')](handleError(_0x106976,null));};exports[_0x3b06('0x76')]=function(_0x5b4d13,_0x4a9747,_0x430972){var _0x3e8a21={'body':_0x5b4d13[_0x3b06('0x62')],'channel':'openchannel'};var _0x54c446=[];var _0x187a1d=[];var _0x2f5641={};var _0x19c378=![];return db[_0x3b06('0x77')][_0x3b06('0x69')]()[_0x3b06('0x3a')](function(_0x3e23b9){if(!_0x3e23b9){throw new db[(_0x3b06('0x78'))][(_0x3b06('0x79'))](_0x3b06('0x7a'));}_0x54c446=_[_0x3b06('0x7b')](_[_0x3b06('0x49')](_0x3e23b9),[_0x3b06('0x7c'),_0x3b06('0x7d')]);_0x187a1d=_[_0x3b06('0x7b')](_['keys'](_0x3e23b9),[_0x3b06('0x7c'),_0x3b06('0x7d'),_0x3b06('0x7e'),_0x3b06('0x7f')]);if(_0x5b4d13[_0x3b06('0x62')]['id']){delete _0x5b4d13[_0x3b06('0x62')]['id'];}if(_['isNil'](_0x5b4d13['body']['from'])){throw new db[(_0x3b06('0x78'))][(_0x3b06('0x79'))](_0x3b06('0x80'));}if(_[_0x3b06('0x81')](_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x62')])||_0x5b4d13[_0x3b06('0x62')]['body']===''){throw new db['Sequelize'][(_0x3b06('0x79'))](_0x3b06('0x82'));}if(_[_0x3b06('0x81')](_0x5b4d13['body'][_0x3b06('0x83')])){throw new db[(_0x3b06('0x78'))][(_0x3b06('0x79'))](_0x3b06('0x84')+_0x187a1d);}if(!_['includes'](_0x187a1d,_0x5b4d13['body']['mapKey'])){throw new db['Sequelize'][(_0x3b06('0x79'))](_0x3b06('0x85')+_0x187a1d);}_0x2f5641[_0x5b4d13[_0x3b06('0x62')]['mapKey']]=_0x5b4d13['body'][_0x3b06('0x86')];})[_0x3b06('0x3a')](function(){return db[_0x3b06('0x43')]['find']({'where':{'id':_0x5b4d13[_0x3b06('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0x3b06('0x87'),'include':[{'model':db[_0x3b06('0x77')],'as':_0x3b06('0x88'),'where':_0x2f5641,'limit':0x1,'order':[[_0x3b06('0x7d'),'DESC']]}]},{'model':db[_0x3b06('0x89')],'as':_0x3b06('0x8a')}]});})[_0x3b06('0x3a')](handleEntityNotFound(_0x4a9747,null))[_0x3b06('0x3a')](function(_0x1cbf9a){if(_0x1cbf9a&&_0x1cbf9a[_0x3b06('0x87')]){_0x3e8a21[_0x3b06('0x8b')]=_0x1cbf9a;_0x3e8a21[_0x3b06('0x8c')]=_0x1cbf9a[_0x3b06('0x8a')];_0x3e8a21[_0x3b06('0x8d')]=_0x1cbf9a[_0x3b06('0x87')];_0x3e8a21['applications']=_[_0x3b06('0x8e')](_0x3e8a21[_0x3b06('0x8c')],['priority'],[_0x3b06('0x8f')]);if(_0x3e8a21[_0x3b06('0x8b')][_0x3b06('0x8a')]){delete _0x3e8a21[_0x3b06('0x8b')]['Applications'];}if(_0x3e8a21[_0x3b06('0x8b')][_0x3b06('0x87')]&&_0x3e8a21['account']['List']['Contacts'][_0x3b06('0x4f')]){return _0x3e8a21[_0x3b06('0x8b')]['List'][_0x3b06('0x88')][0x0];}var _0x7141a6=_[_0x3b06('0x1c')](_0x5b4d13[_0x3b06('0x62')],{'firstName':_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x86')],'ListId':_0x1cbf9a['ListId']});_0x7141a6[_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x83')]]=_0x5b4d13[_0x3b06('0x62')]['from'];return db['CmContact']['create'](_0x7141a6,{'fields':_0x54c446,'raw':!![]});}})[_0x3b06('0x3a')](handleEntityNotFound(_0x4a9747,null))[_0x3b06('0x3a')](function(_0x23e241){_0x3e8a21[_0x3b06('0x90')]=_0x23e241;if(_0x23e241){var _0x2102f2={'ContactId':_0x23e241['id'],'OpenchannelAccountId':_0x5b4d13[_0x3b06('0x5e')]['id'],'from':(_0x23e241['firstName']||'')+'\x20'+(_0x23e241['lastName']||'')};var _0x3fa00d={'OpenchannelAccountId':_0x5b4d13['params']['id'],'closed':![]};if(_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x91')]){_0x3fa00d[_0x3b06('0x91')]=_0x5b4d13[_0x3b06('0x62')]['threadId'];return db['OpenchannelInteraction'][_0x3b06('0x68')]({'where':_0x3fa00d})[_0x3b06('0x3a')](function(_0x51ffab){if(_0x51ffab){return[_0x51ffab,![]];}_0x2102f2[_0x3b06('0x91')]=_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x91')];_0x2102f2['externalUrl']=_0x5b4d13['body'][_0x3b06('0x92')];return db[_0x3b06('0x93')][_0x3b06('0x61')](_0x2102f2)[_0x3b06('0x3a')](function(_0x3e991c){return[_0x3e991c,!![]];});});}else{_0x3fa00d['threadId']=null;}_0x3fa00d['ContactId']=_0x23e241['id'];return db[_0x3b06('0x93')][_0x3b06('0x68')]({'where':_0x3fa00d})[_0x3b06('0x3a')](function(_0x1591a6){if(_0x1591a6){return[_0x1591a6,![]];}return db[_0x3b06('0x93')]['create'](_0x2102f2)[_0x3b06('0x3a')](function(_0x583f61){return[_0x583f61,!![]];});});}})[_0x3b06('0x94')](function(_0x4f67d3,_0x5bcd47){if(_0x4f67d3){_0x19c378=_0x5bcd47;if(!_0x5bcd47){var _0x3304f7={'from':(_0x3e8a21['contact'][_0x3b06('0x95')]||'')+'\x20'+(_0x3e8a21[_0x3b06('0x90')][_0x3b06('0x96')]||'')};if(_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x91')]&&_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x97')]&&_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x91')]!=_0x5b4d13[_0x3b06('0x62')]['messageId']){_0x3304f7[_0x3b06('0x91')]=_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x97')];}return _0x4f67d3[_0x3b06('0x67')](_0x3304f7);}else{return _0x4f67d3;}}})[_0x3b06('0x3a')](function(_0x4d0099){_0x3e8a21[_0x3b06('0x98')]=_0x4d0099['get']({'plain':!![]});_0x3e8a21[_0x3b06('0x98')]['created']=_0x19c378;if(_0x3e8a21[_0x3b06('0x98')]['created']){if(_0x3e8a21[_0x3b06('0x8b')][_0x3b06('0x99')]){_0x3e8a21['applications'][_0x3b06('0x9a')]({'id':0x0,'priority':_0x3e8a21[_0x3b06('0x8c')][_0x3b06('0x4f')]+0x1,'app':_0x3b06('0x9b'),'appdata':_0x3b06('0x9c'),'interval':_0x3b06('0x9d')});}}return db[_0x3b06('0x9e')][_0x3b06('0x61')]({'body':_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x62')],'OpenchannelAccountId':_0x5b4d13[_0x3b06('0x5e')]['id'],'OpenchannelInteractionId':_0x4d0099['id'],'direction':'in','ContactId':_0x3e8a21[_0x3b06('0x90')]['id'],'AttachmentId':_0x5b4d13[_0x3b06('0x62')][_0x3b06('0x9f')]});})[_0x3b06('0x3a')](function(_0x1e8463){_0x3e8a21[_0x3b06('0x2c')]=_0x1e8463;if(_0x3e8a21[_0x3b06('0x98')][_0x3b06('0xa0')]){return db[_0x3b06('0xa1')][_0x3b06('0x68')]({'attributes':['id',_0x3b06('0x48')],'where':{'id':_0x3e8a21[_0x3b06('0x98')][_0x3b06('0xa0')]}})[_0x3b06('0x3a')](function(_0x5dc97f){if(_0x5dc97f){_0x3e8a21[_0x3b06('0x8c')][_0x3b06('0xa2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5dc97f['name']+','+(_0x3e8a21[_0x3b06('0x8b')][_0x3b06('0xa3')]||0xa),'interval':'*,*,*,*'});_0x3e8a21[_0x3b06('0xa4')]=![];}return respondWithRpcPromise(_0x3b06('0xa5'),'startRouting',_0x3e8a21);});}return respondWithRpcPromise(_0x3b06('0xa5'),_0x3b06('0xa6'),_0x3e8a21);})['then'](function(_0x2aed7b){respondWithRpcPromise(_0x3b06('0xa7'),'EventManager',{'event':_0x3b06('0x76'),'message':_0x2aed7b},client9002);return _0x2aed7b;})['then'](respondWithResult(_0x4a9747,null))[_0x3b06('0x2e')](handleError(_0x4a9747,null));};exports[_0x3b06('0xa8')]=function(_0x1b6e81,_0x245f8c,_0x5549e9){return db['OpenchannelAccount'][_0x3b06('0x6e')]({'where':{'id':_0x1b6e81[_0x3b06('0x5e')]['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x245f8c,null))['then'](function(_0x83f835){if(_0x83f835){return db[_0x3b06('0xa9')][_0x3b06('0xaa')](function(_0x2b1474){return db['OpenchannelApplication'][_0x3b06('0x3e')]({'where':{'OpenchannelAccountId':_0x1b6e81[_0x3b06('0x5e')]['id']},'transaction':_0x2b1474})[_0x3b06('0x3a')](function(_0x13c65c){var _0x8489f0=_['map'](_0x1b6e81['body'],function(_0x335fb4){_0x335fb4[_0x3b06('0x6b')]=_0x1b6e81[_0x3b06('0x5e')]['id'];return _0x335fb4;});return db['OpenchannelApplication'][_0x3b06('0xab')](_0x8489f0,{'transaction':_0x2b1474});});})['then'](function(){return db[_0x3b06('0x89')][_0x3b06('0xac')]({'where':{'OpenchannelAccountId':_0x1b6e81['params']['id']},'order':_0x3b06('0xad')});});}})[_0x3b06('0x3a')](respondWithResult(_0x245f8c,null))[_0x3b06('0x2e')](handleError(_0x245f8c,null));};exports[_0x3b06('0xae')]=function(_0x8b0eee,_0x2beae2,_0x212d1d){var _0x381d13={};var _0x65bddc={};var _0x508359;var _0xa0ef9a;return db['OpenchannelAccount'][_0x3b06('0x6e')]({'where':{'id':_0x8b0eee['params']['id']}})['then'](handleEntityNotFound(_0x2beae2,null))[_0x3b06('0x3a')](function(_0x1a2225){if(_0x1a2225){_0x508359=_0x1a2225;_0x65bddc['model']=_[_0x3b06('0x49')](db[_0x3b06('0x89')][_0x3b06('0x44')]);_0x65bddc['query']=_[_0x3b06('0x49')](_0x8b0eee['query']);_0x65bddc[_0x3b06('0x4b')]=_[_0x3b06('0x4d')](_0x65bddc[_0x3b06('0x47')],_0x65bddc[_0x3b06('0x4a')]);_0x381d13[_0x3b06('0x4c')]=_['intersection'](_0x65bddc[_0x3b06('0x47')],qs[_0x3b06('0x4e')](_0x8b0eee[_0x3b06('0x4a')][_0x3b06('0x4e')]));_0x381d13['attributes']=_0x381d13[_0x3b06('0x4c')][_0x3b06('0x4f')]?_0x381d13[_0x3b06('0x4c')]:_0x65bddc[_0x3b06('0x47')];_0x381d13[_0x3b06('0x52')]=qs[_0x3b06('0x53')](_0x8b0eee[_0x3b06('0x4a')][_0x3b06('0x53')]);_0x381d13[_0x3b06('0x54')]=qs[_0x3b06('0x4b')](_[_0x3b06('0x55')](_0x8b0eee[_0x3b06('0x4a')],_0x65bddc[_0x3b06('0x4b')]));if(_0x8b0eee[_0x3b06('0x4a')][_0x3b06('0x56')]){_0x381d13['where']=_[_0x3b06('0x57')](_0x381d13['where'],{'$or':_[_0x3b06('0x42')](_0x381d13['attributes'],function(_0x235973){var _0x18d753={};_0x18d753[_0x235973]={'$like':'%'+_0x8b0eee['query'][_0x3b06('0x56')]+'%'};return _0x18d753;})});}_0x381d13=_['merge']({},_0x381d13,_0x8b0eee[_0x3b06('0x59')]);return _0x508359[_0x3b06('0xae')](_0x381d13);}})[_0x3b06('0x3a')](function(_0x1feb10){if(_0x1feb10){_0xa0ef9a=_0x1feb10[_0x3b06('0x4f')];if(!_0x8b0eee['query'][_0x3b06('0x50')](_0x3b06('0x51'))){_0x381d13['limit']=qs[_0x3b06('0x35')](_0x8b0eee[_0x3b06('0x4a')][_0x3b06('0x35')]);_0x381d13[_0x3b06('0x34')]=qs['offset'](_0x8b0eee[_0x3b06('0x4a')]['offset']);}return _0x508359[_0x3b06('0xae')](_0x381d13);}})[_0x3b06('0x3a')](function(_0x2abc48){if(_0x2abc48){return _0x2abc48?{'count':_0xa0ef9a,'rows':_0x2abc48}:null;}})[_0x3b06('0x3a')](respondWithResult(_0x2beae2,null))[_0x3b06('0x2e')](handleError(_0x2beae2,null));};exports['getInteractions']=function(_0x3210e4,_0x3ffa1c,_0x1093a5){var _0xfaec78={'raw':![],'where':{}};var _0x25affa={};var _0x400b9a={'count':0x0,'rows':[]};return db[_0x3b06('0x43')]['findOne']({'where':{'id':_0x3210e4[_0x3b06('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3ffa1c,null))[_0x3b06('0x3a')](function(_0x4abf2e){if(_0x4abf2e){_0x25affa['model']=_[_0x3b06('0x49')](db[_0x3b06('0x93')][_0x3b06('0x44')]);_0x25affa[_0x3b06('0x4a')]=_[_0x3b06('0x49')](_0x3210e4['query']);_0x25affa['filters']=_[_0x3b06('0x4d')](_0x25affa[_0x3b06('0x47')],_0x25affa[_0x3b06('0x4a')]);_0xfaec78[_0x3b06('0x4c')]=_[_0x3b06('0x4d')](_0x25affa[_0x3b06('0x47')],qs['fields'](_0x3210e4[_0x3b06('0x4a')][_0x3b06('0x4e')]));_0xfaec78['attributes']=_0xfaec78[_0x3b06('0x4c')][_0x3b06('0x4f')]?_0xfaec78['attributes']:_0x25affa[_0x3b06('0x47')];if(!_0x3210e4[_0x3b06('0x4a')][_0x3b06('0x50')](_0x3b06('0x51'))){_0xfaec78[_0x3b06('0x35')]=qs[_0x3b06('0x35')](_0x3210e4[_0x3b06('0x4a')][_0x3b06('0x35')]);_0xfaec78[_0x3b06('0x34')]=qs[_0x3b06('0x34')](_0x3210e4[_0x3b06('0x4a')][_0x3b06('0x34')]);}_0xfaec78[_0x3b06('0x52')]=qs[_0x3b06('0x53')](_0x3210e4['query'][_0x3b06('0x53')]);_0xfaec78[_0x3b06('0x54')]=qs[_0x3b06('0x4b')](_[_0x3b06('0x55')](_0x3210e4['query'],_0x25affa[_0x3b06('0x4b')]));_0xfaec78['where'][_0x3b06('0x6b')]=_0x4abf2e['id'];if(_0x3210e4[_0x3b06('0x4a')][_0x3b06('0x56')]){_0xfaec78[_0x3b06('0x54')]=_['merge'](_0xfaec78['where'],{'$or':_[_0x3b06('0x42')](_0xfaec78[_0x3b06('0x4c')],function(_0x147928){var _0x44e274={};_0x44e274[_0x147928]={'$like':'%'+_0x3210e4[_0x3b06('0x4a')][_0x3b06('0x56')]+'%'};return _0x44e274;})});}_0xfaec78=_['merge']({},_0xfaec78,_0x3210e4[_0x3b06('0x59')]);return db[_0x3b06('0x93')][_0x3b06('0x33')]({'where':_0xfaec78[_0x3b06('0x54')]})['then'](function(_0x522ae0){_0x400b9a[_0x3b06('0x33')]=_0x522ae0;if(_0x3210e4[_0x3b06('0x4a')][_0x3b06('0x5a')]){_0xfaec78[_0x3b06('0x5b')]=[{'model':db[_0x3b06('0x77')],'as':_0x3b06('0xaf'),'required':![]},{'model':db['User'],'as':_0x3b06('0xb0'),'attributes':['name','fullname',_0x3b06('0xb1')],'required':![]},{'model':db[_0x3b06('0xb2')],'as':_0x3b06('0xb3'),'attributes':['id',_0x3b06('0x48'),_0x3b06('0xb4')],'where':_0x3210e4[_0x3b06('0x4a')]['tag']?{'id':_0x3210e4['query'][_0x3b06('0xb5')]}:undefined,'required':_0x3210e4[_0x3b06('0x4a')][_0x3b06('0xb5')]?!![]:![]}];}return db[_0x3b06('0x93')][_0x3b06('0x5c')](_0xfaec78);})[_0x3b06('0x3a')](function(_0x311d42){_0x400b9a[_0x3b06('0x6f')]=_0x311d42;return _0x400b9a;});}})[_0x3b06('0x3a')](respondWithFilteredResult(_0x3ffa1c,_0xfaec78))['catch'](handleError(_0x3ffa1c,null));};exports[_0x3b06('0xb6')]=function(_0x5969a1,_0x5badf6,_0x281a74){return db['OpenchannelAccount'][_0x3b06('0x68')]({'where':{'id':_0x5969a1[_0x3b06('0x5e')]['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x5badf6,null))[_0x3b06('0x3a')](function(_0x4dc8b7){if(_0x4dc8b7){return _0x4dc8b7[_0x3b06('0xb6')](_0x5969a1[_0x3b06('0x62')][_0x3b06('0x71')],_['omit'](_0x5969a1[_0x3b06('0x62')],[_0x3b06('0x71'),'id'])||{})[_0x3b06('0x94')](function(_0x195723){for(var _0x508c48=0x0;_0x508c48<_0x5969a1[_0x3b06('0x62')][_0x3b06('0x71')][_0x3b06('0x4f')];_0x508c48+=0x1){socket[_0x3b06('0xb7')](_0x3b06('0xb8'),{'UserId':Number(_0x5969a1[_0x3b06('0x62')][_0x3b06('0x71')][_0x508c48]),'OpenchannelAccountId':Number(_0x5969a1[_0x3b06('0x5e')]['id'])});}return _0x195723;});}})[_0x3b06('0x3a')](respondWithResult(_0x5badf6,null))[_0x3b06('0x2e')](handleError(_0x5badf6,null));};exports['removeAgents']=function(_0x35abe2,_0x314a38,_0x2c2d59){return db[_0x3b06('0x43')][_0x3b06('0x68')]({'where':{'id':_0x35abe2['params']['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x314a38,null))[_0x3b06('0x3a')](function(_0x965482){if(_0x965482){return _0x965482['removeAgents'](_0x35abe2[_0x3b06('0x4a')]['ids'])[_0x3b06('0x3a')](function(){if(_[_0x3b06('0xb9')](_0x35abe2[_0x3b06('0x4a')][_0x3b06('0x71')])){for(var _0xda9f3f=0x0;_0xda9f3f<_0x35abe2[_0x3b06('0x4a')][_0x3b06('0x71')][_0x3b06('0x4f')];_0xda9f3f+=0x1){socket[_0x3b06('0xb7')](_0x3b06('0xba'),{'UserId':Number(_0x35abe2[_0x3b06('0x4a')]['ids'][_0xda9f3f]),'OpenchannelAccountId':Number(_0x35abe2[_0x3b06('0x5e')]['id'])});}}else{socket[_0x3b06('0xb7')](_0x3b06('0xba'),{'UserId':Number(_0x35abe2['query'][_0x3b06('0x71')]),'OpenchannelAccountId':Number(_0x35abe2[_0x3b06('0x5e')]['id'])});}});}})[_0x3b06('0x3a')](respondWithStatusCode(_0x314a38,null))[_0x3b06('0x2e')](handleError(_0x314a38,null));};exports['getAgents']=function(_0x220ba7,_0x5c7653,_0x2270be){var _0x308ea5={};var _0x4dccab={};var _0x2d63f1;var _0x1272bc;return db[_0x3b06('0x43')]['findOne']({'where':{'id':_0x220ba7['params']['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x5c7653,null))[_0x3b06('0x3a')](function(_0x52754d){if(_0x52754d){_0x2d63f1=_0x52754d;_0x4dccab[_0x3b06('0x47')]=_['keys'](db['User'][_0x3b06('0x44')]);_0x4dccab[_0x3b06('0x4a')]=_[_0x3b06('0x49')](_0x220ba7[_0x3b06('0x4a')]);_0x4dccab[_0x3b06('0x4b')]=_[_0x3b06('0x4d')](_0x4dccab[_0x3b06('0x47')],_0x4dccab['query']);_0x308ea5['attributes']=_[_0x3b06('0x4d')](_0x4dccab[_0x3b06('0x47')],qs[_0x3b06('0x4e')](_0x220ba7[_0x3b06('0x4a')][_0x3b06('0x4e')]));_0x308ea5[_0x3b06('0x4c')]=_0x308ea5[_0x3b06('0x4c')][_0x3b06('0x4f')]?_0x308ea5[_0x3b06('0x4c')]:_0x4dccab['model'];_0x308ea5['order']=qs[_0x3b06('0x53')](_0x220ba7[_0x3b06('0x4a')][_0x3b06('0x53')]);_0x308ea5['where']=qs[_0x3b06('0x4b')](_['pick'](_0x220ba7[_0x3b06('0x4a')],_0x4dccab[_0x3b06('0x4b')]));if(_0x220ba7['query'][_0x3b06('0x56')]){_0x308ea5[_0x3b06('0x54')]=_[_0x3b06('0x57')](_0x308ea5['where'],{'$or':_['map'](_0x308ea5[_0x3b06('0x4c')],function(_0x322efd){var _0x32248e={};_0x32248e[_0x322efd]={'$like':'%'+_0x220ba7['query'][_0x3b06('0x56')]+'%'};return _0x32248e;})});}_0x308ea5=_['merge']({},_0x308ea5,_0x220ba7[_0x3b06('0x59')]);return _0x2d63f1[_0x3b06('0xbb')](_0x308ea5);}})[_0x3b06('0x3a')](function(_0x125f66){if(_0x125f66){_0x1272bc=_0x125f66[_0x3b06('0x4f')];if(!_0x220ba7[_0x3b06('0x4a')][_0x3b06('0x50')](_0x3b06('0x51'))){_0x308ea5[_0x3b06('0x35')]=qs[_0x3b06('0x35')](_0x220ba7[_0x3b06('0x4a')][_0x3b06('0x35')]);_0x308ea5['offset']=qs[_0x3b06('0x34')](_0x220ba7[_0x3b06('0x4a')][_0x3b06('0x34')]);}return _0x2d63f1[_0x3b06('0xbb')](_0x308ea5);}})['then'](function(_0x1c2332){if(_0x1c2332){return _0x1c2332?{'count':_0x1272bc,'rows':_0x1c2332}:null;}})['then'](respondWithResult(_0x5c7653,null))[_0x3b06('0x2e')](handleError(_0x5c7653,null));};exports['send']=function(_0x38e5f6,_0x2e78b9,_0x59d811){var _0xcb29cc,_0x428a75,_0x1f12b9;if(_[_0x3b06('0x81')](_0x38e5f6[_0x3b06('0x62')][_0x3b06('0x62')])||_0x38e5f6[_0x3b06('0x62')]['body']===''){throw new db['Sequelize'][(_0x3b06('0x79'))](_0x3b06('0x82'));}if(_[_0x3b06('0x81')](_0x38e5f6[_0x3b06('0x62')]['to'])){}_0xcb29cc=_0x38e5f6['body']['to'];return db[_0x3b06('0x43')][_0x3b06('0x6e')]({'where':{'id':_0x38e5f6[_0x3b06('0x5e')]['id']}})[_0x3b06('0x3a')](handleEntityNotFound(_0x2e78b9,null))['then'](function(_0x43d093){if(_0x43d093){return db['OpenchannelAccount']['find']({'where':{'id':_0x43d093['id']},'include':[{'model':db[_0x3b06('0xbc')],'as':'List','include':[{'model':db[_0x3b06('0x77')],'as':_0x3b06('0x88'),'where':{[_0x43d093[_0x3b06('0x83')]]:_0xcb29cc},'limit':0x1,'order':[[_0x3b06('0x7d'),_0x3b06('0xbd')]]}]}]})[_0x3b06('0x3a')](handleEntityNotFound(_0x2e78b9,null))['then'](function(_0x3c45f2){if(_0x3c45f2&&_0x3c45f2['List']){_0x428a75=_0x3c45f2[_0x3b06('0x3b')]({'plain':!![]});if(_0x428a75['List']&&_0x428a75[_0x3b06('0x87')][_0x3b06('0x88')][_0x3b06('0x4f')]){return _0x428a75[_0x3b06('0x87')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x3b06('0x1c')](_0x38e5f6[_0x3b06('0x62')],{'firstName':_0xcb29cc,[_0x3c45f2[_0x3b06('0x83')]]:_0xcb29cc,'phone':_0xcb29cc,'ListId':_0x428a75[_0x3b06('0x7f')]}));}})[_0x3b06('0x3a')](handleEntityNotFound(_0x2e78b9,null))[_0x3b06('0x3a')](function(_0x555c51){if(_0x555c51){_0x1f12b9=_0x555c51;return db['OpenchannelInteraction'][_0x3b06('0x68')]({'where':{'ContactId':_0x1f12b9['id'],'closed':![],'OpenchannelAccountId':_0x428a75['id']}})[_0x3b06('0x3a')](function(_0x88e234){if(_0x88e234){return[_0x88e234,![]];}return db['OpenchannelInteraction'][_0x3b06('0x61')]({'UserId':_0x38e5f6[_0x3b06('0x63')]['id'],'ContactId':_0x1f12b9['id'],'OpenchannelAccountId':_0x428a75['id'],'lastMsgDirection':_0x3b06('0xbe'),'Messages':[_[_0x3b06('0x57')](_0x38e5f6[_0x3b06('0x62')],{'read':![],'body':_0x38e5f6['body'][_0x3b06('0x62')],'OpenchannelAccountId':_0x428a75['id'],'UserId':_0x38e5f6['user']['id'],'ContactId':_0x1f12b9['id']})]},{'include':[{'model':db[_0x3b06('0x9e')],'as':'Messages'}]})[_0x3b06('0x3a')](function(_0xf48c52){return[_0xf48c52,!![]];});});}})[_0x3b06('0x94')](function(_0x2c42e6,_0x9a1d69){if(_0x9a1d69){return _0x2c42e6;}return db[_0x3b06('0x9e')]['create'](_['merge'](_0x38e5f6[_0x3b06('0x62')],{'read':![],'body':_0x38e5f6['body'][_0x3b06('0x62')],'OpenchannelAccountId':_0x428a75['id'],'OpenchannelInteractionId':_0x2c42e6['id'],'UserId':_0x38e5f6[_0x3b06('0x63')]['id'],'ContactId':_0x1f12b9['id']}))[_0x3b06('0x3a')](function(_0x591933){_0x2c42e6[_0x3b06('0xbf')]['Messages']=[];_0x2c42e6[_0x3b06('0xbf')][_0x3b06('0xc0')][_0x3b06('0x9a')](_0x591933['dataValues']);return _0x2c42e6;});});}})['then'](respondWithResult(_0x2e78b9,null))[_0x3b06('0x2e')](handleError(_0x2e78b9,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index ded79f7..5842513 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 _0xec56=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x3ce301,_0x858468){var _0x323499=function(_0x789e5b){while(--_0x789e5b){_0x3ce301['push'](_0x3ce301['shift']());}};_0x323499(++_0x858468);}(_0xec56,0x1bd));var _0x6ec5=function(_0x31b12f,_0x575288){_0x31b12f=_0x31b12f-0x0;var _0x39f7b0=_0xec56[_0x31b12f];return _0x39f7b0;};'use strict';var EventEmitter=require(_0x6ec5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6ec5('0x1')](0x0);var events={'afterCreate':_0x6ec5('0x2'),'afterUpdate':_0x6ec5('0x3'),'afterDestroy':_0x6ec5('0x4')};function emitEvent(_0x43c2cd){return function(_0x399441,_0x469679,_0x173aeb){OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd+':'+_0x399441['id'],_0x399441);OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd,_0x399441);_0x173aeb(null);};}for(var e in events){if(events[_0x6ec5('0x6')](e)){var event=events[e];OpenchannelAccount[_0x6ec5('0x7')](e,emitEvent(event));}}module[_0x6ec5('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x1feca9,_0x3c7069){var _0x20e031=function(_0x1af8d7){while(--_0x1af8d7){_0x1feca9['push'](_0x1feca9['shift']());}};_0x20e031(++_0x3c7069);}(_0x5b02,0xe9));var _0x25b0=function(_0x5d31bc,_0x4fa865){_0x5d31bc=_0x5d31bc-0x0;var _0x1a0367=_0x5b02[_0x5d31bc];return _0x1a0367;};'use strict';var EventEmitter=require(_0x25b0('0x0'));var OpenchannelAccount=require(_0x25b0('0x1'))['db'][_0x25b0('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x25b0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x25b0('0x4')};function emitEvent(_0x53493e){return function(_0x3e1d20,_0x31c9c2,_0x38dc14){OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e+':'+_0x3e1d20['id'],_0x3e1d20);OpenchannelAccountEvents[_0x25b0('0x5')](_0x53493e,_0x3e1d20);_0x38dc14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x25b0('0x6')](e,emitEvent(event));}}module[_0x25b0('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 33d6d87..57e5f9d 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(_0x365197,_0x52c74c){var _0x2eff59=function(_0x263e77){while(--_0x263e77){_0x365197['push'](_0x365197['shift']());}};_0x2eff59(++_0x52c74c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x124fce,_0x12605b){var _0x2e4fda=function(_0x5f2787){while(--_0x5f2787){_0x124fce['push'](_0x124fce['shift']());}};_0x2e4fda(++_0x12605b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 8c95dc1..25eb9ec 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 _0xa5fa=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x10a08d,_0x1bab5d){_0x10a08d=_0x10a08d-0x0;var _0x27abcc=_0xa5fa[_0x10a08d];return _0x27abcc;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});config[_0xaa5f('0xb')]=_[_0xaa5f('0xc')](config[_0xaa5f('0xb')],{'host':_0xaa5f('0xd'),'port':0x18eb});var socket=require(_0xaa5f('0xe'))(new Redis(config[_0xaa5f('0xb')]));require('./openchannelAccount.socket')[_0xaa5f('0xf')](socket);function respondWithRpcPromise(_0x227ebb,_0x4d3d16,_0x538865){return new BPromise(function(_0x3fa93f,_0x4bb69d){return client['request'](_0x227ebb,_0x538865)[_0xaa5f('0x10')](function(_0x4d24d2){logger[_0xaa5f('0x11')](_0xaa5f('0x12'),_0x4d3d16,_0xaa5f('0x13'));logger[_0xaa5f('0x14')](_0xaa5f('0x15'),_0x4d3d16,'request\x20sent',JSON[_0xaa5f('0x16')](_0x4d24d2));if(_0x4d24d2['error']){if(_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x18')]===0x1f4){logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x4d24d2[_0xaa5f('0x17')]['message']);return _0x4bb69d(_0x4d24d2['error'][_0xaa5f('0x19')]);}logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x19')]);return _0x3fa93f(_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x19')]);}else{logger[_0xaa5f('0x11')](_0xaa5f('0x12'),_0x4d3d16,_0xaa5f('0x13'));_0x3fa93f(_0x4d24d2[_0xaa5f('0x1a')][_0xaa5f('0x19')]);}})['catch'](function(_0x1c072){logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x1c072);_0x4bb69d(_0x1c072);});});} \ No newline at end of file +var _0x9d9b=['./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0xcc5ee8,_0x1a0a89){var _0xec5a08=function(_0xcc636d){while(--_0xcc636d){_0xcc5ee8['push'](_0xcc5ee8['shift']());}};_0xec5a08(++_0x1a0a89);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x12a764,_0x3aabdf){_0x12a764=_0x12a764-0x0;var _0x3e2248=_0x9d9b[_0x12a764];return _0x3e2248;};'use strict';var _=require('lodash');var util=require(_0xb9d9('0x0'));var moment=require(_0xb9d9('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9d9('0x3'))['db'];var utils=require(_0xb9d9('0x4'));var logger=require(_0xb9d9('0x5'))('rpc');var config=require(_0xb9d9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb9d9('0x7')][_0xb9d9('0x8')]({'port':0x232a});config['redis']=_[_0xb9d9('0x9')](config[_0xb9d9('0xa')],{'host':_0xb9d9('0xb'),'port':0x18eb});var socket=require(_0xb9d9('0xc'))(new Redis(config[_0xb9d9('0xa')]));require(_0xb9d9('0xd'))[_0xb9d9('0xe')](socket);function respondWithRpcPromise(_0x5a9c18,_0x5b591e,_0x5f14e7){return new BPromise(function(_0x4cde40,_0x45f507){return client[_0xb9d9('0xf')](_0x5a9c18,_0x5f14e7)[_0xb9d9('0x10')](function(_0x5e226e){logger[_0xb9d9('0x11')](_0xb9d9('0x12'),_0x5b591e,'request\x20sent');logger[_0xb9d9('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5b591e,_0xb9d9('0x14'),JSON[_0xb9d9('0x15')](_0x5e226e));if(_0x5e226e[_0xb9d9('0x16')]){if(_0x5e226e[_0xb9d9('0x16')][_0xb9d9('0x17')]===0x1f4){logger[_0xb9d9('0x16')](_0xb9d9('0x12'),_0x5b591e,_0x5e226e[_0xb9d9('0x16')]['message']);return _0x45f507(_0x5e226e['error'][_0xb9d9('0x18')]);}logger[_0xb9d9('0x16')](_0xb9d9('0x12'),_0x5b591e,_0x5e226e[_0xb9d9('0x16')]['message']);return _0x4cde40(_0x5e226e['error'][_0xb9d9('0x18')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5b591e,_0xb9d9('0x14'));_0x4cde40(_0x5e226e[_0xb9d9('0x19')][_0xb9d9('0x18')]);}})['catch'](function(_0x473b89){logger[_0xb9d9('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b591e,_0x473b89);_0x45f507(_0x473b89);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 00a7b8a..0aaaad5 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 _0x81a5=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','length'];(function(_0x14e220,_0x57056){var _0x746d60=function(_0x376042){while(--_0x376042){_0x14e220['push'](_0x14e220['shift']());}};_0x746d60(++_0x57056);}(_0x81a5,0x1c8));var _0x581a=function(_0x468d2d,_0x588715){_0x468d2d=_0x468d2d-0x0;var _0x6b41fe=_0x81a5[_0x468d2d];return _0x6b41fe;};'use strict';var OpenchannelAccountEvents=require(_0x581a('0x0'));var events=[_0x581a('0x1'),_0x581a('0x2'),_0x581a('0x3')];function createListener(_0x24ad81,_0x362572){return function(_0x4d0685){_0x362572[_0x581a('0x4')](_0x24ad81,_0x4d0685);};}function removeListener(_0x5125ac,_0x4f5f9a){return function(){OpenchannelAccountEvents['removeListener'](_0x5125ac,_0x4f5f9a);};}exports['register']=function(_0x21fea7){for(var _0x56065e=0x0,_0xdcb7c0=events[_0x581a('0x5')];_0x56065e<_0xdcb7c0;_0x56065e++){var _0x148bc7=events[_0x56065e];var _0x18dec1=createListener(_0x581a('0x6')+_0x148bc7,_0x21fea7);OpenchannelAccountEvents['on'](_0x148bc7,_0x18dec1);}}; \ No newline at end of file +var _0x1cc7=['remove','emit','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x2120f4,_0x2629dd){var _0x1456b6=function(_0x2926dd){while(--_0x2926dd){_0x2120f4['push'](_0x2120f4['shift']());}};_0x1456b6(++_0x2629dd);}(_0x1cc7,0x15a));var _0x71cc=function(_0x5ee080,_0x48b539){_0x5ee080=_0x5ee080-0x0;var _0x764487=_0x1cc7[_0x5ee080];return _0x764487;};'use strict';var OpenchannelAccountEvents=require(_0x71cc('0x0'));var events=[_0x71cc('0x1'),_0x71cc('0x2'),'update'];function createListener(_0x4db9cd,_0x547fe6){return function(_0xe5d54e){_0x547fe6[_0x71cc('0x3')](_0x4db9cd,_0xe5d54e);};}function removeListener(_0x402191,_0x5431e1){return function(){OpenchannelAccountEvents['removeListener'](_0x402191,_0x5431e1);};}exports['register']=function(_0x27a175){for(var _0x4ecf81=0x0,_0xc0444e=events[_0x71cc('0x4')];_0x4ecf81<_0xc0444e;_0x4ecf81++){var _0x4039ce=events[_0x4ecf81];var _0x2e70f0=createListener(_0x71cc('0x5')+_0x4039ce,_0x27a175);OpenchannelAccountEvents['on'](_0x4039ce,_0x2e70f0);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 88f6bbf..d44d16c 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 _0x644f=['fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','put','update','exports','multer','util','path','Router'];(function(_0x4a8a35,_0x41d776){var _0x4a3af3=function(_0x2ac1a2){while(--_0x2ac1a2){_0x4a8a35['push'](_0x4a8a35['shift']());}};_0x4a3af3(++_0x41d776);}(_0x644f,0x182));var _0xf644=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x644f[_0x5c5c52];return _0x4229ff;};'use strict';var multer=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var path=require(_0xf644('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf644('0x3')]();var fs_extra=require(_0xf644('0x4'));var auth=require(_0xf644('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xf644('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf644('0x6')](_0xf644('0x7'),auth[_0xf644('0x8')](),controller[_0xf644('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf644('0xa')](_0xf644('0x7'),auth['isAuthenticated'](),controller[_0xf644('0xb')]);router['delete'](_0xf644('0x7'),auth[_0xf644('0x8')](),controller['destroy']);module[_0xf644('0xc')]=router; \ No newline at end of file +var _0xfe31=['../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4fe07a,_0xe0a338){var _0x1ddbaf=function(_0x4644d6){while(--_0x4644d6){_0x4fe07a['push'](_0x4fe07a['shift']());}};_0x1ddbaf(++_0xe0a338);}(_0xfe31,0x182));var _0x1fe3=function(_0x52ad84,_0x4e34ce){_0x52ad84=_0x52ad84-0x0;var _0x3ad2a1=_0xfe31[_0x52ad84];return _0x3ad2a1;};'use strict';var multer=require(_0x1fe3('0x0'));var util=require('util');var path=require(_0x1fe3('0x1'));var timeout=require('connect-timeout');var express=require(_0x1fe3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1fe3('0x3'));var interaction=require(_0x1fe3('0x4'));var config=require(_0x1fe3('0x5'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x1fe3('0x6')](),controller[_0x1fe3('0x7')]);router[_0x1fe3('0x8')](_0x1fe3('0x9'),auth[_0x1fe3('0x6')](),controller[_0x1fe3('0xa')]);router[_0x1fe3('0xb')]('/',auth[_0x1fe3('0x6')](),controller['create']);router[_0x1fe3('0xc')]('/:id',auth[_0x1fe3('0x6')](),controller[_0x1fe3('0xd')]);router[_0x1fe3('0xe')](_0x1fe3('0x9'),auth[_0x1fe3('0x6')](),controller[_0x1fe3('0xf')]);module[_0x1fe3('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 0f9373c..b153189 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 _0xfb72=['INTEGER','STRING','exports'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0xfb72,0x86));var _0x2fb7=function(_0x4edac5,_0x41d853){_0x4edac5=_0x4edac5-0x0;var _0x572b3b=_0xfb72[_0x4edac5];return _0x572b3b;};'use strict';var Sequelize=require('sequelize');module[_0x2fb7('0x0')]={'priority':{'type':Sequelize[_0x2fb7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2fb7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2fb7('0x2')]},'interval':{'type':Sequelize[_0x2fb7('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x5ae7=['exports','STRING','TEXT'];(function(_0x3cb30b,_0x504b3e){var _0x2ca717=function(_0x32a3d9){while(--_0x32a3d9){_0x3cb30b['push'](_0x3cb30b['shift']());}};_0x2ca717(++_0x504b3e);}(_0x5ae7,0x117));var _0x75ae=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x5ae7[_0x12fc8d];return _0x3f9d04;};'use strict';var Sequelize=require('sequelize');module[_0x75ae('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x75ae('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x75ae('0x2')]()},'description':{'type':Sequelize[_0x75ae('0x1')]},'interval':{'type':Sequelize[_0x75ae('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 90e16b9..e2f351c 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 _0xbd6c=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','count','status','Content-Range','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','map','query','intersection','model','length','attributes','limit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xbd6c,0x80));var _0xcbd6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbd6c[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcbd6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbd6('0x1'));var moment=require(_0xcbd6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcbd6('0x3'));var util=require('util');var path=require(_0xcbd6('0x4'));var sox=require(_0xcbd6('0x5'));var csv=require(_0xcbd6('0x6'));var ejs=require(_0xcbd6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcbd6('0x8'));var crypto=require(_0xcbd6('0x9'));var jsforce=require(_0xcbd6('0xa'));var deskjs=require(_0xcbd6('0xb'));var toCsv=require(_0xcbd6('0x6'));var querystring=require(_0xcbd6('0xc'));var Papa=require(_0xcbd6('0xd'));var Redis=require(_0xcbd6('0xe'));var authService=require(_0xcbd6('0xf'));var qs=require(_0xcbd6('0x10'));var as=require(_0xcbd6('0x11'));var hardwareService=require(_0xcbd6('0x12'));var logger=require(_0xcbd6('0x13'))(_0xcbd6('0x14'));var utils=require(_0xcbd6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcbd6('0x16'));var db=require(_0xcbd6('0x17'))['db'];function respondWithStatusCode(_0x8a2b1b,_0x1f3010){_0x1f3010=_0x1f3010||0xcc;return function(_0x10de75){if(_0x10de75){return _0x8a2b1b[_0xcbd6('0x18')](_0x1f3010);}return _0x8a2b1b['status'](_0x1f3010)[_0xcbd6('0x19')]();};}function respondWithResult(_0x2c7de8,_0x14d28c){_0x14d28c=_0x14d28c||0xc8;return function(_0x3cc58e){if(_0x3cc58e){return _0x2c7de8['status'](_0x14d28c)[_0xcbd6('0x1a')](_0x3cc58e);}};}function respondWithFilteredResult(_0x52d9a7,_0x52561a){return function(_0x2e1246){if(_0x2e1246){var _0x649466=typeof _0x52561a[_0xcbd6('0x1b')]==='undefined'&&typeof _0x52561a['limit']==='undefined';var _0x491c18=_0x2e1246[_0xcbd6('0x1c')];var _0x2cb878=_0x649466?0x0:_0x52561a[_0xcbd6('0x1b')];var _0x89295c=_0x649466?_0x2e1246[_0xcbd6('0x1c')]:_0x52561a['offset']+_0x52561a['limit'];var _0x361ec8;if(_0x89295c>=_0x491c18){_0x89295c=_0x491c18;_0x361ec8=0xc8;}else{_0x361ec8=0xce;}_0x52d9a7[_0xcbd6('0x1d')](_0x361ec8);return _0x52d9a7['set'](_0xcbd6('0x1e'),_0x2cb878+'-'+_0x89295c+'/'+_0x491c18)['json'](_0x2e1246);}return null;};}function patchUpdates(_0x12c1f9){return function(_0x1abc30){try{jsonpatch['apply'](_0x1abc30,_0x12c1f9,!![]);}catch(_0x4a3722){return BPromise[_0xcbd6('0x1f')](_0x4a3722);}return _0x1abc30[_0xcbd6('0x20')]();};}function saveUpdates(_0x5d2db2,_0x3bf909){return function(_0x45571b){if(_0x45571b){return _0x45571b[_0xcbd6('0x21')](_0x5d2db2)[_0xcbd6('0x22')](function(_0x534298){return _0x534298;});}return null;};}function removeEntity(_0x554678,_0x24acbb){return function(_0x13b38f){if(_0x13b38f){return _0x13b38f[_0xcbd6('0x23')]()['then'](function(){_0x554678['status'](0xcc)[_0xcbd6('0x19')]();});}};}function handleEntityNotFound(_0x5b567c,_0x27811f){return function(_0x494f20){if(!_0x494f20){_0x5b567c[_0xcbd6('0x18')](0x194);}return _0x494f20;};}function handleError(_0x15551f,_0x50f54e){_0x50f54e=_0x50f54e||0x1f4;return function(_0x262449){logger[_0xcbd6('0x24')](_0x262449[_0xcbd6('0x25')]);if(_0x262449[_0xcbd6('0x26')]){delete _0x262449[_0xcbd6('0x26')];}_0x15551f[_0xcbd6('0x1d')](_0x50f54e)['send'](_0x262449);};}exports[_0xcbd6('0x27')]=function(_0x45f271,_0x2911ad){var _0x4ca1d1={},_0x29818b={},_0x2fcd94={'count':0x0,'rows':[]};var _0x119610=_['map'](db['OpenchannelApplication'][_0xcbd6('0x28')],function(_0x3c2072){return{'name':_0x3c2072[_0xcbd6('0x29')],'type':_0x3c2072['type'][_0xcbd6('0x2a')]};});_0x29818b['model']=_[_0xcbd6('0x2b')](_0x119610,_0xcbd6('0x26'));_0x29818b['query']=_['keys'](_0x45f271[_0xcbd6('0x2c')]);_0x29818b['filters']=_[_0xcbd6('0x2d')](_0x29818b['model'],_0x29818b[_0xcbd6('0x2c')]);_0x4ca1d1['attributes']=_[_0xcbd6('0x2d')](_0x29818b[_0xcbd6('0x2e')],qs['fields'](_0x45f271['query']['fields']));_0x4ca1d1['attributes']=_0x4ca1d1['attributes'][_0xcbd6('0x2f')]?_0x4ca1d1[_0xcbd6('0x30')]:_0x29818b[_0xcbd6('0x2e')];if(!_0x45f271[_0xcbd6('0x2c')]['hasOwnProperty']('nolimit')){_0x4ca1d1[_0xcbd6('0x31')]=qs['limit'](_0x45f271[_0xcbd6('0x2c')][_0xcbd6('0x31')]);_0x4ca1d1['offset']=qs[_0xcbd6('0x1b')](_0x45f271[_0xcbd6('0x2c')][_0xcbd6('0x1b')]);}_0x4ca1d1[_0xcbd6('0x32')]=qs[_0xcbd6('0x33')](_0x45f271['query'][_0xcbd6('0x33')]);_0x4ca1d1[_0xcbd6('0x34')]=qs[_0xcbd6('0x35')](_['pick'](_0x45f271[_0xcbd6('0x2c')],_0x29818b[_0xcbd6('0x35')]),_0x119610);if(_0x45f271[_0xcbd6('0x2c')]['filter']){_0x4ca1d1[_0xcbd6('0x34')]=_[_0xcbd6('0x36')](_0x4ca1d1[_0xcbd6('0x34')],{'$or':_[_0xcbd6('0x2b')](_0x119610,function(_0x38bd07){if(_0x38bd07[_0xcbd6('0x37')]!==_0xcbd6('0x38')){var _0x136224={};_0x136224[_0x38bd07[_0xcbd6('0x26')]]={'$like':'%'+_0x45f271[_0xcbd6('0x2c')][_0xcbd6('0x39')]+'%'};return _0x136224;}})});}_0x4ca1d1=_[_0xcbd6('0x36')]({},_0x4ca1d1,_0x45f271[_0xcbd6('0x3a')]);var _0x31c8dc={'where':_0x4ca1d1[_0xcbd6('0x34')]};return db[_0xcbd6('0x3b')][_0xcbd6('0x1c')](_0x31c8dc)['then'](function(_0x551775){_0x2fcd94['count']=_0x551775;if(_0x45f271['query'][_0xcbd6('0x3c')]){_0x4ca1d1[_0xcbd6('0x3d')]=[{'all':!![]}];}return db[_0xcbd6('0x3b')][_0xcbd6('0x3e')](_0x4ca1d1);})['then'](function(_0x16e621){_0x2fcd94[_0xcbd6('0x3f')]=_0x16e621;return _0x2fcd94;})[_0xcbd6('0x22')](respondWithFilteredResult(_0x2911ad,_0x4ca1d1))[_0xcbd6('0x40')](handleError(_0x2911ad,null));};exports[_0xcbd6('0x41')]=function(_0x237249,_0x547623){var _0x5c9fea={'raw':!![],'where':{'id':_0x237249[_0xcbd6('0x42')]['id']}},_0x4b4bf8={};_0x4b4bf8[_0xcbd6('0x2e')]=_['keys'](db['OpenchannelApplication'][_0xcbd6('0x28')]);_0x4b4bf8[_0xcbd6('0x2c')]=_['keys'](_0x237249['query']);_0x4b4bf8[_0xcbd6('0x35')]=_[_0xcbd6('0x2d')](_0x4b4bf8[_0xcbd6('0x2e')],_0x4b4bf8[_0xcbd6('0x2c')]);_0x5c9fea[_0xcbd6('0x30')]=_[_0xcbd6('0x2d')](_0x4b4bf8[_0xcbd6('0x2e')],qs[_0xcbd6('0x43')](_0x237249[_0xcbd6('0x2c')]['fields']));_0x5c9fea[_0xcbd6('0x30')]=_0x5c9fea[_0xcbd6('0x30')][_0xcbd6('0x2f')]?_0x5c9fea[_0xcbd6('0x30')]:_0x4b4bf8[_0xcbd6('0x2e')];if(_0x237249[_0xcbd6('0x2c')][_0xcbd6('0x3c')]){_0x5c9fea[_0xcbd6('0x3d')]=[{'all':!![]}];}_0x5c9fea=_[_0xcbd6('0x36')]({},_0x5c9fea,_0x237249[_0xcbd6('0x3a')]);return db['OpenchannelApplication']['find'](_0x5c9fea)[_0xcbd6('0x22')](handleEntityNotFound(_0x547623,null))['then'](respondWithResult(_0x547623,null))[_0xcbd6('0x40')](handleError(_0x547623,null));};exports[_0xcbd6('0x44')]=function(_0x1f382e,_0x56e8df){return db['OpenchannelApplication'][_0xcbd6('0x44')](_0x1f382e[_0xcbd6('0x45')],{})[_0xcbd6('0x22')](respondWithResult(_0x56e8df,0xc9))[_0xcbd6('0x40')](handleError(_0x56e8df,null));};exports[_0xcbd6('0x21')]=function(_0x304dd0,_0x3f15ea){if(_0x304dd0[_0xcbd6('0x45')]['id']){delete _0x304dd0[_0xcbd6('0x45')]['id'];}return db[_0xcbd6('0x3b')]['find']({'where':{'id':_0x304dd0[_0xcbd6('0x42')]['id']}})[_0xcbd6('0x22')](handleEntityNotFound(_0x3f15ea,null))[_0xcbd6('0x22')](saveUpdates(_0x304dd0[_0xcbd6('0x45')],null))[_0xcbd6('0x22')](respondWithResult(_0x3f15ea,null))['catch'](handleError(_0x3f15ea,null));};exports['destroy']=function(_0x4e423c,_0xf9f40){return db[_0xcbd6('0x3b')][_0xcbd6('0x46')]({'where':{'id':_0x4e423c[_0xcbd6('0x42')]['id']}})[_0xcbd6('0x22')](handleEntityNotFound(_0xf9f40,null))[_0xcbd6('0x22')](removeEntity(_0xf9f40,null))[_0xcbd6('0x40')](handleError(_0xf9f40,null));}; \ No newline at end of file +var _0x5b4f=['then','error','stack','name','index','map','OpenchannelApplication','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','options','includeAll','include','rows','catch','show','params','merge','find','body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','destroy'];(function(_0x3377b2,_0x319669){var _0x4cb039=function(_0x48c7b0){while(--_0x48c7b0){_0x3377b2['push'](_0x3377b2['shift']());}};_0x4cb039(++_0x319669);}(_0x5b4f,0xab));var _0xf5b4=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5b4f[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0xf5b4('0x0'));var rimraf=require(_0xf5b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5b4('0x2'));var rp=require('request-promise');var moment=require(_0xf5b4('0x3'));var BPromise=require(_0xf5b4('0x4'));var Mustache=require(_0xf5b4('0x5'));var util=require('util');var path=require(_0xf5b4('0x6'));var sox=require('sox');var csv=require(_0xf5b4('0x7'));var ejs=require(_0xf5b4('0x8'));var fs=require('fs');var fs_extra=require(_0xf5b4('0x9'));var _=require(_0xf5b4('0xa'));var squel=require(_0xf5b4('0xb'));var crypto=require(_0xf5b4('0xc'));var jsforce=require(_0xf5b4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf5b4('0xe'));var Papa=require(_0xf5b4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5b4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5b4('0x11'));var logger=require(_0xf5b4('0x12'))(_0xf5b4('0x13'));var utils=require(_0xf5b4('0x14'));var config=require(_0xf5b4('0x15'));var licenseUtil=require(_0xf5b4('0x16'));var db=require(_0xf5b4('0x17'))['db'];function respondWithStatusCode(_0x1ce923,_0x2a59ee){_0x2a59ee=_0x2a59ee||0xcc;return function(_0xca0201){if(_0xca0201){return _0x1ce923[_0xf5b4('0x18')](_0x2a59ee);}return _0x1ce923[_0xf5b4('0x19')](_0x2a59ee)[_0xf5b4('0x1a')]();};}function respondWithResult(_0x29d585,_0x122aba){_0x122aba=_0x122aba||0xc8;return function(_0x5c702e){if(_0x5c702e){return _0x29d585[_0xf5b4('0x19')](_0x122aba)['json'](_0x5c702e);}};}function respondWithFilteredResult(_0x39c158,_0x15fcb7){return function(_0x2e9ba5){if(_0x2e9ba5){var _0x3ca4a9=typeof _0x15fcb7[_0xf5b4('0x1b')]==='undefined'&&typeof _0x15fcb7[_0xf5b4('0x1c')]===_0xf5b4('0x1d');var _0x3413c9=_0x2e9ba5[_0xf5b4('0x1e')];var _0x1746a6=_0x3ca4a9?0x0:_0x15fcb7[_0xf5b4('0x1b')];var _0x3babc0=_0x3ca4a9?_0x2e9ba5[_0xf5b4('0x1e')]:_0x15fcb7['offset']+_0x15fcb7[_0xf5b4('0x1c')];var _0x537574;if(_0x3babc0>=_0x3413c9){_0x3babc0=_0x3413c9;_0x537574=0xc8;}else{_0x537574=0xce;}_0x39c158[_0xf5b4('0x19')](_0x537574);return _0x39c158['set'](_0xf5b4('0x1f'),_0x1746a6+'-'+_0x3babc0+'/'+_0x3413c9)[_0xf5b4('0x20')](_0x2e9ba5);}return null;};}function patchUpdates(_0x50419c){return function(_0x4dde1b){try{jsonpatch[_0xf5b4('0x21')](_0x4dde1b,_0x50419c,!![]);}catch(_0x1642d2){return BPromise['reject'](_0x1642d2);}return _0x4dde1b[_0xf5b4('0x22')]();};}function saveUpdates(_0x4f3bf8,_0x55cfbf){return function(_0x1013ca){if(_0x1013ca){return _0x1013ca['update'](_0x4f3bf8)['then'](function(_0x3a409c){return _0x3a409c;});}return null;};}function removeEntity(_0x28745f,_0x5e52dc){return function(_0x2e2f3c){if(_0x2e2f3c){return _0x2e2f3c[_0xf5b4('0x23')]()[_0xf5b4('0x24')](function(){_0x28745f['status'](0xcc)[_0xf5b4('0x1a')]();});}};}function handleEntityNotFound(_0x9aa18c,_0x168466){return function(_0x24acaf){if(!_0x24acaf){_0x9aa18c[_0xf5b4('0x18')](0x194);}return _0x24acaf;};}function handleError(_0x331f58,_0x611bc1){_0x611bc1=_0x611bc1||0x1f4;return function(_0x2143af){logger[_0xf5b4('0x25')](_0x2143af[_0xf5b4('0x26')]);if(_0x2143af[_0xf5b4('0x27')]){delete _0x2143af['name'];}_0x331f58[_0xf5b4('0x19')](_0x611bc1)['send'](_0x2143af);};}exports[_0xf5b4('0x28')]=function(_0x86ead9,_0x7da224){var _0x307461={},_0x24ece0={},_0x2c1711={'count':0x0,'rows':[]};var _0x2f0cf2=_[_0xf5b4('0x29')](db[_0xf5b4('0x2a')][_0xf5b4('0x2b')],function(_0x3dd4f7){return{'name':_0x3dd4f7['fieldName'],'type':_0x3dd4f7[_0xf5b4('0x2c')]['key']};});_0x24ece0[_0xf5b4('0x2d')]=_[_0xf5b4('0x29')](_0x2f0cf2,_0xf5b4('0x27'));_0x24ece0[_0xf5b4('0x2e')]=_[_0xf5b4('0x2f')](_0x86ead9[_0xf5b4('0x2e')]);_0x24ece0[_0xf5b4('0x30')]=_[_0xf5b4('0x31')](_0x24ece0[_0xf5b4('0x2d')],_0x24ece0[_0xf5b4('0x2e')]);_0x307461[_0xf5b4('0x32')]=_[_0xf5b4('0x31')](_0x24ece0[_0xf5b4('0x2d')],qs[_0xf5b4('0x33')](_0x86ead9[_0xf5b4('0x2e')][_0xf5b4('0x33')]));_0x307461[_0xf5b4('0x32')]=_0x307461[_0xf5b4('0x32')]['length']?_0x307461[_0xf5b4('0x32')]:_0x24ece0[_0xf5b4('0x2d')];if(!_0x86ead9[_0xf5b4('0x2e')]['hasOwnProperty'](_0xf5b4('0x34'))){_0x307461[_0xf5b4('0x1c')]=qs[_0xf5b4('0x1c')](_0x86ead9[_0xf5b4('0x2e')][_0xf5b4('0x1c')]);_0x307461[_0xf5b4('0x1b')]=qs[_0xf5b4('0x1b')](_0x86ead9[_0xf5b4('0x2e')][_0xf5b4('0x1b')]);}_0x307461[_0xf5b4('0x35')]=qs[_0xf5b4('0x36')](_0x86ead9[_0xf5b4('0x2e')]['sort']);_0x307461['where']=qs[_0xf5b4('0x30')](_[_0xf5b4('0x37')](_0x86ead9[_0xf5b4('0x2e')],_0x24ece0[_0xf5b4('0x30')]),_0x2f0cf2);if(_0x86ead9[_0xf5b4('0x2e')][_0xf5b4('0x38')]){_0x307461[_0xf5b4('0x39')]=_['merge'](_0x307461[_0xf5b4('0x39')],{'$or':_[_0xf5b4('0x29')](_0x2f0cf2,function(_0xfad9f8){if(_0xfad9f8['type']!=='VIRTUAL'){var _0x2b0b4b={};_0x2b0b4b[_0xfad9f8[_0xf5b4('0x27')]]={'$like':'%'+_0x86ead9['query'][_0xf5b4('0x38')]+'%'};return _0x2b0b4b;}})});}_0x307461=_['merge']({},_0x307461,_0x86ead9[_0xf5b4('0x3a')]);var _0x21df3a={'where':_0x307461[_0xf5b4('0x39')]};return db['OpenchannelApplication'][_0xf5b4('0x1e')](_0x21df3a)[_0xf5b4('0x24')](function(_0x3a18b9){_0x2c1711[_0xf5b4('0x1e')]=_0x3a18b9;if(_0x86ead9[_0xf5b4('0x2e')][_0xf5b4('0x3b')]){_0x307461[_0xf5b4('0x3c')]=[{'all':!![]}];}return db[_0xf5b4('0x2a')]['findAll'](_0x307461);})[_0xf5b4('0x24')](function(_0x297625){_0x2c1711[_0xf5b4('0x3d')]=_0x297625;return _0x2c1711;})[_0xf5b4('0x24')](respondWithFilteredResult(_0x7da224,_0x307461))[_0xf5b4('0x3e')](handleError(_0x7da224,null));};exports[_0xf5b4('0x3f')]=function(_0x40f418,_0x478ccb){var _0x32f1b1={'raw':!![],'where':{'id':_0x40f418[_0xf5b4('0x40')]['id']}},_0x14f407={};_0x14f407[_0xf5b4('0x2d')]=_['keys'](db['OpenchannelApplication'][_0xf5b4('0x2b')]);_0x14f407['query']=_['keys'](_0x40f418['query']);_0x14f407[_0xf5b4('0x30')]=_['intersection'](_0x14f407['model'],_0x14f407[_0xf5b4('0x2e')]);_0x32f1b1[_0xf5b4('0x32')]=_[_0xf5b4('0x31')](_0x14f407[_0xf5b4('0x2d')],qs[_0xf5b4('0x33')](_0x40f418[_0xf5b4('0x2e')][_0xf5b4('0x33')]));_0x32f1b1[_0xf5b4('0x32')]=_0x32f1b1[_0xf5b4('0x32')]['length']?_0x32f1b1['attributes']:_0x14f407['model'];if(_0x40f418[_0xf5b4('0x2e')][_0xf5b4('0x3b')]){_0x32f1b1[_0xf5b4('0x3c')]=[{'all':!![]}];}_0x32f1b1=_[_0xf5b4('0x41')]({},_0x32f1b1,_0x40f418[_0xf5b4('0x3a')]);return db['OpenchannelApplication'][_0xf5b4('0x42')](_0x32f1b1)[_0xf5b4('0x24')](handleEntityNotFound(_0x478ccb,null))[_0xf5b4('0x24')](respondWithResult(_0x478ccb,null))[_0xf5b4('0x3e')](handleError(_0x478ccb,null));};exports['create']=function(_0x247506,_0x274ea4){return db[_0xf5b4('0x2a')]['create'](_0x247506[_0xf5b4('0x43')],{})[_0xf5b4('0x24')](respondWithResult(_0x274ea4,0xc9))[_0xf5b4('0x3e')](handleError(_0x274ea4,null));};exports[_0xf5b4('0x44')]=function(_0x32634d,_0x28c3bf){if(_0x32634d[_0xf5b4('0x43')]['id']){delete _0x32634d[_0xf5b4('0x43')]['id'];}return db[_0xf5b4('0x2a')][_0xf5b4('0x42')]({'where':{'id':_0x32634d[_0xf5b4('0x40')]['id']}})[_0xf5b4('0x24')](handleEntityNotFound(_0x28c3bf,null))[_0xf5b4('0x24')](saveUpdates(_0x32634d['body'],null))['then'](respondWithResult(_0x28c3bf,null))['catch'](handleError(_0x28c3bf,null));};exports['destroy']=function(_0x2eb306,_0x499826){return db[_0xf5b4('0x2a')][_0xf5b4('0x42')]({'where':{'id':_0x2eb306['params']['id']}})[_0xf5b4('0x24')](handleEntityNotFound(_0x499826,null))['then'](removeEntity(_0x499826,null))[_0xf5b4('0x3e')](handleError(_0x499826,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 11a9d9a..5a83fd5 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 _0xcaf7=['moment','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x3bcb7c,_0x5af870){var _0x584411=function(_0x4b9a67){while(--_0x4b9a67){_0x3bcb7c['push'](_0x3bcb7c['shift']());}};_0x584411(++_0x5af870);}(_0xcaf7,0x97));var _0x7caf=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xcaf7[_0xea8947];return _0x2455e9;};'use strict';var _=require('lodash');var util=require(_0x7caf('0x0'));var logger=require(_0x7caf('0x1'))(_0x7caf('0x2'));var moment=require(_0x7caf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7caf('0x4'));var config=require('../../config/environment');var attributes=require(_0x7caf('0x5'));module[_0x7caf('0x6')]=function(_0x560b6e,_0x3c6164){return _0x560b6e[_0x7caf('0x7')](_0x7caf('0x8'),attributes,{'tableName':_0x7caf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7caf('0xa')});}; \ No newline at end of file +var _0x0565=['util','../../config/logger','moment','request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4_unicode_ci','lodash'];(function(_0x2094d2,_0x4382cd){var _0x2791c8=function(_0x16a29b){while(--_0x16a29b){_0x2094d2['push'](_0x2094d2['shift']());}};_0x2791c8(++_0x4382cd);}(_0x0565,0x1a3));var _0x5056=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0565[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))('api');var moment=require(_0x5056('0x3'));var BPromise=require('bluebird');var rp=require(_0x5056('0x4'));var fs=require('fs');var path=require(_0x5056('0x5'));var rimraf=require('rimraf');var config=require(_0x5056('0x6'));var attributes=require(_0x5056('0x7'));module[_0x5056('0x8')]=function(_0x25d4cf,_0x4058bd){return _0x25d4cf[_0x5056('0x9')](_0x5056('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5056('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 54b3c95..333efa3 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 _0xfffa=['catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','where','attributes','limit','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result'];(function(_0x520f7a,_0xf7bc99){var _0x2992f0=function(_0x3ed71a){while(--_0x3ed71a){_0x520f7a['push'](_0x520f7a['shift']());}};_0x2992f0(++_0xf7bc99);}(_0xfffa,0x1e8));var _0xafff=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfffa[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xafff('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xafff('0x1'));var fs=require('fs');var Redis=require(_0xafff('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xafff('0x3'));var logger=require(_0xafff('0x4'))(_0xafff('0x5'));var config=require(_0xafff('0x6'));var jayson=require(_0xafff('0x7'));var client=jayson[_0xafff('0x8')][_0xafff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dd70e,_0x23afaf,_0x388416){return new BPromise(function(_0x1dfc99,_0xa72acf){return client[_0xafff('0xa')](_0x2dd70e,_0x388416)[_0xafff('0xb')](function(_0x36ecf5){logger[_0xafff('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x23afaf,'request\x20sent');logger[_0xafff('0xd')](_0xafff('0xe'),_0x23afaf,_0xafff('0xf'),JSON[_0xafff('0x10')](_0x36ecf5));if(_0x36ecf5[_0xafff('0x11')]){if(_0x36ecf5[_0xafff('0x11')][_0xafff('0x12')]===0x1f4){logger[_0xafff('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x23afaf,_0x36ecf5[_0xafff('0x11')][_0xafff('0x13')]);return _0xa72acf(_0x36ecf5[_0xafff('0x11')][_0xafff('0x13')]);}logger[_0xafff('0x11')](_0xafff('0x14'),_0x23afaf,_0x36ecf5[_0xafff('0x11')]['message']);return _0x1dfc99(_0x36ecf5[_0xafff('0x11')][_0xafff('0x13')]);}else{logger[_0xafff('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x23afaf,_0xafff('0xf'));_0x1dfc99(_0x36ecf5[_0xafff('0x15')]['message']);}})[_0xafff('0x16')](function(_0x14488a){logger[_0xafff('0x11')](_0xafff('0x14'),_0x23afaf,_0x14488a);_0xa72acf(_0x14488a);});});}exports[_0xafff('0x17')]=function(_0x881a2){var _0x4a4dff=this;return new Promise(function(_0x4bd7f9,_0x75c511){return db[_0xafff('0x18')]['update'](_0x881a2[_0xafff('0x19')],{'raw':_0x881a2[_0xafff('0x1a')]?_0x881a2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x881a2[_0xafff('0x1a')]?_0x881a2[_0xafff('0x1a')][_0xafff('0x1b')]||null:null,'attributes':_0x881a2[_0xafff('0x1a')]?_0x881a2[_0xafff('0x1a')][_0xafff('0x1c')]||null:null,'limit':_0x881a2['options']?_0x881a2[_0xafff('0x1a')][_0xafff('0x1d')]||null:null})['then'](function(_0x1753b3){logger['info'](_0xafff('0x17'),_0x881a2);logger[_0xafff('0xd')](_0xafff('0x17'),_0x881a2,JSON[_0xafff('0x10')](_0x1753b3));_0x4bd7f9(_0x1753b3);})[_0xafff('0x16')](function(_0x55318d){logger[_0xafff('0x11')](_0xafff('0x17'),_0x55318d['message'],_0x881a2);_0x75c511(_0x4a4dff[_0xafff('0x11')](0x1f4,_0x55318d[_0xafff('0x13')]));});});}; \ No newline at end of file +var _0x0e8c=['body','options','raw','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update'];(function(_0x1138c4,_0x841d33){var _0x200cc1=function(_0x2f6d85){while(--_0x2f6d85){_0x1138c4['push'](_0x1138c4['shift']());}};_0x200cc1(++_0x841d33);}(_0x0e8c,0x75));var _0xc0e8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0e8c[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc0e8('0x0'));var util=require(_0xc0e8('0x1'));var moment=require(_0xc0e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0e8('0x3'));var db=require(_0xc0e8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0e8('0x5'))('rpc');var config=require(_0xc0e8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc0e8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x46c118,_0x24abdb,_0x5e057e){return new BPromise(function(_0x416ef1,_0x4d237b){return client['request'](_0x46c118,_0x5e057e)[_0xc0e8('0x8')](function(_0x59b093){logger[_0xc0e8('0x9')](_0xc0e8('0xa'),_0x24abdb,_0xc0e8('0xb'));logger[_0xc0e8('0xc')](_0xc0e8('0xd'),_0x24abdb,_0xc0e8('0xb'),JSON[_0xc0e8('0xe')](_0x59b093));if(_0x59b093['error']){if(_0x59b093[_0xc0e8('0xf')][_0xc0e8('0x10')]===0x1f4){logger[_0xc0e8('0xf')](_0xc0e8('0xa'),_0x24abdb,_0x59b093[_0xc0e8('0xf')][_0xc0e8('0x11')]);return _0x4d237b(_0x59b093[_0xc0e8('0xf')][_0xc0e8('0x11')]);}logger['error'](_0xc0e8('0xa'),_0x24abdb,_0x59b093[_0xc0e8('0xf')][_0xc0e8('0x11')]);return _0x416ef1(_0x59b093[_0xc0e8('0xf')][_0xc0e8('0x11')]);}else{logger[_0xc0e8('0x9')](_0xc0e8('0xa'),_0x24abdb,_0xc0e8('0xb'));_0x416ef1(_0x59b093[_0xc0e8('0x12')][_0xc0e8('0x11')]);}})[_0xc0e8('0x13')](function(_0x429df8){logger['error'](_0xc0e8('0xa'),_0x24abdb,_0x429df8);_0x4d237b(_0x429df8);});});}exports[_0xc0e8('0x14')]=function(_0x257c51){var _0xf09988=this;return new Promise(function(_0xbc4c8f,_0x60e0a2){return db[_0xc0e8('0x15')][_0xc0e8('0x16')](_0x257c51[_0xc0e8('0x17')],{'raw':_0x257c51[_0xc0e8('0x18')]?_0x257c51[_0xc0e8('0x18')][_0xc0e8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x257c51['options']?_0x257c51['options']['where']||null:null,'attributes':_0x257c51[_0xc0e8('0x18')]?_0x257c51[_0xc0e8('0x18')][_0xc0e8('0x1a')]||null:null,'limit':_0x257c51[_0xc0e8('0x18')]?_0x257c51['options'][_0xc0e8('0x1b')]||null:null})[_0xc0e8('0x8')](function(_0x56bd72){logger[_0xc0e8('0x9')]('UpdateOpenchannelApplication',_0x257c51);logger[_0xc0e8('0xc')](_0xc0e8('0x14'),_0x257c51,JSON[_0xc0e8('0xe')](_0x56bd72));_0xbc4c8f(_0x56bd72);})[_0xc0e8('0x13')](function(_0x49003f){logger[_0xc0e8('0xf')](_0xc0e8('0x14'),_0x49003f[_0xc0e8('0x11')],_0x257c51);_0x60e0a2(_0xf09988[_0xc0e8('0xf')](0x1f4,_0x49003f[_0xc0e8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index ebdf1f9..5257a89 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 _0xadc3=['/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','/:id','tracked','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x43b59d,_0xd7b2ae){var _0x37f43b=function(_0x6ccf5c){while(--_0x6ccf5c){_0x43b59d['push'](_0x43b59d['shift']());}};_0x37f43b(++_0xd7b2ae);}(_0xadc3,0xcb));var _0x3adc=function(_0xef2a2a,_0x261325){_0xef2a2a=_0xef2a2a-0x0;var _0x5dac30=_0xadc3[_0xef2a2a];return _0x5dac30;};'use strict';var multer=require('multer');var util=require(_0x3adc('0x0'));var path=require(_0x3adc('0x1'));var timeout=require(_0x3adc('0x2'));var express=require(_0x3adc('0x3'));var router=express['Router']();var fs_extra=require(_0x3adc('0x4'));var auth=require(_0x3adc('0x5'));var interaction=require(_0x3adc('0x6'));var config=require(_0x3adc('0x7'));var controller=require(_0x3adc('0x8'));router[_0x3adc('0x9')]('/',auth[_0x3adc('0xa')](),controller['index']);router['get'](_0x3adc('0xb'),auth[_0x3adc('0xa')](),controller[_0x3adc('0xc')]);router[_0x3adc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3adc('0xd')]);router[_0x3adc('0x9')](_0x3adc('0xe'),auth['isAuthenticated'](),controller[_0x3adc('0xf')]);router[_0x3adc('0x9')]('/:id/download',auth[_0x3adc('0xa')](),controller[_0x3adc('0x10')]);router['post']('/',auth[_0x3adc('0xa')](),controller[_0x3adc('0x11')]);router[_0x3adc('0x12')](_0x3adc('0xe'),auth[_0x3adc('0xa')](),controller[_0x3adc('0x13')]);router[_0x3adc('0x12')](_0x3adc('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x3adc('0x15'),_0x3adc('0x16')),controller[_0x3adc('0x17')]);router['put'](_0x3adc('0x18'),auth[_0x3adc('0xa')](),interaction[_0x3adc('0x19')](_0x3adc('0x15'),_0x3adc('0x1a')),controller[_0x3adc('0x1b')]);router['delete']('/:id',auth[_0x3adc('0xa')](),interaction['tracked'](_0x3adc('0x15'),_0x3adc('0x1c')),controller['destroy']);router[_0x3adc('0x1d')](_0x3adc('0x14'),auth[_0x3adc('0xa')](),controller['removeTags']);module[_0x3adc('0x1e')]=router; \ No newline at end of file +var _0x1f5a=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','destroy','delete','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1f5a,0xa8));var _0xa1f5=function(_0x3ab680,_0x357f3b){_0x3ab680=_0x3ab680-0x0;var _0x4e2853=_0x1f5a[_0x3ab680];return _0x4e2853;};'use strict';var multer=require(_0xa1f5('0x0'));var util=require(_0xa1f5('0x1'));var path=require(_0xa1f5('0x2'));var timeout=require('connect-timeout');var express=require(_0xa1f5('0x3'));var router=express[_0xa1f5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa1f5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa1f5('0x6'));var controller=require(_0xa1f5('0x7'));router[_0xa1f5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa1f5('0x9')]);router[_0xa1f5('0x8')](_0xa1f5('0xa'),auth[_0xa1f5('0xb')](),controller['describe']);router[_0xa1f5('0x8')](_0xa1f5('0xc'),auth[_0xa1f5('0xb')](),controller[_0xa1f5('0xd')]);router[_0xa1f5('0x8')](_0xa1f5('0xe'),auth[_0xa1f5('0xb')](),controller['getMessages']);router['get'](_0xa1f5('0xf'),auth[_0xa1f5('0xb')](),controller['download']);router[_0xa1f5('0x10')]('/',auth['isAuthenticated'](),controller[_0xa1f5('0x11')]);router[_0xa1f5('0x10')](_0xa1f5('0xe'),auth[_0xa1f5('0xb')](),controller[_0xa1f5('0x12')]);router['post'](_0xa1f5('0x13'),auth['isAuthenticated'](),interaction[_0xa1f5('0x14')](_0xa1f5('0x15'),_0xa1f5('0x16')),controller[_0xa1f5('0x17')]);router[_0xa1f5('0x18')](_0xa1f5('0xc'),auth[_0xa1f5('0xb')](),interaction[_0xa1f5('0x14')](_0xa1f5('0x15'),'openchannelinteraction:update'),controller['update']);router['delete']('/:id',auth[_0xa1f5('0xb')](),interaction[_0xa1f5('0x14')]('openchannel','openchannelinteraction:destroy'),controller[_0xa1f5('0x19')]);router[_0xa1f5('0x1a')](_0xa1f5('0x13'),auth[_0xa1f5('0xb')](),controller['removeTags']);module[_0xa1f5('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index b12866f..606c908 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 _0x7070=['STRING','DATE','ENUM','out','BOOLEAN'];(function(_0x8931a8,_0x8ad68a){var _0x4624ee=function(_0x12545f){while(--_0x12545f){_0x8931a8['push'](_0x8931a8['shift']());}};_0x4624ee(++_0x8ad68a);}(_0x7070,0xa4));var _0x0707=function(_0x1bc66c,_0x24c527){_0x1bc66c=_0x1bc66c-0x0;var _0x223214=_0x7070[_0x1bc66c];return _0x223214;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x0707('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0707('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0707('0x1')]},'note':{'type':Sequelize[_0x0707('0x1')]},'read1stAt':{'type':Sequelize[_0x0707('0x2')]},'threadId':{'type':Sequelize[_0x0707('0x1')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x0707('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0707('0x3')]('in',_0x0707('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0707('0x1')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xec39=['sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0xdaf6e4,_0xdba533){var _0x17df0d=function(_0x5d5bf6){while(--_0x5d5bf6){_0xdaf6e4['push'](_0xdaf6e4['shift']());}};_0x17df0d(++_0xdba533);}(_0xec39,0x19f));var _0x9ec3=function(_0x544a96,_0x1d5a05){_0x544a96=_0x544a96-0x0;var _0x38e398=_0xec39[_0x544a96];return _0x38e398;};'use strict';var Sequelize=require(_0x9ec3('0x0'));module[_0x9ec3('0x1')]={'closed':{'type':Sequelize[_0x9ec3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9ec3('0x3')]},'disposition':{'type':Sequelize[_0x9ec3('0x4')]},'secondDisposition':{'type':Sequelize[_0x9ec3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9ec3('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9ec3('0x3')]},'threadId':{'type':Sequelize[_0x9ec3('0x4')]},'externalUrl':{'type':Sequelize[_0x9ec3('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9ec3('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x9ec3('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 0a38877..f28f2b4 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 _0x60f6=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','fullname','TagIds','Tags','forEach','index','OpenchannelInteraction','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','Contact','operator','$substring','split','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','some','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','isEmpty','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','catch','params','rawAttributes','includeAll','options','create','body','update','destroy','addMessage','OpenchannelMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','emit','removeTags','download','unix','join','root','server','tmp','attachments','CmContact','firstName','Attachment','createdAt','direction','secret','Account','Owner','get','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','createWriteStream','out','System','lastName','renderFile','views','transcript-','.pdf','log','err','unlinkSync','eml-format'];(function(_0x487e84,_0x463808){var _0x11ee1f=function(_0x119e63){while(--_0x119e63){_0x487e84['push'](_0x487e84['shift']());}};_0x11ee1f(++_0x463808);}(_0x60f6,0xe3));var _0x660f=function(_0x3d7023,_0x42d120){_0x3d7023=_0x3d7023-0x0;var _0x5b9d9f=_0x60f6[_0x3d7023];return _0x5b9d9f;};'use strict';var emlformat=require(_0x660f('0x0'));var rimraf=require(_0x660f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x660f('0x2'));var rp=require(_0x660f('0x3'));var moment=require(_0x660f('0x4'));var BPromise=require(_0x660f('0x5'));var Mustache=require(_0x660f('0x6'));var util=require(_0x660f('0x7'));var path=require(_0x660f('0x8'));var sox=require(_0x660f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x660f('0xa'));var _=require(_0x660f('0xb'));var squel=require(_0x660f('0xc'));var crypto=require(_0x660f('0xd'));var jsforce=require(_0x660f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x660f('0xf'));var querystring=require('querystring');var Papa=require(_0x660f('0x10'));var Redis=require(_0x660f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x660f('0x12'));var as=require(_0x660f('0x13'));var pdf=require(_0x660f('0x14'));var hardwareService=require(_0x660f('0x15'));var logger=require('../../config/logger')(_0x660f('0x16'));var utils=require('../../config/utils');var config=require(_0x660f('0x17'));var licenseUtil=require(_0x660f('0x18'));var db=require(_0x660f('0x19'))['db'];config[_0x660f('0x1a')]=_[_0x660f('0x1b')](config['redis'],{'host':_0x660f('0x1c'),'port':0x18eb});var socket=require(_0x660f('0x1d'))(new Redis(config['redis']));require(_0x660f('0x1e'))[_0x660f('0x1f')](socket);function respondWithStatusCode(_0x147d3c,_0x4b4655){_0x4b4655=_0x4b4655||0xcc;return function(_0x3746e4){if(_0x3746e4){return _0x147d3c[_0x660f('0x20')](_0x4b4655);}return _0x147d3c[_0x660f('0x21')](_0x4b4655)[_0x660f('0x22')]();};}function respondWithResult(_0x3c5606,_0x394f09){_0x394f09=_0x394f09||0xc8;return function(_0x2d3f04){if(_0x2d3f04){return _0x3c5606[_0x660f('0x21')](_0x394f09)[_0x660f('0x23')](_0x2d3f04);}};}function respondWithFilteredResult(_0x5ed848,_0x38888a){return function(_0x2f7d37){if(_0x2f7d37){var _0x27b9ce=typeof _0x38888a[_0x660f('0x24')]===_0x660f('0x25')&&typeof _0x38888a[_0x660f('0x26')]==='undefined';var _0x14ca28=_0x2f7d37[_0x660f('0x27')];var _0x50fb53=_0x27b9ce?0x0:_0x38888a[_0x660f('0x24')];var _0x1267af=_0x27b9ce?_0x2f7d37['count']:_0x38888a[_0x660f('0x24')]+_0x38888a[_0x660f('0x26')];var _0x5c6f4b;if(_0x1267af>=_0x14ca28){_0x1267af=_0x14ca28;_0x5c6f4b=0xc8;}else{_0x5c6f4b=0xce;}_0x5ed848[_0x660f('0x21')](_0x5c6f4b);return _0x5ed848['set'](_0x660f('0x28'),_0x50fb53+'-'+_0x1267af+'/'+_0x14ca28)[_0x660f('0x23')](_0x2f7d37);}return null;};}function patchUpdates(_0x2a9817){return function(_0x318708){try{jsonpatch[_0x660f('0x29')](_0x318708,_0x2a9817,!![]);}catch(_0x2634dc){return BPromise[_0x660f('0x2a')](_0x2634dc);}return _0x318708[_0x660f('0x2b')]();};}function saveUpdates(_0x394d87,_0x1c2e4f){return function(_0x25c55f){if(_0x25c55f){return _0x25c55f['update'](_0x394d87)[_0x660f('0x2c')](function(_0x47beb7){return _0x47beb7;});}return null;};}function removeEntity(_0x5da042,_0x33f26e){return function(_0x13e19b){if(_0x13e19b){return _0x13e19b['destroy']()[_0x660f('0x2c')](function(){_0x5da042['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbbe0e0,_0x66f39f){return function(_0x110695){if(!_0x110695){_0xbbe0e0[_0x660f('0x20')](0x194);}return _0x110695;};}function handleError(_0x38634a,_0x229671){_0x229671=_0x229671||0x1f4;return function(_0x23f0fb){logger[_0x660f('0x2d')](_0x23f0fb[_0x660f('0x2e')]);if(_0x23f0fb[_0x660f('0x2f')]){delete _0x23f0fb[_0x660f('0x2f')];}_0x38634a[_0x660f('0x21')](_0x229671)[_0x660f('0x30')](_0x23f0fb);};}function getInteractionUsers(_0x25e3d4,_0x4f8dd0){return new BPromise(function(_0x297a01,_0x39f155){try{if(_0x4f8dd0[_0x25e3d4['id']]){_0x25e3d4['Users']=_['map'](_0x4f8dd0[_0x25e3d4['id']],function(_0x3edff8){return{'id':_0x3edff8['id'],'fullname':_0x3edff8[_0x660f('0x31')]};});}}catch(_0x2d41cf){_0x39f155(_0x2d41cf);}_0x297a01(_0x25e3d4);});}function getInteractionTags(_0xf89e4,_0x2b5d54){return new BPromise(function(_0x2a0e3f,_0x481d68){try{if(_0xf89e4[_0x660f('0x32')]){_0xf89e4[_0x660f('0x33')]=[];_0xf89e4[_0x660f('0x32')]['split'](',')[_0x660f('0x34')](function(_0x2bbb72){_0xf89e4[_0x660f('0x33')]['push'](_0x2b5d54[_0x2bbb72]);});}delete _0xf89e4['TagIds'];}catch(_0x1659e4){_0x481d68(_0x1659e4);}_0x2a0e3f(_0xf89e4);});}function updateOpenchannelInteraction(_0x8d95a3,_0x4de580,_0x3cddac){return new BPromise(function(_0x58e2bc,_0x40e76a){return getInteractionUsers(_0x8d95a3,_0x3cddac)[_0x660f('0x2c')](function(_0x37be3a){return getInteractionTags(_0x37be3a,_0x4de580);})[_0x660f('0x2c')](function(_0x565d68){_0x58e2bc(_0x565d68);})['catch'](function(_0x2559cb){_0x40e76a(_0x2559cb);});});}exports[_0x660f('0x35')]=function(_0x3f59af,_0x4a1b2d){var _0x278ca4={},_0x49a92d={},_0x5a8976={'count':0x0,'rows':[]};var _0x6c718a=_['map'](db[_0x660f('0x36')]['rawAttributes'],function(_0x1a185){return{'name':_0x1a185[_0x660f('0x37')],'type':_0x1a185[_0x660f('0x38')]['key']};});_0x49a92d[_0x660f('0x39')]=_[_0x660f('0x3a')](_0x6c718a,_0x660f('0x2f'));_0x49a92d[_0x660f('0x3b')]=_[_0x660f('0x3c')](_0x3f59af['query']);_0x49a92d[_0x660f('0x3d')]=_['intersection'](_0x49a92d[_0x660f('0x39')],_0x49a92d['query']);_0x278ca4[_0x660f('0x3e')]=_[_0x660f('0x3f')](_0x49a92d['model'],qs[_0x660f('0x40')](_0x3f59af[_0x660f('0x3b')][_0x660f('0x40')]));_0x278ca4[_0x660f('0x3e')]=_0x278ca4[_0x660f('0x3e')][_0x660f('0x41')]?_0x278ca4['attributes']:_0x49a92d['model'];if(!_0x3f59af[_0x660f('0x3b')][_0x660f('0x42')](_0x660f('0x43'))){_0x278ca4['limit']=qs[_0x660f('0x26')](_0x3f59af[_0x660f('0x3b')][_0x660f('0x26')]);_0x278ca4[_0x660f('0x24')]=qs[_0x660f('0x24')](_0x3f59af[_0x660f('0x3b')][_0x660f('0x24')]);}_0x278ca4['order']=qs['sort'](_0x3f59af[_0x660f('0x3b')][_0x660f('0x44')]);_0x278ca4[_0x660f('0x45')]=qs['filters'](_[_0x660f('0x46')](_0x3f59af[_0x660f('0x3b')],_0x49a92d[_0x660f('0x3d')]),_0x6c718a);var _0x2ee57b=[];var _0x1579ab=squel['select']()[_0x660f('0x47')]('id')['field'](_0x660f('0x2f'))['field']('color')[_0x660f('0x48')](_0x660f('0x49'));var _0x179351=squel[_0x660f('0x4a')]()['field'](_0x660f('0x4b'))[_0x660f('0x47')](_0x660f('0x4c'))[_0x660f('0x47')](_0x660f('0x4d'))[_0x660f('0x48')]('user_has_openchannel_interactions','ui')[_0x660f('0x4e')](_0x660f('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x4984c0=squel[_0x660f('0x4a')]()['from']('openchannel_interactions','i')[_0x660f('0x4e')](_0x660f('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x660f('0x4e')](_0x660f('0x4f'),'o',_0x660f('0x51'))[_0x660f('0x4e')]('openchannel_accounts','a',_0x660f('0x52'))['left_join']('openchannel_messages','me',_0x660f('0x53'))[_0x660f('0x4e')](_0x660f('0x54'),'it',_0x660f('0x55'))[_0x660f('0x4e')]('tools_tags','t',_0x660f('0x56'));var _0xb496b7=squel[_0x660f('0x57')]();var _0x587910=[];var _0x4c88a7=squel['expr']();var _0x423bba;if(_0x3f59af[_0x660f('0x3b')]['search']){_0x423bba=as[_0x660f('0x58')](_0x3f59af[_0x660f('0x3b')][_0x660f('0x59')]);var _0x3226e4=_0x423bba[_0x660f('0x5a')];for(var _0x223444=0x0;_0x223444<_0x423bba[_0x660f('0x5b')][_0x660f('0x41')];_0x223444++){var _0x231ffe=_0x423bba[_0x660f('0x5b')][_0x223444];var _0x5e299e='i';var _0x15d319=_[_0x660f('0x5c')](_0x6c718a,[_0x660f('0x2f'),_0x231ffe[_0x660f('0x47')]]);if(!_0x15d319){switch(_0x231ffe[_0x660f('0x47')]){case'unreadMessages':if(_0x231ffe[_0x660f('0x5d')]==0x1){_0x4984c0[_0x660f('0x5e')]('`'+_0x231ffe[_0x660f('0x47')]+_0x660f('0x5f'));}else{_0x4984c0[_0x660f('0x5e')]('`'+_0x231ffe[_0x660f('0x47')]+'`\x20>\x200');}break;case _0x660f('0x60'):if(_0x231ffe[_0x660f('0x61')]===_0x660f('0x62')){if(_0x231ffe['value'][_0x660f('0x63')]('\x20')[_0x660f('0x41')]>0x1){_0xb496b7[_0x3226e4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x660f('0x64')](_0x231ffe['value']),null);}else{var _0x558de0='%'+_0x231ffe[_0x660f('0x5d')]+'%';_0xb496b7[_0x3226e4](_0x660f('0x65'),_0x558de0,_0x558de0,_0x558de0);}}else{_0x15d319=_['find'](_0x6c718a,[_0x660f('0x2f'),_0x660f('0x66')]);_0x231ffe[_0x660f('0x47')]=_0x660f('0x66');_0x454833=as[_0x660f('0x67')](_0x5e299e,_0x15d319[_0x660f('0x38')],_0x231ffe);_0xb496b7[_0x3226e4](_0x454833[_0x660f('0x68')],_0x454833['value'][_0x660f('0x69')],_0x454833[_0x660f('0x5d')][_0x660f('0x22')]);}break;case _0x660f('0x6a'):var _0x2560b0=_0x231ffe[_0x660f('0x5d')][_0x660f('0x63')](',')[_0x660f('0x3a')](function(_0x4b50b4){return Number(_0x4b50b4);});_0x2560b0[_0x660f('0x34')](function(_0x2ad03e){_0x4c88a7['or'](_0x660f('0x6b'),'%,'+_0x2ad03e+',%');});_0x587910=_[_0x660f('0x6c')](_0x587910,_0x2560b0);break;case _0x660f('0x6d'):if(_0x231ffe[_0x660f('0x61')]===_0x660f('0x62')){_0xb496b7[_0x3226e4](_0x660f('0x6e'),'%'+_0x231ffe[_0x660f('0x5d')]+'%',null);}else{_0x15d319=_[_0x660f('0x5c')](_0x6c718a,[_0x660f('0x2f'),_0x660f('0x6f')]);_0x231ffe[_0x660f('0x47')]='UserId';_0x454833=as[_0x660f('0x67')](_0x5e299e,_0x15d319[_0x660f('0x38')],_0x231ffe);_0xb496b7[_0x3226e4](_0x454833[_0x660f('0x68')],_0x454833[_0x660f('0x5d')][_0x660f('0x69')],_0x454833[_0x660f('0x5d')][_0x660f('0x22')]);}break;case'body':_0x454833=as[_0x660f('0x67')]('me',null,_0x231ffe);_0xb496b7[_0x3226e4](_0x454833['text'],_0x454833[_0x660f('0x5d')][_0x660f('0x69')],_0x454833['value'][_0x660f('0x22')]);break;}}else{var _0x454833=as[_0x660f('0x67')](_0x5e299e,_0x15d319['type'],_0x231ffe);_0xb496b7[_0x3226e4](_0x454833['text'],_0x454833[_0x660f('0x5d')][_0x660f('0x69')],_0x454833[_0x660f('0x5d')][_0x660f('0x22')]);}}}else{var _0x4e3959=_(_0x3f59af[_0x660f('0x3b')])[_0x660f('0x3c')]()[_0x660f('0x3a')](function(_0x4bf9f4){return _[_0x660f('0x70')](_0x6c718a,['name',_0x4bf9f4])?_0x4bf9f4:undefined;})['compact']()[_0x660f('0x5d')]();if(!_['isEmpty'](_0x4e3959)){_0x4e3959[_0x660f('0x34')](function(_0x487783){if(_0x487783===_0x660f('0x71')){_0x4984c0[_0x660f('0x45')](_0x660f('0x72'),[][_0x660f('0x73')](_0x3f59af[_0x660f('0x3b')][_0x487783]));}else if(_0x487783==='createdAt'){var _0x268fce=JSON[_0x660f('0x74')](_0x3f59af[_0x660f('0x3b')][_0x487783])[_0x660f('0x75')];var _0x3fd1d6=JSON['parse'](_0x3f59af[_0x660f('0x3b')][_0x487783])[_0x660f('0x76')];_0x4984c0[_0x660f('0x45')](_0x660f('0x77'),_0x268fce,_0x3fd1d6);}else{if(_0x3f59af['query'][_0x487783]===_0x660f('0x78')){_0x4984c0[_0x660f('0x45')]('i.'+_0x487783+_0x660f('0x79'));}else{_0x4984c0[_0x660f('0x45')]('i.'+_0x487783+'\x20=\x20?',_0x3f59af['query'][_0x487783]);}}});}if(_0x3f59af['query']['read']){if(_0x3f59af[_0x660f('0x3b')][_0x660f('0x7a')]==0x1){_0x4984c0[_0x660f('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x4984c0[_0x660f('0x5e')](_0x660f('0x7b'));}}if(_0x3f59af['query']['tag']){_0x587910=_[_0x660f('0x7c')](_0x3f59af[_0x660f('0x3b')]['tag'])?_0x3f59af[_0x660f('0x3b')][_0x660f('0x7d')]:new Array(_0x3f59af['query']['tag']);_0x587910[_0x660f('0x34')](function(_0x108ead){_0x4c88a7['or'](_0x660f('0x6b'),'%,'+_0x108ead+',%');});}if(_0x3f59af['query'][_0x660f('0x7e')]){var _0x7f36af=_0x3f59af['query'][_0x660f('0x7e')][_0x660f('0x7f')]('\x5c','\x5c\x5c')[_0x660f('0x7f')](/'/g,'\x27\x27');if(qs[_0x660f('0x80')](_0x7f36af)){_0xb496b7['or']('i.id\x20LIKE\x20?',_0x7f36af+'%');}else{_0xb496b7['or'](_0x660f('0x81'),qs[_0x660f('0x64')](_0x7f36af))['or'](_0x660f('0x82'),_0x7f36af+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x7f36af+'%');}}}_0x4984c0[_0x660f('0x45')](_0xb496b7);_0x4984c0['group'](_0x660f('0x83'));var _0x285994={'type':db[_0x660f('0x84')][_0x660f('0x85')][_0x660f('0x86')],'raw':!![]};var _0x508b3d=_0x4984c0[_0x660f('0x87')]();_0x508b3d['field'](_0x660f('0x83'));_0x508b3d['field'](_0x660f('0x88'),_0x660f('0x89'));if(_0x278ca4[_0x660f('0x8a')]){_0x278ca4[_0x660f('0x8a')][_0x660f('0x34')](function(_0x3171b5){var _0x191d4a=_0x3171b5[0x0]===_0x660f('0x8b')?_0x3171b5[0x0]:'i.'+_0x3171b5[0x0];_0x4984c0[_0x660f('0x8a')](_0x191d4a,_0x3171b5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x660f('0x8c')](_0x587910)){_0x4984c0[_0x660f('0x5e')](_0x4c88a7);_0x508b3d[_0x660f('0x45')]('t.id\x20IN\x20?',_0x587910);}BPromise['resolve']()['then'](function(){if(!_0x423bba){if(_0x3f59af[_0x660f('0x3b')][_0x660f('0x71')])return;_0x508b3d[_0x660f('0x45')](_0x660f('0x8d'));_0x4984c0[_0x660f('0x45')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3f59af[_0x660f('0x8e')]['role']!==_0x660f('0x8f'))return;return _0x3f59af[_0x660f('0x8e')][_0x660f('0x90')]({'attributes':['id'],'raw':!![]})[_0x660f('0x2c')](function(_0x4d8587){if(_[_0x660f('0x8c')](_0x4d8587)){_0x508b3d[_0x660f('0x45')](_0x660f('0x91'));_0x4984c0[_0x660f('0x45')](_0x660f('0x91'));}else{_0x508b3d['where'](_0x660f('0x72'),_[_0x660f('0x3a')](_0x4d8587,'id'));_0x4984c0[_0x660f('0x45')](_0x660f('0x72'),_[_0x660f('0x3a')](_0x4d8587,'id'));}});})[_0x660f('0x2c')](function(){if(_0x3f59af['user']['role']===_0x660f('0x8f')&&!_0x423bba&&!_0x3f59af['query'][_0x660f('0x71')])return[];return db[_0x660f('0x92')][_0x660f('0x3b')](_0x508b3d['toString'](),_0x285994);})[_0x660f('0x2c')](function(_0x371f9c){_0x5a8976[_0x660f('0x27')]=_0x371f9c[_0x660f('0x41')];if(_0x5a8976[_0x660f('0x27')]===0x0)return[];return db[_0x660f('0x92')]['query'](_0x1579ab[_0x660f('0x93')](),_0x285994)[_0x660f('0x2c')](function(_0x2f01f5){_0x2ee57b=_[_0x660f('0x94')](_0x2f01f5,'id');_0x285994=_[_0x660f('0x95')](_0x285994,{'model':db[_0x660f('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f59af[_0x660f('0x3b')][_0x660f('0x40')]){_0x278ca4[_0x660f('0x3e')]['forEach'](function(_0xb6ee60){_0x4984c0[_0x660f('0x47')]('i.'+_0xb6ee60);});}else{_0x4984c0[_0x660f('0x47')](_0x660f('0x88'),_0x660f('0x89'));_0x4984c0['field']('a.key','Account.key');_0x4984c0[_0x660f('0x47')](_0x660f('0x96'),_0x660f('0x97'));_0x4984c0[_0x660f('0x47')]('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',_0x660f('0x8b'));_0x4984c0[_0x660f('0x47')]('i.*');_0x4984c0[_0x660f('0x47')](_0x660f('0x98'),_0x660f('0x99'));_0x4984c0['field']('c.lastName',_0x660f('0x9a'));_0x4984c0[_0x660f('0x47')]('c.email','Contact.email');_0x4984c0[_0x660f('0x47')]('c.phone',_0x660f('0x9b'));_0x4984c0['field'](_0x660f('0x9c'),_0x660f('0x9d'));_0x4984c0[_0x660f('0x47')](_0x660f('0x9e'),_0x660f('0x9f'));_0x4984c0['field']('o.fullname','Owner.fullname');_0x4984c0[_0x660f('0x47')](_0x660f('0xa0'),_0x660f('0xa1'));_0x4984c0[_0x660f('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x660f('0x32'));}if(_0x278ca4['limit'])_0x4984c0[_0x660f('0x26')](_0x278ca4[_0x660f('0x26')]);if(_0x278ca4['offset'])_0x4984c0[_0x660f('0x24')](_0x278ca4['offset']);return db[_0x660f('0x92')][_0x660f('0x3b')](_0x4984c0[_0x660f('0x93')](),_0x285994);})[_0x660f('0x2c')](function(_0x3bd8da){if(_0x3bd8da[_0x660f('0x41')]>0x0)_0x179351[_0x660f('0x45')](_0x660f('0xa2'),_[_0x660f('0x3a')](_0x3bd8da,'id'));return db['sequelize'][_0x660f('0x3b')](_0x179351[_0x660f('0x93')](),_0x285994)[_0x660f('0x2c')](function(_0x5d3b20){var _0x1ea193=_[_0x660f('0xa3')](_0x5d3b20,_0x660f('0xa4'));var _0x3f8ee3=[];_0x3bd8da['forEach'](function(_0x110c46){_0x3f8ee3[_0x660f('0xa5')](updateOpenchannelInteraction(_0x110c46,_0x2ee57b,_0x1ea193));});return BPromise[_0x660f('0xa6')](_0x3f8ee3);});});})[_0x660f('0x2c')](function(_0x2f098e){_0x5a8976[_0x660f('0xa7')]=_0x2f098e;return _0x5a8976;})[_0x660f('0x2c')](respondWithFilteredResult(_0x4a1b2d,_0x278ca4))[_0x660f('0xa8')](handleError(_0x4a1b2d,null));};exports['show']=function(_0x2ff48e,_0x1f7973){var _0x40d783={};if(_0x2ff48e['query'][_0x660f('0x38')]&&_0x2ff48e['query'][_0x660f('0x38')]==='from'){_0x40d783[_0x660f('0x48')]=_0x2ff48e[_0x660f('0xa9')]['id'];}else{_0x40d783['id']=_0x2ff48e[_0x660f('0xa9')]['id'];}var _0x3a9895={'raw':![],'where':_0x40d783},_0x15065c={};_0x15065c['model']=_[_0x660f('0x3c')](db['OpenchannelInteraction'][_0x660f('0xaa')]);_0x15065c[_0x660f('0x3b')]=_[_0x660f('0x3c')](_0x2ff48e['query']);_0x15065c[_0x660f('0x3d')]=_['intersection'](_0x15065c[_0x660f('0x39')],_0x15065c[_0x660f('0x3b')]);_0x3a9895[_0x660f('0x3e')]=_[_0x660f('0x3f')](_0x15065c[_0x660f('0x39')],qs[_0x660f('0x40')](_0x2ff48e[_0x660f('0x3b')][_0x660f('0x40')]));_0x3a9895[_0x660f('0x3e')]=_0x3a9895[_0x660f('0x3e')]['length']?_0x3a9895[_0x660f('0x3e')]:_0x15065c[_0x660f('0x39')];if(_0x2ff48e[_0x660f('0x3b')][_0x660f('0xab')]){_0x3a9895['include']=[{'all':!![]}];}_0x3a9895=_[_0x660f('0x95')]({},_0x3a9895,_0x2ff48e[_0x660f('0xac')]);return db[_0x660f('0x36')]['find'](_0x3a9895)[_0x660f('0x2c')](handleEntityNotFound(_0x1f7973,null))[_0x660f('0x2c')](respondWithResult(_0x1f7973,null))['catch'](handleError(_0x1f7973,null));};exports[_0x660f('0xad')]=function(_0x3667b0,_0xd95987){return db['OpenchannelInteraction'][_0x660f('0xad')](_0x3667b0[_0x660f('0xae')],{})[_0x660f('0x2c')](respondWithResult(_0xd95987,0xc9))[_0x660f('0xa8')](handleError(_0xd95987,null));};exports[_0x660f('0xaf')]=function(_0x15e708,_0xe596f3){if(_0x15e708[_0x660f('0xae')]['id']){delete _0x15e708[_0x660f('0xae')]['id'];}return db[_0x660f('0x36')]['find']({'where':{'id':_0x15e708[_0x660f('0xa9')]['id']}})['then'](handleEntityNotFound(_0xe596f3,null))['then'](saveUpdates(_0x15e708['body'],null))['then'](respondWithResult(_0xe596f3,null))[_0x660f('0xa8')](handleError(_0xe596f3,null));};exports[_0x660f('0xb0')]=function(_0x53a343,_0x2d424f){return db[_0x660f('0x36')][_0x660f('0x5c')]({'where':{'id':_0x53a343['params']['id']}})[_0x660f('0x2c')](handleEntityNotFound(_0x2d424f,null))[_0x660f('0x2c')](removeEntity(_0x2d424f,null))[_0x660f('0xa8')](handleError(_0x2d424f,null));};exports['describe']=function(_0x374f36,_0x886a08){return db[_0x660f('0x36')]['describe']()['then'](respondWithResult(_0x886a08,null))[_0x660f('0xa8')](handleError(_0x886a08,null));};exports[_0x660f('0xb1')]=function(_0x369acd,_0x5dd800,_0x457377){return db[_0x660f('0xb2')]['find']({'where':{'id':_0x369acd[_0x660f('0xa9')]['id']}})[_0x660f('0x2c')](handleEntityNotFound(_0x5dd800,null))['then'](function(_0x15b40b){if(_0x15b40b){return _0x15b40b[_0x660f('0xb1')](_0x369acd[_0x660f('0xae')][_0x660f('0xb3')],_[_0x660f('0xb4')](_0x369acd[_0x660f('0xae')],[_0x660f('0xb3'),'id'])||{});}})['then'](respondWithResult(_0x5dd800,null))[_0x660f('0xa8')](handleError(_0x5dd800,null));};exports[_0x660f('0xb5')]=function(_0xd901fb,_0x149609,_0x80565f){var _0x5b3f18={'raw':![],'where':{}};var _0x150ee3={};var _0xe9b7f0={'count':0x0,'rows':[]};return db[_0x660f('0x36')]['findOne']({'where':{'id':_0xd901fb[_0x660f('0xa9')]['id']}})[_0x660f('0x2c')](handleEntityNotFound(_0x149609,null))['then'](function(_0x3cae9c){if(_0x3cae9c){_0x150ee3[_0x660f('0x39')]=_[_0x660f('0x3c')](db[_0x660f('0xb2')][_0x660f('0xaa')]);_0x150ee3['query']=_[_0x660f('0x3c')](_0xd901fb[_0x660f('0x3b')]);_0x150ee3[_0x660f('0x3d')]=_['intersection'](_0x150ee3[_0x660f('0x39')],_0x150ee3['query']);_0x5b3f18[_0x660f('0x3e')]=_[_0x660f('0x3f')](_0x150ee3['model'],qs[_0x660f('0x40')](_0xd901fb[_0x660f('0x3b')][_0x660f('0x40')]));_0x5b3f18['attributes']=_0x5b3f18[_0x660f('0x3e')][_0x660f('0x41')]?_0x5b3f18[_0x660f('0x3e')]:_0x150ee3[_0x660f('0x39')];if(!_0xd901fb[_0x660f('0x3b')][_0x660f('0x42')](_0x660f('0x43'))){_0x5b3f18[_0x660f('0x26')]=qs[_0x660f('0x26')](_0xd901fb['query'][_0x660f('0x26')]);_0x5b3f18[_0x660f('0x24')]=qs[_0x660f('0x24')](_0xd901fb[_0x660f('0x3b')]['offset']);}_0x5b3f18[_0x660f('0x8a')]=qs[_0x660f('0x44')](_0xd901fb[_0x660f('0x3b')][_0x660f('0x44')]);_0x5b3f18['where']=qs['filters'](_[_0x660f('0x46')](_0xd901fb[_0x660f('0x3b')],_0x150ee3[_0x660f('0x3d')]));_0x5b3f18[_0x660f('0x45')][_0x660f('0xa4')]=_0x3cae9c['id'];if(_0xd901fb[_0x660f('0x3b')][_0x660f('0x7e')]){_0x5b3f18[_0x660f('0x45')]=_[_0x660f('0x95')](_0x5b3f18[_0x660f('0x45')],{'$or':_[_0x660f('0x3a')](_0x5b3f18[_0x660f('0x3e')],function(_0x52ffe4){var _0xf11e58={};_0xf11e58[_0x52ffe4]={'$like':'%'+_0xd901fb[_0x660f('0x3b')][_0x660f('0x7e')]+'%'};return _0xf11e58;})});}if(_0xd901fb[_0x660f('0x3b')][_0x660f('0x75')]){var _0x50f874=_0xd901fb[_0x660f('0x3b')][_0x660f('0x75')][_0x660f('0x63')](',');var _0x1c110b={};_0x1c110b[_0x50f874[0x0]]={'$gte':moment(_0x50f874[0x1])[_0x660f('0xb6')](_0x660f('0xb7'))};_0x5b3f18[_0x660f('0x45')]=_['merge'](_0x5b3f18[_0x660f('0x45')],_0x1c110b);}_0x5b3f18=_[_0x660f('0x95')]({},_0x5b3f18,_0xd901fb[_0x660f('0xac')]);return db[_0x660f('0xb2')][_0x660f('0x27')]({'where':_0x5b3f18[_0x660f('0x45')]})['then'](function(_0x433eb5){_0xe9b7f0[_0x660f('0x27')]=_0x433eb5;if(_0xd901fb[_0x660f('0x3b')][_0x660f('0xab')]){_0x5b3f18[_0x660f('0xb8')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x5b3f18);})[_0x660f('0x2c')](function(_0x2f7483){_0xe9b7f0[_0x660f('0xa7')]=_0x2f7483;return _0xe9b7f0;});}})[_0x660f('0x2c')](respondWithFilteredResult(_0x149609,_0x5b3f18))[_0x660f('0xa8')](handleError(_0x149609,null));};exports[_0x660f('0xb9')]=function(_0x3e3a22,_0x5337a4,_0x34a7e3){return db['OpenchannelInteraction'][_0x660f('0x5c')]({'where':{'id':_0x3e3a22['params']['id']}})['then'](handleEntityNotFound(_0x5337a4,null))[_0x660f('0x2c')](function(_0x410a34){if(_0x410a34){return _0x410a34[_0x660f('0xba')](_0x3e3a22[_0x660f('0xae')][_0x660f('0xb3')],_[_0x660f('0xb4')](_0x3e3a22[_0x660f('0xae')],[_0x660f('0xb3'),'id'])||{})['spread'](function(){return db[_0x660f('0x6a')]['findAll']({'attributes':['id',_0x660f('0x2f'),'color'],'where':{'id':_0x3e3a22['body'][_0x660f('0xb3')]}});})['then'](function(_0x4c261c){socket[_0x660f('0xbb')]('openchannelInteractionTags:save',{'id':Number(_0x3e3a22[_0x660f('0xa9')]['id']),'tags':_0x4c261c||[]});return{'id':Number(_0x3e3a22[_0x660f('0xa9')]['id']),'tags':_0x4c261c||[]};});}})['then'](respondWithResult(_0x5337a4,null))[_0x660f('0xa8')](handleError(_0x5337a4,null));};exports[_0x660f('0xbc')]=function(_0x2e249b,_0xad9ac6,_0x1ed58f){return db[_0x660f('0x36')][_0x660f('0x5c')]({'where':{'id':_0x2e249b[_0x660f('0xa9')]['id']}})[_0x660f('0x2c')](handleEntityNotFound(_0xad9ac6,null))[_0x660f('0x2c')](function(_0x5708ca){if(_0x5708ca){return _0x5708ca[_0x660f('0xbc')](_0x2e249b['query'][_0x660f('0xb3')]);}})[_0x660f('0x2c')](respondWithStatusCode(_0xad9ac6,null))[_0x660f('0xa8')](handleError(_0xad9ac6,null));};exports[_0x660f('0xbd')]=function(_0x301888,_0x3d2996){var _0x280afa=moment()[_0x660f('0xbe')]()['toString']();var _0x3f5465=path[_0x660f('0xbf')](config[_0x660f('0xc0')],_0x660f('0xc1'),'files',_0x660f('0xc2'));var _0x485c40=path['join'](config['root'],_0x660f('0xc1'),'files',_0x660f('0xc3'));var _0x39803f=path[_0x660f('0xbf')](_0x3f5465,_0x280afa);var _0x184fc7=util['format']('transcript-%d-%s.zip',_0x301888['params']['id'],_0x280afa);var _0x97662=path[_0x660f('0xbf')](_0x3f5465,_0x184fc7);var _0x2a6725=[];_0x2a6725[_0x660f('0xa5')]({'model':db[_0x660f('0x6d')],'as':_0x660f('0x6d'),'attributes':['id','fullname'],'raw':!![]});_0x2a6725[_0x660f('0xa5')]({'model':db[_0x660f('0xc4')],'as':'Contact','attributes':['id',_0x660f('0xc5'),'lastName'],'raw':!![]});if(_0x301888['query'][_0x660f('0xc3')]){_0x2a6725[_0x660f('0xa5')]({'model':db[_0x660f('0xc6')],'as':_0x660f('0xc6'),'raw':!![]});}var _0x4258fd=[{'model':db[_0x660f('0xb2')],'as':'Messages','attributes':['id',_0x660f('0xae'),_0x660f('0xc7'),_0x660f('0xc8'),_0x660f('0xc9'),_0x660f('0x7a')],'include':_0x2a6725}];_0x4258fd[_0x660f('0xa5')]({'model':db['OpenchannelAccount'],'as':_0x660f('0xca'),'attributes':['id',_0x660f('0x2f')]});_0x4258fd[_0x660f('0xa5')]({'model':db[_0x660f('0x6d')],'as':_0x660f('0xcb'),'attributes':['id',_0x660f('0x31')]});return db['OpenchannelInteraction'][_0x660f('0x5c')]({'where':{'id':_0x301888[_0x660f('0xa9')]['id']},'include':_0x4258fd})[_0x660f('0x2c')](handleEntityNotFound(_0x3d2996,null))['then'](function(_0xee1129){if(_0xee1129){var _0x3502e7=_0xee1129[_0x660f('0xcc')]({'plain':!![]});fs['mkdirSync'](_0x39803f);var _0x5d3935={'channel':_0x660f('0xcd'),'account':_0x3502e7[_0x660f('0xca')][_0x660f('0x2f')],'agent':_0x3502e7['Owner']?_0x3502e7[_0x660f('0xcb')]['fullname']:_0x660f('0xce'),'createdAt':moment(_0x3502e7['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x3502e7[_0x660f('0xcf')]?moment(_0x3502e7[_0x660f('0xd0')])['format'](_0x660f('0xb7'))['toString']():'','disposition':_0x3502e7[_0x660f('0xd1')],'visibility':_0x3502e7[_0x660f('0xd2')]?_0x660f('0xd3'):_0x660f('0xd4'),'messages':_(_0x3502e7[_0x660f('0xd5')])[_0x660f('0x7e')]({'secret':![]})['map'](function(_0x5d426f){if(_0x5d426f['Attachment']){var _0x53213c=path[_0x660f('0xbf')](_0x485c40,_0x5d426f[_0x660f('0xc6')][_0x660f('0xd6')]);if(fs[_0x660f('0xd7')](_0x53213c)){fs[_0x660f('0xd8')](_0x53213c)['pipe'](fs[_0x660f('0xd9')](path[_0x660f('0xbf')](_0x39803f,_0x5d426f[_0x660f('0xc6')]['basename'])));}}return{'date':moment(_0x5d426f[_0x660f('0xc7')])['format'](_0x660f('0xb7'))[_0x660f('0x93')](),'sender':_0x5d426f[_0x660f('0xc8')]===_0x660f('0xda')?_0x5d426f['User']?_0x5d426f[_0x660f('0x6d')]['fullname']:_0x660f('0xdb'):_0x5d426f[_0x660f('0x60')]['firstName']+(_0x5d426f[_0x660f('0x60')]['lastName']?'\x20'+_0x5d426f['Contact'][_0x660f('0xdc')]:''),'body':_0x5d426f[_0x660f('0xc6')]?_0x5d426f['Attachment'][_0x660f('0xd6')]:_0x5d426f[_0x660f('0xae')],'direction':_0x5d426f[_0x660f('0xc8')]===_0x660f('0xda')?'A':'C','secret':_0x5d426f[_0x660f('0xc9')],'read':_0x5d426f[_0x660f('0x7a')],'attachment':_0x5d426f[_0x660f('0xc6')]};})[_0x660f('0x5d')]()};return ejs[_0x660f('0xdd')](path[_0x660f('0xbf')](config[_0x660f('0xc0')],_0x660f('0xc1'),_0x660f('0xde'),'downloadInteraction.ejs'),{'interaction':_0x5d3935})['then'](function(_0x54f122){var _0x512833=path[_0x660f('0xbf')](_0x39803f,_0x660f('0xdf')+_0x3502e7['id']+'-'+_0x280afa+_0x660f('0xe0'));var _0x33aece={'path':_0x512833,'channel':'Openchannel','interactionId':_0x3502e7['id']};return pdf['createPdfFromHTML'](_0x54f122,_0x33aece);})['then'](function(){return new BPromise(function(_0x12f3ab,_0x4d308d){zipdir(_0x39803f,{'saveTo':_0x97662},function(_0x3b45d7,_0x1e9dae){if(_0x3b45d7)return _0x4d308d(_0x3b45d7);return _0x12f3ab(_0x1e9dae);});})['then'](function(){return new BPromise(function(_0x47e67a,_0x161a2a){rimraf(_0x39803f,function(_0x52e750){if(_0x52e750)_0x161a2a(_0x52e750);return _0x47e67a();});});})['then'](function(){return _0x3d2996[_0x660f('0xbd')](_0x97662,_0x184fc7,function(_0xe5b652){if(_0xe5b652){console[_0x660f('0xe1')](_0x660f('0xe2'),_0xe5b652);}else{fs[_0x660f('0xe3')](_0x97662);}});});});}else{return _0x3d2996[_0x660f('0x20')](0xc8);}})[_0x660f('0xa8')](handleError(_0x3d2996,null));}; \ No newline at end of file +var _0xc30f=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','end','stack','name','Users','map','fullname','TagIds','split','catch','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','field','color','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','select','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','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','search','parseSearch','sqlOperator','conditions','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','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','body','compact','isEmpty','forEach','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','isNumeric','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?','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','show','from','params','includeAll','options','create','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','lastName','attachments','Messages','secret','Owner','get','mkdirSync','Account','N.A.','closed','closedAt','threadId','Public','Private','Attachment','existsSync','pipe','createWriteStream','basename','firstName','direction','out','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0xc30f,0xda));var _0xfc30=function(_0xe421c0,_0x51fe86){_0xe421c0=_0xe421c0-0x0;var _0x12317d=_0xc30f[_0xe421c0];return _0x12317d;};'use strict';var emlformat=require(_0xfc30('0x0'));var rimraf=require(_0xfc30('0x1'));var zipdir=require(_0xfc30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc30('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfc30('0x4'));var util=require(_0xfc30('0x5'));var path=require('path');var sox=require(_0xfc30('0x6'));var csv=require(_0xfc30('0x7'));var ejs=require(_0xfc30('0x8'));var fs=require('fs');var fs_extra=require(_0xfc30('0x9'));var _=require(_0xfc30('0xa'));var squel=require('squel');var crypto=require(_0xfc30('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfc30('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfc30('0xd'));var Papa=require(_0xfc30('0xe'));var Redis=require(_0xfc30('0xf'));var authService=require(_0xfc30('0x10'));var qs=require(_0xfc30('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xfc30('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc30('0x13'))(_0xfc30('0x14'));var utils=require(_0xfc30('0x15'));var config=require(_0xfc30('0x16'));var licenseUtil=require(_0xfc30('0x17'));var db=require('../../mysqldb')['db'];config[_0xfc30('0x18')]=_[_0xfc30('0x19')](config[_0xfc30('0x18')],{'host':_0xfc30('0x1a'),'port':0x18eb});var socket=require(_0xfc30('0x1b'))(new Redis(config['redis']));require(_0xfc30('0x1c'))[_0xfc30('0x1d')](socket);function respondWithStatusCode(_0x29b21d,_0x1e09d5){_0x1e09d5=_0x1e09d5||0xcc;return function(_0x2f7b6e){if(_0x2f7b6e){return _0x29b21d[_0xfc30('0x1e')](_0x1e09d5);}return _0x29b21d[_0xfc30('0x1f')](_0x1e09d5)['end']();};}function respondWithResult(_0x56a46f,_0x308648){_0x308648=_0x308648||0xc8;return function(_0x5a08fc){if(_0x5a08fc){return _0x56a46f[_0xfc30('0x1f')](_0x308648)['json'](_0x5a08fc);}};}function respondWithFilteredResult(_0x43a206,_0x528c18){return function(_0x49ffec){if(_0x49ffec){var _0x32f9b7=typeof _0x528c18['offset']===_0xfc30('0x20')&&typeof _0x528c18[_0xfc30('0x21')]==='undefined';var _0x574202=_0x49ffec[_0xfc30('0x22')];var _0x2637d8=_0x32f9b7?0x0:_0x528c18[_0xfc30('0x23')];var _0x489314=_0x32f9b7?_0x49ffec['count']:_0x528c18[_0xfc30('0x23')]+_0x528c18[_0xfc30('0x21')];var _0x56ecbb;if(_0x489314>=_0x574202){_0x489314=_0x574202;_0x56ecbb=0xc8;}else{_0x56ecbb=0xce;}_0x43a206[_0xfc30('0x1f')](_0x56ecbb);return _0x43a206[_0xfc30('0x24')](_0xfc30('0x25'),_0x2637d8+'-'+_0x489314+'/'+_0x574202)[_0xfc30('0x26')](_0x49ffec);}return null;};}function patchUpdates(_0x313fb0){return function(_0x493297){try{jsonpatch[_0xfc30('0x27')](_0x493297,_0x313fb0,!![]);}catch(_0x32f476){return BPromise[_0xfc30('0x28')](_0x32f476);}return _0x493297[_0xfc30('0x29')]();};}function saveUpdates(_0x41e4e0,_0x391c41){return function(_0x4e53fe){if(_0x4e53fe){return _0x4e53fe['update'](_0x41e4e0)[_0xfc30('0x2a')](function(_0x24e4cd){return _0x24e4cd;});}return null;};}function removeEntity(_0x1491fd,_0x4d5d7c){return function(_0x519039){if(_0x519039){return _0x519039['destroy']()['then'](function(){_0x1491fd[_0xfc30('0x1f')](0xcc)[_0xfc30('0x2b')]();});}};}function handleEntityNotFound(_0x1fef89,_0x459315){return function(_0x24746e){if(!_0x24746e){_0x1fef89[_0xfc30('0x1e')](0x194);}return _0x24746e;};}function handleError(_0x29479d,_0x537490){_0x537490=_0x537490||0x1f4;return function(_0x4820cc){logger['error'](_0x4820cc[_0xfc30('0x2c')]);if(_0x4820cc[_0xfc30('0x2d')]){delete _0x4820cc['name'];}_0x29479d[_0xfc30('0x1f')](_0x537490)['send'](_0x4820cc);};}function getInteractionUsers(_0x405c1c,_0xb7f848){return new BPromise(function(_0x5b697a,_0x186824){try{if(_0xb7f848[_0x405c1c['id']]){_0x405c1c[_0xfc30('0x2e')]=_[_0xfc30('0x2f')](_0xb7f848[_0x405c1c['id']],function(_0x44fab6){return{'id':_0x44fab6['id'],'fullname':_0x44fab6[_0xfc30('0x30')]};});}}catch(_0x44b58c){_0x186824(_0x44b58c);}_0x5b697a(_0x405c1c);});}function getInteractionTags(_0x23ddb5,_0x1f65fe){return new BPromise(function(_0x3e78b2,_0x49db36){try{if(_0x23ddb5['TagIds']){_0x23ddb5['Tags']=[];_0x23ddb5[_0xfc30('0x31')][_0xfc30('0x32')](',')['forEach'](function(_0x1bafa5){_0x23ddb5['Tags']['push'](_0x1f65fe[_0x1bafa5]);});}delete _0x23ddb5[_0xfc30('0x31')];}catch(_0x517efd){_0x49db36(_0x517efd);}_0x3e78b2(_0x23ddb5);});}function updateOpenchannelInteraction(_0xda5bc5,_0x58cb3e,_0x4f5e70){return new BPromise(function(_0x512a73,_0x143afb){return getInteractionUsers(_0xda5bc5,_0x4f5e70)[_0xfc30('0x2a')](function(_0x393342){return getInteractionTags(_0x393342,_0x58cb3e);})['then'](function(_0x456972){_0x512a73(_0x456972);})[_0xfc30('0x33')](function(_0x5b40c8){_0x143afb(_0x5b40c8);});});}exports[_0xfc30('0x34')]=function(_0x1cdc23,_0x4f222b){var _0x3f2f88={},_0x2b6d01={},_0x5bbd94={'count':0x0,'rows':[]};var _0x165044=_[_0xfc30('0x2f')](db['OpenchannelInteraction'][_0xfc30('0x35')],function(_0x4c524b){return{'name':_0x4c524b[_0xfc30('0x36')],'type':_0x4c524b[_0xfc30('0x37')][_0xfc30('0x38')]};});_0x2b6d01[_0xfc30('0x39')]=_[_0xfc30('0x2f')](_0x165044,_0xfc30('0x2d'));_0x2b6d01[_0xfc30('0x3a')]=_[_0xfc30('0x3b')](_0x1cdc23[_0xfc30('0x3a')]);_0x2b6d01[_0xfc30('0x3c')]=_['intersection'](_0x2b6d01[_0xfc30('0x39')],_0x2b6d01[_0xfc30('0x3a')]);_0x3f2f88[_0xfc30('0x3d')]=_[_0xfc30('0x3e')](_0x2b6d01[_0xfc30('0x39')],qs['fields'](_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x3f')]));_0x3f2f88[_0xfc30('0x3d')]=_0x3f2f88[_0xfc30('0x3d')][_0xfc30('0x40')]?_0x3f2f88[_0xfc30('0x3d')]:_0x2b6d01[_0xfc30('0x39')];if(!_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x41')](_0xfc30('0x42'))){_0x3f2f88[_0xfc30('0x21')]=qs[_0xfc30('0x21')](_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x21')]);_0x3f2f88[_0xfc30('0x23')]=qs[_0xfc30('0x23')](_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x23')]);}_0x3f2f88[_0xfc30('0x43')]=qs[_0xfc30('0x44')](_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x44')]);_0x3f2f88[_0xfc30('0x45')]=qs[_0xfc30('0x3c')](_['pick'](_0x1cdc23[_0xfc30('0x3a')],_0x2b6d01['filters']),_0x165044);var _0x2a4cce=[];var _0x43f50a=squel['select']()['field']('id')[_0xfc30('0x46')](_0xfc30('0x2d'))[_0xfc30('0x46')](_0xfc30('0x47'))['from']('tools_tags');var _0x140e17=squel['select']()['field'](_0xfc30('0x48'))[_0xfc30('0x46')](_0xfc30('0x49'))[_0xfc30('0x46')](_0xfc30('0x4a'))['from'](_0xfc30('0x4b'),'ui')[_0xfc30('0x4c')]('users','u',_0xfc30('0x4d'));var _0x592006=squel[_0xfc30('0x4e')]()['from'](_0xfc30('0x4f'),'i')[_0xfc30('0x4c')](_0xfc30('0x50'),'c',_0xfc30('0x51'))[_0xfc30('0x4c')](_0xfc30('0x52'),'o',_0xfc30('0x53'))[_0xfc30('0x4c')]('openchannel_accounts','a',_0xfc30('0x54'))[_0xfc30('0x4c')](_0xfc30('0x55'),'me',_0xfc30('0x56'))[_0xfc30('0x4c')](_0xfc30('0x57'),'it',_0xfc30('0x58'))[_0xfc30('0x4c')]('tools_tags','t',_0xfc30('0x59'));var _0x1bb2dc=squel[_0xfc30('0x5a')]();var _0x42ff9c=[];var _0x14532c=squel[_0xfc30('0x5a')]();var _0x569887;if(_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x5b')]){_0x569887=as[_0xfc30('0x5c')](_0x1cdc23[_0xfc30('0x3a')]['search']);var _0x198db0=_0x569887[_0xfc30('0x5d')];for(var _0x2fbc3d=0x0;_0x2fbc3d<_0x569887['conditions'][_0xfc30('0x40')];_0x2fbc3d++){var _0x2eca8a=_0x569887[_0xfc30('0x5e')][_0x2fbc3d];var _0x3f2672='i';var _0x2aa55c=_[_0xfc30('0x5f')](_0x165044,['name',_0x2eca8a[_0xfc30('0x46')]]);if(!_0x2aa55c){switch(_0x2eca8a['field']){case _0xfc30('0x60'):if(_0x2eca8a[_0xfc30('0x61')]==0x1){_0x592006[_0xfc30('0x62')]('`'+_0x2eca8a['field']+_0xfc30('0x63'));}else{_0x592006[_0xfc30('0x62')]('`'+_0x2eca8a[_0xfc30('0x46')]+'`\x20>\x200');}break;case _0xfc30('0x64'):if(_0x2eca8a[_0xfc30('0x65')]===_0xfc30('0x66')){if(_0x2eca8a[_0xfc30('0x61')][_0xfc30('0x32')]('\x20')['length']>0x1){_0x1bb2dc[_0x198db0](_0xfc30('0x67'),qs[_0xfc30('0x68')](_0x2eca8a[_0xfc30('0x61')]),null);}else{var _0x54fc20='%'+_0x2eca8a[_0xfc30('0x61')]+'%';_0x1bb2dc[_0x198db0](_0xfc30('0x69'),_0x54fc20,_0x54fc20,_0x54fc20);}}else{_0x2aa55c=_[_0xfc30('0x5f')](_0x165044,['name',_0xfc30('0x6a')]);_0x2eca8a[_0xfc30('0x46')]=_0xfc30('0x6a');_0x457342=as[_0xfc30('0x6b')](_0x3f2672,_0x2aa55c['type'],_0x2eca8a);_0x1bb2dc[_0x198db0](_0x457342[_0xfc30('0x6c')],_0x457342[_0xfc30('0x61')][_0xfc30('0x6d')],_0x457342[_0xfc30('0x61')][_0xfc30('0x2b')]);}break;case _0xfc30('0x6e'):var _0x52471f=_0x2eca8a['value'][_0xfc30('0x32')](',')[_0xfc30('0x2f')](function(_0x248f7c){return Number(_0x248f7c);});_0x52471f['forEach'](function(_0x5b2c53){_0x14532c['or'](_0xfc30('0x6f'),'%,'+_0x5b2c53+',%');});_0x42ff9c=_[_0xfc30('0x70')](_0x42ff9c,_0x52471f);break;case _0xfc30('0x71'):if(_0x2eca8a[_0xfc30('0x65')]===_0xfc30('0x66')){_0x1bb2dc[_0x198db0](_0xfc30('0x72'),'%'+_0x2eca8a[_0xfc30('0x61')]+'%',null);}else{_0x2aa55c=_[_0xfc30('0x5f')](_0x165044,['name',_0xfc30('0x73')]);_0x2eca8a[_0xfc30('0x46')]='UserId';_0x457342=as[_0xfc30('0x6b')](_0x3f2672,_0x2aa55c[_0xfc30('0x37')],_0x2eca8a);_0x1bb2dc[_0x198db0](_0x457342[_0xfc30('0x6c')],_0x457342[_0xfc30('0x61')]['start'],_0x457342[_0xfc30('0x61')][_0xfc30('0x2b')]);}break;case _0xfc30('0x74'):_0x457342=as[_0xfc30('0x6b')]('me',null,_0x2eca8a);_0x1bb2dc[_0x198db0](_0x457342[_0xfc30('0x6c')],_0x457342[_0xfc30('0x61')][_0xfc30('0x6d')],_0x457342['value'][_0xfc30('0x2b')]);break;}}else{var _0x457342=as[_0xfc30('0x6b')](_0x3f2672,_0x2aa55c[_0xfc30('0x37')],_0x2eca8a);_0x1bb2dc[_0x198db0](_0x457342[_0xfc30('0x6c')],_0x457342[_0xfc30('0x61')][_0xfc30('0x6d')],_0x457342[_0xfc30('0x61')][_0xfc30('0x2b')]);}}}else{var _0x65fe86=_(_0x1cdc23[_0xfc30('0x3a')])[_0xfc30('0x3b')]()['map'](function(_0xb69f1c){return _['some'](_0x165044,[_0xfc30('0x2d'),_0xb69f1c])?_0xb69f1c:undefined;})[_0xfc30('0x75')]()[_0xfc30('0x61')]();if(!_[_0xfc30('0x76')](_0x65fe86)){_0x65fe86[_0xfc30('0x77')](function(_0x2c040a){if(_0x2c040a==='OpenchannelAccountId'){_0x592006[_0xfc30('0x45')](_0xfc30('0x78'),[][_0xfc30('0x79')](_0x1cdc23[_0xfc30('0x3a')][_0x2c040a]));}else if(_0x2c040a===_0xfc30('0x7a')){var _0x2d6085=JSON[_0xfc30('0x7b')](_0x1cdc23['query'][_0x2c040a])['$gte'];var _0x25c945=JSON['parse'](_0x1cdc23[_0xfc30('0x3a')][_0x2c040a])[_0xfc30('0x7c')];_0x592006[_0xfc30('0x45')](_0xfc30('0x7d'),_0x2d6085,_0x25c945);}else{if(_0x1cdc23['query'][_0x2c040a]===_0xfc30('0x7e')){_0x592006[_0xfc30('0x45')]('i.'+_0x2c040a+_0xfc30('0x7f'));}else{_0x592006[_0xfc30('0x45')]('i.'+_0x2c040a+_0xfc30('0x80'),_0x1cdc23[_0xfc30('0x3a')][_0x2c040a]);}}});}if(_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x81')]){if(_0x1cdc23[_0xfc30('0x3a')]['read']==0x1){_0x592006[_0xfc30('0x62')]('`unreadMessages`\x20=\x200');}else{_0x592006[_0xfc30('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x82')]){_0x42ff9c=_[_0xfc30('0x83')](_0x1cdc23['query'][_0xfc30('0x82')])?_0x1cdc23[_0xfc30('0x3a')]['tag']:new Array(_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x82')]);_0x42ff9c[_0xfc30('0x77')](function(_0x2a28ab){_0x14532c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a28ab+',%');});}if(_0x1cdc23['query'][_0xfc30('0x84')]){var _0x4581ea=_0x1cdc23['query'][_0xfc30('0x84')]['replace']('\x5c','\x5c\x5c')[_0xfc30('0x85')](/'/g,'\x27\x27');if(qs[_0xfc30('0x86')](_0x4581ea)){_0x1bb2dc['or'](_0xfc30('0x87'),_0x4581ea+'%');}else{_0x1bb2dc['or'](_0xfc30('0x88'),qs[_0xfc30('0x68')](_0x4581ea))['or'](_0xfc30('0x89'),_0x4581ea+'%')['or'](_0xfc30('0x8a'),_0x4581ea+'%');}}}_0x592006[_0xfc30('0x45')](_0x1bb2dc);_0x592006[_0xfc30('0x8b')]('i.id');var _0x1cab05={'type':db['Sequelize'][_0xfc30('0x8c')][_0xfc30('0x8d')],'raw':!![]};var _0x503628=_0x592006[_0xfc30('0x8e')]();_0x503628['field'](_0xfc30('0x8f'));_0x503628[_0xfc30('0x46')](_0xfc30('0x90'),'unreadMessages');if(_0x3f2f88[_0xfc30('0x43')]){_0x3f2f88[_0xfc30('0x43')]['forEach'](function(_0x1bfa56){var _0x5d50fb=_0x1bfa56[0x0]===_0xfc30('0x91')?_0x1bfa56[0x0]:'i.'+_0x1bfa56[0x0];_0x592006['order'](_0x5d50fb,_0x1bfa56[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfc30('0x76')](_0x42ff9c)){_0x592006[_0xfc30('0x62')](_0x14532c);_0x503628[_0xfc30('0x45')](_0xfc30('0x92'),_0x42ff9c);}BPromise[_0xfc30('0x93')]()[_0xfc30('0x2a')](function(){if(!_0x569887){if(_0x1cdc23['query'][_0xfc30('0x94')])return;_0x503628[_0xfc30('0x45')](_0xfc30('0x95'));_0x592006[_0xfc30('0x45')](_0xfc30('0x95'));return;}if(_0x1cdc23['user'][_0xfc30('0x96')]!==_0xfc30('0x97'))return;return _0x1cdc23[_0xfc30('0x98')][_0xfc30('0x99')]({'attributes':['id'],'raw':!![]})[_0xfc30('0x2a')](function(_0x2a71a7){if(_['isEmpty'](_0x2a71a7)){_0x503628[_0xfc30('0x45')](_0xfc30('0x9a'));_0x592006[_0xfc30('0x45')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x503628[_0xfc30('0x45')](_0xfc30('0x78'),_['map'](_0x2a71a7,'id'));_0x592006['where'](_0xfc30('0x78'),_['map'](_0x2a71a7,'id'));}});})[_0xfc30('0x2a')](function(){if(_0x1cdc23[_0xfc30('0x98')][_0xfc30('0x96')]==='agent'&&!_0x569887&&!_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x94')])return[];return db[_0xfc30('0x9b')][_0xfc30('0x3a')](_0x503628[_0xfc30('0x9c')](),_0x1cab05);})[_0xfc30('0x2a')](function(_0x1eb131){_0x5bbd94[_0xfc30('0x22')]=_0x1eb131['length'];if(_0x5bbd94[_0xfc30('0x22')]===0x0)return[];return db[_0xfc30('0x9b')][_0xfc30('0x3a')](_0x43f50a['toString'](),_0x1cab05)[_0xfc30('0x2a')](function(_0x41ef8f){_0x2a4cce=_[_0xfc30('0x9d')](_0x41ef8f,'id');_0x1cab05=_[_0xfc30('0x9e')](_0x1cab05,{'model':db[_0xfc30('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1cdc23[_0xfc30('0x3a')][_0xfc30('0x3f')]){_0x3f2f88['attributes'][_0xfc30('0x77')](function(_0x4cd8b4){_0x592006[_0xfc30('0x46')]('i.'+_0x4cd8b4);});}else{_0x592006['field'](_0xfc30('0x90'),'unreadMessages');_0x592006['field'](_0xfc30('0xa0'),'Account.key');_0x592006['field'](_0xfc30('0xa1'),_0xfc30('0xa2'));_0x592006[_0xfc30('0x46')]('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');_0x592006[_0xfc30('0x46')]('i.*');_0x592006[_0xfc30('0x46')](_0xfc30('0xa3'),_0xfc30('0xa4'));_0x592006[_0xfc30('0x46')](_0xfc30('0xa5'),_0xfc30('0xa6'));_0x592006['field'](_0xfc30('0xa7'),'Contact.email');_0x592006['field'](_0xfc30('0xa8'),_0xfc30('0xa9'));_0x592006[_0xfc30('0x46')]('c.mobile',_0xfc30('0xaa'));_0x592006[_0xfc30('0x46')](_0xfc30('0xab'),_0xfc30('0xac'));_0x592006['field'](_0xfc30('0xad'),_0xfc30('0xae'));_0x592006[_0xfc30('0x46')](_0xfc30('0xaf'),_0xfc30('0xb0'));_0x592006[_0xfc30('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfc30('0x31'));}if(_0x3f2f88[_0xfc30('0x21')])_0x592006['limit'](_0x3f2f88[_0xfc30('0x21')]);if(_0x3f2f88['offset'])_0x592006['offset'](_0x3f2f88[_0xfc30('0x23')]);return db[_0xfc30('0x9b')][_0xfc30('0x3a')](_0x592006[_0xfc30('0x9c')](),_0x1cab05);})[_0xfc30('0x2a')](function(_0x4ed70a){if(_0x4ed70a[_0xfc30('0x40')]>0x0)_0x140e17['where'](_0xfc30('0xb1'),_[_0xfc30('0x2f')](_0x4ed70a,'id'));return db[_0xfc30('0x9b')][_0xfc30('0x3a')](_0x140e17[_0xfc30('0x9c')](),_0x1cab05)['then'](function(_0x1249b4){var _0x546fbc=_[_0xfc30('0xb2')](_0x1249b4,_0xfc30('0xb3'));var _0x2a454b=[];_0x4ed70a[_0xfc30('0x77')](function(_0x35e54f){_0x2a454b['push'](updateOpenchannelInteraction(_0x35e54f,_0x2a4cce,_0x546fbc));});return BPromise['all'](_0x2a454b);});});})[_0xfc30('0x2a')](function(_0x3a40e1){_0x5bbd94['rows']=_0x3a40e1;return _0x5bbd94;})['then'](respondWithFilteredResult(_0x4f222b,_0x3f2f88))[_0xfc30('0x33')](handleError(_0x4f222b,null));};exports[_0xfc30('0xb4')]=function(_0x4089e3,_0x5e26a6){var _0x122ad5={};if(_0x4089e3[_0xfc30('0x3a')][_0xfc30('0x37')]&&_0x4089e3[_0xfc30('0x3a')]['type']===_0xfc30('0xb5')){_0x122ad5[_0xfc30('0xb5')]=_0x4089e3[_0xfc30('0xb6')]['id'];}else{_0x122ad5['id']=_0x4089e3[_0xfc30('0xb6')]['id'];}var _0x3f8663={'raw':![],'where':_0x122ad5},_0x552098={};_0x552098['model']=_[_0xfc30('0x3b')](db[_0xfc30('0x9f')][_0xfc30('0x35')]);_0x552098[_0xfc30('0x3a')]=_['keys'](_0x4089e3[_0xfc30('0x3a')]);_0x552098[_0xfc30('0x3c')]=_['intersection'](_0x552098[_0xfc30('0x39')],_0x552098[_0xfc30('0x3a')]);_0x3f8663[_0xfc30('0x3d')]=_[_0xfc30('0x3e')](_0x552098[_0xfc30('0x39')],qs[_0xfc30('0x3f')](_0x4089e3[_0xfc30('0x3a')][_0xfc30('0x3f')]));_0x3f8663[_0xfc30('0x3d')]=_0x3f8663[_0xfc30('0x3d')][_0xfc30('0x40')]?_0x3f8663['attributes']:_0x552098['model'];if(_0x4089e3[_0xfc30('0x3a')][_0xfc30('0xb7')]){_0x3f8663['include']=[{'all':!![]}];}_0x3f8663=_[_0xfc30('0x9e')]({},_0x3f8663,_0x4089e3[_0xfc30('0xb8')]);return db[_0xfc30('0x9f')]['find'](_0x3f8663)['then'](handleEntityNotFound(_0x5e26a6,null))[_0xfc30('0x2a')](respondWithResult(_0x5e26a6,null))[_0xfc30('0x33')](handleError(_0x5e26a6,null));};exports[_0xfc30('0xb9')]=function(_0x160c37,_0x35099e){return db[_0xfc30('0x9f')][_0xfc30('0xb9')](_0x160c37[_0xfc30('0x74')],{})['then'](respondWithResult(_0x35099e,0xc9))[_0xfc30('0x33')](handleError(_0x35099e,null));};exports['update']=function(_0x130999,_0x2bf2ce){if(_0x130999[_0xfc30('0x74')]['id']){delete _0x130999[_0xfc30('0x74')]['id'];}return db[_0xfc30('0x9f')][_0xfc30('0x5f')]({'where':{'id':_0x130999[_0xfc30('0xb6')]['id']}})[_0xfc30('0x2a')](handleEntityNotFound(_0x2bf2ce,null))['then'](saveUpdates(_0x130999['body'],null))[_0xfc30('0x2a')](respondWithResult(_0x2bf2ce,null))[_0xfc30('0x33')](handleError(_0x2bf2ce,null));};exports[_0xfc30('0xba')]=function(_0x31f042,_0x1496cd){return db[_0xfc30('0x9f')]['find']({'where':{'id':_0x31f042[_0xfc30('0xb6')]['id']}})[_0xfc30('0x2a')](handleEntityNotFound(_0x1496cd,null))['then'](removeEntity(_0x1496cd,null))[_0xfc30('0x33')](handleError(_0x1496cd,null));};exports[_0xfc30('0xbb')]=function(_0x5a8175,_0x283f6c){return db[_0xfc30('0x9f')][_0xfc30('0xbb')]()[_0xfc30('0x2a')](respondWithResult(_0x283f6c,null))[_0xfc30('0x33')](handleError(_0x283f6c,null));};exports[_0xfc30('0xbc')]=function(_0x4cb72b,_0x20abef,_0x60fcce){return db[_0xfc30('0xbd')][_0xfc30('0x5f')]({'where':{'id':_0x4cb72b[_0xfc30('0xb6')]['id']}})['then'](handleEntityNotFound(_0x20abef,null))[_0xfc30('0x2a')](function(_0x38b4a2){if(_0x38b4a2){return _0x38b4a2[_0xfc30('0xbc')](_0x4cb72b[_0xfc30('0x74')][_0xfc30('0xbe')],_[_0xfc30('0xbf')](_0x4cb72b['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x20abef,null))[_0xfc30('0x33')](handleError(_0x20abef,null));};exports[_0xfc30('0xc0')]=function(_0x4b142a,_0x135b69,_0x25d843){var _0x2bad5f={'raw':![],'where':{}};var _0x3a9df1={};var _0x2b3077={'count':0x0,'rows':[]};return db[_0xfc30('0x9f')]['findOne']({'where':{'id':_0x4b142a[_0xfc30('0xb6')]['id']}})[_0xfc30('0x2a')](handleEntityNotFound(_0x135b69,null))[_0xfc30('0x2a')](function(_0x346bf3){if(_0x346bf3){_0x3a9df1['model']=_['keys'](db[_0xfc30('0xbd')][_0xfc30('0x35')]);_0x3a9df1[_0xfc30('0x3a')]=_[_0xfc30('0x3b')](_0x4b142a['query']);_0x3a9df1[_0xfc30('0x3c')]=_[_0xfc30('0x3e')](_0x3a9df1[_0xfc30('0x39')],_0x3a9df1[_0xfc30('0x3a')]);_0x2bad5f['attributes']=_['intersection'](_0x3a9df1['model'],qs['fields'](_0x4b142a[_0xfc30('0x3a')][_0xfc30('0x3f')]));_0x2bad5f['attributes']=_0x2bad5f['attributes']['length']?_0x2bad5f['attributes']:_0x3a9df1[_0xfc30('0x39')];if(!_0x4b142a[_0xfc30('0x3a')][_0xfc30('0x41')]('nolimit')){_0x2bad5f[_0xfc30('0x21')]=qs[_0xfc30('0x21')](_0x4b142a['query']['limit']);_0x2bad5f[_0xfc30('0x23')]=qs['offset'](_0x4b142a[_0xfc30('0x3a')]['offset']);}_0x2bad5f[_0xfc30('0x43')]=qs[_0xfc30('0x44')](_0x4b142a[_0xfc30('0x3a')][_0xfc30('0x44')]);_0x2bad5f[_0xfc30('0x45')]=qs['filters'](_['pick'](_0x4b142a[_0xfc30('0x3a')],_0x3a9df1[_0xfc30('0x3c')]));_0x2bad5f[_0xfc30('0x45')]['OpenchannelInteractionId']=_0x346bf3['id'];if(_0x4b142a[_0xfc30('0x3a')][_0xfc30('0x84')]){_0x2bad5f[_0xfc30('0x45')]=_[_0xfc30('0x9e')](_0x2bad5f[_0xfc30('0x45')],{'$or':_['map'](_0x2bad5f[_0xfc30('0x3d')],function(_0x40e402){var _0x12b432={};_0x12b432[_0x40e402]={'$like':'%'+_0x4b142a[_0xfc30('0x3a')]['filter']+'%'};return _0x12b432;})});}if(_0x4b142a[_0xfc30('0x3a')]['$gte']){var _0xfece63=_0x4b142a[_0xfc30('0x3a')][_0xfc30('0xc1')]['split'](',');var _0x1b6b0d={};_0x1b6b0d[_0xfece63[0x0]]={'$gte':moment(_0xfece63[0x1])[_0xfc30('0xc2')](_0xfc30('0xc3'))};_0x2bad5f['where']=_[_0xfc30('0x9e')](_0x2bad5f['where'],_0x1b6b0d);}_0x2bad5f=_[_0xfc30('0x9e')]({},_0x2bad5f,_0x4b142a[_0xfc30('0xb8')]);return db[_0xfc30('0xbd')]['count']({'where':_0x2bad5f[_0xfc30('0x45')]})[_0xfc30('0x2a')](function(_0xf23bfb){_0x2b3077[_0xfc30('0x22')]=_0xf23bfb;if(_0x4b142a['query'][_0xfc30('0xb7')]){_0x2bad5f[_0xfc30('0xc4')]=[{'all':!![]}];}return db[_0xfc30('0xbd')][_0xfc30('0xc5')](_0x2bad5f);})[_0xfc30('0x2a')](function(_0xbae9f8){_0x2b3077['rows']=_0xbae9f8;return _0x2b3077;});}})[_0xfc30('0x2a')](respondWithFilteredResult(_0x135b69,_0x2bad5f))[_0xfc30('0x33')](handleError(_0x135b69,null));};exports[_0xfc30('0xc6')]=function(_0x296244,_0x513689,_0x5b650c){return db[_0xfc30('0x9f')]['find']({'where':{'id':_0x296244[_0xfc30('0xb6')]['id']}})[_0xfc30('0x2a')](handleEntityNotFound(_0x513689,null))[_0xfc30('0x2a')](function(_0x797a01){if(_0x797a01){return _0x797a01[_0xfc30('0xc7')](_0x296244[_0xfc30('0x74')][_0xfc30('0xbe')],_[_0xfc30('0xbf')](_0x296244[_0xfc30('0x74')],['ids','id'])||{})[_0xfc30('0xc8')](function(){return db[_0xfc30('0x6e')][_0xfc30('0xc5')]({'attributes':['id',_0xfc30('0x2d'),_0xfc30('0x47')],'where':{'id':_0x296244[_0xfc30('0x74')][_0xfc30('0xbe')]}});})[_0xfc30('0x2a')](function(_0x1cda8a){socket[_0xfc30('0xc9')](_0xfc30('0xca'),{'id':Number(_0x296244[_0xfc30('0xb6')]['id']),'tags':_0x1cda8a||[]});return{'id':Number(_0x296244[_0xfc30('0xb6')]['id']),'tags':_0x1cda8a||[]};});}})['then'](respondWithResult(_0x513689,null))['catch'](handleError(_0x513689,null));};exports[_0xfc30('0xcb')]=function(_0x419dd3,_0x41dd0a,_0x222199){return db[_0xfc30('0x9f')][_0xfc30('0x5f')]({'where':{'id':_0x419dd3[_0xfc30('0xb6')]['id']}})['then'](handleEntityNotFound(_0x41dd0a,null))[_0xfc30('0x2a')](function(_0x126d5b){if(_0x126d5b){return _0x126d5b[_0xfc30('0xcb')](_0x419dd3[_0xfc30('0x3a')][_0xfc30('0xbe')]);}})[_0xfc30('0x2a')](respondWithStatusCode(_0x41dd0a,null))[_0xfc30('0x33')](handleError(_0x41dd0a,null));};exports[_0xfc30('0xcc')]=function(_0x5d1ace,_0x4ad134){var _0x389616=moment()[_0xfc30('0xcd')]()[_0xfc30('0x9c')]();var _0x1ff758=path[_0xfc30('0xce')](config[_0xfc30('0xcf')],_0xfc30('0xd0'),_0xfc30('0xd1'),_0xfc30('0xd2'));var _0x437671=path['join'](config[_0xfc30('0xcf')],'server','files','attachments');var _0x4c31f1=path[_0xfc30('0xce')](_0x1ff758,_0x389616);var _0x528bfd=util[_0xfc30('0xc2')](_0xfc30('0xd3'),_0x5d1ace[_0xfc30('0xb6')]['id'],_0x389616);var _0x2c754b=path[_0xfc30('0xce')](_0x1ff758,_0x528bfd);var _0x27f5eb=[];_0x27f5eb[_0xfc30('0xd4')]({'model':db[_0xfc30('0x71')],'as':_0xfc30('0x71'),'attributes':['id',_0xfc30('0x30')],'raw':!![]});_0x27f5eb[_0xfc30('0xd4')]({'model':db['CmContact'],'as':_0xfc30('0x64'),'attributes':['id','firstName',_0xfc30('0xd5')],'raw':!![]});if(_0x5d1ace['query'][_0xfc30('0xd6')]){_0x27f5eb[_0xfc30('0xd4')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4ace29=[{'model':db[_0xfc30('0xbd')],'as':_0xfc30('0xd7'),'attributes':['id',_0xfc30('0x74'),_0xfc30('0x7a'),'direction',_0xfc30('0xd8'),_0xfc30('0x81')],'include':_0x27f5eb}];_0x4ace29[_0xfc30('0xd4')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xfc30('0x2d')]});_0x4ace29[_0xfc30('0xd4')]({'model':db[_0xfc30('0x71')],'as':_0xfc30('0xd9'),'attributes':['id',_0xfc30('0x30')]});return db[_0xfc30('0x9f')][_0xfc30('0x5f')]({'where':{'id':_0x5d1ace['params']['id']},'include':_0x4ace29})[_0xfc30('0x2a')](handleEntityNotFound(_0x4ad134,null))[_0xfc30('0x2a')](function(_0x32f03e){if(_0x32f03e){var _0xcf4ffb=_0x32f03e[_0xfc30('0xda')]({'plain':!![]});fs[_0xfc30('0xdb')](_0x4c31f1);var _0xeb947e={'channel':'Openchannel','account':_0xcf4ffb[_0xfc30('0xdc')][_0xfc30('0x2d')],'agent':_0xcf4ffb[_0xfc30('0xd9')]?_0xcf4ffb[_0xfc30('0xd9')][_0xfc30('0x30')]:_0xfc30('0xdd'),'createdAt':moment(_0xcf4ffb[_0xfc30('0x7a')])[_0xfc30('0xc2')](_0xfc30('0xc3'))[_0xfc30('0x9c')](),'closedAt':_0xcf4ffb[_0xfc30('0xde')]?moment(_0xcf4ffb[_0xfc30('0xdf')])[_0xfc30('0xc2')](_0xfc30('0xc3'))['toString']():'','disposition':_0xcf4ffb['disposition'],'visibility':_0xcf4ffb[_0xfc30('0xe0')]?_0xfc30('0xe1'):_0xfc30('0xe2'),'messages':_(_0xcf4ffb[_0xfc30('0xd7')])[_0xfc30('0x84')]({'secret':![]})[_0xfc30('0x2f')](function(_0x1509a3){if(_0x1509a3['Attachment']){var _0x31dd1c=path['join'](_0x437671,_0x1509a3[_0xfc30('0xe3')]['basename']);if(fs[_0xfc30('0xe4')](_0x31dd1c)){fs['createReadStream'](_0x31dd1c)[_0xfc30('0xe5')](fs[_0xfc30('0xe6')](path['join'](_0x4c31f1,_0x1509a3[_0xfc30('0xe3')][_0xfc30('0xe7')])));}}return{'date':moment(_0x1509a3[_0xfc30('0x7a')])[_0xfc30('0xc2')](_0xfc30('0xc3'))['toString'](),'sender':_0x1509a3['direction']==='out'?_0x1509a3['User']?_0x1509a3[_0xfc30('0x71')]['fullname']:'System':_0x1509a3['Contact'][_0xfc30('0xe8')]+(_0x1509a3['Contact']['lastName']?'\x20'+_0x1509a3[_0xfc30('0x64')][_0xfc30('0xd5')]:''),'body':_0x1509a3[_0xfc30('0xe3')]?_0x1509a3[_0xfc30('0xe3')]['basename']:_0x1509a3[_0xfc30('0x74')],'direction':_0x1509a3[_0xfc30('0xe9')]===_0xfc30('0xea')?'A':'C','secret':_0x1509a3['secret'],'read':_0x1509a3[_0xfc30('0x81')],'attachment':_0x1509a3[_0xfc30('0xe3')]};})[_0xfc30('0x61')]()};return ejs['renderFile'](path[_0xfc30('0xce')](config[_0xfc30('0xcf')],_0xfc30('0xd0'),_0xfc30('0xeb'),_0xfc30('0xec')),{'interaction':_0xeb947e})['then'](function(_0x3ae28b){var _0x4c27ab=path[_0xfc30('0xce')](_0x4c31f1,_0xfc30('0xed')+_0xcf4ffb['id']+'-'+_0x389616+'.pdf');var _0x53902e={'path':_0x4c27ab,'channel':'Openchannel','interactionId':_0xcf4ffb['id']};return pdf[_0xfc30('0xee')](_0x3ae28b,_0x53902e);})['then'](function(){return new BPromise(function(_0xd5c175,_0x2e1468){zipdir(_0x4c31f1,{'saveTo':_0x2c754b},function(_0x302d78,_0x1e27ce){if(_0x302d78)return _0x2e1468(_0x302d78);return _0xd5c175(_0x1e27ce);});})[_0xfc30('0x2a')](function(){return new BPromise(function(_0x35548c,_0x47eae8){rimraf(_0x4c31f1,function(_0x384342){if(_0x384342)_0x47eae8(_0x384342);return _0x35548c();});});})[_0xfc30('0x2a')](function(){return _0x4ad134[_0xfc30('0xcc')](_0x2c754b,_0x528bfd,function(_0xc1ee27){if(_0xc1ee27){console[_0xfc30('0xef')]('err',_0xc1ee27);}else{fs[_0xfc30('0xf0')](_0x2c754b);}});});});}else{return _0x4ad134[_0xfc30('0x1e')](0xc8);}})['catch'](handleError(_0x4ad134,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index a7fa5c6..af7c888 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 _0x88f1=['hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x5a3d49,_0x24b21a){var _0x4d5c23=function(_0x4f62b0){while(--_0x4f62b0){_0x5a3d49['push'](_0x5a3d49['shift']());}};_0x4d5c23(++_0x24b21a);}(_0x88f1,0x1a4));var _0x188f=function(_0x21c09c,_0x2a4240){_0x21c09c=_0x21c09c-0x0;var _0x372dc1=_0x88f1[_0x21c09c];return _0x372dc1;};'use strict';var EventEmitter=require(_0x188f('0x0'));var OpenchannelInteraction=require(_0x188f('0x1'))['db'][_0x188f('0x2')];var OpenchannelMessage=require(_0x188f('0x1'))['db'][_0x188f('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x188f('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x188f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2206c8){return function(_0x3cc456,_0x178e90,_0x55e297){_0x3cc456[_0x188f('0x6')]({'attributes':['id'],'raw':!![]})[_0x188f('0x7')](function(_0x3c1169){_0x3cc456['setDataValue'](_0x188f('0x8'),_0x3c1169[_0x188f('0x9')](function(_0x3dca1b){return{'id':_0x3dca1b['id']};}));return OpenchannelMessage[_0x188f('0xa')]({'where':{'OpenchannelInteractionId':_0x3cc456['id'],'direction':'in','read':![]},'raw':!![]});})[_0x188f('0x7')](function(_0x1c30f7){_0x3cc456[_0x188f('0xb')](_0x188f('0xc'),_0x1c30f7[_0x188f('0xd')]);OpenchannelInteractionEvents['emit'](_0x2206c8+':'+_0x3cc456['id'],_0x3cc456);OpenchannelInteractionEvents[_0x188f('0xe')](_0x2206c8,_0x3cc456);_0x55e297(null);})[_0x188f('0xf')](_0x55e297(null));};}for(var e in events){if(events[_0x188f('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x188f('0x11')](e,emitEvent(event));}}module[_0x188f('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xc633=['catch','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit'];(function(_0x1093af,_0x26a56d){var _0x42d20c=function(_0x53480d){while(--_0x53480d){_0x1093af['push'](_0x1093af['shift']());}};_0x42d20c(++_0x26a56d);}(_0xc633,0x192));var _0x3c63=function(_0x14e585,_0x31bf4e){_0x14e585=_0x14e585-0x0;var _0x46d5e4=_0xc633[_0x14e585];return _0x46d5e4;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x3c63('0x0'))['db'][_0x3c63('0x1')];var OpenchannelMessage=require(_0x3c63('0x0'))['db'][_0x3c63('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3c63('0x3')](0x0);var events={'afterCreate':_0x3c63('0x4'),'afterUpdate':_0x3c63('0x5'),'afterDestroy':_0x3c63('0x6')};function emitEvent(_0x4b68d5){return function(_0x22d6eb,_0x529aed,_0x3cbbd7){_0x22d6eb['getUsers']({'attributes':['id'],'raw':!![]})[_0x3c63('0x7')](function(_0x54f11b){_0x22d6eb[_0x3c63('0x8')]('Users',_0x54f11b[_0x3c63('0x9')](function(_0x76c34b){return{'id':_0x76c34b['id']};}));return OpenchannelMessage[_0x3c63('0xa')]({'where':{'OpenchannelInteractionId':_0x22d6eb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3c63('0x7')](function(_0x2b29be){_0x22d6eb[_0x3c63('0x8')](_0x3c63('0xb'),_0x2b29be[_0x3c63('0xc')]);OpenchannelInteractionEvents[_0x3c63('0xd')](_0x4b68d5+':'+_0x22d6eb['id'],_0x22d6eb);OpenchannelInteractionEvents[_0x3c63('0xd')](_0x4b68d5,_0x22d6eb);_0x3cbbd7(null);})[_0x3c63('0xe')](_0x3cbbd7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x3c63('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ca19e89..777b825 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 _0xd20d=['request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd20d,0x13a));var _0xdd20=function(_0x5554bd,_0x146451){_0x5554bd=_0x5554bd-0x0;var _0x8dffee=_0xd20d[_0x5554bd];return _0x8dffee;};'use strict';var _=require(_0xdd20('0x0'));var util=require(_0xdd20('0x1'));var logger=require(_0xdd20('0x2'))(_0xdd20('0x3'));var moment=require(_0xdd20('0x4'));var BPromise=require(_0xdd20('0x5'));var rp=require(_0xdd20('0x6'));var fs=require('fs');var path=require(_0xdd20('0x7'));var rimraf=require(_0xdd20('0x8'));var config=require(_0xdd20('0x9'));var attributes=require(_0xdd20('0xa'));module[_0xdd20('0xb')]=function(_0x493bf7,_0x2e2981){return _0x493bf7[_0xdd20('0xc')]('OpenchannelInteraction',attributes,{'tableName':_0xdd20('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd20('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4ae781,_0x4e1665,_0x458d57){if(_0x4ae781[_0xdd20('0xf')](_0xdd20('0x10'))){_0x4ae781[_0xdd20('0x11')]=moment()[_0xdd20('0x12')](_0xdd20('0x13'));}_0x458d57(null,_0x4ae781);}}});}; \ No newline at end of file +var _0x15e8=['api','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','lodash','../../config/logger'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x15e8,0x106));var _0x815e=function(_0x55f6a1,_0x6dde8){_0x55f6a1=_0x55f6a1-0x0;var _0x391691=_0x15e8[_0x55f6a1];return _0x391691;};'use strict';var _=require(_0x815e('0x0'));var util=require('util');var logger=require(_0x815e('0x1'))(_0x815e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x815e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x815e('0x4'));var attributes=require(_0x815e('0x5'));module[_0x815e('0x6')]=function(_0xfc3471,_0x3414ad){return _0xfc3471['define'](_0x815e('0x7'),attributes,{'tableName':_0x815e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x815e('0x9'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x3c401b,_0x2b2b3e,_0x531f89){if(_0x3c401b[_0x815e('0xa')](_0x815e('0xb'))){_0x3c401b['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x531f89(null,_0x3c401b);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a78b180..068896a 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 _0xd7d3=['options','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','where','then','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction','update','body'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd7d3,0x1a6));var _0x3d7d=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xd7d3[_0x381372];return _0x4e959a;};'use strict';var _=require(_0x3d7d('0x0'));var util=require(_0x3d7d('0x1'));var moment=require('moment');var BPromise=require(_0x3d7d('0x2'));var rs=require(_0x3d7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d7d('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3d7d('0x5'));var client=jayson[_0x3d7d('0x6')][_0x3d7d('0x7')]({'port':0x232a});config[_0x3d7d('0x8')]=_[_0x3d7d('0x9')](config[_0x3d7d('0x8')],{'host':_0x3d7d('0xa'),'port':0x18eb});var socket=require(_0x3d7d('0xb'))(new Redis(config[_0x3d7d('0x8')]));require(_0x3d7d('0xc'))[_0x3d7d('0xd')](socket);function respondWithRpcPromise(_0x48761b,_0x50a754,_0x2556a6){return new BPromise(function(_0x48020c,_0xcf2dbf){return client[_0x3d7d('0xe')](_0x48761b,_0x2556a6)['then'](function(_0x4d3862){logger[_0x3d7d('0xf')](_0x3d7d('0x10'),_0x50a754,_0x3d7d('0x11'));logger[_0x3d7d('0x12')](_0x3d7d('0x13'),_0x50a754,'request\x20sent',JSON[_0x3d7d('0x14')](_0x4d3862));if(_0x4d3862[_0x3d7d('0x15')]){if(_0x4d3862['error'][_0x3d7d('0x16')]===0x1f4){logger[_0x3d7d('0x15')](_0x3d7d('0x10'),_0x50a754,_0x4d3862['error'][_0x3d7d('0x17')]);return _0xcf2dbf(_0x4d3862[_0x3d7d('0x15')]['message']);}logger[_0x3d7d('0x15')](_0x3d7d('0x10'),_0x50a754,_0x4d3862[_0x3d7d('0x15')][_0x3d7d('0x17')]);return _0x48020c(_0x4d3862[_0x3d7d('0x15')]['message']);}else{logger[_0x3d7d('0xf')](_0x3d7d('0x10'),_0x50a754,'request\x20sent');_0x48020c(_0x4d3862[_0x3d7d('0x18')][_0x3d7d('0x17')]);}})[_0x3d7d('0x19')](function(_0x2fb972){logger[_0x3d7d('0x15')](_0x3d7d('0x10'),_0x50a754,_0x2fb972);_0xcf2dbf(_0x2fb972);});});}exports['UpdateOpenchannelInteraction']=function(_0x3fd468){var _0x1d9074=this;return new Promise(function(_0x33dfe7,_0x53e501){return db[_0x3d7d('0x1a')][_0x3d7d('0x1b')](_0x3fd468[_0x3d7d('0x1c')],{'raw':_0x3fd468[_0x3d7d('0x1d')]?_0x3fd468[_0x3d7d('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fd468['options']?_0x3fd468[_0x3d7d('0x1d')]['where']||null:null,'attributes':_0x3fd468['options']?_0x3fd468[_0x3d7d('0x1d')][_0x3d7d('0x1e')]||null:null,'limit':_0x3fd468[_0x3d7d('0x1d')]?_0x3fd468[_0x3d7d('0x1d')][_0x3d7d('0x1f')]||null:null})['then'](function(_0x27fd1e){logger['info'](_0x3d7d('0x20'),_0x3fd468);logger[_0x3d7d('0x12')](_0x3d7d('0x20'),_0x3fd468,JSON[_0x3d7d('0x14')](_0x27fd1e));_0x33dfe7(_0x27fd1e);})[_0x3d7d('0x19')](function(_0x3e878b){logger[_0x3d7d('0x15')](_0x3d7d('0x20'),_0x3e878b[_0x3d7d('0x17')],_0x3fd468);_0x53e501(_0x1d9074[_0x3d7d('0x15')](0x1f4,_0x3e878b[_0x3d7d('0x17')]));});});};exports[_0x3d7d('0x21')]=function(_0x63921f){return new Promise(function(_0x41f89c,_0x587dc6){return db['OpenchannelInteraction']['find']({'where':_0x63921f[_0x3d7d('0x1d')]?_0x63921f[_0x3d7d('0x1d')][_0x3d7d('0x22')]||null:null})[_0x3d7d('0x23')](function(_0x1ced5c){if(_0x1ced5c){return _0x1ced5c[_0x3d7d('0x24')](_0x63921f['body'][_0x3d7d('0x25')],_[_0x3d7d('0x26')](_0x63921f[_0x3d7d('0x1c')],[_0x3d7d('0x25'),'id'])||{});}})[_0x3d7d('0x27')](function(_0x2dab25){logger['info'](_0x3d7d('0x28'),_0x63921f);logger[_0x3d7d('0x12')](_0x3d7d('0x28'),_0x63921f,JSON[_0x3d7d('0x14')](_0x2dab25));_0x41f89c(_0x2dab25);})[_0x3d7d('0x19')](function(_0x18e69d){logger['error'](_0x3d7d('0x28'),_0x18e69d[_0x3d7d('0x17')],_0x63921f);_0x587dc6(_this[_0x3d7d('0x15')](0x1f4,_0x18e69d['message']));});});}; \ No newline at end of file +var _0xc821=['redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc821,0x1b4));var _0x1c82=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc821[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1c82('0x0'));var util=require(_0x1c82('0x1'));var moment=require(_0x1c82('0x2'));var BPromise=require(_0x1c82('0x3'));var rs=require(_0x1c82('0x4'));var fs=require('fs');var Redis=require(_0x1c82('0x5'));var db=require(_0x1c82('0x6'))['db'];var utils=require(_0x1c82('0x7'));var logger=require(_0x1c82('0x8'))(_0x1c82('0x9'));var config=require(_0x1c82('0xa'));var jayson=require(_0x1c82('0xb'));var client=jayson[_0x1c82('0xc')][_0x1c82('0xd')]({'port':0x232a});config[_0x1c82('0xe')]=_[_0x1c82('0xf')](config[_0x1c82('0xe')],{'host':_0x1c82('0x10'),'port':0x18eb});var socket=require(_0x1c82('0x11'))(new Redis(config[_0x1c82('0xe')]));require(_0x1c82('0x12'))[_0x1c82('0x13')](socket);function respondWithRpcPromise(_0x2255f3,_0x58a8d0,_0x153e22){return new BPromise(function(_0x2524e2,_0x19a55c){return client['request'](_0x2255f3,_0x153e22)[_0x1c82('0x14')](function(_0x19c07a){logger[_0x1c82('0x15')](_0x1c82('0x16'),_0x58a8d0,_0x1c82('0x17'));logger[_0x1c82('0x18')](_0x1c82('0x19'),_0x58a8d0,_0x1c82('0x17'),JSON[_0x1c82('0x1a')](_0x19c07a));if(_0x19c07a['error']){if(_0x19c07a[_0x1c82('0x1b')][_0x1c82('0x1c')]===0x1f4){logger[_0x1c82('0x1b')]('OpenchannelInteraction,\x20%s,\x20%s',_0x58a8d0,_0x19c07a[_0x1c82('0x1b')][_0x1c82('0x1d')]);return _0x19a55c(_0x19c07a[_0x1c82('0x1b')]['message']);}logger[_0x1c82('0x1b')]('OpenchannelInteraction,\x20%s,\x20%s',_0x58a8d0,_0x19c07a['error'][_0x1c82('0x1d')]);return _0x2524e2(_0x19c07a['error'][_0x1c82('0x1d')]);}else{logger['info'](_0x1c82('0x16'),_0x58a8d0,'request\x20sent');_0x2524e2(_0x19c07a['result'][_0x1c82('0x1d')]);}})[_0x1c82('0x1e')](function(_0x11cbbb){logger[_0x1c82('0x1b')](_0x1c82('0x16'),_0x58a8d0,_0x11cbbb);_0x19a55c(_0x11cbbb);});});}exports[_0x1c82('0x1f')]=function(_0x1da919){var _0x1edc8b=this;return new Promise(function(_0x1cf352,_0x4361c0){return db[_0x1c82('0x20')][_0x1c82('0x21')](_0x1da919[_0x1c82('0x22')],{'raw':_0x1da919[_0x1c82('0x23')]?_0x1da919['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1da919[_0x1c82('0x23')]?_0x1da919[_0x1c82('0x23')][_0x1c82('0x24')]||null:null,'attributes':_0x1da919[_0x1c82('0x23')]?_0x1da919[_0x1c82('0x23')][_0x1c82('0x25')]||null:null,'limit':_0x1da919[_0x1c82('0x23')]?_0x1da919['options'][_0x1c82('0x26')]||null:null})['then'](function(_0x1a53ac){logger[_0x1c82('0x15')](_0x1c82('0x1f'),_0x1da919);logger['debug'](_0x1c82('0x1f'),_0x1da919,JSON[_0x1c82('0x1a')](_0x1a53ac));_0x1cf352(_0x1a53ac);})[_0x1c82('0x1e')](function(_0x5f191a){logger['error'](_0x1c82('0x1f'),_0x5f191a[_0x1c82('0x1d')],_0x1da919);_0x4361c0(_0x1edc8b['error'](0x1f4,_0x5f191a[_0x1c82('0x1d')]));});});};exports[_0x1c82('0x27')]=function(_0x32a9ff){return new Promise(function(_0x3e32d1,_0x3bcbbf){return db[_0x1c82('0x20')][_0x1c82('0x28')]({'where':_0x32a9ff[_0x1c82('0x23')]?_0x32a9ff[_0x1c82('0x23')][_0x1c82('0x24')]||null:null})[_0x1c82('0x14')](function(_0x50b89e){if(_0x50b89e){return _0x50b89e[_0x1c82('0x29')](_0x32a9ff[_0x1c82('0x22')][_0x1c82('0x2a')],_[_0x1c82('0x2b')](_0x32a9ff[_0x1c82('0x22')],[_0x1c82('0x2a'),'id'])||{});}})['spread'](function(_0x4aede0){logger[_0x1c82('0x15')](_0x1c82('0x2c'),_0x32a9ff);logger[_0x1c82('0x18')](_0x1c82('0x2c'),_0x32a9ff,JSON[_0x1c82('0x1a')](_0x4aede0));_0x3e32d1(_0x4aede0);})[_0x1c82('0x1e')](function(_0x423390){logger[_0x1c82('0x1b')](_0x1c82('0x2c'),_0x423390['message'],_0x32a9ff);_0x3bcbbf(_this[_0x1c82('0x1b')](0x1f4,_0x423390[_0x1c82('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index db43d9e..13f2991 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 _0x2294=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x2aeca6,_0x565154){var _0x48c8c9=function(_0x739357){while(--_0x739357){_0x2aeca6['push'](_0x2aeca6['shift']());}};_0x48c8c9(++_0x565154);}(_0x2294,0x1ec));var _0x4229=function(_0x4dcbe6,_0x4f1ba6){_0x4dcbe6=_0x4dcbe6-0x0;var _0x5e5750=_0x2294[_0x4dcbe6];return _0x5e5750;};'use strict';var OpenchannelInteractionEvents=require(_0x4229('0x0'));var events=[_0x4229('0x1'),_0x4229('0x2'),_0x4229('0x3')];function createListener(_0x2da9fe,_0x56d1e0){return function(_0x214701){_0x56d1e0[_0x4229('0x4')](_0x2da9fe,_0x214701);};}function removeListener(_0x5f0b68,_0x193aba){return function(){OpenchannelInteractionEvents[_0x4229('0x5')](_0x5f0b68,_0x193aba);};}exports[_0x4229('0x6')]=function(_0x376000){for(var _0x13c1d8=0x0,_0x45fb19=events[_0x4229('0x7')];_0x13c1d8<_0x45fb19;_0x13c1d8++){var _0x47d764=events[_0x13c1d8];var _0x2180c6=createListener(_0x4229('0x8')+_0x47d764,_0x376000);OpenchannelInteractionEvents['on'](_0x47d764,_0x2180c6);}}; \ No newline at end of file +var _0x43d1=['save','remove','emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x5b2202,_0x1d8f90){var _0x90ab7d=function(_0xd8720a){while(--_0xd8720a){_0x5b2202['push'](_0x5b2202['shift']());}};_0x90ab7d(++_0x1d8f90);}(_0x43d1,0x1c6));var _0x143d=function(_0x4b32d9,_0x468dce){_0x4b32d9=_0x4b32d9-0x0;var _0x4a1df4=_0x43d1[_0x4b32d9];return _0x4a1df4;};'use strict';var OpenchannelInteractionEvents=require(_0x143d('0x0'));var events=[_0x143d('0x1'),_0x143d('0x2'),'update'];function createListener(_0x506176,_0x46b6cf){return function(_0x4a07bc){_0x46b6cf[_0x143d('0x3')](_0x506176,_0x4a07bc);};}function removeListener(_0x589f47,_0x43afe4){return function(){OpenchannelInteractionEvents[_0x143d('0x4')](_0x589f47,_0x43afe4);};}exports[_0x143d('0x5')]=function(_0x34ea85){for(var _0x427f14=0x0,_0x40663d=events['length'];_0x427f14<_0x40663d;_0x427f14++){var _0x468ab0=events[_0x427f14];var _0x4f1613=createListener(_0x143d('0x6')+_0x468ab0,_0x34ea85);OpenchannelInteractionEvents['on'](_0x468ab0,_0x4f1613);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f18c0b4..1ff30d3 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0xb4900e,_0x1661ec){_0xb4900e=_0xb4900e-0x0;var _0x34c6da=_0x70e0[_0xb4900e];return _0x34c6da;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _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(_0x541855,_0x2d7fb1){var _0x4de0c2=function(_0x1ae869){while(--_0x1ae869){_0x541855['push'](_0x541855['shift']());}};_0x4de0c2(++_0x2d7fb1);}(_0xe706,0xa3));var _0x6e70=function(_0x3b9859,_0x52b534){_0x3b9859=_0x3b9859-0x0;var _0x3bc080=_0xe706[_0x3b9859];return _0x3bc080;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 5f588e5..d98b606 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 _0x20df=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x20df,0x7c));var _0xf20d=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x20df[_0x3e32a8];return _0x2997b0;};'use strict';var Sequelize=require(_0xf20d('0x0'));module[_0xf20d('0x1')]={'body':{'type':Sequelize[_0xf20d('0x2')](_0xf20d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf20d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf20d('0x5')]('in',_0xf20d('0x6')),'defaultValue':_0xf20d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf20d('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf20d('0x2')]}}; \ No newline at end of file +var _0x6b20=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x6b20,0xd1));var _0x06b2=function(_0x1ce1e0,_0x44e8f1){_0x1ce1e0=_0x1ce1e0-0x0;var _0x1b490c=_0x6b20[_0x1ce1e0];return _0x1b490c;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x06b2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x06b2('0x4')]('in',_0x06b2('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x06b2('0x6')]},'providerName':{'type':Sequelize[_0x06b2('0x7')]},'providerResponse':{'type':Sequelize[_0x06b2('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 18cb2a3..1d71aad 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 _0x213f=['../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','status','json','undefined','limit','count','offset','Content-Range','reject','save','destroy','then','end','stack','name','send','index','map','OpenchannelMessage','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','update','params','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3a1049,_0x1e410b){var _0x56c047=function(_0x237724){while(--_0x237724){_0x3a1049['push'](_0x3a1049['shift']());}};_0x56c047(++_0x1e410b);}(_0x213f,0x173));var _0xf213=function(_0x3df7e7,_0x98e148){_0x3df7e7=_0x3df7e7-0x0;var _0x28dca8=_0x213f[_0x3df7e7];return _0x28dca8;};'use strict';var emlformat=require(_0xf213('0x0'));var rimraf=require(_0xf213('0x1'));var zipdir=require(_0xf213('0x2'));var jsonpatch=require(_0xf213('0x3'));var rp=require(_0xf213('0x4'));var moment=require(_0xf213('0x5'));var BPromise=require(_0xf213('0x6'));var Mustache=require(_0xf213('0x7'));var util=require('util');var path=require(_0xf213('0x8'));var sox=require(_0xf213('0x9'));var csv=require(_0xf213('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf213('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf213('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf213('0xa'));var querystring=require('querystring');var Papa=require(_0xf213('0xd'));var Redis=require(_0xf213('0xe'));var authService=require(_0xf213('0xf'));var qs=require(_0xf213('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf213('0x11'));var logger=require('../../config/logger')(_0xf213('0x12'));var utils=require(_0xf213('0x13'));var config=require(_0xf213('0x14'));var licenseUtil=require(_0xf213('0x15'));var db=require(_0xf213('0x16'))['db'];config[_0xf213('0x17')]=_['defaults'](config[_0xf213('0x17')],{'host':_0xf213('0x18'),'port':0x18eb});var socket=require(_0xf213('0x19'))(new Redis(config[_0xf213('0x17')]));require(_0xf213('0x1a'))[_0xf213('0x1b')](socket);var jayson=require(_0xf213('0x1c'));var client=jayson[_0xf213('0x1d')][_0xf213('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ad789,_0x1c053c,_0x4435b8,_0x5285b6){return new BPromise(function(_0x16cbdb,_0x4188a){var _0x3bdd12=_0x5285b6||client;return _0x3bdd12[_0xf213('0x1f')](_0x4ad789,_0x4435b8)['then'](function(_0x39f060){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1c053c,_0xf213('0x20'));logger[_0xf213('0x21')](_0xf213('0x22'),_0x1c053c,'request\x20sent',JSON[_0xf213('0x23')](_0x39f060));if(_0x39f060[_0xf213('0x24')]){if(_0x39f060[_0xf213('0x24')][_0xf213('0x25')]===0x1f4){logger[_0xf213('0x24')](_0xf213('0x26'),_0x1c053c,_0x39f060[_0xf213('0x24')][_0xf213('0x27')]);return _0x4188a(_0x39f060[_0xf213('0x24')][_0xf213('0x27')]);}logger['error'](_0xf213('0x26'),_0x1c053c,_0x39f060[_0xf213('0x24')][_0xf213('0x27')]);return _0x16cbdb(_0x39f060['error'][_0xf213('0x27')]);}else{logger[_0xf213('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1c053c,_0xf213('0x20'));_0x16cbdb(_0x39f060[_0xf213('0x29')][_0xf213('0x27')]);}})[_0xf213('0x2a')](function(_0x2a7a2f){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x1c053c,_0x2a7a2f);_0x4188a(_0x2a7a2f);});});}function respondWithStatusCode(_0x46cc99,_0x27e02a){_0x27e02a=_0x27e02a||0xcc;return function(_0x50ff24){if(_0x50ff24){return _0x46cc99['sendStatus'](_0x27e02a);}return _0x46cc99[_0xf213('0x2b')](_0x27e02a)['end']();};}function respondWithResult(_0x1eb23b,_0x122b31){_0x122b31=_0x122b31||0xc8;return function(_0x348c2c){if(_0x348c2c){return _0x1eb23b['status'](_0x122b31)[_0xf213('0x2c')](_0x348c2c);}};}function respondWithFilteredResult(_0x7ef1f6,_0x35c5f5){return function(_0x450d9){if(_0x450d9){var _0x141c09=typeof _0x35c5f5['offset']===_0xf213('0x2d')&&typeof _0x35c5f5[_0xf213('0x2e')]===_0xf213('0x2d');var _0x38c932=_0x450d9[_0xf213('0x2f')];var _0x20d1db=_0x141c09?0x0:_0x35c5f5[_0xf213('0x30')];var _0xd5b5e1=_0x141c09?_0x450d9[_0xf213('0x2f')]:_0x35c5f5[_0xf213('0x30')]+_0x35c5f5[_0xf213('0x2e')];var _0x466de4;if(_0xd5b5e1>=_0x38c932){_0xd5b5e1=_0x38c932;_0x466de4=0xc8;}else{_0x466de4=0xce;}_0x7ef1f6[_0xf213('0x2b')](_0x466de4);return _0x7ef1f6['set'](_0xf213('0x31'),_0x20d1db+'-'+_0xd5b5e1+'/'+_0x38c932)[_0xf213('0x2c')](_0x450d9);}return null;};}function patchUpdates(_0x2070a8){return function(_0x58578e){try{jsonpatch['apply'](_0x58578e,_0x2070a8,!![]);}catch(_0x284652){return BPromise[_0xf213('0x32')](_0x284652);}return _0x58578e[_0xf213('0x33')]();};}function saveUpdates(_0x21c98a,_0x1986a6){return function(_0x133c9b){if(_0x133c9b){return _0x133c9b['update'](_0x21c98a)['then'](function(_0x2b67cd){return _0x2b67cd;});}return null;};}function removeEntity(_0x1541ef,_0x3c0e54){return function(_0x4c563e){if(_0x4c563e){return _0x4c563e[_0xf213('0x34')]()[_0xf213('0x35')](function(){_0x1541ef['status'](0xcc)[_0xf213('0x36')]();});}};}function handleEntityNotFound(_0x53be72,_0x772c19){return function(_0x5b8ec7){if(!_0x5b8ec7){_0x53be72['sendStatus'](0x194);}return _0x5b8ec7;};}function handleError(_0x3c6efd,_0x5b16e6){_0x5b16e6=_0x5b16e6||0x1f4;return function(_0x174bd4){logger[_0xf213('0x24')](_0x174bd4[_0xf213('0x37')]);if(_0x174bd4[_0xf213('0x38')]){delete _0x174bd4[_0xf213('0x38')];}_0x3c6efd[_0xf213('0x2b')](_0x5b16e6)[_0xf213('0x39')](_0x174bd4);};}exports[_0xf213('0x3a')]=function(_0x4d5b32,_0x336403){var _0x1c26b9={},_0x417fbe={},_0x48bc2b={'count':0x0,'rows':[]};var _0x201e0d=_[_0xf213('0x3b')](db[_0xf213('0x3c')]['rawAttributes'],function(_0x51648a){return{'name':_0x51648a[_0xf213('0x3d')],'type':_0x51648a[_0xf213('0x3e')]['key']};});_0x417fbe[_0xf213('0x3f')]=_[_0xf213('0x3b')](_0x201e0d,_0xf213('0x38'));_0x417fbe[_0xf213('0x40')]=_[_0xf213('0x41')](_0x4d5b32[_0xf213('0x40')]);_0x417fbe[_0xf213('0x42')]=_['intersection'](_0x417fbe['model'],_0x417fbe['query']);_0x1c26b9[_0xf213('0x43')]=_[_0xf213('0x44')](_0x417fbe['model'],qs[_0xf213('0x45')](_0x4d5b32['query'][_0xf213('0x45')]));_0x1c26b9[_0xf213('0x43')]=_0x1c26b9['attributes'][_0xf213('0x46')]?_0x1c26b9['attributes']:_0x417fbe[_0xf213('0x3f')];if(!_0x4d5b32[_0xf213('0x40')][_0xf213('0x47')]('nolimit')){_0x1c26b9[_0xf213('0x2e')]=qs[_0xf213('0x2e')](_0x4d5b32['query'][_0xf213('0x2e')]);_0x1c26b9[_0xf213('0x30')]=qs[_0xf213('0x30')](_0x4d5b32[_0xf213('0x40')]['offset']);}_0x1c26b9['order']=qs[_0xf213('0x48')](_0x4d5b32[_0xf213('0x40')][_0xf213('0x48')]);_0x1c26b9['where']=qs['filters'](_[_0xf213('0x49')](_0x4d5b32[_0xf213('0x40')],_0x417fbe[_0xf213('0x42')]),_0x201e0d);if(_0x4d5b32[_0xf213('0x40')][_0xf213('0x4a')]){_0x1c26b9[_0xf213('0x4b')]=_['merge'](_0x1c26b9['where'],{'$or':_[_0xf213('0x3b')](_0x201e0d,function(_0xcabb73){if(_0xcabb73['type']!==_0xf213('0x4c')){var _0x363175={};_0x363175[_0xcabb73['name']]={'$like':'%'+_0x4d5b32['query'][_0xf213('0x4a')]+'%'};return _0x363175;}})});}_0x1c26b9=_[_0xf213('0x4d')]({},_0x1c26b9,_0x4d5b32[_0xf213('0x4e')]);var _0x3cd13d={'where':_0x1c26b9[_0xf213('0x4b')]};return db[_0xf213('0x3c')]['count'](_0x3cd13d)[_0xf213('0x35')](function(_0x578cf5){_0x48bc2b[_0xf213('0x2f')]=_0x578cf5;if(_0x4d5b32[_0xf213('0x40')][_0xf213('0x4f')]){_0x1c26b9[_0xf213('0x50')]=[{'all':!![]}];}return db[_0xf213('0x3c')][_0xf213('0x51')](_0x1c26b9);})[_0xf213('0x35')](function(_0x498eff){_0x48bc2b[_0xf213('0x52')]=_0x498eff;return _0x48bc2b;})[_0xf213('0x35')](respondWithFilteredResult(_0x336403,_0x1c26b9))['catch'](handleError(_0x336403,null));};exports[_0xf213('0x53')]=function(_0x50174a,_0x5d44b8){var _0x59931d={'raw':!![],'where':{'id':_0x50174a['params']['id']}},_0x2adaca={};_0x2adaca[_0xf213('0x3f')]=_[_0xf213('0x41')](db['OpenchannelMessage'][_0xf213('0x54')]);_0x2adaca[_0xf213('0x40')]=_['keys'](_0x50174a['query']);_0x2adaca[_0xf213('0x42')]=_[_0xf213('0x44')](_0x2adaca[_0xf213('0x3f')],_0x2adaca[_0xf213('0x40')]);_0x59931d[_0xf213('0x43')]=_[_0xf213('0x44')](_0x2adaca[_0xf213('0x3f')],qs[_0xf213('0x45')](_0x50174a[_0xf213('0x40')][_0xf213('0x45')]));_0x59931d[_0xf213('0x43')]=_0x59931d[_0xf213('0x43')][_0xf213('0x46')]?_0x59931d[_0xf213('0x43')]:_0x2adaca[_0xf213('0x3f')];if(_0x50174a['query'][_0xf213('0x4f')]){_0x59931d[_0xf213('0x50')]=[{'all':!![]}];}_0x59931d=_[_0xf213('0x4d')]({},_0x59931d,_0x50174a['options']);return db[_0xf213('0x3c')][_0xf213('0x55')](_0x59931d)[_0xf213('0x35')](handleEntityNotFound(_0x5d44b8,null))['then'](respondWithResult(_0x5d44b8,null))[_0xf213('0x2a')](handleError(_0x5d44b8,null));};exports[_0xf213('0x56')]=function(_0x245155,_0x882100){return db[_0xf213('0x3c')][_0xf213('0x56')](_0x245155[_0xf213('0x57')],{})[_0xf213('0x35')](respondWithResult(_0x882100,0xc9))[_0xf213('0x2a')](handleError(_0x882100,null));};exports[_0xf213('0x58')]=function(_0x290411,_0x4fd581){if(_0x290411[_0xf213('0x57')]['id']){delete _0x290411[_0xf213('0x57')]['id'];}return db[_0xf213('0x3c')][_0xf213('0x55')]({'where':{'id':_0x290411['params']['id']}})[_0xf213('0x35')](handleEntityNotFound(_0x4fd581,null))[_0xf213('0x35')](saveUpdates(_0x290411['body'],null))[_0xf213('0x35')](respondWithResult(_0x4fd581,null))['catch'](handleError(_0x4fd581,null));};exports[_0xf213('0x34')]=function(_0x4f9c56,_0x3e044b){return db[_0xf213('0x3c')]['find']({'where':{'id':_0x4f9c56[_0xf213('0x59')]['id']}})[_0xf213('0x35')](handleEntityNotFound(_0x3e044b,null))[_0xf213('0x35')](removeEntity(_0x3e044b,null))[_0xf213('0x2a')](handleError(_0x3e044b,null));};exports[_0xf213('0x5a')]=function(_0x4633fb,_0x49dfa1){return db[_0xf213('0x3c')][_0xf213('0x5a')]()[_0xf213('0x35')](respondWithResult(_0x49dfa1,null))['catch'](handleError(_0x49dfa1,null));};var interaction_log=require(_0xf213('0x5b'))(_0xf213('0x5c'));exports[_0xf213('0x5d')]=function(_0x9e21e2,_0x5ad554,_0x54770f){var _0x368c5d={'agent':{},'channel':_0xf213('0x5e')};if(_0x9e21e2[_0xf213('0x57')]['id']){delete _0x9e21e2[_0xf213('0x57')]['id'];}_0x9e21e2[_0xf213('0x57')][_0xf213('0x5f')]=!![];_0x9e21e2[_0xf213('0x57')][_0xf213('0x60')]=moment()[_0xf213('0x61')](_0xf213('0x62'));_0x9e21e2['body'][_0xf213('0x63')]=_0x9e21e2[_0xf213('0x57')][_0xf213('0x63')]||_0x9e21e2[_0xf213('0x64')]['id'];_0x368c5d[_0xf213('0x65')]['id']=_0x9e21e2[_0xf213('0x57')][_0xf213('0x63')];return db['OpenchannelMessage']['find']({'where':{'id':_0x9e21e2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ad554,null))['then'](saveUpdates(_0x9e21e2[_0xf213('0x57')],null))['then'](function(_0x5d3549){if(_0x5d3549){_0x368c5d[_0xf213('0x27')]=_0x5d3549[_0xf213('0x66')]({'plain':!![]});return db['OpenchannelInteraction'][_0xf213('0x55')]({'where':{'id':_0x5d3549[_0xf213('0x67')]}});}return null;})[_0xf213('0x35')](handleEntityNotFound(_0x5ad554,null))[_0xf213('0x35')](function(_0x571829){if(_0x571829){return _0x571829['update']({'UserId':_0x9e21e2[_0xf213('0x57')][_0xf213('0x63')],'read1stAt':_['isNil'](_0x571829['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf213('0x35')](function(_0x5d8908){if(_0x5d8908){_0x368c5d[_0xf213('0x68')]=_0x5d8908[_0xf213('0x66')]({'plain':!![]});interaction_log[_0xf213('0x28')](_0xf213('0x69'),_0x9e21e2[_0xf213('0x64')]['id'],_0x9e21e2[_0xf213('0x64')]['name'],_0x9e21e2['user']['role'],_0x368c5d[_0xf213('0x68')]['id'],_0x9e21e2[_0xf213('0x57')]?JSON['stringify'](_0x9e21e2[_0xf213('0x57')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x368c5d);}return null;})[_0xf213('0x35')](function(_0xea2c43){var _0xb8b06b=_0xf213('0x6a')+_0xea2c43[_0xf213('0x27')][_0xf213('0x6b')];return db['sequelize'][_0xf213('0x40')](_0xb8b06b,{'type':db[_0xf213('0x6c')][_0xf213('0x6d')][_0xf213('0x6e')],'raw':!![]})[_0xf213('0x35')](function(_0x2a93db){return _0x2a93db;});})[_0xf213('0x35')](function(_0x50e514){if(_0x50e514){_0x368c5d[_0xf213('0x27')]['contact']=_0x50e514[0x0];if(!_0x9e21e2['body'][_0xf213('0x63')])return;return db[_0xf213('0x6f')][_0xf213('0x55')]({'where':{'id':_0x9e21e2[_0xf213('0x57')]['UserId'],'role':_0xf213('0x65')},'attributes':['id',_0xf213('0x38'),_0xf213('0x70'),_0xf213('0x71'),_0xf213('0x72')],'raw':!![]});}return null;})[_0xf213('0x35')](function(_0x4f6dd2){if(!_0x4f6dd2)return null;_0x368c5d[_0xf213('0x27')]['agent']=_0x4f6dd2;return _0x368c5d;})[_0xf213('0x35')](function(_0x240b2f){if(_0x240b2f){if(_0x9e21e2[_0xf213('0x57')][_0xf213('0x73')]){_0x368c5d[_0xf213('0x27')][_0xf213('0x74')]=util['format'](_0xf213('0x75'),_0x9e21e2[_0xf213('0x64')]['name']);_0x368c5d[_0xf213('0x27')][_0xf213('0x76')]=_0x368c5d[_0xf213('0x76')];_0x368c5d[_0xf213('0x27')][_0xf213('0x77')]=_0x368c5d[_0xf213('0x76')];_0x368c5d[_0xf213('0x27')][_0xf213('0x78')]=_0xf213('0x5d');return respondWithRpcPromise(_0xf213('0x79'),_0xf213('0x79'),{'event':_0xf213('0x7a'),'message':_0x368c5d['message']},client9002)[_0xf213('0x35')](function(){return _0x368c5d;});}return _0x368c5d;}return null;})[_0xf213('0x35')](respondWithResult(_0x5ad554,null))[_0xf213('0x2a')](handleError(_0x5ad554,null));};var interaction_log=require(_0xf213('0x5b'))(_0xf213('0x5c'));exports[_0xf213('0x32')]=function(_0x4960ac,_0x6d5a2b,_0x42c2d4){var _0x288a1d={'agent':{},'channel':_0xf213('0x5e')};if(_0x4960ac[_0xf213('0x57')]['id']){delete _0x4960ac['body']['id'];}_0x4960ac[_0xf213('0x57')]['UserId']=_0x4960ac[_0xf213('0x57')]['UserId']||_0x4960ac[_0xf213('0x64')]['id'];_0x288a1d[_0xf213('0x65')]['id']=_0x4960ac[_0xf213('0x57')][_0xf213('0x63')];return db[_0xf213('0x3c')][_0xf213('0x55')]({'where':{'id':_0x4960ac['params']['id'],'UserId':null}})[_0xf213('0x35')](handleEntityNotFound(_0x6d5a2b,null))[_0xf213('0x35')](function(_0x5237b2){if(_0x5237b2){_0x288a1d['message']=_0x5237b2[_0xf213('0x66')]({'plain':!![]});return db[_0xf213('0x7b')][_0xf213('0x55')]({'where':{'id':_0x5237b2['OpenchannelInteractionId']}});}return null;})[_0xf213('0x35')](handleEntityNotFound(_0x6d5a2b,null))[_0xf213('0x35')](function(_0x1fa812){if(_0x1fa812){_0x288a1d[_0xf213('0x68')]=_0x1fa812[_0xf213('0x66')]({'plain':!![]});interaction_log[_0xf213('0x28')](_0xf213('0x7c'),_0x4960ac['user']['id'],_0x4960ac[_0xf213('0x64')][_0xf213('0x38')],_0x4960ac['user'][_0xf213('0x7d')],_0x288a1d['interaction']['id'],_0x4960ac[_0xf213('0x57')]?JSON['stringify'](_0x4960ac['body']):'null');return respondWithRpcPromise(_0xf213('0x7e'),_0xf213('0x7f'),_0x288a1d);}return null;})[_0xf213('0x35')](function(_0x3819d2){var _0xc9080a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3819d2[_0xf213('0x27')]['ContactId'];return db[_0xf213('0x80')][_0xf213('0x40')](_0xc9080a,{'type':db[_0xf213('0x6c')]['QueryTypes'][_0xf213('0x6e')],'raw':!![]})[_0xf213('0x35')](function(_0x518f16){return _0x518f16;});})[_0xf213('0x35')](function(_0x2bd715){if(_0x2bd715){_0x288a1d[_0xf213('0x27')][_0xf213('0x81')]=_0x2bd715[0x0];if(!_0x4960ac[_0xf213('0x57')][_0xf213('0x63')])return;return db[_0xf213('0x6f')][_0xf213('0x55')]({'where':{'id':_0x4960ac['body'][_0xf213('0x63')],'role':_0xf213('0x65')},'attributes':['id',_0xf213('0x38'),_0xf213('0x70'),_0xf213('0x71'),_0xf213('0x72')],'raw':!![]});}return null;})['then'](function(_0xa760a){if(!_0xa760a)return null;_0x288a1d[_0xf213('0x27')][_0xf213('0x65')]=_0xa760a;return _0x288a1d;})[_0xf213('0x35')](function(_0x5293c4){if(_0x5293c4){_0x5293c4[_0xf213('0x27')][_0xf213('0x74')]=util[_0xf213('0x61')](_0xf213('0x75'),_0x4960ac[_0xf213('0x64')][_0xf213('0x38')]);_0x5293c4[_0xf213('0x27')][_0xf213('0x76')]=_0x288a1d['channel'];_0x5293c4[_0xf213('0x27')][_0xf213('0x77')]=_0x288a1d['channel'];_0x5293c4[_0xf213('0x27')][_0xf213('0x78')]=_0xf213('0x32');respondWithRpcPromise(_0xf213('0x79'),_0xf213('0x79'),{'event':_0xf213('0x82'),'message':_0x5293c4[_0xf213('0x27')]},client9002);return _0x288a1d;}return null;})['then'](respondWithResult(_0x6d5a2b,null))['catch'](handleError(_0x6d5a2b,null));}; \ No newline at end of file +var _0x30c5=['localhost','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','OpenchannelMessage','includeAll','findAll','rows','show','keys','include','find','create','body','params','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','format','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','email','internal','manual','interface','channel','event','EventManager','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','fullname','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x36f3f3,_0x555fd4){var _0x115842=function(_0x14e220){while(--_0x14e220){_0x36f3f3['push'](_0x36f3f3['shift']());}};_0x115842(++_0x555fd4);}(_0x30c5,0x1e4));var _0x530c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x30c5[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x530c('0x0'));var rimraf=require(_0x530c('0x1'));var zipdir=require(_0x530c('0x2'));var jsonpatch=require(_0x530c('0x3'));var rp=require(_0x530c('0x4'));var moment=require(_0x530c('0x5'));var BPromise=require(_0x530c('0x6'));var Mustache=require(_0x530c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x530c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x530c('0x9'));var _=require(_0x530c('0xa'));var squel=require(_0x530c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x530c('0xc'));var querystring=require('querystring');var Papa=require(_0x530c('0xd'));var Redis=require('ioredis');var authService=require(_0x530c('0xe'));var qs=require(_0x530c('0xf'));var as=require(_0x530c('0x10'));var hardwareService=require(_0x530c('0x11'));var logger=require(_0x530c('0x12'))('api');var utils=require(_0x530c('0x13'));var config=require(_0x530c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x530c('0x15'))['db'];config[_0x530c('0x16')]=_[_0x530c('0x17')](config['redis'],{'host':_0x530c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x530c('0x16')]));require(_0x530c('0x19'))[_0x530c('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x530c('0x1b')][_0x530c('0x1c')]({'port':0x232c});var client9002=jayson[_0x530c('0x1b')][_0x530c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2e2a4d,_0x3412f3,_0x3addff,_0x26208f){return new BPromise(function(_0x25e3f3,_0x535e17){var _0x4b834c=_0x26208f||client;return _0x4b834c[_0x530c('0x1d')](_0x2e2a4d,_0x3addff)[_0x530c('0x1e')](function(_0x323eeb){logger[_0x530c('0x1f')](_0x530c('0x20'),_0x3412f3,_0x530c('0x21'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3412f3,'request\x20sent',JSON[_0x530c('0x22')](_0x323eeb));if(_0x323eeb[_0x530c('0x23')]){if(_0x323eeb[_0x530c('0x23')][_0x530c('0x24')]===0x1f4){logger[_0x530c('0x23')](_0x530c('0x20'),_0x3412f3,_0x323eeb[_0x530c('0x23')][_0x530c('0x25')]);return _0x535e17(_0x323eeb[_0x530c('0x23')][_0x530c('0x25')]);}logger[_0x530c('0x23')](_0x530c('0x20'),_0x3412f3,_0x323eeb[_0x530c('0x23')][_0x530c('0x25')]);return _0x25e3f3(_0x323eeb[_0x530c('0x23')][_0x530c('0x25')]);}else{logger[_0x530c('0x1f')](_0x530c('0x20'),_0x3412f3,_0x530c('0x21'));_0x25e3f3(_0x323eeb['result'][_0x530c('0x25')]);}})[_0x530c('0x26')](function(_0x3f7e3e){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3412f3,_0x3f7e3e);_0x535e17(_0x3f7e3e);});});}function respondWithStatusCode(_0x292e01,_0x277085){_0x277085=_0x277085||0xcc;return function(_0x263b67){if(_0x263b67){return _0x292e01[_0x530c('0x27')](_0x277085);}return _0x292e01['status'](_0x277085)[_0x530c('0x28')]();};}function respondWithResult(_0x48104c,_0x276b67){_0x276b67=_0x276b67||0xc8;return function(_0x4cea3d){if(_0x4cea3d){return _0x48104c[_0x530c('0x29')](_0x276b67)['json'](_0x4cea3d);}};}function respondWithFilteredResult(_0x310f26,_0x3726b4){return function(_0x1b64ed){if(_0x1b64ed){var _0xc7cb33=typeof _0x3726b4[_0x530c('0x2a')]===_0x530c('0x2b')&&typeof _0x3726b4['limit']===_0x530c('0x2b');var _0x2f1e7b=_0x1b64ed[_0x530c('0x2c')];var _0x84b965=_0xc7cb33?0x0:_0x3726b4[_0x530c('0x2a')];var _0x54433a=_0xc7cb33?_0x1b64ed['count']:_0x3726b4[_0x530c('0x2a')]+_0x3726b4[_0x530c('0x2d')];var _0x6b9c97;if(_0x54433a>=_0x2f1e7b){_0x54433a=_0x2f1e7b;_0x6b9c97=0xc8;}else{_0x6b9c97=0xce;}_0x310f26[_0x530c('0x29')](_0x6b9c97);return _0x310f26[_0x530c('0x2e')](_0x530c('0x2f'),_0x84b965+'-'+_0x54433a+'/'+_0x2f1e7b)[_0x530c('0x30')](_0x1b64ed);}return null;};}function patchUpdates(_0xd01b2c){return function(_0x5ea139){try{jsonpatch['apply'](_0x5ea139,_0xd01b2c,!![]);}catch(_0x2093af){return BPromise[_0x530c('0x31')](_0x2093af);}return _0x5ea139['save']();};}function saveUpdates(_0x3ee75f,_0x15f2f0){return function(_0x295ae0){if(_0x295ae0){return _0x295ae0[_0x530c('0x32')](_0x3ee75f)[_0x530c('0x1e')](function(_0x33f228){return _0x33f228;});}return null;};}function removeEntity(_0x4aac7f,_0x5c1709){return function(_0x14d612){if(_0x14d612){return _0x14d612[_0x530c('0x33')]()[_0x530c('0x1e')](function(){_0x4aac7f['status'](0xcc)[_0x530c('0x28')]();});}};}function handleEntityNotFound(_0x4c0d71,_0x57567b){return function(_0xf2015b){if(!_0xf2015b){_0x4c0d71['sendStatus'](0x194);}return _0xf2015b;};}function handleError(_0x4812dc,_0x1f524f){_0x1f524f=_0x1f524f||0x1f4;return function(_0x42910b){logger[_0x530c('0x23')](_0x42910b[_0x530c('0x34')]);if(_0x42910b[_0x530c('0x35')]){delete _0x42910b[_0x530c('0x35')];}_0x4812dc[_0x530c('0x29')](_0x1f524f)[_0x530c('0x36')](_0x42910b);};}exports[_0x530c('0x37')]=function(_0x8f42b9,_0x4797f9){var _0x5cdc39={},_0x415261={},_0x43fb4a={'count':0x0,'rows':[]};var _0x5a8d97=_[_0x530c('0x38')](db['OpenchannelMessage'][_0x530c('0x39')],function(_0x3fc014){return{'name':_0x3fc014[_0x530c('0x3a')],'type':_0x3fc014['type'][_0x530c('0x3b')]};});_0x415261[_0x530c('0x3c')]=_[_0x530c('0x38')](_0x5a8d97,_0x530c('0x35'));_0x415261[_0x530c('0x3d')]=_['keys'](_0x8f42b9[_0x530c('0x3d')]);_0x415261[_0x530c('0x3e')]=_[_0x530c('0x3f')](_0x415261[_0x530c('0x3c')],_0x415261[_0x530c('0x3d')]);_0x5cdc39[_0x530c('0x40')]=_[_0x530c('0x3f')](_0x415261[_0x530c('0x3c')],qs[_0x530c('0x41')](_0x8f42b9['query'][_0x530c('0x41')]));_0x5cdc39[_0x530c('0x40')]=_0x5cdc39[_0x530c('0x40')][_0x530c('0x42')]?_0x5cdc39['attributes']:_0x415261['model'];if(!_0x8f42b9[_0x530c('0x3d')][_0x530c('0x43')](_0x530c('0x44'))){_0x5cdc39['limit']=qs[_0x530c('0x2d')](_0x8f42b9[_0x530c('0x3d')]['limit']);_0x5cdc39['offset']=qs['offset'](_0x8f42b9['query']['offset']);}_0x5cdc39[_0x530c('0x45')]=qs[_0x530c('0x46')](_0x8f42b9[_0x530c('0x3d')][_0x530c('0x46')]);_0x5cdc39['where']=qs['filters'](_[_0x530c('0x47')](_0x8f42b9['query'],_0x415261[_0x530c('0x3e')]),_0x5a8d97);if(_0x8f42b9[_0x530c('0x3d')][_0x530c('0x48')]){_0x5cdc39[_0x530c('0x49')]=_[_0x530c('0x4a')](_0x5cdc39[_0x530c('0x49')],{'$or':_[_0x530c('0x38')](_0x5a8d97,function(_0x5a2e05){if(_0x5a2e05[_0x530c('0x4b')]!==_0x530c('0x4c')){var _0x2760d9={};_0x2760d9[_0x5a2e05['name']]={'$like':'%'+_0x8f42b9[_0x530c('0x3d')][_0x530c('0x48')]+'%'};return _0x2760d9;}})});}_0x5cdc39=_['merge']({},_0x5cdc39,_0x8f42b9[_0x530c('0x4d')]);var _0x2ea2c3={'where':_0x5cdc39[_0x530c('0x49')]};return db[_0x530c('0x4e')][_0x530c('0x2c')](_0x2ea2c3)[_0x530c('0x1e')](function(_0x1fcdd5){_0x43fb4a[_0x530c('0x2c')]=_0x1fcdd5;if(_0x8f42b9[_0x530c('0x3d')][_0x530c('0x4f')]){_0x5cdc39['include']=[{'all':!![]}];}return db[_0x530c('0x4e')][_0x530c('0x50')](_0x5cdc39);})[_0x530c('0x1e')](function(_0x4ad139){_0x43fb4a[_0x530c('0x51')]=_0x4ad139;return _0x43fb4a;})[_0x530c('0x1e')](respondWithFilteredResult(_0x4797f9,_0x5cdc39))['catch'](handleError(_0x4797f9,null));};exports[_0x530c('0x52')]=function(_0x4cd9a2,_0x4fa008){var _0x1a219e={'raw':!![],'where':{'id':_0x4cd9a2['params']['id']}},_0x36343c={};_0x36343c['model']=_['keys'](db[_0x530c('0x4e')][_0x530c('0x39')]);_0x36343c['query']=_[_0x530c('0x53')](_0x4cd9a2[_0x530c('0x3d')]);_0x36343c[_0x530c('0x3e')]=_[_0x530c('0x3f')](_0x36343c[_0x530c('0x3c')],_0x36343c[_0x530c('0x3d')]);_0x1a219e['attributes']=_[_0x530c('0x3f')](_0x36343c[_0x530c('0x3c')],qs[_0x530c('0x41')](_0x4cd9a2[_0x530c('0x3d')]['fields']));_0x1a219e[_0x530c('0x40')]=_0x1a219e[_0x530c('0x40')][_0x530c('0x42')]?_0x1a219e[_0x530c('0x40')]:_0x36343c['model'];if(_0x4cd9a2['query'][_0x530c('0x4f')]){_0x1a219e[_0x530c('0x54')]=[{'all':!![]}];}_0x1a219e=_[_0x530c('0x4a')]({},_0x1a219e,_0x4cd9a2[_0x530c('0x4d')]);return db['OpenchannelMessage'][_0x530c('0x55')](_0x1a219e)[_0x530c('0x1e')](handleEntityNotFound(_0x4fa008,null))[_0x530c('0x1e')](respondWithResult(_0x4fa008,null))['catch'](handleError(_0x4fa008,null));};exports[_0x530c('0x56')]=function(_0x43573c,_0xd8efdf){return db['OpenchannelMessage'][_0x530c('0x56')](_0x43573c['body'],{})[_0x530c('0x1e')](respondWithResult(_0xd8efdf,0xc9))[_0x530c('0x26')](handleError(_0xd8efdf,null));};exports[_0x530c('0x32')]=function(_0x229f7a,_0x4fb81c){if(_0x229f7a[_0x530c('0x57')]['id']){delete _0x229f7a[_0x530c('0x57')]['id'];}return db[_0x530c('0x4e')][_0x530c('0x55')]({'where':{'id':_0x229f7a[_0x530c('0x58')]['id']}})[_0x530c('0x1e')](handleEntityNotFound(_0x4fb81c,null))[_0x530c('0x1e')](saveUpdates(_0x229f7a[_0x530c('0x57')],null))[_0x530c('0x1e')](respondWithResult(_0x4fb81c,null))[_0x530c('0x26')](handleError(_0x4fb81c,null));};exports[_0x530c('0x33')]=function(_0x3060d9,_0x340cbb){return db[_0x530c('0x4e')][_0x530c('0x55')]({'where':{'id':_0x3060d9[_0x530c('0x58')]['id']}})[_0x530c('0x1e')](handleEntityNotFound(_0x340cbb,null))[_0x530c('0x1e')](removeEntity(_0x340cbb,null))[_0x530c('0x26')](handleError(_0x340cbb,null));};exports['describe']=function(_0x4d8908,_0x36d6f1){return db[_0x530c('0x4e')]['describe']()[_0x530c('0x1e')](respondWithResult(_0x36d6f1,null))[_0x530c('0x26')](handleError(_0x36d6f1,null));};var interaction_log=require(_0x530c('0x12'))('openchannel-interactions');exports[_0x530c('0x59')]=function(_0x590474,_0x29830d,_0xb915dd){var _0x1fd5e0={'agent':{},'channel':'openchannel'};if(_0x590474[_0x530c('0x57')]['id']){delete _0x590474[_0x530c('0x57')]['id'];}_0x590474['body'][_0x530c('0x5a')]=!![];_0x590474[_0x530c('0x57')]['readAt']=moment()['format'](_0x530c('0x5b'));_0x590474[_0x530c('0x57')][_0x530c('0x5c')]=_0x590474[_0x530c('0x57')]['UserId']||_0x590474[_0x530c('0x5d')]['id'];_0x1fd5e0['agent']['id']=_0x590474[_0x530c('0x57')]['UserId'];return db[_0x530c('0x4e')][_0x530c('0x55')]({'where':{'id':_0x590474[_0x530c('0x58')]['id'],'UserId':null}})[_0x530c('0x1e')](handleEntityNotFound(_0x29830d,null))['then'](saveUpdates(_0x590474[_0x530c('0x57')],null))['then'](function(_0x18794b){if(_0x18794b){_0x1fd5e0[_0x530c('0x25')]=_0x18794b[_0x530c('0x5e')]({'plain':!![]});return db[_0x530c('0x5f')]['find']({'where':{'id':_0x18794b[_0x530c('0x60')]}});}return null;})[_0x530c('0x1e')](handleEntityNotFound(_0x29830d,null))[_0x530c('0x1e')](function(_0x4f8261){if(_0x4f8261){return _0x4f8261[_0x530c('0x32')]({'UserId':_0x590474[_0x530c('0x57')]['UserId'],'read1stAt':_[_0x530c('0x61')](_0x4f8261['read1stAt'])?moment()[_0x530c('0x62')](_0x530c('0x5b')):undefined});}return null;})['then'](function(_0x5d59ce){if(_0x5d59ce){_0x1fd5e0[_0x530c('0x63')]=_0x5d59ce[_0x530c('0x5e')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x590474['user']['id'],_0x590474[_0x530c('0x5d')]['name'],_0x590474[_0x530c('0x5d')][_0x530c('0x64')],_0x1fd5e0[_0x530c('0x63')]['id'],_0x590474[_0x530c('0x57')]?JSON[_0x530c('0x22')](_0x590474[_0x530c('0x57')]):_0x530c('0x65'));return respondWithRpcPromise(_0x530c('0x66'),'acceptMessage',_0x1fd5e0);}return null;})['then'](function(_0x637ef4){var _0x2a623e=_0x530c('0x67')+_0x637ef4[_0x530c('0x25')][_0x530c('0x68')];return db[_0x530c('0x69')][_0x530c('0x3d')](_0x2a623e,{'type':db['Sequelize']['QueryTypes'][_0x530c('0x6a')],'raw':!![]})[_0x530c('0x1e')](function(_0x29cf60){return _0x29cf60;});})[_0x530c('0x1e')](function(_0x26f8a3){if(_0x26f8a3){_0x1fd5e0[_0x530c('0x25')][_0x530c('0x6b')]=_0x26f8a3[0x0];if(!_0x590474['body'][_0x530c('0x5c')])return;return db[_0x530c('0x6c')][_0x530c('0x55')]({'where':{'id':_0x590474[_0x530c('0x57')][_0x530c('0x5c')],'role':_0x530c('0x6d')},'attributes':['id',_0x530c('0x35'),'fullname',_0x530c('0x6e'),_0x530c('0x6f')],'raw':!![]});}return null;})[_0x530c('0x1e')](function(_0x530de3){if(!_0x530de3)return null;_0x1fd5e0[_0x530c('0x25')][_0x530c('0x6d')]=_0x530de3;return _0x1fd5e0;})[_0x530c('0x1e')](function(_0x4aa6a0){if(_0x4aa6a0){if(_0x590474['body'][_0x530c('0x70')]){_0x1fd5e0[_0x530c('0x25')][_0x530c('0x71')]=util[_0x530c('0x62')]('SIP/%s',_0x590474[_0x530c('0x5d')][_0x530c('0x35')]);_0x1fd5e0[_0x530c('0x25')][_0x530c('0x72')]=_0x1fd5e0['channel'];_0x1fd5e0[_0x530c('0x25')]['motionChannel']=_0x1fd5e0['channel'];_0x1fd5e0[_0x530c('0x25')][_0x530c('0x73')]=_0x530c('0x59');return respondWithRpcPromise(_0x530c('0x74'),_0x530c('0x74'),{'event':'acceptmessage','message':_0x1fd5e0[_0x530c('0x25')]},client9002)['then'](function(){return _0x1fd5e0;});}return _0x1fd5e0;}return null;})[_0x530c('0x1e')](respondWithResult(_0x29830d,null))[_0x530c('0x26')](handleError(_0x29830d,null));};var interaction_log=require(_0x530c('0x12'))('openchannel-interactions');exports[_0x530c('0x31')]=function(_0x29c2ef,_0x268574,_0xd78c9b){var _0x4b9817={'agent':{},'channel':_0x530c('0x75')};if(_0x29c2ef[_0x530c('0x57')]['id']){delete _0x29c2ef[_0x530c('0x57')]['id'];}_0x29c2ef[_0x530c('0x57')][_0x530c('0x5c')]=_0x29c2ef[_0x530c('0x57')]['UserId']||_0x29c2ef['user']['id'];_0x4b9817['agent']['id']=_0x29c2ef[_0x530c('0x57')][_0x530c('0x5c')];return db[_0x530c('0x4e')][_0x530c('0x55')]({'where':{'id':_0x29c2ef['params']['id'],'UserId':null}})[_0x530c('0x1e')](handleEntityNotFound(_0x268574,null))['then'](function(_0x59dd3a){if(_0x59dd3a){_0x4b9817['message']=_0x59dd3a[_0x530c('0x5e')]({'plain':!![]});return db[_0x530c('0x5f')][_0x530c('0x55')]({'where':{'id':_0x59dd3a[_0x530c('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x268574,null))[_0x530c('0x1e')](function(_0x13b7d8){if(_0x13b7d8){_0x4b9817[_0x530c('0x63')]=_0x13b7d8['get']({'plain':!![]});interaction_log[_0x530c('0x1f')](_0x530c('0x76'),_0x29c2ef['user']['id'],_0x29c2ef[_0x530c('0x5d')][_0x530c('0x35')],_0x29c2ef['user']['role'],_0x4b9817[_0x530c('0x63')]['id'],_0x29c2ef[_0x530c('0x57')]?JSON[_0x530c('0x22')](_0x29c2ef[_0x530c('0x57')]):_0x530c('0x65'));return respondWithRpcPromise(_0x530c('0x77'),_0x530c('0x78'),_0x4b9817);}return null;})[_0x530c('0x1e')](function(_0x279a01){var _0xfbd434=_0x530c('0x67')+_0x279a01[_0x530c('0x25')][_0x530c('0x68')];return db[_0x530c('0x69')][_0x530c('0x3d')](_0xfbd434,{'type':db[_0x530c('0x79')][_0x530c('0x7a')][_0x530c('0x6a')],'raw':!![]})[_0x530c('0x1e')](function(_0x4a89ef){return _0x4a89ef;});})['then'](function(_0x190c26){if(_0x190c26){_0x4b9817[_0x530c('0x25')][_0x530c('0x6b')]=_0x190c26[0x0];if(!_0x29c2ef[_0x530c('0x57')][_0x530c('0x5c')])return;return db[_0x530c('0x6c')][_0x530c('0x55')]({'where':{'id':_0x29c2ef[_0x530c('0x57')][_0x530c('0x5c')],'role':_0x530c('0x6d')},'attributes':['id',_0x530c('0x35'),_0x530c('0x7b'),_0x530c('0x6e'),'internal'],'raw':!![]});}return null;})[_0x530c('0x1e')](function(_0x55bff7){if(!_0x55bff7)return null;_0x4b9817['message'][_0x530c('0x6d')]=_0x55bff7;return _0x4b9817;})[_0x530c('0x1e')](function(_0x54bce3){if(_0x54bce3){_0x54bce3['message']['interface']=util[_0x530c('0x62')](_0x530c('0x7c'),_0x29c2ef[_0x530c('0x5d')]['name']);_0x54bce3[_0x530c('0x25')][_0x530c('0x72')]=_0x4b9817[_0x530c('0x72')];_0x54bce3[_0x530c('0x25')][_0x530c('0x7d')]=_0x4b9817[_0x530c('0x72')];_0x54bce3['message'][_0x530c('0x73')]=_0x530c('0x31');respondWithRpcPromise(_0x530c('0x74'),_0x530c('0x74'),{'event':_0x530c('0x7e'),'message':_0x54bce3[_0x530c('0x25')]},client9002);return _0x4b9817;}return null;})['then'](respondWithResult(_0x268574,null))[_0x530c('0x26')](handleError(_0x268574,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 6a3cc59..d93399d 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 _0xc389=['update','remove','emit','hook','exports','events','OpenchannelMessage','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc389,0x15b));var _0x9c38=function(_0x34397d,_0x590d88){_0x34397d=_0x34397d-0x0;var _0x5d66ff=_0xc389[_0x34397d];return _0x5d66ff;};'use strict';var EventEmitter=require(_0x9c38('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x9c38('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9c38('0x2')](0x0);var events={'afterCreate':_0x9c38('0x3'),'afterUpdate':_0x9c38('0x4'),'afterDestroy':_0x9c38('0x5')};function emitEvent(_0x5d9a20){return function(_0x3df1ab,_0x18694a,_0x50c9e3){OpenchannelMessageEvents['emit'](_0x5d9a20+':'+_0x3df1ab['id'],_0x3df1ab);OpenchannelMessageEvents[_0x9c38('0x6')](_0x5d9a20,_0x3df1ab);_0x50c9e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x9c38('0x7')](e,emitEvent(event));}}module[_0x9c38('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7878=['hasOwnProperty','exports','events','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0xb3c46e,_0x5c15f0){var _0x43ad16=function(_0x865238){while(--_0x865238){_0xb3c46e['push'](_0xb3c46e['shift']());}};_0x43ad16(++_0x5c15f0);}(_0x7878,0xbf));var _0x8787=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7878[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8787('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x8787('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8787('0x2')](0x0);var events={'afterCreate':_0x8787('0x3'),'afterUpdate':_0x8787('0x4'),'afterDestroy':_0x8787('0x5')};function emitEvent(_0x1252e8){return function(_0x26ebfb,_0x5d1642,_0x15e74c){OpenchannelMessageEvents[_0x8787('0x6')](_0x1252e8+':'+_0x26ebfb['id'],_0x26ebfb);OpenchannelMessageEvents[_0x8787('0x6')](_0x1252e8,_0x26ebfb);_0x15e74c(null);};}for(var e in events){if(events[_0x8787('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x8787('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 4f5e032..0b930d0 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 _0xb688=['then','replyUri','info','format','length','Interaction','omit','Contact','POST','threadId','update','OpenchannelMessage,\x20%s,\x20%s','afterCreate','inspect','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','catch','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','keys'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb688,0xcf));var _0x8b68=function(_0x5a1378,_0x7ff4){_0x5a1378=_0x5a1378-0x0;var _0x405f6f=_0xb688[_0x5a1378];return _0x405f6f;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[{'name':_0x8b68('0xc'),'fields':[_0x8b68('0xd')],'type':_0x8b68('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f9685,_0x261753,_0x21d944){var _0x24e0b0=_0x583d16[_0x8b68('0xf')];var _0x418775=_0x3f9685[_0x8b68('0x10')]({'plain':!![]});if(_0x418775[_0x8b68('0x11')]['toLowerCase']()==='in'||_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()===_0x8b68('0x13')&&!_0x418775[_0x8b68('0x14')]&&!_[_0x8b68('0x15')](_0x418775[_0x8b68('0x16')])){_0x24e0b0[_0x8b68('0x17')][_0x8b68('0x18')]({'where':{'id':_0x418775[_0x8b68('0x19')]}})['then'](function(_0xb2df35){if(_0xb2df35){_0xb2df35['update']({'lastMsgAt':_0x418775['createdAt'],'lastMsgDirection':_0x418775[_0x8b68('0x11')][_0x8b68('0x12')]()});}})[_0x8b68('0x1a')](function(_0x5d3468){console['error'](_0x5d3468);});}if(_0x418775[_0x8b68('0x11')]==='out'&&!_0x418775[_0x8b68('0x14')]){var _0xb44923;_0x24e0b0[_0x8b68('0x1b')][_0x8b68('0x1c')]()['then'](function(_0xd17693){return _0x24e0b0[_0x8b68('0x1d')]['find']({'where':{'id':_0x418775[_0x8b68('0x1e')]},'include':[{'model':_0x24e0b0[_0x8b68('0x17')],'as':_0x8b68('0x1f'),'where':{'id':_0x418775[_0x8b68('0x19')]},'limit':0x1,'include':[{'model':_0x24e0b0[_0x8b68('0x1b')],'as':'Contact','attributes':_[_0x8b68('0x20')](_0xd17693)}]}]});})[_0x8b68('0x21')](function(_0x59e9b1){_0xb44923=_0x59e9b1[_0x8b68('0x10')]({'plain':!![]});if(_0xb44923&&_0xb44923[_0x8b68('0x22')]){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0xb44923[_0x8b68('0x1f')]&&_0xb44923[_0x8b68('0x1f')][_0x8b68('0x25')]){_0x418775[_0x8b68('0x26')]=_[_0x8b68('0x27')](_0xb44923['Interactions'][0x0],_0x8b68('0x28'));_0x418775[_0x8b68('0x28')]=_0xb44923['Interactions'][0x0][_0x8b68('0x28')];}var _0x261753={'method':_0x8b68('0x29'),'uri':encodeURI(_0xb44923['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x261753['method']){case'GET':_0x261753['qs']=_0x418775;break;case _0x8b68('0x29'):_0x261753[_0x8b68('0xd')]=_0x418775;break;}return rp(_0x261753)[_0x8b68('0x21')](function(_0x583476){logger[_0x8b68('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8b68('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x418775['id'],_0xb44923[_0x8b68('0x22')]));if(_0x583476[_0x8b68('0xd')]['threadId']&&_0x583476['body'][_0x8b68('0x2a')]!=_0x418775[_0x8b68('0x26')][_0x8b68('0x2a')]){return _0x24e0b0[_0x8b68('0x17')][_0x8b68('0x2b')]({'threadId':_0x583476[_0x8b68('0xd')][_0x8b68('0x2a')]},{'logging':!![],'where':{'id':_0x418775['Interaction']['id']}});}else{return;}})[_0x8b68('0x21')](function(){return _0x3f9685['update']({'read':!![]});})[_0x8b68('0x1a')](function(_0x133b75){logger['error'](_0x8b68('0x2c'),_0x8b68('0x2d'),util[_0x8b68('0x2e')](_0x133b75,{'showHidden':![],'depth':null}));_0x21d944();});}else{_0x21d944();}})['finally'](function(){_0x21d944();});}else{_0x21d944();}}},'charset':'utf8mb4','collate':_0x8b68('0x2f')});}; \ 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(_0x2f2927,_0x1a1686){var _0xf41605=function(_0x3b8391){while(--_0x3b8391){_0x2f2927['push'](_0x2f2927['shift']());}};_0xf41605(++_0x1a1686);}(_0x6cb4,0xff));var _0x46cb=function(_0x380033,_0x5089a0){_0x380033=_0x380033-0x0;var _0x33098d=_0x6cb4[_0x380033];return _0x33098d;};'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 5b3c5f1..a0c9cba 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x57793b,_0x722733){var _0x3ac8ae=function(_0x5e00aa){while(--_0x5e00aa){_0x57793b['push'](_0x57793b['shift']());}};_0x3ac8ae(++_0x722733);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x39bf2b,_0x190762){var _0x2e7d16=function(_0x35ee27){while(--_0x35ee27){_0x39bf2b['push'](_0x39bf2b['shift']());}};_0x2e7d16(++_0x190762);}(_0xadb5,0xad));var _0x5adb=function(_0x1cc4d6,_0x36df80){_0x1cc4d6=_0x1cc4d6-0x0;var _0x30cef0=_0xadb5[_0x1cc4d6];return _0x30cef0;};'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});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1185365..2265927 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 _0x1d19=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x479450,_0x4914a6){var _0x30d1a3=function(_0x215e35){while(--_0x215e35){_0x479450['push'](_0x479450['shift']());}};_0x30d1a3(++_0x4914a6);}(_0x1d19,0xb1));var _0x91d1=function(_0x27d4d5,_0x5072c8){_0x27d4d5=_0x27d4d5-0x0;var _0x3be690=_0x1d19[_0x27d4d5];return _0x3be690;};'use strict';var OpenchannelMessageEvents=require(_0x91d1('0x0'));var events=[_0x91d1('0x1'),_0x91d1('0x2'),_0x91d1('0x3')];function createListener(_0xa6cea1,_0x1826d4){return function(_0x468c3a){_0x1826d4[_0x91d1('0x4')](_0xa6cea1,_0x468c3a);};}function removeListener(_0x165633,_0x44b41b){return function(){OpenchannelMessageEvents[_0x91d1('0x5')](_0x165633,_0x44b41b);};}exports[_0x91d1('0x6')]=function(_0x5c9b2b){for(var _0x18b5a5=0x0,_0x500337=events['length'];_0x18b5a5<_0x500337;_0x18b5a5++){var _0x4fe83b=events[_0x18b5a5];var _0x20553c=createListener(_0x91d1('0x7')+_0x4fe83b,_0x5c9b2b);OpenchannelMessageEvents['on'](_0x4fe83b,_0x20553c);}}; \ No newline at end of file +var _0xf611=['emit','removeListener','length','openchannelMessage:','save','remove','update'];(function(_0x3a2b3d,_0x50685e){var _0xd11bfa=function(_0x3022e3){while(--_0x3022e3){_0x3a2b3d['push'](_0x3a2b3d['shift']());}};_0xd11bfa(++_0x50685e);}(_0xf611,0x7b));var _0x1f61=function(_0x523671,_0x4657fc){_0x523671=_0x523671-0x0;var _0x5b0bdc=_0xf611[_0x523671];return _0x5b0bdc;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x1f61('0x0'),_0x1f61('0x1'),_0x1f61('0x2')];function createListener(_0x58da3e,_0x5e6707){return function(_0x5ede64){_0x5e6707[_0x1f61('0x3')](_0x58da3e,_0x5ede64);};}function removeListener(_0x4e0df1,_0xdc8d91){return function(){OpenchannelMessageEvents[_0x1f61('0x4')](_0x4e0df1,_0xdc8d91);};}exports['register']=function(_0x4faa5b){for(var _0x290165=0x0,_0x34a924=events[_0x1f61('0x5')];_0x290165<_0x34a924;_0x290165++){var _0x21e3f6=events[_0x290165];var _0x5b2e5b=createListener(_0x1f61('0x6')+_0x21e3f6,_0x4faa5b);OpenchannelMessageEvents['on'](_0x21e3f6,_0x5b2e5b);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 66031fe..9b47733 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 _0x8958=['util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','update','delete','destroy','removeTeams','removeAgents'];(function(_0xb04f1d,_0x518120){var _0x38b314=function(_0x379e6c){while(--_0x379e6c){_0xb04f1d['push'](_0xb04f1d['shift']());}};_0x38b314(++_0x518120);}(_0x8958,0x180));var _0x8895=function(_0x176943,_0x50969d){_0x176943=_0x176943-0x0;var _0x5c07e8=_0x8958[_0x176943];return _0x5c07e8;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require(_0x8895('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8895('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x3'));var config=require(_0x8895('0x4'));var controller=require(_0x8895('0x5'));router[_0x8895('0x6')]('/',auth['isAuthenticated'](),controller[_0x8895('0x7')]);router[_0x8895('0x6')](_0x8895('0x8'),auth[_0x8895('0x9')](),controller['describe']);router[_0x8895('0x6')](_0x8895('0xa'),auth[_0x8895('0x9')](),controller[_0x8895('0xb')]);router[_0x8895('0x6')](_0x8895('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x8895('0x6')](_0x8895('0xd'),auth['isAuthenticated'](),controller[_0x8895('0xe')]);router[_0x8895('0x6')](_0x8895('0xf'),auth[_0x8895('0x9')](),controller[_0x8895('0x10')]);router[_0x8895('0x11')]('/',auth[_0x8895('0x9')](),controller['create']);router['post'](_0x8895('0xd'),auth[_0x8895('0x9')](),controller['addTeams']);router[_0x8895('0x11')](_0x8895('0xf'),auth['isAuthenticated'](),controller[_0x8895('0x12')]);router['put'](_0x8895('0xa'),auth[_0x8895('0x9')](),controller[_0x8895('0x13')]);router[_0x8895('0x14')]('/:id',auth[_0x8895('0x9')](),controller[_0x8895('0x15')]);router['delete'](_0x8895('0xd'),auth[_0x8895('0x9')](),controller[_0x8895('0x16')]);router[_0x8895('0x14')]('/:id/users',auth[_0x8895('0x9')](),controller[_0x8895('0x17')]);module['exports']=router; \ No newline at end of file +var _0xb50c=['update','destroy','delete','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','addAgents'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0xb50c,0x1e7));var _0xcb50=function(_0x234a17,_0x420ff1){_0x234a17=_0x234a17-0x0;var _0x1a9ecb=_0xb50c[_0x234a17];return _0x1a9ecb;};'use strict';var multer=require(_0xcb50('0x0'));var util=require(_0xcb50('0x1'));var path=require(_0xcb50('0x2'));var timeout=require(_0xcb50('0x3'));var express=require(_0xcb50('0x4'));var router=express[_0xcb50('0x5')]();var fs_extra=require(_0xcb50('0x6'));var auth=require(_0xcb50('0x7'));var interaction=require(_0xcb50('0x8'));var config=require(_0xcb50('0x9'));var controller=require(_0xcb50('0xa'));router[_0xcb50('0xb')]('/',auth[_0xcb50('0xc')](),controller['index']);router[_0xcb50('0xb')](_0xcb50('0xd'),auth[_0xcb50('0xc')](),controller[_0xcb50('0xe')]);router[_0xcb50('0xb')](_0xcb50('0xf'),auth[_0xcb50('0xc')](),controller[_0xcb50('0x10')]);router[_0xcb50('0xb')](_0xcb50('0x11'),auth[_0xcb50('0xc')](),controller[_0xcb50('0x12')]);router[_0xcb50('0xb')]('/:id/teams',auth['isAuthenticated'](),controller[_0xcb50('0x13')]);router[_0xcb50('0xb')]('/:id/users',auth[_0xcb50('0xc')](),controller[_0xcb50('0x14')]);router[_0xcb50('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcb50('0x15')](_0xcb50('0x16'),auth[_0xcb50('0xc')](),controller[_0xcb50('0x17')]);router[_0xcb50('0x15')]('/:id/users',auth[_0xcb50('0xc')](),controller[_0xcb50('0x18')]);router['put'](_0xcb50('0xf'),auth['isAuthenticated'](),controller[_0xcb50('0x19')]);router['delete']('/:id',auth[_0xcb50('0xc')](),controller[_0xcb50('0x1a')]);router[_0xcb50('0x1b')]('/:id/teams',auth['isAuthenticated'](),controller[_0xcb50('0x1c')]);router[_0xcb50('0x1b')](_0xcb50('0x1d'),auth[_0xcb50('0xc')](),controller[_0xcb50('0x1e')]);module[_0xcb50('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index aae828d..dc329ff 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 _0x9872=['ENUM','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x562f75,_0x12ece1){var _0x574c95=function(_0x39e01c){while(--_0x39e01c){_0x562f75['push'](_0x562f75['shift']());}};_0x574c95(++_0x12ece1);}(_0x9872,0x8c));var _0x2987=function(_0x353897,_0x8c94b9){_0x353897=_0x353897-0x0;var _0x22529a=_0x9872[_0x353897];return _0x22529a;};'use strict';var Sequelize=require(_0x2987('0x0'));module[_0x2987('0x1')]={'name':{'type':Sequelize[_0x2987('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2987('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2987('0x4')]('rrmemory','beepall',_0x2987('0x5'))}}; \ No newline at end of file +var _0x260b=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x260b,0x103));var _0xb260=function(_0x4b3c95,_0x370d4c){_0x4b3c95=_0x4b3c95-0x0;var _0x1580b2=_0x260b[_0x4b3c95];return _0x1580b2;};'use strict';var Sequelize=require(_0xb260('0x0'));module[_0xb260('0x1')]={'name':{'type':Sequelize[_0xb260('0x2')],'unique':_0xb260('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb260('0x2')]},'timeout':{'type':Sequelize[_0xb260('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb260('0x5')](_0xb260('0x6'),_0xb260('0x7'),_0xb260('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c6cba51..3b2bd75 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 _0xdc44=['desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','get','destroy','end','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','body','describe','getMembers','findOne','order','pick','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','forEach','emit','removeTeams','select','field','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','value','isEmpty','removeAgents','spread','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','jsforce'];(function(_0x4b630,_0x151f86){var _0x24f855=function(_0x2ead2a){while(--_0x2ead2a){_0x4b630['push'](_0x4b630['shift']());}};_0x24f855(++_0x151f86);}(_0xdc44,0x17e));var _0x4dc4=function(_0x41bfbe,_0x5eebff){_0x41bfbe=_0x41bfbe-0x0;var _0x470d5c=_0xdc44[_0x41bfbe];return _0x470d5c;};'use strict';var emlformat=require(_0x4dc4('0x0'));var rimraf=require(_0x4dc4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4dc4('0x2'));var rp=require(_0x4dc4('0x3'));var moment=require(_0x4dc4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4dc4('0x5'));var util=require(_0x4dc4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4dc4('0x7'));var ejs=require(_0x4dc4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4dc4('0x9'));var crypto=require('crypto');var jsforce=require(_0x4dc4('0xa'));var deskjs=require(_0x4dc4('0xb'));var toCsv=require(_0x4dc4('0x7'));var querystring=require(_0x4dc4('0xc'));var Papa=require('papaparse');var Redis=require(_0x4dc4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4dc4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dc4('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4dc4('0x10'));var db=require(_0x4dc4('0x11'))['db'];config['redis']=_[_0x4dc4('0x12')](config[_0x4dc4('0x13')],{'host':_0x4dc4('0x14'),'port':0x18eb});var socket=require(_0x4dc4('0x15'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x4dc4('0x16')](socket);function respondWithStatusCode(_0x403542,_0x36e9ab){_0x36e9ab=_0x36e9ab||0xcc;return function(_0x18d906){if(_0x18d906){return _0x403542['sendStatus'](_0x36e9ab);}return _0x403542[_0x4dc4('0x17')](_0x36e9ab)['end']();};}function respondWithResult(_0x30e9f2,_0x74b3c0){_0x74b3c0=_0x74b3c0||0xc8;return function(_0x89ce43){if(_0x89ce43){return _0x30e9f2[_0x4dc4('0x17')](_0x74b3c0)[_0x4dc4('0x18')](_0x89ce43);}};}function respondWithFilteredResult(_0x2a863f,_0x379747){return function(_0x2f91a9){if(_0x2f91a9){var _0x3c1a40=typeof _0x379747[_0x4dc4('0x19')]===_0x4dc4('0x1a')&&typeof _0x379747['limit']===_0x4dc4('0x1a');var _0x597eee=_0x2f91a9[_0x4dc4('0x1b')];var _0x1e0b60=_0x3c1a40?0x0:_0x379747[_0x4dc4('0x19')];var _0x357ce0=_0x3c1a40?_0x2f91a9[_0x4dc4('0x1b')]:_0x379747[_0x4dc4('0x19')]+_0x379747['limit'];var _0x378e06;if(_0x357ce0>=_0x597eee){_0x357ce0=_0x597eee;_0x378e06=0xc8;}else{_0x378e06=0xce;}_0x2a863f[_0x4dc4('0x17')](_0x378e06);return _0x2a863f[_0x4dc4('0x1c')](_0x4dc4('0x1d'),_0x1e0b60+'-'+_0x357ce0+'/'+_0x597eee)[_0x4dc4('0x18')](_0x2f91a9);}return null;};}function patchUpdates(_0x4d78d6){return function(_0x3d266c){try{jsonpatch['apply'](_0x3d266c,_0x4d78d6,!![]);}catch(_0x11cc3e){return BPromise[_0x4dc4('0x1e')](_0x11cc3e);}return _0x3d266c[_0x4dc4('0x1f')]();};}function saveUpdates(_0x2c7b04,_0x5a8361){return function(_0xabc04f){if(_0xabc04f){return _0xabc04f[_0x4dc4('0x20')](_0x2c7b04)[_0x4dc4('0x21')](function(_0x550612){return _0x550612;});}return null;};}function removeEntity(_0x2a9738,_0x473509){return function(_0x5c2680){if(_0x5c2680){return _0x5c2680['destroy']()['then'](function(){var _0x26ca86=_0x5c2680[_0x4dc4('0x22')]({'plain':!![]});var _0x377fba='OpenchannelQueues';return db['UserProfileResource'][_0x4dc4('0x23')]({'where':{'type':_0x377fba,'resourceId':_0x26ca86['id']}})[_0x4dc4('0x21')](function(){return _0x5c2680;});})[_0x4dc4('0x21')](function(){_0x2a9738[_0x4dc4('0x17')](0xcc)[_0x4dc4('0x24')]();});}};}function handleEntityNotFound(_0xd533b6,_0x2f24ed){return function(_0x18dd85){if(!_0x18dd85){_0xd533b6[_0x4dc4('0x25')](0x194);}return _0x18dd85;};}function handleError(_0x5f0966,_0x4cb19c){_0x4cb19c=_0x4cb19c||0x1f4;return function(_0x1622f5){logger[_0x4dc4('0x26')](_0x1622f5[_0x4dc4('0x27')]);if(_0x1622f5[_0x4dc4('0x28')]){delete _0x1622f5[_0x4dc4('0x28')];}_0x5f0966[_0x4dc4('0x17')](_0x4cb19c)['send'](_0x1622f5);};}exports['index']=function(_0x369ab9,_0x1b708d){var _0x379185={},_0x4b0881={},_0x1651e4={'count':0x0,'rows':[]};var _0x1c5799=_[_0x4dc4('0x29')](db['OpenchannelQueue'][_0x4dc4('0x2a')],function(_0x4d6c70){return{'name':_0x4d6c70[_0x4dc4('0x2b')],'type':_0x4d6c70[_0x4dc4('0x2c')][_0x4dc4('0x2d')]};});_0x4b0881['model']=_[_0x4dc4('0x29')](_0x1c5799,'name');_0x4b0881[_0x4dc4('0x2e')]=_[_0x4dc4('0x2f')](_0x369ab9[_0x4dc4('0x2e')]);_0x4b0881[_0x4dc4('0x30')]=_['intersection'](_0x4b0881['model'],_0x4b0881['query']);_0x379185['attributes']=_['intersection'](_0x4b0881[_0x4dc4('0x31')],qs[_0x4dc4('0x32')](_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0x379185['attributes']=_0x379185[_0x4dc4('0x33')][_0x4dc4('0x34')]?_0x379185['attributes']:_0x4b0881['model'];if(!_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x35')](_0x4dc4('0x36'))){_0x379185[_0x4dc4('0x37')]=qs[_0x4dc4('0x37')](_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x37')]);_0x379185[_0x4dc4('0x19')]=qs[_0x4dc4('0x19')](_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x19')]);}_0x379185['order']=qs[_0x4dc4('0x38')](_0x369ab9['query'][_0x4dc4('0x38')]);_0x379185['where']=qs['filters'](_['pick'](_0x369ab9['query'],_0x4b0881[_0x4dc4('0x30')]),_0x1c5799);if(_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x39')]){_0x379185[_0x4dc4('0x3a')]=_[_0x4dc4('0x3b')](_0x379185['where'],{'$or':_['map'](_0x1c5799,function(_0x2807d8){if(_0x2807d8[_0x4dc4('0x2c')]!==_0x4dc4('0x3c')){var _0x4380b8={};_0x4380b8[_0x2807d8[_0x4dc4('0x28')]]={'$like':'%'+_0x369ab9['query'][_0x4dc4('0x39')]+'%'};return _0x4380b8;}})});}_0x379185=_['merge']({},_0x379185,_0x369ab9[_0x4dc4('0x3d')]);var _0x1aabfb={'where':_0x379185[_0x4dc4('0x3a')]};return db[_0x4dc4('0x3e')][_0x4dc4('0x1b')](_0x1aabfb)[_0x4dc4('0x21')](function(_0x54c100){_0x1651e4[_0x4dc4('0x1b')]=_0x54c100;if(_0x369ab9[_0x4dc4('0x2e')][_0x4dc4('0x3f')]){_0x379185[_0x4dc4('0x40')]=[{'all':!![]}];}return db[_0x4dc4('0x3e')][_0x4dc4('0x41')](_0x379185);})[_0x4dc4('0x21')](function(_0x5b9185){_0x1651e4[_0x4dc4('0x42')]=_0x5b9185;return _0x1651e4;})[_0x4dc4('0x21')](respondWithFilteredResult(_0x1b708d,_0x379185))[_0x4dc4('0x43')](handleError(_0x1b708d,null));};exports[_0x4dc4('0x44')]=function(_0x32d61a,_0x436f94){var _0x5ecb7a={'raw':!![],'where':{'id':_0x32d61a[_0x4dc4('0x45')]['id']}},_0x66991a={};_0x66991a['model']=_[_0x4dc4('0x2f')](db['OpenchannelQueue'][_0x4dc4('0x2a')]);_0x66991a[_0x4dc4('0x2e')]=_[_0x4dc4('0x2f')](_0x32d61a['query']);_0x66991a[_0x4dc4('0x30')]=_[_0x4dc4('0x46')](_0x66991a[_0x4dc4('0x31')],_0x66991a[_0x4dc4('0x2e')]);_0x5ecb7a[_0x4dc4('0x33')]=_[_0x4dc4('0x46')](_0x66991a[_0x4dc4('0x31')],qs['fields'](_0x32d61a[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0x5ecb7a[_0x4dc4('0x33')]=_0x5ecb7a[_0x4dc4('0x33')][_0x4dc4('0x34')]?_0x5ecb7a[_0x4dc4('0x33')]:_0x66991a['model'];if(_0x32d61a['query'][_0x4dc4('0x3f')]){_0x5ecb7a[_0x4dc4('0x40')]=[{'all':!![]}];}_0x5ecb7a=_[_0x4dc4('0x3b')]({},_0x5ecb7a,_0x32d61a['options']);return db[_0x4dc4('0x3e')][_0x4dc4('0x47')](_0x5ecb7a)['then'](handleEntityNotFound(_0x436f94,null))['then'](respondWithResult(_0x436f94,null))[_0x4dc4('0x43')](handleError(_0x436f94,null));};exports[_0x4dc4('0x48')]=function(_0x41feef,_0x5e11ca){return db['OpenchannelQueue'][_0x4dc4('0x48')](_0x41feef['body'],{})[_0x4dc4('0x21')](function(_0x294bab){var _0x347755=_0x41feef[_0x4dc4('0x49')]['get']({'plain':!![]});if(!_0x347755)throw new Error(_0x4dc4('0x4a'));if(_0x347755['role']===_0x4dc4('0x49')){var _0x54fe7b=_0x294bab[_0x4dc4('0x22')]({'plain':!![]});var _0x4a65b0='OpenchannelQueues';return db['UserProfileSection'][_0x4dc4('0x47')]({'where':{'name':_0x4a65b0,'userProfileId':_0x347755[_0x4dc4('0x4b')]},'raw':!![]})[_0x4dc4('0x21')](function(_0xe4d830){if(_0xe4d830&&_0xe4d830[_0x4dc4('0x4c')]===0x0){return db[_0x4dc4('0x4d')][_0x4dc4('0x48')]({'name':_0x54fe7b['name'],'resourceId':_0x54fe7b['id'],'type':_0xe4d830[_0x4dc4('0x28')],'sectionId':_0xe4d830['id']},{})[_0x4dc4('0x21')](function(){return _0x294bab;});}else{return _0x294bab;}})[_0x4dc4('0x43')](function(_0x387872){logger[_0x4dc4('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x387872);throw _0x387872;});}return _0x294bab;})[_0x4dc4('0x21')](respondWithResult(_0x5e11ca,0xc9))['catch'](handleError(_0x5e11ca,null));};exports[_0x4dc4('0x20')]=function(_0x3246b4,_0x5b925a){if(_0x3246b4['body']['id']){delete _0x3246b4['body']['id'];}return db[_0x4dc4('0x3e')][_0x4dc4('0x47')]({'where':{'id':_0x3246b4[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x21')](handleEntityNotFound(_0x5b925a,null))[_0x4dc4('0x21')](saveUpdates(_0x3246b4[_0x4dc4('0x4e')],null))[_0x4dc4('0x21')](respondWithResult(_0x5b925a,null))[_0x4dc4('0x43')](handleError(_0x5b925a,null));};exports[_0x4dc4('0x23')]=function(_0x4727a9,_0x3f2aba){return db['OpenchannelQueue'][_0x4dc4('0x47')]({'where':{'id':_0x4727a9[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x21')](handleEntityNotFound(_0x3f2aba,null))[_0x4dc4('0x21')](removeEntity(_0x3f2aba,null))[_0x4dc4('0x43')](handleError(_0x3f2aba,null));};exports[_0x4dc4('0x4f')]=function(_0x7eba7b,_0x5f55cb){return db[_0x4dc4('0x3e')][_0x4dc4('0x4f')]()[_0x4dc4('0x21')](respondWithResult(_0x5f55cb,null))[_0x4dc4('0x43')](handleError(_0x5f55cb,null));};exports[_0x4dc4('0x50')]=function(_0x4ed7bb,_0x4cb9b7,_0x4beb9a){var _0xddd9d2={'raw':!![],'where':{}},_0x4a7d4c={},_0x24c709;return db[_0x4dc4('0x3e')][_0x4dc4('0x51')]({'where':{'id':_0x4ed7bb[_0x4dc4('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cb9b7,null))[_0x4dc4('0x21')](function(_0x1401fe){if(_0x1401fe){_0x24c709=_0x1401fe[_0x4dc4('0x22')]({'plain':!![]});_0x4a7d4c[_0x4dc4('0x31')]=_[_0x4dc4('0x2f')](db['UserOpenchannelQueue'][_0x4dc4('0x2a')]);_0x4a7d4c[_0x4dc4('0x2e')]=_['keys'](_0x4ed7bb[_0x4dc4('0x2e')]);_0x4a7d4c['filters']=_[_0x4dc4('0x46')](_0x4a7d4c[_0x4dc4('0x31')],_0x4a7d4c[_0x4dc4('0x2e')]);_0xddd9d2['attributes']=_[_0x4dc4('0x46')](_0x4a7d4c['model'],qs[_0x4dc4('0x32')](_0x4ed7bb[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0xddd9d2[_0x4dc4('0x33')]=_0xddd9d2[_0x4dc4('0x33')][_0x4dc4('0x34')]?_0xddd9d2[_0x4dc4('0x33')]:_0x4a7d4c['model'];if(!_0x4ed7bb['query'][_0x4dc4('0x35')](_0x4dc4('0x36'))){_0xddd9d2[_0x4dc4('0x37')]=qs['limit'](_0x4ed7bb[_0x4dc4('0x2e')][_0x4dc4('0x37')]);_0xddd9d2[_0x4dc4('0x19')]=qs[_0x4dc4('0x19')](_0x4ed7bb[_0x4dc4('0x2e')][_0x4dc4('0x19')]);}_0xddd9d2[_0x4dc4('0x52')]=qs['sort'](_0x4ed7bb[_0x4dc4('0x2e')]['sort']);_0xddd9d2[_0x4dc4('0x3a')]=qs['filters'](_[_0x4dc4('0x53')](_0x4ed7bb[_0x4dc4('0x2e')],_0x4a7d4c[_0x4dc4('0x30')]));_0xddd9d2[_0x4dc4('0x3a')][_0x4dc4('0x54')]=_0x1401fe['id'];if(_0x4ed7bb['query'][_0x4dc4('0x39')]){_0xddd9d2['where']=_[_0x4dc4('0x3b')](_0xddd9d2[_0x4dc4('0x3a')],{'$or':_[_0x4dc4('0x29')](_0xddd9d2[_0x4dc4('0x33')],function(_0xcc06a){var _0x3baa72={};_0x3baa72[_0xcc06a]={'$like':'%'+_0x4ed7bb[_0x4dc4('0x2e')][_0x4dc4('0x39')]+'%'};return _0x3baa72;})});}_0xddd9d2=_[_0x4dc4('0x3b')]({},_0xddd9d2,_0x4ed7bb[_0x4dc4('0x3d')]);return db[_0x4dc4('0x55')][_0x4dc4('0x41')](_0xddd9d2);}})[_0x4dc4('0x21')](function(_0x5e1446){if(_0x5e1446){return db[_0x4dc4('0x56')][_0x4dc4('0x57')]({'where':{'id':_[_0x4dc4('0x29')](_0x5e1446,_0x4dc4('0x58')),'role':_0x4dc4('0x59')},'attributes':['id',_0x4dc4('0x28'),_0x4dc4('0x5a'),_0x4dc4('0x5b'),_0x4dc4('0x5c')]});}})['then'](function(_0x47a292){if(_0x47a292){return{'count':_0x47a292[_0x4dc4('0x1b')],'rows':_['map'](_0x47a292[_0x4dc4('0x42')],function(_0x539f6f){return{'membername':_0x539f6f[_0x4dc4('0x28')],'UserId':_0x539f6f['id'],'queue_name':_0x24c709[_0x4dc4('0x28')],'OpenchannelQueueId':_0x24c709['id'],'interface':util['format'](_0x4dc4('0x5d'),_0x4dc4('0x5e'),_0x539f6f[_0x4dc4('0x28')]),'penalty':0x0,'paused':_0x539f6f[_0x4dc4('0x5a')],'createdAt':_0x539f6f[_0x4dc4('0x5c')],'updatedAt':_0x539f6f[_0x4dc4('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4dc4('0x21')](respondWithFilteredResult(_0x4cb9b7,_0xddd9d2))['catch'](handleError(_0x4cb9b7,null));};exports[_0x4dc4('0x5f')]=function(_0x3008ea,_0x48e082,_0x1eb6db){var _0x5d8d47={};var _0x27d6c7={};var _0x2c8351;var _0x4a15dc;return db['OpenchannelQueue'][_0x4dc4('0x51')]({'where':{'id':_0x3008ea[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x21')](handleEntityNotFound(_0x48e082,null))[_0x4dc4('0x21')](function(_0x451f0d){if(_0x451f0d){_0x2c8351=_0x451f0d;_0x27d6c7[_0x4dc4('0x31')]=_[_0x4dc4('0x2f')](db[_0x4dc4('0x60')][_0x4dc4('0x2a')]);_0x27d6c7['query']=_[_0x4dc4('0x2f')](_0x3008ea[_0x4dc4('0x2e')]);_0x27d6c7[_0x4dc4('0x30')]=_[_0x4dc4('0x46')](_0x27d6c7[_0x4dc4('0x31')],_0x27d6c7[_0x4dc4('0x2e')]);_0x5d8d47['attributes']=_[_0x4dc4('0x46')](_0x27d6c7[_0x4dc4('0x31')],qs[_0x4dc4('0x32')](_0x3008ea[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0x5d8d47[_0x4dc4('0x33')]=_0x5d8d47[_0x4dc4('0x33')][_0x4dc4('0x34')]?_0x5d8d47[_0x4dc4('0x33')]:_0x27d6c7['model'];_0x5d8d47['order']=qs[_0x4dc4('0x38')](_0x3008ea[_0x4dc4('0x2e')]['sort']);_0x5d8d47[_0x4dc4('0x3a')]=qs[_0x4dc4('0x30')](_['pick'](_0x3008ea[_0x4dc4('0x2e')],_0x27d6c7[_0x4dc4('0x30')]));if(_0x3008ea[_0x4dc4('0x2e')][_0x4dc4('0x39')]){_0x5d8d47[_0x4dc4('0x3a')]=_[_0x4dc4('0x3b')](_0x5d8d47[_0x4dc4('0x3a')],{'$or':_[_0x4dc4('0x29')](_0x5d8d47[_0x4dc4('0x33')],function(_0x14210d){var _0x32e90d={};_0x32e90d[_0x14210d]={'$like':'%'+_0x3008ea[_0x4dc4('0x2e')][_0x4dc4('0x39')]+'%'};return _0x32e90d;})});}_0x5d8d47=_[_0x4dc4('0x3b')]({},_0x5d8d47,_0x3008ea['options']);return _0x2c8351[_0x4dc4('0x5f')](_0x5d8d47);}})['then'](function(_0x22ba6f){if(_0x22ba6f){_0x4a15dc=_0x22ba6f[_0x4dc4('0x34')];if(!_0x3008ea['query'][_0x4dc4('0x35')](_0x4dc4('0x36'))){_0x5d8d47[_0x4dc4('0x37')]=qs[_0x4dc4('0x37')](_0x3008ea['query'][_0x4dc4('0x37')]);_0x5d8d47[_0x4dc4('0x19')]=qs['offset'](_0x3008ea[_0x4dc4('0x2e')]['offset']);}return _0x2c8351[_0x4dc4('0x5f')](_0x5d8d47);}})['then'](function(_0x2f411a){if(_0x2f411a){return _0x2f411a?{'count':_0x4a15dc,'rows':_0x2f411a}:null;}})[_0x4dc4('0x21')](respondWithResult(_0x48e082,null))[_0x4dc4('0x43')](handleError(_0x48e082,null));};exports['addTeams']=function(_0x4399d5,_0x266939,_0x2e2973){var _0x26f3d5=_0x4399d5['body'][_0x4dc4('0x61')];return db['Team'][_0x4dc4('0x41')]({'where':{'id':_0x26f3d5},'attributes':['id'],'include':[{'model':db[_0x4dc4('0x56')],'as':_0x4dc4('0x62'),'attributes':['id',_0x4dc4('0x28'),_0x4dc4('0x63'),_0x4dc4('0x64'),_0x4dc4('0x65')],'raw':!![]}]})[_0x4dc4('0x21')](function(_0x193bfe){if(_0x193bfe){var _0x28d701=_['flatMap'](_0x193bfe,function(_0x5c4ab0){var _0x546039=_0x5c4ab0[_0x4dc4('0x22')]({'plain':!![]});return _0x546039[_0x4dc4('0x62')];});return db[_0x4dc4('0x3e')][_0x4dc4('0x47')]({'where':{'id':_0x4399d5[_0x4dc4('0x45')]['id']}})['then'](function(_0x244207){return db[_0x4dc4('0x66')][_0x4dc4('0x67')](function(_0xe06d35){return _0x244207[_0x4dc4('0x68')](_0x26f3d5,{'transaction':_0xe06d35})[_0x4dc4('0x21')](function(){return BPromise['each'](_0x28d701,function(_0x2a29f6){return db[_0x4dc4('0x55')]['findOrCreate']({'where':{'UserId':_0x2a29f6['id'],'OpenchannelQueueId':_0x4399d5[_0x4dc4('0x45')]['id']},'transaction':_0xe06d35});});})['then'](function(){_0x28d701[_0x4dc4('0x69')](function(_0x3eb636){socket[_0x4dc4('0x6a')]('userOpenchannelQueue:save',{'UserId':_0x3eb636['id'],'OpenchannelQueueId':_0x244207['id']});});});});});}})[_0x4dc4('0x21')](respondWithStatusCode(_0x266939,null))[_0x4dc4('0x43')](handleError(_0x266939,null));};exports[_0x4dc4('0x6b')]=function(_0x2fd5fe,_0x591248,_0x342b9b){return db['Team'][_0x4dc4('0x41')]({'where':{'id':_0x2fd5fe[_0x4dc4('0x2e')][_0x4dc4('0x61')]},'attributes':['id'],'include':[{'model':db[_0x4dc4('0x56')],'as':_0x4dc4('0x62'),'attributes':['id'],'raw':!![]}]})[_0x4dc4('0x21')](handleEntityNotFound(_0x591248,null))[_0x4dc4('0x21')](function(_0x114820){var _0x4cf735=_[_0x4dc4('0x29')](_0x114820,'id');var _0x1df052=[];var _0x3f07fb=[];var _0x3c7c7e=squel[_0x4dc4('0x6c')]();_0x3c7c7e[_0x4dc4('0x6d')]('tq.TeamId')[_0x4dc4('0x6e')](_0x4dc4('0x6f'),'tq')['join'](_0x4dc4('0x70'),'ut',_0x4dc4('0x71'))[_0x4dc4('0x3a')](_0x4dc4('0x72'),_0x2fd5fe[_0x4dc4('0x45')]['id']);for(var _0x146f22=0x0;_0x146f22<_0x114820['length'];_0x146f22+=0x1){let _0x5d70d8=_0x114820[_0x146f22];for(var _0x21982d=0x0;_0x21982d<_0x5d70d8[_0x4dc4('0x62')][_0x4dc4('0x34')];_0x21982d+=0x1){let _0x51761b=_0x5d70d8['Agents'][_0x21982d];var _0x1639a5=_0x3c7c7e[_0x4dc4('0x73')]();_0x1639a5[_0x4dc4('0x3a')](_0x4dc4('0x74'),_0x51761b['id']);_0x3f07fb[_0x4dc4('0x75')](db['sequelize']['query'](_0x1639a5[_0x4dc4('0x76')](),{'type':db['sequelize'][_0x4dc4('0x77')]['SELECT']})['then'](function(_0x2e0066){if(_0x2e0066[_0x4dc4('0x34')]===0x1){return _0x51761b['id'];}else{var _0x30df8a=_[_0x4dc4('0x78')](_['map'](_0x2e0066,'TeamId'),function(_0xf0b897){return _[_0x4dc4('0x79')](_0x4cf735,_0xf0b897);});if(_0x30df8a){return _0x51761b['id'];}}}));}}return BPromise[_0x4dc4('0x7a')](_0x3f07fb)['then'](function(_0x5f2e16){_0x1df052=_(_0x1df052)[_0x4dc4('0x7b')](_0x5f2e16)['compact']()[_0x4dc4('0x7c')]();return db[_0x4dc4('0x3e')][_0x4dc4('0x47')]({'where':{'id':_0x2fd5fe[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x21')](function(_0x2227bb){return db[_0x4dc4('0x66')]['transaction'](function(_0x2d1484){return _0x2227bb[_0x4dc4('0x6b')](_0x2fd5fe[_0x4dc4('0x2e')]['ids'],{'transaction':_0x2d1484})[_0x4dc4('0x21')](function(){if(!_[_0x4dc4('0x7d')](_0x1df052)){return _0x2227bb[_0x4dc4('0x7e')](_0x1df052,{'transaction':_0x2d1484});}})[_0x4dc4('0x21')](function(){_0x1df052[_0x4dc4('0x69')](function(_0xb1e43){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0xb1e43,'OpenchannelQueueId':_0x2227bb['id']});});});});});});})[_0x4dc4('0x21')](respondWithStatusCode(_0x591248,null))[_0x4dc4('0x43')](handleError(_0x591248,null));};exports['addAgents']=function(_0x5ae8cc,_0xe9173b,_0x5c581e){return db[_0x4dc4('0x3e')]['find']({'where':{'id':_0x5ae8cc[_0x4dc4('0x45')]['id']}})['then'](handleEntityNotFound(_0xe9173b,null))[_0x4dc4('0x21')](function(_0x4f4ed9){if(_0x4f4ed9){return _0x4f4ed9['addAgents'](_0x5ae8cc[_0x4dc4('0x4e')][_0x4dc4('0x61')],_['omit'](_0x5ae8cc[_0x4dc4('0x4e')],[_0x4dc4('0x61'),'id'])||{})[_0x4dc4('0x7f')](function(_0x59cf5c){for(var _0x387db0=0x0;_0x387db0<_0x5ae8cc['body'][_0x4dc4('0x61')]['length'];_0x387db0+=0x1){socket[_0x4dc4('0x6a')](_0x4dc4('0x80'),{'UserId':Number(_0x5ae8cc['body'][_0x4dc4('0x61')][_0x387db0]),'OpenchannelQueueId':Number(_0x5ae8cc[_0x4dc4('0x45')]['id'])});}return _0x59cf5c;});}})[_0x4dc4('0x21')](respondWithResult(_0xe9173b,null))[_0x4dc4('0x43')](handleError(_0xe9173b,null));};exports[_0x4dc4('0x7e')]=function(_0x54d71f,_0x26cd6e,_0x5cd64c){return db[_0x4dc4('0x3e')][_0x4dc4('0x47')]({'where':{'id':_0x54d71f['params']['id']}})[_0x4dc4('0x21')](handleEntityNotFound(_0x26cd6e,null))[_0x4dc4('0x21')](function(_0x49c56d){if(_0x49c56d){return _0x49c56d[_0x4dc4('0x7e')](_0x54d71f['query'][_0x4dc4('0x61')])['then'](function(){if(_['isArray'](_0x54d71f['query'][_0x4dc4('0x61')])){for(var _0xa96d6b=0x0;_0xa96d6b<_0x54d71f[_0x4dc4('0x2e')]['ids']['length'];_0xa96d6b+=0x1){socket[_0x4dc4('0x6a')](_0x4dc4('0x81'),{'UserId':Number(_0x54d71f[_0x4dc4('0x2e')]['ids'][_0xa96d6b]),'OpenchannelQueueId':Number(_0x54d71f[_0x4dc4('0x45')]['id'])});}}else{socket[_0x4dc4('0x6a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x54d71f[_0x4dc4('0x2e')][_0x4dc4('0x61')]),'OpenchannelQueueId':Number(_0x54d71f[_0x4dc4('0x45')]['id'])});}});}})[_0x4dc4('0x21')](respondWithStatusCode(_0x26cd6e,null))[_0x4dc4('0x43')](handleError(_0x26cd6e,null));};exports[_0x4dc4('0x82')]=function(_0x1593e0,_0xa326e5,_0x46c4ba){var _0x47836e={};var _0x38d75b={};var _0x389ee1;var _0x290326;return db[_0x4dc4('0x3e')][_0x4dc4('0x51')]({'where':{'id':_0x1593e0[_0x4dc4('0x45')]['id']}})['then'](handleEntityNotFound(_0xa326e5,null))[_0x4dc4('0x21')](function(_0x3b90b8){if(_0x3b90b8){_0x389ee1=_0x3b90b8;_0x38d75b['model']=_[_0x4dc4('0x2f')](db[_0x4dc4('0x56')][_0x4dc4('0x2a')]);_0x38d75b[_0x4dc4('0x2e')]=_['keys'](_0x1593e0[_0x4dc4('0x2e')]);_0x38d75b['filters']=_[_0x4dc4('0x46')](_0x38d75b[_0x4dc4('0x31')],_0x38d75b[_0x4dc4('0x2e')]);_0x47836e['attributes']=_[_0x4dc4('0x46')](_0x38d75b['model'],qs[_0x4dc4('0x32')](_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x32')]));_0x47836e[_0x4dc4('0x33')]=_0x47836e['attributes'][_0x4dc4('0x34')]?_0x47836e[_0x4dc4('0x33')]:_0x38d75b['model'];_0x47836e[_0x4dc4('0x52')]=qs['sort'](_0x1593e0['query'][_0x4dc4('0x38')]);_0x47836e[_0x4dc4('0x3a')]=qs[_0x4dc4('0x30')](_['pick'](_0x1593e0[_0x4dc4('0x2e')],_0x38d75b['filters']));if(_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x39')]){_0x47836e[_0x4dc4('0x3a')]=_[_0x4dc4('0x3b')](_0x47836e[_0x4dc4('0x3a')],{'$or':_['map'](_0x47836e[_0x4dc4('0x33')],function(_0xcd2bce){var _0x143b7f={};_0x143b7f[_0xcd2bce]={'$like':'%'+_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x39')]+'%'};return _0x143b7f;})});}_0x47836e=_[_0x4dc4('0x3b')]({},_0x47836e,_0x1593e0[_0x4dc4('0x3d')]);return _0x389ee1[_0x4dc4('0x82')](_0x47836e);}})[_0x4dc4('0x21')](function(_0x4f2397){if(_0x4f2397){_0x290326=_0x4f2397[_0x4dc4('0x34')];if(!_0x1593e0['query'][_0x4dc4('0x35')](_0x4dc4('0x36'))){_0x47836e[_0x4dc4('0x37')]=qs['limit'](_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x37')]);_0x47836e[_0x4dc4('0x19')]=qs['offset'](_0x1593e0[_0x4dc4('0x2e')][_0x4dc4('0x19')]);}return _0x389ee1[_0x4dc4('0x82')](_0x47836e);}})[_0x4dc4('0x21')](function(_0x1457d6){if(_0x1457d6){return _0x1457d6?{'count':_0x290326,'rows':_0x1457d6}:null;}})['then'](respondWithResult(_0xa326e5,null))['catch'](handleError(_0xa326e5,null));}; \ No newline at end of file +var _0x32ba=['compact','value','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','map','OpenchannelQueue','fieldName','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','update','describe','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','Team','nolimit','addTeams','ids','online','voicePause','flatMap','transaction','findOrCreate','forEach','emit','removeTeams','Agents','select','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','includes'];(function(_0x4cfce3,_0x5cfba0){var _0xd71772=function(_0x315f71){while(--_0x315f71){_0x4cfce3['push'](_0x4cfce3['shift']());}};_0xd71772(++_0x5cfba0);}(_0x32ba,0x8f));var _0xa32b=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x32ba[_0x229d7e];return _0xa78280;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa32b('0x0'));var zipdir=require(_0xa32b('0x1'));var jsonpatch=require(_0xa32b('0x2'));var rp=require(_0xa32b('0x3'));var moment=require(_0xa32b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa32b('0x5'));var util=require(_0xa32b('0x6'));var path=require(_0xa32b('0x7'));var sox=require(_0xa32b('0x8'));var csv=require('to-csv');var ejs=require(_0xa32b('0x9'));var fs=require('fs');var fs_extra=require(_0xa32b('0xa'));var _=require(_0xa32b('0xb'));var squel=require(_0xa32b('0xc'));var crypto=require(_0xa32b('0xd'));var jsforce=require(_0xa32b('0xe'));var deskjs=require(_0xa32b('0xf'));var toCsv=require(_0xa32b('0x10'));var querystring=require(_0xa32b('0x11'));var Papa=require(_0xa32b('0x12'));var Redis=require(_0xa32b('0x13'));var authService=require(_0xa32b('0x14'));var qs=require(_0xa32b('0x15'));var as=require(_0xa32b('0x16'));var hardwareService=require(_0xa32b('0x17'));var logger=require('../../config/logger')(_0xa32b('0x18'));var utils=require(_0xa32b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa32b('0x1a'));var db=require(_0xa32b('0x1b'))['db'];config[_0xa32b('0x1c')]=_[_0xa32b('0x1d')](config[_0xa32b('0x1c')],{'host':_0xa32b('0x1e'),'port':0x18eb});var socket=require(_0xa32b('0x1f'))(new Redis(config[_0xa32b('0x1c')]));require('./openchannelQueue.socket')[_0xa32b('0x20')](socket);function respondWithStatusCode(_0x49f8e3,_0x50edac){_0x50edac=_0x50edac||0xcc;return function(_0x7d1e7c){if(_0x7d1e7c){return _0x49f8e3[_0xa32b('0x21')](_0x50edac);}return _0x49f8e3[_0xa32b('0x22')](_0x50edac)[_0xa32b('0x23')]();};}function respondWithResult(_0x2431ad,_0x51bb6f){_0x51bb6f=_0x51bb6f||0xc8;return function(_0x54651b){if(_0x54651b){return _0x2431ad[_0xa32b('0x22')](_0x51bb6f)[_0xa32b('0x24')](_0x54651b);}};}function respondWithFilteredResult(_0x4d1a27,_0x1ed984){return function(_0x921c3b){if(_0x921c3b){var _0x34f1d1=typeof _0x1ed984[_0xa32b('0x25')]==='undefined'&&typeof _0x1ed984[_0xa32b('0x26')]===_0xa32b('0x27');var _0x719196=_0x921c3b[_0xa32b('0x28')];var _0x43a331=_0x34f1d1?0x0:_0x1ed984[_0xa32b('0x25')];var _0x511913=_0x34f1d1?_0x921c3b[_0xa32b('0x28')]:_0x1ed984['offset']+_0x1ed984['limit'];var _0x357956;if(_0x511913>=_0x719196){_0x511913=_0x719196;_0x357956=0xc8;}else{_0x357956=0xce;}_0x4d1a27[_0xa32b('0x22')](_0x357956);return _0x4d1a27[_0xa32b('0x29')]('Content-Range',_0x43a331+'-'+_0x511913+'/'+_0x719196)['json'](_0x921c3b);}return null;};}function patchUpdates(_0x25500a){return function(_0x4be59f){try{jsonpatch[_0xa32b('0x2a')](_0x4be59f,_0x25500a,!![]);}catch(_0x183aea){return BPromise[_0xa32b('0x2b')](_0x183aea);}return _0x4be59f[_0xa32b('0x2c')]();};}function saveUpdates(_0x2311d7,_0x335af6){return function(_0xc400a1){if(_0xc400a1){return _0xc400a1['update'](_0x2311d7)[_0xa32b('0x2d')](function(_0x5aa598){return _0x5aa598;});}return null;};}function removeEntity(_0x4bd914,_0x587145){return function(_0x15660b){if(_0x15660b){return _0x15660b['destroy']()[_0xa32b('0x2d')](function(){var _0x464183=_0x15660b[_0xa32b('0x2e')]({'plain':!![]});var _0x5f2896=_0xa32b('0x2f');return db[_0xa32b('0x30')][_0xa32b('0x31')]({'where':{'type':_0x5f2896,'resourceId':_0x464183['id']}})[_0xa32b('0x2d')](function(){return _0x15660b;});})[_0xa32b('0x2d')](function(){_0x4bd914['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e05cc,_0x4bcde1){return function(_0x5e49e8){if(!_0x5e49e8){_0x4e05cc[_0xa32b('0x21')](0x194);}return _0x5e49e8;};}function handleError(_0x37d1e1,_0x550c60){_0x550c60=_0x550c60||0x1f4;return function(_0x132aa1){logger[_0xa32b('0x32')](_0x132aa1[_0xa32b('0x33')]);if(_0x132aa1[_0xa32b('0x34')]){delete _0x132aa1[_0xa32b('0x34')];}_0x37d1e1[_0xa32b('0x22')](_0x550c60)['send'](_0x132aa1);};}exports['index']=function(_0x4cdfbc,_0x18ef6d){var _0x5bc653={},_0x51214f={},_0x610f16={'count':0x0,'rows':[]};var _0x2e67a9=_[_0xa32b('0x35')](db[_0xa32b('0x36')]['rawAttributes'],function(_0x1a7c12){return{'name':_0x1a7c12[_0xa32b('0x37')],'type':_0x1a7c12['type']['key']};});_0x51214f[_0xa32b('0x38')]=_['map'](_0x2e67a9,'name');_0x51214f[_0xa32b('0x39')]=_[_0xa32b('0x3a')](_0x4cdfbc['query']);_0x51214f[_0xa32b('0x3b')]=_[_0xa32b('0x3c')](_0x51214f['model'],_0x51214f[_0xa32b('0x39')]);_0x5bc653['attributes']=_[_0xa32b('0x3c')](_0x51214f[_0xa32b('0x38')],qs[_0xa32b('0x3d')](_0x4cdfbc['query'][_0xa32b('0x3d')]));_0x5bc653[_0xa32b('0x3e')]=_0x5bc653[_0xa32b('0x3e')][_0xa32b('0x3f')]?_0x5bc653[_0xa32b('0x3e')]:_0x51214f[_0xa32b('0x38')];if(!_0x4cdfbc[_0xa32b('0x39')]['hasOwnProperty']('nolimit')){_0x5bc653[_0xa32b('0x26')]=qs[_0xa32b('0x26')](_0x4cdfbc['query'][_0xa32b('0x26')]);_0x5bc653[_0xa32b('0x25')]=qs[_0xa32b('0x25')](_0x4cdfbc[_0xa32b('0x39')][_0xa32b('0x25')]);}_0x5bc653[_0xa32b('0x40')]=qs[_0xa32b('0x41')](_0x4cdfbc[_0xa32b('0x39')][_0xa32b('0x41')]);_0x5bc653[_0xa32b('0x42')]=qs[_0xa32b('0x3b')](_[_0xa32b('0x43')](_0x4cdfbc[_0xa32b('0x39')],_0x51214f[_0xa32b('0x3b')]),_0x2e67a9);if(_0x4cdfbc['query'][_0xa32b('0x44')]){_0x5bc653[_0xa32b('0x42')]=_[_0xa32b('0x45')](_0x5bc653['where'],{'$or':_[_0xa32b('0x35')](_0x2e67a9,function(_0x2c752a){if(_0x2c752a['type']!=='VIRTUAL'){var _0x5d7426={};_0x5d7426[_0x2c752a[_0xa32b('0x34')]]={'$like':'%'+_0x4cdfbc[_0xa32b('0x39')]['filter']+'%'};return _0x5d7426;}})});}_0x5bc653=_['merge']({},_0x5bc653,_0x4cdfbc[_0xa32b('0x46')]);var _0x2ae332={'where':_0x5bc653[_0xa32b('0x42')]};return db[_0xa32b('0x36')][_0xa32b('0x28')](_0x2ae332)[_0xa32b('0x2d')](function(_0x3d5399){_0x610f16[_0xa32b('0x28')]=_0x3d5399;if(_0x4cdfbc[_0xa32b('0x39')][_0xa32b('0x47')]){_0x5bc653[_0xa32b('0x48')]=[{'all':!![]}];}return db[_0xa32b('0x36')][_0xa32b('0x49')](_0x5bc653);})[_0xa32b('0x2d')](function(_0x7e42b5){_0x610f16[_0xa32b('0x4a')]=_0x7e42b5;return _0x610f16;})[_0xa32b('0x2d')](respondWithFilteredResult(_0x18ef6d,_0x5bc653))[_0xa32b('0x4b')](handleError(_0x18ef6d,null));};exports[_0xa32b('0x4c')]=function(_0x1b8607,_0x577e3f){var _0x5e44de={'raw':!![],'where':{'id':_0x1b8607[_0xa32b('0x4d')]['id']}},_0x290a20={};_0x290a20[_0xa32b('0x38')]=_[_0xa32b('0x3a')](db[_0xa32b('0x36')][_0xa32b('0x4e')]);_0x290a20[_0xa32b('0x39')]=_[_0xa32b('0x3a')](_0x1b8607[_0xa32b('0x39')]);_0x290a20[_0xa32b('0x3b')]=_['intersection'](_0x290a20[_0xa32b('0x38')],_0x290a20[_0xa32b('0x39')]);_0x5e44de[_0xa32b('0x3e')]=_[_0xa32b('0x3c')](_0x290a20[_0xa32b('0x38')],qs[_0xa32b('0x3d')](_0x1b8607[_0xa32b('0x39')][_0xa32b('0x3d')]));_0x5e44de[_0xa32b('0x3e')]=_0x5e44de[_0xa32b('0x3e')][_0xa32b('0x3f')]?_0x5e44de[_0xa32b('0x3e')]:_0x290a20['model'];if(_0x1b8607['query'][_0xa32b('0x47')]){_0x5e44de[_0xa32b('0x48')]=[{'all':!![]}];}_0x5e44de=_['merge']({},_0x5e44de,_0x1b8607[_0xa32b('0x46')]);return db['OpenchannelQueue'][_0xa32b('0x4f')](_0x5e44de)['then'](handleEntityNotFound(_0x577e3f,null))[_0xa32b('0x2d')](respondWithResult(_0x577e3f,null))[_0xa32b('0x4b')](handleError(_0x577e3f,null));};exports[_0xa32b('0x50')]=function(_0x8a6f41,_0x421b94){return db[_0xa32b('0x36')][_0xa32b('0x50')](_0x8a6f41[_0xa32b('0x51')],{})[_0xa32b('0x2d')](function(_0x478e2a){var _0x55d8ae=_0x8a6f41[_0xa32b('0x52')][_0xa32b('0x2e')]({'plain':!![]});if(!_0x55d8ae)throw new Error(_0xa32b('0x53'));if(_0x55d8ae['role']===_0xa32b('0x52')){var _0x5e857b=_0x478e2a[_0xa32b('0x2e')]({'plain':!![]});var _0x5784fe=_0xa32b('0x2f');return db[_0xa32b('0x54')]['find']({'where':{'name':_0x5784fe,'userProfileId':_0x55d8ae['userProfileId']},'raw':!![]})[_0xa32b('0x2d')](function(_0x3b71e4){if(_0x3b71e4&&_0x3b71e4['autoAssociation']===0x0){return db[_0xa32b('0x30')]['create']({'name':_0x5e857b[_0xa32b('0x34')],'resourceId':_0x5e857b['id'],'type':_0x3b71e4['name'],'sectionId':_0x3b71e4['id']},{})[_0xa32b('0x2d')](function(){return _0x478e2a;});}else{return _0x478e2a;}})[_0xa32b('0x4b')](function(_0x3215dd){logger[_0xa32b('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3215dd);throw _0x3215dd;});}return _0x478e2a;})[_0xa32b('0x2d')](respondWithResult(_0x421b94,0xc9))[_0xa32b('0x4b')](handleError(_0x421b94,null));};exports[_0xa32b('0x55')]=function(_0x55e4b8,_0x563616){if(_0x55e4b8[_0xa32b('0x51')]['id']){delete _0x55e4b8[_0xa32b('0x51')]['id'];}return db[_0xa32b('0x36')][_0xa32b('0x4f')]({'where':{'id':_0x55e4b8[_0xa32b('0x4d')]['id']}})[_0xa32b('0x2d')](handleEntityNotFound(_0x563616,null))[_0xa32b('0x2d')](saveUpdates(_0x55e4b8['body'],null))[_0xa32b('0x2d')](respondWithResult(_0x563616,null))['catch'](handleError(_0x563616,null));};exports['destroy']=function(_0x4c0c4c,_0x53e15a){return db[_0xa32b('0x36')][_0xa32b('0x4f')]({'where':{'id':_0x4c0c4c[_0xa32b('0x4d')]['id']}})[_0xa32b('0x2d')](handleEntityNotFound(_0x53e15a,null))[_0xa32b('0x2d')](removeEntity(_0x53e15a,null))[_0xa32b('0x4b')](handleError(_0x53e15a,null));};exports[_0xa32b('0x56')]=function(_0x242619,_0x268b95){return db['OpenchannelQueue'][_0xa32b('0x56')]()[_0xa32b('0x2d')](respondWithResult(_0x268b95,null))[_0xa32b('0x4b')](handleError(_0x268b95,null));};exports['getMembers']=function(_0x2494c3,_0x5625cb,_0x31237f){var _0x11a6e9={'raw':!![],'where':{}},_0x536b60={},_0x54aaf8;return db[_0xa32b('0x36')][_0xa32b('0x57')]({'where':{'id':_0x2494c3['params']['id']}})['then'](handleEntityNotFound(_0x5625cb,null))[_0xa32b('0x2d')](function(_0x33c62f){if(_0x33c62f){_0x54aaf8=_0x33c62f[_0xa32b('0x2e')]({'plain':!![]});_0x536b60[_0xa32b('0x38')]=_['keys'](db[_0xa32b('0x58')]['rawAttributes']);_0x536b60['query']=_[_0xa32b('0x3a')](_0x2494c3[_0xa32b('0x39')]);_0x536b60[_0xa32b('0x3b')]=_['intersection'](_0x536b60[_0xa32b('0x38')],_0x536b60[_0xa32b('0x39')]);_0x11a6e9[_0xa32b('0x3e')]=_[_0xa32b('0x3c')](_0x536b60[_0xa32b('0x38')],qs[_0xa32b('0x3d')](_0x2494c3[_0xa32b('0x39')][_0xa32b('0x3d')]));_0x11a6e9[_0xa32b('0x3e')]=_0x11a6e9[_0xa32b('0x3e')][_0xa32b('0x3f')]?_0x11a6e9[_0xa32b('0x3e')]:_0x536b60[_0xa32b('0x38')];if(!_0x2494c3[_0xa32b('0x39')][_0xa32b('0x59')]('nolimit')){_0x11a6e9[_0xa32b('0x26')]=qs[_0xa32b('0x26')](_0x2494c3[_0xa32b('0x39')][_0xa32b('0x26')]);_0x11a6e9[_0xa32b('0x25')]=qs['offset'](_0x2494c3['query'][_0xa32b('0x25')]);}_0x11a6e9[_0xa32b('0x40')]=qs[_0xa32b('0x41')](_0x2494c3[_0xa32b('0x39')]['sort']);_0x11a6e9['where']=qs['filters'](_[_0xa32b('0x43')](_0x2494c3['query'],_0x536b60[_0xa32b('0x3b')]));_0x11a6e9[_0xa32b('0x42')][_0xa32b('0x5a')]=_0x33c62f['id'];if(_0x2494c3['query'][_0xa32b('0x44')]){_0x11a6e9[_0xa32b('0x42')]=_[_0xa32b('0x45')](_0x11a6e9[_0xa32b('0x42')],{'$or':_['map'](_0x11a6e9[_0xa32b('0x3e')],function(_0x39b911){var _0x2b6d36={};_0x2b6d36[_0x39b911]={'$like':'%'+_0x2494c3[_0xa32b('0x39')][_0xa32b('0x44')]+'%'};return _0x2b6d36;})});}_0x11a6e9=_['merge']({},_0x11a6e9,_0x2494c3[_0xa32b('0x46')]);return db[_0xa32b('0x58')]['findAll'](_0x11a6e9);}})[_0xa32b('0x2d')](function(_0x279b79){if(_0x279b79){return db[_0xa32b('0x5b')][_0xa32b('0x5c')]({'where':{'id':_[_0xa32b('0x35')](_0x279b79,_0xa32b('0x5d')),'role':_0xa32b('0x5e')},'attributes':['id',_0xa32b('0x34'),_0xa32b('0x5f'),_0xa32b('0x60'),_0xa32b('0x61')]});}})[_0xa32b('0x2d')](function(_0x50a42a){if(_0x50a42a){return{'count':_0x50a42a[_0xa32b('0x28')],'rows':_[_0xa32b('0x35')](_0x50a42a[_0xa32b('0x4a')],function(_0x80600a){return{'membername':_0x80600a[_0xa32b('0x34')],'UserId':_0x80600a['id'],'queue_name':_0x54aaf8[_0xa32b('0x34')],'OpenchannelQueueId':_0x54aaf8['id'],'interface':util[_0xa32b('0x62')]('%s/%s',_0xa32b('0x63'),_0x80600a[_0xa32b('0x34')]),'penalty':0x0,'paused':_0x80600a['openchannelPause'],'createdAt':_0x80600a['createdAt'],'updatedAt':_0x80600a[_0xa32b('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa32b('0x2d')](respondWithFilteredResult(_0x5625cb,_0x11a6e9))[_0xa32b('0x4b')](handleError(_0x5625cb,null));};exports[_0xa32b('0x64')]=function(_0x4d8bf9,_0x2f3d18,_0x310240){var _0x5786b4={};var _0x1265c3={};var _0x5eb151;var _0x5260e4;return db[_0xa32b('0x36')][_0xa32b('0x57')]({'where':{'id':_0x4d8bf9[_0xa32b('0x4d')]['id']}})[_0xa32b('0x2d')](handleEntityNotFound(_0x2f3d18,null))['then'](function(_0x4b2df2){if(_0x4b2df2){_0x5eb151=_0x4b2df2;_0x1265c3[_0xa32b('0x38')]=_[_0xa32b('0x3a')](db[_0xa32b('0x65')]['rawAttributes']);_0x1265c3[_0xa32b('0x39')]=_[_0xa32b('0x3a')](_0x4d8bf9[_0xa32b('0x39')]);_0x1265c3['filters']=_['intersection'](_0x1265c3[_0xa32b('0x38')],_0x1265c3[_0xa32b('0x39')]);_0x5786b4[_0xa32b('0x3e')]=_[_0xa32b('0x3c')](_0x1265c3['model'],qs[_0xa32b('0x3d')](_0x4d8bf9[_0xa32b('0x39')][_0xa32b('0x3d')]));_0x5786b4[_0xa32b('0x3e')]=_0x5786b4['attributes'][_0xa32b('0x3f')]?_0x5786b4[_0xa32b('0x3e')]:_0x1265c3[_0xa32b('0x38')];_0x5786b4[_0xa32b('0x40')]=qs[_0xa32b('0x41')](_0x4d8bf9[_0xa32b('0x39')][_0xa32b('0x41')]);_0x5786b4[_0xa32b('0x42')]=qs['filters'](_[_0xa32b('0x43')](_0x4d8bf9[_0xa32b('0x39')],_0x1265c3['filters']));if(_0x4d8bf9[_0xa32b('0x39')][_0xa32b('0x44')]){_0x5786b4[_0xa32b('0x42')]=_[_0xa32b('0x45')](_0x5786b4[_0xa32b('0x42')],{'$or':_[_0xa32b('0x35')](_0x5786b4[_0xa32b('0x3e')],function(_0x1e334e){var _0x264167={};_0x264167[_0x1e334e]={'$like':'%'+_0x4d8bf9[_0xa32b('0x39')][_0xa32b('0x44')]+'%'};return _0x264167;})});}_0x5786b4=_[_0xa32b('0x45')]({},_0x5786b4,_0x4d8bf9[_0xa32b('0x46')]);return _0x5eb151[_0xa32b('0x64')](_0x5786b4);}})[_0xa32b('0x2d')](function(_0x1acf1c){if(_0x1acf1c){_0x5260e4=_0x1acf1c[_0xa32b('0x3f')];if(!_0x4d8bf9[_0xa32b('0x39')][_0xa32b('0x59')](_0xa32b('0x66'))){_0x5786b4['limit']=qs[_0xa32b('0x26')](_0x4d8bf9[_0xa32b('0x39')][_0xa32b('0x26')]);_0x5786b4[_0xa32b('0x25')]=qs['offset'](_0x4d8bf9[_0xa32b('0x39')][_0xa32b('0x25')]);}return _0x5eb151[_0xa32b('0x64')](_0x5786b4);}})[_0xa32b('0x2d')](function(_0x1b11e1){if(_0x1b11e1){return _0x1b11e1?{'count':_0x5260e4,'rows':_0x1b11e1}:null;}})[_0xa32b('0x2d')](respondWithResult(_0x2f3d18,null))[_0xa32b('0x4b')](handleError(_0x2f3d18,null));};exports[_0xa32b('0x67')]=function(_0x21f5db,_0xc0757,_0x25bdfb){var _0x1f2f57=_0x21f5db['body'][_0xa32b('0x68')];return db[_0xa32b('0x65')]['findAll']({'where':{'id':_0x1f2f57},'attributes':['id'],'include':[{'model':db[_0xa32b('0x5b')],'as':'Agents','attributes':['id','name',_0xa32b('0x69'),_0xa32b('0x6a'),'interface'],'raw':!![]}]})[_0xa32b('0x2d')](function(_0x3a1445){if(_0x3a1445){var _0x12887e=_[_0xa32b('0x6b')](_0x3a1445,function(_0x2d0638){var _0x27dacf=_0x2d0638[_0xa32b('0x2e')]({'plain':!![]});return _0x27dacf['Agents'];});return db[_0xa32b('0x36')][_0xa32b('0x4f')]({'where':{'id':_0x21f5db[_0xa32b('0x4d')]['id']}})[_0xa32b('0x2d')](function(_0x359ff){return db['sequelize'][_0xa32b('0x6c')](function(_0x37c0f2){return _0x359ff['addTeams'](_0x1f2f57,{'transaction':_0x37c0f2})[_0xa32b('0x2d')](function(){return BPromise['each'](_0x12887e,function(_0x4cbdd6){return db[_0xa32b('0x58')][_0xa32b('0x6d')]({'where':{'UserId':_0x4cbdd6['id'],'OpenchannelQueueId':_0x21f5db[_0xa32b('0x4d')]['id']},'transaction':_0x37c0f2});});})[_0xa32b('0x2d')](function(){_0x12887e[_0xa32b('0x6e')](function(_0x5b99fb){socket[_0xa32b('0x6f')]('userOpenchannelQueue:save',{'UserId':_0x5b99fb['id'],'OpenchannelQueueId':_0x359ff['id']});});});});});}})[_0xa32b('0x2d')](respondWithStatusCode(_0xc0757,null))[_0xa32b('0x4b')](handleError(_0xc0757,null));};exports[_0xa32b('0x70')]=function(_0x570f49,_0xdbcd5e,_0x4203dc){return db[_0xa32b('0x65')]['findAll']({'where':{'id':_0x570f49[_0xa32b('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa32b('0x5b')],'as':_0xa32b('0x71'),'attributes':['id'],'raw':!![]}]})[_0xa32b('0x2d')](handleEntityNotFound(_0xdbcd5e,null))[_0xa32b('0x2d')](function(_0x533fa1){var _0x28eebf=_[_0xa32b('0x35')](_0x533fa1,'id');var _0x1f82f5=[];var _0x569dde=[];var _0x165637=squel[_0xa32b('0x72')]();_0x165637['field']('tq.TeamId')['from'](_0xa32b('0x73'),'tq')[_0xa32b('0x74')]('user_has_teams','ut',_0xa32b('0x75'))[_0xa32b('0x42')](_0xa32b('0x76'),_0x570f49[_0xa32b('0x4d')]['id']);for(var _0x3b3977=0x0;_0x3b3977<_0x533fa1['length'];_0x3b3977+=0x1){let _0x3766c8=_0x533fa1[_0x3b3977];for(var _0x575088=0x0;_0x575088<_0x3766c8[_0xa32b('0x71')]['length'];_0x575088+=0x1){let _0xb4fea3=_0x3766c8[_0xa32b('0x71')][_0x575088];var _0x3b0cd0=_0x165637['clone']();_0x3b0cd0[_0xa32b('0x42')](_0xa32b('0x77'),_0xb4fea3['id']);_0x569dde[_0xa32b('0x78')](db['sequelize'][_0xa32b('0x39')](_0x3b0cd0[_0xa32b('0x79')](),{'type':db[_0xa32b('0x7a')]['QueryTypes'][_0xa32b('0x7b')]})[_0xa32b('0x2d')](function(_0x303bbb){if(_0x303bbb[_0xa32b('0x3f')]===0x1){return _0xb4fea3['id'];}else{var _0x56f400=_[_0xa32b('0x7c')](_[_0xa32b('0x35')](_0x303bbb,_0xa32b('0x7d')),function(_0x5b0f65){return _[_0xa32b('0x7e')](_0x28eebf,_0x5b0f65);});if(_0x56f400){return _0xb4fea3['id'];}}}));}}return BPromise['all'](_0x569dde)[_0xa32b('0x2d')](function(_0xda78e9){_0x1f82f5=_(_0x1f82f5)['union'](_0xda78e9)[_0xa32b('0x7f')]()[_0xa32b('0x80')]();return db['OpenchannelQueue'][_0xa32b('0x4f')]({'where':{'id':_0x570f49[_0xa32b('0x4d')]['id']}})[_0xa32b('0x2d')](function(_0x23225d){return db['sequelize'][_0xa32b('0x6c')](function(_0x22bbda){return _0x23225d[_0xa32b('0x70')](_0x570f49[_0xa32b('0x39')][_0xa32b('0x68')],{'transaction':_0x22bbda})['then'](function(){if(!_['isEmpty'](_0x1f82f5)){return _0x23225d['removeAgents'](_0x1f82f5,{'transaction':_0x22bbda});}})[_0xa32b('0x2d')](function(){_0x1f82f5[_0xa32b('0x6e')](function(_0x3f5fa7){socket[_0xa32b('0x6f')](_0xa32b('0x81'),{'UserId':_0x3f5fa7,'OpenchannelQueueId':_0x23225d['id']});});});});});});})[_0xa32b('0x2d')](respondWithStatusCode(_0xdbcd5e,null))[_0xa32b('0x4b')](handleError(_0xdbcd5e,null));};exports[_0xa32b('0x82')]=function(_0xb95cc4,_0x4547c9,_0x2cbbcc){return db[_0xa32b('0x36')][_0xa32b('0x4f')]({'where':{'id':_0xb95cc4['params']['id']}})[_0xa32b('0x2d')](handleEntityNotFound(_0x4547c9,null))[_0xa32b('0x2d')](function(_0x2ca2dd){if(_0x2ca2dd){return _0x2ca2dd[_0xa32b('0x82')](_0xb95cc4[_0xa32b('0x51')][_0xa32b('0x68')],_[_0xa32b('0x83')](_0xb95cc4[_0xa32b('0x51')],[_0xa32b('0x68'),'id'])||{})[_0xa32b('0x84')](function(_0x434138){for(var _0x234d37=0x0;_0x234d37<_0xb95cc4['body'][_0xa32b('0x68')]['length'];_0x234d37+=0x1){socket[_0xa32b('0x6f')]('userOpenchannelQueue:save',{'UserId':Number(_0xb95cc4[_0xa32b('0x51')][_0xa32b('0x68')][_0x234d37]),'OpenchannelQueueId':Number(_0xb95cc4[_0xa32b('0x4d')]['id'])});}return _0x434138;});}})['then'](respondWithResult(_0x4547c9,null))[_0xa32b('0x4b')](handleError(_0x4547c9,null));};exports['removeAgents']=function(_0x1e216a,_0x389bc1,_0x46c539){return db[_0xa32b('0x36')]['find']({'where':{'id':_0x1e216a[_0xa32b('0x4d')]['id']}})[_0xa32b('0x2d')](handleEntityNotFound(_0x389bc1,null))[_0xa32b('0x2d')](function(_0x492937){if(_0x492937){return _0x492937[_0xa32b('0x85')](_0x1e216a[_0xa32b('0x39')]['ids'])['then'](function(){if(_['isArray'](_0x1e216a[_0xa32b('0x39')]['ids'])){for(var _0x24be75=0x0;_0x24be75<_0x1e216a[_0xa32b('0x39')][_0xa32b('0x68')]['length'];_0x24be75+=0x1){socket[_0xa32b('0x6f')](_0xa32b('0x81'),{'UserId':Number(_0x1e216a[_0xa32b('0x39')][_0xa32b('0x68')][_0x24be75]),'OpenchannelQueueId':Number(_0x1e216a[_0xa32b('0x4d')]['id'])});}}else{socket[_0xa32b('0x6f')](_0xa32b('0x81'),{'UserId':Number(_0x1e216a[_0xa32b('0x39')][_0xa32b('0x68')]),'OpenchannelQueueId':Number(_0x1e216a[_0xa32b('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x389bc1,null))['catch'](handleError(_0x389bc1,null));};exports[_0xa32b('0x86')]=function(_0x1cbff4,_0x1665cc,_0x178393){var _0x5ecd31={};var _0x29de72={};var _0x11b149;var _0xd1312b;return db['OpenchannelQueue'][_0xa32b('0x57')]({'where':{'id':_0x1cbff4['params']['id']}})[_0xa32b('0x2d')](handleEntityNotFound(_0x1665cc,null))[_0xa32b('0x2d')](function(_0x2b1bb2){if(_0x2b1bb2){_0x11b149=_0x2b1bb2;_0x29de72['model']=_[_0xa32b('0x3a')](db[_0xa32b('0x5b')][_0xa32b('0x4e')]);_0x29de72[_0xa32b('0x39')]=_[_0xa32b('0x3a')](_0x1cbff4['query']);_0x29de72[_0xa32b('0x3b')]=_[_0xa32b('0x3c')](_0x29de72[_0xa32b('0x38')],_0x29de72[_0xa32b('0x39')]);_0x5ecd31[_0xa32b('0x3e')]=_[_0xa32b('0x3c')](_0x29de72[_0xa32b('0x38')],qs[_0xa32b('0x3d')](_0x1cbff4[_0xa32b('0x39')]['fields']));_0x5ecd31['attributes']=_0x5ecd31[_0xa32b('0x3e')]['length']?_0x5ecd31['attributes']:_0x29de72[_0xa32b('0x38')];_0x5ecd31['order']=qs['sort'](_0x1cbff4[_0xa32b('0x39')]['sort']);_0x5ecd31['where']=qs[_0xa32b('0x3b')](_[_0xa32b('0x43')](_0x1cbff4[_0xa32b('0x39')],_0x29de72[_0xa32b('0x3b')]));if(_0x1cbff4[_0xa32b('0x39')][_0xa32b('0x44')]){_0x5ecd31[_0xa32b('0x42')]=_[_0xa32b('0x45')](_0x5ecd31['where'],{'$or':_[_0xa32b('0x35')](_0x5ecd31[_0xa32b('0x3e')],function(_0x4d4662){var _0x1d992c={};_0x1d992c[_0x4d4662]={'$like':'%'+_0x1cbff4[_0xa32b('0x39')]['filter']+'%'};return _0x1d992c;})});}_0x5ecd31=_['merge']({},_0x5ecd31,_0x1cbff4[_0xa32b('0x46')]);return _0x11b149[_0xa32b('0x86')](_0x5ecd31);}})[_0xa32b('0x2d')](function(_0xd62039){if(_0xd62039){_0xd1312b=_0xd62039[_0xa32b('0x3f')];if(!_0x1cbff4[_0xa32b('0x39')][_0xa32b('0x59')]('nolimit')){_0x5ecd31['limit']=qs[_0xa32b('0x26')](_0x1cbff4[_0xa32b('0x39')]['limit']);_0x5ecd31[_0xa32b('0x25')]=qs[_0xa32b('0x25')](_0x1cbff4[_0xa32b('0x39')][_0xa32b('0x25')]);}return _0x11b149[_0xa32b('0x86')](_0x5ecd31);}})[_0xa32b('0x2d')](function(_0x3985ad){if(_0x3985ad){return _0x3985ad?{'count':_0xd1312b,'rows':_0x3985ad}:null;}})['then'](respondWithResult(_0x1665cc,null))[_0xa32b('0x4b')](handleError(_0x1665cc,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 7a59a54..1d4b57e 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 _0xb9ef=['exports','events','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x61b360,_0x5c9eee){var _0x1c7696=function(_0x42f578){while(--_0x42f578){_0x61b360['push'](_0x61b360['shift']());}};_0x1c7696(++_0x5c9eee);}(_0xb9ef,0x1c9));var _0xfb9e=function(_0x3f2719,_0x2282f9){_0x3f2719=_0x3f2719-0x0;var _0xb63d2e=_0xb9ef[_0x3f2719];return _0xb63d2e;};'use strict';var EventEmitter=require(_0xfb9e('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xfb9e('0x1')](0x0);var events={'afterCreate':_0xfb9e('0x2'),'afterUpdate':'update','afterDestroy':_0xfb9e('0x3')};function emitEvent(_0x6923){return function(_0x2f5416,_0x17187c,_0x523b2b){OpenchannelQueueEvents[_0xfb9e('0x4')](_0x6923+':'+_0x2f5416['id'],_0x2f5416);OpenchannelQueueEvents[_0xfb9e('0x4')](_0x6923,_0x2f5416);_0x523b2b(null);};}for(var e in events){if(events[_0xfb9e('0x5')](e)){var event=events[e];OpenchannelQueue[_0xfb9e('0x6')](e,emitEvent(event));}}module[_0xfb9e('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xc838=['emit','hook','exports','../../mysqldb','OpenchannelQueue','save','update'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0xc838,0x81));var _0x8c83=function(_0xa14263,_0x57f374){_0xa14263=_0xa14263-0x0;var _0x4e955b=_0xc838[_0xa14263];return _0x4e955b;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x8c83('0x0'))['db'][_0x8c83('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c83('0x2'),'afterUpdate':_0x8c83('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40a615){return function(_0x234903,_0xc33330,_0x50658c){OpenchannelQueueEvents[_0x8c83('0x4')](_0x40a615+':'+_0x234903['id'],_0x234903);OpenchannelQueueEvents[_0x8c83('0x4')](_0x40a615,_0x234903);_0x50658c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x8c83('0x5')](e,emitEvent(event));}}module[_0x8c83('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index ad37d45..2776181 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 _0xea71=['exports','define','OpenchannelQueue','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x3b3727,_0x408dac){var _0x3dde01=function(_0x54d171){while(--_0x54d171){_0x3b3727['push'](_0x3b3727['shift']());}};_0x3dde01(++_0x408dac);}(_0xea71,0xe7));var _0x1ea7=function(_0x325f75,_0x3b315c){_0x325f75=_0x325f75-0x0;var _0x3e2eb8=_0xea71[_0x325f75];return _0x3e2eb8;};'use strict';var _=require(_0x1ea7('0x0'));var util=require(_0x1ea7('0x1'));var logger=require(_0x1ea7('0x2'))(_0x1ea7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1ea7('0x4'));var fs=require('fs');var path=require(_0x1ea7('0x5'));var rimraf=require(_0x1ea7('0x6'));var config=require(_0x1ea7('0x7'));var attributes=require(_0x1ea7('0x8'));module[_0x1ea7('0x9')]=function(_0x548d0d,_0x1aee02){return _0x548d0d[_0x1ea7('0xa')](_0x1ea7('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4af=['bluebird','request-promise','../../config/environment','./openchannelQueue.attributes','exports','define','lodash','util','api'];(function(_0x1444b1,_0x1362f5){var _0x268be1=function(_0x4248da){while(--_0x4248da){_0x1444b1['push'](_0x1444b1['shift']());}};_0x268be1(++_0x1362f5);}(_0xf4af,0xd5));var _0xff4a=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xf4af[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xff4a('0x0'));var util=require(_0xff4a('0x1'));var logger=require('../../config/logger')(_0xff4a('0x2'));var moment=require('moment');var BPromise=require(_0xff4a('0x3'));var rp=require(_0xff4a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xff4a('0x5'));var attributes=require(_0xff4a('0x6'));module[_0xff4a('0x7')]=function(_0x343f2e,_0x211b8b){return _0x343f2e[_0xff4a('0x8')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index d0dfb20..0e1f2fd 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 _0x3567=['debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','attributes','limit','include','map','model','then','GetOpenchannelQueue','ShowOpenchannelQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x3567,0x8c));var _0x7356=function(_0x17a4cf,_0x5cfc25){_0x17a4cf=_0x17a4cf-0x0;var _0x2d4106=_0x3567[_0x17a4cf];return _0x2d4106;};'use strict';var _=require('lodash');var util=require(_0x7356('0x0'));var moment=require(_0x7356('0x1'));var BPromise=require(_0x7356('0x2'));var rs=require(_0x7356('0x3'));var fs=require('fs');var Redis=require(_0x7356('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7356('0x5'));var logger=require('../../config/logger')(_0x7356('0x6'));var config=require(_0x7356('0x7'));var jayson=require(_0x7356('0x8'));var client=jayson['client'][_0x7356('0x9')]({'port':0x232a});config[_0x7356('0xa')]=_[_0x7356('0xb')](config['redis'],{'host':_0x7356('0xc'),'port':0x18eb});var socket=require(_0x7356('0xd'))(new Redis(config[_0x7356('0xa')]));require(_0x7356('0xe'))[_0x7356('0xf')](socket);function respondWithRpcPromise(_0x48e0a1,_0x4e1456,_0x6f73c){return new BPromise(function(_0x1e52ea,_0x41ac10){return client[_0x7356('0x10')](_0x48e0a1,_0x6f73c)['then'](function(_0x125017){logger[_0x7356('0x11')](_0x7356('0x12'),_0x4e1456,_0x7356('0x13'));logger[_0x7356('0x14')](_0x7356('0x15'),_0x4e1456,_0x7356('0x13'),JSON[_0x7356('0x16')](_0x125017));if(_0x125017[_0x7356('0x17')]){if(_0x125017[_0x7356('0x17')]['code']===0x1f4){logger[_0x7356('0x17')](_0x7356('0x12'),_0x4e1456,_0x125017[_0x7356('0x17')][_0x7356('0x18')]);return _0x41ac10(_0x125017[_0x7356('0x17')][_0x7356('0x18')]);}logger[_0x7356('0x17')](_0x7356('0x12'),_0x4e1456,_0x125017[_0x7356('0x17')][_0x7356('0x18')]);return _0x1e52ea(_0x125017[_0x7356('0x17')]['message']);}else{logger[_0x7356('0x11')](_0x7356('0x12'),_0x4e1456,'request\x20sent');_0x1e52ea(_0x125017[_0x7356('0x19')]['message']);}})[_0x7356('0x1a')](function(_0x183881){logger['error'](_0x7356('0x12'),_0x4e1456,_0x183881);_0x41ac10(_0x183881);});});}exports['GetOpenchannelQueue']=function(_0x2e18e9){var _0x16c22f=this;return new Promise(function(_0x19f359,_0x13509f){return db['OpenchannelQueue'][_0x7356('0x1b')]({'raw':_0x2e18e9[_0x7356('0x1c')]?_0x2e18e9[_0x7356('0x1c')][_0x7356('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e18e9['options']?_0x2e18e9[_0x7356('0x1c')]['where']||null:null,'attributes':_0x2e18e9[_0x7356('0x1c')]?_0x2e18e9[_0x7356('0x1c')][_0x7356('0x1e')]||null:null,'limit':_0x2e18e9['options']?_0x2e18e9[_0x7356('0x1c')][_0x7356('0x1f')]||null:null,'include':_0x2e18e9['options']?_0x2e18e9[_0x7356('0x1c')][_0x7356('0x20')]?_[_0x7356('0x21')](_0x2e18e9[_0x7356('0x1c')][_0x7356('0x20')],function(_0x5beafa){return{'model':db[_0x5beafa['model']],'as':_0x5beafa['as'],'attributes':_0x5beafa[_0x7356('0x1e')],'include':_0x5beafa[_0x7356('0x20')]?_[_0x7356('0x21')](_0x5beafa[_0x7356('0x20')],function(_0x8212df){return{'model':db[_0x8212df[_0x7356('0x22')]],'as':_0x8212df['as'],'attributes':_0x8212df[_0x7356('0x1e')],'include':_0x8212df[_0x7356('0x20')]?_[_0x7356('0x21')](_0x8212df[_0x7356('0x20')],function(_0x39e85f){return{'model':db[_0x39e85f['model']],'as':_0x39e85f['as'],'attributes':_0x39e85f[_0x7356('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7356('0x23')](function(_0x1fd4cf){logger[_0x7356('0x11')](_0x7356('0x24'),_0x2e18e9);logger[_0x7356('0x14')](_0x7356('0x24'),_0x2e18e9,JSON['stringify'](_0x1fd4cf));_0x19f359(_0x1fd4cf);})['catch'](function(_0x41b78e){logger[_0x7356('0x17')]('GetOpenchannelQueue',_0x41b78e[_0x7356('0x18')],_0x2e18e9);_0x13509f(_0x16c22f[_0x7356('0x17')](0x1f4,_0x41b78e['message']));});});};exports[_0x7356('0x25')]=function(_0x1cf8aa){var _0x3d6045=this;return new Promise(function(_0x445720,_0x4fd508){return db['OpenchannelQueue'][_0x7356('0x26')]({'raw':_0x1cf8aa[_0x7356('0x1c')]?_0x1cf8aa['options'][_0x7356('0x1d')]===undefined?!![]:![]:!![],'where':_0x1cf8aa[_0x7356('0x1c')]?_0x1cf8aa['options'][_0x7356('0x27')]||null:null,'attributes':_0x1cf8aa[_0x7356('0x1c')]?_0x1cf8aa[_0x7356('0x1c')][_0x7356('0x1e')]||null:null,'include':_0x1cf8aa['options']?_0x1cf8aa[_0x7356('0x1c')][_0x7356('0x20')]?_[_0x7356('0x21')](_0x1cf8aa[_0x7356('0x1c')]['include'],function(_0x1596d1){return{'model':db[_0x1596d1[_0x7356('0x22')]],'as':_0x1596d1['as'],'attributes':_0x1596d1['attributes'],'include':_0x1596d1[_0x7356('0x20')]?_['map'](_0x1596d1[_0x7356('0x20')],function(_0x20ca9a){return{'model':db[_0x20ca9a[_0x7356('0x22')]],'as':_0x20ca9a['as'],'attributes':_0x20ca9a[_0x7356('0x1e')],'include':_0x20ca9a[_0x7356('0x20')]?_[_0x7356('0x21')](_0x20ca9a['include'],function(_0x4cdfea){return{'model':db[_0x4cdfea[_0x7356('0x22')]],'as':_0x4cdfea['as'],'attributes':_0x4cdfea[_0x7356('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7356('0x23')](function(_0x44ada6){logger[_0x7356('0x11')]('ShowOpenchannelQueue',_0x1cf8aa);logger['debug'](_0x7356('0x25'),_0x1cf8aa,JSON['stringify'](_0x44ada6));_0x445720(_0x44ada6);})[_0x7356('0x1a')](function(_0x3cb479){logger[_0x7356('0x17')](_0x7356('0x25'),_0x3cb479[_0x7356('0x18')],_0x1cf8aa);_0x4fd508(_0x3d6045[_0x7356('0x17')](0x1f4,_0x3cb479[_0x7356('0x18')]));});});}; \ No newline at end of file +var _0x7aac=['GetOpenchannelQueue','OpenchannelQueue','options','attributes','limit','map','include','model','find','where','ShowOpenchannelQueue','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','localhost','socket.io-emitter','./openchannelQueue.socket','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x590114,_0x2ca735){var _0x149e50=function(_0x3275fc){while(--_0x3275fc){_0x590114['push'](_0x590114['shift']());}};_0x149e50(++_0x2ca735);}(_0x7aac,0x1e7));var _0xc7aa=function(_0x4ea634,_0x43fa2e){_0x4ea634=_0x4ea634-0x0;var _0x379c24=_0x7aac[_0x4ea634];return _0x379c24;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc7aa('0x0'));var rs=require(_0xc7aa('0x1'));var fs=require('fs');var Redis=require(_0xc7aa('0x2'));var db=require(_0xc7aa('0x3'))['db'];var utils=require(_0xc7aa('0x4'));var logger=require(_0xc7aa('0x5'))('rpc');var config=require(_0xc7aa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc7aa('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc7aa('0x8'),'port':0x18eb});var socket=require(_0xc7aa('0x9'))(new Redis(config['redis']));require(_0xc7aa('0xa'))['register'](socket);function respondWithRpcPromise(_0x56e790,_0x245605,_0x2cbdcd){return new BPromise(function(_0x8282e1,_0x34985b){return client['request'](_0x56e790,_0x2cbdcd)[_0xc7aa('0xb')](function(_0x51d3dd){logger['info'](_0xc7aa('0xc'),_0x245605,_0xc7aa('0xd'));logger[_0xc7aa('0xe')](_0xc7aa('0xf'),_0x245605,_0xc7aa('0xd'),JSON[_0xc7aa('0x10')](_0x51d3dd));if(_0x51d3dd[_0xc7aa('0x11')]){if(_0x51d3dd[_0xc7aa('0x11')][_0xc7aa('0x12')]===0x1f4){logger[_0xc7aa('0x11')](_0xc7aa('0xc'),_0x245605,_0x51d3dd['error']['message']);return _0x34985b(_0x51d3dd[_0xc7aa('0x11')][_0xc7aa('0x13')]);}logger[_0xc7aa('0x11')](_0xc7aa('0xc'),_0x245605,_0x51d3dd[_0xc7aa('0x11')]['message']);return _0x8282e1(_0x51d3dd[_0xc7aa('0x11')][_0xc7aa('0x13')]);}else{logger[_0xc7aa('0x14')](_0xc7aa('0xc'),_0x245605,_0xc7aa('0xd'));_0x8282e1(_0x51d3dd[_0xc7aa('0x15')]['message']);}})[_0xc7aa('0x16')](function(_0x1b718b){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x245605,_0x1b718b);_0x34985b(_0x1b718b);});});}exports[_0xc7aa('0x17')]=function(_0x1b79aa){var _0x4d732c=this;return new Promise(function(_0x1455f9,_0x436832){return db[_0xc7aa('0x18')]['findAll']({'raw':_0x1b79aa['options']?_0x1b79aa['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b79aa[_0xc7aa('0x19')]?_0x1b79aa['options']['where']||null:null,'attributes':_0x1b79aa[_0xc7aa('0x19')]?_0x1b79aa[_0xc7aa('0x19')][_0xc7aa('0x1a')]||null:null,'limit':_0x1b79aa['options']?_0x1b79aa['options'][_0xc7aa('0x1b')]||null:null,'include':_0x1b79aa[_0xc7aa('0x19')]?_0x1b79aa[_0xc7aa('0x19')]['include']?_[_0xc7aa('0x1c')](_0x1b79aa[_0xc7aa('0x19')][_0xc7aa('0x1d')],function(_0x42b47d){return{'model':db[_0x42b47d[_0xc7aa('0x1e')]],'as':_0x42b47d['as'],'attributes':_0x42b47d['attributes'],'include':_0x42b47d['include']?_['map'](_0x42b47d[_0xc7aa('0x1d')],function(_0x29e633){return{'model':db[_0x29e633['model']],'as':_0x29e633['as'],'attributes':_0x29e633[_0xc7aa('0x1a')],'include':_0x29e633[_0xc7aa('0x1d')]?_[_0xc7aa('0x1c')](_0x29e633['include'],function(_0x317d24){return{'model':db[_0x317d24['model']],'as':_0x317d24['as'],'attributes':_0x317d24['attributes']};}):[]};}):[]};}):[]:[]})[_0xc7aa('0xb')](function(_0x16aaa3){logger[_0xc7aa('0x14')]('GetOpenchannelQueue',_0x1b79aa);logger['debug'](_0xc7aa('0x17'),_0x1b79aa,JSON[_0xc7aa('0x10')](_0x16aaa3));_0x1455f9(_0x16aaa3);})[_0xc7aa('0x16')](function(_0x1ebe6f){logger[_0xc7aa('0x11')](_0xc7aa('0x17'),_0x1ebe6f['message'],_0x1b79aa);_0x436832(_0x4d732c[_0xc7aa('0x11')](0x1f4,_0x1ebe6f[_0xc7aa('0x13')]));});});};exports['ShowOpenchannelQueue']=function(_0x4d043a){var _0x55a6e7=this;return new Promise(function(_0x171ab6,_0x302021){return db[_0xc7aa('0x18')][_0xc7aa('0x1f')]({'raw':_0x4d043a[_0xc7aa('0x19')]?_0x4d043a['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d043a[_0xc7aa('0x19')]?_0x4d043a[_0xc7aa('0x19')][_0xc7aa('0x20')]||null:null,'attributes':_0x4d043a[_0xc7aa('0x19')]?_0x4d043a[_0xc7aa('0x19')]['attributes']||null:null,'include':_0x4d043a[_0xc7aa('0x19')]?_0x4d043a[_0xc7aa('0x19')]['include']?_[_0xc7aa('0x1c')](_0x4d043a['options']['include'],function(_0x445f42){return{'model':db[_0x445f42['model']],'as':_0x445f42['as'],'attributes':_0x445f42[_0xc7aa('0x1a')],'include':_0x445f42[_0xc7aa('0x1d')]?_[_0xc7aa('0x1c')](_0x445f42[_0xc7aa('0x1d')],function(_0x25232b){return{'model':db[_0x25232b[_0xc7aa('0x1e')]],'as':_0x25232b['as'],'attributes':_0x25232b[_0xc7aa('0x1a')],'include':_0x25232b[_0xc7aa('0x1d')]?_[_0xc7aa('0x1c')](_0x25232b['include'],function(_0x27f124){return{'model':db[_0x27f124[_0xc7aa('0x1e')]],'as':_0x27f124['as'],'attributes':_0x27f124[_0xc7aa('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc7aa('0xb')](function(_0x24c31c){logger[_0xc7aa('0x14')](_0xc7aa('0x21'),_0x4d043a);logger[_0xc7aa('0xe')](_0xc7aa('0x21'),_0x4d043a,JSON[_0xc7aa('0x10')](_0x24c31c));_0x171ab6(_0x24c31c);})[_0xc7aa('0x16')](function(_0x345920){logger[_0xc7aa('0x11')](_0xc7aa('0x21'),_0x345920['message'],_0x4d043a);_0x302021(_0x55a6e7[_0xc7aa('0x11')](0x1f4,_0x345920['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 50c1829..9472c14 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 _0x5cdd=['emit','register','length','./openchannelQueue.events'];(function(_0x4c40f7,_0x11abfd){var _0x57e129=function(_0x5c0332){while(--_0x5c0332){_0x4c40f7['push'](_0x4c40f7['shift']());}};_0x57e129(++_0x11abfd);}(_0x5cdd,0x143));var _0xd5cd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5cdd[_0x4b369d];return _0x571a98;};'use strict';var OpenchannelQueueEvents=require(_0xd5cd('0x0'));var events=['save','remove','update'];function createListener(_0x56c8c0,_0x252cb4){return function(_0x5334d6){_0x252cb4[_0xd5cd('0x1')](_0x56c8c0,_0x5334d6);};}function removeListener(_0x1d5fbd,_0x4ffa78){return function(){OpenchannelQueueEvents['removeListener'](_0x1d5fbd,_0x4ffa78);};}exports[_0xd5cd('0x2')]=function(_0x21b8a5){for(var _0x1e909e=0x0,_0x4bfd50=events[_0xd5cd('0x3')];_0x1e909e<_0x4bfd50;_0x1e909e++){var _0x20f4e4=events[_0x1e909e];var _0x2c0320=createListener('openchannelQueue:'+_0x20f4e4,_0x21b8a5);OpenchannelQueueEvents['on'](_0x20f4e4,_0x2c0320);}}; \ No newline at end of file +var _0x960f=['save','remove','removeListener','register','openchannelQueue:'];(function(_0x13eae7,_0x4c65c6){var _0x154c74=function(_0x3963d2){while(--_0x3963d2){_0x13eae7['push'](_0x13eae7['shift']());}};_0x154c74(++_0x4c65c6);}(_0x960f,0x1b3));var _0xf960=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x960f[_0xbb091];return _0x467a04;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xf960('0x0'),_0xf960('0x1'),'update'];function createListener(_0x59d07e,_0x8c97d4){return function(_0x37d211){_0x8c97d4['emit'](_0x59d07e,_0x37d211);};}function removeListener(_0x624b4e,_0x29be7f){return function(){OpenchannelQueueEvents[_0xf960('0x2')](_0x624b4e,_0x29be7f);};}exports[_0xf960('0x3')]=function(_0x20398a){for(var _0x1718ed=0x0,_0xee7dce=events['length'];_0x1718ed<_0xee7dce;_0x1718ed++){var _0x147b95=events[_0x1718ed];var _0x575923=createListener(_0xf960('0x4')+_0x147b95,_0x20398a);OpenchannelQueueEvents['on'](_0x147b95,_0x575923);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 3ed161e..cc25bdf 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 _0x39e8=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x39e8,0x8b));var _0x839e=function(_0x32cdbd,_0x2098c9){_0x32cdbd=_0x32cdbd-0x0;var _0x3e8e47=_0x39e8[_0x32cdbd];return _0x3e8e47;};'use strict';var multer=require('multer');var util=require(_0x839e('0x0'));var path=require(_0x839e('0x1'));var timeout=require('connect-timeout');var express=require(_0x839e('0x2'));var router=express['Router']();var fs_extra=require(_0x839e('0x3'));var auth=require(_0x839e('0x4'));var interaction=require(_0x839e('0x5'));var config=require(_0x839e('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0x839e('0x7')]('/',auth['isAuthenticated'](),controller[_0x839e('0x8')]);router[_0x839e('0x7')](_0x839e('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x839e('0xa'),auth[_0x839e('0xb')](),controller[_0x839e('0xc')]);router[_0x839e('0xd')]('/',auth[_0x839e('0xb')](),controller[_0x839e('0xe')]);router[_0x839e('0xf')]('/:id',auth[_0x839e('0xb')](),controller[_0x839e('0x10')]);router[_0x839e('0x11')](_0x839e('0xa'),auth[_0x839e('0xb')](),controller[_0x839e('0x12')]);module[_0x839e('0x13')]=router; \ No newline at end of file +var _0x8511=['create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x3c9dac,_0x3d24a8){var _0x576ba1=function(_0x29fa93){while(--_0x29fa93){_0x3c9dac['push'](_0x3c9dac['shift']());}};_0x576ba1(++_0x3d24a8);}(_0x8511,0x1bf));var _0x1851=function(_0x427090,_0x3ea32b){_0x427090=_0x427090-0x0;var _0x4aa42c=_0x8511[_0x427090];return _0x4aa42c;};'use strict';var multer=require(_0x1851('0x0'));var util=require('util');var path=require(_0x1851('0x1'));var timeout=require(_0x1851('0x2'));var express=require(_0x1851('0x3'));var router=express[_0x1851('0x4')]();var fs_extra=require(_0x1851('0x5'));var auth=require(_0x1851('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1851('0x7'));router[_0x1851('0x8')]('/',auth[_0x1851('0x9')](),controller[_0x1851('0xa')]);router[_0x1851('0x8')](_0x1851('0xb'),auth[_0x1851('0x9')](),controller[_0x1851('0xc')]);router[_0x1851('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1851('0xd')]);router[_0x1851('0xe')]('/',auth[_0x1851('0x9')](),controller[_0x1851('0xf')]);router[_0x1851('0x10')]('/:id',auth[_0x1851('0x9')](),controller[_0x1851('0x11')]);router[_0x1851('0x12')](_0x1851('0x13'),auth['isAuthenticated'](),controller[_0x1851('0x14')]);module[_0x1851('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 804927a..b66f8fb 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 _0x186a=['exports','STRING','DATE','moment','sequelize'];(function(_0x4766e5,_0x25a5cc){var _0x54f0fc=function(_0x201d11){while(--_0x201d11){_0x4766e5['push'](_0x4766e5['shift']());}};_0x54f0fc(++_0x25a5cc);}(_0x186a,0x15c));var _0xa186=function(_0x5d1d55,_0x101459){_0x5d1d55=_0x5d1d55-0x0;var _0x5e3c4e=_0x186a[_0x5d1d55];return _0x5e3c4e;};'use strict';var moment=require(_0xa186('0x0'));var Sequelize=require(_0xa186('0x1'));module[_0xa186('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa186('0x3')]},'joinAt':{'type':Sequelize[_0xa186('0x4')]},'leaveAt':{'type':Sequelize[_0xa186('0x4')]},'acceptAt':{'type':Sequelize[_0xa186('0x4')]},'exitAt':{'type':Sequelize[_0xa186('0x4')]},'reason':{'type':Sequelize[_0xa186('0x3')]}}; \ No newline at end of file +var _0x6c8c=['DATE','sequelize','exports','STRING'];(function(_0x331dac,_0x1c4096){var _0x2b5d0d=function(_0x38613a){while(--_0x38613a){_0x331dac['push'](_0x331dac['shift']());}};_0x2b5d0d(++_0x1c4096);}(_0x6c8c,0x1ed));var _0xc6c8=function(_0x53e88f,_0x57be87){_0x53e88f=_0x53e88f-0x0;var _0x4955a6=_0x6c8c[_0x53e88f];return _0x4955a6;};'use strict';var moment=require('moment');var Sequelize=require(_0xc6c8('0x0'));module[_0xc6c8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc6c8('0x2')]},'joinAt':{'type':Sequelize[_0xc6c8('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc6c8('0x3')]},'reason':{'type':Sequelize[_0xc6c8('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b3bc345..fda50f5 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 _0x7fcb=['end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','include','findAll','rows','show','params','merge','options','OpenchannelQueueReport','find','catch','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7fcb,0x15f));var _0xb7fc=function(_0x5650b0,_0x1d1dff){_0x5650b0=_0x5650b0-0x0;var _0x311f58=_0x7fcb[_0x5650b0];return _0x311f58;};'use strict';var emlformat=require(_0xb7fc('0x0'));var rimraf=require(_0xb7fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7fc('0x2'));var moment=require('moment');var BPromise=require(_0xb7fc('0x3'));var Mustache=require(_0xb7fc('0x4'));var util=require('util');var path=require(_0xb7fc('0x5'));var sox=require(_0xb7fc('0x6'));var csv=require(_0xb7fc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7fc('0x8'));var _=require(_0xb7fc('0x9'));var squel=require(_0xb7fc('0xa'));var crypto=require(_0xb7fc('0xb'));var jsforce=require(_0xb7fc('0xc'));var deskjs=require(_0xb7fc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb7fc('0xe'));var authService=require(_0xb7fc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb7fc('0x10'));var hardwareService=require(_0xb7fc('0x11'));var logger=require(_0xb7fc('0x12'))(_0xb7fc('0x13'));var utils=require('../../config/utils');var config=require(_0xb7fc('0x14'));var licenseUtil=require(_0xb7fc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20b21a,_0x570da4){_0x570da4=_0x570da4||0xcc;return function(_0x3c8505){if(_0x3c8505){return _0x20b21a[_0xb7fc('0x16')](_0x570da4);}return _0x20b21a[_0xb7fc('0x17')](_0x570da4)[_0xb7fc('0x18')]();};}function respondWithResult(_0x144930,_0x321ef7){_0x321ef7=_0x321ef7||0xc8;return function(_0x5459d0){if(_0x5459d0){return _0x144930[_0xb7fc('0x17')](_0x321ef7)[_0xb7fc('0x19')](_0x5459d0);}};}function respondWithFilteredResult(_0x59bcdb,_0x550571){return function(_0x15793){if(_0x15793){var _0x5aefc6=typeof _0x550571[_0xb7fc('0x1a')]==='undefined'&&typeof _0x550571[_0xb7fc('0x1b')]==='undefined';var _0x22ef41=_0x15793[_0xb7fc('0x1c')];var _0x3f2ff1=_0x5aefc6?0x0:_0x550571['offset'];var _0x1fb1cd=_0x5aefc6?_0x15793[_0xb7fc('0x1c')]:_0x550571[_0xb7fc('0x1a')]+_0x550571['limit'];var _0x5746db;if(_0x1fb1cd>=_0x22ef41){_0x1fb1cd=_0x22ef41;_0x5746db=0xc8;}else{_0x5746db=0xce;}_0x59bcdb[_0xb7fc('0x17')](_0x5746db);return _0x59bcdb[_0xb7fc('0x1d')](_0xb7fc('0x1e'),_0x3f2ff1+'-'+_0x1fb1cd+'/'+_0x22ef41)['json'](_0x15793);}return null;};}function patchUpdates(_0x42759b){return function(_0x4663a0){try{jsonpatch[_0xb7fc('0x1f')](_0x4663a0,_0x42759b,!![]);}catch(_0x407534){return BPromise[_0xb7fc('0x20')](_0x407534);}return _0x4663a0['save']();};}function saveUpdates(_0x4f9d71,_0x3d452b){return function(_0x227fcc){if(_0x227fcc){return _0x227fcc[_0xb7fc('0x21')](_0x4f9d71)[_0xb7fc('0x22')](function(_0x2023b7){return _0x2023b7;});}return null;};}function removeEntity(_0xe1746b,_0x1254a8){return function(_0x2de29c){if(_0x2de29c){return _0x2de29c[_0xb7fc('0x23')]()['then'](function(){_0xe1746b[_0xb7fc('0x17')](0xcc)[_0xb7fc('0x18')]();});}};}function handleEntityNotFound(_0x363839,_0x3d72c2){return function(_0x26653b){if(!_0x26653b){_0x363839[_0xb7fc('0x16')](0x194);}return _0x26653b;};}function handleError(_0x1b6dcd,_0x39e916){_0x39e916=_0x39e916||0x1f4;return function(_0x3c03a2){logger[_0xb7fc('0x24')](_0x3c03a2[_0xb7fc('0x25')]);if(_0x3c03a2[_0xb7fc('0x26')]){delete _0x3c03a2[_0xb7fc('0x26')];}_0x1b6dcd[_0xb7fc('0x17')](_0x39e916)[_0xb7fc('0x27')](_0x3c03a2);};}exports[_0xb7fc('0x28')]=function(_0x404ee8,_0x543c3d){var _0x4517d0={},_0x584bf5={},_0x3e85ef={'count':0x0,'rows':[]};var _0x5c8613=_[_0xb7fc('0x29')](db['OpenchannelQueueReport'][_0xb7fc('0x2a')],function(_0x39dc57){return{'name':_0x39dc57[_0xb7fc('0x2b')],'type':_0x39dc57[_0xb7fc('0x2c')][_0xb7fc('0x2d')]};});_0x584bf5[_0xb7fc('0x2e')]=_[_0xb7fc('0x29')](_0x5c8613,'name');_0x584bf5[_0xb7fc('0x2f')]=_[_0xb7fc('0x30')](_0x404ee8['query']);_0x584bf5[_0xb7fc('0x31')]=_[_0xb7fc('0x32')](_0x584bf5[_0xb7fc('0x2e')],_0x584bf5['query']);_0x4517d0[_0xb7fc('0x33')]=_[_0xb7fc('0x32')](_0x584bf5[_0xb7fc('0x2e')],qs[_0xb7fc('0x34')](_0x404ee8[_0xb7fc('0x2f')]['fields']));_0x4517d0[_0xb7fc('0x33')]=_0x4517d0['attributes'][_0xb7fc('0x35')]?_0x4517d0[_0xb7fc('0x33')]:_0x584bf5[_0xb7fc('0x2e')];if(!_0x404ee8[_0xb7fc('0x2f')][_0xb7fc('0x36')](_0xb7fc('0x37'))){_0x4517d0[_0xb7fc('0x1b')]=qs[_0xb7fc('0x1b')](_0x404ee8[_0xb7fc('0x2f')][_0xb7fc('0x1b')]);_0x4517d0[_0xb7fc('0x1a')]=qs[_0xb7fc('0x1a')](_0x404ee8[_0xb7fc('0x2f')][_0xb7fc('0x1a')]);}_0x4517d0[_0xb7fc('0x38')]=qs[_0xb7fc('0x39')](_0x404ee8['query'][_0xb7fc('0x39')]);_0x4517d0['where']=qs['filters'](_[_0xb7fc('0x3a')](_0x404ee8[_0xb7fc('0x2f')],_0x584bf5[_0xb7fc('0x31')]),_0x5c8613);if(_0x404ee8[_0xb7fc('0x2f')][_0xb7fc('0x3b')]){_0x4517d0['where']=_['merge'](_0x4517d0[_0xb7fc('0x3c')],{'$or':_[_0xb7fc('0x29')](_0x5c8613,function(_0x157fb2){if(_0x157fb2[_0xb7fc('0x2c')]!==_0xb7fc('0x3d')){var _0x4c011d={};_0x4c011d[_0x157fb2[_0xb7fc('0x26')]]={'$like':'%'+_0x404ee8['query'][_0xb7fc('0x3b')]+'%'};return _0x4c011d;}})});}_0x4517d0=_['merge']({},_0x4517d0,_0x404ee8['options']);var _0x262739={'where':_0x4517d0[_0xb7fc('0x3c')]};return db['OpenchannelQueueReport'][_0xb7fc('0x1c')](_0x262739)[_0xb7fc('0x22')](function(_0x1dba03){_0x3e85ef[_0xb7fc('0x1c')]=_0x1dba03;if(_0x404ee8[_0xb7fc('0x2f')]['includeAll']){_0x4517d0[_0xb7fc('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xb7fc('0x3f')](_0x4517d0);})['then'](function(_0x4fd604){_0x3e85ef[_0xb7fc('0x40')]=_0x4fd604;return _0x3e85ef;})['then'](respondWithFilteredResult(_0x543c3d,_0x4517d0))['catch'](handleError(_0x543c3d,null));};exports[_0xb7fc('0x41')]=function(_0x2aa44b,_0x1e46ad){var _0x542e56={'raw':!![],'where':{'id':_0x2aa44b[_0xb7fc('0x42')]['id']}},_0x569504={};_0x569504['model']=_[_0xb7fc('0x30')](db['OpenchannelQueueReport'][_0xb7fc('0x2a')]);_0x569504[_0xb7fc('0x2f')]=_['keys'](_0x2aa44b[_0xb7fc('0x2f')]);_0x569504['filters']=_['intersection'](_0x569504[_0xb7fc('0x2e')],_0x569504[_0xb7fc('0x2f')]);_0x542e56[_0xb7fc('0x33')]=_[_0xb7fc('0x32')](_0x569504[_0xb7fc('0x2e')],qs['fields'](_0x2aa44b[_0xb7fc('0x2f')][_0xb7fc('0x34')]));_0x542e56['attributes']=_0x542e56[_0xb7fc('0x33')][_0xb7fc('0x35')]?_0x542e56[_0xb7fc('0x33')]:_0x569504[_0xb7fc('0x2e')];if(_0x2aa44b[_0xb7fc('0x2f')]['includeAll']){_0x542e56[_0xb7fc('0x3e')]=[{'all':!![]}];}_0x542e56=_[_0xb7fc('0x43')]({},_0x542e56,_0x2aa44b[_0xb7fc('0x44')]);return db[_0xb7fc('0x45')][_0xb7fc('0x46')](_0x542e56)[_0xb7fc('0x22')](handleEntityNotFound(_0x1e46ad,null))[_0xb7fc('0x22')](respondWithResult(_0x1e46ad,null))[_0xb7fc('0x47')](handleError(_0x1e46ad,null));};exports[_0xb7fc('0x48')]=function(_0x5abe7d,_0x3327c5){return db[_0xb7fc('0x45')][_0xb7fc('0x48')](_0x5abe7d[_0xb7fc('0x49')],{})[_0xb7fc('0x22')](respondWithResult(_0x3327c5,0xc9))[_0xb7fc('0x47')](handleError(_0x3327c5,null));};exports[_0xb7fc('0x21')]=function(_0x875d5c,_0x44578c){if(_0x875d5c[_0xb7fc('0x49')]['id']){delete _0x875d5c[_0xb7fc('0x49')]['id'];}return db[_0xb7fc('0x45')][_0xb7fc('0x46')]({'where':{'id':_0x875d5c[_0xb7fc('0x42')]['id']}})[_0xb7fc('0x22')](handleEntityNotFound(_0x44578c,null))['then'](saveUpdates(_0x875d5c[_0xb7fc('0x49')],null))['then'](respondWithResult(_0x44578c,null))[_0xb7fc('0x47')](handleError(_0x44578c,null));};exports[_0xb7fc('0x23')]=function(_0xd42df3,_0x722282){return db[_0xb7fc('0x45')][_0xb7fc('0x46')]({'where':{'id':_0xd42df3['params']['id']}})[_0xb7fc('0x22')](handleEntityNotFound(_0x722282,null))[_0xb7fc('0x22')](removeEntity(_0x722282,null))[_0xb7fc('0x47')](handleError(_0x722282,null));};exports[_0xb7fc('0x4a')]=function(_0x47239a,_0x195d90){return db[_0xb7fc('0x45')]['describe']()[_0xb7fc('0x22')](respondWithResult(_0x195d90,null))[_0xb7fc('0x47')](handleError(_0x195d90,null));}; \ No newline at end of file +var _0x16e3=['set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','limit','undefined','count','offset'];(function(_0xd83c77,_0x343752){var _0x392ee8=function(_0x576335){while(--_0x576335){_0xd83c77['push'](_0xd83c77['shift']());}};_0x392ee8(++_0x343752);}(_0x16e3,0x116));var _0x316e=function(_0x5986f1,_0x303505){_0x5986f1=_0x5986f1-0x0;var _0x4c70ab=_0x16e3[_0x5986f1];return _0x4c70ab;};'use strict';var emlformat=require(_0x316e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x316e('0x1'));var jsonpatch=require(_0x316e('0x2'));var rp=require(_0x316e('0x3'));var moment=require('moment');var BPromise=require(_0x316e('0x4'));var Mustache=require(_0x316e('0x5'));var util=require(_0x316e('0x6'));var path=require(_0x316e('0x7'));var sox=require(_0x316e('0x8'));var csv=require(_0x316e('0x9'));var ejs=require(_0x316e('0xa'));var fs=require('fs');var fs_extra=require(_0x316e('0xb'));var _=require(_0x316e('0xc'));var squel=require(_0x316e('0xd'));var crypto=require(_0x316e('0xe'));var jsforce=require(_0x316e('0xf'));var deskjs=require(_0x316e('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x316e('0x11'));var Redis=require(_0x316e('0x12'));var authService=require(_0x316e('0x13'));var qs=require(_0x316e('0x14'));var as=require(_0x316e('0x15'));var hardwareService=require(_0x316e('0x16'));var logger=require(_0x316e('0x17'))(_0x316e('0x18'));var utils=require(_0x316e('0x19'));var config=require(_0x316e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b722e,_0x1c1150){_0x1c1150=_0x1c1150||0xcc;return function(_0x15d9f6){if(_0x15d9f6){return _0x3b722e[_0x316e('0x1b')](_0x1c1150);}return _0x3b722e['status'](_0x1c1150)[_0x316e('0x1c')]();};}function respondWithResult(_0x362f4f,_0x4e5198){_0x4e5198=_0x4e5198||0xc8;return function(_0x420cb1){if(_0x420cb1){return _0x362f4f[_0x316e('0x1d')](_0x4e5198)['json'](_0x420cb1);}};}function respondWithFilteredResult(_0x11bdba,_0x60f7ca){return function(_0x1af68b){if(_0x1af68b){var _0x50ffc6=typeof _0x60f7ca['offset']==='undefined'&&typeof _0x60f7ca[_0x316e('0x1e')]===_0x316e('0x1f');var _0x43d479=_0x1af68b['count'];var _0x655de0=_0x50ffc6?0x0:_0x60f7ca['offset'];var _0x43929b=_0x50ffc6?_0x1af68b[_0x316e('0x20')]:_0x60f7ca[_0x316e('0x21')]+_0x60f7ca[_0x316e('0x1e')];var _0x3b8aea;if(_0x43929b>=_0x43d479){_0x43929b=_0x43d479;_0x3b8aea=0xc8;}else{_0x3b8aea=0xce;}_0x11bdba[_0x316e('0x1d')](_0x3b8aea);return _0x11bdba[_0x316e('0x22')](_0x316e('0x23'),_0x655de0+'-'+_0x43929b+'/'+_0x43d479)['json'](_0x1af68b);}return null;};}function patchUpdates(_0x430101){return function(_0x104f07){try{jsonpatch[_0x316e('0x24')](_0x104f07,_0x430101,!![]);}catch(_0x4fbdcf){return BPromise[_0x316e('0x25')](_0x4fbdcf);}return _0x104f07[_0x316e('0x26')]();};}function saveUpdates(_0x2d4668,_0xc9b2d){return function(_0x5a605b){if(_0x5a605b){return _0x5a605b[_0x316e('0x27')](_0x2d4668)[_0x316e('0x28')](function(_0x4eeb0e){return _0x4eeb0e;});}return null;};}function removeEntity(_0x3fbadf,_0x5920dd){return function(_0x3ed8f7){if(_0x3ed8f7){return _0x3ed8f7[_0x316e('0x29')]()[_0x316e('0x28')](function(){_0x3fbadf[_0x316e('0x1d')](0xcc)[_0x316e('0x1c')]();});}};}function handleEntityNotFound(_0x46a313,_0x2873a1){return function(_0x29c82a){if(!_0x29c82a){_0x46a313[_0x316e('0x1b')](0x194);}return _0x29c82a;};}function handleError(_0x5c8e42,_0x563ce3){_0x563ce3=_0x563ce3||0x1f4;return function(_0x4f4268){logger[_0x316e('0x2a')](_0x4f4268['stack']);if(_0x4f4268['name']){delete _0x4f4268[_0x316e('0x2b')];}_0x5c8e42['status'](_0x563ce3)['send'](_0x4f4268);};}exports[_0x316e('0x2c')]=function(_0x3ac31a,_0xe26c51){var _0x11b43d={},_0x273c42={},_0x13511b={'count':0x0,'rows':[]};var _0x3f87ef=_[_0x316e('0x2d')](db[_0x316e('0x2e')][_0x316e('0x2f')],function(_0x59b0be){return{'name':_0x59b0be[_0x316e('0x30')],'type':_0x59b0be[_0x316e('0x31')][_0x316e('0x32')]};});_0x273c42[_0x316e('0x33')]=_['map'](_0x3f87ef,_0x316e('0x2b'));_0x273c42[_0x316e('0x34')]=_['keys'](_0x3ac31a[_0x316e('0x34')]);_0x273c42[_0x316e('0x35')]=_[_0x316e('0x36')](_0x273c42[_0x316e('0x33')],_0x273c42[_0x316e('0x34')]);_0x11b43d['attributes']=_[_0x316e('0x36')](_0x273c42[_0x316e('0x33')],qs[_0x316e('0x37')](_0x3ac31a[_0x316e('0x34')][_0x316e('0x37')]));_0x11b43d[_0x316e('0x38')]=_0x11b43d[_0x316e('0x38')]['length']?_0x11b43d['attributes']:_0x273c42[_0x316e('0x33')];if(!_0x3ac31a[_0x316e('0x34')][_0x316e('0x39')](_0x316e('0x3a'))){_0x11b43d['limit']=qs['limit'](_0x3ac31a[_0x316e('0x34')][_0x316e('0x1e')]);_0x11b43d[_0x316e('0x21')]=qs[_0x316e('0x21')](_0x3ac31a[_0x316e('0x34')][_0x316e('0x21')]);}_0x11b43d[_0x316e('0x3b')]=qs['sort'](_0x3ac31a[_0x316e('0x34')][_0x316e('0x3c')]);_0x11b43d[_0x316e('0x3d')]=qs[_0x316e('0x35')](_[_0x316e('0x3e')](_0x3ac31a[_0x316e('0x34')],_0x273c42[_0x316e('0x35')]),_0x3f87ef);if(_0x3ac31a['query'][_0x316e('0x3f')]){_0x11b43d[_0x316e('0x3d')]=_[_0x316e('0x40')](_0x11b43d['where'],{'$or':_['map'](_0x3f87ef,function(_0xc106af){if(_0xc106af[_0x316e('0x31')]!=='VIRTUAL'){var _0x399c8f={};_0x399c8f[_0xc106af[_0x316e('0x2b')]]={'$like':'%'+_0x3ac31a[_0x316e('0x34')][_0x316e('0x3f')]+'%'};return _0x399c8f;}})});}_0x11b43d=_['merge']({},_0x11b43d,_0x3ac31a[_0x316e('0x41')]);var _0xc90f29={'where':_0x11b43d['where']};return db[_0x316e('0x2e')][_0x316e('0x20')](_0xc90f29)[_0x316e('0x28')](function(_0x43b494){_0x13511b[_0x316e('0x20')]=_0x43b494;if(_0x3ac31a['query'][_0x316e('0x42')]){_0x11b43d[_0x316e('0x43')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x316e('0x44')](_0x11b43d);})[_0x316e('0x28')](function(_0x3f646a){_0x13511b[_0x316e('0x45')]=_0x3f646a;return _0x13511b;})[_0x316e('0x28')](respondWithFilteredResult(_0xe26c51,_0x11b43d))[_0x316e('0x46')](handleError(_0xe26c51,null));};exports[_0x316e('0x47')]=function(_0x1cc814,_0x3232e2){var _0x555371={'raw':!![],'where':{'id':_0x1cc814[_0x316e('0x48')]['id']}},_0x13db38={};_0x13db38[_0x316e('0x33')]=_[_0x316e('0x49')](db[_0x316e('0x2e')][_0x316e('0x2f')]);_0x13db38[_0x316e('0x34')]=_[_0x316e('0x49')](_0x1cc814['query']);_0x13db38['filters']=_[_0x316e('0x36')](_0x13db38[_0x316e('0x33')],_0x13db38['query']);_0x555371['attributes']=_['intersection'](_0x13db38[_0x316e('0x33')],qs['fields'](_0x1cc814[_0x316e('0x34')][_0x316e('0x37')]));_0x555371['attributes']=_0x555371['attributes']['length']?_0x555371['attributes']:_0x13db38['model'];if(_0x1cc814['query'][_0x316e('0x42')]){_0x555371['include']=[{'all':!![]}];}_0x555371=_[_0x316e('0x40')]({},_0x555371,_0x1cc814[_0x316e('0x41')]);return db[_0x316e('0x2e')][_0x316e('0x4a')](_0x555371)[_0x316e('0x28')](handleEntityNotFound(_0x3232e2,null))['then'](respondWithResult(_0x3232e2,null))[_0x316e('0x46')](handleError(_0x3232e2,null));};exports[_0x316e('0x4b')]=function(_0x26337a,_0x130ade){return db[_0x316e('0x2e')][_0x316e('0x4b')](_0x26337a[_0x316e('0x4c')],{})[_0x316e('0x28')](respondWithResult(_0x130ade,0xc9))[_0x316e('0x46')](handleError(_0x130ade,null));};exports[_0x316e('0x27')]=function(_0x12a139,_0x305298){if(_0x12a139[_0x316e('0x4c')]['id']){delete _0x12a139['body']['id'];}return db[_0x316e('0x2e')][_0x316e('0x4a')]({'where':{'id':_0x12a139[_0x316e('0x48')]['id']}})[_0x316e('0x28')](handleEntityNotFound(_0x305298,null))[_0x316e('0x28')](saveUpdates(_0x12a139['body'],null))[_0x316e('0x28')](respondWithResult(_0x305298,null))[_0x316e('0x46')](handleError(_0x305298,null));};exports[_0x316e('0x29')]=function(_0x30e625,_0x1bdd95){return db[_0x316e('0x2e')]['find']({'where':{'id':_0x30e625['params']['id']}})[_0x316e('0x28')](handleEntityNotFound(_0x1bdd95,null))[_0x316e('0x28')](removeEntity(_0x1bdd95,null))[_0x316e('0x46')](handleError(_0x1bdd95,null));};exports['describe']=function(_0x4e51ac,_0x3b74f8){return db[_0x316e('0x2e')][_0x316e('0x4d')]()['then'](respondWithResult(_0x3b74f8,null))[_0x316e('0x46')](handleError(_0x3b74f8,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index cdac3cf..8656475 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x814b,0x1a2));var _0xb814=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0x814b[_0x57014b];return _0x2b258a;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x1d6b91,_0x570374){var _0x225e92=function(_0x509884){while(--_0x509884){_0x1d6b91['push'](_0x1d6b91['shift']());}};_0x225e92(++_0x570374);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0x5fc3[_0x5e8c32];return _0x595f7b;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index a23d82b..feeb7d7 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 _0x4fc2=['limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x4fc2,0x111));var _0x24fc=function(_0x4d95db,_0x28b7e9){_0x4d95db=_0x4d95db-0x0;var _0x1cc484=_0x4fc2[_0x4d95db];return _0x1cc484;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['CreateOpenchannelQueueReport']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['OpenchannelQueueReport'][_0x24fc('0x17')](_0x23873c[_0x24fc('0x18')],{'raw':_0x23873c[_0x24fc('0x19')]?_0x23873c['options'][_0x24fc('0x1a')]===undefined?!![]:![]:!![]})[_0x24fc('0xc')](function(_0xbf1d6b){logger[_0x24fc('0xd')]('CreateOpenchannelQueueReport',_0x23873c);logger[_0x24fc('0x10')]('CreateOpenchannelQueueReport',_0x23873c,JSON[_0x24fc('0x12')](_0xbf1d6b));_0x6cfa0a(_0xbf1d6b);})['catch'](function(_0x3ed464){logger[_0x24fc('0x13')](_0x24fc('0x1b'),_0x3ed464['message'],_0x23873c);_0x8ac114(_0x1cb3d0[_0x24fc('0x13')](0x1f4,_0x3ed464['message']));});});};exports[_0x24fc('0x1c')]=function(_0x2bb93a){var _0x36a9b4=this;return new Promise(function(_0x34b5b2,_0x3296fc){return db[_0x24fc('0x1d')][_0x24fc('0x1e')](_0x2bb93a[_0x24fc('0x18')],{'raw':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x1f')]||null:null,'attributes':_0x2bb93a['options']?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x20')]||null:null,'limit':_0x2bb93a[_0x24fc('0x19')]?_0x2bb93a[_0x24fc('0x19')][_0x24fc('0x21')]||null:null})[_0x24fc('0xc')](function(_0x5ac1f2){logger[_0x24fc('0xd')](_0x24fc('0x1c'),_0x2bb93a);logger[_0x24fc('0x10')](_0x24fc('0x1c'),_0x2bb93a,JSON[_0x24fc('0x12')](_0x5ac1f2));_0x34b5b2(_0x5ac1f2);})['catch'](function(_0x55c27f){logger['error'](_0x24fc('0x1c'),_0x55c27f['message'],_0x2bb93a);_0x3296fc(_0x36a9b4[_0x24fc('0x13')](0x1f4,_0x55c27f[_0x24fc('0x15')]));});});}; \ No newline at end of file +var _0x4bde=['jayson/promise','client','http','request','then','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','stringify','UpdateOpenchannelQueueReport','body','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x253563,_0x2a86ac){var _0x5d1ab7=function(_0x13e212){while(--_0x13e212){_0x253563['push'](_0x253563['shift']());}};_0x5d1ab7(++_0x2a86ac);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x55277f,_0x380974){_0x55277f=_0x55277f-0x0;var _0x161341=_0x4bde[_0x55277f];return _0x161341;};'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']('OpenchannelQueueReport,\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')]('OpenchannelQueueReport,\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')]));});});};exports[_0xe4bd('0x1d')]=function(_0x1e2abf){var _0x35d0ef=this;return new Promise(function(_0x4edd31,_0x1ab72b){return db[_0xe4bd('0x19')]['update'](_0x1e2abf[_0xe4bd('0x1e')],{'raw':_0x1e2abf[_0xe4bd('0x1a')]?_0x1e2abf[_0xe4bd('0x1a')][_0xe4bd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e2abf[_0xe4bd('0x1a')]?_0x1e2abf[_0xe4bd('0x1a')][_0xe4bd('0x1f')]||null:null,'attributes':_0x1e2abf[_0xe4bd('0x1a')]?_0x1e2abf['options'][_0xe4bd('0x20')]||null:null,'limit':_0x1e2abf[_0xe4bd('0x1a')]?_0x1e2abf[_0xe4bd('0x1a')][_0xe4bd('0x21')]||null:null})[_0xe4bd('0xd')](function(_0x17d143){logger[_0xe4bd('0x15')](_0xe4bd('0x1d'),_0x1e2abf);logger['debug'](_0xe4bd('0x1d'),_0x1e2abf,JSON[_0xe4bd('0x1c')](_0x17d143));_0x4edd31(_0x17d143);})[_0xe4bd('0x17')](function(_0xaad372){logger[_0xe4bd('0x11')](_0xe4bd('0x1d'),_0xaad372[_0xe4bd('0x14')],_0x1e2abf);_0x1ab72b(_0x35d0ef[_0xe4bd('0x11')](0x1f4,_0xaad372[_0xe4bd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index bbe998f..d51b6f4 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 _0xc9d8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','path'];(function(_0x2c07f3,_0x57d203){var _0x159db4=function(_0x9d3cff){while(--_0x9d3cff){_0x2c07f3['push'](_0x2c07f3['shift']());}};_0x159db4(++_0x57d203);}(_0xc9d8,0xda));var _0x8c9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9d8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8c9d('0x0'));var util=require('util');var path=require(_0x8c9d('0x1'));var timeout=require(_0x8c9d('0x2'));var express=require(_0x8c9d('0x3'));var router=express[_0x8c9d('0x4')]();var fs_extra=require(_0x8c9d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c9d('0x6'));var config=require('../../config/environment');var controller=require(_0x8c9d('0x7'));router[_0x8c9d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c9d('0x8')](_0x8c9d('0x9'),auth['isAuthenticated'](),controller[_0x8c9d('0xa')]);router[_0x8c9d('0x8')](_0x8c9d('0xb'),auth[_0x8c9d('0xc')](),controller[_0x8c9d('0xd')]);router['post']('/',auth[_0x8c9d('0xc')](),controller[_0x8c9d('0xe')]);router[_0x8c9d('0xf')](_0x8c9d('0xb'),auth['isAuthenticated'](),controller[_0x8c9d('0x10')]);router[_0x8c9d('0x11')]('/:id',auth[_0x8c9d('0xc')](),controller[_0x8c9d('0x12')]);module[_0x8c9d('0x13')]=router; \ No newline at end of file +var _0x39d4=['update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','show','put'];(function(_0x5a039f,_0x2c6ee6){var _0x304d1d=function(_0x43e9a0){while(--_0x43e9a0){_0x5a039f['push'](_0x5a039f['shift']());}};_0x304d1d(++_0x2c6ee6);}(_0x39d4,0x16b));var _0x439d=function(_0x1b0297,_0x3feb2d){_0x1b0297=_0x1b0297-0x0;var _0x1d1406=_0x39d4[_0x1b0297];return _0x1d1406;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x439d('0x0'));var timeout=require(_0x439d('0x1'));var express=require(_0x439d('0x2'));var router=express[_0x439d('0x3')]();var fs_extra=require(_0x439d('0x4'));var auth=require(_0x439d('0x5'));var interaction=require(_0x439d('0x6'));var config=require(_0x439d('0x7'));var controller=require(_0x439d('0x8'));router[_0x439d('0x9')]('/',auth[_0x439d('0xa')](),controller['index']);router[_0x439d('0x9')](_0x439d('0xb'),auth[_0x439d('0xa')](),controller['describe']);router['get'](_0x439d('0xc'),auth[_0x439d('0xa')](),controller[_0x439d('0xd')]);router['post']('/',auth[_0x439d('0xa')](),controller['create']);router[_0x439d('0xe')](_0x439d('0xc'),auth[_0x439d('0xa')](),controller[_0x439d('0xf')]);router['delete'](_0x439d('0xc'),auth['isAuthenticated'](),controller[_0x439d('0x10')]);module[_0x439d('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b33e937..971a935 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x465c0b,_0x157f99){var _0x321ae9=function(_0x24d8d0){while(--_0x24d8d0){_0x465c0b['push'](_0x465c0b['shift']());}};_0x321ae9(++_0x157f99);}(_0x00bb,0x1d8));var _0xb00b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x00bb[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x34966f,_0x4ac950){var _0x1fdc43=function(_0x23f804){while(--_0x23f804){_0x34966f['push'](_0x34966f['shift']());}};_0x1fdc43(++_0x4ac950);}(_0x00bb,0x1d8));var _0xb00b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x00bb[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ab9ddc9..b27cbc0 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 _0x219e=['util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xe8078,_0x4b46e8){var _0x4b0b22=function(_0x2d0d48){while(--_0x2d0d48){_0xe8078['push'](_0xe8078['shift']());}};_0x4b0b22(++_0x4b46e8);}(_0x219e,0x1ce));var _0xe219=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x219e[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe219('0x0'));var zipdir=require(_0xe219('0x1'));var jsonpatch=require(_0xe219('0x2'));var rp=require(_0xe219('0x3'));var moment=require(_0xe219('0x4'));var BPromise=require(_0xe219('0x5'));var Mustache=require('mustache');var util=require(_0xe219('0x6'));var path=require(_0xe219('0x7'));var sox=require(_0xe219('0x8'));var csv=require('to-csv');var ejs=require(_0xe219('0x9'));var fs=require('fs');var fs_extra=require(_0xe219('0xa'));var _=require('lodash');var squel=require(_0xe219('0xb'));var crypto=require(_0xe219('0xc'));var jsforce=require(_0xe219('0xd'));var deskjs=require(_0xe219('0xe'));var toCsv=require(_0xe219('0xf'));var querystring=require(_0xe219('0x10'));var Papa=require(_0xe219('0x11'));var Redis=require(_0xe219('0x12'));var authService=require(_0xe219('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe219('0x14'));var hardwareService=require(_0xe219('0x15'));var logger=require('../../config/logger')(_0xe219('0x16'));var utils=require(_0xe219('0x17'));var config=require(_0xe219('0x18'));var licenseUtil=require(_0xe219('0x19'));var db=require(_0xe219('0x1a'))['db'];function respondWithStatusCode(_0x100342,_0x5ce156){_0x5ce156=_0x5ce156||0xcc;return function(_0x2e34a5){if(_0x2e34a5){return _0x100342[_0xe219('0x1b')](_0x5ce156);}return _0x100342['status'](_0x5ce156)[_0xe219('0x1c')]();};}function respondWithResult(_0x2dcf88,_0x33616b){_0x33616b=_0x33616b||0xc8;return function(_0x2a5459){if(_0x2a5459){return _0x2dcf88['status'](_0x33616b)[_0xe219('0x1d')](_0x2a5459);}};}function respondWithFilteredResult(_0x2c80c5,_0x197c1a){return function(_0x53f562){if(_0x53f562){var _0x592ad1=typeof _0x197c1a[_0xe219('0x1e')]===_0xe219('0x1f')&&typeof _0x197c1a['limit']===_0xe219('0x1f');var _0x542dd7=_0x53f562['count'];var _0x8ecd76=_0x592ad1?0x0:_0x197c1a[_0xe219('0x1e')];var _0x2db963=_0x592ad1?_0x53f562['count']:_0x197c1a['offset']+_0x197c1a[_0xe219('0x20')];var _0x43e99b;if(_0x2db963>=_0x542dd7){_0x2db963=_0x542dd7;_0x43e99b=0xc8;}else{_0x43e99b=0xce;}_0x2c80c5[_0xe219('0x21')](_0x43e99b);return _0x2c80c5[_0xe219('0x22')](_0xe219('0x23'),_0x8ecd76+'-'+_0x2db963+'/'+_0x542dd7)[_0xe219('0x1d')](_0x53f562);}return null;};}function patchUpdates(_0x699865){return function(_0x29a13b){try{jsonpatch[_0xe219('0x24')](_0x29a13b,_0x699865,!![]);}catch(_0x2129b5){return BPromise[_0xe219('0x25')](_0x2129b5);}return _0x29a13b[_0xe219('0x26')]();};}function saveUpdates(_0xa7bb1f,_0x1defe2){return function(_0xcae062){if(_0xcae062){return _0xcae062[_0xe219('0x27')](_0xa7bb1f)[_0xe219('0x28')](function(_0x5661c8){return _0x5661c8;});}return null;};}function removeEntity(_0x358733,_0x413927){return function(_0x33ee9a){if(_0x33ee9a){return _0x33ee9a[_0xe219('0x29')]()[_0xe219('0x28')](function(){_0x358733['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39821c,_0x4ef26d){return function(_0x7581dc){if(!_0x7581dc){_0x39821c['sendStatus'](0x194);}return _0x7581dc;};}function handleError(_0x1b8a00,_0x526620){_0x526620=_0x526620||0x1f4;return function(_0x9937d){logger[_0xe219('0x2a')](_0x9937d[_0xe219('0x2b')]);if(_0x9937d[_0xe219('0x2c')]){delete _0x9937d[_0xe219('0x2c')];}_0x1b8a00[_0xe219('0x21')](_0x526620)['send'](_0x9937d);};}exports['index']=function(_0x1aeb01,_0x33d063){var _0x44dfd5={},_0x4d10f6={},_0x5ea76b={'count':0x0,'rows':[]};var _0x4f99bc=_[_0xe219('0x2d')](db[_0xe219('0x2e')][_0xe219('0x2f')],function(_0x187c74){return{'name':_0x187c74[_0xe219('0x30')],'type':_0x187c74[_0xe219('0x31')][_0xe219('0x32')]};});_0x4d10f6[_0xe219('0x33')]=_[_0xe219('0x2d')](_0x4f99bc,_0xe219('0x2c'));_0x4d10f6[_0xe219('0x34')]=_[_0xe219('0x35')](_0x1aeb01[_0xe219('0x34')]);_0x4d10f6['filters']=_[_0xe219('0x36')](_0x4d10f6[_0xe219('0x33')],_0x4d10f6[_0xe219('0x34')]);_0x44dfd5[_0xe219('0x37')]=_['intersection'](_0x4d10f6[_0xe219('0x33')],qs[_0xe219('0x38')](_0x1aeb01['query'][_0xe219('0x38')]));_0x44dfd5[_0xe219('0x37')]=_0x44dfd5['attributes'][_0xe219('0x39')]?_0x44dfd5[_0xe219('0x37')]:_0x4d10f6['model'];if(!_0x1aeb01[_0xe219('0x34')][_0xe219('0x3a')]('nolimit')){_0x44dfd5[_0xe219('0x20')]=qs[_0xe219('0x20')](_0x1aeb01[_0xe219('0x34')][_0xe219('0x20')]);_0x44dfd5[_0xe219('0x1e')]=qs[_0xe219('0x1e')](_0x1aeb01['query'][_0xe219('0x1e')]);}_0x44dfd5[_0xe219('0x3b')]=qs[_0xe219('0x3c')](_0x1aeb01[_0xe219('0x34')]['sort']);_0x44dfd5[_0xe219('0x3d')]=qs[_0xe219('0x3e')](_['pick'](_0x1aeb01[_0xe219('0x34')],_0x4d10f6['filters']),_0x4f99bc);if(_0x1aeb01[_0xe219('0x34')][_0xe219('0x3f')]){_0x44dfd5['where']=_[_0xe219('0x40')](_0x44dfd5[_0xe219('0x3d')],{'$or':_[_0xe219('0x2d')](_0x4f99bc,function(_0x421dfe){if(_0x421dfe[_0xe219('0x31')]!=='VIRTUAL'){var _0x44c410={};_0x44c410[_0x421dfe[_0xe219('0x2c')]]={'$like':'%'+_0x1aeb01[_0xe219('0x34')][_0xe219('0x3f')]+'%'};return _0x44c410;}})});}_0x44dfd5=_['merge']({},_0x44dfd5,_0x1aeb01[_0xe219('0x41')]);var _0x2d8984={'where':_0x44dfd5[_0xe219('0x3d')]};return db[_0xe219('0x2e')][_0xe219('0x42')](_0x2d8984)[_0xe219('0x28')](function(_0x1072a6){_0x5ea76b[_0xe219('0x42')]=_0x1072a6;if(_0x1aeb01[_0xe219('0x34')][_0xe219('0x43')]){_0x44dfd5['include']=[{'all':!![]}];}return db[_0xe219('0x2e')][_0xe219('0x44')](_0x44dfd5);})[_0xe219('0x28')](function(_0x4fd72f){_0x5ea76b[_0xe219('0x45')]=_0x4fd72f;return _0x5ea76b;})['then'](respondWithFilteredResult(_0x33d063,_0x44dfd5))[_0xe219('0x46')](handleError(_0x33d063,null));};exports[_0xe219('0x47')]=function(_0x2c1297,_0x4ce55e){var _0x2af4be={'raw':!![],'where':{'id':_0x2c1297['params']['id']}},_0x1bb70c={};_0x1bb70c['model']=_[_0xe219('0x35')](db['OpenchannelTransferReport']['rawAttributes']);_0x1bb70c[_0xe219('0x34')]=_[_0xe219('0x35')](_0x2c1297[_0xe219('0x34')]);_0x1bb70c[_0xe219('0x3e')]=_[_0xe219('0x36')](_0x1bb70c[_0xe219('0x33')],_0x1bb70c[_0xe219('0x34')]);_0x2af4be[_0xe219('0x37')]=_['intersection'](_0x1bb70c[_0xe219('0x33')],qs[_0xe219('0x38')](_0x2c1297[_0xe219('0x34')][_0xe219('0x38')]));_0x2af4be[_0xe219('0x37')]=_0x2af4be[_0xe219('0x37')][_0xe219('0x39')]?_0x2af4be[_0xe219('0x37')]:_0x1bb70c['model'];if(_0x2c1297[_0xe219('0x34')]['includeAll']){_0x2af4be[_0xe219('0x48')]=[{'all':!![]}];}_0x2af4be=_['merge']({},_0x2af4be,_0x2c1297['options']);return db['OpenchannelTransferReport'][_0xe219('0x49')](_0x2af4be)['then'](handleEntityNotFound(_0x4ce55e,null))['then'](respondWithResult(_0x4ce55e,null))[_0xe219('0x46')](handleError(_0x4ce55e,null));};exports['create']=function(_0x4facba,_0x775e6a){return db[_0xe219('0x2e')][_0xe219('0x4a')](_0x4facba[_0xe219('0x4b')],{})[_0xe219('0x28')](respondWithResult(_0x775e6a,0xc9))[_0xe219('0x46')](handleError(_0x775e6a,null));};exports[_0xe219('0x27')]=function(_0x27fef8,_0x14ed83){if(_0x27fef8[_0xe219('0x4b')]['id']){delete _0x27fef8['body']['id'];}return db[_0xe219('0x2e')]['find']({'where':{'id':_0x27fef8[_0xe219('0x4c')]['id']}})[_0xe219('0x28')](handleEntityNotFound(_0x14ed83,null))[_0xe219('0x28')](saveUpdates(_0x27fef8[_0xe219('0x4b')],null))[_0xe219('0x28')](respondWithResult(_0x14ed83,null))[_0xe219('0x46')](handleError(_0x14ed83,null));};exports[_0xe219('0x29')]=function(_0x5b49fe,_0x43476e){return db[_0xe219('0x2e')][_0xe219('0x49')]({'where':{'id':_0x5b49fe[_0xe219('0x4c')]['id']}})[_0xe219('0x28')](handleEntityNotFound(_0x43476e,null))[_0xe219('0x28')](removeEntity(_0x43476e,null))[_0xe219('0x46')](handleError(_0x43476e,null));};exports[_0xe219('0x4d')]=function(_0x547bab,_0xfd0393){return db['OpenchannelTransferReport']['describe']()[_0xe219('0x28')](respondWithResult(_0xfd0393,null))[_0xe219('0x46')](handleError(_0xfd0393,null));}; \ No newline at end of file +var _0xcdbd=['type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','save','then','destroy','error','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xcdbd,0x15d));var _0xdcdb=function(_0x3bf173,_0x33551d){_0x3bf173=_0x3bf173-0x0;var _0xfbde49=_0xcdbd[_0x3bf173];return _0xfbde49;};'use strict';var emlformat=require(_0xdcdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcdb('0x1'));var jsonpatch=require(_0xdcdb('0x2'));var rp=require(_0xdcdb('0x3'));var moment=require(_0xdcdb('0x4'));var BPromise=require(_0xdcdb('0x5'));var Mustache=require('mustache');var util=require(_0xdcdb('0x6'));var path=require(_0xdcdb('0x7'));var sox=require(_0xdcdb('0x8'));var csv=require(_0xdcdb('0x9'));var ejs=require(_0xdcdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdcdb('0xb'));var _=require(_0xdcdb('0xc'));var squel=require('squel');var crypto=require(_0xdcdb('0xd'));var jsforce=require(_0xdcdb('0xe'));var deskjs=require(_0xdcdb('0xf'));var toCsv=require(_0xdcdb('0x9'));var querystring=require(_0xdcdb('0x10'));var Papa=require(_0xdcdb('0x11'));var Redis=require(_0xdcdb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdcdb('0x13'));var as=require(_0xdcdb('0x14'));var hardwareService=require(_0xdcdb('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xdcdb('0x16'));var config=require(_0xdcdb('0x17'));var licenseUtil=require(_0xdcdb('0x18'));var db=require(_0xdcdb('0x19'))['db'];function respondWithStatusCode(_0x3004c5,_0xb5532a){_0xb5532a=_0xb5532a||0xcc;return function(_0xe72396){if(_0xe72396){return _0x3004c5[_0xdcdb('0x1a')](_0xb5532a);}return _0x3004c5['status'](_0xb5532a)[_0xdcdb('0x1b')]();};}function respondWithResult(_0x18eae4,_0x57ca12){_0x57ca12=_0x57ca12||0xc8;return function(_0x15e9dd){if(_0x15e9dd){return _0x18eae4[_0xdcdb('0x1c')](_0x57ca12)[_0xdcdb('0x1d')](_0x15e9dd);}};}function respondWithFilteredResult(_0x2942e1,_0x164afe){return function(_0x2d1835){if(_0x2d1835){var _0x3d0874=typeof _0x164afe['offset']===_0xdcdb('0x1e')&&typeof _0x164afe[_0xdcdb('0x1f')]===_0xdcdb('0x1e');var _0x566720=_0x2d1835['count'];var _0x35ceae=_0x3d0874?0x0:_0x164afe[_0xdcdb('0x20')];var _0x2cb73a=_0x3d0874?_0x2d1835[_0xdcdb('0x21')]:_0x164afe['offset']+_0x164afe[_0xdcdb('0x1f')];var _0x29f793;if(_0x2cb73a>=_0x566720){_0x2cb73a=_0x566720;_0x29f793=0xc8;}else{_0x29f793=0xce;}_0x2942e1[_0xdcdb('0x1c')](_0x29f793);return _0x2942e1['set'](_0xdcdb('0x22'),_0x35ceae+'-'+_0x2cb73a+'/'+_0x566720)['json'](_0x2d1835);}return null;};}function patchUpdates(_0x13b209){return function(_0x3edcc8){try{jsonpatch[_0xdcdb('0x23')](_0x3edcc8,_0x13b209,!![]);}catch(_0x1926da){return BPromise['reject'](_0x1926da);}return _0x3edcc8[_0xdcdb('0x24')]();};}function saveUpdates(_0x135b73,_0xd179d){return function(_0x13e7af){if(_0x13e7af){return _0x13e7af['update'](_0x135b73)[_0xdcdb('0x25')](function(_0x4a0534){return _0x4a0534;});}return null;};}function removeEntity(_0x3b5043,_0x47ff1a){return function(_0x169d43){if(_0x169d43){return _0x169d43[_0xdcdb('0x26')]()[_0xdcdb('0x25')](function(){_0x3b5043[_0xdcdb('0x1c')](0xcc)[_0xdcdb('0x1b')]();});}};}function handleEntityNotFound(_0x3ab69a,_0x483e6f){return function(_0x2dc22b){if(!_0x2dc22b){_0x3ab69a[_0xdcdb('0x1a')](0x194);}return _0x2dc22b;};}function handleError(_0x5a7d06,_0x4a52f6){_0x4a52f6=_0x4a52f6||0x1f4;return function(_0xac6f7e){logger[_0xdcdb('0x27')](_0xac6f7e['stack']);if(_0xac6f7e[_0xdcdb('0x28')]){delete _0xac6f7e[_0xdcdb('0x28')];}_0x5a7d06[_0xdcdb('0x1c')](_0x4a52f6)[_0xdcdb('0x29')](_0xac6f7e);};}exports[_0xdcdb('0x2a')]=function(_0x1c1d61,_0x3b5396){var _0x172759={},_0x33e8f5={},_0x192ad5={'count':0x0,'rows':[]};var _0x5ba9d3=_['map'](db[_0xdcdb('0x2b')][_0xdcdb('0x2c')],function(_0x80ead6){return{'name':_0x80ead6[_0xdcdb('0x2d')],'type':_0x80ead6[_0xdcdb('0x2e')][_0xdcdb('0x2f')]};});_0x33e8f5[_0xdcdb('0x30')]=_[_0xdcdb('0x31')](_0x5ba9d3,'name');_0x33e8f5[_0xdcdb('0x32')]=_[_0xdcdb('0x33')](_0x1c1d61[_0xdcdb('0x32')]);_0x33e8f5['filters']=_[_0xdcdb('0x34')](_0x33e8f5['model'],_0x33e8f5['query']);_0x172759[_0xdcdb('0x35')]=_[_0xdcdb('0x34')](_0x33e8f5['model'],qs[_0xdcdb('0x36')](_0x1c1d61[_0xdcdb('0x32')][_0xdcdb('0x36')]));_0x172759[_0xdcdb('0x35')]=_0x172759[_0xdcdb('0x35')][_0xdcdb('0x37')]?_0x172759[_0xdcdb('0x35')]:_0x33e8f5[_0xdcdb('0x30')];if(!_0x1c1d61[_0xdcdb('0x32')][_0xdcdb('0x38')](_0xdcdb('0x39'))){_0x172759[_0xdcdb('0x1f')]=qs[_0xdcdb('0x1f')](_0x1c1d61[_0xdcdb('0x32')][_0xdcdb('0x1f')]);_0x172759[_0xdcdb('0x20')]=qs[_0xdcdb('0x20')](_0x1c1d61[_0xdcdb('0x32')]['offset']);}_0x172759[_0xdcdb('0x3a')]=qs[_0xdcdb('0x3b')](_0x1c1d61[_0xdcdb('0x32')]['sort']);_0x172759[_0xdcdb('0x3c')]=qs[_0xdcdb('0x3d')](_[_0xdcdb('0x3e')](_0x1c1d61['query'],_0x33e8f5[_0xdcdb('0x3d')]),_0x5ba9d3);if(_0x1c1d61[_0xdcdb('0x32')]['filter']){_0x172759['where']=_['merge'](_0x172759[_0xdcdb('0x3c')],{'$or':_[_0xdcdb('0x31')](_0x5ba9d3,function(_0x571973){if(_0x571973[_0xdcdb('0x2e')]!==_0xdcdb('0x3f')){var _0x2b6a4a={};_0x2b6a4a[_0x571973['name']]={'$like':'%'+_0x1c1d61[_0xdcdb('0x32')][_0xdcdb('0x40')]+'%'};return _0x2b6a4a;}})});}_0x172759=_[_0xdcdb('0x41')]({},_0x172759,_0x1c1d61[_0xdcdb('0x42')]);var _0xbe9373={'where':_0x172759[_0xdcdb('0x3c')]};return db[_0xdcdb('0x2b')][_0xdcdb('0x21')](_0xbe9373)[_0xdcdb('0x25')](function(_0x28c9f3){_0x192ad5[_0xdcdb('0x21')]=_0x28c9f3;if(_0x1c1d61[_0xdcdb('0x32')]['includeAll']){_0x172759['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xdcdb('0x43')](_0x172759);})[_0xdcdb('0x25')](function(_0x4bbeb3){_0x192ad5[_0xdcdb('0x44')]=_0x4bbeb3;return _0x192ad5;})[_0xdcdb('0x25')](respondWithFilteredResult(_0x3b5396,_0x172759))[_0xdcdb('0x45')](handleError(_0x3b5396,null));};exports[_0xdcdb('0x46')]=function(_0x4c91b9,_0x5198f2){var _0x16098f={'raw':!![],'where':{'id':_0x4c91b9[_0xdcdb('0x47')]['id']}},_0x11e582={};_0x11e582[_0xdcdb('0x30')]=_['keys'](db[_0xdcdb('0x2b')][_0xdcdb('0x2c')]);_0x11e582[_0xdcdb('0x32')]=_[_0xdcdb('0x33')](_0x4c91b9[_0xdcdb('0x32')]);_0x11e582[_0xdcdb('0x3d')]=_[_0xdcdb('0x34')](_0x11e582[_0xdcdb('0x30')],_0x11e582['query']);_0x16098f[_0xdcdb('0x35')]=_[_0xdcdb('0x34')](_0x11e582['model'],qs['fields'](_0x4c91b9[_0xdcdb('0x32')]['fields']));_0x16098f[_0xdcdb('0x35')]=_0x16098f[_0xdcdb('0x35')][_0xdcdb('0x37')]?_0x16098f['attributes']:_0x11e582[_0xdcdb('0x30')];if(_0x4c91b9[_0xdcdb('0x32')][_0xdcdb('0x48')]){_0x16098f[_0xdcdb('0x49')]=[{'all':!![]}];}_0x16098f=_[_0xdcdb('0x41')]({},_0x16098f,_0x4c91b9[_0xdcdb('0x42')]);return db[_0xdcdb('0x2b')][_0xdcdb('0x4a')](_0x16098f)['then'](handleEntityNotFound(_0x5198f2,null))[_0xdcdb('0x25')](respondWithResult(_0x5198f2,null))[_0xdcdb('0x45')](handleError(_0x5198f2,null));};exports[_0xdcdb('0x4b')]=function(_0x4e4e33,_0x5d6d38){return db[_0xdcdb('0x2b')]['create'](_0x4e4e33[_0xdcdb('0x4c')],{})[_0xdcdb('0x25')](respondWithResult(_0x5d6d38,0xc9))[_0xdcdb('0x45')](handleError(_0x5d6d38,null));};exports[_0xdcdb('0x4d')]=function(_0x1fe27d,_0x14f00a){if(_0x1fe27d[_0xdcdb('0x4c')]['id']){delete _0x1fe27d[_0xdcdb('0x4c')]['id'];}return db[_0xdcdb('0x2b')][_0xdcdb('0x4a')]({'where':{'id':_0x1fe27d[_0xdcdb('0x47')]['id']}})[_0xdcdb('0x25')](handleEntityNotFound(_0x14f00a,null))['then'](saveUpdates(_0x1fe27d[_0xdcdb('0x4c')],null))[_0xdcdb('0x25')](respondWithResult(_0x14f00a,null))[_0xdcdb('0x45')](handleError(_0x14f00a,null));};exports[_0xdcdb('0x26')]=function(_0x6ecbc2,_0x1322de){return db[_0xdcdb('0x2b')][_0xdcdb('0x4a')]({'where':{'id':_0x6ecbc2[_0xdcdb('0x47')]['id']}})[_0xdcdb('0x25')](handleEntityNotFound(_0x1322de,null))[_0xdcdb('0x25')](removeEntity(_0x1322de,null))[_0xdcdb('0x45')](handleError(_0x1322de,null));};exports[_0xdcdb('0x4e')]=function(_0x276253,_0xf5d5bd){return db['OpenchannelTransferReport'][_0xdcdb('0x4e')]()[_0xdcdb('0x25')](respondWithResult(_0xf5d5bd,null))[_0xdcdb('0x45')](handleError(_0xf5d5bd,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 836a396..bb85842 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 _0xac26=['moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0xaf52f9,_0x3608bc){var _0xd9e03e=function(_0xaf82d3){while(--_0xaf82d3){_0xaf52f9['push'](_0xaf52f9['shift']());}};_0xd9e03e(++_0x3608bc);}(_0xac26,0x100));var _0x6ac2=function(_0x2c8546,_0xe13fa2){_0x2c8546=_0x2c8546-0x0;var _0x2a4016=_0xac26[_0x2c8546];return _0x2a4016;};'use strict';var _=require(_0x6ac2('0x0'));var util=require(_0x6ac2('0x1'));var logger=require(_0x6ac2('0x2'))(_0x6ac2('0x3'));var moment=require(_0x6ac2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ac2('0x5'));var rimraf=require(_0x6ac2('0x6'));var config=require(_0x6ac2('0x7'));var attributes=require(_0x6ac2('0x8'));module[_0x6ac2('0x9')]=function(_0x5dffa1,_0x5d4e82){return _0x5dffa1[_0x6ac2('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x6ac2('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6ac2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf0e=['report_openchannel_transfer','uniqueid','lodash','util','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xcf0e,0x1f1));var _0xecf0=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xcf0e[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xecf0('0x0'));var util=require(_0xecf0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xecf0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecf0('0x3'));var rimraf=require(_0xecf0('0x4'));var config=require(_0xecf0('0x5'));var attributes=require(_0xecf0('0x6'));module['exports']=function(_0x4d5883,_0x92369c){return _0x4d5883[_0xecf0('0x7')](_0xecf0('0x8'),attributes,{'tableName':_0xecf0('0x9'),'paranoid':![],'indexes':[{'name':_0xecf0('0xa'),'fields':[_0xecf0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 0da3013..ffdefa2 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 _0x8c32=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0xcaafa8,_0x14297c){var _0xd65de0=function(_0x4dc550){while(--_0x4dc550){_0xcaafa8['push'](_0xcaafa8['shift']());}};_0xd65de0(++_0x14297c);}(_0x8c32,0x130));var _0x28c3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8c32[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var moment=require(_0x28c3('0x2'));var BPromise=require(_0x28c3('0x3'));var rs=require(_0x28c3('0x4'));var fs=require('fs');var Redis=require(_0x28c3('0x5'));var db=require(_0x28c3('0x6'))['db'];var utils=require(_0x28c3('0x7'));var logger=require(_0x28c3('0x8'))(_0x28c3('0x9'));var config=require(_0x28c3('0xa'));var jayson=require(_0x28c3('0xb'));var client=jayson['client'][_0x28c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ed515,_0x2ce6c1,_0x482952){return new BPromise(function(_0xbaee6f,_0x2fb4cb){return client['request'](_0x4ed515,_0x482952)[_0x28c3('0xd')](function(_0x37bda3){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2ce6c1,'request\x20sent');logger[_0x28c3('0xe')](_0x28c3('0xf'),_0x2ce6c1,'request\x20sent',JSON[_0x28c3('0x10')](_0x37bda3));if(_0x37bda3[_0x28c3('0x11')]){if(_0x37bda3[_0x28c3('0x11')]['code']===0x1f4){logger[_0x28c3('0x11')](_0x28c3('0x12'),_0x2ce6c1,_0x37bda3[_0x28c3('0x11')][_0x28c3('0x13')]);return _0x2fb4cb(_0x37bda3[_0x28c3('0x11')]['message']);}logger[_0x28c3('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2ce6c1,_0x37bda3[_0x28c3('0x11')]['message']);return _0xbaee6f(_0x37bda3[_0x28c3('0x11')]['message']);}else{logger[_0x28c3('0x14')](_0x28c3('0x12'),_0x2ce6c1,'request\x20sent');_0xbaee6f(_0x37bda3[_0x28c3('0x15')]['message']);}})['catch'](function(_0x58e2b9){logger[_0x28c3('0x11')](_0x28c3('0x12'),_0x2ce6c1,_0x58e2b9);_0x2fb4cb(_0x58e2b9);});});} \ No newline at end of file +var _0xd6d2=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x57af3d,_0xc153fd){_0x57af3d=_0x57af3d-0x0;var _0x39887d=_0xd6d2[_0x57af3d];return _0x39887d;};'use strict';var _=require(_0x2d6d('0x0'));var util=require(_0x2d6d('0x1'));var moment=require('moment');var BPromise=require(_0x2d6d('0x2'));var rs=require(_0x2d6d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d6d('0x5'))(_0x2d6d('0x6'));var config=require(_0x2d6d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2d6d('0x8')][_0x2d6d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf59b20,_0x45b7b9,_0x4002b7){return new BPromise(function(_0x42d802,_0x1cab9b){return client[_0x2d6d('0xa')](_0xf59b20,_0x4002b7)[_0x2d6d('0xb')](function(_0x261959){logger[_0x2d6d('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x45b7b9,_0x2d6d('0xd'));logger[_0x2d6d('0xe')](_0x2d6d('0xf'),_0x45b7b9,_0x2d6d('0xd'),JSON[_0x2d6d('0x10')](_0x261959));if(_0x261959['error']){if(_0x261959[_0x2d6d('0x11')][_0x2d6d('0x12')]===0x1f4){logger[_0x2d6d('0x11')](_0x2d6d('0x13'),_0x45b7b9,_0x261959[_0x2d6d('0x11')]['message']);return _0x1cab9b(_0x261959[_0x2d6d('0x11')][_0x2d6d('0x14')]);}logger[_0x2d6d('0x11')](_0x2d6d('0x13'),_0x45b7b9,_0x261959['error'][_0x2d6d('0x14')]);return _0x42d802(_0x261959[_0x2d6d('0x11')]['message']);}else{logger['info'](_0x2d6d('0x13'),_0x45b7b9,_0x2d6d('0xd'));_0x42d802(_0x261959[_0x2d6d('0x15')]['message']);}})[_0x2d6d('0x16')](function(_0x5b8d81){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x45b7b9,_0x5b8d81);_0x1cab9b(_0x5b8d81);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index cc09643..867a2b5 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 _0x686d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x686d,0x115));var _0xd686=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x686d[_0xcd0918];return _0x250704;};'use strict';var multer=require(_0xd686('0x0'));var util=require(_0xd686('0x1'));var path=require(_0xd686('0x2'));var timeout=require(_0xd686('0x3'));var express=require('express');var router=express[_0xd686('0x4')]();var fs_extra=require(_0xd686('0x5'));var auth=require(_0xd686('0x6'));var interaction=require(_0xd686('0x7'));var config=require(_0xd686('0x8'));var controller=require(_0xd686('0x9'));router[_0xd686('0xa')]('/',auth[_0xd686('0xb')](),controller[_0xd686('0xc')]);router['get'](_0xd686('0xd'),auth[_0xd686('0xb')](),controller[_0xd686('0xe')]);router[_0xd686('0xf')]('/',auth[_0xd686('0xb')](),controller[_0xd686('0x10')]);router[_0xd686('0x11')](_0xd686('0xd'),auth[_0xd686('0xb')](),controller[_0xd686('0x12')]);router['delete']('/:id',auth[_0xd686('0xb')](),controller['destroy']);module[_0xd686('0x13')]=router; \ No newline at end of file +var _0x99cd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x99cd,0x1df));var _0xd99c=function(_0x31079b,_0x1f3f90){_0x31079b=_0x31079b-0x0;var _0x38bc02=_0x99cd[_0x31079b];return _0x38bc02;};'use strict';var multer=require(_0xd99c('0x0'));var util=require('util');var path=require(_0xd99c('0x1'));var timeout=require(_0xd99c('0x2'));var express=require(_0xd99c('0x3'));var router=express[_0xd99c('0x4')]();var fs_extra=require(_0xd99c('0x5'));var auth=require(_0xd99c('0x6'));var interaction=require(_0xd99c('0x7'));var config=require(_0xd99c('0x8'));var controller=require(_0xd99c('0x9'));router[_0xd99c('0xa')]('/',auth['isAuthenticated'](),controller[_0xd99c('0xb')]);router['get'](_0xd99c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd99c('0xd')]('/',auth[_0xd99c('0xe')](),controller[_0xd99c('0xf')]);router[_0xd99c('0x10')](_0xd99c('0xc'),auth[_0xd99c('0xe')](),controller[_0xd99c('0x11')]);router[_0xd99c('0x12')](_0xd99c('0xc'),auth[_0xd99c('0xe')](),controller[_0xd99c('0x13')]);module[_0xd99c('0x14')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index c4a5356..f987c30 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 _0x1d46=['sequelize','exports','STRING'];(function(_0x3212c7,_0x3eb2b5){var _0x125f7=function(_0x27675a){while(--_0x27675a){_0x3212c7['push'](_0x3212c7['shift']());}};_0x125f7(++_0x3eb2b5);}(_0x1d46,0xa8));var _0x61d4=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0x1d46[_0x3a07c1];return _0x2bbe15;};'use strict';var Sequelize=require(_0x61d4('0x0'));module[_0x61d4('0x1')]={'name':{'type':Sequelize[_0x61d4('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9029=['exports','STRING','name'];(function(_0x5de669,_0x2d3f28){var _0x2fc372=function(_0x3bbc68){while(--_0x3bbc68){_0x5de669['push'](_0x5de669['shift']());}};_0x2fc372(++_0x2d3f28);}(_0x9029,0x117));var _0x9902=function(_0x2af780,_0x26256c){_0x2af780=_0x2af780-0x0;var _0x6cabf4=_0x9029[_0x2af780];return _0x6cabf4;};'use strict';var Sequelize=require('sequelize');module[_0x9902('0x0')]={'name':{'type':Sequelize[_0x9902('0x1')],'unique':_0x9902('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9902('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 4cbbfeb..78d251d 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 _0x98a5=['VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','role','user','UserProfileSection','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','fs-extra','lodash','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','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','index','Pause','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','map'];(function(_0x3d30e3,_0x3f2c79){var _0x3b209a=function(_0x495aa5){while(--_0x495aa5){_0x3d30e3['push'](_0x3d30e3['shift']());}};_0x3b209a(++_0x3f2c79);}(_0x98a5,0x1d1));var _0x598a=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x98a5[_0x545bed];return _0x16c79c;};'use strict';var emlformat=require(_0x598a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x598a('0x1'));var jsonpatch=require(_0x598a('0x2'));var rp=require(_0x598a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x598a('0x4'));var path=require(_0x598a('0x5'));var sox=require(_0x598a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x598a('0x7'));var _=require(_0x598a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x598a('0x9'));var deskjs=require(_0x598a('0xa'));var toCsv=require(_0x598a('0xb'));var querystring=require(_0x598a('0xc'));var Papa=require('papaparse');var Redis=require(_0x598a('0xd'));var authService=require(_0x598a('0xe'));var qs=require(_0x598a('0xf'));var as=require(_0x598a('0x10'));var hardwareService=require(_0x598a('0x11'));var logger=require(_0x598a('0x12'))(_0x598a('0x13'));var utils=require('../../config/utils');var config=require(_0x598a('0x14'));var licenseUtil=require(_0x598a('0x15'));var db=require(_0x598a('0x16'))['db'];function respondWithStatusCode(_0x4425c1,_0x5b63f1){_0x5b63f1=_0x5b63f1||0xcc;return function(_0x2eaa42){if(_0x2eaa42){return _0x4425c1['sendStatus'](_0x5b63f1);}return _0x4425c1[_0x598a('0x17')](_0x5b63f1)[_0x598a('0x18')]();};}function respondWithResult(_0xbd5765,_0x282fbf){_0x282fbf=_0x282fbf||0xc8;return function(_0xedcebf){if(_0xedcebf){return _0xbd5765['status'](_0x282fbf)[_0x598a('0x19')](_0xedcebf);}};}function respondWithFilteredResult(_0x2f2c8c,_0x339626){return function(_0x5edee4){if(_0x5edee4){var _0x1ac5db=typeof _0x339626['offset']==='undefined'&&typeof _0x339626[_0x598a('0x1a')]==='undefined';var _0x5aacd8=_0x5edee4[_0x598a('0x1b')];var _0x4e3918=_0x1ac5db?0x0:_0x339626[_0x598a('0x1c')];var _0x30c420=_0x1ac5db?_0x5edee4[_0x598a('0x1b')]:_0x339626[_0x598a('0x1c')]+_0x339626[_0x598a('0x1a')];var _0x527e3c;if(_0x30c420>=_0x5aacd8){_0x30c420=_0x5aacd8;_0x527e3c=0xc8;}else{_0x527e3c=0xce;}_0x2f2c8c[_0x598a('0x17')](_0x527e3c);return _0x2f2c8c[_0x598a('0x1d')](_0x598a('0x1e'),_0x4e3918+'-'+_0x30c420+'/'+_0x5aacd8)[_0x598a('0x19')](_0x5edee4);}return null;};}function patchUpdates(_0x38c6d6){return function(_0x1408d8){try{jsonpatch[_0x598a('0x1f')](_0x1408d8,_0x38c6d6,!![]);}catch(_0x55132b){return BPromise['reject'](_0x55132b);}return _0x1408d8['save']();};}function saveUpdates(_0x4dccaf,_0x2308ee){return function(_0xf07a0f){if(_0xf07a0f){return _0xf07a0f[_0x598a('0x20')](_0x4dccaf)[_0x598a('0x21')](function(_0x334c4e){return _0x334c4e;});}return null;};}function removeEntity(_0x20b7e0,_0x2d49e6){return function(_0x1a6a8c){if(_0x1a6a8c){return _0x1a6a8c[_0x598a('0x22')]()[_0x598a('0x21')](function(){var _0x2e1021=_0x1a6a8c[_0x598a('0x23')]({'plain':!![]});var _0x1a21cd=_0x598a('0x24');return db[_0x598a('0x25')][_0x598a('0x22')]({'where':{'type':_0x1a21cd,'resourceId':_0x2e1021['id']}})[_0x598a('0x21')](function(){return _0x1a6a8c;});})[_0x598a('0x21')](function(){_0x20b7e0[_0x598a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ab9c,_0x5c2a4e){return function(_0x33b37f){if(!_0x33b37f){_0x12ab9c['sendStatus'](0x194);}return _0x33b37f;};}function handleError(_0x2bfb17,_0x48480b){_0x48480b=_0x48480b||0x1f4;return function(_0x4483c8){logger[_0x598a('0x26')](_0x4483c8[_0x598a('0x27')]);if(_0x4483c8['name']){delete _0x4483c8[_0x598a('0x28')];}_0x2bfb17[_0x598a('0x17')](_0x48480b)['send'](_0x4483c8);};}exports[_0x598a('0x29')]=function(_0x4e6cb1,_0x4733cd){var _0x14d79b={},_0x4d3b3a={},_0x57329a={'count':0x0,'rows':[]};var _0x227040=_['map'](db[_0x598a('0x2a')][_0x598a('0x2b')],function(_0x54dd22){return{'name':_0x54dd22['fieldName'],'type':_0x54dd22['type'][_0x598a('0x2c')]};});_0x4d3b3a['model']=_['map'](_0x227040,_0x598a('0x28'));_0x4d3b3a[_0x598a('0x2d')]=_[_0x598a('0x2e')](_0x4e6cb1[_0x598a('0x2d')]);_0x4d3b3a[_0x598a('0x2f')]=_[_0x598a('0x30')](_0x4d3b3a[_0x598a('0x31')],_0x4d3b3a[_0x598a('0x2d')]);_0x14d79b['attributes']=_['intersection'](_0x4d3b3a[_0x598a('0x31')],qs[_0x598a('0x32')](_0x4e6cb1[_0x598a('0x2d')]['fields']));_0x14d79b[_0x598a('0x33')]=_0x14d79b[_0x598a('0x33')][_0x598a('0x34')]?_0x14d79b[_0x598a('0x33')]:_0x4d3b3a[_0x598a('0x31')];if(!_0x4e6cb1[_0x598a('0x2d')][_0x598a('0x35')]('nolimit')){_0x14d79b['limit']=qs[_0x598a('0x1a')](_0x4e6cb1['query']['limit']);_0x14d79b[_0x598a('0x1c')]=qs[_0x598a('0x1c')](_0x4e6cb1[_0x598a('0x2d')][_0x598a('0x1c')]);}_0x14d79b[_0x598a('0x36')]=qs['sort'](_0x4e6cb1['query'][_0x598a('0x37')]);_0x14d79b[_0x598a('0x38')]=qs[_0x598a('0x2f')](_[_0x598a('0x39')](_0x4e6cb1[_0x598a('0x2d')],_0x4d3b3a[_0x598a('0x2f')]),_0x227040);if(_0x4e6cb1[_0x598a('0x2d')]['filter']){_0x14d79b['where']=_[_0x598a('0x3a')](_0x14d79b['where'],{'$or':_[_0x598a('0x3b')](_0x227040,function(_0x486d21){if(_0x486d21['type']!==_0x598a('0x3c')){var _0x4e3ae5={};_0x4e3ae5[_0x486d21[_0x598a('0x28')]]={'$like':'%'+_0x4e6cb1[_0x598a('0x2d')]['filter']+'%'};return _0x4e3ae5;}})});}_0x14d79b=_[_0x598a('0x3a')]({},_0x14d79b,_0x4e6cb1[_0x598a('0x3d')]);var _0x28f8a8={'where':_0x14d79b['where']};return db[_0x598a('0x2a')][_0x598a('0x1b')](_0x28f8a8)[_0x598a('0x21')](function(_0x29e43a){_0x57329a['count']=_0x29e43a;if(_0x4e6cb1[_0x598a('0x2d')][_0x598a('0x3e')]){_0x14d79b[_0x598a('0x3f')]=[{'all':!![]}];}return db[_0x598a('0x2a')][_0x598a('0x40')](_0x14d79b);})[_0x598a('0x21')](function(_0x124d15){_0x57329a['rows']=_0x124d15;return _0x57329a;})['then'](respondWithFilteredResult(_0x4733cd,_0x14d79b))[_0x598a('0x41')](handleError(_0x4733cd,null));};exports[_0x598a('0x42')]=function(_0x2d2adc,_0x2bed32){var _0x4ddab4={'raw':!![],'where':{'id':_0x2d2adc[_0x598a('0x43')]['id']}},_0xe1a840={};_0xe1a840[_0x598a('0x31')]=_[_0x598a('0x2e')](db[_0x598a('0x2a')][_0x598a('0x2b')]);_0xe1a840[_0x598a('0x2d')]=_[_0x598a('0x2e')](_0x2d2adc[_0x598a('0x2d')]);_0xe1a840[_0x598a('0x2f')]=_['intersection'](_0xe1a840[_0x598a('0x31')],_0xe1a840['query']);_0x4ddab4[_0x598a('0x33')]=_[_0x598a('0x30')](_0xe1a840[_0x598a('0x31')],qs[_0x598a('0x32')](_0x2d2adc['query'][_0x598a('0x32')]));_0x4ddab4['attributes']=_0x4ddab4[_0x598a('0x33')][_0x598a('0x34')]?_0x4ddab4[_0x598a('0x33')]:_0xe1a840[_0x598a('0x31')];if(_0x2d2adc[_0x598a('0x2d')][_0x598a('0x3e')]){_0x4ddab4[_0x598a('0x3f')]=[{'all':!![]}];}_0x4ddab4=_['merge']({},_0x4ddab4,_0x2d2adc[_0x598a('0x3d')]);return db[_0x598a('0x2a')][_0x598a('0x44')](_0x4ddab4)[_0x598a('0x21')](handleEntityNotFound(_0x2bed32,null))[_0x598a('0x21')](respondWithResult(_0x2bed32,null))[_0x598a('0x41')](handleError(_0x2bed32,null));};exports[_0x598a('0x45')]=function(_0x2534b2,_0x10ac25){return db['Pause'][_0x598a('0x45')](_0x2534b2[_0x598a('0x46')],{})['then'](function(_0xa41c32){var _0x1243d6=_0x2534b2['user'][_0x598a('0x23')]({'plain':!![]});if(!_0x1243d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1243d6[_0x598a('0x47')]===_0x598a('0x48')){var _0x163dc8=_0xa41c32['get']({'plain':!![]});var _0x55195f=_0x598a('0x24');return db[_0x598a('0x49')][_0x598a('0x44')]({'where':{'name':_0x55195f,'userProfileId':_0x1243d6['userProfileId']},'raw':!![]})['then'](function(_0x9c807c){if(_0x9c807c&&_0x9c807c[_0x598a('0x4a')]===0x0){return db['UserProfileResource'][_0x598a('0x45')]({'name':_0x163dc8['name'],'resourceId':_0x163dc8['id'],'type':_0x9c807c['name'],'sectionId':_0x9c807c['id']},{})[_0x598a('0x21')](function(){return _0xa41c32;});}else{return _0xa41c32;}})[_0x598a('0x41')](function(_0x4fc978){logger[_0x598a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fc978);throw _0x4fc978;});}return _0xa41c32;})[_0x598a('0x21')](respondWithResult(_0x10ac25,0xc9))[_0x598a('0x41')](handleError(_0x10ac25,null));};exports[_0x598a('0x20')]=function(_0x499cf1,_0x28ca9a){if(_0x499cf1[_0x598a('0x46')]['id']){delete _0x499cf1['body']['id'];}return db['Pause'][_0x598a('0x44')]({'where':{'id':_0x499cf1[_0x598a('0x43')]['id']}})[_0x598a('0x21')](handleEntityNotFound(_0x28ca9a,null))[_0x598a('0x21')](saveUpdates(_0x499cf1[_0x598a('0x46')],null))[_0x598a('0x21')](respondWithResult(_0x28ca9a,null))['catch'](handleError(_0x28ca9a,null));};exports[_0x598a('0x22')]=function(_0x18c293,_0x18f836){return db['Pause']['find']({'where':{'id':_0x18c293[_0x598a('0x43')]['id']}})['then'](handleEntityNotFound(_0x18f836,null))[_0x598a('0x21')](removeEntity(_0x18f836,null))[_0x598a('0x41')](handleError(_0x18f836,null));}; \ No newline at end of file +var _0xb466=['name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','VIRTUAL','Pause','include','findAll','catch','show','params','includeAll','options','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','destroy','then','get','Pauses','UserProfileResource','error'];(function(_0x12e706,_0x3d16d6){var _0x1a0f9c=function(_0x4ad9bf){while(--_0x4ad9bf){_0x12e706['push'](_0x12e706['shift']());}};_0x1a0f9c(++_0x3d16d6);}(_0xb466,0x1ef));var _0x6b46=function(_0x618aeb,_0x34d206){_0x618aeb=_0x618aeb-0x0;var _0x21236d=_0xb466[_0x618aeb];return _0x21236d;};'use strict';var emlformat=require(_0x6b46('0x0'));var rimraf=require(_0x6b46('0x1'));var zipdir=require(_0x6b46('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6b46('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6b46('0x4'));var ejs=require(_0x6b46('0x5'));var fs=require('fs');var fs_extra=require(_0x6b46('0x6'));var _=require(_0x6b46('0x7'));var squel=require('squel');var crypto=require(_0x6b46('0x8'));var jsforce=require(_0x6b46('0x9'));var deskjs=require(_0x6b46('0xa'));var toCsv=require(_0x6b46('0x4'));var querystring=require(_0x6b46('0xb'));var Papa=require(_0x6b46('0xc'));var Redis=require(_0x6b46('0xd'));var authService=require(_0x6b46('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6b46('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6b46('0x10'));var utils=require('../../config/utils');var config=require(_0x6b46('0x11'));var licenseUtil=require(_0x6b46('0x12'));var db=require(_0x6b46('0x13'))['db'];function respondWithStatusCode(_0x31c54b,_0x26b0b9){_0x26b0b9=_0x26b0b9||0xcc;return function(_0x5c335e){if(_0x5c335e){return _0x31c54b[_0x6b46('0x14')](_0x26b0b9);}return _0x31c54b[_0x6b46('0x15')](_0x26b0b9)[_0x6b46('0x16')]();};}function respondWithResult(_0x11c2b2,_0x36b3a9){_0x36b3a9=_0x36b3a9||0xc8;return function(_0x4e05b1){if(_0x4e05b1){return _0x11c2b2['status'](_0x36b3a9)[_0x6b46('0x17')](_0x4e05b1);}};}function respondWithFilteredResult(_0x520b8e,_0x343f62){return function(_0x553e66){if(_0x553e66){var _0x32ab64=typeof _0x343f62[_0x6b46('0x18')]===_0x6b46('0x19')&&typeof _0x343f62['limit']===_0x6b46('0x19');var _0x394080=_0x553e66[_0x6b46('0x1a')];var _0x5d6c33=_0x32ab64?0x0:_0x343f62[_0x6b46('0x18')];var _0x3f9590=_0x32ab64?_0x553e66[_0x6b46('0x1a')]:_0x343f62[_0x6b46('0x18')]+_0x343f62['limit'];var _0x2d2e4f;if(_0x3f9590>=_0x394080){_0x3f9590=_0x394080;_0x2d2e4f=0xc8;}else{_0x2d2e4f=0xce;}_0x520b8e['status'](_0x2d2e4f);return _0x520b8e['set'](_0x6b46('0x1b'),_0x5d6c33+'-'+_0x3f9590+'/'+_0x394080)['json'](_0x553e66);}return null;};}function patchUpdates(_0x5c6614){return function(_0x473efe){try{jsonpatch[_0x6b46('0x1c')](_0x473efe,_0x5c6614,!![]);}catch(_0x424d87){return BPromise['reject'](_0x424d87);}return _0x473efe[_0x6b46('0x1d')]();};}function saveUpdates(_0xc249f8,_0x12fcd2){return function(_0x2266e6){if(_0x2266e6){return _0x2266e6[_0x6b46('0x1e')](_0xc249f8)['then'](function(_0x379358){return _0x379358;});}return null;};}function removeEntity(_0x177119,_0x21647f){return function(_0x5e856a){if(_0x5e856a){return _0x5e856a[_0x6b46('0x1f')]()[_0x6b46('0x20')](function(){var _0x5b4753=_0x5e856a[_0x6b46('0x21')]({'plain':!![]});var _0x3302eb=_0x6b46('0x22');return db[_0x6b46('0x23')][_0x6b46('0x1f')]({'where':{'type':_0x3302eb,'resourceId':_0x5b4753['id']}})['then'](function(){return _0x5e856a;});})[_0x6b46('0x20')](function(){_0x177119[_0x6b46('0x15')](0xcc)[_0x6b46('0x16')]();});}};}function handleEntityNotFound(_0x5f260f,_0xad8669){return function(_0x353859){if(!_0x353859){_0x5f260f[_0x6b46('0x14')](0x194);}return _0x353859;};}function handleError(_0x523aca,_0x1ebe0f){_0x1ebe0f=_0x1ebe0f||0x1f4;return function(_0xd090dd){logger[_0x6b46('0x24')](_0xd090dd['stack']);if(_0xd090dd[_0x6b46('0x25')]){delete _0xd090dd['name'];}_0x523aca[_0x6b46('0x15')](_0x1ebe0f)[_0x6b46('0x26')](_0xd090dd);};}exports[_0x6b46('0x27')]=function(_0x4707e8,_0xdc722c){var _0x557593={},_0x1b5b36={},_0x1d744b={'count':0x0,'rows':[]};var _0x536d18=_['map'](db['Pause'][_0x6b46('0x28')],function(_0x1a3783){return{'name':_0x1a3783[_0x6b46('0x29')],'type':_0x1a3783[_0x6b46('0x2a')][_0x6b46('0x2b')]};});_0x1b5b36[_0x6b46('0x2c')]=_[_0x6b46('0x2d')](_0x536d18,'name');_0x1b5b36[_0x6b46('0x2e')]=_[_0x6b46('0x2f')](_0x4707e8[_0x6b46('0x2e')]);_0x1b5b36['filters']=_['intersection'](_0x1b5b36[_0x6b46('0x2c')],_0x1b5b36[_0x6b46('0x2e')]);_0x557593[_0x6b46('0x30')]=_[_0x6b46('0x31')](_0x1b5b36[_0x6b46('0x2c')],qs[_0x6b46('0x32')](_0x4707e8[_0x6b46('0x2e')][_0x6b46('0x32')]));_0x557593[_0x6b46('0x30')]=_0x557593['attributes'][_0x6b46('0x33')]?_0x557593['attributes']:_0x1b5b36[_0x6b46('0x2c')];if(!_0x4707e8[_0x6b46('0x2e')][_0x6b46('0x34')]('nolimit')){_0x557593[_0x6b46('0x35')]=qs['limit'](_0x4707e8[_0x6b46('0x2e')][_0x6b46('0x35')]);_0x557593[_0x6b46('0x18')]=qs[_0x6b46('0x18')](_0x4707e8['query'][_0x6b46('0x18')]);}_0x557593[_0x6b46('0x36')]=qs['sort'](_0x4707e8[_0x6b46('0x2e')][_0x6b46('0x37')]);_0x557593[_0x6b46('0x38')]=qs['filters'](_['pick'](_0x4707e8['query'],_0x1b5b36[_0x6b46('0x39')]),_0x536d18);if(_0x4707e8[_0x6b46('0x2e')][_0x6b46('0x3a')]){_0x557593[_0x6b46('0x38')]=_[_0x6b46('0x3b')](_0x557593[_0x6b46('0x38')],{'$or':_['map'](_0x536d18,function(_0x78f3f4){if(_0x78f3f4[_0x6b46('0x2a')]!==_0x6b46('0x3c')){var _0x33f253={};_0x33f253[_0x78f3f4['name']]={'$like':'%'+_0x4707e8[_0x6b46('0x2e')][_0x6b46('0x3a')]+'%'};return _0x33f253;}})});}_0x557593=_[_0x6b46('0x3b')]({},_0x557593,_0x4707e8['options']);var _0x45ab1d={'where':_0x557593[_0x6b46('0x38')]};return db[_0x6b46('0x3d')]['count'](_0x45ab1d)['then'](function(_0x94463d){_0x1d744b[_0x6b46('0x1a')]=_0x94463d;if(_0x4707e8['query']['includeAll']){_0x557593[_0x6b46('0x3e')]=[{'all':!![]}];}return db['Pause'][_0x6b46('0x3f')](_0x557593);})[_0x6b46('0x20')](function(_0x308ee4){_0x1d744b['rows']=_0x308ee4;return _0x1d744b;})[_0x6b46('0x20')](respondWithFilteredResult(_0xdc722c,_0x557593))[_0x6b46('0x40')](handleError(_0xdc722c,null));};exports[_0x6b46('0x41')]=function(_0x4c0e0e,_0x52a007){var _0x30963f={'raw':!![],'where':{'id':_0x4c0e0e[_0x6b46('0x42')]['id']}},_0x536bed={};_0x536bed[_0x6b46('0x2c')]=_['keys'](db[_0x6b46('0x3d')][_0x6b46('0x28')]);_0x536bed['query']=_['keys'](_0x4c0e0e[_0x6b46('0x2e')]);_0x536bed[_0x6b46('0x39')]=_[_0x6b46('0x31')](_0x536bed[_0x6b46('0x2c')],_0x536bed['query']);_0x30963f[_0x6b46('0x30')]=_['intersection'](_0x536bed[_0x6b46('0x2c')],qs[_0x6b46('0x32')](_0x4c0e0e[_0x6b46('0x2e')]['fields']));_0x30963f['attributes']=_0x30963f['attributes']['length']?_0x30963f[_0x6b46('0x30')]:_0x536bed['model'];if(_0x4c0e0e[_0x6b46('0x2e')][_0x6b46('0x43')]){_0x30963f[_0x6b46('0x3e')]=[{'all':!![]}];}_0x30963f=_['merge']({},_0x30963f,_0x4c0e0e[_0x6b46('0x44')]);return db['Pause'][_0x6b46('0x45')](_0x30963f)[_0x6b46('0x20')](handleEntityNotFound(_0x52a007,null))[_0x6b46('0x20')](respondWithResult(_0x52a007,null))[_0x6b46('0x40')](handleError(_0x52a007,null));};exports['create']=function(_0x418d68,_0x5768f0){return db[_0x6b46('0x3d')][_0x6b46('0x46')](_0x418d68[_0x6b46('0x47')],{})['then'](function(_0x558ff1){var _0xabc8c4=_0x418d68[_0x6b46('0x48')][_0x6b46('0x21')]({'plain':!![]});if(!_0xabc8c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xabc8c4[_0x6b46('0x49')]===_0x6b46('0x48')){var _0x1d719d=_0x558ff1['get']({'plain':!![]});var _0x2ba452=_0x6b46('0x22');return db['UserProfileSection'][_0x6b46('0x45')]({'where':{'name':_0x2ba452,'userProfileId':_0xabc8c4['userProfileId']},'raw':!![]})[_0x6b46('0x20')](function(_0xd162d4){if(_0xd162d4&&_0xd162d4[_0x6b46('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x1d719d[_0x6b46('0x25')],'resourceId':_0x1d719d['id'],'type':_0xd162d4[_0x6b46('0x25')],'sectionId':_0xd162d4['id']},{})[_0x6b46('0x20')](function(){return _0x558ff1;});}else{return _0x558ff1;}})[_0x6b46('0x40')](function(_0x277bc7){logger[_0x6b46('0x24')](_0x6b46('0x4b'),_0x277bc7);throw _0x277bc7;});}return _0x558ff1;})[_0x6b46('0x20')](respondWithResult(_0x5768f0,0xc9))[_0x6b46('0x40')](handleError(_0x5768f0,null));};exports[_0x6b46('0x1e')]=function(_0x3fc294,_0x4ab940){if(_0x3fc294['body']['id']){delete _0x3fc294[_0x6b46('0x47')]['id'];}return db[_0x6b46('0x3d')][_0x6b46('0x45')]({'where':{'id':_0x3fc294[_0x6b46('0x42')]['id']}})[_0x6b46('0x20')](handleEntityNotFound(_0x4ab940,null))['then'](saveUpdates(_0x3fc294[_0x6b46('0x47')],null))[_0x6b46('0x20')](respondWithResult(_0x4ab940,null))[_0x6b46('0x40')](handleError(_0x4ab940,null));};exports[_0x6b46('0x1f')]=function(_0x3dad07,_0x1a7703){return db[_0x6b46('0x3d')][_0x6b46('0x45')]({'where':{'id':_0x3dad07['params']['id']}})[_0x6b46('0x20')](handleEntityNotFound(_0x1a7703,null))['then'](removeEntity(_0x1a7703,null))['catch'](handleError(_0x1a7703,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 0911b44..7a9c2b8 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 _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x7217,0x19e));var _0x7721=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7217[_0x5b561d];return _0x431060;};'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 +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'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 8b87e89..30b35fc 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4a4de9,_0x5e56d9){var _0x3cf978=function(_0xa7a081){while(--_0xa7a081){_0x4a4de9['push'](_0x4a4de9['shift']());}};_0x3cf978(++_0x5e56d9);}(_0xb10b,0x12a));var _0xbb10=function(_0x462042,_0x524279){_0x462042=_0x462042-0x0;var _0x585608=_0xb10b[_0x462042];return _0x585608;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x3d8e3d,_0x411e65){var _0x5b9aa8=function(_0x31d978){while(--_0x31d978){_0x3d8e3d['push'](_0x3d8e3d['shift']());}};_0x5b9aa8(++_0x411e65);}(_0xb10b,0x12a));var _0xbb10=function(_0x555164,_0x13e97c){_0x555164=_0x555164-0x0;var _0x541861=_0xb10b[_0x555164];return _0x541861;};'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 8780e2f..921c853 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 _0x425d=['isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get'];(function(_0xdeeb18,_0x1a9e0a){var _0x456c67=function(_0xff5d3c){while(--_0xff5d3c){_0xdeeb18['push'](_0xdeeb18['shift']());}};_0x456c67(++_0x1a9e0a);}(_0x425d,0x1e0));var _0xd425=function(_0x57ff59,_0x4b9327){_0x57ff59=_0x57ff59-0x0;var _0x58e63f=_0x425d[_0x57ff59];return _0x58e63f;};'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')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0xb')]);router[_0xd425('0x9')](_0xd425('0xc'),controller['webhookGet']);router[_0xd425('0x9')](_0xd425('0xd'),auth[_0xd425('0xa')](),controller[_0xd425('0xe')]);router[_0xd425('0x9')](_0xd425('0xf'),auth[_0xd425('0xa')](),controller[_0xd425('0x10')]);var upload=multer({'storage':multer[_0xd425('0x11')]({'destination':function(_0x35a7f4,_0x3d2bcf,_0x10d463){_0x10d463(null,path[_0xd425('0x12')](config[_0xd425('0x13')],_0xd425('0x14')));},'filename':function(_0x2385a5,_0x9bb611,_0x3cacf7){_0x9bb611[_0xd425('0x15')]=_0x9bb611[_0xd425('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3cacf7(null,util[_0xd425('0x16')](_0xd425('0x17'),path[_0xd425('0x18')](_0x9bb611['originalname'],path[_0xd425('0x19')](_0x9bb611[_0xd425('0x15')])),Date[_0xd425('0x1a')](),path[_0xd425('0x19')](_0x9bb611[_0xd425('0x15')])));}})});router['post']('/',upload[_0xd425('0x1b')](_0xd425('0x1c')),controller[_0xd425('0x1d')]);router[_0xd425('0x1e')]('/webhook',controller[_0xd425('0x1f')]);router[_0xd425('0x20')](_0xd425('0xd'),auth[_0xd425('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd425('0x21')]);module[_0xd425('0x22')]=router; \ No newline at end of file +var _0xb43b=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','index','/webhook','webhookGet','get','/:id','isAuthenticated','/:id/download','download','diskStorage','join','server/files/plugins','originalname','format','basename','extname','file','webhookPost','put','delete','exports','multer'];(function(_0x1f1170,_0x3b5783){var _0x127b7b=function(_0x30c5ed){while(--_0x30c5ed){_0x1f1170['push'](_0x1f1170['shift']());}};_0x127b7b(++_0x3b5783);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4eb4ea,_0xce9158){_0x4eb4ea=_0x4eb4ea-0x0;var _0x381405=_0xb43b[_0x4eb4ea];return _0x381405;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),controller[_0xbb43('0xb')]);router[_0xbb43('0xc')](_0xbb43('0xd'),auth[_0xbb43('0xe')](),controller['show']);router[_0xbb43('0xc')](_0xbb43('0xf'),auth['isAuthenticated'](),controller[_0xbb43('0x10')]);var upload=multer({'storage':multer[_0xbb43('0x11')]({'destination':function(_0xd37cdf,_0x5e3611,_0xfac791){_0xfac791(null,path[_0xbb43('0x12')](config['root'],_0xbb43('0x13')));},'filename':function(_0x2a5a4d,_0x50e2c0,_0x578392){_0x50e2c0[_0xbb43('0x14')]=_0x50e2c0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x578392(null,util[_0xbb43('0x15')]('%s-%s%s',path[_0xbb43('0x16')](_0x50e2c0[_0xbb43('0x14')],path['extname'](_0x50e2c0['originalname'])),Date['now'](),path[_0xbb43('0x17')](_0x50e2c0[_0xbb43('0x14')])));}})});router['post']('/',upload['single'](_0xbb43('0x18')),controller['upload']);router['post'](_0xbb43('0xa'),controller[_0xbb43('0x19')]);router[_0xbb43('0x1a')]('/:id',auth[_0xbb43('0xe')](),controller['update']);router[_0xbb43('0x1b')](_0xbb43('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0xbb43('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 103c67f..c7c740e 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 _0x2689=['agentOnly','always','never','sequelize','exports','STRING','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.','ENUM','adminOnly'];(function(_0x21bde7,_0x199391){var _0x2153b7=function(_0x3346d0){while(--_0x3346d0){_0x21bde7['push'](_0x21bde7['shift']());}};_0x2153b7(++_0x199391);}(_0x2689,0x1ed));var _0x9268=function(_0x1c27e1,_0x10cc1c){_0x1c27e1=_0x1c27e1-0x0;var _0x9a81ac=_0x2689[_0x1c27e1];return _0x9a81ac;};'use strict';var Sequelize=require(_0x9268('0x0'));module[_0x9268('0x1')]={'name':{'type':Sequelize[_0x9268('0x2')]},'type':{'type':Sequelize['ENUM'](_0x9268('0x3'),_0x9268('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9268('0x5')]},'path':{'type':Sequelize[_0x9268('0x2')],'comment':_0x9268('0x6')},'active':{'type':Sequelize[_0x9268('0x7')],'defaultValue':0x0,'comment':_0x9268('0x8')},'sidebar':{'type':Sequelize[_0x9268('0x9')](_0x9268('0xa'),_0x9268('0xb'),_0x9268('0xc'),_0x9268('0xd')),'defaultValue':_0x9268('0xc'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x9268('0x2')]},'adminUrl':{'type':Sequelize[_0x9268('0x2')]},'agentUrl':{'type':Sequelize[_0x9268('0x2')]},'scriptName':{'type':Sequelize[_0x9268('0x2')]},'scriptPath':{'type':Sequelize[_0x9268('0x2')]}}; \ No newline at end of file +var _0x459b=['ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x41f56a,_0x49a25b){var _0x25d410=function(_0x2aae95){while(--_0x2aae95){_0x41f56a['push'](_0x41f56a['shift']());}};_0x25d410(++_0x49a25b);}(_0x459b,0x11b));var _0xb459=function(_0x5a83af,_0x162de6){_0x5a83af=_0x5a83af-0x0;var _0x83a209=_0x459b[_0x5a83af];return _0x83a209;};'use strict';var Sequelize=require(_0xb459('0x0'));module[_0xb459('0x1')]={'name':{'type':Sequelize[_0xb459('0x2')]},'type':{'type':Sequelize[_0xb459('0x3')](_0xb459('0x4'),_0xb459('0x5'))},'description':{'type':Sequelize[_0xb459('0x6')]},'version':{'type':Sequelize[_0xb459('0x6')]},'path':{'type':Sequelize['STRING'],'comment':_0xb459('0x7')},'active':{'type':Sequelize[_0xb459('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xb459('0x3')](_0xb459('0x9'),_0xb459('0xa'),'always',_0xb459('0xb')),'defaultValue':'always','comment':_0xb459('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xb459('0x2')]},'agentUrl':{'type':Sequelize[_0xb459('0x2')]},'scriptName':{'type':Sequelize[_0xb459('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b7f1c25..bc623f1 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 _0x1997=['send','index','Plugin','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','download','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','agent','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','method','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name'];(function(_0x520a50,_0x452885){var _0xab1017=function(_0x185128){while(--_0x185128){_0x520a50['push'](_0x520a50['shift']());}};_0xab1017(++_0x452885);}(_0x1997,0x1d2));var _0x7199=function(_0x1ab615,_0x5a536b){_0x1ab615=_0x1ab615-0x0;var _0x3cf729=_0x1997[_0x1ab615];return _0x3cf729;};'use strict';var emlformat=require(_0x7199('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7199('0x1'));var jsonpatch=require(_0x7199('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7199('0x3'));var Mustache=require(_0x7199('0x4'));var util=require(_0x7199('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7199('0x6'));var ejs=require(_0x7199('0x7'));var fs=require('fs');var fs_extra=require(_0x7199('0x8'));var _=require(_0x7199('0x9'));var squel=require(_0x7199('0xa'));var crypto=require(_0x7199('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7199('0xc'));var Papa=require(_0x7199('0xd'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x7199('0xe'));var authService=require(_0x7199('0xf'));var qs=require(_0x7199('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7199('0x11'))(_0x7199('0x12'));var utils=require(_0x7199('0x13'));var config=require(_0x7199('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7199('0x15'))['db'];config[_0x7199('0x16')]=_['defaults'](config[_0x7199('0x16')],{'host':_0x7199('0x17'),'port':0x18eb});var socket=require(_0x7199('0x18'))(new Redis(config[_0x7199('0x16')]));require(_0x7199('0x19'))['register'](socket);function respondWithStatusCode(_0x46eccc,_0x11d967){_0x11d967=_0x11d967||0xcc;return function(_0x318750){if(_0x318750){return _0x46eccc[_0x7199('0x1a')](_0x11d967);}return _0x46eccc[_0x7199('0x1b')](_0x11d967)[_0x7199('0x1c')]();};}function respondWithResult(_0x4f8d39,_0x810274){_0x810274=_0x810274||0xc8;return function(_0x56b592){if(_0x56b592){return _0x4f8d39[_0x7199('0x1b')](_0x810274)['json'](_0x56b592);}};}function respondWithFilteredResult(_0xcf3104,_0x215304){return function(_0x2c046b){if(_0x2c046b){var _0x5651e5=typeof _0x215304['offset']===_0x7199('0x1d')&&typeof _0x215304[_0x7199('0x1e')]===_0x7199('0x1d');var _0x4c2bc5=_0x2c046b[_0x7199('0x1f')];var _0xd4100a=_0x5651e5?0x0:_0x215304[_0x7199('0x20')];var _0x602907=_0x5651e5?_0x2c046b[_0x7199('0x1f')]:_0x215304[_0x7199('0x20')]+_0x215304[_0x7199('0x1e')];var _0x40614b;if(_0x602907>=_0x4c2bc5){_0x602907=_0x4c2bc5;_0x40614b=0xc8;}else{_0x40614b=0xce;}_0xcf3104[_0x7199('0x1b')](_0x40614b);return _0xcf3104[_0x7199('0x21')](_0x7199('0x22'),_0xd4100a+'-'+_0x602907+'/'+_0x4c2bc5)[_0x7199('0x23')](_0x2c046b);}return null;};}function patchUpdates(_0x2f2278){return function(_0x190b76){try{jsonpatch[_0x7199('0x24')](_0x190b76,_0x2f2278,!![]);}catch(_0x27b6d2){return BPromise[_0x7199('0x25')](_0x27b6d2);}return _0x190b76['save']();};}function saveUpdates(_0x2937bb,_0x21fdfa){return function(_0x1f8c27){if(_0x1f8c27){return _0x1f8c27[_0x7199('0x26')](_0x2937bb)[_0x7199('0x27')](function(_0x331ac0){return _0x331ac0;});}return null;};}function removeEntity(_0x8ff480,_0x2ff96b){return function(_0x4f271b){if(_0x4f271b){return _0x4f271b[_0x7199('0x28')]()[_0x7199('0x27')](function(){var _0x3230b4=_0x4f271b[_0x7199('0x29')]({'plain':!![]});var _0x487c3d=_0x7199('0x2a');return db[_0x7199('0x2b')][_0x7199('0x28')]({'where':{'type':_0x487c3d,'resourceId':_0x3230b4['id']}})[_0x7199('0x27')](function(){return _0x4f271b;});})['then'](function(){_0x8ff480[_0x7199('0x1b')](0xcc)[_0x7199('0x1c')]();});}};}function handleEntityNotFound(_0x7cfdbe,_0xc507f1){return function(_0x4b2c25){if(!_0x4b2c25){_0x7cfdbe[_0x7199('0x1a')](0x194);}return _0x4b2c25;};}function handleError(_0x53e997,_0x20ccff){_0x20ccff=_0x20ccff||0x1f4;return function(_0x5ba6ca){logger[_0x7199('0x2c')](_0x5ba6ca[_0x7199('0x2d')]);if(_0x5ba6ca[_0x7199('0x2e')]){delete _0x5ba6ca[_0x7199('0x2e')];}_0x53e997[_0x7199('0x1b')](_0x20ccff)[_0x7199('0x2f')](_0x5ba6ca);};}exports[_0x7199('0x30')]=function(_0x160e35,_0x35f1da){var _0x1af0eb={},_0x2232bc={},_0x50942b={'count':0x0,'rows':[]};var _0x444aea=_['map'](db[_0x7199('0x31')][_0x7199('0x32')],function(_0x788010){return{'name':_0x788010[_0x7199('0x33')],'type':_0x788010[_0x7199('0x34')][_0x7199('0x35')]};});_0x2232bc['model']=_['map'](_0x444aea,_0x7199('0x2e'));_0x2232bc[_0x7199('0x36')]=_[_0x7199('0x37')](_0x160e35['query']);_0x2232bc[_0x7199('0x38')]=_['intersection'](_0x2232bc[_0x7199('0x39')],_0x2232bc[_0x7199('0x36')]);_0x1af0eb[_0x7199('0x3a')]=_[_0x7199('0x3b')](_0x2232bc[_0x7199('0x39')],qs[_0x7199('0x3c')](_0x160e35['query'][_0x7199('0x3c')]));_0x1af0eb[_0x7199('0x3a')]=_0x1af0eb[_0x7199('0x3a')][_0x7199('0x3d')]?_0x1af0eb[_0x7199('0x3a')]:_0x2232bc[_0x7199('0x39')];if(!_0x160e35['query'][_0x7199('0x3e')](_0x7199('0x3f'))){_0x1af0eb['limit']=qs[_0x7199('0x1e')](_0x160e35[_0x7199('0x36')][_0x7199('0x1e')]);_0x1af0eb['offset']=qs[_0x7199('0x20')](_0x160e35[_0x7199('0x36')][_0x7199('0x20')]);}_0x1af0eb[_0x7199('0x40')]=qs[_0x7199('0x41')](_0x160e35[_0x7199('0x36')][_0x7199('0x41')]);_0x1af0eb[_0x7199('0x42')]=qs[_0x7199('0x38')](_['pick'](_0x160e35[_0x7199('0x36')],_0x2232bc['filters']),_0x444aea);if(_0x160e35[_0x7199('0x36')][_0x7199('0x43')]){_0x1af0eb[_0x7199('0x42')]=_[_0x7199('0x44')](_0x1af0eb['where'],{'$or':_[_0x7199('0x45')](_0x444aea,function(_0x18d3b9){if(_0x18d3b9[_0x7199('0x34')]!==_0x7199('0x46')){var _0x20ac3a={};_0x20ac3a[_0x18d3b9[_0x7199('0x2e')]]={'$like':'%'+_0x160e35[_0x7199('0x36')]['filter']+'%'};return _0x20ac3a;}})});}_0x1af0eb=_[_0x7199('0x44')]({},_0x1af0eb,_0x160e35['options']);var _0x3421d1={'where':_0x1af0eb[_0x7199('0x42')]};return db[_0x7199('0x31')]['count'](_0x3421d1)[_0x7199('0x27')](function(_0x4c5b09){_0x50942b[_0x7199('0x1f')]=_0x4c5b09;if(_0x160e35[_0x7199('0x36')]['includeAll']){_0x1af0eb[_0x7199('0x47')]=[{'all':!![]}];}return db[_0x7199('0x31')][_0x7199('0x48')](_0x1af0eb);})['then'](function(_0x5ca80b){_0x50942b[_0x7199('0x49')]=_0x5ca80b;return _0x50942b;})[_0x7199('0x27')](respondWithFilteredResult(_0x35f1da,_0x1af0eb))[_0x7199('0x4a')](handleError(_0x35f1da,null));};exports[_0x7199('0x4b')]=function(_0x306e96,_0x1a52fa){var _0x3c62c8={'raw':!![],'where':{'id':_0x306e96[_0x7199('0x4c')]['id']}},_0x413526={};_0x413526[_0x7199('0x39')]=_[_0x7199('0x37')](db[_0x7199('0x31')][_0x7199('0x32')]);_0x413526[_0x7199('0x36')]=_[_0x7199('0x37')](_0x306e96[_0x7199('0x36')]);_0x413526[_0x7199('0x38')]=_[_0x7199('0x3b')](_0x413526[_0x7199('0x39')],_0x413526['query']);_0x3c62c8[_0x7199('0x3a')]=_[_0x7199('0x3b')](_0x413526['model'],qs[_0x7199('0x3c')](_0x306e96[_0x7199('0x36')][_0x7199('0x3c')]));_0x3c62c8['attributes']=_0x3c62c8['attributes'][_0x7199('0x3d')]?_0x3c62c8['attributes']:_0x413526[_0x7199('0x39')];if(_0x306e96[_0x7199('0x36')][_0x7199('0x4d')]){_0x3c62c8['include']=[{'all':!![]}];}_0x3c62c8=_['merge']({},_0x3c62c8,_0x306e96['options']);return db[_0x7199('0x31')][_0x7199('0x4e')](_0x3c62c8)[_0x7199('0x27')](handleEntityNotFound(_0x1a52fa,null))[_0x7199('0x27')](respondWithResult(_0x1a52fa,null))[_0x7199('0x4a')](handleError(_0x1a52fa,null));};exports[_0x7199('0x4f')]=function(_0x3ce041,_0x346962,_0x316d9e){return db['Plugin'][_0x7199('0x4e')]({'where':{'id':_0x3ce041['params']['id']},'attributes':[_0x7199('0x2e'),_0x7199('0x50')],'raw':!![]})[_0x7199('0x27')](handleEntityNotFound(_0x346962,null))[_0x7199('0x27')](function(_0x4d4c1c){if(_0x4d4c1c){var _0x4e4c06=path[_0x7199('0x51')](config[_0x7199('0x52')],_0x7199('0x53'),util[_0x7199('0x54')](_0x7199('0x55'),path[_0x7199('0x56')](_0x4d4c1c[_0x7199('0x50')])));var _0x268763=fs[_0x7199('0x57')](_0x4e4c06);var _0x1cf128=archiver('zip',{'zlib':{'level':0x9}});_0x1cf128['on'](_0x7199('0x58'),function(_0xc4b741){if(_0xc4b741[_0x7199('0x59')]===_0x7199('0x5a')){logger[_0x7199('0x2c')](_0xc4b741);}else{throw new db[(_0x7199('0x5b'))][(_0x7199('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1cf128['on']('error',function(_0x35a55c){throw new db['Sequelize']['Error'](_0x7199('0x5d'));});_0x1cf128[_0x7199('0x5e')](_0x268763);_0x1cf128[_0x7199('0x5f')](_0x7199('0x60'),{'cwd':path[_0x7199('0x51')](config[_0x7199('0x52')],_0x7199('0x53'),path[_0x7199('0x61')](_0x4d4c1c[_0x7199('0x50')])),'ignore':[path[_0x7199('0x51')](path[_0x7199('0x56')](_0x4d4c1c[_0x7199('0x50')]),_0x7199('0x62')),path[_0x7199('0x51')](path[_0x7199('0x56')](_0x4d4c1c[_0x7199('0x50')]),_0x7199('0x63'))],'nodir':!![]})['finalize']();_0x268763['on'](_0x7199('0x64'),function(){if(!fs[_0x7199('0x65')](_0x4e4c06)){throw new db[(_0x7199('0x5b'))][(_0x7199('0x5c'))](_0x7199('0x66'));}return _0x346962['download'](_0x4e4c06,util[_0x7199('0x54')](_0x7199('0x55'),path['basename'](_0x4d4c1c[_0x7199('0x50')])),function(_0x25c31c){if(_0x25c31c){throw new db[(_0x7199('0x5b'))]['Error'](_0x7199('0x67'));}fs[_0x7199('0x68')](_0x4e4c06);logger[_0x7199('0x69')](_0x7199('0x6a'));logger['info'](_0x7199('0x6b'));});});}return null;})[_0x7199('0x4a')](handleError(_0x346962,null));};exports[_0x7199('0x6c')]=function(_0x3fcc5d,_0x148b74,_0x965e01){var _0x46c732=path[_0x7199('0x56')](_0x3fcc5d[_0x7199('0x6d')][_0x7199('0x6e')],path[_0x7199('0x6f')](_0x3fcc5d[_0x7199('0x6d')][_0x7199('0x6e')]));var _0x205f87=path['join'](config[_0x7199('0x52')],'server/files/plugins',_0x3fcc5d[_0x7199('0x6d')][_0x7199('0x6e')]);var _0x557063=path[_0x7199('0x51')](config[_0x7199('0x52')],_0x7199('0x53'),_0x46c732);logger[_0x7199('0x69')]('Plugin\x20upload\x20filepath:\x20%s',_0x205f87);logger[_0x7199('0x69')](_0x7199('0x70'),_0x557063);try{fs['chmodSync'](_0x205f87,parseInt(_0x7199('0x71'),0x8));extract(_0x205f87,{'dir':_0x557063},function(_0x3e8024){if(_0x3e8024){logger[_0x7199('0x2c')](_0x3e8024);handleError(_0x3e8024,!![]);};var _0x1762dd=fs[_0x7199('0x72')](_0x557063);if(_0x1762dd['length']>0x1){removeReferences(_0x205f87,_0x557063);logger[_0x7199('0x2c')](_0x7199('0x73'));return _0x965e01(new Error(_0x7199('0x73')));}var _0x39b85e=fs[_0x7199('0x74')](path['join'](_0x557063,_0x1762dd[0x0]));if(_0x39b85e[_0x7199('0x75')]()){removeReferences(_0x205f87,_0x557063);logger[_0x7199('0x2c')]('Invalid\x20plugin\x20structure');return _0x965e01(new Error(_0x7199('0x73')));}if(_0x39b85e[_0x7199('0x76')]()){var _0x51d1ab=fs[_0x7199('0x72')](path['join'](_0x557063,_0x1762dd[0x0]));if(_0x51d1ab[_0x7199('0x3d')]===0x0){removeReferences(_0x205f87,_0x557063);logger[_0x7199('0x2c')](_0x7199('0x73'));return _0x965e01(new Error(_0x7199('0x73')));}var _0xe4305c=_0x51d1ab[_0x7199('0x77')](function(_0x25d5c5){return _0x25d5c5===_0x7199('0x78');});if(!_0xe4305c){return _0x965e01(new Error(_0x7199('0x79')));}var _0x22ada9=fs[_0x7199('0x7a')](path['join'](_0x557063,_0x1762dd[0x0],_0x7199('0x78')));var _0x33006=JSON['parse'](_0x22ada9);if(_0x7199('0x1d')==typeof _0x33006['name']){return _0x965e01(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x7199('0x1d')==typeof _0x33006['type']){return _0x965e01(new Error(_0x7199('0x7b')));}if(_0x7199('0x1d')==typeof _0x33006[_0x7199('0x7c')]){return _0x965e01(new Error(_0x7199('0x7d')));}if(_0x7199('0x1d')==typeof _0x33006[_0x7199('0x7e')]){return _0x965e01(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x33006['type']===_0x7199('0x7f')){if(_0x7199('0x1d')==typeof _0x33006[_0x7199('0x7e')][_0x7199('0x80')]){return _0x965e01(new Error(_0x7199('0x81')));}if('undefined'==typeof _0x33006[_0x7199('0x7e')][_0x7199('0x80')][_0x7199('0x82')]&&_0x7199('0x1d')==typeof _0x33006['parameters']['views']['agent']){return _0x965e01(new Error(_0x7199('0x83')));}}else if(_0x33006[_0x7199('0x34')]===_0x7199('0x84')){if(_0x7199('0x1d')==typeof _0x33006[_0x7199('0x7e')]['scriptName']){return _0x965e01(new Error(_0x7199('0x85')));}if('undefined'==typeof _0x33006[_0x7199('0x7e')][_0x7199('0x86')]){return _0x965e01(new Error(_0x7199('0x87')));}}else{return _0x965e01(new Error(_0x7199('0x88')));}var _0x148588=_0x33006[_0x7199('0x2e')];var _0x5f26e8=_0x33006[_0x7199('0x89')];var _0x3c04aa=_0x33006[_0x7199('0x34')];var _0x3a352d=_0x33006[_0x7199('0x8a')]?_0x33006[_0x7199('0x8a')]:_0x7199('0x8b');var _0x3dda71=_0x33006['icon']?_0x33006[_0x7199('0x8c')]:_0x7199('0x8d');var _0x52fe94='';var _0x397b2c='';var _0x3cf5e7='';var _0x288b93='';var _0x5ac071=_0x33006['version'];if(_0x3c04aa==='html'){if(_0x7199('0x1d')!=typeof _0x33006['parameters'][_0x7199('0x80')][_0x7199('0x82')]){var _0x500590=_0x33006[_0x7199('0x7e')][_0x7199('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7199('0x8e')](_0x500590)){_0x52fe94=path[_0x7199('0x51')]('plugins',_0x46c732,_0x1762dd[0x0],_0x500590);}else{_0x52fe94=_0x500590;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x7199('0x1d')!=typeof _0x33006[_0x7199('0x7e')][_0x7199('0x80')]['agent']){var _0x31a71a=_0x33006[_0x7199('0x7e')][_0x7199('0x80')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x31a71a)){_0x397b2c=path[_0x7199('0x51')](_0x7199('0x8f'),_0x46c732,_0x1762dd[0x0],_0x31a71a);}else{_0x397b2c=_0x31a71a;}}else{logger[_0x7199('0x69')](_0x7199('0x90'));}}else if(_0x3c04aa===_0x7199('0x84')){_0x3cf5e7=_0x33006[_0x7199('0x7e')][_0x7199('0x91')];_0x288b93=_0x33006[_0x7199('0x7e')][_0x7199('0x86')];if(_0x7199('0x1d')!=typeof _0x33006[_0x7199('0x7e')][_0x7199('0x80')]){if('undefined'!=typeof _0x33006['parameters']['views'][_0x7199('0x82')]){var _0x500590=_0x33006[_0x7199('0x7e')][_0x7199('0x80')][_0x7199('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x500590)){_0x52fe94=path[_0x7199('0x51')](_0x7199('0x8f'),_0x46c732,_0x1762dd[0x0],_0x500590);}else{_0x52fe94=_0x500590;}}if(_0x7199('0x1d')!=typeof _0x33006['parameters'][_0x7199('0x80')]['agent']){var _0x31a71a=_0x33006[_0x7199('0x7e')][_0x7199('0x80')][_0x7199('0x92')];if(!/^(f|ht)tps?:\/\//i[_0x7199('0x8e')](_0x31a71a)){_0x397b2c=path[_0x7199('0x51')]('plugins',_0x46c732,_0x1762dd[0x0],_0x31a71a);}else{_0x397b2c=_0x31a71a;}}}}var _0x43abee={'name':_0x148588,'description':_0x5f26e8,'path':path[_0x7199('0x51')](_0x46c732,_0x1762dd[0x0]),'type':_0x3c04aa,'sidebar':_0x3a352d,'icon':_0x3dda71,'adminUrl':_0x52fe94,'agentUrl':_0x397b2c,'scriptName':_0x3cf5e7,'scriptPath':_0x288b93,'version':_0x5ac071};removeReferences(_0x205f87,null);return db['Plugin']['create'](_0x43abee)[_0x7199('0x27')](function(_0x8955f0){var _0x524e2d={'role':_0x3fcc5d['body'][_0x7199('0x93')],'userProfileId':_0x3fcc5d[_0x7199('0x94')][_0x7199('0x95')]};if(!_0x524e2d)throw new Error(_0x7199('0x96'));if(_0x524e2d['role']===_0x7199('0x97')){var _0x23508d=_0x8955f0[_0x7199('0x29')]({'plain':!![]});return db[_0x7199('0x98')][_0x7199('0x4e')]({'where':{'name':_0x7199('0x2a'),'userProfileId':_0x524e2d[_0x7199('0x95')]},'raw':!![]})[_0x7199('0x27')](function(_0x55d90e){if(_0x55d90e&&_0x55d90e[_0x7199('0x99')]===0x0){return db[_0x7199('0x2b')]['create']({'name':_0x23508d[_0x7199('0x2e')],'resourceId':_0x23508d['id'],'type':_0x55d90e[_0x7199('0x2e')],'sectionId':_0x55d90e['id']},{})['then'](function(){return _0x8955f0;});}else{return _0x8955f0;}})['catch'](function(_0x89f096){logger[_0x7199('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x89f096);throw _0x89f096;});}return _0x8955f0;})[_0x7199('0x27')](respondWithResult(_0x148b74,null))['catch'](handleError(_0x148b74,null));}});}catch(_0xad4e9c){_0x148b74[_0x7199('0x1b')](0x1f4)[_0x7199('0x2f')](_0xad4e9c);}};function removeReferences(_0xe457d4,_0x199997){try{if(_0xe457d4){fs[_0x7199('0x68')](_0xe457d4);logger['info'](_0x7199('0x9a'));}if(_0x199997){rimraf(_0x199997,function(){});logger[_0x7199('0x69')](_0x7199('0x9b'));}}catch(_0x328f4a){logger[_0x7199('0x2c')](_0x328f4a);}}exports[_0x7199('0x26')]=function(_0x3ffe87,_0x283057,_0x1babb0){return db[_0x7199('0x31')]['find']({'where':{'id':_0x3ffe87[_0x7199('0x4c')]['id']}})[_0x7199('0x27')](handleEntityNotFound(_0x283057,null))[_0x7199('0x27')](saveUpdates(_0x3ffe87['body'],null))[_0x7199('0x27')](respondWithResult(_0x283057,null))[_0x7199('0x4a')](handleError(_0x283057,null));};exports['delete']=function(_0x83ca14,_0x35c848,_0x2faccf){return db[_0x7199('0x31')][_0x7199('0x4e')]({'where':{'id':_0x83ca14[_0x7199('0x4c')]['id']}})[_0x7199('0x27')](function(_0x1362af){if(_0x1362af){return _0x1362af[_0x7199('0x28')]();}})[_0x7199('0x27')](function(_0x1eebdd){rimraf(path[_0x7199('0x51')](config['root'],_0x7199('0x53'),path[_0x7199('0x61')](_0x1eebdd['path'])),function(){});return _0x1eebdd;})[_0x7199('0x27')](handleEntityNotFound(_0x35c848,null))[_0x7199('0x27')](respondWithStatusCode(_0x35c848,null))[_0x7199('0x4a')](handleError(_0x35c848,null));};exports[_0x7199('0x9c')]=function(_0xc3eb96,_0x5b2319,_0x5c2d4a){return BPromise[_0x7199('0x9d')]()[_0x7199('0x27')](function(){if(!_0xc3eb96[_0x7199('0x36')]['path']){throw new Error(_0x7199('0x9e'));}if(!_0xc3eb96[_0x7199('0x36')][_0x7199('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x21271a=_0xc3eb96['query']['hostname']?_0xc3eb96[_0x7199('0x36')][_0x7199('0xa0')]+':'+_0xc3eb96['query']['port']:_0x7199('0xa1')+_0xc3eb96['query'][_0x7199('0x9f')];var _0x2c6c8f=_0xc3eb96[_0x7199('0x36')][_0x7199('0x23')]?_0xc3eb96[_0x7199('0x36')][_0x7199('0x23')]:!![];var _0x46bb92=_0xc3eb96[_0x7199('0x36')][_0x7199('0xa2')]?_0xc3eb96[_0x7199('0x36')][_0x7199('0xa2')]:null;var _0x4166e6={'method':_0xc3eb96['method'],'uri':util['format'](_0x7199('0xa3'),_0x21271a,_0xc3eb96[_0x7199('0x36')]['path']),'json':_0x2c6c8f,'resolveWithFullResponse':!![],'encoding':_0x46bb92,'qs':_0xc3eb96[_0x7199('0x36')]};if(_0xc3eb96['headers']){_0x4166e6[_0x7199('0xa4')]=_0xc3eb96[_0x7199('0xa4')];if(_0x4166e6['headers']['content-length']){delete _0x4166e6['headers'][_0x7199('0xa5')];}}if(_0x4166e6[_0x7199('0xa4')][_0x7199('0xa6')]){delete _0x4166e6[_0x7199('0xa4')]['content-type'];}return rp(_0x4166e6);})[_0x7199('0x27')](function(_0x59c436){if(_0x59c436){_0x5b2319[_0x7199('0x21')](_0x59c436[_0x7199('0xa4')]);logger[_0x7199('0x69')](_0x59c436[_0x7199('0x94')]);if(_[_0x7199('0xa7')](_0xc3eb96[_0x7199('0x36')][_0x7199('0x50')],_0x7199('0x4f'))&&_0x59c436['statusCode']==0x1f4){return _0x5b2319[_0x7199('0x1a')](_0x59c436[_0x7199('0xa8')]);}else{return _0x5b2319[_0x7199('0x1b')](_0x59c436[_0x7199('0xa8')])[_0x7199('0x2f')](_0x59c436[_0x7199('0x94')]);}}else{return _0x5b2319[_0x7199('0x1a')](0xc8);}})[_0x7199('0x4a')](handleError(_0x5b2319,null));};exports[_0x7199('0xa9')]=function(_0x25a850,_0x2f0ddd,_0x2a0465){return BPromise[_0x7199('0x9d')]()['then'](function(){if(!_0x25a850[_0x7199('0x36')]['path']){throw new Error(_0x7199('0x9e'));}if(!_0x25a850['query'][_0x7199('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1d10cb=_0x25a850[_0x7199('0x36')][_0x7199('0xa0')]?_0x25a850[_0x7199('0x36')][_0x7199('0xa0')]+':'+_0x25a850[_0x7199('0x36')][_0x7199('0x9f')]:_0x7199('0xa1')+_0x25a850[_0x7199('0x36')]['port'];var _0x3b40d1=_0x25a850[_0x7199('0x36')][_0x7199('0x23')]?_0x25a850[_0x7199('0x36')][_0x7199('0x23')]:!![];var _0x19dd16=_0x25a850[_0x7199('0x36')][_0x7199('0xa2')]?_0x25a850[_0x7199('0x36')][_0x7199('0xa2')]:null;var _0x1e489c={'method':_0x25a850[_0x7199('0xaa')],'uri':util[_0x7199('0x54')](_0x7199('0xa3'),_0x1d10cb,_0x25a850[_0x7199('0x36')][_0x7199('0x50')]),'json':_0x3b40d1,'resolveWithFullResponse':!![],'encoding':_0x19dd16,'body':_0x25a850[_0x7199('0x94')]};if(_0x25a850[_0x7199('0xa4')]){_0x1e489c[_0x7199('0xa4')]=_0x25a850[_0x7199('0xa4')];if(_0x1e489c[_0x7199('0xa4')][_0x7199('0xa5')]){delete _0x1e489c[_0x7199('0xa4')][_0x7199('0xa5')];}}if(_0x1e489c[_0x7199('0xa4')]['content-type']){delete _0x1e489c[_0x7199('0xa4')][_0x7199('0xa6')];}return rp(_0x1e489c);})['then'](function(_0x5c7066){if(_0x5c7066){_0x2f0ddd[_0x7199('0x21')](_0x5c7066[_0x7199('0xa4')]);logger[_0x7199('0x69')](_0x5c7066[_0x7199('0x94')]);return _0x2f0ddd[_0x7199('0x1b')](_0x5c7066[_0x7199('0xa8')])['send'](_0x5c7066[_0x7199('0x94')]);}else{return _0x2f0ddd['sendStatus'](0xc8);}})['catch'](handleError(_0x2f0ddd,null));}; \ No newline at end of file +var _0x4e69=['papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','Plugins','error','name','send','map','Plugin','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','path','root','server/files/plugins','format','basename','createWriteStream','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','dirname','join','node_modules/**/*','attachments/**/*','finalize','existsSync','download','%s.zip','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','html','test','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','plugins','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0x4e69,0x1ee));var _0x94e6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x4e69[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0x94e6('0x0'));var rimraf=require(_0x94e6('0x1'));var zipdir=require(_0x94e6('0x2'));var jsonpatch=require(_0x94e6('0x3'));var rp=require(_0x94e6('0x4'));var moment=require(_0x94e6('0x5'));var BPromise=require(_0x94e6('0x6'));var Mustache=require(_0x94e6('0x7'));var util=require(_0x94e6('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x94e6('0x9'));var ejs=require(_0x94e6('0xa'));var fs=require('fs');var fs_extra=require(_0x94e6('0xb'));var _=require(_0x94e6('0xc'));var squel=require(_0x94e6('0xd'));var crypto=require('crypto');var jsforce=require(_0x94e6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x94e6('0x9'));var querystring=require(_0x94e6('0xf'));var Papa=require(_0x94e6('0x10'));var extract=require(_0x94e6('0x11'));var rimraf=require(_0x94e6('0x1'));var archiver=require(_0x94e6('0x12'));var Redis=require(_0x94e6('0x13'));var authService=require(_0x94e6('0x14'));var qs=require(_0x94e6('0x15'));var as=require(_0x94e6('0x16'));var hardwareService=require(_0x94e6('0x17'));var logger=require(_0x94e6('0x18'))(_0x94e6('0x19'));var utils=require(_0x94e6('0x1a'));var config=require(_0x94e6('0x1b'));var licenseUtil=require(_0x94e6('0x1c'));var db=require(_0x94e6('0x1d'))['db'];config['redis']=_['defaults'](config[_0x94e6('0x1e')],{'host':_0x94e6('0x1f'),'port':0x18eb});var socket=require(_0x94e6('0x20'))(new Redis(config[_0x94e6('0x1e')]));require(_0x94e6('0x21'))['register'](socket);function respondWithStatusCode(_0xc914f6,_0x1834ad){_0x1834ad=_0x1834ad||0xcc;return function(_0x886468){if(_0x886468){return _0xc914f6[_0x94e6('0x22')](_0x1834ad);}return _0xc914f6['status'](_0x1834ad)[_0x94e6('0x23')]();};}function respondWithResult(_0x6d226c,_0x2656a5){_0x2656a5=_0x2656a5||0xc8;return function(_0x305400){if(_0x305400){return _0x6d226c[_0x94e6('0x24')](_0x2656a5)[_0x94e6('0x25')](_0x305400);}};}function respondWithFilteredResult(_0x561124,_0x3b9c72){return function(_0x4b6dd7){if(_0x4b6dd7){var _0x3d49c2=typeof _0x3b9c72[_0x94e6('0x26')]===_0x94e6('0x27')&&typeof _0x3b9c72[_0x94e6('0x28')]===_0x94e6('0x27');var _0x599476=_0x4b6dd7[_0x94e6('0x29')];var _0x2944a4=_0x3d49c2?0x0:_0x3b9c72[_0x94e6('0x26')];var _0x43cf26=_0x3d49c2?_0x4b6dd7['count']:_0x3b9c72['offset']+_0x3b9c72[_0x94e6('0x28')];var _0x224731;if(_0x43cf26>=_0x599476){_0x43cf26=_0x599476;_0x224731=0xc8;}else{_0x224731=0xce;}_0x561124[_0x94e6('0x24')](_0x224731);return _0x561124[_0x94e6('0x2a')](_0x94e6('0x2b'),_0x2944a4+'-'+_0x43cf26+'/'+_0x599476)[_0x94e6('0x25')](_0x4b6dd7);}return null;};}function patchUpdates(_0x3375cc){return function(_0x3ad02f){try{jsonpatch['apply'](_0x3ad02f,_0x3375cc,!![]);}catch(_0x357414){return BPromise['reject'](_0x357414);}return _0x3ad02f[_0x94e6('0x2c')]();};}function saveUpdates(_0x2a909f,_0x1961d2){return function(_0x213d13){if(_0x213d13){return _0x213d13[_0x94e6('0x2d')](_0x2a909f)['then'](function(_0x59c35a){return _0x59c35a;});}return null;};}function removeEntity(_0x337543,_0x3b44b3){return function(_0x5100dd){if(_0x5100dd){return _0x5100dd[_0x94e6('0x2e')]()[_0x94e6('0x2f')](function(){var _0x103521=_0x5100dd['get']({'plain':!![]});var _0x3fce0e=_0x94e6('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x3fce0e,'resourceId':_0x103521['id']}})['then'](function(){return _0x5100dd;});})[_0x94e6('0x2f')](function(){_0x337543[_0x94e6('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b2bf1,_0x5b4de3){return function(_0x598282){if(!_0x598282){_0x4b2bf1[_0x94e6('0x22')](0x194);}return _0x598282;};}function handleError(_0x8913bc,_0x40961b){_0x40961b=_0x40961b||0x1f4;return function(_0x4e1d0f){logger[_0x94e6('0x31')](_0x4e1d0f['stack']);if(_0x4e1d0f[_0x94e6('0x32')]){delete _0x4e1d0f[_0x94e6('0x32')];}_0x8913bc['status'](_0x40961b)[_0x94e6('0x33')](_0x4e1d0f);};}exports['index']=function(_0x3f5203,_0x5ae2f5){var _0x541ad9={},_0x2160b6={},_0x36f174={'count':0x0,'rows':[]};var _0x122290=_[_0x94e6('0x34')](db[_0x94e6('0x35')][_0x94e6('0x36')],function(_0x5e3743){return{'name':_0x5e3743['fieldName'],'type':_0x5e3743[_0x94e6('0x37')][_0x94e6('0x38')]};});_0x2160b6['model']=_[_0x94e6('0x34')](_0x122290,'name');_0x2160b6[_0x94e6('0x39')]=_['keys'](_0x3f5203['query']);_0x2160b6['filters']=_[_0x94e6('0x3a')](_0x2160b6[_0x94e6('0x3b')],_0x2160b6[_0x94e6('0x39')]);_0x541ad9['attributes']=_['intersection'](_0x2160b6[_0x94e6('0x3b')],qs['fields'](_0x3f5203['query'][_0x94e6('0x3c')]));_0x541ad9[_0x94e6('0x3d')]=_0x541ad9[_0x94e6('0x3d')][_0x94e6('0x3e')]?_0x541ad9[_0x94e6('0x3d')]:_0x2160b6[_0x94e6('0x3b')];if(!_0x3f5203[_0x94e6('0x39')][_0x94e6('0x3f')](_0x94e6('0x40'))){_0x541ad9[_0x94e6('0x28')]=qs[_0x94e6('0x28')](_0x3f5203[_0x94e6('0x39')]['limit']);_0x541ad9['offset']=qs[_0x94e6('0x26')](_0x3f5203[_0x94e6('0x39')]['offset']);}_0x541ad9[_0x94e6('0x41')]=qs['sort'](_0x3f5203[_0x94e6('0x39')][_0x94e6('0x42')]);_0x541ad9['where']=qs[_0x94e6('0x43')](_[_0x94e6('0x44')](_0x3f5203['query'],_0x2160b6[_0x94e6('0x43')]),_0x122290);if(_0x3f5203[_0x94e6('0x39')][_0x94e6('0x45')]){_0x541ad9[_0x94e6('0x46')]=_[_0x94e6('0x47')](_0x541ad9['where'],{'$or':_[_0x94e6('0x34')](_0x122290,function(_0x199de4){if(_0x199de4[_0x94e6('0x37')]!==_0x94e6('0x48')){var _0x202db3={};_0x202db3[_0x199de4[_0x94e6('0x32')]]={'$like':'%'+_0x3f5203[_0x94e6('0x39')][_0x94e6('0x45')]+'%'};return _0x202db3;}})});}_0x541ad9=_['merge']({},_0x541ad9,_0x3f5203[_0x94e6('0x49')]);var _0x53bd6e={'where':_0x541ad9['where']};return db[_0x94e6('0x35')][_0x94e6('0x29')](_0x53bd6e)[_0x94e6('0x2f')](function(_0x382ead){_0x36f174['count']=_0x382ead;if(_0x3f5203['query'][_0x94e6('0x4a')]){_0x541ad9[_0x94e6('0x4b')]=[{'all':!![]}];}return db[_0x94e6('0x35')][_0x94e6('0x4c')](_0x541ad9);})[_0x94e6('0x2f')](function(_0x1f79e7){_0x36f174[_0x94e6('0x4d')]=_0x1f79e7;return _0x36f174;})[_0x94e6('0x2f')](respondWithFilteredResult(_0x5ae2f5,_0x541ad9))[_0x94e6('0x4e')](handleError(_0x5ae2f5,null));};exports[_0x94e6('0x4f')]=function(_0xa1b3ab,_0x44c43f){var _0x5282cc={'raw':!![],'where':{'id':_0xa1b3ab[_0x94e6('0x50')]['id']}},_0x4e7572={};_0x4e7572[_0x94e6('0x3b')]=_[_0x94e6('0x51')](db[_0x94e6('0x35')]['rawAttributes']);_0x4e7572[_0x94e6('0x39')]=_['keys'](_0xa1b3ab[_0x94e6('0x39')]);_0x4e7572[_0x94e6('0x43')]=_[_0x94e6('0x3a')](_0x4e7572['model'],_0x4e7572[_0x94e6('0x39')]);_0x5282cc[_0x94e6('0x3d')]=_['intersection'](_0x4e7572[_0x94e6('0x3b')],qs[_0x94e6('0x3c')](_0xa1b3ab['query'][_0x94e6('0x3c')]));_0x5282cc[_0x94e6('0x3d')]=_0x5282cc['attributes'][_0x94e6('0x3e')]?_0x5282cc[_0x94e6('0x3d')]:_0x4e7572[_0x94e6('0x3b')];if(_0xa1b3ab[_0x94e6('0x39')]['includeAll']){_0x5282cc[_0x94e6('0x4b')]=[{'all':!![]}];}_0x5282cc=_[_0x94e6('0x47')]({},_0x5282cc,_0xa1b3ab[_0x94e6('0x49')]);return db[_0x94e6('0x35')][_0x94e6('0x52')](_0x5282cc)[_0x94e6('0x2f')](handleEntityNotFound(_0x44c43f,null))[_0x94e6('0x2f')](respondWithResult(_0x44c43f,null))[_0x94e6('0x4e')](handleError(_0x44c43f,null));};exports['download']=function(_0x16fca2,_0x2e0617,_0x12ed68){return db[_0x94e6('0x35')][_0x94e6('0x52')]({'where':{'id':_0x16fca2['params']['id']},'attributes':[_0x94e6('0x32'),_0x94e6('0x53')],'raw':!![]})[_0x94e6('0x2f')](handleEntityNotFound(_0x2e0617,null))[_0x94e6('0x2f')](function(_0x5b2346){if(_0x5b2346){var _0x5f3777=path['join'](config[_0x94e6('0x54')],_0x94e6('0x55'),util[_0x94e6('0x56')]('%s.zip',path[_0x94e6('0x57')](_0x5b2346[_0x94e6('0x53')])));var _0x4e70d7=fs[_0x94e6('0x58')](_0x5f3777);var _0xc1d366=archiver('zip',{'zlib':{'level':0x9}});_0xc1d366['on']('warning',function(_0x3aac7c){if(_0x3aac7c['code']===_0x94e6('0x59')){logger[_0x94e6('0x31')](_0x3aac7c);}else{throw new db[(_0x94e6('0x5a'))][(_0x94e6('0x5b'))](_0x94e6('0x5c'));}});_0xc1d366['on']('error',function(_0x150fa1){throw new db[(_0x94e6('0x5a'))][(_0x94e6('0x5b'))](_0x94e6('0x5c'));});_0xc1d366[_0x94e6('0x5d')](_0x4e70d7);_0xc1d366['glob']('**/*',{'cwd':path['join'](config[_0x94e6('0x54')],_0x94e6('0x55'),path[_0x94e6('0x5e')](_0x5b2346[_0x94e6('0x53')])),'ignore':[path[_0x94e6('0x5f')](path[_0x94e6('0x57')](_0x5b2346['path']),_0x94e6('0x60')),path[_0x94e6('0x5f')](path[_0x94e6('0x57')](_0x5b2346['path']),_0x94e6('0x61'))],'nodir':!![]})[_0x94e6('0x62')]();_0x4e70d7['on']('close',function(){if(!fs[_0x94e6('0x63')](_0x5f3777)){throw new db[(_0x94e6('0x5a'))][(_0x94e6('0x5b'))]('Plugin\x20not\x20found');}return _0x2e0617[_0x94e6('0x64')](_0x5f3777,util[_0x94e6('0x56')](_0x94e6('0x65'),path[_0x94e6('0x57')](_0x5b2346[_0x94e6('0x53')])),function(_0x3ff52a){if(_0x3ff52a){throw new db[(_0x94e6('0x5a'))][(_0x94e6('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x94e6('0x66')](_0x5f3777);logger[_0x94e6('0x67')](_0x94e6('0x68'));logger[_0x94e6('0x67')](_0x94e6('0x69'));});});}return null;})['catch'](handleError(_0x2e0617,null));};exports[_0x94e6('0x6a')]=function(_0x57ecb2,_0x1b8a4f,_0x134dca){var _0x1f69b1=path[_0x94e6('0x57')](_0x57ecb2[_0x94e6('0x6b')][_0x94e6('0x6c')],path['extname'](_0x57ecb2['file'][_0x94e6('0x6c')]));var _0x239326=path[_0x94e6('0x5f')](config[_0x94e6('0x54')],_0x94e6('0x55'),_0x57ecb2[_0x94e6('0x6b')][_0x94e6('0x6c')]);var _0xd7de14=path[_0x94e6('0x5f')](config[_0x94e6('0x54')],_0x94e6('0x55'),_0x1f69b1);logger[_0x94e6('0x67')](_0x94e6('0x6d'),_0x239326);logger[_0x94e6('0x67')](_0x94e6('0x6e'),_0xd7de14);try{fs[_0x94e6('0x6f')](_0x239326,parseInt(_0x94e6('0x70'),0x8));extract(_0x239326,{'dir':_0xd7de14},function(_0x4b5def){if(_0x4b5def){logger[_0x94e6('0x31')](_0x4b5def);handleError(_0x4b5def,!![]);};var _0x529df3=fs['readdirSync'](_0xd7de14);if(_0x529df3[_0x94e6('0x3e')]>0x1){removeReferences(_0x239326,_0xd7de14);logger[_0x94e6('0x31')](_0x94e6('0x71'));return _0x134dca(new Error(_0x94e6('0x71')));}var _0x3888ee=fs[_0x94e6('0x72')](path[_0x94e6('0x5f')](_0xd7de14,_0x529df3[0x0]));if(_0x3888ee['isFile']()){removeReferences(_0x239326,_0xd7de14);logger[_0x94e6('0x31')]('Invalid\x20plugin\x20structure');return _0x134dca(new Error(_0x94e6('0x71')));}if(_0x3888ee[_0x94e6('0x73')]()){var _0x9f5155=fs[_0x94e6('0x74')](path[_0x94e6('0x5f')](_0xd7de14,_0x529df3[0x0]));if(_0x9f5155[_0x94e6('0x3e')]===0x0){removeReferences(_0x239326,_0xd7de14);logger[_0x94e6('0x31')](_0x94e6('0x71'));return _0x134dca(new Error(_0x94e6('0x71')));}var _0x17ad39=_0x9f5155[_0x94e6('0x75')](function(_0x471e13){return _0x471e13===_0x94e6('0x76');});if(!_0x17ad39){return _0x134dca(new Error(_0x94e6('0x77')));}var _0xd2519d=fs['readFileSync'](path[_0x94e6('0x5f')](_0xd7de14,_0x529df3[0x0],_0x94e6('0x76')));var _0x4f2b28=JSON[_0x94e6('0x78')](_0xd2519d);if(_0x94e6('0x27')==typeof _0x4f2b28['name']){return _0x134dca(new Error(_0x94e6('0x79')));}if('undefined'==typeof _0x4f2b28['type']){return _0x134dca(new Error(_0x94e6('0x7a')));}if(_0x94e6('0x27')==typeof _0x4f2b28[_0x94e6('0x7b')]){return _0x134dca(new Error(_0x94e6('0x7c')));}if(_0x94e6('0x27')==typeof _0x4f2b28[_0x94e6('0x7d')]){return _0x134dca(new Error(_0x94e6('0x7e')));}if(_0x4f2b28[_0x94e6('0x37')]==='html'){if(_0x94e6('0x27')==typeof _0x4f2b28[_0x94e6('0x7d')]['views']){return _0x134dca(new Error(_0x94e6('0x7f')));}if(_0x94e6('0x27')==typeof _0x4f2b28[_0x94e6('0x7d')][_0x94e6('0x80')][_0x94e6('0x81')]&&_0x94e6('0x27')==typeof _0x4f2b28[_0x94e6('0x7d')]['views'][_0x94e6('0x82')]){return _0x134dca(new Error(_0x94e6('0x83')));}}else if(_0x4f2b28[_0x94e6('0x37')]==='script'){if(_0x94e6('0x27')==typeof _0x4f2b28[_0x94e6('0x7d')][_0x94e6('0x84')]){return _0x134dca(new Error(_0x94e6('0x85')));}if('undefined'==typeof _0x4f2b28['parameters'][_0x94e6('0x86')]){return _0x134dca(new Error(_0x94e6('0x87')));}}else{return _0x134dca(new Error(_0x94e6('0x88')));}var _0x429428=_0x4f2b28[_0x94e6('0x32')];var _0x2a1c88=_0x4f2b28['description'];var _0x47afcc=_0x4f2b28[_0x94e6('0x37')];var _0x4d655b=_0x4f2b28[_0x94e6('0x89')]?_0x4f2b28[_0x94e6('0x89')]:_0x94e6('0x8a');var _0x431166=_0x4f2b28[_0x94e6('0x8b')]?_0x4f2b28[_0x94e6('0x8b')]:_0x94e6('0x8c');var _0x4f9618='';var _0x4de1c9='';var _0x5e55b6='';var _0x4e2d45='';var _0x2eac5c=_0x4f2b28[_0x94e6('0x7b')];if(_0x47afcc===_0x94e6('0x8d')){if(_0x94e6('0x27')!=typeof _0x4f2b28['parameters'][_0x94e6('0x80')]['admin']){var _0x394fb7=_0x4f2b28['parameters'][_0x94e6('0x80')][_0x94e6('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x94e6('0x8e')](_0x394fb7)){_0x4f9618=path[_0x94e6('0x5f')]('plugins',_0x1f69b1,_0x529df3[0x0],_0x394fb7);}else{_0x4f9618=_0x394fb7;}}else{logger[_0x94e6('0x67')](_0x94e6('0x8f'));}if(_0x94e6('0x27')!=typeof _0x4f2b28[_0x94e6('0x7d')]['views'][_0x94e6('0x82')]){var _0x82a9ab=_0x4f2b28[_0x94e6('0x7d')][_0x94e6('0x80')][_0x94e6('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x94e6('0x8e')](_0x82a9ab)){_0x4de1c9=path['join']('plugins',_0x1f69b1,_0x529df3[0x0],_0x82a9ab);}else{_0x4de1c9=_0x82a9ab;}}else{logger[_0x94e6('0x67')](_0x94e6('0x90'));}}else if(_0x47afcc===_0x94e6('0x91')){_0x5e55b6=_0x4f2b28['parameters'][_0x94e6('0x84')];_0x4e2d45=_0x4f2b28[_0x94e6('0x7d')][_0x94e6('0x86')];if(_0x94e6('0x27')!=typeof _0x4f2b28[_0x94e6('0x7d')][_0x94e6('0x80')]){if('undefined'!=typeof _0x4f2b28['parameters'][_0x94e6('0x80')]['admin']){var _0x394fb7=_0x4f2b28[_0x94e6('0x7d')][_0x94e6('0x80')][_0x94e6('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x94e6('0x8e')](_0x394fb7)){_0x4f9618=path['join'](_0x94e6('0x92'),_0x1f69b1,_0x529df3[0x0],_0x394fb7);}else{_0x4f9618=_0x394fb7;}}if(_0x94e6('0x27')!=typeof _0x4f2b28[_0x94e6('0x7d')]['views'][_0x94e6('0x82')]){var _0x82a9ab=_0x4f2b28['parameters'][_0x94e6('0x80')][_0x94e6('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x82a9ab)){_0x4de1c9=path[_0x94e6('0x5f')](_0x94e6('0x92'),_0x1f69b1,_0x529df3[0x0],_0x82a9ab);}else{_0x4de1c9=_0x82a9ab;}}}}var _0x4818b3={'name':_0x429428,'description':_0x2a1c88,'path':path[_0x94e6('0x5f')](_0x1f69b1,_0x529df3[0x0]),'type':_0x47afcc,'sidebar':_0x4d655b,'icon':_0x431166,'adminUrl':_0x4f9618,'agentUrl':_0x4de1c9,'scriptName':_0x5e55b6,'scriptPath':_0x4e2d45,'version':_0x2eac5c};removeReferences(_0x239326,null);return db[_0x94e6('0x35')][_0x94e6('0x93')](_0x4818b3)[_0x94e6('0x2f')](function(_0x1b9c96){var _0x583294={'role':_0x57ecb2[_0x94e6('0x94')]['role'],'userProfileId':_0x57ecb2[_0x94e6('0x94')][_0x94e6('0x95')]};if(!_0x583294)throw new Error(_0x94e6('0x96'));if(_0x583294['role']==='user'){var _0xc4baae=_0x1b9c96[_0x94e6('0x97')]({'plain':!![]});return db['UserProfileSection'][_0x94e6('0x52')]({'where':{'name':_0x94e6('0x30'),'userProfileId':_0x583294[_0x94e6('0x95')]},'raw':!![]})[_0x94e6('0x2f')](function(_0x524006){if(_0x524006&&_0x524006['autoAssociation']===0x0){return db[_0x94e6('0x98')][_0x94e6('0x93')]({'name':_0xc4baae[_0x94e6('0x32')],'resourceId':_0xc4baae['id'],'type':_0x524006[_0x94e6('0x32')],'sectionId':_0x524006['id']},{})[_0x94e6('0x2f')](function(){return _0x1b9c96;});}else{return _0x1b9c96;}})['catch'](function(_0x278fe5){logger[_0x94e6('0x31')](_0x94e6('0x99'),_0x278fe5);throw _0x278fe5;});}return _0x1b9c96;})['then'](respondWithResult(_0x1b8a4f,null))[_0x94e6('0x4e')](handleError(_0x1b8a4f,null));}});}catch(_0x13a367){_0x1b8a4f['status'](0x1f4)['send'](_0x13a367);}};function removeReferences(_0x56ddd8,_0x562f2c){try{if(_0x56ddd8){fs[_0x94e6('0x66')](_0x56ddd8);logger[_0x94e6('0x67')](_0x94e6('0x9a'));}if(_0x562f2c){rimraf(_0x562f2c,function(){});logger[_0x94e6('0x67')](_0x94e6('0x9b'));}}catch(_0x4c1de9){logger[_0x94e6('0x31')](_0x4c1de9);}}exports['update']=function(_0x4e2d5f,_0x4b75e2,_0x2a5032){return db['Plugin'][_0x94e6('0x52')]({'where':{'id':_0x4e2d5f[_0x94e6('0x50')]['id']}})[_0x94e6('0x2f')](handleEntityNotFound(_0x4b75e2,null))['then'](saveUpdates(_0x4e2d5f[_0x94e6('0x94')],null))[_0x94e6('0x2f')](respondWithResult(_0x4b75e2,null))[_0x94e6('0x4e')](handleError(_0x4b75e2,null));};exports['delete']=function(_0x14c6b0,_0x1ba317,_0x5411d0){return db[_0x94e6('0x35')][_0x94e6('0x52')]({'where':{'id':_0x14c6b0[_0x94e6('0x50')]['id']}})[_0x94e6('0x2f')](function(_0x4888c4){if(_0x4888c4){return _0x4888c4[_0x94e6('0x2e')]();}})['then'](function(_0x3a5d59){rimraf(path['join'](config['root'],_0x94e6('0x55'),path[_0x94e6('0x5e')](_0x3a5d59[_0x94e6('0x53')])),function(){});return _0x3a5d59;})[_0x94e6('0x2f')](handleEntityNotFound(_0x1ba317,null))[_0x94e6('0x2f')](respondWithStatusCode(_0x1ba317,null))[_0x94e6('0x4e')](handleError(_0x1ba317,null));};exports['webhookGet']=function(_0x2ff771,_0x5d7f13,_0x4709e3){return BPromise[_0x94e6('0x9c')]()['then'](function(){if(!_0x2ff771['query'][_0x94e6('0x53')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2ff771[_0x94e6('0x39')][_0x94e6('0x9d')]){throw new Error(_0x94e6('0x9e'));}var _0x5ce646=_0x2ff771[_0x94e6('0x39')]['hostname']?_0x2ff771[_0x94e6('0x39')][_0x94e6('0x9f')]+':'+_0x2ff771[_0x94e6('0x39')][_0x94e6('0x9d')]:_0x94e6('0xa0')+_0x2ff771['query'][_0x94e6('0x9d')];var _0x54fe76=_0x2ff771[_0x94e6('0x39')][_0x94e6('0x25')]?_0x2ff771[_0x94e6('0x39')][_0x94e6('0x25')]:!![];var _0x57ca34=_0x2ff771['query'][_0x94e6('0xa1')]?_0x2ff771[_0x94e6('0x39')]['encoding']:null;var _0xa8c1ff={'method':_0x2ff771[_0x94e6('0xa2')],'uri':util[_0x94e6('0x56')]('%s%s',_0x5ce646,_0x2ff771['query'][_0x94e6('0x53')]),'json':_0x54fe76,'resolveWithFullResponse':!![],'encoding':_0x57ca34,'qs':_0x2ff771[_0x94e6('0x39')]};if(_0x2ff771[_0x94e6('0xa3')]){_0xa8c1ff['headers']=_0x2ff771[_0x94e6('0xa3')];if(_0xa8c1ff[_0x94e6('0xa3')][_0x94e6('0xa4')]){delete _0xa8c1ff[_0x94e6('0xa3')][_0x94e6('0xa4')];}}if(_0xa8c1ff[_0x94e6('0xa3')][_0x94e6('0xa5')]){delete _0xa8c1ff[_0x94e6('0xa3')][_0x94e6('0xa5')];}return rp(_0xa8c1ff);})[_0x94e6('0x2f')](function(_0x4945a6){if(_0x4945a6){_0x5d7f13[_0x94e6('0x2a')](_0x4945a6[_0x94e6('0xa3')]);logger[_0x94e6('0x67')](_0x4945a6[_0x94e6('0x94')]);if(_['endsWith'](_0x2ff771['query'][_0x94e6('0x53')],_0x94e6('0x64'))&&_0x4945a6[_0x94e6('0xa6')]==0x1f4){return _0x5d7f13[_0x94e6('0x22')](_0x4945a6[_0x94e6('0xa6')]);}else{return _0x5d7f13[_0x94e6('0x24')](_0x4945a6[_0x94e6('0xa6')])[_0x94e6('0x33')](_0x4945a6[_0x94e6('0x94')]);}}else{return _0x5d7f13[_0x94e6('0x22')](0xc8);}})[_0x94e6('0x4e')](handleError(_0x5d7f13,null));};exports[_0x94e6('0xa7')]=function(_0x5ebc28,_0x4a42ca,_0x2a7664){return BPromise['resolve']()['then'](function(){if(!_0x5ebc28[_0x94e6('0x39')][_0x94e6('0x53')]){throw new Error(_0x94e6('0xa8'));}if(!_0x5ebc28[_0x94e6('0x39')][_0x94e6('0x9d')]){throw new Error(_0x94e6('0x9e'));}var _0x13d1b5=_0x5ebc28[_0x94e6('0x39')][_0x94e6('0x9f')]?_0x5ebc28[_0x94e6('0x39')][_0x94e6('0x9f')]+':'+_0x5ebc28[_0x94e6('0x39')][_0x94e6('0x9d')]:_0x94e6('0xa0')+_0x5ebc28[_0x94e6('0x39')][_0x94e6('0x9d')];var _0x32d48f=_0x5ebc28['query']['json']?_0x5ebc28[_0x94e6('0x39')][_0x94e6('0x25')]:!![];var _0x11a7f3=_0x5ebc28[_0x94e6('0x39')][_0x94e6('0xa1')]?_0x5ebc28[_0x94e6('0x39')]['encoding']:null;var _0x70b799={'method':_0x5ebc28[_0x94e6('0xa2')],'uri':util[_0x94e6('0x56')](_0x94e6('0xa9'),_0x13d1b5,_0x5ebc28[_0x94e6('0x39')][_0x94e6('0x53')]),'json':_0x32d48f,'resolveWithFullResponse':!![],'encoding':_0x11a7f3,'body':_0x5ebc28[_0x94e6('0x94')]};if(_0x5ebc28['headers']){_0x70b799[_0x94e6('0xa3')]=_0x5ebc28[_0x94e6('0xa3')];if(_0x70b799[_0x94e6('0xa3')][_0x94e6('0xa4')]){delete _0x70b799[_0x94e6('0xa3')][_0x94e6('0xa4')];}}if(_0x70b799[_0x94e6('0xa3')][_0x94e6('0xa5')]){delete _0x70b799[_0x94e6('0xa3')][_0x94e6('0xa5')];}return rp(_0x70b799);})[_0x94e6('0x2f')](function(_0x17b0f3){if(_0x17b0f3){_0x4a42ca['set'](_0x17b0f3[_0x94e6('0xa3')]);logger[_0x94e6('0x67')](_0x17b0f3[_0x94e6('0x94')]);return _0x4a42ca[_0x94e6('0x24')](_0x17b0f3[_0x94e6('0xa6')])['send'](_0x17b0f3[_0x94e6('0x94')]);}else{return _0x4a42ca['sendStatus'](0xc8);}})[_0x94e6('0x4e')](handleError(_0x4a42ca,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 813ad66..1810fbc 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 _0x6bb4=['update','emit','exports','events','../../mysqldb','Plugin','save'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x33f12d,_0x25b899){_0x33f12d=_0x33f12d-0x0;var _0x5bb00f=_0x6bb4[_0x33f12d];return _0x5bb00f;};'use strict';var EventEmitter=require(_0x46bb('0x0'));var Plugin=require(_0x46bb('0x1'))['db'][_0x46bb('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x46bb('0x3'),'afterUpdate':_0x46bb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x74054){return function(_0x100be2,_0x2eefcc,_0x3c8bef){PluginEvents[_0x46bb('0x5')](_0x74054+':'+_0x100be2['id'],_0x100be2);PluginEvents[_0x46bb('0x5')](_0x74054,_0x100be2);_0x3c8bef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x46bb('0x6')]=PluginEvents; \ No newline at end of file +var _0x16d8=['hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0x4ab5a9,_0x2e42ca){var _0x261ac8=function(_0x3b8f50){while(--_0x3b8f50){_0x4ab5a9['push'](_0x4ab5a9['shift']());}};_0x261ac8(++_0x2e42ca);}(_0x16d8,0xa3));var _0x816d=function(_0x12d625,_0x5ca47d){_0x12d625=_0x12d625-0x0;var _0x3c3e1c=_0x16d8[_0x12d625];return _0x3c3e1c;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x816d('0x0'))['db'][_0x816d('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x816d('0x2')](0x0);var events={'afterCreate':_0x816d('0x3'),'afterUpdate':_0x816d('0x4'),'afterDestroy':_0x816d('0x5')};function emitEvent(_0x24b6d0){return function(_0x2c491b,_0x29b15c,_0x4fb0f2){PluginEvents[_0x816d('0x6')](_0x24b6d0+':'+_0x2c491b['id'],_0x2c491b);PluginEvents['emit'](_0x24b6d0,_0x2c491b);_0x4fb0f2(null);};}for(var e in events){if(events[_0x816d('0x7')](e)){var event=events[e];Plugin[_0x816d('0x8')](e,emitEvent(event));}}module[_0x816d('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 6010c3d..feb816e 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 _0xacd0=['Plugin','lodash','util','../../config/logger','moment','request-promise','rimraf','./plugin.attributes','exports','define'];(function(_0x3d30fc,_0x3f2e9e){var _0x233d4a=function(_0xe538cb){while(--_0xe538cb){_0x3d30fc['push'](_0x3d30fc['shift']());}};_0x233d4a(++_0x3f2e9e);}(_0xacd0,0xc9));var _0x0acd=function(_0x4d692a,_0x5c1506){_0x4d692a=_0x4d692a-0x0;var _0x9ef565=_0xacd0[_0x4d692a];return _0x9ef565;};'use strict';var _=require(_0x0acd('0x0'));var util=require(_0x0acd('0x1'));var logger=require(_0x0acd('0x2'))('api');var moment=require(_0x0acd('0x3'));var BPromise=require('bluebird');var rp=require(_0x0acd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0acd('0x5'));var config=require('../../config/environment');var attributes=require(_0x0acd('0x6'));module[_0x0acd('0x7')]=function(_0x46ed23,_0x3a5b39){return _0x46ed23[_0x0acd('0x8')](_0x0acd('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd53a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd53a,0x14e));var _0xad53=function(_0x5d5e21,_0x118344){_0x5d5e21=_0x5d5e21-0x0;var _0x9a33fd=_0xd53a[_0x5d5e21];return _0x9a33fd;};'use strict';var _=require(_0xad53('0x0'));var util=require(_0xad53('0x1'));var logger=require(_0xad53('0x2'))('api');var moment=require(_0xad53('0x3'));var BPromise=require(_0xad53('0x4'));var rp=require(_0xad53('0x5'));var fs=require('fs');var path=require(_0xad53('0x6'));var rimraf=require(_0xad53('0x7'));var config=require(_0xad53('0x8'));var attributes=require(_0xad53('0x9'));module[_0xad53('0xa')]=function(_0x384211,_0x1cceca){return _0x384211[_0xad53('0xb')](_0xad53('0xc'),attributes,{'tableName':_0xad53('0xd'),'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 d4ab9be..08fb917 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 _0x2f91=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','debug','lodash','util','moment'];(function(_0xaeedf9,_0x2832a5){var _0x3f1174=function(_0x271a9d){while(--_0x271a9d){_0xaeedf9['push'](_0xaeedf9['shift']());}};_0x3f1174(++_0x2832a5);}(_0x2f91,0xdd));var _0x12f9=function(_0x338775,_0x18d242){_0x338775=_0x338775-0x0;var _0x41394d=_0x2f91[_0x338775];return _0x41394d;};'use strict';var _=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var moment=require(_0x12f9('0x2'));var BPromise=require(_0x12f9('0x3'));var rs=require(_0x12f9('0x4'));var fs=require('fs');var Redis=require(_0x12f9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x12f9('0x6'))(_0x12f9('0x7'));var config=require(_0x12f9('0x8'));var jayson=require(_0x12f9('0x9'));var client=jayson['client'][_0x12f9('0xa')]({'port':0x232a});config[_0x12f9('0xb')]=_['defaults'](config[_0x12f9('0xb')],{'host':_0x12f9('0xc'),'port':0x18eb});var socket=require(_0x12f9('0xd'))(new Redis(config[_0x12f9('0xb')]));require('./plugin.socket')[_0x12f9('0xe')](socket);function respondWithRpcPromise(_0x1626f3,_0x2f8f18,_0x4d63ce){return new BPromise(function(_0x10df69,_0x4dd2b5){return client[_0x12f9('0xf')](_0x1626f3,_0x4d63ce)[_0x12f9('0x10')](function(_0xe5a6fc){logger['info'](_0x12f9('0x11'),_0x2f8f18,'request\x20sent');logger['debug'](_0x12f9('0x12'),_0x2f8f18,_0x12f9('0x13'),JSON['stringify'](_0xe5a6fc));if(_0xe5a6fc[_0x12f9('0x14')]){if(_0xe5a6fc[_0x12f9('0x14')][_0x12f9('0x15')]===0x1f4){logger[_0x12f9('0x14')](_0x12f9('0x11'),_0x2f8f18,_0xe5a6fc[_0x12f9('0x14')]['message']);return _0x4dd2b5(_0xe5a6fc[_0x12f9('0x14')][_0x12f9('0x16')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x2f8f18,_0xe5a6fc[_0x12f9('0x14')]['message']);return _0x10df69(_0xe5a6fc[_0x12f9('0x14')][_0x12f9('0x16')]);}else{logger['info'](_0x12f9('0x11'),_0x2f8f18,_0x12f9('0x13'));_0x10df69(_0xe5a6fc[_0x12f9('0x17')][_0x12f9('0x16')]);}})[_0x12f9('0x18')](function(_0x48441a){logger['error'](_0x12f9('0x11'),_0x2f8f18,_0x48441a);_0x4dd2b5(_0x48441a);});});}exports[_0x12f9('0x19')]=function(_0x549373){var _0x2f331e=this;return new Promise(function(_0x294b5b,_0xd69363){return db[_0x12f9('0x1a')][_0x12f9('0x1b')](_0x549373[_0x12f9('0x1c')],{'raw':_0x549373[_0x12f9('0x1d')]?_0x549373['options'][_0x12f9('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1bc018){logger['info'](_0x12f9('0x19'),_0x549373);logger[_0x12f9('0x1f')]('CreatePlugin',_0x549373,JSON['stringify'](_0x1bc018));_0x294b5b(_0x1bc018);})[_0x12f9('0x18')](function(_0x55ef0a){logger[_0x12f9('0x14')](_0x12f9('0x19'),_0x55ef0a[_0x12f9('0x16')],_0x549373);_0xd69363(_0x2f331e[_0x12f9('0x14')](0x1f4,_0x55ef0a['message']));});});}; \ No newline at end of file +var _0x5e6c=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','create','body','raw','then','util','moment','randomstring','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x1382d5,_0x3728e6){_0x1382d5=_0x1382d5-0x0;var _0x3b9509=_0x5e6c[_0x1382d5];return _0x3b9509;};'use strict';var _=require('lodash');var util=require(_0xc5e6('0x0'));var moment=require(_0xc5e6('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5e6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc5e6('0x3'))(_0xc5e6('0x4'));var config=require('../../config/environment');var jayson=require(_0xc5e6('0x5'));var client=jayson['client'][_0xc5e6('0x6')]({'port':0x232a});config[_0xc5e6('0x7')]=_['defaults'](config[_0xc5e6('0x7')],{'host':_0xc5e6('0x8'),'port':0x18eb});var socket=require(_0xc5e6('0x9'))(new Redis(config[_0xc5e6('0x7')]));require(_0xc5e6('0xa'))[_0xc5e6('0xb')](socket);function respondWithRpcPromise(_0x4671af,_0x58e76a,_0x5e601a){return new BPromise(function(_0x3f25f7,_0x5477be){return client[_0xc5e6('0xc')](_0x4671af,_0x5e601a)['then'](function(_0x5da247){logger[_0xc5e6('0xd')](_0xc5e6('0xe'),_0x58e76a,_0xc5e6('0xf'));logger[_0xc5e6('0x10')](_0xc5e6('0x11'),_0x58e76a,_0xc5e6('0xf'),JSON[_0xc5e6('0x12')](_0x5da247));if(_0x5da247[_0xc5e6('0x13')]){if(_0x5da247[_0xc5e6('0x13')][_0xc5e6('0x14')]===0x1f4){logger[_0xc5e6('0x13')](_0xc5e6('0xe'),_0x58e76a,_0x5da247[_0xc5e6('0x13')][_0xc5e6('0x15')]);return _0x5477be(_0x5da247[_0xc5e6('0x13')][_0xc5e6('0x15')]);}logger['error'](_0xc5e6('0xe'),_0x58e76a,_0x5da247['error'][_0xc5e6('0x15')]);return _0x3f25f7(_0x5da247[_0xc5e6('0x13')][_0xc5e6('0x15')]);}else{logger[_0xc5e6('0xd')](_0xc5e6('0xe'),_0x58e76a,_0xc5e6('0xf'));_0x3f25f7(_0x5da247[_0xc5e6('0x16')]['message']);}})[_0xc5e6('0x17')](function(_0x1f671f){logger[_0xc5e6('0x13')](_0xc5e6('0xe'),_0x58e76a,_0x1f671f);_0x5477be(_0x1f671f);});});}exports[_0xc5e6('0x18')]=function(_0xeb472b){var _0x40a24d=this;return new Promise(function(_0x599e80,_0x4a3e66){return db['Plugin'][_0xc5e6('0x19')](_0xeb472b[_0xc5e6('0x1a')],{'raw':_0xeb472b['options']?_0xeb472b['options'][_0xc5e6('0x1b')]===undefined?!![]:![]:!![]})[_0xc5e6('0x1c')](function(_0x4528a1){logger[_0xc5e6('0xd')]('CreatePlugin',_0xeb472b);logger[_0xc5e6('0x10')](_0xc5e6('0x18'),_0xeb472b,JSON[_0xc5e6('0x12')](_0x4528a1));_0x599e80(_0x4528a1);})[_0xc5e6('0x17')](function(_0xf1d750){logger[_0xc5e6('0x13')](_0xc5e6('0x18'),_0xf1d750[_0xc5e6('0x15')],_0xeb472b);_0x4a3e66(_0x40a24d['error'](0x1f4,_0xf1d750['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 6b1c88d..c3fee91 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 _0xf9c5=['emit','removeListener','length','plugin:','./plugin.events','save','remove','update'];(function(_0x5a6997,_0x284ce3){var _0x59aa09=function(_0xb6ab87){while(--_0xb6ab87){_0x5a6997['push'](_0x5a6997['shift']());}};_0x59aa09(++_0x284ce3);}(_0xf9c5,0x104));var _0x5f9c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xf9c5[_0x2070da];return _0x4f9fe1;};'use strict';var PluginEvents=require(_0x5f9c('0x0'));var events=[_0x5f9c('0x1'),_0x5f9c('0x2'),_0x5f9c('0x3')];function createListener(_0x3d0a07,_0x581399){return function(_0x178dae){_0x581399[_0x5f9c('0x4')](_0x3d0a07,_0x178dae);};}function removeListener(_0x24b9b6,_0x1d7fc4){return function(){PluginEvents[_0x5f9c('0x5')](_0x24b9b6,_0x1d7fc4);};}exports['register']=function(_0x268629){for(var _0xfa633b=0x0,_0x5517f6=events[_0x5f9c('0x6')];_0xfa633b<_0x5517f6;_0xfa633b++){var _0x447a6d=events[_0xfa633b];var _0x326eec=createListener(_0x5f9c('0x7')+_0x447a6d,_0x268629);PluginEvents['on'](_0x447a6d,_0x326eec);}}; \ No newline at end of file +var _0xa5ee=['update','emit','removeListener','register','length','plugin:','./plugin.events','save','remove'];(function(_0x1c3b41,_0x50f776){var _0x41e3fe=function(_0x512069){while(--_0x512069){_0x1c3b41['push'](_0x1c3b41['shift']());}};_0x41e3fe(++_0x50f776);}(_0xa5ee,0x189));var _0xea5e=function(_0x3afa76,_0xd7ee5a){_0x3afa76=_0x3afa76-0x0;var _0x3962fc=_0xa5ee[_0x3afa76];return _0x3962fc;};'use strict';var PluginEvents=require(_0xea5e('0x0'));var events=[_0xea5e('0x1'),_0xea5e('0x2'),_0xea5e('0x3')];function createListener(_0x48e9e6,_0x40ff98){return function(_0x6f652a){_0x40ff98[_0xea5e('0x4')](_0x48e9e6,_0x6f652a);};}function removeListener(_0x45ecf0,_0x4e59c0){return function(){PluginEvents[_0xea5e('0x5')](_0x45ecf0,_0x4e59c0);};}exports[_0xea5e('0x6')]=function(_0x51c7ae){for(var _0x4f46c5=0x0,_0xef0c4d=events[_0xea5e('0x7')];_0x4f46c5<_0xef0c4d;_0x4f46c5++){var _0x333f5d=events[_0x4f46c5];var _0x239caa=createListener(_0xea5e('0x8')+_0x333f5d,_0x51c7ae);PluginEvents['on'](_0x333f5d,_0x239caa);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 206a120..2708a03 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(_0x156a77,_0x522c13){var _0x32398a=function(_0x55a47a){while(--_0x55a47a){_0x156a77['push'](_0x156a77['shift']());}};_0x32398a(++_0x522c13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x55bf11,_0xa8d0a4){var _0x5a7410=function(_0x248493){while(--_0x248493){_0x55bf11['push'](_0x55bf11['shift']());}};_0x5a7410(++_0xa8d0a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 26e361a..7b924c3 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 _0xee5b=['exec','bluebird','sendStatus','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script','join','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/logger','api','child_process'];(function(_0x403ff8,_0x459e58){var _0xfdee81=function(_0x2f65f8){while(--_0x2f65f8){_0x403ff8['push'](_0x403ff8['shift']());}};_0xfdee81(++_0x459e58);}(_0xee5b,0x1f4));var _0xbee5=function(_0xe18ed9,_0x1c128c){_0xe18ed9=_0xe18ed9-0x0;var _0x39e9b3=_0xee5b[_0xe18ed9];return _0x39e9b3;};'use strict';var _=require(_0xbee5('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var path=require('path');var exec=require(_0xbee5('0x3'))[_0xbee5('0x4')];var BPromise=require(_0xbee5('0x5'));function handleEntityNotFound(_0x210159,_0x4bd202){return function(_0x5200b1){if(!_0x5200b1){_0x210159[_0xbee5('0x6')](0x194);;}return _0x5200b1;};}function respondWithResult(_0x2c0bde,_0xab6e4d){_0xab6e4d=_0xab6e4d||0xc8;return function(_0x804ab8){if(_0x804ab8){return _0x2c0bde['status'](_0xab6e4d)['json'](_0x804ab8);}return null;};}function handleError(_0x53d5b9,_0x5baf5c){_0x5baf5c=_0x5baf5c||0x1f4;return function(_0x5536bd){logger[_0xbee5('0x7')](_0x5536bd[_0xbee5('0x8')]);if(_0x5536bd[_0xbee5('0x9')]){delete _0x5536bd[_0xbee5('0x9')];}_0x53d5b9['status'](_0x5baf5c)[_0xbee5('0xa')](_0x5536bd);};}function execChildProcess(){return new BPromise(function(_0x305921,_0x9b3d3b){exec(_0xbee5('0xb'),function(_0x16377d,_0x1509c7,_0x105e16){logger[_0xbee5('0xc')](_0x1509c7);logger[_0xbee5('0xc')](_0x105e16);if(_0x16377d){logger['error'](_0x16377d);return _0x9b3d3b(_0x16377d);}return _0x305921(_0x1509c7);});});}exports[_0xbee5('0xd')]=function(_0x532a78,_0x183877){return pm2[_0xbee5('0xe')]()[_0xbee5('0xf')](function(_0x593ecb){if(_0x593ecb){var _0x5092f2=_[_0xbee5('0x10')](_0x593ecb,function(_0x4cf5a8){return _0x4cf5a8[_0xbee5('0x9')]==='express'||_0x4cf5a8[_0xbee5('0x9')]===_0xbee5('0x11');});return{'rows':_0x5092f2,'count':_0x5092f2[_0xbee5('0x12')]};}return null;})['then'](respondWithResult(_0x183877,null))[_0xbee5('0x13')](handleError(_0x183877,null));};exports[_0xbee5('0x14')]=function(_0x5a0ae5,_0x254dd3){return pm2[_0xbee5('0x15')](_0x5a0ae5[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x254dd3,null))[_0xbee5('0xf')](handleEntityNotFound(_0x254dd3,null))[_0xbee5('0x13')](handleError(_0x254dd3,null));};exports[_0xbee5('0x17')]=function(_0xa50ec9,_0x20cf52){if(_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')]&&_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x19')]){var _0x40a06=path[_0xbee5('0x1a')](__dirname,'../../files/plugins',_0xa50ec9['body'][_0xbee5('0x19')]);var _0x48bfb5=process[_0xbee5('0x1b')]();process[_0xbee5('0x1c')](path[_0xbee5('0x1d')](_0x40a06));return execChildProcess()[_0xbee5('0xf')](function(_0x3f23c5){process[_0xbee5('0x1c')](_0x48bfb5);return pm2[_0xbee5('0x1e')]({'name':_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')],'script':_0x40a06});})['then'](function(_0x5b43b3){pm2['dump']();return _0x5b43b3[0x0];})['then'](respondWithResult(_0x20cf52,0xc9))['catch'](handleError(_0x20cf52,null));}else{return _0x20cf52[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x20')});}};exports[_0xbee5('0x21')]=function(_0x169042,_0x20e7e8){if(_0x169042[_0xbee5('0x18')]['id']){delete _0x169042['body']['id'];}var _0x36b50f={'online':_0xbee5('0x22'),'stopped':_0xbee5('0x23')};if(_0x36b50f[_0xbee5('0x24')](_0x169042[_0xbee5('0x18')]['status'])){return pm2[_0x36b50f[_0x169042[_0xbee5('0x18')][_0xbee5('0x1f')]]](_0x169042[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x20e7e8,0xc8))[_0xbee5('0x13')](handleError(_0x20e7e8,null));}else{return _0x20e7e8[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x25')});}};exports[_0xbee5('0x26')]=function(_0x59c2e4,_0x22df5f){if(_0x59c2e4['body']['id']){delete _0x59c2e4[_0xbee5('0x18')]['id'];}if(_0x59c2e4['params']['id']){return pm2[_0xbee5('0x27')](_0x59c2e4['params']['id'])[_0xbee5('0xf')](function(_0x5c1109){pm2[_0xbee5('0x28')]();return _0x5c1109[0x0];})[_0xbee5('0xf')](respondWithResult(_0x22df5f,null))[_0xbee5('0x13')](handleError(_0x22df5f,null));}else{return _0x22df5f[_0xbee5('0x1f')](0x1f4)['send']({'message':_0xbee5('0x29')});}}; \ No newline at end of file +var _0x2e54=['exec','bluebird','sendStatus','status','error','stack','name','send','info','index','list','then','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','chdir','start','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','api','path','child_process'];(function(_0xaff2e4,_0x3b057d){var _0x2b3624=function(_0x17b219){while(--_0x17b219){_0xaff2e4['push'](_0xaff2e4['shift']());}};_0x2b3624(++_0x3b057d);}(_0x2e54,0x1dd));var _0x42e5=function(_0x3fb3b7,_0xe62eb5){_0x3fb3b7=_0x3fb3b7-0x0;var _0x48b0de=_0x2e54[_0x3fb3b7];return _0x48b0de;};'use strict';var _=require(_0x42e5('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x42e5('0x1'));var path=require(_0x42e5('0x2'));var exec=require(_0x42e5('0x3'))[_0x42e5('0x4')];var BPromise=require(_0x42e5('0x5'));function handleEntityNotFound(_0x153440,_0x42736b){return function(_0x528772){if(!_0x528772){_0x153440[_0x42e5('0x6')](0x194);;}return _0x528772;};}function respondWithResult(_0x455f48,_0x38cb1b){_0x38cb1b=_0x38cb1b||0xc8;return function(_0x4bed10){if(_0x4bed10){return _0x455f48[_0x42e5('0x7')](_0x38cb1b)['json'](_0x4bed10);}return null;};}function handleError(_0x335b92,_0x490b99){_0x490b99=_0x490b99||0x1f4;return function(_0x3a8494){logger[_0x42e5('0x8')](_0x3a8494[_0x42e5('0x9')]);if(_0x3a8494[_0x42e5('0xa')]){delete _0x3a8494[_0x42e5('0xa')];}_0x335b92[_0x42e5('0x7')](_0x490b99)[_0x42e5('0xb')](_0x3a8494);};}function execChildProcess(){return new BPromise(function(_0x2fa2f0,_0x197752){exec('npm\x20install',function(_0x456298,_0x28b3b3,_0x5d57f4){logger[_0x42e5('0xc')](_0x28b3b3);logger[_0x42e5('0xc')](_0x5d57f4);if(_0x456298){logger[_0x42e5('0x8')](_0x456298);return _0x197752(_0x456298);}return _0x2fa2f0(_0x28b3b3);});});}exports[_0x42e5('0xd')]=function(_0x144fb4,_0x1faafc){return pm2[_0x42e5('0xe')]()[_0x42e5('0xf')](function(_0x447648){if(_0x447648){var _0x23957f=_['reject'](_0x447648,function(_0x3b3dd9){return _0x3b3dd9[_0x42e5('0xa')]===_0x42e5('0x10')||_0x3b3dd9[_0x42e5('0xa')]===_0x42e5('0x11');});return{'rows':_0x23957f,'count':_0x23957f[_0x42e5('0x12')]};}return null;})[_0x42e5('0xf')](respondWithResult(_0x1faafc,null))[_0x42e5('0x13')](handleError(_0x1faafc,null));};exports[_0x42e5('0x14')]=function(_0x3c7b79,_0x22655f){return pm2[_0x42e5('0x15')](_0x3c7b79[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](respondWithResult(_0x22655f,null))['then'](handleEntityNotFound(_0x22655f,null))[_0x42e5('0x13')](handleError(_0x22655f,null));};exports['create']=function(_0x5f4428,_0x14d16d){if(_0x5f4428[_0x42e5('0x17')]['name']&&_0x5f4428[_0x42e5('0x17')][_0x42e5('0x18')]){var _0x1c2169=path[_0x42e5('0x19')](__dirname,_0x42e5('0x1a'),_0x5f4428[_0x42e5('0x17')][_0x42e5('0x18')]);var _0x58eee5=process['cwd']();process[_0x42e5('0x1b')](path['dirname'](_0x1c2169));return execChildProcess()[_0x42e5('0xf')](function(_0x2e9574){process[_0x42e5('0x1b')](_0x58eee5);return pm2[_0x42e5('0x1c')]({'name':_0x5f4428[_0x42e5('0x17')]['name'],'script':_0x1c2169});})[_0x42e5('0xf')](function(_0xf29221){pm2[_0x42e5('0x1d')]();return _0xf29221[0x0];})[_0x42e5('0xf')](respondWithResult(_0x14d16d,0xc9))[_0x42e5('0x13')](handleError(_0x14d16d,null));}else{return _0x14d16d['status'](0x1f4)['send']({'message':_0x42e5('0x1e')});}};exports['update']=function(_0x56f812,_0x1b60be){if(_0x56f812['body']['id']){delete _0x56f812[_0x42e5('0x17')]['id'];}var _0x2d9e65={'online':_0x42e5('0x1f'),'stopped':_0x42e5('0x20')};if(_0x2d9e65[_0x42e5('0x21')](_0x56f812[_0x42e5('0x17')]['status'])){return pm2[_0x2d9e65[_0x56f812[_0x42e5('0x17')][_0x42e5('0x7')]]](_0x56f812[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](respondWithResult(_0x1b60be,0xc8))[_0x42e5('0x13')](handleError(_0x1b60be,null));}else{return _0x1b60be[_0x42e5('0x7')](0x1f4)[_0x42e5('0xb')]({'message':_0x42e5('0x22')});}};exports[_0x42e5('0x23')]=function(_0x2ba9ef,_0x2c7542){if(_0x2ba9ef[_0x42e5('0x17')]['id']){delete _0x2ba9ef[_0x42e5('0x17')]['id'];}if(_0x2ba9ef['params']['id']){return pm2[_0x42e5('0x24')](_0x2ba9ef[_0x42e5('0x16')]['id'])[_0x42e5('0xf')](function(_0x156e73){pm2['dump']();return _0x156e73[0x0];})['then'](respondWithResult(_0x2c7542,null))[_0x42e5('0x13')](handleError(_0x2c7542,null));}else{return _0x2c7542['status'](0x1f4)[_0x42e5('0xb')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 7c724fb..d1e28d1 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 _0xf03d=['Router','../../components/auth/service','get','/queues','isAuthenticated','getQueues','exports','express'];(function(_0x4ce540,_0x4f878b){var _0xd74e77=function(_0x70e89e){while(--_0x70e89e){_0x4ce540['push'](_0x4ce540['shift']());}};_0xd74e77(++_0x4f878b);}(_0xf03d,0x1a7));var _0xdf03=function(_0x532704,_0x576ef2){_0x532704=_0x532704-0x0;var _0x1b4635=_0xf03d[_0x532704];return _0x1b4635;};'use strict';var express=require(_0xdf03('0x0'));var router=express[_0xdf03('0x1')]();var auth=require(_0xdf03('0x2'));var controller=require('./realtime.controller');router[_0xdf03('0x3')](_0xdf03('0x4'),auth[_0xdf03('0x5')](),controller[_0xdf03('0x6')]);module[_0xdf03('0x7')]=router; \ No newline at end of file +var _0x5388=['/queues','isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0x5388,0xee));var _0x8538=function(_0xa515c,_0x57ca32){_0xa515c=_0xa515c-0x0;var _0x4b737e=_0x5388[_0xa515c];return _0x4b737e;};'use strict';var express=require(_0x8538('0x0'));var router=express[_0x8538('0x1')]();var auth=require(_0x8538('0x2'));var controller=require(_0x8538('0x3'));router[_0x8538('0x4')](_0x8538('0x5'),auth[_0x8538('0x6')](),controller[_0x8538('0x7')]);module[_0x8538('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 48c5d52..8a81040 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 _0x4137=['../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','Content-Range','json','error','send','mail','openchannel','whatsapp','resolve','then','query','includes','channel','toLowerCase','startCase','Queue','map','fieldName','key','getOptions','user','role','userProfileId','voice','outbound','Queues','name','filter','UserProfile','getResources','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','available','waiting','talking','paused','type','push','pTalking','originated','dialActive','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','loggedIn','online','getMembers','find','UserId','agents','User','Pause','findAll','QueueId','agent','length','all','catch','util','lodash','jayson/promise','../../components/parsers/qs'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x4137,0xf8));var _0x7413=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4137[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0x7413('0x0'));var _=require(_0x7413('0x1'));var jayson=require(_0x7413('0x2'));var qs=require(_0x7413('0x3'));var logger=require(_0x7413('0x4'))(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var client=jayson[_0x7413('0x7')][_0x7413('0x8')]({'port':0x232a});var routingClient=jayson[_0x7413('0x7')][_0x7413('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x3bb181,_0x4fbade){return function(_0xc808cd){if(_0xc808cd){var _0x188d89=typeof _0x4fbade[_0x7413('0x9')]===_0x7413('0xa')&&typeof _0x4fbade['limit']===_0x7413('0xa');var _0x120dc2=_0xc808cd['count'];var _0x422bf5=_0x188d89?0x0:_0x4fbade[_0x7413('0x9')];var _0x50fde0=_0x188d89?_0xc808cd[_0x7413('0xb')]:_0x4fbade[_0x7413('0x9')]+_0x4fbade[_0x7413('0xc')];var _0x3e026b;if(_0x50fde0>=_0x120dc2){_0x50fde0=_0x120dc2;_0x3e026b=0xc8;}else{_0x3e026b=0xce;}_0x3bb181[_0x7413('0xd')](_0x3e026b);return _0x3bb181['set'](_0x7413('0xe'),_0x422bf5+'-'+_0x50fde0+'/'+_0x120dc2)[_0x7413('0xf')](_0xc808cd);}return null;};}function handleError(_0x4bf07d,_0x18a874){_0x18a874=_0x18a874||0x1f4;return function(_0xa26ca4){logger[_0x7413('0x10')](_0xa26ca4['stack']);if(_0xa26ca4['name']){delete _0xa26ca4['name'];}_0x4bf07d[_0x7413('0xd')](_0x18a874)[_0x7413('0x11')](_0xa26ca4);};}exports['getQueues']=function(_0x1a42aa,_0x45bef0){var _0x4955d3=[_0x7413('0x12'),'chat','sms',_0x7413('0x13'),'fax',_0x7413('0x14'),'voice'];var _0x2036b6={'count':0x0,'rows':[]},_0x3230d8={},_0x19157f;Promise[_0x7413('0x15')]()[_0x7413('0x16')](function(){if(_0x1a42aa[_0x7413('0x17')]['channel']){if(!_[_0x7413('0x18')](_0x4955d3,_0x1a42aa[_0x7413('0x17')][_0x7413('0x19')][_0x7413('0x1a')]()))throw new Error('Invalid\x20channel');_0x19157f=_0x1a42aa[_0x7413('0x17')][_0x7413('0x19')][_0x7413('0x1a')]();}var _0x20d3d2=_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x1c');var _0x4886e3=_[_0x7413('0x1d')](db[_0x20d3d2]['rawAttributes'],function(_0x5f12a2){return{'name':_0x5f12a2[_0x7413('0x1e')],'type':_0x5f12a2['type'][_0x7413('0x1f')]};});_0x3230d8=qs[_0x7413('0x20')](_0x4886e3,_0x1a42aa);if(_0x1a42aa[_0x7413('0x21')][_0x7413('0x22')]===_0x7413('0x21')){var _0x346ce8={'params':{'id':_0x1a42aa[_0x7413('0x21')][_0x7413('0x23')]},'query':{'section':_0x19157f===_0x7413('0x24')&&_0x1a42aa['query']['type']===_0x7413('0x25')?'QueueCampaigns':_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x26'),'type':_0x1a42aa[_0x7413('0x17')]['type'],'nolimit':!![],'sort':_0x7413('0x27'),'filter':_0x1a42aa[_0x7413('0x17')][_0x7413('0x28')]}};return db[_0x7413('0x29')][_0x7413('0x2a')](_0x346ce8);}return db[_0x20d3d2][_0x7413('0x2b')](_0x3230d8);})['then'](function(_0x24dce7){_0x2036b6['count']=_0x24dce7[_0x7413('0xb')];var _0x23e682=_0x19157f===_0x7413('0x24')?client:routingClient;return _0x23e682[_0x7413('0x2c')](_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x26'),_0x1a42aa)['then'](function(_0x1ffb6f){if(_0x1ffb6f[_0x7413('0x10')])throw new Error(util[_0x7413('0x2d')](_0x7413('0x2e'),_0x19157f));var _0x291268=_0x1ffb6f[_0x7413('0x2f')];var _0x185cfe=['loggedIn',_0x7413('0x30'),_0x7413('0x31'),_0x7413('0x32'),_0x7413('0x33')];if(_0x19157f===_0x7413('0x24')&&_0x1a42aa['query'][_0x7413('0x34')]==='outbound'){_0x185cfe[_0x7413('0x35')](_0x7413('0x36'),_0x7413('0x37'),'message',_0x7413('0x38'),'dialMethod',_0x7413('0x39'),_0x7413('0x3a'),'startProgressive','erlangCalls',_0x7413('0x3b'),_0x7413('0x3c'),_0x7413('0x3d'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x7413('0x3e'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x7413('0x3f'),'predictiveIntervalDroppedCallsTimeout',_0x7413('0x40'),_0x7413('0x41'),_0x7413('0x42'));}var _0x2b178c=_0x24dce7[_0x7413('0x43')]['map'](function(_0xa58bd2){var _0x8dc047=_0xa58bd2[_0x7413('0x44')]({'plain':!![]});_0x8dc047[_0x7413('0x33')]=0x0;_0x8dc047[_0x7413('0x45')]=0x0;_0x8dc047[_0x7413('0x46')]=0x0;_0x8dc047[_0x7413('0x30')]=0x0;_0x8dc047[_0x7413('0x33')]=0x0;_0x8dc047[_0x7413('0x31')]=0x0;if(_0x19157f===_0x7413('0x24')){_0x8dc047[_0x7413('0x32')]=0x0;if(_0x1a42aa[_0x7413('0x17')]['type']===_0x7413('0x25')){_0x8dc047['pTalking']=0x0;_0x8dc047['originated']=0x0;}}_0x8dc047['agents']=[];var _0x53c47c=_['find'](_0x291268[_0x7413('0x43')],['id',_0x8dc047['id']]);if(_0x53c47c)_['merge'](_0x8dc047,_['pick'](_0x53c47c,_0x185cfe));if(_0x19157f===_0x7413('0x24')){return _0xa58bd2['getAgents']({'attributes':['id','name',_0x7413('0x47')],'joinTableAttributes':[],'raw':!![]})[_0x7413('0x16')](function(_0x18674c){return _0xa58bd2[_0x7413('0x48')]({'raw':!![]})[_0x7413('0x16')](function(_0x57cb9e){for(var _0x3f421c=0x0;_0x3f421c<_0x18674c['length'];_0x3f421c++){var _0x2e9e18=_[_0x7413('0x49')](_0x57cb9e,[_0x7413('0x4a'),_0x18674c[_0x3f421c]['id']]);var _0xfe0daa={'id':_0x18674c[_0x3f421c]['id'],'name':_0x18674c[_0x3f421c][_0x7413('0x27')],'online':Boolean(_0x18674c[_0x3f421c][_0x7413('0x47')]),'paused':_0x2e9e18?Boolean(_0x2e9e18[_0x7413('0x33')]):![]};if(_0xfe0daa[_0x7413('0x47')])_0x8dc047[_0x7413('0x45')]++;if(_0xfe0daa[_0x7413('0x33')])_0x8dc047[_0x7413('0x33')]++;_0x8dc047[_0x7413('0x4b')][_0x7413('0x35')](_0xfe0daa);}return _0x8dc047;});});}else{var _0x58ab17=_0x7413('0x4c')+_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x1c');var _0x1fbbd5=_0x19157f+_0x7413('0x4d');return db[_0x58ab17][_0x7413('0x4e')]({'where':{[_[_0x7413('0x1b')](_0x19157f)+_0x7413('0x4f')]:_0xa58bd2['id']},'raw':!![]})[_0x7413('0x16')](function(_0x1c3af5){return db[_0x7413('0x4c')]['findAll']({'attributes':['id',_0x7413('0x27'),'online',_0x1fbbd5],'where':{'id':_[_0x7413('0x1d')](_0x1c3af5,_0x7413('0x4a')),'role':_0x7413('0x50')},'raw':!![]});})[_0x7413('0x16')](function(_0x479049){for(var _0x148b69=0x0;_0x148b69<_0x479049[_0x7413('0x51')];_0x148b69++){var _0x7de9d8={'id':_0x479049[_0x148b69]['id'],'name':_0x479049[_0x148b69][_0x7413('0x27')],'online':Boolean(_0x479049[_0x148b69][_0x7413('0x47')]),'paused':Boolean(_0x479049[_0x148b69][_0x1fbbd5])};if(_0x7de9d8['online'])_0x8dc047['loggedInDb']++;if(_0x7de9d8[_0x7413('0x33')])_0x8dc047['paused']++;_0x8dc047['agents'][_0x7413('0x35')](_0x7de9d8);}return _0x8dc047;});}});return Promise[_0x7413('0x52')](_0x2b178c);});})['then'](function(_0x2aa12c){_0x2036b6['rows']=_0x2aa12c;return _0x2036b6;})['then'](respondWithFilteredResult(_0x45bef0,_0x3230d8))[_0x7413('0x53')](handleError(_0x45bef0,null));}; \ No newline at end of file +var _0x9fd4=['error','stack','name','send','getQueues','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','query','channel','Invalid\x20channel','toLowerCase','Queue','map','rawAttributes','fieldName','key','getOptions','user','type','outbound','QueueCampaigns','startCase','Queues','filter','getResources','findAndCountAll','request','format','result','talking','paused','push','pTalking','originated','message','dialActive','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','loggedIn','available','waiting','agents','merge','pick','getAgents','online','then','getMembers','length','find','UserId','Pause','findAll','User','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','offset','status','Content-Range','json'];(function(_0x117277,_0x532e58){var _0xf3af80=function(_0xc0420d){while(--_0xc0420d){_0x117277['push'](_0x117277['shift']());}};_0xf3af80(++_0x532e58);}(_0x9fd4,0x16c));var _0x49fd=function(_0x21efd3,_0x445165){_0x21efd3=_0x21efd3-0x0;var _0x3898f5=_0x9fd4[_0x21efd3];return _0x3898f5;};'use strict';var util=require(_0x49fd('0x0'));var _=require(_0x49fd('0x1'));var jayson=require(_0x49fd('0x2'));var qs=require(_0x49fd('0x3'));var logger=require(_0x49fd('0x4'))(_0x49fd('0x5'));var db=require(_0x49fd('0x6'))['db'];var client=jayson[_0x49fd('0x7')][_0x49fd('0x8')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x3b4b46,_0x42fdc7){return function(_0x1bc16e){if(_0x1bc16e){var _0x9353cd=typeof _0x42fdc7['offset']===_0x49fd('0x9')&&typeof _0x42fdc7[_0x49fd('0xa')]===_0x49fd('0x9');var _0x3bf3fd=_0x1bc16e[_0x49fd('0xb')];var _0x4a1c47=_0x9353cd?0x0:_0x42fdc7[_0x49fd('0xc')];var _0x130c9b=_0x9353cd?_0x1bc16e[_0x49fd('0xb')]:_0x42fdc7[_0x49fd('0xc')]+_0x42fdc7[_0x49fd('0xa')];var _0x2c6d77;if(_0x130c9b>=_0x3bf3fd){_0x130c9b=_0x3bf3fd;_0x2c6d77=0xc8;}else{_0x2c6d77=0xce;}_0x3b4b46[_0x49fd('0xd')](_0x2c6d77);return _0x3b4b46['set'](_0x49fd('0xe'),_0x4a1c47+'-'+_0x130c9b+'/'+_0x3bf3fd)[_0x49fd('0xf')](_0x1bc16e);}return null;};}function handleError(_0x426109,_0x40d1b0){_0x40d1b0=_0x40d1b0||0x1f4;return function(_0x15dabd){logger[_0x49fd('0x10')](_0x15dabd[_0x49fd('0x11')]);if(_0x15dabd[_0x49fd('0x12')]){delete _0x15dabd[_0x49fd('0x12')];}_0x426109[_0x49fd('0xd')](_0x40d1b0)[_0x49fd('0x13')](_0x15dabd);};}exports[_0x49fd('0x14')]=function(_0x46760f,_0x1a9063){var _0x264ab1=[_0x49fd('0x15'),_0x49fd('0x16'),_0x49fd('0x17'),_0x49fd('0x18'),_0x49fd('0x19'),_0x49fd('0x1a'),_0x49fd('0x1b')];var _0x320fe5={'count':0x0,'rows':[]},_0x475eee={},_0xb55d24;Promise[_0x49fd('0x1c')]()['then'](function(){if(_0x46760f[_0x49fd('0x1d')][_0x49fd('0x1e')]){if(!_['includes'](_0x264ab1,_0x46760f['query'][_0x49fd('0x1e')]['toLowerCase']()))throw new Error(_0x49fd('0x1f'));_0xb55d24=_0x46760f[_0x49fd('0x1d')]['channel'][_0x49fd('0x20')]();}var _0x83ab70=_['startCase'](_0xb55d24)+_0x49fd('0x21');var _0x1165db=_[_0x49fd('0x22')](db[_0x83ab70][_0x49fd('0x23')],function(_0x20fa0d){return{'name':_0x20fa0d[_0x49fd('0x24')],'type':_0x20fa0d['type'][_0x49fd('0x25')]};});_0x475eee=qs[_0x49fd('0x26')](_0x1165db,_0x46760f);if(_0x46760f[_0x49fd('0x27')]['role']===_0x49fd('0x27')){var _0x10de13={'params':{'id':_0x46760f[_0x49fd('0x27')]['userProfileId']},'query':{'section':_0xb55d24==='voice'&&_0x46760f['query'][_0x49fd('0x28')]===_0x49fd('0x29')?_0x49fd('0x2a'):_[_0x49fd('0x2b')](_0xb55d24)+_0x49fd('0x2c'),'type':_0x46760f[_0x49fd('0x1d')][_0x49fd('0x28')],'nolimit':!![],'sort':_0x49fd('0x12'),'filter':_0x46760f['query'][_0x49fd('0x2d')]}};return db['UserProfile'][_0x49fd('0x2e')](_0x10de13);}return db[_0x83ab70][_0x49fd('0x2f')](_0x475eee);})['then'](function(_0x203038){_0x320fe5[_0x49fd('0xb')]=_0x203038[_0x49fd('0xb')];var _0x43826f=_0xb55d24===_0x49fd('0x1b')?client:routingClient;return _0x43826f[_0x49fd('0x30')](_[_0x49fd('0x2b')](_0xb55d24)+_0x49fd('0x2c'),_0x46760f)['then'](function(_0x42181b){if(_0x42181b['error'])throw new Error(util[_0x49fd('0x31')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xb55d24));var _0xa278f1=_0x42181b[_0x49fd('0x32')];var _0x390788=['loggedIn','available','waiting',_0x49fd('0x33'),_0x49fd('0x34')];if(_0xb55d24==='voice'&&_0x46760f[_0x49fd('0x1d')]['type']==='outbound'){_0x390788[_0x49fd('0x35')](_0x49fd('0x36'),_0x49fd('0x37'),_0x49fd('0x38'),_0x49fd('0x39'),'dialMethod','Trunk',_0x49fd('0x3a'),_0x49fd('0x3b'),_0x49fd('0x3c'),_0x49fd('0x3d'),'erlangAbandonmentRate',_0x49fd('0x3e'),_0x49fd('0x3f'),_0x49fd('0x40'),_0x49fd('0x41'),_0x49fd('0x42'),_0x49fd('0x43'),_0x49fd('0x44'),_0x49fd('0x45'),_0x49fd('0x46'),_0x49fd('0x47'),_0x49fd('0x48'));}var _0x5502ca=_0x203038[_0x49fd('0x49')][_0x49fd('0x22')](function(_0x8dc5b3){var _0xfea54d=_0x8dc5b3[_0x49fd('0x4a')]({'plain':!![]});_0xfea54d[_0x49fd('0x34')]=0x0;_0xfea54d[_0x49fd('0x4b')]=0x0;_0xfea54d[_0x49fd('0x4c')]=0x0;_0xfea54d[_0x49fd('0x4d')]=0x0;_0xfea54d['paused']=0x0;_0xfea54d[_0x49fd('0x4e')]=0x0;if(_0xb55d24==='voice'){_0xfea54d[_0x49fd('0x33')]=0x0;if(_0x46760f[_0x49fd('0x1d')]['type']===_0x49fd('0x29')){_0xfea54d[_0x49fd('0x36')]=0x0;_0xfea54d['originated']=0x0;}}_0xfea54d[_0x49fd('0x4f')]=[];var _0x4f525f=_['find'](_0xa278f1['rows'],['id',_0xfea54d['id']]);if(_0x4f525f)_[_0x49fd('0x50')](_0xfea54d,_[_0x49fd('0x51')](_0x4f525f,_0x390788));if(_0xb55d24===_0x49fd('0x1b')){return _0x8dc5b3[_0x49fd('0x52')]({'attributes':['id','name',_0x49fd('0x53')],'joinTableAttributes':[],'raw':!![]})[_0x49fd('0x54')](function(_0x42c130){return _0x8dc5b3[_0x49fd('0x55')]({'raw':!![]})[_0x49fd('0x54')](function(_0x28d7ea){for(var _0x26a0c7=0x0;_0x26a0c7<_0x42c130[_0x49fd('0x56')];_0x26a0c7++){var _0x594452=_[_0x49fd('0x57')](_0x28d7ea,[_0x49fd('0x58'),_0x42c130[_0x26a0c7]['id']]);var _0x4dce94={'id':_0x42c130[_0x26a0c7]['id'],'name':_0x42c130[_0x26a0c7][_0x49fd('0x12')],'online':Boolean(_0x42c130[_0x26a0c7][_0x49fd('0x53')]),'paused':_0x594452?Boolean(_0x594452['paused']):![]};if(_0x4dce94[_0x49fd('0x53')])_0xfea54d['loggedInDb']++;if(_0x4dce94[_0x49fd('0x34')])_0xfea54d[_0x49fd('0x34')]++;_0xfea54d[_0x49fd('0x4f')][_0x49fd('0x35')](_0x4dce94);}return _0xfea54d;});});}else{var _0x4f6902='User'+_[_0x49fd('0x2b')](_0xb55d24)+'Queue';var _0xf79ed6=_0xb55d24+_0x49fd('0x59');return db[_0x4f6902][_0x49fd('0x5a')]({'where':{[_[_0x49fd('0x2b')](_0xb55d24)+'QueueId']:_0x8dc5b3['id']},'raw':!![]})[_0x49fd('0x54')](function(_0x29bcbf){return db[_0x49fd('0x5b')][_0x49fd('0x5a')]({'attributes':['id',_0x49fd('0x12'),_0x49fd('0x53'),_0xf79ed6],'where':{'id':_[_0x49fd('0x22')](_0x29bcbf,_0x49fd('0x58')),'role':_0x49fd('0x5c')},'raw':!![]});})[_0x49fd('0x54')](function(_0x1a18aa){for(var _0x312344=0x0;_0x312344<_0x1a18aa[_0x49fd('0x56')];_0x312344++){var _0x427209={'id':_0x1a18aa[_0x312344]['id'],'name':_0x1a18aa[_0x312344]['name'],'online':Boolean(_0x1a18aa[_0x312344]['online']),'paused':Boolean(_0x1a18aa[_0x312344][_0xf79ed6])};if(_0x427209[_0x49fd('0x53')])_0xfea54d[_0x49fd('0x4b')]++;if(_0x427209[_0x49fd('0x34')])_0xfea54d[_0x49fd('0x34')]++;_0xfea54d['agents'][_0x49fd('0x35')](_0x427209);}return _0xfea54d;});}});return Promise[_0x49fd('0x5d')](_0x5502ca);});})['then'](function(_0x341728){_0x320fe5[_0x49fd('0x49')]=_0x341728;return _0x320fe5;})[_0x49fd('0x54')](respondWithFilteredResult(_0x1a9063,_0x475eee))[_0x49fd('0x5e')](handleError(_0x1a9063,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 99175d2..3a45d7c 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x584b1e,_0x3f380e){var _0x56e471=function(_0x315cae){while(--_0x315cae){_0x584b1e['push'](_0x584b1e['shift']());}};_0x56e471(++_0x3f380e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x81697e,_0x552c16){var _0x1f6e36=function(_0x2a6bbd){while(--_0x2a6bbd){_0x81697e['push'](_0x81697e['shift']());}};_0x1f6e36(++_0x552c16);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 0d1252e..7c0383c 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 _0x0f89=['INTEGER','DATE','STRING','sequelize','exports'];(function(_0x51e99b,_0x2d7d42){var _0x2af489=function(_0xade5a3){while(--_0xade5a3){_0x51e99b['push'](_0x51e99b['shift']());}};_0x2af489(++_0x2d7d42);}(_0x0f89,0x111));var _0x90f8=function(_0x1202a2,_0x2912d9){_0x1202a2=_0x1202a2-0x0;var _0x3a8ac6=_0x0f89[_0x1202a2];return _0x3a8ac6;};'use strict';var Sequelize=require(_0x90f8('0x0'));module[_0x90f8('0x1')]={'state':{'type':Sequelize[_0x90f8('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x90f8('0x3')]},'uniqueid':{'type':Sequelize[_0x90f8('0x4')]},'starttime':{'type':Sequelize[_0x90f8('0x3')]},'responsetime':{'type':Sequelize[_0x90f8('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x90f8('0x4')]},'campaigntype':{'type':Sequelize[_0x90f8('0x4')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2bae=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe2ba('0x0'));module[_0xe2ba('0x1')]={'state':{'type':Sequelize[_0xe2ba('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe2ba('0x3')]},'scheduledat':{'type':Sequelize[_0xe2ba('0x4')]},'uniqueid':{'type':Sequelize[_0xe2ba('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe2ba('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe2ba('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe2ba('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index eef7a96..400290b 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 _0xd66b=['../../config/logger','api','moment','bluebird','path','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util'];(function(_0x2ce57b,_0x57a83a){var _0x59bae9=function(_0x2e5611){while(--_0x2e5611){_0x2ce57b['push'](_0x2ce57b['shift']());}};_0x59bae9(++_0x57a83a);}(_0xd66b,0x153));var _0xbd66=function(_0x31f390,_0x1c5c83){_0x31f390=_0x31f390-0x0;var _0x2d7885=_0xd66b[_0x31f390];return _0x2d7885;};'use strict';var _=require(_0xbd66('0x0'));var util=require(_0xbd66('0x1'));var logger=require(_0xbd66('0x2'))(_0xbd66('0x3'));var moment=require(_0xbd66('0x4'));var BPromise=require(_0xbd66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd66('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbd66('0x7'));module[_0xbd66('0x8')]=function(_0x321af6,_0x890554){return _0x321af6[_0xbd66('0x9')](_0xbd66('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1910=['path','../../config/environment','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird'];(function(_0x27a61f,_0x16a390){var _0x10af82=function(_0x4392db){while(--_0x4392db){_0x27a61f['push'](_0x27a61f['shift']());}};_0x10af82(++_0x16a390);}(_0x1910,0x127));var _0x0191=function(_0x2fe5c4,_0x4697d5){_0x2fe5c4=_0x2fe5c4-0x0;var _0x2282d0=_0x1910[_0x2fe5c4];return _0x2282d0;};'use strict';var _=require(_0x0191('0x0'));var util=require(_0x0191('0x1'));var logger=require(_0x0191('0x2'))('api');var moment=require(_0x0191('0x3'));var BPromise=require(_0x0191('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0191('0x5'));var rimraf=require('rimraf');var config=require(_0x0191('0x6'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x270a50,_0x104749){return _0x270a50[_0x0191('0x7')](_0x0191('0x8'),attributes,{'tableName':_0x0191('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index ea09011..c9a36d2 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 _0x6666=['then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','raw','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x35aa18,_0x106eab){var _0x151ef2=function(_0x57d056){while(--_0x57d056){_0x35aa18['push'](_0x35aa18['shift']());}};_0x151ef2(++_0x106eab);}(_0x6666,0xa0));var _0x6666=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0x6666[_0x4afac5];return _0x2404b3;};'use strict';var _=require(_0x6666('0x0'));var util=require('util');var moment=require(_0x6666('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6666('0x2'))['db'];var utils=require(_0x6666('0x3'));var logger=require(_0x6666('0x4'))(_0x6666('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6666('0x6')][_0x6666('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45bdc7,_0x5b3111,_0x324bad){return new BPromise(function(_0x3f06a9,_0x5d3b5e){return client['request'](_0x45bdc7,_0x324bad)[_0x6666('0x8')](function(_0x1398f1){logger[_0x6666('0x9')](_0x6666('0xa'),_0x5b3111,_0x6666('0xb'));logger[_0x6666('0xc')](_0x6666('0xd'),_0x5b3111,_0x6666('0xb'),JSON[_0x6666('0xe')](_0x1398f1));if(_0x1398f1[_0x6666('0xf')]){if(_0x1398f1[_0x6666('0xf')][_0x6666('0x10')]===0x1f4){logger['error'](_0x6666('0xa'),_0x5b3111,_0x1398f1[_0x6666('0xf')]['message']);return _0x5d3b5e(_0x1398f1[_0x6666('0xf')][_0x6666('0x11')]);}logger['error'](_0x6666('0xa'),_0x5b3111,_0x1398f1['error'][_0x6666('0x11')]);return _0x3f06a9(_0x1398f1[_0x6666('0xf')]['message']);}else{logger[_0x6666('0x9')](_0x6666('0xa'),_0x5b3111,_0x6666('0xb'));_0x3f06a9(_0x1398f1['result'][_0x6666('0x11')]);}})[_0x6666('0x12')](function(_0x4731fe){logger[_0x6666('0xf')](_0x6666('0xa'),_0x5b3111,_0x4731fe);_0x5d3b5e(_0x4731fe);});});}exports[_0x6666('0x13')]=function(_0x5dd84f){var _0x3ed446=this;return new Promise(function(_0x221c92,_0x1cb409){return db[_0x6666('0x14')][_0x6666('0x15')](_0x5dd84f[_0x6666('0x16')],{'raw':_0x5dd84f['options']?_0x5dd84f['options'][_0x6666('0x17')]===undefined?!![]:![]:!![]})[_0x6666('0x8')](function(_0x4fd2ca){logger[_0x6666('0x9')](_0x6666('0x13'),_0x5dd84f);logger['debug'](_0x6666('0x13'),_0x5dd84f,JSON[_0x6666('0xe')](_0x4fd2ca));_0x221c92(_0x4fd2ca);})[_0x6666('0x12')](function(_0x83ce37){logger['error'](_0x6666('0x13'),_0x83ce37['message'],_0x5dd84f);_0x1cb409(_0x3ed446[_0x6666('0xf')](0x1f4,_0x83ce37[_0x6666('0x11')]));});});}; \ No newline at end of file +var _0x5f33=['client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3fe90c,_0x231b20){var _0x12c302=function(_0x5f5cb6){while(--_0x5f5cb6){_0x3fe90c['push'](_0x3fe90c['shift']());}};_0x12c302(++_0x231b20);}(_0x5f33,0x170));var _0x35f3=function(_0xc543d2,_0x4a9d10){_0xc543d2=_0xc543d2-0x0;var _0x187d7b=_0x5f33[_0xc543d2];return _0x187d7b;};'use strict';var _=require('lodash');var util=require(_0x35f3('0x0'));var moment=require(_0x35f3('0x1'));var BPromise=require(_0x35f3('0x2'));var rs=require(_0x35f3('0x3'));var fs=require('fs');var Redis=require(_0x35f3('0x4'));var db=require(_0x35f3('0x5'))['db'];var utils=require(_0x35f3('0x6'));var logger=require(_0x35f3('0x7'))(_0x35f3('0x8'));var config=require('../../config/environment');var jayson=require(_0x35f3('0x9'));var client=jayson[_0x35f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e6684,_0x1bdca1,_0x12d60a){return new BPromise(function(_0xc03490,_0x27ac45){return client[_0x35f3('0xb')](_0x4e6684,_0x12d60a)[_0x35f3('0xc')](function(_0x5dc6bd){logger[_0x35f3('0xd')](_0x35f3('0xe'),_0x1bdca1,_0x35f3('0xf'));logger[_0x35f3('0x10')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x1bdca1,_0x35f3('0xf'),JSON[_0x35f3('0x11')](_0x5dc6bd));if(_0x5dc6bd['error']){if(_0x5dc6bd[_0x35f3('0x12')][_0x35f3('0x13')]===0x1f4){logger[_0x35f3('0x12')](_0x35f3('0xe'),_0x1bdca1,_0x5dc6bd[_0x35f3('0x12')][_0x35f3('0x14')]);return _0x27ac45(_0x5dc6bd['error'][_0x35f3('0x14')]);}logger[_0x35f3('0x12')](_0x35f3('0xe'),_0x1bdca1,_0x5dc6bd['error'][_0x35f3('0x14')]);return _0xc03490(_0x5dc6bd['error'][_0x35f3('0x14')]);}else{logger['info'](_0x35f3('0xe'),_0x1bdca1,_0x35f3('0xf'));_0xc03490(_0x5dc6bd['result'][_0x35f3('0x14')]);}})[_0x35f3('0x15')](function(_0x303990){logger[_0x35f3('0x12')](_0x35f3('0xe'),_0x1bdca1,_0x303990);_0x27ac45(_0x303990);});});}exports[_0x35f3('0x16')]=function(_0x23f4c9){var _0x2c3c5f=this;return new Promise(function(_0x5a0c7d,_0x566270){return db[_0x35f3('0x17')]['create'](_0x23f4c9[_0x35f3('0x18')],{'raw':_0x23f4c9[_0x35f3('0x19')]?_0x23f4c9[_0x35f3('0x19')][_0x35f3('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x47cee6){logger[_0x35f3('0xd')](_0x35f3('0x16'),_0x23f4c9);logger['debug'](_0x35f3('0x16'),_0x23f4c9,JSON[_0x35f3('0x11')](_0x47cee6));_0x5a0c7d(_0x47cee6);})['catch'](function(_0x1004ad){logger['error'](_0x35f3('0x16'),_0x1004ad[_0x35f3('0x14')],_0x23f4c9);_0x566270(_0x2c3c5f[_0x35f3('0x12')](0x1f4,_0x1004ad['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index f5fb246..f7ee562 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 _0xdbaa=['agents','/agents/:id/capacity','agentCapacity','/trunks','/campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents'];(function(_0x192105,_0x1e7690){var _0x5bb1c0=function(_0x218b46){while(--_0x218b46){_0x192105['push'](_0x192105['shift']());}};_0x5bb1c0(++_0x1e7690);}(_0xdbaa,0xc3));var _0xadba=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xdbaa[_0x725b8e];return _0x43ac45;};'use strict';var multer=require(_0xadba('0x0'));var util=require(_0xadba('0x1'));var path=require('path');var express=require(_0xadba('0x2'));var router=express[_0xadba('0x3')]();var auth=require(_0xadba('0x4'));var controller=require(_0xadba('0x5'));router[_0xadba('0x6')](_0xadba('0x7'),auth[_0xadba('0x8')](),controller[_0xadba('0x9')]);router[_0xadba('0x6')](_0xadba('0xa'),auth[_0xadba('0x8')](),controller[_0xadba('0xb')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0xadba('0xc')]);router['get'](_0xadba('0xd'),auth[_0xadba('0x8')](),controller['voiceQueues']);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0xadba('0xe')]);router['get'](_0xadba('0xf'),auth[_0xadba('0x8')](),controller['mailQueues']);router[_0xadba('0x6')](_0xadba('0x10'),auth['isAuthenticated'](),controller[_0xadba('0x11')]);router[_0xadba('0x6')](_0xadba('0x12'),auth[_0xadba('0x8')](),controller[_0xadba('0x13')]);router[_0xadba('0x6')](_0xadba('0x14'),auth['isAuthenticated'](),controller[_0xadba('0x15')]);router['get'](_0xadba('0x16'),auth[_0xadba('0x8')](),controller[_0xadba('0x17')]);router['get']('/fax/queues',auth[_0xadba('0x8')](),controller[_0xadba('0x18')]);router[_0xadba('0x6')](_0xadba('0x19'),auth[_0xadba('0x8')](),controller[_0xadba('0x1a')]);router['get']('/voice/queues/channels',auth[_0xadba('0x8')](),controller[_0xadba('0x1b')]);router[_0xadba('0x6')](_0xadba('0x1c'),auth[_0xadba('0x8')](),controller[_0xadba('0x1d')]);router[_0xadba('0x6')](_0xadba('0x1e'),auth[_0xadba('0x8')](),controller[_0xadba('0x1f')]);router[_0xadba('0x6')](_0xadba('0x20'),auth['isAuthenticated'](),controller[_0xadba('0x21')]);router[_0xadba('0x6')](_0xadba('0x22'),auth[_0xadba('0x8')](),controller[_0xadba('0x23')]);router[_0xadba('0x24')](_0xadba('0x22'),auth[_0xadba('0x8')](),controller[_0xadba('0x25')]);router[_0xadba('0x6')](_0xadba('0x26'),auth[_0xadba('0x8')](),controller[_0xadba('0x27')]);router[_0xadba('0x6')](_0xadba('0x28'),auth[_0xadba('0x8')](),controller['outboundChannels']);router[_0xadba('0x6')](_0xadba('0x29'),auth['isAuthenticated'](),controller[_0xadba('0x2a')]);router[_0xadba('0x24')](_0xadba('0x2b'),auth[_0xadba('0x8')](),controller[_0xadba('0x2c')]);router[_0xadba('0x6')]('/telephones',auth[_0xadba('0x8')](),controller['telephones']);router[_0xadba('0x6')](_0xadba('0x2d'),auth['isAuthenticated'](),controller['trunks']);router[_0xadba('0x6')](_0xadba('0x2e'),auth[_0xadba('0x8')](),controller['campaigns']);router['get'](_0xadba('0x2f'),auth['isAuthenticated'](),controller[_0xadba('0x30')]);router['get']('/chat/queues/waitinginteractions',auth[_0xadba('0x8')](),controller[_0xadba('0x31')]);router['get']('/mail/queues/waitinginteractions',auth[_0xadba('0x8')](),controller[_0xadba('0x32')]);router[_0xadba('0x6')](_0xadba('0x33'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xadba('0x6')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xadba('0x34')]);router[_0xadba('0x6')](_0xadba('0x35'),auth['isAuthenticated'](),controller[_0xadba('0x36')]);router[_0xadba('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0xadba('0x8')](),controller[_0xadba('0x37')]);router['get'](_0xadba('0x38'),auth[_0xadba('0x8')](),controller[_0xadba('0x39')]);router[_0xadba('0x3a')](_0xadba('0x3b'),auth[_0xadba('0x8')](),controller[_0xadba('0x3c')]('mail'));router['get'](_0xadba('0x3d'),auth[_0xadba('0x8')](),controller['showMailQueues']);router[_0xadba('0x3a')]('/chat/queues/:id/notify',auth[_0xadba('0x8')](),controller['queueNotify'](_0xadba('0x3e')));router['get'](_0xadba('0x3f'),auth['isAuthenticated'](),controller[_0xadba('0x40')]);router[_0xadba('0x3a')](_0xadba('0x41'),auth[_0xadba('0x8')](),controller['queueNotify'](_0xadba('0x42')));router[_0xadba('0x6')](_0xadba('0x43'),auth['isAuthenticated'](),controller[_0xadba('0x44')]);router[_0xadba('0x3a')]('/openchannel/queues/:id/notify',auth[_0xadba('0x8')](),controller[_0xadba('0x3c')]('openchannel'));router[_0xadba('0x6')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0xadba('0x45')]);router[_0xadba('0x3a')](_0xadba('0x46'),auth[_0xadba('0x8')](),controller[_0xadba('0x3c')](_0xadba('0x47')));router['post'](_0xadba('0x48'),auth[_0xadba('0x8')](),controller[_0xadba('0x3c')](_0xadba('0x49')));router[_0xadba('0x6')](_0xadba('0x4a'),auth[_0xadba('0x8')](),controller[_0xadba('0x4b')]);router[_0xadba('0x6')]('/whatsapp/queues/:id',auth[_0xadba('0x8')](),controller[_0xadba('0x4c')]);router[_0xadba('0x3a')](_0xadba('0x4d'),auth['isAuthenticated'](),controller[_0xadba('0x4e')]);module['exports']=router; \ No newline at end of file +var _0x1899=['voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','outbound','outboundChannels','/agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated'];(function(_0xfe0b69,_0x30e84f){var _0xb6431c=function(_0x14c377){while(--_0x14c377){_0xfe0b69['push'](_0xfe0b69['shift']());}};_0xb6431c(++_0x30e84f);}(_0x1899,0x148));var _0x9189=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1899[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x9189('0x0'));var util=require('util');var path=require(_0x9189('0x1'));var express=require(_0x9189('0x2'));var router=express[_0x9189('0x3')]();var auth=require(_0x9189('0x4'));var controller=require('./rpc.controller');router[_0x9189('0x5')](_0x9189('0x6'),auth[_0x9189('0x7')](),controller[_0x9189('0x8')]);router[_0x9189('0x5')](_0x9189('0x9'),auth[_0x9189('0x7')](),controller['voiceChannelMixMonitor']);router[_0x9189('0x5')](_0x9189('0xa'),auth[_0x9189('0x7')](),controller[_0x9189('0xb')]);router[_0x9189('0x5')](_0x9189('0xc'),auth[_0x9189('0x7')](),controller[_0x9189('0xd')]);router[_0x9189('0x5')](_0x9189('0xe'),auth['isAuthenticated'](),controller[_0x9189('0xf')]);router['get'](_0x9189('0x10'),auth[_0x9189('0x7')](),controller[_0x9189('0x11')]);router[_0x9189('0x5')](_0x9189('0x12'),auth[_0x9189('0x7')](),controller['mailAccounts']);router[_0x9189('0x5')]('/openchannel/queues',auth[_0x9189('0x7')](),controller[_0x9189('0x13')]);router['get'](_0x9189('0x14'),auth[_0x9189('0x7')](),controller[_0x9189('0x15')]);router[_0x9189('0x5')](_0x9189('0x16'),auth['isAuthenticated'](),controller[_0x9189('0x17')]);router['get'](_0x9189('0x18'),auth[_0x9189('0x7')](),controller[_0x9189('0x19')]);router[_0x9189('0x5')](_0x9189('0x1a'),auth[_0x9189('0x7')](),controller['voiceQueuesPreview']);router[_0x9189('0x5')](_0x9189('0x1b'),auth[_0x9189('0x7')](),controller[_0x9189('0x1c')]);router[_0x9189('0x5')](_0x9189('0x1d'),auth['isAuthenticated'](),controller[_0x9189('0x1e')]);router['get'](_0x9189('0x1f'),auth['isAuthenticated'](),controller[_0x9189('0x20')]);router['get'](_0x9189('0x21'),auth[_0x9189('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x9189('0x5')](_0x9189('0x22'),auth[_0x9189('0x7')](),controller[_0x9189('0x23')]);router['put'](_0x9189('0x22'),auth[_0x9189('0x7')](),controller['updateVoiceQueue']);router[_0x9189('0x5')]('/outbound',auth[_0x9189('0x7')](),controller[_0x9189('0x24')]);router[_0x9189('0x5')]('/outbound/channels',auth[_0x9189('0x7')](),controller[_0x9189('0x25')]);router[_0x9189('0x5')](_0x9189('0x26'),auth[_0x9189('0x7')](),controller['agents']);router[_0x9189('0x27')](_0x9189('0x28'),auth[_0x9189('0x7')](),controller['agentCapacity']);router[_0x9189('0x5')](_0x9189('0x29'),auth[_0x9189('0x7')](),controller[_0x9189('0x2a')]);router['get'](_0x9189('0x2b'),auth[_0x9189('0x7')](),controller[_0x9189('0x2c')]);router[_0x9189('0x5')](_0x9189('0x2d'),auth[_0x9189('0x7')](),controller[_0x9189('0x2e')]);router[_0x9189('0x5')](_0x9189('0x2f'),auth['isAuthenticated'](),controller[_0x9189('0x30')]);router[_0x9189('0x5')](_0x9189('0x31'),auth[_0x9189('0x7')](),controller[_0x9189('0x32')]);router[_0x9189('0x5')](_0x9189('0x33'),auth['isAuthenticated'](),controller[_0x9189('0x34')]);router[_0x9189('0x5')](_0x9189('0x35'),auth[_0x9189('0x7')](),controller[_0x9189('0x36')]);router[_0x9189('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x9189('0x7')](),controller[_0x9189('0x37')]);router[_0x9189('0x5')](_0x9189('0x38'),auth[_0x9189('0x7')](),controller[_0x9189('0x39')]);router[_0x9189('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0x9189('0x7')](),controller['whatsappQueuesWaitingInteractions']);router['get']('/fax/queues/waitinginteractions',auth[_0x9189('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0x9189('0x3a')]('/mail/queues/:id/notify',auth[_0x9189('0x7')](),controller[_0x9189('0x3b')](_0x9189('0x3c')));router[_0x9189('0x5')](_0x9189('0x3d'),auth[_0x9189('0x7')](),controller['showMailQueues']);router[_0x9189('0x3a')](_0x9189('0x3e'),auth['isAuthenticated'](),controller[_0x9189('0x3b')](_0x9189('0x3f')));router[_0x9189('0x5')](_0x9189('0x40'),auth[_0x9189('0x7')](),controller[_0x9189('0x41')]);router[_0x9189('0x3a')](_0x9189('0x42'),auth[_0x9189('0x7')](),controller[_0x9189('0x3b')](_0x9189('0x43')));router['get'](_0x9189('0x44'),auth['isAuthenticated'](),controller[_0x9189('0x45')]);router[_0x9189('0x3a')](_0x9189('0x46'),auth[_0x9189('0x7')](),controller[_0x9189('0x3b')]('openchannel'));router[_0x9189('0x5')](_0x9189('0x47'),auth[_0x9189('0x7')](),controller[_0x9189('0x48')]);router['post'](_0x9189('0x49'),auth[_0x9189('0x7')](),controller[_0x9189('0x3b')](_0x9189('0x4a')));router[_0x9189('0x3a')](_0x9189('0x4b'),auth[_0x9189('0x7')](),controller[_0x9189('0x3b')](_0x9189('0x4c')));router['get'](_0x9189('0x4d'),auth[_0x9189('0x7')](),controller[_0x9189('0x4e')]);router[_0x9189('0x5')](_0x9189('0x4f'),auth[_0x9189('0x7')](),controller[_0x9189('0x50')]);router['post'](_0x9189('0x51'),auth[_0x9189('0x7')](),controller[_0x9189('0x52')]);module[_0x9189('0x53')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index fd9e0c4..f512f1c 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 _0x3eea=['whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','Agents','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','format','SIP/%s','interface','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x23a367,_0x256e4d){_0x23a367=_0x23a367-0x0;var _0x4e6458=_0x3eea[_0x23a367];return _0x4e6458;};'use strict';var BPromise=require(_0xa3ee('0x0'));var moment=require('moment');var _=require(_0xa3ee('0x1'));var util=require(_0xa3ee('0x2'));var db=require(_0xa3ee('0x3'))['db'];var logger=require(_0xa3ee('0x4'))(_0xa3ee('0x5'));var jayson=require(_0xa3ee('0x6'));var amiClient=jayson[_0xa3ee('0x7')][_0xa3ee('0x8')]({'port':0x232a});var mailClient=jayson[_0xa3ee('0x7')][_0xa3ee('0x8')]({'port':0x232b});var routingClient=jayson[_0xa3ee('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x538bf9,_0x4183ee,_0x4e4588){return new BPromise(function(_0x37a3f0,_0x56f37b){var _0x1eeb5b=_0x4e4588?_0x4e4588:amiClient;return _0x1eeb5b['request'](_0x538bf9,_0x4183ee)[_0xa3ee('0x9')](function(_0x5ef236){if(_0x5ef236[_0xa3ee('0xa')]){if(_0x5ef236[_0xa3ee('0xa')][_0xa3ee('0xb')]===0x1f4){return _0x56f37b(_0x5ef236['error'][_0xa3ee('0xc')]);}return _0x37a3f0(_0x5ef236[_0xa3ee('0xa')]['message']);}else{_0x37a3f0(_0x5ef236['result']);}})[_0xa3ee('0xd')](function(_0x30e652){_0x56f37b(_0x30e652);});});}function respondWithResult(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xc8;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0xe')](_0x4363d1)['json'](_0x594c88);}return _0x403518[_0xa3ee('0xf')](0x194);};}function handleError(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0x1f4;return function(_0x150e20){logger['error'](_0x150e20[_0xa3ee('0x10')]);if(_0x150e20[_0xa3ee('0x11')]){delete _0x150e20['name'];}_0x20535f['status'](_0x2c34cf)['send'](_0x150e20);};}function findById(_0x40decb){return function(_0x7277cd){if(!_[_0xa3ee('0x12')](_0x40decb)&&!_[_0xa3ee('0x12')](_0x7277cd)&&!_['isNil'](_0x7277cd[_0xa3ee('0x13')])){return _[_0xa3ee('0x14')](_0x7277cd[_0xa3ee('0x13')],function(_0x299b1e){return _0x299b1e['id']==_0x40decb;});}return null;};}exports[_0xa3ee('0x15')]=function(_0x4aac0e,_0x377b9d){return respondWithRpcPromise(_0xa3ee('0x16'),_0x4aac0e[_0xa3ee('0x17')])[_0xa3ee('0x9')](respondWithResult(_0x377b9d,null))[_0xa3ee('0xd')](handleError(_0x377b9d,null));};exports[_0xa3ee('0x18')]=function(_0x4f8c56,_0x3f5d70){return respondWithRpcPromise(_0xa3ee('0x19'),_['merge'](_0x4f8c56[_0xa3ee('0x17')],_0x4f8c56['params']))[_0xa3ee('0x9')](respondWithResult(_0x3f5d70,null))[_0xa3ee('0xd')](handleError(_0x3f5d70,null));};exports[_0xa3ee('0x1a')]=function(_0x1bd196,_0x60b899){return respondWithRpcPromise(_0xa3ee('0x1b'),_[_0xa3ee('0x1c')](_0x1bd196[_0xa3ee('0x17')],_0x1bd196[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x60b899,null))['catch'](handleError(_0x60b899,null));};exports[_0xa3ee('0x1e')]=function(_0x1dca29,_0x157071){return respondWithRpcPromise(_0xa3ee('0x1f'),_0x1dca29[_0xa3ee('0x17')])['then'](respondWithResult(_0x157071,null))[_0xa3ee('0xd')](handleError(_0x157071,null));};exports[_0xa3ee('0x20')]=function(_0x146493,_0xd9a7f8){return respondWithRpcPromise(_0xa3ee('0x1f'),_0x146493[_0xa3ee('0x17')])[_0xa3ee('0x9')](findById(_0x146493[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0xd9a7f8,null))[_0xa3ee('0xd')](handleError(_0xd9a7f8,null));};exports['updateVoiceQueue']=function(_0x5ba571,_0x4abf49){return respondWithRpcPromise(_0xa3ee('0x21'),_['merge'](_0x5ba571[_0xa3ee('0x22')],_0x5ba571[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x4abf49,null))[_0xa3ee('0xd')](handleError(_0x4abf49,null));};exports[_0xa3ee('0x23')]=function(_0x14547d,_0x30ba4e){return respondWithRpcPromise(_0xa3ee('0x24'),_[_0xa3ee('0x1c')](_0x14547d[_0xa3ee('0x17')],_0x14547d['params']))[_0xa3ee('0x9')](respondWithResult(_0x30ba4e,null))['catch'](handleError(_0x30ba4e,null));};exports[_0xa3ee('0x25')]=function(_0x332d61,_0x496839){return respondWithRpcPromise(_0xa3ee('0x26'),_0x332d61['query'])[_0xa3ee('0x9')](respondWithResult(_0x496839,null))['catch'](handleError(_0x496839,null));};exports[_0xa3ee('0x27')]=function(_0x299099,_0x2f803c){return respondWithRpcPromise(_0xa3ee('0x28'),_[_0xa3ee('0x1c')](_0x299099['query'],_0x299099[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x2f803c,null))[_0xa3ee('0xd')](handleError(_0x2f803c,null));};exports['voiceQueuesChannelHangup']=function(_0x1599e4,_0x531f58){return respondWithRpcPromise(_0xa3ee('0x29'),_['merge'](_0x1599e4[_0xa3ee('0x17')],_0x1599e4['params']))[_0xa3ee('0x9')](respondWithResult(_0x531f58,null))[_0xa3ee('0xd')](handleError(_0x531f58,null));};exports[_0xa3ee('0x2a')]=function(_0x45be9b,_0x1717ba){return respondWithRpcPromise(_0xa3ee('0x2b'),_[_0xa3ee('0x1c')](_0x45be9b[_0xa3ee('0x17')],_0x45be9b[_0xa3ee('0x1d')]))[_0xa3ee('0x9')](respondWithResult(_0x1717ba,null))[_0xa3ee('0xd')](handleError(_0x1717ba,null));};exports[_0xa3ee('0x2c')]=function(_0x447efd,_0x595b55){return respondWithRpcPromise(_0xa3ee('0x2d'),_0x447efd[_0xa3ee('0x17')])[_0xa3ee('0x9')](respondWithResult(_0x595b55,null))[_0xa3ee('0xd')](handleError(_0x595b55,null));};exports['outboundChannels']=function(_0x257627,_0x11a721){return respondWithRpcPromise(_0xa3ee('0x2e'),_0x257627['query'])[_0xa3ee('0x9')](respondWithResult(_0x11a721,null))[_0xa3ee('0xd')](handleError(_0x11a721,null));};exports['agents']=function(_0x319c26,_0x3ecbe6){var _0x4ef99a;return respondWithRpcPromise(_0xa3ee('0x2f'),_0x319c26[_0xa3ee('0x17')])[_0xa3ee('0x9')](function(_0x2c8873){_0x4ef99a=_0x2c8873;return respondWithRpcPromise(_0xa3ee('0x2f'),_0x319c26[_0xa3ee('0x17')],routingClient);})[_0xa3ee('0x9')](function(_0x3e0eec){return _[_0xa3ee('0x1c')]({},_0x3e0eec,_0x4ef99a);})[_0xa3ee('0x9')](respondWithResult(_0x3ecbe6,null))[_0xa3ee('0xd')](handleError(_0x3ecbe6,null));};exports['agentCapacity']=function(_0x5aa4b3,_0x548534){if(_0x5aa4b3[_0xa3ee('0x22')]&&_0x5aa4b3[_0xa3ee('0x22')]['interaction']&&_0x5aa4b3[_0xa3ee('0x30')]&&_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')]){for(var _0x55f47f in _0x5aa4b3[_0xa3ee('0x22')]['interaction']){if(_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0xa3ee('0x32')](_0x55f47f)){db[_0xa3ee('0x33')][_0xa3ee('0x34')]({'where':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')],'type':_0xa3ee('0x35'),'exitAt':null,'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f]&&_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0xa3ee('0x36')]?{'$notIn':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f]}:{'$ne':null}}})[_0xa3ee('0x9')](function(_0x25e0fe){var _0x4594e1=moment()['format'](_0xa3ee('0x37'));for(var _0xdca412=0x0,_0x112e80=_0x25e0fe[_0xa3ee('0x36')];_0xdca412<_0x112e80;_0xdca412+=0x1){_0x25e0fe[_0xdca412]['updateAttributes']({'exitAt':_0x4594e1});}});for(var _0x30fcf1=0x0;_0x30fcf1<_0x5aa4b3['body'][_0xa3ee('0x31')][_0x55f47f][_0xa3ee('0x36')];_0x30fcf1+=0x1){db[_0xa3ee('0x33')][_0xa3ee('0x38')]({'where':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')],'type':_0xa3ee('0x35'),'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0x30fcf1],'exitAt':null},'defaults':{'channel':_0x55f47f,'membername':_0x5aa4b3[_0xa3ee('0x30')]['name'],'interface':_[_0xa3ee('0x12')](_0x5aa4b3['user']['interface'])?util[_0xa3ee('0x39')](_0xa3ee('0x3a'),_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x11')]):_0x5aa4b3[_0xa3ee('0x30')][_0xa3ee('0x3b')],'type':_0xa3ee('0x35'),'enterAt':moment()['format'](_0xa3ee('0x37')),'role':_0xa3ee('0x3c'),'internal':_0x5aa4b3['user'][_0xa3ee('0x3d')],'uniqueid':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x31')][_0x55f47f][_0x30fcf1]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5aa4b3['params']['id'],'capacity':_0x5aa4b3[_0xa3ee('0x22')][_0xa3ee('0x3e')]},routingClient)[_0xa3ee('0x9')](respondWithResult(_0x548534,null))[_0xa3ee('0xd')](handleError(_0x548534,null));};exports[_0xa3ee('0x3f')]=function(_0x57e654,_0x55678e){return respondWithRpcPromise(_0xa3ee('0x40'),_0x57e654[_0xa3ee('0x17')])['then'](respondWithResult(_0x55678e,null))[_0xa3ee('0xd')](handleError(_0x55678e,null));};exports[_0xa3ee('0x41')]=function(_0x13cd8b,_0x579ec8){return respondWithRpcPromise('Trunks',_0x13cd8b[_0xa3ee('0x17')])['then'](respondWithResult(_0x579ec8,null))[_0xa3ee('0xd')](handleError(_0x579ec8,null));};exports[_0xa3ee('0x42')]=function(_0x5b8e79,_0x4232e0){return respondWithRpcPromise(_0xa3ee('0x43'),_0x5b8e79[_0xa3ee('0x17')])['then'](respondWithResult(_0x4232e0,null))[_0xa3ee('0xd')](handleError(_0x4232e0,null));};exports[_0xa3ee('0x44')]=function(_0x594034,_0x1d832c){return respondWithRpcPromise(_0xa3ee('0x45'),_0x594034[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x1d832c,null))['catch'](handleError(_0x1d832c,null));};exports[_0xa3ee('0x46')]=function(_0x17ac07,_0x4a1a2f){return respondWithRpcPromise(_0xa3ee('0x45'),_0x17ac07[_0xa3ee('0x17')],routingClient)['then'](findById(_0x17ac07['params']['id']))[_0xa3ee('0x9')](respondWithResult(_0x4a1a2f,null))[_0xa3ee('0xd')](handleError(_0x4a1a2f,null));};exports[_0xa3ee('0x47')]=function(_0x52b824,_0x11fb6e){return respondWithRpcPromise(_0xa3ee('0x48'),_0x52b824[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x11fb6e,null))[_0xa3ee('0xd')](handleError(_0x11fb6e,null));};exports[_0xa3ee('0x49')]=function(_0x497be4,_0x10f508){return respondWithRpcPromise(_0xa3ee('0x48'),_0x497be4['query'],routingClient)[_0xa3ee('0x9')](findById(_0x497be4[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0x10f508,null))[_0xa3ee('0xd')](handleError(_0x10f508,null));};exports[_0xa3ee('0x4a')]=function(_0x330778,_0x4a2255){return respondWithRpcPromise(_0xa3ee('0x4b'),_0x330778[_0xa3ee('0x17')],mailClient)[_0xa3ee('0x9')](respondWithResult(_0x4a2255,null))['catch'](handleError(_0x4a2255,null));};exports[_0xa3ee('0x4c')]=function(_0x13b81b,_0x519f10){return respondWithRpcPromise('OpenchannelQueues',_0x13b81b['query'],routingClient)['then'](respondWithResult(_0x519f10,null))[_0xa3ee('0xd')](handleError(_0x519f10,null));};exports[_0xa3ee('0x4d')]=function(_0x3adafb,_0x2f0424){return respondWithRpcPromise(_0xa3ee('0x4e'),_0x3adafb[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x3adafb['params']['id']))[_0xa3ee('0x9')](respondWithResult(_0x2f0424,null))[_0xa3ee('0xd')](handleError(_0x2f0424,null));};exports[_0xa3ee('0x4f')]=function(_0xaff641,_0x147024){return respondWithRpcPromise('SmsQueues',_0xaff641['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x147024,null))[_0xa3ee('0xd')](handleError(_0x147024,null));};exports[_0xa3ee('0x50')]=function(_0x24613d,_0x16aabe){return respondWithRpcPromise(_0xa3ee('0x51'),_0x24613d[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x24613d[_0xa3ee('0x1d')]['id']))[_0xa3ee('0x9')](respondWithResult(_0x16aabe,null))[_0xa3ee('0xd')](handleError(_0x16aabe,null));};exports[_0xa3ee('0x52')]=function(_0x64f353,_0x224790){return respondWithRpcPromise(_0xa3ee('0x53'),_0x64f353['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x224790,null))['catch'](handleError(_0x224790,null));};exports['showWhatsappQueues']=function(_0x2b1c6e,_0x49daf9){return respondWithRpcPromise(_0xa3ee('0x53'),_0x2b1c6e[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](findById(_0x2b1c6e[_0xa3ee('0x1d')]['id']))['then'](respondWithResult(_0x49daf9,null))[_0xa3ee('0xd')](handleError(_0x49daf9,null));};exports[_0xa3ee('0x54')]=function(_0x179ae2,_0x370e3e){return respondWithRpcPromise('FaxQueues',_0x179ae2[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x370e3e,null))['catch'](handleError(_0x370e3e,null));};exports[_0xa3ee('0x55')]=function(_0x52a066,_0x4f3aac){return respondWithRpcPromise(_0xa3ee('0x56'),_0x52a066['query'],routingClient)['then'](findById(_0x52a066[_0xa3ee('0x1d')]['id']))['then'](respondWithResult(_0x4f3aac,null))['catch'](handleError(_0x4f3aac,null));};exports[_0xa3ee('0x57')]=function(_0xf8689f,_0x538a9b){return respondWithRpcPromise('FaxAccounts',_0xf8689f['query'])[_0xa3ee('0x9')](respondWithResult(_0x538a9b,null))[_0xa3ee('0xd')](handleError(_0x538a9b,null));};exports[_0xa3ee('0x58')]=function(_0x7844ae,_0x389547){return respondWithRpcPromise(_0xa3ee('0x59'),_0x7844ae['query'],routingClient)['then'](respondWithResult(_0x389547,null))[_0xa3ee('0xd')](handleError(_0x389547,null));};exports[_0xa3ee('0x5a')]=function(_0x42a79e,_0x5675fb){return respondWithRpcPromise(_0xa3ee('0x5b'),_0x42a79e[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x5675fb,null))[_0xa3ee('0xd')](handleError(_0x5675fb,null));};exports[_0xa3ee('0x5c')]=function(_0x3be877,_0x2ad745){return respondWithRpcPromise(_0xa3ee('0x5d'),_0x3be877['query'],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x2ad745,null))[_0xa3ee('0xd')](handleError(_0x2ad745,null));};exports[_0xa3ee('0x5e')]=function(_0x37e1c2,_0xbfb429){return respondWithRpcPromise(_0xa3ee('0x5d'),_0x37e1c2[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](function(_0x448f14){if(_0x37e1c2['query']['type']!==undefined){var _0x228671=_(_0x448f14['rows'])[_0xa3ee('0x5f')]([_0x37e1c2[_0xa3ee('0x17')][_0xa3ee('0x60')],_0x37e1c2[_0xa3ee('0x1d')]['id']])['map'](_0xa3ee('0x61'))[_0xa3ee('0x62')]()[_0xa3ee('0x63')]();return _0x448f14[_0xa3ee('0x13')][_0xa3ee('0x5f')](function(_0x4e9473){return _0x228671[_0xa3ee('0x64')](_0x4e9473[_0xa3ee('0x61')])>-0x1;});}else{return _0x448f14[_0xa3ee('0x13')]['filter'](function(_0x3ca523){return _0x3ca523['queue_id']===parseInt(_0x37e1c2[_0xa3ee('0x1d')]['id']);});}})['then'](respondWithResult(_0xbfb429,null))[_0xa3ee('0xd')](handleError(_0xbfb429,null));};exports[_0xa3ee('0x65')]=function(_0x119c3d,_0x140ee0){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x119c3d[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x140ee0,null))['catch'](handleError(_0x140ee0,null));};exports[_0xa3ee('0x66')]=function(_0xa82482,_0x44b084){return respondWithRpcPromise(_0xa3ee('0x67'),_0xa82482[_0xa3ee('0x17')],routingClient)['then'](respondWithResult(_0x44b084,null))[_0xa3ee('0xd')](handleError(_0x44b084,null));};exports[_0xa3ee('0x68')]=function(_0x55a6b7,_0x2535ef){return respondWithRpcPromise(_0xa3ee('0x69'),_0x55a6b7[_0xa3ee('0x17')],routingClient)[_0xa3ee('0x9')](respondWithResult(_0x2535ef,null))[_0xa3ee('0xd')](handleError(_0x2535ef,null));};exports[_0xa3ee('0x6a')]=function(_0x31d3ca){return function(_0x329e32,_0x37bde3){var _0x25334c,_0x4f7ace;var _0x21fd56=_[_0xa3ee('0x6b')](_0x31d3ca);var _0x26a124=_0x31d3ca==='chat'?_0xa3ee('0x6c'):'Account';return db[_0x21fd56+_0xa3ee('0x6d')][_0xa3ee('0x6e')]({'raw':!![],'where':{'id':_0x329e32['params']['id']}})[_0xa3ee('0x9')](function(_0x44f27b){if(_['isNil'](_0x44f27b)){throw new Error(_0x21fd56+_0xa3ee('0x6f'));}_0x25334c=_0x44f27b;return db[_0x21fd56+_0xa3ee('0x70')][_0xa3ee('0x6e')]({'where':{'id':_0x329e32[_0xa3ee('0x22')][_0xa3ee('0x71')]},'include':[{'model':db[_0x21fd56+_0xa3ee('0x72')],'as':'Interaction'},{'model':db[_0x21fd56+_0x26a124],'as':'Account'}]});})['then'](function(_0x27454a){if(_['isNil'](_0x27454a)){throw new Error(_0x21fd56+_0xa3ee('0x73'));}_0x4f7ace=_0x27454a;return _0x27454a[_0xa3ee('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa3ee('0x9')](function(){var _0x312ad8={'uniqueid':_0x31d3ca+'.'+_0x4f7ace['id']+'.'+_0x4f7ace[_0xa3ee('0x72')]['id'],'FromUserId':_0x329e32[_0xa3ee('0x30')]['id'],'type':_0xa3ee('0x75')};_0x312ad8[_0x21fd56+_0xa3ee('0x76')]=_0x4f7ace['id'];_0x312ad8[_0x21fd56+_0xa3ee('0x77')]=_0x4f7ace[_0xa3ee('0x72')]['id'];_0x312ad8[_0xa3ee('0x78')+_0x21fd56+_0x26a124+'Id']=_0x4f7ace[_0xa3ee('0x79')]['id'];_0x312ad8['To'+_0x21fd56+_0xa3ee('0x7a')]=_0x25334c['id'];return db[_0x21fd56+_0xa3ee('0x7b')][_0xa3ee('0x7c')](_0x312ad8);})[_0xa3ee('0x9')](function(){return respondWithRpcPromise(_0xa3ee('0x7d'),{'channel':_0x31d3ca,'interaction':_0x4f7ace[_0xa3ee('0x72')],'message':_0x4f7ace,'account':_0x4f7ace[_0xa3ee('0x79')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x25334c[_0xa3ee('0x11')]+','+(_0x4f7ace[_0xa3ee('0x79')][_0xa3ee('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x37bde3,null))[_0xa3ee('0xd')](handleError(_0x37bde3,null));};};exports[_0xa3ee('0x7f')]=function(_0x591bfa,_0x5b53f1){var _0x24cbc9,_0x157436;if(_[_0xa3ee('0x12')](_0x591bfa[_0xa3ee('0x22')][_0xa3ee('0x80')])){throw new Error(_0xa3ee('0x81'));}var _0x18a74b=_0x591bfa[_0xa3ee('0x22')][_0xa3ee('0x80')];var _0x3e6657=_[_0xa3ee('0x6b')](_0x18a74b);var _0x3236b3=_0x18a74b===_0xa3ee('0x82')?'Website':_0xa3ee('0x79');return db[_0xa3ee('0x83')][_0xa3ee('0x6e')]({'raw':!![],'where':{'id':_0x591bfa[_0xa3ee('0x1d')]['id'],'role':_0xa3ee('0x3c')}})[_0xa3ee('0x9')](function(_0x4cc5e5){if(_['isNil'](_0x4cc5e5)){throw new Error(_0xa3ee('0x84'));}_0x24cbc9=_0x4cc5e5;return db[_0x3e6657+_0xa3ee('0x70')][_0xa3ee('0x6e')]({'where':{'id':_0x591bfa['body'][_0xa3ee('0x71')]},'include':[{'model':db[_0x3e6657+'Interaction'],'as':_0xa3ee('0x72')},{'model':db[_0x3e6657+_0x3236b3],'as':_0xa3ee('0x79')}]});})[_0xa3ee('0x9')](function(_0x10ec99){if(_[_0xa3ee('0x12')](_0x10ec99)){throw new Error(_0x3e6657+_0xa3ee('0x73'));}_0x157436=_0x10ec99;return _0x10ec99[_0xa3ee('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa3ee('0x9')](function(){var _0x116de1={'uniqueid':_0x18a74b+'.'+_0x157436['id']+'.'+_0x157436[_0xa3ee('0x72')]['id'],'FromUserId':_0x591bfa['user']['id'],'type':'queue','ToUserId':_0x24cbc9['id']};_0x116de1[_0x3e6657+'MessageId']=_0x157436['id'];_0x116de1[_0x3e6657+_0xa3ee('0x77')]=_0x157436['Interaction']['id'];_0x116de1[_0xa3ee('0x78')+_0x3e6657+_0x3236b3+'Id']=_0x157436[_0xa3ee('0x79')]['id'];return db[_0x3e6657+_0xa3ee('0x7b')][_0xa3ee('0x7c')](_0x116de1);})[_0xa3ee('0x9')](function(){return respondWithRpcPromise(_0xa3ee('0x7d'),{'channel':_0x18a74b,'interaction':_0x157436[_0xa3ee('0x72')],'message':_0x157436,'account':_0x157436[_0xa3ee('0x79')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa3ee('0x3c'),'appdata':_0x24cbc9['name']+','+(_0x157436['Account'][_0xa3ee('0x85')]||0x12c),'interval':_0xa3ee('0x86')}]},routingClient);})[_0xa3ee('0x9')](respondWithResult(_0x5b53f1,null))[_0xa3ee('0xd')](handleError(_0x5b53f1,null));}; \ No newline at end of file +var _0xed1f=['voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','queue','MessageId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','update','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','query'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xed1f,0x6a));var _0xfed1=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xed1f[_0x40a825];return _0x273a54;};'use strict';var BPromise=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var _=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var db=require(_0xfed1('0x4'))['db'];var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));var jayson=require(_0xfed1('0x7'));var amiClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232a});var mailClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232b});var routingClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){var _0x42dd5c=_0x2a6082?_0x2a6082:amiClient;return _0x42dd5c[_0xfed1('0xa')](_0x380e18,_0x612b38)['then'](function(_0x1414be){if(_0x1414be[_0xfed1('0xb')]){if(_0x1414be['error'][_0xfed1('0xc')]===0x1f4){return _0x568d48(_0x1414be['error'][_0xfed1('0xd')]);}return _0x2967ef(_0x1414be[_0xfed1('0xb')]['message']);}else{_0x2967ef(_0x1414be['result']);}})[_0xfed1('0xe')](function(_0xe84ba6){_0x568d48(_0xe84ba6);});});}function respondWithResult(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xc8;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['status'](_0x17f4fe)[_0xfed1('0xf')](_0x5a3469);}return _0x569a6e[_0xfed1('0x10')](0x194);};}function handleError(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0x1f4;return function(_0x5b9455){logger['error'](_0x5b9455[_0xfed1('0x11')]);if(_0x5b9455[_0xfed1('0x12')]){delete _0x5b9455[_0xfed1('0x12')];}_0x532537[_0xfed1('0x13')](_0x2dde3a)['send'](_0x5b9455);};}function findById(_0x1a00f6){return function(_0x4af928){if(!_[_0xfed1('0x14')](_0x1a00f6)&&!_[_0xfed1('0x14')](_0x4af928)&&!_['isNil'](_0x4af928[_0xfed1('0x15')])){return _[_0xfed1('0x16')](_0x4af928['rows'],function(_0x59509b){return _0x59509b['id']==_0x1a00f6;});}return null;};}exports['voiceChannels']=function(_0x1e5afb,_0x51f12a){return respondWithRpcPromise(_0xfed1('0x17'),_0x1e5afb[_0xfed1('0x18')])['then'](respondWithResult(_0x51f12a,null))[_0xfed1('0xe')](handleError(_0x51f12a,null));};exports[_0xfed1('0x19')]=function(_0x59ee9d,_0x3ce944){return respondWithRpcPromise(_0xfed1('0x1a'),_[_0xfed1('0x1b')](_0x59ee9d[_0xfed1('0x18')],_0x59ee9d['params']))[_0xfed1('0x1c')](respondWithResult(_0x3ce944,null))['catch'](handleError(_0x3ce944,null));};exports[_0xfed1('0x1d')]=function(_0x1317c8,_0x37c384){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xfed1('0x1b')](_0x1317c8['query'],_0x1317c8[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x37c384,null))[_0xfed1('0xe')](handleError(_0x37c384,null));};exports[_0xfed1('0x1f')]=function(_0x186ecc,_0x1199b7){return respondWithRpcPromise('VoiceQueues',_0x186ecc[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1199b7,null))['catch'](handleError(_0x1199b7,null));};exports[_0xfed1('0x20')]=function(_0x2b9dd2,_0x1b871a){return respondWithRpcPromise(_0xfed1('0x21'),_0x2b9dd2[_0xfed1('0x18')])[_0xfed1('0x1c')](findById(_0x2b9dd2['params']['id']))[_0xfed1('0x1c')](respondWithResult(_0x1b871a,null))['catch'](handleError(_0x1b871a,null));};exports[_0xfed1('0x22')]=function(_0x4e5249,_0x53b0c9){return respondWithRpcPromise(_0xfed1('0x23'),_[_0xfed1('0x1b')](_0x4e5249[_0xfed1('0x24')],_0x4e5249['params']))[_0xfed1('0x1c')](respondWithResult(_0x53b0c9,null))[_0xfed1('0xe')](handleError(_0x53b0c9,null));};exports[_0xfed1('0x25')]=function(_0x383955,_0x12399f){return respondWithRpcPromise(_0xfed1('0x26'),_['merge'](_0x383955[_0xfed1('0x18')],_0x383955[_0xfed1('0x1e')]))['then'](respondWithResult(_0x12399f,null))['catch'](handleError(_0x12399f,null));};exports[_0xfed1('0x27')]=function(_0x2d10f5,_0x2def09){return respondWithRpcPromise(_0xfed1('0x28'),_0x2d10f5[_0xfed1('0x18')])['then'](respondWithResult(_0x2def09,null))[_0xfed1('0xe')](handleError(_0x2def09,null));};exports[_0xfed1('0x29')]=function(_0x10143b,_0x349de1){return respondWithRpcPromise(_0xfed1('0x2a'),_['merge'](_0x10143b[_0xfed1('0x18')],_0x10143b['params']))[_0xfed1('0x1c')](respondWithResult(_0x349de1,null))[_0xfed1('0xe')](handleError(_0x349de1,null));};exports[_0xfed1('0x2b')]=function(_0x321c1b,_0x1c0523){return respondWithRpcPromise(_0xfed1('0x2c'),_[_0xfed1('0x1b')](_0x321c1b[_0xfed1('0x18')],_0x321c1b['params']))[_0xfed1('0x1c')](respondWithResult(_0x1c0523,null))[_0xfed1('0xe')](handleError(_0x1c0523,null));};exports[_0xfed1('0x2d')]=function(_0x28adfc,_0x57da75){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xfed1('0x1b')](_0x28adfc[_0xfed1('0x18')],_0x28adfc[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x57da75,null))[_0xfed1('0xe')](handleError(_0x57da75,null));};exports[_0xfed1('0x2e')]=function(_0x46a150,_0x2f183c){return respondWithRpcPromise('Outbound',_0x46a150['query'])[_0xfed1('0x1c')](respondWithResult(_0x2f183c,null))[_0xfed1('0xe')](handleError(_0x2f183c,null));};exports['outboundChannels']=function(_0x1dae7c,_0x15339c){return respondWithRpcPromise(_0xfed1('0x2f'),_0x1dae7c[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x15339c,null))[_0xfed1('0xe')](handleError(_0x15339c,null));};exports[_0xfed1('0x30')]=function(_0x4118d4,_0x3c27de){var _0x5f3e1f;return respondWithRpcPromise('Agents',_0x4118d4['query'])[_0xfed1('0x1c')](function(_0x340e3c){_0x5f3e1f=_0x340e3c;return respondWithRpcPromise(_0xfed1('0x31'),_0x4118d4['query'],routingClient);})[_0xfed1('0x1c')](function(_0x4a0b04){return _[_0xfed1('0x1b')]({},_0x4a0b04,_0x5f3e1f);})[_0xfed1('0x1c')](respondWithResult(_0x3c27de,null))[_0xfed1('0xe')](handleError(_0x3c27de,null));};exports['agentCapacity']=function(_0x20bdae,_0x6f1647){if(_0x20bdae[_0xfed1('0x24')]&&_0x20bdae['body'][_0xfed1('0x32')]&&_0x20bdae['user']&&_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]){for(var _0x229fc7 in _0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')]){if(_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0xfed1('0x34')](_0x229fc7)){db[_0xfed1('0x35')]['findAll']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'exitAt':null,'uniqueid':_0x20bdae['body']['interaction'][_0x229fc7]&&_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')]?{'$notIn':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7]}:{'$ne':null}}})[_0xfed1('0x1c')](function(_0x2547ee){var _0x24bf7a=moment()[_0xfed1('0x38')](_0xfed1('0x39'));for(var _0x61f65b=0x0,_0x1db6dc=_0x2547ee['length'];_0x61f65b<_0x1db6dc;_0x61f65b+=0x1){_0x2547ee[_0x61f65b][_0xfed1('0x3a')]({'exitAt':_0x24bf7a});}});for(var _0xb61d09=0x0;_0xb61d09<_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')];_0xb61d09+=0x1){db[_0xfed1('0x35')]['findOrCreate']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'uniqueid':_0x20bdae['body'][_0xfed1('0x32')][_0x229fc7][_0xb61d09],'exitAt':null},'defaults':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'interface':_[_0xfed1('0x14')](_0x20bdae['user'][_0xfed1('0x3b')])?util[_0xfed1('0x38')](_0xfed1('0x3c'),_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]):_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3b')],'type':_0xfed1('0x36'),'enterAt':moment()[_0xfed1('0x38')](_0xfed1('0x39')),'role':_0xfed1('0x3d'),'internal':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3e')],'uniqueid':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xb61d09]}});}}}}return respondWithRpcPromise(_0xfed1('0x3f'),{'id':_0x20bdae[_0xfed1('0x1e')]['id'],'capacity':_0x20bdae[_0xfed1('0x24')]['capacity']},routingClient)['then'](respondWithResult(_0x6f1647,null))[_0xfed1('0xe')](handleError(_0x6f1647,null));};exports[_0xfed1('0x40')]=function(_0x5be0c3,_0x1358c1){return respondWithRpcPromise('Telephones',_0x5be0c3[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1358c1,null))['catch'](handleError(_0x1358c1,null));};exports['trunks']=function(_0x49f696,_0x2376b3){return respondWithRpcPromise(_0xfed1('0x41'),_0x49f696[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x2376b3,null))[_0xfed1('0xe')](handleError(_0x2376b3,null));};exports[_0xfed1('0x42')]=function(_0x1a9f22,_0x144102){return respondWithRpcPromise(_0xfed1('0x43'),_0x1a9f22[_0xfed1('0x18')])['then'](respondWithResult(_0x144102,null))['catch'](handleError(_0x144102,null));};exports[_0xfed1('0x44')]=function(_0x2a2eaa,_0x3f4db7){return respondWithRpcPromise(_0xfed1('0x45'),_0x2a2eaa[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x3f4db7,null))[_0xfed1('0xe')](handleError(_0x3f4db7,null));};exports[_0xfed1('0x46')]=function(_0x117e25,_0x427fa6){return respondWithRpcPromise(_0xfed1('0x45'),_0x117e25[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x117e25[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x427fa6,null))[_0xfed1('0xe')](handleError(_0x427fa6,null));};exports[_0xfed1('0x47')]=function(_0x54eb53,_0x5b167b){return respondWithRpcPromise(_0xfed1('0x48'),_0x54eb53[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5b167b,null))[_0xfed1('0xe')](handleError(_0x5b167b,null));};exports[_0xfed1('0x49')]=function(_0x41a22a,_0x2ccdc3){return respondWithRpcPromise(_0xfed1('0x48'),_0x41a22a[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x41a22a[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x2ccdc3,null))[_0xfed1('0xe')](handleError(_0x2ccdc3,null));};exports[_0xfed1('0x4a')]=function(_0x59ecc4,_0x30cf99){return respondWithRpcPromise('MailAccounts',_0x59ecc4['query'],mailClient)[_0xfed1('0x1c')](respondWithResult(_0x30cf99,null))['catch'](handleError(_0x30cf99,null));};exports[_0xfed1('0x4b')]=function(_0x5acc45,_0x390fc0){return respondWithRpcPromise(_0xfed1('0x4c'),_0x5acc45['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390fc0,null))[_0xfed1('0xe')](handleError(_0x390fc0,null));};exports['showOpenchannelQueues']=function(_0x29b51e,_0x41b407){return respondWithRpcPromise(_0xfed1('0x4c'),_0x29b51e[_0xfed1('0x18')],routingClient)['then'](findById(_0x29b51e[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x41b407,null))[_0xfed1('0xe')](handleError(_0x41b407,null));};exports[_0xfed1('0x4d')]=function(_0x23347a,_0xf4e660){return respondWithRpcPromise(_0xfed1('0x4e'),_0x23347a[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0xf4e660,null))[_0xfed1('0xe')](handleError(_0xf4e660,null));};exports[_0xfed1('0x4f')]=function(_0x18e958,_0x4112c1){return respondWithRpcPromise(_0xfed1('0x4e'),_0x18e958[_0xfed1('0x18')],routingClient)['then'](findById(_0x18e958['params']['id']))['then'](respondWithResult(_0x4112c1,null))[_0xfed1('0xe')](handleError(_0x4112c1,null));};exports[_0xfed1('0x50')]=function(_0x3aea22,_0x2fb9b2){return respondWithRpcPromise('WhatsappQueues',_0x3aea22[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x2fb9b2,null))[_0xfed1('0xe')](handleError(_0x2fb9b2,null));};exports[_0xfed1('0x51')]=function(_0x18af7d,_0x3beef3){return respondWithRpcPromise(_0xfed1('0x52'),_0x18af7d['query'],routingClient)[_0xfed1('0x1c')](findById(_0x18af7d[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x3beef3,null))['catch'](handleError(_0x3beef3,null));};exports[_0xfed1('0x53')]=function(_0x103628,_0x28dbaa){return respondWithRpcPromise(_0xfed1('0x54'),_0x103628['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x28dbaa,null))['catch'](handleError(_0x28dbaa,null));};exports[_0xfed1('0x55')]=function(_0x2d64d3,_0x4b685b){return respondWithRpcPromise('FaxQueues',_0x2d64d3[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x2d64d3[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x4b685b,null))['catch'](handleError(_0x4b685b,null));};exports[_0xfed1('0x56')]=function(_0x440e40,_0x42bc11){return respondWithRpcPromise(_0xfed1('0x57'),_0x440e40[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x42bc11,null))['catch'](handleError(_0x42bc11,null));};exports[_0xfed1('0x58')]=function(_0x93411d,_0x5ceedd){return respondWithRpcPromise(_0xfed1('0x59'),_0x93411d[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5ceedd,null))[_0xfed1('0xe')](handleError(_0x5ceedd,null));};exports[_0xfed1('0x5a')]=function(_0x26ecb9,_0x4fc7b5){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x26ecb9[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x4fc7b5,null))[_0xfed1('0xe')](handleError(_0x4fc7b5,null));};exports[_0xfed1('0x5b')]=function(_0x5d8742,_0xdc237c){return respondWithRpcPromise(_0xfed1('0x5c'),_0x5d8742[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xdc237c,null))[_0xfed1('0xe')](handleError(_0xdc237c,null));};exports[_0xfed1('0x5d')]=function(_0x4104fe,_0x49213b){return respondWithRpcPromise(_0xfed1('0x5c'),_0x4104fe[_0xfed1('0x18')],routingClient)['then'](function(_0x544605){if(_0x4104fe[_0xfed1('0x18')]['type']!==undefined){var _0x1f4e2b=_(_0x544605[_0xfed1('0x15')])[_0xfed1('0x5e')]([_0x4104fe['query'][_0xfed1('0x5f')],_0x4104fe[_0xfed1('0x1e')]['id']])[_0xfed1('0x60')](_0xfed1('0x61'))[_0xfed1('0x62')]()['value']();return _0x544605[_0xfed1('0x15')][_0xfed1('0x5e')](function(_0x45348d){return _0x1f4e2b[_0xfed1('0x63')](_0x45348d[_0xfed1('0x61')])>-0x1;});}else{return _0x544605['rows'][_0xfed1('0x5e')](function(_0xe74336){return _0xe74336[_0xfed1('0x61')]===parseInt(_0x4104fe[_0xfed1('0x1e')]['id']);});}})[_0xfed1('0x1c')](respondWithResult(_0x49213b,null))[_0xfed1('0xe')](handleError(_0x49213b,null));};exports[_0xfed1('0x64')]=function(_0x4238bd,_0x390eb0){return respondWithRpcPromise(_0xfed1('0x65'),_0x4238bd['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390eb0,null))[_0xfed1('0xe')](handleError(_0x390eb0,null));};exports[_0xfed1('0x66')]=function(_0x383d34,_0x194f42){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x383d34[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x194f42,null))[_0xfed1('0xe')](handleError(_0x194f42,null));};exports[_0xfed1('0x67')]=function(_0x221ed8,_0xb76860){return respondWithRpcPromise(_0xfed1('0x68'),_0x221ed8[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xb76860,null))['catch'](handleError(_0xb76860,null));};exports['queueNotify']=function(_0xc3b72a){return function(_0x547d9c,_0x25cebc){var _0x3ab92e,_0x483b16;var _0x4b355d=_['capitalize'](_0xc3b72a);var _0x304cc0=_0xc3b72a==='chat'?_0xfed1('0x69'):'Account';return db[_0x4b355d+_0xfed1('0x6a')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x547d9c[_0xfed1('0x1e')]['id']}})[_0xfed1('0x1c')](function(_0x3c6ddd){if(_['isNil'](_0x3c6ddd)){throw new Error(_0x4b355d+_0xfed1('0x6c'));}_0x3ab92e=_0x3c6ddd;return db[_0x4b355d+_0xfed1('0x6d')]['findOne']({'where':{'id':_0x547d9c[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x4b355d+'Interaction'],'as':_0xfed1('0x6f')},{'model':db[_0x4b355d+_0x304cc0],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x5cf634){if(_[_0xfed1('0x14')](_0x5cf634)){throw new Error(_0x4b355d+_0xfed1('0x71'));}_0x483b16=_0x5cf634;return _0x5cf634['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0xc81c8f={'uniqueid':_0xc3b72a+'.'+_0x483b16['id']+'.'+_0x483b16[_0xfed1('0x6f')]['id'],'FromUserId':_0x547d9c['user']['id'],'type':_0xfed1('0x72')};_0xc81c8f[_0x4b355d+_0xfed1('0x73')]=_0x483b16['id'];_0xc81c8f[_0x4b355d+'InteractionId']=_0x483b16['Interaction']['id'];_0xc81c8f[_0xfed1('0x74')+_0x4b355d+_0x304cc0+'Id']=_0x483b16[_0xfed1('0x70')]['id'];_0xc81c8f['To'+_0x4b355d+_0xfed1('0x75')]=_0x3ab92e['id'];return db[_0x4b355d+_0xfed1('0x76')][_0xfed1('0x77')](_0xc81c8f);})[_0xfed1('0x1c')](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0xc3b72a,'interaction':_0x483b16[_0xfed1('0x6f')],'message':_0x483b16,'account':_0x483b16[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x72'),'appdata':_0x3ab92e[_0xfed1('0x12')]+','+(_0x483b16[_0xfed1('0x70')]['queueTransferTimeout']||0x12c),'interval':_0xfed1('0x79')}]},routingClient);})[_0xfed1('0x1c')](respondWithResult(_0x25cebc,null))['catch'](handleError(_0x25cebc,null));};};exports[_0xfed1('0x7a')]=function(_0x1f721d,_0x5f5d42){var _0x3d4aee,_0x408ee0;if(_[_0xfed1('0x14')](_0x1f721d[_0xfed1('0x24')]['channel'])){throw new Error(_0xfed1('0x7b'));}var _0x24ab18=_0x1f721d[_0xfed1('0x24')][_0xfed1('0x7c')];var _0x1ecef6=_[_0xfed1('0x7d')](_0x24ab18);var _0x2d0cbb=_0x24ab18===_0xfed1('0x7e')?'Website':_0xfed1('0x70');return db[_0xfed1('0x7f')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x1f721d['params']['id'],'role':_0xfed1('0x3d')}})[_0xfed1('0x1c')](function(_0x45a677){if(_['isNil'](_0x45a677)){throw new Error('Agent\x20not\x20found');}_0x3d4aee=_0x45a677;return db[_0x1ecef6+_0xfed1('0x6d')][_0xfed1('0x6b')]({'where':{'id':_0x1f721d[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x1ecef6+_0xfed1('0x6f')],'as':_0xfed1('0x6f')},{'model':db[_0x1ecef6+_0x2d0cbb],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x130eb2){if(_[_0xfed1('0x14')](_0x130eb2)){throw new Error(_0x1ecef6+_0xfed1('0x71'));}_0x408ee0=_0x130eb2;return _0x130eb2[_0xfed1('0x80')]({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0x18b086={'uniqueid':_0x24ab18+'.'+_0x408ee0['id']+'.'+_0x408ee0[_0xfed1('0x6f')]['id'],'FromUserId':_0x1f721d[_0xfed1('0x33')]['id'],'type':_0xfed1('0x72'),'ToUserId':_0x3d4aee['id']};_0x18b086[_0x1ecef6+_0xfed1('0x73')]=_0x408ee0['id'];_0x18b086[_0x1ecef6+_0xfed1('0x81')]=_0x408ee0[_0xfed1('0x6f')]['id'];_0x18b086['From'+_0x1ecef6+_0x2d0cbb+'Id']=_0x408ee0[_0xfed1('0x70')]['id'];return db[_0x1ecef6+_0xfed1('0x76')][_0xfed1('0x77')](_0x18b086);})['then'](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0x24ab18,'interaction':_0x408ee0[_0xfed1('0x6f')],'message':_0x408ee0,'account':_0x408ee0[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x3d'),'appdata':_0x3d4aee[_0xfed1('0x12')]+','+(_0x408ee0[_0xfed1('0x70')][_0xfed1('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x5f5d42,null))[_0xfed1('0xe')](handleError(_0x5f5d42,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 4eec0e9..5c5bd63 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 _0x4ce0=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/run','run','post','create'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4ce0,0x15f));var _0x04ce=function(_0x28ae11,_0x12043f){_0x28ae11=_0x28ae11-0x0;var _0x32bb34=_0x4ce0[_0x28ae11];return _0x32bb34;};'use strict';var multer=require(_0x04ce('0x0'));var util=require(_0x04ce('0x1'));var path=require(_0x04ce('0x2'));var timeout=require(_0x04ce('0x3'));var express=require(_0x04ce('0x4'));var router=express['Router']();var fs_extra=require(_0x04ce('0x5'));var auth=require(_0x04ce('0x6'));var interaction=require(_0x04ce('0x7'));var config=require(_0x04ce('0x8'));var controller=require('./schedule.controller');router[_0x04ce('0x9')]('/',auth[_0x04ce('0xa')](),controller[_0x04ce('0xb')]);router[_0x04ce('0x9')]('/:id',auth[_0x04ce('0xa')](),controller[_0x04ce('0xc')]);router[_0x04ce('0x9')](_0x04ce('0xd'),auth['isAuthenticated'](),controller[_0x04ce('0xe')]);router[_0x04ce('0xf')]('/',auth[_0x04ce('0xa')](),controller[_0x04ce('0x10')]);router[_0x04ce('0x11')](_0x04ce('0x12'),auth[_0x04ce('0xa')](),controller[_0x04ce('0x13')]);router[_0x04ce('0x14')](_0x04ce('0x12'),auth[_0x04ce('0xa')](),controller[_0x04ce('0x15')]);module[_0x04ce('0x16')]=router; \ No newline at end of file +var _0xa618=['/:id','show','/:id/run','post','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index'];(function(_0x452e3d,_0x5dcac0){var _0x22bcc8=function(_0x45e917){while(--_0x45e917){_0x452e3d['push'](_0x452e3d['shift']());}};_0x22bcc8(++_0x5dcac0);}(_0xa618,0x193));var _0x8a61=function(_0x53c3e6,_0x1a0221){_0x53c3e6=_0x53c3e6-0x0;var _0x41fd8c=_0xa618[_0x53c3e6];return _0x41fd8c;};'use strict';var multer=require(_0x8a61('0x0'));var util=require(_0x8a61('0x1'));var path=require(_0x8a61('0x2'));var timeout=require(_0x8a61('0x3'));var express=require(_0x8a61('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8a61('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a61('0x6'));var controller=require(_0x8a61('0x7'));router[_0x8a61('0x8')]('/',auth[_0x8a61('0x9')](),controller[_0x8a61('0xa')]);router[_0x8a61('0x8')](_0x8a61('0xb'),auth['isAuthenticated'](),controller[_0x8a61('0xc')]);router[_0x8a61('0x8')](_0x8a61('0xd'),auth['isAuthenticated'](),controller['run']);router[_0x8a61('0xe')]('/',auth[_0x8a61('0x9')](),controller['create']);router['put'](_0x8a61('0xb'),auth[_0x8a61('0x9')](),controller[_0x8a61('0xf')]);router[_0x8a61('0x10')](_0x8a61('0xb'),auth[_0x8a61('0x9')](),controller['destroy']);module[_0x8a61('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 3792049..35e7962 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 _0x7fba=['custom','TEXT','sequelize','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','minutes','days','xlsx','csv','default'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fba,0x122));var _0xa7fb=function(_0x18fa1b,_0x3b6d3e){_0x18fa1b=_0x18fa1b-0x0;var _0x4036e6=_0x7fba[_0x18fa1b];return _0x4036e6;};'use strict';var Sequelize=require(_0xa7fb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa7fb('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa7fb('0x2')],'allowNull':![],'defaultValue':_0xa7fb('0x3')},'startAt':{'type':Sequelize[_0xa7fb('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xa7fb('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xa7fb('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa7fb('0x6')]('years',_0xa7fb('0x7'),_0xa7fb('0x8'),'weeks','days','hours',_0xa7fb('0x9')),'allowNull':![],'defaultValue':_0xa7fb('0xa')},'output':{'type':Sequelize[_0xa7fb('0x6')]('csv','pdf',_0xa7fb('0xb')),'allowNull':![],'defaultValue':_0xa7fb('0xc')},'type':{'type':Sequelize[_0xa7fb('0x6')]('custom',_0xa7fb('0xd')),'allowNull':![],'defaultValue':_0xa7fb('0xe')},'sendMail':{'type':Sequelize[_0xa7fb('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xa7fb('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xa7fb('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xa7fb('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd790=['exports','STRING','0\x200\x20*\x20*\x20*','DATE','years','quarters','weeks','days','hours','ENUM','csv','xlsx','default','custom','BOOLEAN','TEXT'];(function(_0xf3cbef,_0x394417){var _0x45c493=function(_0x27c750){while(--_0x27c750){_0xf3cbef['push'](_0xf3cbef['shift']());}};_0x45c493(++_0x394417);}(_0xd790,0x160));var _0x0d79=function(_0xfb073a,_0x248d58){_0xfb073a=_0xfb073a-0x0;var _0x4a0cd=_0xd790[_0xfb073a];return _0x4a0cd;};'use strict';var Sequelize=require('sequelize');module[_0x0d79('0x0')]={'name':{'type':Sequelize[_0x0d79('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0d79('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0d79('0x2')},'startAt':{'type':Sequelize[_0x0d79('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x0d79('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x0d79('0x4'),_0x0d79('0x5'),'months',_0x0d79('0x6'),_0x0d79('0x7'),_0x0d79('0x8'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x0d79('0x9')](_0x0d79('0xa'),'pdf',_0x0d79('0xb')),'allowNull':![],'defaultValue':_0x0d79('0xa')},'type':{'type':Sequelize[_0x0d79('0x9')]('custom',_0x0d79('0xc')),'allowNull':![],'defaultValue':_0x0d79('0xd')},'sendMail':{'type':Sequelize[_0x0d79('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x0d79('0x1')]},'cc':{'type':Sequelize[_0x0d79('0xf')]},'bcc':{'type':Sequelize[_0x0d79('0xf')]},'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 ccb2b0a..764e257 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 _0x0497=['index','Schedule','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','count','includeAll','findAll','catch','show','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','error','stack','name','send'];(function(_0x1c1c95,_0x317616){var _0xf538c3=function(_0x1e7ec6){while(--_0x1e7ec6){_0x1c1c95['push'](_0x1c1c95['shift']());}};_0xf538c3(++_0x317616);}(_0x0497,0x83));var _0x7049=function(_0x4471f5,_0x4c8ac8){_0x4471f5=_0x4471f5-0x0;var _0x5a7082=_0x0497[_0x4471f5];return _0x5a7082;};'use strict';var emlformat=require(_0x7049('0x0'));var rimraf=require(_0x7049('0x1'));var zipdir=require(_0x7049('0x2'));var jsonpatch=require(_0x7049('0x3'));var rp=require(_0x7049('0x4'));var moment=require('moment');var BPromise=require(_0x7049('0x5'));var Mustache=require(_0x7049('0x6'));var util=require(_0x7049('0x7'));var path=require('path');var sox=require(_0x7049('0x8'));var csv=require(_0x7049('0x9'));var ejs=require(_0x7049('0xa'));var fs=require('fs');var fs_extra=require(_0x7049('0xb'));var _=require(_0x7049('0xc'));var squel=require(_0x7049('0xd'));var crypto=require(_0x7049('0xe'));var jsforce=require(_0x7049('0xf'));var deskjs=require(_0x7049('0x10'));var toCsv=require(_0x7049('0x9'));var querystring=require(_0x7049('0x11'));var Papa=require(_0x7049('0x12'));var Redis=require('ioredis');var authService=require(_0x7049('0x13'));var qs=require(_0x7049('0x14'));var as=require(_0x7049('0x15'));var hardwareService=require(_0x7049('0x16'));var logger=require('../../config/logger')(_0x7049('0x17'));var utils=require(_0x7049('0x18'));var config=require(_0x7049('0x19'));var licenseUtil=require(_0x7049('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2da892,_0x489d93){_0x489d93=_0x489d93||0xcc;return function(_0x5420f5){if(_0x5420f5){return _0x2da892[_0x7049('0x1b')](_0x489d93);}return _0x2da892[_0x7049('0x1c')](_0x489d93)[_0x7049('0x1d')]();};}function respondWithResult(_0x4b5c49,_0x401d1c){_0x401d1c=_0x401d1c||0xc8;return function(_0x10fd66){if(_0x10fd66){return _0x4b5c49[_0x7049('0x1c')](_0x401d1c)['json'](_0x10fd66);}};}function respondWithFilteredResult(_0x139c94,_0x239a22){return function(_0x523207){if(_0x523207){var _0xc3f088=typeof _0x239a22[_0x7049('0x1e')]===_0x7049('0x1f')&&typeof _0x239a22[_0x7049('0x20')]===_0x7049('0x1f');var _0x4570f8=_0x523207['count'];var _0xb05037=_0xc3f088?0x0:_0x239a22[_0x7049('0x1e')];var _0x32e4a3=_0xc3f088?_0x523207['count']:_0x239a22[_0x7049('0x1e')]+_0x239a22[_0x7049('0x20')];var _0x1bcd49;if(_0x32e4a3>=_0x4570f8){_0x32e4a3=_0x4570f8;_0x1bcd49=0xc8;}else{_0x1bcd49=0xce;}_0x139c94[_0x7049('0x1c')](_0x1bcd49);return _0x139c94[_0x7049('0x21')](_0x7049('0x22'),_0xb05037+'-'+_0x32e4a3+'/'+_0x4570f8)['json'](_0x523207);}return null;};}function patchUpdates(_0x4cd81d){return function(_0x4bb545){try{jsonpatch[_0x7049('0x23')](_0x4bb545,_0x4cd81d,!![]);}catch(_0x1fa1d8){return BPromise[_0x7049('0x24')](_0x1fa1d8);}return _0x4bb545[_0x7049('0x25')]();};}function saveUpdates(_0x3ee828,_0x5428ec){return function(_0x273cbc){if(_0x273cbc){return _0x273cbc['update'](_0x3ee828)[_0x7049('0x26')](function(_0x318818){return _0x318818;});}return null;};}function removeEntity(_0x4f1fd5,_0x2c7d50){return function(_0x4a1fa2){if(_0x4a1fa2){return _0x4a1fa2[_0x7049('0x27')]()[_0x7049('0x26')](function(){var _0x3f48f2=_0x4a1fa2[_0x7049('0x28')]({'plain':!![]});var _0x19d82e='Scheduler';return db['UserProfileResource']['destroy']({'where':{'type':_0x19d82e,'resourceId':_0x3f48f2['id']}})['then'](function(){return _0x4a1fa2;});})[_0x7049('0x26')](function(){_0x4f1fd5[_0x7049('0x1c')](0xcc)[_0x7049('0x1d')]();});}};}function handleEntityNotFound(_0x174733,_0xf0363d){return function(_0x56107a){if(!_0x56107a){_0x174733[_0x7049('0x1b')](0x194);}return _0x56107a;};}function handleError(_0x5ece2a,_0x2703dd){_0x2703dd=_0x2703dd||0x1f4;return function(_0x24378a){logger[_0x7049('0x29')](_0x24378a[_0x7049('0x2a')]);if(_0x24378a[_0x7049('0x2b')]){delete _0x24378a[_0x7049('0x2b')];}_0x5ece2a['status'](_0x2703dd)[_0x7049('0x2c')](_0x24378a);};}exports[_0x7049('0x2d')]=function(_0x245fde,_0x377ab8){var _0x530858={},_0x450c15={},_0x46975c={'count':0x0,'rows':[]};var _0x49fd5c=_['map'](db[_0x7049('0x2e')][_0x7049('0x2f')],function(_0x3f5fb3){return{'name':_0x3f5fb3['fieldName'],'type':_0x3f5fb3[_0x7049('0x30')][_0x7049('0x31')]};});_0x450c15[_0x7049('0x32')]=_['map'](_0x49fd5c,_0x7049('0x2b'));_0x450c15[_0x7049('0x33')]=_[_0x7049('0x34')](_0x245fde[_0x7049('0x33')]);_0x450c15[_0x7049('0x35')]=_['intersection'](_0x450c15['model'],_0x450c15[_0x7049('0x33')]);_0x530858[_0x7049('0x36')]=_['intersection'](_0x450c15[_0x7049('0x32')],qs[_0x7049('0x37')](_0x245fde[_0x7049('0x33')]['fields']));_0x530858[_0x7049('0x36')]=_0x530858[_0x7049('0x36')][_0x7049('0x38')]?_0x530858[_0x7049('0x36')]:_0x450c15[_0x7049('0x32')];if(!_0x245fde[_0x7049('0x33')][_0x7049('0x39')](_0x7049('0x3a'))){_0x530858[_0x7049('0x20')]=qs[_0x7049('0x20')](_0x245fde[_0x7049('0x33')]['limit']);_0x530858['offset']=qs['offset'](_0x245fde['query'][_0x7049('0x1e')]);}_0x530858['order']=qs[_0x7049('0x3b')](_0x245fde['query'][_0x7049('0x3b')]);_0x530858[_0x7049('0x3c')]=qs['filters'](_[_0x7049('0x3d')](_0x245fde[_0x7049('0x33')],_0x450c15[_0x7049('0x35')]),_0x49fd5c);if(_0x245fde[_0x7049('0x33')]['filter']){_0x530858[_0x7049('0x3c')]=_[_0x7049('0x3e')](_0x530858[_0x7049('0x3c')],{'$or':_[_0x7049('0x3f')](_0x49fd5c,function(_0x3f5dcd){if(_0x3f5dcd['type']!==_0x7049('0x40')){var _0xfdcf82={};_0xfdcf82[_0x3f5dcd['name']]={'$like':'%'+_0x245fde[_0x7049('0x33')][_0x7049('0x41')]+'%'};return _0xfdcf82;}})});}_0x530858=_[_0x7049('0x3e')]({},_0x530858,_0x245fde[_0x7049('0x42')]);var _0x4e1d57={'where':_0x530858['where']};return db[_0x7049('0x2e')][_0x7049('0x43')](_0x4e1d57)[_0x7049('0x26')](function(_0x55e0ea){_0x46975c[_0x7049('0x43')]=_0x55e0ea;if(_0x245fde[_0x7049('0x33')][_0x7049('0x44')]){_0x530858['include']=[{'all':!![]}];}return db[_0x7049('0x2e')][_0x7049('0x45')](_0x530858);})[_0x7049('0x26')](function(_0xeffab9){_0x46975c['rows']=_0xeffab9;return _0x46975c;})[_0x7049('0x26')](respondWithFilteredResult(_0x377ab8,_0x530858))[_0x7049('0x46')](handleError(_0x377ab8,null));};exports[_0x7049('0x47')]=function(_0x49543a,_0x2cf678){var _0x1ea681={'raw':![],'where':{'id':_0x49543a['params']['id']}},_0x1ef980={};_0x1ef980[_0x7049('0x32')]=_[_0x7049('0x34')](db[_0x7049('0x2e')]['rawAttributes']);_0x1ef980['query']=_['keys'](_0x49543a[_0x7049('0x33')]);_0x1ef980[_0x7049('0x35')]=_[_0x7049('0x48')](_0x1ef980['model'],_0x1ef980[_0x7049('0x33')]);_0x1ea681['attributes']=_['intersection'](_0x1ef980[_0x7049('0x32')],qs['fields'](_0x49543a['query'][_0x7049('0x37')]));_0x1ea681[_0x7049('0x36')]=_0x1ea681[_0x7049('0x36')]['length']?_0x1ea681[_0x7049('0x36')]:_0x1ef980[_0x7049('0x32')];if(_0x49543a['query'][_0x7049('0x44')]){_0x1ea681[_0x7049('0x49')]=[{'all':!![]}];}_0x1ea681=_['merge']({},_0x1ea681,_0x49543a['options']);return db['Schedule'][_0x7049('0x4a')](_0x1ea681)['then'](handleEntityNotFound(_0x2cf678,null))['then'](respondWithResult(_0x2cf678,null))[_0x7049('0x46')](handleError(_0x2cf678,null));};exports[_0x7049('0x4b')]=function(_0x2ba40b,_0x465bec){return db[_0x7049('0x2e')][_0x7049('0x4b')](_0x2ba40b[_0x7049('0x4c')],{})[_0x7049('0x26')](function(_0x316e3e){var _0x4f7964=_0x2ba40b[_0x7049('0x4d')][_0x7049('0x28')]({'plain':!![]});if(!_0x4f7964)throw new Error(_0x7049('0x4e'));if(_0x4f7964[_0x7049('0x4f')]===_0x7049('0x4d')){var _0x34c5eb=_0x316e3e[_0x7049('0x28')]({'plain':!![]});var _0x4ff1a0='Scheduler';return db[_0x7049('0x50')][_0x7049('0x4a')]({'where':{'name':_0x4ff1a0,'userProfileId':_0x4f7964[_0x7049('0x51')]},'raw':!![]})[_0x7049('0x26')](function(_0x26394d){if(_0x26394d&&_0x26394d[_0x7049('0x52')]===0x0){return db[_0x7049('0x53')][_0x7049('0x4b')]({'name':_0x34c5eb[_0x7049('0x2b')],'resourceId':_0x34c5eb['id'],'type':_0x26394d[_0x7049('0x2b')],'sectionId':_0x26394d['id']},{})[_0x7049('0x26')](function(){return _0x316e3e;});}else{return _0x316e3e;}})['catch'](function(_0x35403a){logger[_0x7049('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35403a);throw _0x35403a;});}return _0x316e3e;})[_0x7049('0x26')](respondWithResult(_0x465bec,0xc9))[_0x7049('0x46')](handleError(_0x465bec,null));};exports[_0x7049('0x54')]=function(_0x3ff81a,_0x3f97f2){if(_0x3ff81a[_0x7049('0x4c')]['id']){delete _0x3ff81a[_0x7049('0x4c')]['id'];}return db[_0x7049('0x2e')][_0x7049('0x4a')]({'where':{'id':_0x3ff81a['params']['id']}})[_0x7049('0x26')](handleEntityNotFound(_0x3f97f2,null))['then'](saveUpdates(_0x3ff81a[_0x7049('0x4c')],null))[_0x7049('0x26')](respondWithResult(_0x3f97f2,null))[_0x7049('0x46')](handleError(_0x3f97f2,null));};exports['destroy']=function(_0x1e27af,_0x4fadbd){return db[_0x7049('0x2e')][_0x7049('0x4a')]({'where':{'id':_0x1e27af[_0x7049('0x55')]['id']}})[_0x7049('0x26')](handleEntityNotFound(_0x4fadbd,null))[_0x7049('0x26')](removeEntity(_0x4fadbd,null))[_0x7049('0x46')](handleError(_0x4fadbd,null));};exports[_0x7049('0x56')]=function(_0x16e1dc,_0x41013d,_0x391dbe){var _0xb76499=require(_0x7049('0x57'));return db[_0x7049('0x2e')][_0x7049('0x4a')]({'where':{'id':_0x16e1dc[_0x7049('0x55')]['id']},'raw':!![]})[_0x7049('0x26')](handleEntityNotFound(_0x41013d,null))['then'](function(){_0xb76499[_0x7049('0x56')](_0x16e1dc[_0x7049('0x55')]['id']);})[_0x7049('0x26')](respondWithStatusCode(_0x41013d,null))[_0x7049('0x46')](handleError(_0x41013d,null));}; \ No newline at end of file +var _0xb78b=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','Schedule','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','keys','find','create'];(function(_0x358f39,_0xac2124){var _0x5bfe34=function(_0x39938c){while(--_0x39938c){_0x358f39['push'](_0x358f39['shift']());}};_0x5bfe34(++_0xac2124);}(_0xb78b,0x1b1));var _0xbb78=function(_0x25ff90,_0x2954c0){_0x25ff90=_0x25ff90-0x0;var _0x98f30a=_0xb78b[_0x25ff90];return _0x98f30a;};'use strict';var emlformat=require(_0xbb78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb78('0x1'));var jsonpatch=require(_0xbb78('0x2'));var rp=require(_0xbb78('0x3'));var moment=require('moment');var BPromise=require(_0xbb78('0x4'));var Mustache=require(_0xbb78('0x5'));var util=require(_0xbb78('0x6'));var path=require('path');var sox=require(_0xbb78('0x7'));var csv=require('to-csv');var ejs=require(_0xbb78('0x8'));var fs=require('fs');var fs_extra=require(_0xbb78('0x9'));var _=require(_0xbb78('0xa'));var squel=require(_0xbb78('0xb'));var crypto=require(_0xbb78('0xc'));var jsforce=require(_0xbb78('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbb78('0xe'));var querystring=require(_0xbb78('0xf'));var Papa=require(_0xbb78('0x10'));var Redis=require(_0xbb78('0x11'));var authService=require(_0xbb78('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb78('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xbb78('0x14'));var config=require(_0xbb78('0x15'));var licenseUtil=require(_0xbb78('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x330e8e,_0x1a873d){_0x1a873d=_0x1a873d||0xcc;return function(_0x1d205e){if(_0x1d205e){return _0x330e8e[_0xbb78('0x17')](_0x1a873d);}return _0x330e8e['status'](_0x1a873d)[_0xbb78('0x18')]();};}function respondWithResult(_0x56262b,_0x4ee596){_0x4ee596=_0x4ee596||0xc8;return function(_0x35df3b){if(_0x35df3b){return _0x56262b[_0xbb78('0x19')](_0x4ee596)['json'](_0x35df3b);}};}function respondWithFilteredResult(_0x1fdb52,_0x5a61a1){return function(_0x3740dd){if(_0x3740dd){var _0xb7da43=typeof _0x5a61a1[_0xbb78('0x1a')]===_0xbb78('0x1b')&&typeof _0x5a61a1[_0xbb78('0x1c')]===_0xbb78('0x1b');var _0x51ae77=_0x3740dd['count'];var _0x6b63f5=_0xb7da43?0x0:_0x5a61a1[_0xbb78('0x1a')];var _0x1d7025=_0xb7da43?_0x3740dd[_0xbb78('0x1d')]:_0x5a61a1[_0xbb78('0x1a')]+_0x5a61a1[_0xbb78('0x1c')];var _0x19f44c;if(_0x1d7025>=_0x51ae77){_0x1d7025=_0x51ae77;_0x19f44c=0xc8;}else{_0x19f44c=0xce;}_0x1fdb52[_0xbb78('0x19')](_0x19f44c);return _0x1fdb52[_0xbb78('0x1e')]('Content-Range',_0x6b63f5+'-'+_0x1d7025+'/'+_0x51ae77)[_0xbb78('0x1f')](_0x3740dd);}return null;};}function patchUpdates(_0x4c42dc){return function(_0x2a6b01){try{jsonpatch['apply'](_0x2a6b01,_0x4c42dc,!![]);}catch(_0x42e66f){return BPromise[_0xbb78('0x20')](_0x42e66f);}return _0x2a6b01[_0xbb78('0x21')]();};}function saveUpdates(_0x612943,_0x280ce2){return function(_0x17a6be){if(_0x17a6be){return _0x17a6be[_0xbb78('0x22')](_0x612943)[_0xbb78('0x23')](function(_0x30c5b5){return _0x30c5b5;});}return null;};}function removeEntity(_0x26be2a,_0x199784){return function(_0x45c783){if(_0x45c783){return _0x45c783[_0xbb78('0x24')]()[_0xbb78('0x23')](function(){var _0x546038=_0x45c783[_0xbb78('0x25')]({'plain':!![]});var _0x3f5bc3='Scheduler';return db[_0xbb78('0x26')][_0xbb78('0x24')]({'where':{'type':_0x3f5bc3,'resourceId':_0x546038['id']}})[_0xbb78('0x23')](function(){return _0x45c783;});})['then'](function(){_0x26be2a[_0xbb78('0x19')](0xcc)[_0xbb78('0x18')]();});}};}function handleEntityNotFound(_0x496659,_0x1a3e8f){return function(_0xa7640d){if(!_0xa7640d){_0x496659[_0xbb78('0x17')](0x194);}return _0xa7640d;};}function handleError(_0x13e303,_0x5c3487){_0x5c3487=_0x5c3487||0x1f4;return function(_0x5ec1a2){logger['error'](_0x5ec1a2[_0xbb78('0x27')]);if(_0x5ec1a2[_0xbb78('0x28')]){delete _0x5ec1a2[_0xbb78('0x28')];}_0x13e303[_0xbb78('0x19')](_0x5c3487)['send'](_0x5ec1a2);};}exports[_0xbb78('0x29')]=function(_0x5b7d2d,_0x69c141){var _0x304535={},_0x34aa10={},_0x4c324f={'count':0x0,'rows':[]};var _0x407766=_[_0xbb78('0x2a')](db[_0xbb78('0x2b')]['rawAttributes'],function(_0x428169){return{'name':_0x428169[_0xbb78('0x2c')],'type':_0x428169[_0xbb78('0x2d')][_0xbb78('0x2e')]};});_0x34aa10[_0xbb78('0x2f')]=_[_0xbb78('0x2a')](_0x407766,_0xbb78('0x28'));_0x34aa10[_0xbb78('0x30')]=_['keys'](_0x5b7d2d[_0xbb78('0x30')]);_0x34aa10[_0xbb78('0x31')]=_[_0xbb78('0x32')](_0x34aa10['model'],_0x34aa10[_0xbb78('0x30')]);_0x304535[_0xbb78('0x33')]=_[_0xbb78('0x32')](_0x34aa10['model'],qs[_0xbb78('0x34')](_0x5b7d2d[_0xbb78('0x30')][_0xbb78('0x34')]));_0x304535[_0xbb78('0x33')]=_0x304535[_0xbb78('0x33')]['length']?_0x304535[_0xbb78('0x33')]:_0x34aa10[_0xbb78('0x2f')];if(!_0x5b7d2d[_0xbb78('0x30')][_0xbb78('0x35')](_0xbb78('0x36'))){_0x304535[_0xbb78('0x1c')]=qs['limit'](_0x5b7d2d[_0xbb78('0x30')]['limit']);_0x304535[_0xbb78('0x1a')]=qs[_0xbb78('0x1a')](_0x5b7d2d[_0xbb78('0x30')][_0xbb78('0x1a')]);}_0x304535[_0xbb78('0x37')]=qs[_0xbb78('0x38')](_0x5b7d2d[_0xbb78('0x30')][_0xbb78('0x38')]);_0x304535[_0xbb78('0x39')]=qs['filters'](_[_0xbb78('0x3a')](_0x5b7d2d[_0xbb78('0x30')],_0x34aa10['filters']),_0x407766);if(_0x5b7d2d[_0xbb78('0x30')]['filter']){_0x304535[_0xbb78('0x39')]=_[_0xbb78('0x3b')](_0x304535[_0xbb78('0x39')],{'$or':_[_0xbb78('0x2a')](_0x407766,function(_0x4b7d95){if(_0x4b7d95[_0xbb78('0x2d')]!==_0xbb78('0x3c')){var _0x23568b={};_0x23568b[_0x4b7d95[_0xbb78('0x28')]]={'$like':'%'+_0x5b7d2d[_0xbb78('0x30')][_0xbb78('0x3d')]+'%'};return _0x23568b;}})});}_0x304535=_[_0xbb78('0x3b')]({},_0x304535,_0x5b7d2d[_0xbb78('0x3e')]);var _0x32106e={'where':_0x304535[_0xbb78('0x39')]};return db[_0xbb78('0x2b')]['count'](_0x32106e)['then'](function(_0x1784f6){_0x4c324f['count']=_0x1784f6;if(_0x5b7d2d[_0xbb78('0x30')][_0xbb78('0x3f')]){_0x304535[_0xbb78('0x40')]=[{'all':!![]}];}return db[_0xbb78('0x2b')]['findAll'](_0x304535);})[_0xbb78('0x23')](function(_0x3ec042){_0x4c324f[_0xbb78('0x41')]=_0x3ec042;return _0x4c324f;})['then'](respondWithFilteredResult(_0x69c141,_0x304535))[_0xbb78('0x42')](handleError(_0x69c141,null));};exports[_0xbb78('0x43')]=function(_0x30858b,_0x567fb1){var _0x3cf353={'raw':![],'where':{'id':_0x30858b['params']['id']}},_0x1a0b9a={};_0x1a0b9a[_0xbb78('0x2f')]=_[_0xbb78('0x44')](db[_0xbb78('0x2b')]['rawAttributes']);_0x1a0b9a[_0xbb78('0x30')]=_['keys'](_0x30858b[_0xbb78('0x30')]);_0x1a0b9a[_0xbb78('0x31')]=_[_0xbb78('0x32')](_0x1a0b9a[_0xbb78('0x2f')],_0x1a0b9a[_0xbb78('0x30')]);_0x3cf353[_0xbb78('0x33')]=_[_0xbb78('0x32')](_0x1a0b9a['model'],qs[_0xbb78('0x34')](_0x30858b[_0xbb78('0x30')][_0xbb78('0x34')]));_0x3cf353[_0xbb78('0x33')]=_0x3cf353[_0xbb78('0x33')]['length']?_0x3cf353[_0xbb78('0x33')]:_0x1a0b9a[_0xbb78('0x2f')];if(_0x30858b[_0xbb78('0x30')][_0xbb78('0x3f')]){_0x3cf353[_0xbb78('0x40')]=[{'all':!![]}];}_0x3cf353=_['merge']({},_0x3cf353,_0x30858b[_0xbb78('0x3e')]);return db[_0xbb78('0x2b')][_0xbb78('0x45')](_0x3cf353)[_0xbb78('0x23')](handleEntityNotFound(_0x567fb1,null))[_0xbb78('0x23')](respondWithResult(_0x567fb1,null))['catch'](handleError(_0x567fb1,null));};exports[_0xbb78('0x46')]=function(_0x48f4a6,_0x3efe2e){return db[_0xbb78('0x2b')][_0xbb78('0x46')](_0x48f4a6[_0xbb78('0x47')],{})[_0xbb78('0x23')](function(_0x510870){var _0x292f01=_0x48f4a6[_0xbb78('0x48')][_0xbb78('0x25')]({'plain':!![]});if(!_0x292f01)throw new Error(_0xbb78('0x49'));if(_0x292f01[_0xbb78('0x4a')]==='user'){var _0x49aa6f=_0x510870['get']({'plain':!![]});var _0x50dcca=_0xbb78('0x4b');return db[_0xbb78('0x4c')][_0xbb78('0x45')]({'where':{'name':_0x50dcca,'userProfileId':_0x292f01[_0xbb78('0x4d')]},'raw':!![]})[_0xbb78('0x23')](function(_0x582131){if(_0x582131&&_0x582131[_0xbb78('0x4e')]===0x0){return db[_0xbb78('0x26')][_0xbb78('0x46')]({'name':_0x49aa6f[_0xbb78('0x28')],'resourceId':_0x49aa6f['id'],'type':_0x582131[_0xbb78('0x28')],'sectionId':_0x582131['id']},{})['then'](function(){return _0x510870;});}else{return _0x510870;}})[_0xbb78('0x42')](function(_0xd90f1f){logger[_0xbb78('0x4f')](_0xbb78('0x50'),_0xd90f1f);throw _0xd90f1f;});}return _0x510870;})['then'](respondWithResult(_0x3efe2e,0xc9))[_0xbb78('0x42')](handleError(_0x3efe2e,null));};exports[_0xbb78('0x22')]=function(_0x1b59ec,_0x3ef8be){if(_0x1b59ec[_0xbb78('0x47')]['id']){delete _0x1b59ec[_0xbb78('0x47')]['id'];}return db[_0xbb78('0x2b')][_0xbb78('0x45')]({'where':{'id':_0x1b59ec[_0xbb78('0x51')]['id']}})[_0xbb78('0x23')](handleEntityNotFound(_0x3ef8be,null))['then'](saveUpdates(_0x1b59ec[_0xbb78('0x47')],null))[_0xbb78('0x23')](respondWithResult(_0x3ef8be,null))[_0xbb78('0x42')](handleError(_0x3ef8be,null));};exports[_0xbb78('0x24')]=function(_0x36291f,_0x25e665){return db['Schedule'][_0xbb78('0x45')]({'where':{'id':_0x36291f[_0xbb78('0x51')]['id']}})['then'](handleEntityNotFound(_0x25e665,null))[_0xbb78('0x23')](removeEntity(_0x25e665,null))['catch'](handleError(_0x25e665,null));};exports[_0xbb78('0x52')]=function(_0x368a6b,_0x1f879c,_0x5b1418){var _0x4c0692=require(_0xbb78('0x53'));return db[_0xbb78('0x2b')]['find']({'where':{'id':_0x368a6b['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1f879c,null))[_0xbb78('0x23')](function(){_0x4c0692['run'](_0x368a6b[_0xbb78('0x51')]['id']);})[_0xbb78('0x23')](respondWithStatusCode(_0x1f879c,null))['catch'](handleError(_0x1f879c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 5277547..fd1b210 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 _0x16bb=['bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','Schedule','util','../../config/logger','api','moment'];(function(_0x12aba8,_0x40a036){var _0x2aac66=function(_0x3e56b7){while(--_0x3e56b7){_0x12aba8['push'](_0x12aba8['shift']());}};_0x2aac66(++_0x40a036);}(_0x16bb,0x80));var _0xb16b=function(_0x1e5e63,_0x4a8ddb){_0x1e5e63=_0x1e5e63-0x0;var _0x5d9c31=_0x16bb[_0x1e5e63];return _0x5d9c31;};'use strict';var _=require('lodash');var util=require(_0xb16b('0x0'));var logger=require(_0xb16b('0x1'))(_0xb16b('0x2'));var moment=require(_0xb16b('0x3'));var BPromise=require(_0xb16b('0x4'));var rp=require(_0xb16b('0x5'));var fs=require('fs');var path=require(_0xb16b('0x6'));var rimraf=require('rimraf');var config=require(_0xb16b('0x7'));var attributes=require(_0xb16b('0x8'));module[_0xb16b('0x9')]=function(_0x31c3ba,_0x1bcf2b){return _0x31c3ba[_0xb16b('0xa')](_0xb16b('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8850=['define','Schedule','tools_schedules','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x8850,0x1b3));var _0x0885=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8850[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x0885('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0885('0x1'));var moment=require(_0x0885('0x2'));var BPromise=require(_0x0885('0x3'));var rp=require(_0x0885('0x4'));var fs=require('fs');var path=require(_0x0885('0x5'));var rimraf=require(_0x0885('0x6'));var config=require(_0x0885('0x7'));var attributes=require('./schedule.attributes');module[_0x0885('0x8')]=function(_0x196181,_0x523684){return _0x196181[_0x0885('0x9')](_0x0885('0xa'),attributes,{'tableName':_0x0885('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1c6beaf..7a56859 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 _0x318a=['request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x151ab5,_0x2d7459){var _0x46acfa=function(_0x5b331a){while(--_0x5b331a){_0x151ab5['push'](_0x151ab5['shift']());}};_0x46acfa(++_0x2d7459);}(_0x318a,0xde));var _0xa318=function(_0x59e0e1,_0x228668){_0x59e0e1=_0x59e0e1-0x0;var _0x2f781f=_0x318a[_0x59e0e1];return _0x2f781f;};'use strict';var _=require(_0xa318('0x0'));var util=require(_0xa318('0x1'));var moment=require('moment');var BPromise=require(_0xa318('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa318('0x3'))['db'];var utils=require(_0xa318('0x4'));var logger=require('../../config/logger')(_0xa318('0x5'));var config=require(_0xa318('0x6'));var jayson=require(_0xa318('0x7'));var client=jayson[_0xa318('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2762d8,_0x4c5616,_0x144222){return new BPromise(function(_0x30348b,_0x560acd){return client[_0xa318('0x9')](_0x2762d8,_0x144222)[_0xa318('0xa')](function(_0xe81a73){logger['info'](_0xa318('0xb'),_0x4c5616,_0xa318('0xc'));logger[_0xa318('0xd')](_0xa318('0xe'),_0x4c5616,_0xa318('0xc'),JSON[_0xa318('0xf')](_0xe81a73));if(_0xe81a73['error']){if(_0xe81a73['error'][_0xa318('0x10')]===0x1f4){logger[_0xa318('0x11')](_0xa318('0xb'),_0x4c5616,_0xe81a73[_0xa318('0x11')][_0xa318('0x12')]);return _0x560acd(_0xe81a73[_0xa318('0x11')][_0xa318('0x12')]);}logger['error'](_0xa318('0xb'),_0x4c5616,_0xe81a73[_0xa318('0x11')][_0xa318('0x12')]);return _0x30348b(_0xe81a73[_0xa318('0x11')]['message']);}else{logger[_0xa318('0x13')](_0xa318('0xb'),_0x4c5616,_0xa318('0xc'));_0x30348b(_0xe81a73['result']['message']);}})[_0xa318('0x14')](function(_0x214011){logger[_0xa318('0x11')](_0xa318('0xb'),_0x4c5616,_0x214011);_0x560acd(_0x214011);});});} \ No newline at end of file +var _0x16ab=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x3c202d,_0x5171ff){var _0x99199=function(_0x425a96){while(--_0x425a96){_0x3c202d['push'](_0x3c202d['shift']());}};_0x99199(++_0x5171ff);}(_0x16ab,0x97));var _0xb16a=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x16ab[_0x172747];return _0x509692;};'use strict';var _=require(_0xb16a('0x0'));var util=require('util');var moment=require(_0xb16a('0x1'));var BPromise=require(_0xb16a('0x2'));var rs=require(_0xb16a('0x3'));var fs=require('fs');var Redis=require(_0xb16a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb16a('0x5'));var logger=require(_0xb16a('0x6'))(_0xb16a('0x7'));var config=require(_0xb16a('0x8'));var jayson=require(_0xb16a('0x9'));var client=jayson['client'][_0xb16a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53035b,_0x2fd210,_0xf33e52){return new BPromise(function(_0x120261,_0x3da06e){return client[_0xb16a('0xb')](_0x53035b,_0xf33e52)[_0xb16a('0xc')](function(_0x1569a8){logger[_0xb16a('0xd')](_0xb16a('0xe'),_0x2fd210,_0xb16a('0xf'));logger[_0xb16a('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x2fd210,_0xb16a('0xf'),JSON['stringify'](_0x1569a8));if(_0x1569a8['error']){if(_0x1569a8[_0xb16a('0x11')][_0xb16a('0x12')]===0x1f4){logger[_0xb16a('0x11')]('Schedule,\x20%s,\x20%s',_0x2fd210,_0x1569a8['error'][_0xb16a('0x13')]);return _0x3da06e(_0x1569a8['error'][_0xb16a('0x13')]);}logger[_0xb16a('0x11')]('Schedule,\x20%s,\x20%s',_0x2fd210,_0x1569a8[_0xb16a('0x11')][_0xb16a('0x13')]);return _0x120261(_0x1569a8['error'][_0xb16a('0x13')]);}else{logger[_0xb16a('0xd')]('Schedule,\x20%s,\x20%s',_0x2fd210,_0xb16a('0xf'));_0x120261(_0x1569a8[_0xb16a('0x14')][_0xb16a('0x13')]);}})[_0xb16a('0x15')](function(_0x132342){logger[_0xb16a('0x11')](_0xb16a('0xe'),_0x2fd210,_0x132342);_0x3da06e(_0x132342);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index e77a856..1c2c40e 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 _0x4dc0=['isAuthenticated','index','/describe','/:id','show','/:id/download','post','create','put','update','delete','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get'];(function(_0x1685e6,_0x55ee67){var _0x346233=function(_0x421874){while(--_0x421874){_0x1685e6['push'](_0x1685e6['shift']());}};_0x346233(++_0x55ee67);}(_0x4dc0,0xb6));var _0x04dc=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4dc0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require('multer');var util=require(_0x04dc('0x0'));var path=require('path');var timeout=require(_0x04dc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x04dc('0x2'));var auth=require(_0x04dc('0x3'));var interaction=require(_0x04dc('0x4'));var config=require(_0x04dc('0x5'));var controller=require(_0x04dc('0x6'));router[_0x04dc('0x7')]('/',auth[_0x04dc('0x8')](),controller[_0x04dc('0x9')]);router['get'](_0x04dc('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x04dc('0x7')](_0x04dc('0xb'),auth[_0x04dc('0x8')](),controller[_0x04dc('0xc')]);router[_0x04dc('0x7')](_0x04dc('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x04dc('0xe')]('/',auth[_0x04dc('0x8')](),controller[_0x04dc('0xf')]);router[_0x04dc('0x10')](_0x04dc('0xb'),auth[_0x04dc('0x8')](),controller[_0x04dc('0x11')]);router[_0x04dc('0x12')](_0x04dc('0xb'),auth[_0x04dc('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x19a1=['create','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','isAuthenticated','describe','/:id','show','/:id/download'];(function(_0x35d481,_0x39c746){var _0x1aa929=function(_0x957a05){while(--_0x957a05){_0x35d481['push'](_0x35d481['shift']());}};_0x1aa929(++_0x39c746);}(_0x19a1,0x17f));var _0x119a=function(_0x563e99,_0x181622){_0x563e99=_0x563e99-0x0;var _0x196311=_0x19a1[_0x563e99];return _0x196311;};'use strict';var multer=require(_0x119a('0x0'));var util=require(_0x119a('0x1'));var path=require(_0x119a('0x2'));var timeout=require(_0x119a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x119a('0x4'));var auth=require(_0x119a('0x5'));var interaction=require(_0x119a('0x6'));var config=require(_0x119a('0x7'));var controller=require(_0x119a('0x8'));router[_0x119a('0x9')]('/',auth['isAuthenticated'](),controller[_0x119a('0xa')]);router[_0x119a('0x9')]('/describe',auth[_0x119a('0xb')](),controller[_0x119a('0xc')]);router[_0x119a('0x9')](_0x119a('0xd'),auth[_0x119a('0xb')](),controller[_0x119a('0xe')]);router[_0x119a('0x9')](_0x119a('0xf'),auth[_0x119a('0xb')](),controller['download']);router['post']('/',auth[_0x119a('0xb')](),controller[_0x119a('0x10')]);router[_0x119a('0x11')](_0x119a('0xd'),auth[_0x119a('0xb')](),controller[_0x119a('0x12')]);router[_0x119a('0x13')]('/:id',auth[_0x119a('0xb')](),controller[_0x119a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 4e709f9..5326620 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 _0xce04=['sequelize','path','../../config/environment','exports','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','format','MM-DD-YYYY\x20HH:mm','DATE','toString'];(function(_0x477733,_0x25c3d4){var _0x4fbf31=function(_0x5471a3){while(--_0x5471a3){_0x477733['push'](_0x477733['shift']());}};_0x4fbf31(++_0x25c3d4);}(_0xce04,0xc0));var _0x4ce0=function(_0x4b7ee4,_0x79a135){_0x4b7ee4=_0x4b7ee4-0x0;var _0x52ac5d=_0xce04[_0x4b7ee4];return _0x52ac5d;};'use strict';var Sequelize=require(_0x4ce0('0x0'));var moment=require('moment');var path=require(_0x4ce0('0x1'));var config=require(_0x4ce0('0x2'));module[_0x4ce0('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4ce0('0x4')]('value')?path['extname'](this['getDataValue'](_0x4ce0('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x4ce0('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x4ce0('0x6')],'set':function(_0x462871){var _0x5377ab=_0x462871[_0x4ce0('0x7')](/\\/g,'/');this[_0x4ce0('0x8')](_0x4ce0('0x5'),_0x5377ab);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4ce0('0x9')],'set':function(_0x29c627){this[_0x4ce0('0x8')](_0x4ce0('0xa'),moment()[_0x4ce0('0xb')](_0x29c627,'ms'));this[_0x4ce0('0x8')]('closedAt',moment());this[_0x4ce0('0x8')]('duration',_0x29c627);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x4ce0('0xa')))[_0x4ce0('0xc')](_0x4ce0('0xd'))['toString']();}},'closedAt':{'type':Sequelize[_0x4ce0('0xe')],'get':function(){return moment(this[_0x4ce0('0x4')]('closedAt'))[_0x4ce0('0xc')]('MM-DD-YYYY\x20HH:mm')[_0x4ce0('0xf')]();}},'createdAt':{'type':Sequelize[_0x4ce0('0xe')],'get':function(){return moment(this[_0x4ce0('0x4')]('createdAt'))[_0x4ce0('0xc')](_0x4ce0('0xd'))[_0x4ce0('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4ce0('0x4')]('updatedAt'))['format'](_0x4ce0('0xd'))[_0x4ce0('0xf')]();}}}; \ No newline at end of file +var _0xbb59=['MM-DD-YYYY\x20HH:mm','toString','sequelize','moment','path','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format'];(function(_0x16340b,_0xd3497){var _0x216302=function(_0xf2ec7e){while(--_0xf2ec7e){_0x16340b['push'](_0x16340b['shift']());}};_0x216302(++_0xd3497);}(_0xbb59,0xec));var _0x9bb5=function(_0x575f41,_0x33715e){_0x575f41=_0x575f41-0x0;var _0x4993ab=_0xbb59[_0x575f41];return _0x4993ab;};'use strict';var Sequelize=require(_0x9bb5('0x0'));var moment=require(_0x9bb5('0x1'));var path=require(_0x9bb5('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x9bb5('0x3')],'get':function(){return this[_0x9bb5('0x4')](_0x9bb5('0x5'))?path[_0x9bb5('0x6')](this[_0x9bb5('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x9bb5('0x7')]},'channel':{'type':Sequelize[_0x9bb5('0x7')]},'value':{'type':Sequelize[_0x9bb5('0x7')],'set':function(_0x2df722){var _0xe362e0=_0x2df722[_0x9bb5('0x8')](/\\/g,'/');this[_0x9bb5('0x9')](_0x9bb5('0x5'),_0xe362e0);}},'rating':{'type':Sequelize[_0x9bb5('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9bb5('0xa')],'set':function(_0x2fdbcb){this[_0x9bb5('0x9')](_0x9bb5('0xb'),moment()['subtract'](_0x2fdbcb,'ms'));this[_0x9bb5('0x9')](_0x9bb5('0xc'),moment());this[_0x9bb5('0x9')](_0x9bb5('0xd'),_0x2fdbcb);}},'startedAt':{'type':Sequelize[_0x9bb5('0xe')],'get':function(){return moment(this[_0x9bb5('0x4')](_0x9bb5('0xb')))[_0x9bb5('0xf')](_0x9bb5('0x10'))[_0x9bb5('0x11')]();}},'closedAt':{'type':Sequelize[_0x9bb5('0xe')],'get':function(){return moment(this[_0x9bb5('0x4')](_0x9bb5('0xc')))[_0x9bb5('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x9bb5('0xe')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x9bb5('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x9bb5('0x11')]();}},'updatedAt':{'type':Sequelize[_0x9bb5('0xe')],'get':function(){return moment(this[_0x9bb5('0x4')]('updatedAt'))[_0x9bb5('0xf')](_0x9bb5('0x10'))[_0x9bb5('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index dc6481e..e388f0f 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf'];(function(_0x3ea4f4,_0x186e21){var _0x365eed=function(_0x32c7b1){while(--_0x32c7b1){_0x3ea4f4['push'](_0x3ea4f4['shift']());}};_0x365eed(++_0x186e21);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x2eb2[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22eb('0x0'));var zipdir=require(_0x22eb('0x1'));var jsonpatch=require(_0x22eb('0x2'));var rp=require(_0x22eb('0x3'));var moment=require(_0x22eb('0x4'));var BPromise=require(_0x22eb('0x5'));var Mustache=require('mustache');var util=require(_0x22eb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x22eb('0x7'));var ejs=require(_0x22eb('0x8'));var fs=require('fs');var fs_extra=require(_0x22eb('0x9'));var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x7'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22eb('0x13'))('api');var utils=require(_0x22eb('0x14'));var config=require(_0x22eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xcc;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0x16')](_0x189f05);}return _0x1f286c[_0x22eb('0x17')](_0x189f05)['end']();};}function respondWithResult(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0xc8;return function(_0x1f5089){if(_0x1f5089){return _0x350ade['status'](_0x53f14e)[_0x22eb('0x18')](_0x1f5089);}};}function respondWithFilteredResult(_0x84c668,_0x53abbf){return function(_0x48b63c){if(_0x48b63c){var _0x4bc29a=typeof _0x53abbf[_0x22eb('0x19')]==='undefined'&&typeof _0x53abbf['limit']===_0x22eb('0x1a');var _0x4d9a71=_0x48b63c['count'];var _0xb7a73a=_0x4bc29a?0x0:_0x53abbf[_0x22eb('0x19')];var _0x385bcb=_0x4bc29a?_0x48b63c[_0x22eb('0x1b')]:_0x53abbf[_0x22eb('0x19')]+_0x53abbf['limit'];var _0x4182a8;if(_0x385bcb>=_0x4d9a71){_0x385bcb=_0x4d9a71;_0x4182a8=0xc8;}else{_0x4182a8=0xce;}_0x84c668[_0x22eb('0x17')](_0x4182a8);return _0x84c668[_0x22eb('0x1c')](_0x22eb('0x1d'),_0xb7a73a+'-'+_0x385bcb+'/'+_0x4d9a71)[_0x22eb('0x18')](_0x48b63c);}return null;};}function patchUpdates(_0x517313){return function(_0x2eb115){try{jsonpatch[_0x22eb('0x1e')](_0x2eb115,_0x517313,!![]);}catch(_0x2fc36e){return BPromise['reject'](_0x2fc36e);}return _0x2eb115['save']();};}function saveUpdates(_0x4335b7,_0x267d97){return function(_0x434ecb){if(_0x434ecb){return _0x434ecb[_0x22eb('0x1f')](_0x4335b7)[_0x22eb('0x20')](function(_0x3e8c1c){return _0x3e8c1c;});}return null;};}function removeEntity(_0x43dacb,_0x4e7e69){return function(_0x2e8f7c){if(_0x2e8f7c){return _0x2e8f7c[_0x22eb('0x21')]()[_0x22eb('0x20')](function(){_0x43dacb[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();});}};}function handleEntityNotFound(_0x4da252,_0x12c133){return function(_0x6f8ff3){if(!_0x6f8ff3){_0x4da252[_0x22eb('0x16')](0x194);}return _0x6f8ff3;};}function handleError(_0x5a001e,_0xe0783c){_0xe0783c=_0xe0783c||0x1f4;return function(_0x259847){logger['error'](_0x259847[_0x22eb('0x23')]);if(_0x259847[_0x22eb('0x24')]){delete _0x259847[_0x22eb('0x24')];}_0x5a001e[_0x22eb('0x17')](_0xe0783c)[_0x22eb('0x25')](_0x259847);};}exports['index']=function(_0x49dd59,_0x2a950e){var _0x25e5bc={},_0x44cf91={},_0x7c0119={'count':0x0,'rows':[]};var _0x1599c7=_[_0x22eb('0x26')](db[_0x22eb('0x27')][_0x22eb('0x28')],function(_0x382784){return{'name':_0x382784[_0x22eb('0x29')],'type':_0x382784[_0x22eb('0x2a')][_0x22eb('0x2b')]};});_0x44cf91['model']=_[_0x22eb('0x2c')](_['map'](_0x1599c7,_0x22eb('0x24')),[_0x22eb('0x2d')]);_0x44cf91[_0x22eb('0x2e')]=_[_0x22eb('0x2f')](_0x49dd59[_0x22eb('0x2e')]);_0x44cf91[_0x22eb('0x30')]=_[_0x22eb('0x31')](_0x44cf91[_0x22eb('0x32')],_0x44cf91[_0x22eb('0x2e')]);_0x25e5bc[_0x22eb('0x33')]=_['intersection'](_0x44cf91['model'],qs[_0x22eb('0x34')](_0x49dd59['query']['fields']));_0x25e5bc[_0x22eb('0x33')]=_0x25e5bc[_0x22eb('0x33')][_0x22eb('0x35')]?_0x25e5bc[_0x22eb('0x33')]:_0x44cf91[_0x22eb('0x32')];if(!_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x36')](_0x22eb('0x37'))){_0x25e5bc[_0x22eb('0x38')]=qs[_0x22eb('0x38')](_0x49dd59['query'][_0x22eb('0x38')]);_0x25e5bc['offset']=qs['offset'](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x19')]);}_0x25e5bc['order']=qs[_0x22eb('0x39')](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x39')]);_0x25e5bc[_0x22eb('0x3a')]=qs[_0x22eb('0x30')](_['pick'](_0x49dd59[_0x22eb('0x2e')],_0x44cf91[_0x22eb('0x30')]),_0x1599c7);if(_0x49dd59['query'][_0x22eb('0x3b')]){_0x25e5bc[_0x22eb('0x3a')]=_[_0x22eb('0x3c')](_0x25e5bc[_0x22eb('0x3a')],{'$or':_[_0x22eb('0x26')](_0x1599c7,function(_0x5382eb){if(_0x5382eb['type']!==_0x22eb('0x3d')){var _0x6cd651={};_0x6cd651[_0x5382eb['name']]={'$like':'%'+_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3b')]+'%'};return _0x6cd651;}})});}_0x25e5bc=_[_0x22eb('0x3c')]({},_0x25e5bc,_0x49dd59['options']);var _0x1d977c={'where':_0x25e5bc[_0x22eb('0x3a')]};return db[_0x22eb('0x27')][_0x22eb('0x1b')](_0x1d977c)[_0x22eb('0x20')](function(_0x39778e){_0x7c0119['count']=_0x39778e;if(_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x25e5bc['include']=[{'all':!![]}];}return db[_0x22eb('0x27')][_0x22eb('0x3f')](_0x25e5bc);})[_0x22eb('0x20')](function(_0x30cb10){_0x7c0119[_0x22eb('0x40')]=_0x30cb10;return _0x7c0119;})[_0x22eb('0x20')](respondWithFilteredResult(_0x2a950e,_0x25e5bc))[_0x22eb('0x41')](handleError(_0x2a950e,null));};exports[_0x22eb('0x42')]=function(_0x1bafa3,_0x82ace8){var _0x3e1826={'raw':![],'where':{'id':_0x1bafa3[_0x22eb('0x43')]['id']}},_0x1cf1e0={};_0x1cf1e0[_0x22eb('0x32')]=_[_0x22eb('0x2f')](db[_0x22eb('0x27')][_0x22eb('0x28')]);_0x1cf1e0[_0x22eb('0x2e')]=_['keys'](_0x1bafa3[_0x22eb('0x2e')]);_0x1cf1e0[_0x22eb('0x30')]=_['intersection'](_0x1cf1e0[_0x22eb('0x32')],_0x1cf1e0[_0x22eb('0x2e')]);_0x3e1826['attributes']=_['intersection'](_0x1cf1e0['model'],qs[_0x22eb('0x34')](_0x1bafa3[_0x22eb('0x2e')]['fields']));_0x3e1826['attributes']=_0x3e1826[_0x22eb('0x33')][_0x22eb('0x35')]?_0x3e1826[_0x22eb('0x33')]:_0x1cf1e0[_0x22eb('0x32')];if(_0x1bafa3[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x3e1826[_0x22eb('0x44')]=[{'all':!![]}];}_0x3e1826=_[_0x22eb('0x3c')]({},_0x3e1826,_0x1bafa3['options']);return db['ScreenRecording'][_0x22eb('0x45')](_0x3e1826)['then'](handleEntityNotFound(_0x82ace8,null))[_0x22eb('0x20')](respondWithResult(_0x82ace8,null))['catch'](handleError(_0x82ace8,null));};exports[_0x22eb('0x46')]=function(_0x5c41c0,_0x4b2f86){return db['ScreenRecording']['create'](_0x5c41c0[_0x22eb('0x47')],{})['then'](respondWithResult(_0x4b2f86,0xc9))[_0x22eb('0x41')](handleError(_0x4b2f86,null));};exports[_0x22eb('0x1f')]=function(_0x490bef,_0x24e6ba){if(_0x490bef['body']['id']){delete _0x490bef[_0x22eb('0x47')]['id'];}delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x48')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x49')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4a')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4b')];return db['ScreenRecording'][_0x22eb('0x45')]({'where':{'id':_0x490bef[_0x22eb('0x43')]['id']}})['then'](handleEntityNotFound(_0x24e6ba,null))[_0x22eb('0x20')](saveUpdates(_0x490bef[_0x22eb('0x47')],null))[_0x22eb('0x20')](respondWithResult(_0x24e6ba,null))[_0x22eb('0x41')](handleError(_0x24e6ba,null));};exports['describe']=function(_0x6c0600,_0x169ae1){return db[_0x22eb('0x27')][_0x22eb('0x4c')]()[_0x22eb('0x20')](respondWithResult(_0x169ae1,null))[_0x22eb('0x41')](handleError(_0x169ae1,null));};exports['download']=function(_0x29d7ca,_0x4e5b9f,_0x3ff406){var _0x5eecef=require(_0x22eb('0x4d'));var _0x254b53=![];var _0x4028ef={};if(_0x29d7ca[_0x22eb('0x2e')][_0x22eb('0x2a')]&&_0x29d7ca['query']['type']===_0x22eb('0x4e')){_0x4028ef[_0x22eb('0x4e')]=_0x29d7ca['params']['id'];}else{_0x4028ef['id']=_0x29d7ca[_0x22eb('0x43')]['id'];}return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':_0x4028ef,'attributes':['id',_0x22eb('0x4b')],'raw':!![]})[_0x22eb('0x20')](handleEntityNotFound(_0x4e5b9f,null))[_0x22eb('0x20')](function(_0x3a8588){if(_0x3a8588){var _0x35c997=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x3a8588['value']);var _0x19cadf=util[_0x22eb('0x2d')](_0x22eb('0x52'),_0x35c997);if(fs[_0x22eb('0x53')](_0x19cadf)){_0x254b53=!![];return _0x5eecef[_0x22eb('0x54')](_0x19cadf,_0x35c997,config[_0x22eb('0x55')][_0x22eb('0x56')])[_0x22eb('0x20')](function(){return _0x3a8588;});}return _0x3a8588;}})[_0x22eb('0x20')](function(_0x9f8465){if(_0x9f8465){var _0x3e9ab5=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x9f8465['value']);if(!fs['existsSync'](_0x3e9ab5)){throw new db[(_0x22eb('0x57'))][(_0x22eb('0x58'))](_0x22eb('0x59'));}if(_0x9f8465[_0x22eb('0x5a')]){return _0x4e5b9f[_0x22eb('0x5b')](_0x3e9ab5,_0x9f8465['filename']+path[_0x22eb('0x5c')](_0x3e9ab5),function(){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}else{return _0x4e5b9f['download'](_0x3e9ab5,function(_0x485408){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}}})[_0x22eb('0x41')](function(_0xb5c8ae){if(_0xb5c8ae[_0x22eb('0x5e')]===_0x22eb('0x59')){_0x4e5b9f[_0x22eb('0x17')](0x194)[_0x22eb('0x25')](_0x22eb('0x5f'));}else{return handleError(_0x4e5b9f,null);}});};exports[_0x22eb('0x21')]=function(_0x19b579,_0x164645){return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':{'id':_0x19b579[_0x22eb('0x43')]['id']}})['then'](function(_0x29dd8b){if(_[_0x22eb('0x60')](_0x29dd8b)){throw new ReferenceError(_0x22eb('0x61'));}return _0x29dd8b;})['then'](function(_0x1787ec){var _0x5ac4c5=path[_0x22eb('0x4f')](config['root'],_0x22eb('0x51'),_0x1787ec[_0x22eb('0x4b')]);logger['info'](_0x22eb('0x62'),_0x5ac4c5);if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs['existsSync'](_0x5ac4c5)){logger[_0x22eb('0x63')](_0x22eb('0x64')+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}_0x5ac4c5=_0x5ac4c5+_0x22eb('0x67');if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs[_0x22eb('0x53')](_0x5ac4c5)){logger['info']('File:\x20\x22'+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}return _0x1787ec;})[_0x22eb('0x20')](function(_0x22b5c6){if(!_0x22b5c6)throw new InternalError();return _0x22b5c6[_0x22eb('0x21')]();})[_0x22eb('0x20')](function(){_0x164645[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();})['catch'](handleError(_0x164645,null));}; \ No newline at end of file +var _0x4b84=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','show','params','find','catch','create','body','duration','createdAt','closedAt','value','download','uniqueid','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','join','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','differenceBy','map','format'];(function(_0x340700,_0x32ad39){var _0x2b871d=function(_0x340e53){while(--_0x340e53){_0x340700['push'](_0x340700['shift']());}};_0x2b871d(++_0x32ad39);}(_0x4b84,0x1cc));var _0x44b8=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x4b84[_0xbe200f];return _0x192597;};'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['ScreenRecording'][_0x44b8('0x25')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x26')],'type':_0x29b18d[_0x44b8('0x27')][_0x44b8('0x28')]};});_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x2a')](_[_0x44b8('0x2b')](_0x5a544c,_0x44b8('0x23')),[_0x44b8('0x2c')]);_0x4a182d[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x242342[_0x44b8('0x2d')]);_0x4a182d['filters']=_[_0x44b8('0x2f')](_0x4a182d['model'],_0x4a182d[_0x44b8('0x2d')]);_0x2e0174[_0x44b8('0x30')]=_[_0x44b8('0x2f')](_0x4a182d[_0x44b8('0x29')],qs[_0x44b8('0x31')](_0x242342['query'][_0x44b8('0x31')]));_0x2e0174[_0x44b8('0x30')]=_0x2e0174[_0x44b8('0x30')][_0x44b8('0x32')]?_0x2e0174[_0x44b8('0x30')]:_0x4a182d['model'];if(!_0x242342[_0x44b8('0x2d')][_0x44b8('0x33')](_0x44b8('0x34'))){_0x2e0174[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x17')]);_0x2e0174[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x19')]);}_0x2e0174[_0x44b8('0x35')]=qs[_0x44b8('0x36')](_0x242342[_0x44b8('0x2d')][_0x44b8('0x36')]);_0x2e0174[_0x44b8('0x37')]=qs[_0x44b8('0x38')](_[_0x44b8('0x39')](_0x242342[_0x44b8('0x2d')],_0x4a182d[_0x44b8('0x38')]),_0x5a544c);if(_0x242342[_0x44b8('0x2d')][_0x44b8('0x3a')]){_0x2e0174['where']=_[_0x44b8('0x3b')](_0x2e0174[_0x44b8('0x37')],{'$or':_['map'](_0x5a544c,function(_0x25688b){if(_0x25688b[_0x44b8('0x27')]!==_0x44b8('0x3c')){var _0x332c2b={};_0x332c2b[_0x25688b['name']]={'$like':'%'+_0x242342[_0x44b8('0x2d')][_0x44b8('0x3a')]+'%'};return _0x332c2b;}})});}_0x2e0174=_[_0x44b8('0x3b')]({},_0x2e0174,_0x242342[_0x44b8('0x3d')]);var _0x9cb2a={'where':_0x2e0174[_0x44b8('0x37')]};return db[_0x44b8('0x3e')][_0x44b8('0x18')](_0x9cb2a)[_0x44b8('0x20')](function(_0x3d1be1){_0xfb0028[_0x44b8('0x18')]=_0x3d1be1;if(_0x242342[_0x44b8('0x2d')][_0x44b8('0x3f')]){_0x2e0174[_0x44b8('0x40')]=[{'all':!![]}];}return db[_0x44b8('0x3e')][_0x44b8('0x41')](_0x2e0174);})['then'](function(_0x12a0a4){_0xfb0028[_0x44b8('0x42')]=_0x12a0a4;return _0xfb0028;})[_0x44b8('0x20')](respondWithFilteredResult(_0x53d9c7,_0x2e0174))['catch'](handleError(_0x53d9c7,null));};exports[_0x44b8('0x43')]=function(_0x1054c5,_0x229cc9){var _0x585a16={'raw':![],'where':{'id':_0x1054c5[_0x44b8('0x44')]['id']}},_0xbad4bb={};_0xbad4bb[_0x44b8('0x29')]=_[_0x44b8('0x2e')](db[_0x44b8('0x3e')]['rawAttributes']);_0xbad4bb['query']=_[_0x44b8('0x2e')](_0x1054c5[_0x44b8('0x2d')]);_0xbad4bb[_0x44b8('0x38')]=_[_0x44b8('0x2f')](_0xbad4bb[_0x44b8('0x29')],_0xbad4bb[_0x44b8('0x2d')]);_0x585a16[_0x44b8('0x30')]=_[_0x44b8('0x2f')](_0xbad4bb[_0x44b8('0x29')],qs[_0x44b8('0x31')](_0x1054c5[_0x44b8('0x2d')][_0x44b8('0x31')]));_0x585a16[_0x44b8('0x30')]=_0x585a16[_0x44b8('0x30')][_0x44b8('0x32')]?_0x585a16[_0x44b8('0x30')]:_0xbad4bb[_0x44b8('0x29')];if(_0x1054c5[_0x44b8('0x2d')][_0x44b8('0x3f')]){_0x585a16['include']=[{'all':!![]}];}_0x585a16=_['merge']({},_0x585a16,_0x1054c5[_0x44b8('0x3d')]);return db[_0x44b8('0x3e')][_0x44b8('0x45')](_0x585a16)[_0x44b8('0x20')](handleEntityNotFound(_0x229cc9,null))[_0x44b8('0x20')](respondWithResult(_0x229cc9,null))[_0x44b8('0x46')](handleError(_0x229cc9,null));};exports[_0x44b8('0x47')]=function(_0x4fe73f,_0x156070){return db['ScreenRecording'][_0x44b8('0x47')](_0x4fe73f[_0x44b8('0x48')],{})[_0x44b8('0x20')](respondWithResult(_0x156070,0xc9))[_0x44b8('0x46')](handleError(_0x156070,null));};exports[_0x44b8('0x1f')]=function(_0x35ca19,_0x491600){if(_0x35ca19[_0x44b8('0x48')]['id']){delete _0x35ca19[_0x44b8('0x48')]['id'];}delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x49')];delete _0x35ca19['body'][_0x44b8('0x4a')];delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x4b')];delete _0x35ca19[_0x44b8('0x48')][_0x44b8('0x4c')];return db[_0x44b8('0x3e')]['find']({'where':{'id':_0x35ca19[_0x44b8('0x44')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x491600,null))[_0x44b8('0x20')](saveUpdates(_0x35ca19[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x491600,null))['catch'](handleError(_0x491600,null));};exports['describe']=function(_0x2516fc,_0x4eb344){return db[_0x44b8('0x3e')]['describe']()[_0x44b8('0x20')](respondWithResult(_0x4eb344,null))[_0x44b8('0x46')](handleError(_0x4eb344,null));};exports[_0x44b8('0x4d')]=function(_0x15f4c6,_0x2fa6b4,_0x32f588){var _0xdc67e8=require('../../components/encryptor');var _0x3ad278=![];var _0x37b2c2={};if(_0x15f4c6[_0x44b8('0x2d')]['type']&&_0x15f4c6[_0x44b8('0x2d')][_0x44b8('0x27')]===_0x44b8('0x4e')){_0x37b2c2[_0x44b8('0x4e')]=_0x15f4c6['params']['id'];}else{_0x37b2c2['id']=_0x15f4c6[_0x44b8('0x44')]['id'];}return db[_0x44b8('0x3e')]['find']({'where':_0x37b2c2,'attributes':['id',_0x44b8('0x4c')],'raw':!![]})[_0x44b8('0x20')](handleEntityNotFound(_0x2fa6b4,null))[_0x44b8('0x20')](function(_0x3df6aa){if(_0x3df6aa){var _0xe86e34=path['join'](config['root'],_0x44b8('0x4f'),_0x3df6aa[_0x44b8('0x4c')]);var _0xa30834=util[_0x44b8('0x2c')](_0x44b8('0x50'),_0xe86e34);if(fs[_0x44b8('0x51')](_0xa30834)){_0x3ad278=!![];return _0xdc67e8[_0x44b8('0x52')](_0xa30834,_0xe86e34,config[_0x44b8('0x53')][_0x44b8('0x54')])[_0x44b8('0x20')](function(){return _0x3df6aa;});}return _0x3df6aa;}})[_0x44b8('0x20')](function(_0x3f7576){if(_0x3f7576){var _0x5af3e6=path[_0x44b8('0x55')](config[_0x44b8('0x56')],_0x44b8('0x4f'),_0x3f7576[_0x44b8('0x4c')]);if(!fs[_0x44b8('0x51')](_0x5af3e6)){throw new db[(_0x44b8('0x57'))][(_0x44b8('0x58'))](_0x44b8('0x59'));}if(_0x3f7576[_0x44b8('0x5a')]){return _0x2fa6b4[_0x44b8('0x4d')](_0x5af3e6,_0x3f7576[_0x44b8('0x5a')]+path[_0x44b8('0x5b')](_0x5af3e6),function(){if(_0x3ad278){fs[_0x44b8('0x5c')](_0x5af3e6);}});}else{return _0x2fa6b4[_0x44b8('0x4d')](_0x5af3e6,function(_0x2250bb){if(_0x3ad278){fs[_0x44b8('0x5c')](_0x5af3e6);}});}}})[_0x44b8('0x46')](function(_0x20e563){if(_0x20e563['message']===_0x44b8('0x59')){_0x2fa6b4[_0x44b8('0x14')](0x194)[_0x44b8('0x5d')](_0x44b8('0x5e'));}else{return handleError(_0x2fa6b4,null);}});};exports[_0x44b8('0x21')]=function(_0x29ed5d,_0x2ecf65){return db['ScreenRecording'][_0x44b8('0x45')]({'where':{'id':_0x29ed5d[_0x44b8('0x44')]['id']}})['then'](function(_0x2a95f6){if(_[_0x44b8('0x5f')](_0x2a95f6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2a95f6;})[_0x44b8('0x20')](function(_0x454fe6){var _0x370618=path['join'](config[_0x44b8('0x56')],'server/files/screen_recordings',_0x454fe6[_0x44b8('0x4c')]);logger['info'](_0x44b8('0x60'),_0x370618);if(!_[_0x44b8('0x5f')](_0x454fe6[_0x44b8('0x4c')])&&fs[_0x44b8('0x51')](_0x370618)){logger[_0x44b8('0x61')](_0x44b8('0x62')+_0x370618+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x44b8('0x63')](_0x370618);}_0x370618=_0x370618+'.cypher';if(!_[_0x44b8('0x5f')](_0x454fe6[_0x44b8('0x4c')])&&fs['existsSync'](_0x370618)){logger[_0x44b8('0x61')](_0x44b8('0x62')+_0x370618+_0x44b8('0x64'));fs[_0x44b8('0x63')](_0x370618);}return _0x454fe6;})[_0x44b8('0x20')](function(_0x3774fe){if(!_0x3774fe)throw new InternalError();return _0x3774fe[_0x44b8('0x21')]();})[_0x44b8('0x20')](function(){_0x2ecf65[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();})[_0x44b8('0x46')](handleError(_0x2ecf65,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 0e4c70a..ce6d1b0 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 _0x2088=['interactionid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings'];(function(_0x1dd242,_0x1c61a3){var _0x1c6510=function(_0x3df61b){while(--_0x3df61b){_0x1dd242['push'](_0x1dd242['shift']());}};_0x1c6510(++_0x1c61a3);}(_0x2088,0x189));var _0x8208=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x2088[_0x296754];return _0x1d9f1d;};'use strict';var _=require(_0x8208('0x0'));var util=require(_0x8208('0x1'));var logger=require('../../config/logger')(_0x8208('0x2'));var moment=require(_0x8208('0x3'));var BPromise=require('bluebird');var rp=require(_0x8208('0x4'));var fs=require('fs');var path=require(_0x8208('0x5'));var rimraf=require(_0x8208('0x6'));var config=require(_0x8208('0x7'));var attributes=require(_0x8208('0x8'));module[_0x8208('0x9')]=function(_0x5eaac3,_0x1fa55a){return _0x5eaac3[_0x8208('0xa')](_0x8208('0xb'),attributes,{'tableName':_0x8208('0xc'),'paranoid':![],'indexes':[{'name':_0x8208('0xd'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd4=['exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x544099,_0x102022){var _0x1e5253=function(_0x3eb26d){while(--_0x3eb26d){_0x544099['push'](_0x544099['shift']());}};_0x1e5253(++_0x102022);}(_0x2bd4,0x7d));var _0x42bd=function(_0x13dcdc,_0x18d835){_0x13dcdc=_0x13dcdc-0x0;var _0x52a446=_0x2bd4[_0x13dcdc];return _0x52a446;};'use strict';var _=require(_0x42bd('0x0'));var util=require(_0x42bd('0x1'));var logger=require(_0x42bd('0x2'))('api');var moment=require(_0x42bd('0x3'));var BPromise=require(_0x42bd('0x4'));var rp=require(_0x42bd('0x5'));var fs=require('fs');var path=require(_0x42bd('0x6'));var rimraf=require(_0x42bd('0x7'));var config=require(_0x42bd('0x8'));var attributes=require(_0x42bd('0x9'));module[_0x42bd('0xa')]=function(_0x2aa6cb,_0x5d8e63){return _0x2aa6cb[_0x42bd('0xb')](_0x42bd('0xc'),attributes,{'tableName':_0x42bd('0xd'),'paranoid':![],'indexes':[{'name':_0x42bd('0xe'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 90131ae..d01b7c3 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 _0x535a=['request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x535a,0x136));var _0xa535=function(_0x496b59,_0x54283d){_0x496b59=_0x496b59-0x0;var _0x23b37f=_0x535a[_0x496b59];return _0x23b37f;};'use strict';var _=require(_0xa535('0x0'));var util=require(_0xa535('0x1'));var moment=require(_0xa535('0x2'));var BPromise=require(_0xa535('0x3'));var rs=require(_0xa535('0x4'));var fs=require('fs');var Redis=require(_0xa535('0x5'));var db=require(_0xa535('0x6'))['db'];var utils=require(_0xa535('0x7'));var logger=require(_0xa535('0x8'))(_0xa535('0x9'));var config=require(_0xa535('0xa'));var jayson=require(_0xa535('0xb'));var client=jayson[_0xa535('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f6a39,_0x400151,_0x54d974){return new BPromise(function(_0x38bd8a,_0x205a85){return client[_0xa535('0xd')](_0x2f6a39,_0x54d974)['then'](function(_0x5b1f84){logger[_0xa535('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x400151,_0xa535('0xf'));logger[_0xa535('0x10')](_0xa535('0x11'),_0x400151,_0xa535('0xf'),JSON[_0xa535('0x12')](_0x5b1f84));if(_0x5b1f84[_0xa535('0x13')]){if(_0x5b1f84[_0xa535('0x13')][_0xa535('0x14')]===0x1f4){logger['error'](_0xa535('0x15'),_0x400151,_0x5b1f84[_0xa535('0x13')]['message']);return _0x205a85(_0x5b1f84[_0xa535('0x13')][_0xa535('0x16')]);}logger[_0xa535('0x13')](_0xa535('0x15'),_0x400151,_0x5b1f84['error'][_0xa535('0x16')]);return _0x38bd8a(_0x5b1f84[_0xa535('0x13')][_0xa535('0x16')]);}else{logger[_0xa535('0xe')](_0xa535('0x15'),_0x400151,_0xa535('0xf'));_0x38bd8a(_0x5b1f84[_0xa535('0x17')][_0xa535('0x16')]);}})[_0xa535('0x18')](function(_0x4070bc){logger['error'](_0xa535('0x15'),_0x400151,_0x4070bc);_0x205a85(_0x4070bc);});});} \ No newline at end of file +var _0x9383=['jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9383,0xb5));var _0x3938=function(_0x248031,_0x1eb4ea){_0x248031=_0x248031-0x0;var _0x2feafd=_0x9383[_0x248031];return _0x2feafd;};'use strict';var _=require(_0x3938('0x0'));var util=require(_0x3938('0x1'));var moment=require(_0x3938('0x2'));var BPromise=require(_0x3938('0x3'));var rs=require(_0x3938('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3938('0x5'));var logger=require(_0x3938('0x6'))(_0x3938('0x7'));var config=require('../../config/environment');var jayson=require(_0x3938('0x8'));var client=jayson[_0x3938('0x9')][_0x3938('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55d171,_0x2c91fd,_0xbfd77b){return new BPromise(function(_0x42b213,_0x2c629b){return client['request'](_0x55d171,_0xbfd77b)[_0x3938('0xb')](function(_0x23977d){logger[_0x3938('0xc')](_0x3938('0xd'),_0x2c91fd,'request\x20sent');logger[_0x3938('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2c91fd,'request\x20sent',JSON[_0x3938('0xf')](_0x23977d));if(_0x23977d[_0x3938('0x10')]){if(_0x23977d['error'][_0x3938('0x11')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x2c91fd,_0x23977d[_0x3938('0x10')]['message']);return _0x2c629b(_0x23977d['error'][_0x3938('0x12')]);}logger[_0x3938('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x2c91fd,_0x23977d[_0x3938('0x10')]['message']);return _0x42b213(_0x23977d['error'][_0x3938('0x12')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x2c91fd,_0x3938('0x13'));_0x42b213(_0x23977d['result']['message']);}})[_0x3938('0x14')](function(_0x1cb58d){logger[_0x3938('0x10')](_0x3938('0xd'),_0x2c91fd,_0x1cb58d);_0x2c629b(_0x1cb58d);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 289e096..d1d1260 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 _0x0f27=['index','get','/now','getDate','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','logologin','post','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','addFavicon','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0x0f27,0x171));var _0x70f2=function(_0x32084f,_0x28fc38){_0x32084f=_0x32084f-0x0;var _0x187302=_0x0f27[_0x32084f];return _0x187302;};'use strict';var multer=require(_0x70f2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x70f2('0x1'));var express=require(_0x70f2('0x2'));var router=express[_0x70f2('0x3')]();var fs_extra=require(_0x70f2('0x4'));var auth=require(_0x70f2('0x5'));var interaction=require(_0x70f2('0x6'));var config=require('../../config/environment');var controller=require(_0x70f2('0x7'));router['get']('/',auth[_0x70f2('0x8')](),controller[_0x70f2('0x9')]);router[_0x70f2('0xa')](_0x70f2('0xb'),controller[_0x70f2('0xc')]);router[_0x70f2('0xa')](_0x70f2('0xd'),controller[_0x70f2('0xe')]);router[_0x70f2('0xa')](_0x70f2('0xf'),controller['getLogo']);router[_0x70f2('0xa')]('/:id/logo_login',controller[_0x70f2('0x10')]);router[_0x70f2('0xa')](_0x70f2('0x11'),controller[_0x70f2('0x12')]);router[_0x70f2('0xa')](_0x70f2('0x13'),controller[_0x70f2('0x14')]);router[_0x70f2('0xa')](_0x70f2('0x15'),controller[_0x70f2('0x16')]);var upload=multer({'storage':multer[_0x70f2('0x17')]({'destination':function(_0x339bf4,_0x2f9e60,_0x31d2d1){_0x31d2d1(null,path[_0x70f2('0x18')](config[_0x70f2('0x19')],_0x70f2('0x1a')));},'filename':function(_0x27b6d1,_0x3ee836,_0x23f98f){_0x23f98f(null,util[_0x70f2('0x1b')](_0x70f2('0x1c'),_0x70f2('0x1d'),path[_0x70f2('0x1e')](_0x3ee836[_0x70f2('0x1f')])));}})});router['post'](_0x70f2('0xf'),upload[_0x70f2('0x20')](_0x70f2('0x21')),controller['addLogo']);var upload=multer({'storage':multer[_0x70f2('0x17')]({'destination':function(_0x2ce844,_0x34a6c4,_0x4f739c){_0x4f739c(null,path[_0x70f2('0x18')](config[_0x70f2('0x19')],_0x70f2('0x1a')));},'filename':function(_0x42eca7,_0x6a8554,_0x3edd15){_0x3edd15(null,util[_0x70f2('0x1b')](_0x70f2('0x1c'),_0x70f2('0x22'),path[_0x70f2('0x1e')](_0x6a8554[_0x70f2('0x1f')])));}})});router[_0x70f2('0x23')](_0x70f2('0x24'),upload[_0x70f2('0x20')](_0x70f2('0x21')),controller[_0x70f2('0x25')]);var upload=multer({'storage':multer[_0x70f2('0x17')]({'destination':function(_0x2e31ba,_0x926bc,_0x5f3955){_0x5f3955(null,path['join'](config[_0x70f2('0x19')],_0x70f2('0x1a')));},'filename':function(_0x3e25ea,_0xe60a,_0x774f84){_0x774f84(null,util[_0x70f2('0x1b')](_0x70f2('0x1c'),_0x70f2('0x26'),path[_0x70f2('0x1e')](_0xe60a[_0x70f2('0x1f')])));}})});router[_0x70f2('0x23')](_0x70f2('0x13'),upload[_0x70f2('0x20')](_0x70f2('0x21')),controller[_0x70f2('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28121a,_0xce5cb8,_0x5bd851){_0x5bd851(null,path['join'](config['root'],_0x70f2('0x1a')));},'filename':function(_0x2c0fb1,_0x1f6c4d,_0x39d023){_0x39d023(null,util[_0x70f2('0x1b')](_0x70f2('0x1c'),_0x70f2('0x28'),path[_0x70f2('0x1e')](_0x1f6c4d[_0x70f2('0x1f')])));}})});router[_0x70f2('0x23')](_0x70f2('0x15'),upload[_0x70f2('0x20')]('file'),controller[_0x70f2('0x29')]);router['put'](_0x70f2('0xd'),auth[_0x70f2('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xd1dc=['/:id/preferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','addLogo','logologin','post','addLogoLogin','preferred','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr'];(function(_0x1bb4da,_0x597af0){var _0x2bbc41=function(_0x90df2b){while(--_0x90df2b){_0x1bb4da['push'](_0x1bb4da['shift']());}};_0x2bbc41(++_0x597af0);}(_0xd1dc,0x15a));var _0xcd1d=function(_0x2ec53e,_0x59038e){_0x2ec53e=_0x2ec53e-0x0;var _0x3a42d0=_0xd1dc[_0x2ec53e];return _0x3a42d0;};'use strict';var multer=require(_0xcd1d('0x0'));var util=require(_0xcd1d('0x1'));var path=require(_0xcd1d('0x2'));var timeout=require(_0xcd1d('0x3'));var express=require(_0xcd1d('0x4'));var router=express[_0xcd1d('0x5')]();var fs_extra=require(_0xcd1d('0x6'));var auth=require(_0xcd1d('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcd1d('0x8'));router['get']('/',auth[_0xcd1d('0x9')](),controller[_0xcd1d('0xa')]);router[_0xcd1d('0xb')](_0xcd1d('0xc'),controller[_0xcd1d('0xd')]);router[_0xcd1d('0xb')](_0xcd1d('0xe'),controller[_0xcd1d('0xf')]);router[_0xcd1d('0xb')](_0xcd1d('0x10'),controller[_0xcd1d('0x11')]);router['get'](_0xcd1d('0x12'),controller[_0xcd1d('0x13')]);router[_0xcd1d('0xb')](_0xcd1d('0x14'),controller[_0xcd1d('0x15')]);router[_0xcd1d('0xb')](_0xcd1d('0x16'),controller['getPreferred']);router['get']('/:id/favicon',controller[_0xcd1d('0x17')]);var upload=multer({'storage':multer[_0xcd1d('0x18')]({'destination':function(_0x34b045,_0x2a5af8,_0x30ce98){_0x30ce98(null,path[_0xcd1d('0x19')](config[_0xcd1d('0x1a')],_0xcd1d('0x1b')));},'filename':function(_0x216f24,_0x1fb471,_0x36c56c){_0x36c56c(null,util[_0xcd1d('0x1c')](_0xcd1d('0x1d'),_0xcd1d('0x1e'),path[_0xcd1d('0x1f')](_0x1fb471[_0xcd1d('0x20')])));}})});router['post'](_0xcd1d('0x10'),upload[_0xcd1d('0x21')](_0xcd1d('0x22')),controller[_0xcd1d('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe0e25f,_0x1b59f2,_0x45758b){_0x45758b(null,path['join'](config['root'],_0xcd1d('0x1b')));},'filename':function(_0x27a99e,_0x3f2763,_0xe5d972){_0xe5d972(null,util['format'](_0xcd1d('0x1d'),_0xcd1d('0x24'),path[_0xcd1d('0x1f')](_0x3f2763[_0xcd1d('0x20')])));}})});router[_0xcd1d('0x25')](_0xcd1d('0x12'),upload[_0xcd1d('0x21')](_0xcd1d('0x22')),controller[_0xcd1d('0x26')]);var upload=multer({'storage':multer[_0xcd1d('0x18')]({'destination':function(_0x2ba210,_0x661370,_0x446432){_0x446432(null,path['join'](config[_0xcd1d('0x1a')],_0xcd1d('0x1b')));},'filename':function(_0x30bbaf,_0x1053dd,_0x44d0bb){_0x44d0bb(null,util['format'](_0xcd1d('0x1d'),_0xcd1d('0x27'),path[_0xcd1d('0x1f')](_0x1053dd['originalname'])));}})});router[_0xcd1d('0x25')](_0xcd1d('0x16'),upload['single'](_0xcd1d('0x22')),controller['addPreferred']);var upload=multer({'storage':multer[_0xcd1d('0x18')]({'destination':function(_0x141dd3,_0x192fa1,_0x203165){_0x203165(null,path[_0xcd1d('0x19')](config['root'],_0xcd1d('0x1b')));},'filename':function(_0x3652a5,_0x530e86,_0x2fe1f7){_0x2fe1f7(null,util[_0xcd1d('0x1c')](_0xcd1d('0x1d'),_0xcd1d('0x28'),path[_0xcd1d('0x1f')](_0x530e86['originalname'])));}})});router[_0xcd1d('0x25')](_0xcd1d('0x29'),upload[_0xcd1d('0x21')](_0xcd1d('0x22')),controller[_0xcd1d('0x2a')]);router[_0xcd1d('0x2b')](_0xcd1d('0xe'),auth[_0xcd1d('0x9')](),controller[_0xcd1d('0x2c')]);module[_0xcd1d('0x2d')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index ef4fd49..cf6991b 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 _0xdb28=['INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x558486,_0xa89a21){_0x558486=_0x558486-0x0;var _0x15e0c1=_0xdb28[_0x558486];return _0x15e0c1;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'min_internal':{'type':Sequelize[_0x8db2('0x2')](0xb),'unique':_0x8db2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8db2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x6')},'logo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnusername':{'type':Sequelize[_0x8db2('0x5')]},'turnpassword':{'type':Sequelize[_0x8db2('0x5')]},'pageTitle':{'type':Sequelize[_0x8db2('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x8db2('0x8')},'enableEmailPreview':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8db2('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8db2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8db2('0x5')]},'defaultFavicon':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8db2('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8db2('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8db2('0x2')]},'sentimentRegion':{'type':Sequelize[_0x8db2('0x5')]},'language':{'type':Sequelize[_0x8db2('0x5')]},'bucket':{'type':Sequelize[_0x8db2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x8db2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8db2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x2ef3=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x1ac3ed,_0xb498){var _0x4fd63b=function(_0x18dd56){while(--_0x18dd56){_0x1ac3ed['push'](_0x1ac3ed['shift']());}};_0x4fd63b(++_0xb498);}(_0x2ef3,0xba));var _0x32ef=function(_0x1fd1f0,_0x253252){_0x1fd1f0=_0x1fd1f0-0x0;var _0x12677a=_0x2ef3[_0x1fd1f0];return _0x12677a;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'min_internal':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x32ef('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnusername':{'type':Sequelize[_0x32ef('0x5')]},'turnpassword':{'type':Sequelize[_0x32ef('0x5')]},'pageTitle':{'type':Sequelize[_0x32ef('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x8')},'enableEmailPreview':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x32ef('0x5')]},'defaultFavicon':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x32ef('0x2')]},'transcribeRegion':{'type':Sequelize[_0x32ef('0x5')]},'sentiment':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x32ef('0x5')]},'language':{'type':Sequelize[_0x32ef('0x5')]},'bucket':{'type':Sequelize[_0x32ef('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x32ef('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index b83a2f8..2541e30 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 _0x5b96=['type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','body','file','logo','params','addLogoLogin','filename','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','toLower','root','join','default_logo.svg','upperFirst','existsSync','Sequelize','ValidationError','getLogoLogin','getLicense','defaultLoginLogo','loginLogo','default_loginLogo.svg','default','custom','download','getPreferred','default_preferred.png','\x20not\x20found','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','index','map','Setting','rawAttributes','fieldName'];(function(_0x149169,_0x5a0100){var _0x220e71=function(_0x388b5f){while(--_0x388b5f){_0x149169['push'](_0x149169['shift']());}};_0x220e71(++_0x5a0100);}(_0x5b96,0xbc));var _0x65b9=function(_0x3ef8f7,_0x35359a){_0x3ef8f7=_0x3ef8f7-0x0;var _0x3b097e=_0x5b96[_0x3ef8f7];return _0x3b097e;};'use strict';var emlformat=require(_0x65b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65b9('0x1'));var jsonpatch=require(_0x65b9('0x2'));var rp=require('request-promise');var moment=require(_0x65b9('0x3'));var BPromise=require(_0x65b9('0x4'));var Mustache=require(_0x65b9('0x5'));var util=require(_0x65b9('0x6'));var path=require(_0x65b9('0x7'));var sox=require(_0x65b9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65b9('0x9'));var _=require(_0x65b9('0xa'));var squel=require(_0x65b9('0xb'));var crypto=require(_0x65b9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x65b9('0xd'));var toCsv=require(_0x65b9('0xe'));var querystring=require(_0x65b9('0xf'));var Papa=require(_0x65b9('0x10'));var Redis=require(_0x65b9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65b9('0x12'));var hardwareService=require(_0x65b9('0x13'));var logger=require(_0x65b9('0x14'))(_0x65b9('0x15'));var utils=require(_0x65b9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x65b9('0x17'));var db=require(_0x65b9('0x18'))['db'];var jayson=require(_0x65b9('0x19'));var client=jayson['client'][_0x65b9('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xb25f17,_0x54b48d,_0x574cbe,_0x414cc2){return new BPromise(function(_0x807983,_0x5ac38e){var _0x52cc6e=_0x414cc2||client;return _0x52cc6e[_0x65b9('0x1b')](_0xb25f17,_0x574cbe)['then'](function(_0x339f2d){logger['info'](_0x65b9('0x1c'),_0x54b48d,_0x65b9('0x1d'));logger[_0x65b9('0x1e')](_0x65b9('0x1f'),_0x54b48d,'request\x20sent',JSON[_0x65b9('0x20')](_0x339f2d));if(_0x339f2d[_0x65b9('0x21')]){if(_0x339f2d[_0x65b9('0x21')][_0x65b9('0x22')]===0x1f4){logger[_0x65b9('0x21')](_0x65b9('0x1c'),_0x54b48d,_0x339f2d[_0x65b9('0x21')][_0x65b9('0x23')]);return _0x5ac38e(_0x339f2d[_0x65b9('0x21')]['message']);}logger[_0x65b9('0x21')](_0x65b9('0x1c'),_0x54b48d,_0x339f2d[_0x65b9('0x21')][_0x65b9('0x23')]);return _0x807983(_0x339f2d[_0x65b9('0x21')][_0x65b9('0x23')]);}else{logger[_0x65b9('0x24')](_0x65b9('0x1c'),_0x54b48d,_0x65b9('0x1d'));_0x807983(_0x339f2d[_0x65b9('0x25')]['message']);}})[_0x65b9('0x26')](function(_0x157edf){logger[_0x65b9('0x21')]('Setting,\x20%s,\x20%s',_0x54b48d,_0x157edf);_0x5ac38e(_0x157edf);});});}function respondWithStatusCode(_0x38d934,_0x3a25fc){_0x3a25fc=_0x3a25fc||0xcc;return function(_0x2cf0fc){if(_0x2cf0fc){return _0x38d934[_0x65b9('0x27')](_0x3a25fc);}return _0x38d934[_0x65b9('0x28')](_0x3a25fc)[_0x65b9('0x29')]();};}function respondWithResult(_0x2181d5,_0x5c910f){_0x5c910f=_0x5c910f||0xc8;return function(_0x46e3c2){if(_0x46e3c2){return _0x2181d5['status'](_0x5c910f)[_0x65b9('0x2a')](_0x46e3c2);}};}function respondWithFilteredResult(_0x343029,_0x406cf5){return function(_0x4e9851){if(_0x4e9851){var _0x1010a9=typeof _0x406cf5[_0x65b9('0x2b')]===_0x65b9('0x2c')&&typeof _0x406cf5[_0x65b9('0x2d')]===_0x65b9('0x2c');var _0x38b57c=_0x4e9851['count'];var _0x20f248=_0x1010a9?0x0:_0x406cf5[_0x65b9('0x2b')];var _0x4efb48=_0x1010a9?_0x4e9851[_0x65b9('0x2e')]:_0x406cf5['offset']+_0x406cf5[_0x65b9('0x2d')];var _0x3c9e6a;if(_0x4efb48>=_0x38b57c){_0x4efb48=_0x38b57c;_0x3c9e6a=0xc8;}else{_0x3c9e6a=0xce;}_0x343029[_0x65b9('0x28')](_0x3c9e6a);return _0x343029[_0x65b9('0x2f')](_0x65b9('0x30'),_0x20f248+'-'+_0x4efb48+'/'+_0x38b57c)[_0x65b9('0x2a')](_0x4e9851);}return null;};}function patchUpdates(_0x2ae8b0){return function(_0x2f6f46){try{jsonpatch['apply'](_0x2f6f46,_0x2ae8b0,!![]);}catch(_0x5974c6){return BPromise['reject'](_0x5974c6);}return _0x2f6f46[_0x65b9('0x31')]();};}function saveUpdates(_0x2b56c9,_0x20e74f){return function(_0x4f25e0){if(_0x4f25e0){return _0x4f25e0[_0x65b9('0x32')](_0x2b56c9)[_0x65b9('0x33')](function(_0x3d854f){return _0x3d854f;});}return null;};}function removeEntity(_0x144e00,_0x320594){return function(_0x26a668){if(_0x26a668){return _0x26a668[_0x65b9('0x34')]()[_0x65b9('0x33')](function(){_0x144e00[_0x65b9('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e326,_0x418411){return function(_0x4b4153){if(!_0x4b4153){_0x25e326[_0x65b9('0x27')](0x194);}return _0x4b4153;};}function handleError(_0x22721d,_0x1d1b8e){_0x1d1b8e=_0x1d1b8e||0x1f4;return function(_0x3627af){logger['error'](_0x3627af[_0x65b9('0x35')]);if(_0x3627af[_0x65b9('0x36')]){delete _0x3627af['name'];}_0x22721d[_0x65b9('0x28')](_0x1d1b8e)['send'](_0x3627af);};}exports[_0x65b9('0x37')]=function(_0x29bac7,_0x205e70){var _0x40c189={},_0x148580={},_0x267eeb={'count':0x0,'rows':[]};var _0x47c94a=_[_0x65b9('0x38')](db[_0x65b9('0x39')][_0x65b9('0x3a')],function(_0x523e85){return{'name':_0x523e85[_0x65b9('0x3b')],'type':_0x523e85[_0x65b9('0x3c')]['key']};});_0x148580[_0x65b9('0x3d')]=_[_0x65b9('0x38')](_0x47c94a,_0x65b9('0x36'));_0x148580[_0x65b9('0x3e')]=_[_0x65b9('0x3f')](_0x29bac7[_0x65b9('0x3e')]);_0x148580[_0x65b9('0x40')]=_[_0x65b9('0x41')](_0x148580[_0x65b9('0x3d')],_0x148580[_0x65b9('0x3e')]);_0x40c189[_0x65b9('0x42')]=_[_0x65b9('0x41')](_0x148580[_0x65b9('0x3d')],qs[_0x65b9('0x43')](_0x29bac7[_0x65b9('0x3e')][_0x65b9('0x43')]));_0x40c189[_0x65b9('0x42')]=_0x40c189[_0x65b9('0x42')][_0x65b9('0x44')]?_0x40c189[_0x65b9('0x42')]:_0x148580[_0x65b9('0x3d')];if(!_0x29bac7[_0x65b9('0x3e')]['hasOwnProperty'](_0x65b9('0x45'))){_0x40c189[_0x65b9('0x2d')]=qs[_0x65b9('0x2d')](_0x29bac7[_0x65b9('0x3e')][_0x65b9('0x2d')]);_0x40c189[_0x65b9('0x2b')]=qs['offset'](_0x29bac7['query'][_0x65b9('0x2b')]);}_0x40c189[_0x65b9('0x46')]=qs['sort'](_0x29bac7[_0x65b9('0x3e')][_0x65b9('0x47')]);_0x40c189['where']=qs[_0x65b9('0x40')](_[_0x65b9('0x48')](_0x29bac7[_0x65b9('0x3e')],_0x148580['filters']),_0x47c94a);if(_0x29bac7[_0x65b9('0x3e')][_0x65b9('0x49')]){_0x40c189[_0x65b9('0x4a')]=_[_0x65b9('0x4b')](_0x40c189['where'],{'$or':_[_0x65b9('0x38')](_0x47c94a,function(_0x2a913d){if(_0x2a913d[_0x65b9('0x3c')]!==_0x65b9('0x4c')){var _0x20bab5={};_0x20bab5[_0x2a913d[_0x65b9('0x36')]]={'$like':'%'+_0x29bac7[_0x65b9('0x3e')]['filter']+'%'};return _0x20bab5;}})});}_0x40c189=_[_0x65b9('0x4b')]({},_0x40c189,_0x29bac7[_0x65b9('0x4d')]);var _0x20e4a9={'where':_0x40c189[_0x65b9('0x4a')]};return db[_0x65b9('0x39')][_0x65b9('0x2e')](_0x20e4a9)[_0x65b9('0x33')](function(_0x100b67){_0x267eeb[_0x65b9('0x2e')]=_0x100b67;if(_0x29bac7['query'][_0x65b9('0x4e')]){_0x40c189[_0x65b9('0x4f')]=[{'all':!![]}];}return db[_0x65b9('0x39')][_0x65b9('0x50')](_0x40c189);})[_0x65b9('0x33')](function(_0x4ab458){_0x267eeb[_0x65b9('0x51')]=_0x4ab458;return _0x267eeb;})[_0x65b9('0x33')](respondWithFilteredResult(_0x205e70,_0x40c189))[_0x65b9('0x26')](handleError(_0x205e70,null));};exports[_0x65b9('0x52')]=function(_0x1024ae,_0x521750){var _0x144e53={'raw':![],'where':{'id':_0x1024ae['params']['id']}},_0x1f9ac4={};_0x1f9ac4[_0x65b9('0x3d')]=_['keys'](db['Setting']['rawAttributes']);_0x1f9ac4['query']=_[_0x65b9('0x3f')](_0x1024ae[_0x65b9('0x3e')]);_0x1f9ac4[_0x65b9('0x40')]=_[_0x65b9('0x41')](_0x1f9ac4[_0x65b9('0x3d')],_0x1f9ac4['query']);_0x144e53[_0x65b9('0x42')]=_['intersection'](_0x1f9ac4[_0x65b9('0x3d')],qs[_0x65b9('0x43')](_0x1024ae[_0x65b9('0x3e')]['fields']));_0x144e53[_0x65b9('0x42')]=_0x144e53['attributes'][_0x65b9('0x44')]?_0x144e53[_0x65b9('0x42')]:_0x1f9ac4[_0x65b9('0x3d')];if(_0x1024ae[_0x65b9('0x3e')][_0x65b9('0x4e')]){_0x144e53[_0x65b9('0x4f')]=[{'all':!![]}];}_0x144e53=_[_0x65b9('0x4b')]({},_0x144e53,_0x1024ae[_0x65b9('0x4d')]);return db[_0x65b9('0x39')][_0x65b9('0x53')](_0x144e53)['then'](handleEntityNotFound(_0x521750,null))[_0x65b9('0x33')](respondWithResult(_0x521750,null))['catch'](handleError(_0x521750,null));};exports[_0x65b9('0x32')]=function(_0x55e2e0,_0x495045){if(_0x55e2e0[_0x65b9('0x54')]['id']){delete _0x55e2e0[_0x65b9('0x54')]['id'];}return db['Setting'][_0x65b9('0x53')]({'where':{'id':_0x55e2e0['params']['id']}})['then'](handleEntityNotFound(_0x495045,null))['then'](saveUpdates(_0x55e2e0[_0x65b9('0x54')],null))['then'](respondWithResult(_0x495045,null))[_0x65b9('0x26')](handleError(_0x495045,null));};exports['addLogo']=function(_0x2c0aca,_0x370453,_0x36d121){if(_0x2c0aca[_0x65b9('0x55')]&&_0x2c0aca['file']['filename']){_0x2c0aca[_0x65b9('0x54')][_0x65b9('0x56')]=_0x2c0aca[_0x65b9('0x55')]['filename'];}return db[_0x65b9('0x39')]['find']({'where':{'id':_0x2c0aca[_0x65b9('0x57')]['id']}})[_0x65b9('0x33')](handleEntityNotFound(_0x370453,null))['then'](saveUpdates(_0x2c0aca[_0x65b9('0x54')],null))[_0x65b9('0x33')](respondWithResult(_0x370453,null))[_0x65b9('0x26')](handleError(_0x370453,null));};exports[_0x65b9('0x58')]=function(_0x2659df,_0x1dc74e,_0xe8597b){if(_0x2659df[_0x65b9('0x55')]&&_0x2659df[_0x65b9('0x55')][_0x65b9('0x59')]){_0x2659df[_0x65b9('0x54')]['loginLogo']=_0x2659df[_0x65b9('0x55')][_0x65b9('0x59')];}return db['Setting'][_0x65b9('0x53')]({'where':{'id':_0x2659df[_0x65b9('0x57')]['id']}})[_0x65b9('0x33')](handleEntityNotFound(_0x1dc74e,null))['then'](saveUpdates(_0x2659df[_0x65b9('0x54')],null))[_0x65b9('0x33')](respondWithResult(_0x1dc74e,null))[_0x65b9('0x26')](handleError(_0x1dc74e,null));};var utilLicense=require('../../config/license/util');exports[_0x65b9('0x5a')]=function(_0x147f47,_0x25ba32,_0x40dc12){var _0xc49f61=_0x65b9('0x5b');var _0x23615e={'custom':![]};return utilLicense['getLicense']()[_0x65b9('0x33')](function(_0x12e122){if(_0x12e122){_0x23615e=_0x12e122;}return db[_0x65b9('0x39')]['find']({'where':{'id':_0x147f47[_0x65b9('0x57')]['id']},'attributes':[_0x65b9('0x56'),'loginLogo',_0x65b9('0x5c'),_0x65b9('0x5d'),_0x65b9('0x5e'),'defaultLoginLogo',_0x65b9('0x5f'),_0x65b9('0x60')],'raw':!![]});})[_0x65b9('0x33')](handleEntityNotFound(_0x25ba32,null))[_0x65b9('0x33')](function(_0x50bff5){if(_0x50bff5){var _0x23745b=_0x50bff5[_0x65b9('0x56')]&&fs['existsSync'](path['join'](config['root'],_0xc49f61,_[_0x65b9('0x61')](_0x50bff5[_0x65b9('0x56')])))?path['join'](config[_0x65b9('0x62')],_0xc49f61,_[_0x65b9('0x61')](_0x50bff5[_0x65b9('0x56')])):path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0xc49f61,_['toLower'](_0x65b9('0x64')));var _0x56a544='default'+_[_0x65b9('0x65')](_0x65b9('0x56'));if(_0x50bff5[_0x56a544]||!_0x23615e['custom']){_0x23745b=path['join'](config[_0x65b9('0x62')],_0xc49f61,_[_0x65b9('0x61')](_0x65b9('0x64')));}if(!fs[_0x65b9('0x66')](_0x23745b)){throw new db[(_0x65b9('0x67'))][(_0x65b9('0x68'))](_[_0x65b9('0x65')](_0x65b9('0x56'))+'\x20not\x20found');}return _0x25ba32['download'](_0x23745b);}})[_0x65b9('0x26')](handleError(_0x25ba32,null));};var utilLicense=require(_0x65b9('0x17'));exports[_0x65b9('0x69')]=function(_0x35515f,_0x1a0def,_0x5401de){var _0x3b3eb9=_0x65b9('0x5b');var _0x3f9fff={'custom':![]};return utilLicense[_0x65b9('0x6a')]()[_0x65b9('0x33')](function(_0x1c0146){if(_0x1c0146){_0x3f9fff=_0x1c0146;}return db[_0x65b9('0x39')][_0x65b9('0x53')]({'where':{'id':_0x35515f['params']['id']},'attributes':[_0x65b9('0x56'),'loginLogo',_0x65b9('0x5c'),'favicon',_0x65b9('0x5e'),_0x65b9('0x6b'),_0x65b9('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x65b9('0x33')](handleEntityNotFound(_0x1a0def,null))[_0x65b9('0x33')](function(_0x1ed123){if(_0x1ed123){var _0x256746=_0x1ed123['loginLogo']&&fs[_0x65b9('0x66')](path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x3b3eb9,_[_0x65b9('0x61')](_0x1ed123[_0x65b9('0x6c')])))?path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x3b3eb9,_['toLower'](_0x1ed123[_0x65b9('0x6c')])):path[_0x65b9('0x63')](config['root'],_0x3b3eb9,_[_0x65b9('0x61')](_0x65b9('0x6d')));var _0x191e27=_0x65b9('0x6e')+_[_0x65b9('0x65')]('loginLogo');if(_0x1ed123[_0x191e27]||!_0x3f9fff[_0x65b9('0x6f')]){_0x256746=path['join'](config['root'],_0x3b3eb9,_[_0x65b9('0x61')](_0x65b9('0x6d')));}if(!fs[_0x65b9('0x66')](_0x256746)){throw new db[(_0x65b9('0x67'))][(_0x65b9('0x68'))](_[_0x65b9('0x65')]('loginLogo')+'\x20not\x20found');}return _0x1a0def[_0x65b9('0x70')](_0x256746);}})[_0x65b9('0x26')](handleError(_0x1a0def,null));};exports['gdpr']=function(_0x2688f5,_0x444cb3){return db[_0x65b9('0x39')][_0x65b9('0x53')]({'where':{'id':_0x2688f5['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x444cb3,null))['catch'](handleError(_0x444cb3,null));};exports['addPreferred']=function(_0x4fc4f7,_0x493ed0,_0x3e65e7){if(_0x4fc4f7[_0x65b9('0x55')]&&_0x4fc4f7[_0x65b9('0x55')][_0x65b9('0x59')]){_0x4fc4f7[_0x65b9('0x54')]['preferred']=_0x4fc4f7['file'][_0x65b9('0x59')];}return db[_0x65b9('0x39')][_0x65b9('0x53')]({'where':{'id':_0x4fc4f7['params']['id']}})['then'](handleEntityNotFound(_0x493ed0,null))['then'](saveUpdates(_0x4fc4f7[_0x65b9('0x54')],null))[_0x65b9('0x33')](respondWithResult(_0x493ed0,null))[_0x65b9('0x26')](handleError(_0x493ed0,null));};var utilLicense=require(_0x65b9('0x17'));exports[_0x65b9('0x71')]=function(_0x51552b,_0x494076,_0x3d2668){var _0x1291bd=_0x65b9('0x5b');var _0x26ff83={'custom':![]};return utilLicense[_0x65b9('0x6a')]()['then'](function(_0x43bd8d){if(_0x43bd8d){_0x26ff83=_0x43bd8d;}return db[_0x65b9('0x39')][_0x65b9('0x53')]({'where':{'id':_0x51552b[_0x65b9('0x57')]['id']},'attributes':[_0x65b9('0x56'),_0x65b9('0x6c'),_0x65b9('0x5c'),_0x65b9('0x5d'),_0x65b9('0x5e'),'defaultLoginLogo',_0x65b9('0x5f'),_0x65b9('0x60')],'raw':!![]});})[_0x65b9('0x33')](handleEntityNotFound(_0x494076,null))[_0x65b9('0x33')](function(_0x3fab18){if(_0x3fab18){var _0x3d6510=_0x3fab18[_0x65b9('0x5c')]&&fs['existsSync'](path['join'](config[_0x65b9('0x62')],_0x1291bd,_[_0x65b9('0x61')](_0x3fab18[_0x65b9('0x5c')])))?path['join'](config[_0x65b9('0x62')],_0x1291bd,_[_0x65b9('0x61')](_0x3fab18[_0x65b9('0x5c')])):path['join'](config[_0x65b9('0x62')],_0x1291bd,_[_0x65b9('0x61')](_0x65b9('0x72')));var _0x38fce9=_0x65b9('0x6e')+_['upperFirst']('preferred');if(_0x3fab18[_0x38fce9]||!_0x26ff83[_0x65b9('0x6f')]||!_0x26ff83[_0x65b9('0x5c')]){_0x3d6510=path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x1291bd,_['toLower']('default_preferred.png'));}if(!fs[_0x65b9('0x66')](_0x3d6510)){throw new db[(_0x65b9('0x67'))][(_0x65b9('0x68'))](_['upperFirst'](_0x65b9('0x5c'))+_0x65b9('0x73'));}return _0x494076['download'](_0x3d6510);}})['catch'](handleError(_0x494076,null));};exports['addFavicon']=function(_0x51f0bb,_0x5a2977,_0x30be78){if(_0x51f0bb[_0x65b9('0x55')]&&_0x51f0bb[_0x65b9('0x55')][_0x65b9('0x59')]){_0x51f0bb[_0x65b9('0x54')]['favicon']=_0x51f0bb[_0x65b9('0x55')][_0x65b9('0x59')];}return db['Setting'][_0x65b9('0x53')]({'where':{'id':_0x51f0bb[_0x65b9('0x57')]['id']}})[_0x65b9('0x33')](handleEntityNotFound(_0x5a2977,null))[_0x65b9('0x33')](saveUpdates(_0x51f0bb[_0x65b9('0x54')],null))[_0x65b9('0x33')](respondWithResult(_0x5a2977,null))[_0x65b9('0x26')](handleError(_0x5a2977,null));};var utilLicense=require('../../config/license/util');exports[_0x65b9('0x74')]=function(_0x18c778,_0x313572,_0x1f15a5){var _0x38e64d='server/files/images/logos';var _0x2f4be2={'custom':![]};return utilLicense['getLicense']()[_0x65b9('0x33')](function(_0x198910){if(_0x198910){_0x2f4be2=_0x198910;}return db[_0x65b9('0x39')]['find']({'where':{'id':_0x18c778[_0x65b9('0x57')]['id']},'attributes':[_0x65b9('0x56'),'loginLogo',_0x65b9('0x5c'),_0x65b9('0x5d'),_0x65b9('0x5e'),_0x65b9('0x6b'),_0x65b9('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x65b9('0x33')](handleEntityNotFound(_0x313572,null))['then'](function(_0x293129){if(_0x293129){var _0x4ff304=_0x293129[_0x65b9('0x5d')]&&fs[_0x65b9('0x66')](path['join'](config['root'],_0x38e64d,_[_0x65b9('0x61')](_0x293129[_0x65b9('0x5d')])))?path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x38e64d,_[_0x65b9('0x61')](_0x293129[_0x65b9('0x5d')])):path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x38e64d,_[_0x65b9('0x61')](_0x65b9('0x75')));var _0x39a3c0=_0x65b9('0x6e')+_['upperFirst']('favicon');if(_0x293129[_0x39a3c0]||!_0x2f4be2[_0x65b9('0x6f')]){_0x4ff304=path[_0x65b9('0x63')](config[_0x65b9('0x62')],_0x38e64d,_[_0x65b9('0x61')](_0x65b9('0x75')));}if(!fs['existsSync'](_0x4ff304)){throw new db[(_0x65b9('0x67'))][(_0x65b9('0x68'))](_[_0x65b9('0x65')](_0x65b9('0x5d'))+_0x65b9('0x73'));}return _0x313572[_0x65b9('0x70')](_0x4ff304);}})[_0x65b9('0x26')](handleError(_0x313572,null));};exports[_0x65b9('0x76')]=function(_0x3d22ec,_0x4d7b9f){var _0x2ce468={'offset':moment()[_0x65b9('0x77')]()};_0x2ce468[_0x65b9('0x78')]=moment()[_0x65b9('0x77')](_0x2ce468[_0x65b9('0x2b')])[_0x65b9('0x79')](_0x65b9('0x7a'));return _0x4d7b9f[_0x65b9('0x28')](0xc8)[_0x65b9('0x7b')](_0x2ce468);}; \ No newline at end of file +var _0x55db=['save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','nolimit','where','pick','merge','filter','Setting','include','findAll','rows','show','params','length','includeAll','options','find','body','addLogo','file','filename','getLogo','logo','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default','upperFirst','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','defaultFavicon','default_loginLogo.svg','gdpr','addPreferred','server/files/images/logos','getLicense','default_preferred.png','custom','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x55db,0x1b5));var _0xb55d=function(_0x1fdd46,_0x4c6268){_0x1fdd46=_0x1fdd46-0x0;var _0x204722=_0x55db[_0x1fdd46];return _0x204722;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb55d('0x0'));var zipdir=require(_0xb55d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb55d('0x2'));var moment=require(_0xb55d('0x3'));var BPromise=require(_0xb55d('0x4'));var Mustache=require(_0xb55d('0x5'));var util=require('util');var path=require(_0xb55d('0x6'));var sox=require('sox');var csv=require(_0xb55d('0x7'));var ejs=require(_0xb55d('0x8'));var fs=require('fs');var fs_extra=require(_0xb55d('0x9'));var _=require(_0xb55d('0xa'));var squel=require(_0xb55d('0xb'));var crypto=require(_0xb55d('0xc'));var jsforce=require(_0xb55d('0xd'));var deskjs=require(_0xb55d('0xe'));var toCsv=require(_0xb55d('0x7'));var querystring=require(_0xb55d('0xf'));var Papa=require(_0xb55d('0x10'));var Redis=require(_0xb55d('0x11'));var authService=require(_0xb55d('0x12'));var qs=require(_0xb55d('0x13'));var as=require(_0xb55d('0x14'));var hardwareService=require(_0xb55d('0x15'));var logger=require(_0xb55d('0x16'))(_0xb55d('0x17'));var utils=require('../../config/utils');var config=require(_0xb55d('0x18'));var licenseUtil=require(_0xb55d('0x19'));var db=require(_0xb55d('0x1a'))['db'];var jayson=require(_0xb55d('0x1b'));var client=jayson[_0xb55d('0x1c')][_0xb55d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5b1d08,_0x4c2972,_0xeeeb8,_0x4ac21b){return new BPromise(function(_0x3eb2bf,_0x288758){var _0x331a94=_0x4ac21b||client;return _0x331a94['request'](_0x5b1d08,_0xeeeb8)[_0xb55d('0x1e')](function(_0x9c4fa8){logger[_0xb55d('0x1f')]('Setting,\x20%s,\x20%s',_0x4c2972,_0xb55d('0x20'));logger[_0xb55d('0x21')]('Setting,\x20%s,\x20%s,\x20%s',_0x4c2972,'request\x20sent',JSON['stringify'](_0x9c4fa8));if(_0x9c4fa8['error']){if(_0x9c4fa8[_0xb55d('0x22')][_0xb55d('0x23')]===0x1f4){logger[_0xb55d('0x22')](_0xb55d('0x24'),_0x4c2972,_0x9c4fa8[_0xb55d('0x22')][_0xb55d('0x25')]);return _0x288758(_0x9c4fa8['error']['message']);}logger['error']('Setting,\x20%s,\x20%s',_0x4c2972,_0x9c4fa8['error'][_0xb55d('0x25')]);return _0x3eb2bf(_0x9c4fa8[_0xb55d('0x22')][_0xb55d('0x25')]);}else{logger['info'](_0xb55d('0x24'),_0x4c2972,_0xb55d('0x20'));_0x3eb2bf(_0x9c4fa8[_0xb55d('0x26')][_0xb55d('0x25')]);}})[_0xb55d('0x27')](function(_0x33dc06){logger[_0xb55d('0x22')]('Setting,\x20%s,\x20%s',_0x4c2972,_0x33dc06);_0x288758(_0x33dc06);});});}function respondWithStatusCode(_0x29c470,_0x220d5d){_0x220d5d=_0x220d5d||0xcc;return function(_0x3e7c22){if(_0x3e7c22){return _0x29c470[_0xb55d('0x28')](_0x220d5d);}return _0x29c470[_0xb55d('0x29')](_0x220d5d)[_0xb55d('0x2a')]();};}function respondWithResult(_0x55502a,_0x2bdf34){_0x2bdf34=_0x2bdf34||0xc8;return function(_0x39386a){if(_0x39386a){return _0x55502a[_0xb55d('0x29')](_0x2bdf34)[_0xb55d('0x2b')](_0x39386a);}};}function respondWithFilteredResult(_0xcc1e6a,_0x318e33){return function(_0x38a341){if(_0x38a341){var _0x14bfbc=typeof _0x318e33['offset']===_0xb55d('0x2c')&&typeof _0x318e33[_0xb55d('0x2d')]===_0xb55d('0x2c');var _0x53a686=_0x38a341[_0xb55d('0x2e')];var _0x5d0ec8=_0x14bfbc?0x0:_0x318e33[_0xb55d('0x2f')];var _0x5024d7=_0x14bfbc?_0x38a341[_0xb55d('0x2e')]:_0x318e33[_0xb55d('0x2f')]+_0x318e33['limit'];var _0x1fa56b;if(_0x5024d7>=_0x53a686){_0x5024d7=_0x53a686;_0x1fa56b=0xc8;}else{_0x1fa56b=0xce;}_0xcc1e6a[_0xb55d('0x29')](_0x1fa56b);return _0xcc1e6a[_0xb55d('0x30')](_0xb55d('0x31'),_0x5d0ec8+'-'+_0x5024d7+'/'+_0x53a686)['json'](_0x38a341);}return null;};}function patchUpdates(_0x6477e5){return function(_0x36eb53){try{jsonpatch[_0xb55d('0x32')](_0x36eb53,_0x6477e5,!![]);}catch(_0x58a329){return BPromise['reject'](_0x58a329);}return _0x36eb53[_0xb55d('0x33')]();};}function saveUpdates(_0x2f423d,_0x177ef0){return function(_0x5aa145){if(_0x5aa145){return _0x5aa145[_0xb55d('0x34')](_0x2f423d)[_0xb55d('0x1e')](function(_0x3e3bc4){return _0x3e3bc4;});}return null;};}function removeEntity(_0x33d77b,_0x23b789){return function(_0x26ad5b){if(_0x26ad5b){return _0x26ad5b[_0xb55d('0x35')]()['then'](function(){_0x33d77b['status'](0xcc)[_0xb55d('0x2a')]();});}};}function handleEntityNotFound(_0x4bf60a,_0x5b66fa){return function(_0x9c43e7){if(!_0x9c43e7){_0x4bf60a[_0xb55d('0x28')](0x194);}return _0x9c43e7;};}function handleError(_0x2990a0,_0x1056da){_0x1056da=_0x1056da||0x1f4;return function(_0x408841){logger['error'](_0x408841[_0xb55d('0x36')]);if(_0x408841[_0xb55d('0x37')]){delete _0x408841[_0xb55d('0x37')];}_0x2990a0[_0xb55d('0x29')](_0x1056da)[_0xb55d('0x38')](_0x408841);};}exports[_0xb55d('0x39')]=function(_0x55baa2,_0x3fd641){var _0x4fdfce={},_0x1c9176={},_0x1749d1={'count':0x0,'rows':[]};var _0x2f5131=_[_0xb55d('0x3a')](db['Setting'][_0xb55d('0x3b')],function(_0x35650e){return{'name':_0x35650e[_0xb55d('0x3c')],'type':_0x35650e[_0xb55d('0x3d')]['key']};});_0x1c9176[_0xb55d('0x3e')]=_[_0xb55d('0x3a')](_0x2f5131,_0xb55d('0x37'));_0x1c9176['query']=_[_0xb55d('0x3f')](_0x55baa2['query']);_0x1c9176[_0xb55d('0x40')]=_[_0xb55d('0x41')](_0x1c9176[_0xb55d('0x3e')],_0x1c9176[_0xb55d('0x42')]);_0x4fdfce['attributes']=_[_0xb55d('0x41')](_0x1c9176[_0xb55d('0x3e')],qs[_0xb55d('0x43')](_0x55baa2[_0xb55d('0x42')][_0xb55d('0x43')]));_0x4fdfce['attributes']=_0x4fdfce['attributes']['length']?_0x4fdfce[_0xb55d('0x44')]:_0x1c9176[_0xb55d('0x3e')];if(!_0x55baa2[_0xb55d('0x42')]['hasOwnProperty'](_0xb55d('0x45'))){_0x4fdfce['limit']=qs[_0xb55d('0x2d')](_0x55baa2[_0xb55d('0x42')]['limit']);_0x4fdfce[_0xb55d('0x2f')]=qs[_0xb55d('0x2f')](_0x55baa2[_0xb55d('0x42')]['offset']);}_0x4fdfce['order']=qs['sort'](_0x55baa2[_0xb55d('0x42')]['sort']);_0x4fdfce[_0xb55d('0x46')]=qs['filters'](_[_0xb55d('0x47')](_0x55baa2[_0xb55d('0x42')],_0x1c9176[_0xb55d('0x40')]),_0x2f5131);if(_0x55baa2[_0xb55d('0x42')]['filter']){_0x4fdfce['where']=_[_0xb55d('0x48')](_0x4fdfce[_0xb55d('0x46')],{'$or':_[_0xb55d('0x3a')](_0x2f5131,function(_0x312b64){if(_0x312b64[_0xb55d('0x3d')]!=='VIRTUAL'){var _0x5cae03={};_0x5cae03[_0x312b64[_0xb55d('0x37')]]={'$like':'%'+_0x55baa2[_0xb55d('0x42')][_0xb55d('0x49')]+'%'};return _0x5cae03;}})});}_0x4fdfce=_['merge']({},_0x4fdfce,_0x55baa2['options']);var _0x478d5d={'where':_0x4fdfce[_0xb55d('0x46')]};return db[_0xb55d('0x4a')][_0xb55d('0x2e')](_0x478d5d)['then'](function(_0x5b8e0a){_0x1749d1[_0xb55d('0x2e')]=_0x5b8e0a;if(_0x55baa2[_0xb55d('0x42')]['includeAll']){_0x4fdfce[_0xb55d('0x4b')]=[{'all':!![]}];}return db[_0xb55d('0x4a')][_0xb55d('0x4c')](_0x4fdfce);})[_0xb55d('0x1e')](function(_0xa90807){_0x1749d1[_0xb55d('0x4d')]=_0xa90807;return _0x1749d1;})['then'](respondWithFilteredResult(_0x3fd641,_0x4fdfce))[_0xb55d('0x27')](handleError(_0x3fd641,null));};exports[_0xb55d('0x4e')]=function(_0x20c7c7,_0x1dc5ab){var _0x2e2c44={'raw':![],'where':{'id':_0x20c7c7[_0xb55d('0x4f')]['id']}},_0x39ff27={};_0x39ff27['model']=_[_0xb55d('0x3f')](db[_0xb55d('0x4a')]['rawAttributes']);_0x39ff27[_0xb55d('0x42')]=_[_0xb55d('0x3f')](_0x20c7c7['query']);_0x39ff27[_0xb55d('0x40')]=_[_0xb55d('0x41')](_0x39ff27[_0xb55d('0x3e')],_0x39ff27['query']);_0x2e2c44['attributes']=_['intersection'](_0x39ff27['model'],qs[_0xb55d('0x43')](_0x20c7c7['query'][_0xb55d('0x43')]));_0x2e2c44[_0xb55d('0x44')]=_0x2e2c44[_0xb55d('0x44')][_0xb55d('0x50')]?_0x2e2c44[_0xb55d('0x44')]:_0x39ff27[_0xb55d('0x3e')];if(_0x20c7c7[_0xb55d('0x42')][_0xb55d('0x51')]){_0x2e2c44['include']=[{'all':!![]}];}_0x2e2c44=_[_0xb55d('0x48')]({},_0x2e2c44,_0x20c7c7[_0xb55d('0x52')]);return db[_0xb55d('0x4a')][_0xb55d('0x53')](_0x2e2c44)[_0xb55d('0x1e')](handleEntityNotFound(_0x1dc5ab,null))[_0xb55d('0x1e')](respondWithResult(_0x1dc5ab,null))[_0xb55d('0x27')](handleError(_0x1dc5ab,null));};exports['update']=function(_0x6abe98,_0x3aa406){if(_0x6abe98[_0xb55d('0x54')]['id']){delete _0x6abe98[_0xb55d('0x54')]['id'];}return db[_0xb55d('0x4a')][_0xb55d('0x53')]({'where':{'id':_0x6abe98['params']['id']}})[_0xb55d('0x1e')](handleEntityNotFound(_0x3aa406,null))[_0xb55d('0x1e')](saveUpdates(_0x6abe98['body'],null))['then'](respondWithResult(_0x3aa406,null))[_0xb55d('0x27')](handleError(_0x3aa406,null));};exports[_0xb55d('0x55')]=function(_0x4fbb07,_0x58543e,_0x32bc9c){if(_0x4fbb07['file']&&_0x4fbb07[_0xb55d('0x56')][_0xb55d('0x57')]){_0x4fbb07['body']['logo']=_0x4fbb07[_0xb55d('0x56')][_0xb55d('0x57')];}return db['Setting'][_0xb55d('0x53')]({'where':{'id':_0x4fbb07['params']['id']}})['then'](handleEntityNotFound(_0x58543e,null))[_0xb55d('0x1e')](saveUpdates(_0x4fbb07[_0xb55d('0x54')],null))[_0xb55d('0x1e')](respondWithResult(_0x58543e,null))['catch'](handleError(_0x58543e,null));};exports['addLogoLogin']=function(_0x1685b7,_0x4683d4,_0x50b821){if(_0x1685b7[_0xb55d('0x56')]&&_0x1685b7[_0xb55d('0x56')][_0xb55d('0x57')]){_0x1685b7['body']['loginLogo']=_0x1685b7['file']['filename'];}return db[_0xb55d('0x4a')][_0xb55d('0x53')]({'where':{'id':_0x1685b7[_0xb55d('0x4f')]['id']}})[_0xb55d('0x1e')](handleEntityNotFound(_0x4683d4,null))[_0xb55d('0x1e')](saveUpdates(_0x1685b7[_0xb55d('0x54')],null))['then'](respondWithResult(_0x4683d4,null))[_0xb55d('0x27')](handleError(_0x4683d4,null));};var utilLicense=require(_0xb55d('0x19'));exports[_0xb55d('0x58')]=function(_0xfda0ab,_0xcf54d9,_0x265bcb){var _0x37e443='server/files/images/logos';var _0x1159a4={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x5e1087){if(_0x5e1087){_0x1159a4=_0x5e1087;}return db[_0xb55d('0x4a')][_0xb55d('0x53')]({'where':{'id':_0xfda0ab[_0xb55d('0x4f')]['id']},'attributes':[_0xb55d('0x59'),_0xb55d('0x5a'),_0xb55d('0x5b'),_0xb55d('0x5c'),_0xb55d('0x5d'),_0xb55d('0x5e'),_0xb55d('0x5f'),'defaultFavicon'],'raw':!![]});})[_0xb55d('0x1e')](handleEntityNotFound(_0xcf54d9,null))[_0xb55d('0x1e')](function(_0xa1baac){if(_0xa1baac){var _0x3e61af=_0xa1baac['logo']&&fs[_0xb55d('0x60')](path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x37e443,_['toLower'](_0xa1baac[_0xb55d('0x59')])))?path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x37e443,_[_0xb55d('0x63')](_0xa1baac['logo'])):path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x37e443,_[_0xb55d('0x63')]('default_logo.svg'));var _0x333707=_0xb55d('0x64')+_[_0xb55d('0x65')]('logo');if(_0xa1baac[_0x333707]||!_0x1159a4['custom']){_0x3e61af=path['join'](config[_0xb55d('0x62')],_0x37e443,_['toLower'](_0xb55d('0x66')));}if(!fs[_0xb55d('0x60')](_0x3e61af)){throw new db[(_0xb55d('0x67'))][(_0xb55d('0x68'))](_[_0xb55d('0x65')]('logo')+_0xb55d('0x69'));}return _0xcf54d9[_0xb55d('0x6a')](_0x3e61af);}})[_0xb55d('0x27')](handleError(_0xcf54d9,null));};var utilLicense=require(_0xb55d('0x19'));exports['getLogoLogin']=function(_0x5ef98f,_0x9b639d,_0x9a3f8f){var _0x47a558='server/files/images/logos';var _0x4f28e3={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x143655){if(_0x143655){_0x4f28e3=_0x143655;}return db[_0xb55d('0x4a')][_0xb55d('0x53')]({'where':{'id':_0x5ef98f['params']['id']},'attributes':['logo',_0xb55d('0x5a'),_0xb55d('0x5b'),_0xb55d('0x5c'),_0xb55d('0x5d'),_0xb55d('0x5e'),_0xb55d('0x5f'),_0xb55d('0x6b')],'raw':!![]});})['then'](handleEntityNotFound(_0x9b639d,null))[_0xb55d('0x1e')](function(_0x17c858){if(_0x17c858){var _0x10b1b5=_0x17c858[_0xb55d('0x5a')]&&fs[_0xb55d('0x60')](path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x47a558,_[_0xb55d('0x63')](_0x17c858['loginLogo'])))?path['join'](config[_0xb55d('0x62')],_0x47a558,_[_0xb55d('0x63')](_0x17c858[_0xb55d('0x5a')])):path['join'](config[_0xb55d('0x62')],_0x47a558,_['toLower']('default_loginLogo.svg'));var _0x9493d=_0xb55d('0x64')+_[_0xb55d('0x65')]('loginLogo');if(_0x17c858[_0x9493d]||!_0x4f28e3['custom']){_0x10b1b5=path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x47a558,_['toLower'](_0xb55d('0x6c')));}if(!fs[_0xb55d('0x60')](_0x10b1b5)){throw new db[(_0xb55d('0x67'))][(_0xb55d('0x68'))](_[_0xb55d('0x65')]('loginLogo')+_0xb55d('0x69'));}return _0x9b639d[_0xb55d('0x6a')](_0x10b1b5);}})[_0xb55d('0x27')](handleError(_0x9b639d,null));};exports[_0xb55d('0x6d')]=function(_0x49d113,_0x3f5ff2){return db['Setting']['find']({'where':{'id':_0x49d113[_0xb55d('0x4f')]['id']},'attributes':['securePassword']})[_0xb55d('0x1e')](respondWithResult(_0x3f5ff2,null))[_0xb55d('0x27')](handleError(_0x3f5ff2,null));};exports[_0xb55d('0x6e')]=function(_0x47b559,_0x5a59c2,_0x1f4994){if(_0x47b559['file']&&_0x47b559[_0xb55d('0x56')][_0xb55d('0x57')]){_0x47b559[_0xb55d('0x54')][_0xb55d('0x5b')]=_0x47b559[_0xb55d('0x56')][_0xb55d('0x57')];}return db[_0xb55d('0x4a')][_0xb55d('0x53')]({'where':{'id':_0x47b559[_0xb55d('0x4f')]['id']}})[_0xb55d('0x1e')](handleEntityNotFound(_0x5a59c2,null))['then'](saveUpdates(_0x47b559[_0xb55d('0x54')],null))[_0xb55d('0x1e')](respondWithResult(_0x5a59c2,null))[_0xb55d('0x27')](handleError(_0x5a59c2,null));};var utilLicense=require(_0xb55d('0x19'));exports['getPreferred']=function(_0x2344ef,_0x56623c,_0x260c0f){var _0x5b9d80=_0xb55d('0x6f');var _0x4508f3={'custom':![]};return utilLicense[_0xb55d('0x70')]()[_0xb55d('0x1e')](function(_0x1dc6fd){if(_0x1dc6fd){_0x4508f3=_0x1dc6fd;}return db[_0xb55d('0x4a')]['find']({'where':{'id':_0x2344ef['params']['id']},'attributes':[_0xb55d('0x59'),_0xb55d('0x5a'),'preferred',_0xb55d('0x5c'),'defaultLogo',_0xb55d('0x5e'),_0xb55d('0x5f'),_0xb55d('0x6b')],'raw':!![]});})['then'](handleEntityNotFound(_0x56623c,null))['then'](function(_0x44c7ff){if(_0x44c7ff){var _0x193472=_0x44c7ff[_0xb55d('0x5b')]&&fs[_0xb55d('0x60')](path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x5b9d80,_[_0xb55d('0x63')](_0x44c7ff[_0xb55d('0x5b')])))?path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x5b9d80,_['toLower'](_0x44c7ff[_0xb55d('0x5b')])):path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x5b9d80,_[_0xb55d('0x63')](_0xb55d('0x71')));var _0x28820e='default'+_[_0xb55d('0x65')]('preferred');if(_0x44c7ff[_0x28820e]||!_0x4508f3[_0xb55d('0x72')]||!_0x4508f3['preferred']){_0x193472=path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x5b9d80,_['toLower'](_0xb55d('0x71')));}if(!fs[_0xb55d('0x60')](_0x193472)){throw new db[(_0xb55d('0x67'))][(_0xb55d('0x68'))](_['upperFirst'](_0xb55d('0x5b'))+'\x20not\x20found');}return _0x56623c['download'](_0x193472);}})[_0xb55d('0x27')](handleError(_0x56623c,null));};exports[_0xb55d('0x73')]=function(_0x9a9f31,_0x587384,_0x16d05e){if(_0x9a9f31[_0xb55d('0x56')]&&_0x9a9f31['file'][_0xb55d('0x57')]){_0x9a9f31[_0xb55d('0x54')][_0xb55d('0x5c')]=_0x9a9f31[_0xb55d('0x56')][_0xb55d('0x57')];}return db[_0xb55d('0x4a')]['find']({'where':{'id':_0x9a9f31[_0xb55d('0x4f')]['id']}})[_0xb55d('0x1e')](handleEntityNotFound(_0x587384,null))[_0xb55d('0x1e')](saveUpdates(_0x9a9f31[_0xb55d('0x54')],null))[_0xb55d('0x1e')](respondWithResult(_0x587384,null))[_0xb55d('0x27')](handleError(_0x587384,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x3c506f,_0x37b0e3,_0x8459d1){var _0x429cc2=_0xb55d('0x6f');var _0xc3e9cf={'custom':![]};return utilLicense['getLicense']()[_0xb55d('0x1e')](function(_0x57d84d){if(_0x57d84d){_0xc3e9cf=_0x57d84d;}return db['Setting'][_0xb55d('0x53')]({'where':{'id':_0x3c506f[_0xb55d('0x4f')]['id']},'attributes':[_0xb55d('0x59'),_0xb55d('0x5a'),_0xb55d('0x5b'),_0xb55d('0x5c'),_0xb55d('0x5d'),_0xb55d('0x5e'),'defaultPreferred',_0xb55d('0x6b')],'raw':!![]});})['then'](handleEntityNotFound(_0x37b0e3,null))['then'](function(_0xaa071a){if(_0xaa071a){var _0x25795d=_0xaa071a[_0xb55d('0x5c')]&&fs['existsSync'](path[_0xb55d('0x61')](config['root'],_0x429cc2,_[_0xb55d('0x63')](_0xaa071a['favicon'])))?path['join'](config[_0xb55d('0x62')],_0x429cc2,_[_0xb55d('0x63')](_0xaa071a[_0xb55d('0x5c')])):path[_0xb55d('0x61')](config[_0xb55d('0x62')],_0x429cc2,_['toLower'](_0xb55d('0x74')));var _0xc63daa=_0xb55d('0x64')+_['upperFirst']('favicon');if(_0xaa071a[_0xc63daa]||!_0xc3e9cf[_0xb55d('0x72')]){_0x25795d=path['join'](config[_0xb55d('0x62')],_0x429cc2,_[_0xb55d('0x63')](_0xb55d('0x74')));}if(!fs[_0xb55d('0x60')](_0x25795d)){throw new db[(_0xb55d('0x67'))]['ValidationError'](_[_0xb55d('0x65')](_0xb55d('0x5c'))+_0xb55d('0x69'));}return _0x37b0e3['download'](_0x25795d);}})[_0xb55d('0x27')](handleError(_0x37b0e3,null));};exports[_0xb55d('0x75')]=function(_0x473f39,_0x1ee2e4){var _0x12dbb6={'offset':moment()[_0xb55d('0x76')]()};_0x12dbb6[_0xb55d('0x77')]=moment()[_0xb55d('0x76')](_0x12dbb6[_0xb55d('0x2f')])[_0xb55d('0x78')](_0xb55d('0x79'));return _0x1ee2e4[_0xb55d('0x29')](0xc8)[_0xb55d('0x38')](_0x12dbb6);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d3aa10f..d18556b 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x69752e,_0x2579f6){var _0x506a36=function(_0x1793bc){while(--_0x1793bc){_0x69752e['push'](_0x69752e['shift']());}};_0x506a36(++_0x2579f6);}(_0x3e74,0x175));var _0x43e7=function(_0x493152,_0x14f99a){_0x493152=_0x493152-0x0;var _0x5a8e5a=_0x3e74[_0x493152];return _0x5a8e5a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x371e98,_0x2e46a7){var _0x17fbbd=function(_0x258976){while(--_0x258976){_0x371e98['push'](_0x371e98['shift']());}};_0x17fbbd(++_0x2e46a7);}(_0xedd9,0xfc));var _0x9edd=function(_0x36621a,_0x5642a3){_0x36621a=_0x36621a-0x0;var _0x247a1f=_0xedd9[_0x36621a];return _0x247a1f;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 4af459a..8f8d83e 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 _0x3e56=['../../config/utils','rpc','../../config/environment','request','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','Setting,\x20%s,\x20%s','message','result','ShowSetting','Setting','options','raw','attributes','include','model','map','then','debug','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3d6baa,_0x92ddd7){var _0x32b8d1=function(_0x1a77d6){while(--_0x1a77d6){_0x3d6baa['push'](_0x3d6baa['shift']());}};_0x32b8d1(++_0x92ddd7);}(_0x3e56,0x1a0));var _0x63e5=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x3e56[_0x5cc8b9];return _0x58892e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x63e5('0x0'));var BPromise=require(_0x63e5('0x1'));var rs=require(_0x63e5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63e5('0x3'))['db'];var utils=require(_0x63e5('0x4'));var logger=require('../../config/logger')(_0x63e5('0x5'));var config=require(_0x63e5('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x514e32,_0x41f74d,_0x1e4eed){return new BPromise(function(_0x2b9a8c,_0xd186f7){return client[_0x63e5('0x7')](_0x514e32,_0x1e4eed)['then'](function(_0x377415){logger[_0x63e5('0x8')]('Setting,\x20%s,\x20%s',_0x41f74d,_0x63e5('0x9'));logger['debug'](_0x63e5('0xa'),_0x41f74d,_0x63e5('0x9'),JSON[_0x63e5('0xb')](_0x377415));if(_0x377415['error']){if(_0x377415['error'][_0x63e5('0xc')]===0x1f4){logger[_0x63e5('0xd')](_0x63e5('0xe'),_0x41f74d,_0x377415['error']['message']);return _0xd186f7(_0x377415[_0x63e5('0xd')][_0x63e5('0xf')]);}logger[_0x63e5('0xd')](_0x63e5('0xe'),_0x41f74d,_0x377415['error'][_0x63e5('0xf')]);return _0x2b9a8c(_0x377415['error'][_0x63e5('0xf')]);}else{logger[_0x63e5('0x8')]('Setting,\x20%s,\x20%s',_0x41f74d,_0x63e5('0x9'));_0x2b9a8c(_0x377415[_0x63e5('0x10')][_0x63e5('0xf')]);}})['catch'](function(_0x4b2a4c){logger[_0x63e5('0xd')](_0x63e5('0xe'),_0x41f74d,_0x4b2a4c);_0xd186f7(_0x4b2a4c);});});}exports[_0x63e5('0x11')]=function(_0x34158f){var _0x2d8d16=this;return new Promise(function(_0x3556d3,_0x568d4c){return db[_0x63e5('0x12')]['find']({'raw':_0x34158f[_0x63e5('0x13')]?_0x34158f['options'][_0x63e5('0x14')]===undefined?!![]:![]:!![],'where':_0x34158f[_0x63e5('0x13')]?_0x34158f[_0x63e5('0x13')]['where']||null:null,'attributes':_0x34158f[_0x63e5('0x13')]?_0x34158f[_0x63e5('0x13')][_0x63e5('0x15')]||null:null,'include':_0x34158f[_0x63e5('0x13')]?_0x34158f[_0x63e5('0x13')][_0x63e5('0x16')]?_['map'](_0x34158f[_0x63e5('0x13')][_0x63e5('0x16')],function(_0x1ab95f){return{'model':db[_0x1ab95f[_0x63e5('0x17')]],'as':_0x1ab95f['as'],'attributes':_0x1ab95f[_0x63e5('0x15')],'include':_0x1ab95f['include']?_[_0x63e5('0x18')](_0x1ab95f['include'],function(_0x564a85){return{'model':db[_0x564a85[_0x63e5('0x17')]],'as':_0x564a85['as'],'attributes':_0x564a85[_0x63e5('0x15')],'include':_0x564a85['include']?_['map'](_0x564a85[_0x63e5('0x16')],function(_0x596fc6){return{'model':db[_0x596fc6['model']],'as':_0x596fc6['as'],'attributes':_0x596fc6[_0x63e5('0x15')]};}):[]};}):[]};}):[]:[]})[_0x63e5('0x19')](function(_0xaf9128){logger[_0x63e5('0x8')](_0x63e5('0x11'),_0x34158f);logger[_0x63e5('0x1a')](_0x63e5('0x11'),_0x34158f,JSON['stringify'](_0xaf9128));_0x3556d3(_0xaf9128);})[_0x63e5('0x1b')](function(_0x58369f){logger[_0x63e5('0xd')](_0x63e5('0x11'),_0x58369f['message'],_0x34158f);_0x568d4c(_0x2d8d16['error'](0x1f4,_0x58369f[_0x63e5('0xf')]));});});}; \ No newline at end of file +var _0x4aa8=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','Setting','options','include','map','attributes','model','ShowSetting'];(function(_0x49ac91,_0x2078b2){var _0x9b4f87=function(_0x23c0a5){while(--_0x23c0a5){_0x49ac91['push'](_0x49ac91['shift']());}};_0x9b4f87(++_0x2078b2);}(_0x4aa8,0x152));var _0x84aa=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4aa8[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x84aa('0x0'));var moment=require(_0x84aa('0x1'));var BPromise=require(_0x84aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x84aa('0x3'));var logger=require(_0x84aa('0x4'))(_0x84aa('0x5'));var config=require(_0x84aa('0x6'));var jayson=require(_0x84aa('0x7'));var client=jayson['client'][_0x84aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3698f1,_0x5b80a3,_0x537956){return new BPromise(function(_0x2bb76e,_0x409961){return client[_0x84aa('0x9')](_0x3698f1,_0x537956)[_0x84aa('0xa')](function(_0x1af35b){logger[_0x84aa('0xb')](_0x84aa('0xc'),_0x5b80a3,_0x84aa('0xd'));logger[_0x84aa('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x5b80a3,'request\x20sent',JSON[_0x84aa('0xf')](_0x1af35b));if(_0x1af35b[_0x84aa('0x10')]){if(_0x1af35b['error'][_0x84aa('0x11')]===0x1f4){logger[_0x84aa('0x10')](_0x84aa('0xc'),_0x5b80a3,_0x1af35b[_0x84aa('0x10')][_0x84aa('0x12')]);return _0x409961(_0x1af35b[_0x84aa('0x10')]['message']);}logger[_0x84aa('0x10')](_0x84aa('0xc'),_0x5b80a3,_0x1af35b[_0x84aa('0x10')][_0x84aa('0x12')]);return _0x2bb76e(_0x1af35b[_0x84aa('0x10')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x5b80a3,_0x84aa('0xd'));_0x2bb76e(_0x1af35b['result'][_0x84aa('0x12')]);}})['catch'](function(_0x3e2ebc){logger[_0x84aa('0x10')](_0x84aa('0xc'),_0x5b80a3,_0x3e2ebc);_0x409961(_0x3e2ebc);});});}exports['ShowSetting']=function(_0x1db0af){var _0x28fd79=this;return new Promise(function(_0xda1022,_0x5b5f4f){return db[_0x84aa('0x13')]['find']({'raw':_0x1db0af['options']?_0x1db0af['options']['raw']===undefined?!![]:![]:!![],'where':_0x1db0af[_0x84aa('0x14')]?_0x1db0af[_0x84aa('0x14')]['where']||null:null,'attributes':_0x1db0af[_0x84aa('0x14')]?_0x1db0af[_0x84aa('0x14')]['attributes']||null:null,'include':_0x1db0af[_0x84aa('0x14')]?_0x1db0af['options'][_0x84aa('0x15')]?_[_0x84aa('0x16')](_0x1db0af[_0x84aa('0x14')]['include'],function(_0x392d6b){return{'model':db[_0x392d6b['model']],'as':_0x392d6b['as'],'attributes':_0x392d6b[_0x84aa('0x17')],'include':_0x392d6b['include']?_[_0x84aa('0x16')](_0x392d6b[_0x84aa('0x15')],function(_0x4b6923){return{'model':db[_0x4b6923[_0x84aa('0x18')]],'as':_0x4b6923['as'],'attributes':_0x4b6923[_0x84aa('0x17')],'include':_0x4b6923[_0x84aa('0x15')]?_[_0x84aa('0x16')](_0x4b6923[_0x84aa('0x15')],function(_0x33f003){return{'model':db[_0x33f003[_0x84aa('0x18')]],'as':_0x33f003['as'],'attributes':_0x33f003[_0x84aa('0x17')]};}):[]};}):[]};}):[]:[]})[_0x84aa('0xa')](function(_0x22ed68){logger[_0x84aa('0xb')](_0x84aa('0x19'),_0x1db0af);logger[_0x84aa('0xe')](_0x84aa('0x19'),_0x1db0af,JSON[_0x84aa('0xf')](_0x22ed68));_0xda1022(_0x22ed68);})['catch'](function(_0xc33720){logger[_0x84aa('0x10')](_0x84aa('0x19'),_0xc33720[_0x84aa('0x12')],_0x1db0af);_0x5b5f4f(_0x28fd79['error'](0x1f4,_0xc33720[_0x84aa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 861d2f4..9f14959 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 _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x2ae22a,_0x4fe753){var _0x286a82=function(_0x256e58){while(--_0x256e58){_0x2ae22a['push'](_0x2ae22a['shift']());}};_0x286a82(++_0x4fe753);}(_0x814b,0x1a2));var _0xb814=function(_0x554047,_0x46ec41){_0x554047=_0x554047-0x0;var _0x5d11e4=_0x814b[_0x554047];return _0x5d11e4;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x59bd2d,_0x307929){var _0x572487=function(_0x217fec){while(--_0x217fec){_0x59bd2d['push'](_0x59bd2d['shift']());}};_0x572487(++_0x307929);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 520c84d..16504b1 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 _0x3749=['twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM'];(function(_0x13f632,_0x86a8aa){var _0x400e9f=function(_0x53d6d3){while(--_0x53d6d3){_0x13f632['push'](_0x13f632['shift']());}};_0x400e9f(++_0x86a8aa);}(_0x3749,0x68));var _0x9374=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x3749[_0x1bc0ae];return _0x501104;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9374('0x0'));module[_0x9374('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9374('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x9374('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x9374('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9374('0x3')],'defaultValue':function(){return rs[_0x9374('0x4')]();}},'phone':{'type':Sequelize[_0x9374('0x3')]},'type':{'type':Sequelize[_0x9374('0x5')](_0x9374('0x6'),_0x9374('0x7'),_0x9374('0x8'),_0x9374('0x9'),_0x9374('0xa'),'clickatell',_0x9374('0xb'),_0x9374('0xc'),_0x9374('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0x9374('0x3')]},'authId':{'type':Sequelize[_0x9374('0x3')]},'authToken':{'type':Sequelize[_0x9374('0x3')]},'smsMethod':{'type':Sequelize[_0x9374('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9374('0x3')]},'apiKey':{'type':Sequelize[_0x9374('0x3')]},'applicationId':{'type':Sequelize[_0x9374('0x3')]},'accountId':{'type':Sequelize[_0x9374('0x3')]},'senderString':{'type':Sequelize[_0x9374('0x3')]},'deliveryReport':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9374('0xf')],'defaultValue':function(){return _0x9374('0x10');}},'notificationSound':{'type':Sequelize[_0x9374('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9374('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9374('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9374('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9374('0x11')],'comment':_0x9374('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x9374('0xe')],'defaultValue':![],'comment':_0x9374('0x13'),'set':function(_0x5a712e){if(!_0x5a712e)this['setDataValue'](_0x9374('0x14'),null);this['setDataValue'](_0x9374('0x15'),_0x5a712e);}}}; \ No newline at end of file +var _0x0518=['skebby','connectel','plivo','clickatell','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0518,0x101));var _0x8051=function(_0x1c182e,_0x52daa2){_0x1c182e=_0x1c182e-0x0;var _0x3338d2=_0x0518[_0x1c182e];return _0x3338d2;};'use strict';var Sequelize=require(_0x8051('0x0'));var rs=require(_0x8051('0x1'));module[_0x8051('0x2')]={'name':{'type':Sequelize[_0x8051('0x3')],'unique':_0x8051('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x8051('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x8051('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8051('0x5')]();}},'phone':{'type':Sequelize[_0x8051('0x3')]},'type':{'type':Sequelize[_0x8051('0x6')]('twilio',_0x8051('0x7'),_0x8051('0x8'),'clicksend',_0x8051('0x9'),_0x8051('0xa'),'bandwidth','csc',_0x8051('0xb'),_0x8051('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x8051('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x8051('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x8051('0x3')]},'password':{'type':Sequelize[_0x8051('0x3')]},'apiKey':{'type':Sequelize[_0x8051('0x3')]},'applicationId':{'type':Sequelize[_0x8051('0x3')]},'accountId':{'type':Sequelize[_0x8051('0x3')]},'senderString':{'type':Sequelize[_0x8051('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x8051('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8051('0xd')],'defaultValue':function(){return _0x8051('0xe');}},'notificationSound':{'type':Sequelize[_0x8051('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8051('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8051('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8051('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8051('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x8051('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x8051('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x8051('0xf')],'defaultValue':![],'comment':_0x8051('0x12'),'set':function(_0x3d1ee4){if(!_0x3d1ee4)this[_0x8051('0x13')](_0x8051('0x14'),null);this[_0x8051('0x13')](_0x8051('0x15'),_0x3d1ee4);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 80fc736..2ae0920 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 _0x597b=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','SmsAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','MessageSid','skebby','sender','text','connectel','message_id','MessageUUID','infobip','messageId','results','csc','originatingAddress','segmentedMessage','fromNumber','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','push','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','to\x20is\x20mandatory','List','out','user','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','requestid','statusInt','clicksend','status_code','DELIVERED','groupName','clickatell','bandwidth','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x449b4e,_0x1ab937){var _0x32e387=function(_0x2b211e){while(--_0x2b211e){_0x449b4e['push'](_0x449b4e['shift']());}};_0x32e387(++_0x1ab937);}(_0x597b,0x1b3));var _0xb597=function(_0x3472d2,_0x3a8160){_0x3472d2=_0x3472d2-0x0;var _0x5d901f=_0x597b[_0x3472d2];return _0x5d901f;};'use strict';var emlformat=require(_0xb597('0x0'));var rimraf=require(_0xb597('0x1'));var zipdir=require(_0xb597('0x2'));var jsonpatch=require(_0xb597('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb597('0x4'));var Mustache=require('mustache');var util=require(_0xb597('0x5'));var path=require(_0xb597('0x6'));var sox=require(_0xb597('0x7'));var csv=require(_0xb597('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb597('0x9'));var _=require(_0xb597('0xa'));var squel=require(_0xb597('0xb'));var crypto=require(_0xb597('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb597('0x8'));var querystring=require(_0xb597('0xd'));var Papa=require('papaparse');var Redis=require(_0xb597('0xe'));var authService=require(_0xb597('0xf'));var qs=require(_0xb597('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb597('0x11'));var logger=require(_0xb597('0x12'))(_0xb597('0x13'));var utils=require(_0xb597('0x14'));var config=require(_0xb597('0x15'));var licenseUtil=require(_0xb597('0x16'));var db=require(_0xb597('0x17'))['db'];config[_0xb597('0x18')]=_[_0xb597('0x19')](config['redis'],{'host':_0xb597('0x1a'),'port':0x18eb});var socket=require(_0xb597('0x1b'))(new Redis(config['redis']));require(_0xb597('0x1c'))[_0xb597('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb597('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x21b2a2,_0x4d7352,_0x3eb8ac,_0x5d7ce3){return new BPromise(function(_0x4e3713,_0x280067){var _0x23eb88=_0x5d7ce3||client;return _0x23eb88[_0xb597('0x1f')](_0x21b2a2,_0x3eb8ac)['then'](function(_0x3c7f11){logger[_0xb597('0x20')](_0xb597('0x21'),_0x4d7352,_0xb597('0x22'));logger[_0xb597('0x23')](_0xb597('0x24'),_0x4d7352,_0xb597('0x22'),JSON['stringify'](_0x3c7f11));if(_0x3c7f11[_0xb597('0x25')]){if(_0x3c7f11[_0xb597('0x25')][_0xb597('0x26')]===0x1f4){logger['error'](_0xb597('0x21'),_0x4d7352,_0x3c7f11[_0xb597('0x25')][_0xb597('0x27')]);return _0x280067(_0x3c7f11[_0xb597('0x25')][_0xb597('0x27')]);}logger[_0xb597('0x25')]('SmsAccount,\x20%s,\x20%s',_0x4d7352,_0x3c7f11[_0xb597('0x25')][_0xb597('0x27')]);return _0x4e3713(_0x3c7f11[_0xb597('0x25')][_0xb597('0x27')]);}else{logger[_0xb597('0x20')](_0xb597('0x21'),_0x4d7352,_0xb597('0x22'));_0x4e3713(_0x3c7f11[_0xb597('0x28')]['message']);}})['catch'](function(_0x51b35){logger[_0xb597('0x25')]('SmsAccount,\x20%s,\x20%s',_0x4d7352,_0x51b35);_0x280067(_0x51b35);});});}function respondWithStatusCode(_0xec5882,_0x44fed1){_0x44fed1=_0x44fed1||0xcc;return function(_0x5ea296){if(_0x5ea296){return _0xec5882[_0xb597('0x29')](_0x44fed1);}return _0xec5882[_0xb597('0x2a')](_0x44fed1)[_0xb597('0x2b')]();};}function respondWithResult(_0xa3f95a,_0x45e3b4){_0x45e3b4=_0x45e3b4||0xc8;return function(_0x3389d7){if(_0x3389d7){return _0xa3f95a['status'](_0x45e3b4)[_0xb597('0x2c')](_0x3389d7);}};}function respondWithFilteredResult(_0x23b5ca,_0x329274){return function(_0x1fc87a){if(_0x1fc87a){var _0x432a76=typeof _0x329274[_0xb597('0x2d')]===_0xb597('0x2e')&&typeof _0x329274[_0xb597('0x2f')]===_0xb597('0x2e');var _0x5a722e=_0x1fc87a['count'];var _0x54c876=_0x432a76?0x0:_0x329274[_0xb597('0x2d')];var _0xa7ea22=_0x432a76?_0x1fc87a['count']:_0x329274[_0xb597('0x2d')]+_0x329274[_0xb597('0x2f')];var _0x253a05;if(_0xa7ea22>=_0x5a722e){_0xa7ea22=_0x5a722e;_0x253a05=0xc8;}else{_0x253a05=0xce;}_0x23b5ca[_0xb597('0x2a')](_0x253a05);return _0x23b5ca[_0xb597('0x30')]('Content-Range',_0x54c876+'-'+_0xa7ea22+'/'+_0x5a722e)[_0xb597('0x2c')](_0x1fc87a);}return null;};}function patchUpdates(_0x596681){return function(_0x21f71a){try{jsonpatch[_0xb597('0x31')](_0x21f71a,_0x596681,!![]);}catch(_0x16c131){return BPromise[_0xb597('0x32')](_0x16c131);}return _0x21f71a['save']();};}function saveUpdates(_0xbbd60f,_0x2f2467){return function(_0x29dd6){if(_0x29dd6){return _0x29dd6[_0xb597('0x33')](_0xbbd60f)[_0xb597('0x34')](function(_0x15fd2f){return _0x15fd2f;});}return null;};}function removeEntity(_0x12c704,_0x20a170){return function(_0x5e76a8){if(_0x5e76a8){return _0x5e76a8[_0xb597('0x35')]()['then'](function(){var _0x33584f=_0x5e76a8[_0xb597('0x36')]({'plain':!![]});var _0x5c33f2=_0xb597('0x37');return db[_0xb597('0x38')][_0xb597('0x35')]({'where':{'type':_0x5c33f2,'resourceId':_0x33584f['id']}})[_0xb597('0x34')](function(){return _0x5e76a8;});})['then'](function(){_0x12c704[_0xb597('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e428a,_0x1eae53){return function(_0x3b817a){if(!_0x3b817a){_0x3e428a[_0xb597('0x29')](0x194);}return _0x3b817a;};}function handleError(_0x3b6338,_0x4bb6e1){_0x4bb6e1=_0x4bb6e1||0x1f4;return function(_0x485b68){logger[_0xb597('0x25')](_0x485b68['stack']);if(_0x485b68[_0xb597('0x39')]){delete _0x485b68[_0xb597('0x39')];}_0x3b6338['status'](_0x4bb6e1)[_0xb597('0x3a')](_0x485b68);};}exports[_0xb597('0x3b')]=function(_0x24f9ef,_0x7117e4){var _0x2e8491={'include':[{'model':db['Pause'],'as':_0xb597('0x3c')}]},_0x19c594={},_0x368f8b={'count':0x0,'rows':[]};var _0xbb44af=_[_0xb597('0x3d')](db[_0xb597('0x3e')][_0xb597('0x3f')],function(_0xe59a23){return{'name':_0xe59a23[_0xb597('0x40')],'type':_0xe59a23[_0xb597('0x41')][_0xb597('0x42')]};});_0x19c594['model']=_['map'](_0xbb44af,_0xb597('0x39'));_0x19c594[_0xb597('0x43')]=_[_0xb597('0x44')](_0x24f9ef[_0xb597('0x43')]);_0x19c594[_0xb597('0x45')]=_[_0xb597('0x46')](_0x19c594['model'],_0x19c594['query']);_0x2e8491[_0xb597('0x47')]=_[_0xb597('0x46')](_0x19c594[_0xb597('0x48')],qs[_0xb597('0x49')](_0x24f9ef[_0xb597('0x43')][_0xb597('0x49')]));_0x2e8491[_0xb597('0x47')]=_0x2e8491['attributes'][_0xb597('0x4a')]?_0x2e8491[_0xb597('0x47')]:_0x19c594[_0xb597('0x48')];if(!_0x24f9ef['query'][_0xb597('0x4b')](_0xb597('0x4c'))){_0x2e8491[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x24f9ef[_0xb597('0x43')][_0xb597('0x2f')]);_0x2e8491[_0xb597('0x2d')]=qs['offset'](_0x24f9ef[_0xb597('0x43')][_0xb597('0x2d')]);}_0x2e8491[_0xb597('0x4d')]=qs[_0xb597('0x4e')](_0x24f9ef[_0xb597('0x43')][_0xb597('0x4e')]);_0x2e8491['where']=qs[_0xb597('0x45')](_[_0xb597('0x4f')](_0x24f9ef[_0xb597('0x43')],_0x19c594[_0xb597('0x45')]),_0xbb44af);if(_0x24f9ef[_0xb597('0x43')][_0xb597('0x50')]){_0x2e8491[_0xb597('0x51')]=_[_0xb597('0x52')](_0x2e8491[_0xb597('0x51')],{'$or':_['map'](_0xbb44af,function(_0x94d5af){if(_0x94d5af['type']!==_0xb597('0x53')){var _0x5a10db={};_0x5a10db[_0x94d5af['name']]={'$like':'%'+_0x24f9ef[_0xb597('0x43')][_0xb597('0x50')]+'%'};return _0x5a10db;}})});}_0x2e8491=_[_0xb597('0x52')]({},_0x2e8491,_0x24f9ef[_0xb597('0x54')]);var _0x23bd63={'where':_0x2e8491[_0xb597('0x51')]};return db[_0xb597('0x3e')]['count'](_0x23bd63)['then'](function(_0x1bc170){_0x368f8b[_0xb597('0x55')]=_0x1bc170;if(_0x24f9ef[_0xb597('0x43')][_0xb597('0x56')]){_0x2e8491[_0xb597('0x57')]=[{'all':!![]}];}return db['SmsAccount'][_0xb597('0x58')](_0x2e8491);})[_0xb597('0x34')](function(_0x417a75){_0x368f8b[_0xb597('0x59')]=_0x417a75;return _0x368f8b;})['then'](respondWithFilteredResult(_0x7117e4,_0x2e8491))[_0xb597('0x5a')](handleError(_0x7117e4,null));};exports[_0xb597('0x5b')]=function(_0x1b4710,_0x4d2368){var _0x16185d={'raw':![],'where':{'id':_0x1b4710[_0xb597('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5637b4={};_0x5637b4[_0xb597('0x48')]=_[_0xb597('0x44')](db[_0xb597('0x3e')][_0xb597('0x3f')]);_0x5637b4[_0xb597('0x43')]=_[_0xb597('0x44')](_0x1b4710['query']);_0x5637b4[_0xb597('0x45')]=_[_0xb597('0x46')](_0x5637b4[_0xb597('0x48')],_0x5637b4[_0xb597('0x43')]);_0x16185d['attributes']=_['intersection'](_0x5637b4[_0xb597('0x48')],qs[_0xb597('0x49')](_0x1b4710[_0xb597('0x43')]['fields']));_0x16185d[_0xb597('0x47')]=_0x16185d[_0xb597('0x47')]['length']?_0x16185d[_0xb597('0x47')]:_0x5637b4[_0xb597('0x48')];if(_0x1b4710[_0xb597('0x43')][_0xb597('0x56')]){_0x16185d[_0xb597('0x57')]=[{'all':!![]}];}_0x16185d=_[_0xb597('0x52')]({},_0x16185d,_0x1b4710[_0xb597('0x54')]);return db[_0xb597('0x3e')]['find'](_0x16185d)['then'](handleEntityNotFound(_0x4d2368,null))[_0xb597('0x34')](respondWithResult(_0x4d2368,null))[_0xb597('0x5a')](handleError(_0x4d2368,null));};exports[_0xb597('0x5d')]=function(_0x1153b3,_0xdd9af6){return db[_0xb597('0x3e')]['create'](_0x1153b3['body'],{})[_0xb597('0x34')](function(_0x53f97e){var _0x5c1720=_0x1153b3['user'][_0xb597('0x36')]({'plain':!![]});if(!_0x5c1720)throw new Error(_0xb597('0x5e'));if(_0x5c1720['role']==='user'){var _0x2f4f3f=_0x53f97e[_0xb597('0x36')]({'plain':!![]});var _0x1cbd40=_0xb597('0x37');return db[_0xb597('0x5f')][_0xb597('0x60')]({'where':{'name':_0x1cbd40,'userProfileId':_0x5c1720['userProfileId']},'raw':!![]})['then'](function(_0x3f71b7){if(_0x3f71b7&&_0x3f71b7[_0xb597('0x61')]===0x0){return db[_0xb597('0x38')]['create']({'name':_0x2f4f3f['name'],'resourceId':_0x2f4f3f['id'],'type':_0x3f71b7[_0xb597('0x39')],'sectionId':_0x3f71b7['id']},{})[_0xb597('0x34')](function(){return _0x53f97e;});}else{return _0x53f97e;}})[_0xb597('0x5a')](function(_0x4c9a17){logger[_0xb597('0x25')](_0xb597('0x62'),_0x4c9a17);throw _0x4c9a17;});}return _0x53f97e;})[_0xb597('0x34')](respondWithResult(_0xdd9af6,0xc9))[_0xb597('0x5a')](handleError(_0xdd9af6,null));};exports[_0xb597('0x33')]=function(_0xdbabaf,_0x326d99){if(_0xdbabaf[_0xb597('0x63')]['id']){delete _0xdbabaf['body']['id'];}return db['SmsAccount'][_0xb597('0x60')]({'where':{'id':_0xdbabaf[_0xb597('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xb597('0x34')](handleEntityNotFound(_0x326d99,null))[_0xb597('0x34')](saveUpdates(_0xdbabaf[_0xb597('0x63')],null))[_0xb597('0x34')](respondWithResult(_0x326d99,null))[_0xb597('0x5a')](handleError(_0x326d99,null));};exports[_0xb597('0x35')]=function(_0x585ae9,_0x46f355){return db['SmsAccount'][_0xb597('0x60')]({'where':{'id':_0x585ae9['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x46f355,null))[_0xb597('0x34')](removeEntity(_0x46f355,null))[_0xb597('0x5a')](handleError(_0x46f355,null));};exports[_0xb597('0x64')]=function(_0x223526,_0x9db858){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x9db858,null))[_0xb597('0x5a')](handleError(_0x9db858,null));};exports['addDisposition']=function(_0x52680b,_0x3bccc0,_0x372d26){if(_0x52680b[_0xb597('0x63')]['id']){delete _0x52680b[_0xb597('0x63')]['id'];}return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x52680b['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x3bccc0,null))[_0xb597('0x34')](function(_0x5acf39){if(_0x5acf39){_0x52680b['body'][_0xb597('0x65')]=_0x5acf39['id'];return db[_0xb597('0x66')][_0xb597('0x5d')](_0x52680b[_0xb597('0x63')]);}})['then'](respondWithResult(_0x3bccc0,null))[_0xb597('0x5a')](handleError(_0x3bccc0,null));};exports['getDispositions']=function(_0x37e63d,_0x18a6ae,_0x83fbf5){var _0x52ecf3={'raw':![],'where':{}};var _0x452946={};var _0x6eb7ca={'count':0x0,'rows':[]};return db[_0xb597('0x3e')][_0xb597('0x67')]({'where':{'id':_0x37e63d[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x18a6ae,null))['then'](function(_0x584d7d){if(_0x584d7d){_0x452946[_0xb597('0x48')]=_[_0xb597('0x44')](db[_0xb597('0x66')][_0xb597('0x3f')]);_0x452946[_0xb597('0x43')]=_[_0xb597('0x44')](_0x37e63d[_0xb597('0x43')]);_0x452946[_0xb597('0x45')]=_['intersection'](_0x452946[_0xb597('0x48')],_0x452946[_0xb597('0x43')]);_0x52ecf3['attributes']=_[_0xb597('0x46')](_0x452946[_0xb597('0x48')],qs['fields'](_0x37e63d['query'][_0xb597('0x49')]));_0x52ecf3['attributes']=_0x52ecf3[_0xb597('0x47')]['length']?_0x52ecf3[_0xb597('0x47')]:_0x452946['model'];if(!_0x37e63d[_0xb597('0x43')][_0xb597('0x4b')](_0xb597('0x4c'))){_0x52ecf3[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x37e63d[_0xb597('0x43')][_0xb597('0x2f')]);_0x52ecf3[_0xb597('0x2d')]=qs[_0xb597('0x2d')](_0x37e63d['query'][_0xb597('0x2d')]);}_0x52ecf3[_0xb597('0x4d')]=qs[_0xb597('0x4e')](_0x37e63d[_0xb597('0x43')][_0xb597('0x4e')]);_0x52ecf3[_0xb597('0x51')]=qs['filters'](_[_0xb597('0x4f')](_0x37e63d[_0xb597('0x43')],_0x452946[_0xb597('0x45')]));_0x52ecf3[_0xb597('0x51')][_0xb597('0x65')]=_0x584d7d['id'];if(_0x37e63d[_0xb597('0x43')][_0xb597('0x50')]){_0x52ecf3[_0xb597('0x51')]=_['merge'](_0x52ecf3[_0xb597('0x51')],{'$or':_['map'](_0x52ecf3['attributes'],function(_0xfb7d4c){var _0x33bec4={};_0x33bec4[_0xfb7d4c]={'$like':'%'+_0x37e63d[_0xb597('0x43')]['filter']+'%'};return _0x33bec4;})});}_0x52ecf3=_[_0xb597('0x52')]({},_0x52ecf3,_0x37e63d[_0xb597('0x54')]);return db['Disposition']['count']({'where':_0x52ecf3[_0xb597('0x51')]})[_0xb597('0x34')](function(_0x1ec7fe){_0x6eb7ca[_0xb597('0x55')]=_0x1ec7fe;if(_0x37e63d[_0xb597('0x43')][_0xb597('0x56')]){_0x52ecf3['include']=[{'all':!![]}];}return db[_0xb597('0x66')][_0xb597('0x58')](_0x52ecf3);})['then'](function(_0x3aaafc){_0x6eb7ca[_0xb597('0x59')]=_0x3aaafc;return _0x6eb7ca;});}})[_0xb597('0x34')](respondWithFilteredResult(_0x18a6ae,_0x52ecf3))[_0xb597('0x5a')](handleError(_0x18a6ae,null));};exports[_0xb597('0x68')]=function(_0xb7ef12,_0x368aca,_0x42874c){return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0xb7ef12[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x368aca,null))[_0xb597('0x34')](function(_0x40f36f){if(_0x40f36f){return _0x40f36f[_0xb597('0x68')](_0xb7ef12['query'][_0xb597('0x69')]);}})[_0xb597('0x34')](respondWithStatusCode(_0x368aca,null))[_0xb597('0x5a')](handleError(_0x368aca,null));};exports[_0xb597('0x6a')]=function(_0x2d40f2,_0x2dbbe8,_0x2b4e56){if(_0x2d40f2[_0xb597('0x63')]['id']){delete _0x2d40f2[_0xb597('0x63')]['id'];}return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x2d40f2[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x2dbbe8,null))['then'](function(_0x17a4b3){if(_0x17a4b3){_0x2d40f2[_0xb597('0x63')][_0xb597('0x65')]=_0x17a4b3['id'];return db['CannedAnswer'][_0xb597('0x5d')](_0x2d40f2[_0xb597('0x63')]);}})['then'](respondWithResult(_0x2dbbe8,null))[_0xb597('0x5a')](handleError(_0x2dbbe8,null));};exports[_0xb597('0x6b')]=function(_0x2ee91a,_0x2fdbe5,_0x3e8736){var _0x4d4b25={'raw':![],'where':{}};var _0x306f25={};var _0x1fff10={'count':0x0,'rows':[]};return db['SmsAccount'][_0xb597('0x67')]({'where':{'id':_0x2ee91a['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x2fdbe5,null))[_0xb597('0x34')](function(_0x3331d3){if(_0x3331d3){_0x306f25[_0xb597('0x48')]=_['keys'](db[_0xb597('0x6c')][_0xb597('0x3f')]);_0x306f25[_0xb597('0x43')]=_[_0xb597('0x44')](_0x2ee91a[_0xb597('0x43')]);_0x306f25[_0xb597('0x45')]=_[_0xb597('0x46')](_0x306f25['model'],_0x306f25['query']);_0x4d4b25[_0xb597('0x47')]=_[_0xb597('0x46')](_0x306f25[_0xb597('0x48')],qs[_0xb597('0x49')](_0x2ee91a[_0xb597('0x43')][_0xb597('0x49')]));_0x4d4b25['attributes']=_0x4d4b25[_0xb597('0x47')][_0xb597('0x4a')]?_0x4d4b25[_0xb597('0x47')]:_0x306f25[_0xb597('0x48')];if(!_0x2ee91a[_0xb597('0x43')][_0xb597('0x4b')](_0xb597('0x4c'))){_0x4d4b25[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x2ee91a[_0xb597('0x43')][_0xb597('0x2f')]);_0x4d4b25[_0xb597('0x2d')]=qs['offset'](_0x2ee91a[_0xb597('0x43')]['offset']);}_0x4d4b25[_0xb597('0x4d')]=qs['sort'](_0x2ee91a[_0xb597('0x43')]['sort']);_0x4d4b25[_0xb597('0x51')]=qs[_0xb597('0x45')](_[_0xb597('0x4f')](_0x2ee91a[_0xb597('0x43')],_0x306f25[_0xb597('0x45')]));_0x4d4b25[_0xb597('0x51')][_0xb597('0x65')]=_0x3331d3['id'];if(_0x2ee91a[_0xb597('0x43')]['filter']){_0x4d4b25[_0xb597('0x51')]=_[_0xb597('0x52')](_0x4d4b25[_0xb597('0x51')],{'$or':_[_0xb597('0x3d')](_0x4d4b25['attributes'],function(_0x30a30a){var _0x708ee1={};_0x708ee1[_0x30a30a]={'$like':'%'+_0x2ee91a[_0xb597('0x43')][_0xb597('0x50')]+'%'};return _0x708ee1;})});}_0x4d4b25=_[_0xb597('0x52')]({},_0x4d4b25,_0x2ee91a[_0xb597('0x54')]);return db[_0xb597('0x6c')][_0xb597('0x55')]({'where':_0x4d4b25[_0xb597('0x51')]})['then'](function(_0x4506c4){_0x1fff10[_0xb597('0x55')]=_0x4506c4;if(_0x2ee91a[_0xb597('0x43')][_0xb597('0x56')]){_0x4d4b25['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xb597('0x58')](_0x4d4b25);})[_0xb597('0x34')](function(_0x47cefa){_0x1fff10[_0xb597('0x59')]=_0x47cefa;return _0x1fff10;});}})[_0xb597('0x34')](respondWithFilteredResult(_0x2fdbe5,_0x4d4b25))[_0xb597('0x5a')](handleError(_0x2fdbe5,null));};exports[_0xb597('0x6d')]=function(_0x1599b1,_0xad8c52,_0x408d49){return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x1599b1[_0xb597('0x5c')]['id']}})['then'](handleEntityNotFound(_0xad8c52,null))[_0xb597('0x34')](function(_0x4b47e2){if(_0x4b47e2){return _0x4b47e2[_0xb597('0x6d')](_0x1599b1['query'][_0xb597('0x69')]);}})[_0xb597('0x34')](respondWithStatusCode(_0xad8c52,null))[_0xb597('0x5a')](handleError(_0xad8c52,null));};exports[_0xb597('0x6e')]=function(_0x2cf538,_0x37b93a,_0x4828f0){var _0x372549={'channel':'sms'};var _0x115e55=[];var _0x697c4e=[];var _0x4185a3={};return db[_0xb597('0x3e')]['find']({'where':{'id':_0x2cf538[_0xb597('0x5c')]['id']},'include':[{'model':db[_0xb597('0x6f')],'as':_0xb597('0x70')}]})[_0xb597('0x34')](handleEntityNotFound(_0x37b93a,null))[_0xb597('0x34')](function(_0x526cdc){_0x372549[_0xb597('0x71')]=_0x526cdc;_0x372549[_0xb597('0x72')]=_[_0xb597('0x73')](_0x526cdc[_0xb597('0x70')],['priority'],[_0xb597('0x74')]);if(_0x372549[_0xb597('0x71')][_0xb597('0x70')]){delete _0x372549[_0xb597('0x71')]['Applications'];}return db[_0xb597('0x75')][_0xb597('0x64')]();})[_0xb597('0x34')](function(_0x28d5fc){if(!_0x28d5fc){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0x78'));}_0x115e55=_[_0xb597('0x79')](_[_0xb597('0x44')](_0x28d5fc),[_0xb597('0x7a'),_0xb597('0x7b')]);_0x697c4e=_[_0xb597('0x79')](_['keys'](_0x28d5fc),['createdAt','updatedAt',_0xb597('0x7c'),_0xb597('0x7d')]);_0x372549[_0xb597('0x63')]={'mapKey':_0xb597('0x7e')};if(_0x372549['account'][_0xb597('0x41')]){switch(_0x372549[_0xb597('0x71')][_0xb597('0x41')]){case _0xb597('0x7f'):_0x372549['body'][_0xb597('0x80')]=_0x2cf538['body']['From'];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x81')];_0x372549[_0xb597('0x63')]['messageId']=_0x2cf538['body'][_0xb597('0x82')];break;case _0xb597('0x83'):_0x372549['body'][_0xb597('0x80')]='+'+_0x2cf538['body'][_0xb597('0x84')];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x85')];break;case _0xb597('0x86'):_0x372549[_0xb597('0x63')][_0xb597('0x80')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x80')];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')]['message'];break;case'clicksend':_0x372549['body'][_0xb597('0x80')]=_0x2cf538[_0xb597('0x63')]['from'];_0x372549[_0xb597('0x63')]['body']=_0x2cf538[_0xb597('0x63')][_0xb597('0x63')];_0x372549[_0xb597('0x63')]['messageId']=_0x2cf538[_0xb597('0x63')][_0xb597('0x87')];break;case'plivo':_0x372549[_0xb597('0x63')]['from']=_0x2cf538['body']['From'];_0x372549[_0xb597('0x63')]['body']=_0x2cf538['body']['Text'];_0x372549[_0xb597('0x63')]['messageId']=_0x2cf538[_0xb597('0x63')][_0xb597('0x88')];break;case _0xb597('0x89'):_0x372549[_0xb597('0x63')][_0xb597('0x80')]='+'+_0x2cf538[_0xb597('0x63')]['results'][0x0][_0xb597('0x80')];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538['body']['results'][0x0][_0xb597('0x85')];_0x372549[_0xb597('0x63')][_0xb597('0x8a')]=_0x2cf538['body'][_0xb597('0x8b')][0x0][_0xb597('0x8a')];break;case _0xb597('0x8c'):_0x372549[_0xb597('0x63')][_0xb597('0x80')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x8d')];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x8e')][_0xb597('0x27')];break;case'clickatell':_0x372549['body'][_0xb597('0x80')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x8f')];_0x372549['body'][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x85')];_0x372549['body'][_0xb597('0x8a')]=_0x2cf538[_0xb597('0x63')]['replyMessageId'];break;case'bandwidth':_0x372549[_0xb597('0x63')][_0xb597('0x8a')]=_0x2cf538['body'][0x0]['message']['id'];_0x372549[_0xb597('0x63')][_0xb597('0x80')]=_0x2cf538['body'][0x0][_0xb597('0x27')][_0xb597('0x80')];_0x372549[_0xb597('0x63')]['body']=_0x2cf538[_0xb597('0x63')][0x0][_0xb597('0x27')][_0xb597('0x85')];break;case _0xb597('0x90'):_0x372549['body']['from']=_0x2cf538[_0xb597('0x63')]['from'];_0x372549[_0xb597('0x63')][_0xb597('0x63')]=_0x2cf538[_0xb597('0x63')][_0xb597('0x27')];_0x372549[_0xb597('0x63')]['messageId']=_0x2cf538['body'][_0xb597('0x91')];break;}}if(_0x372549[_0xb597('0x63')]['id']){delete _0x372549['body']['id'];}if(_['isNil'](_0x372549['body'][_0xb597('0x80')])){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0x92'));}if(_[_0xb597('0x93')](_0x372549[_0xb597('0x63')][_0xb597('0x63')])||_0x372549['body'][_0xb597('0x63')]===''){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0x94'));}if(_[_0xb597('0x93')](_0x372549[_0xb597('0x63')][_0xb597('0x95')])){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0x96')+_0x697c4e);}if(!_[_0xb597('0x97')](_0x697c4e,_0x372549[_0xb597('0x63')]['mapKey'])){throw new db[(_0xb597('0x76'))]['ValidationError'](_0xb597('0x98')+_0x697c4e);}_0x4185a3[_0x372549['body'][_0xb597('0x95')]]=_0x372549['body'][_0xb597('0x80')];return db[_0xb597('0x99')][_0xb597('0x60')]({'where':{'id':_0x372549[_0xb597('0x71')][_0xb597('0x7d')]},'include':[{'model':db[_0xb597('0x75')],'as':_0xb597('0x9a'),'where':_0x4185a3,'limit':0x1,'order':[['updatedAt',_0xb597('0x9b')]]}]});})[_0xb597('0x34')](handleEntityNotFound(_0x37b93a,null))[_0xb597('0x34')](function(_0x4a6282){if(_0x4a6282){_0x372549[_0xb597('0x9c')]=_[_0xb597('0x9d')](_0x4a6282,['Contacts']);if(_0x4a6282[_0xb597('0x9a')][_0xb597('0x4a')]){return _0x4a6282['Contacts'][0x0];}var _0x12756f=_[_0xb597('0x19')](_0x372549[_0xb597('0x63')],{'firstName':_0x372549[_0xb597('0x63')]['from'],'ListId':_0x4a6282['id']});_0x12756f[_0x372549[_0xb597('0x63')][_0xb597('0x95')]]=_0x372549['body']['from'];return db['CmContact'][_0xb597('0x5d')](_0x12756f,{'fields':_0x115e55,'raw':!![]});}})[_0xb597('0x34')](handleEntityNotFound(_0x37b93a,null))[_0xb597('0x34')](function(_0x3cf025){if(_0x3cf025){_0x372549[_0xb597('0x9e')]=_0x3cf025;var _0xa3c98={'ContactId':_0x3cf025['id'],'phone':_0x372549['body'][_0xb597('0x80')],'SmsAccountId':_0x2cf538[_0xb597('0x5c')]['id']};var _0x3dfff8={'ContactId':_0x3cf025['id'],'SmsAccountId':_0x2cf538['params']['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x3dfff8})[_0xb597('0x34')](function(_0x3bdd6b){if(_0x3bdd6b){return[_0x3bdd6b,![]];}return db[_0xb597('0x9f')][_0xb597('0x5d')](_0xa3c98)[_0xb597('0x34')](function(_0x4c2092){return[_0x4c2092,!![]];});});}})[_0xb597('0xa0')](function(_0x371eba,_0x2a1d03){_0x372549[_0xb597('0xa1')]=_0x371eba[_0xb597('0x36')]({'plain':!![]});_0x372549['interaction'][_0xb597('0xa2')]=![];if(_0x2a1d03){if(_0x372549[_0xb597('0x71')]['autoclose']){_0x372549[_0xb597('0x72')][_0xb597('0xa3')]({'id':0x0,'priority':_0x372549[_0xb597('0x72')][_0xb597('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x372549[_0xb597('0xa1')][_0xb597('0xa2')]=!![];}return db['SmsMessage'][_0xb597('0x5d')]({'phone':_0x372549[_0xb597('0x63')][_0xb597('0x80')],'messageId':_0x372549[_0xb597('0x63')][_0xb597('0x8a')],'body':_0x372549[_0xb597('0x63')]['body'],'SmsAccountId':_0x2cf538[_0xb597('0x5c')]['id'],'SmsInteractionId':_0x371eba['id'],'direction':'in','ContactId':_0x371eba[_0xb597('0xa4')],'AttachmentId':_0x372549[_0xb597('0x63')][_0xb597('0xa5')]});})[_0xb597('0x34')](function(_0x26d5e3){_0x372549['message']=_0x26d5e3;if(_0x372549[_0xb597('0xa1')][_0xb597('0xa6')]){return db[_0xb597('0xa7')][_0xb597('0x60')]({'attributes':['id',_0xb597('0x39')],'where':{'id':_0x372549[_0xb597('0xa1')][_0xb597('0xa6')]}})[_0xb597('0x34')](function(_0xc3a25b){if(_0xc3a25b){_0x372549[_0xb597('0x72')][_0xb597('0xa8')]({'id':0x0,'priority':0x0,'app':_0xb597('0xa9'),'appdata':_0xc3a25b[_0xb597('0x39')]+','+(_0x372549[_0xb597('0x71')][_0xb597('0xaa')]||0xa),'interval':_0xb597('0xab')});}return respondWithRpcPromise('Start',_0xb597('0xac'),_0x372549);});}return respondWithRpcPromise(_0xb597('0xad'),_0xb597('0xac'),_0x372549);})[_0xb597('0x34')](function(_0x3fc0dc){if(_0x3fc0dc){var _0x5221c4=0xc8;var _0x29f4ec=_0xb597('0xae');logger[_0xb597('0x20')](_0xb597('0x24'),_0x29f4ec,_0x5221c4,'entity\x20found');logger[_0xb597('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x29f4ec,_0x5221c4,_0xb597('0xaf'),JSON['stringify'](_0x3fc0dc));if(_0x372549[_0xb597('0x71')][_0xb597('0x41')]===_0xb597('0x7f')){return _0x37b93a[_0xb597('0x2a')](_0x5221c4)['set'](_0xb597('0xb0'),_0xb597('0xb1'))[_0xb597('0x3a')](_0xb597('0xb2'));}else{return _0x37b93a[_0xb597('0x2a')](_0x5221c4)[_0xb597('0x2c')](_0x3fc0dc);}}})['catch'](handleError(_0x37b93a,null));};exports[_0xb597('0xb3')]=function(_0xc38d57,_0x4d7fb5,_0x587f4b){return db['SmsAccount']['findOne']({'where':{'id':_0xc38d57['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x4d7fb5,null))['then'](function(_0x545dc2){if(_0x545dc2){return db[_0xb597('0xb4')][_0xb597('0xb5')](function(_0x114702){return db['SmsApplication'][_0xb597('0x35')]({'where':{'SmsAccountId':_0xc38d57[_0xb597('0x5c')]['id']},'transaction':_0x114702})[_0xb597('0x34')](function(_0x2f9d03){var _0x38afbc=_[_0xb597('0x3d')](_0xc38d57[_0xb597('0x63')],function(_0x4bcb39){_0x4bcb39['SmsAccountId']=_0xc38d57['params']['id'];return _0x4bcb39;});return db[_0xb597('0x6f')][_0xb597('0xb6')](_0x38afbc,{'transaction':_0x114702});});})[_0xb597('0x34')](function(){return db['SmsApplication'][_0xb597('0xb7')]({'where':{'SmsAccountId':_0xc38d57['params']['id']},'order':_0xb597('0xb8')});});}})[_0xb597('0x34')](respondWithResult(_0x4d7fb5,null))[_0xb597('0x5a')](handleError(_0x4d7fb5,null));};exports[_0xb597('0xb9')]=function(_0x1fcfa2,_0x1b0997,_0x16ad24){var _0x40c70c={};var _0x30397c={};var _0x47e5c8;var _0x4e3d20;return db['SmsAccount']['findOne']({'where':{'id':_0x1fcfa2[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x1b0997,null))[_0xb597('0x34')](function(_0x220d23){if(_0x220d23){_0x47e5c8=_0x220d23;_0x30397c['model']=_[_0xb597('0x44')](db[_0xb597('0x6f')][_0xb597('0x3f')]);_0x30397c[_0xb597('0x43')]=_[_0xb597('0x44')](_0x1fcfa2[_0xb597('0x43')]);_0x30397c[_0xb597('0x45')]=_[_0xb597('0x46')](_0x30397c[_0xb597('0x48')],_0x30397c[_0xb597('0x43')]);_0x40c70c[_0xb597('0x47')]=_[_0xb597('0x46')](_0x30397c[_0xb597('0x48')],qs[_0xb597('0x49')](_0x1fcfa2[_0xb597('0x43')][_0xb597('0x49')]));_0x40c70c[_0xb597('0x47')]=_0x40c70c[_0xb597('0x47')][_0xb597('0x4a')]?_0x40c70c[_0xb597('0x47')]:_0x30397c['model'];_0x40c70c['order']=qs[_0xb597('0x4e')](_0x1fcfa2['query'][_0xb597('0x4e')]);_0x40c70c[_0xb597('0x51')]=qs[_0xb597('0x45')](_[_0xb597('0x4f')](_0x1fcfa2[_0xb597('0x43')],_0x30397c['filters']));if(_0x1fcfa2[_0xb597('0x43')][_0xb597('0x50')]){_0x40c70c[_0xb597('0x51')]=_[_0xb597('0x52')](_0x40c70c[_0xb597('0x51')],{'$or':_[_0xb597('0x3d')](_0x40c70c[_0xb597('0x47')],function(_0x45fb9b){var _0x5efe2b={};_0x5efe2b[_0x45fb9b]={'$like':'%'+_0x1fcfa2[_0xb597('0x43')][_0xb597('0x50')]+'%'};return _0x5efe2b;})});}_0x40c70c=_[_0xb597('0x52')]({},_0x40c70c,_0x1fcfa2[_0xb597('0x54')]);return _0x47e5c8[_0xb597('0xb9')](_0x40c70c);}})[_0xb597('0x34')](function(_0x268cb3){if(_0x268cb3){_0x4e3d20=_0x268cb3[_0xb597('0x4a')];if(!_0x1fcfa2[_0xb597('0x43')][_0xb597('0x4b')](_0xb597('0x4c'))){_0x40c70c[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x1fcfa2[_0xb597('0x43')][_0xb597('0x2f')]);_0x40c70c[_0xb597('0x2d')]=qs[_0xb597('0x2d')](_0x1fcfa2['query'][_0xb597('0x2d')]);}return _0x47e5c8[_0xb597('0xb9')](_0x40c70c);}})[_0xb597('0x34')](function(_0x1f6f72){if(_0x1f6f72){return _0x1f6f72?{'count':_0x4e3d20,'rows':_0x1f6f72}:null;}})[_0xb597('0x34')](respondWithResult(_0x1b0997,null))[_0xb597('0x5a')](handleError(_0x1b0997,null));};exports[_0xb597('0xba')]=function(_0x597171,_0x4b65d6,_0x271ace){var _0x112ea1={'raw':![],'where':{}};var _0x1a952b={};var _0x5aafe7={'count':0x0,'rows':[]};return db[_0xb597('0x3e')]['findOne']({'where':{'id':_0x597171[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x4b65d6,null))[_0xb597('0x34')](function(_0x5f32f9){if(_0x5f32f9){_0x1a952b[_0xb597('0x48')]=_[_0xb597('0x44')](db['SmsInteraction']['rawAttributes']);_0x1a952b[_0xb597('0x43')]=_['keys'](_0x597171[_0xb597('0x43')]);_0x1a952b['filters']=_[_0xb597('0x46')](_0x1a952b[_0xb597('0x48')],_0x1a952b[_0xb597('0x43')]);_0x112ea1[_0xb597('0x47')]=_[_0xb597('0x46')](_0x1a952b[_0xb597('0x48')],qs[_0xb597('0x49')](_0x597171[_0xb597('0x43')][_0xb597('0x49')]));_0x112ea1[_0xb597('0x47')]=_0x112ea1[_0xb597('0x47')]['length']?_0x112ea1[_0xb597('0x47')]:_0x1a952b[_0xb597('0x48')];if(!_0x597171[_0xb597('0x43')][_0xb597('0x4b')](_0xb597('0x4c'))){_0x112ea1[_0xb597('0x2f')]=qs[_0xb597('0x2f')](_0x597171[_0xb597('0x43')][_0xb597('0x2f')]);_0x112ea1[_0xb597('0x2d')]=qs[_0xb597('0x2d')](_0x597171['query']['offset']);}_0x112ea1[_0xb597('0x4d')]=qs[_0xb597('0x4e')](_0x597171['query'][_0xb597('0x4e')]);_0x112ea1[_0xb597('0x51')]=qs[_0xb597('0x45')](_[_0xb597('0x4f')](_0x597171[_0xb597('0x43')],_0x1a952b[_0xb597('0x45')]));_0x112ea1[_0xb597('0x51')][_0xb597('0x65')]=_0x5f32f9['id'];if(_0x597171[_0xb597('0x43')][_0xb597('0x50')]){_0x112ea1[_0xb597('0x51')]=_['merge'](_0x112ea1['where'],{'$or':_[_0xb597('0x3d')](_0x112ea1[_0xb597('0x47')],function(_0x231a10){var _0x32f5d5={};_0x32f5d5[_0x231a10]={'$like':'%'+_0x597171['query'][_0xb597('0x50')]+'%'};return _0x32f5d5;})});}_0x112ea1=_[_0xb597('0x52')]({},_0x112ea1,_0x597171[_0xb597('0x54')]);return db['SmsInteraction']['count']({'where':_0x112ea1[_0xb597('0x51')]})[_0xb597('0x34')](function(_0x326c6d){_0x5aafe7[_0xb597('0x55')]=_0x326c6d;if(_0x597171[_0xb597('0x43')][_0xb597('0x56')]){_0x112ea1[_0xb597('0x57')]=[{'model':db['CmContact'],'as':_0xb597('0xbb'),'required':![]},{'model':db[_0xb597('0xa7')],'as':_0xb597('0xbc'),'attributes':[_0xb597('0x39'),_0xb597('0xbd'),_0xb597('0xbe')],'required':![]},{'model':db['Tag'],'as':_0xb597('0xbf'),'attributes':['id','name','color'],'where':_0x597171[_0xb597('0x43')]['tag']?{'id':_0x597171[_0xb597('0x43')]['tag']}:undefined,'required':_0x597171[_0xb597('0x43')][_0xb597('0xc0')]?!![]:![]}];}return db['SmsInteraction'][_0xb597('0x58')](_0x112ea1);})[_0xb597('0x34')](function(_0x383397){_0x5aafe7[_0xb597('0x59')]=_0x383397;return _0x5aafe7;});}})['then'](respondWithFilteredResult(_0x4b65d6,_0x112ea1))['catch'](handleError(_0x4b65d6,null));};exports[_0xb597('0x3a')]=function(_0x27306f,_0x318031,_0x110874){var _0x43338f,_0x12838d,_0x2a8413;if(_[_0xb597('0x93')](_0x27306f[_0xb597('0x63')][_0xb597('0x63')])||_0x27306f[_0xb597('0x63')][_0xb597('0x63')]===''){throw new db[(_0xb597('0x76'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb597('0x93')](_0x27306f[_0xb597('0x63')]['to'])){throw new db[(_0xb597('0x76'))][(_0xb597('0x77'))](_0xb597('0xc1'));}_0x43338f=_0x27306f[_0xb597('0x63')]['to'];return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x27306f[_0xb597('0x5c')]['id']},'include':[{'model':db[_0xb597('0x99')],'as':'List','include':[{'model':db[_0xb597('0x75')],'as':_0xb597('0x9a'),'where':{'mobile':_0x43338f},'limit':0x1,'order':[[_0xb597('0x7b'),_0xb597('0x9b')]]}]}]})['then'](handleEntityNotFound(_0x318031,null))[_0xb597('0x34')](function(_0xe9818f){if(_0xe9818f&&_0xe9818f[_0xb597('0xc2')]){_0x12838d=_0xe9818f['get']({'plain':!![]});if(_0x12838d[_0xb597('0xc2')]&&_0x12838d[_0xb597('0xc2')][_0xb597('0x9a')][_0xb597('0x4a')]){return _0x12838d['List'][_0xb597('0x9a')][0x0];}return db[_0xb597('0x75')][_0xb597('0x5d')](_[_0xb597('0x19')](_0x27306f['body'],{'firstName':_0x43338f,'mobile':_0x43338f,'phone':_0x43338f,'ListId':_0x12838d[_0xb597('0x7d')]}));}})['then'](handleEntityNotFound(_0x318031,null))[_0xb597('0x34')](function(_0x474f8f){if(_0x474f8f){_0x2a8413=_0x474f8f;return db['SmsInteraction'][_0xb597('0x60')]({'where':{'ContactId':_0x2a8413['id'],'closed':![],'SmsAccountId':_0x12838d['id']}})[_0xb597('0x34')](function(_0x57689b){if(_0x57689b){return[_0x57689b,![]];}return db[_0xb597('0x9f')][_0xb597('0x5d')]({'UserId':_0x27306f['user']['id'],'ContactId':_0x2a8413['id'],'SmsAccountId':_0x12838d['id'],'phone':_0x43338f,'firstMsgDirection':_0xb597('0xc3'),'Messages':[_[_0xb597('0x52')](_0x27306f[_0xb597('0x63')],{'read':![],'body':_0x27306f[_0xb597('0x63')][_0xb597('0x63')],'phone':_0x43338f,'SmsAccountId':_0x12838d['id'],'UserId':_0x27306f[_0xb597('0xc4')]['id'],'ContactId':_0x2a8413['id']})]},{'include':[{'model':db[_0xb597('0xc5')],'as':_0xb597('0xc6')}]})['then'](function(_0x34d9b5){return[_0x34d9b5,!![]];});});}})['spread'](function(_0x286d6e,_0x527f4e){if(_0x527f4e){return _0x286d6e;}return db[_0xb597('0xc5')][_0xb597('0x5d')](_[_0xb597('0x52')](_0x27306f[_0xb597('0x63')],{'read':![],'body':_0x27306f['body'][_0xb597('0x63')],'phone':_0x43338f,'SmsAccountId':_0x12838d['id'],'SmsInteractionId':_0x286d6e['id'],'UserId':_0x27306f['user']['id'],'ContactId':_0x2a8413['id']}))[_0xb597('0x34')](function(_0xb4b3be){_0x286d6e[_0xb597('0xc7')][_0xb597('0xc6')]=[];_0x286d6e[_0xb597('0xc7')][_0xb597('0xc6')][_0xb597('0xa3')](_0xb4b3be[_0xb597('0xc7')]);return _0x286d6e;});})[_0xb597('0x34')](respondWithResult(_0x318031,null))['catch'](handleError(_0x318031,null));};exports[_0xb597('0x2a')]=function(_0x2f6658,_0x5da49b,_0x36d085){if(_0x2f6658[_0xb597('0x63')]['id']){delete _0x2f6658[_0xb597('0x63')]['id'];}var _0x21abd3,_0x324767,_0x11fc30;return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x2f6658['params']['id']}})['then'](handleEntityNotFound(_0x5da49b,null))[_0xb597('0x34')](function(_0x17d0b9){if(_0x17d0b9){_0x11fc30=_0x17d0b9;logger['debug'](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0xc8'),_0x17d0b9[_0xb597('0x41')],util['inspect'](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));switch(_0x17d0b9[_0xb597('0x41')]){case _0xb597('0x83'):if(_0x2f6658[_0xb597('0x63')]['skebby_dispatch_id']&&_0x2f6658['body'][_0xb597('0x2a')]){_0x324767=_0x2f6658[_0xb597('0x63')][_0xb597('0x2a')];return db[_0xb597('0xc5')]['find']({'where':{'messageId':_0x2f6658[_0xb597('0x63')]['skebby_dispatch_id']}});}break;case _0xb597('0x86'):if(_0x2f6658[_0xb597('0x63')][_0xb597('0xc9')]&&_0x2f6658['body'][_0xb597('0xca')]){_0x324767=_0x2f6658[_0xb597('0x63')][_0xb597('0xca')];return db[_0xb597('0xc5')]['find']({'where':{'messageId':_0x2f6658[_0xb597('0x63')][_0xb597('0xc9')]}});}break;case _0xb597('0xcb'):if(_0x2f6658[_0xb597('0x63')]['message_id']&&_0x2f6658[_0xb597('0x63')][_0xb597('0xcc')]){_0x324767=_0x2f6658[_0xb597('0x63')][_0xb597('0xcc')];return db['SmsMessage']['find']({'where':{'messageId':_0x2f6658[_0xb597('0x63')][_0xb597('0x87')]}});}break;case _0xb597('0x89'):var _0x3b8526=_0x2f6658['body'][_0xb597('0x8b')][0x0];if(_0x3b8526['messageId']&&_0x3b8526[_0xb597('0x2a')]['groupName']===_0xb597('0xcd')){_0x324767=_0x3b8526['status'][_0xb597('0xce')];return db['SmsMessage'][_0xb597('0x60')]({'where':{'messageId':_0x3b8526['messageId']}});}break;case _0xb597('0xcf'):if(_0x2f6658[_0xb597('0x63')]['messageId']&&_0x2f6658[_0xb597('0x63')][_0xb597('0x2a')]){_0x324767=_0x2f6658[_0xb597('0x63')]['status'];return db['SmsMessage'][_0xb597('0x60')]({'where':{'messageId':_0x2f6658[_0xb597('0x63')][_0xb597('0x8a')]}});}break;case _0xb597('0xd0'):if(_0x2f6658[_0xb597('0x63')][0x0][_0xb597('0x27')]['id']){_0x324767=_0x2f6658['body'][0x0][_0xb597('0x41')];return db[_0xb597('0xc5')][_0xb597('0x60')]({'where':{'messageId':_0x2f6658['body'][0x0][_0xb597('0x27')]['id']}});}break;case'intelepeer':if(_0x2f6658[_0xb597('0x63')][_0xb597('0xd1')]&&_0x2f6658[_0xb597('0x63')]['status']){_0x324767=_0x2f6658[_0xb597('0x63')][_0xb597('0x2a')];return db[_0xb597('0xc5')]['find']({'where':{'messageId':_0x2f6658['body']['redif']}});}break;}}})[_0xb597('0x34')](handleEntityNotFound(_0x5da49b,null))[_0xb597('0x34')](function(_0x27b9b9){if(_0x27b9b9){_0x21abd3=_0x27b9b9;switch(_0x11fc30[_0xb597('0x41')]){case _0xb597('0x83'):if(_0x324767===_0xb597('0xcd')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger['error'](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0x83'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case _0xb597('0x86'):if(_0x324767==='1'){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger[_0xb597('0x25')](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0x83'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case _0xb597('0xcb'):if(!_0x2f6658['body'][_0xb597('0xd3')]&&_0x324767>=0xc8&&_0x324767<=0xce){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb597('0x2a'),_0xb597('0xcb'),util[_0xb597('0xd2')](_0x2f6658['body'],{'showHidden':![],'depth':null}));}break;case _0xb597('0x89'):var _0x2c6457=_0x2f6658[_0xb597('0x63')][_0xb597('0x8b')][0x0];if(_0x2c6457[_0xb597('0x2a')][_0xb597('0xce')]===_0xb597('0xcd')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger['error'](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0x89'),util['inspect'](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x324767==_0xb597('0xd4')||_0x324767==_0xb597('0xd5')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger[_0xb597('0x25')](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0xcf'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x324767==_0xb597('0xd6')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger[_0xb597('0x25')](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0xd0'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;case _0xb597('0x90'):if(_0x324767===_0xb597('0xd7')||_0x324767===_0xb597('0xd8')){return _0x21abd3[_0xb597('0x33')]({'read':!![]});}else{logger[_0xb597('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb597('0x2a'),_0xb597('0x90'),util[_0xb597('0xd2')](_0x2f6658[_0xb597('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x21abd3;}})['then'](respondWithResult(_0x5da49b,null))[_0xb597('0x5a')](handleError(_0x5da49b,null));};exports[_0xb597('0xd9')]=function(_0x1f6fdf,_0x1b3993,_0x3857ee){var _0x31fa50,_0x1e6cbb,_0x472669;return db[_0xb597('0x3e')]['find']({'where':{'id':_0x1f6fdf[_0xb597('0x5c')]['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x1b3993,null))[_0xb597('0x34')](function(_0x59c6bb){if(_0x59c6bb){_0x472669=_0x59c6bb;logger[_0xb597('0x23')](_0xb597('0x24'),_0xb597('0x2a'),_0xb597('0xc8'),_0x59c6bb[_0xb597('0x41')],util['inspect'](_0x1f6fdf[_0xb597('0x43')],{'showHidden':![],'depth':null}));switch(_0x59c6bb['type']){case _0xb597('0x8c'):if(_0x1f6fdf[_0xb597('0x43')][_0xb597('0xda')]&&_0x1f6fdf[_0xb597('0x43')][_0xb597('0xdb')]){_0x1e6cbb=_0x1f6fdf[_0xb597('0x43')][_0xb597('0xdb')];return db[_0xb597('0xc5')][_0xb597('0x60')]({'where':{'messageId':_0x1f6fdf[_0xb597('0x43')][_0xb597('0xda')]}});}break;}}})[_0xb597('0x34')](handleEntityNotFound(_0x1b3993,null))['then'](function(_0x33145a){if(_0x33145a){_0x31fa50=_0x33145a;switch(_0x472669['type']){case _0xb597('0x8c'):if(_0x1e6cbb==='2'||_0x1e6cbb==='6'){return _0x31fa50['update']({'read':!![]});}else{logger[_0xb597('0x25')](_0xb597('0x24'),'status','csc',util[_0xb597('0xd2')](_0x1f6fdf[_0xb597('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x31fa50;}})[_0xb597('0x34')](respondWithResult(_0x1b3993,null))[_0xb597('0x5a')](handleError(_0x1b3993,null));};exports[_0xb597('0xdc')]=function(_0x36e010,_0x1b0105,_0x219273){return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x36e010['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x1b0105,null))[_0xb597('0x34')](function(_0x5bf8c3){if(_0x5bf8c3){return _0x5bf8c3[_0xb597('0xdc')](_0x36e010[_0xb597('0x63')][_0xb597('0x69')],_['omit'](_0x36e010[_0xb597('0x63')],['ids','id'])||{})['spread'](function(_0x3f686e){for(var _0x3319a4=0x0;_0x3319a4<_0x36e010[_0xb597('0x63')][_0xb597('0x69')][_0xb597('0x4a')];_0x3319a4+=0x1){socket[_0xb597('0xdd')](_0xb597('0xde'),{'UserId':Number(_0x36e010[_0xb597('0x63')][_0xb597('0x69')][_0x3319a4]),'SmsAccountId':Number(_0x36e010[_0xb597('0x5c')]['id'])});}return _0x3f686e;});}})[_0xb597('0x34')](respondWithResult(_0x1b0105,null))['catch'](handleError(_0x1b0105,null));};exports['removeAgents']=function(_0x3969f3,_0x35d491,_0x492502){return db[_0xb597('0x3e')][_0xb597('0x60')]({'where':{'id':_0x3969f3['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x35d491,null))[_0xb597('0x34')](function(_0x4190ac){if(_0x4190ac){return _0x4190ac[_0xb597('0xdf')](_0x3969f3['query'][_0xb597('0x69')])[_0xb597('0x34')](function(){if(_[_0xb597('0xe0')](_0x3969f3[_0xb597('0x43')][_0xb597('0x69')])){for(var _0x2ce57d=0x0;_0x2ce57d<_0x3969f3[_0xb597('0x43')]['ids'][_0xb597('0x4a')];_0x2ce57d+=0x1){socket[_0xb597('0xdd')](_0xb597('0xe1'),{'UserId':Number(_0x3969f3[_0xb597('0x43')][_0xb597('0x69')][_0x2ce57d]),'SmsAccountId':Number(_0x3969f3[_0xb597('0x5c')]['id'])});}}else{socket[_0xb597('0xdd')](_0xb597('0xe1'),{'UserId':Number(_0x3969f3[_0xb597('0x43')]['ids']),'SmsAccountId':Number(_0x3969f3[_0xb597('0x5c')]['id'])});}});}})[_0xb597('0x34')](respondWithStatusCode(_0x35d491,null))[_0xb597('0x5a')](handleError(_0x35d491,null));};exports['getAgents']=function(_0x32b239,_0x2cd1a9,_0x10eab5){var _0x439d8d={};var _0x500e42={};var _0x39504c;var _0x47771d;return db[_0xb597('0x3e')][_0xb597('0x67')]({'where':{'id':_0x32b239['params']['id']}})[_0xb597('0x34')](handleEntityNotFound(_0x2cd1a9,null))[_0xb597('0x34')](function(_0x3decfc){if(_0x3decfc){_0x39504c=_0x3decfc;_0x500e42[_0xb597('0x48')]=_[_0xb597('0x44')](db[_0xb597('0xa7')][_0xb597('0x3f')]);_0x500e42[_0xb597('0x43')]=_[_0xb597('0x44')](_0x32b239[_0xb597('0x43')]);_0x500e42[_0xb597('0x45')]=_[_0xb597('0x46')](_0x500e42['model'],_0x500e42[_0xb597('0x43')]);_0x439d8d['attributes']=_[_0xb597('0x46')](_0x500e42[_0xb597('0x48')],qs[_0xb597('0x49')](_0x32b239[_0xb597('0x43')][_0xb597('0x49')]));_0x439d8d[_0xb597('0x47')]=_0x439d8d['attributes']['length']?_0x439d8d['attributes']:_0x500e42[_0xb597('0x48')];_0x439d8d['order']=qs[_0xb597('0x4e')](_0x32b239[_0xb597('0x43')]['sort']);_0x439d8d[_0xb597('0x51')]=qs[_0xb597('0x45')](_['pick'](_0x32b239[_0xb597('0x43')],_0x500e42[_0xb597('0x45')]));if(_0x32b239[_0xb597('0x43')]['filter']){_0x439d8d[_0xb597('0x51')]=_[_0xb597('0x52')](_0x439d8d['where'],{'$or':_[_0xb597('0x3d')](_0x439d8d['attributes'],function(_0x1fd351){var _0x266d40={};_0x266d40[_0x1fd351]={'$like':'%'+_0x32b239[_0xb597('0x43')][_0xb597('0x50')]+'%'};return _0x266d40;})});}_0x439d8d=_[_0xb597('0x52')]({},_0x439d8d,_0x32b239[_0xb597('0x54')]);return _0x39504c['getAgents'](_0x439d8d);}})['then'](function(_0x183efa){if(_0x183efa){_0x47771d=_0x183efa[_0xb597('0x4a')];if(!_0x32b239[_0xb597('0x43')][_0xb597('0x4b')]('nolimit')){_0x439d8d[_0xb597('0x2f')]=qs['limit'](_0x32b239['query'][_0xb597('0x2f')]);_0x439d8d[_0xb597('0x2d')]=qs['offset'](_0x32b239['query'][_0xb597('0x2d')]);}return _0x39504c[_0xb597('0xe2')](_0x439d8d);}})['then'](function(_0x73ccea){if(_0x73ccea){return _0x73ccea?{'count':_0x47771d,'rows':_0x73ccea}:null;}})[_0xb597('0x34')](respondWithResult(_0x2cd1a9,null))[_0xb597('0x5a')](handleError(_0x2cd1a9,null));}; \ No newline at end of file +var _0xca63=['findOne','CannedAnswer','getAnswers','rows','removeAnswers','ids','sms','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','Body','MessageSid','sender','text','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','messageId','segmentedMessage','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','twilio','Content-Type','send','\x0a','addApplications','sequelize','SmsApplication','bulkCreate','findAndCountAll','getApplications','Contact','User','Owner','fullname','internal','Tag','tag','to\x20is\x20mandatory','List','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby','statusInt','SmsMessage','requestid','status_code','groupName','clickatell','redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','get','SmsAccounts','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xca63,0x75));var _0x3ca6=function(_0x446ced,_0x195e64){_0x446ced=_0x446ced-0x0;var _0x3ec3d0=_0xca63[_0x446ced];return _0x3ec3d0;};'use strict';var emlformat=require(_0x3ca6('0x0'));var rimraf=require(_0x3ca6('0x1'));var zipdir=require(_0x3ca6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ca6('0x3'));var moment=require(_0x3ca6('0x4'));var BPromise=require(_0x3ca6('0x5'));var Mustache=require(_0x3ca6('0x6'));var util=require('util');var path=require(_0x3ca6('0x7'));var sox=require(_0x3ca6('0x8'));var csv=require(_0x3ca6('0x9'));var ejs=require(_0x3ca6('0xa'));var fs=require('fs');var fs_extra=require(_0x3ca6('0xb'));var _=require(_0x3ca6('0xc'));var squel=require(_0x3ca6('0xd'));var crypto=require('crypto');var jsforce=require(_0x3ca6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3ca6('0x9'));var querystring=require(_0x3ca6('0xf'));var Papa=require(_0x3ca6('0x10'));var Redis=require(_0x3ca6('0x11'));var authService=require(_0x3ca6('0x12'));var qs=require(_0x3ca6('0x13'));var as=require(_0x3ca6('0x14'));var hardwareService=require(_0x3ca6('0x15'));var logger=require(_0x3ca6('0x16'))(_0x3ca6('0x17'));var utils=require(_0x3ca6('0x18'));var config=require(_0x3ca6('0x19'));var licenseUtil=require(_0x3ca6('0x1a'));var db=require(_0x3ca6('0x1b'))['db'];config[_0x3ca6('0x1c')]=_[_0x3ca6('0x1d')](config[_0x3ca6('0x1c')],{'host':_0x3ca6('0x1e'),'port':0x18eb});var socket=require(_0x3ca6('0x1f'))(new Redis(config[_0x3ca6('0x1c')]));require(_0x3ca6('0x20'))[_0x3ca6('0x21')](socket);var jayson=require(_0x3ca6('0x22'));var client=jayson['client'][_0x3ca6('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1c6f59,_0xc349b4,_0x28aa4c,_0x586721){return new BPromise(function(_0x4f71b6,_0x3c2624){var _0x53e0da=_0x586721||client;return _0x53e0da[_0x3ca6('0x24')](_0x1c6f59,_0x28aa4c)[_0x3ca6('0x25')](function(_0x2eba5e){logger[_0x3ca6('0x26')](_0x3ca6('0x27'),_0xc349b4,_0x3ca6('0x28'));logger[_0x3ca6('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc349b4,_0x3ca6('0x28'),JSON['stringify'](_0x2eba5e));if(_0x2eba5e[_0x3ca6('0x2a')]){if(_0x2eba5e[_0x3ca6('0x2a')][_0x3ca6('0x2b')]===0x1f4){logger[_0x3ca6('0x2a')](_0x3ca6('0x27'),_0xc349b4,_0x2eba5e['error']['message']);return _0x3c2624(_0x2eba5e[_0x3ca6('0x2a')]['message']);}logger[_0x3ca6('0x2a')](_0x3ca6('0x27'),_0xc349b4,_0x2eba5e['error']['message']);return _0x4f71b6(_0x2eba5e[_0x3ca6('0x2a')][_0x3ca6('0x2c')]);}else{logger[_0x3ca6('0x26')](_0x3ca6('0x27'),_0xc349b4,_0x3ca6('0x28'));_0x4f71b6(_0x2eba5e[_0x3ca6('0x2d')][_0x3ca6('0x2c')]);}})['catch'](function(_0x38bf03){logger[_0x3ca6('0x2a')]('SmsAccount,\x20%s,\x20%s',_0xc349b4,_0x38bf03);_0x3c2624(_0x38bf03);});});}function respondWithStatusCode(_0x2b0b00,_0x21a188){_0x21a188=_0x21a188||0xcc;return function(_0x1db434){if(_0x1db434){return _0x2b0b00[_0x3ca6('0x2e')](_0x21a188);}return _0x2b0b00[_0x3ca6('0x2f')](_0x21a188)[_0x3ca6('0x30')]();};}function respondWithResult(_0x297e9b,_0x5ebd63){_0x5ebd63=_0x5ebd63||0xc8;return function(_0x19e414){if(_0x19e414){return _0x297e9b[_0x3ca6('0x2f')](_0x5ebd63)[_0x3ca6('0x31')](_0x19e414);}};}function respondWithFilteredResult(_0x5e5f7d,_0x439e2b){return function(_0x2df6da){if(_0x2df6da){var _0xc5947d=typeof _0x439e2b[_0x3ca6('0x32')]==='undefined'&&typeof _0x439e2b['limit']===_0x3ca6('0x33');var _0xffac17=_0x2df6da[_0x3ca6('0x34')];var _0x291272=_0xc5947d?0x0:_0x439e2b[_0x3ca6('0x32')];var _0x19cdc6=_0xc5947d?_0x2df6da['count']:_0x439e2b['offset']+_0x439e2b[_0x3ca6('0x35')];var _0x26504e;if(_0x19cdc6>=_0xffac17){_0x19cdc6=_0xffac17;_0x26504e=0xc8;}else{_0x26504e=0xce;}_0x5e5f7d[_0x3ca6('0x2f')](_0x26504e);return _0x5e5f7d[_0x3ca6('0x36')](_0x3ca6('0x37'),_0x291272+'-'+_0x19cdc6+'/'+_0xffac17)[_0x3ca6('0x31')](_0x2df6da);}return null;};}function patchUpdates(_0xd1d03){return function(_0x99f21c){try{jsonpatch[_0x3ca6('0x38')](_0x99f21c,_0xd1d03,!![]);}catch(_0x55d830){return BPromise['reject'](_0x55d830);}return _0x99f21c[_0x3ca6('0x39')]();};}function saveUpdates(_0x4e3417,_0x14a044){return function(_0x50b7c8){if(_0x50b7c8){return _0x50b7c8['update'](_0x4e3417)[_0x3ca6('0x25')](function(_0xb4436f){return _0xb4436f;});}return null;};}function removeEntity(_0x45d0c0,_0x36f3b8){return function(_0x57cd44){if(_0x57cd44){return _0x57cd44[_0x3ca6('0x3a')]()[_0x3ca6('0x25')](function(){var _0x545caa=_0x57cd44[_0x3ca6('0x3b')]({'plain':!![]});var _0x109805=_0x3ca6('0x3c');return db['UserProfileResource']['destroy']({'where':{'type':_0x109805,'resourceId':_0x545caa['id']}})['then'](function(){return _0x57cd44;});})['then'](function(){_0x45d0c0[_0x3ca6('0x2f')](0xcc)[_0x3ca6('0x30')]();});}};}function handleEntityNotFound(_0x411a48,_0x29966c){return function(_0x23c436){if(!_0x23c436){_0x411a48[_0x3ca6('0x2e')](0x194);}return _0x23c436;};}function handleError(_0x51ab20,_0x188c51){_0x188c51=_0x188c51||0x1f4;return function(_0x5cbc6f){logger[_0x3ca6('0x2a')](_0x5cbc6f[_0x3ca6('0x3d')]);if(_0x5cbc6f[_0x3ca6('0x3e')]){delete _0x5cbc6f['name'];}_0x51ab20[_0x3ca6('0x2f')](_0x188c51)['send'](_0x5cbc6f);};}exports[_0x3ca6('0x3f')]=function(_0x53522c,_0x3c85f8){var _0x491687={'include':[{'model':db[_0x3ca6('0x40')],'as':_0x3ca6('0x41')}]},_0x2c9040={},_0x38bc19={'count':0x0,'rows':[]};var _0xbc4989=_[_0x3ca6('0x42')](db[_0x3ca6('0x43')][_0x3ca6('0x44')],function(_0x146142){return{'name':_0x146142[_0x3ca6('0x45')],'type':_0x146142[_0x3ca6('0x46')][_0x3ca6('0x47')]};});_0x2c9040[_0x3ca6('0x48')]=_[_0x3ca6('0x42')](_0xbc4989,_0x3ca6('0x3e'));_0x2c9040[_0x3ca6('0x49')]=_[_0x3ca6('0x4a')](_0x53522c['query']);_0x2c9040[_0x3ca6('0x4b')]=_[_0x3ca6('0x4c')](_0x2c9040[_0x3ca6('0x48')],_0x2c9040[_0x3ca6('0x49')]);_0x491687[_0x3ca6('0x4d')]=_[_0x3ca6('0x4c')](_0x2c9040[_0x3ca6('0x48')],qs[_0x3ca6('0x4e')](_0x53522c[_0x3ca6('0x49')]['fields']));_0x491687['attributes']=_0x491687[_0x3ca6('0x4d')][_0x3ca6('0x4f')]?_0x491687['attributes']:_0x2c9040[_0x3ca6('0x48')];if(!_0x53522c['query'][_0x3ca6('0x50')](_0x3ca6('0x51'))){_0x491687[_0x3ca6('0x35')]=qs[_0x3ca6('0x35')](_0x53522c[_0x3ca6('0x49')][_0x3ca6('0x35')]);_0x491687[_0x3ca6('0x32')]=qs['offset'](_0x53522c[_0x3ca6('0x49')]['offset']);}_0x491687[_0x3ca6('0x52')]=qs['sort'](_0x53522c[_0x3ca6('0x49')][_0x3ca6('0x53')]);_0x491687[_0x3ca6('0x54')]=qs[_0x3ca6('0x4b')](_[_0x3ca6('0x55')](_0x53522c[_0x3ca6('0x49')],_0x2c9040['filters']),_0xbc4989);if(_0x53522c[_0x3ca6('0x49')][_0x3ca6('0x56')]){_0x491687[_0x3ca6('0x54')]=_[_0x3ca6('0x57')](_0x491687['where'],{'$or':_[_0x3ca6('0x42')](_0xbc4989,function(_0x456803){if(_0x456803[_0x3ca6('0x46')]!==_0x3ca6('0x58')){var _0x1b2cd0={};_0x1b2cd0[_0x456803[_0x3ca6('0x3e')]]={'$like':'%'+_0x53522c[_0x3ca6('0x49')]['filter']+'%'};return _0x1b2cd0;}})});}_0x491687=_['merge']({},_0x491687,_0x53522c[_0x3ca6('0x59')]);var _0x1be4ee={'where':_0x491687[_0x3ca6('0x54')]};return db[_0x3ca6('0x43')][_0x3ca6('0x34')](_0x1be4ee)['then'](function(_0x3f64b6){_0x38bc19[_0x3ca6('0x34')]=_0x3f64b6;if(_0x53522c['query'][_0x3ca6('0x5a')]){_0x491687[_0x3ca6('0x5b')]=[{'all':!![]}];}return db[_0x3ca6('0x43')][_0x3ca6('0x5c')](_0x491687);})[_0x3ca6('0x25')](function(_0x38f504){_0x38bc19['rows']=_0x38f504;return _0x38bc19;})[_0x3ca6('0x25')](respondWithFilteredResult(_0x3c85f8,_0x491687))[_0x3ca6('0x5d')](handleError(_0x3c85f8,null));};exports['show']=function(_0x4765f4,_0x3c933f){var _0x1c267d={'raw':![],'where':{'id':_0x4765f4[_0x3ca6('0x5e')]['id']},'include':[{'model':db[_0x3ca6('0x40')],'as':_0x3ca6('0x41')}]},_0x2995ff={};_0x2995ff[_0x3ca6('0x48')]=_[_0x3ca6('0x4a')](db[_0x3ca6('0x43')][_0x3ca6('0x44')]);_0x2995ff['query']=_[_0x3ca6('0x4a')](_0x4765f4[_0x3ca6('0x49')]);_0x2995ff['filters']=_['intersection'](_0x2995ff[_0x3ca6('0x48')],_0x2995ff[_0x3ca6('0x49')]);_0x1c267d[_0x3ca6('0x4d')]=_[_0x3ca6('0x4c')](_0x2995ff[_0x3ca6('0x48')],qs['fields'](_0x4765f4[_0x3ca6('0x49')][_0x3ca6('0x4e')]));_0x1c267d[_0x3ca6('0x4d')]=_0x1c267d['attributes'][_0x3ca6('0x4f')]?_0x1c267d[_0x3ca6('0x4d')]:_0x2995ff['model'];if(_0x4765f4[_0x3ca6('0x49')][_0x3ca6('0x5a')]){_0x1c267d[_0x3ca6('0x5b')]=[{'all':!![]}];}_0x1c267d=_[_0x3ca6('0x57')]({},_0x1c267d,_0x4765f4['options']);return db[_0x3ca6('0x43')][_0x3ca6('0x5f')](_0x1c267d)[_0x3ca6('0x25')](handleEntityNotFound(_0x3c933f,null))[_0x3ca6('0x25')](respondWithResult(_0x3c933f,null))[_0x3ca6('0x5d')](handleError(_0x3c933f,null));};exports[_0x3ca6('0x60')]=function(_0x4123aa,_0x4a390d){return db[_0x3ca6('0x43')][_0x3ca6('0x60')](_0x4123aa[_0x3ca6('0x61')],{})[_0x3ca6('0x25')](function(_0x51db2f){var _0x5b0de2=_0x4123aa[_0x3ca6('0x62')][_0x3ca6('0x3b')]({'plain':!![]});if(!_0x5b0de2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b0de2[_0x3ca6('0x63')]===_0x3ca6('0x62')){var _0x2af67b=_0x51db2f['get']({'plain':!![]});var _0x2f84ec=_0x3ca6('0x3c');return db[_0x3ca6('0x64')]['find']({'where':{'name':_0x2f84ec,'userProfileId':_0x5b0de2[_0x3ca6('0x65')]},'raw':!![]})[_0x3ca6('0x25')](function(_0x4e6ffb){if(_0x4e6ffb&&_0x4e6ffb['autoAssociation']===0x0){return db[_0x3ca6('0x66')][_0x3ca6('0x60')]({'name':_0x2af67b[_0x3ca6('0x3e')],'resourceId':_0x2af67b['id'],'type':_0x4e6ffb[_0x3ca6('0x3e')],'sectionId':_0x4e6ffb['id']},{})[_0x3ca6('0x25')](function(){return _0x51db2f;});}else{return _0x51db2f;}})['catch'](function(_0x664596){logger[_0x3ca6('0x2a')](_0x3ca6('0x67'),_0x664596);throw _0x664596;});}return _0x51db2f;})[_0x3ca6('0x25')](respondWithResult(_0x4a390d,0xc9))['catch'](handleError(_0x4a390d,null));};exports[_0x3ca6('0x68')]=function(_0x1dd8e0,_0x74b76c){if(_0x1dd8e0[_0x3ca6('0x61')]['id']){delete _0x1dd8e0[_0x3ca6('0x61')]['id'];}return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0x1dd8e0[_0x3ca6('0x5e')]['id']},'include':[{'model':db[_0x3ca6('0x40')],'as':_0x3ca6('0x41')}]})[_0x3ca6('0x25')](handleEntityNotFound(_0x74b76c,null))[_0x3ca6('0x25')](saveUpdates(_0x1dd8e0['body'],null))[_0x3ca6('0x25')](respondWithResult(_0x74b76c,null))['catch'](handleError(_0x74b76c,null));};exports[_0x3ca6('0x3a')]=function(_0xc91b86,_0x4c14bb){return db['SmsAccount'][_0x3ca6('0x5f')]({'where':{'id':_0xc91b86[_0x3ca6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4c14bb,null))[_0x3ca6('0x25')](removeEntity(_0x4c14bb,null))['catch'](handleError(_0x4c14bb,null));};exports['describe']=function(_0x372671,_0x470547){return db[_0x3ca6('0x43')][_0x3ca6('0x69')]()[_0x3ca6('0x25')](respondWithResult(_0x470547,null))[_0x3ca6('0x5d')](handleError(_0x470547,null));};exports[_0x3ca6('0x6a')]=function(_0x4ed993,_0x7ab0fc,_0x1c9c50){if(_0x4ed993[_0x3ca6('0x61')]['id']){delete _0x4ed993[_0x3ca6('0x61')]['id'];}return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0x4ed993[_0x3ca6('0x5e')]['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0x7ab0fc,null))['then'](function(_0x762ad8){if(_0x762ad8){_0x4ed993['body'][_0x3ca6('0x6b')]=_0x762ad8['id'];return db[_0x3ca6('0x6c')]['create'](_0x4ed993[_0x3ca6('0x61')]);}})[_0x3ca6('0x25')](respondWithResult(_0x7ab0fc,null))[_0x3ca6('0x5d')](handleError(_0x7ab0fc,null));};exports['getDispositions']=function(_0x58f409,_0x4334d5,_0x47373b){var _0x7993a1={'raw':![],'where':{}};var _0x17f573={};var _0x556f44={'count':0x0,'rows':[]};return db[_0x3ca6('0x43')][_0x3ca6('0x6d')]({'where':{'id':_0x58f409[_0x3ca6('0x5e')]['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0x4334d5,null))['then'](function(_0x256156){if(_0x256156){_0x17f573[_0x3ca6('0x48')]=_['keys'](db[_0x3ca6('0x6c')][_0x3ca6('0x44')]);_0x17f573[_0x3ca6('0x49')]=_[_0x3ca6('0x4a')](_0x58f409['query']);_0x17f573[_0x3ca6('0x4b')]=_['intersection'](_0x17f573[_0x3ca6('0x48')],_0x17f573[_0x3ca6('0x49')]);_0x7993a1['attributes']=_[_0x3ca6('0x4c')](_0x17f573[_0x3ca6('0x48')],qs[_0x3ca6('0x4e')](_0x58f409['query'][_0x3ca6('0x4e')]));_0x7993a1[_0x3ca6('0x4d')]=_0x7993a1[_0x3ca6('0x4d')][_0x3ca6('0x4f')]?_0x7993a1[_0x3ca6('0x4d')]:_0x17f573[_0x3ca6('0x48')];if(!_0x58f409[_0x3ca6('0x49')]['hasOwnProperty'](_0x3ca6('0x51'))){_0x7993a1[_0x3ca6('0x35')]=qs[_0x3ca6('0x35')](_0x58f409[_0x3ca6('0x49')][_0x3ca6('0x35')]);_0x7993a1[_0x3ca6('0x32')]=qs[_0x3ca6('0x32')](_0x58f409[_0x3ca6('0x49')][_0x3ca6('0x32')]);}_0x7993a1['order']=qs[_0x3ca6('0x53')](_0x58f409[_0x3ca6('0x49')]['sort']);_0x7993a1[_0x3ca6('0x54')]=qs['filters'](_[_0x3ca6('0x55')](_0x58f409['query'],_0x17f573['filters']));_0x7993a1[_0x3ca6('0x54')]['SmsAccountId']=_0x256156['id'];if(_0x58f409[_0x3ca6('0x49')][_0x3ca6('0x56')]){_0x7993a1[_0x3ca6('0x54')]=_[_0x3ca6('0x57')](_0x7993a1[_0x3ca6('0x54')],{'$or':_[_0x3ca6('0x42')](_0x7993a1['attributes'],function(_0x25c02e){var _0xa6c6d6={};_0xa6c6d6[_0x25c02e]={'$like':'%'+_0x58f409[_0x3ca6('0x49')][_0x3ca6('0x56')]+'%'};return _0xa6c6d6;})});}_0x7993a1=_[_0x3ca6('0x57')]({},_0x7993a1,_0x58f409[_0x3ca6('0x59')]);return db[_0x3ca6('0x6c')][_0x3ca6('0x34')]({'where':_0x7993a1['where']})[_0x3ca6('0x25')](function(_0x3bf25b){_0x556f44[_0x3ca6('0x34')]=_0x3bf25b;if(_0x58f409['query'][_0x3ca6('0x5a')]){_0x7993a1['include']=[{'all':!![]}];}return db[_0x3ca6('0x6c')][_0x3ca6('0x5c')](_0x7993a1);})['then'](function(_0x347413){_0x556f44['rows']=_0x347413;return _0x556f44;});}})[_0x3ca6('0x25')](respondWithFilteredResult(_0x4334d5,_0x7993a1))[_0x3ca6('0x5d')](handleError(_0x4334d5,null));};exports['removeDispositions']=function(_0x15440d,_0x22ce69,_0xf12f6e){return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0x15440d[_0x3ca6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x22ce69,null))[_0x3ca6('0x25')](function(_0x57cc52){if(_0x57cc52){return _0x57cc52['removeDispositions'](_0x15440d[_0x3ca6('0x49')]['ids']);}})[_0x3ca6('0x25')](respondWithStatusCode(_0x22ce69,null))['catch'](handleError(_0x22ce69,null));};exports['addAnswer']=function(_0x33861c,_0x1b1560,_0x25315c){if(_0x33861c[_0x3ca6('0x61')]['id']){delete _0x33861c[_0x3ca6('0x61')]['id'];}return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0x33861c[_0x3ca6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1b1560,null))['then'](function(_0x1169c7){if(_0x1169c7){_0x33861c['body'][_0x3ca6('0x6b')]=_0x1169c7['id'];return db[_0x3ca6('0x6e')][_0x3ca6('0x60')](_0x33861c['body']);}})[_0x3ca6('0x25')](respondWithResult(_0x1b1560,null))[_0x3ca6('0x5d')](handleError(_0x1b1560,null));};exports[_0x3ca6('0x6f')]=function(_0x5c6f17,_0x567008,_0x2e34c1){var _0x90c297={'raw':![],'where':{}};var _0xdfb9c8={};var _0xa0e7ab={'count':0x0,'rows':[]};return db[_0x3ca6('0x43')]['findOne']({'where':{'id':_0x5c6f17['params']['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0x567008,null))[_0x3ca6('0x25')](function(_0x25bad2){if(_0x25bad2){_0xdfb9c8[_0x3ca6('0x48')]=_[_0x3ca6('0x4a')](db[_0x3ca6('0x6e')]['rawAttributes']);_0xdfb9c8['query']=_['keys'](_0x5c6f17[_0x3ca6('0x49')]);_0xdfb9c8[_0x3ca6('0x4b')]=_['intersection'](_0xdfb9c8[_0x3ca6('0x48')],_0xdfb9c8[_0x3ca6('0x49')]);_0x90c297[_0x3ca6('0x4d')]=_[_0x3ca6('0x4c')](_0xdfb9c8['model'],qs['fields'](_0x5c6f17['query'][_0x3ca6('0x4e')]));_0x90c297[_0x3ca6('0x4d')]=_0x90c297[_0x3ca6('0x4d')][_0x3ca6('0x4f')]?_0x90c297[_0x3ca6('0x4d')]:_0xdfb9c8[_0x3ca6('0x48')];if(!_0x5c6f17[_0x3ca6('0x49')][_0x3ca6('0x50')]('nolimit')){_0x90c297[_0x3ca6('0x35')]=qs[_0x3ca6('0x35')](_0x5c6f17[_0x3ca6('0x49')][_0x3ca6('0x35')]);_0x90c297[_0x3ca6('0x32')]=qs[_0x3ca6('0x32')](_0x5c6f17[_0x3ca6('0x49')][_0x3ca6('0x32')]);}_0x90c297['order']=qs[_0x3ca6('0x53')](_0x5c6f17['query'][_0x3ca6('0x53')]);_0x90c297[_0x3ca6('0x54')]=qs[_0x3ca6('0x4b')](_['pick'](_0x5c6f17[_0x3ca6('0x49')],_0xdfb9c8[_0x3ca6('0x4b')]));_0x90c297['where'][_0x3ca6('0x6b')]=_0x25bad2['id'];if(_0x5c6f17[_0x3ca6('0x49')][_0x3ca6('0x56')]){_0x90c297['where']=_[_0x3ca6('0x57')](_0x90c297['where'],{'$or':_[_0x3ca6('0x42')](_0x90c297[_0x3ca6('0x4d')],function(_0x5e2b39){var _0x4bff58={};_0x4bff58[_0x5e2b39]={'$like':'%'+_0x5c6f17[_0x3ca6('0x49')][_0x3ca6('0x56')]+'%'};return _0x4bff58;})});}_0x90c297=_['merge']({},_0x90c297,_0x5c6f17[_0x3ca6('0x59')]);return db['CannedAnswer'][_0x3ca6('0x34')]({'where':_0x90c297[_0x3ca6('0x54')]})[_0x3ca6('0x25')](function(_0x9b268e){_0xa0e7ab[_0x3ca6('0x34')]=_0x9b268e;if(_0x5c6f17[_0x3ca6('0x49')][_0x3ca6('0x5a')]){_0x90c297[_0x3ca6('0x5b')]=[{'all':!![]}];}return db[_0x3ca6('0x6e')]['findAll'](_0x90c297);})[_0x3ca6('0x25')](function(_0xdaa46f){_0xa0e7ab[_0x3ca6('0x70')]=_0xdaa46f;return _0xa0e7ab;});}})[_0x3ca6('0x25')](respondWithFilteredResult(_0x567008,_0x90c297))[_0x3ca6('0x5d')](handleError(_0x567008,null));};exports[_0x3ca6('0x71')]=function(_0x78dac3,_0x3bbabc,_0x4f066a){return db['SmsAccount'][_0x3ca6('0x5f')]({'where':{'id':_0x78dac3[_0x3ca6('0x5e')]['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0x3bbabc,null))['then'](function(_0x13b4cc){if(_0x13b4cc){return _0x13b4cc[_0x3ca6('0x71')](_0x78dac3['query'][_0x3ca6('0x72')]);}})['then'](respondWithStatusCode(_0x3bbabc,null))[_0x3ca6('0x5d')](handleError(_0x3bbabc,null));};exports['notify']=function(_0x11b948,_0x509c77,_0x160a81){var _0x2f3a30={'channel':_0x3ca6('0x73')};var _0x266033=[];var _0x32ddad=[];var _0x29a434={};return db['SmsAccount'][_0x3ca6('0x5f')]({'where':{'id':_0x11b948[_0x3ca6('0x5e')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x3ca6('0x74')}]})[_0x3ca6('0x25')](handleEntityNotFound(_0x509c77,null))[_0x3ca6('0x25')](function(_0x4a72ff){_0x2f3a30[_0x3ca6('0x75')]=_0x4a72ff;_0x2f3a30[_0x3ca6('0x76')]=_['orderBy'](_0x4a72ff[_0x3ca6('0x74')],[_0x3ca6('0x77')],[_0x3ca6('0x78')]);if(_0x2f3a30[_0x3ca6('0x75')]['Applications']){delete _0x2f3a30['account'][_0x3ca6('0x74')];}return db[_0x3ca6('0x79')]['describe']();})[_0x3ca6('0x25')](function(_0xdb1910){if(!_0xdb1910){throw new db[(_0x3ca6('0x7a'))][(_0x3ca6('0x7b'))]('no\x20available\x20attributes');}_0x266033=_[_0x3ca6('0x7c')](_['keys'](_0xdb1910),[_0x3ca6('0x7d'),_0x3ca6('0x7e')]);_0x32ddad=_['difference'](_[_0x3ca6('0x4a')](_0xdb1910),[_0x3ca6('0x7d'),_0x3ca6('0x7e'),_0x3ca6('0x7f'),_0x3ca6('0x80')]);_0x2f3a30['body']={'mapKey':'mobile'};if(_0x2f3a30['account']['type']){switch(_0x2f3a30['account'][_0x3ca6('0x46')]){case'twilio':_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')]=_0x11b948[_0x3ca6('0x61')]['From'];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x61')]=_0x11b948['body'][_0x3ca6('0x82')];_0x2f3a30[_0x3ca6('0x61')]['messageId']=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x83')];break;case'skebby':_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')]='+'+_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x84')];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x61')]=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x85')];break;case _0x3ca6('0x86'):_0x2f3a30[_0x3ca6('0x61')]['from']=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x81')];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x61')]=_0x11b948[_0x3ca6('0x61')]['message'];break;case _0x3ca6('0x87'):_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')]=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x81')];_0x2f3a30['body']['body']=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x61')];_0x2f3a30['body']['messageId']=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x88')];break;case _0x3ca6('0x89'):_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')]=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x8a')];_0x2f3a30['body'][_0x3ca6('0x61')]=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x8b')];_0x2f3a30[_0x3ca6('0x61')]['messageId']=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x8c')];break;case _0x3ca6('0x8d'):_0x2f3a30['body'][_0x3ca6('0x81')]='+'+_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x8e')][0x0][_0x3ca6('0x81')];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x61')]=_0x11b948['body'][_0x3ca6('0x8e')][0x0][_0x3ca6('0x85')];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x8f')]=_0x11b948[_0x3ca6('0x61')]['results'][0x0][_0x3ca6('0x8f')];break;case'csc':_0x2f3a30['body'][_0x3ca6('0x81')]=_0x11b948['body']['originatingAddress'];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x61')]=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x90')]['message'];break;case'clickatell':_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')]=_0x11b948['body']['fromNumber'];_0x2f3a30[_0x3ca6('0x61')]['body']=_0x11b948['body']['text'];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x8f')]=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x91')];break;case _0x3ca6('0x92'):_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x8f')]=_0x11b948['body'][0x0]['message']['id'];_0x2f3a30[_0x3ca6('0x61')]['from']=_0x11b948['body'][0x0]['message'][_0x3ca6('0x81')];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x61')]=_0x11b948[_0x3ca6('0x61')][0x0][_0x3ca6('0x2c')][_0x3ca6('0x85')];break;case'intelepeer':_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')]=_0x11b948['body'][_0x3ca6('0x81')];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x61')]=_0x11b948[_0x3ca6('0x61')][_0x3ca6('0x2c')];_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x8f')]=_0x11b948['body'][_0x3ca6('0x93')];break;}}if(_0x2f3a30['body']['id']){delete _0x2f3a30['body']['id'];}if(_[_0x3ca6('0x94')](_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')])){throw new db[(_0x3ca6('0x7a'))][(_0x3ca6('0x7b'))](_0x3ca6('0x95'));}if(_['isNil'](_0x2f3a30[_0x3ca6('0x61')]['body'])||_0x2f3a30[_0x3ca6('0x61')]['body']===''){throw new db['Sequelize'][(_0x3ca6('0x7b'))](_0x3ca6('0x96'));}if(_[_0x3ca6('0x94')](_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x97')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x32ddad);}if(!_[_0x3ca6('0x98')](_0x32ddad,_0x2f3a30[_0x3ca6('0x61')]['mapKey'])){throw new db[(_0x3ca6('0x7a'))][(_0x3ca6('0x7b'))](_0x3ca6('0x99')+_0x32ddad);}_0x29a434[_0x2f3a30[_0x3ca6('0x61')]['mapKey']]=_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')];return db['CmList'][_0x3ca6('0x5f')]({'where':{'id':_0x2f3a30['account'][_0x3ca6('0x80')]},'include':[{'model':db[_0x3ca6('0x79')],'as':_0x3ca6('0x9a'),'where':_0x29a434,'limit':0x1,'order':[[_0x3ca6('0x7e'),_0x3ca6('0x9b')]]}]});})[_0x3ca6('0x25')](handleEntityNotFound(_0x509c77,null))[_0x3ca6('0x25')](function(_0x1e0426){if(_0x1e0426){_0x2f3a30['list']=_['omit'](_0x1e0426,['Contacts']);if(_0x1e0426[_0x3ca6('0x9a')][_0x3ca6('0x4f')]){return _0x1e0426[_0x3ca6('0x9a')][0x0];}var _0x5589b7=_[_0x3ca6('0x1d')](_0x2f3a30[_0x3ca6('0x61')],{'firstName':_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')],'ListId':_0x1e0426['id']});_0x5589b7[_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x97')]]=_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x81')];return db[_0x3ca6('0x79')][_0x3ca6('0x60')](_0x5589b7,{'fields':_0x266033,'raw':!![]});}})[_0x3ca6('0x25')](handleEntityNotFound(_0x509c77,null))['then'](function(_0x452418){if(_0x452418){_0x2f3a30[_0x3ca6('0x9c')]=_0x452418;var _0x2a6a4d={'ContactId':_0x452418['id'],'phone':_0x2f3a30[_0x3ca6('0x61')]['from'],'SmsAccountId':_0x11b948['params']['id']};var _0x133bfe={'ContactId':_0x452418['id'],'SmsAccountId':_0x11b948[_0x3ca6('0x5e')]['id'],'closed':![]};return db[_0x3ca6('0x9d')]['find']({'where':_0x133bfe})['then'](function(_0x18a40a){if(_0x18a40a){return[_0x18a40a,![]];}return db[_0x3ca6('0x9d')]['create'](_0x2a6a4d)['then'](function(_0x2a7a49){return[_0x2a7a49,!![]];});});}})[_0x3ca6('0x9e')](function(_0xe74156,_0x1a8bc0){_0x2f3a30[_0x3ca6('0x9f')]=_0xe74156[_0x3ca6('0x3b')]({'plain':!![]});_0x2f3a30['interaction'][_0x3ca6('0xa0')]=![];if(_0x1a8bc0){if(_0x2f3a30[_0x3ca6('0x75')][_0x3ca6('0xa1')]){_0x2f3a30['applications'][_0x3ca6('0xa2')]({'id':0x0,'priority':_0x2f3a30[_0x3ca6('0x76')][_0x3ca6('0x4f')]+0x1,'app':_0x3ca6('0xa3'),'appdata':_0x3ca6('0xa4'),'interval':'*,*,*,*'});}_0x2f3a30[_0x3ca6('0x9f')][_0x3ca6('0xa0')]=!![];}return db['SmsMessage']['create']({'phone':_0x2f3a30['body'][_0x3ca6('0x81')],'messageId':_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0x8f')],'body':_0x2f3a30[_0x3ca6('0x61')]['body'],'SmsAccountId':_0x11b948[_0x3ca6('0x5e')]['id'],'SmsInteractionId':_0xe74156['id'],'direction':'in','ContactId':_0xe74156[_0x3ca6('0xa5')],'AttachmentId':_0x2f3a30[_0x3ca6('0x61')][_0x3ca6('0xa6')]});})[_0x3ca6('0x25')](function(_0x2abd1f){_0x2f3a30[_0x3ca6('0x2c')]=_0x2abd1f;if(_0x2f3a30[_0x3ca6('0x9f')][_0x3ca6('0xa7')]){return db['User'][_0x3ca6('0x5f')]({'attributes':['id',_0x3ca6('0x3e')],'where':{'id':_0x2f3a30[_0x3ca6('0x9f')][_0x3ca6('0xa7')]}})['then'](function(_0x206a74){if(_0x206a74){_0x2f3a30['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x3ca6('0xa8'),'appdata':_0x206a74[_0x3ca6('0x3e')]+','+(_0x2f3a30[_0x3ca6('0x75')][_0x3ca6('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3ca6('0xaa'),_0x3ca6('0xab'),_0x2f3a30);});}return respondWithRpcPromise(_0x3ca6('0xaa'),_0x3ca6('0xab'),_0x2f3a30);})[_0x3ca6('0x25')](function(_0x407715){if(_0x407715){var _0x128eb3=0xc8;var _0x287346=_0x3ca6('0xac');logger[_0x3ca6('0x26')](_0x3ca6('0xad'),_0x287346,_0x128eb3,_0x3ca6('0xae'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x287346,_0x128eb3,'entity\x20found',JSON[_0x3ca6('0xaf')](_0x407715));if(_0x2f3a30[_0x3ca6('0x75')][_0x3ca6('0x46')]===_0x3ca6('0xb0')){return _0x509c77[_0x3ca6('0x2f')](_0x128eb3)[_0x3ca6('0x36')](_0x3ca6('0xb1'),'text/xml')[_0x3ca6('0xb2')](_0x3ca6('0xb3'));}else{return _0x509c77[_0x3ca6('0x2f')](_0x128eb3)[_0x3ca6('0x31')](_0x407715);}}})[_0x3ca6('0x5d')](handleError(_0x509c77,null));};exports[_0x3ca6('0xb4')]=function(_0x9508ad,_0x4546ee,_0x1e57d5){return db[_0x3ca6('0x43')][_0x3ca6('0x6d')]({'where':{'id':_0x9508ad[_0x3ca6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4546ee,null))[_0x3ca6('0x25')](function(_0x35ab31){if(_0x35ab31){return db[_0x3ca6('0xb5')]['transaction'](function(_0x270f9b){return db[_0x3ca6('0xb6')]['destroy']({'where':{'SmsAccountId':_0x9508ad[_0x3ca6('0x5e')]['id']},'transaction':_0x270f9b})[_0x3ca6('0x25')](function(_0x421660){var _0x48237d=_[_0x3ca6('0x42')](_0x9508ad['body'],function(_0xaabe9e){_0xaabe9e[_0x3ca6('0x6b')]=_0x9508ad['params']['id'];return _0xaabe9e;});return db['SmsApplication'][_0x3ca6('0xb7')](_0x48237d,{'transaction':_0x270f9b});});})[_0x3ca6('0x25')](function(){return db[_0x3ca6('0xb6')][_0x3ca6('0xb8')]({'where':{'SmsAccountId':_0x9508ad['params']['id']},'order':'priority'});});}})[_0x3ca6('0x25')](respondWithResult(_0x4546ee,null))[_0x3ca6('0x5d')](handleError(_0x4546ee,null));};exports['getApplications']=function(_0xd15a8e,_0x30debc,_0x3d79aa){var _0x3ced11={};var _0x3c424b={};var _0xf69e41;var _0x4b0668;return db['SmsAccount'][_0x3ca6('0x6d')]({'where':{'id':_0xd15a8e[_0x3ca6('0x5e')]['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0x30debc,null))[_0x3ca6('0x25')](function(_0x42bfcd){if(_0x42bfcd){_0xf69e41=_0x42bfcd;_0x3c424b[_0x3ca6('0x48')]=_[_0x3ca6('0x4a')](db[_0x3ca6('0xb6')][_0x3ca6('0x44')]);_0x3c424b[_0x3ca6('0x49')]=_[_0x3ca6('0x4a')](_0xd15a8e[_0x3ca6('0x49')]);_0x3c424b[_0x3ca6('0x4b')]=_['intersection'](_0x3c424b[_0x3ca6('0x48')],_0x3c424b[_0x3ca6('0x49')]);_0x3ced11[_0x3ca6('0x4d')]=_[_0x3ca6('0x4c')](_0x3c424b['model'],qs['fields'](_0xd15a8e['query'][_0x3ca6('0x4e')]));_0x3ced11[_0x3ca6('0x4d')]=_0x3ced11[_0x3ca6('0x4d')][_0x3ca6('0x4f')]?_0x3ced11[_0x3ca6('0x4d')]:_0x3c424b[_0x3ca6('0x48')];_0x3ced11['order']=qs['sort'](_0xd15a8e[_0x3ca6('0x49')][_0x3ca6('0x53')]);_0x3ced11[_0x3ca6('0x54')]=qs['filters'](_[_0x3ca6('0x55')](_0xd15a8e['query'],_0x3c424b[_0x3ca6('0x4b')]));if(_0xd15a8e[_0x3ca6('0x49')][_0x3ca6('0x56')]){_0x3ced11[_0x3ca6('0x54')]=_[_0x3ca6('0x57')](_0x3ced11['where'],{'$or':_[_0x3ca6('0x42')](_0x3ced11[_0x3ca6('0x4d')],function(_0x2a05e1){var _0x304710={};_0x304710[_0x2a05e1]={'$like':'%'+_0xd15a8e['query'][_0x3ca6('0x56')]+'%'};return _0x304710;})});}_0x3ced11=_[_0x3ca6('0x57')]({},_0x3ced11,_0xd15a8e['options']);return _0xf69e41['getApplications'](_0x3ced11);}})['then'](function(_0x451c38){if(_0x451c38){_0x4b0668=_0x451c38[_0x3ca6('0x4f')];if(!_0xd15a8e['query'][_0x3ca6('0x50')](_0x3ca6('0x51'))){_0x3ced11['limit']=qs['limit'](_0xd15a8e['query'][_0x3ca6('0x35')]);_0x3ced11[_0x3ca6('0x32')]=qs[_0x3ca6('0x32')](_0xd15a8e[_0x3ca6('0x49')][_0x3ca6('0x32')]);}return _0xf69e41[_0x3ca6('0xb9')](_0x3ced11);}})[_0x3ca6('0x25')](function(_0x49cc89){if(_0x49cc89){return _0x49cc89?{'count':_0x4b0668,'rows':_0x49cc89}:null;}})[_0x3ca6('0x25')](respondWithResult(_0x30debc,null))['catch'](handleError(_0x30debc,null));};exports['getInteractions']=function(_0x159e81,_0x38f18f,_0x1322fe){var _0x48bf6c={'raw':![],'where':{}};var _0x89086={};var _0x31af57={'count':0x0,'rows':[]};return db['SmsAccount'][_0x3ca6('0x6d')]({'where':{'id':_0x159e81['params']['id']}})['then'](handleEntityNotFound(_0x38f18f,null))[_0x3ca6('0x25')](function(_0x394771){if(_0x394771){_0x89086[_0x3ca6('0x48')]=_['keys'](db['SmsInteraction'][_0x3ca6('0x44')]);_0x89086[_0x3ca6('0x49')]=_[_0x3ca6('0x4a')](_0x159e81[_0x3ca6('0x49')]);_0x89086['filters']=_[_0x3ca6('0x4c')](_0x89086[_0x3ca6('0x48')],_0x89086[_0x3ca6('0x49')]);_0x48bf6c[_0x3ca6('0x4d')]=_[_0x3ca6('0x4c')](_0x89086[_0x3ca6('0x48')],qs[_0x3ca6('0x4e')](_0x159e81[_0x3ca6('0x49')][_0x3ca6('0x4e')]));_0x48bf6c[_0x3ca6('0x4d')]=_0x48bf6c['attributes'][_0x3ca6('0x4f')]?_0x48bf6c[_0x3ca6('0x4d')]:_0x89086[_0x3ca6('0x48')];if(!_0x159e81[_0x3ca6('0x49')][_0x3ca6('0x50')]('nolimit')){_0x48bf6c['limit']=qs[_0x3ca6('0x35')](_0x159e81[_0x3ca6('0x49')][_0x3ca6('0x35')]);_0x48bf6c[_0x3ca6('0x32')]=qs[_0x3ca6('0x32')](_0x159e81['query'][_0x3ca6('0x32')]);}_0x48bf6c[_0x3ca6('0x52')]=qs[_0x3ca6('0x53')](_0x159e81[_0x3ca6('0x49')][_0x3ca6('0x53')]);_0x48bf6c['where']=qs[_0x3ca6('0x4b')](_[_0x3ca6('0x55')](_0x159e81[_0x3ca6('0x49')],_0x89086[_0x3ca6('0x4b')]));_0x48bf6c[_0x3ca6('0x54')][_0x3ca6('0x6b')]=_0x394771['id'];if(_0x159e81['query'][_0x3ca6('0x56')]){_0x48bf6c[_0x3ca6('0x54')]=_[_0x3ca6('0x57')](_0x48bf6c['where'],{'$or':_['map'](_0x48bf6c[_0x3ca6('0x4d')],function(_0x3816e6){var _0x2a4b74={};_0x2a4b74[_0x3816e6]={'$like':'%'+_0x159e81[_0x3ca6('0x49')]['filter']+'%'};return _0x2a4b74;})});}_0x48bf6c=_[_0x3ca6('0x57')]({},_0x48bf6c,_0x159e81[_0x3ca6('0x59')]);return db[_0x3ca6('0x9d')][_0x3ca6('0x34')]({'where':_0x48bf6c[_0x3ca6('0x54')]})['then'](function(_0x3d5d73){_0x31af57[_0x3ca6('0x34')]=_0x3d5d73;if(_0x159e81['query'][_0x3ca6('0x5a')]){_0x48bf6c[_0x3ca6('0x5b')]=[{'model':db[_0x3ca6('0x79')],'as':_0x3ca6('0xba'),'required':![]},{'model':db[_0x3ca6('0xbb')],'as':_0x3ca6('0xbc'),'attributes':[_0x3ca6('0x3e'),_0x3ca6('0xbd'),_0x3ca6('0xbe')],'required':![]},{'model':db[_0x3ca6('0xbf')],'as':'Tags','attributes':['id','name','color'],'where':_0x159e81['query'][_0x3ca6('0xc0')]?{'id':_0x159e81[_0x3ca6('0x49')][_0x3ca6('0xc0')]}:undefined,'required':_0x159e81[_0x3ca6('0x49')][_0x3ca6('0xc0')]?!![]:![]}];}return db[_0x3ca6('0x9d')][_0x3ca6('0x5c')](_0x48bf6c);})['then'](function(_0x2ce2bb){_0x31af57[_0x3ca6('0x70')]=_0x2ce2bb;return _0x31af57;});}})[_0x3ca6('0x25')](respondWithFilteredResult(_0x38f18f,_0x48bf6c))['catch'](handleError(_0x38f18f,null));};exports['send']=function(_0x450f78,_0x139a8d,_0x3d3b6d){var _0x111a41,_0x845769,_0x48101f;if(_['isNil'](_0x450f78[_0x3ca6('0x61')][_0x3ca6('0x61')])||_0x450f78[_0x3ca6('0x61')][_0x3ca6('0x61')]===''){throw new db['Sequelize']['ValidationError'](_0x3ca6('0x96'));}if(_['isNil'](_0x450f78[_0x3ca6('0x61')]['to'])){throw new db[(_0x3ca6('0x7a'))]['ValidationError'](_0x3ca6('0xc1'));}_0x111a41=_0x450f78[_0x3ca6('0x61')]['to'];return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0x450f78[_0x3ca6('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0x3ca6('0xc2'),'include':[{'model':db[_0x3ca6('0x79')],'as':'Contacts','where':{'mobile':_0x111a41},'limit':0x1,'order':[[_0x3ca6('0x7e'),_0x3ca6('0x9b')]]}]}]})[_0x3ca6('0x25')](handleEntityNotFound(_0x139a8d,null))[_0x3ca6('0x25')](function(_0x245c92){if(_0x245c92&&_0x245c92[_0x3ca6('0xc2')]){_0x845769=_0x245c92[_0x3ca6('0x3b')]({'plain':!![]});if(_0x845769[_0x3ca6('0xc2')]&&_0x845769[_0x3ca6('0xc2')]['Contacts'][_0x3ca6('0x4f')]){return _0x845769[_0x3ca6('0xc2')][_0x3ca6('0x9a')][0x0];}return db['CmContact'][_0x3ca6('0x60')](_[_0x3ca6('0x1d')](_0x450f78['body'],{'firstName':_0x111a41,'mobile':_0x111a41,'phone':_0x111a41,'ListId':_0x845769['ListId']}));}})['then'](handleEntityNotFound(_0x139a8d,null))[_0x3ca6('0x25')](function(_0x350bd7){if(_0x350bd7){_0x48101f=_0x350bd7;return db[_0x3ca6('0x9d')]['find']({'where':{'ContactId':_0x48101f['id'],'closed':![],'SmsAccountId':_0x845769['id']}})[_0x3ca6('0x25')](function(_0x5ac401){if(_0x5ac401){return[_0x5ac401,![]];}return db[_0x3ca6('0x9d')][_0x3ca6('0x60')]({'UserId':_0x450f78['user']['id'],'ContactId':_0x48101f['id'],'SmsAccountId':_0x845769['id'],'phone':_0x111a41,'firstMsgDirection':'out','Messages':[_[_0x3ca6('0x57')](_0x450f78[_0x3ca6('0x61')],{'read':![],'body':_0x450f78[_0x3ca6('0x61')][_0x3ca6('0x61')],'phone':_0x111a41,'SmsAccountId':_0x845769['id'],'UserId':_0x450f78[_0x3ca6('0x62')]['id'],'ContactId':_0x48101f['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x3ca6('0x25')](function(_0x1d003e){return[_0x1d003e,!![]];});});}})[_0x3ca6('0x9e')](function(_0x15d68a,_0x406f47){if(_0x406f47){return _0x15d68a;}return db['SmsMessage'][_0x3ca6('0x60')](_[_0x3ca6('0x57')](_0x450f78[_0x3ca6('0x61')],{'read':![],'body':_0x450f78[_0x3ca6('0x61')][_0x3ca6('0x61')],'phone':_0x111a41,'SmsAccountId':_0x845769['id'],'SmsInteractionId':_0x15d68a['id'],'UserId':_0x450f78[_0x3ca6('0x62')]['id'],'ContactId':_0x48101f['id']}))[_0x3ca6('0x25')](function(_0x1c2540){_0x15d68a[_0x3ca6('0xc3')][_0x3ca6('0xc4')]=[];_0x15d68a[_0x3ca6('0xc3')][_0x3ca6('0xc4')]['push'](_0x1c2540['dataValues']);return _0x15d68a;});})[_0x3ca6('0x25')](respondWithResult(_0x139a8d,null))[_0x3ca6('0x5d')](handleError(_0x139a8d,null));};exports[_0x3ca6('0x2f')]=function(_0x5c6b20,_0xda5ab6,_0xe7dfdd){if(_0x5c6b20[_0x3ca6('0x61')]['id']){delete _0x5c6b20[_0x3ca6('0x61')]['id'];}var _0x981387,_0x163fa4,_0x561ff4;return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0x5c6b20['params']['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0xda5ab6,null))['then'](function(_0x1cc788){if(_0x1cc788){_0x561ff4=_0x1cc788;logger['debug'](_0x3ca6('0xad'),_0x3ca6('0x2f'),_0x3ca6('0xc5'),_0x1cc788['type'],util[_0x3ca6('0xc6')](_0x5c6b20[_0x3ca6('0x61')],{'showHidden':![],'depth':null}));switch(_0x1cc788[_0x3ca6('0x46')]){case _0x3ca6('0xc7'):if(_0x5c6b20[_0x3ca6('0x61')]['skebby_dispatch_id']&&_0x5c6b20['body'][_0x3ca6('0x2f')]){_0x163fa4=_0x5c6b20[_0x3ca6('0x61')]['status'];return db['SmsMessage'][_0x3ca6('0x5f')]({'where':{'messageId':_0x5c6b20[_0x3ca6('0x61')]['skebby_dispatch_id']}});}break;case _0x3ca6('0x86'):if(_0x5c6b20[_0x3ca6('0x61')]['requestid']&&_0x5c6b20['body'][_0x3ca6('0xc8')]){_0x163fa4=_0x5c6b20[_0x3ca6('0x61')]['statusInt'];return db[_0x3ca6('0xc9')][_0x3ca6('0x5f')]({'where':{'messageId':_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0xca')]}});}break;case _0x3ca6('0x87'):if(_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0x88')]&&_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0xcb')]){_0x163fa4=_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0xcb')];return db[_0x3ca6('0xc9')][_0x3ca6('0x5f')]({'where':{'messageId':_0x5c6b20[_0x3ca6('0x61')]['message_id']}});}break;case _0x3ca6('0x8d'):var _0x38fa54=_0x5c6b20[_0x3ca6('0x61')]['results'][0x0];if(_0x38fa54[_0x3ca6('0x8f')]&&_0x38fa54[_0x3ca6('0x2f')][_0x3ca6('0xcc')]==='DELIVERED'){_0x163fa4=_0x38fa54['status'][_0x3ca6('0xcc')];return db[_0x3ca6('0xc9')][_0x3ca6('0x5f')]({'where':{'messageId':_0x38fa54[_0x3ca6('0x8f')]}});}break;case _0x3ca6('0xcd'):if(_0x5c6b20['body'][_0x3ca6('0x8f')]&&_0x5c6b20[_0x3ca6('0x61')]['status']){_0x163fa4=_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0x8f')]}});}break;case _0x3ca6('0x92'):if(_0x5c6b20[_0x3ca6('0x61')][0x0][_0x3ca6('0x2c')]['id']){_0x163fa4=_0x5c6b20[_0x3ca6('0x61')][0x0][_0x3ca6('0x46')];return db[_0x3ca6('0xc9')][_0x3ca6('0x5f')]({'where':{'messageId':_0x5c6b20[_0x3ca6('0x61')][0x0][_0x3ca6('0x2c')]['id']}});}break;case'intelepeer':if(_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0xce')]&&_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0x2f')]){_0x163fa4=_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0xce')]}});}break;}}})[_0x3ca6('0x25')](handleEntityNotFound(_0xda5ab6,null))['then'](function(_0x366efa){if(_0x366efa){_0x981387=_0x366efa;switch(_0x561ff4[_0x3ca6('0x46')]){case _0x3ca6('0xc7'):if(_0x163fa4===_0x3ca6('0xcf')){return _0x981387[_0x3ca6('0x68')]({'read':!![]});}else{logger['error'](_0x3ca6('0xad'),'status',_0x3ca6('0xc7'),util['inspect'](_0x5c6b20[_0x3ca6('0x61')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x163fa4==='1'){return _0x981387['update']({'read':!![]});}else{logger[_0x3ca6('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x3ca6('0xc7'),util[_0x3ca6('0xc6')](_0x5c6b20['body'],{'showHidden':![],'depth':null}));}break;case _0x3ca6('0x87'):if(!_0x5c6b20[_0x3ca6('0x61')][_0x3ca6('0xd0')]&&_0x163fa4>=0xc8&&_0x163fa4<=0xce){return _0x981387[_0x3ca6('0x68')]({'read':!![]});}else{logger['error'](_0x3ca6('0xad'),_0x3ca6('0x2f'),'clicksend',util[_0x3ca6('0xc6')](_0x5c6b20[_0x3ca6('0x61')],{'showHidden':![],'depth':null}));}break;case _0x3ca6('0x8d'):var _0x294f91=_0x5c6b20[_0x3ca6('0x61')]['results'][0x0];if(_0x294f91[_0x3ca6('0x2f')][_0x3ca6('0xcc')]===_0x3ca6('0xcf')){return _0x981387[_0x3ca6('0x68')]({'read':!![]});}else{logger[_0x3ca6('0x2a')](_0x3ca6('0xad'),_0x3ca6('0x2f'),_0x3ca6('0x8d'),util['inspect'](_0x5c6b20[_0x3ca6('0x61')],{'showHidden':![],'depth':null}));}break;case _0x3ca6('0xcd'):if(_0x163fa4==_0x3ca6('0xd1')||_0x163fa4==_0x3ca6('0xd2')){return _0x981387[_0x3ca6('0x68')]({'read':!![]});}else{logger[_0x3ca6('0x2a')](_0x3ca6('0xad'),_0x3ca6('0x2f'),_0x3ca6('0xcd'),util[_0x3ca6('0xc6')](_0x5c6b20['body'],{'showHidden':![],'depth':null}));}break;case _0x3ca6('0x92'):if(_0x163fa4==_0x3ca6('0xd3')){return _0x981387[_0x3ca6('0x68')]({'read':!![]});}else{logger[_0x3ca6('0x2a')](_0x3ca6('0xad'),_0x3ca6('0x2f'),_0x3ca6('0x92'),util[_0x3ca6('0xc6')](_0x5c6b20[_0x3ca6('0x61')],{'showHidden':![],'depth':null}));}break;case _0x3ca6('0xd4'):if(_0x163fa4===_0x3ca6('0xd5')||_0x163fa4===_0x3ca6('0xd6')){return _0x981387[_0x3ca6('0x68')]({'read':!![]});}else{logger[_0x3ca6('0x2a')](_0x3ca6('0xad'),_0x3ca6('0x2f'),_0x3ca6('0xd4'),util[_0x3ca6('0xc6')](_0x5c6b20[_0x3ca6('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x981387;}})[_0x3ca6('0x25')](respondWithResult(_0xda5ab6,null))[_0x3ca6('0x5d')](handleError(_0xda5ab6,null));};exports[_0x3ca6('0xd7')]=function(_0xa5075e,_0x3c7f92,_0x34e0e0){var _0x248a48,_0xab6472,_0x25e2df;return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0xa5075e[_0x3ca6('0x5e')]['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0x3c7f92,null))[_0x3ca6('0x25')](function(_0x429449){if(_0x429449){_0x25e2df=_0x429449;logger[_0x3ca6('0x29')](_0x3ca6('0xad'),_0x3ca6('0x2f'),'received\x20delivery\x20report\x20from',_0x429449['type'],util[_0x3ca6('0xc6')](_0xa5075e[_0x3ca6('0x49')],{'showHidden':![],'depth':null}));switch(_0x429449[_0x3ca6('0x46')]){case _0x3ca6('0xd8'):if(_0xa5075e[_0x3ca6('0x49')][_0x3ca6('0xd9')]&&_0xa5075e[_0x3ca6('0x49')][_0x3ca6('0xda')]){_0xab6472=_0xa5075e[_0x3ca6('0x49')][_0x3ca6('0xda')];return db[_0x3ca6('0xc9')][_0x3ca6('0x5f')]({'where':{'messageId':_0xa5075e[_0x3ca6('0x49')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x3c7f92,null))[_0x3ca6('0x25')](function(_0x3b5b7e){if(_0x3b5b7e){_0x248a48=_0x3b5b7e;switch(_0x25e2df[_0x3ca6('0x46')]){case _0x3ca6('0xd8'):if(_0xab6472==='2'||_0xab6472==='6'){return _0x248a48['update']({'read':!![]});}else{logger[_0x3ca6('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3ca6('0x2f'),_0x3ca6('0xd8'),util['inspect'](_0xa5075e[_0x3ca6('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x248a48;}})['then'](respondWithResult(_0x3c7f92,null))['catch'](handleError(_0x3c7f92,null));};exports[_0x3ca6('0xdb')]=function(_0x3ff98c,_0x1ba8b0,_0x2a8ab9){return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0x3ff98c['params']['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0x1ba8b0,null))['then'](function(_0x207374){if(_0x207374){return _0x207374[_0x3ca6('0xdb')](_0x3ff98c[_0x3ca6('0x61')]['ids'],_[_0x3ca6('0xdc')](_0x3ff98c['body'],[_0x3ca6('0x72'),'id'])||{})[_0x3ca6('0x9e')](function(_0x202636){for(var _0x9b24d5=0x0;_0x9b24d5<_0x3ff98c[_0x3ca6('0x61')][_0x3ca6('0x72')][_0x3ca6('0x4f')];_0x9b24d5+=0x1){socket[_0x3ca6('0xdd')](_0x3ca6('0xde'),{'UserId':Number(_0x3ff98c[_0x3ca6('0x61')][_0x3ca6('0x72')][_0x9b24d5]),'SmsAccountId':Number(_0x3ff98c[_0x3ca6('0x5e')]['id'])});}return _0x202636;});}})[_0x3ca6('0x25')](respondWithResult(_0x1ba8b0,null))['catch'](handleError(_0x1ba8b0,null));};exports[_0x3ca6('0xdf')]=function(_0x454a3e,_0x34a38,_0x1dd0f7){return db[_0x3ca6('0x43')][_0x3ca6('0x5f')]({'where':{'id':_0x454a3e['params']['id']}})[_0x3ca6('0x25')](handleEntityNotFound(_0x34a38,null))['then'](function(_0x6352b1){if(_0x6352b1){return _0x6352b1[_0x3ca6('0xdf')](_0x454a3e[_0x3ca6('0x49')]['ids'])[_0x3ca6('0x25')](function(){if(_['isArray'](_0x454a3e[_0x3ca6('0x49')][_0x3ca6('0x72')])){for(var _0x173397=0x0;_0x173397<_0x454a3e[_0x3ca6('0x49')][_0x3ca6('0x72')]['length'];_0x173397+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x454a3e[_0x3ca6('0x49')][_0x3ca6('0x72')][_0x173397]),'SmsAccountId':Number(_0x454a3e[_0x3ca6('0x5e')]['id'])});}}else{socket[_0x3ca6('0xdd')](_0x3ca6('0xe0'),{'UserId':Number(_0x454a3e[_0x3ca6('0x49')][_0x3ca6('0x72')]),'SmsAccountId':Number(_0x454a3e['params']['id'])});}});}})[_0x3ca6('0x25')](respondWithStatusCode(_0x34a38,null))[_0x3ca6('0x5d')](handleError(_0x34a38,null));};exports[_0x3ca6('0xe1')]=function(_0x521409,_0x2535fe,_0x318dbb){var _0x464471={};var _0x3c4bfe={};var _0x93d8be;var _0x27d142;return db[_0x3ca6('0x43')][_0x3ca6('0x6d')]({'where':{'id':_0x521409['params']['id']}})['then'](handleEntityNotFound(_0x2535fe,null))['then'](function(_0x5dd376){if(_0x5dd376){_0x93d8be=_0x5dd376;_0x3c4bfe['model']=_[_0x3ca6('0x4a')](db['User']['rawAttributes']);_0x3c4bfe[_0x3ca6('0x49')]=_['keys'](_0x521409[_0x3ca6('0x49')]);_0x3c4bfe[_0x3ca6('0x4b')]=_[_0x3ca6('0x4c')](_0x3c4bfe[_0x3ca6('0x48')],_0x3c4bfe[_0x3ca6('0x49')]);_0x464471['attributes']=_[_0x3ca6('0x4c')](_0x3c4bfe[_0x3ca6('0x48')],qs[_0x3ca6('0x4e')](_0x521409[_0x3ca6('0x49')][_0x3ca6('0x4e')]));_0x464471[_0x3ca6('0x4d')]=_0x464471[_0x3ca6('0x4d')][_0x3ca6('0x4f')]?_0x464471[_0x3ca6('0x4d')]:_0x3c4bfe[_0x3ca6('0x48')];_0x464471['order']=qs['sort'](_0x521409[_0x3ca6('0x49')]['sort']);_0x464471[_0x3ca6('0x54')]=qs[_0x3ca6('0x4b')](_['pick'](_0x521409[_0x3ca6('0x49')],_0x3c4bfe[_0x3ca6('0x4b')]));if(_0x521409['query'][_0x3ca6('0x56')]){_0x464471['where']=_[_0x3ca6('0x57')](_0x464471['where'],{'$or':_[_0x3ca6('0x42')](_0x464471['attributes'],function(_0x40d501){var _0x147840={};_0x147840[_0x40d501]={'$like':'%'+_0x521409[_0x3ca6('0x49')][_0x3ca6('0x56')]+'%'};return _0x147840;})});}_0x464471=_[_0x3ca6('0x57')]({},_0x464471,_0x521409[_0x3ca6('0x59')]);return _0x93d8be['getAgents'](_0x464471);}})[_0x3ca6('0x25')](function(_0x1c90a3){if(_0x1c90a3){_0x27d142=_0x1c90a3[_0x3ca6('0x4f')];if(!_0x521409[_0x3ca6('0x49')][_0x3ca6('0x50')](_0x3ca6('0x51'))){_0x464471['limit']=qs[_0x3ca6('0x35')](_0x521409[_0x3ca6('0x49')][_0x3ca6('0x35')]);_0x464471[_0x3ca6('0x32')]=qs['offset'](_0x521409[_0x3ca6('0x49')][_0x3ca6('0x32')]);}return _0x93d8be['getAgents'](_0x464471);}})[_0x3ca6('0x25')](function(_0x29c59e){if(_0x29c59e){return _0x29c59e?{'count':_0x27d142,'rows':_0x29c59e}:null;}})[_0x3ca6('0x25')](respondWithResult(_0x2535fe,null))['catch'](handleError(_0x2535fe,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 367e00b..91cd203 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 _0x09f2=['emit','hasOwnProperty','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x14d05d,_0x5ef5c0){var _0x11e5d7=function(_0x446397){while(--_0x446397){_0x14d05d['push'](_0x14d05d['shift']());}};_0x11e5d7(++_0x5ef5c0);}(_0x09f2,0x1ca));var _0x209f=function(_0x1eb578,_0x14f617){_0x1eb578=_0x1eb578-0x0;var _0x5d1f47=_0x09f2[_0x1eb578];return _0x5d1f47;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x209f('0x0'))['db'][_0x209f('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x209f('0x2')](0x0);var events={'afterCreate':_0x209f('0x3'),'afterUpdate':_0x209f('0x4'),'afterDestroy':_0x209f('0x5')};function emitEvent(_0x53e4b1){return function(_0xfe06e2,_0x2adfae,_0xa08713){SmsAccountEvents['emit'](_0x53e4b1+':'+_0xfe06e2['id'],_0xfe06e2);SmsAccountEvents[_0x209f('0x6')](_0x53e4b1,_0xfe06e2);_0xa08713(null);};}for(var e in events){if(events[_0x209f('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xffca=['SmsAccount','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x466186,_0x2276fb){var _0x1ee9af=function(_0x5dd5f0){while(--_0x5dd5f0){_0x466186['push'](_0x466186['shift']());}};_0x1ee9af(++_0x2276fb);}(_0xffca,0x137));var _0xaffc=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xffca[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require(_0xaffc('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xaffc('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xaffc('0x2')](0x0);var events={'afterCreate':_0xaffc('0x3'),'afterUpdate':_0xaffc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x27043b){return function(_0x2669b0,_0x4d0f50,_0x118832){SmsAccountEvents[_0xaffc('0x5')](_0x27043b+':'+_0x2669b0['id'],_0x2669b0);SmsAccountEvents[_0xaffc('0x5')](_0x27043b,_0x2669b0);_0x118832(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xaffc('0x6')](e,emitEvent(event));}}module[_0xaffc('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5460e81..8bc4b1a 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 _0xff2f=['define','SmsAccount','sms_accounts','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0xe775be,_0x4822af){var _0x49e73c=function(_0x225efd){while(--_0x225efd){_0xe775be['push'](_0xe775be['shift']());}};_0x49e73c(++_0x4822af);}(_0xff2f,0x1e7));var _0xfff2=function(_0x493720,_0x2e7724){_0x493720=_0x493720-0x0;var _0x3cfc8e=_0xff2f[_0x493720];return _0x3cfc8e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfff2('0x0'))(_0xfff2('0x1'));var moment=require(_0xfff2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfff2('0x3'));var rimraf=require(_0xfff2('0x4'));var config=require(_0xfff2('0x5'));var attributes=require(_0xfff2('0x6'));module[_0xfff2('0x7')]=function(_0x14ccc6,_0x1c972c){return _0x14ccc6[_0xfff2('0x8')](_0xfff2('0x9'),attributes,{'tableName':_0xfff2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51d9=['sms_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x54a12c,_0x5d9fe5){var _0x114bbf=function(_0x4b3bf8){while(--_0x4b3bf8){_0x54a12c['push'](_0x54a12c['shift']());}};_0x114bbf(++_0x5d9fe5);}(_0x51d9,0x76));var _0x951d=function(_0x5a40ea,_0x79acf0){_0x5a40ea=_0x5a40ea-0x0;var _0xc1697a=_0x51d9[_0x5a40ea];return _0xc1697a;};'use strict';var _=require(_0x951d('0x0'));var util=require('util');var logger=require(_0x951d('0x1'))(_0x951d('0x2'));var moment=require(_0x951d('0x3'));var BPromise=require(_0x951d('0x4'));var rp=require(_0x951d('0x5'));var fs=require('fs');var path=require(_0x951d('0x6'));var rimraf=require('rimraf');var config=require(_0x951d('0x7'));var attributes=require(_0x951d('0x8'));module[_0x951d('0x9')]=function(_0x51f29c,_0x197b79){return _0x51f29c[_0x951d('0xa')](_0x951d('0xb'),attributes,{'tableName':_0x951d('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 2c0b195..344a792 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 _0x9277=['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','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x45655c,_0x407b81){var _0x24a8d9=function(_0x1624c7){while(--_0x1624c7){_0x45655c['push'](_0x45655c['shift']());}};_0x24a8d9(++_0x407b81);}(_0x9277,0x151));var _0x7927=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0x9277[_0x425b19];return _0x15ecab;};'use strict';var _=require(_0x7927('0x0'));var util=require(_0x7927('0x1'));var moment=require(_0x7927('0x2'));var BPromise=require(_0x7927('0x3'));var rs=require(_0x7927('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7927('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7927('0x6'))(_0x7927('0x7'));var config=require(_0x7927('0x8'));var jayson=require(_0x7927('0x9'));var client=jayson[_0x7927('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7927('0xb')](config[_0x7927('0xc')],{'host':_0x7927('0xd'),'port':0x18eb});var socket=require(_0x7927('0xe'))(new Redis(config['redis']));require(_0x7927('0xf'))[_0x7927('0x10')](socket);function respondWithRpcPromise(_0x38fb41,_0x305e80,_0xc1ade0){return new BPromise(function(_0x489f2d,_0x16bf69){return client[_0x7927('0x11')](_0x38fb41,_0xc1ade0)[_0x7927('0x12')](function(_0x63c2a2){logger['info'](_0x7927('0x13'),_0x305e80,_0x7927('0x14'));logger[_0x7927('0x15')](_0x7927('0x16'),_0x305e80,_0x7927('0x14'),JSON[_0x7927('0x17')](_0x63c2a2));if(_0x63c2a2[_0x7927('0x18')]){if(_0x63c2a2['error'][_0x7927('0x19')]===0x1f4){logger[_0x7927('0x18')](_0x7927('0x13'),_0x305e80,_0x63c2a2[_0x7927('0x18')][_0x7927('0x1a')]);return _0x16bf69(_0x63c2a2[_0x7927('0x18')][_0x7927('0x1a')]);}logger[_0x7927('0x18')](_0x7927('0x13'),_0x305e80,_0x63c2a2[_0x7927('0x18')][_0x7927('0x1a')]);return _0x489f2d(_0x63c2a2['error'][_0x7927('0x1a')]);}else{logger[_0x7927('0x1b')](_0x7927('0x13'),_0x305e80,_0x7927('0x14'));_0x489f2d(_0x63c2a2[_0x7927('0x1c')]['message']);}})[_0x7927('0x1d')](function(_0x158f1b){logger[_0x7927('0x18')](_0x7927('0x13'),_0x305e80,_0x158f1b);_0x16bf69(_0x158f1b);});});}exports[_0x7927('0x1e')]=function(_0x4a0200){var _0x5b92fc=this;return new Promise(function(_0x150e62,_0x335197){return db[_0x7927('0x1f')][_0x7927('0x20')]({'raw':_0x4a0200[_0x7927('0x21')]?_0x4a0200['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a0200[_0x7927('0x21')]?_0x4a0200['options'][_0x7927('0x22')]||null:null,'attributes':_0x4a0200[_0x7927('0x21')]?_0x4a0200[_0x7927('0x21')][_0x7927('0x23')]||null:null,'include':_0x4a0200[_0x7927('0x21')]?_0x4a0200[_0x7927('0x21')][_0x7927('0x24')]?_[_0x7927('0x25')](_0x4a0200[_0x7927('0x21')]['include'],function(_0x3864ac){return{'model':db[_0x3864ac[_0x7927('0x26')]],'as':_0x3864ac['as'],'attributes':_0x3864ac[_0x7927('0x23')],'include':_0x3864ac[_0x7927('0x24')]?_[_0x7927('0x25')](_0x3864ac[_0x7927('0x24')],function(_0x197c2e){return{'model':db[_0x197c2e[_0x7927('0x26')]],'as':_0x197c2e['as'],'attributes':_0x197c2e[_0x7927('0x23')],'include':_0x197c2e['include']?_['map'](_0x197c2e[_0x7927('0x24')],function(_0x45cdb7){return{'model':db[_0x45cdb7['model']],'as':_0x45cdb7['as'],'attributes':_0x45cdb7[_0x7927('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7927('0x12')](function(_0x5b044f){logger[_0x7927('0x1b')](_0x7927('0x1e'),_0x4a0200);logger[_0x7927('0x15')](_0x7927('0x1e'),_0x4a0200,JSON['stringify'](_0x5b044f));_0x150e62(_0x5b044f);})['catch'](function(_0x10b313){logger[_0x7927('0x18')](_0x7927('0x1e'),_0x10b313[_0x7927('0x1a')],_0x4a0200);_0x335197(_0x5b92fc[_0x7927('0x18')](0x1f4,_0x10b313[_0x7927('0x1a')]));});});}; \ No newline at end of file +var _0x275f=['raw','where','attributes','map','model','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','find','options'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0x275f,0x19d));var _0xf275=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x275f[_0x1ee9a1];return _0x21270f;};'use strict';var _=require(_0xf275('0x0'));var util=require(_0xf275('0x1'));var moment=require(_0xf275('0x2'));var BPromise=require(_0xf275('0x3'));var rs=require(_0xf275('0x4'));var fs=require('fs');var Redis=require(_0xf275('0x5'));var db=require(_0xf275('0x6'))['db'];var utils=require(_0xf275('0x7'));var logger=require(_0xf275('0x8'))('rpc');var config=require(_0xf275('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf275('0xa')][_0xf275('0xb')]({'port':0x232a});config[_0xf275('0xc')]=_[_0xf275('0xd')](config[_0xf275('0xc')],{'host':_0xf275('0xe'),'port':0x18eb});var socket=require(_0xf275('0xf'))(new Redis(config[_0xf275('0xc')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x595c9e,_0x2e92a0,_0x2031cf){return new BPromise(function(_0x4a2b31,_0x117c60){return client['request'](_0x595c9e,_0x2031cf)[_0xf275('0x10')](function(_0x5a4b5f){logger[_0xf275('0x11')]('SmsAccount,\x20%s,\x20%s',_0x2e92a0,_0xf275('0x12'));logger[_0xf275('0x13')](_0xf275('0x14'),_0x2e92a0,_0xf275('0x12'),JSON[_0xf275('0x15')](_0x5a4b5f));if(_0x5a4b5f[_0xf275('0x16')]){if(_0x5a4b5f[_0xf275('0x16')][_0xf275('0x17')]===0x1f4){logger[_0xf275('0x16')](_0xf275('0x18'),_0x2e92a0,_0x5a4b5f[_0xf275('0x16')][_0xf275('0x19')]);return _0x117c60(_0x5a4b5f[_0xf275('0x16')][_0xf275('0x19')]);}logger[_0xf275('0x16')](_0xf275('0x18'),_0x2e92a0,_0x5a4b5f['error']['message']);return _0x4a2b31(_0x5a4b5f[_0xf275('0x16')]['message']);}else{logger[_0xf275('0x11')](_0xf275('0x18'),_0x2e92a0,'request\x20sent');_0x4a2b31(_0x5a4b5f['result'][_0xf275('0x19')]);}})[_0xf275('0x1a')](function(_0x3030b7){logger[_0xf275('0x16')](_0xf275('0x18'),_0x2e92a0,_0x3030b7);_0x117c60(_0x3030b7);});});}exports[_0xf275('0x1b')]=function(_0x59f370){var _0x10537a=this;return new Promise(function(_0x180910,_0x1ac129){return db[_0xf275('0x1c')][_0xf275('0x1d')]({'raw':_0x59f370[_0xf275('0x1e')]?_0x59f370[_0xf275('0x1e')][_0xf275('0x1f')]===undefined?!![]:![]:!![],'where':_0x59f370[_0xf275('0x1e')]?_0x59f370[_0xf275('0x1e')][_0xf275('0x20')]||null:null,'attributes':_0x59f370['options']?_0x59f370[_0xf275('0x1e')][_0xf275('0x21')]||null:null,'include':_0x59f370[_0xf275('0x1e')]?_0x59f370[_0xf275('0x1e')]['include']?_[_0xf275('0x22')](_0x59f370['options']['include'],function(_0x84fa8d){return{'model':db[_0x84fa8d[_0xf275('0x23')]],'as':_0x84fa8d['as'],'attributes':_0x84fa8d[_0xf275('0x21')],'include':_0x84fa8d['include']?_['map'](_0x84fa8d[_0xf275('0x24')],function(_0x1fe67f){return{'model':db[_0x1fe67f[_0xf275('0x23')]],'as':_0x1fe67f['as'],'attributes':_0x1fe67f[_0xf275('0x21')],'include':_0x1fe67f[_0xf275('0x24')]?_[_0xf275('0x22')](_0x1fe67f[_0xf275('0x24')],function(_0x853505){return{'model':db[_0x853505[_0xf275('0x23')]],'as':_0x853505['as'],'attributes':_0x853505[_0xf275('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x303991){logger[_0xf275('0x11')](_0xf275('0x1b'),_0x59f370);logger['debug'](_0xf275('0x1b'),_0x59f370,JSON[_0xf275('0x15')](_0x303991));_0x180910(_0x303991);})[_0xf275('0x1a')](function(_0x4de7f5){logger[_0xf275('0x16')](_0xf275('0x1b'),_0x4de7f5[_0xf275('0x19')],_0x59f370);_0x1ac129(_0x10537a[_0xf275('0x16')](0x1f4,_0x4de7f5['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 36b9c77..fe44ed7 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 55eb768..4239b71 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(_0x2646ad,_0x2915ba){var _0x350cbb=function(_0x48a62c){while(--_0x48a62c){_0x2646ad['push'](_0x2646ad['shift']());}};_0x350cbb(++_0x2915ba);}(_0x3e74,0x175));var _0x43e7=function(_0x297a9a,_0x46047a){_0x297a9a=_0x297a9a-0x0;var _0x27d5fb=_0x3e74[_0x297a9a];return _0x27d5fb;};'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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0xb160c0,_0x36660d){var _0x3d7153=function(_0x19178c){while(--_0x19178c){_0xb160c0['push'](_0xb160c0['shift']());}};_0x3d7153(++_0x36660d);}(_0x55ca,0x126));var _0xa55c=function(_0x484cb9,_0x103489){_0x484cb9=_0x484cb9-0x0;var _0x59517e=_0x55ca[_0x484cb9];return _0x59517e;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('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 e1d7ff3..59982a7 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 _0x86e7=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0xe154ff,_0x112a21){var _0x12efc9=function(_0xbb6da8){while(--_0xbb6da8){_0xe154ff['push'](_0xe154ff['shift']());}};_0x12efc9(++_0x112a21);}(_0x86e7,0x1a4));var _0x786e=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x86e7[_0x2c1dcd];return _0x158ce5;};'use strict';var Sequelize=require(_0x786e('0x0'));module[_0x786e('0x1')]={'priority':{'type':Sequelize[_0x786e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x786e('0x3')],'allowNull':![],'defaultValue':_0x786e('0x4')},'appdata':{'type':Sequelize[_0x786e('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x786e('0x6')}}; \ No newline at end of file +var _0x95fc=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x5d613f,_0x110753){var _0x10ff27=function(_0x55a843){while(--_0x55a843){_0x5d613f['push'](_0x5d613f['shift']());}};_0x10ff27(++_0x110753);}(_0x95fc,0x1b8));var _0xc95f=function(_0x237c7f,_0x3a9366){_0x237c7f=_0x237c7f-0x0;var _0x3376f5=_0x95fc[_0x237c7f];return _0x3376f5;};'use strict';var Sequelize=require(_0xc95f('0x0'));module[_0xc95f('0x1')]={'priority':{'type':Sequelize[_0xc95f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc95f('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc95f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc95f('0x3')],'defaultValue':_0xc95f('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 35672c8..b3fb683 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 _0x8092=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','SmsApplication','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto'];(function(_0x3be010,_0x3c3db0){var _0x8b1ec1=function(_0x2a7fcd){while(--_0x2a7fcd){_0x3be010['push'](_0x3be010['shift']());}};_0x8b1ec1(++_0x3c3db0);}(_0x8092,0x122));var _0x2809=function(_0x236b7b,_0x4617f8){_0x236b7b=_0x236b7b-0x0;var _0xa327a7=_0x8092[_0x236b7b];return _0xa327a7;};'use strict';var emlformat=require(_0x2809('0x0'));var rimraf=require(_0x2809('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2809('0x2'));var rp=require(_0x2809('0x3'));var moment=require(_0x2809('0x4'));var BPromise=require(_0x2809('0x5'));var Mustache=require(_0x2809('0x6'));var util=require(_0x2809('0x7'));var path=require(_0x2809('0x8'));var sox=require(_0x2809('0x9'));var csv=require('to-csv');var ejs=require(_0x2809('0xa'));var fs=require('fs');var fs_extra=require(_0x2809('0xb'));var _=require('lodash');var squel=require(_0x2809('0xc'));var crypto=require(_0x2809('0xd'));var jsforce=require(_0x2809('0xe'));var deskjs=require(_0x2809('0xf'));var toCsv=require(_0x2809('0x10'));var querystring=require('querystring');var Papa=require(_0x2809('0x11'));var Redis=require(_0x2809('0x12'));var authService=require(_0x2809('0x13'));var qs=require(_0x2809('0x14'));var as=require(_0x2809('0x15'));var hardwareService=require(_0x2809('0x16'));var logger=require('../../config/logger')(_0x2809('0x17'));var utils=require(_0x2809('0x18'));var config=require(_0x2809('0x19'));var licenseUtil=require(_0x2809('0x1a'));var db=require(_0x2809('0x1b'))['db'];function respondWithStatusCode(_0x2cf1f3,_0x384ac9){_0x384ac9=_0x384ac9||0xcc;return function(_0x22c3b9){if(_0x22c3b9){return _0x2cf1f3[_0x2809('0x1c')](_0x384ac9);}return _0x2cf1f3['status'](_0x384ac9)['end']();};}function respondWithResult(_0xcab3c5,_0x1cdae8){_0x1cdae8=_0x1cdae8||0xc8;return function(_0x5bd7bf){if(_0x5bd7bf){return _0xcab3c5[_0x2809('0x1d')](_0x1cdae8)[_0x2809('0x1e')](_0x5bd7bf);}};}function respondWithFilteredResult(_0x4d9adf,_0x32ebc8){return function(_0x1047f2){if(_0x1047f2){var _0x1aac60=typeof _0x32ebc8[_0x2809('0x1f')]==='undefined'&&typeof _0x32ebc8[_0x2809('0x20')]===_0x2809('0x21');var _0x28272f=_0x1047f2[_0x2809('0x22')];var _0x552bdf=_0x1aac60?0x0:_0x32ebc8['offset'];var _0x2c7792=_0x1aac60?_0x1047f2[_0x2809('0x22')]:_0x32ebc8[_0x2809('0x1f')]+_0x32ebc8[_0x2809('0x20')];var _0x14c1ee;if(_0x2c7792>=_0x28272f){_0x2c7792=_0x28272f;_0x14c1ee=0xc8;}else{_0x14c1ee=0xce;}_0x4d9adf[_0x2809('0x1d')](_0x14c1ee);return _0x4d9adf[_0x2809('0x23')](_0x2809('0x24'),_0x552bdf+'-'+_0x2c7792+'/'+_0x28272f)[_0x2809('0x1e')](_0x1047f2);}return null;};}function patchUpdates(_0x53e473){return function(_0x3d7268){try{jsonpatch[_0x2809('0x25')](_0x3d7268,_0x53e473,!![]);}catch(_0x1b8c55){return BPromise['reject'](_0x1b8c55);}return _0x3d7268[_0x2809('0x26')]();};}function saveUpdates(_0x11dcae,_0x3020b1){return function(_0x19c3d0){if(_0x19c3d0){return _0x19c3d0[_0x2809('0x27')](_0x11dcae)[_0x2809('0x28')](function(_0x27d44b){return _0x27d44b;});}return null;};}function removeEntity(_0x42a565,_0x4416f9){return function(_0x3c0ff4){if(_0x3c0ff4){return _0x3c0ff4[_0x2809('0x29')]()[_0x2809('0x28')](function(){_0x42a565['status'](0xcc)[_0x2809('0x2a')]();});}};}function handleEntityNotFound(_0x553f1d,_0x541b2b){return function(_0x65d68d){if(!_0x65d68d){_0x553f1d[_0x2809('0x1c')](0x194);}return _0x65d68d;};}function handleError(_0x10e1da,_0x106992){_0x106992=_0x106992||0x1f4;return function(_0x5f03d2){logger[_0x2809('0x2b')](_0x5f03d2[_0x2809('0x2c')]);if(_0x5f03d2[_0x2809('0x2d')]){delete _0x5f03d2[_0x2809('0x2d')];}_0x10e1da[_0x2809('0x1d')](_0x106992)['send'](_0x5f03d2);};}exports[_0x2809('0x2e')]=function(_0x3ff586,_0x13e67b){var _0x17adff={},_0x3544eb={},_0x5d4ff2={'count':0x0,'rows':[]};var _0x4360d2=_[_0x2809('0x2f')](db[_0x2809('0x30')]['rawAttributes'],function(_0x452edc){return{'name':_0x452edc['fieldName'],'type':_0x452edc[_0x2809('0x31')][_0x2809('0x32')]};});_0x3544eb[_0x2809('0x33')]=_[_0x2809('0x2f')](_0x4360d2,_0x2809('0x2d'));_0x3544eb[_0x2809('0x34')]=_[_0x2809('0x35')](_0x3ff586[_0x2809('0x34')]);_0x3544eb[_0x2809('0x36')]=_[_0x2809('0x37')](_0x3544eb[_0x2809('0x33')],_0x3544eb['query']);_0x17adff[_0x2809('0x38')]=_['intersection'](_0x3544eb[_0x2809('0x33')],qs['fields'](_0x3ff586['query'][_0x2809('0x39')]));_0x17adff['attributes']=_0x17adff[_0x2809('0x38')]['length']?_0x17adff['attributes']:_0x3544eb['model'];if(!_0x3ff586['query'][_0x2809('0x3a')](_0x2809('0x3b'))){_0x17adff[_0x2809('0x20')]=qs[_0x2809('0x20')](_0x3ff586[_0x2809('0x34')][_0x2809('0x20')]);_0x17adff[_0x2809('0x1f')]=qs[_0x2809('0x1f')](_0x3ff586[_0x2809('0x34')][_0x2809('0x1f')]);}_0x17adff[_0x2809('0x3c')]=qs[_0x2809('0x3d')](_0x3ff586[_0x2809('0x34')][_0x2809('0x3d')]);_0x17adff[_0x2809('0x3e')]=qs[_0x2809('0x36')](_[_0x2809('0x3f')](_0x3ff586[_0x2809('0x34')],_0x3544eb[_0x2809('0x36')]),_0x4360d2);if(_0x3ff586[_0x2809('0x34')][_0x2809('0x40')]){_0x17adff[_0x2809('0x3e')]=_[_0x2809('0x41')](_0x17adff['where'],{'$or':_[_0x2809('0x2f')](_0x4360d2,function(_0x401c68){if(_0x401c68[_0x2809('0x31')]!=='VIRTUAL'){var _0x4a1f39={};_0x4a1f39[_0x401c68[_0x2809('0x2d')]]={'$like':'%'+_0x3ff586[_0x2809('0x34')][_0x2809('0x40')]+'%'};return _0x4a1f39;}})});}_0x17adff=_[_0x2809('0x41')]({},_0x17adff,_0x3ff586[_0x2809('0x42')]);var _0x5104f6={'where':_0x17adff[_0x2809('0x3e')]};return db[_0x2809('0x30')]['count'](_0x5104f6)[_0x2809('0x28')](function(_0x202d19){_0x5d4ff2[_0x2809('0x22')]=_0x202d19;if(_0x3ff586['query'][_0x2809('0x43')]){_0x17adff[_0x2809('0x44')]=[{'all':!![]}];}return db[_0x2809('0x30')]['findAll'](_0x17adff);})['then'](function(_0x5057ff){_0x5d4ff2['rows']=_0x5057ff;return _0x5d4ff2;})[_0x2809('0x28')](respondWithFilteredResult(_0x13e67b,_0x17adff))['catch'](handleError(_0x13e67b,null));};exports[_0x2809('0x45')]=function(_0x11776d,_0x36c516){var _0x3ce79e={'raw':!![],'where':{'id':_0x11776d[_0x2809('0x46')]['id']}},_0x4e072c={};_0x4e072c[_0x2809('0x33')]=_[_0x2809('0x35')](db[_0x2809('0x30')][_0x2809('0x47')]);_0x4e072c[_0x2809('0x34')]=_[_0x2809('0x35')](_0x11776d[_0x2809('0x34')]);_0x4e072c[_0x2809('0x36')]=_['intersection'](_0x4e072c[_0x2809('0x33')],_0x4e072c[_0x2809('0x34')]);_0x3ce79e[_0x2809('0x38')]=_[_0x2809('0x37')](_0x4e072c[_0x2809('0x33')],qs[_0x2809('0x39')](_0x11776d['query'][_0x2809('0x39')]));_0x3ce79e[_0x2809('0x38')]=_0x3ce79e['attributes']['length']?_0x3ce79e['attributes']:_0x4e072c['model'];if(_0x11776d[_0x2809('0x34')]['includeAll']){_0x3ce79e[_0x2809('0x44')]=[{'all':!![]}];}_0x3ce79e=_['merge']({},_0x3ce79e,_0x11776d[_0x2809('0x42')]);return db[_0x2809('0x30')][_0x2809('0x48')](_0x3ce79e)['then'](handleEntityNotFound(_0x36c516,null))[_0x2809('0x28')](respondWithResult(_0x36c516,null))[_0x2809('0x49')](handleError(_0x36c516,null));};exports[_0x2809('0x4a')]=function(_0x288176,_0x110add){return db[_0x2809('0x30')]['create'](_0x288176[_0x2809('0x4b')],{})['then'](respondWithResult(_0x110add,0xc9))[_0x2809('0x49')](handleError(_0x110add,null));};exports[_0x2809('0x27')]=function(_0x20a81c,_0x3fe8ff){if(_0x20a81c[_0x2809('0x4b')]['id']){delete _0x20a81c[_0x2809('0x4b')]['id'];}return db[_0x2809('0x30')]['find']({'where':{'id':_0x20a81c[_0x2809('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fe8ff,null))[_0x2809('0x28')](saveUpdates(_0x20a81c[_0x2809('0x4b')],null))[_0x2809('0x28')](respondWithResult(_0x3fe8ff,null))[_0x2809('0x49')](handleError(_0x3fe8ff,null));};exports[_0x2809('0x29')]=function(_0x3ad9d8,_0x4ea9a6){return db[_0x2809('0x30')][_0x2809('0x48')]({'where':{'id':_0x3ad9d8['params']['id']}})[_0x2809('0x28')](handleEntityNotFound(_0x4ea9a6,null))['then'](removeEntity(_0x4ea9a6,null))['catch'](handleError(_0x4ea9a6,null));}; \ No newline at end of file +var _0x8406=['includeAll','include','findAll','rows','catch','filters','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','update','destroy','then','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x8406,0x177));var _0x6840=function(_0x1b17cf,_0x4ec01a){_0x1b17cf=_0x1b17cf-0x0;var _0x25639b=_0x8406[_0x1b17cf];return _0x25639b;};'use strict';var emlformat=require(_0x6840('0x0'));var rimraf=require(_0x6840('0x1'));var zipdir=require(_0x6840('0x2'));var jsonpatch=require(_0x6840('0x3'));var rp=require(_0x6840('0x4'));var moment=require(_0x6840('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6840('0x6'));var util=require(_0x6840('0x7'));var path=require(_0x6840('0x8'));var sox=require('sox');var csv=require(_0x6840('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6840('0xa'));var squel=require(_0x6840('0xb'));var crypto=require('crypto');var jsforce=require(_0x6840('0xc'));var deskjs=require(_0x6840('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6840('0xe'));var Papa=require(_0x6840('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6840('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6840('0x11'))(_0x6840('0x12'));var utils=require(_0x6840('0x13'));var config=require(_0x6840('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6840('0x15'))['db'];function respondWithStatusCode(_0x58b87b,_0x215ec3){_0x215ec3=_0x215ec3||0xcc;return function(_0x3b40c5){if(_0x3b40c5){return _0x58b87b[_0x6840('0x16')](_0x215ec3);}return _0x58b87b[_0x6840('0x17')](_0x215ec3)[_0x6840('0x18')]();};}function respondWithResult(_0x4709fa,_0x4c4938){_0x4c4938=_0x4c4938||0xc8;return function(_0x3b1681){if(_0x3b1681){return _0x4709fa[_0x6840('0x17')](_0x4c4938)['json'](_0x3b1681);}};}function respondWithFilteredResult(_0x53b825,_0x1c6430){return function(_0x5c4d7f){if(_0x5c4d7f){var _0xaf4af6=typeof _0x1c6430[_0x6840('0x19')]===_0x6840('0x1a')&&typeof _0x1c6430[_0x6840('0x1b')]===_0x6840('0x1a');var _0x127ebc=_0x5c4d7f['count'];var _0x516152=_0xaf4af6?0x0:_0x1c6430['offset'];var _0xa97cc9=_0xaf4af6?_0x5c4d7f['count']:_0x1c6430['offset']+_0x1c6430[_0x6840('0x1b')];var _0x3e4cc3;if(_0xa97cc9>=_0x127ebc){_0xa97cc9=_0x127ebc;_0x3e4cc3=0xc8;}else{_0x3e4cc3=0xce;}_0x53b825[_0x6840('0x17')](_0x3e4cc3);return _0x53b825[_0x6840('0x1c')](_0x6840('0x1d'),_0x516152+'-'+_0xa97cc9+'/'+_0x127ebc)[_0x6840('0x1e')](_0x5c4d7f);}return null;};}function patchUpdates(_0x34b312){return function(_0x126460){try{jsonpatch[_0x6840('0x1f')](_0x126460,_0x34b312,!![]);}catch(_0x3f318c){return BPromise['reject'](_0x3f318c);}return _0x126460[_0x6840('0x20')]();};}function saveUpdates(_0x3380b5,_0xa8fb82){return function(_0x223404){if(_0x223404){return _0x223404[_0x6840('0x21')](_0x3380b5)['then'](function(_0x1d17d0){return _0x1d17d0;});}return null;};}function removeEntity(_0x534ad2,_0x4760ed){return function(_0x2c259b){if(_0x2c259b){return _0x2c259b[_0x6840('0x22')]()[_0x6840('0x23')](function(){_0x534ad2[_0x6840('0x17')](0xcc)[_0x6840('0x18')]();});}};}function handleEntityNotFound(_0x420134,_0x5f24a0){return function(_0x560037){if(!_0x560037){_0x420134[_0x6840('0x16')](0x194);}return _0x560037;};}function handleError(_0x528c65,_0x212736){_0x212736=_0x212736||0x1f4;return function(_0x27cc63){logger['error'](_0x27cc63[_0x6840('0x24')]);if(_0x27cc63[_0x6840('0x25')]){delete _0x27cc63[_0x6840('0x25')];}_0x528c65[_0x6840('0x17')](_0x212736)[_0x6840('0x26')](_0x27cc63);};}exports[_0x6840('0x27')]=function(_0x45823f,_0x2916af){var _0x246860={},_0x3dc1bf={},_0x580cf5={'count':0x0,'rows':[]};var _0x3e7078=_[_0x6840('0x28')](db[_0x6840('0x29')][_0x6840('0x2a')],function(_0xfcef31){return{'name':_0xfcef31[_0x6840('0x2b')],'type':_0xfcef31['type'][_0x6840('0x2c')]};});_0x3dc1bf[_0x6840('0x2d')]=_[_0x6840('0x28')](_0x3e7078,_0x6840('0x25'));_0x3dc1bf[_0x6840('0x2e')]=_[_0x6840('0x2f')](_0x45823f['query']);_0x3dc1bf['filters']=_['intersection'](_0x3dc1bf[_0x6840('0x2d')],_0x3dc1bf[_0x6840('0x2e')]);_0x246860[_0x6840('0x30')]=_[_0x6840('0x31')](_0x3dc1bf['model'],qs[_0x6840('0x32')](_0x45823f[_0x6840('0x2e')][_0x6840('0x32')]));_0x246860[_0x6840('0x30')]=_0x246860[_0x6840('0x30')][_0x6840('0x33')]?_0x246860[_0x6840('0x30')]:_0x3dc1bf[_0x6840('0x2d')];if(!_0x45823f[_0x6840('0x2e')][_0x6840('0x34')](_0x6840('0x35'))){_0x246860['limit']=qs[_0x6840('0x1b')](_0x45823f['query'][_0x6840('0x1b')]);_0x246860[_0x6840('0x19')]=qs[_0x6840('0x19')](_0x45823f[_0x6840('0x2e')][_0x6840('0x19')]);}_0x246860[_0x6840('0x36')]=qs[_0x6840('0x37')](_0x45823f['query'][_0x6840('0x37')]);_0x246860['where']=qs['filters'](_[_0x6840('0x38')](_0x45823f[_0x6840('0x2e')],_0x3dc1bf['filters']),_0x3e7078);if(_0x45823f[_0x6840('0x2e')][_0x6840('0x39')]){_0x246860[_0x6840('0x3a')]=_[_0x6840('0x3b')](_0x246860[_0x6840('0x3a')],{'$or':_[_0x6840('0x28')](_0x3e7078,function(_0x517e2c){if(_0x517e2c['type']!==_0x6840('0x3c')){var _0x18bc49={};_0x18bc49[_0x517e2c['name']]={'$like':'%'+_0x45823f[_0x6840('0x2e')][_0x6840('0x39')]+'%'};return _0x18bc49;}})});}_0x246860=_[_0x6840('0x3b')]({},_0x246860,_0x45823f[_0x6840('0x3d')]);var _0x7ea281={'where':_0x246860[_0x6840('0x3a')]};return db[_0x6840('0x29')][_0x6840('0x3e')](_0x7ea281)[_0x6840('0x23')](function(_0x2ad238){_0x580cf5[_0x6840('0x3e')]=_0x2ad238;if(_0x45823f['query'][_0x6840('0x3f')]){_0x246860[_0x6840('0x40')]=[{'all':!![]}];}return db[_0x6840('0x29')][_0x6840('0x41')](_0x246860);})['then'](function(_0x2278e3){_0x580cf5[_0x6840('0x42')]=_0x2278e3;return _0x580cf5;})[_0x6840('0x23')](respondWithFilteredResult(_0x2916af,_0x246860))[_0x6840('0x43')](handleError(_0x2916af,null));};exports['show']=function(_0x27d6b8,_0x283ebc){var _0x32a266={'raw':!![],'where':{'id':_0x27d6b8['params']['id']}},_0x2476af={};_0x2476af[_0x6840('0x2d')]=_[_0x6840('0x2f')](db[_0x6840('0x29')]['rawAttributes']);_0x2476af['query']=_[_0x6840('0x2f')](_0x27d6b8[_0x6840('0x2e')]);_0x2476af[_0x6840('0x44')]=_[_0x6840('0x31')](_0x2476af[_0x6840('0x2d')],_0x2476af['query']);_0x32a266[_0x6840('0x30')]=_[_0x6840('0x31')](_0x2476af['model'],qs[_0x6840('0x32')](_0x27d6b8[_0x6840('0x2e')][_0x6840('0x32')]));_0x32a266[_0x6840('0x30')]=_0x32a266['attributes'][_0x6840('0x33')]?_0x32a266['attributes']:_0x2476af[_0x6840('0x2d')];if(_0x27d6b8[_0x6840('0x2e')][_0x6840('0x3f')]){_0x32a266[_0x6840('0x40')]=[{'all':!![]}];}_0x32a266=_[_0x6840('0x3b')]({},_0x32a266,_0x27d6b8[_0x6840('0x3d')]);return db['SmsApplication'][_0x6840('0x45')](_0x32a266)['then'](handleEntityNotFound(_0x283ebc,null))[_0x6840('0x23')](respondWithResult(_0x283ebc,null))[_0x6840('0x43')](handleError(_0x283ebc,null));};exports[_0x6840('0x46')]=function(_0xb7655e,_0x307cb4){return db['SmsApplication'][_0x6840('0x46')](_0xb7655e[_0x6840('0x47')],{})[_0x6840('0x23')](respondWithResult(_0x307cb4,0xc9))['catch'](handleError(_0x307cb4,null));};exports[_0x6840('0x21')]=function(_0x5f4367,_0x3d7b72){if(_0x5f4367[_0x6840('0x47')]['id']){delete _0x5f4367['body']['id'];}return db['SmsApplication'][_0x6840('0x45')]({'where':{'id':_0x5f4367[_0x6840('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d7b72,null))[_0x6840('0x23')](saveUpdates(_0x5f4367['body'],null))[_0x6840('0x23')](respondWithResult(_0x3d7b72,null))[_0x6840('0x43')](handleError(_0x3d7b72,null));};exports['destroy']=function(_0x280b26,_0x1280fe){return db[_0x6840('0x29')][_0x6840('0x45')]({'where':{'id':_0x280b26['params']['id']}})[_0x6840('0x23')](handleEntityNotFound(_0x1280fe,null))['then'](removeEntity(_0x1280fe,null))[_0x6840('0x43')](handleError(_0x1280fe,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 076301a..690944e 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 _0xf555=['path','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise'];(function(_0x288c1c,_0x583bfe){var _0x1fbb27=function(_0x1ced94){while(--_0x1ced94){_0x288c1c['push'](_0x288c1c['shift']());}};_0x1fbb27(++_0x583bfe);}(_0xf555,0x97));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f55('0x0'));var util=require(_0x5f55('0x1'));var logger=require('../../config/logger')(_0x5f55('0x2'));var moment=require('moment');var BPromise=require(_0x5f55('0x3'));var rp=require(_0x5f55('0x4'));var fs=require('fs');var path=require(_0x5f55('0x5'));var rimraf=require('rimraf');var config=require(_0x5f55('0x6'));var attributes=require(_0x5f55('0x7'));module['exports']=function(_0x2c6a58,_0x113537){return _0x2c6a58[_0x5f55('0x8')](_0x5f55('0x9'),attributes,{'tableName':_0x5f55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f55('0xb'),'collate':_0x5f55('0xc')});}; \ No newline at end of file +var _0x6ed3=['api','moment','bluebird','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x48128f,_0x2bd912){var _0x496bb3=function(_0x4aa942){while(--_0x4aa942){_0x48128f['push'](_0x48128f['shift']());}};_0x496bb3(++_0x2bd912);}(_0x6ed3,0xbb));var _0x36ed=function(_0x3e6dac,_0x5ee8de){_0x3e6dac=_0x3e6dac-0x0;var _0x4f9783=_0x6ed3[_0x3e6dac];return _0x4f9783;};'use strict';var _=require(_0x36ed('0x0'));var util=require(_0x36ed('0x1'));var logger=require('../../config/logger')(_0x36ed('0x2'));var moment=require(_0x36ed('0x3'));var BPromise=require(_0x36ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x36ed('0x5'));var config=require(_0x36ed('0x6'));var attributes=require('./smsApplication.attributes');module[_0x36ed('0x7')]=function(_0x13d7f2,_0x1171b9){return _0x13d7f2[_0x36ed('0x8')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 c93f8b4..92acdc2 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 _0xb5fb=['request','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x319412,_0x3e5995){var _0x2d78b3=function(_0x295ed6){while(--_0x295ed6){_0x319412['push'](_0x319412['shift']());}};_0x2d78b3(++_0x3e5995);}(_0xb5fb,0x172));var _0xbb5f=function(_0x2ee93b,_0x82445f){_0x2ee93b=_0x2ee93b-0x0;var _0x37c343=_0xb5fb[_0x2ee93b];return _0x37c343;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require(_0xbb5f('0xa'));var jayson=require(_0xbb5f('0xb'));var client=jayson[_0xbb5f('0xc')][_0xbb5f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487a1a,_0x597050,_0x317cd9){return new BPromise(function(_0x5e7943,_0x5b91){return client[_0xbb5f('0xe')](_0x487a1a,_0x317cd9)['then'](function(_0x4f13a9){logger[_0xbb5f('0xf')]('SmsApplication,\x20%s,\x20%s',_0x597050,_0xbb5f('0x10'));logger[_0xbb5f('0x11')](_0xbb5f('0x12'),_0x597050,_0xbb5f('0x10'),JSON[_0xbb5f('0x13')](_0x4f13a9));if(_0x4f13a9[_0xbb5f('0x14')]){if(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x15')]===0x1f4){logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9['error'][_0xbb5f('0x17')]);return _0x5b91(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9[_0xbb5f('0x14')]['message']);return _0x5e7943(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}else{logger[_0xbb5f('0xf')](_0xbb5f('0x16'),_0x597050,'request\x20sent');_0x5e7943(_0x4f13a9['result'][_0xbb5f('0x17')]);}})['catch'](function(_0xdf4ec8){logger[_0xbb5f('0x14')]('SmsApplication,\x20%s,\x20%s',_0x597050,_0xdf4ec8);_0x5b91(_0xdf4ec8);});});} \ No newline at end of file +var _0x723c=['then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','SmsApplication,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xd54ba0,_0x3446da){var _0x16952f=function(_0xccf172){while(--_0xccf172){_0xd54ba0['push'](_0xd54ba0['shift']());}};_0x16952f(++_0x3446da);}(_0x723c,0x1ad));var _0xc723=function(_0x10ad01,_0x2a39d1){_0x10ad01=_0x10ad01-0x0;var _0x59ed66=_0x723c[_0x10ad01];return _0x59ed66;};'use strict';var _=require('lodash');var util=require(_0xc723('0x0'));var moment=require(_0xc723('0x1'));var BPromise=require('bluebird');var rs=require(_0xc723('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc723('0x3'))['db'];var utils=require(_0xc723('0x4'));var logger=require(_0xc723('0x5'))(_0xc723('0x6'));var config=require(_0xc723('0x7'));var jayson=require(_0xc723('0x8'));var client=jayson[_0xc723('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x94e3de,_0x3e887f,_0x5e9c74){return new BPromise(function(_0x199e04,_0xe4e485){return client[_0xc723('0xa')](_0x94e3de,_0x5e9c74)[_0xc723('0xb')](function(_0x3d17ff){logger['info']('SmsApplication,\x20%s,\x20%s',_0x3e887f,_0xc723('0xc'));logger[_0xc723('0xd')](_0xc723('0xe'),_0x3e887f,_0xc723('0xc'),JSON['stringify'](_0x3d17ff));if(_0x3d17ff[_0xc723('0xf')]){if(_0x3d17ff[_0xc723('0xf')][_0xc723('0x10')]===0x1f4){logger[_0xc723('0xf')](_0xc723('0x11'),_0x3e887f,_0x3d17ff['error'][_0xc723('0x12')]);return _0xe4e485(_0x3d17ff[_0xc723('0xf')][_0xc723('0x12')]);}logger[_0xc723('0xf')](_0xc723('0x11'),_0x3e887f,_0x3d17ff['error'][_0xc723('0x12')]);return _0x199e04(_0x3d17ff['error']['message']);}else{logger[_0xc723('0x13')](_0xc723('0x11'),_0x3e887f,_0xc723('0xc'));_0x199e04(_0x3d17ff[_0xc723('0x14')][_0xc723('0x12')]);}})[_0xc723('0x15')](function(_0x7794ca){logger[_0xc723('0xf')]('SmsApplication,\x20%s,\x20%s',_0x3e887f,_0x7794ca);_0xe4e485(_0x7794ca);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f1948d8..14e9a36 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 _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5c00,0x17e));var _0x05c0=function(_0x465b0c,_0x569d90){_0x465b0c=_0x465b0c-0x0;var _0x502ff0=_0x5c00[_0x465b0c];return _0x502ff0;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router; \ No newline at end of file +var _0xf7b4=['/describe','describe','/:id','show','getMessages','/:id/download','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index'];(function(_0x5b1d8e,_0x4111f7){var _0x1b0ebe=function(_0x11e9d1){while(--_0x11e9d1){_0x5b1d8e['push'](_0x5b1d8e['shift']());}};_0x1b0ebe(++_0x4111f7);}(_0xf7b4,0x152));var _0x4f7b=function(_0x26fbb9,_0x18f6a1){_0x26fbb9=_0x26fbb9-0x0;var _0x2427a8=_0xf7b4[_0x26fbb9];return _0x2427a8;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/messages',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0x7')](_0x4f7b('0xf'),auth[_0x4f7b('0x8')](),controller['download']);router[_0x4f7b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f7b('0x10')](_0x4f7b('0x11'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['post'](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x16')),controller[_0x4f7b('0x17')]);router[_0x4f7b('0x18')](_0x4f7b('0xc'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x19')),controller['update']);router[_0x4f7b('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),'smsinteraction:destroy'),controller[_0x4f7b('0x1b')]);router[_0x4f7b('0x1a')](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),controller['removeTags']);module[_0x4f7b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index c70ac11..bb6d200 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 _0x4819=['out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x404402,_0x3a3c3f){var _0x1df111=function(_0x479bb4){while(--_0x479bb4){_0x404402['push'](_0x404402['shift']());}};_0x1df111(++_0x3a3c3f);}(_0x4819,0xcd));var _0x9481=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x4819[_0x1064bc];return _0x5edc45;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9481('0x0'));module[_0x9481('0x1')]={'closed':{'type':Sequelize[_0x9481('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9481('0x3')]},'disposition':{'type':Sequelize[_0x9481('0x4')]},'secondDisposition':{'type':Sequelize[_0x9481('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9481('0x4')]},'note':{'type':Sequelize[_0x9481('0x4')]},'phone':{'type':Sequelize[_0x9481('0x4')]},'read1stAt':{'type':Sequelize[_0x9481('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9481('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9481('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9481('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x8ad5=['out','sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8ad5,0xf1));var _0x58ad=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x8ad5[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0x58ad('0x0'));var moment=require(_0x58ad('0x1'));module[_0x58ad('0x2')]={'closed':{'type':Sequelize[_0x58ad('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x58ad('0x4')]},'thirdDisposition':{'type':Sequelize[_0x58ad('0x4')]},'note':{'type':Sequelize[_0x58ad('0x4')]},'phone':{'type':Sequelize[_0x58ad('0x4')]},'read1stAt':{'type':Sequelize[_0x58ad('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x58ad('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x58ad('0x6')]('in',_0x58ad('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x58ad('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 44904e4..243dbff 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 _0x791b=['../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','sms_accounts','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','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','type','text','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','createdAt','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','agent','toString','count','sequelize','keyBy','merge','SmsInteraction','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.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','all','rows','show','includeAll','include','options','create','body','update','params','describe','addMessage','SmsMessage','ids','omit','SmsInteractionId','format','findAll','addTags','setTags','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','User','Messages','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','firstName','lastName','renderFile','views','downloadInteraction.ejs','transcript-','unlinkSync','eml-format','zip-dir','mustache','util','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x55cc98,_0x25441d){var _0x16d656=function(_0x25eef8){while(--_0x25eef8){_0x55cc98['push'](_0x55cc98['shift']());}};_0x16d656(++_0x25441d);}(_0x791b,0xcb));var _0xb791=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x791b[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xb791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb791('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb791('0x2'));var util=require(_0xb791('0x3'));var path=require(_0xb791('0x4'));var sox=require(_0xb791('0x5'));var csv=require(_0xb791('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb791('0x7'));var squel=require('squel');var crypto=require(_0xb791('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb791('0x6'));var querystring=require(_0xb791('0x9'));var Papa=require(_0xb791('0xa'));var Redis=require(_0xb791('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xb791('0xc'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xb791('0xd'));var logger=require(_0xb791('0xe'))(_0xb791('0xf'));var utils=require(_0xb791('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xb791('0x11'));var db=require(_0xb791('0x12'))['db'];config[_0xb791('0x13')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb791('0x14'))(new Redis(config[_0xb791('0x13')]));require('./smsInteraction.socket')[_0xb791('0x15')](socket);function respondWithStatusCode(_0x54b8b8,_0x278949){_0x278949=_0x278949||0xcc;return function(_0x1e1ad8){if(_0x1e1ad8){return _0x54b8b8[_0xb791('0x16')](_0x278949);}return _0x54b8b8[_0xb791('0x17')](_0x278949)[_0xb791('0x18')]();};}function respondWithResult(_0x3cebdb,_0x1cadf6){_0x1cadf6=_0x1cadf6||0xc8;return function(_0x2b5290){if(_0x2b5290){return _0x3cebdb[_0xb791('0x17')](_0x1cadf6)[_0xb791('0x19')](_0x2b5290);}};}function respondWithFilteredResult(_0xc59b66,_0x50d393){return function(_0x1dfce9){if(_0x1dfce9){var _0x36a9fe=typeof _0x50d393[_0xb791('0x1a')]===_0xb791('0x1b')&&typeof _0x50d393[_0xb791('0x1c')]===_0xb791('0x1b');var _0x550a79=_0x1dfce9['count'];var _0xc8e5e2=_0x36a9fe?0x0:_0x50d393[_0xb791('0x1a')];var _0x41f706=_0x36a9fe?_0x1dfce9['count']:_0x50d393[_0xb791('0x1a')]+_0x50d393[_0xb791('0x1c')];var _0x2d0088;if(_0x41f706>=_0x550a79){_0x41f706=_0x550a79;_0x2d0088=0xc8;}else{_0x2d0088=0xce;}_0xc59b66[_0xb791('0x17')](_0x2d0088);return _0xc59b66[_0xb791('0x1d')](_0xb791('0x1e'),_0xc8e5e2+'-'+_0x41f706+'/'+_0x550a79)[_0xb791('0x19')](_0x1dfce9);}return null;};}function patchUpdates(_0x2450bd){return function(_0x43624b){try{jsonpatch[_0xb791('0x1f')](_0x43624b,_0x2450bd,!![]);}catch(_0x7b01a4){return BPromise[_0xb791('0x20')](_0x7b01a4);}return _0x43624b[_0xb791('0x21')]();};}function saveUpdates(_0x1cdb17,_0x2c8a88){return function(_0x137575){if(_0x137575){return _0x137575['update'](_0x1cdb17)['then'](function(_0x3c7627){return _0x3c7627;});}return null;};}function removeEntity(_0x280384,_0x5c8d4f){return function(_0x3616fa){if(_0x3616fa){return _0x3616fa[_0xb791('0x22')]()[_0xb791('0x23')](function(){_0x280384[_0xb791('0x17')](0xcc)[_0xb791('0x18')]();});}};}function handleEntityNotFound(_0x3ef842,_0x1e0050){return function(_0x2706fe){if(!_0x2706fe){_0x3ef842[_0xb791('0x16')](0x194);}return _0x2706fe;};}function handleError(_0x35605d,_0x3e5ed0){_0x3e5ed0=_0x3e5ed0||0x1f4;return function(_0x1984b9){logger[_0xb791('0x24')](_0x1984b9[_0xb791('0x25')]);if(_0x1984b9[_0xb791('0x26')]){delete _0x1984b9['name'];}_0x35605d[_0xb791('0x17')](_0x3e5ed0)[_0xb791('0x27')](_0x1984b9);};}function getInteractionUsers(_0x23a14c,_0x5061f7){return new BPromise(function(_0x538a23,_0x392be5){try{if(_0x5061f7[_0x23a14c['id']]){_0x23a14c[_0xb791('0x28')]=_[_0xb791('0x29')](_0x5061f7[_0x23a14c['id']],function(_0x204b7b){return{'id':_0x204b7b['id'],'fullname':_0x204b7b[_0xb791('0x2a')]};});}}catch(_0x52b474){_0x392be5(_0x52b474);}_0x538a23(_0x23a14c);});}function getInteractionTags(_0x2cc187,_0x4c4766){return new BPromise(function(_0x3fddb9,_0x366220){try{if(_0x2cc187['TagIds']){_0x2cc187[_0xb791('0x2b')]=[];_0x2cc187[_0xb791('0x2c')][_0xb791('0x2d')](',')[_0xb791('0x2e')](function(_0x46f714){_0x2cc187['Tags'][_0xb791('0x2f')](_0x4c4766[_0x46f714]);});}delete _0x2cc187[_0xb791('0x2c')];}catch(_0x308794){_0x366220(_0x308794);}_0x3fddb9(_0x2cc187);});}function updateSmsInteraction(_0x141aa5,_0xd117aa,_0x4c212b){return new BPromise(function(_0x503e7a,_0x4538d7){return getInteractionUsers(_0x141aa5,_0x4c212b)[_0xb791('0x23')](function(_0x3a4b69){return getInteractionTags(_0x3a4b69,_0xd117aa);})[_0xb791('0x23')](function(_0x38af15){_0x503e7a(_0x38af15);})[_0xb791('0x30')](function(_0x2859d0){_0x4538d7(_0x2859d0);});});}exports['index']=function(_0x224d59,_0x2e7be9){var _0x26d1c7={},_0x6c77b3={},_0x43a271={'count':0x0,'rows':[]};var _0x388187=_[_0xb791('0x29')](db['SmsInteraction'][_0xb791('0x31')],function(_0x10e1ad){return{'name':_0x10e1ad[_0xb791('0x32')],'type':_0x10e1ad['type'][_0xb791('0x33')]};});_0x6c77b3[_0xb791('0x34')]=_[_0xb791('0x29')](_0x388187,_0xb791('0x26'));_0x6c77b3[_0xb791('0x35')]=_[_0xb791('0x36')](_0x224d59[_0xb791('0x35')]);_0x6c77b3[_0xb791('0x37')]=_[_0xb791('0x38')](_0x6c77b3[_0xb791('0x34')],_0x6c77b3['query']);_0x26d1c7[_0xb791('0x39')]=_['intersection'](_0x6c77b3['model'],qs[_0xb791('0x3a')](_0x224d59[_0xb791('0x35')][_0xb791('0x3a')]));_0x26d1c7[_0xb791('0x39')]=_0x26d1c7['attributes'][_0xb791('0x3b')]?_0x26d1c7[_0xb791('0x39')]:_0x6c77b3[_0xb791('0x34')];if(!_0x224d59[_0xb791('0x35')][_0xb791('0x3c')](_0xb791('0x3d'))){_0x26d1c7[_0xb791('0x1c')]=qs[_0xb791('0x1c')](_0x224d59[_0xb791('0x35')][_0xb791('0x1c')]);_0x26d1c7[_0xb791('0x1a')]=qs['offset'](_0x224d59[_0xb791('0x35')]['offset']);}_0x26d1c7[_0xb791('0x3e')]=qs[_0xb791('0x3f')](_0x224d59['query'][_0xb791('0x3f')]);_0x26d1c7[_0xb791('0x40')]=qs[_0xb791('0x37')](_[_0xb791('0x41')](_0x224d59[_0xb791('0x35')],_0x6c77b3[_0xb791('0x37')]),_0x388187);var _0x3f4f0e=[];var _0x2f7174=squel[_0xb791('0x42')]()[_0xb791('0x43')]('id')[_0xb791('0x43')](_0xb791('0x26'))[_0xb791('0x43')](_0xb791('0x44'))['from']('tools_tags');var _0x71380c=squel[_0xb791('0x42')]()[_0xb791('0x43')]('u.id')[_0xb791('0x43')](_0xb791('0x45'))[_0xb791('0x43')](_0xb791('0x46'))[_0xb791('0x47')](_0xb791('0x48'),'ui')[_0xb791('0x49')](_0xb791('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x3ad3f4=squel[_0xb791('0x42')]()[_0xb791('0x47')](_0xb791('0x4b'),'i')[_0xb791('0x49')](_0xb791('0x4c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb791('0x49')]('users','o','o.id\x20=\x20i.UserId')[_0xb791('0x49')](_0xb791('0x4d'),'a','a.id\x20=\x20i.SmsAccountId')['left_join']('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0xb791('0x4e'),'it',_0xb791('0x4f'))['left_join'](_0xb791('0x50'),'t','t.id\x20=\x20it.TagId');var _0x459f68=squel[_0xb791('0x51')]();var _0x20ab27=[];var _0x549106=squel[_0xb791('0x51')]();var _0xf2d0b7;if(_0x224d59[_0xb791('0x35')][_0xb791('0x52')]){_0xf2d0b7=as['parseSearch'](_0x224d59[_0xb791('0x35')][_0xb791('0x52')]);var _0x2ae25e=_0xf2d0b7[_0xb791('0x53')];for(var _0x223519=0x0;_0x223519<_0xf2d0b7[_0xb791('0x54')][_0xb791('0x3b')];_0x223519++){var _0x37f638=_0xf2d0b7['conditions'][_0x223519];var _0x588b63='i';var _0x96e47c=_[_0xb791('0x55')](_0x388187,[_0xb791('0x26'),_0x37f638[_0xb791('0x43')]]);if(!_0x96e47c){switch(_0x37f638[_0xb791('0x43')]){case _0xb791('0x56'):if(_0x37f638['value']==0x1){_0x3ad3f4['having']('`'+_0x37f638[_0xb791('0x43')]+_0xb791('0x57'));}else{_0x3ad3f4[_0xb791('0x58')]('`'+_0x37f638[_0xb791('0x43')]+'`\x20>\x200');}break;case _0xb791('0x59'):if(_0x37f638[_0xb791('0x5a')]==='$substring'){if(_0x37f638[_0xb791('0x5b')][_0xb791('0x2d')]('\x20')[_0xb791('0x3b')]>0x1){_0x459f68[_0x2ae25e](_0xb791('0x5c'),qs[_0xb791('0x5d')](_0x37f638['value']),null);}else{var _0x235d62='%'+_0x37f638[_0xb791('0x5b')]+'%';_0x459f68[_0x2ae25e](_0xb791('0x5e'),_0x235d62,_0x235d62,_0x235d62);}}else{_0x96e47c=_[_0xb791('0x55')](_0x388187,[_0xb791('0x26'),_0xb791('0x5f')]);_0x37f638[_0xb791('0x43')]=_0xb791('0x5f');_0x5020db=as['buildExpression'](_0x588b63,_0x96e47c[_0xb791('0x60')],_0x37f638);_0x459f68[_0x2ae25e](_0x5020db[_0xb791('0x61')],_0x5020db[_0xb791('0x5b')][_0xb791('0x62')],_0x5020db[_0xb791('0x5b')][_0xb791('0x18')]);}break;case _0xb791('0x63'):var _0x4dc651=_0x37f638[_0xb791('0x5b')]['split'](',')[_0xb791('0x29')](function(_0x22b346){return Number(_0x22b346);});_0x4dc651[_0xb791('0x2e')](function(_0x5a0e7b){_0x549106['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5a0e7b+',%');});_0x20ab27=_[_0xb791('0x64')](_0x20ab27,_0x4dc651);break;case'User':if(_0x37f638['operator']==='$substring'){_0x459f68[_0x2ae25e](_0xb791('0x65'),'%'+_0x37f638[_0xb791('0x5b')]+'%',null);}else{_0x96e47c=_[_0xb791('0x55')](_0x388187,['name',_0xb791('0x66')]);_0x37f638[_0xb791('0x43')]='UserId';_0x5020db=as[_0xb791('0x67')](_0x588b63,_0x96e47c[_0xb791('0x60')],_0x37f638);_0x459f68[_0x2ae25e](_0x5020db[_0xb791('0x61')],_0x5020db['value']['start'],_0x5020db['value']['end']);}break;case'body':_0x5020db=as[_0xb791('0x67')]('me',null,_0x37f638);_0x459f68[_0x2ae25e](_0x5020db[_0xb791('0x61')],_0x5020db[_0xb791('0x5b')][_0xb791('0x62')],_0x5020db[_0xb791('0x5b')][_0xb791('0x18')]);break;}}else{var _0x5020db=as[_0xb791('0x67')](_0x588b63,_0x96e47c['type'],_0x37f638);_0x459f68[_0x2ae25e](_0x5020db[_0xb791('0x61')],_0x5020db[_0xb791('0x5b')][_0xb791('0x62')],_0x5020db[_0xb791('0x5b')][_0xb791('0x18')]);}}}else{var _0x2dae87=_(_0x224d59[_0xb791('0x35')])['keys']()['map'](function(_0x1bbb05){return _[_0xb791('0x68')](_0x388187,['name',_0x1bbb05])?_0x1bbb05:undefined;})[_0xb791('0x69')]()[_0xb791('0x5b')]();if(!_[_0xb791('0x6a')](_0x2dae87)){_0x2dae87[_0xb791('0x2e')](function(_0x6eadd3){if(_0x6eadd3==='SmsAccountId'){_0x3ad3f4[_0xb791('0x40')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x224d59[_0xb791('0x35')][_0x6eadd3]));}else if(_0x6eadd3===_0xb791('0x6b')){var _0x293ce1=JSON[_0xb791('0x6c')](_0x224d59['query'][_0x6eadd3])[_0xb791('0x6d')];var _0x59121e=JSON['parse'](_0x224d59[_0xb791('0x35')][_0x6eadd3])[_0xb791('0x6e')];_0x3ad3f4[_0xb791('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x293ce1,_0x59121e);}else{if(_0x224d59[_0xb791('0x35')][_0x6eadd3]===_0xb791('0x6f')){_0x3ad3f4['where']('i.'+_0x6eadd3+'\x20IS\x20NULL');}else{_0x3ad3f4[_0xb791('0x40')]('i.'+_0x6eadd3+_0xb791('0x70'),_0x224d59[_0xb791('0x35')][_0x6eadd3]);}}});}if(_0x224d59[_0xb791('0x35')]['read']){if(_0x224d59[_0xb791('0x35')][_0xb791('0x71')]==0x1){_0x3ad3f4[_0xb791('0x58')](_0xb791('0x72'));}else{_0x3ad3f4['having'](_0xb791('0x73'));}}if(_0x224d59['query'][_0xb791('0x74')]){_0x20ab27=_[_0xb791('0x75')](_0x224d59[_0xb791('0x35')]['tag'])?_0x224d59[_0xb791('0x35')][_0xb791('0x74')]:new Array(_0x224d59['query'][_0xb791('0x74')]);_0x20ab27[_0xb791('0x2e')](function(_0x212e87){_0x549106['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x212e87+',%');});}if(_0x224d59['query'][_0xb791('0x76')]){var _0x409774=_0x224d59[_0xb791('0x35')][_0xb791('0x76')][_0xb791('0x77')]('\x5c','\x5c\x5c')[_0xb791('0x77')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x409774)){_0x459f68['or'](_0xb791('0x78'),_0x409774+'%')['or'](_0xb791('0x79'),_0x409774+'%');}else{_0x459f68['or'](_0xb791('0x7a'),qs[_0xb791('0x5d')](_0x409774))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x409774+'%');}}}_0x3ad3f4[_0xb791('0x40')](_0x459f68);_0x3ad3f4[_0xb791('0x7b')]('i.id');var _0x34371d={'type':db['Sequelize'][_0xb791('0x7c')][_0xb791('0x7d')],'raw':!![]};var _0x46a33d=_0x3ad3f4[_0xb791('0x7e')]();_0x46a33d[_0xb791('0x43')](_0xb791('0x7f'));_0x46a33d[_0xb791('0x43')](_0xb791('0x80'),_0xb791('0x56'));if(_0x26d1c7[_0xb791('0x3e')]){_0x26d1c7[_0xb791('0x3e')][_0xb791('0x2e')](function(_0x54c4d2){var _0x995ba5=_0x54c4d2[0x0]===_0xb791('0x81')?_0x54c4d2[0x0]:'i.'+_0x54c4d2[0x0];_0x3ad3f4[_0xb791('0x3e')](_0x995ba5,_0x54c4d2[0x1]===_0xb791('0x82')?![]:!![]);});}if(!_['isEmpty'](_0x20ab27)){_0x3ad3f4['having'](_0x549106);_0x46a33d['where'](_0xb791('0x83'),_0x20ab27);}BPromise[_0xb791('0x84')]()[_0xb791('0x23')](function(){if(!_0xf2d0b7){if(_0x224d59['query'][_0xb791('0x85')])return;_0x46a33d[_0xb791('0x40')](_0xb791('0x86'));_0x3ad3f4[_0xb791('0x40')](_0xb791('0x86'));return;}if(_0x224d59['user'][_0xb791('0x87')]!=='agent')return;return _0x224d59[_0xb791('0x88')][_0xb791('0x89')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4dd9b4){if(_[_0xb791('0x6a')](_0x4dd9b4)){_0x46a33d[_0xb791('0x40')](_0xb791('0x8a'));_0x3ad3f4['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x46a33d['where'](_0xb791('0x8b'),_[_0xb791('0x29')](_0x4dd9b4,'id'));_0x3ad3f4[_0xb791('0x40')]('i.SmsAccountId\x20IN\x20?',_[_0xb791('0x29')](_0x4dd9b4,'id'));}});})[_0xb791('0x23')](function(){if(_0x224d59[_0xb791('0x88')]['role']===_0xb791('0x8c')&&!_0xf2d0b7&&!_0x224d59[_0xb791('0x35')][_0xb791('0x85')])return[];return db['sequelize']['query'](_0x46a33d[_0xb791('0x8d')](),_0x34371d);})[_0xb791('0x23')](function(_0x157e98){_0x43a271[_0xb791('0x8e')]=_0x157e98['length'];if(_0x43a271['count']===0x0)return[];return db[_0xb791('0x8f')][_0xb791('0x35')](_0x2f7174['toString'](),_0x34371d)[_0xb791('0x23')](function(_0x406eb7){_0x3f4f0e=_[_0xb791('0x90')](_0x406eb7,'id');_0x34371d=_[_0xb791('0x91')](_0x34371d,{'model':db[_0xb791('0x92')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x224d59[_0xb791('0x35')][_0xb791('0x3a')]){_0x26d1c7['attributes'][_0xb791('0x2e')](function(_0x2bfbfc){_0x3ad3f4[_0xb791('0x43')]('i.'+_0x2bfbfc);});}else{_0x3ad3f4[_0xb791('0x43')](_0xb791('0x80'),_0xb791('0x56'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x93'),_0xb791('0x94'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x95'),_0xb791('0x96'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x97'),_0xb791('0x81'));_0x3ad3f4['field'](_0xb791('0x98'));_0x3ad3f4[_0xb791('0x43')]('c.firstName',_0xb791('0x99'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x9a'),_0xb791('0x9b'));_0x3ad3f4[_0xb791('0x43')]('c.email',_0xb791('0x9c'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0x9d'),'Contact.phone');_0x3ad3f4[_0xb791('0x43')](_0xb791('0x9e'),_0xb791('0x9f'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0xa0'),_0xb791('0xa1'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0xa2'),'Owner.fullname');_0x3ad3f4[_0xb791('0x43')](_0xb791('0xa3'),_0xb791('0xa4'));_0x3ad3f4[_0xb791('0x43')](_0xb791('0xa5'),_0xb791('0x2c'));}if(_0x26d1c7[_0xb791('0x1c')])_0x3ad3f4[_0xb791('0x1c')](_0x26d1c7['limit']);if(_0x26d1c7[_0xb791('0x1a')])_0x3ad3f4[_0xb791('0x1a')](_0x26d1c7[_0xb791('0x1a')]);return db[_0xb791('0x8f')][_0xb791('0x35')](_0x3ad3f4[_0xb791('0x8d')](),_0x34371d);})[_0xb791('0x23')](function(_0x52cc35){if(_0x52cc35[_0xb791('0x3b')]>0x0)_0x71380c['where']('ui.SmsInteractionId\x20IN\x20?',_[_0xb791('0x29')](_0x52cc35,'id'));return db[_0xb791('0x8f')][_0xb791('0x35')](_0x71380c[_0xb791('0x8d')](),_0x34371d)[_0xb791('0x23')](function(_0x4aa02f){var _0x5186a6=_['groupBy'](_0x4aa02f,'SmsInteractionId');var _0x2fd768=[];_0x52cc35[_0xb791('0x2e')](function(_0x525347){_0x2fd768[_0xb791('0x2f')](updateSmsInteraction(_0x525347,_0x3f4f0e,_0x5186a6));});return BPromise[_0xb791('0xa6')](_0x2fd768);});});})[_0xb791('0x23')](function(_0x8c2168){_0x43a271[_0xb791('0xa7')]=_0x8c2168;return _0x43a271;})[_0xb791('0x23')](respondWithFilteredResult(_0x2e7be9,_0x26d1c7))[_0xb791('0x30')](handleError(_0x2e7be9,null));};exports[_0xb791('0xa8')]=function(_0x5ec1bc,_0x25a55d){var _0x3caa4a={'raw':![],'where':{'id':_0x5ec1bc['params']['id']}},_0x4be512={};_0x4be512[_0xb791('0x34')]=_[_0xb791('0x36')](db[_0xb791('0x92')]['rawAttributes']);_0x4be512['query']=_[_0xb791('0x36')](_0x5ec1bc[_0xb791('0x35')]);_0x4be512[_0xb791('0x37')]=_[_0xb791('0x38')](_0x4be512[_0xb791('0x34')],_0x4be512['query']);_0x3caa4a['attributes']=_['intersection'](_0x4be512['model'],qs['fields'](_0x5ec1bc['query'][_0xb791('0x3a')]));_0x3caa4a[_0xb791('0x39')]=_0x3caa4a[_0xb791('0x39')]['length']?_0x3caa4a['attributes']:_0x4be512[_0xb791('0x34')];if(_0x5ec1bc['query'][_0xb791('0xa9')]){_0x3caa4a[_0xb791('0xaa')]=[{'all':!![]}];}_0x3caa4a=_[_0xb791('0x91')]({},_0x3caa4a,_0x5ec1bc[_0xb791('0xab')]);return db[_0xb791('0x92')][_0xb791('0x55')](_0x3caa4a)[_0xb791('0x23')](handleEntityNotFound(_0x25a55d,null))[_0xb791('0x23')](respondWithResult(_0x25a55d,null))[_0xb791('0x30')](handleError(_0x25a55d,null));};exports['create']=function(_0xcd593c,_0x6ea25d){return db['SmsInteraction'][_0xb791('0xac')](_0xcd593c[_0xb791('0xad')],{})[_0xb791('0x23')](respondWithResult(_0x6ea25d,0xc9))[_0xb791('0x30')](handleError(_0x6ea25d,null));};exports[_0xb791('0xae')]=function(_0x414cfd,_0x488daf){if(_0x414cfd[_0xb791('0xad')]['id']){delete _0x414cfd[_0xb791('0xad')]['id'];}return db[_0xb791('0x92')][_0xb791('0x55')]({'where':{'id':_0x414cfd[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x488daf,null))[_0xb791('0x23')](saveUpdates(_0x414cfd[_0xb791('0xad')],null))[_0xb791('0x23')](respondWithResult(_0x488daf,null))[_0xb791('0x30')](handleError(_0x488daf,null));};exports[_0xb791('0x22')]=function(_0x56f62c,_0x424b1e){return db['SmsInteraction'][_0xb791('0x55')]({'where':{'id':_0x56f62c[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x424b1e,null))[_0xb791('0x23')](removeEntity(_0x424b1e,null))[_0xb791('0x30')](handleError(_0x424b1e,null));};exports[_0xb791('0xb0')]=function(_0x501748,_0x4ac774){return db[_0xb791('0x92')]['describe']()[_0xb791('0x23')](respondWithResult(_0x4ac774,null))['catch'](handleError(_0x4ac774,null));};exports[_0xb791('0xb1')]=function(_0x3c45f8,_0x6457e7,_0xebb605){return db[_0xb791('0xb2')]['find']({'where':{'id':_0x3c45f8[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x6457e7,null))[_0xb791('0x23')](function(_0x1253f0){if(_0x1253f0){return _0x1253f0[_0xb791('0xb1')](_0x3c45f8[_0xb791('0xad')][_0xb791('0xb3')],_[_0xb791('0xb4')](_0x3c45f8[_0xb791('0xad')],['ids','id'])||{});}})['then'](respondWithResult(_0x6457e7,null))[_0xb791('0x30')](handleError(_0x6457e7,null));};exports['getMessages']=function(_0x20a33b,_0xab6c83,_0x4334fd){var _0x523e88={'raw':![],'where':{}};var _0x10ff23={};var _0x5a47f3={'count':0x0,'rows':[]};return db[_0xb791('0x92')]['findOne']({'where':{'id':_0x20a33b[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0xab6c83,null))[_0xb791('0x23')](function(_0x2217df){if(_0x2217df){_0x10ff23[_0xb791('0x34')]=_[_0xb791('0x36')](db[_0xb791('0xb2')][_0xb791('0x31')]);_0x10ff23[_0xb791('0x35')]=_[_0xb791('0x36')](_0x20a33b[_0xb791('0x35')]);_0x10ff23['filters']=_[_0xb791('0x38')](_0x10ff23[_0xb791('0x34')],_0x10ff23[_0xb791('0x35')]);_0x523e88[_0xb791('0x39')]=_[_0xb791('0x38')](_0x10ff23[_0xb791('0x34')],qs[_0xb791('0x3a')](_0x20a33b[_0xb791('0x35')][_0xb791('0x3a')]));_0x523e88[_0xb791('0x39')]=_0x523e88[_0xb791('0x39')][_0xb791('0x3b')]?_0x523e88[_0xb791('0x39')]:_0x10ff23[_0xb791('0x34')];if(!_0x20a33b[_0xb791('0x35')]['hasOwnProperty']('nolimit')){_0x523e88[_0xb791('0x1c')]=qs[_0xb791('0x1c')](_0x20a33b[_0xb791('0x35')][_0xb791('0x1c')]);_0x523e88['offset']=qs[_0xb791('0x1a')](_0x20a33b[_0xb791('0x35')][_0xb791('0x1a')]);}_0x523e88['order']=qs[_0xb791('0x3f')](_0x20a33b[_0xb791('0x35')][_0xb791('0x3f')]);_0x523e88[_0xb791('0x40')]=qs[_0xb791('0x37')](_[_0xb791('0x41')](_0x20a33b[_0xb791('0x35')],_0x10ff23[_0xb791('0x37')]));_0x523e88[_0xb791('0x40')][_0xb791('0xb5')]=_0x2217df['id'];if(_0x20a33b[_0xb791('0x35')]['filter']){_0x523e88[_0xb791('0x40')]=_['merge'](_0x523e88['where'],{'$or':_[_0xb791('0x29')](_0x523e88[_0xb791('0x39')],function(_0x352f83){var _0x1029d7={};_0x1029d7[_0x352f83]={'$like':'%'+_0x20a33b['query'][_0xb791('0x76')]+'%'};return _0x1029d7;})});}if(_0x20a33b[_0xb791('0x35')][_0xb791('0x6d')]){var _0x179736=_0x20a33b[_0xb791('0x35')][_0xb791('0x6d')][_0xb791('0x2d')](',');var _0x18abbe={};_0x18abbe[_0x179736[0x0]]={'$gte':moment(_0x179736[0x1])[_0xb791('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x523e88[_0xb791('0x40')]=_[_0xb791('0x91')](_0x523e88[_0xb791('0x40')],_0x18abbe);}_0x523e88=_['merge']({},_0x523e88,_0x20a33b[_0xb791('0xab')]);return db['SmsMessage'][_0xb791('0x8e')]({'where':_0x523e88[_0xb791('0x40')]})['then'](function(_0x54ccc0){_0x5a47f3['count']=_0x54ccc0;if(_0x20a33b['query'][_0xb791('0xa9')]){_0x523e88['include']=[{'all':!![]}];}return db[_0xb791('0xb2')][_0xb791('0xb7')](_0x523e88);})['then'](function(_0x572569){_0x5a47f3['rows']=_0x572569;return _0x5a47f3;});}})['then'](respondWithFilteredResult(_0xab6c83,_0x523e88))[_0xb791('0x30')](handleError(_0xab6c83,null));};exports[_0xb791('0xb8')]=function(_0x1d5fd9,_0x412e54,_0x1b2884){return db[_0xb791('0x92')][_0xb791('0x55')]({'where':{'id':_0x1d5fd9[_0xb791('0xaf')]['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x412e54,null))[_0xb791('0x23')](function(_0x4bf532){if(_0x4bf532){return _0x4bf532[_0xb791('0xb9')](_0x1d5fd9['body']['ids'],_[_0xb791('0xb4')](_0x1d5fd9['body'],[_0xb791('0xb3'),'id'])||{})['spread'](function(){return db[_0xb791('0x63')]['findAll']({'attributes':['id',_0xb791('0x26'),_0xb791('0x44')],'where':{'id':_0x1d5fd9[_0xb791('0xad')][_0xb791('0xb3')]}});})[_0xb791('0x23')](function(_0x467f0d){socket[_0xb791('0xba')](_0xb791('0xbb'),{'id':Number(_0x1d5fd9['params']['id']),'tags':_0x467f0d||[]});return{'id':Number(_0x1d5fd9['params']['id']),'tags':_0x467f0d||[]};});}})[_0xb791('0x23')](respondWithResult(_0x412e54,null))[_0xb791('0x30')](handleError(_0x412e54,null));};exports['removeTags']=function(_0x5d428f,_0x5730fc,_0x1e3164){return db[_0xb791('0x92')][_0xb791('0x55')]({'where':{'id':_0x5d428f['params']['id']}})[_0xb791('0x23')](handleEntityNotFound(_0x5730fc,null))[_0xb791('0x23')](function(_0x24f26e){if(_0x24f26e){return _0x24f26e[_0xb791('0xbc')](_0x5d428f[_0xb791('0x35')][_0xb791('0xb3')]);}})['then'](respondWithStatusCode(_0x5730fc,null))[_0xb791('0x30')](handleError(_0x5730fc,null));};exports[_0xb791('0xbd')]=function(_0x5c0154,_0x5f205e){var _0x5d3335=moment()[_0xb791('0xbe')]()[_0xb791('0x8d')]();var _0xb21cea=path[_0xb791('0xbf')](config[_0xb791('0xc0')],_0xb791('0xc1'),'files',_0xb791('0xc2'));var _0x1f5ddf=path[_0xb791('0xbf')](config[_0xb791('0xc0')],_0xb791('0xc1'),_0xb791('0xc3'),_0xb791('0xc4'));var _0x27bf5d=path[_0xb791('0xbf')](_0xb21cea,_0x5d3335);var _0x502a0d=util[_0xb791('0xb6')](_0xb791('0xc5'),_0x5c0154[_0xb791('0xaf')]['id'],_0x5d3335);var _0x522c39=path[_0xb791('0xbf')](_0xb21cea,_0x502a0d);var _0x47b4fb=[];_0x47b4fb[_0xb791('0x2f')]({'model':db[_0xb791('0xc6')],'as':_0xb791('0xc6'),'attributes':['id','fullname'],'raw':!![]});_0x47b4fb['push']({'model':db['CmContact'],'as':_0xb791('0x59'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x303526=[{'model':db['SmsMessage'],'as':_0xb791('0xc7'),'attributes':['id',_0xb791('0xad'),_0xb791('0x6b'),_0xb791('0xc8'),_0xb791('0xc9'),_0xb791('0x71')],'include':_0x47b4fb}];_0x303526[_0xb791('0x2f')]({'model':db[_0xb791('0xca')],'as':_0xb791('0xcb'),'attributes':['id','name']});_0x303526['push']({'model':db['User'],'as':_0xb791('0xcc'),'attributes':['id',_0xb791('0x2a')]});return db['SmsInteraction']['find']({'where':{'id':_0x5c0154['params']['id']},'include':_0x303526})[_0xb791('0x23')](handleEntityNotFound(_0x5f205e,null))[_0xb791('0x23')](function(_0x1980c0){if(_0x1980c0){var _0xd2b004=_0x1980c0[_0xb791('0xcd')]({'plain':!![]});fs[_0xb791('0xce')](_0x27bf5d);var _0x37e3cb={'channel':_0xb791('0xcf'),'account':_0xd2b004[_0xb791('0xcb')][_0xb791('0x26')],'agent':_0xd2b004[_0xb791('0xcc')]?_0xd2b004[_0xb791('0xcc')][_0xb791('0x2a')]:_0xb791('0xd0'),'createdAt':moment(_0xd2b004[_0xb791('0x6b')])[_0xb791('0xb6')](_0xb791('0xd1'))[_0xb791('0x8d')](),'closedAt':_0xd2b004[_0xb791('0xd2')]?moment(_0xd2b004[_0xb791('0xd3')])[_0xb791('0xb6')](_0xb791('0xd1'))[_0xb791('0x8d')]():'','disposition':_0xd2b004[_0xb791('0xd4')],'messages':_(_0xd2b004['Messages'])['filter']({'secret':![]})['map'](function(_0x130675){return{'date':moment(_0x130675[_0xb791('0x6b')])[_0xb791('0xb6')](_0xb791('0xd1'))['toString'](),'sender':_0x130675[_0xb791('0xc8')]==='out'?_0x130675['User']?_0x130675[_0xb791('0xc6')][_0xb791('0x2a')]:'System':_0x130675[_0xb791('0x59')][_0xb791('0xd5')]+(_0x130675[_0xb791('0x59')]['lastName']?'\x20'+_0x130675['Contact'][_0xb791('0xd6')]:''),'body':_0x130675['body'],'direction':_0x130675['direction']==='out'?'A':'C','secret':_0x130675['secret'],'read':_0x130675[_0xb791('0x71')]};})[_0xb791('0x5b')]()};return ejs[_0xb791('0xd7')](path[_0xb791('0xbf')](config[_0xb791('0xc0')],_0xb791('0xc1'),_0xb791('0xd8'),_0xb791('0xd9')),{'interaction':_0x37e3cb})[_0xb791('0x23')](function(_0x42f011){var _0x2a392b=path[_0xb791('0xbf')](_0x27bf5d,_0xb791('0xda')+_0xd2b004['id']+'-'+_0x5d3335+'.pdf');var _0x40b36b={'path':_0x2a392b,'channel':_0xb791('0xcf'),'interactionId':_0xd2b004['id']};return pdf['createPdfFromHTML'](_0x42f011,_0x40b36b);})[_0xb791('0x23')](function(){return new BPromise(function(_0x3b45e3,_0x286d86){zipdir(_0x27bf5d,{'saveTo':_0x522c39},function(_0x26b622,_0xe3c800){if(_0x26b622)return _0x286d86(_0x26b622);return _0x3b45e3(_0xe3c800);});})['then'](function(){return new BPromise(function(_0x26d576,_0x197233){rimraf(_0x27bf5d,function(_0x4cb98b){if(_0x4cb98b)_0x197233(_0x4cb98b);return _0x26d576();});});})[_0xb791('0x23')](function(){return _0x5f205e[_0xb791('0xbd')](_0x522c39,_0x502a0d,function(_0x30cbdc){if(_0x30cbdc){console['log']('err',_0x30cbdc);}else{fs[_0xb791('0xdb')](_0x522c39);}});});});}else{return _0x5f205e['sendStatus'](0xc8);}})[_0xb791('0x30')](handleError(_0x5f205e,null));}; \ No newline at end of file +var _0x26d5=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','count','keyBy','SmsInteraction','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','show','include','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','merge','options','includeAll','rows','addTags','setTags','findAll','emit','smsInteractionTags:save','removeTags','download','join','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','Messages','direction','secret','SmsAccount','get','mkdirSync','Sms','Account','Owner','closed','closedAt','disposition','System','out','root','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','sendStatus','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','end','status','json','undefined','limit','offset','set','apply','reject','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','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','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','having','`\x20=\x200','`\x20>\x200','Contact','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','body','some','compact','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0x26d5,0x14f));var _0x526d=function(_0x3d560e,_0x1b8889){_0x3d560e=_0x3d560e-0x0;var _0xa161ff=_0x26d5[_0x3d560e];return _0xa161ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x526d('0x0'));var zipdir=require(_0x526d('0x1'));var jsonpatch=require(_0x526d('0x2'));var rp=require(_0x526d('0x3'));var moment=require('moment');var BPromise=require(_0x526d('0x4'));var Mustache=require(_0x526d('0x5'));var util=require(_0x526d('0x6'));var path=require(_0x526d('0x7'));var sox=require(_0x526d('0x8'));var csv=require(_0x526d('0x9'));var ejs=require(_0x526d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x526d('0xb'));var squel=require('squel');var crypto=require(_0x526d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x526d('0xd'));var toCsv=require(_0x526d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x526d('0xe'));var authService=require(_0x526d('0xf'));var qs=require(_0x526d('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x526d('0x11'));var logger=require(_0x526d('0x12'))(_0x526d('0x13'));var utils=require('../../config/utils');var config=require(_0x526d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x526d('0x15'))['db'];config[_0x526d('0x16')]=_[_0x526d('0x17')](config[_0x526d('0x16')],{'host':_0x526d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x526d('0x16')]));require(_0x526d('0x19'))[_0x526d('0x1a')](socket);function respondWithStatusCode(_0xba75c9,_0x34253c){_0x34253c=_0x34253c||0xcc;return function(_0x39584c){if(_0x39584c){return _0xba75c9['sendStatus'](_0x34253c);}return _0xba75c9['status'](_0x34253c)[_0x526d('0x1b')]();};}function respondWithResult(_0x733485,_0x3c657b){_0x3c657b=_0x3c657b||0xc8;return function(_0x2f5a61){if(_0x2f5a61){return _0x733485[_0x526d('0x1c')](_0x3c657b)[_0x526d('0x1d')](_0x2f5a61);}};}function respondWithFilteredResult(_0xded923,_0x4f70a2){return function(_0xaf60df){if(_0xaf60df){var _0x11f606=typeof _0x4f70a2['offset']===_0x526d('0x1e')&&typeof _0x4f70a2[_0x526d('0x1f')]===_0x526d('0x1e');var _0x103070=_0xaf60df['count'];var _0x55a578=_0x11f606?0x0:_0x4f70a2['offset'];var _0x50a39a=_0x11f606?_0xaf60df['count']:_0x4f70a2[_0x526d('0x20')]+_0x4f70a2['limit'];var _0x56e8fe;if(_0x50a39a>=_0x103070){_0x50a39a=_0x103070;_0x56e8fe=0xc8;}else{_0x56e8fe=0xce;}_0xded923[_0x526d('0x1c')](_0x56e8fe);return _0xded923[_0x526d('0x21')]('Content-Range',_0x55a578+'-'+_0x50a39a+'/'+_0x103070)[_0x526d('0x1d')](_0xaf60df);}return null;};}function patchUpdates(_0x671ff6){return function(_0x54453b){try{jsonpatch[_0x526d('0x22')](_0x54453b,_0x671ff6,!![]);}catch(_0x59ef2e){return BPromise[_0x526d('0x23')](_0x59ef2e);}return _0x54453b['save']();};}function saveUpdates(_0x322507,_0x2546f2){return function(_0x4bafed){if(_0x4bafed){return _0x4bafed[_0x526d('0x24')](_0x322507)[_0x526d('0x25')](function(_0x2752b9){return _0x2752b9;});}return null;};}function removeEntity(_0x566e7a,_0x39dcee){return function(_0x13ff79){if(_0x13ff79){return _0x13ff79[_0x526d('0x26')]()['then'](function(){_0x566e7a[_0x526d('0x1c')](0xcc)[_0x526d('0x1b')]();});}};}function handleEntityNotFound(_0x53d111,_0x21aaa2){return function(_0x372e11){if(!_0x372e11){_0x53d111['sendStatus'](0x194);}return _0x372e11;};}function handleError(_0x10400d,_0x4a4e7c){_0x4a4e7c=_0x4a4e7c||0x1f4;return function(_0x33e59f){logger[_0x526d('0x27')](_0x33e59f[_0x526d('0x28')]);if(_0x33e59f['name']){delete _0x33e59f[_0x526d('0x29')];}_0x10400d['status'](_0x4a4e7c)[_0x526d('0x2a')](_0x33e59f);};}function getInteractionUsers(_0x26dd75,_0x3e85ee){return new BPromise(function(_0xf528b9,_0x130687){try{if(_0x3e85ee[_0x26dd75['id']]){_0x26dd75[_0x526d('0x2b')]=_[_0x526d('0x2c')](_0x3e85ee[_0x26dd75['id']],function(_0x1b2ca0){return{'id':_0x1b2ca0['id'],'fullname':_0x1b2ca0[_0x526d('0x2d')]};});}}catch(_0x3d5b0f){_0x130687(_0x3d5b0f);}_0xf528b9(_0x26dd75);});}function getInteractionTags(_0x398ce1,_0x503828){return new BPromise(function(_0x122128,_0xb20d45){try{if(_0x398ce1[_0x526d('0x2e')]){_0x398ce1[_0x526d('0x2f')]=[];_0x398ce1[_0x526d('0x2e')][_0x526d('0x30')](',')[_0x526d('0x31')](function(_0x8fcce3){_0x398ce1['Tags'][_0x526d('0x32')](_0x503828[_0x8fcce3]);});}delete _0x398ce1[_0x526d('0x2e')];}catch(_0x49a529){_0xb20d45(_0x49a529);}_0x122128(_0x398ce1);});}function updateSmsInteraction(_0x2ce920,_0x35c907,_0x4d8599){return new BPromise(function(_0x5672f7,_0x86fffa){return getInteractionUsers(_0x2ce920,_0x4d8599)[_0x526d('0x25')](function(_0x112a8d){return getInteractionTags(_0x112a8d,_0x35c907);})[_0x526d('0x25')](function(_0x5253e9){_0x5672f7(_0x5253e9);})[_0x526d('0x33')](function(_0x5b5e73){_0x86fffa(_0x5b5e73);});});}exports['index']=function(_0x23472d,_0x5ed9aa){var _0x2799c3={},_0x5c0d9c={},_0x1bad91={'count':0x0,'rows':[]};var _0x52bf6b=_['map'](db['SmsInteraction'][_0x526d('0x34')],function(_0x2b939d){return{'name':_0x2b939d[_0x526d('0x35')],'type':_0x2b939d[_0x526d('0x36')][_0x526d('0x37')]};});_0x5c0d9c[_0x526d('0x38')]=_[_0x526d('0x2c')](_0x52bf6b,_0x526d('0x29'));_0x5c0d9c[_0x526d('0x39')]=_[_0x526d('0x3a')](_0x23472d[_0x526d('0x39')]);_0x5c0d9c[_0x526d('0x3b')]=_[_0x526d('0x3c')](_0x5c0d9c['model'],_0x5c0d9c[_0x526d('0x39')]);_0x2799c3[_0x526d('0x3d')]=_['intersection'](_0x5c0d9c['model'],qs[_0x526d('0x3e')](_0x23472d[_0x526d('0x39')]['fields']));_0x2799c3['attributes']=_0x2799c3[_0x526d('0x3d')][_0x526d('0x3f')]?_0x2799c3[_0x526d('0x3d')]:_0x5c0d9c[_0x526d('0x38')];if(!_0x23472d[_0x526d('0x39')][_0x526d('0x40')](_0x526d('0x41'))){_0x2799c3[_0x526d('0x1f')]=qs[_0x526d('0x1f')](_0x23472d[_0x526d('0x39')][_0x526d('0x1f')]);_0x2799c3[_0x526d('0x20')]=qs['offset'](_0x23472d[_0x526d('0x39')][_0x526d('0x20')]);}_0x2799c3[_0x526d('0x42')]=qs['sort'](_0x23472d[_0x526d('0x39')][_0x526d('0x43')]);_0x2799c3[_0x526d('0x44')]=qs[_0x526d('0x3b')](_[_0x526d('0x45')](_0x23472d['query'],_0x5c0d9c[_0x526d('0x3b')]),_0x52bf6b);var _0x2beb58=[];var _0xc033d=squel['select']()[_0x526d('0x46')]('id')[_0x526d('0x46')](_0x526d('0x29'))['field'](_0x526d('0x47'))[_0x526d('0x48')](_0x526d('0x49'));var _0x33045e=squel[_0x526d('0x4a')]()[_0x526d('0x46')](_0x526d('0x4b'))[_0x526d('0x46')](_0x526d('0x4c'))[_0x526d('0x46')](_0x526d('0x4d'))[_0x526d('0x48')](_0x526d('0x4e'),'ui')[_0x526d('0x4f')](_0x526d('0x50'),'u',_0x526d('0x51'));var _0x5a717c=squel['select']()[_0x526d('0x48')](_0x526d('0x52'),'i')[_0x526d('0x4f')](_0x526d('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x526d('0x4f')]('users','o',_0x526d('0x54'))[_0x526d('0x4f')](_0x526d('0x55'),'a',_0x526d('0x56'))[_0x526d('0x4f')](_0x526d('0x57'),'me',_0x526d('0x58'))[_0x526d('0x4f')](_0x526d('0x59'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x526d('0x4f')](_0x526d('0x49'),'t',_0x526d('0x5a'));var _0x228d5d=squel[_0x526d('0x5b')]();var _0x4b564c=[];var _0x529cc8=squel[_0x526d('0x5b')]();var _0x5740dc;if(_0x23472d[_0x526d('0x39')][_0x526d('0x5c')]){_0x5740dc=as[_0x526d('0x5d')](_0x23472d[_0x526d('0x39')][_0x526d('0x5c')]);var _0x2f7a14=_0x5740dc['sqlOperator'];for(var _0x2e0cc3=0x0;_0x2e0cc3<_0x5740dc[_0x526d('0x5e')]['length'];_0x2e0cc3++){var _0x1fadef=_0x5740dc[_0x526d('0x5e')][_0x2e0cc3];var _0x304c84='i';var _0x7c7e8a=_['find'](_0x52bf6b,[_0x526d('0x29'),_0x1fadef[_0x526d('0x46')]]);if(!_0x7c7e8a){switch(_0x1fadef[_0x526d('0x46')]){case'unreadMessages':if(_0x1fadef['value']==0x1){_0x5a717c[_0x526d('0x5f')]('`'+_0x1fadef[_0x526d('0x46')]+_0x526d('0x60'));}else{_0x5a717c[_0x526d('0x5f')]('`'+_0x1fadef[_0x526d('0x46')]+_0x526d('0x61'));}break;case _0x526d('0x62'):if(_0x1fadef['operator']==='$substring'){if(_0x1fadef[_0x526d('0x63')][_0x526d('0x30')]('\x20')[_0x526d('0x3f')]>0x1){_0x228d5d[_0x2f7a14](_0x526d('0x64'),qs['getFullTextValue'](_0x1fadef[_0x526d('0x63')]),null);}else{var _0x47b0a5='%'+_0x1fadef['value']+'%';_0x228d5d[_0x2f7a14]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x47b0a5,_0x47b0a5,_0x47b0a5);}}else{_0x7c7e8a=_['find'](_0x52bf6b,[_0x526d('0x29'),_0x526d('0x65')]);_0x1fadef[_0x526d('0x46')]=_0x526d('0x65');_0x57f977=as[_0x526d('0x66')](_0x304c84,_0x7c7e8a['type'],_0x1fadef);_0x228d5d[_0x2f7a14](_0x57f977[_0x526d('0x67')],_0x57f977[_0x526d('0x63')][_0x526d('0x68')],_0x57f977[_0x526d('0x63')][_0x526d('0x1b')]);}break;case _0x526d('0x69'):var _0x13381e=_0x1fadef[_0x526d('0x63')][_0x526d('0x30')](',')[_0x526d('0x2c')](function(_0x15dabf){return Number(_0x15dabf);});_0x13381e[_0x526d('0x31')](function(_0x285465){_0x529cc8['or'](_0x526d('0x6a'),'%,'+_0x285465+',%');});_0x4b564c=_['union'](_0x4b564c,_0x13381e);break;case _0x526d('0x6b'):if(_0x1fadef[_0x526d('0x6c')]===_0x526d('0x6d')){_0x228d5d[_0x2f7a14](_0x526d('0x6e'),'%'+_0x1fadef[_0x526d('0x63')]+'%',null);}else{_0x7c7e8a=_[_0x526d('0x6f')](_0x52bf6b,[_0x526d('0x29'),'UserId']);_0x1fadef[_0x526d('0x46')]='UserId';_0x57f977=as[_0x526d('0x66')](_0x304c84,_0x7c7e8a[_0x526d('0x36')],_0x1fadef);_0x228d5d[_0x2f7a14](_0x57f977[_0x526d('0x67')],_0x57f977[_0x526d('0x63')][_0x526d('0x68')],_0x57f977[_0x526d('0x63')]['end']);}break;case _0x526d('0x70'):_0x57f977=as[_0x526d('0x66')]('me',null,_0x1fadef);_0x228d5d[_0x2f7a14](_0x57f977['text'],_0x57f977[_0x526d('0x63')][_0x526d('0x68')],_0x57f977[_0x526d('0x63')][_0x526d('0x1b')]);break;}}else{var _0x57f977=as[_0x526d('0x66')](_0x304c84,_0x7c7e8a[_0x526d('0x36')],_0x1fadef);_0x228d5d[_0x2f7a14](_0x57f977['text'],_0x57f977['value']['start'],_0x57f977[_0x526d('0x63')][_0x526d('0x1b')]);}}}else{var _0x21e3ca=_(_0x23472d[_0x526d('0x39')])[_0x526d('0x3a')]()[_0x526d('0x2c')](function(_0x17bbf6){return _[_0x526d('0x71')](_0x52bf6b,[_0x526d('0x29'),_0x17bbf6])?_0x17bbf6:undefined;})[_0x526d('0x72')]()['value']();if(!_['isEmpty'](_0x21e3ca)){_0x21e3ca['forEach'](function(_0x1b545a){if(_0x1b545a===_0x526d('0x73')){_0x5a717c[_0x526d('0x44')](_0x526d('0x74'),[]['concat'](_0x23472d[_0x526d('0x39')][_0x1b545a]));}else if(_0x1b545a===_0x526d('0x75')){var _0x3b55f1=JSON[_0x526d('0x76')](_0x23472d[_0x526d('0x39')][_0x1b545a])[_0x526d('0x77')];var _0x32aab6=JSON[_0x526d('0x76')](_0x23472d[_0x526d('0x39')][_0x1b545a])['$lte'];_0x5a717c[_0x526d('0x44')](_0x526d('0x78'),_0x3b55f1,_0x32aab6);}else{if(_0x23472d[_0x526d('0x39')][_0x1b545a]===_0x526d('0x79')){_0x5a717c[_0x526d('0x44')]('i.'+_0x1b545a+_0x526d('0x7a'));}else{_0x5a717c[_0x526d('0x44')]('i.'+_0x1b545a+_0x526d('0x7b'),_0x23472d[_0x526d('0x39')][_0x1b545a]);}}});}if(_0x23472d['query'][_0x526d('0x7c')]){if(_0x23472d[_0x526d('0x39')][_0x526d('0x7c')]==0x1){_0x5a717c[_0x526d('0x5f')](_0x526d('0x7d'));}else{_0x5a717c[_0x526d('0x5f')](_0x526d('0x7e'));}}if(_0x23472d[_0x526d('0x39')][_0x526d('0x7f')]){_0x4b564c=_[_0x526d('0x80')](_0x23472d[_0x526d('0x39')][_0x526d('0x7f')])?_0x23472d[_0x526d('0x39')]['tag']:new Array(_0x23472d['query']['tag']);_0x4b564c[_0x526d('0x31')](function(_0x7934fd){_0x529cc8['or'](_0x526d('0x6a'),'%,'+_0x7934fd+',%');});}if(_0x23472d[_0x526d('0x39')][_0x526d('0x81')]){var _0x3b4dac=_0x23472d[_0x526d('0x39')][_0x526d('0x81')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x526d('0x82')](_0x3b4dac)){_0x228d5d['or'](_0x526d('0x83'),_0x3b4dac+'%')['or'](_0x526d('0x84'),_0x3b4dac+'%');}else{_0x228d5d['or'](_0x526d('0x85'),qs[_0x526d('0x86')](_0x3b4dac))['or'](_0x526d('0x87'),_0x3b4dac+'%');}}}_0x5a717c[_0x526d('0x44')](_0x228d5d);_0x5a717c['group']('i.id');var _0x2a621f={'type':db[_0x526d('0x88')][_0x526d('0x89')][_0x526d('0x8a')],'raw':!![]};var _0x27eccd=_0x5a717c[_0x526d('0x8b')]();_0x27eccd['field'](_0x526d('0x8c'));_0x27eccd['field'](_0x526d('0x8d'),_0x526d('0x8e'));if(_0x2799c3['order']){_0x2799c3[_0x526d('0x42')][_0x526d('0x31')](function(_0xb6d2e2){var _0x507e24=_0xb6d2e2[0x0]===_0x526d('0x8f')?_0xb6d2e2[0x0]:'i.'+_0xb6d2e2[0x0];_0x5a717c[_0x526d('0x42')](_0x507e24,_0xb6d2e2[0x1]===_0x526d('0x90')?![]:!![]);});}if(!_[_0x526d('0x91')](_0x4b564c)){_0x5a717c[_0x526d('0x5f')](_0x529cc8);_0x27eccd[_0x526d('0x44')](_0x526d('0x92'),_0x4b564c);}BPromise[_0x526d('0x93')]()['then'](function(){if(!_0x5740dc){if(_0x23472d[_0x526d('0x39')]['SmsAccountId'])return;_0x27eccd[_0x526d('0x44')](_0x526d('0x94'));_0x5a717c[_0x526d('0x44')](_0x526d('0x94'));return;}if(_0x23472d[_0x526d('0x95')][_0x526d('0x96')]!=='agent')return;return _0x23472d[_0x526d('0x95')][_0x526d('0x97')]({'attributes':['id'],'raw':!![]})[_0x526d('0x25')](function(_0xe65abb){if(_[_0x526d('0x91')](_0xe65abb)){_0x27eccd[_0x526d('0x44')](_0x526d('0x98'));_0x5a717c[_0x526d('0x44')](_0x526d('0x98'));}else{_0x27eccd[_0x526d('0x44')](_0x526d('0x74'),_[_0x526d('0x2c')](_0xe65abb,'id'));_0x5a717c[_0x526d('0x44')](_0x526d('0x74'),_[_0x526d('0x2c')](_0xe65abb,'id'));}});})[_0x526d('0x25')](function(){if(_0x23472d[_0x526d('0x95')]['role']===_0x526d('0x99')&&!_0x5740dc&&!_0x23472d[_0x526d('0x39')][_0x526d('0x73')])return[];return db[_0x526d('0x9a')][_0x526d('0x39')](_0x27eccd[_0x526d('0x9b')](),_0x2a621f);})[_0x526d('0x25')](function(_0x313eda){_0x1bad91[_0x526d('0x9c')]=_0x313eda[_0x526d('0x3f')];if(_0x1bad91[_0x526d('0x9c')]===0x0)return[];return db[_0x526d('0x9a')]['query'](_0xc033d[_0x526d('0x9b')](),_0x2a621f)['then'](function(_0x31ef04){_0x2beb58=_[_0x526d('0x9d')](_0x31ef04,'id');_0x2a621f=_['merge'](_0x2a621f,{'model':db[_0x526d('0x9e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23472d[_0x526d('0x39')][_0x526d('0x3e')]){_0x2799c3[_0x526d('0x3d')]['forEach'](function(_0x532be5){_0x5a717c[_0x526d('0x46')]('i.'+_0x532be5);});}else{_0x5a717c[_0x526d('0x46')](_0x526d('0x8d'),_0x526d('0x8e'));_0x5a717c[_0x526d('0x46')](_0x526d('0x9f'),_0x526d('0xa0'));_0x5a717c[_0x526d('0x46')]('a.mandatoryDisposition',_0x526d('0xa1'));_0x5a717c[_0x526d('0x46')](_0x526d('0xa2'),_0x526d('0x8f'));_0x5a717c[_0x526d('0x46')](_0x526d('0xa3'));_0x5a717c['field'](_0x526d('0xa4'),_0x526d('0xa5'));_0x5a717c[_0x526d('0x46')](_0x526d('0xa6'),_0x526d('0xa7'));_0x5a717c['field'](_0x526d('0xa8'),_0x526d('0xa9'));_0x5a717c[_0x526d('0x46')]('c.phone',_0x526d('0xaa'));_0x5a717c[_0x526d('0x46')](_0x526d('0xab'),_0x526d('0xac'));_0x5a717c['field']('c.fax',_0x526d('0xad'));_0x5a717c[_0x526d('0x46')](_0x526d('0xae'),_0x526d('0xaf'));_0x5a717c[_0x526d('0x46')]('o.internal',_0x526d('0xb0'));_0x5a717c[_0x526d('0x46')](_0x526d('0xb1'),_0x526d('0x2e'));}if(_0x2799c3[_0x526d('0x1f')])_0x5a717c[_0x526d('0x1f')](_0x2799c3[_0x526d('0x1f')]);if(_0x2799c3[_0x526d('0x20')])_0x5a717c[_0x526d('0x20')](_0x2799c3['offset']);return db[_0x526d('0x9a')][_0x526d('0x39')](_0x5a717c[_0x526d('0x9b')](),_0x2a621f);})['then'](function(_0x45c5c5){if(_0x45c5c5['length']>0x0)_0x33045e[_0x526d('0x44')](_0x526d('0xb2'),_[_0x526d('0x2c')](_0x45c5c5,'id'));return db['sequelize']['query'](_0x33045e[_0x526d('0x9b')](),_0x2a621f)['then'](function(_0x2a9450){var _0x440ac7=_[_0x526d('0xb3')](_0x2a9450,'SmsInteractionId');var _0x1a0627=[];_0x45c5c5[_0x526d('0x31')](function(_0x57f05a){_0x1a0627[_0x526d('0x32')](updateSmsInteraction(_0x57f05a,_0x2beb58,_0x440ac7));});return BPromise[_0x526d('0xb4')](_0x1a0627);});});})[_0x526d('0x25')](function(_0x3e392e){_0x1bad91['rows']=_0x3e392e;return _0x1bad91;})['then'](respondWithFilteredResult(_0x5ed9aa,_0x2799c3))[_0x526d('0x33')](handleError(_0x5ed9aa,null));};exports[_0x526d('0xb5')]=function(_0x41f46a,_0x334d32){var _0x259f02={'raw':![],'where':{'id':_0x41f46a['params']['id']}},_0x4a7673={};_0x4a7673[_0x526d('0x38')]=_[_0x526d('0x3a')](db[_0x526d('0x9e')][_0x526d('0x34')]);_0x4a7673['query']=_[_0x526d('0x3a')](_0x41f46a[_0x526d('0x39')]);_0x4a7673[_0x526d('0x3b')]=_[_0x526d('0x3c')](_0x4a7673[_0x526d('0x38')],_0x4a7673[_0x526d('0x39')]);_0x259f02[_0x526d('0x3d')]=_[_0x526d('0x3c')](_0x4a7673[_0x526d('0x38')],qs[_0x526d('0x3e')](_0x41f46a[_0x526d('0x39')][_0x526d('0x3e')]));_0x259f02[_0x526d('0x3d')]=_0x259f02[_0x526d('0x3d')]['length']?_0x259f02[_0x526d('0x3d')]:_0x4a7673['model'];if(_0x41f46a[_0x526d('0x39')]['includeAll']){_0x259f02[_0x526d('0xb6')]=[{'all':!![]}];}_0x259f02=_['merge']({},_0x259f02,_0x41f46a['options']);return db[_0x526d('0x9e')][_0x526d('0x6f')](_0x259f02)['then'](handleEntityNotFound(_0x334d32,null))[_0x526d('0x25')](respondWithResult(_0x334d32,null))['catch'](handleError(_0x334d32,null));};exports['create']=function(_0x2b8c8d,_0x20fde8){return db['SmsInteraction']['create'](_0x2b8c8d['body'],{})[_0x526d('0x25')](respondWithResult(_0x20fde8,0xc9))['catch'](handleError(_0x20fde8,null));};exports[_0x526d('0x24')]=function(_0x5935c9,_0x1a70d0){if(_0x5935c9[_0x526d('0x70')]['id']){delete _0x5935c9[_0x526d('0x70')]['id'];}return db[_0x526d('0x9e')]['find']({'where':{'id':_0x5935c9[_0x526d('0xb7')]['id']}})['then'](handleEntityNotFound(_0x1a70d0,null))[_0x526d('0x25')](saveUpdates(_0x5935c9[_0x526d('0x70')],null))[_0x526d('0x25')](respondWithResult(_0x1a70d0,null))[_0x526d('0x33')](handleError(_0x1a70d0,null));};exports[_0x526d('0x26')]=function(_0x5f1113,_0x2603b8){return db[_0x526d('0x9e')]['find']({'where':{'id':_0x5f1113[_0x526d('0xb7')]['id']}})[_0x526d('0x25')](handleEntityNotFound(_0x2603b8,null))['then'](removeEntity(_0x2603b8,null))['catch'](handleError(_0x2603b8,null));};exports['describe']=function(_0x388f3a,_0x174853){return db['SmsInteraction'][_0x526d('0xb8')]()['then'](respondWithResult(_0x174853,null))[_0x526d('0x33')](handleError(_0x174853,null));};exports[_0x526d('0xb9')]=function(_0x53391a,_0x55a625,_0x5c2eda){return db[_0x526d('0xba')][_0x526d('0x6f')]({'where':{'id':_0x53391a[_0x526d('0xb7')]['id']}})['then'](handleEntityNotFound(_0x55a625,null))[_0x526d('0x25')](function(_0x55504b){if(_0x55504b){return _0x55504b['addMessage'](_0x53391a[_0x526d('0x70')][_0x526d('0xbb')],_[_0x526d('0xbc')](_0x53391a['body'],[_0x526d('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x55a625,null))[_0x526d('0x33')](handleError(_0x55a625,null));};exports[_0x526d('0xbd')]=function(_0x2b52c2,_0x2aa850,_0x35cef3){var _0x5c9110={'raw':![],'where':{}};var _0x5356a3={};var _0x1f7950={'count':0x0,'rows':[]};return db[_0x526d('0x9e')][_0x526d('0xbe')]({'where':{'id':_0x2b52c2['params']['id']}})['then'](handleEntityNotFound(_0x2aa850,null))[_0x526d('0x25')](function(_0x142de3){if(_0x142de3){_0x5356a3[_0x526d('0x38')]=_[_0x526d('0x3a')](db[_0x526d('0xba')][_0x526d('0x34')]);_0x5356a3[_0x526d('0x39')]=_['keys'](_0x2b52c2[_0x526d('0x39')]);_0x5356a3[_0x526d('0x3b')]=_[_0x526d('0x3c')](_0x5356a3[_0x526d('0x38')],_0x5356a3['query']);_0x5c9110[_0x526d('0x3d')]=_[_0x526d('0x3c')](_0x5356a3[_0x526d('0x38')],qs['fields'](_0x2b52c2['query'][_0x526d('0x3e')]));_0x5c9110['attributes']=_0x5c9110[_0x526d('0x3d')][_0x526d('0x3f')]?_0x5c9110[_0x526d('0x3d')]:_0x5356a3[_0x526d('0x38')];if(!_0x2b52c2[_0x526d('0x39')][_0x526d('0x40')](_0x526d('0x41'))){_0x5c9110[_0x526d('0x1f')]=qs[_0x526d('0x1f')](_0x2b52c2[_0x526d('0x39')][_0x526d('0x1f')]);_0x5c9110[_0x526d('0x20')]=qs[_0x526d('0x20')](_0x2b52c2[_0x526d('0x39')][_0x526d('0x20')]);}_0x5c9110[_0x526d('0x42')]=qs[_0x526d('0x43')](_0x2b52c2[_0x526d('0x39')][_0x526d('0x43')]);_0x5c9110[_0x526d('0x44')]=qs[_0x526d('0x3b')](_[_0x526d('0x45')](_0x2b52c2[_0x526d('0x39')],_0x5356a3['filters']));_0x5c9110['where']['SmsInteractionId']=_0x142de3['id'];if(_0x2b52c2['query'][_0x526d('0x81')]){_0x5c9110[_0x526d('0x44')]=_['merge'](_0x5c9110[_0x526d('0x44')],{'$or':_[_0x526d('0x2c')](_0x5c9110[_0x526d('0x3d')],function(_0xf44fba){var _0x4c35bb={};_0x4c35bb[_0xf44fba]={'$like':'%'+_0x2b52c2[_0x526d('0x39')][_0x526d('0x81')]+'%'};return _0x4c35bb;})});}if(_0x2b52c2[_0x526d('0x39')][_0x526d('0x77')]){var _0xae681e=_0x2b52c2[_0x526d('0x39')][_0x526d('0x77')][_0x526d('0x30')](',');var _0x30ca2a={};_0x30ca2a[_0xae681e[0x0]]={'$gte':moment(_0xae681e[0x1])[_0x526d('0xbf')](_0x526d('0xc0'))};_0x5c9110[_0x526d('0x44')]=_[_0x526d('0xc1')](_0x5c9110['where'],_0x30ca2a);}_0x5c9110=_[_0x526d('0xc1')]({},_0x5c9110,_0x2b52c2[_0x526d('0xc2')]);return db[_0x526d('0xba')]['count']({'where':_0x5c9110[_0x526d('0x44')]})[_0x526d('0x25')](function(_0x26e36f){_0x1f7950[_0x526d('0x9c')]=_0x26e36f;if(_0x2b52c2[_0x526d('0x39')][_0x526d('0xc3')]){_0x5c9110['include']=[{'all':!![]}];}return db[_0x526d('0xba')]['findAll'](_0x5c9110);})[_0x526d('0x25')](function(_0x28ee85){_0x1f7950[_0x526d('0xc4')]=_0x28ee85;return _0x1f7950;});}})['then'](respondWithFilteredResult(_0x2aa850,_0x5c9110))[_0x526d('0x33')](handleError(_0x2aa850,null));};exports[_0x526d('0xc5')]=function(_0x37a99e,_0x37989c,_0x5c1bfe){return db[_0x526d('0x9e')][_0x526d('0x6f')]({'where':{'id':_0x37a99e[_0x526d('0xb7')]['id']}})[_0x526d('0x25')](handleEntityNotFound(_0x37989c,null))[_0x526d('0x25')](function(_0x108277){if(_0x108277){return _0x108277[_0x526d('0xc6')](_0x37a99e[_0x526d('0x70')][_0x526d('0xbb')],_['omit'](_0x37a99e['body'],[_0x526d('0xbb'),'id'])||{})['spread'](function(){return db[_0x526d('0x69')][_0x526d('0xc7')]({'attributes':['id',_0x526d('0x29'),_0x526d('0x47')],'where':{'id':_0x37a99e['body'][_0x526d('0xbb')]}});})[_0x526d('0x25')](function(_0x19199c){socket[_0x526d('0xc8')](_0x526d('0xc9'),{'id':Number(_0x37a99e[_0x526d('0xb7')]['id']),'tags':_0x19199c||[]});return{'id':Number(_0x37a99e[_0x526d('0xb7')]['id']),'tags':_0x19199c||[]};});}})['then'](respondWithResult(_0x37989c,null))[_0x526d('0x33')](handleError(_0x37989c,null));};exports['removeTags']=function(_0x1857cc,_0x2cd3a3,_0x2a7cf3){return db['SmsInteraction'][_0x526d('0x6f')]({'where':{'id':_0x1857cc[_0x526d('0xb7')]['id']}})[_0x526d('0x25')](handleEntityNotFound(_0x2cd3a3,null))[_0x526d('0x25')](function(_0x5e2d68){if(_0x5e2d68){return _0x5e2d68[_0x526d('0xca')](_0x1857cc[_0x526d('0x39')][_0x526d('0xbb')]);}})['then'](respondWithStatusCode(_0x2cd3a3,null))[_0x526d('0x33')](handleError(_0x2cd3a3,null));};exports[_0x526d('0xcb')]=function(_0x29f91d,_0x52feba){var _0xb3f527=moment()['unix']()[_0x526d('0x9b')]();var _0x5a408a=path[_0x526d('0xcc')](config['root'],_0x526d('0xcd'),_0x526d('0xce'),_0x526d('0xcf'));var _0x21fea6=path[_0x526d('0xcc')](config['root'],_0x526d('0xcd'),_0x526d('0xce'),'attachments');var _0x277368=path[_0x526d('0xcc')](_0x5a408a,_0xb3f527);var _0x524431=util[_0x526d('0xbf')](_0x526d('0xd0'),_0x29f91d[_0x526d('0xb7')]['id'],_0xb3f527);var _0x5c4e23=path[_0x526d('0xcc')](_0x5a408a,_0x524431);var _0x46e565=[];_0x46e565[_0x526d('0x32')]({'model':db['User'],'as':_0x526d('0x6b'),'attributes':['id','fullname'],'raw':!![]});_0x46e565[_0x526d('0x32')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x526d('0xd1'),_0x526d('0xd2')],'raw':!![]});var _0x55a2e0=[{'model':db[_0x526d('0xba')],'as':_0x526d('0xd3'),'attributes':['id','body',_0x526d('0x75'),_0x526d('0xd4'),_0x526d('0xd5'),_0x526d('0x7c')],'include':_0x46e565}];_0x55a2e0[_0x526d('0x32')]({'model':db[_0x526d('0xd6')],'as':'Account','attributes':['id',_0x526d('0x29')]});_0x55a2e0[_0x526d('0x32')]({'model':db[_0x526d('0x6b')],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0x526d('0x6f')]({'where':{'id':_0x29f91d[_0x526d('0xb7')]['id']},'include':_0x55a2e0})[_0x526d('0x25')](handleEntityNotFound(_0x52feba,null))[_0x526d('0x25')](function(_0x4c51a9){if(_0x4c51a9){var _0x2ba6d7=_0x4c51a9[_0x526d('0xd7')]({'plain':!![]});fs[_0x526d('0xd8')](_0x277368);var _0x22362f={'channel':_0x526d('0xd9'),'account':_0x2ba6d7[_0x526d('0xda')]['name'],'agent':_0x2ba6d7[_0x526d('0xdb')]?_0x2ba6d7[_0x526d('0xdb')]['fullname']:'N.A.','createdAt':moment(_0x2ba6d7[_0x526d('0x75')])[_0x526d('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x526d('0x9b')](),'closedAt':_0x2ba6d7[_0x526d('0xdc')]?moment(_0x2ba6d7[_0x526d('0xdd')])[_0x526d('0xbf')](_0x526d('0xc0'))[_0x526d('0x9b')]():'','disposition':_0x2ba6d7[_0x526d('0xde')],'messages':_(_0x2ba6d7['Messages'])[_0x526d('0x81')]({'secret':![]})['map'](function(_0x21ebee){return{'date':moment(_0x21ebee[_0x526d('0x75')])[_0x526d('0xbf')](_0x526d('0xc0'))[_0x526d('0x9b')](),'sender':_0x21ebee[_0x526d('0xd4')]==='out'?_0x21ebee[_0x526d('0x6b')]?_0x21ebee[_0x526d('0x6b')][_0x526d('0x2d')]:_0x526d('0xdf'):_0x21ebee['Contact'][_0x526d('0xd1')]+(_0x21ebee[_0x526d('0x62')]['lastName']?'\x20'+_0x21ebee[_0x526d('0x62')][_0x526d('0xd2')]:''),'body':_0x21ebee[_0x526d('0x70')],'direction':_0x21ebee[_0x526d('0xd4')]===_0x526d('0xe0')?'A':'C','secret':_0x21ebee[_0x526d('0xd5')],'read':_0x21ebee[_0x526d('0x7c')]};})[_0x526d('0x63')]()};return ejs['renderFile'](path[_0x526d('0xcc')](config[_0x526d('0xe1')],_0x526d('0xcd'),_0x526d('0xe2'),'downloadInteraction.ejs'),{'interaction':_0x22362f})[_0x526d('0x25')](function(_0x57c1ad){var _0x4b430f=path[_0x526d('0xcc')](_0x277368,_0x526d('0xe3')+_0x2ba6d7['id']+'-'+_0xb3f527+_0x526d('0xe4'));var _0x4c9238={'path':_0x4b430f,'channel':_0x526d('0xd9'),'interactionId':_0x2ba6d7['id']};return pdf[_0x526d('0xe5')](_0x57c1ad,_0x4c9238);})[_0x526d('0x25')](function(){return new BPromise(function(_0x13d476,_0x17d170){zipdir(_0x277368,{'saveTo':_0x5c4e23},function(_0x86d5f8,_0x4c06e7){if(_0x86d5f8)return _0x17d170(_0x86d5f8);return _0x13d476(_0x4c06e7);});})['then'](function(){return new BPromise(function(_0x5432b0,_0x3b1025){rimraf(_0x277368,function(_0x1756cb){if(_0x1756cb)_0x3b1025(_0x1756cb);return _0x5432b0();});});})[_0x526d('0x25')](function(){return _0x52feba[_0x526d('0xcb')](_0x5c4e23,_0x524431,function(_0x5c992e){if(_0x5c992e){console[_0x526d('0xe6')](_0x526d('0xe7'),_0x5c992e);}else{fs[_0x526d('0xe8')](_0x5c4e23);}});});});}else{return _0x52feba[_0x526d('0xe9')](0xc8);}})[_0x526d('0x33')](handleError(_0x52feba,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 0dd33a9..15f3933 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 _0xdd4f=['setMaxListeners','update','remove','getUsers','then','Users','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','SmsMessage'];(function(_0x555da1,_0xa82be7){var _0x372361=function(_0x4f6d2e){while(--_0x4f6d2e){_0x555da1['push'](_0x555da1['shift']());}};_0x372361(++_0xa82be7);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x3625f0,_0x33a66c){_0x3625f0=_0x3625f0-0x0;var _0x2312a1=_0xdd4f[_0x3625f0];return _0x2312a1;};'use strict';var EventEmitter=require(_0xfdd4('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0xfdd4('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xfdd4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfdd4('0x3'),'afterDestroy':_0xfdd4('0x4')};function emitEvent(_0x6b2b0d){return function(_0x554e44,_0x398015,_0x43cbcf){_0x554e44[_0xfdd4('0x5')]({'attributes':['id'],'raw':!![]})[_0xfdd4('0x6')](function(_0x3c72d4){_0x554e44['setDataValue'](_0xfdd4('0x7'),_0x3c72d4['map'](function(_0x4181d6){return{'id':_0x4181d6['id']};}));return SmsMessage[_0xfdd4('0x8')]({'where':{'SmsInteractionId':_0x554e44['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfdd4('0x6')](function(_0x4ee02f){_0x554e44[_0xfdd4('0x9')]('unreadMessages',_0x4ee02f[_0xfdd4('0xa')]);SmsInteractionEvents[_0xfdd4('0xb')](_0x6b2b0d+':'+_0x554e44['id'],_0x554e44);SmsInteractionEvents[_0xfdd4('0xb')](_0x6b2b0d,_0x554e44);_0x43cbcf(null);})[_0xfdd4('0xc')](_0x43cbcf(null));};}for(var e in events){if(events[_0xfdd4('0xd')](e)){var event=events[e];SmsInteraction[_0xfdd4('0xe')](e,emitEvent(event));}}module[_0xfdd4('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x3423=['then','setDataValue','Users','map','findAll','catch','hasOwnProperty','exports','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x11a278,_0x349407){var _0x47bb25=function(_0x3592d5){while(--_0x3592d5){_0x11a278['push'](_0x11a278['shift']());}};_0x47bb25(++_0x349407);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x3342('0x0')];var SmsMessage=require(_0x3342('0x1'))['db'][_0x3342('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3342('0x3')](0x0);var events={'afterCreate':_0x3342('0x4'),'afterUpdate':_0x3342('0x5'),'afterDestroy':_0x3342('0x6')};function emitEvent(_0x3c5d8d){return function(_0x3075f8,_0x19206f,_0x467453){_0x3075f8[_0x3342('0x7')]({'attributes':['id'],'raw':!![]})[_0x3342('0x8')](function(_0x420d4b){_0x3075f8[_0x3342('0x9')](_0x3342('0xa'),_0x420d4b[_0x3342('0xb')](function(_0xd9d129){return{'id':_0xd9d129['id']};}));return SmsMessage[_0x3342('0xc')]({'where':{'SmsInteractionId':_0x3075f8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x582c37){_0x3075f8[_0x3342('0x9')]('unreadMessages',_0x582c37['length']);SmsInteractionEvents['emit'](_0x3c5d8d+':'+_0x3075f8['id'],_0x3075f8);SmsInteractionEvents['emit'](_0x3c5d8d,_0x3075f8);_0x467453(null);})[_0x3342('0xd')](_0x467453(null));};}for(var e in events){if(events[_0x3342('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x3342('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 1bf6b9e..15081e1 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 _0x948d=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x54727a,_0x37d477){var _0x414e28=function(_0x332fdd){while(--_0x332fdd){_0x54727a['push'](_0x54727a['shift']());}};_0x414e28(++_0x37d477);}(_0x948d,0x1be));var _0xd948=function(_0x557e53,_0x1170e0){_0x557e53=_0x557e53-0x0;var _0x21ef9b=_0x948d[_0x557e53];return _0x21ef9b;};'use strict';var _=require(_0xd948('0x0'));var util=require(_0xd948('0x1'));var logger=require(_0xd948('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd948('0x3'));var rp=require(_0xd948('0x4'));var fs=require('fs');var path=require(_0xd948('0x5'));var rimraf=require(_0xd948('0x6'));var config=require(_0xd948('0x7'));var attributes=require(_0xd948('0x8'));module[_0xd948('0x9')]=function(_0x4c707a,_0x129484){return _0x4c707a['define'](_0xd948('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b5482,_0x41fe9a,_0x2e19e5){if(_0x3b5482[_0xd948('0xb')](_0xd948('0xc'))){_0x3b5482[_0xd948('0xd')]=moment()[_0xd948('0xe')](_0xd948('0xf'));}_0x2e19e5(null,_0x3b5482);}}});}; \ No newline at end of file +var _0xb9c7=['util','../../config/logger','moment','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x2724f0,_0x6f9855){var _0x52ee7e=function(_0x49fc35){while(--_0x49fc35){_0x2724f0['push'](_0x2724f0['shift']());}};_0x52ee7e(++_0x6f9855);}(_0xb9c7,0x8f));var _0x7b9c=function(_0x5f1cc5,_0x1d5082){_0x5f1cc5=_0x5f1cc5-0x0;var _0x1d9e7c=_0xb9c7[_0x5f1cc5];return _0x1d9e7c;};'use strict';var _=require(_0x7b9c('0x0'));var util=require(_0x7b9c('0x1'));var logger=require(_0x7b9c('0x2'))('api');var moment=require(_0x7b9c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b9c('0x4'));var rimraf=require(_0x7b9c('0x5'));var config=require(_0x7b9c('0x6'));var attributes=require(_0x7b9c('0x7'));module[_0x7b9c('0x8')]=function(_0x562eee,_0x5c39b6){return _0x562eee[_0x7b9c('0x9')](_0x7b9c('0xa'),attributes,{'tableName':_0x7b9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b3580,_0x2b11c7,_0x53c5cb){if(_0x1b3580[_0x7b9c('0xc')]('closed')){_0x1b3580[_0x7b9c('0xd')]=moment()[_0x7b9c('0xe')](_0x7b9c('0xf'));}_0x53c5cb(null,_0x1b3580);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d5cb1bf..61eebdb 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 _0xec7a=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateSmsInteraction','body','options','where','attributes','limit','stringify','catch','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x544d55,_0x4bb645){var _0x9c2cc=function(_0x196305){while(--_0x196305){_0x544d55['push'](_0x544d55['shift']());}};_0x9c2cc(++_0x4bb645);}(_0xec7a,0x12b));var _0xaec7=function(_0x4ed9ef,_0x381176){_0x4ed9ef=_0x4ed9ef-0x0;var _0x2bb85b=_0xec7a[_0x4ed9ef];return _0x2bb85b;};'use strict';var _=require(_0xaec7('0x0'));var util=require(_0xaec7('0x1'));var moment=require(_0xaec7('0x2'));var BPromise=require(_0xaec7('0x3'));var rs=require(_0xaec7('0x4'));var fs=require('fs');var Redis=require(_0xaec7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaec7('0x6'));var logger=require(_0xaec7('0x7'))(_0xaec7('0x8'));var config=require('../../config/environment');var jayson=require(_0xaec7('0x9'));var client=jayson[_0xaec7('0xa')]['http']({'port':0x232a});config[_0xaec7('0xb')]=_['defaults'](config[_0xaec7('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaec7('0xb')]));require('./smsInteraction.socket')[_0xaec7('0xc')](socket);function respondWithRpcPromise(_0x2dc48a,_0x3868f2,_0x24f396){return new BPromise(function(_0x448f9b,_0x56b678){return client[_0xaec7('0xd')](_0x2dc48a,_0x24f396)[_0xaec7('0xe')](function(_0x381250){logger[_0xaec7('0xf')](_0xaec7('0x10'),_0x3868f2,'request\x20sent');logger[_0xaec7('0x11')](_0xaec7('0x12'),_0x3868f2,_0xaec7('0x13'),JSON['stringify'](_0x381250));if(_0x381250[_0xaec7('0x14')]){if(_0x381250[_0xaec7('0x14')][_0xaec7('0x15')]===0x1f4){logger[_0xaec7('0x14')](_0xaec7('0x10'),_0x3868f2,_0x381250['error'][_0xaec7('0x16')]);return _0x56b678(_0x381250[_0xaec7('0x14')]['message']);}logger[_0xaec7('0x14')](_0xaec7('0x10'),_0x3868f2,_0x381250['error'][_0xaec7('0x16')]);return _0x448f9b(_0x381250[_0xaec7('0x14')][_0xaec7('0x16')]);}else{logger[_0xaec7('0xf')](_0xaec7('0x10'),_0x3868f2,_0xaec7('0x13'));_0x448f9b(_0x381250[_0xaec7('0x17')][_0xaec7('0x16')]);}})['catch'](function(_0x469746){logger[_0xaec7('0x14')](_0xaec7('0x10'),_0x3868f2,_0x469746);_0x56b678(_0x469746);});});}exports[_0xaec7('0x18')]=function(_0x4d1ef6){var _0x38e036=this;return new Promise(function(_0x588fa4,_0x45148d){return db['SmsInteraction']['update'](_0x4d1ef6[_0xaec7('0x19')],{'raw':_0x4d1ef6[_0xaec7('0x1a')]?_0x4d1ef6[_0xaec7('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d1ef6[_0xaec7('0x1a')]?_0x4d1ef6[_0xaec7('0x1a')][_0xaec7('0x1b')]||null:null,'attributes':_0x4d1ef6[_0xaec7('0x1a')]?_0x4d1ef6[_0xaec7('0x1a')][_0xaec7('0x1c')]||null:null,'limit':_0x4d1ef6[_0xaec7('0x1a')]?_0x4d1ef6[_0xaec7('0x1a')][_0xaec7('0x1d')]||null:null})[_0xaec7('0xe')](function(_0x5efa44){logger[_0xaec7('0xf')](_0xaec7('0x18'),_0x4d1ef6);logger[_0xaec7('0x11')]('UpdateSmsInteraction',_0x4d1ef6,JSON[_0xaec7('0x1e')](_0x5efa44));_0x588fa4(_0x5efa44);})[_0xaec7('0x1f')](function(_0x1fce62){logger[_0xaec7('0x14')](_0xaec7('0x18'),_0x1fce62['message'],_0x4d1ef6);_0x45148d(_0x38e036['error'](0x1f4,_0x1fce62[_0xaec7('0x16')]));});});};exports[_0xaec7('0x20')]=function(_0x1bcc9d){return new Promise(function(_0xa07929,_0x128d69){return db['SmsInteraction'][_0xaec7('0x21')]({'where':_0x1bcc9d[_0xaec7('0x1a')]?_0x1bcc9d[_0xaec7('0x1a')]['where']||null:null})[_0xaec7('0xe')](function(_0x127137){if(_0x127137){return _0x127137[_0xaec7('0x22')](_0x1bcc9d[_0xaec7('0x19')][_0xaec7('0x23')],_['omit'](_0x1bcc9d[_0xaec7('0x19')],[_0xaec7('0x23'),'id'])||{});}})[_0xaec7('0x24')](function(_0x209dd2){logger[_0xaec7('0xf')](_0xaec7('0x25'),_0x1bcc9d);logger['debug']('AddTags',_0x1bcc9d,JSON['stringify'](_0x209dd2));_0xa07929(_0x209dd2);})[_0xaec7('0x1f')](function(_0x5555cd){logger[_0xaec7('0x14')]('AddTags',_0x5555cd[_0xaec7('0x16')],_0x1bcc9d);_0x128d69(_this[_0xaec7('0x14')](0x1f4,_0x5555cd[_0xaec7('0x16')]));});});}; \ No newline at end of file +var _0x1685=['addTags','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','redis','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SmsInteraction,\x20%s,\x20%s','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','limit','debug','AddTagsToSmsInteraction','find','then'];(function(_0x1ecbad,_0xe90ac4){var _0x50fe57=function(_0x349653){while(--_0x349653){_0x1ecbad['push'](_0x1ecbad['shift']());}};_0x50fe57(++_0xe90ac4);}(_0x1685,0x6f));var _0x5168=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x1685[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x5168('0x0'));var util=require(_0x5168('0x1'));var moment=require('moment');var BPromise=require(_0x5168('0x2'));var rs=require(_0x5168('0x3'));var fs=require('fs');var Redis=require(_0x5168('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5168('0x5'));var logger=require(_0x5168('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5168('0x7')]({'port':0x232a});config[_0x5168('0x8')]=_['defaults'](config[_0x5168('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x5168('0x9'))(new Redis(config[_0x5168('0x8')]));require(_0x5168('0xa'))[_0x5168('0xb')](socket);function respondWithRpcPromise(_0xffe30b,_0x239e48,_0x1d7b34){return new BPromise(function(_0x2e6fc8,_0x14275a){return client[_0x5168('0xc')](_0xffe30b,_0x1d7b34)['then'](function(_0x125ab1){logger[_0x5168('0xd')]('SmsInteraction,\x20%s,\x20%s',_0x239e48,'request\x20sent');logger['debug'](_0x5168('0xe'),_0x239e48,_0x5168('0xf'),JSON[_0x5168('0x10')](_0x125ab1));if(_0x125ab1['error']){if(_0x125ab1[_0x5168('0x11')]['code']===0x1f4){logger[_0x5168('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x239e48,_0x125ab1[_0x5168('0x11')][_0x5168('0x12')]);return _0x14275a(_0x125ab1[_0x5168('0x11')]['message']);}logger[_0x5168('0x11')](_0x5168('0x13'),_0x239e48,_0x125ab1[_0x5168('0x11')]['message']);return _0x2e6fc8(_0x125ab1[_0x5168('0x11')]['message']);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x239e48,_0x5168('0xf'));_0x2e6fc8(_0x125ab1[_0x5168('0x14')]['message']);}})[_0x5168('0x15')](function(_0x11a397){logger[_0x5168('0x11')](_0x5168('0x13'),_0x239e48,_0x11a397);_0x14275a(_0x11a397);});});}exports[_0x5168('0x16')]=function(_0x33c6d3){var _0x505997=this;return new Promise(function(_0x112a2e,_0x1c24a6){return db[_0x5168('0x17')]['update'](_0x33c6d3[_0x5168('0x18')],{'raw':_0x33c6d3['options']?_0x33c6d3[_0x5168('0x19')][_0x5168('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33c6d3[_0x5168('0x19')]?_0x33c6d3['options'][_0x5168('0x1b')]||null:null,'attributes':_0x33c6d3[_0x5168('0x19')]?_0x33c6d3[_0x5168('0x19')]['attributes']||null:null,'limit':_0x33c6d3[_0x5168('0x19')]?_0x33c6d3[_0x5168('0x19')][_0x5168('0x1c')]||null:null})['then'](function(_0x520e95){logger['info'](_0x5168('0x16'),_0x33c6d3);logger[_0x5168('0x1d')]('UpdateSmsInteraction',_0x33c6d3,JSON['stringify'](_0x520e95));_0x112a2e(_0x520e95);})[_0x5168('0x15')](function(_0x4767e6){logger[_0x5168('0x11')](_0x5168('0x16'),_0x4767e6[_0x5168('0x12')],_0x33c6d3);_0x1c24a6(_0x505997['error'](0x1f4,_0x4767e6[_0x5168('0x12')]));});});};exports[_0x5168('0x1e')]=function(_0x1ed82d){return new Promise(function(_0x58f96f,_0xa1fefb){return db[_0x5168('0x17')][_0x5168('0x1f')]({'where':_0x1ed82d[_0x5168('0x19')]?_0x1ed82d[_0x5168('0x19')][_0x5168('0x1b')]||null:null})[_0x5168('0x20')](function(_0x38ea93){if(_0x38ea93){return _0x38ea93[_0x5168('0x21')](_0x1ed82d[_0x5168('0x18')][_0x5168('0x22')],_['omit'](_0x1ed82d['body'],[_0x5168('0x22'),'id'])||{});}})['spread'](function(_0x10d887){logger[_0x5168('0xd')]('AddTags',_0x1ed82d);logger[_0x5168('0x1d')](_0x5168('0x23'),_0x1ed82d,JSON[_0x5168('0x10')](_0x10d887));_0x58f96f(_0x10d887);})[_0x5168('0x15')](function(_0x169ab2){logger[_0x5168('0x11')](_0x5168('0x23'),_0x169ab2[_0x5168('0x12')],_0x1ed82d);_0xa1fefb(_this[_0x5168('0x11')](0x1f4,_0x169ab2['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index f5e9913..11a4064 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 _0xda51=['emit','removeListener','length','save'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0xda51,0xab));var _0x1da5=function(_0x26d9b3,_0x591f4e){_0x26d9b3=_0x26d9b3-0x0;var _0x15c226=_0xda51[_0x26d9b3];return _0x15c226;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x1da5('0x0'),'remove','update'];function createListener(_0x5b4b48,_0x5072b8){return function(_0x89bcfb){_0x5072b8[_0x1da5('0x1')](_0x5b4b48,_0x89bcfb);};}function removeListener(_0x14ae97,_0x30b3cc){return function(){SmsInteractionEvents[_0x1da5('0x2')](_0x14ae97,_0x30b3cc);};}exports['register']=function(_0x1caaa0){for(var _0x17b6be=0x0,_0x3dee37=events[_0x1da5('0x3')];_0x17b6be<_0x3dee37;_0x17b6be++){var _0x3f33c0=events[_0x17b6be];var _0x22cc7b=createListener('smsInteraction:'+_0x3f33c0,_0x1caaa0);SmsInteractionEvents['on'](_0x3f33c0,_0x22cc7b);}}; \ No newline at end of file +var _0x6616=['register','smsInteraction:','save','update','removeListener'];(function(_0x254479,_0x1bf884){var _0x3e93ea=function(_0x2081e0){while(--_0x2081e0){_0x254479['push'](_0x254479['shift']());}};_0x3e93ea(++_0x1bf884);}(_0x6616,0x1b0));var _0x6661=function(_0x1c24a8,_0x36eb21){_0x1c24a8=_0x1c24a8-0x0;var _0x195054=_0x6616[_0x1c24a8];return _0x195054;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x6661('0x0'),'remove',_0x6661('0x1')];function createListener(_0x1f1029,_0x1bf2c5){return function(_0x126559){_0x1bf2c5['emit'](_0x1f1029,_0x126559);};}function removeListener(_0x4cb1a7,_0x465d10){return function(){SmsInteractionEvents[_0x6661('0x2')](_0x4cb1a7,_0x465d10);};}exports[_0x6661('0x3')]=function(_0x697034){for(var _0x20b694=0x0,_0x32e7e6=events['length'];_0x20b694<_0x32e7e6;_0x20b694++){var _0x27ef12=events[_0x20b694];var _0x1a41d6=createListener(_0x6661('0x4')+_0x27ef12,_0x697034);SmsInteractionEvents['on'](_0x27ef12,_0x1a41d6);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 5ce90d8..14d354f 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 _0xcdd6=['tracked','sms','smsmessage:create','create','post','/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xcdd6,0x1be));var _0x6cdd=function(_0x1db1f2,_0x238fb1){_0x1db1f2=_0x1db1f2-0x0;var _0x530e85=_0xcdd6[_0x1db1f2];return _0x530e85;};'use strict';var multer=require('multer');var util=require(_0x6cdd('0x0'));var path=require(_0x6cdd('0x1'));var timeout=require(_0x6cdd('0x2'));var express=require(_0x6cdd('0x3'));var router=express['Router']();var fs_extra=require(_0x6cdd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6cdd('0x5'));var config=require(_0x6cdd('0x6'));var controller=require(_0x6cdd('0x7'));router[_0x6cdd('0x8')]('/',auth[_0x6cdd('0x9')](),controller['index']);router[_0x6cdd('0x8')]('/describe',auth[_0x6cdd('0x9')](),controller[_0x6cdd('0xa')]);router[_0x6cdd('0x8')](_0x6cdd('0xb'),auth[_0x6cdd('0x9')](),controller[_0x6cdd('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x6cdd('0xd')](_0x6cdd('0xe'),_0x6cdd('0xf')),controller[_0x6cdd('0x10')]);router[_0x6cdd('0x11')](_0x6cdd('0x12'),controller[_0x6cdd('0x13')]);router[_0x6cdd('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6cdd('0x15')]);router[_0x6cdd('0x14')]('/:id/accept',auth[_0x6cdd('0x9')](),controller[_0x6cdd('0x16')]);router[_0x6cdd('0x14')](_0x6cdd('0x17'),auth[_0x6cdd('0x9')](),controller[_0x6cdd('0x18')]);router[_0x6cdd('0x19')](_0x6cdd('0xb'),auth[_0x6cdd('0x9')](),controller[_0x6cdd('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xdeb2=['show','post','tracked','smsmessage:create','/:id/status','status','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x342886,_0x1ab16e){var _0x58dd0e=function(_0x449ab9){while(--_0x449ab9){_0x342886['push'](_0x342886['shift']());}};_0x58dd0e(++_0x1ab16e);}(_0xdeb2,0x64));var _0x2deb=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0xdeb2[_0x4c184d];return _0x23d997;};'use strict';var multer=require(_0x2deb('0x0'));var util=require(_0x2deb('0x1'));var path=require(_0x2deb('0x2'));var timeout=require(_0x2deb('0x3'));var express=require(_0x2deb('0x4'));var router=express['Router']();var fs_extra=require(_0x2deb('0x5'));var auth=require(_0x2deb('0x6'));var interaction=require(_0x2deb('0x7'));var config=require(_0x2deb('0x8'));var controller=require(_0x2deb('0x9'));router[_0x2deb('0xa')]('/',auth['isAuthenticated'](),controller[_0x2deb('0xb')]);router[_0x2deb('0xa')](_0x2deb('0xc'),auth[_0x2deb('0xd')](),controller[_0x2deb('0xe')]);router[_0x2deb('0xa')](_0x2deb('0xf'),auth['isAuthenticated'](),controller[_0x2deb('0x10')]);router[_0x2deb('0x11')]('/',auth[_0x2deb('0xd')](),interaction[_0x2deb('0x12')]('sms',_0x2deb('0x13')),controller['create']);router[_0x2deb('0x11')](_0x2deb('0x14'),controller[_0x2deb('0x15')]);router[_0x2deb('0x16')](_0x2deb('0xf'),auth['isAuthenticated'](),controller['update']);router['put'](_0x2deb('0x17'),auth[_0x2deb('0xd')](),controller[_0x2deb('0x18')]);router[_0x2deb('0x16')]('/:id/reject',auth[_0x2deb('0xd')](),controller[_0x2deb('0x19')]);router[_0x2deb('0x1a')](_0x2deb('0xf'),auth['isAuthenticated'](),controller[_0x2deb('0x1b')]);module[_0x2deb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 583ae4c..e04c45d 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 _0xd2e3=['sequelize','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x50f7e6,_0xa29d72){var _0x68d004=function(_0x4952b4){while(--_0x4952b4){_0x50f7e6['push'](_0x50f7e6['shift']());}};_0x68d004(++_0xa29d72);}(_0xd2e3,0x1e3));var _0x3d2e=function(_0x9cf49,_0x1c25f9){_0x9cf49=_0x9cf49-0x0;var _0x47816a=_0xd2e3[_0x9cf49];return _0x47816a;};'use strict';var Sequelize=require(_0x3d2e('0x0'));module['exports']={'body':{'type':Sequelize[_0x3d2e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3d2e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3d2e('0x3')]('in',_0x3d2e('0x4')),'defaultValue':_0x3d2e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3d2e('0x5')](0xbe)},'phone':{'type':Sequelize[_0x3d2e('0x5')]},'readAt':{'type':Sequelize[_0x3d2e('0x6')]},'secret':{'type':Sequelize[_0x3d2e('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3d2e('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3e51=['STRING','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x33537b,_0x1e1d93){var _0x46fd8e=function(_0x5e8dda){while(--_0x5e8dda){_0x33537b['push'](_0x33537b['shift']());}};_0x46fd8e(++_0x1e1d93);}(_0x3e51,0xa3));var _0x13e5=function(_0x37010b,_0x1d1778){_0x37010b=_0x37010b-0x0;var _0x118613=_0x3e51[_0x37010b];return _0x118613;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x13e5('0x0')](_0x13e5('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x13e5('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x13e5('0x3')]('in',_0x13e5('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x13e5('0x5')](0xbe)},'phone':{'type':Sequelize[_0x13e5('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x13e5('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x13e5('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 7f7956e..b461c0b 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 _0x7b77=['model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','describe','sms-interactions','accept','sms','read','readAt','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','stringify','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','delivered','Status','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','debug','error','SmsMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key'];(function(_0x49a4b5,_0x420d0c){var _0x343547=function(_0xdd6b78){while(--_0xdd6b78){_0x49a4b5['push'](_0x49a4b5['shift']());}};_0x343547(++_0x420d0c);}(_0x7b77,0x179));var _0x77b7=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x7b77[_0x178856];return _0x3c7fe7;};'use strict';var emlformat=require(_0x77b7('0x0'));var rimraf=require(_0x77b7('0x1'));var zipdir=require(_0x77b7('0x2'));var jsonpatch=require(_0x77b7('0x3'));var rp=require('request-promise');var moment=require(_0x77b7('0x4'));var BPromise=require(_0x77b7('0x5'));var Mustache=require(_0x77b7('0x6'));var util=require('util');var path=require(_0x77b7('0x7'));var sox=require(_0x77b7('0x8'));var csv=require(_0x77b7('0x9'));var ejs=require(_0x77b7('0xa'));var fs=require('fs');var fs_extra=require(_0x77b7('0xb'));var _=require(_0x77b7('0xc'));var squel=require('squel');var crypto=require(_0x77b7('0xd'));var jsforce=require(_0x77b7('0xe'));var deskjs=require(_0x77b7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x77b7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x77b7('0x11'));var as=require(_0x77b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77b7('0x13'))(_0x77b7('0x14'));var utils=require(_0x77b7('0x15'));var config=require(_0x77b7('0x16'));var licenseUtil=require(_0x77b7('0x17'));var db=require(_0x77b7('0x18'))['db'];config[_0x77b7('0x19')]=_['defaults'](config[_0x77b7('0x19')],{'host':_0x77b7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x77b7('0x1b')](socket);var jayson=require(_0x77b7('0x1c'));var client=jayson[_0x77b7('0x1d')][_0x77b7('0x1e')]({'port':0x232c});var client9002=jayson[_0x77b7('0x1d')][_0x77b7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4dbe04,_0x19d460,_0x253543,_0x3cb44b){return new BPromise(function(_0x2060df,_0x1cd7dd){var _0x25f361=_0x3cb44b||client;return _0x25f361[_0x77b7('0x1f')](_0x4dbe04,_0x253543)[_0x77b7('0x20')](function(_0x286046){logger['info']('SmsMessage,\x20%s,\x20%s',_0x19d460,'request\x20sent');logger[_0x77b7('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x19d460,'request\x20sent',JSON['stringify'](_0x286046));if(_0x286046['error']){if(_0x286046[_0x77b7('0x22')]['code']===0x1f4){logger[_0x77b7('0x22')]('SmsMessage,\x20%s,\x20%s',_0x19d460,_0x286046[_0x77b7('0x22')]['message']);return _0x1cd7dd(_0x286046[_0x77b7('0x22')]['message']);}logger[_0x77b7('0x22')](_0x77b7('0x23'),_0x19d460,_0x286046[_0x77b7('0x22')][_0x77b7('0x24')]);return _0x2060df(_0x286046[_0x77b7('0x22')][_0x77b7('0x24')]);}else{logger[_0x77b7('0x25')](_0x77b7('0x23'),_0x19d460,_0x77b7('0x26'));_0x2060df(_0x286046[_0x77b7('0x27')][_0x77b7('0x24')]);}})[_0x77b7('0x28')](function(_0x29c2aa){logger[_0x77b7('0x22')](_0x77b7('0x23'),_0x19d460,_0x29c2aa);_0x1cd7dd(_0x29c2aa);});});}function respondWithStatusCode(_0x359b23,_0x300de9){_0x300de9=_0x300de9||0xcc;return function(_0x1cfcbb){if(_0x1cfcbb){return _0x359b23['sendStatus'](_0x300de9);}return _0x359b23['status'](_0x300de9)[_0x77b7('0x29')]();};}function respondWithResult(_0x22c56d,_0x3cae5a){_0x3cae5a=_0x3cae5a||0xc8;return function(_0x4c6f8d){if(_0x4c6f8d){return _0x22c56d[_0x77b7('0x2a')](_0x3cae5a)[_0x77b7('0x2b')](_0x4c6f8d);}};}function respondWithFilteredResult(_0x20de87,_0x16b66a){return function(_0x114cf0){if(_0x114cf0){var _0x323363=typeof _0x16b66a[_0x77b7('0x2c')]===_0x77b7('0x2d')&&typeof _0x16b66a[_0x77b7('0x2e')]==='undefined';var _0x2afbf5=_0x114cf0[_0x77b7('0x2f')];var _0x23aa7e=_0x323363?0x0:_0x16b66a[_0x77b7('0x2c')];var _0x2e87e6=_0x323363?_0x114cf0[_0x77b7('0x2f')]:_0x16b66a[_0x77b7('0x2c')]+_0x16b66a[_0x77b7('0x2e')];var _0xcac9e;if(_0x2e87e6>=_0x2afbf5){_0x2e87e6=_0x2afbf5;_0xcac9e=0xc8;}else{_0xcac9e=0xce;}_0x20de87[_0x77b7('0x2a')](_0xcac9e);return _0x20de87['set'](_0x77b7('0x30'),_0x23aa7e+'-'+_0x2e87e6+'/'+_0x2afbf5)[_0x77b7('0x2b')](_0x114cf0);}return null;};}function patchUpdates(_0x15eb97){return function(_0x4c4ba5){try{jsonpatch[_0x77b7('0x31')](_0x4c4ba5,_0x15eb97,!![]);}catch(_0x4b8d1e){return BPromise[_0x77b7('0x32')](_0x4b8d1e);}return _0x4c4ba5[_0x77b7('0x33')]();};}function saveUpdates(_0x4b24a2,_0x31102a){return function(_0x4eb758){if(_0x4eb758){return _0x4eb758[_0x77b7('0x34')](_0x4b24a2)[_0x77b7('0x20')](function(_0xad1a3c){return _0xad1a3c;});}return null;};}function removeEntity(_0x50345e,_0x21fae3){return function(_0x108c6d){if(_0x108c6d){return _0x108c6d[_0x77b7('0x35')]()[_0x77b7('0x20')](function(){_0x50345e[_0x77b7('0x2a')](0xcc)[_0x77b7('0x29')]();});}};}function handleEntityNotFound(_0x214257,_0x26a52d){return function(_0x3cf95f){if(!_0x3cf95f){_0x214257[_0x77b7('0x36')](0x194);}return _0x3cf95f;};}function handleError(_0x3546d8,_0xacd0b7){_0xacd0b7=_0xacd0b7||0x1f4;return function(_0xb5f230){logger['error'](_0xb5f230[_0x77b7('0x37')]);if(_0xb5f230[_0x77b7('0x38')]){delete _0xb5f230[_0x77b7('0x38')];}_0x3546d8['status'](_0xacd0b7)['send'](_0xb5f230);};}exports[_0x77b7('0x39')]=function(_0x2c5c77,_0x42d245){var _0x2d11ef={},_0x1bdfec={},_0x1f5184={'count':0x0,'rows':[]};var _0x1330e9=_[_0x77b7('0x3a')](db[_0x77b7('0x3b')][_0x77b7('0x3c')],function(_0x17f4ca){return{'name':_0x17f4ca[_0x77b7('0x3d')],'type':_0x17f4ca[_0x77b7('0x3e')][_0x77b7('0x3f')]};});_0x1bdfec[_0x77b7('0x40')]=_[_0x77b7('0x3a')](_0x1330e9,_0x77b7('0x38'));_0x1bdfec[_0x77b7('0x41')]=_[_0x77b7('0x42')](_0x2c5c77[_0x77b7('0x41')]);_0x1bdfec[_0x77b7('0x43')]=_['intersection'](_0x1bdfec[_0x77b7('0x40')],_0x1bdfec[_0x77b7('0x41')]);_0x2d11ef['attributes']=_[_0x77b7('0x44')](_0x1bdfec['model'],qs[_0x77b7('0x45')](_0x2c5c77[_0x77b7('0x41')]['fields']));_0x2d11ef[_0x77b7('0x46')]=_0x2d11ef['attributes']['length']?_0x2d11ef[_0x77b7('0x46')]:_0x1bdfec['model'];if(!_0x2c5c77[_0x77b7('0x41')]['hasOwnProperty'](_0x77b7('0x47'))){_0x2d11ef[_0x77b7('0x2e')]=qs[_0x77b7('0x2e')](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x2e')]);_0x2d11ef[_0x77b7('0x2c')]=qs['offset'](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x2c')]);}_0x2d11ef[_0x77b7('0x48')]=qs[_0x77b7('0x49')](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x49')]);_0x2d11ef[_0x77b7('0x4a')]=qs[_0x77b7('0x43')](_['pick'](_0x2c5c77[_0x77b7('0x41')],_0x1bdfec['filters']),_0x1330e9);if(_0x2c5c77[_0x77b7('0x41')]['filter']){_0x2d11ef[_0x77b7('0x4a')]=_[_0x77b7('0x4b')](_0x2d11ef[_0x77b7('0x4a')],{'$or':_[_0x77b7('0x3a')](_0x1330e9,function(_0x1250ad){if(_0x1250ad[_0x77b7('0x3e')]!==_0x77b7('0x4c')){var _0x52a73d={};_0x52a73d[_0x1250ad[_0x77b7('0x38')]]={'$like':'%'+_0x2c5c77[_0x77b7('0x41')]['filter']+'%'};return _0x52a73d;}})});}_0x2d11ef=_['merge']({},_0x2d11ef,_0x2c5c77[_0x77b7('0x4d')]);var _0x5dbb20={'where':_0x2d11ef[_0x77b7('0x4a')]};return db[_0x77b7('0x3b')][_0x77b7('0x2f')](_0x5dbb20)[_0x77b7('0x20')](function(_0x46d361){_0x1f5184[_0x77b7('0x2f')]=_0x46d361;if(_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x4e')]){_0x2d11ef[_0x77b7('0x4f')]=[{'all':!![]}];}return db[_0x77b7('0x3b')][_0x77b7('0x50')](_0x2d11ef);})[_0x77b7('0x20')](function(_0x272bfb){_0x1f5184[_0x77b7('0x51')]=_0x272bfb;return _0x1f5184;})[_0x77b7('0x20')](respondWithFilteredResult(_0x42d245,_0x2d11ef))['catch'](handleError(_0x42d245,null));};exports[_0x77b7('0x52')]=function(_0x59a29d,_0x2da729){var _0x4ffde2={'raw':!![],'where':{'id':_0x59a29d[_0x77b7('0x53')]['id']}},_0x37ba6b={};_0x37ba6b[_0x77b7('0x40')]=_[_0x77b7('0x42')](db['SmsMessage'][_0x77b7('0x3c')]);_0x37ba6b['query']=_[_0x77b7('0x42')](_0x59a29d[_0x77b7('0x41')]);_0x37ba6b['filters']=_['intersection'](_0x37ba6b['model'],_0x37ba6b[_0x77b7('0x41')]);_0x4ffde2['attributes']=_[_0x77b7('0x44')](_0x37ba6b[_0x77b7('0x40')],qs[_0x77b7('0x45')](_0x59a29d[_0x77b7('0x41')]['fields']));_0x4ffde2[_0x77b7('0x46')]=_0x4ffde2[_0x77b7('0x46')][_0x77b7('0x54')]?_0x4ffde2[_0x77b7('0x46')]:_0x37ba6b['model'];if(_0x59a29d[_0x77b7('0x41')][_0x77b7('0x4e')]){_0x4ffde2['include']=[{'all':!![]}];}_0x4ffde2=_[_0x77b7('0x4b')]({},_0x4ffde2,_0x59a29d[_0x77b7('0x4d')]);return db[_0x77b7('0x3b')][_0x77b7('0x55')](_0x4ffde2)[_0x77b7('0x20')](handleEntityNotFound(_0x2da729,null))[_0x77b7('0x20')](respondWithResult(_0x2da729,null))[_0x77b7('0x28')](handleError(_0x2da729,null));};exports['create']=function(_0x404f23,_0x29d52b){return db['SmsMessage'][_0x77b7('0x56')](_0x404f23[_0x77b7('0x57')],{})[_0x77b7('0x20')](respondWithResult(_0x29d52b,0xc9))[_0x77b7('0x28')](handleError(_0x29d52b,null));};exports['update']=function(_0x50e6ab,_0x3a4902){if(_0x50e6ab[_0x77b7('0x57')]['id']){delete _0x50e6ab['body']['id'];}return db['SmsMessage'][_0x77b7('0x55')]({'where':{'id':_0x50e6ab[_0x77b7('0x53')]['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x3a4902,null))[_0x77b7('0x20')](saveUpdates(_0x50e6ab[_0x77b7('0x57')],null))[_0x77b7('0x20')](respondWithResult(_0x3a4902,null))[_0x77b7('0x28')](handleError(_0x3a4902,null));};exports[_0x77b7('0x35')]=function(_0x58296f,_0x5aa315){return db[_0x77b7('0x3b')][_0x77b7('0x55')]({'where':{'id':_0x58296f[_0x77b7('0x53')]['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x5aa315,null))[_0x77b7('0x20')](removeEntity(_0x5aa315,null))['catch'](handleError(_0x5aa315,null));};exports['describe']=function(_0x642f7a,_0x1323fc){return db['SmsMessage'][_0x77b7('0x58')]()['then'](respondWithResult(_0x1323fc,null))[_0x77b7('0x28')](handleError(_0x1323fc,null));};var interaction_log=require(_0x77b7('0x13'))(_0x77b7('0x59'));exports[_0x77b7('0x5a')]=function(_0x136fb5,_0x346083,_0x325208){var _0x1f590e={'agent':{},'channel':_0x77b7('0x5b')};if(_0x136fb5[_0x77b7('0x57')]['id']){delete _0x136fb5[_0x77b7('0x57')]['id'];}_0x136fb5['body'][_0x77b7('0x5c')]=!![];_0x136fb5[_0x77b7('0x57')][_0x77b7('0x5d')]=moment()[_0x77b7('0x5e')](_0x77b7('0x5f'));_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')]=_0x136fb5['body'][_0x77b7('0x60')]||_0x136fb5[_0x77b7('0x61')]['id'];_0x1f590e[_0x77b7('0x62')]['id']=_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')];return db[_0x77b7('0x3b')][_0x77b7('0x55')]({'where':{'id':_0x136fb5[_0x77b7('0x53')]['id'],'UserId':null}})[_0x77b7('0x20')](handleEntityNotFound(_0x346083,null))[_0x77b7('0x20')](saveUpdates(_0x136fb5[_0x77b7('0x57')],null))[_0x77b7('0x20')](function(_0x1da758){if(_0x1da758){_0x1f590e[_0x77b7('0x24')]=_0x1da758[_0x77b7('0x63')]({'plain':!![]});return db[_0x77b7('0x64')][_0x77b7('0x55')]({'where':{'id':_0x1da758[_0x77b7('0x65')]}});}return null;})[_0x77b7('0x20')](handleEntityNotFound(_0x346083,null))[_0x77b7('0x20')](function(_0x5e4338){if(_0x5e4338){return _0x5e4338['update']({'UserId':_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')],'read1stAt':_[_0x77b7('0x66')](_0x5e4338[_0x77b7('0x67')])?moment()[_0x77b7('0x5e')](_0x77b7('0x5f')):undefined});}return null;})[_0x77b7('0x20')](function(_0x4ddf38){if(_0x4ddf38){_0x1f590e[_0x77b7('0x68')]=_0x4ddf38['get']({'plain':!![]});interaction_log[_0x77b7('0x25')](_0x77b7('0x69'),_0x136fb5[_0x77b7('0x61')]['id'],_0x136fb5[_0x77b7('0x61')][_0x77b7('0x38')],_0x136fb5['user'][_0x77b7('0x6a')],_0x1f590e[_0x77b7('0x68')]['id'],_0x136fb5['body']?JSON[_0x77b7('0x6b')](_0x136fb5[_0x77b7('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0x77b7('0x6c'),_0x1f590e);}return null;})['then'](function(_0x2e1910){var _0x571041='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e1910[_0x77b7('0x24')][_0x77b7('0x6d')];return db[_0x77b7('0x6e')]['query'](_0x571041,{'type':db[_0x77b7('0x6f')]['QueryTypes'][_0x77b7('0x70')],'raw':!![]})[_0x77b7('0x20')](function(_0x23911a){return _0x23911a;});})[_0x77b7('0x20')](function(_0x57ce8b){if(_0x57ce8b){_0x1f590e['message'][_0x77b7('0x71')]=_0x57ce8b[0x0];if(!_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')])return;return db[_0x77b7('0x72')][_0x77b7('0x55')]({'where':{'id':_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')],'role':_0x77b7('0x62')},'attributes':['id',_0x77b7('0x38'),_0x77b7('0x73'),_0x77b7('0x74'),'internal'],'raw':!![]});}return null;})[_0x77b7('0x20')](function(_0x5bca0e){if(!_0x5bca0e)return null;_0x1f590e['message']['agent']=_0x5bca0e;return _0x1f590e;})['then'](function(_0x20aa17){if(_0x20aa17){if(_0x136fb5[_0x77b7('0x57')][_0x77b7('0x75')]){_0x1f590e[_0x77b7('0x24')][_0x77b7('0x76')]=util[_0x77b7('0x5e')](_0x77b7('0x77'),_0x136fb5['user']['name']);_0x1f590e[_0x77b7('0x24')][_0x77b7('0x78')]=_0x1f590e[_0x77b7('0x78')];_0x1f590e[_0x77b7('0x24')][_0x77b7('0x79')]=_0x1f590e[_0x77b7('0x78')];_0x1f590e[_0x77b7('0x24')][_0x77b7('0x7a')]=_0x77b7('0x5a');return respondWithRpcPromise(_0x77b7('0x7b'),'EventManager',{'event':_0x77b7('0x7c'),'message':_0x1f590e[_0x77b7('0x24')]},client9002)[_0x77b7('0x20')](function(){return _0x1f590e;});}return _0x1f590e;}return null;})[_0x77b7('0x20')](respondWithResult(_0x346083,null))[_0x77b7('0x28')](handleError(_0x346083,null));};var interaction_log=require('../../config/logger')(_0x77b7('0x59'));exports[_0x77b7('0x32')]=function(_0x2dea85,_0x48924c,_0x4fd6ce){var _0xbdf72f={'agent':{},'channel':'sms'};if(_0x2dea85[_0x77b7('0x57')]['id']){delete _0x2dea85[_0x77b7('0x57')]['id'];}_0x2dea85['body']['UserId']=_0x2dea85['body']['UserId']||_0x2dea85[_0x77b7('0x61')]['id'];_0xbdf72f[_0x77b7('0x62')]['id']=_0x2dea85['body'][_0x77b7('0x60')];return db['SmsMessage']['find']({'where':{'id':_0x2dea85[_0x77b7('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48924c,null))[_0x77b7('0x20')](function(_0x56aa57){if(_0x56aa57){_0xbdf72f['message']=_0x56aa57[_0x77b7('0x63')]({'plain':!![]});return db[_0x77b7('0x64')][_0x77b7('0x55')]({'where':{'id':_0x56aa57[_0x77b7('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x48924c,null))['then'](function(_0x4e787f){if(_0x4e787f){_0xbdf72f[_0x77b7('0x68')]=_0x4e787f[_0x77b7('0x63')]({'plain':!![]});interaction_log[_0x77b7('0x25')](_0x77b7('0x7d'),_0x2dea85[_0x77b7('0x61')]['id'],_0x2dea85[_0x77b7('0x61')][_0x77b7('0x38')],_0x2dea85[_0x77b7('0x61')][_0x77b7('0x6a')],_0xbdf72f[_0x77b7('0x68')]['id'],_0x2dea85['body']?JSON['stringify'](_0x2dea85[_0x77b7('0x57')]):_0x77b7('0x7e'));return respondWithRpcPromise(_0x77b7('0x7f'),_0x77b7('0x80'),_0xbdf72f);}return null;})[_0x77b7('0x20')](function(_0x411810){var _0x385987=_0x77b7('0x81')+_0x411810[_0x77b7('0x24')][_0x77b7('0x6d')];return db['sequelize'][_0x77b7('0x41')](_0x385987,{'type':db[_0x77b7('0x6f')]['QueryTypes'][_0x77b7('0x70')],'raw':!![]})[_0x77b7('0x20')](function(_0x5d41fb){return _0x5d41fb;});})[_0x77b7('0x20')](function(_0x4ba5bd){if(_0x4ba5bd){_0xbdf72f[_0x77b7('0x24')][_0x77b7('0x71')]=_0x4ba5bd[0x0];if(!_0x2dea85[_0x77b7('0x57')][_0x77b7('0x60')])return;return db['User'][_0x77b7('0x55')]({'where':{'id':_0x2dea85['body'][_0x77b7('0x60')],'role':_0x77b7('0x62')},'attributes':['id',_0x77b7('0x38'),_0x77b7('0x73'),_0x77b7('0x74'),_0x77b7('0x82')],'raw':!![]});}return null;})[_0x77b7('0x20')](function(_0x2c4e23){if(!_0x2c4e23)return null;_0xbdf72f[_0x77b7('0x24')]['agent']=_0x2c4e23;return _0xbdf72f;})[_0x77b7('0x20')](function(_0x326b13){if(_0x326b13){_0x326b13[_0x77b7('0x24')][_0x77b7('0x76')]=util[_0x77b7('0x5e')](_0x77b7('0x77'),_0x2dea85['user']['name']);_0x326b13[_0x77b7('0x24')][_0x77b7('0x78')]=_0xbdf72f[_0x77b7('0x78')];_0x326b13['message'][_0x77b7('0x79')]=_0xbdf72f['channel'];_0x326b13[_0x77b7('0x24')][_0x77b7('0x7a')]=_0x77b7('0x32');respondWithRpcPromise(_0x77b7('0x7b'),_0x77b7('0x7b'),{'event':'rejectmessage','message':_0x326b13[_0x77b7('0x24')]},client9002);return _0xbdf72f;}return null;})['then'](respondWithResult(_0x48924c,null))[_0x77b7('0x28')](handleError(_0x48924c,null));};exports[_0x77b7('0x2a')]=function(_0x1a7afd,_0x2558fd,_0x11adb5){if(_0x1a7afd[_0x77b7('0x57')]['id']){delete _0x1a7afd['body']['id'];}var _0x1582ab;return db['SmsMessage'][_0x77b7('0x55')]({'where':{'id':_0x1a7afd['params']['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x2558fd,null))['then'](function(_0x2798da){if(_0x2798da){_0x1582ab=_0x2798da;return db['SmsAccount'][_0x77b7('0x55')]({'where':{'id':_0x2798da['SmsAccountId']}});}})[_0x77b7('0x20')](handleEntityNotFound(_0x2558fd,null))[_0x77b7('0x20')](function(_0x43faf7){if(_0x43faf7){logger['debug'](_0x77b7('0x83'),_0x77b7('0x2a'),_0x77b7('0x84'),_0x43faf7[_0x77b7('0x3e')],util['inspect'](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));switch(_0x43faf7[_0x77b7('0x3e')]){case _0x77b7('0x85'):if(_0x1a7afd['body'][_0x77b7('0x86')]&&_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x86')]===_0x1582ab[_0x77b7('0x87')]){return _0x1582ab[_0x77b7('0x34')]({'read':!![]});}else{logger['error'](_0x77b7('0x88'),_0x77b7('0x2a'),_0x77b7('0x85'),util[_0x77b7('0x89')](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));}break;case _0x77b7('0x8a'):if(_0x1a7afd['body'][_0x77b7('0x8b')]&&_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x8b')]===_0x1582ab['messageId']&&_[_0x77b7('0x8c')](['sent',_0x77b7('0x8d')],_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x8e')])>=0x0){return _0x1582ab['update']({'read':!![]});}else{logger[_0x77b7('0x22')](_0x77b7('0x88'),_0x77b7('0x2a'),'plivio',util[_0x77b7('0x89')](_0x1a7afd['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5eb9de=_0x1a7afd['body'][_0x77b7('0x8f')][0x0];if(_0x5eb9de[_0x77b7('0x2a')][_0x77b7('0x90')]===_0x77b7('0x91')){return _0x1582ab[_0x77b7('0x34')]({'read':!![]});}else{logger[_0x77b7('0x22')](_0x77b7('0x88'),'status',_0x77b7('0x92'),util['inspect'](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1582ab;}})[_0x77b7('0x20')](respondWithResult(_0x2558fd,null))[_0x77b7('0x28')](handleError(_0x2558fd,null));}; \ No newline at end of file +var _0xa848=['infobip','results','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','includeAll','rows','catch','show','params','include','options','find','create','body','describe','sms-interactions','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','internal','interface','channel','motionChannel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','Sequelize','SELECT','SIP/%s','event','rejectmessage','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status'];(function(_0xadf1c0,_0x21b502){var _0x14f557=function(_0x2aa0fa){while(--_0x2aa0fa){_0xadf1c0['push'](_0xadf1c0['shift']());}};_0x14f557(++_0x21b502);}(_0xa848,0x99));var _0x8a84=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa848[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x8a84('0x0'));var rimraf=require(_0x8a84('0x1'));var zipdir=require(_0x8a84('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a84('0x3'));var moment=require(_0x8a84('0x4'));var BPromise=require(_0x8a84('0x5'));var Mustache=require(_0x8a84('0x6'));var util=require(_0x8a84('0x7'));var path=require(_0x8a84('0x8'));var sox=require(_0x8a84('0x9'));var csv=require(_0x8a84('0xa'));var ejs=require(_0x8a84('0xb'));var fs=require('fs');var fs_extra=require(_0x8a84('0xc'));var _=require(_0x8a84('0xd'));var squel=require(_0x8a84('0xe'));var crypto=require(_0x8a84('0xf'));var jsforce=require(_0x8a84('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8a84('0xa'));var querystring=require(_0x8a84('0x11'));var Papa=require(_0x8a84('0x12'));var Redis=require('ioredis');var authService=require(_0x8a84('0x13'));var qs=require(_0x8a84('0x14'));var as=require(_0x8a84('0x15'));var hardwareService=require(_0x8a84('0x16'));var logger=require(_0x8a84('0x17'))(_0x8a84('0x18'));var utils=require(_0x8a84('0x19'));var config=require(_0x8a84('0x1a'));var licenseUtil=require(_0x8a84('0x1b'));var db=require(_0x8a84('0x1c'))['db'];config[_0x8a84('0x1d')]=_[_0x8a84('0x1e')](config['redis'],{'host':_0x8a84('0x1f'),'port':0x18eb});var socket=require(_0x8a84('0x20'))(new Redis(config[_0x8a84('0x1d')]));require('./smsMessage.socket')[_0x8a84('0x21')](socket);var jayson=require(_0x8a84('0x22'));var client=jayson[_0x8a84('0x23')]['http']({'port':0x232c});var client9002=jayson[_0x8a84('0x23')][_0x8a84('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x50a338,_0x44144a,_0x335f65,_0x9e386a){return new BPromise(function(_0x209516,_0x586e71){var _0x70847=_0x9e386a||client;return _0x70847[_0x8a84('0x25')](_0x50a338,_0x335f65)[_0x8a84('0x26')](function(_0x3dbca9){logger[_0x8a84('0x27')](_0x8a84('0x28'),_0x44144a,'request\x20sent');logger[_0x8a84('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44144a,_0x8a84('0x2a'),JSON['stringify'](_0x3dbca9));if(_0x3dbca9[_0x8a84('0x2b')]){if(_0x3dbca9[_0x8a84('0x2b')][_0x8a84('0x2c')]===0x1f4){logger['error'](_0x8a84('0x28'),_0x44144a,_0x3dbca9[_0x8a84('0x2b')][_0x8a84('0x2d')]);return _0x586e71(_0x3dbca9[_0x8a84('0x2b')][_0x8a84('0x2d')]);}logger['error'](_0x8a84('0x28'),_0x44144a,_0x3dbca9[_0x8a84('0x2b')][_0x8a84('0x2d')]);return _0x209516(_0x3dbca9[_0x8a84('0x2b')][_0x8a84('0x2d')]);}else{logger['info'](_0x8a84('0x28'),_0x44144a,_0x8a84('0x2a'));_0x209516(_0x3dbca9[_0x8a84('0x2e')][_0x8a84('0x2d')]);}})['catch'](function(_0x34b0dd){logger[_0x8a84('0x2b')](_0x8a84('0x28'),_0x44144a,_0x34b0dd);_0x586e71(_0x34b0dd);});});}function respondWithStatusCode(_0x34e448,_0x4a9f05){_0x4a9f05=_0x4a9f05||0xcc;return function(_0x5060f4){if(_0x5060f4){return _0x34e448['sendStatus'](_0x4a9f05);}return _0x34e448[_0x8a84('0x2f')](_0x4a9f05)[_0x8a84('0x30')]();};}function respondWithResult(_0x5520bf,_0x3f6337){_0x3f6337=_0x3f6337||0xc8;return function(_0x50c80b){if(_0x50c80b){return _0x5520bf['status'](_0x3f6337)['json'](_0x50c80b);}};}function respondWithFilteredResult(_0x4940af,_0x482067){return function(_0x141921){if(_0x141921){var _0x3083c0=typeof _0x482067[_0x8a84('0x31')]===_0x8a84('0x32')&&typeof _0x482067[_0x8a84('0x33')]==='undefined';var _0x2df556=_0x141921[_0x8a84('0x34')];var _0x50db30=_0x3083c0?0x0:_0x482067[_0x8a84('0x31')];var _0x5338eb=_0x3083c0?_0x141921['count']:_0x482067[_0x8a84('0x31')]+_0x482067[_0x8a84('0x33')];var _0x150d4a;if(_0x5338eb>=_0x2df556){_0x5338eb=_0x2df556;_0x150d4a=0xc8;}else{_0x150d4a=0xce;}_0x4940af[_0x8a84('0x2f')](_0x150d4a);return _0x4940af[_0x8a84('0x35')](_0x8a84('0x36'),_0x50db30+'-'+_0x5338eb+'/'+_0x2df556)[_0x8a84('0x37')](_0x141921);}return null;};}function patchUpdates(_0x572789){return function(_0x4cd479){try{jsonpatch[_0x8a84('0x38')](_0x4cd479,_0x572789,!![]);}catch(_0x4b2ab3){return BPromise[_0x8a84('0x39')](_0x4b2ab3);}return _0x4cd479[_0x8a84('0x3a')]();};}function saveUpdates(_0x25908d,_0x30f585){return function(_0x4e1889){if(_0x4e1889){return _0x4e1889[_0x8a84('0x3b')](_0x25908d)[_0x8a84('0x26')](function(_0x140d90){return _0x140d90;});}return null;};}function removeEntity(_0x4aa3bb,_0x227eb6){return function(_0xdc899){if(_0xdc899){return _0xdc899[_0x8a84('0x3c')]()['then'](function(){_0x4aa3bb[_0x8a84('0x2f')](0xcc)[_0x8a84('0x30')]();});}};}function handleEntityNotFound(_0x2a2e80,_0x22dcbb){return function(_0x28142d){if(!_0x28142d){_0x2a2e80[_0x8a84('0x3d')](0x194);}return _0x28142d;};}function handleError(_0x18c0d8,_0xe8d9c5){_0xe8d9c5=_0xe8d9c5||0x1f4;return function(_0x5b81d6){logger[_0x8a84('0x2b')](_0x5b81d6[_0x8a84('0x3e')]);if(_0x5b81d6[_0x8a84('0x3f')]){delete _0x5b81d6[_0x8a84('0x3f')];}_0x18c0d8[_0x8a84('0x2f')](_0xe8d9c5)['send'](_0x5b81d6);};}exports['index']=function(_0x166855,_0x2c54eb){var _0x437411={},_0x1f8454={},_0x37f51={'count':0x0,'rows':[]};var _0x5f5902=_[_0x8a84('0x40')](db[_0x8a84('0x41')][_0x8a84('0x42')],function(_0x4f1691){return{'name':_0x4f1691[_0x8a84('0x43')],'type':_0x4f1691[_0x8a84('0x44')][_0x8a84('0x45')]};});_0x1f8454[_0x8a84('0x46')]=_['map'](_0x5f5902,'name');_0x1f8454['query']=_[_0x8a84('0x47')](_0x166855[_0x8a84('0x48')]);_0x1f8454['filters']=_[_0x8a84('0x49')](_0x1f8454[_0x8a84('0x46')],_0x1f8454['query']);_0x437411[_0x8a84('0x4a')]=_[_0x8a84('0x49')](_0x1f8454[_0x8a84('0x46')],qs[_0x8a84('0x4b')](_0x166855[_0x8a84('0x48')][_0x8a84('0x4b')]));_0x437411[_0x8a84('0x4a')]=_0x437411['attributes'][_0x8a84('0x4c')]?_0x437411['attributes']:_0x1f8454[_0x8a84('0x46')];if(!_0x166855['query']['hasOwnProperty'](_0x8a84('0x4d'))){_0x437411[_0x8a84('0x33')]=qs[_0x8a84('0x33')](_0x166855['query'][_0x8a84('0x33')]);_0x437411[_0x8a84('0x31')]=qs[_0x8a84('0x31')](_0x166855[_0x8a84('0x48')]['offset']);}_0x437411[_0x8a84('0x4e')]=qs[_0x8a84('0x4f')](_0x166855[_0x8a84('0x48')][_0x8a84('0x4f')]);_0x437411[_0x8a84('0x50')]=qs[_0x8a84('0x51')](_[_0x8a84('0x52')](_0x166855[_0x8a84('0x48')],_0x1f8454[_0x8a84('0x51')]),_0x5f5902);if(_0x166855['query']['filter']){_0x437411['where']=_[_0x8a84('0x53')](_0x437411[_0x8a84('0x50')],{'$or':_[_0x8a84('0x40')](_0x5f5902,function(_0x5dd8dd){if(_0x5dd8dd[_0x8a84('0x44')]!=='VIRTUAL'){var _0x5e7113={};_0x5e7113[_0x5dd8dd[_0x8a84('0x3f')]]={'$like':'%'+_0x166855['query'][_0x8a84('0x54')]+'%'};return _0x5e7113;}})});}_0x437411=_[_0x8a84('0x53')]({},_0x437411,_0x166855['options']);var _0x31ba3e={'where':_0x437411[_0x8a84('0x50')]};return db[_0x8a84('0x41')][_0x8a84('0x34')](_0x31ba3e)['then'](function(_0x2274b0){_0x37f51[_0x8a84('0x34')]=_0x2274b0;if(_0x166855[_0x8a84('0x48')][_0x8a84('0x55')]){_0x437411['include']=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x437411);})['then'](function(_0x5e87c9){_0x37f51[_0x8a84('0x56')]=_0x5e87c9;return _0x37f51;})[_0x8a84('0x26')](respondWithFilteredResult(_0x2c54eb,_0x437411))[_0x8a84('0x57')](handleError(_0x2c54eb,null));};exports[_0x8a84('0x58')]=function(_0x3a56ac,_0x5e4c48){var _0x3c3519={'raw':!![],'where':{'id':_0x3a56ac[_0x8a84('0x59')]['id']}},_0x59e840={};_0x59e840[_0x8a84('0x46')]=_[_0x8a84('0x47')](db['SmsMessage'][_0x8a84('0x42')]);_0x59e840[_0x8a84('0x48')]=_[_0x8a84('0x47')](_0x3a56ac[_0x8a84('0x48')]);_0x59e840['filters']=_[_0x8a84('0x49')](_0x59e840['model'],_0x59e840['query']);_0x3c3519[_0x8a84('0x4a')]=_['intersection'](_0x59e840[_0x8a84('0x46')],qs[_0x8a84('0x4b')](_0x3a56ac['query']['fields']));_0x3c3519['attributes']=_0x3c3519['attributes'][_0x8a84('0x4c')]?_0x3c3519['attributes']:_0x59e840[_0x8a84('0x46')];if(_0x3a56ac[_0x8a84('0x48')][_0x8a84('0x55')]){_0x3c3519[_0x8a84('0x5a')]=[{'all':!![]}];}_0x3c3519=_[_0x8a84('0x53')]({},_0x3c3519,_0x3a56ac[_0x8a84('0x5b')]);return db[_0x8a84('0x41')][_0x8a84('0x5c')](_0x3c3519)['then'](handleEntityNotFound(_0x5e4c48,null))[_0x8a84('0x26')](respondWithResult(_0x5e4c48,null))['catch'](handleError(_0x5e4c48,null));};exports[_0x8a84('0x5d')]=function(_0x1776cc,_0x5f3088){return db[_0x8a84('0x41')][_0x8a84('0x5d')](_0x1776cc['body'],{})['then'](respondWithResult(_0x5f3088,0xc9))[_0x8a84('0x57')](handleError(_0x5f3088,null));};exports[_0x8a84('0x3b')]=function(_0xdaf79c,_0x5af98d){if(_0xdaf79c[_0x8a84('0x5e')]['id']){delete _0xdaf79c[_0x8a84('0x5e')]['id'];}return db[_0x8a84('0x41')][_0x8a84('0x5c')]({'where':{'id':_0xdaf79c[_0x8a84('0x59')]['id']}})[_0x8a84('0x26')](handleEntityNotFound(_0x5af98d,null))[_0x8a84('0x26')](saveUpdates(_0xdaf79c[_0x8a84('0x5e')],null))[_0x8a84('0x26')](respondWithResult(_0x5af98d,null))[_0x8a84('0x57')](handleError(_0x5af98d,null));};exports[_0x8a84('0x3c')]=function(_0x504352,_0x173085){return db[_0x8a84('0x41')][_0x8a84('0x5c')]({'where':{'id':_0x504352[_0x8a84('0x59')]['id']}})[_0x8a84('0x26')](handleEntityNotFound(_0x173085,null))[_0x8a84('0x26')](removeEntity(_0x173085,null))['catch'](handleError(_0x173085,null));};exports[_0x8a84('0x5f')]=function(_0x26269a,_0x1e1a24){return db[_0x8a84('0x41')][_0x8a84('0x5f')]()[_0x8a84('0x26')](respondWithResult(_0x1e1a24,null))[_0x8a84('0x57')](handleError(_0x1e1a24,null));};var interaction_log=require(_0x8a84('0x17'))(_0x8a84('0x60'));exports[_0x8a84('0x61')]=function(_0x9dd223,_0x3a9cdd,_0xf3d190){var _0x54080d={'agent':{},'channel':_0x8a84('0x62')};if(_0x9dd223['body']['id']){delete _0x9dd223[_0x8a84('0x5e')]['id'];}_0x9dd223[_0x8a84('0x5e')]['read']=!![];_0x9dd223[_0x8a84('0x5e')][_0x8a84('0x63')]=moment()['format'](_0x8a84('0x64'));_0x9dd223['body'][_0x8a84('0x65')]=_0x9dd223['body'][_0x8a84('0x65')]||_0x9dd223[_0x8a84('0x66')]['id'];_0x54080d[_0x8a84('0x67')]['id']=_0x9dd223[_0x8a84('0x5e')]['UserId'];return db[_0x8a84('0x41')]['find']({'where':{'id':_0x9dd223[_0x8a84('0x59')]['id'],'UserId':null}})[_0x8a84('0x26')](handleEntityNotFound(_0x3a9cdd,null))[_0x8a84('0x26')](saveUpdates(_0x9dd223[_0x8a84('0x5e')],null))['then'](function(_0x2c7428){if(_0x2c7428){_0x54080d[_0x8a84('0x2d')]=_0x2c7428[_0x8a84('0x68')]({'plain':!![]});return db[_0x8a84('0x69')]['find']({'where':{'id':_0x2c7428['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3a9cdd,null))['then'](function(_0xf737ae){if(_0xf737ae){return _0xf737ae[_0x8a84('0x3b')]({'UserId':_0x9dd223[_0x8a84('0x5e')]['UserId'],'read1stAt':_[_0x8a84('0x6a')](_0xf737ae['read1stAt'])?moment()[_0x8a84('0x6b')](_0x8a84('0x64')):undefined});}return null;})[_0x8a84('0x26')](function(_0x4f5b67){if(_0x4f5b67){_0x54080d['interaction']=_0x4f5b67['get']({'plain':!![]});interaction_log[_0x8a84('0x27')](_0x8a84('0x6c'),_0x9dd223['user']['id'],_0x9dd223[_0x8a84('0x66')]['name'],_0x9dd223['user'][_0x8a84('0x6d')],_0x54080d[_0x8a84('0x6e')]['id'],_0x9dd223[_0x8a84('0x5e')]?JSON[_0x8a84('0x6f')](_0x9dd223[_0x8a84('0x5e')]):'null');return respondWithRpcPromise(_0x8a84('0x70'),_0x8a84('0x71'),_0x54080d);}return null;})[_0x8a84('0x26')](function(_0x5255f3){var _0x2797c6=_0x8a84('0x72')+_0x5255f3[_0x8a84('0x2d')]['ContactId'];return db[_0x8a84('0x73')][_0x8a84('0x48')](_0x2797c6,{'type':db['Sequelize'][_0x8a84('0x74')]['SELECT'],'raw':!![]})[_0x8a84('0x26')](function(_0x2c4403){return _0x2c4403;});})['then'](function(_0x352aaf){if(_0x352aaf){_0x54080d[_0x8a84('0x2d')][_0x8a84('0x75')]=_0x352aaf[0x0];if(!_0x9dd223[_0x8a84('0x5e')][_0x8a84('0x65')])return;return db[_0x8a84('0x76')]['find']({'where':{'id':_0x9dd223[_0x8a84('0x5e')][_0x8a84('0x65')],'role':_0x8a84('0x67')},'attributes':['id',_0x8a84('0x3f'),_0x8a84('0x77'),'email',_0x8a84('0x78')],'raw':!![]});}return null;})[_0x8a84('0x26')](function(_0x41337c){if(!_0x41337c)return null;_0x54080d[_0x8a84('0x2d')]['agent']=_0x41337c;return _0x54080d;})['then'](function(_0x1a85d0){if(_0x1a85d0){if(_0x9dd223[_0x8a84('0x5e')]['manual']){_0x54080d[_0x8a84('0x2d')][_0x8a84('0x79')]=util['format']('SIP/%s',_0x9dd223[_0x8a84('0x66')][_0x8a84('0x3f')]);_0x54080d[_0x8a84('0x2d')][_0x8a84('0x7a')]=_0x54080d[_0x8a84('0x7a')];_0x54080d['message'][_0x8a84('0x7b')]=_0x54080d[_0x8a84('0x7a')];_0x54080d['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x8a84('0x7c'),{'event':_0x8a84('0x7d'),'message':_0x54080d[_0x8a84('0x2d')]},client9002)[_0x8a84('0x26')](function(){return _0x54080d;});}return _0x54080d;}return null;})['then'](respondWithResult(_0x3a9cdd,null))[_0x8a84('0x57')](handleError(_0x3a9cdd,null));};var interaction_log=require('../../config/logger')(_0x8a84('0x60'));exports[_0x8a84('0x39')]=function(_0x14e48c,_0x5d9492,_0x5b3dcb){var _0x2792c8={'agent':{},'channel':_0x8a84('0x62')};if(_0x14e48c[_0x8a84('0x5e')]['id']){delete _0x14e48c[_0x8a84('0x5e')]['id'];}_0x14e48c[_0x8a84('0x5e')][_0x8a84('0x65')]=_0x14e48c[_0x8a84('0x5e')]['UserId']||_0x14e48c[_0x8a84('0x66')]['id'];_0x2792c8['agent']['id']=_0x14e48c[_0x8a84('0x5e')][_0x8a84('0x65')];return db[_0x8a84('0x41')][_0x8a84('0x5c')]({'where':{'id':_0x14e48c[_0x8a84('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5d9492,null))[_0x8a84('0x26')](function(_0x49712d){if(_0x49712d){_0x2792c8[_0x8a84('0x2d')]=_0x49712d[_0x8a84('0x68')]({'plain':!![]});return db[_0x8a84('0x69')][_0x8a84('0x5c')]({'where':{'id':_0x49712d['SmsInteractionId']}});}return null;})[_0x8a84('0x26')](handleEntityNotFound(_0x5d9492,null))[_0x8a84('0x26')](function(_0x24f154){if(_0x24f154){_0x2792c8[_0x8a84('0x6e')]=_0x24f154[_0x8a84('0x68')]({'plain':!![]});interaction_log['info'](_0x8a84('0x7e'),_0x14e48c['user']['id'],_0x14e48c[_0x8a84('0x66')][_0x8a84('0x3f')],_0x14e48c[_0x8a84('0x66')][_0x8a84('0x6d')],_0x2792c8[_0x8a84('0x6e')]['id'],_0x14e48c[_0x8a84('0x5e')]?JSON[_0x8a84('0x6f')](_0x14e48c[_0x8a84('0x5e')]):_0x8a84('0x7f'));return respondWithRpcPromise(_0x8a84('0x80'),_0x8a84('0x81'),_0x2792c8);}return null;})[_0x8a84('0x26')](function(_0x422b42){var _0x16dd9b=_0x8a84('0x72')+_0x422b42[_0x8a84('0x2d')][_0x8a84('0x82')];return db[_0x8a84('0x73')][_0x8a84('0x48')](_0x16dd9b,{'type':db[_0x8a84('0x83')][_0x8a84('0x74')][_0x8a84('0x84')],'raw':!![]})['then'](function(_0x1b880a){return _0x1b880a;});})[_0x8a84('0x26')](function(_0xc9f6bf){if(_0xc9f6bf){_0x2792c8[_0x8a84('0x2d')][_0x8a84('0x75')]=_0xc9f6bf[0x0];if(!_0x14e48c[_0x8a84('0x5e')][_0x8a84('0x65')])return;return db[_0x8a84('0x76')][_0x8a84('0x5c')]({'where':{'id':_0x14e48c[_0x8a84('0x5e')][_0x8a84('0x65')],'role':_0x8a84('0x67')},'attributes':['id',_0x8a84('0x3f'),_0x8a84('0x77'),'email',_0x8a84('0x78')],'raw':!![]});}return null;})['then'](function(_0x25487b){if(!_0x25487b)return null;_0x2792c8[_0x8a84('0x2d')][_0x8a84('0x67')]=_0x25487b;return _0x2792c8;})[_0x8a84('0x26')](function(_0x1ba114){if(_0x1ba114){_0x1ba114[_0x8a84('0x2d')]['interface']=util[_0x8a84('0x6b')](_0x8a84('0x85'),_0x14e48c['user'][_0x8a84('0x3f')]);_0x1ba114['message'][_0x8a84('0x7a')]=_0x2792c8[_0x8a84('0x7a')];_0x1ba114['message']['motionChannel']=_0x2792c8[_0x8a84('0x7a')];_0x1ba114['message'][_0x8a84('0x86')]=_0x8a84('0x39');respondWithRpcPromise(_0x8a84('0x7c'),'EventManager',{'event':_0x8a84('0x87'),'message':_0x1ba114['message']},client9002);return _0x2792c8;}return null;})['then'](respondWithResult(_0x5d9492,null))['catch'](handleError(_0x5d9492,null));};exports[_0x8a84('0x2f')]=function(_0x4426d8,_0x244216,_0x105533){if(_0x4426d8['body']['id']){delete _0x4426d8['body']['id'];}var _0x1bfced;return db['SmsMessage'][_0x8a84('0x5c')]({'where':{'id':_0x4426d8[_0x8a84('0x59')]['id']}})[_0x8a84('0x26')](handleEntityNotFound(_0x244216,null))[_0x8a84('0x26')](function(_0x4404f9){if(_0x4404f9){_0x1bfced=_0x4404f9;return db['SmsAccount'][_0x8a84('0x5c')]({'where':{'id':_0x4404f9['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x244216,null))[_0x8a84('0x26')](function(_0x4979f9){if(_0x4979f9){logger[_0x8a84('0x29')](_0x8a84('0x88'),_0x8a84('0x2f'),'received\x20delivery\x20report\x20from',_0x4979f9['type'],util[_0x8a84('0x89')](_0x4426d8[_0x8a84('0x5e')],{'showHidden':![],'depth':null}));switch(_0x4979f9[_0x8a84('0x44')]){case _0x8a84('0x8a'):if(_0x4426d8[_0x8a84('0x5e')][_0x8a84('0x8b')]&&_0x4426d8[_0x8a84('0x5e')][_0x8a84('0x8b')]===_0x1bfced[_0x8a84('0x8c')]){return _0x1bfced[_0x8a84('0x3b')]({'read':!![]});}else{logger['error'](_0x8a84('0x8d'),_0x8a84('0x2f'),_0x8a84('0x8a'),util['inspect'](_0x4426d8[_0x8a84('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8a84('0x8e'):if(_0x4426d8[_0x8a84('0x5e')][_0x8a84('0x8f')]&&_0x4426d8['body'][_0x8a84('0x8f')]===_0x1bfced['messageId']&&_['indexOf']([_0x8a84('0x90'),_0x8a84('0x91')],_0x4426d8[_0x8a84('0x5e')][_0x8a84('0x92')])>=0x0){return _0x1bfced[_0x8a84('0x3b')]({'read':!![]});}else{logger[_0x8a84('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8a84('0x2f'),'plivio',util[_0x8a84('0x89')](_0x4426d8['body'],{'showHidden':![],'depth':null}));}break;case _0x8a84('0x93'):var _0x3636da=_0x4426d8[_0x8a84('0x5e')][_0x8a84('0x94')][0x0];if(_0x3636da[_0x8a84('0x2f')]['groupName']===_0x8a84('0x95')){return _0x1bfced[_0x8a84('0x3b')]({'read':!![]});}else{logger[_0x8a84('0x2b')](_0x8a84('0x8d'),_0x8a84('0x2f'),'infobip',util[_0x8a84('0x89')](_0x4426d8['body'],{'showHidden':![],'depth':null}));}break;}return _0x1bfced;}})[_0x8a84('0x26')](respondWithResult(_0x244216,null))[_0x8a84('0x57')](handleError(_0x244216,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 74b553b..0dce643 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 _0xde9d=['emit','hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x3db860,_0x4e3333){var _0x51d5ce=function(_0x1d25e1){while(--_0x1d25e1){_0x3db860['push'](_0x3db860['shift']());}};_0x51d5ce(++_0x4e3333);}(_0xde9d,0x18a));var _0xdde9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xde9d[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0xdde9('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xdde9('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdde9('0x2')](0x0);var events={'afterCreate':_0xdde9('0x3'),'afterUpdate':_0xdde9('0x4'),'afterDestroy':_0xdde9('0x5')};function emitEvent(_0x7f4cf9){return function(_0x3cf7bb,_0x775ab2,_0x1da865){SmsMessageEvents['emit'](_0x7f4cf9+':'+_0x3cf7bb['id'],_0x3cf7bb);SmsMessageEvents[_0xdde9('0x6')](_0x7f4cf9,_0x3cf7bb);_0x1da865(null);};}for(var e in events){if(events[_0xdde9('0x7')](e)){var event=events[e];SmsMessage[_0xdde9('0x8')](e,emitEvent(event));}}module[_0xdde9('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x6e6d=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0x6e6d,0x105));var _0xd6e6=function(_0x43235c,_0x19d75e){_0x43235c=_0x43235c-0x0;var _0x4a04ed=_0x6e6d[_0x43235c];return _0x4a04ed;};'use strict';var EventEmitter=require(_0xd6e6('0x0'));var SmsMessage=require(_0xd6e6('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd6e6('0x2')](0x0);var events={'afterCreate':_0xd6e6('0x3'),'afterUpdate':'update','afterDestroy':_0xd6e6('0x4')};function emitEvent(_0x3e5e0f){return function(_0x1c869d,_0x383901,_0x563d5d){SmsMessageEvents[_0xd6e6('0x5')](_0x3e5e0f+':'+_0x1c869d['id'],_0x1c869d);SmsMessageEvents[_0xd6e6('0x5')](_0x3e5e0f,_0x1c869d);_0x563d5d(null);};}for(var e in events){if(events[_0xd6e6('0x6')](e)){var event=events[e];SmsMessage[_0xd6e6('0x7')](e,emitEvent(event));}}module[_0xd6e6('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 494762f..6212b77 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 _0xe74e=['https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','messageId','fti_sms_messages','models','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','out','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','format','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','/auth/1/session','baseUrl','remote','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey'];(function(_0x31ffcf,_0x326559){var _0x53c38c=function(_0x28972b){while(--_0x28972b){_0x31ffcf['push'](_0x31ffcf['shift']());}};_0x53c38c(++_0x326559);}(_0xe74e,0x10a));var _0xee74=function(_0x57d566,_0x20eef6){_0x57d566=_0x57d566-0x0;var _0x106c44=_0xe74e[_0x57d566];return _0x106c44;};'use strict';var _=require('lodash');var util=require(_0xee74('0x0'));var logger=require(_0xee74('0x1'))(_0xee74('0x2'));var moment=require(_0xee74('0x3'));var BPromise=require(_0xee74('0x4'));var rp=require(_0xee74('0x5'));var fs=require('fs');var path=require(_0xee74('0x6'));var rimraf=require(_0xee74('0x7'));var config=require(_0xee74('0x8'));var attributes=require(_0xee74('0x9'));module['exports']=function(_0x483d0a,_0xbb9d43){return _0x483d0a[_0xee74('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xee74('0xb'),'fields':[_0xee74('0xb')]},{'name':_0xee74('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12f2b7,_0x28ae0d,_0xe6609e){var _0x1c68e8=_0x483d0a[_0xee74('0xd')];var _0x90033d=_0x12f2b7['get']({'plain':!![]});if(_0x90033d[_0xee74('0xe')][_0xee74('0xf')]()==='in'||_0x90033d[_0xee74('0xe')][_0xee74('0xf')]()==='out'&&!_0x90033d[_0xee74('0x10')]&&!_[_0xee74('0x11')](_0x90033d[_0xee74('0x12')])){_0x1c68e8[_0xee74('0x13')]['findOne']({'where':{'id':_0x90033d[_0xee74('0x14')]}})[_0xee74('0x15')](function(_0x2dfe0f){if(_0x2dfe0f){_0x2dfe0f[_0xee74('0x16')]({'lastMsgAt':_0x90033d[_0xee74('0x17')],'lastMsgDirection':_0x90033d[_0xee74('0xe')]['toLowerCase']()});}})[_0xee74('0x18')](function(_0x456c3f){console[_0xee74('0x19')](_0x456c3f);});}if(_0x90033d['direction']===_0xee74('0x1a')&&!_0x90033d[_0xee74('0x10')]){var _0x5aa1db;_0x1c68e8['SmsAccount'][_0xee74('0x1b')]({'where':{'id':_0x90033d[_0xee74('0x1c')]},'raw':!![]})[_0xee74('0x15')](function(_0x320c54){_0x5aa1db=_0x320c54;if(_0x5aa1db&&_0x5aa1db[_0xee74('0x1d')]){switch(_0x5aa1db['type']){case _0xee74('0x1e'):var _0x165059=require('twilio');if(_0x5aa1db[_0xee74('0x1f')]&&_0x5aa1db[_0xee74('0x20')]&&_0x5aa1db[_0xee74('0x21')]){var _0x23ab9e=new _0x165059(_0x5aa1db[_0xee74('0x1f')],_0x5aa1db['authToken']);_0x23ab9e[_0xee74('0x22')][_0xee74('0x23')]({'body':_0x90033d[_0xee74('0x24')],'to':_0x90033d[_0xee74('0x21')],'from':_0x5aa1db['phone'],'statusCallback':_0x5aa1db['remote']+'/api/sms/messages/'+_0x90033d['id']+_0xee74('0x25')+_0x5aa1db[_0xee74('0x26')]})[_0xee74('0x15')](function(_0x1aa325){if(_0x1aa325[_0xee74('0x27')]){return _0x12f2b7[_0xee74('0x16')]({'messageId':_0x1aa325[_0xee74('0x27')]});}})[_0xee74('0x18')](function(_0x7bbf7e){logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x1e'),util[_0xee74('0x2a')](_0x7bbf7e,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x1e'),_0xee74('0x2b'));}break;case _0xee74('0x2c'):var _0x5c6096=_0xee74('0x2d');if(_0x5aa1db[_0xee74('0x2e')]&&_0x5aa1db[_0xee74('0x2f')]){var _0x1da568={'recipient':[_0x90033d[_0xee74('0x21')]],'message':_0x90033d[_0xee74('0x24')],'message_type':_0x5aa1db['smsMethod']};if(_0x5aa1db[_0xee74('0x30')]&&_0x5aa1db[_0xee74('0x30')]!=='SI'){_0x1da568[_0xee74('0x31')]=_0x5aa1db['phone'];}var _0x170e5d={'url':_0x5c6096+_0xee74('0x32')+_0x5aa1db[_0xee74('0x2e')]+_0xee74('0x33')+_0x5aa1db[_0xee74('0x2f')],'method':_0xee74('0x34')};rp(_0x170e5d)[_0xee74('0x15')](function(_0xb8cc6f){var _0x378dbd=_0xb8cc6f[_0xee74('0x35')](';');var _0x5bad7c={'user_key':_0x378dbd[0x0],'session_key':_0x378dbd[0x1]};_0x170e5d={'url':_0x5c6096+_0xee74('0x36'),'method':'POST','headers':{'user_key':_0x5bad7c['user_key'],'Session_key':_0x5bad7c[_0xee74('0x37')]},'json':!![],'body':_0x1da568};return rp(_0x170e5d);})['then'](function(_0x569507){if(_0x569507[_0xee74('0x38')]>=0x1){var _0xbfdcf9={'messageId':_0x569507['internal_order_id']};if(_0x5aa1db[_0xee74('0x30')]!=='GP'||!_0x5aa1db[_0xee74('0x39')]){_0xbfdcf9[_0xee74('0x3a')]=!![];}return _0x12f2b7[_0xee74('0x16')](_0xbfdcf9);}else{return logger['error'](_0xee74('0x28'),'afterCreate',_0xee74('0x2c'),util[_0xee74('0x2a')](_0x569507,{'showHidden':![],'depth':null}));}})[_0xee74('0x18')](function(_0x5001e9){return logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xee74('0x2c'),util[_0xee74('0x2a')](_0x5001e9,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xee74('0x2c'),_0xee74('0x3b'));}break;case _0xee74('0x3c'):if(_0x5aa1db[_0xee74('0x20')]){var _0x56fc25={'recipient':_0x90033d[_0xee74('0x21')],'message':_0x90033d[_0xee74('0x24')],'sender':_0x5aa1db[_0xee74('0x3d')]||_0x5aa1db[_0xee74('0x21')],'authorization':_0x5aa1db[_0xee74('0x20')]};var _0x28ae0d={'method':_0xee74('0x3e'),'uri':_0xee74('0x3f'),'body':_0x56fc25,'json':!![]};rp(_0x28ae0d)[_0xee74('0x15')](function(_0x56dd55){var _0x28d7d8={'messageId':_0x56dd55[_0xee74('0x40')]};if(!_0x5aa1db[_0xee74('0x39')]){_0x28d7d8[_0xee74('0x3a')]=!![];}return _0x12f2b7['update'](_0x28d7d8);})['catch'](function(_0x3369bf){logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x3c'),util[_0xee74('0x2a')](_0x3369bf,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate',_0xee74('0x3c'),_0xee74('0x41'));}break;case _0xee74('0x42'):if(_0x5aa1db[_0xee74('0x2e')]&&_0x5aa1db['password']){var _0x56fc25={'messages':[{'source':_0xee74('0x43'),'to':_0x90033d[_0xee74('0x21')],'body':_0x90033d[_0xee74('0x24')],'from':_0x5aa1db['senderString']||_0x5aa1db['phone']}]};var _0x3c8ec2=util['format'](_0xee74('0x44'),_0x5aa1db[_0xee74('0x2e')],_0x5aa1db[_0xee74('0x2f')]);var _0x28ae0d={'method':_0xee74('0x3e'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x56fc25,'headers':{'Authorization':util[_0xee74('0x45')](_0xee74('0x46'),new Buffer(_0x3c8ec2)[_0xee74('0x47')]('base64'))},'json':!![]};rp(_0x28ae0d)[_0xee74('0x15')](function(_0xa0bc6f){if(_0xa0bc6f['http_code']>=0xc8&&_0xa0bc6f[_0xee74('0x48')]<=0xce){if(_0xa0bc6f[_0xee74('0x49')]&&_0xa0bc6f['data'][_0xee74('0x4a')]>0x0){var _0x10416c=_[_0xee74('0x4b')](_0xa0bc6f[_0xee74('0x49')]['messages']);var _0x36a78a={'messageId':_0x10416c[_0xee74('0x4c')]};if(!_0x5aa1db['deliveryReport']){_0x36a78a[_0xee74('0x3a')]=!![];}return _0x12f2b7['update'](_0x36a78a);}else{logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x4d'),util[_0xee74('0x2a')](_0xa0bc6f,{'showHidden':![],'depth':null}));}}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x4d'),util[_0xee74('0x2a')](_0xa0bc6f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5ad786){logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate',_0xee74('0x4d'),util[_0xee74('0x2a')](_0x5ad786,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x4d'),_0xee74('0x3b'));}break;case _0xee74('0x4e'):if(_0x5aa1db[_0xee74('0x4f')]&&_0x5aa1db[_0xee74('0x20')]){var _0x56fc25={'dst':_0x90033d[_0xee74('0x21')],'text':_0x90033d[_0xee74('0x24')],'src':_0x5aa1db[_0xee74('0x3d')]||_0x5aa1db['phone'],'url':_0x5aa1db['remote']+_0xee74('0x50')+_0x90033d['id']+_0xee74('0x25')+_0x5aa1db[_0xee74('0x26')]};var _0x3c8ec2=util[_0xee74('0x45')](_0xee74('0x44'),_0x5aa1db[_0xee74('0x4f')],_0x5aa1db['authToken']);var _0x28ae0d={'method':_0xee74('0x3e'),'uri':util[_0xee74('0x45')](_0xee74('0x51'),_0x5aa1db[_0xee74('0x4f')]),'body':_0x56fc25,'headers':{'Authorization':util[_0xee74('0x45')](_0xee74('0x46'),new Buffer(_0x3c8ec2)['toString'](_0xee74('0x52')))},'json':!![]};rp(_0x28ae0d)[_0xee74('0x15')](function(_0x25dfc4){var _0x23cae9={'messageId':_0x25dfc4[_0xee74('0x53')][0x0]};return _0x12f2b7[_0xee74('0x16')](_0x23cae9);})[_0xee74('0x18')](function(_0xa4a705){logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x4e'),util['inspect'](_0xa4a705,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate',_0xee74('0x4e'),_0xee74('0x54'));}break;case'infobip':if(_0x5aa1db['username']&&_0x5aa1db[_0xee74('0x2f')]){if(_0x5aa1db['baseUrl']){var _0x194c24={'method':'POST','uri':_0x5aa1db['baseUrl']+_0xee74('0x55'),'body':{'username':_0x5aa1db['username'],'password':_0x5aa1db[_0xee74('0x2f')]},'json':!![]};return rp(_0x194c24)[_0xee74('0x15')](function(_0x5aa70a){var _0x530847={'method':_0xee74('0x3e'),'uri':_0x5aa1db[_0xee74('0x56')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5aa1db['phone'],'destinations':[{'to':_0x90033d[_0xee74('0x21')]}],'text':_0x90033d[_0xee74('0x24')],'notifyUrl':_0x5aa1db[_0xee74('0x57')]+_0xee74('0x50')+_0x90033d['id']+_0xee74('0x25')+_0x5aa1db[_0xee74('0x26')],'notifyContentType':'application/json','callbackData':_0x5aa1db[_0xee74('0x21')]+';'+_0x90033d[_0xee74('0x24')]}]},'headers':{'Authorization':_0xee74('0x58')+_0x5aa70a['token']},'json':!![]};return rp(_0x530847)[_0xee74('0x15')](function(_0x4531da){if(_0x4531da[_0xee74('0x22')]){var _0xbdc844={'messageId':_0x4531da['messages'][0x0][_0xee74('0xb')]};if(!_0x5aa1db[_0xee74('0x39')]){_0xbdc844[_0xee74('0x3a')]=!![];}return _0x12f2b7[_0xee74('0x16')](_0xbdc844);}else{return logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate','infobip',util['inspect'](_0x4531da,{'showHidden':![],'depth':null}));}});})[_0xee74('0x18')](function(_0x210d11){return logger['error'](_0xee74('0x28'),'afterCreate',_0xee74('0x59'),util[_0xee74('0x2a')](_0x210d11,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),'infobip',_0xee74('0x5a'));}}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x59'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xee74('0x5b'):var _0x6cc9f9=require(_0xee74('0x5c'));if(_0x5aa1db[_0xee74('0x5d')]){var _0xfcaaf0={};_0xfcaaf0[_0xee74('0x5e')]=_0x5aa1db[_0xee74('0x2e')];_0xfcaaf0['phone']=_0x90033d['phone'];_0xfcaaf0[_0xee74('0x31')]=_0x5aa1db[_0xee74('0x21')];_0xfcaaf0[_0xee74('0x5f')]=_0x90033d[_0xee74('0x24')];_0xfcaaf0['timestamp']=+new Date();var _0xca1d1d='';var _0x3d0a8e='';var _0x47d2b9=Object[_0xee74('0x60')](_0xfcaaf0);_0x47d2b9[_0xee74('0x61')]();for(var _0x2b09af=0x0;_0x2b09af<_0x47d2b9[_0xee74('0x62')];_0x2b09af++){if(_0xca1d1d!=''){_0xca1d1d+='&';}_0xca1d1d+=_0x47d2b9[_0x2b09af]+'='+encodeURIComponent(_0xfcaaf0[_0x47d2b9[_0x2b09af]]);_0x3d0a8e+=_0xfcaaf0[_0x47d2b9[_0x2b09af]];}_0x3d0a8e+=_0x5aa1db['apiKey'];_0x3d0a8e=_0x6cc9f9[_0xee74('0x63')](_0xee74('0x64'))[_0xee74('0x16')](_0x3d0a8e)[_0xee74('0x65')]('hex');if(_0xca1d1d!==''){_0xca1d1d+='&';}_0xca1d1d+=_0xee74('0x66')+_0x3d0a8e;var _0x170e5d={'method':'GET','uri':_0x5aa1db[_0xee74('0x56')]+_0xee74('0x67')+_0xca1d1d,'json':!![]};return rp(_0x170e5d)[_0xee74('0x15')](function(_0x210623){var _0x4929a9=Object[_0xee74('0x60')](_0x210623);if(_0x210623[_0x4929a9[0x0]][_0xee74('0x19')]&&parseInt(_0x210623[_0x4929a9[0x0]][_0xee74('0x19')])===0x0){var _0x592a60={'messageId':_0x210623[_0x4929a9[0x0]][_0xee74('0x68')]};if(!_0x5aa1db[_0xee74('0x39')]){_0x592a60[_0xee74('0x3a')]=!![];}return _0x12f2b7[_0xee74('0x16')](_0x592a60);}else{return logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xee74('0x29'),_0xee74('0x5b'),util[_0xee74('0x2a')](_0x210623['error'],{'showHidden':![],'depth':null}));}})[_0xee74('0x18')](function(_0x46c794){return logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x5b'),util['inspect'](_0x46c794,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x5b'),_0xee74('0x69'));}break;case'clickatell':if(_0x5aa1db[_0xee74('0x5d')]){var _0x21354a={'method':_0xee74('0x3e'),'uri':_0xee74('0x6a'),'headers':{'Authorization':_0x5aa1db[_0xee74('0x5d')]},'body':{'content':_0x90033d[_0xee74('0x24')],'to':[_0x90033d[_0xee74('0x21')]],'from':_0x5aa1db['phone'],'binary':![],'clientMessageId':_0xee74('0x6b'),'charset':_0xee74('0x6c')},'json':!![]};rp(_0x21354a)[_0xee74('0x15')](function(_0x234735){if(!_0x234735[_0xee74('0x19')]){var _0x577b1e={'messageId':_0x234735['messages'][0x0]['apiMessageId']};if(!_0x5aa1db['deliveryReport']){_0x577b1e[_0xee74('0x3a')]=!![];}return _0x12f2b7['update'](_0x577b1e);}else{return logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xee74('0x29'),'clickatell',util[_0xee74('0x2a')](_0x234735[_0xee74('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x55b382){return logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x6d'),util[_0xee74('0x2a')](_0x55b382,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xee74('0x29'),_0xee74('0x6d'),_0xee74('0x69'));}break;case _0xee74('0x6e'):if(_0x5aa1db['username']&&_0x5aa1db[_0xee74('0x2f')]){var _0x3c8ec2=util[_0xee74('0x45')](_0xee74('0x44'),_0x5aa1db[_0xee74('0x2e')],_0x5aa1db[_0xee74('0x2f')]);var _0x28ae0d={'method':_0xee74('0x3e'),'uri':_0xee74('0x6f')+_0x5aa1db[_0xee74('0x70')]+_0xee74('0x71'),'body':{'to':[_0x90033d['phone']],'text':_0x90033d[_0xee74('0x24')],'from':_0x5aa1db[_0xee74('0x21')],'applicationId':_0x5aa1db['applicationId']},'headers':{'Authorization':util[_0xee74('0x45')](_0xee74('0x46'),new Buffer(_0x3c8ec2)[_0xee74('0x47')](_0xee74('0x52')))},'json':!![]};rp(_0x28ae0d)[_0xee74('0x15')](function(_0x15cd5c){if(_0x15cd5c['id']){var _0x58a6ce={'messageId':_0x15cd5c['id']};return _0x12f2b7[_0xee74('0x16')](_0x58a6ce);}else{logger['error'](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x6e'),util['inspect'](_0x15cd5c,{'showHidden':![],'depth':null}));}})[_0xee74('0x18')](function(_0x17e148){logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x6e'),util[_0xee74('0x2a')](_0x17e148,{'showHidden':![],'depth':null}));});}else{logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x6e'),_0xee74('0x3b'));}break;case _0xee74('0x72'):if(_0x5aa1db['apiKey']){var _0x1a768f={};var _0x170e5d={'method':_0xee74('0x3e'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xee74('0x73')+_0x5aa1db[_0xee74('0x5d')],'Content-Type':_0xee74('0x74')},'body':{'from':_0x5aa1db[_0xee74('0x21')],'to':_0x90033d['phone'],'text':_0x90033d[_0xee74('0x24')]},'json':!![]};return rp(_0x170e5d)[_0xee74('0x15')](function(_0x2e9329){if(_0x2e9329['code']==0xca){_0x1a768f[_0xee74('0x75')]=_0x2e9329;var _0x5480a3={'method':_0xee74('0x3e'),'uri':_0xee74('0x76'),'headers':{'Authorization':_0xee74('0x73')+_0x5aa1db[_0xee74('0x5d')],'Content-Type':_0xee74('0x74')},'body':{'refid':_0x1a768f[_0xee74('0x75')][_0xee74('0x77')]},'json':!![]};return rp(_0x5480a3)[_0xee74('0x15')](function(_0x45c563){_0x1a768f[_0xee74('0x78')]=_0x45c563;var _0x1dc3f1={'messageId':_0x1a768f['message'][_0xee74('0x77')],'read':!![]};return _0x12f2b7['update'](_0x1dc3f1);});}else{return logger[_0xee74('0x19')](_0xee74('0x28'),'afterCreate',_0xee74('0x72'),util['inspect'](_0x2e9329,{'showHidden':![],'depth':null}));}})[_0xee74('0x18')](function(_0x2fd7a4){return logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x72'),util['inspect'](_0x2fd7a4,{'showHidden':![],'depth':null}));});}else{return logger[_0xee74('0x19')](_0xee74('0x28'),_0xee74('0x29'),_0xee74('0x72'),_0xee74('0x79'));}break;}}})[_0xee74('0x7a')](function(){_0xe6609e();});}else{_0xe6609e();}}},'charset':'utf8mb4','collate':_0xee74('0x7b')});}; \ No newline at end of file +var _0x89c4=['status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','models','get','direction','out','UserId','findOne','then','createdAt','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','update','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','user_key','session_key','total_sent','internal_order_id','read','skebby','catch','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','token','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','length','createHash','hex','signature=','GET','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiKey','uuid','UTF-8','apiMessageId','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid'];(function(_0x1b1ec4,_0x129be2){var _0x280dda=function(_0x20ff2a){while(--_0x20ff2a){_0x1b1ec4['push'](_0x1b1ec4['shift']());}};_0x280dda(++_0x129be2);}(_0x89c4,0x82));var _0x489c=function(_0x12924f,_0x30d69f){_0x12924f=_0x12924f-0x0;var _0x49cbf9=_0x89c4[_0x12924f];return _0x49cbf9;};'use strict';var _=require(_0x489c('0x0'));var util=require(_0x489c('0x1'));var logger=require('../../config/logger')(_0x489c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x489c('0x3'));var fs=require('fs');var path=require(_0x489c('0x4'));var rimraf=require(_0x489c('0x5'));var config=require(_0x489c('0x6'));var attributes=require(_0x489c('0x7'));module[_0x489c('0x8')]=function(_0x27415a,_0x4c5ea1){return _0x27415a[_0x489c('0x9')](_0x489c('0xa'),attributes,{'tableName':_0x489c('0xb'),'paranoid':![],'indexes':[{'name':_0x489c('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x489c('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x375265,_0x3cc086,_0xd2b0cb){var _0x108485=_0x27415a[_0x489c('0xe')];var _0x20a400=_0x375265[_0x489c('0xf')]({'plain':!![]});if(_0x20a400[_0x489c('0x10')]['toLowerCase']()==='in'||_0x20a400[_0x489c('0x10')]['toLowerCase']()===_0x489c('0x11')&&!_0x20a400['secret']&&!_['isNil'](_0x20a400[_0x489c('0x12')])){_0x108485['SmsInteraction'][_0x489c('0x13')]({'where':{'id':_0x20a400['SmsInteractionId']}})[_0x489c('0x14')](function(_0x45983e){if(_0x45983e){_0x45983e['update']({'lastMsgAt':_0x20a400[_0x489c('0x15')],'lastMsgDirection':_0x20a400[_0x489c('0x10')]['toLowerCase']()});}})['catch'](function(_0x1bb98a){console['error'](_0x1bb98a);});}if(_0x20a400[_0x489c('0x10')]===_0x489c('0x11')&&!_0x20a400[_0x489c('0x16')]){var _0x39f9a9;_0x108485[_0x489c('0x17')][_0x489c('0x18')]({'where':{'id':_0x20a400[_0x489c('0x19')]},'raw':!![]})[_0x489c('0x14')](function(_0xa91de){_0x39f9a9=_0xa91de;if(_0x39f9a9&&_0x39f9a9[_0x489c('0x1a')]){switch(_0x39f9a9[_0x489c('0x1a')]){case _0x489c('0x1b'):var _0x3ee33c=require(_0x489c('0x1b'));if(_0x39f9a9[_0x489c('0x1c')]&&_0x39f9a9[_0x489c('0x1d')]&&_0x39f9a9[_0x489c('0x1e')]){var _0x381b56=new _0x3ee33c(_0x39f9a9['accountSid'],_0x39f9a9[_0x489c('0x1d')]);_0x381b56[_0x489c('0x1f')][_0x489c('0x20')]({'body':_0x20a400[_0x489c('0xd')],'to':_0x20a400[_0x489c('0x1e')],'from':_0x39f9a9['phone'],'statusCallback':_0x39f9a9[_0x489c('0x21')]+_0x489c('0x22')+_0x20a400['id']+_0x489c('0x23')+_0x39f9a9['token']})[_0x489c('0x14')](function(_0x1de4bf){if(_0x1de4bf['sid']){return _0x375265[_0x489c('0x24')]({'messageId':_0x1de4bf[_0x489c('0x25')]});}})['catch'](function(_0x35db69){logger['error'](_0x489c('0x26'),_0x489c('0x27'),'twilio',util[_0x489c('0x28')](_0x35db69,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),'twilio',_0x489c('0x2a'));}break;case'skebby':var _0x2ce72c=_0x489c('0x2b');if(_0x39f9a9[_0x489c('0x2c')]&&_0x39f9a9[_0x489c('0x2d')]){var _0x36d812={'recipient':[_0x20a400[_0x489c('0x1e')]],'message':_0x20a400['body'],'message_type':_0x39f9a9[_0x489c('0x2e')]};if(_0x39f9a9[_0x489c('0x2e')]&&_0x39f9a9['smsMethod']!=='SI'){_0x36d812[_0x489c('0x2f')]=_0x39f9a9[_0x489c('0x1e')];}var _0x35340a={'url':_0x2ce72c+_0x489c('0x30')+_0x39f9a9[_0x489c('0x2c')]+_0x489c('0x31')+_0x39f9a9[_0x489c('0x2d')],'method':'GET'};rp(_0x35340a)[_0x489c('0x14')](function(_0x335436){var _0x4a7128=_0x335436[_0x489c('0x32')](';');var _0x13bb3e={'user_key':_0x4a7128[0x0],'session_key':_0x4a7128[0x1]};_0x35340a={'url':_0x2ce72c+_0x489c('0x33'),'method':'POST','headers':{'user_key':_0x13bb3e[_0x489c('0x34')],'Session_key':_0x13bb3e[_0x489c('0x35')]},'json':!![],'body':_0x36d812};return rp(_0x35340a);})[_0x489c('0x14')](function(_0x157760){if(_0x157760[_0x489c('0x36')]>=0x1){var _0x3833d4={'messageId':_0x157760[_0x489c('0x37')]};if(_0x39f9a9[_0x489c('0x2e')]!=='GP'||!_0x39f9a9['deliveryReport']){_0x3833d4[_0x489c('0x38')]=!![];}return _0x375265[_0x489c('0x24')](_0x3833d4);}else{return logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x39'),util[_0x489c('0x28')](_0x157760,{'showHidden':![],'depth':null}));}})[_0x489c('0x3a')](function(_0x3980a5){return logger[_0x489c('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x489c('0x27'),'skebby',util[_0x489c('0x28')](_0x3980a5,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),'skebby',_0x489c('0x3b'));}break;case _0x489c('0x3c'):if(_0x39f9a9[_0x489c('0x1d')]){var _0x3c87ac={'recipient':_0x20a400[_0x489c('0x1e')],'message':_0x20a400[_0x489c('0xd')],'sender':_0x39f9a9[_0x489c('0x3d')]||_0x39f9a9['phone'],'authorization':_0x39f9a9[_0x489c('0x1d')]};var _0x3cc086={'method':_0x489c('0x3e'),'uri':_0x489c('0x3f'),'body':_0x3c87ac,'json':!![]};rp(_0x3cc086)[_0x489c('0x14')](function(_0x5b508c){var _0x298cd6={'messageId':_0x5b508c['requestid']};if(!_0x39f9a9[_0x489c('0x40')]){_0x298cd6['read']=!![];}return _0x375265[_0x489c('0x24')](_0x298cd6);})[_0x489c('0x3a')](function(_0x3f5a50){logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x3c'),util[_0x489c('0x28')](_0x3f5a50,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x3c'),_0x489c('0x41'));}break;case _0x489c('0x42'):if(_0x39f9a9[_0x489c('0x2c')]&&_0x39f9a9['password']){var _0x3c87ac={'messages':[{'source':_0x489c('0x43'),'to':_0x20a400[_0x489c('0x1e')],'body':_0x20a400[_0x489c('0xd')],'from':_0x39f9a9[_0x489c('0x3d')]||_0x39f9a9['phone']}]};var _0x4e4bc0=util[_0x489c('0x44')]('%s:%s',_0x39f9a9[_0x489c('0x2c')],_0x39f9a9['password']);var _0x3cc086={'method':'POST','uri':_0x489c('0x45'),'body':_0x3c87ac,'headers':{'Authorization':util[_0x489c('0x44')](_0x489c('0x46'),new Buffer(_0x4e4bc0)[_0x489c('0x47')](_0x489c('0x48')))},'json':!![]};rp(_0x3cc086)[_0x489c('0x14')](function(_0xb24af0){if(_0xb24af0[_0x489c('0x49')]>=0xc8&&_0xb24af0[_0x489c('0x49')]<=0xce){if(_0xb24af0[_0x489c('0x4a')]&&_0xb24af0[_0x489c('0x4a')][_0x489c('0x4b')]>0x0){var _0x393b6=_[_0x489c('0x4c')](_0xb24af0[_0x489c('0x4a')][_0x489c('0x1f')]);var _0x26a367={'messageId':_0x393b6[_0x489c('0x4d')]};if(!_0x39f9a9['deliveryReport']){_0x26a367[_0x489c('0x38')]=!![];}return _0x375265['update'](_0x26a367);}else{logger[_0x489c('0x29')](_0x489c('0x26'),'afterCreate',_0x489c('0x4e'),util[_0x489c('0x28')](_0xb24af0,{'showHidden':![],'depth':null}));}}else{logger[_0x489c('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x489c('0x4e'),util[_0x489c('0x28')](_0xb24af0,{'showHidden':![],'depth':null}));}})['catch'](function(_0x16da9d){logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x4e'),util[_0x489c('0x28')](_0x16da9d,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x4e'),_0x489c('0x3b'));}break;case _0x489c('0x4f'):if(_0x39f9a9[_0x489c('0x50')]&&_0x39f9a9[_0x489c('0x1d')]){var _0x3c87ac={'dst':_0x20a400[_0x489c('0x1e')],'text':_0x20a400[_0x489c('0xd')],'src':_0x39f9a9[_0x489c('0x3d')]||_0x39f9a9[_0x489c('0x1e')],'url':_0x39f9a9[_0x489c('0x21')]+_0x489c('0x22')+_0x20a400['id']+'/status?token='+_0x39f9a9[_0x489c('0x51')]};var _0x4e4bc0=util[_0x489c('0x44')]('%s:%s',_0x39f9a9['authId'],_0x39f9a9[_0x489c('0x1d')]);var _0x3cc086={'method':_0x489c('0x3e'),'uri':util[_0x489c('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0x39f9a9[_0x489c('0x50')]),'body':_0x3c87ac,'headers':{'Authorization':util[_0x489c('0x44')]('Basic\x20%s',new Buffer(_0x4e4bc0)[_0x489c('0x47')]('base64'))},'json':!![]};rp(_0x3cc086)['then'](function(_0x6e4130){var _0x219d1f={'messageId':_0x6e4130[_0x489c('0x52')][0x0]};return _0x375265[_0x489c('0x24')](_0x219d1f);})[_0x489c('0x3a')](function(_0x279090){logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x4f'),util[_0x489c('0x28')](_0x279090,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x489c('0x27'),_0x489c('0x4f'),_0x489c('0x53'));}break;case'infobip':if(_0x39f9a9[_0x489c('0x2c')]&&_0x39f9a9['password']){if(_0x39f9a9['baseUrl']){var _0x5bbede={'method':_0x489c('0x3e'),'uri':_0x39f9a9[_0x489c('0x54')]+_0x489c('0x55'),'body':{'username':_0x39f9a9[_0x489c('0x2c')],'password':_0x39f9a9[_0x489c('0x2d')]},'json':!![]};return rp(_0x5bbede)[_0x489c('0x14')](function(_0x41c853){var _0x2cca96={'method':_0x489c('0x3e'),'uri':_0x39f9a9['baseUrl']+_0x489c('0x56'),'body':{'messages':[{'from':_0x39f9a9[_0x489c('0x1e')],'destinations':[{'to':_0x20a400[_0x489c('0x1e')]}],'text':_0x20a400['body'],'notifyUrl':_0x39f9a9['remote']+'/api/sms/messages/'+_0x20a400['id']+_0x489c('0x23')+_0x39f9a9[_0x489c('0x51')],'notifyContentType':_0x489c('0x57'),'callbackData':_0x39f9a9[_0x489c('0x1e')]+';'+_0x20a400[_0x489c('0xd')]}]},'headers':{'Authorization':_0x489c('0x58')+_0x41c853[_0x489c('0x51')]},'json':!![]};return rp(_0x2cca96)['then'](function(_0xc98873){if(_0xc98873[_0x489c('0x1f')]){var _0x5d272f={'messageId':_0xc98873['messages'][0x0][_0x489c('0xc')]};if(!_0x39f9a9[_0x489c('0x40')]){_0x5d272f[_0x489c('0x38')]=!![];}return _0x375265[_0x489c('0x24')](_0x5d272f);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x489c('0x27'),'infobip',util[_0x489c('0x28')](_0xc98873,{'showHidden':![],'depth':null}));}});})[_0x489c('0x3a')](function(_0x1bba50){return logger[_0x489c('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x489c('0x59'),util['inspect'](_0x1bba50,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x59'),_0x489c('0x5a'));}}else{logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x59'),_0x489c('0x3b'));}break;case _0x489c('0x5b'):var _0x4ab07a=require(_0x489c('0x5c'));if(_0x39f9a9['apiKey']){var _0x3d09bc={};_0x3d09bc[_0x489c('0x5d')]=_0x39f9a9['username'];_0x3d09bc[_0x489c('0x1e')]=_0x20a400[_0x489c('0x1e')];_0x3d09bc[_0x489c('0x2f')]=_0x39f9a9['phone'];_0x3d09bc[_0x489c('0x5e')]=_0x20a400['body'];_0x3d09bc[_0x489c('0x5f')]=+new Date();var _0x512467='';var _0x524c49='';var _0x233ef4=Object[_0x489c('0x60')](_0x3d09bc);_0x233ef4[_0x489c('0x61')]();for(var _0x419a3a=0x0;_0x419a3a<_0x233ef4[_0x489c('0x62')];_0x419a3a++){if(_0x512467!=''){_0x512467+='&';}_0x512467+=_0x233ef4[_0x419a3a]+'='+encodeURIComponent(_0x3d09bc[_0x233ef4[_0x419a3a]]);_0x524c49+=_0x3d09bc[_0x233ef4[_0x419a3a]];}_0x524c49+=_0x39f9a9['apiKey'];_0x524c49=_0x4ab07a[_0x489c('0x63')]('md5')['update'](_0x524c49)['digest'](_0x489c('0x64'));if(_0x512467!==''){_0x512467+='&';}_0x512467+=_0x489c('0x65')+_0x524c49;var _0x35340a={'method':_0x489c('0x66'),'uri':_0x39f9a9[_0x489c('0x54')]+_0x489c('0x67')+_0x512467,'json':!![]};return rp(_0x35340a)[_0x489c('0x14')](function(_0x38ee40){var _0x88f266=Object[_0x489c('0x60')](_0x38ee40);if(_0x38ee40[_0x88f266[0x0]][_0x489c('0x29')]&&parseInt(_0x38ee40[_0x88f266[0x0]]['error'])===0x0){var _0x3c4c7b={'messageId':_0x38ee40[_0x88f266[0x0]]['id_sms']};if(!_0x39f9a9[_0x489c('0x40')]){_0x3c4c7b['read']=!![];}return _0x375265[_0x489c('0x24')](_0x3c4c7b);}else{return logger[_0x489c('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x489c('0x5b'),util[_0x489c('0x28')](_0x38ee40['error'],{'showHidden':![],'depth':null}));}})[_0x489c('0x3a')](function(_0x11a095){return logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x5b'),util['inspect'](_0x11a095,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')](_0x489c('0x26'),'afterCreate',_0x489c('0x5b'),_0x489c('0x68'));}break;case _0x489c('0x69'):if(_0x39f9a9['apiKey']){var _0x132999={'method':_0x489c('0x3e'),'uri':_0x489c('0x6a'),'headers':{'Authorization':_0x39f9a9[_0x489c('0x6b')]},'body':{'content':_0x20a400['body'],'to':[_0x20a400[_0x489c('0x1e')]],'from':_0x39f9a9['phone'],'binary':![],'clientMessageId':_0x489c('0x6c'),'charset':_0x489c('0x6d')},'json':!![]};rp(_0x132999)['then'](function(_0x154cf7){if(!_0x154cf7[_0x489c('0x29')]){var _0x5dd61e={'messageId':_0x154cf7[_0x489c('0x1f')][0x0][_0x489c('0x6e')]};if(!_0x39f9a9[_0x489c('0x40')]){_0x5dd61e['read']=!![];}return _0x375265[_0x489c('0x24')](_0x5dd61e);}else{return logger[_0x489c('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x489c('0x27'),_0x489c('0x69'),util[_0x489c('0x28')](_0x154cf7[_0x489c('0x29')],{'showHidden':![],'depth':null}));}})[_0x489c('0x3a')](function(_0x5edf54){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x489c('0x27'),'clickatell',util[_0x489c('0x28')](_0x5edf54,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')](_0x489c('0x26'),'afterCreate','clickatell',_0x489c('0x68'));}break;case _0x489c('0x6f'):if(_0x39f9a9['username']&&_0x39f9a9[_0x489c('0x2d')]){var _0x4e4bc0=util['format'](_0x489c('0x70'),_0x39f9a9[_0x489c('0x2c')],_0x39f9a9[_0x489c('0x2d')]);var _0x3cc086={'method':_0x489c('0x3e'),'uri':_0x489c('0x71')+_0x39f9a9[_0x489c('0x72')]+_0x489c('0x73'),'body':{'to':[_0x20a400[_0x489c('0x1e')]],'text':_0x20a400[_0x489c('0xd')],'from':_0x39f9a9['phone'],'applicationId':_0x39f9a9['applicationId']},'headers':{'Authorization':util['format'](_0x489c('0x46'),new Buffer(_0x4e4bc0)[_0x489c('0x47')](_0x489c('0x48')))},'json':!![]};rp(_0x3cc086)['then'](function(_0x3e9629){if(_0x3e9629['id']){var _0x121928={'messageId':_0x3e9629['id']};return _0x375265[_0x489c('0x24')](_0x121928);}else{logger['error'](_0x489c('0x26'),'afterCreate',_0x489c('0x6f'),util[_0x489c('0x28')](_0x3e9629,{'showHidden':![],'depth':null}));}})[_0x489c('0x3a')](function(_0x728344){logger[_0x489c('0x29')](_0x489c('0x26'),'afterCreate','bandwidth',util[_0x489c('0x28')](_0x728344,{'showHidden':![],'depth':null}));});}else{logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),'bandwidth',_0x489c('0x3b'));}break;case _0x489c('0x74'):if(_0x39f9a9['apiKey']){var _0x3d29d3={};var _0x35340a={'method':_0x489c('0x3e'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x39f9a9['apiKey'],'Content-Type':_0x489c('0x57')},'body':{'from':_0x39f9a9[_0x489c('0x1e')],'to':_0x20a400[_0x489c('0x1e')],'text':_0x20a400[_0x489c('0xd')]},'json':!![]};return rp(_0x35340a)[_0x489c('0x14')](function(_0x19da94){if(_0x19da94[_0x489c('0x75')]==0xca){_0x3d29d3[_0x489c('0x76')]=_0x19da94;var _0x24533e={'method':'POST','uri':_0x489c('0x77'),'headers':{'Authorization':_0x489c('0x78')+_0x39f9a9[_0x489c('0x6b')],'Content-Type':_0x489c('0x57')},'body':{'refid':_0x3d29d3[_0x489c('0x76')][_0x489c('0x79')]},'json':!![]};return rp(_0x24533e)[_0x489c('0x14')](function(_0x34c805){_0x3d29d3[_0x489c('0x7a')]=_0x34c805;var _0x49e329={'messageId':_0x3d29d3['message']['refid'],'read':!![]};return _0x375265['update'](_0x49e329);});}else{return logger['error'](_0x489c('0x26'),'afterCreate',_0x489c('0x74'),util['inspect'](_0x19da94,{'showHidden':![],'depth':null}));}})['catch'](function(_0x406178){return logger[_0x489c('0x29')](_0x489c('0x26'),_0x489c('0x27'),_0x489c('0x74'),util[_0x489c('0x28')](_0x406178,{'showHidden':![],'depth':null}));});}else{return logger[_0x489c('0x29')](_0x489c('0x26'),'afterCreate',_0x489c('0x74'),'Token\x20not\x20received');}break;}}})[_0x489c('0x7b')](function(){_0xd2b0cb();});}else{_0xd2b0cb();}}},'charset':_0x489c('0x7c'),'collate':_0x489c('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index ed410bd..074b8c1 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 _0x7cf6=['info','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','SmsMessage','body','options','raw','CreateSmsMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','then'];(function(_0x57bf00,_0x506b93){var _0x5a9564=function(_0x4ebda9){while(--_0x4ebda9){_0x57bf00['push'](_0x57bf00['shift']());}};_0x5a9564(++_0x506b93);}(_0x7cf6,0x18f));var _0x67cf=function(_0x3fddab,_0x355100){_0x3fddab=_0x3fddab-0x0;var _0x372a03=_0x7cf6[_0x3fddab];return _0x372a03;};'use strict';var _=require(_0x67cf('0x0'));var util=require(_0x67cf('0x1'));var moment=require(_0x67cf('0x2'));var BPromise=require('bluebird');var rs=require(_0x67cf('0x3'));var fs=require('fs');var Redis=require(_0x67cf('0x4'));var db=require(_0x67cf('0x5'))['db'];var utils=require(_0x67cf('0x6'));var logger=require(_0x67cf('0x7'))(_0x67cf('0x8'));var config=require('../../config/environment');var jayson=require(_0x67cf('0x9'));var client=jayson[_0x67cf('0xa')][_0x67cf('0xb')]({'port':0x232a});config[_0x67cf('0xc')]=_[_0x67cf('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x67cf('0xe'))(new Redis(config[_0x67cf('0xc')]));require(_0x67cf('0xf'))['register'](socket);function respondWithRpcPromise(_0x2ce9f5,_0x54a995,_0x106400){return new BPromise(function(_0x1d361d,_0x4fb013){return client['request'](_0x2ce9f5,_0x106400)[_0x67cf('0x10')](function(_0x5d7fe3){logger[_0x67cf('0x11')]('SmsMessage,\x20%s,\x20%s',_0x54a995,'request\x20sent');logger['debug'](_0x67cf('0x12'),_0x54a995,_0x67cf('0x13'),JSON[_0x67cf('0x14')](_0x5d7fe3));if(_0x5d7fe3['error']){if(_0x5d7fe3[_0x67cf('0x15')][_0x67cf('0x16')]===0x1f4){logger[_0x67cf('0x15')](_0x67cf('0x17'),_0x54a995,_0x5d7fe3[_0x67cf('0x15')]['message']);return _0x4fb013(_0x5d7fe3[_0x67cf('0x15')]['message']);}logger[_0x67cf('0x15')]('SmsMessage,\x20%s,\x20%s',_0x54a995,_0x5d7fe3[_0x67cf('0x15')][_0x67cf('0x18')]);return _0x1d361d(_0x5d7fe3[_0x67cf('0x15')][_0x67cf('0x18')]);}else{logger[_0x67cf('0x11')](_0x67cf('0x17'),_0x54a995,_0x67cf('0x13'));_0x1d361d(_0x5d7fe3[_0x67cf('0x19')]['message']);}})[_0x67cf('0x1a')](function(_0x40a4b8){logger[_0x67cf('0x15')](_0x67cf('0x17'),_0x54a995,_0x40a4b8);_0x4fb013(_0x40a4b8);});});}exports['CreateSmsMessage']=function(_0x5a191b){var _0x5f2f7e=this;return new Promise(function(_0x32b46e,_0x5695f7){return db[_0x67cf('0x1b')]['create'](_0x5a191b[_0x67cf('0x1c')],{'raw':_0x5a191b[_0x67cf('0x1d')]?_0x5a191b['options'][_0x67cf('0x1e')]===undefined?!![]:![]:!![]})[_0x67cf('0x10')](function(_0x5e1ce3){logger[_0x67cf('0x11')](_0x67cf('0x1f'),_0x5a191b);logger['debug']('CreateSmsMessage',_0x5a191b,JSON[_0x67cf('0x14')](_0x5e1ce3));_0x32b46e(_0x5e1ce3);})['catch'](function(_0x3fca65){logger[_0x67cf('0x15')](_0x67cf('0x1f'),_0x3fca65[_0x67cf('0x18')],_0x5a191b);_0x5695f7(_0x5f2f7e[_0x67cf('0x15')](0x1f4,_0x3fca65[_0x67cf('0x18')]));});});}; \ No newline at end of file +var _0x6d13=['info','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw'];(function(_0x1feb65,_0x59d59b){var _0xb2dbb3=function(_0x13c353){while(--_0x13c353){_0x1feb65['push'](_0x1feb65['shift']());}};_0xb2dbb3(++_0x59d59b);}(_0x6d13,0x1eb));var _0x36d1=function(_0x4d4f61,_0x56d7a7){_0x4d4f61=_0x4d4f61-0x0;var _0x297414=_0x6d13[_0x4d4f61];return _0x297414;};'use strict';var _=require(_0x36d1('0x0'));var util=require('util');var moment=require(_0x36d1('0x1'));var BPromise=require(_0x36d1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x36d1('0x3'))['db'];var utils=require(_0x36d1('0x4'));var logger=require(_0x36d1('0x5'))(_0x36d1('0x6'));var config=require(_0x36d1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x36d1('0x8')][_0x36d1('0x9')]({'port':0x232a});config[_0x36d1('0xa')]=_[_0x36d1('0xb')](config[_0x36d1('0xa')],{'host':_0x36d1('0xc'),'port':0x18eb});var socket=require(_0x36d1('0xd'))(new Redis(config['redis']));require(_0x36d1('0xe'))[_0x36d1('0xf')](socket);function respondWithRpcPromise(_0x3bb1ae,_0x30925b,_0xb44ff7){return new BPromise(function(_0x5a16bd,_0x159b27){return client[_0x36d1('0x10')](_0x3bb1ae,_0xb44ff7)[_0x36d1('0x11')](function(_0x26e104){logger['info']('SmsMessage,\x20%s,\x20%s',_0x30925b,_0x36d1('0x12'));logger[_0x36d1('0x13')](_0x36d1('0x14'),_0x30925b,_0x36d1('0x12'),JSON[_0x36d1('0x15')](_0x26e104));if(_0x26e104[_0x36d1('0x16')]){if(_0x26e104['error'][_0x36d1('0x17')]===0x1f4){logger[_0x36d1('0x16')](_0x36d1('0x18'),_0x30925b,_0x26e104[_0x36d1('0x16')][_0x36d1('0x19')]);return _0x159b27(_0x26e104[_0x36d1('0x16')][_0x36d1('0x19')]);}logger[_0x36d1('0x16')]('SmsMessage,\x20%s,\x20%s',_0x30925b,_0x26e104[_0x36d1('0x16')][_0x36d1('0x19')]);return _0x5a16bd(_0x26e104[_0x36d1('0x16')]['message']);}else{logger['info'](_0x36d1('0x18'),_0x30925b,_0x36d1('0x12'));_0x5a16bd(_0x26e104[_0x36d1('0x1a')][_0x36d1('0x19')]);}})[_0x36d1('0x1b')](function(_0x5b4eee){logger[_0x36d1('0x16')](_0x36d1('0x18'),_0x30925b,_0x5b4eee);_0x159b27(_0x5b4eee);});});}exports[_0x36d1('0x1c')]=function(_0x10442a){var _0x514807=this;return new Promise(function(_0x25008a,_0x3dda52){return db[_0x36d1('0x1d')][_0x36d1('0x1e')](_0x10442a[_0x36d1('0x1f')],{'raw':_0x10442a[_0x36d1('0x20')]?_0x10442a[_0x36d1('0x20')][_0x36d1('0x21')]===undefined?!![]:![]:!![]})[_0x36d1('0x11')](function(_0x5d8a35){logger[_0x36d1('0x22')](_0x36d1('0x1c'),_0x10442a);logger[_0x36d1('0x13')](_0x36d1('0x1c'),_0x10442a,JSON[_0x36d1('0x15')](_0x5d8a35));_0x25008a(_0x5d8a35);})[_0x36d1('0x1b')](function(_0x259411){logger[_0x36d1('0x16')](_0x36d1('0x1c'),_0x259411[_0x36d1('0x19')],_0x10442a);_0x3dda52(_0x514807[_0x36d1('0x16')](0x1f4,_0x259411[_0x36d1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 339f755..ab7b937 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 _0x1ce9=['length','smsMessage:','./smsMessage.events','update','removeListener'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0x1ce9,0xde));var _0x91ce=function(_0x2dfcb2,_0x6757ee){_0x2dfcb2=_0x2dfcb2-0x0;var _0x41825d=_0x1ce9[_0x2dfcb2];return _0x41825d;};'use strict';var SmsMessageEvents=require(_0x91ce('0x0'));var events=['save','remove',_0x91ce('0x1')];function createListener(_0x4fb038,_0x2422eb){return function(_0x46bf7a){_0x2422eb['emit'](_0x4fb038,_0x46bf7a);};}function removeListener(_0x1d6ad1,_0x5608ba){return function(){SmsMessageEvents[_0x91ce('0x2')](_0x1d6ad1,_0x5608ba);};}exports['register']=function(_0x5bfca1){for(var _0x2f2afa=0x0,_0x193784=events[_0x91ce('0x3')];_0x2f2afa<_0x193784;_0x2f2afa++){var _0x318eff=events[_0x2f2afa];var _0x4c058b=createListener(_0x91ce('0x4')+_0x318eff,_0x5bfca1);SmsMessageEvents['on'](_0x318eff,_0x4c058b);}}; \ No newline at end of file +var _0xd2c7=['smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener'];(function(_0x50c16c,_0x43b99e){var _0x24dc5f=function(_0x39b90f){while(--_0x39b90f){_0x50c16c['push'](_0x50c16c['shift']());}};_0x24dc5f(++_0x43b99e);}(_0xd2c7,0x8d));var _0x7d2c=function(_0x237bed,_0x2c9315){_0x237bed=_0x237bed-0x0;var _0x325fbf=_0xd2c7[_0x237bed];return _0x325fbf;};'use strict';var SmsMessageEvents=require(_0x7d2c('0x0'));var events=[_0x7d2c('0x1'),_0x7d2c('0x2'),_0x7d2c('0x3')];function createListener(_0xb76be9,_0x27717c){return function(_0x4da9fa){_0x27717c[_0x7d2c('0x4')](_0xb76be9,_0x4da9fa);};}function removeListener(_0x1654bb,_0x457a6c){return function(){SmsMessageEvents[_0x7d2c('0x5')](_0x1654bb,_0x457a6c);};}exports['register']=function(_0x44620c){for(var _0x43090e=0x0,_0x5ef607=events['length'];_0x43090e<_0x5ef607;_0x43090e++){var _0x2a6ef4=events[_0x43090e];var _0x5cc824=createListener(_0x7d2c('0x6')+_0x2a6ef4,_0x44620c);SmsMessageEvents['on'](_0x2a6ef4,_0x5cc824);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 1252593..67b155d 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 _0x7a10=['/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','getMembers'];(function(_0x3a2798,_0x2e2ec6){var _0x2c5a84=function(_0x5f3e94){while(--_0x5f3e94){_0x3a2798['push'](_0x3a2798['shift']());}};_0x2c5a84(++_0x2e2ec6);}(_0x7a10,0xe4));var _0x07a1=function(_0x25c9f6,_0x44c87b){_0x25c9f6=_0x25c9f6-0x0;var _0x87070c=_0x7a10[_0x25c9f6];return _0x87070c;};'use strict';var multer=require(_0x07a1('0x0'));var util=require(_0x07a1('0x1'));var path=require(_0x07a1('0x2'));var timeout=require(_0x07a1('0x3'));var express=require('express');var router=express[_0x07a1('0x4')]();var fs_extra=require(_0x07a1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x07a1('0x6'));var config=require(_0x07a1('0x7'));var controller=require(_0x07a1('0x8'));router[_0x07a1('0x9')]('/',auth[_0x07a1('0xa')](),controller[_0x07a1('0xb')]);router[_0x07a1('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x07a1('0xc')]);router[_0x07a1('0x9')](_0x07a1('0xd'),auth[_0x07a1('0xa')](),controller['show']);router[_0x07a1('0x9')]('/:id/members',auth[_0x07a1('0xa')](),controller[_0x07a1('0xe')]);router['get'](_0x07a1('0xf'),auth[_0x07a1('0xa')](),controller[_0x07a1('0x10')]);router[_0x07a1('0x9')](_0x07a1('0x11'),auth[_0x07a1('0xa')](),controller[_0x07a1('0x12')]);router[_0x07a1('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x07a1('0x14')]);router[_0x07a1('0x13')](_0x07a1('0x11'),auth['isAuthenticated'](),controller[_0x07a1('0x15')]);router[_0x07a1('0x16')]('/:id',auth[_0x07a1('0xa')](),controller[_0x07a1('0x17')]);router[_0x07a1('0x18')](_0x07a1('0xd'),auth[_0x07a1('0xa')](),controller['destroy']);router[_0x07a1('0x18')](_0x07a1('0xf'),auth[_0x07a1('0xa')](),controller[_0x07a1('0x19')]);router[_0x07a1('0x18')](_0x07a1('0x11'),auth['isAuthenticated'](),controller[_0x07a1('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xf7d6=['index','/describe','describe','show','/:id/members','getMembers','/:id/teams','isAuthenticated','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get'];(function(_0x45c8c,_0x3c4b10){var _0x1159d2=function(_0x2e3a30){while(--_0x2e3a30){_0x45c8c['push'](_0x45c8c['shift']());}};_0x1159d2(++_0x3c4b10);}(_0xf7d6,0xdd));var _0x6f7d=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xf7d6[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x6f7d('0x0'));var util=require(_0x6f7d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f7d('0x2'));var router=express[_0x6f7d('0x3')]();var fs_extra=require(_0x6f7d('0x4'));var auth=require(_0x6f7d('0x5'));var interaction=require(_0x6f7d('0x6'));var config=require(_0x6f7d('0x7'));var controller=require(_0x6f7d('0x8'));router[_0x6f7d('0x9')]('/',auth['isAuthenticated'](),controller[_0x6f7d('0xa')]);router['get'](_0x6f7d('0xb'),auth['isAuthenticated'](),controller[_0x6f7d('0xc')]);router[_0x6f7d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6f7d('0xd')]);router[_0x6f7d('0x9')](_0x6f7d('0xe'),auth['isAuthenticated'](),controller[_0x6f7d('0xf')]);router['get'](_0x6f7d('0x10'),auth[_0x6f7d('0x11')](),controller[_0x6f7d('0x12')]);router[_0x6f7d('0x9')](_0x6f7d('0x13'),auth['isAuthenticated'](),controller[_0x6f7d('0x14')]);router['post']('/',auth[_0x6f7d('0x11')](),controller[_0x6f7d('0x15')]);router[_0x6f7d('0x16')](_0x6f7d('0x10'),auth[_0x6f7d('0x11')](),controller[_0x6f7d('0x17')]);router['post']('/:id/users',auth[_0x6f7d('0x11')](),controller[_0x6f7d('0x18')]);router[_0x6f7d('0x19')](_0x6f7d('0x1a'),auth[_0x6f7d('0x11')](),controller[_0x6f7d('0x1b')]);router['delete'](_0x6f7d('0x1a'),auth[_0x6f7d('0x11')](),controller[_0x6f7d('0x1c')]);router[_0x6f7d('0x1d')](_0x6f7d('0x10'),auth['isAuthenticated'](),controller[_0x6f7d('0x1e')]);router['delete'](_0x6f7d('0x13'),auth['isAuthenticated'](),controller[_0x6f7d('0x1f')]);module[_0x6f7d('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 2fee2a8..5e0d273 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 _0x1a93=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x56851f,_0x44069b){var _0x48cae9=function(_0x11c207){while(--_0x11c207){_0x56851f['push'](_0x56851f['shift']());}};_0x48cae9(++_0x44069b);}(_0x1a93,0xa6));var _0x31a9=function(_0x2c6e37,_0x49bc15){_0x2c6e37=_0x2c6e37-0x0;var _0x312114=_0x1a93[_0x2c6e37];return _0x312114;};'use strict';var Sequelize=require(_0x31a9('0x0'));module[_0x31a9('0x1')]={'name':{'type':Sequelize[_0x31a9('0x2')],'unique':_0x31a9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x31a9('0x2')]},'timeout':{'type':Sequelize[_0x31a9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x31a9('0x5')]('rrmemory',_0x31a9('0x6'),_0x31a9('0x7'))}}; \ No newline at end of file +var _0xa49c=['name','INTEGER','ENUM','roundrobin','sequelize','exports'];(function(_0x380e4a,_0x40572b){var _0x11be37=function(_0x192fe4){while(--_0x192fe4){_0x380e4a['push'](_0x380e4a['shift']());}};_0x11be37(++_0x40572b);}(_0xa49c,0x142));var _0xca49=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0xa49c[_0x565fed];return _0x3e018f;};'use strict';var Sequelize=require(_0xca49('0x0'));module[_0xca49('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xca49('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xca49('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xca49('0x4')]('rrmemory','beepall',_0xca49('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index ab944ea..0542a0b 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 _0x056d=['findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','join','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','SmsQueue','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','describe','findOne','UserSmsQueue','options','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','updatedAt','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x056d,0xa6));var _0xd056=function(_0xa676a5,_0x419e29){_0xa676a5=_0xa676a5-0x0;var _0x29914b=_0x056d[_0xa676a5];return _0x29914b;};'use strict';var emlformat=require(_0xd056('0x0'));var rimraf=require(_0xd056('0x1'));var zipdir=require(_0xd056('0x2'));var jsonpatch=require(_0xd056('0x3'));var rp=require(_0xd056('0x4'));var moment=require(_0xd056('0x5'));var BPromise=require(_0xd056('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd056('0x7'));var sox=require(_0xd056('0x8'));var csv=require(_0xd056('0x9'));var ejs=require(_0xd056('0xa'));var fs=require('fs');var fs_extra=require(_0xd056('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd056('0xc'));var jsforce=require(_0xd056('0xd'));var deskjs=require(_0xd056('0xe'));var toCsv=require(_0xd056('0x9'));var querystring=require(_0xd056('0xf'));var Papa=require('papaparse');var Redis=require(_0xd056('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd056('0x11'));var hardwareService=require(_0xd056('0x12'));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(_0xd056('0x13'))['db'];config[_0xd056('0x14')]=_[_0xd056('0x15')](config[_0xd056('0x14')],{'host':_0xd056('0x16'),'port':0x18eb});var socket=require(_0xd056('0x17'))(new Redis(config[_0xd056('0x14')]));require(_0xd056('0x18'))[_0xd056('0x19')](socket);function respondWithStatusCode(_0x3e2f09,_0x4546b0){_0x4546b0=_0x4546b0||0xcc;return function(_0x1315a1){if(_0x1315a1){return _0x3e2f09[_0xd056('0x1a')](_0x4546b0);}return _0x3e2f09[_0xd056('0x1b')](_0x4546b0)[_0xd056('0x1c')]();};}function respondWithResult(_0x3f6bdf,_0x3a9f35){_0x3a9f35=_0x3a9f35||0xc8;return function(_0x71472d){if(_0x71472d){return _0x3f6bdf[_0xd056('0x1b')](_0x3a9f35)[_0xd056('0x1d')](_0x71472d);}};}function respondWithFilteredResult(_0x5b7430,_0x5237cc){return function(_0x291ad2){if(_0x291ad2){var _0x19647a=typeof _0x5237cc['offset']===_0xd056('0x1e')&&typeof _0x5237cc[_0xd056('0x1f')]==='undefined';var _0x1ed921=_0x291ad2[_0xd056('0x20')];var _0x164a16=_0x19647a?0x0:_0x5237cc[_0xd056('0x21')];var _0x42e0cd=_0x19647a?_0x291ad2[_0xd056('0x20')]:_0x5237cc[_0xd056('0x21')]+_0x5237cc['limit'];var _0xd3a2f1;if(_0x42e0cd>=_0x1ed921){_0x42e0cd=_0x1ed921;_0xd3a2f1=0xc8;}else{_0xd3a2f1=0xce;}_0x5b7430['status'](_0xd3a2f1);return _0x5b7430[_0xd056('0x22')](_0xd056('0x23'),_0x164a16+'-'+_0x42e0cd+'/'+_0x1ed921)[_0xd056('0x1d')](_0x291ad2);}return null;};}function patchUpdates(_0x4406ea){return function(_0x7fbf85){try{jsonpatch[_0xd056('0x24')](_0x7fbf85,_0x4406ea,!![]);}catch(_0x944c0b){return BPromise[_0xd056('0x25')](_0x944c0b);}return _0x7fbf85[_0xd056('0x26')]();};}function saveUpdates(_0x5b8a3b,_0x2ba39a){return function(_0x19d72f){if(_0x19d72f){return _0x19d72f[_0xd056('0x27')](_0x5b8a3b)[_0xd056('0x28')](function(_0x44da3d){return _0x44da3d;});}return null;};}function removeEntity(_0x3c1f1e,_0x4c4bc3){return function(_0x70144f){if(_0x70144f){return _0x70144f[_0xd056('0x29')]()['then'](function(){var _0x189512=_0x70144f[_0xd056('0x2a')]({'plain':!![]});var _0xeccad5=_0xd056('0x2b');return db[_0xd056('0x2c')]['destroy']({'where':{'type':_0xeccad5,'resourceId':_0x189512['id']}})[_0xd056('0x28')](function(){return _0x70144f;});})[_0xd056('0x28')](function(){_0x3c1f1e[_0xd056('0x1b')](0xcc)[_0xd056('0x1c')]();});}};}function handleEntityNotFound(_0x420cf5,_0x440bae){return function(_0x50bf3c){if(!_0x50bf3c){_0x420cf5[_0xd056('0x1a')](0x194);}return _0x50bf3c;};}function handleError(_0x587b75,_0x387dfc){_0x387dfc=_0x387dfc||0x1f4;return function(_0x355b08){logger[_0xd056('0x2d')](_0x355b08['stack']);if(_0x355b08[_0xd056('0x2e')]){delete _0x355b08[_0xd056('0x2e')];}_0x587b75['status'](_0x387dfc)[_0xd056('0x2f')](_0x355b08);};}exports[_0xd056('0x30')]=function(_0x148977,_0x337af5){var _0x12ad26={},_0xb2eb={},_0x36e7d0={'count':0x0,'rows':[]};var _0x5be8e7=_['map'](db[_0xd056('0x31')][_0xd056('0x32')],function(_0x7713ff){return{'name':_0x7713ff['fieldName'],'type':_0x7713ff['type'][_0xd056('0x33')]};});_0xb2eb[_0xd056('0x34')]=_[_0xd056('0x35')](_0x5be8e7,_0xd056('0x2e'));_0xb2eb[_0xd056('0x36')]=_[_0xd056('0x37')](_0x148977[_0xd056('0x36')]);_0xb2eb[_0xd056('0x38')]=_['intersection'](_0xb2eb[_0xd056('0x34')],_0xb2eb['query']);_0x12ad26[_0xd056('0x39')]=_[_0xd056('0x3a')](_0xb2eb[_0xd056('0x34')],qs[_0xd056('0x3b')](_0x148977['query'][_0xd056('0x3b')]));_0x12ad26[_0xd056('0x39')]=_0x12ad26['attributes'][_0xd056('0x3c')]?_0x12ad26['attributes']:_0xb2eb[_0xd056('0x34')];if(!_0x148977[_0xd056('0x36')][_0xd056('0x3d')](_0xd056('0x3e'))){_0x12ad26['limit']=qs[_0xd056('0x1f')](_0x148977[_0xd056('0x36')][_0xd056('0x1f')]);_0x12ad26[_0xd056('0x21')]=qs[_0xd056('0x21')](_0x148977[_0xd056('0x36')]['offset']);}_0x12ad26[_0xd056('0x3f')]=qs[_0xd056('0x40')](_0x148977[_0xd056('0x36')][_0xd056('0x40')]);_0x12ad26['where']=qs[_0xd056('0x38')](_[_0xd056('0x41')](_0x148977[_0xd056('0x36')],_0xb2eb[_0xd056('0x38')]),_0x5be8e7);if(_0x148977['query'][_0xd056('0x42')]){_0x12ad26[_0xd056('0x43')]=_[_0xd056('0x44')](_0x12ad26['where'],{'$or':_[_0xd056('0x35')](_0x5be8e7,function(_0xee6e17){if(_0xee6e17['type']!==_0xd056('0x45')){var _0x119d8b={};_0x119d8b[_0xee6e17[_0xd056('0x2e')]]={'$like':'%'+_0x148977[_0xd056('0x36')][_0xd056('0x42')]+'%'};return _0x119d8b;}})});}_0x12ad26=_['merge']({},_0x12ad26,_0x148977['options']);var _0x1c0f1d={'where':_0x12ad26['where']};return db[_0xd056('0x31')]['count'](_0x1c0f1d)[_0xd056('0x28')](function(_0x86c248){_0x36e7d0[_0xd056('0x20')]=_0x86c248;if(_0x148977[_0xd056('0x36')][_0xd056('0x46')]){_0x12ad26[_0xd056('0x47')]=[{'all':!![]}];}return db[_0xd056('0x31')][_0xd056('0x48')](_0x12ad26);})[_0xd056('0x28')](function(_0x4b0e11){_0x36e7d0[_0xd056('0x49')]=_0x4b0e11;return _0x36e7d0;})['then'](respondWithFilteredResult(_0x337af5,_0x12ad26))[_0xd056('0x4a')](handleError(_0x337af5,null));};exports['show']=function(_0x13dd6f,_0x359b3a){var _0x34d401={'raw':!![],'where':{'id':_0x13dd6f[_0xd056('0x4b')]['id']}},_0x24652f={};_0x24652f[_0xd056('0x34')]=_['keys'](db['SmsQueue']['rawAttributes']);_0x24652f['query']=_[_0xd056('0x37')](_0x13dd6f[_0xd056('0x36')]);_0x24652f['filters']=_[_0xd056('0x3a')](_0x24652f[_0xd056('0x34')],_0x24652f['query']);_0x34d401['attributes']=_[_0xd056('0x3a')](_0x24652f[_0xd056('0x34')],qs[_0xd056('0x3b')](_0x13dd6f[_0xd056('0x36')][_0xd056('0x3b')]));_0x34d401[_0xd056('0x39')]=_0x34d401[_0xd056('0x39')]['length']?_0x34d401[_0xd056('0x39')]:_0x24652f[_0xd056('0x34')];if(_0x13dd6f[_0xd056('0x36')]['includeAll']){_0x34d401['include']=[{'all':!![]}];}_0x34d401=_[_0xd056('0x44')]({},_0x34d401,_0x13dd6f['options']);return db[_0xd056('0x31')]['find'](_0x34d401)[_0xd056('0x28')](handleEntityNotFound(_0x359b3a,null))[_0xd056('0x28')](respondWithResult(_0x359b3a,null))['catch'](handleError(_0x359b3a,null));};exports[_0xd056('0x4c')]=function(_0x3f2008,_0x1857e8){return db[_0xd056('0x31')]['create'](_0x3f2008[_0xd056('0x4d')],{})[_0xd056('0x28')](function(_0x1bfa32){var _0x41582b=_0x3f2008[_0xd056('0x4e')][_0xd056('0x2a')]({'plain':!![]});if(!_0x41582b)throw new Error(_0xd056('0x4f'));if(_0x41582b[_0xd056('0x50')]==='user'){var _0x25ec97=_0x1bfa32[_0xd056('0x2a')]({'plain':!![]});var _0xbb8b3b=_0xd056('0x2b');return db['UserProfileSection'][_0xd056('0x51')]({'where':{'name':_0xbb8b3b,'userProfileId':_0x41582b['userProfileId']},'raw':!![]})[_0xd056('0x28')](function(_0x313985){if(_0x313985&&_0x313985[_0xd056('0x52')]===0x0){return db[_0xd056('0x2c')][_0xd056('0x4c')]({'name':_0x25ec97[_0xd056('0x2e')],'resourceId':_0x25ec97['id'],'type':_0x313985[_0xd056('0x2e')],'sectionId':_0x313985['id']},{})['then'](function(){return _0x1bfa32;});}else{return _0x1bfa32;}})[_0xd056('0x4a')](function(_0x42d961){logger[_0xd056('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42d961);throw _0x42d961;});}return _0x1bfa32;})[_0xd056('0x28')](respondWithResult(_0x1857e8,0xc9))[_0xd056('0x4a')](handleError(_0x1857e8,null));};exports[_0xd056('0x27')]=function(_0x1fd634,_0x1e82d1){if(_0x1fd634[_0xd056('0x4d')]['id']){delete _0x1fd634[_0xd056('0x4d')]['id'];}return db['SmsQueue'][_0xd056('0x51')]({'where':{'id':_0x1fd634['params']['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x1e82d1,null))[_0xd056('0x28')](saveUpdates(_0x1fd634[_0xd056('0x4d')],null))[_0xd056('0x28')](respondWithResult(_0x1e82d1,null))['catch'](handleError(_0x1e82d1,null));};exports[_0xd056('0x29')]=function(_0x10766b,_0x372090){return db['SmsQueue'][_0xd056('0x51')]({'where':{'id':_0x10766b[_0xd056('0x4b')]['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x372090,null))['then'](removeEntity(_0x372090,null))[_0xd056('0x4a')](handleError(_0x372090,null));};exports[_0xd056('0x53')]=function(_0xabab1b,_0x3d6620){return db[_0xd056('0x31')][_0xd056('0x53')]()[_0xd056('0x28')](respondWithResult(_0x3d6620,null))[_0xd056('0x4a')](handleError(_0x3d6620,null));};exports['getMembers']=function(_0x4b4730,_0x5a0e9f,_0x19cb5a){var _0x447d68={'raw':!![],'where':{}},_0x55da79={},_0x271073;return db[_0xd056('0x31')][_0xd056('0x54')]({'where':{'id':_0x4b4730[_0xd056('0x4b')]['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x5a0e9f,null))[_0xd056('0x28')](function(_0x1224a5){if(_0x1224a5){_0x271073=_0x1224a5['get']({'plain':!![]});_0x55da79[_0xd056('0x34')]=_[_0xd056('0x37')](db[_0xd056('0x55')][_0xd056('0x32')]);_0x55da79[_0xd056('0x36')]=_[_0xd056('0x37')](_0x4b4730[_0xd056('0x36')]);_0x55da79[_0xd056('0x38')]=_[_0xd056('0x3a')](_0x55da79[_0xd056('0x34')],_0x55da79['query']);_0x447d68['attributes']=_[_0xd056('0x3a')](_0x55da79[_0xd056('0x34')],qs[_0xd056('0x3b')](_0x4b4730['query']['fields']));_0x447d68['attributes']=_0x447d68[_0xd056('0x39')][_0xd056('0x3c')]?_0x447d68[_0xd056('0x39')]:_0x55da79[_0xd056('0x34')];if(!_0x4b4730[_0xd056('0x36')][_0xd056('0x3d')]('nolimit')){_0x447d68[_0xd056('0x1f')]=qs['limit'](_0x4b4730[_0xd056('0x36')][_0xd056('0x1f')]);_0x447d68[_0xd056('0x21')]=qs[_0xd056('0x21')](_0x4b4730[_0xd056('0x36')][_0xd056('0x21')]);}_0x447d68[_0xd056('0x3f')]=qs[_0xd056('0x40')](_0x4b4730[_0xd056('0x36')][_0xd056('0x40')]);_0x447d68[_0xd056('0x43')]=qs[_0xd056('0x38')](_[_0xd056('0x41')](_0x4b4730[_0xd056('0x36')],_0x55da79[_0xd056('0x38')]));_0x447d68[_0xd056('0x43')]['SmsQueueId']=_0x1224a5['id'];if(_0x4b4730[_0xd056('0x36')]['filter']){_0x447d68[_0xd056('0x43')]=_[_0xd056('0x44')](_0x447d68[_0xd056('0x43')],{'$or':_[_0xd056('0x35')](_0x447d68[_0xd056('0x39')],function(_0x30b5ce){var _0x697f31={};_0x697f31[_0x30b5ce]={'$like':'%'+_0x4b4730['query'][_0xd056('0x42')]+'%'};return _0x697f31;})});}_0x447d68=_[_0xd056('0x44')]({},_0x447d68,_0x4b4730[_0xd056('0x56')]);return db[_0xd056('0x55')][_0xd056('0x48')](_0x447d68);}})[_0xd056('0x28')](function(_0x2bd926){if(_0x2bd926){return db[_0xd056('0x57')][_0xd056('0x58')]({'where':{'id':_[_0xd056('0x35')](_0x2bd926,_0xd056('0x59')),'role':_0xd056('0x5a')},'attributes':['id',_0xd056('0x2e'),_0xd056('0x5b'),'updatedAt',_0xd056('0x5c')]});}})[_0xd056('0x28')](function(_0x4b6f6d){if(_0x4b6f6d){return{'count':_0x4b6f6d[_0xd056('0x20')],'rows':_[_0xd056('0x35')](_0x4b6f6d[_0xd056('0x49')],function(_0x3a909){return{'membername':_0x3a909[_0xd056('0x2e')],'UserId':_0x3a909['id'],'queue_name':_0x271073['name'],'SmsQueueId':_0x271073['id'],'interface':util[_0xd056('0x5d')](_0xd056('0x5e'),'SIP',_0x3a909[_0xd056('0x2e')]),'penalty':0x0,'paused':_0x3a909[_0xd056('0x5b')],'createdAt':_0x3a909['createdAt'],'updatedAt':_0x3a909[_0xd056('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd056('0x28')](respondWithFilteredResult(_0x5a0e9f,_0x447d68))[_0xd056('0x4a')](handleError(_0x5a0e9f,null));};exports[_0xd056('0x60')]=function(_0x3a71e3,_0x197eb7,_0xee9586){var _0x8f797d={};var _0x2672f1={};var _0x55f618;var _0x3909b5;return db[_0xd056('0x31')]['findOne']({'where':{'id':_0x3a71e3[_0xd056('0x4b')]['id']}})['then'](handleEntityNotFound(_0x197eb7,null))[_0xd056('0x28')](function(_0x2fe3e8){if(_0x2fe3e8){_0x55f618=_0x2fe3e8;_0x2672f1[_0xd056('0x34')]=_[_0xd056('0x37')](db['Team']['rawAttributes']);_0x2672f1['query']=_['keys'](_0x3a71e3[_0xd056('0x36')]);_0x2672f1[_0xd056('0x38')]=_[_0xd056('0x3a')](_0x2672f1[_0xd056('0x34')],_0x2672f1['query']);_0x8f797d['attributes']=_[_0xd056('0x3a')](_0x2672f1['model'],qs[_0xd056('0x3b')](_0x3a71e3['query'][_0xd056('0x3b')]));_0x8f797d[_0xd056('0x39')]=_0x8f797d['attributes'][_0xd056('0x3c')]?_0x8f797d[_0xd056('0x39')]:_0x2672f1['model'];_0x8f797d[_0xd056('0x3f')]=qs[_0xd056('0x40')](_0x3a71e3['query']['sort']);_0x8f797d['where']=qs[_0xd056('0x38')](_[_0xd056('0x41')](_0x3a71e3['query'],_0x2672f1['filters']));if(_0x3a71e3[_0xd056('0x36')][_0xd056('0x42')]){_0x8f797d[_0xd056('0x43')]=_[_0xd056('0x44')](_0x8f797d[_0xd056('0x43')],{'$or':_['map'](_0x8f797d[_0xd056('0x39')],function(_0x1b71fc){var _0x36156d={};_0x36156d[_0x1b71fc]={'$like':'%'+_0x3a71e3['query'][_0xd056('0x42')]+'%'};return _0x36156d;})});}_0x8f797d=_[_0xd056('0x44')]({},_0x8f797d,_0x3a71e3[_0xd056('0x56')]);return _0x55f618['getTeams'](_0x8f797d);}})[_0xd056('0x28')](function(_0xa99812){if(_0xa99812){_0x3909b5=_0xa99812['length'];if(!_0x3a71e3[_0xd056('0x36')]['hasOwnProperty'](_0xd056('0x3e'))){_0x8f797d[_0xd056('0x1f')]=qs[_0xd056('0x1f')](_0x3a71e3[_0xd056('0x36')][_0xd056('0x1f')]);_0x8f797d[_0xd056('0x21')]=qs['offset'](_0x3a71e3[_0xd056('0x36')][_0xd056('0x21')]);}return _0x55f618['getTeams'](_0x8f797d);}})['then'](function(_0x3e6a27){if(_0x3e6a27){return _0x3e6a27?{'count':_0x3909b5,'rows':_0x3e6a27}:null;}})[_0xd056('0x28')](respondWithResult(_0x197eb7,null))[_0xd056('0x4a')](handleError(_0x197eb7,null));};exports['addTeams']=function(_0xa77d00,_0x71f555,_0x174afc){var _0x1cd44d=_0xa77d00[_0xd056('0x4d')][_0xd056('0x61')];return db[_0xd056('0x62')]['findAll']({'where':{'id':_0x1cd44d},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd056('0x63'),'attributes':['id',_0xd056('0x2e'),_0xd056('0x64'),_0xd056('0x65'),_0xd056('0x66')],'raw':!![]}]})[_0xd056('0x28')](function(_0xc3562b){if(_0xc3562b){var _0x23076f=_[_0xd056('0x67')](_0xc3562b,function(_0x1e9888){var _0x11c64d=_0x1e9888['get']({'plain':!![]});return _0x11c64d['Agents'];});return db['SmsQueue'][_0xd056('0x51')]({'where':{'id':_0xa77d00['params']['id']}})[_0xd056('0x28')](function(_0x878bb7){return db[_0xd056('0x68')][_0xd056('0x69')](function(_0x32d91a){return _0x878bb7[_0xd056('0x6a')](_0x1cd44d,{'transaction':_0x32d91a})[_0xd056('0x28')](function(){return BPromise[_0xd056('0x6b')](_0x23076f,function(_0x40f77e){return db['UserSmsQueue'][_0xd056('0x6c')]({'where':{'UserId':_0x40f77e['id'],'SmsQueueId':_0xa77d00[_0xd056('0x4b')]['id']},'transaction':_0x32d91a});});})[_0xd056('0x28')](function(){_0x23076f['forEach'](function(_0x1e94e9){socket[_0xd056('0x6d')](_0xd056('0x6e'),{'UserId':_0x1e94e9['id'],'SmsQueueId':_0x878bb7['id']});});});});});}})[_0xd056('0x28')](respondWithStatusCode(_0x71f555,null))['catch'](handleError(_0x71f555,null));};exports[_0xd056('0x6f')]=function(_0xf35e05,_0x5d7fc2,_0x16dbdc){return db['Team'][_0xd056('0x48')]({'where':{'id':_0xf35e05[_0xd056('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd056('0x57')],'as':_0xd056('0x63'),'attributes':['id'],'raw':!![]}]})[_0xd056('0x28')](handleEntityNotFound(_0x5d7fc2,null))[_0xd056('0x28')](function(_0x593ba6){var _0x4c9a2b=_['map'](_0x593ba6,'id');var _0xb6dd01=[];var _0xd40f0e=[];var _0x585d60=squel[_0xd056('0x70')]();_0x585d60[_0xd056('0x71')](_0xd056('0x72'))[_0xd056('0x73')]('team_has_sms_queues','tq')[_0xd056('0x74')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xd056('0x75'),_0xf35e05[_0xd056('0x4b')]['id']);for(var _0x526827=0x0;_0x526827<_0x593ba6[_0xd056('0x3c')];_0x526827+=0x1){let _0x3d13db=_0x593ba6[_0x526827];for(var _0x31f17f=0x0;_0x31f17f<_0x3d13db[_0xd056('0x63')]['length'];_0x31f17f+=0x1){let _0x42749f=_0x3d13db[_0xd056('0x63')][_0x31f17f];var _0x4460f0=_0x585d60[_0xd056('0x76')]();_0x4460f0[_0xd056('0x43')]('ut.UserId\x20=\x20?',_0x42749f['id']);_0xd40f0e[_0xd056('0x77')](db['sequelize']['query'](_0x4460f0[_0xd056('0x78')](),{'type':db[_0xd056('0x68')][_0xd056('0x79')][_0xd056('0x7a')]})[_0xd056('0x28')](function(_0x4178f4){if(_0x4178f4['length']===0x1){return _0x42749f['id'];}else{var _0xbf0cef=_[_0xd056('0x7b')](_['map'](_0x4178f4,'TeamId'),function(_0x382d9b){return _[_0xd056('0x7c')](_0x4c9a2b,_0x382d9b);});if(_0xbf0cef){return _0x42749f['id'];}}}));}}return BPromise[_0xd056('0x7d')](_0xd40f0e)[_0xd056('0x28')](function(_0x5cea04){_0xb6dd01=_(_0xb6dd01)[_0xd056('0x7e')](_0x5cea04)[_0xd056('0x7f')]()[_0xd056('0x80')]();return db[_0xd056('0x31')]['find']({'where':{'id':_0xf35e05[_0xd056('0x4b')]['id']}})[_0xd056('0x28')](function(_0x3f69ba){return db[_0xd056('0x68')][_0xd056('0x69')](function(_0x398186){return _0x3f69ba[_0xd056('0x6f')](_0xf35e05[_0xd056('0x36')][_0xd056('0x61')],{'transaction':_0x398186})[_0xd056('0x28')](function(){if(!_[_0xd056('0x81')](_0xb6dd01)){return _0x3f69ba[_0xd056('0x82')](_0xb6dd01,{'transaction':_0x398186});}})[_0xd056('0x28')](function(){_0xb6dd01[_0xd056('0x83')](function(_0x55ebf2){socket[_0xd056('0x6d')](_0xd056('0x84'),{'UserId':_0x55ebf2,'SmsQueueId':_0x3f69ba['id']});});});});});});})[_0xd056('0x28')](respondWithStatusCode(_0x5d7fc2,null))[_0xd056('0x4a')](handleError(_0x5d7fc2,null));};exports[_0xd056('0x85')]=function(_0x322b14,_0x324745,_0x20df47){return db[_0xd056('0x31')]['find']({'where':{'id':_0x322b14['params']['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x324745,null))[_0xd056('0x28')](function(_0xffaec8){if(_0xffaec8){return _0xffaec8[_0xd056('0x85')](_0x322b14[_0xd056('0x4d')]['ids'],_[_0xd056('0x86')](_0x322b14[_0xd056('0x4d')],[_0xd056('0x61'),'id'])||{})[_0xd056('0x87')](function(_0x309f29){for(var _0x396d33=0x0;_0x396d33<_0x322b14['body']['ids'][_0xd056('0x3c')];_0x396d33+=0x1){socket[_0xd056('0x6d')](_0xd056('0x6e'),{'UserId':Number(_0x322b14[_0xd056('0x4d')]['ids'][_0x396d33]),'SmsQueueId':Number(_0x322b14[_0xd056('0x4b')]['id'])});}return _0x309f29;});}})[_0xd056('0x28')](respondWithResult(_0x324745,null))[_0xd056('0x4a')](handleError(_0x324745,null));};exports[_0xd056('0x82')]=function(_0x15ced5,_0x5db443,_0x2ba98f){return db['SmsQueue'][_0xd056('0x51')]({'where':{'id':_0x15ced5[_0xd056('0x4b')]['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x5db443,null))[_0xd056('0x28')](function(_0x3ff168){if(_0x3ff168){return _0x3ff168['removeAgents'](_0x15ced5[_0xd056('0x36')][_0xd056('0x61')])[_0xd056('0x28')](function(){if(_['isArray'](_0x15ced5[_0xd056('0x36')]['ids'])){for(var _0x9936e8=0x0;_0x9936e8<_0x15ced5[_0xd056('0x36')][_0xd056('0x61')][_0xd056('0x3c')];_0x9936e8+=0x1){socket['emit'](_0xd056('0x84'),{'UserId':Number(_0x15ced5[_0xd056('0x36')][_0xd056('0x61')][_0x9936e8]),'SmsQueueId':Number(_0x15ced5['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x15ced5[_0xd056('0x36')][_0xd056('0x61')]),'SmsQueueId':Number(_0x15ced5[_0xd056('0x4b')]['id'])});}});}})[_0xd056('0x28')](respondWithStatusCode(_0x5db443,null))[_0xd056('0x4a')](handleError(_0x5db443,null));};exports[_0xd056('0x88')]=function(_0x143789,_0x41a6cb,_0x470495){var _0x16bc67={};var _0x10136f={};var _0x217d7c;var _0x441e1d;return db[_0xd056('0x31')][_0xd056('0x54')]({'where':{'id':_0x143789['params']['id']}})[_0xd056('0x28')](handleEntityNotFound(_0x41a6cb,null))[_0xd056('0x28')](function(_0xe60ce2){if(_0xe60ce2){_0x217d7c=_0xe60ce2;_0x10136f[_0xd056('0x34')]=_[_0xd056('0x37')](db[_0xd056('0x57')][_0xd056('0x32')]);_0x10136f[_0xd056('0x36')]=_['keys'](_0x143789[_0xd056('0x36')]);_0x10136f[_0xd056('0x38')]=_[_0xd056('0x3a')](_0x10136f['model'],_0x10136f[_0xd056('0x36')]);_0x16bc67['attributes']=_[_0xd056('0x3a')](_0x10136f['model'],qs[_0xd056('0x3b')](_0x143789[_0xd056('0x36')][_0xd056('0x3b')]));_0x16bc67[_0xd056('0x39')]=_0x16bc67[_0xd056('0x39')][_0xd056('0x3c')]?_0x16bc67[_0xd056('0x39')]:_0x10136f[_0xd056('0x34')];_0x16bc67[_0xd056('0x3f')]=qs[_0xd056('0x40')](_0x143789['query']['sort']);_0x16bc67[_0xd056('0x43')]=qs['filters'](_[_0xd056('0x41')](_0x143789[_0xd056('0x36')],_0x10136f['filters']));if(_0x143789[_0xd056('0x36')][_0xd056('0x42')]){_0x16bc67[_0xd056('0x43')]=_[_0xd056('0x44')](_0x16bc67[_0xd056('0x43')],{'$or':_[_0xd056('0x35')](_0x16bc67[_0xd056('0x39')],function(_0x58b5c0){var _0xdae2cc={};_0xdae2cc[_0x58b5c0]={'$like':'%'+_0x143789[_0xd056('0x36')][_0xd056('0x42')]+'%'};return _0xdae2cc;})});}_0x16bc67=_[_0xd056('0x44')]({},_0x16bc67,_0x143789[_0xd056('0x56')]);return _0x217d7c['getAgents'](_0x16bc67);}})[_0xd056('0x28')](function(_0xd76495){if(_0xd76495){_0x441e1d=_0xd76495['length'];if(!_0x143789['query'][_0xd056('0x3d')]('nolimit')){_0x16bc67['limit']=qs[_0xd056('0x1f')](_0x143789[_0xd056('0x36')][_0xd056('0x1f')]);_0x16bc67[_0xd056('0x21')]=qs[_0xd056('0x21')](_0x143789['query']['offset']);}return _0x217d7c[_0xd056('0x88')](_0x16bc67);}})['then'](function(_0x4f9e9f){if(_0x4f9e9f){return _0x4f9e9f?{'count':_0x441e1d,'rows':_0x4f9e9f}:null;}})[_0xd056('0x28')](respondWithResult(_0x41a6cb,null))[_0xd056('0x4a')](handleError(_0x41a6cb,null));}; \ No newline at end of file +var _0xa7ee=['filters','filter','merge','VIRTUAL','options','SmsQueue','findAll','rows','show','includeAll','include','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','UserSmsQueue','hasOwnProperty','pick','SmsQueueId','User','findAndCountAll','agent','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','transaction','each','userSmsQueue:save','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','every','TeamId','includes','all','value','isEmpty','removeAgents','forEach','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','count','limit','set','Content-Range','json','reject','then','destroy','get','SmsQueues','UserProfileResource','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x4e51da,_0x473df2){var _0x1368fe=function(_0x4bdfd4){while(--_0x4bdfd4){_0x4e51da['push'](_0x4e51da['shift']());}};_0x1368fe(++_0x473df2);}(_0xa7ee,0x159));var _0xea7e=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0xa7ee[_0x24cc72];return _0xd49f1e;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7e('0x1'));var jsonpatch=require(_0xea7e('0x2'));var rp=require(_0xea7e('0x3'));var moment=require(_0xea7e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea7e('0x5'));var path=require('path');var sox=require(_0xea7e('0x6'));var csv=require(_0xea7e('0x7'));var ejs=require(_0xea7e('0x8'));var fs=require('fs');var fs_extra=require(_0xea7e('0x9'));var _=require('lodash');var squel=require(_0xea7e('0xa'));var crypto=require(_0xea7e('0xb'));var jsforce=require(_0xea7e('0xc'));var deskjs=require(_0xea7e('0xd'));var toCsv=require(_0xea7e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea7e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xea7e('0xf'));var as=require(_0xea7e('0x10'));var hardwareService=require(_0xea7e('0x11'));var logger=require(_0xea7e('0x12'))('api');var utils=require(_0xea7e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea7e('0x14'));var db=require(_0xea7e('0x15'))['db'];config[_0xea7e('0x16')]=_[_0xea7e('0x17')](config[_0xea7e('0x16')],{'host':_0xea7e('0x18'),'port':0x18eb});var socket=require(_0xea7e('0x19'))(new Redis(config[_0xea7e('0x16')]));require('./smsQueue.socket')[_0xea7e('0x1a')](socket);function respondWithStatusCode(_0x3ef916,_0x1a617e){_0x1a617e=_0x1a617e||0xcc;return function(_0x777c57){if(_0x777c57){return _0x3ef916['sendStatus'](_0x1a617e);}return _0x3ef916[_0xea7e('0x1b')](_0x1a617e)['end']();};}function respondWithResult(_0x5c7466,_0x3cd795){_0x3cd795=_0x3cd795||0xc8;return function(_0x2d5794){if(_0x2d5794){return _0x5c7466[_0xea7e('0x1b')](_0x3cd795)['json'](_0x2d5794);}};}function respondWithFilteredResult(_0x5c3b15,_0x13281d){return function(_0x5becf4){if(_0x5becf4){var _0x195d5a=typeof _0x13281d[_0xea7e('0x1c')]==='undefined'&&typeof _0x13281d['limit']===_0xea7e('0x1d');var _0x59e8d8=_0x5becf4['count'];var _0x406aff=_0x195d5a?0x0:_0x13281d['offset'];var _0x373c2c=_0x195d5a?_0x5becf4[_0xea7e('0x1e')]:_0x13281d['offset']+_0x13281d[_0xea7e('0x1f')];var _0x52dfb0;if(_0x373c2c>=_0x59e8d8){_0x373c2c=_0x59e8d8;_0x52dfb0=0xc8;}else{_0x52dfb0=0xce;}_0x5c3b15[_0xea7e('0x1b')](_0x52dfb0);return _0x5c3b15[_0xea7e('0x20')](_0xea7e('0x21'),_0x406aff+'-'+_0x373c2c+'/'+_0x59e8d8)[_0xea7e('0x22')](_0x5becf4);}return null;};}function patchUpdates(_0x372b9d){return function(_0x268511){try{jsonpatch['apply'](_0x268511,_0x372b9d,!![]);}catch(_0xd41599){return BPromise[_0xea7e('0x23')](_0xd41599);}return _0x268511['save']();};}function saveUpdates(_0xb8149f,_0x344ec6){return function(_0xa07c9a){if(_0xa07c9a){return _0xa07c9a['update'](_0xb8149f)[_0xea7e('0x24')](function(_0x400125){return _0x400125;});}return null;};}function removeEntity(_0x41b995,_0x49ce51){return function(_0x456222){if(_0x456222){return _0x456222[_0xea7e('0x25')]()[_0xea7e('0x24')](function(){var _0x7a75a6=_0x456222[_0xea7e('0x26')]({'plain':!![]});var _0x789f9e=_0xea7e('0x27');return db[_0xea7e('0x28')][_0xea7e('0x25')]({'where':{'type':_0x789f9e,'resourceId':_0x7a75a6['id']}})[_0xea7e('0x24')](function(){return _0x456222;});})['then'](function(){_0x41b995[_0xea7e('0x1b')](0xcc)[_0xea7e('0x29')]();});}};}function handleEntityNotFound(_0x4d3c38,_0x2a1753){return function(_0x3a9465){if(!_0x3a9465){_0x4d3c38[_0xea7e('0x2a')](0x194);}return _0x3a9465;};}function handleError(_0x4db5a8,_0x33447e){_0x33447e=_0x33447e||0x1f4;return function(_0x56ea98){logger[_0xea7e('0x2b')](_0x56ea98[_0xea7e('0x2c')]);if(_0x56ea98['name']){delete _0x56ea98[_0xea7e('0x2d')];}_0x4db5a8[_0xea7e('0x1b')](_0x33447e)['send'](_0x56ea98);};}exports[_0xea7e('0x2e')]=function(_0x5c12d6,_0x1f3a50){var _0x17c03c={},_0x2e6915={},_0x1313f3={'count':0x0,'rows':[]};var _0xe60da3=_[_0xea7e('0x2f')](db['SmsQueue'][_0xea7e('0x30')],function(_0x168c4f){return{'name':_0x168c4f[_0xea7e('0x31')],'type':_0x168c4f[_0xea7e('0x32')][_0xea7e('0x33')]};});_0x2e6915[_0xea7e('0x34')]=_['map'](_0xe60da3,'name');_0x2e6915[_0xea7e('0x35')]=_[_0xea7e('0x36')](_0x5c12d6[_0xea7e('0x35')]);_0x2e6915['filters']=_[_0xea7e('0x37')](_0x2e6915[_0xea7e('0x34')],_0x2e6915[_0xea7e('0x35')]);_0x17c03c[_0xea7e('0x38')]=_[_0xea7e('0x37')](_0x2e6915[_0xea7e('0x34')],qs[_0xea7e('0x39')](_0x5c12d6[_0xea7e('0x35')][_0xea7e('0x39')]));_0x17c03c[_0xea7e('0x38')]=_0x17c03c[_0xea7e('0x38')][_0xea7e('0x3a')]?_0x17c03c[_0xea7e('0x38')]:_0x2e6915[_0xea7e('0x34')];if(!_0x5c12d6[_0xea7e('0x35')]['hasOwnProperty'](_0xea7e('0x3b'))){_0x17c03c[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x5c12d6[_0xea7e('0x35')]['limit']);_0x17c03c[_0xea7e('0x1c')]=qs['offset'](_0x5c12d6[_0xea7e('0x35')]['offset']);}_0x17c03c[_0xea7e('0x3c')]=qs[_0xea7e('0x3d')](_0x5c12d6[_0xea7e('0x35')][_0xea7e('0x3d')]);_0x17c03c[_0xea7e('0x3e')]=qs[_0xea7e('0x3f')](_['pick'](_0x5c12d6[_0xea7e('0x35')],_0x2e6915[_0xea7e('0x3f')]),_0xe60da3);if(_0x5c12d6['query'][_0xea7e('0x40')]){_0x17c03c['where']=_[_0xea7e('0x41')](_0x17c03c[_0xea7e('0x3e')],{'$or':_['map'](_0xe60da3,function(_0x232b0b){if(_0x232b0b[_0xea7e('0x32')]!==_0xea7e('0x42')){var _0x2a9ad6={};_0x2a9ad6[_0x232b0b[_0xea7e('0x2d')]]={'$like':'%'+_0x5c12d6[_0xea7e('0x35')][_0xea7e('0x40')]+'%'};return _0x2a9ad6;}})});}_0x17c03c=_[_0xea7e('0x41')]({},_0x17c03c,_0x5c12d6[_0xea7e('0x43')]);var _0x115089={'where':_0x17c03c[_0xea7e('0x3e')]};return db[_0xea7e('0x44')][_0xea7e('0x1e')](_0x115089)[_0xea7e('0x24')](function(_0x507d92){_0x1313f3['count']=_0x507d92;if(_0x5c12d6['query']['includeAll']){_0x17c03c['include']=[{'all':!![]}];}return db['SmsQueue'][_0xea7e('0x45')](_0x17c03c);})['then'](function(_0x165874){_0x1313f3[_0xea7e('0x46')]=_0x165874;return _0x1313f3;})['then'](respondWithFilteredResult(_0x1f3a50,_0x17c03c))['catch'](handleError(_0x1f3a50,null));};exports[_0xea7e('0x47')]=function(_0x121ce6,_0x1239fd){var _0x2681dd={'raw':!![],'where':{'id':_0x121ce6['params']['id']}},_0x521744={};_0x521744[_0xea7e('0x34')]=_['keys'](db[_0xea7e('0x44')][_0xea7e('0x30')]);_0x521744['query']=_[_0xea7e('0x36')](_0x121ce6[_0xea7e('0x35')]);_0x521744['filters']=_[_0xea7e('0x37')](_0x521744[_0xea7e('0x34')],_0x521744['query']);_0x2681dd['attributes']=_[_0xea7e('0x37')](_0x521744[_0xea7e('0x34')],qs['fields'](_0x121ce6[_0xea7e('0x35')][_0xea7e('0x39')]));_0x2681dd['attributes']=_0x2681dd[_0xea7e('0x38')][_0xea7e('0x3a')]?_0x2681dd[_0xea7e('0x38')]:_0x521744[_0xea7e('0x34')];if(_0x121ce6[_0xea7e('0x35')][_0xea7e('0x48')]){_0x2681dd[_0xea7e('0x49')]=[{'all':!![]}];}_0x2681dd=_['merge']({},_0x2681dd,_0x121ce6[_0xea7e('0x43')]);return db[_0xea7e('0x44')][_0xea7e('0x4a')](_0x2681dd)[_0xea7e('0x24')](handleEntityNotFound(_0x1239fd,null))[_0xea7e('0x24')](respondWithResult(_0x1239fd,null))[_0xea7e('0x4b')](handleError(_0x1239fd,null));};exports['create']=function(_0x4404e5,_0x1ba27f){return db[_0xea7e('0x44')][_0xea7e('0x4c')](_0x4404e5[_0xea7e('0x4d')],{})[_0xea7e('0x24')](function(_0x5318b4){var _0x302f1c=_0x4404e5[_0xea7e('0x4e')][_0xea7e('0x26')]({'plain':!![]});if(!_0x302f1c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x302f1c[_0xea7e('0x4f')]===_0xea7e('0x4e')){var _0x597b88=_0x5318b4[_0xea7e('0x26')]({'plain':!![]});var _0x377fb9=_0xea7e('0x27');return db[_0xea7e('0x50')][_0xea7e('0x4a')]({'where':{'name':_0x377fb9,'userProfileId':_0x302f1c[_0xea7e('0x51')]},'raw':!![]})[_0xea7e('0x24')](function(_0x420d44){if(_0x420d44&&_0x420d44[_0xea7e('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x597b88[_0xea7e('0x2d')],'resourceId':_0x597b88['id'],'type':_0x420d44[_0xea7e('0x2d')],'sectionId':_0x420d44['id']},{})['then'](function(){return _0x5318b4;});}else{return _0x5318b4;}})[_0xea7e('0x4b')](function(_0x5b0bcb){logger[_0xea7e('0x2b')](_0xea7e('0x53'),_0x5b0bcb);throw _0x5b0bcb;});}return _0x5318b4;})[_0xea7e('0x24')](respondWithResult(_0x1ba27f,0xc9))['catch'](handleError(_0x1ba27f,null));};exports[_0xea7e('0x54')]=function(_0x20bf89,_0x3eb694){if(_0x20bf89[_0xea7e('0x4d')]['id']){delete _0x20bf89[_0xea7e('0x4d')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x20bf89[_0xea7e('0x55')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x3eb694,null))[_0xea7e('0x24')](saveUpdates(_0x20bf89[_0xea7e('0x4d')],null))['then'](respondWithResult(_0x3eb694,null))[_0xea7e('0x4b')](handleError(_0x3eb694,null));};exports[_0xea7e('0x25')]=function(_0x219dff,_0x478365){return db[_0xea7e('0x44')]['find']({'where':{'id':_0x219dff['params']['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x478365,null))[_0xea7e('0x24')](removeEntity(_0x478365,null))['catch'](handleError(_0x478365,null));};exports[_0xea7e('0x56')]=function(_0x1bb85b,_0x1697b5){return db[_0xea7e('0x44')][_0xea7e('0x56')]()['then'](respondWithResult(_0x1697b5,null))['catch'](handleError(_0x1697b5,null));};exports[_0xea7e('0x57')]=function(_0x17f39a,_0x31f8d4,_0x1555fa){var _0x28ec1e={'raw':!![],'where':{}},_0x2a76ad={},_0x337ee7;return db['SmsQueue']['findOne']({'where':{'id':_0x17f39a['params']['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x31f8d4,null))[_0xea7e('0x24')](function(_0x59066c){if(_0x59066c){_0x337ee7=_0x59066c[_0xea7e('0x26')]({'plain':!![]});_0x2a76ad[_0xea7e('0x34')]=_['keys'](db[_0xea7e('0x58')][_0xea7e('0x30')]);_0x2a76ad['query']=_[_0xea7e('0x36')](_0x17f39a[_0xea7e('0x35')]);_0x2a76ad[_0xea7e('0x3f')]=_[_0xea7e('0x37')](_0x2a76ad[_0xea7e('0x34')],_0x2a76ad['query']);_0x28ec1e['attributes']=_[_0xea7e('0x37')](_0x2a76ad[_0xea7e('0x34')],qs[_0xea7e('0x39')](_0x17f39a['query'][_0xea7e('0x39')]));_0x28ec1e[_0xea7e('0x38')]=_0x28ec1e[_0xea7e('0x38')][_0xea7e('0x3a')]?_0x28ec1e[_0xea7e('0x38')]:_0x2a76ad['model'];if(!_0x17f39a['query'][_0xea7e('0x59')](_0xea7e('0x3b'))){_0x28ec1e['limit']=qs[_0xea7e('0x1f')](_0x17f39a[_0xea7e('0x35')]['limit']);_0x28ec1e[_0xea7e('0x1c')]=qs[_0xea7e('0x1c')](_0x17f39a[_0xea7e('0x35')][_0xea7e('0x1c')]);}_0x28ec1e[_0xea7e('0x3c')]=qs[_0xea7e('0x3d')](_0x17f39a['query'][_0xea7e('0x3d')]);_0x28ec1e['where']=qs[_0xea7e('0x3f')](_[_0xea7e('0x5a')](_0x17f39a[_0xea7e('0x35')],_0x2a76ad[_0xea7e('0x3f')]));_0x28ec1e['where'][_0xea7e('0x5b')]=_0x59066c['id'];if(_0x17f39a['query'][_0xea7e('0x40')]){_0x28ec1e[_0xea7e('0x3e')]=_['merge'](_0x28ec1e[_0xea7e('0x3e')],{'$or':_[_0xea7e('0x2f')](_0x28ec1e[_0xea7e('0x38')],function(_0x4bd0bf){var _0x306937={};_0x306937[_0x4bd0bf]={'$like':'%'+_0x17f39a['query']['filter']+'%'};return _0x306937;})});}_0x28ec1e=_['merge']({},_0x28ec1e,_0x17f39a[_0xea7e('0x43')]);return db['UserSmsQueue']['findAll'](_0x28ec1e);}})[_0xea7e('0x24')](function(_0x2ac5f0){if(_0x2ac5f0){return db[_0xea7e('0x5c')][_0xea7e('0x5d')]({'where':{'id':_[_0xea7e('0x2f')](_0x2ac5f0,'UserId'),'role':_0xea7e('0x5e')},'attributes':['id','name','smsPause',_0xea7e('0x5f'),_0xea7e('0x60')]});}})['then'](function(_0x8447d2){if(_0x8447d2){return{'count':_0x8447d2[_0xea7e('0x1e')],'rows':_['map'](_0x8447d2['rows'],function(_0x4ce179){return{'membername':_0x4ce179['name'],'UserId':_0x4ce179['id'],'queue_name':_0x337ee7[_0xea7e('0x2d')],'SmsQueueId':_0x337ee7['id'],'interface':util['format'](_0xea7e('0x61'),_0xea7e('0x62'),_0x4ce179[_0xea7e('0x2d')]),'penalty':0x0,'paused':_0x4ce179['smsPause'],'createdAt':_0x4ce179['createdAt'],'updatedAt':_0x4ce179[_0xea7e('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xea7e('0x24')](respondWithFilteredResult(_0x31f8d4,_0x28ec1e))['catch'](handleError(_0x31f8d4,null));};exports[_0xea7e('0x63')]=function(_0x187e91,_0x3f577f,_0x1afec5){var _0x1314d0={};var _0x4411c7={};var _0x21d447;var _0x1b13cb;return db[_0xea7e('0x44')][_0xea7e('0x64')]({'where':{'id':_0x187e91[_0xea7e('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f577f,null))[_0xea7e('0x24')](function(_0x429090){if(_0x429090){_0x21d447=_0x429090;_0x4411c7[_0xea7e('0x34')]=_['keys'](db[_0xea7e('0x65')][_0xea7e('0x30')]);_0x4411c7[_0xea7e('0x35')]=_[_0xea7e('0x36')](_0x187e91[_0xea7e('0x35')]);_0x4411c7[_0xea7e('0x3f')]=_[_0xea7e('0x37')](_0x4411c7[_0xea7e('0x34')],_0x4411c7[_0xea7e('0x35')]);_0x1314d0['attributes']=_[_0xea7e('0x37')](_0x4411c7['model'],qs[_0xea7e('0x39')](_0x187e91[_0xea7e('0x35')]['fields']));_0x1314d0['attributes']=_0x1314d0[_0xea7e('0x38')]['length']?_0x1314d0['attributes']:_0x4411c7[_0xea7e('0x34')];_0x1314d0['order']=qs['sort'](_0x187e91[_0xea7e('0x35')][_0xea7e('0x3d')]);_0x1314d0[_0xea7e('0x3e')]=qs[_0xea7e('0x3f')](_[_0xea7e('0x5a')](_0x187e91[_0xea7e('0x35')],_0x4411c7[_0xea7e('0x3f')]));if(_0x187e91[_0xea7e('0x35')][_0xea7e('0x40')]){_0x1314d0['where']=_['merge'](_0x1314d0[_0xea7e('0x3e')],{'$or':_[_0xea7e('0x2f')](_0x1314d0[_0xea7e('0x38')],function(_0x3f5e66){var _0x397cdd={};_0x397cdd[_0x3f5e66]={'$like':'%'+_0x187e91[_0xea7e('0x35')][_0xea7e('0x40')]+'%'};return _0x397cdd;})});}_0x1314d0=_[_0xea7e('0x41')]({},_0x1314d0,_0x187e91[_0xea7e('0x43')]);return _0x21d447[_0xea7e('0x63')](_0x1314d0);}})[_0xea7e('0x24')](function(_0x55447d){if(_0x55447d){_0x1b13cb=_0x55447d[_0xea7e('0x3a')];if(!_0x187e91[_0xea7e('0x35')][_0xea7e('0x59')](_0xea7e('0x3b'))){_0x1314d0[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x187e91[_0xea7e('0x35')][_0xea7e('0x1f')]);_0x1314d0[_0xea7e('0x1c')]=qs['offset'](_0x187e91[_0xea7e('0x35')][_0xea7e('0x1c')]);}return _0x21d447[_0xea7e('0x63')](_0x1314d0);}})[_0xea7e('0x24')](function(_0x243f45){if(_0x243f45){return _0x243f45?{'count':_0x1b13cb,'rows':_0x243f45}:null;}})[_0xea7e('0x24')](respondWithResult(_0x3f577f,null))[_0xea7e('0x4b')](handleError(_0x3f577f,null));};exports[_0xea7e('0x66')]=function(_0x366f88,_0x4a56e5,_0x318011){var _0x1d9f7a=_0x366f88['body'][_0xea7e('0x67')];return db['Team'][_0xea7e('0x45')]({'where':{'id':_0x1d9f7a},'attributes':['id'],'include':[{'model':db['User'],'as':_0xea7e('0x68'),'attributes':['id',_0xea7e('0x2d'),_0xea7e('0x69'),_0xea7e('0x6a'),'interface'],'raw':!![]}]})['then'](function(_0x2f9fb3){if(_0x2f9fb3){var _0x2b0b7e=_['flatMap'](_0x2f9fb3,function(_0x3bbc33){var _0x531f14=_0x3bbc33[_0xea7e('0x26')]({'plain':!![]});return _0x531f14[_0xea7e('0x68')];});return db['SmsQueue'][_0xea7e('0x4a')]({'where':{'id':_0x366f88[_0xea7e('0x55')]['id']}})[_0xea7e('0x24')](function(_0x1562e2){return db['sequelize'][_0xea7e('0x6b')](function(_0x2747b2){return _0x1562e2[_0xea7e('0x66')](_0x1d9f7a,{'transaction':_0x2747b2})['then'](function(){return BPromise[_0xea7e('0x6c')](_0x2b0b7e,function(_0x2bd772){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x2bd772['id'],'SmsQueueId':_0x366f88[_0xea7e('0x55')]['id']},'transaction':_0x2747b2});});})[_0xea7e('0x24')](function(){_0x2b0b7e['forEach'](function(_0x5884af){socket['emit'](_0xea7e('0x6d'),{'UserId':_0x5884af['id'],'SmsQueueId':_0x1562e2['id']});});});});});}})[_0xea7e('0x24')](respondWithStatusCode(_0x4a56e5,null))[_0xea7e('0x4b')](handleError(_0x4a56e5,null));};exports['removeTeams']=function(_0x233b0b,_0x39279a,_0x44194e){return db['Team']['findAll']({'where':{'id':_0x233b0b[_0xea7e('0x35')][_0xea7e('0x67')]},'attributes':['id'],'include':[{'model':db[_0xea7e('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xea7e('0x24')](handleEntityNotFound(_0x39279a,null))[_0xea7e('0x24')](function(_0x1d4f43){var _0x1ef693=_[_0xea7e('0x2f')](_0x1d4f43,'id');var _0x401a6a=[];var _0x1e6e00=[];var _0x3b9fb3=squel[_0xea7e('0x6e')]();_0x3b9fb3['field'](_0xea7e('0x6f'))['from'](_0xea7e('0x70'),'tq')[_0xea7e('0x71')](_0xea7e('0x72'),'ut',_0xea7e('0x73'))['where'](_0xea7e('0x74'),_0x233b0b[_0xea7e('0x55')]['id']);for(var _0x51f1b1=0x0;_0x51f1b1<_0x1d4f43[_0xea7e('0x3a')];_0x51f1b1+=0x1){let _0x3d8a2b=_0x1d4f43[_0x51f1b1];for(var _0x28729e=0x0;_0x28729e<_0x3d8a2b['Agents']['length'];_0x28729e+=0x1){let _0x45636b=_0x3d8a2b[_0xea7e('0x68')][_0x28729e];var _0x35af58=_0x3b9fb3[_0xea7e('0x75')]();_0x35af58[_0xea7e('0x3e')]('ut.UserId\x20=\x20?',_0x45636b['id']);_0x1e6e00[_0xea7e('0x76')](db[_0xea7e('0x77')]['query'](_0x35af58['toString'](),{'type':db[_0xea7e('0x77')][_0xea7e('0x78')]['SELECT']})[_0xea7e('0x24')](function(_0x4c4ea8){if(_0x4c4ea8[_0xea7e('0x3a')]===0x1){return _0x45636b['id'];}else{var _0x3b439e=_[_0xea7e('0x79')](_[_0xea7e('0x2f')](_0x4c4ea8,_0xea7e('0x7a')),function(_0x136719){return _[_0xea7e('0x7b')](_0x1ef693,_0x136719);});if(_0x3b439e){return _0x45636b['id'];}}}));}}return BPromise[_0xea7e('0x7c')](_0x1e6e00)[_0xea7e('0x24')](function(_0x318a0b){_0x401a6a=_(_0x401a6a)['union'](_0x318a0b)['compact']()[_0xea7e('0x7d')]();return db[_0xea7e('0x44')][_0xea7e('0x4a')]({'where':{'id':_0x233b0b[_0xea7e('0x55')]['id']}})[_0xea7e('0x24')](function(_0x2ed83a){return db[_0xea7e('0x77')][_0xea7e('0x6b')](function(_0x5dc9da){return _0x2ed83a['removeTeams'](_0x233b0b[_0xea7e('0x35')]['ids'],{'transaction':_0x5dc9da})[_0xea7e('0x24')](function(){if(!_[_0xea7e('0x7e')](_0x401a6a)){return _0x2ed83a[_0xea7e('0x7f')](_0x401a6a,{'transaction':_0x5dc9da});}})[_0xea7e('0x24')](function(){_0x401a6a[_0xea7e('0x80')](function(_0x3d5777){socket[_0xea7e('0x81')](_0xea7e('0x82'),{'UserId':_0x3d5777,'SmsQueueId':_0x2ed83a['id']});});});});});});})['then'](respondWithStatusCode(_0x39279a,null))['catch'](handleError(_0x39279a,null));};exports[_0xea7e('0x83')]=function(_0x644953,_0x4681a8,_0x12cbba){return db[_0xea7e('0x44')][_0xea7e('0x4a')]({'where':{'id':_0x644953[_0xea7e('0x55')]['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x4681a8,null))['then'](function(_0x53673d){if(_0x53673d){return _0x53673d['addAgents'](_0x644953['body']['ids'],_[_0xea7e('0x84')](_0x644953['body'],[_0xea7e('0x67'),'id'])||{})[_0xea7e('0x85')](function(_0x369678){for(var _0x5d9fc3=0x0;_0x5d9fc3<_0x644953[_0xea7e('0x4d')][_0xea7e('0x67')]['length'];_0x5d9fc3+=0x1){socket[_0xea7e('0x81')]('userSmsQueue:save',{'UserId':Number(_0x644953[_0xea7e('0x4d')][_0xea7e('0x67')][_0x5d9fc3]),'SmsQueueId':Number(_0x644953[_0xea7e('0x55')]['id'])});}return _0x369678;});}})[_0xea7e('0x24')](respondWithResult(_0x4681a8,null))[_0xea7e('0x4b')](handleError(_0x4681a8,null));};exports[_0xea7e('0x7f')]=function(_0x585a9a,_0x25fef1,_0x47facd){return db['SmsQueue'][_0xea7e('0x4a')]({'where':{'id':_0x585a9a[_0xea7e('0x55')]['id']}})['then'](handleEntityNotFound(_0x25fef1,null))[_0xea7e('0x24')](function(_0x255c0f){if(_0x255c0f){return _0x255c0f[_0xea7e('0x7f')](_0x585a9a['query'][_0xea7e('0x67')])[_0xea7e('0x24')](function(){if(_[_0xea7e('0x86')](_0x585a9a[_0xea7e('0x35')][_0xea7e('0x67')])){for(var _0x3b92e7=0x0;_0x3b92e7<_0x585a9a[_0xea7e('0x35')][_0xea7e('0x67')]['length'];_0x3b92e7+=0x1){socket[_0xea7e('0x81')](_0xea7e('0x82'),{'UserId':Number(_0x585a9a[_0xea7e('0x35')][_0xea7e('0x67')][_0x3b92e7]),'SmsQueueId':Number(_0x585a9a[_0xea7e('0x55')]['id'])});}}else{socket['emit'](_0xea7e('0x82'),{'UserId':Number(_0x585a9a[_0xea7e('0x35')][_0xea7e('0x67')]),'SmsQueueId':Number(_0x585a9a[_0xea7e('0x55')]['id'])});}});}})[_0xea7e('0x24')](respondWithStatusCode(_0x25fef1,null))[_0xea7e('0x4b')](handleError(_0x25fef1,null));};exports[_0xea7e('0x87')]=function(_0x49cfa6,_0x5e98a7,_0x4cf1cc){var _0x1c6951={};var _0x43be31={};var _0x125f05;var _0x50d60c;return db[_0xea7e('0x44')]['findOne']({'where':{'id':_0x49cfa6['params']['id']}})[_0xea7e('0x24')](handleEntityNotFound(_0x5e98a7,null))[_0xea7e('0x24')](function(_0x149208){if(_0x149208){_0x125f05=_0x149208;_0x43be31[_0xea7e('0x34')]=_[_0xea7e('0x36')](db[_0xea7e('0x5c')][_0xea7e('0x30')]);_0x43be31['query']=_[_0xea7e('0x36')](_0x49cfa6[_0xea7e('0x35')]);_0x43be31[_0xea7e('0x3f')]=_['intersection'](_0x43be31[_0xea7e('0x34')],_0x43be31[_0xea7e('0x35')]);_0x1c6951['attributes']=_[_0xea7e('0x37')](_0x43be31[_0xea7e('0x34')],qs[_0xea7e('0x39')](_0x49cfa6[_0xea7e('0x35')][_0xea7e('0x39')]));_0x1c6951[_0xea7e('0x38')]=_0x1c6951[_0xea7e('0x38')]['length']?_0x1c6951[_0xea7e('0x38')]:_0x43be31['model'];_0x1c6951['order']=qs[_0xea7e('0x3d')](_0x49cfa6[_0xea7e('0x35')][_0xea7e('0x3d')]);_0x1c6951['where']=qs[_0xea7e('0x3f')](_[_0xea7e('0x5a')](_0x49cfa6['query'],_0x43be31['filters']));if(_0x49cfa6[_0xea7e('0x35')][_0xea7e('0x40')]){_0x1c6951['where']=_[_0xea7e('0x41')](_0x1c6951[_0xea7e('0x3e')],{'$or':_[_0xea7e('0x2f')](_0x1c6951['attributes'],function(_0x2ea5ec){var _0x2a0ef7={};_0x2a0ef7[_0x2ea5ec]={'$like':'%'+_0x49cfa6[_0xea7e('0x35')][_0xea7e('0x40')]+'%'};return _0x2a0ef7;})});}_0x1c6951=_[_0xea7e('0x41')]({},_0x1c6951,_0x49cfa6[_0xea7e('0x43')]);return _0x125f05[_0xea7e('0x87')](_0x1c6951);}})[_0xea7e('0x24')](function(_0x26ef49){if(_0x26ef49){_0x50d60c=_0x26ef49[_0xea7e('0x3a')];if(!_0x49cfa6[_0xea7e('0x35')]['hasOwnProperty'](_0xea7e('0x3b'))){_0x1c6951[_0xea7e('0x1f')]=qs['limit'](_0x49cfa6[_0xea7e('0x35')][_0xea7e('0x1f')]);_0x1c6951['offset']=qs[_0xea7e('0x1c')](_0x49cfa6[_0xea7e('0x35')][_0xea7e('0x1c')]);}return _0x125f05[_0xea7e('0x87')](_0x1c6951);}})[_0xea7e('0x24')](function(_0x2173fd){if(_0x2173fd){return _0x2173fd?{'count':_0x50d60c,'rows':_0x2173fd}:null;}})[_0xea7e('0x24')](respondWithResult(_0x5e98a7,null))[_0xea7e('0x4b')](handleError(_0x5e98a7,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 5c76305..94205bc 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 _0xb5c7=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0xb5c7,0x13c));var _0x7b5c=function(_0x54e345,_0x316e23){_0x54e345=_0x54e345-0x0;var _0x518526=_0xb5c7[_0x54e345];return _0x518526;};'use strict';var EventEmitter=require(_0x7b5c('0x0'));var SmsQueue=require(_0x7b5c('0x1'))['db'][_0x7b5c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7b5c('0x3')](0x0);var events={'afterCreate':_0x7b5c('0x4'),'afterUpdate':_0x7b5c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f44a7){return function(_0x2a81ca,_0x5d6357,_0x243f57){SmsQueueEvents['emit'](_0x1f44a7+':'+_0x2a81ca['id'],_0x2a81ca);SmsQueueEvents['emit'](_0x1f44a7,_0x2a81ca);_0x243f57(null);};}for(var e in events){if(events[_0x7b5c('0x6')](e)){var event=events[e];SmsQueue[_0x7b5c('0x7')](e,emitEvent(event));}}module[_0x7b5c('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xcd59=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit'];(function(_0x1817b0,_0x3aaaa1){var _0x5c10e6=function(_0x9b3a2d){while(--_0x9b3a2d){_0x1817b0['push'](_0x1817b0['shift']());}};_0x5c10e6(++_0x3aaaa1);}(_0xcd59,0xb7));var _0x9cd5=function(_0x3b7e6f,_0x1565b5){_0x3b7e6f=_0x3b7e6f-0x0;var _0x4873c3=_0xcd59[_0x3b7e6f];return _0x4873c3;};'use strict';var EventEmitter=require(_0x9cd5('0x0'));var SmsQueue=require(_0x9cd5('0x1'))['db'][_0x9cd5('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9cd5('0x3')](0x0);var events={'afterCreate':_0x9cd5('0x4'),'afterUpdate':_0x9cd5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x44b183){return function(_0x18ab22,_0x3c18af,_0x1cbdc2){SmsQueueEvents[_0x9cd5('0x6')](_0x44b183+':'+_0x18ab22['id'],_0x18ab22);SmsQueueEvents['emit'](_0x44b183,_0x18ab22);_0x1cbdc2(null);};}for(var e in events){if(events[_0x9cd5('0x7')](e)){var event=events[e];SmsQueue[_0x9cd5('0x8')](e,emitEvent(event));}}module[_0x9cd5('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 18d7549..7f1cb0f 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 _0x0ede=['sms_queues','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x353a30,_0x50c68a){var _0x213161=function(_0x440b8b){while(--_0x440b8b){_0x353a30['push'](_0x353a30['shift']());}};_0x213161(++_0x50c68a);}(_0x0ede,0x149));var _0xe0ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ede[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe0ed('0x0'));var logger=require(_0xe0ed('0x1'))(_0xe0ed('0x2'));var moment=require(_0xe0ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0ed('0x5'));var config=require(_0xe0ed('0x6'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x2ddc35,_0x5be568){return _0x2ddc35['define']('SmsQueue',attributes,{'tableName':_0xe0ed('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da5=['SmsQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0x2c921c,_0x3c6a85){var _0x440bf2=function(_0x4db0df){while(--_0x4db0df){_0x2c921c['push'](_0x2c921c['shift']());}};_0x440bf2(++_0x3c6a85);}(_0x7da5,0x197));var _0x57da=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x7da5[_0x550d12];return _0x12103d;};'use strict';var _=require(_0x57da('0x0'));var util=require(_0x57da('0x1'));var logger=require(_0x57da('0x2'))(_0x57da('0x3'));var moment=require(_0x57da('0x4'));var BPromise=require(_0x57da('0x5'));var rp=require(_0x57da('0x6'));var fs=require('fs');var path=require(_0x57da('0x7'));var rimraf=require(_0x57da('0x8'));var config=require(_0x57da('0x9'));var attributes=require(_0x57da('0xa'));module[_0x57da('0xb')]=function(_0x3ca2da,_0x4951f6){return _0x3ca2da[_0x57da('0xc')](_0x57da('0xd'),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 770c2e5..e4755a2 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 _0x87a3=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','./smsQueue.socket','request','then','info','request\x20sent','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowSmsQueue'];(function(_0x21c331,_0x3f889f){var _0x3f2c43=function(_0x2484f3){while(--_0x2484f3){_0x21c331['push'](_0x21c331['shift']());}};_0x3f2c43(++_0x3f889f);}(_0x87a3,0xa5));var _0x387a=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x87a3[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0x387a('0x0'));var util=require(_0x387a('0x1'));var moment=require(_0x387a('0x2'));var BPromise=require('bluebird');var rs=require(_0x387a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x387a('0x4'))['db'];var utils=require(_0x387a('0x5'));var logger=require(_0x387a('0x6'))(_0x387a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x387a('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x387a('0x8')]));require(_0x387a('0x9'))['register'](socket);function respondWithRpcPromise(_0x2ad5fd,_0x58bd2e,_0x454942){return new BPromise(function(_0x6e97dd,_0x51a194){return client[_0x387a('0xa')](_0x2ad5fd,_0x454942)[_0x387a('0xb')](function(_0x46f41b){logger[_0x387a('0xc')]('SmsQueue,\x20%s,\x20%s',_0x58bd2e,_0x387a('0xd'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x58bd2e,_0x387a('0xd'),JSON[_0x387a('0xe')](_0x46f41b));if(_0x46f41b[_0x387a('0xf')]){if(_0x46f41b[_0x387a('0xf')]['code']===0x1f4){logger[_0x387a('0xf')](_0x387a('0x10'),_0x58bd2e,_0x46f41b[_0x387a('0xf')][_0x387a('0x11')]);return _0x51a194(_0x46f41b['error'][_0x387a('0x11')]);}logger[_0x387a('0xf')]('SmsQueue,\x20%s,\x20%s',_0x58bd2e,_0x46f41b[_0x387a('0xf')][_0x387a('0x11')]);return _0x6e97dd(_0x46f41b[_0x387a('0xf')][_0x387a('0x11')]);}else{logger[_0x387a('0xc')](_0x387a('0x10'),_0x58bd2e,_0x387a('0xd'));_0x6e97dd(_0x46f41b[_0x387a('0x12')]['message']);}})[_0x387a('0x13')](function(_0x4a84cb){logger[_0x387a('0xf')](_0x387a('0x10'),_0x58bd2e,_0x4a84cb);_0x51a194(_0x4a84cb);});});}exports[_0x387a('0x14')]=function(_0x29b5fc){var _0x307a6e=this;return new Promise(function(_0xe209f0,_0xa4096e){return db[_0x387a('0x15')][_0x387a('0x16')]({'raw':_0x29b5fc[_0x387a('0x17')]?_0x29b5fc[_0x387a('0x17')][_0x387a('0x18')]===undefined?!![]:![]:!![],'where':_0x29b5fc['options']?_0x29b5fc[_0x387a('0x17')][_0x387a('0x19')]||null:null,'attributes':_0x29b5fc['options']?_0x29b5fc[_0x387a('0x17')][_0x387a('0x1a')]||null:null,'limit':_0x29b5fc[_0x387a('0x17')]?_0x29b5fc[_0x387a('0x17')][_0x387a('0x1b')]||null:null,'include':_0x29b5fc[_0x387a('0x17')]?_0x29b5fc['options'][_0x387a('0x1c')]?_[_0x387a('0x1d')](_0x29b5fc[_0x387a('0x17')][_0x387a('0x1c')],function(_0x47d330){return{'model':db[_0x47d330[_0x387a('0x1e')]],'as':_0x47d330['as'],'attributes':_0x47d330[_0x387a('0x1a')],'include':_0x47d330['include']?_['map'](_0x47d330['include'],function(_0x41dc4d){return{'model':db[_0x41dc4d[_0x387a('0x1e')]],'as':_0x41dc4d['as'],'attributes':_0x41dc4d['attributes'],'include':_0x41dc4d[_0x387a('0x1c')]?_[_0x387a('0x1d')](_0x41dc4d[_0x387a('0x1c')],function(_0x26a0f0){return{'model':db[_0x26a0f0[_0x387a('0x1e')]],'as':_0x26a0f0['as'],'attributes':_0x26a0f0[_0x387a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x387a('0xb')](function(_0x14fe2a){logger[_0x387a('0xc')]('GetSmsQueue',_0x29b5fc);logger[_0x387a('0x1f')](_0x387a('0x14'),_0x29b5fc,JSON[_0x387a('0xe')](_0x14fe2a));_0xe209f0(_0x14fe2a);})[_0x387a('0x13')](function(_0x220c41){logger[_0x387a('0xf')]('GetSmsQueue',_0x220c41[_0x387a('0x11')],_0x29b5fc);_0xa4096e(_0x307a6e[_0x387a('0xf')](0x1f4,_0x220c41['message']));});});};exports['ShowSmsQueue']=function(_0x3f746){var _0x1b3957=this;return new Promise(function(_0x29ccc0,_0x120a4f){return db['SmsQueue']['find']({'raw':_0x3f746[_0x387a('0x17')]?_0x3f746[_0x387a('0x17')][_0x387a('0x18')]===undefined?!![]:![]:!![],'where':_0x3f746[_0x387a('0x17')]?_0x3f746[_0x387a('0x17')][_0x387a('0x19')]||null:null,'attributes':_0x3f746[_0x387a('0x17')]?_0x3f746[_0x387a('0x17')][_0x387a('0x1a')]||null:null,'include':_0x3f746[_0x387a('0x17')]?_0x3f746[_0x387a('0x17')][_0x387a('0x1c')]?_[_0x387a('0x1d')](_0x3f746['options']['include'],function(_0x55a10f){return{'model':db[_0x55a10f[_0x387a('0x1e')]],'as':_0x55a10f['as'],'attributes':_0x55a10f[_0x387a('0x1a')],'include':_0x55a10f['include']?_[_0x387a('0x1d')](_0x55a10f[_0x387a('0x1c')],function(_0x161e3f){return{'model':db[_0x161e3f[_0x387a('0x1e')]],'as':_0x161e3f['as'],'attributes':_0x161e3f[_0x387a('0x1a')],'include':_0x161e3f[_0x387a('0x1c')]?_['map'](_0x161e3f[_0x387a('0x1c')],function(_0x44c293){return{'model':db[_0x44c293[_0x387a('0x1e')]],'as':_0x44c293['as'],'attributes':_0x44c293[_0x387a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x387a('0xb')](function(_0x51ca8f){logger[_0x387a('0xc')](_0x387a('0x20'),_0x3f746);logger[_0x387a('0x1f')](_0x387a('0x20'),_0x3f746,JSON[_0x387a('0xe')](_0x51ca8f));_0x29ccc0(_0x51ca8f);})[_0x387a('0x13')](function(_0x2c8bec){logger[_0x387a('0xf')](_0x387a('0x20'),_0x2c8bec[_0x387a('0x11')],_0x3f746);_0x120a4f(_0x1b3957[_0x387a('0xf')](0x1f4,_0x2c8bec['message']));});});}; \ No newline at end of file +var _0x15ab=['options','raw','attributes','limit','include','map','model','catch','ShowSmsQueue','SmsQueue','where','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','findAll'];(function(_0x29ff78,_0x2c561a){var _0x39c247=function(_0x495036){while(--_0x495036){_0x29ff78['push'](_0x29ff78['shift']());}};_0x39c247(++_0x2c561a);}(_0x15ab,0xf5));var _0xb15a=function(_0xdb7627,_0x5ea4a8){_0xdb7627=_0xdb7627-0x0;var _0x50c4e4=_0x15ab[_0xdb7627];return _0x50c4e4;};'use strict';var _=require(_0xb15a('0x0'));var util=require(_0xb15a('0x1'));var moment=require('moment');var BPromise=require(_0xb15a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb15a('0x3'))(_0xb15a('0x4'));var config=require(_0xb15a('0x5'));var jayson=require(_0xb15a('0x6'));var client=jayson[_0xb15a('0x7')][_0xb15a('0x8')]({'port':0x232a});config['redis']=_[_0xb15a('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb15a('0xa'))(new Redis(config[_0xb15a('0xb')]));require(_0xb15a('0xc'))[_0xb15a('0xd')](socket);function respondWithRpcPromise(_0x48528f,_0xe4e6a6,_0x2cc8fb){return new BPromise(function(_0x489486,_0x535094){return client[_0xb15a('0xe')](_0x48528f,_0x2cc8fb)[_0xb15a('0xf')](function(_0x341666){logger[_0xb15a('0x10')](_0xb15a('0x11'),_0xe4e6a6,_0xb15a('0x12'));logger[_0xb15a('0x13')](_0xb15a('0x14'),_0xe4e6a6,_0xb15a('0x12'),JSON[_0xb15a('0x15')](_0x341666));if(_0x341666[_0xb15a('0x16')]){if(_0x341666[_0xb15a('0x16')][_0xb15a('0x17')]===0x1f4){logger[_0xb15a('0x16')](_0xb15a('0x11'),_0xe4e6a6,_0x341666[_0xb15a('0x16')]['message']);return _0x535094(_0x341666['error'][_0xb15a('0x18')]);}logger[_0xb15a('0x16')]('SmsQueue,\x20%s,\x20%s',_0xe4e6a6,_0x341666[_0xb15a('0x16')]['message']);return _0x489486(_0x341666[_0xb15a('0x16')][_0xb15a('0x18')]);}else{logger[_0xb15a('0x10')](_0xb15a('0x11'),_0xe4e6a6,_0xb15a('0x12'));_0x489486(_0x341666[_0xb15a('0x19')][_0xb15a('0x18')]);}})['catch'](function(_0x2b395e){logger[_0xb15a('0x16')](_0xb15a('0x11'),_0xe4e6a6,_0x2b395e);_0x535094(_0x2b395e);});});}exports[_0xb15a('0x1a')]=function(_0x4c87fc){var _0x285910=this;return new Promise(function(_0x1233fa,_0x496b44){return db['SmsQueue'][_0xb15a('0x1b')]({'raw':_0x4c87fc[_0xb15a('0x1c')]?_0x4c87fc['options'][_0xb15a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c87fc[_0xb15a('0x1c')]?_0x4c87fc['options']['where']||null:null,'attributes':_0x4c87fc[_0xb15a('0x1c')]?_0x4c87fc['options'][_0xb15a('0x1e')]||null:null,'limit':_0x4c87fc[_0xb15a('0x1c')]?_0x4c87fc[_0xb15a('0x1c')][_0xb15a('0x1f')]||null:null,'include':_0x4c87fc['options']?_0x4c87fc[_0xb15a('0x1c')][_0xb15a('0x20')]?_[_0xb15a('0x21')](_0x4c87fc[_0xb15a('0x1c')][_0xb15a('0x20')],function(_0x2f34bd){return{'model':db[_0x2f34bd[_0xb15a('0x22')]],'as':_0x2f34bd['as'],'attributes':_0x2f34bd[_0xb15a('0x1e')],'include':_0x2f34bd[_0xb15a('0x20')]?_[_0xb15a('0x21')](_0x2f34bd[_0xb15a('0x20')],function(_0x3870f5){return{'model':db[_0x3870f5[_0xb15a('0x22')]],'as':_0x3870f5['as'],'attributes':_0x3870f5[_0xb15a('0x1e')],'include':_0x3870f5[_0xb15a('0x20')]?_[_0xb15a('0x21')](_0x3870f5[_0xb15a('0x20')],function(_0xab0d07){return{'model':db[_0xab0d07[_0xb15a('0x22')]],'as':_0xab0d07['as'],'attributes':_0xab0d07['attributes']};}):[]};}):[]};}):[]:[]})[_0xb15a('0xf')](function(_0x5be2d2){logger[_0xb15a('0x10')](_0xb15a('0x1a'),_0x4c87fc);logger['debug']('GetSmsQueue',_0x4c87fc,JSON[_0xb15a('0x15')](_0x5be2d2));_0x1233fa(_0x5be2d2);})[_0xb15a('0x23')](function(_0x58057d){logger[_0xb15a('0x16')](_0xb15a('0x1a'),_0x58057d[_0xb15a('0x18')],_0x4c87fc);_0x496b44(_0x285910['error'](0x1f4,_0x58057d[_0xb15a('0x18')]));});});};exports[_0xb15a('0x24')]=function(_0x68211c){var _0x20331e=this;return new Promise(function(_0x30045b,_0x11e829){return db[_0xb15a('0x25')]['find']({'raw':_0x68211c[_0xb15a('0x1c')]?_0x68211c[_0xb15a('0x1c')][_0xb15a('0x1d')]===undefined?!![]:![]:!![],'where':_0x68211c['options']?_0x68211c[_0xb15a('0x1c')][_0xb15a('0x26')]||null:null,'attributes':_0x68211c[_0xb15a('0x1c')]?_0x68211c[_0xb15a('0x1c')][_0xb15a('0x1e')]||null:null,'include':_0x68211c[_0xb15a('0x1c')]?_0x68211c[_0xb15a('0x1c')][_0xb15a('0x20')]?_[_0xb15a('0x21')](_0x68211c['options'][_0xb15a('0x20')],function(_0x70cd47){return{'model':db[_0x70cd47[_0xb15a('0x22')]],'as':_0x70cd47['as'],'attributes':_0x70cd47[_0xb15a('0x1e')],'include':_0x70cd47[_0xb15a('0x20')]?_[_0xb15a('0x21')](_0x70cd47[_0xb15a('0x20')],function(_0x5e606c){return{'model':db[_0x5e606c[_0xb15a('0x22')]],'as':_0x5e606c['as'],'attributes':_0x5e606c[_0xb15a('0x1e')],'include':_0x5e606c[_0xb15a('0x20')]?_[_0xb15a('0x21')](_0x5e606c[_0xb15a('0x20')],function(_0x43fd9c){return{'model':db[_0x43fd9c[_0xb15a('0x22')]],'as':_0x43fd9c['as'],'attributes':_0x43fd9c['attributes']};}):[]};}):[]};}):[]:[]})[_0xb15a('0xf')](function(_0x8407c5){logger[_0xb15a('0x10')](_0xb15a('0x24'),_0x68211c);logger[_0xb15a('0x13')](_0xb15a('0x24'),_0x68211c,JSON[_0xb15a('0x15')](_0x8407c5));_0x30045b(_0x8407c5);})[_0xb15a('0x23')](function(_0x3662d6){logger[_0xb15a('0x16')]('ShowSmsQueue',_0x3662d6[_0xb15a('0x18')],_0x68211c);_0x11e829(_0x20331e[_0xb15a('0x16')](0x1f4,_0x3662d6[_0xb15a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 1819385..c3411e2 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 _0x1ffa=['./smsQueue.events','save','remove','length','smsQueue:'];(function(_0x2bf2a4,_0x2ea970){var _0x34ab49=function(_0x122214){while(--_0x122214){_0x2bf2a4['push'](_0x2bf2a4['shift']());}};_0x34ab49(++_0x2ea970);}(_0x1ffa,0xb9));var _0xa1ff=function(_0x515610,_0x51d4ca){_0x515610=_0x515610-0x0;var _0x555356=_0x1ffa[_0x515610];return _0x555356;};'use strict';var SmsQueueEvents=require(_0xa1ff('0x0'));var events=[_0xa1ff('0x1'),_0xa1ff('0x2'),'update'];function createListener(_0x41f054,_0x1c74a5){return function(_0x328eea){_0x1c74a5['emit'](_0x41f054,_0x328eea);};}function removeListener(_0x2649d7,_0x4ba1f2){return function(){SmsQueueEvents['removeListener'](_0x2649d7,_0x4ba1f2);};}exports['register']=function(_0xfbbee8){for(var _0x3d64d6=0x0,_0x30e023=events[_0xa1ff('0x3')];_0x3d64d6<_0x30e023;_0x3d64d6++){var _0x5db553=events[_0x3d64d6];var _0x3009a6=createListener(_0xa1ff('0x4')+_0x5db553,_0xfbbee8);SmsQueueEvents['on'](_0x5db553,_0x3009a6);}}; \ No newline at end of file +var _0xa4c3=['remove','emit','removeListener','length','smsQueue:','./smsQueue.events'];(function(_0x2b849a,_0x11f19c){var _0x3ec9fb=function(_0x5e3267){while(--_0x5e3267){_0x2b849a['push'](_0x2b849a['shift']());}};_0x3ec9fb(++_0x11f19c);}(_0xa4c3,0x9b));var _0x3a4c=function(_0x5b00e9,_0x1ab97c){_0x5b00e9=_0x5b00e9-0x0;var _0xa39f6e=_0xa4c3[_0x5b00e9];return _0xa39f6e;};'use strict';var SmsQueueEvents=require(_0x3a4c('0x0'));var events=['save',_0x3a4c('0x1'),'update'];function createListener(_0x280e0b,_0x436ef0){return function(_0x3acd13){_0x436ef0[_0x3a4c('0x2')](_0x280e0b,_0x3acd13);};}function removeListener(_0x380b10,_0x10ada5){return function(){SmsQueueEvents[_0x3a4c('0x3')](_0x380b10,_0x10ada5);};}exports['register']=function(_0x1e572e){for(var _0x469b3e=0x0,_0x27127b=events[_0x3a4c('0x4')];_0x469b3e<_0x27127b;_0x469b3e++){var _0x51bbba=events[_0x469b3e];var _0x45977f=createListener(_0x3a4c('0x5')+_0x51bbba,_0x1e572e);SmsQueueEvents['on'](_0x51bbba,_0x45977f);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index e68112d..99fb146 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 _0xe28c=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','post','put','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x27e689,_0x322669){var _0xa9df48=function(_0x2d6ede){while(--_0x2d6ede){_0x27e689['push'](_0x27e689['shift']());}};_0xa9df48(++_0x322669);}(_0xe28c,0x175));var _0xce28=function(_0x43330e,_0x3ddaae){_0x43330e=_0x43330e-0x0;var _0x9fedf4=_0xe28c[_0x43330e];return _0x9fedf4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce28('0x0'));var timeout=require(_0xce28('0x1'));var express=require(_0xce28('0x2'));var router=express[_0xce28('0x3')]();var fs_extra=require(_0xce28('0x4'));var auth=require(_0xce28('0x5'));var interaction=require(_0xce28('0x6'));var config=require(_0xce28('0x7'));var controller=require('./smsQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xce28('0x8')]);router[_0xce28('0x9')](_0xce28('0xa'),auth[_0xce28('0xb')](),controller[_0xce28('0xc')]);router[_0xce28('0x9')](_0xce28('0xd'),auth[_0xce28('0xb')](),controller['show']);router[_0xce28('0xe')]('/',auth[_0xce28('0xb')](),controller['create']);router[_0xce28('0xf')]('/:id',auth[_0xce28('0xb')](),controller['update']);router['delete']('/:id',auth[_0xce28('0xb')](),controller[_0xce28('0x10')]);module[_0xce28('0x11')]=router; \ No newline at end of file +var _0x51f2=['../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4349de,_0x32c0b4){var _0x4ee7f7=function(_0x5d1446){while(--_0x5d1446){_0x4349de['push'](_0x4349de['shift']());}};_0x4ee7f7(++_0x32c0b4);}(_0x51f2,0xeb));var _0x251f=function(_0x514880,_0x42f57d){_0x514880=_0x514880-0x0;var _0x33e4d1=_0x51f2[_0x514880];return _0x33e4d1;};'use strict';var multer=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var path=require(_0x251f('0x2'));var timeout=require(_0x251f('0x3'));var express=require(_0x251f('0x4'));var router=express[_0x251f('0x5')]();var fs_extra=require(_0x251f('0x6'));var auth=require(_0x251f('0x7'));var interaction=require(_0x251f('0x8'));var config=require('../../config/environment');var controller=require(_0x251f('0x9'));router[_0x251f('0xa')]('/',auth[_0x251f('0xb')](),controller[_0x251f('0xc')]);router[_0x251f('0xa')]('/describe',auth[_0x251f('0xb')](),controller[_0x251f('0xd')]);router[_0x251f('0xa')](_0x251f('0xe'),auth['isAuthenticated'](),controller[_0x251f('0xf')]);router[_0x251f('0x10')]('/',auth[_0x251f('0xb')](),controller[_0x251f('0x11')]);router['put'](_0x251f('0xe'),auth[_0x251f('0xb')](),controller[_0x251f('0x12')]);router[_0x251f('0x13')]('/:id',auth[_0x251f('0xb')](),controller[_0x251f('0x14')]);module[_0x251f('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 44f6139..4286ce9 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 _0x80fc=['DATE','moment','sequelize','exports','STRING'];(function(_0x27b506,_0x3f8745){var _0x4cae56=function(_0x2d315d){while(--_0x2d315d){_0x27b506['push'](_0x27b506['shift']());}};_0x4cae56(++_0x3f8745);}(_0x80fc,0x1af));var _0xc80f=function(_0x43dc0d,_0x2b1247){_0x43dc0d=_0x43dc0d-0x0;var _0x58484d=_0x80fc[_0x43dc0d];return _0x58484d;};'use strict';var moment=require(_0xc80f('0x0'));var Sequelize=require(_0xc80f('0x1'));module[_0xc80f('0x2')]={'uniqueid':{'type':Sequelize[_0xc80f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc80f('0x3')]},'joinAt':{'type':Sequelize[_0xc80f('0x4')]},'leaveAt':{'type':Sequelize[_0xc80f('0x4')]},'acceptAt':{'type':Sequelize[_0xc80f('0x4')]},'exitAt':{'type':Sequelize[_0xc80f('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf008=['exports','STRING','DATE','moment','sequelize'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xf008,0x193));var _0x8f00=function(_0x3c73a7,_0x3a0a40){_0x3c73a7=_0x3c73a7-0x0;var _0x2605bb=_0xf008[_0x3c73a7];return _0x2605bb;};'use strict';var moment=require(_0x8f00('0x0'));var Sequelize=require(_0x8f00('0x1'));module[_0x8f00('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8f00('0x3')]},'joinAt':{'type':Sequelize[_0x8f00('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8f00('0x4')]},'exitAt':{'type':Sequelize[_0x8f00('0x4')]},'reason':{'type':Sequelize[_0x8f00('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0250b3e..48d8704 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 _0xf8e3=['undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0xf8e3,0xc2));var _0x3f8e=function(_0x1dcdc1,_0x2fdd77){_0x1dcdc1=_0x1dcdc1-0x0;var _0x24a48c=_0xf8e3[_0x1dcdc1];return _0x24a48c;};'use strict';var emlformat=require(_0x3f8e('0x0'));var rimraf=require(_0x3f8e('0x1'));var zipdir=require(_0x3f8e('0x2'));var jsonpatch=require(_0x3f8e('0x3'));var rp=require(_0x3f8e('0x4'));var moment=require(_0x3f8e('0x5'));var BPromise=require(_0x3f8e('0x6'));var Mustache=require(_0x3f8e('0x7'));var util=require(_0x3f8e('0x8'));var path=require(_0x3f8e('0x9'));var sox=require(_0x3f8e('0xa'));var csv=require(_0x3f8e('0xb'));var ejs=require(_0x3f8e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f8e('0xd'));var squel=require(_0x3f8e('0xe'));var crypto=require(_0x3f8e('0xf'));var jsforce=require(_0x3f8e('0x10'));var deskjs=require(_0x3f8e('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3f8e('0x12'));var Papa=require(_0x3f8e('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f8e('0x14'));var as=require(_0x3f8e('0x15'));var hardwareService=require(_0x3f8e('0x16'));var logger=require(_0x3f8e('0x17'))(_0x3f8e('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f8e('0x19'));var db=require(_0x3f8e('0x1a'))['db'];function respondWithStatusCode(_0x4f82ad,_0x3dc36b){_0x3dc36b=_0x3dc36b||0xcc;return function(_0x3fce6c){if(_0x3fce6c){return _0x4f82ad[_0x3f8e('0x1b')](_0x3dc36b);}return _0x4f82ad[_0x3f8e('0x1c')](_0x3dc36b)[_0x3f8e('0x1d')]();};}function respondWithResult(_0x1d4e7b,_0x1f6281){_0x1f6281=_0x1f6281||0xc8;return function(_0x4ee63b){if(_0x4ee63b){return _0x1d4e7b[_0x3f8e('0x1c')](_0x1f6281)[_0x3f8e('0x1e')](_0x4ee63b);}};}function respondWithFilteredResult(_0x4a81f6,_0x24701d){return function(_0x330125){if(_0x330125){var _0x455315=typeof _0x24701d['offset']===_0x3f8e('0x1f')&&typeof _0x24701d[_0x3f8e('0x20')]===_0x3f8e('0x1f');var _0x2990df=_0x330125['count'];var _0x1a1ec0=_0x455315?0x0:_0x24701d[_0x3f8e('0x21')];var _0x4a50c9=_0x455315?_0x330125[_0x3f8e('0x22')]:_0x24701d['offset']+_0x24701d[_0x3f8e('0x20')];var _0x37f443;if(_0x4a50c9>=_0x2990df){_0x4a50c9=_0x2990df;_0x37f443=0xc8;}else{_0x37f443=0xce;}_0x4a81f6[_0x3f8e('0x1c')](_0x37f443);return _0x4a81f6[_0x3f8e('0x23')](_0x3f8e('0x24'),_0x1a1ec0+'-'+_0x4a50c9+'/'+_0x2990df)['json'](_0x330125);}return null;};}function patchUpdates(_0x3197f1){return function(_0x5606b9){try{jsonpatch[_0x3f8e('0x25')](_0x5606b9,_0x3197f1,!![]);}catch(_0x5ca0ee){return BPromise[_0x3f8e('0x26')](_0x5ca0ee);}return _0x5606b9['save']();};}function saveUpdates(_0x5a224a,_0x30c167){return function(_0x591e92){if(_0x591e92){return _0x591e92[_0x3f8e('0x27')](_0x5a224a)[_0x3f8e('0x28')](function(_0x40eb68){return _0x40eb68;});}return null;};}function removeEntity(_0x5aee07,_0x101847){return function(_0x4a6f58){if(_0x4a6f58){return _0x4a6f58['destroy']()[_0x3f8e('0x28')](function(){_0x5aee07[_0x3f8e('0x1c')](0xcc)[_0x3f8e('0x1d')]();});}};}function handleEntityNotFound(_0x4dae33,_0x1965e1){return function(_0xb09245){if(!_0xb09245){_0x4dae33[_0x3f8e('0x1b')](0x194);}return _0xb09245;};}function handleError(_0x431795,_0x278c09){_0x278c09=_0x278c09||0x1f4;return function(_0x4bf86f){logger[_0x3f8e('0x29')](_0x4bf86f[_0x3f8e('0x2a')]);if(_0x4bf86f['name']){delete _0x4bf86f[_0x3f8e('0x2b')];}_0x431795['status'](_0x278c09)[_0x3f8e('0x2c')](_0x4bf86f);};}exports[_0x3f8e('0x2d')]=function(_0x25ced4,_0x1e5114){var _0x299129={},_0x23a470={},_0x144413={'count':0x0,'rows':[]};var _0x4b6188=_[_0x3f8e('0x2e')](db[_0x3f8e('0x2f')]['rawAttributes'],function(_0x290152){return{'name':_0x290152[_0x3f8e('0x30')],'type':_0x290152[_0x3f8e('0x31')][_0x3f8e('0x32')]};});_0x23a470['model']=_['map'](_0x4b6188,_0x3f8e('0x2b'));_0x23a470['query']=_['keys'](_0x25ced4[_0x3f8e('0x33')]);_0x23a470[_0x3f8e('0x34')]=_[_0x3f8e('0x35')](_0x23a470[_0x3f8e('0x36')],_0x23a470[_0x3f8e('0x33')]);_0x299129['attributes']=_[_0x3f8e('0x35')](_0x23a470[_0x3f8e('0x36')],qs['fields'](_0x25ced4[_0x3f8e('0x33')][_0x3f8e('0x37')]));_0x299129[_0x3f8e('0x38')]=_0x299129[_0x3f8e('0x38')][_0x3f8e('0x39')]?_0x299129[_0x3f8e('0x38')]:_0x23a470[_0x3f8e('0x36')];if(!_0x25ced4[_0x3f8e('0x33')]['hasOwnProperty']('nolimit')){_0x299129[_0x3f8e('0x20')]=qs[_0x3f8e('0x20')](_0x25ced4[_0x3f8e('0x33')]['limit']);_0x299129[_0x3f8e('0x21')]=qs[_0x3f8e('0x21')](_0x25ced4['query'][_0x3f8e('0x21')]);}_0x299129[_0x3f8e('0x3a')]=qs[_0x3f8e('0x3b')](_0x25ced4[_0x3f8e('0x33')][_0x3f8e('0x3b')]);_0x299129[_0x3f8e('0x3c')]=qs[_0x3f8e('0x34')](_['pick'](_0x25ced4[_0x3f8e('0x33')],_0x23a470[_0x3f8e('0x34')]),_0x4b6188);if(_0x25ced4['query'][_0x3f8e('0x3d')]){_0x299129[_0x3f8e('0x3c')]=_[_0x3f8e('0x3e')](_0x299129[_0x3f8e('0x3c')],{'$or':_[_0x3f8e('0x2e')](_0x4b6188,function(_0x2afedd){if(_0x2afedd[_0x3f8e('0x31')]!==_0x3f8e('0x3f')){var _0x132f56={};_0x132f56[_0x2afedd[_0x3f8e('0x2b')]]={'$like':'%'+_0x25ced4[_0x3f8e('0x33')][_0x3f8e('0x3d')]+'%'};return _0x132f56;}})});}_0x299129=_[_0x3f8e('0x3e')]({},_0x299129,_0x25ced4['options']);var _0x47d121={'where':_0x299129['where']};return db[_0x3f8e('0x2f')][_0x3f8e('0x22')](_0x47d121)[_0x3f8e('0x28')](function(_0x13d9ae){_0x144413[_0x3f8e('0x22')]=_0x13d9ae;if(_0x25ced4[_0x3f8e('0x33')][_0x3f8e('0x40')]){_0x299129[_0x3f8e('0x41')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x299129);})[_0x3f8e('0x28')](function(_0x539a85){_0x144413[_0x3f8e('0x42')]=_0x539a85;return _0x144413;})[_0x3f8e('0x28')](respondWithFilteredResult(_0x1e5114,_0x299129))[_0x3f8e('0x43')](handleError(_0x1e5114,null));};exports[_0x3f8e('0x44')]=function(_0xbfbc8d,_0x582366){var _0x29d1d2={'raw':!![],'where':{'id':_0xbfbc8d[_0x3f8e('0x45')]['id']}},_0x43f7f7={};_0x43f7f7[_0x3f8e('0x36')]=_[_0x3f8e('0x46')](db[_0x3f8e('0x2f')]['rawAttributes']);_0x43f7f7['query']=_[_0x3f8e('0x46')](_0xbfbc8d[_0x3f8e('0x33')]);_0x43f7f7['filters']=_[_0x3f8e('0x35')](_0x43f7f7['model'],_0x43f7f7[_0x3f8e('0x33')]);_0x29d1d2[_0x3f8e('0x38')]=_['intersection'](_0x43f7f7['model'],qs[_0x3f8e('0x37')](_0xbfbc8d[_0x3f8e('0x33')][_0x3f8e('0x37')]));_0x29d1d2[_0x3f8e('0x38')]=_0x29d1d2[_0x3f8e('0x38')][_0x3f8e('0x39')]?_0x29d1d2[_0x3f8e('0x38')]:_0x43f7f7['model'];if(_0xbfbc8d[_0x3f8e('0x33')][_0x3f8e('0x40')]){_0x29d1d2['include']=[{'all':!![]}];}_0x29d1d2=_[_0x3f8e('0x3e')]({},_0x29d1d2,_0xbfbc8d['options']);return db[_0x3f8e('0x2f')][_0x3f8e('0x47')](_0x29d1d2)['then'](handleEntityNotFound(_0x582366,null))[_0x3f8e('0x28')](respondWithResult(_0x582366,null))[_0x3f8e('0x43')](handleError(_0x582366,null));};exports[_0x3f8e('0x48')]=function(_0x36e6ec,_0x3c279d){return db[_0x3f8e('0x2f')]['create'](_0x36e6ec[_0x3f8e('0x49')],{})[_0x3f8e('0x28')](respondWithResult(_0x3c279d,0xc9))[_0x3f8e('0x43')](handleError(_0x3c279d,null));};exports[_0x3f8e('0x27')]=function(_0x3761a9,_0x19df6){if(_0x3761a9[_0x3f8e('0x49')]['id']){delete _0x3761a9[_0x3f8e('0x49')]['id'];}return db[_0x3f8e('0x2f')][_0x3f8e('0x47')]({'where':{'id':_0x3761a9[_0x3f8e('0x45')]['id']}})['then'](handleEntityNotFound(_0x19df6,null))[_0x3f8e('0x28')](saveUpdates(_0x3761a9[_0x3f8e('0x49')],null))[_0x3f8e('0x28')](respondWithResult(_0x19df6,null))[_0x3f8e('0x43')](handleError(_0x19df6,null));};exports[_0x3f8e('0x4a')]=function(_0x25ec18,_0x5d591f){return db[_0x3f8e('0x2f')]['find']({'where':{'id':_0x25ec18[_0x3f8e('0x45')]['id']}})[_0x3f8e('0x28')](handleEntityNotFound(_0x5d591f,null))[_0x3f8e('0x28')](removeEntity(_0x5d591f,null))['catch'](handleError(_0x5d591f,null));};exports['describe']=function(_0x20b2f5,_0x11fc8c){return db['SmsQueueReport']['describe']()[_0x3f8e('0x28')](respondWithResult(_0x11fc8c,null))['catch'](handleError(_0x11fc8c,null));}; \ No newline at end of file +var _0xa9ca=['crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../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','error','name','index','SmsQueueReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel'];(function(_0x3edccf,_0x2a0805){var _0xb1932f=function(_0x546714){while(--_0x546714){_0x3edccf['push'](_0x3edccf['shift']());}};_0xb1932f(++_0x2a0805);}(_0xa9ca,0x131));var _0xaa9c=function(_0x5dcf36,_0x49e11f){_0x5dcf36=_0x5dcf36-0x0;var _0x4dba5e=_0xa9ca[_0x5dcf36];return _0x4dba5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa9c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa9c('0x1'));var rp=require(_0xaa9c('0x2'));var moment=require(_0xaa9c('0x3'));var BPromise=require(_0xaa9c('0x4'));var Mustache=require('mustache');var util=require(_0xaa9c('0x5'));var path=require(_0xaa9c('0x6'));var sox=require(_0xaa9c('0x7'));var csv=require('to-csv');var ejs=require(_0xaa9c('0x8'));var fs=require('fs');var fs_extra=require(_0xaa9c('0x9'));var _=require('lodash');var squel=require(_0xaa9c('0xa'));var crypto=require(_0xaa9c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaa9c('0xc'));var toCsv=require(_0xaa9c('0xd'));var querystring=require(_0xaa9c('0xe'));var Papa=require(_0xaa9c('0xf'));var Redis=require('ioredis');var authService=require(_0xaa9c('0x10'));var qs=require(_0xaa9c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa9c('0x12'));var logger=require(_0xaa9c('0x13'))(_0xaa9c('0x14'));var utils=require(_0xaa9c('0x15'));var config=require(_0xaa9c('0x16'));var licenseUtil=require(_0xaa9c('0x17'));var db=require(_0xaa9c('0x18'))['db'];function respondWithStatusCode(_0x438b68,_0x1920c0){_0x1920c0=_0x1920c0||0xcc;return function(_0x296f98){if(_0x296f98){return _0x438b68['sendStatus'](_0x1920c0);}return _0x438b68[_0xaa9c('0x19')](_0x1920c0)[_0xaa9c('0x1a')]();};}function respondWithResult(_0x343931,_0x5e454d){_0x5e454d=_0x5e454d||0xc8;return function(_0x59818a){if(_0x59818a){return _0x343931['status'](_0x5e454d)[_0xaa9c('0x1b')](_0x59818a);}};}function respondWithFilteredResult(_0x2d46a9,_0x1ad325){return function(_0x3026e7){if(_0x3026e7){var _0x2816fd=typeof _0x1ad325[_0xaa9c('0x1c')]===_0xaa9c('0x1d')&&typeof _0x1ad325[_0xaa9c('0x1e')]==='undefined';var _0x3640ff=_0x3026e7[_0xaa9c('0x1f')];var _0x5e012a=_0x2816fd?0x0:_0x1ad325[_0xaa9c('0x1c')];var _0x17aa14=_0x2816fd?_0x3026e7[_0xaa9c('0x1f')]:_0x1ad325[_0xaa9c('0x1c')]+_0x1ad325['limit'];var _0x70916;if(_0x17aa14>=_0x3640ff){_0x17aa14=_0x3640ff;_0x70916=0xc8;}else{_0x70916=0xce;}_0x2d46a9['status'](_0x70916);return _0x2d46a9[_0xaa9c('0x20')](_0xaa9c('0x21'),_0x5e012a+'-'+_0x17aa14+'/'+_0x3640ff)[_0xaa9c('0x1b')](_0x3026e7);}return null;};}function patchUpdates(_0x4eb8b8){return function(_0x292e3c){try{jsonpatch[_0xaa9c('0x22')](_0x292e3c,_0x4eb8b8,!![]);}catch(_0x36daac){return BPromise[_0xaa9c('0x23')](_0x36daac);}return _0x292e3c[_0xaa9c('0x24')]();};}function saveUpdates(_0x126612,_0x3f2520){return function(_0x59ac27){if(_0x59ac27){return _0x59ac27[_0xaa9c('0x25')](_0x126612)[_0xaa9c('0x26')](function(_0x2002c7){return _0x2002c7;});}return null;};}function removeEntity(_0x42567b,_0x3ad45f){return function(_0x567f4f){if(_0x567f4f){return _0x567f4f[_0xaa9c('0x27')]()['then'](function(){_0x42567b[_0xaa9c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf89ea7,_0x1a332c){return function(_0x5d13f0){if(!_0x5d13f0){_0xf89ea7[_0xaa9c('0x28')](0x194);}return _0x5d13f0;};}function handleError(_0x28bbf8,_0xa6550a){_0xa6550a=_0xa6550a||0x1f4;return function(_0x3f847e){logger[_0xaa9c('0x29')](_0x3f847e['stack']);if(_0x3f847e[_0xaa9c('0x2a')]){delete _0x3f847e[_0xaa9c('0x2a')];}_0x28bbf8[_0xaa9c('0x19')](_0xa6550a)['send'](_0x3f847e);};}exports[_0xaa9c('0x2b')]=function(_0x18163b,_0x3d13b7){var _0xe157a3={},_0xfbbed={},_0x16550c={'count':0x0,'rows':[]};var _0x4e496b=_['map'](db[_0xaa9c('0x2c')][_0xaa9c('0x2d')],function(_0x3b7df1){return{'name':_0x3b7df1[_0xaa9c('0x2e')],'type':_0x3b7df1[_0xaa9c('0x2f')][_0xaa9c('0x30')]};});_0xfbbed['model']=_[_0xaa9c('0x31')](_0x4e496b,'name');_0xfbbed[_0xaa9c('0x32')]=_[_0xaa9c('0x33')](_0x18163b['query']);_0xfbbed[_0xaa9c('0x34')]=_[_0xaa9c('0x35')](_0xfbbed[_0xaa9c('0x36')],_0xfbbed[_0xaa9c('0x32')]);_0xe157a3[_0xaa9c('0x37')]=_[_0xaa9c('0x35')](_0xfbbed[_0xaa9c('0x36')],qs['fields'](_0x18163b[_0xaa9c('0x32')][_0xaa9c('0x38')]));_0xe157a3[_0xaa9c('0x37')]=_0xe157a3[_0xaa9c('0x37')][_0xaa9c('0x39')]?_0xe157a3[_0xaa9c('0x37')]:_0xfbbed[_0xaa9c('0x36')];if(!_0x18163b[_0xaa9c('0x32')][_0xaa9c('0x3a')](_0xaa9c('0x3b'))){_0xe157a3[_0xaa9c('0x1e')]=qs[_0xaa9c('0x1e')](_0x18163b[_0xaa9c('0x32')][_0xaa9c('0x1e')]);_0xe157a3['offset']=qs[_0xaa9c('0x1c')](_0x18163b[_0xaa9c('0x32')][_0xaa9c('0x1c')]);}_0xe157a3[_0xaa9c('0x3c')]=qs[_0xaa9c('0x3d')](_0x18163b[_0xaa9c('0x32')][_0xaa9c('0x3d')]);_0xe157a3[_0xaa9c('0x3e')]=qs[_0xaa9c('0x34')](_[_0xaa9c('0x3f')](_0x18163b[_0xaa9c('0x32')],_0xfbbed['filters']),_0x4e496b);if(_0x18163b[_0xaa9c('0x32')][_0xaa9c('0x40')]){_0xe157a3[_0xaa9c('0x3e')]=_[_0xaa9c('0x41')](_0xe157a3[_0xaa9c('0x3e')],{'$or':_[_0xaa9c('0x31')](_0x4e496b,function(_0x39d590){if(_0x39d590[_0xaa9c('0x2f')]!==_0xaa9c('0x42')){var _0x1aaf39={};_0x1aaf39[_0x39d590[_0xaa9c('0x2a')]]={'$like':'%'+_0x18163b[_0xaa9c('0x32')][_0xaa9c('0x40')]+'%'};return _0x1aaf39;}})});}_0xe157a3=_[_0xaa9c('0x41')]({},_0xe157a3,_0x18163b[_0xaa9c('0x43')]);var _0x1b631f={'where':_0xe157a3[_0xaa9c('0x3e')]};return db[_0xaa9c('0x2c')]['count'](_0x1b631f)[_0xaa9c('0x26')](function(_0x46137c){_0x16550c[_0xaa9c('0x1f')]=_0x46137c;if(_0x18163b[_0xaa9c('0x32')]['includeAll']){_0xe157a3['include']=[{'all':!![]}];}return db[_0xaa9c('0x2c')][_0xaa9c('0x44')](_0xe157a3);})['then'](function(_0x336323){_0x16550c[_0xaa9c('0x45')]=_0x336323;return _0x16550c;})[_0xaa9c('0x26')](respondWithFilteredResult(_0x3d13b7,_0xe157a3))[_0xaa9c('0x46')](handleError(_0x3d13b7,null));};exports[_0xaa9c('0x47')]=function(_0x1b7dd4,_0x30d98d){var _0x4b6cf5={'raw':!![],'where':{'id':_0x1b7dd4[_0xaa9c('0x48')]['id']}},_0x20c2c8={};_0x20c2c8[_0xaa9c('0x36')]=_[_0xaa9c('0x33')](db['SmsQueueReport'][_0xaa9c('0x2d')]);_0x20c2c8[_0xaa9c('0x32')]=_[_0xaa9c('0x33')](_0x1b7dd4['query']);_0x20c2c8[_0xaa9c('0x34')]=_['intersection'](_0x20c2c8['model'],_0x20c2c8[_0xaa9c('0x32')]);_0x4b6cf5[_0xaa9c('0x37')]=_[_0xaa9c('0x35')](_0x20c2c8[_0xaa9c('0x36')],qs[_0xaa9c('0x38')](_0x1b7dd4[_0xaa9c('0x32')][_0xaa9c('0x38')]));_0x4b6cf5[_0xaa9c('0x37')]=_0x4b6cf5[_0xaa9c('0x37')][_0xaa9c('0x39')]?_0x4b6cf5['attributes']:_0x20c2c8[_0xaa9c('0x36')];if(_0x1b7dd4[_0xaa9c('0x32')][_0xaa9c('0x49')]){_0x4b6cf5[_0xaa9c('0x4a')]=[{'all':!![]}];}_0x4b6cf5=_[_0xaa9c('0x41')]({},_0x4b6cf5,_0x1b7dd4['options']);return db[_0xaa9c('0x2c')][_0xaa9c('0x4b')](_0x4b6cf5)[_0xaa9c('0x26')](handleEntityNotFound(_0x30d98d,null))[_0xaa9c('0x26')](respondWithResult(_0x30d98d,null))[_0xaa9c('0x46')](handleError(_0x30d98d,null));};exports[_0xaa9c('0x4c')]=function(_0x2fa81e,_0x32a34a){return db[_0xaa9c('0x2c')][_0xaa9c('0x4c')](_0x2fa81e['body'],{})[_0xaa9c('0x26')](respondWithResult(_0x32a34a,0xc9))[_0xaa9c('0x46')](handleError(_0x32a34a,null));};exports[_0xaa9c('0x25')]=function(_0xde646e,_0x10c399){if(_0xde646e[_0xaa9c('0x4d')]['id']){delete _0xde646e['body']['id'];}return db[_0xaa9c('0x2c')][_0xaa9c('0x4b')]({'where':{'id':_0xde646e[_0xaa9c('0x48')]['id']}})[_0xaa9c('0x26')](handleEntityNotFound(_0x10c399,null))[_0xaa9c('0x26')](saveUpdates(_0xde646e['body'],null))[_0xaa9c('0x26')](respondWithResult(_0x10c399,null))[_0xaa9c('0x46')](handleError(_0x10c399,null));};exports[_0xaa9c('0x27')]=function(_0x11acb6,_0x5314d8){return db[_0xaa9c('0x2c')][_0xaa9c('0x4b')]({'where':{'id':_0x11acb6['params']['id']}})[_0xaa9c('0x26')](handleEntityNotFound(_0x5314d8,null))[_0xaa9c('0x26')](removeEntity(_0x5314d8,null))[_0xaa9c('0x46')](handleError(_0x5314d8,null));};exports[_0xaa9c('0x4e')]=function(_0x4da95f,_0x3e9b42){return db[_0xaa9c('0x2c')][_0xaa9c('0x4e')]()[_0xaa9c('0x26')](respondWithResult(_0x3e9b42,null))['catch'](handleError(_0x3e9b42,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 08a6ecf..2b484f6 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x2165af,_0xfa73d9){var _0x439f65=function(_0x4bcccd){while(--_0x4bcccd){_0x2165af['push'](_0x2165af['shift']());}};_0x439f65(++_0xfa73d9);}(_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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xe706,0xa3));var _0x6e70=function(_0x4a30b7,_0x3dabc8){_0x4a30b7=_0x4a30b7-0x0;var _0xe48f3c=_0xe706[_0x4a30b7];return _0xe48f3c;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b9d487b..d0aaffe 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 _0x32be=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','raw','UpdateSmsQueueReport','options','attributes','lodash','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x32be,0xd7));var _0xe32b=function(_0x2410e9,_0x6028ce){_0x2410e9=_0x2410e9-0x0;var _0x560eba=_0x32be[_0x2410e9];return _0x560eba;};'use strict';var _=require(_0xe32b('0x0'));var util=require('util');var moment=require(_0xe32b('0x1'));var BPromise=require(_0xe32b('0x2'));var rs=require(_0xe32b('0x3'));var fs=require('fs');var Redis=require(_0xe32b('0x4'));var db=require(_0xe32b('0x5'))['db'];var utils=require(_0xe32b('0x6'));var logger=require('../../config/logger')(_0xe32b('0x7'));var config=require('../../config/environment');var jayson=require(_0xe32b('0x8'));var client=jayson[_0xe32b('0x9')][_0xe32b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39ee2b,_0x3ec6ec,_0x51928b){return new BPromise(function(_0x37565a,_0x526830){return client['request'](_0x39ee2b,_0x51928b)[_0xe32b('0xb')](function(_0x5c9633){logger['info'](_0xe32b('0xc'),_0x3ec6ec,_0xe32b('0xd'));logger[_0xe32b('0xe')](_0xe32b('0xf'),_0x3ec6ec,_0xe32b('0xd'),JSON[_0xe32b('0x10')](_0x5c9633));if(_0x5c9633[_0xe32b('0x11')]){if(_0x5c9633[_0xe32b('0x11')][_0xe32b('0x12')]===0x1f4){logger[_0xe32b('0x11')](_0xe32b('0xc'),_0x3ec6ec,_0x5c9633[_0xe32b('0x11')][_0xe32b('0x13')]);return _0x526830(_0x5c9633['error'][_0xe32b('0x13')]);}logger[_0xe32b('0x11')](_0xe32b('0xc'),_0x3ec6ec,_0x5c9633[_0xe32b('0x11')][_0xe32b('0x13')]);return _0x37565a(_0x5c9633[_0xe32b('0x11')][_0xe32b('0x13')]);}else{logger[_0xe32b('0x14')](_0xe32b('0xc'),_0x3ec6ec,_0xe32b('0xd'));_0x37565a(_0x5c9633[_0xe32b('0x15')]['message']);}})[_0xe32b('0x16')](function(_0x3404ee){logger[_0xe32b('0x11')](_0xe32b('0xc'),_0x3ec6ec,_0x3404ee);_0x526830(_0x3404ee);});});}exports[_0xe32b('0x17')]=function(_0x115fd8){var _0x514b43=this;return new Promise(function(_0x6f8cdb,_0x36daa3){return db[_0xe32b('0x18')][_0xe32b('0x19')](_0x115fd8[_0xe32b('0x1a')],{'raw':_0x115fd8['options']?_0x115fd8['options'][_0xe32b('0x1b')]===undefined?!![]:![]:!![]})[_0xe32b('0xb')](function(_0x2329a9){logger['info'](_0xe32b('0x17'),_0x115fd8);logger['debug'](_0xe32b('0x17'),_0x115fd8,JSON[_0xe32b('0x10')](_0x2329a9));_0x6f8cdb(_0x2329a9);})['catch'](function(_0x562cb0){logger[_0xe32b('0x11')](_0xe32b('0x17'),_0x562cb0[_0xe32b('0x13')],_0x115fd8);_0x36daa3(_0x514b43[_0xe32b('0x11')](0x1f4,_0x562cb0['message']));});});};exports[_0xe32b('0x1c')]=function(_0x4c8a6a){var _0x8520f3=this;return new Promise(function(_0x43d773,_0x34d78e){return db[_0xe32b('0x18')]['update'](_0x4c8a6a[_0xe32b('0x1a')],{'raw':_0x4c8a6a[_0xe32b('0x1d')]?_0x4c8a6a['options'][_0xe32b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c8a6a['options']?_0x4c8a6a[_0xe32b('0x1d')]['where']||null:null,'attributes':_0x4c8a6a[_0xe32b('0x1d')]?_0x4c8a6a['options'][_0xe32b('0x1e')]||null:null,'limit':_0x4c8a6a[_0xe32b('0x1d')]?_0x4c8a6a[_0xe32b('0x1d')]['limit']||null:null})['then'](function(_0x5e0500){logger[_0xe32b('0x14')](_0xe32b('0x1c'),_0x4c8a6a);logger[_0xe32b('0xe')]('UpdateSmsQueueReport',_0x4c8a6a,JSON[_0xe32b('0x10')](_0x5e0500));_0x43d773(_0x5e0500);})[_0xe32b('0x16')](function(_0x5c00ec){logger[_0xe32b('0x11')]('UpdateSmsQueueReport',_0x5c00ec[_0xe32b('0x13')],_0x4c8a6a);_0x34d78e(_0x8520f3[_0xe32b('0x11')](0x1f4,_0x5c00ec[_0xe32b('0x13')]));});});}; \ No newline at end of file +var _0x886f=['create','body','options','raw','then','UpdateSmsQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport'];(function(_0x47744d,_0x386dd3){var _0x2a647f=function(_0x402a97){while(--_0x402a97){_0x47744d['push'](_0x47744d['shift']());}};_0x2a647f(++_0x386dd3);}(_0x886f,0xfe));var _0xf886=function(_0x3668cf,_0x5ba00f){_0x3668cf=_0x3668cf-0x0;var _0x31714e=_0x886f[_0x3668cf];return _0x31714e;};'use strict';var _=require(_0xf886('0x0'));var util=require(_0xf886('0x1'));var moment=require(_0xf886('0x2'));var BPromise=require(_0xf886('0x3'));var rs=require(_0xf886('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf886('0x5'))['db'];var utils=require(_0xf886('0x6'));var logger=require(_0xf886('0x7'))(_0xf886('0x8'));var config=require(_0xf886('0x9'));var jayson=require(_0xf886('0xa'));var client=jayson['client'][_0xf886('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3004c2,_0x4776ed,_0x35a70c){return new BPromise(function(_0x512825,_0x51e4e6){return client[_0xf886('0xc')](_0x3004c2,_0x35a70c)['then'](function(_0x5cb7b1){logger[_0xf886('0xd')](_0xf886('0xe'),_0x4776ed,_0xf886('0xf'));logger[_0xf886('0x10')](_0xf886('0x11'),_0x4776ed,_0xf886('0xf'),JSON[_0xf886('0x12')](_0x5cb7b1));if(_0x5cb7b1['error']){if(_0x5cb7b1[_0xf886('0x13')][_0xf886('0x14')]===0x1f4){logger[_0xf886('0x13')](_0xf886('0xe'),_0x4776ed,_0x5cb7b1[_0xf886('0x13')]['message']);return _0x51e4e6(_0x5cb7b1['error'][_0xf886('0x15')]);}logger[_0xf886('0x13')](_0xf886('0xe'),_0x4776ed,_0x5cb7b1[_0xf886('0x13')][_0xf886('0x15')]);return _0x512825(_0x5cb7b1[_0xf886('0x13')][_0xf886('0x15')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x4776ed,_0xf886('0xf'));_0x512825(_0x5cb7b1[_0xf886('0x16')]['message']);}})[_0xf886('0x17')](function(_0x250683){logger[_0xf886('0x13')](_0xf886('0xe'),_0x4776ed,_0x250683);_0x51e4e6(_0x250683);});});}exports[_0xf886('0x18')]=function(_0x6ce09a){var _0x2fe3da=this;return new Promise(function(_0x596b59,_0x1134f2){return db[_0xf886('0x19')][_0xf886('0x1a')](_0x6ce09a[_0xf886('0x1b')],{'raw':_0x6ce09a[_0xf886('0x1c')]?_0x6ce09a[_0xf886('0x1c')][_0xf886('0x1d')]===undefined?!![]:![]:!![]})[_0xf886('0x1e')](function(_0x4f737a){logger[_0xf886('0xd')](_0xf886('0x18'),_0x6ce09a);logger[_0xf886('0x10')]('CreateSmsQueueReport',_0x6ce09a,JSON[_0xf886('0x12')](_0x4f737a));_0x596b59(_0x4f737a);})[_0xf886('0x17')](function(_0x3b3ce0){logger['error'](_0xf886('0x18'),_0x3b3ce0[_0xf886('0x15')],_0x6ce09a);_0x1134f2(_0x2fe3da[_0xf886('0x13')](0x1f4,_0x3b3ce0['message']));});});};exports[_0xf886('0x1f')]=function(_0x52fb8d){var _0x177fd0=this;return new Promise(function(_0x52e8ab,_0x140e07){return db[_0xf886('0x19')][_0xf886('0x20')](_0x52fb8d[_0xf886('0x1b')],{'raw':_0x52fb8d[_0xf886('0x1c')]?_0x52fb8d[_0xf886('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52fb8d['options']?_0x52fb8d[_0xf886('0x1c')][_0xf886('0x21')]||null:null,'attributes':_0x52fb8d['options']?_0x52fb8d[_0xf886('0x1c')]['attributes']||null:null,'limit':_0x52fb8d['options']?_0x52fb8d[_0xf886('0x1c')][_0xf886('0x22')]||null:null})[_0xf886('0x1e')](function(_0x42608e){logger[_0xf886('0xd')](_0xf886('0x1f'),_0x52fb8d);logger[_0xf886('0x10')](_0xf886('0x1f'),_0x52fb8d,JSON[_0xf886('0x12')](_0x42608e));_0x52e8ab(_0x42608e);})[_0xf886('0x17')](function(_0x4331ad){logger[_0xf886('0x13')](_0xf886('0x1f'),_0x4331ad[_0xf886('0x15')],_0x52fb8d);_0x140e07(_0x177fd0[_0xf886('0x13')](0x1f4,_0x4331ad[_0xf886('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 26c1c74..09b5b26 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 _0x85d0=['../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x2db69f,_0x410e40){var _0x5c0e64=function(_0x445208){while(--_0x445208){_0x2db69f['push'](_0x2db69f['shift']());}};_0x5c0e64(++_0x410e40);}(_0x85d0,0x164));var _0x085d=function(_0x37085b,_0xce159e){_0x37085b=_0x37085b-0x0;var _0x1398f4=_0x85d0[_0x37085b];return _0x1398f4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x085d('0x0'));var router=express[_0x085d('0x1')]();var fs_extra=require(_0x085d('0x2'));var auth=require(_0x085d('0x3'));var interaction=require(_0x085d('0x4'));var config=require(_0x085d('0x5'));var controller=require('./smsTransferReport.controller');router[_0x085d('0x6')]('/',auth['isAuthenticated'](),controller[_0x085d('0x7')]);router[_0x085d('0x6')](_0x085d('0x8'),auth['isAuthenticated'](),controller[_0x085d('0x9')]);router[_0x085d('0x6')](_0x085d('0xa'),auth[_0x085d('0xb')](),controller[_0x085d('0xc')]);router[_0x085d('0xd')]('/',auth[_0x085d('0xb')](),controller[_0x085d('0xe')]);router[_0x085d('0xf')]('/:id',auth[_0x085d('0xb')](),controller[_0x085d('0x10')]);router[_0x085d('0x11')](_0x085d('0xa'),auth['isAuthenticated'](),controller[_0x085d('0x12')]);module[_0x085d('0x13')]=router; \ No newline at end of file +var _0x57d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x57d4,0x78));var _0x457d=function(_0x1380ba,_0x68aa9b){_0x1380ba=_0x1380ba-0x0;var _0x1236b2=_0x57d4[_0x1380ba];return _0x1236b2;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var fs_extra=require(_0x457d('0x5'));var auth=require(_0x457d('0x6'));var interaction=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var controller=require(_0x457d('0x9'));router[_0x457d('0xa')]('/',auth[_0x457d('0xb')](),controller[_0x457d('0xc')]);router['get'](_0x457d('0xd'),auth[_0x457d('0xb')](),controller['describe']);router['get'](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x457d('0x10')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x11')]);router[_0x457d('0x12')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x13')]);module[_0x457d('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 8b8d9be..b5ae76f 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xe5c04a,_0x42e424){var _0x9135b9=function(_0x4e2dbd){while(--_0x4e2dbd){_0xe5c04a['push'](_0xe5c04a['shift']());}};_0x9135b9(++_0x42e424);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0xcb91[_0x506172];return _0x2723c0;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5aa480,_0x4aad6c){_0x5aa480=_0x5aa480-0x0;var _0x3a7b64=_0x9bde[_0x5aa480];return _0x3a7b64;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index ef79bdd..ef623ac 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 _0x68c3=['where','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','show','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','error','name','send','map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort'];(function(_0xcc1ffc,_0x28a312){var _0x3d614b=function(_0x3f9e83){while(--_0x3f9e83){_0xcc1ffc['push'](_0xcc1ffc['shift']());}};_0x3d614b(++_0x28a312);}(_0x68c3,0xd9));var _0x368c=function(_0x40c601,_0x25997e){_0x40c601=_0x40c601-0x0;var _0x214a0=_0x68c3[_0x40c601];return _0x214a0;};'use strict';var emlformat=require(_0x368c('0x0'));var rimraf=require(_0x368c('0x1'));var zipdir=require(_0x368c('0x2'));var jsonpatch=require(_0x368c('0x3'));var rp=require(_0x368c('0x4'));var moment=require(_0x368c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x368c('0x6'));var path=require('path');var sox=require(_0x368c('0x7'));var csv=require(_0x368c('0x8'));var ejs=require(_0x368c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x368c('0xa'));var squel=require(_0x368c('0xb'));var crypto=require(_0x368c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x368c('0x8'));var querystring=require(_0x368c('0xd'));var Papa=require(_0x368c('0xe'));var Redis=require(_0x368c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x368c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x368c('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x368c('0x12'));var db=require(_0x368c('0x13'))['db'];function respondWithStatusCode(_0x3f08b2,_0x5d64d6){_0x5d64d6=_0x5d64d6||0xcc;return function(_0x2ec7de){if(_0x2ec7de){return _0x3f08b2[_0x368c('0x14')](_0x5d64d6);}return _0x3f08b2[_0x368c('0x15')](_0x5d64d6)[_0x368c('0x16')]();};}function respondWithResult(_0xd09931,_0x389d10){_0x389d10=_0x389d10||0xc8;return function(_0x362a1){if(_0x362a1){return _0xd09931['status'](_0x389d10)[_0x368c('0x17')](_0x362a1);}};}function respondWithFilteredResult(_0x13c9b2,_0x369ecd){return function(_0x5bd831){if(_0x5bd831){var _0x355597=typeof _0x369ecd[_0x368c('0x18')]==='undefined'&&typeof _0x369ecd['limit']===_0x368c('0x19');var _0xeb671c=_0x5bd831[_0x368c('0x1a')];var _0x203ed1=_0x355597?0x0:_0x369ecd[_0x368c('0x18')];var _0x44e201=_0x355597?_0x5bd831[_0x368c('0x1a')]:_0x369ecd['offset']+_0x369ecd[_0x368c('0x1b')];var _0x3619c1;if(_0x44e201>=_0xeb671c){_0x44e201=_0xeb671c;_0x3619c1=0xc8;}else{_0x3619c1=0xce;}_0x13c9b2[_0x368c('0x15')](_0x3619c1);return _0x13c9b2[_0x368c('0x1c')]('Content-Range',_0x203ed1+'-'+_0x44e201+'/'+_0xeb671c)[_0x368c('0x17')](_0x5bd831);}return null;};}function patchUpdates(_0x4dff33){return function(_0x178ce8){try{jsonpatch[_0x368c('0x1d')](_0x178ce8,_0x4dff33,!![]);}catch(_0x4799c9){return BPromise[_0x368c('0x1e')](_0x4799c9);}return _0x178ce8['save']();};}function saveUpdates(_0x5df510,_0x608817){return function(_0x49e83a){if(_0x49e83a){return _0x49e83a[_0x368c('0x1f')](_0x5df510)[_0x368c('0x20')](function(_0x5d4f9c){return _0x5d4f9c;});}return null;};}function removeEntity(_0xb96950,_0x3e3da5){return function(_0x1e3ffe){if(_0x1e3ffe){return _0x1e3ffe['destroy']()[_0x368c('0x20')](function(){_0xb96950['status'](0xcc)[_0x368c('0x16')]();});}};}function handleEntityNotFound(_0x24a611,_0x160072){return function(_0x17b74f){if(!_0x17b74f){_0x24a611[_0x368c('0x14')](0x194);}return _0x17b74f;};}function handleError(_0x2eb6b4,_0x53501b){_0x53501b=_0x53501b||0x1f4;return function(_0xd58e73){logger[_0x368c('0x21')](_0xd58e73['stack']);if(_0xd58e73[_0x368c('0x22')]){delete _0xd58e73[_0x368c('0x22')];}_0x2eb6b4[_0x368c('0x15')](_0x53501b)[_0x368c('0x23')](_0xd58e73);};}exports['index']=function(_0x7801e2,_0x55e702){var _0x2e5ef9={},_0x37d141={},_0x36491f={'count':0x0,'rows':[]};var _0x53823b=_[_0x368c('0x24')](db[_0x368c('0x25')][_0x368c('0x26')],function(_0x310ed6){return{'name':_0x310ed6[_0x368c('0x27')],'type':_0x310ed6['type'][_0x368c('0x28')]};});_0x37d141[_0x368c('0x29')]=_['map'](_0x53823b,_0x368c('0x22'));_0x37d141[_0x368c('0x2a')]=_[_0x368c('0x2b')](_0x7801e2[_0x368c('0x2a')]);_0x37d141[_0x368c('0x2c')]=_['intersection'](_0x37d141['model'],_0x37d141[_0x368c('0x2a')]);_0x2e5ef9[_0x368c('0x2d')]=_[_0x368c('0x2e')](_0x37d141[_0x368c('0x29')],qs[_0x368c('0x2f')](_0x7801e2[_0x368c('0x2a')]['fields']));_0x2e5ef9[_0x368c('0x2d')]=_0x2e5ef9[_0x368c('0x2d')]['length']?_0x2e5ef9[_0x368c('0x2d')]:_0x37d141[_0x368c('0x29')];if(!_0x7801e2[_0x368c('0x2a')][_0x368c('0x30')]('nolimit')){_0x2e5ef9[_0x368c('0x1b')]=qs['limit'](_0x7801e2['query'][_0x368c('0x1b')]);_0x2e5ef9[_0x368c('0x18')]=qs[_0x368c('0x18')](_0x7801e2[_0x368c('0x2a')]['offset']);}_0x2e5ef9[_0x368c('0x31')]=qs[_0x368c('0x32')](_0x7801e2[_0x368c('0x2a')]['sort']);_0x2e5ef9[_0x368c('0x33')]=qs[_0x368c('0x2c')](_[_0x368c('0x34')](_0x7801e2['query'],_0x37d141[_0x368c('0x2c')]),_0x53823b);if(_0x7801e2['query'][_0x368c('0x35')]){_0x2e5ef9[_0x368c('0x33')]=_[_0x368c('0x36')](_0x2e5ef9[_0x368c('0x33')],{'$or':_[_0x368c('0x24')](_0x53823b,function(_0x19e4d1){if(_0x19e4d1[_0x368c('0x37')]!==_0x368c('0x38')){var _0x1002b0={};_0x1002b0[_0x19e4d1[_0x368c('0x22')]]={'$like':'%'+_0x7801e2[_0x368c('0x2a')][_0x368c('0x35')]+'%'};return _0x1002b0;}})});}_0x2e5ef9=_['merge']({},_0x2e5ef9,_0x7801e2['options']);var _0x5e3776={'where':_0x2e5ef9['where']};return db[_0x368c('0x25')][_0x368c('0x1a')](_0x5e3776)[_0x368c('0x20')](function(_0x3507fa){_0x36491f['count']=_0x3507fa;if(_0x7801e2[_0x368c('0x2a')][_0x368c('0x39')]){_0x2e5ef9[_0x368c('0x3a')]=[{'all':!![]}];}return db[_0x368c('0x25')]['findAll'](_0x2e5ef9);})[_0x368c('0x20')](function(_0x50a789){_0x36491f['rows']=_0x50a789;return _0x36491f;})[_0x368c('0x20')](respondWithFilteredResult(_0x55e702,_0x2e5ef9))[_0x368c('0x3b')](handleError(_0x55e702,null));};exports[_0x368c('0x3c')]=function(_0x1d1210,_0x3df4a4){var _0x5b368e={'raw':!![],'where':{'id':_0x1d1210['params']['id']}},_0x24bfbd={};_0x24bfbd[_0x368c('0x29')]=_[_0x368c('0x2b')](db['SmsTransferReport'][_0x368c('0x26')]);_0x24bfbd['query']=_[_0x368c('0x2b')](_0x1d1210[_0x368c('0x2a')]);_0x24bfbd['filters']=_[_0x368c('0x2e')](_0x24bfbd[_0x368c('0x29')],_0x24bfbd[_0x368c('0x2a')]);_0x5b368e['attributes']=_[_0x368c('0x2e')](_0x24bfbd[_0x368c('0x29')],qs[_0x368c('0x2f')](_0x1d1210['query'][_0x368c('0x2f')]));_0x5b368e[_0x368c('0x2d')]=_0x5b368e['attributes']['length']?_0x5b368e[_0x368c('0x2d')]:_0x24bfbd[_0x368c('0x29')];if(_0x1d1210['query']['includeAll']){_0x5b368e['include']=[{'all':!![]}];}_0x5b368e=_[_0x368c('0x36')]({},_0x5b368e,_0x1d1210[_0x368c('0x3d')]);return db['SmsTransferReport']['find'](_0x5b368e)[_0x368c('0x20')](handleEntityNotFound(_0x3df4a4,null))[_0x368c('0x20')](respondWithResult(_0x3df4a4,null))[_0x368c('0x3b')](handleError(_0x3df4a4,null));};exports[_0x368c('0x3e')]=function(_0x2775e7,_0x24c37a){return db[_0x368c('0x25')][_0x368c('0x3e')](_0x2775e7[_0x368c('0x3f')],{})['then'](respondWithResult(_0x24c37a,0xc9))[_0x368c('0x3b')](handleError(_0x24c37a,null));};exports[_0x368c('0x1f')]=function(_0x2b9b28,_0x5773ae){if(_0x2b9b28[_0x368c('0x3f')]['id']){delete _0x2b9b28[_0x368c('0x3f')]['id'];}return db[_0x368c('0x25')][_0x368c('0x40')]({'where':{'id':_0x2b9b28[_0x368c('0x41')]['id']}})['then'](handleEntityNotFound(_0x5773ae,null))['then'](saveUpdates(_0x2b9b28[_0x368c('0x3f')],null))[_0x368c('0x20')](respondWithResult(_0x5773ae,null))[_0x368c('0x3b')](handleError(_0x5773ae,null));};exports['destroy']=function(_0x4dd90d,_0x13cabc){return db[_0x368c('0x25')][_0x368c('0x40')]({'where':{'id':_0x4dd90d[_0x368c('0x41')]['id']}})[_0x368c('0x20')](handleEntityNotFound(_0x13cabc,null))[_0x368c('0x20')](removeEntity(_0x13cabc,null))[_0x368c('0x3b')](handleError(_0x13cabc,null));};exports[_0x368c('0x42')]=function(_0x321edb,_0x2bbbb4){return db[_0x368c('0x25')][_0x368c('0x42')]()[_0x368c('0x20')](respondWithResult(_0x2bbbb4,null))[_0x368c('0x3b')](handleError(_0x2bbbb4,null));}; \ No newline at end of file +var _0xba5a=['filters','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','length','include','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','stack','name','index','map','SmsTransferReport','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x3eb498,_0x1cdc12){var _0x327f69=function(_0x17953c){while(--_0x17953c){_0x3eb498['push'](_0x3eb498['shift']());}};_0x327f69(++_0x1cdc12);}(_0xba5a,0xe7));var _0xaba5=function(_0x31e94f,_0x42ecd6){_0x31e94f=_0x31e94f-0x0;var _0x1b8494=_0xba5a[_0x31e94f];return _0x1b8494;};'use strict';var emlformat=require(_0xaba5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaba5('0x1'));var jsonpatch=require(_0xaba5('0x2'));var rp=require(_0xaba5('0x3'));var moment=require(_0xaba5('0x4'));var BPromise=require(_0xaba5('0x5'));var Mustache=require(_0xaba5('0x6'));var util=require(_0xaba5('0x7'));var path=require(_0xaba5('0x8'));var sox=require(_0xaba5('0x9'));var csv=require(_0xaba5('0xa'));var ejs=require(_0xaba5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaba5('0xc'));var squel=require('squel');var crypto=require(_0xaba5('0xd'));var jsforce=require(_0xaba5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaba5('0xa'));var querystring=require(_0xaba5('0xf'));var Papa=require(_0xaba5('0x10'));var Redis=require(_0xaba5('0x11'));var authService=require(_0xaba5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaba5('0x13'));var hardwareService=require(_0xaba5('0x14'));var logger=require('../../config/logger')(_0xaba5('0x15'));var utils=require(_0xaba5('0x16'));var config=require(_0xaba5('0x17'));var licenseUtil=require(_0xaba5('0x18'));var db=require(_0xaba5('0x19'))['db'];function respondWithStatusCode(_0x252509,_0x11b247){_0x11b247=_0x11b247||0xcc;return function(_0x46895a){if(_0x46895a){return _0x252509[_0xaba5('0x1a')](_0x11b247);}return _0x252509['status'](_0x11b247)[_0xaba5('0x1b')]();};}function respondWithResult(_0x11f85c,_0x3d12d5){_0x3d12d5=_0x3d12d5||0xc8;return function(_0x5b5c0c){if(_0x5b5c0c){return _0x11f85c['status'](_0x3d12d5)[_0xaba5('0x1c')](_0x5b5c0c);}};}function respondWithFilteredResult(_0x318f7d,_0x10061a){return function(_0x5bcbee){if(_0x5bcbee){var _0x34fb2a=typeof _0x10061a['offset']===_0xaba5('0x1d')&&typeof _0x10061a['limit']==='undefined';var _0x54cf38=_0x5bcbee[_0xaba5('0x1e')];var _0x746f00=_0x34fb2a?0x0:_0x10061a[_0xaba5('0x1f')];var _0x30b1bc=_0x34fb2a?_0x5bcbee[_0xaba5('0x1e')]:_0x10061a[_0xaba5('0x1f')]+_0x10061a[_0xaba5('0x20')];var _0x46be58;if(_0x30b1bc>=_0x54cf38){_0x30b1bc=_0x54cf38;_0x46be58=0xc8;}else{_0x46be58=0xce;}_0x318f7d[_0xaba5('0x21')](_0x46be58);return _0x318f7d[_0xaba5('0x22')](_0xaba5('0x23'),_0x746f00+'-'+_0x30b1bc+'/'+_0x54cf38)[_0xaba5('0x1c')](_0x5bcbee);}return null;};}function patchUpdates(_0x5d80ad){return function(_0x3dd0f9){try{jsonpatch['apply'](_0x3dd0f9,_0x5d80ad,!![]);}catch(_0x363b2c){return BPromise[_0xaba5('0x24')](_0x363b2c);}return _0x3dd0f9[_0xaba5('0x25')]();};}function saveUpdates(_0x1b1893,_0x14a450){return function(_0x11eaf5){if(_0x11eaf5){return _0x11eaf5[_0xaba5('0x26')](_0x1b1893)[_0xaba5('0x27')](function(_0x1ab071){return _0x1ab071;});}return null;};}function removeEntity(_0x29db35,_0x3fe752){return function(_0x9fcdf8){if(_0x9fcdf8){return _0x9fcdf8[_0xaba5('0x28')]()[_0xaba5('0x27')](function(){_0x29db35[_0xaba5('0x21')](0xcc)[_0xaba5('0x1b')]();});}};}function handleEntityNotFound(_0x2bc92d,_0x546555){return function(_0x35a61f){if(!_0x35a61f){_0x2bc92d['sendStatus'](0x194);}return _0x35a61f;};}function handleError(_0x204c3b,_0x1ec04d){_0x1ec04d=_0x1ec04d||0x1f4;return function(_0x32099c){logger['error'](_0x32099c[_0xaba5('0x29')]);if(_0x32099c[_0xaba5('0x2a')]){delete _0x32099c['name'];}_0x204c3b[_0xaba5('0x21')](_0x1ec04d)['send'](_0x32099c);};}exports[_0xaba5('0x2b')]=function(_0x549dd4,_0x150249){var _0x38dd72={},_0x54b75c={},_0x41f0a6={'count':0x0,'rows':[]};var _0x5ae46a=_[_0xaba5('0x2c')](db[_0xaba5('0x2d')]['rawAttributes'],function(_0x3cd57d){return{'name':_0x3cd57d['fieldName'],'type':_0x3cd57d[_0xaba5('0x2e')]['key']};});_0x54b75c[_0xaba5('0x2f')]=_[_0xaba5('0x2c')](_0x5ae46a,_0xaba5('0x2a'));_0x54b75c[_0xaba5('0x30')]=_[_0xaba5('0x31')](_0x549dd4['query']);_0x54b75c['filters']=_[_0xaba5('0x32')](_0x54b75c[_0xaba5('0x2f')],_0x54b75c[_0xaba5('0x30')]);_0x38dd72[_0xaba5('0x33')]=_[_0xaba5('0x32')](_0x54b75c[_0xaba5('0x2f')],qs[_0xaba5('0x34')](_0x549dd4[_0xaba5('0x30')][_0xaba5('0x34')]));_0x38dd72[_0xaba5('0x33')]=_0x38dd72[_0xaba5('0x33')]['length']?_0x38dd72[_0xaba5('0x33')]:_0x54b75c[_0xaba5('0x2f')];if(!_0x549dd4['query'][_0xaba5('0x35')](_0xaba5('0x36'))){_0x38dd72[_0xaba5('0x20')]=qs[_0xaba5('0x20')](_0x549dd4[_0xaba5('0x30')][_0xaba5('0x20')]);_0x38dd72[_0xaba5('0x1f')]=qs[_0xaba5('0x1f')](_0x549dd4['query'][_0xaba5('0x1f')]);}_0x38dd72['order']=qs['sort'](_0x549dd4[_0xaba5('0x30')][_0xaba5('0x37')]);_0x38dd72[_0xaba5('0x38')]=qs[_0xaba5('0x39')](_['pick'](_0x549dd4[_0xaba5('0x30')],_0x54b75c[_0xaba5('0x39')]),_0x5ae46a);if(_0x549dd4[_0xaba5('0x30')][_0xaba5('0x3a')]){_0x38dd72[_0xaba5('0x38')]=_[_0xaba5('0x3b')](_0x38dd72[_0xaba5('0x38')],{'$or':_[_0xaba5('0x2c')](_0x5ae46a,function(_0x4047e8){if(_0x4047e8[_0xaba5('0x2e')]!==_0xaba5('0x3c')){var _0x214097={};_0x214097[_0x4047e8[_0xaba5('0x2a')]]={'$like':'%'+_0x549dd4['query'][_0xaba5('0x3a')]+'%'};return _0x214097;}})});}_0x38dd72=_[_0xaba5('0x3b')]({},_0x38dd72,_0x549dd4[_0xaba5('0x3d')]);var _0xfa337a={'where':_0x38dd72[_0xaba5('0x38')]};return db[_0xaba5('0x2d')][_0xaba5('0x1e')](_0xfa337a)[_0xaba5('0x27')](function(_0x3ee0a0){_0x41f0a6['count']=_0x3ee0a0;if(_0x549dd4[_0xaba5('0x30')][_0xaba5('0x3e')]){_0x38dd72['include']=[{'all':!![]}];}return db[_0xaba5('0x2d')][_0xaba5('0x3f')](_0x38dd72);})[_0xaba5('0x27')](function(_0x3e429f){_0x41f0a6['rows']=_0x3e429f;return _0x41f0a6;})[_0xaba5('0x27')](respondWithFilteredResult(_0x150249,_0x38dd72))[_0xaba5('0x40')](handleError(_0x150249,null));};exports[_0xaba5('0x41')]=function(_0x3cbc74,_0x5269f8){var _0x4c4b3a={'raw':!![],'where':{'id':_0x3cbc74[_0xaba5('0x42')]['id']}},_0x58ed60={};_0x58ed60[_0xaba5('0x2f')]=_['keys'](db[_0xaba5('0x2d')]['rawAttributes']);_0x58ed60[_0xaba5('0x30')]=_[_0xaba5('0x31')](_0x3cbc74[_0xaba5('0x30')]);_0x58ed60[_0xaba5('0x39')]=_[_0xaba5('0x32')](_0x58ed60[_0xaba5('0x2f')],_0x58ed60[_0xaba5('0x30')]);_0x4c4b3a['attributes']=_[_0xaba5('0x32')](_0x58ed60[_0xaba5('0x2f')],qs['fields'](_0x3cbc74[_0xaba5('0x30')][_0xaba5('0x34')]));_0x4c4b3a[_0xaba5('0x33')]=_0x4c4b3a['attributes'][_0xaba5('0x43')]?_0x4c4b3a[_0xaba5('0x33')]:_0x58ed60['model'];if(_0x3cbc74[_0xaba5('0x30')][_0xaba5('0x3e')]){_0x4c4b3a[_0xaba5('0x44')]=[{'all':!![]}];}_0x4c4b3a=_['merge']({},_0x4c4b3a,_0x3cbc74[_0xaba5('0x3d')]);return db[_0xaba5('0x2d')][_0xaba5('0x45')](_0x4c4b3a)[_0xaba5('0x27')](handleEntityNotFound(_0x5269f8,null))[_0xaba5('0x27')](respondWithResult(_0x5269f8,null))[_0xaba5('0x40')](handleError(_0x5269f8,null));};exports['create']=function(_0x2c0f9d,_0x2c6f5d){return db['SmsTransferReport']['create'](_0x2c0f9d[_0xaba5('0x46')],{})[_0xaba5('0x27')](respondWithResult(_0x2c6f5d,0xc9))[_0xaba5('0x40')](handleError(_0x2c6f5d,null));};exports[_0xaba5('0x26')]=function(_0xe67e60,_0xd9486d){if(_0xe67e60[_0xaba5('0x46')]['id']){delete _0xe67e60[_0xaba5('0x46')]['id'];}return db[_0xaba5('0x2d')][_0xaba5('0x45')]({'where':{'id':_0xe67e60[_0xaba5('0x42')]['id']}})[_0xaba5('0x27')](handleEntityNotFound(_0xd9486d,null))[_0xaba5('0x27')](saveUpdates(_0xe67e60[_0xaba5('0x46')],null))[_0xaba5('0x27')](respondWithResult(_0xd9486d,null))[_0xaba5('0x40')](handleError(_0xd9486d,null));};exports[_0xaba5('0x28')]=function(_0x5057e2,_0x46c434){return db[_0xaba5('0x2d')][_0xaba5('0x45')]({'where':{'id':_0x5057e2[_0xaba5('0x42')]['id']}})[_0xaba5('0x27')](handleEntityNotFound(_0x46c434,null))[_0xaba5('0x27')](removeEntity(_0x46c434,null))[_0xaba5('0x40')](handleError(_0x46c434,null));};exports[_0xaba5('0x47')]=function(_0x32189b,_0x1abfe6){return db['SmsTransferReport'][_0xaba5('0x47')]()[_0xaba5('0x27')](respondWithResult(_0x1abfe6,null))['catch'](handleError(_0x1abfe6,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index f369f8d..50f594c 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 _0x25b4=['api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger'];(function(_0x31774e,_0x2588cd){var _0x5c1e16=function(_0x38ac65){while(--_0x38ac65){_0x31774e['push'](_0x31774e['shift']());}};_0x5c1e16(++_0x2588cd);}(_0x25b4,0x1ab));var _0x425b=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x25b4[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0x425b('0x0'));var util=require('util');var logger=require(_0x425b('0x1'))(_0x425b('0x2'));var moment=require(_0x425b('0x3'));var BPromise=require(_0x425b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x425b('0x5'));var rimraf=require(_0x425b('0x6'));var config=require(_0x425b('0x7'));var attributes=require(_0x425b('0x8'));module['exports']=function(_0x27e02e,_0x1e22e4){return _0x27e02e[_0x425b('0x9')](_0x425b('0xa'),attributes,{'tableName':_0x425b('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x425b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x234a=['util','../../config/logger','api','moment','bluebird','path','rimraf','./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x234a,0xa7));var _0xa234=function(_0x11503f,_0x30de86){_0x11503f=_0x11503f-0x0;var _0x34caab=_0x234a[_0x11503f];return _0x34caab;};'use strict';var _=require(_0xa234('0x0'));var util=require(_0xa234('0x1'));var logger=require(_0xa234('0x2'))(_0xa234('0x3'));var moment=require(_0xa234('0x4'));var BPromise=require(_0xa234('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa234('0x6'));var rimraf=require(_0xa234('0x7'));var config=require('../../config/environment');var attributes=require(_0xa234('0x8'));module[_0xa234('0x9')]=function(_0x3254ba,_0x288d65){return _0x3254ba['define'](_0xa234('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa234('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 7a1b237..7000056 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 _0xc569=['then','request\x20sent','debug','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xc569,0x159));var _0x9c56=function(_0x1a2d27,_0x5b277b){_0x1a2d27=_0x1a2d27-0x0;var _0x5ef5c6=_0xc569[_0x1a2d27];return _0x5ef5c6;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var moment=require(_0x9c56('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c56('0x3'));var fs=require('fs');var Redis=require(_0x9c56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c56('0x5'));var logger=require(_0x9c56('0x6'))(_0x9c56('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c56('0x8'));var client=jayson[_0x9c56('0x9')][_0x9c56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38a9cf,_0x564e30,_0x15206f){return new BPromise(function(_0xaba9c7,_0x35baa0){return client[_0x9c56('0xb')](_0x38a9cf,_0x15206f)[_0x9c56('0xc')](function(_0x582e29){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x564e30,_0x9c56('0xd'));logger[_0x9c56('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x564e30,_0x9c56('0xd'),JSON['stringify'](_0x582e29));if(_0x582e29[_0x9c56('0xf')]){if(_0x582e29[_0x9c56('0xf')][_0x9c56('0x10')]===0x1f4){logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x582e29[_0x9c56('0xf')][_0x9c56('0x12')]);return _0x35baa0(_0x582e29['error'][_0x9c56('0x12')]);}logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x582e29[_0x9c56('0xf')][_0x9c56('0x12')]);return _0xaba9c7(_0x582e29['error'][_0x9c56('0x12')]);}else{logger['info'](_0x9c56('0x11'),_0x564e30,_0x9c56('0xd'));_0xaba9c7(_0x582e29[_0x9c56('0x13')][_0x9c56('0x12')]);}})[_0x9c56('0x14')](function(_0x20467d){logger[_0x9c56('0xf')](_0x9c56('0x11'),_0x564e30,_0x20467d);_0x35baa0(_0x20467d);});});} \ No newline at end of file +var _0x8ba0=['rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ba0,0x1c7));var _0x08ba=function(_0xa09326,_0x647a6f){_0xa09326=_0xa09326-0x0;var _0x77a41b=_0x8ba0[_0xa09326];return _0x77a41b;};'use strict';var _=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var moment=require(_0x08ba('0x2'));var BPromise=require(_0x08ba('0x3'));var rs=require(_0x08ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x08ba('0x5'));var logger=require(_0x08ba('0x6'))(_0x08ba('0x7'));var config=require(_0x08ba('0x8'));var jayson=require(_0x08ba('0x9'));var client=jayson[_0x08ba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x235354,_0x11f6a1,_0x37bcdf){return new BPromise(function(_0x451f15,_0x1f6051){return client['request'](_0x235354,_0x37bcdf)[_0x08ba('0xb')](function(_0x5eb94f){logger[_0x08ba('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x11f6a1,_0x08ba('0xd'));logger[_0x08ba('0xe')](_0x08ba('0xf'),_0x11f6a1,_0x08ba('0xd'),JSON[_0x08ba('0x10')](_0x5eb94f));if(_0x5eb94f[_0x08ba('0x11')]){if(_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x12')]===0x1f4){logger[_0x08ba('0x11')](_0x08ba('0x13'),_0x11f6a1,_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x14')]);return _0x1f6051(_0x5eb94f['error'][_0x08ba('0x14')]);}logger[_0x08ba('0x11')](_0x08ba('0x13'),_0x11f6a1,_0x5eb94f[_0x08ba('0x11')][_0x08ba('0x14')]);return _0x451f15(_0x5eb94f[_0x08ba('0x11')]['message']);}else{logger[_0x08ba('0xc')](_0x08ba('0x13'),_0x11f6a1,_0x08ba('0xd'));_0x451f15(_0x5eb94f[_0x08ba('0x15')][_0x08ba('0x14')]);}})['catch'](function(_0x4b5a04){logger[_0x08ba('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x11f6a1,_0x4b5a04);_0x1f6051(_0x4b5a04);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 737fc3f..c533eac 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 _0x0b0c=['show','/:id/download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','file','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x0b0c,0xc5));var _0xc0b0=function(_0x4c6f44,_0x413a03){_0x4c6f44=_0x4c6f44-0x0;var _0x5ee4b9=_0x0b0c[_0x4c6f44];return _0x5ee4b9;};'use strict';var multer=require(_0xc0b0('0x0'));var util=require(_0xc0b0('0x1'));var path=require(_0xc0b0('0x2'));var timeout=require(_0xc0b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc0b0('0x4'));var auth=require(_0xc0b0('0x5'));var interaction=require(_0xc0b0('0x6'));var config=require(_0xc0b0('0x7'));var controller=require(_0xc0b0('0x8'));router[_0xc0b0('0x9')]('/',auth[_0xc0b0('0xa')](),controller[_0xc0b0('0xb')]);router[_0xc0b0('0x9')](_0xc0b0('0xc'),auth[_0xc0b0('0xa')](),controller[_0xc0b0('0xd')]);router[_0xc0b0('0x9')](_0xc0b0('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x132b6b,_0x10dc99,_0x36ae40){_0x36ae40(null,path[_0xc0b0('0xf')](config[_0xc0b0('0x10')],_0xc0b0('0x11')));},'filename':function(_0x256da8,_0xe27430,_0x98e23c){_0xe27430[_0xc0b0('0x12')]=_0xe27430[_0xc0b0('0x12')][_0xc0b0('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x98e23c(null,util[_0xc0b0('0x14')](_0xc0b0('0x15'),path['basename'](_0xe27430['originalname'],path[_0xc0b0('0x16')](_0xe27430[_0xc0b0('0x12')])),Date[_0xc0b0('0x17')](),path['extname'](_0xe27430[_0xc0b0('0x12')])));}})});router['post']('/',upload['single'](_0xc0b0('0x18')),controller[_0xc0b0('0x19')]);router[_0xc0b0('0x1a')](_0xc0b0('0xc'),auth['isAuthenticated'](),controller[_0xc0b0('0x1b')]);router[_0xc0b0('0x1c')](_0xc0b0('0xc'),auth[_0xc0b0('0xa')](),controller[_0xc0b0('0x1c')]);module[_0xc0b0('0x1d')]=router; \ No newline at end of file +var _0x7d46=['extname','post','single','file','put','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now'];(function(_0x42c70d,_0x5e7638){var _0x99fb81=function(_0x10dbf5){while(--_0x10dbf5){_0x42c70d['push'](_0x42c70d['shift']());}};_0x99fb81(++_0x5e7638);}(_0x7d46,0x193));var _0x67d4=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x7d46[_0x368bba];return _0x409f8f;};'use strict';var multer=require(_0x67d4('0x0'));var util=require(_0x67d4('0x1'));var path=require(_0x67d4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x67d4('0x3')]();var fs_extra=require(_0x67d4('0x4'));var auth=require(_0x67d4('0x5'));var interaction=require(_0x67d4('0x6'));var config=require(_0x67d4('0x7'));var controller=require(_0x67d4('0x8'));router[_0x67d4('0x9')]('/',auth[_0x67d4('0xa')](),controller[_0x67d4('0xb')]);router['get'](_0x67d4('0xc'),auth[_0x67d4('0xa')](),controller[_0x67d4('0xd')]);router['get'](_0x67d4('0xe'),auth[_0x67d4('0xa')](),controller[_0x67d4('0xf')]);var upload=multer({'storage':multer[_0x67d4('0x10')]({'destination':function(_0x5f38fe,_0x4702eb,_0x45dd4d){_0x45dd4d(null,path[_0x67d4('0x11')](config[_0x67d4('0x12')],_0x67d4('0x13')));},'filename':function(_0x2711bc,_0x5e014d,_0x5a6167){_0x5e014d[_0x67d4('0x14')]=_0x5e014d[_0x67d4('0x14')][_0x67d4('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a6167(null,util[_0x67d4('0x16')](_0x67d4('0x17'),path[_0x67d4('0x18')](_0x5e014d[_0x67d4('0x14')],path['extname'](_0x5e014d[_0x67d4('0x14')])),Date[_0x67d4('0x19')](),path[_0x67d4('0x1a')](_0x5e014d[_0x67d4('0x14')])));}})});router[_0x67d4('0x1b')]('/',upload[_0x67d4('0x1c')](_0x67d4('0x1d')),controller['create']);router[_0x67d4('0x1e')](_0x67d4('0xc'),auth[_0x67d4('0xa')](),controller[_0x67d4('0x1f')]);router['delete'](_0x67d4('0xc'),auth[_0x67d4('0xa')](),controller['delete']);module[_0x67d4('0x20')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 6baef6e..f518586 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 _0xa0f8=['FLOAT','INTEGER','BIGINT','sequelize','STRING','name'];(function(_0x4483b5,_0x192c27){var _0xce017c=function(_0x7ae1e6){while(--_0x7ae1e6){_0x4483b5['push'](_0x4483b5['shift']());}};_0xce017c(++_0x192c27);}(_0xa0f8,0x1ef));var _0x8a0f=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0xa0f8[_0x27eda0];return _0x2b63a5;};'use strict';var Sequelize=require(_0x8a0f('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a0f('0x1')],'unique':_0x8a0f('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8a0f('0x1')]},'display_name':{'type':Sequelize[_0x8a0f('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x8a0f('0x1')]},'original_format':{'type':Sequelize[_0x8a0f('0x1')]},'original_duration':{'type':Sequelize[_0x8a0f('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x8a0f('0x4')]},'original_bitRate':{'type':Sequelize[_0x8a0f('0x5')]},'original_sampleRate':{'type':Sequelize[_0x8a0f('0x4')]},'converted_format':{'type':Sequelize[_0x8a0f('0x1')]},'converted_duration':{'type':Sequelize[_0x8a0f('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x8a0f('0x5')]},'converted_channelCount':{'type':Sequelize[_0x8a0f('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x8a0f('0x4')]}}; \ No newline at end of file +var _0xd639=['BIGINT','INTEGER','exports','STRING','name','FLOAT'];(function(_0x4f0356,_0x4b3263){var _0xe9abb8=function(_0x43d6fa){while(--_0x43d6fa){_0x4f0356['push'](_0x4f0356['shift']());}};_0xe9abb8(++_0x4b3263);}(_0xd639,0x1c4));var _0x9d63=function(_0x2dc93d,_0x2b61f4){_0x2dc93d=_0x2dc93d-0x0;var _0x1274e0=_0xd639[_0x2dc93d];return _0x1274e0;};'use strict';var Sequelize=require('sequelize');module[_0x9d63('0x0')]={'name':{'type':Sequelize[_0x9d63('0x1')],'unique':_0x9d63('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x9d63('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x9d63('0x1')]},'original_duration':{'type':Sequelize[_0x9d63('0x3')]},'original_sampleCount':{'type':Sequelize[_0x9d63('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x9d63('0x4')]},'original_sampleRate':{'type':Sequelize[_0x9d63('0x5')]},'converted_format':{'type':Sequelize[_0x9d63('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x9d63('0x4')]},'converted_channelCount':{'type':Sequelize[_0x9d63('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x9d63('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a0bd71f..6d1f4cb 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 _0xd892=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','set','Content-Range','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','offset','order','sort','where','pick','filter','merge','options','Sound','includeAll','include','rows','catch','params','rawAttributes','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','download','format','%s.%s','create','file','originalname','extname','filename','substring','server/files/sounds/original','basename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','sampleRate','dest','converted_duration','converted_bitRate','bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','start','description','delete','original_format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5c3ea5,_0xa9ed0c){var _0x102b61=function(_0xafb4a3){while(--_0xafb4a3){_0x5c3ea5['push'](_0x5c3ea5['shift']());}};_0x102b61(++_0xa9ed0c);}(_0xd892,0x1df));var _0x2d89=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xd892[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0x2d89('0x0'));var rimraf=require(_0x2d89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2d89('0x2'));var moment=require(_0x2d89('0x3'));var BPromise=require(_0x2d89('0x4'));var Mustache=require(_0x2d89('0x5'));var util=require(_0x2d89('0x6'));var path=require(_0x2d89('0x7'));var sox=require('sox');var csv=require(_0x2d89('0x8'));var ejs=require(_0x2d89('0x9'));var fs=require('fs');var fs_extra=require(_0x2d89('0xa'));var _=require(_0x2d89('0xb'));var squel=require(_0x2d89('0xc'));var crypto=require(_0x2d89('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2d89('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2d89('0xf'));var Papa=require(_0x2d89('0x10'));var Redis=require(_0x2d89('0x11'));var authService=require(_0x2d89('0x12'));var qs=require(_0x2d89('0x13'));var as=require(_0x2d89('0x14'));var hardwareService=require(_0x2d89('0x15'));var logger=require(_0x2d89('0x16'))(_0x2d89('0x17'));var utils=require(_0x2d89('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2d89('0x19'));var db=require(_0x2d89('0x1a'))['db'];function respondWithStatusCode(_0xc19a4b,_0x168dc0){_0x168dc0=_0x168dc0||0xcc;return function(_0x2f3c6b){if(_0x2f3c6b){return _0xc19a4b[_0x2d89('0x1b')](_0x168dc0);}return _0xc19a4b[_0x2d89('0x1c')](_0x168dc0)[_0x2d89('0x1d')]();};}function respondWithResult(_0x7f9d6c,_0xec8f9b){_0xec8f9b=_0xec8f9b||0xc8;return function(_0x42e512){if(_0x42e512){return _0x7f9d6c[_0x2d89('0x1c')](_0xec8f9b)[_0x2d89('0x1e')](_0x42e512);}};}function respondWithFilteredResult(_0x526a01,_0x2a63a7){return function(_0x1c69b4){if(_0x1c69b4){var _0x4eb47d=typeof _0x2a63a7['offset']==='undefined'&&typeof _0x2a63a7['limit']===_0x2d89('0x1f');var _0x19aa03=_0x1c69b4[_0x2d89('0x20')];var _0x3122db=_0x4eb47d?0x0:_0x2a63a7['offset'];var _0x361bf6=_0x4eb47d?_0x1c69b4[_0x2d89('0x20')]:_0x2a63a7['offset']+_0x2a63a7['limit'];var _0x52d19a;if(_0x361bf6>=_0x19aa03){_0x361bf6=_0x19aa03;_0x52d19a=0xc8;}else{_0x52d19a=0xce;}_0x526a01['status'](_0x52d19a);return _0x526a01[_0x2d89('0x21')](_0x2d89('0x22'),_0x3122db+'-'+_0x361bf6+'/'+_0x19aa03)['json'](_0x1c69b4);}return null;};}function patchUpdates(_0x42b773){return function(_0x2f2a51){try{jsonpatch['apply'](_0x2f2a51,_0x42b773,!![]);}catch(_0x23c508){return BPromise['reject'](_0x23c508);}return _0x2f2a51[_0x2d89('0x23')]();};}function saveUpdates(_0x1fd533,_0x19a848){return function(_0x93ae2b){if(_0x93ae2b){return _0x93ae2b[_0x2d89('0x24')](_0x1fd533)[_0x2d89('0x25')](function(_0x18d7bf){return _0x18d7bf;});}return null;};}function removeEntity(_0x392a23,_0x4aaa84){return function(_0x2a2c08){if(_0x2a2c08){return _0x2a2c08[_0x2d89('0x26')]()[_0x2d89('0x25')](function(){var _0x58dcd0=_0x2a2c08['get']({'plain':!![]});var _0x467970=_0x2d89('0x27');return db[_0x2d89('0x28')]['destroy']({'where':{'type':_0x467970,'resourceId':_0x58dcd0['id']}})[_0x2d89('0x25')](function(){return _0x2a2c08;});})[_0x2d89('0x25')](function(){_0x392a23[_0x2d89('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x82616b,_0xa05201){return function(_0x13fa11){if(!_0x13fa11){_0x82616b[_0x2d89('0x1b')](0x194);}return _0x13fa11;};}function handleError(_0x34c97e,_0x4b1fff){_0x4b1fff=_0x4b1fff||0x1f4;return function(_0x5a2680){logger[_0x2d89('0x29')](_0x5a2680[_0x2d89('0x2a')]);if(_0x5a2680[_0x2d89('0x2b')]){delete _0x5a2680[_0x2d89('0x2b')];}_0x34c97e[_0x2d89('0x1c')](_0x4b1fff)[_0x2d89('0x2c')](_0x5a2680);};}exports[_0x2d89('0x2d')]=function(_0x539c18,_0x39a0c8){var _0x232c05={},_0x12fb83={},_0x3b5f21={'count':0x0,'rows':[]};var _0x991585=_['map'](db['Sound']['rawAttributes'],function(_0x4d98af){return{'name':_0x4d98af[_0x2d89('0x2e')],'type':_0x4d98af[_0x2d89('0x2f')][_0x2d89('0x30')]};});_0x12fb83[_0x2d89('0x31')]=_[_0x2d89('0x32')](_0x991585,_0x2d89('0x2b'));_0x12fb83[_0x2d89('0x33')]=_[_0x2d89('0x34')](_0x539c18[_0x2d89('0x33')]);_0x12fb83[_0x2d89('0x35')]=_['intersection'](_0x12fb83[_0x2d89('0x31')],_0x12fb83[_0x2d89('0x33')]);_0x232c05[_0x2d89('0x36')]=_[_0x2d89('0x37')](_0x12fb83['model'],qs[_0x2d89('0x38')](_0x539c18[_0x2d89('0x33')][_0x2d89('0x38')]));_0x232c05[_0x2d89('0x36')]=_0x232c05[_0x2d89('0x36')][_0x2d89('0x39')]?_0x232c05[_0x2d89('0x36')]:_0x12fb83[_0x2d89('0x31')];if(!_0x539c18[_0x2d89('0x33')]['hasOwnProperty'](_0x2d89('0x3a'))){_0x232c05[_0x2d89('0x3b')]=qs['limit'](_0x539c18[_0x2d89('0x33')][_0x2d89('0x3b')]);_0x232c05[_0x2d89('0x3c')]=qs['offset'](_0x539c18[_0x2d89('0x33')][_0x2d89('0x3c')]);}_0x232c05[_0x2d89('0x3d')]=qs[_0x2d89('0x3e')](_0x539c18['query'][_0x2d89('0x3e')]);_0x232c05[_0x2d89('0x3f')]=qs[_0x2d89('0x35')](_[_0x2d89('0x40')](_0x539c18[_0x2d89('0x33')],_0x12fb83[_0x2d89('0x35')]),_0x991585);if(_0x539c18[_0x2d89('0x33')][_0x2d89('0x41')]){_0x232c05[_0x2d89('0x3f')]=_[_0x2d89('0x42')](_0x232c05[_0x2d89('0x3f')],{'$or':_[_0x2d89('0x32')](_0x991585,function(_0x168b41){if(_0x168b41[_0x2d89('0x2f')]!=='VIRTUAL'){var _0x3a8a29={};_0x3a8a29[_0x168b41[_0x2d89('0x2b')]]={'$like':'%'+_0x539c18['query'][_0x2d89('0x41')]+'%'};return _0x3a8a29;}})});}_0x232c05=_[_0x2d89('0x42')]({},_0x232c05,_0x539c18[_0x2d89('0x43')]);var _0x1225b2={'where':_0x232c05['where']};return db[_0x2d89('0x44')]['count'](_0x1225b2)['then'](function(_0x1ebb3b){_0x3b5f21['count']=_0x1ebb3b;if(_0x539c18[_0x2d89('0x33')][_0x2d89('0x45')]){_0x232c05[_0x2d89('0x46')]=[{'all':!![]}];}return db[_0x2d89('0x44')]['findAll'](_0x232c05);})['then'](function(_0xb1ccf8){_0x3b5f21[_0x2d89('0x47')]=_0xb1ccf8;return _0x3b5f21;})[_0x2d89('0x25')](respondWithFilteredResult(_0x39a0c8,_0x232c05))[_0x2d89('0x48')](handleError(_0x39a0c8,null));};exports['show']=function(_0x37dcfe,_0xa915d2){var _0x5872b1={'raw':!![],'where':{'id':_0x37dcfe[_0x2d89('0x49')]['id']}},_0x1338d6={};_0x1338d6['model']=_[_0x2d89('0x34')](db[_0x2d89('0x44')][_0x2d89('0x4a')]);_0x1338d6[_0x2d89('0x33')]=_[_0x2d89('0x34')](_0x37dcfe[_0x2d89('0x33')]);_0x1338d6[_0x2d89('0x35')]=_['intersection'](_0x1338d6[_0x2d89('0x31')],_0x1338d6[_0x2d89('0x33')]);_0x5872b1[_0x2d89('0x36')]=_[_0x2d89('0x37')](_0x1338d6['model'],qs[_0x2d89('0x38')](_0x37dcfe[_0x2d89('0x33')][_0x2d89('0x38')]));_0x5872b1[_0x2d89('0x36')]=_0x5872b1[_0x2d89('0x36')][_0x2d89('0x39')]?_0x5872b1['attributes']:_0x1338d6[_0x2d89('0x31')];if(_0x37dcfe[_0x2d89('0x33')]['includeAll']){_0x5872b1['include']=[{'all':!![]}];}_0x5872b1=_['merge']({},_0x5872b1,_0x37dcfe[_0x2d89('0x43')]);return db[_0x2d89('0x44')][_0x2d89('0x4b')](_0x5872b1)[_0x2d89('0x25')](handleEntityNotFound(_0xa915d2,null))[_0x2d89('0x25')](respondWithResult(_0xa915d2,null))[_0x2d89('0x48')](handleError(_0xa915d2,null));};exports['download']=function(_0x358610,_0x3bb0c0,_0x5d634d){return db[_0x2d89('0x44')]['find']({'where':{'id':_0x358610[_0x2d89('0x49')]['id']},'attributes':[_0x2d89('0x2b'),_0x2d89('0x4c'),_0x2d89('0x4d')],'raw':!![]})[_0x2d89('0x25')](handleEntityNotFound(_0x3bb0c0,null))[_0x2d89('0x25')](function(_0x2507c5){if(_0x2507c5){if(!fs[_0x2d89('0x4e')](path[_0x2d89('0x4f')](config[_0x2d89('0x50')],_0x2d89('0x51'),_0x2507c5[_0x2d89('0x4c')]+'.'+_0x2507c5[_0x2d89('0x4d')]))){throw new db['Sequelize'][(_0x2d89('0x52'))]('Sound\x20not\x20found');}return _0x3bb0c0[_0x2d89('0x53')](path[_0x2d89('0x4f')](config[_0x2d89('0x50')],_0x2d89('0x51'),util[_0x2d89('0x54')](_0x2d89('0x55'),_0x2507c5[_0x2d89('0x4c')],_0x2507c5['converted_format'])),util['format']('%s.%s',_0x2507c5[_0x2d89('0x2b')],_0x2507c5[_0x2d89('0x4d')]));}return null;})[_0x2d89('0x48')](handleError(_0x3bb0c0,null));};exports[_0x2d89('0x56')]=function(_0x4517ea,_0x126d0a,_0x3b8008){var _0x1991b6={'name':path['basename'](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x58')],path[_0x2d89('0x59')](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x58')])),'save_name':path['basename'](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x5a')],path[_0x2d89('0x59')](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x5a')])),'original_format':path[_0x2d89('0x59')](_0x4517ea[_0x2d89('0x57')][_0x2d89('0x58')])[_0x2d89('0x5b')](0x1),'converted_format':'wav'};var _0x7278d1=path[_0x2d89('0x4f')](config['root'],_0x2d89('0x5c'),_0x4517ea['file']['filename']);var _0xadd1eb=path['join'](config[_0x2d89('0x50')],'server/files/sounds/converted',util['format'](_0x2d89('0x55'),path[_0x2d89('0x5d')](_0x4517ea[_0x2d89('0x57')]['filename'],path[_0x2d89('0x59')](_0x4517ea['file'][_0x2d89('0x5a')])),_0x1991b6[_0x2d89('0x4d')]));logger[_0x2d89('0x5e')](_0x2d89('0x5f'),_0x7278d1);logger[_0x2d89('0x5e')](_0x2d89('0x60'),_0xadd1eb);try{fs[_0x2d89('0x61')](_0x7278d1,parseInt(_0x2d89('0x62'),0x8));var _0x5834be=sox[_0x2d89('0x63')](_0x7278d1,_0xadd1eb,{'sampleRate':0x1f40,'format':_0x2d89('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5834be['on']('error',function(_0x42b500){fs[_0x2d89('0x65')](_0x7278d1);_0x126d0a[_0x2d89('0x1c')](0x1f4)[_0x2d89('0x2c')](_0x42b500);});_0x5834be['on'](_0x2d89('0x66'),function(_0x19d798){_0x1991b6[_0x2d89('0x67')]=isNaN(_0x19d798[_0x2d89('0x68')])?null:_0x19d798[_0x2d89('0x68')]*0x3e8;_0x1991b6[_0x2d89('0x69')]=isNaN(_0x19d798[_0x2d89('0x6a')])?null:_0x19d798['sampleCount'];_0x1991b6['original_channelCount']=isNaN(_0x19d798[_0x2d89('0x6b')])?null:_0x19d798[_0x2d89('0x6b')];_0x1991b6[_0x2d89('0x6c')]=isNaN(_0x19d798['bitRate'])?null:_0x19d798['bitRate'];_0x1991b6['original_sampleRate']=isNaN(_0x19d798[_0x2d89('0x6d')])?null:_0x19d798['sampleRate'];});_0x5834be['on'](_0x2d89('0x6e'),function(_0x1e5ba2){_0x1991b6[_0x2d89('0x6f')]=isNaN(_0x1e5ba2[_0x2d89('0x68')])?null:_0x1e5ba2[_0x2d89('0x68')]*0x3e8;_0x1991b6['converted_sampleCount']=isNaN(_0x1e5ba2[_0x2d89('0x6a')])?null:_0x1e5ba2['sampleCount'];_0x1991b6['converted_channelCount']=isNaN(_0x1e5ba2[_0x2d89('0x6b')])?null:_0x1e5ba2[_0x2d89('0x6b')];_0x1991b6[_0x2d89('0x70')]=isNaN(_0x1e5ba2['bitRate'])?null:_0x1e5ba2[_0x2d89('0x71')];_0x1991b6[_0x2d89('0x72')]=isNaN(_0x1e5ba2['sampleRate'])?null:_0x1e5ba2[_0x2d89('0x6d')];});_0x5834be['on'](_0x2d89('0x1d'),function(){fs[_0x2d89('0x61')](_0xadd1eb,parseInt(_0x2d89('0x62'),0x8));return db['Sound'][_0x2d89('0x56')](_0x1991b6)['then'](function(_0x5aed2b){var _0xea1300={'role':_0x4517ea[_0x2d89('0x73')][_0x2d89('0x74')],'userProfileId':_0x4517ea[_0x2d89('0x73')][_0x2d89('0x75')]};if(!_0xea1300)throw new Error(_0x2d89('0x76'));if(_0xea1300[_0x2d89('0x74')]===_0x2d89('0x77')){var _0x40017b=_0x5aed2b['get']({'plain':!![]});return db[_0x2d89('0x78')][_0x2d89('0x4b')]({'where':{'name':_0x2d89('0x27'),'userProfileId':_0xea1300['userProfileId']},'raw':!![]})[_0x2d89('0x25')](function(_0x1e818c){if(_0x1e818c&&_0x1e818c[_0x2d89('0x79')]===0x0){return db[_0x2d89('0x28')]['create']({'name':_0x40017b[_0x2d89('0x2b')],'resourceId':_0x40017b['id'],'type':_0x1e818c[_0x2d89('0x2b')],'sectionId':_0x1e818c['id']},{})['then'](function(){return _0x5aed2b;});}else{return _0x5aed2b;}})[_0x2d89('0x48')](function(_0x29e78a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e78a);throw _0x29e78a;});}return _0x5aed2b;})[_0x2d89('0x25')](respondWithResult(_0x126d0a,null))[_0x2d89('0x48')](handleError(_0x126d0a,null));});_0x5834be[_0x2d89('0x7a')]();}catch(_0x5e354a){_0x126d0a['status'](0x1f4)['send'](_0x5e354a);}};exports[_0x2d89('0x24')]=function(_0x27a54a,_0x8946ad,_0x1b6c79){return db[_0x2d89('0x44')][_0x2d89('0x4b')]({'where':{'id':_0x27a54a[_0x2d89('0x49')]['id']}})[_0x2d89('0x25')](handleEntityNotFound(_0x8946ad,null))['then'](saveUpdates(_['pick'](_0x27a54a[_0x2d89('0x73')],[_0x2d89('0x2b'),_0x2d89('0x7b')]),null))[_0x2d89('0x25')](respondWithResult(_0x8946ad,null))[_0x2d89('0x48')](handleError(_0x8946ad,null));};exports[_0x2d89('0x7c')]=function(_0x940153,_0x513800,_0x254d7c){return db[_0x2d89('0x44')][_0x2d89('0x4b')]({'where':{'id':_0x940153[_0x2d89('0x49')]['id']}})[_0x2d89('0x25')](function(_0x2771e6){if(_0x2771e6){return _0x2771e6[_0x2d89('0x26')]();}})[_0x2d89('0x25')](function(_0x4ab2de){var _0x440583=path['join'](config['root'],_0x2d89('0x5c'),util[_0x2d89('0x54')](_0x2d89('0x55'),_0x4ab2de[_0x2d89('0x4c')],_0x4ab2de[_0x2d89('0x7d')]));var _0x965660=path[_0x2d89('0x4f')](config[_0x2d89('0x50')],_0x2d89('0x51'),util[_0x2d89('0x54')](_0x2d89('0x55'),_0x4ab2de[_0x2d89('0x4c')],_0x4ab2de[_0x2d89('0x4d')]));fs['unlinkSync'](_0x440583);fs[_0x2d89('0x65')](_0x965660);return _0x4ab2de;})[_0x2d89('0x25')](function(_0x59fab7){if(_0x59fab7){return _0x513800['status'](0xcc)[_0x2d89('0x1d')]();}})[_0x2d89('0x25')](handleEntityNotFound(_0x513800,null))['catch'](handleError(_0x513800,null));}; \ No newline at end of file +var _0x796d=['filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','params','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','get','Sounds','error','name','send','index','Sound','rawAttributes','type','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','originalname','extname','file','basename'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0x796d,0xa5));var _0xd796=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x796d[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0xd796('0x0'));var rimraf=require(_0xd796('0x1'));var zipdir=require(_0xd796('0x2'));var jsonpatch=require(_0xd796('0x3'));var rp=require(_0xd796('0x4'));var moment=require('moment');var BPromise=require(_0xd796('0x5'));var Mustache=require('mustache');var util=require(_0xd796('0x6'));var path=require('path');var sox=require(_0xd796('0x7'));var csv=require(_0xd796('0x8'));var ejs=require(_0xd796('0x9'));var fs=require('fs');var fs_extra=require(_0xd796('0xa'));var _=require('lodash');var squel=require(_0xd796('0xb'));var crypto=require(_0xd796('0xc'));var jsforce=require(_0xd796('0xd'));var deskjs=require(_0xd796('0xe'));var toCsv=require(_0xd796('0x8'));var querystring=require(_0xd796('0xf'));var Papa=require(_0xd796('0x10'));var Redis=require('ioredis');var authService=require(_0xd796('0x11'));var qs=require(_0xd796('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd796('0x13'));var logger=require(_0xd796('0x14'))(_0xd796('0x15'));var utils=require(_0xd796('0x16'));var config=require(_0xd796('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd796('0x18'))['db'];function respondWithStatusCode(_0x51b53f,_0xd12ff6){_0xd12ff6=_0xd12ff6||0xcc;return function(_0x2e68d2){if(_0x2e68d2){return _0x51b53f[_0xd796('0x19')](_0xd12ff6);}return _0x51b53f[_0xd796('0x1a')](_0xd12ff6)[_0xd796('0x1b')]();};}function respondWithResult(_0x1f4217,_0x2a7104){_0x2a7104=_0x2a7104||0xc8;return function(_0xae9437){if(_0xae9437){return _0x1f4217[_0xd796('0x1a')](_0x2a7104)[_0xd796('0x1c')](_0xae9437);}};}function respondWithFilteredResult(_0x385503,_0x3daec6){return function(_0x1bd420){if(_0x1bd420){var _0x5b56c3=typeof _0x3daec6[_0xd796('0x1d')]===_0xd796('0x1e')&&typeof _0x3daec6[_0xd796('0x1f')]===_0xd796('0x1e');var _0xa60db6=_0x1bd420[_0xd796('0x20')];var _0x3e5922=_0x5b56c3?0x0:_0x3daec6[_0xd796('0x1d')];var _0x5f5163=_0x5b56c3?_0x1bd420[_0xd796('0x20')]:_0x3daec6[_0xd796('0x1d')]+_0x3daec6[_0xd796('0x1f')];var _0x1b6dbc;if(_0x5f5163>=_0xa60db6){_0x5f5163=_0xa60db6;_0x1b6dbc=0xc8;}else{_0x1b6dbc=0xce;}_0x385503[_0xd796('0x1a')](_0x1b6dbc);return _0x385503[_0xd796('0x21')](_0xd796('0x22'),_0x3e5922+'-'+_0x5f5163+'/'+_0xa60db6)[_0xd796('0x1c')](_0x1bd420);}return null;};}function patchUpdates(_0x591d4a){return function(_0x49cf8c){try{jsonpatch['apply'](_0x49cf8c,_0x591d4a,!![]);}catch(_0x2e2b3d){return BPromise['reject'](_0x2e2b3d);}return _0x49cf8c[_0xd796('0x23')]();};}function saveUpdates(_0x3c1a7a,_0x13cfa3){return function(_0x253506){if(_0x253506){return _0x253506[_0xd796('0x24')](_0x3c1a7a)['then'](function(_0x446268){return _0x446268;});}return null;};}function removeEntity(_0xd3a583,_0x130877){return function(_0x151adc){if(_0x151adc){return _0x151adc[_0xd796('0x25')]()[_0xd796('0x26')](function(){var _0x24a857=_0x151adc[_0xd796('0x27')]({'plain':!![]});var _0x34c98a=_0xd796('0x28');return db['UserProfileResource'][_0xd796('0x25')]({'where':{'type':_0x34c98a,'resourceId':_0x24a857['id']}})[_0xd796('0x26')](function(){return _0x151adc;});})[_0xd796('0x26')](function(){_0xd3a583['status'](0xcc)[_0xd796('0x1b')]();});}};}function handleEntityNotFound(_0xb9ec07,_0x336c22){return function(_0x507cdc){if(!_0x507cdc){_0xb9ec07[_0xd796('0x19')](0x194);}return _0x507cdc;};}function handleError(_0x181ebc,_0x505530){_0x505530=_0x505530||0x1f4;return function(_0x438b80){logger[_0xd796('0x29')](_0x438b80['stack']);if(_0x438b80['name']){delete _0x438b80[_0xd796('0x2a')];}_0x181ebc['status'](_0x505530)[_0xd796('0x2b')](_0x438b80);};}exports[_0xd796('0x2c')]=function(_0x1cf18e,_0x41680b){var _0x29aaa2={},_0x5910de={},_0x592417={'count':0x0,'rows':[]};var _0x3bd180=_['map'](db[_0xd796('0x2d')][_0xd796('0x2e')],function(_0x7ac341){return{'name':_0x7ac341['fieldName'],'type':_0x7ac341[_0xd796('0x2f')]['key']};});_0x5910de[_0xd796('0x30')]=_[_0xd796('0x31')](_0x3bd180,_0xd796('0x2a'));_0x5910de[_0xd796('0x32')]=_['keys'](_0x1cf18e[_0xd796('0x32')]);_0x5910de[_0xd796('0x33')]=_['intersection'](_0x5910de[_0xd796('0x30')],_0x5910de[_0xd796('0x32')]);_0x29aaa2[_0xd796('0x34')]=_[_0xd796('0x35')](_0x5910de[_0xd796('0x30')],qs[_0xd796('0x36')](_0x1cf18e[_0xd796('0x32')][_0xd796('0x36')]));_0x29aaa2[_0xd796('0x34')]=_0x29aaa2['attributes'][_0xd796('0x37')]?_0x29aaa2[_0xd796('0x34')]:_0x5910de[_0xd796('0x30')];if(!_0x1cf18e[_0xd796('0x32')]['hasOwnProperty'](_0xd796('0x38'))){_0x29aaa2[_0xd796('0x1f')]=qs[_0xd796('0x1f')](_0x1cf18e[_0xd796('0x32')][_0xd796('0x1f')]);_0x29aaa2[_0xd796('0x1d')]=qs['offset'](_0x1cf18e[_0xd796('0x32')]['offset']);}_0x29aaa2[_0xd796('0x39')]=qs[_0xd796('0x3a')](_0x1cf18e[_0xd796('0x32')][_0xd796('0x3a')]);_0x29aaa2['where']=qs[_0xd796('0x33')](_[_0xd796('0x3b')](_0x1cf18e[_0xd796('0x32')],_0x5910de['filters']),_0x3bd180);if(_0x1cf18e[_0xd796('0x32')][_0xd796('0x3c')]){_0x29aaa2[_0xd796('0x3d')]=_[_0xd796('0x3e')](_0x29aaa2[_0xd796('0x3d')],{'$or':_[_0xd796('0x31')](_0x3bd180,function(_0x2e5bdc){if(_0x2e5bdc[_0xd796('0x2f')]!==_0xd796('0x3f')){var _0x44a45a={};_0x44a45a[_0x2e5bdc['name']]={'$like':'%'+_0x1cf18e['query'][_0xd796('0x3c')]+'%'};return _0x44a45a;}})});}_0x29aaa2=_[_0xd796('0x3e')]({},_0x29aaa2,_0x1cf18e[_0xd796('0x40')]);var _0x5d6013={'where':_0x29aaa2['where']};return db['Sound'][_0xd796('0x20')](_0x5d6013)[_0xd796('0x26')](function(_0x4adf06){_0x592417[_0xd796('0x20')]=_0x4adf06;if(_0x1cf18e['query'][_0xd796('0x41')]){_0x29aaa2[_0xd796('0x42')]=[{'all':!![]}];}return db[_0xd796('0x2d')][_0xd796('0x43')](_0x29aaa2);})[_0xd796('0x26')](function(_0x1f21a9){_0x592417[_0xd796('0x44')]=_0x1f21a9;return _0x592417;})[_0xd796('0x26')](respondWithFilteredResult(_0x41680b,_0x29aaa2))[_0xd796('0x45')](handleError(_0x41680b,null));};exports[_0xd796('0x46')]=function(_0x1704fa,_0x29530b){var _0x5aae30={'raw':!![],'where':{'id':_0x1704fa['params']['id']}},_0x15fa5e={};_0x15fa5e[_0xd796('0x30')]=_[_0xd796('0x47')](db[_0xd796('0x2d')]['rawAttributes']);_0x15fa5e[_0xd796('0x32')]=_[_0xd796('0x47')](_0x1704fa[_0xd796('0x32')]);_0x15fa5e[_0xd796('0x33')]=_[_0xd796('0x35')](_0x15fa5e['model'],_0x15fa5e[_0xd796('0x32')]);_0x5aae30['attributes']=_['intersection'](_0x15fa5e['model'],qs[_0xd796('0x36')](_0x1704fa[_0xd796('0x32')]['fields']));_0x5aae30[_0xd796('0x34')]=_0x5aae30[_0xd796('0x34')][_0xd796('0x37')]?_0x5aae30[_0xd796('0x34')]:_0x15fa5e[_0xd796('0x30')];if(_0x1704fa[_0xd796('0x32')]['includeAll']){_0x5aae30['include']=[{'all':!![]}];}_0x5aae30=_[_0xd796('0x3e')]({},_0x5aae30,_0x1704fa[_0xd796('0x40')]);return db[_0xd796('0x2d')][_0xd796('0x48')](_0x5aae30)['then'](handleEntityNotFound(_0x29530b,null))[_0xd796('0x26')](respondWithResult(_0x29530b,null))[_0xd796('0x45')](handleError(_0x29530b,null));};exports[_0xd796('0x49')]=function(_0xf0aa7,_0xcac021,_0x42d49a){return db[_0xd796('0x2d')]['find']({'where':{'id':_0xf0aa7['params']['id']},'attributes':['name',_0xd796('0x4a'),_0xd796('0x4b')],'raw':!![]})[_0xd796('0x26')](handleEntityNotFound(_0xcac021,null))[_0xd796('0x26')](function(_0x146d51){if(_0x146d51){if(!fs[_0xd796('0x4c')](path[_0xd796('0x4d')](config[_0xd796('0x4e')],_0xd796('0x4f'),_0x146d51[_0xd796('0x4a')]+'.'+_0x146d51[_0xd796('0x4b')]))){throw new db[(_0xd796('0x50'))][(_0xd796('0x51'))](_0xd796('0x52'));}return _0xcac021[_0xd796('0x49')](path[_0xd796('0x4d')](config[_0xd796('0x4e')],_0xd796('0x4f'),util[_0xd796('0x53')](_0xd796('0x54'),_0x146d51[_0xd796('0x4a')],_0x146d51[_0xd796('0x4b')])),util['format'](_0xd796('0x54'),_0x146d51['name'],_0x146d51['converted_format']));}return null;})[_0xd796('0x45')](handleError(_0xcac021,null));};exports['create']=function(_0x58109a,_0x32a7cc,_0x25f44f){var _0x4d37e4={'name':path['basename'](_0x58109a['file'][_0xd796('0x55')],path[_0xd796('0x56')](_0x58109a[_0xd796('0x57')][_0xd796('0x55')])),'save_name':path[_0xd796('0x58')](_0x58109a[_0xd796('0x57')]['filename'],path[_0xd796('0x56')](_0x58109a[_0xd796('0x57')][_0xd796('0x59')])),'original_format':path[_0xd796('0x56')](_0x58109a['file'][_0xd796('0x55')])[_0xd796('0x5a')](0x1),'converted_format':'wav'};var _0x1c4cd3=path[_0xd796('0x4d')](config[_0xd796('0x4e')],_0xd796('0x5b'),_0x58109a[_0xd796('0x57')][_0xd796('0x59')]);var _0x45327d=path[_0xd796('0x4d')](config[_0xd796('0x4e')],_0xd796('0x4f'),util['format'](_0xd796('0x54'),path[_0xd796('0x58')](_0x58109a['file'][_0xd796('0x59')],path['extname'](_0x58109a['file'][_0xd796('0x59')])),_0x4d37e4[_0xd796('0x4b')]));logger[_0xd796('0x5c')](_0xd796('0x5d'),_0x1c4cd3);logger[_0xd796('0x5c')]('Sound\x20upload\x20destination:\x20%s',_0x45327d);try{fs['chmodSync'](_0x1c4cd3,parseInt(_0xd796('0x5e'),0x8));var _0x20b666=sox[_0xd796('0x5f')](_0x1c4cd3,_0x45327d,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x20b666['on'](_0xd796('0x29'),function(_0x2c8a85){fs[_0xd796('0x60')](_0x1c4cd3);_0x32a7cc[_0xd796('0x1a')](0x1f4)[_0xd796('0x2b')](_0x2c8a85);});_0x20b666['on'](_0xd796('0x61'),function(_0xd1f006){_0x4d37e4['original_duration']=isNaN(_0xd1f006[_0xd796('0x62')])?null:_0xd1f006[_0xd796('0x62')]*0x3e8;_0x4d37e4[_0xd796('0x63')]=isNaN(_0xd1f006[_0xd796('0x64')])?null:_0xd1f006[_0xd796('0x64')];_0x4d37e4[_0xd796('0x65')]=isNaN(_0xd1f006[_0xd796('0x66')])?null:_0xd1f006[_0xd796('0x66')];_0x4d37e4[_0xd796('0x67')]=isNaN(_0xd1f006['bitRate'])?null:_0xd1f006[_0xd796('0x68')];_0x4d37e4[_0xd796('0x69')]=isNaN(_0xd1f006[_0xd796('0x6a')])?null:_0xd1f006['sampleRate'];});_0x20b666['on'](_0xd796('0x6b'),function(_0x2a8f17){_0x4d37e4[_0xd796('0x6c')]=isNaN(_0x2a8f17['duration'])?null:_0x2a8f17[_0xd796('0x62')]*0x3e8;_0x4d37e4[_0xd796('0x6d')]=isNaN(_0x2a8f17[_0xd796('0x64')])?null:_0x2a8f17['sampleCount'];_0x4d37e4[_0xd796('0x6e')]=isNaN(_0x2a8f17['channelCount'])?null:_0x2a8f17['channelCount'];_0x4d37e4[_0xd796('0x6f')]=isNaN(_0x2a8f17[_0xd796('0x68')])?null:_0x2a8f17[_0xd796('0x68')];_0x4d37e4[_0xd796('0x70')]=isNaN(_0x2a8f17[_0xd796('0x6a')])?null:_0x2a8f17[_0xd796('0x6a')];});_0x20b666['on'](_0xd796('0x1b'),function(){fs['chmodSync'](_0x45327d,parseInt(_0xd796('0x5e'),0x8));return db[_0xd796('0x2d')][_0xd796('0x71')](_0x4d37e4)[_0xd796('0x26')](function(_0x8fb0b7){var _0x939028={'role':_0x58109a[_0xd796('0x72')][_0xd796('0x73')],'userProfileId':_0x58109a['body'][_0xd796('0x74')]};if(!_0x939028)throw new Error(_0xd796('0x75'));if(_0x939028[_0xd796('0x73')]===_0xd796('0x76')){var _0x3864b1=_0x8fb0b7[_0xd796('0x27')]({'plain':!![]});return db[_0xd796('0x77')][_0xd796('0x48')]({'where':{'name':_0xd796('0x28'),'userProfileId':_0x939028[_0xd796('0x74')]},'raw':!![]})[_0xd796('0x26')](function(_0x363d27){if(_0x363d27&&_0x363d27[_0xd796('0x78')]===0x0){return db[_0xd796('0x79')][_0xd796('0x71')]({'name':_0x3864b1['name'],'resourceId':_0x3864b1['id'],'type':_0x363d27['name'],'sectionId':_0x363d27['id']},{})[_0xd796('0x26')](function(){return _0x8fb0b7;});}else{return _0x8fb0b7;}})[_0xd796('0x45')](function(_0x2e7b25){logger[_0xd796('0x29')](_0xd796('0x7a'),_0x2e7b25);throw _0x2e7b25;});}return _0x8fb0b7;})['then'](respondWithResult(_0x32a7cc,null))[_0xd796('0x45')](handleError(_0x32a7cc,null));});_0x20b666[_0xd796('0x7b')]();}catch(_0x2d5b16){_0x32a7cc[_0xd796('0x1a')](0x1f4)[_0xd796('0x2b')](_0x2d5b16);}};exports[_0xd796('0x24')]=function(_0x2bfd35,_0x560150,_0x56b6bb){return db[_0xd796('0x2d')][_0xd796('0x48')]({'where':{'id':_0x2bfd35['params']['id']}})[_0xd796('0x26')](handleEntityNotFound(_0x560150,null))[_0xd796('0x26')](saveUpdates(_['pick'](_0x2bfd35[_0xd796('0x72')],[_0xd796('0x2a'),_0xd796('0x7c')]),null))[_0xd796('0x26')](respondWithResult(_0x560150,null))[_0xd796('0x45')](handleError(_0x560150,null));};exports['delete']=function(_0x37d6b1,_0x1a0d9c,_0x2a20ae){return db['Sound']['find']({'where':{'id':_0x37d6b1[_0xd796('0x7d')]['id']}})[_0xd796('0x26')](function(_0x54ef7f){if(_0x54ef7f){return _0x54ef7f[_0xd796('0x25')]();}})['then'](function(_0x8ae1e0){var _0xd44062=path[_0xd796('0x4d')](config['root'],_0xd796('0x5b'),util[_0xd796('0x53')](_0xd796('0x54'),_0x8ae1e0[_0xd796('0x4a')],_0x8ae1e0[_0xd796('0x7e')]));var _0x342cc6=path['join'](config[_0xd796('0x4e')],'server/files/sounds/converted',util[_0xd796('0x53')](_0xd796('0x54'),_0x8ae1e0[_0xd796('0x4a')],_0x8ae1e0[_0xd796('0x4b')]));fs[_0xd796('0x60')](_0xd44062);fs['unlinkSync'](_0x342cc6);return _0x8ae1e0;})[_0xd796('0x26')](function(_0x5386fa){if(_0x5386fa){return _0x1a0d9c[_0xd796('0x1a')](0xcc)[_0xd796('0x1b')]();}})[_0xd796('0x26')](handleEntityNotFound(_0x1a0d9c,null))[_0xd796('0x45')](handleError(_0x1a0d9c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index da83264..22c8add 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 _0x7bca=['moment','bluebird','request-promise','rimraf','../../config/environment','define','util','../../config/logger','api'];(function(_0x5a843d,_0x1c2011){var _0x163d92=function(_0x2f5999){while(--_0x2f5999){_0x5a843d['push'](_0x5a843d['shift']());}};_0x163d92(++_0x1c2011);}(_0x7bca,0x1d1));var _0xa7bc=function(_0x5473da,_0x49396c){_0x5473da=_0x5473da-0x0;var _0x3b0928=_0x7bca[_0x5473da];return _0x3b0928;};'use strict';var _=require('lodash');var util=require(_0xa7bc('0x0'));var logger=require(_0xa7bc('0x1'))(_0xa7bc('0x2'));var moment=require(_0xa7bc('0x3'));var BPromise=require(_0xa7bc('0x4'));var rp=require(_0xa7bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7bc('0x6'));var config=require(_0xa7bc('0x7'));var attributes=require('./sound.attributes');module['exports']=function(_0x39e4e7,_0x45bec4){return _0x39e4e7[_0xa7bc('0x8')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3e0=['exports','define','Sound','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./sound.attributes'];(function(_0x2afadf,_0x57fb00){var _0x3f0571=function(_0x16f0c7){while(--_0x16f0c7){_0x2afadf['push'](_0x2afadf['shift']());}};_0x3f0571(++_0x57fb00);}(_0xa3e0,0x13b));var _0x0a3e=function(_0x21a3c3,_0x5e41cd){_0x21a3c3=_0x21a3c3-0x0;var _0x36aa5b=_0xa3e0[_0x21a3c3];return _0x36aa5b;};'use strict';var _=require(_0x0a3e('0x0'));var util=require(_0x0a3e('0x1'));var logger=require(_0x0a3e('0x2'))(_0x0a3e('0x3'));var moment=require('moment');var BPromise=require(_0x0a3e('0x4'));var rp=require(_0x0a3e('0x5'));var fs=require('fs');var path=require(_0x0a3e('0x6'));var rimraf=require('rimraf');var config=require(_0x0a3e('0x7'));var attributes=require(_0x0a3e('0x8'));module[_0x0a3e('0x9')]=function(_0x321727,_0x154310){return _0x321727[_0x0a3e('0xa')](_0x0a3e('0xb'),attributes,{'tableName':'tools_sounds','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 ef0db40..76d1155 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 _0x35fa=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x4cdb94,_0x480fd8){var _0x595b52=function(_0x393256){while(--_0x393256){_0x4cdb94['push'](_0x4cdb94['shift']());}};_0x595b52(++_0x480fd8);}(_0x35fa,0x7f));var _0xa35f=function(_0x1ccf70,_0x1f6416){_0x1ccf70=_0x1ccf70-0x0;var _0x4a0de6=_0x35fa[_0x1ccf70];return _0x4a0de6;};'use strict';var _=require(_0xa35f('0x0'));var util=require(_0xa35f('0x1'));var moment=require(_0xa35f('0x2'));var BPromise=require(_0xa35f('0x3'));var rs=require(_0xa35f('0x4'));var fs=require('fs');var Redis=require(_0xa35f('0x5'));var db=require(_0xa35f('0x6'))['db'];var utils=require(_0xa35f('0x7'));var logger=require('../../config/logger')(_0xa35f('0x8'));var config=require(_0xa35f('0x9'));var jayson=require(_0xa35f('0xa'));var client=jayson[_0xa35f('0xb')][_0xa35f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4721db,_0x5e3fd7,_0x55c3b2){return new BPromise(function(_0x1b100a,_0x6f616){return client[_0xa35f('0xd')](_0x4721db,_0x55c3b2)[_0xa35f('0xe')](function(_0x348abf){logger[_0xa35f('0xf')](_0xa35f('0x10'),_0x5e3fd7,_0xa35f('0x11'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x5e3fd7,_0xa35f('0x11'),JSON[_0xa35f('0x12')](_0x348abf));if(_0x348abf[_0xa35f('0x13')]){if(_0x348abf[_0xa35f('0x13')]['code']===0x1f4){logger['error'](_0xa35f('0x10'),_0x5e3fd7,_0x348abf[_0xa35f('0x13')][_0xa35f('0x14')]);return _0x6f616(_0x348abf[_0xa35f('0x13')][_0xa35f('0x14')]);}logger[_0xa35f('0x13')](_0xa35f('0x10'),_0x5e3fd7,_0x348abf[_0xa35f('0x13')][_0xa35f('0x14')]);return _0x1b100a(_0x348abf[_0xa35f('0x13')][_0xa35f('0x14')]);}else{logger[_0xa35f('0xf')](_0xa35f('0x10'),_0x5e3fd7,_0xa35f('0x11'));_0x1b100a(_0x348abf[_0xa35f('0x15')][_0xa35f('0x14')]);}})[_0xa35f('0x16')](function(_0x592a44){logger[_0xa35f('0x13')](_0xa35f('0x10'),_0x5e3fd7,_0x592a44);_0x6f616(_0x592a44);});});}exports[_0xa35f('0x17')]=function(_0x2b6a31){var _0x548abb=this;return new Promise(function(_0x233cf3,_0x207978){return db[_0xa35f('0x18')]['find']({'raw':_0x2b6a31[_0xa35f('0x19')]?_0x2b6a31[_0xa35f('0x19')][_0xa35f('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b6a31[_0xa35f('0x19')]?_0x2b6a31[_0xa35f('0x19')][_0xa35f('0x1b')]||null:null,'attributes':_0x2b6a31['options']?_0x2b6a31['options'][_0xa35f('0x1c')]||null:null,'include':_0x2b6a31[_0xa35f('0x19')]?_0x2b6a31[_0xa35f('0x19')][_0xa35f('0x1d')]?_[_0xa35f('0x1e')](_0x2b6a31[_0xa35f('0x19')][_0xa35f('0x1d')],function(_0x464d70){return{'model':db[_0x464d70['model']],'as':_0x464d70['as'],'attributes':_0x464d70[_0xa35f('0x1c')],'include':_0x464d70['include']?_[_0xa35f('0x1e')](_0x464d70[_0xa35f('0x1d')],function(_0x240ca5){return{'model':db[_0x240ca5[_0xa35f('0x1f')]],'as':_0x240ca5['as'],'attributes':_0x240ca5[_0xa35f('0x1c')],'include':_0x240ca5['include']?_[_0xa35f('0x1e')](_0x240ca5[_0xa35f('0x1d')],function(_0x58dc0e){return{'model':db[_0x58dc0e[_0xa35f('0x1f')]],'as':_0x58dc0e['as'],'attributes':_0x58dc0e[_0xa35f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa35f('0xe')](function(_0x47356c){logger['info'](_0xa35f('0x17'),_0x2b6a31);logger[_0xa35f('0x20')](_0xa35f('0x17'),_0x2b6a31,JSON[_0xa35f('0x12')](_0x47356c));_0x233cf3(_0x47356c);})['catch'](function(_0x1d85b7){logger[_0xa35f('0x13')]('ShowSound',_0x1d85b7[_0xa35f('0x14')],_0x2b6a31);_0x207978(_0x548abb[_0xa35f('0x13')](0x1f4,_0x1d85b7[_0xa35f('0x14')]));});});}; \ No newline at end of file +var _0xf7ca=['then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','ShowSound','Sound','find','options','raw','where','include','model','map','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x2cb3cd,_0x4bc604){var _0x4e8250=function(_0x506e03){while(--_0x506e03){_0x2cb3cd['push'](_0x2cb3cd['shift']());}};_0x4e8250(++_0x4bc604);}(_0xf7ca,0xec));var _0xaf7c=function(_0xb8ea22,_0x29ca46){_0xb8ea22=_0xb8ea22-0x0;var _0x47b08c=_0xf7ca[_0xb8ea22];return _0x47b08c;};'use strict';var _=require(_0xaf7c('0x0'));var util=require('util');var moment=require(_0xaf7c('0x1'));var BPromise=require(_0xaf7c('0x2'));var rs=require(_0xaf7c('0x3'));var fs=require('fs');var Redis=require(_0xaf7c('0x4'));var db=require(_0xaf7c('0x5'))['db'];var utils=require(_0xaf7c('0x6'));var logger=require('../../config/logger')(_0xaf7c('0x7'));var config=require(_0xaf7c('0x8'));var jayson=require(_0xaf7c('0x9'));var client=jayson[_0xaf7c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3494b8,_0x59ee4b,_0x3d03e0){return new BPromise(function(_0x1f937e,_0x16620b){return client[_0xaf7c('0xb')](_0x3494b8,_0x3d03e0)[_0xaf7c('0xc')](function(_0x73857f){logger[_0xaf7c('0xd')](_0xaf7c('0xe'),_0x59ee4b,_0xaf7c('0xf'));logger[_0xaf7c('0x10')]('Sound,\x20%s,\x20%s,\x20%s',_0x59ee4b,_0xaf7c('0xf'),JSON[_0xaf7c('0x11')](_0x73857f));if(_0x73857f[_0xaf7c('0x12')]){if(_0x73857f[_0xaf7c('0x12')]['code']===0x1f4){logger[_0xaf7c('0x12')](_0xaf7c('0xe'),_0x59ee4b,_0x73857f['error'][_0xaf7c('0x13')]);return _0x16620b(_0x73857f[_0xaf7c('0x12')][_0xaf7c('0x13')]);}logger[_0xaf7c('0x12')](_0xaf7c('0xe'),_0x59ee4b,_0x73857f[_0xaf7c('0x12')][_0xaf7c('0x13')]);return _0x1f937e(_0x73857f[_0xaf7c('0x12')]['message']);}else{logger[_0xaf7c('0xd')](_0xaf7c('0xe'),_0x59ee4b,'request\x20sent');_0x1f937e(_0x73857f['result'][_0xaf7c('0x13')]);}})[_0xaf7c('0x14')](function(_0x136adf){logger[_0xaf7c('0x12')](_0xaf7c('0xe'),_0x59ee4b,_0x136adf);_0x16620b(_0x136adf);});});}exports[_0xaf7c('0x15')]=function(_0x5f3a8d){var _0x447659=this;return new Promise(function(_0x24a22b,_0x102b05){return db[_0xaf7c('0x16')][_0xaf7c('0x17')]({'raw':_0x5f3a8d[_0xaf7c('0x18')]?_0x5f3a8d[_0xaf7c('0x18')][_0xaf7c('0x19')]===undefined?!![]:![]:!![],'where':_0x5f3a8d['options']?_0x5f3a8d[_0xaf7c('0x18')][_0xaf7c('0x1a')]||null:null,'attributes':_0x5f3a8d[_0xaf7c('0x18')]?_0x5f3a8d[_0xaf7c('0x18')]['attributes']||null:null,'include':_0x5f3a8d[_0xaf7c('0x18')]?_0x5f3a8d[_0xaf7c('0x18')][_0xaf7c('0x1b')]?_['map'](_0x5f3a8d[_0xaf7c('0x18')]['include'],function(_0x426f57){return{'model':db[_0x426f57[_0xaf7c('0x1c')]],'as':_0x426f57['as'],'attributes':_0x426f57['attributes'],'include':_0x426f57['include']?_[_0xaf7c('0x1d')](_0x426f57[_0xaf7c('0x1b')],function(_0x2d43b3){return{'model':db[_0x2d43b3[_0xaf7c('0x1c')]],'as':_0x2d43b3['as'],'attributes':_0x2d43b3[_0xaf7c('0x1e')],'include':_0x2d43b3['include']?_['map'](_0x2d43b3[_0xaf7c('0x1b')],function(_0x3e3501){return{'model':db[_0x3e3501[_0xaf7c('0x1c')]],'as':_0x3e3501['as'],'attributes':_0x3e3501['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf7c('0xc')](function(_0x3a5f79){logger[_0xaf7c('0xd')](_0xaf7c('0x15'),_0x5f3a8d);logger['debug']('ShowSound',_0x5f3a8d,JSON[_0xaf7c('0x11')](_0x3a5f79));_0x24a22b(_0x3a5f79);})[_0xaf7c('0x14')](function(_0x22fedb){logger[_0xaf7c('0x12')](_0xaf7c('0x15'),_0x22fedb[_0xaf7c('0x13')],_0x5f3a8d);_0x102b05(_0x447659[_0xaf7c('0x12')](0x1f4,_0x22fedb[_0xaf7c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d2f70c5..ac4c553 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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x45e60e,_0x529bef){var _0x5717a5=function(_0x38d070){while(--_0x38d070){_0x45e60e['push'](_0x45e60e['shift']());}};_0x5717a5(++_0x529bef);}(_0x2032,0xd9));var _0x2203=function(_0x3ffee5,_0x373510){_0x3ffee5=_0x3ffee5-0x0;var _0x314208=_0x2032[_0x3ffee5];return _0x314208;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file +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(_0x33f5c9,_0x54db2e){var _0x4af0a1=function(_0x142dc9){while(--_0x142dc9){_0x33f5c9['push'](_0x33f5c9['shift']());}};_0x4af0a1(++_0x54db2e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb7e7[_0x502c7d];return _0x30b7ed;};'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 diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 972da7f..d3ff3b2 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 _0xe43e=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x3fd60c,_0x23fb55){var _0x33d2ff=function(_0x39d0f9){while(--_0x39d0f9){_0x3fd60c['push'](_0x3fd60c['shift']());}};_0x33d2ff(++_0x23fb55);}(_0xe43e,0x18a));var _0xee43=function(_0xe79212,_0x37f1b9){_0xe79212=_0xe79212-0x0;var _0x508219=_0xe43e[_0xe79212];return _0x508219;};'use strict';var Sequelize=require(_0xee43('0x0'));module[_0xee43('0x1')]={'uniqueid':{'type':Sequelize[_0xee43('0x2')]},'body':{'type':Sequelize[_0xee43('0x3')](_0xee43('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xee43('0x5')]('in',_0xee43('0x6')),'defaultValue':_0xee43('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xee43('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x70f0=['sequelize','STRING','TEXT'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x70f0,0x90));var _0x070f=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0x70f0[_0x34bc94];return _0xee41e7;};'use strict';var Sequelize=require(_0x070f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x070f('0x1')]},'body':{'type':Sequelize[_0x070f('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x070f('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 6e26ff4..c9f2e7d 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 _0x18a6=['body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','update','destroy','then','end','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','SquareMessage','includeAll','findAll','rows','catch','show','params','include','find','create'];(function(_0x30c53c,_0x1c93f4){var _0x42500f=function(_0x1ba019){while(--_0x1ba019){_0x30c53c['push'](_0x30c53c['shift']());}};_0x42500f(++_0x1c93f4);}(_0x18a6,0x1c9));var _0x618a=function(_0xbedd5f,_0x10bc19){_0xbedd5f=_0xbedd5f-0x0;var _0x3344b4=_0x18a6[_0xbedd5f];return _0x3344b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x618a('0x0'));var zipdir=require(_0x618a('0x1'));var jsonpatch=require(_0x618a('0x2'));var rp=require(_0x618a('0x3'));var moment=require(_0x618a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x618a('0x5'));var util=require(_0x618a('0x6'));var path=require(_0x618a('0x7'));var sox=require(_0x618a('0x8'));var csv=require(_0x618a('0x9'));var ejs=require(_0x618a('0xa'));var fs=require('fs');var fs_extra=require(_0x618a('0xb'));var _=require(_0x618a('0xc'));var squel=require(_0x618a('0xd'));var crypto=require('crypto');var jsforce=require(_0x618a('0xe'));var deskjs=require(_0x618a('0xf'));var toCsv=require(_0x618a('0x9'));var querystring=require(_0x618a('0x10'));var Papa=require(_0x618a('0x11'));var Redis=require('ioredis');var authService=require(_0x618a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x618a('0x13'));var hardwareService=require(_0x618a('0x14'));var logger=require(_0x618a('0x15'))(_0x618a('0x16'));var utils=require('../../config/utils');var config=require(_0x618a('0x17'));var licenseUtil=require(_0x618a('0x18'));var db=require(_0x618a('0x19'))['db'];function respondWithStatusCode(_0x2861fb,_0x1f5ebe){_0x1f5ebe=_0x1f5ebe||0xcc;return function(_0x28bb2f){if(_0x28bb2f){return _0x2861fb[_0x618a('0x1a')](_0x1f5ebe);}return _0x2861fb[_0x618a('0x1b')](_0x1f5ebe)['end']();};}function respondWithResult(_0x594b8e,_0x4c7923){_0x4c7923=_0x4c7923||0xc8;return function(_0x34f2ac){if(_0x34f2ac){return _0x594b8e['status'](_0x4c7923)[_0x618a('0x1c')](_0x34f2ac);}};}function respondWithFilteredResult(_0x26e379,_0x2a04e9){return function(_0x576e56){if(_0x576e56){var _0x3e17cd=typeof _0x2a04e9[_0x618a('0x1d')]==='undefined'&&typeof _0x2a04e9[_0x618a('0x1e')]===_0x618a('0x1f');var _0x1c056f=_0x576e56[_0x618a('0x20')];var _0x35b13e=_0x3e17cd?0x0:_0x2a04e9[_0x618a('0x1d')];var _0x469ffd=_0x3e17cd?_0x576e56[_0x618a('0x20')]:_0x2a04e9[_0x618a('0x1d')]+_0x2a04e9['limit'];var _0x89aba0;if(_0x469ffd>=_0x1c056f){_0x469ffd=_0x1c056f;_0x89aba0=0xc8;}else{_0x89aba0=0xce;}_0x26e379[_0x618a('0x1b')](_0x89aba0);return _0x26e379['set'](_0x618a('0x21'),_0x35b13e+'-'+_0x469ffd+'/'+_0x1c056f)['json'](_0x576e56);}return null;};}function patchUpdates(_0x246349){return function(_0x4e50b3){try{jsonpatch[_0x618a('0x22')](_0x4e50b3,_0x246349,!![]);}catch(_0xaecf23){return BPromise['reject'](_0xaecf23);}return _0x4e50b3['save']();};}function saveUpdates(_0x3381df,_0x96031){return function(_0x4f3293){if(_0x4f3293){return _0x4f3293[_0x618a('0x23')](_0x3381df)['then'](function(_0x245e6f){return _0x245e6f;});}return null;};}function removeEntity(_0x45e0f9,_0x3175dc){return function(_0x5a462a){if(_0x5a462a){return _0x5a462a[_0x618a('0x24')]()[_0x618a('0x25')](function(){_0x45e0f9['status'](0xcc)[_0x618a('0x26')]();});}};}function handleEntityNotFound(_0x1da2a9,_0x17164c){return function(_0x3986f3){if(!_0x3986f3){_0x1da2a9[_0x618a('0x1a')](0x194);}return _0x3986f3;};}function handleError(_0x2a38b1,_0x1e88f3){_0x1e88f3=_0x1e88f3||0x1f4;return function(_0x12074e){logger['error'](_0x12074e['stack']);if(_0x12074e[_0x618a('0x27')]){delete _0x12074e['name'];}_0x2a38b1[_0x618a('0x1b')](_0x1e88f3)[_0x618a('0x28')](_0x12074e);};}exports[_0x618a('0x29')]=function(_0x1582aa,_0x4e3a17){var _0x2b7066={},_0x4f3aa2={},_0x69a697={'count':0x0,'rows':[]};var _0x4abb30=_[_0x618a('0x2a')](db['SquareMessage'][_0x618a('0x2b')],function(_0xc1fb12){return{'name':_0xc1fb12[_0x618a('0x2c')],'type':_0xc1fb12['type'][_0x618a('0x2d')]};});_0x4f3aa2[_0x618a('0x2e')]=_[_0x618a('0x2a')](_0x4abb30,'name');_0x4f3aa2[_0x618a('0x2f')]=_[_0x618a('0x30')](_0x1582aa[_0x618a('0x2f')]);_0x4f3aa2['filters']=_[_0x618a('0x31')](_0x4f3aa2['model'],_0x4f3aa2[_0x618a('0x2f')]);_0x2b7066[_0x618a('0x32')]=_[_0x618a('0x31')](_0x4f3aa2[_0x618a('0x2e')],qs['fields'](_0x1582aa[_0x618a('0x2f')][_0x618a('0x33')]));_0x2b7066[_0x618a('0x32')]=_0x2b7066[_0x618a('0x32')][_0x618a('0x34')]?_0x2b7066[_0x618a('0x32')]:_0x4f3aa2[_0x618a('0x2e')];if(!_0x1582aa[_0x618a('0x2f')][_0x618a('0x35')](_0x618a('0x36'))){_0x2b7066['limit']=qs[_0x618a('0x1e')](_0x1582aa[_0x618a('0x2f')][_0x618a('0x1e')]);_0x2b7066[_0x618a('0x1d')]=qs[_0x618a('0x1d')](_0x1582aa['query'][_0x618a('0x1d')]);}_0x2b7066[_0x618a('0x37')]=qs[_0x618a('0x38')](_0x1582aa[_0x618a('0x2f')][_0x618a('0x38')]);_0x2b7066[_0x618a('0x39')]=qs[_0x618a('0x3a')](_[_0x618a('0x3b')](_0x1582aa[_0x618a('0x2f')],_0x4f3aa2[_0x618a('0x3a')]),_0x4abb30);if(_0x1582aa[_0x618a('0x2f')][_0x618a('0x3c')]){_0x2b7066[_0x618a('0x39')]=_[_0x618a('0x3d')](_0x2b7066[_0x618a('0x39')],{'$or':_[_0x618a('0x2a')](_0x4abb30,function(_0x2a4bf5){if(_0x2a4bf5[_0x618a('0x3e')]!==_0x618a('0x3f')){var _0x2d26ea={};_0x2d26ea[_0x2a4bf5[_0x618a('0x27')]]={'$like':'%'+_0x1582aa[_0x618a('0x2f')][_0x618a('0x3c')]+'%'};return _0x2d26ea;}})});}_0x2b7066=_['merge']({},_0x2b7066,_0x1582aa[_0x618a('0x40')]);var _0x2ebec0={'where':_0x2b7066[_0x618a('0x39')]};return db[_0x618a('0x41')][_0x618a('0x20')](_0x2ebec0)[_0x618a('0x25')](function(_0x3fb29b){_0x69a697[_0x618a('0x20')]=_0x3fb29b;if(_0x1582aa['query'][_0x618a('0x42')]){_0x2b7066['include']=[{'all':!![]}];}return db[_0x618a('0x41')][_0x618a('0x43')](_0x2b7066);})[_0x618a('0x25')](function(_0x22164a){_0x69a697[_0x618a('0x44')]=_0x22164a;return _0x69a697;})['then'](respondWithFilteredResult(_0x4e3a17,_0x2b7066))[_0x618a('0x45')](handleError(_0x4e3a17,null));};exports[_0x618a('0x46')]=function(_0x45285e,_0x110e25){var _0x5eca01={'raw':!![],'where':{'id':_0x45285e[_0x618a('0x47')]['id']}},_0x40132e={};_0x40132e[_0x618a('0x2e')]=_[_0x618a('0x30')](db[_0x618a('0x41')][_0x618a('0x2b')]);_0x40132e[_0x618a('0x2f')]=_[_0x618a('0x30')](_0x45285e[_0x618a('0x2f')]);_0x40132e[_0x618a('0x3a')]=_[_0x618a('0x31')](_0x40132e[_0x618a('0x2e')],_0x40132e[_0x618a('0x2f')]);_0x5eca01[_0x618a('0x32')]=_[_0x618a('0x31')](_0x40132e[_0x618a('0x2e')],qs['fields'](_0x45285e[_0x618a('0x2f')][_0x618a('0x33')]));_0x5eca01[_0x618a('0x32')]=_0x5eca01['attributes'][_0x618a('0x34')]?_0x5eca01[_0x618a('0x32')]:_0x40132e['model'];if(_0x45285e[_0x618a('0x2f')][_0x618a('0x42')]){_0x5eca01[_0x618a('0x48')]=[{'all':!![]}];}_0x5eca01=_[_0x618a('0x3d')]({},_0x5eca01,_0x45285e[_0x618a('0x40')]);return db[_0x618a('0x41')][_0x618a('0x49')](_0x5eca01)[_0x618a('0x25')](handleEntityNotFound(_0x110e25,null))[_0x618a('0x25')](respondWithResult(_0x110e25,null))['catch'](handleError(_0x110e25,null));};exports[_0x618a('0x4a')]=function(_0x326e43,_0x597288){return db[_0x618a('0x41')][_0x618a('0x4a')](_0x326e43[_0x618a('0x4b')],{})[_0x618a('0x25')](respondWithResult(_0x597288,0xc9))[_0x618a('0x45')](handleError(_0x597288,null));};exports['update']=function(_0x571086,_0x4d8be3){if(_0x571086['body']['id']){delete _0x571086['body']['id'];}return db[_0x618a('0x41')][_0x618a('0x49')]({'where':{'id':_0x571086['params']['id']}})['then'](handleEntityNotFound(_0x4d8be3,null))[_0x618a('0x25')](saveUpdates(_0x571086[_0x618a('0x4b')],null))[_0x618a('0x25')](respondWithResult(_0x4d8be3,null))[_0x618a('0x45')](handleError(_0x4d8be3,null));};exports[_0x618a('0x24')]=function(_0x387022,_0x5ba7ac){return db[_0x618a('0x41')][_0x618a('0x49')]({'where':{'id':_0x387022['params']['id']}})[_0x618a('0x25')](handleEntityNotFound(_0x5ba7ac,null))[_0x618a('0x25')](removeEntity(_0x5ba7ac,null))[_0x618a('0x45')](handleError(_0x5ba7ac,null));}; \ No newline at end of file +var _0x391f=['count','apply','reject','update','then','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','fields','options','create','body','destroy','find','eml-format','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/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3700d9,_0x52962f){var _0x1cd957=function(_0x5861cd){while(--_0x5861cd){_0x3700d9['push'](_0x3700d9['shift']());}};_0x1cd957(++_0x52962f);}(_0x391f,0x10c));var _0xf391=function(_0x4ba5a5,_0x3e769a){_0x4ba5a5=_0x4ba5a5-0x0;var _0x1810a5=_0x391f[_0x4ba5a5];return _0x1810a5;};'use strict';var emlformat=require(_0xf391('0x0'));var rimraf=require(_0xf391('0x1'));var zipdir=require(_0xf391('0x2'));var jsonpatch=require(_0xf391('0x3'));var rp=require(_0xf391('0x4'));var moment=require(_0xf391('0x5'));var BPromise=require(_0xf391('0x6'));var Mustache=require('mustache');var util=require(_0xf391('0x7'));var path=require(_0xf391('0x8'));var sox=require(_0xf391('0x9'));var csv=require(_0xf391('0xa'));var ejs=require(_0xf391('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf391('0xc'));var squel=require(_0xf391('0xd'));var crypto=require(_0xf391('0xe'));var jsforce=require(_0xf391('0xf'));var deskjs=require(_0xf391('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf391('0x11'));var Papa=require(_0xf391('0x12'));var Redis=require(_0xf391('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf391('0x14'));var hardwareService=require(_0xf391('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf391('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf391('0x17'));var db=require(_0xf391('0x18'))['db'];function respondWithStatusCode(_0x3fde73,_0x4fcb52){_0x4fcb52=_0x4fcb52||0xcc;return function(_0x3c014c){if(_0x3c014c){return _0x3fde73[_0xf391('0x19')](_0x4fcb52);}return _0x3fde73[_0xf391('0x1a')](_0x4fcb52)[_0xf391('0x1b')]();};}function respondWithResult(_0x3a1125,_0x1f7d65){_0x1f7d65=_0x1f7d65||0xc8;return function(_0x4f69f2){if(_0x4f69f2){return _0x3a1125[_0xf391('0x1a')](_0x1f7d65)[_0xf391('0x1c')](_0x4f69f2);}};}function respondWithFilteredResult(_0x5a92e1,_0x44a510){return function(_0x47dbc7){if(_0x47dbc7){var _0xbaeaba=typeof _0x44a510[_0xf391('0x1d')]===_0xf391('0x1e')&&typeof _0x44a510[_0xf391('0x1f')]===_0xf391('0x1e');var _0x5d61d0=_0x47dbc7['count'];var _0x32b6c3=_0xbaeaba?0x0:_0x44a510[_0xf391('0x1d')];var _0x548bc4=_0xbaeaba?_0x47dbc7[_0xf391('0x20')]:_0x44a510[_0xf391('0x1d')]+_0x44a510[_0xf391('0x1f')];var _0x2a6c88;if(_0x548bc4>=_0x5d61d0){_0x548bc4=_0x5d61d0;_0x2a6c88=0xc8;}else{_0x2a6c88=0xce;}_0x5a92e1['status'](_0x2a6c88);return _0x5a92e1['set']('Content-Range',_0x32b6c3+'-'+_0x548bc4+'/'+_0x5d61d0)['json'](_0x47dbc7);}return null;};}function patchUpdates(_0x5544bc){return function(_0x262c1c){try{jsonpatch[_0xf391('0x21')](_0x262c1c,_0x5544bc,!![]);}catch(_0x3c13eb){return BPromise[_0xf391('0x22')](_0x3c13eb);}return _0x262c1c['save']();};}function saveUpdates(_0x312818,_0x2b6fa0){return function(_0x41036e){if(_0x41036e){return _0x41036e[_0xf391('0x23')](_0x312818)[_0xf391('0x24')](function(_0x4ab172){return _0x4ab172;});}return null;};}function removeEntity(_0x1bc97a,_0x54632e){return function(_0x46f41f){if(_0x46f41f){return _0x46f41f['destroy']()[_0xf391('0x24')](function(){_0x1bc97a[_0xf391('0x1a')](0xcc)[_0xf391('0x1b')]();});}};}function handleEntityNotFound(_0x1a6f70,_0x122668){return function(_0x109880){if(!_0x109880){_0x1a6f70[_0xf391('0x19')](0x194);}return _0x109880;};}function handleError(_0x35a7af,_0x10b25f){_0x10b25f=_0x10b25f||0x1f4;return function(_0x3f18ca){logger[_0xf391('0x25')](_0x3f18ca[_0xf391('0x26')]);if(_0x3f18ca[_0xf391('0x27')]){delete _0x3f18ca[_0xf391('0x27')];}_0x35a7af['status'](_0x10b25f)[_0xf391('0x28')](_0x3f18ca);};}exports['index']=function(_0x2c78b8,_0x322db8){var _0x42858c={},_0x201c37={},_0x3fbedd={'count':0x0,'rows':[]};var _0x4de0b1=_[_0xf391('0x29')](db[_0xf391('0x2a')][_0xf391('0x2b')],function(_0x355d33){return{'name':_0x355d33[_0xf391('0x2c')],'type':_0x355d33[_0xf391('0x2d')][_0xf391('0x2e')]};});_0x201c37['model']=_['map'](_0x4de0b1,_0xf391('0x27'));_0x201c37[_0xf391('0x2f')]=_[_0xf391('0x30')](_0x2c78b8['query']);_0x201c37[_0xf391('0x31')]=_[_0xf391('0x32')](_0x201c37['model'],_0x201c37[_0xf391('0x2f')]);_0x42858c[_0xf391('0x33')]=_['intersection'](_0x201c37['model'],qs['fields'](_0x2c78b8[_0xf391('0x2f')]['fields']));_0x42858c[_0xf391('0x33')]=_0x42858c['attributes'][_0xf391('0x34')]?_0x42858c['attributes']:_0x201c37[_0xf391('0x35')];if(!_0x2c78b8['query'][_0xf391('0x36')](_0xf391('0x37'))){_0x42858c[_0xf391('0x1f')]=qs[_0xf391('0x1f')](_0x2c78b8['query']['limit']);_0x42858c['offset']=qs[_0xf391('0x1d')](_0x2c78b8[_0xf391('0x2f')][_0xf391('0x1d')]);}_0x42858c[_0xf391('0x38')]=qs[_0xf391('0x39')](_0x2c78b8[_0xf391('0x2f')][_0xf391('0x39')]);_0x42858c[_0xf391('0x3a')]=qs[_0xf391('0x31')](_[_0xf391('0x3b')](_0x2c78b8['query'],_0x201c37['filters']),_0x4de0b1);if(_0x2c78b8[_0xf391('0x2f')][_0xf391('0x3c')]){_0x42858c[_0xf391('0x3a')]=_['merge'](_0x42858c[_0xf391('0x3a')],{'$or':_[_0xf391('0x29')](_0x4de0b1,function(_0x533b69){if(_0x533b69[_0xf391('0x2d')]!==_0xf391('0x3d')){var _0x51fc82={};_0x51fc82[_0x533b69[_0xf391('0x27')]]={'$like':'%'+_0x2c78b8[_0xf391('0x2f')][_0xf391('0x3c')]+'%'};return _0x51fc82;}})});}_0x42858c=_[_0xf391('0x3e')]({},_0x42858c,_0x2c78b8['options']);var _0x1d6eef={'where':_0x42858c[_0xf391('0x3a')]};return db[_0xf391('0x2a')]['count'](_0x1d6eef)['then'](function(_0x115969){_0x3fbedd[_0xf391('0x20')]=_0x115969;if(_0x2c78b8[_0xf391('0x2f')][_0xf391('0x3f')]){_0x42858c[_0xf391('0x40')]=[{'all':!![]}];}return db[_0xf391('0x2a')][_0xf391('0x41')](_0x42858c);})[_0xf391('0x24')](function(_0x2bd6ab){_0x3fbedd[_0xf391('0x42')]=_0x2bd6ab;return _0x3fbedd;})[_0xf391('0x24')](respondWithFilteredResult(_0x322db8,_0x42858c))[_0xf391('0x43')](handleError(_0x322db8,null));};exports['show']=function(_0x12706e,_0x110d46){var _0xbc3afc={'raw':!![],'where':{'id':_0x12706e[_0xf391('0x44')]['id']}},_0x2aa19c={};_0x2aa19c[_0xf391('0x35')]=_[_0xf391('0x30')](db[_0xf391('0x2a')][_0xf391('0x2b')]);_0x2aa19c[_0xf391('0x2f')]=_[_0xf391('0x30')](_0x12706e[_0xf391('0x2f')]);_0x2aa19c[_0xf391('0x31')]=_['intersection'](_0x2aa19c['model'],_0x2aa19c[_0xf391('0x2f')]);_0xbc3afc[_0xf391('0x33')]=_[_0xf391('0x32')](_0x2aa19c[_0xf391('0x35')],qs[_0xf391('0x45')](_0x12706e[_0xf391('0x2f')][_0xf391('0x45')]));_0xbc3afc[_0xf391('0x33')]=_0xbc3afc['attributes']['length']?_0xbc3afc[_0xf391('0x33')]:_0x2aa19c['model'];if(_0x12706e['query']['includeAll']){_0xbc3afc[_0xf391('0x40')]=[{'all':!![]}];}_0xbc3afc=_['merge']({},_0xbc3afc,_0x12706e[_0xf391('0x46')]);return db[_0xf391('0x2a')]['find'](_0xbc3afc)[_0xf391('0x24')](handleEntityNotFound(_0x110d46,null))[_0xf391('0x24')](respondWithResult(_0x110d46,null))[_0xf391('0x43')](handleError(_0x110d46,null));};exports[_0xf391('0x47')]=function(_0x52d04d,_0x55356c){return db[_0xf391('0x2a')][_0xf391('0x47')](_0x52d04d[_0xf391('0x48')],{})[_0xf391('0x24')](respondWithResult(_0x55356c,0xc9))[_0xf391('0x43')](handleError(_0x55356c,null));};exports['update']=function(_0x41f697,_0x2992f1){if(_0x41f697[_0xf391('0x48')]['id']){delete _0x41f697[_0xf391('0x48')]['id'];}return db[_0xf391('0x2a')]['find']({'where':{'id':_0x41f697[_0xf391('0x44')]['id']}})['then'](handleEntityNotFound(_0x2992f1,null))[_0xf391('0x24')](saveUpdates(_0x41f697[_0xf391('0x48')],null))[_0xf391('0x24')](respondWithResult(_0x2992f1,null))['catch'](handleError(_0x2992f1,null));};exports[_0xf391('0x49')]=function(_0x59e1c1,_0x16660d){return db[_0xf391('0x2a')][_0xf391('0x4a')]({'where':{'id':_0x59e1c1['params']['id']}})[_0xf391('0x24')](handleEntityNotFound(_0x16660d,null))[_0xf391('0x24')](removeEntity(_0x16660d,null))['catch'](handleError(_0x16660d,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index e85383a..4614049 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 _0xa8bb=['exports','define','SquareMessage','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3ed9ed,_0x5841b0){var _0x4e9106=function(_0x20949b){while(--_0x20949b){_0x3ed9ed['push'](_0x3ed9ed['shift']());}};_0x4e9106(++_0x5841b0);}(_0xa8bb,0xc3));var _0xba8b=function(_0x3728ff,_0x345d4f){_0x3728ff=_0x3728ff-0x0;var _0x11a810=_0xa8bb[_0x3728ff];return _0x11a810;};'use strict';var _=require(_0xba8b('0x0'));var util=require(_0xba8b('0x1'));var logger=require(_0xba8b('0x2'))(_0xba8b('0x3'));var moment=require(_0xba8b('0x4'));var BPromise=require('bluebird');var rp=require(_0xba8b('0x5'));var fs=require('fs');var path=require(_0xba8b('0x6'));var rimraf=require(_0xba8b('0x7'));var config=require(_0xba8b('0x8'));var attributes=require('./squareMessage.attributes');module[_0xba8b('0x9')]=function(_0x187556,_0x3cf61b){return _0x187556[_0xba8b('0xa')](_0xba8b('0xb'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc55e=['path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x25a8d8,_0x1ffea7){var _0x284370=function(_0x491988){while(--_0x491988){_0x25a8d8['push'](_0x25a8d8['shift']());}};_0x284370(++_0x1ffea7);}(_0xc55e,0xbd));var _0xec55=function(_0x2cdaac,_0x534689){_0x2cdaac=_0x2cdaac-0x0;var _0x3190d8=_0xc55e[_0x2cdaac];return _0x3190d8;};'use strict';var _=require(_0xec55('0x0'));var util=require(_0xec55('0x1'));var logger=require(_0xec55('0x2'))(_0xec55('0x3'));var moment=require(_0xec55('0x4'));var BPromise=require(_0xec55('0x5'));var rp=require(_0xec55('0x6'));var fs=require('fs');var path=require(_0xec55('0x7'));var rimraf=require(_0xec55('0x8'));var config=require(_0xec55('0x9'));var attributes=require(_0xec55('0xa'));module['exports']=function(_0x570f69,_0x278193){return _0x570f69[_0xec55('0xb')](_0xec55('0xc'),attributes,{'tableName':_0xec55('0xd'),'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 b2fc27e..48f52ff 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 _0x8fe0=['code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x8fe0,0x1dd));var _0x08fe=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fe0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x08fe('0x0'));var util=require('util');var moment=require(_0x08fe('0x1'));var BPromise=require(_0x08fe('0x2'));var rs=require(_0x08fe('0x3'));var fs=require('fs');var Redis=require(_0x08fe('0x4'));var db=require(_0x08fe('0x5'))['db'];var utils=require(_0x08fe('0x6'));var logger=require(_0x08fe('0x7'))('rpc');var config=require(_0x08fe('0x8'));var jayson=require(_0x08fe('0x9'));var client=jayson[_0x08fe('0xa')][_0x08fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cafc3,_0x4c501c,_0x2900fc){return new BPromise(function(_0xb8bb4e,_0x194f72){return client[_0x08fe('0xc')](_0x2cafc3,_0x2900fc)[_0x08fe('0xd')](function(_0x5990e9){logger[_0x08fe('0xe')]('SquareMessage,\x20%s,\x20%s',_0x4c501c,_0x08fe('0xf'));logger[_0x08fe('0x10')](_0x08fe('0x11'),_0x4c501c,_0x08fe('0xf'),JSON['stringify'](_0x5990e9));if(_0x5990e9[_0x08fe('0x12')]){if(_0x5990e9[_0x08fe('0x12')][_0x08fe('0x13')]===0x1f4){logger[_0x08fe('0x12')](_0x08fe('0x14'),_0x4c501c,_0x5990e9[_0x08fe('0x12')][_0x08fe('0x15')]);return _0x194f72(_0x5990e9[_0x08fe('0x12')][_0x08fe('0x15')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x4c501c,_0x5990e9[_0x08fe('0x12')][_0x08fe('0x15')]);return _0xb8bb4e(_0x5990e9[_0x08fe('0x12')][_0x08fe('0x15')]);}else{logger['info'](_0x08fe('0x14'),_0x4c501c,_0x08fe('0xf'));_0xb8bb4e(_0x5990e9[_0x08fe('0x16')]['message']);}})[_0x08fe('0x17')](function(_0x138437){logger[_0x08fe('0x12')](_0x08fe('0x14'),_0x4c501c,_0x138437);_0x194f72(_0x138437);});});}exports[_0x08fe('0x18')]=function(_0x30d565){var _0x1472dc=this;return new Promise(function(_0x252e90,_0x5ecba9){return db[_0x08fe('0x19')][_0x08fe('0x1a')](_0x30d565[_0x08fe('0x1b')],{'raw':_0x30d565[_0x08fe('0x1c')]?_0x30d565[_0x08fe('0x1c')][_0x08fe('0x1d')]===undefined?!![]:![]:!![]})[_0x08fe('0xd')](function(_0x1828de){logger[_0x08fe('0xe')](_0x08fe('0x18'),_0x30d565);logger[_0x08fe('0x10')](_0x08fe('0x18'),_0x30d565,JSON[_0x08fe('0x1e')](_0x1828de));_0x252e90(_0x1828de);})[_0x08fe('0x17')](function(_0x4c56e6){logger[_0x08fe('0x12')](_0x08fe('0x18'),_0x4c56e6[_0x08fe('0x15')],_0x30d565);_0x5ecba9(_0x1472dc['error'](0x1f4,_0x4c56e6[_0x08fe('0x15')]));});});}; \ No newline at end of file +var _0xd1d1=['message','result','catch','body','options','raw','then','CreateSquareMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x43512d,_0x63027f){var _0x187908=function(_0x51088d){while(--_0x51088d){_0x43512d['push'](_0x43512d['shift']());}};_0x187908(++_0x63027f);}(_0xd1d1,0xb6));var _0x1d1d=function(_0x37d954,_0x2cea2d){_0x37d954=_0x37d954-0x0;var _0x3342fe=_0xd1d1[_0x37d954];return _0x3342fe;};'use strict';var _=require(_0x1d1d('0x0'));var util=require(_0x1d1d('0x1'));var moment=require(_0x1d1d('0x2'));var BPromise=require(_0x1d1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d1d('0x4'));var db=require(_0x1d1d('0x5'))['db'];var utils=require(_0x1d1d('0x6'));var logger=require(_0x1d1d('0x7'))(_0x1d1d('0x8'));var config=require(_0x1d1d('0x9'));var jayson=require(_0x1d1d('0xa'));var client=jayson[_0x1d1d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x411785,_0x2ccc3d,_0xd21d73){return new BPromise(function(_0x3ea0c7,_0x5314c9){return client[_0x1d1d('0xc')](_0x411785,_0xd21d73)['then'](function(_0x4f795c){logger[_0x1d1d('0xd')](_0x1d1d('0xe'),_0x2ccc3d,_0x1d1d('0xf'));logger[_0x1d1d('0x10')](_0x1d1d('0x11'),_0x2ccc3d,'request\x20sent',JSON[_0x1d1d('0x12')](_0x4f795c));if(_0x4f795c[_0x1d1d('0x13')]){if(_0x4f795c[_0x1d1d('0x13')][_0x1d1d('0x14')]===0x1f4){logger['error'](_0x1d1d('0xe'),_0x2ccc3d,_0x4f795c['error'][_0x1d1d('0x15')]);return _0x5314c9(_0x4f795c['error'][_0x1d1d('0x15')]);}logger[_0x1d1d('0x13')](_0x1d1d('0xe'),_0x2ccc3d,_0x4f795c[_0x1d1d('0x13')][_0x1d1d('0x15')]);return _0x3ea0c7(_0x4f795c[_0x1d1d('0x13')][_0x1d1d('0x15')]);}else{logger[_0x1d1d('0xd')](_0x1d1d('0xe'),_0x2ccc3d,'request\x20sent');_0x3ea0c7(_0x4f795c[_0x1d1d('0x16')][_0x1d1d('0x15')]);}})[_0x1d1d('0x17')](function(_0x5e49ba){logger[_0x1d1d('0x13')](_0x1d1d('0xe'),_0x2ccc3d,_0x5e49ba);_0x5314c9(_0x5e49ba);});});}exports['CreateSquareMessage']=function(_0x205be1){var _0x1df591=this;return new Promise(function(_0x330439,_0x594c57){return db['SquareMessage']['create'](_0x205be1[_0x1d1d('0x18')],{'raw':_0x205be1['options']?_0x205be1[_0x1d1d('0x19')][_0x1d1d('0x1a')]===undefined?!![]:![]:!![]})[_0x1d1d('0x1b')](function(_0x465c74){logger[_0x1d1d('0xd')](_0x1d1d('0x1c'),_0x205be1);logger[_0x1d1d('0x10')](_0x1d1d('0x1c'),_0x205be1,JSON[_0x1d1d('0x12')](_0x465c74));_0x330439(_0x465c74);})[_0x1d1d('0x17')](function(_0xa78d76){logger[_0x1d1d('0x13')](_0x1d1d('0x1c'),_0xa78d76[_0x1d1d('0x15')],_0x205be1);_0x594c57(_0x1df591[_0x1d1d('0x13')](0x1f4,_0xa78d76[_0x1d1d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1038edb..edd0762 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 _0xf166=['isAuthenticated','show','/:id/test','15s','test','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','index','/:id'];(function(_0x3d72c1,_0x3d64f5){var _0x36e748=function(_0x4cf06d){while(--_0x4cf06d){_0x3d72c1['push'](_0x3d72c1['shift']());}};_0x36e748(++_0x3d64f5);}(_0xf166,0xf2));var _0x6f16=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf166[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x6f16('0x0'));var util=require(_0x6f16('0x1'));var path=require(_0x6f16('0x2'));var timeout=require(_0x6f16('0x3'));var express=require(_0x6f16('0x4'));var router=express[_0x6f16('0x5')]();var fs_extra=require(_0x6f16('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f16('0x7'));var controller=require('./squareOdbc.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6f16('0x8')]);router['get'](_0x6f16('0x9'),auth[_0x6f16('0xa')](),controller[_0x6f16('0xb')]);router['get'](_0x6f16('0xc'),auth['isAuthenticated'](),timeout(_0x6f16('0xd')),controller[_0x6f16('0xe')]);router[_0x6f16('0xf')]('/',auth['isAuthenticated'](),controller[_0x6f16('0x10')]);router[_0x6f16('0x11')]('/:id',auth[_0x6f16('0xa')](),controller['update']);router[_0x6f16('0x12')]('/:id',auth[_0x6f16('0xa')](),controller[_0x6f16('0x13')]);module[_0x6f16('0x14')]=router; \ No newline at end of file +var _0x3a02=['util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id/test','15s','post','put','update','delete','/:id','destroy','exports'];(function(_0x3f75e5,_0x2cce57){var _0x1972a5=function(_0x3dccd9){while(--_0x3dccd9){_0x3f75e5['push'](_0x3f75e5['shift']());}};_0x1972a5(++_0x2cce57);}(_0x3a02,0xab));var _0x23a0=function(_0xd00d39,_0x50b441){_0xd00d39=_0xd00d39-0x0;var _0x15102c=_0x3a02[_0xd00d39];return _0x15102c;};'use strict';var multer=require('multer');var util=require(_0x23a0('0x0'));var path=require(_0x23a0('0x1'));var timeout=require(_0x23a0('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x23a0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x23a0('0x4'));var config=require(_0x23a0('0x5'));var controller=require(_0x23a0('0x6'));router['get']('/',auth[_0x23a0('0x7')](),controller[_0x23a0('0x8')]);router[_0x23a0('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x23a0('0xa'),auth[_0x23a0('0x7')](),timeout(_0x23a0('0xb')),controller['test']);router[_0x23a0('0xc')]('/',auth[_0x23a0('0x7')](),controller['create']);router[_0x23a0('0xd')]('/:id',auth[_0x23a0('0x7')](),controller[_0x23a0('0xe')]);router[_0x23a0('0xf')](_0x23a0('0x10'),auth[_0x23a0('0x7')](),controller[_0x23a0('0x11')]);module[_0x23a0('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5bf7939..fddcc11 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 _0x221b=['name','exports','STRING'];(function(_0x5c7cf1,_0x2a3502){var _0x1bed4a=function(_0x2e9324){while(--_0x2e9324){_0x5c7cf1['push'](_0x5c7cf1['shift']());}};_0x1bed4a(++_0x2a3502);}(_0x221b,0x199));var _0xb221=function(_0x1b85fe,_0x1b8b6b){_0x1b85fe=_0x1b85fe-0x0;var _0x50d28a=_0x221b[_0x1b85fe];return _0x50d28a;};'use strict';var Sequelize=require('sequelize');module[_0xb221('0x0')]={'name':{'type':Sequelize[_0xb221('0x1')],'unique':_0xb221('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb221('0x1')]},'description':{'type':Sequelize[_0xb221('0x1')]}}; \ No newline at end of file +var _0x5587=['name','sequelize','STRING'];(function(_0x534212,_0x2cde10){var _0x37d3cf=function(_0x1ed029){while(--_0x1ed029){_0x534212['push'](_0x534212['shift']());}};_0x37d3cf(++_0x2cde10);}(_0x5587,0x1f3));var _0x7558=function(_0x3e7423,_0x3657c4){_0x3e7423=_0x3e7423-0x0;var _0x4622ce=_0x5587[_0x3e7423];return _0x4622ce;};'use strict';var Sequelize=require(_0x7558('0x0'));module['exports']={'name':{'type':Sequelize[_0x7558('0x1')],'unique':_0x7558('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7558('0x1')]},'description':{'type':Sequelize[_0x7558('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 17401d1..cb53648 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 _0x936f=['lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','dsn','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x25f849,_0xaaa293){var _0x457597=function(_0x3e8549){while(--_0x3e8549){_0x25f849['push'](_0x25f849['shift']());}};_0x457597(++_0xaaa293);}(_0x936f,0xfd));var _0xf936=function(_0x2848d5,_0x72bdc7){_0x2848d5=_0x2848d5-0x0;var _0x3378ef=_0x936f[_0x2848d5];return _0x3378ef;};'use strict';var emlformat=require(_0xf936('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf936('0x1'));var jsonpatch=require(_0xf936('0x2'));var rp=require(_0xf936('0x3'));var moment=require(_0xf936('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf936('0x5'));var util=require(_0xf936('0x6'));var path=require(_0xf936('0x7'));var sox=require(_0xf936('0x8'));var csv=require(_0xf936('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf936('0xa'));var _=require(_0xf936('0xb'));var squel=require(_0xf936('0xc'));var crypto=require(_0xf936('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf936('0xe'));var toCsv=require(_0xf936('0x9'));var querystring=require('querystring');var Papa=require(_0xf936('0xf'));var Redis=require(_0xf936('0x10'));var authService=require(_0xf936('0x11'));var qs=require(_0xf936('0x12'));var as=require(_0xf936('0x13'));var hardwareService=require(_0xf936('0x14'));var logger=require(_0xf936('0x15'))(_0xf936('0x16'));var utils=require(_0xf936('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf936('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf4ab57,_0x2df742){_0x2df742=_0x2df742||0xcc;return function(_0x9486f4){if(_0x9486f4){return _0xf4ab57[_0xf936('0x19')](_0x2df742);}return _0xf4ab57['status'](_0x2df742)[_0xf936('0x1a')]();};}function respondWithResult(_0x4fe18f,_0x30f912){_0x30f912=_0x30f912||0xc8;return function(_0xd94f67){if(_0xd94f67){return _0x4fe18f[_0xf936('0x1b')](_0x30f912)[_0xf936('0x1c')](_0xd94f67);}};}function respondWithFilteredResult(_0x14c8d8,_0x24305f){return function(_0xbeff6d){if(_0xbeff6d){var _0x3f997e=typeof _0x24305f[_0xf936('0x1d')]==='undefined'&&typeof _0x24305f[_0xf936('0x1e')]===_0xf936('0x1f');var _0x197502=_0xbeff6d['count'];var _0x571466=_0x3f997e?0x0:_0x24305f[_0xf936('0x1d')];var _0x212824=_0x3f997e?_0xbeff6d[_0xf936('0x20')]:_0x24305f[_0xf936('0x1d')]+_0x24305f[_0xf936('0x1e')];var _0x1ae5b2;if(_0x212824>=_0x197502){_0x212824=_0x197502;_0x1ae5b2=0xc8;}else{_0x1ae5b2=0xce;}_0x14c8d8[_0xf936('0x1b')](_0x1ae5b2);return _0x14c8d8[_0xf936('0x21')](_0xf936('0x22'),_0x571466+'-'+_0x212824+'/'+_0x197502)[_0xf936('0x1c')](_0xbeff6d);}return null;};}function patchUpdates(_0x27d1cc){return function(_0xfc49e0){try{jsonpatch['apply'](_0xfc49e0,_0x27d1cc,!![]);}catch(_0xaba72b){return BPromise[_0xf936('0x23')](_0xaba72b);}return _0xfc49e0[_0xf936('0x24')]();};}function saveUpdates(_0x5283a0,_0x59f253){return function(_0x14e931){if(_0x14e931){return _0x14e931[_0xf936('0x25')](_0x5283a0)[_0xf936('0x26')](function(_0x17928b){return _0x17928b;});}return null;};}function removeEntity(_0x2ccd2d,_0x4c906b){return function(_0x40291f){if(_0x40291f){return _0x40291f['destroy']()[_0xf936('0x26')](function(){var _0x45b8c0=_0x40291f[_0xf936('0x27')]({'plain':!![]});var _0x17d350=_0xf936('0x28');return db[_0xf936('0x29')][_0xf936('0x2a')]({'where':{'type':_0x17d350,'resourceId':_0x45b8c0['id']}})[_0xf936('0x26')](function(){return _0x40291f;});})[_0xf936('0x26')](function(){_0x2ccd2d[_0xf936('0x1b')](0xcc)[_0xf936('0x1a')]();});}};}function handleEntityNotFound(_0x183044,_0x2a2b2d){return function(_0xeffb71){if(!_0xeffb71){_0x183044['sendStatus'](0x194);}return _0xeffb71;};}function handleError(_0xf33ea8,_0x21582f){_0x21582f=_0x21582f||0x1f4;return function(_0x5b9de8){logger[_0xf936('0x2b')](_0x5b9de8[_0xf936('0x2c')]);if(_0x5b9de8['name']){delete _0x5b9de8[_0xf936('0x2d')];}_0xf33ea8[_0xf936('0x1b')](_0x21582f)[_0xf936('0x2e')](_0x5b9de8);};}exports[_0xf936('0x2f')]=function(_0x504b8f,_0x14ac22){var _0x182f4c={},_0x2a6bbe={},_0x4241d9={'count':0x0,'rows':[]};var _0x5dbf3e=_[_0xf936('0x30')](db[_0xf936('0x31')][_0xf936('0x32')],function(_0x211df0){return{'name':_0x211df0[_0xf936('0x33')],'type':_0x211df0[_0xf936('0x34')][_0xf936('0x35')]};});_0x2a6bbe[_0xf936('0x36')]=_['map'](_0x5dbf3e,'name');_0x2a6bbe[_0xf936('0x37')]=_['keys'](_0x504b8f['query']);_0x2a6bbe['filters']=_['intersection'](_0x2a6bbe[_0xf936('0x36')],_0x2a6bbe[_0xf936('0x37')]);_0x182f4c['attributes']=_['intersection'](_0x2a6bbe[_0xf936('0x36')],qs[_0xf936('0x38')](_0x504b8f['query'][_0xf936('0x38')]));_0x182f4c[_0xf936('0x39')]=_0x182f4c[_0xf936('0x39')][_0xf936('0x3a')]?_0x182f4c['attributes']:_0x2a6bbe[_0xf936('0x36')];if(!_0x504b8f['query']['hasOwnProperty'](_0xf936('0x3b'))){_0x182f4c[_0xf936('0x1e')]=qs[_0xf936('0x1e')](_0x504b8f['query']['limit']);_0x182f4c[_0xf936('0x1d')]=qs[_0xf936('0x1d')](_0x504b8f[_0xf936('0x37')][_0xf936('0x1d')]);}_0x182f4c[_0xf936('0x3c')]=qs[_0xf936('0x3d')](_0x504b8f[_0xf936('0x37')][_0xf936('0x3d')]);_0x182f4c['where']=qs[_0xf936('0x3e')](_['pick'](_0x504b8f['query'],_0x2a6bbe[_0xf936('0x3e')]),_0x5dbf3e);if(_0x504b8f['query'][_0xf936('0x3f')]){_0x182f4c[_0xf936('0x40')]=_[_0xf936('0x41')](_0x182f4c[_0xf936('0x40')],{'$or':_[_0xf936('0x30')](_0x5dbf3e,function(_0x109c6c){if(_0x109c6c[_0xf936('0x34')]!=='VIRTUAL'){var _0x4a7932={};_0x4a7932[_0x109c6c[_0xf936('0x2d')]]={'$like':'%'+_0x504b8f[_0xf936('0x37')][_0xf936('0x3f')]+'%'};return _0x4a7932;}})});}_0x182f4c=_['merge']({},_0x182f4c,_0x504b8f[_0xf936('0x42')]);var _0x23f51a={'where':_0x182f4c[_0xf936('0x40')]};return db[_0xf936('0x31')][_0xf936('0x20')](_0x23f51a)[_0xf936('0x26')](function(_0x3c88ee){_0x4241d9[_0xf936('0x20')]=_0x3c88ee;if(_0x504b8f[_0xf936('0x37')][_0xf936('0x43')]){_0x182f4c[_0xf936('0x44')]=[{'all':!![]}];}return db[_0xf936('0x31')][_0xf936('0x45')](_0x182f4c);})[_0xf936('0x26')](function(_0x26da87){_0x4241d9[_0xf936('0x46')]=_0x26da87;return _0x4241d9;})[_0xf936('0x26')](respondWithFilteredResult(_0x14ac22,_0x182f4c))[_0xf936('0x47')](handleError(_0x14ac22,null));};exports[_0xf936('0x48')]=function(_0x35407b,_0x4fb8f4){var _0x2b53b0={'raw':!![],'where':{'id':_0x35407b[_0xf936('0x49')]['id']}},_0x18869c={};_0x18869c[_0xf936('0x36')]=_['keys'](db['SquareOdbc'][_0xf936('0x32')]);_0x18869c[_0xf936('0x37')]=_[_0xf936('0x4a')](_0x35407b['query']);_0x18869c['filters']=_[_0xf936('0x4b')](_0x18869c[_0xf936('0x36')],_0x18869c[_0xf936('0x37')]);_0x2b53b0[_0xf936('0x39')]=_['intersection'](_0x18869c['model'],qs[_0xf936('0x38')](_0x35407b[_0xf936('0x37')][_0xf936('0x38')]));_0x2b53b0[_0xf936('0x39')]=_0x2b53b0[_0xf936('0x39')][_0xf936('0x3a')]?_0x2b53b0[_0xf936('0x39')]:_0x18869c[_0xf936('0x36')];if(_0x35407b['query']['includeAll']){_0x2b53b0['include']=[{'all':!![]}];}_0x2b53b0=_[_0xf936('0x41')]({},_0x2b53b0,_0x35407b[_0xf936('0x42')]);return db['SquareOdbc'][_0xf936('0x4c')](_0x2b53b0)[_0xf936('0x26')](handleEntityNotFound(_0x4fb8f4,null))['then'](respondWithResult(_0x4fb8f4,null))['catch'](handleError(_0x4fb8f4,null));};exports[_0xf936('0x4d')]=function(_0x3badfa,_0x495907){return db[_0xf936('0x31')][_0xf936('0x4d')](_0x3badfa['body'],{})[_0xf936('0x26')](function(_0x3078cc){var _0x36a80b=_0x3badfa[_0xf936('0x4e')][_0xf936('0x27')]({'plain':!![]});if(!_0x36a80b)throw new Error(_0xf936('0x4f'));if(_0x36a80b[_0xf936('0x50')]===_0xf936('0x4e')){var _0x3a0471=_0x3078cc[_0xf936('0x27')]({'plain':!![]});var _0x24980a=_0xf936('0x28');return db[_0xf936('0x51')][_0xf936('0x4c')]({'where':{'name':_0x24980a,'userProfileId':_0x36a80b['userProfileId']},'raw':!![]})['then'](function(_0xf3fee7){if(_0xf3fee7&&_0xf3fee7[_0xf936('0x52')]===0x0){return db[_0xf936('0x29')][_0xf936('0x4d')]({'name':_0x3a0471[_0xf936('0x2d')],'resourceId':_0x3a0471['id'],'type':_0xf3fee7['name'],'sectionId':_0xf3fee7['id']},{})[_0xf936('0x26')](function(){return _0x3078cc;});}else{return _0x3078cc;}})[_0xf936('0x47')](function(_0x22525b){logger[_0xf936('0x2b')](_0xf936('0x53'),_0x22525b);throw _0x22525b;});}return _0x3078cc;})['then'](respondWithResult(_0x495907,0xc9))['catch'](handleError(_0x495907,null));};exports['update']=function(_0x3b6411,_0x5b0a43){if(_0x3b6411[_0xf936('0x54')]['id']){delete _0x3b6411[_0xf936('0x54')]['id'];}return db[_0xf936('0x31')][_0xf936('0x4c')]({'where':{'id':_0x3b6411[_0xf936('0x49')]['id']}})[_0xf936('0x26')](handleEntityNotFound(_0x5b0a43,null))[_0xf936('0x26')](saveUpdates(_0x3b6411[_0xf936('0x54')],null))['then'](respondWithResult(_0x5b0a43,null))[_0xf936('0x47')](handleError(_0x5b0a43,null));};exports['destroy']=function(_0x4377d4,_0x15e143){return db[_0xf936('0x31')][_0xf936('0x4c')]({'where':{'id':_0x4377d4[_0xf936('0x49')]['id']}})[_0xf936('0x26')](handleEntityNotFound(_0x15e143,null))[_0xf936('0x26')](removeEntity(_0x15e143,null))[_0xf936('0x47')](handleError(_0x15e143,null));};exports['test']=function(_0x18c4bc,_0x11ade0,_0x293610){var _0x2691e2;return db[_0xf936('0x31')][_0xf936('0x4c')]({'where':{'id':_0x18c4bc[_0xf936('0x49')]['id']},'attributes':['id',_0xf936('0x55')]})[_0xf936('0x26')](handleEntityNotFound(_0x11ade0,null))[_0xf936('0x26')](function(_0x12de32){if(_0x12de32){var _0x534cfe=require('odbc')();_0x534cfe[_0xf936('0x56')](_0x12de32[_0xf936('0x55')]);_0x534cfe[_0xf936('0x57')]();return _0x12de32;}})[_0xf936('0x26')](respondWithResult(_0x11ade0,null))[_0xf936('0x47')](handleError(_0x11ade0,null));}; \ No newline at end of file +var _0x6495=['mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','get','ODBC','UserProfileResource','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','keys','query','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','catch','show','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','params','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6495,0x146));var _0x5649=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6495[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x5649('0x0'));var rimraf=require(_0x5649('0x1'));var zipdir=require(_0x5649('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5649('0x3'));var moment=require(_0x5649('0x4'));var BPromise=require(_0x5649('0x5'));var Mustache=require(_0x5649('0x6'));var util=require(_0x5649('0x7'));var path=require(_0x5649('0x8'));var sox=require(_0x5649('0x9'));var csv=require(_0x5649('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5649('0xb'));var squel=require(_0x5649('0xc'));var crypto=require(_0x5649('0xd'));var jsforce=require(_0x5649('0xe'));var deskjs=require(_0x5649('0xf'));var toCsv=require(_0x5649('0xa'));var querystring=require('querystring');var Papa=require(_0x5649('0x10'));var Redis=require(_0x5649('0x11'));var authService=require(_0x5649('0x12'));var qs=require(_0x5649('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5649('0x14'))(_0x5649('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5649('0x16'));var db=require(_0x5649('0x17'))['db'];function respondWithStatusCode(_0x4c9dd2,_0x31d784){_0x31d784=_0x31d784||0xcc;return function(_0x1caa33){if(_0x1caa33){return _0x4c9dd2[_0x5649('0x18')](_0x31d784);}return _0x4c9dd2[_0x5649('0x19')](_0x31d784)[_0x5649('0x1a')]();};}function respondWithResult(_0x25c4f6,_0x24443b){_0x24443b=_0x24443b||0xc8;return function(_0xadf93a){if(_0xadf93a){return _0x25c4f6['status'](_0x24443b)['json'](_0xadf93a);}};}function respondWithFilteredResult(_0x254caf,_0x55912d){return function(_0x3909bf){if(_0x3909bf){var _0x55e035=typeof _0x55912d[_0x5649('0x1b')]===_0x5649('0x1c')&&typeof _0x55912d[_0x5649('0x1d')]===_0x5649('0x1c');var _0x4f89d2=_0x3909bf['count'];var _0x629902=_0x55e035?0x0:_0x55912d[_0x5649('0x1b')];var _0x1aea78=_0x55e035?_0x3909bf[_0x5649('0x1e')]:_0x55912d[_0x5649('0x1b')]+_0x55912d['limit'];var _0x51335e;if(_0x1aea78>=_0x4f89d2){_0x1aea78=_0x4f89d2;_0x51335e=0xc8;}else{_0x51335e=0xce;}_0x254caf['status'](_0x51335e);return _0x254caf[_0x5649('0x1f')](_0x5649('0x20'),_0x629902+'-'+_0x1aea78+'/'+_0x4f89d2)['json'](_0x3909bf);}return null;};}function patchUpdates(_0x3e7b30){return function(_0x286e57){try{jsonpatch['apply'](_0x286e57,_0x3e7b30,!![]);}catch(_0x59a750){return BPromise['reject'](_0x59a750);}return _0x286e57[_0x5649('0x21')]();};}function saveUpdates(_0x387edb,_0x16e75f){return function(_0x4095d2){if(_0x4095d2){return _0x4095d2[_0x5649('0x22')](_0x387edb)['then'](function(_0x7f272c){return _0x7f272c;});}return null;};}function removeEntity(_0x6e447e,_0x1de2ca){return function(_0x3fdced){if(_0x3fdced){return _0x3fdced[_0x5649('0x23')]()[_0x5649('0x24')](function(){var _0xcf4bb8=_0x3fdced[_0x5649('0x25')]({'plain':!![]});var _0x5c31d6=_0x5649('0x26');return db[_0x5649('0x27')][_0x5649('0x23')]({'where':{'type':_0x5c31d6,'resourceId':_0xcf4bb8['id']}})[_0x5649('0x24')](function(){return _0x3fdced;});})['then'](function(){_0x6e447e[_0x5649('0x19')](0xcc)[_0x5649('0x1a')]();});}};}function handleEntityNotFound(_0x343e05,_0x1b6a87){return function(_0x405e93){if(!_0x405e93){_0x343e05[_0x5649('0x18')](0x194);}return _0x405e93;};}function handleError(_0x2e3fae,_0x3e3fcf){_0x3e3fcf=_0x3e3fcf||0x1f4;return function(_0x1a57bf){logger[_0x5649('0x28')](_0x1a57bf[_0x5649('0x29')]);if(_0x1a57bf[_0x5649('0x2a')]){delete _0x1a57bf[_0x5649('0x2a')];}_0x2e3fae[_0x5649('0x19')](_0x3e3fcf)['send'](_0x1a57bf);};}exports[_0x5649('0x2b')]=function(_0x5f4c0c,_0x2e117b){var _0x148040={},_0x491829={},_0x500f28={'count':0x0,'rows':[]};var _0x13bd98=_[_0x5649('0x2c')](db[_0x5649('0x2d')][_0x5649('0x2e')],function(_0x1d3f3f){return{'name':_0x1d3f3f[_0x5649('0x2f')],'type':_0x1d3f3f[_0x5649('0x30')][_0x5649('0x31')]};});_0x491829['model']=_[_0x5649('0x2c')](_0x13bd98,_0x5649('0x2a'));_0x491829['query']=_[_0x5649('0x32')](_0x5f4c0c[_0x5649('0x33')]);_0x491829['filters']=_['intersection'](_0x491829[_0x5649('0x34')],_0x491829['query']);_0x148040[_0x5649('0x35')]=_['intersection'](_0x491829['model'],qs[_0x5649('0x36')](_0x5f4c0c[_0x5649('0x33')][_0x5649('0x36')]));_0x148040[_0x5649('0x35')]=_0x148040[_0x5649('0x35')][_0x5649('0x37')]?_0x148040['attributes']:_0x491829[_0x5649('0x34')];if(!_0x5f4c0c[_0x5649('0x33')][_0x5649('0x38')]('nolimit')){_0x148040[_0x5649('0x1d')]=qs[_0x5649('0x1d')](_0x5f4c0c['query'][_0x5649('0x1d')]);_0x148040[_0x5649('0x1b')]=qs[_0x5649('0x1b')](_0x5f4c0c[_0x5649('0x33')][_0x5649('0x1b')]);}_0x148040[_0x5649('0x39')]=qs[_0x5649('0x3a')](_0x5f4c0c[_0x5649('0x33')][_0x5649('0x3a')]);_0x148040[_0x5649('0x3b')]=qs[_0x5649('0x3c')](_[_0x5649('0x3d')](_0x5f4c0c['query'],_0x491829[_0x5649('0x3c')]),_0x13bd98);if(_0x5f4c0c['query'][_0x5649('0x3e')]){_0x148040['where']=_[_0x5649('0x3f')](_0x148040['where'],{'$or':_[_0x5649('0x2c')](_0x13bd98,function(_0x1b8cde){if(_0x1b8cde['type']!==_0x5649('0x40')){var _0x375a70={};_0x375a70[_0x1b8cde[_0x5649('0x2a')]]={'$like':'%'+_0x5f4c0c['query'][_0x5649('0x3e')]+'%'};return _0x375a70;}})});}_0x148040=_[_0x5649('0x3f')]({},_0x148040,_0x5f4c0c['options']);var _0x132aa1={'where':_0x148040[_0x5649('0x3b')]};return db[_0x5649('0x2d')]['count'](_0x132aa1)['then'](function(_0x47a0c5){_0x500f28[_0x5649('0x1e')]=_0x47a0c5;if(_0x5f4c0c[_0x5649('0x33')][_0x5649('0x41')]){_0x148040['include']=[{'all':!![]}];}return db[_0x5649('0x2d')]['findAll'](_0x148040);})[_0x5649('0x24')](function(_0x180cf8){_0x500f28['rows']=_0x180cf8;return _0x500f28;})[_0x5649('0x24')](respondWithFilteredResult(_0x2e117b,_0x148040))[_0x5649('0x42')](handleError(_0x2e117b,null));};exports[_0x5649('0x43')]=function(_0x661b9c,_0x41e2c7){var _0x216dc0={'raw':!![],'where':{'id':_0x661b9c['params']['id']}},_0x460bb7={};_0x460bb7[_0x5649('0x34')]=_[_0x5649('0x32')](db[_0x5649('0x2d')][_0x5649('0x2e')]);_0x460bb7[_0x5649('0x33')]=_[_0x5649('0x32')](_0x661b9c[_0x5649('0x33')]);_0x460bb7[_0x5649('0x3c')]=_[_0x5649('0x44')](_0x460bb7[_0x5649('0x34')],_0x460bb7[_0x5649('0x33')]);_0x216dc0[_0x5649('0x35')]=_[_0x5649('0x44')](_0x460bb7[_0x5649('0x34')],qs[_0x5649('0x36')](_0x661b9c[_0x5649('0x33')][_0x5649('0x36')]));_0x216dc0[_0x5649('0x35')]=_0x216dc0[_0x5649('0x35')][_0x5649('0x37')]?_0x216dc0[_0x5649('0x35')]:_0x460bb7[_0x5649('0x34')];if(_0x661b9c[_0x5649('0x33')][_0x5649('0x41')]){_0x216dc0[_0x5649('0x45')]=[{'all':!![]}];}_0x216dc0=_[_0x5649('0x3f')]({},_0x216dc0,_0x661b9c[_0x5649('0x46')]);return db[_0x5649('0x2d')][_0x5649('0x47')](_0x216dc0)[_0x5649('0x24')](handleEntityNotFound(_0x41e2c7,null))[_0x5649('0x24')](respondWithResult(_0x41e2c7,null))[_0x5649('0x42')](handleError(_0x41e2c7,null));};exports[_0x5649('0x48')]=function(_0x4e79a1,_0xb5f9f2){return db[_0x5649('0x2d')][_0x5649('0x48')](_0x4e79a1[_0x5649('0x49')],{})[_0x5649('0x24')](function(_0x207183){var _0x6103e=_0x4e79a1[_0x5649('0x4a')]['get']({'plain':!![]});if(!_0x6103e)throw new Error(_0x5649('0x4b'));if(_0x6103e['role']===_0x5649('0x4a')){var _0xb2581b=_0x207183[_0x5649('0x25')]({'plain':!![]});var _0x41aafe=_0x5649('0x26');return db[_0x5649('0x4c')][_0x5649('0x47')]({'where':{'name':_0x41aafe,'userProfileId':_0x6103e[_0x5649('0x4d')]},'raw':!![]})[_0x5649('0x24')](function(_0x49ab7a){if(_0x49ab7a&&_0x49ab7a['autoAssociation']===0x0){return db[_0x5649('0x27')]['create']({'name':_0xb2581b[_0x5649('0x2a')],'resourceId':_0xb2581b['id'],'type':_0x49ab7a[_0x5649('0x2a')],'sectionId':_0x49ab7a['id']},{})[_0x5649('0x24')](function(){return _0x207183;});}else{return _0x207183;}})[_0x5649('0x42')](function(_0x167b95){logger[_0x5649('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x167b95);throw _0x167b95;});}return _0x207183;})[_0x5649('0x24')](respondWithResult(_0xb5f9f2,0xc9))[_0x5649('0x42')](handleError(_0xb5f9f2,null));};exports['update']=function(_0x4f3a79,_0x2a715a){if(_0x4f3a79[_0x5649('0x49')]['id']){delete _0x4f3a79[_0x5649('0x49')]['id'];}return db[_0x5649('0x2d')][_0x5649('0x47')]({'where':{'id':_0x4f3a79[_0x5649('0x4e')]['id']}})[_0x5649('0x24')](handleEntityNotFound(_0x2a715a,null))['then'](saveUpdates(_0x4f3a79[_0x5649('0x49')],null))[_0x5649('0x24')](respondWithResult(_0x2a715a,null))['catch'](handleError(_0x2a715a,null));};exports[_0x5649('0x23')]=function(_0x31c555,_0xd1263a){return db[_0x5649('0x2d')][_0x5649('0x47')]({'where':{'id':_0x31c555[_0x5649('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd1263a,null))[_0x5649('0x24')](removeEntity(_0xd1263a,null))[_0x5649('0x42')](handleError(_0xd1263a,null));};exports['test']=function(_0x3391b0,_0x4041a0,_0x1d2a8b){var _0x196bdd;return db[_0x5649('0x2d')][_0x5649('0x47')]({'where':{'id':_0x3391b0[_0x5649('0x4e')]['id']},'attributes':['id',_0x5649('0x4f')]})['then'](handleEntityNotFound(_0x4041a0,null))[_0x5649('0x24')](function(_0x2e9627){if(_0x2e9627){var _0x1a4567=require(_0x5649('0x50'))();_0x1a4567[_0x5649('0x51')](_0x2e9627[_0x5649('0x4f')]);_0x1a4567[_0x5649('0x52')]();return _0x2e9627;}})['then'](respondWithResult(_0x4041a0,null))[_0x5649('0x42')](handleError(_0x4041a0,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 171e23a..feac128 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 _0x350e=['rimraf','../../config/environment','./squareOdbc.attributes','util','api','moment','request-promise','path'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0x350e,0x1f3));var _0xe350=function(_0xbaf9bf,_0x5d96b2){_0xbaf9bf=_0xbaf9bf-0x0;var _0x2987ea=_0x350e[_0xbaf9bf];return _0x2987ea;};'use strict';var _=require('lodash');var util=require(_0xe350('0x0'));var logger=require('../../config/logger')(_0xe350('0x1'));var moment=require(_0xe350('0x2'));var BPromise=require('bluebird');var rp=require(_0xe350('0x3'));var fs=require('fs');var path=require(_0xe350('0x4'));var rimraf=require(_0xe350('0x5'));var config=require(_0xe350('0x6'));var attributes=require(_0xe350('0x7'));module['exports']=function(_0x5ba68b,_0xe15d62){return _0x5ba68b['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82eb=['bluebird','request-promise','path','rimraf','../../config/environment','SquareOdbc','square_odbc','util'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x82eb,0x67));var _0xb82e=function(_0x1be049,_0x2fd7d0){_0x1be049=_0x1be049-0x0;var _0x4c0b14=_0x82eb[_0x1be049];return _0x4c0b14;};'use strict';var _=require('lodash');var util=require(_0xb82e('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb82e('0x1'));var rp=require(_0xb82e('0x2'));var fs=require('fs');var path=require(_0xb82e('0x3'));var rimraf=require(_0xb82e('0x4'));var config=require(_0xb82e('0x5'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x31673b,_0x10fd2f){return _0x31673b['define'](_0xb82e('0x6'),attributes,{'tableName':_0xb82e('0x7'),'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 1efed26..30e86de 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 _0x7899=['include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../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','options','raw','attributes'];(function(_0x4d72a6,_0x2279a0){var _0x34997b=function(_0x17adbe){while(--_0x17adbe){_0x4d72a6['push'](_0x4d72a6['shift']());}};_0x34997b(++_0x2279a0);}(_0x7899,0xe4));var _0x9789=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x7899[_0x216d45];return _0xbaac0b;};'use strict';var _=require(_0x9789('0x0'));var util=require(_0x9789('0x1'));var moment=require(_0x9789('0x2'));var BPromise=require('bluebird');var rs=require(_0x9789('0x3'));var fs=require('fs');var Redis=require(_0x9789('0x4'));var db=require(_0x9789('0x5'))['db'];var utils=require(_0x9789('0x6'));var logger=require(_0x9789('0x7'))(_0x9789('0x8'));var config=require(_0x9789('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9789('0xa')][_0x9789('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c8cde,_0x4f572a,_0x23ad2f){return new BPromise(function(_0x536144,_0x8c5c23){return client[_0x9789('0xc')](_0x4c8cde,_0x23ad2f)[_0x9789('0xd')](function(_0x422dd4){logger[_0x9789('0xe')](_0x9789('0xf'),_0x4f572a,_0x9789('0x10'));logger[_0x9789('0x11')](_0x9789('0x12'),_0x4f572a,_0x9789('0x10'),JSON['stringify'](_0x422dd4));if(_0x422dd4[_0x9789('0x13')]){if(_0x422dd4[_0x9789('0x13')][_0x9789('0x14')]===0x1f4){logger['error'](_0x9789('0xf'),_0x4f572a,_0x422dd4[_0x9789('0x13')][_0x9789('0x15')]);return _0x8c5c23(_0x422dd4[_0x9789('0x13')][_0x9789('0x15')]);}logger[_0x9789('0x13')](_0x9789('0xf'),_0x4f572a,_0x422dd4['error'][_0x9789('0x15')]);return _0x536144(_0x422dd4[_0x9789('0x13')][_0x9789('0x15')]);}else{logger['info'](_0x9789('0xf'),_0x4f572a,'request\x20sent');_0x536144(_0x422dd4[_0x9789('0x16')][_0x9789('0x15')]);}})[_0x9789('0x17')](function(_0x2c9f4c){logger[_0x9789('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x4f572a,_0x2c9f4c);_0x8c5c23(_0x2c9f4c);});});}exports[_0x9789('0x18')]=function(_0x217684){var _0x57c099=this;return new Promise(function(_0x501e88,_0x2f9b9c){return db['SquareOdbc']['find']({'raw':_0x217684[_0x9789('0x19')]?_0x217684['options'][_0x9789('0x1a')]===undefined?!![]:![]:!![],'where':_0x217684[_0x9789('0x19')]?_0x217684[_0x9789('0x19')]['where']||null:null,'attributes':_0x217684[_0x9789('0x19')]?_0x217684[_0x9789('0x19')][_0x9789('0x1b')]||null:null,'include':_0x217684[_0x9789('0x19')]?_0x217684['options'][_0x9789('0x1c')]?_[_0x9789('0x1d')](_0x217684['options']['include'],function(_0x4109d8){return{'model':db[_0x4109d8[_0x9789('0x1e')]],'as':_0x4109d8['as'],'attributes':_0x4109d8[_0x9789('0x1b')],'include':_0x4109d8[_0x9789('0x1c')]?_[_0x9789('0x1d')](_0x4109d8[_0x9789('0x1c')],function(_0x383da7){return{'model':db[_0x383da7[_0x9789('0x1e')]],'as':_0x383da7['as'],'attributes':_0x383da7[_0x9789('0x1b')],'include':_0x383da7[_0x9789('0x1c')]?_[_0x9789('0x1d')](_0x383da7[_0x9789('0x1c')],function(_0x220cca){return{'model':db[_0x220cca['model']],'as':_0x220cca['as'],'attributes':_0x220cca['attributes']};}):[]};}):[]};}):[]:[]})[_0x9789('0xd')](function(_0x290df9){logger[_0x9789('0xe')]('ShowSquareOdbc',_0x217684);logger[_0x9789('0x11')](_0x9789('0x18'),_0x217684,JSON[_0x9789('0x1f')](_0x290df9));_0x501e88(_0x290df9);})['catch'](function(_0x1e2947){logger[_0x9789('0x13')](_0x9789('0x18'),_0x1e2947[_0x9789('0x15')],_0x217684);_0x2f9b9c(_0x57c099['error'](0x1f4,_0x1e2947[_0x9789('0x15')]));});});}; \ No newline at end of file +var _0x79e3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','ShowSquareOdbc','find','options','raw','where','attributes','model','include','map','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x79e3,0x1b4));var _0x379e=function(_0x2f9563,_0x4ecf38){_0x2f9563=_0x2f9563-0x0;var _0x164881=_0x79e3[_0x2f9563];return _0x164881;};'use strict';var _=require(_0x379e('0x0'));var util=require('util');var moment=require(_0x379e('0x1'));var BPromise=require(_0x379e('0x2'));var rs=require(_0x379e('0x3'));var fs=require('fs');var Redis=require(_0x379e('0x4'));var db=require(_0x379e('0x5'))['db'];var utils=require(_0x379e('0x6'));var logger=require(_0x379e('0x7'))(_0x379e('0x8'));var config=require(_0x379e('0x9'));var jayson=require(_0x379e('0xa'));var client=jayson[_0x379e('0xb')][_0x379e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c5b07,_0x98ab29,_0x1e33d5){return new BPromise(function(_0x266149,_0x33a5ce){return client[_0x379e('0xd')](_0x5c5b07,_0x1e33d5)[_0x379e('0xe')](function(_0x5716c9){logger['info'](_0x379e('0xf'),_0x98ab29,_0x379e('0x10'));logger['debug'](_0x379e('0x11'),_0x98ab29,_0x379e('0x10'),JSON['stringify'](_0x5716c9));if(_0x5716c9[_0x379e('0x12')]){if(_0x5716c9[_0x379e('0x12')][_0x379e('0x13')]===0x1f4){logger[_0x379e('0x12')](_0x379e('0xf'),_0x98ab29,_0x5716c9[_0x379e('0x12')][_0x379e('0x14')]);return _0x33a5ce(_0x5716c9[_0x379e('0x12')][_0x379e('0x14')]);}logger['error'](_0x379e('0xf'),_0x98ab29,_0x5716c9[_0x379e('0x12')][_0x379e('0x14')]);return _0x266149(_0x5716c9['error'][_0x379e('0x14')]);}else{logger[_0x379e('0x15')]('SquareOdbc,\x20%s,\x20%s',_0x98ab29,_0x379e('0x10'));_0x266149(_0x5716c9['result'][_0x379e('0x14')]);}})[_0x379e('0x16')](function(_0x40f1ea){logger['error'](_0x379e('0xf'),_0x98ab29,_0x40f1ea);_0x33a5ce(_0x40f1ea);});});}exports[_0x379e('0x17')]=function(_0x92cc03){var _0x908cb0=this;return new Promise(function(_0x1b2a04,_0x50ae6f){return db['SquareOdbc'][_0x379e('0x18')]({'raw':_0x92cc03[_0x379e('0x19')]?_0x92cc03[_0x379e('0x19')][_0x379e('0x1a')]===undefined?!![]:![]:!![],'where':_0x92cc03[_0x379e('0x19')]?_0x92cc03['options'][_0x379e('0x1b')]||null:null,'attributes':_0x92cc03[_0x379e('0x19')]?_0x92cc03[_0x379e('0x19')][_0x379e('0x1c')]||null:null,'include':_0x92cc03[_0x379e('0x19')]?_0x92cc03[_0x379e('0x19')]['include']?_['map'](_0x92cc03[_0x379e('0x19')]['include'],function(_0x3c1ae8){return{'model':db[_0x3c1ae8[_0x379e('0x1d')]],'as':_0x3c1ae8['as'],'attributes':_0x3c1ae8[_0x379e('0x1c')],'include':_0x3c1ae8[_0x379e('0x1e')]?_[_0x379e('0x1f')](_0x3c1ae8[_0x379e('0x1e')],function(_0x307e6f){return{'model':db[_0x307e6f[_0x379e('0x1d')]],'as':_0x307e6f['as'],'attributes':_0x307e6f['attributes'],'include':_0x307e6f['include']?_[_0x379e('0x1f')](_0x307e6f['include'],function(_0x5ae6ab){return{'model':db[_0x5ae6ab[_0x379e('0x1d')]],'as':_0x5ae6ab['as'],'attributes':_0x5ae6ab[_0x379e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x379e('0xe')](function(_0x5cfe6b){logger[_0x379e('0x15')](_0x379e('0x17'),_0x92cc03);logger[_0x379e('0x20')]('ShowSquareOdbc',_0x92cc03,JSON[_0x379e('0x21')](_0x5cfe6b));_0x1b2a04(_0x5cfe6b);})[_0x379e('0x16')](function(_0x52adbc){logger[_0x379e('0x12')]('ShowSquareOdbc',_0x52adbc[_0x379e('0x14')],_0x92cc03);_0x50ae6f(_0x908cb0[_0x379e('0x12')](0x1f4,_0x52adbc[_0x379e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index fe8ac6d..63b4b56 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 _0xa67e=['/:id','show','/:id/users','post','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareProject.controller','get','isAuthenticated','index'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0xa67e,0xce));var _0xea67=function(_0x5a57a2,_0x25e81d){_0x5a57a2=_0x5a57a2-0x0;var _0x4754bb=_0xa67e[_0x5a57a2];return _0x4754bb;};'use strict';var multer=require('multer');var util=require(_0xea67('0x0'));var path=require('path');var timeout=require(_0xea67('0x1'));var express=require(_0xea67('0x2'));var router=express[_0xea67('0x3')]();var fs_extra=require(_0xea67('0x4'));var auth=require(_0xea67('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea67('0x6'));router[_0xea67('0x7')]('/',auth[_0xea67('0x8')](),controller[_0xea67('0x9')]);router[_0xea67('0x7')](_0xea67('0xa'),auth[_0xea67('0x8')](),controller[_0xea67('0xb')]);router[_0xea67('0x7')](_0xea67('0xc'),auth[_0xea67('0x8')](),controller['getUsers']);router[_0xea67('0xd')]('/',auth[_0xea67('0x8')](),controller[_0xea67('0xe')]);router[_0xea67('0xd')](_0xea67('0xc'),auth['isAuthenticated'](),controller['addUsers']);router['put']('/:id',auth[_0xea67('0x8')](),controller[_0xea67('0xf')]);router[_0xea67('0x10')]('/:id',auth[_0xea67('0x8')](),controller[_0xea67('0x11')]);router['delete'](_0xea67('0xc'),auth[_0xea67('0x8')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file +var _0x5204=['addUsers','put','update','delete','destroy','removeUsers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create'];(function(_0x1f0ca7,_0x403fe9){var _0x107ec2=function(_0x12f7af){while(--_0x12f7af){_0x1f0ca7['push'](_0x1f0ca7['shift']());}};_0x107ec2(++_0x403fe9);}(_0x5204,0xdf));var _0x4520=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x5204[_0x55d8c5];return _0x225ae5;};'use strict';var multer=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var path=require('path');var timeout=require(_0x4520('0x2'));var express=require(_0x4520('0x3'));var router=express[_0x4520('0x4')]();var fs_extra=require(_0x4520('0x5'));var auth=require(_0x4520('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4520('0x7'));var controller=require('./squareProject.controller');router[_0x4520('0x8')]('/',auth[_0x4520('0x9')](),controller[_0x4520('0xa')]);router[_0x4520('0x8')](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0xc')]);router['get'](_0x4520('0xd'),auth['isAuthenticated'](),controller[_0x4520('0xe')]);router[_0x4520('0xf')]('/',auth[_0x4520('0x9')](),controller[_0x4520('0x10')]);router[_0x4520('0xf')](_0x4520('0xd'),auth[_0x4520('0x9')](),controller[_0x4520('0x11')]);router[_0x4520('0x12')](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0x13')]);router[_0x4520('0x14')](_0x4520('0xb'),auth[_0x4520('0x9')](),controller[_0x4520('0x15')]);router[_0x4520('0x14')](_0x4520('0xd'),auth[_0x4520('0x9')](),controller[_0x4520('0x16')]);module[_0x4520('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 4b9f191..d8401f0 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 _0x59ee=['long','getDataValue','preproduction','toString','utf8','DATE','exports','name','TEXT','BLOB'];(function(_0x329a4c,_0x4a124f){var _0x4b4197=function(_0x1ba774){while(--_0x1ba774){_0x329a4c['push'](_0x329a4c['shift']());}};_0x4b4197(++_0x4a124f);}(_0x59ee,0x1a0));var _0xe59e=function(_0x4ab32c,_0x44ab5e){_0x4ab32c=_0x4ab32c-0x0;var _0x2b9644=_0x59ee[_0x4ab32c];return _0x2b9644;};'use strict';var Sequelize=require('sequelize');module[_0xe59e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe59e('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xe59e('0x2')]},'preproduction':{'type':Sequelize[_0xe59e('0x3')](_0xe59e('0x4')),'get':function(){if(this[_0xe59e('0x5')](_0xe59e('0x6'))){return this[_0xe59e('0x5')](_0xe59e('0x6'))[_0xe59e('0x7')](_0xe59e('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xe59e('0x4')),'get':function(){if(this[_0xe59e('0x5')]('production')){return this[_0xe59e('0x5')]('production')['toString'](_0xe59e('0x8'));}}},'savedAt':{'type':Sequelize[_0xe59e('0x9')]},'publishedAt':{'type':Sequelize[_0xe59e('0x9')]}}; \ No newline at end of file +var _0x4996=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0x1d85e9,_0x58f543){var _0x894dbd=function(_0x22eced){while(--_0x22eced){_0x1d85e9['push'](_0x1d85e9['shift']());}};_0x894dbd(++_0x58f543);}(_0x4996,0x173));var _0x6499=function(_0x3aaf33,_0x4c56fe){_0x3aaf33=_0x3aaf33-0x0;var _0x281a10=_0x4996[_0x3aaf33];return _0x281a10;};'use strict';var Sequelize=require(_0x6499('0x0'));module[_0x6499('0x1')]={'name':{'type':Sequelize[_0x6499('0x2')],'unique':_0x6499('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6499('0x2')]},'notes':{'type':Sequelize[_0x6499('0x4')]},'preproduction':{'type':Sequelize[_0x6499('0x5')](_0x6499('0x6')),'get':function(){if(this[_0x6499('0x7')]('preproduction')){return this[_0x6499('0x7')](_0x6499('0x8'))[_0x6499('0x9')](_0x6499('0xa'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue']('production')){return this[_0x6499('0x7')](_0x6499('0xb'))[_0x6499('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x6499('0xc')]},'publishedAt':{'type':Sequelize[_0x6499('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index d9120b1..27dc85e 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 _0x99f8=['autoAssociation','catch','update','body','find','params','destroy','addUsers','ids','removeUsers','userSquareProject:remove','emit','getUsers','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./squareProject.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareProject','findAll','rows','show','includeAll','include','create','role','user','UserProfileSection','userProfileId'];(function(_0x4ba9fb,_0x5d82f2){var _0x573085=function(_0x1ae084){while(--_0x1ae084){_0x4ba9fb['push'](_0x4ba9fb['shift']());}};_0x573085(++_0x5d82f2);}(_0x99f8,0xcc));var _0x899f=function(_0x4115cb,_0xd99479){_0x4115cb=_0x4115cb-0x0;var _0x59726e=_0x99f8[_0x4115cb];return _0x59726e;};'use strict';var emlformat=require(_0x899f('0x0'));var rimraf=require(_0x899f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x899f('0x2'));var rp=require(_0x899f('0x3'));var moment=require(_0x899f('0x4'));var BPromise=require(_0x899f('0x5'));var Mustache=require(_0x899f('0x6'));var util=require('util');var path=require(_0x899f('0x7'));var sox=require(_0x899f('0x8'));var csv=require(_0x899f('0x9'));var ejs=require(_0x899f('0xa'));var fs=require('fs');var fs_extra=require(_0x899f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x899f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x899f('0xd'));var toCsv=require(_0x899f('0x9'));var querystring=require(_0x899f('0xe'));var Papa=require(_0x899f('0xf'));var Redis=require(_0x899f('0x10'));var authService=require(_0x899f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x899f('0x12'));var logger=require(_0x899f('0x13'))(_0x899f('0x14'));var utils=require(_0x899f('0x15'));var config=require(_0x899f('0x16'));var licenseUtil=require(_0x899f('0x17'));var db=require('../../mysqldb')['db'];config[_0x899f('0x18')]=_[_0x899f('0x19')](config[_0x899f('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x899f('0x18')]));require(_0x899f('0x1a'))[_0x899f('0x1b')](socket);function respondWithStatusCode(_0x140bab,_0x2721ef){_0x2721ef=_0x2721ef||0xcc;return function(_0x49158a){if(_0x49158a){return _0x140bab[_0x899f('0x1c')](_0x2721ef);}return _0x140bab[_0x899f('0x1d')](_0x2721ef)[_0x899f('0x1e')]();};}function respondWithResult(_0x506969,_0x96f2){_0x96f2=_0x96f2||0xc8;return function(_0x3a3164){if(_0x3a3164){return _0x506969[_0x899f('0x1d')](_0x96f2)['json'](_0x3a3164);}};}function respondWithFilteredResult(_0x4b25f5,_0x38084c){return function(_0x318ba3){if(_0x318ba3){var _0x39ad32=typeof _0x38084c[_0x899f('0x1f')]===_0x899f('0x20')&&typeof _0x38084c[_0x899f('0x21')]==='undefined';var _0x4811c8=_0x318ba3[_0x899f('0x22')];var _0x48ee4e=_0x39ad32?0x0:_0x38084c['offset'];var _0x245a63=_0x39ad32?_0x318ba3[_0x899f('0x22')]:_0x38084c[_0x899f('0x1f')]+_0x38084c[_0x899f('0x21')];var _0x782394;if(_0x245a63>=_0x4811c8){_0x245a63=_0x4811c8;_0x782394=0xc8;}else{_0x782394=0xce;}_0x4b25f5['status'](_0x782394);return _0x4b25f5['set'](_0x899f('0x23'),_0x48ee4e+'-'+_0x245a63+'/'+_0x4811c8)[_0x899f('0x24')](_0x318ba3);}return null;};}function patchUpdates(_0x20d7b6){return function(_0x22347a){try{jsonpatch[_0x899f('0x25')](_0x22347a,_0x20d7b6,!![]);}catch(_0x22df5f){return BPromise[_0x899f('0x26')](_0x22df5f);}return _0x22347a['save']();};}function saveUpdates(_0x130b94,_0x1099dd){return function(_0x4c29e0){if(_0x4c29e0){return _0x4c29e0['update'](_0x130b94)['then'](function(_0x4ac2ea){return _0x4ac2ea;});}return null;};}function removeEntity(_0x10bf67,_0x1fb213){return function(_0x5b5ae5){if(_0x5b5ae5){return _0x5b5ae5['destroy']()[_0x899f('0x27')](function(){var _0x2b2c6e=_0x5b5ae5[_0x899f('0x28')]({'plain':!![]});var _0x1f5a6c=_0x899f('0x29');return db[_0x899f('0x2a')]['destroy']({'where':{'type':_0x1f5a6c,'resourceId':_0x2b2c6e['id']}})[_0x899f('0x27')](function(){return _0x5b5ae5;});})[_0x899f('0x27')](function(){_0x10bf67[_0x899f('0x1d')](0xcc)[_0x899f('0x1e')]();});}};}function handleEntityNotFound(_0x34017c,_0x343214){return function(_0x154b3d){if(!_0x154b3d){_0x34017c['sendStatus'](0x194);}return _0x154b3d;};}function handleError(_0x1efae1,_0x35e86e){_0x35e86e=_0x35e86e||0x1f4;return function(_0x3e4f18){logger[_0x899f('0x2b')](_0x3e4f18[_0x899f('0x2c')]);if(_0x3e4f18['name']){delete _0x3e4f18[_0x899f('0x2d')];}_0x1efae1[_0x899f('0x1d')](_0x35e86e)[_0x899f('0x2e')](_0x3e4f18);};}exports[_0x899f('0x2f')]=function(_0x102ca0,_0x11e7c1){var _0x274811={},_0x396803={},_0x45d925={'count':0x0,'rows':[]};var _0x43576c=_[_0x899f('0x30')](db['SquareProject'][_0x899f('0x31')],function(_0xc81a9e){return{'name':_0xc81a9e[_0x899f('0x32')],'type':_0xc81a9e[_0x899f('0x33')][_0x899f('0x34')]};});_0x396803[_0x899f('0x35')]=_[_0x899f('0x30')](_0x43576c,'name');_0x396803[_0x899f('0x36')]=_[_0x899f('0x37')](_0x102ca0[_0x899f('0x36')]);_0x396803[_0x899f('0x38')]=_[_0x899f('0x39')](_0x396803[_0x899f('0x35')],_0x396803[_0x899f('0x36')]);_0x274811['attributes']=_['intersection'](_0x396803['model'],qs['fields'](_0x102ca0[_0x899f('0x36')][_0x899f('0x3a')]));_0x274811[_0x899f('0x3b')]=_0x274811[_0x899f('0x3b')][_0x899f('0x3c')]?_0x274811[_0x899f('0x3b')]:_0x396803[_0x899f('0x35')];if(!_0x102ca0['query'][_0x899f('0x3d')]('nolimit')){_0x274811[_0x899f('0x21')]=qs[_0x899f('0x21')](_0x102ca0[_0x899f('0x36')][_0x899f('0x21')]);_0x274811[_0x899f('0x1f')]=qs[_0x899f('0x1f')](_0x102ca0[_0x899f('0x36')][_0x899f('0x1f')]);}_0x274811[_0x899f('0x3e')]=qs[_0x899f('0x3f')](_0x102ca0['query'][_0x899f('0x3f')]);_0x274811[_0x899f('0x40')]=qs[_0x899f('0x38')](_[_0x899f('0x41')](_0x102ca0['query'],_0x396803[_0x899f('0x38')]),_0x43576c);if(_0x102ca0[_0x899f('0x36')]['filter']){_0x274811[_0x899f('0x40')]=_[_0x899f('0x42')](_0x274811['where'],{'$or':_[_0x899f('0x30')](_0x43576c,function(_0x584960){if(_0x584960[_0x899f('0x33')]!==_0x899f('0x43')){var _0x5d8a66={};_0x5d8a66[_0x584960[_0x899f('0x2d')]]={'$like':'%'+_0x102ca0[_0x899f('0x36')][_0x899f('0x44')]+'%'};return _0x5d8a66;}})});}_0x274811=_['merge']({},_0x274811,_0x102ca0[_0x899f('0x45')]);var _0x14e49f={'where':_0x274811['where']};return db['SquareProject'][_0x899f('0x22')](_0x14e49f)[_0x899f('0x27')](function(_0x1bf273){_0x45d925[_0x899f('0x22')]=_0x1bf273;if(_0x102ca0[_0x899f('0x36')]['includeAll']){_0x274811['include']=[{'all':!![]}];}return db[_0x899f('0x46')][_0x899f('0x47')](_0x274811);})[_0x899f('0x27')](function(_0x2e3e14){_0x45d925[_0x899f('0x48')]=_0x2e3e14;return _0x45d925;})[_0x899f('0x27')](respondWithFilteredResult(_0x11e7c1,_0x274811))['catch'](handleError(_0x11e7c1,null));};exports[_0x899f('0x49')]=function(_0x463e6d,_0x34e944){var _0x28cb21={'raw':![],'where':{'id':_0x463e6d['params']['id']}},_0x53144c={};_0x53144c['model']=_[_0x899f('0x37')](db[_0x899f('0x46')]['rawAttributes']);_0x53144c[_0x899f('0x36')]=_[_0x899f('0x37')](_0x463e6d[_0x899f('0x36')]);_0x53144c['filters']=_['intersection'](_0x53144c[_0x899f('0x35')],_0x53144c[_0x899f('0x36')]);_0x28cb21[_0x899f('0x3b')]=_[_0x899f('0x39')](_0x53144c[_0x899f('0x35')],qs[_0x899f('0x3a')](_0x463e6d[_0x899f('0x36')][_0x899f('0x3a')]));_0x28cb21[_0x899f('0x3b')]=_0x28cb21[_0x899f('0x3b')][_0x899f('0x3c')]?_0x28cb21[_0x899f('0x3b')]:_0x53144c[_0x899f('0x35')];if(_0x463e6d['query'][_0x899f('0x4a')]){_0x28cb21[_0x899f('0x4b')]=[{'all':!![]}];}_0x28cb21=_[_0x899f('0x42')]({},_0x28cb21,_0x463e6d[_0x899f('0x45')]);return db[_0x899f('0x46')]['find'](_0x28cb21)[_0x899f('0x27')](handleEntityNotFound(_0x34e944,null))[_0x899f('0x27')](respondWithResult(_0x34e944,null))['catch'](handleError(_0x34e944,null));};exports[_0x899f('0x4c')]=function(_0x3e8aad,_0x598401){return db[_0x899f('0x46')][_0x899f('0x4c')](_0x3e8aad['body'],{})[_0x899f('0x27')](function(_0x45e142){var _0x4744b1=_0x3e8aad['user']['get']({'plain':!![]});if(!_0x4744b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4744b1[_0x899f('0x4d')]===_0x899f('0x4e')){var _0x4d5bd1=_0x45e142['get']({'plain':!![]});var _0x1b112d=_0x899f('0x29');return db[_0x899f('0x4f')]['find']({'where':{'name':_0x1b112d,'userProfileId':_0x4744b1[_0x899f('0x50')]},'raw':!![]})['then'](function(_0x3e6ef0){if(_0x3e6ef0&&_0x3e6ef0[_0x899f('0x51')]===0x0){return db[_0x899f('0x2a')][_0x899f('0x4c')]({'name':_0x4d5bd1[_0x899f('0x2d')],'resourceId':_0x4d5bd1['id'],'type':_0x3e6ef0['name'],'sectionId':_0x3e6ef0['id']},{})[_0x899f('0x27')](function(){return _0x45e142;});}else{return _0x45e142;}})[_0x899f('0x52')](function(_0x2c9a7e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c9a7e);throw _0x2c9a7e;});}return _0x45e142;})[_0x899f('0x27')](respondWithResult(_0x598401,0xc9))[_0x899f('0x52')](handleError(_0x598401,null));};exports[_0x899f('0x53')]=function(_0x593199,_0x722415){if(_0x593199['body']['id']){delete _0x593199[_0x899f('0x54')]['id'];}return db['SquareProject'][_0x899f('0x55')]({'where':{'id':_0x593199[_0x899f('0x56')]['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x722415,null))['then'](saveUpdates(_0x593199[_0x899f('0x54')],null))[_0x899f('0x27')](respondWithResult(_0x722415,null))[_0x899f('0x52')](handleError(_0x722415,null));};exports[_0x899f('0x57')]=function(_0x5cfb3d,_0x15e10a){return db[_0x899f('0x46')][_0x899f('0x55')]({'where':{'id':_0x5cfb3d['params']['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x15e10a,null))[_0x899f('0x27')](removeEntity(_0x15e10a,null))['catch'](handleError(_0x15e10a,null));};exports['addUsers']=function(_0x23c23a,_0x8cc441,_0x280843){return db[_0x899f('0x46')][_0x899f('0x55')]({'where':{'id':_0x23c23a['params']['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x8cc441,null))[_0x899f('0x27')](function(_0x11ce9f){if(_0x11ce9f){return _0x11ce9f[_0x899f('0x58')](_0x23c23a['body']['ids'],_['omit'](_0x23c23a['body'],[_0x899f('0x59'),'id'])||{});}})[_0x899f('0x27')](respondWithResult(_0x8cc441,null))[_0x899f('0x52')](handleError(_0x8cc441,null));};exports[_0x899f('0x5a')]=function(_0x26f389,_0x49ae36,_0x57eaf0){return db[_0x899f('0x46')][_0x899f('0x55')]({'where':{'id':_0x26f389[_0x899f('0x56')]['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x49ae36,null))['then'](function(_0x4782ce){if(_0x4782ce){return _0x4782ce[_0x899f('0x5a')](_0x26f389[_0x899f('0x36')]['ids'])[_0x899f('0x27')](function(){if(_['isArray'](_0x26f389['query'][_0x899f('0x59')])){for(var _0x3d4d23=0x0;_0x3d4d23<_0x26f389[_0x899f('0x36')][_0x899f('0x59')][_0x899f('0x3c')];_0x3d4d23+=0x1){socket['emit'](_0x899f('0x5b'),{'UserId':Number(_0x26f389['query'][_0x899f('0x59')][_0x3d4d23]),'SquareProjectId':Number(_0x26f389[_0x899f('0x56')]['id'])});}}else{socket[_0x899f('0x5c')](_0x899f('0x5b'),{'UserId':Number(_0x26f389[_0x899f('0x36')][_0x899f('0x59')]),'SquareProjectId':Number(_0x26f389[_0x899f('0x56')]['id'])});}});}})[_0x899f('0x27')](respondWithStatusCode(_0x49ae36,null))[_0x899f('0x52')](handleError(_0x49ae36,null));};exports[_0x899f('0x5d')]=function(_0x27b18d,_0x472c75,_0x3ff4c2){var _0x3b722f={};var _0x3ae64e={};var _0x5d0c24;var _0x52f3c6;return db[_0x899f('0x46')]['findOne']({'where':{'id':_0x27b18d['params']['id']}})[_0x899f('0x27')](handleEntityNotFound(_0x472c75,null))[_0x899f('0x27')](function(_0x132973){if(_0x132973){_0x5d0c24=_0x132973;_0x3ae64e[_0x899f('0x35')]=_[_0x899f('0x37')](db['User'][_0x899f('0x31')]);_0x3ae64e[_0x899f('0x36')]=_[_0x899f('0x37')](_0x27b18d[_0x899f('0x36')]);_0x3ae64e[_0x899f('0x38')]=_[_0x899f('0x39')](_0x3ae64e[_0x899f('0x35')],_0x3ae64e[_0x899f('0x36')]);_0x3b722f[_0x899f('0x3b')]=_[_0x899f('0x39')](_0x3ae64e['model'],qs[_0x899f('0x3a')](_0x27b18d['query'][_0x899f('0x3a')]));_0x3b722f[_0x899f('0x3b')]=_0x3b722f['attributes'][_0x899f('0x3c')]?_0x3b722f['attributes']:_0x3ae64e[_0x899f('0x35')];_0x3b722f[_0x899f('0x3e')]=qs[_0x899f('0x3f')](_0x27b18d[_0x899f('0x36')][_0x899f('0x3f')]);_0x3b722f[_0x899f('0x40')]=qs[_0x899f('0x38')](_[_0x899f('0x41')](_0x27b18d[_0x899f('0x36')],_0x3ae64e['filters']));if(_0x27b18d['query'][_0x899f('0x44')]){_0x3b722f[_0x899f('0x40')]=_[_0x899f('0x42')](_0x3b722f[_0x899f('0x40')],{'$or':_[_0x899f('0x30')](_0x3b722f[_0x899f('0x3b')],function(_0x3cf8bf){var _0x3b0ce3={};_0x3b0ce3[_0x3cf8bf]={'$like':'%'+_0x27b18d[_0x899f('0x36')]['filter']+'%'};return _0x3b0ce3;})});}_0x3b722f=_[_0x899f('0x42')]({},_0x3b722f,_0x27b18d[_0x899f('0x45')]);return _0x5d0c24['getUsers'](_0x3b722f);}})['then'](function(_0x2749ea){if(_0x2749ea){_0x52f3c6=_0x2749ea['length'];if(!_0x27b18d[_0x899f('0x36')][_0x899f('0x3d')](_0x899f('0x5e'))){_0x3b722f[_0x899f('0x21')]=qs[_0x899f('0x21')](_0x27b18d[_0x899f('0x36')][_0x899f('0x21')]);_0x3b722f[_0x899f('0x1f')]=qs[_0x899f('0x1f')](_0x27b18d[_0x899f('0x36')][_0x899f('0x1f')]);}return _0x5d0c24[_0x899f('0x5d')](_0x3b722f);}})[_0x899f('0x27')](function(_0x5cf7b5){if(_0x5cf7b5){return _0x5cf7b5?{'count':_0x52f3c6,'rows':_0x5cf7b5}:null;}})[_0x899f('0x27')](respondWithResult(_0x472c75,null))['catch'](handleError(_0x472c75,null));}; \ No newline at end of file +var _0x864b=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','pick','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','stack','name','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x864b,0x83));var _0xb864=function(_0x4f219b,_0x841f7e){_0x4f219b=_0x4f219b-0x0;var _0x8a7718=_0x864b[_0x4f219b];return _0x8a7718;};'use strict';var emlformat=require(_0xb864('0x0'));var rimraf=require(_0xb864('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb864('0x2'));var rp=require('request-promise');var moment=require(_0xb864('0x3'));var BPromise=require(_0xb864('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb864('0x5'));var sox=require(_0xb864('0x6'));var csv=require('to-csv');var ejs=require(_0xb864('0x7'));var fs=require('fs');var fs_extra=require(_0xb864('0x8'));var _=require('lodash');var squel=require(_0xb864('0x9'));var crypto=require(_0xb864('0xa'));var jsforce=require(_0xb864('0xb'));var deskjs=require(_0xb864('0xc'));var toCsv=require(_0xb864('0xd'));var querystring=require('querystring');var Papa=require(_0xb864('0xe'));var Redis=require(_0xb864('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb864('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb864('0x11'));var logger=require(_0xb864('0x12'))('api');var utils=require(_0xb864('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb864('0x14'));var db=require('../../mysqldb')['db'];config[_0xb864('0x15')]=_['defaults'](config[_0xb864('0x15')],{'host':_0xb864('0x16'),'port':0x18eb});var socket=require(_0xb864('0x17'))(new Redis(config[_0xb864('0x15')]));require(_0xb864('0x18'))[_0xb864('0x19')](socket);function respondWithStatusCode(_0x510710,_0x399226){_0x399226=_0x399226||0xcc;return function(_0x1b2b51){if(_0x1b2b51){return _0x510710[_0xb864('0x1a')](_0x399226);}return _0x510710[_0xb864('0x1b')](_0x399226)[_0xb864('0x1c')]();};}function respondWithResult(_0x3c22df,_0x21391c){_0x21391c=_0x21391c||0xc8;return function(_0xf9cebb){if(_0xf9cebb){return _0x3c22df[_0xb864('0x1b')](_0x21391c)[_0xb864('0x1d')](_0xf9cebb);}};}function respondWithFilteredResult(_0x467204,_0x29b7b2){return function(_0x538c82){if(_0x538c82){var _0x4d64fb=typeof _0x29b7b2[_0xb864('0x1e')]===_0xb864('0x1f')&&typeof _0x29b7b2[_0xb864('0x20')]===_0xb864('0x1f');var _0x170765=_0x538c82[_0xb864('0x21')];var _0x381381=_0x4d64fb?0x0:_0x29b7b2[_0xb864('0x1e')];var _0x14f6ee=_0x4d64fb?_0x538c82[_0xb864('0x21')]:_0x29b7b2[_0xb864('0x1e')]+_0x29b7b2['limit'];var _0x102583;if(_0x14f6ee>=_0x170765){_0x14f6ee=_0x170765;_0x102583=0xc8;}else{_0x102583=0xce;}_0x467204['status'](_0x102583);return _0x467204['set'](_0xb864('0x22'),_0x381381+'-'+_0x14f6ee+'/'+_0x170765)[_0xb864('0x1d')](_0x538c82);}return null;};}function patchUpdates(_0x7a8ace){return function(_0x59bf42){try{jsonpatch[_0xb864('0x23')](_0x59bf42,_0x7a8ace,!![]);}catch(_0x310235){return BPromise[_0xb864('0x24')](_0x310235);}return _0x59bf42[_0xb864('0x25')]();};}function saveUpdates(_0x3f3a68,_0x549716){return function(_0x46b06c){if(_0x46b06c){return _0x46b06c[_0xb864('0x26')](_0x3f3a68)[_0xb864('0x27')](function(_0x2f9ac0){return _0x2f9ac0;});}return null;};}function removeEntity(_0x15cf80,_0x21d689){return function(_0x53f43f){if(_0x53f43f){return _0x53f43f[_0xb864('0x28')]()[_0xb864('0x27')](function(){var _0xcbb0b3=_0x53f43f[_0xb864('0x29')]({'plain':!![]});var _0x5783fd=_0xb864('0x2a');return db[_0xb864('0x2b')]['destroy']({'where':{'type':_0x5783fd,'resourceId':_0xcbb0b3['id']}})[_0xb864('0x27')](function(){return _0x53f43f;});})[_0xb864('0x27')](function(){_0x15cf80[_0xb864('0x1b')](0xcc)[_0xb864('0x1c')]();});}};}function handleEntityNotFound(_0x3bcbc3,_0x95ecb4){return function(_0x3cd70a){if(!_0x3cd70a){_0x3bcbc3[_0xb864('0x1a')](0x194);}return _0x3cd70a;};}function handleError(_0x53dff6,_0x38c838){_0x38c838=_0x38c838||0x1f4;return function(_0x3312c3){logger['error'](_0x3312c3[_0xb864('0x2c')]);if(_0x3312c3['name']){delete _0x3312c3[_0xb864('0x2d')];}_0x53dff6[_0xb864('0x1b')](_0x38c838)['send'](_0x3312c3);};}exports['index']=function(_0x4dbbe5,_0x4bc14e){var _0x502ec4={},_0x3ce5e0={},_0x2c1f2c={'count':0x0,'rows':[]};var _0x2b6c60=_[_0xb864('0x2e')](db['SquareProject'][_0xb864('0x2f')],function(_0x4cd87a){return{'name':_0x4cd87a[_0xb864('0x30')],'type':_0x4cd87a[_0xb864('0x31')][_0xb864('0x32')]};});_0x3ce5e0[_0xb864('0x33')]=_[_0xb864('0x2e')](_0x2b6c60,_0xb864('0x2d'));_0x3ce5e0['query']=_[_0xb864('0x34')](_0x4dbbe5[_0xb864('0x35')]);_0x3ce5e0['filters']=_[_0xb864('0x36')](_0x3ce5e0['model'],_0x3ce5e0[_0xb864('0x35')]);_0x502ec4[_0xb864('0x37')]=_[_0xb864('0x36')](_0x3ce5e0[_0xb864('0x33')],qs[_0xb864('0x38')](_0x4dbbe5[_0xb864('0x35')][_0xb864('0x38')]));_0x502ec4[_0xb864('0x37')]=_0x502ec4['attributes'][_0xb864('0x39')]?_0x502ec4[_0xb864('0x37')]:_0x3ce5e0[_0xb864('0x33')];if(!_0x4dbbe5['query'][_0xb864('0x3a')](_0xb864('0x3b'))){_0x502ec4[_0xb864('0x20')]=qs[_0xb864('0x20')](_0x4dbbe5[_0xb864('0x35')][_0xb864('0x20')]);_0x502ec4['offset']=qs[_0xb864('0x1e')](_0x4dbbe5[_0xb864('0x35')][_0xb864('0x1e')]);}_0x502ec4[_0xb864('0x3c')]=qs[_0xb864('0x3d')](_0x4dbbe5[_0xb864('0x35')]['sort']);_0x502ec4[_0xb864('0x3e')]=qs[_0xb864('0x3f')](_['pick'](_0x4dbbe5['query'],_0x3ce5e0[_0xb864('0x3f')]),_0x2b6c60);if(_0x4dbbe5[_0xb864('0x35')][_0xb864('0x40')]){_0x502ec4[_0xb864('0x3e')]=_[_0xb864('0x41')](_0x502ec4[_0xb864('0x3e')],{'$or':_[_0xb864('0x2e')](_0x2b6c60,function(_0x5a332a){if(_0x5a332a[_0xb864('0x31')]!==_0xb864('0x42')){var _0xd6972e={};_0xd6972e[_0x5a332a[_0xb864('0x2d')]]={'$like':'%'+_0x4dbbe5[_0xb864('0x35')][_0xb864('0x40')]+'%'};return _0xd6972e;}})});}_0x502ec4=_['merge']({},_0x502ec4,_0x4dbbe5[_0xb864('0x43')]);var _0x2353d4={'where':_0x502ec4[_0xb864('0x3e')]};return db[_0xb864('0x44')][_0xb864('0x21')](_0x2353d4)[_0xb864('0x27')](function(_0x2ef678){_0x2c1f2c['count']=_0x2ef678;if(_0x4dbbe5[_0xb864('0x35')][_0xb864('0x45')]){_0x502ec4[_0xb864('0x46')]=[{'all':!![]}];}return db[_0xb864('0x44')][_0xb864('0x47')](_0x502ec4);})[_0xb864('0x27')](function(_0x58c6e6){_0x2c1f2c[_0xb864('0x48')]=_0x58c6e6;return _0x2c1f2c;})[_0xb864('0x27')](respondWithFilteredResult(_0x4bc14e,_0x502ec4))[_0xb864('0x49')](handleError(_0x4bc14e,null));};exports['show']=function(_0x38550a,_0x3a7362){var _0x1f2991={'raw':![],'where':{'id':_0x38550a[_0xb864('0x4a')]['id']}},_0x3d53ec={};_0x3d53ec[_0xb864('0x33')]=_[_0xb864('0x34')](db['SquareProject'][_0xb864('0x2f')]);_0x3d53ec[_0xb864('0x35')]=_[_0xb864('0x34')](_0x38550a[_0xb864('0x35')]);_0x3d53ec['filters']=_[_0xb864('0x36')](_0x3d53ec[_0xb864('0x33')],_0x3d53ec[_0xb864('0x35')]);_0x1f2991[_0xb864('0x37')]=_[_0xb864('0x36')](_0x3d53ec[_0xb864('0x33')],qs[_0xb864('0x38')](_0x38550a[_0xb864('0x35')][_0xb864('0x38')]));_0x1f2991[_0xb864('0x37')]=_0x1f2991['attributes']['length']?_0x1f2991['attributes']:_0x3d53ec[_0xb864('0x33')];if(_0x38550a[_0xb864('0x35')]['includeAll']){_0x1f2991[_0xb864('0x46')]=[{'all':!![]}];}_0x1f2991=_[_0xb864('0x41')]({},_0x1f2991,_0x38550a[_0xb864('0x43')]);return db[_0xb864('0x44')][_0xb864('0x4b')](_0x1f2991)['then'](handleEntityNotFound(_0x3a7362,null))[_0xb864('0x27')](respondWithResult(_0x3a7362,null))[_0xb864('0x49')](handleError(_0x3a7362,null));};exports[_0xb864('0x4c')]=function(_0x11bb76,_0x28529d){return db['SquareProject'][_0xb864('0x4c')](_0x11bb76[_0xb864('0x4d')],{})['then'](function(_0x6daf60){var _0x30585d=_0x11bb76[_0xb864('0x4e')][_0xb864('0x29')]({'plain':!![]});if(!_0x30585d)throw new Error(_0xb864('0x4f'));if(_0x30585d['role']===_0xb864('0x4e')){var _0x56dbbe=_0x6daf60[_0xb864('0x29')]({'plain':!![]});var _0x45ddef=_0xb864('0x2a');return db[_0xb864('0x50')][_0xb864('0x4b')]({'where':{'name':_0x45ddef,'userProfileId':_0x30585d[_0xb864('0x51')]},'raw':!![]})[_0xb864('0x27')](function(_0x2fc256){if(_0x2fc256&&_0x2fc256['autoAssociation']===0x0){return db[_0xb864('0x2b')][_0xb864('0x4c')]({'name':_0x56dbbe[_0xb864('0x2d')],'resourceId':_0x56dbbe['id'],'type':_0x2fc256[_0xb864('0x2d')],'sectionId':_0x2fc256['id']},{})[_0xb864('0x27')](function(){return _0x6daf60;});}else{return _0x6daf60;}})[_0xb864('0x49')](function(_0x485171){logger[_0xb864('0x52')](_0xb864('0x53'),_0x485171);throw _0x485171;});}return _0x6daf60;})[_0xb864('0x27')](respondWithResult(_0x28529d,0xc9))[_0xb864('0x49')](handleError(_0x28529d,null));};exports[_0xb864('0x26')]=function(_0x356d35,_0x2209b0){if(_0x356d35[_0xb864('0x4d')]['id']){delete _0x356d35[_0xb864('0x4d')]['id'];}return db['SquareProject'][_0xb864('0x4b')]({'where':{'id':_0x356d35['params']['id']}})[_0xb864('0x27')](handleEntityNotFound(_0x2209b0,null))['then'](saveUpdates(_0x356d35[_0xb864('0x4d')],null))[_0xb864('0x27')](respondWithResult(_0x2209b0,null))[_0xb864('0x49')](handleError(_0x2209b0,null));};exports[_0xb864('0x28')]=function(_0x6cd436,_0xe4cd6f){return db['SquareProject'][_0xb864('0x4b')]({'where':{'id':_0x6cd436[_0xb864('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe4cd6f,null))[_0xb864('0x27')](removeEntity(_0xe4cd6f,null))[_0xb864('0x49')](handleError(_0xe4cd6f,null));};exports[_0xb864('0x54')]=function(_0x41708d,_0x47b555,_0x2238ca){return db[_0xb864('0x44')][_0xb864('0x4b')]({'where':{'id':_0x41708d[_0xb864('0x4a')]['id']}})[_0xb864('0x27')](handleEntityNotFound(_0x47b555,null))[_0xb864('0x27')](function(_0x593ef7){if(_0x593ef7){return _0x593ef7['addUsers'](_0x41708d[_0xb864('0x4d')][_0xb864('0x55')],_[_0xb864('0x56')](_0x41708d[_0xb864('0x4d')],[_0xb864('0x55'),'id'])||{});}})[_0xb864('0x27')](respondWithResult(_0x47b555,null))[_0xb864('0x49')](handleError(_0x47b555,null));};exports[_0xb864('0x57')]=function(_0x432cb0,_0x2936d6,_0x462c26){return db[_0xb864('0x44')]['find']({'where':{'id':_0x432cb0['params']['id']}})[_0xb864('0x27')](handleEntityNotFound(_0x2936d6,null))[_0xb864('0x27')](function(_0x1da1df){if(_0x1da1df){return _0x1da1df['removeUsers'](_0x432cb0[_0xb864('0x35')]['ids'])[_0xb864('0x27')](function(){if(_[_0xb864('0x58')](_0x432cb0['query']['ids'])){for(var _0x5a727b=0x0;_0x5a727b<_0x432cb0['query']['ids']['length'];_0x5a727b+=0x1){socket['emit'](_0xb864('0x59'),{'UserId':Number(_0x432cb0[_0xb864('0x35')]['ids'][_0x5a727b]),'SquareProjectId':Number(_0x432cb0[_0xb864('0x4a')]['id'])});}}else{socket[_0xb864('0x5a')](_0xb864('0x59'),{'UserId':Number(_0x432cb0[_0xb864('0x35')][_0xb864('0x55')]),'SquareProjectId':Number(_0x432cb0[_0xb864('0x4a')]['id'])});}});}})[_0xb864('0x27')](respondWithStatusCode(_0x2936d6,null))[_0xb864('0x49')](handleError(_0x2936d6,null));};exports[_0xb864('0x5b')]=function(_0x22d7ba,_0x30a97a,_0x282f39){var _0x59eaba={};var _0x5bafd6={};var _0x1f1ff1;var _0xe49294;return db[_0xb864('0x44')][_0xb864('0x5c')]({'where':{'id':_0x22d7ba[_0xb864('0x4a')]['id']}})['then'](handleEntityNotFound(_0x30a97a,null))[_0xb864('0x27')](function(_0x5f1848){if(_0x5f1848){_0x1f1ff1=_0x5f1848;_0x5bafd6[_0xb864('0x33')]=_[_0xb864('0x34')](db['User']['rawAttributes']);_0x5bafd6[_0xb864('0x35')]=_['keys'](_0x22d7ba[_0xb864('0x35')]);_0x5bafd6[_0xb864('0x3f')]=_[_0xb864('0x36')](_0x5bafd6['model'],_0x5bafd6[_0xb864('0x35')]);_0x59eaba[_0xb864('0x37')]=_[_0xb864('0x36')](_0x5bafd6['model'],qs['fields'](_0x22d7ba['query'][_0xb864('0x38')]));_0x59eaba['attributes']=_0x59eaba['attributes'][_0xb864('0x39')]?_0x59eaba['attributes']:_0x5bafd6[_0xb864('0x33')];_0x59eaba[_0xb864('0x3c')]=qs['sort'](_0x22d7ba['query'][_0xb864('0x3d')]);_0x59eaba[_0xb864('0x3e')]=qs[_0xb864('0x3f')](_[_0xb864('0x5d')](_0x22d7ba[_0xb864('0x35')],_0x5bafd6[_0xb864('0x3f')]));if(_0x22d7ba[_0xb864('0x35')][_0xb864('0x40')]){_0x59eaba[_0xb864('0x3e')]=_[_0xb864('0x41')](_0x59eaba[_0xb864('0x3e')],{'$or':_[_0xb864('0x2e')](_0x59eaba[_0xb864('0x37')],function(_0x19d6fb){var _0x514a01={};_0x514a01[_0x19d6fb]={'$like':'%'+_0x22d7ba[_0xb864('0x35')][_0xb864('0x40')]+'%'};return _0x514a01;})});}_0x59eaba=_[_0xb864('0x41')]({},_0x59eaba,_0x22d7ba[_0xb864('0x43')]);return _0x1f1ff1[_0xb864('0x5b')](_0x59eaba);}})[_0xb864('0x27')](function(_0x54e315){if(_0x54e315){_0xe49294=_0x54e315[_0xb864('0x39')];if(!_0x22d7ba['query']['hasOwnProperty'](_0xb864('0x3b'))){_0x59eaba[_0xb864('0x20')]=qs[_0xb864('0x20')](_0x22d7ba[_0xb864('0x35')][_0xb864('0x20')]);_0x59eaba[_0xb864('0x1e')]=qs['offset'](_0x22d7ba[_0xb864('0x35')][_0xb864('0x1e')]);}return _0x1f1ff1[_0xb864('0x5b')](_0x59eaba);}})[_0xb864('0x27')](function(_0x143799){if(_0x143799){return _0x143799?{'count':_0xe49294,'rows':_0x143799}:null;}})['then'](respondWithResult(_0x30a97a,null))[_0xb864('0x49')](handleError(_0x30a97a,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e342f26..e28ffe2 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 _0x4222=['emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners','update','remove'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x4222,0x1ce));var _0x2422=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x4222[_0x1969a7];return _0x3d665f;};'use strict';var EventEmitter=require(_0x2422('0x0'));var SquareProject=require(_0x2422('0x1'))['db'][_0x2422('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2422('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2422('0x4'),'afterDestroy':_0x2422('0x5')};function emitEvent(_0x150873){return function(_0x55e1a4,_0x10892f,_0x1664b1){SquareProjectEvents[_0x2422('0x6')](_0x150873+':'+_0x55e1a4['id'],_0x55e1a4);SquareProjectEvents[_0x2422('0x6')](_0x150873,_0x55e1a4);_0x1664b1(null);};}for(var e in events){if(events[_0x2422('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x2422('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x95d2=['update','remove','emit','hook','events','../../mysqldb','SquareProject'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x95d2,0x15b));var _0x295d=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x95d2[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x295d('0x0'));var SquareProject=require(_0x295d('0x1'))['db'][_0x295d('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x295d('0x3'),'afterDestroy':_0x295d('0x4')};function emitEvent(_0x4b6e64){return function(_0x332739,_0x41eb44,_0x443adf){SquareProjectEvents['emit'](_0x4b6e64+':'+_0x332739['id'],_0x332739);SquareProjectEvents[_0x295d('0x5')](_0x4b6e64,_0x332739);_0x443adf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x295d('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 3e6ce7f..b9c09f8 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 _0xf927=['changed','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x48f5ba,_0x434092){var _0x1aaabf=function(_0x7a7f3f){while(--_0x7a7f3f){_0x48f5ba['push'](_0x48f5ba['shift']());}};_0x1aaabf(++_0x434092);}(_0xf927,0x120));var _0x7f92=function(_0x3d0085,_0x5ef723){_0x3d0085=_0x3d0085-0x0;var _0x1be930=_0xf927[_0x3d0085];return _0x1be930;};'use strict';var _=require(_0x7f92('0x0'));var util=require(_0x7f92('0x1'));var logger=require(_0x7f92('0x2'))(_0x7f92('0x3'));var moment=require(_0x7f92('0x4'));var BPromise=require(_0x7f92('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f92('0x6'));var rimraf=require('rimraf');var config=require(_0x7f92('0x7'));var attributes=require('./squareProject.attributes');module[_0x7f92('0x8')]=function(_0x1a3c1c,_0x3a3f3f){return _0x1a3c1c['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x297dce,_0x4d1747,_0x1674af){if(_0x297dce['changed']('preproduction')){_0x297dce[_0x7f92('0x9')]=moment()[_0x7f92('0xa')](_0x7f92('0xb'));}if(_0x297dce[_0x7f92('0xc')](_0x7f92('0xd'))){_0x297dce[_0x7f92('0xe')]=moment()[_0x7f92('0xa')](_0x7f92('0xb'));}_0x1674af(null,_0x297dce);}}});}; \ No newline at end of file +var _0x7933=['util','moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','define','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3d447a,_0x463698){var _0x514245=function(_0x381a06){while(--_0x381a06){_0x3d447a['push'](_0x3d447a['shift']());}};_0x514245(++_0x463698);}(_0x7933,0x1bf));var _0x3793=function(_0x44b18b,_0x461fa0){_0x44b18b=_0x44b18b-0x0;var _0x371e83=_0x7933[_0x44b18b];return _0x371e83;};'use strict';var _=require(_0x3793('0x0'));var util=require(_0x3793('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3793('0x2'));var BPromise=require(_0x3793('0x3'));var rp=require(_0x3793('0x4'));var fs=require('fs');var path=require(_0x3793('0x5'));var rimraf=require(_0x3793('0x6'));var config=require('../../config/environment');var attributes=require(_0x3793('0x7'));module[_0x3793('0x8')]=function(_0x300d03,_0x152c27){return _0x300d03[_0x3793('0x9')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26360a,_0x454105,_0x1f7287){if(_0x26360a[_0x3793('0xa')](_0x3793('0xb'))){_0x26360a['savedAt']=moment()[_0x3793('0xc')](_0x3793('0xd'));}if(_0x26360a[_0x3793('0xa')]('production')){_0x26360a['publishedAt']=moment()[_0x3793('0xc')](_0x3793('0xd'));}_0x1f7287(null,_0x26360a);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b8d6503..a34bd31 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 _0x59ec=['raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','ShowSquareProject','SquareProject','options'];(function(_0x1b1e01,_0x53c575){var _0x3bd00e=function(_0x255e2c){while(--_0x255e2c){_0x1b1e01['push'](_0x1b1e01['shift']());}};_0x3bd00e(++_0x53c575);}(_0x59ec,0x102));var _0xc59e=function(_0x428028,_0x16296e){_0x428028=_0x428028-0x0;var _0x53dccb=_0x59ec[_0x428028];return _0x53dccb;};'use strict';var _=require(_0xc59e('0x0'));var util=require(_0xc59e('0x1'));var moment=require('moment');var BPromise=require(_0xc59e('0x2'));var rs=require(_0xc59e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59e('0x4'))['db'];var utils=require(_0xc59e('0x5'));var logger=require(_0xc59e('0x6'))(_0xc59e('0x7'));var config=require(_0xc59e('0x8'));var jayson=require(_0xc59e('0x9'));var client=jayson[_0xc59e('0xa')][_0xc59e('0xb')]({'port':0x232a});config[_0xc59e('0xc')]=_[_0xc59e('0xd')](config[_0xc59e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc59e('0xe'))(new Redis(config[_0xc59e('0xc')]));require('./squareProject.socket')[_0xc59e('0xf')](socket);function respondWithRpcPromise(_0x57fa06,_0x3b365a,_0x5e0dff){return new BPromise(function(_0x5690be,_0x19d954){return client[_0xc59e('0x10')](_0x57fa06,_0x5e0dff)[_0xc59e('0x11')](function(_0x78d23a){logger['info'](_0xc59e('0x12'),_0x3b365a,'request\x20sent');logger[_0xc59e('0x13')](_0xc59e('0x14'),_0x3b365a,'request\x20sent',JSON[_0xc59e('0x15')](_0x78d23a));if(_0x78d23a[_0xc59e('0x16')]){if(_0x78d23a[_0xc59e('0x16')]['code']===0x1f4){logger['error'](_0xc59e('0x12'),_0x3b365a,_0x78d23a['error'][_0xc59e('0x17')]);return _0x19d954(_0x78d23a[_0xc59e('0x16')]['message']);}logger['error'](_0xc59e('0x12'),_0x3b365a,_0x78d23a[_0xc59e('0x16')]['message']);return _0x5690be(_0x78d23a[_0xc59e('0x16')][_0xc59e('0x17')]);}else{logger[_0xc59e('0x18')]('SquareProject,\x20%s,\x20%s',_0x3b365a,_0xc59e('0x19'));_0x5690be(_0x78d23a['result'][_0xc59e('0x17')]);}})[_0xc59e('0x1a')](function(_0x5aa256){logger['error'](_0xc59e('0x12'),_0x3b365a,_0x5aa256);_0x19d954(_0x5aa256);});});}exports[_0xc59e('0x1b')]=function(_0x53333d){var _0x73efd2=this;return new Promise(function(_0x43bbf2,_0x15cb06){return db[_0xc59e('0x1c')]['find']({'raw':_0x53333d[_0xc59e('0x1d')]?_0x53333d[_0xc59e('0x1d')][_0xc59e('0x1e')]===undefined?!![]:![]:!![],'where':_0x53333d['options']?_0x53333d[_0xc59e('0x1d')][_0xc59e('0x1f')]||null:null,'attributes':_0x53333d[_0xc59e('0x1d')]?_0x53333d[_0xc59e('0x1d')][_0xc59e('0x20')]||null:null,'include':_0x53333d['options']?_0x53333d[_0xc59e('0x1d')][_0xc59e('0x21')]?_[_0xc59e('0x22')](_0x53333d[_0xc59e('0x1d')][_0xc59e('0x21')],function(_0x5f5a2b){return{'model':db[_0x5f5a2b[_0xc59e('0x23')]],'as':_0x5f5a2b['as'],'attributes':_0x5f5a2b[_0xc59e('0x20')],'include':_0x5f5a2b[_0xc59e('0x21')]?_[_0xc59e('0x22')](_0x5f5a2b[_0xc59e('0x21')],function(_0x4a93fc){return{'model':db[_0x4a93fc[_0xc59e('0x23')]],'as':_0x4a93fc['as'],'attributes':_0x4a93fc[_0xc59e('0x20')],'include':_0x4a93fc[_0xc59e('0x21')]?_[_0xc59e('0x22')](_0x4a93fc[_0xc59e('0x21')],function(_0x579efb){return{'model':db[_0x579efb[_0xc59e('0x23')]],'as':_0x579efb['as'],'attributes':_0x579efb[_0xc59e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc59e('0x11')](function(_0x30f15a){logger[_0xc59e('0x18')](_0xc59e('0x1b'),_0x53333d);logger['debug']('ShowSquareProject',_0x53333d,JSON[_0xc59e('0x15')](_0x30f15a));_0x43bbf2(_0x30f15a);})[_0xc59e('0x1a')](function(_0x10b1d9){logger[_0xc59e('0x16')](_0xc59e('0x1b'),_0x10b1d9[_0xc59e('0x17')],_0x53333d);_0x15cb06(_0x73efd2[_0xc59e('0x16')](0x1f4,_0x10b1d9[_0xc59e('0x17')]));});});}; \ No newline at end of file +var _0xb60c=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./squareProject.socket','register','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','include','model','map','info','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x4d8a86,_0x214457){var _0x489380=function(_0x18b8b1){while(--_0x18b8b1){_0x4d8a86['push'](_0x4d8a86['shift']());}};_0x489380(++_0x214457);}(_0xb60c,0x1cd));var _0xcb60=function(_0x8f095d,_0x2168b9){_0x8f095d=_0x8f095d-0x0;var _0x45f91d=_0xb60c[_0x8f095d];return _0x45f91d;};'use strict';var _=require(_0xcb60('0x0'));var util=require(_0xcb60('0x1'));var moment=require(_0xcb60('0x2'));var BPromise=require(_0xcb60('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb60('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb60('0x5'));var logger=require(_0xcb60('0x6'))(_0xcb60('0x7'));var config=require(_0xcb60('0x8'));var jayson=require(_0xcb60('0x9'));var client=jayson[_0xcb60('0xa')][_0xcb60('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcb60('0xc')],{'host':_0xcb60('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb60('0xc')]));require(_0xcb60('0xe'))[_0xcb60('0xf')](socket);function respondWithRpcPromise(_0x95d152,_0x238178,_0x1f2455){return new BPromise(function(_0x4a1698,_0x47a5de){return client['request'](_0x95d152,_0x1f2455)[_0xcb60('0x10')](function(_0x41f79f){logger['info'](_0xcb60('0x11'),_0x238178,_0xcb60('0x12'));logger[_0xcb60('0x13')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x238178,_0xcb60('0x12'),JSON['stringify'](_0x41f79f));if(_0x41f79f[_0xcb60('0x14')]){if(_0x41f79f[_0xcb60('0x14')][_0xcb60('0x15')]===0x1f4){logger[_0xcb60('0x14')](_0xcb60('0x11'),_0x238178,_0x41f79f[_0xcb60('0x14')][_0xcb60('0x16')]);return _0x47a5de(_0x41f79f['error'][_0xcb60('0x16')]);}logger['error'](_0xcb60('0x11'),_0x238178,_0x41f79f[_0xcb60('0x14')][_0xcb60('0x16')]);return _0x4a1698(_0x41f79f['error']['message']);}else{logger['info'](_0xcb60('0x11'),_0x238178,_0xcb60('0x12'));_0x4a1698(_0x41f79f[_0xcb60('0x17')][_0xcb60('0x16')]);}})[_0xcb60('0x18')](function(_0x373a73){logger[_0xcb60('0x14')](_0xcb60('0x11'),_0x238178,_0x373a73);_0x47a5de(_0x373a73);});});}exports[_0xcb60('0x19')]=function(_0x395c69){var _0x4256e3=this;return new Promise(function(_0x56fe5c,_0x4e83bc){return db[_0xcb60('0x1a')][_0xcb60('0x1b')]({'raw':_0x395c69[_0xcb60('0x1c')]?_0x395c69['options'][_0xcb60('0x1d')]===undefined?!![]:![]:!![],'where':_0x395c69[_0xcb60('0x1c')]?_0x395c69[_0xcb60('0x1c')]['where']||null:null,'attributes':_0x395c69[_0xcb60('0x1c')]?_0x395c69[_0xcb60('0x1c')][_0xcb60('0x1e')]||null:null,'include':_0x395c69['options']?_0x395c69[_0xcb60('0x1c')]['include']?_['map'](_0x395c69[_0xcb60('0x1c')][_0xcb60('0x1f')],function(_0x28656d){return{'model':db[_0x28656d[_0xcb60('0x20')]],'as':_0x28656d['as'],'attributes':_0x28656d['attributes'],'include':_0x28656d[_0xcb60('0x1f')]?_[_0xcb60('0x21')](_0x28656d[_0xcb60('0x1f')],function(_0x3f73fc){return{'model':db[_0x3f73fc[_0xcb60('0x20')]],'as':_0x3f73fc['as'],'attributes':_0x3f73fc[_0xcb60('0x1e')],'include':_0x3f73fc['include']?_[_0xcb60('0x21')](_0x3f73fc[_0xcb60('0x1f')],function(_0x53f72e){return{'model':db[_0x53f72e[_0xcb60('0x20')]],'as':_0x53f72e['as'],'attributes':_0x53f72e[_0xcb60('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe06d17){logger[_0xcb60('0x22')](_0xcb60('0x19'),_0x395c69);logger['debug'](_0xcb60('0x19'),_0x395c69,JSON[_0xcb60('0x23')](_0xe06d17));_0x56fe5c(_0xe06d17);})['catch'](function(_0x2bdd8e){logger[_0xcb60('0x14')](_0xcb60('0x19'),_0x2bdd8e[_0xcb60('0x16')],_0x395c69);_0x4e83bc(_0x4256e3[_0xcb60('0x14')](0x1f4,_0x2bdd8e[_0xcb60('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 1c6387d..2dafd30 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 _0x5bdf=['remove','emit','register','squareProject:','./squareProject.events','save'];(function(_0x31dff6,_0x3b2578){var _0x3a3998=function(_0x498ee2){while(--_0x498ee2){_0x31dff6['push'](_0x31dff6['shift']());}};_0x3a3998(++_0x3b2578);}(_0x5bdf,0xe8));var _0xf5bd=function(_0x33dd4e,_0x22a7f7){_0x33dd4e=_0x33dd4e-0x0;var _0x345007=_0x5bdf[_0x33dd4e];return _0x345007;};'use strict';var SquareProjectEvents=require(_0xf5bd('0x0'));var events=[_0xf5bd('0x1'),_0xf5bd('0x2'),'update'];function createListener(_0x2ce85a,_0x589239){return function(_0x39e9f8){_0x589239[_0xf5bd('0x3')](_0x2ce85a,_0x39e9f8);};}function removeListener(_0x1313ba,_0x454de7){return function(){SquareProjectEvents['removeListener'](_0x1313ba,_0x454de7);};}exports[_0xf5bd('0x4')]=function(_0x14ec1f){for(var _0x528006=0x0,_0x3751df=events['length'];_0x528006<_0x3751df;_0x528006++){var _0x16450d=events[_0x528006];var _0xa921c9=createListener(_0xf5bd('0x5')+_0x16450d,_0x14ec1f);SquareProjectEvents['on'](_0x16450d,_0xa921c9);}}; \ No newline at end of file +var _0xa51a=['squareProject:','save','remove','update','removeListener','register','length'];(function(_0x468972,_0x350e2e){var _0x475eba=function(_0x583e30){while(--_0x583e30){_0x468972['push'](_0x468972['shift']());}};_0x475eba(++_0x350e2e);}(_0xa51a,0x10b));var _0xaa51=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xa51a[_0x39096d];return _0x13da4f;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xaa51('0x0'),_0xaa51('0x1'),_0xaa51('0x2')];function createListener(_0x1a55dc,_0x4654d5){return function(_0xc57e86){_0x4654d5['emit'](_0x1a55dc,_0xc57e86);};}function removeListener(_0x4b82fb,_0x3f880f){return function(){SquareProjectEvents[_0xaa51('0x3')](_0x4b82fb,_0x3f880f);};}exports[_0xaa51('0x4')]=function(_0x5c0c02){for(var _0x4067ad=0x0,_0x5cd761=events[_0xaa51('0x5')];_0x4067ad<_0x5cd761;_0x4067ad++){var _0x15f787=events[_0x4067ad];var _0x342dcb=createListener(_0xaa51('0x6')+_0x15f787,_0x5c0c02);SquareProjectEvents['on'](_0x15f787,_0x342dcb);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 57f6094..61a05a6 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x23a3a7,_0x430850){var _0xc9ba61=function(_0x3630d2){while(--_0x3630d2){_0x23a3a7['push'](_0x23a3a7['shift']());}};_0xc9ba61(++_0x430850);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4dfe4d,_0x5366ec){_0x4dfe4d=_0x4dfe4d-0x0;var _0x37b850=_0x1cb9[_0x4dfe4d];return _0x37b850;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0x7217=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4d8a8f,_0x2afd4c){var _0xfc4adc=function(_0xb89886){while(--_0xb89886){_0x4d8a8f['push'](_0x4d8a8f['shift']());}};_0xfc4adc(++_0x2afd4c);}(_0x7217,0x19e));var _0x7721=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x7217[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 323aec7..017d3ad 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 _0xf494=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xf494,0x1c6));var _0x4f49=function(_0x4a971c,_0x479c11){_0x4a971c=_0x4a971c-0x0;var _0x28037f=_0xf494[_0x4a971c];return _0x28037f;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'uniqueid':{'type':Sequelize[_0x4f49('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4f49('0x2')]},'context':{'type':Sequelize[_0x4f49('0x2')]},'extension':{'type':Sequelize[_0x4f49('0x2')]},'priority':{'type':Sequelize[_0x4f49('0x2')]},'accountcode':{'type':Sequelize[_0x4f49('0x2')]},'dnid':{'type':Sequelize[_0x4f49('0x2')]},'projectName':{'type':Sequelize[_0x4f49('0x2')]},'saveName':{'type':Sequelize[_0x4f49('0x2')]},'filename':{'type':Sequelize[_0x4f49('0x2')]},'savePath':{'type':Sequelize[_0x4f49('0x2')]},'format':{'type':Sequelize[_0x4f49('0x3')],'get':function(){var _0x5eb186='';var _0x58e9a0=this[_0x4f49('0x4')](_0x4f49('0x5'));if(_0x58e9a0){_0x5eb186=_0x58e9a0[_0x4f49('0x6')](_0x58e9a0[_0x4f49('0x7')]('.'));}return _0x5eb186;}}}; \ No newline at end of file +var _0xabce=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xabce,0x103));var _0xeabc=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xabce[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'uniqueid':{'type':Sequelize[_0xeabc('0x2')]},'callerid':{'type':Sequelize[_0xeabc('0x2')]},'calleridname':{'type':Sequelize[_0xeabc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xeabc('0x2')]},'accountcode':{'type':Sequelize[_0xeabc('0x2')]},'dnid':{'type':Sequelize[_0xeabc('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xeabc('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xeabc('0x3')],'get':function(){var _0x52ede8='';var _0x3bdc29=this[_0xeabc('0x4')](_0xeabc('0x5'));if(_0x3bdc29){_0x52ede8=_0x3bdc29['substring'](_0x3bdc29[_0xeabc('0x6')]('.'));}return _0x52ede8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 7f8e60a..2cd7408 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 _0x94ca=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','find','create','body','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','extname','unlink','SquareRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x94ca,0x1a4));var _0xa94c=function(_0x5a8697,_0x4c7709){_0x5a8697=_0x5a8697-0x0;var _0x5d958f=_0x94ca[_0x5a8697];return _0x5d958f;};'use strict';var emlformat=require(_0xa94c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa94c('0x1'));var moment=require('moment');var BPromise=require(_0xa94c('0x2'));var Mustache=require(_0xa94c('0x3'));var util=require(_0xa94c('0x4'));var path=require('path');var sox=require(_0xa94c('0x5'));var csv=require(_0xa94c('0x6'));var ejs=require(_0xa94c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa94c('0x8'));var crypto=require(_0xa94c('0x9'));var jsforce=require(_0xa94c('0xa'));var deskjs=require(_0xa94c('0xb'));var toCsv=require(_0xa94c('0x6'));var querystring=require('querystring');var Papa=require(_0xa94c('0xc'));var Redis=require(_0xa94c('0xd'));var authService=require(_0xa94c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa94c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa94c('0x10'))(_0xa94c('0x11'));var utils=require(_0xa94c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa94c('0x13'));var db=require(_0xa94c('0x14'))['db'];function respondWithStatusCode(_0x2f5812,_0x20933a){_0x20933a=_0x20933a||0xcc;return function(_0x2f336f){if(_0x2f336f){return _0x2f5812[_0xa94c('0x15')](_0x20933a);}return _0x2f5812['status'](_0x20933a)['end']();};}function respondWithResult(_0xa07195,_0x8518f5){_0x8518f5=_0x8518f5||0xc8;return function(_0x4aac64){if(_0x4aac64){return _0xa07195[_0xa94c('0x16')](_0x8518f5)[_0xa94c('0x17')](_0x4aac64);}};}function respondWithFilteredResult(_0x2a2b6d,_0x5d5dc9){return function(_0x39babd){if(_0x39babd){var _0x2cb2f8=typeof _0x5d5dc9[_0xa94c('0x18')]==='undefined'&&typeof _0x5d5dc9[_0xa94c('0x19')]==='undefined';var _0x1d601c=_0x39babd[_0xa94c('0x1a')];var _0x20624b=_0x2cb2f8?0x0:_0x5d5dc9[_0xa94c('0x18')];var _0x17351a=_0x2cb2f8?_0x39babd[_0xa94c('0x1a')]:_0x5d5dc9[_0xa94c('0x18')]+_0x5d5dc9['limit'];var _0x3f6f1b;if(_0x17351a>=_0x1d601c){_0x17351a=_0x1d601c;_0x3f6f1b=0xc8;}else{_0x3f6f1b=0xce;}_0x2a2b6d['status'](_0x3f6f1b);return _0x2a2b6d[_0xa94c('0x1b')]('Content-Range',_0x20624b+'-'+_0x17351a+'/'+_0x1d601c)[_0xa94c('0x17')](_0x39babd);}return null;};}function patchUpdates(_0x1a7ca1){return function(_0x373cfb){try{jsonpatch[_0xa94c('0x1c')](_0x373cfb,_0x1a7ca1,!![]);}catch(_0x1e7436){return BPromise[_0xa94c('0x1d')](_0x1e7436);}return _0x373cfb[_0xa94c('0x1e')]();};}function saveUpdates(_0xfffb9,_0xb1e72){return function(_0x6bda11){if(_0x6bda11){return _0x6bda11[_0xa94c('0x1f')](_0xfffb9)[_0xa94c('0x20')](function(_0x260056){return _0x260056;});}return null;};}function removeEntity(_0x320378,_0x15a86b){return function(_0x2807b3){if(_0x2807b3){return _0x2807b3[_0xa94c('0x21')]()['then'](function(){_0x320378['status'](0xcc)[_0xa94c('0x22')]();});}};}function handleEntityNotFound(_0x139c62,_0x50b2c9){return function(_0x28ffa2){if(!_0x28ffa2){_0x139c62['sendStatus'](0x194);}return _0x28ffa2;};}function handleError(_0x1dd658,_0xd9b61e){_0xd9b61e=_0xd9b61e||0x1f4;return function(_0x2b8f1b){logger['error'](_0x2b8f1b[_0xa94c('0x23')]);if(_0x2b8f1b[_0xa94c('0x24')]){delete _0x2b8f1b[_0xa94c('0x24')];}_0x1dd658[_0xa94c('0x16')](_0xd9b61e)[_0xa94c('0x25')](_0x2b8f1b);};}exports['index']=function(_0xfb0c06,_0x31c756){var _0x52c019={},_0x5e8e38={},_0x50c15c={'count':0x0,'rows':[]};var _0x1ac2ad=_[_0xa94c('0x26')](db[_0xa94c('0x27')][_0xa94c('0x28')],function(_0xe59720){return{'name':_0xe59720[_0xa94c('0x29')],'type':_0xe59720[_0xa94c('0x2a')][_0xa94c('0x2b')]};});_0x5e8e38[_0xa94c('0x2c')]=_[_0xa94c('0x26')](_0x1ac2ad,_0xa94c('0x24'));_0x5e8e38[_0xa94c('0x2d')]=_[_0xa94c('0x2e')](_0xfb0c06[_0xa94c('0x2d')]);_0x5e8e38[_0xa94c('0x2f')]=_[_0xa94c('0x30')](_0x5e8e38[_0xa94c('0x2c')],_0x5e8e38[_0xa94c('0x2d')]);_0x52c019['attributes']=_['intersection'](_0x5e8e38[_0xa94c('0x2c')],qs[_0xa94c('0x31')](_0xfb0c06['query']['fields']));_0x52c019[_0xa94c('0x32')]=_0x52c019[_0xa94c('0x32')][_0xa94c('0x33')]?_0x52c019['attributes']:_0x5e8e38[_0xa94c('0x2c')];if(!_0xfb0c06['query'][_0xa94c('0x34')](_0xa94c('0x35'))){_0x52c019['limit']=qs[_0xa94c('0x19')](_0xfb0c06['query'][_0xa94c('0x19')]);_0x52c019[_0xa94c('0x18')]=qs[_0xa94c('0x18')](_0xfb0c06[_0xa94c('0x2d')]['offset']);}_0x52c019['order']=qs['sort'](_0xfb0c06[_0xa94c('0x2d')]['sort']);_0x52c019[_0xa94c('0x36')]=qs['filters'](_[_0xa94c('0x37')](_0xfb0c06[_0xa94c('0x2d')],_0x5e8e38[_0xa94c('0x2f')]),_0x1ac2ad);if(_0xfb0c06['query'][_0xa94c('0x38')]){_0x52c019[_0xa94c('0x36')]=_[_0xa94c('0x39')](_0x52c019[_0xa94c('0x36')],{'$or':_[_0xa94c('0x26')](_0x1ac2ad,function(_0x30ea8e){if(_0x30ea8e[_0xa94c('0x2a')]!==_0xa94c('0x3a')){var _0x244816={};_0x244816[_0x30ea8e[_0xa94c('0x24')]]={'$like':'%'+_0xfb0c06[_0xa94c('0x2d')][_0xa94c('0x38')]+'%'};return _0x244816;}})});}_0x52c019=_['merge']({},_0x52c019,_0xfb0c06['options']);var _0x310cf0={'where':_0x52c019['where']};return db[_0xa94c('0x27')][_0xa94c('0x1a')](_0x310cf0)[_0xa94c('0x20')](function(_0x18a8be){_0x50c15c['count']=_0x18a8be;if(_0xfb0c06[_0xa94c('0x2d')][_0xa94c('0x3b')]){_0x52c019[_0xa94c('0x3c')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x52c019);})[_0xa94c('0x20')](function(_0x2691b6){_0x50c15c['rows']=_0x2691b6;return _0x50c15c;})[_0xa94c('0x20')](respondWithFilteredResult(_0x31c756,_0x52c019))[_0xa94c('0x3d')](handleError(_0x31c756,null));};exports[_0xa94c('0x3e')]=function(_0x259ce6,_0x9f5ff6){var _0x5c40a5={'raw':!![],'where':{'id':_0x259ce6[_0xa94c('0x3f')]['id']}},_0x46da76={};_0x46da76[_0xa94c('0x2c')]=_[_0xa94c('0x2e')](db[_0xa94c('0x27')][_0xa94c('0x28')]);_0x46da76['query']=_[_0xa94c('0x2e')](_0x259ce6[_0xa94c('0x2d')]);_0x46da76[_0xa94c('0x2f')]=_[_0xa94c('0x30')](_0x46da76[_0xa94c('0x2c')],_0x46da76['query']);_0x5c40a5[_0xa94c('0x32')]=_[_0xa94c('0x30')](_0x46da76[_0xa94c('0x2c')],qs['fields'](_0x259ce6['query'][_0xa94c('0x31')]));_0x5c40a5[_0xa94c('0x32')]=_0x5c40a5[_0xa94c('0x32')][_0xa94c('0x33')]?_0x5c40a5[_0xa94c('0x32')]:_0x46da76[_0xa94c('0x2c')];if(_0x259ce6['query'][_0xa94c('0x3b')]){_0x5c40a5[_0xa94c('0x3c')]=[{'all':!![]}];}_0x5c40a5=_['merge']({},_0x5c40a5,_0x259ce6['options']);return db[_0xa94c('0x27')][_0xa94c('0x40')](_0x5c40a5)[_0xa94c('0x20')](handleEntityNotFound(_0x9f5ff6,null))[_0xa94c('0x20')](respondWithResult(_0x9f5ff6,null))['catch'](handleError(_0x9f5ff6,null));};exports[_0xa94c('0x41')]=function(_0x510cca,_0x18a193){return db[_0xa94c('0x27')][_0xa94c('0x41')](_0x510cca[_0xa94c('0x42')],{})[_0xa94c('0x20')](respondWithResult(_0x18a193,0xc9))[_0xa94c('0x3d')](handleError(_0x18a193,null));};exports['update']=function(_0x304aa0,_0x3fae39){if(_0x304aa0[_0xa94c('0x42')]['id']){delete _0x304aa0[_0xa94c('0x42')]['id'];}return db[_0xa94c('0x27')][_0xa94c('0x40')]({'where':{'id':_0x304aa0[_0xa94c('0x3f')]['id']}})[_0xa94c('0x20')](handleEntityNotFound(_0x3fae39,null))['then'](saveUpdates(_0x304aa0[_0xa94c('0x42')],null))[_0xa94c('0x20')](respondWithResult(_0x3fae39,null))['catch'](handleError(_0x3fae39,null));};exports[_0xa94c('0x43')]=function(_0x5899b7,_0x9dccd3,_0x4b594f){var _0x2420c5=require('../../components/encryptor');var _0x34e0a3=![];var _0x421f64={};if(_0x5899b7['query'][_0xa94c('0x2a')]&&_0x5899b7[_0xa94c('0x2d')][_0xa94c('0x2a')]===_0xa94c('0x44')){_0x421f64['uniqueid']=_0x5899b7['params']['id'];}else{_0x421f64['id']=_0x5899b7[_0xa94c('0x3f')]['id'];}return db['SquareRecording']['find']({'where':_0x421f64,'attributes':['id',_0xa94c('0x45'),_0xa94c('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x9dccd3,null))[_0xa94c('0x20')](function(_0x5ae87a){if(_0x5ae87a){var _0x45e311=_0x5ae87a['savePath'];var _0x1ad777=util[_0xa94c('0x47')](_0xa94c('0x48'),_0x45e311);if(fs[_0xa94c('0x49')](_0x1ad777)){_0x34e0a3=!![];return _0x2420c5[_0xa94c('0x4a')](_0x1ad777,_0x45e311,config[_0xa94c('0x4b')][_0xa94c('0x4c')])[_0xa94c('0x20')](function(){return _0x5ae87a;});}return _0x5ae87a;}})[_0xa94c('0x20')](function(_0x364931){if(_0x364931){var _0x5e1498=_0x364931[_0xa94c('0x45')];if(!fs['existsSync'](_0x5e1498)){throw new db[(_0xa94c('0x4d'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x364931[_0xa94c('0x46')]){return _0x9dccd3[_0xa94c('0x43')](_0x5e1498,_0x364931['filename']+path[_0xa94c('0x4e')](_0x5e1498),function(){if(_0x34e0a3){fs[_0xa94c('0x4f')](_0x5e1498);}});}else{return _0x9dccd3[_0xa94c('0x43')](_0x5e1498,function(_0x49b767){if(_0x34e0a3){fs['unlink'](_0x5e1498);}});}}})[_0xa94c('0x3d')](function(_0x4679db){if(_0x4679db['message']===_0xa94c('0x50')){_0x9dccd3['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x9dccd3,null);}});};exports[_0xa94c('0x21')]=function(_0x4c419e,_0x2180fb){return db[_0xa94c('0x27')][_0xa94c('0x40')]({'where':{'id':_0x4c419e['params']['id']}})[_0xa94c('0x20')](function(_0x4ca1af){if(_[_0xa94c('0x51')](_0x4ca1af)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ca1af;})[_0xa94c('0x20')](function(_0x43eec6){var _0x351ee7=_0x43eec6[_0xa94c('0x45')];logger[_0xa94c('0x52')](_0xa94c('0x53'),_0x351ee7);if(!_[_0xa94c('0x51')](_0x43eec6[_0xa94c('0x45')])&&fs[_0xa94c('0x49')](_0x351ee7)){logger['info']('File:\x20\x22'+_0x351ee7+_0xa94c('0x54'));fs[_0xa94c('0x55')](_0x351ee7);}_0x351ee7=_0x351ee7+_0xa94c('0x56');if(!_[_0xa94c('0x51')](_0x43eec6[_0xa94c('0x45')])&&fs['existsSync'](_0x351ee7)){logger[_0xa94c('0x52')]('File:\x20\x22'+_0x351ee7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa94c('0x55')](_0x351ee7);}return _0x43eec6;})[_0xa94c('0x20')](function(_0x306a29){if(!_0x306a29)throw new InternalError();return _0x306a29[_0xa94c('0x21')]();})[_0xa94c('0x20')](function(){_0x2180fb['status'](0xcc)[_0xa94c('0x22')]();})[_0xa94c('0x3d')](handleError(_0x2180fb,null));}; \ No newline at end of file +var _0x8864=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','create','body','find','params','download','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8864,0x10e));var _0x4886=function(_0x12019a,_0x407485){_0x12019a=_0x12019a-0x0;var _0x49520a=_0x8864[_0x12019a];return _0x49520a;};'use strict';var emlformat=require(_0x4886('0x0'));var rimraf=require(_0x4886('0x1'));var zipdir=require(_0x4886('0x2'));var jsonpatch=require(_0x4886('0x3'));var rp=require(_0x4886('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4886('0x5'));var path=require(_0x4886('0x6'));var sox=require('sox');var csv=require(_0x4886('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4886('0x8'));var _=require(_0x4886('0x9'));var squel=require(_0x4886('0xa'));var crypto=require('crypto');var jsforce=require(_0x4886('0xb'));var deskjs=require(_0x4886('0xc'));var toCsv=require(_0x4886('0x7'));var querystring=require(_0x4886('0xd'));var Papa=require(_0x4886('0xe'));var Redis=require(_0x4886('0xf'));var authService=require(_0x4886('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4886('0x11'));var hardwareService=require(_0x4886('0x12'));var logger=require(_0x4886('0x13'))(_0x4886('0x14'));var utils=require(_0x4886('0x15'));var config=require(_0x4886('0x16'));var licenseUtil=require(_0x4886('0x17'));var db=require(_0x4886('0x18'))['db'];function respondWithStatusCode(_0x5d1e7c,_0xf19c71){_0xf19c71=_0xf19c71||0xcc;return function(_0x31ef5f){if(_0x31ef5f){return _0x5d1e7c[_0x4886('0x19')](_0xf19c71);}return _0x5d1e7c[_0x4886('0x1a')](_0xf19c71)[_0x4886('0x1b')]();};}function respondWithResult(_0x2e430b,_0x432ab1){_0x432ab1=_0x432ab1||0xc8;return function(_0x1c71bb){if(_0x1c71bb){return _0x2e430b[_0x4886('0x1a')](_0x432ab1)[_0x4886('0x1c')](_0x1c71bb);}};}function respondWithFilteredResult(_0x31e3f5,_0x82b984){return function(_0x584b19){if(_0x584b19){var _0x375758=typeof _0x82b984[_0x4886('0x1d')]===_0x4886('0x1e')&&typeof _0x82b984['limit']==='undefined';var _0x4a898a=_0x584b19[_0x4886('0x1f')];var _0x40e96c=_0x375758?0x0:_0x82b984['offset'];var _0x92e10d=_0x375758?_0x584b19[_0x4886('0x1f')]:_0x82b984[_0x4886('0x1d')]+_0x82b984[_0x4886('0x20')];var _0xd9bb6c;if(_0x92e10d>=_0x4a898a){_0x92e10d=_0x4a898a;_0xd9bb6c=0xc8;}else{_0xd9bb6c=0xce;}_0x31e3f5['status'](_0xd9bb6c);return _0x31e3f5[_0x4886('0x21')](_0x4886('0x22'),_0x40e96c+'-'+_0x92e10d+'/'+_0x4a898a)[_0x4886('0x1c')](_0x584b19);}return null;};}function patchUpdates(_0x137dba){return function(_0x307d58){try{jsonpatch[_0x4886('0x23')](_0x307d58,_0x137dba,!![]);}catch(_0x13e326){return BPromise['reject'](_0x13e326);}return _0x307d58[_0x4886('0x24')]();};}function saveUpdates(_0x5d4505,_0x530f38){return function(_0x9e2e9c){if(_0x9e2e9c){return _0x9e2e9c[_0x4886('0x25')](_0x5d4505)[_0x4886('0x26')](function(_0xfe5a08){return _0xfe5a08;});}return null;};}function removeEntity(_0x37a0ea,_0x2820e8){return function(_0x26d415){if(_0x26d415){return _0x26d415[_0x4886('0x27')]()[_0x4886('0x26')](function(){_0x37a0ea[_0x4886('0x1a')](0xcc)[_0x4886('0x1b')]();});}};}function handleEntityNotFound(_0x5bd95f,_0x3c3ac7){return function(_0x24f477){if(!_0x24f477){_0x5bd95f[_0x4886('0x19')](0x194);}return _0x24f477;};}function handleError(_0x6a757c,_0x28c392){_0x28c392=_0x28c392||0x1f4;return function(_0x5eb897){logger[_0x4886('0x28')](_0x5eb897[_0x4886('0x29')]);if(_0x5eb897['name']){delete _0x5eb897[_0x4886('0x2a')];}_0x6a757c[_0x4886('0x1a')](_0x28c392)[_0x4886('0x2b')](_0x5eb897);};}exports[_0x4886('0x2c')]=function(_0x5866df,_0x23601e){var _0x59ceac={},_0x5b910b={},_0x32bc74={'count':0x0,'rows':[]};var _0x2d152f=_[_0x4886('0x2d')](db[_0x4886('0x2e')][_0x4886('0x2f')],function(_0x318f5c){return{'name':_0x318f5c['fieldName'],'type':_0x318f5c[_0x4886('0x30')][_0x4886('0x31')]};});_0x5b910b[_0x4886('0x32')]=_['map'](_0x2d152f,_0x4886('0x2a'));_0x5b910b[_0x4886('0x33')]=_[_0x4886('0x34')](_0x5866df[_0x4886('0x33')]);_0x5b910b['filters']=_[_0x4886('0x35')](_0x5b910b[_0x4886('0x32')],_0x5b910b[_0x4886('0x33')]);_0x59ceac['attributes']=_[_0x4886('0x35')](_0x5b910b[_0x4886('0x32')],qs[_0x4886('0x36')](_0x5866df[_0x4886('0x33')][_0x4886('0x36')]));_0x59ceac['attributes']=_0x59ceac[_0x4886('0x37')][_0x4886('0x38')]?_0x59ceac[_0x4886('0x37')]:_0x5b910b['model'];if(!_0x5866df[_0x4886('0x33')]['hasOwnProperty'](_0x4886('0x39'))){_0x59ceac[_0x4886('0x20')]=qs[_0x4886('0x20')](_0x5866df[_0x4886('0x33')]['limit']);_0x59ceac[_0x4886('0x1d')]=qs['offset'](_0x5866df[_0x4886('0x33')]['offset']);}_0x59ceac[_0x4886('0x3a')]=qs[_0x4886('0x3b')](_0x5866df[_0x4886('0x33')][_0x4886('0x3b')]);_0x59ceac[_0x4886('0x3c')]=qs[_0x4886('0x3d')](_[_0x4886('0x3e')](_0x5866df[_0x4886('0x33')],_0x5b910b['filters']),_0x2d152f);if(_0x5866df['query'][_0x4886('0x3f')]){_0x59ceac[_0x4886('0x3c')]=_['merge'](_0x59ceac[_0x4886('0x3c')],{'$or':_['map'](_0x2d152f,function(_0x7c38dd){if(_0x7c38dd['type']!==_0x4886('0x40')){var _0x2aaf71={};_0x2aaf71[_0x7c38dd[_0x4886('0x2a')]]={'$like':'%'+_0x5866df['query'][_0x4886('0x3f')]+'%'};return _0x2aaf71;}})});}_0x59ceac=_[_0x4886('0x41')]({},_0x59ceac,_0x5866df[_0x4886('0x42')]);var _0x51371f={'where':_0x59ceac[_0x4886('0x3c')]};return db[_0x4886('0x2e')][_0x4886('0x1f')](_0x51371f)[_0x4886('0x26')](function(_0x51a7c0){_0x32bc74[_0x4886('0x1f')]=_0x51a7c0;if(_0x5866df['query']['includeAll']){_0x59ceac[_0x4886('0x43')]=[{'all':!![]}];}return db['SquareRecording'][_0x4886('0x44')](_0x59ceac);})[_0x4886('0x26')](function(_0x3a6f0a){_0x32bc74[_0x4886('0x45')]=_0x3a6f0a;return _0x32bc74;})[_0x4886('0x26')](respondWithFilteredResult(_0x23601e,_0x59ceac))[_0x4886('0x46')](handleError(_0x23601e,null));};exports['show']=function(_0x4252a0,_0x1ad7fc){var _0x253589={'raw':!![],'where':{'id':_0x4252a0['params']['id']}},_0x52e99a={};_0x52e99a[_0x4886('0x32')]=_[_0x4886('0x34')](db[_0x4886('0x2e')][_0x4886('0x2f')]);_0x52e99a[_0x4886('0x33')]=_[_0x4886('0x34')](_0x4252a0[_0x4886('0x33')]);_0x52e99a[_0x4886('0x3d')]=_[_0x4886('0x35')](_0x52e99a[_0x4886('0x32')],_0x52e99a[_0x4886('0x33')]);_0x253589[_0x4886('0x37')]=_['intersection'](_0x52e99a[_0x4886('0x32')],qs[_0x4886('0x36')](_0x4252a0['query']['fields']));_0x253589[_0x4886('0x37')]=_0x253589[_0x4886('0x37')][_0x4886('0x38')]?_0x253589[_0x4886('0x37')]:_0x52e99a['model'];if(_0x4252a0['query'][_0x4886('0x47')]){_0x253589['include']=[{'all':!![]}];}_0x253589=_[_0x4886('0x41')]({},_0x253589,_0x4252a0[_0x4886('0x42')]);return db[_0x4886('0x2e')]['find'](_0x253589)[_0x4886('0x26')](handleEntityNotFound(_0x1ad7fc,null))[_0x4886('0x26')](respondWithResult(_0x1ad7fc,null))['catch'](handleError(_0x1ad7fc,null));};exports[_0x4886('0x48')]=function(_0x4db1c6,_0x17bdb0){return db[_0x4886('0x2e')][_0x4886('0x48')](_0x4db1c6[_0x4886('0x49')],{})[_0x4886('0x26')](respondWithResult(_0x17bdb0,0xc9))[_0x4886('0x46')](handleError(_0x17bdb0,null));};exports[_0x4886('0x25')]=function(_0x54b83c,_0x4cfe38){if(_0x54b83c[_0x4886('0x49')]['id']){delete _0x54b83c['body']['id'];}return db[_0x4886('0x2e')][_0x4886('0x4a')]({'where':{'id':_0x54b83c[_0x4886('0x4b')]['id']}})[_0x4886('0x26')](handleEntityNotFound(_0x4cfe38,null))['then'](saveUpdates(_0x54b83c[_0x4886('0x49')],null))[_0x4886('0x26')](respondWithResult(_0x4cfe38,null))['catch'](handleError(_0x4cfe38,null));};exports[_0x4886('0x4c')]=function(_0x2f2847,_0x2cbbc1,_0x218e49){var _0x3e7d6c=require('../../components/encryptor');var _0x5b325f=![];var _0x4a757c={};if(_0x2f2847[_0x4886('0x33')][_0x4886('0x30')]&&_0x2f2847[_0x4886('0x33')][_0x4886('0x30')]===_0x4886('0x4d')){_0x4a757c[_0x4886('0x4d')]=_0x2f2847['params']['id'];}else{_0x4a757c['id']=_0x2f2847[_0x4886('0x4b')]['id'];}return db[_0x4886('0x2e')][_0x4886('0x4a')]({'where':_0x4a757c,'attributes':['id','savePath',_0x4886('0x4e')],'raw':!![]})[_0x4886('0x26')](handleEntityNotFound(_0x2cbbc1,null))[_0x4886('0x26')](function(_0x49f80c){if(_0x49f80c){var _0x209b5e=_0x49f80c[_0x4886('0x4f')];var _0x5a4980=util['format'](_0x4886('0x50'),_0x209b5e);if(fs[_0x4886('0x51')](_0x5a4980)){_0x5b325f=!![];return _0x3e7d6c[_0x4886('0x52')](_0x5a4980,_0x209b5e,config[_0x4886('0x53')][_0x4886('0x54')])[_0x4886('0x26')](function(){return _0x49f80c;});}return _0x49f80c;}})[_0x4886('0x26')](function(_0x2399b5){if(_0x2399b5){var _0x27c5bc=_0x2399b5[_0x4886('0x4f')];if(!fs[_0x4886('0x51')](_0x27c5bc)){throw new db[(_0x4886('0x55'))][(_0x4886('0x56'))](_0x4886('0x57'));}if(_0x2399b5[_0x4886('0x4e')]){return _0x2cbbc1[_0x4886('0x4c')](_0x27c5bc,_0x2399b5['filename']+path['extname'](_0x27c5bc),function(){if(_0x5b325f){fs[_0x4886('0x58')](_0x27c5bc);}});}else{return _0x2cbbc1[_0x4886('0x4c')](_0x27c5bc,function(_0x5728ef){if(_0x5b325f){fs['unlink'](_0x27c5bc);}});}}})['catch'](function(_0x35721e){if(_0x35721e[_0x4886('0x59')]==='SquareRecording\x20not\x20found'){_0x2cbbc1[_0x4886('0x1a')](0x194)[_0x4886('0x2b')](_0x4886('0x5a'));}else{return handleError(_0x2cbbc1,null);}});};exports['destroy']=function(_0x5361b8,_0x5b13db){return db['SquareRecording'][_0x4886('0x4a')]({'where':{'id':_0x5361b8[_0x4886('0x4b')]['id']}})[_0x4886('0x26')](function(_0x33a289){if(_[_0x4886('0x5b')](_0x33a289)){throw new ReferenceError(_0x4886('0x5c'));}return _0x33a289;})[_0x4886('0x26')](function(_0x334a59){var _0x269af9=_0x334a59[_0x4886('0x4f')];logger[_0x4886('0x5d')](_0x4886('0x5e'),_0x269af9);if(!_[_0x4886('0x5b')](_0x334a59['savePath'])&&fs['existsSync'](_0x269af9)){logger[_0x4886('0x5d')]('File:\x20\x22'+_0x269af9+_0x4886('0x5f'));fs['unlinkSync'](_0x269af9);}_0x269af9=_0x269af9+_0x4886('0x60');if(!_[_0x4886('0x5b')](_0x334a59[_0x4886('0x4f')])&&fs[_0x4886('0x51')](_0x269af9)){logger[_0x4886('0x5d')]('File:\x20\x22'+_0x269af9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4886('0x61')](_0x269af9);}return _0x334a59;})[_0x4886('0x26')](function(_0x23b302){if(!_0x23b302)throw new InternalError();return _0x23b302['destroy']();})[_0x4886('0x26')](function(){_0x5b13db[_0x4886('0x1a')](0xcc)[_0x4886('0x1b')]();})[_0x4886('0x46')](handleError(_0x5b13db,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 0cb5078..581cc0e 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 _0x86b8=['moment','request-promise','path','rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0xdbf392,_0x198c59){var _0x2c7b45=function(_0x5c3678){while(--_0x5c3678){_0xdbf392['push'](_0xdbf392['shift']());}};_0x2c7b45(++_0x198c59);}(_0x86b8,0x15d));var _0x886b=function(_0x14c71a,_0x111613){_0x14c71a=_0x14c71a-0x0;var _0x55b023=_0x86b8[_0x14c71a];return _0x55b023;};'use strict';var _=require(_0x886b('0x0'));var util=require(_0x886b('0x1'));var logger=require(_0x886b('0x2'))('api');var moment=require(_0x886b('0x3'));var BPromise=require('bluebird');var rp=require(_0x886b('0x4'));var fs=require('fs');var path=require(_0x886b('0x5'));var rimraf=require(_0x886b('0x6'));var config=require('../../config/environment');var attributes=require(_0x886b('0x7'));module['exports']=function(_0x5b5ff5,_0x2c32bc){return _0x5b5ff5[_0x886b('0x8')](_0x886b('0x9'),attributes,{'tableName':_0x886b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7374=['SquareRecording','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x467ae5,_0x521145){var _0x472584=function(_0x354670){while(--_0x354670){_0x467ae5['push'](_0x467ae5['shift']());}};_0x472584(++_0x521145);}(_0x7374,0x1b9));var _0x4737=function(_0x43380a,_0x49541b){_0x43380a=_0x43380a-0x0;var _0x5a11dd=_0x7374[_0x43380a];return _0x5a11dd;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var logger=require(_0x4737('0x2'))(_0x4737('0x3'));var moment=require(_0x4737('0x4'));var BPromise=require('bluebird');var rp=require(_0x4737('0x5'));var fs=require('fs');var path=require(_0x4737('0x6'));var rimraf=require(_0x4737('0x7'));var config=require(_0x4737('0x8'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x162bf0,_0xc35930){return _0x162bf0[_0x4737('0x9')](_0x4737('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 1f13024..8630834 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 _0x7647=['CreateSquareRecording','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','create','options','raw'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7647,0x197));var _0x7764=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7647[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7764('0x0'));var util=require(_0x7764('0x1'));var moment=require(_0x7764('0x2'));var BPromise=require('bluebird');var rs=require(_0x7764('0x3'));var fs=require('fs');var Redis=require(_0x7764('0x4'));var db=require(_0x7764('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7764('0x6'))(_0x7764('0x7'));var config=require(_0x7764('0x8'));var jayson=require(_0x7764('0x9'));var client=jayson['client'][_0x7764('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57d7aa,_0x1a3b46,_0x2431b1){return new BPromise(function(_0x387089,_0x58aa34){return client[_0x7764('0xb')](_0x57d7aa,_0x2431b1)[_0x7764('0xc')](function(_0x5730e4){logger[_0x7764('0xd')](_0x7764('0xe'),_0x1a3b46,_0x7764('0xf'));logger[_0x7764('0x10')](_0x7764('0x11'),_0x1a3b46,_0x7764('0xf'),JSON['stringify'](_0x5730e4));if(_0x5730e4['error']){if(_0x5730e4[_0x7764('0x12')][_0x7764('0x13')]===0x1f4){logger[_0x7764('0x12')]('SquareRecording,\x20%s,\x20%s',_0x1a3b46,_0x5730e4['error'][_0x7764('0x14')]);return _0x58aa34(_0x5730e4['error']['message']);}logger[_0x7764('0x12')](_0x7764('0xe'),_0x1a3b46,_0x5730e4['error']['message']);return _0x387089(_0x5730e4[_0x7764('0x12')]['message']);}else{logger[_0x7764('0xd')](_0x7764('0xe'),_0x1a3b46,_0x7764('0xf'));_0x387089(_0x5730e4['result'][_0x7764('0x14')]);}})[_0x7764('0x15')](function(_0x4efd64){logger[_0x7764('0x12')](_0x7764('0xe'),_0x1a3b46,_0x4efd64);_0x58aa34(_0x4efd64);});});}exports['CreateSquareRecording']=function(_0x1e553e){var _0x432063=this;return new Promise(function(_0x357ccc,_0x2dcda2){return db['SquareRecording'][_0x7764('0x16')](_0x1e553e['body'],{'raw':_0x1e553e[_0x7764('0x17')]?_0x1e553e['options'][_0x7764('0x18')]===undefined?!![]:![]:!![]})[_0x7764('0xc')](function(_0x20c0b7){logger[_0x7764('0xd')](_0x7764('0x19'),_0x1e553e);logger[_0x7764('0x10')]('CreateSquareRecording',_0x1e553e,JSON[_0x7764('0x1a')](_0x20c0b7));_0x357ccc(_0x20c0b7);})['catch'](function(_0x61b78){logger[_0x7764('0x12')](_0x7764('0x19'),_0x61b78[_0x7764('0x14')],_0x1e553e);_0x2dcda2(_0x432063[_0x7764('0x12')](0x1f4,_0x61b78['message']));});});}; \ No newline at end of file +var _0xacfd=['result','CreateSquareRecording','SquareRecording','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2a65d0,_0x5d9238){var _0x45a1e3=function(_0x20777f){while(--_0x20777f){_0x2a65d0['push'](_0x2a65d0['shift']());}};_0x45a1e3(++_0x5d9238);}(_0xacfd,0x144));var _0xdacf=function(_0x565a33,_0x26b2ba){_0x565a33=_0x565a33-0x0;var _0x2abe46=_0xacfd[_0x565a33];return _0x2abe46;};'use strict';var _=require(_0xdacf('0x0'));var util=require(_0xdacf('0x1'));var moment=require(_0xdacf('0x2'));var BPromise=require(_0xdacf('0x3'));var rs=require(_0xdacf('0x4'));var fs=require('fs');var Redis=require(_0xdacf('0x5'));var db=require(_0xdacf('0x6'))['db'];var utils=require(_0xdacf('0x7'));var logger=require(_0xdacf('0x8'))(_0xdacf('0x9'));var config=require(_0xdacf('0xa'));var jayson=require(_0xdacf('0xb'));var client=jayson[_0xdacf('0xc')][_0xdacf('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x47dc88,_0x4b9393,_0x62dec4){return new BPromise(function(_0x12e329,_0x3ce239){return client['request'](_0x47dc88,_0x62dec4)[_0xdacf('0xe')](function(_0x2cce8a){logger[_0xdacf('0xf')](_0xdacf('0x10'),_0x4b9393,_0xdacf('0x11'));logger[_0xdacf('0x12')](_0xdacf('0x13'),_0x4b9393,_0xdacf('0x11'),JSON[_0xdacf('0x14')](_0x2cce8a));if(_0x2cce8a[_0xdacf('0x15')]){if(_0x2cce8a[_0xdacf('0x15')][_0xdacf('0x16')]===0x1f4){logger[_0xdacf('0x15')](_0xdacf('0x10'),_0x4b9393,_0x2cce8a[_0xdacf('0x15')]['message']);return _0x3ce239(_0x2cce8a[_0xdacf('0x15')][_0xdacf('0x17')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x4b9393,_0x2cce8a[_0xdacf('0x15')][_0xdacf('0x17')]);return _0x12e329(_0x2cce8a[_0xdacf('0x15')][_0xdacf('0x17')]);}else{logger[_0xdacf('0xf')]('SquareRecording,\x20%s,\x20%s',_0x4b9393,_0xdacf('0x11'));_0x12e329(_0x2cce8a[_0xdacf('0x18')][_0xdacf('0x17')]);}})['catch'](function(_0x3d1649){logger[_0xdacf('0x15')]('SquareRecording,\x20%s,\x20%s',_0x4b9393,_0x3d1649);_0x3ce239(_0x3d1649);});});}exports[_0xdacf('0x19')]=function(_0x4a9c47){var _0x3c3e78=this;return new Promise(function(_0x2ebd2a,_0x2d15e4){return db[_0xdacf('0x1a')]['create'](_0x4a9c47[_0xdacf('0x1b')],{'raw':_0x4a9c47['options']?_0x4a9c47[_0xdacf('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xdacf('0xe')](function(_0x4f919d){logger[_0xdacf('0xf')](_0xdacf('0x19'),_0x4a9c47);logger[_0xdacf('0x12')](_0xdacf('0x19'),_0x4a9c47,JSON[_0xdacf('0x14')](_0x4f919d));_0x2ebd2a(_0x4f919d);})['catch'](function(_0x68575e){logger[_0xdacf('0x15')](_0xdacf('0x19'),_0x68575e[_0xdacf('0x17')],_0x4a9c47);_0x2d15e4(_0x3c3e78[_0xdacf('0x15')](0x1f4,_0x68575e[_0xdacf('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 1c1b9be..1f5f4dd 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x10aab3,_0x32cf93){var _0x496b74=function(_0x4a071d){while(--_0x4a071d){_0x10aab3['push'](_0x10aab3['shift']());}};_0x496b74(++_0x32cf93);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a09c6,_0x54ce5e){_0x4a09c6=_0x4a09c6-0x0;var _0x25d834=_0xb10b[_0x4a09c6];return _0x25d834;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x1c8982,_0x1dfb9c){var _0x325939=function(_0x18f6f4){while(--_0x18f6f4){_0x1c8982['push'](_0x1c8982['shift']());}};_0x325939(++_0x1dfb9c);}(_0xe706,0xa3));var _0x6e70=function(_0x519401,_0x3c39ab){_0x519401=_0x519401-0x0;var _0x11e911=_0xe706[_0x519401];return _0x11e911;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index bc70325..4a624f1 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 _0x0c75=['BOOLEAN','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0c75,0x1c3));var _0x50c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c75[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x50c7('0x0')]},'request':{'type':Sequelize[_0x50c7('0x0')]},'channel':{'type':Sequelize[_0x50c7('0x0')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x50c7('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x50c7('0x0')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x50c7('0x0')]},'callington':{'type':Sequelize[_0x50c7('0x0')]},'callingtns':{'type':Sequelize[_0x50c7('0x0')]},'dnid':{'type':Sequelize[_0x50c7('0x0')]},'rdnis':{'type':Sequelize[_0x50c7('0x0')]},'context':{'type':Sequelize[_0x50c7('0x0')]},'extension':{'type':Sequelize[_0x50c7('0x0')]},'priority':{'type':Sequelize[_0x50c7('0x0')]},'enhanced':{'type':Sequelize[_0x50c7('0x0')]},'accountcode':{'type':Sequelize[_0x50c7('0x0')]},'threadid':{'type':Sequelize[_0x50c7('0x0')]},'project_name':{'type':Sequelize[_0x50c7('0x0')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x50c7('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x2158=['sequelize','exports','STRING','DATE'];(function(_0x38f7b1,_0x3d6c11){var _0x25a9fd=function(_0x2bb939){while(--_0x2bb939){_0x38f7b1['push'](_0x38f7b1['shift']());}};_0x25a9fd(++_0x3d6c11);}(_0x2158,0x1bc));var _0x8215=function(_0x304ccc,_0x5a955a){_0x304ccc=_0x304ccc-0x0;var _0x569c32=_0x2158[_0x304ccc];return _0x569c32;};'use strict';var Sequelize=require(_0x8215('0x0'));module[_0x8215('0x1')]={'network':{'type':Sequelize[_0x8215('0x2')]},'network_script':{'type':Sequelize[_0x8215('0x2')]},'request':{'type':Sequelize[_0x8215('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8215('0x2')]},'type':{'type':Sequelize[_0x8215('0x2')]},'uniqueid':{'type':Sequelize[_0x8215('0x2')]},'version':{'type':Sequelize[_0x8215('0x2')]},'callerid':{'type':Sequelize[_0x8215('0x2')]},'calleridname':{'type':Sequelize[_0x8215('0x2')]},'callingpres':{'type':Sequelize[_0x8215('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x8215('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x8215('0x2')]},'context':{'type':Sequelize[_0x8215('0x2')]},'extension':{'type':Sequelize[_0x8215('0x2')]},'priority':{'type':Sequelize[_0x8215('0x2')]},'enhanced':{'type':Sequelize[_0x8215('0x2')]},'accountcode':{'type':Sequelize[_0x8215('0x2')]},'threadid':{'type':Sequelize[_0x8215('0x2')]},'project_name':{'type':Sequelize[_0x8215('0x2')]},'joinAt':{'type':Sequelize[_0x8215('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 0262d72..ffc53da 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 _0xe276=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','SquareReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe276,0x88));var _0x6e27=function(_0x3400ca,_0x27c04d){_0x3400ca=_0x3400ca-0x0;var _0x26e8d1=_0xe276[_0x3400ca];return _0x26e8d1;};'use strict';var emlformat=require(_0x6e27('0x0'));var rimraf=require(_0x6e27('0x1'));var zipdir=require(_0x6e27('0x2'));var jsonpatch=require(_0x6e27('0x3'));var rp=require(_0x6e27('0x4'));var moment=require('moment');var BPromise=require(_0x6e27('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6e27('0x6'));var sox=require('sox');var csv=require(_0x6e27('0x7'));var ejs=require(_0x6e27('0x8'));var fs=require('fs');var fs_extra=require(_0x6e27('0x9'));var _=require(_0x6e27('0xa'));var squel=require('squel');var crypto=require(_0x6e27('0xb'));var jsforce=require(_0x6e27('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6e27('0x7'));var querystring=require(_0x6e27('0xd'));var Papa=require(_0x6e27('0xe'));var Redis=require(_0x6e27('0xf'));var authService=require(_0x6e27('0x10'));var qs=require(_0x6e27('0x11'));var as=require(_0x6e27('0x12'));var hardwareService=require(_0x6e27('0x13'));var logger=require(_0x6e27('0x14'))(_0x6e27('0x15'));var utils=require(_0x6e27('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6e27('0x17'));var db=require(_0x6e27('0x18'))['db'];function respondWithStatusCode(_0x841f9b,_0xdeeb51){_0xdeeb51=_0xdeeb51||0xcc;return function(_0x14bb96){if(_0x14bb96){return _0x841f9b['sendStatus'](_0xdeeb51);}return _0x841f9b[_0x6e27('0x19')](_0xdeeb51)[_0x6e27('0x1a')]();};}function respondWithResult(_0x2859bb,_0x202456){_0x202456=_0x202456||0xc8;return function(_0x359d8e){if(_0x359d8e){return _0x2859bb[_0x6e27('0x19')](_0x202456)['json'](_0x359d8e);}};}function respondWithFilteredResult(_0x264263,_0x1b4b69){return function(_0x3304a5){if(_0x3304a5){var _0x49e758=typeof _0x1b4b69[_0x6e27('0x1b')]===_0x6e27('0x1c')&&typeof _0x1b4b69['limit']===_0x6e27('0x1c');var _0x3b3fa5=_0x3304a5[_0x6e27('0x1d')];var _0x1c1bc2=_0x49e758?0x0:_0x1b4b69[_0x6e27('0x1b')];var _0x14c176=_0x49e758?_0x3304a5['count']:_0x1b4b69[_0x6e27('0x1b')]+_0x1b4b69[_0x6e27('0x1e')];var _0x3197f5;if(_0x14c176>=_0x3b3fa5){_0x14c176=_0x3b3fa5;_0x3197f5=0xc8;}else{_0x3197f5=0xce;}_0x264263['status'](_0x3197f5);return _0x264263[_0x6e27('0x1f')](_0x6e27('0x20'),_0x1c1bc2+'-'+_0x14c176+'/'+_0x3b3fa5)['json'](_0x3304a5);}return null;};}function patchUpdates(_0x3b732e){return function(_0x3a1502){try{jsonpatch[_0x6e27('0x21')](_0x3a1502,_0x3b732e,!![]);}catch(_0x427cdb){return BPromise[_0x6e27('0x22')](_0x427cdb);}return _0x3a1502[_0x6e27('0x23')]();};}function saveUpdates(_0x2d97d4,_0x3b894b){return function(_0x470641){if(_0x470641){return _0x470641[_0x6e27('0x24')](_0x2d97d4)[_0x6e27('0x25')](function(_0x54cc72){return _0x54cc72;});}return null;};}function removeEntity(_0x464965,_0x5214aa){return function(_0x5900ad){if(_0x5900ad){return _0x5900ad['destroy']()[_0x6e27('0x25')](function(){_0x464965[_0x6e27('0x19')](0xcc)[_0x6e27('0x1a')]();});}};}function handleEntityNotFound(_0x4d4956,_0x1d5249){return function(_0x1d8e0f){if(!_0x1d8e0f){_0x4d4956[_0x6e27('0x26')](0x194);}return _0x1d8e0f;};}function handleError(_0x1d565c,_0x13fc1f){_0x13fc1f=_0x13fc1f||0x1f4;return function(_0x25a995){logger[_0x6e27('0x27')](_0x25a995[_0x6e27('0x28')]);if(_0x25a995[_0x6e27('0x29')]){delete _0x25a995['name'];}_0x1d565c[_0x6e27('0x19')](_0x13fc1f)[_0x6e27('0x2a')](_0x25a995);};}exports[_0x6e27('0x2b')]=function(_0x139a45,_0x4c073f){var _0x1a1cb2={},_0x3bae26={},_0x170bfd={'count':0x0,'rows':[]};var _0x4c2015=_['map'](db[_0x6e27('0x2c')][_0x6e27('0x2d')],function(_0x2345db){return{'name':_0x2345db['fieldName'],'type':_0x2345db[_0x6e27('0x2e')][_0x6e27('0x2f')]};});_0x3bae26[_0x6e27('0x30')]=_[_0x6e27('0x31')](_0x4c2015,_0x6e27('0x29'));_0x3bae26[_0x6e27('0x32')]=_[_0x6e27('0x33')](_0x139a45[_0x6e27('0x32')]);_0x3bae26[_0x6e27('0x34')]=_[_0x6e27('0x35')](_0x3bae26[_0x6e27('0x30')],_0x3bae26[_0x6e27('0x32')]);_0x1a1cb2[_0x6e27('0x36')]=_[_0x6e27('0x35')](_0x3bae26[_0x6e27('0x30')],qs[_0x6e27('0x37')](_0x139a45[_0x6e27('0x32')][_0x6e27('0x37')]));_0x1a1cb2[_0x6e27('0x36')]=_0x1a1cb2['attributes']['length']?_0x1a1cb2['attributes']:_0x3bae26[_0x6e27('0x30')];if(!_0x139a45[_0x6e27('0x32')][_0x6e27('0x38')](_0x6e27('0x39'))){_0x1a1cb2[_0x6e27('0x1e')]=qs[_0x6e27('0x1e')](_0x139a45[_0x6e27('0x32')]['limit']);_0x1a1cb2[_0x6e27('0x1b')]=qs[_0x6e27('0x1b')](_0x139a45['query'][_0x6e27('0x1b')]);}_0x1a1cb2[_0x6e27('0x3a')]=qs[_0x6e27('0x3b')](_0x139a45[_0x6e27('0x32')][_0x6e27('0x3b')]);_0x1a1cb2['where']=qs[_0x6e27('0x34')](_[_0x6e27('0x3c')](_0x139a45[_0x6e27('0x32')],_0x3bae26['filters']),_0x4c2015);if(_0x139a45[_0x6e27('0x32')][_0x6e27('0x3d')]){_0x1a1cb2[_0x6e27('0x3e')]=_[_0x6e27('0x3f')](_0x1a1cb2[_0x6e27('0x3e')],{'$or':_['map'](_0x4c2015,function(_0x2f6819){if(_0x2f6819['type']!==_0x6e27('0x40')){var _0x4ec5d6={};_0x4ec5d6[_0x2f6819[_0x6e27('0x29')]]={'$like':'%'+_0x139a45[_0x6e27('0x32')][_0x6e27('0x3d')]+'%'};return _0x4ec5d6;}})});}_0x1a1cb2=_['merge']({},_0x1a1cb2,_0x139a45['options']);var _0x1274bd={'where':_0x1a1cb2[_0x6e27('0x3e')]};return db[_0x6e27('0x2c')][_0x6e27('0x1d')](_0x1274bd)['then'](function(_0x1ecd7c){_0x170bfd[_0x6e27('0x1d')]=_0x1ecd7c;if(_0x139a45[_0x6e27('0x32')][_0x6e27('0x41')]){_0x1a1cb2['include']=[{'all':!![]}];}return db[_0x6e27('0x2c')][_0x6e27('0x42')](_0x1a1cb2);})[_0x6e27('0x25')](function(_0x20c4e4){_0x170bfd['rows']=_0x20c4e4;return _0x170bfd;})[_0x6e27('0x25')](respondWithFilteredResult(_0x4c073f,_0x1a1cb2))[_0x6e27('0x43')](handleError(_0x4c073f,null));};exports[_0x6e27('0x44')]=function(_0x2ba62d,_0x2fd4c8){var _0x5afb29={'raw':!![],'where':{'id':_0x2ba62d[_0x6e27('0x45')]['id']}},_0x28efd7={};_0x28efd7[_0x6e27('0x30')]=_['keys'](db[_0x6e27('0x2c')][_0x6e27('0x2d')]);_0x28efd7[_0x6e27('0x32')]=_[_0x6e27('0x33')](_0x2ba62d[_0x6e27('0x32')]);_0x28efd7[_0x6e27('0x34')]=_[_0x6e27('0x35')](_0x28efd7[_0x6e27('0x30')],_0x28efd7[_0x6e27('0x32')]);_0x5afb29[_0x6e27('0x36')]=_[_0x6e27('0x35')](_0x28efd7[_0x6e27('0x30')],qs[_0x6e27('0x37')](_0x2ba62d[_0x6e27('0x32')][_0x6e27('0x37')]));_0x5afb29[_0x6e27('0x36')]=_0x5afb29[_0x6e27('0x36')]['length']?_0x5afb29[_0x6e27('0x36')]:_0x28efd7['model'];if(_0x2ba62d[_0x6e27('0x32')]['includeAll']){_0x5afb29[_0x6e27('0x46')]=[{'all':!![]}];}_0x5afb29=_['merge']({},_0x5afb29,_0x2ba62d[_0x6e27('0x47')]);return db[_0x6e27('0x2c')][_0x6e27('0x48')](_0x5afb29)['then'](handleEntityNotFound(_0x2fd4c8,null))[_0x6e27('0x25')](respondWithResult(_0x2fd4c8,null))[_0x6e27('0x43')](handleError(_0x2fd4c8,null));};exports[_0x6e27('0x49')]=function(_0x289aa2,_0xe8f690){return db[_0x6e27('0x2c')][_0x6e27('0x49')](_0x289aa2['body'],{})[_0x6e27('0x25')](respondWithResult(_0xe8f690,0xc9))['catch'](handleError(_0xe8f690,null));};exports[_0x6e27('0x24')]=function(_0x5461ed,_0x3db56b){if(_0x5461ed[_0x6e27('0x4a')]['id']){delete _0x5461ed[_0x6e27('0x4a')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x5461ed['params']['id']}})[_0x6e27('0x25')](handleEntityNotFound(_0x3db56b,null))['then'](saveUpdates(_0x5461ed[_0x6e27('0x4a')],null))[_0x6e27('0x25')](respondWithResult(_0x3db56b,null))[_0x6e27('0x43')](handleError(_0x3db56b,null));};exports[_0x6e27('0x4b')]=function(_0x36a28a,_0x48f889){return db[_0x6e27('0x2c')]['find']({'where':{'id':_0x36a28a[_0x6e27('0x45')]['id']}})[_0x6e27('0x25')](handleEntityNotFound(_0x48f889,null))[_0x6e27('0x25')](removeEntity(_0x48f889,null))[_0x6e27('0x43')](handleError(_0x48f889,null));};exports[_0x6e27('0x4c')]=function(_0x50514c,_0x5c326a){return db[_0x6e27('0x2c')][_0x6e27('0x4c')]()[_0x6e27('0x25')](respondWithResult(_0x5c326a,null))['catch'](handleError(_0x5c326a,null));}; \ No newline at end of file +var _0x4d59=['offset','limit','set','Content-Range','json','apply','save','update','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','rows','catch','show','merge','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','count'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4d59,0x79));var _0x94d5=function(_0x3e5ab4,_0x4ff2a0){_0x3e5ab4=_0x3e5ab4-0x0;var _0x1a8cb3=_0x4d59[_0x3e5ab4];return _0x1a8cb3;};'use strict';var emlformat=require(_0x94d5('0x0'));var rimraf=require(_0x94d5('0x1'));var zipdir=require(_0x94d5('0x2'));var jsonpatch=require(_0x94d5('0x3'));var rp=require(_0x94d5('0x4'));var moment=require(_0x94d5('0x5'));var BPromise=require(_0x94d5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x94d5('0x7'));var csv=require(_0x94d5('0x8'));var ejs=require(_0x94d5('0x9'));var fs=require('fs');var fs_extra=require(_0x94d5('0xa'));var _=require('lodash');var squel=require(_0x94d5('0xb'));var crypto=require(_0x94d5('0xc'));var jsforce=require(_0x94d5('0xd'));var deskjs=require(_0x94d5('0xe'));var toCsv=require(_0x94d5('0x8'));var querystring=require(_0x94d5('0xf'));var Papa=require(_0x94d5('0x10'));var Redis=require(_0x94d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x94d5('0x12'));var as=require(_0x94d5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94d5('0x14'))(_0x94d5('0x15'));var utils=require(_0x94d5('0x16'));var config=require(_0x94d5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x94d5('0x18'))['db'];function respondWithStatusCode(_0x52b54c,_0x544bab){_0x544bab=_0x544bab||0xcc;return function(_0x3bde2f){if(_0x3bde2f){return _0x52b54c['sendStatus'](_0x544bab);}return _0x52b54c[_0x94d5('0x19')](_0x544bab)[_0x94d5('0x1a')]();};}function respondWithResult(_0xe75797,_0x4f934e){_0x4f934e=_0x4f934e||0xc8;return function(_0x346f76){if(_0x346f76){return _0xe75797[_0x94d5('0x19')](_0x4f934e)['json'](_0x346f76);}};}function respondWithFilteredResult(_0x20bae6,_0xbe529e){return function(_0x21a09a){if(_0x21a09a){var _0x563588=typeof _0xbe529e['offset']===_0x94d5('0x1b')&&typeof _0xbe529e['limit']===_0x94d5('0x1b');var _0x31a03a=_0x21a09a[_0x94d5('0x1c')];var _0x1d58b7=_0x563588?0x0:_0xbe529e[_0x94d5('0x1d')];var _0x5d49bc=_0x563588?_0x21a09a['count']:_0xbe529e[_0x94d5('0x1d')]+_0xbe529e[_0x94d5('0x1e')];var _0xd85e74;if(_0x5d49bc>=_0x31a03a){_0x5d49bc=_0x31a03a;_0xd85e74=0xc8;}else{_0xd85e74=0xce;}_0x20bae6['status'](_0xd85e74);return _0x20bae6[_0x94d5('0x1f')](_0x94d5('0x20'),_0x1d58b7+'-'+_0x5d49bc+'/'+_0x31a03a)[_0x94d5('0x21')](_0x21a09a);}return null;};}function patchUpdates(_0x34c5d0){return function(_0x25598e){try{jsonpatch[_0x94d5('0x22')](_0x25598e,_0x34c5d0,!![]);}catch(_0x4a066c){return BPromise['reject'](_0x4a066c);}return _0x25598e[_0x94d5('0x23')]();};}function saveUpdates(_0x59ded6,_0x16590f){return function(_0x477258){if(_0x477258){return _0x477258[_0x94d5('0x24')](_0x59ded6)['then'](function(_0x7ba469){return _0x7ba469;});}return null;};}function removeEntity(_0x5d46a2,_0x2cf9ab){return function(_0x55df49){if(_0x55df49){return _0x55df49['destroy']()[_0x94d5('0x25')](function(){_0x5d46a2['status'](0xcc)[_0x94d5('0x1a')]();});}};}function handleEntityNotFound(_0x22726d,_0x1521cc){return function(_0x13c218){if(!_0x13c218){_0x22726d['sendStatus'](0x194);}return _0x13c218;};}function handleError(_0x4d8c74,_0x2a0809){_0x2a0809=_0x2a0809||0x1f4;return function(_0x556ffc){logger['error'](_0x556ffc[_0x94d5('0x26')]);if(_0x556ffc[_0x94d5('0x27')]){delete _0x556ffc[_0x94d5('0x27')];}_0x4d8c74[_0x94d5('0x19')](_0x2a0809)[_0x94d5('0x28')](_0x556ffc);};}exports[_0x94d5('0x29')]=function(_0x4f3007,_0xfb86e3){var _0x10a857={},_0x1de2ea={},_0x35cb77={'count':0x0,'rows':[]};var _0x2e1e8d=_[_0x94d5('0x2a')](db[_0x94d5('0x2b')][_0x94d5('0x2c')],function(_0x2372a1){return{'name':_0x2372a1[_0x94d5('0x2d')],'type':_0x2372a1[_0x94d5('0x2e')][_0x94d5('0x2f')]};});_0x1de2ea[_0x94d5('0x30')]=_[_0x94d5('0x2a')](_0x2e1e8d,_0x94d5('0x27'));_0x1de2ea[_0x94d5('0x31')]=_[_0x94d5('0x32')](_0x4f3007['query']);_0x1de2ea[_0x94d5('0x33')]=_[_0x94d5('0x34')](_0x1de2ea[_0x94d5('0x30')],_0x1de2ea[_0x94d5('0x31')]);_0x10a857[_0x94d5('0x35')]=_[_0x94d5('0x34')](_0x1de2ea[_0x94d5('0x30')],qs['fields'](_0x4f3007[_0x94d5('0x31')][_0x94d5('0x36')]));_0x10a857[_0x94d5('0x35')]=_0x10a857[_0x94d5('0x35')][_0x94d5('0x37')]?_0x10a857[_0x94d5('0x35')]:_0x1de2ea[_0x94d5('0x30')];if(!_0x4f3007[_0x94d5('0x31')][_0x94d5('0x38')](_0x94d5('0x39'))){_0x10a857[_0x94d5('0x1e')]=qs[_0x94d5('0x1e')](_0x4f3007[_0x94d5('0x31')][_0x94d5('0x1e')]);_0x10a857[_0x94d5('0x1d')]=qs['offset'](_0x4f3007[_0x94d5('0x31')][_0x94d5('0x1d')]);}_0x10a857[_0x94d5('0x3a')]=qs[_0x94d5('0x3b')](_0x4f3007[_0x94d5('0x31')][_0x94d5('0x3b')]);_0x10a857['where']=qs['filters'](_['pick'](_0x4f3007[_0x94d5('0x31')],_0x1de2ea[_0x94d5('0x33')]),_0x2e1e8d);if(_0x4f3007[_0x94d5('0x31')]['filter']){_0x10a857[_0x94d5('0x3c')]=_['merge'](_0x10a857[_0x94d5('0x3c')],{'$or':_['map'](_0x2e1e8d,function(_0x28a066){if(_0x28a066[_0x94d5('0x2e')]!=='VIRTUAL'){var _0x279d45={};_0x279d45[_0x28a066['name']]={'$like':'%'+_0x4f3007[_0x94d5('0x31')][_0x94d5('0x3d')]+'%'};return _0x279d45;}})});}_0x10a857=_['merge']({},_0x10a857,_0x4f3007[_0x94d5('0x3e')]);var _0x17ae14={'where':_0x10a857[_0x94d5('0x3c')]};return db[_0x94d5('0x2b')]['count'](_0x17ae14)[_0x94d5('0x25')](function(_0x1b82f5){_0x35cb77[_0x94d5('0x1c')]=_0x1b82f5;if(_0x4f3007[_0x94d5('0x31')][_0x94d5('0x3f')]){_0x10a857[_0x94d5('0x40')]=[{'all':!![]}];}return db[_0x94d5('0x2b')]['findAll'](_0x10a857);})['then'](function(_0x42f841){_0x35cb77[_0x94d5('0x41')]=_0x42f841;return _0x35cb77;})[_0x94d5('0x25')](respondWithFilteredResult(_0xfb86e3,_0x10a857))[_0x94d5('0x42')](handleError(_0xfb86e3,null));};exports[_0x94d5('0x43')]=function(_0x5c3f01,_0x3c3b45){var _0x9caa72={'raw':!![],'where':{'id':_0x5c3f01['params']['id']}},_0x10655c={};_0x10655c[_0x94d5('0x30')]=_[_0x94d5('0x32')](db['SquareReport']['rawAttributes']);_0x10655c[_0x94d5('0x31')]=_[_0x94d5('0x32')](_0x5c3f01['query']);_0x10655c['filters']=_[_0x94d5('0x34')](_0x10655c[_0x94d5('0x30')],_0x10655c[_0x94d5('0x31')]);_0x9caa72[_0x94d5('0x35')]=_[_0x94d5('0x34')](_0x10655c[_0x94d5('0x30')],qs[_0x94d5('0x36')](_0x5c3f01[_0x94d5('0x31')]['fields']));_0x9caa72[_0x94d5('0x35')]=_0x9caa72[_0x94d5('0x35')][_0x94d5('0x37')]?_0x9caa72[_0x94d5('0x35')]:_0x10655c[_0x94d5('0x30')];if(_0x5c3f01['query'][_0x94d5('0x3f')]){_0x9caa72[_0x94d5('0x40')]=[{'all':!![]}];}_0x9caa72=_[_0x94d5('0x44')]({},_0x9caa72,_0x5c3f01[_0x94d5('0x3e')]);return db['SquareReport'][_0x94d5('0x45')](_0x9caa72)[_0x94d5('0x25')](handleEntityNotFound(_0x3c3b45,null))['then'](respondWithResult(_0x3c3b45,null))['catch'](handleError(_0x3c3b45,null));};exports[_0x94d5('0x46')]=function(_0x3d84fe,_0x40f033){return db['SquareReport'][_0x94d5('0x46')](_0x3d84fe[_0x94d5('0x47')],{})[_0x94d5('0x25')](respondWithResult(_0x40f033,0xc9))[_0x94d5('0x42')](handleError(_0x40f033,null));};exports[_0x94d5('0x24')]=function(_0x13b9df,_0x5a042a){if(_0x13b9df['body']['id']){delete _0x13b9df[_0x94d5('0x47')]['id'];}return db[_0x94d5('0x2b')]['find']({'where':{'id':_0x13b9df[_0x94d5('0x48')]['id']}})[_0x94d5('0x25')](handleEntityNotFound(_0x5a042a,null))['then'](saveUpdates(_0x13b9df[_0x94d5('0x47')],null))[_0x94d5('0x25')](respondWithResult(_0x5a042a,null))[_0x94d5('0x42')](handleError(_0x5a042a,null));};exports[_0x94d5('0x49')]=function(_0x3f0a5c,_0x58b219){return db[_0x94d5('0x2b')][_0x94d5('0x45')]({'where':{'id':_0x3f0a5c[_0x94d5('0x48')]['id']}})[_0x94d5('0x25')](handleEntityNotFound(_0x58b219,null))[_0x94d5('0x25')](removeEntity(_0x58b219,null))['catch'](handleError(_0x58b219,null));};exports[_0x94d5('0x4a')]=function(_0x558c51,_0x14c9b0){return db[_0x94d5('0x2b')]['describe']()[_0x94d5('0x25')](respondWithResult(_0x14c9b0,null))[_0x94d5('0x42')](handleError(_0x14c9b0,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 192ef7d..687cd13 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 _0x1754=['api','moment','bluebird','request-promise','rimraf','./squareReport.attributes','exports','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x420ede,_0x306edc){var _0x35dfee=function(_0x3caf64){while(--_0x3caf64){_0x420ede['push'](_0x420ede['shift']());}};_0x35dfee(++_0x306edc);}(_0x1754,0x1bf));var _0x4175=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0x1754[_0x3f88bc];return _0x4df1c4;};'use strict';var _=require(_0x4175('0x0'));var util=require(_0x4175('0x1'));var logger=require(_0x4175('0x2'))(_0x4175('0x3'));var moment=require(_0x4175('0x4'));var BPromise=require(_0x4175('0x5'));var rp=require(_0x4175('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4175('0x7'));var config=require('../../config/environment');var attributes=require(_0x4175('0x8'));module[_0x4175('0x9')]=function(_0x8380e6,_0x2b8662){return _0x8380e6['define']('SquareReport',attributes,{'tableName':_0x4175('0xa'),'paranoid':![],'indexes':[{'name':_0x4175('0xb'),'fields':[_0x4175('0xc'),_0x4175('0xd')]},{'name':_0x4175('0xe'),'fields':[_0x4175('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6eb2=['request-promise','path','rimraf','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird'];(function(_0x52ee88,_0x55e402){var _0x5a0cdf=function(_0x2c74b1){while(--_0x2c74b1){_0x52ee88['push'](_0x52ee88['shift']());}};_0x5a0cdf(++_0x55e402);}(_0x6eb2,0x8b));var _0x26eb=function(_0x15be0f,_0x58e1ef){_0x15be0f=_0x15be0f-0x0;var _0x550beb=_0x6eb2[_0x15be0f];return _0x550beb;};'use strict';var _=require(_0x26eb('0x0'));var util=require('util');var logger=require(_0x26eb('0x1'))(_0x26eb('0x2'));var moment=require(_0x26eb('0x3'));var BPromise=require(_0x26eb('0x4'));var rp=require(_0x26eb('0x5'));var fs=require('fs');var path=require(_0x26eb('0x6'));var rimraf=require(_0x26eb('0x7'));var config=require('../../config/environment');var attributes=require(_0x26eb('0x8'));module[_0x26eb('0x9')]=function(_0x360240,_0x363cb6){return _0x360240['define'](_0x26eb('0xa'),attributes,{'tableName':_0x26eb('0xb'),'paranoid':![],'indexes':[{'name':_0x26eb('0xc'),'fields':[_0x26eb('0xd'),_0x26eb('0xe')]},{'name':_0x26eb('0xf'),'fields':[_0x26eb('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 09cb6c8..50501fc 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 _0x37e5=['message','SquareReport,\x20%s,\x20%s','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','where','attributes','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x15fa1f,_0x298fdf){var _0x1a0278=function(_0x440185){while(--_0x440185){_0x15fa1f['push'](_0x15fa1f['shift']());}};_0x1a0278(++_0x298fdf);}(_0x37e5,0x14e));var _0x537e=function(_0x259a42,_0x2b4483){_0x259a42=_0x259a42-0x0;var _0x548d68=_0x37e5[_0x259a42];return _0x548d68;};'use strict';var _=require(_0x537e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x537e('0x1'));var fs=require('fs');var Redis=require(_0x537e('0x2'));var db=require(_0x537e('0x3'))['db'];var utils=require(_0x537e('0x4'));var logger=require(_0x537e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x537e('0x6'));var client=jayson[_0x537e('0x7')][_0x537e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54afa5,_0x29aa43,_0x51c353){return new BPromise(function(_0x977192,_0x566b7d){return client[_0x537e('0x9')](_0x54afa5,_0x51c353)[_0x537e('0xa')](function(_0x14b722){logger[_0x537e('0xb')]('SquareReport,\x20%s,\x20%s',_0x29aa43,_0x537e('0xc'));logger[_0x537e('0xd')](_0x537e('0xe'),_0x29aa43,_0x537e('0xc'),JSON[_0x537e('0xf')](_0x14b722));if(_0x14b722['error']){if(_0x14b722[_0x537e('0x10')][_0x537e('0x11')]===0x1f4){logger[_0x537e('0x10')]('SquareReport,\x20%s,\x20%s',_0x29aa43,_0x14b722[_0x537e('0x10')][_0x537e('0x12')]);return _0x566b7d(_0x14b722['error'][_0x537e('0x12')]);}logger[_0x537e('0x10')]('SquareReport,\x20%s,\x20%s',_0x29aa43,_0x14b722['error'][_0x537e('0x12')]);return _0x977192(_0x14b722[_0x537e('0x10')][_0x537e('0x12')]);}else{logger[_0x537e('0xb')](_0x537e('0x13'),_0x29aa43,'request\x20sent');_0x977192(_0x14b722[_0x537e('0x14')][_0x537e('0x12')]);}})[_0x537e('0x15')](function(_0x191230){logger['error'](_0x537e('0x13'),_0x29aa43,_0x191230);_0x566b7d(_0x191230);});});}exports[_0x537e('0x16')]=function(_0x2f8af9){var _0x54b73f=this;return new Promise(function(_0x10a5a3,_0x5cb050){return db[_0x537e('0x17')][_0x537e('0x18')](_0x2f8af9[_0x537e('0x19')],{'raw':_0x2f8af9[_0x537e('0x1a')]?_0x2f8af9[_0x537e('0x1a')][_0x537e('0x1b')]===undefined?!![]:![]:!![]})[_0x537e('0xa')](function(_0x47f111){logger['info']('CreateSquareReport',_0x2f8af9);logger[_0x537e('0xd')]('CreateSquareReport',_0x2f8af9,JSON[_0x537e('0xf')](_0x47f111));_0x10a5a3(_0x47f111);})[_0x537e('0x15')](function(_0x32252f){logger[_0x537e('0x10')](_0x537e('0x16'),_0x32252f[_0x537e('0x12')],_0x2f8af9);_0x5cb050(_0x54b73f[_0x537e('0x10')](0x1f4,_0x32252f[_0x537e('0x12')]));});});};exports[_0x537e('0x1c')]=function(_0x4efe47){var _0x279f29=this;return new Promise(function(_0x380a02,_0xb55874){return db[_0x537e('0x17')]['update'](_0x4efe47[_0x537e('0x19')],{'raw':_0x4efe47[_0x537e('0x1a')]?_0x4efe47['options'][_0x537e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4efe47[_0x537e('0x1a')]?_0x4efe47[_0x537e('0x1a')][_0x537e('0x1d')]||null:null,'attributes':_0x4efe47[_0x537e('0x1a')]?_0x4efe47[_0x537e('0x1a')][_0x537e('0x1e')]||null:null,'limit':_0x4efe47[_0x537e('0x1a')]?_0x4efe47[_0x537e('0x1a')][_0x537e('0x1f')]||null:null})[_0x537e('0xa')](function(_0x579074){logger[_0x537e('0xb')]('UpdateSquareReport',_0x4efe47);logger['debug'](_0x537e('0x1c'),_0x4efe47,JSON[_0x537e('0xf')](_0x579074));_0x380a02(_0x579074);})[_0x537e('0x15')](function(_0x2aaa25){logger['error'](_0x537e('0x1c'),_0x2aaa25[_0x537e('0x12')],_0x4efe47);_0xb55874(_0x279f29[_0x537e('0x10')](0x1f4,_0x2aaa25[_0x537e('0x12')]));});});}; \ No newline at end of file +var _0x55db=['result','catch','CreateSquareReport','create','body','options','raw','then','UpdateSquareReport','SquareReport','update','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3097b3,_0x36fab5){var _0x178349=function(_0x2470f1){while(--_0x2470f1){_0x3097b3['push'](_0x3097b3['shift']());}};_0x178349(++_0x36fab5);}(_0x55db,0x6c));var _0xb55d=function(_0x1ba144,_0x157555){_0x1ba144=_0x1ba144-0x0;var _0xc3b592=_0x55db[_0x1ba144];return _0xc3b592;};'use strict';var _=require(_0xb55d('0x0'));var util=require('util');var moment=require(_0xb55d('0x1'));var BPromise=require(_0xb55d('0x2'));var rs=require(_0xb55d('0x3'));var fs=require('fs');var Redis=require(_0xb55d('0x4'));var db=require(_0xb55d('0x5'))['db'];var utils=require(_0xb55d('0x6'));var logger=require(_0xb55d('0x7'))('rpc');var config=require(_0xb55d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb55d('0x9')][_0xb55d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cc268,_0x4b464c,_0x5c8b41){return new BPromise(function(_0x3c03c1,_0x27a57c){return client[_0xb55d('0xb')](_0x5cc268,_0x5c8b41)['then'](function(_0x5928d4){logger['info'](_0xb55d('0xc'),_0x4b464c,_0xb55d('0xd'));logger[_0xb55d('0xe')](_0xb55d('0xf'),_0x4b464c,_0xb55d('0xd'),JSON[_0xb55d('0x10')](_0x5928d4));if(_0x5928d4[_0xb55d('0x11')]){if(_0x5928d4[_0xb55d('0x11')][_0xb55d('0x12')]===0x1f4){logger['error'](_0xb55d('0xc'),_0x4b464c,_0x5928d4[_0xb55d('0x11')]['message']);return _0x27a57c(_0x5928d4[_0xb55d('0x11')]['message']);}logger[_0xb55d('0x11')](_0xb55d('0xc'),_0x4b464c,_0x5928d4[_0xb55d('0x11')]['message']);return _0x3c03c1(_0x5928d4[_0xb55d('0x11')][_0xb55d('0x13')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x4b464c,_0xb55d('0xd'));_0x3c03c1(_0x5928d4[_0xb55d('0x14')][_0xb55d('0x13')]);}})[_0xb55d('0x15')](function(_0x3027c5){logger[_0xb55d('0x11')](_0xb55d('0xc'),_0x4b464c,_0x3027c5);_0x27a57c(_0x3027c5);});});}exports[_0xb55d('0x16')]=function(_0x5c4f6f){var _0x1d5040=this;return new Promise(function(_0x5a5dd7,_0x140ad6){return db['SquareReport'][_0xb55d('0x17')](_0x5c4f6f[_0xb55d('0x18')],{'raw':_0x5c4f6f[_0xb55d('0x19')]?_0x5c4f6f['options'][_0xb55d('0x1a')]===undefined?!![]:![]:!![]})[_0xb55d('0x1b')](function(_0x21351d){logger['info'](_0xb55d('0x16'),_0x5c4f6f);logger[_0xb55d('0xe')](_0xb55d('0x16'),_0x5c4f6f,JSON['stringify'](_0x21351d));_0x5a5dd7(_0x21351d);})['catch'](function(_0x42e51b){logger[_0xb55d('0x11')](_0xb55d('0x16'),_0x42e51b['message'],_0x5c4f6f);_0x140ad6(_0x1d5040[_0xb55d('0x11')](0x1f4,_0x42e51b[_0xb55d('0x13')]));});});};exports[_0xb55d('0x1c')]=function(_0x4ac6f2){var _0x109f52=this;return new Promise(function(_0x25e3e0,_0x27b524){return db[_0xb55d('0x1d')][_0xb55d('0x1e')](_0x4ac6f2[_0xb55d('0x18')],{'raw':_0x4ac6f2[_0xb55d('0x19')]?_0x4ac6f2[_0xb55d('0x19')][_0xb55d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ac6f2['options']?_0x4ac6f2[_0xb55d('0x19')]['where']||null:null,'attributes':_0x4ac6f2['options']?_0x4ac6f2[_0xb55d('0x19')]['attributes']||null:null,'limit':_0x4ac6f2['options']?_0x4ac6f2[_0xb55d('0x19')]['limit']||null:null})[_0xb55d('0x1b')](function(_0x5372b0){logger[_0xb55d('0x1f')](_0xb55d('0x1c'),_0x4ac6f2);logger['debug'](_0xb55d('0x1c'),_0x4ac6f2,JSON[_0xb55d('0x10')](_0x5372b0));_0x25e3e0(_0x5372b0);})[_0xb55d('0x15')](function(_0x1b9768){logger[_0xb55d('0x11')](_0xb55d('0x1c'),_0x1b9768[_0xb55d('0x13')],_0x4ac6f2);_0x27b524(_0x109f52[_0xb55d('0x11')](0x1f4,_0x1b9768[_0xb55d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 69d375e..4b97a96 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 _0xc7e4=['../../config/environment','./squareReportDetail.controller','index','get','/describe','/:id','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xc7e4,0xab));var _0x4c7e=function(_0x4e9c37,_0x610089){_0x4e9c37=_0x4e9c37-0x0;var _0x2b8231=_0xc7e4[_0x4e9c37];return _0x2b8231;};'use strict';var multer=require(_0x4c7e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4c7e('0x1'));var express=require(_0x4c7e('0x2'));var router=express[_0x4c7e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4c7e('0x4'));var config=require(_0x4c7e('0x5'));var controller=require(_0x4c7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4c7e('0x7')]);router[_0x4c7e('0x8')](_0x4c7e('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4c7e('0xa'),auth[_0x4c7e('0xb')](),controller['show']);router['post']('/',auth[_0x4c7e('0xb')](),controller[_0x4c7e('0xc')]);router['put']('/:id',auth[_0x4c7e('0xb')](),controller[_0x4c7e('0xd')]);router[_0x4c7e('0xe')](_0x4c7e('0xa'),auth['isAuthenticated'](),controller[_0x4c7e('0xf')]);module['exports']=router; \ No newline at end of file +var _0xbb4c=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','destroy'];(function(_0x2a98a5,_0x1da57a){var _0x26fe13=function(_0x4b68d0){while(--_0x4b68d0){_0x2a98a5['push'](_0x2a98a5['shift']());}};_0x26fe13(++_0x1da57a);}(_0xbb4c,0x1ba));var _0xcbb4=function(_0x338f07,_0x5460df){_0x338f07=_0x338f07-0x0;var _0x362f66=_0xbb4c[_0x338f07];return _0x362f66;};'use strict';var multer=require('multer');var util=require(_0xcbb4('0x0'));var path=require('path');var timeout=require(_0xcbb4('0x1'));var express=require(_0xcbb4('0x2'));var router=express[_0xcbb4('0x3')]();var fs_extra=require(_0xcbb4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcbb4('0x5'));var config=require(_0xcbb4('0x6'));var controller=require(_0xcbb4('0x7'));router[_0xcbb4('0x8')]('/',auth[_0xcbb4('0x9')](),controller[_0xcbb4('0xa')]);router[_0xcbb4('0x8')](_0xcbb4('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xcbb4('0x8')](_0xcbb4('0xc'),auth[_0xcbb4('0x9')](),controller[_0xcbb4('0xd')]);router[_0xcbb4('0xe')]('/',auth[_0xcbb4('0x9')](),controller[_0xcbb4('0xf')]);router['put']('/:id',auth[_0xcbb4('0x9')](),controller['update']);router['delete'](_0xcbb4('0xc'),auth[_0xcbb4('0x9')](),controller[_0xcbb4('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 581bc81..f3d926e 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 _0x9444=['TEXT','sequelize','exports','STRING'];(function(_0x24f107,_0x3c6c88){var _0x5116ab=function(_0x2b4985){while(--_0x2b4985){_0x24f107['push'](_0x24f107['shift']());}};_0x5116ab(++_0x3c6c88);}(_0x9444,0x1a5));var _0x4944=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x9444[_0x2bddf9];return _0x3f3ae9;};'use strict';var Sequelize=require(_0x4944('0x0'));module[_0x4944('0x1')]={'uniqueid':{'type':Sequelize[_0x4944('0x2')]},'node':{'type':Sequelize[_0x4944('0x2')]},'application':{'type':Sequelize[_0x4944('0x2')]},'data':{'type':Sequelize[_0x4944('0x3')]},'project_name':{'type':Sequelize[_0x4944('0x2')]},'callerid':{'type':Sequelize[_0x4944('0x2')]}}; \ No newline at end of file +var _0x1533=['sequelize','exports','STRING'];(function(_0x592cf1,_0x4113fb){var _0x3a7a18=function(_0x186e7a){while(--_0x186e7a){_0x592cf1['push'](_0x592cf1['shift']());}};_0x3a7a18(++_0x4113fb);}(_0x1533,0x78));var _0x3153=function(_0x4fe93e,_0x44f9e2){_0x4fe93e=_0x4fe93e-0x0;var _0x5f1d5a=_0x1533[_0x4fe93e];return _0x5f1d5a;};'use strict';var Sequelize=require(_0x3153('0x0'));module[_0x3153('0x1')]={'uniqueid':{'type':Sequelize[_0x3153('0x2')]},'node':{'type':Sequelize[_0x3153('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x3153('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index cfcf279..c7a0bf5 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 _0xad6b=['limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','sort','filter','where','VIRTUAL','merge','options','count','show','params','keys','includeAll','include','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xad6b,0x1cf));var _0xbad6=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xad6b[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0xbad6('0x0'));var rimraf=require(_0xbad6('0x1'));var zipdir=require(_0xbad6('0x2'));var jsonpatch=require(_0xbad6('0x3'));var rp=require('request-promise');var moment=require(_0xbad6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbad6('0x5'));var sox=require(_0xbad6('0x6'));var csv=require(_0xbad6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbad6('0x8'));var _=require(_0xbad6('0x9'));var squel=require(_0xbad6('0xa'));var crypto=require('crypto');var jsforce=require(_0xbad6('0xb'));var deskjs=require(_0xbad6('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbad6('0xd'));var Redis=require('ioredis');var authService=require(_0xbad6('0xe'));var qs=require(_0xbad6('0xf'));var as=require(_0xbad6('0x10'));var hardwareService=require(_0xbad6('0x11'));var logger=require(_0xbad6('0x12'))('api');var utils=require(_0xbad6('0x13'));var config=require(_0xbad6('0x14'));var licenseUtil=require(_0xbad6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a9c07,_0x3e42a3){_0x3e42a3=_0x3e42a3||0xcc;return function(_0x277901){if(_0x277901){return _0x3a9c07[_0xbad6('0x16')](_0x3e42a3);}return _0x3a9c07[_0xbad6('0x17')](_0x3e42a3)[_0xbad6('0x18')]();};}function respondWithResult(_0x141934,_0x4905de){_0x4905de=_0x4905de||0xc8;return function(_0x5a13b0){if(_0x5a13b0){return _0x141934[_0xbad6('0x17')](_0x4905de)[_0xbad6('0x19')](_0x5a13b0);}};}function respondWithFilteredResult(_0x51a259,_0x24ce3f){return function(_0x5956ae){if(_0x5956ae){var _0x297fbe=typeof _0x24ce3f['offset']===_0xbad6('0x1a')&&typeof _0x24ce3f[_0xbad6('0x1b')]===_0xbad6('0x1a');var _0x4b4f01=_0x5956ae['count'];var _0x274053=_0x297fbe?0x0:_0x24ce3f[_0xbad6('0x1c')];var _0x1815a6=_0x297fbe?_0x5956ae['count']:_0x24ce3f['offset']+_0x24ce3f[_0xbad6('0x1b')];var _0x3063aa;if(_0x1815a6>=_0x4b4f01){_0x1815a6=_0x4b4f01;_0x3063aa=0xc8;}else{_0x3063aa=0xce;}_0x51a259['status'](_0x3063aa);return _0x51a259[_0xbad6('0x1d')](_0xbad6('0x1e'),_0x274053+'-'+_0x1815a6+'/'+_0x4b4f01)['json'](_0x5956ae);}return null;};}function patchUpdates(_0x4d9151){return function(_0x737d8e){try{jsonpatch[_0xbad6('0x1f')](_0x737d8e,_0x4d9151,!![]);}catch(_0x11bdc7){return BPromise[_0xbad6('0x20')](_0x11bdc7);}return _0x737d8e[_0xbad6('0x21')]();};}function saveUpdates(_0x1f367b,_0x41d90a){return function(_0x3cd5af){if(_0x3cd5af){return _0x3cd5af[_0xbad6('0x22')](_0x1f367b)[_0xbad6('0x23')](function(_0x338ac2){return _0x338ac2;});}return null;};}function removeEntity(_0x1a0702,_0x5a086a){return function(_0x2eb593){if(_0x2eb593){return _0x2eb593[_0xbad6('0x24')]()['then'](function(){_0x1a0702[_0xbad6('0x17')](0xcc)[_0xbad6('0x18')]();});}};}function handleEntityNotFound(_0x1af294,_0x16af6c){return function(_0x1a75cd){if(!_0x1a75cd){_0x1af294[_0xbad6('0x16')](0x194);}return _0x1a75cd;};}function handleError(_0x45e964,_0x544c3e){_0x544c3e=_0x544c3e||0x1f4;return function(_0x332993){logger[_0xbad6('0x25')](_0x332993[_0xbad6('0x26')]);if(_0x332993['name']){delete _0x332993[_0xbad6('0x27')];}_0x45e964[_0xbad6('0x17')](_0x544c3e)['send'](_0x332993);};}exports[_0xbad6('0x28')]=function(_0x1c23a2,_0x416cff){var _0x402328={},_0x55cbe3={},_0x3aea27={'count':0x0,'rows':[]};var _0x553660=_[_0xbad6('0x29')](db[_0xbad6('0x2a')][_0xbad6('0x2b')],function(_0x348972){return{'name':_0x348972['fieldName'],'type':_0x348972[_0xbad6('0x2c')][_0xbad6('0x2d')]};});_0x55cbe3[_0xbad6('0x2e')]=_[_0xbad6('0x29')](_0x553660,_0xbad6('0x27'));_0x55cbe3[_0xbad6('0x2f')]=_['keys'](_0x1c23a2[_0xbad6('0x2f')]);_0x55cbe3[_0xbad6('0x30')]=_[_0xbad6('0x31')](_0x55cbe3[_0xbad6('0x2e')],_0x55cbe3[_0xbad6('0x2f')]);_0x402328[_0xbad6('0x32')]=_['intersection'](_0x55cbe3[_0xbad6('0x2e')],qs[_0xbad6('0x33')](_0x1c23a2[_0xbad6('0x2f')][_0xbad6('0x33')]));_0x402328[_0xbad6('0x32')]=_0x402328[_0xbad6('0x32')][_0xbad6('0x34')]?_0x402328[_0xbad6('0x32')]:_0x55cbe3[_0xbad6('0x2e')];if(!_0x1c23a2['query']['hasOwnProperty']('nolimit')){_0x402328[_0xbad6('0x1b')]=qs[_0xbad6('0x1b')](_0x1c23a2['query'][_0xbad6('0x1b')]);_0x402328[_0xbad6('0x1c')]=qs[_0xbad6('0x1c')](_0x1c23a2[_0xbad6('0x2f')]['offset']);}_0x402328['order']=qs[_0xbad6('0x35')](_0x1c23a2[_0xbad6('0x2f')][_0xbad6('0x35')]);_0x402328['where']=qs[_0xbad6('0x30')](_['pick'](_0x1c23a2[_0xbad6('0x2f')],_0x55cbe3[_0xbad6('0x30')]),_0x553660);if(_0x1c23a2[_0xbad6('0x2f')][_0xbad6('0x36')]){_0x402328[_0xbad6('0x37')]=_['merge'](_0x402328[_0xbad6('0x37')],{'$or':_[_0xbad6('0x29')](_0x553660,function(_0x19c072){if(_0x19c072[_0xbad6('0x2c')]!==_0xbad6('0x38')){var _0x3e4379={};_0x3e4379[_0x19c072['name']]={'$like':'%'+_0x1c23a2[_0xbad6('0x2f')][_0xbad6('0x36')]+'%'};return _0x3e4379;}})});}_0x402328=_[_0xbad6('0x39')]({},_0x402328,_0x1c23a2[_0xbad6('0x3a')]);var _0x26ad56={'where':_0x402328[_0xbad6('0x37')]};return db['SquareDetailsReport']['count'](_0x26ad56)[_0xbad6('0x23')](function(_0xdddaf4){_0x3aea27[_0xbad6('0x3b')]=_0xdddaf4;if(_0x1c23a2[_0xbad6('0x2f')]['includeAll']){_0x402328['include']=[{'all':!![]}];}return db[_0xbad6('0x2a')]['findAll'](_0x402328);})['then'](function(_0x383314){_0x3aea27['rows']=_0x383314;return _0x3aea27;})['then'](respondWithFilteredResult(_0x416cff,_0x402328))['catch'](handleError(_0x416cff,null));};exports[_0xbad6('0x3c')]=function(_0x1a29a6,_0x196973){var _0x11ec74={'raw':!![],'where':{'id':_0x1a29a6[_0xbad6('0x3d')]['id']}},_0x3f4aa5={};_0x3f4aa5[_0xbad6('0x2e')]=_[_0xbad6('0x3e')](db[_0xbad6('0x2a')][_0xbad6('0x2b')]);_0x3f4aa5[_0xbad6('0x2f')]=_['keys'](_0x1a29a6['query']);_0x3f4aa5[_0xbad6('0x30')]=_[_0xbad6('0x31')](_0x3f4aa5[_0xbad6('0x2e')],_0x3f4aa5[_0xbad6('0x2f')]);_0x11ec74['attributes']=_[_0xbad6('0x31')](_0x3f4aa5[_0xbad6('0x2e')],qs['fields'](_0x1a29a6[_0xbad6('0x2f')][_0xbad6('0x33')]));_0x11ec74['attributes']=_0x11ec74[_0xbad6('0x32')][_0xbad6('0x34')]?_0x11ec74[_0xbad6('0x32')]:_0x3f4aa5[_0xbad6('0x2e')];if(_0x1a29a6[_0xbad6('0x2f')][_0xbad6('0x3f')]){_0x11ec74[_0xbad6('0x40')]=[{'all':!![]}];}_0x11ec74=_[_0xbad6('0x39')]({},_0x11ec74,_0x1a29a6[_0xbad6('0x3a')]);return db[_0xbad6('0x2a')][_0xbad6('0x41')](_0x11ec74)[_0xbad6('0x23')](handleEntityNotFound(_0x196973,null))[_0xbad6('0x23')](respondWithResult(_0x196973,null))['catch'](handleError(_0x196973,null));};exports['create']=function(_0x49be16,_0x262fce){return db['SquareDetailsReport'][_0xbad6('0x42')](_0x49be16[_0xbad6('0x43')],{})['then'](respondWithResult(_0x262fce,0xc9))[_0xbad6('0x44')](handleError(_0x262fce,null));};exports[_0xbad6('0x22')]=function(_0x4f9aed,_0x13dfe0){if(_0x4f9aed[_0xbad6('0x43')]['id']){delete _0x4f9aed[_0xbad6('0x43')]['id'];}return db[_0xbad6('0x2a')][_0xbad6('0x41')]({'where':{'id':_0x4f9aed[_0xbad6('0x3d')]['id']}})[_0xbad6('0x23')](handleEntityNotFound(_0x13dfe0,null))['then'](saveUpdates(_0x4f9aed[_0xbad6('0x43')],null))['then'](respondWithResult(_0x13dfe0,null))[_0xbad6('0x44')](handleError(_0x13dfe0,null));};exports[_0xbad6('0x24')]=function(_0x53a418,_0x8555d9){return db[_0xbad6('0x2a')][_0xbad6('0x41')]({'where':{'id':_0x53a418[_0xbad6('0x3d')]['id']}})['then'](handleEntityNotFound(_0x8555d9,null))['then'](removeEntity(_0x8555d9,null))['catch'](handleError(_0x8555d9,null));};exports['describe']=function(_0x18e233,_0x1a3706){return db[_0xbad6('0x2a')][_0xbad6('0x45')]()[_0xbad6('0x23')](respondWithResult(_0x1a3706,null))[_0xbad6('0x44')](handleError(_0x1a3706,null));}; \ No newline at end of file +var _0x0f64=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x571852,_0x34ae1f){var _0x1ec365=function(_0x398fe5){while(--_0x398fe5){_0x571852['push'](_0x571852['shift']());}};_0x1ec365(++_0x34ae1f);}(_0x0f64,0xcb));var _0x40f6=function(_0x365c8e,_0x3bfb75){_0x365c8e=_0x365c8e-0x0;var _0xcbc28a=_0x0f64[_0x365c8e];return _0xcbc28a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x40f6('0x0'));var rp=require(_0x40f6('0x1'));var moment=require('moment');var BPromise=require(_0x40f6('0x2'));var Mustache=require(_0x40f6('0x3'));var util=require(_0x40f6('0x4'));var path=require(_0x40f6('0x5'));var sox=require(_0x40f6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x40f6('0x7'));var squel=require('squel');var crypto=require(_0x40f6('0x8'));var jsforce=require(_0x40f6('0x9'));var deskjs=require(_0x40f6('0xa'));var toCsv=require('to-csv');var querystring=require(_0x40f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x40f6('0xc'));var authService=require(_0x40f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x40f6('0xe'));var hardwareService=require(_0x40f6('0xf'));var logger=require(_0x40f6('0x10'))(_0x40f6('0x11'));var utils=require(_0x40f6('0x12'));var config=require(_0x40f6('0x13'));var licenseUtil=require(_0x40f6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461e95,_0x48d3d9){_0x48d3d9=_0x48d3d9||0xcc;return function(_0x1c68fd){if(_0x1c68fd){return _0x461e95['sendStatus'](_0x48d3d9);}return _0x461e95[_0x40f6('0x15')](_0x48d3d9)[_0x40f6('0x16')]();};}function respondWithResult(_0x527a25,_0x4d57fd){_0x4d57fd=_0x4d57fd||0xc8;return function(_0x168e92){if(_0x168e92){return _0x527a25['status'](_0x4d57fd)[_0x40f6('0x17')](_0x168e92);}};}function respondWithFilteredResult(_0x133133,_0x2d8821){return function(_0x32cc71){if(_0x32cc71){var _0x5f0edf=typeof _0x2d8821[_0x40f6('0x18')]===_0x40f6('0x19')&&typeof _0x2d8821[_0x40f6('0x1a')]==='undefined';var _0x29163f=_0x32cc71[_0x40f6('0x1b')];var _0x3debff=_0x5f0edf?0x0:_0x2d8821['offset'];var _0xdef673=_0x5f0edf?_0x32cc71[_0x40f6('0x1b')]:_0x2d8821['offset']+_0x2d8821[_0x40f6('0x1a')];var _0x241d93;if(_0xdef673>=_0x29163f){_0xdef673=_0x29163f;_0x241d93=0xc8;}else{_0x241d93=0xce;}_0x133133[_0x40f6('0x15')](_0x241d93);return _0x133133['set']('Content-Range',_0x3debff+'-'+_0xdef673+'/'+_0x29163f)[_0x40f6('0x17')](_0x32cc71);}return null;};}function patchUpdates(_0x131ac1){return function(_0x10fb08){try{jsonpatch['apply'](_0x10fb08,_0x131ac1,!![]);}catch(_0x210c5a){return BPromise[_0x40f6('0x1c')](_0x210c5a);}return _0x10fb08[_0x40f6('0x1d')]();};}function saveUpdates(_0xb0edb,_0xe6f3ff){return function(_0x3b2dfb){if(_0x3b2dfb){return _0x3b2dfb[_0x40f6('0x1e')](_0xb0edb)[_0x40f6('0x1f')](function(_0x45764d){return _0x45764d;});}return null;};}function removeEntity(_0x2a665e,_0x5f3402){return function(_0x3648f6){if(_0x3648f6){return _0x3648f6[_0x40f6('0x20')]()[_0x40f6('0x1f')](function(){_0x2a665e['status'](0xcc)[_0x40f6('0x16')]();});}};}function handleEntityNotFound(_0x2d5491,_0x504e52){return function(_0x36e0a0){if(!_0x36e0a0){_0x2d5491[_0x40f6('0x21')](0x194);}return _0x36e0a0;};}function handleError(_0x4a219d,_0x403f10){_0x403f10=_0x403f10||0x1f4;return function(_0x77b87f){logger[_0x40f6('0x22')](_0x77b87f[_0x40f6('0x23')]);if(_0x77b87f[_0x40f6('0x24')]){delete _0x77b87f['name'];}_0x4a219d[_0x40f6('0x15')](_0x403f10)[_0x40f6('0x25')](_0x77b87f);};}exports[_0x40f6('0x26')]=function(_0x142ce5,_0x1f0f4f){var _0x535e16={},_0x46be35={},_0x379361={'count':0x0,'rows':[]};var _0x20f685=_[_0x40f6('0x27')](db[_0x40f6('0x28')][_0x40f6('0x29')],function(_0x361873){return{'name':_0x361873['fieldName'],'type':_0x361873['type'][_0x40f6('0x2a')]};});_0x46be35[_0x40f6('0x2b')]=_[_0x40f6('0x27')](_0x20f685,_0x40f6('0x24'));_0x46be35['query']=_[_0x40f6('0x2c')](_0x142ce5[_0x40f6('0x2d')]);_0x46be35['filters']=_[_0x40f6('0x2e')](_0x46be35[_0x40f6('0x2b')],_0x46be35[_0x40f6('0x2d')]);_0x535e16[_0x40f6('0x2f')]=_[_0x40f6('0x2e')](_0x46be35[_0x40f6('0x2b')],qs[_0x40f6('0x30')](_0x142ce5['query']['fields']));_0x535e16[_0x40f6('0x2f')]=_0x535e16[_0x40f6('0x2f')][_0x40f6('0x31')]?_0x535e16[_0x40f6('0x2f')]:_0x46be35[_0x40f6('0x2b')];if(!_0x142ce5[_0x40f6('0x2d')][_0x40f6('0x32')]('nolimit')){_0x535e16['limit']=qs[_0x40f6('0x1a')](_0x142ce5['query'][_0x40f6('0x1a')]);_0x535e16['offset']=qs[_0x40f6('0x18')](_0x142ce5['query'][_0x40f6('0x18')]);}_0x535e16[_0x40f6('0x33')]=qs['sort'](_0x142ce5[_0x40f6('0x2d')][_0x40f6('0x34')]);_0x535e16[_0x40f6('0x35')]=qs[_0x40f6('0x36')](_[_0x40f6('0x37')](_0x142ce5[_0x40f6('0x2d')],_0x46be35['filters']),_0x20f685);if(_0x142ce5['query']['filter']){_0x535e16[_0x40f6('0x35')]=_['merge'](_0x535e16[_0x40f6('0x35')],{'$or':_[_0x40f6('0x27')](_0x20f685,function(_0x387364){if(_0x387364[_0x40f6('0x38')]!==_0x40f6('0x39')){var _0xeccff8={};_0xeccff8[_0x387364['name']]={'$like':'%'+_0x142ce5[_0x40f6('0x2d')][_0x40f6('0x3a')]+'%'};return _0xeccff8;}})});}_0x535e16=_[_0x40f6('0x3b')]({},_0x535e16,_0x142ce5[_0x40f6('0x3c')]);var _0x2556b8={'where':_0x535e16[_0x40f6('0x35')]};return db['SquareDetailsReport'][_0x40f6('0x1b')](_0x2556b8)[_0x40f6('0x1f')](function(_0xacd03f){_0x379361[_0x40f6('0x1b')]=_0xacd03f;if(_0x142ce5[_0x40f6('0x2d')][_0x40f6('0x3d')]){_0x535e16['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x40f6('0x3e')](_0x535e16);})['then'](function(_0x3adf45){_0x379361[_0x40f6('0x3f')]=_0x3adf45;return _0x379361;})[_0x40f6('0x1f')](respondWithFilteredResult(_0x1f0f4f,_0x535e16))[_0x40f6('0x40')](handleError(_0x1f0f4f,null));};exports[_0x40f6('0x41')]=function(_0x1eadb1,_0xa21caa){var _0x3b1c56={'raw':!![],'where':{'id':_0x1eadb1['params']['id']}},_0x421159={};_0x421159[_0x40f6('0x2b')]=_['keys'](db[_0x40f6('0x28')][_0x40f6('0x29')]);_0x421159['query']=_[_0x40f6('0x2c')](_0x1eadb1[_0x40f6('0x2d')]);_0x421159[_0x40f6('0x36')]=_['intersection'](_0x421159[_0x40f6('0x2b')],_0x421159[_0x40f6('0x2d')]);_0x3b1c56['attributes']=_[_0x40f6('0x2e')](_0x421159[_0x40f6('0x2b')],qs[_0x40f6('0x30')](_0x1eadb1[_0x40f6('0x2d')][_0x40f6('0x30')]));_0x3b1c56[_0x40f6('0x2f')]=_0x3b1c56[_0x40f6('0x2f')][_0x40f6('0x31')]?_0x3b1c56[_0x40f6('0x2f')]:_0x421159[_0x40f6('0x2b')];if(_0x1eadb1[_0x40f6('0x2d')][_0x40f6('0x3d')]){_0x3b1c56[_0x40f6('0x42')]=[{'all':!![]}];}_0x3b1c56=_[_0x40f6('0x3b')]({},_0x3b1c56,_0x1eadb1[_0x40f6('0x3c')]);return db['SquareDetailsReport'][_0x40f6('0x43')](_0x3b1c56)[_0x40f6('0x1f')](handleEntityNotFound(_0xa21caa,null))[_0x40f6('0x1f')](respondWithResult(_0xa21caa,null))['catch'](handleError(_0xa21caa,null));};exports[_0x40f6('0x44')]=function(_0x427c72,_0x7642f8){return db['SquareDetailsReport']['create'](_0x427c72[_0x40f6('0x45')],{})['then'](respondWithResult(_0x7642f8,0xc9))[_0x40f6('0x40')](handleError(_0x7642f8,null));};exports['update']=function(_0x6495af,_0x426b13){if(_0x6495af[_0x40f6('0x45')]['id']){delete _0x6495af[_0x40f6('0x45')]['id'];}return db['SquareDetailsReport'][_0x40f6('0x43')]({'where':{'id':_0x6495af[_0x40f6('0x46')]['id']}})[_0x40f6('0x1f')](handleEntityNotFound(_0x426b13,null))[_0x40f6('0x1f')](saveUpdates(_0x6495af[_0x40f6('0x45')],null))[_0x40f6('0x1f')](respondWithResult(_0x426b13,null))[_0x40f6('0x40')](handleError(_0x426b13,null));};exports[_0x40f6('0x20')]=function(_0x414a2c,_0x35ff50){return db[_0x40f6('0x28')][_0x40f6('0x43')]({'where':{'id':_0x414a2c[_0x40f6('0x46')]['id']}})[_0x40f6('0x1f')](handleEntityNotFound(_0x35ff50,null))[_0x40f6('0x1f')](removeEntity(_0x35ff50,null))[_0x40f6('0x40')](handleError(_0x35ff50,null));};exports[_0x40f6('0x47')]=function(_0x1a29c3,_0x5416f3){return db[_0x40f6('0x28')][_0x40f6('0x47')]()['then'](respondWithResult(_0x5416f3,null))[_0x40f6('0x40')](handleError(_0x5416f3,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 5d6bdf0..9efdf1a 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 _0x6a7a=['exports','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x5c1aea,_0x17331f){var _0x7a7af7=function(_0x188016){while(--_0x188016){_0x5c1aea['push'](_0x5c1aea['shift']());}};_0x7a7af7(++_0x17331f);}(_0x6a7a,0x162));var _0xa6a7=function(_0x86b9b,_0x3bee57){_0x86b9b=_0x86b9b-0x0;var _0x42a820=_0x6a7a[_0x86b9b];return _0x42a820;};'use strict';var _=require(_0xa6a7('0x0'));var util=require(_0xa6a7('0x1'));var logger=require(_0xa6a7('0x2'))(_0xa6a7('0x3'));var moment=require(_0xa6a7('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6a7('0x5'));var fs=require('fs');var path=require(_0xa6a7('0x6'));var rimraf=require(_0xa6a7('0x7'));var config=require(_0xa6a7('0x8'));var attributes=require(_0xa6a7('0x9'));module[_0xa6a7('0xa')]=function(_0x5dccd1,_0xd67787){return _0x5dccd1[_0xa6a7('0xb')](_0xa6a7('0xc'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc7e=['rimraf','./squareReportDetail.attributes','exports','define','lodash','util','bluebird','request-promise','path'];(function(_0x520c18,_0x30a7a2){var _0x2f2f6e=function(_0x42f10e){while(--_0x42f10e){_0x520c18['push'](_0x520c18['shift']());}};_0x2f2f6e(++_0x30a7a2);}(_0xfc7e,0x136));var _0xefc7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc7e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xefc7('0x0'));var util=require(_0xefc7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xefc7('0x2'));var rp=require(_0xefc7('0x3'));var fs=require('fs');var path=require(_0xefc7('0x4'));var rimraf=require(_0xefc7('0x5'));var config=require('../../config/environment');var attributes=require(_0xefc7('0x6'));module[_0xefc7('0x7')]=function(_0x1c3b3f,_0x39b4fd){return _0x1c3b3f[_0xefc7('0x8')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','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 54188b9..ef77785 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 _0xc7da=['code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2493f5,_0x4189ab){var _0x16f6d8=function(_0x575c83){while(--_0x575c83){_0x2493f5['push'](_0x2493f5['shift']());}};_0x16f6d8(++_0x4189ab);}(_0xc7da,0xf2));var _0xac7d=function(_0x259882,_0x3b2bfe){_0x259882=_0x259882-0x0;var _0x44b823=_0xc7da[_0x259882];return _0x44b823;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7d('0x3'));var fs=require('fs');var Redis=require(_0xac7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x5'));var logger=require(_0xac7d('0x6'))('rpc');var config=require(_0xac7d('0x7'));var jayson=require(_0xac7d('0x8'));var client=jayson[_0xac7d('0x9')][_0xac7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268265,_0x153ce5,_0x48ca59){return new BPromise(function(_0x44eb2b,_0x457e2d){return client[_0xac7d('0xb')](_0x268265,_0x48ca59)[_0xac7d('0xc')](function(_0x217811){logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');logger[_0xac7d('0xf')](_0xac7d('0x10'),_0x153ce5,_0xac7d('0x11'),JSON['stringify'](_0x217811));if(_0x217811[_0xac7d('0x12')]){if(_0x217811[_0xac7d('0x12')][_0xac7d('0x13')]===0x1f4){logger[_0xac7d('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);return _0x457e2d(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}logger[_0xac7d('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')]['message']);return _0x44eb2b(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}else{logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');_0x44eb2b(_0x217811[_0xac7d('0x15')][_0xac7d('0x14')]);}})[_0xac7d('0x16')](function(_0x12813a){logger[_0xac7d('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x153ce5,_0x12813a);_0x457e2d(_0x12813a);});});}exports[_0xac7d('0x17')]=function(_0x3cb12d){var _0x563634=this;return new Promise(function(_0x2e4790,_0x2d2494){return db[_0xac7d('0x18')][_0xac7d('0x19')](_0x3cb12d['body'],{'raw':_0x3cb12d[_0xac7d('0x1a')]?_0x3cb12d[_0xac7d('0x1a')][_0xac7d('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xd42c40){logger['info'](_0xac7d('0x17'),_0x3cb12d);logger[_0xac7d('0xf')](_0xac7d('0x17'),_0x3cb12d,JSON[_0xac7d('0x1c')](_0xd42c40));_0x2e4790(_0xd42c40);})[_0xac7d('0x16')](function(_0x365269){logger['error']('CreateSquareDetailsReport',_0x365269[_0xac7d('0x14')],_0x3cb12d);_0x2d2494(_0x563634[_0xac7d('0x12')](0x1f4,_0x365269['message']));});});}; \ No newline at end of file +var _0xe511=['options','raw','then','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','body'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0xe511,0x16f));var _0x1e51=function(_0x4998bd,_0x3faca9){_0x4998bd=_0x4998bd-0x0;var _0x5d4b6c=_0xe511[_0x4998bd];return _0x5d4b6c;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ed6b,_0x5c4590,_0x4fa2ba){return new BPromise(function(_0x394ad8,_0x133021){return client['request'](_0x21ed6b,_0x4fa2ba)['then'](function(_0x658941){logger[_0x1e51('0xa')](_0x1e51('0xb'),_0x5c4590,_0x1e51('0xc'));logger[_0x1e51('0xd')](_0x1e51('0xe'),_0x5c4590,'request\x20sent',JSON[_0x1e51('0xf')](_0x658941));if(_0x658941[_0x1e51('0x10')]){if(_0x658941[_0x1e51('0x10')][_0x1e51('0x11')]===0x1f4){logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941['error'][_0x1e51('0x12')]);return _0x133021(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);return _0x394ad8(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}else{logger[_0x1e51('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x5c4590,_0x1e51('0xc'));_0x394ad8(_0x658941[_0x1e51('0x13')][_0x1e51('0x12')]);}})['catch'](function(_0xa3b410){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5c4590,_0xa3b410);_0x133021(_0xa3b410);});});}exports[_0x1e51('0x14')]=function(_0x27dcad){var _0x40ae4c=this;return new Promise(function(_0x4785a5,_0x4d1aae){return db[_0x1e51('0x15')]['create'](_0x27dcad[_0x1e51('0x16')],{'raw':_0x27dcad['options']?_0x27dcad[_0x1e51('0x17')][_0x1e51('0x18')]===undefined?!![]:![]:!![]})[_0x1e51('0x19')](function(_0x183a95){logger['info']('CreateSquareDetailsReport',_0x27dcad);logger['debug']('CreateSquareDetailsReport',_0x27dcad,JSON[_0x1e51('0xf')](_0x183a95));_0x4785a5(_0x183a95);})['catch'](function(_0x3f7340){logger[_0x1e51('0x10')](_0x1e51('0x14'),_0x3f7340[_0x1e51('0x12')],_0x27dcad);_0x4d1aae(_0x40ae4c[_0x1e51('0x10')](0x1f4,_0x3f7340[_0x1e51('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 05f3b9d..c7e024d 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 _0x368d=['killProcess','exports','express','Router','./system.controller','isAuthenticated','index','get','/process/:pid/kill'];(function(_0x5cc924,_0xaaf584){var _0x4794ac=function(_0x3d0eb4){while(--_0x3d0eb4){_0x5cc924['push'](_0x5cc924['shift']());}};_0x4794ac(++_0xaaf584);}(_0x368d,0x185));var _0xd368=function(_0x2317af,_0x1332d3){_0x2317af=_0x2317af-0x0;var _0x3cb58d=_0x368d[_0x2317af];return _0x3cb58d;};'use strict';var express=require(_0xd368('0x0'));var router=express[_0xd368('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd368('0x2'));router['get']('/',auth[_0xd368('0x3')](),controller[_0xd368('0x4')]);router[_0xd368('0x5')](_0xd368('0x6'),auth[_0xd368('0x3')](),controller[_0xd368('0x7')]);module[_0xd368('0x8')]=router; \ No newline at end of file +var _0xd6d9=['killProcess','exports','Router','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill'];(function(_0x1f1fb4,_0x15a561){var _0x12fa15=function(_0x5ecc9b){while(--_0x5ecc9b){_0x1f1fb4['push'](_0x1f1fb4['shift']());}};_0x12fa15(++_0x15a561);}(_0xd6d9,0xe2));var _0x9d6d=function(_0x2f57b7,_0x45c19f){_0x2f57b7=_0x2f57b7-0x0;var _0x257977=_0xd6d9[_0x2f57b7];return _0x257977;};'use strict';var express=require('express');var router=express[_0x9d6d('0x0')]();var auth=require(_0x9d6d('0x1'));var controller=require(_0x9d6d('0x2'));router[_0x9d6d('0x3')]('/',auth[_0x9d6d('0x4')](),controller['index']);router['get'](_0x9d6d('0x5'),auth[_0x9d6d('0x4')](),controller[_0x9d6d('0x6')]);module[_0x9d6d('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 0b40c2a..21ce750 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 _0x8acb=['name','send','getAllData','status','catch','json','killProcess','components/import/cm','format','params','split','length','indexOf','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x2e536c,_0x35984e){var _0x39b637=function(_0xa31d29){while(--_0xa31d29){_0x2e536c['push'](_0x2e536c['shift']());}};_0x39b637(++_0x35984e);}(_0x8acb,0xe9));var _0xb8ac=function(_0x3a3663,_0x281a12){_0x3a3663=_0x3a3663-0x0;var _0x560d5d=_0x8acb[_0x3a3663];return _0x560d5d;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0xb8ac('0x0'))(_0xb8ac('0x1'));var util=require(_0xb8ac('0x2'));var BPromise=require(_0xb8ac('0x3'));var _=require('lodash');function handleError(_0x5465b6,_0x1abb04,_0x4cc663){_0x1abb04=_0x1abb04||0x1f4;return function(_0x4aa1e7){logger[_0xb8ac('0x4')](_0xb8ac('0x5'),_0x4cc663,_0x1abb04,util[_0xb8ac('0x6')](_0x4aa1e7,{'showHidden':![],'depth':null}));delete _0x4aa1e7[_0xb8ac('0x7')];_0x5465b6['status'](_0x1abb04)[_0xb8ac('0x8')](_0x4aa1e7);};}exports['index']=function(_0xb543b7,_0x3c00a6){return info[_0xb8ac('0x9')]()['then'](function(_0x2606f7){return _0x3c00a6[_0xb8ac('0xa')](0xc8)['json'](_0x2606f7);})[_0xb8ac('0xb')](function(_0x3f1d2a){return _0x3c00a6[_0xb8ac('0xa')](0x1f4)[_0xb8ac('0xc')](_0x3f1d2a);});};exports[_0xb8ac('0xd')]=function(_0x4b865a,_0x11b2ce){var _0x4caff0=[_0xb8ac('0xe')];return new BPromise(function(_0xb6f378,_0x358804){return exec(util[_0xb8ac('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x4b865a[_0xb8ac('0x10')]['pid']),function(_0x461be2,_0x30c5c0,_0xd81641){if(_0x461be2){return _0x358804(_0x461be2);}return _0xb6f378(_0x30c5c0);});})['then'](function(_0x4abecb){var _0x2388ca=![];var _0x3f61e4=_0x4abecb[_0xb8ac('0x11')](/\n/);for(var _0x30d4c9=0x0,_0x389a84=_0x4caff0[_0xb8ac('0x12')];_0x30d4c9<_0x389a84,_0x2388ca===![];_0x30d4c9+=0x1){if(_0x4abecb[_0xb8ac('0x13')](_0x4caff0[_0x30d4c9])>=0x0){_0x2388ca=!![];}}if(!_0x2388ca){throw new Error(util[_0xb8ac('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x4b865a[_0xb8ac('0x10')][_0xb8ac('0x14')]));}process[_0xb8ac('0x15')](_0x4b865a[_0xb8ac('0x10')][_0xb8ac('0x14')],_0xb8ac('0x16'));return _0x11b2ce[_0xb8ac('0xa')](0xc8)[_0xb8ac('0xc')]({'message':util[_0xb8ac('0xf')](_0xb8ac('0x17'),_0x4b865a[_0xb8ac('0x10')]['pid'])});})[_0xb8ac('0xb')](handleError(_0x11b2ce,null,'killProcess'));}; \ No newline at end of file +var _0xa08a=['child_process','api','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x31b8ea,_0x5bdd46){var _0x1eeda4=function(_0x10a087){while(--_0x10a087){_0x31b8ea['push'](_0x31b8ea['shift']());}};_0x1eeda4(++_0x5bdd46);}(_0xa08a,0x14f));var _0xaa08=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0xa08a[_0xa60623];return _0x4a6487;};'use strict';var info=require(_0xaa08('0x0'));var exec=require(_0xaa08('0x1'))['exec'];var logger=require('../../config/logger')(_0xaa08('0x2'));var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0xc1cfa8,_0xf8c817,_0x1c425d){_0xf8c817=_0xf8c817||0x1f4;return function(_0x5be8c7){logger['error'](_0xaa08('0x3'),_0x1c425d,_0xf8c817,util[_0xaa08('0x4')](_0x5be8c7,{'showHidden':![],'depth':null}));delete _0x5be8c7['name'];_0xc1cfa8[_0xaa08('0x5')](_0xf8c817)[_0xaa08('0x6')](_0x5be8c7);};}exports[_0xaa08('0x7')]=function(_0x2d34f1,_0x26a232){return info[_0xaa08('0x8')]()['then'](function(_0x554b93){return _0x26a232[_0xaa08('0x5')](0xc8)[_0xaa08('0x9')](_0x554b93);})[_0xaa08('0xa')](function(_0x3e993d){return _0x26a232[_0xaa08('0x5')](0x1f4)[_0xaa08('0x9')](_0x3e993d);});};exports[_0xaa08('0xb')]=function(_0x41d9e5,_0x2f8327){var _0x30c89f=[_0xaa08('0xc')];return new BPromise(function(_0x1f3f08,_0x103653){return exec(util[_0xaa08('0xd')](_0xaa08('0xe'),_0x41d9e5[_0xaa08('0xf')][_0xaa08('0x10')]),function(_0x2b6c56,_0x23b761,_0x13a0f5){if(_0x2b6c56){return _0x103653(_0x2b6c56);}return _0x1f3f08(_0x23b761);});})[_0xaa08('0x11')](function(_0x5dbbe3){var _0xfe9cef=![];var _0x2fa04e=_0x5dbbe3[_0xaa08('0x12')](/\n/);for(var _0x568e5c=0x0,_0x5c2653=_0x30c89f[_0xaa08('0x13')];_0x568e5c<_0x5c2653,_0xfe9cef===![];_0x568e5c+=0x1){if(_0x5dbbe3[_0xaa08('0x14')](_0x30c89f[_0x568e5c])>=0x0){_0xfe9cef=!![];}}if(!_0xfe9cef){throw new Error(util[_0xaa08('0xd')](_0xaa08('0x15'),_0x41d9e5['params'][_0xaa08('0x10')]));}process[_0xaa08('0x16')](_0x41d9e5[_0xaa08('0xf')]['pid'],'SIGINT');return _0x2f8327[_0xaa08('0x5')](0xc8)[_0xaa08('0x9')]({'message':util[_0xaa08('0xd')](_0xaa08('0x17'),_0x41d9e5['params'][_0xaa08('0x10')])});})[_0xaa08('0xa')](handleError(_0x2f8327,null,_0xaa08('0xb')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6164cf3..0c8d19a 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 _0x096b=['/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0xa5ce17,_0x54274d){var _0x12cfb9=function(_0x2cf309){while(--_0x2cf309){_0xa5ce17['push'](_0xa5ce17['shift']());}};_0x12cfb9(++_0x54274d);}(_0x096b,0x1df));var _0xb096=function(_0xc025da,_0x90c624){_0xc025da=_0xc025da-0x0;var _0x520249=_0x096b[_0xc025da];return _0x520249;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb096('0x0'));var timeout=require(_0xb096('0x1'));var express=require(_0xb096('0x2'));var router=express[_0xb096('0x3')]();var fs_extra=require(_0xb096('0x4'));var auth=require(_0xb096('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb096('0x6'));var controller=require(_0xb096('0x7'));router[_0xb096('0x8')]('/',auth[_0xb096('0x9')](),controller[_0xb096('0xa')]);router[_0xb096('0x8')]('/:id',auth[_0xb096('0x9')](),controller[_0xb096('0xb')]);router[_0xb096('0xc')]('/',auth['isAuthenticated'](),controller[_0xb096('0xd')]);router[_0xb096('0xe')](_0xb096('0xf'),auth[_0xb096('0x9')](),controller[_0xb096('0x10')]);router[_0xb096('0x11')](_0xb096('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xb096('0x12')]=router; \ No newline at end of file +var _0x3442=['create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x58896e,_0x418507){var _0x21f06d=function(_0x32a107){while(--_0x32a107){_0x58896e['push'](_0x58896e['shift']());}};_0x21f06d(++_0x418507);}(_0x3442,0x15a));var _0x2344=function(_0x33ef54,_0x113125){_0x33ef54=_0x33ef54-0x0;var _0x1c4074=_0x3442[_0x33ef54];return _0x1c4074;};'use strict';var multer=require('multer');var util=require(_0x2344('0x0'));var path=require(_0x2344('0x1'));var timeout=require(_0x2344('0x2'));var express=require(_0x2344('0x3'));var router=express[_0x2344('0x4')]();var fs_extra=require(_0x2344('0x5'));var auth=require(_0x2344('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2344('0x7'));var controller=require(_0x2344('0x8'));router['get']('/',auth[_0x2344('0x9')](),controller[_0x2344('0xa')]);router[_0x2344('0xb')](_0x2344('0xc'),auth[_0x2344('0x9')](),controller[_0x2344('0xd')]);router[_0x2344('0xe')]('/',auth[_0x2344('0x9')](),controller[_0x2344('0xf')]);router['put'](_0x2344('0xc'),auth[_0x2344('0x9')](),controller[_0x2344('0x10')]);router[_0x2344('0x11')](_0x2344('0xc'),auth[_0x2344('0x9')](),controller['destroy']);module[_0x2344('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 900b49f..5aef68c 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 _0xe486=['#0091EA','sequelize','exports','STRING','name'];(function(_0x4b067a,_0x21e1d9){var _0x43bbe7=function(_0x290da5){while(--_0x290da5){_0x4b067a['push'](_0x4b067a['shift']());}};_0x43bbe7(++_0x21e1d9);}(_0xe486,0x6a));var _0x6e48=function(_0x400912,_0x4762e2){_0x400912=_0x400912-0x0;var _0x120b20=_0xe486[_0x400912];return _0x120b20;};'use strict';var Sequelize=require(_0x6e48('0x0'));module[_0x6e48('0x1')]={'name':{'type':Sequelize[_0x6e48('0x2')],'unique':_0x6e48('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6e48('0x2')],'defaultValue':_0x6e48('0x4')},'description':{'type':Sequelize[_0x6e48('0x2')]}}; \ No newline at end of file +var _0xd5fc=['sequelize','STRING','#0091EA'];(function(_0x2e7b04,_0x3f1b14){var _0x30018b=function(_0x44a87e){while(--_0x44a87e){_0x2e7b04['push'](_0x2e7b04['shift']());}};_0x30018b(++_0x3f1b14);}(_0xd5fc,0xae));var _0xcd5f=function(_0xea4b7f,_0x54efd6){_0xea4b7f=_0xea4b7f-0x0;var _0x5099b5=_0xd5fc[_0xea4b7f];return _0x5099b5;};'use strict';var Sequelize=require(_0xcd5f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xcd5f('0x1')],'defaultValue':_0xcd5f('0x2')},'description':{'type':Sequelize[_0xcd5f('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 055cd08..a919a49 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 _0x8b29=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','limit','undefined','count','offset','status','set','json','reject','then','Tags','UserProfileResource','sendStatus','error','stack','name','index','map','Tag','rawAttributes','type','key','model','query','filters','intersection','attributes'];(function(_0x5a0401,_0xae66ad){var _0x49a0b1=function(_0x10f749){while(--_0x10f749){_0x5a0401['push'](_0x5a0401['shift']());}};_0x49a0b1(++_0xae66ad);}(_0x8b29,0xbe));var _0x98b2=function(_0x2ca4a4,_0x28d7cf){_0x2ca4a4=_0x2ca4a4-0x0;var _0x4a89b6=_0x8b29[_0x2ca4a4];return _0x4a89b6;};'use strict';var emlformat=require(_0x98b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98b2('0x1'));var jsonpatch=require(_0x98b2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x98b2('0x3'));var Mustache=require(_0x98b2('0x4'));var util=require('util');var path=require(_0x98b2('0x5'));var sox=require('sox');var csv=require(_0x98b2('0x6'));var ejs=require(_0x98b2('0x7'));var fs=require('fs');var fs_extra=require(_0x98b2('0x8'));var _=require(_0x98b2('0x9'));var squel=require(_0x98b2('0xa'));var crypto=require(_0x98b2('0xb'));var jsforce=require(_0x98b2('0xc'));var deskjs=require(_0x98b2('0xd'));var toCsv=require(_0x98b2('0x6'));var querystring=require(_0x98b2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x98b2('0xf'));var qs=require(_0x98b2('0x10'));var as=require(_0x98b2('0x11'));var hardwareService=require(_0x98b2('0x12'));var logger=require(_0x98b2('0x13'))(_0x98b2('0x14'));var utils=require('../../config/utils');var config=require(_0x98b2('0x15'));var licenseUtil=require(_0x98b2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27865e,_0x1180fe){_0x1180fe=_0x1180fe||0xcc;return function(_0x2a6337){if(_0x2a6337){return _0x27865e['sendStatus'](_0x1180fe);}return _0x27865e['status'](_0x1180fe)[_0x98b2('0x17')]();};}function respondWithResult(_0x56bcbd,_0x2966e2){_0x2966e2=_0x2966e2||0xc8;return function(_0x49b151){if(_0x49b151){return _0x56bcbd['status'](_0x2966e2)['json'](_0x49b151);}};}function respondWithFilteredResult(_0x831ee8,_0x413464){return function(_0xe49e9a){if(_0xe49e9a){var _0x5ecea1=typeof _0x413464['offset']==='undefined'&&typeof _0x413464[_0x98b2('0x18')]===_0x98b2('0x19');var _0x145d65=_0xe49e9a[_0x98b2('0x1a')];var _0x4b9f2c=_0x5ecea1?0x0:_0x413464[_0x98b2('0x1b')];var _0x588837=_0x5ecea1?_0xe49e9a[_0x98b2('0x1a')]:_0x413464['offset']+_0x413464[_0x98b2('0x18')];var _0x1dfc04;if(_0x588837>=_0x145d65){_0x588837=_0x145d65;_0x1dfc04=0xc8;}else{_0x1dfc04=0xce;}_0x831ee8[_0x98b2('0x1c')](_0x1dfc04);return _0x831ee8[_0x98b2('0x1d')]('Content-Range',_0x4b9f2c+'-'+_0x588837+'/'+_0x145d65)[_0x98b2('0x1e')](_0xe49e9a);}return null;};}function patchUpdates(_0x242cbd){return function(_0x5dfdf7){try{jsonpatch['apply'](_0x5dfdf7,_0x242cbd,!![]);}catch(_0x5d6b38){return BPromise[_0x98b2('0x1f')](_0x5d6b38);}return _0x5dfdf7['save']();};}function saveUpdates(_0x4ddded,_0x3796c0){return function(_0x37fc18){if(_0x37fc18){return _0x37fc18['update'](_0x4ddded)[_0x98b2('0x20')](function(_0x13d149){return _0x13d149;});}return null;};}function removeEntity(_0xfae112,_0x4f33d8){return function(_0x2a5587){if(_0x2a5587){return _0x2a5587['destroy']()[_0x98b2('0x20')](function(){var _0x4c34f1=_0x2a5587['get']({'plain':!![]});var _0x7b6ebc=_0x98b2('0x21');return db[_0x98b2('0x22')]['destroy']({'where':{'type':_0x7b6ebc,'resourceId':_0x4c34f1['id']}})['then'](function(){return _0x2a5587;});})['then'](function(){_0xfae112[_0x98b2('0x1c')](0xcc)[_0x98b2('0x17')]();});}};}function handleEntityNotFound(_0x50aafb,_0xecb32b){return function(_0x28db65){if(!_0x28db65){_0x50aafb[_0x98b2('0x23')](0x194);}return _0x28db65;};}function handleError(_0x56efb6,_0x2e1ea4){_0x2e1ea4=_0x2e1ea4||0x1f4;return function(_0x1dee11){logger[_0x98b2('0x24')](_0x1dee11[_0x98b2('0x25')]);if(_0x1dee11[_0x98b2('0x26')]){delete _0x1dee11['name'];}_0x56efb6[_0x98b2('0x1c')](_0x2e1ea4)['send'](_0x1dee11);};}exports[_0x98b2('0x27')]=function(_0x1aa42a,_0x4d197c){var _0x2f5156={},_0x363174={},_0x526637={'count':0x0,'rows':[]};var _0x1a676e=_[_0x98b2('0x28')](db[_0x98b2('0x29')][_0x98b2('0x2a')],function(_0x4aee2a){return{'name':_0x4aee2a['fieldName'],'type':_0x4aee2a[_0x98b2('0x2b')][_0x98b2('0x2c')]};});_0x363174[_0x98b2('0x2d')]=_[_0x98b2('0x28')](_0x1a676e,_0x98b2('0x26'));_0x363174[_0x98b2('0x2e')]=_['keys'](_0x1aa42a[_0x98b2('0x2e')]);_0x363174[_0x98b2('0x2f')]=_[_0x98b2('0x30')](_0x363174[_0x98b2('0x2d')],_0x363174[_0x98b2('0x2e')]);_0x2f5156[_0x98b2('0x31')]=_[_0x98b2('0x30')](_0x363174[_0x98b2('0x2d')],qs[_0x98b2('0x32')](_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x32')]));_0x2f5156[_0x98b2('0x31')]=_0x2f5156[_0x98b2('0x31')]['length']?_0x2f5156['attributes']:_0x363174[_0x98b2('0x2d')];if(!_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x33')](_0x98b2('0x34'))){_0x2f5156[_0x98b2('0x18')]=qs[_0x98b2('0x18')](_0x1aa42a['query'][_0x98b2('0x18')]);_0x2f5156[_0x98b2('0x1b')]=qs[_0x98b2('0x1b')](_0x1aa42a[_0x98b2('0x2e')]['offset']);}_0x2f5156[_0x98b2('0x35')]=qs[_0x98b2('0x36')](_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x36')]);_0x2f5156[_0x98b2('0x37')]=qs[_0x98b2('0x2f')](_[_0x98b2('0x38')](_0x1aa42a['query'],_0x363174[_0x98b2('0x2f')]),_0x1a676e);if(_0x1aa42a['query'][_0x98b2('0x39')]){_0x2f5156[_0x98b2('0x37')]=_[_0x98b2('0x3a')](_0x2f5156[_0x98b2('0x37')],{'$or':_['map'](_0x1a676e,function(_0x5aa34b){if(_0x5aa34b[_0x98b2('0x2b')]!==_0x98b2('0x3b')){var _0x42c69c={};_0x42c69c[_0x5aa34b['name']]={'$like':'%'+_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x39')]+'%'};return _0x42c69c;}})});}_0x2f5156=_[_0x98b2('0x3a')]({},_0x2f5156,_0x1aa42a[_0x98b2('0x3c')]);var _0x311fa7={'where':_0x2f5156[_0x98b2('0x37')]};return db['Tag'][_0x98b2('0x1a')](_0x311fa7)[_0x98b2('0x20')](function(_0x197749){_0x526637['count']=_0x197749;if(_0x1aa42a[_0x98b2('0x2e')][_0x98b2('0x3d')]){_0x2f5156[_0x98b2('0x3e')]=[{'all':!![]}];}return db[_0x98b2('0x29')][_0x98b2('0x3f')](_0x2f5156);})[_0x98b2('0x20')](function(_0x4a6c03){_0x526637[_0x98b2('0x40')]=_0x4a6c03;return _0x526637;})['then'](respondWithFilteredResult(_0x4d197c,_0x2f5156))[_0x98b2('0x41')](handleError(_0x4d197c,null));};exports[_0x98b2('0x42')]=function(_0x410094,_0x1d262d){var _0x44d858={'raw':!![],'where':{'id':_0x410094[_0x98b2('0x43')]['id']}},_0x32e14b={};_0x32e14b[_0x98b2('0x2d')]=_[_0x98b2('0x44')](db['Tag'][_0x98b2('0x2a')]);_0x32e14b['query']=_[_0x98b2('0x44')](_0x410094[_0x98b2('0x2e')]);_0x32e14b[_0x98b2('0x2f')]=_[_0x98b2('0x30')](_0x32e14b[_0x98b2('0x2d')],_0x32e14b[_0x98b2('0x2e')]);_0x44d858['attributes']=_[_0x98b2('0x30')](_0x32e14b[_0x98b2('0x2d')],qs[_0x98b2('0x32')](_0x410094[_0x98b2('0x2e')][_0x98b2('0x32')]));_0x44d858['attributes']=_0x44d858['attributes'][_0x98b2('0x45')]?_0x44d858[_0x98b2('0x31')]:_0x32e14b[_0x98b2('0x2d')];if(_0x410094[_0x98b2('0x2e')]['includeAll']){_0x44d858['include']=[{'all':!![]}];}_0x44d858=_['merge']({},_0x44d858,_0x410094[_0x98b2('0x3c')]);return db[_0x98b2('0x29')][_0x98b2('0x46')](_0x44d858)[_0x98b2('0x20')](handleEntityNotFound(_0x1d262d,null))[_0x98b2('0x20')](respondWithResult(_0x1d262d,null))[_0x98b2('0x41')](handleError(_0x1d262d,null));};exports[_0x98b2('0x47')]=function(_0x2b08ed,_0x3c2477){return db['Tag'][_0x98b2('0x47')](_0x2b08ed['body'],{})[_0x98b2('0x20')](function(_0x6369ca){var _0x3c3c64=_0x2b08ed[_0x98b2('0x48')]['get']({'plain':!![]});if(!_0x3c3c64)throw new Error(_0x98b2('0x49'));if(_0x3c3c64[_0x98b2('0x4a')]===_0x98b2('0x48')){var _0x1e13b8=_0x6369ca[_0x98b2('0x4b')]({'plain':!![]});var _0x54f7ba=_0x98b2('0x21');return db[_0x98b2('0x4c')][_0x98b2('0x46')]({'where':{'name':_0x54f7ba,'userProfileId':_0x3c3c64[_0x98b2('0x4d')]},'raw':!![]})[_0x98b2('0x20')](function(_0x3d6a4e){if(_0x3d6a4e&&_0x3d6a4e[_0x98b2('0x4e')]===0x0){return db[_0x98b2('0x22')][_0x98b2('0x47')]({'name':_0x1e13b8[_0x98b2('0x26')],'resourceId':_0x1e13b8['id'],'type':_0x3d6a4e[_0x98b2('0x26')],'sectionId':_0x3d6a4e['id']},{})[_0x98b2('0x20')](function(){return _0x6369ca;});}else{return _0x6369ca;}})['catch'](function(_0x3b083a){logger[_0x98b2('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b083a);throw _0x3b083a;});}return _0x6369ca;})['then'](respondWithResult(_0x3c2477,0xc9))[_0x98b2('0x41')](handleError(_0x3c2477,null));};exports['update']=function(_0x20ddfd,_0x1cad33){if(_0x20ddfd[_0x98b2('0x4f')]['id']){delete _0x20ddfd[_0x98b2('0x4f')]['id'];}return db[_0x98b2('0x29')][_0x98b2('0x46')]({'where':{'id':_0x20ddfd['params']['id']}})[_0x98b2('0x20')](handleEntityNotFound(_0x1cad33,null))['then'](saveUpdates(_0x20ddfd['body'],null))[_0x98b2('0x20')](respondWithResult(_0x1cad33,null))[_0x98b2('0x41')](handleError(_0x1cad33,null));};exports['destroy']=function(_0x12a72e,_0x1253e2){return db['Tag'][_0x98b2('0x46')]({'where':{'id':_0x12a72e[_0x98b2('0x43')]['id']}})[_0x98b2('0x20')](handleEntityNotFound(_0x1253e2,null))[_0x98b2('0x20')](removeEntity(_0x1253e2,null))['catch'](handleError(_0x1253e2,null));}; \ No newline at end of file +var _0xf2cb=['../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Tags','UserProfileResource','end','error','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xf2cb,0x130));var _0xbf2c=function(_0x53b185,_0x129850){_0x53b185=_0x53b185-0x0;var _0x17dd56=_0xf2cb[_0x53b185];return _0x17dd56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf2c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf2c('0x1'));var rp=require('request-promise');var moment=require(_0xbf2c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbf2c('0x3'));var util=require(_0xbf2c('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xbf2c('0x5'));var ejs=require(_0xbf2c('0x6'));var fs=require('fs');var fs_extra=require(_0xbf2c('0x7'));var _=require(_0xbf2c('0x8'));var squel=require('squel');var crypto=require(_0xbf2c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbf2c('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf2c('0xb'));var Redis=require(_0xbf2c('0xc'));var authService=require(_0xbf2c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xbf2c('0xe'));var hardwareService=require(_0xbf2c('0xf'));var logger=require(_0xbf2c('0x10'))(_0xbf2c('0x11'));var utils=require(_0xbf2c('0x12'));var config=require(_0xbf2c('0x13'));var licenseUtil=require(_0xbf2c('0x14'));var db=require(_0xbf2c('0x15'))['db'];function respondWithStatusCode(_0x52983d,_0x149235){_0x149235=_0x149235||0xcc;return function(_0x294d0d){if(_0x294d0d){return _0x52983d[_0xbf2c('0x16')](_0x149235);}return _0x52983d[_0xbf2c('0x17')](_0x149235)['end']();};}function respondWithResult(_0x7665b1,_0x5a160b){_0x5a160b=_0x5a160b||0xc8;return function(_0x557740){if(_0x557740){return _0x7665b1[_0xbf2c('0x17')](_0x5a160b)['json'](_0x557740);}};}function respondWithFilteredResult(_0x47df49,_0x3ed1c3){return function(_0x45412){if(_0x45412){var _0x2dc80e=typeof _0x3ed1c3[_0xbf2c('0x18')]===_0xbf2c('0x19')&&typeof _0x3ed1c3['limit']===_0xbf2c('0x19');var _0x5514b0=_0x45412[_0xbf2c('0x1a')];var _0x1df2ab=_0x2dc80e?0x0:_0x3ed1c3[_0xbf2c('0x18')];var _0x32a44d=_0x2dc80e?_0x45412[_0xbf2c('0x1a')]:_0x3ed1c3['offset']+_0x3ed1c3[_0xbf2c('0x1b')];var _0x1fbfe8;if(_0x32a44d>=_0x5514b0){_0x32a44d=_0x5514b0;_0x1fbfe8=0xc8;}else{_0x1fbfe8=0xce;}_0x47df49[_0xbf2c('0x17')](_0x1fbfe8);return _0x47df49[_0xbf2c('0x1c')](_0xbf2c('0x1d'),_0x1df2ab+'-'+_0x32a44d+'/'+_0x5514b0)[_0xbf2c('0x1e')](_0x45412);}return null;};}function patchUpdates(_0x426724){return function(_0x58caa9){try{jsonpatch[_0xbf2c('0x1f')](_0x58caa9,_0x426724,!![]);}catch(_0x2a3adf){return BPromise[_0xbf2c('0x20')](_0x2a3adf);}return _0x58caa9[_0xbf2c('0x21')]();};}function saveUpdates(_0x57873c,_0x2bc2ad){return function(_0x1f5515){if(_0x1f5515){return _0x1f5515['update'](_0x57873c)[_0xbf2c('0x22')](function(_0x356f26){return _0x356f26;});}return null;};}function removeEntity(_0x3f1cdb,_0x52ecb4){return function(_0x5de1f2){if(_0x5de1f2){return _0x5de1f2[_0xbf2c('0x23')]()[_0xbf2c('0x22')](function(){var _0xae9c7=_0x5de1f2[_0xbf2c('0x24')]({'plain':!![]});var _0x108aa8=_0xbf2c('0x25');return db[_0xbf2c('0x26')]['destroy']({'where':{'type':_0x108aa8,'resourceId':_0xae9c7['id']}})['then'](function(){return _0x5de1f2;});})[_0xbf2c('0x22')](function(){_0x3f1cdb[_0xbf2c('0x17')](0xcc)[_0xbf2c('0x27')]();});}};}function handleEntityNotFound(_0x4314d6,_0x3ed68d){return function(_0x4a0257){if(!_0x4a0257){_0x4314d6[_0xbf2c('0x16')](0x194);}return _0x4a0257;};}function handleError(_0x2976fa,_0x1f7030){_0x1f7030=_0x1f7030||0x1f4;return function(_0x4f3191){logger[_0xbf2c('0x28')](_0x4f3191['stack']);if(_0x4f3191[_0xbf2c('0x29')]){delete _0x4f3191[_0xbf2c('0x29')];}_0x2976fa[_0xbf2c('0x17')](_0x1f7030)[_0xbf2c('0x2a')](_0x4f3191);};}exports[_0xbf2c('0x2b')]=function(_0x502943,_0x1e946c){var _0xef5fc9={},_0x132365={},_0x13e238={'count':0x0,'rows':[]};var _0x2cc8cb=_[_0xbf2c('0x2c')](db[_0xbf2c('0x2d')][_0xbf2c('0x2e')],function(_0x4d731d){return{'name':_0x4d731d[_0xbf2c('0x2f')],'type':_0x4d731d[_0xbf2c('0x30')][_0xbf2c('0x31')]};});_0x132365['model']=_['map'](_0x2cc8cb,_0xbf2c('0x29'));_0x132365[_0xbf2c('0x32')]=_[_0xbf2c('0x33')](_0x502943[_0xbf2c('0x32')]);_0x132365[_0xbf2c('0x34')]=_[_0xbf2c('0x35')](_0x132365[_0xbf2c('0x36')],_0x132365[_0xbf2c('0x32')]);_0xef5fc9[_0xbf2c('0x37')]=_['intersection'](_0x132365[_0xbf2c('0x36')],qs[_0xbf2c('0x38')](_0x502943[_0xbf2c('0x32')][_0xbf2c('0x38')]));_0xef5fc9[_0xbf2c('0x37')]=_0xef5fc9[_0xbf2c('0x37')][_0xbf2c('0x39')]?_0xef5fc9[_0xbf2c('0x37')]:_0x132365['model'];if(!_0x502943[_0xbf2c('0x32')][_0xbf2c('0x3a')](_0xbf2c('0x3b'))){_0xef5fc9['limit']=qs[_0xbf2c('0x1b')](_0x502943[_0xbf2c('0x32')][_0xbf2c('0x1b')]);_0xef5fc9['offset']=qs[_0xbf2c('0x18')](_0x502943[_0xbf2c('0x32')]['offset']);}_0xef5fc9['order']=qs['sort'](_0x502943['query']['sort']);_0xef5fc9[_0xbf2c('0x3c')]=qs[_0xbf2c('0x34')](_[_0xbf2c('0x3d')](_0x502943[_0xbf2c('0x32')],_0x132365[_0xbf2c('0x34')]),_0x2cc8cb);if(_0x502943[_0xbf2c('0x32')][_0xbf2c('0x3e')]){_0xef5fc9[_0xbf2c('0x3c')]=_[_0xbf2c('0x3f')](_0xef5fc9[_0xbf2c('0x3c')],{'$or':_[_0xbf2c('0x2c')](_0x2cc8cb,function(_0x99abc8){if(_0x99abc8[_0xbf2c('0x30')]!==_0xbf2c('0x40')){var _0x4776e0={};_0x4776e0[_0x99abc8[_0xbf2c('0x29')]]={'$like':'%'+_0x502943['query'][_0xbf2c('0x3e')]+'%'};return _0x4776e0;}})});}_0xef5fc9=_[_0xbf2c('0x3f')]({},_0xef5fc9,_0x502943[_0xbf2c('0x41')]);var _0x3379d2={'where':_0xef5fc9[_0xbf2c('0x3c')]};return db[_0xbf2c('0x2d')][_0xbf2c('0x1a')](_0x3379d2)[_0xbf2c('0x22')](function(_0x500e0b){_0x13e238[_0xbf2c('0x1a')]=_0x500e0b;if(_0x502943[_0xbf2c('0x32')][_0xbf2c('0x42')]){_0xef5fc9[_0xbf2c('0x43')]=[{'all':!![]}];}return db['Tag'][_0xbf2c('0x44')](_0xef5fc9);})['then'](function(_0x369bdc){_0x13e238[_0xbf2c('0x45')]=_0x369bdc;return _0x13e238;})[_0xbf2c('0x22')](respondWithFilteredResult(_0x1e946c,_0xef5fc9))[_0xbf2c('0x46')](handleError(_0x1e946c,null));};exports[_0xbf2c('0x47')]=function(_0x14107c,_0x4c2a1e){var _0x365710={'raw':!![],'where':{'id':_0x14107c['params']['id']}},_0x55c3d7={};_0x55c3d7[_0xbf2c('0x36')]=_['keys'](db['Tag'][_0xbf2c('0x2e')]);_0x55c3d7[_0xbf2c('0x32')]=_['keys'](_0x14107c[_0xbf2c('0x32')]);_0x55c3d7['filters']=_[_0xbf2c('0x35')](_0x55c3d7['model'],_0x55c3d7[_0xbf2c('0x32')]);_0x365710[_0xbf2c('0x37')]=_[_0xbf2c('0x35')](_0x55c3d7[_0xbf2c('0x36')],qs[_0xbf2c('0x38')](_0x14107c[_0xbf2c('0x32')]['fields']));_0x365710[_0xbf2c('0x37')]=_0x365710[_0xbf2c('0x37')][_0xbf2c('0x39')]?_0x365710[_0xbf2c('0x37')]:_0x55c3d7[_0xbf2c('0x36')];if(_0x14107c['query']['includeAll']){_0x365710[_0xbf2c('0x43')]=[{'all':!![]}];}_0x365710=_['merge']({},_0x365710,_0x14107c[_0xbf2c('0x41')]);return db[_0xbf2c('0x2d')][_0xbf2c('0x48')](_0x365710)[_0xbf2c('0x22')](handleEntityNotFound(_0x4c2a1e,null))[_0xbf2c('0x22')](respondWithResult(_0x4c2a1e,null))[_0xbf2c('0x46')](handleError(_0x4c2a1e,null));};exports[_0xbf2c('0x49')]=function(_0x1c3b78,_0x128e97){return db[_0xbf2c('0x2d')][_0xbf2c('0x49')](_0x1c3b78['body'],{})[_0xbf2c('0x22')](function(_0x22af02){var _0x90276=_0x1c3b78[_0xbf2c('0x4a')]['get']({'plain':!![]});if(!_0x90276)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x90276['role']===_0xbf2c('0x4a')){var _0x2451ba=_0x22af02['get']({'plain':!![]});var _0x5a0c37='Tags';return db[_0xbf2c('0x4b')][_0xbf2c('0x48')]({'where':{'name':_0x5a0c37,'userProfileId':_0x90276[_0xbf2c('0x4c')]},'raw':!![]})[_0xbf2c('0x22')](function(_0x3a8d9a){if(_0x3a8d9a&&_0x3a8d9a[_0xbf2c('0x4d')]===0x0){return db['UserProfileResource'][_0xbf2c('0x49')]({'name':_0x2451ba[_0xbf2c('0x29')],'resourceId':_0x2451ba['id'],'type':_0x3a8d9a[_0xbf2c('0x29')],'sectionId':_0x3a8d9a['id']},{})[_0xbf2c('0x22')](function(){return _0x22af02;});}else{return _0x22af02;}})[_0xbf2c('0x46')](function(_0x3166dd){logger[_0xbf2c('0x28')](_0xbf2c('0x4e'),_0x3166dd);throw _0x3166dd;});}return _0x22af02;})['then'](respondWithResult(_0x128e97,0xc9))['catch'](handleError(_0x128e97,null));};exports['update']=function(_0x3a62f9,_0x2b0ec3){if(_0x3a62f9[_0xbf2c('0x4f')]['id']){delete _0x3a62f9[_0xbf2c('0x4f')]['id'];}return db['Tag'][_0xbf2c('0x48')]({'where':{'id':_0x3a62f9[_0xbf2c('0x50')]['id']}})['then'](handleEntityNotFound(_0x2b0ec3,null))[_0xbf2c('0x22')](saveUpdates(_0x3a62f9[_0xbf2c('0x4f')],null))[_0xbf2c('0x22')](respondWithResult(_0x2b0ec3,null))['catch'](handleError(_0x2b0ec3,null));};exports['destroy']=function(_0x4b6253,_0x49cae6){return db[_0xbf2c('0x2d')][_0xbf2c('0x48')]({'where':{'id':_0x4b6253[_0xbf2c('0x50')]['id']}})[_0xbf2c('0x22')](handleEntityNotFound(_0x49cae6,null))[_0xbf2c('0x22')](removeEntity(_0x49cae6,null))['catch'](handleError(_0x49cae6,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index e43d3e0..f7a64c5 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 _0xf0fb=['moment','request-promise','path','rimraf','../../config/environment','define','tools_tags','../../config/logger','api'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xf0fb,0x97));var _0xbf0f=function(_0x221f71,_0x221c04){_0x221f71=_0x221f71-0x0;var _0x2df2e5=_0xf0fb[_0x221f71];return _0x2df2e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf0f('0x0'))(_0xbf0f('0x1'));var moment=require(_0xbf0f('0x2'));var BPromise=require('bluebird');var rp=require(_0xbf0f('0x3'));var fs=require('fs');var path=require(_0xbf0f('0x4'));var rimraf=require(_0xbf0f('0x5'));var config=require(_0xbf0f('0x6'));var attributes=require('./tag.attributes');module['exports']=function(_0x35d3af,_0x5cac16){return _0x35d3af[_0xbf0f('0x7')]('Tag',attributes,{'tableName':_0xbf0f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81a4=['../../config/environment','exports','define','tools_tags','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x54eb19,_0x1322f3){var _0x9ceca2=function(_0x390f5d){while(--_0x390f5d){_0x54eb19['push'](_0x54eb19['shift']());}};_0x9ceca2(++_0x1322f3);}(_0x81a4,0x1a6));var _0x481a=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x81a4[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x481a('0x0'));var util=require(_0x481a('0x1'));var logger=require(_0x481a('0x2'))(_0x481a('0x3'));var moment=require('moment');var BPromise=require(_0x481a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x481a('0x5'));var rimraf=require(_0x481a('0x6'));var config=require(_0x481a('0x7'));var attributes=require('./tag.attributes');module[_0x481a('0x8')]=function(_0x3a6458,_0x17d40e){return _0x3a6458[_0x481a('0x9')]('Tag',attributes,{'tableName':_0x481a('0xa'),'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 019e5b5..b91dfd0 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x34bbec,_0x35d0f9){var _0x532c43=function(_0x31078e){while(--_0x31078e){_0x34bbec['push'](_0x34bbec['shift']());}};_0x532c43(++_0x35d0f9);}(_0x34e8,0x12c));var _0x834e=function(_0x57edaf,_0x27591a){_0x57edaf=_0x57edaf-0x0;var _0x599b8e=_0x34e8[_0x57edaf];return _0x599b8e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('Tag,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('Tag,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0xec56=['http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xec56,0x1bd));var _0x6ec5=function(_0x249b7d,_0x55688c){_0x249b7d=_0x249b7d-0x0;var _0x4d0ef1=_0xec56[_0x249b7d];return _0x4d0ef1;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ec5('0x1'));var rs=require(_0x6ec5('0x2'));var fs=require('fs');var Redis=require(_0x6ec5('0x3'));var db=require(_0x6ec5('0x4'))['db'];var utils=require(_0x6ec5('0x5'));var logger=require(_0x6ec5('0x6'))(_0x6ec5('0x7'));var config=require(_0x6ec5('0x8'));var jayson=require(_0x6ec5('0x9'));var client=jayson[_0x6ec5('0xa')][_0x6ec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb683,_0x35be4e,_0x1f59cd){return new BPromise(function(_0x3dd891,_0x225d2f){return client[_0x6ec5('0xc')](_0x3bb683,_0x1f59cd)[_0x6ec5('0xd')](function(_0x3ff17c){logger['info'](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));logger[_0x6ec5('0x10')](_0x6ec5('0x11'),_0x35be4e,_0x6ec5('0xf'),JSON[_0x6ec5('0x12')](_0x3ff17c));if(_0x3ff17c[_0x6ec5('0x13')]){if(_0x3ff17c['error'][_0x6ec5('0x14')]===0x1f4){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);return _0x225d2f(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}logger[_0x6ec5('0x13')]('Tag,\x20%s,\x20%s',_0x35be4e,_0x3ff17c[_0x6ec5('0x13')]['message']);return _0x3dd891(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}else{logger[_0x6ec5('0x16')](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));_0x3dd891(_0x3ff17c['result'][_0x6ec5('0x15')]);}})[_0x6ec5('0x17')](function(_0x125ae6){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x125ae6);_0x225d2f(_0x125ae6);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c973631..51ee4e4 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 3fd9541..9edb579 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 _0xbaf0=['name','exports','STRING'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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 +var _0x0713=['STRING','name'];(function(_0x484c6b,_0x45e0f4){var _0x55884f=function(_0x4e594d){while(--_0x4e594d){_0x484c6b['push'](_0x484c6b['shift']());}};_0x55884f(++_0x45e0f4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 5e09baa..bf71e82 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 _0x5ceb=['Whatsapp','sequelize','removeAgents','parse','Queue:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','include','Team','findAll','rows','catch','show','params','keys','length','includeAll','options','find','create','body','user','get','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','capitalize','toLowerCase','Queue','order','addQueues','Unknown\x20channel','add','Queues','removeQueues','remove','ids','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all'];(function(_0x2c984d,_0x5a6f2f){var _0x31df62=function(_0x180acd){while(--_0x180acd){_0x2c984d['push'](_0x2c984d['shift']());}};_0x31df62(++_0x5a6f2f);}(_0x5ceb,0x90));var _0xb5ce=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x5ceb[_0xbc4560];return _0x298cfb;};'use strict';var emlformat=require(_0xb5ce('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb5ce('0x1'));var rp=require(_0xb5ce('0x2'));var moment=require(_0xb5ce('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb5ce('0x4'));var path=require(_0xb5ce('0x5'));var sox=require(_0xb5ce('0x6'));var csv=require(_0xb5ce('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5ce('0x8'));var _=require(_0xb5ce('0x9'));var squel=require(_0xb5ce('0xa'));var crypto=require(_0xb5ce('0xb'));var jsforce=require(_0xb5ce('0xc'));var deskjs=require(_0xb5ce('0xd'));var toCsv=require(_0xb5ce('0x7'));var querystring=require(_0xb5ce('0xe'));var Papa=require(_0xb5ce('0xf'));var Redis=require('ioredis');var authService=require(_0xb5ce('0x10'));var qs=require(_0xb5ce('0x11'));var as=require(_0xb5ce('0x12'));var hardwareService=require(_0xb5ce('0x13'));var logger=require(_0xb5ce('0x14'))(_0xb5ce('0x15'));var utils=require(_0xb5ce('0x16'));var config=require(_0xb5ce('0x17'));var licenseUtil=require(_0xb5ce('0x18'));var db=require(_0xb5ce('0x19'))['db'];config[_0xb5ce('0x1a')]=_[_0xb5ce('0x1b')](config['redis'],{'host':_0xb5ce('0x1c'),'port':0x18eb});var socket=require(_0xb5ce('0x1d'))(new Redis(config[_0xb5ce('0x1a')]));require(_0xb5ce('0x1e'))[_0xb5ce('0x1f')](socket);function respondWithStatusCode(_0xa1c140,_0x46d2de){_0x46d2de=_0x46d2de||0xcc;return function(_0x99b9f6){if(_0x99b9f6){return _0xa1c140['sendStatus'](_0x46d2de);}return _0xa1c140[_0xb5ce('0x20')](_0x46d2de)[_0xb5ce('0x21')]();};}function respondWithResult(_0x93fbf2,_0x73ed4b){_0x73ed4b=_0x73ed4b||0xc8;return function(_0x23abce){if(_0x23abce){return _0x93fbf2[_0xb5ce('0x20')](_0x73ed4b)[_0xb5ce('0x22')](_0x23abce);}};}function respondWithFilteredResult(_0x57b30a,_0x270137){return function(_0x122b18){if(_0x122b18){var _0xafa279=typeof _0x270137[_0xb5ce('0x23')]==='undefined'&&typeof _0x270137[_0xb5ce('0x24')]===_0xb5ce('0x25');var _0x1dada4=_0x122b18[_0xb5ce('0x26')];var _0x4b3062=_0xafa279?0x0:_0x270137['offset'];var _0x74b272=_0xafa279?_0x122b18[_0xb5ce('0x26')]:_0x270137[_0xb5ce('0x23')]+_0x270137['limit'];var _0x36a0a9;if(_0x74b272>=_0x1dada4){_0x74b272=_0x1dada4;_0x36a0a9=0xc8;}else{_0x36a0a9=0xce;}_0x57b30a[_0xb5ce('0x20')](_0x36a0a9);return _0x57b30a[_0xb5ce('0x27')](_0xb5ce('0x28'),_0x4b3062+'-'+_0x74b272+'/'+_0x1dada4)[_0xb5ce('0x22')](_0x122b18);}return null;};}function patchUpdates(_0x427b13){return function(_0x29fb8d){try{jsonpatch[_0xb5ce('0x29')](_0x29fb8d,_0x427b13,!![]);}catch(_0x7542b0){return BPromise[_0xb5ce('0x2a')](_0x7542b0);}return _0x29fb8d[_0xb5ce('0x2b')]();};}function saveUpdates(_0x3990b5,_0x45c11b){return function(_0x20c417){if(_0x20c417){return _0x20c417[_0xb5ce('0x2c')](_0x3990b5)[_0xb5ce('0x2d')](function(_0x22d928){return _0x22d928;});}return null;};}function removeEntity(_0x4f44fe,_0x5ceb90){return function(_0x1fb5af){if(_0x1fb5af){return _0x1fb5af[_0xb5ce('0x2e')]()[_0xb5ce('0x2d')](function(){var _0x14835e=_0x1fb5af['get']({'plain':!![]});var _0x2d250e='Teams';return db['UserProfileResource'][_0xb5ce('0x2e')]({'where':{'type':_0x2d250e,'resourceId':_0x14835e['id']}})[_0xb5ce('0x2d')](function(){return _0x1fb5af;});})[_0xb5ce('0x2d')](function(){_0x4f44fe[_0xb5ce('0x20')](0xcc)[_0xb5ce('0x21')]();});}};}function handleEntityNotFound(_0x456d75,_0x164100){return function(_0x4ba0bf){if(!_0x4ba0bf){_0x456d75[_0xb5ce('0x2f')](0x194);}return _0x4ba0bf;};}function handleError(_0x4f0062,_0x486468){_0x486468=_0x486468||0x1f4;return function(_0x35b391){logger[_0xb5ce('0x30')](_0x35b391['stack']);if(_0x35b391[_0xb5ce('0x31')]){delete _0x35b391[_0xb5ce('0x31')];}_0x4f0062[_0xb5ce('0x20')](_0x486468)[_0xb5ce('0x32')](_0x35b391);};}exports[_0xb5ce('0x33')]=function(_0x694547,_0x597165){var _0x3dd28f={},_0x1f2420={},_0x413806={'count':0x0,'rows':[]};var _0x11fd11=_[_0xb5ce('0x34')](db['Team'][_0xb5ce('0x35')],function(_0x1722ab){return{'name':_0x1722ab[_0xb5ce('0x36')],'type':_0x1722ab['type'][_0xb5ce('0x37')]};});_0x1f2420[_0xb5ce('0x38')]=_[_0xb5ce('0x34')](_0x11fd11,_0xb5ce('0x31'));_0x1f2420['query']=_['keys'](_0x694547[_0xb5ce('0x39')]);_0x1f2420['filters']=_[_0xb5ce('0x3a')](_0x1f2420[_0xb5ce('0x38')],_0x1f2420['query']);_0x3dd28f[_0xb5ce('0x3b')]=_[_0xb5ce('0x3a')](_0x1f2420['model'],qs['fields'](_0x694547['query'][_0xb5ce('0x3c')]));_0x3dd28f[_0xb5ce('0x3b')]=_0x3dd28f[_0xb5ce('0x3b')]['length']?_0x3dd28f[_0xb5ce('0x3b')]:_0x1f2420['model'];if(!_0x694547[_0xb5ce('0x39')][_0xb5ce('0x3d')](_0xb5ce('0x3e'))){_0x3dd28f[_0xb5ce('0x24')]=qs[_0xb5ce('0x24')](_0x694547['query'][_0xb5ce('0x24')]);_0x3dd28f[_0xb5ce('0x23')]=qs['offset'](_0x694547[_0xb5ce('0x39')][_0xb5ce('0x23')]);}_0x3dd28f['order']=qs[_0xb5ce('0x3f')](_0x694547[_0xb5ce('0x39')][_0xb5ce('0x3f')]);_0x3dd28f[_0xb5ce('0x40')]=qs[_0xb5ce('0x41')](_[_0xb5ce('0x42')](_0x694547[_0xb5ce('0x39')],_0x1f2420['filters']),_0x11fd11);if(_0x694547['query'][_0xb5ce('0x43')]){_0x3dd28f[_0xb5ce('0x40')]=_[_0xb5ce('0x44')](_0x3dd28f[_0xb5ce('0x40')],{'$or':_[_0xb5ce('0x34')](_0x11fd11,function(_0x5e1b1e){if(_0x5e1b1e[_0xb5ce('0x45')]!=='VIRTUAL'){var _0x549d41={};_0x549d41[_0x5e1b1e[_0xb5ce('0x31')]]={'$like':'%'+_0x694547[_0xb5ce('0x39')][_0xb5ce('0x43')]+'%'};return _0x549d41;}})});}_0x3dd28f=_[_0xb5ce('0x44')]({},_0x3dd28f,_0x694547['options']);var _0x49cce9={'where':_0x3dd28f[_0xb5ce('0x40')]};return db['Team']['count'](_0x49cce9)['then'](function(_0x266472){_0x413806['count']=_0x266472;if(_0x694547[_0xb5ce('0x39')]['includeAll']){_0x3dd28f[_0xb5ce('0x46')]=[{'all':!![]}];}return db[_0xb5ce('0x47')][_0xb5ce('0x48')](_0x3dd28f);})[_0xb5ce('0x2d')](function(_0x3961d7){_0x413806[_0xb5ce('0x49')]=_0x3961d7;return _0x413806;})[_0xb5ce('0x2d')](respondWithFilteredResult(_0x597165,_0x3dd28f))[_0xb5ce('0x4a')](handleError(_0x597165,null));};exports[_0xb5ce('0x4b')]=function(_0x5ef6f1,_0x33742b){var _0x2fe0d9={'raw':![],'where':{'id':_0x5ef6f1[_0xb5ce('0x4c')]['id']}},_0x586580={};_0x586580['model']=_[_0xb5ce('0x4d')](db[_0xb5ce('0x47')][_0xb5ce('0x35')]);_0x586580[_0xb5ce('0x39')]=_[_0xb5ce('0x4d')](_0x5ef6f1[_0xb5ce('0x39')]);_0x586580[_0xb5ce('0x41')]=_[_0xb5ce('0x3a')](_0x586580[_0xb5ce('0x38')],_0x586580[_0xb5ce('0x39')]);_0x2fe0d9[_0xb5ce('0x3b')]=_[_0xb5ce('0x3a')](_0x586580[_0xb5ce('0x38')],qs[_0xb5ce('0x3c')](_0x5ef6f1[_0xb5ce('0x39')][_0xb5ce('0x3c')]));_0x2fe0d9['attributes']=_0x2fe0d9[_0xb5ce('0x3b')][_0xb5ce('0x4e')]?_0x2fe0d9['attributes']:_0x586580[_0xb5ce('0x38')];if(_0x5ef6f1[_0xb5ce('0x39')][_0xb5ce('0x4f')]){_0x2fe0d9[_0xb5ce('0x46')]=[{'all':!![]}];}_0x2fe0d9=_[_0xb5ce('0x44')]({},_0x2fe0d9,_0x5ef6f1[_0xb5ce('0x50')]);return db['Team'][_0xb5ce('0x51')](_0x2fe0d9)[_0xb5ce('0x2d')](handleEntityNotFound(_0x33742b,null))[_0xb5ce('0x2d')](respondWithResult(_0x33742b,null))[_0xb5ce('0x4a')](handleError(_0x33742b,null));};exports['create']=function(_0x3f733f,_0x1ee8a1){return db[_0xb5ce('0x47')][_0xb5ce('0x52')](_0x3f733f[_0xb5ce('0x53')],{})[_0xb5ce('0x2d')](function(_0x448aae){var _0x2317e9=_0x3f733f[_0xb5ce('0x54')][_0xb5ce('0x55')]({'plain':!![]});if(!_0x2317e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2317e9['role']===_0xb5ce('0x54')){var _0x47d07a=_0x448aae[_0xb5ce('0x55')]({'plain':!![]});var _0x5682c7=_0xb5ce('0x56');return db[_0xb5ce('0x57')][_0xb5ce('0x51')]({'where':{'name':_0x5682c7,'userProfileId':_0x2317e9[_0xb5ce('0x58')]},'raw':!![]})[_0xb5ce('0x2d')](function(_0x3b0426){if(_0x3b0426&&_0x3b0426[_0xb5ce('0x59')]===0x0){return db['UserProfileResource'][_0xb5ce('0x52')]({'name':_0x47d07a[_0xb5ce('0x31')],'resourceId':_0x47d07a['id'],'type':_0x3b0426['name'],'sectionId':_0x3b0426['id']},{})[_0xb5ce('0x2d')](function(){return _0x448aae;});}else{return _0x448aae;}})[_0xb5ce('0x4a')](function(_0x39e667){logger[_0xb5ce('0x30')](_0xb5ce('0x5a'),_0x39e667);throw _0x39e667;});}return _0x448aae;})[_0xb5ce('0x2d')](respondWithResult(_0x1ee8a1,0xc9))[_0xb5ce('0x4a')](handleError(_0x1ee8a1,null));};exports[_0xb5ce('0x2c')]=function(_0x5874f1,_0x3323d3){if(_0x5874f1[_0xb5ce('0x53')]['id']){delete _0x5874f1[_0xb5ce('0x53')]['id'];}return db[_0xb5ce('0x47')][_0xb5ce('0x51')]({'where':{'id':_0x5874f1[_0xb5ce('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3323d3,null))[_0xb5ce('0x2d')](saveUpdates(_0x5874f1[_0xb5ce('0x53')],null))[_0xb5ce('0x2d')](respondWithResult(_0x3323d3,null))['catch'](handleError(_0x3323d3,null));};exports['destroy']=function(_0x134e73,_0x2a3868){return db['Team'][_0xb5ce('0x51')]({'where':{'id':_0x134e73[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x2a3868,null))[_0xb5ce('0x2d')](removeEntity(_0x2a3868,null))[_0xb5ce('0x4a')](handleError(_0x2a3868,null));};exports[_0xb5ce('0x5b')]=function(_0x1e2567,_0x320e02,_0x2ff9f4){return db[_0xb5ce('0x47')][_0xb5ce('0x5c')]({'where':{'id':_0x1e2567[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x320e02,null))[_0xb5ce('0x2d')](function(_0x4daf3b){if(!_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x5d')]||!utils[_0xb5ce('0x5e')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x5d')])){throw new db[(_0xb5ce('0x5f'))][(_0xb5ce('0x60'))]('Unknown\x20channel');}var _0xddfff3={};var _0x29d58f={};_0x29d58f[_0xb5ce('0x38')]=_[_0xb5ce('0x4d')](db[_[_0xb5ce('0x61')](_0x1e2567[_0xb5ce('0x39')]['channel'][_0xb5ce('0x62')]())+_0xb5ce('0x63')]['rawAttributes']);_0x29d58f['query']=_[_0xb5ce('0x4d')](_0x1e2567['query']);_0x29d58f[_0xb5ce('0x41')]=_['intersection'](_0x29d58f[_0xb5ce('0x38')],_0x29d58f[_0xb5ce('0x39')]);_0xddfff3[_0xb5ce('0x3b')]=_[_0xb5ce('0x3a')](_0x29d58f['model'],qs[_0xb5ce('0x3c')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x3c')]));_0xddfff3[_0xb5ce('0x3b')]=_0xddfff3['attributes']['length']?_0xddfff3[_0xb5ce('0x3b')]:_0x29d58f[_0xb5ce('0x38')];_0xddfff3[_0xb5ce('0x24')]=qs[_0xb5ce('0x24')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x24')]);_0xddfff3['offset']=qs[_0xb5ce('0x23')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x23')]);_0xddfff3[_0xb5ce('0x64')]=qs[_0xb5ce('0x3f')](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x3f')]);_0xddfff3[_0xb5ce('0x40')]=qs['filters'](_[_0xb5ce('0x42')](_0x1e2567['query'],_0x29d58f[_0xb5ce('0x41')]));_0xddfff3=_['merge']({},_0xddfff3,_0x1e2567['options']);return _0x4daf3b['get'+_['capitalize'](_0x1e2567[_0xb5ce('0x39')][_0xb5ce('0x5d')][_0xb5ce('0x62')]())+'Queues'](_0xddfff3);})[_0xb5ce('0x2d')](respondWithResult(_0x320e02,null))['catch'](handleError(_0x320e02,null));};exports[_0xb5ce('0x65')]=function(_0x3ea258,_0x22ffdb,_0x1e28a7){return db['Team']['findOne']({'where':{'id':_0x3ea258[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](function(_0x435186){if(_0x435186){if(!_0x3ea258[_0xb5ce('0x53')]['channel']||!utils[_0xb5ce('0x5e')](_0x3ea258[_0xb5ce('0x53')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xb5ce('0x66'));}return _0x435186[_0xb5ce('0x67')+_[_0xb5ce('0x61')](_0x3ea258[_0xb5ce('0x53')][_0xb5ce('0x5d')][_0xb5ce('0x62')]())+_0xb5ce('0x68')](_0x3ea258[_0xb5ce('0x53')]['ids']);}return null;})[_0xb5ce('0x2d')](handleEntityNotFound(_0x22ffdb,null))[_0xb5ce('0x2d')](respondWithStatusCode(_0x22ffdb,null))['catch'](handleError(_0x22ffdb,null));};exports[_0xb5ce('0x69')]=function(_0x43dbe2,_0xe6109a,_0x319a9e){return db[_0xb5ce('0x47')][_0xb5ce('0x5c')]({'where':{'id':_0x43dbe2[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](function(_0x2e7e3d){if(_0x2e7e3d){if(!_0x43dbe2['query'][_0xb5ce('0x5d')]||!utils['isValidChannel'](_0x43dbe2[_0xb5ce('0x39')][_0xb5ce('0x5d')])){throw new db[(_0xb5ce('0x5f'))][(_0xb5ce('0x60'))](_0xb5ce('0x66'));}return _0x2e7e3d[_0xb5ce('0x6a')+_[_0xb5ce('0x61')](_0x43dbe2[_0xb5ce('0x39')]['channel']['toLowerCase']())+_0xb5ce('0x68')](_0x43dbe2['query'][_0xb5ce('0x6b')]);}return null;})[_0xb5ce('0x2d')](handleEntityNotFound(_0xe6109a,null))[_0xb5ce('0x2d')](respondWithStatusCode(_0xe6109a,null))['catch'](handleError(_0xe6109a,null));};exports[_0xb5ce('0x6c')]=function(_0x6d5666,_0x3e4d89){return db['Team'][_0xb5ce('0x51')]({'where':{'id':_0x6d5666[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x3e4d89,null))[_0xb5ce('0x2d')](function(_0x5ab28a){if(_0x5ab28a){var _0x3525d5=[_0xb5ce('0x6d'),_0xb5ce('0x6e'),_0xb5ce('0x6f'),_0xb5ce('0x70'),_0xb5ce('0x71'),_0xb5ce('0x72'),'Whatsapp'];return db['sequelize'][_0xb5ce('0x73')](function(_0x13872f){var _0x30504d=_[_0xb5ce('0x34')](_0x3525d5,function(_0x4a491c){var _0xe8e931={'attributes':['id',_0xb5ce('0x31')]};if(_0x4a491c==='Voice'){_0xe8e931[_0xb5ce('0x74')]={'attributes':['penalty']};}return _0x5ab28a[_0xb5ce('0x55')+_0x4a491c+_0xb5ce('0x68')](_0xe8e931)['then'](function(_0x46838c){var _0x585393=_['map'](_0x46838c,function(_0x52de7c){var _0x3e2282=_['map'](_0x6d5666[_0xb5ce('0x53')][_0xb5ce('0x6b')],function(_0x6f9cb3){var _0x26725e={'where':{'UserId':_0x6f9cb3,[_0x4a491c+_0xb5ce('0x75')]:_0x52de7c['id']},'transaction':_0x13872f};if(_0x4a491c===_0xb5ce('0x6d')){_0x26725e['defaults']={'penalty':_0x52de7c[_0xb5ce('0x76')][_0xb5ce('0x77')]};}return db[_0xb5ce('0x78')+_0x4a491c+_0xb5ce('0x63')][_0xb5ce('0x79')](_0x26725e)[_0xb5ce('0x2d')](function(){socket[_0xb5ce('0x7a')](_0xb5ce('0x54')+_0x4a491c+_0xb5ce('0x7b'),{'UserId':_0x6f9cb3,[_0x4a491c+_0xb5ce('0x75')]:_0x52de7c['id']});if(_0x4a491c!=='Voice')return;return db[_0xb5ce('0x78')][_0xb5ce('0x48')]({'where':{'id':_0x6d5666[_0xb5ce('0x53')][_0xb5ce('0x6b')],'online':0x1},'attributes':['id',_0xb5ce('0x31'),_0xb5ce('0x7c'),_0xb5ce('0x7d'),_0xb5ce('0x7e')],'raw':!![]})['then'](function(_0x30179a){var _0x250d0b=_['map'](_0x30179a,function(_0x37782a){return db[_0xb5ce('0x7f')][_0xb5ce('0x80')]({'membername':_0x37782a[_0xb5ce('0x31')],'UserId':_0x37782a['id'],'queue_name':_0x52de7c[_0xb5ce('0x31')],'VoiceQueueId':_0x52de7c['id'],'interface':_['isNil'](_0x37782a[_0xb5ce('0x7e')])?util[_0xb5ce('0x81')](_0xb5ce('0x82'),_0x37782a[_0xb5ce('0x31')]):_0x37782a[_0xb5ce('0x7e')],'paused':_0x37782a['voicePause']||![],'penalty':_0x52de7c['TeamVoiceQueue'][_0xb5ce('0x77')]},{'transaction':_0x13872f});});return Promise[_0xb5ce('0x83')](_0x250d0b);});});});return Promise[_0xb5ce('0x83')](_0x3e2282);});return Promise['all'](_0x585393);});});return Promise[_0xb5ce('0x83')](_0x30504d)[_0xb5ce('0x2d')](function(){return _0x5ab28a[_0xb5ce('0x6c')](_0x6d5666[_0xb5ce('0x53')][_0xb5ce('0x6b')],{'transaction':_0x13872f})['spread'](function(_0x378e08){return _0x378e08;});});});}})[_0xb5ce('0x2d')](respondWithResult(_0x3e4d89,null))[_0xb5ce('0x4a')](handleError(_0x3e4d89,null));};exports['removeAgents']=function(_0x26f80f,_0x242e4f){return db['Team'][_0xb5ce('0x51')]({'where':{'id':_0x26f80f['params']['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x242e4f,null))[_0xb5ce('0x2d')](function(_0x1ee0fd){if(_0x1ee0fd){var _0xd9f2d3=[_0xb5ce('0x6d'),'Chat',_0xb5ce('0x6f'),'Sms',_0xb5ce('0x71'),_0xb5ce('0x72'),_0xb5ce('0x84')];return db[_0xb5ce('0x85')][_0xb5ce('0x73')](function(_0x208e59){var _0x3c67e2=_['map'](_0xd9f2d3,function(_0x14594e){var _0xe14d78={'attributes':['id',_0xb5ce('0x31')]};return _0x1ee0fd[_0xb5ce('0x55')+_0x14594e+'Queues'](_0xe14d78)[_0xb5ce('0x2d')](function(_0x2c3207){var _0x443fca=_[_0xb5ce('0x34')](_0x2c3207,function(_0x33b811){return _0x33b811[_0xb5ce('0x86')](_0x26f80f['query'][_0xb5ce('0x6b')],{'transaction':_0x208e59})[_0xb5ce('0x2d')](function(){var _0x1c641a=JSON[_0xb5ce('0x87')]('['+_0x26f80f[_0xb5ce('0x39')][_0xb5ce('0x6b')]+']');var _0x3353e3=_['map'](_0x1c641a,function(_0x1545f4){socket[_0xb5ce('0x7a')]('user'+_0x14594e+_0xb5ce('0x88'),{'UserId':Number(_0x1545f4),[_0x14594e+'QueueId']:_0x33b811['id']});if(_0x14594e!==_0xb5ce('0x6d'))return;return db[_0xb5ce('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x33b811['id'],'UserId':_0x1545f4},'transaction':_0x208e59});});return Promise[_0xb5ce('0x83')](_0x3353e3);});});return Promise[_0xb5ce('0x83')](_0x443fca);});});return Promise['all'](_0x3c67e2)[_0xb5ce('0x2d')](function(){return _0x1ee0fd[_0xb5ce('0x86')](_0x26f80f['query'][_0xb5ce('0x6b')],{'transaction':_0x208e59});});});}})[_0xb5ce('0x2d')](respondWithStatusCode(_0x242e4f,null))['catch'](handleError(_0x242e4f,null));};exports[_0xb5ce('0x89')]=function(_0x35f357,_0x2495a5,_0x3c214b){var _0x12056f={};var _0xf1aa5c={};var _0x4b63a6;var _0x3c6e0b;return db['Team'][_0xb5ce('0x5c')]({'where':{'id':_0x35f357[_0xb5ce('0x4c')]['id']}})[_0xb5ce('0x2d')](handleEntityNotFound(_0x2495a5,null))[_0xb5ce('0x2d')](function(_0x10c9be){if(_0x10c9be){_0x4b63a6=_0x10c9be;_0xf1aa5c['model']=_['keys'](db[_0xb5ce('0x78')][_0xb5ce('0x35')]);_0xf1aa5c[_0xb5ce('0x39')]=_[_0xb5ce('0x4d')](_0x35f357[_0xb5ce('0x39')]);_0xf1aa5c[_0xb5ce('0x41')]=_[_0xb5ce('0x3a')](_0xf1aa5c[_0xb5ce('0x38')],_0xf1aa5c[_0xb5ce('0x39')]);_0x12056f[_0xb5ce('0x3b')]=_[_0xb5ce('0x3a')](_0xf1aa5c[_0xb5ce('0x38')],qs['fields'](_0x35f357[_0xb5ce('0x39')][_0xb5ce('0x3c')]));_0x12056f['attributes']=_0x12056f[_0xb5ce('0x3b')]['length']?_0x12056f[_0xb5ce('0x3b')]:_0xf1aa5c['model'];_0x12056f['order']=qs[_0xb5ce('0x3f')](_0x35f357[_0xb5ce('0x39')]['sort']);_0x12056f[_0xb5ce('0x40')]=qs[_0xb5ce('0x41')](_[_0xb5ce('0x42')](_0x35f357[_0xb5ce('0x39')],_0xf1aa5c[_0xb5ce('0x41')]));if(_0x35f357[_0xb5ce('0x39')][_0xb5ce('0x43')]){_0x12056f[_0xb5ce('0x40')]=_['merge'](_0x12056f[_0xb5ce('0x40')],{'$or':_[_0xb5ce('0x34')](_0x12056f['attributes'],function(_0x563cc7){var _0x427d90={};_0x427d90[_0x563cc7]={'$like':'%'+_0x35f357['query'][_0xb5ce('0x43')]+'%'};return _0x427d90;})});}_0x12056f=_['merge']({},_0x12056f,_0x35f357[_0xb5ce('0x50')]);return _0x4b63a6['getAgents'](_0x12056f);}})['then'](function(_0x2bf8da){if(_0x2bf8da){_0x3c6e0b=_0x2bf8da[_0xb5ce('0x4e')];if(!_0x35f357['query'][_0xb5ce('0x3d')]('nolimit')){_0x12056f[_0xb5ce('0x24')]=qs[_0xb5ce('0x24')](_0x35f357['query'][_0xb5ce('0x24')]);_0x12056f[_0xb5ce('0x23')]=qs[_0xb5ce('0x23')](_0x35f357[_0xb5ce('0x39')][_0xb5ce('0x23')]);}return _0x4b63a6[_0xb5ce('0x89')](_0x12056f);}})[_0xb5ce('0x2d')](function(_0x5f38da){if(_0x5f38da){return _0x5f38da?{'count':_0x3c6e0b,'rows':_0x5f38da}:null;}})[_0xb5ce('0x2d')](respondWithResult(_0x2495a5,null))[_0xb5ce('0x4a')](handleError(_0x2495a5,null));}; \ No newline at end of file +var _0xb53b=['index','map','Team','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','rows','catch','show','length','find','create','body','user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','toLowerCase','capitalize','addQueues','add','Queues','ids','remove','addAgents','Chat','Mail','Sms','Whatsapp','sequelize','transaction','Voice','through','penalty','QueueId','User','Queue','findOrCreate','findAll','online','UserVoiceQueueRt','interface','format','SIP/%s','voicePause','TeamVoiceQueue','all','Fax','Openchannel','removeAgents','parse','emit','Queue:remove','getAgents','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','get','destroy','stack','name','send'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0xb53b,0xd6));var _0xbb53=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xb53b[_0x49c057];return _0xd8f0e6;};'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(_0xbb53('0x0'));var BPromise=require(_0xbb53('0x1'));var Mustache=require(_0xbb53('0x2'));var util=require(_0xbb53('0x3'));var path=require(_0xbb53('0x4'));var sox=require(_0xbb53('0x5'));var csv=require(_0xbb53('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb53('0x7'));var _=require(_0xbb53('0x8'));var squel=require(_0xbb53('0x9'));var crypto=require(_0xbb53('0xa'));var jsforce=require(_0xbb53('0xb'));var deskjs=require(_0xbb53('0xc'));var toCsv=require(_0xbb53('0x6'));var querystring=require(_0xbb53('0xd'));var Papa=require('papaparse');var Redis=require(_0xbb53('0xe'));var authService=require(_0xbb53('0xf'));var qs=require(_0xbb53('0x10'));var as=require(_0xbb53('0x11'));var hardwareService=require(_0xbb53('0x12'));var logger=require(_0xbb53('0x13'))('api');var utils=require(_0xbb53('0x14'));var config=require(_0xbb53('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbb53('0x16')]=_[_0xbb53('0x17')](config[_0xbb53('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb53('0x18'))(new Redis(config[_0xbb53('0x16')]));require('./team.socket')[_0xbb53('0x19')](socket);function respondWithStatusCode(_0x3c5d63,_0x1d2576){_0x1d2576=_0x1d2576||0xcc;return function(_0x335b74){if(_0x335b74){return _0x3c5d63[_0xbb53('0x1a')](_0x1d2576);}return _0x3c5d63[_0xbb53('0x1b')](_0x1d2576)[_0xbb53('0x1c')]();};}function respondWithResult(_0x25b434,_0x137f0a){_0x137f0a=_0x137f0a||0xc8;return function(_0xf179dd){if(_0xf179dd){return _0x25b434[_0xbb53('0x1b')](_0x137f0a)[_0xbb53('0x1d')](_0xf179dd);}};}function respondWithFilteredResult(_0x3eb769,_0x1d457a){return function(_0x12629b){if(_0x12629b){var _0x1a9379=typeof _0x1d457a['offset']===_0xbb53('0x1e')&&typeof _0x1d457a['limit']===_0xbb53('0x1e');var _0x21d8ef=_0x12629b[_0xbb53('0x1f')];var _0x1643d5=_0x1a9379?0x0:_0x1d457a[_0xbb53('0x20')];var _0x1f19ae=_0x1a9379?_0x12629b[_0xbb53('0x1f')]:_0x1d457a['offset']+_0x1d457a[_0xbb53('0x21')];var _0x34da4c;if(_0x1f19ae>=_0x21d8ef){_0x1f19ae=_0x21d8ef;_0x34da4c=0xc8;}else{_0x34da4c=0xce;}_0x3eb769['status'](_0x34da4c);return _0x3eb769[_0xbb53('0x22')](_0xbb53('0x23'),_0x1643d5+'-'+_0x1f19ae+'/'+_0x21d8ef)[_0xbb53('0x1d')](_0x12629b);}return null;};}function patchUpdates(_0x280c42){return function(_0x3ffffa){try{jsonpatch[_0xbb53('0x24')](_0x3ffffa,_0x280c42,!![]);}catch(_0x3657c9){return BPromise[_0xbb53('0x25')](_0x3657c9);}return _0x3ffffa['save']();};}function saveUpdates(_0x115351,_0xf35f3){return function(_0x16f8be){if(_0x16f8be){return _0x16f8be['update'](_0x115351)[_0xbb53('0x26')](function(_0x2654cc){return _0x2654cc;});}return null;};}function removeEntity(_0x216356,_0x3e3527){return function(_0x4a7e80){if(_0x4a7e80){return _0x4a7e80['destroy']()['then'](function(){var _0x5bb69a=_0x4a7e80[_0xbb53('0x27')]({'plain':!![]});var _0x5f3b9d='Teams';return db['UserProfileResource'][_0xbb53('0x28')]({'where':{'type':_0x5f3b9d,'resourceId':_0x5bb69a['id']}})[_0xbb53('0x26')](function(){return _0x4a7e80;});})[_0xbb53('0x26')](function(){_0x216356[_0xbb53('0x1b')](0xcc)[_0xbb53('0x1c')]();});}};}function handleEntityNotFound(_0x179673,_0x487a0f){return function(_0x1ffb23){if(!_0x1ffb23){_0x179673[_0xbb53('0x1a')](0x194);}return _0x1ffb23;};}function handleError(_0x2d0aeb,_0x7c3736){_0x7c3736=_0x7c3736||0x1f4;return function(_0x2d1726){logger['error'](_0x2d1726[_0xbb53('0x29')]);if(_0x2d1726[_0xbb53('0x2a')]){delete _0x2d1726[_0xbb53('0x2a')];}_0x2d0aeb[_0xbb53('0x1b')](_0x7c3736)[_0xbb53('0x2b')](_0x2d1726);};}exports[_0xbb53('0x2c')]=function(_0x5236ee,_0x4e8b95){var _0x3ebe91={},_0xa2450c={},_0x55198c={'count':0x0,'rows':[]};var _0x28ce0e=_[_0xbb53('0x2d')](db[_0xbb53('0x2e')][_0xbb53('0x2f')],function(_0x2db492){return{'name':_0x2db492[_0xbb53('0x30')],'type':_0x2db492[_0xbb53('0x31')][_0xbb53('0x32')]};});_0xa2450c[_0xbb53('0x33')]=_['map'](_0x28ce0e,_0xbb53('0x2a'));_0xa2450c['query']=_[_0xbb53('0x34')](_0x5236ee[_0xbb53('0x35')]);_0xa2450c['filters']=_[_0xbb53('0x36')](_0xa2450c['model'],_0xa2450c[_0xbb53('0x35')]);_0x3ebe91[_0xbb53('0x37')]=_[_0xbb53('0x36')](_0xa2450c[_0xbb53('0x33')],qs[_0xbb53('0x38')](_0x5236ee[_0xbb53('0x35')][_0xbb53('0x38')]));_0x3ebe91[_0xbb53('0x37')]=_0x3ebe91[_0xbb53('0x37')]['length']?_0x3ebe91[_0xbb53('0x37')]:_0xa2450c['model'];if(!_0x5236ee[_0xbb53('0x35')][_0xbb53('0x39')](_0xbb53('0x3a'))){_0x3ebe91[_0xbb53('0x21')]=qs[_0xbb53('0x21')](_0x5236ee[_0xbb53('0x35')][_0xbb53('0x21')]);_0x3ebe91[_0xbb53('0x20')]=qs['offset'](_0x5236ee['query'][_0xbb53('0x20')]);}_0x3ebe91[_0xbb53('0x3b')]=qs[_0xbb53('0x3c')](_0x5236ee[_0xbb53('0x35')][_0xbb53('0x3c')]);_0x3ebe91['where']=qs[_0xbb53('0x3d')](_[_0xbb53('0x3e')](_0x5236ee[_0xbb53('0x35')],_0xa2450c[_0xbb53('0x3d')]),_0x28ce0e);if(_0x5236ee['query']['filter']){_0x3ebe91[_0xbb53('0x3f')]=_[_0xbb53('0x40')](_0x3ebe91[_0xbb53('0x3f')],{'$or':_[_0xbb53('0x2d')](_0x28ce0e,function(_0x3041df){if(_0x3041df[_0xbb53('0x31')]!==_0xbb53('0x41')){var _0x2e07c3={};_0x2e07c3[_0x3041df['name']]={'$like':'%'+_0x5236ee[_0xbb53('0x35')][_0xbb53('0x42')]+'%'};return _0x2e07c3;}})});}_0x3ebe91=_[_0xbb53('0x40')]({},_0x3ebe91,_0x5236ee[_0xbb53('0x43')]);var _0x68cc9c={'where':_0x3ebe91[_0xbb53('0x3f')]};return db[_0xbb53('0x2e')]['count'](_0x68cc9c)[_0xbb53('0x26')](function(_0x548b27){_0x55198c[_0xbb53('0x1f')]=_0x548b27;if(_0x5236ee[_0xbb53('0x35')]['includeAll']){_0x3ebe91[_0xbb53('0x44')]=[{'all':!![]}];}return db[_0xbb53('0x2e')]['findAll'](_0x3ebe91);})[_0xbb53('0x26')](function(_0x306f20){_0x55198c[_0xbb53('0x45')]=_0x306f20;return _0x55198c;})[_0xbb53('0x26')](respondWithFilteredResult(_0x4e8b95,_0x3ebe91))[_0xbb53('0x46')](handleError(_0x4e8b95,null));};exports[_0xbb53('0x47')]=function(_0x2390c0,_0x8ba6d7){var _0x1554fb={'raw':![],'where':{'id':_0x2390c0['params']['id']}},_0x1159f7={};_0x1159f7[_0xbb53('0x33')]=_['keys'](db['Team'][_0xbb53('0x2f')]);_0x1159f7[_0xbb53('0x35')]=_[_0xbb53('0x34')](_0x2390c0[_0xbb53('0x35')]);_0x1159f7[_0xbb53('0x3d')]=_[_0xbb53('0x36')](_0x1159f7[_0xbb53('0x33')],_0x1159f7[_0xbb53('0x35')]);_0x1554fb[_0xbb53('0x37')]=_['intersection'](_0x1159f7[_0xbb53('0x33')],qs['fields'](_0x2390c0[_0xbb53('0x35')][_0xbb53('0x38')]));_0x1554fb['attributes']=_0x1554fb[_0xbb53('0x37')][_0xbb53('0x48')]?_0x1554fb[_0xbb53('0x37')]:_0x1159f7[_0xbb53('0x33')];if(_0x2390c0[_0xbb53('0x35')]['includeAll']){_0x1554fb['include']=[{'all':!![]}];}_0x1554fb=_[_0xbb53('0x40')]({},_0x1554fb,_0x2390c0['options']);return db[_0xbb53('0x2e')][_0xbb53('0x49')](_0x1554fb)[_0xbb53('0x26')](handleEntityNotFound(_0x8ba6d7,null))[_0xbb53('0x26')](respondWithResult(_0x8ba6d7,null))[_0xbb53('0x46')](handleError(_0x8ba6d7,null));};exports[_0xbb53('0x4a')]=function(_0x3e3c3e,_0xd972ea){return db[_0xbb53('0x2e')][_0xbb53('0x4a')](_0x3e3c3e[_0xbb53('0x4b')],{})[_0xbb53('0x26')](function(_0x30b995){var _0x2069e1=_0x3e3c3e['user']['get']({'plain':!![]});if(!_0x2069e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2069e1['role']===_0xbb53('0x4c')){var _0x2290c6=_0x30b995[_0xbb53('0x27')]({'plain':!![]});var _0x28abfc=_0xbb53('0x4d');return db[_0xbb53('0x4e')][_0xbb53('0x49')]({'where':{'name':_0x28abfc,'userProfileId':_0x2069e1[_0xbb53('0x4f')]},'raw':!![]})[_0xbb53('0x26')](function(_0x2ccd00){if(_0x2ccd00&&_0x2ccd00[_0xbb53('0x50')]===0x0){return db[_0xbb53('0x51')][_0xbb53('0x4a')]({'name':_0x2290c6[_0xbb53('0x2a')],'resourceId':_0x2290c6['id'],'type':_0x2ccd00[_0xbb53('0x2a')],'sectionId':_0x2ccd00['id']},{})[_0xbb53('0x26')](function(){return _0x30b995;});}else{return _0x30b995;}})['catch'](function(_0x424894){logger[_0xbb53('0x52')](_0xbb53('0x53'),_0x424894);throw _0x424894;});}return _0x30b995;})[_0xbb53('0x26')](respondWithResult(_0xd972ea,0xc9))[_0xbb53('0x46')](handleError(_0xd972ea,null));};exports[_0xbb53('0x54')]=function(_0x44261d,_0x4a7ede){if(_0x44261d['body']['id']){delete _0x44261d[_0xbb53('0x4b')]['id'];}return db['Team'][_0xbb53('0x49')]({'where':{'id':_0x44261d[_0xbb53('0x55')]['id']}})[_0xbb53('0x26')](handleEntityNotFound(_0x4a7ede,null))['then'](saveUpdates(_0x44261d['body'],null))[_0xbb53('0x26')](respondWithResult(_0x4a7ede,null))[_0xbb53('0x46')](handleError(_0x4a7ede,null));};exports[_0xbb53('0x28')]=function(_0xf0c737,_0x49ed79){return db[_0xbb53('0x2e')][_0xbb53('0x49')]({'where':{'id':_0xf0c737['params']['id']}})[_0xbb53('0x26')](handleEntityNotFound(_0x49ed79,null))[_0xbb53('0x26')](removeEntity(_0x49ed79,null))['catch'](handleError(_0x49ed79,null));};exports['getQueues']=function(_0x1d2f83,_0x25efcf,_0x66b894){return db[_0xbb53('0x2e')][_0xbb53('0x56')]({'where':{'id':_0x1d2f83[_0xbb53('0x55')]['id']}})[_0xbb53('0x26')](handleEntityNotFound(_0x25efcf,null))[_0xbb53('0x26')](function(_0xc7a63b){if(!_0x1d2f83[_0xbb53('0x35')][_0xbb53('0x57')]||!utils[_0xbb53('0x58')](_0x1d2f83[_0xbb53('0x35')][_0xbb53('0x57')])){throw new db[(_0xbb53('0x59'))][(_0xbb53('0x5a'))](_0xbb53('0x5b'));}var _0x425b34={};var _0x59dbad={};_0x59dbad[_0xbb53('0x33')]=_['keys'](db[_['capitalize'](_0x1d2f83[_0xbb53('0x35')][_0xbb53('0x57')][_0xbb53('0x5c')]())+'Queue'][_0xbb53('0x2f')]);_0x59dbad['query']=_[_0xbb53('0x34')](_0x1d2f83[_0xbb53('0x35')]);_0x59dbad[_0xbb53('0x3d')]=_[_0xbb53('0x36')](_0x59dbad[_0xbb53('0x33')],_0x59dbad[_0xbb53('0x35')]);_0x425b34[_0xbb53('0x37')]=_['intersection'](_0x59dbad[_0xbb53('0x33')],qs[_0xbb53('0x38')](_0x1d2f83[_0xbb53('0x35')][_0xbb53('0x38')]));_0x425b34[_0xbb53('0x37')]=_0x425b34[_0xbb53('0x37')][_0xbb53('0x48')]?_0x425b34[_0xbb53('0x37')]:_0x59dbad[_0xbb53('0x33')];_0x425b34[_0xbb53('0x21')]=qs[_0xbb53('0x21')](_0x1d2f83[_0xbb53('0x35')][_0xbb53('0x21')]);_0x425b34[_0xbb53('0x20')]=qs[_0xbb53('0x20')](_0x1d2f83[_0xbb53('0x35')][_0xbb53('0x20')]);_0x425b34['order']=qs[_0xbb53('0x3c')](_0x1d2f83[_0xbb53('0x35')]['sort']);_0x425b34[_0xbb53('0x3f')]=qs[_0xbb53('0x3d')](_['pick'](_0x1d2f83[_0xbb53('0x35')],_0x59dbad['filters']));_0x425b34=_[_0xbb53('0x40')]({},_0x425b34,_0x1d2f83[_0xbb53('0x43')]);return _0xc7a63b[_0xbb53('0x27')+_[_0xbb53('0x5d')](_0x1d2f83[_0xbb53('0x35')]['channel'][_0xbb53('0x5c')]())+'Queues'](_0x425b34);})[_0xbb53('0x26')](respondWithResult(_0x25efcf,null))['catch'](handleError(_0x25efcf,null));};exports[_0xbb53('0x5e')]=function(_0x470fb9,_0x5b5870,_0x6ddb16){return db[_0xbb53('0x2e')][_0xbb53('0x56')]({'where':{'id':_0x470fb9[_0xbb53('0x55')]['id']}})[_0xbb53('0x26')](function(_0xb34290){if(_0xb34290){if(!_0x470fb9[_0xbb53('0x4b')][_0xbb53('0x57')]||!utils[_0xbb53('0x58')](_0x470fb9[_0xbb53('0x4b')][_0xbb53('0x57')])){throw new db[(_0xbb53('0x59'))][(_0xbb53('0x5a'))](_0xbb53('0x5b'));}return _0xb34290[_0xbb53('0x5f')+_['capitalize'](_0x470fb9[_0xbb53('0x4b')][_0xbb53('0x57')][_0xbb53('0x5c')]())+_0xbb53('0x60')](_0x470fb9[_0xbb53('0x4b')][_0xbb53('0x61')]);}return null;})['then'](handleEntityNotFound(_0x5b5870,null))['then'](respondWithStatusCode(_0x5b5870,null))[_0xbb53('0x46')](handleError(_0x5b5870,null));};exports['removeQueues']=function(_0x50ea44,_0x54ff4a,_0x2576ad){return db[_0xbb53('0x2e')][_0xbb53('0x56')]({'where':{'id':_0x50ea44[_0xbb53('0x55')]['id']}})[_0xbb53('0x26')](function(_0x3179b2){if(_0x3179b2){if(!_0x50ea44[_0xbb53('0x35')][_0xbb53('0x57')]||!utils[_0xbb53('0x58')](_0x50ea44[_0xbb53('0x35')][_0xbb53('0x57')])){throw new db[(_0xbb53('0x59'))][(_0xbb53('0x5a'))](_0xbb53('0x5b'));}return _0x3179b2[_0xbb53('0x62')+_[_0xbb53('0x5d')](_0x50ea44[_0xbb53('0x35')][_0xbb53('0x57')]['toLowerCase']())+_0xbb53('0x60')](_0x50ea44[_0xbb53('0x35')]['ids']);}return null;})[_0xbb53('0x26')](handleEntityNotFound(_0x54ff4a,null))[_0xbb53('0x26')](respondWithStatusCode(_0x54ff4a,null))[_0xbb53('0x46')](handleError(_0x54ff4a,null));};exports[_0xbb53('0x63')]=function(_0x12ead0,_0x5046d5){return db[_0xbb53('0x2e')][_0xbb53('0x49')]({'where':{'id':_0x12ead0['params']['id']}})[_0xbb53('0x26')](handleEntityNotFound(_0x5046d5,null))[_0xbb53('0x26')](function(_0x4bf636){if(_0x4bf636){var _0xd59ca1=['Voice',_0xbb53('0x64'),_0xbb53('0x65'),_0xbb53('0x66'),'Fax','Openchannel',_0xbb53('0x67')];return db[_0xbb53('0x68')][_0xbb53('0x69')](function(_0xb03c8){var _0x4e245e=_[_0xbb53('0x2d')](_0xd59ca1,function(_0x509a66){var _0x311e7c={'attributes':['id',_0xbb53('0x2a')]};if(_0x509a66===_0xbb53('0x6a')){_0x311e7c[_0xbb53('0x6b')]={'attributes':[_0xbb53('0x6c')]};}return _0x4bf636['get'+_0x509a66+_0xbb53('0x60')](_0x311e7c)[_0xbb53('0x26')](function(_0x4f45c4){var _0x2f0710=_['map'](_0x4f45c4,function(_0x4855d2){var _0x41ea2c=_['map'](_0x12ead0[_0xbb53('0x4b')][_0xbb53('0x61')],function(_0x50c41c){var _0x291428={'where':{'UserId':_0x50c41c,[_0x509a66+_0xbb53('0x6d')]:_0x4855d2['id']},'transaction':_0xb03c8};if(_0x509a66===_0xbb53('0x6a')){_0x291428[_0xbb53('0x17')]={'penalty':_0x4855d2['TeamVoiceQueue'][_0xbb53('0x6c')]};}return db[_0xbb53('0x6e')+_0x509a66+_0xbb53('0x6f')][_0xbb53('0x70')](_0x291428)[_0xbb53('0x26')](function(){socket['emit'](_0xbb53('0x4c')+_0x509a66+'Queue:save',{'UserId':_0x50c41c,[_0x509a66+'QueueId']:_0x4855d2['id']});if(_0x509a66!==_0xbb53('0x6a'))return;return db['User'][_0xbb53('0x71')]({'where':{'id':_0x12ead0[_0xbb53('0x4b')][_0xbb53('0x61')],'online':0x1},'attributes':['id',_0xbb53('0x2a'),_0xbb53('0x72'),'voicePause','interface'],'raw':!![]})['then'](function(_0x4822ea){var _0x5ae9d9=_[_0xbb53('0x2d')](_0x4822ea,function(_0x3c20b0){return db[_0xbb53('0x73')]['upsert']({'membername':_0x3c20b0[_0xbb53('0x2a')],'UserId':_0x3c20b0['id'],'queue_name':_0x4855d2[_0xbb53('0x2a')],'VoiceQueueId':_0x4855d2['id'],'interface':_['isNil'](_0x3c20b0[_0xbb53('0x74')])?util[_0xbb53('0x75')](_0xbb53('0x76'),_0x3c20b0[_0xbb53('0x2a')]):_0x3c20b0[_0xbb53('0x74')],'paused':_0x3c20b0[_0xbb53('0x77')]||![],'penalty':_0x4855d2[_0xbb53('0x78')]['penalty']},{'transaction':_0xb03c8});});return Promise[_0xbb53('0x79')](_0x5ae9d9);});});});return Promise['all'](_0x41ea2c);});return Promise[_0xbb53('0x79')](_0x2f0710);});});return Promise['all'](_0x4e245e)[_0xbb53('0x26')](function(){return _0x4bf636[_0xbb53('0x63')](_0x12ead0[_0xbb53('0x4b')][_0xbb53('0x61')],{'transaction':_0xb03c8})['spread'](function(_0x263025){return _0x263025;});});});}})[_0xbb53('0x26')](respondWithResult(_0x5046d5,null))[_0xbb53('0x46')](handleError(_0x5046d5,null));};exports['removeAgents']=function(_0x3be7b6,_0x502065){return db['Team'][_0xbb53('0x49')]({'where':{'id':_0x3be7b6[_0xbb53('0x55')]['id']}})[_0xbb53('0x26')](handleEntityNotFound(_0x502065,null))['then'](function(_0x4bd6cd){if(_0x4bd6cd){var _0xdf4b37=[_0xbb53('0x6a'),'Chat',_0xbb53('0x65'),_0xbb53('0x66'),_0xbb53('0x7a'),_0xbb53('0x7b'),_0xbb53('0x67')];return db[_0xbb53('0x68')][_0xbb53('0x69')](function(_0x28f3fa){var _0x1eae42=_[_0xbb53('0x2d')](_0xdf4b37,function(_0x1d2d4f){var _0x726c0f={'attributes':['id',_0xbb53('0x2a')]};return _0x4bd6cd['get'+_0x1d2d4f+_0xbb53('0x60')](_0x726c0f)['then'](function(_0x5f1a1f){var _0x364609=_[_0xbb53('0x2d')](_0x5f1a1f,function(_0x3a123d){return _0x3a123d[_0xbb53('0x7c')](_0x3be7b6[_0xbb53('0x35')]['ids'],{'transaction':_0x28f3fa})['then'](function(){var _0x25dd6b=JSON[_0xbb53('0x7d')]('['+_0x3be7b6['query'][_0xbb53('0x61')]+']');var _0xf8d7e7=_[_0xbb53('0x2d')](_0x25dd6b,function(_0x37f0d6){socket[_0xbb53('0x7e')](_0xbb53('0x4c')+_0x1d2d4f+_0xbb53('0x7f'),{'UserId':Number(_0x37f0d6),[_0x1d2d4f+'QueueId']:_0x3a123d['id']});if(_0x1d2d4f!==_0xbb53('0x6a'))return;return db[_0xbb53('0x73')][_0xbb53('0x28')]({'where':{'VoiceQueueId':_0x3a123d['id'],'UserId':_0x37f0d6},'transaction':_0x28f3fa});});return Promise[_0xbb53('0x79')](_0xf8d7e7);});});return Promise['all'](_0x364609);});});return Promise[_0xbb53('0x79')](_0x1eae42)['then'](function(){return _0x4bd6cd[_0xbb53('0x7c')](_0x3be7b6[_0xbb53('0x35')][_0xbb53('0x61')],{'transaction':_0x28f3fa});});});}})[_0xbb53('0x26')](respondWithStatusCode(_0x502065,null))[_0xbb53('0x46')](handleError(_0x502065,null));};exports[_0xbb53('0x80')]=function(_0x20842c,_0xa607f,_0x428941){var _0x6057d3={};var _0x509dd0={};var _0x16adef;var _0x2bea4d;return db[_0xbb53('0x2e')][_0xbb53('0x56')]({'where':{'id':_0x20842c['params']['id']}})[_0xbb53('0x26')](handleEntityNotFound(_0xa607f,null))[_0xbb53('0x26')](function(_0x5a1c03){if(_0x5a1c03){_0x16adef=_0x5a1c03;_0x509dd0['model']=_['keys'](db[_0xbb53('0x6e')]['rawAttributes']);_0x509dd0[_0xbb53('0x35')]=_['keys'](_0x20842c[_0xbb53('0x35')]);_0x509dd0[_0xbb53('0x3d')]=_['intersection'](_0x509dd0[_0xbb53('0x33')],_0x509dd0['query']);_0x6057d3[_0xbb53('0x37')]=_[_0xbb53('0x36')](_0x509dd0[_0xbb53('0x33')],qs[_0xbb53('0x38')](_0x20842c[_0xbb53('0x35')][_0xbb53('0x38')]));_0x6057d3[_0xbb53('0x37')]=_0x6057d3[_0xbb53('0x37')][_0xbb53('0x48')]?_0x6057d3[_0xbb53('0x37')]:_0x509dd0[_0xbb53('0x33')];_0x6057d3[_0xbb53('0x3b')]=qs['sort'](_0x20842c[_0xbb53('0x35')]['sort']);_0x6057d3[_0xbb53('0x3f')]=qs[_0xbb53('0x3d')](_['pick'](_0x20842c['query'],_0x509dd0[_0xbb53('0x3d')]));if(_0x20842c[_0xbb53('0x35')][_0xbb53('0x42')]){_0x6057d3[_0xbb53('0x3f')]=_[_0xbb53('0x40')](_0x6057d3['where'],{'$or':_[_0xbb53('0x2d')](_0x6057d3[_0xbb53('0x37')],function(_0x49b29d){var _0x21994a={};_0x21994a[_0x49b29d]={'$like':'%'+_0x20842c['query'][_0xbb53('0x42')]+'%'};return _0x21994a;})});}_0x6057d3=_[_0xbb53('0x40')]({},_0x6057d3,_0x20842c['options']);return _0x16adef['getAgents'](_0x6057d3);}})['then'](function(_0x2075b5){if(_0x2075b5){_0x2bea4d=_0x2075b5['length'];if(!_0x20842c[_0xbb53('0x35')][_0xbb53('0x39')](_0xbb53('0x3a'))){_0x6057d3['limit']=qs[_0xbb53('0x21')](_0x20842c[_0xbb53('0x35')][_0xbb53('0x21')]);_0x6057d3['offset']=qs['offset'](_0x20842c['query'][_0xbb53('0x20')]);}return _0x16adef[_0xbb53('0x80')](_0x6057d3);}})['then'](function(_0x4ae245){if(_0x4ae245){return _0x4ae245?{'count':_0x2bea4d,'rows':_0x4ae245}:null;}})[_0xbb53('0x26')](respondWithResult(_0xa607f,null))[_0xbb53('0x46')](handleError(_0xa607f,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index e34d261..4beff18 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 _0xe0bd=['update','remove','emit','hook','exports','events','../../mysqldb','Team','save'];(function(_0xbf9125,_0x1f3275){var _0x58475c=function(_0xd3004b){while(--_0xd3004b){_0xbf9125['push'](_0xbf9125['shift']());}};_0x58475c(++_0x1f3275);}(_0xe0bd,0x12e));var _0xde0b=function(_0x38de33,_0x4361bb){_0x38de33=_0x38de33-0x0;var _0x40f16d=_0xe0bd[_0x38de33];return _0x40f16d;};'use strict';var EventEmitter=require(_0xde0b('0x0'));var Team=require(_0xde0b('0x1'))['db'][_0xde0b('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xde0b('0x3'),'afterUpdate':_0xde0b('0x4'),'afterDestroy':_0xde0b('0x5')};function emitEvent(_0xc31934){return function(_0x14c924,_0x536fc2,_0x1f60f3){TeamEvents[_0xde0b('0x6')](_0xc31934+':'+_0x14c924['id'],_0x14c924);TeamEvents[_0xde0b('0x6')](_0xc31934,_0x14c924);_0x1f60f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xde0b('0x7')](e,emitEvent(event));}}module[_0xde0b('0x8')]=TeamEvents; \ No newline at end of file +var _0x922d=['emit','../../mysqldb','Team','setMaxListeners','save','remove'];(function(_0x14adfc,_0x2f05fa){var _0x384191=function(_0x33085a){while(--_0x33085a){_0x14adfc['push'](_0x14adfc['shift']());}};_0x384191(++_0x2f05fa);}(_0x922d,0xaf));var _0xd922=function(_0x631151,_0x8a07c8){_0x631151=_0x631151-0x0;var _0x42bf35=_0x922d[_0x631151];return _0x42bf35;};'use strict';var EventEmitter=require('events');var Team=require(_0xd922('0x0'))['db'][_0xd922('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xd922('0x2')](0x0);var events={'afterCreate':_0xd922('0x3'),'afterUpdate':'update','afterDestroy':_0xd922('0x4')};function emitEvent(_0x446ada){return function(_0x170d02,_0x4511ba,_0x4c3608){TeamEvents[_0xd922('0x5')](_0x446ada+':'+_0x170d02['id'],_0x170d02);TeamEvents[_0xd922('0x5')](_0x446ada,_0x170d02);_0x4c3608(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 5778fee..039fb8a 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 _0x148e=['moment','bluebird','request-promise','../../config/environment','define','teams','util','../../config/logger','api'];(function(_0x32825e,_0x5981c1){var _0x119578=function(_0x40ce3d){while(--_0x40ce3d){_0x32825e['push'](_0x32825e['shift']());}};_0x119578(++_0x5981c1);}(_0x148e,0x12f));var _0xe148=function(_0x1b81ae,_0x1941f7){_0x1b81ae=_0x1b81ae-0x0;var _0x33ba48=_0x148e[_0x1b81ae];return _0x33ba48;};'use strict';var _=require('lodash');var util=require(_0xe148('0x0'));var logger=require(_0xe148('0x1'))(_0xe148('0x2'));var moment=require(_0xe148('0x3'));var BPromise=require(_0xe148('0x4'));var rp=require(_0xe148('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe148('0x6'));var attributes=require('./team.attributes');module['exports']=function(_0x30c6fc,_0x290e5a){return _0x30c6fc[_0xe148('0x7')]('Team',attributes,{'tableName':_0xe148('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf88=['../../config/environment','exports','define','Team','lodash','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x176fbe,_0x4d766a){var _0x223ae0=function(_0x474951){while(--_0x474951){_0x176fbe['push'](_0x176fbe['shift']());}};_0x223ae0(++_0x4d766a);}(_0xbf88,0x124));var _0x8bf8=function(_0x2db3b3,_0x36e306){_0x2db3b3=_0x2db3b3-0x0;var _0xb772c6=_0xbf88[_0x2db3b3];return _0xb772c6;};'use strict';var _=require(_0x8bf8('0x0'));var util=require('util');var logger=require(_0x8bf8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8bf8('0x2'));var rp=require(_0x8bf8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bf8('0x4'));var config=require(_0x8bf8('0x5'));var attributes=require('./team.attributes');module[_0x8bf8('0x6')]=function(_0x17e229,_0xc33d1f){return _0x17e229[_0x8bf8('0x7')](_0x8bf8('0x8'),attributes,{'tableName':'teams','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 ba25092..69a9caf 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 _0x37ce=['moment','bluebird','../../config/utils','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','./team.socket','register','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x219411,_0x8e667f){var _0x5dd956=function(_0x1b2d62){while(--_0x1b2d62){_0x219411['push'](_0x219411['shift']());}};_0x5dd956(++_0x8e667f);}(_0x37ce,0x196));var _0xe37c=function(_0x5bf8f2,_0x468c7e){_0x5bf8f2=_0x5bf8f2-0x0;var _0x41e6ca=_0x37ce[_0x5bf8f2];return _0x41e6ca;};'use strict';var _=require(_0xe37c('0x0'));var util=require(_0xe37c('0x1'));var moment=require(_0xe37c('0x2'));var BPromise=require(_0xe37c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe37c('0x4'));var logger=require('../../config/logger')(_0xe37c('0x5'));var config=require(_0xe37c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe37c('0x7')]({'port':0x232a});config['redis']=_[_0xe37c('0x8')](config[_0xe37c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe37c('0xa'))(new Redis(config[_0xe37c('0x9')]));require(_0xe37c('0xb'))[_0xe37c('0xc')](socket);function respondWithRpcPromise(_0x112be7,_0x2e260b,_0x427731){return new BPromise(function(_0x24f972,_0x3da298){return client[_0xe37c('0xd')](_0x112be7,_0x427731)['then'](function(_0x2b7ceb){logger['info'](_0xe37c('0xe'),_0x2e260b,_0xe37c('0xf'));logger[_0xe37c('0x10')](_0xe37c('0x11'),_0x2e260b,_0xe37c('0xf'),JSON[_0xe37c('0x12')](_0x2b7ceb));if(_0x2b7ceb[_0xe37c('0x13')]){if(_0x2b7ceb[_0xe37c('0x13')][_0xe37c('0x14')]===0x1f4){logger[_0xe37c('0x13')](_0xe37c('0xe'),_0x2e260b,_0x2b7ceb['error'][_0xe37c('0x15')]);return _0x3da298(_0x2b7ceb[_0xe37c('0x13')][_0xe37c('0x15')]);}logger[_0xe37c('0x13')]('Team,\x20%s,\x20%s',_0x2e260b,_0x2b7ceb['error'][_0xe37c('0x15')]);return _0x24f972(_0x2b7ceb[_0xe37c('0x13')][_0xe37c('0x15')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x2e260b,_0xe37c('0xf'));_0x24f972(_0x2b7ceb[_0xe37c('0x16')][_0xe37c('0x15')]);}})[_0xe37c('0x17')](function(_0x149ebf){logger[_0xe37c('0x13')](_0xe37c('0xe'),_0x2e260b,_0x149ebf);_0x3da298(_0x149ebf);});});} \ No newline at end of file +var _0xdd77=['catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0xdd77,0x139));var _0x7dd7=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xdd77[_0x3a6efd];return _0x487b9a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7dd7('0x0'));var BPromise=require(_0x7dd7('0x1'));var rs=require(_0x7dd7('0x2'));var fs=require('fs');var Redis=require(_0x7dd7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7dd7('0x4'))(_0x7dd7('0x5'));var config=require(_0x7dd7('0x6'));var jayson=require(_0x7dd7('0x7'));var client=jayson[_0x7dd7('0x8')][_0x7dd7('0x9')]({'port':0x232a});config[_0x7dd7('0xa')]=_['defaults'](config[_0x7dd7('0xa')],{'host':_0x7dd7('0xb'),'port':0x18eb});var socket=require(_0x7dd7('0xc'))(new Redis(config['redis']));require(_0x7dd7('0xd'))[_0x7dd7('0xe')](socket);function respondWithRpcPromise(_0x478226,_0x5331c4,_0x4c361e){return new BPromise(function(_0x37ae7c,_0x31cb8d){return client[_0x7dd7('0xf')](_0x478226,_0x4c361e)['then'](function(_0x1d598e){logger[_0x7dd7('0x10')](_0x7dd7('0x11'),_0x5331c4,_0x7dd7('0x12'));logger[_0x7dd7('0x13')](_0x7dd7('0x14'),_0x5331c4,_0x7dd7('0x12'),JSON['stringify'](_0x1d598e));if(_0x1d598e[_0x7dd7('0x15')]){if(_0x1d598e['error'][_0x7dd7('0x16')]===0x1f4){logger[_0x7dd7('0x15')](_0x7dd7('0x11'),_0x5331c4,_0x1d598e[_0x7dd7('0x15')]['message']);return _0x31cb8d(_0x1d598e['error'][_0x7dd7('0x17')]);}logger[_0x7dd7('0x15')]('Team,\x20%s,\x20%s',_0x5331c4,_0x1d598e[_0x7dd7('0x15')][_0x7dd7('0x17')]);return _0x37ae7c(_0x1d598e[_0x7dd7('0x15')][_0x7dd7('0x17')]);}else{logger[_0x7dd7('0x10')](_0x7dd7('0x11'),_0x5331c4,_0x7dd7('0x12'));_0x37ae7c(_0x1d598e[_0x7dd7('0x18')][_0x7dd7('0x17')]);}})[_0x7dd7('0x19')](function(_0x47284e){logger['error'](_0x7dd7('0x11'),_0x5331c4,_0x47284e);_0x31cb8d(_0x47284e);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index dd7ecf3..733107a 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 _0xb544=['remove','update','emit','team:'];(function(_0x4c5148,_0x45939e){var _0x245f29=function(_0xc425a2){while(--_0xc425a2){_0x4c5148['push'](_0x4c5148['shift']());}};_0x245f29(++_0x45939e);}(_0xb544,0xd0));var _0x4b54=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb544[_0x199572];return _0x13cfa3;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x4b54('0x0'),_0x4b54('0x1')];function createListener(_0x1a52e8,_0x3442ff){return function(_0xc4666b){_0x3442ff[_0x4b54('0x2')](_0x1a52e8,_0xc4666b);};}function removeListener(_0x3e2f2c,_0x192cc1){return function(){TeamEvents['removeListener'](_0x3e2f2c,_0x192cc1);};}exports['register']=function(_0x5c5c8f){for(var _0x5b68a3=0x0,_0xc9f31c=events['length'];_0x5b68a3<_0xc9f31c;_0x5b68a3++){var _0x2bf592=events[_0x5b68a3];var _0x512bff=createListener(_0x4b54('0x3')+_0x2bf592,_0x5c5c8f);TeamEvents['on'](_0x2bf592,_0x512bff);}}; \ No newline at end of file +var _0x3970=['./team.events','save','update','emit','register','length'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0x3970,0x1d4));var _0x0397=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0x3970[_0x398294];return _0x2a872d;};'use strict';var TeamEvents=require(_0x0397('0x0'));var events=[_0x0397('0x1'),'remove',_0x0397('0x2')];function createListener(_0x5dd8db,_0x34727a){return function(_0x10b215){_0x34727a[_0x0397('0x3')](_0x5dd8db,_0x10b215);};}function removeListener(_0xc1d227,_0x39bd02){return function(){TeamEvents['removeListener'](_0xc1d227,_0x39bd02);};}exports[_0x0397('0x4')]=function(_0xc638c0){for(var _0x15dbbe=0x0,_0x40a950=events[_0x0397('0x5')];_0x15dbbe<_0x40a950;_0x15dbbe++){var _0x384d82=events[_0x15dbbe];var _0x5429c5=createListener('team:'+_0x384d82,_0xc638c0);TeamEvents['on'](_0x384d82,_0x5429c5);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 0dec769..0b6d7e1 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x41210a,_0x3dab6c){var _0x27d176=function(_0x223f30){while(--_0x223f30){_0x41210a['push'](_0x41210a['shift']());}};_0x27d176(++_0x3dab6c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0xcb91[_0x2af053];return _0x4b4001;};'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(_0x1c62c6,_0x36301b){var _0x3fdcf0=function(_0x64ecdc){while(--_0x64ecdc){_0x1c62c6['push'](_0x1c62c6['shift']());}};_0x3fdcf0(++_0x36301b);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 7b0e4fd..ac78fd7 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 _0xdd54=['sequelize','exports','INTEGER'];(function(_0x1f8066,_0x52d4c8){var _0x34a7ac=function(_0x41a804){while(--_0x41a804){_0x1f8066['push'](_0x1f8066['shift']());}};_0x34a7ac(++_0x52d4c8);}(_0xdd54,0x159));var _0x4dd5=function(_0xe7a4b5,_0x200412){_0xe7a4b5=_0xe7a4b5-0x0;var _0xe5bb55=_0xdd54[_0xe7a4b5];return _0xe5bb55;};'use strict';var Sequelize=require(_0x4dd5('0x0'));module[_0x4dd5('0x1')]={'penalty':{'type':Sequelize[_0x4dd5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb950=['INTEGER','sequelize'];(function(_0x2fe486,_0x5c4c7c){var _0x1d75a6=function(_0x12d7f2){while(--_0x12d7f2){_0x2fe486['push'](_0x2fe486['shift']());}};_0x1d75a6(++_0x5c4c7c);}(_0xb950,0x18d));var _0x0b95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb950[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0b95('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0b95('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 c91224d..cf8bf59 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 _0x95f4=['TeamVoiceQueue','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x21d7a7,_0x1500d8){var _0x58c681=function(_0xf5ef27){while(--_0xf5ef27){_0x21d7a7['push'](_0x21d7a7['shift']());}};_0x58c681(++_0x1500d8);}(_0x95f4,0xf1));var _0x495f=function(_0x11b94c,_0x5d24cc){_0x11b94c=_0x11b94c-0x0;var _0x24b402=_0x95f4[_0x11b94c];return _0x24b402;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var logger=require(_0x495f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x495f('0x3'));var rp=require(_0x495f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x495f('0x5'));var attributes=require(_0x495f('0x6'));module[_0x495f('0x7')]=function(_0x4a56a5,_0x704a46){return _0x4a56a5[_0x495f('0x8')](_0x495f('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4aa3=['api','moment','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4aa3,0x174));var _0x34aa=function(_0x5cdaa5,_0x350653){_0x5cdaa5=_0x5cdaa5-0x0;var _0x241e7b=_0x4aa3[_0x5cdaa5];return _0x241e7b;};'use strict';var _=require(_0x34aa('0x0'));var util=require(_0x34aa('0x1'));var logger=require('../../config/logger')(_0x34aa('0x2'));var moment=require(_0x34aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x34aa('0x4'));var fs=require('fs');var path=require(_0x34aa('0x5'));var rimraf=require('rimraf');var config=require(_0x34aa('0x6'));var attributes=require(_0x34aa('0x7'));module[_0x34aa('0x8')]=function(_0x5a717c,_0x201f69){return _0x5a717c[_0x34aa('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0x34aa('0xa'),'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 80c0a4f..bc417dc 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 _0x8f02=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x462f16,_0x2c21f0){var _0x2be15f=function(_0x2ad7cc){while(--_0x2ad7cc){_0x462f16['push'](_0x462f16['shift']());}};_0x2be15f(++_0x2c21f0);}(_0x8f02,0xa1));var _0x28f0=function(_0x438ab7,_0x1f31c4){_0x438ab7=_0x438ab7-0x0;var _0xf20db5=_0x8f02[_0x438ab7];return _0xf20db5;};'use strict';var _=require('lodash');var util=require(_0x28f0('0x0'));var moment=require(_0x28f0('0x1'));var BPromise=require(_0x28f0('0x2'));var rs=require(_0x28f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28f0('0x4'))['db'];var utils=require(_0x28f0('0x5'));var logger=require(_0x28f0('0x6'))(_0x28f0('0x7'));var config=require(_0x28f0('0x8'));var jayson=require(_0x28f0('0x9'));var client=jayson[_0x28f0('0xa')][_0x28f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2720d1,_0x2350d7,_0x247669){return new BPromise(function(_0x326221,_0x17f589){return client['request'](_0x2720d1,_0x247669)[_0x28f0('0xc')](function(_0x557298){logger[_0x28f0('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2350d7,'request\x20sent');logger[_0x28f0('0xe')](_0x28f0('0xf'),_0x2350d7,'request\x20sent',JSON[_0x28f0('0x10')](_0x557298));if(_0x557298[_0x28f0('0x11')]){if(_0x557298['error'][_0x28f0('0x12')]===0x1f4){logger[_0x28f0('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2350d7,_0x557298[_0x28f0('0x11')][_0x28f0('0x13')]);return _0x17f589(_0x557298[_0x28f0('0x11')]['message']);}logger[_0x28f0('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2350d7,_0x557298[_0x28f0('0x11')][_0x28f0('0x13')]);return _0x326221(_0x557298['error']['message']);}else{logger[_0x28f0('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2350d7,'request\x20sent');_0x326221(_0x557298[_0x28f0('0x14')][_0x28f0('0x13')]);}})[_0x28f0('0x15')](function(_0x4b1891){logger[_0x28f0('0x11')](_0x28f0('0x16'),_0x2350d7,_0x4b1891);_0x17f589(_0x4b1891);});});} \ No newline at end of file +var _0xf53f=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x3de59c,_0x263669){var _0x328e5d=function(_0x295679){while(--_0x295679){_0x3de59c['push'](_0x3de59c['shift']());}};_0x328e5d(++_0x263669);}(_0xf53f,0x8d));var _0xff53=function(_0xbafec2,_0x3a8d60){_0xbafec2=_0xbafec2-0x0;var _0x482495=_0xf53f[_0xbafec2];return _0x482495;};'use strict';var _=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var moment=require(_0xff53('0x2'));var BPromise=require(_0xff53('0x3'));var rs=require(_0xff53('0x4'));var fs=require('fs');var Redis=require(_0xff53('0x5'));var db=require(_0xff53('0x6'))['db'];var utils=require(_0xff53('0x7'));var logger=require(_0xff53('0x8'))(_0xff53('0x9'));var config=require(_0xff53('0xa'));var jayson=require(_0xff53('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27b397,_0x5751e7,_0x1c27bb){return new BPromise(function(_0x122746,_0x1bc4b3){return client['request'](_0x27b397,_0x1c27bb)['then'](function(_0x3c001d){logger['info'](_0xff53('0xc'),_0x5751e7,_0xff53('0xd'));logger['debug'](_0xff53('0xe'),_0x5751e7,_0xff53('0xd'),JSON['stringify'](_0x3c001d));if(_0x3c001d[_0xff53('0xf')]){if(_0x3c001d[_0xff53('0xf')][_0xff53('0x10')]===0x1f4){logger['error'](_0xff53('0xc'),_0x5751e7,_0x3c001d[_0xff53('0xf')][_0xff53('0x11')]);return _0x1bc4b3(_0x3c001d['error'][_0xff53('0x11')]);}logger[_0xff53('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5751e7,_0x3c001d['error']['message']);return _0x122746(_0x3c001d['error'][_0xff53('0x11')]);}else{logger[_0xff53('0x12')](_0xff53('0xc'),_0x5751e7,'request\x20sent');_0x122746(_0x3c001d[_0xff53('0x13')]['message']);}})['catch'](function(_0x12e90b){logger[_0xff53('0xf')](_0xff53('0xc'),_0x5751e7,_0x12e90b);_0x1bc4b3(_0x12e90b);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 65579db..8d96df9 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 _0xcd2f=['destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xcd2f[_0x40220a];return _0x3903cc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfcd2('0x0'));var express=require(_0xfcd2('0x1'));var router=express[_0xfcd2('0x2')]();var fs_extra=require(_0xfcd2('0x3'));var auth=require(_0xfcd2('0x4'));var interaction=require(_0xfcd2('0x5'));var config=require(_0xfcd2('0x6'));var controller=require(_0xfcd2('0x7'));router['get']('/',auth[_0xfcd2('0x8')](),controller[_0xfcd2('0x9')]);router[_0xfcd2('0xa')](_0xfcd2('0xb'),auth[_0xfcd2('0x8')](),controller[_0xfcd2('0xc')]);router[_0xfcd2('0xd')]('/',auth[_0xfcd2('0x8')](),controller[_0xfcd2('0xe')]);router[_0xfcd2('0xf')](_0xfcd2('0xb'),auth['isAuthenticated'](),controller[_0xfcd2('0x10')]);router[_0xfcd2('0x11')](_0xfcd2('0xb'),auth[_0xfcd2('0x8')](),controller[_0xfcd2('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8b8e=['isAuthenticated','index','/:id','post','create','update','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x244a3f,_0x56bc59){var _0x1f92ce=function(_0x149b13){while(--_0x149b13){_0x244a3f['push'](_0x244a3f['shift']());}};_0x1f92ce(++_0x56bc59);}(_0x8b8e,0x108));var _0xe8b8=function(_0x1183ed,_0x36bd59){_0x1183ed=_0x1183ed-0x0;var _0x52731e=_0x8b8e[_0x1183ed];return _0x52731e;};'use strict';var multer=require(_0xe8b8('0x0'));var util=require('util');var path=require(_0xe8b8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b8('0x3'));var interaction=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var controller=require(_0xe8b8('0x6'));router[_0xe8b8('0x7')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x9')]);router[_0xe8b8('0x7')](_0xe8b8('0xa'),auth[_0xe8b8('0x8')](),controller['show']);router[_0xe8b8('0xb')]('/',auth['isAuthenticated'](),controller[_0xe8b8('0xc')]);router['put']('/:id',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xd')]);router['delete']('/:id',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xe')]);module[_0xe8b8('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index b7c49d7..101aa4f 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 _0x8bc4=['TEXT','sequelize','exports','STRING'];(function(_0x4d8ab5,_0x26fc7d){var _0x136a08=function(_0x485b3b){while(--_0x485b3b){_0x4d8ab5['push'](_0x4d8ab5['shift']());}};_0x136a08(++_0x26fc7d);}(_0x8bc4,0x1dd));var _0x48bc=function(_0x23f119,_0x21ea4b){_0x23f119=_0x23f119-0x0;var _0x41847a=_0x8bc4[_0x23f119];return _0x41847a;};'use strict';var Sequelize=require(_0x48bc('0x0'));module[_0x48bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x48bc('0x2')]},'html':{'type':Sequelize[_0x48bc('0x3')]}}; \ No newline at end of file +var _0xb894=['sequelize','exports','STRING','TEXT'];(function(_0x5641e3,_0x2515a7){var _0x3b552b=function(_0x390c73){while(--_0x390c73){_0x5641e3['push'](_0x5641e3['shift']());}};_0x3b552b(++_0x2515a7);}(_0xb894,0xa8));var _0x4b89=function(_0x504e4e,_0x1dfcd2){_0x504e4e=_0x504e4e-0x0;var _0x497838=_0xb894[_0x504e4e];return _0x497838;};'use strict';var Sequelize=require(_0x4b89('0x0'));module[_0x4b89('0x1')]={'name':{'type':Sequelize[_0x4b89('0x2')]},'description':{'type':Sequelize[_0x4b89('0x2')]},'html':{'type':Sequelize[_0x4b89('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 9102a38..6b67363 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 _0x2a6a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','apply','reject','save','update','then','destroy','Templates','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','Template','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5ef8d0,_0x87719f){var _0x39ae59=function(_0x2ab366){while(--_0x2ab366){_0x5ef8d0['push'](_0x5ef8d0['shift']());}};_0x39ae59(++_0x87719f);}(_0x2a6a,0x197));var _0xa2a6=function(_0x8b1a5e,_0x2744eb){_0x8b1a5e=_0x8b1a5e-0x0;var _0x1146b1=_0x2a6a[_0x8b1a5e];return _0x1146b1;};'use strict';var emlformat=require(_0xa2a6('0x0'));var rimraf=require(_0xa2a6('0x1'));var zipdir=require(_0xa2a6('0x2'));var jsonpatch=require(_0xa2a6('0x3'));var rp=require('request-promise');var moment=require(_0xa2a6('0x4'));var BPromise=require(_0xa2a6('0x5'));var Mustache=require(_0xa2a6('0x6'));var util=require(_0xa2a6('0x7'));var path=require(_0xa2a6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2a6('0x9'));var _=require(_0xa2a6('0xa'));var squel=require(_0xa2a6('0xb'));var crypto=require('crypto');var jsforce=require(_0xa2a6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa2a6('0xd'));var querystring=require(_0xa2a6('0xe'));var Papa=require(_0xa2a6('0xf'));var Redis=require(_0xa2a6('0x10'));var authService=require(_0xa2a6('0x11'));var qs=require(_0xa2a6('0x12'));var as=require(_0xa2a6('0x13'));var hardwareService=require(_0xa2a6('0x14'));var logger=require(_0xa2a6('0x15'))(_0xa2a6('0x16'));var utils=require(_0xa2a6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa2a6('0x18'));var db=require(_0xa2a6('0x19'))['db'];function respondWithStatusCode(_0x329c3c,_0x274621){_0x274621=_0x274621||0xcc;return function(_0x1b120b){if(_0x1b120b){return _0x329c3c['sendStatus'](_0x274621);}return _0x329c3c[_0xa2a6('0x1a')](_0x274621)['end']();};}function respondWithResult(_0x20aa3c,_0x2ae47f){_0x2ae47f=_0x2ae47f||0xc8;return function(_0x50bc67){if(_0x50bc67){return _0x20aa3c[_0xa2a6('0x1a')](_0x2ae47f)['json'](_0x50bc67);}};}function respondWithFilteredResult(_0x10afce,_0x4d2925){return function(_0x2a5015){if(_0x2a5015){var _0x22c301=typeof _0x4d2925['offset']===_0xa2a6('0x1b')&&typeof _0x4d2925[_0xa2a6('0x1c')]===_0xa2a6('0x1b');var _0x5ebc86=_0x2a5015[_0xa2a6('0x1d')];var _0x1e6638=_0x22c301?0x0:_0x4d2925[_0xa2a6('0x1e')];var _0x530103=_0x22c301?_0x2a5015[_0xa2a6('0x1d')]:_0x4d2925[_0xa2a6('0x1e')]+_0x4d2925[_0xa2a6('0x1c')];var _0x48bd94;if(_0x530103>=_0x5ebc86){_0x530103=_0x5ebc86;_0x48bd94=0xc8;}else{_0x48bd94=0xce;}_0x10afce[_0xa2a6('0x1a')](_0x48bd94);return _0x10afce['set']('Content-Range',_0x1e6638+'-'+_0x530103+'/'+_0x5ebc86)['json'](_0x2a5015);}return null;};}function patchUpdates(_0x57d72c){return function(_0x206269){try{jsonpatch[_0xa2a6('0x1f')](_0x206269,_0x57d72c,!![]);}catch(_0x18725d){return BPromise[_0xa2a6('0x20')](_0x18725d);}return _0x206269[_0xa2a6('0x21')]();};}function saveUpdates(_0x267a7a,_0x116dd6){return function(_0x5961cd){if(_0x5961cd){return _0x5961cd[_0xa2a6('0x22')](_0x267a7a)[_0xa2a6('0x23')](function(_0x2640f1){return _0x2640f1;});}return null;};}function removeEntity(_0x563eb0,_0x43f476){return function(_0x4c9837){if(_0x4c9837){return _0x4c9837[_0xa2a6('0x24')]()['then'](function(){var _0x4be77b=_0x4c9837['get']({'plain':!![]});var _0x4d2311=_0xa2a6('0x25');return db[_0xa2a6('0x26')][_0xa2a6('0x24')]({'where':{'type':_0x4d2311,'resourceId':_0x4be77b['id']}})[_0xa2a6('0x23')](function(){return _0x4c9837;});})['then'](function(){_0x563eb0[_0xa2a6('0x1a')](0xcc)[_0xa2a6('0x27')]();});}};}function handleEntityNotFound(_0x3a6248,_0x46af2c){return function(_0xf7caec){if(!_0xf7caec){_0x3a6248[_0xa2a6('0x28')](0x194);}return _0xf7caec;};}function handleError(_0x39ec95,_0x52af44){_0x52af44=_0x52af44||0x1f4;return function(_0x2e2aeb){logger[_0xa2a6('0x29')](_0x2e2aeb[_0xa2a6('0x2a')]);if(_0x2e2aeb[_0xa2a6('0x2b')]){delete _0x2e2aeb[_0xa2a6('0x2b')];}_0x39ec95[_0xa2a6('0x1a')](_0x52af44)[_0xa2a6('0x2c')](_0x2e2aeb);};}exports[_0xa2a6('0x2d')]=function(_0x41cf45,_0xd8fc2d){var _0x5e7a46={},_0x1ee5d0={},_0x15190a={'count':0x0,'rows':[]};var _0x2d1c41=_[_0xa2a6('0x2e')](db['Template'][_0xa2a6('0x2f')],function(_0x41b083){return{'name':_0x41b083[_0xa2a6('0x30')],'type':_0x41b083[_0xa2a6('0x31')][_0xa2a6('0x32')]};});_0x1ee5d0['model']=_[_0xa2a6('0x2e')](_0x2d1c41,_0xa2a6('0x2b'));_0x1ee5d0[_0xa2a6('0x33')]=_[_0xa2a6('0x34')](_0x41cf45[_0xa2a6('0x33')]);_0x1ee5d0['filters']=_[_0xa2a6('0x35')](_0x1ee5d0['model'],_0x1ee5d0[_0xa2a6('0x33')]);_0x5e7a46[_0xa2a6('0x36')]=_[_0xa2a6('0x35')](_0x1ee5d0[_0xa2a6('0x37')],qs['fields'](_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x38')]));_0x5e7a46[_0xa2a6('0x36')]=_0x5e7a46[_0xa2a6('0x36')][_0xa2a6('0x39')]?_0x5e7a46['attributes']:_0x1ee5d0['model'];if(!_0x41cf45[_0xa2a6('0x33')]['hasOwnProperty'](_0xa2a6('0x3a'))){_0x5e7a46[_0xa2a6('0x1c')]=qs[_0xa2a6('0x1c')](_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x1c')]);_0x5e7a46[_0xa2a6('0x1e')]=qs[_0xa2a6('0x1e')](_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x1e')]);}_0x5e7a46[_0xa2a6('0x3b')]=qs[_0xa2a6('0x3c')](_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x3c')]);_0x5e7a46[_0xa2a6('0x3d')]=qs[_0xa2a6('0x3e')](_[_0xa2a6('0x3f')](_0x41cf45[_0xa2a6('0x33')],_0x1ee5d0[_0xa2a6('0x3e')]),_0x2d1c41);if(_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x40')]){_0x5e7a46[_0xa2a6('0x3d')]=_[_0xa2a6('0x41')](_0x5e7a46['where'],{'$or':_[_0xa2a6('0x2e')](_0x2d1c41,function(_0xf10e87){if(_0xf10e87[_0xa2a6('0x31')]!==_0xa2a6('0x42')){var _0x5249d7={};_0x5249d7[_0xf10e87[_0xa2a6('0x2b')]]={'$like':'%'+_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x40')]+'%'};return _0x5249d7;}})});}_0x5e7a46=_[_0xa2a6('0x41')]({},_0x5e7a46,_0x41cf45[_0xa2a6('0x43')]);var _0x57992b={'where':_0x5e7a46['where']};return db['Template']['count'](_0x57992b)['then'](function(_0x39da73){_0x15190a[_0xa2a6('0x1d')]=_0x39da73;if(_0x41cf45[_0xa2a6('0x33')][_0xa2a6('0x44')]){_0x5e7a46[_0xa2a6('0x45')]=[{'all':!![]}];}return db['Template'][_0xa2a6('0x46')](_0x5e7a46);})[_0xa2a6('0x23')](function(_0x158d96){_0x15190a[_0xa2a6('0x47')]=_0x158d96;return _0x15190a;})[_0xa2a6('0x23')](respondWithFilteredResult(_0xd8fc2d,_0x5e7a46))[_0xa2a6('0x48')](handleError(_0xd8fc2d,null));};exports[_0xa2a6('0x49')]=function(_0x13632b,_0x33f450){var _0x1e103d={'raw':!![],'where':{'id':_0x13632b['params']['id']}},_0x452d34={};_0x452d34[_0xa2a6('0x37')]=_['keys'](db[_0xa2a6('0x4a')][_0xa2a6('0x2f')]);_0x452d34['query']=_[_0xa2a6('0x34')](_0x13632b['query']);_0x452d34[_0xa2a6('0x3e')]=_[_0xa2a6('0x35')](_0x452d34['model'],_0x452d34[_0xa2a6('0x33')]);_0x1e103d[_0xa2a6('0x36')]=_['intersection'](_0x452d34[_0xa2a6('0x37')],qs['fields'](_0x13632b['query'][_0xa2a6('0x38')]));_0x1e103d['attributes']=_0x1e103d[_0xa2a6('0x36')][_0xa2a6('0x39')]?_0x1e103d[_0xa2a6('0x36')]:_0x452d34[_0xa2a6('0x37')];if(_0x13632b['query'][_0xa2a6('0x44')]){_0x1e103d[_0xa2a6('0x45')]=[{'all':!![]}];}_0x1e103d=_['merge']({},_0x1e103d,_0x13632b[_0xa2a6('0x43')]);return db[_0xa2a6('0x4a')]['find'](_0x1e103d)[_0xa2a6('0x23')](handleEntityNotFound(_0x33f450,null))[_0xa2a6('0x23')](respondWithResult(_0x33f450,null))[_0xa2a6('0x48')](handleError(_0x33f450,null));};exports[_0xa2a6('0x4b')]=function(_0x5794f0,_0x1ad5dc){return db['Template'][_0xa2a6('0x4b')](_0x5794f0[_0xa2a6('0x4c')],{})[_0xa2a6('0x23')](function(_0x14cf44){var _0x187644=_0x5794f0[_0xa2a6('0x4d')][_0xa2a6('0x4e')]({'plain':!![]});if(!_0x187644)throw new Error(_0xa2a6('0x4f'));if(_0x187644[_0xa2a6('0x50')]==='user'){var _0x3dd625=_0x14cf44[_0xa2a6('0x4e')]({'plain':!![]});var _0x191913=_0xa2a6('0x25');return db[_0xa2a6('0x51')][_0xa2a6('0x52')]({'where':{'name':_0x191913,'userProfileId':_0x187644[_0xa2a6('0x53')]},'raw':!![]})[_0xa2a6('0x23')](function(_0x280c29){if(_0x280c29&&_0x280c29[_0xa2a6('0x54')]===0x0){return db[_0xa2a6('0x26')][_0xa2a6('0x4b')]({'name':_0x3dd625['name'],'resourceId':_0x3dd625['id'],'type':_0x280c29['name'],'sectionId':_0x280c29['id']},{})['then'](function(){return _0x14cf44;});}else{return _0x14cf44;}})[_0xa2a6('0x48')](function(_0x5c5bb7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5bb7);throw _0x5c5bb7;});}return _0x14cf44;})[_0xa2a6('0x23')](respondWithResult(_0x1ad5dc,0xc9))[_0xa2a6('0x48')](handleError(_0x1ad5dc,null));};exports['update']=function(_0x2cf83c,_0x52cbfb){if(_0x2cf83c[_0xa2a6('0x4c')]['id']){delete _0x2cf83c['body']['id'];}return db[_0xa2a6('0x4a')][_0xa2a6('0x52')]({'where':{'id':_0x2cf83c['params']['id']}})[_0xa2a6('0x23')](handleEntityNotFound(_0x52cbfb,null))[_0xa2a6('0x23')](saveUpdates(_0x2cf83c[_0xa2a6('0x4c')],null))['then'](respondWithResult(_0x52cbfb,null))['catch'](handleError(_0x52cbfb,null));};exports[_0xa2a6('0x24')]=function(_0x45322d,_0x438ad2){return db[_0xa2a6('0x4a')][_0xa2a6('0x52')]({'where':{'id':_0x45322d['params']['id']}})[_0xa2a6('0x23')](handleEntityNotFound(_0x438ad2,null))[_0xa2a6('0x23')](removeEntity(_0x438ad2,null))[_0xa2a6('0x48')](handleError(_0x438ad2,null));}; \ No newline at end of file +var _0x84d9=['name','send','index','map','Template','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','Templates','error','stack'];(function(_0x1448b5,_0x5babfe){var _0x340c4c=function(_0x1a73b6){while(--_0x1a73b6){_0x1448b5['push'](_0x1448b5['shift']());}};_0x340c4c(++_0x5babfe);}(_0x84d9,0x1d3));var _0x984d=function(_0x569484,_0x3f5a2e){_0x569484=_0x569484-0x0;var _0x3135cd=_0x84d9[_0x569484];return _0x3135cd;};'use strict';var emlformat=require(_0x984d('0x0'));var rimraf=require(_0x984d('0x1'));var zipdir=require(_0x984d('0x2'));var jsonpatch=require(_0x984d('0x3'));var rp=require(_0x984d('0x4'));var moment=require('moment');var BPromise=require(_0x984d('0x5'));var Mustache=require('mustache');var util=require(_0x984d('0x6'));var path=require(_0x984d('0x7'));var sox=require(_0x984d('0x8'));var csv=require(_0x984d('0x9'));var ejs=require(_0x984d('0xa'));var fs=require('fs');var fs_extra=require(_0x984d('0xb'));var _=require(_0x984d('0xc'));var squel=require('squel');var crypto=require(_0x984d('0xd'));var jsforce=require(_0x984d('0xe'));var deskjs=require(_0x984d('0xf'));var toCsv=require(_0x984d('0x9'));var querystring=require(_0x984d('0x10'));var Papa=require(_0x984d('0x11'));var Redis=require(_0x984d('0x12'));var authService=require(_0x984d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x984d('0x14'));var hardwareService=require(_0x984d('0x15'));var logger=require('../../config/logger')(_0x984d('0x16'));var utils=require(_0x984d('0x17'));var config=require(_0x984d('0x18'));var licenseUtil=require(_0x984d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c36c2,_0x345f73){_0x345f73=_0x345f73||0xcc;return function(_0x1f40c9){if(_0x1f40c9){return _0x3c36c2[_0x984d('0x1a')](_0x345f73);}return _0x3c36c2[_0x984d('0x1b')](_0x345f73)[_0x984d('0x1c')]();};}function respondWithResult(_0x20b3e6,_0x219b68){_0x219b68=_0x219b68||0xc8;return function(_0x2d2b80){if(_0x2d2b80){return _0x20b3e6[_0x984d('0x1b')](_0x219b68)[_0x984d('0x1d')](_0x2d2b80);}};}function respondWithFilteredResult(_0x137280,_0x59eed7){return function(_0x36cbc7){if(_0x36cbc7){var _0x4d7aaa=typeof _0x59eed7[_0x984d('0x1e')]===_0x984d('0x1f')&&typeof _0x59eed7[_0x984d('0x20')]===_0x984d('0x1f');var _0x4e144e=_0x36cbc7[_0x984d('0x21')];var _0x4d7c00=_0x4d7aaa?0x0:_0x59eed7['offset'];var _0x1b8a22=_0x4d7aaa?_0x36cbc7['count']:_0x59eed7[_0x984d('0x1e')]+_0x59eed7[_0x984d('0x20')];var _0x2e5f61;if(_0x1b8a22>=_0x4e144e){_0x1b8a22=_0x4e144e;_0x2e5f61=0xc8;}else{_0x2e5f61=0xce;}_0x137280[_0x984d('0x1b')](_0x2e5f61);return _0x137280[_0x984d('0x22')](_0x984d('0x23'),_0x4d7c00+'-'+_0x1b8a22+'/'+_0x4e144e)[_0x984d('0x1d')](_0x36cbc7);}return null;};}function patchUpdates(_0x523767){return function(_0x38b62a){try{jsonpatch[_0x984d('0x24')](_0x38b62a,_0x523767,!![]);}catch(_0x4b513f){return BPromise['reject'](_0x4b513f);}return _0x38b62a[_0x984d('0x25')]();};}function saveUpdates(_0x100911,_0xfb61d3){return function(_0xa0be81){if(_0xa0be81){return _0xa0be81['update'](_0x100911)[_0x984d('0x26')](function(_0x294069){return _0x294069;});}return null;};}function removeEntity(_0x42a7a0,_0x2ee01e){return function(_0x314849){if(_0x314849){return _0x314849['destroy']()[_0x984d('0x26')](function(){var _0x1d479c=_0x314849[_0x984d('0x27')]({'plain':!![]});var _0x301dee=_0x984d('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x301dee,'resourceId':_0x1d479c['id']}})['then'](function(){return _0x314849;});})[_0x984d('0x26')](function(){_0x42a7a0[_0x984d('0x1b')](0xcc)[_0x984d('0x1c')]();});}};}function handleEntityNotFound(_0x165a79,_0x5e7597){return function(_0x1c6a82){if(!_0x1c6a82){_0x165a79['sendStatus'](0x194);}return _0x1c6a82;};}function handleError(_0x3d778a,_0x22d182){_0x22d182=_0x22d182||0x1f4;return function(_0x362e81){logger[_0x984d('0x29')](_0x362e81[_0x984d('0x2a')]);if(_0x362e81[_0x984d('0x2b')]){delete _0x362e81['name'];}_0x3d778a[_0x984d('0x1b')](_0x22d182)[_0x984d('0x2c')](_0x362e81);};}exports[_0x984d('0x2d')]=function(_0x21089b,_0x2e7d2c){var _0x392989={},_0x117d84={},_0x2f313f={'count':0x0,'rows':[]};var _0x3c835e=_[_0x984d('0x2e')](db[_0x984d('0x2f')][_0x984d('0x30')],function(_0x5c631d){return{'name':_0x5c631d[_0x984d('0x31')],'type':_0x5c631d[_0x984d('0x32')]['key']};});_0x117d84[_0x984d('0x33')]=_['map'](_0x3c835e,_0x984d('0x2b'));_0x117d84['query']=_[_0x984d('0x34')](_0x21089b[_0x984d('0x35')]);_0x117d84[_0x984d('0x36')]=_['intersection'](_0x117d84[_0x984d('0x33')],_0x117d84[_0x984d('0x35')]);_0x392989[_0x984d('0x37')]=_[_0x984d('0x38')](_0x117d84[_0x984d('0x33')],qs[_0x984d('0x39')](_0x21089b[_0x984d('0x35')][_0x984d('0x39')]));_0x392989[_0x984d('0x37')]=_0x392989['attributes']['length']?_0x392989['attributes']:_0x117d84[_0x984d('0x33')];if(!_0x21089b[_0x984d('0x35')][_0x984d('0x3a')](_0x984d('0x3b'))){_0x392989[_0x984d('0x20')]=qs['limit'](_0x21089b[_0x984d('0x35')][_0x984d('0x20')]);_0x392989[_0x984d('0x1e')]=qs[_0x984d('0x1e')](_0x21089b['query'][_0x984d('0x1e')]);}_0x392989[_0x984d('0x3c')]=qs[_0x984d('0x3d')](_0x21089b[_0x984d('0x35')][_0x984d('0x3d')]);_0x392989[_0x984d('0x3e')]=qs['filters'](_['pick'](_0x21089b[_0x984d('0x35')],_0x117d84[_0x984d('0x36')]),_0x3c835e);if(_0x21089b[_0x984d('0x35')][_0x984d('0x3f')]){_0x392989[_0x984d('0x3e')]=_['merge'](_0x392989[_0x984d('0x3e')],{'$or':_['map'](_0x3c835e,function(_0x17b928){if(_0x17b928[_0x984d('0x32')]!=='VIRTUAL'){var _0x501781={};_0x501781[_0x17b928[_0x984d('0x2b')]]={'$like':'%'+_0x21089b['query'][_0x984d('0x3f')]+'%'};return _0x501781;}})});}_0x392989=_[_0x984d('0x40')]({},_0x392989,_0x21089b['options']);var _0x1a992e={'where':_0x392989[_0x984d('0x3e')]};return db[_0x984d('0x2f')][_0x984d('0x21')](_0x1a992e)[_0x984d('0x26')](function(_0x404c36){_0x2f313f[_0x984d('0x21')]=_0x404c36;if(_0x21089b[_0x984d('0x35')][_0x984d('0x41')]){_0x392989[_0x984d('0x42')]=[{'all':!![]}];}return db[_0x984d('0x2f')][_0x984d('0x43')](_0x392989);})[_0x984d('0x26')](function(_0x5557f8){_0x2f313f[_0x984d('0x44')]=_0x5557f8;return _0x2f313f;})['then'](respondWithFilteredResult(_0x2e7d2c,_0x392989))[_0x984d('0x45')](handleError(_0x2e7d2c,null));};exports[_0x984d('0x46')]=function(_0x2a9770,_0x8ea277){var _0x5482f2={'raw':!![],'where':{'id':_0x2a9770[_0x984d('0x47')]['id']}},_0x4c9e1f={};_0x4c9e1f[_0x984d('0x33')]=_[_0x984d('0x34')](db['Template'][_0x984d('0x30')]);_0x4c9e1f['query']=_[_0x984d('0x34')](_0x2a9770[_0x984d('0x35')]);_0x4c9e1f[_0x984d('0x36')]=_[_0x984d('0x38')](_0x4c9e1f[_0x984d('0x33')],_0x4c9e1f[_0x984d('0x35')]);_0x5482f2['attributes']=_[_0x984d('0x38')](_0x4c9e1f[_0x984d('0x33')],qs[_0x984d('0x39')](_0x2a9770[_0x984d('0x35')][_0x984d('0x39')]));_0x5482f2[_0x984d('0x37')]=_0x5482f2['attributes'][_0x984d('0x48')]?_0x5482f2[_0x984d('0x37')]:_0x4c9e1f['model'];if(_0x2a9770[_0x984d('0x35')][_0x984d('0x41')]){_0x5482f2[_0x984d('0x42')]=[{'all':!![]}];}_0x5482f2=_[_0x984d('0x40')]({},_0x5482f2,_0x2a9770[_0x984d('0x49')]);return db[_0x984d('0x2f')][_0x984d('0x4a')](_0x5482f2)[_0x984d('0x26')](handleEntityNotFound(_0x8ea277,null))[_0x984d('0x26')](respondWithResult(_0x8ea277,null))['catch'](handleError(_0x8ea277,null));};exports['create']=function(_0x3a161c,_0x47d183){return db[_0x984d('0x2f')][_0x984d('0x4b')](_0x3a161c[_0x984d('0x4c')],{})[_0x984d('0x26')](function(_0x2445eb){var _0x1fcf37=_0x3a161c[_0x984d('0x4d')][_0x984d('0x27')]({'plain':!![]});if(!_0x1fcf37)throw new Error(_0x984d('0x4e'));if(_0x1fcf37['role']==='user'){var _0xaaa656=_0x2445eb[_0x984d('0x27')]({'plain':!![]});var _0xf1583e=_0x984d('0x28');return db[_0x984d('0x4f')][_0x984d('0x4a')]({'where':{'name':_0xf1583e,'userProfileId':_0x1fcf37[_0x984d('0x50')]},'raw':!![]})[_0x984d('0x26')](function(_0x290690){if(_0x290690&&_0x290690[_0x984d('0x51')]===0x0){return db[_0x984d('0x52')][_0x984d('0x4b')]({'name':_0xaaa656[_0x984d('0x2b')],'resourceId':_0xaaa656['id'],'type':_0x290690[_0x984d('0x2b')],'sectionId':_0x290690['id']},{})[_0x984d('0x26')](function(){return _0x2445eb;});}else{return _0x2445eb;}})[_0x984d('0x45')](function(_0xf77f27){logger[_0x984d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf77f27);throw _0xf77f27;});}return _0x2445eb;})['then'](respondWithResult(_0x47d183,0xc9))[_0x984d('0x45')](handleError(_0x47d183,null));};exports[_0x984d('0x53')]=function(_0x414a35,_0x281662){if(_0x414a35[_0x984d('0x4c')]['id']){delete _0x414a35[_0x984d('0x4c')]['id'];}return db[_0x984d('0x2f')][_0x984d('0x4a')]({'where':{'id':_0x414a35[_0x984d('0x47')]['id']}})[_0x984d('0x26')](handleEntityNotFound(_0x281662,null))['then'](saveUpdates(_0x414a35[_0x984d('0x4c')],null))[_0x984d('0x26')](respondWithResult(_0x281662,null))[_0x984d('0x45')](handleError(_0x281662,null));};exports[_0x984d('0x54')]=function(_0x444298,_0x171942){return db[_0x984d('0x2f')]['find']({'where':{'id':_0x444298[_0x984d('0x47')]['id']}})[_0x984d('0x26')](handleEntityNotFound(_0x171942,null))[_0x984d('0x26')](removeEntity(_0x171942,null))['catch'](handleError(_0x171942,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index a5d1cb9..30d43ba 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 _0x5f94=['Template','tools_templates','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x1f9d62,_0x9e0d01){var _0x3eab7f=function(_0x27a9c3){while(--_0x27a9c3){_0x1f9d62['push'](_0x1f9d62['shift']());}};_0x3eab7f(++_0x9e0d01);}(_0x5f94,0xf2));var _0x45f9=function(_0x3464be,_0x3dbb88){_0x3464be=_0x3464be-0x0;var _0x5bb7f2=_0x5f94[_0x3464be];return _0x5bb7f2;};'use strict';var _=require(_0x45f9('0x0'));var util=require('util');var logger=require(_0x45f9('0x1'))('api');var moment=require(_0x45f9('0x2'));var BPromise=require('bluebird');var rp=require(_0x45f9('0x3'));var fs=require('fs');var path=require(_0x45f9('0x4'));var rimraf=require(_0x45f9('0x5'));var config=require(_0x45f9('0x6'));var attributes=require(_0x45f9('0x7'));module[_0x45f9('0x8')]=function(_0x38598b,_0x418dc6){return _0x38598b[_0x45f9('0x9')](_0x45f9('0xa'),attributes,{'tableName':_0x45f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe753=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','util','../../config/logger'];(function(_0x211a17,_0x46fbca){var _0x5ca292=function(_0x295a50){while(--_0x295a50){_0x211a17['push'](_0x211a17['shift']());}};_0x5ca292(++_0x46fbca);}(_0xe753,0x136));var _0x3e75=function(_0x12be85,_0x4a5721){_0x12be85=_0x12be85-0x0;var _0x5a1135=_0xe753[_0x12be85];return _0x5a1135;};'use strict';var _=require('lodash');var util=require(_0x3e75('0x0'));var logger=require(_0x3e75('0x1'))(_0x3e75('0x2'));var moment=require(_0x3e75('0x3'));var BPromise=require(_0x3e75('0x4'));var rp=require(_0x3e75('0x5'));var fs=require('fs');var path=require(_0x3e75('0x6'));var rimraf=require(_0x3e75('0x7'));var config=require(_0x3e75('0x8'));var attributes=require(_0x3e75('0x9'));module['exports']=function(_0x1ed03f,_0x509c2c){return _0x1ed03f[_0x3e75('0xa')](_0x3e75('0xb'),attributes,{'tableName':_0x3e75('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 bffe8cf..a4b2bd4 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 _0x1516=['GetTemplate','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','raw','where','attributes','limit','include','model','map','info'];(function(_0x2ed791,_0x1abc01){var _0x1a1990=function(_0x433f23){while(--_0x433f23){_0x2ed791['push'](_0x2ed791['shift']());}};_0x1a1990(++_0x1abc01);}(_0x1516,0xb0));var _0x6151=function(_0x56d807,_0x4bf889){_0x56d807=_0x56d807-0x0;var _0x5bfc9a=_0x1516[_0x56d807];return _0x5bfc9a;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x319164,_0x3fa962,_0x46e22f){return new BPromise(function(_0x43513c,_0x44cc85){return client[_0x6151('0xb')](_0x319164,_0x46e22f)[_0x6151('0xc')](function(_0x5c5b55){logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));logger[_0x6151('0xf')](_0x6151('0x10'),_0x3fa962,_0x6151('0xe'),JSON[_0x6151('0x11')](_0x5c5b55));if(_0x5c5b55[_0x6151('0x12')]){if(_0x5c5b55[_0x6151('0x12')][_0x6151('0x13')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x44cc85(_0x5c5b55[_0x6151('0x12')]['message']);}logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x43513c(_0x5c5b55['error'][_0x6151('0x14')]);}else{logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));_0x43513c(_0x5c5b55[_0x6151('0x15')][_0x6151('0x14')]);}})[_0x6151('0x16')](function(_0x12524a){logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x12524a);_0x44cc85(_0x12524a);});});}exports['GetTemplate']=function(_0x24375a){var _0x7d5f8d=this;return new Promise(function(_0x504c4b,_0x168b79){return db[_0x6151('0x17')][_0x6151('0x18')]({'raw':_0x24375a[_0x6151('0x19')]?_0x24375a[_0x6151('0x19')][_0x6151('0x1a')]===undefined?!![]:![]:!![],'where':_0x24375a[_0x6151('0x19')]?_0x24375a[_0x6151('0x19')][_0x6151('0x1b')]||null:null,'attributes':_0x24375a[_0x6151('0x19')]?_0x24375a[_0x6151('0x19')][_0x6151('0x1c')]||null:null,'limit':_0x24375a[_0x6151('0x19')]?_0x24375a[_0x6151('0x19')][_0x6151('0x1d')]||null:null,'include':_0x24375a['options']?_0x24375a[_0x6151('0x19')][_0x6151('0x1e')]?_['map'](_0x24375a[_0x6151('0x19')][_0x6151('0x1e')],function(_0x3ed0ac){return{'model':db[_0x3ed0ac['model']],'as':_0x3ed0ac['as'],'attributes':_0x3ed0ac[_0x6151('0x1c')],'include':_0x3ed0ac[_0x6151('0x1e')]?_['map'](_0x3ed0ac[_0x6151('0x1e')],function(_0x26676d){return{'model':db[_0x26676d[_0x6151('0x1f')]],'as':_0x26676d['as'],'attributes':_0x26676d[_0x6151('0x1c')],'include':_0x26676d['include']?_[_0x6151('0x20')](_0x26676d[_0x6151('0x1e')],function(_0x431b75){return{'model':db[_0x431b75[_0x6151('0x1f')]],'as':_0x431b75['as'],'attributes':_0x431b75['attributes']};}):[]};}):[]};}):[]:[]})[_0x6151('0xc')](function(_0x14ea6b){logger[_0x6151('0x21')]('GetTemplate',_0x24375a);logger[_0x6151('0xf')](_0x6151('0x22'),_0x24375a,JSON['stringify'](_0x14ea6b));_0x504c4b(_0x14ea6b);})[_0x6151('0x16')](function(_0x18991f){logger[_0x6151('0x12')](_0x6151('0x22'),_0x18991f[_0x6151('0x14')],_0x24375a);_0x168b79(_0x7d5f8d[_0x6151('0x12')](0x1f4,_0x18991f[_0x6151('0x14')]));});});}; \ No newline at end of file +var _0xd87d=['model','then','debug','lodash','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetTemplate','Template','findAll','raw','options','where','attributes','limit','include','map'];(function(_0x117704,_0x498ab3){var _0x20b07a=function(_0x4c25f4){while(--_0x4c25f4){_0x117704['push'](_0x117704['shift']());}};_0x20b07a(++_0x498ab3);}(_0xd87d,0x16b));var _0xdd87=function(_0x24c451,_0x210b90){_0x24c451=_0x24c451-0x0;var _0x89344e=_0xd87d[_0x24c451];return _0x89344e;};'use strict';var _=require(_0xdd87('0x0'));var util=require('util');var moment=require(_0xdd87('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd87('0x2'));var fs=require('fs');var Redis=require(_0xdd87('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdd87('0x4'))(_0xdd87('0x5'));var config=require('../../config/environment');var jayson=require(_0xdd87('0x6'));var client=jayson[_0xdd87('0x7')][_0xdd87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41fdf6,_0x2a4ee0,_0x57a2cb){return new BPromise(function(_0x368e34,_0x22f608){return client['request'](_0x41fdf6,_0x57a2cb)['then'](function(_0x2acc82){logger[_0xdd87('0x9')](_0xdd87('0xa'),_0x2a4ee0,_0xdd87('0xb'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x2a4ee0,_0xdd87('0xb'),JSON[_0xdd87('0xc')](_0x2acc82));if(_0x2acc82[_0xdd87('0xd')]){if(_0x2acc82['error'][_0xdd87('0xe')]===0x1f4){logger[_0xdd87('0xd')](_0xdd87('0xa'),_0x2a4ee0,_0x2acc82[_0xdd87('0xd')][_0xdd87('0xf')]);return _0x22f608(_0x2acc82[_0xdd87('0xd')][_0xdd87('0xf')]);}logger[_0xdd87('0xd')](_0xdd87('0xa'),_0x2a4ee0,_0x2acc82[_0xdd87('0xd')]['message']);return _0x368e34(_0x2acc82[_0xdd87('0xd')][_0xdd87('0xf')]);}else{logger[_0xdd87('0x9')]('Template,\x20%s,\x20%s',_0x2a4ee0,'request\x20sent');_0x368e34(_0x2acc82['result']['message']);}})[_0xdd87('0x10')](function(_0x541004){logger[_0xdd87('0xd')](_0xdd87('0xa'),_0x2a4ee0,_0x541004);_0x22f608(_0x541004);});});}exports[_0xdd87('0x11')]=function(_0x20aaf8){var _0x4bc37d=this;return new Promise(function(_0xabf813,_0x4fbd38){return db[_0xdd87('0x12')][_0xdd87('0x13')]({'raw':_0x20aaf8['options']?_0x20aaf8['options'][_0xdd87('0x14')]===undefined?!![]:![]:!![],'where':_0x20aaf8[_0xdd87('0x15')]?_0x20aaf8[_0xdd87('0x15')][_0xdd87('0x16')]||null:null,'attributes':_0x20aaf8['options']?_0x20aaf8[_0xdd87('0x15')][_0xdd87('0x17')]||null:null,'limit':_0x20aaf8['options']?_0x20aaf8['options'][_0xdd87('0x18')]||null:null,'include':_0x20aaf8['options']?_0x20aaf8['options'][_0xdd87('0x19')]?_[_0xdd87('0x1a')](_0x20aaf8[_0xdd87('0x15')][_0xdd87('0x19')],function(_0x1c18d3){return{'model':db[_0x1c18d3[_0xdd87('0x1b')]],'as':_0x1c18d3['as'],'attributes':_0x1c18d3[_0xdd87('0x17')],'include':_0x1c18d3[_0xdd87('0x19')]?_['map'](_0x1c18d3['include'],function(_0x183502){return{'model':db[_0x183502[_0xdd87('0x1b')]],'as':_0x183502['as'],'attributes':_0x183502[_0xdd87('0x17')],'include':_0x183502[_0xdd87('0x19')]?_[_0xdd87('0x1a')](_0x183502['include'],function(_0x191fe6){return{'model':db[_0x191fe6['model']],'as':_0x191fe6['as'],'attributes':_0x191fe6['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd87('0x1c')](function(_0x2bdc38){logger[_0xdd87('0x9')]('GetTemplate',_0x20aaf8);logger[_0xdd87('0x1d')]('GetTemplate',_0x20aaf8,JSON[_0xdd87('0xc')](_0x2bdc38));_0xabf813(_0x2bdc38);})[_0xdd87('0x10')](function(_0x164222){logger['error']('GetTemplate',_0x164222[_0xdd87('0xf')],_0x20aaf8);_0x4fbd38(_0x4bc37d[_0xdd87('0xd')](0x1f4,_0x164222[_0xdd87('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 76f3398..4bff952 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 _0xa3cb=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','addAllCondition','addAnyCondition','addAction','put'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0xa3cb,0x1e0));var _0xba3c=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xa3cb[_0xae1a83];return _0xdb9da8;};'use strict';var multer=require(_0xba3c('0x0'));var util=require('util');var path=require(_0xba3c('0x1'));var timeout=require(_0xba3c('0x2'));var express=require(_0xba3c('0x3'));var router=express[_0xba3c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xba3c('0x5'));var interaction=require(_0xba3c('0x6'));var config=require(_0xba3c('0x7'));var controller=require(_0xba3c('0x8'));router[_0xba3c('0x9')]('/',auth[_0xba3c('0xa')](),controller[_0xba3c('0xb')]);router[_0xba3c('0x9')](_0xba3c('0xc'),auth['isAuthenticated'](),controller[_0xba3c('0xd')]);router['get'](_0xba3c('0xe'),auth[_0xba3c('0xa')](),controller['getAllConditions']);router[_0xba3c('0x9')](_0xba3c('0xf'),auth[_0xba3c('0xa')](),controller[_0xba3c('0x10')]);router[_0xba3c('0x9')](_0xba3c('0x11'),auth[_0xba3c('0xa')](),controller['getActions']);router[_0xba3c('0x12')]('/',auth[_0xba3c('0xa')](),controller[_0xba3c('0x13')]);router[_0xba3c('0x12')](_0xba3c('0xe'),auth['isAuthenticated'](),controller[_0xba3c('0x14')]);router[_0xba3c('0x12')](_0xba3c('0xf'),auth['isAuthenticated'](),controller[_0xba3c('0x15')]);router[_0xba3c('0x12')]('/:id/actions',auth[_0xba3c('0xa')](),controller[_0xba3c('0x16')]);router[_0xba3c('0x17')](_0xba3c('0xc'),auth['isAuthenticated'](),controller[_0xba3c('0x18')]);router[_0xba3c('0x19')](_0xba3c('0xc'),auth[_0xba3c('0xa')](),controller[_0xba3c('0x1a')]);module[_0xba3c('0x1b')]=router; \ No newline at end of file +var _0x6ea1=['isAuthenticated','index','get','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./trigger.controller'];(function(_0xab8668,_0x5204ac){var _0x571c10=function(_0x4ed488){while(--_0x4ed488){_0xab8668['push'](_0xab8668['shift']());}};_0x571c10(++_0x5204ac);}(_0x6ea1,0x1c2));var _0x16ea=function(_0x2e9da2,_0x25c4b3){_0x2e9da2=_0x2e9da2-0x0;var _0x5da8ea=_0x6ea1[_0x2e9da2];return _0x5da8ea;};'use strict';var multer=require(_0x16ea('0x0'));var util=require(_0x16ea('0x1'));var path=require(_0x16ea('0x2'));var timeout=require(_0x16ea('0x3'));var express=require(_0x16ea('0x4'));var router=express[_0x16ea('0x5')]();var fs_extra=require(_0x16ea('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x16ea('0x7'));var controller=require(_0x16ea('0x8'));router['get']('/',auth[_0x16ea('0x9')](),controller[_0x16ea('0xa')]);router[_0x16ea('0xb')](_0x16ea('0xc'),auth[_0x16ea('0x9')](),controller['show']);router[_0x16ea('0xb')](_0x16ea('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x16ea('0xb')](_0x16ea('0xe'),auth[_0x16ea('0x9')](),controller[_0x16ea('0xf')]);router['get'](_0x16ea('0x10'),auth[_0x16ea('0x9')](),controller['getActions']);router[_0x16ea('0x11')]('/',auth['isAuthenticated'](),controller[_0x16ea('0x12')]);router[_0x16ea('0x11')](_0x16ea('0xd'),auth[_0x16ea('0x9')](),controller[_0x16ea('0x13')]);router[_0x16ea('0x11')](_0x16ea('0xe'),auth[_0x16ea('0x9')](),controller[_0x16ea('0x14')]);router[_0x16ea('0x11')]('/:id/actions',auth[_0x16ea('0x9')](),controller[_0x16ea('0x15')]);router[_0x16ea('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x16ea('0x17')]);router[_0x16ea('0x18')]('/:id',auth[_0x16ea('0x9')](),controller[_0x16ea('0x19')]);module[_0x16ea('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 1303624..0af0c6c 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 _0xde32=['BOOLEAN','sequelize','STRING'];(function(_0x4f3b3c,_0x4257c4){var _0x25c181=function(_0x5de512){while(--_0x5de512){_0x4f3b3c['push'](_0x4f3b3c['shift']());}};_0x25c181(++_0x4257c4);}(_0xde32,0x7f));var _0x2de3=function(_0x15a996,_0x293fae){_0x15a996=_0x15a996-0x0;var _0x46c369=_0xde32[_0x15a996];return _0x46c369;};'use strict';var Sequelize=require(_0x2de3('0x0'));module['exports']={'name':{'type':Sequelize[_0x2de3('0x1')]},'channel':{'type':Sequelize[_0x2de3('0x1')]},'description':{'type':Sequelize[_0x2de3('0x1')]},'status':{'type':Sequelize[_0x2de3('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x2984=['BOOLEAN','sequelize','STRING'];(function(_0x1adddb,_0x3ff8fd){var _0x4c8440=function(_0x1160ff){while(--_0x1160ff){_0x1adddb['push'](_0x1adddb['shift']());}};_0x4c8440(++_0x3ff8fd);}(_0x2984,0x175));var _0x4298=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x2984[_0x1e6659];return _0x4d16e4;};'use strict';var Sequelize=require(_0x4298('0x0'));module['exports']={'name':{'type':Sequelize[_0x4298('0x1')]},'channel':{'type':Sequelize[_0x4298('0x1')]},'description':{'type':Sequelize[_0x4298('0x1')]},'status':{'type':Sequelize[_0x4298('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 6fec241..7da807b 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 _0x084b=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trigger','includeAll','include','findAll','rows','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Triggers','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','addAllCondition','TriggerAllId','addAnyCondition','Condition','getAllConditions','findOne','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3c1589,_0x4aea51){var _0x566059=function(_0x4b6fec){while(--_0x4b6fec){_0x3c1589['push'](_0x3c1589['shift']());}};_0x566059(++_0x4aea51);}(_0x084b,0xa5));var _0xb084=function(_0x118e2c,_0x49395d){_0x118e2c=_0x118e2c-0x0;var _0x4741e9=_0x084b[_0x118e2c];return _0x4741e9;};'use strict';var emlformat=require(_0xb084('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb084('0x1'));var jsonpatch=require(_0xb084('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(_0xb084('0x3'));var sox=require('sox');var csv=require(_0xb084('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb084('0x5'));var _=require('lodash');var squel=require(_0xb084('0x6'));var crypto=require(_0xb084('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xb084('0x8'));var toCsv=require(_0xb084('0x4'));var querystring=require(_0xb084('0x9'));var Papa=require(_0xb084('0xa'));var Redis=require(_0xb084('0xb'));var authService=require(_0xb084('0xc'));var qs=require(_0xb084('0xd'));var as=require(_0xb084('0xe'));var hardwareService=require(_0xb084('0xf'));var logger=require(_0xb084('0x10'))(_0xb084('0x11'));var utils=require('../../config/utils');var config=require(_0xb084('0x12'));var licenseUtil=require(_0xb084('0x13'));var db=require(_0xb084('0x14'))['db'];function respondWithStatusCode(_0x35054b,_0x342c58){_0x342c58=_0x342c58||0xcc;return function(_0x20b57a){if(_0x20b57a){return _0x35054b['sendStatus'](_0x342c58);}return _0x35054b[_0xb084('0x15')](_0x342c58)[_0xb084('0x16')]();};}function respondWithResult(_0xa3421,_0x55e9d6){_0x55e9d6=_0x55e9d6||0xc8;return function(_0x23b36b){if(_0x23b36b){return _0xa3421[_0xb084('0x15')](_0x55e9d6)[_0xb084('0x17')](_0x23b36b);}};}function respondWithFilteredResult(_0xd8ccb7,_0x5da141){return function(_0x52a393){if(_0x52a393){var _0x4b32a2=typeof _0x5da141[_0xb084('0x18')]===_0xb084('0x19')&&typeof _0x5da141[_0xb084('0x1a')]===_0xb084('0x19');var _0xdec903=_0x52a393[_0xb084('0x1b')];var _0x40c535=_0x4b32a2?0x0:_0x5da141['offset'];var _0x1ddbbd=_0x4b32a2?_0x52a393[_0xb084('0x1b')]:_0x5da141[_0xb084('0x18')]+_0x5da141['limit'];var _0x3e501d;if(_0x1ddbbd>=_0xdec903){_0x1ddbbd=_0xdec903;_0x3e501d=0xc8;}else{_0x3e501d=0xce;}_0xd8ccb7['status'](_0x3e501d);return _0xd8ccb7[_0xb084('0x1c')](_0xb084('0x1d'),_0x40c535+'-'+_0x1ddbbd+'/'+_0xdec903)['json'](_0x52a393);}return null;};}function patchUpdates(_0x32fcf8){return function(_0x857818){try{jsonpatch[_0xb084('0x1e')](_0x857818,_0x32fcf8,!![]);}catch(_0x222f6c){return BPromise[_0xb084('0x1f')](_0x222f6c);}return _0x857818[_0xb084('0x20')]();};}function saveUpdates(_0x161e64,_0x4e321b){return function(_0x11e29c){if(_0x11e29c){return _0x11e29c[_0xb084('0x21')](_0x161e64)[_0xb084('0x22')](function(_0x525c33){return _0x525c33;});}return null;};}function removeEntity(_0x2e1729,_0x23975e){return function(_0x532fd3){if(_0x532fd3){return _0x532fd3[_0xb084('0x23')]()['then'](function(){var _0x2449d2=_0x532fd3[_0xb084('0x24')]({'plain':!![]});var _0x786af1='Triggers';return db['UserProfileResource'][_0xb084('0x23')]({'where':{'type':_0x786af1,'resourceId':_0x2449d2['id']}})[_0xb084('0x22')](function(){return _0x532fd3;});})['then'](function(){_0x2e1729[_0xb084('0x15')](0xcc)[_0xb084('0x16')]();});}};}function handleEntityNotFound(_0x50be0e,_0x3e2ba7){return function(_0x1cad03){if(!_0x1cad03){_0x50be0e[_0xb084('0x25')](0x194);}return _0x1cad03;};}function handleError(_0x609ad8,_0x3c4896){_0x3c4896=_0x3c4896||0x1f4;return function(_0x4ce8e3){logger[_0xb084('0x26')](_0x4ce8e3[_0xb084('0x27')]);if(_0x4ce8e3[_0xb084('0x28')]){delete _0x4ce8e3[_0xb084('0x28')];}_0x609ad8[_0xb084('0x15')](_0x3c4896)[_0xb084('0x29')](_0x4ce8e3);};}exports[_0xb084('0x2a')]=function(_0x277925,_0x30ffee){var _0x1e66f1={},_0x6940ea={},_0x470c10={'count':0x0,'rows':[]};var _0x31b72d=_[_0xb084('0x2b')](db['Trigger'][_0xb084('0x2c')],function(_0x3fd149){return{'name':_0x3fd149['fieldName'],'type':_0x3fd149[_0xb084('0x2d')][_0xb084('0x2e')]};});_0x6940ea[_0xb084('0x2f')]=_['map'](_0x31b72d,_0xb084('0x28'));_0x6940ea[_0xb084('0x30')]=_[_0xb084('0x31')](_0x277925[_0xb084('0x30')]);_0x6940ea[_0xb084('0x32')]=_['intersection'](_0x6940ea[_0xb084('0x2f')],_0x6940ea[_0xb084('0x30')]);_0x1e66f1[_0xb084('0x33')]=_[_0xb084('0x34')](_0x6940ea[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x277925[_0xb084('0x30')][_0xb084('0x35')]));_0x1e66f1[_0xb084('0x33')]=_0x1e66f1[_0xb084('0x33')][_0xb084('0x36')]?_0x1e66f1['attributes']:_0x6940ea[_0xb084('0x2f')];if(!_0x277925[_0xb084('0x30')][_0xb084('0x37')](_0xb084('0x38'))){_0x1e66f1[_0xb084('0x1a')]=qs['limit'](_0x277925[_0xb084('0x30')]['limit']);_0x1e66f1[_0xb084('0x18')]=qs[_0xb084('0x18')](_0x277925['query'][_0xb084('0x18')]);}_0x1e66f1[_0xb084('0x39')]=qs[_0xb084('0x3a')](_0x277925[_0xb084('0x30')][_0xb084('0x3a')]);_0x1e66f1[_0xb084('0x3b')]=qs[_0xb084('0x32')](_['pick'](_0x277925[_0xb084('0x30')],_0x6940ea['filters']),_0x31b72d);if(_0x277925['query'][_0xb084('0x3c')]){_0x1e66f1[_0xb084('0x3b')]=_[_0xb084('0x3d')](_0x1e66f1['where'],{'$or':_[_0xb084('0x2b')](_0x31b72d,function(_0xad57d8){if(_0xad57d8[_0xb084('0x2d')]!==_0xb084('0x3e')){var _0x1575b4={};_0x1575b4[_0xad57d8[_0xb084('0x28')]]={'$like':'%'+_0x277925[_0xb084('0x30')][_0xb084('0x3c')]+'%'};return _0x1575b4;}})});}_0x1e66f1=_[_0xb084('0x3d')]({},_0x1e66f1,_0x277925[_0xb084('0x3f')]);var _0x33b8b6={'where':_0x1e66f1[_0xb084('0x3b')]};return db[_0xb084('0x40')][_0xb084('0x1b')](_0x33b8b6)[_0xb084('0x22')](function(_0x42a239){_0x470c10[_0xb084('0x1b')]=_0x42a239;if(_0x277925[_0xb084('0x30')][_0xb084('0x41')]){_0x1e66f1[_0xb084('0x42')]=[{'all':!![]}];}return db[_0xb084('0x40')][_0xb084('0x43')](_0x1e66f1);})[_0xb084('0x22')](function(_0x57ff45){_0x470c10[_0xb084('0x44')]=_0x57ff45;return _0x470c10;})[_0xb084('0x22')](respondWithFilteredResult(_0x30ffee,_0x1e66f1))[_0xb084('0x45')](handleError(_0x30ffee,null));};exports['show']=function(_0x1d933c,_0x5e5102){var _0x1b2804={'raw':![],'where':{'id':_0x1d933c[_0xb084('0x46')]['id']}},_0x878f84={};_0x878f84[_0xb084('0x2f')]=_[_0xb084('0x31')](db[_0xb084('0x40')][_0xb084('0x2c')]);_0x878f84[_0xb084('0x30')]=_[_0xb084('0x31')](_0x1d933c[_0xb084('0x30')]);_0x878f84[_0xb084('0x32')]=_[_0xb084('0x34')](_0x878f84[_0xb084('0x2f')],_0x878f84[_0xb084('0x30')]);_0x1b2804[_0xb084('0x33')]=_[_0xb084('0x34')](_0x878f84[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x1d933c[_0xb084('0x30')][_0xb084('0x35')]));_0x1b2804['attributes']=_0x1b2804[_0xb084('0x33')][_0xb084('0x36')]?_0x1b2804[_0xb084('0x33')]:_0x878f84['model'];if(_0x1d933c['query'][_0xb084('0x41')]){_0x1b2804[_0xb084('0x42')]=[{'all':!![]}];}_0x1b2804=_[_0xb084('0x3d')]({},_0x1b2804,_0x1d933c['options']);return db['Trigger']['find'](_0x1b2804)['then'](handleEntityNotFound(_0x5e5102,null))[_0xb084('0x22')](respondWithResult(_0x5e5102,null))[_0xb084('0x45')](handleError(_0x5e5102,null));};exports[_0xb084('0x47')]=function(_0x793adf,_0x13caa2){return db['Trigger'][_0xb084('0x47')](_0x793adf[_0xb084('0x48')],{})[_0xb084('0x22')](function(_0x48743c){var _0x5d48df=_0x793adf['user'][_0xb084('0x24')]({'plain':!![]});if(!_0x5d48df)throw new Error(_0xb084('0x49'));if(_0x5d48df['role']===_0xb084('0x4a')){var _0x562927=_0x48743c[_0xb084('0x24')]({'plain':!![]});var _0x56095d=_0xb084('0x4b');return db[_0xb084('0x4c')][_0xb084('0x4d')]({'where':{'name':_0x56095d,'userProfileId':_0x5d48df[_0xb084('0x4e')]},'raw':!![]})[_0xb084('0x22')](function(_0x502564){if(_0x502564&&_0x502564[_0xb084('0x4f')]===0x0){return db[_0xb084('0x50')]['create']({'name':_0x562927['name'],'resourceId':_0x562927['id'],'type':_0x502564[_0xb084('0x28')],'sectionId':_0x502564['id']},{})[_0xb084('0x22')](function(){return _0x48743c;});}else{return _0x48743c;}})[_0xb084('0x45')](function(_0x4bf0b4){logger[_0xb084('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bf0b4);throw _0x4bf0b4;});}return _0x48743c;})[_0xb084('0x22')](respondWithResult(_0x13caa2,0xc9))[_0xb084('0x45')](handleError(_0x13caa2,null));};exports[_0xb084('0x21')]=function(_0x33d2d3,_0x26c3da){if(_0x33d2d3[_0xb084('0x48')]['id']){delete _0x33d2d3[_0xb084('0x48')]['id'];}return db[_0xb084('0x40')][_0xb084('0x4d')]({'where':{'id':_0x33d2d3['params']['id']}})[_0xb084('0x22')](handleEntityNotFound(_0x26c3da,null))['then'](saveUpdates(_0x33d2d3[_0xb084('0x48')],null))[_0xb084('0x22')](respondWithResult(_0x26c3da,null))['catch'](handleError(_0x26c3da,null));};exports[_0xb084('0x23')]=function(_0x34e398,_0xaa0b7c){return db[_0xb084('0x40')][_0xb084('0x4d')]({'where':{'id':_0x34e398[_0xb084('0x46')]['id']}})[_0xb084('0x22')](handleEntityNotFound(_0xaa0b7c,null))[_0xb084('0x22')](removeEntity(_0xaa0b7c,null))[_0xb084('0x45')](handleError(_0xaa0b7c,null));};exports[_0xb084('0x51')]=function(_0x1478fa,_0xa0f7a5,_0x2ca9c3){if(_0x1478fa[_0xb084('0x48')]['id']){delete _0x1478fa[_0xb084('0x48')]['id'];}return db[_0xb084('0x40')][_0xb084('0x4d')]({'where':{'id':_0x1478fa['params']['id']}})[_0xb084('0x22')](handleEntityNotFound(_0xa0f7a5,null))[_0xb084('0x22')](function(_0x23782e){if(_0x23782e){_0x1478fa[_0xb084('0x48')][_0xb084('0x52')]=_0x23782e['id'];return db['Condition'][_0xb084('0x47')](_0x1478fa[_0xb084('0x48')]);}})[_0xb084('0x22')](respondWithResult(_0xa0f7a5,null))[_0xb084('0x45')](handleError(_0xa0f7a5,null));};exports[_0xb084('0x53')]=function(_0x27f027,_0x1fe5b4,_0x3a20e4){if(_0x27f027[_0xb084('0x48')]['id']){delete _0x27f027[_0xb084('0x48')]['id'];}return db[_0xb084('0x40')][_0xb084('0x4d')]({'where':{'id':_0x27f027[_0xb084('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fe5b4,null))[_0xb084('0x22')](function(_0x21153d){if(_0x21153d){_0x27f027[_0xb084('0x48')]['TriggerAnyId']=_0x21153d['id'];return db[_0xb084('0x54')][_0xb084('0x47')](_0x27f027[_0xb084('0x48')]);}})[_0xb084('0x22')](respondWithResult(_0x1fe5b4,null))[_0xb084('0x45')](handleError(_0x1fe5b4,null));};exports[_0xb084('0x55')]=function(_0x3a7b13,_0x12f8b3,_0x5ed2aa){var _0x896b1f={};var _0x4226fb={};var _0x469b1e;var _0x29044b;return db['Trigger'][_0xb084('0x56')]({'where':{'id':_0x3a7b13[_0xb084('0x46')]['id']}})[_0xb084('0x22')](handleEntityNotFound(_0x12f8b3,null))[_0xb084('0x22')](function(_0x54b3ba){if(_0x54b3ba){_0x469b1e=_0x54b3ba;_0x4226fb[_0xb084('0x2f')]=_['keys'](db[_0xb084('0x54')][_0xb084('0x2c')]);_0x4226fb[_0xb084('0x30')]=_[_0xb084('0x31')](_0x3a7b13[_0xb084('0x30')]);_0x4226fb['filters']=_['intersection'](_0x4226fb[_0xb084('0x2f')],_0x4226fb['query']);_0x896b1f[_0xb084('0x33')]=_[_0xb084('0x34')](_0x4226fb[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x3a7b13[_0xb084('0x30')]['fields']));_0x896b1f[_0xb084('0x33')]=_0x896b1f[_0xb084('0x33')][_0xb084('0x36')]?_0x896b1f[_0xb084('0x33')]:_0x4226fb[_0xb084('0x2f')];_0x896b1f[_0xb084('0x39')]=qs[_0xb084('0x3a')](_0x3a7b13[_0xb084('0x30')][_0xb084('0x3a')]);_0x896b1f[_0xb084('0x3b')]=qs['filters'](_[_0xb084('0x57')](_0x3a7b13[_0xb084('0x30')],_0x4226fb[_0xb084('0x32')]));if(_0x3a7b13[_0xb084('0x30')]['filter']){_0x896b1f[_0xb084('0x3b')]=_[_0xb084('0x3d')](_0x896b1f[_0xb084('0x3b')],{'$or':_['map'](_0x896b1f[_0xb084('0x33')],function(_0x18bac2){var _0xc77ff6={};_0xc77ff6[_0x18bac2]={'$like':'%'+_0x3a7b13['query'][_0xb084('0x3c')]+'%'};return _0xc77ff6;})});}_0x896b1f=_[_0xb084('0x3d')]({},_0x896b1f,_0x3a7b13['options']);return _0x469b1e[_0xb084('0x55')](_0x896b1f);}})[_0xb084('0x22')](function(_0x348e0e){if(_0x348e0e){_0x29044b=_0x348e0e['length'];if(!_0x3a7b13['query'][_0xb084('0x37')](_0xb084('0x38'))){_0x896b1f['limit']=qs[_0xb084('0x1a')](_0x3a7b13[_0xb084('0x30')]['limit']);_0x896b1f[_0xb084('0x18')]=qs['offset'](_0x3a7b13['query'][_0xb084('0x18')]);}return _0x469b1e['getAllConditions'](_0x896b1f);}})[_0xb084('0x22')](function(_0x14a084){if(_0x14a084){return _0x14a084?{'count':_0x29044b,'rows':_0x14a084}:null;}})[_0xb084('0x22')](respondWithResult(_0x12f8b3,null))[_0xb084('0x45')](handleError(_0x12f8b3,null));};exports[_0xb084('0x58')]=function(_0x9904f0,_0x2d33e6,_0xa292b3){var _0x3759c3={};var _0x1e30e3={};var _0x2347bc;var _0x3492e8;return db[_0xb084('0x40')]['findOne']({'where':{'id':_0x9904f0[_0xb084('0x46')]['id']}})[_0xb084('0x22')](handleEntityNotFound(_0x2d33e6,null))[_0xb084('0x22')](function(_0x4c0476){if(_0x4c0476){_0x2347bc=_0x4c0476;_0x1e30e3['model']=_[_0xb084('0x31')](db['Condition']['rawAttributes']);_0x1e30e3[_0xb084('0x30')]=_[_0xb084('0x31')](_0x9904f0[_0xb084('0x30')]);_0x1e30e3[_0xb084('0x32')]=_[_0xb084('0x34')](_0x1e30e3['model'],_0x1e30e3[_0xb084('0x30')]);_0x3759c3['attributes']=_[_0xb084('0x34')](_0x1e30e3[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x9904f0[_0xb084('0x30')][_0xb084('0x35')]));_0x3759c3[_0xb084('0x33')]=_0x3759c3[_0xb084('0x33')]['length']?_0x3759c3[_0xb084('0x33')]:_0x1e30e3[_0xb084('0x2f')];_0x3759c3[_0xb084('0x39')]=qs[_0xb084('0x3a')](_0x9904f0[_0xb084('0x30')][_0xb084('0x3a')]);_0x3759c3[_0xb084('0x3b')]=qs[_0xb084('0x32')](_[_0xb084('0x57')](_0x9904f0['query'],_0x1e30e3[_0xb084('0x32')]));if(_0x9904f0[_0xb084('0x30')][_0xb084('0x3c')]){_0x3759c3[_0xb084('0x3b')]=_['merge'](_0x3759c3[_0xb084('0x3b')],{'$or':_[_0xb084('0x2b')](_0x3759c3[_0xb084('0x33')],function(_0x31291b){var _0x1ac4c9={};_0x1ac4c9[_0x31291b]={'$like':'%'+_0x9904f0['query']['filter']+'%'};return _0x1ac4c9;})});}_0x3759c3=_['merge']({},_0x3759c3,_0x9904f0[_0xb084('0x3f')]);return _0x2347bc['getAnyConditions'](_0x3759c3);}})[_0xb084('0x22')](function(_0x5f1a22){if(_0x5f1a22){_0x3492e8=_0x5f1a22[_0xb084('0x36')];if(!_0x9904f0['query']['hasOwnProperty'](_0xb084('0x38'))){_0x3759c3[_0xb084('0x1a')]=qs['limit'](_0x9904f0[_0xb084('0x30')][_0xb084('0x1a')]);_0x3759c3[_0xb084('0x18')]=qs[_0xb084('0x18')](_0x9904f0[_0xb084('0x30')][_0xb084('0x18')]);}return _0x2347bc[_0xb084('0x58')](_0x3759c3);}})['then'](function(_0x286b79){if(_0x286b79){return _0x286b79?{'count':_0x3492e8,'rows':_0x286b79}:null;}})['then'](respondWithResult(_0x2d33e6,null))[_0xb084('0x45')](handleError(_0x2d33e6,null));};exports[_0xb084('0x59')]=function(_0x4e36cc,_0x2429c9,_0x59395d){if(_0x4e36cc[_0xb084('0x48')]['id']){delete _0x4e36cc['body']['id'];}return db[_0xb084('0x40')]['find']({'where':{'id':_0x4e36cc[_0xb084('0x46')]['id']}})['then'](handleEntityNotFound(_0x2429c9,null))[_0xb084('0x22')](function(_0x2bdd12){if(_0x2bdd12){_0x4e36cc[_0xb084('0x48')][_0xb084('0x5a')]=_0x2bdd12['id'];return db[_0xb084('0x5b')][_0xb084('0x47')](_0x4e36cc[_0xb084('0x48')]);}})[_0xb084('0x22')](respondWithResult(_0x2429c9,null))['catch'](handleError(_0x2429c9,null));};exports[_0xb084('0x5c')]=function(_0x45e26d,_0x1c5b18,_0x1920d7){var _0x584bf0={};var _0x4eed52={};var _0x27cd51;var _0x27ef32;return db[_0xb084('0x40')][_0xb084('0x56')]({'where':{'id':_0x45e26d['params']['id']}})[_0xb084('0x22')](handleEntityNotFound(_0x1c5b18,null))[_0xb084('0x22')](function(_0x4d7e21){if(_0x4d7e21){_0x27cd51=_0x4d7e21;_0x4eed52[_0xb084('0x2f')]=_[_0xb084('0x31')](db[_0xb084('0x5b')][_0xb084('0x2c')]);_0x4eed52[_0xb084('0x30')]=_[_0xb084('0x31')](_0x45e26d[_0xb084('0x30')]);_0x4eed52[_0xb084('0x32')]=_['intersection'](_0x4eed52['model'],_0x4eed52[_0xb084('0x30')]);_0x584bf0['attributes']=_['intersection'](_0x4eed52[_0xb084('0x2f')],qs[_0xb084('0x35')](_0x45e26d[_0xb084('0x30')][_0xb084('0x35')]));_0x584bf0[_0xb084('0x33')]=_0x584bf0[_0xb084('0x33')][_0xb084('0x36')]?_0x584bf0[_0xb084('0x33')]:_0x4eed52[_0xb084('0x2f')];_0x584bf0['order']=qs[_0xb084('0x3a')](_0x45e26d[_0xb084('0x30')][_0xb084('0x3a')]);_0x584bf0[_0xb084('0x3b')]=qs[_0xb084('0x32')](_[_0xb084('0x57')](_0x45e26d[_0xb084('0x30')],_0x4eed52[_0xb084('0x32')]));if(_0x45e26d[_0xb084('0x30')][_0xb084('0x3c')]){_0x584bf0[_0xb084('0x3b')]=_['merge'](_0x584bf0[_0xb084('0x3b')],{'$or':_['map'](_0x584bf0[_0xb084('0x33')],function(_0x4bae95){var _0x1fb9a={};_0x1fb9a[_0x4bae95]={'$like':'%'+_0x45e26d[_0xb084('0x30')][_0xb084('0x3c')]+'%'};return _0x1fb9a;})});}_0x584bf0=_[_0xb084('0x3d')]({},_0x584bf0,_0x45e26d['options']);return _0x27cd51[_0xb084('0x5c')](_0x584bf0);}})[_0xb084('0x22')](function(_0x292711){if(_0x292711){_0x27ef32=_0x292711[_0xb084('0x36')];if(!_0x45e26d[_0xb084('0x30')][_0xb084('0x37')]('nolimit')){_0x584bf0[_0xb084('0x1a')]=qs[_0xb084('0x1a')](_0x45e26d[_0xb084('0x30')][_0xb084('0x1a')]);_0x584bf0[_0xb084('0x18')]=qs[_0xb084('0x18')](_0x45e26d[_0xb084('0x30')][_0xb084('0x18')]);}return _0x27cd51['getActions'](_0x584bf0);}})['then'](function(_0x1cdc7f){if(_0x1cdc7f){return _0x1cdc7f?{'count':_0x27ef32,'rows':_0x1cdc7f}:null;}})[_0xb084('0x22')](respondWithResult(_0x1c5b18,null))[_0xb084('0x45')](handleError(_0x1c5b18,null));}; \ No newline at end of file +var _0x3de0=['show','params','length','includeAll','find','create','role','get','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','order','findOne','getAnyConditions','nolimit','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','Triggers','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','Trigger','catch'];(function(_0x3073ca,_0x85dfb4){var _0x2df586=function(_0x413054){while(--_0x413054){_0x3073ca['push'](_0x3073ca['shift']());}};_0x2df586(++_0x85dfb4);}(_0x3de0,0x76));var _0x03de=function(_0x326c66,_0x253354){_0x326c66=_0x326c66-0x0;var _0x30baff=_0x3de0[_0x326c66];return _0x30baff;};'use strict';var emlformat=require(_0x03de('0x0'));var rimraf=require(_0x03de('0x1'));var zipdir=require(_0x03de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x03de('0x3'));var BPromise=require(_0x03de('0x4'));var Mustache=require(_0x03de('0x5'));var util=require('util');var path=require(_0x03de('0x6'));var sox=require(_0x03de('0x7'));var csv=require(_0x03de('0x8'));var ejs=require(_0x03de('0x9'));var fs=require('fs');var fs_extra=require(_0x03de('0xa'));var _=require(_0x03de('0xb'));var squel=require(_0x03de('0xc'));var crypto=require(_0x03de('0xd'));var jsforce=require(_0x03de('0xe'));var deskjs=require(_0x03de('0xf'));var toCsv=require(_0x03de('0x8'));var querystring=require(_0x03de('0x10'));var Papa=require('papaparse');var Redis=require(_0x03de('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x03de('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x03de('0x13'))(_0x03de('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x03de('0x15'));var db=require(_0x03de('0x16'))['db'];function respondWithStatusCode(_0xc03d37,_0x26210d){_0x26210d=_0x26210d||0xcc;return function(_0x3939f9){if(_0x3939f9){return _0xc03d37[_0x03de('0x17')](_0x26210d);}return _0xc03d37[_0x03de('0x18')](_0x26210d)[_0x03de('0x19')]();};}function respondWithResult(_0x47c658,_0x5d3e72){_0x5d3e72=_0x5d3e72||0xc8;return function(_0x598f3c){if(_0x598f3c){return _0x47c658['status'](_0x5d3e72)[_0x03de('0x1a')](_0x598f3c);}};}function respondWithFilteredResult(_0x4b16c6,_0x186e00){return function(_0x134345){if(_0x134345){var _0x481e61=typeof _0x186e00[_0x03de('0x1b')]==='undefined'&&typeof _0x186e00[_0x03de('0x1c')]===_0x03de('0x1d');var _0x2520e4=_0x134345[_0x03de('0x1e')];var _0x3aa8e2=_0x481e61?0x0:_0x186e00[_0x03de('0x1b')];var _0x43c295=_0x481e61?_0x134345[_0x03de('0x1e')]:_0x186e00[_0x03de('0x1b')]+_0x186e00[_0x03de('0x1c')];var _0x5203cc;if(_0x43c295>=_0x2520e4){_0x43c295=_0x2520e4;_0x5203cc=0xc8;}else{_0x5203cc=0xce;}_0x4b16c6['status'](_0x5203cc);return _0x4b16c6[_0x03de('0x1f')](_0x03de('0x20'),_0x3aa8e2+'-'+_0x43c295+'/'+_0x2520e4)[_0x03de('0x1a')](_0x134345);}return null;};}function patchUpdates(_0x187056){return function(_0x4c2892){try{jsonpatch['apply'](_0x4c2892,_0x187056,!![]);}catch(_0x34c347){return BPromise[_0x03de('0x21')](_0x34c347);}return _0x4c2892[_0x03de('0x22')]();};}function saveUpdates(_0x2f3c4c,_0x2697a3){return function(_0x3d8716){if(_0x3d8716){return _0x3d8716[_0x03de('0x23')](_0x2f3c4c)[_0x03de('0x24')](function(_0x4c5f2a){return _0x4c5f2a;});}return null;};}function removeEntity(_0x101a6d,_0x4fd979){return function(_0x81f04b){if(_0x81f04b){return _0x81f04b[_0x03de('0x25')]()['then'](function(){var _0x50f934=_0x81f04b['get']({'plain':!![]});var _0x137f2c=_0x03de('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x137f2c,'resourceId':_0x50f934['id']}})[_0x03de('0x24')](function(){return _0x81f04b;});})[_0x03de('0x24')](function(){_0x101a6d[_0x03de('0x18')](0xcc)[_0x03de('0x19')]();});}};}function handleEntityNotFound(_0x41b3d4,_0x35c3bb){return function(_0x2922f1){if(!_0x2922f1){_0x41b3d4[_0x03de('0x17')](0x194);}return _0x2922f1;};}function handleError(_0x1bec9c,_0x250ddb){_0x250ddb=_0x250ddb||0x1f4;return function(_0x15f05f){logger[_0x03de('0x27')](_0x15f05f[_0x03de('0x28')]);if(_0x15f05f[_0x03de('0x29')]){delete _0x15f05f[_0x03de('0x29')];}_0x1bec9c[_0x03de('0x18')](_0x250ddb)[_0x03de('0x2a')](_0x15f05f);};}exports[_0x03de('0x2b')]=function(_0x2930dc,_0x3c533c){var _0x5441b9={},_0x33ae6c={},_0x5510f7={'count':0x0,'rows':[]};var _0x3f6c34=_[_0x03de('0x2c')](db['Trigger'][_0x03de('0x2d')],function(_0x173a10){return{'name':_0x173a10[_0x03de('0x2e')],'type':_0x173a10[_0x03de('0x2f')]['key']};});_0x33ae6c[_0x03de('0x30')]=_[_0x03de('0x2c')](_0x3f6c34,_0x03de('0x29'));_0x33ae6c[_0x03de('0x31')]=_[_0x03de('0x32')](_0x2930dc[_0x03de('0x31')]);_0x33ae6c[_0x03de('0x33')]=_[_0x03de('0x34')](_0x33ae6c['model'],_0x33ae6c['query']);_0x5441b9[_0x03de('0x35')]=_[_0x03de('0x34')](_0x33ae6c['model'],qs[_0x03de('0x36')](_0x2930dc[_0x03de('0x31')][_0x03de('0x36')]));_0x5441b9[_0x03de('0x35')]=_0x5441b9[_0x03de('0x35')]['length']?_0x5441b9['attributes']:_0x33ae6c[_0x03de('0x30')];if(!_0x2930dc[_0x03de('0x31')][_0x03de('0x37')]('nolimit')){_0x5441b9[_0x03de('0x1c')]=qs[_0x03de('0x1c')](_0x2930dc[_0x03de('0x31')][_0x03de('0x1c')]);_0x5441b9[_0x03de('0x1b')]=qs[_0x03de('0x1b')](_0x2930dc['query'][_0x03de('0x1b')]);}_0x5441b9['order']=qs[_0x03de('0x38')](_0x2930dc[_0x03de('0x31')]['sort']);_0x5441b9[_0x03de('0x39')]=qs['filters'](_[_0x03de('0x3a')](_0x2930dc[_0x03de('0x31')],_0x33ae6c[_0x03de('0x33')]),_0x3f6c34);if(_0x2930dc[_0x03de('0x31')][_0x03de('0x3b')]){_0x5441b9[_0x03de('0x39')]=_[_0x03de('0x3c')](_0x5441b9[_0x03de('0x39')],{'$or':_['map'](_0x3f6c34,function(_0x52b436){if(_0x52b436['type']!==_0x03de('0x3d')){var _0x995bda={};_0x995bda[_0x52b436[_0x03de('0x29')]]={'$like':'%'+_0x2930dc[_0x03de('0x31')][_0x03de('0x3b')]+'%'};return _0x995bda;}})});}_0x5441b9=_[_0x03de('0x3c')]({},_0x5441b9,_0x2930dc[_0x03de('0x3e')]);var _0x5c4ab5={'where':_0x5441b9['where']};return db['Trigger'][_0x03de('0x1e')](_0x5c4ab5)[_0x03de('0x24')](function(_0x4b1da1){_0x5510f7[_0x03de('0x1e')]=_0x4b1da1;if(_0x2930dc['query']['includeAll']){_0x5441b9[_0x03de('0x3f')]=[{'all':!![]}];}return db[_0x03de('0x40')]['findAll'](_0x5441b9);})[_0x03de('0x24')](function(_0xd3203f){_0x5510f7['rows']=_0xd3203f;return _0x5510f7;})[_0x03de('0x24')](respondWithFilteredResult(_0x3c533c,_0x5441b9))[_0x03de('0x41')](handleError(_0x3c533c,null));};exports[_0x03de('0x42')]=function(_0x592230,_0x1cd9e5){var _0x19e4ca={'raw':![],'where':{'id':_0x592230[_0x03de('0x43')]['id']}},_0x3732de={};_0x3732de['model']=_[_0x03de('0x32')](db[_0x03de('0x40')][_0x03de('0x2d')]);_0x3732de['query']=_['keys'](_0x592230[_0x03de('0x31')]);_0x3732de['filters']=_[_0x03de('0x34')](_0x3732de[_0x03de('0x30')],_0x3732de['query']);_0x19e4ca[_0x03de('0x35')]=_[_0x03de('0x34')](_0x3732de[_0x03de('0x30')],qs['fields'](_0x592230[_0x03de('0x31')]['fields']));_0x19e4ca['attributes']=_0x19e4ca[_0x03de('0x35')][_0x03de('0x44')]?_0x19e4ca[_0x03de('0x35')]:_0x3732de[_0x03de('0x30')];if(_0x592230[_0x03de('0x31')][_0x03de('0x45')]){_0x19e4ca['include']=[{'all':!![]}];}_0x19e4ca=_[_0x03de('0x3c')]({},_0x19e4ca,_0x592230[_0x03de('0x3e')]);return db[_0x03de('0x40')][_0x03de('0x46')](_0x19e4ca)['then'](handleEntityNotFound(_0x1cd9e5,null))[_0x03de('0x24')](respondWithResult(_0x1cd9e5,null))[_0x03de('0x41')](handleError(_0x1cd9e5,null));};exports[_0x03de('0x47')]=function(_0x1de506,_0x1e014a){return db[_0x03de('0x40')][_0x03de('0x47')](_0x1de506['body'],{})[_0x03de('0x24')](function(_0xa0effb){var _0x4520fa=_0x1de506['user']['get']({'plain':!![]});if(!_0x4520fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4520fa[_0x03de('0x48')]==='user'){var _0x14841a=_0xa0effb[_0x03de('0x49')]({'plain':!![]});var _0x28a7a4=_0x03de('0x26');return db['UserProfileSection'][_0x03de('0x46')]({'where':{'name':_0x28a7a4,'userProfileId':_0x4520fa[_0x03de('0x4a')]},'raw':!![]})[_0x03de('0x24')](function(_0x6a8f2c){if(_0x6a8f2c&&_0x6a8f2c[_0x03de('0x4b')]===0x0){return db[_0x03de('0x4c')][_0x03de('0x47')]({'name':_0x14841a[_0x03de('0x29')],'resourceId':_0x14841a['id'],'type':_0x6a8f2c[_0x03de('0x29')],'sectionId':_0x6a8f2c['id']},{})['then'](function(){return _0xa0effb;});}else{return _0xa0effb;}})['catch'](function(_0xeb23da){logger[_0x03de('0x27')](_0x03de('0x4d'),_0xeb23da);throw _0xeb23da;});}return _0xa0effb;})[_0x03de('0x24')](respondWithResult(_0x1e014a,0xc9))['catch'](handleError(_0x1e014a,null));};exports[_0x03de('0x23')]=function(_0x2fa7df,_0x7fc2de){if(_0x2fa7df[_0x03de('0x4e')]['id']){delete _0x2fa7df[_0x03de('0x4e')]['id'];}return db[_0x03de('0x40')][_0x03de('0x46')]({'where':{'id':_0x2fa7df[_0x03de('0x43')]['id']}})[_0x03de('0x24')](handleEntityNotFound(_0x7fc2de,null))[_0x03de('0x24')](saveUpdates(_0x2fa7df[_0x03de('0x4e')],null))[_0x03de('0x24')](respondWithResult(_0x7fc2de,null))['catch'](handleError(_0x7fc2de,null));};exports[_0x03de('0x25')]=function(_0x5eb4eb,_0x54f5e0){return db[_0x03de('0x40')][_0x03de('0x46')]({'where':{'id':_0x5eb4eb['params']['id']}})['then'](handleEntityNotFound(_0x54f5e0,null))[_0x03de('0x24')](removeEntity(_0x54f5e0,null))[_0x03de('0x41')](handleError(_0x54f5e0,null));};exports['addAllCondition']=function(_0x1ea497,_0x1124bd,_0x2e96b1){if(_0x1ea497[_0x03de('0x4e')]['id']){delete _0x1ea497['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x1ea497[_0x03de('0x43')]['id']}})[_0x03de('0x24')](handleEntityNotFound(_0x1124bd,null))[_0x03de('0x24')](function(_0x5773a1){if(_0x5773a1){_0x1ea497[_0x03de('0x4e')][_0x03de('0x4f')]=_0x5773a1['id'];return db[_0x03de('0x50')][_0x03de('0x47')](_0x1ea497[_0x03de('0x4e')]);}})[_0x03de('0x24')](respondWithResult(_0x1124bd,null))['catch'](handleError(_0x1124bd,null));};exports[_0x03de('0x51')]=function(_0x492174,_0xa66427,_0x12f99b){if(_0x492174['body']['id']){delete _0x492174[_0x03de('0x4e')]['id'];}return db[_0x03de('0x40')]['find']({'where':{'id':_0x492174[_0x03de('0x43')]['id']}})[_0x03de('0x24')](handleEntityNotFound(_0xa66427,null))['then'](function(_0x191e71){if(_0x191e71){_0x492174[_0x03de('0x4e')][_0x03de('0x52')]=_0x191e71['id'];return db[_0x03de('0x50')][_0x03de('0x47')](_0x492174['body']);}})[_0x03de('0x24')](respondWithResult(_0xa66427,null))[_0x03de('0x41')](handleError(_0xa66427,null));};exports[_0x03de('0x53')]=function(_0x2542d0,_0x27abee,_0x52e394){var _0xa191a4={};var _0x4d4cdd={};var _0x161e66;var _0x5cfaa1;return db[_0x03de('0x40')]['findOne']({'where':{'id':_0x2542d0[_0x03de('0x43')]['id']}})['then'](handleEntityNotFound(_0x27abee,null))[_0x03de('0x24')](function(_0x2a8d3d){if(_0x2a8d3d){_0x161e66=_0x2a8d3d;_0x4d4cdd[_0x03de('0x30')]=_[_0x03de('0x32')](db[_0x03de('0x50')][_0x03de('0x2d')]);_0x4d4cdd[_0x03de('0x31')]=_[_0x03de('0x32')](_0x2542d0[_0x03de('0x31')]);_0x4d4cdd[_0x03de('0x33')]=_['intersection'](_0x4d4cdd[_0x03de('0x30')],_0x4d4cdd[_0x03de('0x31')]);_0xa191a4[_0x03de('0x35')]=_[_0x03de('0x34')](_0x4d4cdd['model'],qs['fields'](_0x2542d0['query'][_0x03de('0x36')]));_0xa191a4[_0x03de('0x35')]=_0xa191a4['attributes']['length']?_0xa191a4[_0x03de('0x35')]:_0x4d4cdd['model'];_0xa191a4[_0x03de('0x54')]=qs['sort'](_0x2542d0[_0x03de('0x31')][_0x03de('0x38')]);_0xa191a4[_0x03de('0x39')]=qs['filters'](_[_0x03de('0x3a')](_0x2542d0[_0x03de('0x31')],_0x4d4cdd[_0x03de('0x33')]));if(_0x2542d0[_0x03de('0x31')][_0x03de('0x3b')]){_0xa191a4['where']=_['merge'](_0xa191a4[_0x03de('0x39')],{'$or':_[_0x03de('0x2c')](_0xa191a4['attributes'],function(_0x5efbea){var _0x41fcc8={};_0x41fcc8[_0x5efbea]={'$like':'%'+_0x2542d0[_0x03de('0x31')][_0x03de('0x3b')]+'%'};return _0x41fcc8;})});}_0xa191a4=_[_0x03de('0x3c')]({},_0xa191a4,_0x2542d0['options']);return _0x161e66[_0x03de('0x53')](_0xa191a4);}})['then'](function(_0x3a5afa){if(_0x3a5afa){_0x5cfaa1=_0x3a5afa[_0x03de('0x44')];if(!_0x2542d0[_0x03de('0x31')][_0x03de('0x37')]('nolimit')){_0xa191a4['limit']=qs['limit'](_0x2542d0[_0x03de('0x31')][_0x03de('0x1c')]);_0xa191a4[_0x03de('0x1b')]=qs['offset'](_0x2542d0['query']['offset']);}return _0x161e66[_0x03de('0x53')](_0xa191a4);}})[_0x03de('0x24')](function(_0x583e08){if(_0x583e08){return _0x583e08?{'count':_0x5cfaa1,'rows':_0x583e08}:null;}})[_0x03de('0x24')](respondWithResult(_0x27abee,null))[_0x03de('0x41')](handleError(_0x27abee,null));};exports['getAnyConditions']=function(_0x5e26d5,_0x53238f,_0x1d064e){var _0x1b1050={};var _0x1559e8={};var _0xe3365d;var _0x316573;return db[_0x03de('0x40')][_0x03de('0x55')]({'where':{'id':_0x5e26d5['params']['id']}})['then'](handleEntityNotFound(_0x53238f,null))['then'](function(_0x2a809f){if(_0x2a809f){_0xe3365d=_0x2a809f;_0x1559e8['model']=_[_0x03de('0x32')](db[_0x03de('0x50')][_0x03de('0x2d')]);_0x1559e8[_0x03de('0x31')]=_['keys'](_0x5e26d5[_0x03de('0x31')]);_0x1559e8[_0x03de('0x33')]=_[_0x03de('0x34')](_0x1559e8[_0x03de('0x30')],_0x1559e8[_0x03de('0x31')]);_0x1b1050[_0x03de('0x35')]=_[_0x03de('0x34')](_0x1559e8['model'],qs[_0x03de('0x36')](_0x5e26d5['query'][_0x03de('0x36')]));_0x1b1050[_0x03de('0x35')]=_0x1b1050[_0x03de('0x35')][_0x03de('0x44')]?_0x1b1050['attributes']:_0x1559e8[_0x03de('0x30')];_0x1b1050[_0x03de('0x54')]=qs[_0x03de('0x38')](_0x5e26d5[_0x03de('0x31')][_0x03de('0x38')]);_0x1b1050['where']=qs[_0x03de('0x33')](_[_0x03de('0x3a')](_0x5e26d5[_0x03de('0x31')],_0x1559e8[_0x03de('0x33')]));if(_0x5e26d5[_0x03de('0x31')][_0x03de('0x3b')]){_0x1b1050['where']=_[_0x03de('0x3c')](_0x1b1050[_0x03de('0x39')],{'$or':_[_0x03de('0x2c')](_0x1b1050[_0x03de('0x35')],function(_0x20d4d2){var _0x3301be={};_0x3301be[_0x20d4d2]={'$like':'%'+_0x5e26d5['query'][_0x03de('0x3b')]+'%'};return _0x3301be;})});}_0x1b1050=_[_0x03de('0x3c')]({},_0x1b1050,_0x5e26d5[_0x03de('0x3e')]);return _0xe3365d[_0x03de('0x56')](_0x1b1050);}})[_0x03de('0x24')](function(_0x4dda83){if(_0x4dda83){_0x316573=_0x4dda83['length'];if(!_0x5e26d5['query'][_0x03de('0x37')](_0x03de('0x57'))){_0x1b1050[_0x03de('0x1c')]=qs[_0x03de('0x1c')](_0x5e26d5[_0x03de('0x31')]['limit']);_0x1b1050[_0x03de('0x1b')]=qs[_0x03de('0x1b')](_0x5e26d5[_0x03de('0x31')][_0x03de('0x1b')]);}return _0xe3365d[_0x03de('0x56')](_0x1b1050);}})[_0x03de('0x24')](function(_0x56f373){if(_0x56f373){return _0x56f373?{'count':_0x316573,'rows':_0x56f373}:null;}})[_0x03de('0x24')](respondWithResult(_0x53238f,null))[_0x03de('0x41')](handleError(_0x53238f,null));};exports[_0x03de('0x58')]=function(_0x2d7ca6,_0x36a4a7,_0x4219f5){if(_0x2d7ca6['body']['id']){delete _0x2d7ca6[_0x03de('0x4e')]['id'];}return db['Trigger'][_0x03de('0x46')]({'where':{'id':_0x2d7ca6[_0x03de('0x43')]['id']}})[_0x03de('0x24')](handleEntityNotFound(_0x36a4a7,null))[_0x03de('0x24')](function(_0x5256a3){if(_0x5256a3){_0x2d7ca6[_0x03de('0x4e')][_0x03de('0x59')]=_0x5256a3['id'];return db[_0x03de('0x5a')]['create'](_0x2d7ca6[_0x03de('0x4e')]);}})[_0x03de('0x24')](respondWithResult(_0x36a4a7,null))[_0x03de('0x41')](handleError(_0x36a4a7,null));};exports['getActions']=function(_0x5aebea,_0x502da7,_0x264afc){var _0x126fb5={};var _0x5e4c79={};var _0x2813d6;var _0x192b8e;return db['Trigger'][_0x03de('0x55')]({'where':{'id':_0x5aebea['params']['id']}})['then'](handleEntityNotFound(_0x502da7,null))[_0x03de('0x24')](function(_0x1e3a6e){if(_0x1e3a6e){_0x2813d6=_0x1e3a6e;_0x5e4c79[_0x03de('0x30')]=_['keys'](db[_0x03de('0x5a')]['rawAttributes']);_0x5e4c79[_0x03de('0x31')]=_[_0x03de('0x32')](_0x5aebea['query']);_0x5e4c79[_0x03de('0x33')]=_[_0x03de('0x34')](_0x5e4c79[_0x03de('0x30')],_0x5e4c79[_0x03de('0x31')]);_0x126fb5['attributes']=_[_0x03de('0x34')](_0x5e4c79['model'],qs['fields'](_0x5aebea[_0x03de('0x31')][_0x03de('0x36')]));_0x126fb5['attributes']=_0x126fb5['attributes'][_0x03de('0x44')]?_0x126fb5[_0x03de('0x35')]:_0x5e4c79[_0x03de('0x30')];_0x126fb5[_0x03de('0x54')]=qs[_0x03de('0x38')](_0x5aebea['query'][_0x03de('0x38')]);_0x126fb5[_0x03de('0x39')]=qs['filters'](_[_0x03de('0x3a')](_0x5aebea[_0x03de('0x31')],_0x5e4c79[_0x03de('0x33')]));if(_0x5aebea[_0x03de('0x31')][_0x03de('0x3b')]){_0x126fb5[_0x03de('0x39')]=_[_0x03de('0x3c')](_0x126fb5['where'],{'$or':_[_0x03de('0x2c')](_0x126fb5[_0x03de('0x35')],function(_0x28a815){var _0x22b842={};_0x22b842[_0x28a815]={'$like':'%'+_0x5aebea[_0x03de('0x31')][_0x03de('0x3b')]+'%'};return _0x22b842;})});}_0x126fb5=_[_0x03de('0x3c')]({},_0x126fb5,_0x5aebea[_0x03de('0x3e')]);return _0x2813d6[_0x03de('0x5b')](_0x126fb5);}})['then'](function(_0x278cb8){if(_0x278cb8){_0x192b8e=_0x278cb8['length'];if(!_0x5aebea['query'][_0x03de('0x37')](_0x03de('0x57'))){_0x126fb5[_0x03de('0x1c')]=qs[_0x03de('0x1c')](_0x5aebea[_0x03de('0x31')][_0x03de('0x1c')]);_0x126fb5[_0x03de('0x1b')]=qs[_0x03de('0x1b')](_0x5aebea['query'][_0x03de('0x1b')]);}return _0x2813d6[_0x03de('0x5b')](_0x126fb5);}})[_0x03de('0x24')](function(_0x2f54cf){if(_0x2f54cf){return _0x2f54cf?{'count':_0x192b8e,'rows':_0x2f54cf}:null;}})[_0x03de('0x24')](respondWithResult(_0x502da7,null))['catch'](handleError(_0x502da7,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index b84b7e9..ab2cc27 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 _0x43fd=['Trigger','tools_triggers','util','moment','bluebird','path','../../config/environment','./trigger.attributes','exports','define'];(function(_0x11c11f,_0x4c447f){var _0x537082=function(_0x5bc3cb){while(--_0x5bc3cb){_0x11c11f['push'](_0x11c11f['shift']());}};_0x537082(++_0x4c447f);}(_0x43fd,0x1ec));var _0xd43f=function(_0x5ebc24,_0xfbae35){_0x5ebc24=_0x5ebc24-0x0;var _0x5a98b2=_0x43fd[_0x5ebc24];return _0x5a98b2;};'use strict';var _=require('lodash');var util=require(_0xd43f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd43f('0x1'));var BPromise=require(_0xd43f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd43f('0x3'));var rimraf=require('rimraf');var config=require(_0xd43f('0x4'));var attributes=require(_0xd43f('0x5'));module[_0xd43f('0x6')]=function(_0x33ddff,_0x52e75f){return _0x33ddff[_0xd43f('0x7')](_0xd43f('0x8'),attributes,{'tableName':_0xd43f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf675=['Trigger','tools_triggers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./trigger.attributes','exports'];(function(_0x468c64,_0xc8ffba){var _0x3565a7=function(_0x1347bd){while(--_0x1347bd){_0x468c64['push'](_0x468c64['shift']());}};_0x3565a7(++_0xc8ffba);}(_0xf675,0x199));var _0x5f67=function(_0x35dfe6,_0x4244fa){_0x35dfe6=_0x35dfe6-0x0;var _0x59651c=_0xf675[_0x35dfe6];return _0x59651c;};'use strict';var _=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var logger=require(_0x5f67('0x2'))('api');var moment=require(_0x5f67('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f67('0x4'));var fs=require('fs');var path=require(_0x5f67('0x5'));var rimraf=require(_0x5f67('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f67('0x7'));module[_0x5f67('0x8')]=function(_0x2919cc,_0xd4b727){return _0x2919cc['define'](_0x5f67('0x9'),attributes,{'tableName':_0x5f67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index d28a7bb..68ff683 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 _0xb37b=['attributes','find','ShowTrigger','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','Trigger','options','raw','where','limit','include','map','model'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xb37b,0xc9));var _0xbb37=function(_0x1bdc6f,_0x296305){_0x1bdc6f=_0x1bdc6f-0x0;var _0x539c54=_0xb37b[_0x1bdc6f];return _0x539c54;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbb37('0x0'));var BPromise=require(_0xbb37('0x1'));var rs=require(_0xbb37('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb37('0x3'))['db'];var utils=require(_0xbb37('0x4'));var logger=require('../../config/logger')(_0xbb37('0x5'));var config=require(_0xbb37('0x6'));var jayson=require(_0xbb37('0x7'));var client=jayson[_0xbb37('0x8')][_0xbb37('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a24,_0x1287bf,_0x56582d){return new BPromise(function(_0x297c70,_0x3e91bc){return client['request'](_0x4d7a24,_0x56582d)[_0xbb37('0xa')](function(_0x2ac886){logger[_0xbb37('0xb')](_0xbb37('0xc'),_0x1287bf,_0xbb37('0xd'));logger[_0xbb37('0xe')](_0xbb37('0xf'),_0x1287bf,_0xbb37('0xd'),JSON[_0xbb37('0x10')](_0x2ac886));if(_0x2ac886[_0xbb37('0x11')]){if(_0x2ac886[_0xbb37('0x11')]['code']===0x1f4){logger[_0xbb37('0x11')](_0xbb37('0xc'),_0x1287bf,_0x2ac886[_0xbb37('0x11')]['message']);return _0x3e91bc(_0x2ac886[_0xbb37('0x11')][_0xbb37('0x12')]);}logger['error'](_0xbb37('0xc'),_0x1287bf,_0x2ac886[_0xbb37('0x11')][_0xbb37('0x12')]);return _0x297c70(_0x2ac886[_0xbb37('0x11')][_0xbb37('0x12')]);}else{logger[_0xbb37('0xb')](_0xbb37('0xc'),_0x1287bf,_0xbb37('0xd'));_0x297c70(_0x2ac886[_0xbb37('0x13')][_0xbb37('0x12')]);}})[_0xbb37('0x14')](function(_0x35cfe3){logger[_0xbb37('0x11')]('Trigger,\x20%s,\x20%s',_0x1287bf,_0x35cfe3);_0x3e91bc(_0x35cfe3);});});}exports[_0xbb37('0x15')]=function(_0x41dc59){var _0x50a259=this;return new Promise(function(_0x4d1880,_0x302fbf){return db[_0xbb37('0x16')]['findAll']({'raw':_0x41dc59['options']?_0x41dc59[_0xbb37('0x17')][_0xbb37('0x18')]===undefined?!![]:![]:!![],'where':_0x41dc59[_0xbb37('0x17')]?_0x41dc59['options'][_0xbb37('0x19')]||null:null,'attributes':_0x41dc59['options']?_0x41dc59[_0xbb37('0x17')]['attributes']||null:null,'limit':_0x41dc59[_0xbb37('0x17')]?_0x41dc59['options'][_0xbb37('0x1a')]||null:null,'include':_0x41dc59[_0xbb37('0x17')]?_0x41dc59[_0xbb37('0x17')][_0xbb37('0x1b')]?_[_0xbb37('0x1c')](_0x41dc59[_0xbb37('0x17')]['include'],function(_0x314f0d){return{'model':db[_0x314f0d[_0xbb37('0x1d')]],'as':_0x314f0d['as'],'attributes':_0x314f0d['attributes'],'include':_0x314f0d[_0xbb37('0x1b')]?_[_0xbb37('0x1c')](_0x314f0d[_0xbb37('0x1b')],function(_0x3de941){return{'model':db[_0x3de941[_0xbb37('0x1d')]],'as':_0x3de941['as'],'attributes':_0x3de941[_0xbb37('0x1e')],'include':_0x3de941[_0xbb37('0x1b')]?_[_0xbb37('0x1c')](_0x3de941[_0xbb37('0x1b')],function(_0x2eff68){return{'model':db[_0x2eff68[_0xbb37('0x1d')]],'as':_0x2eff68['as'],'attributes':_0x2eff68[_0xbb37('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbb37('0xa')](function(_0x1522a7){logger[_0xbb37('0xb')]('GetTrigger',_0x41dc59);logger['debug'](_0xbb37('0x15'),_0x41dc59,JSON[_0xbb37('0x10')](_0x1522a7));_0x4d1880(_0x1522a7);})['catch'](function(_0x47790f){logger['error'](_0xbb37('0x15'),_0x47790f['message'],_0x41dc59);_0x302fbf(_0x50a259[_0xbb37('0x11')](0x1f4,_0x47790f[_0xbb37('0x12')]));});});};exports['ShowTrigger']=function(_0x17110e){var _0x294b82=this;return new Promise(function(_0x55ab4c,_0x34b38a){return db[_0xbb37('0x16')][_0xbb37('0x1f')]({'raw':_0x17110e[_0xbb37('0x17')]?_0x17110e[_0xbb37('0x17')][_0xbb37('0x18')]===undefined?!![]:![]:!![],'where':_0x17110e['options']?_0x17110e[_0xbb37('0x17')][_0xbb37('0x19')]||null:null,'attributes':_0x17110e[_0xbb37('0x17')]?_0x17110e['options'][_0xbb37('0x1e')]||null:null,'include':_0x17110e['options']?_0x17110e[_0xbb37('0x17')][_0xbb37('0x1b')]?_[_0xbb37('0x1c')](_0x17110e[_0xbb37('0x17')][_0xbb37('0x1b')],function(_0xf35992){return{'model':db[_0xf35992[_0xbb37('0x1d')]],'as':_0xf35992['as'],'attributes':_0xf35992[_0xbb37('0x1e')],'include':_0xf35992[_0xbb37('0x1b')]?_['map'](_0xf35992['include'],function(_0x4acf8e){return{'model':db[_0x4acf8e[_0xbb37('0x1d')]],'as':_0x4acf8e['as'],'attributes':_0x4acf8e[_0xbb37('0x1e')],'include':_0x4acf8e[_0xbb37('0x1b')]?_['map'](_0x4acf8e[_0xbb37('0x1b')],function(_0x12c621){return{'model':db[_0x12c621[_0xbb37('0x1d')]],'as':_0x12c621['as'],'attributes':_0x12c621[_0xbb37('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbb37('0xa')](function(_0x3d63b5){logger['info']('ShowTrigger',_0x17110e);logger[_0xbb37('0xe')](_0xbb37('0x20'),_0x17110e,JSON['stringify'](_0x3d63b5));_0x55ab4c(_0x3d63b5);})[_0xbb37('0x14')](function(_0x187edd){logger[_0xbb37('0x11')](_0xbb37('0x20'),_0x187edd[_0xbb37('0x12')],_0x17110e);_0x34b38a(_0x294b82[_0xbb37('0x11')](0x1f4,_0x187edd[_0xbb37('0x12')]));});});}; \ No newline at end of file +var _0xf6fe=['http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','ShowTrigger','find','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf6fe,0x18d));var _0xef6f=function(_0xe5c213,_0x2cddcb){_0xe5c213=_0xe5c213-0x0;var _0xa55910=_0xf6fe[_0xe5c213];return _0xa55910;};'use strict';var _=require('lodash');var util=require(_0xef6f('0x0'));var moment=require(_0xef6f('0x1'));var BPromise=require('bluebird');var rs=require(_0xef6f('0x2'));var fs=require('fs');var Redis=require(_0xef6f('0x3'));var db=require(_0xef6f('0x4'))['db'];var utils=require(_0xef6f('0x5'));var logger=require(_0xef6f('0x6'))(_0xef6f('0x7'));var config=require('../../config/environment');var jayson=require(_0xef6f('0x8'));var client=jayson[_0xef6f('0x9')][_0xef6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c6eb3,_0x554ce3,_0x4e89ef){return new BPromise(function(_0x1a63c4,_0x55f1ad){return client[_0xef6f('0xb')](_0x3c6eb3,_0x4e89ef)[_0xef6f('0xc')](function(_0x458222){logger[_0xef6f('0xd')](_0xef6f('0xe'),_0x554ce3,_0xef6f('0xf'));logger['debug'](_0xef6f('0x10'),_0x554ce3,_0xef6f('0xf'),JSON[_0xef6f('0x11')](_0x458222));if(_0x458222[_0xef6f('0x12')]){if(_0x458222['error'][_0xef6f('0x13')]===0x1f4){logger[_0xef6f('0x12')](_0xef6f('0xe'),_0x554ce3,_0x458222[_0xef6f('0x12')][_0xef6f('0x14')]);return _0x55f1ad(_0x458222['error'][_0xef6f('0x14')]);}logger['error'](_0xef6f('0xe'),_0x554ce3,_0x458222['error'][_0xef6f('0x14')]);return _0x1a63c4(_0x458222[_0xef6f('0x12')]['message']);}else{logger[_0xef6f('0xd')](_0xef6f('0xe'),_0x554ce3,_0xef6f('0xf'));_0x1a63c4(_0x458222[_0xef6f('0x15')][_0xef6f('0x14')]);}})[_0xef6f('0x16')](function(_0x4f17bd){logger[_0xef6f('0x12')](_0xef6f('0xe'),_0x554ce3,_0x4f17bd);_0x55f1ad(_0x4f17bd);});});}exports[_0xef6f('0x17')]=function(_0x12c81a){var _0x32d7ef=this;return new Promise(function(_0x5f1596,_0x1da7f8){return db[_0xef6f('0x18')][_0xef6f('0x19')]({'raw':_0x12c81a['options']?_0x12c81a[_0xef6f('0x1a')][_0xef6f('0x1b')]===undefined?!![]:![]:!![],'where':_0x12c81a[_0xef6f('0x1a')]?_0x12c81a['options'][_0xef6f('0x1c')]||null:null,'attributes':_0x12c81a[_0xef6f('0x1a')]?_0x12c81a['options']['attributes']||null:null,'limit':_0x12c81a[_0xef6f('0x1a')]?_0x12c81a[_0xef6f('0x1a')][_0xef6f('0x1d')]||null:null,'include':_0x12c81a['options']?_0x12c81a[_0xef6f('0x1a')][_0xef6f('0x1e')]?_[_0xef6f('0x1f')](_0x12c81a[_0xef6f('0x1a')]['include'],function(_0x4e57cd){return{'model':db[_0x4e57cd[_0xef6f('0x20')]],'as':_0x4e57cd['as'],'attributes':_0x4e57cd[_0xef6f('0x21')],'include':_0x4e57cd[_0xef6f('0x1e')]?_['map'](_0x4e57cd['include'],function(_0x5da924){return{'model':db[_0x5da924[_0xef6f('0x20')]],'as':_0x5da924['as'],'attributes':_0x5da924[_0xef6f('0x21')],'include':_0x5da924[_0xef6f('0x1e')]?_['map'](_0x5da924[_0xef6f('0x1e')],function(_0x3efe6f){return{'model':db[_0x3efe6f[_0xef6f('0x20')]],'as':_0x3efe6f['as'],'attributes':_0x3efe6f[_0xef6f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xef6f('0xc')](function(_0x298b25){logger['info']('GetTrigger',_0x12c81a);logger['debug'](_0xef6f('0x17'),_0x12c81a,JSON['stringify'](_0x298b25));_0x5f1596(_0x298b25);})[_0xef6f('0x16')](function(_0x22da43){logger[_0xef6f('0x12')](_0xef6f('0x17'),_0x22da43['message'],_0x12c81a);_0x1da7f8(_0x32d7ef[_0xef6f('0x12')](0x1f4,_0x22da43['message']));});});};exports[_0xef6f('0x22')]=function(_0x4098b9){var _0x583702=this;return new Promise(function(_0x4a8c68,_0x19aded){return db[_0xef6f('0x18')][_0xef6f('0x23')]({'raw':_0x4098b9[_0xef6f('0x1a')]?_0x4098b9[_0xef6f('0x1a')][_0xef6f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4098b9[_0xef6f('0x1a')]?_0x4098b9['options']['where']||null:null,'attributes':_0x4098b9[_0xef6f('0x1a')]?_0x4098b9[_0xef6f('0x1a')]['attributes']||null:null,'include':_0x4098b9[_0xef6f('0x1a')]?_0x4098b9['options'][_0xef6f('0x1e')]?_['map'](_0x4098b9[_0xef6f('0x1a')][_0xef6f('0x1e')],function(_0x38e65f){return{'model':db[_0x38e65f[_0xef6f('0x20')]],'as':_0x38e65f['as'],'attributes':_0x38e65f['attributes'],'include':_0x38e65f[_0xef6f('0x1e')]?_['map'](_0x38e65f[_0xef6f('0x1e')],function(_0x11f27d){return{'model':db[_0x11f27d[_0xef6f('0x20')]],'as':_0x11f27d['as'],'attributes':_0x11f27d[_0xef6f('0x21')],'include':_0x11f27d['include']?_[_0xef6f('0x1f')](_0x11f27d[_0xef6f('0x1e')],function(_0x574273){return{'model':db[_0x574273['model']],'as':_0x574273['as'],'attributes':_0x574273[_0xef6f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xef6f('0xc')](function(_0x4efc92){logger['info'](_0xef6f('0x22'),_0x4098b9);logger[_0xef6f('0x24')](_0xef6f('0x22'),_0x4098b9,JSON[_0xef6f('0x11')](_0x4efc92));_0x4a8c68(_0x4efc92);})[_0xef6f('0x16')](function(_0x261f16){logger[_0xef6f('0x12')]('ShowTrigger',_0x261f16['message'],_0x4098b9);_0x19aded(_0x583702[_0xef6f('0x12')](0x1f4,_0x261f16['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index f6baa26..c282201 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 _0x454d=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','clone','put','update','delete','destroy','exports'];(function(_0x531834,_0x10b067){var _0x56fa30=function(_0x55cd1f){while(--_0x55cd1f){_0x531834['push'](_0x531834['shift']());}};_0x56fa30(++_0x10b067);}(_0x454d,0x18c));var _0xd454=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0x454d[_0x239dba];return _0x1ceb11;};'use strict';var multer=require(_0xd454('0x0'));var util=require(_0xd454('0x1'));var path=require(_0xd454('0x2'));var timeout=require(_0xd454('0x3'));var express=require('express');var router=express[_0xd454('0x4')]();var fs_extra=require(_0xd454('0x5'));var auth=require(_0xd454('0x6'));var interaction=require(_0xd454('0x7'));var config=require(_0xd454('0x8'));var controller=require(_0xd454('0x9'));router[_0xd454('0xa')]('/',auth[_0xd454('0xb')](),controller[_0xd454('0xc')]);router[_0xd454('0xa')](_0xd454('0xd'),auth[_0xd454('0xb')](),controller[_0xd454('0xe')]);router[_0xd454('0xf')]('/:id/clone',auth[_0xd454('0xb')](),controller[_0xd454('0x10')]);router['post']('/',auth[_0xd454('0xb')](),controller['create']);router[_0xd454('0x11')](_0xd454('0xd'),auth[_0xd454('0xb')](),controller[_0xd454('0x12')]);router[_0xd454('0x13')](_0xd454('0xd'),auth['isAuthenticated'](),controller[_0xd454('0x14')]);module[_0xd454('0x15')]=router; \ No newline at end of file +var _0x4e21=['../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','clone','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x4e113a,_0x255246){var _0x216431=function(_0x5afff1){while(--_0x5afff1){_0x4e113a['push'](_0x4e113a['shift']());}};_0x216431(++_0x255246);}(_0x4e21,0x1c5));var _0x14e2=function(_0x202cee,_0x8c10b8){_0x202cee=_0x202cee-0x0;var _0x3ebbd1=_0x4e21[_0x202cee];return _0x3ebbd1;};'use strict';var multer=require(_0x14e2('0x0'));var util=require(_0x14e2('0x1'));var path=require(_0x14e2('0x2'));var timeout=require(_0x14e2('0x3'));var express=require('express');var router=express[_0x14e2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x14e2('0x5'));var config=require(_0x14e2('0x6'));var controller=require(_0x14e2('0x7'));router[_0x14e2('0x8')]('/',auth[_0x14e2('0x9')](),controller[_0x14e2('0xa')]);router[_0x14e2('0x8')](_0x14e2('0xb'),auth[_0x14e2('0x9')](),controller['show']);router['post']('/:id/clone',auth[_0x14e2('0x9')](),controller[_0x14e2('0xc')]);router['post']('/',auth[_0x14e2('0x9')](),controller['create']);router[_0x14e2('0xd')]('/:id',auth[_0x14e2('0x9')](),controller[_0x14e2('0xe')]);router[_0x14e2('0xf')]('/:id',auth[_0x14e2('0x9')](),controller['destroy']);module[_0x14e2('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 41985d4..66a8293 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 _0xc28a=['PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED'];(function(_0x589957,_0x557a8b){var _0x2dd207=function(_0x17b4e7){while(--_0x17b4e7){_0x589957['push'](_0x589957['shift']());}};_0x2dd207(++_0x557a8b);}(_0xc28a,0x99));var _0xac28=function(_0x2611e8,_0x436048){_0x2611e8=_0x2611e8-0x0;var _0x4335f1=_0xc28a[_0x2611e8];return _0x4335f1;};'use strict';var Sequelize=require(_0xac28('0x0'));module[_0xac28('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xac28('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x4'),_0xac28('0x5'),_0xac28('0x6')),'allowNull':![],'defaultValue':_0xac28('0x4')},'context':{'type':Sequelize[_0xac28('0x7')],'allowNull':![],'defaultValue':_0xac28('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xac28('0x9'),_0xac28('0xa'),'ALLOWED_FAILED_SCREEN',_0xac28('0xb'),_0xac28('0xc'),_0xac28('0xd'),_0xac28('0xe'),_0xac28('0xf'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xac28('0x7')]},'md5secret':{'type':Sequelize[_0xac28('0x7')]},'remotesecret':{'type':Sequelize[_0xac28('0x7')]},'transport':{'type':Sequelize[_0xac28('0x7')],'defaultValue':_0xac28('0x10'),'set':function(_0xff199e){this[_0xac28('0x11')](_0xac28('0x12'),_0xff199e?_0xff199e[_0xac28('0x13')](','):null);},'get':function(){return this[_0xac28('0x14')](_0xac28('0x12'))?this[_0xac28('0x14')]('transport')[_0xac28('0x15')](','):null;},'comment':_0xac28('0x16')},'dtmfmode':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x17'),_0xac28('0x18'),_0xac28('0x19'),_0xac28('0x1a'),_0xac28('0x1b')),'defaultValue':_0xac28('0x17')},'directmedia':{'type':Sequelize[_0xac28('0x3')]('yes','no',_0xac28('0x1c'),_0xac28('0x1d'),_0xac28('0x1e')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xac28('0x7')]},'directmediadeny':{'type':Sequelize[_0xac28('0x7')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xac28('0x20'),'set':function(_0x330b3c){this[_0xac28('0x11')](_0xac28('0x21'),_0x330b3c?_0x330b3c[_0xac28('0x13')](','):null);},'get':function(){return this[_0xac28('0x14')](_0xac28('0x21'))?this[_0xac28('0x14')]('nat')[_0xac28('0x15')](','):null;},'comment':_0xac28('0x22')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xac28('0x7')]},'pickupgroup':{'type':Sequelize[_0xac28('0x7')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xac28('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xac28('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xac28('0x7')],'defaultValue':_0xac28('0x23')},'allow':{'type':Sequelize[_0xac28('0x7')],'allowNull':![],'defaultValue':_0xac28('0x24'),'set':function(_0x1bbc53){this[_0xac28('0x11')](_0xac28('0x25'),_0x1bbc53?_0x1bbc53[_0xac28('0x13')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xac28('0x14')](_0xac28('0x25'))?this[_0xac28('0x14')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'insecure':{'type':Sequelize[_0xac28('0x7')],'defaultValue':'port,invite','set':function(_0x4c6640){this[_0xac28('0x11')]('insecure',_0x4c6640?_0x4c6640[_0xac28('0x13')](','):null);},'get':function(){return this['getDataValue'](_0xac28('0x26'))?this['getDataValue']('insecure')[_0xac28('0x15')](','):null;},'comment':_0xac28('0x27')},'trustrpid':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no',_0xac28('0x28'))},'promiscredir':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'useclientcode':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'accountcode':{'type':Sequelize[_0xac28('0x29')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xac28('0x7')],'defaultValue':_0xac28('0x2a')},'amaflags':{'type':Sequelize[_0xac28('0x7')]},'callcounter':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xac28('0x29')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'subscribecontext':{'type':Sequelize[_0xac28('0x7')]},'template':{'type':Sequelize[_0xac28('0x7')]},'videosupport':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no',_0xac28('0x2b')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xac28('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'mailbox':{'type':Sequelize[_0xac28('0x7')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xac28('0x2c'),_0xac28('0x2d'))},'session_expires':{'type':Sequelize[_0xac28('0x29')](0xb)},'session_minse':{'type':Sequelize[_0xac28('0x29')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xac28('0x2e'),_0xac28('0x2f')),'defaultValue':_0xac28('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0xac28('0x7')]},'regexten':{'type':Sequelize[_0xac28('0x7')]},'fromdomain':{'type':Sequelize[_0xac28('0x7')]},'fromuser':{'type':Sequelize[_0xac28('0x7')]},'port':{'type':Sequelize[_0xac28('0x29')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no'),'defaultValue':_0xac28('0x1f')},'keepalive':{'type':Sequelize[_0xac28('0x29')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xac28('0x7')]},'rtptimeout':{'type':Sequelize[_0xac28('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xac28('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xac28('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no',_0xac28('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xac28('0x7')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xac28('0x29')](0xb)},'timerb':{'type':Sequelize[_0xac28('0x29')](0xb)},'qualifyfreq':{'type':Sequelize[_0xac28('0x29')](0xb)},'contactpermit':{'type':Sequelize[_0xac28('0x7')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xac28('0x7')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xac28('0x29')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'force_avp':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'icesupport':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'dtlsenable':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no','fingerprint',_0xac28('0x31'))},'dtlsrekey':{'type':Sequelize[_0xac28('0x29')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xac28('0x7')]},'dtlscipher':{'type':Sequelize[_0xac28('0x7')]},'dtlscafile':{'type':Sequelize[_0xac28('0x7')]},'dtlscapath':{'type':Sequelize[_0xac28('0x7')]},'dtlssetup':{'type':Sequelize[_0xac28('0x3')]('active',_0xac28('0x32'),_0xac28('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xac28('0x7')]},'recordofffeature':{'type':Sequelize[_0xac28('0x7')]},'call_limit':{'type':Sequelize[_0xac28('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xac28('0x1f'),'no')},'vmexten':{'type':Sequelize[_0xac28('0x7')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xac28('0x7')]},'parkinglot':{'type':Sequelize[_0xac28('0x7')]},'description':{'type':Sequelize[_0xac28('0x7')]},'host':{'type':Sequelize[_0xac28('0x7')],'defaultValue':_0xac28('0x34')},'canreinvite':{'type':Sequelize[_0xac28('0x3')](_0xac28('0x1f'),'no','nonat',_0xac28('0x1d'),_0xac28('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xac28('0x7')]},'otherFields':{'type':Sequelize[_0xac28('0x7')]},'active':{'type':Sequelize[_0xac28('0x36')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xac28('0x7')],'defaultValue':'no'}}; \ No newline at end of file +var _0x586c=['BOOLEAN','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','\x22\x22\x20<>','INTEGER','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','update','update,nonat'];(function(_0x25efba,_0x831b0f){var _0x52d66a=function(_0x1539fe){while(--_0x1539fe){_0x25efba['push'](_0x25efba['shift']());}};_0x52d66a(++_0x831b0f);}(_0x586c,0x1e7));var _0xc586=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x586c[_0x38537f];return _0x141e23;};'use strict';var Sequelize=require('sequelize');module[_0xc586('0x0')]={'name':{'type':Sequelize[_0xc586('0x1')],'allowNull':![],'unique':_0xc586('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc586('0x3')]('friend',_0xc586('0x4'),_0xc586('0x5')),'allowNull':![],'defaultValue':_0xc586('0x6')},'context':{'type':Sequelize[_0xc586('0x1')],'allowNull':![],'defaultValue':_0xc586('0x7')},'callingpres':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x8'),_0xc586('0x9'),_0xc586('0xa'),_0xc586('0xb'),_0xc586('0xc'),_0xc586('0xd'),_0xc586('0xe'),'PROHIB')},'deny':{'type':Sequelize[_0xc586('0x1')]},'permit':{'type':Sequelize[_0xc586('0x1')]},'secret':{'type':Sequelize[_0xc586('0x1')]},'md5secret':{'type':Sequelize[_0xc586('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xc586('0x1')],'defaultValue':_0xc586('0xf'),'set':function(_0x569b40){this[_0xc586('0x10')](_0xc586('0x11'),_0x569b40?_0x569b40[_0xc586('0x12')](','):null);},'get':function(){return this[_0xc586('0x13')]('transport')?this[_0xc586('0x13')]('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xc586('0x14'),_0xc586('0x15'),_0xc586('0x16'),_0xc586('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no',_0xc586('0x19'),'update',_0xc586('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xc586('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc586('0x1')]},'directmediadeny':{'type':Sequelize[_0xc586('0x1')]},'nat':{'type':Sequelize[_0xc586('0x1')],'defaultValue':_0xc586('0x1b'),'set':function(_0x347918){this[_0xc586('0x10')](_0xc586('0x1c'),_0x347918?_0x347918[_0xc586('0x12')](','):null);},'get':function(){return this[_0xc586('0x13')](_0xc586('0x1c'))?this[_0xc586('0x13')]('nat')[_0xc586('0x1d')](','):null;},'comment':_0xc586('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xc586('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xc586('0x1')]},'language':{'type':Sequelize[_0xc586('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc586('0x1')],'defaultValue':_0xc586('0x1f')},'allow':{'type':Sequelize[_0xc586('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x59fab3){this[_0xc586('0x10')]('allow',_0x59fab3?_0x59fab3['join'](';'):_0xc586('0x20'));},'get':function(){return this[_0xc586('0x13')](_0xc586('0x21'))?this['getDataValue']('allow')[_0xc586('0x1d')](';'):null;},'comment':_0xc586('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0xc586('0x18'),'no')},'insecure':{'type':Sequelize[_0xc586('0x1')],'defaultValue':_0xc586('0x23'),'set':function(_0x36e63f){this[_0xc586('0x10')](_0xc586('0x24'),_0x36e63f?_0x36e63f[_0xc586('0x12')](','):null);},'get':function(){return this[_0xc586('0x13')](_0xc586('0x24'))?this['getDataValue'](_0xc586('0x24'))[_0xc586('0x1d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xc586('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no',_0xc586('0x25'))},'promiscredir':{'type':Sequelize[_0xc586('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xc586('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xc586('0x26')},'amaflags':{'type':Sequelize[_0xc586('0x1')]},'callcounter':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no'),'defaultValue':_0xc586('0x18')},'busylevel':{'type':Sequelize[_0xc586('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc586('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xc586('0x1')]},'videosupport':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0xc586('0x1')]},'session_timers':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x28'),_0xc586('0x29'),_0xc586('0x2a'))},'session_expires':{'type':Sequelize[_0xc586('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xc586('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x2b'),'uas'),'defaultValue':_0xc586('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xc586('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xc586('0x1')]},'fromuser':{'type':Sequelize[_0xc586('0x1')]},'port':{'type':Sequelize[_0xc586('0x27')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xc586('0x1')]},'rtptimeout':{'type':Sequelize[_0xc586('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xc586('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc586('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0xc586('0x3')]('yes','no',_0xc586('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc586('0x1')]},'callbackextension':{'type':Sequelize[_0xc586('0x1')]},'timert1':{'type':Sequelize[_0xc586('0x27')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xc586('0x27')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xc586('0x1')]},'contactacl':{'type':Sequelize[_0xc586('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xc586('0x1')]},'use_q850_reason':{'type':Sequelize[_0xc586('0x1')]},'maxforwards':{'type':Sequelize[_0xc586('0x27')](0xb)},'encryption':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xc586('0x18'),'no')},'force_avp':{'type':Sequelize[_0xc586('0x3')]('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0xc586('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no',_0xc586('0x2e'),_0xc586('0x2f'))},'dtlsrekey':{'type':Sequelize[_0xc586('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc586('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xc586('0x1')]},'dtlscafile':{'type':Sequelize[_0xc586('0x1')]},'dtlscapath':{'type':Sequelize[_0xc586('0x1')]},'dtlssetup':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x30'),_0xc586('0x31'),_0xc586('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc586('0x1')]},'recordofffeature':{'type':Sequelize[_0xc586('0x1')]},'call_limit':{'type':Sequelize[_0xc586('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xc586('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xc586('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xc586('0x1')]},'mohinterpret':{'type':Sequelize[_0xc586('0x1')]},'mohsuggest':{'type':Sequelize[_0xc586('0x1')]},'parkinglot':{'type':Sequelize[_0xc586('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xc586('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xc586('0x3')](_0xc586('0x18'),'no',_0xc586('0x19'),_0xc586('0x33'),_0xc586('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xc586('0x1')]},'active':{'type':Sequelize[_0xc586('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc586('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 1ddc0e7..35814b1 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 _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x56c442,_0x433de4){var _0x2944db=function(_0xa8bae1){while(--_0xa8bae1){_0x56c442['push'](_0x56c442['shift']());}};_0x2944db(++_0x433de4);}(_0xa41a,0x6b));var _0xaa41=function(_0x38356b,_0x1c83fb){_0x38356b=_0x38356b-0x0;var _0x14dad4=_0xa41a[_0x38356b];return _0x14dad4;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file +var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x325512,_0x5e5233){var _0x5b1b4c=function(_0x4d0ffa){while(--_0x4d0ffa){_0x325512['push'](_0x325512['shift']());}};_0x5b1b4c(++_0x5e5233);}(_0x24ca,0x1bc));var _0xa24c=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x24ca[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 3e6489a..ee34abe 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 _0x50aa=['Trunk','lodash','util','../../config/logger','api','request-promise','path','./trunk.attributes','exports','define'];(function(_0x1a9267,_0x1caba5){var _0x31512b=function(_0x27a158){while(--_0x27a158){_0x1a9267['push'](_0x1a9267['shift']());}};_0x31512b(++_0x1caba5);}(_0x50aa,0x169));var _0xa50a=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0x50aa[_0xef4ef0];return _0x39b60b;};'use strict';var _=require(_0xa50a('0x0'));var util=require(_0xa50a('0x1'));var logger=require(_0xa50a('0x2'))(_0xa50a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa50a('0x4'));var fs=require('fs');var path=require(_0xa50a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa50a('0x6'));module[_0xa50a('0x7')]=function(_0x37b8c8,_0xd14f02){return _0x37b8c8[_0xa50a('0x8')](_0xa50a('0x9'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5ef=['define','Trunk','util','../../config/logger','api','moment','request-promise','path','rimraf','./trunk.attributes','exports'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xc5ef,0x1e6));var _0xfc5e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xc5ef[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xfc5e('0x0'));var logger=require(_0xfc5e('0x1'))(_0xfc5e('0x2'));var moment=require(_0xfc5e('0x3'));var BPromise=require('bluebird');var rp=require(_0xfc5e('0x4'));var fs=require('fs');var path=require(_0xfc5e('0x5'));var rimraf=require(_0xfc5e('0x6'));var config=require('../../config/environment');var attributes=require(_0xfc5e('0x7'));module[_0xfc5e('0x8')]=function(_0x368090,_0x14452e){return _0x368090[_0xfc5e('0x9')](_0xfc5e('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 9da8243..915b8a7 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 _0xebad=['attributes','limit','include','map','model','GetTrunk','debug','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','Trunk','options','where'];(function(_0x1c8a88,_0x3ad9d6){var _0x35d468=function(_0x553f3c){while(--_0x553f3c){_0x1c8a88['push'](_0x1c8a88['shift']());}};_0x35d468(++_0x3ad9d6);}(_0xebad,0x189));var _0xdeba=function(_0xa75a9b,_0x30d6ac){_0xa75a9b=_0xa75a9b-0x0;var _0x76c510=_0xebad[_0xa75a9b];return _0x76c510;};'use strict';var _=require(_0xdeba('0x0'));var util=require(_0xdeba('0x1'));var moment=require(_0xdeba('0x2'));var BPromise=require(_0xdeba('0x3'));var rs=require(_0xdeba('0x4'));var fs=require('fs');var Redis=require(_0xdeba('0x5'));var db=require(_0xdeba('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdeba('0x7'))('rpc');var config=require(_0xdeba('0x8'));var jayson=require(_0xdeba('0x9'));var client=jayson[_0xdeba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101abd,_0x494e6d,_0x3d5778){return new BPromise(function(_0x3cdf60,_0x1cb8ab){return client['request'](_0x101abd,_0x3d5778)[_0xdeba('0xb')](function(_0x4f25f3){logger[_0xdeba('0xc')](_0xdeba('0xd'),_0x494e6d,_0xdeba('0xe'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x494e6d,'request\x20sent',JSON[_0xdeba('0xf')](_0x4f25f3));if(_0x4f25f3[_0xdeba('0x10')]){if(_0x4f25f3[_0xdeba('0x10')]['code']===0x1f4){logger[_0xdeba('0x10')]('Trunk,\x20%s,\x20%s',_0x494e6d,_0x4f25f3['error'][_0xdeba('0x11')]);return _0x1cb8ab(_0x4f25f3[_0xdeba('0x10')][_0xdeba('0x11')]);}logger[_0xdeba('0x10')](_0xdeba('0xd'),_0x494e6d,_0x4f25f3['error']['message']);return _0x3cdf60(_0x4f25f3[_0xdeba('0x10')]['message']);}else{logger[_0xdeba('0xc')](_0xdeba('0xd'),_0x494e6d,_0xdeba('0xe'));_0x3cdf60(_0x4f25f3[_0xdeba('0x12')][_0xdeba('0x11')]);}})[_0xdeba('0x13')](function(_0x1e7fa0){logger[_0xdeba('0x10')](_0xdeba('0xd'),_0x494e6d,_0x1e7fa0);_0x1cb8ab(_0x1e7fa0);});});}exports['GetTrunk']=function(_0x167933){var _0x12e035=this;return new Promise(function(_0x1ad1d7,_0x3871be){return db[_0xdeba('0x14')]['findAll']({'raw':_0x167933[_0xdeba('0x15')]?_0x167933[_0xdeba('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x167933[_0xdeba('0x15')]?_0x167933['options'][_0xdeba('0x16')]||null:null,'attributes':_0x167933[_0xdeba('0x15')]?_0x167933['options'][_0xdeba('0x17')]||null:null,'limit':_0x167933[_0xdeba('0x15')]?_0x167933['options'][_0xdeba('0x18')]||null:null,'include':_0x167933[_0xdeba('0x15')]?_0x167933[_0xdeba('0x15')][_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x167933[_0xdeba('0x15')][_0xdeba('0x19')],function(_0x3f8aa9){return{'model':db[_0x3f8aa9[_0xdeba('0x1b')]],'as':_0x3f8aa9['as'],'attributes':_0x3f8aa9[_0xdeba('0x17')],'include':_0x3f8aa9[_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x3f8aa9[_0xdeba('0x19')],function(_0x5509db){return{'model':db[_0x5509db[_0xdeba('0x1b')]],'as':_0x5509db['as'],'attributes':_0x5509db[_0xdeba('0x17')],'include':_0x5509db[_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x5509db[_0xdeba('0x19')],function(_0x57ea3c){return{'model':db[_0x57ea3c['model']],'as':_0x57ea3c['as'],'attributes':_0x57ea3c[_0xdeba('0x17')]};}):[]};}):[]};}):[]:[]})[_0xdeba('0xb')](function(_0x1a4f0e){logger[_0xdeba('0xc')](_0xdeba('0x1c'),_0x167933);logger[_0xdeba('0x1d')](_0xdeba('0x1c'),_0x167933,JSON['stringify'](_0x1a4f0e));_0x1ad1d7(_0x1a4f0e);})[_0xdeba('0x13')](function(_0x30509f){logger[_0xdeba('0x10')](_0xdeba('0x1c'),_0x30509f['message'],_0x167933);_0x3871be(_0x12e035[_0xdeba('0x10')](0x1f4,_0x30509f[_0xdeba('0x11')]));});});};exports[_0xdeba('0x1e')]=function(_0x3033fa){var _0x212f09=this;return new Promise(function(_0xe84ee6,_0x1f2c98){return db[_0xdeba('0x14')][_0xdeba('0x1f')]({'raw':_0x3033fa[_0xdeba('0x15')]?_0x3033fa[_0xdeba('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3033fa[_0xdeba('0x15')]?_0x3033fa[_0xdeba('0x15')][_0xdeba('0x16')]||null:null,'attributes':_0x3033fa[_0xdeba('0x15')]?_0x3033fa[_0xdeba('0x15')][_0xdeba('0x17')]||null:null,'include':_0x3033fa[_0xdeba('0x15')]?_0x3033fa[_0xdeba('0x15')][_0xdeba('0x19')]?_['map'](_0x3033fa['options'][_0xdeba('0x19')],function(_0x52981f){return{'model':db[_0x52981f[_0xdeba('0x1b')]],'as':_0x52981f['as'],'attributes':_0x52981f[_0xdeba('0x17')],'include':_0x52981f[_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x52981f[_0xdeba('0x19')],function(_0x1c8458){return{'model':db[_0x1c8458[_0xdeba('0x1b')]],'as':_0x1c8458['as'],'attributes':_0x1c8458[_0xdeba('0x17')],'include':_0x1c8458[_0xdeba('0x19')]?_[_0xdeba('0x1a')](_0x1c8458[_0xdeba('0x19')],function(_0x3568c6){return{'model':db[_0x3568c6[_0xdeba('0x1b')]],'as':_0x3568c6['as'],'attributes':_0x3568c6[_0xdeba('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe8716e){logger[_0xdeba('0xc')](_0xdeba('0x1e'),_0x3033fa);logger['debug'](_0xdeba('0x1e'),_0x3033fa,JSON['stringify'](_0xe8716e));_0xe84ee6(_0xe8716e);})[_0xdeba('0x13')](function(_0x15431f){logger[_0xdeba('0x10')](_0xdeba('0x1e'),_0x15431f[_0xdeba('0x11')],_0x3033fa);_0x1f2c98(_0x212f09[_0xdeba('0x10')](0x1f4,_0x15431f[_0xdeba('0x11')]));});});}; \ No newline at end of file +var _0x0178=['then','info','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','GetTrunk','Trunk','options','attributes','limit','include','model','map','stringify','catch','ShowTrunk','raw','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request'];(function(_0x493e88,_0x523b5c){var _0x39e648=function(_0x2030e9){while(--_0x2030e9){_0x493e88['push'](_0x493e88['shift']());}};_0x39e648(++_0x523b5c);}(_0x0178,0x1e6));var _0x8017=function(_0x16501a,_0x10b323){_0x16501a=_0x16501a-0x0;var _0x232fb9=_0x0178[_0x16501a];return _0x232fb9;};'use strict';var _=require(_0x8017('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8017('0x1'));var rs=require(_0x8017('0x2'));var fs=require('fs');var Redis=require(_0x8017('0x3'));var db=require(_0x8017('0x4'))['db'];var utils=require(_0x8017('0x5'));var logger=require(_0x8017('0x6'))('rpc');var config=require(_0x8017('0x7'));var jayson=require(_0x8017('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5dab34,_0x3a21c0,_0x1c110c){return new BPromise(function(_0xf0776c,_0x49190c){return client[_0x8017('0x9')](_0x5dab34,_0x1c110c)[_0x8017('0xa')](function(_0x9c9d4c){logger[_0x8017('0xb')]('Trunk,\x20%s,\x20%s',_0x3a21c0,_0x8017('0xc'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x3a21c0,_0x8017('0xc'),JSON['stringify'](_0x9c9d4c));if(_0x9c9d4c[_0x8017('0xd')]){if(_0x9c9d4c[_0x8017('0xd')][_0x8017('0xe')]===0x1f4){logger[_0x8017('0xd')](_0x8017('0xf'),_0x3a21c0,_0x9c9d4c[_0x8017('0xd')]['message']);return _0x49190c(_0x9c9d4c[_0x8017('0xd')][_0x8017('0x10')]);}logger[_0x8017('0xd')]('Trunk,\x20%s,\x20%s',_0x3a21c0,_0x9c9d4c[_0x8017('0xd')][_0x8017('0x10')]);return _0xf0776c(_0x9c9d4c['error']['message']);}else{logger[_0x8017('0xb')](_0x8017('0xf'),_0x3a21c0,_0x8017('0xc'));_0xf0776c(_0x9c9d4c[_0x8017('0x11')][_0x8017('0x10')]);}})['catch'](function(_0x5e4c15){logger[_0x8017('0xd')](_0x8017('0xf'),_0x3a21c0,_0x5e4c15);_0x49190c(_0x5e4c15);});});}exports[_0x8017('0x12')]=function(_0x1538e6){var _0x3d676b=this;return new Promise(function(_0x1f5c5c,_0x9038f5){return db[_0x8017('0x13')]['findAll']({'raw':_0x1538e6[_0x8017('0x14')]?_0x1538e6[_0x8017('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1538e6[_0x8017('0x14')]?_0x1538e6['options']['where']||null:null,'attributes':_0x1538e6[_0x8017('0x14')]?_0x1538e6['options'][_0x8017('0x15')]||null:null,'limit':_0x1538e6[_0x8017('0x14')]?_0x1538e6[_0x8017('0x14')][_0x8017('0x16')]||null:null,'include':_0x1538e6[_0x8017('0x14')]?_0x1538e6[_0x8017('0x14')][_0x8017('0x17')]?_['map'](_0x1538e6['options'][_0x8017('0x17')],function(_0x1f7386){return{'model':db[_0x1f7386[_0x8017('0x18')]],'as':_0x1f7386['as'],'attributes':_0x1f7386[_0x8017('0x15')],'include':_0x1f7386[_0x8017('0x17')]?_[_0x8017('0x19')](_0x1f7386['include'],function(_0x1f12ff){return{'model':db[_0x1f12ff[_0x8017('0x18')]],'as':_0x1f12ff['as'],'attributes':_0x1f12ff[_0x8017('0x15')],'include':_0x1f12ff[_0x8017('0x17')]?_[_0x8017('0x19')](_0x1f12ff[_0x8017('0x17')],function(_0x23b723){return{'model':db[_0x23b723[_0x8017('0x18')]],'as':_0x23b723['as'],'attributes':_0x23b723[_0x8017('0x15')]};}):[]};}):[]};}):[]:[]})[_0x8017('0xa')](function(_0x1adace){logger[_0x8017('0xb')](_0x8017('0x12'),_0x1538e6);logger['debug'](_0x8017('0x12'),_0x1538e6,JSON[_0x8017('0x1a')](_0x1adace));_0x1f5c5c(_0x1adace);})[_0x8017('0x1b')](function(_0x556708){logger[_0x8017('0xd')](_0x8017('0x12'),_0x556708[_0x8017('0x10')],_0x1538e6);_0x9038f5(_0x3d676b[_0x8017('0xd')](0x1f4,_0x556708[_0x8017('0x10')]));});});};exports[_0x8017('0x1c')]=function(_0x739ace){var _0x47402f=this;return new Promise(function(_0x288db6,_0x5ad744){return db[_0x8017('0x13')]['find']({'raw':_0x739ace[_0x8017('0x14')]?_0x739ace[_0x8017('0x14')][_0x8017('0x1d')]===undefined?!![]:![]:!![],'where':_0x739ace[_0x8017('0x14')]?_0x739ace[_0x8017('0x14')]['where']||null:null,'attributes':_0x739ace[_0x8017('0x14')]?_0x739ace[_0x8017('0x14')][_0x8017('0x15')]||null:null,'include':_0x739ace[_0x8017('0x14')]?_0x739ace[_0x8017('0x14')]['include']?_[_0x8017('0x19')](_0x739ace[_0x8017('0x14')]['include'],function(_0x1e1464){return{'model':db[_0x1e1464[_0x8017('0x18')]],'as':_0x1e1464['as'],'attributes':_0x1e1464['attributes'],'include':_0x1e1464['include']?_[_0x8017('0x19')](_0x1e1464[_0x8017('0x17')],function(_0x1abaef){return{'model':db[_0x1abaef[_0x8017('0x18')]],'as':_0x1abaef['as'],'attributes':_0x1abaef[_0x8017('0x15')],'include':_0x1abaef['include']?_['map'](_0x1abaef['include'],function(_0xf4d879){return{'model':db[_0xf4d879[_0x8017('0x18')]],'as':_0xf4d879['as'],'attributes':_0xf4d879[_0x8017('0x15')]};}):[]};}):[]};}):[]:[]})[_0x8017('0xa')](function(_0x4516f7){logger[_0x8017('0xb')]('ShowTrunk',_0x739ace);logger[_0x8017('0x1e')](_0x8017('0x1c'),_0x739ace,JSON[_0x8017('0x1a')](_0x4516f7));_0x288db6(_0x4516f7);})[_0x8017('0x1b')](function(_0x27eb82){logger[_0x8017('0xd')](_0x8017('0x1c'),_0x27eb82[_0x8017('0x10')],_0x739ace);_0x5ad744(_0x47402f[_0x8017('0xd')](0x1f4,_0x27eb82['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 71fcdb6..585e0dc 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 _0xb33a=['Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','bulkCreate','/:id/queues','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','login','/:id/logout','logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','/:id/api_key','createApiKey','put','update','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout'];(function(_0x35595d,_0x121058){var _0x4b30d9=function(_0x1b86eb){while(--_0x1b86eb){_0x35595d['push'](_0x35595d['shift']());}};_0x4b30d9(++_0x121058);}(_0xb33a,0x15e));var _0xab33=function(_0x11a9b5,_0x18e003){_0x11a9b5=_0x11a9b5-0x0;var _0x1d1573=_0xb33a[_0x11a9b5];return _0x1d1573;};'use strict';var multer=require(_0xab33('0x0'));var util=require(_0xab33('0x1'));var path=require(_0xab33('0x2'));var timeout=require(_0xab33('0x3'));var express=require('express');var router=express[_0xab33('0x4')]();var fs_extra=require(_0xab33('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xab33('0x6'));var config=require(_0xab33('0x7'));var controller=require(_0xab33('0x8'));router[_0xab33('0x9')]('/',auth[_0xab33('0xa')](),controller[_0xab33('0xb')]);router[_0xab33('0x9')]('/describe',auth[_0xab33('0xa')](),controller[_0xab33('0xc')]);router[_0xab33('0x9')](_0xab33('0xd'),auth[_0xab33('0xa')](),controller[_0xab33('0xe')]);router[_0xab33('0x9')](_0xab33('0xf'),auth[_0xab33('0xa')](),controller[_0xab33('0x10')]);router[_0xab33('0x9')](_0xab33('0x11'),auth[_0xab33('0xa')](),controller[_0xab33('0x12')]);router[_0xab33('0x9')](_0xab33('0x13'),controller[_0xab33('0x14')]);router[_0xab33('0x9')](_0xab33('0x15'),auth['isAuthenticated'](),controller[_0xab33('0x16')]);router['get'](_0xab33('0x17'),auth[_0xab33('0xa')](),controller[_0xab33('0x18')]);router[_0xab33('0x9')]('/:id/queues',auth[_0xab33('0xa')](),controller[_0xab33('0x19')]);router['get'](_0xab33('0x1a'),auth[_0xab33('0xa')](),controller[_0xab33('0x1b')]);router[_0xab33('0x9')](_0xab33('0x1c'),auth[_0xab33('0xa')](),controller[_0xab33('0x1d')]);router[_0xab33('0x9')](_0xab33('0x1e'),auth[_0xab33('0xa')](),controller[_0xab33('0x1f')]);router[_0xab33('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xab33('0x20')]);router[_0xab33('0x9')]('/:id/chat/interactions',auth[_0xab33('0xa')](),controller[_0xab33('0x21')]);router[_0xab33('0x9')](_0xab33('0x22'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0xab33('0x9')](_0xab33('0x23'),auth['isAuthenticated'](),controller[_0xab33('0x24')]);router[_0xab33('0x9')](_0xab33('0x25'),auth['isAuthenticated'](),controller[_0xab33('0x26')]);router['get'](_0xab33('0x27'),auth[_0xab33('0xa')](),controller[_0xab33('0x28')]);router[_0xab33('0x9')](_0xab33('0x29'),auth[_0xab33('0xa')](),controller[_0xab33('0x2a')]);router['get'](_0xab33('0x2b'),auth[_0xab33('0xa')](),controller['getTeams']);router[_0xab33('0x9')](_0xab33('0x2c'),auth[_0xab33('0xa')](),controller[_0xab33('0x2d')]);router['get'](_0xab33('0x2e'),auth[_0xab33('0xa')](),controller['getAgents']);router[_0xab33('0x9')](_0xab33('0x2f'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0xab33('0x9')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xab33('0x30')]);router[_0xab33('0x9')](_0xab33('0x31'),auth[_0xab33('0xa')](),controller[_0xab33('0x32')]);router['get']('/:id/openchannel_accounts',auth[_0xab33('0xa')](),controller[_0xab33('0x33')]);router[_0xab33('0x9')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xab33('0x34')]);router['get'](_0xab33('0x35'),auth[_0xab33('0xa')](),controller['getChatWebsites']);router[_0xab33('0x9')]('/:id/whatsapp_accounts',auth[_0xab33('0xa')](),controller[_0xab33('0x36')]);router[_0xab33('0x9')](_0xab33('0x37'),auth[_0xab33('0xa')](),controller[_0xab33('0x38')]);router['get'](_0xab33('0x39'),auth[_0xab33('0xa')](),controller[_0xab33('0x3a')]);router[_0xab33('0x9')]('/:id/api_key',auth[_0xab33('0xa')](),controller[_0xab33('0x3b')]);router[_0xab33('0x3c')](_0xab33('0x17'),auth['isAuthenticated'](),controller[_0xab33('0x3d')]);router['post']('/',auth[_0xab33('0xa')](),controller[_0xab33('0x3e')]);router[_0xab33('0x3c')]('/create_many',auth['isAuthenticated'](),controller[_0xab33('0x3f')]);router[_0xab33('0x3c')](_0xab33('0x40'),auth[_0xab33('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0xab33('0x41')]({'destination':function(_0x63a6b9,_0x5bd5b5,_0x2cf5b8){_0x2cf5b8(null,path[_0xab33('0x42')](config[_0xab33('0x43')],_0xab33('0x44')));},'filename':function(_0x1d68ac,_0x5ae28d,_0x35d276){_0x35d276(null,util[_0xab33('0x45')](_0xab33('0x46'),Date[_0xab33('0x47')](),_0x5ae28d['originalname']));}})});router['post'](_0xab33('0x13'),upload[_0xab33('0x48')](_0xab33('0x49')),controller['addAvatar']);router['post']('/:id/login',auth[_0xab33('0xa')](),controller[_0xab33('0x4a')]);router[_0xab33('0x3c')](_0xab33('0x4b'),auth[_0xab33('0xa')](),controller[_0xab33('0x4c')]);router[_0xab33('0x3c')](_0xab33('0x4d'),auth[_0xab33('0xa')](),controller['pause']);router[_0xab33('0x3c')]('/:id/unpause',auth[_0xab33('0xa')](),controller[_0xab33('0x4e')]);router[_0xab33('0x3c')](_0xab33('0x2b'),auth[_0xab33('0xa')](),controller[_0xab33('0x4f')]);router[_0xab33('0x3c')](_0xab33('0x50'),auth[_0xab33('0xa')](),controller[_0xab33('0x51')]);router['post'](_0xab33('0x52'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xab33('0x3c')](_0xab33('0x53'),auth[_0xab33('0xa')](),controller[_0xab33('0x54')]);router[_0xab33('0x3c')](_0xab33('0x55'),auth['isAuthenticated'](),controller[_0xab33('0x56')]);router['post']('/:id/openchannel_interactions',auth[_0xab33('0xa')](),controller['addOpenchannelInteractions']);router[_0xab33('0x3c')](_0xab33('0x57'),auth[_0xab33('0xa')](),controller[_0xab33('0x58')]);router[_0xab33('0x3c')](_0xab33('0x59'),auth[_0xab33('0xa')](),controller[_0xab33('0x5a')]);router[_0xab33('0x3c')](_0xab33('0x31'),auth[_0xab33('0xa')](),controller[_0xab33('0x5b')]);router[_0xab33('0x3c')](_0xab33('0x5c'),auth[_0xab33('0xa')](),controller['addOpenchannelAccounts']);router[_0xab33('0x3c')](_0xab33('0x5d'),auth['isAuthenticated'](),controller[_0xab33('0x5e')]);router[_0xab33('0x3c')](_0xab33('0x35'),auth[_0xab33('0xa')](),controller[_0xab33('0x5f')]);router['post'](_0xab33('0x60'),auth[_0xab33('0xa')](),controller[_0xab33('0x61')]);router['post'](_0xab33('0x37'),auth[_0xab33('0xa')](),controller['addSquareProjects']);router['post'](_0xab33('0x62'),auth[_0xab33('0xa')](),controller[_0xab33('0x63')]);router[_0xab33('0x64')](_0xab33('0x11'),auth['isAuthenticated'](),controller[_0xab33('0x65')]);router[_0xab33('0x64')]('/:id/password',auth[_0xab33('0xa')](),controller['changePassword']);router[_0xab33('0x66')](_0xab33('0x40'),auth[_0xab33('0xa')](),controller[_0xab33('0x67')]);router[_0xab33('0x66')](_0xab33('0x2b'),auth[_0xab33('0xa')](),controller[_0xab33('0x68')]);router['delete']('/:id',auth[_0xab33('0xa')](),controller[_0xab33('0x69')]);router[_0xab33('0x66')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router['delete'](_0xab33('0x52'),auth[_0xab33('0xa')](),controller[_0xab33('0x6a')]);router[_0xab33('0x66')](_0xab33('0x53'),auth[_0xab33('0xa')](),controller[_0xab33('0x6b')]);router['delete']('/:id/sms_interactions',auth[_0xab33('0xa')](),controller[_0xab33('0x6c')]);router[_0xab33('0x66')](_0xab33('0x6d'),auth[_0xab33('0xa')](),controller['removeOpenchannelInteractions']);router['delete'](_0xab33('0x57'),auth[_0xab33('0xa')](),controller[_0xab33('0x6e')]);router[_0xab33('0x66')](_0xab33('0x59'),auth['isAuthenticated'](),controller[_0xab33('0x6f')]);router['delete'](_0xab33('0x31'),auth['isAuthenticated'](),controller[_0xab33('0x70')]);router['delete']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xab33('0x71')]);router[_0xab33('0x66')](_0xab33('0x5d'),auth[_0xab33('0xa')](),controller['removeSmsAccounts']);router[_0xab33('0x66')](_0xab33('0x35'),auth[_0xab33('0xa')](),controller[_0xab33('0x72')]);router[_0xab33('0x66')]('/:id/whatsapp_accounts',auth[_0xab33('0xa')](),controller[_0xab33('0x73')]);router['delete'](_0xab33('0x37'),auth[_0xab33('0xa')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0xab33('0xa')](),controller[_0xab33('0x74')]);module[_0xab33('0x75')]=router; \ No newline at end of file +var _0xb46d=['/whoami','whoami','/presence','getPresence','/:id','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','create','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','/:id/pause','pause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','createApiKey','put','changePassword','delete','removeQueues','removeTeams','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','isAuthenticated'];(function(_0x4c0620,_0x59846d){var _0x11d3c2=function(_0x3c6cd3){while(--_0x3c6cd3){_0x4c0620['push'](_0x4c0620['shift']());}};_0x11d3c2(++_0x59846d);}(_0xb46d,0x65));var _0xdb46=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0xb46d[_0x2338fa];return _0x42df9b;};'use strict';var multer=require(_0xdb46('0x0'));var util=require(_0xdb46('0x1'));var path=require('path');var timeout=require(_0xdb46('0x2'));var express=require(_0xdb46('0x3'));var router=express[_0xdb46('0x4')]();var fs_extra=require(_0xdb46('0x5'));var auth=require(_0xdb46('0x6'));var interaction=require(_0xdb46('0x7'));var config=require(_0xdb46('0x8'));var controller=require(_0xdb46('0x9'));router[_0xdb46('0xa')]('/',auth['isAuthenticated'](),controller[_0xdb46('0xb')]);router['get']('/describe',auth[_0xdb46('0xc')](),controller['describe']);router[_0xdb46('0xa')](_0xdb46('0xd'),auth[_0xdb46('0xc')](),controller[_0xdb46('0xe')]);router[_0xdb46('0xa')](_0xdb46('0xf'),auth['isAuthenticated'](),controller[_0xdb46('0x10')]);router[_0xdb46('0xa')](_0xdb46('0x11'),auth[_0xdb46('0xc')](),controller['show']);router[_0xdb46('0xa')]('/:id/avatar',controller['getAvatar']);router[_0xdb46('0xa')](_0xdb46('0x12'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x13')]);router['get']('/:id/contacts',auth[_0xdb46('0xc')](),controller[_0xdb46('0x14')]);router[_0xdb46('0xa')](_0xdb46('0x15'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x16')]);router[_0xdb46('0xa')](_0xdb46('0x17'),auth[_0xdb46('0xc')](),controller['getVoiceQueuesRt']);router[_0xdb46('0xa')]('/:id/groups',auth[_0xdb46('0xc')](),controller[_0xdb46('0x18')]);router[_0xdb46('0xa')](_0xdb46('0x19'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x1a')]);router[_0xdb46('0xa')](_0xdb46('0x1b'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x1c')]);router['get'](_0xdb46('0x1d'),auth['isAuthenticated'](),controller[_0xdb46('0x1e')]);router['get'](_0xdb46('0x1f'),auth[_0xdb46('0xc')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth[_0xdb46('0xc')](),controller[_0xdb46('0x20')]);router[_0xdb46('0xa')](_0xdb46('0x21'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x22')]);router[_0xdb46('0xa')](_0xdb46('0x23'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x24')]);router[_0xdb46('0xa')]('/:id/whatsapp/interactions',auth[_0xdb46('0xc')](),controller[_0xdb46('0x25')]);router[_0xdb46('0xa')](_0xdb46('0x26'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x27')]);router[_0xdb46('0xa')](_0xdb46('0x28'),auth[_0xdb46('0xc')](),controller['getLists']);router[_0xdb46('0xa')](_0xdb46('0x29'),auth['isAuthenticated'](),controller[_0xdb46('0x2a')]);router[_0xdb46('0xa')](_0xdb46('0x2b'),auth[_0xdb46('0xc')](),controller['getVoicePrefixes']);router[_0xdb46('0xa')](_0xdb46('0x2c'),auth['isAuthenticated'](),controller[_0xdb46('0x2d')]);router[_0xdb46('0xa')](_0xdb46('0x2e'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x2f')]);router[_0xdb46('0xa')](_0xdb46('0x30'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x31')]);router[_0xdb46('0xa')](_0xdb46('0x32'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x33')]);router[_0xdb46('0xa')](_0xdb46('0x34'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x35')]);router[_0xdb46('0xa')]('/:id/whatsapp_accounts',auth[_0xdb46('0xc')](),controller['getWhatsappAccounts']);router[_0xdb46('0xa')](_0xdb46('0x36'),auth['isAuthenticated'](),controller[_0xdb46('0x37')]);router[_0xdb46('0xa')](_0xdb46('0x38'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x39')]);router['get'](_0xdb46('0x3a'),auth[_0xdb46('0xc')](),controller['getApiKey']);router[_0xdb46('0x3b')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0xdb46('0x3b')]('/',auth[_0xdb46('0xc')](),controller[_0xdb46('0x3c')]);router['post'](_0xdb46('0x3d'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x3e')]);router[_0xdb46('0x3b')](_0xdb46('0x15'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x3f')]);var upload=multer({'storage':multer[_0xdb46('0x40')]({'destination':function(_0xc4881f,_0x5e003c,_0x1f64ce){_0x1f64ce(null,path['join'](config[_0xdb46('0x41')],_0xdb46('0x42')));},'filename':function(_0x238006,_0x1e172a,_0xdc0ba8){_0xdc0ba8(null,util[_0xdb46('0x43')](_0xdb46('0x44'),Date[_0xdb46('0x45')](),_0x1e172a[_0xdb46('0x46')]));}})});router[_0xdb46('0x3b')](_0xdb46('0x47'),upload[_0xdb46('0x48')](_0xdb46('0x49')),controller[_0xdb46('0x4a')]);router['post'](_0xdb46('0x4b'),auth['isAuthenticated'](),controller['login']);router[_0xdb46('0x3b')]('/:id/logout',auth[_0xdb46('0xc')](),controller['logout']);router['post'](_0xdb46('0x4c'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x4d')]);router[_0xdb46('0x3b')]('/:id/unpause',auth[_0xdb46('0xc')](),controller['unpause']);router[_0xdb46('0x3b')](_0xdb46('0x26'),auth[_0xdb46('0xc')](),controller['addTeams']);router[_0xdb46('0x3b')]('/:id/chat_interactions',auth[_0xdb46('0xc')](),controller[_0xdb46('0x4e')]);router['post'](_0xdb46('0x4f'),auth['isAuthenticated'](),controller[_0xdb46('0x50')]);router[_0xdb46('0x3b')](_0xdb46('0x51'),auth['isAuthenticated'](),controller[_0xdb46('0x52')]);router['post'](_0xdb46('0x53'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x54')]);router[_0xdb46('0x3b')](_0xdb46('0x55'),auth[_0xdb46('0xc')](),controller['addOpenchannelInteractions']);router[_0xdb46('0x3b')](_0xdb46('0x56'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x57')]);router[_0xdb46('0x3b')](_0xdb46('0x2c'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x58')]);router[_0xdb46('0x3b')](_0xdb46('0x2e'),auth['isAuthenticated'](),controller[_0xdb46('0x59')]);router[_0xdb46('0x3b')](_0xdb46('0x30'),auth['isAuthenticated'](),controller[_0xdb46('0x5a')]);router[_0xdb46('0x3b')](_0xdb46('0x32'),auth['isAuthenticated'](),controller[_0xdb46('0x5b')]);router[_0xdb46('0x3b')]('/:id/chat_websites',auth[_0xdb46('0xc')](),controller[_0xdb46('0x5c')]);router['post'](_0xdb46('0x5d'),auth[_0xdb46('0xc')](),controller['addWhatsappAccounts']);router['post'](_0xdb46('0x36'),auth[_0xdb46('0xc')](),controller['addSquareProjects']);router[_0xdb46('0x3b')]('/:id/api_key',auth[_0xdb46('0xc')](),controller[_0xdb46('0x5e')]);router[_0xdb46('0x5f')](_0xdb46('0x11'),auth[_0xdb46('0xc')](),controller['update']);router[_0xdb46('0x5f')]('/:id/password',auth[_0xdb46('0xc')](),controller[_0xdb46('0x60')]);router[_0xdb46('0x61')](_0xdb46('0x15'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x62')]);router[_0xdb46('0x61')]('/:id/teams',auth[_0xdb46('0xc')](),controller[_0xdb46('0x63')]);router['delete'](_0xdb46('0x11'),auth[_0xdb46('0xc')](),controller['destroy']);router[_0xdb46('0x61')](_0xdb46('0x64'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x65')]);router[_0xdb46('0x61')](_0xdb46('0x4f'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x66')]);router[_0xdb46('0x61')](_0xdb46('0x51'),auth['isAuthenticated'](),controller[_0xdb46('0x67')]);router[_0xdb46('0x61')](_0xdb46('0x53'),auth['isAuthenticated'](),controller[_0xdb46('0x68')]);router['delete'](_0xdb46('0x55'),auth['isAuthenticated'](),controller[_0xdb46('0x69')]);router[_0xdb46('0x61')]('/:id/whatsapp_interactions',auth[_0xdb46('0xc')](),controller[_0xdb46('0x6a')]);router[_0xdb46('0x61')]('/:id/fax_accounts',auth[_0xdb46('0xc')](),controller[_0xdb46('0x6b')]);router[_0xdb46('0x61')](_0xdb46('0x2e'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x6c')]);router[_0xdb46('0x61')](_0xdb46('0x30'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x6d')]);router[_0xdb46('0x61')]('/:id/sms_accounts',auth[_0xdb46('0xc')](),controller[_0xdb46('0x6e')]);router[_0xdb46('0x61')](_0xdb46('0x34'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x6f')]);router[_0xdb46('0x61')](_0xdb46('0x5d'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0xdb46('0x61')](_0xdb46('0x36'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x70')]);router[_0xdb46('0x61')](_0xdb46('0x3a'),auth[_0xdb46('0xc')](),controller[_0xdb46('0x71')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 7f07c7d..2ce88ce 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 _0xf06c=['phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','getDataValue','internal','STRING','email','ENUM','user','agent','telephone','INTEGER','accountcode','format','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','DATE','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlscertfile','dtlsprivatekey','dtlsverify','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL'];(function(_0xabd6ec,_0x35a8ee){var _0x4623bc=function(_0x1302f4){while(--_0x1302f4){_0xabd6ec['push'](_0xabd6ec['shift']());}};_0x4623bc(++_0x35a8ee);}(_0xf06c,0xc7));var _0xcf06=function(_0x8d0bb1,_0x30c13a){_0x8d0bb1=_0x8d0bb1-0x0;var _0x1c78b0=_0xf06c[_0x8d0bb1];return _0x1c78b0;};'use strict';var Sequelize=require(_0xcf06('0x0'));var moment=require(_0xcf06('0x1'));var util=require(_0xcf06('0x2'));var _=require(_0xcf06('0x3'));module[_0xcf06('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcf06('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2b98f4){this[_0xcf06('0x6')]('name',_0x2b98f4);this[_0xcf06('0x6')](_0xcf06('0x7'),_0x2b98f4);},'comment':_0xcf06('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x22ac40){this['setDataValue'](_0xcf06('0x9'),_0x22ac40);this['setDataValue']('callerid',util['format']('\x22%s\x22\x20<%s>',_0x22ac40,this[_0xcf06('0xa')](_0xcf06('0xb'))));}},'alias':{'type':Sequelize[_0xcf06('0xc')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x463309){if(_0x463309){this['setDataValue'](_0xcf06('0xd'),_0x463309['toLowerCase']());}}},'role':{'type':Sequelize[_0xcf06('0xe')]('admin',_0xcf06('0xf'),_0xcf06('0x10'),_0xcf06('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0xcf06('0xc')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':![],'unique':_0xcf06('0xb'),'set':function(_0x2fd686){this[_0xcf06('0x6')]('internal',_0x2fd686);this[_0xcf06('0x6')](_0xcf06('0x13'),_0x2fd686);this['setDataValue']('callerid',util[_0xcf06('0x14')](_0xcf06('0x15'),this[_0xcf06('0xa')]('fullname'),_0x2fd686));}},'salt':{'type':Sequelize[_0xcf06('0xc')]},'phone':{'type':Sequelize[_0xcf06('0xc')]},'mobile':{'type':Sequelize[_0xcf06('0xc')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xcf06('0xc')]},'userpic':{'type':Sequelize[_0xcf06('0xc')]},'city':{'type':Sequelize[_0xcf06('0xc')]},'country':{'type':Sequelize[_0xcf06('0xc')]},'online':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xcf06('0xc')],'defaultValue':_0xcf06('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xcf06('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xcf06('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'host':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'defaultValue':_0xcf06('0x18')},'ipaddr':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'port':{'type':Sequelize[_0xcf06('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x19'),_0xcf06('0xf'),_0xcf06('0x1a')),'allowNull':!![],'defaultValue':_0xcf06('0x19')},'context':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'defaultValue':_0xcf06('0x1b')},'callingpres':{'type':Sequelize[_0xcf06('0xe')]('ALLOWED_NOT_SCREENED',_0xcf06('0x1c'),'ALLOWED_FAILED_SCREEN',_0xcf06('0x1d'),_0xcf06('0x1e'),_0xcf06('0x1f'),_0xcf06('0x20'),_0xcf06('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'transport':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'defaultValue':_0xcf06('0x22'),'set':function(_0x44d65b){this[_0xcf06('0x6')](_0xcf06('0x23'),_0x44d65b?_0x44d65b[_0xcf06('0x24')](','):null);},'get':function(){return this[_0xcf06('0xa')]('transport')?this[_0xcf06('0xa')](_0xcf06('0x23'))[_0xcf06('0x25')](','):null;},'comment':_0xcf06('0x26')},'dtmfmode':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x27'),_0xcf06('0x28'),_0xcf06('0x29'),_0xcf06('0x2a'),_0xcf06('0x2b')),'allowNull':!![],'defaultValue':_0xcf06('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no',_0xcf06('0x2d'),'update',_0xcf06('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'nat':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x1b6820){this[_0xcf06('0x6')](_0xcf06('0x2f'),_0x1b6820?_0x1b6820[_0xcf06('0x24')](','):null);},'get':function(){return this[_0xcf06('0xa')]('nat')?this[_0xcf06('0xa')](_0xcf06('0x2f'))[_0xcf06('0x25')](','):null;},'comment':_0xcf06('0x30')},'callgroup':{'type':Sequelize[_0xcf06('0xc')]},'namedcallgroup':{'type':Sequelize[_0xcf06('0xc')]},'pickupgroup':{'type':Sequelize[_0xcf06('0xc')]},'namedpickupgroup':{'type':Sequelize[_0xcf06('0xc')]},'language':{'type':Sequelize[_0xcf06('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xcf06('0xc')]},'disallow':{'type':Sequelize[_0xcf06('0xc')],'allowNull':![],'defaultValue':_0xcf06('0x31')},'allow':{'type':Sequelize[_0xcf06('0xc')],'allowNull':![],'defaultValue':_0xcf06('0x32'),'set':function(_0x446972){this[_0xcf06('0x6')](_0xcf06('0x33'),_0x446972?_0x446972['join'](';'):_0xcf06('0x32'));},'get':function(){return this['getDataValue'](_0xcf06('0x33'))?this[_0xcf06('0xa')](_0xcf06('0x33'))['split'](';'):null;},'comment':_0xcf06('0x34')},'autoframing':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![],'set':function(_0x42b847){this['setDataValue']('insecure',_0x42b847?_0x42b847[_0xcf06('0x24')](','):null);},'get':function(){return this['getDataValue'](_0xcf06('0x35'))?this[_0xcf06('0xa')](_0xcf06('0x35'))[_0xcf06('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xcf06('0xe')]('yes','no',_0xcf06('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xcf06('0x37')},'amaflags':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0xcf06('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xcf06('0xe')]('yes','no',_0xcf06('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xcf06('0x39'),_0xcf06('0x3a'),_0xcf06('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xcf06('0x3c'),'uas'),'allowNull':!![],'defaultValue':_0xcf06('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no',_0xcf06('0x3e'),_0xcf06('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xcf06('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x40'),_0xcf06('0x41'),_0xcf06('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xcf06('0xe')](_0xcf06('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xcf06('0x2c'),'no',_0xcf06('0x2d'),_0xcf06('0x43'),_0xcf06('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xcf06('0xc')]},'resetPasswordExpires':{'type':Sequelize[_0xcf06('0x45')]},'passwordResetAt':{'type':Sequelize[_0xcf06('0x45')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xcf06('0x46')]},'showWebBar':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0,'set':function(_0x3a3af4){this[_0xcf06('0x6')](_0xcf06('0x47'),_0x3a3af4);var _0x54fcc9=this[_0xcf06('0x48')]({'plain':!![]});switch(_0x3a3af4){case 0x0:case 0x1:var _0x16faf1=_0x54fcc9[_0xcf06('0x23')]?_[_0xcf06('0x49')](_0x54fcc9[_0xcf06('0x23')])?_0x54fcc9['transport'][_0xcf06('0x24')]():_0x54fcc9[_0xcf06('0x23')]:_0xcf06('0x22');if(_0x16faf1===_0xcf06('0x4a')){_0x16faf1='udp';}this[_0xcf06('0x6')](_0xcf06('0x23'),_0x16faf1);this[_0xcf06('0x6')](_0xcf06('0x4b'),'no');this[_0xcf06('0x6')](_0xcf06('0x4c'),null);this[_0xcf06('0x6')](_0xcf06('0x4d'),null);this['setDataValue'](_0xcf06('0x4e'),null);this['setDataValue'](_0xcf06('0x4f'),null);this[_0xcf06('0x6')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this[_0xcf06('0x6')](_0xcf06('0x50'),null);this[_0xcf06('0x6')](_0xcf06('0x51'),null);this[_0xcf06('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xcf06('0x6')](_0xcf06('0x23'),'wss');this['setDataValue']('encryption',_0xcf06('0x2c'));this[_0xcf06('0x6')]('avpf','yes');this[_0xcf06('0x6')]('force_avp',_0xcf06('0x2c'));this[_0xcf06('0x6')](_0xcf06('0x4e'),_0xcf06('0x2c'));this[_0xcf06('0x6')]('dtlsenable',_0xcf06('0x2c'));this['setDataValue'](_0xcf06('0x52'),'no');this[_0xcf06('0x6')](_0xcf06('0x53'),'actpass');this[_0xcf06('0x6')](_0xcf06('0x50'),_0x54fcc9['dtlscertfile']||_0xcf06('0x54'));this[_0xcf06('0x6')](_0xcf06('0x51'),_0x54fcc9['dtlsprivatekey']||_0xcf06('0x55'));this['setDataValue'](_0xcf06('0x56'),_0xcf06('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0xcf06('0x46')],'set':function(_0x209608){this['setDataValue']('permissions',_0x209608?_0x209608[_0xcf06('0x24')](','):[]);},'get':function(){return this[_0xcf06('0xa')](_0xcf06('0x57'))?_['map'](this[_0xcf06('0xa')]('permissions')[_0xcf06('0x25')](','),function(_0x51fc0b){return parseInt(_0x51fc0b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xcf06('0xc')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xcf06('0xc')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xcf06('0xc')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xcf06('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xcf06('0xc')]},'phoneBarEnableJaws':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xcf06('0x58')],'get':function(){return this[_0xcf06('0xa')](_0xcf06('0x59'))?this['getDataValue'](_0xcf06('0x59')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xcf06('0xc')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xcf06('0xc')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![],'set':function(_0x16d72f){if(typeof _0x16d72f==='string'){var _0x2d775b=_0x16d72f==='1'?!![]:_0x16d72f==='0'?![]:_0x16d72f===_0xcf06('0x5a')?!![]:_0x16d72f===_0xcf06('0x5b')?![]:![];this[_0xcf06('0x6')](_0xcf06('0x5c'),_0x2d775b);}else{this[_0xcf06('0x6')](_0xcf06('0x5c'),_0x16d72f);}}},'blocked':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![],'set':function(_0x3e9c84){this[_0xcf06('0x6')]('blocked',_0x3e9c84);if(_0x3e9c84===!![]){this['setDataValue']('blockedAt',moment());this[_0xcf06('0x6')](_0xcf06('0x5d'),0x0);}else{this[_0xcf06('0x6')](_0xcf06('0x5e'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xcf06('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xcf06('0x12')](0x5)[_0xcf06('0x5f')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcf06('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0x737d=['VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','getDataValue','internal','email','ENUM','user','agent','local','accountcode','BOOLEAN','DATE','INTEGER','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\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','fingerprint','certificate','passive','actpass','update,nonat','TEXT','showWebBar','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x737d,0xbc));var _0xd737=function(_0x364e7c,_0x323460){_0x364e7c=_0x364e7c-0x0;var _0x56247f=_0x737d[_0x364e7c];return _0x56247f;};'use strict';var Sequelize=require(_0xd737('0x0'));var moment=require(_0xd737('0x1'));var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd737('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5ce3d6){this[_0xd737('0x3')]('name',_0x5ce3d6);this[_0xd737('0x3')](_0xd737('0x4'),_0x5ce3d6);},'comment':_0xd737('0x5')},'fullname':{'type':Sequelize[_0xd737('0x6')],'allowNull':![],'set':function(_0x46f559){this[_0xd737('0x3')](_0xd737('0x7'),_0x46f559);this[_0xd737('0x3')](_0xd737('0x8'),util[_0xd737('0x9')]('\x22%s\x22\x20<%s>',_0x46f559,this[_0xd737('0xa')](_0xd737('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd737('0x6')],'allowNull':![],'unique':_0xd737('0xc'),'validate':{'isEmail':!![]},'set':function(_0x4f8018){if(_0x4f8018){this[_0xd737('0x3')](_0xd737('0xc'),_0x4f8018['toLowerCase']());}}},'role':{'type':Sequelize[_0xd737('0xd')]('admin',_0xd737('0xe'),_0xd737('0xf'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xd737('0x6')],'defaultValue':_0xd737('0x10')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xd737('0xb'),'set':function(_0xe9f7be){this[_0xd737('0x3')](_0xd737('0xb'),_0xe9f7be);this[_0xd737('0x3')](_0xd737('0x11'),_0xe9f7be);this[_0xd737('0x3')](_0xd737('0x8'),util['format']('\x22%s\x22\x20<%s>',this[_0xd737('0xa')](_0xd737('0x7')),_0xe9f7be));}},'salt':{'type':Sequelize[_0xd737('0x6')]},'phone':{'type':Sequelize[_0xd737('0x6')]},'mobile':{'type':Sequelize[_0xd737('0x6')]},'address':{'type':Sequelize[_0xd737('0x6')]},'zipcode':{'type':Sequelize[_0xd737('0x6')]},'userpic':{'type':Sequelize[_0xd737('0x6')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd737('0x6')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xd737('0x13')]},'chatCapacity':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xd737('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xd737('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'host':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'port':{'type':Sequelize[_0xd737('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x15'),_0xd737('0xe'),_0xd737('0x16')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd737('0x17')},'callingpres':{'type':Sequelize['ENUM'](_0xd737('0x18'),_0xd737('0x19'),'ALLOWED_FAILED_SCREEN',_0xd737('0x1a'),_0xd737('0x1b'),_0xd737('0x1c'),_0xd737('0x1d'),_0xd737('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'transport':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![],'defaultValue':_0xd737('0x1f'),'set':function(_0x5e43aa){this['setDataValue']('transport',_0x5e43aa?_0x5e43aa['join'](','):null);},'get':function(){return this[_0xd737('0xa')]('transport')?this[_0xd737('0xa')](_0xd737('0x20'))['split'](','):null;},'comment':_0xd737('0x21')},'dtmfmode':{'type':Sequelize['ENUM'](_0xd737('0x22'),_0xd737('0x23'),_0xd737('0x24'),_0xd737('0x25'),_0xd737('0x26')),'allowNull':!![],'defaultValue':_0xd737('0x22')},'directmedia':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no',_0xd737('0x28'),_0xd737('0x29'),_0xd737('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd737('0x2b'),'set':function(_0x5a0018){this['setDataValue'](_0xd737('0x2c'),_0x5a0018?_0x5a0018[_0xd737('0x2d')](','):null);},'get':function(){return this[_0xd737('0xa')](_0xd737('0x2c'))?this['getDataValue'](_0xd737('0x2c'))[_0xd737('0x2e')](','):null;},'comment':_0xd737('0x2f')},'callgroup':{'type':Sequelize[_0xd737('0x6')]},'namedcallgroup':{'type':Sequelize[_0xd737('0x6')]},'pickupgroup':{'type':Sequelize[_0xd737('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xd737('0x6')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd737('0x6')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd737('0x30'),'set':function(_0x272ac4){this[_0xd737('0x3')]('allow',_0x272ac4?_0x272ac4['join'](';'):_0xd737('0x30'));},'get':function(){return this[_0xd737('0xa')](_0xd737('0x31'))?this[_0xd737('0xa')](_0xd737('0x31'))[_0xd737('0x2e')](';'):null;},'comment':_0xd737('0x32')},'autoframing':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![],'set':function(_0x15c10b){this[_0xd737('0x3')](_0xd737('0x33'),_0x15c10b?_0x15c10b['join'](','):null);},'get':function(){return this[_0xd737('0xa')](_0xd737('0x33'))?this[_0xd737('0xa')]('insecure')[_0xd737('0x2e')](','):null;},'comment':_0xd737('0x34')},'trustrpid':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no',_0xd737('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![],'defaultValue':_0xd737('0x36')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no',_0xd737('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xd737('0x38'),_0xd737('0x39'),_0xd737('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xd737('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0xd737('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![],'defaultValue':_0xd737('0x27')},'keepalive':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd737('0xd')]('yes','no',_0xd737('0x3d'),_0xd737('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd737('0xd')]('active',_0xd737('0x3f'),_0xd737('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd737('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xd737('0xd')](_0xd737('0x27'),'no',_0xd737('0x28'),'update',_0xd737('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd737('0x6')]},'resetPasswordExpires':{'type':Sequelize[_0xd737('0x13')]},'passwordResetAt':{'type':Sequelize[_0xd737('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xd737('0x42')]},'showWebBar':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x0,'set':function(_0x155e45){this[_0xd737('0x3')](_0xd737('0x43'),_0x155e45);var _0x3455bd=this['get']({'plain':!![]});switch(_0x155e45){case 0x0:case 0x1:var _0xde79ee=_0x3455bd[_0xd737('0x20')]?_['isArray'](_0x3455bd[_0xd737('0x20')])?_0x3455bd[_0xd737('0x20')]['join']():_0x3455bd[_0xd737('0x20')]:_0xd737('0x1f');if(_0xde79ee===_0xd737('0x44')){_0xde79ee=_0xd737('0x1f');}this['setDataValue']('transport',_0xde79ee);this[_0xd737('0x3')](_0xd737('0x45'),'no');this[_0xd737('0x3')](_0xd737('0x46'),null);this[_0xd737('0x3')](_0xd737('0x47'),null);this[_0xd737('0x3')](_0xd737('0x48'),null);this[_0xd737('0x3')](_0xd737('0x49'),null);this['setDataValue'](_0xd737('0x4a'),null);this[_0xd737('0x3')](_0xd737('0x4b'),null);this['setDataValue'](_0xd737('0x4c'),null);this[_0xd737('0x3')](_0xd737('0x4d'),null);this[_0xd737('0x3')]('rtcp_mux','no');break;case 0x2:this[_0xd737('0x3')]('transport',_0xd737('0x44'));this[_0xd737('0x3')](_0xd737('0x45'),_0xd737('0x27'));this[_0xd737('0x3')](_0xd737('0x46'),'yes');this[_0xd737('0x3')](_0xd737('0x47'),_0xd737('0x27'));this[_0xd737('0x3')](_0xd737('0x48'),'yes');this[_0xd737('0x3')](_0xd737('0x49'),_0xd737('0x27'));this['setDataValue'](_0xd737('0x4a'),'no');this[_0xd737('0x3')]('dtlssetup',_0xd737('0x40'));this[_0xd737('0x3')]('dtlscertfile',_0x3455bd['dtlscertfile']||_0xd737('0x4e'));this[_0xd737('0x3')]('dtlsprivatekey',_0x3455bd['dtlsprivatekey']||_0xd737('0x4f'));this[_0xd737('0x3')]('rtcp_mux',_0xd737('0x27'));break;default:}}},'permissions':{'type':Sequelize[_0xd737('0x42')],'set':function(_0x4020df){this['setDataValue'](_0xd737('0x50'),_0x4020df?_0x4020df[_0xd737('0x2d')](','):[]);},'get':function(){return this[_0xd737('0xa')](_0xd737('0x50'))?_[_0xd737('0x51')](this[_0xd737('0xa')]('permissions')[_0xd737('0x2e')](','),function(_0x1fa0cb){return parseInt(_0x1fa0cb,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xd737('0x6')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xd737('0x6')]},'phoneBarUnconditional':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xd737('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd737('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xd737('0x6')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xd737('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xd737('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xd737('0x52')],'get':function(){return this[_0xd737('0xa')]('phoneBarEnableScreenRecordingByAgent')?this[_0xd737('0xa')](_0xd737('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd737('0x6')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x113258){if(typeof _0x113258===_0xd737('0x54')){var _0x6154ed=_0x113258==='1'?!![]:_0x113258==='0'?![]:_0x113258===_0xd737('0x55')?!![]:_0x113258==='false'?![]:![];this[_0xd737('0x3')](_0xd737('0x56'),_0x6154ed);}else{this[_0xd737('0x3')](_0xd737('0x56'),_0x113258);}}},'blocked':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![],'set':function(_0x315d96){this[_0xd737('0x3')]('blocked',_0x315d96);if(_0x315d96===!![]){this[_0xd737('0x3')]('blockedAt',moment());this[_0xd737('0x3')](_0xd737('0x57'),0x0);}else{this[_0xd737('0x3')](_0xd737('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0xd737('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xd737('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd737('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd737('0x12')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xd737('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xd737('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd737('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd737('0x12')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index e1fc155..432ebf1 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 _0x8e3f=['CmContact','order','sort','where','options','List','Tag','Tags','color','tag','hasOwnProperty','nolimit','getQueues','Queue','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','UserId','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','smsPause','whatsapppause','pauseType','manual','%s%s','getTeams','Team','addTeams','Voice','getChatQueues','setDataValue','Chat','getMailQueues','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','addAgent','getDataValue','Queue:save','removeTeams','getSmsQueues','Whatsapp','getLists','CmList','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$like','$notLike','$notILike','$contains','$any','CmHopper','lastName','Contact','dialActive','getApiKey','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','token','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','inbound','queues','col','toString','asc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unavailable','ringing','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','User,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','role','admin','Users','Agents','agent','filter','map','value','includes','find','name','UserProfileResource','stack','send','index','User','rawAttributes','type','key','password','salt','query','includeAll','include','attributes','push','findAll','rows','length','chat','dataValues','fax','openchannel','show','params','model','differenceBy','keys','filters','intersection','fields','merge','openTabs','mail','body','describe','addContacts','ids','omit','Setting','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','fullname','permissions','101','102','103','113','110','104','105','106','108','109','100','111','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','each','isEmpty','telephone','compact','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','voice','VoiceQueue','format','SIP/%s','voicePause','penalty','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','emit','Queue:remove','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','root','server/files/images/','getOpenTabs','sms','whatsapp','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts'];(function(_0x12fe24,_0x4061cd){var _0x309501=function(_0x2c91d8){while(--_0x2c91d8){_0x12fe24['push'](_0x12fe24['shift']());}};_0x309501(++_0x4061cd);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var moment=require(_0xf8e3('0x0'));var BPromise=require(_0xf8e3('0x1'));var util=require(_0xf8e3('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xf8e3('0x3'));var squel=require(_0xf8e3('0x4'));var jayson=require(_0xf8e3('0x5'));var Redis=require('ioredis');var authService=require(_0xf8e3('0x6'));var qs=require(_0xf8e3('0x7'));var logger=require('../../config/logger')(_0xf8e3('0x8'));var utils=require(_0xf8e3('0x9'));var config=require(_0xf8e3('0xa'));var licenseUtil=require(_0xf8e3('0xb'));var db=require('../../mysqldb')['db'];var socket=require(_0xf8e3('0xc'))(new Redis(config[_0xf8e3('0xd')]));require(_0xf8e3('0xe'))[_0xf8e3('0xf')](socket);config[_0xf8e3('0xd')]=_[_0xf8e3('0x10')](config[_0xf8e3('0xd')],{'host':_0xf8e3('0x11'),'port':0x18eb});var client=jayson[_0xf8e3('0x12')][_0xf8e3('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x28f5f0,_0xe584cd,_0x5e4b87,_0xb7d14f){return new BPromise(function(_0x1e6d9c,_0x3b6ac6){var _0x4888eb=_0xb7d14f||client;return _0x4888eb[_0xf8e3('0x14')](_0x28f5f0,_0x5e4b87)[_0xf8e3('0x15')](function(_0x336790){logger[_0xf8e3('0x16')]('User,\x20%s,\x20%s',_0xe584cd,_0xf8e3('0x17'));logger[_0xf8e3('0x18')](_0xf8e3('0x19'),_0xe584cd,'request\x20sent',JSON[_0xf8e3('0x1a')](_0x336790));if(_0x336790['error']){if(_0x336790[_0xf8e3('0x1b')][_0xf8e3('0x1c')]===0x1f4){logger[_0xf8e3('0x1b')]('User,\x20%s,\x20%s',_0xe584cd,_0x336790['error'][_0xf8e3('0x1d')]);return _0x3b6ac6(_0x336790[_0xf8e3('0x1b')][_0xf8e3('0x1d')]);}logger[_0xf8e3('0x1b')](_0xf8e3('0x1e'),_0xe584cd,_0x336790[_0xf8e3('0x1b')][_0xf8e3('0x1d')]);return _0x1e6d9c(_0x336790[_0xf8e3('0x1b')][_0xf8e3('0x1d')]);}else{logger[_0xf8e3('0x16')]('User,\x20%s,\x20%s',_0xe584cd,_0xf8e3('0x17'));_0x1e6d9c(_0x336790[_0xf8e3('0x1f')][_0xf8e3('0x1d')]);}})[_0xf8e3('0x20')](function(_0x3128ad){logger[_0xf8e3('0x1b')](_0xf8e3('0x1e'),_0xe584cd,_0x3128ad);_0x3b6ac6(_0x3128ad);});});}function respondWithStatusCode(_0x3fff85,_0x5b99b1){_0x5b99b1=_0x5b99b1||0xcc;return function(_0xe5102b){if(_0xe5102b){return _0x3fff85[_0xf8e3('0x21')](_0x5b99b1);}return _0x3fff85[_0xf8e3('0x22')](_0x5b99b1)[_0xf8e3('0x23')]();};}function respondWithResult(_0x4a1e5f,_0x39df34){_0x39df34=_0x39df34||0xc8;return function(_0x4b3705){if(_0x4b3705){return _0x4a1e5f[_0xf8e3('0x22')](_0x39df34)[_0xf8e3('0x24')](_0x4b3705);}};}function respondWithFilteredResult(_0x33d526,_0x2dc856){return function(_0x1f4b68){if(_0x1f4b68){var _0x3ac384=typeof _0x2dc856['offset']===_0xf8e3('0x25')&&typeof _0x2dc856[_0xf8e3('0x26')]===_0xf8e3('0x25');var _0x417b42=_0x1f4b68[_0xf8e3('0x27')];var _0x3b41a1=_0x3ac384?0x0:_0x2dc856[_0xf8e3('0x28')];var _0x157a2d=_0x3ac384?_0x1f4b68['count']:_0x2dc856[_0xf8e3('0x28')]+_0x2dc856[_0xf8e3('0x26')];var _0x12ebd2;if(_0x157a2d>=_0x417b42){_0x157a2d=_0x417b42;_0x12ebd2=0xc8;}else{_0x12ebd2=0xce;}_0x33d526[_0xf8e3('0x22')](_0x12ebd2);return _0x33d526[_0xf8e3('0x29')](_0xf8e3('0x2a'),_0x3b41a1+'-'+_0x157a2d+'/'+_0x417b42)[_0xf8e3('0x24')](_0x1f4b68);}return null;};}function saveUpdates(_0xfaf15d){return function(_0x4f2ae9){if(_0x4f2ae9){return _0x4f2ae9[_0xf8e3('0x2b')](_0xfaf15d)[_0xf8e3('0x15')](function(_0x492694){return _0x492694;});}return null;};}function removeEntity(_0x28b2f2){return function(_0x567153){if(_0x567153){return _0x567153[_0xf8e3('0x2c')]()[_0xf8e3('0x15')](function(){var _0x40f64d=_0x567153[_0xf8e3('0x2d')]({'plain':!![]});if(_0x40f64d[_0xf8e3('0x2e')]===_0xf8e3('0x2f'))return;var _0xb9c26=[{'name':_0xf8e3('0x30'),'value':'user','ignore':!![]},{'name':_0xf8e3('0x31'),'value':_0xf8e3('0x32'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x5cc1ed=_(_0xb9c26)[_0xf8e3('0x33')]('ignore')[_0xf8e3('0x34')](_0xf8e3('0x35'))[_0xf8e3('0x35')]();if(_[_0xf8e3('0x36')](_0x5cc1ed,_0x40f64d['role'])){return;}var _0x581a97=_[_0xf8e3('0x37')](_0xb9c26,[_0xf8e3('0x35'),_0x40f64d[_0xf8e3('0x2e')]])[_0xf8e3('0x38')];return db[_0xf8e3('0x39')][_0xf8e3('0x2c')]({'where':{'type':_0x581a97,'resourceId':_0x40f64d['id']}})['then'](function(){return _0x567153;});})[_0xf8e3('0x15')](function(){_0x28b2f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eaa03){return function(_0x1e8878){if(!_0x1e8878){_0x1eaa03[_0xf8e3('0x21')](0x194);}return _0x1e8878;};}function handleError(_0x1b7af2,_0x4cb46a){_0x4cb46a=_0x4cb46a||0x1f4;return function(_0x5ece46){logger[_0xf8e3('0x1b')](_0x5ece46[_0xf8e3('0x3a')]);if(_0x5ece46['name']){delete _0x5ece46[_0xf8e3('0x38')];}_0x1b7af2[_0xf8e3('0x22')](_0x4cb46a)[_0xf8e3('0x3b')](_0x5ece46);};}exports[_0xf8e3('0x3c')]=function(_0x547f53,_0x53cfea){var _0x5d307e={},_0x22b65e={'count':0x0,'rows':[]};var _0xcd2ffe=_(db[_0xf8e3('0x3d')][_0xf8e3('0x3e')])['map'](function(_0xee2e34){return{'name':_0xee2e34['fieldName'],'type':_0xee2e34[_0xf8e3('0x3f')][_0xf8e3('0x40')]};})[_0xf8e3('0x33')](function(_0x10e225){return!_[_0xf8e3('0x36')]([_0xf8e3('0x41'),_0xf8e3('0x42')],_0x10e225[_0xf8e3('0x38')]);})[_0xf8e3('0x35')]();_0x5d307e=qs['getOptions'](_0xcd2ffe,_0x547f53);var _0x211620={'where':_0x5d307e['where']};return db[_0xf8e3('0x3d')][_0xf8e3('0x27')](_0x211620)[_0xf8e3('0x15')](function(_0x9a6b37){_0x22b65e[_0xf8e3('0x27')]=_0x9a6b37;if(_0x547f53[_0xf8e3('0x43')][_0xf8e3('0x44')]){_0x5d307e[_0xf8e3('0x45')]=[{'all':!![]}];}if(!_['includes'](_0x5d307e[_0xf8e3('0x46')],'id')){_0x5d307e[_0xf8e3('0x46')][_0xf8e3('0x47')]('id');}return db[_0xf8e3('0x3d')][_0xf8e3('0x48')](_0x5d307e);})[_0xf8e3('0x15')](function(_0x792190){_0x22b65e[_0xf8e3('0x49')]=_0x792190;if(_0x547f53['query']['openTabs']==='true'){var _0x30fecf=[];for(var _0x3d3ea5=0x0;_0x3d3ea5<_0x22b65e['rows'][_0xf8e3('0x4a')];_0x3d3ea5++){_0x30fecf['push'](get_open_tabs(_0xf8e3('0x4b'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('sms',_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));_0x30fecf['push'](get_open_tabs(_0xf8e3('0x4d'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('mail',_0x22b65e['rows'][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4e'),_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5]['dataValues']));_0x30fecf[_0xf8e3('0x47')](get_open_tabs('whatsapp',_0x22b65e[_0xf8e3('0x49')][_0x3d3ea5][_0xf8e3('0x4c')]));}return BPromise['all'](_0x30fecf)['then'](function(_0x128234){return _0x22b65e;});}else{return _0x22b65e;}})[_0xf8e3('0x15')](respondWithFilteredResult(_0x53cfea,_0x5d307e))[_0xf8e3('0x20')](handleError(_0x53cfea,null));};exports[_0xf8e3('0x4f')]=function(_0x3b790f,_0x1fc2a6){var _0x3b56ed={'raw':![],'where':{'id':_0x3b790f[_0xf8e3('0x50')]['id']}},_0x2a58e2={};_0x2a58e2[_0xf8e3('0x51')]=_[_0xf8e3('0x52')](_['keys'](db[_0xf8e3('0x3d')][_0xf8e3('0x3e')]),[_0xf8e3('0x41'),_0xf8e3('0x42')]);_0x2a58e2[_0xf8e3('0x43')]=_[_0xf8e3('0x53')](_0x3b790f['query']);_0x2a58e2[_0xf8e3('0x54')]=_[_0xf8e3('0x55')](_0x2a58e2[_0xf8e3('0x51')],_0x2a58e2[_0xf8e3('0x43')]);_0x3b56ed[_0xf8e3('0x46')]=_[_0xf8e3('0x55')](_0x2a58e2['model'],qs[_0xf8e3('0x56')](_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x56')]));_0x3b56ed[_0xf8e3('0x46')]=_0x3b56ed[_0xf8e3('0x46')][_0xf8e3('0x4a')]?_0x3b56ed['attributes']:_0x2a58e2[_0xf8e3('0x51')];if(_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x44')]){_0x3b56ed[_0xf8e3('0x45')]=[{'all':!![]}];}_0x3b56ed=_[_0xf8e3('0x57')]({},_0x3b56ed,_0x3b790f['options']);if(!_[_0xf8e3('0x36')](_0x3b56ed[_0xf8e3('0x46')],'id')){_0x3b56ed[_0xf8e3('0x46')]['push']('id');}return db['User'][_0xf8e3('0x37')](_0x3b56ed)[_0xf8e3('0x15')](handleEntityNotFound(_0x1fc2a6,null))[_0xf8e3('0x15')](function(_0x3ad7f1){var _0x58ad2f=[];values=_0x3ad7f1;if(_0x3b790f[_0xf8e3('0x43')][_0xf8e3('0x58')]==='true'){_0x58ad2f['push'](get_open_tabs(_0xf8e3('0x4b'),_0x3ad7f1[_0xf8e3('0x4c')]));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs('sms',_0x3ad7f1['dataValues']));_0x58ad2f['push'](get_open_tabs(_0xf8e3('0x4e'),_0x3ad7f1[_0xf8e3('0x4c')]));_0x58ad2f['push'](get_open_tabs('whatsapp',_0x3ad7f1['dataValues']));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4d'),_0x3ad7f1['dataValues']));_0x58ad2f[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x59'),_0x3ad7f1[_0xf8e3('0x4c')]));return BPromise['all'](_0x58ad2f);}else{return values;}})['then'](function(_0x524fbc){return values;})['then'](respondWithResult(_0x1fc2a6,null))[_0xf8e3('0x20')](handleError(_0x1fc2a6,null));};exports[_0xf8e3('0x2b')]=function(_0x3ef144,_0x447efe){if(_0x3ef144[_0xf8e3('0x5a')]['id']){delete _0x3ef144[_0xf8e3('0x5a')]['id'];}delete _0x3ef144[_0xf8e3('0x5a')][_0xf8e3('0x2e')];return db[_0xf8e3('0x3d')]['find']({'where':{'id':_0x3ef144['params']['id']}})[_0xf8e3('0x15')](handleEntityNotFound(_0x447efe,null))[_0xf8e3('0x15')](saveUpdates(_0x3ef144[_0xf8e3('0x5a')],null))['then'](respondWithResult(_0x447efe,null))[_0xf8e3('0x20')](handleError(_0x447efe,null));};exports[_0xf8e3('0x5b')]=function(_0x4879c7,_0x48bb3f){return db[_0xf8e3('0x3d')][_0xf8e3('0x5b')]()[_0xf8e3('0x15')](respondWithResult(_0x48bb3f,null))[_0xf8e3('0x20')](handleError(_0x48bb3f,null));};exports['addContacts']=function(_0x5bd7bf,_0x37751e){return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x5bd7bf[_0xf8e3('0x50')]['id']}})['then'](handleEntityNotFound(_0x37751e,null))['then'](function(_0x324ad5){if(_0x324ad5){return _0x324ad5[_0xf8e3('0x5c')](_0x5bd7bf['body'][_0xf8e3('0x5d')],_[_0xf8e3('0x5e')](_0x5bd7bf[_0xf8e3('0x5a')],[_0xf8e3('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x37751e,null))[_0xf8e3('0x20')](handleError(_0x37751e,null));};function validateUser(_0x5d2ecf){return new BPromise(function(_0x217979,_0x1cad38){if(_0x5d2ecf['internal'])return _0x217979(_0x5d2ecf);return db[_0xf8e3('0x5f')][_0xf8e3('0x60')](0x1)['then'](function(_0x232d83){if(_0x232d83[_0xf8e3('0x61')])authService[_0xf8e3('0x62')](_0x5d2ecf[_0xf8e3('0x41')]);db['User'][_0xf8e3('0x63')](_0xf8e3('0x64'))[_0xf8e3('0x15')](function(_0x3c214f){if(_[_0xf8e3('0x65')](_0x3c214f)){_0x5d2ecf[_0xf8e3('0x64')]=_0x232d83[_0xf8e3('0x66')]||0x1;return;}if(_[_0xf8e3('0x65')](_0x232d83[_0xf8e3('0x66')])||_0x232d83[_0xf8e3('0x66')]===_0x3c214f){_0x5d2ecf[_0xf8e3('0x64')]=_0x3c214f+0x1;return;}if(_0x232d83[_0xf8e3('0x66')]>_0x3c214f){_0x5d2ecf['internal']=_0x232d83['min_internal'];return;}return db[_0xf8e3('0x67')][_0xf8e3('0x43')]('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[_0xf8e3('0x67')][_0xf8e3('0x68')][_0xf8e3('0x69')]})[_0xf8e3('0x15')](function(_0x18a810){if(_0x18a810&&_0x18a810['length']){for(var _0x3e501c=0x0,_0x1dcd23=_0x18a810['length'];_0x3e501c<_0x1dcd23&&_[_0xf8e3('0x65')](_0x5d2ecf['internal']);_0x3e501c++){if(_0x232d83[_0xf8e3('0x66')]<=_0x18a810[_0x3e501c]['from']){_0x5d2ecf[_0xf8e3('0x64')]=_0x18a810[_0x3e501c][_0xf8e3('0x6a')];}else if(_0x232d83[_0xf8e3('0x66')]>_0x18a810[_0x3e501c][_0xf8e3('0x6a')]&&_0x232d83[_0xf8e3('0x66')]<=_0x18a810[_0x3e501c]['to']){_0x5d2ecf['internal']=_0x232d83[_0xf8e3('0x66')];}}}if(_[_0xf8e3('0x65')](_0x5d2ecf[_0xf8e3('0x64')])){_0x5d2ecf[_0xf8e3('0x64')]=_0x3c214f+0x1;}return _0x217979(_0x5d2ecf);});});})[_0xf8e3('0x20')](function(_0x3852d1){_0x1cad38(_0x3852d1);});});}function updateUser(_0x459562){return new BPromise(function(_0x2ccd34,_0x3ddc19){try{if(_0x459562[_0xf8e3('0x6b')]){_0x459562[_0xf8e3('0x6c')]=_0x459562[_0xf8e3('0x64')];_0x459562['VoiceMail']={'mailbox':_0x459562[_0xf8e3('0x64')],'password':_0x459562[_0xf8e3('0x41')],'fullname':_0x459562[_0xf8e3('0x6d')],'email':_0x459562['email']};}if(_0x459562[_0xf8e3('0x2e')]===_0xf8e3('0x32')){if(!_0x459562[_0xf8e3('0x6e')])_0x459562[_0xf8e3('0x6e')]=[_0xf8e3('0x6f'),_0xf8e3('0x70'),_0xf8e3('0x71'),_0xf8e3('0x72'),_0xf8e3('0x73'),_0xf8e3('0x74'),_0xf8e3('0x75'),_0xf8e3('0x76'),'107',_0xf8e3('0x77'),_0xf8e3('0x78'),_0xf8e3('0x79'),_0xf8e3('0x7a'),'114','115'];}_0x2ccd34(_0x459562);}catch(_0x11aa1d){_0x3ddc19(_0x11aa1d);}});}exports[_0xf8e3('0x7b')]=function(_0x4c8707,_0x5bedc7){if(_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]==='agent')throw new Error(_0xf8e3('0x7d'));if(_0x4c8707[_0xf8e3('0x5a')][_0xf8e3('0x2e')]===_0xf8e3('0x7c')&&_0x4c8707[_0xf8e3('0x7c')]['role']!==_0xf8e3('0x2f')){throw new Error(_0xf8e3('0x7e'));}if(_0x4c8707['body']['role']===_0xf8e3('0x2f')&&_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x2f')){throw new Error(_0xf8e3('0x7f'));}return licenseUtil[_0xf8e3('0x80')]([_0x4c8707[_0xf8e3('0x5a')]])[_0xf8e3('0x15')](function(){return validateUser(_0x4c8707['body']);})[_0xf8e3('0x15')](function(_0x2c9a8e){return updateUser(_0x2c9a8e)[_0xf8e3('0x15')](function(_0x16f087){if(_0x16f087[_0xf8e3('0x2e')]===_0xf8e3('0x2f')){_0x16f087['settingsEnabled']=_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x81')];delete _0x16f087[_0xf8e3('0x82')];}return _0x16f087;});})['then'](function(_0x47a748){return db[_0xf8e3('0x3d')][_0xf8e3('0x7b')](_0x47a748,{'include':[{'model':db[_0xf8e3('0x83')],'as':_0xf8e3('0x83')}]});})[_0xf8e3('0x15')](function(_0x5b8840){if(_0x4c8707[_0xf8e3('0x5a')][_0xf8e3('0x2e')]===_0xf8e3('0x7c'))return _0x5b8840;if(_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x7c'))return _0x5b8840;return db[_0xf8e3('0x84')][_0xf8e3('0x37')]({'where':{'name':_0x5b8840[_0xf8e3('0x2e')]==='agent'?_0xf8e3('0x31'):_0xf8e3('0x85'),'userProfileId':_0x4c8707[_0xf8e3('0x7c')][_0xf8e3('0x82')]},'raw':!![]})[_0xf8e3('0x15')](function(_0xb2f16e){if(!_0xb2f16e||_0xb2f16e[_0xf8e3('0x86')]!=0x0)return _0x5b8840;return db['UserProfileResource']['create']({'name':_0x5b8840[_0xf8e3('0x38')],'resourceId':_0x5b8840['id'],'type':_0xb2f16e[_0xf8e3('0x38')],'sectionId':_0xb2f16e['id']},{})['then'](function(){return _0x5b8840;});})[_0xf8e3('0x20')](function(_0x2412f9){logger[_0xf8e3('0x1b')](_0xf8e3('0x87'),_0x2412f9);throw _0x2412f9;});})[_0xf8e3('0x15')](respondWithResult(_0x5bedc7,0xc9))[_0xf8e3('0x20')](handleError(_0x5bedc7,null));};exports[_0xf8e3('0x88')]=function(_0x4b5a1f,_0xddfaee){var _0x2121f3=_0x4b5a1f[_0xf8e3('0x5a')];var _0xc8c987=[];if(_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]===_0xf8e3('0x32'))throw new Error(_0xf8e3('0x7d'));if(_[_0xf8e3('0x89')](_0x2121f3,[_0xf8e3('0x2e'),_0xf8e3('0x7c')])&&_0x4b5a1f['user']['role']!==_0xf8e3('0x2f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xf8e3('0x89')](_0x2121f3,['role',_0xf8e3('0x2f')])&&_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!=='admin'){throw new Error(_0xf8e3('0x8a'));}return licenseUtil[_0xf8e3('0x80')](_0x2121f3)[_0xf8e3('0x15')](function(){return validateUser(_0x2121f3[0x0]);})[_0xf8e3('0x15')](function(){for(var _0x3619cd=0x1;_0x3619cd<_0x2121f3['length'];_0x3619cd++){var _0xec1ff5=_0x2121f3[_0x3619cd-0x1]['internal'];if(!_0x2121f3[_0x3619cd][_0xf8e3('0x64')])_0x2121f3[_0x3619cd][_0xf8e3('0x64')]=_0xec1ff5+0x1;_0xc8c987[_0xf8e3('0x47')](validateUser(_0x2121f3[_0x3619cd]));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);})[_0xf8e3('0x15')](function(){_0xc8c987=[];for(var _0x3243b5=0x0;_0x3243b5<_0x2121f3[_0xf8e3('0x4a')];_0x3243b5++){_0xc8c987['push'](updateUser(_0x2121f3[_0x3243b5]));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);})[_0xf8e3('0x15')](function(){return BPromise[_0xf8e3('0x8c')](_0x2121f3,function(_0x1a9ba6){return db['User'][_0xf8e3('0x7b')](_0x1a9ba6,{'include':[{'model':db[_0xf8e3('0x83')],'as':_0xf8e3('0x83')}]})[_0xf8e3('0x15')](function(_0x22fa2f){_0x1a9ba6['id']=_0x22fa2f['id'];return _0x1a9ba6;});});})[_0xf8e3('0x15')](function(_0x477589){if(_0x4b5a1f[_0xf8e3('0x5a')]['role']==='user')return _0x477589;if(_0x4b5a1f[_0xf8e3('0x7c')][_0xf8e3('0x2e')]!==_0xf8e3('0x7c'))return _0x477589;var _0x161347=_[_0xf8e3('0x89')](_0x477589,function(_0x12bc5b){return _0x12bc5b[_0xf8e3('0x2e')]==='agent'||_0x12bc5b[_0xf8e3('0x2e')]==='telephone';});if(!_0x161347)return _0x477589;return db[_0xf8e3('0x84')][_0xf8e3('0x48')]({'where':{'name':{'$or':[_0xf8e3('0x31'),_0xf8e3('0x85')]},'userProfileId':_0x4b5a1f['user'][_0xf8e3('0x82')]},'raw':!![]})['then'](function(_0x567d66){if(_[_0xf8e3('0x8d')](_0x567d66)||!_[_0xf8e3('0x89')](_0x567d66,[_0xf8e3('0x86'),0x0]))return _0x477589;_0xc8c987=[];var _0x2db4e4=_(_0x567d66)['map'](function(_0x4e7821){if(_0x4e7821[_0xf8e3('0x86')]===0x1)return;return _0x4e7821[_0xf8e3('0x38')]==='Agents'?'agent':_0xf8e3('0x8e');})[_0xf8e3('0x8f')]()['value']();for(var _0x1844da=0x0;_0x1844da<_0x477589[_0xf8e3('0x4a')];_0x1844da++){if(!_[_0xf8e3('0x36')](_0x2db4e4,_0x477589[_0x1844da][_0xf8e3('0x2e')]))return;var _0x1bae38=_0x477589[_0x1844da][_0xf8e3('0x2e')]===_0xf8e3('0x32')?'Agents':_0xf8e3('0x85');_0xc8c987[_0xf8e3('0x47')](db['UserProfileResource'][_0xf8e3('0x7b')]({'name':_0x477589[_0x1844da]['name'],'resourceId':_0x477589[_0x1844da]['id'],'type':_0x1bae38,'sectionId':_[_0xf8e3('0x37')](_0x567d66,[_0xf8e3('0x38'),_0x1bae38])['id']},{}));}return BPromise[_0xf8e3('0x8b')](_0xc8c987);});})['then'](respondWithResult(_0xddfaee,0xc9))[_0xf8e3('0x20')](handleError(_0xddfaee,null));};exports['changePassword']=function(_0x153c80,_0x41ca1b){if(_0x153c80[_0xf8e3('0x5a')]['id']){delete _0x153c80[_0xf8e3('0x5a')]['id'];}return db['User']['find']({'where':{'id':_0x153c80[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x15')](function(_0x268855){if(!_0x268855)return null;if(_0x268855['id']===_0x153c80[_0xf8e3('0x7c')]['id']){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x90')]||!_0x153c80['body'][_0xf8e3('0x91')]){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x94'));}if(!_0x268855['authenticate'](_0x153c80[_0xf8e3('0x5a')]['oldPassword'])){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))]('Wrong\x20credentials');}if(_0x153c80[_0xf8e3('0x5a')]['oldPassword']===_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db['Sequelize'][(_0xf8e3('0x93'))](_0xf8e3('0x95'));}}else if(_0x153c80['user'][_0xf8e3('0x2e')]===_0xf8e3('0x2f')){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x96'));}}else if(_0x153c80[_0xf8e3('0x7c')][_0xf8e3('0x2e')]===_0xf8e3('0x7c')){if(!_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]){throw new db['Sequelize'][(_0xf8e3('0x93'))](_0xf8e3('0x96'));}if(_0x268855[_0xf8e3('0x2e')]!=='agent'){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x7d'));}}else{throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0x7d'));}return _0x268855;})[_0xf8e3('0x15')](handleEntityNotFound(_0x41ca1b,null))['then'](function(_0x513b90){return db[_0xf8e3('0x5f')][_0xf8e3('0x97')]({'attributes':['id','securePassword',_0xf8e3('0x98'),_0xf8e3('0x99')]})['then'](function(_0x45919d){if(_0x45919d[_0xf8e3('0x61')])authService[_0xf8e3('0x62')](_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')]);if(!_0x45919d['enforcePasswordHistory']||!_0x513b90[_0xf8e3('0x9a')])return _0x513b90;authService[_0xf8e3('0x9b')](_0x153c80['body'][_0xf8e3('0x91')],_0x513b90[_0xf8e3('0x9a')],_0x45919d[_0xf8e3('0x99')]);return _0x513b90;})[_0xf8e3('0x15')](saveUpdates({'password':_0x153c80[_0xf8e3('0x5a')][_0xf8e3('0x91')],'passwordResetAt':_0x153c80[_0xf8e3('0x7c')]['id']==_0x153c80['params']['id']?moment():null,'previousPasswords':authService[_0xf8e3('0x9c')](_0x153c80[_0xf8e3('0x5a')]['newPassword'],_0x513b90['previousPasswords'])},null));})['then'](respondWithResult(_0x41ca1b,null))[_0xf8e3('0x20')](handleError(_0x41ca1b,null));};exports[_0xf8e3('0x9d')]=function(_0x417af2,_0x29f5d0){var _0x4622b1=_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x9e')];return db['User']['find']({'where':{'id':_0x417af2[_0xf8e3('0x50')]['id']},'attributes':['id','name','role',_0xf8e3('0x9f'),_0xf8e3('0xa0'),'voicePause',_0xf8e3('0xa1')]})[_0xf8e3('0x15')](handleEntityNotFound(_0x29f5d0,null))[_0xf8e3('0x15')](function(_0x2c4060){if(_0x2c4060){if(!utils[_0xf8e3('0xa2')](_0x4622b1)){throw new db[(_0xf8e3('0x92'))][(_0xf8e3('0x93'))](_0xf8e3('0xa3'));}return _0x2c4060[_0xf8e3('0xa4')+_[_0xf8e3('0xa5')](_0x4622b1[_0xf8e3('0xa6')]())+_0xf8e3('0xa7')](_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')],{'penalty':_0x417af2[_0xf8e3('0x5a')]['penalty']||0x0})[_0xf8e3('0xa8')](function(_0x3de54e){for(var _0x4cb7c0=0x0;_0x4cb7c0<_0x417af2[_0xf8e3('0x5a')]['ids']['length'];_0x4cb7c0+=0x1){var _0x5a66ee={'UserId':Number(_0x417af2[_0xf8e3('0x50')]['id'])};_0x5a66ee[_[_0xf8e3('0xa5')](_0x4622b1['toLowerCase']())+_0xf8e3('0xa9')]=Number(_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')][_0x4cb7c0]);socket['emit'](_0xf8e3('0x7c')+_[_0xf8e3('0xa5')](_0x4622b1[_0xf8e3('0xa6')]())+'Queue:save',_0x5a66ee);}return _0x3de54e;})[_0xf8e3('0x15')](function(){if(_0x4622b1===_0xf8e3('0xaa')){return db[_0xf8e3('0xab')]['findAll']({'where':{'id':_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0x5d')]||[]},'raw':!![],'attributes':['id',_0xf8e3('0x38')]});}})[_0xf8e3('0x15')](function(_0x239890){var _0x446bf8=_0x2c4060['get']({'plain':!![]});var _0x14b346=[];if(_0x4622b1===_0xf8e3('0xaa')&&_0x446bf8['role']===_0xf8e3('0x32')&&_0x446bf8[_0xf8e3('0x9f')]){for(var _0xcf534f=0x0;_0xcf534f<_0x239890[_0xf8e3('0x4a')];_0xcf534f+=0x1){_0x14b346['push']({'membername':_0x446bf8[_0xf8e3('0x38')],'UserId':_0x446bf8['id'],'queue_name':_0x239890[_0xcf534f]['name'],'VoiceQueueId':_0x239890[_0xcf534f]['id'],'interface':_[_0xf8e3('0x65')](_0x446bf8['interface'])?util[_0xf8e3('0xac')](_0xf8e3('0xad'),_0x446bf8['name']):_0x446bf8[_0xf8e3('0xa1')],'paused':_0x446bf8[_0xf8e3('0xae')]||![],'penalty':_0x417af2[_0xf8e3('0x5a')][_0xf8e3('0xaf')]||0x0});}return BPromise[_0xf8e3('0x8c')](_0x14b346,function(_0x1b02c8){return db[_0xf8e3('0xb0')][_0xf8e3('0xb1')](_0x1b02c8);});}return _0x2c4060;});}})[_0xf8e3('0x15')](respondWithStatusCode(_0x29f5d0,null))[_0xf8e3('0x20')](handleError(_0x29f5d0,null));};exports[_0xf8e3('0xb2')]=function(_0xba6c1a,_0x4508d2){var _0x430f5b;return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0xba6c1a['params']['id']},'attributes':['id',_0xf8e3('0x38'),'role']})[_0xf8e3('0x15')](handleEntityNotFound(_0x4508d2,null))[_0xf8e3('0x15')](function(_0x50b249){if(_0x50b249){_0x430f5b=_0x50b249;if(!_0xba6c1a[_0xf8e3('0x43')]['channel']||!utils[_0xf8e3('0xa2')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')])){throw new db[(_0xf8e3('0x92'))]['ValidationError'](_0xf8e3('0xa3'));}return _0x50b249[_0xf8e3('0xb3')+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+'Queues'](_0xba6c1a[_0xf8e3('0x43')]['ids']);}})['then'](function(_0x490b3c){if(_[_0xf8e3('0xb4')](_0xba6c1a['query']['ids'])){for(var _0x537cf0=0x0;_0x537cf0<_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')][_0xf8e3('0x4a')];_0x537cf0+=0x1){var _0x5399b5={'UserId':Number(_0xba6c1a[_0xf8e3('0x50')]['id'])};_0x5399b5[_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xa9')]=Number(_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')][_0x537cf0]);socket[_0xf8e3('0xb5')](_0xf8e3('0x7c')+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xb6'),_0x5399b5);}}else{var _0x5399b5={'UserId':Number(_0xba6c1a[_0xf8e3('0x50')]['id'])};_0x5399b5[_[_0xf8e3('0xa5')](_0xba6c1a['query'][_0xf8e3('0x9e')]['toLowerCase']())+_0xf8e3('0xa9')]=Number(_0xba6c1a[_0xf8e3('0x43')]['ids']);socket[_0xf8e3('0xb5')]('user'+_[_0xf8e3('0xa5')](_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')][_0xf8e3('0xa6')]())+_0xf8e3('0xb6'),_0x5399b5);}return _0x490b3c;})[_0xf8e3('0x15')](function(){if(_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x9e')]===_0xf8e3('0xaa')){return db[_0xf8e3('0xb0')][_0xf8e3('0x2c')]({'where':{'UserId':_0xba6c1a[_0xf8e3('0x50')]['id'],'VoiceQueueId':_0xba6c1a[_0xf8e3('0x43')][_0xf8e3('0x5d')]},'individualHooks':!![]})[_0xf8e3('0x15')](function(){return _0x430f5b;});}return _0x430f5b;})[_0xf8e3('0x15')](respondWithStatusCode(_0x4508d2,null))[_0xf8e3('0x20')](handleError(_0x4508d2,null));};exports['addAvatar']=function(_0x463566,_0x37d5c9){_0x463566[_0xf8e3('0x5a')][_0xf8e3('0xb7')]=_0x463566[_0xf8e3('0xb8')][_0xf8e3('0xb9')];return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x463566[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x15')](handleEntityNotFound(_0x37d5c9,null))[_0xf8e3('0x15')](saveUpdates(_0x463566[_0xf8e3('0x5a')],null))[_0xf8e3('0x15')](respondWithResult(_0x37d5c9,null))[_0xf8e3('0x20')](handleError(_0x37d5c9,null));};exports[_0xf8e3('0xba')]=function(_0x3cf809,_0x4d2cdb){var _0x3f4924=path[_0xf8e3('0xbb')](config['root'],_0xf8e3('0xbc'));return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x3cf809['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xf8e3('0x15')](handleEntityNotFound(_0x4d2cdb,null))['then'](function(_0x445091){if(_0x445091){if(_['isNil'](_0x445091['userpic'])){return _0x4d2cdb[_0xf8e3('0xbd')](_0x3f4924);}else{if(!fs['existsSync'](path[_0xf8e3('0xbb')](config[_0xf8e3('0xbe')],'server/files/images/',_0x445091['userpic']))){return _0x4d2cdb[_0xf8e3('0xbd')](_0x3f4924);}return _0x4d2cdb['download'](path[_0xf8e3('0xbb')](config[_0xf8e3('0xbe')],_0xf8e3('0xbf'),_0x445091['userpic']));}}})[_0xf8e3('0x20')](handleError(_0x4d2cdb,null));};exports[_0xf8e3('0xc0')]=function(_0x33cf45,_0xfd0019){return db[_0xf8e3('0x3d')][_0xf8e3('0x37')]({'where':{'id':_0x33cf45[_0xf8e3('0x50')]['id']},'attributes':['id']})[_0xf8e3('0x15')](handleEntityNotFound(_0xfd0019,null))[_0xf8e3('0x15')](function(_0xe70da7){var _0x3bffa9=[];values=_0xe70da7[_0xf8e3('0x4c')];_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4b'),_0xe70da7['dataValues']));_0x3bffa9['push'](get_open_tabs(_0xf8e3('0xc1'),_0xe70da7['dataValues']));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4e'),_0xe70da7['dataValues']));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0xc2'),_0xe70da7[_0xf8e3('0x4c')]));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x4d'),_0xe70da7[_0xf8e3('0x4c')]));_0x3bffa9[_0xf8e3('0x47')](get_open_tabs(_0xf8e3('0x59'),_0xe70da7[_0xf8e3('0x4c')]));return BPromise['all'](_0x3bffa9);})[_0xf8e3('0x15')](function(_0x3996fe){var _0x5e026c=[];if(_0x3996fe){for(var _0x15fa6f=0x0;_0x15fa6f=_0x480103){_0x262f69=_0x480103;_0x47ec77=0xc8;}else{_0x47ec77=0xce;}_0x43414b[_0xa00e('0x1c')](_0x47ec77);return _0x43414b[_0xa00e('0x22')]('Content-Range',_0x61cd80+'-'+_0x262f69+'/'+_0x480103)[_0xa00e('0x23')](_0x32aa90);}return null;};}function saveUpdates(_0x1e4ace){return function(_0x43dcc5){if(_0x43dcc5){return _0x43dcc5[_0xa00e('0x24')](_0x1e4ace)[_0xa00e('0x12')](function(_0x543c1b){return _0x543c1b;});}return null;};}function removeEntity(_0x515913){return function(_0x3e49d1){if(_0x3e49d1){return _0x3e49d1[_0xa00e('0x25')]()[_0xa00e('0x12')](function(){var _0x1f37aa=_0x3e49d1[_0xa00e('0x26')]({'plain':!![]});if(_0x1f37aa['role']===_0xa00e('0x27'))return;var _0x63bfa3=[{'name':'Users','value':_0xa00e('0x28'),'ignore':!![]},{'name':_0xa00e('0x29'),'value':_0xa00e('0x2a'),'ignore':![]},{'name':_0xa00e('0x2b'),'value':_0xa00e('0x2c'),'ignore':![]}];var _0x293ee6=_(_0x63bfa3)[_0xa00e('0x2d')](_0xa00e('0x2e'))['map'](_0xa00e('0x2f'))['value']();if(_[_0xa00e('0x30')](_0x293ee6,_0x1f37aa[_0xa00e('0x31')])){return;}var _0x3eae30=_[_0xa00e('0x32')](_0x63bfa3,[_0xa00e('0x2f'),_0x1f37aa['role']])[_0xa00e('0x33')];return db[_0xa00e('0x34')][_0xa00e('0x25')]({'where':{'type':_0x3eae30,'resourceId':_0x1f37aa['id']}})['then'](function(){return _0x3e49d1;});})[_0xa00e('0x12')](function(){_0x515913['status'](0xcc)[_0xa00e('0x1d')]();});}};}function handleEntityNotFound(_0xe8f3c4){return function(_0x5a41e8){if(!_0x5a41e8){_0xe8f3c4[_0xa00e('0x1b')](0x194);}return _0x5a41e8;};}function handleError(_0x1061c2,_0x5e9c72){_0x5e9c72=_0x5e9c72||0x1f4;return function(_0x14ae12){logger[_0xa00e('0x18')](_0x14ae12[_0xa00e('0x35')]);if(_0x14ae12['name']){delete _0x14ae12['name'];}_0x1061c2['status'](_0x5e9c72)[_0xa00e('0x36')](_0x14ae12);};}exports[_0xa00e('0x37')]=function(_0x25b5c5,_0xb15b7d){var _0x1ecfe6={},_0x26b501={'count':0x0,'rows':[]};var _0xae3292=_(db[_0xa00e('0x38')][_0xa00e('0x39')])[_0xa00e('0x3a')](function(_0x49d874){return{'name':_0x49d874[_0xa00e('0x3b')],'type':_0x49d874[_0xa00e('0x3c')][_0xa00e('0x3d')]};})[_0xa00e('0x2d')](function(_0x508e33){return!_['includes']([_0xa00e('0x3e'),_0xa00e('0x3f')],_0x508e33[_0xa00e('0x33')]);})[_0xa00e('0x2f')]();_0x1ecfe6=qs[_0xa00e('0x40')](_0xae3292,_0x25b5c5);var _0x50cbdc={'where':_0x1ecfe6[_0xa00e('0x41')]};return db['User'][_0xa00e('0x21')](_0x50cbdc)['then'](function(_0x4e17a5){_0x26b501['count']=_0x4e17a5;if(_0x25b5c5[_0xa00e('0x42')][_0xa00e('0x43')]){_0x1ecfe6[_0xa00e('0x44')]=[{'all':!![]}];}if(!_['includes'](_0x1ecfe6[_0xa00e('0x45')],'id')){_0x1ecfe6[_0xa00e('0x45')][_0xa00e('0x46')]('id');}return db[_0xa00e('0x38')][_0xa00e('0x47')](_0x1ecfe6);})[_0xa00e('0x12')](function(_0x427c34){_0x26b501[_0xa00e('0x48')]=_0x427c34;if(_0x25b5c5['query'][_0xa00e('0x49')]===_0xa00e('0x4a')){var _0x342530=[];for(var _0x98dd17=0x0;_0x98dd17<_0x26b501[_0xa00e('0x48')]['length'];_0x98dd17++){_0x342530['push'](get_open_tabs('chat',_0x26b501['rows'][_0x98dd17]['dataValues']));_0x342530[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4b'),_0x26b501['rows'][_0x98dd17]['dataValues']));_0x342530[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4c'),_0x26b501['rows'][_0x98dd17][_0xa00e('0x4d')]));_0x342530['push'](get_open_tabs('mail',_0x26b501[_0xa00e('0x48')][_0x98dd17][_0xa00e('0x4d')]));_0x342530[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4e'),_0x26b501[_0xa00e('0x48')][_0x98dd17]['dataValues']));_0x342530[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4f'),_0x26b501[_0xa00e('0x48')][_0x98dd17][_0xa00e('0x4d')]));}return BPromise[_0xa00e('0x50')](_0x342530)[_0xa00e('0x12')](function(_0x2e98f6){return _0x26b501;});}else{return _0x26b501;}})[_0xa00e('0x12')](respondWithFilteredResult(_0xb15b7d,_0x1ecfe6))[_0xa00e('0x51')](handleError(_0xb15b7d,null));};exports['show']=function(_0x59b345,_0x2e4d02){var _0x563069={'raw':![],'where':{'id':_0x59b345['params']['id']}},_0x1aea53={};_0x1aea53[_0xa00e('0x52')]=_[_0xa00e('0x53')](_[_0xa00e('0x54')](db[_0xa00e('0x38')]['rawAttributes']),['password',_0xa00e('0x3f')]);_0x1aea53[_0xa00e('0x42')]=_['keys'](_0x59b345[_0xa00e('0x42')]);_0x1aea53['filters']=_['intersection'](_0x1aea53[_0xa00e('0x52')],_0x1aea53[_0xa00e('0x42')]);_0x563069[_0xa00e('0x45')]=_[_0xa00e('0x55')](_0x1aea53[_0xa00e('0x52')],qs[_0xa00e('0x56')](_0x59b345['query'][_0xa00e('0x56')]));_0x563069[_0xa00e('0x45')]=_0x563069[_0xa00e('0x45')][_0xa00e('0x57')]?_0x563069[_0xa00e('0x45')]:_0x1aea53['model'];if(_0x59b345['query'][_0xa00e('0x43')]){_0x563069[_0xa00e('0x44')]=[{'all':!![]}];}_0x563069=_[_0xa00e('0x58')]({},_0x563069,_0x59b345[_0xa00e('0x59')]);if(!_[_0xa00e('0x30')](_0x563069[_0xa00e('0x45')],'id')){_0x563069[_0xa00e('0x45')]['push']('id');}return db[_0xa00e('0x38')][_0xa00e('0x32')](_0x563069)[_0xa00e('0x12')](handleEntityNotFound(_0x2e4d02,null))['then'](function(_0x408aaa){var _0x559d21=[];values=_0x408aaa;if(_0x59b345[_0xa00e('0x42')][_0xa00e('0x49')]==='true'){_0x559d21[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x5a'),_0x408aaa[_0xa00e('0x4d')]));_0x559d21['push'](get_open_tabs('sms',_0x408aaa['dataValues']));_0x559d21[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4e'),_0x408aaa[_0xa00e('0x4d')]));_0x559d21['push'](get_open_tabs(_0xa00e('0x4f'),_0x408aaa[_0xa00e('0x4d')]));_0x559d21[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4c'),_0x408aaa[_0xa00e('0x4d')]));_0x559d21[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x5b'),_0x408aaa['dataValues']));return BPromise['all'](_0x559d21);}else{return values;}})['then'](function(_0x25ce34){return values;})['then'](respondWithResult(_0x2e4d02,null))[_0xa00e('0x51')](handleError(_0x2e4d02,null));};exports[_0xa00e('0x24')]=function(_0x2a6834,_0x58483a){if(_0x2a6834['body']['id']){delete _0x2a6834['body']['id'];}delete _0x2a6834['body'][_0xa00e('0x31')];return db[_0xa00e('0x38')][_0xa00e('0x32')]({'where':{'id':_0x2a6834[_0xa00e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x58483a,null))['then'](saveUpdates(_0x2a6834['body'],null))[_0xa00e('0x12')](respondWithResult(_0x58483a,null))[_0xa00e('0x51')](handleError(_0x58483a,null));};exports[_0xa00e('0x5d')]=function(_0x1382a2,_0xb9d27e){return db[_0xa00e('0x38')][_0xa00e('0x5d')]()[_0xa00e('0x12')](respondWithResult(_0xb9d27e,null))['catch'](handleError(_0xb9d27e,null));};exports[_0xa00e('0x5e')]=function(_0x5e0474,_0x1a447b){return db[_0xa00e('0x38')][_0xa00e('0x32')]({'where':{'id':_0x5e0474[_0xa00e('0x5c')]['id']}})[_0xa00e('0x12')](handleEntityNotFound(_0x1a447b,null))[_0xa00e('0x12')](function(_0x300a5d){if(_0x300a5d){return _0x300a5d['addContacts'](_0x5e0474[_0xa00e('0x5f')][_0xa00e('0x60')],_['omit'](_0x5e0474[_0xa00e('0x5f')],[_0xa00e('0x60'),'id'])||{});}})[_0xa00e('0x12')](respondWithResult(_0x1a447b,null))[_0xa00e('0x51')](handleError(_0x1a447b,null));};function validateUser(_0xc88230){return new BPromise(function(_0x4ed8e6,_0x6de675){if(_0xc88230['internal'])return _0x4ed8e6(_0xc88230);return db['Setting'][_0xa00e('0x61')](0x1)['then'](function(_0x568274){if(_0x568274[_0xa00e('0x62')])authService[_0xa00e('0x63')](_0xc88230[_0xa00e('0x3e')]);db[_0xa00e('0x38')][_0xa00e('0x64')](_0xa00e('0x65'))['then'](function(_0x18516e){if(_[_0xa00e('0x66')](_0x18516e)){_0xc88230[_0xa00e('0x65')]=_0x568274[_0xa00e('0x67')]||0x1;return;}if(_['isNil'](_0x568274[_0xa00e('0x67')])||_0x568274[_0xa00e('0x67')]===_0x18516e){_0xc88230[_0xa00e('0x65')]=_0x18516e+0x1;return;}if(_0x568274['min_internal']>_0x18516e){_0xc88230[_0xa00e('0x65')]=_0x568274[_0xa00e('0x67')];return;}return db[_0xa00e('0x68')]['query'](_0xa00e('0x69'),{'type':db[_0xa00e('0x68')][_0xa00e('0x6a')][_0xa00e('0x6b')]})[_0xa00e('0x12')](function(_0x4fac34){if(_0x4fac34&&_0x4fac34[_0xa00e('0x57')]){for(var _0x458ca1=0x0,_0x5d43e7=_0x4fac34['length'];_0x458ca1<_0x5d43e7&&_['isNil'](_0xc88230[_0xa00e('0x65')]);_0x458ca1++){if(_0x568274['min_internal']<=_0x4fac34[_0x458ca1]['from']){_0xc88230[_0xa00e('0x65')]=_0x4fac34[_0x458ca1][_0xa00e('0x6c')];}else if(_0x568274[_0xa00e('0x67')]>_0x4fac34[_0x458ca1][_0xa00e('0x6c')]&&_0x568274[_0xa00e('0x67')]<=_0x4fac34[_0x458ca1]['to']){_0xc88230[_0xa00e('0x65')]=_0x568274[_0xa00e('0x67')];}}}if(_['isNil'](_0xc88230[_0xa00e('0x65')])){_0xc88230[_0xa00e('0x65')]=_0x18516e+0x1;}return _0x4ed8e6(_0xc88230);});});})[_0xa00e('0x51')](function(_0x51c8cc){_0x6de675(_0x51c8cc);});});}function updateUser(_0x583c63){return new BPromise(function(_0x52b9ab,_0x48e352){try{if(_0x583c63[_0xa00e('0x6d')]){_0x583c63[_0xa00e('0x6e')]=_0x583c63[_0xa00e('0x65')];_0x583c63[_0xa00e('0x6f')]={'mailbox':_0x583c63['internal'],'password':_0x583c63[_0xa00e('0x3e')],'fullname':_0x583c63[_0xa00e('0x70')],'email':_0x583c63[_0xa00e('0x71')]};}if(_0x583c63[_0xa00e('0x31')]===_0xa00e('0x2a')){if(!_0x583c63['permissions'])_0x583c63[_0xa00e('0x72')]=[_0xa00e('0x73'),'102',_0xa00e('0x74'),_0xa00e('0x75'),'110',_0xa00e('0x76'),_0xa00e('0x77'),_0xa00e('0x78'),_0xa00e('0x79'),_0xa00e('0x7a'),_0xa00e('0x7b'),_0xa00e('0x7c'),_0xa00e('0x7d'),'114',_0xa00e('0x7e')];}_0x52b9ab(_0x583c63);}catch(_0x55df19){_0x48e352(_0x55df19);}});}exports[_0xa00e('0x7f')]=function(_0x3123ba,_0x2c4a61){if(_0x3123ba['user'][_0xa00e('0x31')]==='agent')throw new Error('Unauthorized');if(_0x3123ba[_0xa00e('0x5f')][_0xa00e('0x31')]===_0xa00e('0x28')&&_0x3123ba[_0xa00e('0x28')][_0xa00e('0x31')]!==_0xa00e('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3123ba[_0xa00e('0x5f')][_0xa00e('0x31')]==='admin'&&_0x3123ba[_0xa00e('0x28')][_0xa00e('0x31')]!==_0xa00e('0x27')){throw new Error(_0xa00e('0x80'));}return licenseUtil[_0xa00e('0x81')]([_0x3123ba[_0xa00e('0x5f')]])[_0xa00e('0x12')](function(){return validateUser(_0x3123ba[_0xa00e('0x5f')]);})[_0xa00e('0x12')](function(_0x218ef9){return updateUser(_0x218ef9)[_0xa00e('0x12')](function(_0x2d9620){if(_0x2d9620['role']===_0xa00e('0x27')){_0x2d9620[_0xa00e('0x82')]=_0x3123ba['user']['settingsEnabled'];delete _0x2d9620['userProfileId'];}return _0x2d9620;});})[_0xa00e('0x12')](function(_0x4922c9){return db[_0xa00e('0x38')]['create'](_0x4922c9,{'include':[{'model':db[_0xa00e('0x6f')],'as':_0xa00e('0x6f')}]});})['then'](function(_0x3ecbc8){if(_0x3123ba['body'][_0xa00e('0x31')]===_0xa00e('0x28'))return _0x3ecbc8;if(_0x3123ba[_0xa00e('0x28')]['role']!=='user')return _0x3ecbc8;return db[_0xa00e('0x83')][_0xa00e('0x32')]({'where':{'name':_0x3ecbc8[_0xa00e('0x31')]===_0xa00e('0x2a')?_0xa00e('0x29'):'Telephones','userProfileId':_0x3123ba[_0xa00e('0x28')][_0xa00e('0x84')]},'raw':!![]})[_0xa00e('0x12')](function(_0x2d0a5f){if(!_0x2d0a5f||_0x2d0a5f[_0xa00e('0x85')]!=0x0)return _0x3ecbc8;return db['UserProfileResource'][_0xa00e('0x7f')]({'name':_0x3ecbc8[_0xa00e('0x33')],'resourceId':_0x3ecbc8['id'],'type':_0x2d0a5f[_0xa00e('0x33')],'sectionId':_0x2d0a5f['id']},{})[_0xa00e('0x12')](function(){return _0x3ecbc8;});})['catch'](function(_0x4c9ab3){logger[_0xa00e('0x18')](_0xa00e('0x86'),_0x4c9ab3);throw _0x4c9ab3;});})['then'](respondWithResult(_0x2c4a61,0xc9))['catch'](handleError(_0x2c4a61,null));};exports['bulkCreate']=function(_0x549187,_0x3460cf){var _0x3fc496=_0x549187[_0xa00e('0x5f')];var _0xa4936a=[];if(_0x549187['user'][_0xa00e('0x31')]===_0xa00e('0x2a'))throw new Error(_0xa00e('0x87'));if(_[_0xa00e('0x88')](_0x3fc496,[_0xa00e('0x31'),_0xa00e('0x28')])&&_0x549187[_0xa00e('0x28')][_0xa00e('0x31')]!==_0xa00e('0x27')){throw new Error(_0xa00e('0x89'));}if(_[_0xa00e('0x88')](_0x3fc496,[_0xa00e('0x31'),'admin'])&&_0x549187[_0xa00e('0x28')][_0xa00e('0x31')]!==_0xa00e('0x27')){throw new Error(_0xa00e('0x8a'));}return licenseUtil[_0xa00e('0x81')](_0x3fc496)[_0xa00e('0x12')](function(){return validateUser(_0x3fc496[0x0]);})[_0xa00e('0x12')](function(){for(var _0x3ee193=0x1;_0x3ee193<_0x3fc496[_0xa00e('0x57')];_0x3ee193++){var _0x4b278a=_0x3fc496[_0x3ee193-0x1][_0xa00e('0x65')];if(!_0x3fc496[_0x3ee193]['internal'])_0x3fc496[_0x3ee193][_0xa00e('0x65')]=_0x4b278a+0x1;_0xa4936a[_0xa00e('0x46')](validateUser(_0x3fc496[_0x3ee193]));}return BPromise[_0xa00e('0x50')](_0xa4936a);})[_0xa00e('0x12')](function(){_0xa4936a=[];for(var _0x4f3af0=0x0;_0x4f3af0<_0x3fc496[_0xa00e('0x57')];_0x4f3af0++){_0xa4936a[_0xa00e('0x46')](updateUser(_0x3fc496[_0x4f3af0]));}return BPromise[_0xa00e('0x50')](_0xa4936a);})['then'](function(){return BPromise[_0xa00e('0x8b')](_0x3fc496,function(_0x3c310c){return db[_0xa00e('0x38')][_0xa00e('0x7f')](_0x3c310c,{'include':[{'model':db[_0xa00e('0x6f')],'as':_0xa00e('0x6f')}]})[_0xa00e('0x12')](function(_0x2175be){_0x3c310c['id']=_0x2175be['id'];return _0x3c310c;});});})[_0xa00e('0x12')](function(_0x1d4863){if(_0x549187[_0xa00e('0x5f')]['role']===_0xa00e('0x28'))return _0x1d4863;if(_0x549187[_0xa00e('0x28')][_0xa00e('0x31')]!=='user')return _0x1d4863;var _0x3a2bb2=_[_0xa00e('0x88')](_0x1d4863,function(_0x58b420){return _0x58b420[_0xa00e('0x31')]===_0xa00e('0x2a')||_0x58b420['role']===_0xa00e('0x2c');});if(!_0x3a2bb2)return _0x1d4863;return db[_0xa00e('0x83')][_0xa00e('0x47')]({'where':{'name':{'$or':['Agents',_0xa00e('0x2b')]},'userProfileId':_0x549187[_0xa00e('0x28')][_0xa00e('0x84')]},'raw':!![]})[_0xa00e('0x12')](function(_0x5edd91){if(_[_0xa00e('0x8c')](_0x5edd91)||!_['some'](_0x5edd91,[_0xa00e('0x85'),0x0]))return _0x1d4863;_0xa4936a=[];var _0x156a6c=_(_0x5edd91)['map'](function(_0x40d4c6){if(_0x40d4c6[_0xa00e('0x85')]===0x1)return;return _0x40d4c6[_0xa00e('0x33')]==='Agents'?_0xa00e('0x2a'):_0xa00e('0x2c');})[_0xa00e('0x8d')]()[_0xa00e('0x2f')]();for(var _0x50eb95=0x0;_0x50eb95<_0x1d4863[_0xa00e('0x57')];_0x50eb95++){if(!_[_0xa00e('0x30')](_0x156a6c,_0x1d4863[_0x50eb95][_0xa00e('0x31')]))return;var _0x62a199=_0x1d4863[_0x50eb95]['role']===_0xa00e('0x2a')?'Agents':_0xa00e('0x2b');_0xa4936a[_0xa00e('0x46')](db[_0xa00e('0x34')]['create']({'name':_0x1d4863[_0x50eb95][_0xa00e('0x33')],'resourceId':_0x1d4863[_0x50eb95]['id'],'type':_0x62a199,'sectionId':_[_0xa00e('0x32')](_0x5edd91,[_0xa00e('0x33'),_0x62a199])['id']},{}));}return BPromise[_0xa00e('0x50')](_0xa4936a);});})[_0xa00e('0x12')](respondWithResult(_0x3460cf,0xc9))['catch'](handleError(_0x3460cf,null));};exports[_0xa00e('0x8e')]=function(_0x4e7ca6,_0x202042){if(_0x4e7ca6[_0xa00e('0x5f')]['id']){delete _0x4e7ca6[_0xa00e('0x5f')]['id'];}return db[_0xa00e('0x38')]['find']({'where':{'id':_0x4e7ca6['params']['id']}})[_0xa00e('0x12')](function(_0x298206){if(!_0x298206)return null;if(_0x298206['id']===_0x4e7ca6['user']['id']){if(!_0x4e7ca6[_0xa00e('0x5f')]['oldPassword']||!_0x4e7ca6['body'][_0xa00e('0x8f')]){throw new db[(_0xa00e('0x90'))][(_0xa00e('0x91'))](_0xa00e('0x92'));}if(!_0x298206[_0xa00e('0x93')](_0x4e7ca6[_0xa00e('0x5f')][_0xa00e('0x94')])){throw new db[(_0xa00e('0x90'))][(_0xa00e('0x91'))]('Wrong\x20credentials');}if(_0x4e7ca6[_0xa00e('0x5f')][_0xa00e('0x94')]===_0x4e7ca6[_0xa00e('0x5f')][_0xa00e('0x8f')]){throw new db[(_0xa00e('0x90'))][(_0xa00e('0x91'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x4e7ca6[_0xa00e('0x28')][_0xa00e('0x31')]===_0xa00e('0x27')){if(!_0x4e7ca6[_0xa00e('0x5f')][_0xa00e('0x8f')]){throw new db[(_0xa00e('0x90'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x4e7ca6[_0xa00e('0x28')][_0xa00e('0x31')]===_0xa00e('0x28')){if(!_0x4e7ca6[_0xa00e('0x5f')][_0xa00e('0x8f')]){throw new db['Sequelize'][(_0xa00e('0x91'))](_0xa00e('0x95'));}if(_0x298206[_0xa00e('0x31')]!==_0xa00e('0x2a')){throw new db[(_0xa00e('0x90'))]['ValidationError']('Unauthorized');}}else{throw new db[(_0xa00e('0x90'))][(_0xa00e('0x91'))](_0xa00e('0x87'));}return _0x298206;})[_0xa00e('0x12')](handleEntityNotFound(_0x202042,null))[_0xa00e('0x12')](function(_0x128193){return db['Setting'][_0xa00e('0x96')]({'attributes':['id',_0xa00e('0x62'),'enforcePasswordHistory',_0xa00e('0x97')]})[_0xa00e('0x12')](function(_0x1f00da){if(_0x1f00da['securePassword'])authService[_0xa00e('0x63')](_0x4e7ca6[_0xa00e('0x5f')]['newPassword']);if(!_0x1f00da[_0xa00e('0x98')]||!_0x128193[_0xa00e('0x99')])return _0x128193;authService[_0xa00e('0x9a')](_0x4e7ca6[_0xa00e('0x5f')][_0xa00e('0x8f')],_0x128193[_0xa00e('0x99')],_0x1f00da['passwordHistoryLimit']);return _0x128193;})[_0xa00e('0x12')](saveUpdates({'password':_0x4e7ca6['body'][_0xa00e('0x8f')],'passwordResetAt':_0x4e7ca6[_0xa00e('0x28')]['id']==_0x4e7ca6[_0xa00e('0x5c')]['id']?moment():null,'previousPasswords':authService[_0xa00e('0x9b')](_0x4e7ca6[_0xa00e('0x5f')][_0xa00e('0x8f')],_0x128193[_0xa00e('0x99')])},null));})[_0xa00e('0x12')](respondWithResult(_0x202042,null))['catch'](handleError(_0x202042,null));};exports[_0xa00e('0x9c')]=function(_0x20cbad,_0x443e54){var _0x37e84d=_0x20cbad[_0xa00e('0x5f')][_0xa00e('0x9d')];return db[_0xa00e('0x38')]['find']({'where':{'id':_0x20cbad[_0xa00e('0x5c')]['id']},'attributes':['id',_0xa00e('0x33'),'role',_0xa00e('0x9e'),_0xa00e('0x9f'),_0xa00e('0xa0'),_0xa00e('0xa1')]})[_0xa00e('0x12')](handleEntityNotFound(_0x443e54,null))[_0xa00e('0x12')](function(_0x462dc6){if(_0x462dc6){if(!utils['isValidChannel'](_0x37e84d)){throw new db[(_0xa00e('0x90'))][(_0xa00e('0x91'))]('Unknown\x20channel');}return _0x462dc6[_0xa00e('0xa2')+_[_0xa00e('0xa3')](_0x37e84d[_0xa00e('0xa4')]())+_0xa00e('0xa5')](_0x20cbad[_0xa00e('0x5f')]['ids'],{'penalty':_0x20cbad[_0xa00e('0x5f')][_0xa00e('0xa6')]||0x0})['spread'](function(_0x1dd48a){for(var _0x7e0c13=0x0;_0x7e0c13<_0x20cbad[_0xa00e('0x5f')][_0xa00e('0x60')][_0xa00e('0x57')];_0x7e0c13+=0x1){var _0x4e7216={'UserId':Number(_0x20cbad[_0xa00e('0x5c')]['id'])};_0x4e7216[_['capitalize'](_0x37e84d[_0xa00e('0xa4')]())+_0xa00e('0xa7')]=Number(_0x20cbad['body']['ids'][_0x7e0c13]);socket[_0xa00e('0xa8')](_0xa00e('0x28')+_['capitalize'](_0x37e84d[_0xa00e('0xa4')]())+_0xa00e('0xa9'),_0x4e7216);}return _0x1dd48a;})[_0xa00e('0x12')](function(){if(_0x37e84d===_0xa00e('0xaa')){return db[_0xa00e('0xab')][_0xa00e('0x47')]({'where':{'id':_0x20cbad[_0xa00e('0x5f')][_0xa00e('0x60')]||[]},'raw':!![],'attributes':['id',_0xa00e('0x33')]});}})[_0xa00e('0x12')](function(_0x2ddc84){var _0x1be18d=_0x462dc6[_0xa00e('0x26')]({'plain':!![]});var _0x511002=[];if(_0x37e84d===_0xa00e('0xaa')&&_0x1be18d[_0xa00e('0x31')]===_0xa00e('0x2a')&&_0x1be18d['online']){for(var _0xdb2b66=0x0;_0xdb2b66<_0x2ddc84['length'];_0xdb2b66+=0x1){_0x511002[_0xa00e('0x46')]({'membername':_0x1be18d[_0xa00e('0x33')],'UserId':_0x1be18d['id'],'queue_name':_0x2ddc84[_0xdb2b66][_0xa00e('0x33')],'VoiceQueueId':_0x2ddc84[_0xdb2b66]['id'],'interface':_[_0xa00e('0x66')](_0x1be18d['interface'])?util[_0xa00e('0xac')]('SIP/%s',_0x1be18d[_0xa00e('0x33')]):_0x1be18d[_0xa00e('0xa1')],'paused':_0x1be18d['voicePause']||![],'penalty':_0x20cbad['body'][_0xa00e('0xa6')]||0x0});}return BPromise['each'](_0x511002,function(_0x20eef0){return db[_0xa00e('0xad')][_0xa00e('0xae')](_0x20eef0);});}return _0x462dc6;});}})[_0xa00e('0x12')](respondWithStatusCode(_0x443e54,null))[_0xa00e('0x51')](handleError(_0x443e54,null));};exports['removeQueues']=function(_0x172ad8,_0x5531ac){var _0xe07584;return db['User'][_0xa00e('0x32')]({'where':{'id':_0x172ad8[_0xa00e('0x5c')]['id']},'attributes':['id',_0xa00e('0x33'),_0xa00e('0x31')]})[_0xa00e('0x12')](handleEntityNotFound(_0x5531ac,null))['then'](function(_0x27b347){if(_0x27b347){_0xe07584=_0x27b347;if(!_0x172ad8['query'][_0xa00e('0x9d')]||!utils['isValidChannel'](_0x172ad8['query'][_0xa00e('0x9d')])){throw new db[(_0xa00e('0x90'))][(_0xa00e('0x91'))]('Unknown\x20channel');}return _0x27b347['remove'+_[_0xa00e('0xa3')](_0x172ad8[_0xa00e('0x42')]['channel'][_0xa00e('0xa4')]())+_0xa00e('0xa5')](_0x172ad8[_0xa00e('0x42')][_0xa00e('0x60')]);}})[_0xa00e('0x12')](function(_0x1e134b){if(_[_0xa00e('0xaf')](_0x172ad8[_0xa00e('0x42')][_0xa00e('0x60')])){for(var _0x413574=0x0;_0x413574<_0x172ad8[_0xa00e('0x42')]['ids'][_0xa00e('0x57')];_0x413574+=0x1){var _0x48cda6={'UserId':Number(_0x172ad8[_0xa00e('0x5c')]['id'])};_0x48cda6[_['capitalize'](_0x172ad8[_0xa00e('0x42')][_0xa00e('0x9d')]['toLowerCase']())+_0xa00e('0xa7')]=Number(_0x172ad8['query'][_0xa00e('0x60')][_0x413574]);socket[_0xa00e('0xa8')]('user'+_[_0xa00e('0xa3')](_0x172ad8[_0xa00e('0x42')]['channel'][_0xa00e('0xa4')]())+'Queue:remove',_0x48cda6);}}else{var _0x48cda6={'UserId':Number(_0x172ad8['params']['id'])};_0x48cda6[_[_0xa00e('0xa3')](_0x172ad8[_0xa00e('0x42')][_0xa00e('0x9d')]['toLowerCase']())+_0xa00e('0xa7')]=Number(_0x172ad8[_0xa00e('0x42')]['ids']);socket[_0xa00e('0xa8')](_0xa00e('0x28')+_[_0xa00e('0xa3')](_0x172ad8[_0xa00e('0x42')][_0xa00e('0x9d')]['toLowerCase']())+'Queue:remove',_0x48cda6);}return _0x1e134b;})[_0xa00e('0x12')](function(){if(_0x172ad8[_0xa00e('0x42')][_0xa00e('0x9d')]===_0xa00e('0xaa')){return db[_0xa00e('0xad')][_0xa00e('0x25')]({'where':{'UserId':_0x172ad8[_0xa00e('0x5c')]['id'],'VoiceQueueId':_0x172ad8[_0xa00e('0x42')]['ids']},'individualHooks':!![]})[_0xa00e('0x12')](function(){return _0xe07584;});}return _0xe07584;})[_0xa00e('0x12')](respondWithStatusCode(_0x5531ac,null))['catch'](handleError(_0x5531ac,null));};exports[_0xa00e('0xb0')]=function(_0x27f999,_0x4c1b24){_0x27f999[_0xa00e('0x5f')][_0xa00e('0xb1')]=_0x27f999[_0xa00e('0xb2')]['filename'];return db[_0xa00e('0x38')][_0xa00e('0x32')]({'where':{'id':_0x27f999['params']['id']}})['then'](handleEntityNotFound(_0x4c1b24,null))[_0xa00e('0x12')](saveUpdates(_0x27f999[_0xa00e('0x5f')],null))[_0xa00e('0x12')](respondWithResult(_0x4c1b24,null))[_0xa00e('0x51')](handleError(_0x4c1b24,null));};exports[_0xa00e('0xb3')]=function(_0x337d41,_0x4c8b69){var _0x563843=path[_0xa00e('0xb4')](config[_0xa00e('0xb5')],_0xa00e('0xb6'));return db[_0xa00e('0x38')]['find']({'where':{'id':_0x337d41['params']['id']},'attributes':['id',_0xa00e('0xb1')],'raw':!![]})[_0xa00e('0x12')](handleEntityNotFound(_0x4c8b69,null))[_0xa00e('0x12')](function(_0xf3ef6d){if(_0xf3ef6d){if(_[_0xa00e('0x66')](_0xf3ef6d['userpic'])){return _0x4c8b69['download'](_0x563843);}else{if(!fs[_0xa00e('0xb7')](path[_0xa00e('0xb4')](config[_0xa00e('0xb5')],_0xa00e('0xb8'),_0xf3ef6d[_0xa00e('0xb1')]))){return _0x4c8b69[_0xa00e('0xb9')](_0x563843);}return _0x4c8b69['download'](path[_0xa00e('0xb4')](config['root'],_0xa00e('0xb8'),_0xf3ef6d[_0xa00e('0xb1')]));}}})[_0xa00e('0x51')](handleError(_0x4c8b69,null));};exports['getOpenTabs']=function(_0x556115,_0x32fe02){return db[_0xa00e('0x38')][_0xa00e('0x32')]({'where':{'id':_0x556115[_0xa00e('0x5c')]['id']},'attributes':['id']})[_0xa00e('0x12')](handleEntityNotFound(_0x32fe02,null))[_0xa00e('0x12')](function(_0x348090){var _0x26d5f1=[];values=_0x348090[_0xa00e('0x4d')];_0x26d5f1[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x5a'),_0x348090[_0xa00e('0x4d')]));_0x26d5f1[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4b'),_0x348090['dataValues']));_0x26d5f1['push'](get_open_tabs('openchannel',_0x348090[_0xa00e('0x4d')]));_0x26d5f1[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4f'),_0x348090[_0xa00e('0x4d')]));_0x26d5f1[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x4c'),_0x348090[_0xa00e('0x4d')]));_0x26d5f1[_0xa00e('0x46')](get_open_tabs(_0xa00e('0x5b'),_0x348090[_0xa00e('0x4d')]));return BPromise['all'](_0x26d5f1);})[_0xa00e('0x12')](function(_0x24c758){var _0x25e781=[];if(_0x24c758){for(var _0x101e0d=0x0;_0x101e0d=_0x59cce5['agents']){throw new Error(_0x5799('0x55'));}})[_0x5799('0xf')](function(){if(_0x36325b){return db[_0x5799('0x2b')][_0x5799('0x4b')]({'where':{'membername':_0x36325b[_0x5799('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x36325b){return _0x36325b[_0x5799('0x56')]({'raw':!![]});}})[_0x5799('0xf')](function(_0x513247){if(_0x36325b){if(_0x513247){var _0x2939a7=[];_0x150913=_0x513247;if(_0x150913[_0x5799('0x2f')]){for(var _0x2f31cc=0x0;_0x2f31cc<_0x150913[_0x5799('0x2f')];_0x2f31cc++){_0x2939a7['push'](db[_0x5799('0x2b')]['upsert']({'membername':_0x36325b[_0x5799('0x28')],'UserId':_0x36325b['id'],'queue_name':_0x150913[_0x2f31cc]['name'],'VoiceQueueId':_0x150913[_0x2f31cc]['id'],'interface':_0x257d33,'paused':_0x36325b[_0x5799('0x4e')]||![],'penalty':_0x150913[_0x2f31cc][_0x5799('0x57')]||0x0}));}return BPromise[_0x5799('0x48')](_0x2939a7);}}}})[_0x5799('0xf')](function(){if(_0x36325b){return db[_0x5799('0x2d')][_0x5799('0x1a')]({'where':{'membername':_0x36325b[_0x5799('0x28')],'exitAt':null}});}})[_0x5799('0xf')](function(_0x322142){if(_0x36325b){if(_0x322142&&_0x322142[_0x5799('0x2f')]){var _0x14bd3b=[];_0x322142[_0x5799('0x47')](function(_0x2c9c64){_0x14bd3b[_0x5799('0x32')](_0x2c9c64[_0x5799('0x2c')]({'exitAt':moment()[_0x5799('0x34')](_0x5799('0x30'))}));});return BPromise[_0x5799('0x48')](_0x14bd3b);}}})[_0x5799('0xf')](function(_0x2cc5f0){if(_0x36325b){var _0x3ed9b1=[];var _0x42e3f3=[];var _0x748819=utils['getChannels']();var _0x33b65a={'membername':_0x36325b[_0x5799('0x28')],'interface':_0x257d33,'enterAt':moment()[_0x5799('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x36325b['role'],'internal':_0x36325b[_0x5799('0x29')]};_0x748819['forEach'](function(_0x585ce8){_0x3ed9b1[_0x5799('0x32')](_['merge']({'channel':_0x585ce8,'type':_0x5799('0x58'),'data1':_0x5799('0x59'),'data2':_0x257d33},_0x33b65a));if(_0x36325b[_0x5799('0x4e')]){_0x42e3f3['push'](_['merge']({'channel':_0x585ce8,'type':'PAUSE','data1':_0x5799('0x5a')},_0x33b65a));}});return db[_0x5799('0x2d')]['bulkCreate'](_0x3ed9b1['concat'](_0x42e3f3),{'individualHooks':!![]});}})[_0x5799('0xf')](function(){if(_0x36325b){return _0x36325b[_0x5799('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x5799('0x34')](_0x5799('0x30')),'voicePause':_0x36325b[_0x5799('0x4e')]||![],'mailPause':_0x36325b['loginInPause']||![],'chatPause':_0x36325b['loginInPause']||![],'faxPause':_0x36325b[_0x5799('0x4e')]||![],'smsPause':_0x36325b['loginInPause']||![],'openchannelPause':_0x36325b[_0x5799('0x4e')]||![],'pauseType':_0x36325b[_0x5799('0x4e')]?_0x5799('0x5a'):null,'lastPauseAt':moment()[_0x5799('0x34')](_0x5799('0x30')),'interface':_0x257d33});}})[_0x5799('0xf')](function(_0x2c183e){_0x461b46(_0x2c183e);})[_0x5799('0x24')](function(_0x6bea21){_0x3b7f01(_0x30763b[_0x5799('0x15')](0x1f4,_0x6bea21[_0x5799('0x17')]));});});}; \ No newline at end of file +var _0x29b0=['mail','fax','sms','openchannel','whatsapp','set','Pause','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','LOGININPAUSE','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetUser','User','findAll','options','limit','include','map','model','attributes','catch','raw','where','ShowUser','find','name','role','internal','interface','UserVoiceQueueRt','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','SIP/%s','body','type','DEFAULT\x20PAUSE','bulkCreate','update','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','system'];(function(_0x25f96c,_0x223a95){var _0x17fe0a=function(_0x16c138){while(--_0x16c138){_0x25f96c['push'](_0x25f96c['shift']());}};_0x17fe0a(++_0x223a95);}(_0x29b0,0x137));var _0x029b=function(_0x47bfb7,_0x676d53){_0x47bfb7=_0x47bfb7-0x0;var _0x25daa9=_0x29b0[_0x47bfb7];return _0x25daa9;};'use strict';var _=require(_0x029b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x029b('0x1'));var rs=require(_0x029b('0x2'));var fs=require('fs');var Redis=require(_0x029b('0x3'));var db=require(_0x029b('0x4'))['db'];var utils=require(_0x029b('0x5'));var logger=require(_0x029b('0x6'))(_0x029b('0x7'));var config=require(_0x029b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x029b('0x9')]({'port':0x232a});config[_0x029b('0xa')]=_[_0x029b('0xb')](config['redis'],{'host':_0x029b('0xc'),'port':0x18eb});var socket=require(_0x029b('0xd'))(new Redis(config['redis']));require(_0x029b('0xe'))[_0x029b('0xf')](socket);function respondWithRpcPromise(_0x3dd629,_0x45122c,_0x20ab24){return new BPromise(function(_0x4ed45d,_0xf92d0a){return client[_0x029b('0x10')](_0x3dd629,_0x20ab24)[_0x029b('0x11')](function(_0x30fcf7){logger[_0x029b('0x12')](_0x029b('0x13'),_0x45122c,_0x029b('0x14'));logger[_0x029b('0x15')](_0x029b('0x16'),_0x45122c,'request\x20sent',JSON[_0x029b('0x17')](_0x30fcf7));if(_0x30fcf7[_0x029b('0x18')]){if(_0x30fcf7[_0x029b('0x18')][_0x029b('0x19')]===0x1f4){logger[_0x029b('0x18')](_0x029b('0x13'),_0x45122c,_0x30fcf7[_0x029b('0x18')]['message']);return _0xf92d0a(_0x30fcf7[_0x029b('0x18')][_0x029b('0x1a')]);}logger[_0x029b('0x18')](_0x029b('0x13'),_0x45122c,_0x30fcf7[_0x029b('0x18')][_0x029b('0x1a')]);return _0x4ed45d(_0x30fcf7[_0x029b('0x18')]['message']);}else{logger['info'](_0x029b('0x13'),_0x45122c,_0x029b('0x14'));_0x4ed45d(_0x30fcf7[_0x029b('0x1b')][_0x029b('0x1a')]);}})['catch'](function(_0x5b77e1){logger[_0x029b('0x18')](_0x029b('0x13'),_0x45122c,_0x5b77e1);_0xf92d0a(_0x5b77e1);});});}exports[_0x029b('0x1c')]=function(_0x3e19e8){var _0x1b2b9e=this;return new Promise(function(_0x36a752,_0x248bc5){return db[_0x029b('0x1d')][_0x029b('0x1e')]({'raw':_0x3e19e8['options']?_0x3e19e8[_0x029b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3e19e8[_0x029b('0x1f')]?_0x3e19e8[_0x029b('0x1f')]['where']||null:null,'attributes':_0x3e19e8['options']?_0x3e19e8[_0x029b('0x1f')]['attributes']||null:null,'limit':_0x3e19e8[_0x029b('0x1f')]?_0x3e19e8[_0x029b('0x1f')][_0x029b('0x20')]||null:null,'include':_0x3e19e8['options']?_0x3e19e8[_0x029b('0x1f')][_0x029b('0x21')]?_[_0x029b('0x22')](_0x3e19e8[_0x029b('0x1f')][_0x029b('0x21')],function(_0x41d251){return{'model':db[_0x41d251[_0x029b('0x23')]],'as':_0x41d251['as'],'attributes':_0x41d251['attributes'],'include':_0x41d251[_0x029b('0x21')]?_[_0x029b('0x22')](_0x41d251[_0x029b('0x21')],function(_0x5e2003){return{'model':db[_0x5e2003[_0x029b('0x23')]],'as':_0x5e2003['as'],'attributes':_0x5e2003[_0x029b('0x24')],'include':_0x5e2003[_0x029b('0x21')]?_['map'](_0x5e2003[_0x029b('0x21')],function(_0x312ba5){return{'model':db[_0x312ba5['model']],'as':_0x312ba5['as'],'attributes':_0x312ba5[_0x029b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x029b('0x11')](function(_0x24c14b){logger[_0x029b('0x12')](_0x029b('0x1c'),_0x3e19e8);logger[_0x029b('0x15')]('GetUser',_0x3e19e8,JSON[_0x029b('0x17')](_0x24c14b));_0x36a752(_0x24c14b);})[_0x029b('0x25')](function(_0x41f1fd){logger[_0x029b('0x18')](_0x029b('0x1c'),_0x41f1fd['message'],_0x3e19e8);_0x248bc5(_0x1b2b9e[_0x029b('0x18')](0x1f4,_0x41f1fd[_0x029b('0x1a')]));});});};exports['ShowUser']=function(_0x55efe0){var _0x5e17bb=this;return new Promise(function(_0x44c4cb,_0xcc4084){return db[_0x029b('0x1d')]['find']({'raw':_0x55efe0[_0x029b('0x1f')]?_0x55efe0[_0x029b('0x1f')][_0x029b('0x26')]===undefined?!![]:![]:!![],'where':_0x55efe0[_0x029b('0x1f')]?_0x55efe0['options'][_0x029b('0x27')]||null:null,'attributes':_0x55efe0['options']?_0x55efe0[_0x029b('0x1f')][_0x029b('0x24')]||null:null,'include':_0x55efe0[_0x029b('0x1f')]?_0x55efe0[_0x029b('0x1f')][_0x029b('0x21')]?_['map'](_0x55efe0[_0x029b('0x1f')][_0x029b('0x21')],function(_0x439412){return{'model':db[_0x439412[_0x029b('0x23')]],'as':_0x439412['as'],'attributes':_0x439412[_0x029b('0x24')],'include':_0x439412[_0x029b('0x21')]?_[_0x029b('0x22')](_0x439412[_0x029b('0x21')],function(_0x5bf3bf){return{'model':db[_0x5bf3bf[_0x029b('0x23')]],'as':_0x5bf3bf['as'],'attributes':_0x5bf3bf[_0x029b('0x24')],'include':_0x5bf3bf[_0x029b('0x21')]?_[_0x029b('0x22')](_0x5bf3bf[_0x029b('0x21')],function(_0x503366){return{'model':db[_0x503366[_0x029b('0x23')]],'as':_0x503366['as'],'attributes':_0x503366[_0x029b('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x226a09){logger['info'](_0x029b('0x28'),_0x55efe0);logger[_0x029b('0x15')]('ShowUser',_0x55efe0,JSON[_0x029b('0x17')](_0x226a09));_0x44c4cb(_0x226a09);})[_0x029b('0x25')](function(_0x1ed056){logger[_0x029b('0x18')](_0x029b('0x28'),_0x1ed056[_0x029b('0x1a')],_0x55efe0);_0xcc4084(_0x5e17bb[_0x029b('0x18')](0x1f4,_0x1ed056[_0x029b('0x1a')]));});});};exports['PauseUser']=function(_0x4013ef){var _0x34b151=this;return new Promise(function(_0x215e4b,_0x40471d){var _0x27a8ff;return db[_0x029b('0x1d')][_0x029b('0x29')]({'where':_0x4013ef[_0x029b('0x1f')]['where']||{},'attributes':['id',_0x029b('0x2a'),_0x029b('0x2b'),_0x029b('0x2c'),_0x029b('0x2d')]})['then'](function(_0x1bf1b3){if(_0x1bf1b3){_0x27a8ff=_0x1bf1b3;return db[_0x029b('0x2e')]['update']({'paused':0x1},{'where':{'UserId':_0x27a8ff['id']},'individualHooks':!![]});}})[_0x029b('0x11')](function(){if(_0x27a8ff){return db[_0x029b('0x2f')]['findAll']({'where':{'membername':_0x27a8ff[_0x029b('0x2a')],'type':_0x029b('0x30'),'exitAt':null}});}})[_0x029b('0x11')](function(_0x3f0291){if(_0x27a8ff){if(_0x3f0291&&_0x3f0291[_0x029b('0x31')]){var _0x69f77b=moment()[_0x029b('0x32')](_0x029b('0x33'));for(var _0x4ebcaa=0x0,_0x19f6a1=_0x3f0291['length'];_0x4ebcaa<_0x19f6a1;_0x4ebcaa++){_0x3f0291[_0x4ebcaa][_0x029b('0x34')]({'exitAt':_0x69f77b});}}}})[_0x029b('0x11')](function(){if(_0x27a8ff){var _0x49f666=[];var _0x54b9dd=utils[_0x029b('0x35')]();_0x54b9dd[_0x029b('0x36')](function(_0xdb7010){_0x49f666[_0x029b('0x37')]({'channel':_0xdb7010,'membername':_0x27a8ff[_0x029b('0x2a')],'interface':_['isNil'](_0x27a8ff[_0x029b('0x2d')])?util['format'](_0x029b('0x38'),_0x27a8ff['name']):_0x27a8ff[_0x029b('0x2d')],'type':_0x029b('0x30'),'enterAt':moment()[_0x029b('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4013ef[_0x029b('0x39')][_0x029b('0x3a')]||_0x029b('0x3b'),'role':_0x27a8ff[_0x029b('0x2b')],'internal':_0x27a8ff[_0x029b('0x2c')],'uniqueid':_0x4013ef[_0x029b('0x39')]['uniqueid']||null});});return db[_0x029b('0x2f')][_0x029b('0x3c')](_0x49f666,{'individualHooks':!![]});}})[_0x029b('0x11')](function(){if(_0x27a8ff){return _0x27a8ff[_0x029b('0x3d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4013ef[_0x029b('0x39')]['type']||_0x029b('0x3b'),'lastPauseAt':moment()[_0x029b('0x32')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x029b('0x11')](function(_0x231efc){_0x215e4b(_0x231efc);})[_0x029b('0x25')](function(_0x5847ec){_0x40471d(_0x34b151['error'](0x1f4,_0x5847ec[_0x029b('0x1a')]));});});};exports[_0x029b('0x3e')]=function(_0xf33be3){var _0x39303f=this;return new Promise(function(_0x4f50f9,_0x48f684){var _0x5c25f5;return db['User'][_0x029b('0x3f')]({'where':_0xf33be3[_0x029b('0x1f')]['where']||{},'attributes':['id',_0x029b('0x2a')]})[_0x029b('0x11')](function(_0x43b3fc){if(_0x43b3fc){_0x5c25f5=_0x43b3fc;if(_0xf33be3[_0x029b('0x39')][_0x029b('0x40')]&&!utils[_0x029b('0x41')](_0xf33be3['body'][_0x029b('0x40')])){throw new Error(_0x029b('0x42'));}switch(_0xf33be3['body'][_0x029b('0x40')]){case _0x029b('0x43'):return db[_0x029b('0x2e')][_0x029b('0x3d')]({'paused':0x0},{'where':{'UserId':_0x5c25f5['id']}})[_0x029b('0x11')](function(){return db[_0x029b('0x2f')][_0x029b('0x29')]({'where':{'channel':_0xf33be3[_0x029b('0x39')][_0x029b('0x40')],'membername':_0x5c25f5['name'],'type':_0x029b('0x30'),'exitAt':null}});})[_0x029b('0x11')](function(_0x42a9fb){if(_0x42a9fb){return _0x42a9fb['update']({'exitAt':moment()['format'](_0x029b('0x33')),'data2':_0x029b('0x44')},{'individualHooks':!![]});}return null;})[_0x029b('0x11')](function(){return _0x5c25f5[_0x029b('0x3d')]({'voicePause':![]});});case _0x029b('0x45'):case'chat':case _0x029b('0x46'):case _0x029b('0x47'):case _0x029b('0x48'):case _0x029b('0x49'):return db['MemberReport']['find']({'where':{'channel':_0xf33be3[_0x029b('0x39')]['channel'],'membername':_0x5c25f5[_0x029b('0x2a')],'type':'PAUSE','exitAt':null}})[_0x029b('0x11')](function(_0x1919fb){return _0x1919fb[_0x029b('0x3d')]({'exitAt':moment()[_0x029b('0x32')](_0x029b('0x33')),'data2':_0x029b('0x44')},{'individualHooks':!![]});})[_0x029b('0x11')](function(){var _0x134cb3={};_[_0x029b('0x4a')](_0x134cb3,util[_0x029b('0x32')]('%s%s',_0xf33be3[_0x029b('0x39')]['channel'],_0x029b('0x4b')),![]);return _0x5c25f5[_0x029b('0x3d')](_0x134cb3);});default:return db[_0x029b('0x2e')][_0x029b('0x3d')]({'paused':0x0},{'where':{'UserId':_0x5c25f5['id']}})['then'](function(){return db[_0x029b('0x2f')][_0x029b('0x1e')]({'where':{'membername':_0x5c25f5['name'],'type':_0x029b('0x30'),'exitAt':null}});})['then'](function(_0x1baeb1){var _0x1f04a1=[];_0x1baeb1[_0x029b('0x36')](function(_0x573e0d){_0x1f04a1[_0x029b('0x37')](_0x573e0d['update']({'exitAt':moment()[_0x029b('0x32')](_0x029b('0x33')),'data2':_0x029b('0x44')}));});return BPromise['all'](_0x1f04a1);})['then'](function(){return _0x5c25f5['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x029b('0x11')](function(_0x926137){_0x4f50f9(_0x926137);})[_0x029b('0x25')](function(_0x263e39){_0x48f684(_0x39303f[_0x029b('0x18')](0x1f4,_0x263e39[_0x029b('0x1a')]));});});};exports['LogoutUser']=function(_0x32d475){var _0x4a2089=this;return new Promise(function(_0x1d9eca,_0xca9698){var _0x63a499;return db[_0x029b('0x1d')][_0x029b('0x3f')]({'where':_0x32d475[_0x029b('0x1f')][_0x029b('0x27')]||{},'attributes':['id',_0x029b('0x2a')]})[_0x029b('0x11')](function(_0x134051){if(_0x134051){_0x63a499=_0x134051;return db[_0x029b('0x2e')][_0x029b('0x4c')]({'where':{'membername':_0x63a499[_0x029b('0x2a')]},'individualHooks':!![]});}})[_0x029b('0x11')](function(){if(_0x63a499){return db[_0x029b('0x2f')][_0x029b('0x1e')]({'where':{'membername':_0x63a499[_0x029b('0x2a')],'exitAt':null}});}})['then'](function(_0x241ef5){if(_0x63a499){if(_0x241ef5&&_0x241ef5[_0x029b('0x31')]){var _0x10b3f1=[];_0x241ef5[_0x029b('0x36')](function(_0xc92dd9){_0x10b3f1[_0x029b('0x37')](_0xc92dd9[_0x029b('0x3d')]({'exitAt':moment()[_0x029b('0x32')](_0x029b('0x33'))}));});return BPromise['all'](_0x10b3f1);}}})['then'](function(){if(_0x63a499){return _0x63a499[_0x029b('0x3d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x029b('0x11')](function(_0x1ac5cd){_0x1d9eca(_0x1ac5cd);})[_0x029b('0x25')](function(_0x51a315){_0xca9698(_0x4a2089[_0x029b('0x18')](0x1f4,_0x51a315[_0x029b('0x1a')]));});});};exports[_0x029b('0x4d')]=function(_0x2efee8){var _0x202c1f=this;return new Promise(function(_0x5dad85,_0x2d51d4){var _0x3505c6;var _0x1cb4d9;var _0x32713a;var _0x43b0bd;return db[_0x029b('0x1d')][_0x029b('0x3f')]({'where':_0x2efee8[_0x029b('0x1f')]['where']||{},'attributes':['id',_0x029b('0x2a'),_0x029b('0x2b'),_0x029b('0x4e'),_0x029b('0x4f'),_0x029b('0x2c'),_0x029b('0x50'),_0x029b('0x2d')]})[_0x029b('0x11')](function(_0x548bdf){if(_0x548bdf){_0x3505c6=_0x548bdf;_0x43b0bd=_0x2efee8[_0x029b('0x39')][_0x029b('0x2d')]?_0x2efee8[_0x029b('0x39')][_0x029b('0x2d')]:util['format']('SIP/%s',_0x3505c6[_0x029b('0x2a')]);return db['User'][_0x029b('0x51')]({'where':{'role':_0x029b('0x52'),'online':!![],'id':{'$ne':_0x3505c6['id']}}});}})[_0x029b('0x11')](function(_0x520f61){if(_0x520f61){_0x32713a=_0x520f61;return require(_0x029b('0x53'))[_0x029b('0x54')]();}})[_0x029b('0x11')](function(_0x296cf6){if(_0x296cf6&&_0x296cf6[_0x029b('0x55')]&&_0x32713a>=_0x296cf6[_0x029b('0x55')]){throw new Error(_0x029b('0x56'));}})[_0x029b('0x11')](function(){if(_0x3505c6){return db[_0x029b('0x2e')][_0x029b('0x4c')]({'where':{'membername':_0x3505c6[_0x029b('0x2a')]},'individualHooks':!![]});}})[_0x029b('0x11')](function(){if(_0x3505c6){return _0x3505c6[_0x029b('0x57')]({'raw':!![]});}})[_0x029b('0x11')](function(_0x20e0a5){if(_0x3505c6){if(_0x20e0a5){var _0x3124f6=[];_0x1cb4d9=_0x20e0a5;if(_0x1cb4d9[_0x029b('0x31')]){for(var _0x5efb95=0x0;_0x5efb95<_0x1cb4d9[_0x029b('0x31')];_0x5efb95++){_0x3124f6[_0x029b('0x37')](db['UserVoiceQueueRt'][_0x029b('0x58')]({'membername':_0x3505c6[_0x029b('0x2a')],'UserId':_0x3505c6['id'],'queue_name':_0x1cb4d9[_0x5efb95]['name'],'VoiceQueueId':_0x1cb4d9[_0x5efb95]['id'],'interface':_0x43b0bd,'paused':_0x3505c6['loginInPause']||![],'penalty':_0x1cb4d9[_0x5efb95][_0x029b('0x59')]||0x0}));}return BPromise[_0x029b('0x5a')](_0x3124f6);}}}})['then'](function(){if(_0x3505c6){return db[_0x029b('0x2f')][_0x029b('0x1e')]({'where':{'membername':_0x3505c6[_0x029b('0x2a')],'exitAt':null}});}})[_0x029b('0x11')](function(_0xdf7791){if(_0x3505c6){if(_0xdf7791&&_0xdf7791['length']){var _0x1120e3=[];_0xdf7791[_0x029b('0x36')](function(_0x31b176){_0x1120e3[_0x029b('0x37')](_0x31b176[_0x029b('0x3d')]({'exitAt':moment()[_0x029b('0x32')](_0x029b('0x33'))}));});return BPromise['all'](_0x1120e3);}}})[_0x029b('0x11')](function(_0x43339e){if(_0x3505c6){var _0x67ecd2=[];var _0x4eb010=[];var _0x5d7514=utils[_0x029b('0x35')]();var _0x51af57={'membername':_0x3505c6[_0x029b('0x2a')],'interface':_0x43b0bd,'enterAt':moment()['format'](_0x029b('0x33')),'role':_0x3505c6[_0x029b('0x2b')],'internal':_0x3505c6[_0x029b('0x2c')]};_0x5d7514['forEach'](function(_0x4195bb){_0x67ecd2[_0x029b('0x37')](_[_0x029b('0x5b')]({'channel':_0x4195bb,'type':_0x029b('0x5c'),'data1':_0x029b('0x5d'),'data2':_0x43b0bd},_0x51af57));if(_0x3505c6['loginInPause']){_0x4eb010[_0x029b('0x37')](_[_0x029b('0x5b')]({'channel':_0x4195bb,'type':_0x029b('0x30'),'data1':_0x029b('0x5e')},_0x51af57));}});return db['MemberReport']['bulkCreate'](_0x67ecd2['concat'](_0x4eb010),{'individualHooks':!![]});}})[_0x029b('0x11')](function(){if(_0x3505c6){return _0x3505c6['update']({'online':!![],'lastLoginAt':moment()[_0x029b('0x32')](_0x029b('0x33')),'voicePause':_0x3505c6[_0x029b('0x50')]||![],'mailPause':_0x3505c6[_0x029b('0x50')]||![],'chatPause':_0x3505c6[_0x029b('0x50')]||![],'faxPause':_0x3505c6['loginInPause']||![],'smsPause':_0x3505c6['loginInPause']||![],'openchannelPause':_0x3505c6[_0x029b('0x50')]||![],'pauseType':_0x3505c6[_0x029b('0x50')]?_0x029b('0x5e'):null,'lastPauseAt':moment()['format'](_0x029b('0x33')),'interface':_0x43b0bd});}})[_0x029b('0x11')](function(_0x444315){_0x5dad85(_0x444315);})[_0x029b('0x25')](function(_0x5d0429){_0x2d51d4(_0x202c1f[_0x029b('0x18')](0x1f4,_0x5d0429[_0x029b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f75c386..9a96a75 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 _0x183d=['save','remove','update','emit','removeListener','register','length','./user.events'];(function(_0x3f8187,_0xde28b1){var _0x1e6830=function(_0x322fa2){while(--_0x322fa2){_0x3f8187['push'](_0x3f8187['shift']());}};_0x1e6830(++_0xde28b1);}(_0x183d,0x1bf));var _0xd183=function(_0x4cf8b9,_0x1fc660){_0x4cf8b9=_0x4cf8b9-0x0;var _0x7868d5=_0x183d[_0x4cf8b9];return _0x7868d5;};'use strict';var UserEvents=require(_0xd183('0x0'));var events=[_0xd183('0x1'),_0xd183('0x2'),_0xd183('0x3')];function createListener(_0x16b7f5,_0x3653a0){return function(_0x25317c){_0x3653a0[_0xd183('0x4')](_0x16b7f5,_0x25317c);};}function removeListener(_0x3220da,_0x3c2066){return function(){UserEvents[_0xd183('0x5')](_0x3220da,_0x3c2066);};}exports[_0xd183('0x6')]=function(_0x5ce835){for(var _0x437584=0x0,_0x456207=events[_0xd183('0x7')];_0x437584<_0x456207;_0x437584++){var _0xbddae=events[_0x437584];var _0x257df=createListener('user:'+_0xbddae,_0x5ce835);UserEvents['on'](_0xbddae,_0x257df);}}; \ No newline at end of file +var _0x3a18=['update','emit','removeListener','length','user:','remove'];(function(_0x5d59d0,_0x4c4d36){var _0x8d165a=function(_0x369c24){while(--_0x369c24){_0x5d59d0['push'](_0x5d59d0['shift']());}};_0x8d165a(++_0x4c4d36);}(_0x3a18,0x1b5));var _0x83a1=function(_0x3ad7a9,_0xe9a6a6){_0x3ad7a9=_0x3ad7a9-0x0;var _0x2aeb72=_0x3a18[_0x3ad7a9];return _0x2aeb72;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x83a1('0x0'),_0x83a1('0x1')];function createListener(_0x10107c,_0x36418a){return function(_0x45b2a2){_0x36418a[_0x83a1('0x2')](_0x10107c,_0x45b2a2);};}function removeListener(_0x17095a,_0x48e8cb){return function(){UserEvents[_0x83a1('0x3')](_0x17095a,_0x48e8cb);};}exports['register']=function(_0x19b0aa){for(var _0x41ccc7=0x0,_0x155e00=events[_0x83a1('0x4')];_0x41ccc7<_0x155e00;_0x41ccc7++){var _0x1c16e4=events[_0x41ccc7];var _0x164b5a=createListener(_0x83a1('0x5')+_0x1c16e4,_0x19b0aa);UserEvents['on'](_0x1c16e4,_0x164b5a);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 6843d87..eb686be 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x9bcf8f,_0x589f7d){var _0x10e1ec=function(_0x2cc08d){while(--_0x2cc08d){_0x9bcf8f['push'](_0x9bcf8f['shift']());}};_0x10e1ec(++_0x589f7d);}(_0xedd9,0xfc));var _0x9edd=function(_0x220d1a,_0x31f1e3){_0x220d1a=_0x220d1a-0x0;var _0x4f0fe3=_0xedd9[_0x220d1a];return _0x4f0fe3;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4d291f,_0x44598d){var _0xbba133=function(_0x4bbf72){while(--_0x4bbf72){_0x4d291f['push'](_0x4d291f['shift']());}};_0xbba133(++_0x44598d);}(_0xe706,0xa3));var _0x6e70=function(_0x21bfc8,_0x2a67d2){_0x21bfc8=_0x21bfc8-0x0;var _0x2029c0=_0xe706[_0x21bfc8];return _0x2029c0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index eb6e4db..0c7c347 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 _0x4899=['exports','INTEGER'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x4899,0x10c));var _0x9489=function(_0x34a1e9,_0x59707a){_0x34a1e9=_0x34a1e9-0x0;var _0x52627d=_0x4899[_0x34a1e9];return _0x52627d;};'use strict';var Sequelize=require('sequelize');module[_0x9489('0x0')]={'penalty':{'type':Sequelize[_0x9489('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc30=['exports','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcc30,0x1a9));var _0x0cc3=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0xcc30[_0x442f02];return _0xab6ef1;};'use strict';var Sequelize=require(_0x0cc3('0x0'));module[_0x0cc3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 698d914..a53427d 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 _0x26db=['path','rimraf','../../config/environment','exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5bad83,_0x5c216d){var _0x1bddfd=function(_0x236e94){while(--_0x236e94){_0x5bad83['push'](_0x5bad83['shift']());}};_0x1bddfd(++_0x5c216d);}(_0x26db,0x6e));var _0xb26d=function(_0x19b874,_0xc3f8c0){_0x19b874=_0x19b874-0x0;var _0x400685=_0x26db[_0x19b874];return _0x400685;};'use strict';var _=require(_0xb26d('0x0'));var util=require(_0xb26d('0x1'));var logger=require(_0xb26d('0x2'))(_0xb26d('0x3'));var moment=require(_0xb26d('0x4'));var BPromise=require(_0xb26d('0x5'));var rp=require(_0xb26d('0x6'));var fs=require('fs');var path=require(_0xb26d('0x7'));var rimraf=require(_0xb26d('0x8'));var config=require(_0xb26d('0x9'));var attributes=require('./userChatQueue.attributes');module[_0xb26d('0xa')]=function(_0x2cd413,_0x4d6ae8){return _0x2cd413['define'](_0xb26d('0xb'),attributes,{'tableName':_0xb26d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6fa=['api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','../../config/logger'];(function(_0x1c2e0e,_0x49de2d){var _0x448ee7=function(_0x4c1e97){while(--_0x4c1e97){_0x1c2e0e['push'](_0x1c2e0e['shift']());}};_0x448ee7(++_0x49de2d);}(_0xf6fa,0x13e));var _0xaf6f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf6fa[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaf6f('0x0'))(_0xaf6f('0x1'));var moment=require(_0xaf6f('0x2'));var BPromise=require('bluebird');var rp=require(_0xaf6f('0x3'));var fs=require('fs');var path=require(_0xaf6f('0x4'));var rimraf=require(_0xaf6f('0x5'));var config=require(_0xaf6f('0x6'));var attributes=require(_0xaf6f('0x7'));module[_0xaf6f('0x8')]=function(_0x6c42d7,_0x4c0ff7){return _0x6c42d7[_0xaf6f('0x9')](_0xaf6f('0xa'),attributes,{'tableName':'user_has_chat_queues','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 6f82ecc..b4b0643 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 _0xae62=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xae62,0x111));var _0x2ae6=function(_0x22710e,_0x366b9b){_0x22710e=_0x22710e-0x0;var _0x63f449=_0xae62[_0x22710e];return _0x63f449;};'use strict';var _=require('lodash');var util=require(_0x2ae6('0x0'));var moment=require(_0x2ae6('0x1'));var BPromise=require(_0x2ae6('0x2'));var rs=require(_0x2ae6('0x3'));var fs=require('fs');var Redis=require(_0x2ae6('0x4'));var db=require(_0x2ae6('0x5'))['db'];var utils=require(_0x2ae6('0x6'));var logger=require(_0x2ae6('0x7'))('rpc');var config=require(_0x2ae6('0x8'));var jayson=require(_0x2ae6('0x9'));var client=jayson['client'][_0x2ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x360642,_0x707538,_0x2ab82e){return new BPromise(function(_0x29f403,_0x13539d){return client['request'](_0x360642,_0x2ab82e)[_0x2ae6('0xb')](function(_0x572f0b){logger['info'](_0x2ae6('0xc'),_0x707538,_0x2ae6('0xd'));logger[_0x2ae6('0xe')](_0x2ae6('0xf'),_0x707538,'request\x20sent',JSON[_0x2ae6('0x10')](_0x572f0b));if(_0x572f0b[_0x2ae6('0x11')]){if(_0x572f0b[_0x2ae6('0x11')][_0x2ae6('0x12')]===0x1f4){logger[_0x2ae6('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x707538,_0x572f0b['error'][_0x2ae6('0x13')]);return _0x13539d(_0x572f0b[_0x2ae6('0x11')][_0x2ae6('0x13')]);}logger[_0x2ae6('0x11')](_0x2ae6('0xc'),_0x707538,_0x572f0b[_0x2ae6('0x11')][_0x2ae6('0x13')]);return _0x29f403(_0x572f0b[_0x2ae6('0x11')][_0x2ae6('0x13')]);}else{logger[_0x2ae6('0x14')](_0x2ae6('0xc'),_0x707538,'request\x20sent');_0x29f403(_0x572f0b[_0x2ae6('0x15')]['message']);}})[_0x2ae6('0x16')](function(_0xe74089){logger[_0x2ae6('0x11')](_0x2ae6('0xc'),_0x707538,_0xe74089);_0x13539d(_0xe74089);});});} \ No newline at end of file +var _0xdf2b=['../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','moment','bluebird','ioredis','../../mysqldb'];(function(_0x10b434,_0x521745){var _0x31050b=function(_0x5c72e7){while(--_0x5c72e7){_0x10b434['push'](_0x10b434['shift']());}};_0x31050b(++_0x521745);}(_0xdf2b,0xe0));var _0xbdf2=function(_0x5055b7,_0x15adad){_0x5055b7=_0x5055b7-0x0;var _0x289d45=_0xdf2b[_0x5055b7];return _0x289d45;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbdf2('0x0'));var BPromise=require(_0xbdf2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdf2('0x2'));var db=require(_0xbdf2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdf2('0x4'))(_0xbdf2('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbdf2('0x6')][_0xbdf2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b0634,_0x1a1b79,_0x456fd4){return new BPromise(function(_0x116693,_0x11a74d){return client[_0xbdf2('0x8')](_0x3b0634,_0x456fd4)[_0xbdf2('0x9')](function(_0x555b2b){logger[_0xbdf2('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x1a1b79,_0xbdf2('0xb'));logger[_0xbdf2('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1a1b79,_0xbdf2('0xb'),JSON[_0xbdf2('0xd')](_0x555b2b));if(_0x555b2b[_0xbdf2('0xe')]){if(_0x555b2b[_0xbdf2('0xe')][_0xbdf2('0xf')]===0x1f4){logger[_0xbdf2('0xe')](_0xbdf2('0x10'),_0x1a1b79,_0x555b2b['error']['message']);return _0x11a74d(_0x555b2b[_0xbdf2('0xe')][_0xbdf2('0x11')]);}logger[_0xbdf2('0xe')](_0xbdf2('0x10'),_0x1a1b79,_0x555b2b[_0xbdf2('0xe')]['message']);return _0x116693(_0x555b2b[_0xbdf2('0xe')]['message']);}else{logger['info'](_0xbdf2('0x10'),_0x1a1b79,_0xbdf2('0xb'));_0x116693(_0x555b2b[_0xbdf2('0x12')]['message']);}})['catch'](function(_0x42ca59){logger['error'](_0xbdf2('0x10'),_0x1a1b79,_0x42ca59);_0x11a74d(_0x42ca59);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c778f3a..7ea18e7 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x85629,_0x10be69){var _0x51b019=function(_0x2b35fb){while(--_0x2b35fb){_0x85629['push'](_0x85629['shift']());}};_0x51b019(++_0x10be69);}(_0xe706,0xa3));var _0x6e70=function(_0x5e343c,_0x5d5c6a){_0x5e343c=_0x5e343c-0x0;var _0x497243=_0xe706[_0x5e343c];return _0x497243;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3e49c3,_0xf492ea){var _0x565d2a=function(_0x5c9a4b){while(--_0x5c9a4b){_0x3e49c3['push'](_0x3e49c3['shift']());}};_0x565d2a(++_0xf492ea);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xcb91[_0x40dd56];return _0x4f850f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f431ace..7159960 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 _0xe889=['exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe889,0x11a));var _0x9e88=function(_0x298d28,_0x10daee){_0x298d28=_0x298d28-0x0;var _0x20693d=_0xe889[_0x298d28];return _0x20693d;};'use strict';var Sequelize=require('sequelize');module[_0x9e88('0x0')]={'penalty':{'type':Sequelize[_0x9e88('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9e88('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9e88('0x2')]}}; \ No newline at end of file +var _0x9cd7=['INTEGER','STRING','exports'];(function(_0x2c9c95,_0x20957d){var _0x240ae6=function(_0xe1f45){while(--_0xe1f45){_0x2c9c95['push'](_0x2c9c95['shift']());}};_0x240ae6(++_0x20957d);}(_0x9cd7,0x77));var _0x79cd=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x9cd7[_0xf91841];return _0x4b9c44;};'use strict';var Sequelize=require('sequelize');module[_0x79cd('0x0')]={'penalty':{'type':Sequelize[_0x79cd('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x79cd('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x79cd('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 654bf3f..e79fc35 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 _0x52fe=['path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','lodash','api','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52fe,0x14a));var _0xe52f=function(_0x46a643,_0x16244c){_0x46a643=_0x46a643-0x0;var _0x253204=_0x52fe[_0x46a643];return _0x253204;};'use strict';var _=require(_0xe52f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe52f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe52f('0x2'));var fs=require('fs');var path=require(_0xe52f('0x3'));var rimraf=require(_0xe52f('0x4'));var config=require(_0xe52f('0x5'));var attributes=require(_0xe52f('0x6'));module['exports']=function(_0x473136,_0x493ce8){return _0x473136[_0xe52f('0x7')](_0xe52f('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23f1=['../../config/environment','exports','define','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3c95af,_0xeae1ff){var _0x56c6ef=function(_0x1b684e){while(--_0x1b684e){_0x3c95af['push'](_0x3c95af['shift']());}};_0x56c6ef(++_0xeae1ff);}(_0x23f1,0xd2));var _0x123f=function(_0x505eeb,_0x527b68){_0x505eeb=_0x505eeb-0x0;var _0x39acb1=_0x23f1[_0x505eeb];return _0x39acb1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x123f('0x0'))(_0x123f('0x1'));var moment=require(_0x123f('0x2'));var BPromise=require(_0x123f('0x3'));var rp=require(_0x123f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x123f('0x5'));var config=require(_0x123f('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x123f('0x7')]=function(_0x152f1c,_0x70e225){return _0x152f1c[_0x123f('0x8')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','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 571b3f9..f25380e 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 _0x3be6=['then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x3f8fea,_0x230ac4){var _0x6bf899=function(_0x2ebd87){while(--_0x2ebd87){_0x3f8fea['push'](_0x3f8fea['shift']());}};_0x6bf899(++_0x230ac4);}(_0x3be6,0xb2));var _0x63be=function(_0x5af1ce,_0x318f6e){_0x5af1ce=_0x5af1ce-0x0;var _0x4e7f4f=_0x3be6[_0x5af1ce];return _0x4e7f4f;};'use strict';var _=require(_0x63be('0x0'));var util=require('util');var moment=require(_0x63be('0x1'));var BPromise=require(_0x63be('0x2'));var rs=require(_0x63be('0x3'));var fs=require('fs');var Redis=require(_0x63be('0x4'));var db=require(_0x63be('0x5'))['db'];var utils=require(_0x63be('0x6'));var logger=require('../../config/logger')(_0x63be('0x7'));var config=require('../../config/environment');var jayson=require(_0x63be('0x8'));var client=jayson['client'][_0x63be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319dbe,_0x3305cd,_0x3c05ed){return new BPromise(function(_0x30d8e1,_0x48e089){return client[_0x63be('0xa')](_0x319dbe,_0x3c05ed)[_0x63be('0xb')](function(_0x46acc5){logger[_0x63be('0xc')](_0x63be('0xd'),_0x3305cd,_0x63be('0xe'));logger[_0x63be('0xf')](_0x63be('0x10'),_0x3305cd,_0x63be('0xe'),JSON[_0x63be('0x11')](_0x46acc5));if(_0x46acc5[_0x63be('0x12')]){if(_0x46acc5[_0x63be('0x12')]['code']===0x1f4){logger[_0x63be('0x12')](_0x63be('0xd'),_0x3305cd,_0x46acc5[_0x63be('0x12')]['message']);return _0x48e089(_0x46acc5[_0x63be('0x12')]['message']);}logger[_0x63be('0x12')](_0x63be('0xd'),_0x3305cd,_0x46acc5[_0x63be('0x12')][_0x63be('0x13')]);return _0x30d8e1(_0x46acc5['error']['message']);}else{logger[_0x63be('0xc')](_0x63be('0xd'),_0x3305cd,_0x63be('0xe'));_0x30d8e1(_0x46acc5[_0x63be('0x14')]['message']);}})['catch'](function(_0x7a8bb9){logger[_0x63be('0x12')](_0x63be('0xd'),_0x3305cd,_0x7a8bb9);_0x48e089(_0x7a8bb9);});});} \ No newline at end of file +var _0xa2df=['http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x1eebba,_0x558eda){var _0x311596=function(_0x416aea){while(--_0x416aea){_0x1eebba['push'](_0x1eebba['shift']());}};_0x311596(++_0x558eda);}(_0xa2df,0x172));var _0xfa2d=function(_0x24f98b,_0x28f4a5){_0x24f98b=_0x24f98b-0x0;var _0x37be13=_0xa2df[_0x24f98b];return _0x37be13;};'use strict';var _=require(_0xfa2d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa2d('0x1'));var fs=require('fs');var Redis=require(_0xfa2d('0x2'));var db=require(_0xfa2d('0x3'))['db'];var utils=require(_0xfa2d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfa2d('0x5'));var jayson=require(_0xfa2d('0x6'));var client=jayson[_0xfa2d('0x7')][_0xfa2d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21bd3b,_0x2274d7,_0x413abc){return new BPromise(function(_0x4e83d9,_0x302d8b){return client[_0xfa2d('0x9')](_0x21bd3b,_0x413abc)[_0xfa2d('0xa')](function(_0x26024e){logger[_0xfa2d('0xb')](_0xfa2d('0xc'),_0x2274d7,_0xfa2d('0xd'));logger[_0xfa2d('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2274d7,_0xfa2d('0xd'),JSON[_0xfa2d('0xf')](_0x26024e));if(_0x26024e[_0xfa2d('0x10')]){if(_0x26024e['error'][_0xfa2d('0x11')]===0x1f4){logger[_0xfa2d('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x2274d7,_0x26024e[_0xfa2d('0x10')][_0xfa2d('0x12')]);return _0x302d8b(_0x26024e[_0xfa2d('0x10')][_0xfa2d('0x12')]);}logger['error'](_0xfa2d('0xc'),_0x2274d7,_0x26024e['error'][_0xfa2d('0x12')]);return _0x4e83d9(_0x26024e[_0xfa2d('0x10')][_0xfa2d('0x12')]);}else{logger['info'](_0xfa2d('0xc'),_0x2274d7,_0xfa2d('0xd'));_0x4e83d9(_0x26024e[_0xfa2d('0x13')][_0xfa2d('0x12')]);}})[_0xfa2d('0x14')](function(_0x4e9aff){logger[_0xfa2d('0x10')](_0xfa2d('0xc'),_0x2274d7,_0x4e9aff);_0x302d8b(_0x4e9aff);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 41ef750..55b6a8a 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x45cc27,_0x25797e){var _0x2fca50=function(_0x5b1673){while(--_0x5b1673){_0x45cc27['push'](_0x45cc27['shift']());}};_0x2fca50(++_0x25797e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xcb91[_0x23b655];return _0x364b32;};'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(_0x590778,_0x36fc2c){var _0x323405=function(_0x25d1b7){while(--_0x25d1b7){_0x590778['push'](_0x590778['shift']());}};_0x323405(++_0x36fc2c);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 3234784..1d6282d 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 _0xd61f=['exports','INTEGER','sequelize'];(function(_0x2de49b,_0x5471e5){var _0x1042c7=function(_0x278856){while(--_0x278856){_0x2de49b['push'](_0x2de49b['shift']());}};_0x1042c7(++_0x5471e5);}(_0xd61f,0x113));var _0xfd61=function(_0x42f5cb,_0x3ae198){_0x42f5cb=_0x42f5cb-0x0;var _0x4ec9f6=_0xd61f[_0x42f5cb];return _0x4ec9f6;};'use strict';var Sequelize=require(_0xfd61('0x0'));module[_0xfd61('0x1')]={'penalty':{'type':Sequelize[_0xfd61('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9275=['sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9275,0x154));var _0x5927=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x9275[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0x5927('0x0'));module[_0x5927('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 4d60524..230929d 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 _0x6230=['./userMailQueue.attributes','UserMailQueue','lodash','util','bluebird','request-promise','path','../../config/environment'];(function(_0xf3cbb5,_0x2a040f){var _0x5a9464=function(_0x21471a){while(--_0x21471a){_0xf3cbb5['push'](_0xf3cbb5['shift']());}};_0x5a9464(++_0x2a040f);}(_0x6230,0xea));var _0x0623=function(_0x4f4547,_0x2b7b2f){_0x4f4547=_0x4f4547-0x0;var _0x5541de=_0x6230[_0x4f4547];return _0x5541de;};'use strict';var _=require(_0x0623('0x0'));var util=require(_0x0623('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0623('0x2'));var rp=require(_0x0623('0x3'));var fs=require('fs');var path=require(_0x0623('0x4'));var rimraf=require('rimraf');var config=require(_0x0623('0x5'));var attributes=require(_0x0623('0x6'));module['exports']=function(_0x416c99,_0x3029d2){return _0x416c99['define'](_0x0623('0x7'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc706=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','user_has_mail_queues','lodash','util'];(function(_0x366047,_0x41a038){var _0x1e7f8c=function(_0xb69310){while(--_0xb69310){_0x366047['push'](_0x366047['shift']());}};_0x1e7f8c(++_0x41a038);}(_0xc706,0x184));var _0x6c70=function(_0x1158de,_0x29435c){_0x1158de=_0x1158de-0x0;var _0x21f764=_0xc706[_0x1158de];return _0x21f764;};'use strict';var _=require(_0x6c70('0x0'));var util=require(_0x6c70('0x1'));var logger=require('../../config/logger')(_0x6c70('0x2'));var moment=require('moment');var BPromise=require(_0x6c70('0x3'));var rp=require(_0x6c70('0x4'));var fs=require('fs');var path=require(_0x6c70('0x5'));var rimraf=require(_0x6c70('0x6'));var config=require(_0x6c70('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x6c70('0x8')]=function(_0x5b1b28,_0x544c31){return _0x5b1b28['define']('UserMailQueue',attributes,{'tableName':_0x6c70('0x9'),'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 4ca1ecc..62d8fd9 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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x307e61,_0x499952){var _0x1b4ab8=function(_0x10b4bf){while(--_0x10b4bf){_0x307e61['push'](_0x307e61['shift']());}};_0x1b4ab8(++_0x499952);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2e7192,_0x1b354b){_0x2e7192=_0x2e7192-0x0;var _0xbe639f=_0x8ef6[_0x2e7192];return _0xbe639f;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x124be8,_0x3b57c1){var _0x3dae86=function(_0x2260c2){while(--_0x2260c2){_0x124be8['push'](_0x124be8['shift']());}};_0x3dae86(++_0x3b57c1);}(_0x8ef6,0xf2));var _0x68ef=function(_0x35287b,_0x3e3af3){_0x35287b=_0x35287b-0x0;var _0x1404c5=_0x8ef6[_0x35287b];return _0x1404c5;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 8f1c8c6..2fbd41c 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 _0x261a=['isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','post'];(function(_0x2686ff,_0x51cee6){var _0x5a95f5=function(_0xc967a9){while(--_0xc967a9){_0x2686ff['push'](_0x2686ff['shift']());}};_0x5a95f5(++_0x51cee6);}(_0x261a,0x1ba));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xa261('0x0'));var util=require(_0xa261('0x1'));var path=require(_0xa261('0x2'));var timeout=require(_0xa261('0x3'));var express=require(_0xa261('0x4'));var router=express[_0xa261('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa261('0x6'));var interaction=require(_0xa261('0x7'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xa261('0x8')]('/',auth[_0xa261('0x9')](),controller['sendUserNotification']);module[_0xa261('0xa')]=router; \ No newline at end of file +var _0xc805=['Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout','express'];(function(_0x1ec136,_0x2e8c43){var _0x3ae9ec=function(_0x2e8046){while(--_0x2e8046){_0x1ec136['push'](_0x1ec136['shift']());}};_0x3ae9ec(++_0x2e8c43);}(_0xc805,0xd3));var _0x5c80=function(_0x42ba3b,_0x355441){_0x42ba3b=_0x42ba3b-0x0;var _0x17634b=_0xc805[_0x42ba3b];return _0x17634b;};'use strict';var multer=require(_0x5c80('0x0'));var util=require(_0x5c80('0x1'));var path=require(_0x5c80('0x2'));var timeout=require(_0x5c80('0x3'));var express=require(_0x5c80('0x4'));var router=express[_0x5c80('0x5')]();var fs_extra=require(_0x5c80('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5c80('0x7'));var config=require(_0x5c80('0x8'));var controller=require(_0x5c80('0x9'));router['post']('/',auth[_0x5c80('0xa')](),controller[_0x5c80('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 5cc145e..c2898b9 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 _0x7c55=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4c1f1f,_0x3aa18d){var _0x4f9e3c=function(_0x1a94cb){while(--_0x1a94cb){_0x4c1f1f['push'](_0x4c1f1f['shift']());}};_0x4f9e3c(++_0x3aa18d);}(_0x7c55,0xc7));var _0x57c5=function(_0x2226dd,_0x59d005){_0x2226dd=_0x2226dd-0x0;var _0x55936e=_0x7c55[_0x2226dd];return _0x55936e;};'use strict';var Sequelize=require(_0x57c5('0x0'));module[_0x57c5('0x1')]={'body':{'type':Sequelize[_0x57c5('0x2')]},'senderName':{'type':Sequelize[_0x57c5('0x3')]},'recipientsId':{'type':Sequelize[_0x57c5('0x2')]},'recipientsDescription':{'type':Sequelize[_0x57c5('0x3')]},'beep':{'type':Sequelize[_0x57c5('0x4')]}}; \ No newline at end of file +var _0xd316=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1a1619,_0x24f84c){var _0x47987d=function(_0x15dec2){while(--_0x15dec2){_0x1a1619['push'](_0x1a1619['shift']());}};_0x47987d(++_0x24f84c);}(_0xd316,0x182));var _0x6d31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd316[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6d31('0x0'));module[_0x6d31('0x1')]={'body':{'type':Sequelize[_0x6d31('0x2')]},'senderName':{'type':Sequelize[_0x6d31('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x6d31('0x3')]},'beep':{'type':Sequelize[_0x6d31('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index d1f737d..8f7462a 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 _0xf8f0=['openchannelqueue','smsqueue','whatsappqueue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','beep','SenderId','recipientsId','join','sequelize','transaction','create','recipientsDescription','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','model','User','union','ids','queue','replace','Queue','push','all','flatten','findOne','getAgents','map','eml-format','fast-json-patch','request-promise','moment','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','view','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf8f0,0x94));var _0x0f8f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf8f0[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x0f8f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f8f('0x1'));var rp=require(_0x0f8f('0x2'));var moment=require(_0x0f8f('0x3'));var BPromise=require(_0x0f8f('0x4'));var Mustache=require(_0x0f8f('0x5'));var util=require(_0x0f8f('0x6'));var path=require(_0x0f8f('0x7'));var sox=require(_0x0f8f('0x8'));var csv=require(_0x0f8f('0x9'));var ejs=require(_0x0f8f('0xa'));var fs=require('fs');var fs_extra=require(_0x0f8f('0xb'));var _=require(_0x0f8f('0xc'));var squel=require(_0x0f8f('0xd'));var crypto=require(_0x0f8f('0xe'));var jsforce=require(_0x0f8f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0f8f('0x9'));var querystring=require(_0x0f8f('0x10'));var Papa=require(_0x0f8f('0x11'));var Redis=require(_0x0f8f('0x12'));var authService=require(_0x0f8f('0x13'));var qs=require(_0x0f8f('0x14'));var as=require(_0x0f8f('0x15'));var hardwareService=require(_0x0f8f('0x16'));var logger=require(_0x0f8f('0x17'))(_0x0f8f('0x18'));var utils=require(_0x0f8f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0f8f('0x1a'))['db'];config[_0x0f8f('0x1b')]=_[_0x0f8f('0x1c')](config[_0x0f8f('0x1b')],{'host':_0x0f8f('0x1d'),'port':0x18eb});var socket=require(_0x0f8f('0x1e'))(new Redis(config[_0x0f8f('0x1b')]));require(_0x0f8f('0x1f'))[_0x0f8f('0x20')](socket);function respondWithStatusCode(_0x1c14f8,_0x381228){_0x381228=_0x381228||0xcc;return function(_0x50f575){if(_0x50f575){return _0x1c14f8[_0x0f8f('0x21')](_0x381228);}return _0x1c14f8[_0x0f8f('0x22')](_0x381228)[_0x0f8f('0x23')]();};}function respondWithResult(_0x237fa6,_0x19dda4){_0x19dda4=_0x19dda4||0xc8;return function(_0x218d9c){if(_0x218d9c){return _0x237fa6[_0x0f8f('0x22')](_0x19dda4)['json'](_0x218d9c);}};}function respondWithFilteredResult(_0x3d638c,_0x297811){return function(_0x2ff15c){if(_0x2ff15c){var _0x222666=typeof _0x297811[_0x0f8f('0x24')]==='undefined'&&typeof _0x297811['limit']===_0x0f8f('0x25');var _0x5244f4=_0x2ff15c['count'];var _0x14f0de=_0x222666?0x0:_0x297811['offset'];var _0x385eae=_0x222666?_0x2ff15c[_0x0f8f('0x26')]:_0x297811['offset']+_0x297811[_0x0f8f('0x27')];var _0x1a1020;if(_0x385eae>=_0x5244f4){_0x385eae=_0x5244f4;_0x1a1020=0xc8;}else{_0x1a1020=0xce;}_0x3d638c['status'](_0x1a1020);return _0x3d638c[_0x0f8f('0x28')](_0x0f8f('0x29'),_0x14f0de+'-'+_0x385eae+'/'+_0x5244f4)['json'](_0x2ff15c);}return null;};}function patchUpdates(_0xc374c6){return function(_0x48054f){try{jsonpatch[_0x0f8f('0x2a')](_0x48054f,_0xc374c6,!![]);}catch(_0x344da7){return BPromise[_0x0f8f('0x2b')](_0x344da7);}return _0x48054f[_0x0f8f('0x2c')]();};}function saveUpdates(_0x1fbe36,_0xad5ecd){return function(_0x175497){if(_0x175497){return _0x175497[_0x0f8f('0x2d')](_0x1fbe36)['then'](function(_0x54d625){return _0x54d625;});}return null;};}function removeEntity(_0xc8248b,_0x4d178f){return function(_0x1901f7){if(_0x1901f7){return _0x1901f7['destroy']()[_0x0f8f('0x2e')](function(){_0xc8248b[_0x0f8f('0x22')](0xcc)[_0x0f8f('0x23')]();});}};}function handleEntityNotFound(_0x3d5c16,_0x415dc8){return function(_0x47189d){if(!_0x47189d){_0x3d5c16[_0x0f8f('0x21')](0x194);}return _0x47189d;};}function handleError(_0x55e055,_0x48b387){_0x48b387=_0x48b387||0x1f4;return function(_0x14848b){logger[_0x0f8f('0x2f')](_0x14848b[_0x0f8f('0x30')]);if(_0x14848b[_0x0f8f('0x31')]){delete _0x14848b[_0x0f8f('0x31')];}_0x55e055['status'](_0x48b387)[_0x0f8f('0x32')](_0x14848b);};}exports[_0x0f8f('0x33')]=function(_0x455fef,_0x21bdfd,_0x3eebe7){if(!_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x35')](_0x0f8f('0x36'))&&!_0x455fef['body'][_0x0f8f('0x35')](_0x0f8f('0x37'))){throw new db[(_0x0f8f('0x38'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x455fef[_0x0f8f('0x34')]['hasOwnProperty'](_0x0f8f('0x37'))&&!_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x35')](_0x0f8f('0x39'))){throw new db[(_0x0f8f('0x38'))]['ValidationError'](_0x0f8f('0x3a'));}if(!_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x35')](_0x0f8f('0x3b'))){throw new db[(_0x0f8f('0x38'))][(_0x0f8f('0x3c'))](_0x0f8f('0x3d'));}else{try{var _0x4cbe4c=JSON[_0x0f8f('0x3e')](_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x3b')]);}catch(_0x259a45){logger[_0x0f8f('0x2f')](_0x259a45);throw new db[(_0x0f8f('0x38'))][(_0x0f8f('0x3c'))](_0x0f8f('0x3f'));}var _0x20bb0d=[_0x0f8f('0x40'),_0x0f8f('0x41'),'mailqueue',_0x0f8f('0x42'),_0x0f8f('0x43'),'voicequeue',_0x0f8f('0x44'),'team',_0x0f8f('0x45')];if(_[_0x0f8f('0x46')](_0x4cbe4c,function(_0x3e0cb7){return!_[_0x0f8f('0x47')](_0x20bb0d,_0x3e0cb7['model'][_0x0f8f('0x48')]());})){throw new db[(_0x0f8f('0x38'))]['ValidationError'](_0x0f8f('0x49'));}}}var _0x158819={};_0x158819[_0x0f8f('0x4a')]=_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x35')]('senderName')?_0x455fef['body'][_0x0f8f('0x4a')]:_0x455fef['user'][_0x0f8f('0x4b')];_0x158819['recipientsDescription']=_[_0x0f8f('0x4c')](_0x455fef[_0x0f8f('0x34')]['recipientsDescription'])?null:_0x455fef[_0x0f8f('0x34')]['recipientsDescription'];_0x158819['beep']=_0x455fef[_0x0f8f('0x34')][_0x0f8f('0x4d')]||![];_0x158819[_0x0f8f('0x4e')]=_0x455fef['user']['id'];return getContent(_0x455fef[_0x0f8f('0x34')])[_0x0f8f('0x2e')](function(_0x11bbf7){_0x158819[_0x0f8f('0x34')]=_0x11bbf7;return getRecipients(_0x4cbe4c);})[_0x0f8f('0x2e')](function(_0x26880d){_0x158819[_0x0f8f('0x4f')]=_['sortBy'](_0x26880d)[_0x0f8f('0x50')](',');return db[_0x0f8f('0x51')][_0x0f8f('0x52')](function(_0x30623a){return db['UserNotification'][_0x0f8f('0x53')](_0x158819,{'raw':!![],'transaction':_0x30623a})[_0x0f8f('0x2e')](function(_0x328258){var _0x2d0961={'sender':_0x158819[_0x0f8f('0x4a')],'description':_0x158819[_0x0f8f('0x54')],'content':_0x158819[_0x0f8f('0x34')],'beep':_0x158819[_0x0f8f('0x4d')]};_0x26880d[_0x0f8f('0x55')](function(_0xc15d4c){_0x2d0961[_0x0f8f('0x56')]=_0xc15d4c;socket[_0x0f8f('0x57')](_0x0f8f('0x58'),_0x2d0961);});return _0x328258;});});})['then'](respondWithResult(_0x21bdfd,0xc9))[_0x0f8f('0x59')](handleError(_0x21bdfd,null));};function getContent(_0x139777){return new BPromise(function(_0x84d111,_0x3bf0e1){if(_0x139777['text']){_0x84d111(_0x139777[_0x0f8f('0x36')]);return;}return db[_0x0f8f('0x5a')]['findOne']({'attributes':[_0x0f8f('0x5b')],'where':{'id':_0x139777['TemplateId']},'raw':!![]})[_0x0f8f('0x2e')](function(_0x41b83a){if(!_0x41b83a)throw new db['Sequelize'][(_0x0f8f('0x3c'))](_0x0f8f('0x5c'));var _0x4567f2=Mustache[_0x0f8f('0x5d')](_0x41b83a[_0x0f8f('0x5b')],_0x139777[_0x0f8f('0x39')]);_0x84d111(_0x4567f2);})[_0x0f8f('0x59')](function(_0x4e827c){_0x3bf0e1(_0x4e827c);});});}function getRecipients(_0xd03b79){return new BPromise(function(_0x278a61,_0xa9560e){var _0x37a2cf=[];var _0x213179=[];_0xd03b79[_0x0f8f('0x55')](function(_0x4cb748){var _0x25a621=_['startCase'](_0x4cb748[_0x0f8f('0x5e')]['toLowerCase']());if(_0x25a621===_0x0f8f('0x5f')){_0x37a2cf=_[_0x0f8f('0x60')](_0x37a2cf,_0x4cb748[_0x0f8f('0x61')]);}else{if(_[_0x0f8f('0x47')](_0x25a621,_0x0f8f('0x62')))_0x25a621=_0x25a621[_0x0f8f('0x63')]('queue',_0x0f8f('0x64'));_0x4cb748[_0x0f8f('0x61')]['forEach'](function(_0x12a0aa){_0x213179[_0x0f8f('0x65')](getAgents(_0x25a621,_0x12a0aa));});}});return BPromise[_0x0f8f('0x66')](_0x213179)[_0x0f8f('0x2e')](function(_0x14635e){_0x37a2cf=_[_0x0f8f('0x60')](_0x37a2cf,_[_0x0f8f('0x67')](_0x14635e));_0x278a61(_0x37a2cf);})[_0x0f8f('0x59')](function(_0x51d2eb){_0xa9560e(_0x51d2eb);});});}function getAgents(_0x33fc20,_0x142d27){return new BPromise(function(_0x37c27a,_0x22be01){return db[_0x33fc20][_0x0f8f('0x68')]({'where':{'id':_0x142d27}})[_0x0f8f('0x2e')](function(_0x5618fa){return _0x5618fa[_0x0f8f('0x69')]({'attributes':['id'],'raw':!![]})[_0x0f8f('0x2e')](function(_0x16056f){var _0x403d94=_[_0x0f8f('0x6a')](_0x16056f,'id');_0x37c27a(_0x403d94);});})[_0x0f8f('0x59')](function(_0x2e87db){_0x22be01(_0x2e87db);});});} \ No newline at end of file +var _0x782b=['replace','ids','push','all','union','flatten','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','end','error','stack','name','send','sendUserNotification','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','view','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','chatqueue','faxqueue','mailqueue','smsqueue','whatsappqueue','team','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','user','sortBy','join','sequelize','transaction','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','render','startCase','User','queue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x782b,0x6a));var _0xb782=function(_0x41b6f5,_0x1ad42f){_0x41b6f5=_0x41b6f5-0x0;var _0x5d6142=_0x782b[_0x41b6f5];return _0x5d6142;};'use strict';var emlformat=require(_0xb782('0x0'));var rimraf=require(_0xb782('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb782('0x2'));var rp=require(_0xb782('0x3'));var moment=require(_0xb782('0x4'));var BPromise=require(_0xb782('0x5'));var Mustache=require('mustache');var util=require(_0xb782('0x6'));var path=require(_0xb782('0x7'));var sox=require(_0xb782('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb782('0x9'));var _=require(_0xb782('0xa'));var squel=require(_0xb782('0xb'));var crypto=require('crypto');var jsforce=require(_0xb782('0xc'));var deskjs=require(_0xb782('0xd'));var toCsv=require(_0xb782('0xe'));var querystring=require(_0xb782('0xf'));var Papa=require('papaparse');var Redis=require(_0xb782('0x10'));var authService=require(_0xb782('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb782('0x12'));var hardwareService=require(_0xb782('0x13'));var logger=require(_0xb782('0x14'))(_0xb782('0x15'));var utils=require(_0xb782('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb782('0x17'))['db'];config[_0xb782('0x18')]=_['defaults'](config[_0xb782('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb782('0x19'))(new Redis(config[_0xb782('0x18')]));require(_0xb782('0x1a'))[_0xb782('0x1b')](socket);function respondWithStatusCode(_0x285c1d,_0x291cad){_0x291cad=_0x291cad||0xcc;return function(_0x428ba4){if(_0x428ba4){return _0x285c1d[_0xb782('0x1c')](_0x291cad);}return _0x285c1d[_0xb782('0x1d')](_0x291cad)['end']();};}function respondWithResult(_0x59ce8e,_0x340a59){_0x340a59=_0x340a59||0xc8;return function(_0x8af66c){if(_0x8af66c){return _0x59ce8e[_0xb782('0x1d')](_0x340a59)[_0xb782('0x1e')](_0x8af66c);}};}function respondWithFilteredResult(_0x5775c7,_0x62f797){return function(_0x1434b9){if(_0x1434b9){var _0x16c44f=typeof _0x62f797[_0xb782('0x1f')]==='undefined'&&typeof _0x62f797[_0xb782('0x20')]===_0xb782('0x21');var _0x36d497=_0x1434b9['count'];var _0x2f6ecf=_0x16c44f?0x0:_0x62f797[_0xb782('0x1f')];var _0xfc2c42=_0x16c44f?_0x1434b9[_0xb782('0x22')]:_0x62f797[_0xb782('0x1f')]+_0x62f797[_0xb782('0x20')];var _0x650f26;if(_0xfc2c42>=_0x36d497){_0xfc2c42=_0x36d497;_0x650f26=0xc8;}else{_0x650f26=0xce;}_0x5775c7[_0xb782('0x1d')](_0x650f26);return _0x5775c7['set']('Content-Range',_0x2f6ecf+'-'+_0xfc2c42+'/'+_0x36d497)[_0xb782('0x1e')](_0x1434b9);}return null;};}function patchUpdates(_0x3128b6){return function(_0x5d0646){try{jsonpatch[_0xb782('0x23')](_0x5d0646,_0x3128b6,!![]);}catch(_0x940f4e){return BPromise[_0xb782('0x24')](_0x940f4e);}return _0x5d0646[_0xb782('0x25')]();};}function saveUpdates(_0x2841e5,_0x475b97){return function(_0x23b1a1){if(_0x23b1a1){return _0x23b1a1[_0xb782('0x26')](_0x2841e5)[_0xb782('0x27')](function(_0x8d8105){return _0x8d8105;});}return null;};}function removeEntity(_0x5e762c,_0x1cbc56){return function(_0x5931b9){if(_0x5931b9){return _0x5931b9[_0xb782('0x28')]()[_0xb782('0x27')](function(){_0x5e762c[_0xb782('0x1d')](0xcc)[_0xb782('0x29')]();});}};}function handleEntityNotFound(_0x2e5b73,_0x3782e1){return function(_0x13a573){if(!_0x13a573){_0x2e5b73[_0xb782('0x1c')](0x194);}return _0x13a573;};}function handleError(_0x533366,_0x2ec229){_0x2ec229=_0x2ec229||0x1f4;return function(_0x2acc55){logger[_0xb782('0x2a')](_0x2acc55[_0xb782('0x2b')]);if(_0x2acc55['name']){delete _0x2acc55[_0xb782('0x2c')];}_0x533366['status'](_0x2ec229)[_0xb782('0x2d')](_0x2acc55);};}exports[_0xb782('0x2e')]=function(_0x4fc979,_0x2478a8,_0x59766f){if(!_0x4fc979['body'][_0xb782('0x2f')](_0xb782('0x30'))&&!_0x4fc979['body'][_0xb782('0x2f')](_0xb782('0x31'))){throw new db[(_0xb782('0x32'))][(_0xb782('0x33'))](_0xb782('0x34'));}else{if(_0x4fc979['body'][_0xb782('0x2f')]('TemplateId')&&!_0x4fc979[_0xb782('0x35')][_0xb782('0x2f')](_0xb782('0x36'))){throw new db[(_0xb782('0x32'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x4fc979['body'][_0xb782('0x2f')]('recipients')){throw new db[(_0xb782('0x32'))]['ValidationError'](_0xb782('0x37'));}else{try{var _0x202c68=JSON[_0xb782('0x38')](_0x4fc979[_0xb782('0x35')][_0xb782('0x39')]);}catch(_0x54fedc){logger[_0xb782('0x2a')](_0x54fedc);throw new db['Sequelize']['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x5db988=[_0xb782('0x3a'),_0xb782('0x3b'),_0xb782('0x3c'),'openchannelqueue',_0xb782('0x3d'),'voicequeue',_0xb782('0x3e'),_0xb782('0x3f'),'user'];if(_[_0xb782('0x40')](_0x202c68,function(_0x11c2eb){return!_[_0xb782('0x41')](_0x5db988,_0x11c2eb[_0xb782('0x42')][_0xb782('0x43')]());})){throw new db['Sequelize'][(_0xb782('0x33'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x38854a={};_0x38854a[_0xb782('0x44')]=_0x4fc979[_0xb782('0x35')]['hasOwnProperty']('senderName')?_0x4fc979['body']['senderName']:_0x4fc979['user'][_0xb782('0x45')];_0x38854a[_0xb782('0x46')]=_[_0xb782('0x47')](_0x4fc979[_0xb782('0x35')][_0xb782('0x46')])?null:_0x4fc979[_0xb782('0x35')][_0xb782('0x46')];_0x38854a[_0xb782('0x48')]=_0x4fc979[_0xb782('0x35')][_0xb782('0x48')]||![];_0x38854a[_0xb782('0x49')]=_0x4fc979[_0xb782('0x4a')]['id'];return getContent(_0x4fc979['body'])[_0xb782('0x27')](function(_0x46516e){_0x38854a['body']=_0x46516e;return getRecipients(_0x202c68);})[_0xb782('0x27')](function(_0x3df079){_0x38854a['recipientsId']=_[_0xb782('0x4b')](_0x3df079)[_0xb782('0x4c')](',');return db[_0xb782('0x4d')][_0xb782('0x4e')](function(_0x288a3c){return db['UserNotification'][_0xb782('0x4f')](_0x38854a,{'raw':!![],'transaction':_0x288a3c})[_0xb782('0x27')](function(_0x3b689e){var _0x3b37a5={'sender':_0x38854a[_0xb782('0x44')],'description':_0x38854a[_0xb782('0x46')],'content':_0x38854a[_0xb782('0x35')],'beep':_0x38854a['beep']};_0x3df079[_0xb782('0x50')](function(_0x415fae){_0x3b37a5[_0xb782('0x51')]=_0x415fae;socket[_0xb782('0x52')](_0xb782('0x53'),_0x3b37a5);});return _0x3b689e;});});})['then'](respondWithResult(_0x2478a8,0xc9))[_0xb782('0x54')](handleError(_0x2478a8,null));};function getContent(_0x1da862){return new BPromise(function(_0x4a94fd,_0x466320){if(_0x1da862['text']){_0x4a94fd(_0x1da862[_0xb782('0x30')]);return;}return db[_0xb782('0x55')][_0xb782('0x56')]({'attributes':[_0xb782('0x57')],'where':{'id':_0x1da862['TemplateId']},'raw':!![]})[_0xb782('0x27')](function(_0x2d1897){if(!_0x2d1897)throw new db[(_0xb782('0x32'))][(_0xb782('0x33'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x1675a7=Mustache[_0xb782('0x58')](_0x2d1897[_0xb782('0x57')],_0x1da862['view']);_0x4a94fd(_0x1675a7);})[_0xb782('0x54')](function(_0x31dfde){_0x466320(_0x31dfde);});});}function getRecipients(_0x21465c){return new BPromise(function(_0x5aaca4,_0x11596e){var _0x3cd7d0=[];var _0x514723=[];_0x21465c['forEach'](function(_0x3b6ae3){var _0xdb7352=_[_0xb782('0x59')](_0x3b6ae3[_0xb782('0x42')][_0xb782('0x43')]());if(_0xdb7352===_0xb782('0x5a')){_0x3cd7d0=_['union'](_0x3cd7d0,_0x3b6ae3['ids']);}else{if(_[_0xb782('0x41')](_0xdb7352,_0xb782('0x5b')))_0xdb7352=_0xdb7352[_0xb782('0x5c')](_0xb782('0x5b'),'Queue');_0x3b6ae3[_0xb782('0x5d')][_0xb782('0x50')](function(_0xc606c8){_0x514723[_0xb782('0x5e')](getAgents(_0xdb7352,_0xc606c8));});}});return BPromise[_0xb782('0x5f')](_0x514723)[_0xb782('0x27')](function(_0x659bc9){_0x3cd7d0=_[_0xb782('0x60')](_0x3cd7d0,_[_0xb782('0x61')](_0x659bc9));_0x5aaca4(_0x3cd7d0);})[_0xb782('0x54')](function(_0x178d76){_0x11596e(_0x178d76);});});}function getAgents(_0x2d80bf,_0x23ef15){return new BPromise(function(_0x443746,_0x2ac79d){return db[_0x2d80bf][_0xb782('0x56')]({'where':{'id':_0x23ef15}})['then'](function(_0x47a3fb){return _0x47a3fb[_0xb782('0x62')]({'attributes':['id'],'raw':!![]})[_0xb782('0x27')](function(_0x45021c){var _0x42dae2=_['map'](_0x45021c,'id');_0x443746(_0x42dae2);});})[_0xb782('0x54')](function(_0x4963c6){_0x2ac79d(_0x4963c6);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 4aece62..90bf127 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 _0xe8e3=['hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xe8e3,0x141));var _0x3e8e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe8e3[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x3e8e('0x0'));var UserNotification=require(_0x3e8e('0x1'))['db'][_0x3e8e('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3e8e('0x3')](0x0);var events={'afterCreate':_0x3e8e('0x4'),'afterUpdate':_0x3e8e('0x5'),'afterDestroy':_0x3e8e('0x6')};function emitEvent(_0x1cc26b){return function(_0x1f0e0a,_0xaba088,_0x559305){UserNotificationEvents[_0x3e8e('0x7')](_0x1cc26b+':'+_0x1f0e0a['id'],_0x1f0e0a);UserNotificationEvents['emit'](_0x1cc26b,_0x1f0e0a);_0x559305(null);};}for(var e in events){if(events[_0x3e8e('0x8')](e)){var event=events[e];UserNotification[_0x3e8e('0x9')](e,emitEvent(event));}}module[_0x3e8e('0xa')]=UserNotificationEvents; \ No newline at end of file +var _0x4787=['UserNotification','save','remove','emit','hasOwnProperty','hook'];(function(_0x1e7dcb,_0x2c58c7){var _0x5d3b2e=function(_0x3da63d){while(--_0x3da63d){_0x1e7dcb['push'](_0x1e7dcb['shift']());}};_0x5d3b2e(++_0x2c58c7);}(_0x4787,0x150));var _0x7478=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x4787[_0x3de8a4];return _0x4635cf;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x7478('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7478('0x1'),'afterUpdate':'update','afterDestroy':_0x7478('0x2')};function emitEvent(_0x11e111){return function(_0x3f27b2,_0x59d74b,_0x52febc){UserNotificationEvents['emit'](_0x11e111+':'+_0x3f27b2['id'],_0x3f27b2);UserNotificationEvents[_0x7478('0x3')](_0x11e111,_0x3f27b2);_0x52febc(null);};}for(var e in events){if(events[_0x7478('0x4')](e)){var event=events[e];UserNotification[_0x7478('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 047f416..c1e5238 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 _0x5c3e=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','UserNotification','userNotifications'];(function(_0x1679fa,_0x8df10d){var _0x22f72d=function(_0x2ae2c9){while(--_0x2ae2c9){_0x1679fa['push'](_0x1679fa['shift']());}};_0x22f72d(++_0x8df10d);}(_0x5c3e,0x152));var _0xe5c3=function(_0x5930f8,_0x28f13c){_0x5930f8=_0x5930f8-0x0;var _0x3ea2af=_0x5c3e[_0x5930f8];return _0x3ea2af;};'use strict';var _=require(_0xe5c3('0x0'));var util=require(_0xe5c3('0x1'));var logger=require(_0xe5c3('0x2'))(_0xe5c3('0x3'));var moment=require(_0xe5c3('0x4'));var BPromise=require(_0xe5c3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe5c3('0x6'));var config=require(_0xe5c3('0x7'));var attributes=require('./userNotification.attributes');module[_0xe5c3('0x8')]=function(_0x5257dd,_0x49b512){return _0x5257dd[_0xe5c3('0x9')](_0xe5c3('0xa'),attributes,{'tableName':_0xe5c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe5c3('0xc'),'collate':_0xe5c3('0xd')});}; \ No newline at end of file +var _0x9afa=['request-promise','../../config/environment','exports','define','UserNotification','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3163bd,_0x3a928b){var _0x447e8d=function(_0x251778){while(--_0x251778){_0x3163bd['push'](_0x3163bd['shift']());}};_0x447e8d(++_0x3a928b);}(_0x9afa,0x17c));var _0xa9af=function(_0x2dede0,_0xb4569f){_0x2dede0=_0x2dede0-0x0;var _0x542b49=_0x9afa[_0x2dede0];return _0x542b49;};'use strict';var _=require(_0xa9af('0x0'));var util=require(_0xa9af('0x1'));var logger=require(_0xa9af('0x2'))('api');var moment=require(_0xa9af('0x3'));var BPromise=require(_0xa9af('0x4'));var rp=require(_0xa9af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa9af('0x6'));var attributes=require('./userNotification.attributes');module[_0xa9af('0x7')]=function(_0xb5cc9d,_0x163096){return _0xb5cc9d[_0xa9af('0x8')](_0xa9af('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa9af('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 3d1f02a..d5bb93f 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 _0x4110=['error','code','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x4110,0xad));var _0x0411=function(_0x2d6a2a,_0x4d8c74){_0x2d6a2a=_0x2d6a2a-0x0;var _0x451d18=_0x4110[_0x2d6a2a];return _0x451d18;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0411('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0411('0x1'));var db=require(_0x0411('0x2'))['db'];var utils=require(_0x0411('0x3'));var logger=require(_0x0411('0x4'))('rpc');var config=require(_0x0411('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0411('0x6')][_0x0411('0x7')]({'port':0x232a});config[_0x0411('0x8')]=_[_0x0411('0x9')](config[_0x0411('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0411('0xa'))(new Redis(config[_0x0411('0x8')]));require(_0x0411('0xb'))[_0x0411('0xc')](socket);function respondWithRpcPromise(_0x322e12,_0x3c14bf,_0x1e08a4){return new BPromise(function(_0x198358,_0x15717e){return client[_0x0411('0xd')](_0x322e12,_0x1e08a4)[_0x0411('0xe')](function(_0x39f789){logger[_0x0411('0xf')](_0x0411('0x10'),_0x3c14bf,_0x0411('0x11'));logger[_0x0411('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x3c14bf,'request\x20sent',JSON['stringify'](_0x39f789));if(_0x39f789[_0x0411('0x13')]){if(_0x39f789[_0x0411('0x13')][_0x0411('0x14')]===0x1f4){logger[_0x0411('0x13')]('UserNotification,\x20%s,\x20%s',_0x3c14bf,_0x39f789[_0x0411('0x13')][_0x0411('0x15')]);return _0x15717e(_0x39f789['error']['message']);}logger[_0x0411('0x13')](_0x0411('0x10'),_0x3c14bf,_0x39f789['error']['message']);return _0x198358(_0x39f789['error'][_0x0411('0x15')]);}else{logger[_0x0411('0xf')](_0x0411('0x10'),_0x3c14bf,_0x0411('0x11'));_0x198358(_0x39f789[_0x0411('0x16')]['message']);}})[_0x0411('0x17')](function(_0x49103c){logger[_0x0411('0x13')]('UserNotification,\x20%s,\x20%s',_0x3c14bf,_0x49103c);_0x15717e(_0x49103c);});});} \ No newline at end of file +var _0x0d0c=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x31cc3e,_0x1f14d6){var _0x1728af=function(_0x287f55){while(--_0x287f55){_0x31cc3e['push'](_0x31cc3e['shift']());}};_0x1728af(++_0x1f14d6);}(_0x0d0c,0x136));var _0xc0d0=function(_0x21bbfe,_0x1aeb54){_0x21bbfe=_0x21bbfe-0x0;var _0x3834bb=_0x0d0c[_0x21bbfe];return _0x3834bb;};'use strict';var _=require('lodash');var util=require(_0xc0d0('0x0'));var moment=require('moment');var BPromise=require(_0xc0d0('0x1'));var rs=require(_0xc0d0('0x2'));var fs=require('fs');var Redis=require(_0xc0d0('0x3'));var db=require(_0xc0d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0d0('0x5'))(_0xc0d0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc0d0('0x7')][_0xc0d0('0x8')]({'port':0x232a});config[_0xc0d0('0x9')]=_[_0xc0d0('0xa')](config[_0xc0d0('0x9')],{'host':_0xc0d0('0xb'),'port':0x18eb});var socket=require(_0xc0d0('0xc'))(new Redis(config['redis']));require(_0xc0d0('0xd'))[_0xc0d0('0xe')](socket);function respondWithRpcPromise(_0x1bdf9f,_0x1ebf53,_0xb08cb){return new BPromise(function(_0x1c36ce,_0x1ef44d){return client[_0xc0d0('0xf')](_0x1bdf9f,_0xb08cb)['then'](function(_0x169ef9){logger[_0xc0d0('0x10')](_0xc0d0('0x11'),_0x1ebf53,'request\x20sent');logger[_0xc0d0('0x12')](_0xc0d0('0x13'),_0x1ebf53,'request\x20sent',JSON[_0xc0d0('0x14')](_0x169ef9));if(_0x169ef9['error']){if(_0x169ef9[_0xc0d0('0x15')][_0xc0d0('0x16')]===0x1f4){logger['error'](_0xc0d0('0x11'),_0x1ebf53,_0x169ef9[_0xc0d0('0x15')][_0xc0d0('0x17')]);return _0x1ef44d(_0x169ef9[_0xc0d0('0x15')][_0xc0d0('0x17')]);}logger[_0xc0d0('0x15')](_0xc0d0('0x11'),_0x1ebf53,_0x169ef9[_0xc0d0('0x15')][_0xc0d0('0x17')]);return _0x1c36ce(_0x169ef9['error'][_0xc0d0('0x17')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x1ebf53,'request\x20sent');_0x1c36ce(_0x169ef9[_0xc0d0('0x18')]['message']);}})[_0xc0d0('0x19')](function(_0x53eb11){logger['error']('UserNotification,\x20%s,\x20%s',_0x1ebf53,_0x53eb11);_0x1ef44d(_0x53eb11);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index a918c51..4585744 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 _0xa099=['userNotification:','save','remove','update','removeListener','register','length'];(function(_0x53ef01,_0x3b4bc8){var _0x270706=function(_0x3e800a){while(--_0x3e800a){_0x53ef01['push'](_0x53ef01['shift']());}};_0x270706(++_0x3b4bc8);}(_0xa099,0xc5));var _0x9a09=function(_0x5d1636,_0x5034d7){_0x5d1636=_0x5d1636-0x0;var _0x3dc4ed=_0xa099[_0x5d1636];return _0x3dc4ed;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x9a09('0x0'),_0x9a09('0x1'),_0x9a09('0x2')];function createListener(_0x603c2a,_0x44a3e6){return function(_0x270e7c){_0x44a3e6['emit'](_0x603c2a,_0x270e7c);};}function removeListener(_0x35b8d6,_0xc9d687){return function(){UserNotificationEvents[_0x9a09('0x3')](_0x35b8d6,_0xc9d687);};}exports[_0x9a09('0x4')]=function(_0x2e323f){for(var _0x3a0de2=0x0,_0xc2c742=events[_0x9a09('0x5')];_0x3a0de2<_0xc2c742;_0x3a0de2++){var _0x3531f8=events[_0x3a0de2];var _0xe0adc0=createListener(_0x9a09('0x6')+_0x3531f8,_0x2e323f);UserNotificationEvents['on'](_0x3531f8,_0xe0adc0);}}; \ No newline at end of file +var _0x732a=['remove','emit','removeListener','register','length','userNotification:'];(function(_0xc14024,_0x1945ef){var _0x59b3f2=function(_0x18717e){while(--_0x18717e){_0xc14024['push'](_0xc14024['shift']());}};_0x59b3f2(++_0x1945ef);}(_0x732a,0x198));var _0xa732=function(_0x5ce7e2,_0x8dd5de){_0x5ce7e2=_0x5ce7e2-0x0;var _0x5224d1=_0x732a[_0x5ce7e2];return _0x5224d1;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0xa732('0x0'),'update'];function createListener(_0x4acac7,_0xd2ee41){return function(_0x9047d9){_0xd2ee41[_0xa732('0x1')](_0x4acac7,_0x9047d9);};}function removeListener(_0x4657c7,_0x2b28b2){return function(){UserNotificationEvents[_0xa732('0x2')](_0x4657c7,_0x2b28b2);};}exports[_0xa732('0x3')]=function(_0x4d2479){for(var _0x1868ee=0x0,_0x574350=events[_0xa732('0x4')];_0x1868ee<_0x574350;_0x1868ee++){var _0x3123a1=events[_0x1868ee];var _0x34a39a=createListener(_0xa732('0x5')+_0x3123a1,_0x4d2479);UserNotificationEvents['on'](_0x3123a1,_0x34a39a);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 22d1cfa..79a66da 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x322743,_0x3903b9){var _0x13de4d=function(_0x13a597){while(--_0x13a597){_0x322743['push'](_0x322743['shift']());}};_0x13de4d(++_0x3903b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('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 8245b2b..2133f2d 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 _0x1b3b=['exports','INTEGER'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x1b3b,0x1be));var _0xb1b3=function(_0x15da6d,_0x3f7b83){_0x15da6d=_0x15da6d-0x0;var _0x4535ac=_0x1b3b[_0x15da6d];return _0x4535ac;};'use strict';var Sequelize=require('sequelize');module[_0xb1b3('0x0')]={'penalty':{'type':Sequelize[_0xb1b3('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc4e=['INTEGER'];(function(_0xe3badc,_0x58f0a3){var _0x9c8a0d=function(_0xc94ecf){while(--_0xc94ecf){_0xe3badc['push'](_0xe3badc['shift']());}};_0x9c8a0d(++_0x58f0a3);}(_0xcc4e,0x174));var _0xecc4=function(_0x5a7648,_0x351abd){_0x5a7648=_0x5a7648-0x0;var _0xab376f=_0xcc4e[_0x5a7648];return _0xab376f;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xecc4('0x0')],'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 a93f867..a3535b5 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 _0x9746=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x25c9b7,_0x9e3bd){var _0x2e541b=function(_0x5318f0){while(--_0x5318f0){_0x25c9b7['push'](_0x25c9b7['shift']());}};_0x2e541b(++_0x9e3bd);}(_0x9746,0xbb));var _0x6974=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x9746[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require('lodash');var util=require(_0x6974('0x0'));var logger=require(_0x6974('0x1'))('api');var moment=require(_0x6974('0x2'));var BPromise=require(_0x6974('0x3'));var rp=require(_0x6974('0x4'));var fs=require('fs');var path=require(_0x6974('0x5'));var rimraf=require(_0x6974('0x6'));var config=require(_0x6974('0x7'));var attributes=require(_0x6974('0x8'));module[_0x6974('0x9')]=function(_0xa2bfdb,_0x423848){return _0xa2bfdb['define'](_0x6974('0xa'),attributes,{'tableName':_0x6974('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6d0=['request-promise','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','util','../../config/logger','api','moment'];(function(_0x51cfc5,_0x46e1d0){var _0x567d00=function(_0x204747){while(--_0x204747){_0x51cfc5['push'](_0x51cfc5['shift']());}};_0x567d00(++_0x46e1d0);}(_0xf6d0,0x1d2));var _0x0f6d=function(_0x10f1e8,_0x2d04f3){_0x10f1e8=_0x10f1e8-0x0;var _0x190539=_0xf6d0[_0x10f1e8];return _0x190539;};'use strict';var _=require('lodash');var util=require(_0x0f6d('0x0'));var logger=require(_0x0f6d('0x1'))(_0x0f6d('0x2'));var moment=require(_0x0f6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x0f6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f6d('0x5'));var config=require('../../config/environment');var attributes=require(_0x0f6d('0x6'));module[_0x0f6d('0x7')]=function(_0x59280b,_0x2afd5e){return _0x59280b[_0x0f6d('0x8')](_0x0f6d('0x9'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index bda930a..4e89eca 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 _0x6f12=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3755a2,_0x5be61e){var _0x2df8e4=function(_0x316bae){while(--_0x316bae){_0x3755a2['push'](_0x3755a2['shift']());}};_0x2df8e4(++_0x5be61e);}(_0x6f12,0x11d));var _0x26f1=function(_0x1c7502,_0xf4952b){_0x1c7502=_0x1c7502-0x0;var _0x2de29d=_0x6f12[_0x1c7502];return _0x2de29d;};'use strict';var _=require(_0x26f1('0x0'));var util=require(_0x26f1('0x1'));var moment=require(_0x26f1('0x2'));var BPromise=require(_0x26f1('0x3'));var rs=require(_0x26f1('0x4'));var fs=require('fs');var Redis=require(_0x26f1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x26f1('0x6'));var logger=require(_0x26f1('0x7'))(_0x26f1('0x8'));var config=require('../../config/environment');var jayson=require(_0x26f1('0x9'));var client=jayson[_0x26f1('0xa')][_0x26f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d6445,_0x2998de,_0x2cd814){return new BPromise(function(_0x18c34c,_0x289381){return client[_0x26f1('0xc')](_0x1d6445,_0x2cd814)[_0x26f1('0xd')](function(_0x116f72){logger[_0x26f1('0xe')](_0x26f1('0xf'),_0x2998de,_0x26f1('0x10'));logger[_0x26f1('0x11')](_0x26f1('0x12'),_0x2998de,_0x26f1('0x10'),JSON[_0x26f1('0x13')](_0x116f72));if(_0x116f72[_0x26f1('0x14')]){if(_0x116f72['error'][_0x26f1('0x15')]===0x1f4){logger[_0x26f1('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2998de,_0x116f72['error'][_0x26f1('0x16')]);return _0x289381(_0x116f72[_0x26f1('0x14')][_0x26f1('0x16')]);}logger['error'](_0x26f1('0xf'),_0x2998de,_0x116f72['error'][_0x26f1('0x16')]);return _0x18c34c(_0x116f72[_0x26f1('0x14')][_0x26f1('0x16')]);}else{logger[_0x26f1('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2998de,_0x26f1('0x10'));_0x18c34c(_0x116f72[_0x26f1('0x17')][_0x26f1('0x16')]);}})[_0x26f1('0x18')](function(_0x5a24c6){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2998de,_0x5a24c6);_0x289381(_0x5a24c6);});});} \ No newline at end of file +var _0x0550=['client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x3b826d,_0x1d0b68){var _0x38e1b3=function(_0x314620){while(--_0x314620){_0x3b826d['push'](_0x3b826d['shift']());}};_0x38e1b3(++_0x1d0b68);}(_0x0550,0x109));var _0x0055=function(_0x5cb6f3,_0x4085bc){_0x5cb6f3=_0x5cb6f3-0x0;var _0x225ffe=_0x0550[_0x5cb6f3];return _0x225ffe;};'use strict';var _=require(_0x0055('0x0'));var util=require('util');var moment=require(_0x0055('0x1'));var BPromise=require(_0x0055('0x2'));var rs=require(_0x0055('0x3'));var fs=require('fs');var Redis=require(_0x0055('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0055('0x5'));var logger=require('../../config/logger')(_0x0055('0x6'));var config=require(_0x0055('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0055('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x413758,_0x28a816,_0x43f3cf){return new BPromise(function(_0x517230,_0xe63b54){return client[_0x0055('0x9')](_0x413758,_0x43f3cf)['then'](function(_0x244f86){logger[_0x0055('0xa')](_0x0055('0xb'),_0x28a816,'request\x20sent');logger[_0x0055('0xc')](_0x0055('0xd'),_0x28a816,'request\x20sent',JSON[_0x0055('0xe')](_0x244f86));if(_0x244f86['error']){if(_0x244f86[_0x0055('0xf')][_0x0055('0x10')]===0x1f4){logger[_0x0055('0xf')](_0x0055('0xb'),_0x28a816,_0x244f86[_0x0055('0xf')][_0x0055('0x11')]);return _0xe63b54(_0x244f86[_0x0055('0xf')][_0x0055('0x11')]);}logger['error'](_0x0055('0xb'),_0x28a816,_0x244f86[_0x0055('0xf')][_0x0055('0x11')]);return _0x517230(_0x244f86[_0x0055('0xf')][_0x0055('0x11')]);}else{logger[_0x0055('0xa')](_0x0055('0xb'),_0x28a816,_0x0055('0x12'));_0x517230(_0x244f86[_0x0055('0x13')][_0x0055('0x11')]);}})[_0x0055('0x14')](function(_0x120a90){logger[_0x0055('0xf')](_0x0055('0xb'),_0x28a816,_0x120a90);_0xe63b54(_0x120a90);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b1a99a9..f4791a8 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 _0x3077=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','create','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','util','path','connect-timeout','express','Router'];(function(_0x22c250,_0x4fbc3c){var _0x249589=function(_0x4ec136){while(--_0x4ec136){_0x22c250['push'](_0x22c250['shift']());}};_0x249589(++_0x4fbc3c);}(_0x3077,0xeb));var _0x7307=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x3077[_0x3054be];return _0x3df150;};'use strict';var multer=require('multer');var util=require(_0x7307('0x0'));var path=require(_0x7307('0x1'));var timeout=require(_0x7307('0x2'));var express=require(_0x7307('0x3'));var router=express[_0x7307('0x4')]();var fs_extra=require(_0x7307('0x5'));var auth=require(_0x7307('0x6'));var interaction=require(_0x7307('0x7'));var config=require(_0x7307('0x8'));var controller=require('./userProfile.controller');router['get']('/',auth[_0x7307('0x9')](),controller[_0x7307('0xa')]);router[_0x7307('0xb')](_0x7307('0xc'),auth[_0x7307('0x9')](),controller['describe']);router[_0x7307('0xb')](_0x7307('0xd'),auth[_0x7307('0x9')](),controller[_0x7307('0xe')]);router[_0x7307('0xb')](_0x7307('0xf'),auth['isAuthenticated'](),controller[_0x7307('0x10')]);router[_0x7307('0xb')](_0x7307('0x11'),auth[_0x7307('0x9')](),controller[_0x7307('0x12')]);router['post']('/',auth[_0x7307('0x9')](),controller[_0x7307('0x13')]);router['post'](_0x7307('0x14'),auth[_0x7307('0x9')](),controller[_0x7307('0x15')]);router['post'](_0x7307('0xf'),auth[_0x7307('0x9')](),controller[_0x7307('0x16')]);router['post'](_0x7307('0x11'),auth[_0x7307('0x9')](),controller[_0x7307('0x17')]);router[_0x7307('0x18')](_0x7307('0xd'),auth['isAuthenticated'](),controller[_0x7307('0x19')]);router[_0x7307('0x1a')](_0x7307('0xd'),auth[_0x7307('0x9')](),controller[_0x7307('0x1b')]);router[_0x7307('0x1a')](_0x7307('0xf'),auth[_0x7307('0x9')](),controller[_0x7307('0x1c')]);router[_0x7307('0x1a')]('/:id/resources',auth[_0x7307('0x9')](),controller['removeResources']);module[_0x7307('0x1d')]=router; \ No newline at end of file +var _0xc9d4=['/:id','show','/:id/sections','getSections','/:id/resources','create','post','/:id/clone','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x408560,_0x413b7f){var _0x3d8b31=function(_0x471c40){while(--_0x471c40){_0x408560['push'](_0x408560['shift']());}};_0x3d8b31(++_0x413b7f);}(_0xc9d4,0xf0));var _0x4c9d=function(_0x702cb,_0x1d2834){_0x702cb=_0x702cb-0x0;var _0x3131ca=_0xc9d4[_0x702cb];return _0x3131ca;};'use strict';var multer=require(_0x4c9d('0x0'));var util=require(_0x4c9d('0x1'));var path=require(_0x4c9d('0x2'));var timeout=require(_0x4c9d('0x3'));var express=require(_0x4c9d('0x4'));var router=express[_0x4c9d('0x5')]();var fs_extra=require(_0x4c9d('0x6'));var auth=require(_0x4c9d('0x7'));var interaction=require(_0x4c9d('0x8'));var config=require(_0x4c9d('0x9'));var controller=require(_0x4c9d('0xa'));router[_0x4c9d('0xb')]('/',auth[_0x4c9d('0xc')](),controller[_0x4c9d('0xd')]);router[_0x4c9d('0xb')](_0x4c9d('0xe'),auth['isAuthenticated'](),controller[_0x4c9d('0xf')]);router['get'](_0x4c9d('0x10'),auth[_0x4c9d('0xc')](),controller[_0x4c9d('0x11')]);router[_0x4c9d('0xb')](_0x4c9d('0x12'),auth[_0x4c9d('0xc')](),controller[_0x4c9d('0x13')]);router[_0x4c9d('0xb')](_0x4c9d('0x14'),auth[_0x4c9d('0xc')](),controller['getResources']);router['post']('/',auth[_0x4c9d('0xc')](),controller[_0x4c9d('0x15')]);router[_0x4c9d('0x16')](_0x4c9d('0x17'),auth[_0x4c9d('0xc')](),controller['clone']);router[_0x4c9d('0x16')](_0x4c9d('0x12'),auth['isAuthenticated'](),controller['addSections']);router[_0x4c9d('0x16')](_0x4c9d('0x14'),auth[_0x4c9d('0xc')](),controller[_0x4c9d('0x18')]);router[_0x4c9d('0x19')](_0x4c9d('0x10'),auth['isAuthenticated'](),controller[_0x4c9d('0x1a')]);router[_0x4c9d('0x1b')](_0x4c9d('0x10'),auth[_0x4c9d('0xc')](),controller[_0x4c9d('0x1c')]);router[_0x4c9d('0x1b')](_0x4c9d('0x12'),auth['isAuthenticated'](),controller[_0x4c9d('0x1d')]);router[_0x4c9d('0x1b')]('/:id/resources',auth[_0x4c9d('0xc')](),controller[_0x4c9d('0x1e')]);module[_0x4c9d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 55e649e..5cc8735 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 _0x3fef=['getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','setDataValue','join'];(function(_0x264f25,_0x13641f){var _0x6e977b=function(_0x5dc8c2){while(--_0x5dc8c2){_0x264f25['push'](_0x264f25['shift']());}};_0x6e977b(++_0x13641f);}(_0x3fef,0xf7));var _0xf3fe=function(_0x4f37a9,_0x5ab8a2){_0x4f37a9=_0x4f37a9-0x0;var _0x5ae200=_0x3fef[_0x4f37a9];return _0x5ae200;};'use strict';var Sequelize=require(_0xf3fe('0x0'));module[_0xf3fe('0x1')]={'name':{'type':Sequelize[_0xf3fe('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5de108){this[_0xf3fe('0x3')]('crudPermissions',_0x5de108?_0x5de108[_0xf3fe('0x4')](''):[]);},'get':function(){return this[_0xf3fe('0x5')](_0xf3fe('0x6'))?this[_0xf3fe('0x5')](_0xf3fe('0x6'))[_0xf3fe('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf3fe('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf3fe('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa0b8=['exports','STRING','name','setDataValue','getDataValue','crudPermissions','split','BOOLEAN','sequelize'];(function(_0x2f48d4,_0x29b0fd){var _0x515c6f=function(_0x4b71c9){while(--_0x4b71c9){_0x2f48d4['push'](_0x2f48d4['shift']());}};_0x515c6f(++_0x29b0fd);}(_0xa0b8,0xe9));var _0x8a0b=function(_0x399849,_0x3b630d){_0x399849=_0x399849-0x0;var _0xfbb04=_0xa0b8[_0x399849];return _0xfbb04;};'use strict';var Sequelize=require(_0x8a0b('0x0'));module[_0x8a0b('0x1')]={'name':{'type':Sequelize[_0x8a0b('0x2')],'allowNull':![],'unique':_0x8a0b('0x3')},'crudPermissions':{'type':Sequelize[_0x8a0b('0x2')],'set':function(_0x29d99d){this[_0x8a0b('0x4')]('crudPermissions',_0x29d99d?_0x29d99d['join'](''):[]);},'get':function(){return this[_0x8a0b('0x5')](_0x8a0b('0x6'))?this[_0x8a0b('0x5')]('crudPermissions')[_0x8a0b('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8a0b('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8a0b('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8a0b('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8a0b('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8a0b('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8a0b('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8a0b('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 723180a..42763f1 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 _0xe98f=['eml-format','zip-dir','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','catch','create','clone','options','get','createdAt','body','omit','updatedAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','find','describe','addSections','transaction','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20'];(function(_0x3b9ec3,_0x618415){var _0x19a554=function(_0x20bdc4){while(--_0x20bdc4){_0x3b9ec3['push'](_0x3b9ec3['shift']());}};_0x19a554(++_0x618415);}(_0xe98f,0xde));var _0xfe98=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe98f[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xfe98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe98('0x2'));var moment=require(_0xfe98('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe98('0x4'));var path=require('path');var sox=require(_0xfe98('0x5'));var csv=require(_0xfe98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe98('0x7'));var _=require('lodash');var squel=require(_0xfe98('0x8'));var crypto=require(_0xfe98('0x9'));var jsforce=require(_0xfe98('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfe98('0x6'));var querystring=require(_0xfe98('0xb'));var Papa=require('papaparse');var Redis=require(_0xfe98('0xc'));var authService=require(_0xfe98('0xd'));var qs=require(_0xfe98('0xe'));var as=require(_0xfe98('0xf'));var hardwareService=require(_0xfe98('0x10'));var logger=require(_0xfe98('0x11'))('api');var utils=require(_0xfe98('0x12'));var config=require(_0xfe98('0x13'));var licenseUtil=require(_0xfe98('0x14'));var db=require(_0xfe98('0x15'))['db'];config[_0xfe98('0x16')]=_['defaults'](config[_0xfe98('0x16')],{'host':_0xfe98('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe98('0x16')]));require('./userProfile.socket')[_0xfe98('0x18')](socket);function respondWithStatusCode(_0x3386de,_0x1b2155){_0x1b2155=_0x1b2155||0xcc;return function(_0x15e6b7){if(_0x15e6b7){return _0x3386de['sendStatus'](_0x1b2155);}return _0x3386de[_0xfe98('0x19')](_0x1b2155)['end']();};}function respondWithResult(_0x416c4c,_0x8c527c){_0x8c527c=_0x8c527c||0xc8;return function(_0x20d565){if(_0x20d565){return _0x416c4c[_0xfe98('0x19')](_0x8c527c)['json'](_0x20d565);}};}function respondWithFilteredResult(_0x56c0f4,_0x41dca9){return function(_0x26ad78){if(_0x26ad78){var _0x31bb37=typeof _0x41dca9['offset']===_0xfe98('0x1a')&&typeof _0x41dca9[_0xfe98('0x1b')]===_0xfe98('0x1a');var _0x40f0b1=_0x26ad78[_0xfe98('0x1c')];var _0x6d2220=_0x31bb37?0x0:_0x41dca9[_0xfe98('0x1d')];var _0x5cbdb0=_0x31bb37?_0x26ad78[_0xfe98('0x1c')]:_0x41dca9['offset']+_0x41dca9[_0xfe98('0x1b')];var _0x51d257;if(_0x5cbdb0>=_0x40f0b1){_0x5cbdb0=_0x40f0b1;_0x51d257=0xc8;}else{_0x51d257=0xce;}_0x56c0f4['status'](_0x51d257);return _0x56c0f4[_0xfe98('0x1e')](_0xfe98('0x1f'),_0x6d2220+'-'+_0x5cbdb0+'/'+_0x40f0b1)[_0xfe98('0x20')](_0x26ad78);}return null;};}function patchUpdates(_0xc3c06a){return function(_0x59e3ff){try{jsonpatch[_0xfe98('0x21')](_0x59e3ff,_0xc3c06a,!![]);}catch(_0x4b808c){return BPromise[_0xfe98('0x22')](_0x4b808c);}return _0x59e3ff[_0xfe98('0x23')]();};}function saveUpdates(_0xb628ed,_0x59fbde){return function(_0x52a381){if(_0x52a381){return _0x52a381[_0xfe98('0x24')](_0xb628ed)['then'](function(_0x7b629e){return _0x7b629e;});}return null;};}function removeEntity(_0x2c9323,_0x4d17b7){return function(_0x3dc31d){if(_0x3dc31d){return _0x3dc31d[_0xfe98('0x25')]()[_0xfe98('0x26')](function(){_0x2c9323[_0xfe98('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e40f0,_0x5921f0){return function(_0x51da63){if(!_0x51da63){_0x4e40f0[_0xfe98('0x27')](0x194);}return _0x51da63;};}function handleError(_0x221d7c,_0x3e8723){_0x3e8723=_0x3e8723||0x1f4;return function(_0x21c730){logger[_0xfe98('0x28')](_0x21c730[_0xfe98('0x29')]);if(_0x21c730[_0xfe98('0x2a')]){delete _0x21c730[_0xfe98('0x2a')];}_0x221d7c[_0xfe98('0x19')](_0x3e8723)[_0xfe98('0x2b')](_0x21c730);};}exports['index']=function(_0x1bed97,_0x1c56e5){var _0x9eb9c9={},_0x4507be={},_0x3094df={'count':0x0,'rows':[]};var _0x20ae5d=_[_0xfe98('0x2c')](db[_0xfe98('0x2d')][_0xfe98('0x2e')],function(_0xaf782){return{'name':_0xaf782[_0xfe98('0x2f')],'type':_0xaf782[_0xfe98('0x30')][_0xfe98('0x31')]};});_0x4507be[_0xfe98('0x32')]=_[_0xfe98('0x2c')](_0x20ae5d,'name');_0x4507be['query']=_[_0xfe98('0x33')](_0x1bed97[_0xfe98('0x34')]);_0x4507be['filters']=_[_0xfe98('0x35')](_0x4507be[_0xfe98('0x32')],_0x4507be[_0xfe98('0x34')]);_0x9eb9c9[_0xfe98('0x36')]=_[_0xfe98('0x35')](_0x4507be['model'],qs[_0xfe98('0x37')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x37')]));_0x9eb9c9[_0xfe98('0x36')]=_0x9eb9c9[_0xfe98('0x36')]['length']?_0x9eb9c9[_0xfe98('0x36')]:_0x4507be['model'];if(!_0x1bed97[_0xfe98('0x34')][_0xfe98('0x38')](_0xfe98('0x39'))){_0x9eb9c9[_0xfe98('0x1b')]=qs[_0xfe98('0x1b')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x1b')]);_0x9eb9c9[_0xfe98('0x1d')]=qs['offset'](_0x1bed97['query'][_0xfe98('0x1d')]);}_0x9eb9c9[_0xfe98('0x3a')]=qs[_0xfe98('0x3b')](_0x1bed97[_0xfe98('0x34')][_0xfe98('0x3b')]);_0x9eb9c9['where']=qs[_0xfe98('0x3c')](_[_0xfe98('0x3d')](_0x1bed97[_0xfe98('0x34')],_0x4507be['filters']),_0x20ae5d);if(_0x1bed97[_0xfe98('0x34')][_0xfe98('0x3e')]){_0x9eb9c9[_0xfe98('0x3f')]=_[_0xfe98('0x40')](_0x9eb9c9['where'],{'$or':_[_0xfe98('0x2c')](_0x20ae5d,function(_0x3abd5d){if(_0x3abd5d['type']!==_0xfe98('0x41')){var _0x14afbc={};_0x14afbc[_0x3abd5d[_0xfe98('0x2a')]]={'$like':'%'+_0x1bed97['query']['filter']+'%'};return _0x14afbc;}})});}_0x9eb9c9=_['merge']({},_0x9eb9c9,_0x1bed97['options']);var _0x2b796a={'where':_0x9eb9c9['where']};return db[_0xfe98('0x2d')][_0xfe98('0x1c')](_0x2b796a)['then'](function(_0x43b085){_0x3094df[_0xfe98('0x1c')]=_0x43b085;if(_0x1bed97[_0xfe98('0x34')][_0xfe98('0x42')]){_0x9eb9c9[_0xfe98('0x43')]=[{'all':!![]}];}return db[_0xfe98('0x2d')][_0xfe98('0x44')](_0x9eb9c9);})[_0xfe98('0x26')](function(_0x5dae05){_0x3094df[_0xfe98('0x45')]=_0x5dae05;return _0x3094df;})[_0xfe98('0x26')](respondWithFilteredResult(_0x1c56e5,_0x9eb9c9))['catch'](handleError(_0x1c56e5,null));};exports[_0xfe98('0x46')]=function(_0xd2cc2e,_0x575ff3){var _0x36643c={'raw':![],'where':{'id':_0xd2cc2e[_0xfe98('0x47')]['id']}},_0x50ccd7={};_0x50ccd7['model']=_[_0xfe98('0x33')](db[_0xfe98('0x2d')][_0xfe98('0x2e')]);_0x50ccd7[_0xfe98('0x34')]=_['keys'](_0xd2cc2e[_0xfe98('0x34')]);_0x50ccd7[_0xfe98('0x3c')]=_[_0xfe98('0x35')](_0x50ccd7[_0xfe98('0x32')],_0x50ccd7[_0xfe98('0x34')]);_0x36643c[_0xfe98('0x36')]=_['intersection'](_0x50ccd7[_0xfe98('0x32')],qs[_0xfe98('0x37')](_0xd2cc2e[_0xfe98('0x34')][_0xfe98('0x37')]));_0x36643c[_0xfe98('0x36')]=_0x36643c[_0xfe98('0x36')][_0xfe98('0x48')]?_0x36643c['attributes']:_0x50ccd7[_0xfe98('0x32')];if(_0xd2cc2e[_0xfe98('0x34')][_0xfe98('0x42')]){_0x36643c[_0xfe98('0x43')]=[{'all':!![]}];}_0x36643c=_[_0xfe98('0x40')]({},_0x36643c,_0xd2cc2e['options']);return db[_0xfe98('0x2d')]['find'](_0x36643c)[_0xfe98('0x26')](handleEntityNotFound(_0x575ff3,null))[_0xfe98('0x26')](respondWithResult(_0x575ff3,null))[_0xfe98('0x49')](handleError(_0x575ff3,null));};exports[_0xfe98('0x4a')]=function(_0x27b100,_0x475394){return db[_0xfe98('0x2d')][_0xfe98('0x4a')](_0x27b100['body'],{})[_0xfe98('0x26')](respondWithResult(_0x475394,0xc9))[_0xfe98('0x49')](handleError(_0x475394,null));};exports[_0xfe98('0x4b')]=function(_0x1720d3,_0x5ad61e){var _0x26cb3d={'where':{'id':_0x1720d3[_0xfe98('0x47')]['id']}},_0xc0573c={};_0xc0573c[_0xfe98('0x32')]=_[_0xfe98('0x33')](db[_0xfe98('0x2d')]['rawAttributes']);_0x26cb3d[_0xfe98('0x36')]=_[_0xfe98('0x35')](_0xc0573c[_0xfe98('0x32')],qs[_0xfe98('0x37')](_0x1720d3[_0xfe98('0x34')]['fields']));_0x26cb3d['attributes']=_0x26cb3d[_0xfe98('0x36')][_0xfe98('0x48')]?_0x26cb3d[_0xfe98('0x36')]:_0xc0573c[_0xfe98('0x32')];if(_0x1720d3[_0xfe98('0x34')][_0xfe98('0x42')]){_0x26cb3d[_0xfe98('0x43')]=[{'all':!![]}];}_0x26cb3d=_[_0xfe98('0x40')]({},_0x26cb3d,_0x1720d3[_0xfe98('0x4c')]);return db[_0xfe98('0x2d')]['find'](_0x26cb3d)[_0xfe98('0x26')](handleEntityNotFound(_0x5ad61e,null))['then'](function(_0x29eff4){if(_0x29eff4){var _0x278839=_0x29eff4[_0xfe98('0x4d')]({'plain':!![]});_0x278839=qs['omit'](_0x278839,['id',_0xfe98('0x4e'),'updatedAt','crudPermissions']);_0x1720d3[_0xfe98('0x4f')]=_[_0xfe98('0x50')](_0x1720d3[_0xfe98('0x4f')],['id',_0xfe98('0x4e'),_0xfe98('0x51')]);return db[_0xfe98('0x52')]['transaction'](function(_0x23e897){return db['UserProfile'][_0xfe98('0x4a')](_['merge'](_0x278839,_0x1720d3['body']),{'include':_0x1720d3['query'][_0xfe98('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x23e897})[_0xfe98('0x26')](function(_0x2b50c8){var _0x448025=_0x2b50c8['get']({'plain':!![]});return db[_0xfe98('0x53')]['findAll']({'where':{'userProfileId':_0x1720d3[_0xfe98('0x47')]['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x5b2132){if(_0x5b2132){return BPromise[_0xfe98('0x54')](_0x5b2132,function(_0x6299e9){return new BPromise(function(_0xc2cc1b,_0x4753d2){if(_0x6299e9['autoAssociation']===null||_0x6299e9[_0xfe98('0x55')]===0x1)_0xc2cc1b(null);return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x6299e9['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x4ab9c4){var _0x4192e0=_['map'](_0x4ab9c4,function(_0x7ca5b9){return qs[_0xfe98('0x50')](_0x7ca5b9,['id',_0xfe98('0x4e'),_0xfe98('0x51'),_0xfe98('0x57')]);});_0xc2cc1b(_0x4192e0);})[_0xfe98('0x49')](function(_0x4435d1){_0x4753d2(_0x4435d1);});})[_0xfe98('0x26')](function(_0x36a92f){var _0x3b8626=qs[_0xfe98('0x50')](_0x6299e9,['id',_0xfe98('0x4e'),_0xfe98('0x51')]);_0x3b8626['userProfileId']=_0x448025['id'];if(_0x36a92f)_0x3b8626[_0xfe98('0x58')]=_0x36a92f;return _0x3b8626;})['then'](function(_0x52befb){return db[_0xfe98('0x53')]['create'](_0x52befb,{'include':[{'model':db[_0xfe98('0x56')],'as':_0xfe98('0x58')}],'raw':!![],'transaction':_0x23e897});});})[_0xfe98('0x26')](function(){return _0x448025;});}});});});}})[_0xfe98('0x26')](respondWithResult(_0x5ad61e,0xc9))[_0xfe98('0x49')](handleError(_0x5ad61e,null));};exports[_0xfe98('0x24')]=function(_0x46a8fb,_0x1b5436){if(_0x46a8fb[_0xfe98('0x4f')]['id']){delete _0x46a8fb[_0xfe98('0x4f')]['id'];}return db[_0xfe98('0x2d')]['find']({'where':{'id':_0x46a8fb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x1b5436,null))[_0xfe98('0x26')](saveUpdates(_0x46a8fb[_0xfe98('0x4f')],null))[_0xfe98('0x26')](respondWithResult(_0x1b5436,null))['catch'](handleError(_0x1b5436,null));};exports[_0xfe98('0x25')]=function(_0xaa3d51,_0x2b827d){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0xaa3d51[_0xfe98('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b827d,null))[_0xfe98('0x26')](removeEntity(_0x2b827d,null))[_0xfe98('0x49')](handleError(_0x2b827d,null));};exports[_0xfe98('0x5a')]=function(_0x363584,_0x2d195e){return db[_0xfe98('0x2d')][_0xfe98('0x5a')]()['then'](respondWithResult(_0x2d195e,null))[_0xfe98('0x49')](handleError(_0x2d195e,null));};exports[_0xfe98('0x5b')]=function(_0x1ecaeb,_0x351129){var _0x3d9113=_0x1ecaeb[_0xfe98('0x4f')];return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x1ecaeb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x351129,null))[_0xfe98('0x26')](function(_0x2516e5){if(_0x2516e5){return db[_0xfe98('0x52')][_0xfe98('0x5c')](function(_0x1f0bc3){return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x1ecaeb[_0xfe98('0x47')]['id'],'sectionId':_[_0xfe98('0x2c')](_0x3d9113,function(_0x3c14d9){return _0x3c14d9[_0xfe98('0x57')];})},'transaction':_0x1f0bc3})[_0xfe98('0x26')](function(){var _0x25c207=_[_0xfe98('0x2c')](_0x3d9113,function(_0xa5c1a7){_0xa5c1a7[_0xfe98('0x5d')]=_0x1ecaeb[_0xfe98('0x47')]['id'];return _0xa5c1a7;});var _0x59bcb0=[];return BPromise['each'](_0x25c207,function(_0x2683f2){return db[_0xfe98('0x53')][_0xfe98('0x4a')](_0x2683f2,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x1f0bc3})[_0xfe98('0x26')](function(_0x539e83){_0x59bcb0[_0xfe98('0x5e')](_0x539e83[_0xfe98('0x4d')]({'plain':!![]}));});})['then'](function(){return _0x59bcb0;});});});}})[_0xfe98('0x26')](function(_0x4418e8){return _0x4418e8;})[_0xfe98('0x26')](respondWithResult(_0x351129,null))[_0xfe98('0x49')](handleError(_0x351129,null));};exports[_0xfe98('0x5f')]=function(_0x308b99,_0x271c09){var _0xc89e3a;return db[_0xfe98('0x2d')]['find']({'where':{'id':_0x308b99[_0xfe98('0x47')]['id']},'attributes':['id','name']})[_0xfe98('0x26')](handleEntityNotFound(_0x271c09,null))[_0xfe98('0x26')](function(_0x2bd663){if(_0x2bd663){_0xc89e3a=_0x2bd663;return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x308b99[_0xfe98('0x47')]['id'],'sectionId':_0x308b99[_0xfe98('0x34')][_0xfe98('0x60')]}});}})[_0xfe98('0x26')](function(){return _0xc89e3a;})[_0xfe98('0x26')](respondWithStatusCode(_0x271c09,null))[_0xfe98('0x49')](handleError(_0x271c09,null));};exports[_0xfe98('0x61')]=function(_0x471499,_0x5c8015){var _0x4b5be5=[];var _0x454a42=[];return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x471499[_0xfe98('0x47')]['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x1921b4){_0x4b5be5=_[_0xfe98('0x3e')](_0x1921b4,function(_0x1b97bb){return _0x1b97bb[_0xfe98('0x62')]===0x1||_[_0xfe98('0x63')]([0x3eb,0x709],_0x1b97bb[_0xfe98('0x57')]);});if(!_[_0xfe98('0x64')](_0x4b5be5)){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x27f70e){return _0x27f70e[_0xfe98('0x57')];});}else{return;}})[_0xfe98('0x26')](function(_0x57756e){if(_0x57756e)_0x454a42=_0x57756e;if(_[_0xfe98('0x63')](_0x454a42,0x64)){var _0x9433b9=_[_0xfe98('0x59')](_0x4b5be5,{'sectionId':0x64});return hasDefaultDashboard(_0x9433b9)['then'](function(_0x180cff){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x1de511){if(_0x1de511[_0xfe98('0x57')]===0x64){_0x1de511[_0xfe98('0x65')]=_0x180cff;}return _0x1de511;});});}else{return;}})['then'](function(_0x548b82){if(_0x548b82)_0x4b5be5=_0x548b82;if(_[_0xfe98('0x63')](_0x454a42,0x3eb)){var _0x17141c=_['find'](_0x4b5be5,{'sectionId':0x3eb});return getCustomDashboards(_0x17141c)['then'](function(_0x4a686d){return _['map'](_0x4b5be5,function(_0x1382e2){if(_0x17141c[_0xfe98('0x62')]){if(_0x1382e2[_0xfe98('0x57')]===0x3eb){_0x1382e2['subsections']=_0x4a686d;}}else{if(_0x1382e2[_0xfe98('0x57')]===0x64){_0x1382e2[_0xfe98('0x65')]=_0x4a686d;}}return _0x1382e2;});});}else{return;}})[_0xfe98('0x26')](function(_0x2c039e){if(_0x2c039e)_0x4b5be5=_0x2c039e;if(_[_0xfe98('0x63')](_0x454a42,0x709)){var _0x131240=_[_0xfe98('0x59')](_0x4b5be5,{'sectionId':0x709});return getPlugins(_0x131240)['then'](function(_0x47b756){if(_0x131240['enabled']){return _[_0xfe98('0x2c')](_0x4b5be5,function(_0x35290b){if(_0x35290b[_0xfe98('0x57')]===0x709){_0x35290b[_0xfe98('0x65')]=_0x47b756;}return _0x35290b;});}else{var _0x425576={'sectionId':0x76c,'enabled':0x1,'subsections':_0x47b756};var _0xfc79a1=_[_0xfe98('0x2c')](_0x4b5be5);_0xfc79a1[_0xfe98('0x5e')](_0x425576);return _0xfc79a1;}});}else{return;}})['then'](function(_0x5df11e){if(_0x5df11e)_0x4b5be5=_0x5df11e;return _['filter'](_0x4b5be5,['enabled',0x1]);})[_0xfe98('0x26')](respondWithResult(_0x5c8015,null))[_0xfe98('0x49')](handleError(_0x5c8015,null));};function hasDefaultDashboard(_0x14e2e4){var _0x3153f0=[0x65];return new BPromise(function(_0x2de027,_0x19385b){try{if(_0x14e2e4['autoAssociation']){_0x2de027(_0x3153f0);}else{return db[_0xfe98('0x56')][_0xfe98('0x66')]({'where':{'sectionId':_0x14e2e4['id']},'raw':!![]})['then'](function(_0x4a9028){_0x4a9028?_0x2de027(_0x3153f0):_0x2de027();});}}catch(_0xd5b171){_0x19385b(_0xd5b171);}});}function getCustomDashboards(_0x11ba08){var _0x573815=[];return new BPromise(function(_0x8223f1,_0xed4caa){try{if(_0x11ba08['autoAssociation']){return db[_0xfe98('0x67')]['findAll']({'raw':!![]})[_0xfe98('0x26')](function(_0x376c8f){_0x376c8f[_0xfe98('0x68')](function(_0x234b80){_0x573815['push'](_0x234b80['id']+0x1869f);});_0x8223f1(_0x573815);});}else{return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x11ba08['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x5919f1){_0x5919f1[_0xfe98('0x68')](function(_0x406758){_0x573815['push'](_0x406758[_0xfe98('0x69')]+0x1869f);});_0x8223f1(_0x573815);});}}catch(_0x4733d3){_0xed4caa(_0x4733d3);}});}function getPlugins(_0x51c65b){var _0xc6421f=[];return new BPromise(function(_0x4d9e98,_0x3e140f){try{if(_0x51c65b[_0xfe98('0x55')]){return db[_0xfe98('0x6a')][_0xfe98('0x44')]({'raw':!![]})['then'](function(_0x4f8099){_0x4f8099['forEach'](function(_0x10454b){_0xc6421f[_0xfe98('0x5e')](_0x10454b['id']+0x15b38);});_0x4d9e98(_0xc6421f);});}else{return db[_0xfe98('0x56')][_0xfe98('0x44')]({'where':{'sectionId':_0x51c65b['id']},'raw':!![]})[_0xfe98('0x26')](function(_0x147b1e){_0x147b1e[_0xfe98('0x68')](function(_0x4fe8cb){_0xc6421f[_0xfe98('0x5e')](_0x4fe8cb[_0xfe98('0x69')]+0x15b38);});_0x4d9e98(_0xc6421f);});}}catch(_0xd367d9){_0x3e140f(_0xd367d9);}});}exports['addResources']=function(_0x2ad8bb,_0x481789){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x2ad8bb[_0xfe98('0x47')]['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x481789,null))['then'](function(_0x5165bc){if(_0x5165bc){return db[_0xfe98('0x52')]['transaction'](function(_0x361c00){return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0xfe98('0x26')](function(_0x1a5d43){if(_0x1a5d43){return db[_0xfe98('0x53')][_0xfe98('0x25')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id'],'id':_[_0xfe98('0x2c')](_0x1a5d43,function(_0x17470a){return _0x17470a['id'];})},'transaction':_0x361c00});}})['then'](function(_0xd58077){var _0x5b1421=_[_0xfe98('0x2c')](_0x2ad8bb['body'],function(_0x1d2873){_0x1d2873[_0xfe98('0x5d')]=_0x2ad8bb[_0xfe98('0x47')]['id'];return _0x1d2873;});return db[_0xfe98('0x53')][_0xfe98('0x6b')](_0x5b1421,{'raw':!![],'transaction':_0x361c00});})['then'](function(_0x1befdb){var _0x8ecf07=_['filter'](_[_0xfe98('0x2c')](_0x1befdb,function(_0x416705){return _0x416705[_0xfe98('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x8ecf07){return db[_0xfe98('0x53')][_0xfe98('0x44')]({'where':{'userProfileId':_0x2ad8bb[_0xfe98('0x47')]['id'],'sectionId':_[_0xfe98('0x2c')](_0x8ecf07,function(_0x40714b){return _0x40714b['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xfe98('0x26')](function(_0x4d7a13){var _0x1be023=_[_0xfe98('0x2c')](_0x2ad8bb[_0xfe98('0x4f')],function(_0x11cf80){_0x11cf80['userProfileId']=_0x2ad8bb['params']['id'];return _0x11cf80;});return db[_0xfe98('0x56')]['bulkCreate'](_0x1be023,{'raw':!![],'transaction':_0x361c00});});}})['catch'](handleError(_0x481789,null));});}})[_0xfe98('0x26')](function(_0x5cd22f){var _0x3cf1a2=_[_0xfe98('0x2c')](_0x5cd22f,function(_0x2dc3ae){return _0x2dc3ae[_0xfe98('0x4d')]({'plain':!![]});});})[_0xfe98('0x26')](respondWithResult(_0x481789,null))['catch'](handleError(_0x481789,null));};exports[_0xfe98('0x6c')]=function(_0x3a53c1,_0x3f9b11,_0x1efc1a){return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x3a53c1['params']['id']}})[_0xfe98('0x26')](handleEntityNotFound(_0x3f9b11,null))[_0xfe98('0x26')](function(_0x250eb2){if(_0x250eb2){return _0x250eb2[_0xfe98('0x6c')](_0x3a53c1[_0xfe98('0x34')][_0xfe98('0x60')]);}})[_0xfe98('0x26')](respondWithStatusCode(_0x3f9b11,null))['catch'](handleError(_0x3f9b11,null));};exports[_0xfe98('0x6d')]=function(_0x233182,_0x148e11){var _0x37f452={};if(!_0x233182['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x233182['query'][_0xfe98('0x38')](_0xfe98('0x39'))){_0x37f452[_0xfe98('0x1b')]=qs[_0xfe98('0x1b')](_0x233182['query']['limit']);_0x37f452[_0xfe98('0x1d')]=qs[_0xfe98('0x1d')](_0x233182[_0xfe98('0x34')][_0xfe98('0x1d')]);}return db[_0xfe98('0x2d')][_0xfe98('0x59')]({'where':{'id':_0x233182[_0xfe98('0x47')]['id']}})['then'](function(_0x3bc6fb){if(!_0x3bc6fb)throw new Error(_0xfe98('0x6e')+_0x233182[_0xfe98('0x47')]['id']);return db[_0xfe98('0x2d')][_0xfe98('0x6d')](_0x233182);})[_0xfe98('0x26')](respondWithFilteredResult(_0x148e11,_0x37f452))['catch'](handleError(_0x148e11,null));}; \ No newline at end of file +var _0x9e6b=['reject','save','update','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','sequelize','transaction','each','UserProfileResource','sectionId','Resources','UserProfileSection','describe','addSections','userProfileId','push','ids','getSections','filter','includes','isEmpty','subsections','enabled','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','Missing\x20section\x20parameter','getResources','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range'];(function(_0x1d291d,_0x17314a){var _0x44cc4e=function(_0x38d29f){while(--_0x38d29f){_0x1d291d['push'](_0x1d291d['shift']());}};_0x44cc4e(++_0x17314a);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9e6b[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xb9e6('0x0'));var rimraf=require(_0xb9e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9e6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb9e6('0x3'));var Mustache=require(_0xb9e6('0x4'));var util=require(_0xb9e6('0x5'));var path=require(_0xb9e6('0x6'));var sox=require('sox');var csv=require(_0xb9e6('0x7'));var ejs=require(_0xb9e6('0x8'));var fs=require('fs');var fs_extra=require(_0xb9e6('0x9'));var _=require('lodash');var squel=require(_0xb9e6('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb9e6('0x7'));var querystring=require('querystring');var Papa=require(_0xb9e6('0xb'));var Redis=require(_0xb9e6('0xc'));var authService=require(_0xb9e6('0xd'));var qs=require(_0xb9e6('0xe'));var as=require(_0xb9e6('0xf'));var hardwareService=require(_0xb9e6('0x10'));var logger=require(_0xb9e6('0x11'))(_0xb9e6('0x12'));var utils=require(_0xb9e6('0x13'));var config=require(_0xb9e6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9e6('0x15'))['db'];config[_0xb9e6('0x16')]=_[_0xb9e6('0x17')](config[_0xb9e6('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb9e6('0x18'))(new Redis(config[_0xb9e6('0x16')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x45f38d,_0xa22bf1){_0xa22bf1=_0xa22bf1||0xcc;return function(_0x2673f6){if(_0x2673f6){return _0x45f38d[_0xb9e6('0x19')](_0xa22bf1);}return _0x45f38d['status'](_0xa22bf1)[_0xb9e6('0x1a')]();};}function respondWithResult(_0x1969e6,_0x40b508){_0x40b508=_0x40b508||0xc8;return function(_0x1d47b9){if(_0x1d47b9){return _0x1969e6[_0xb9e6('0x1b')](_0x40b508)[_0xb9e6('0x1c')](_0x1d47b9);}};}function respondWithFilteredResult(_0x3cd35e,_0x640762){return function(_0x8d7ea3){if(_0x8d7ea3){var _0x1931f2=typeof _0x640762['offset']===_0xb9e6('0x1d')&&typeof _0x640762['limit']===_0xb9e6('0x1d');var _0x312091=_0x8d7ea3[_0xb9e6('0x1e')];var _0x1d6df7=_0x1931f2?0x0:_0x640762['offset'];var _0x3f0598=_0x1931f2?_0x8d7ea3[_0xb9e6('0x1e')]:_0x640762[_0xb9e6('0x1f')]+_0x640762[_0xb9e6('0x20')];var _0x5ecc3b;if(_0x3f0598>=_0x312091){_0x3f0598=_0x312091;_0x5ecc3b=0xc8;}else{_0x5ecc3b=0xce;}_0x3cd35e['status'](_0x5ecc3b);return _0x3cd35e['set'](_0xb9e6('0x21'),_0x1d6df7+'-'+_0x3f0598+'/'+_0x312091)[_0xb9e6('0x1c')](_0x8d7ea3);}return null;};}function patchUpdates(_0x530fb9){return function(_0x22813e){try{jsonpatch['apply'](_0x22813e,_0x530fb9,!![]);}catch(_0x34dd9b){return BPromise[_0xb9e6('0x22')](_0x34dd9b);}return _0x22813e[_0xb9e6('0x23')]();};}function saveUpdates(_0x467aa4,_0x17885d){return function(_0x5cc468){if(_0x5cc468){return _0x5cc468[_0xb9e6('0x24')](_0x467aa4)[_0xb9e6('0x25')](function(_0xf4e177){return _0xf4e177;});}return null;};}function removeEntity(_0x24a195,_0x3822ee){return function(_0x5d8f88){if(_0x5d8f88){return _0x5d8f88[_0xb9e6('0x26')]()[_0xb9e6('0x25')](function(){_0x24a195[_0xb9e6('0x1b')](0xcc)[_0xb9e6('0x1a')]();});}};}function handleEntityNotFound(_0x5de404,_0x2fbdca){return function(_0x4601a1){if(!_0x4601a1){_0x5de404[_0xb9e6('0x19')](0x194);}return _0x4601a1;};}function handleError(_0xa94c3b,_0x3a30cd){_0x3a30cd=_0x3a30cd||0x1f4;return function(_0x31887a){logger[_0xb9e6('0x27')](_0x31887a[_0xb9e6('0x28')]);if(_0x31887a['name']){delete _0x31887a[_0xb9e6('0x29')];}_0xa94c3b[_0xb9e6('0x1b')](_0x3a30cd)['send'](_0x31887a);};}exports[_0xb9e6('0x2a')]=function(_0xda86d5,_0x5e2761){var _0x17915d={},_0x43ad11={},_0x2562d0={'count':0x0,'rows':[]};var _0x1b704f=_[_0xb9e6('0x2b')](db[_0xb9e6('0x2c')][_0xb9e6('0x2d')],function(_0x518e35){return{'name':_0x518e35[_0xb9e6('0x2e')],'type':_0x518e35[_0xb9e6('0x2f')]['key']};});_0x43ad11[_0xb9e6('0x30')]=_[_0xb9e6('0x2b')](_0x1b704f,'name');_0x43ad11[_0xb9e6('0x31')]=_['keys'](_0xda86d5[_0xb9e6('0x31')]);_0x43ad11[_0xb9e6('0x32')]=_[_0xb9e6('0x33')](_0x43ad11[_0xb9e6('0x30')],_0x43ad11['query']);_0x17915d[_0xb9e6('0x34')]=_['intersection'](_0x43ad11[_0xb9e6('0x30')],qs['fields'](_0xda86d5['query'][_0xb9e6('0x35')]));_0x17915d[_0xb9e6('0x34')]=_0x17915d[_0xb9e6('0x34')][_0xb9e6('0x36')]?_0x17915d[_0xb9e6('0x34')]:_0x43ad11['model'];if(!_0xda86d5[_0xb9e6('0x31')][_0xb9e6('0x37')](_0xb9e6('0x38'))){_0x17915d[_0xb9e6('0x20')]=qs[_0xb9e6('0x20')](_0xda86d5[_0xb9e6('0x31')]['limit']);_0x17915d[_0xb9e6('0x1f')]=qs[_0xb9e6('0x1f')](_0xda86d5[_0xb9e6('0x31')][_0xb9e6('0x1f')]);}_0x17915d[_0xb9e6('0x39')]=qs[_0xb9e6('0x3a')](_0xda86d5['query'][_0xb9e6('0x3a')]);_0x17915d[_0xb9e6('0x3b')]=qs[_0xb9e6('0x32')](_[_0xb9e6('0x3c')](_0xda86d5[_0xb9e6('0x31')],_0x43ad11[_0xb9e6('0x32')]),_0x1b704f);if(_0xda86d5['query']['filter']){_0x17915d['where']=_[_0xb9e6('0x3d')](_0x17915d['where'],{'$or':_[_0xb9e6('0x2b')](_0x1b704f,function(_0x1afce2){if(_0x1afce2[_0xb9e6('0x2f')]!=='VIRTUAL'){var _0x5d6439={};_0x5d6439[_0x1afce2[_0xb9e6('0x29')]]={'$like':'%'+_0xda86d5['query']['filter']+'%'};return _0x5d6439;}})});}_0x17915d=_['merge']({},_0x17915d,_0xda86d5[_0xb9e6('0x3e')]);var _0x361f31={'where':_0x17915d[_0xb9e6('0x3b')]};return db[_0xb9e6('0x2c')][_0xb9e6('0x1e')](_0x361f31)['then'](function(_0x433608){_0x2562d0[_0xb9e6('0x1e')]=_0x433608;if(_0xda86d5['query']['includeAll']){_0x17915d[_0xb9e6('0x3f')]=[{'all':!![]}];}return db['UserProfile'][_0xb9e6('0x40')](_0x17915d);})['then'](function(_0x59f2e1){_0x2562d0['rows']=_0x59f2e1;return _0x2562d0;})[_0xb9e6('0x25')](respondWithFilteredResult(_0x5e2761,_0x17915d))[_0xb9e6('0x41')](handleError(_0x5e2761,null));};exports[_0xb9e6('0x42')]=function(_0x2ec7b6,_0x5eae94){var _0x5a6df2={'raw':![],'where':{'id':_0x2ec7b6[_0xb9e6('0x43')]['id']}},_0x1ede95={};_0x1ede95['model']=_[_0xb9e6('0x44')](db[_0xb9e6('0x2c')]['rawAttributes']);_0x1ede95['query']=_[_0xb9e6('0x44')](_0x2ec7b6[_0xb9e6('0x31')]);_0x1ede95[_0xb9e6('0x32')]=_['intersection'](_0x1ede95['model'],_0x1ede95[_0xb9e6('0x31')]);_0x5a6df2[_0xb9e6('0x34')]=_[_0xb9e6('0x33')](_0x1ede95['model'],qs['fields'](_0x2ec7b6['query']['fields']));_0x5a6df2['attributes']=_0x5a6df2['attributes'][_0xb9e6('0x36')]?_0x5a6df2[_0xb9e6('0x34')]:_0x1ede95['model'];if(_0x2ec7b6[_0xb9e6('0x31')][_0xb9e6('0x45')]){_0x5a6df2[_0xb9e6('0x3f')]=[{'all':!![]}];}_0x5a6df2=_[_0xb9e6('0x3d')]({},_0x5a6df2,_0x2ec7b6[_0xb9e6('0x3e')]);return db[_0xb9e6('0x2c')][_0xb9e6('0x46')](_0x5a6df2)[_0xb9e6('0x25')](handleEntityNotFound(_0x5eae94,null))[_0xb9e6('0x25')](respondWithResult(_0x5eae94,null))[_0xb9e6('0x41')](handleError(_0x5eae94,null));};exports[_0xb9e6('0x47')]=function(_0x4fe140,_0x29b400){return db[_0xb9e6('0x2c')]['create'](_0x4fe140[_0xb9e6('0x48')],{})['then'](respondWithResult(_0x29b400,0xc9))[_0xb9e6('0x41')](handleError(_0x29b400,null));};exports[_0xb9e6('0x49')]=function(_0x3d03f0,_0x1514f6){var _0x59a4fb={'where':{'id':_0x3d03f0[_0xb9e6('0x43')]['id']}},_0x1cd9be={};_0x1cd9be[_0xb9e6('0x30')]=_[_0xb9e6('0x44')](db['UserProfile'][_0xb9e6('0x2d')]);_0x59a4fb['attributes']=_[_0xb9e6('0x33')](_0x1cd9be[_0xb9e6('0x30')],qs[_0xb9e6('0x35')](_0x3d03f0['query'][_0xb9e6('0x35')]));_0x59a4fb['attributes']=_0x59a4fb['attributes'][_0xb9e6('0x36')]?_0x59a4fb['attributes']:_0x1cd9be[_0xb9e6('0x30')];if(_0x3d03f0[_0xb9e6('0x31')]['includeAll']){_0x59a4fb[_0xb9e6('0x3f')]=[{'all':!![]}];}_0x59a4fb=_[_0xb9e6('0x3d')]({},_0x59a4fb,_0x3d03f0[_0xb9e6('0x3e')]);return db[_0xb9e6('0x2c')][_0xb9e6('0x46')](_0x59a4fb)[_0xb9e6('0x25')](handleEntityNotFound(_0x1514f6,null))[_0xb9e6('0x25')](function(_0x5027d8){if(_0x5027d8){var _0x2e0b69=_0x5027d8[_0xb9e6('0x4a')]({'plain':!![]});_0x2e0b69=qs[_0xb9e6('0x4b')](_0x2e0b69,['id',_0xb9e6('0x4c'),_0xb9e6('0x4d'),'crudPermissions']);_0x3d03f0[_0xb9e6('0x48')]=_['omit'](_0x3d03f0[_0xb9e6('0x48')],['id',_0xb9e6('0x4c'),_0xb9e6('0x4d')]);return db[_0xb9e6('0x4e')][_0xb9e6('0x4f')](function(_0x848ff3){return db[_0xb9e6('0x2c')][_0xb9e6('0x47')](_[_0xb9e6('0x3d')](_0x2e0b69,_0x3d03f0[_0xb9e6('0x48')]),{'include':_0x3d03f0[_0xb9e6('0x31')][_0xb9e6('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x848ff3})[_0xb9e6('0x25')](function(_0x96585c){var _0x13432a=_0x96585c[_0xb9e6('0x4a')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3d03f0[_0xb9e6('0x43')]['id']},'raw':!![]})[_0xb9e6('0x25')](function(_0x58af33){if(_0x58af33){return BPromise[_0xb9e6('0x50')](_0x58af33,function(_0x30fbe4){return new BPromise(function(_0x650fc7,_0x2a9b78){if(_0x30fbe4['autoAssociation']===null||_0x30fbe4['autoAssociation']===0x1)_0x650fc7(null);return db[_0xb9e6('0x51')][_0xb9e6('0x40')]({'where':{'sectionId':_0x30fbe4['id']},'raw':!![]})[_0xb9e6('0x25')](function(_0x4ce762){var _0x2ea3ff=_[_0xb9e6('0x2b')](_0x4ce762,function(_0x295a49){return qs[_0xb9e6('0x4b')](_0x295a49,['id','createdAt',_0xb9e6('0x4d'),_0xb9e6('0x52')]);});_0x650fc7(_0x2ea3ff);})[_0xb9e6('0x41')](function(_0x463e49){_0x2a9b78(_0x463e49);});})[_0xb9e6('0x25')](function(_0x1a1510){var _0x7444cd=qs[_0xb9e6('0x4b')](_0x30fbe4,['id',_0xb9e6('0x4c'),_0xb9e6('0x4d')]);_0x7444cd['userProfileId']=_0x13432a['id'];if(_0x1a1510)_0x7444cd[_0xb9e6('0x53')]=_0x1a1510;return _0x7444cd;})['then'](function(_0x522ff9){return db[_0xb9e6('0x54')][_0xb9e6('0x47')](_0x522ff9,{'include':[{'model':db[_0xb9e6('0x51')],'as':_0xb9e6('0x53')}],'raw':!![],'transaction':_0x848ff3});});})[_0xb9e6('0x25')](function(){return _0x13432a;});}});});});}})[_0xb9e6('0x25')](respondWithResult(_0x1514f6,0xc9))[_0xb9e6('0x41')](handleError(_0x1514f6,null));};exports[_0xb9e6('0x24')]=function(_0x4affbb,_0x599170){if(_0x4affbb[_0xb9e6('0x48')]['id']){delete _0x4affbb['body']['id'];}return db[_0xb9e6('0x2c')][_0xb9e6('0x46')]({'where':{'id':_0x4affbb[_0xb9e6('0x43')]['id']}})[_0xb9e6('0x25')](handleEntityNotFound(_0x599170,null))[_0xb9e6('0x25')](saveUpdates(_0x4affbb[_0xb9e6('0x48')],null))[_0xb9e6('0x25')](respondWithResult(_0x599170,null))['catch'](handleError(_0x599170,null));};exports[_0xb9e6('0x26')]=function(_0x487834,_0x1470fb){return db['UserProfile'][_0xb9e6('0x46')]({'where':{'id':_0x487834['params']['id']}})[_0xb9e6('0x25')](handleEntityNotFound(_0x1470fb,null))['then'](removeEntity(_0x1470fb,null))[_0xb9e6('0x41')](handleError(_0x1470fb,null));};exports[_0xb9e6('0x55')]=function(_0x47e13e,_0x3a004d){return db[_0xb9e6('0x2c')][_0xb9e6('0x55')]()[_0xb9e6('0x25')](respondWithResult(_0x3a004d,null))[_0xb9e6('0x41')](handleError(_0x3a004d,null));};exports[_0xb9e6('0x56')]=function(_0x466a89,_0x30dd1f){var _0x523e91=_0x466a89['body'];return db[_0xb9e6('0x2c')][_0xb9e6('0x46')]({'where':{'id':_0x466a89[_0xb9e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x30dd1f,null))['then'](function(_0x45a433){if(_0x45a433){return db['sequelize']['transaction'](function(_0x148bbe){return db[_0xb9e6('0x54')][_0xb9e6('0x26')]({'where':{'userProfileId':_0x466a89[_0xb9e6('0x43')]['id'],'sectionId':_[_0xb9e6('0x2b')](_0x523e91,function(_0x21ffa9){return _0x21ffa9['sectionId'];})},'transaction':_0x148bbe})[_0xb9e6('0x25')](function(){var _0x31d1b3=_['map'](_0x523e91,function(_0x2ecf14){_0x2ecf14[_0xb9e6('0x57')]=_0x466a89['params']['id'];return _0x2ecf14;});var _0x42c383=[];return BPromise[_0xb9e6('0x50')](_0x31d1b3,function(_0xdd2e79){return db[_0xb9e6('0x54')]['create'](_0xdd2e79,{'include':[{'model':db[_0xb9e6('0x51')],'as':'Resources'}],'raw':!![],'transaction':_0x148bbe})[_0xb9e6('0x25')](function(_0x196f47){_0x42c383[_0xb9e6('0x58')](_0x196f47[_0xb9e6('0x4a')]({'plain':!![]}));});})[_0xb9e6('0x25')](function(){return _0x42c383;});});});}})[_0xb9e6('0x25')](function(_0x5d3bbc){return _0x5d3bbc;})[_0xb9e6('0x25')](respondWithResult(_0x30dd1f,null))[_0xb9e6('0x41')](handleError(_0x30dd1f,null));};exports['removeSections']=function(_0x4e2ff5,_0x591b0f){var _0x1379d2;return db[_0xb9e6('0x2c')]['find']({'where':{'id':_0x4e2ff5[_0xb9e6('0x43')]['id']},'attributes':['id',_0xb9e6('0x29')]})[_0xb9e6('0x25')](handleEntityNotFound(_0x591b0f,null))['then'](function(_0x1a777f){if(_0x1a777f){_0x1379d2=_0x1a777f;return db[_0xb9e6('0x54')][_0xb9e6('0x26')]({'where':{'userProfileId':_0x4e2ff5['params']['id'],'sectionId':_0x4e2ff5[_0xb9e6('0x31')][_0xb9e6('0x59')]}});}})[_0xb9e6('0x25')](function(){return _0x1379d2;})[_0xb9e6('0x25')](respondWithStatusCode(_0x591b0f,null))['catch'](handleError(_0x591b0f,null));};exports[_0xb9e6('0x5a')]=function(_0x29cd5e,_0x5a57fb){var _0x38c190=[];var _0xa147d3=[];return db[_0xb9e6('0x54')][_0xb9e6('0x40')]({'where':{'userProfileId':_0x29cd5e['params']['id']},'raw':!![]})[_0xb9e6('0x25')](function(_0x17d7b3){_0x38c190=_[_0xb9e6('0x5b')](_0x17d7b3,function(_0x53be5d){return _0x53be5d['enabled']===0x1||_[_0xb9e6('0x5c')]([0x3eb,0x709],_0x53be5d[_0xb9e6('0x52')]);});if(!_[_0xb9e6('0x5d')](_0x38c190)){return _[_0xb9e6('0x2b')](_0x38c190,function(_0x3ae2e7){return _0x3ae2e7[_0xb9e6('0x52')];});}else{return;}})[_0xb9e6('0x25')](function(_0x260825){if(_0x260825)_0xa147d3=_0x260825;if(_[_0xb9e6('0x5c')](_0xa147d3,0x64)){var _0x5334a0=_['find'](_0x38c190,{'sectionId':0x64});return hasDefaultDashboard(_0x5334a0)[_0xb9e6('0x25')](function(_0x146269){return _['map'](_0x38c190,function(_0x330749){if(_0x330749[_0xb9e6('0x52')]===0x64){_0x330749[_0xb9e6('0x5e')]=_0x146269;}return _0x330749;});});}else{return;}})[_0xb9e6('0x25')](function(_0x30a8c1){if(_0x30a8c1)_0x38c190=_0x30a8c1;if(_[_0xb9e6('0x5c')](_0xa147d3,0x3eb)){var _0x7c73eb=_[_0xb9e6('0x46')](_0x38c190,{'sectionId':0x3eb});return getCustomDashboards(_0x7c73eb)[_0xb9e6('0x25')](function(_0x10e2b9){return _['map'](_0x38c190,function(_0x2b90e0){if(_0x7c73eb['enabled']){if(_0x2b90e0['sectionId']===0x3eb){_0x2b90e0[_0xb9e6('0x5e')]=_0x10e2b9;}}else{if(_0x2b90e0[_0xb9e6('0x52')]===0x64){_0x2b90e0[_0xb9e6('0x5e')]=_0x10e2b9;}}return _0x2b90e0;});});}else{return;}})[_0xb9e6('0x25')](function(_0x1561d0){if(_0x1561d0)_0x38c190=_0x1561d0;if(_[_0xb9e6('0x5c')](_0xa147d3,0x709)){var _0x255364=_[_0xb9e6('0x46')](_0x38c190,{'sectionId':0x709});return getPlugins(_0x255364)[_0xb9e6('0x25')](function(_0x429988){if(_0x255364[_0xb9e6('0x5f')]){return _['map'](_0x38c190,function(_0x3f18c9){if(_0x3f18c9[_0xb9e6('0x52')]===0x709){_0x3f18c9[_0xb9e6('0x5e')]=_0x429988;}return _0x3f18c9;});}else{var _0x3daf6a={'sectionId':0x76c,'enabled':0x1,'subsections':_0x429988};var _0x2505b2=_['map'](_0x38c190);_0x2505b2[_0xb9e6('0x58')](_0x3daf6a);return _0x2505b2;}});}else{return;}})[_0xb9e6('0x25')](function(_0x6332d7){if(_0x6332d7)_0x38c190=_0x6332d7;return _[_0xb9e6('0x5b')](_0x38c190,[_0xb9e6('0x5f'),0x1]);})[_0xb9e6('0x25')](respondWithResult(_0x5a57fb,null))[_0xb9e6('0x41')](handleError(_0x5a57fb,null));};function hasDefaultDashboard(_0x169d17){var _0x3411f3=[0x65];return new BPromise(function(_0x409765,_0x54d687){try{if(_0x169d17[_0xb9e6('0x60')]){_0x409765(_0x3411f3);}else{return db[_0xb9e6('0x51')][_0xb9e6('0x61')]({'where':{'sectionId':_0x169d17['id']},'raw':!![]})[_0xb9e6('0x25')](function(_0x266211){_0x266211?_0x409765(_0x3411f3):_0x409765();});}}catch(_0x7de101){_0x54d687(_0x7de101);}});}function getCustomDashboards(_0x23321b){var _0x423a5f=[];return new BPromise(function(_0x318898,_0x3748a3){try{if(_0x23321b['autoAssociation']){return db[_0xb9e6('0x62')][_0xb9e6('0x40')]({'raw':!![]})[_0xb9e6('0x25')](function(_0x309c5b){_0x309c5b['forEach'](function(_0xa56b0b){_0x423a5f['push'](_0xa56b0b['id']+0x1869f);});_0x318898(_0x423a5f);});}else{return db[_0xb9e6('0x51')][_0xb9e6('0x40')]({'where':{'sectionId':_0x23321b['id']},'raw':!![]})[_0xb9e6('0x25')](function(_0x1fac7f){_0x1fac7f[_0xb9e6('0x63')](function(_0x5aa5df){_0x423a5f[_0xb9e6('0x58')](_0x5aa5df[_0xb9e6('0x64')]+0x1869f);});_0x318898(_0x423a5f);});}}catch(_0x51d78b){_0x3748a3(_0x51d78b);}});}function getPlugins(_0x29d16b){var _0x1097c3=[];return new BPromise(function(_0xb22906,_0x480bdf){try{if(_0x29d16b['autoAssociation']){return db[_0xb9e6('0x65')][_0xb9e6('0x40')]({'raw':!![]})[_0xb9e6('0x25')](function(_0x253a11){_0x253a11[_0xb9e6('0x63')](function(_0x6ca7d1){_0x1097c3['push'](_0x6ca7d1['id']+0x15b38);});_0xb22906(_0x1097c3);});}else{return db['UserProfileResource'][_0xb9e6('0x40')]({'where':{'sectionId':_0x29d16b['id']},'raw':!![]})['then'](function(_0xbab405){_0xbab405[_0xb9e6('0x63')](function(_0x58b8b1){_0x1097c3[_0xb9e6('0x58')](_0x58b8b1[_0xb9e6('0x64')]+0x15b38);});_0xb22906(_0x1097c3);});}}catch(_0x1d8730){_0x480bdf(_0x1d8730);}});}exports[_0xb9e6('0x66')]=function(_0x2fe418,_0x3ad019){return db['UserProfile'][_0xb9e6('0x46')]({'where':{'id':_0x2fe418[_0xb9e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ad019,null))[_0xb9e6('0x25')](function(_0x317b10){if(_0x317b10){return db[_0xb9e6('0x4e')][_0xb9e6('0x4f')](function(_0x2a71be){return db['UserProfileSection'][_0xb9e6('0x40')]({'where':{'userProfileId':_0x2fe418[_0xb9e6('0x43')]['id']},'attributes':['id'],'raw':!![]})[_0xb9e6('0x25')](function(_0x1c0cc8){if(_0x1c0cc8){return db[_0xb9e6('0x54')][_0xb9e6('0x26')]({'where':{'userProfileId':_0x2fe418[_0xb9e6('0x43')]['id'],'id':_[_0xb9e6('0x2b')](_0x1c0cc8,function(_0x70459e){return _0x70459e['id'];})},'transaction':_0x2a71be});}})[_0xb9e6('0x25')](function(_0x31e088){var _0x1dd9b7=_[_0xb9e6('0x2b')](_0x2fe418[_0xb9e6('0x48')],function(_0x3521a0){_0x3521a0['userProfileId']=_0x2fe418[_0xb9e6('0x43')]['id'];return _0x3521a0;});return db[_0xb9e6('0x54')]['bulkCreate'](_0x1dd9b7,{'raw':!![],'transaction':_0x2a71be});})[_0xb9e6('0x25')](function(_0x4ae70f){var _0x4cf9fe=_[_0xb9e6('0x5b')](_[_0xb9e6('0x2b')](_0x4ae70f,function(_0x45c578){return _0x45c578[_0xb9e6('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x4cf9fe){return db[_0xb9e6('0x54')][_0xb9e6('0x40')]({'where':{'userProfileId':_0x2fe418[_0xb9e6('0x43')]['id'],'sectionId':_[_0xb9e6('0x2b')](_0x4cf9fe,function(_0x296f56){return _0x296f56[_0xb9e6('0x52')];})},'attributes':['id',_0xb9e6('0x52')],'raw':!![]})[_0xb9e6('0x25')](function(_0xb842e3){var _0x328d65=_[_0xb9e6('0x2b')](_0x2fe418[_0xb9e6('0x48')],function(_0x34ebce){_0x34ebce['userProfileId']=_0x2fe418[_0xb9e6('0x43')]['id'];return _0x34ebce;});return db['UserProfileResource']['bulkCreate'](_0x328d65,{'raw':!![],'transaction':_0x2a71be});});}})['catch'](handleError(_0x3ad019,null));});}})['then'](function(_0x457233){var _0x2ee337=_[_0xb9e6('0x2b')](_0x457233,function(_0x3e6d49){return _0x3e6d49['get']({'plain':!![]});});})[_0xb9e6('0x25')](respondWithResult(_0x3ad019,null))[_0xb9e6('0x41')](handleError(_0x3ad019,null));};exports[_0xb9e6('0x67')]=function(_0x37cb7d,_0x406893,_0x18b59e){return db[_0xb9e6('0x2c')][_0xb9e6('0x46')]({'where':{'id':_0x37cb7d['params']['id']}})[_0xb9e6('0x25')](handleEntityNotFound(_0x406893,null))[_0xb9e6('0x25')](function(_0xa671a1){if(_0xa671a1){return _0xa671a1[_0xb9e6('0x67')](_0x37cb7d[_0xb9e6('0x31')][_0xb9e6('0x59')]);}})[_0xb9e6('0x25')](respondWithStatusCode(_0x406893,null))[_0xb9e6('0x41')](handleError(_0x406893,null));};exports['getResources']=function(_0x8276bd,_0x5379a7){var _0x2b86d6={};if(!_0x8276bd[_0xb9e6('0x31')]['section'])throw new Error(_0xb9e6('0x68'));if(!_0x8276bd[_0xb9e6('0x31')]['hasOwnProperty'](_0xb9e6('0x38'))){_0x2b86d6['limit']=qs['limit'](_0x8276bd['query'][_0xb9e6('0x20')]);_0x2b86d6[_0xb9e6('0x1f')]=qs[_0xb9e6('0x1f')](_0x8276bd['query']['offset']);}return db[_0xb9e6('0x2c')][_0xb9e6('0x46')]({'where':{'id':_0x8276bd['params']['id']}})[_0xb9e6('0x25')](function(_0x5d3ca6){if(!_0x5d3ca6)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x8276bd[_0xb9e6('0x43')]['id']);return db[_0xb9e6('0x2c')][_0xb9e6('0x69')](_0x8276bd);})[_0xb9e6('0x25')](respondWithFilteredResult(_0x5379a7,_0x2b86d6))[_0xb9e6('0x41')](handleError(_0x5379a7,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 4d5fce8..71bed89 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 _0x1893=['UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1893,0xa2));var _0x3189=function(_0x50f382,_0x32473c){_0x50f382=_0x50f382-0x0;var _0x16afda=_0x1893[_0x50f382];return _0x16afda;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db'][_0x3189('0x0')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3189('0x1')](0x0);var events={'afterCreate':_0x3189('0x2'),'afterUpdate':_0x3189('0x3'),'afterDestroy':_0x3189('0x4')};function emitEvent(_0x36a7b0){return function(_0x3953a2,_0x5371db,_0x27445){UserProfileEvents[_0x3189('0x5')](_0x36a7b0+':'+_0x3953a2['id'],_0x3953a2);UserProfileEvents[_0x3189('0x5')](_0x36a7b0,_0x3953a2);_0x27445(null);};}for(var e in events){if(events[_0x3189('0x6')](e)){var event=events[e];UserProfile[_0x3189('0x7')](e,emitEvent(event));}}module[_0x3189('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xb931=['remove','emit','hasOwnProperty','hook','exports','UserProfile','update'];(function(_0x59008b,_0x75ea97){var _0x20359c=function(_0x3e3199){while(--_0x3e3199){_0x59008b['push'](_0x59008b['shift']());}};_0x20359c(++_0x75ea97);}(_0xb931,0x155));var _0x1b93=function(_0x1bd2ec,_0x158553){_0x1bd2ec=_0x1bd2ec-0x0;var _0x542366=_0xb931[_0x1bd2ec];return _0x542366;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db'][_0x1b93('0x0')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b93('0x1'),'afterDestroy':_0x1b93('0x2')};function emitEvent(_0x2d11a5){return function(_0x42a943,_0x1c8b77,_0xa36141){UserProfileEvents[_0x1b93('0x3')](_0x2d11a5+':'+_0x42a943['id'],_0x42a943);UserProfileEvents[_0x1b93('0x3')](_0x2d11a5,_0x42a943);_0xa36141(null);};}for(var e in events){if(events[_0x1b93('0x4')](e)){var event=events[e];UserProfile[_0x1b93('0x5')](e,emitEvent(event));}}module[_0x1b93('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 40486ad..d11bb39 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 _0x7880=['VoiceMail','VoiceRecording','parentSections','Agents','membername','role','Telephones','User','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','musiconholds','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Sound','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','sequelize','query','toString','define','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','params','all','ignore','union','find','push','autoAssociation','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','include','forEach','reportType','default','DefaultReports','CustomReports','count','rows','includeAll','CmContact','Tags','color','tag','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','findAll','map','catch','model','then','name','associatedResources','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','odbc','childModel','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','voicemails'];(function(_0x5926a4,_0x42f65d){var _0xd64f0f=function(_0x252e72){while(--_0x252e72){_0x5926a4['push'](_0x5926a4['shift']());}};_0xd64f0f(++_0x42f65d);}(_0x7880,0x1f4));var _0x0788=function(_0x1a7edf,_0x5c4e04){_0x1a7edf=_0x1a7edf-0x0;var _0x56c1d9=_0x7880[_0x1a7edf];return _0x56c1d9;};'use strict';var _=require('lodash');var attributes=require(_0x0788('0x0'));var qs=require(_0x0788('0x1'));var squel=require(_0x0788('0x2'));module[_0x0788('0x3')]=function(_0x47dc20){var _0x446ded=_0x47dc20['models'];function _0x3925a6(_0x1e0814,_0x317885){return new Promise(function(_0xd53e7d,_0x262f5c){if(!_0x317885)return _0xd53e7d(null);var _0x775629=_0x317885[_0x0788('0x4')]?{[_0x317885[_0x0788('0x4')][_0x0788('0x5')]]:_0x317885[_0x0788('0x4')]['value']}:undefined;return _0x446ded[_0x1e0814][_0x0788('0x6')]({'where':_0x775629,'raw':!![]})['then'](function(_0xabaf81){_0x317885['associatedResources']=_[_0x0788('0x7')](_0xabaf81,'id');_0xd53e7d(_0x317885);})[_0x0788('0x8')](function(_0x1f9ff6){_0x262f5c(_0x1f9ff6);});});}function _0xee8670(_0x469ebe,_0x5d747c){return new Promise(function(_0x1920b3,_0x37560d){var _0x21c303=_0x469ebe[_0x0788('0x4')]?{[_0x469ebe[_0x0788('0x4')][_0x0788('0x5')]]:_0x469ebe[_0x0788('0x4')]['value']}:undefined;return _0x446ded[_0x469ebe[_0x0788('0x9')]][_0x0788('0x6')]({'where':_0x21c303,'raw':!![]})[_0x0788('0xa')](function(_0x13cf07){_0x5d747c['associatedResources']=_[_0x0788('0x7')](_0x13cf07,function(_0x4ed024){return _0x4ed024[_0x0788('0xb')];});_0x1920b3(_0x5d747c);})[_0x0788('0x8')](function(_0x3fd1e4){_0x37560d(_0x3fd1e4);});});}function _0xb406fb(_0x2ddd1a,_0x430e34,_0x5e1a29){if(!_0x430e34)return Promise['resolve'](null);return new Promise(function(_0x17d805,_0x461d9d){return _0x446ded['UserProfileResource'][_0x0788('0x6')]({'where':{'sectionId':_0x430e34['id']},'raw':!![]})[_0x0788('0xa')](function(_0x17ae59){if(_0x2ddd1a['field']&&_0x2ddd1a[_0x0788('0x5')]!=='id'){_0x430e34[_0x0788('0xc')]=_['map'](_0x17ae59,function(_0x11ea01){return _0x11ea01[_0x2ddd1a['field']];});}else{if(_0x5e1a29===_0x0788('0xd')){_0x430e34['associatedResources']=_[_0x0788('0x7')](_0x17ae59,function(_0x3c37ca){return{'id':_0x3c37ca[_0x0788('0xe')],'type':_0x3c37ca[_0x0788('0xf')]};});}else{_0x430e34[_0x0788('0xc')]=_['map'](_0x17ae59,function(_0x48ec43){return _0x48ec43[_0x0788('0xe')];});}}_0x17d805(_0x430e34);})[_0x0788('0x8')](function(_0x645320){_0x461d9d(_0x645320);});});}function _0x7a99a1(_0x5ba1da,_0x4d5c93){var _0x79204e={'parentSections':[]};switch(_0x5ba1da[_0x0788('0x10')]()){case _0x0788('0x11'):_0x79204e['childModel']='SquareProject';break;case _0x0788('0x12'):_0x79204e[_0x0788('0x13')]='SquareOdbc';break;case'squarerecordings':_0x79204e[_0x0788('0x13')]=_0x0788('0x14');_0x79204e['parentSections']=[{'name':_0x0788('0x15'),'field':_0x0788('0xb'),'foreignKey':_0x0788('0x16')}];break;case _0x0788('0x17'):_0x79204e[_0x0788('0x13')]=_0x0788('0x18');break;case _0x0788('0x19'):_0x79204e[_0x0788('0x13')]='CmContact';_0x79204e['parentSections']=[{'name':_0x0788('0x1a'),'field':'id','foreignKey':_0x0788('0x1b')}];break;case'lists':_0x79204e['childModel']=_0x0788('0x1c');break;case _0x0788('0x1d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x1e');break;case _0x0788('0x1f'):_0x79204e[_0x0788('0x13')]=_0x0788('0x20');break;case _0x0788('0x21'):_0x79204e[_0x0788('0x13')]=_0x0788('0x22');break;case'chatwebsites':_0x79204e[_0x0788('0x13')]=_0x0788('0x23');break;case _0x0788('0x24'):_0x79204e[_0x0788('0x13')]=_0x0788('0x25');break;case _0x0788('0x26'):_0x79204e[_0x0788('0x13')]=_0x0788('0x27');break;case _0x0788('0x28'):case _0x0788('0x29'):case'outboundroutes':_0x79204e['childModel']='VoiceExtension';break;case'contexts':_0x79204e['childModel']='VoiceContext';break;case _0x0788('0x2a'):_0x79204e[_0x0788('0x13')]=_0x0788('0x2b');break;case'voicerecordings':_0x79204e[_0x0788('0x13')]=_0x0788('0x2c');_0x79204e[_0x0788('0x2d')]=[{'name':_0x0788('0x2e'),'field':'name','foreignKey':_0x0788('0x2f'),'model':'User','filter':{'field':_0x0788('0x30'),'value':['agent']}},{'name':_0x0788('0x31'),'field':_0x0788('0xb'),'foreignKey':'membername','model':_0x0788('0x32'),'filter':{'field':_0x0788('0x30'),'value':['telephone']}},{'name':_0x0788('0x33'),'field':'name','foreignKey':_0x0788('0x34'),'model':'VoiceQueue','filter':{'field':_0x0788('0xf'),'value':['inbound']}},{'name':_0x0788('0x35'),'field':'name','foreignKey':'queue','model':_0x0788('0x36'),'filter':{'field':_0x0788('0xf'),'value':[_0x0788('0x37')]}}];break;case _0x0788('0x38'):_0x79204e[_0x0788('0x13')]='VoiceMusicOnHold';break;case'chanspies':_0x79204e['childModel']='VoiceChanSpy';break;case _0x0788('0x39'):_0x79204e[_0x0788('0x13')]=_0x0788('0x3a');break;case _0x0788('0x3b'):_0x79204e[_0x0788('0x13')]='Campaign';break;case'mailqueues':_0x79204e[_0x0788('0x13')]=_0x0788('0x3c');break;case _0x0788('0x3d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x3e');break;case _0x0788('0x3f'):_0x79204e[_0x0788('0x13')]=_0x0788('0x40');break;case _0x0788('0x41'):_0x79204e['childModel']='OpenchannelQueue';break;case _0x0788('0x42'):_0x79204e[_0x0788('0x13')]=_0x0788('0x43');break;case'smsqueues':_0x79204e['childModel']='SmsQueue';break;case _0x0788('0x44'):_0x79204e[_0x0788('0x13')]=_0x0788('0x45');break;case _0x0788('0x46'):_0x79204e[_0x0788('0x13')]=_0x0788('0x47');break;case _0x0788('0x48'):_0x79204e[_0x0788('0x13')]='WhatsappAccount';break;case _0x0788('0x49'):_0x79204e[_0x0788('0x13')]=_0x0788('0x4a');break;case _0x0788('0x4b'):case'queuecampaigns':_0x79204e[_0x0788('0x13')]=_0x0788('0x36');if(_0x4d5c93){_0x79204e['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x0788('0x4c'):case'agents':case _0x0788('0x4d'):_0x79204e[_0x0788('0x13')]=_0x0788('0x32');if(_0x4d5c93){_0x79204e[_0x0788('0x2d')]=[{'name':_0x0788('0x4e'),'filter':{'field':_0x0788('0x30'),'value':[_0x0788('0x4f'),_0x0788('0x50')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x0788('0x51'):_0x79204e[_0x0788('0x13')]=_0x0788('0x52');break;case'salesforceaccounts':_0x79204e[_0x0788('0x13')]=_0x0788('0x53');break;case _0x0788('0x54'):_0x79204e[_0x0788('0x13')]=_0x0788('0x55');break;case'sugarcrmaccounts':_0x79204e['childModel']=_0x0788('0x56');break;case _0x0788('0x57'):_0x79204e['childModel']=_0x0788('0x58');break;case'zohoaccounts':_0x79204e[_0x0788('0x13')]=_0x0788('0x59');break;case _0x0788('0x5a'):_0x79204e[_0x0788('0x13')]=_0x0788('0x32');break;case _0x0788('0x5b'):_0x79204e[_0x0788('0x13')]=_0x0788('0x5c');break;case'dispositions':_0x79204e[_0x0788('0x13')]=_0x0788('0x5d');break;case _0x0788('0x5e'):_0x79204e['childModel']=_0x0788('0x5f');break;case _0x0788('0x60'):_0x79204e['childModel']=_0x0788('0x61');break;case _0x0788('0x62'):_0x79204e[_0x0788('0x13')]=_0x0788('0x63');break;case _0x0788('0x64'):_0x79204e[_0x0788('0x13')]='Schedule';break;case'sounds':_0x79204e[_0x0788('0x13')]=_0x0788('0x65');break;case'tags':_0x79204e[_0x0788('0x13')]=_0x0788('0x66');break;case _0x0788('0x67'):_0x79204e[_0x0788('0x13')]=_0x0788('0x68');break;case _0x0788('0x69'):_0x79204e[_0x0788('0x13')]=_0x0788('0x6a');break;case _0x0788('0x6b'):_0x79204e[_0x0788('0x13')]=_0x0788('0x6c');break;case _0x0788('0x6d'):_0x79204e['childModel']=_0x0788('0x6e');break;case _0x0788('0x6f'):_0x79204e[_0x0788('0x13')]='Plugin';break;case _0x0788('0x70'):_0x79204e[_0x0788('0x13')]='AnalyticExtractedReport';_0x79204e['parentSections']=[{'name':_0x0788('0x71'),'field':'id','foreignKey':_0x0788('0x72')}];break;case _0x0788('0x73'):_0x79204e[_0x0788('0x13')]=_0x0788('0x74');break;}return _0x79204e;}function _0x4c08f9(_0x535648,_0x336d30){var _0x3be076=_0x535648[_0x0788('0x75')](0x0)['toUpperCase']()+_0x535648['slice'](0x1);var _0x3a25d3={'type':_0x446ded['Sequelize'][_0x0788('0x76')][_0x0788('0x77')],'raw':!![]};return new Promise(function(_0x223767,_0x13a021){var _0x101e8b=squel[_0x0788('0x78')]()[_0x0788('0x5')](_0x0788('0x79')+_0x3be076+_0x0788('0x7a'),'id')[_0x0788('0x5')]('ui.createdAt')[_0x0788('0x7b')](_0x0788('0x7c')+_0x535648+_0x0788('0x7d'),'ui')[_0x0788('0x7e')]('ui.UserId\x20=\x20?',_0x336d30['id']);return _0x446ded[_0x0788('0x7f')][_0x0788('0x80')](_0x101e8b[_0x0788('0x81')](),_0x3a25d3)[_0x0788('0xa')](function(_0x5a353f){_0x336d30[_0x3be076+'OpenTabs']=_0x5a353f;_0x223767(_0x5a353f);})[_0x0788('0x8')](function(_0x4aa3af){_0x13a021(_0x4aa3af);});});}return _0x47dc20[_0x0788('0x82')](_0x0788('0x83'),attributes,{'tableName':_0x0788('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x47f22c){var _0x3baf23={'raw':![],'where':{}};var _0x348cbf={};var _0xdc7103={'count':0x0,'rows':[]};var _0x150403=_0x47f22c[_0x0788('0x80')]['section'];var _0x25201f=_0x47f22c[_0x0788('0x80')][_0x0788('0x85')]||![];var _0x59a436=_0x7a99a1(_0x150403,_0x25201f);if(!_0x59a436['childModel'])throw new Error(_0x0788('0x86')+_0x150403+'\x27');var _0x1bb234=[{'name':_0x150403}];if(!_[_0x0788('0x87')](_0x59a436['parentSections']))_0x1bb234=_0x59a436[_0x0788('0x2d')];var _0x23f7d1=[];for(var _0x1eb4c9=0x0;_0x1eb4c9<_0x1bb234[_0x0788('0x88')];_0x1eb4c9++){_0x23f7d1['push'](_0x446ded['UserProfileSection']['find']({'where':{'userProfileId':_0x47f22c[_0x0788('0x89')]['id'],'name':_0x1bb234[_0x1eb4c9][_0x0788('0xb')]},'raw':!![]}));}return Promise[_0x0788('0x8a')](_0x23f7d1)['then'](function(_0x59b296){var _0xaa2d4d=_['filter'](_0x59b296,function(_0x955bfa){return _0x955bfa?_0x955bfa:undefined;});var _0x3d1181=_[_0x0788('0x4')](_0x1bb234,[_0x0788('0x8b'),!![]]);var _0x1834fb=_[_0x0788('0x87')](_0xaa2d4d)&&_[_0x0788('0x87')](_0x3d1181)?null:_[_0x0788('0x8c')](_0x3d1181,_0xaa2d4d);if(!_0x1834fb)return null;var _0x433c05=[];for(var _0x137a7a=0x0;_0x137a7a<_0x1834fb['length'];_0x137a7a++){var _0x240210=_[_0x0788('0x8d')](_0x1bb234,function(_0x52926f){return _0x1834fb[_0x137a7a]?_0x52926f['name']===_0x1834fb[_0x137a7a][_0x0788('0xb')]:null;});if(_0x240210){if(_0x1834fb[_0x137a7a][_0x0788('0x8b')]){_0x433c05[_0x0788('0x8e')](_0x3925a6(_0x59a436[_0x0788('0x13')],_0x1834fb[_0x137a7a]));}else{if(!_0x1834fb[_0x137a7a][_0x0788('0x8f')]){_0x433c05[_0x0788('0x8e')](_0xb406fb(_0x240210,_0x1834fb[_0x137a7a],_0x59a436['childModel']));}else{if(_0x240210[_0x0788('0x9')]){_0x433c05[_0x0788('0x8e')](_0xee8670(_0x240210,_0x1834fb[_0x137a7a]));}}}}}return Promise[_0x0788('0x8a')](_0x433c05);})[_0x0788('0xa')](function(_0x4e0282){var _0x35c612=_0x4e0282;var _0x2272e2=null;if(_0x35c612){_0x2272e2=_0x35c612[_0x0788('0x88')]===0x1?_0x35c612[0x0]:null;}if(!_0x2272e2&&!_0x35c612)return _0xdc7103;var _0x360476=_0x446ded[_0x59a436['childModel']]['rawAttributes'];_0x348cbf[_0x0788('0x9')]=_[_0x0788('0x90')](_0x360476);_0x348cbf[_0x0788('0x80')]=_[_0x0788('0x90')](_0x47f22c[_0x0788('0x80')]);_0x348cbf[_0x0788('0x91')]=_[_0x0788('0x92')](_0x348cbf[_0x0788('0x9')],_0x348cbf[_0x0788('0x80')]);_0x3baf23['attributes']=_[_0x0788('0x92')](_0x348cbf[_0x0788('0x9')],qs[_0x0788('0x93')](_0x47f22c['query']['fields']));_0x3baf23[_0x0788('0x94')]=_0x3baf23['attributes'][_0x0788('0x88')]?_0x3baf23[_0x0788('0x94')]:_0x348cbf[_0x0788('0x9')];if(!_0x47f22c[_0x0788('0x80')][_0x0788('0x95')](_0x0788('0x96'))){_0x3baf23[_0x0788('0x97')]=qs[_0x0788('0x97')](_0x47f22c[_0x0788('0x80')]['limit']);_0x3baf23[_0x0788('0x98')]=qs[_0x0788('0x98')](_0x47f22c[_0x0788('0x80')]['offset']);}_0x3baf23[_0x0788('0x99')]=qs[_0x0788('0x9a')](_0x47f22c[_0x0788('0x80')]['sort']);_0x3baf23[_0x0788('0x7e')]=qs[_0x0788('0x91')](_[_0x0788('0x9b')](_0x47f22c[_0x0788('0x80')],_0x348cbf[_0x0788('0x91')]));if(_0x47f22c[_0x0788('0x80')][_0x0788('0x4')]){_0x3baf23[_0x0788('0x7e')]=_[_0x0788('0x9c')](_0x3baf23['where'],{'$or':_[_0x0788('0x7')](_0x360476,function(_0x623d29){if(_0x623d29[_0x0788('0xf')][_0x0788('0x9d')]!==_0x0788('0x9e')){var _0x5749fc={};_0x5749fc[_0x623d29[_0x0788('0x5')]]={'$like':'%'+_0x47f22c[_0x0788('0x80')][_0x0788('0x4')]+'%'};return _0x5749fc;}})});}var _0x4fb7f7=[];var _0x1788d1=null;var _0x17430c={};if(_0x2272e2){_0x1788d1=_[_0x0788('0x8d')](_0x1bb234,[_0x0788('0xb'),_0x2272e2[_0x0788('0xb')]]);if(_0x1788d1['field']){_0x17430c={};if(_0x59a436[_0x0788('0x13')]===_0x0788('0xd')){_0x17430c[_0x1788d1['foreignKey']]=_[_0x0788('0x7')](_0x2272e2[_0x0788('0xc')],'id');}else{_0x17430c[_0x1788d1['foreignKey']]=_0x2272e2[_0x0788('0xc')];}_0x4fb7f7[_0x0788('0x8e')](_0x17430c);}else{_0x3baf23[_0x0788('0x7e')]['id']=_0x2272e2['associatedResources'];}}else{for(var _0x28ad96=0x0;_0x28ad96<_0x35c612[_0x0788('0x88')];_0x28ad96++){_0x1788d1=_[_0x0788('0x8d')](_0x1bb234,['name',_0x35c612[_0x28ad96][_0x0788('0xb')]]);if(_0x1788d1[_0x0788('0x5')]){_0x17430c={};_0x17430c[_0x1788d1[_0x0788('0x9f')]]=_0x35c612[_0x28ad96][_0x0788('0xc')];_0x4fb7f7[_0x0788('0x8e')](_0x17430c);}else{if(!_0x3baf23[_0x0788('0x7e')]['id'])_0x3baf23[_0x0788('0x7e')]['id']=[];_0x35c612[_0x28ad96][_0x0788('0xc')]['forEach'](function(_0x36ebc1){_0x3baf23[_0x0788('0x7e')]['id'][_0x0788('0x8e')](_0x36ebc1);});}}}if(!_[_0x0788('0x87')](_0x4fb7f7)){_0x3baf23['where']=_['merge'](_0x3baf23[_0x0788('0x7e')],{'$and':{'$or':_0x4fb7f7}});}_0x3baf23=_[_0x0788('0x9c')]({},_0x3baf23,_0x47f22c['options']);if(_0x2272e2&&!_0x2272e2[_0x0788('0x8f')]&&_0x59a436[_0x0788('0x13')]===_0x0788('0xd')){if(_0x47f22c['query']['includeAll']){_0x3baf23[_0x0788('0xa0')]=[{'all':!![]}];}return _0x446ded[_0x59a436[_0x0788('0x13')]]['findAll'](_0x3baf23)['then'](function(_0x4ace43){var _0x17ea6a=[];_0x4ace43[_0x0788('0xa1')](function(_0x59260c){var _0x1827e4;switch(_0x59260c[_0x0788('0xa2')]){case _0x0788('0xa3'):_0x1827e4=_[_0x0788('0x8d')](_0x2272e2[_0x0788('0xc')],function(_0x4864f5){return _0x4864f5['id']===_0x59260c[_0x0788('0x72')]&&_0x4864f5['type']===_0x0788('0xa4');});break;case'custom':_0x1827e4=_[_0x0788('0x8d')](_0x2272e2[_0x0788('0xc')],function(_0xbf1276){return _0xbf1276['id']===_0x59260c[_0x0788('0x72')]&&_0xbf1276[_0x0788('0xf')]===_0x0788('0xa5');});break;}if(_0x1827e4)_0x17ea6a[_0x0788('0x8e')](_0x59260c);});_0xdc7103[_0x0788('0xa6')]=_0x17ea6a[_0x0788('0x88')];_0xdc7103[_0x0788('0xa7')]=_0x17ea6a;return _0xdc7103;});}else{return _0x446ded[_0x59a436[_0x0788('0x13')]][_0x0788('0xa6')]({'where':_0x3baf23[_0x0788('0x7e')]})['then'](function(_0x55fe55){_0xdc7103['count']=_0x55fe55;if(_0x47f22c[_0x0788('0x80')][_0x0788('0xa8')]){if(_0x59a436[_0x0788('0x13')]===_0x0788('0xa9')){_0x3baf23[_0x0788('0xa0')]=[{'model':_0x446ded[_0x0788('0x66')],'as':_0x0788('0xaa'),'attributes':['id',_0x0788('0xb'),_0x0788('0xab')],'required':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?!![]:![]},{'model':_0x446ded['Tag'],'as':'ThroughTags','attributes':['id',_0x0788('0xb'),_0x0788('0xab')],'through':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?{'attributes':[],'where':{'TagId':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]||undefined}}:{},'required':_0x47f22c[_0x0788('0x80')][_0x0788('0xac')]?!![]:![]}];}else{_0x3baf23['include']=[{'all':!![]}];}}return _0x446ded[_0x59a436['childModel']][_0x0788('0x6')](_0x3baf23);})[_0x0788('0xa')](function(_0x285972){_0xdc7103[_0x0788('0xa7')]=_0x285972;if(_0x150403===_0x0788('0x2e')&&_0x47f22c[_0x0788('0x80')]['openTabs']===_0x0788('0xad')){var _0x1311d7=[];for(var _0x3ca412=0x0;_0x3ca412<_0xdc7103[_0x0788('0xa7')][_0x0788('0x88')];_0x3ca412++){_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xae'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7['push'](_0x4c08f9(_0x0788('0xb0'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb1'),_0xdc7103[_0x0788('0xa7')][_0x3ca412]['dataValues']));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb2'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb3'),_0xdc7103[_0x0788('0xa7')][_0x3ca412][_0x0788('0xaf')]));_0x1311d7[_0x0788('0x8e')](_0x4c08f9(_0x0788('0xb4'),_0xdc7103['rows'][_0x3ca412][_0x0788('0xaf')]));}return Promise['all'](_0x1311d7)[_0x0788('0xa')](function(){return _0xdc7103;});}return _0xdc7103;});}});}}});}; \ No newline at end of file +var _0x4745=['smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','QueueCampaigns','users','telephones','User','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','trunks','Trunk','variables','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','QueryTypes','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','params','union','autoAssociation','length','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','filters','merge','key','VIRTUAL','find','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','tag','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','all','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','lists','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','parentSections','Agents','name','membername','agent','Telephones','role','telephone','VoiceQueues','inbound','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount'];(function(_0x5671c9,_0x324c29){var _0x2a2065=function(_0x2eeea0){while(--_0x2eeea0){_0x5671c9['push'](_0x5671c9['shift']());}};_0x2a2065(++_0x324c29);}(_0x4745,0x1e7));var _0x5474=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x4745[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x5474('0x0'));var attributes=require(_0x5474('0x1'));var qs=require(_0x5474('0x2'));var squel=require(_0x5474('0x3'));module[_0x5474('0x4')]=function(_0xa40879){var _0x4bd69d=_0xa40879[_0x5474('0x5')];function _0x28d8aa(_0x39fb9b,_0x45a895){return new Promise(function(_0x34f89b,_0x4e7ce7){if(!_0x45a895)return _0x34f89b(null);var _0x3d1e1=_0x45a895[_0x5474('0x6')]?{[_0x45a895['filter'][_0x5474('0x7')]]:_0x45a895['filter'][_0x5474('0x8')]}:undefined;return _0x4bd69d[_0x39fb9b][_0x5474('0x9')]({'where':_0x3d1e1,'raw':!![]})['then'](function(_0xf876f8){_0x45a895[_0x5474('0xa')]=_[_0x5474('0xb')](_0xf876f8,'id');_0x34f89b(_0x45a895);})[_0x5474('0xc')](function(_0x4444dd){_0x4e7ce7(_0x4444dd);});});}function _0x40c4a8(_0x3f729f,_0x2fc637){return new Promise(function(_0x48fc51,_0x38dadb){var _0x2bb3c1=_0x3f729f[_0x5474('0x6')]?{[_0x3f729f[_0x5474('0x6')][_0x5474('0x7')]]:_0x3f729f[_0x5474('0x6')][_0x5474('0x8')]}:undefined;return _0x4bd69d[_0x3f729f[_0x5474('0xd')]][_0x5474('0x9')]({'where':_0x2bb3c1,'raw':!![]})['then'](function(_0xb828fe){_0x2fc637[_0x5474('0xa')]=_[_0x5474('0xb')](_0xb828fe,function(_0x1790eb){return _0x1790eb['name'];});_0x48fc51(_0x2fc637);})['catch'](function(_0x50b949){_0x38dadb(_0x50b949);});});}function _0x50eb42(_0x32f0e4,_0x172bcb,_0x2da774){if(!_0x172bcb)return Promise['resolve'](null);return new Promise(function(_0x3da004,_0x2be746){return _0x4bd69d['UserProfileResource'][_0x5474('0x9')]({'where':{'sectionId':_0x172bcb['id']},'raw':!![]})[_0x5474('0xe')](function(_0x18b0fe){if(_0x32f0e4[_0x5474('0x7')]&&_0x32f0e4[_0x5474('0x7')]!=='id'){_0x172bcb['associatedResources']=_[_0x5474('0xb')](_0x18b0fe,function(_0x5f31a9){return _0x5f31a9[_0x32f0e4[_0x5474('0x7')]];});}else{if(_0x2da774===_0x5474('0xf')){_0x172bcb['associatedResources']=_['map'](_0x18b0fe,function(_0x563539){return{'id':_0x563539[_0x5474('0x10')],'type':_0x563539[_0x5474('0x11')]};});}else{_0x172bcb[_0x5474('0xa')]=_[_0x5474('0xb')](_0x18b0fe,function(_0x36b389){return _0x36b389[_0x5474('0x10')];});}}_0x3da004(_0x172bcb);})[_0x5474('0xc')](function(_0x1e512d){_0x2be746(_0x1e512d);});});}function _0x219be1(_0x9c80cc,_0x542d1f){var _0x5f065d={'parentSections':[]};switch(_0x9c80cc[_0x5474('0x12')]()){case _0x5474('0x13'):_0x5f065d[_0x5474('0x14')]='SquareProject';break;case _0x5474('0x15'):_0x5f065d['childModel']=_0x5474('0x16');break;case _0x5474('0x17'):_0x5f065d['childModel']=_0x5474('0x18');_0x5f065d['parentSections']=[{'name':_0x5474('0x19'),'field':'name','foreignKey':_0x5474('0x1a')}];break;case _0x5474('0x1b'):_0x5f065d[_0x5474('0x14')]='JscriptyProject';break;case _0x5474('0x1c'):_0x5f065d[_0x5474('0x14')]='CmContact';_0x5f065d['parentSections']=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x5474('0x1d'):_0x5f065d[_0x5474('0x14')]='CmList';break;case _0x5474('0x1e'):_0x5f065d['childModel']=_0x5474('0x1f');break;case'globalcustomfields':_0x5f065d[_0x5474('0x14')]='CmCustomField';break;case _0x5474('0x20'):_0x5f065d['childModel']=_0x5474('0x21');break;case _0x5474('0x22'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x23');break;case'faxqueues':_0x5f065d['childModel']=_0x5474('0x24');break;case _0x5474('0x25'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x26');break;case'inboundroutes':case'internalroutes':case _0x5474('0x27'):_0x5f065d[_0x5474('0x14')]='VoiceExtension';break;case _0x5474('0x28'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x29');break;case _0x5474('0x2a'):_0x5f065d['childModel']=_0x5474('0x2b');break;case _0x5474('0x2c'):_0x5f065d[_0x5474('0x14')]='VoiceRecording';_0x5f065d[_0x5474('0x2d')]=[{'name':_0x5474('0x2e'),'field':_0x5474('0x2f'),'foreignKey':_0x5474('0x30'),'model':'User','filter':{'field':'role','value':[_0x5474('0x31')]}},{'name':_0x5474('0x32'),'field':_0x5474('0x2f'),'foreignKey':_0x5474('0x30'),'model':'User','filter':{'field':_0x5474('0x33'),'value':[_0x5474('0x34')]}},{'name':_0x5474('0x35'),'field':_0x5474('0x2f'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':[_0x5474('0x36')]}},{'name':'QueueCampaigns','field':_0x5474('0x2f'),'foreignKey':_0x5474('0x37'),'model':_0x5474('0x38'),'filter':{'field':_0x5474('0x11'),'value':[_0x5474('0x39')]}}];break;case _0x5474('0x3a'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x3b');break;case _0x5474('0x3c'):_0x5f065d['childModel']=_0x5474('0x3d');break;case _0x5474('0x3e'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x3f');break;case'ivrcampaigns':_0x5f065d[_0x5474('0x14')]='Campaign';break;case _0x5474('0x40'):_0x5f065d[_0x5474('0x14')]='MailQueue';break;case _0x5474('0x41'):_0x5f065d[_0x5474('0x14')]='MailAccount';break;case _0x5474('0x42'):_0x5f065d[_0x5474('0x14')]='MailSubstatus';break;case _0x5474('0x43'):_0x5f065d['childModel']=_0x5474('0x44');break;case _0x5474('0x45'):_0x5f065d['childModel']=_0x5474('0x46');break;case _0x5474('0x47'):_0x5f065d[_0x5474('0x14')]='SmsQueue';break;case _0x5474('0x48'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x49');break;case _0x5474('0x4a'):_0x5f065d['childModel']='WhatsappQueue';break;case _0x5474('0x4b'):_0x5f065d['childModel']=_0x5474('0x4c');break;case _0x5474('0x4d'):_0x5f065d['childModel']=_0x5474('0x4e');break;case _0x5474('0x4f'):case'queuecampaigns':_0x5f065d[_0x5474('0x14')]=_0x5474('0x38');if(_0x542d1f){_0x5f065d['parentSections']=[{'name':'VoiceQueues'},{'name':_0x5474('0x50')}];}break;case _0x5474('0x51'):case'agents':case _0x5474('0x52'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x53');if(_0x542d1f){_0x5f065d[_0x5474('0x2d')]=[{'name':'Users','filter':{'field':_0x5474('0x33'),'value':[_0x5474('0x54'),'user']},'ignore':!![]},{'name':_0x5474('0x2e')},{'name':_0x5474('0x32')}];}break;case _0x5474('0x55'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x56');break;case _0x5474('0x57'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x58');break;case _0x5474('0x59'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x5a');break;case _0x5474('0x5b'):_0x5f065d['childModel']=_0x5474('0x5c');break;case _0x5474('0x5d'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x5e');break;case'zohoaccounts':_0x5f065d[_0x5474('0x14')]=_0x5474('0x5f');break;case _0x5474('0x60'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x53');break;case _0x5474('0x61'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x62');break;case _0x5474('0x63'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x64');break;case _0x5474('0x65'):_0x5f065d[_0x5474('0x14')]='Dashboard';break;case'intervals':_0x5f065d['childModel']=_0x5474('0x66');break;case _0x5474('0x67'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x68');break;case _0x5474('0x69'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x6a');break;case _0x5474('0x6b'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x6c');break;case'tags':_0x5f065d[_0x5474('0x14')]=_0x5474('0x6d');break;case _0x5474('0x6e'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x6f');break;case _0x5474('0x70'):_0x5f065d['childModel']='Trigger';break;case _0x5474('0x71'):_0x5f065d['childModel']=_0x5474('0x72');break;case _0x5474('0x73'):_0x5f065d[_0x5474('0x14')]='Variable';break;case _0x5474('0x74'):_0x5f065d['childModel']=_0x5474('0x75');break;case _0x5474('0x76'):_0x5f065d[_0x5474('0x14')]=_0x5474('0xf');_0x5f065d[_0x5474('0x2d')]=[{'name':_0x5474('0x77'),'field':'id','foreignKey':_0x5474('0x78')}];break;case'metrics':_0x5f065d['childModel']=_0x5474('0x79');break;}return _0x5f065d;}function _0x42d6ba(_0x5d2aa1,_0x191401){var _0x282a17=_0x5d2aa1[_0x5474('0x7a')](0x0)['toUpperCase']()+_0x5d2aa1['slice'](0x1);var _0x27e27d={'type':_0x4bd69d['Sequelize'][_0x5474('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x121951,_0x438290){var _0x142edd=squel['select']()['field'](_0x5474('0x7c')+_0x282a17+_0x5474('0x7d'),'id')['field'](_0x5474('0x7e'))[_0x5474('0x7f')](_0x5474('0x80')+_0x5d2aa1+_0x5474('0x81'),'ui')[_0x5474('0x82')](_0x5474('0x83'),_0x191401['id']);return _0x4bd69d['sequelize'][_0x5474('0x84')](_0x142edd[_0x5474('0x85')](),_0x27e27d)['then'](function(_0x3ad815){_0x191401[_0x282a17+_0x5474('0x86')]=_0x3ad815;_0x121951(_0x3ad815);})['catch'](function(_0x495737){_0x438290(_0x495737);});});}return _0xa40879[_0x5474('0x87')]('UserProfile',attributes,{'tableName':_0x5474('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x13cda3){var _0x458805={'raw':![],'where':{}};var _0x173dad={};var _0xaa0f67={'count':0x0,'rows':[]};var _0x2a9f70=_0x13cda3['query']['section'];var _0x1cbdc5=_0x13cda3[_0x5474('0x84')][_0x5474('0x89')]||![];var _0x2eb32e=_0x219be1(_0x2a9f70,_0x1cbdc5);if(!_0x2eb32e[_0x5474('0x14')])throw new Error(_0x5474('0x8a')+_0x2a9f70+'\x27');var _0x200b78=[{'name':_0x2a9f70}];if(!_[_0x5474('0x8b')](_0x2eb32e[_0x5474('0x2d')]))_0x200b78=_0x2eb32e[_0x5474('0x2d')];var _0x59e85e=[];for(var _0x38e08f=0x0;_0x38e08f<_0x200b78['length'];_0x38e08f++){_0x59e85e[_0x5474('0x8c')](_0x4bd69d[_0x5474('0x8d')]['find']({'where':{'userProfileId':_0x13cda3[_0x5474('0x8e')]['id'],'name':_0x200b78[_0x38e08f]['name']},'raw':!![]}));}return Promise['all'](_0x59e85e)[_0x5474('0xe')](function(_0x593672){var _0x526b3c=_[_0x5474('0x6')](_0x593672,function(_0x18a99a){return _0x18a99a?_0x18a99a:undefined;});var _0x2f4d1e=_[_0x5474('0x6')](_0x200b78,['ignore',!![]]);var _0x25a24e=_[_0x5474('0x8b')](_0x526b3c)&&_[_0x5474('0x8b')](_0x2f4d1e)?null:_[_0x5474('0x8f')](_0x2f4d1e,_0x526b3c);if(!_0x25a24e)return null;var _0x1920a3=[];for(var _0x1a5ac0=0x0;_0x1a5ac0<_0x25a24e['length'];_0x1a5ac0++){var _0x4131bb=_['find'](_0x200b78,function(_0x198eb8){return _0x25a24e[_0x1a5ac0]?_0x198eb8[_0x5474('0x2f')]===_0x25a24e[_0x1a5ac0]['name']:null;});if(_0x4131bb){if(_0x25a24e[_0x1a5ac0]['ignore']){_0x1920a3[_0x5474('0x8c')](_0x28d8aa(_0x2eb32e[_0x5474('0x14')],_0x25a24e[_0x1a5ac0]));}else{if(!_0x25a24e[_0x1a5ac0][_0x5474('0x90')]){_0x1920a3[_0x5474('0x8c')](_0x50eb42(_0x4131bb,_0x25a24e[_0x1a5ac0],_0x2eb32e[_0x5474('0x14')]));}else{if(_0x4131bb[_0x5474('0xd')]){_0x1920a3[_0x5474('0x8c')](_0x40c4a8(_0x4131bb,_0x25a24e[_0x1a5ac0]));}}}}}return Promise['all'](_0x1920a3);})['then'](function(_0x28823e){var _0x10cff3=_0x28823e;var _0x41b119=null;if(_0x10cff3){_0x41b119=_0x10cff3[_0x5474('0x91')]===0x1?_0x10cff3[0x0]:null;}if(!_0x41b119&&!_0x10cff3)return _0xaa0f67;var _0xa69efe=_0x4bd69d[_0x2eb32e[_0x5474('0x14')]][_0x5474('0x92')];_0x173dad[_0x5474('0xd')]=_[_0x5474('0x93')](_0xa69efe);_0x173dad['query']=_['keys'](_0x13cda3['query']);_0x173dad['filters']=_[_0x5474('0x94')](_0x173dad['model'],_0x173dad[_0x5474('0x84')]);_0x458805[_0x5474('0x95')]=_[_0x5474('0x94')](_0x173dad[_0x5474('0xd')],qs[_0x5474('0x96')](_0x13cda3[_0x5474('0x84')]['fields']));_0x458805[_0x5474('0x95')]=_0x458805[_0x5474('0x95')][_0x5474('0x91')]?_0x458805['attributes']:_0x173dad[_0x5474('0xd')];if(!_0x13cda3[_0x5474('0x84')][_0x5474('0x97')]('nolimit')){_0x458805[_0x5474('0x98')]=qs[_0x5474('0x98')](_0x13cda3[_0x5474('0x84')][_0x5474('0x98')]);_0x458805[_0x5474('0x99')]=qs[_0x5474('0x99')](_0x13cda3[_0x5474('0x84')]['offset']);}_0x458805[_0x5474('0x9a')]=qs[_0x5474('0x9b')](_0x13cda3[_0x5474('0x84')][_0x5474('0x9b')]);_0x458805[_0x5474('0x82')]=qs['filters'](_[_0x5474('0x9c')](_0x13cda3[_0x5474('0x84')],_0x173dad[_0x5474('0x9d')]));if(_0x13cda3[_0x5474('0x84')][_0x5474('0x6')]){_0x458805['where']=_[_0x5474('0x9e')](_0x458805[_0x5474('0x82')],{'$or':_[_0x5474('0xb')](_0xa69efe,function(_0x2a3746){if(_0x2a3746[_0x5474('0x11')][_0x5474('0x9f')]!==_0x5474('0xa0')){var _0x38a640={};_0x38a640[_0x2a3746[_0x5474('0x7')]]={'$like':'%'+_0x13cda3['query']['filter']+'%'};return _0x38a640;}})});}var _0x14deb4=[];var _0x1c8148=null;var _0x15fb33={};if(_0x41b119){_0x1c8148=_[_0x5474('0xa1')](_0x200b78,[_0x5474('0x2f'),_0x41b119[_0x5474('0x2f')]]);if(_0x1c8148['field']){_0x15fb33={};if(_0x2eb32e[_0x5474('0x14')]==='AnalyticExtractedReport'){_0x15fb33[_0x1c8148[_0x5474('0xa2')]]=_[_0x5474('0xb')](_0x41b119[_0x5474('0xa')],'id');}else{_0x15fb33[_0x1c8148['foreignKey']]=_0x41b119[_0x5474('0xa')];}_0x14deb4[_0x5474('0x8c')](_0x15fb33);}else{_0x458805[_0x5474('0x82')]['id']=_0x41b119['associatedResources'];}}else{for(var _0x21f6e6=0x0;_0x21f6e6<_0x10cff3[_0x5474('0x91')];_0x21f6e6++){_0x1c8148=_[_0x5474('0xa1')](_0x200b78,['name',_0x10cff3[_0x21f6e6]['name']]);if(_0x1c8148['field']){_0x15fb33={};_0x15fb33[_0x1c8148[_0x5474('0xa2')]]=_0x10cff3[_0x21f6e6][_0x5474('0xa')];_0x14deb4[_0x5474('0x8c')](_0x15fb33);}else{if(!_0x458805[_0x5474('0x82')]['id'])_0x458805[_0x5474('0x82')]['id']=[];_0x10cff3[_0x21f6e6][_0x5474('0xa')][_0x5474('0xa3')](function(_0x5362cc){_0x458805[_0x5474('0x82')]['id'][_0x5474('0x8c')](_0x5362cc);});}}}if(!_[_0x5474('0x8b')](_0x14deb4)){_0x458805[_0x5474('0x82')]=_[_0x5474('0x9e')](_0x458805[_0x5474('0x82')],{'$and':{'$or':_0x14deb4}});}_0x458805=_[_0x5474('0x9e')]({},_0x458805,_0x13cda3[_0x5474('0xa4')]);if(_0x41b119&&!_0x41b119[_0x5474('0x90')]&&_0x2eb32e[_0x5474('0x14')]===_0x5474('0xf')){if(_0x13cda3[_0x5474('0x84')][_0x5474('0xa5')]){_0x458805[_0x5474('0xa6')]=[{'all':!![]}];}return _0x4bd69d[_0x2eb32e[_0x5474('0x14')]][_0x5474('0x9')](_0x458805)[_0x5474('0xe')](function(_0x19aa83){var _0x1de17a=[];_0x19aa83[_0x5474('0xa3')](function(_0x5994f5){var _0xbd8403;switch(_0x5994f5[_0x5474('0xa7')]){case _0x5474('0xa8'):_0xbd8403=_['find'](_0x41b119['associatedResources'],function(_0x20c3ed){return _0x20c3ed['id']===_0x5994f5['reportId']&&_0x20c3ed[_0x5474('0x11')]===_0x5474('0xa9');});break;case _0x5474('0xaa'):_0xbd8403=_[_0x5474('0xa1')](_0x41b119[_0x5474('0xa')],function(_0x67b1a9){return _0x67b1a9['id']===_0x5994f5[_0x5474('0x78')]&&_0x67b1a9[_0x5474('0x11')]===_0x5474('0xab');});break;}if(_0xbd8403)_0x1de17a[_0x5474('0x8c')](_0x5994f5);});_0xaa0f67[_0x5474('0xac')]=_0x1de17a['length'];_0xaa0f67[_0x5474('0xad')]=_0x1de17a;return _0xaa0f67;});}else{return _0x4bd69d[_0x2eb32e[_0x5474('0x14')]][_0x5474('0xac')]({'where':_0x458805[_0x5474('0x82')]})[_0x5474('0xe')](function(_0x2f8c7b){_0xaa0f67['count']=_0x2f8c7b;if(_0x13cda3[_0x5474('0x84')]['includeAll']){if(_0x2eb32e[_0x5474('0x14')]==='CmContact'){_0x458805[_0x5474('0xa6')]=[{'model':_0x4bd69d[_0x5474('0x6d')],'as':_0x5474('0xae'),'attributes':['id',_0x5474('0x2f'),_0x5474('0xaf')],'required':_0x13cda3[_0x5474('0x84')][_0x5474('0xb0')]?!![]:![]},{'model':_0x4bd69d[_0x5474('0x6d')],'as':'ThroughTags','attributes':['id','name',_0x5474('0xaf')],'through':_0x13cda3['query'][_0x5474('0xb0')]?{'attributes':[],'where':{'TagId':_0x13cda3['query']['tag']||undefined}}:{},'required':_0x13cda3[_0x5474('0x84')][_0x5474('0xb0')]?!![]:![]}];}else{_0x458805[_0x5474('0xa6')]=[{'all':!![]}];}}return _0x4bd69d[_0x2eb32e[_0x5474('0x14')]]['findAll'](_0x458805);})[_0x5474('0xe')](function(_0x22e42d){_0xaa0f67['rows']=_0x22e42d;if(_0x2a9f70===_0x5474('0x2e')&&_0x13cda3[_0x5474('0x84')][_0x5474('0xb1')]===_0x5474('0xb2')){var _0x5ec2a3=[];for(var _0x28b73f=0x0;_0x28b73f<_0xaa0f67[_0x5474('0xad')][_0x5474('0x91')];_0x28b73f++){_0x5ec2a3['push'](_0x42d6ba(_0x5474('0xb3'),_0xaa0f67['rows'][_0x28b73f]['dataValues']));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba(_0x5474('0xb4'),_0xaa0f67[_0x5474('0xad')][_0x28b73f][_0x5474('0xb5')]));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba(_0x5474('0xb6'),_0xaa0f67[_0x5474('0xad')][_0x28b73f][_0x5474('0xb5')]));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba(_0x5474('0xb7'),_0xaa0f67[_0x5474('0xad')][_0x28b73f][_0x5474('0xb5')]));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba(_0x5474('0xb8'),_0xaa0f67[_0x5474('0xad')][_0x28b73f][_0x5474('0xb5')]));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba('whatsapp',_0xaa0f67['rows'][_0x28b73f][_0x5474('0xb5')]));}return Promise[_0x5474('0xb9')](_0x5ec2a3)[_0x5474('0xe')](function(){return _0xaa0f67;});}return _0xaa0f67;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8e38e6a..90eaf92 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 _0x3e0c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','defaults','redis','localhost','request','then','info','request\x20sent','debug','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x5caee2,_0x325a65){var _0x3f8747=function(_0x2d86bc){while(--_0x2d86bc){_0x5caee2['push'](_0x5caee2['shift']());}};_0x3f8747(++_0x325a65);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x2a2b4,_0xcc17b){_0x2a2b4=_0x2a2b4-0x0;var _0x16bec5=_0x3e0c[_0x2a2b4];return _0x16bec5;};'use strict';var _=require(_0xc3e0('0x0'));var util=require(_0xc3e0('0x1'));var moment=require(_0xc3e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3e0('0x3'));var fs=require('fs');var Redis=require(_0xc3e0('0x4'));var db=require(_0xc3e0('0x5'))['db'];var utils=require(_0xc3e0('0x6'));var logger=require(_0xc3e0('0x7'))('rpc');var config=require(_0xc3e0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc3e0('0x9')](config[_0xc3e0('0xa')],{'host':_0xc3e0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x433fd1,_0x33ed9c,_0xca5897){return new BPromise(function(_0x231293,_0x3f38c5){return client[_0xc3e0('0xc')](_0x433fd1,_0xca5897)[_0xc3e0('0xd')](function(_0x493aaa){logger[_0xc3e0('0xe')]('UserProfile,\x20%s,\x20%s',_0x33ed9c,_0xc3e0('0xf'));logger[_0xc3e0('0x10')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x33ed9c,_0xc3e0('0xf'),JSON['stringify'](_0x493aaa));if(_0x493aaa[_0xc3e0('0x11')]){if(_0x493aaa[_0xc3e0('0x11')][_0xc3e0('0x12')]===0x1f4){logger[_0xc3e0('0x11')](_0xc3e0('0x13'),_0x33ed9c,_0x493aaa[_0xc3e0('0x11')][_0xc3e0('0x14')]);return _0x3f38c5(_0x493aaa['error'][_0xc3e0('0x14')]);}logger[_0xc3e0('0x11')]('UserProfile,\x20%s,\x20%s',_0x33ed9c,_0x493aaa[_0xc3e0('0x11')][_0xc3e0('0x14')]);return _0x231293(_0x493aaa[_0xc3e0('0x11')][_0xc3e0('0x14')]);}else{logger[_0xc3e0('0xe')](_0xc3e0('0x13'),_0x33ed9c,_0xc3e0('0xf'));_0x231293(_0x493aaa[_0xc3e0('0x15')][_0xc3e0('0x14')]);}})[_0xc3e0('0x16')](function(_0x6b3666){logger[_0xc3e0('0x11')](_0xc3e0('0x13'),_0x33ed9c,_0x6b3666);_0x3f38c5(_0x6b3666);});});} \ No newline at end of file +var _0x7096=['UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','then','info'];(function(_0x4c37e0,_0x10e0d9){var _0x53eaf2=function(_0x391307){while(--_0x391307){_0x4c37e0['push'](_0x4c37e0['shift']());}};_0x53eaf2(++_0x10e0d9);}(_0x7096,0x10c));var _0x6709=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7096[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});config[_0x6709('0xb')]=_[_0x6709('0xc')](config[_0x6709('0xb')],{'host':_0x6709('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6709('0xe'))[_0x6709('0xf')](socket);function respondWithRpcPromise(_0xbcb47,_0x1aa476,_0x12eea2){return new BPromise(function(_0x426ea1,_0x5de1fa){return client['request'](_0xbcb47,_0x12eea2)[_0x6709('0x10')](function(_0x262261){logger[_0x6709('0x11')](_0x6709('0x12'),_0x1aa476,_0x6709('0x13'));logger[_0x6709('0x14')](_0x6709('0x15'),_0x1aa476,_0x6709('0x13'),JSON['stringify'](_0x262261));if(_0x262261[_0x6709('0x16')]){if(_0x262261[_0x6709('0x16')][_0x6709('0x17')]===0x1f4){logger[_0x6709('0x16')]('UserProfile,\x20%s,\x20%s',_0x1aa476,_0x262261[_0x6709('0x16')]['message']);return _0x5de1fa(_0x262261[_0x6709('0x16')]['message']);}logger[_0x6709('0x16')](_0x6709('0x12'),_0x1aa476,_0x262261[_0x6709('0x16')][_0x6709('0x18')]);return _0x426ea1(_0x262261['error']['message']);}else{logger['info'](_0x6709('0x12'),_0x1aa476,_0x6709('0x13'));_0x426ea1(_0x262261['result'][_0x6709('0x18')]);}})[_0x6709('0x19')](function(_0xf1a70d){logger['error'](_0x6709('0x12'),_0x1aa476,_0xf1a70d);_0x5de1fa(_0xf1a70d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 0e6f038..f5c61d0 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 _0x4e10=['remove','removeListener','save'];(function(_0x2605a0,_0x229de5){var _0x3c9031=function(_0x319322){while(--_0x319322){_0x2605a0['push'](_0x2605a0['shift']());}};_0x3c9031(++_0x229de5);}(_0x4e10,0xfb));var _0x04e1=function(_0x534157,_0x3aa410){_0x534157=_0x534157-0x0;var _0x21aba6=_0x4e10[_0x534157];return _0x21aba6;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x04e1('0x0'),_0x04e1('0x1'),'update'];function createListener(_0x140ff6,_0x7a7c06){return function(_0x344e3e){_0x7a7c06['emit'](_0x140ff6,_0x344e3e);};}function removeListener(_0x2889f5,_0x30f5ee){return function(){UserProfileEvents[_0x04e1('0x2')](_0x2889f5,_0x30f5ee);};}exports['register']=function(_0x835fa8){for(var _0x5e91a8=0x0,_0x1a7613=events['length'];_0x5e91a8<_0x1a7613;_0x5e91a8++){var _0x4d5653=events[_0x5e91a8];var _0x2d6d1b=createListener('userProfile:'+_0x4d5653,_0x835fa8);UserProfileEvents['on'](_0x4d5653,_0x2d6d1b);}}; \ No newline at end of file +var _0xb45a=['update','emit','register','length','userProfile:','./userProfile.events','save'];(function(_0x813d0a,_0x4fd3d7){var _0x241352=function(_0x3ca375){while(--_0x3ca375){_0x813d0a['push'](_0x813d0a['shift']());}};_0x241352(++_0x4fd3d7);}(_0xb45a,0x1b0));var _0xab45=function(_0x295317,_0x46aebf){_0x295317=_0x295317-0x0;var _0x458246=_0xb45a[_0x295317];return _0x458246;};'use strict';var UserProfileEvents=require(_0xab45('0x0'));var events=[_0xab45('0x1'),'remove',_0xab45('0x2')];function createListener(_0x31797b,_0x5342b4){return function(_0x11061f){_0x5342b4[_0xab45('0x3')](_0x31797b,_0x11061f);};}function removeListener(_0x2e8b84,_0x1f1f9e){return function(){UserProfileEvents['removeListener'](_0x2e8b84,_0x1f1f9e);};}exports[_0xab45('0x4')]=function(_0x5b112d){for(var _0x2cd0db=0x0,_0x28704d=events[_0xab45('0x5')];_0x2cd0db<_0x28704d;_0x2cd0db++){var _0xee8063=events[_0x2cd0db];var _0x5d1a68=createListener(_0xab45('0x6')+_0xee8063,_0x5b112d);UserProfileEvents['on'](_0xee8063,_0x5d1a68);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index b244514..613c274 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 _0x7c9c=['delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/:id','show','put','update'];(function(_0x451a5d,_0x213298){var _0x1e64a7=function(_0x2f344e){while(--_0x2f344e){_0x451a5d['push'](_0x451a5d['shift']());}};_0x1e64a7(++_0x213298);}(_0x7c9c,0x93));var _0xc7c9=function(_0x31880d,_0x4f0ff3){_0x31880d=_0x31880d-0x0;var _0x423823=_0x7c9c[_0x31880d];return _0x423823;};'use strict';var multer=require('multer');var util=require(_0xc7c9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7c9('0x1'));var router=express[_0xc7c9('0x2')]();var fs_extra=require(_0xc7c9('0x3'));var auth=require(_0xc7c9('0x4'));var interaction=require(_0xc7c9('0x5'));var config=require(_0xc7c9('0x6'));var controller=require(_0xc7c9('0x7'));router[_0xc7c9('0x8')]('/',auth[_0xc7c9('0x9')](),controller[_0xc7c9('0xa')]);router[_0xc7c9('0x8')]('/describe',auth[_0xc7c9('0x9')](),controller['describe']);router[_0xc7c9('0x8')](_0xc7c9('0xb'),auth[_0xc7c9('0x9')](),controller[_0xc7c9('0xc')]);router['post']('/',auth[_0xc7c9('0x9')](),controller['create']);router[_0xc7c9('0xd')](_0xc7c9('0xb'),auth[_0xc7c9('0x9')](),controller[_0xc7c9('0xe')]);router[_0xc7c9('0xf')]('/:id',auth[_0xc7c9('0x9')](),controller[_0xc7c9('0x10')]);module[_0xc7c9('0x11')]=router; \ No newline at end of file +var _0xa112=['delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','update'];(function(_0x137bda,_0x2b4b52){var _0x3258d6=function(_0x80824f){while(--_0x80824f){_0x137bda['push'](_0x137bda['shift']());}};_0x3258d6(++_0x2b4b52);}(_0xa112,0x153));var _0x2a11=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xa112[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0x2a11('0x0'));var util=require(_0x2a11('0x1'));var path=require(_0x2a11('0x2'));var timeout=require(_0x2a11('0x3'));var express=require(_0x2a11('0x4'));var router=express[_0x2a11('0x5')]();var fs_extra=require(_0x2a11('0x6'));var auth=require(_0x2a11('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2a11('0x8'));var controller=require('./userProfileResource.controller');router[_0x2a11('0x9')]('/',auth[_0x2a11('0xa')](),controller[_0x2a11('0xb')]);router[_0x2a11('0x9')](_0x2a11('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x2a11('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2a11('0xd')]);router[_0x2a11('0xe')]('/',auth[_0x2a11('0xa')](),controller[_0x2a11('0xf')]);router[_0x2a11('0x10')]('/:id',auth[_0x2a11('0xa')](),controller[_0x2a11('0x11')]);router[_0x2a11('0x12')](_0x2a11('0x13'),auth[_0x2a11('0xa')](),controller[_0x2a11('0x14')]);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 8840357..9a69b47 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 _0xa2c9=['STRING','INTEGER','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa2c9,0x172));var _0x9a2c=function(_0x129126,_0x2098ee){_0x129126=_0x129126-0x0;var _0x1e7685=_0xa2c9[_0x129126];return _0x1e7685;};'use strict';var Sequelize=require(_0x9a2c('0x0'));module[_0x9a2c('0x1')]={'name':{'type':Sequelize[_0x9a2c('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9a2c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9a2c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8864=['INTEGER','exports'];(function(_0x3da30a,_0x4a428d){var _0xf81303=function(_0x4a561b){while(--_0x4a561b){_0x3da30a['push'](_0x3da30a['shift']());}};_0xf81303(++_0x4a428d);}(_0x8864,0xa5));var _0x4886=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x8864[_0x234ae1];return _0x227ba0;};'use strict';var Sequelize=require('sequelize');module[_0x4886('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4886('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index dafbb34..84e8a81 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 _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','UserProfileResource','includeAll','rows','catch','show'];(function(_0x16de43,_0x2bb75f){var _0x2aaa5d=function(_0x5d6eee){while(--_0x5d6eee){_0x16de43['push'](_0x16de43['shift']());}};_0x2aaa5d(++_0x2bb75f);}(_0x0295,0x1f0));var _0x5029=function(_0xcceb4e,_0x16b9cd){_0xcceb4e=_0xcceb4e-0x0;var _0x458bda=_0x0295[_0xcceb4e];return _0x458bda;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['UserProfileResource'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['UserProfileResource'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file +var _0x5c3c=['findAll','rows','params','merge','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','UserProfileResource','includeAll','include'];(function(_0x18a4b6,_0x105565){var _0x5a972c=function(_0x1f2d37){while(--_0x1f2d37){_0x18a4b6['push'](_0x18a4b6['shift']());}};_0x5a972c(++_0x105565);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x5c3c[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['UserProfileResource'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['UserProfileResource'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['UserProfileResource'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['UserProfileResource'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));};exports[_0xc5c3('0x49')]=function(_0x34a2c3,_0x4add6b){return db[_0xc5c3('0x3d')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x4add6b,null))[_0xc5c3('0x44')](handleError(_0x4add6b,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 31f737f..5316db7 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 _0xe1bd=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','UserProfileResource'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xe1bd,0xac));var _0xde1b=function(_0x2a4a35,_0x3f5ccb){_0x2a4a35=_0x2a4a35-0x0;var _0x35a706=_0xe1bd[_0x2a4a35];return _0x35a706;};'use strict';var _=require(_0xde1b('0x0'));var util=require(_0xde1b('0x1'));var logger=require(_0xde1b('0x2'))(_0xde1b('0x3'));var moment=require('moment');var BPromise=require(_0xde1b('0x4'));var rp=require(_0xde1b('0x5'));var fs=require('fs');var path=require(_0xde1b('0x6'));var rimraf=require('rimraf');var config=require(_0xde1b('0x7'));var attributes=require(_0xde1b('0x8'));module['exports']=function(_0x3e8601,_0x48b5ac){return _0x3e8601['define'](_0xde1b('0x9'),attributes,{'tableName':_0xde1b('0xa'),'paranoid':![],'indexes':[{'name':_0xde1b('0xb'),'fields':[_0xde1b('0xc'),_0xde1b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc969=['./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xc969,0xcb));var _0x9c96=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xc969[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x9c96('0x0'));var util=require('util');var logger=require(_0x9c96('0x1'))(_0x9c96('0x2'));var moment=require(_0x9c96('0x3'));var BPromise=require(_0x9c96('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c96('0x5'));var rimraf=require(_0x9c96('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c96('0x7'));module[_0x9c96('0x8')]=function(_0x5b7cf4,_0x270380){return _0x5b7cf4[_0x9c96('0x9')](_0x9c96('0xa'),attributes,{'tableName':_0x9c96('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x9c96('0xc'),_0x9c96('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 1246cd4..8764595 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 _0x0649=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info'];(function(_0xa42e5,_0x2228e2){var _0x36951c=function(_0x46bb32){while(--_0x46bb32){_0xa42e5['push'](_0xa42e5['shift']());}};_0x36951c(++_0x2228e2);}(_0x0649,0xc8));var _0x9064=function(_0x2d8c20,_0x3e6f43){_0x2d8c20=_0x2d8c20-0x0;var _0x211bba=_0x0649[_0x2d8c20];return _0x211bba;};'use strict';var _=require(_0x9064('0x0'));var util=require(_0x9064('0x1'));var moment=require('moment');var BPromise=require(_0x9064('0x2'));var rs=require(_0x9064('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9064('0x4'))['db'];var utils=require(_0x9064('0x5'));var logger=require(_0x9064('0x6'))(_0x9064('0x7'));var config=require(_0x9064('0x8'));var jayson=require(_0x9064('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9067,_0x32ebda,_0x4400a0){return new BPromise(function(_0x3e8694,_0x141292){return client[_0x9064('0xa')](_0x1c9067,_0x4400a0)[_0x9064('0xb')](function(_0x23ca69){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x32ebda,_0x9064('0xc'));logger[_0x9064('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x32ebda,_0x9064('0xc'),JSON[_0x9064('0xe')](_0x23ca69));if(_0x23ca69[_0x9064('0xf')]){if(_0x23ca69[_0x9064('0xf')][_0x9064('0x10')]===0x1f4){logger[_0x9064('0xf')](_0x9064('0x11'),_0x32ebda,_0x23ca69[_0x9064('0xf')][_0x9064('0x12')]);return _0x141292(_0x23ca69[_0x9064('0xf')]['message']);}logger[_0x9064('0xf')](_0x9064('0x11'),_0x32ebda,_0x23ca69[_0x9064('0xf')][_0x9064('0x12')]);return _0x3e8694(_0x23ca69[_0x9064('0xf')]['message']);}else{logger[_0x9064('0x13')](_0x9064('0x11'),_0x32ebda,_0x9064('0xc'));_0x3e8694(_0x23ca69['result'][_0x9064('0x12')]);}})['catch'](function(_0x88277){logger[_0x9064('0xf')](_0x9064('0x11'),_0x32ebda,_0x88277);_0x141292(_0x88277);});});} \ No newline at end of file +var _0x538a=['request','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x538a,0xa1));var _0xa538=function(_0x1e00f2,_0x1c38a0){_0x1e00f2=_0x1e00f2-0x0;var _0x4c31d6=_0x538a[_0x1e00f2];return _0x4c31d6;};'use strict';var _=require(_0xa538('0x0'));var util=require(_0xa538('0x1'));var moment=require('moment');var BPromise=require(_0xa538('0x2'));var rs=require(_0xa538('0x3'));var fs=require('fs');var Redis=require(_0xa538('0x4'));var db=require(_0xa538('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa538('0x6'));var jayson=require(_0xa538('0x7'));var client=jayson[_0xa538('0x8')][_0xa538('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aad24,_0x1dcbb1,_0x2c2854){return new BPromise(function(_0x47c686,_0xc8ee97){return client[_0xa538('0xa')](_0x4aad24,_0x2c2854)['then'](function(_0x5290ee){logger['info'](_0xa538('0xb'),_0x1dcbb1,_0xa538('0xc'));logger[_0xa538('0xd')](_0xa538('0xe'),_0x1dcbb1,'request\x20sent',JSON['stringify'](_0x5290ee));if(_0x5290ee[_0xa538('0xf')]){if(_0x5290ee[_0xa538('0xf')][_0xa538('0x10')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x1dcbb1,_0x5290ee['error'][_0xa538('0x11')]);return _0xc8ee97(_0x5290ee[_0xa538('0xf')][_0xa538('0x11')]);}logger[_0xa538('0xf')](_0xa538('0xb'),_0x1dcbb1,_0x5290ee[_0xa538('0xf')][_0xa538('0x11')]);return _0x47c686(_0x5290ee[_0xa538('0xf')][_0xa538('0x11')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x1dcbb1,_0xa538('0xc'));_0x47c686(_0x5290ee[_0xa538('0x12')][_0xa538('0x11')]);}})['catch'](function(_0x563182){logger['error'](_0xa538('0xb'),_0x1dcbb1,_0x563182);_0xc8ee97(_0x563182);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 67976a7..dcd87b7 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 _0x1d1e=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','update','delete','destroy'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x1d1e,0xc7));var _0xe1d1=function(_0xac15c3,_0x2451ea){_0xac15c3=_0xac15c3-0x0;var _0x3ef3db=_0x1d1e[_0xac15c3];return _0x3ef3db;};'use strict';var multer=require('multer');var util=require(_0xe1d1('0x0'));var path=require(_0xe1d1('0x1'));var timeout=require(_0xe1d1('0x2'));var express=require(_0xe1d1('0x3'));var router=express['Router']();var fs_extra=require(_0xe1d1('0x4'));var auth=require(_0xe1d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe1d1('0x6'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0xe1d1('0x7')](),controller[_0xe1d1('0x8')]);router[_0xe1d1('0x9')](_0xe1d1('0xa'),auth[_0xe1d1('0x7')](),controller[_0xe1d1('0xb')]);router[_0xe1d1('0x9')](_0xe1d1('0xc'),auth[_0xe1d1('0x7')](),controller['show']);router[_0xe1d1('0xd')]('/',auth[_0xe1d1('0x7')](),controller['create']);router['put'](_0xe1d1('0xc'),auth[_0xe1d1('0x7')](),controller[_0xe1d1('0xe')]);router[_0xe1d1('0xf')](_0xe1d1('0xc'),auth[_0xe1d1('0x7')](),controller[_0xe1d1('0x10')]);module[_0xe1d1('0x11')]=router; \ No newline at end of file +var _0x40b1=['index','/describe','describe','show','post','put','/:id','update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated'];(function(_0x4e61bc,_0x1cff51){var _0x4e0fb1=function(_0x587f0d){while(--_0x587f0d){_0x4e61bc['push'](_0x4e61bc['shift']());}};_0x4e0fb1(++_0x1cff51);}(_0x40b1,0x1e5));var _0x140b=function(_0x45323e,_0x3e5f42){_0x45323e=_0x45323e-0x0;var _0x1dfe8d=_0x40b1[_0x45323e];return _0x1dfe8d;};'use strict';var multer=require(_0x140b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x140b('0x1'));var router=express[_0x140b('0x2')]();var fs_extra=require(_0x140b('0x3'));var auth=require(_0x140b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x140b('0x5'));var controller=require(_0x140b('0x6'));router[_0x140b('0x7')]('/',auth[_0x140b('0x8')](),controller[_0x140b('0x9')]);router['get'](_0x140b('0xa'),auth[_0x140b('0x8')](),controller[_0x140b('0xb')]);router[_0x140b('0x7')]('/:id',auth[_0x140b('0x8')](),controller[_0x140b('0xc')]);router[_0x140b('0xd')]('/',auth[_0x140b('0x8')](),controller['create']);router[_0x140b('0xe')](_0x140b('0xf'),auth[_0x140b('0x8')](),controller[_0x140b('0x10')]);router['delete'](_0x140b('0xf'),auth[_0x140b('0x8')](),controller[_0x140b('0x11')]);module[_0x140b('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 6342fe7..f94e06e 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefda=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x3d0766,_0x4ab88a){var _0x42cc11=function(_0x463464){while(--_0x463464){_0x3d0766['push'](_0x3d0766['shift']());}};_0x42cc11(++_0x4ab88a);}(_0xefda,0x96));var _0xaefd=function(_0x5d5853,_0x780f4c){_0x5d5853=_0x5d5853-0x0;var _0x3584c9=_0xefda[_0x5d5853];return _0x3584c9;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xaefd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaefd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaefd('0x1')],'set':function(_0x2ade44){this[_0xaefd('0x4')](_0xaefd('0x5'),_0x2ade44?_0x2ade44[_0xaefd('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xaefd('0x5'))?this[_0xaefd('0x7')](_0xaefd('0x5'))[_0xaefd('0x8')](''):[];}}}; \ No newline at end of file +var _0xd914=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x29a273,_0x155fc0){var _0x225d4f=function(_0x5b06e9){while(--_0x5b06e9){_0x29a273['push'](_0x29a273['shift']());}};_0x225d4f(++_0x155fc0);}(_0xd914,0x17f));var _0x4d91=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0xd914[_0x4629ee];return _0x47fb5b;};'use strict';var Sequelize=require(_0x4d91('0x0'));module[_0x4d91('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4d91('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4d91('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4d91('0x2')],'set':function(_0x2db8c5){this['setDataValue'](_0x4d91('0x5'),_0x2db8c5?_0x2db8c5['join'](''):[]);},'get':function(){return this[_0x4d91('0x6')](_0x4d91('0x5'))?this[_0x4d91('0x6')](_0x4d91('0x5'))[_0x4d91('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c5a3686..5e81840 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 _0x0e22=['offset','set','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x344eb8,_0x5b5fd1){var _0x104c0e=function(_0x1e2592){while(--_0x1e2592){_0x344eb8['push'](_0x344eb8['shift']());}};_0x104c0e(++_0x5b5fd1);}(_0x0e22,0x78));var _0x20e2=function(_0x3e779c,_0x546ea2){_0x3e779c=_0x3e779c-0x0;var _0x22ab11=_0x0e22[_0x3e779c];return _0x22ab11;};'use strict';var emlformat=require(_0x20e2('0x0'));var rimraf=require(_0x20e2('0x1'));var zipdir=require(_0x20e2('0x2'));var jsonpatch=require(_0x20e2('0x3'));var rp=require(_0x20e2('0x4'));var moment=require(_0x20e2('0x5'));var BPromise=require(_0x20e2('0x6'));var Mustache=require(_0x20e2('0x7'));var util=require(_0x20e2('0x8'));var path=require('path');var sox=require(_0x20e2('0x9'));var csv=require(_0x20e2('0xa'));var ejs=require(_0x20e2('0xb'));var fs=require('fs');var fs_extra=require(_0x20e2('0xc'));var _=require(_0x20e2('0xd'));var squel=require('squel');var crypto=require(_0x20e2('0xe'));var jsforce=require(_0x20e2('0xf'));var deskjs=require(_0x20e2('0x10'));var toCsv=require(_0x20e2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x20e2('0x11'));var as=require(_0x20e2('0x12'));var hardwareService=require(_0x20e2('0x13'));var logger=require(_0x20e2('0x14'))('api');var utils=require(_0x20e2('0x15'));var config=require(_0x20e2('0x16'));var licenseUtil=require(_0x20e2('0x17'));var db=require(_0x20e2('0x18'))['db'];function respondWithStatusCode(_0x39d8a2,_0x428a2c){_0x428a2c=_0x428a2c||0xcc;return function(_0x3535e6){if(_0x3535e6){return _0x39d8a2[_0x20e2('0x19')](_0x428a2c);}return _0x39d8a2[_0x20e2('0x1a')](_0x428a2c)[_0x20e2('0x1b')]();};}function respondWithResult(_0x56981d,_0x152394){_0x152394=_0x152394||0xc8;return function(_0x455b27){if(_0x455b27){return _0x56981d[_0x20e2('0x1a')](_0x152394)[_0x20e2('0x1c')](_0x455b27);}};}function respondWithFilteredResult(_0xa3b029,_0xb7a80f){return function(_0x5992b6){if(_0x5992b6){var _0x38dc9f=typeof _0xb7a80f['offset']===_0x20e2('0x1d')&&typeof _0xb7a80f[_0x20e2('0x1e')]===_0x20e2('0x1d');var _0x12c52b=_0x5992b6[_0x20e2('0x1f')];var _0x441531=_0x38dc9f?0x0:_0xb7a80f[_0x20e2('0x20')];var _0x191754=_0x38dc9f?_0x5992b6['count']:_0xb7a80f[_0x20e2('0x20')]+_0xb7a80f[_0x20e2('0x1e')];var _0x13e3e1;if(_0x191754>=_0x12c52b){_0x191754=_0x12c52b;_0x13e3e1=0xc8;}else{_0x13e3e1=0xce;}_0xa3b029[_0x20e2('0x1a')](_0x13e3e1);return _0xa3b029[_0x20e2('0x21')]('Content-Range',_0x441531+'-'+_0x191754+'/'+_0x12c52b)[_0x20e2('0x1c')](_0x5992b6);}return null;};}function patchUpdates(_0xaea79d){return function(_0x2fb59a){try{jsonpatch[_0x20e2('0x22')](_0x2fb59a,_0xaea79d,!![]);}catch(_0x26645c){return BPromise['reject'](_0x26645c);}return _0x2fb59a[_0x20e2('0x23')]();};}function saveUpdates(_0x43c703,_0x1a0ef0){return function(_0x474241){if(_0x474241){return _0x474241[_0x20e2('0x24')](_0x43c703)[_0x20e2('0x25')](function(_0x52aace){return _0x52aace;});}return null;};}function removeEntity(_0x1c27f5,_0x30105d){return function(_0x7ac1fc){if(_0x7ac1fc){return _0x7ac1fc[_0x20e2('0x26')]()[_0x20e2('0x25')](function(){_0x1c27f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f981,_0x145e2c){return function(_0x513467){if(!_0x513467){_0x18f981[_0x20e2('0x19')](0x194);}return _0x513467;};}function handleError(_0x3ae16d,_0x47eddb){_0x47eddb=_0x47eddb||0x1f4;return function(_0x19f640){logger[_0x20e2('0x27')](_0x19f640[_0x20e2('0x28')]);if(_0x19f640[_0x20e2('0x29')]){delete _0x19f640[_0x20e2('0x29')];}_0x3ae16d[_0x20e2('0x1a')](_0x47eddb)[_0x20e2('0x2a')](_0x19f640);};}exports['index']=function(_0x4a8ed5,_0x3700d4){var _0x16308e={},_0x55a646={},_0x2b46ee={'count':0x0,'rows':[]};var _0x5db586=_[_0x20e2('0x2b')](db['UserProfileSection'][_0x20e2('0x2c')],function(_0x1f8357){return{'name':_0x1f8357[_0x20e2('0x2d')],'type':_0x1f8357[_0x20e2('0x2e')][_0x20e2('0x2f')]};});_0x55a646[_0x20e2('0x30')]=_['map'](_0x5db586,_0x20e2('0x29'));_0x55a646[_0x20e2('0x31')]=_[_0x20e2('0x32')](_0x4a8ed5[_0x20e2('0x31')]);_0x55a646[_0x20e2('0x33')]=_[_0x20e2('0x34')](_0x55a646[_0x20e2('0x30')],_0x55a646[_0x20e2('0x31')]);_0x16308e[_0x20e2('0x35')]=_[_0x20e2('0x34')](_0x55a646[_0x20e2('0x30')],qs[_0x20e2('0x36')](_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x36')]));_0x16308e[_0x20e2('0x35')]=_0x16308e['attributes']['length']?_0x16308e['attributes']:_0x55a646[_0x20e2('0x30')];if(!_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x37')](_0x20e2('0x38'))){_0x16308e['limit']=qs[_0x20e2('0x1e')](_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x1e')]);_0x16308e[_0x20e2('0x20')]=qs['offset'](_0x4a8ed5['query'][_0x20e2('0x20')]);}_0x16308e[_0x20e2('0x39')]=qs['sort'](_0x4a8ed5[_0x20e2('0x31')]['sort']);_0x16308e[_0x20e2('0x3a')]=qs[_0x20e2('0x33')](_[_0x20e2('0x3b')](_0x4a8ed5[_0x20e2('0x31')],_0x55a646[_0x20e2('0x33')]),_0x5db586);if(_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x3c')]){_0x16308e['where']=_[_0x20e2('0x3d')](_0x16308e[_0x20e2('0x3a')],{'$or':_[_0x20e2('0x2b')](_0x5db586,function(_0xb45ba1){if(_0xb45ba1[_0x20e2('0x2e')]!==_0x20e2('0x3e')){var _0xf4b8be={};_0xf4b8be[_0xb45ba1[_0x20e2('0x29')]]={'$like':'%'+_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x3c')]+'%'};return _0xf4b8be;}})});}_0x16308e=_[_0x20e2('0x3d')]({},_0x16308e,_0x4a8ed5[_0x20e2('0x3f')]);var _0x115d64={'where':_0x16308e[_0x20e2('0x3a')]};return db[_0x20e2('0x40')]['count'](_0x115d64)['then'](function(_0x2a31a6){_0x2b46ee[_0x20e2('0x1f')]=_0x2a31a6;if(_0x4a8ed5[_0x20e2('0x31')][_0x20e2('0x41')]){_0x16308e[_0x20e2('0x42')]=[{'all':!![]}];}return db[_0x20e2('0x40')][_0x20e2('0x43')](_0x16308e);})['then'](function(_0x3b5df9){_0x2b46ee['rows']=_0x3b5df9;return _0x2b46ee;})[_0x20e2('0x25')](respondWithFilteredResult(_0x3700d4,_0x16308e))[_0x20e2('0x44')](handleError(_0x3700d4,null));};exports[_0x20e2('0x45')]=function(_0x58ae9b,_0x59cace){var _0x3a5602={'raw':![],'where':{'id':_0x58ae9b[_0x20e2('0x46')]['id']}},_0x2429af={};_0x2429af[_0x20e2('0x30')]=_[_0x20e2('0x32')](db['UserProfileSection'][_0x20e2('0x2c')]);_0x2429af['query']=_[_0x20e2('0x32')](_0x58ae9b[_0x20e2('0x31')]);_0x2429af[_0x20e2('0x33')]=_['intersection'](_0x2429af['model'],_0x2429af[_0x20e2('0x31')]);_0x3a5602['attributes']=_['intersection'](_0x2429af[_0x20e2('0x30')],qs['fields'](_0x58ae9b[_0x20e2('0x31')][_0x20e2('0x36')]));_0x3a5602[_0x20e2('0x35')]=_0x3a5602['attributes'][_0x20e2('0x47')]?_0x3a5602[_0x20e2('0x35')]:_0x2429af['model'];if(_0x58ae9b[_0x20e2('0x31')][_0x20e2('0x41')]){_0x3a5602[_0x20e2('0x42')]=[{'all':!![]}];}_0x3a5602=_[_0x20e2('0x3d')]({},_0x3a5602,_0x58ae9b[_0x20e2('0x3f')]);return db[_0x20e2('0x40')][_0x20e2('0x48')](_0x3a5602)[_0x20e2('0x25')](handleEntityNotFound(_0x59cace,null))['then'](respondWithResult(_0x59cace,null))[_0x20e2('0x44')](handleError(_0x59cace,null));};exports['create']=function(_0x284bee,_0xb25a7){return db[_0x20e2('0x40')][_0x20e2('0x49')](_0x284bee[_0x20e2('0x4a')],{})[_0x20e2('0x25')](respondWithResult(_0xb25a7,0xc9))[_0x20e2('0x44')](handleError(_0xb25a7,null));};exports[_0x20e2('0x24')]=function(_0x4d53a6,_0x4ed95b){if(_0x4d53a6['body']['id']){delete _0x4d53a6[_0x20e2('0x4a')]['id'];}return db['UserProfileSection'][_0x20e2('0x48')]({'where':{'id':_0x4d53a6[_0x20e2('0x46')]['id']}})[_0x20e2('0x25')](handleEntityNotFound(_0x4ed95b,null))[_0x20e2('0x25')](saveUpdates(_0x4d53a6[_0x20e2('0x4a')],null))['then'](respondWithResult(_0x4ed95b,null))[_0x20e2('0x44')](handleError(_0x4ed95b,null));};exports['destroy']=function(_0x5d050c,_0x3baf3e){return db[_0x20e2('0x40')][_0x20e2('0x48')]({'where':{'id':_0x5d050c[_0x20e2('0x46')]['id']}})[_0x20e2('0x25')](handleEntityNotFound(_0x3baf3e,null))[_0x20e2('0x25')](removeEntity(_0x3baf3e,null))[_0x20e2('0x44')](handleError(_0x3baf3e,null));};exports[_0x20e2('0x4b')]=function(_0xba83cd,_0x5b0a73){return db[_0x20e2('0x40')]['describe']()[_0x20e2('0x25')](respondWithResult(_0x5b0a73,null))['catch'](handleError(_0x5b0a73,null));}; \ No newline at end of file +var _0x078a=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','error','stack','name','send','UserProfileSection','rawAttributes','fieldName','type','model','map','query','keys'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x078a,0x101));var _0xa078=function(_0x46731e,_0x19cd6b){_0x46731e=_0x46731e-0x0;var _0x3909e6=_0x078a[_0x46731e];return _0x3909e6;};'use strict';var emlformat=require(_0xa078('0x0'));var rimraf=require(_0xa078('0x1'));var zipdir=require(_0xa078('0x2'));var jsonpatch=require(_0xa078('0x3'));var rp=require(_0xa078('0x4'));var moment=require(_0xa078('0x5'));var BPromise=require(_0xa078('0x6'));var Mustache=require(_0xa078('0x7'));var util=require(_0xa078('0x8'));var path=require(_0xa078('0x9'));var sox=require(_0xa078('0xa'));var csv=require(_0xa078('0xb'));var ejs=require(_0xa078('0xc'));var fs=require('fs');var fs_extra=require(_0xa078('0xd'));var _=require(_0xa078('0xe'));var squel=require(_0xa078('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa078('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa078('0x11'));var Papa=require(_0xa078('0x12'));var Redis=require(_0xa078('0x13'));var authService=require(_0xa078('0x14'));var qs=require(_0xa078('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa078('0x16'));var logger=require(_0xa078('0x17'))('api');var utils=require(_0xa078('0x18'));var config=require(_0xa078('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa078('0x1a'))['db'];function respondWithStatusCode(_0x57986f,_0x2a20b7){_0x2a20b7=_0x2a20b7||0xcc;return function(_0x2abcab){if(_0x2abcab){return _0x57986f[_0xa078('0x1b')](_0x2a20b7);}return _0x57986f[_0xa078('0x1c')](_0x2a20b7)[_0xa078('0x1d')]();};}function respondWithResult(_0x76aca8,_0x17fdf2){_0x17fdf2=_0x17fdf2||0xc8;return function(_0x5eaf9f){if(_0x5eaf9f){return _0x76aca8[_0xa078('0x1c')](_0x17fdf2)[_0xa078('0x1e')](_0x5eaf9f);}};}function respondWithFilteredResult(_0x5bf8a3,_0x5ec002){return function(_0x23c31e){if(_0x23c31e){var _0x4b4c90=typeof _0x5ec002[_0xa078('0x1f')]===_0xa078('0x20')&&typeof _0x5ec002[_0xa078('0x21')]===_0xa078('0x20');var _0x5a79c7=_0x23c31e[_0xa078('0x22')];var _0x3a7725=_0x4b4c90?0x0:_0x5ec002[_0xa078('0x1f')];var _0x5e7012=_0x4b4c90?_0x23c31e[_0xa078('0x22')]:_0x5ec002['offset']+_0x5ec002[_0xa078('0x21')];var _0x4ff22c;if(_0x5e7012>=_0x5a79c7){_0x5e7012=_0x5a79c7;_0x4ff22c=0xc8;}else{_0x4ff22c=0xce;}_0x5bf8a3['status'](_0x4ff22c);return _0x5bf8a3['set'](_0xa078('0x23'),_0x3a7725+'-'+_0x5e7012+'/'+_0x5a79c7)[_0xa078('0x1e')](_0x23c31e);}return null;};}function patchUpdates(_0x502818){return function(_0x4d04b7){try{jsonpatch[_0xa078('0x24')](_0x4d04b7,_0x502818,!![]);}catch(_0x5eb249){return BPromise[_0xa078('0x25')](_0x5eb249);}return _0x4d04b7['save']();};}function saveUpdates(_0x114483,_0xb3eeab){return function(_0x402b18){if(_0x402b18){return _0x402b18['update'](_0x114483)['then'](function(_0x1777e8){return _0x1777e8;});}return null;};}function removeEntity(_0x2a4104,_0xa059d2){return function(_0x433c4d){if(_0x433c4d){return _0x433c4d['destroy']()[_0xa078('0x26')](function(){_0x2a4104[_0xa078('0x1c')](0xcc)[_0xa078('0x1d')]();});}};}function handleEntityNotFound(_0xb9e47b,_0x30f151){return function(_0xfc2dd3){if(!_0xfc2dd3){_0xb9e47b[_0xa078('0x1b')](0x194);}return _0xfc2dd3;};}function handleError(_0x50db35,_0x36ac02){_0x36ac02=_0x36ac02||0x1f4;return function(_0x4be81e){logger[_0xa078('0x27')](_0x4be81e[_0xa078('0x28')]);if(_0x4be81e[_0xa078('0x29')]){delete _0x4be81e[_0xa078('0x29')];}_0x50db35['status'](_0x36ac02)[_0xa078('0x2a')](_0x4be81e);};}exports['index']=function(_0x1f57be,_0x281736){var _0x35830e={},_0x47c4ea={},_0x5bd390={'count':0x0,'rows':[]};var _0x2bf4bc=_['map'](db[_0xa078('0x2b')][_0xa078('0x2c')],function(_0x416091){return{'name':_0x416091[_0xa078('0x2d')],'type':_0x416091[_0xa078('0x2e')]['key']};});_0x47c4ea[_0xa078('0x2f')]=_[_0xa078('0x30')](_0x2bf4bc,'name');_0x47c4ea[_0xa078('0x31')]=_[_0xa078('0x32')](_0x1f57be['query']);_0x47c4ea[_0xa078('0x33')]=_[_0xa078('0x34')](_0x47c4ea['model'],_0x47c4ea[_0xa078('0x31')]);_0x35830e[_0xa078('0x35')]=_['intersection'](_0x47c4ea[_0xa078('0x2f')],qs[_0xa078('0x36')](_0x1f57be['query'][_0xa078('0x36')]));_0x35830e[_0xa078('0x35')]=_0x35830e['attributes'][_0xa078('0x37')]?_0x35830e[_0xa078('0x35')]:_0x47c4ea[_0xa078('0x2f')];if(!_0x1f57be['query'][_0xa078('0x38')](_0xa078('0x39'))){_0x35830e[_0xa078('0x21')]=qs['limit'](_0x1f57be[_0xa078('0x31')][_0xa078('0x21')]);_0x35830e[_0xa078('0x1f')]=qs[_0xa078('0x1f')](_0x1f57be[_0xa078('0x31')][_0xa078('0x1f')]);}_0x35830e[_0xa078('0x3a')]=qs['sort'](_0x1f57be[_0xa078('0x31')][_0xa078('0x3b')]);_0x35830e[_0xa078('0x3c')]=qs['filters'](_[_0xa078('0x3d')](_0x1f57be['query'],_0x47c4ea[_0xa078('0x33')]),_0x2bf4bc);if(_0x1f57be[_0xa078('0x31')][_0xa078('0x3e')]){_0x35830e[_0xa078('0x3c')]=_[_0xa078('0x3f')](_0x35830e[_0xa078('0x3c')],{'$or':_['map'](_0x2bf4bc,function(_0x2f1e60){if(_0x2f1e60[_0xa078('0x2e')]!==_0xa078('0x40')){var _0x456972={};_0x456972[_0x2f1e60['name']]={'$like':'%'+_0x1f57be['query'][_0xa078('0x3e')]+'%'};return _0x456972;}})});}_0x35830e=_[_0xa078('0x3f')]({},_0x35830e,_0x1f57be[_0xa078('0x41')]);var _0x4dd7f7={'where':_0x35830e[_0xa078('0x3c')]};return db[_0xa078('0x2b')][_0xa078('0x22')](_0x4dd7f7)[_0xa078('0x26')](function(_0xf8e5d2){_0x5bd390[_0xa078('0x22')]=_0xf8e5d2;if(_0x1f57be[_0xa078('0x31')][_0xa078('0x42')]){_0x35830e[_0xa078('0x43')]=[{'all':!![]}];}return db[_0xa078('0x2b')][_0xa078('0x44')](_0x35830e);})[_0xa078('0x26')](function(_0x1203d7){_0x5bd390['rows']=_0x1203d7;return _0x5bd390;})[_0xa078('0x26')](respondWithFilteredResult(_0x281736,_0x35830e))[_0xa078('0x45')](handleError(_0x281736,null));};exports[_0xa078('0x46')]=function(_0x1fcb5c,_0x2f6093){var _0x2a0f37={'raw':![],'where':{'id':_0x1fcb5c[_0xa078('0x47')]['id']}},_0x5caf02={};_0x5caf02[_0xa078('0x2f')]=_[_0xa078('0x32')](db[_0xa078('0x2b')][_0xa078('0x2c')]);_0x5caf02['query']=_[_0xa078('0x32')](_0x1fcb5c[_0xa078('0x31')]);_0x5caf02[_0xa078('0x33')]=_[_0xa078('0x34')](_0x5caf02['model'],_0x5caf02[_0xa078('0x31')]);_0x2a0f37[_0xa078('0x35')]=_[_0xa078('0x34')](_0x5caf02[_0xa078('0x2f')],qs[_0xa078('0x36')](_0x1fcb5c['query']['fields']));_0x2a0f37[_0xa078('0x35')]=_0x2a0f37[_0xa078('0x35')][_0xa078('0x37')]?_0x2a0f37['attributes']:_0x5caf02[_0xa078('0x2f')];if(_0x1fcb5c[_0xa078('0x31')][_0xa078('0x42')]){_0x2a0f37[_0xa078('0x43')]=[{'all':!![]}];}_0x2a0f37=_[_0xa078('0x3f')]({},_0x2a0f37,_0x1fcb5c[_0xa078('0x41')]);return db[_0xa078('0x2b')][_0xa078('0x48')](_0x2a0f37)[_0xa078('0x26')](handleEntityNotFound(_0x2f6093,null))[_0xa078('0x26')](respondWithResult(_0x2f6093,null))[_0xa078('0x45')](handleError(_0x2f6093,null));};exports[_0xa078('0x49')]=function(_0x2d0406,_0xc8b914){return db[_0xa078('0x2b')]['create'](_0x2d0406['body'],{})[_0xa078('0x26')](respondWithResult(_0xc8b914,0xc9))[_0xa078('0x45')](handleError(_0xc8b914,null));};exports[_0xa078('0x4a')]=function(_0x17a443,_0x138161){if(_0x17a443[_0xa078('0x4b')]['id']){delete _0x17a443[_0xa078('0x4b')]['id'];}return db['UserProfileSection'][_0xa078('0x48')]({'where':{'id':_0x17a443[_0xa078('0x47')]['id']}})[_0xa078('0x26')](handleEntityNotFound(_0x138161,null))[_0xa078('0x26')](saveUpdates(_0x17a443[_0xa078('0x4b')],null))[_0xa078('0x26')](respondWithResult(_0x138161,null))[_0xa078('0x45')](handleError(_0x138161,null));};exports['destroy']=function(_0x4d3569,_0x2acc0a){return db[_0xa078('0x2b')]['find']({'where':{'id':_0x4d3569[_0xa078('0x47')]['id']}})[_0xa078('0x26')](handleEntityNotFound(_0x2acc0a,null))[_0xa078('0x26')](removeEntity(_0x2acc0a,null))[_0xa078('0x45')](handleError(_0x2acc0a,null));};exports[_0xa078('0x4c')]=function(_0x436acb,_0x4fef7b){return db[_0xa078('0x2b')][_0xa078('0x4c')]()[_0xa078('0x26')](respondWithResult(_0x4fef7b,null))[_0xa078('0x45')](handleError(_0x4fef7b,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index c76b211..993976f 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 _0xf2a5=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xf2a5,0x8f));var _0x5f2a=function(_0x193843,_0x477dd3){_0x193843=_0x193843-0x0;var _0x1b98f8=_0xf2a5[_0x193843];return _0x1b98f8;};'use strict';var _=require(_0x5f2a('0x0'));var util=require('util');var logger=require(_0x5f2a('0x1'))(_0x5f2a('0x2'));var moment=require(_0x5f2a('0x3'));var BPromise=require(_0x5f2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f2a('0x5'));var rimraf=require(_0x5f2a('0x6'));var config=require(_0x5f2a('0x7'));var attributes=require(_0x5f2a('0x8'));module[_0x5f2a('0x9')]=function(_0x317961,_0x553b3c){return _0x317961[_0x5f2a('0xa')](_0x5f2a('0xb'),attributes,{'tableName':_0x5f2a('0xc'),'paranoid':![],'indexes':[{'name':_0x5f2a('0xd'),'fields':[_0x5f2a('0xe'),_0x5f2a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf5c5=['UserProfileSection','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','define'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0xf5c5,0x13b));var _0x5f5c=function(_0x3b5031,_0x38057f){_0x3b5031=_0x3b5031-0x0;var _0x57ad35=_0xf5c5[_0x3b5031];return _0x57ad35;};'use strict';var _=require(_0x5f5c('0x0'));var util=require(_0x5f5c('0x1'));var logger=require(_0x5f5c('0x2'))('api');var moment=require(_0x5f5c('0x3'));var BPromise=require(_0x5f5c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f5c('0x5'));var rimraf=require(_0x5f5c('0x6'));var config=require(_0x5f5c('0x7'));var attributes=require(_0x5f5c('0x8'));module['exports']=function(_0x4a684e,_0x628731){return _0x4a684e[_0x5f5c('0x9')](_0x5f5c('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x5f5c('0xb'),_0x5f5c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 60bfb92..ef1297f 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 _0x6c23=['UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x3318dd,_0x4df6b9){var _0x132195=function(_0x3e2ebb){while(--_0x3e2ebb){_0x3318dd['push'](_0x3318dd['shift']());}};_0x132195(++_0x4df6b9);}(_0x6c23,0x112));var _0x36c2=function(_0x1dad69,_0x2ae613){_0x1dad69=_0x1dad69-0x0;var _0x2aab17=_0x6c23[_0x1dad69];return _0x2aab17;};'use strict';var _=require(_0x36c2('0x0'));var util=require(_0x36c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x36c2('0x2'));var fs=require('fs');var Redis=require(_0x36c2('0x3'));var db=require(_0x36c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x36c2('0x5'));var config=require(_0x36c2('0x6'));var jayson=require(_0x36c2('0x7'));var client=jayson['client'][_0x36c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b8f1a,_0x31b297,_0x51adb4){return new BPromise(function(_0x4dff2b,_0x2cf5fa){return client['request'](_0x1b8f1a,_0x51adb4)[_0x36c2('0x9')](function(_0x384e14){logger[_0x36c2('0xa')](_0x36c2('0xb'),_0x31b297,'request\x20sent');logger['debug'](_0x36c2('0xc'),_0x31b297,_0x36c2('0xd'),JSON[_0x36c2('0xe')](_0x384e14));if(_0x384e14[_0x36c2('0xf')]){if(_0x384e14[_0x36c2('0xf')][_0x36c2('0x10')]===0x1f4){logger[_0x36c2('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x31b297,_0x384e14[_0x36c2('0xf')][_0x36c2('0x11')]);return _0x2cf5fa(_0x384e14[_0x36c2('0xf')][_0x36c2('0x11')]);}logger[_0x36c2('0xf')](_0x36c2('0xb'),_0x31b297,_0x384e14[_0x36c2('0xf')][_0x36c2('0x11')]);return _0x4dff2b(_0x384e14[_0x36c2('0xf')][_0x36c2('0x11')]);}else{logger[_0x36c2('0xa')](_0x36c2('0xb'),_0x31b297,'request\x20sent');_0x4dff2b(_0x384e14[_0x36c2('0x12')][_0x36c2('0x11')]);}})['catch'](function(_0x36ef80){logger['error'](_0x36c2('0xb'),_0x31b297,_0x36ef80);_0x2cf5fa(_0x36ef80);});});} \ No newline at end of file +var _0x1e1b=['then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x43175d,_0x5dfd80){var _0x4fe27f=function(_0x52f553){while(--_0x52f553){_0x43175d['push'](_0x43175d['shift']());}};_0x4fe27f(++_0x5dfd80);}(_0x1e1b,0xfc));var _0xb1e1=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x1e1b[_0x187ee1];return _0x388160;};'use strict';var _=require(_0xb1e1('0x0'));var util=require(_0xb1e1('0x1'));var moment=require('moment');var BPromise=require(_0xb1e1('0x2'));var rs=require(_0xb1e1('0x3'));var fs=require('fs');var Redis=require(_0xb1e1('0x4'));var db=require(_0xb1e1('0x5'))['db'];var utils=require(_0xb1e1('0x6'));var logger=require(_0xb1e1('0x7'))('rpc');var config=require(_0xb1e1('0x8'));var jayson=require(_0xb1e1('0x9'));var client=jayson['client'][_0xb1e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40bd62,_0x4a5fe6,_0x2986be){return new BPromise(function(_0x1d4710,_0x31fb32){return client[_0xb1e1('0xb')](_0x40bd62,_0x2986be)[_0xb1e1('0xc')](function(_0x3aff44){logger[_0xb1e1('0xd')](_0xb1e1('0xe'),_0x4a5fe6,'request\x20sent');logger[_0xb1e1('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x4a5fe6,_0xb1e1('0x10'),JSON[_0xb1e1('0x11')](_0x3aff44));if(_0x3aff44[_0xb1e1('0x12')]){if(_0x3aff44[_0xb1e1('0x12')][_0xb1e1('0x13')]===0x1f4){logger['error'](_0xb1e1('0xe'),_0x4a5fe6,_0x3aff44[_0xb1e1('0x12')][_0xb1e1('0x14')]);return _0x31fb32(_0x3aff44[_0xb1e1('0x12')][_0xb1e1('0x14')]);}logger[_0xb1e1('0x12')](_0xb1e1('0xe'),_0x4a5fe6,_0x3aff44[_0xb1e1('0x12')][_0xb1e1('0x14')]);return _0x1d4710(_0x3aff44[_0xb1e1('0x12')][_0xb1e1('0x14')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x4a5fe6,'request\x20sent');_0x1d4710(_0x3aff44[_0xb1e1('0x15')][_0xb1e1('0x14')]);}})['catch'](function(_0xe83b68){logger[_0xb1e1('0x12')](_0xb1e1('0xe'),_0x4a5fe6,_0xe83b68);_0x31fb32(_0xe83b68);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 1f34640..7a6da34 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x25dfe3,_0x8699a8){var _0xa2ea8b=function(_0x7cbe06){while(--_0x7cbe06){_0x25dfe3['push'](_0x25dfe3['shift']());}};_0xa2ea8b(++_0x8699a8);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x49f76d,_0x1297f7){var _0x4f880b=function(_0x41f5d3){while(--_0x41f5d3){_0x49f76d['push'](_0x49f76d['shift']());}};_0x4f880b(++_0x1297f7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xcb91[_0x1d70db];return _0x3060c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d4990d0..2665587 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 _0xb695=['INTEGER'];(function(_0x3feb27,_0x349f9f){var _0x2b864e=function(_0x4229c6){while(--_0x4229c6){_0x3feb27['push'](_0x3feb27['shift']());}};_0x2b864e(++_0x349f9f);}(_0xb695,0x9b));var _0x5b69=function(_0x581db5,_0x4bbd6c){_0x581db5=_0x581db5-0x0;var _0x185479=_0xb695[_0x581db5];return _0x185479;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5b69('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf65f=['exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf65f,0xe0));var _0xff65=function(_0xc67594,_0x25a6f3){_0xc67594=_0xc67594-0x0;var _0x2f9020=_0xf65f[_0xc67594];return _0x2f9020;};'use strict';var Sequelize=require('sequelize');module[_0xff65('0x0')]={'penalty':{'type':Sequelize[_0xff65('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 a9012d3..a0b1754 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 _0xafc4=['path','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xafc4,0x69));var _0x4afc=function(_0x3c656d,_0x5e958c){_0x3c656d=_0x3c656d-0x0;var _0x58fc7a=_0xafc4[_0x3c656d];return _0x58fc7a;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9582=['bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x16e459,_0x48e6f3){var _0x5e80ad=function(_0x5d6188){while(--_0x5d6188){_0x16e459['push'](_0x16e459['shift']());}};_0x5e80ad(++_0x48e6f3);}(_0x9582,0x95));var _0x2958=function(_0x2694eb,_0xd31d46){_0x2694eb=_0x2694eb-0x0;var _0x44e719=_0x9582[_0x2694eb];return _0x44e719;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var logger=require(_0x2958('0x2'))(_0x2958('0x3'));var moment=require(_0x2958('0x4'));var BPromise=require(_0x2958('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2958('0x6'));var rimraf=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var attributes=require(_0x2958('0x9'));module[_0x2958('0xa')]=function(_0xbde128,_0x88ffaa){return _0xbde128[_0x2958('0xb')](_0x2958('0xc'),attributes,{'tableName':_0x2958('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index d31cd08..6c5f806 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 _0x69f7=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x195802,_0x3edb16){var _0x3bb28f=function(_0x369d6e){while(--_0x369d6e){_0x195802['push'](_0x195802['shift']());}};_0x3bb28f(++_0x3edb16);}(_0x69f7,0x1cf));var _0x769f=function(_0x200776,_0x176cd0){_0x200776=_0x200776-0x0;var _0x5b4579=_0x69f7[_0x200776];return _0x5b4579;};'use strict';var _=require('lodash');var util=require(_0x769f('0x0'));var moment=require(_0x769f('0x1'));var BPromise=require('bluebird');var rs=require(_0x769f('0x2'));var fs=require('fs');var Redis=require(_0x769f('0x3'));var db=require(_0x769f('0x4'))['db'];var utils=require(_0x769f('0x5'));var logger=require(_0x769f('0x6'))(_0x769f('0x7'));var config=require(_0x769f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x769f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d621d,_0x335dbe,_0x465451){return new BPromise(function(_0x55526a,_0x54ad8b){return client[_0x769f('0xa')](_0x3d621d,_0x465451)['then'](function(_0x33649d){logger['info'](_0x769f('0xb'),_0x335dbe,_0x769f('0xc'));logger[_0x769f('0xd')](_0x769f('0xe'),_0x335dbe,_0x769f('0xc'),JSON[_0x769f('0xf')](_0x33649d));if(_0x33649d[_0x769f('0x10')]){if(_0x33649d[_0x769f('0x10')]['code']===0x1f4){logger['error'](_0x769f('0xb'),_0x335dbe,_0x33649d['error'][_0x769f('0x11')]);return _0x54ad8b(_0x33649d['error'][_0x769f('0x11')]);}logger[_0x769f('0x10')](_0x769f('0xb'),_0x335dbe,_0x33649d[_0x769f('0x10')][_0x769f('0x11')]);return _0x55526a(_0x33649d['error']['message']);}else{logger['info'](_0x769f('0xb'),_0x335dbe,_0x769f('0xc'));_0x55526a(_0x33649d[_0x769f('0x12')][_0x769f('0x11')]);}})[_0x769f('0x13')](function(_0x3a6cd5){logger[_0x769f('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x335dbe,_0x3a6cd5);_0x54ad8b(_0x3a6cd5);});});} \ No newline at end of file +var _0x08a3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x244bed,_0x43652c){var _0x593e24=function(_0x364647){while(--_0x364647){_0x244bed['push'](_0x244bed['shift']());}};_0x593e24(++_0x43652c);}(_0x08a3,0x14a));var _0x308a=function(_0x3057ab,_0x5e4fb8){_0x3057ab=_0x3057ab-0x0;var _0x1d492f=_0x08a3[_0x3057ab];return _0x1d492f;};'use strict';var _=require(_0x308a('0x0'));var util=require(_0x308a('0x1'));var moment=require(_0x308a('0x2'));var BPromise=require(_0x308a('0x3'));var rs=require(_0x308a('0x4'));var fs=require('fs');var Redis=require(_0x308a('0x5'));var db=require(_0x308a('0x6'))['db'];var utils=require(_0x308a('0x7'));var logger=require('../../config/logger')(_0x308a('0x8'));var config=require('../../config/environment');var jayson=require(_0x308a('0x9'));var client=jayson[_0x308a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59393a,_0x3d9a2b,_0x2ba670){return new BPromise(function(_0xba714,_0x2c39ee){return client['request'](_0x59393a,_0x2ba670)[_0x308a('0xb')](function(_0x4f44d0){logger[_0x308a('0xc')](_0x308a('0xd'),_0x3d9a2b,_0x308a('0xe'));logger[_0x308a('0xf')](_0x308a('0x10'),_0x3d9a2b,'request\x20sent',JSON[_0x308a('0x11')](_0x4f44d0));if(_0x4f44d0[_0x308a('0x12')]){if(_0x4f44d0['error'][_0x308a('0x13')]===0x1f4){logger['error'](_0x308a('0xd'),_0x3d9a2b,_0x4f44d0[_0x308a('0x12')][_0x308a('0x14')]);return _0x2c39ee(_0x4f44d0[_0x308a('0x12')][_0x308a('0x14')]);}logger['error'](_0x308a('0xd'),_0x3d9a2b,_0x4f44d0[_0x308a('0x12')][_0x308a('0x14')]);return _0xba714(_0x4f44d0['error']['message']);}else{logger[_0x308a('0xc')](_0x308a('0xd'),_0x3d9a2b,'request\x20sent');_0xba714(_0x4f44d0[_0x308a('0x15')][_0x308a('0x14')]);}})['catch'](function(_0xabbeee){logger['error'](_0x308a('0xd'),_0x3d9a2b,_0xabbeee);_0x2c39ee(_0xabbeee);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 0ece1f8..f064005 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x439790,_0x2f4e02){var _0x1275ab=function(_0x23eea7){while(--_0x23eea7){_0x439790['push'](_0x439790['shift']());}};_0x1275ab(++_0x2f4e02);}(_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(_0x52886f,_0x4c6522){var _0x254d89=function(_0x1dab03){while(--_0x1dab03){_0x52886f['push'](_0x52886f['shift']());}};_0x254d89(++_0x4c6522);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a5fd6,_0xe9a7dd){_0x1a5fd6=_0x1a5fd6-0x0;var _0x3f7bb4=_0xedd9[_0x1a5fd6];return _0x3f7bb4;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a5d0cd3..e21d5b0 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 _0xf66d=['exports','INTEGER','sequelize'];(function(_0x506cbe,_0x818678){var _0x4fdaa7=function(_0x28db18){while(--_0x28db18){_0x506cbe['push'](_0x506cbe['shift']());}};_0x4fdaa7(++_0x818678);}(_0xf66d,0x152));var _0xdf66=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xf66d[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0xdf66('0x0'));module[_0xdf66('0x1')]={'penalty':{'type':Sequelize[_0xdf66('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3376=['INTEGER','exports'];(function(_0x4e61cc,_0xad3cf2){var _0x226a70=function(_0xdb31d9){while(--_0xdb31d9){_0x4e61cc['push'](_0x4e61cc['shift']());}};_0x226a70(++_0xad3cf2);}(_0x3376,0x1dd));var _0x6337=function(_0x3516fc,_0x4c6066){_0x3516fc=_0x3516fc-0x0;var _0x291b7c=_0x3376[_0x3516fc];return _0x291b7c;};'use strict';var Sequelize=require('sequelize');module[_0x6337('0x0')]={'penalty':{'type':Sequelize[_0x6337('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 222e29e..8c060c5 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 _0x852a=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x29a463,_0x4590ac){var _0x37e9d3=function(_0x5dc557){while(--_0x5dc557){_0x29a463['push'](_0x29a463['shift']());}};_0x37e9d3(++_0x4590ac);}(_0x852a,0x1b9));var _0xa852=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x852a[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0xa852('0x0'));var util=require(_0xa852('0x1'));var logger=require(_0xa852('0x2'))(_0xa852('0x3'));var moment=require(_0xa852('0x4'));var BPromise=require(_0xa852('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa852('0x6'));var rimraf=require(_0xa852('0x7'));var config=require(_0xa852('0x8'));var attributes=require(_0xa852('0x9'));module[_0xa852('0xa')]=function(_0x39f8d3,_0x227964){return _0x39f8d3['define'](_0xa852('0xb'),attributes,{'tableName':_0xa852('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d6b=['util','bluebird','path','rimraf','./userVoiceQueue.attributes','define','user_has_voice_queues','lodash'];(function(_0x3681bf,_0x152dbe){var _0x413f01=function(_0x10ceca){while(--_0x10ceca){_0x3681bf['push'](_0x3681bf['shift']());}};_0x413f01(++_0x152dbe);}(_0x7d6b,0x1bf));var _0xb7d6=function(_0x58ba49,_0x527bb3){_0x58ba49=_0x58ba49-0x0;var _0xc62b5=_0x7d6b[_0x58ba49];return _0xc62b5;};'use strict';var _=require(_0xb7d6('0x0'));var util=require(_0xb7d6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb7d6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7d6('0x3'));var rimraf=require(_0xb7d6('0x4'));var config=require('../../config/environment');var attributes=require(_0xb7d6('0x5'));module['exports']=function(_0x38b025,_0x4a244f){return _0x38b025[_0xb7d6('0x6')]('UserVoiceQueue',attributes,{'tableName':_0xb7d6('0x7'),'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 ab7851d..b5efaf8 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 _0x5bf3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0xc8db78,_0x58b5a7){var _0x3483f3=function(_0x2089ee){while(--_0x2089ee){_0xc8db78['push'](_0xc8db78['shift']());}};_0x3483f3(++_0x58b5a7);}(_0x5bf3,0x1df));var _0x35bf=function(_0x4c3f4a,_0x761393){_0x4c3f4a=_0x4c3f4a-0x0;var _0x1bcec7=_0x5bf3[_0x4c3f4a];return _0x1bcec7;};'use strict';var _=require('lodash');var util=require(_0x35bf('0x0'));var moment=require(_0x35bf('0x1'));var BPromise=require(_0x35bf('0x2'));var rs=require(_0x35bf('0x3'));var fs=require('fs');var Redis=require(_0x35bf('0x4'));var db=require(_0x35bf('0x5'))['db'];var utils=require(_0x35bf('0x6'));var logger=require('../../config/logger')(_0x35bf('0x7'));var config=require(_0x35bf('0x8'));var jayson=require(_0x35bf('0x9'));var client=jayson[_0x35bf('0xa')][_0x35bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17bd55,_0x1cf571,_0x542b4f){return new BPromise(function(_0x24d5e1,_0x55e98a){return client['request'](_0x17bd55,_0x542b4f)[_0x35bf('0xc')](function(_0x4b35a3){logger[_0x35bf('0xd')](_0x35bf('0xe'),_0x1cf571,_0x35bf('0xf'));logger[_0x35bf('0x10')](_0x35bf('0x11'),_0x1cf571,_0x35bf('0xf'),JSON[_0x35bf('0x12')](_0x4b35a3));if(_0x4b35a3[_0x35bf('0x13')]){if(_0x4b35a3['error']['code']===0x1f4){logger['error'](_0x35bf('0xe'),_0x1cf571,_0x4b35a3[_0x35bf('0x13')]['message']);return _0x55e98a(_0x4b35a3['error']['message']);}logger['error'](_0x35bf('0xe'),_0x1cf571,_0x4b35a3[_0x35bf('0x13')]['message']);return _0x24d5e1(_0x4b35a3['error'][_0x35bf('0x14')]);}else{logger['info'](_0x35bf('0xe'),_0x1cf571,_0x35bf('0xf'));_0x24d5e1(_0x4b35a3[_0x35bf('0x15')][_0x35bf('0x14')]);}})[_0x35bf('0x16')](function(_0x5636a6){logger[_0x35bf('0x13')](_0x35bf('0xe'),_0x1cf571,_0x5636a6);_0x55e98a(_0x5636a6);});});} \ No newline at end of file +var _0xdf5b=['info','request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x217f20,_0x131abd){var _0x186504=function(_0xb70861){while(--_0xb70861){_0x217f20['push'](_0x217f20['shift']());}};_0x186504(++_0x131abd);}(_0xdf5b,0x113));var _0xbdf5=function(_0x5cea2b,_0x204236){_0x5cea2b=_0x5cea2b-0x0;var _0x35ac86=_0xdf5b[_0x5cea2b];return _0x35ac86;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbdf5('0x0'));var fs=require('fs');var Redis=require(_0xbdf5('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdf5('0x2'));var logger=require(_0xbdf5('0x3'))(_0xbdf5('0x4'));var config=require(_0xbdf5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xbdf5('0x6')][_0xbdf5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24622b,_0xeb80ad,_0x36c6d0){return new BPromise(function(_0x5b6d1c,_0x5c0010){return client[_0xbdf5('0x8')](_0x24622b,_0x36c6d0)[_0xbdf5('0x9')](function(_0x45d09a){logger[_0xbdf5('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0xeb80ad,_0xbdf5('0xb'));logger[_0xbdf5('0xc')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0xeb80ad,_0xbdf5('0xb'),JSON[_0xbdf5('0xd')](_0x45d09a));if(_0x45d09a[_0xbdf5('0xe')]){if(_0x45d09a[_0xbdf5('0xe')][_0xbdf5('0xf')]===0x1f4){logger[_0xbdf5('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0xeb80ad,_0x45d09a['error']['message']);return _0x5c0010(_0x45d09a[_0xbdf5('0xe')]['message']);}logger['error'](_0xbdf5('0x10'),_0xeb80ad,_0x45d09a['error'][_0xbdf5('0x11')]);return _0x5b6d1c(_0x45d09a[_0xbdf5('0xe')]['message']);}else{logger['info'](_0xbdf5('0x10'),_0xeb80ad,_0xbdf5('0xb'));_0x5b6d1c(_0x45d09a['result']['message']);}})[_0xbdf5('0x12')](function(_0x2ea67a){logger[_0xbdf5('0xe')](_0xbdf5('0x10'),_0xeb80ad,_0x2ea67a);_0x5c0010(_0x2ea67a);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index d7f39ca..cbb32f2 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x21a406,_0x15fa93){var _0x4e4ae1=function(_0x364fac){while(--_0x364fac){_0x21a406['push'](_0x21a406['shift']());}};_0x4e4ae1(++_0x15fa93);}(_0xedd9,0xfc));var _0x9edd=function(_0x199451,_0x10b3d1){_0x199451=_0x199451-0x0;var _0x5aee97=_0xedd9[_0x199451];return _0x5aee97;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x289917,_0x1c2059){var _0x5d1834=function(_0x41e5a0){while(--_0x41e5a0){_0x289917['push'](_0x289917['shift']());}};_0x5d1834(++_0x1c2059);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0xcb91[_0x1f5887];return _0x21774b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d1e1339..a3b5fa0 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 _0x72c3=['sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x45ee03,_0x2f5319){var _0x13d535=function(_0x391904){while(--_0x391904){_0x45ee03['push'](_0x45ee03['shift']());}};_0x13d535(++_0x2f5319);}(_0x72c3,0x108));var _0x372c=function(_0xd2605b,_0x1c7cb4){_0xd2605b=_0xd2605b-0x0;var _0x58649d=_0x72c3[_0xd2605b];return _0x58649d;};'use strict';var Sequelize=require(_0x372c('0x0'));module[_0x372c('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x372c('0x2')},'membername':{'type':Sequelize[_0x372c('0x3')],'allowNull':![],'comment':_0x372c('0x2')},'UserId':{'type':Sequelize[_0x372c('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x372c('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x372c('0x2')},'VoiceQueueId':{'type':Sequelize[_0x372c('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x372c('0x3')],'allowNull':![],'unique':_0x372c('0x5'),'comment':_0x372c('0x2')},'penalty':{'type':Sequelize[_0x372c('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x372c('0x4')](0xb),'defaultValue':0x0,'comment':_0x372c('0x2')}}; \ No newline at end of file +var _0x1220=['sequelize','exports','Required\x20by\x20Asterisk','INTEGER','STRING','queue_interface'];(function(_0x2b04ef,_0x343fcc){var _0x4b85e8=function(_0x31bce2){while(--_0x31bce2){_0x2b04ef['push'](_0x2b04ef['shift']());}};_0x4b85e8(++_0x343fcc);}(_0x1220,0x8a));var _0x0122=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x1220[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0x0122('0x0'));module[_0x0122('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0122('0x2')},'UserId':{'type':Sequelize[_0x0122('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0122('0x4')],'allowNull':![],'unique':_0x0122('0x5'),'comment':_0x0122('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0122('0x5'),'comment':_0x0122('0x2')},'penalty':{'type':Sequelize[_0x0122('0x3')](0xb),'defaultValue':0x0,'comment':_0x0122('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x0122('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 3d7e229..50abd43 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 _0x5605=['exports','events','../../mysqldb','UserVoiceQueueRt','save','remove','emit','hasOwnProperty','hook'];(function(_0x286ddd,_0x5af2c6){var _0x24eff6=function(_0x45085f){while(--_0x45085f){_0x286ddd['push'](_0x286ddd['shift']());}};_0x24eff6(++_0x5af2c6);}(_0x5605,0x7f));var _0x5560=function(_0x2babe9,_0xc3e8ba){_0x2babe9=_0x2babe9-0x0;var _0x462541=_0x5605[_0x2babe9];return _0x462541;};'use strict';var EventEmitter=require(_0x5560('0x0'));var UserVoiceQueueRt=require(_0x5560('0x1'))['db'][_0x5560('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5560('0x3'),'afterUpdate':'update','afterDestroy':_0x5560('0x4')};function emitEvent(_0x47db2c){return function(_0x152af7,_0x469ceb,_0x48a9b9){UserVoiceQueueRtEvents[_0x5560('0x5')](_0x47db2c+':'+_0x152af7['id'],_0x152af7);UserVoiceQueueRtEvents[_0x5560('0x5')](_0x47db2c,_0x152af7);_0x48a9b9(null);};}for(var e in events){if(events[_0x5560('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x5560('0x7')](e,emitEvent(event));}}module[_0x5560('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x8bfc=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','emit','hook'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x8bfc,0x14e));var _0xc8bf=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x8bfc[_0x79b649];return _0x1af9b1;};'use strict';var EventEmitter=require(_0xc8bf('0x0'));var UserVoiceQueueRt=require(_0xc8bf('0x1'))['db'][_0xc8bf('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc8bf('0x3')](0x0);var events={'afterCreate':_0xc8bf('0x4'),'afterUpdate':_0xc8bf('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5a70e0){return function(_0x4a5d16,_0x72c521,_0x1e6add){UserVoiceQueueRtEvents[_0xc8bf('0x6')](_0x5a70e0+':'+_0x4a5d16['id'],_0x4a5d16);UserVoiceQueueRtEvents['emit'](_0x5a70e0,_0x4a5d16);_0x1e6add(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xc8bf('0x7')](e,emitEvent(event));}}module[_0xc8bf('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 8c6db11..705165e 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 _0x7ad5=['user_has_voice_queues_rt','util','moment','bluebird','request-promise','rimraf','define','UserVoiceQueueRt'];(function(_0x20fb22,_0x210b85){var _0xdd510a=function(_0x390c50){while(--_0x390c50){_0x20fb22['push'](_0x20fb22['shift']());}};_0xdd510a(++_0x210b85);}(_0x7ad5,0x151));var _0x57ad=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x7ad5[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0x57ad('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x57ad('0x1'));var BPromise=require(_0x57ad('0x2'));var rp=require(_0x57ad('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57ad('0x4'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x519f9a,_0x2a4b02){return _0x519f9a[_0x57ad('0x5')](_0x57ad('0x6'),attributes,{'tableName':_0x57ad('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaab7=['./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0xaab7,0xeb));var _0x7aab=function(_0x49495c,_0x1694df){_0x49495c=_0x49495c-0x0;var _0x2464cd=_0xaab7[_0x49495c];return _0x2464cd;};'use strict';var _=require(_0x7aab('0x0'));var util=require('util');var logger=require(_0x7aab('0x1'))('api');var moment=require(_0x7aab('0x2'));var BPromise=require(_0x7aab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7aab('0x4'));var rimraf=require(_0x7aab('0x5'));var config=require(_0x7aab('0x6'));var attributes=require(_0x7aab('0x7'));module['exports']=function(_0x1e76f6,_0x20f7e7){return _0x1e76f6[_0x7aab('0x8')](_0x7aab('0x9'),attributes,{'tableName':_0x7aab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 200054c..05b6621 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 _0x770b=['redis','localhost','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceQueueRtPauses','findAll','options','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x427134,_0x4db288){var _0x19af84=function(_0x22e828){while(--_0x22e828){_0x427134['push'](_0x427134['shift']());}};_0x19af84(++_0x4db288);}(_0x770b,0x77));var _0xb770=function(_0x23b2b4,_0x1af875){_0x23b2b4=_0x23b2b4-0x0;var _0x4918ae=_0x770b[_0x23b2b4];return _0x4918ae;};'use strict';var _=require(_0xb770('0x0'));var util=require(_0xb770('0x1'));var moment=require(_0xb770('0x2'));var BPromise=require(_0xb770('0x3'));var rs=require(_0xb770('0x4'));var fs=require('fs');var Redis=require(_0xb770('0x5'));var db=require(_0xb770('0x6'))['db'];var utils=require(_0xb770('0x7'));var logger=require(_0xb770('0x8'))(_0xb770('0x9'));var config=require(_0xb770('0xa'));var jayson=require(_0xb770('0xb'));var client=jayson['client'][_0xb770('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb770('0xd')],{'host':_0xb770('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb770('0xf'))['register'](socket);function respondWithRpcPromise(_0x3264d8,_0x18c383,_0x5dc135){return new BPromise(function(_0x3287b3,_0x3e7bcd){return client['request'](_0x3264d8,_0x5dc135)[_0xb770('0x10')](function(_0xbb4bbf){logger[_0xb770('0x11')](_0xb770('0x12'),_0x18c383,_0xb770('0x13'));logger[_0xb770('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x18c383,_0xb770('0x13'),JSON[_0xb770('0x15')](_0xbb4bbf));if(_0xbb4bbf[_0xb770('0x16')]){if(_0xbb4bbf['error']['code']===0x1f4){logger[_0xb770('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x18c383,_0xbb4bbf[_0xb770('0x16')][_0xb770('0x17')]);return _0x3e7bcd(_0xbb4bbf[_0xb770('0x16')][_0xb770('0x17')]);}logger['error'](_0xb770('0x12'),_0x18c383,_0xbb4bbf[_0xb770('0x16')]['message']);return _0x3287b3(_0xbb4bbf[_0xb770('0x16')][_0xb770('0x17')]);}else{logger[_0xb770('0x11')](_0xb770('0x12'),_0x18c383,_0xb770('0x13'));_0x3287b3(_0xbb4bbf[_0xb770('0x18')][_0xb770('0x17')]);}})[_0xb770('0x19')](function(_0x43d0a4){logger[_0xb770('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x18c383,_0x43d0a4);_0x3e7bcd(_0x43d0a4);});});}exports[_0xb770('0x1a')]=function(_0x453f85){var _0x191a26=this;return new Promise(function(_0x4bb765,_0x4a7023){return db['UserVoiceQueueRt'][_0xb770('0x1b')]({'raw':_0x453f85[_0xb770('0x1c')]?_0x453f85[_0xb770('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x453f85['options']?_0x453f85[_0xb770('0x1c')]['where']||null:null,'attributes':[[db[_0xb770('0x1d')]['fn']('COUNT',db[_0xb770('0x1d')]['fn']('IF',db[_0xb770('0x1d')][_0xb770('0x1e')](_0xb770('0x1f')))),_0xb770('0x20')]]})[_0xb770('0x10')](function(_0x139564){logger[_0xb770('0x11')](_0xb770('0x1a'),_0x453f85);logger[_0xb770('0x14')](_0xb770('0x1a'),_0x453f85,JSON[_0xb770('0x15')](_0x139564));_0x4bb765(_0x139564);})[_0xb770('0x19')](function(_0x1e7e12){logger[_0xb770('0x16')]('GetVoiceQueueRtPauses',_0x1e7e12[_0xb770('0x17')],_0x453f85);_0x4a7023(_0x191a26['error'](0x1f4,_0x1e7e12[_0xb770('0x17')]));});});}; \ No newline at end of file +var _0x8af6=['./userVoiceQueueRt.socket','register','request','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','info','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8af6,0x1a3));var _0x68af=function(_0x32de5f,_0x1dfe64){_0x32de5f=_0x32de5f-0x0;var _0x1b4ecb=_0x8af6[_0x32de5f];return _0x1b4ecb;};'use strict';var _=require(_0x68af('0x0'));var util=require(_0x68af('0x1'));var moment=require(_0x68af('0x2'));var BPromise=require('bluebird');var rs=require(_0x68af('0x3'));var fs=require('fs');var Redis=require(_0x68af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x68af('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x68af('0x6'));var jayson=require(_0x68af('0x7'));var client=jayson[_0x68af('0x8')]['http']({'port':0x232a});config[_0x68af('0x9')]=_[_0x68af('0xa')](config[_0x68af('0x9')],{'host':_0x68af('0xb'),'port':0x18eb});var socket=require(_0x68af('0xc'))(new Redis(config[_0x68af('0x9')]));require(_0x68af('0xd'))[_0x68af('0xe')](socket);function respondWithRpcPromise(_0x318142,_0x1484cd,_0x19ec57){return new BPromise(function(_0x3b668f,_0x315e60){return client[_0x68af('0xf')](_0x318142,_0x19ec57)[_0x68af('0x10')](function(_0x2aa568){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1484cd,_0x68af('0x11'));logger[_0x68af('0x12')](_0x68af('0x13'),_0x1484cd,_0x68af('0x11'),JSON[_0x68af('0x14')](_0x2aa568));if(_0x2aa568[_0x68af('0x15')]){if(_0x2aa568[_0x68af('0x15')][_0x68af('0x16')]===0x1f4){logger[_0x68af('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1484cd,_0x2aa568[_0x68af('0x15')][_0x68af('0x17')]);return _0x315e60(_0x2aa568['error'][_0x68af('0x17')]);}logger['error'](_0x68af('0x18'),_0x1484cd,_0x2aa568[_0x68af('0x15')][_0x68af('0x17')]);return _0x3b668f(_0x2aa568['error'][_0x68af('0x17')]);}else{logger[_0x68af('0x19')](_0x68af('0x18'),_0x1484cd,'request\x20sent');_0x3b668f(_0x2aa568['result'][_0x68af('0x17')]);}})[_0x68af('0x1a')](function(_0x220a86){logger[_0x68af('0x15')](_0x68af('0x18'),_0x1484cd,_0x220a86);_0x315e60(_0x220a86);});});}exports[_0x68af('0x1b')]=function(_0x233d91){var _0x499256=this;return new Promise(function(_0xa07dcc,_0x4fd242){return db[_0x68af('0x1c')]['findAll']({'raw':_0x233d91[_0x68af('0x1d')]?_0x233d91[_0x68af('0x1d')][_0x68af('0x1e')]===undefined?!![]:![]:!![],'where':_0x233d91[_0x68af('0x1d')]?_0x233d91[_0x68af('0x1d')][_0x68af('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x68af('0x20'),db[_0x68af('0x21')]['fn']('IF',db[_0x68af('0x21')]['literal'](_0x68af('0x22')))),_0x68af('0x23')]]})[_0x68af('0x10')](function(_0x34ff94){logger[_0x68af('0x19')](_0x68af('0x1b'),_0x233d91);logger['debug']('GetVoiceQueueRtPauses',_0x233d91,JSON[_0x68af('0x14')](_0x34ff94));_0xa07dcc(_0x34ff94);})[_0x68af('0x1a')](function(_0x4ecd75){logger[_0x68af('0x15')](_0x68af('0x1b'),_0x4ecd75[_0x68af('0x17')],_0x233d91);_0x4fd242(_0x499256[_0x68af('0x15')](0x1f4,_0x4ecd75['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 5f8d3c8..7d2f7c3 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 _0xdded=['register','length','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x1540a4,_0x3b1de4){var _0xc7942c=function(_0x2a2b14){while(--_0x2a2b14){_0x1540a4['push'](_0x1540a4['shift']());}};_0xc7942c(++_0x3b1de4);}(_0xdded,0x17a));var _0xddde=function(_0x507ea3,_0xf965c5){_0x507ea3=_0x507ea3-0x0;var _0x364d72=_0xdded[_0x507ea3];return _0x364d72;};'use strict';var UserVoiceQueueRtEvents=require(_0xddde('0x0'));var events=[_0xddde('0x1'),_0xddde('0x2'),_0xddde('0x3')];function createListener(_0x3f2b75,_0x9b8506){return function(_0x5cc90a){_0x9b8506[_0xddde('0x4')](_0x3f2b75,_0x5cc90a);};}function removeListener(_0x276cc6,_0x44468e){return function(){UserVoiceQueueRtEvents[_0xddde('0x5')](_0x276cc6,_0x44468e);};}exports[_0xddde('0x6')]=function(_0x39fd85){for(var _0x3c3021=0x0,_0x3cea18=events[_0xddde('0x7')];_0x3c3021<_0x3cea18;_0x3c3021++){var _0x18d8b8=events[_0x3c3021];var _0x3a5e8a=createListener('userVoiceQueueRt:'+_0x18d8b8,_0x39fd85);UserVoiceQueueRtEvents['on'](_0x18d8b8,_0x3a5e8a);}}; \ No newline at end of file +var _0x6bfc=['userVoiceQueueRt:','save','remove','update','emit','removeListener','register','length'];(function(_0x1c3fc1,_0x3707db){var _0x33a2ea=function(_0xbe8eb7){while(--_0xbe8eb7){_0x1c3fc1['push'](_0x1c3fc1['shift']());}};_0x33a2ea(++_0x3707db);}(_0x6bfc,0x159));var _0xc6bf=function(_0x179d95,_0x5f0429){_0x179d95=_0x179d95-0x0;var _0x297aba=_0x6bfc[_0x179d95];return _0x297aba;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xc6bf('0x0'),_0xc6bf('0x1'),_0xc6bf('0x2')];function createListener(_0x4d46ea,_0x44f89c){return function(_0x4edec8){_0x44f89c[_0xc6bf('0x3')](_0x4d46ea,_0x4edec8);};}function removeListener(_0x4a6de4,_0x15b991){return function(){UserVoiceQueueRtEvents[_0xc6bf('0x4')](_0x4a6de4,_0x15b991);};}exports[_0xc6bf('0x5')]=function(_0x4a999e){for(var _0x27a5d9=0x0,_0x2c9049=events[_0xc6bf('0x6')];_0x27a5d9<_0x2c9049;_0x27a5d9++){var _0x28d218=events[_0x27a5d9];var _0x250311=createListener(_0xc6bf('0x7')+_0x28d218,_0x4a999e);UserVoiceQueueRtEvents['on'](_0x28d218,_0x250311);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index f6b1f77..17901ef 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c1700,_0x2e5f79){var _0xabd509=function(_0x411f8e){while(--_0x411f8e){_0x4c1700['push'](_0x4c1700['shift']());}};_0xabd509(++_0x2e5f79);}(_0xe706,0xa3));var _0x6e70=function(_0x34145e,_0x689e31){_0x34145e=_0x34145e-0x0;var _0x27ed04=_0xe706[_0x34145e];return _0x27ed04;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x266ad8,_0x45346d){var _0x45b7de=function(_0x43e027){while(--_0x43e027){_0x266ad8['push'](_0x266ad8['shift']());}};_0x45b7de(++_0x45346d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 4b07477..a3791ce 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 _0xc6e6=['INTEGER','exports'];(function(_0x5038e3,_0x29855b){var _0x593c8d=function(_0x41c341){while(--_0x41c341){_0x5038e3['push'](_0x5038e3['shift']());}};_0x593c8d(++_0x29855b);}(_0xc6e6,0x113));var _0x6c6e=function(_0x3a81c2,_0x7d08dd){_0x3a81c2=_0x3a81c2-0x0;var _0x2d7eea=_0xc6e6[_0x3a81c2];return _0x2d7eea;};'use strict';var Sequelize=require('sequelize');module[_0x6c6e('0x0')]={'penalty':{'type':Sequelize[_0x6c6e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x385f=['exports','INTEGER','sequelize'];(function(_0x614908,_0x11b308){var _0x230585=function(_0x336d2a){while(--_0x336d2a){_0x614908['push'](_0x614908['shift']());}};_0x230585(++_0x11b308);}(_0x385f,0x7d));var _0xf385=function(_0x1d83db,_0x89d115){_0x1d83db=_0x1d83db-0x0;var _0x2dc1d1=_0x385f[_0x1d83db];return _0x2dc1d1;};'use strict';var Sequelize=require(_0xf385('0x0'));module[_0xf385('0x1')]={'penalty':{'type':Sequelize[_0xf385('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 4b752c1..19cfd83 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 _0x0766=['exports','define','UserWhatsappQueue','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x51d497,_0x25fb90){var _0x1fe078=function(_0x30545a){while(--_0x30545a){_0x51d497['push'](_0x51d497['shift']());}};_0x1fe078(++_0x25fb90);}(_0x0766,0x81));var _0x6076=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0766[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6076('0x0'));var util=require('util');var logger=require(_0x6076('0x1'))(_0x6076('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6076('0x3'));var fs=require('fs');var path=require(_0x6076('0x4'));var rimraf=require(_0x6076('0x5'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x6076('0x6')]=function(_0x5eb4b1,_0x2dfcf4){return _0x5eb4b1[_0x6076('0x7')](_0x6076('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41cf=['util','api','moment','bluebird','request-promise','path','rimraf','exports','define','UserWhatsappQueue','lodash'];(function(_0x5c0490,_0x3a7029){var _0x3f1696=function(_0x32f8ed){while(--_0x32f8ed){_0x5c0490['push'](_0x5c0490['shift']());}};_0x3f1696(++_0x3a7029);}(_0x41cf,0x196));var _0xf41c=function(_0x34fc32,_0x1b372f){_0x34fc32=_0x34fc32-0x0;var _0x567758=_0x41cf[_0x34fc32];return _0x567758;};'use strict';var _=require(_0xf41c('0x0'));var util=require(_0xf41c('0x1'));var logger=require('../../config/logger')(_0xf41c('0x2'));var moment=require(_0xf41c('0x3'));var BPromise=require(_0xf41c('0x4'));var rp=require(_0xf41c('0x5'));var fs=require('fs');var path=require(_0xf41c('0x6'));var rimraf=require(_0xf41c('0x7'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0xf41c('0x8')]=function(_0x17e86b,_0x33c655){return _0x17e86b[_0xf41c('0x9')](_0xf41c('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index e5632b8..32ffca7 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 _0x0130=['request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x214425,_0x41d257){var _0x268c4b=function(_0x3f52a1){while(--_0x3f52a1){_0x214425['push'](_0x214425['shift']());}};_0x268c4b(++_0x41d257);}(_0x0130,0x138));var _0x0013=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0130[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x0013('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0013('0x1'));var db=require(_0x0013('0x2'))['db'];var utils=require(_0x0013('0x3'));var logger=require('../../config/logger')(_0x0013('0x4'));var config=require(_0x0013('0x5'));var jayson=require(_0x0013('0x6'));var client=jayson[_0x0013('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x368b8f,_0x4498d1,_0x551891){return new BPromise(function(_0x3eca1a,_0x14645b){return client[_0x0013('0x8')](_0x368b8f,_0x551891)[_0x0013('0x9')](function(_0x335f51){logger[_0x0013('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4498d1,_0x0013('0xb'));logger[_0x0013('0xc')](_0x0013('0xd'),_0x4498d1,_0x0013('0xb'),JSON['stringify'](_0x335f51));if(_0x335f51[_0x0013('0xe')]){if(_0x335f51[_0x0013('0xe')]['code']===0x1f4){logger[_0x0013('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4498d1,_0x335f51[_0x0013('0xe')][_0x0013('0xf')]);return _0x14645b(_0x335f51[_0x0013('0xe')]['message']);}logger[_0x0013('0xe')](_0x0013('0x10'),_0x4498d1,_0x335f51[_0x0013('0xe')][_0x0013('0xf')]);return _0x3eca1a(_0x335f51[_0x0013('0xe')][_0x0013('0xf')]);}else{logger[_0x0013('0xa')](_0x0013('0x10'),_0x4498d1,_0x0013('0xb'));_0x3eca1a(_0x335f51[_0x0013('0x11')][_0x0013('0xf')]);}})[_0x0013('0x12')](function(_0x53717b){logger[_0x0013('0xe')](_0x0013('0x10'),_0x4498d1,_0x53717b);_0x14645b(_0x53717b);});});} \ No newline at end of file +var _0xd257=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','info','result','util','moment','bluebird','ioredis'];(function(_0x287a79,_0x1925e9){var _0x51c501=function(_0xb1bf7){while(--_0xb1bf7){_0x287a79['push'](_0x287a79['shift']());}};_0x51c501(++_0x1925e9);}(_0xd257,0x18c));var _0x7d25=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0xd257[_0x5c811c];return _0x5df3af;};'use strict';var _=require('lodash');var util=require(_0x7d25('0x0'));var moment=require(_0x7d25('0x1'));var BPromise=require(_0x7d25('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d25('0x3'));var db=require(_0x7d25('0x4'))['db'];var utils=require(_0x7d25('0x5'));var logger=require('../../config/logger')(_0x7d25('0x6'));var config=require(_0x7d25('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7d25('0x8')][_0x7d25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8f4bf6,_0x12854e,_0x1a92e9){return new BPromise(function(_0x442d8b,_0x45373e){return client[_0x7d25('0xa')](_0x8f4bf6,_0x1a92e9)[_0x7d25('0xb')](function(_0x27566a){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x12854e,_0x7d25('0xc'));logger[_0x7d25('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x12854e,_0x7d25('0xc'),JSON['stringify'](_0x27566a));if(_0x27566a[_0x7d25('0xe')]){if(_0x27566a[_0x7d25('0xe')][_0x7d25('0xf')]===0x1f4){logger[_0x7d25('0xe')](_0x7d25('0x10'),_0x12854e,_0x27566a['error'][_0x7d25('0x11')]);return _0x45373e(_0x27566a['error'][_0x7d25('0x11')]);}logger[_0x7d25('0xe')](_0x7d25('0x10'),_0x12854e,_0x27566a[_0x7d25('0xe')][_0x7d25('0x11')]);return _0x442d8b(_0x27566a[_0x7d25('0xe')][_0x7d25('0x11')]);}else{logger[_0x7d25('0x12')](_0x7d25('0x10'),_0x12854e,'request\x20sent');_0x442d8b(_0x27566a[_0x7d25('0x13')]['message']);}})['catch'](function(_0x5855c3){logger[_0x7d25('0xe')](_0x7d25('0x10'),_0x12854e,_0x5855c3);_0x45373e(_0x5855c3);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 2306c44..0458b23 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 _0xbacb=['index','show','post','create','put','update','delete','/:id','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x1d9f1c,_0x3ca956){var _0x496ef2=function(_0xa758d0){while(--_0xa758d0){_0x1d9f1c['push'](_0x1d9f1c['shift']());}};_0x496ef2(++_0x3ca956);}(_0xbacb,0x1a6));var _0xbbac=function(_0x143265,_0x189283){_0x143265=_0x143265-0x0;var _0x2f6259=_0xbacb[_0x143265];return _0x2f6259;};'use strict';var multer=require(_0xbbac('0x0'));var util=require(_0xbbac('0x1'));var path=require('path');var timeout=require(_0xbbac('0x2'));var express=require(_0xbbac('0x3'));var router=express[_0xbbac('0x4')]();var fs_extra=require(_0xbbac('0x5'));var auth=require(_0xbbac('0x6'));var interaction=require(_0xbbac('0x7'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xbbac('0x8')]('/',auth[_0xbbac('0x9')](),controller[_0xbbac('0xa')]);router[_0xbbac('0x8')]('/:id',auth[_0xbbac('0x9')](),controller[_0xbbac('0xb')]);router[_0xbbac('0xc')]('/',auth[_0xbbac('0x9')](),controller[_0xbbac('0xd')]);router[_0xbbac('0xe')]('/:id',auth[_0xbbac('0x9')](),controller[_0xbbac('0xf')]);router[_0xbbac('0x10')](_0xbbac('0x11'),auth[_0xbbac('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3df4=['create','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post'];(function(_0x3305f7,_0x2806ba){var _0x58700f=function(_0x1ea09f){while(--_0x1ea09f){_0x3305f7['push'](_0x3305f7['shift']());}};_0x58700f(++_0x2806ba);}(_0x3df4,0x102));var _0x43df=function(_0x17bfbb,_0x5e0cd0){_0x17bfbb=_0x17bfbb-0x0;var _0x58462a=_0x3df4[_0x17bfbb];return _0x58462a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x43df('0x0'));var timeout=require(_0x43df('0x1'));var express=require(_0x43df('0x2'));var router=express[_0x43df('0x3')]();var fs_extra=require(_0x43df('0x4'));var auth=require(_0x43df('0x5'));var interaction=require(_0x43df('0x6'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x43df('0x7')]('/',auth[_0x43df('0x8')](),controller[_0x43df('0x9')]);router[_0x43df('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x43df('0xa')]);router[_0x43df('0xb')]('/',auth[_0x43df('0x8')](),controller[_0x43df('0xc')]);router['put'](_0x43df('0xd'),auth['isAuthenticated'](),controller[_0x43df('0xe')]);router[_0x43df('0xf')](_0x43df('0xd'),auth[_0x43df('0x8')](),controller[_0x43df('0x10')]);module[_0x43df('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index baf1298..974d997 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 _0xffde=['exports','STRING','name'];(function(_0x548cca,_0x4121c2){var _0x1b58ee=function(_0x2f101d){while(--_0x2f101d){_0x548cca['push'](_0x548cca['shift']());}};_0x1b58ee(++_0x4121c2);}(_0xffde,0x9f));var _0xeffd=function(_0x49522d,_0x2d52c9){_0x49522d=_0x49522d-0x0;var _0x4ae102=_0xffde[_0x49522d];return _0x4ae102;};'use strict';var Sequelize=require('sequelize');module[_0xeffd('0x0')]={'name':{'type':Sequelize[_0xeffd('0x1')],'unique':_0xeffd('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeffd('0x1')]}}; \ No newline at end of file +var _0x5daf=['sequelize','exports','STRING','name'];(function(_0x49f4f4,_0x4b6189){var _0xbaaad3=function(_0x2cf3ee){while(--_0x2cf3ee){_0x49f4f4['push'](_0x49f4f4['shift']());}};_0xbaaad3(++_0x4b6189);}(_0x5daf,0x1a8));var _0xf5da=function(_0x264a7a,_0x494adc){_0x264a7a=_0x264a7a-0x0;var _0x1cbe27=_0x5daf[_0x264a7a];return _0x1cbe27;};'use strict';var Sequelize=require(_0xf5da('0x0'));module[_0xf5da('0x1')]={'name':{'type':Sequelize[_0xf5da('0x2')],'unique':_0xf5da('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 2611282..f7a4aab 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 _0xf193=['stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Variable','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','sendStatus'];(function(_0x4f3cf6,_0x1d8c0b){var _0x26309f=function(_0x5031c5){while(--_0x5031c5){_0x4f3cf6['push'](_0x4f3cf6['shift']());}};_0x26309f(++_0x1d8c0b);}(_0xf193,0xd9));var _0x3f19=function(_0x3ed93c,_0x9495c9){_0x3ed93c=_0x3ed93c-0x0;var _0x909ce9=_0xf193[_0x3ed93c];return _0x909ce9;};'use strict';var emlformat=require(_0x3f19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f19('0x1'));var jsonpatch=require(_0x3f19('0x2'));var rp=require(_0x3f19('0x3'));var moment=require('moment');var BPromise=require(_0x3f19('0x4'));var Mustache=require('mustache');var util=require(_0x3f19('0x5'));var path=require(_0x3f19('0x6'));var sox=require(_0x3f19('0x7'));var csv=require(_0x3f19('0x8'));var ejs=require(_0x3f19('0x9'));var fs=require('fs');var fs_extra=require(_0x3f19('0xa'));var _=require('lodash');var squel=require(_0x3f19('0xb'));var crypto=require(_0x3f19('0xc'));var jsforce=require(_0x3f19('0xd'));var deskjs=require(_0x3f19('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f19('0xf'));var Redis=require(_0x3f19('0x10'));var authService=require(_0x3f19('0x11'));var qs=require(_0x3f19('0x12'));var as=require(_0x3f19('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f19('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3f19('0x15'));var licenseUtil=require(_0x3f19('0x16'));var db=require(_0x3f19('0x17'))['db'];function respondWithStatusCode(_0x2a54d9,_0x466318){_0x466318=_0x466318||0xcc;return function(_0x17c452){if(_0x17c452){return _0x2a54d9['sendStatus'](_0x466318);}return _0x2a54d9[_0x3f19('0x18')](_0x466318)[_0x3f19('0x19')]();};}function respondWithResult(_0x176a80,_0x5c59f1){_0x5c59f1=_0x5c59f1||0xc8;return function(_0x12d3cc){if(_0x12d3cc){return _0x176a80[_0x3f19('0x18')](_0x5c59f1)[_0x3f19('0x1a')](_0x12d3cc);}};}function respondWithFilteredResult(_0x11707d,_0x4d78c2){return function(_0x2a98e4){if(_0x2a98e4){var _0x53970b=typeof _0x4d78c2[_0x3f19('0x1b')]===_0x3f19('0x1c')&&typeof _0x4d78c2[_0x3f19('0x1d')]===_0x3f19('0x1c');var _0x5cfa28=_0x2a98e4[_0x3f19('0x1e')];var _0x58e0f8=_0x53970b?0x0:_0x4d78c2[_0x3f19('0x1b')];var _0x879ee2=_0x53970b?_0x2a98e4[_0x3f19('0x1e')]:_0x4d78c2['offset']+_0x4d78c2[_0x3f19('0x1d')];var _0x83339;if(_0x879ee2>=_0x5cfa28){_0x879ee2=_0x5cfa28;_0x83339=0xc8;}else{_0x83339=0xce;}_0x11707d[_0x3f19('0x18')](_0x83339);return _0x11707d['set'](_0x3f19('0x1f'),_0x58e0f8+'-'+_0x879ee2+'/'+_0x5cfa28)[_0x3f19('0x1a')](_0x2a98e4);}return null;};}function patchUpdates(_0x182d75){return function(_0x6e4766){try{jsonpatch['apply'](_0x6e4766,_0x182d75,!![]);}catch(_0xfd91d0){return BPromise['reject'](_0xfd91d0);}return _0x6e4766[_0x3f19('0x20')]();};}function saveUpdates(_0x2cdcc9,_0x197483){return function(_0x5145bc){if(_0x5145bc){return _0x5145bc[_0x3f19('0x21')](_0x2cdcc9)[_0x3f19('0x22')](function(_0x1b796c){return _0x1b796c;});}return null;};}function removeEntity(_0x156fd6,_0x881da8){return function(_0xc7c3b5){if(_0xc7c3b5){return _0xc7c3b5[_0x3f19('0x23')]()[_0x3f19('0x22')](function(){var _0x11192b=_0xc7c3b5[_0x3f19('0x24')]({'plain':!![]});var _0x52b95a='Variables';return db['UserProfileResource'][_0x3f19('0x23')]({'where':{'type':_0x52b95a,'resourceId':_0x11192b['id']}})[_0x3f19('0x22')](function(){return _0xc7c3b5;});})[_0x3f19('0x22')](function(){_0x156fd6[_0x3f19('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3809cf,_0x1f2b59){return function(_0x127e9b){if(!_0x127e9b){_0x3809cf[_0x3f19('0x25')](0x194);}return _0x127e9b;};}function handleError(_0x4628fc,_0x3b961e){_0x3b961e=_0x3b961e||0x1f4;return function(_0x528e1c){logger['error'](_0x528e1c[_0x3f19('0x26')]);if(_0x528e1c[_0x3f19('0x27')]){delete _0x528e1c[_0x3f19('0x27')];}_0x4628fc[_0x3f19('0x18')](_0x3b961e)[_0x3f19('0x28')](_0x528e1c);};}exports[_0x3f19('0x29')]=function(_0x264c1f,_0x223ec7){var _0x270b6d={},_0x2afb70={},_0x184320={'count':0x0,'rows':[]};var _0x17d53d=_['map'](db['Variable']['rawAttributes'],function(_0x3e9ccd){return{'name':_0x3e9ccd[_0x3f19('0x2a')],'type':_0x3e9ccd[_0x3f19('0x2b')][_0x3f19('0x2c')]};});_0x2afb70[_0x3f19('0x2d')]=_[_0x3f19('0x2e')](_0x17d53d,_0x3f19('0x27'));_0x2afb70['query']=_[_0x3f19('0x2f')](_0x264c1f[_0x3f19('0x30')]);_0x2afb70[_0x3f19('0x31')]=_[_0x3f19('0x32')](_0x2afb70[_0x3f19('0x2d')],_0x2afb70['query']);_0x270b6d[_0x3f19('0x33')]=_[_0x3f19('0x32')](_0x2afb70[_0x3f19('0x2d')],qs['fields'](_0x264c1f['query'][_0x3f19('0x34')]));_0x270b6d[_0x3f19('0x33')]=_0x270b6d[_0x3f19('0x33')][_0x3f19('0x35')]?_0x270b6d[_0x3f19('0x33')]:_0x2afb70[_0x3f19('0x2d')];if(!_0x264c1f[_0x3f19('0x30')][_0x3f19('0x36')](_0x3f19('0x37'))){_0x270b6d[_0x3f19('0x1d')]=qs[_0x3f19('0x1d')](_0x264c1f[_0x3f19('0x30')][_0x3f19('0x1d')]);_0x270b6d[_0x3f19('0x1b')]=qs[_0x3f19('0x1b')](_0x264c1f['query']['offset']);}_0x270b6d[_0x3f19('0x38')]=qs['sort'](_0x264c1f[_0x3f19('0x30')][_0x3f19('0x39')]);_0x270b6d[_0x3f19('0x3a')]=qs[_0x3f19('0x31')](_[_0x3f19('0x3b')](_0x264c1f['query'],_0x2afb70[_0x3f19('0x31')]),_0x17d53d);if(_0x264c1f[_0x3f19('0x30')][_0x3f19('0x3c')]){_0x270b6d[_0x3f19('0x3a')]=_[_0x3f19('0x3d')](_0x270b6d[_0x3f19('0x3a')],{'$or':_['map'](_0x17d53d,function(_0x526b0d){if(_0x526b0d[_0x3f19('0x2b')]!==_0x3f19('0x3e')){var _0x266be={};_0x266be[_0x526b0d[_0x3f19('0x27')]]={'$like':'%'+_0x264c1f['query']['filter']+'%'};return _0x266be;}})});}_0x270b6d=_['merge']({},_0x270b6d,_0x264c1f[_0x3f19('0x3f')]);var _0x528fb0={'where':_0x270b6d[_0x3f19('0x3a')]};return db[_0x3f19('0x40')][_0x3f19('0x1e')](_0x528fb0)[_0x3f19('0x22')](function(_0x32dd2c){_0x184320[_0x3f19('0x1e')]=_0x32dd2c;if(_0x264c1f['query']['includeAll']){_0x270b6d[_0x3f19('0x41')]=[{'all':!![]}];}return db[_0x3f19('0x40')][_0x3f19('0x42')](_0x270b6d);})[_0x3f19('0x22')](function(_0x4a4cb7){_0x184320[_0x3f19('0x43')]=_0x4a4cb7;return _0x184320;})[_0x3f19('0x22')](respondWithFilteredResult(_0x223ec7,_0x270b6d))[_0x3f19('0x44')](handleError(_0x223ec7,null));};exports[_0x3f19('0x45')]=function(_0x52c6a7,_0x4f3e19){var _0x5ea87f={'raw':!![],'where':{'id':_0x52c6a7[_0x3f19('0x46')]['id']}},_0x47b897={};_0x47b897['model']=_[_0x3f19('0x2f')](db[_0x3f19('0x40')][_0x3f19('0x47')]);_0x47b897[_0x3f19('0x30')]=_[_0x3f19('0x2f')](_0x52c6a7[_0x3f19('0x30')]);_0x47b897['filters']=_[_0x3f19('0x32')](_0x47b897[_0x3f19('0x2d')],_0x47b897['query']);_0x5ea87f[_0x3f19('0x33')]=_['intersection'](_0x47b897[_0x3f19('0x2d')],qs[_0x3f19('0x34')](_0x52c6a7['query'][_0x3f19('0x34')]));_0x5ea87f[_0x3f19('0x33')]=_0x5ea87f['attributes'][_0x3f19('0x35')]?_0x5ea87f[_0x3f19('0x33')]:_0x47b897[_0x3f19('0x2d')];if(_0x52c6a7[_0x3f19('0x30')]['includeAll']){_0x5ea87f[_0x3f19('0x41')]=[{'all':!![]}];}_0x5ea87f=_[_0x3f19('0x3d')]({},_0x5ea87f,_0x52c6a7[_0x3f19('0x3f')]);return db[_0x3f19('0x40')]['find'](_0x5ea87f)['then'](handleEntityNotFound(_0x4f3e19,null))[_0x3f19('0x22')](respondWithResult(_0x4f3e19,null))[_0x3f19('0x44')](handleError(_0x4f3e19,null));};exports[_0x3f19('0x48')]=function(_0x4b294c,_0x1420c4){return db[_0x3f19('0x40')][_0x3f19('0x48')](_0x4b294c[_0x3f19('0x49')],{})[_0x3f19('0x22')](function(_0x95c9f8){var _0x58070f=_0x4b294c[_0x3f19('0x4a')][_0x3f19('0x24')]({'plain':!![]});if(!_0x58070f)throw new Error(_0x3f19('0x4b'));if(_0x58070f[_0x3f19('0x4c')]===_0x3f19('0x4a')){var _0xcd7cea=_0x95c9f8[_0x3f19('0x24')]({'plain':!![]});var _0x5d0a6d=_0x3f19('0x4d');return db[_0x3f19('0x4e')]['find']({'where':{'name':_0x5d0a6d,'userProfileId':_0x58070f[_0x3f19('0x4f')]},'raw':!![]})['then'](function(_0x1410dd){if(_0x1410dd&&_0x1410dd[_0x3f19('0x50')]===0x0){return db[_0x3f19('0x51')][_0x3f19('0x48')]({'name':_0xcd7cea[_0x3f19('0x27')],'resourceId':_0xcd7cea['id'],'type':_0x1410dd[_0x3f19('0x27')],'sectionId':_0x1410dd['id']},{})[_0x3f19('0x22')](function(){return _0x95c9f8;});}else{return _0x95c9f8;}})['catch'](function(_0x2361ae){logger[_0x3f19('0x52')](_0x3f19('0x53'),_0x2361ae);throw _0x2361ae;});}return _0x95c9f8;})[_0x3f19('0x22')](respondWithResult(_0x1420c4,0xc9))[_0x3f19('0x44')](handleError(_0x1420c4,null));};exports[_0x3f19('0x21')]=function(_0x526a53,_0x19db66){if(_0x526a53['body']['id']){delete _0x526a53['body']['id'];}return db['Variable']['find']({'where':{'id':_0x526a53['params']['id']}})[_0x3f19('0x22')](handleEntityNotFound(_0x19db66,null))['then'](saveUpdates(_0x526a53[_0x3f19('0x49')],null))['then'](respondWithResult(_0x19db66,null))[_0x3f19('0x44')](handleError(_0x19db66,null));};exports[_0x3f19('0x23')]=function(_0x5e2e74,_0x59a735){return db['Variable'][_0x3f19('0x54')]({'where':{'id':_0x5e2e74[_0x3f19('0x46')]['id']}})[_0x3f19('0x22')](handleEntityNotFound(_0x59a735,null))['then'](removeEntity(_0x59a735,null))['catch'](handleError(_0x59a735,null));}; \ No newline at end of file +var _0x310f=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Variable','rows','show','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','Variables','UserProfileResource','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x374061,_0x2a62b8){var _0x484ed4=function(_0x31d88f){while(--_0x31d88f){_0x374061['push'](_0x374061['shift']());}};_0x484ed4(++_0x2a62b8);}(_0x310f,0x166));var _0xf310=function(_0x322d9f,_0x1dd054){_0x322d9f=_0x322d9f-0x0;var _0x14e7fe=_0x310f[_0x322d9f];return _0x14e7fe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf310('0x0'));var jsonpatch=require(_0xf310('0x1'));var rp=require(_0xf310('0x2'));var moment=require(_0xf310('0x3'));var BPromise=require(_0xf310('0x4'));var Mustache=require(_0xf310('0x5'));var util=require(_0xf310('0x6'));var path=require(_0xf310('0x7'));var sox=require(_0xf310('0x8'));var csv=require(_0xf310('0x9'));var ejs=require(_0xf310('0xa'));var fs=require('fs');var fs_extra=require(_0xf310('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf310('0xc'));var jsforce=require(_0xf310('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf310('0x9'));var querystring=require('querystring');var Papa=require(_0xf310('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf310('0xf'));var as=require(_0xf310('0x10'));var hardwareService=require(_0xf310('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf310('0x12'));var licenseUtil=require(_0xf310('0x13'));var db=require(_0xf310('0x14'))['db'];function respondWithStatusCode(_0x4f8495,_0xe5d862){_0xe5d862=_0xe5d862||0xcc;return function(_0x955a39){if(_0x955a39){return _0x4f8495[_0xf310('0x15')](_0xe5d862);}return _0x4f8495[_0xf310('0x16')](_0xe5d862)['end']();};}function respondWithResult(_0x1edd8e,_0x52d160){_0x52d160=_0x52d160||0xc8;return function(_0x34abbb){if(_0x34abbb){return _0x1edd8e[_0xf310('0x16')](_0x52d160)[_0xf310('0x17')](_0x34abbb);}};}function respondWithFilteredResult(_0x1d016e,_0x3f17ed){return function(_0x822ab3){if(_0x822ab3){var _0x146a10=typeof _0x3f17ed[_0xf310('0x18')]===_0xf310('0x19')&&typeof _0x3f17ed[_0xf310('0x1a')]===_0xf310('0x19');var _0x10ba15=_0x822ab3[_0xf310('0x1b')];var _0x139c9d=_0x146a10?0x0:_0x3f17ed[_0xf310('0x18')];var _0x2f35f4=_0x146a10?_0x822ab3[_0xf310('0x1b')]:_0x3f17ed[_0xf310('0x18')]+_0x3f17ed[_0xf310('0x1a')];var _0x4effa2;if(_0x2f35f4>=_0x10ba15){_0x2f35f4=_0x10ba15;_0x4effa2=0xc8;}else{_0x4effa2=0xce;}_0x1d016e[_0xf310('0x16')](_0x4effa2);return _0x1d016e['set'](_0xf310('0x1c'),_0x139c9d+'-'+_0x2f35f4+'/'+_0x10ba15)[_0xf310('0x17')](_0x822ab3);}return null;};}function patchUpdates(_0x12518c){return function(_0x4b59fe){try{jsonpatch[_0xf310('0x1d')](_0x4b59fe,_0x12518c,!![]);}catch(_0x467b10){return BPromise[_0xf310('0x1e')](_0x467b10);}return _0x4b59fe[_0xf310('0x1f')]();};}function saveUpdates(_0x1df8e8,_0x5354a5){return function(_0x582f07){if(_0x582f07){return _0x582f07['update'](_0x1df8e8)[_0xf310('0x20')](function(_0x341d82){return _0x341d82;});}return null;};}function removeEntity(_0x3d66c8,_0x2481d6){return function(_0xfacc76){if(_0xfacc76){return _0xfacc76[_0xf310('0x21')]()[_0xf310('0x20')](function(){var _0x5be9f5=_0xfacc76[_0xf310('0x22')]({'plain':!![]});var _0x3917e1=_0xf310('0x23');return db[_0xf310('0x24')]['destroy']({'where':{'type':_0x3917e1,'resourceId':_0x5be9f5['id']}})[_0xf310('0x20')](function(){return _0xfacc76;});})[_0xf310('0x20')](function(){_0x3d66c8[_0xf310('0x16')](0xcc)[_0xf310('0x25')]();});}};}function handleEntityNotFound(_0x5d5cab,_0x144064){return function(_0x6b46d0){if(!_0x6b46d0){_0x5d5cab[_0xf310('0x15')](0x194);}return _0x6b46d0;};}function handleError(_0x1a62a0,_0x33b934){_0x33b934=_0x33b934||0x1f4;return function(_0x31b6f2){logger['error'](_0x31b6f2[_0xf310('0x26')]);if(_0x31b6f2[_0xf310('0x27')]){delete _0x31b6f2['name'];}_0x1a62a0[_0xf310('0x16')](_0x33b934)[_0xf310('0x28')](_0x31b6f2);};}exports['index']=function(_0x4c1381,_0x428c9a){var _0x4113e2={},_0x1da85b={},_0x4e912b={'count':0x0,'rows':[]};var _0x4c9693=_[_0xf310('0x29')](db['Variable'][_0xf310('0x2a')],function(_0x49f87d){return{'name':_0x49f87d[_0xf310('0x2b')],'type':_0x49f87d[_0xf310('0x2c')][_0xf310('0x2d')]};});_0x1da85b[_0xf310('0x2e')]=_[_0xf310('0x29')](_0x4c9693,_0xf310('0x27'));_0x1da85b[_0xf310('0x2f')]=_[_0xf310('0x30')](_0x4c1381['query']);_0x1da85b[_0xf310('0x31')]=_[_0xf310('0x32')](_0x1da85b['model'],_0x1da85b[_0xf310('0x2f')]);_0x4113e2[_0xf310('0x33')]=_['intersection'](_0x1da85b[_0xf310('0x2e')],qs[_0xf310('0x34')](_0x4c1381[_0xf310('0x2f')]['fields']));_0x4113e2[_0xf310('0x33')]=_0x4113e2['attributes'][_0xf310('0x35')]?_0x4113e2[_0xf310('0x33')]:_0x1da85b['model'];if(!_0x4c1381[_0xf310('0x2f')][_0xf310('0x36')](_0xf310('0x37'))){_0x4113e2[_0xf310('0x1a')]=qs['limit'](_0x4c1381[_0xf310('0x2f')][_0xf310('0x1a')]);_0x4113e2[_0xf310('0x18')]=qs[_0xf310('0x18')](_0x4c1381[_0xf310('0x2f')][_0xf310('0x18')]);}_0x4113e2[_0xf310('0x38')]=qs[_0xf310('0x39')](_0x4c1381[_0xf310('0x2f')][_0xf310('0x39')]);_0x4113e2['where']=qs[_0xf310('0x31')](_[_0xf310('0x3a')](_0x4c1381[_0xf310('0x2f')],_0x1da85b[_0xf310('0x31')]),_0x4c9693);if(_0x4c1381[_0xf310('0x2f')][_0xf310('0x3b')]){_0x4113e2[_0xf310('0x3c')]=_[_0xf310('0x3d')](_0x4113e2['where'],{'$or':_[_0xf310('0x29')](_0x4c9693,function(_0x1b48b7){if(_0x1b48b7[_0xf310('0x2c')]!==_0xf310('0x3e')){var _0x1997c2={};_0x1997c2[_0x1b48b7[_0xf310('0x27')]]={'$like':'%'+_0x4c1381['query']['filter']+'%'};return _0x1997c2;}})});}_0x4113e2=_[_0xf310('0x3d')]({},_0x4113e2,_0x4c1381[_0xf310('0x3f')]);var _0x76f36={'where':_0x4113e2['where']};return db['Variable'][_0xf310('0x1b')](_0x76f36)['then'](function(_0x2ae46d){_0x4e912b[_0xf310('0x1b')]=_0x2ae46d;if(_0x4c1381[_0xf310('0x2f')]['includeAll']){_0x4113e2['include']=[{'all':!![]}];}return db[_0xf310('0x40')]['findAll'](_0x4113e2);})[_0xf310('0x20')](function(_0x4395fa){_0x4e912b[_0xf310('0x41')]=_0x4395fa;return _0x4e912b;})['then'](respondWithFilteredResult(_0x428c9a,_0x4113e2))['catch'](handleError(_0x428c9a,null));};exports[_0xf310('0x42')]=function(_0x552ddf,_0x469089){var _0x1ee0ff={'raw':!![],'where':{'id':_0x552ddf['params']['id']}},_0x155fc6={};_0x155fc6['model']=_[_0xf310('0x30')](db['Variable'][_0xf310('0x2a')]);_0x155fc6[_0xf310('0x2f')]=_[_0xf310('0x30')](_0x552ddf[_0xf310('0x2f')]);_0x155fc6['filters']=_[_0xf310('0x32')](_0x155fc6['model'],_0x155fc6[_0xf310('0x2f')]);_0x1ee0ff['attributes']=_['intersection'](_0x155fc6['model'],qs[_0xf310('0x34')](_0x552ddf[_0xf310('0x2f')][_0xf310('0x34')]));_0x1ee0ff['attributes']=_0x1ee0ff[_0xf310('0x33')]['length']?_0x1ee0ff[_0xf310('0x33')]:_0x155fc6[_0xf310('0x2e')];if(_0x552ddf[_0xf310('0x2f')][_0xf310('0x43')]){_0x1ee0ff[_0xf310('0x44')]=[{'all':!![]}];}_0x1ee0ff=_[_0xf310('0x3d')]({},_0x1ee0ff,_0x552ddf[_0xf310('0x3f')]);return db['Variable'][_0xf310('0x45')](_0x1ee0ff)[_0xf310('0x20')](handleEntityNotFound(_0x469089,null))['then'](respondWithResult(_0x469089,null))[_0xf310('0x46')](handleError(_0x469089,null));};exports[_0xf310('0x47')]=function(_0x216244,_0x4227c8){return db[_0xf310('0x40')][_0xf310('0x47')](_0x216244[_0xf310('0x48')],{})['then'](function(_0x9f4916){var _0x1509f3=_0x216244[_0xf310('0x49')][_0xf310('0x22')]({'plain':!![]});if(!_0x1509f3)throw new Error(_0xf310('0x4a'));if(_0x1509f3[_0xf310('0x4b')]==='user'){var _0x5d7a7b=_0x9f4916['get']({'plain':!![]});var _0x5f3ad7=_0xf310('0x23');return db[_0xf310('0x4c')]['find']({'where':{'name':_0x5f3ad7,'userProfileId':_0x1509f3[_0xf310('0x4d')]},'raw':!![]})[_0xf310('0x20')](function(_0x291c8c){if(_0x291c8c&&_0x291c8c[_0xf310('0x4e')]===0x0){return db[_0xf310('0x24')][_0xf310('0x47')]({'name':_0x5d7a7b[_0xf310('0x27')],'resourceId':_0x5d7a7b['id'],'type':_0x291c8c[_0xf310('0x27')],'sectionId':_0x291c8c['id']},{})[_0xf310('0x20')](function(){return _0x9f4916;});}else{return _0x9f4916;}})[_0xf310('0x46')](function(_0x4d9812){logger['error'](_0xf310('0x4f'),_0x4d9812);throw _0x4d9812;});}return _0x9f4916;})[_0xf310('0x20')](respondWithResult(_0x4227c8,0xc9))[_0xf310('0x46')](handleError(_0x4227c8,null));};exports[_0xf310('0x50')]=function(_0x50f92e,_0x25cb58){if(_0x50f92e[_0xf310('0x48')]['id']){delete _0x50f92e['body']['id'];}return db[_0xf310('0x40')][_0xf310('0x45')]({'where':{'id':_0x50f92e['params']['id']}})[_0xf310('0x20')](handleEntityNotFound(_0x25cb58,null))[_0xf310('0x20')](saveUpdates(_0x50f92e[_0xf310('0x48')],null))['then'](respondWithResult(_0x25cb58,null))[_0xf310('0x46')](handleError(_0x25cb58,null));};exports[_0xf310('0x21')]=function(_0x15e2d7,_0x438fe0){return db[_0xf310('0x40')][_0xf310('0x45')]({'where':{'id':_0x15e2d7[_0xf310('0x51')]['id']}})[_0xf310('0x20')](handleEntityNotFound(_0x438fe0,null))[_0xf310('0x20')](removeEntity(_0x438fe0,null))[_0xf310('0x46')](handleError(_0x438fe0,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 15f3f68..79b1a9d 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 _0xd48c=['./variable.attributes','define','Variable','tools_variables','util','api','bluebird','path','rimraf'];(function(_0x1a5557,_0x20000d){var _0x10e30b=function(_0x48f3cb){while(--_0x48f3cb){_0x1a5557['push'](_0x1a5557['shift']());}};_0x10e30b(++_0x20000d);}(_0xd48c,0xe5));var _0xcd48=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xd48c[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require('lodash');var util=require(_0xcd48('0x0'));var logger=require('../../config/logger')(_0xcd48('0x1'));var moment=require('moment');var BPromise=require(_0xcd48('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd48('0x3'));var rimraf=require(_0xcd48('0x4'));var config=require('../../config/environment');var attributes=require(_0xcd48('0x5'));module['exports']=function(_0x2c0452,_0x470a53){return _0x2c0452[_0xcd48('0x6')](_0xcd48('0x7'),attributes,{'tableName':_0xcd48('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf925=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','define','Variable','tools_variables','lodash','util'];(function(_0x3e6db8,_0x195bf5){var _0x5d01e9=function(_0x5e2e78){while(--_0x5e2e78){_0x3e6db8['push'](_0x3e6db8['shift']());}};_0x5d01e9(++_0x195bf5);}(_0xf925,0x15c));var _0x5f92=function(_0x50af79,_0x26774e){_0x50af79=_0x50af79-0x0;var _0xebf22a=_0xf925[_0x50af79];return _0xebf22a;};'use strict';var _=require(_0x5f92('0x0'));var util=require(_0x5f92('0x1'));var logger=require(_0x5f92('0x2'))(_0x5f92('0x3'));var moment=require(_0x5f92('0x4'));var BPromise=require(_0x5f92('0x5'));var rp=require(_0x5f92('0x6'));var fs=require('fs');var path=require(_0x5f92('0x7'));var rimraf=require(_0x5f92('0x8'));var config=require('../../config/environment');var attributes=require(_0x5f92('0x9'));module[_0x5f92('0xa')]=function(_0x49a479,_0x3f1bfa){return _0x49a479[_0x5f92('0xb')](_0x5f92('0xc'),attributes,{'tableName':_0x5f92('0xd'),'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 e2b4169..88c3f73 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(_0x48298d,_0x26cd10){var _0x58aed5=function(_0x398e23){while(--_0x398e23){_0x48298d['push'](_0x48298d['shift']());}};_0x58aed5(++_0x26cd10);}(_0xabce,0x103));var _0xeabc=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xabce[_0x18a79d];return _0x4f8848;};'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 _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(_0x5e9be5,_0x95fa7a){var _0x12e007=function(_0x3ceee3){while(--_0x3ceee3){_0x5e9be5['push'](_0x5e9be5['shift']());}};_0x12e007(++_0x95fa7a);}(_0xabce,0x103));var _0xeabc=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xabce[_0x4bfac3];return _0x15f0f2;};'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 diff --git a/server/api/version/index.js b/server/api/version/index.js index ef93b6c..905799e 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 _0x6a67=['express','Router','../../components/auth/service','index','get','isAuthenticated','/reset','reset','/pull','canUpdate','pull','migrations'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x6a67,0x1e0));var _0x76a6=function(_0xe06071,_0x4eeaa1){_0xe06071=_0xe06071-0x0;var _0x8ad8be=_0x6a67[_0xe06071];return _0x8ad8be;};'use strict';var express=require(_0x76a6('0x0'));var router=express[_0x76a6('0x1')]();var auth=require(_0x76a6('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x76a6('0x3')]);router[_0x76a6('0x4')]('/fetch',auth[_0x76a6('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0x76a6('0x4')](_0x76a6('0x6'),auth[_0x76a6('0x5')](),auth['canUpdate'](),controller[_0x76a6('0x7')]);router[_0x76a6('0x4')](_0x76a6('0x8'),auth['isAuthenticated'](),auth[_0x76a6('0x9')](),controller[_0x76a6('0xa')]);router['get']('/restart',auth[_0x76a6('0x5')](),controller['restart']);router[_0x76a6('0x4')]('/migrations',controller[_0x76a6('0xb')]);module['exports']=router; \ No newline at end of file +var _0xd3d5=['get','/fetch','isAuthenticated','canUpdate','/reset','/pull','pull','/restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd3d5,0x146));var _0x5d3d=function(_0x4675a5,_0x4ee8ea){_0x4675a5=_0x4675a5-0x0;var _0x2f6195=_0xd3d5[_0x4675a5];return _0x2f6195;};'use strict';var express=require(_0x5d3d('0x0'));var router=express[_0x5d3d('0x1')]();var auth=require(_0x5d3d('0x2'));var controller=require(_0x5d3d('0x3'));router[_0x5d3d('0x4')]('/',controller['index']);router[_0x5d3d('0x4')](_0x5d3d('0x5'),auth[_0x5d3d('0x6')](),auth[_0x5d3d('0x7')](),controller['fetch']);router[_0x5d3d('0x4')](_0x5d3d('0x8'),auth[_0x5d3d('0x6')](),auth[_0x5d3d('0x7')](),controller['reset']);router[_0x5d3d('0x4')](_0x5d3d('0x9'),auth[_0x5d3d('0x6')](),auth[_0x5d3d('0x7')](),controller[_0x5d3d('0xa')]);router[_0x5d3d('0x4')](_0x5d3d('0xb'),auth[_0x5d3d('0x6')](),controller['restart']);router['get'](_0x5d3d('0xc'),controller[_0x5d3d('0xd')]);module[_0x5d3d('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 3af25cb..2dc5498 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 _0x67e0=['push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','tags','latest','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','server','length','replace'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x67e0,0xea));var _0x067e=function(_0x4dbc5d,_0x2d0a51){_0x4dbc5d=_0x4dbc5d-0x0;var _0x45b461=_0x67e0[_0x4dbc5d];return _0x45b461;};'use strict';var Umzug=require(_0x067e('0x0'));var path=require(_0x067e('0x1'));var fs=require('fs');var _=require(_0x067e('0x2'));var pkginfo=require(_0x067e('0x3'))(module,_0x067e('0x4'));var compareVersions=require(_0x067e('0x5'));var exec=require(_0x067e('0x6'))[_0x067e('0x7')];var db=require(_0x067e('0x8'))['db'];var config=require(_0x067e('0x9'));var pm2=require(_0x067e('0xa'));var logger=require(_0x067e('0xb'))('update');var git=require(_0x067e('0xc'))(config[_0x067e('0xd')]);exports['index']=function(_0x515f13,_0x30f12c){var _0x140881={'current':module[_0x067e('0xe')][_0x067e('0x4')],'phonebar':0x2};if(_0x515f13[_0x067e('0xf')]&&_0x515f13[_0x067e('0xf')]['latest']){return git['fetch']()[_0x067e('0x10')](function(_0x3db81c,_0x1f59dc){_0x140881[_0x067e('0x11')]=(_0x3db81c?module['exports']['version']:_0x1f59dc['latest'])||_0x067e('0x12');return _0x30f12c[_0x067e('0x13')](0xc8)[_0x067e('0x14')](_0x140881);});}else{return _0x30f12c[_0x067e('0x13')](0xc8)['json'](_0x140881);}};exports[_0x067e('0x15')]=function(_0xab70e0,_0x1cf601){return git['fetch']([_0x067e('0x16'),_0x067e('0x17')],function(_0x41580f){if(_0x41580f){logger[_0x067e('0x18')](_0x41580f);return _0x1cf601['status'](0x1f4)['json'](_0x41580f);}logger[_0x067e('0x19')](_0x067e('0x1a'));return _0x1cf601[_0x067e('0x13')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x15b0a8,_0x39713a){return git['reset']([_0x067e('0x1b'),_0x067e('0x1c')],function(_0x2f65ff){if(_0x2f65ff){logger[_0x067e('0x18')](_0x2f65ff);return _0x39713a[_0x067e('0x13')](0x1f4)[_0x067e('0x14')](_0x2f65ff);}logger[_0x067e('0x19')](_0x067e('0x1d'));return _0x39713a[_0x067e('0x13')](0xc8)['json']({'output':_0x067e('0x1e')});});};exports[_0x067e('0x1f')]=function(_0x588228,_0xba1480){exec(_0x067e('0x20'),function(_0x370caa,_0x5b28fe,_0x490170){logger['info'](_0x5b28fe);logger['info'](_0x490170);if(_0x370caa){logger[_0x067e('0x18')](_0x370caa);return _0xba1480[_0x067e('0x13')](0x1f4)['json'](_0x370caa);}return _0xba1480[_0x067e('0x13')](0xc8)[_0x067e('0x14')]({'output':_0x5b28fe});});};exports[_0x067e('0x21')]=function(_0x48b385,_0x559f9f){return pm2[_0x067e('0x21')]('motion2')[_0x067e('0x22')](function(_0x569873){logger[_0x067e('0x19')](_0x067e('0x23'),_0x569873);return _0x559f9f[_0x067e('0x13')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x067e('0x24')](function(_0x51628c){logger['error'](_0x51628c);return _0x559f9f['status'](0x1f4)[_0x067e('0x14')](_0x51628c);});};exports[_0x067e('0x25')]=function(_0x2301ff,_0x2513d1){var _0xc60ef3=fs['readdirSync'](path['join'](config['root'],_0x067e('0x26'),_0x067e('0x25')));var _0x4afc61=[];for(var _0x5ad533=0x0;_0x5ad533<_0xc60ef3[_0x067e('0x27')];_0x5ad533++){var _0x2bee20=_0xc60ef3[_0x5ad533][_0x067e('0x28')]('.js','');if(compareVersions(module['exports'][_0x067e('0x4')],_0x2bee20)===-0x1){_0x4afc61[_0x067e('0x29')](_0x2bee20);}}if(_0x4afc61[_0x067e('0x27')]){var _0xc72bc3=_0x4afc61[_0x067e('0x2a')](compareVersions);var _0x2eb223=new Umzug({'storage':_0x067e('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0x067e('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x067e('0x2b')][_0x067e('0x2d')](),db['sequelize'][_0x067e('0x2e')],function(){throw new Error(_0x067e('0x2f'));}],'path':path[_0x067e('0x30')](config['root'],_0x067e('0x26'),_0x067e('0x25')),'pattern':/\.js$/}});_0x2eb223['up']({'migrations':_[_0x067e('0x31')](_0xc72bc3,function(_0x1a0e69){return _0x1a0e69+_0x067e('0x32');})})['then'](function(){return _0x2513d1['status'](0xc8)[_0x067e('0x14')]({'output':_0x067e('0x33')+module[_0x067e('0xe')][_0x067e('0x4')]+'\x20to\x20'+_[_0x067e('0x34')](_0xc72bc3),'migrations':_[_0x067e('0x30')](_0xc72bc3)});})[_0x067e('0x24')](function(_0x31acc0){if(_0x31acc0 instanceof db[_0x067e('0x2b')][_0x067e('0x35')]){return _0x2513d1['status'](0xc8)['json']({'output':_0x067e('0x36')});}else{return _0x2513d1['status'](0x1f4)[_0x067e('0x14')](_0x31acc0);}});}else{return _0x2513d1[_0x067e('0x13')](0xc8)[_0x067e('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x1540=['pkginfo','compare-versions','child_process','../../config/logger','update','simple-git','root','index','exports','version','query','fetch','tags','latest','2.0.0','json','status','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','length','sort','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1540,0x66));var _0x0154=function(_0x3b04e0,_0x59da99){_0x3b04e0=_0x3b04e0-0x0;var _0x368ecf=_0x1540[_0x3b04e0];return _0x368ecf;};'use strict';var Umzug=require(_0x0154('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x0154('0x1'));var pkginfo=require(_0x0154('0x2'))(module,'version');var compareVersions=require(_0x0154('0x3'));var exec=require(_0x0154('0x4'))['exec'];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0x0154('0x5'))(_0x0154('0x6'));var git=require(_0x0154('0x7'))(config[_0x0154('0x8')]);exports[_0x0154('0x9')]=function(_0x2cdbd1,_0x21cbed){var _0x152d29={'current':module[_0x0154('0xa')][_0x0154('0xb')],'phonebar':0x2};if(_0x2cdbd1[_0x0154('0xc')]&&_0x2cdbd1[_0x0154('0xc')]['latest']){return git[_0x0154('0xd')]()[_0x0154('0xe')](function(_0x295718,_0x3485c2){_0x152d29[_0x0154('0xf')]=(_0x295718?module[_0x0154('0xa')][_0x0154('0xb')]:_0x3485c2[_0x0154('0xf')])||_0x0154('0x10');return _0x21cbed['status'](0xc8)[_0x0154('0x11')](_0x152d29);});}else{return _0x21cbed[_0x0154('0x12')](0xc8)[_0x0154('0x11')](_0x152d29);}};exports[_0x0154('0xd')]=function(_0x52644e,_0x47ae53){return git['fetch']([_0x0154('0x13'),_0x0154('0x14')],function(_0x5f4046){if(_0x5f4046){logger[_0x0154('0x15')](_0x5f4046);return _0x47ae53[_0x0154('0x12')](0x1f4)[_0x0154('0x11')](_0x5f4046);}logger['info'](_0x0154('0x16'));return _0x47ae53['status'](0xc8)[_0x0154('0x11')]({'output':_0x0154('0x17')});});};exports[_0x0154('0x18')]=function(_0x14d050,_0x12f66b){return git['reset']([_0x0154('0x19'),_0x0154('0x1a')],function(_0x105b85){if(_0x105b85){logger[_0x0154('0x15')](_0x105b85);return _0x12f66b[_0x0154('0x12')](0x1f4)['json'](_0x105b85);}logger[_0x0154('0x1b')](_0x0154('0x1c'));return _0x12f66b[_0x0154('0x12')](0xc8)['json']({'output':_0x0154('0x1d')});});};exports['pull']=function(_0x5d84f8,_0x1ed575){exec(_0x0154('0x1e'),function(_0xcb5b03,_0xf36812,_0x768805){logger[_0x0154('0x1b')](_0xf36812);logger[_0x0154('0x1b')](_0x768805);if(_0xcb5b03){logger['error'](_0xcb5b03);return _0x1ed575['status'](0x1f4)['json'](_0xcb5b03);}return _0x1ed575['status'](0xc8)[_0x0154('0x11')]({'output':_0xf36812});});};exports['restart']=function(_0x2fc8d1,_0x10da3c){return pm2[_0x0154('0x1f')](_0x0154('0x20'))['then'](function(_0x2d6a19){logger[_0x0154('0x1b')]('pm2\x20restart\x20motion\x20%s',_0x2d6a19);return _0x10da3c[_0x0154('0x12')](0xc8)['json']({'output':_0x0154('0x21')});})['catch'](function(_0x57643c){logger[_0x0154('0x15')](_0x57643c);return _0x10da3c['status'](0x1f4)['json'](_0x57643c);});};exports[_0x0154('0x22')]=function(_0x384ce9,_0x4c697a){var _0x248775=fs[_0x0154('0x23')](path[_0x0154('0x24')](config['root'],'server',_0x0154('0x22')));var _0x32a862=[];for(var _0x259493=0x0;_0x259493<_0x248775[_0x0154('0x25')];_0x259493++){var _0x5847b5=_0x248775[_0x259493]['replace']('.js','');if(compareVersions(module['exports'][_0x0154('0xb')],_0x5847b5)===-0x1){_0x32a862['push'](_0x5847b5);}}if(_0x32a862[_0x0154('0x25')]){var _0x27fb61=_0x32a862[_0x0154('0x26')](compareVersions);var _0x50b461=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x0154('0x27'),'columnName':_0x0154('0xb')},'migrations':{'params':[db['sequelize'][_0x0154('0x28')](),db['sequelize'][_0x0154('0x29')],function(){throw new Error(_0x0154('0x2a'));}],'path':path[_0x0154('0x24')](config[_0x0154('0x8')],_0x0154('0x2b'),_0x0154('0x22')),'pattern':/\.js$/}});_0x50b461['up']({'migrations':_[_0x0154('0x2c')](_0x27fb61,function(_0x415dda){return _0x415dda+'.js';})})[_0x0154('0x2d')](function(){return _0x4c697a['status'](0xc8)[_0x0154('0x11')]({'output':_0x0154('0x2e')+module[_0x0154('0xa')][_0x0154('0xb')]+_0x0154('0x2f')+_[_0x0154('0x30')](_0x27fb61),'migrations':_['join'](_0x27fb61)});})[_0x0154('0x31')](function(_0xa50e4){if(_0xa50e4 instanceof db['sequelize'][_0x0154('0x32')]){return _0x4c697a[_0x0154('0x12')](0xc8)[_0x0154('0x11')]({'output':_0x0154('0x33')});}else{return _0x4c697a[_0x0154('0x12')](0x1f4)[_0x0154('0x11')](_0xa50e4);}});}else{return _0x4c697a['status'](0xc8)[_0x0154('0x11')]({'output':_0x0154('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index f284942..b023471 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 _0x7950=['/:id','update','delete','exports','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put'];(function(_0x2da223,_0x4ecf9a){var _0x1fd244=function(_0x3deb7a){while(--_0x3deb7a){_0x2da223['push'](_0x2da223['shift']());}};_0x1fd244(++_0x4ecf9a);}(_0x7950,0x1a2));var _0x0795=function(_0x4d10cb,_0x2b4821){_0x4d10cb=_0x4d10cb-0x0;var _0x2b4830=_0x7950[_0x4d10cb];return _0x2b4830;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0795('0x0'));var timeout=require(_0x0795('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0795('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x0795('0x3'));var config=require(_0x0795('0x4'));var controller=require(_0x0795('0x5'));router[_0x0795('0x6')]('/',auth[_0x0795('0x7')](),controller['index']);router[_0x0795('0x6')](_0x0795('0x8'),auth[_0x0795('0x7')](),controller[_0x0795('0x9')]);router[_0x0795('0x6')]('/:id',auth[_0x0795('0x7')](),controller[_0x0795('0xa')]);router[_0x0795('0xb')]('/',auth[_0x0795('0x7')](),controller[_0x0795('0xc')]);router[_0x0795('0xd')](_0x0795('0xe'),auth['isAuthenticated'](),controller[_0x0795('0xf')]);router[_0x0795('0x10')]('/:id',auth[_0x0795('0x7')](),controller['destroy']);module[_0x0795('0x11')]=router; \ No newline at end of file +var _0x9ae1=['get','isAuthenticated','index','/describe','describe','show','/:id','update','delete','exports','path','connect-timeout','express','../../components/interaction/service','./voiceAgentReport.controller'];(function(_0x562736,_0x4d6445){var _0x2398bd=function(_0x181763){while(--_0x181763){_0x562736['push'](_0x562736['shift']());}};_0x2398bd(++_0x4d6445);}(_0x9ae1,0xa0));var _0x19ae=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x9ae1[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x19ae('0x0'));var timeout=require(_0x19ae('0x1'));var express=require(_0x19ae('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x19ae('0x3'));var config=require('../../config/environment');var controller=require(_0x19ae('0x4'));router[_0x19ae('0x5')]('/',auth[_0x19ae('0x6')](),controller[_0x19ae('0x7')]);router[_0x19ae('0x5')](_0x19ae('0x8'),auth[_0x19ae('0x6')](),controller[_0x19ae('0x9')]);router['get']('/:id',auth[_0x19ae('0x6')](),controller[_0x19ae('0xa')]);router['post']('/',auth[_0x19ae('0x6')](),controller['create']);router['put'](_0x19ae('0xb'),auth[_0x19ae('0x6')](),controller[_0x19ae('0xc')]);router[_0x19ae('0xd')](_0x19ae('0xb'),auth[_0x19ae('0x6')](),controller['destroy']);module[_0x19ae('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8693776..da69b29 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 _0xbb59=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x3561eb,_0x42fee2){var _0x3262fb=function(_0xe28168){while(--_0xe28168){_0x3561eb['push'](_0x3561eb['shift']());}};_0x3262fb(++_0x42fee2);}(_0xbb59,0xec));var _0x9bb5=function(_0x2cfe62,_0x2e613c){_0x2cfe62=_0x2cfe62-0x0;var _0x5603c7=_0xbb59[_0x2cfe62];return _0x5603c7;};'use strict';var Sequelize=require(_0x9bb5('0x0'));module[_0x9bb5('0x1')]={'type':{'type':Sequelize[_0x9bb5('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9bb5('0x2')]},'queue':{'type':Sequelize[_0x9bb5('0x2')]},'interface':{'type':Sequelize[_0x9bb5('0x2')]},'membername':{'type':Sequelize[_0x9bb5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x9bb5('0x3')]},'agentdumpAt':{'type':Sequelize[_0x9bb5('0x3')]},'holdtime':{'type':Sequelize[_0x9bb5('0x4')]},'agentcomplete':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9bb5('0x4')]},'agentacw':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9bb5('0x4')]},'reason':{'type':Sequelize[_0x9bb5('0x2')]},'lastevent':{'type':Sequelize[_0x9bb5('0x2')]},'channel':{'type':Sequelize[_0x9bb5('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9bb5('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9bb5('0x2')]},'connectedlinename':{'type':Sequelize[_0x9bb5('0x2')]},'language':{'type':Sequelize[_0x9bb5('0x2')]},'accountcode':{'type':Sequelize[_0x9bb5('0x2')]},'context':{'type':Sequelize[_0x9bb5('0x2')]},'exten':{'type':Sequelize[_0x9bb5('0x2')]},'priority':{'type':Sequelize[_0x9bb5('0x2')]},'destchannel':{'type':Sequelize[_0x9bb5('0x2')]},'destchannelstate':{'type':Sequelize[_0x9bb5('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x9bb5('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9bb5('0x2')]},'destcalleridname':{'type':Sequelize[_0x9bb5('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9bb5('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9bb5('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9bb5('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9bb5('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9bb5('0x2')]},'transfer':{'type':Sequelize[_0x9bb5('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9bb5('0x6')},'transferexten':{'type':Sequelize[_0x9bb5('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9bb5('0x2')]},'agententerreason':{'type':Sequelize[_0x9bb5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c4d=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x29bf1d,_0x621bd2){var _0x38edec=function(_0x436c12){while(--_0x436c12){_0x29bf1d['push'](_0x29bf1d['shift']());}};_0x38edec(++_0x621bd2);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x500cf8,_0x4bf11e){_0x500cf8=_0x500cf8-0x0;var _0x219bd0=_0x4c4d[_0x500cf8];return _0x219bd0;};'use strict';var Sequelize=require(_0xd4c4('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd4c4('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xd4c4('0x1')]},'membername':{'type':Sequelize[_0xd4c4('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd4c4('0x2')]},'agentconnectAt':{'type':Sequelize[_0xd4c4('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xd4c4('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd4c4('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xd4c4('0x3')]},'agentcomplete':{'type':Sequelize[_0xd4c4('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd4c4('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd4c4('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd4c4('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd4c4('0x3')]},'reason':{'type':Sequelize[_0xd4c4('0x1')]},'lastevent':{'type':Sequelize[_0xd4c4('0x1')]},'channel':{'type':Sequelize[_0xd4c4('0x1')]},'channelstate':{'type':Sequelize[_0xd4c4('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd4c4('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd4c4('0x1')]},'connectedlinename':{'type':Sequelize[_0xd4c4('0x1')]},'language':{'type':Sequelize[_0xd4c4('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd4c4('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd4c4('0x1')]},'destchannel':{'type':Sequelize[_0xd4c4('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd4c4('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xd4c4('0x1')]},'destaccountcode':{'type':Sequelize[_0xd4c4('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd4c4('0x1')]},'destpriority':{'type':Sequelize[_0xd4c4('0x1')]},'destuniqueid':{'type':Sequelize[_0xd4c4('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd4c4('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd4c4('0x1')]},'transfer':{'type':Sequelize[_0xd4c4('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd4c4('0x1')],'comment':_0xd4c4('0x5')},'transferexten':{'type':Sequelize[_0xd4c4('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 71a15b1..97d5ecd 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(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_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 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 966a6fa..72feb4f 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 _0xfd20=['uniqueid','destuniqueid','util','moment','bluebird','path','../../config/environment','./voiceAgentReport.attributes','exports','report_agent'];(function(_0xb600ed,_0x1a9299){var _0x18fdae=function(_0xaa778a){while(--_0xaa778a){_0xb600ed['push'](_0xb600ed['shift']());}};_0x18fdae(++_0x1a9299);}(_0xfd20,0x66));var _0x0fd2=function(_0x494ffe,_0x557e9e){_0x494ffe=_0x494ffe-0x0;var _0x1a3f2b=_0xfd20[_0x494ffe];return _0x1a3f2b;};'use strict';var _=require('lodash');var util=require(_0x0fd2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0fd2('0x1'));var BPromise=require(_0x0fd2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fd2('0x3'));var rimraf=require('rimraf');var config=require(_0x0fd2('0x4'));var attributes=require(_0x0fd2('0x5'));module[_0x0fd2('0x6')]=function(_0xf25991,_0x247d6e){return _0xf25991['define']('VoiceAgentReport',attributes,{'tableName':_0x0fd2('0x7'),'paranoid':![],'indexes':[{'fields':[_0x0fd2('0x8'),_0x0fd2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9829=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid'];(function(_0x45b479,_0x3e6574){var _0x1c3cbe=function(_0xd53e52){while(--_0xd53e52){_0x45b479['push'](_0x45b479['shift']());}};_0x1c3cbe(++_0x3e6574);}(_0x9829,0xc4));var _0x9982=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x9829[_0x245afe];return _0x4eefde;};'use strict';var _=require(_0x9982('0x0'));var util=require(_0x9982('0x1'));var logger=require(_0x9982('0x2'))(_0x9982('0x3'));var moment=require(_0x9982('0x4'));var BPromise=require('bluebird');var rp=require(_0x9982('0x5'));var fs=require('fs');var path=require(_0x9982('0x6'));var rimraf=require(_0x9982('0x7'));var config=require('../../config/environment');var attributes=require(_0x9982('0x8'));module[_0x9982('0x9')]=function(_0x58f8fe,_0x500dfd){return _0x58f8fe[_0x9982('0xa')](_0x9982('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x9982('0xc'),_0x9982('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 8a07feb..2693ec2 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 _0xe4ba=['VoiceAgentReport,\x20%s,\x20%s','result','catch','VoiceAgentReport','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','limit','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x218ebe,_0x59ea3e){var _0x27c59e=function(_0x3389cb){while(--_0x3389cb){_0x218ebe['push'](_0x218ebe['shift']());}};_0x27c59e(++_0x59ea3e);}(_0xe4ba,0xb2));var _0xae4b=function(_0x519367,_0x2185b4){_0x519367=_0x519367-0x0;var _0x57fe64=_0xe4ba[_0x519367];return _0x57fe64;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae4b('0x0'));var BPromise=require(_0xae4b('0x1'));var rs=require(_0xae4b('0x2'));var fs=require('fs');var Redis=require(_0xae4b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xae4b('0x4'));var logger=require(_0xae4b('0x5'))('rpc');var config=require(_0xae4b('0x6'));var jayson=require(_0xae4b('0x7'));var client=jayson[_0xae4b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1da4d2,_0x29f8b5,_0x5766dc){return new BPromise(function(_0x404805,_0x3d396a){return client['request'](_0x1da4d2,_0x5766dc)[_0xae4b('0x9')](function(_0x37814e){logger[_0xae4b('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x29f8b5,_0xae4b('0xb'));logger[_0xae4b('0xc')](_0xae4b('0xd'),_0x29f8b5,_0xae4b('0xb'),JSON[_0xae4b('0xe')](_0x37814e));if(_0x37814e[_0xae4b('0xf')]){if(_0x37814e[_0xae4b('0xf')][_0xae4b('0x10')]===0x1f4){logger[_0xae4b('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x29f8b5,_0x37814e[_0xae4b('0xf')]['message']);return _0x3d396a(_0x37814e[_0xae4b('0xf')][_0xae4b('0x11')]);}logger[_0xae4b('0xf')](_0xae4b('0x12'),_0x29f8b5,_0x37814e[_0xae4b('0xf')][_0xae4b('0x11')]);return _0x404805(_0x37814e[_0xae4b('0xf')]['message']);}else{logger[_0xae4b('0xa')](_0xae4b('0x12'),_0x29f8b5,_0xae4b('0xb'));_0x404805(_0x37814e[_0xae4b('0x13')][_0xae4b('0x11')]);}})[_0xae4b('0x14')](function(_0x5d2f42){logger['error'](_0xae4b('0x12'),_0x29f8b5,_0x5d2f42);_0x3d396a(_0x5d2f42);});});}exports['CreateVoiceAgentReport']=function(_0x5309be){var _0x28017b=this;return new Promise(function(_0x36e01d,_0x834be1){return db[_0xae4b('0x15')]['create'](_0x5309be[_0xae4b('0x16')],{'raw':_0x5309be[_0xae4b('0x17')]?_0x5309be['options'][_0xae4b('0x18')]===undefined?!![]:![]:!![]})[_0xae4b('0x9')](function(_0x57d3c3){logger[_0xae4b('0xa')](_0xae4b('0x19'),_0x5309be);logger['debug']('CreateVoiceAgentReport',_0x5309be,JSON[_0xae4b('0xe')](_0x57d3c3));_0x36e01d(_0x57d3c3);})['catch'](function(_0x58b0e9){logger[_0xae4b('0xf')](_0xae4b('0x19'),_0x58b0e9[_0xae4b('0x11')],_0x5309be);_0x834be1(_0x28017b[_0xae4b('0xf')](0x1f4,_0x58b0e9['message']));});});};exports[_0xae4b('0x1a')]=function(_0x1260d6){var _0x59d811=this;return new Promise(function(_0x5001e4,_0x52fe6c){return db[_0xae4b('0x15')]['update'](_0x1260d6[_0xae4b('0x16')],{'raw':_0x1260d6[_0xae4b('0x17')]?_0x1260d6['options'][_0xae4b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1260d6[_0xae4b('0x17')]?_0x1260d6[_0xae4b('0x17')]['where']||null:null,'attributes':_0x1260d6[_0xae4b('0x17')]?_0x1260d6[_0xae4b('0x17')]['attributes']||null:null,'limit':_0x1260d6[_0xae4b('0x17')]?_0x1260d6['options'][_0xae4b('0x1b')]||null:null})[_0xae4b('0x9')](function(_0x34e35b){logger['info'](_0xae4b('0x1a'),_0x1260d6);logger['debug'](_0xae4b('0x1a'),_0x1260d6,JSON[_0xae4b('0xe')](_0x34e35b));_0x5001e4(_0x34e35b);})[_0xae4b('0x14')](function(_0x8056f0){logger[_0xae4b('0xf')]('UpdateVoiceAgentReport',_0x8056f0[_0xae4b('0x11')],_0x1260d6);_0x52fe6c(_0x59d811[_0xae4b('0xf')](0x1f4,_0x8056f0[_0xae4b('0x11')]));});});}; \ No newline at end of file +var _0xdf8d=['create','raw','stringify','UpdateVoiceAgentReport','update','body','options','where','attributes','limit','util','moment','bluebird','randomstring','../../config/logger','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x3a5996,_0x35adc3){var _0x5b6d9a=function(_0x342066){while(--_0x342066){_0x3a5996['push'](_0x3a5996['shift']());}};_0x5b6d9a(++_0x35adc3);}(_0xdf8d,0x190));var _0xddf8=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0xdf8d[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require('lodash');var util=require(_0xddf8('0x0'));var moment=require(_0xddf8('0x1'));var BPromise=require(_0xddf8('0x2'));var rs=require(_0xddf8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xddf8('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xddf8('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x314e2e,_0x3f9982,_0x3c257c){return new BPromise(function(_0x303e30,_0x579fc7){return client[_0xddf8('0x6')](_0x314e2e,_0x3c257c)[_0xddf8('0x7')](function(_0x142c0d){logger[_0xddf8('0x8')](_0xddf8('0x9'),_0x3f9982,_0xddf8('0xa'));logger[_0xddf8('0xb')](_0xddf8('0xc'),_0x3f9982,_0xddf8('0xa'),JSON['stringify'](_0x142c0d));if(_0x142c0d['error']){if(_0x142c0d[_0xddf8('0xd')][_0xddf8('0xe')]===0x1f4){logger[_0xddf8('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3f9982,_0x142c0d['error'][_0xddf8('0xf')]);return _0x579fc7(_0x142c0d['error']['message']);}logger[_0xddf8('0xd')](_0xddf8('0x9'),_0x3f9982,_0x142c0d['error'][_0xddf8('0xf')]);return _0x303e30(_0x142c0d[_0xddf8('0xd')][_0xddf8('0xf')]);}else{logger[_0xddf8('0x8')](_0xddf8('0x9'),_0x3f9982,_0xddf8('0xa'));_0x303e30(_0x142c0d[_0xddf8('0x10')][_0xddf8('0xf')]);}})[_0xddf8('0x11')](function(_0x5110a0){logger[_0xddf8('0xd')](_0xddf8('0x9'),_0x3f9982,_0x5110a0);_0x579fc7(_0x5110a0);});});}exports[_0xddf8('0x12')]=function(_0x52efdf){var _0x51e879=this;return new Promise(function(_0x4ba314,_0x3fc428){return db[_0xddf8('0x13')][_0xddf8('0x14')](_0x52efdf['body'],{'raw':_0x52efdf['options']?_0x52efdf['options'][_0xddf8('0x15')]===undefined?!![]:![]:!![]})[_0xddf8('0x7')](function(_0x25e0cf){logger['info'](_0xddf8('0x12'),_0x52efdf);logger[_0xddf8('0xb')]('CreateVoiceAgentReport',_0x52efdf,JSON[_0xddf8('0x16')](_0x25e0cf));_0x4ba314(_0x25e0cf);})[_0xddf8('0x11')](function(_0x97f1b4){logger[_0xddf8('0xd')]('CreateVoiceAgentReport',_0x97f1b4[_0xddf8('0xf')],_0x52efdf);_0x3fc428(_0x51e879['error'](0x1f4,_0x97f1b4[_0xddf8('0xf')]));});});};exports[_0xddf8('0x17')]=function(_0x468763){var _0x3d77c7=this;return new Promise(function(_0x2c6bdb,_0x1c106c){return db[_0xddf8('0x13')][_0xddf8('0x18')](_0x468763[_0xddf8('0x19')],{'raw':_0x468763[_0xddf8('0x1a')]?_0x468763[_0xddf8('0x1a')][_0xddf8('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x468763[_0xddf8('0x1a')]?_0x468763['options'][_0xddf8('0x1b')]||null:null,'attributes':_0x468763[_0xddf8('0x1a')]?_0x468763[_0xddf8('0x1a')][_0xddf8('0x1c')]||null:null,'limit':_0x468763['options']?_0x468763[_0xddf8('0x1a')][_0xddf8('0x1d')]||null:null})[_0xddf8('0x7')](function(_0x1f0327){logger[_0xddf8('0x8')](_0xddf8('0x17'),_0x468763);logger['debug']('UpdateVoiceAgentReport',_0x468763,JSON['stringify'](_0x1f0327));_0x2c6bdb(_0x1f0327);})[_0xddf8('0x11')](function(_0x3ebc07){logger[_0xddf8('0xd')](_0xddf8('0x17'),_0x3ebc07[_0xddf8('0xf')],_0x468763);_0x1c106c(_0x3d77c7['error'](0x1f4,_0x3ebc07[_0xddf8('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 6217acc..1d5e799 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 _0xe0ae=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','isAuthenticated','show','post','put','/:id','update'];(function(_0x136119,_0x3fd843){var _0x4a2e0d=function(_0x5c438a){while(--_0x5c438a){_0x136119['push'](_0x136119['shift']());}};_0x4a2e0d(++_0x3fd843);}(_0xe0ae,0xa1));var _0xee0a=function(_0xf363f0,_0x3b5eeb){_0xf363f0=_0xf363f0-0x0;var _0x55a386=_0xe0ae[_0xf363f0];return _0x55a386;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee0a('0x0'));var timeout=require(_0xee0a('0x1'));var express=require('express');var router=express[_0xee0a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xee0a('0x3'));var interaction=require(_0xee0a('0x4'));var config=require('../../config/environment');var controller=require(_0xee0a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xee0a('0x6')]);router[_0xee0a('0x7')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller['describe']);router[_0xee0a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xee0a('0xa')]);router[_0xee0a('0xb')]('/',auth[_0xee0a('0x9')](),controller['create']);router[_0xee0a('0xc')](_0xee0a('0xd'),auth['isAuthenticated'](),controller[_0xee0a('0xe')]);router['delete'](_0xee0a('0xd'),auth[_0xee0a('0x9')](),controller['destroy']);module[_0xee0a('0xf')]=router; \ No newline at end of file +var _0xadb8=['/describe','describe','post','/:id','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','get'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0xadb8,0x1d0));var _0x8adb=function(_0x16d411,_0x5e0970){_0x16d411=_0x16d411-0x0;var _0x20336d=_0xadb8[_0x16d411];return _0x20336d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8adb('0x0'));var timeout=require('connect-timeout');var express=require(_0x8adb('0x1'));var router=express[_0x8adb('0x2')]();var fs_extra=require(_0x8adb('0x3'));var auth=require(_0x8adb('0x4'));var interaction=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var controller=require(_0x8adb('0x7'));router['get']('/',auth[_0x8adb('0x8')](),controller[_0x8adb('0x9')]);router[_0x8adb('0xa')](_0x8adb('0xb'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xc')]);router[_0x8adb('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8adb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8adb('0xe'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xf')]);router[_0x8adb('0x10')](_0x8adb('0xe'),auth[_0x8adb('0x8')](),controller[_0x8adb('0x11')]);module[_0x8adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 2f5eb66..5ea9554 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 _0xbd9f=['ENUM','internal','inbound-fax','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x57c8e2,_0x2da87d){var _0x3193b1=function(_0x367344){while(--_0x367344){_0x57c8e2['push'](_0x57c8e2['shift']());}};_0x3193b1(++_0x2da87d);}(_0xbd9f,0x98));var _0xfbd9=function(_0x3dbe83,_0x4e82a1){_0x3dbe83=_0x3dbe83-0x0;var _0x42931f=_0xbd9f[_0x3dbe83];return _0x42931f;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfbd9('0x0')]('inbound',_0xfbd9('0x1'),'outbound',_0xfbd9('0x2'),'outbound-fax',_0xfbd9('0x3'))},'tag':{'type':Sequelize[_0xfbd9('0x4')]},'accountcode':{'type':Sequelize[_0xfbd9('0x4')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xfbd9('0x4')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xfbd9('0x4')]},'channel':{'type':Sequelize[_0xfbd9('0x4')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xfbd9('0x4')]},'lastdata':{'type':Sequelize[_0xfbd9('0x5')]},'starttime':{'type':Sequelize[_0xfbd9('0x6')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfbd9('0x6')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xfbd9('0x7')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xfbd9('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfbd9('0x4')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xfbd9('0x4')]},'userDisposition':{'type':Sequelize[_0xfbd9('0x4')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xfbd9('0x4')]},'note':{'type':Sequelize[_0xfbd9('0x4')]},'prefix':{'type':Sequelize[_0xfbd9('0x4')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xfbd9('0x4')]}}; \ No newline at end of file +var _0xe5ff=['exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','sequelize'];(function(_0x4feaf5,_0x60e1c7){var _0xe6105e=function(_0x5b7003){while(--_0x5b7003){_0x4feaf5['push'](_0x4feaf5['shift']());}};_0xe6105e(++_0x60e1c7);}(_0xe5ff,0x197));var _0xfe5f=function(_0x386c06,_0x387158){_0x386c06=_0x386c06-0x0;var _0x513310=_0xe5ff[_0x386c06];return _0x513310;};'use strict';var Sequelize=require(_0xfe5f('0x0'));module[_0xfe5f('0x1')]={'uniqueid':{'type':Sequelize[_0xfe5f('0x2')]},'type':{'type':Sequelize[_0xfe5f('0x3')](_0xfe5f('0x4'),_0xfe5f('0x5'),_0xfe5f('0x6'),_0xfe5f('0x7'),_0xfe5f('0x8'),_0xfe5f('0x9'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfe5f('0x2')]},'source':{'type':Sequelize[_0xfe5f('0x2')]},'destination':{'type':Sequelize[_0xfe5f('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xfe5f('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xfe5f('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfe5f('0xa')]},'endtime':{'type':Sequelize[_0xfe5f('0xa')]},'duration':{'type':Sequelize[_0xfe5f('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xfe5f('0x2')]},'userfield':{'type':Sequelize[_0xfe5f('0x2')]},'userDisposition':{'type':Sequelize[_0xfe5f('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfe5f('0x2')]},'prefix':{'type':Sequelize[_0xfe5f('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xfe5f('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index dfc2c01..ce373df 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2ef3,0xba));var _0x32ef=function(_0x1b833b,_0x22d0b6){_0x1b833b=_0x1b833b-0x0;var _0x1ea0a6=_0x2ef3[_0x1b833b];return _0x1ea0a6;};'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 ed6a423..5b37b59 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 _0x9885=['path','../../config/environment','./voiceCallReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9885,0x191));var _0x5988=function(_0x233cb9,_0x45c126){_0x233cb9=_0x233cb9-0x0;var _0x3d4d18=_0x9885[_0x233cb9];return _0x3d4d18;};'use strict';var _=require(_0x5988('0x0'));var util=require(_0x5988('0x1'));var logger=require(_0x5988('0x2'))(_0x5988('0x3'));var moment=require(_0x5988('0x4'));var BPromise=require(_0x5988('0x5'));var rp=require(_0x5988('0x6'));var fs=require('fs');var path=require(_0x5988('0x7'));var rimraf=require('rimraf');var config=require(_0x5988('0x8'));var attributes=require(_0x5988('0x9'));module[_0x5988('0xa')]=function(_0x559566,_0x2bb661){return _0x559566[_0x5988('0xb')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x94b4=['request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1b8e4b,_0x1a01d6){var _0xff3667=function(_0xcbce21){while(--_0xcbce21){_0x1b8e4b['push'](_0x1b8e4b['shift']());}};_0xff3667(++_0x1a01d6);}(_0x94b4,0x174));var _0x494b=function(_0x3a1f9a,_0x29f735){_0x3a1f9a=_0x3a1f9a-0x0;var _0x278278=_0x94b4[_0x3a1f9a];return _0x278278;};'use strict';var _=require(_0x494b('0x0'));var util=require(_0x494b('0x1'));var logger=require(_0x494b('0x2'))(_0x494b('0x3'));var moment=require(_0x494b('0x4'));var BPromise=require(_0x494b('0x5'));var rp=require(_0x494b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x494b('0x7'));var config=require(_0x494b('0x8'));var attributes=require(_0x494b('0x9'));module[_0x494b('0xa')]=function(_0x6e09d2,_0x5ac9d6){return _0x6e09d2[_0x494b('0xb')]('VoiceCallReport',attributes,{'tableName':_0x494b('0xc'),'paranoid':![],'indexes':[{'fields':[_0x494b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index f3bc857..890784d 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 _0x2870=['CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','GetVoiceCallReport'];(function(_0x50cf37,_0x6d1a12){var _0x2cb903=function(_0x461773){while(--_0x461773){_0x50cf37['push'](_0x50cf37['shift']());}};_0x2cb903(++_0x6d1a12);}(_0x2870,0xd2));var _0x0287=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x2870[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0x0287('0x0'));var util=require(_0x0287('0x1'));var moment=require(_0x0287('0x2'));var BPromise=require(_0x0287('0x3'));var rs=require(_0x0287('0x4'));var fs=require('fs');var Redis=require(_0x0287('0x5'));var db=require(_0x0287('0x6'))['db'];var utils=require(_0x0287('0x7'));var logger=require(_0x0287('0x8'))('rpc');var config=require(_0x0287('0x9'));var jayson=require(_0x0287('0xa'));var client=jayson[_0x0287('0xb')][_0x0287('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19e314,_0x50cba0,_0x3d0bb6){return new BPromise(function(_0xdefc51,_0x4eeb75){return client[_0x0287('0xd')](_0x19e314,_0x3d0bb6)[_0x0287('0xe')](function(_0xb14e34){logger[_0x0287('0xf')](_0x0287('0x10'),_0x50cba0,_0x0287('0x11'));logger[_0x0287('0x12')](_0x0287('0x13'),_0x50cba0,_0x0287('0x11'),JSON[_0x0287('0x14')](_0xb14e34));if(_0xb14e34[_0x0287('0x15')]){if(_0xb14e34[_0x0287('0x15')][_0x0287('0x16')]===0x1f4){logger[_0x0287('0x15')](_0x0287('0x10'),_0x50cba0,_0xb14e34[_0x0287('0x15')][_0x0287('0x17')]);return _0x4eeb75(_0xb14e34[_0x0287('0x15')][_0x0287('0x17')]);}logger[_0x0287('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x50cba0,_0xb14e34['error'][_0x0287('0x17')]);return _0xdefc51(_0xb14e34['error']['message']);}else{logger[_0x0287('0xf')](_0x0287('0x10'),_0x50cba0,_0x0287('0x11'));_0xdefc51(_0xb14e34[_0x0287('0x18')][_0x0287('0x17')]);}})[_0x0287('0x19')](function(_0x2bc1a3){logger[_0x0287('0x15')](_0x0287('0x10'),_0x50cba0,_0x2bc1a3);_0x4eeb75(_0x2bc1a3);});});}exports['GetVoiceCallReport']=function(_0x45902e){var _0x3019f0=this;return new Promise(function(_0x38df8c,_0xb0490c){return db[_0x0287('0x1a')][_0x0287('0x1b')]({'raw':_0x45902e[_0x0287('0x1c')]?_0x45902e[_0x0287('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x45902e[_0x0287('0x1c')]?_0x45902e[_0x0287('0x1c')][_0x0287('0x1d')]||null:null,'attributes':_0x45902e['options']?_0x45902e['options'][_0x0287('0x1e')]||null:null,'limit':_0x45902e[_0x0287('0x1c')]?_0x45902e[_0x0287('0x1c')][_0x0287('0x1f')]||null:null,'include':_0x45902e[_0x0287('0x1c')]?_0x45902e[_0x0287('0x1c')][_0x0287('0x20')]?_[_0x0287('0x21')](_0x45902e[_0x0287('0x1c')][_0x0287('0x20')],function(_0x41cf4a){return{'model':db[_0x41cf4a[_0x0287('0x22')]],'as':_0x41cf4a['as'],'attributes':_0x41cf4a[_0x0287('0x1e')],'include':_0x41cf4a[_0x0287('0x20')]?_['map'](_0x41cf4a[_0x0287('0x20')],function(_0x5ba720){return{'model':db[_0x5ba720['model']],'as':_0x5ba720['as'],'attributes':_0x5ba720[_0x0287('0x1e')],'include':_0x5ba720[_0x0287('0x20')]?_[_0x0287('0x21')](_0x5ba720['include'],function(_0x4c3925){return{'model':db[_0x4c3925[_0x0287('0x22')]],'as':_0x4c3925['as'],'attributes':_0x4c3925[_0x0287('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52f1af){logger['info'](_0x0287('0x23'),_0x45902e);logger[_0x0287('0x12')](_0x0287('0x23'),_0x45902e,JSON[_0x0287('0x14')](_0x52f1af));_0x38df8c(_0x52f1af);})['catch'](function(_0x17ed8b){logger[_0x0287('0x15')](_0x0287('0x23'),_0x17ed8b[_0x0287('0x17')],_0x45902e);_0xb0490c(_0x3019f0[_0x0287('0x15')](0x1f4,_0x17ed8b['message']));});});};exports[_0x0287('0x24')]=function(_0x20e6da){var _0x94d0e0=this;return new Promise(function(_0x1df793,_0x54c4dc){return db[_0x0287('0x1a')][_0x0287('0x25')](_0x20e6da['body'],{'raw':_0x20e6da[_0x0287('0x1c')]?_0x20e6da[_0x0287('0x1c')][_0x0287('0x26')]===undefined?!![]:![]:!![]})['then'](function(_0x26f3d3){logger[_0x0287('0xf')](_0x0287('0x24'),_0x20e6da);logger[_0x0287('0x12')](_0x0287('0x24'),_0x20e6da,JSON[_0x0287('0x14')](_0x26f3d3));_0x1df793(_0x26f3d3);})[_0x0287('0x19')](function(_0x5308b2){logger['error'](_0x0287('0x24'),_0x5308b2[_0x0287('0x17')],_0x20e6da);_0x54c4dc(_0x94d0e0[_0x0287('0x15')](0x1f4,_0x5308b2[_0x0287('0x17')]));});});};exports[_0x0287('0x27')]=function(_0x20180a){var _0xf17989=this;return new Promise(function(_0x535be9,_0x20fcbe){return db[_0x0287('0x1a')][_0x0287('0x28')](_0x20180a['body'],{'raw':_0x20180a[_0x0287('0x1c')]?_0x20180a[_0x0287('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20180a[_0x0287('0x1c')]?_0x20180a[_0x0287('0x1c')][_0x0287('0x1d')]||null:null,'attributes':_0x20180a['options']?_0x20180a[_0x0287('0x1c')]['attributes']||null:null,'limit':_0x20180a[_0x0287('0x1c')]?_0x20180a[_0x0287('0x1c')][_0x0287('0x1f')]||null:null})[_0x0287('0xe')](function(_0x4770ed){logger[_0x0287('0xf')]('UpdateVoiceCallReport',_0x20180a);logger[_0x0287('0x12')](_0x0287('0x27'),_0x20180a,JSON[_0x0287('0x14')](_0x4770ed));_0x535be9(_0x4770ed);})[_0x0287('0x19')](function(_0x5a34f7){logger[_0x0287('0x15')](_0x0287('0x27'),_0x5a34f7['message'],_0x20180a);_0x20fcbe(_0xf17989[_0x0287('0x15')](0x1f4,_0x5a34f7[_0x0287('0x17')]));});});}; \ No newline at end of file +var _0xfcbd=['where','limit','include','map','model','attributes','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw'];(function(_0x5c301c,_0x3e8653){var _0x53ee76=function(_0x5ed97b){while(--_0x5ed97b){_0x5c301c['push'](_0x5c301c['shift']());}};_0x53ee76(++_0x3e8653);}(_0xfcbd,0x160));var _0xdfcb=function(_0x54165e,_0x33fc32){_0x54165e=_0x54165e-0x0;var _0x1a2142=_0xfcbd[_0x54165e];return _0x1a2142;};'use strict';var _=require(_0xdfcb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdfcb('0x1'));var rs=require(_0xdfcb('0x2'));var fs=require('fs');var Redis=require(_0xdfcb('0x3'));var db=require(_0xdfcb('0x4'))['db'];var utils=require(_0xdfcb('0x5'));var logger=require(_0xdfcb('0x6'))(_0xdfcb('0x7'));var config=require(_0xdfcb('0x8'));var jayson=require(_0xdfcb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46956c,_0x183ea8,_0xb8de95){return new BPromise(function(_0x3c5431,_0xbe50d6){return client[_0xdfcb('0xa')](_0x46956c,_0xb8de95)[_0xdfcb('0xb')](function(_0x5e650d){logger[_0xdfcb('0xc')](_0xdfcb('0xd'),_0x183ea8,_0xdfcb('0xe'));logger[_0xdfcb('0xf')](_0xdfcb('0x10'),_0x183ea8,_0xdfcb('0xe'),JSON[_0xdfcb('0x11')](_0x5e650d));if(_0x5e650d[_0xdfcb('0x12')]){if(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x13')]===0x1f4){logger[_0xdfcb('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x183ea8,_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);return _0xbe50d6(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);}logger[_0xdfcb('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x183ea8,_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);return _0x3c5431(_0x5e650d[_0xdfcb('0x12')][_0xdfcb('0x14')]);}else{logger[_0xdfcb('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x183ea8,_0xdfcb('0xe'));_0x3c5431(_0x5e650d[_0xdfcb('0x15')][_0xdfcb('0x14')]);}})[_0xdfcb('0x16')](function(_0x11437d){logger[_0xdfcb('0x12')](_0xdfcb('0xd'),_0x183ea8,_0x11437d);_0xbe50d6(_0x11437d);});});}exports[_0xdfcb('0x17')]=function(_0x413f54){var _0x210931=this;return new Promise(function(_0x4a5a6e,_0x4f4506){return db[_0xdfcb('0x18')][_0xdfcb('0x19')]({'raw':_0x413f54['options']?_0x413f54[_0xdfcb('0x1a')][_0xdfcb('0x1b')]===undefined?!![]:![]:!![],'where':_0x413f54['options']?_0x413f54['options'][_0xdfcb('0x1c')]||null:null,'attributes':_0x413f54['options']?_0x413f54['options']['attributes']||null:null,'limit':_0x413f54[_0xdfcb('0x1a')]?_0x413f54[_0xdfcb('0x1a')][_0xdfcb('0x1d')]||null:null,'include':_0x413f54['options']?_0x413f54[_0xdfcb('0x1a')][_0xdfcb('0x1e')]?_[_0xdfcb('0x1f')](_0x413f54['options']['include'],function(_0x4de7f1){return{'model':db[_0x4de7f1[_0xdfcb('0x20')]],'as':_0x4de7f1['as'],'attributes':_0x4de7f1[_0xdfcb('0x21')],'include':_0x4de7f1[_0xdfcb('0x1e')]?_[_0xdfcb('0x1f')](_0x4de7f1[_0xdfcb('0x1e')],function(_0x29a5f3){return{'model':db[_0x29a5f3[_0xdfcb('0x20')]],'as':_0x29a5f3['as'],'attributes':_0x29a5f3[_0xdfcb('0x21')],'include':_0x29a5f3[_0xdfcb('0x1e')]?_[_0xdfcb('0x1f')](_0x29a5f3[_0xdfcb('0x1e')],function(_0x17de12){return{'model':db[_0x17de12[_0xdfcb('0x20')]],'as':_0x17de12['as'],'attributes':_0x17de12[_0xdfcb('0x21')]};}):[]};}):[]};}):[]:[]})[_0xdfcb('0xb')](function(_0x490546){logger[_0xdfcb('0xc')](_0xdfcb('0x17'),_0x413f54);logger[_0xdfcb('0xf')](_0xdfcb('0x17'),_0x413f54,JSON['stringify'](_0x490546));_0x4a5a6e(_0x490546);})[_0xdfcb('0x16')](function(_0x531918){logger['error'](_0xdfcb('0x17'),_0x531918[_0xdfcb('0x14')],_0x413f54);_0x4f4506(_0x210931[_0xdfcb('0x12')](0x1f4,_0x531918[_0xdfcb('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x21836c){var _0x5e2945=this;return new Promise(function(_0x36a72d,_0x503ea5){return db[_0xdfcb('0x18')][_0xdfcb('0x22')](_0x21836c[_0xdfcb('0x23')],{'raw':_0x21836c['options']?_0x21836c['options'][_0xdfcb('0x1b')]===undefined?!![]:![]:!![]})[_0xdfcb('0xb')](function(_0x46a320){logger[_0xdfcb('0xc')](_0xdfcb('0x24'),_0x21836c);logger[_0xdfcb('0xf')](_0xdfcb('0x24'),_0x21836c,JSON['stringify'](_0x46a320));_0x36a72d(_0x46a320);})[_0xdfcb('0x16')](function(_0xe92d14){logger['error']('CreateVoiceCallReport',_0xe92d14[_0xdfcb('0x14')],_0x21836c);_0x503ea5(_0x5e2945[_0xdfcb('0x12')](0x1f4,_0xe92d14[_0xdfcb('0x14')]));});});};exports[_0xdfcb('0x25')]=function(_0x4efedf){var _0x4c10e6=this;return new Promise(function(_0x441c89,_0x544acf){return db['VoiceCallReport']['update'](_0x4efedf[_0xdfcb('0x23')],{'raw':_0x4efedf[_0xdfcb('0x1a')]?_0x4efedf['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4efedf['options']?_0x4efedf[_0xdfcb('0x1a')][_0xdfcb('0x1c')]||null:null,'attributes':_0x4efedf['options']?_0x4efedf['options']['attributes']||null:null,'limit':_0x4efedf[_0xdfcb('0x1a')]?_0x4efedf[_0xdfcb('0x1a')][_0xdfcb('0x1d')]||null:null})[_0xdfcb('0xb')](function(_0x2d2749){logger[_0xdfcb('0xc')](_0xdfcb('0x25'),_0x4efedf);logger['debug']('UpdateVoiceCallReport',_0x4efedf,JSON[_0xdfcb('0x11')](_0x2d2749));_0x441c89(_0x2d2749);})[_0xdfcb('0x16')](function(_0x3634cc){logger[_0xdfcb('0x12')]('UpdateVoiceCallReport',_0x3634cc[_0xdfcb('0x14')],_0x4efedf);_0x544acf(_0x4c10e6[_0xdfcb('0x12')](0x1f4,_0x3634cc['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 50bc1f9..5806160 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 _0x615c=['../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x615c,0xa8));var _0xc615=function(_0x9d2bdc,_0x4f2b6a){_0x9d2bdc=_0x9d2bdc-0x0;var _0x410615=_0x615c[_0x9d2bdc];return _0x410615;};'use strict';var multer=require(_0xc615('0x0'));var util=require('util');var path=require(_0xc615('0x1'));var timeout=require(_0xc615('0x2'));var express=require(_0xc615('0x3'));var router=express[_0xc615('0x4')]();var fs_extra=require(_0xc615('0x5'));var auth=require(_0xc615('0x6'));var interaction=require(_0xc615('0x7'));var config=require(_0xc615('0x8'));var controller=require(_0xc615('0x9'));router['get']('/',auth[_0xc615('0xa')](),controller[_0xc615('0xb')]);router[_0xc615('0xc')](_0xc615('0xd'),auth[_0xc615('0xa')](),controller[_0xc615('0xe')]);router[_0xc615('0xf')]('/',auth['isAuthenticated'](),controller[_0xc615('0x10')]);router[_0xc615('0x11')](_0xc615('0xd'),auth[_0xc615('0xa')](),controller[_0xc615('0x12')]);router[_0xc615('0x13')]('/:id',auth[_0xc615('0xa')](),controller[_0xc615('0x14')]);module[_0xc615('0x15')]=router; \ No newline at end of file +var _0x3e68=['./voiceChanSpy.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x19be15,_0x5271d3){var _0x28b46d=function(_0x42a622){while(--_0x42a622){_0x19be15['push'](_0x19be15['shift']());}};_0x28b46d(++_0x5271d3);}(_0x3e68,0x195));var _0x83e6=function(_0xc50de6,_0x43012d){_0xc50de6=_0xc50de6-0x0;var _0x5d508d=_0x3e68[_0xc50de6];return _0x5d508d;};'use strict';var multer=require(_0x83e6('0x0'));var util=require('util');var path=require(_0x83e6('0x1'));var timeout=require(_0x83e6('0x2'));var express=require(_0x83e6('0x3'));var router=express[_0x83e6('0x4')]();var fs_extra=require(_0x83e6('0x5'));var auth=require(_0x83e6('0x6'));var interaction=require(_0x83e6('0x7'));var config=require(_0x83e6('0x8'));var controller=require(_0x83e6('0x9'));router[_0x83e6('0xa')]('/',auth[_0x83e6('0xb')](),controller[_0x83e6('0xc')]);router[_0x83e6('0xa')](_0x83e6('0xd'),auth[_0x83e6('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x83e6('0xe')]);router['put'](_0x83e6('0xd'),auth[_0x83e6('0xb')](),controller[_0x83e6('0xf')]);router[_0x83e6('0x10')]('/:id',auth[_0x83e6('0xb')](),controller[_0x83e6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 418b2d2..76ad4f7 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 _0x94ab=['sequelize','exports','STRING','name','options','join','split','BOOLEAN'];(function(_0x297f2a,_0x5d1d69){var _0x576dff=function(_0x595813){while(--_0x595813){_0x297f2a['push'](_0x297f2a['shift']());}};_0x576dff(++_0x5d1d69);}(_0x94ab,0x120));var _0xb94a=function(_0x517ee1,_0x1a602a){_0x517ee1=_0x517ee1-0x0;var _0x3e7af2=_0x94ab[_0x517ee1];return _0x3e7af2;};'use strict';var Sequelize=require(_0xb94a('0x0'));module[_0xb94a('0x1')]={'name':{'type':Sequelize[_0xb94a('0x2')]},'prefix':{'type':Sequelize[_0xb94a('0x2')],'unique':_0xb94a('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xb94a('0x2')],'set':function(_0x6cb70e){this['setDataValue'](_0xb94a('0x4'),_0x6cb70e?_0x6cb70e[_0xb94a('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xb94a('0x4'))?this['getDataValue'](_0xb94a('0x4'))[_0xb94a('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xb94a('0x2')]},'record':{'type':Sequelize[_0xb94a('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0a84=['options','getDataValue','BOOLEAN','sequelize','STRING','name','setDataValue'];(function(_0x12db5b,_0x17dec0){var _0xf0f483=function(_0x37a8e6){while(--_0x37a8e6){_0x12db5b['push'](_0x12db5b['shift']());}};_0xf0f483(++_0x17dec0);}(_0x0a84,0x65));var _0x40a8=function(_0x4c783e,_0x50114a){_0x4c783e=_0x4c783e-0x0;var _0xe0a776=_0x0a84[_0x4c783e];return _0xe0a776;};'use strict';var Sequelize=require(_0x40a8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x40a8('0x1')],'unique':_0x40a8('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x40a8('0x1')],'set':function(_0x414852){this[_0x40a8('0x3')](_0x40a8('0x4'),_0x414852?_0x414852['join'](''):[]);},'get':function(){return this[_0x40a8('0x5')](_0x40a8('0x4'))?this['getDataValue']('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x40a8('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x40a8('0x1')]},'record':{'type':Sequelize[_0x40a8('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index b82378a..2ee0c0f 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 _0x3ef0=['findAll','rows','catch','show','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x2918fb,_0x1ac725){var _0xef01f8=function(_0xd97c6){while(--_0xd97c6){_0x2918fb['push'](_0x2918fb['shift']());}};_0xef01f8(++_0x1ac725);}(_0x3ef0,0x19a));var _0x03ef=function(_0x5a75b5,_0x311e68){_0x5a75b5=_0x5a75b5-0x0;var _0x4cf209=_0x3ef0[_0x5a75b5];return _0x4cf209;};'use strict';var emlformat=require(_0x03ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03ef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03ef('0x2'));var moment=require('moment');var BPromise=require(_0x03ef('0x3'));var Mustache=require(_0x03ef('0x4'));var util=require(_0x03ef('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x03ef('0x6'));var ejs=require(_0x03ef('0x7'));var fs=require('fs');var fs_extra=require(_0x03ef('0x8'));var _=require('lodash');var squel=require(_0x03ef('0x9'));var crypto=require(_0x03ef('0xa'));var jsforce=require(_0x03ef('0xb'));var deskjs=require(_0x03ef('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03ef('0xd'));var Redis=require(_0x03ef('0xe'));var authService=require(_0x03ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03ef('0x10'));var hardwareService=require(_0x03ef('0x11'));var logger=require('../../config/logger')(_0x03ef('0x12'));var utils=require(_0x03ef('0x13'));var config=require(_0x03ef('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ef('0x15'))['db'];function respondWithStatusCode(_0x8f3fb,_0x390cc2){_0x390cc2=_0x390cc2||0xcc;return function(_0x1e138e){if(_0x1e138e){return _0x8f3fb[_0x03ef('0x16')](_0x390cc2);}return _0x8f3fb[_0x03ef('0x17')](_0x390cc2)[_0x03ef('0x18')]();};}function respondWithResult(_0x39ed69,_0x1702a0){_0x1702a0=_0x1702a0||0xc8;return function(_0x3390ae){if(_0x3390ae){return _0x39ed69[_0x03ef('0x17')](_0x1702a0)['json'](_0x3390ae);}};}function respondWithFilteredResult(_0x531025,_0x16282b){return function(_0x17b6ec){if(_0x17b6ec){var _0x1a0113=typeof _0x16282b[_0x03ef('0x19')]===_0x03ef('0x1a')&&typeof _0x16282b['limit']==='undefined';var _0x343bf0=_0x17b6ec[_0x03ef('0x1b')];var _0x501d87=_0x1a0113?0x0:_0x16282b['offset'];var _0x277f0d=_0x1a0113?_0x17b6ec[_0x03ef('0x1b')]:_0x16282b[_0x03ef('0x19')]+_0x16282b[_0x03ef('0x1c')];var _0x1776d8;if(_0x277f0d>=_0x343bf0){_0x277f0d=_0x343bf0;_0x1776d8=0xc8;}else{_0x1776d8=0xce;}_0x531025['status'](_0x1776d8);return _0x531025[_0x03ef('0x1d')](_0x03ef('0x1e'),_0x501d87+'-'+_0x277f0d+'/'+_0x343bf0)['json'](_0x17b6ec);}return null;};}function patchUpdates(_0xb663d){return function(_0x39f693){try{jsonpatch[_0x03ef('0x1f')](_0x39f693,_0xb663d,!![]);}catch(_0xde0e02){return BPromise[_0x03ef('0x20')](_0xde0e02);}return _0x39f693['save']();};}function saveUpdates(_0x5cddb6,_0x41d7d7){return function(_0x5d56e1){if(_0x5d56e1){return _0x5d56e1[_0x03ef('0x21')](_0x5cddb6)['then'](function(_0x5c1a36){return _0x5c1a36;});}return null;};}function removeEntity(_0x13b033,_0x27ac0d){return function(_0x5efaf0){if(_0x5efaf0){return _0x5efaf0['destroy']()[_0x03ef('0x22')](function(){var _0x38a7c5=_0x5efaf0['get']({'plain':!![]});var _0x305829=_0x03ef('0x23');return db[_0x03ef('0x24')]['destroy']({'where':{'type':_0x305829,'resourceId':_0x38a7c5['id']}})[_0x03ef('0x22')](function(){return _0x5efaf0;});})[_0x03ef('0x22')](function(){_0x13b033[_0x03ef('0x17')](0xcc)[_0x03ef('0x18')]();});}};}function handleEntityNotFound(_0x1d1a51,_0x1b766b){return function(_0x538a5d){if(!_0x538a5d){_0x1d1a51['sendStatus'](0x194);}return _0x538a5d;};}function handleError(_0x29c965,_0x5a2bd5){_0x5a2bd5=_0x5a2bd5||0x1f4;return function(_0x39f762){logger[_0x03ef('0x25')](_0x39f762[_0x03ef('0x26')]);if(_0x39f762['name']){delete _0x39f762[_0x03ef('0x27')];}_0x29c965[_0x03ef('0x17')](_0x5a2bd5)[_0x03ef('0x28')](_0x39f762);};}exports[_0x03ef('0x29')]=function(_0x53658c,_0x4711df){var _0x2cd00c={},_0xf38b61={},_0x154c6f={'count':0x0,'rows':[]};var _0x54c07e=_[_0x03ef('0x2a')](db[_0x03ef('0x2b')][_0x03ef('0x2c')],function(_0x4ba338){return{'name':_0x4ba338[_0x03ef('0x2d')],'type':_0x4ba338[_0x03ef('0x2e')][_0x03ef('0x2f')]};});_0xf38b61[_0x03ef('0x30')]=_[_0x03ef('0x2a')](_0x54c07e,'name');_0xf38b61[_0x03ef('0x31')]=_[_0x03ef('0x32')](_0x53658c[_0x03ef('0x31')]);_0xf38b61[_0x03ef('0x33')]=_[_0x03ef('0x34')](_0xf38b61['model'],_0xf38b61[_0x03ef('0x31')]);_0x2cd00c[_0x03ef('0x35')]=_[_0x03ef('0x34')](_0xf38b61[_0x03ef('0x30')],qs[_0x03ef('0x36')](_0x53658c['query']['fields']));_0x2cd00c[_0x03ef('0x35')]=_0x2cd00c[_0x03ef('0x35')]['length']?_0x2cd00c[_0x03ef('0x35')]:_0xf38b61['model'];if(!_0x53658c[_0x03ef('0x31')][_0x03ef('0x37')]('nolimit')){_0x2cd00c[_0x03ef('0x1c')]=qs['limit'](_0x53658c[_0x03ef('0x31')][_0x03ef('0x1c')]);_0x2cd00c['offset']=qs['offset'](_0x53658c[_0x03ef('0x31')][_0x03ef('0x19')]);}_0x2cd00c['order']=qs[_0x03ef('0x38')](_0x53658c[_0x03ef('0x31')][_0x03ef('0x38')]);_0x2cd00c[_0x03ef('0x39')]=qs[_0x03ef('0x33')](_[_0x03ef('0x3a')](_0x53658c[_0x03ef('0x31')],_0xf38b61[_0x03ef('0x33')]),_0x54c07e);if(_0x53658c['query'][_0x03ef('0x3b')]){_0x2cd00c[_0x03ef('0x39')]=_[_0x03ef('0x3c')](_0x2cd00c['where'],{'$or':_[_0x03ef('0x2a')](_0x54c07e,function(_0x473dfe){if(_0x473dfe[_0x03ef('0x2e')]!==_0x03ef('0x3d')){var _0x4b2f62={};_0x4b2f62[_0x473dfe[_0x03ef('0x27')]]={'$like':'%'+_0x53658c[_0x03ef('0x31')][_0x03ef('0x3b')]+'%'};return _0x4b2f62;}})});}_0x2cd00c=_[_0x03ef('0x3c')]({},_0x2cd00c,_0x53658c['options']);var _0x286555={'where':_0x2cd00c[_0x03ef('0x39')]};return db[_0x03ef('0x2b')][_0x03ef('0x1b')](_0x286555)[_0x03ef('0x22')](function(_0x177e8b){_0x154c6f[_0x03ef('0x1b')]=_0x177e8b;if(_0x53658c[_0x03ef('0x31')][_0x03ef('0x3e')]){_0x2cd00c[_0x03ef('0x3f')]=[{'all':!![]}];}return db[_0x03ef('0x2b')][_0x03ef('0x40')](_0x2cd00c);})[_0x03ef('0x22')](function(_0x8f7f42){_0x154c6f[_0x03ef('0x41')]=_0x8f7f42;return _0x154c6f;})[_0x03ef('0x22')](respondWithFilteredResult(_0x4711df,_0x2cd00c))[_0x03ef('0x42')](handleError(_0x4711df,null));};exports[_0x03ef('0x43')]=function(_0x1152d3,_0xd37ba6){var _0x3f5a8b={'raw':![],'where':{'id':_0x1152d3['params']['id']}},_0xeaffb0={};_0xeaffb0[_0x03ef('0x30')]=_[_0x03ef('0x32')](db[_0x03ef('0x2b')][_0x03ef('0x2c')]);_0xeaffb0[_0x03ef('0x31')]=_[_0x03ef('0x32')](_0x1152d3[_0x03ef('0x31')]);_0xeaffb0[_0x03ef('0x33')]=_[_0x03ef('0x34')](_0xeaffb0[_0x03ef('0x30')],_0xeaffb0[_0x03ef('0x31')]);_0x3f5a8b[_0x03ef('0x35')]=_['intersection'](_0xeaffb0[_0x03ef('0x30')],qs[_0x03ef('0x36')](_0x1152d3['query'][_0x03ef('0x36')]));_0x3f5a8b[_0x03ef('0x35')]=_0x3f5a8b['attributes'][_0x03ef('0x44')]?_0x3f5a8b[_0x03ef('0x35')]:_0xeaffb0[_0x03ef('0x30')];if(_0x1152d3['query'][_0x03ef('0x3e')]){_0x3f5a8b[_0x03ef('0x3f')]=[{'all':!![]}];}_0x3f5a8b=_['merge']({},_0x3f5a8b,_0x1152d3['options']);return db[_0x03ef('0x2b')][_0x03ef('0x45')](_0x3f5a8b)[_0x03ef('0x22')](handleEntityNotFound(_0xd37ba6,null))[_0x03ef('0x22')](respondWithResult(_0xd37ba6,null))[_0x03ef('0x42')](handleError(_0xd37ba6,null));};exports[_0x03ef('0x46')]=function(_0x27c6ca,_0x2e3145){return db[_0x03ef('0x2b')]['create'](_0x27c6ca[_0x03ef('0x47')],{})['then'](function(_0x83afeb){var _0x159f2f=_0x27c6ca['user'][_0x03ef('0x48')]({'plain':!![]});if(!_0x159f2f)throw new Error(_0x03ef('0x49'));if(_0x159f2f[_0x03ef('0x4a')]===_0x03ef('0x4b')){var _0x390483=_0x83afeb['get']({'plain':!![]});var _0x1b7e2f=_0x03ef('0x23');return db['UserProfileSection'][_0x03ef('0x45')]({'where':{'name':_0x1b7e2f,'userProfileId':_0x159f2f[_0x03ef('0x4c')]},'raw':!![]})['then'](function(_0x6efa41){if(_0x6efa41&&_0x6efa41['autoAssociation']===0x0){return db['UserProfileResource'][_0x03ef('0x46')]({'name':_0x390483[_0x03ef('0x27')],'resourceId':_0x390483['id'],'type':_0x6efa41['name'],'sectionId':_0x6efa41['id']},{})['then'](function(){return _0x83afeb;});}else{return _0x83afeb;}})[_0x03ef('0x42')](function(_0x5a5533){logger[_0x03ef('0x25')](_0x03ef('0x4d'),_0x5a5533);throw _0x5a5533;});}return _0x83afeb;})[_0x03ef('0x22')](respondWithResult(_0x2e3145,0xc9))[_0x03ef('0x42')](handleError(_0x2e3145,null));};exports[_0x03ef('0x21')]=function(_0x492b1d,_0x45723f){if(_0x492b1d['body']['id']){delete _0x492b1d[_0x03ef('0x47')]['id'];}return db[_0x03ef('0x2b')][_0x03ef('0x45')]({'where':{'id':_0x492b1d[_0x03ef('0x4e')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x45723f,null))[_0x03ef('0x22')](saveUpdates(_0x492b1d[_0x03ef('0x47')],null))[_0x03ef('0x22')](respondWithResult(_0x45723f,null))[_0x03ef('0x42')](handleError(_0x45723f,null));};exports['destroy']=function(_0x5b46a8,_0x152bb5){return db[_0x03ef('0x2b')][_0x03ef('0x45')]({'where':{'id':_0x5b46a8[_0x03ef('0x4e')]['id']}})['then'](handleEntityNotFound(_0x152bb5,null))[_0x03ef('0x22')](removeEntity(_0x152bb5,null))[_0x03ef('0x42')](handleError(_0x152bb5,null));}; \ No newline at end of file +var _0xc4e6=['path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','pick','where','merge','VIRTUAL','filter','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc4e6[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x6c4e('0x0'));var rimraf=require(_0x6c4e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c4e('0x2'));var rp=require(_0x6c4e('0x3'));var moment=require(_0x6c4e('0x4'));var BPromise=require(_0x6c4e('0x5'));var Mustache=require('mustache');var util=require(_0x6c4e('0x6'));var path=require(_0x6c4e('0x7'));var sox=require(_0x6c4e('0x8'));var csv=require('to-csv');var ejs=require(_0x6c4e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6c4e('0xa'));var crypto=require(_0x6c4e('0xb'));var jsforce=require(_0x6c4e('0xc'));var deskjs=require(_0x6c4e('0xd'));var toCsv=require(_0x6c4e('0xe'));var querystring=require(_0x6c4e('0xf'));var Papa=require(_0x6c4e('0x10'));var Redis=require(_0x6c4e('0x11'));var authService=require(_0x6c4e('0x12'));var qs=require(_0x6c4e('0x13'));var as=require(_0x6c4e('0x14'));var hardwareService=require(_0x6c4e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6c4e('0x16'));var config=require(_0x6c4e('0x17'));var licenseUtil=require(_0x6c4e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13bb88,_0x195cd2){_0x195cd2=_0x195cd2||0xcc;return function(_0x38dc10){if(_0x38dc10){return _0x13bb88[_0x6c4e('0x19')](_0x195cd2);}return _0x13bb88['status'](_0x195cd2)[_0x6c4e('0x1a')]();};}function respondWithResult(_0x12b894,_0x287ffe){_0x287ffe=_0x287ffe||0xc8;return function(_0x48c29e){if(_0x48c29e){return _0x12b894[_0x6c4e('0x1b')](_0x287ffe)['json'](_0x48c29e);}};}function respondWithFilteredResult(_0x25941a,_0x1eaf04){return function(_0x1b7746){if(_0x1b7746){var _0x5b83aa=typeof _0x1eaf04['offset']==='undefined'&&typeof _0x1eaf04['limit']===_0x6c4e('0x1c');var _0x5946e1=_0x1b7746[_0x6c4e('0x1d')];var _0x48e453=_0x5b83aa?0x0:_0x1eaf04[_0x6c4e('0x1e')];var _0x145383=_0x5b83aa?_0x1b7746['count']:_0x1eaf04[_0x6c4e('0x1e')]+_0x1eaf04['limit'];var _0xd851df;if(_0x145383>=_0x5946e1){_0x145383=_0x5946e1;_0xd851df=0xc8;}else{_0xd851df=0xce;}_0x25941a[_0x6c4e('0x1b')](_0xd851df);return _0x25941a[_0x6c4e('0x1f')](_0x6c4e('0x20'),_0x48e453+'-'+_0x145383+'/'+_0x5946e1)['json'](_0x1b7746);}return null;};}function patchUpdates(_0xc41439){return function(_0x6b6a2){try{jsonpatch['apply'](_0x6b6a2,_0xc41439,!![]);}catch(_0x112317){return BPromise[_0x6c4e('0x21')](_0x112317);}return _0x6b6a2[_0x6c4e('0x22')]();};}function saveUpdates(_0x104766,_0x11ea4b){return function(_0x5ba1d2){if(_0x5ba1d2){return _0x5ba1d2[_0x6c4e('0x23')](_0x104766)[_0x6c4e('0x24')](function(_0x5c45f2){return _0x5c45f2;});}return null;};}function removeEntity(_0x5c2898,_0x1664a7){return function(_0x2c8a7e){if(_0x2c8a7e){return _0x2c8a7e[_0x6c4e('0x25')]()[_0x6c4e('0x24')](function(){var _0x924712=_0x2c8a7e[_0x6c4e('0x26')]({'plain':!![]});var _0xf2254f='ChanSpies';return db[_0x6c4e('0x27')][_0x6c4e('0x25')]({'where':{'type':_0xf2254f,'resourceId':_0x924712['id']}})[_0x6c4e('0x24')](function(){return _0x2c8a7e;});})[_0x6c4e('0x24')](function(){_0x5c2898['status'](0xcc)[_0x6c4e('0x1a')]();});}};}function handleEntityNotFound(_0x276cb8,_0x602cf8){return function(_0x117f1a){if(!_0x117f1a){_0x276cb8[_0x6c4e('0x19')](0x194);}return _0x117f1a;};}function handleError(_0x14ccfc,_0x3681ee){_0x3681ee=_0x3681ee||0x1f4;return function(_0x52c934){logger[_0x6c4e('0x28')](_0x52c934[_0x6c4e('0x29')]);if(_0x52c934['name']){delete _0x52c934[_0x6c4e('0x2a')];}_0x14ccfc[_0x6c4e('0x1b')](_0x3681ee)['send'](_0x52c934);};}exports['index']=function(_0x2cf74e,_0x12fc7c){var _0x52a69e={},_0x254245={},_0x17ec9e={'count':0x0,'rows':[]};var _0x5aa383=_[_0x6c4e('0x2b')](db['VoiceChanSpy'][_0x6c4e('0x2c')],function(_0x43a6df){return{'name':_0x43a6df['fieldName'],'type':_0x43a6df[_0x6c4e('0x2d')]['key']};});_0x254245[_0x6c4e('0x2e')]=_[_0x6c4e('0x2b')](_0x5aa383,'name');_0x254245[_0x6c4e('0x2f')]=_['keys'](_0x2cf74e[_0x6c4e('0x2f')]);_0x254245[_0x6c4e('0x30')]=_[_0x6c4e('0x31')](_0x254245[_0x6c4e('0x2e')],_0x254245[_0x6c4e('0x2f')]);_0x52a69e[_0x6c4e('0x32')]=_['intersection'](_0x254245[_0x6c4e('0x2e')],qs[_0x6c4e('0x33')](_0x2cf74e[_0x6c4e('0x2f')][_0x6c4e('0x33')]));_0x52a69e[_0x6c4e('0x32')]=_0x52a69e[_0x6c4e('0x32')][_0x6c4e('0x34')]?_0x52a69e[_0x6c4e('0x32')]:_0x254245[_0x6c4e('0x2e')];if(!_0x2cf74e['query']['hasOwnProperty'](_0x6c4e('0x35'))){_0x52a69e[_0x6c4e('0x36')]=qs[_0x6c4e('0x36')](_0x2cf74e[_0x6c4e('0x2f')][_0x6c4e('0x36')]);_0x52a69e[_0x6c4e('0x1e')]=qs[_0x6c4e('0x1e')](_0x2cf74e[_0x6c4e('0x2f')][_0x6c4e('0x1e')]);}_0x52a69e['order']=qs['sort'](_0x2cf74e['query']['sort']);_0x52a69e['where']=qs[_0x6c4e('0x30')](_[_0x6c4e('0x37')](_0x2cf74e[_0x6c4e('0x2f')],_0x254245['filters']),_0x5aa383);if(_0x2cf74e[_0x6c4e('0x2f')]['filter']){_0x52a69e[_0x6c4e('0x38')]=_[_0x6c4e('0x39')](_0x52a69e['where'],{'$or':_['map'](_0x5aa383,function(_0x3ddb81){if(_0x3ddb81[_0x6c4e('0x2d')]!==_0x6c4e('0x3a')){var _0x5dec92={};_0x5dec92[_0x3ddb81[_0x6c4e('0x2a')]]={'$like':'%'+_0x2cf74e[_0x6c4e('0x2f')][_0x6c4e('0x3b')]+'%'};return _0x5dec92;}})});}_0x52a69e=_[_0x6c4e('0x39')]({},_0x52a69e,_0x2cf74e[_0x6c4e('0x3c')]);var _0x11d735={'where':_0x52a69e['where']};return db[_0x6c4e('0x3d')][_0x6c4e('0x1d')](_0x11d735)[_0x6c4e('0x24')](function(_0x2894f6){_0x17ec9e[_0x6c4e('0x1d')]=_0x2894f6;if(_0x2cf74e[_0x6c4e('0x2f')][_0x6c4e('0x3e')]){_0x52a69e[_0x6c4e('0x3f')]=[{'all':!![]}];}return db[_0x6c4e('0x3d')][_0x6c4e('0x40')](_0x52a69e);})[_0x6c4e('0x24')](function(_0x514998){_0x17ec9e[_0x6c4e('0x41')]=_0x514998;return _0x17ec9e;})['then'](respondWithFilteredResult(_0x12fc7c,_0x52a69e))[_0x6c4e('0x42')](handleError(_0x12fc7c,null));};exports[_0x6c4e('0x43')]=function(_0x380622,_0x3e03d5){var _0x4b9d91={'raw':![],'where':{'id':_0x380622['params']['id']}},_0x189b75={};_0x189b75[_0x6c4e('0x2e')]=_['keys'](db[_0x6c4e('0x3d')]['rawAttributes']);_0x189b75['query']=_[_0x6c4e('0x44')](_0x380622[_0x6c4e('0x2f')]);_0x189b75[_0x6c4e('0x30')]=_['intersection'](_0x189b75[_0x6c4e('0x2e')],_0x189b75[_0x6c4e('0x2f')]);_0x4b9d91[_0x6c4e('0x32')]=_[_0x6c4e('0x31')](_0x189b75[_0x6c4e('0x2e')],qs[_0x6c4e('0x33')](_0x380622[_0x6c4e('0x2f')][_0x6c4e('0x33')]));_0x4b9d91['attributes']=_0x4b9d91['attributes'][_0x6c4e('0x34')]?_0x4b9d91[_0x6c4e('0x32')]:_0x189b75['model'];if(_0x380622[_0x6c4e('0x2f')]['includeAll']){_0x4b9d91[_0x6c4e('0x3f')]=[{'all':!![]}];}_0x4b9d91=_[_0x6c4e('0x39')]({},_0x4b9d91,_0x380622[_0x6c4e('0x3c')]);return db['VoiceChanSpy']['find'](_0x4b9d91)[_0x6c4e('0x24')](handleEntityNotFound(_0x3e03d5,null))[_0x6c4e('0x24')](respondWithResult(_0x3e03d5,null))[_0x6c4e('0x42')](handleError(_0x3e03d5,null));};exports[_0x6c4e('0x45')]=function(_0x2ceda7,_0x51288c){return db[_0x6c4e('0x3d')][_0x6c4e('0x45')](_0x2ceda7['body'],{})[_0x6c4e('0x24')](function(_0x356370){var _0x326ccd=_0x2ceda7[_0x6c4e('0x46')][_0x6c4e('0x26')]({'plain':!![]});if(!_0x326ccd)throw new Error(_0x6c4e('0x47'));if(_0x326ccd[_0x6c4e('0x48')]===_0x6c4e('0x46')){var _0x17beba=_0x356370['get']({'plain':!![]});var _0x5420a5=_0x6c4e('0x49');return db[_0x6c4e('0x4a')][_0x6c4e('0x4b')]({'where':{'name':_0x5420a5,'userProfileId':_0x326ccd[_0x6c4e('0x4c')]},'raw':!![]})[_0x6c4e('0x24')](function(_0x222349){if(_0x222349&&_0x222349['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x17beba['name'],'resourceId':_0x17beba['id'],'type':_0x222349[_0x6c4e('0x2a')],'sectionId':_0x222349['id']},{})[_0x6c4e('0x24')](function(){return _0x356370;});}else{return _0x356370;}})[_0x6c4e('0x42')](function(_0x1666f3){logger[_0x6c4e('0x28')](_0x6c4e('0x4d'),_0x1666f3);throw _0x1666f3;});}return _0x356370;})[_0x6c4e('0x24')](respondWithResult(_0x51288c,0xc9))[_0x6c4e('0x42')](handleError(_0x51288c,null));};exports[_0x6c4e('0x23')]=function(_0xd62861,_0x4f540e){if(_0xd62861[_0x6c4e('0x4e')]['id']){delete _0xd62861[_0x6c4e('0x4e')]['id'];}return db[_0x6c4e('0x3d')][_0x6c4e('0x4b')]({'where':{'id':_0xd62861[_0x6c4e('0x4f')]['id']}})[_0x6c4e('0x24')](handleEntityNotFound(_0x4f540e,null))[_0x6c4e('0x24')](saveUpdates(_0xd62861[_0x6c4e('0x4e')],null))[_0x6c4e('0x24')](respondWithResult(_0x4f540e,null))[_0x6c4e('0x42')](handleError(_0x4f540e,null));};exports[_0x6c4e('0x25')]=function(_0x5113d6,_0x581f0a){return db[_0x6c4e('0x3d')][_0x6c4e('0x4b')]({'where':{'id':_0x5113d6['params']['id']}})[_0x6c4e('0x24')](handleEntityNotFound(_0x581f0a,null))[_0x6c4e('0x24')](removeEntity(_0x581f0a,null))['catch'](handleError(_0x581f0a,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 7b2ee06..4ac2044 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 _0x63a1=['MixMonitor','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','agent','then','catch','define','voice_chanspy','VoiceExtension','bulkCreate','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','record'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x63a1,0x9d));var _0x163a=function(_0x2d090b,_0xe34d4c){_0x2d090b=_0x2d090b-0x0;var _0x4022a4=_0x63a1[_0x2d090b];return _0x4022a4;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x163a('0x0'));var attributes=require(_0x163a('0x1'));var getUserApplications=function(_0x3361d2,_0x1cc150,_0x582c8a){var _0x5ce70c=0x1;var _0x4d5293=[];var _0x4e4c9f={'context':_0x1cc150[_0x163a('0x2')]||_0x163a('0x3'),'exten':util['format']('%s%s',_0x3361d2[_0x163a('0x4')],_0x582c8a),'type':_0x163a('0x5'),'isApp':![],'ChanSpyId':_0x3361d2['id'],'UserId':_0x1cc150['id']};_0x4d5293[_0x163a('0x6')](_[_0x163a('0x7')]({'app':_0x163a('0x8'),'appdata':util[_0x163a('0x9')](_0x163a('0xa'),_0x163a('0xb')),'priority':_0x5ce70c++},_0x4e4c9f));if(_0x3361d2[_0x163a('0xc')]){_0x4d5293['push'](_[_0x163a('0x7')]({'app':_0x163a('0xd'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x3361d2[_0x163a('0xe')]),'priority':_0x5ce70c++},_0x4e4c9f));}if(_0x3361d2['auth']){_0x4d5293['push'](_[_0x163a('0x7')]({'app':'Authenticate','appdata':_0x3361d2[_0x163a('0xf')],'priority':_0x5ce70c++},_0x4e4c9f));}_0x4d5293['push'](_[_0x163a('0x7')]({'app':_0x163a('0x10'),'appdata':util[_0x163a('0x9')](_0x163a('0x11'),_0x1cc150[_0x163a('0x12')],_0x3361d2[_0x163a('0x13')]?_0x3361d2[_0x163a('0x13')][_0x163a('0x14')](''):''),'priority':_0x5ce70c++},_0x4e4c9f));if(_0x3361d2[_0x163a('0xc')]){_0x4d5293['push'](_[_0x163a('0x7')]({'app':'StopMixMonitor','priority':_0x5ce70c++},_0x4e4c9f));}return _0x4d5293;};var getChanSpyApplications=function(_0x47050b,_0x167ed0){var _0x455884=[];for(var _0x26e820=0x0,_0x3bc1ce=0x1;_0x26e820<_0x167ed0[_0x163a('0x15')];_0x26e820++,_0x3bc1ce=0x1){_0x455884=_0x455884[_0x163a('0x16')](getUserApplications(_0x47050b,_0x167ed0[_0x26e820],_0x167ed0[_0x26e820][_0x163a('0x17')]));if(_0x167ed0[_0x26e820][_0x163a('0x17')]!=_0x167ed0[_0x26e820][_0x163a('0x12')]){_0x455884=_0x455884['concat'](getUserApplications(_0x47050b,_0x167ed0[_0x26e820],_0x167ed0[_0x26e820][_0x163a('0x12')]));}}return _0x455884;};var getChanSpyPromise=function(_0x104458,_0x39cbef){return new BPromise(function(_0x2e4d18,_0xe018d3){return _0x104458[_0x163a('0x18')][_0x163a('0x19')]({'attributes':['id',_0x163a('0x12'),'internal'],'where':{'role':_0x163a('0x1a'),'chanspy':!![]},'raw':!![]})[_0x163a('0x1b')](function(_0x29bad5){if(_0x29bad5){return _0x2e4d18(getChanSpyApplications(_0x39cbef,_0x29bad5));}return _0x2e4d18([]);})[_0x163a('0x1c')](function(_0x11346a){_0xe018d3(_0x11346a);});});};module['exports']=function(_0x28f395,_0x39805a){var _0x3ad59f=_0x28f395['models'];return _0x28f395[_0x163a('0x1d')]('VoiceChanSpy',attributes,{'tableName':_0x163a('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x452823,_0x41e590,_0x190512){return getChanSpyPromise(_0x3ad59f,_0x452823)['then'](function(_0x206700){if(_0x206700&&_0x206700['length']){return _0x3ad59f[_0x163a('0x1f')][_0x163a('0x20')](_0x206700);}})['then'](function(){_0x190512();})[_0x163a('0x1c')](function(_0x2995c8){_0x190512(_0x2995c8);});},'afterUpdate':function(_0x5298d8,_0x28c4ca,_0x5c3366){return _0x3ad59f[_0x163a('0x1f')][_0x163a('0x21')]({'where':{'ChanSpyId':_0x5298d8['id']}})[_0x163a('0x1b')](function(){return getChanSpyPromise(_0x3ad59f,_0x5298d8);})['then'](function(_0x1aaee1){if(_0x1aaee1&&_0x1aaee1['length']){return _0x3ad59f[_0x163a('0x1f')][_0x163a('0x20')](_0x1aaee1);}})[_0x163a('0x1b')](function(){_0x5c3366();})['catch'](function(_0x39058b){_0x5c3366(_0x39058b);});},'afterDestroy':function(_0x3f72fc,_0x5e80f6,_0x1b68d5){return _0x3ad59f[_0x163a('0x1f')][_0x163a('0x21')]({'where':{'ChanSpyId':_0x3f72fc['id']}})[_0x163a('0x1b')](function(){_0x1b68d5();})[_0x163a('0x1c')](function(_0x436ae3){_0x1b68d5(_0x436ae3);});}}});}; \ No newline at end of file +var _0xa061=['VoiceExtension','bulkCreate','then','catch','destroy','util','./voiceChanSpy.attributes','context','from-sip','%s%s','system','push','merge','Set','format','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','findAll','agent','models','define','voice_chanspy'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xa061,0xb4));var _0x1a06=function(_0x5ce075,_0x20b649){_0x5ce075=_0x5ce075-0x0;var _0x595e7d=_0xa061[_0x5ce075];return _0x595e7d;};'use strict';var _=require('lodash');var util=require(_0x1a06('0x0'));var BPromise=require('bluebird');var attributes=require(_0x1a06('0x1'));var getUserApplications=function(_0x16cf23,_0x4b01c8,_0x19b9ab){var _0x2ef593=0x1;var _0x25ee9a=[];var _0x488dd9={'context':_0x4b01c8[_0x1a06('0x2')]||_0x1a06('0x3'),'exten':util['format'](_0x1a06('0x4'),_0x16cf23['prefix'],_0x19b9ab),'type':_0x1a06('0x5'),'isApp':![],'ChanSpyId':_0x16cf23['id'],'UserId':_0x4b01c8['id']};_0x25ee9a[_0x1a06('0x6')](_[_0x1a06('0x7')]({'app':_0x1a06('0x8'),'appdata':util[_0x1a06('0x9')]('CDR(type)=%s',_0x1a06('0xa')),'priority':_0x2ef593++},_0x488dd9));if(_0x16cf23[_0x1a06('0xb')]){_0x25ee9a[_0x1a06('0x6')](_[_0x1a06('0x7')]({'app':_0x1a06('0xc'),'appdata':util[_0x1a06('0x9')]('${UNIQUEID}.%s,a',_0x16cf23[_0x1a06('0xd')]),'priority':_0x2ef593++},_0x488dd9));}if(_0x16cf23[_0x1a06('0xe')]){_0x25ee9a[_0x1a06('0x6')](_[_0x1a06('0x7')]({'app':_0x1a06('0xf'),'appdata':_0x16cf23[_0x1a06('0x10')],'priority':_0x2ef593++},_0x488dd9));}_0x25ee9a[_0x1a06('0x6')](_[_0x1a06('0x7')]({'app':_0x1a06('0x11'),'appdata':util['format'](_0x1a06('0x12'),_0x4b01c8[_0x1a06('0x13')],_0x16cf23[_0x1a06('0x14')]?_0x16cf23['options']['join'](''):''),'priority':_0x2ef593++},_0x488dd9));if(_0x16cf23[_0x1a06('0xb')]){_0x25ee9a[_0x1a06('0x6')](_['merge']({'app':_0x1a06('0x15'),'priority':_0x2ef593++},_0x488dd9));}return _0x25ee9a;};var getChanSpyApplications=function(_0x10ded2,_0x2b5f57){var _0x2729bb=[];for(var _0x30dda6=0x0,_0x3128d5=0x1;_0x30dda6<_0x2b5f57[_0x1a06('0x16')];_0x30dda6++,_0x3128d5=0x1){_0x2729bb=_0x2729bb[_0x1a06('0x17')](getUserApplications(_0x10ded2,_0x2b5f57[_0x30dda6],_0x2b5f57[_0x30dda6][_0x1a06('0x18')]));if(_0x2b5f57[_0x30dda6][_0x1a06('0x18')]!=_0x2b5f57[_0x30dda6][_0x1a06('0x13')]){_0x2729bb=_0x2729bb[_0x1a06('0x17')](getUserApplications(_0x10ded2,_0x2b5f57[_0x30dda6],_0x2b5f57[_0x30dda6][_0x1a06('0x13')]));}}return _0x2729bb;};var getChanSpyPromise=function(_0x2b94ec,_0x31ff80){return new BPromise(function(_0x596f79,_0xae3bcd){return _0x2b94ec['User'][_0x1a06('0x19')]({'attributes':['id',_0x1a06('0x13'),_0x1a06('0x18')],'where':{'role':_0x1a06('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x89f78c){if(_0x89f78c){return _0x596f79(getChanSpyApplications(_0x31ff80,_0x89f78c));}return _0x596f79([]);})['catch'](function(_0x278836){_0xae3bcd(_0x278836);});});};module['exports']=function(_0x1157d2,_0x173efd){var _0x13dd30=_0x1157d2[_0x1a06('0x1b')];return _0x1157d2[_0x1a06('0x1c')]('VoiceChanSpy',attributes,{'tableName':_0x1a06('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xed4e5a,_0xc3930b,_0x2e4f4d){return getChanSpyPromise(_0x13dd30,_0xed4e5a)['then'](function(_0x45cea6){if(_0x45cea6&&_0x45cea6['length']){return _0x13dd30[_0x1a06('0x1e')][_0x1a06('0x1f')](_0x45cea6);}})[_0x1a06('0x20')](function(){_0x2e4f4d();})[_0x1a06('0x21')](function(_0x37cca1){_0x2e4f4d(_0x37cca1);});},'afterUpdate':function(_0x1215f6,_0x50455f,_0x37545d){return _0x13dd30[_0x1a06('0x1e')][_0x1a06('0x22')]({'where':{'ChanSpyId':_0x1215f6['id']}})['then'](function(){return getChanSpyPromise(_0x13dd30,_0x1215f6);})[_0x1a06('0x20')](function(_0x25a7c7){if(_0x25a7c7&&_0x25a7c7[_0x1a06('0x16')]){return _0x13dd30[_0x1a06('0x1e')][_0x1a06('0x1f')](_0x25a7c7);}})[_0x1a06('0x20')](function(){_0x37545d();})[_0x1a06('0x21')](function(_0x458ab3){_0x37545d(_0x458ab3);});},'afterDestroy':function(_0x34fbf5,_0x11402f,_0x534ce0){return _0x13dd30[_0x1a06('0x1e')][_0x1a06('0x22')]({'where':{'ChanSpyId':_0x34fbf5['id']}})[_0x1a06('0x20')](function(){_0x534ce0();})[_0x1a06('0x21')](function(_0x27e7f4){_0x534ce0(_0x27e7f4);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index eea7639..bdea797 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 _0x87ae=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x87ae,0xf5));var _0xe87a=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x87ae[_0x3f0b30];return _0x2748a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe87a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe87a('0x1'));var db=require(_0xe87a('0x2'))['db'];var utils=require(_0xe87a('0x3'));var logger=require('../../config/logger')(_0xe87a('0x4'));var config=require(_0xe87a('0x5'));var jayson=require(_0xe87a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x125dd3,_0x2fbd6b,_0x5dff22){return new BPromise(function(_0x379db4,_0x455b3a){return client['request'](_0x125dd3,_0x5dff22)[_0xe87a('0x7')](function(_0x278d7c){logger['info'](_0xe87a('0x8'),_0x2fbd6b,_0xe87a('0x9'));logger[_0xe87a('0xa')](_0xe87a('0xb'),_0x2fbd6b,_0xe87a('0x9'),JSON[_0xe87a('0xc')](_0x278d7c));if(_0x278d7c['error']){if(_0x278d7c['error'][_0xe87a('0xd')]===0x1f4){logger[_0xe87a('0xe')](_0xe87a('0x8'),_0x2fbd6b,_0x278d7c['error'][_0xe87a('0xf')]);return _0x455b3a(_0x278d7c[_0xe87a('0xe')]['message']);}logger[_0xe87a('0xe')](_0xe87a('0x8'),_0x2fbd6b,_0x278d7c[_0xe87a('0xe')]['message']);return _0x379db4(_0x278d7c['error']['message']);}else{logger['info'](_0xe87a('0x8'),_0x2fbd6b,_0xe87a('0x9'));_0x379db4(_0x278d7c[_0xe87a('0x10')][_0xe87a('0xf')]);}})['catch'](function(_0x415147){logger[_0xe87a('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x2fbd6b,_0x415147);_0x455b3a(_0x415147);});});} \ No newline at end of file +var _0x5db8=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5db8,0xbb));var _0x85db=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x5db8[_0x385eb1];return _0x5d40eb;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var moment=require(_0x85db('0x2'));var BPromise=require('bluebird');var rs=require(_0x85db('0x3'));var fs=require('fs');var Redis=require(_0x85db('0x4'));var db=require(_0x85db('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85db('0x6'));var config=require(_0x85db('0x7'));var jayson=require(_0x85db('0x8'));var client=jayson[_0x85db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489b13,_0x2b9f25,_0x3a10dd){return new BPromise(function(_0xc6fd00,_0x308988){return client['request'](_0x489b13,_0x3a10dd)[_0x85db('0xa')](function(_0x54f0c1){logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));logger[_0x85db('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x2b9f25,'request\x20sent',JSON['stringify'](_0x54f0c1));if(_0x54f0c1[_0x85db('0xf')]){if(_0x54f0c1[_0x85db('0xf')]['code']===0x1f4){logger[_0x85db('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0x308988(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0xc6fd00(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}else{logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));_0xc6fd00(_0x54f0c1['result'][_0x85db('0x10')]);}})[_0x85db('0x11')](function(_0x11e7da){logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x11e7da);_0x308988(_0x11e7da);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4036d60..6fa2dba 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 _0xbade=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post','create','update','delete','exports','util','path'];(function(_0x16f6e4,_0x288b61){var _0x275354=function(_0x43865e){while(--_0x43865e){_0x16f6e4['push'](_0x16f6e4['shift']());}};_0x275354(++_0x288b61);}(_0xbade,0x7c));var _0xebad=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0xbade[_0x12e073];return _0x267748;};'use strict';var multer=require('multer');var util=require(_0xebad('0x0'));var path=require(_0xebad('0x1'));var timeout=require(_0xebad('0x2'));var express=require(_0xebad('0x3'));var router=express[_0xebad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xebad('0x5'));var interaction=require(_0xebad('0x6'));var config=require(_0xebad('0x7'));var controller=require(_0xebad('0x8'));router[_0xebad('0x9')]('/',auth[_0xebad('0xa')](),controller['index']);router['get'](_0xebad('0xb'),auth[_0xebad('0xa')](),controller[_0xebad('0xc')]);router[_0xebad('0xd')]('/',auth['isAuthenticated'](),controller[_0xebad('0xe')]);router['put'](_0xebad('0xb'),auth['isAuthenticated'](),controller[_0xebad('0xf')]);router[_0xebad('0x10')](_0xebad('0xb'),auth[_0xebad('0xa')](),controller['destroy']);module[_0xebad('0x11')]=router; \ No newline at end of file +var _0xf8a6=['delete','destroy','multer','path','Router','index','get','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x3d3251,_0xc69e75){var _0x3c5543=function(_0x5047d8){while(--_0x5047d8){_0x3d3251['push'](_0x3d3251['shift']());}};_0x3c5543(++_0xc69e75);}(_0xf8a6,0x16e));var _0x6f8a=function(_0x45cb74,_0x4ceee8){_0x45cb74=_0x45cb74-0x0;var _0x36ee8e=_0xf8a6[_0x45cb74];return _0x36ee8e;};'use strict';var multer=require(_0x6f8a('0x0'));var util=require('util');var path=require(_0x6f8a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f8a('0x2')]();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('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6f8a('0x3')]);router[_0x6f8a('0x4')]('/:id',auth[_0x6f8a('0x5')](),controller[_0x6f8a('0x6')]);router[_0x6f8a('0x7')]('/',auth['isAuthenticated'](),controller[_0x6f8a('0x8')]);router[_0x6f8a('0x9')](_0x6f8a('0xa'),auth[_0x6f8a('0x5')](),controller[_0x6f8a('0xb')]);router[_0x6f8a('0xc')]('/:id',auth[_0x6f8a('0x5')](),controller[_0x6f8a('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index feecbab..535c2ba 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 _0xf470=['name','BOOLEAN','exports','STRING'];(function(_0x5e88a1,_0x3a9f75){var _0x32a879=function(_0x300eec){while(--_0x300eec){_0x5e88a1['push'](_0x5e88a1['shift']());}};_0x32a879(++_0x3a9f75);}(_0xf470,0x11a));var _0x0f47=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xf470[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module[_0x0f47('0x0')]={'name':{'type':Sequelize[_0x0f47('0x1')],'unique':_0x0f47('0x2')},'description':{'type':Sequelize[_0x0f47('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0f47('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1413=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x1b68ff,_0x5e68a2){var _0x4b3b07=function(_0x465dd9){while(--_0x465dd9){_0x1b68ff['push'](_0x1b68ff['shift']());}};_0x4b3b07(++_0x5e68a2);}(_0x1413,0x1ba));var _0x3141=function(_0x31543d,_0xa33109){_0x31543d=_0x31543d-0x0;var _0xe5a19d=_0x1413[_0x31543d];return _0xe5a19d;};'use strict';var Sequelize=require(_0x3141('0x0'));module[_0x3141('0x1')]={'name':{'type':Sequelize[_0x3141('0x2')],'unique':_0x3141('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x3141('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index f689022..6fc2f32 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 _0x04a8=['../../config/environment','../../config/license/util','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','Contexts','UserProfileResource','end','send','index','map','VoiceContext','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','type','VIRTUAL','name','merge','options','where','includeAll','include','findAll','rows','params','length','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','writeFileSync','chan_sip.so','root','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x3efa1c,_0x324128){var _0x1eb949=function(_0x2f03a8){while(--_0x2f03a8){_0x3efa1c['push'](_0x3efa1c['shift']());}};_0x1eb949(++_0x324128);}(_0x04a8,0x1e4));var _0x804a=function(_0x271478,_0x2d420e){_0x271478=_0x271478-0x0;var _0x522946=_0x04a8[_0x271478];return _0x522946;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804a('0x0'));var zipdir=require(_0x804a('0x1'));var jsonpatch=require(_0x804a('0x2'));var rp=require(_0x804a('0x3'));var moment=require(_0x804a('0x4'));var BPromise=require(_0x804a('0x5'));var Mustache=require(_0x804a('0x6'));var util=require(_0x804a('0x7'));var path=require(_0x804a('0x8'));var sox=require('sox');var csv=require(_0x804a('0x9'));var ejs=require(_0x804a('0xa'));var fs=require('fs');var fs_extra=require(_0x804a('0xb'));var _=require('lodash');var squel=require(_0x804a('0xc'));var crypto=require('crypto');var jsforce=require(_0x804a('0xd'));var deskjs=require(_0x804a('0xe'));var toCsv=require(_0x804a('0x9'));var querystring=require(_0x804a('0xf'));var Papa=require(_0x804a('0x10'));var Redis=require(_0x804a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x804a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804a('0x13'));var logger=require('../../config/logger')(_0x804a('0x14'));var utils=require('../../config/utils');var config=require(_0x804a('0x15'));var licenseUtil=require(_0x804a('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x804a('0x17'));var client=jayson[_0x804a('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c122b,_0x13d652,_0x2743fb,_0x4b6203){return new BPromise(function(_0x415cc3,_0x4b8ccf){var _0x38c5f7=_0x4b6203||client;return _0x38c5f7['request'](_0x4c122b,_0x2743fb)[_0x804a('0x19')](function(_0x4670a8){logger[_0x804a('0x1a')](_0x804a('0x1b'),_0x13d652,_0x804a('0x1c'));logger['debug'](_0x804a('0x1d'),_0x13d652,_0x804a('0x1c'),JSON[_0x804a('0x1e')](_0x4670a8));if(_0x4670a8[_0x804a('0x1f')]){if(_0x4670a8['error'][_0x804a('0x20')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x13d652,_0x4670a8[_0x804a('0x1f')][_0x804a('0x21')]);return _0x4b8ccf(_0x4670a8[_0x804a('0x1f')][_0x804a('0x21')]);}logger[_0x804a('0x1f')](_0x804a('0x1b'),_0x13d652,_0x4670a8['error'][_0x804a('0x21')]);return _0x415cc3(_0x4670a8[_0x804a('0x1f')][_0x804a('0x21')]);}else{logger[_0x804a('0x1a')](_0x804a('0x1b'),_0x13d652,'request\x20sent');_0x415cc3(_0x4670a8['result'][_0x804a('0x21')]);}})[_0x804a('0x22')](function(_0x417a5b){logger['error'](_0x804a('0x1b'),_0x13d652,_0x417a5b);_0x4b8ccf(_0x417a5b);});});}function respondWithStatusCode(_0x1deb5e,_0x1b03bd){_0x1b03bd=_0x1b03bd||0xcc;return function(_0xf76a05){if(_0xf76a05){return _0x1deb5e[_0x804a('0x23')](_0x1b03bd);}return _0x1deb5e['status'](_0x1b03bd)['end']();};}function respondWithResult(_0x246a3b,_0x3a40fe){_0x3a40fe=_0x3a40fe||0xc8;return function(_0x45fde6){if(_0x45fde6){return _0x246a3b[_0x804a('0x24')](_0x3a40fe)['json'](_0x45fde6);}};}function respondWithFilteredResult(_0x10ec51,_0x57165c){return function(_0x2b9806){if(_0x2b9806){var _0x4160e3=typeof _0x57165c[_0x804a('0x25')]==='undefined'&&typeof _0x57165c[_0x804a('0x26')]===_0x804a('0x27');var _0x525c39=_0x2b9806[_0x804a('0x28')];var _0x450834=_0x4160e3?0x0:_0x57165c[_0x804a('0x25')];var _0x2ec2dd=_0x4160e3?_0x2b9806[_0x804a('0x28')]:_0x57165c[_0x804a('0x25')]+_0x57165c[_0x804a('0x26')];var _0x3e3989;if(_0x2ec2dd>=_0x525c39){_0x2ec2dd=_0x525c39;_0x3e3989=0xc8;}else{_0x3e3989=0xce;}_0x10ec51[_0x804a('0x24')](_0x3e3989);return _0x10ec51[_0x804a('0x29')](_0x804a('0x2a'),_0x450834+'-'+_0x2ec2dd+'/'+_0x525c39)['json'](_0x2b9806);}return null;};}function patchUpdates(_0x5e1bba){return function(_0x5f3b5d){try{jsonpatch[_0x804a('0x2b')](_0x5f3b5d,_0x5e1bba,!![]);}catch(_0x360692){return BPromise['reject'](_0x360692);}return _0x5f3b5d[_0x804a('0x2c')]();};}function saveUpdates(_0x839937,_0x39963b){return function(_0x52d01f){if(_0x52d01f){return _0x52d01f['update'](_0x839937)['then'](function(_0x1ce401){return _0x1ce401;});}return null;};}function removeEntity(_0x1dbba1,_0x2cedc1){return function(_0x3e62a1){if(_0x3e62a1){return _0x3e62a1[_0x804a('0x2d')]()[_0x804a('0x19')](function(){var _0x45ea6f=_0x3e62a1['get']({'plain':!![]});var _0x5ba2da=_0x804a('0x2e');return db[_0x804a('0x2f')][_0x804a('0x2d')]({'where':{'type':_0x5ba2da,'resourceId':_0x45ea6f['id']}})[_0x804a('0x19')](function(){return _0x3e62a1;});})[_0x804a('0x19')](function(){_0x1dbba1[_0x804a('0x24')](0xcc)[_0x804a('0x30')]();});}};}function handleEntityNotFound(_0x472872,_0x5009db){return function(_0x45b509){if(!_0x45b509){_0x472872['sendStatus'](0x194);}return _0x45b509;};}function handleError(_0x142b2f,_0x447ef9){_0x447ef9=_0x447ef9||0x1f4;return function(_0x42647b){logger[_0x804a('0x1f')](_0x42647b['stack']);if(_0x42647b['name']){delete _0x42647b['name'];}_0x142b2f[_0x804a('0x24')](_0x447ef9)[_0x804a('0x31')](_0x42647b);};}exports[_0x804a('0x32')]=function(_0x1fab9c,_0x2a5798){var _0x40dfbf={},_0x4d02db={},_0x4cec40={'count':0x0,'rows':[]};var _0x12b9ff=_[_0x804a('0x33')](db[_0x804a('0x34')][_0x804a('0x35')],function(_0x32ed5e){return{'name':_0x32ed5e['fieldName'],'type':_0x32ed5e['type'][_0x804a('0x36')]};});_0x4d02db['model']=_[_0x804a('0x33')](_0x12b9ff,'name');_0x4d02db[_0x804a('0x37')]=_[_0x804a('0x38')](_0x1fab9c[_0x804a('0x37')]);_0x4d02db[_0x804a('0x39')]=_[_0x804a('0x3a')](_0x4d02db[_0x804a('0x3b')],_0x4d02db[_0x804a('0x37')]);_0x40dfbf[_0x804a('0x3c')]=_[_0x804a('0x3a')](_0x4d02db['model'],qs[_0x804a('0x3d')](_0x1fab9c[_0x804a('0x37')]['fields']));_0x40dfbf[_0x804a('0x3c')]=_0x40dfbf[_0x804a('0x3c')]['length']?_0x40dfbf[_0x804a('0x3c')]:_0x4d02db[_0x804a('0x3b')];if(!_0x1fab9c['query'][_0x804a('0x3e')](_0x804a('0x3f'))){_0x40dfbf[_0x804a('0x26')]=qs[_0x804a('0x26')](_0x1fab9c[_0x804a('0x37')]['limit']);_0x40dfbf[_0x804a('0x25')]=qs[_0x804a('0x25')](_0x1fab9c[_0x804a('0x37')][_0x804a('0x25')]);}_0x40dfbf[_0x804a('0x40')]=qs[_0x804a('0x41')](_0x1fab9c[_0x804a('0x37')]['sort']);_0x40dfbf['where']=qs[_0x804a('0x39')](_[_0x804a('0x42')](_0x1fab9c[_0x804a('0x37')],_0x4d02db[_0x804a('0x39')]),_0x12b9ff);if(_0x1fab9c[_0x804a('0x37')][_0x804a('0x43')]){_0x40dfbf['where']=_['merge'](_0x40dfbf['where'],{'$or':_[_0x804a('0x33')](_0x12b9ff,function(_0x30a520){if(_0x30a520[_0x804a('0x44')]!==_0x804a('0x45')){var _0x30c467={};_0x30c467[_0x30a520[_0x804a('0x46')]]={'$like':'%'+_0x1fab9c[_0x804a('0x37')]['filter']+'%'};return _0x30c467;}})});}_0x40dfbf=_[_0x804a('0x47')]({},_0x40dfbf,_0x1fab9c[_0x804a('0x48')]);var _0x4f400f={'where':_0x40dfbf[_0x804a('0x49')]};return db[_0x804a('0x34')][_0x804a('0x28')](_0x4f400f)[_0x804a('0x19')](function(_0x597daa){_0x4cec40[_0x804a('0x28')]=_0x597daa;if(_0x1fab9c[_0x804a('0x37')][_0x804a('0x4a')]){_0x40dfbf[_0x804a('0x4b')]=[{'all':!![]}];}return db[_0x804a('0x34')][_0x804a('0x4c')](_0x40dfbf);})[_0x804a('0x19')](function(_0x558eca){_0x4cec40[_0x804a('0x4d')]=_0x558eca;return _0x4cec40;})[_0x804a('0x19')](respondWithFilteredResult(_0x2a5798,_0x40dfbf))[_0x804a('0x22')](handleError(_0x2a5798,null));};exports['show']=function(_0x1e6333,_0x3f2032){var _0x1ddc6a={'raw':![],'where':{'id':_0x1e6333[_0x804a('0x4e')]['id']}},_0x4ace71={};_0x4ace71[_0x804a('0x3b')]=_[_0x804a('0x38')](db['VoiceContext'][_0x804a('0x35')]);_0x4ace71['query']=_[_0x804a('0x38')](_0x1e6333[_0x804a('0x37')]);_0x4ace71['filters']=_[_0x804a('0x3a')](_0x4ace71[_0x804a('0x3b')],_0x4ace71['query']);_0x1ddc6a['attributes']=_[_0x804a('0x3a')](_0x4ace71['model'],qs[_0x804a('0x3d')](_0x1e6333[_0x804a('0x37')][_0x804a('0x3d')]));_0x1ddc6a[_0x804a('0x3c')]=_0x1ddc6a[_0x804a('0x3c')][_0x804a('0x4f')]?_0x1ddc6a['attributes']:_0x4ace71[_0x804a('0x3b')];if(_0x1e6333[_0x804a('0x37')][_0x804a('0x4a')]){_0x1ddc6a['include']=[{'all':!![]}];}_0x1ddc6a=_[_0x804a('0x47')]({},_0x1ddc6a,_0x1e6333['options']);return db[_0x804a('0x34')][_0x804a('0x50')](_0x1ddc6a)[_0x804a('0x19')](handleEntityNotFound(_0x3f2032,null))[_0x804a('0x19')](respondWithResult(_0x3f2032,null))[_0x804a('0x22')](handleError(_0x3f2032,null));};exports[_0x804a('0x51')]=function(_0x161a6e,_0x1362e3,_0x28781e){var _0x426f2c;return db[_0x804a('0x34')]['create'](_0x161a6e[_0x804a('0x52')],{'raw':!![]})['then'](function(_0x5d07c0){_0x426f2c=_0x5d07c0;return db[_0x804a('0x34')]['findAll']({'raw':!![]});})[_0x804a('0x19')](function(_0x10e088){var _0x39f26a=fs[_0x804a('0x53')](path[_0x804a('0x54')](config['root'],_0x804a('0x55')),_0x804a('0x56'));var _0x37e502=ejs[_0x804a('0x57')](_0x39f26a,{'contexts':_0x10e088||[]});fs['writeFileSync'](_0x804a('0x58'),_0x37e502);})[_0x804a('0x19')](function(){return respondWithRpcPromise(_0x804a('0x59'),_0x804a('0x51'),{'module':'chan_sip.so'});})['then'](function(){var _0x34029c=_0x161a6e['user'][_0x804a('0x5a')]({'plain':!![]});if(!_0x34029c)throw new Error(_0x804a('0x5b'));if(_0x34029c[_0x804a('0x5c')]===_0x804a('0x5d')){var _0x523e71=_0x426f2c[_0x804a('0x5a')]({'plain':!![]});return db['UserProfileSection'][_0x804a('0x50')]({'where':{'name':_0x804a('0x2e'),'userProfileId':_0x34029c[_0x804a('0x5e')]},'raw':!![]})['then'](function(_0x38363d){if(_0x38363d&&_0x38363d[_0x804a('0x5f')]===0x0){return db[_0x804a('0x2f')][_0x804a('0x51')]({'name':_0x523e71[_0x804a('0x46')],'resourceId':_0x523e71['id'],'type':_0x38363d['name'],'sectionId':_0x38363d['id']},{})[_0x804a('0x19')](function(){return _0x426f2c;});}else{return _0x426f2c;}})[_0x804a('0x22')](function(_0x1999eb){logger[_0x804a('0x1f')](_0x804a('0x60'),_0x1999eb);throw _0x1999eb;});}return _0x426f2c;})[_0x804a('0x19')](respondWithResult(_0x1362e3,0xc9))[_0x804a('0x22')](handleError(_0x1362e3,null));};exports[_0x804a('0x61')]=function(_0x35e822,_0x192c23,_0x5c6bfd){var _0x29e732;return db[_0x804a('0x34')][_0x804a('0x50')]({'where':{'id':_0x35e822[_0x804a('0x4e')]['id']}})[_0x804a('0x19')](handleEntityNotFound(_0x192c23,null))['then'](saveUpdates(_0x35e822[_0x804a('0x52')],null))[_0x804a('0x19')](function(_0x42a971){if(_0x42a971){_0x29e732=_0x42a971;return db[_0x804a('0x34')]['findAll']({'raw':!![]});}})[_0x804a('0x19')](function(_0x566e85){var _0x50a18e=fs[_0x804a('0x53')](path[_0x804a('0x54')](config['root'],_0x804a('0x55')),_0x804a('0x56'));var _0x5c23da=ejs[_0x804a('0x57')](_0x50a18e,{'contexts':_0x566e85||[]});fs[_0x804a('0x62')](_0x804a('0x58'),_0x5c23da);})[_0x804a('0x19')](function(){return respondWithRpcPromise(_0x804a('0x59'),_0x804a('0x61'),{'module':_0x804a('0x63')});})[_0x804a('0x19')](function(){return _0x29e732;})['then'](respondWithResult(_0x192c23,null))[_0x804a('0x22')](handleError(_0x192c23,null));};exports[_0x804a('0x2d')]=function(_0x5f4a87,_0x3547f5,_0x6f3dbc){var _0x58e57c;return db[_0x804a('0x34')][_0x804a('0x50')]({'where':{'id':_0x5f4a87[_0x804a('0x4e')]['id']}})[_0x804a('0x19')](handleEntityNotFound(_0x3547f5,null))[_0x804a('0x19')](removeEntity(_0x3547f5,null))[_0x804a('0x19')](function(){return db[_0x804a('0x34')]['findAll']({'raw':!![]});})['then'](function(_0x139d8b){var _0x3ed006=fs[_0x804a('0x53')](path[_0x804a('0x54')](config[_0x804a('0x64')],_0x804a('0x55')),_0x804a('0x56'));var _0x429a02=ejs['render'](_0x3ed006,{'contexts':_0x139d8b});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x429a02);return respondWithRpcPromise(_0x804a('0x59'),_0x804a('0x2d'),{'module':'chan_sip.so'});})[_0x804a('0x22')](handleError(_0x3547f5,null));}; \ No newline at end of file +var _0xdf3d=['sendStatus','status','end','offset','undefined','count','limit','Content-Range','save','get','Contexts','UserProfileResource','stack','name','index','map','rawAttributes','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','VoiceContext','includeAll','findAll','rows','catch','show','include','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','destroy','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xa97e50,_0x22375c){var _0x44e7b7=function(_0x3d7d33){while(--_0x3d7d33){_0xa97e50['push'](_0xa97e50['shift']());}};_0x44e7b7(++_0x22375c);}(_0xdf3d,0xfd));var _0xddf3=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xdf3d[_0x30faec];return _0x29484f;};'use strict';var emlformat=require(_0xddf3('0x0'));var rimraf=require(_0xddf3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xddf3('0x2'));var moment=require('moment');var BPromise=require(_0xddf3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xddf3('0x4'));var sox=require('sox');var csv=require(_0xddf3('0x5'));var ejs=require(_0xddf3('0x6'));var fs=require('fs');var fs_extra=require(_0xddf3('0x7'));var _=require('lodash');var squel=require(_0xddf3('0x8'));var crypto=require('crypto');var jsforce=require(_0xddf3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xddf3('0x5'));var querystring=require('querystring');var Papa=require(_0xddf3('0xa'));var Redis=require(_0xddf3('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xddf3('0xc'));var as=require(_0xddf3('0xd'));var hardwareService=require(_0xddf3('0xe'));var logger=require(_0xddf3('0xf'))('api');var utils=require(_0xddf3('0x10'));var config=require(_0xddf3('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xddf3('0x12'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xddf3('0x13')][_0xddf3('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x6f0927,_0x416812,_0x19f5a9,_0x63e6e){return new BPromise(function(_0x3003a1,_0x4a50a0){var _0x4e2010=_0x63e6e||client;return _0x4e2010[_0xddf3('0x15')](_0x6f0927,_0x19f5a9)[_0xddf3('0x16')](function(_0x560f04){logger['info'](_0xddf3('0x17'),_0x416812,_0xddf3('0x18'));logger['debug'](_0xddf3('0x19'),_0x416812,_0xddf3('0x18'),JSON[_0xddf3('0x1a')](_0x560f04));if(_0x560f04[_0xddf3('0x1b')]){if(_0x560f04[_0xddf3('0x1b')][_0xddf3('0x1c')]===0x1f4){logger[_0xddf3('0x1b')](_0xddf3('0x17'),_0x416812,_0x560f04['error'][_0xddf3('0x1d')]);return _0x4a50a0(_0x560f04[_0xddf3('0x1b')][_0xddf3('0x1d')]);}logger[_0xddf3('0x1b')](_0xddf3('0x17'),_0x416812,_0x560f04[_0xddf3('0x1b')]['message']);return _0x3003a1(_0x560f04['error']['message']);}else{logger[_0xddf3('0x1e')](_0xddf3('0x17'),_0x416812,_0xddf3('0x18'));_0x3003a1(_0x560f04[_0xddf3('0x1f')][_0xddf3('0x1d')]);}})['catch'](function(_0x1d7376){logger[_0xddf3('0x1b')](_0xddf3('0x17'),_0x416812,_0x1d7376);_0x4a50a0(_0x1d7376);});});}function respondWithStatusCode(_0x256167,_0x5ed21a){_0x5ed21a=_0x5ed21a||0xcc;return function(_0x51e397){if(_0x51e397){return _0x256167[_0xddf3('0x20')](_0x5ed21a);}return _0x256167[_0xddf3('0x21')](_0x5ed21a)[_0xddf3('0x22')]();};}function respondWithResult(_0x216847,_0x1da827){_0x1da827=_0x1da827||0xc8;return function(_0x1e9d46){if(_0x1e9d46){return _0x216847[_0xddf3('0x21')](_0x1da827)['json'](_0x1e9d46);}};}function respondWithFilteredResult(_0x41e324,_0x1e6e17){return function(_0x5a46ee){if(_0x5a46ee){var _0x1c2655=typeof _0x1e6e17[_0xddf3('0x23')]===_0xddf3('0x24')&&typeof _0x1e6e17['limit']===_0xddf3('0x24');var _0x1d33f5=_0x5a46ee[_0xddf3('0x25')];var _0x4b0b60=_0x1c2655?0x0:_0x1e6e17[_0xddf3('0x23')];var _0x40d984=_0x1c2655?_0x5a46ee[_0xddf3('0x25')]:_0x1e6e17[_0xddf3('0x23')]+_0x1e6e17[_0xddf3('0x26')];var _0x2c7311;if(_0x40d984>=_0x1d33f5){_0x40d984=_0x1d33f5;_0x2c7311=0xc8;}else{_0x2c7311=0xce;}_0x41e324[_0xddf3('0x21')](_0x2c7311);return _0x41e324['set'](_0xddf3('0x27'),_0x4b0b60+'-'+_0x40d984+'/'+_0x1d33f5)['json'](_0x5a46ee);}return null;};}function patchUpdates(_0x3ba55c){return function(_0x734796){try{jsonpatch['apply'](_0x734796,_0x3ba55c,!![]);}catch(_0x18050d){return BPromise['reject'](_0x18050d);}return _0x734796[_0xddf3('0x28')]();};}function saveUpdates(_0x2f79f9,_0x89385b){return function(_0xd4c750){if(_0xd4c750){return _0xd4c750['update'](_0x2f79f9)[_0xddf3('0x16')](function(_0x1884bd){return _0x1884bd;});}return null;};}function removeEntity(_0x364d6a,_0x34f13c){return function(_0x381a1c){if(_0x381a1c){return _0x381a1c['destroy']()[_0xddf3('0x16')](function(){var _0x37120c=_0x381a1c[_0xddf3('0x29')]({'plain':!![]});var _0x39a979=_0xddf3('0x2a');return db[_0xddf3('0x2b')]['destroy']({'where':{'type':_0x39a979,'resourceId':_0x37120c['id']}})[_0xddf3('0x16')](function(){return _0x381a1c;});})['then'](function(){_0x364d6a[_0xddf3('0x21')](0xcc)[_0xddf3('0x22')]();});}};}function handleEntityNotFound(_0x268456,_0x1b7f0f){return function(_0x4bbf5d){if(!_0x4bbf5d){_0x268456['sendStatus'](0x194);}return _0x4bbf5d;};}function handleError(_0x4d153a,_0x96e3ad){_0x96e3ad=_0x96e3ad||0x1f4;return function(_0x4d611c){logger[_0xddf3('0x1b')](_0x4d611c[_0xddf3('0x2c')]);if(_0x4d611c[_0xddf3('0x2d')]){delete _0x4d611c[_0xddf3('0x2d')];}_0x4d153a[_0xddf3('0x21')](_0x96e3ad)['send'](_0x4d611c);};}exports[_0xddf3('0x2e')]=function(_0x1fa7a9,_0x1a0b71){var _0x26c25a={},_0x5e3c9e={},_0x197d27={'count':0x0,'rows':[]};var _0x3dcb4b=_[_0xddf3('0x2f')](db['VoiceContext'][_0xddf3('0x30')],function(_0x58179b){return{'name':_0x58179b['fieldName'],'type':_0x58179b[_0xddf3('0x31')][_0xddf3('0x32')]};});_0x5e3c9e[_0xddf3('0x33')]=_[_0xddf3('0x2f')](_0x3dcb4b,_0xddf3('0x2d'));_0x5e3c9e['query']=_[_0xddf3('0x34')](_0x1fa7a9['query']);_0x5e3c9e['filters']=_[_0xddf3('0x35')](_0x5e3c9e[_0xddf3('0x33')],_0x5e3c9e[_0xddf3('0x36')]);_0x26c25a[_0xddf3('0x37')]=_['intersection'](_0x5e3c9e[_0xddf3('0x33')],qs[_0xddf3('0x38')](_0x1fa7a9[_0xddf3('0x36')][_0xddf3('0x38')]));_0x26c25a[_0xddf3('0x37')]=_0x26c25a[_0xddf3('0x37')][_0xddf3('0x39')]?_0x26c25a[_0xddf3('0x37')]:_0x5e3c9e[_0xddf3('0x33')];if(!_0x1fa7a9['query'][_0xddf3('0x3a')](_0xddf3('0x3b'))){_0x26c25a[_0xddf3('0x26')]=qs['limit'](_0x1fa7a9[_0xddf3('0x36')][_0xddf3('0x26')]);_0x26c25a[_0xddf3('0x23')]=qs[_0xddf3('0x23')](_0x1fa7a9[_0xddf3('0x36')][_0xddf3('0x23')]);}_0x26c25a[_0xddf3('0x3c')]=qs['sort'](_0x1fa7a9[_0xddf3('0x36')]['sort']);_0x26c25a[_0xddf3('0x3d')]=qs['filters'](_[_0xddf3('0x3e')](_0x1fa7a9[_0xddf3('0x36')],_0x5e3c9e['filters']),_0x3dcb4b);if(_0x1fa7a9['query']['filter']){_0x26c25a[_0xddf3('0x3d')]=_['merge'](_0x26c25a[_0xddf3('0x3d')],{'$or':_[_0xddf3('0x2f')](_0x3dcb4b,function(_0x1955c2){if(_0x1955c2[_0xddf3('0x31')]!=='VIRTUAL'){var _0x246238={};_0x246238[_0x1955c2[_0xddf3('0x2d')]]={'$like':'%'+_0x1fa7a9[_0xddf3('0x36')][_0xddf3('0x3f')]+'%'};return _0x246238;}})});}_0x26c25a=_[_0xddf3('0x40')]({},_0x26c25a,_0x1fa7a9[_0xddf3('0x41')]);var _0x5ae19c={'where':_0x26c25a[_0xddf3('0x3d')]};return db[_0xddf3('0x42')]['count'](_0x5ae19c)[_0xddf3('0x16')](function(_0x13c586){_0x197d27['count']=_0x13c586;if(_0x1fa7a9[_0xddf3('0x36')][_0xddf3('0x43')]){_0x26c25a['include']=[{'all':!![]}];}return db[_0xddf3('0x42')][_0xddf3('0x44')](_0x26c25a);})[_0xddf3('0x16')](function(_0x32dc10){_0x197d27[_0xddf3('0x45')]=_0x32dc10;return _0x197d27;})[_0xddf3('0x16')](respondWithFilteredResult(_0x1a0b71,_0x26c25a))[_0xddf3('0x46')](handleError(_0x1a0b71,null));};exports[_0xddf3('0x47')]=function(_0x2193cc,_0x33a6f2){var _0x46ba60={'raw':![],'where':{'id':_0x2193cc['params']['id']}},_0x2ea739={};_0x2ea739[_0xddf3('0x33')]=_[_0xddf3('0x34')](db[_0xddf3('0x42')][_0xddf3('0x30')]);_0x2ea739[_0xddf3('0x36')]=_[_0xddf3('0x34')](_0x2193cc[_0xddf3('0x36')]);_0x2ea739['filters']=_[_0xddf3('0x35')](_0x2ea739[_0xddf3('0x33')],_0x2ea739[_0xddf3('0x36')]);_0x46ba60[_0xddf3('0x37')]=_['intersection'](_0x2ea739[_0xddf3('0x33')],qs[_0xddf3('0x38')](_0x2193cc[_0xddf3('0x36')]['fields']));_0x46ba60[_0xddf3('0x37')]=_0x46ba60[_0xddf3('0x37')][_0xddf3('0x39')]?_0x46ba60['attributes']:_0x2ea739[_0xddf3('0x33')];if(_0x2193cc[_0xddf3('0x36')]['includeAll']){_0x46ba60[_0xddf3('0x48')]=[{'all':!![]}];}_0x46ba60=_[_0xddf3('0x40')]({},_0x46ba60,_0x2193cc[_0xddf3('0x41')]);return db[_0xddf3('0x42')]['find'](_0x46ba60)[_0xddf3('0x16')](handleEntityNotFound(_0x33a6f2,null))[_0xddf3('0x16')](respondWithResult(_0x33a6f2,null))[_0xddf3('0x46')](handleError(_0x33a6f2,null));};exports['create']=function(_0x22aedf,_0x1ede5a,_0xc767d2){var _0x2ad977;return db[_0xddf3('0x42')][_0xddf3('0x49')](_0x22aedf[_0xddf3('0x4a')],{'raw':!![]})[_0xddf3('0x16')](function(_0x3a93c8){_0x2ad977=_0x3a93c8;return db[_0xddf3('0x42')]['findAll']({'raw':!![]});})[_0xddf3('0x16')](function(_0x7f2e24){var _0x19aa7a=fs[_0xddf3('0x4b')](path[_0xddf3('0x4c')](config[_0xddf3('0x4d')],_0xddf3('0x4e')),_0xddf3('0x4f'));var _0x49719f=ejs[_0xddf3('0x50')](_0x19aa7a,{'contexts':_0x7f2e24||[]});fs[_0xddf3('0x51')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x49719f);})['then'](function(){return respondWithRpcPromise('Reload',_0xddf3('0x49'),{'module':_0xddf3('0x52')});})[_0xddf3('0x16')](function(){var _0x3df680=_0x22aedf['user'][_0xddf3('0x29')]({'plain':!![]});if(!_0x3df680)throw new Error(_0xddf3('0x53'));if(_0x3df680[_0xddf3('0x54')]===_0xddf3('0x55')){var _0x45a40b=_0x2ad977[_0xddf3('0x29')]({'plain':!![]});return db[_0xddf3('0x56')][_0xddf3('0x57')]({'where':{'name':_0xddf3('0x2a'),'userProfileId':_0x3df680[_0xddf3('0x58')]},'raw':!![]})[_0xddf3('0x16')](function(_0x26e1ed){if(_0x26e1ed&&_0x26e1ed[_0xddf3('0x59')]===0x0){return db['UserProfileResource'][_0xddf3('0x49')]({'name':_0x45a40b[_0xddf3('0x2d')],'resourceId':_0x45a40b['id'],'type':_0x26e1ed[_0xddf3('0x2d')],'sectionId':_0x26e1ed['id']},{})['then'](function(){return _0x2ad977;});}else{return _0x2ad977;}})[_0xddf3('0x46')](function(_0x1d7d72){logger['error'](_0xddf3('0x5a'),_0x1d7d72);throw _0x1d7d72;});}return _0x2ad977;})[_0xddf3('0x16')](respondWithResult(_0x1ede5a,0xc9))['catch'](handleError(_0x1ede5a,null));};exports[_0xddf3('0x5b')]=function(_0x36ef64,_0x5e65d1,_0xd265d2){var _0x3b9900;return db['VoiceContext'][_0xddf3('0x57')]({'where':{'id':_0x36ef64[_0xddf3('0x5c')]['id']}})[_0xddf3('0x16')](handleEntityNotFound(_0x5e65d1,null))[_0xddf3('0x16')](saveUpdates(_0x36ef64[_0xddf3('0x4a')],null))[_0xddf3('0x16')](function(_0x46c848){if(_0x46c848){_0x3b9900=_0x46c848;return db[_0xddf3('0x42')][_0xddf3('0x44')]({'raw':!![]});}})['then'](function(_0x8480d9){var _0x27efe7=fs[_0xddf3('0x4b')](path['join'](config[_0xddf3('0x4d')],_0xddf3('0x4e')),_0xddf3('0x4f'));var _0x57a0fc=ejs['render'](_0x27efe7,{'contexts':_0x8480d9||[]});fs[_0xddf3('0x51')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x57a0fc);})[_0xddf3('0x16')](function(){return respondWithRpcPromise('Reload',_0xddf3('0x5b'),{'module':_0xddf3('0x52')});})[_0xddf3('0x16')](function(){return _0x3b9900;})['then'](respondWithResult(_0x5e65d1,null))[_0xddf3('0x46')](handleError(_0x5e65d1,null));};exports[_0xddf3('0x5d')]=function(_0x34a5fa,_0x1bdd57,_0x2a151e){var _0x247de1;return db[_0xddf3('0x42')][_0xddf3('0x57')]({'where':{'id':_0x34a5fa['params']['id']}})['then'](handleEntityNotFound(_0x1bdd57,null))[_0xddf3('0x16')](removeEntity(_0x1bdd57,null))[_0xddf3('0x16')](function(){return db['VoiceContext'][_0xddf3('0x44')]({'raw':!![]});})[_0xddf3('0x16')](function(_0x3848eb){var _0x531456=fs[_0xddf3('0x4b')](path[_0xddf3('0x4c')](config[_0xddf3('0x4d')],_0xddf3('0x4e')),'utf8');var _0x254776=ejs[_0xddf3('0x50')](_0x531456,{'contexts':_0x3848eb});fs['writeFileSync'](_0xddf3('0x5e'),_0x254776);return respondWithRpcPromise('Reload',_0xddf3('0x5d'),{'module':_0xddf3('0x52')});})['catch'](handleError(_0x1bdd57,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 39ec8a1..69c7a2c 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 _0x0ee6=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash','util'];(function(_0x368b0c,_0x20da2e){var _0x11da70=function(_0x5c1865){while(--_0x5c1865){_0x368b0c['push'](_0x368b0c['shift']());}};_0x11da70(++_0x20da2e);}(_0x0ee6,0x106));var _0x60ee=function(_0x548647,_0x127146){_0x548647=_0x548647-0x0;var _0x5af8be=_0x0ee6[_0x548647];return _0x5af8be;};'use strict';var _=require(_0x60ee('0x0'));var util=require(_0x60ee('0x1'));var logger=require('../../config/logger')(_0x60ee('0x2'));var moment=require(_0x60ee('0x3'));var BPromise=require(_0x60ee('0x4'));var rp=require(_0x60ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60ee('0x6'));var config=require(_0x60ee('0x7'));var attributes=require(_0x60ee('0x8'));module[_0x60ee('0x9')]=function(_0x43b019,_0x49ba32){return _0x43b019['define'](_0x60ee('0xa'),attributes,{'tableName':_0x60ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfffd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger','api'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xfffd,0xea));var _0xdfff=function(_0x24de02,_0x11dce3){_0x24de02=_0x24de02-0x0;var _0x462f03=_0xfffd[_0x24de02];return _0x462f03;};'use strict';var _=require(_0xdfff('0x0'));var util=require(_0xdfff('0x1'));var logger=require(_0xdfff('0x2'))(_0xdfff('0x3'));var moment=require(_0xdfff('0x4'));var BPromise=require(_0xdfff('0x5'));var rp=require(_0xdfff('0x6'));var fs=require('fs');var path=require(_0xdfff('0x7'));var rimraf=require(_0xdfff('0x8'));var config=require(_0xdfff('0x9'));var attributes=require(_0xdfff('0xa'));module[_0xdfff('0xb')]=function(_0x3addb0,_0x566763){return _0x3addb0[_0xdfff('0xc')]('VoiceContext',attributes,{'tableName':_0xdfff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index c745ece..546bab2 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 _0x608a=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info'];(function(_0x13f93d,_0x40f289){var _0x26e77c=function(_0x575de3){while(--_0x575de3){_0x13f93d['push'](_0x13f93d['shift']());}};_0x26e77c(++_0x40f289);}(_0x608a,0xff));var _0xa608=function(_0x39578e,_0x40b029){_0x39578e=_0x39578e-0x0;var _0x145744=_0x608a[_0x39578e];return _0x145744;};'use strict';var _=require('lodash');var util=require(_0xa608('0x0'));var moment=require(_0xa608('0x1'));var BPromise=require('bluebird');var rs=require(_0xa608('0x2'));var fs=require('fs');var Redis=require(_0xa608('0x3'));var db=require(_0xa608('0x4'))['db'];var utils=require(_0xa608('0x5'));var logger=require('../../config/logger')(_0xa608('0x6'));var config=require(_0xa608('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa608('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50395e,_0x2a2408,_0x46d6a7){return new BPromise(function(_0x6d5537,_0x516260){return client[_0xa608('0x9')](_0x50395e,_0x46d6a7)['then'](function(_0x27c4c4){logger[_0xa608('0xa')]('VoiceContext,\x20%s,\x20%s',_0x2a2408,_0xa608('0xb'));logger[_0xa608('0xc')](_0xa608('0xd'),_0x2a2408,_0xa608('0xb'),JSON['stringify'](_0x27c4c4));if(_0x27c4c4[_0xa608('0xe')]){if(_0x27c4c4[_0xa608('0xe')][_0xa608('0xf')]===0x1f4){logger[_0xa608('0xe')](_0xa608('0x10'),_0x2a2408,_0x27c4c4['error'][_0xa608('0x11')]);return _0x516260(_0x27c4c4[_0xa608('0xe')]['message']);}logger['error'](_0xa608('0x10'),_0x2a2408,_0x27c4c4[_0xa608('0xe')][_0xa608('0x11')]);return _0x6d5537(_0x27c4c4[_0xa608('0xe')]['message']);}else{logger[_0xa608('0xa')](_0xa608('0x10'),_0x2a2408,'request\x20sent');_0x6d5537(_0x27c4c4[_0xa608('0x12')][_0xa608('0x11')]);}})['catch'](function(_0x573bc7){logger['error'](_0xa608('0x10'),_0x2a2408,_0x573bc7);_0x516260(_0x573bc7);});});} \ No newline at end of file +var _0x3c32=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x316f03,_0x1a7edd){var _0x3f77b9=function(_0x2d0b4c){while(--_0x2d0b4c){_0x316f03['push'](_0x316f03['shift']());}};_0x3f77b9(++_0x1a7edd);}(_0x3c32,0x161));var _0x23c3=function(_0x1d71b8,_0x156409){_0x1d71b8=_0x1d71b8-0x0;var _0xeee915=_0x3c32[_0x1d71b8];return _0xeee915;};'use strict';var _=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var moment=require(_0x23c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x23c3('0x3'));var fs=require('fs');var Redis=require(_0x23c3('0x4'));var db=require(_0x23c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c3('0x6'))('rpc');var config=require(_0x23c3('0x7'));var jayson=require(_0x23c3('0x8'));var client=jayson[_0x23c3('0x9')][_0x23c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a6364,_0x56568e,_0x493ca6){return new BPromise(function(_0x4df5ee,_0x422558){return client[_0x23c3('0xb')](_0x4a6364,_0x493ca6)[_0x23c3('0xc')](function(_0x420987){logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));logger[_0x23c3('0x10')](_0x23c3('0x11'),_0x56568e,_0x23c3('0xf'),JSON[_0x23c3('0x12')](_0x420987));if(_0x420987[_0x23c3('0x13')]){if(_0x420987[_0x23c3('0x13')][_0x23c3('0x14')]===0x1f4){logger[_0x23c3('0x13')](_0x23c3('0xe'),_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x422558(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x4df5ee(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}else{logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));_0x4df5ee(_0x420987['result']['message']);}})[_0x23c3('0x16')](function(_0x43534b){logger['error'](_0x23c3('0xe'),_0x56568e,_0x43534b);_0x422558(_0x43534b);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 7ff525d..9b7fc15 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 _0x50ab=['../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4fa693,_0x56a655){var _0x58afed=function(_0x4573af){while(--_0x4573af){_0x4fa693['push'](_0x4fa693['shift']());}};_0x58afed(++_0x56a655);}(_0x50ab,0xf1));var _0xb50a=function(_0x45f864,_0x11ce66){_0x45f864=_0x45f864-0x0;var _0x4ed958=_0x50ab[_0x45f864];return _0x4ed958;};'use strict';var multer=require('multer');var util=require(_0xb50a('0x0'));var path=require(_0xb50a('0x1'));var timeout=require(_0xb50a('0x2'));var express=require(_0xb50a('0x3'));var router=express[_0xb50a('0x4')]();var fs_extra=require(_0xb50a('0x5'));var auth=require(_0xb50a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb50a('0x7'));var controller=require(_0xb50a('0x8'));router['get']('/',auth[_0xb50a('0x9')](),controller['index']);router[_0xb50a('0xa')](_0xb50a('0xb'),auth[_0xb50a('0x9')](),controller[_0xb50a('0xc')]);router['get'](_0xb50a('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb50a('0x9')](),controller[_0xb50a('0xe')]);router['put'](_0xb50a('0xd'),auth[_0xb50a('0x9')](),controller[_0xb50a('0xf')]);router[_0xb50a('0x10')]('/:id',auth[_0xb50a('0x9')](),controller[_0xb50a('0x11')]);module[_0xb50a('0x12')]=router; \ No newline at end of file +var _0xd5f9=['show','post','create','put','update','delete','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3f5425,_0x14ff38){var _0x3397a2=function(_0x106330){while(--_0x106330){_0x3f5425['push'](_0x3f5425['shift']());}};_0x3397a2(++_0x14ff38);}(_0xd5f9,0xbb));var _0x9d5f=function(_0x459b3e,_0x5a0c7a){_0x459b3e=_0x459b3e-0x0;var _0xaf15e4=_0xd5f9[_0x459b3e];return _0xaf15e4;};'use strict';var multer=require('multer');var util=require(_0x9d5f('0x0'));var path=require(_0x9d5f('0x1'));var timeout=require(_0x9d5f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9d5f('0x3'));var auth=require(_0x9d5f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9d5f('0x5'));var controller=require(_0x9d5f('0x6'));router[_0x9d5f('0x7')]('/',auth[_0x9d5f('0x8')](),controller[_0x9d5f('0x9')]);router['get'](_0x9d5f('0xa'),auth[_0x9d5f('0x8')](),controller[_0x9d5f('0xb')]);router[_0x9d5f('0x7')](_0x9d5f('0xc'),auth[_0x9d5f('0x8')](),controller[_0x9d5f('0xd')]);router[_0x9d5f('0xe')]('/',auth[_0x9d5f('0x8')](),controller[_0x9d5f('0xf')]);router[_0x9d5f('0x10')]('/:id',auth[_0x9d5f('0x8')](),controller[_0x9d5f('0x11')]);router[_0x9d5f('0x12')]('/:id',auth[_0x9d5f('0x8')](),controller['destroy']);module[_0x9d5f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index f8605cb..97ed70b 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file +var _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0xe9f514,_0x5353d){var _0x4fc053=function(_0x3b14ae){while(--_0x3b14ae){_0xe9f514['push'](_0xe9f514['shift']());}};_0x4fc053(++_0x5353d);}(_0x6aa7,0x178));var _0x76aa=function(_0x7cfb35,_0x4882a2){_0x7cfb35=_0x7cfb35-0x0;var _0x3eda73=_0x6aa7[_0x7cfb35];return _0x3eda73;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 716f394..b10fcd2 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 _0x31d3=['rawAttributes','length','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params'];(function(_0x903eeb,_0x322ebe){var _0x36a1f1=function(_0x5b4924){while(--_0x5b4924){_0x903eeb['push'](_0x903eeb['shift']());}};_0x36a1f1(++_0x322ebe);}(_0x31d3,0x12c));var _0x331d=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x31d3[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0x331d('0x0'));var rimraf=require(_0x331d('0x1'));var zipdir=require(_0x331d('0x2'));var jsonpatch=require(_0x331d('0x3'));var rp=require(_0x331d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x331d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x331d('0x6'));var fs=require('fs');var fs_extra=require(_0x331d('0x7'));var _=require(_0x331d('0x8'));var squel=require('squel');var crypto=require(_0x331d('0x9'));var jsforce=require(_0x331d('0xa'));var deskjs=require(_0x331d('0xb'));var toCsv=require(_0x331d('0xc'));var querystring=require(_0x331d('0xd'));var Papa=require(_0x331d('0xe'));var Redis=require(_0x331d('0xf'));var authService=require(_0x331d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x331d('0x11'));var hardwareService=require(_0x331d('0x12'));var logger=require(_0x331d('0x13'))(_0x331d('0x14'));var utils=require('../../config/utils');var config=require(_0x331d('0x15'));var licenseUtil=require(_0x331d('0x16'));var db=require(_0x331d('0x17'))['db'];function respondWithStatusCode(_0x35bc72,_0x256bd4){_0x256bd4=_0x256bd4||0xcc;return function(_0x50eebb){if(_0x50eebb){return _0x35bc72['sendStatus'](_0x256bd4);}return _0x35bc72[_0x331d('0x18')](_0x256bd4)[_0x331d('0x19')]();};}function respondWithResult(_0x36938c,_0x3fd705){_0x3fd705=_0x3fd705||0xc8;return function(_0x56ffb5){if(_0x56ffb5){return _0x36938c[_0x331d('0x18')](_0x3fd705)[_0x331d('0x1a')](_0x56ffb5);}};}function respondWithFilteredResult(_0x59b9c4,_0x3e2010){return function(_0x269444){if(_0x269444){var _0x1e133b=typeof _0x3e2010[_0x331d('0x1b')]===_0x331d('0x1c')&&typeof _0x3e2010[_0x331d('0x1d')]===_0x331d('0x1c');var _0x2cec3a=_0x269444[_0x331d('0x1e')];var _0x408a33=_0x1e133b?0x0:_0x3e2010[_0x331d('0x1b')];var _0x10661c=_0x1e133b?_0x269444[_0x331d('0x1e')]:_0x3e2010[_0x331d('0x1b')]+_0x3e2010[_0x331d('0x1d')];var _0x1c57a6;if(_0x10661c>=_0x2cec3a){_0x10661c=_0x2cec3a;_0x1c57a6=0xc8;}else{_0x1c57a6=0xce;}_0x59b9c4['status'](_0x1c57a6);return _0x59b9c4[_0x331d('0x1f')](_0x331d('0x20'),_0x408a33+'-'+_0x10661c+'/'+_0x2cec3a)[_0x331d('0x1a')](_0x269444);}return null;};}function patchUpdates(_0x541623){return function(_0x3c537f){try{jsonpatch['apply'](_0x3c537f,_0x541623,!![]);}catch(_0x5a7b4d){return BPromise[_0x331d('0x21')](_0x5a7b4d);}return _0x3c537f[_0x331d('0x22')]();};}function saveUpdates(_0x2aa7a4,_0x3a6a25){return function(_0x4989bd){if(_0x4989bd){return _0x4989bd['update'](_0x2aa7a4)[_0x331d('0x23')](function(_0x46cef4){return _0x46cef4;});}return null;};}function removeEntity(_0x159427,_0xa634a6){return function(_0x25445d){if(_0x25445d){return _0x25445d['destroy']()[_0x331d('0x23')](function(){_0x159427[_0x331d('0x18')](0xcc)[_0x331d('0x19')]();});}};}function handleEntityNotFound(_0x257aab,_0x38d623){return function(_0x2b1970){if(!_0x2b1970){_0x257aab['sendStatus'](0x194);}return _0x2b1970;};}function handleError(_0x18f5d1,_0x543aa6){_0x543aa6=_0x543aa6||0x1f4;return function(_0x28a0d3){logger[_0x331d('0x24')](_0x28a0d3[_0x331d('0x25')]);if(_0x28a0d3[_0x331d('0x26')]){delete _0x28a0d3[_0x331d('0x26')];}_0x18f5d1['status'](_0x543aa6)[_0x331d('0x27')](_0x28a0d3);};}exports['index']=function(_0x1fa8f2,_0x3cc12d){var _0x165a14={},_0x82caf0={},_0x449ced={'count':0x0,'rows':[]};var _0x278083=_[_0x331d('0x28')](db[_0x331d('0x29')]['rawAttributes'],function(_0x15611d){return{'name':_0x15611d[_0x331d('0x2a')],'type':_0x15611d[_0x331d('0x2b')][_0x331d('0x2c')]};});_0x82caf0[_0x331d('0x2d')]=_[_0x331d('0x28')](_0x278083,_0x331d('0x26'));_0x82caf0[_0x331d('0x2e')]=_[_0x331d('0x2f')](_0x1fa8f2[_0x331d('0x2e')]);_0x82caf0[_0x331d('0x30')]=_[_0x331d('0x31')](_0x82caf0['model'],_0x82caf0[_0x331d('0x2e')]);_0x165a14[_0x331d('0x32')]=_[_0x331d('0x31')](_0x82caf0[_0x331d('0x2d')],qs[_0x331d('0x33')](_0x1fa8f2[_0x331d('0x2e')]['fields']));_0x165a14[_0x331d('0x32')]=_0x165a14[_0x331d('0x32')]['length']?_0x165a14['attributes']:_0x82caf0[_0x331d('0x2d')];if(!_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x34')](_0x331d('0x35'))){_0x165a14[_0x331d('0x1d')]=qs[_0x331d('0x1d')](_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x1d')]);_0x165a14[_0x331d('0x1b')]=qs[_0x331d('0x1b')](_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x1b')]);}_0x165a14['order']=qs[_0x331d('0x36')](_0x1fa8f2['query'][_0x331d('0x36')]);_0x165a14[_0x331d('0x37')]=qs['filters'](_[_0x331d('0x38')](_0x1fa8f2[_0x331d('0x2e')],_0x82caf0[_0x331d('0x30')]),_0x278083);if(_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x39')]){_0x165a14[_0x331d('0x37')]=_[_0x331d('0x3a')](_0x165a14['where'],{'$or':_['map'](_0x278083,function(_0x3fdce3){if(_0x3fdce3[_0x331d('0x2b')]!=='VIRTUAL'){var _0x1d3373={};_0x1d3373[_0x3fdce3['name']]={'$like':'%'+_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x39')]+'%'};return _0x1d3373;}})});}_0x165a14=_[_0x331d('0x3a')]({},_0x165a14,_0x1fa8f2[_0x331d('0x3b')]);var _0xa8ac9c={'where':_0x165a14['where']};return db[_0x331d('0x29')]['count'](_0xa8ac9c)[_0x331d('0x23')](function(_0x274a44){_0x449ced[_0x331d('0x1e')]=_0x274a44;if(_0x1fa8f2[_0x331d('0x2e')][_0x331d('0x3c')]){_0x165a14['include']=[{'all':!![]}];}return db[_0x331d('0x29')][_0x331d('0x3d')](_0x165a14);})[_0x331d('0x23')](function(_0x3b87fb){_0x449ced['rows']=_0x3b87fb;return _0x449ced;})[_0x331d('0x23')](respondWithFilteredResult(_0x3cc12d,_0x165a14))[_0x331d('0x3e')](handleError(_0x3cc12d,null));};exports[_0x331d('0x3f')]=function(_0x5abc12,_0x2d8900){var _0x12bb6f={'raw':!![],'where':{'id':_0x5abc12[_0x331d('0x40')]['id']}},_0xec7dea={};_0xec7dea[_0x331d('0x2d')]=_['keys'](db[_0x331d('0x29')][_0x331d('0x41')]);_0xec7dea[_0x331d('0x2e')]=_[_0x331d('0x2f')](_0x5abc12[_0x331d('0x2e')]);_0xec7dea[_0x331d('0x30')]=_['intersection'](_0xec7dea[_0x331d('0x2d')],_0xec7dea[_0x331d('0x2e')]);_0x12bb6f[_0x331d('0x32')]=_['intersection'](_0xec7dea['model'],qs[_0x331d('0x33')](_0x5abc12[_0x331d('0x2e')][_0x331d('0x33')]));_0x12bb6f[_0x331d('0x32')]=_0x12bb6f['attributes'][_0x331d('0x42')]?_0x12bb6f[_0x331d('0x32')]:_0xec7dea[_0x331d('0x2d')];if(_0x5abc12[_0x331d('0x2e')][_0x331d('0x3c')]){_0x12bb6f[_0x331d('0x43')]=[{'all':!![]}];}_0x12bb6f=_['merge']({},_0x12bb6f,_0x5abc12[_0x331d('0x3b')]);return db[_0x331d('0x29')][_0x331d('0x44')](_0x12bb6f)[_0x331d('0x23')](handleEntityNotFound(_0x2d8900,null))[_0x331d('0x23')](respondWithResult(_0x2d8900,null))[_0x331d('0x3e')](handleError(_0x2d8900,null));};exports[_0x331d('0x45')]=function(_0x17f0f8,_0x461a7e){return db[_0x331d('0x29')]['create'](_0x17f0f8[_0x331d('0x46')],{})[_0x331d('0x23')](respondWithResult(_0x461a7e,0xc9))[_0x331d('0x3e')](handleError(_0x461a7e,null));};exports[_0x331d('0x47')]=function(_0x578135,_0x13cc8b){if(_0x578135['body']['id']){delete _0x578135['body']['id'];}return db[_0x331d('0x29')][_0x331d('0x44')]({'where':{'id':_0x578135[_0x331d('0x40')]['id']}})['then'](handleEntityNotFound(_0x13cc8b,null))['then'](saveUpdates(_0x578135[_0x331d('0x46')],null))['then'](respondWithResult(_0x13cc8b,null))[_0x331d('0x3e')](handleError(_0x13cc8b,null));};exports['destroy']=function(_0x1b464b,_0x456f54){return db[_0x331d('0x29')][_0x331d('0x44')]({'where':{'id':_0x1b464b[_0x331d('0x40')]['id']}})[_0x331d('0x23')](handleEntityNotFound(_0x456f54,null))[_0x331d('0x23')](removeEntity(_0x456f54,null))[_0x331d('0x3e')](handleError(_0x456f54,null));};exports[_0x331d('0x48')]=function(_0x342755,_0x5071ad){return db[_0x331d('0x29')][_0x331d('0x48')]()[_0x331d('0x23')](respondWithResult(_0x5071ad,null))[_0x331d('0x3e')](handleError(_0x5071ad,null));}; \ No newline at end of file +var _0x31ed=['update','destroy','then','error','stack','send','map','VoiceDialReport','rawAttributes','fieldName','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0x31ed,0xbe));var _0xd31e=function(_0xd5d1b4,_0x1f1210){_0xd5d1b4=_0xd5d1b4-0x0;var _0x57983c=_0x31ed[_0xd5d1b4];return _0x57983c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd31e('0x0'));var zipdir=require(_0xd31e('0x1'));var jsonpatch=require(_0xd31e('0x2'));var rp=require(_0xd31e('0x3'));var moment=require(_0xd31e('0x4'));var BPromise=require(_0xd31e('0x5'));var Mustache=require('mustache');var util=require(_0xd31e('0x6'));var path=require('path');var sox=require(_0xd31e('0x7'));var csv=require(_0xd31e('0x8'));var ejs=require(_0xd31e('0x9'));var fs=require('fs');var fs_extra=require(_0xd31e('0xa'));var _=require(_0xd31e('0xb'));var squel=require('squel');var crypto=require(_0xd31e('0xc'));var jsforce=require(_0xd31e('0xd'));var deskjs=require(_0xd31e('0xe'));var toCsv=require(_0xd31e('0x8'));var querystring=require(_0xd31e('0xf'));var Papa=require('papaparse');var Redis=require(_0xd31e('0x10'));var authService=require(_0xd31e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd31e('0x12'));var hardwareService=require(_0xd31e('0x13'));var logger=require('../../config/logger')(_0xd31e('0x14'));var utils=require(_0xd31e('0x15'));var config=require(_0xd31e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd31e('0x17'))['db'];function respondWithStatusCode(_0x12eff8,_0x8dc217){_0x8dc217=_0x8dc217||0xcc;return function(_0x4b8710){if(_0x4b8710){return _0x12eff8[_0xd31e('0x18')](_0x8dc217);}return _0x12eff8[_0xd31e('0x19')](_0x8dc217)[_0xd31e('0x1a')]();};}function respondWithResult(_0x29f144,_0x3e0dba){_0x3e0dba=_0x3e0dba||0xc8;return function(_0x36189d){if(_0x36189d){return _0x29f144[_0xd31e('0x19')](_0x3e0dba)[_0xd31e('0x1b')](_0x36189d);}};}function respondWithFilteredResult(_0x413a79,_0x1b19fc){return function(_0x20d8f9){if(_0x20d8f9){var _0x506474=typeof _0x1b19fc['offset']===_0xd31e('0x1c')&&typeof _0x1b19fc['limit']===_0xd31e('0x1c');var _0x553b10=_0x20d8f9[_0xd31e('0x1d')];var _0x280b2d=_0x506474?0x0:_0x1b19fc[_0xd31e('0x1e')];var _0x1a0955=_0x506474?_0x20d8f9[_0xd31e('0x1d')]:_0x1b19fc['offset']+_0x1b19fc['limit'];var _0x3dfdc2;if(_0x1a0955>=_0x553b10){_0x1a0955=_0x553b10;_0x3dfdc2=0xc8;}else{_0x3dfdc2=0xce;}_0x413a79[_0xd31e('0x19')](_0x3dfdc2);return _0x413a79[_0xd31e('0x1f')](_0xd31e('0x20'),_0x280b2d+'-'+_0x1a0955+'/'+_0x553b10)['json'](_0x20d8f9);}return null;};}function patchUpdates(_0x58ddc3){return function(_0x311393){try{jsonpatch[_0xd31e('0x21')](_0x311393,_0x58ddc3,!![]);}catch(_0x4c2779){return BPromise[_0xd31e('0x22')](_0x4c2779);}return _0x311393['save']();};}function saveUpdates(_0x1cd0dc,_0x336418){return function(_0x1061b9){if(_0x1061b9){return _0x1061b9[_0xd31e('0x23')](_0x1cd0dc)['then'](function(_0x2f51e1){return _0x2f51e1;});}return null;};}function removeEntity(_0x347366,_0x482161){return function(_0xd28672){if(_0xd28672){return _0xd28672[_0xd31e('0x24')]()[_0xd31e('0x25')](function(){_0x347366[_0xd31e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15de80,_0x1e3058){return function(_0x5ee5ab){if(!_0x5ee5ab){_0x15de80[_0xd31e('0x18')](0x194);}return _0x5ee5ab;};}function handleError(_0x147524,_0x4de5da){_0x4de5da=_0x4de5da||0x1f4;return function(_0x330fcc){logger[_0xd31e('0x26')](_0x330fcc[_0xd31e('0x27')]);if(_0x330fcc['name']){delete _0x330fcc['name'];}_0x147524[_0xd31e('0x19')](_0x4de5da)[_0xd31e('0x28')](_0x330fcc);};}exports['index']=function(_0x453305,_0x14f129){var _0x70e39f={},_0x4be275={},_0x417602={'count':0x0,'rows':[]};var _0x5731fc=_[_0xd31e('0x29')](db[_0xd31e('0x2a')][_0xd31e('0x2b')],function(_0x5b2170){return{'name':_0x5b2170[_0xd31e('0x2c')],'type':_0x5b2170['type']['key']};});_0x4be275[_0xd31e('0x2d')]=_[_0xd31e('0x29')](_0x5731fc,_0xd31e('0x2e'));_0x4be275['query']=_[_0xd31e('0x2f')](_0x453305[_0xd31e('0x30')]);_0x4be275[_0xd31e('0x31')]=_[_0xd31e('0x32')](_0x4be275['model'],_0x4be275[_0xd31e('0x30')]);_0x70e39f[_0xd31e('0x33')]=_[_0xd31e('0x32')](_0x4be275[_0xd31e('0x2d')],qs[_0xd31e('0x34')](_0x453305['query']['fields']));_0x70e39f[_0xd31e('0x33')]=_0x70e39f[_0xd31e('0x33')][_0xd31e('0x35')]?_0x70e39f[_0xd31e('0x33')]:_0x4be275[_0xd31e('0x2d')];if(!_0x453305['query'][_0xd31e('0x36')](_0xd31e('0x37'))){_0x70e39f['limit']=qs['limit'](_0x453305['query'][_0xd31e('0x38')]);_0x70e39f[_0xd31e('0x1e')]=qs[_0xd31e('0x1e')](_0x453305[_0xd31e('0x30')][_0xd31e('0x1e')]);}_0x70e39f['order']=qs[_0xd31e('0x39')](_0x453305[_0xd31e('0x30')]['sort']);_0x70e39f[_0xd31e('0x3a')]=qs['filters'](_[_0xd31e('0x3b')](_0x453305[_0xd31e('0x30')],_0x4be275['filters']),_0x5731fc);if(_0x453305[_0xd31e('0x30')][_0xd31e('0x3c')]){_0x70e39f[_0xd31e('0x3a')]=_[_0xd31e('0x3d')](_0x70e39f[_0xd31e('0x3a')],{'$or':_[_0xd31e('0x29')](_0x5731fc,function(_0x40828f){if(_0x40828f[_0xd31e('0x3e')]!==_0xd31e('0x3f')){var _0xef4e6a={};_0xef4e6a[_0x40828f[_0xd31e('0x2e')]]={'$like':'%'+_0x453305[_0xd31e('0x30')][_0xd31e('0x3c')]+'%'};return _0xef4e6a;}})});}_0x70e39f=_[_0xd31e('0x3d')]({},_0x70e39f,_0x453305['options']);var _0x4a9610={'where':_0x70e39f[_0xd31e('0x3a')]};return db[_0xd31e('0x2a')][_0xd31e('0x1d')](_0x4a9610)[_0xd31e('0x25')](function(_0x265f93){_0x417602[_0xd31e('0x1d')]=_0x265f93;if(_0x453305[_0xd31e('0x30')][_0xd31e('0x40')]){_0x70e39f[_0xd31e('0x41')]=[{'all':!![]}];}return db[_0xd31e('0x2a')][_0xd31e('0x42')](_0x70e39f);})[_0xd31e('0x25')](function(_0x51b965){_0x417602[_0xd31e('0x43')]=_0x51b965;return _0x417602;})[_0xd31e('0x25')](respondWithFilteredResult(_0x14f129,_0x70e39f))[_0xd31e('0x44')](handleError(_0x14f129,null));};exports['show']=function(_0x3962a3,_0x47f6d9){var _0x14c2d3={'raw':!![],'where':{'id':_0x3962a3[_0xd31e('0x45')]['id']}},_0xc8db74={};_0xc8db74['model']=_[_0xd31e('0x2f')](db[_0xd31e('0x2a')][_0xd31e('0x2b')]);_0xc8db74['query']=_[_0xd31e('0x2f')](_0x3962a3[_0xd31e('0x30')]);_0xc8db74[_0xd31e('0x31')]=_[_0xd31e('0x32')](_0xc8db74['model'],_0xc8db74['query']);_0x14c2d3[_0xd31e('0x33')]=_['intersection'](_0xc8db74[_0xd31e('0x2d')],qs[_0xd31e('0x34')](_0x3962a3['query']['fields']));_0x14c2d3[_0xd31e('0x33')]=_0x14c2d3['attributes'][_0xd31e('0x35')]?_0x14c2d3[_0xd31e('0x33')]:_0xc8db74['model'];if(_0x3962a3['query'][_0xd31e('0x40')]){_0x14c2d3[_0xd31e('0x41')]=[{'all':!![]}];}_0x14c2d3=_[_0xd31e('0x3d')]({},_0x14c2d3,_0x3962a3[_0xd31e('0x46')]);return db['VoiceDialReport']['find'](_0x14c2d3)[_0xd31e('0x25')](handleEntityNotFound(_0x47f6d9,null))[_0xd31e('0x25')](respondWithResult(_0x47f6d9,null))[_0xd31e('0x44')](handleError(_0x47f6d9,null));};exports['create']=function(_0x58cac5,_0x3e546e){return db['VoiceDialReport'][_0xd31e('0x47')](_0x58cac5[_0xd31e('0x48')],{})[_0xd31e('0x25')](respondWithResult(_0x3e546e,0xc9))[_0xd31e('0x44')](handleError(_0x3e546e,null));};exports[_0xd31e('0x23')]=function(_0x3c05db,_0x29a714){if(_0x3c05db['body']['id']){delete _0x3c05db['body']['id'];}return db[_0xd31e('0x2a')][_0xd31e('0x49')]({'where':{'id':_0x3c05db[_0xd31e('0x45')]['id']}})[_0xd31e('0x25')](handleEntityNotFound(_0x29a714,null))[_0xd31e('0x25')](saveUpdates(_0x3c05db['body'],null))[_0xd31e('0x25')](respondWithResult(_0x29a714,null))['catch'](handleError(_0x29a714,null));};exports[_0xd31e('0x24')]=function(_0xed5e5e,_0x3d3cee){return db[_0xd31e('0x2a')][_0xd31e('0x49')]({'where':{'id':_0xed5e5e['params']['id']}})['then'](handleEntityNotFound(_0x3d3cee,null))['then'](removeEntity(_0x3d3cee,null))[_0xd31e('0x44')](handleError(_0x3d3cee,null));};exports[_0xd31e('0x4a')]=function(_0x3c7ae8,_0x5abfb1){return db[_0xd31e('0x2a')][_0xd31e('0x4a')]()[_0xd31e('0x25')](respondWithResult(_0x5abfb1,null))[_0xd31e('0x44')](handleError(_0x5abfb1,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c479872..6492ae8 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 _0x132b=['moment','bluebird','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','util','api'];(function(_0x1402d4,_0x33b322){var _0x1d6b5c=function(_0x4e6bd6){while(--_0x4e6bd6){_0x1402d4['push'](_0x1402d4['shift']());}};_0x1d6b5c(++_0x33b322);}(_0x132b,0x8d));var _0xb132=function(_0x72ad09,_0x190845){_0x72ad09=_0x72ad09-0x0;var _0x5c7906=_0x132b[_0x72ad09];return _0x5c7906;};'use strict';var _=require(_0xb132('0x0'));var util=require(_0xb132('0x1'));var logger=require('../../config/logger')(_0xb132('0x2'));var moment=require(_0xb132('0x3'));var BPromise=require(_0xb132('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb132('0x5'));var rimraf=require(_0xb132('0x6'));var config=require('../../config/environment');var attributes=require(_0xb132('0x7'));module[_0xb132('0x8')]=function(_0x59a940,_0x4753eb){return _0x59a940[_0xb132('0x9')](_0xb132('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xb132('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb2a=['bluebird','request-promise','rimraf','./voiceDialReport.attributes','exports','define','report_dial','lodash','util','../../config/logger'];(function(_0x286cc0,_0x32f7aa){var _0x51e478=function(_0x20228c){while(--_0x20228c){_0x286cc0['push'](_0x286cc0['shift']());}};_0x51e478(++_0x32f7aa);}(_0xdb2a,0x16f));var _0xadb2=function(_0x25afff,_0x4400d1){_0x25afff=_0x25afff-0x0;var _0x2788c0=_0xdb2a[_0x25afff];return _0x2788c0;};'use strict';var _=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var logger=require(_0xadb2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xadb2('0x3'));var rp=require(_0xadb2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadb2('0x5'));var config=require('../../config/environment');var attributes=require(_0xadb2('0x6'));module[_0xadb2('0x7')]=function(_0x1f5c7e,_0x297e69){return _0x1f5c7e[_0xadb2('0x8')]('VoiceDialReport',attributes,{'tableName':_0xadb2('0x9'),'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 2120bc8..f6cfcae 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 _0xa47d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','body','options','raw','CreateVoiceDialReport','debug','stringify','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','catch'];(function(_0xf8a6ed,_0x300f1b){var _0x5f41f1=function(_0x369f71){while(--_0x369f71){_0xf8a6ed['push'](_0xf8a6ed['shift']());}};_0x5f41f1(++_0x300f1b);}(_0xa47d,0x7c));var _0xda47=function(_0x2a75fa,_0x316917){_0x2a75fa=_0x2a75fa-0x0;var _0x53a7fd=_0xa47d[_0x2a75fa];return _0x53a7fd;};'use strict';var _=require(_0xda47('0x0'));var util=require(_0xda47('0x1'));var moment=require(_0xda47('0x2'));var BPromise=require(_0xda47('0x3'));var rs=require(_0xda47('0x4'));var fs=require('fs');var Redis=require(_0xda47('0x5'));var db=require(_0xda47('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xda47('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xda47('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55fc1a,_0x43e531,_0x3ca236){return new BPromise(function(_0x576d83,_0x522f46){return client[_0xda47('0x9')](_0x55fc1a,_0x3ca236)[_0xda47('0xa')](function(_0x8b06a2){logger[_0xda47('0xb')](_0xda47('0xc'),_0x43e531,_0xda47('0xd'));logger['debug'](_0xda47('0xe'),_0x43e531,_0xda47('0xd'),JSON['stringify'](_0x8b06a2));if(_0x8b06a2[_0xda47('0xf')]){if(_0x8b06a2[_0xda47('0xf')][_0xda47('0x10')]===0x1f4){logger[_0xda47('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x43e531,_0x8b06a2['error'][_0xda47('0x11')]);return _0x522f46(_0x8b06a2[_0xda47('0xf')][_0xda47('0x11')]);}logger['error'](_0xda47('0xc'),_0x43e531,_0x8b06a2['error'][_0xda47('0x11')]);return _0x576d83(_0x8b06a2[_0xda47('0xf')][_0xda47('0x11')]);}else{logger['info'](_0xda47('0xc'),_0x43e531,_0xda47('0xd'));_0x576d83(_0x8b06a2[_0xda47('0x12')][_0xda47('0x11')]);}})['catch'](function(_0x381749){logger[_0xda47('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x43e531,_0x381749);_0x522f46(_0x381749);});});}exports['CreateVoiceDialReport']=function(_0x4ecb10){var _0x149b51=this;return new Promise(function(_0x576396,_0x295695){return db['VoiceDialReport']['create'](_0x4ecb10[_0xda47('0x13')],{'raw':_0x4ecb10[_0xda47('0x14')]?_0x4ecb10[_0xda47('0x14')][_0xda47('0x15')]===undefined?!![]:![]:!![]})[_0xda47('0xa')](function(_0xe36724){logger['info'](_0xda47('0x16'),_0x4ecb10);logger[_0xda47('0x17')](_0xda47('0x16'),_0x4ecb10,JSON[_0xda47('0x18')](_0xe36724));_0x576396(_0xe36724);})['catch'](function(_0x157296){logger[_0xda47('0xf')](_0xda47('0x16'),_0x157296[_0xda47('0x11')],_0x4ecb10);_0x295695(_0x149b51[_0xda47('0xf')](0x1f4,_0x157296['message']));});});};exports[_0xda47('0x19')]=function(_0x542b1f){var _0x3dbf4f=this;return new Promise(function(_0x537555,_0x4216ea){return db[_0xda47('0x1a')][_0xda47('0x1b')](_0x542b1f['body'],{'raw':_0x542b1f[_0xda47('0x14')]?_0x542b1f[_0xda47('0x14')][_0xda47('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x542b1f[_0xda47('0x14')]?_0x542b1f[_0xda47('0x14')][_0xda47('0x1c')]||null:null,'attributes':_0x542b1f[_0xda47('0x14')]?_0x542b1f['options'][_0xda47('0x1d')]||null:null,'limit':_0x542b1f[_0xda47('0x14')]?_0x542b1f[_0xda47('0x14')]['limit']||null:null})['then'](function(_0x4dc015){logger[_0xda47('0xb')](_0xda47('0x19'),_0x542b1f);logger['debug'](_0xda47('0x19'),_0x542b1f,JSON[_0xda47('0x18')](_0x4dc015));_0x537555(_0x4dc015);})[_0xda47('0x1e')](function(_0x33252c){logger[_0xda47('0xf')](_0xda47('0x19'),_0x33252c['message'],_0x542b1f);_0x4216ea(_0x3dbf4f[_0xda47('0xf')](0x1f4,_0x33252c['message']));});});}; \ No newline at end of file +var _0x7219=['body','options','raw','debug','UpdateVoiceDialReport','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x33205b,_0x373c87){var _0x39039b=function(_0x463a6b){while(--_0x463a6b){_0x33205b['push'](_0x33205b['shift']());}};_0x39039b(++_0x373c87);}(_0x7219,0x108));var _0x9721=function(_0x4ee4c4,_0x419b2a){_0x4ee4c4=_0x4ee4c4-0x0;var _0x5e9c37=_0x7219[_0x4ee4c4];return _0x5e9c37;};'use strict';var _=require(_0x9721('0x0'));var util=require(_0x9721('0x1'));var moment=require('moment');var BPromise=require(_0x9721('0x2'));var rs=require(_0x9721('0x3'));var fs=require('fs');var Redis=require(_0x9721('0x4'));var db=require(_0x9721('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9721('0x6'))(_0x9721('0x7'));var config=require(_0x9721('0x8'));var jayson=require(_0x9721('0x9'));var client=jayson[_0x9721('0xa')][_0x9721('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ef439,_0x510fb6,_0x1c6882){return new BPromise(function(_0x352709,_0x2ec674){return client[_0x9721('0xc')](_0x3ef439,_0x1c6882)[_0x9721('0xd')](function(_0x19a0f7){logger[_0x9721('0xe')](_0x9721('0xf'),_0x510fb6,_0x9721('0x10'));logger['debug'](_0x9721('0x11'),_0x510fb6,_0x9721('0x10'),JSON[_0x9721('0x12')](_0x19a0f7));if(_0x19a0f7[_0x9721('0x13')]){if(_0x19a0f7[_0x9721('0x13')]['code']===0x1f4){logger[_0x9721('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x510fb6,_0x19a0f7[_0x9721('0x13')]['message']);return _0x2ec674(_0x19a0f7['error']['message']);}logger[_0x9721('0x13')](_0x9721('0xf'),_0x510fb6,_0x19a0f7[_0x9721('0x13')][_0x9721('0x14')]);return _0x352709(_0x19a0f7[_0x9721('0x13')][_0x9721('0x14')]);}else{logger[_0x9721('0xe')](_0x9721('0xf'),_0x510fb6,_0x9721('0x10'));_0x352709(_0x19a0f7['result'][_0x9721('0x14')]);}})[_0x9721('0x15')](function(_0xea63ae){logger[_0x9721('0x13')](_0x9721('0xf'),_0x510fb6,_0xea63ae);_0x2ec674(_0xea63ae);});});}exports[_0x9721('0x16')]=function(_0x44fe53){var _0x3ff030=this;return new Promise(function(_0x463ddf,_0x3dba8d){return db[_0x9721('0x17')]['create'](_0x44fe53[_0x9721('0x18')],{'raw':_0x44fe53[_0x9721('0x19')]?_0x44fe53['options'][_0x9721('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1c2d80){logger[_0x9721('0xe')](_0x9721('0x16'),_0x44fe53);logger[_0x9721('0x1b')]('CreateVoiceDialReport',_0x44fe53,JSON['stringify'](_0x1c2d80));_0x463ddf(_0x1c2d80);})['catch'](function(_0x2498ce){logger[_0x9721('0x13')](_0x9721('0x16'),_0x2498ce[_0x9721('0x14')],_0x44fe53);_0x3dba8d(_0x3ff030[_0x9721('0x13')](0x1f4,_0x2498ce[_0x9721('0x14')]));});});};exports[_0x9721('0x1c')]=function(_0x35ef38){var _0x56c429=this;return new Promise(function(_0x1aaebb,_0x5e7b4f){return db[_0x9721('0x17')][_0x9721('0x1d')](_0x35ef38[_0x9721('0x18')],{'raw':_0x35ef38[_0x9721('0x19')]?_0x35ef38[_0x9721('0x19')][_0x9721('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35ef38['options']?_0x35ef38[_0x9721('0x19')]['where']||null:null,'attributes':_0x35ef38['options']?_0x35ef38['options'][_0x9721('0x1e')]||null:null,'limit':_0x35ef38[_0x9721('0x19')]?_0x35ef38[_0x9721('0x19')][_0x9721('0x1f')]||null:null})[_0x9721('0xd')](function(_0x53a94d){logger[_0x9721('0xe')](_0x9721('0x1c'),_0x35ef38);logger['debug'](_0x9721('0x1c'),_0x35ef38,JSON[_0x9721('0x12')](_0x53a94d));_0x1aaebb(_0x53a94d);})[_0x9721('0x15')](function(_0x98a48e){logger['error'](_0x9721('0x1c'),_0x98a48e['message'],_0x35ef38);_0x5e7b4f(_0x56c429[_0x9721('0x13')](0x1f4,_0x98a48e[_0x9721('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index cc40f2b..7ebec55 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 _0x8cd9=['isAuthenticated','create','/:id/applications','addApplications','put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','/:id','show','post'];(function(_0x44f3c2,_0x73964){var _0x20169c=function(_0x4228b1){while(--_0x4228b1){_0x44f3c2['push'](_0x44f3c2['shift']());}};_0x20169c(++_0x73964);}(_0x8cd9,0x1c1));var _0x98cd=function(_0x1fc18d,_0x4f2bdd){_0x1fc18d=_0x1fc18d-0x0;var _0x1988a2=_0x8cd9[_0x1fc18d];return _0x1988a2;};'use strict';var multer=require(_0x98cd('0x0'));var util=require('util');var path=require(_0x98cd('0x1'));var timeout=require(_0x98cd('0x2'));var express=require('express');var router=express[_0x98cd('0x3')]();var fs_extra=require(_0x98cd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x98cd('0x5'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x98cd('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x98cd('0x6')](_0x98cd('0x7'),auth['isAuthenticated'](),controller[_0x98cd('0x8')]);router[_0x98cd('0x9')]('/',auth[_0x98cd('0xa')](),controller[_0x98cd('0xb')]);router[_0x98cd('0x9')](_0x98cd('0xc'),auth[_0x98cd('0xa')](),controller[_0x98cd('0xd')]);router[_0x98cd('0xe')](_0x98cd('0x7'),auth[_0x98cd('0xa')](),controller['update']);router[_0x98cd('0xf')](_0x98cd('0x7'),auth[_0x98cd('0xa')](),controller[_0x98cd('0x10')]);module['exports']=router; \ No newline at end of file +var _0xfb14=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','post','addApplications','put','update','delete'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0xfb14,0x172));var _0x4fb1=function(_0x5d6562,_0x48a352){_0x5d6562=_0x5d6562-0x0;var _0xdaafd1=_0xfb14[_0x5d6562];return _0xdaafd1;};'use strict';var multer=require(_0x4fb1('0x0'));var util=require(_0x4fb1('0x1'));var path=require(_0x4fb1('0x2'));var timeout=require(_0x4fb1('0x3'));var express=require(_0x4fb1('0x4'));var router=express[_0x4fb1('0x5')]();var fs_extra=require(_0x4fb1('0x6'));var auth=require(_0x4fb1('0x7'));var interaction=require(_0x4fb1('0x8'));var config=require(_0x4fb1('0x9'));var controller=require('./voiceExtension.controller');router[_0x4fb1('0xa')]('/',auth['isAuthenticated'](),controller[_0x4fb1('0xb')]);router['get'](_0x4fb1('0xc'),auth[_0x4fb1('0xd')](),controller[_0x4fb1('0xe')]);router['post']('/',auth[_0x4fb1('0xd')](),controller[_0x4fb1('0xf')]);router[_0x4fb1('0x10')]('/:id/applications',auth[_0x4fb1('0xd')](),controller[_0x4fb1('0x11')]);router[_0x4fb1('0x12')](_0x4fb1('0xc'),auth[_0x4fb1('0xd')](),controller[_0x4fb1('0x13')]);router[_0x4fb1('0x14')](_0x4fb1('0xc'),auth[_0x4fb1('0xd')](),controller[_0x4fb1('0x15')]);module[_0x4fb1('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 498424f..b7f2e2e 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 _0x5260=['outbound','internal','inbound-fax','outbound-fax','any','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x29f014,_0x508522){var _0x316be5=function(_0x1753a5){while(--_0x1753a5){_0x29f014['push'](_0x29f014['shift']());}};_0x316be5(++_0x508522);}(_0x5260,0x89));var _0x0526=function(_0x285d1f,_0x4746de){_0x285d1f=_0x285d1f-0x0;var _0x4fb3c4=_0x5260[_0x285d1f];return _0x4fb3c4;};'use strict';var Sequelize=require(_0x0526('0x0'));module[_0x0526('0x1')]={'context':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'unique':_0x0526('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'unique':_0x0526('0x3')},'priority':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'defaultValue':_0x0526('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0526('0x5')](_0x0526('0x6'),_0x0526('0x7'),_0x0526('0x8'),_0x0526('0x9'),_0x0526('0xa'),'system',_0x0526('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x0526('0x2')]},'interval':{'type':Sequelize[_0x0526('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0526('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x0526('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x0526('0x2')],'defaultValue':_0x0526('0xd')},'answer':{'type':Sequelize[_0x0526('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0526('0xe')],'get':function(_0x1a7ef1){return this[_0x0526('0xf')]('exten');}},'alias':{'type':Sequelize[_0x0526('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x9bed=['getDataValue','sequelize','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9bed,0xf1));var _0xd9be=function(_0x4972bc,_0x53d906){_0x4972bc=_0x4972bc-0x0;var _0x65e08b=_0x9bed[_0x4972bc];return _0x65e08b;};'use strict';var Sequelize=require(_0xd9be('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd9be('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd9be('0x2')],'allowNull':![],'unique':_0xd9be('0x1')},'priority':{'type':Sequelize[_0xd9be('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xd9be('0x1')},'tag':{'type':Sequelize[_0xd9be('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd9be('0x3')},'appdata':{'type':Sequelize[_0xd9be('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd9be('0x4')](_0xd9be('0x5'),_0xd9be('0x6'),_0xd9be('0x7'),'inbound-fax',_0xd9be('0x8'),_0xd9be('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xd9be('0x2')]},'interval':{'type':Sequelize[_0xd9be('0x2')],'allowNull':![],'defaultValue':_0xd9be('0xa')},'IntervalId':{'type':Sequelize[_0xd9be('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd9be('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd9be('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xd9be('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd9be('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xd9be('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xd9be('0xe')],'get':function(_0x11f1a6){return this[_0xd9be('0xf')]('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 4bff39b..71c1814 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 _0xe78c=['to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','value','type','find','name','UserProfileResource','destroy','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','query','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','catch','show','params','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','rewriteDial','toLowerCase','true','bulkCreate','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x301cb9,_0x1b0f7f){var _0x364932=function(_0x40fc92){while(--_0x40fc92){_0x301cb9['push'](_0x301cb9['shift']());}};_0x364932(++_0x1b0f7f);}(_0xe78c,0xd2));var _0xce78=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe78c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xce78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce78('0x1'));var jsonpatch=require(_0xce78('0x2'));var rp=require(_0xce78('0x3'));var moment=require(_0xce78('0x4'));var BPromise=require(_0xce78('0x5'));var Mustache=require(_0xce78('0x6'));var util=require(_0xce78('0x7'));var path=require(_0xce78('0x8'));var sox=require(_0xce78('0x9'));var csv=require(_0xce78('0xa'));var ejs=require(_0xce78('0xb'));var fs=require('fs');var fs_extra=require(_0xce78('0xc'));var _=require('lodash');var squel=require(_0xce78('0xd'));var crypto=require(_0xce78('0xe'));var jsforce=require(_0xce78('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xce78('0x10'));var Redis=require('ioredis');var authService=require(_0xce78('0x11'));var qs=require(_0xce78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xce78('0x13'))(_0xce78('0x14'));var utils=require(_0xce78('0x15'));var config=require(_0xce78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xce78('0x17'))['db'];config[_0xce78('0x18')]=_[_0xce78('0x19')](config[_0xce78('0x18')],{'host':_0xce78('0x1a'),'port':0x18eb});var socket=require(_0xce78('0x1b'))(new Redis(config['redis']));require(_0xce78('0x1c'))[_0xce78('0x1d')](socket);function respondWithStatusCode(_0x3b4115,_0x5a1170){_0x5a1170=_0x5a1170||0xcc;return function(_0x295718){if(_0x295718){return _0x3b4115[_0xce78('0x1e')](_0x5a1170);}return _0x3b4115[_0xce78('0x1f')](_0x5a1170)[_0xce78('0x20')]();};}function respondWithResult(_0x4337da,_0x29fd75){_0x29fd75=_0x29fd75||0xc8;return function(_0x5500ba){if(_0x5500ba){return _0x4337da['status'](_0x29fd75)[_0xce78('0x21')](_0x5500ba);}};}function respondWithFilteredResult(_0x499873,_0x2c6ed5){return function(_0x5932dd){if(_0x5932dd){var _0x2c216b=typeof _0x2c6ed5['offset']==='undefined'&&typeof _0x2c6ed5[_0xce78('0x22')]===_0xce78('0x23');var _0x32e738=_0x5932dd[_0xce78('0x24')];var _0xd5e94c=_0x2c216b?0x0:_0x2c6ed5[_0xce78('0x25')];var _0x556aef=_0x2c216b?_0x5932dd['count']:_0x2c6ed5[_0xce78('0x25')]+_0x2c6ed5[_0xce78('0x22')];var _0x4c11c5;if(_0x556aef>=_0x32e738){_0x556aef=_0x32e738;_0x4c11c5=0xc8;}else{_0x4c11c5=0xce;}_0x499873[_0xce78('0x1f')](_0x4c11c5);return _0x499873[_0xce78('0x26')](_0xce78('0x27'),_0xd5e94c+'-'+_0x556aef+'/'+_0x32e738)[_0xce78('0x21')](_0x5932dd);}return null;};}function patchUpdates(_0x2d0e69){return function(_0xa9990a){try{jsonpatch['apply'](_0xa9990a,_0x2d0e69,!![]);}catch(_0x62b7b6){return BPromise[_0xce78('0x28')](_0x62b7b6);}return _0xa9990a[_0xce78('0x29')]();};}function saveUpdates(_0x6bfa09,_0x598410){return function(_0x541882){if(_0x541882){return _0x541882['update'](_0x6bfa09)[_0xce78('0x2a')](function(_0x188068){return _0x188068;});}return null;};}function removeEntity(_0x5adc10,_0x3b216c){return function(_0x159f3e){if(_0x159f3e){return _0x159f3e['destroy']()[_0xce78('0x2a')](function(){var _0x4e1342=_0x159f3e['get']({'plain':!![]});var _0xfe9f48=[{'name':_0xce78('0x2b'),'value':_0xce78('0x2c'),'ignore':![]},{'name':_0xce78('0x2d'),'value':_0xce78('0x2e'),'ignore':![]},{'name':'InternalRoutes','value':_0xce78('0x2f'),'ignore':![]}];var _0x1c82fa=_(_0xfe9f48)[_0xce78('0x30')]('ignore')['map'](_0xce78('0x31'))[_0xce78('0x31')]();if(_['includes'](_0x1c82fa,_0x4e1342[_0xce78('0x32')])){return;}var _0x234a73=_[_0xce78('0x33')](_0xfe9f48,[_0xce78('0x31'),_0x4e1342[_0xce78('0x32')]])[_0xce78('0x34')];return db[_0xce78('0x35')][_0xce78('0x36')]({'where':{'type':_0x234a73,'resourceId':_0x4e1342['id']}})[_0xce78('0x2a')](function(){return _0x159f3e;});})[_0xce78('0x2a')](function(){_0x5adc10[_0xce78('0x1f')](0xcc)[_0xce78('0x20')]();});}};}function handleEntityNotFound(_0x4fcefe,_0x2a985b){return function(_0x5e9f2e){if(!_0x5e9f2e){_0x4fcefe[_0xce78('0x1e')](0x194);}return _0x5e9f2e;};}function handleError(_0x1c3b32,_0x4d3386){_0x4d3386=_0x4d3386||0x1f4;return function(_0x2b82cc){logger['error'](_0x2b82cc['stack']);if(_0x2b82cc[_0xce78('0x34')]){delete _0x2b82cc[_0xce78('0x34')];}_0x1c3b32['status'](_0x4d3386)[_0xce78('0x37')](_0x2b82cc);};}exports[_0xce78('0x38')]=function(_0x568e45,_0x3711a7){var _0x36920c={},_0x2b4137={},_0x2dcf09={'count':0x0,'rows':[]};var _0x57341e=_[_0xce78('0x39')](db['VoiceExtension'][_0xce78('0x3a')],function(_0x38ca08){return{'name':_0x38ca08['fieldName'],'type':_0x38ca08[_0xce78('0x32')][_0xce78('0x3b')]};});_0x2b4137[_0xce78('0x3c')]=_[_0xce78('0x39')](_0x57341e,_0xce78('0x34'));_0x2b4137['query']=_[_0xce78('0x3d')](_0x568e45['query']);_0x2b4137[_0xce78('0x3e')]=_[_0xce78('0x3f')](_0x2b4137[_0xce78('0x3c')],_0x2b4137['query']);_0x36920c[_0xce78('0x40')]=_[_0xce78('0x3f')](_0x2b4137['model'],qs['fields'](_0x568e45[_0xce78('0x41')][_0xce78('0x42')]));_0x36920c[_0xce78('0x40')]=_0x36920c['attributes'][_0xce78('0x43')]?_0x36920c[_0xce78('0x40')]:_0x2b4137[_0xce78('0x3c')];if(!_0x568e45[_0xce78('0x41')]['hasOwnProperty'](_0xce78('0x44'))){_0x36920c[_0xce78('0x22')]=qs['limit'](_0x568e45[_0xce78('0x41')][_0xce78('0x22')]);_0x36920c[_0xce78('0x25')]=qs[_0xce78('0x25')](_0x568e45[_0xce78('0x41')][_0xce78('0x25')]);}_0x36920c[_0xce78('0x45')]=qs[_0xce78('0x46')](_0x568e45[_0xce78('0x41')][_0xce78('0x46')]);_0x36920c[_0xce78('0x47')]=qs[_0xce78('0x3e')](_[_0xce78('0x48')](_0x568e45[_0xce78('0x41')],_0x2b4137[_0xce78('0x3e')]),_0x57341e);if(_0x568e45[_0xce78('0x41')]['filter']){_0x36920c[_0xce78('0x47')]=_[_0xce78('0x49')](_0x36920c['where'],{'$or':_['map'](_0x57341e,function(_0x2f7b37){if(_0x2f7b37['type']!==_0xce78('0x4a')){var _0x3cfc4e={};_0x3cfc4e[_0x2f7b37[_0xce78('0x34')]]={'$like':'%'+_0x568e45[_0xce78('0x41')]['filter']+'%'};return _0x3cfc4e;}})});}_0x36920c=_[_0xce78('0x49')]({},_0x36920c,_0x568e45[_0xce78('0x4b')]);var _0x5634de={'where':_0x36920c[_0xce78('0x47')]};return db[_0xce78('0x4c')][_0xce78('0x24')](_0x5634de)[_0xce78('0x2a')](function(_0x2e18bb){_0x2dcf09[_0xce78('0x24')]=_0x2e18bb;if(_0x568e45[_0xce78('0x41')][_0xce78('0x4d')]){_0x36920c[_0xce78('0x4e')]=[{'all':!![]}];}return db[_0xce78('0x4c')][_0xce78('0x4f')](_0x36920c);})[_0xce78('0x2a')](function(_0x3d86a8){_0x2dcf09['rows']=_0x3d86a8;return _0x2dcf09;})[_0xce78('0x2a')](respondWithFilteredResult(_0x3711a7,_0x36920c))[_0xce78('0x50')](handleError(_0x3711a7,null));};exports[_0xce78('0x51')]=function(_0x4e3533,_0x4cd54b){var _0x3acab6={'raw':![],'where':{'id':_0x4e3533[_0xce78('0x52')]['id']}},_0x10dbff={};_0x10dbff[_0xce78('0x3c')]=_[_0xce78('0x3d')](db[_0xce78('0x4c')][_0xce78('0x3a')]);_0x10dbff[_0xce78('0x41')]=_[_0xce78('0x3d')](_0x4e3533['query']);_0x10dbff[_0xce78('0x3e')]=_[_0xce78('0x3f')](_0x10dbff[_0xce78('0x3c')],_0x10dbff[_0xce78('0x41')]);_0x3acab6[_0xce78('0x40')]=_['intersection'](_0x10dbff[_0xce78('0x3c')],qs['fields'](_0x4e3533[_0xce78('0x41')]['fields']));_0x3acab6['attributes']=_0x3acab6[_0xce78('0x40')][_0xce78('0x43')]?_0x3acab6[_0xce78('0x40')]:_0x10dbff['model'];if(_0x4e3533['query'][_0xce78('0x4d')]){_0x3acab6[_0xce78('0x4e')]=[{'all':!![]}];}_0x3acab6=_[_0xce78('0x49')]({},_0x3acab6,_0x4e3533[_0xce78('0x4b')]);return db[_0xce78('0x4c')]['find'](_0x3acab6)[_0xce78('0x2a')](handleEntityNotFound(_0x4cd54b,null))[_0xce78('0x2a')](respondWithResult(_0x4cd54b,null))[_0xce78('0x50')](handleError(_0x4cd54b,null));};exports[_0xce78('0x36')]=function(_0x2f345a,_0x509685){return db[_0xce78('0x4c')][_0xce78('0x33')]({'where':{'id':_0x2f345a[_0xce78('0x52')]['id']}})[_0xce78('0x2a')](handleEntityNotFound(_0x509685,null))[_0xce78('0x2a')](removeEntity(_0x509685,null))[_0xce78('0x50')](handleError(_0x509685,null));};exports[_0xce78('0x53')]=function(_0x3c8cf4,_0x512a33){if(_0x3c8cf4[_0xce78('0x54')][_0xce78('0x32')]===_0xce78('0x2e')&&!_[_0xce78('0x55')](_0x3c8cf4[_0xce78('0x54')][_0xce78('0x56')],'_')){_0x3c8cf4['body'][_0xce78('0x56')]='_'['concat'](_0x3c8cf4[_0xce78('0x54')]['exten']);}return db[_0xce78('0x4c')]['create'](_0x3c8cf4['body'],{'raw':![]})[_0xce78('0x2a')](function(_0x573eff){var _0x343f1b=_0x3c8cf4[_0xce78('0x57')]['get']({'plain':!![]});if(!_0x343f1b)throw new Error(_0xce78('0x58'));if(_0x343f1b['role']==='user'){var _0x4d4b2a=_0x573eff[_0xce78('0x59')]({'plain':!![]});var _0x5995ad=[{'name':_0xce78('0x2b'),'value':_0xce78('0x2c')},{'name':_0xce78('0x2d'),'value':'outbound'},{'name':_0xce78('0x5a'),'value':_0xce78('0x2f')}];var _0x154495=_[_0xce78('0x33')](_0x5995ad,[_0xce78('0x31'),_0x4d4b2a[_0xce78('0x32')]])[_0xce78('0x34')];return db[_0xce78('0x5b')][_0xce78('0x33')]({'where':{'name':_0x154495,'userProfileId':_0x343f1b[_0xce78('0x5c')]},'raw':!![]})[_0xce78('0x2a')](function(_0x310a35){if(_0x310a35&&_0x310a35[_0xce78('0x5d')]===0x0){return db[_0xce78('0x35')][_0xce78('0x53')]({'name':_0x4d4b2a[_0xce78('0x34')],'resourceId':_0x4d4b2a['id'],'type':_0x310a35['name'],'sectionId':_0x310a35['id']},{})[_0xce78('0x2a')](function(){return _0x573eff;});}else{return _0x573eff;}})['catch'](function(_0xaf635c){logger[_0xce78('0x5e')](_0xce78('0x5f'),_0xaf635c);throw _0xaf635c;});}return _0x573eff;})[_0xce78('0x2a')](respondWithResult(_0x512a33,0xc9))['catch'](handleError(_0x512a33,null));};exports['update']=function(_0x180413,_0x5328e1){if(_0x180413[_0xce78('0x54')]['id']){delete _0x180413[_0xce78('0x54')]['id'];}return db['VoiceExtension'][_0xce78('0x33')]({'where':{'id':_0x180413['params']['id']}})[_0xce78('0x2a')](handleEntityNotFound(_0x5328e1,null))[_0xce78('0x2a')](function(_0x1fae6b){if(_0x1fae6b){return db[_0xce78('0x4c')]['update'](_[_0xce78('0x48')](_0x180413[_0xce78('0x54')],['exten',_0xce78('0x60'),'description','recordingFormat',_0xce78('0x61'),_0xce78('0x62'),_0xce78('0x63')]),{'where':{'context':_0x1fae6b[_0xce78('0x60')],'exten':_0x1fae6b[_0xce78('0x56')]},'individualHooks':!![]})[_0xce78('0x2a')](function(_0x2a4818){return _0x2a4818;});}return null;})[_0xce78('0x2a')](respondWithStatusCode(_0x5328e1,null))[_0xce78('0x50')](handleError(_0x5328e1,null));};exports[_0xce78('0x64')]=function(_0x362d34,_0x22c200){return db['VoiceExtension'][_0xce78('0x65')]({'where':{'id':_0x362d34['params']['id']}})[_0xce78('0x2a')](function(_0x34f4d1){if(_0x34f4d1){return db[_0xce78('0x66')][_0xce78('0x67')](function(_0x56b3ef){return db['VoiceExtension'][_0xce78('0x36')]({'where':{'VoiceExtensionId':_0x362d34[_0xce78('0x52')]['id']},'transaction':_0x56b3ef})['then'](function(){var _0x55c89a=_[_0xce78('0x39')](_0x362d34['body'],function(_0x48a27c){_0x48a27c[_0xce78('0x68')]=_0x362d34[_0xce78('0x52')]['id'];_0x48a27c['isApp']=!![];return _0x48a27c;});var _0x57aa72=_0x362d34[_0xce78('0x41')][_0xce78('0x69')]&&_0x362d34[_0xce78('0x41')][_0xce78('0x69')][_0xce78('0x6a')]()===_0xce78('0x6b')?!![]:![];return _0x34f4d1['createRouting'](_0x55c89a,_0x57aa72);})[_0xce78('0x2a')](function(_0xd5a355){return db[_0xce78('0x4c')][_0xce78('0x6c')](_0xd5a355,{'transaction':_0x56b3ef});});})[_0xce78('0x2a')](function(){return db[_0xce78('0x4c')][_0xce78('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x362d34['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x22c200,null))['catch'](handleError(_0x22c200,null));}; \ No newline at end of file +var _0x80fe=['../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','inbound','outbound','InternalRoutes','filter','value','includes','name','UserProfileResource','error','index','map','VoiceExtension','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','catch','params','options','find','create','startsWith','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','OutboundRoutes','internal','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','alias','context','addApplications','sequelize','isApp','rewriteDial','toLowerCase','true','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment'];(function(_0x4ba20e,_0x5d7255){var _0x1cda38=function(_0x4cc0fd){while(--_0x4cc0fd){_0x4ba20e['push'](_0x4ba20e['shift']());}};_0x1cda38(++_0x5d7255);}(_0x80fe,0xc0));var _0xe80f=function(_0x94258a,_0x1110b5){_0x94258a=_0x94258a-0x0;var _0x59ca89=_0x80fe[_0x94258a];return _0x59ca89;};'use strict';var emlformat=require(_0xe80f('0x0'));var rimraf=require(_0xe80f('0x1'));var zipdir=require(_0xe80f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe80f('0x3'));var moment=require(_0xe80f('0x4'));var BPromise=require(_0xe80f('0x5'));var Mustache=require(_0xe80f('0x6'));var util=require(_0xe80f('0x7'));var path=require(_0xe80f('0x8'));var sox=require(_0xe80f('0x9'));var csv=require(_0xe80f('0xa'));var ejs=require(_0xe80f('0xb'));var fs=require('fs');var fs_extra=require(_0xe80f('0xc'));var _=require(_0xe80f('0xd'));var squel=require(_0xe80f('0xe'));var crypto=require(_0xe80f('0xf'));var jsforce=require(_0xe80f('0x10'));var deskjs=require(_0xe80f('0x11'));var toCsv=require(_0xe80f('0xa'));var querystring=require('querystring');var Papa=require(_0xe80f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe80f('0x13'));var as=require(_0xe80f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe80f('0x15'))(_0xe80f('0x16'));var utils=require('../../config/utils');var config=require(_0xe80f('0x17'));var licenseUtil=require(_0xe80f('0x18'));var db=require(_0xe80f('0x19'))['db'];config[_0xe80f('0x1a')]=_[_0xe80f('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe80f('0x1c'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x2a36ef,_0x14b80d){_0x14b80d=_0x14b80d||0xcc;return function(_0x11abfd){if(_0x11abfd){return _0x2a36ef[_0xe80f('0x1d')](_0x14b80d);}return _0x2a36ef[_0xe80f('0x1e')](_0x14b80d)['end']();};}function respondWithResult(_0x969fa6,_0x3f4c5c){_0x3f4c5c=_0x3f4c5c||0xc8;return function(_0x1b53e7){if(_0x1b53e7){return _0x969fa6[_0xe80f('0x1e')](_0x3f4c5c)['json'](_0x1b53e7);}};}function respondWithFilteredResult(_0x2f8164,_0x61760e){return function(_0xa14f62){if(_0xa14f62){var _0x4a6ed3=typeof _0x61760e[_0xe80f('0x1f')]===_0xe80f('0x20')&&typeof _0x61760e['limit']==='undefined';var _0x298d03=_0xa14f62[_0xe80f('0x21')];var _0x441c4f=_0x4a6ed3?0x0:_0x61760e[_0xe80f('0x1f')];var _0x47abfd=_0x4a6ed3?_0xa14f62[_0xe80f('0x21')]:_0x61760e[_0xe80f('0x1f')]+_0x61760e[_0xe80f('0x22')];var _0x2faa7b;if(_0x47abfd>=_0x298d03){_0x47abfd=_0x298d03;_0x2faa7b=0xc8;}else{_0x2faa7b=0xce;}_0x2f8164[_0xe80f('0x1e')](_0x2faa7b);return _0x2f8164[_0xe80f('0x23')](_0xe80f('0x24'),_0x441c4f+'-'+_0x47abfd+'/'+_0x298d03)[_0xe80f('0x25')](_0xa14f62);}return null;};}function patchUpdates(_0x444459){return function(_0x50aa55){try{jsonpatch[_0xe80f('0x26')](_0x50aa55,_0x444459,!![]);}catch(_0x5cf0f2){return BPromise['reject'](_0x5cf0f2);}return _0x50aa55[_0xe80f('0x27')]();};}function saveUpdates(_0x45390c,_0x187cd7){return function(_0x338f68){if(_0x338f68){return _0x338f68[_0xe80f('0x28')](_0x45390c)[_0xe80f('0x29')](function(_0x30f858){return _0x30f858;});}return null;};}function removeEntity(_0x56c3a2,_0x39659e){return function(_0x8f81aa){if(_0x8f81aa){return _0x8f81aa[_0xe80f('0x2a')]()[_0xe80f('0x29')](function(){var _0x1c6041=_0x8f81aa[_0xe80f('0x2b')]({'plain':!![]});var _0x11853e=[{'name':'InboundRoutes','value':_0xe80f('0x2c'),'ignore':![]},{'name':'OutboundRoutes','value':_0xe80f('0x2d'),'ignore':![]},{'name':_0xe80f('0x2e'),'value':'internal','ignore':![]}];var _0x1e162e=_(_0x11853e)[_0xe80f('0x2f')]('ignore')['map'](_0xe80f('0x30'))[_0xe80f('0x30')]();if(_[_0xe80f('0x31')](_0x1e162e,_0x1c6041['type'])){return;}var _0x5ac05e=_['find'](_0x11853e,['value',_0x1c6041['type']])[_0xe80f('0x32')];return db[_0xe80f('0x33')][_0xe80f('0x2a')]({'where':{'type':_0x5ac05e,'resourceId':_0x1c6041['id']}})[_0xe80f('0x29')](function(){return _0x8f81aa;});})[_0xe80f('0x29')](function(){_0x56c3a2[_0xe80f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5242a1,_0x5aebc3){return function(_0x8f9fea){if(!_0x8f9fea){_0x5242a1[_0xe80f('0x1d')](0x194);}return _0x8f9fea;};}function handleError(_0x1d5516,_0x457c1d){_0x457c1d=_0x457c1d||0x1f4;return function(_0x34fe9d){logger[_0xe80f('0x34')](_0x34fe9d['stack']);if(_0x34fe9d[_0xe80f('0x32')]){delete _0x34fe9d['name'];}_0x1d5516[_0xe80f('0x1e')](_0x457c1d)['send'](_0x34fe9d);};}exports[_0xe80f('0x35')]=function(_0x26b940,_0x184d31){var _0x2a64ec={},_0x5f2186={},_0x24ca4c={'count':0x0,'rows':[]};var _0x9d9b7e=_[_0xe80f('0x36')](db[_0xe80f('0x37')][_0xe80f('0x38')],function(_0x4f414f){return{'name':_0x4f414f[_0xe80f('0x39')],'type':_0x4f414f[_0xe80f('0x3a')][_0xe80f('0x3b')]};});_0x5f2186[_0xe80f('0x3c')]=_[_0xe80f('0x36')](_0x9d9b7e,_0xe80f('0x32'));_0x5f2186[_0xe80f('0x3d')]=_[_0xe80f('0x3e')](_0x26b940[_0xe80f('0x3d')]);_0x5f2186[_0xe80f('0x3f')]=_[_0xe80f('0x40')](_0x5f2186[_0xe80f('0x3c')],_0x5f2186[_0xe80f('0x3d')]);_0x2a64ec[_0xe80f('0x41')]=_['intersection'](_0x5f2186['model'],qs[_0xe80f('0x42')](_0x26b940['query'][_0xe80f('0x42')]));_0x2a64ec[_0xe80f('0x41')]=_0x2a64ec[_0xe80f('0x41')]['length']?_0x2a64ec[_0xe80f('0x41')]:_0x5f2186[_0xe80f('0x3c')];if(!_0x26b940['query'][_0xe80f('0x43')](_0xe80f('0x44'))){_0x2a64ec[_0xe80f('0x22')]=qs[_0xe80f('0x22')](_0x26b940[_0xe80f('0x3d')][_0xe80f('0x22')]);_0x2a64ec[_0xe80f('0x1f')]=qs['offset'](_0x26b940[_0xe80f('0x3d')]['offset']);}_0x2a64ec[_0xe80f('0x45')]=qs[_0xe80f('0x46')](_0x26b940[_0xe80f('0x3d')][_0xe80f('0x46')]);_0x2a64ec[_0xe80f('0x47')]=qs[_0xe80f('0x3f')](_[_0xe80f('0x48')](_0x26b940['query'],_0x5f2186['filters']),_0x9d9b7e);if(_0x26b940[_0xe80f('0x3d')][_0xe80f('0x2f')]){_0x2a64ec[_0xe80f('0x47')]=_[_0xe80f('0x49')](_0x2a64ec[_0xe80f('0x47')],{'$or':_[_0xe80f('0x36')](_0x9d9b7e,function(_0x1b7d7b){if(_0x1b7d7b[_0xe80f('0x3a')]!=='VIRTUAL'){var _0x15b67a={};_0x15b67a[_0x1b7d7b[_0xe80f('0x32')]]={'$like':'%'+_0x26b940['query'][_0xe80f('0x2f')]+'%'};return _0x15b67a;}})});}_0x2a64ec=_['merge']({},_0x2a64ec,_0x26b940['options']);var _0x293294={'where':_0x2a64ec[_0xe80f('0x47')]};return db[_0xe80f('0x37')][_0xe80f('0x21')](_0x293294)[_0xe80f('0x29')](function(_0x18cd59){_0x24ca4c[_0xe80f('0x21')]=_0x18cd59;if(_0x26b940['query'][_0xe80f('0x4a')]){_0x2a64ec[_0xe80f('0x4b')]=[{'all':!![]}];}return db['VoiceExtension'][_0xe80f('0x4c')](_0x2a64ec);})[_0xe80f('0x29')](function(_0x2416a6){_0x24ca4c['rows']=_0x2416a6;return _0x24ca4c;})[_0xe80f('0x29')](respondWithFilteredResult(_0x184d31,_0x2a64ec))[_0xe80f('0x4d')](handleError(_0x184d31,null));};exports['show']=function(_0x55ea99,_0x3fc2ee){var _0x2bc5e4={'raw':![],'where':{'id':_0x55ea99[_0xe80f('0x4e')]['id']}},_0x4f80e7={};_0x4f80e7[_0xe80f('0x3c')]=_[_0xe80f('0x3e')](db[_0xe80f('0x37')][_0xe80f('0x38')]);_0x4f80e7[_0xe80f('0x3d')]=_['keys'](_0x55ea99[_0xe80f('0x3d')]);_0x4f80e7[_0xe80f('0x3f')]=_[_0xe80f('0x40')](_0x4f80e7[_0xe80f('0x3c')],_0x4f80e7[_0xe80f('0x3d')]);_0x2bc5e4[_0xe80f('0x41')]=_['intersection'](_0x4f80e7['model'],qs['fields'](_0x55ea99['query']['fields']));_0x2bc5e4[_0xe80f('0x41')]=_0x2bc5e4[_0xe80f('0x41')]['length']?_0x2bc5e4[_0xe80f('0x41')]:_0x4f80e7['model'];if(_0x55ea99[_0xe80f('0x3d')][_0xe80f('0x4a')]){_0x2bc5e4[_0xe80f('0x4b')]=[{'all':!![]}];}_0x2bc5e4=_['merge']({},_0x2bc5e4,_0x55ea99[_0xe80f('0x4f')]);return db[_0xe80f('0x37')][_0xe80f('0x50')](_0x2bc5e4)['then'](handleEntityNotFound(_0x3fc2ee,null))[_0xe80f('0x29')](respondWithResult(_0x3fc2ee,null))['catch'](handleError(_0x3fc2ee,null));};exports[_0xe80f('0x2a')]=function(_0x36923e,_0x10f546){return db[_0xe80f('0x37')]['find']({'where':{'id':_0x36923e[_0xe80f('0x4e')]['id']}})[_0xe80f('0x29')](handleEntityNotFound(_0x10f546,null))[_0xe80f('0x29')](removeEntity(_0x10f546,null))['catch'](handleError(_0x10f546,null));};exports[_0xe80f('0x51')]=function(_0x213e65,_0x47b18a){if(_0x213e65['body'][_0xe80f('0x3a')]===_0xe80f('0x2d')&&!_[_0xe80f('0x52')](_0x213e65[_0xe80f('0x53')][_0xe80f('0x54')],'_')){_0x213e65[_0xe80f('0x53')][_0xe80f('0x54')]='_'['concat'](_0x213e65[_0xe80f('0x53')][_0xe80f('0x54')]);}return db[_0xe80f('0x37')]['create'](_0x213e65[_0xe80f('0x53')],{'raw':![]})['then'](function(_0xce3de3){var _0x2e9552=_0x213e65[_0xe80f('0x55')][_0xe80f('0x2b')]({'plain':!![]});if(!_0x2e9552)throw new Error(_0xe80f('0x56'));if(_0x2e9552[_0xe80f('0x57')]===_0xe80f('0x55')){var _0x25cac1=_0xce3de3['get']({'plain':!![]});var _0x32a5da=[{'name':_0xe80f('0x58'),'value':_0xe80f('0x2c')},{'name':_0xe80f('0x59'),'value':_0xe80f('0x2d')},{'name':_0xe80f('0x2e'),'value':_0xe80f('0x5a')}];var _0x505574=_[_0xe80f('0x50')](_0x32a5da,['value',_0x25cac1[_0xe80f('0x3a')]])['name'];return db[_0xe80f('0x5b')][_0xe80f('0x50')]({'where':{'name':_0x505574,'userProfileId':_0x2e9552['userProfileId']},'raw':!![]})[_0xe80f('0x29')](function(_0x9a3065){if(_0x9a3065&&_0x9a3065[_0xe80f('0x5c')]===0x0){return db[_0xe80f('0x33')][_0xe80f('0x51')]({'name':_0x25cac1[_0xe80f('0x32')],'resourceId':_0x25cac1['id'],'type':_0x9a3065[_0xe80f('0x32')],'sectionId':_0x9a3065['id']},{})['then'](function(){return _0xce3de3;});}else{return _0xce3de3;}})['catch'](function(_0x4abfe1){logger[_0xe80f('0x34')](_0xe80f('0x5d'),_0x4abfe1);throw _0x4abfe1;});}return _0xce3de3;})['then'](respondWithResult(_0x47b18a,0xc9))[_0xe80f('0x4d')](handleError(_0x47b18a,null));};exports[_0xe80f('0x28')]=function(_0x308db4,_0x3bde22){if(_0x308db4['body']['id']){delete _0x308db4[_0xe80f('0x53')]['id'];}return db[_0xe80f('0x37')][_0xe80f('0x50')]({'where':{'id':_0x308db4['params']['id']}})[_0xe80f('0x29')](handleEntityNotFound(_0x3bde22,null))[_0xe80f('0x29')](function(_0x3e75a1){if(_0x3e75a1){return db[_0xe80f('0x37')]['update'](_[_0xe80f('0x48')](_0x308db4['body'],[_0xe80f('0x54'),'context',_0xe80f('0x5e'),_0xe80f('0x5f'),_0xe80f('0x60'),'mandatoryDisposition',_0xe80f('0x61')]),{'where':{'context':_0x3e75a1[_0xe80f('0x62')],'exten':_0x3e75a1[_0xe80f('0x54')]},'individualHooks':!![]})[_0xe80f('0x29')](function(_0x48a337){return _0x48a337;});}return null;})[_0xe80f('0x29')](respondWithStatusCode(_0x3bde22,null))['catch'](handleError(_0x3bde22,null));};exports[_0xe80f('0x63')]=function(_0x58683d,_0x11103a){return db[_0xe80f('0x37')]['findOne']({'where':{'id':_0x58683d[_0xe80f('0x4e')]['id']}})['then'](function(_0x25ff63){if(_0x25ff63){return db[_0xe80f('0x64')]['transaction'](function(_0x13e32d){return db[_0xe80f('0x37')]['destroy']({'where':{'VoiceExtensionId':_0x58683d[_0xe80f('0x4e')]['id']},'transaction':_0x13e32d})[_0xe80f('0x29')](function(){var _0x44acd6=_['map'](_0x58683d[_0xe80f('0x53')],function(_0x2b84b5){_0x2b84b5['VoiceExtensionId']=_0x58683d[_0xe80f('0x4e')]['id'];_0x2b84b5[_0xe80f('0x65')]=!![];return _0x2b84b5;});var _0x3d34e3=_0x58683d['query'][_0xe80f('0x66')]&&_0x58683d[_0xe80f('0x3d')][_0xe80f('0x66')][_0xe80f('0x67')]()===_0xe80f('0x68')?!![]:![];return _0x25ff63['createRouting'](_0x44acd6,_0x3d34e3);})[_0xe80f('0x29')](function(_0x5a352c){return db[_0xe80f('0x37')][_0xe80f('0x69')](_0x5a352c,{'transaction':_0x13e32d});});})[_0xe80f('0x29')](function(){return db[_0xe80f('0x37')][_0xe80f('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x58683d[_0xe80f('0x4e')]['id']},'order':_0xe80f('0x6b')});});}})[_0xe80f('0x29')](respondWithResult(_0x11103a,null))['catch'](handleError(_0x11103a,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d5c4e2a..944fe0d 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 _0xf626=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0xf626,0x159));var _0x6f62=function(_0xa47778,_0x3cd87d){_0xa47778=_0xa47778-0x0;var _0x3a8693=_0xf626[_0xa47778];return _0x3a8693;};'use strict';var EventEmitter=require(_0x6f62('0x0'));var VoiceExtension=require(_0x6f62('0x1'))['db'][_0x6f62('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6f62('0x3')](0x0);var events={'afterCreate':_0x6f62('0x4'),'afterUpdate':_0x6f62('0x5'),'afterDestroy':_0x6f62('0x6')};function emitEvent(_0x323e4c){return function(_0x40171f,_0x39ab5d,_0x37a04f){VoiceExtensionEvents['emit'](_0x323e4c+':'+_0x40171f['id'],_0x40171f);VoiceExtensionEvents[_0x6f62('0x7')](_0x323e4c,_0x40171f);_0x37a04f(null);};}for(var e in events){if(events[_0x6f62('0x8')](e)){var event=events[e];VoiceExtension[_0x6f62('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x5389=['hook','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x24863a,_0x356568){var _0x54449c=function(_0x52b293){while(--_0x52b293){_0x24863a['push'](_0x24863a['shift']());}};_0x54449c(++_0x356568);}(_0x5389,0x78));var _0x9538=function(_0x1343d4,_0x54d48c){_0x1343d4=_0x1343d4-0x0;var _0x3c32d4=_0x5389[_0x1343d4];return _0x3c32d4;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x9538('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9538('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9538('0x2'),'afterDestroy':_0x9538('0x3')};function emitEvent(_0x4be419){return function(_0x2d623e,_0x12bc8b,_0x414ed0){VoiceExtensionEvents[_0x9538('0x4')](_0x4be419+':'+_0x2d623e['id'],_0x2d623e);VoiceExtensionEvents['emit'](_0x4be419,_0x2d623e);_0x414ed0(null);};}for(var e in events){if(events[_0x9538('0x5')](e)){var event=events[e];VoiceExtension[_0x9538('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index ce338a6..5a51ec8 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 _0x0ab8=['join','Interval','findAll','interval','IntervalId','then','intervals','map','filter','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','exports','type','alias','Set','CDR(routeAlias)=','No\x20alias\x20set','context','exten','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','url','split','length','trunk','phone','prefix','SIP','options','indexOf','U(xcally-mixmonitor-context)','param'];(function(_0x27f32f,_0x387ccc){var _0x1b12c8=function(_0x12769a){while(--_0x12769a){_0x27f32f['push'](_0x27f32f['shift']());}};_0x1b12c8(++_0x387ccc);}(_0x0ab8,0x10b));var _0x80ab=function(_0x47b084,_0x36275a){_0x47b084=_0x47b084-0x0;var _0x161d41=_0x0ab8[_0x47b084];return _0x161d41;};'use strict';var util=require(_0x80ab('0x0'));var _=require(_0x80ab('0x1'));var attributes=require(_0x80ab('0x2'));module[_0x80ab('0x3')]=function(_0x2fc408){var _0x5a6ec6=_0x2fc408['models'];function _0x2eea23(_0x49de42){var _0x32a721=0x2;var _0x3c619f=[{'type':_0x49de42[_0x80ab('0x4')],'app':'Set','appdata':'CDR(type)='+_0x49de42[_0x80ab('0x4')],'context':_0x49de42['context'],'exten':_0x49de42['exten'],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']},{'type':_0x49de42['type'],'app':_0x49de42[_0x80ab('0x5')]?_0x80ab('0x6'):'NoOp','appdata':_0x49de42[_0x80ab('0x5')]?_0x80ab('0x7')+_0x49de42[_0x80ab('0x5')]:_0x80ab('0x8'),'context':_0x49de42[_0x80ab('0x9')],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']}];if(_0x49de42[_0x80ab('0x4')]===_0x80ab('0xb')){_0x3c619f['push']({'type':'inbound','app':_0x80ab('0x6'),'appdata':_0x80ab('0xc')+_0x49de42['id'],'context':_0x49de42[_0x80ab('0x9')],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']});}_0x3c619f[_0x80ab('0xd')]({'type':_0x49de42[_0x80ab('0x4')],'app':_0x80ab('0x6'),'appdata':_0x80ab('0xe'),'context':_0x49de42[_0x80ab('0x9')],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']},{'type':_0x49de42[_0x80ab('0x4')],'app':_0x80ab('0x6'),'appdata':_0x80ab('0xf'),'context':_0x49de42['context'],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']},{'type':_0x49de42[_0x80ab('0x4')],'app':'Set','appdata':_0x80ab('0x10'),'context':_0x49de42[_0x80ab('0x9')],'exten':_0x49de42[_0x80ab('0xa')],'priority':_0x32a721++,'VoiceExtensionId':_0x49de42['id']});return _0x3c619f;}function _0x2077b8(_0xcd12cc){var _0x20028c=0x2;var _0x837b9a=[{'type':_0x80ab('0x11'),'app':_0x80ab('0x6'),'appdata':_0x80ab('0x12'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':'outbound','app':_0xcd12cc['alias']?_0x80ab('0x6'):_0x80ab('0x13'),'appdata':_0xcd12cc[_0x80ab('0x5')]?'CDR(routeAlias)='+_0xcd12cc['alias']:_0x80ab('0x8'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':'outbound','app':_0x80ab('0x6'),'appdata':'CDR(destination)='+(_0xcd12cc[_0x80ab('0x14')]?_0x80ab('0x15')+_0xcd12cc[_0x80ab('0x14')]+'}':'${EXTEN}'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':'Set','appdata':_0x80ab('0xc')+_0xcd12cc['id'],'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':_0x80ab('0x16'),'appdata':_0x80ab('0x17')+(_0x20028c+0x2)+_0x80ab('0x18')+(_0x20028c+0x1)+')','context':_0xcd12cc['context'],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':_0x80ab('0x6'),'appdata':_0xcd12cc['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0xcd12cc[_0x80ab('0x14')]+'}':_0x80ab('0x19'),'context':_0xcd12cc['context'],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':'outbound','app':_0x80ab('0x6'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xcd12cc['context'],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':'outbound','app':_0x80ab('0x6'),'appdata':_0x80ab('0xf'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':_0x80ab('0x6'),'appdata':'MONITOR_OPTIONS=ab','context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':_0x80ab('0x6'),'appdata':_0x80ab('0x1a')+_0xcd12cc['id'],'context':_0xcd12cc['context'],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']}];if(_0xcd12cc[_0x80ab('0x1b')]('recordingFormat')&&_0xcd12cc[_0x80ab('0x1c')]!==_0x80ab('0x1d')){_0x837b9a['push']({'type':_0x80ab('0x11'),'app':'Set','appdata':_0x80ab('0x1e'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc[_0x80ab('0xa')],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']},{'type':_0x80ab('0x11'),'app':'Set','appdata':_0x80ab('0x1f')+_0xcd12cc[_0x80ab('0x1c')]||_0x80ab('0x20'),'context':_0xcd12cc[_0x80ab('0x9')],'exten':_0xcd12cc['exten'],'priority':_0x20028c++,'VoiceExtensionId':_0xcd12cc['id']});}return _0x837b9a;}function _0x375582(_0x1b1278){var _0x39c719=[{'name':'trunk','param':0x0},{'name':_0x80ab('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0x80ab('0x22'),'param':0x3}];var _0x5b4c6d={};var _0x7716bb=_0x1b1278[_0x80ab('0x23')](',');var _0x3c3ed6=[];for(var _0x1950ab=0x0;_0x1950ab<_0x39c719[_0x80ab('0x24')];_0x1950ab++){switch(_0x39c719[_0x1950ab]['name']){case _0x80ab('0x25'):_0x5b4c6d[_0x80ab('0x25')]=_0x7716bb[_0x39c719[_0x1950ab]['param']]['split']('/')[0x1];_0x5b4c6d[_0x80ab('0x26')]=_0x7716bb[_0x39c719[_0x1950ab]['param']]['split']('/')[0x2];_0x5b4c6d[_0x80ab('0x27')]=_0x5b4c6d[_0x80ab('0x26')]?_0x5b4c6d[_0x80ab('0x26')]['split']('$')[0x0]:undefined;_0x5b4c6d[_0x80ab('0x26')]=route[_0x80ab('0x14')]?(_0x5b4c6d[_0x80ab('0x27')]||'')+'${EXTEN:'+route[_0x80ab('0x14')]+'}':(_0x5b4c6d[_0x80ab('0x27')]||'')+'${EXTEN}';_0x3c3ed6[_0x39c719[_0x1950ab]['param']]=[_0x80ab('0x28'),_0x5b4c6d[_0x80ab('0x25')],_0x5b4c6d[_0x80ab('0x26')]]['join']('/');break;case _0x80ab('0x29'):_0x5b4c6d[_0x80ab('0x29')]=_0x7716bb[_0x39c719[_0x1950ab]['param']];if(route[_0x80ab('0x1c')]!==_0x80ab('0x1d')){if(_0x5b4c6d[_0x80ab('0x29')][_0x80ab('0x2a')](_0x80ab('0x2b'))<0x0){_0x5b4c6d['options']+=_0x80ab('0x2b');}}else{_0x5b4c6d[_0x80ab('0x29')]=_0x5b4c6d[_0x80ab('0x29')]['replace'](_0x80ab('0x2b'),'');}_0x3c3ed6[_0x39c719[_0x1950ab][_0x80ab('0x2c')]]=_0x5b4c6d['options'];break;default:_0x3c3ed6[_0x39c719[_0x1950ab][_0x80ab('0x2c')]]=_0x7716bb[_0x39c719[_0x1950ab][_0x80ab('0x2c')]];}}return _0x3c3ed6[_0x80ab('0x2d')](',');}function _0x42cd0b(_0x586134,_0x39afb4,_0x36eca8,_0x596850){return new Promise(function(_0x3596fd,_0xa65ec1){var _0x2a0144=[];if(_['isEmpty'](_0x39afb4))return _0x3596fd(_0x2a0144);_0x5a6ec6[_0x80ab('0x2e')][_0x80ab('0x2f')]({'attributes':['id',_0x80ab('0x30'),_0x80ab('0x31')],'raw':!![]})[_0x80ab('0x32')](function(_0x436ccf){for(var _0x3cb9dc=0x0,_0x1e9a4d=0x0;_0x3cb9dc<_0x39afb4[_0x80ab('0x24')];_0x3cb9dc++,_0x1e9a4d=0x0){var _0x490c3a=_0x39afb4[_0x3cb9dc];var _0x3e37d0=[];var _0x4eded5=[];if(_0x490c3a['interval']!=='*,*,*,*'){_0x490c3a[_0x80ab('0x33')]=[_0x490c3a[_0x80ab('0x30')]];}else{_0x490c3a[_0x80ab('0x33')]=_0x490c3a[_0x80ab('0x31')]?_[_0x80ab('0x34')](_[_0x80ab('0x35')](_0x436ccf,{'IntervalId':_0x490c3a[_0x80ab('0x31')]}),'interval'):[];}_0x490c3a[_0x80ab('0x9')]=_0x586134['context'];_0x490c3a[_0x80ab('0xa')]=_0x586134[_0x80ab('0xa')];if(_0x490c3a['type'])_0x490c3a[_0x80ab('0x4')]=_0x490c3a['type']['toLowerCase']();if(_0x586134[_0x80ab('0x4')]===_0x80ab('0x11')){if(_0x490c3a[_0x80ab('0x1b')](_0x80ab('0x36'))&&_0x490c3a[_0x80ab('0x36')]&&_0x490c3a['tag']!=='--'){_0x3e37d0[_0x80ab('0xd')]({'type':_0x490c3a['type']['toLowerCase'](),'app':_0x80ab('0x6'),'appdata':'CDR(tag)='+_0x490c3a[_0x80ab('0x36')],'context':_0x586134[_0x80ab('0x9')],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});}_0x3e37d0[_0x80ab('0xd')]({'type':_0x490c3a[_0x80ab('0x4')]['toLowerCase'](),'app':_0x80ab('0x16'),'appdata':_0x80ab('0x37')+(_0x490c3a[_0x80ab('0x38')]?'Set(CALLERID(all)='+_0x490c3a[_0x80ab('0x38')]+')':_0x80ab('0x39')),'context':_0x586134['context'],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a[_0x80ab('0x33')]['length']+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});}else{if(_0x490c3a['hasOwnProperty'](_0x80ab('0x3a'))){if([_0x80ab('0x3b'),_0x80ab('0x3c')]['includes'](_0x490c3a['app'][_0x80ab('0x3d')]())&&_0x490c3a[_0x80ab('0x3e')]!==_0x80ab('0x3f')){if(_0x490c3a[_0x80ab('0x3a')]){_0x3e37d0[_0x80ab('0xd')]({'type':_0x490c3a[_0x80ab('0x4')][_0x80ab('0x3d')](),'app':_0x80ab('0x16'),'appdata':_0x80ab('0x40'),'context':_0x586134[_0x80ab('0x9')],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});_0x3e37d0[_0x80ab('0xd')]({'type':_0x490c3a['type'][_0x80ab('0x3d')](),'app':'Set','appdata':_0x80ab('0x41'),'context':_0x586134[_0x80ab('0x9')],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a['intervals'][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});}else{_0x3e37d0['push']({'type':_0x490c3a[_0x80ab('0x4')][_0x80ab('0x3d')](),'app':_0x80ab('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x586134[_0x80ab('0x9')],'exten':_0x586134[_0x80ab('0xa')],'priority':_0x490c3a['intervals'][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});_0x3e37d0['push']({'type':_0x490c3a['type'][_0x80ab('0x3d')](),'app':'Set','appdata':_0x80ab('0x42'),'context':_0x586134[_0x80ab('0x9')],'exten':_0x586134['exten'],'priority':_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')]+_0x36eca8+_0x1e9a4d++,'VoiceExtensionId':_0x586134['id']});}}}}for(var _0x1a9d0e=0x0;_0x1a9d0e<_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')];_0x1a9d0e++){var _0x5ec25e=_0x36eca8+_0x490c3a[_0x80ab('0x33')]['length'];var _0x1b1597=_0x1a9d0e===_0x490c3a[_0x80ab('0x33')][_0x80ab('0x24')]-0x1?_0x36eca8+_0x3e37d0[_0x80ab('0x24')]+_0x4eded5[_0x80ab('0x24')]+0x2:_0x36eca8+_0x1a9d0e+0x1;_0x3e37d0[_0x80ab('0x43')](_0x1a9d0e,0x0,{'type':_0x586134[_0x80ab('0x4')],'app':_0x80ab('0x44'),'appdata':_0x490c3a[_0x80ab('0x33')][_0x1a9d0e]+'?'+_0x586134[_0x80ab('0x9')]+',${EXTEN},'+_0x5ec25e+':'+_0x586134[_0x80ab('0x9')]+',${EXTEN},'+_0x1b1597,'exten':_0x586134[_0x80ab('0xa')],'context':_0x586134[_0x80ab('0x9')],'priority':_0x36eca8+_0x1a9d0e,'VoiceExtensionId':_0x586134['id']});}if(_0x596850&&_0x490c3a['appType']===_0x80ab('0x45'))_0x490c3a[_0x80ab('0x46')]=_0x375582(_0x490c3a[_0x80ab('0x46')]);_0x490c3a[_0x80ab('0x47')]=_0x3e37d0[_0x80ab('0x24')]?_[_0x80ab('0x48')](_0x3e37d0)[_0x80ab('0x47')]+0x1:_0x36eca8;_0x2a0144=_[_0x80ab('0x49')](_0x2a0144,_0x3e37d0,[_0x490c3a],_0x4eded5);_0x36eca8=_[_0x80ab('0x48')](_0x2a0144)[_0x80ab('0x47')]+0x1;}return _0x3596fd(_0x2a0144);})[_0x80ab('0x4a')](function(_0x3aa510){_0xa65ec1(_0x3aa510);});});}return _0x2fc408['define'](_0x80ab('0x4b'),attributes,{'tableName':_0x80ab('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xaa2376,_0x3acb06){var _0x1ac513=this;var _0x14a82f=_0x1ac513[_0x80ab('0x4')]===_0x80ab('0x11')?_0x2077b8(_0x1ac513):_0x2eea23(_0x1ac513);return _0x42cd0b(_0x1ac513,_0xaa2376,_[_0x80ab('0x48')](_0x14a82f)[_0x80ab('0x47')]+0x1,_0x3acb06)[_0x80ab('0x32')](function(_0x1819f6){var _0x37bfb4=_[_0x80ab('0x49')](_0x14a82f,_0x1819f6);_0x37bfb4[_0x80ab('0xd')]({'type':_0x1ac513[_0x80ab('0x4')],'app':_0x80ab('0x4d'),'exten':_0x1ac513[_0x80ab('0xa')],'context':_0x1ac513[_0x80ab('0x9')],'priority':_['last'](_0x37bfb4)[_0x80ab('0x47')]+0x1,'VoiceExtensionId':_0x1ac513['id']});return _0x37bfb4;});}}});}; \ No newline at end of file +var _0x1434=['interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','length','ExecIf','callerID','Set(CALLERID(all)=','answer','queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','exports','models','type','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','Set','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','url','name','param','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','join','isEmpty'];(function(_0xaeac4e,_0x461a84){var _0x2d0bcf=function(_0x5cea9e){while(--_0x5cea9e){_0xaeac4e['push'](_0xaeac4e['shift']());}};_0x2d0bcf(++_0x461a84);}(_0x1434,0x16c));var _0x4143=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x1434[_0x2dadb9];return _0x2f0097;};'use strict';var util=require(_0x4143('0x0'));var _=require(_0x4143('0x1'));var attributes=require(_0x4143('0x2'));module[_0x4143('0x3')]=function(_0x3564dc){var _0x2e66a1=_0x3564dc[_0x4143('0x4')];function _0x510960(_0x49728d){var _0x5bbcf4=0x2;var _0xba79ed=[{'type':_0x49728d['type'],'app':'Set','appdata':'CDR(type)='+_0x49728d[_0x4143('0x5')],'context':_0x49728d['context'],'exten':_0x49728d[_0x4143('0x6')],'priority':_0x5bbcf4++,'VoiceExtensionId':_0x49728d['id']},{'type':_0x49728d['type'],'app':_0x49728d[_0x4143('0x7')]?'Set':'NoOp','appdata':_0x49728d[_0x4143('0x7')]?_0x4143('0x8')+_0x49728d[_0x4143('0x7')]:_0x4143('0x9'),'context':_0x49728d[_0x4143('0xa')],'exten':_0x49728d['exten'],'priority':_0x5bbcf4++,'VoiceExtensionId':_0x49728d['id']}];if(_0x49728d['type']===_0x4143('0xb')){_0xba79ed[_0x4143('0xc')]({'type':_0x4143('0xb'),'app':_0x4143('0xd'),'appdata':_0x4143('0xe')+_0x49728d['id'],'context':_0x49728d[_0x4143('0xa')],'exten':_0x49728d['exten'],'priority':_0x5bbcf4++,'VoiceExtensionId':_0x49728d['id']});}_0xba79ed[_0x4143('0xc')]({'type':_0x49728d[_0x4143('0x5')],'app':'Set','appdata':_0x4143('0xf'),'context':_0x49728d['context'],'exten':_0x49728d[_0x4143('0x6')],'priority':_0x5bbcf4++,'VoiceExtensionId':_0x49728d['id']},{'type':_0x49728d['type'],'app':_0x4143('0xd'),'appdata':_0x4143('0x10'),'context':_0x49728d[_0x4143('0xa')],'exten':_0x49728d[_0x4143('0x6')],'priority':_0x5bbcf4++,'VoiceExtensionId':_0x49728d['id']},{'type':_0x49728d[_0x4143('0x5')],'app':_0x4143('0xd'),'appdata':_0x4143('0x11'),'context':_0x49728d[_0x4143('0xa')],'exten':_0x49728d[_0x4143('0x6')],'priority':_0x5bbcf4++,'VoiceExtensionId':_0x49728d['id']});return _0xba79ed;}function _0x5be1c4(_0x114d0b){var _0x16d6d9=0x2;var _0x75a0fb=[{'type':_0x4143('0x12'),'app':_0x4143('0xd'),'appdata':_0x4143('0x13'),'context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':'outbound','app':_0x114d0b[_0x4143('0x7')]?'Set':_0x4143('0x14'),'appdata':_0x114d0b[_0x4143('0x7')]?'CDR(routeAlias)='+_0x114d0b[_0x4143('0x7')]:_0x4143('0x9'),'context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':_0x4143('0x12'),'app':'Set','appdata':'CDR(destination)='+(_0x114d0b['cutdigits']?_0x4143('0x15')+_0x114d0b[_0x4143('0x16')]+'}':_0x4143('0x17')),'context':_0x114d0b['context'],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':_0x4143('0x12'),'app':_0x4143('0xd'),'appdata':_0x4143('0xe')+_0x114d0b['id'],'context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':_0x4143('0x12'),'app':'ExecIf','appdata':_0x4143('0x18')+(_0x16d6d9+0x2)+_0x4143('0x19')+(_0x16d6d9+0x1)+')','context':_0x114d0b['context'],'exten':_0x114d0b['exten'],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':_0x4143('0x12'),'app':_0x4143('0xd'),'appdata':_0x114d0b[_0x4143('0x16')]?_0x4143('0x1a')+_0x114d0b[_0x4143('0x16')]+'}':'CDR(prefix)=noprefix','context':_0x114d0b['context'],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':_0x4143('0x12'),'app':'Set','appdata':_0x4143('0xf'),'context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b['exten'],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':_0x4143('0x12'),'app':'Set','appdata':_0x4143('0x10'),'context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':_0x4143('0x12'),'app':_0x4143('0xd'),'appdata':'MONITOR_OPTIONS=ab','context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':'outbound','app':_0x4143('0xd'),'appdata':_0x4143('0x1b')+_0x114d0b['id'],'context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']}];if(_0x114d0b['hasOwnProperty']('recordingFormat')&&_0x114d0b['recordingFormat']!==_0x4143('0x1c')){_0x75a0fb[_0x4143('0xc')]({'type':_0x4143('0x12'),'app':_0x4143('0xd'),'appdata':_0x4143('0x1d'),'context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']},{'type':_0x4143('0x12'),'app':_0x4143('0xd'),'appdata':_0x4143('0x1e')+_0x114d0b[_0x4143('0x1f')]||_0x4143('0x20'),'context':_0x114d0b[_0x4143('0xa')],'exten':_0x114d0b[_0x4143('0x6')],'priority':_0x16d6d9++,'VoiceExtensionId':_0x114d0b['id']});}return _0x75a0fb;}function _0x169078(_0x48bce3){var _0x1e829d=[{'name':_0x4143('0x21'),'param':0x0},{'name':_0x4143('0x22'),'param':0x1},{'name':_0x4143('0x23'),'param':0x2},{'name':_0x4143('0x24'),'param':0x3}];var _0x523de2={};var _0x326799=_0x48bce3['split'](',');var _0x50a067=[];for(var _0x262729=0x0;_0x262729<_0x1e829d['length'];_0x262729++){switch(_0x1e829d[_0x262729][_0x4143('0x25')]){case'trunk':_0x523de2['trunk']=_0x326799[_0x1e829d[_0x262729][_0x4143('0x26')]]['split']('/')[0x1];_0x523de2[_0x4143('0x27')]=_0x326799[_0x1e829d[_0x262729][_0x4143('0x26')]]['split']('/')[0x2];_0x523de2['prefix']=_0x523de2['phone']?_0x523de2[_0x4143('0x27')]['split']('$')[0x0]:undefined;_0x523de2['phone']=route['cutdigits']?(_0x523de2[_0x4143('0x28')]||'')+'${EXTEN:'+route[_0x4143('0x16')]+'}':(_0x523de2[_0x4143('0x28')]||'')+_0x4143('0x17');_0x50a067[_0x1e829d[_0x262729]['param']]=[_0x4143('0x29'),_0x523de2['trunk'],_0x523de2['phone']]['join']('/');break;case _0x4143('0x23'):_0x523de2['options']=_0x326799[_0x1e829d[_0x262729][_0x4143('0x26')]];if(route[_0x4143('0x1f')]!==_0x4143('0x1c')){if(_0x523de2[_0x4143('0x23')][_0x4143('0x2a')](_0x4143('0x2b'))<0x0){_0x523de2[_0x4143('0x23')]+=_0x4143('0x2b');}}else{_0x523de2[_0x4143('0x23')]=_0x523de2[_0x4143('0x23')]['replace'](_0x4143('0x2b'),'');}_0x50a067[_0x1e829d[_0x262729][_0x4143('0x26')]]=_0x523de2[_0x4143('0x23')];break;default:_0x50a067[_0x1e829d[_0x262729][_0x4143('0x26')]]=_0x326799[_0x1e829d[_0x262729][_0x4143('0x26')]];}}return _0x50a067[_0x4143('0x2c')](',');}function _0x5ba810(_0x43c95b,_0x1867b0,_0x54e121,_0x38cc46){return new Promise(function(_0x19f45b,_0x489fc4){var _0xabac50=[];if(_[_0x4143('0x2d')](_0x1867b0))return _0x19f45b(_0xabac50);_0x2e66a1['Interval']['findAll']({'attributes':['id',_0x4143('0x2e'),_0x4143('0x2f')],'raw':!![]})[_0x4143('0x30')](function(_0x1b030d){for(var _0x485469=0x0,_0x319c28=0x0;_0x485469<_0x1867b0['length'];_0x485469++,_0x319c28=0x0){var _0x33405b=_0x1867b0[_0x485469];var _0x237df9=[];var _0x45ba0c=[];if(_0x33405b[_0x4143('0x2e')]!==_0x4143('0x31')){_0x33405b[_0x4143('0x32')]=[_0x33405b[_0x4143('0x2e')]];}else{_0x33405b[_0x4143('0x32')]=_0x33405b[_0x4143('0x2f')]?_[_0x4143('0x33')](_[_0x4143('0x34')](_0x1b030d,{'IntervalId':_0x33405b[_0x4143('0x2f')]}),_0x4143('0x2e')):[];}_0x33405b[_0x4143('0xa')]=_0x43c95b[_0x4143('0xa')];_0x33405b['exten']=_0x43c95b['exten'];if(_0x33405b[_0x4143('0x5')])_0x33405b[_0x4143('0x5')]=_0x33405b[_0x4143('0x5')][_0x4143('0x35')]();if(_0x43c95b['type']===_0x4143('0x12')){if(_0x33405b[_0x4143('0x36')](_0x4143('0x37'))&&_0x33405b[_0x4143('0x37')]&&_0x33405b[_0x4143('0x37')]!=='--'){_0x237df9[_0x4143('0xc')]({'type':_0x33405b[_0x4143('0x5')]['toLowerCase'](),'app':_0x4143('0xd'),'appdata':_0x4143('0x38')+_0x33405b[_0x4143('0x37')],'context':_0x43c95b[_0x4143('0xa')],'exten':_0x43c95b['exten'],'priority':_0x33405b[_0x4143('0x32')][_0x4143('0x39')]+_0x54e121+_0x319c28++,'VoiceExtensionId':_0x43c95b['id']});}_0x237df9[_0x4143('0xc')]({'type':_0x33405b['type'][_0x4143('0x35')](),'app':_0x4143('0x3a'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x33405b[_0x4143('0x3b')]?_0x4143('0x3c')+_0x33405b['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x43c95b[_0x4143('0xa')],'exten':_0x43c95b[_0x4143('0x6')],'priority':_0x33405b[_0x4143('0x32')][_0x4143('0x39')]+_0x54e121+_0x319c28++,'VoiceExtensionId':_0x43c95b['id']});}else{if(_0x33405b['hasOwnProperty'](_0x4143('0x3d'))){if([_0x4143('0x3e'),_0x4143('0x3f')][_0x4143('0x40')](_0x33405b[_0x4143('0x41')][_0x4143('0x35')]())&&_0x33405b[_0x4143('0x42')]!=='custom'){if(_0x33405b[_0x4143('0x3d')]){_0x237df9[_0x4143('0xc')]({'type':_0x33405b['type'][_0x4143('0x35')](),'app':_0x4143('0x3a'),'appdata':_0x4143('0x43'),'context':_0x43c95b['context'],'exten':_0x43c95b['exten'],'priority':_0x33405b[_0x4143('0x32')][_0x4143('0x39')]+_0x54e121+_0x319c28++,'VoiceExtensionId':_0x43c95b['id']});_0x237df9['push']({'type':_0x33405b['type'][_0x4143('0x35')](),'app':_0x4143('0xd'),'appdata':_0x4143('0x44'),'context':_0x43c95b[_0x4143('0xa')],'exten':_0x43c95b[_0x4143('0x6')],'priority':_0x33405b[_0x4143('0x32')][_0x4143('0x39')]+_0x54e121+_0x319c28++,'VoiceExtensionId':_0x43c95b['id']});}else{_0x237df9[_0x4143('0xc')]({'type':_0x33405b[_0x4143('0x5')][_0x4143('0x35')](),'app':_0x4143('0x3a'),'appdata':_0x4143('0x45'),'context':_0x43c95b['context'],'exten':_0x43c95b[_0x4143('0x6')],'priority':_0x33405b['intervals'][_0x4143('0x39')]+_0x54e121+_0x319c28++,'VoiceExtensionId':_0x43c95b['id']});_0x237df9['push']({'type':_0x33405b[_0x4143('0x5')][_0x4143('0x35')](),'app':_0x4143('0xd'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x43c95b[_0x4143('0xa')],'exten':_0x43c95b[_0x4143('0x6')],'priority':_0x33405b['intervals'][_0x4143('0x39')]+_0x54e121+_0x319c28++,'VoiceExtensionId':_0x43c95b['id']});}}}}for(var _0x4b6176=0x0;_0x4b6176<_0x33405b[_0x4143('0x32')][_0x4143('0x39')];_0x4b6176++){var _0x3ec2e5=_0x54e121+_0x33405b[_0x4143('0x32')][_0x4143('0x39')];var _0x48a922=_0x4b6176===_0x33405b[_0x4143('0x32')]['length']-0x1?_0x54e121+_0x237df9[_0x4143('0x39')]+_0x45ba0c[_0x4143('0x39')]+0x2:_0x54e121+_0x4b6176+0x1;_0x237df9[_0x4143('0x46')](_0x4b6176,0x0,{'type':_0x43c95b[_0x4143('0x5')],'app':_0x4143('0x47'),'appdata':_0x33405b[_0x4143('0x32')][_0x4b6176]+'?'+_0x43c95b[_0x4143('0xa')]+',${EXTEN},'+_0x3ec2e5+':'+_0x43c95b['context']+',${EXTEN},'+_0x48a922,'exten':_0x43c95b[_0x4143('0x6')],'context':_0x43c95b['context'],'priority':_0x54e121+_0x4b6176,'VoiceExtensionId':_0x43c95b['id']});}if(_0x38cc46&&_0x33405b[_0x4143('0x42')]===_0x4143('0x48'))_0x33405b[_0x4143('0x49')]=_0x169078(_0x33405b['appdata']);_0x33405b[_0x4143('0x4a')]=_0x237df9[_0x4143('0x39')]?_['last'](_0x237df9)[_0x4143('0x4a')]+0x1:_0x54e121;_0xabac50=_[_0x4143('0x4b')](_0xabac50,_0x237df9,[_0x33405b],_0x45ba0c);_0x54e121=_[_0x4143('0x4c')](_0xabac50)[_0x4143('0x4a')]+0x1;}return _0x19f45b(_0xabac50);})[_0x4143('0x4d')](function(_0x4cda1d){_0x489fc4(_0x4cda1d);});});}return _0x3564dc[_0x4143('0x4e')](_0x4143('0x4f'),attributes,{'tableName':_0x4143('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x23e077,_0x5efbfa){var _0x2c6fb7=this;var _0x2927b6=_0x2c6fb7[_0x4143('0x5')]===_0x4143('0x12')?_0x5be1c4(_0x2c6fb7):_0x510960(_0x2c6fb7);return _0x5ba810(_0x2c6fb7,_0x23e077,_['last'](_0x2927b6)[_0x4143('0x4a')]+0x1,_0x5efbfa)['then'](function(_0x3c7691){var _0x27efde=_['concat'](_0x2927b6,_0x3c7691);_0x27efde[_0x4143('0xc')]({'type':_0x2c6fb7[_0x4143('0x5')],'app':_0x4143('0x51'),'exten':_0x2c6fb7[_0x4143('0x6')],'context':_0x2c6fb7[_0x4143('0xa')],'priority':_[_0x4143('0x4c')](_0x27efde)[_0x4143('0x4a')]+0x1,'VoiceExtensionId':_0x2c6fb7['id']});return _0x27efde;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 675b2e5..41b6343 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 _0xb4c7=['then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./voiceExtension.socket','register','request'];(function(_0xd33198,_0x5d4c0e){var _0x2277db=function(_0x541402){while(--_0x541402){_0xd33198['push'](_0xd33198['shift']());}};_0x2277db(++_0x5d4c0e);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x3c188c,_0x25d714){_0x3c188c=_0x3c188c-0x0;var _0x340bf8=_0xb4c7[_0x3c188c];return _0x340bf8;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});config[_0x7b4c('0xc')]=_['defaults'](config[_0x7b4c('0xc')],{'host':_0x7b4c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b4c('0xc')]));require(_0x7b4c('0xe'))[_0x7b4c('0xf')](socket);function respondWithRpcPromise(_0x237e28,_0x365225,_0x93d013){return new BPromise(function(_0x1a996f,_0xc62104){return client[_0x7b4c('0x10')](_0x237e28,_0x93d013)[_0x7b4c('0x11')](function(_0x5d5bc3){logger['info'](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));logger[_0x7b4c('0x14')](_0x7b4c('0x15'),_0x365225,_0x7b4c('0x13'),JSON[_0x7b4c('0x16')](_0x5d5bc3));if(_0x5d5bc3[_0x7b4c('0x17')]){if(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x18')]===0x1f4){logger[_0x7b4c('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0xc62104(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);}logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0x1a996f(_0x5d5bc3['error'][_0x7b4c('0x19')]);}else{logger[_0x7b4c('0x1a')](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));_0x1a996f(_0x5d5bc3['result'][_0x7b4c('0x19')]);}})[_0x7b4c('0x1b')](function(_0x32110e){logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x32110e);_0xc62104(_0x32110e);});});}exports[_0x7b4c('0x1c')]=function(_0x237110){var _0x445281=this;return new Promise(function(_0x3556d8,_0x55e3df){return db[_0x7b4c('0x1d')][_0x7b4c('0x1e')]({'raw':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x20')]===undefined?!![]:![]:!![],'where':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x21')]||null:null,'attributes':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')]['attributes']||null:null,'limit':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x22')]||null:null,'include':_0x237110[_0x7b4c('0x1f')]?_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x23')]?_[_0x7b4c('0x24')](_0x237110[_0x7b4c('0x1f')][_0x7b4c('0x23')],function(_0x1a69db){return{'model':db[_0x1a69db[_0x7b4c('0x25')]],'as':_0x1a69db['as'],'attributes':_0x1a69db[_0x7b4c('0x26')],'include':_0x1a69db[_0x7b4c('0x23')]?_['map'](_0x1a69db[_0x7b4c('0x23')],function(_0x3ab614){return{'model':db[_0x3ab614[_0x7b4c('0x25')]],'as':_0x3ab614['as'],'attributes':_0x3ab614[_0x7b4c('0x26')],'include':_0x3ab614[_0x7b4c('0x23')]?_[_0x7b4c('0x24')](_0x3ab614[_0x7b4c('0x23')],function(_0x2552f9){return{'model':db[_0x2552f9[_0x7b4c('0x25')]],'as':_0x2552f9['as'],'attributes':_0x2552f9[_0x7b4c('0x26')]};}):[]};}):[]};}):[]:[]})[_0x7b4c('0x11')](function(_0x130ace){logger[_0x7b4c('0x1a')](_0x7b4c('0x1c'),_0x237110);logger[_0x7b4c('0x14')](_0x7b4c('0x1c'),_0x237110,JSON[_0x7b4c('0x16')](_0x130ace));_0x3556d8(_0x130ace);})[_0x7b4c('0x1b')](function(_0x9d3d31){logger['error']('GetVoiceExtension',_0x9d3d31['message'],_0x237110);_0x55e3df(_0x445281[_0x7b4c('0x17')](0x1f4,_0x9d3d31[_0x7b4c('0x19')]));});});}; \ No newline at end of file +var _0xd45e=['GetVoiceExtension','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','result','findAll','options','raw','limit','map','include','attributes','model','catch'];(function(_0x253d53,_0x9e2cd1){var _0x1244ac=function(_0x508518){while(--_0x508518){_0x253d53['push'](_0x253d53['shift']());}};_0x1244ac(++_0x9e2cd1);}(_0xd45e,0x182));var _0xed45=function(_0x3e35e9,_0x343705){_0x3e35e9=_0x3e35e9-0x0;var _0x5a9829=_0xd45e[_0x3e35e9];return _0x5a9829;};'use strict';var _=require('lodash');var util=require(_0xed45('0x0'));var moment=require(_0xed45('0x1'));var BPromise=require('bluebird');var rs=require(_0xed45('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed45('0x3'))['db'];var utils=require(_0xed45('0x4'));var logger=require(_0xed45('0x5'))('rpc');var config=require(_0xed45('0x6'));var jayson=require(_0xed45('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xed45('0x8')]=_[_0xed45('0x9')](config['redis'],{'host':_0xed45('0xa'),'port':0x18eb});var socket=require(_0xed45('0xb'))(new Redis(config[_0xed45('0x8')]));require(_0xed45('0xc'))[_0xed45('0xd')](socket);function respondWithRpcPromise(_0x2ea0be,_0x52c747,_0x53fce3){return new BPromise(function(_0xded80e,_0x219878){return client[_0xed45('0xe')](_0x2ea0be,_0x53fce3)[_0xed45('0xf')](function(_0x3ad89f){logger[_0xed45('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x52c747,_0xed45('0x11'));logger[_0xed45('0x12')](_0xed45('0x13'),_0x52c747,_0xed45('0x11'),JSON['stringify'](_0x3ad89f));if(_0x3ad89f[_0xed45('0x14')]){if(_0x3ad89f['error'][_0xed45('0x15')]===0x1f4){logger[_0xed45('0x14')](_0xed45('0x16'),_0x52c747,_0x3ad89f[_0xed45('0x14')]['message']);return _0x219878(_0x3ad89f[_0xed45('0x14')][_0xed45('0x17')]);}logger[_0xed45('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x52c747,_0x3ad89f[_0xed45('0x14')]['message']);return _0xded80e(_0x3ad89f[_0xed45('0x14')][_0xed45('0x17')]);}else{logger[_0xed45('0x10')](_0xed45('0x16'),_0x52c747,'request\x20sent');_0xded80e(_0x3ad89f[_0xed45('0x18')]['message']);}})['catch'](function(_0x14ca4a){logger[_0xed45('0x14')](_0xed45('0x16'),_0x52c747,_0x14ca4a);_0x219878(_0x14ca4a);});});}exports['GetVoiceExtension']=function(_0x582d92){var _0xaa120e=this;return new Promise(function(_0x113e95,_0x481c8e){return db['VoiceExtension'][_0xed45('0x19')]({'raw':_0x582d92[_0xed45('0x1a')]?_0x582d92[_0xed45('0x1a')][_0xed45('0x1b')]===undefined?!![]:![]:!![],'where':_0x582d92[_0xed45('0x1a')]?_0x582d92[_0xed45('0x1a')]['where']||null:null,'attributes':_0x582d92['options']?_0x582d92['options']['attributes']||null:null,'limit':_0x582d92[_0xed45('0x1a')]?_0x582d92[_0xed45('0x1a')][_0xed45('0x1c')]||null:null,'include':_0x582d92[_0xed45('0x1a')]?_0x582d92['options']['include']?_[_0xed45('0x1d')](_0x582d92[_0xed45('0x1a')][_0xed45('0x1e')],function(_0x55290d){return{'model':db[_0x55290d['model']],'as':_0x55290d['as'],'attributes':_0x55290d[_0xed45('0x1f')],'include':_0x55290d['include']?_['map'](_0x55290d[_0xed45('0x1e')],function(_0xc7dc3f){return{'model':db[_0xc7dc3f['model']],'as':_0xc7dc3f['as'],'attributes':_0xc7dc3f[_0xed45('0x1f')],'include':_0xc7dc3f[_0xed45('0x1e')]?_[_0xed45('0x1d')](_0xc7dc3f[_0xed45('0x1e')],function(_0x34c1a9){return{'model':db[_0x34c1a9[_0xed45('0x20')]],'as':_0x34c1a9['as'],'attributes':_0x34c1a9[_0xed45('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x427bc7){logger[_0xed45('0x10')]('GetVoiceExtension',_0x582d92);logger[_0xed45('0x12')]('GetVoiceExtension',_0x582d92,JSON['stringify'](_0x427bc7));_0x113e95(_0x427bc7);})[_0xed45('0x21')](function(_0x1c2698){logger[_0xed45('0x14')](_0xed45('0x22'),_0x1c2698[_0xed45('0x17')],_0x582d92);_0x481c8e(_0xaa120e['error'](0x1f4,_0x1c2698[_0xed45('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 2a9b479..9d18c12 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x42daa5,_0x345b51){var _0xadfa2b=function(_0x593a02){while(--_0x593a02){_0x42daa5['push'](_0x42daa5['shift']());}};_0xadfa2b(++_0x345b51);}(_0x53ec,0x192));var _0xc53e=function(_0x39b07e,_0x33b057){_0x39b07e=_0x39b07e-0x0;var _0x591dae=_0x53ec[_0x39b07e];return _0x591dae;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x508338,_0xcf1f4d){var _0x1ccd1b=function(_0x3b4525){while(--_0x3b4525){_0x508338['push'](_0x508338['shift']());}};_0x1ccd1b(++_0xcf1f4d);}(_0xe14b,0x93));var _0xbe14=function(_0x39ca72,_0x448219){_0x39ca72=_0x39ca72-0x0;var _0x3cf6de=_0xe14b[_0x39ca72];return _0x3cf6de;};'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 b498f6b..c1a4f51 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 _0xd046=['get','show','getMessages','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMail.controller','index'];(function(_0x4fd272,_0x1ff97d){var _0x50948=function(_0x489827){while(--_0x489827){_0x4fd272['push'](_0x4fd272['shift']());}};_0x50948(++_0x1ff97d);}(_0xd046,0x129));var _0x6d04=function(_0x4e4458,_0xf33e8f){_0x4e4458=_0x4e4458-0x0;var _0x56bc7c=_0xd046[_0x4e4458];return _0x56bc7c;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['post']('/',auth[_0x6d04('0xa')](),controller['create']);router['put']('/:id',auth[_0x6d04('0xa')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')](_0x6d04('0xd'),auth['isAuthenticated'](),controller[_0x6d04('0xe')]);module[_0x6d04('0xf')]=router; \ No newline at end of file +var _0x7bd0=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x140f89,_0x169a9a){var _0x4f2b9c=function(_0xa7e803){while(--_0xa7e803){_0x140f89['push'](_0x140f89['shift']());}};_0x4f2b9c(++_0x169a9a);}(_0x7bd0,0x111));var _0x07bd=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x7bd0[_0x15b380];return _0x232c5c;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var fs_extra=require(_0x07bd('0x6'));var auth=require(_0x07bd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x07bd('0x8'));var controller=require(_0x07bd('0x9'));router[_0x07bd('0xa')]('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0xc')]);router[_0x07bd('0xa')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0xe')]);router['get'](_0x07bd('0xf'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x10')]);router['post']('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0x11')]);router[_0x07bd('0x12')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0x13')]);router[_0x07bd('0x14')](_0x07bd('0xd'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x15')]);module[_0x07bd('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index ae6c985..ebd84cc 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 _0x7637=['VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x285ec4,_0x2430d0){var _0x51377=function(_0x5a9539){while(--_0x5a9539){_0x285ec4['push'](_0x285ec4['shift']());}};_0x51377(++_0x2430d0);}(_0x7637,0xaf));var _0x7763=function(_0x4dc8c6,_0x3fba52){_0x4dc8c6=_0x4dc8c6-0x0;var _0x69ce1d=_0x7637[_0x4dc8c6];return _0x69ce1d;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x7763('0x0')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x7763('0x1'),'unique':_0x7763('0x2')},'mailbox':{'type':Sequelize[_0x7763('0x0')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7763('0x0')]},'fullname':{'type':Sequelize[_0x7763('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x2b6f0c){this[_0x7763('0x3')](_0x7763('0x4'),typeof _0x2b6f0c===_0x7763('0x5')&&_0x2b6f0c[_0x7763('0x6')]()?_0x2b6f0c['trim']():null);}},'pager':{'type':Sequelize[_0x7763('0x0')]},'tz':{'type':Sequelize[_0x7763('0x0')],'defaultValue':_0x7763('0x7')},'attach':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':_0x7763('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':_0x7763('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7763('0x0')]},'callback':{'type':Sequelize[_0x7763('0x0')]},'review':{'type':Sequelize['ENUM'](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7763('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7763('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':_0x7763('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7763('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7763('0x8')](_0x7763('0x9'),'no'),'defaultValue':_0x7763('0x9'),'allowNull':![]},'stamp':{'type':_0x7763('0xb')},'emailsubject':{'type':Sequelize[_0x7763('0x0')]},'emailbody':{'type':Sequelize[_0x7763('0x0')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7763('0xc')],'get':function(){return this['getDataValue'](_0x7763('0xd'))+_0x7763('0xe')+this[_0x7763('0xf')](_0x7763('0x10'));}}}; \ No newline at end of file +var _0x1861=['trim','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string'];(function(_0x41d7ae,_0xd9cb25){var _0x5db9f5=function(_0x366ad4){while(--_0x366ad4){_0x41d7ae['push'](_0x41d7ae['shift']());}};_0x5db9f5(++_0xd9cb25);}(_0x1861,0x14e));var _0x1186=function(_0xdbe14f,_0x1020e3){_0xdbe14f=_0xdbe14f-0x0;var _0x1d0618=_0x1861[_0xdbe14f];return _0x1d0618;};'use strict';var Sequelize=require(_0x1186('0x0'));module[_0x1186('0x1')]={'customer_id':{'type':Sequelize[_0x1186('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x1186('0x3'),'unique':_0x1186('0x4')},'mailbox':{'type':Sequelize[_0x1186('0x2')],'defaultValue':'','allowNull':![],'unique':_0x1186('0x4')},'password':{'type':Sequelize[_0x1186('0x2')]},'fullname':{'type':Sequelize[_0x1186('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x5c542a){this[_0x1186('0x5')](_0x1186('0x6'),typeof _0x5c542a===_0x1186('0x7')&&_0x5c542a[_0x1186('0x8')]()?_0x5c542a[_0x1186('0x8')]():null);}},'pager':{'type':Sequelize[_0x1186('0x2')]},'tz':{'type':Sequelize[_0x1186('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x1186('0x9'),'no'),'defaultValue':_0x1186('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1186('0xa')](_0x1186('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1186('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x1186('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1186('0xa')](_0x1186('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1186('0xa')](_0x1186('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1186('0xa')](_0x1186('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1186('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1186('0xa')](_0x1186('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1186('0xa')](_0x1186('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1186('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x1186('0xa')](_0x1186('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1186('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1186('0xa')](_0x1186('0x9'),'no'),'defaultValue':_0x1186('0x9'),'allowNull':![]},'stamp':{'type':_0x1186('0xc')},'emailsubject':{'type':Sequelize[_0x1186('0x2')]},'emailbody':{'type':Sequelize[_0x1186('0x2')]},'maxsecs':{'type':Sequelize[_0x1186('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1186('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1186('0xe')],'get':function(){return this[_0x1186('0xf')](_0x1186('0x10'))+_0x1186('0x11')+this['getDataValue'](_0x1186('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index b1e35ae..4b0f036 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 _0xe1e3=['set','Content-Range','apply','reject','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','send','VoiceMail','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','body','VoiceMailMessage','nolimit','order','options','findAndCountAll','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status'];(function(_0x1633e9,_0x50a939){var _0x549ace=function(_0x15a157){while(--_0x15a157){_0x1633e9['push'](_0x1633e9['shift']());}};_0x549ace(++_0x50a939);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x24c497,_0x38f74b){_0x24c497=_0x24c497-0x0;var _0x4240d4=_0xe1e3[_0x24c497];return _0x4240d4;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){var _0x33bf0f=_0x60e6bc[_0x3e1e('0x1f')]({'plain':!![]});var _0x159212=_0x3e1e('0x20');return db[_0x3e1e('0x21')]['destroy']({'where':{'type':_0x159212,'resourceId':_0x33bf0f['id']}})['then'](function(){return _0x60e6bc;});})[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be84e,_0x56b9a8){return function(_0x1a33bb){if(!_0x1a33bb){_0x4be84e[_0x3e1e('0x14')](0x194);}return _0x1a33bb;};}function handleError(_0x5b1bd1,_0x52f966){_0x52f966=_0x52f966||0x1f4;return function(_0x5ac814){logger[_0x3e1e('0x22')](_0x5ac814[_0x3e1e('0x23')]);if(_0x5ac814['name']){delete _0x5ac814[_0x3e1e('0x24')];}_0x5b1bd1[_0x3e1e('0x18')](_0x52f966)[_0x3e1e('0x25')](_0x5ac814);};}exports['index']=function(_0xdef39,_0x4ec149){var _0x591c36={},_0x494c75={},_0x39da8d={'count':0x0,'rows':[]};var _0x5b8f95=_['map'](db[_0x3e1e('0x26')][_0x3e1e('0x27')],function(_0x1c57c2){return{'name':_0x1c57c2[_0x3e1e('0x28')],'type':_0x1c57c2[_0x3e1e('0x29')]['key']};});_0x494c75['model']=_['map'](_0x5b8f95,'name');_0x494c75[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0xdef39[_0x3e1e('0x2a')]);_0x494c75[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x494c75[_0x3e1e('0x2e')],_0x494c75[_0x3e1e('0x2a')]);_0x591c36[_0x3e1e('0x2f')]=_['intersection'](_0x494c75[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0xdef39['query'][_0x3e1e('0x30')]));_0x591c36[_0x3e1e('0x2f')]=_0x591c36[_0x3e1e('0x2f')][_0x3e1e('0x31')]?_0x591c36['attributes']:_0x494c75['model'];if(!_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x32')]('nolimit')){_0x591c36[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0xdef39['query'][_0x3e1e('0x16')]);_0x591c36[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x15')]);}_0x591c36['order']=qs[_0x3e1e('0x33')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x33')]);_0x591c36[_0x3e1e('0x34')]=qs['filters'](_[_0x3e1e('0x35')](_0xdef39[_0x3e1e('0x2a')],_0x494c75[_0x3e1e('0x2c')]),_0x5b8f95);if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x591c36[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x591c36['where'],{'$or':_[_0x3e1e('0x38')](_0x5b8f95,function(_0x4fdd7c){if(_0x4fdd7c['type']!==_0x3e1e('0x39')){var _0x469a42={};_0x469a42[_0x4fdd7c[_0x3e1e('0x24')]]={'$like':'%'+_0xdef39['query'][_0x3e1e('0x36')]+'%'};return _0x469a42;}})});}_0x591c36=_[_0x3e1e('0x37')]({},_0x591c36,_0xdef39['options']);var _0x16d03f={'where':_0x591c36[_0x3e1e('0x34')]};return db['VoiceMail']['count'](_0x16d03f)[_0x3e1e('0x1e')](function(_0x49e4cb){_0x39da8d['count']=_0x49e4cb;if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0x591c36[_0x3e1e('0x3b')]=[{'all':!![]}];}return db[_0x3e1e('0x26')][_0x3e1e('0x3c')](_0x591c36);})['then'](function(_0x5b32ad){_0x39da8d[_0x3e1e('0x3d')]=_0x5b32ad;return _0x39da8d;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0x4ec149,_0x591c36))[_0x3e1e('0x3e')](handleError(_0x4ec149,null));};exports['show']=function(_0x1124d0,_0x2dcce1){var _0xabe865={'raw':!![],'where':{'id':_0x1124d0[_0x3e1e('0x3f')]['id']}},_0x4ad5fd={};_0x4ad5fd['model']=_['keys'](db[_0x3e1e('0x26')][_0x3e1e('0x27')]);_0x4ad5fd[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0x1124d0['query']);_0x4ad5fd['filters']=_['intersection'](_0x4ad5fd['model'],_0x4ad5fd[_0x3e1e('0x2a')]);_0xabe865[_0x3e1e('0x2f')]=_['intersection'](_0x4ad5fd['model'],qs[_0x3e1e('0x30')](_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x30')]));_0xabe865['attributes']=_0xabe865[_0x3e1e('0x2f')]['length']?_0xabe865[_0x3e1e('0x2f')]:_0x4ad5fd[_0x3e1e('0x2e')];if(_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0xabe865[_0x3e1e('0x3b')]=[{'all':!![]}];}_0xabe865=_[_0x3e1e('0x37')]({},_0xabe865,_0x1124d0['options']);return db[_0x3e1e('0x26')][_0x3e1e('0x40')](_0xabe865)['then'](handleEntityNotFound(_0x2dcce1,null))[_0x3e1e('0x1e')](respondWithResult(_0x2dcce1,null))[_0x3e1e('0x3e')](handleError(_0x2dcce1,null));};exports['create']=function(_0x1cc820,_0x347b3f){return db[_0x3e1e('0x26')][_0x3e1e('0x41')](_0x1cc820['body'],{})[_0x3e1e('0x1e')](function(_0x3d7303){var _0x29d23b=_0x1cc820[_0x3e1e('0x42')]['get']({'plain':!![]});if(!_0x29d23b)throw new Error(_0x3e1e('0x43'));if(_0x29d23b[_0x3e1e('0x44')]===_0x3e1e('0x42')){var _0x25ddf7=_0x3d7303[_0x3e1e('0x1f')]({'plain':!![]});var _0x1df5a8=_0x3e1e('0x20');return db[_0x3e1e('0x45')]['find']({'where':{'name':_0x1df5a8,'userProfileId':_0x29d23b[_0x3e1e('0x46')]},'raw':!![]})['then'](function(_0x5b0d0d){if(_0x5b0d0d&&_0x5b0d0d['autoAssociation']===0x0){return db[_0x3e1e('0x21')][_0x3e1e('0x41')]({'name':_0x25ddf7['name'],'resourceId':_0x25ddf7['id'],'type':_0x5b0d0d[_0x3e1e('0x24')],'sectionId':_0x5b0d0d['id']},{})['then'](function(){return _0x3d7303;});}else{return _0x3d7303;}})['catch'](function(_0x3eaf76){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eaf76);throw _0x3eaf76;});}return _0x3d7303;})['then'](respondWithResult(_0x347b3f,0xc9))[_0x3e1e('0x3e')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x47')]=function(_0x1334c8,_0x162a51){if(_0x1334c8[_0x3e1e('0x48')]['id']){delete _0x1334c8[_0x3e1e('0x48')]['id'];}return db[_0x3e1e('0x26')]['find']({'where':{'id':_0x1334c8[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x162a51,null))[_0x3e1e('0x1e')](saveUpdates(_0x1334c8[_0x3e1e('0x48')],null))[_0x3e1e('0x1e')](respondWithResult(_0x162a51,null))['catch'](handleError(_0x162a51,null));};exports['destroy']=function(_0xba8d16,_0xb1456e){return db['VoiceMail'][_0x3e1e('0x40')]({'where':{'id':_0xba8d16['params']['id']}})['then'](handleEntityNotFound(_0xb1456e,null))[_0x3e1e('0x1e')](removeEntity(_0xb1456e,null))[_0x3e1e('0x3e')](handleError(_0xb1456e,null));};exports['getMessages']=function(_0x17bc26,_0x551f12,_0x553451){return db[_0x3e1e('0x26')]['findOne']({'where':{'id':_0x17bc26[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x551f12,null))[_0x3e1e('0x1e')](function(_0x57d845){var _0x7ea199;var _0x8a4987={},_0x48be40={};_0x48be40['model']=_['keys'](db[_0x3e1e('0x49')][_0x3e1e('0x27')]);_0x48be40[_0x3e1e('0x2a')]=_['keys'](_0x17bc26[_0x3e1e('0x2a')]);_0x48be40[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x48be40['model'],_0x48be40['query']);_0x8a4987[_0x3e1e('0x2f')]=_['intersection'](_0x48be40[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0x17bc26[_0x3e1e('0x2a')]['fields']));_0x8a4987[_0x3e1e('0x2f')]=_0x8a4987['attributes'][_0x3e1e('0x31')]?_0x8a4987[_0x3e1e('0x2f')]:_0x48be40['model'];if(!_0x17bc26[_0x3e1e('0x2a')]['hasOwnProperty'](_0x3e1e('0x4a'))){_0x8a4987['limit']=qs[_0x3e1e('0x16')](_0x17bc26['query'][_0x3e1e('0x16')]);_0x8a4987[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0x17bc26['query'][_0x3e1e('0x15')]);}_0x8a4987[_0x3e1e('0x4b')]=qs['sort'](_0x17bc26[_0x3e1e('0x2a')]['sort']);_0x8a4987['where']=qs['filters'](_[_0x3e1e('0x35')](_0x17bc26[_0x3e1e('0x2a')],_0x48be40[_0x3e1e('0x2c')]));if(_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'$or':_[_0x3e1e('0x38')](_0x8a4987[_0x3e1e('0x2f')],function(_0x4634c0){var _0x2a9c84={};_0x2a9c84[_0x4634c0]={'$like':'%'+_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]+'%'};return _0x2a9c84;})});}_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'mailboxuser':_0x57d845['mailbox']});_0x8a4987=_[_0x3e1e('0x37')]({},_0x8a4987,_0x17bc26[_0x3e1e('0x4c')]);return db[_0x3e1e('0x49')][_0x3e1e('0x4d')](_0x8a4987)[_0x3e1e('0x1e')](respondWithFilteredResult(_0x551f12,_0x8a4987));})[_0x3e1e('0x3e')](handleError(_0x551f12,null));}; \ No newline at end of file +var _0xf45e=['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','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource','error','stack','name','send','map','VoiceMail','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir'];(function(_0x16e1be,_0x5e7ae0){var _0x2f0a23=function(_0xe9e1a9){while(--_0xe9e1a9){_0x16e1be['push'](_0x16e1be['shift']());}};_0x2f0a23(++_0x5e7ae0);}(_0xf45e,0x115));var _0xef45=function(_0x2cb34f,_0x4c2bf0){_0x2cb34f=_0x2cb34f-0x0;var _0x5db55d=_0xf45e[_0x2cb34f];return _0x5db55d;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){var _0x315777=_0x7817d0['get']({'plain':!![]});var _0x208b35='Voicemails';return db[_0xef45('0x2a')][_0xef45('0x28')]({'where':{'type':_0x208b35,'resourceId':_0x315777['id']}})['then'](function(){return _0x7817d0;});})[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1096af,_0x4f8c9b){return function(_0x550e18){if(!_0x550e18){_0x1096af['sendStatus'](0x194);}return _0x550e18;};}function handleError(_0x53690e,_0x1f636f){_0x1f636f=_0x1f636f||0x1f4;return function(_0x2f72ef){logger[_0xef45('0x2b')](_0x2f72ef[_0xef45('0x2c')]);if(_0x2f72ef['name']){delete _0x2f72ef[_0xef45('0x2d')];}_0x53690e['status'](_0x1f636f)[_0xef45('0x2e')](_0x2f72ef);};}exports['index']=function(_0x3e6922,_0x5bfd2d){var _0x575734={},_0x14ce5a={},_0x3e45de={'count':0x0,'rows':[]};var _0x390a7a=_[_0xef45('0x2f')](db[_0xef45('0x30')]['rawAttributes'],function(_0x5551ce){return{'name':_0x5551ce['fieldName'],'type':_0x5551ce[_0xef45('0x31')][_0xef45('0x32')]};});_0x14ce5a[_0xef45('0x33')]=_[_0xef45('0x2f')](_0x390a7a,_0xef45('0x2d'));_0x14ce5a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x3e6922['query']);_0x14ce5a['filters']=_[_0xef45('0x36')](_0x14ce5a['model'],_0x14ce5a[_0xef45('0x34')]);_0x575734['attributes']=_[_0xef45('0x36')](_0x14ce5a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x3e6922[_0xef45('0x34')][_0xef45('0x37')]));_0x575734['attributes']=_0x575734[_0xef45('0x38')][_0xef45('0x39')]?_0x575734[_0xef45('0x38')]:_0x14ce5a['model'];if(!_0x3e6922['query'][_0xef45('0x3a')](_0xef45('0x3b'))){_0x575734['limit']=qs[_0xef45('0x20')](_0x3e6922['query']['limit']);_0x575734[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x3e6922[_0xef45('0x34')]['offset']);}_0x575734[_0xef45('0x3c')]=qs[_0xef45('0x3d')](_0x3e6922[_0xef45('0x34')][_0xef45('0x3d')]);_0x575734['where']=qs['filters'](_[_0xef45('0x3e')](_0x3e6922[_0xef45('0x34')],_0x14ce5a[_0xef45('0x3f')]),_0x390a7a);if(_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]){_0x575734[_0xef45('0x41')]=_[_0xef45('0x42')](_0x575734[_0xef45('0x41')],{'$or':_['map'](_0x390a7a,function(_0x4f5877){if(_0x4f5877[_0xef45('0x31')]!==_0xef45('0x43')){var _0x154e72={};_0x154e72[_0x4f5877[_0xef45('0x2d')]]={'$like':'%'+_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]+'%'};return _0x154e72;}})});}_0x575734=_[_0xef45('0x42')]({},_0x575734,_0x3e6922[_0xef45('0x44')]);var _0x3a5082={'where':_0x575734[_0xef45('0x41')]};return db[_0xef45('0x30')][_0xef45('0x21')](_0x3a5082)[_0xef45('0x29')](function(_0xd7d217){_0x3e45de[_0xef45('0x21')]=_0xd7d217;if(_0x3e6922[_0xef45('0x34')]['includeAll']){_0x575734[_0xef45('0x45')]=[{'all':!![]}];}return db[_0xef45('0x30')][_0xef45('0x46')](_0x575734);})[_0xef45('0x29')](function(_0x54ccb8){_0x3e45de[_0xef45('0x47')]=_0x54ccb8;return _0x3e45de;})['then'](respondWithFilteredResult(_0x5bfd2d,_0x575734))[_0xef45('0x48')](handleError(_0x5bfd2d,null));};exports['show']=function(_0x5faf67,_0x2d086f){var _0x2236d9={'raw':!![],'where':{'id':_0x5faf67[_0xef45('0x49')]['id']}},_0x36e81a={};_0x36e81a[_0xef45('0x33')]=_[_0xef45('0x35')](db['VoiceMail'][_0xef45('0x4a')]);_0x36e81a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5faf67[_0xef45('0x34')]);_0x36e81a[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],_0x36e81a[_0xef45('0x34')]);_0x2236d9[_0xef45('0x38')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x5faf67[_0xef45('0x34')][_0xef45('0x37')]));_0x2236d9[_0xef45('0x38')]=_0x2236d9['attributes'][_0xef45('0x39')]?_0x2236d9[_0xef45('0x38')]:_0x36e81a[_0xef45('0x33')];if(_0x5faf67['query']['includeAll']){_0x2236d9['include']=[{'all':!![]}];}_0x2236d9=_[_0xef45('0x42')]({},_0x2236d9,_0x5faf67[_0xef45('0x44')]);return db[_0xef45('0x30')][_0xef45('0x4b')](_0x2236d9)[_0xef45('0x29')](handleEntityNotFound(_0x2d086f,null))[_0xef45('0x29')](respondWithResult(_0x2d086f,null))['catch'](handleError(_0x2d086f,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){return db['VoiceMail']['create'](_0x463796[_0xef45('0x4d')],{})[_0xef45('0x29')](function(_0x4feeb1){var _0x1a56ae=_0x463796[_0xef45('0x4e')][_0xef45('0x4f')]({'plain':!![]});if(!_0x1a56ae)throw new Error(_0xef45('0x50'));if(_0x1a56ae[_0xef45('0x51')]===_0xef45('0x4e')){var _0x23581f=_0x4feeb1[_0xef45('0x4f')]({'plain':!![]});var _0x1961b4=_0xef45('0x52');return db[_0xef45('0x53')][_0xef45('0x4b')]({'where':{'name':_0x1961b4,'userProfileId':_0x1a56ae[_0xef45('0x54')]},'raw':!![]})[_0xef45('0x29')](function(_0x48a391){if(_0x48a391&&_0x48a391[_0xef45('0x55')]===0x0){return db[_0xef45('0x2a')][_0xef45('0x4c')]({'name':_0x23581f['name'],'resourceId':_0x23581f['id'],'type':_0x48a391[_0xef45('0x2d')],'sectionId':_0x48a391['id']},{})[_0xef45('0x29')](function(){return _0x4feeb1;});}else{return _0x4feeb1;}})[_0xef45('0x48')](function(_0x1531ea){logger['error'](_0xef45('0x56'),_0x1531ea);throw _0x1531ea;});}return _0x4feeb1;})[_0xef45('0x29')](respondWithResult(_0x2b2419,0xc9))[_0xef45('0x48')](handleError(_0x2b2419,null));};exports[_0xef45('0x57')]=function(_0x67d57b,_0x41f575){if(_0x67d57b[_0xef45('0x4d')]['id']){delete _0x67d57b[_0xef45('0x4d')]['id'];}return db[_0xef45('0x30')][_0xef45('0x4b')]({'where':{'id':_0x67d57b[_0xef45('0x49')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x41f575,null))['then'](saveUpdates(_0x67d57b[_0xef45('0x4d')],null))[_0xef45('0x29')](respondWithResult(_0x41f575,null))[_0xef45('0x48')](handleError(_0x41f575,null));};exports[_0xef45('0x28')]=function(_0x2fe9cf,_0x32232f){return db['VoiceMail']['find']({'where':{'id':_0x2fe9cf[_0xef45('0x49')]['id']}})['then'](handleEntityNotFound(_0x32232f,null))[_0xef45('0x29')](removeEntity(_0x32232f,null))[_0xef45('0x48')](handleError(_0x32232f,null));};exports[_0xef45('0x58')]=function(_0x5676fb,_0x16b04e,_0x398dc0){return db['VoiceMail'][_0xef45('0x59')]({'where':{'id':_0x5676fb['params']['id']}})['then'](handleEntityNotFound(_0x16b04e,null))[_0xef45('0x29')](function(_0x4f78ac){var _0x189f22;var _0x3fbc26={},_0x22fd64={};_0x22fd64['model']=_[_0xef45('0x35')](db[_0xef45('0x5a')]['rawAttributes']);_0x22fd64[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5676fb[_0xef45('0x34')]);_0x22fd64[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x22fd64[_0xef45('0x33')],_0x22fd64[_0xef45('0x34')]);_0x3fbc26[_0xef45('0x38')]=_['intersection'](_0x22fd64[_0xef45('0x33')],qs['fields'](_0x5676fb['query'][_0xef45('0x37')]));_0x3fbc26['attributes']=_0x3fbc26[_0xef45('0x38')][_0xef45('0x39')]?_0x3fbc26['attributes']:_0x22fd64[_0xef45('0x33')];if(!_0x5676fb[_0xef45('0x34')][_0xef45('0x3a')](_0xef45('0x3b'))){_0x3fbc26[_0xef45('0x20')]=qs[_0xef45('0x20')](_0x5676fb['query'][_0xef45('0x20')]);_0x3fbc26[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x5676fb[_0xef45('0x34')][_0xef45('0x1e')]);}_0x3fbc26['order']=qs[_0xef45('0x3d')](_0x5676fb['query'][_0xef45('0x3d')]);_0x3fbc26[_0xef45('0x41')]=qs['filters'](_[_0xef45('0x3e')](_0x5676fb[_0xef45('0x34')],_0x22fd64[_0xef45('0x3f')]));if(_0x5676fb['query']['filter']){_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'$or':_['map'](_0x3fbc26[_0xef45('0x38')],function(_0x3956b0){var _0x49131e={};_0x49131e[_0x3956b0]={'$like':'%'+_0x5676fb[_0xef45('0x34')]['filter']+'%'};return _0x49131e;})});}_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'mailboxuser':_0x4f78ac[_0xef45('0x5b')]});_0x3fbc26=_[_0xef45('0x42')]({},_0x3fbc26,_0x5676fb[_0xef45('0x44')]);return db[_0xef45('0x5a')][_0xef45('0x5c')](_0x3fbc26)['then'](respondWithFilteredResult(_0x16b04e,_0x3fbc26));})[_0xef45('0x48')](handleError(_0x16b04e,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 7057abe..e023964 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 _0x4e5d=['util','api','moment','bluebird','request-promise','path','rimraf','define','VoiceMail','mailbox_context','context'];(function(_0x239dd5,_0x2cb9dc){var _0x2cf354=function(_0x4877cc){while(--_0x4877cc){_0x239dd5['push'](_0x239dd5['shift']());}};_0x2cf354(++_0x2cb9dc);}(_0x4e5d,0xb0));var _0xd4e5=function(_0x1fec86,_0x422ed7){_0x1fec86=_0x1fec86-0x0;var _0x55e897=_0x4e5d[_0x1fec86];return _0x55e897;};'use strict';var _=require('lodash');var util=require(_0xd4e5('0x0'));var logger=require('../../config/logger')(_0xd4e5('0x1'));var moment=require(_0xd4e5('0x2'));var BPromise=require(_0xd4e5('0x3'));var rp=require(_0xd4e5('0x4'));var fs=require('fs');var path=require(_0xd4e5('0x5'));var rimraf=require(_0xd4e5('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module['exports']=function(_0x22caae,_0x4e2967){return _0x22caae[_0xd4e5('0x7')](_0xd4e5('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd4e5('0x9'),'fields':['mailbox',_0xd4e5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ee3=['request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x42a4f9,_0x1a8a7b){var _0x10733d=function(_0x4e6406){while(--_0x4e6406){_0x42a4f9['push'](_0x42a4f9['shift']());}};_0x10733d(++_0x1a8a7b);}(_0x4ee3,0x1a3));var _0x34ee=function(_0x2a45f2,_0x3c7df0){_0x2a45f2=_0x2a45f2-0x0;var _0x398290=_0x4ee3[_0x2a45f2];return _0x398290;};'use strict';var _=require(_0x34ee('0x0'));var util=require(_0x34ee('0x1'));var logger=require(_0x34ee('0x2'))(_0x34ee('0x3'));var moment=require(_0x34ee('0x4'));var BPromise=require(_0x34ee('0x5'));var rp=require(_0x34ee('0x6'));var fs=require('fs');var path=require(_0x34ee('0x7'));var rimraf=require(_0x34ee('0x8'));var config=require('../../config/environment');var attributes=require(_0x34ee('0x9'));module[_0x34ee('0xa')]=function(_0x5782a4,_0x38e42b){return _0x5782a4[_0x34ee('0xb')](_0x34ee('0xc'),attributes,{'tableName':_0x34ee('0xd'),'paranoid':![],'indexes':[{'name':_0x34ee('0xe'),'fields':[_0x34ee('0xf'),_0x34ee('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 63d144a..20ff02f 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 _0xd056=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4911ab,_0x4dcb06){var _0x441554=function(_0x35f205){while(--_0x35f205){_0x4911ab['push'](_0x4911ab['shift']());}};_0x441554(++_0x4dcb06);}(_0xd056,0xf9));var _0x6d05=function(_0x4120bc,_0x3e6c48){_0x4120bc=_0x4120bc-0x0;var _0x5e4091=_0xd056[_0x4120bc];return _0x5e4091;};'use strict';var _=require(_0x6d05('0x0'));var util=require(_0x6d05('0x1'));var moment=require(_0x6d05('0x2'));var BPromise=require(_0x6d05('0x3'));var rs=require(_0x6d05('0x4'));var fs=require('fs');var Redis=require(_0x6d05('0x5'));var db=require(_0x6d05('0x6'))['db'];var utils=require(_0x6d05('0x7'));var logger=require(_0x6d05('0x8'))('rpc');var config=require(_0x6d05('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6d05('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25dbed,_0x132e10,_0x235c2c){return new BPromise(function(_0x3a35c9,_0x2544f8){return client['request'](_0x25dbed,_0x235c2c)['then'](function(_0x91afbe){logger[_0x6d05('0xb')](_0x6d05('0xc'),_0x132e10,_0x6d05('0xd'));logger[_0x6d05('0xe')](_0x6d05('0xf'),_0x132e10,_0x6d05('0xd'),JSON[_0x6d05('0x10')](_0x91afbe));if(_0x91afbe[_0x6d05('0x11')]){if(_0x91afbe[_0x6d05('0x11')][_0x6d05('0x12')]===0x1f4){logger[_0x6d05('0x11')](_0x6d05('0xc'),_0x132e10,_0x91afbe[_0x6d05('0x11')][_0x6d05('0x13')]);return _0x2544f8(_0x91afbe[_0x6d05('0x11')][_0x6d05('0x13')]);}logger[_0x6d05('0x11')](_0x6d05('0xc'),_0x132e10,_0x91afbe[_0x6d05('0x11')][_0x6d05('0x13')]);return _0x3a35c9(_0x91afbe[_0x6d05('0x11')]['message']);}else{logger['info'](_0x6d05('0xc'),_0x132e10,_0x6d05('0xd'));_0x3a35c9(_0x91afbe['result'][_0x6d05('0x13')]);}})[_0x6d05('0x14')](function(_0x55755e){logger['error'](_0x6d05('0xc'),_0x132e10,_0x55755e);_0x2544f8(_0x55755e);});});} \ No newline at end of file +var _0x094b=['jayson/promise','client','http','then','info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3322a0,_0xc75fc7){var _0x15be8e=function(_0x44983b){while(--_0x44983b){_0x3322a0['push'](_0x3322a0['shift']());}};_0x15be8e(++_0xc75fc7);}(_0x094b,0x1ac));var _0xb094=function(_0x58280a,_0x2b58d3){_0x58280a=_0x58280a-0x0;var _0x43763c=_0x094b[_0x58280a];return _0x43763c;};'use strict';var _=require(_0xb094('0x0'));var util=require(_0xb094('0x1'));var moment=require(_0xb094('0x2'));var BPromise=require(_0xb094('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb094('0x4'));var db=require(_0xb094('0x5'))['db'];var utils=require(_0xb094('0x6'));var logger=require('../../config/logger')(_0xb094('0x7'));var config=require(_0xb094('0x8'));var jayson=require(_0xb094('0x9'));var client=jayson[_0xb094('0xa')][_0xb094('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b7033,_0x12fa63,_0x3eae57){return new BPromise(function(_0x2e58cc,_0x37e8e3){return client['request'](_0x5b7033,_0x3eae57)[_0xb094('0xc')](function(_0x5cc9af){logger[_0xb094('0xd')]('VoiceMail,\x20%s,\x20%s',_0x12fa63,'request\x20sent');logger[_0xb094('0xe')](_0xb094('0xf'),_0x12fa63,_0xb094('0x10'),JSON[_0xb094('0x11')](_0x5cc9af));if(_0x5cc9af[_0xb094('0x12')]){if(_0x5cc9af['error'][_0xb094('0x13')]===0x1f4){logger[_0xb094('0x12')](_0xb094('0x14'),_0x12fa63,_0x5cc9af[_0xb094('0x12')][_0xb094('0x15')]);return _0x37e8e3(_0x5cc9af[_0xb094('0x12')][_0xb094('0x15')]);}logger[_0xb094('0x12')](_0xb094('0x14'),_0x12fa63,_0x5cc9af[_0xb094('0x12')][_0xb094('0x15')]);return _0x2e58cc(_0x5cc9af[_0xb094('0x12')][_0xb094('0x15')]);}else{logger['info'](_0xb094('0x14'),_0x12fa63,'request\x20sent');_0x2e58cc(_0x5cc9af[_0xb094('0x16')]['message']);}})['catch'](function(_0x3bc940){logger['error'](_0xb094('0x14'),_0x12fa63,_0x3bc940);_0x37e8e3(_0x3bc940);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 4f55a2b..6d24525 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 _0x3df3=['update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x3df3,0xea));var _0x33df=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x3df3[_0x59eefb];return _0x1a49e8;};'use strict';var multer=require(_0x33df('0x0'));var util=require(_0x33df('0x1'));var path=require(_0x33df('0x2'));var timeout=require(_0x33df('0x3'));var express=require('express');var router=express[_0x33df('0x4')]();var fs_extra=require(_0x33df('0x5'));var auth=require(_0x33df('0x6'));var interaction=require(_0x33df('0x7'));var config=require(_0x33df('0x8'));var controller=require('./voiceMailMessage.controller');router[_0x33df('0x9')]('/',auth[_0x33df('0xa')](),controller['index']);router[_0x33df('0x9')](_0x33df('0xb'),auth[_0x33df('0xa')](),controller[_0x33df('0xc')]);router[_0x33df('0x9')](_0x33df('0xd'),auth[_0x33df('0xa')](),controller[_0x33df('0xe')]);router[_0x33df('0xf')]('/',auth['isAuthenticated'](),controller[_0x33df('0x10')]);router[_0x33df('0x11')](_0x33df('0xb'),auth[_0x33df('0xa')](),controller[_0x33df('0x12')]);router[_0x33df('0x13')](_0x33df('0xb'),auth[_0x33df('0xa')](),controller[_0x33df('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc3fb=['download','create','/:id','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xc3fb,0xb1));var _0xbc3f=function(_0x1dec33,_0x24aad0){_0x1dec33=_0x1dec33-0x0;var _0x4ba85a=_0xc3fb[_0x1dec33];return _0x4ba85a;};'use strict';var multer=require(_0xbc3f('0x0'));var util=require('util');var path=require(_0xbc3f('0x1'));var timeout=require('connect-timeout');var express=require(_0xbc3f('0x2'));var router=express[_0xbc3f('0x3')]();var fs_extra=require(_0xbc3f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbc3f('0x5'));var config=require(_0xbc3f('0x6'));var controller=require(_0xbc3f('0x7'));router[_0xbc3f('0x8')]('/',auth[_0xbc3f('0x9')](),controller[_0xbc3f('0xa')]);router[_0xbc3f('0x8')]('/:id',auth[_0xbc3f('0x9')](),controller[_0xbc3f('0xb')]);router['get'](_0xbc3f('0xc'),auth[_0xbc3f('0x9')](),controller[_0xbc3f('0xd')]);router['post']('/',auth[_0xbc3f('0x9')](),controller[_0xbc3f('0xe')]);router['put'](_0xbc3f('0xf'),auth[_0xbc3f('0x9')](),controller[_0xbc3f('0x10')]);router[_0xbc3f('0x11')]('/:id',auth[_0xbc3f('0x9')](),controller[_0xbc3f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 78a6225..dd2bd6c 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 _0xd8b3=['BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x55ddbb,_0x5ddaed){var _0x24c69b=function(_0xa29ae8){while(--_0xa29ae8){_0x55ddbb['push'](_0x55ddbb['shift']());}};_0x24c69b(++_0x5ddaed);}(_0xd8b3,0x68));var _0x3d8b=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0xd8b3[_0x1e03e4];return _0x4a887e;};'use strict';var Sequelize=require(_0x3d8b('0x0'));module[_0x3d8b('0x1')]={'name':{'type':Sequelize[_0x3d8b('0x2')],'get':function(_0x59f483){return this[_0x3d8b('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x3d8b('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3d8b('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x3d8b('0x6')](_0x3d8b('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x3d8b('0x8'),'defaultValue':Sequelize[_0x3d8b('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xed82=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','sequelize','exports'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0xed82,0xdf));var _0x2ed8=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xed82[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x2ed8('0x0'));module[_0x2ed8('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b3d1f){return this[_0x2ed8('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x2ed8('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2ed8('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x2ed8('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x2ed8('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x2ed8('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2ed8('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2ed8('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x2ed8('0x5')](_0x2ed8('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x2ed8('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x2ed8('0x7'),'defaultValue':Sequelize[_0x2ed8('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 45bb71e..ad117ba 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 _0x759b=['create','body','download','recording','VoiceMailMessage\x20not\x20found','msg_id','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','json','save','update','then','destroy','name','send','map','VoiceMailMessage','fieldName','key','differenceBy','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find'];(function(_0x220b08,_0x584bc5){var _0x549f9f=function(_0x5acb00){while(--_0x5acb00){_0x220b08['push'](_0x220b08['shift']());}};_0x549f9f(++_0x584bc5);}(_0x759b,0x130));var _0xb759=function(_0x2a7544,_0x47e6d1){_0x2a7544=_0x2a7544-0x0;var _0xdaac83=_0x759b[_0x2a7544];return _0xdaac83;};'use strict';var emlformat=require(_0xb759('0x0'));var rimraf=require(_0xb759('0x1'));var zipdir=require(_0xb759('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb759('0x3'));var moment=require(_0xb759('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb759('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb759('0x6'));var ejs=require(_0xb759('0x7'));var fs=require('fs');var fs_extra=require(_0xb759('0x8'));var _=require(_0xb759('0x9'));var squel=require(_0xb759('0xa'));var crypto=require(_0xb759('0xb'));var jsforce=require(_0xb759('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb759('0x6'));var querystring=require(_0xb759('0xd'));var Papa=require('papaparse');var Redis=require(_0xb759('0xe'));var authService=require(_0xb759('0xf'));var qs=require(_0xb759('0x10'));var as=require(_0xb759('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb759('0x12'))(_0xb759('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb759('0x14'));var db=require(_0xb759('0x15'))['db'];function respondWithStatusCode(_0x3d6d00,_0x590dc1){_0x590dc1=_0x590dc1||0xcc;return function(_0x479c58){if(_0x479c58){return _0x3d6d00[_0xb759('0x16')](_0x590dc1);}return _0x3d6d00['status'](_0x590dc1)[_0xb759('0x17')]();};}function respondWithResult(_0x11b466,_0x49b3a6){_0x49b3a6=_0x49b3a6||0xc8;return function(_0x25102f){if(_0x25102f){return _0x11b466['status'](_0x49b3a6)['json'](_0x25102f);}};}function respondWithFilteredResult(_0x4bc813,_0x58f557){return function(_0x13476d){if(_0x13476d){var _0x89eca=typeof _0x58f557[_0xb759('0x18')]===_0xb759('0x19')&&typeof _0x58f557[_0xb759('0x1a')]===_0xb759('0x19');var _0x5bc105=_0x13476d[_0xb759('0x1b')];var _0x282726=_0x89eca?0x0:_0x58f557['offset'];var _0x587292=_0x89eca?_0x13476d[_0xb759('0x1b')]:_0x58f557[_0xb759('0x18')]+_0x58f557[_0xb759('0x1a')];var _0xf30d8d;if(_0x587292>=_0x5bc105){_0x587292=_0x5bc105;_0xf30d8d=0xc8;}else{_0xf30d8d=0xce;}_0x4bc813[_0xb759('0x1c')](_0xf30d8d);return _0x4bc813[_0xb759('0x1d')]('Content-Range',_0x282726+'-'+_0x587292+'/'+_0x5bc105)[_0xb759('0x1e')](_0x13476d);}return null;};}function patchUpdates(_0x4625ef){return function(_0x31b970){try{jsonpatch['apply'](_0x31b970,_0x4625ef,!![]);}catch(_0x57439f){return BPromise['reject'](_0x57439f);}return _0x31b970[_0xb759('0x1f')]();};}function saveUpdates(_0x8de3e1,_0x5c9b2c){return function(_0x149770){if(_0x149770){return _0x149770[_0xb759('0x20')](_0x8de3e1)[_0xb759('0x21')](function(_0x2ac53d){return _0x2ac53d;});}return null;};}function removeEntity(_0x316866,_0x34a58f){return function(_0x4d9397){if(_0x4d9397){return _0x4d9397[_0xb759('0x22')]()[_0xb759('0x21')](function(){_0x316866[_0xb759('0x1c')](0xcc)[_0xb759('0x17')]();});}};}function handleEntityNotFound(_0x203f4e,_0x49576b){return function(_0x1e9797){if(!_0x1e9797){_0x203f4e[_0xb759('0x16')](0x194);}return _0x1e9797;};}function handleError(_0xb184bb,_0x5f242d){_0x5f242d=_0x5f242d||0x1f4;return function(_0x10f77d){logger['error'](_0x10f77d['stack']);if(_0x10f77d[_0xb759('0x23')]){delete _0x10f77d['name'];}_0xb184bb['status'](_0x5f242d)[_0xb759('0x24')](_0x10f77d);};}exports['index']=function(_0x31734d,_0x3e6f64){var _0x305bb3={},_0xf40c40={},_0x44ab76={'count':0x0,'rows':[]};var _0x5e3c4f=_[_0xb759('0x25')](db[_0xb759('0x26')]['rawAttributes'],function(_0x54bd84){return{'name':_0x54bd84[_0xb759('0x27')],'type':_0x54bd84['type'][_0xb759('0x28')]};});_0xf40c40['model']=_[_0xb759('0x29')](_[_0xb759('0x25')](_0x5e3c4f,_0xb759('0x23')),[_0xb759('0x23')]);_0xf40c40['query']=_[_0xb759('0x2a')](_0x31734d[_0xb759('0x2b')]);_0xf40c40[_0xb759('0x2c')]=_[_0xb759('0x2d')](_0xf40c40[_0xb759('0x2e')],_0xf40c40[_0xb759('0x2b')]);_0x305bb3['attributes']=_['intersection'](_0xf40c40[_0xb759('0x2e')],qs[_0xb759('0x2f')](_0x31734d[_0xb759('0x2b')][_0xb759('0x2f')]));_0x305bb3['attributes']=_0x305bb3[_0xb759('0x30')][_0xb759('0x31')]?_0x305bb3[_0xb759('0x30')]:_0xf40c40[_0xb759('0x2e')];if(!_0x31734d[_0xb759('0x2b')][_0xb759('0x32')](_0xb759('0x33'))){_0x305bb3[_0xb759('0x1a')]=qs[_0xb759('0x1a')](_0x31734d[_0xb759('0x2b')][_0xb759('0x1a')]);_0x305bb3[_0xb759('0x18')]=qs[_0xb759('0x18')](_0x31734d[_0xb759('0x2b')][_0xb759('0x18')]);}_0x305bb3['order']=qs[_0xb759('0x34')](_0x31734d[_0xb759('0x2b')][_0xb759('0x34')]);_0x305bb3[_0xb759('0x35')]=qs[_0xb759('0x2c')](_['pick'](_0x31734d[_0xb759('0x2b')],_0xf40c40['filters']),_0x5e3c4f);if(_0x31734d['query']['filter']){_0x305bb3[_0xb759('0x35')]=_[_0xb759('0x36')](_0x305bb3[_0xb759('0x35')],{'$or':_[_0xb759('0x25')](_0x5e3c4f,function(_0x531afa){if(_0x531afa[_0xb759('0x37')]!==_0xb759('0x38')){var _0x1229f6={};_0x1229f6[_0x531afa[_0xb759('0x23')]]={'$like':'%'+_0x31734d['query'][_0xb759('0x39')]+'%'};return _0x1229f6;}})});}_0x305bb3=_['merge']({},_0x305bb3,_0x31734d['options']);var _0x42e43f={'where':_0x305bb3[_0xb759('0x35')]};return db[_0xb759('0x26')]['count'](_0x42e43f)['then'](function(_0x5ad989){_0x44ab76['count']=_0x5ad989;if(_0x31734d[_0xb759('0x2b')][_0xb759('0x3a')]){_0x305bb3[_0xb759('0x3b')]=[{'all':!![]}];}return db[_0xb759('0x26')][_0xb759('0x3c')](_0x305bb3);})['then'](function(_0x14d7d9){_0x44ab76['rows']=_0x14d7d9;return _0x44ab76;})[_0xb759('0x21')](respondWithFilteredResult(_0x3e6f64,_0x305bb3))[_0xb759('0x3d')](handleError(_0x3e6f64,null));};exports[_0xb759('0x3e')]=function(_0x5a5eca,_0x7f8f97){var _0xf84d6d={'raw':!![],'where':{'id':_0x5a5eca[_0xb759('0x3f')]['id']}},_0x33efe0={};_0x33efe0[_0xb759('0x2e')]=_['keys'](db[_0xb759('0x26')]['rawAttributes']);_0x33efe0[_0xb759('0x2b')]=_[_0xb759('0x2a')](_0x5a5eca[_0xb759('0x2b')]);_0x33efe0[_0xb759('0x2c')]=_[_0xb759('0x2d')](_0x33efe0[_0xb759('0x2e')],_0x33efe0['query']);_0xf84d6d[_0xb759('0x30')]=_[_0xb759('0x2d')](_0x33efe0[_0xb759('0x2e')],qs['fields'](_0x5a5eca[_0xb759('0x2b')][_0xb759('0x2f')]));_0xf84d6d[_0xb759('0x30')]=_0xf84d6d[_0xb759('0x30')]['length']?_0xf84d6d[_0xb759('0x30')]:_0x33efe0['model'];if(_0x5a5eca[_0xb759('0x2b')][_0xb759('0x3a')]){_0xf84d6d[_0xb759('0x3b')]=[{'all':!![]}];}_0xf84d6d=_[_0xb759('0x36')]({},_0xf84d6d,_0x5a5eca[_0xb759('0x40')]);return db[_0xb759('0x26')][_0xb759('0x41')](_0xf84d6d)['then'](handleEntityNotFound(_0x7f8f97,null))['then'](respondWithResult(_0x7f8f97,null))[_0xb759('0x3d')](handleError(_0x7f8f97,null));};exports[_0xb759('0x42')]=function(_0x990c7e,_0x35f1cd){return db[_0xb759('0x26')][_0xb759('0x42')](_0x990c7e[_0xb759('0x43')],{})[_0xb759('0x21')](respondWithResult(_0x35f1cd,0xc9))[_0xb759('0x3d')](handleError(_0x35f1cd,null));};exports[_0xb759('0x20')]=function(_0x3ae5fc,_0x50065f){if(_0x3ae5fc[_0xb759('0x43')]['id']){delete _0x3ae5fc[_0xb759('0x43')]['id'];}return db[_0xb759('0x26')][_0xb759('0x41')]({'where':{'id':_0x3ae5fc['params']['id']}})[_0xb759('0x21')](handleEntityNotFound(_0x50065f,null))[_0xb759('0x21')](saveUpdates(_0x3ae5fc['body'],null))['then'](respondWithResult(_0x50065f,null))[_0xb759('0x3d')](handleError(_0x50065f,null));};exports[_0xb759('0x22')]=function(_0x437366,_0x375df4){return db[_0xb759('0x26')]['find']({'where':{'id':_0x437366['params']['id']}})[_0xb759('0x21')](handleEntityNotFound(_0x375df4,null))[_0xb759('0x21')](removeEntity(_0x375df4,null))[_0xb759('0x3d')](handleError(_0x375df4,null));};exports[_0xb759('0x44')]=function(_0x202236,_0x443430,_0x10d9fb){return db[_0xb759('0x26')][_0xb759('0x41')]({'where':{'id':_0x202236[_0xb759('0x3f')]['id']},'attributes':['id',_0xb759('0x45'),'msg_id']})['then'](handleEntityNotFound(_0x443430,null))[_0xb759('0x21')](function(_0x213859){if(_0x213859){if(!_0x213859[_0xb759('0x45')]){throw new db['Sequelize']['ValidationError'](_0xb759('0x46'));}var _0x113000={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x213859[_0xb759('0x47')]){_0x113000[_0xb759('0x48')]='attachment;\x20filename=\x22'+_0x213859[_0xb759('0x47')]+_0xb759('0x49');}_0x443430['set'](_0x113000);return _0x443430[_0xb759('0x24')](new Buffer(_0x213859[_0xb759('0x45')]));}})[_0xb759('0x3d')](handleError(_0x443430,null));}; \ No newline at end of file +var _0xabae=['VIRTUAL','includeAll','include','catch','show','params','keys','VoiceMailMessage','options','create','body','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where'];(function(_0x15a4c8,_0x1ad9f2){var _0x166023=function(_0x890c89){while(--_0x890c89){_0x15a4c8['push'](_0x15a4c8['shift']());}};_0x166023(++_0x1ad9f2);}(_0xabae,0x121));var _0xeaba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabae[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xeaba('0x0'));var rimraf=require(_0xeaba('0x1'));var zipdir=require(_0xeaba('0x2'));var jsonpatch=require(_0xeaba('0x3'));var rp=require(_0xeaba('0x4'));var moment=require(_0xeaba('0x5'));var BPromise=require(_0xeaba('0x6'));var Mustache=require(_0xeaba('0x7'));var util=require(_0xeaba('0x8'));var path=require(_0xeaba('0x9'));var sox=require(_0xeaba('0xa'));var csv=require(_0xeaba('0xb'));var ejs=require(_0xeaba('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeaba('0xd'));var squel=require(_0xeaba('0xe'));var crypto=require(_0xeaba('0xf'));var jsforce=require(_0xeaba('0x10'));var deskjs=require(_0xeaba('0x11'));var toCsv=require(_0xeaba('0xb'));var querystring=require(_0xeaba('0x12'));var Papa=require(_0xeaba('0x13'));var Redis=require(_0xeaba('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xeaba('0x15'));var as=require(_0xeaba('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaba('0x17'))(_0xeaba('0x18'));var utils=require(_0xeaba('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeaba('0x1a'))['db'];function respondWithStatusCode(_0x189714,_0x120332){_0x120332=_0x120332||0xcc;return function(_0x17c82f){if(_0x17c82f){return _0x189714[_0xeaba('0x1b')](_0x120332);}return _0x189714['status'](_0x120332)[_0xeaba('0x1c')]();};}function respondWithResult(_0x1d67a2,_0x17b61a){_0x17b61a=_0x17b61a||0xc8;return function(_0x1a4b7c){if(_0x1a4b7c){return _0x1d67a2[_0xeaba('0x1d')](_0x17b61a)[_0xeaba('0x1e')](_0x1a4b7c);}};}function respondWithFilteredResult(_0x2a2f95,_0x4caf46){return function(_0x4e373c){if(_0x4e373c){var _0x2f2e9f=typeof _0x4caf46['offset']==='undefined'&&typeof _0x4caf46[_0xeaba('0x1f')]===_0xeaba('0x20');var _0x2568f7=_0x4e373c['count'];var _0x227b9c=_0x2f2e9f?0x0:_0x4caf46[_0xeaba('0x21')];var _0x634d36=_0x2f2e9f?_0x4e373c[_0xeaba('0x22')]:_0x4caf46[_0xeaba('0x21')]+_0x4caf46[_0xeaba('0x1f')];var _0x5395fc;if(_0x634d36>=_0x2568f7){_0x634d36=_0x2568f7;_0x5395fc=0xc8;}else{_0x5395fc=0xce;}_0x2a2f95[_0xeaba('0x1d')](_0x5395fc);return _0x2a2f95[_0xeaba('0x23')](_0xeaba('0x24'),_0x227b9c+'-'+_0x634d36+'/'+_0x2568f7)[_0xeaba('0x1e')](_0x4e373c);}return null;};}function patchUpdates(_0x794aa){return function(_0x3d881e){try{jsonpatch[_0xeaba('0x25')](_0x3d881e,_0x794aa,!![]);}catch(_0x15957b){return BPromise[_0xeaba('0x26')](_0x15957b);}return _0x3d881e[_0xeaba('0x27')]();};}function saveUpdates(_0x16f95f,_0x1d9b9f){return function(_0x5d1ce2){if(_0x5d1ce2){return _0x5d1ce2[_0xeaba('0x28')](_0x16f95f)[_0xeaba('0x29')](function(_0x2be0c6){return _0x2be0c6;});}return null;};}function removeEntity(_0x3bd5c7,_0xc9bef0){return function(_0x43b468){if(_0x43b468){return _0x43b468[_0xeaba('0x2a')]()[_0xeaba('0x29')](function(){_0x3bd5c7[_0xeaba('0x1d')](0xcc)[_0xeaba('0x1c')]();});}};}function handleEntityNotFound(_0x5efc98,_0x44f131){return function(_0x17394b){if(!_0x17394b){_0x5efc98['sendStatus'](0x194);}return _0x17394b;};}function handleError(_0x1962e0,_0x34f2a4){_0x34f2a4=_0x34f2a4||0x1f4;return function(_0x128833){logger[_0xeaba('0x2b')](_0x128833[_0xeaba('0x2c')]);if(_0x128833['name']){delete _0x128833['name'];}_0x1962e0['status'](_0x34f2a4)[_0xeaba('0x2d')](_0x128833);};}exports[_0xeaba('0x2e')]=function(_0x369975,_0x319218){var _0x55d211={},_0x590b10={},_0x18aa4e={'count':0x0,'rows':[]};var _0x264fcd=_[_0xeaba('0x2f')](db['VoiceMailMessage'][_0xeaba('0x30')],function(_0x4c7d9f){return{'name':_0x4c7d9f[_0xeaba('0x31')],'type':_0x4c7d9f[_0xeaba('0x32')][_0xeaba('0x33')]};});_0x590b10[_0xeaba('0x34')]=_[_0xeaba('0x35')](_[_0xeaba('0x2f')](_0x264fcd,_0xeaba('0x36')),['name']);_0x590b10[_0xeaba('0x37')]=_['keys'](_0x369975[_0xeaba('0x37')]);_0x590b10[_0xeaba('0x38')]=_[_0xeaba('0x39')](_0x590b10[_0xeaba('0x34')],_0x590b10[_0xeaba('0x37')]);_0x55d211[_0xeaba('0x3a')]=_[_0xeaba('0x39')](_0x590b10[_0xeaba('0x34')],qs[_0xeaba('0x3b')](_0x369975[_0xeaba('0x37')][_0xeaba('0x3b')]));_0x55d211[_0xeaba('0x3a')]=_0x55d211[_0xeaba('0x3a')][_0xeaba('0x3c')]?_0x55d211[_0xeaba('0x3a')]:_0x590b10['model'];if(!_0x369975[_0xeaba('0x37')][_0xeaba('0x3d')]('nolimit')){_0x55d211[_0xeaba('0x1f')]=qs[_0xeaba('0x1f')](_0x369975[_0xeaba('0x37')][_0xeaba('0x1f')]);_0x55d211[_0xeaba('0x21')]=qs[_0xeaba('0x21')](_0x369975[_0xeaba('0x37')][_0xeaba('0x21')]);}_0x55d211[_0xeaba('0x3e')]=qs[_0xeaba('0x3f')](_0x369975['query']['sort']);_0x55d211['where']=qs[_0xeaba('0x38')](_['pick'](_0x369975[_0xeaba('0x37')],_0x590b10['filters']),_0x264fcd);if(_0x369975[_0xeaba('0x37')][_0xeaba('0x40')]){_0x55d211['where']=_[_0xeaba('0x41')](_0x55d211[_0xeaba('0x42')],{'$or':_[_0xeaba('0x2f')](_0x264fcd,function(_0x3c26ae){if(_0x3c26ae[_0xeaba('0x32')]!==_0xeaba('0x43')){var _0x5aab08={};_0x5aab08[_0x3c26ae[_0xeaba('0x36')]]={'$like':'%'+_0x369975['query'][_0xeaba('0x40')]+'%'};return _0x5aab08;}})});}_0x55d211=_['merge']({},_0x55d211,_0x369975['options']);var _0x5cca36={'where':_0x55d211[_0xeaba('0x42')]};return db['VoiceMailMessage'][_0xeaba('0x22')](_0x5cca36)[_0xeaba('0x29')](function(_0x55d555){_0x18aa4e[_0xeaba('0x22')]=_0x55d555;if(_0x369975[_0xeaba('0x37')][_0xeaba('0x44')]){_0x55d211[_0xeaba('0x45')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x55d211);})[_0xeaba('0x29')](function(_0x687f28){_0x18aa4e['rows']=_0x687f28;return _0x18aa4e;})[_0xeaba('0x29')](respondWithFilteredResult(_0x319218,_0x55d211))[_0xeaba('0x46')](handleError(_0x319218,null));};exports[_0xeaba('0x47')]=function(_0x349611,_0x117cab){var _0x5bf86b={'raw':!![],'where':{'id':_0x349611[_0xeaba('0x48')]['id']}},_0x38135b={};_0x38135b['model']=_[_0xeaba('0x49')](db[_0xeaba('0x4a')][_0xeaba('0x30')]);_0x38135b[_0xeaba('0x37')]=_['keys'](_0x349611[_0xeaba('0x37')]);_0x38135b['filters']=_[_0xeaba('0x39')](_0x38135b[_0xeaba('0x34')],_0x38135b['query']);_0x5bf86b[_0xeaba('0x3a')]=_['intersection'](_0x38135b[_0xeaba('0x34')],qs[_0xeaba('0x3b')](_0x349611[_0xeaba('0x37')][_0xeaba('0x3b')]));_0x5bf86b[_0xeaba('0x3a')]=_0x5bf86b[_0xeaba('0x3a')][_0xeaba('0x3c')]?_0x5bf86b[_0xeaba('0x3a')]:_0x38135b['model'];if(_0x349611[_0xeaba('0x37')][_0xeaba('0x44')]){_0x5bf86b['include']=[{'all':!![]}];}_0x5bf86b=_[_0xeaba('0x41')]({},_0x5bf86b,_0x349611[_0xeaba('0x4b')]);return db[_0xeaba('0x4a')]['find'](_0x5bf86b)['then'](handleEntityNotFound(_0x117cab,null))[_0xeaba('0x29')](respondWithResult(_0x117cab,null))[_0xeaba('0x46')](handleError(_0x117cab,null));};exports[_0xeaba('0x4c')]=function(_0x15196f,_0x308e52){return db[_0xeaba('0x4a')][_0xeaba('0x4c')](_0x15196f[_0xeaba('0x4d')],{})[_0xeaba('0x29')](respondWithResult(_0x308e52,0xc9))['catch'](handleError(_0x308e52,null));};exports[_0xeaba('0x28')]=function(_0x3810f8,_0x2a60ba){if(_0x3810f8[_0xeaba('0x4d')]['id']){delete _0x3810f8[_0xeaba('0x4d')]['id'];}return db[_0xeaba('0x4a')]['find']({'where':{'id':_0x3810f8[_0xeaba('0x48')]['id']}})[_0xeaba('0x29')](handleEntityNotFound(_0x2a60ba,null))[_0xeaba('0x29')](saveUpdates(_0x3810f8[_0xeaba('0x4d')],null))[_0xeaba('0x29')](respondWithResult(_0x2a60ba,null))['catch'](handleError(_0x2a60ba,null));};exports[_0xeaba('0x2a')]=function(_0x3370fb,_0x11b0a9){return db['VoiceMailMessage'][_0xeaba('0x4e')]({'where':{'id':_0x3370fb[_0xeaba('0x48')]['id']}})[_0xeaba('0x29')](handleEntityNotFound(_0x11b0a9,null))[_0xeaba('0x29')](removeEntity(_0x11b0a9,null))['catch'](handleError(_0x11b0a9,null));};exports[_0xeaba('0x4f')]=function(_0x3e312d,_0x28bdef,_0x578831){return db[_0xeaba('0x4a')][_0xeaba('0x4e')]({'where':{'id':_0x3e312d['params']['id']},'attributes':['id',_0xeaba('0x50'),_0xeaba('0x51')]})['then'](handleEntityNotFound(_0x28bdef,null))[_0xeaba('0x29')](function(_0x34f8d9){if(_0x34f8d9){if(!_0x34f8d9[_0xeaba('0x50')]){throw new db[(_0xeaba('0x52'))][(_0xeaba('0x53'))](_0xeaba('0x54'));}var _0x77f182={'Content-Type':_0xeaba('0x55'),'Content-Disposition':_0xeaba('0x56')};if(_0x34f8d9[_0xeaba('0x51')]){_0x77f182['Content-Disposition']=_0xeaba('0x57')+_0x34f8d9[_0xeaba('0x51')]+_0xeaba('0x58');}_0x28bdef[_0xeaba('0x23')](_0x77f182);return _0x28bdef[_0xeaba('0x2d')](new Buffer(_0x34f8d9[_0xeaba('0x50')]));}})[_0xeaba('0x46')](handleError(_0x28bdef,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 225d0ef..69da9d8 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 _0x9644=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0x9644,0x149));var _0x4964=function(_0xe88bda,_0x13d18b){_0xe88bda=_0xe88bda-0x0;var _0x5d3803=_0x9644[_0xe88bda];return _0x5d3803;};'use strict';var _=require(_0x4964('0x0'));var util=require(_0x4964('0x1'));var logger=require(_0x4964('0x2'))(_0x4964('0x3'));var moment=require('moment');var BPromise=require(_0x4964('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4964('0x5'));var rimraf=require(_0x4964('0x6'));var config=require('../../config/environment');var attributes=require(_0x4964('0x7'));module[_0x4964('0x8')]=function(_0x4cdc3e,_0xd20c5){return _0x4cdc3e[_0x4964('0x9')](_0x4964('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x4964('0xb'),'fields':[_0x4964('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb3f8=['../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3befc6,_0x444457){var _0x562f1b=function(_0x51b64d){while(--_0x51b64d){_0x3befc6['push'](_0x3befc6['shift']());}};_0x562f1b(++_0x444457);}(_0xb3f8,0x17a));var _0x8b3f=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0xb3f8[_0x1857c6];return _0x51011c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8b3f('0x0'))(_0x8b3f('0x1'));var moment=require(_0x8b3f('0x2'));var BPromise=require(_0x8b3f('0x3'));var rp=require(_0x8b3f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b3f('0x5'));var config=require(_0x8b3f('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x8b3f('0x7')]=function(_0x4a3cca,_0x2cfce3){return _0x4a3cca[_0x8b3f('0x8')](_0x8b3f('0x9'),attributes,{'tableName':_0x8b3f('0xa'),'paranoid':![],'indexes':[{'name':_0x8b3f('0xb'),'fields':[_0x8b3f('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 0c3eef6..3dbecb7 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 _0x5904=['error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5e97d3,_0x1a58b2){var _0xb08e2b=function(_0x572b4a){while(--_0x572b4a){_0x5e97d3['push'](_0x5e97d3['shift']());}};_0xb08e2b(++_0x1a58b2);}(_0x5904,0xe0));var _0x4590=function(_0x3b00a4,_0x1229d7){_0x3b00a4=_0x3b00a4-0x0;var _0x57e899=_0x5904[_0x3b00a4];return _0x57e899;};'use strict';var _=require(_0x4590('0x0'));var util=require(_0x4590('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4590('0x2'));var fs=require('fs');var Redis=require(_0x4590('0x3'));var db=require(_0x4590('0x4'))['db'];var utils=require(_0x4590('0x5'));var logger=require(_0x4590('0x6'))(_0x4590('0x7'));var config=require(_0x4590('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4590('0x9')][_0x4590('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6b2b35,_0x392694,_0x7688f4){return new BPromise(function(_0x13d7dd,_0xbf23df){return client[_0x4590('0xb')](_0x6b2b35,_0x7688f4)['then'](function(_0x2188a5){logger[_0x4590('0xc')](_0x4590('0xd'),_0x392694,_0x4590('0xe'));logger[_0x4590('0xf')](_0x4590('0x10'),_0x392694,'request\x20sent',JSON[_0x4590('0x11')](_0x2188a5));if(_0x2188a5[_0x4590('0x12')]){if(_0x2188a5[_0x4590('0x12')][_0x4590('0x13')]===0x1f4){logger[_0x4590('0x12')](_0x4590('0xd'),_0x392694,_0x2188a5[_0x4590('0x12')][_0x4590('0x14')]);return _0xbf23df(_0x2188a5[_0x4590('0x12')][_0x4590('0x14')]);}logger[_0x4590('0x12')](_0x4590('0xd'),_0x392694,_0x2188a5[_0x4590('0x12')][_0x4590('0x14')]);return _0x13d7dd(_0x2188a5['error']['message']);}else{logger[_0x4590('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x392694,_0x4590('0xe'));_0x13d7dd(_0x2188a5['result'][_0x4590('0x14')]);}})[_0x4590('0x15')](function(_0x328e6e){logger['error'](_0x4590('0xd'),_0x392694,_0x328e6e);_0xbf23df(_0x328e6e);});});} \ No newline at end of file +var _0x7651=['stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x1aaa97,_0x5a9010){var _0x177b56=function(_0x2e3cde){while(--_0x2e3cde){_0x1aaa97['push'](_0x1aaa97['shift']());}};_0x177b56(++_0x5a9010);}(_0x7651,0x8e));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1765('0x0'));var util=require(_0x1765('0x1'));var moment=require(_0x1765('0x2'));var BPromise=require(_0x1765('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1765('0x4'));var db=require(_0x1765('0x5'))['db'];var utils=require(_0x1765('0x6'));var logger=require(_0x1765('0x7'))(_0x1765('0x8'));var config=require(_0x1765('0x9'));var jayson=require(_0x1765('0xa'));var client=jayson['client'][_0x1765('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55b1de,_0x3b628d,_0x22492a){return new BPromise(function(_0x3dc080,_0x4d73d6){return client[_0x1765('0xc')](_0x55b1de,_0x22492a)[_0x1765('0xd')](function(_0x2016ec){logger[_0x1765('0xe')](_0x1765('0xf'),_0x3b628d,_0x1765('0x10'));logger[_0x1765('0x11')](_0x1765('0x12'),_0x3b628d,_0x1765('0x10'),JSON[_0x1765('0x13')](_0x2016ec));if(_0x2016ec[_0x1765('0x14')]){if(_0x2016ec[_0x1765('0x14')]['code']===0x1f4){logger['error'](_0x1765('0xf'),_0x3b628d,_0x2016ec[_0x1765('0x14')][_0x1765('0x15')]);return _0x4d73d6(_0x2016ec[_0x1765('0x14')][_0x1765('0x15')]);}logger['error'](_0x1765('0xf'),_0x3b628d,_0x2016ec['error'][_0x1765('0x15')]);return _0x3dc080(_0x2016ec[_0x1765('0x14')]['message']);}else{logger[_0x1765('0xe')](_0x1765('0xf'),_0x3b628d,_0x1765('0x10'));_0x3dc080(_0x2016ec[_0x1765('0x16')][_0x1765('0x15')]);}})['catch'](function(_0x541370){logger[_0x1765('0x14')](_0x1765('0xf'),_0x3b628d,_0x541370);_0x4d73d6(_0x541370);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 0c965e1..ed58163 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 _0x2420=['post','create','/:id/sounds','addSound','delete','removeSound','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds'];(function(_0x312b2b,_0x2174f3){var _0x1d6a18=function(_0x4f95ae){while(--_0x4f95ae){_0x312b2b['push'](_0x312b2b['shift']());}};_0x1d6a18(++_0x2174f3);}(_0x2420,0x136));var _0x0242=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x2420[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0242('0x0'));var express=require(_0x0242('0x1'));var router=express[_0x0242('0x2')]();var fs_extra=require(_0x0242('0x3'));var auth=require(_0x0242('0x4'));var interaction=require(_0x0242('0x5'));var config=require(_0x0242('0x6'));var controller=require(_0x0242('0x7'));router[_0x0242('0x8')]('/',auth[_0x0242('0x9')](),controller['index']);router[_0x0242('0x8')](_0x0242('0xa'),auth[_0x0242('0x9')](),controller[_0x0242('0xb')]);router[_0x0242('0x8')]('/:id/sounds',auth[_0x0242('0x9')](),controller[_0x0242('0xc')]);router[_0x0242('0xd')]('/',auth[_0x0242('0x9')](),controller[_0x0242('0xe')]);router[_0x0242('0xd')](_0x0242('0xf'),auth[_0x0242('0x9')](),controller[_0x0242('0x10')]);router['put'](_0x0242('0xa'),auth[_0x0242('0x9')](),controller['update']);router[_0x0242('0x11')](_0x0242('0xa'),auth[_0x0242('0x9')](),controller['destroy']);router[_0x0242('0x11')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x0242('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6747=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','put','delete','destroy','/:id/sounds/:id2','exports'];(function(_0x2f5a35,_0x184e92){var _0x10eb39=function(_0x5364b4){while(--_0x5364b4){_0x2f5a35['push'](_0x2f5a35['shift']());}};_0x10eb39(++_0x184e92);}(_0x6747,0xa8));var _0x7674=function(_0x57d4c4,_0x1eb1c7){_0x57d4c4=_0x57d4c4-0x0;var _0x551561=_0x6747[_0x57d4c4];return _0x551561;};'use strict';var multer=require(_0x7674('0x0'));var util=require(_0x7674('0x1'));var path=require(_0x7674('0x2'));var timeout=require(_0x7674('0x3'));var express=require(_0x7674('0x4'));var router=express[_0x7674('0x5')]();var fs_extra=require(_0x7674('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7674('0x7'));var config=require(_0x7674('0x8'));var controller=require(_0x7674('0x9'));router[_0x7674('0xa')]('/',auth[_0x7674('0xb')](),controller[_0x7674('0xc')]);router[_0x7674('0xa')](_0x7674('0xd'),auth[_0x7674('0xb')](),controller[_0x7674('0xe')]);router[_0x7674('0xa')](_0x7674('0xf'),auth[_0x7674('0xb')](),controller[_0x7674('0x10')]);router[_0x7674('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7674('0x11')](_0x7674('0xf'),auth[_0x7674('0xb')](),controller[_0x7674('0x12')]);router[_0x7674('0x13')](_0x7674('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7674('0x14')](_0x7674('0xd'),auth['isAuthenticated'](),controller[_0x7674('0x15')]);router[_0x7674('0x14')](_0x7674('0x16'),auth[_0x7674('0xb')](),controller['removeSound']);module[_0x7674('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f320080..d5b2d5c 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 _0xb534=['exports','STRING','name','files','quietmp3nb','quietmp3','mp3','alpha','sequelize'];(function(_0x3ba9d6,_0x4e9f98){var _0x172e00=function(_0x425e91){while(--_0x425e91){_0x3ba9d6['push'](_0x3ba9d6['shift']());}};_0x172e00(++_0x4e9f98);}(_0xb534,0x14c));var _0x4b53=function(_0x3f4790,_0x5189ef){_0x3f4790=_0x3f4790-0x0;var _0x4baf4b=_0xb534[_0x3f4790];return _0x4baf4b;};'use strict';var Sequelize=require(_0x4b53('0x0'));module[_0x4b53('0x1')]={'name':{'type':Sequelize[_0x4b53('0x2')],'allowNull':![],'unique':_0x4b53('0x3')},'mode':{'type':Sequelize['ENUM']('custom',_0x4b53('0x4'),'mp3nb',_0x4b53('0x5'),_0x4b53('0x6'),_0x4b53('0x7')),'allowNull':!![],'defaultValue':_0x4b53('0x4')},'directory':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![],'defaultValue':_0x4b53('0x8')},'format':{'type':Sequelize[_0x4b53('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8f7b=['alpha','TIMESTAMP','sequelize','ENUM','quietmp3nb','quietmp3','mp3','STRING'];(function(_0x45e5e9,_0x3a3d37){var _0x2f98f0=function(_0x139d28){while(--_0x139d28){_0x45e5e9['push'](_0x45e5e9['shift']());}};_0x2f98f0(++_0x3a3d37);}(_0x8f7b,0x16a));var _0xb8f7=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x8f7b[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xb8f7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xb8f7('0x1')]('custom','files','mp3nb',_0xb8f7('0x2'),_0xb8f7('0x3'),_0xb8f7('0x4')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xb8f7('0x5')],'allowNull':!![]},'application':{'type':Sequelize[_0xb8f7('0x5')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb8f7('0x5')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb8f7('0x5')],'allowNull':!![],'defaultValue':_0xb8f7('0x6')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xb8f7('0x7')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 7db0220..85d5f9f 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 _0x861e=['sort','where','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','includeAll','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','find','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','extname','symlinkSync','Sequelize','removeSound','id2','Sound','format','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x861e,0x10d));var _0xe861=function(_0x259b25,_0x37fe57){_0x259b25=_0x259b25-0x0;var _0x531cad=_0x861e[_0x259b25];return _0x531cad;};'use strict';var emlformat=require(_0xe861('0x0'));var rimraf=require(_0xe861('0x1'));var zipdir=require(_0xe861('0x2'));var jsonpatch=require(_0xe861('0x3'));var rp=require(_0xe861('0x4'));var moment=require(_0xe861('0x5'));var BPromise=require(_0xe861('0x6'));var Mustache=require(_0xe861('0x7'));var util=require(_0xe861('0x8'));var path=require(_0xe861('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe861('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe861('0xb'));var squel=require(_0xe861('0xc'));var crypto=require(_0xe861('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe861('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe861('0xf'));var Papa=require(_0xe861('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe861('0x11'));var as=require(_0xe861('0x12'));var hardwareService=require(_0xe861('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe861('0x14'));var config=require(_0xe861('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58846b,_0x5cf612){_0x5cf612=_0x5cf612||0xcc;return function(_0x1ecdd1){if(_0x1ecdd1){return _0x58846b[_0xe861('0x16')](_0x5cf612);}return _0x58846b[_0xe861('0x17')](_0x5cf612)['end']();};}function respondWithResult(_0x316d01,_0x123fb5){_0x123fb5=_0x123fb5||0xc8;return function(_0x38d8d4){if(_0x38d8d4){return _0x316d01[_0xe861('0x17')](_0x123fb5)[_0xe861('0x18')](_0x38d8d4);}};}function respondWithFilteredResult(_0x2a3972,_0x440de2){return function(_0x5be076){if(_0x5be076){var _0x202e21=typeof _0x440de2[_0xe861('0x19')]===_0xe861('0x1a')&&typeof _0x440de2['limit']===_0xe861('0x1a');var _0x598bb0=_0x5be076['count'];var _0x2555e2=_0x202e21?0x0:_0x440de2['offset'];var _0x1349a0=_0x202e21?_0x5be076['count']:_0x440de2[_0xe861('0x19')]+_0x440de2[_0xe861('0x1b')];var _0x2eebf4;if(_0x1349a0>=_0x598bb0){_0x1349a0=_0x598bb0;_0x2eebf4=0xc8;}else{_0x2eebf4=0xce;}_0x2a3972[_0xe861('0x17')](_0x2eebf4);return _0x2a3972[_0xe861('0x1c')](_0xe861('0x1d'),_0x2555e2+'-'+_0x1349a0+'/'+_0x598bb0)['json'](_0x5be076);}return null;};}function patchUpdates(_0x310fab){return function(_0x2291bf){try{jsonpatch['apply'](_0x2291bf,_0x310fab,!![]);}catch(_0xa619d5){return BPromise[_0xe861('0x1e')](_0xa619d5);}return _0x2291bf['save']();};}function saveUpdates(_0x23011c,_0x4fa022){return function(_0x2cf158){if(_0x2cf158){return _0x2cf158[_0xe861('0x1f')](_0x23011c)[_0xe861('0x20')](function(_0x305c32){return _0x305c32;});}return null;};}function removeEntity(_0x1ba045,_0x16fd0c){return function(_0x39ac93){if(_0x39ac93){return _0x39ac93[_0xe861('0x21')]()['then'](function(){var _0x48ea66=_0x39ac93[_0xe861('0x22')]({'plain':!![]});var _0x4bcc2f=_0xe861('0x23');return db[_0xe861('0x24')][_0xe861('0x21')]({'where':{'type':_0x4bcc2f,'resourceId':_0x48ea66['id']}})['then'](function(){return _0x39ac93;});})[_0xe861('0x20')](function(){_0x1ba045[_0xe861('0x17')](0xcc)[_0xe861('0x25')]();});}};}function handleEntityNotFound(_0x3421ad,_0x2a53e5){return function(_0x44e417){if(!_0x44e417){_0x3421ad['sendStatus'](0x194);}return _0x44e417;};}function handleError(_0x110538,_0x5c1a28){_0x5c1a28=_0x5c1a28||0x1f4;return function(_0x5658a5){logger['error'](_0x5658a5['stack']);if(_0x5658a5[_0xe861('0x26')]){delete _0x5658a5[_0xe861('0x26')];}_0x110538[_0xe861('0x17')](_0x5c1a28)[_0xe861('0x27')](_0x5658a5);};}exports[_0xe861('0x28')]=function(_0x2c7336,_0xd5432d){var _0x2cbd13={},_0x11d65a={},_0x10505b={'count':0x0,'rows':[]};var _0x1767be=_['map'](db[_0xe861('0x29')][_0xe861('0x2a')],function(_0x11bdf1){return{'name':_0x11bdf1[_0xe861('0x2b')],'type':_0x11bdf1[_0xe861('0x2c')][_0xe861('0x2d')]};});_0x11d65a[_0xe861('0x2e')]=_[_0xe861('0x2f')](_0x1767be,_0xe861('0x26'));_0x11d65a['query']=_[_0xe861('0x30')](_0x2c7336[_0xe861('0x31')]);_0x11d65a[_0xe861('0x32')]=_['intersection'](_0x11d65a['model'],_0x11d65a[_0xe861('0x31')]);_0x2cbd13['attributes']=_[_0xe861('0x33')](_0x11d65a['model'],qs[_0xe861('0x34')](_0x2c7336[_0xe861('0x31')][_0xe861('0x34')]));_0x2cbd13['attributes']=_0x2cbd13['attributes'][_0xe861('0x35')]?_0x2cbd13[_0xe861('0x36')]:_0x11d65a[_0xe861('0x2e')];if(!_0x2c7336['query'][_0xe861('0x37')](_0xe861('0x38'))){_0x2cbd13[_0xe861('0x1b')]=qs[_0xe861('0x1b')](_0x2c7336[_0xe861('0x31')][_0xe861('0x1b')]);_0x2cbd13[_0xe861('0x19')]=qs[_0xe861('0x19')](_0x2c7336['query'][_0xe861('0x19')]);}_0x2cbd13[_0xe861('0x39')]=qs[_0xe861('0x3a')](_0x2c7336[_0xe861('0x31')][_0xe861('0x3a')]);delete _0x2c7336['query']['sort'];_0x2cbd13[_0xe861('0x3b')]=qs[_0xe861('0x32')](_[_0xe861('0x3c')](_0x2c7336[_0xe861('0x31')],_0x11d65a['filters']),_0x1767be);if(_0x2c7336[_0xe861('0x31')]['filter']){_0x2cbd13[_0xe861('0x3b')]=_[_0xe861('0x3d')](_0x2cbd13['where'],{'$or':_[_0xe861('0x2f')](_0x1767be,function(_0x16c706){if(_0x16c706['type']!==_0xe861('0x3e')){var _0x2e933b={};_0x2e933b[_0x16c706[_0xe861('0x26')]]={'$like':'%'+_0x2c7336['query'][_0xe861('0x3f')]+'%'};return _0x2e933b;}})});}_0x2cbd13=_[_0xe861('0x3d')]({},_0x2cbd13,_0x2c7336[_0xe861('0x40')]);var _0x34eff3={'where':_0x2cbd13[_0xe861('0x3b')]};return db[_0xe861('0x29')][_0xe861('0x41')](_0x34eff3)[_0xe861('0x20')](function(_0x3b50a8){_0x10505b[_0xe861('0x41')]=_0x3b50a8;if(_0x2c7336[_0xe861('0x31')]['includeAll']){_0x2cbd13[_0xe861('0x42')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xe861('0x43')](_0x2cbd13);})[_0xe861('0x20')](function(_0x35adfc){_0x10505b[_0xe861('0x44')]=_0x35adfc;return _0x10505b;})[_0xe861('0x20')](respondWithFilteredResult(_0xd5432d,_0x2cbd13))[_0xe861('0x45')](handleError(_0xd5432d,null));};exports[_0xe861('0x46')]=function(_0x3beddb,_0x4095a3){var _0x3664a3={'raw':![],'where':{'id':_0x3beddb[_0xe861('0x47')]['id']}},_0x20084e={};_0x20084e['model']=_[_0xe861('0x30')](db[_0xe861('0x29')][_0xe861('0x2a')]);_0x20084e[_0xe861('0x31')]=_[_0xe861('0x30')](_0x3beddb[_0xe861('0x31')]);_0x20084e[_0xe861('0x32')]=_[_0xe861('0x33')](_0x20084e['model'],_0x20084e[_0xe861('0x31')]);_0x3664a3[_0xe861('0x36')]=_[_0xe861('0x33')](_0x20084e['model'],qs[_0xe861('0x34')](_0x3beddb[_0xe861('0x31')][_0xe861('0x34')]));_0x3664a3[_0xe861('0x36')]=_0x3664a3[_0xe861('0x36')][_0xe861('0x35')]?_0x3664a3[_0xe861('0x36')]:_0x20084e[_0xe861('0x2e')];if(_0x3beddb[_0xe861('0x31')][_0xe861('0x48')]){_0x3664a3[_0xe861('0x42')]=[{'all':!![]}];}_0x3664a3=_[_0xe861('0x3d')]({},_0x3664a3,_0x3beddb[_0xe861('0x40')]);return db['VoiceMusicOnHold']['find'](_0x3664a3)[_0xe861('0x20')](handleEntityNotFound(_0x4095a3,null))[_0xe861('0x20')](respondWithResult(_0x4095a3,null))['catch'](handleError(_0x4095a3,null));};exports['update']=function(_0x3e63a6,_0x235927){if(_0x3e63a6[_0xe861('0x49')]['id']){delete _0x3e63a6[_0xe861('0x49')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3e63a6[_0xe861('0x47')]['id']}})[_0xe861('0x20')](handleEntityNotFound(_0x235927,null))['then'](saveUpdates(_0x3e63a6[_0xe861('0x49')],null))[_0xe861('0x20')](respondWithResult(_0x235927,null))[_0xe861('0x45')](handleError(_0x235927,null));};exports[_0xe861('0x4a')]=function(_0x572f99,_0x34ae97,_0x2a725e){return db[_0xe861('0x4b')][_0xe861('0x4c')](function(_0x1e035b){if(_0x572f99['body']['mode']===_0xe861('0x4d')){_0x572f99[_0xe861('0x49')][_0xe861('0x4e')]=path[_0xe861('0x4f')](config[_0xe861('0x50')],_0xe861('0x51'),_0x572f99[_0xe861('0x49')][_0xe861('0x26')]);}return db['VoiceMusicOnHold']['create'](_0x572f99[_0xe861('0x49')],{'transaction':_0x1e035b})['then'](function(_0x168bbb){if(_0x572f99['body']['mode']==='files'){fs['mkdirSync'](_0x168bbb[_0xe861('0x4e')],parseInt('0777',0x8));}var _0x1f553f=_0x572f99['user'][_0xe861('0x22')]({'plain':!![]});if(!_0x1f553f)throw new Error(_0xe861('0x52'));if(_0x1f553f[_0xe861('0x53')]===_0xe861('0x54')){var _0x5a514a=_0x168bbb[_0xe861('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe861('0x23'),'userProfileId':_0x1f553f[_0xe861('0x55')]},'raw':!![]})['then'](function(_0xdb0771){if(_0xdb0771&&_0xdb0771[_0xe861('0x56')]===0x0){return db[_0xe861('0x24')][_0xe861('0x4a')]({'name':_0x5a514a['name'],'resourceId':_0x5a514a['id'],'type':_0xdb0771[_0xe861('0x26')],'sectionId':_0xdb0771['id']},{})[_0xe861('0x20')](function(){return _0x168bbb;});}else{return _0x168bbb;}})[_0xe861('0x45')](function(_0x1e8c36){logger['error'](_0xe861('0x57'),_0x1e8c36);});}return _0x168bbb;});})['then'](respondWithResult(_0x34ae97,0xc9))[_0xe861('0x45')](handleError(_0x34ae97,null));};exports[_0xe861('0x21')]=function(_0x29a5dd,_0x378da4,_0x4376c6){var _0x4fbff7;return db[_0xe861('0x29')]['find']({'where':{'id':_0x29a5dd['params']['id']}})['then'](function(_0x4d51c3){if(_0x4d51c3){return db[_0xe861('0x4b')]['transaction'](function(_0x40f2e9){return _0x4d51c3[_0xe861('0x21')]({'transaction':_0x40f2e9,'raw':!![]})[_0xe861('0x20')](function(_0x477818){if(_0x477818[_0xe861('0x4e')]){fs['readdirSync'](_0x477818[_0xe861('0x4e')])[_0xe861('0x58')](function(_0x4525d5){fs[_0xe861('0x59')](path[_0xe861('0x4f')](_0x477818[_0xe861('0x4e')],_0x4525d5));});fs[_0xe861('0x5a')](_0x477818['directory']);}return _0x477818;});})[_0xe861('0x45')](function(_0x3c8f97){throw new db['Sequelize'][(_0xe861('0x5b'))](_0x3c8f97[_0xe861('0x5c')]);});}})[_0xe861('0x20')](handleEntityNotFound(_0x378da4,null))[_0xe861('0x20')](removeEntity(_0x378da4,null))['catch'](handleError(_0x378da4,null));};exports[_0xe861('0x5d')]=function(_0x4bf9f4,_0x461d4d,_0x4e7c80){return db['sequelize']['transaction'](function(_0x54c430){var _0x5af745;return db['VoiceMusicOnHold'][_0xe861('0x5e')]({'where':{'id':_0x4bf9f4[_0xe861('0x47')]['id']}})['then'](function(_0x2912ed){if(_0x2912ed){_0x5af745=_0x2912ed;return _0x2912ed[_0xe861('0x5d')](_0x4bf9f4['body']['id'],{'transaction':_0x54c430});}})[_0xe861('0x20')](function(_0x2694c2){if(_0x2694c2){return db['Sound'][_0xe861('0x5f')]({'where':{'id':_0x4bf9f4['body']['id']},'attributes':['id','name',_0xe861('0x60'),_0xe861('0x61'),_0xe861('0x62')],'raw':!![]});}})[_0xe861('0x20')](function(_0x3195d9){if(_0x3195d9){var _0x48cfb8=path[_0xe861('0x4f')](config['root'],_0xe861('0x63'),util['format'](_0xe861('0x64'),path['basename'](_0x3195d9[_0xe861('0x60')],path[_0xe861('0x65')](_0x3195d9[_0xe861('0x60')])),_0x3195d9['converted_format']));var _0x5a51fa=path[_0xe861('0x4f')](config[_0xe861('0x50')],'server/files/moh',_0x5af745[_0xe861('0x26')],util['format'](_0xe861('0x64'),_0x3195d9['name'],_0x3195d9[_0xe861('0x61')]));fs[_0xe861('0x66')](_0x48cfb8,_0x5a51fa);return _0x3195d9;}})['catch'](function(_0x4bf74b){throw new db[(_0xe861('0x67'))]['ValidationError'](_0x4bf74b[_0xe861('0x5c')]);});})[_0xe861('0x20')](handleEntityNotFound(_0x461d4d,null))['then'](respondWithResult(_0x461d4d,0xc9))[_0xe861('0x45')](handleError(_0x461d4d,null));};exports[_0xe861('0x68')]=function(_0x20c1d2,_0x244d99,_0x213e91){return db[_0xe861('0x4b')][_0xe861('0x4c')](function(_0x2a14f0){var _0x240f82;return db[_0xe861('0x29')][_0xe861('0x5f')]({'where':{'id':_0x20c1d2['params']['id']}})[_0xe861('0x20')](handleEntityNotFound(_0x244d99,null))[_0xe861('0x20')](function(_0x2fb53f){if(_0x2fb53f){_0x240f82=_0x2fb53f;return _0x2fb53f[_0xe861('0x68')](_0x20c1d2[_0xe861('0x47')][_0xe861('0x69')]);}})[_0xe861('0x20')](function(_0x60d67b){if(_0x60d67b){return db[_0xe861('0x6a')][_0xe861('0x5f')]({'where':{'id':_0x20c1d2[_0xe861('0x47')][_0xe861('0x69')]},'attributes':['id',_0xe861('0x26'),_0xe861('0x60'),_0xe861('0x61'),_0xe861('0x62')],'raw':!![]});}})[_0xe861('0x20')](function(_0x2445a8){if(_0x2445a8){fs[_0xe861('0x59')](path[_0xe861('0x4f')](_0x240f82[_0xe861('0x4e')],util[_0xe861('0x6b')](_0xe861('0x64'),_0x2445a8[_0xe861('0x26')],_0x2445a8['converted_format'])));return _0x2445a8;}})['catch'](function(_0x5c7673){throw new db['Sequelize']['ValidationError'](_0x5c7673[_0xe861('0x5c')]);});})['then'](handleEntityNotFound(_0x244d99,null))[_0xe861('0x20')](respondWithStatusCode(_0x244d99,0xcc))[_0xe861('0x45')](handleError(_0x244d99,null));};exports[_0xe861('0x6c')]=function(_0x49bebd,_0x46c556,_0x428a90){var _0x516e25={};var _0xc0a24={};var _0x565b07;var _0x47a178;return db[_0xe861('0x29')][_0xe861('0x5f')]({'where':{'id':_0x49bebd[_0xe861('0x47')]['id']}})[_0xe861('0x20')](handleEntityNotFound(_0x46c556,null))['then'](function(_0xda1a85){if(_0xda1a85){_0x565b07=_0xda1a85;_0xc0a24[_0xe861('0x2e')]=_[_0xe861('0x30')](db[_0xe861('0x6a')][_0xe861('0x2a')]);_0xc0a24[_0xe861('0x31')]=_[_0xe861('0x30')](_0x49bebd[_0xe861('0x31')]);_0xc0a24['filters']=_['intersection'](_0xc0a24[_0xe861('0x2e')],_0xc0a24['query']);_0x516e25['attributes']=_[_0xe861('0x33')](_0xc0a24['model'],qs[_0xe861('0x34')](_0x49bebd[_0xe861('0x31')][_0xe861('0x34')]));_0x516e25[_0xe861('0x36')]=_0x516e25[_0xe861('0x36')][_0xe861('0x35')]?_0x516e25[_0xe861('0x36')]:_0xc0a24['model'];_0x516e25[_0xe861('0x39')]=qs['sort'](_0x49bebd[_0xe861('0x31')][_0xe861('0x3a')]);_0x516e25[_0xe861('0x3b')]=qs['filters'](_[_0xe861('0x3c')](_0x49bebd[_0xe861('0x31')],_0xc0a24[_0xe861('0x32')]));if(_0x49bebd[_0xe861('0x31')][_0xe861('0x3f')]){_0x516e25['where']=_[_0xe861('0x3d')](_0x516e25[_0xe861('0x3b')],{'$or':_[_0xe861('0x2f')](_0x516e25[_0xe861('0x36')],function(_0x1bb3d8){var _0x282f6c={};_0x282f6c[_0x1bb3d8]={'$like':'%'+_0x49bebd['query'][_0xe861('0x3f')]+'%'};return _0x282f6c;})});}_0x516e25=_[_0xe861('0x3d')]({},_0x516e25,_0x49bebd[_0xe861('0x40')]);return _0x565b07['getSounds'](_0x516e25);}})['then'](function(_0x391aa3){if(_0x391aa3){_0x47a178=_0x391aa3[_0xe861('0x35')];if(!_0x49bebd['query'][_0xe861('0x37')](_0xe861('0x38'))){_0x516e25[_0xe861('0x1b')]=qs[_0xe861('0x1b')](_0x49bebd[_0xe861('0x31')]['limit']);_0x516e25['offset']=qs[_0xe861('0x19')](_0x49bebd[_0xe861('0x31')][_0xe861('0x19')]);}return _0x565b07[_0xe861('0x6c')](_0x516e25);}})[_0xe861('0x20')](function(_0x233240){if(_0x233240){return _0x233240?{'count':_0x47a178,'rows':_0x233240}:null;}})[_0xe861('0x20')](respondWithResult(_0x46c556,null))[_0xe861('0x45')](handleError(_0x46c556,null));}; \ No newline at end of file +var _0x1d24=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','stack','name','send','index','VoiceMusicOnHold','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','body','create','sequelize','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','unlinkSync','rmdirSync','ValidationError','addSound','Sound','findOne','createdAt','root','server/files/sounds/converted','format','%s.%s','extname','save_name','symlinkSync','Sequelize','message','removeSound','id2','converted_format','getSounds','length','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x1d24,0xe5));var _0x41d2=function(_0x21774b,_0x4a6d2b){_0x21774b=_0x21774b-0x0;var _0x4675b2=_0x1d24[_0x21774b];return _0x4675b2;};'use strict';var emlformat=require(_0x41d2('0x0'));var rimraf=require(_0x41d2('0x1'));var zipdir=require(_0x41d2('0x2'));var jsonpatch=require(_0x41d2('0x3'));var rp=require('request-promise');var moment=require(_0x41d2('0x4'));var BPromise=require(_0x41d2('0x5'));var Mustache=require('mustache');var util=require(_0x41d2('0x6'));var path=require(_0x41d2('0x7'));var sox=require(_0x41d2('0x8'));var csv=require(_0x41d2('0x9'));var ejs=require(_0x41d2('0xa'));var fs=require('fs');var fs_extra=require(_0x41d2('0xb'));var _=require(_0x41d2('0xc'));var squel=require('squel');var crypto=require(_0x41d2('0xd'));var jsforce=require(_0x41d2('0xe'));var deskjs=require(_0x41d2('0xf'));var toCsv=require(_0x41d2('0x9'));var querystring=require(_0x41d2('0x10'));var Papa=require('papaparse');var Redis=require(_0x41d2('0x11'));var authService=require(_0x41d2('0x12'));var qs=require(_0x41d2('0x13'));var as=require(_0x41d2('0x14'));var hardwareService=require(_0x41d2('0x15'));var logger=require(_0x41d2('0x16'))('api');var utils=require(_0x41d2('0x17'));var config=require(_0x41d2('0x18'));var licenseUtil=require(_0x41d2('0x19'));var db=require(_0x41d2('0x1a'))['db'];function respondWithStatusCode(_0x231195,_0x40c143){_0x40c143=_0x40c143||0xcc;return function(_0x26e238){if(_0x26e238){return _0x231195[_0x41d2('0x1b')](_0x40c143);}return _0x231195[_0x41d2('0x1c')](_0x40c143)[_0x41d2('0x1d')]();};}function respondWithResult(_0x34461d,_0x29bcd4){_0x29bcd4=_0x29bcd4||0xc8;return function(_0x5969c2){if(_0x5969c2){return _0x34461d[_0x41d2('0x1c')](_0x29bcd4)[_0x41d2('0x1e')](_0x5969c2);}};}function respondWithFilteredResult(_0x29c93c,_0x3688ca){return function(_0x3d9076){if(_0x3d9076){var _0x1e1b77=typeof _0x3688ca['offset']===_0x41d2('0x1f')&&typeof _0x3688ca[_0x41d2('0x20')]===_0x41d2('0x1f');var _0x31874a=_0x3d9076[_0x41d2('0x21')];var _0x4325ab=_0x1e1b77?0x0:_0x3688ca[_0x41d2('0x22')];var _0x12415f=_0x1e1b77?_0x3d9076[_0x41d2('0x21')]:_0x3688ca[_0x41d2('0x22')]+_0x3688ca[_0x41d2('0x20')];var _0x121332;if(_0x12415f>=_0x31874a){_0x12415f=_0x31874a;_0x121332=0xc8;}else{_0x121332=0xce;}_0x29c93c[_0x41d2('0x1c')](_0x121332);return _0x29c93c['set'](_0x41d2('0x23'),_0x4325ab+'-'+_0x12415f+'/'+_0x31874a)[_0x41d2('0x1e')](_0x3d9076);}return null;};}function patchUpdates(_0x30fb13){return function(_0x5d2105){try{jsonpatch[_0x41d2('0x24')](_0x5d2105,_0x30fb13,!![]);}catch(_0x3bb160){return BPromise[_0x41d2('0x25')](_0x3bb160);}return _0x5d2105[_0x41d2('0x26')]();};}function saveUpdates(_0x23b37a,_0x459369){return function(_0x33ef1e){if(_0x33ef1e){return _0x33ef1e[_0x41d2('0x27')](_0x23b37a)[_0x41d2('0x28')](function(_0x441cb3){return _0x441cb3;});}return null;};}function removeEntity(_0x45e5e1,_0x5a3ced){return function(_0x5527e6){if(_0x5527e6){return _0x5527e6[_0x41d2('0x29')]()[_0x41d2('0x28')](function(){var _0x4ae47f=_0x5527e6['get']({'plain':!![]});var _0x7ff41=_0x41d2('0x2a');return db[_0x41d2('0x2b')][_0x41d2('0x29')]({'where':{'type':_0x7ff41,'resourceId':_0x4ae47f['id']}})[_0x41d2('0x28')](function(){return _0x5527e6;});})[_0x41d2('0x28')](function(){_0x45e5e1[_0x41d2('0x1c')](0xcc)[_0x41d2('0x1d')]();});}};}function handleEntityNotFound(_0x18bd53,_0x11ca93){return function(_0x1fdee9){if(!_0x1fdee9){_0x18bd53[_0x41d2('0x1b')](0x194);}return _0x1fdee9;};}function handleError(_0x2e39bc,_0x1244a1){_0x1244a1=_0x1244a1||0x1f4;return function(_0x4b0e25){logger['error'](_0x4b0e25[_0x41d2('0x2c')]);if(_0x4b0e25[_0x41d2('0x2d')]){delete _0x4b0e25['name'];}_0x2e39bc['status'](_0x1244a1)[_0x41d2('0x2e')](_0x4b0e25);};}exports[_0x41d2('0x2f')]=function(_0x1861e1,_0x161d81){var _0x349181={},_0x54a3d0={},_0x5c9ade={'count':0x0,'rows':[]};var _0x4bad24=_['map'](db[_0x41d2('0x30')][_0x41d2('0x31')],function(_0x4b0ae1){return{'name':_0x4b0ae1['fieldName'],'type':_0x4b0ae1[_0x41d2('0x32')][_0x41d2('0x33')]};});_0x54a3d0['model']=_[_0x41d2('0x34')](_0x4bad24,_0x41d2('0x2d'));_0x54a3d0[_0x41d2('0x35')]=_[_0x41d2('0x36')](_0x1861e1[_0x41d2('0x35')]);_0x54a3d0[_0x41d2('0x37')]=_[_0x41d2('0x38')](_0x54a3d0[_0x41d2('0x39')],_0x54a3d0[_0x41d2('0x35')]);_0x349181[_0x41d2('0x3a')]=_[_0x41d2('0x38')](_0x54a3d0[_0x41d2('0x39')],qs[_0x41d2('0x3b')](_0x1861e1[_0x41d2('0x35')][_0x41d2('0x3b')]));_0x349181[_0x41d2('0x3a')]=_0x349181[_0x41d2('0x3a')]['length']?_0x349181['attributes']:_0x54a3d0['model'];if(!_0x1861e1[_0x41d2('0x35')][_0x41d2('0x3c')](_0x41d2('0x3d'))){_0x349181[_0x41d2('0x20')]=qs[_0x41d2('0x20')](_0x1861e1[_0x41d2('0x35')][_0x41d2('0x20')]);_0x349181[_0x41d2('0x22')]=qs[_0x41d2('0x22')](_0x1861e1[_0x41d2('0x35')][_0x41d2('0x22')]);}_0x349181[_0x41d2('0x3e')]=qs[_0x41d2('0x3f')](_0x1861e1[_0x41d2('0x35')][_0x41d2('0x3f')]);delete _0x1861e1[_0x41d2('0x35')][_0x41d2('0x3f')];_0x349181[_0x41d2('0x40')]=qs['filters'](_[_0x41d2('0x41')](_0x1861e1[_0x41d2('0x35')],_0x54a3d0[_0x41d2('0x37')]),_0x4bad24);if(_0x1861e1['query'][_0x41d2('0x42')]){_0x349181['where']=_['merge'](_0x349181[_0x41d2('0x40')],{'$or':_[_0x41d2('0x34')](_0x4bad24,function(_0x13e82a){if(_0x13e82a['type']!==_0x41d2('0x43')){var _0xb9139={};_0xb9139[_0x13e82a[_0x41d2('0x2d')]]={'$like':'%'+_0x1861e1[_0x41d2('0x35')][_0x41d2('0x42')]+'%'};return _0xb9139;}})});}_0x349181=_[_0x41d2('0x44')]({},_0x349181,_0x1861e1[_0x41d2('0x45')]);var _0x45e5c3={'where':_0x349181[_0x41d2('0x40')]};return db['VoiceMusicOnHold']['count'](_0x45e5c3)['then'](function(_0xc5f741){_0x5c9ade['count']=_0xc5f741;if(_0x1861e1[_0x41d2('0x35')][_0x41d2('0x46')]){_0x349181['include']=[{'all':!![]}];}return db[_0x41d2('0x30')]['findAll'](_0x349181);})[_0x41d2('0x28')](function(_0x306c9e){_0x5c9ade[_0x41d2('0x47')]=_0x306c9e;return _0x5c9ade;})[_0x41d2('0x28')](respondWithFilteredResult(_0x161d81,_0x349181))['catch'](handleError(_0x161d81,null));};exports[_0x41d2('0x48')]=function(_0x5f40fc,_0x2e6c99){var _0x1873f5={'raw':![],'where':{'id':_0x5f40fc[_0x41d2('0x49')]['id']}},_0xdddd67={};_0xdddd67[_0x41d2('0x39')]=_[_0x41d2('0x36')](db['VoiceMusicOnHold']['rawAttributes']);_0xdddd67[_0x41d2('0x35')]=_[_0x41d2('0x36')](_0x5f40fc[_0x41d2('0x35')]);_0xdddd67[_0x41d2('0x37')]=_['intersection'](_0xdddd67['model'],_0xdddd67[_0x41d2('0x35')]);_0x1873f5[_0x41d2('0x3a')]=_['intersection'](_0xdddd67[_0x41d2('0x39')],qs['fields'](_0x5f40fc[_0x41d2('0x35')]['fields']));_0x1873f5[_0x41d2('0x3a')]=_0x1873f5[_0x41d2('0x3a')]['length']?_0x1873f5[_0x41d2('0x3a')]:_0xdddd67[_0x41d2('0x39')];if(_0x5f40fc[_0x41d2('0x35')][_0x41d2('0x46')]){_0x1873f5[_0x41d2('0x4a')]=[{'all':!![]}];}_0x1873f5=_[_0x41d2('0x44')]({},_0x1873f5,_0x5f40fc[_0x41d2('0x45')]);return db[_0x41d2('0x30')][_0x41d2('0x4b')](_0x1873f5)[_0x41d2('0x28')](handleEntityNotFound(_0x2e6c99,null))['then'](respondWithResult(_0x2e6c99,null))[_0x41d2('0x4c')](handleError(_0x2e6c99,null));};exports['update']=function(_0x5069af,_0x71019){if(_0x5069af[_0x41d2('0x4d')]['id']){delete _0x5069af[_0x41d2('0x4d')]['id'];}return db[_0x41d2('0x30')][_0x41d2('0x4b')]({'where':{'id':_0x5069af[_0x41d2('0x49')]['id']}})[_0x41d2('0x28')](handleEntityNotFound(_0x71019,null))['then'](saveUpdates(_0x5069af[_0x41d2('0x4d')],null))[_0x41d2('0x28')](respondWithResult(_0x71019,null))[_0x41d2('0x4c')](handleError(_0x71019,null));};exports[_0x41d2('0x4e')]=function(_0x4f4e12,_0x35c979,_0x2fbeaa){return db[_0x41d2('0x4f')]['transaction'](function(_0x1df3c9){if(_0x4f4e12[_0x41d2('0x4d')][_0x41d2('0x50')]===_0x41d2('0x51')){_0x4f4e12[_0x41d2('0x4d')][_0x41d2('0x52')]=path[_0x41d2('0x53')](config['root'],_0x41d2('0x54'),_0x4f4e12[_0x41d2('0x4d')]['name']);}return db[_0x41d2('0x30')]['create'](_0x4f4e12[_0x41d2('0x4d')],{'transaction':_0x1df3c9})['then'](function(_0x155b8f){if(_0x4f4e12[_0x41d2('0x4d')][_0x41d2('0x50')]===_0x41d2('0x51')){fs[_0x41d2('0x55')](_0x155b8f['directory'],parseInt(_0x41d2('0x56'),0x8));}var _0x53fc56=_0x4f4e12[_0x41d2('0x57')][_0x41d2('0x58')]({'plain':!![]});if(!_0x53fc56)throw new Error(_0x41d2('0x59'));if(_0x53fc56[_0x41d2('0x5a')]===_0x41d2('0x57')){var _0x1dee6a=_0x155b8f[_0x41d2('0x58')]({'plain':!![]});return db[_0x41d2('0x5b')][_0x41d2('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0x53fc56[_0x41d2('0x5c')]},'raw':!![]})[_0x41d2('0x28')](function(_0x37af88){if(_0x37af88&&_0x37af88[_0x41d2('0x5d')]===0x0){return db[_0x41d2('0x2b')][_0x41d2('0x4e')]({'name':_0x1dee6a[_0x41d2('0x2d')],'resourceId':_0x1dee6a['id'],'type':_0x37af88[_0x41d2('0x2d')],'sectionId':_0x37af88['id']},{})[_0x41d2('0x28')](function(){return _0x155b8f;});}else{return _0x155b8f;}})[_0x41d2('0x4c')](function(_0x5c1dbb){logger[_0x41d2('0x5e')](_0x41d2('0x5f'),_0x5c1dbb);});}return _0x155b8f;});})[_0x41d2('0x28')](respondWithResult(_0x35c979,0xc9))[_0x41d2('0x4c')](handleError(_0x35c979,null));};exports['destroy']=function(_0x202e72,_0x4c79af,_0x2764ea){var _0x3e227f;return db[_0x41d2('0x30')]['find']({'where':{'id':_0x202e72[_0x41d2('0x49')]['id']}})[_0x41d2('0x28')](function(_0x31b494){if(_0x31b494){return db[_0x41d2('0x4f')][_0x41d2('0x60')](function(_0xecf24b){return _0x31b494[_0x41d2('0x29')]({'transaction':_0xecf24b,'raw':!![]})[_0x41d2('0x28')](function(_0x270933){if(_0x270933['directory']){fs[_0x41d2('0x61')](_0x270933['directory'])['forEach'](function(_0x56eae7){fs[_0x41d2('0x62')](path[_0x41d2('0x53')](_0x270933['directory'],_0x56eae7));});fs[_0x41d2('0x63')](_0x270933[_0x41d2('0x52')]);}return _0x270933;});})[_0x41d2('0x4c')](function(_0x5a4c8e){throw new db['Sequelize'][(_0x41d2('0x64'))](_0x5a4c8e['message']);});}})[_0x41d2('0x28')](handleEntityNotFound(_0x4c79af,null))[_0x41d2('0x28')](removeEntity(_0x4c79af,null))['catch'](handleError(_0x4c79af,null));};exports[_0x41d2('0x65')]=function(_0x2fdc3e,_0x2870d0,_0x11b9b5){return db[_0x41d2('0x4f')][_0x41d2('0x60')](function(_0x3f6c1d){var _0xefdb00;return db[_0x41d2('0x30')][_0x41d2('0x4b')]({'where':{'id':_0x2fdc3e[_0x41d2('0x49')]['id']}})[_0x41d2('0x28')](function(_0x3eedf6){if(_0x3eedf6){_0xefdb00=_0x3eedf6;return _0x3eedf6['addSound'](_0x2fdc3e[_0x41d2('0x4d')]['id'],{'transaction':_0x3f6c1d});}})['then'](function(_0xfc00b5){if(_0xfc00b5){return db[_0x41d2('0x66')][_0x41d2('0x67')]({'where':{'id':_0x2fdc3e[_0x41d2('0x4d')]['id']},'attributes':['id',_0x41d2('0x2d'),'save_name','converted_format',_0x41d2('0x68')],'raw':!![]});}})[_0x41d2('0x28')](function(_0x4fefb3){if(_0x4fefb3){var _0x4dd5c7=path[_0x41d2('0x53')](config[_0x41d2('0x69')],_0x41d2('0x6a'),util[_0x41d2('0x6b')](_0x41d2('0x6c'),path['basename'](_0x4fefb3['save_name'],path[_0x41d2('0x6d')](_0x4fefb3[_0x41d2('0x6e')])),_0x4fefb3['converted_format']));var _0xfb55c0=path[_0x41d2('0x53')](config[_0x41d2('0x69')],'server/files/moh',_0xefdb00[_0x41d2('0x2d')],util['format']('%s.%s',_0x4fefb3[_0x41d2('0x2d')],_0x4fefb3['converted_format']));fs[_0x41d2('0x6f')](_0x4dd5c7,_0xfb55c0);return _0x4fefb3;}})['catch'](function(_0x52e92e){throw new db[(_0x41d2('0x70'))][(_0x41d2('0x64'))](_0x52e92e[_0x41d2('0x71')]);});})[_0x41d2('0x28')](handleEntityNotFound(_0x2870d0,null))[_0x41d2('0x28')](respondWithResult(_0x2870d0,0xc9))[_0x41d2('0x4c')](handleError(_0x2870d0,null));};exports[_0x41d2('0x72')]=function(_0x1d2d55,_0x3e54a2,_0x1a2ebc){return db[_0x41d2('0x4f')][_0x41d2('0x60')](function(_0x960a38){var _0x4dc5a9;return db['VoiceMusicOnHold'][_0x41d2('0x67')]({'where':{'id':_0x1d2d55[_0x41d2('0x49')]['id']}})[_0x41d2('0x28')](handleEntityNotFound(_0x3e54a2,null))[_0x41d2('0x28')](function(_0x39e02b){if(_0x39e02b){_0x4dc5a9=_0x39e02b;return _0x39e02b['removeSound'](_0x1d2d55[_0x41d2('0x49')][_0x41d2('0x73')]);}})[_0x41d2('0x28')](function(_0x56d966){if(_0x56d966){return db[_0x41d2('0x66')][_0x41d2('0x67')]({'where':{'id':_0x1d2d55[_0x41d2('0x49')][_0x41d2('0x73')]},'attributes':['id',_0x41d2('0x2d'),_0x41d2('0x6e'),_0x41d2('0x74'),_0x41d2('0x68')],'raw':!![]});}})['then'](function(_0x1c4176){if(_0x1c4176){fs[_0x41d2('0x62')](path[_0x41d2('0x53')](_0x4dc5a9[_0x41d2('0x52')],util['format'](_0x41d2('0x6c'),_0x1c4176[_0x41d2('0x2d')],_0x1c4176[_0x41d2('0x74')])));return _0x1c4176;}})[_0x41d2('0x4c')](function(_0x2ff39e){throw new db[(_0x41d2('0x70'))][(_0x41d2('0x64'))](_0x2ff39e[_0x41d2('0x71')]);});})[_0x41d2('0x28')](handleEntityNotFound(_0x3e54a2,null))[_0x41d2('0x28')](respondWithStatusCode(_0x3e54a2,0xcc))[_0x41d2('0x4c')](handleError(_0x3e54a2,null));};exports[_0x41d2('0x75')]=function(_0x1b270e,_0x3e6f13,_0x1e896f){var _0x4fc6ba={};var _0x27b484={};var _0x5c0449;var _0x18adfb;return db[_0x41d2('0x30')]['findOne']({'where':{'id':_0x1b270e[_0x41d2('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e6f13,null))[_0x41d2('0x28')](function(_0x45a512){if(_0x45a512){_0x5c0449=_0x45a512;_0x27b484[_0x41d2('0x39')]=_[_0x41d2('0x36')](db[_0x41d2('0x66')]['rawAttributes']);_0x27b484[_0x41d2('0x35')]=_[_0x41d2('0x36')](_0x1b270e[_0x41d2('0x35')]);_0x27b484[_0x41d2('0x37')]=_[_0x41d2('0x38')](_0x27b484[_0x41d2('0x39')],_0x27b484[_0x41d2('0x35')]);_0x4fc6ba['attributes']=_['intersection'](_0x27b484[_0x41d2('0x39')],qs[_0x41d2('0x3b')](_0x1b270e['query'][_0x41d2('0x3b')]));_0x4fc6ba[_0x41d2('0x3a')]=_0x4fc6ba[_0x41d2('0x3a')]['length']?_0x4fc6ba['attributes']:_0x27b484[_0x41d2('0x39')];_0x4fc6ba[_0x41d2('0x3e')]=qs[_0x41d2('0x3f')](_0x1b270e[_0x41d2('0x35')][_0x41d2('0x3f')]);_0x4fc6ba[_0x41d2('0x40')]=qs[_0x41d2('0x37')](_[_0x41d2('0x41')](_0x1b270e[_0x41d2('0x35')],_0x27b484[_0x41d2('0x37')]));if(_0x1b270e[_0x41d2('0x35')][_0x41d2('0x42')]){_0x4fc6ba['where']=_[_0x41d2('0x44')](_0x4fc6ba[_0x41d2('0x40')],{'$or':_[_0x41d2('0x34')](_0x4fc6ba[_0x41d2('0x3a')],function(_0x14f4f5){var _0x155324={};_0x155324[_0x14f4f5]={'$like':'%'+_0x1b270e['query']['filter']+'%'};return _0x155324;})});}_0x4fc6ba=_['merge']({},_0x4fc6ba,_0x1b270e[_0x41d2('0x45')]);return _0x5c0449[_0x41d2('0x75')](_0x4fc6ba);}})['then'](function(_0x404bd1){if(_0x404bd1){_0x18adfb=_0x404bd1[_0x41d2('0x76')];if(!_0x1b270e['query'][_0x41d2('0x3c')]('nolimit')){_0x4fc6ba['limit']=qs['limit'](_0x1b270e[_0x41d2('0x35')][_0x41d2('0x20')]);_0x4fc6ba[_0x41d2('0x22')]=qs[_0x41d2('0x22')](_0x1b270e[_0x41d2('0x35')][_0x41d2('0x22')]);}return _0x5c0449[_0x41d2('0x75')](_0x4fc6ba);}})['then'](function(_0x3ad164){if(_0x3ad164){return _0x3ad164?{'count':_0x18adfb,'rows':_0x3ad164}:null;}})[_0x41d2('0x28')](respondWithResult(_0x3e6f13,null))[_0x41d2('0x4c')](handleError(_0x3e6f13,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 5362853..6ccaac1 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 _0x5783=['path','rimraf','./voiceMusicOnHold.attributes','exports','define','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4fabfe,_0x53487c){var _0x112eaf=function(_0xea02c3){while(--_0xea02c3){_0x4fabfe['push'](_0x4fabfe['shift']());}};_0x112eaf(++_0x53487c);}(_0x5783,0x177));var _0x3578=function(_0x1aea05,_0x1ac65c){_0x1aea05=_0x1aea05-0x0;var _0x33a8af=_0x5783[_0x1aea05];return _0x33a8af;};'use strict';var _=require('lodash');var util=require(_0x3578('0x0'));var logger=require(_0x3578('0x1'))('api');var moment=require(_0x3578('0x2'));var BPromise=require(_0x3578('0x3'));var rp=require(_0x3578('0x4'));var fs=require('fs');var path=require(_0x3578('0x5'));var rimraf=require(_0x3578('0x6'));var config=require('../../config/environment');var attributes=require(_0x3578('0x7'));module[_0x3578('0x8')]=function(_0x5b56ca,_0x35b43d){return _0x5b56ca[_0x3578('0x9')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3aed=['define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x3aed,0x19a));var _0xd3ae=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0x3aed[_0x33554b];return _0x256954;};'use strict';var _=require(_0xd3ae('0x0'));var util=require('util');var logger=require(_0xd3ae('0x1'))(_0xd3ae('0x2'));var moment=require(_0xd3ae('0x3'));var BPromise=require('bluebird');var rp=require(_0xd3ae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3ae('0x5'));var config=require(_0xd3ae('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xd3ae('0x7')]=function(_0x332756,_0x8e4a6a){return _0x332756[_0xd3ae('0x8')](_0xd3ae('0x9'),attributes,{'tableName':_0xd3ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 3557a0c..12b64d5 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x138c4c,_0x5693fa){var _0x57af3d=function(_0x1b229d){while(--_0x1b229d){_0x138c4c['push'](_0x138c4c['shift']());}};_0x57af3d(++_0x5693fa);}(_0xedd9,0xfc));var _0x9edd=function(_0x224090,_0x38f7e4){_0x224090=_0x224090-0x0;var _0xd97361=_0xedd9[_0x224090];return _0xd97361;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +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(_0x20690a,_0x5bbf7f){var _0x55ec47=function(_0x28ccec){while(--_0x28ccec){_0x20690a['push'](_0x20690a['shift']());}};_0x55ec47(++_0x5bbf7f);}(_0x70e0,0x17b));var _0x070e=function(_0x394340,_0x1cdb2d){_0x394340=_0x394340-0x0;var _0x28a3bc=_0x70e0[_0x394340];return _0x28a3bc;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6d47c6f..9d11ef2 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 _0xf326=['../../components/interaction/service','./voicePrefix.controller','index','get','/describe','isAuthenticated','describe','show','/:id/users','getAgents','post','create','addAgents','/:id','update','delete','destroy','removeAgents','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xf326,0xcb));var _0x6f32=function(_0x3c1304,_0x219ae5){_0x3c1304=_0x3c1304-0x0;var _0x11b071=_0xf326[_0x3c1304];return _0x11b071;};'use strict';var multer=require('multer');var util=require(_0x6f32('0x0'));var path=require('path');var timeout=require(_0x6f32('0x1'));var express=require(_0x6f32('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6f32('0x3'));var interaction=require(_0x6f32('0x4'));var config=require('../../config/environment');var controller=require(_0x6f32('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6f32('0x6')]);router[_0x6f32('0x7')](_0x6f32('0x8'),auth[_0x6f32('0x9')](),controller[_0x6f32('0xa')]);router[_0x6f32('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6f32('0xb')]);router[_0x6f32('0x7')](_0x6f32('0xc'),auth['isAuthenticated'](),controller[_0x6f32('0xd')]);router[_0x6f32('0xe')]('/',auth[_0x6f32('0x9')](),controller[_0x6f32('0xf')]);router[_0x6f32('0xe')](_0x6f32('0xc'),auth[_0x6f32('0x9')](),controller[_0x6f32('0x10')]);router['put'](_0x6f32('0x11'),auth[_0x6f32('0x9')](),controller[_0x6f32('0x12')]);router[_0x6f32('0x13')](_0x6f32('0x11'),auth['isAuthenticated'](),controller[_0x6f32('0x14')]);router[_0x6f32('0x13')](_0x6f32('0xc'),auth[_0x6f32('0x9')](),controller[_0x6f32('0x15')]);module[_0x6f32('0x16')]=router; \ No newline at end of file +var _0x7ca8=['connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','describe','/:id','show','/:id/users','post','put','update','delete','destroy','exports','util'];(function(_0x9640d9,_0x218341){var _0x30bd3d=function(_0x12db28){while(--_0x12db28){_0x9640d9['push'](_0x9640d9['shift']());}};_0x30bd3d(++_0x218341);}(_0x7ca8,0x10f));var _0x87ca=function(_0x44b634,_0x4f5396){_0x44b634=_0x44b634-0x0;var _0x29149a=_0x7ca8[_0x44b634];return _0x29149a;};'use strict';var multer=require('multer');var util=require(_0x87ca('0x0'));var path=require('path');var timeout=require(_0x87ca('0x1'));var express=require(_0x87ca('0x2'));var router=express['Router']();var fs_extra=require(_0x87ca('0x3'));var auth=require(_0x87ca('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x87ca('0x5')]('/',auth[_0x87ca('0x6')](),controller['index']);router['get']('/describe',auth[_0x87ca('0x6')](),controller[_0x87ca('0x7')]);router[_0x87ca('0x5')](_0x87ca('0x8'),auth[_0x87ca('0x6')](),controller[_0x87ca('0x9')]);router['get'](_0x87ca('0xa'),auth[_0x87ca('0x6')](),controller['getAgents']);router[_0x87ca('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x87ca('0xc')](_0x87ca('0x8'),auth[_0x87ca('0x6')](),controller[_0x87ca('0xd')]);router[_0x87ca('0xe')](_0x87ca('0x8'),auth[_0x87ca('0x6')](),controller[_0x87ca('0xf')]);router['delete'](_0x87ca('0xa'),auth[_0x87ca('0x6')](),controller['removeAgents']);module[_0x87ca('0x10')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 1114003..b15b7bb 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 _0xfd9f=['INTEGER','exports','name','getDataValue','STRING'];(function(_0x5bb60a,_0x23fde5){var _0x72482d=function(_0x4c67f8){while(--_0x4c67f8){_0x5bb60a['push'](_0x5bb60a['shift']());}};_0x72482d(++_0x23fde5);}(_0xfd9f,0x1af));var _0xffd9=function(_0x174160,_0x3df8f4){_0x174160=_0x174160-0x0;var _0x3c85ee=_0xfd9f[_0x174160];return _0x3c85ee;};'use strict';var Sequelize=require('sequelize');module[_0xffd9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xffd9('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x26744e){return'system-'+this[_0xffd9('0x2')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xffd9('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0xffd9('0x4')]}}; \ No newline at end of file +var _0xa1ff=['getDataValue','sequelize','STRING','name','VIRTUAL','system-'];(function(_0x437cf7,_0x493c9f){var _0x2fafe2=function(_0x2bcd70){while(--_0x2bcd70){_0x437cf7['push'](_0x437cf7['shift']());}};_0x2fafe2(++_0x493c9f);}(_0xa1ff,0x1c3));var _0xfa1f=function(_0x49aed9,_0x4a7b44){_0x49aed9=_0x49aed9-0x0;var _0x5c913e=_0xa1ff[_0x49aed9];return _0x5c913e;};'use strict';var Sequelize=require(_0xfa1f('0x0'));module['exports']={'name':{'type':Sequelize[_0xfa1f('0x1')],'allowNull':![],'unique':_0xfa1f('0x2')},'prefix':{'type':Sequelize[_0xfa1f('0x3')],'get':function(_0x5c1b70){return _0xfa1f('0x4')+this[_0xfa1f('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xfa1f('0x1')]},'callerIdAll':{'type':Sequelize[_0xfa1f('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d224671..f1b7420 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 _0x88b5=['NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','show','params','include','find','catch','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','UserProfileSection','autoAssociation','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority'];(function(_0x294870,_0x35fcdb){var _0x6805e1=function(_0x58ae69){while(--_0x58ae69){_0x294870['push'](_0x294870['shift']());}};_0x6805e1(++_0x35fcdb);}(_0x88b5,0x10f));var _0x588b=function(_0x16773c,_0xf47f89){_0x16773c=_0x16773c-0x0;var _0x4b3bdb=_0x88b5[_0x16773c];return _0x4b3bdb;};'use strict';var emlformat=require(_0x588b('0x0'));var rimraf=require(_0x588b('0x1'));var zipdir=require(_0x588b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x588b('0x3'));var moment=require(_0x588b('0x4'));var BPromise=require(_0x588b('0x5'));var Mustache=require(_0x588b('0x6'));var util=require(_0x588b('0x7'));var path=require(_0x588b('0x8'));var sox=require('sox');var csv=require(_0x588b('0x9'));var ejs=require(_0x588b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x588b('0xb'));var crypto=require(_0x588b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x588b('0xd'));var toCsv=require(_0x588b('0x9'));var querystring=require(_0x588b('0xe'));var Papa=require(_0x588b('0xf'));var Redis=require(_0x588b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x588b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x588b('0x12'));var utils=require(_0x588b('0x13'));var config=require(_0x588b('0x14'));var licenseUtil=require(_0x588b('0x15'));var db=require(_0x588b('0x16'))['db'];config[_0x588b('0x17')]=_[_0x588b('0x18')](config['redis'],{'host':_0x588b('0x19'),'port':0x18eb});var socket=require(_0x588b('0x1a'))(new Redis(config[_0x588b('0x17')]));require(_0x588b('0x1b'))[_0x588b('0x1c')](socket);function respondWithStatusCode(_0x280fc4,_0x1eebe5){_0x1eebe5=_0x1eebe5||0xcc;return function(_0x25d118){if(_0x25d118){return _0x280fc4[_0x588b('0x1d')](_0x1eebe5);}return _0x280fc4[_0x588b('0x1e')](_0x1eebe5)[_0x588b('0x1f')]();};}function respondWithResult(_0x414692,_0x46d556){_0x46d556=_0x46d556||0xc8;return function(_0x48725a){if(_0x48725a){return _0x414692['status'](_0x46d556)[_0x588b('0x20')](_0x48725a);}};}function respondWithFilteredResult(_0x2b9aae,_0x94b52e){return function(_0x2ef1a2){if(_0x2ef1a2){var _0x221220=typeof _0x94b52e[_0x588b('0x21')]==='undefined'&&typeof _0x94b52e[_0x588b('0x22')]===_0x588b('0x23');var _0x6851fd=_0x2ef1a2['count'];var _0x3832d8=_0x221220?0x0:_0x94b52e[_0x588b('0x21')];var _0x20e817=_0x221220?_0x2ef1a2[_0x588b('0x24')]:_0x94b52e[_0x588b('0x21')]+_0x94b52e[_0x588b('0x22')];var _0x2e17f0;if(_0x20e817>=_0x6851fd){_0x20e817=_0x6851fd;_0x2e17f0=0xc8;}else{_0x2e17f0=0xce;}_0x2b9aae['status'](_0x2e17f0);return _0x2b9aae[_0x588b('0x25')]('Content-Range',_0x3832d8+'-'+_0x20e817+'/'+_0x6851fd)[_0x588b('0x20')](_0x2ef1a2);}return null;};}function patchUpdates(_0x232c85){return function(_0x3e7830){try{jsonpatch[_0x588b('0x26')](_0x3e7830,_0x232c85,!![]);}catch(_0x341802){return BPromise[_0x588b('0x27')](_0x341802);}return _0x3e7830[_0x588b('0x28')]();};}function saveUpdates(_0x445312,_0x185df5){return function(_0xd737ba){if(_0xd737ba){return _0xd737ba[_0x588b('0x29')](_0x445312)['then'](function(_0x13885f){return _0x13885f;});}return null;};}function removeEntity(_0x5d0abe,_0x5daf97){return function(_0x521a12){if(_0x521a12){return _0x521a12[_0x588b('0x2a')]()[_0x588b('0x2b')](function(){var _0x258037=_0x521a12[_0x588b('0x2c')]({'plain':!![]});var _0x524a94=_0x588b('0x2d');return db[_0x588b('0x2e')][_0x588b('0x2a')]({'where':{'type':_0x524a94,'resourceId':_0x258037['id']}})['then'](function(){return _0x521a12;});})[_0x588b('0x2b')](function(){_0x5d0abe[_0x588b('0x1e')](0xcc)[_0x588b('0x1f')]();});}};}function handleEntityNotFound(_0x229611,_0x46cd03){return function(_0x386a97){if(!_0x386a97){_0x229611[_0x588b('0x1d')](0x194);}return _0x386a97;};}function handleError(_0x24fca0,_0x5830b9){_0x5830b9=_0x5830b9||0x1f4;return function(_0xddef60){logger[_0x588b('0x2f')](_0xddef60[_0x588b('0x30')]);if(_0xddef60[_0x588b('0x31')]){delete _0xddef60['name'];}_0x24fca0['status'](_0x5830b9)[_0x588b('0x32')](_0xddef60);};}exports[_0x588b('0x33')]=function(_0x326bc4,_0x45e54c){var _0xeb4586={},_0x350df3={},_0x496017={'count':0x0,'rows':[]};var _0x2e8d43=_['map'](db[_0x588b('0x34')][_0x588b('0x35')],function(_0x3ec105){return{'name':_0x3ec105[_0x588b('0x36')],'type':_0x3ec105[_0x588b('0x37')][_0x588b('0x38')]};});_0x350df3[_0x588b('0x39')]=_[_0x588b('0x3a')](_0x2e8d43,_0x588b('0x31'));_0x350df3['query']=_[_0x588b('0x3b')](_0x326bc4[_0x588b('0x3c')]);_0x350df3[_0x588b('0x3d')]=_[_0x588b('0x3e')](_0x350df3['model'],_0x350df3[_0x588b('0x3c')]);_0xeb4586[_0x588b('0x3f')]=_[_0x588b('0x3e')](_0x350df3['model'],qs['fields'](_0x326bc4['query'][_0x588b('0x40')]));_0xeb4586['attributes']=_0xeb4586['attributes'][_0x588b('0x41')]?_0xeb4586[_0x588b('0x3f')]:_0x350df3[_0x588b('0x39')];if(!_0x326bc4[_0x588b('0x3c')][_0x588b('0x42')](_0x588b('0x43'))){_0xeb4586[_0x588b('0x22')]=qs[_0x588b('0x22')](_0x326bc4['query'][_0x588b('0x22')]);_0xeb4586[_0x588b('0x21')]=qs[_0x588b('0x21')](_0x326bc4['query'][_0x588b('0x21')]);}_0xeb4586[_0x588b('0x44')]=qs['sort'](_0x326bc4[_0x588b('0x3c')][_0x588b('0x45')]);_0xeb4586[_0x588b('0x46')]=qs[_0x588b('0x3d')](_['pick'](_0x326bc4['query'],_0x350df3[_0x588b('0x3d')]),_0x2e8d43);if(_0x326bc4[_0x588b('0x3c')][_0x588b('0x47')]){_0xeb4586[_0x588b('0x46')]=_[_0x588b('0x48')](_0xeb4586['where'],{'$or':_[_0x588b('0x3a')](_0x2e8d43,function(_0x2cf2e7){if(_0x2cf2e7[_0x588b('0x37')]!=='VIRTUAL'){var _0x1ca990={};_0x1ca990[_0x2cf2e7[_0x588b('0x31')]]={'$like':'%'+_0x326bc4['query'][_0x588b('0x47')]+'%'};return _0x1ca990;}})});}_0xeb4586=_['merge']({},_0xeb4586,_0x326bc4[_0x588b('0x49')]);var _0x53c4a3={'where':_0xeb4586[_0x588b('0x46')]};return db[_0x588b('0x34')]['count'](_0x53c4a3)[_0x588b('0x2b')](function(_0x33c77f){_0x496017['count']=_0x33c77f;if(_0x326bc4['query'][_0x588b('0x4a')]){_0xeb4586['include']=[{'all':!![]}];}return db[_0x588b('0x34')][_0x588b('0x4b')](_0xeb4586);})[_0x588b('0x2b')](function(_0x18a9c2){_0x496017['rows']=_0x18a9c2;return _0x496017;})[_0x588b('0x2b')](respondWithFilteredResult(_0x45e54c,_0xeb4586))['catch'](handleError(_0x45e54c,null));};exports[_0x588b('0x4c')]=function(_0x49f636,_0x1926da){var _0x2f7a90={'raw':![],'where':{'id':_0x49f636[_0x588b('0x4d')]['id']}},_0x52f86e={};_0x52f86e['model']=_['keys'](db['VoicePrefix'][_0x588b('0x35')]);_0x52f86e[_0x588b('0x3c')]=_[_0x588b('0x3b')](_0x49f636['query']);_0x52f86e[_0x588b('0x3d')]=_[_0x588b('0x3e')](_0x52f86e[_0x588b('0x39')],_0x52f86e[_0x588b('0x3c')]);_0x2f7a90['attributes']=_[_0x588b('0x3e')](_0x52f86e[_0x588b('0x39')],qs[_0x588b('0x40')](_0x49f636[_0x588b('0x3c')][_0x588b('0x40')]));_0x2f7a90['attributes']=_0x2f7a90[_0x588b('0x3f')][_0x588b('0x41')]?_0x2f7a90[_0x588b('0x3f')]:_0x52f86e[_0x588b('0x39')];if(_0x49f636[_0x588b('0x3c')][_0x588b('0x4a')]){_0x2f7a90[_0x588b('0x4e')]=[{'all':!![]}];}_0x2f7a90=_['merge']({},_0x2f7a90,_0x49f636['options']);return db[_0x588b('0x34')][_0x588b('0x4f')](_0x2f7a90)[_0x588b('0x2b')](handleEntityNotFound(_0x1926da,null))[_0x588b('0x2b')](respondWithResult(_0x1926da,null))[_0x588b('0x50')](handleError(_0x1926da,null));};exports[_0x588b('0x2a')]=function(_0x2e2b4a,_0x4f180d){return db['VoicePrefix'][_0x588b('0x4f')]({'where':{'id':_0x2e2b4a[_0x588b('0x4d')]['id']}})[_0x588b('0x2b')](handleEntityNotFound(_0x4f180d,null))[_0x588b('0x2b')](removeEntity(_0x4f180d,null))[_0x588b('0x50')](handleError(_0x4f180d,null));};exports['describe']=function(_0x3d837e,_0x36aa53){return db[_0x588b('0x34')][_0x588b('0x51')]()[_0x588b('0x2b')](respondWithResult(_0x36aa53,null))[_0x588b('0x50')](handleError(_0x36aa53,null));};exports[_0x588b('0x52')]=function(_0x27392a,_0x12dc33){var _0x4500ef;return db[_0x588b('0x53')][_0x588b('0x54')](function(_0x1c5107){return db[_0x588b('0x34')][_0x588b('0x52')](_0x27392a[_0x588b('0x55')],{'transaction':_0x1c5107})['then'](function(_0x37e5da){_0x4500ef=_0x37e5da['get']({'plain':!![]});return db[_0x588b('0x56')][_0x588b('0x4f')]({'where':{'id':_0x4500ef[_0x588b('0x57')]},'raw':!![]})[_0x588b('0x2b')](function(_0x345917){return createVoicePrefixExtensions(_0x4500ef,_0x345917,_0x1c5107);});});})[_0x588b('0x2b')](function(){var _0x3a1ad3=_0x27392a[_0x588b('0x58')][_0x588b('0x2c')]({'plain':!![]});if(!_0x3a1ad3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a1ad3['role']===_0x588b('0x58')){var _0x299330=_0x4500ef;return db[_0x588b('0x59')]['find']({'where':{'name':_0x588b('0x2d'),'userProfileId':_0x3a1ad3['userProfileId']},'raw':!![]})[_0x588b('0x2b')](function(_0x10e468){if(_0x10e468&&_0x10e468[_0x588b('0x5a')]===0x0){return db[_0x588b('0x2e')][_0x588b('0x52')]({'name':_0x299330['name'],'resourceId':_0x299330['id'],'type':_0x10e468['name'],'sectionId':_0x10e468['id']},{})[_0x588b('0x2b')](function(){return _0x4500ef;});}else{return _0x4500ef;}})[_0x588b('0x50')](function(_0x41c369){logger[_0x588b('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41c369);throw _0x41c369;});}return _0x4500ef;})[_0x588b('0x2b')](respondWithResult(_0x12dc33,null))[_0x588b('0x50')](handleError(_0x12dc33,null));};function Extension(_0xf0e0d5,_0x3b0791,_0x2dccb3,_0xeba798){this[_0x588b('0x5b')]=_0x588b('0x5c');this[_0x588b('0x5d')]=_0xf0e0d5;this['app']=_0x2dccb3;this['type']=_0x588b('0x5e');this[_0x588b('0x5f')]=_0x588b('0x60');this[_0x588b('0x61')]=_0x3b0791;this['appdata']=_0xeba798;}function createVoicePrefixExtensions(_0x3d078c,_0x5efa86,_0x37a0d2){return new BPromise(function(_0x24ce26,_0x15e309){var _0x4f5cd0=new Extension(formatPrefixName(_0x3d078c['prefix']),0x1,_0x588b('0x62'),_0x588b('0x63'));_0x4f5cd0[_0x588b('0x64')]=_0x3d078c['id'];return db[_0x588b('0x56')][_0x588b('0x52')](_0x4f5cd0,{'transaction':_0x37a0d2})['then'](function(_0x4b71ec){var _0x2606a9=_0x4b71ec[_0x588b('0x2c')]({'plain':!![]});var _0x1ccbf2=_[_0x588b('0x3a')](addVoicePrefixExtensions(_0x3d078c,_0x5efa86),function(_0x2e0a8b){_0x2e0a8b['VoiceExtensionId']=_0x2606a9['id'];_0x2e0a8b[_0x588b('0x64')]=_0x3d078c['id'];return _0x2e0a8b;});return db[_0x588b('0x56')][_0x588b('0x65')](_0x1ccbf2,{'transaction':_0x37a0d2})[_0x588b('0x2b')](function(_0x3de71e){if(!_0x3de71e){return _0x15e309('Extensions\x20creation\x20failed');}else{return _0x24ce26(_0x3de71e);}})['catch'](function(_0x58b342){return _0x15e309(_0x58b342);});});;});};function addVoicePrefixExtensions(_0xb173d9,_0x38a120){var _0x33455d=[];var _0x5ee378=formatPrefixName(_0xb173d9[_0x588b('0x66')]);_0x33455d[_0x588b('0x67')](new Extension(_0x5ee378,0x2,_0x588b('0x68'),_0x588b('0x69')+_0xb173d9[_0x588b('0x31')]));if(_0xb173d9[_0x588b('0x6a')]){_0x33455d[_0x588b('0x67')](new Extension(_0x5ee378,0x3,_0x588b('0x68'),_0x588b('0x6b')+_0xb173d9[_0x588b('0x6a')]));}else{_0x33455d[_0x588b('0x67')](new Extension(_0x5ee378,0x3,'NoOp',_0x588b('0x6c')));}_0x33455d['push'](new Extension(_0x5ee378,0x4,_0x588b('0x6d'),_0x38a120['context']+','+_0x588b('0x6e')+(0x8+_0xb173d9[_0x588b('0x31')][_0x588b('0x41')])+'}'+','+0x1));return _0x33455d;}function formatPrefixName(_0x4c12f1){var _0x1b6589='_';for(var _0x1c5c3e=0x0;_0x1c5c3e<_0x4c12f1[_0x588b('0x41')];_0x1c5c3e++){if(_0x4c12f1[_0x588b('0x6f')](_0x1c5c3e)=='-'){_0x1b6589+=_0x4c12f1[_0x588b('0x6f')](_0x1c5c3e);}else{_0x1b6589+='['+_0x4c12f1[_0x588b('0x6f')](_0x1c5c3e)+']';}}_0x1b6589+='.';return _0x1b6589;}exports[_0x588b('0x29')]=function(_0x53ca92,_0x291f58,_0x27248f){var _0x1647e3=_0x53ca92['body'];_0x1647e3['prefix']=_0x588b('0x70')+_0x1647e3['name']+'-';return db[_0x588b('0x53')][_0x588b('0x54')](function(_0x122317){return db[_0x588b('0x34')][_0x588b('0x29')](_0x1647e3,{'where':{'id':_0x1647e3['id']},'transaction':_0x122317})[_0x588b('0x2b')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x1647e3['id']},'transaction':_0x122317})[_0x588b('0x2b')](function(){return db[_0x588b('0x56')][_0x588b('0x4f')]({'where':{'id':_0x1647e3[_0x588b('0x57')]},'raw':!![]})['then'](function(_0x298a3d){return createVoicePrefixExtensions(_0x1647e3,_0x298a3d,_0x122317);});});});})[_0x588b('0x2b')](function(){return db[_0x588b('0x34')][_0x588b('0x71')](_0x1647e3['id']);})[_0x588b('0x2b')](respondWithResult(_0x291f58,null))[_0x588b('0x50')](handleError(_0x291f58,null));};exports['addAgents']=function(_0x45f9cb,_0x1afd77,_0xdf12a6){return db[_0x588b('0x34')][_0x588b('0x4f')]({'where':{'id':_0x45f9cb[_0x588b('0x4d')]['id']}})[_0x588b('0x2b')](handleEntityNotFound(_0x1afd77,null))[_0x588b('0x2b')](function(_0x2431b9){if(_0x2431b9){return _0x2431b9[_0x588b('0x72')](_0x45f9cb[_0x588b('0x55')][_0x588b('0x73')],_['omit'](_0x45f9cb[_0x588b('0x55')],[_0x588b('0x73'),'id'])||{})[_0x588b('0x74')](function(_0xca96ce){for(var _0x39d5ab=0x0;_0x39d5ab<_0x45f9cb[_0x588b('0x55')]['ids'][_0x588b('0x41')];_0x39d5ab+=0x1){socket[_0x588b('0x75')](_0x588b('0x76'),{'UserId':Number(_0x45f9cb[_0x588b('0x55')][_0x588b('0x73')][_0x39d5ab]),'VoicePrefixId':Number(_0x45f9cb[_0x588b('0x4d')]['id'])});}return _0xca96ce;});}})[_0x588b('0x2b')](respondWithResult(_0x1afd77,null))[_0x588b('0x50')](handleError(_0x1afd77,null));};exports[_0x588b('0x77')]=function(_0x3766c2,_0x416c8b,_0x347d55){return db[_0x588b('0x34')][_0x588b('0x4f')]({'where':{'id':_0x3766c2[_0x588b('0x4d')]['id']}})[_0x588b('0x2b')](handleEntityNotFound(_0x416c8b,null))[_0x588b('0x2b')](function(_0x10b40d){if(_0x10b40d){return _0x10b40d['removeAgents'](_0x3766c2['query'][_0x588b('0x73')])[_0x588b('0x2b')](function(){if(_['isArray'](_0x3766c2['query'][_0x588b('0x73')])){for(var _0x142a6b=0x0;_0x142a6b<_0x3766c2[_0x588b('0x3c')]['ids']['length'];_0x142a6b+=0x1){socket[_0x588b('0x75')](_0x588b('0x78'),{'UserId':Number(_0x3766c2[_0x588b('0x3c')][_0x588b('0x73')][_0x142a6b]),'VoicePrefixId':Number(_0x3766c2[_0x588b('0x4d')]['id'])});}}else{socket[_0x588b('0x75')](_0x588b('0x78'),{'UserId':Number(_0x3766c2[_0x588b('0x3c')]['ids']),'VoicePrefixId':Number(_0x3766c2[_0x588b('0x4d')]['id'])});}});}})[_0x588b('0x2b')](respondWithStatusCode(_0x416c8b,null))[_0x588b('0x50')](handleError(_0x416c8b,null));};exports[_0x588b('0x79')]=function(_0x3e0f68,_0x596376,_0x58ebb1){var _0x1e6bb3={};var _0x4858ba={};var _0x5d398f;var _0x54cdce;return db[_0x588b('0x34')][_0x588b('0x7a')]({'where':{'id':_0x3e0f68[_0x588b('0x4d')]['id']}})[_0x588b('0x2b')](handleEntityNotFound(_0x596376,null))[_0x588b('0x2b')](function(_0x1a730e){if(_0x1a730e){_0x5d398f=_0x1a730e;_0x4858ba[_0x588b('0x39')]=_['keys'](db['User']['rawAttributes']);_0x4858ba[_0x588b('0x3c')]=_[_0x588b('0x3b')](_0x3e0f68[_0x588b('0x3c')]);_0x4858ba['filters']=_[_0x588b('0x3e')](_0x4858ba[_0x588b('0x39')],_0x4858ba[_0x588b('0x3c')]);_0x1e6bb3[_0x588b('0x3f')]=_[_0x588b('0x3e')](_0x4858ba[_0x588b('0x39')],qs[_0x588b('0x40')](_0x3e0f68[_0x588b('0x3c')]['fields']));_0x1e6bb3['attributes']=_0x1e6bb3['attributes']['length']?_0x1e6bb3[_0x588b('0x3f')]:_0x4858ba['model'];_0x1e6bb3['order']=qs[_0x588b('0x45')](_0x3e0f68[_0x588b('0x3c')][_0x588b('0x45')]);_0x1e6bb3['where']=qs['filters'](_['pick'](_0x3e0f68[_0x588b('0x3c')],_0x4858ba[_0x588b('0x3d')]));if(_0x3e0f68['query'][_0x588b('0x47')]){_0x1e6bb3[_0x588b('0x46')]=_[_0x588b('0x48')](_0x1e6bb3[_0x588b('0x46')],{'$or':_[_0x588b('0x3a')](_0x1e6bb3[_0x588b('0x3f')],function(_0x2a3594){var _0x297a4f={};_0x297a4f[_0x2a3594]={'$like':'%'+_0x3e0f68[_0x588b('0x3c')][_0x588b('0x47')]+'%'};return _0x297a4f;})});}_0x1e6bb3=_[_0x588b('0x48')]({},_0x1e6bb3,_0x3e0f68['options']);return _0x5d398f[_0x588b('0x79')](_0x1e6bb3);}})[_0x588b('0x2b')](function(_0x261165){if(_0x261165){_0x54cdce=_0x261165[_0x588b('0x41')];if(!_0x3e0f68[_0x588b('0x3c')]['hasOwnProperty'](_0x588b('0x43'))){_0x1e6bb3[_0x588b('0x22')]=qs[_0x588b('0x22')](_0x3e0f68[_0x588b('0x3c')]['limit']);_0x1e6bb3['offset']=qs['offset'](_0x3e0f68[_0x588b('0x3c')][_0x588b('0x21')]);}return _0x5d398f['getAgents'](_0x1e6bb3);}})[_0x588b('0x2b')](function(_0x3228a4){if(_0x3228a4){return _0x3228a4?{'count':_0x54cdce,'rows':_0x3228a4}:null;}})[_0x588b('0x2b')](respondWithResult(_0x596376,null))[_0x588b('0x50')](handleError(_0x596376,null));}; \ No newline at end of file +var _0x4f2f=['offset','limit','set','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VoicePrefix','include','findAll','catch','show','params','includeAll','options','find','describe','create','sequelize','transaction','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','Set','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','addAgents','ids','omit','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','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','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','end','json','undefined','count'];(function(_0x5a8274,_0x3bd06a){var _0x54daf2=function(_0xcfa87){while(--_0xcfa87){_0x5a8274['push'](_0x5a8274['shift']());}};_0x54daf2(++_0x3bd06a);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x4f2f[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf4f2('0x0'));var jsonpatch=require(_0xf4f2('0x1'));var rp=require('request-promise');var moment=require(_0xf4f2('0x2'));var BPromise=require(_0xf4f2('0x3'));var Mustache=require(_0xf4f2('0x4'));var util=require(_0xf4f2('0x5'));var path=require(_0xf4f2('0x6'));var sox=require(_0xf4f2('0x7'));var csv=require(_0xf4f2('0x8'));var ejs=require(_0xf4f2('0x9'));var fs=require('fs');var fs_extra=require(_0xf4f2('0xa'));var _=require(_0xf4f2('0xb'));var squel=require(_0xf4f2('0xc'));var crypto=require('crypto');var jsforce=require(_0xf4f2('0xd'));var deskjs=require(_0xf4f2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf4f2('0xf'));var Papa=require(_0xf4f2('0x10'));var Redis=require(_0xf4f2('0x11'));var authService=require(_0xf4f2('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf4f2('0x13'));var utils=require(_0xf4f2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf4f2('0x15'));var db=require(_0xf4f2('0x16'))['db'];config['redis']=_[_0xf4f2('0x17')](config['redis'],{'host':_0xf4f2('0x18'),'port':0x18eb});var socket=require(_0xf4f2('0x19'))(new Redis(config[_0xf4f2('0x1a')]));require('./voicePrefix.socket')[_0xf4f2('0x1b')](socket);function respondWithStatusCode(_0x260164,_0x3ada76){_0x3ada76=_0x3ada76||0xcc;return function(_0x36bae7){if(_0x36bae7){return _0x260164['sendStatus'](_0x3ada76);}return _0x260164[_0xf4f2('0x1c')](_0x3ada76)[_0xf4f2('0x1d')]();};}function respondWithResult(_0x418b9a,_0x27ec1d){_0x27ec1d=_0x27ec1d||0xc8;return function(_0x42466b){if(_0x42466b){return _0x418b9a['status'](_0x27ec1d)[_0xf4f2('0x1e')](_0x42466b);}};}function respondWithFilteredResult(_0x4b1331,_0x5cf942){return function(_0x499b44){if(_0x499b44){var _0x51d50c=typeof _0x5cf942['offset']===_0xf4f2('0x1f')&&typeof _0x5cf942['limit']===_0xf4f2('0x1f');var _0xfcc2c2=_0x499b44[_0xf4f2('0x20')];var _0xc14ddb=_0x51d50c?0x0:_0x5cf942[_0xf4f2('0x21')];var _0x5f4839=_0x51d50c?_0x499b44[_0xf4f2('0x20')]:_0x5cf942[_0xf4f2('0x21')]+_0x5cf942[_0xf4f2('0x22')];var _0x588861;if(_0x5f4839>=_0xfcc2c2){_0x5f4839=_0xfcc2c2;_0x588861=0xc8;}else{_0x588861=0xce;}_0x4b1331[_0xf4f2('0x1c')](_0x588861);return _0x4b1331[_0xf4f2('0x23')](_0xf4f2('0x24'),_0xc14ddb+'-'+_0x5f4839+'/'+_0xfcc2c2)[_0xf4f2('0x1e')](_0x499b44);}return null;};}function patchUpdates(_0x149e1a){return function(_0x4c4c8c){try{jsonpatch[_0xf4f2('0x25')](_0x4c4c8c,_0x149e1a,!![]);}catch(_0x4365ab){return BPromise['reject'](_0x4365ab);}return _0x4c4c8c[_0xf4f2('0x26')]();};}function saveUpdates(_0x4d36dc,_0x1b77b3){return function(_0x4aac67){if(_0x4aac67){return _0x4aac67[_0xf4f2('0x27')](_0x4d36dc)[_0xf4f2('0x28')](function(_0x520595){return _0x520595;});}return null;};}function removeEntity(_0x541c7c,_0x1baf92){return function(_0x48d2cb){if(_0x48d2cb){return _0x48d2cb[_0xf4f2('0x29')]()[_0xf4f2('0x28')](function(){var _0x1b7246=_0x48d2cb[_0xf4f2('0x2a')]({'plain':!![]});var _0x3d3182=_0xf4f2('0x2b');return db[_0xf4f2('0x2c')][_0xf4f2('0x29')]({'where':{'type':_0x3d3182,'resourceId':_0x1b7246['id']}})[_0xf4f2('0x28')](function(){return _0x48d2cb;});})[_0xf4f2('0x28')](function(){_0x541c7c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x174510,_0x272ed9){return function(_0x49d327){if(!_0x49d327){_0x174510[_0xf4f2('0x2d')](0x194);}return _0x49d327;};}function handleError(_0x47f4b8,_0x190a42){_0x190a42=_0x190a42||0x1f4;return function(_0x549192){logger['error'](_0x549192[_0xf4f2('0x2e')]);if(_0x549192[_0xf4f2('0x2f')]){delete _0x549192[_0xf4f2('0x2f')];}_0x47f4b8[_0xf4f2('0x1c')](_0x190a42)[_0xf4f2('0x30')](_0x549192);};}exports[_0xf4f2('0x31')]=function(_0x6da655,_0x25ee3e){var _0x135d4b={},_0x48739b={},_0x3407c0={'count':0x0,'rows':[]};var _0xfb214d=_[_0xf4f2('0x32')](db['VoicePrefix'][_0xf4f2('0x33')],function(_0x3bb184){return{'name':_0x3bb184[_0xf4f2('0x34')],'type':_0x3bb184[_0xf4f2('0x35')]['key']};});_0x48739b[_0xf4f2('0x36')]=_[_0xf4f2('0x32')](_0xfb214d,_0xf4f2('0x2f'));_0x48739b[_0xf4f2('0x37')]=_[_0xf4f2('0x38')](_0x6da655[_0xf4f2('0x37')]);_0x48739b[_0xf4f2('0x39')]=_[_0xf4f2('0x3a')](_0x48739b['model'],_0x48739b[_0xf4f2('0x37')]);_0x135d4b[_0xf4f2('0x3b')]=_[_0xf4f2('0x3a')](_0x48739b[_0xf4f2('0x36')],qs[_0xf4f2('0x3c')](_0x6da655[_0xf4f2('0x37')][_0xf4f2('0x3c')]));_0x135d4b['attributes']=_0x135d4b['attributes'][_0xf4f2('0x3d')]?_0x135d4b[_0xf4f2('0x3b')]:_0x48739b[_0xf4f2('0x36')];if(!_0x6da655[_0xf4f2('0x37')]['hasOwnProperty'](_0xf4f2('0x3e'))){_0x135d4b[_0xf4f2('0x22')]=qs['limit'](_0x6da655[_0xf4f2('0x37')][_0xf4f2('0x22')]);_0x135d4b[_0xf4f2('0x21')]=qs[_0xf4f2('0x21')](_0x6da655[_0xf4f2('0x37')][_0xf4f2('0x21')]);}_0x135d4b[_0xf4f2('0x3f')]=qs[_0xf4f2('0x40')](_0x6da655[_0xf4f2('0x37')]['sort']);_0x135d4b[_0xf4f2('0x41')]=qs[_0xf4f2('0x39')](_['pick'](_0x6da655['query'],_0x48739b['filters']),_0xfb214d);if(_0x6da655['query'][_0xf4f2('0x42')]){_0x135d4b[_0xf4f2('0x41')]=_['merge'](_0x135d4b['where'],{'$or':_[_0xf4f2('0x32')](_0xfb214d,function(_0x25deaa){if(_0x25deaa[_0xf4f2('0x35')]!=='VIRTUAL'){var _0xef2916={};_0xef2916[_0x25deaa[_0xf4f2('0x2f')]]={'$like':'%'+_0x6da655[_0xf4f2('0x37')]['filter']+'%'};return _0xef2916;}})});}_0x135d4b=_[_0xf4f2('0x43')]({},_0x135d4b,_0x6da655['options']);var _0x228896={'where':_0x135d4b[_0xf4f2('0x41')]};return db[_0xf4f2('0x44')][_0xf4f2('0x20')](_0x228896)[_0xf4f2('0x28')](function(_0x5d44be){_0x3407c0['count']=_0x5d44be;if(_0x6da655[_0xf4f2('0x37')]['includeAll']){_0x135d4b[_0xf4f2('0x45')]=[{'all':!![]}];}return db[_0xf4f2('0x44')][_0xf4f2('0x46')](_0x135d4b);})['then'](function(_0x5d6dc5){_0x3407c0['rows']=_0x5d6dc5;return _0x3407c0;})[_0xf4f2('0x28')](respondWithFilteredResult(_0x25ee3e,_0x135d4b))[_0xf4f2('0x47')](handleError(_0x25ee3e,null));};exports[_0xf4f2('0x48')]=function(_0x467b6f,_0x13bddf){var _0x3c17db={'raw':![],'where':{'id':_0x467b6f[_0xf4f2('0x49')]['id']}},_0x2436b5={};_0x2436b5['model']=_[_0xf4f2('0x38')](db[_0xf4f2('0x44')][_0xf4f2('0x33')]);_0x2436b5[_0xf4f2('0x37')]=_[_0xf4f2('0x38')](_0x467b6f[_0xf4f2('0x37')]);_0x2436b5[_0xf4f2('0x39')]=_['intersection'](_0x2436b5['model'],_0x2436b5['query']);_0x3c17db[_0xf4f2('0x3b')]=_[_0xf4f2('0x3a')](_0x2436b5[_0xf4f2('0x36')],qs[_0xf4f2('0x3c')](_0x467b6f[_0xf4f2('0x37')]['fields']));_0x3c17db[_0xf4f2('0x3b')]=_0x3c17db[_0xf4f2('0x3b')][_0xf4f2('0x3d')]?_0x3c17db[_0xf4f2('0x3b')]:_0x2436b5[_0xf4f2('0x36')];if(_0x467b6f[_0xf4f2('0x37')][_0xf4f2('0x4a')]){_0x3c17db[_0xf4f2('0x45')]=[{'all':!![]}];}_0x3c17db=_[_0xf4f2('0x43')]({},_0x3c17db,_0x467b6f[_0xf4f2('0x4b')]);return db[_0xf4f2('0x44')][_0xf4f2('0x4c')](_0x3c17db)[_0xf4f2('0x28')](handleEntityNotFound(_0x13bddf,null))['then'](respondWithResult(_0x13bddf,null))[_0xf4f2('0x47')](handleError(_0x13bddf,null));};exports[_0xf4f2('0x29')]=function(_0x4e13c3,_0x794f27){return db[_0xf4f2('0x44')][_0xf4f2('0x4c')]({'where':{'id':_0x4e13c3[_0xf4f2('0x49')]['id']}})[_0xf4f2('0x28')](handleEntityNotFound(_0x794f27,null))[_0xf4f2('0x28')](removeEntity(_0x794f27,null))[_0xf4f2('0x47')](handleError(_0x794f27,null));};exports[_0xf4f2('0x4d')]=function(_0x5a019d,_0x55111b){return db[_0xf4f2('0x44')][_0xf4f2('0x4d')]()[_0xf4f2('0x28')](respondWithResult(_0x55111b,null))[_0xf4f2('0x47')](handleError(_0x55111b,null));};exports[_0xf4f2('0x4e')]=function(_0x129274,_0x41f263){var _0x1290b0;return db[_0xf4f2('0x4f')][_0xf4f2('0x50')](function(_0x5a62b4){return db[_0xf4f2('0x44')][_0xf4f2('0x4e')](_0x129274[_0xf4f2('0x51')],{'transaction':_0x5a62b4})[_0xf4f2('0x28')](function(_0x1c0dc7){_0x1290b0=_0x1c0dc7[_0xf4f2('0x2a')]({'plain':!![]});return db['VoiceExtension'][_0xf4f2('0x4c')]({'where':{'id':_0x1290b0['VoiceExtensionId']},'raw':!![]})[_0xf4f2('0x28')](function(_0x396589){return createVoicePrefixExtensions(_0x1290b0,_0x396589,_0x5a62b4);});});})[_0xf4f2('0x28')](function(){var _0x3c4d25=_0x129274['user']['get']({'plain':!![]});if(!_0x3c4d25)throw new Error(_0xf4f2('0x52'));if(_0x3c4d25[_0xf4f2('0x53')]===_0xf4f2('0x54')){var _0x322a88=_0x1290b0;return db[_0xf4f2('0x55')][_0xf4f2('0x4c')]({'where':{'name':_0xf4f2('0x2b'),'userProfileId':_0x3c4d25[_0xf4f2('0x56')]},'raw':!![]})[_0xf4f2('0x28')](function(_0x2be74a){if(_0x2be74a&&_0x2be74a[_0xf4f2('0x57')]===0x0){return db[_0xf4f2('0x2c')][_0xf4f2('0x4e')]({'name':_0x322a88['name'],'resourceId':_0x322a88['id'],'type':_0x2be74a['name'],'sectionId':_0x2be74a['id']},{})[_0xf4f2('0x28')](function(){return _0x1290b0;});}else{return _0x1290b0;}})[_0xf4f2('0x47')](function(_0x548333){logger[_0xf4f2('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x548333);throw _0x548333;});}return _0x1290b0;})[_0xf4f2('0x28')](respondWithResult(_0x41f263,null))[_0xf4f2('0x47')](handleError(_0x41f263,null));};function Extension(_0x496043,_0x24e6cf,_0x4c7cd7,_0x43d537){this['context']=_0xf4f2('0x59');this[_0xf4f2('0x5a')]=_0x496043;this[_0xf4f2('0x5b')]=_0x4c7cd7;this[_0xf4f2('0x35')]=_0xf4f2('0x5c');this[_0xf4f2('0x5d')]=_0xf4f2('0x5e');this[_0xf4f2('0x5f')]=_0x24e6cf;this[_0xf4f2('0x60')]=_0x43d537;}function createVoicePrefixExtensions(_0x125fcc,_0x1f14a1,_0x462d11){return new BPromise(function(_0xb7153d,_0x32902b){var _0x7b7363=new Extension(formatPrefixName(_0x125fcc[_0xf4f2('0x61')]),0x1,_0xf4f2('0x62'),'Voice\x20Prefix');_0x7b7363[_0xf4f2('0x63')]=_0x125fcc['id'];return db[_0xf4f2('0x64')][_0xf4f2('0x4e')](_0x7b7363,{'transaction':_0x462d11})[_0xf4f2('0x28')](function(_0x38cd3c){var _0x150e8c=_0x38cd3c[_0xf4f2('0x2a')]({'plain':!![]});var _0x4e77f2=_[_0xf4f2('0x32')](addVoicePrefixExtensions(_0x125fcc,_0x1f14a1),function(_0x528029){_0x528029[_0xf4f2('0x65')]=_0x150e8c['id'];_0x528029['VoicePrefixId']=_0x125fcc['id'];return _0x528029;});return db['VoiceExtension'][_0xf4f2('0x66')](_0x4e77f2,{'transaction':_0x462d11})[_0xf4f2('0x28')](function(_0x1b57ae){if(!_0x1b57ae){return _0x32902b(_0xf4f2('0x67'));}else{return _0xb7153d(_0x1b57ae);}})['catch'](function(_0x4bd6a7){return _0x32902b(_0x4bd6a7);});});;});};function addVoicePrefixExtensions(_0x454786,_0x306f15){var _0x3aa375=[];var _0x360d1f=formatPrefixName(_0x454786['prefix']);_0x3aa375['push'](new Extension(_0x360d1f,0x2,_0xf4f2('0x68'),'CDR(prefix)='+_0x454786[_0xf4f2('0x2f')]));if(_0x454786[_0xf4f2('0x69')]){_0x3aa375[_0xf4f2('0x6a')](new Extension(_0x360d1f,0x3,'Set',_0xf4f2('0x6b')+_0x454786['callerIdAll']));}else{_0x3aa375[_0xf4f2('0x6a')](new Extension(_0x360d1f,0x3,_0xf4f2('0x62'),_0xf4f2('0x6c')));}_0x3aa375[_0xf4f2('0x6a')](new Extension(_0x360d1f,0x4,'goto',_0x306f15['context']+','+_0xf4f2('0x6d')+(0x8+_0x454786[_0xf4f2('0x2f')][_0xf4f2('0x3d')])+'}'+','+0x1));return _0x3aa375;}function formatPrefixName(_0x40d85e){var _0xb71e0f='_';for(var _0x5ad964=0x0;_0x5ad964<_0x40d85e['length'];_0x5ad964++){if(_0x40d85e['charAt'](_0x5ad964)=='-'){_0xb71e0f+=_0x40d85e[_0xf4f2('0x6e')](_0x5ad964);}else{_0xb71e0f+='['+_0x40d85e[_0xf4f2('0x6e')](_0x5ad964)+']';}}_0xb71e0f+='.';return _0xb71e0f;}exports[_0xf4f2('0x27')]=function(_0x31689c,_0x4071a8,_0x557c3d){var _0x535aaa=_0x31689c[_0xf4f2('0x51')];_0x535aaa[_0xf4f2('0x61')]=_0xf4f2('0x6f')+_0x535aaa['name']+'-';return db[_0xf4f2('0x4f')]['transaction'](function(_0x51255e){return db[_0xf4f2('0x44')][_0xf4f2('0x27')](_0x535aaa,{'where':{'id':_0x535aaa['id']},'transaction':_0x51255e})[_0xf4f2('0x28')](function(){return db[_0xf4f2('0x64')][_0xf4f2('0x29')]({'where':{'VoicePrefixId':_0x535aaa['id']},'transaction':_0x51255e})[_0xf4f2('0x28')](function(){return db[_0xf4f2('0x64')][_0xf4f2('0x4c')]({'where':{'id':_0x535aaa[_0xf4f2('0x65')]},'raw':!![]})['then'](function(_0x51aa88){return createVoicePrefixExtensions(_0x535aaa,_0x51aa88,_0x51255e);});});});})['then'](function(){return db['VoicePrefix']['findById'](_0x535aaa['id']);})[_0xf4f2('0x28')](respondWithResult(_0x4071a8,null))['catch'](handleError(_0x4071a8,null));};exports['addAgents']=function(_0x55df2a,_0x1b867d,_0x233316){return db[_0xf4f2('0x44')]['find']({'where':{'id':_0x55df2a[_0xf4f2('0x49')]['id']}})[_0xf4f2('0x28')](handleEntityNotFound(_0x1b867d,null))[_0xf4f2('0x28')](function(_0x5089aa){if(_0x5089aa){return _0x5089aa[_0xf4f2('0x70')](_0x55df2a[_0xf4f2('0x51')][_0xf4f2('0x71')],_[_0xf4f2('0x72')](_0x55df2a[_0xf4f2('0x51')],[_0xf4f2('0x71'),'id'])||{})['spread'](function(_0x24bcef){for(var _0x12414b=0x0;_0x12414b<_0x55df2a[_0xf4f2('0x51')][_0xf4f2('0x71')]['length'];_0x12414b+=0x1){socket[_0xf4f2('0x73')]('userVoicePrefix:save',{'UserId':Number(_0x55df2a[_0xf4f2('0x51')]['ids'][_0x12414b]),'VoicePrefixId':Number(_0x55df2a[_0xf4f2('0x49')]['id'])});}return _0x24bcef;});}})[_0xf4f2('0x28')](respondWithResult(_0x1b867d,null))[_0xf4f2('0x47')](handleError(_0x1b867d,null));};exports[_0xf4f2('0x74')]=function(_0x5cf73a,_0x24007b,_0x305c42){return db[_0xf4f2('0x44')][_0xf4f2('0x4c')]({'where':{'id':_0x5cf73a[_0xf4f2('0x49')]['id']}})['then'](handleEntityNotFound(_0x24007b,null))['then'](function(_0x242007){if(_0x242007){return _0x242007[_0xf4f2('0x74')](_0x5cf73a[_0xf4f2('0x37')]['ids'])[_0xf4f2('0x28')](function(){if(_[_0xf4f2('0x75')](_0x5cf73a['query'][_0xf4f2('0x71')])){for(var _0x3e4a8b=0x0;_0x3e4a8b<_0x5cf73a[_0xf4f2('0x37')][_0xf4f2('0x71')][_0xf4f2('0x3d')];_0x3e4a8b+=0x1){socket[_0xf4f2('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x5cf73a[_0xf4f2('0x37')][_0xf4f2('0x71')][_0x3e4a8b]),'VoicePrefixId':Number(_0x5cf73a[_0xf4f2('0x49')]['id'])});}}else{socket[_0xf4f2('0x73')](_0xf4f2('0x76'),{'UserId':Number(_0x5cf73a['query'][_0xf4f2('0x71')]),'VoicePrefixId':Number(_0x5cf73a['params']['id'])});}});}})[_0xf4f2('0x28')](respondWithStatusCode(_0x24007b,null))['catch'](handleError(_0x24007b,null));};exports[_0xf4f2('0x77')]=function(_0x10c5b3,_0x3ac3e5,_0x59fc7b){var _0x465992={};var _0x25c73b={};var _0x3676d3;var _0x4a9cba;return db[_0xf4f2('0x44')][_0xf4f2('0x78')]({'where':{'id':_0x10c5b3[_0xf4f2('0x49')]['id']}})[_0xf4f2('0x28')](handleEntityNotFound(_0x3ac3e5,null))[_0xf4f2('0x28')](function(_0x13a99a){if(_0x13a99a){_0x3676d3=_0x13a99a;_0x25c73b['model']=_[_0xf4f2('0x38')](db[_0xf4f2('0x79')][_0xf4f2('0x33')]);_0x25c73b[_0xf4f2('0x37')]=_[_0xf4f2('0x38')](_0x10c5b3[_0xf4f2('0x37')]);_0x25c73b[_0xf4f2('0x39')]=_[_0xf4f2('0x3a')](_0x25c73b[_0xf4f2('0x36')],_0x25c73b[_0xf4f2('0x37')]);_0x465992[_0xf4f2('0x3b')]=_[_0xf4f2('0x3a')](_0x25c73b['model'],qs[_0xf4f2('0x3c')](_0x10c5b3['query'][_0xf4f2('0x3c')]));_0x465992['attributes']=_0x465992[_0xf4f2('0x3b')][_0xf4f2('0x3d')]?_0x465992[_0xf4f2('0x3b')]:_0x25c73b[_0xf4f2('0x36')];_0x465992[_0xf4f2('0x3f')]=qs[_0xf4f2('0x40')](_0x10c5b3[_0xf4f2('0x37')]['sort']);_0x465992[_0xf4f2('0x41')]=qs[_0xf4f2('0x39')](_['pick'](_0x10c5b3[_0xf4f2('0x37')],_0x25c73b[_0xf4f2('0x39')]));if(_0x10c5b3[_0xf4f2('0x37')]['filter']){_0x465992[_0xf4f2('0x41')]=_[_0xf4f2('0x43')](_0x465992['where'],{'$or':_[_0xf4f2('0x32')](_0x465992[_0xf4f2('0x3b')],function(_0x5d97b7){var _0x1e6876={};_0x1e6876[_0x5d97b7]={'$like':'%'+_0x10c5b3[_0xf4f2('0x37')][_0xf4f2('0x42')]+'%'};return _0x1e6876;})});}_0x465992=_['merge']({},_0x465992,_0x10c5b3[_0xf4f2('0x4b')]);return _0x3676d3[_0xf4f2('0x77')](_0x465992);}})[_0xf4f2('0x28')](function(_0x2a4551){if(_0x2a4551){_0x4a9cba=_0x2a4551[_0xf4f2('0x3d')];if(!_0x10c5b3[_0xf4f2('0x37')][_0xf4f2('0x7a')](_0xf4f2('0x3e'))){_0x465992[_0xf4f2('0x22')]=qs[_0xf4f2('0x22')](_0x10c5b3[_0xf4f2('0x37')][_0xf4f2('0x22')]);_0x465992[_0xf4f2('0x21')]=qs[_0xf4f2('0x21')](_0x10c5b3[_0xf4f2('0x37')][_0xf4f2('0x21')]);}return _0x3676d3[_0xf4f2('0x77')](_0x465992);}})[_0xf4f2('0x28')](function(_0x38c83f){if(_0x38c83f){return _0x38c83f?{'count':_0x4a9cba,'rows':_0x38c83f}:null;}})[_0xf4f2('0x28')](respondWithResult(_0x3ac3e5,null))[_0xf4f2('0x47')](handleError(_0x3ac3e5,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index e419a54..dae68f1 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 _0x1374=['VoicePrefix','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x16c4b4,_0xf01770){var _0x32de8e=function(_0x50cf04){while(--_0x50cf04){_0x16c4b4['push'](_0x16c4b4['shift']());}};_0x32de8e(++_0xf01770);}(_0x1374,0xce));var _0x4137=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x1374[_0x36eaaa];return _0x461349;};'use strict';var EventEmitter=require(_0x4137('0x0'));var VoicePrefix=require(_0x4137('0x1'))['db'][_0x4137('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4137('0x3'),'afterDestroy':_0x4137('0x4')};function emitEvent(_0xe958){return function(_0x48b4cf,_0x152413,_0x471695){VoicePrefixEvents[_0x4137('0x5')](_0xe958+':'+_0x48b4cf['id'],_0x48b4cf);VoicePrefixEvents[_0x4137('0x5')](_0xe958,_0x48b4cf);_0x471695(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x4137('0x6')](e,emitEvent(event));}}module[_0x4137('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xd54c=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xd54c,0xe8));var _0xcd54=function(_0x531a7f,_0x4f8a3f){_0x531a7f=_0x531a7f-0x0;var _0xa67aa2=_0xd54c[_0x531a7f];return _0xa67aa2;};'use strict';var EventEmitter=require(_0xcd54('0x0'));var VoicePrefix=require(_0xcd54('0x1'))['db'][_0xcd54('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xcd54('0x3')](0x0);var events={'afterCreate':_0xcd54('0x4'),'afterUpdate':_0xcd54('0x5'),'afterDestroy':_0xcd54('0x6')};function emitEvent(_0x5b0c4d){return function(_0x4c2406,_0x39df20,_0x53c4e4){VoicePrefixEvents[_0xcd54('0x7')](_0x5b0c4d+':'+_0x4c2406['id'],_0x4c2406);VoicePrefixEvents[_0xcd54('0x7')](_0x5b0c4d,_0x4c2406);_0x53c4e4(null);};}for(var e in events){if(events[_0xcd54('0x8')](e)){var event=events[e];VoicePrefix[_0xcd54('0x9')](e,emitEvent(event));}}module[_0xcd54('0xa')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 8c01bdc..62b2ca2 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 _0x30eb=['../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x21cb42,_0x4a9d87){var _0x4d847b=function(_0x555ede){while(--_0x555ede){_0x21cb42['push'](_0x21cb42['shift']());}};_0x4d847b(++_0x4a9d87);}(_0x30eb,0xe9));var _0xb30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30eb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb30e('0x0'));var util=require('util');var logger=require(_0xb30e('0x1'))(_0xb30e('0x2'));var moment=require('moment');var BPromise=require(_0xb30e('0x3'));var rp=require(_0xb30e('0x4'));var fs=require('fs');var path=require(_0xb30e('0x5'));var rimraf=require(_0xb30e('0x6'));var config=require(_0xb30e('0x7'));var attributes=require('./voicePrefix.attributes');module[_0xb30e('0x8')]=function(_0x6fb6c7,_0x176b0d){return _0x6fb6c7[_0xb30e('0x9')](_0xb30e('0xa'),attributes,{'tableName':_0xb30e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b2a=['voice_prefixes','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoicePrefix'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8b2a,0x1a3));var _0xa8b2=function(_0x382602,_0x5e9d2d){_0x382602=_0x382602-0x0;var _0x14dda6=_0x8b2a[_0x382602];return _0x14dda6;};'use strict';var _=require('lodash');var util=require(_0xa8b2('0x0'));var logger=require('../../config/logger')(_0xa8b2('0x1'));var moment=require(_0xa8b2('0x2'));var BPromise=require(_0xa8b2('0x3'));var rp=require(_0xa8b2('0x4'));var fs=require('fs');var path=require(_0xa8b2('0x5'));var rimraf=require(_0xa8b2('0x6'));var config=require(_0xa8b2('0x7'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x7955ad,_0x4f2a41){return _0x7955ad[_0xa8b2('0x8')](_0xa8b2('0x9'),attributes,{'tableName':_0xa8b2('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 4f027e3..d745496 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 _0x496e=['info','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x496e,0x1a0));var _0xe496=function(_0x1c3569,_0x30aaac){_0x1c3569=_0x1c3569-0x0;var _0x1af5cc=_0x496e[_0x1c3569];return _0x1af5cc;};'use strict';var _=require('lodash');var util=require(_0xe496('0x0'));var moment=require(_0xe496('0x1'));var BPromise=require(_0xe496('0x2'));var rs=require(_0xe496('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe496('0x4'))('rpc');var config=require(_0xe496('0x5'));var jayson=require(_0xe496('0x6'));var client=jayson[_0xe496('0x7')][_0xe496('0x8')]({'port':0x232a});config[_0xe496('0x9')]=_[_0xe496('0xa')](config[_0xe496('0x9')],{'host':_0xe496('0xb'),'port':0x18eb});var socket=require(_0xe496('0xc'))(new Redis(config[_0xe496('0x9')]));require(_0xe496('0xd'))['register'](socket);function respondWithRpcPromise(_0x4a4caa,_0x37c55b,_0x5ca4d4){return new BPromise(function(_0x2e679b,_0x44936f){return client[_0xe496('0xe')](_0x4a4caa,_0x5ca4d4)[_0xe496('0xf')](function(_0x19d4fa){logger[_0xe496('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x37c55b,'request\x20sent');logger[_0xe496('0x11')](_0xe496('0x12'),_0x37c55b,'request\x20sent',JSON[_0xe496('0x13')](_0x19d4fa));if(_0x19d4fa[_0xe496('0x14')]){if(_0x19d4fa[_0xe496('0x14')][_0xe496('0x15')]===0x1f4){logger['error'](_0xe496('0x16'),_0x37c55b,_0x19d4fa['error'][_0xe496('0x17')]);return _0x44936f(_0x19d4fa['error'][_0xe496('0x17')]);}logger[_0xe496('0x14')](_0xe496('0x16'),_0x37c55b,_0x19d4fa[_0xe496('0x14')]['message']);return _0x2e679b(_0x19d4fa[_0xe496('0x14')][_0xe496('0x17')]);}else{logger['info'](_0xe496('0x16'),_0x37c55b,_0xe496('0x18'));_0x2e679b(_0x19d4fa[_0xe496('0x19')][_0xe496('0x17')]);}})[_0xe496('0x1a')](function(_0x25e42d){logger[_0xe496('0x14')](_0xe496('0x16'),_0x37c55b,_0x25e42d);_0x44936f(_0x25e42d);});});} \ No newline at end of file +var _0xd5f9=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x133f31,_0x404a54){var _0x578c84=function(_0x1023f0){while(--_0x1023f0){_0x133f31['push'](_0x133f31['shift']());}};_0x578c84(++_0x404a54);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0xd5f9[_0x409deb];return _0x15a4f7;};'use strict';var _=require(_0x9d5f('0x0'));var util=require(_0x9d5f('0x1'));var moment=require(_0x9d5f('0x2'));var BPromise=require(_0x9d5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d5f('0x4'));var db=require(_0x9d5f('0x5'))['db'];var utils=require(_0x9d5f('0x6'));var logger=require(_0x9d5f('0x7'))(_0x9d5f('0x8'));var config=require(_0x9d5f('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9d5f('0xa')]=_[_0x9d5f('0xb')](config['redis'],{'host':_0x9d5f('0xc'),'port':0x18eb});var socket=require(_0x9d5f('0xd'))(new Redis(config['redis']));require(_0x9d5f('0xe'))[_0x9d5f('0xf')](socket);function respondWithRpcPromise(_0x4c3def,_0xff9bab,_0x554793){return new BPromise(function(_0x3d0fdf,_0x3b71ed){return client[_0x9d5f('0x10')](_0x4c3def,_0x554793)[_0x9d5f('0x11')](function(_0x32a6f4){logger['info'](_0x9d5f('0x12'),_0xff9bab,_0x9d5f('0x13'));logger[_0x9d5f('0x14')](_0x9d5f('0x15'),_0xff9bab,_0x9d5f('0x13'),JSON[_0x9d5f('0x16')](_0x32a6f4));if(_0x32a6f4[_0x9d5f('0x17')]){if(_0x32a6f4[_0x9d5f('0x17')][_0x9d5f('0x18')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0xff9bab,_0x32a6f4['error']['message']);return _0x3b71ed(_0x32a6f4[_0x9d5f('0x17')][_0x9d5f('0x19')]);}logger['error'](_0x9d5f('0x12'),_0xff9bab,_0x32a6f4[_0x9d5f('0x17')][_0x9d5f('0x19')]);return _0x3d0fdf(_0x32a6f4[_0x9d5f('0x17')][_0x9d5f('0x19')]);}else{logger['info'](_0x9d5f('0x12'),_0xff9bab,_0x9d5f('0x13'));_0x3d0fdf(_0x32a6f4[_0x9d5f('0x1a')][_0x9d5f('0x19')]);}})[_0x9d5f('0x1b')](function(_0x3df923){logger[_0x9d5f('0x17')]('VoicePrefix,\x20%s,\x20%s',_0xff9bab,_0x3df923);_0x3b71ed(_0x3df923);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 9e82196..110d72b 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 _0xe739=['length','voicePrefix:','./voicePrefix.events','remove','update','removeListener','register'];(function(_0x224737,_0x170939){var _0x1cd976=function(_0x138d26){while(--_0x138d26){_0x224737['push'](_0x224737['shift']());}};_0x1cd976(++_0x170939);}(_0xe739,0x105));var _0x9e73=function(_0x25a49f,_0x44626b){_0x25a49f=_0x25a49f-0x0;var _0x8c5dc6=_0xe739[_0x25a49f];return _0x8c5dc6;};'use strict';var VoicePrefixEvents=require(_0x9e73('0x0'));var events=['save',_0x9e73('0x1'),_0x9e73('0x2')];function createListener(_0x2dc1a9,_0x508042){return function(_0x54a986){_0x508042['emit'](_0x2dc1a9,_0x54a986);};}function removeListener(_0x3bbc00,_0x43c2e8){return function(){VoicePrefixEvents[_0x9e73('0x3')](_0x3bbc00,_0x43c2e8);};}exports[_0x9e73('0x4')]=function(_0x4cb2ed){for(var _0x3db8fa=0x0,_0x26cb5b=events[_0x9e73('0x5')];_0x3db8fa<_0x26cb5b;_0x3db8fa++){var _0x5e46e7=events[_0x3db8fa];var _0xa49f86=createListener(_0x9e73('0x6')+_0x5e46e7,_0x4cb2ed);VoicePrefixEvents['on'](_0x5e46e7,_0xa49f86);}}; \ No newline at end of file +var _0xd0a4=['emit','removeListener','register','./voicePrefix.events','save'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd0a4,0x166));var _0x4d0a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd0a4[_0x5b644e];return _0x49c6bf;};'use strict';var VoicePrefixEvents=require(_0x4d0a('0x0'));var events=[_0x4d0a('0x1'),'remove','update'];function createListener(_0x4b7fcf,_0x2b01d2){return function(_0x2007d6){_0x2b01d2[_0x4d0a('0x2')](_0x4b7fcf,_0x2007d6);};}function removeListener(_0x37ba9a,_0x27ba10){return function(){VoicePrefixEvents[_0x4d0a('0x3')](_0x37ba9a,_0x27ba10);};}exports[_0x4d0a('0x4')]=function(_0x25dfae){for(var _0x330e38=0x0,_0x4a3a1a=events['length'];_0x330e38<_0x4a3a1a;_0x330e38++){var _0xd6c889=events[_0x330e38];var _0x1feaea=createListener('voicePrefix:'+_0xd6c889,_0x25dfae);VoicePrefixEvents['on'](_0xd6c889,_0x1feaea);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bd3a56a..6d90eb4 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 _0x772f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','get','/:id','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','/:id/lists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeBlackLists','exports','util','path','express','Router'];(function(_0x52d3c1,_0x25db7b){var _0x85307f=function(_0x128a92){while(--_0x128a92){_0x52d3c1['push'](_0x52d3c1['shift']());}};_0x85307f(++_0x25db7b);}(_0x772f,0x77));var _0xf772=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0x772f[_0xea1570];return _0x579e74;};'use strict';var multer=require('multer');var util=require(_0xf772('0x0'));var path=require(_0xf772('0x1'));var timeout=require('connect-timeout');var express=require(_0xf772('0x2'));var router=express[_0xf772('0x3')]();var fs_extra=require(_0xf772('0x4'));var auth=require(_0xf772('0x5'));var interaction=require(_0xf772('0x6'));var config=require(_0xf772('0x7'));var controller=require(_0xf772('0x8'));router['get']('/',auth[_0xf772('0x9')](),controller['index']);router[_0xf772('0xa')](_0xf772('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf772('0xa')](_0xf772('0xc'),auth['isAuthenticated'](),controller[_0xf772('0xd')]);router[_0xf772('0xa')]('/:id/hopper_histories',auth[_0xf772('0x9')](),controller[_0xf772('0xe')]);router[_0xf772('0xa')]('/:id/hopper_finals',auth[_0xf772('0x9')](),controller[_0xf772('0xf')]);router['get'](_0xf772('0x10'),auth['isAuthenticated'](),controller[_0xf772('0x11')]);router['get'](_0xf772('0x12'),auth[_0xf772('0x9')](),controller[_0xf772('0x13')]);router['get'](_0xf772('0x14'),auth[_0xf772('0x9')](),controller[_0xf772('0x15')]);router[_0xf772('0xa')](_0xf772('0x16'),auth[_0xf772('0x9')](),controller[_0xf772('0x17')]);router[_0xf772('0xa')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0xf772('0xa')](_0xf772('0x18'),auth[_0xf772('0x9')](),controller[_0xf772('0x19')]);router[_0xf772('0x1a')]('/',auth[_0xf772('0x9')](),controller[_0xf772('0x1b')]);router[_0xf772('0x1a')](_0xf772('0x1c'),auth[_0xf772('0x9')](),controller[_0xf772('0x1d')]);router[_0xf772('0x1a')]('/:id/teams',auth[_0xf772('0x9')](),controller[_0xf772('0x1e')]);router['post'](_0xf772('0x14'),auth[_0xf772('0x9')](),controller['addAgents']);router[_0xf772('0x1a')](_0xf772('0x1f'),auth[_0xf772('0x9')](),controller['addLists']);router['post'](_0xf772('0x18'),auth[_0xf772('0x9')](),controller[_0xf772('0x20')]);router[_0xf772('0x21')]('/:id',auth['isAuthenticated'](),controller[_0xf772('0x22')]);router[_0xf772('0x23')]('/:id',auth[_0xf772('0x9')](),controller[_0xf772('0x24')]);router[_0xf772('0x23')](_0xf772('0x12'),auth[_0xf772('0x9')](),controller[_0xf772('0x25')]);router[_0xf772('0x23')]('/:id/users',auth[_0xf772('0x9')](),controller[_0xf772('0x26')]);router['delete'](_0xf772('0x1f'),auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0xf772('0x18'),auth['isAuthenticated'](),controller[_0xf772('0x27')]);module[_0xf772('0x28')]=router; \ No newline at end of file +var _0x4448=['/:id/teams','/:id/users','getAgents','getMembers','/:id/lists','getLists','getBlackLists','post','create','addTeams','addAgents','/:id/blacklists','addBlackLists','put','/:id','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x3cd2bb,_0x1b70e7){var _0x1fdd46=function(_0x4c590a){while(--_0x4c590a){_0x3cd2bb['push'](_0x3cd2bb['shift']());}};_0x1fdd46(++_0x1b70e7);}(_0x4448,0xbf));var _0x8444=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4448[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8444('0x0'));var util=require(_0x8444('0x1'));var path=require(_0x8444('0x2'));var timeout=require(_0x8444('0x3'));var express=require(_0x8444('0x4'));var router=express[_0x8444('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8444('0x6'));var interaction=require(_0x8444('0x7'));var config=require(_0x8444('0x8'));var controller=require(_0x8444('0x9'));router[_0x8444('0xa')]('/',auth[_0x8444('0xb')](),controller['index']);router[_0x8444('0xa')]('/:id',auth[_0x8444('0xb')](),controller[_0x8444('0xc')]);router[_0x8444('0xa')](_0x8444('0xd'),auth[_0x8444('0xb')](),controller[_0x8444('0xe')]);router[_0x8444('0xa')](_0x8444('0xf'),auth[_0x8444('0xb')](),controller['getHopperHistories']);router[_0x8444('0xa')](_0x8444('0x10'),auth[_0x8444('0xb')](),controller[_0x8444('0x11')]);router[_0x8444('0xa')](_0x8444('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x8444('0xa')](_0x8444('0x13'),auth[_0x8444('0xb')](),controller['getTeams']);router['get'](_0x8444('0x14'),auth[_0x8444('0xb')](),controller[_0x8444('0x15')]);router[_0x8444('0xa')]('/:id/members',auth[_0x8444('0xb')](),controller[_0x8444('0x16')]);router[_0x8444('0xa')](_0x8444('0x17'),auth[_0x8444('0xb')](),controller[_0x8444('0x18')]);router['get']('/:id/blacklists',auth[_0x8444('0xb')](),controller[_0x8444('0x19')]);router[_0x8444('0x1a')]('/',auth[_0x8444('0xb')](),controller[_0x8444('0x1b')]);router[_0x8444('0x1a')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x8444('0x1a')](_0x8444('0x13'),auth[_0x8444('0xb')](),controller[_0x8444('0x1c')]);router['post'](_0x8444('0x14'),auth[_0x8444('0xb')](),controller[_0x8444('0x1d')]);router[_0x8444('0x1a')](_0x8444('0x17'),auth[_0x8444('0xb')](),controller['addLists']);router['post'](_0x8444('0x1e'),auth[_0x8444('0xb')](),controller[_0x8444('0x1f')]);router[_0x8444('0x20')](_0x8444('0x21'),auth[_0x8444('0xb')](),controller[_0x8444('0x22')]);router[_0x8444('0x23')](_0x8444('0x21'),auth[_0x8444('0xb')](),controller[_0x8444('0x24')]);router[_0x8444('0x23')](_0x8444('0x13'),auth[_0x8444('0xb')](),controller[_0x8444('0x25')]);router[_0x8444('0x23')](_0x8444('0x14'),auth[_0x8444('0xb')](),controller[_0x8444('0x26')]);router['delete']('/:id/lists',auth[_0x8444('0xb')](),controller[_0x8444('0x27')]);router[_0x8444('0x23')]('/:id/blacklists',auth[_0x8444('0xb')](),controller[_0x8444('0x28')]);module[_0x8444('0x29')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 6e570fd..af1f4a7 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 _0xef72=['exports','STRING','outbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','type','getDataValue','dialMethod','strategy','inbound','booked','roundrobin','progressive','predictive','INTEGER','ENUM','yes','all','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize'];(function(_0x3c68ac,_0x38b406){var _0x35d849=function(_0x1fb2e0){while(--_0x1fb2e0){_0x3c68ac['push'](_0x3c68ac['shift']());}};_0x35d849(++_0x38b406);}(_0xef72,0xf8));var _0x2ef7=function(_0x30b148,_0x10da07){_0x30b148=_0x30b148-0x0;var _0x39b26a=_0xef72[_0x30b148];return _0x39b26a;};'use strict';var Sequelize=require(_0x2ef7('0x0'));module[_0x2ef7('0x1')]={'name':{'type':Sequelize[_0x2ef7('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x2ef7('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':_0x2ef7('0x4')},'announce':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x2ef7('0x5'),'leastrecent',_0x2ef7('0x6'),_0x2ef7('0x7'),_0x2ef7('0x8'),_0x2ef7('0x9'),_0x2ef7('0xa'),_0x2ef7('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x3a1902){this['setDataValue']('strategy',_0x3a1902?_0x3a1902:_0x2ef7('0x8'));},'get':function(){var _0x5f54f2=this['getDataValue'](_0x2ef7('0xc'));var _0x14f20a=this[_0x2ef7('0xd')](_0x2ef7('0xe'));var _0x59d8a2=this['getDataValue'](_0x2ef7('0xf'));if(_0x5f54f2===_0x2ef7('0x10')){return _0x59d8a2;}if(_0x14f20a===_0x2ef7('0x11')&&_0x59d8a2===_0x2ef7('0x8')||_0x14f20a==='booked'&&_0x59d8a2===_0x2ef7('0x12')){return _0x59d8a2;}if(_0x14f20a===_0x2ef7('0x13')||_0x14f20a===_0x2ef7('0x14')||_0x14f20a==='power'){return _0x59d8a2;}return null;}},'servicelevel':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2ef7('0x15')](0xb)},'timeout':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2ef7('0x2')]},'weight':{'type':Sequelize[_0x2ef7('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x2ef7('0x16')]('yes','no',_0x2ef7('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2ef7('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2ef7('0x16')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2ef7('0x16')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2ef7('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2ef7('0x16')]('yes','no'),'defaultValue':_0x2ef7('0x17')},'announce_holdtime':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no',_0x2ef7('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x2ef7('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2ef7('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2ef7('0x2')]},'queue_quantity1':{'type':Sequelize[_0x2ef7('0x2')]},'queue_quantity2':{'type':Sequelize[_0x2ef7('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x2ef7('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x2ef7('0x1a')],'set':function(_0x1625fc){this[_0x2ef7('0x1b')](_0x2ef7('0x1c'),_0x1625fc?_0x1625fc[_0x2ef7('0x1d')](','):[]);},'get':function(){return this[_0x2ef7('0xd')](_0x2ef7('0x1c'))?this[_0x2ef7('0xd')](_0x2ef7('0x1c'))[_0x2ef7('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':_0x2ef7('0x17'),'set':function(_0x52146d){this[_0x2ef7('0x1b')](_0x2ef7('0x1f'),_0x52146d?_0x52146d['join'](','):undefined);},'get':function(){return this[_0x2ef7('0xd')](_0x2ef7('0x1f'))?this[_0x2ef7('0xd')]('joinempty')[_0x2ef7('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':'no','set':function(_0x55bcb2){this[_0x2ef7('0x1b')](_0x2ef7('0x20'),_0x55bcb2?_0x55bcb2[_0x2ef7('0x1d')](','):undefined);},'get':function(){return this[_0x2ef7('0xd')](_0x2ef7('0x20'))?this[_0x2ef7('0xd')](_0x2ef7('0x20'))[_0x2ef7('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2ef7('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x2ef7('0x16')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ef7('0x2')]},'acw':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':0x0,'set':function(_0x4b5561){this[_0x2ef7('0x1b')](_0x2ef7('0x22'),_0x4b5561);if(_0x4b5561){if(this['getDataValue'](_0x2ef7('0x23'))<0x2){this[_0x2ef7('0x1b')](_0x2ef7('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2ef7('0x24')},'dialMethod':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x25'),_0x2ef7('0x13'),'power',_0x2ef7('0x14'),_0x2ef7('0x11')),'defaultValue':_0x2ef7('0x13'),'comment':_0x2ef7('0x26')},'dialLimitChannel':{'type':Sequelize[_0x2ef7('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2ef7('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2ef7('0x28')},'dialPowerLevel':{'type':Sequelize[_0x2ef7('0x29')](0x2)[_0x2ef7('0x2a')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2ef7('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0x2ef7('0x16')]('agentBusyFactor',_0x2ef7('0x2c')),'defaultValue':_0x2ef7('0x2c'),'comment':_0x2ef7('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2ef7('0x29')](0x2)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2ef7('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x2ef7('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2ef7('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2ef7('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2ef7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x2ef7('0x2')],'defaultValue':'tTxX','comment':_0x2ef7('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x31')},'dialQueueProject':{'type':Sequelize[_0x2ef7('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x2ef7('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2ef7('0x38')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x39'),_0x2ef7('0x3a'),'onlyIfOpen'),'defaultValue':_0x2ef7('0x39')},'dialAMDActive':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':0x0,'comment':_0x2ef7('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2ef7('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2ef7('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2ef7('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2ef7('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2ef7('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2ef7('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x2ef7('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2ef7('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2ef7('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2ef7('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2ef7('0x15')](0x9)[_0x2ef7('0x2a')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2ef7('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2ef7('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':0x0,'comment':_0x2ef7('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2ef7('0x16')](_0x2ef7('0x46'),_0x2ef7('0x47')),'defaultValue':_0x2ef7('0x46')},'dialQueueProject2':{'type':Sequelize[_0x2ef7('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x2ef7('0x2a')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ef7('0x4e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ef7('0x4f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2ef7('0x15')](0x5)[_0x2ef7('0x2a')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2ef7('0x15')],'allowNull':!![],'comment':_0x2ef7('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x2ef7('0x21')],'defaultValue':![],'comment':_0x2ef7('0x51'),'set':function(_0x2b94a8){if(!_0x2b94a8)this[_0x2ef7('0x1b')]('mandatoryDispositionPauseId',null);this[_0x2ef7('0x1b')](_0x2ef7('0x52'),_0x2b94a8);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2ef7('0x15')](0x3)[_0x2ef7('0x2a')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x2ef7('0x2a')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xcb81=['#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','inbound','STRING','default','ENUM','leastrecent','fewestcalls','rrmemory','linear','wrandom','ringall','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcb81,0x154));var _0x1cb8=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xcb81[_0xca1f0e];return _0x35e4ef;};'use strict';var Sequelize=require(_0x1cb8('0x0'));module[_0x1cb8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1cb8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound','outbound'),'allowNull':![],'defaultValue':_0x1cb8('0x3')},'musiconhold':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':_0x1cb8('0x5')},'announce':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1cb8('0x6')]('rr','ringall',_0x1cb8('0x7'),_0x1cb8('0x8'),'random',_0x1cb8('0x9'),_0x1cb8('0xa'),_0x1cb8('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0x1cb8('0xc'),'set':function(_0x51dc9e){this['setDataValue'](_0x1cb8('0xd'),_0x51dc9e?_0x51dc9e:_0x1cb8('0x9'));},'get':function(){var _0x16600b=this[_0x1cb8('0xe')](_0x1cb8('0xf'));var _0x32715a=this[_0x1cb8('0xe')](_0x1cb8('0x10'));var _0x522539=this[_0x1cb8('0xe')](_0x1cb8('0xd'));if(_0x16600b===_0x1cb8('0x3')){return _0x522539;}if(_0x32715a===_0x1cb8('0x11')&&_0x522539===_0x1cb8('0x9')||_0x32715a==='booked'&&_0x522539===_0x1cb8('0x12')){return _0x522539;}if(_0x32715a===_0x1cb8('0x13')||_0x32715a===_0x1cb8('0x14')||_0x32715a===_0x1cb8('0x15')){return _0x522539;}return null;}},'servicelevel':{'type':Sequelize[_0x1cb8('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1cb8('0x16')](0xb)},'timeout':{'type':Sequelize[_0x1cb8('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1cb8('0x4')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1cb8('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defaultValue':_0x1cb8('0x17')},'autopause':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no',_0x1cb8('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1cb8('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1cb8('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1cb8('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1cb8('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defaultValue':_0x1cb8('0x17')},'announce_holdtime':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x1cb8('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1cb8('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1cb8('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1cb8('0x4')]},'queue_quantity1':{'type':Sequelize[_0x1cb8('0x4')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x1cb8('0x4')]},'queue_less_than':{'type':Sequelize[_0x1cb8('0x4')]},'periodic_announce':{'type':Sequelize[_0x1cb8('0x19')],'set':function(_0x5bf630){this[_0x1cb8('0x1a')](_0x1cb8('0x1b'),_0x5bf630?_0x5bf630[_0x1cb8('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0x1cb8('0x1b'))?this[_0x1cb8('0xe')](_0x1cb8('0x1b'))[_0x1cb8('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':'yes','set':function(_0x2607f0){this[_0x1cb8('0x1a')](_0x1cb8('0x1e'),_0x2607f0?_0x2607f0[_0x1cb8('0x1c')](','):undefined);},'get':function(){return this[_0x1cb8('0xe')](_0x1cb8('0x1e'))?this[_0x1cb8('0xe')](_0x1cb8('0x1e'))[_0x1cb8('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5cd6bd){this[_0x1cb8('0x1a')](_0x1cb8('0x1f'),_0x5cd6bd?_0x5cd6bd[_0x1cb8('0x1c')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x1cb8('0xe')](_0x1cb8('0x1f'))[_0x1cb8('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1cb8('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x1cb8('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1cb8('0x4')]},'description':{'type':Sequelize[_0x1cb8('0x4')]},'acw':{'type':Sequelize[_0x1cb8('0x20')],'defaultValue':0x0,'set':function(_0x1bf06d){this[_0x1cb8('0x1a')](_0x1cb8('0x21'),_0x1bf06d);if(_0x1bf06d){if(this[_0x1cb8('0xe')](_0x1cb8('0x22'))<0x2){this['setDataValue'](_0x1cb8('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1cb8('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1cb8('0x23')},'dialMethod':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x24'),_0x1cb8('0x13'),_0x1cb8('0x15'),'predictive',_0x1cb8('0x11')),'defaultValue':_0x1cb8('0x13'),'comment':_0x1cb8('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x1cb8('0x16')](0x4)[_0x1cb8('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1cb8('0x27')},'dialPowerLevel':{'type':Sequelize[_0x1cb8('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x29'),_0x1cb8('0x2a')),'defaultValue':_0x1cb8('0x2a'),'comment':_0x1cb8('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1cb8('0x28')](0x2)[_0x1cb8('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1cb8('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x1cb8('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1cb8('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1cb8('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1cb8('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1cb8('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':_0x1cb8('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cb8('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cb8('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1cb8('0x16')](0x5)[_0x1cb8('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cb8('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cb8('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1cb8('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cb8('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1cb8('0x16')](0x5)[_0x1cb8('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cb8('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':_0x1cb8('0x35')},'dialPrefix':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1cb8('0x6')]('always',_0x1cb8('0x36'),_0x1cb8('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1cb8('0x20')],'defaultValue':0x0,'comment':_0x1cb8('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x1cb8('0x16')](0x9)[_0x1cb8('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1cb8('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x1cb8('0x16')](0x9)[_0x1cb8('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1cb8('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1cb8('0x16')](0x9)[_0x1cb8('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1cb8('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1cb8('0x16')](0x9)[_0x1cb8('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1cb8('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1cb8('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1cb8('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1cb8('0x16')](0x9)[_0x1cb8('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1cb8('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1cb8('0x16')](0x9)[_0x1cb8('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1cb8('0x16')](0x5)[_0x1cb8('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1cb8('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1cb8('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x1cb8('0x16')](0x5)[_0x1cb8('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1cb8('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x1cb8('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x1cb8('0x6')](_0x1cb8('0x42'),_0x1cb8('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1cb8('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1cb8('0x44')},'dialCutDigit':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cb8('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1cb8('0x16')](0x5)[_0x1cb8('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cb8('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cb8('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x1cb8('0x16')](0x5)[_0x1cb8('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cb8('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cb8('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1cb8('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1cb8('0x16')](0x5)[_0x1cb8('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cb8('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1cb8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1cb8('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1cb8('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x1cb8('0x4d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1cb8('0x4e'),'set':function(_0x3c4718){if(!_0x3c4718)this['setDataValue'](_0x1cb8('0x4f'),null);this[_0x1cb8('0x1a')](_0x1cb8('0x50'),_0x3c4718);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1cb8('0x16')](0x3)[_0x1cb8('0x26')],'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 48b02c2..32d0fcf 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 _0x87be=['ContactId','ListId','createdAt','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','insert','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','VoiceQueues','outbound','map','includes','type','value','end','error','stack','send','VoiceQueue','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','updatedAt','update','CmHopper','sort','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','penalty','Agents','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','union','transaction','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','isEmpty','all','removeAgents','isArray','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt'];(function(_0x21ae6f,_0x3bc3d2){var _0x37201a=function(_0x40f178){while(--_0x40f178){_0x21ae6f['push'](_0x21ae6f['shift']());}};_0x37201a(++_0x3bc3d2);}(_0x87be,0xc4));var _0xe87b=function(_0x5efe13,_0x2615c6){_0x5efe13=_0x5efe13-0x0;var _0x19d50c=_0x87be[_0x5efe13];return _0x19d50c;};'use strict';var emlformat=require(_0xe87b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe87b('0x1'));var jsonpatch=require(_0xe87b('0x2'));var rp=require(_0xe87b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe87b('0x4'));var util=require('util');var path=require(_0xe87b('0x5'));var sox=require(_0xe87b('0x6'));var csv=require(_0xe87b('0x7'));var ejs=require(_0xe87b('0x8'));var fs=require('fs');var fs_extra=require(_0xe87b('0x9'));var _=require(_0xe87b('0xa'));var squel=require(_0xe87b('0xb'));var crypto=require('crypto');var jsforce=require(_0xe87b('0xc'));var deskjs=require(_0xe87b('0xd'));var toCsv=require(_0xe87b('0x7'));var querystring=require('querystring');var Papa=require(_0xe87b('0xe'));var Redis=require('ioredis');var authService=require(_0xe87b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe87b('0x10'));var hardwareService=require(_0xe87b('0x11'));var logger=require(_0xe87b('0x12'))(_0xe87b('0x13'));var utils=require('../../config/utils');var config=require(_0xe87b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe87b('0x15'))['db'];config[_0xe87b('0x16')]=_[_0xe87b('0x17')](config[_0xe87b('0x16')],{'host':_0xe87b('0x18'),'port':0x18eb});var socket=require(_0xe87b('0x19'))(new Redis(config[_0xe87b('0x16')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x16bf03,_0x3eef56){_0x3eef56=_0x3eef56||0xcc;return function(_0x3eabc4){if(_0x3eabc4){return _0x16bf03[_0xe87b('0x1a')](_0x3eef56);}return _0x16bf03[_0xe87b('0x1b')](_0x3eef56)['end']();};}function respondWithResult(_0x11cbb6,_0x311357){_0x311357=_0x311357||0xc8;return function(_0x30b757){if(_0x30b757){return _0x11cbb6[_0xe87b('0x1b')](_0x311357)[_0xe87b('0x1c')](_0x30b757);}};}function respondWithFilteredResult(_0x2a5d89,_0x179b74){return function(_0x365ddd){if(_0x365ddd){var _0x21241e=typeof _0x179b74['offset']===_0xe87b('0x1d')&&typeof _0x179b74[_0xe87b('0x1e')]===_0xe87b('0x1d');var _0x462947=_0x365ddd[_0xe87b('0x1f')];var _0x8e3586=_0x21241e?0x0:_0x179b74[_0xe87b('0x20')];var _0x4a27cd=_0x21241e?_0x365ddd[_0xe87b('0x1f')]:_0x179b74['offset']+_0x179b74[_0xe87b('0x1e')];var _0x2a0f;if(_0x4a27cd>=_0x462947){_0x4a27cd=_0x462947;_0x2a0f=0xc8;}else{_0x2a0f=0xce;}_0x2a5d89[_0xe87b('0x1b')](_0x2a0f);return _0x2a5d89[_0xe87b('0x21')](_0xe87b('0x22'),_0x8e3586+'-'+_0x4a27cd+'/'+_0x462947)['json'](_0x365ddd);}return null;};}function patchUpdates(_0xec9aa0){return function(_0x724295){try{jsonpatch[_0xe87b('0x23')](_0x724295,_0xec9aa0,!![]);}catch(_0x3c1435){return BPromise[_0xe87b('0x24')](_0x3c1435);}return _0x724295['save']();};}function saveUpdates(_0x4ecc22,_0x1d924c){return function(_0x36a8cd){if(_0x36a8cd){return _0x36a8cd['update'](_0x4ecc22)[_0xe87b('0x25')](function(_0x28c74d){return _0x28c74d;});}return null;};}function removeEntity(_0xad04f,_0x453eae){return function(_0x180cf8){if(_0x180cf8){return _0x180cf8[_0xe87b('0x26')]()[_0xe87b('0x25')](function(){var _0x51c518=_0x180cf8['get']({'plain':!![]});var _0x2ef070=[{'name':_0xe87b('0x27'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0xe87b('0x28'),'ignore':![]}];var _0x5d2896=_(_0x2ef070)['filter']('ignore')[_0xe87b('0x29')]('value')['value']();if(_[_0xe87b('0x2a')](_0x5d2896,_0x51c518[_0xe87b('0x2b')])){return;}var _0xc8ab9a=_['find'](_0x2ef070,[_0xe87b('0x2c'),_0x51c518[_0xe87b('0x2b')]])['name'];return db['UserProfileResource'][_0xe87b('0x26')]({'where':{'type':_0xc8ab9a,'resourceId':_0x51c518['id']}})[_0xe87b('0x25')](function(){return _0x180cf8;});})[_0xe87b('0x25')](function(){_0xad04f[_0xe87b('0x1b')](0xcc)[_0xe87b('0x2d')]();});}};}function handleEntityNotFound(_0x386731,_0xca6e41){return function(_0x3fb2a1){if(!_0x3fb2a1){_0x386731[_0xe87b('0x1a')](0x194);}return _0x3fb2a1;};}function handleError(_0x53e615,_0xb60acb){_0xb60acb=_0xb60acb||0x1f4;return function(_0x142995){logger[_0xe87b('0x2e')](_0x142995[_0xe87b('0x2f')]);if(_0x142995['name']){delete _0x142995['name'];}_0x53e615['status'](_0xb60acb)[_0xe87b('0x30')](_0x142995);};}exports['index']=function(_0x35c85b,_0x25978c){var _0x38dc90={},_0x9e0b58={},_0x36a51e={'count':0x0,'rows':[]};var _0x2dd703=_[_0xe87b('0x29')](db[_0xe87b('0x31')]['rawAttributes'],function(_0x34e9e7){return{'name':_0x34e9e7['fieldName'],'type':_0x34e9e7[_0xe87b('0x2b')][_0xe87b('0x32')]};});_0x9e0b58[_0xe87b('0x33')]=_[_0xe87b('0x29')](_0x2dd703,_0xe87b('0x34'));_0x9e0b58['query']=_['keys'](_0x35c85b[_0xe87b('0x35')]);_0x9e0b58['filters']=_[_0xe87b('0x36')](_0x9e0b58['model'],_0x9e0b58[_0xe87b('0x35')]);_0x38dc90['attributes']=_[_0xe87b('0x36')](_0x9e0b58[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x35c85b[_0xe87b('0x35')][_0xe87b('0x37')]));_0x38dc90[_0xe87b('0x38')]=_0x38dc90[_0xe87b('0x38')][_0xe87b('0x39')]?_0x38dc90[_0xe87b('0x38')]:_0x9e0b58[_0xe87b('0x33')];if(!_0x35c85b['query'][_0xe87b('0x3a')](_0xe87b('0x3b'))){_0x38dc90['limit']=qs[_0xe87b('0x1e')](_0x35c85b[_0xe87b('0x35')]['limit']);_0x38dc90[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x35c85b[_0xe87b('0x35')][_0xe87b('0x20')]);}_0x38dc90[_0xe87b('0x3c')]=qs['sort'](_0x35c85b[_0xe87b('0x35')]['sort']);_0x38dc90[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x35c85b[_0xe87b('0x35')],_0x9e0b58[_0xe87b('0x3e')]),_0x2dd703);if(_0x35c85b[_0xe87b('0x35')]['filter']){_0x38dc90['where']=_[_0xe87b('0x40')](_0x38dc90[_0xe87b('0x3d')],{'$or':_[_0xe87b('0x29')](_0x2dd703,function(_0x55ea7f){if(_0x55ea7f[_0xe87b('0x2b')]!==_0xe87b('0x41')){var _0x525db4={};_0x525db4[_0x55ea7f['name']]={'$like':'%'+_0x35c85b[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x525db4;}})});}_0x38dc90=_[_0xe87b('0x40')]({},_0x38dc90,_0x35c85b['options']);var _0x596097={'where':_0x38dc90[_0xe87b('0x3d')]};return db['VoiceQueue'][_0xe87b('0x1f')](_0x596097)[_0xe87b('0x25')](function(_0x33eb39){_0x36a51e[_0xe87b('0x1f')]=_0x33eb39;if(_0x35c85b['query'][_0xe87b('0x43')]){_0x38dc90[_0xe87b('0x44')]=[{'all':!![]}];}return db[_0xe87b('0x31')]['findAll'](_0x38dc90);})[_0xe87b('0x25')](function(_0x5d79a2){_0x36a51e[_0xe87b('0x45')]=_0x5d79a2;return _0x36a51e;})[_0xe87b('0x25')](respondWithFilteredResult(_0x25978c,_0x38dc90))[_0xe87b('0x46')](handleError(_0x25978c,null));};exports[_0xe87b('0x47')]=function(_0x1a90b1,_0x2e975a){var _0x2aea37={'raw':![],'where':{'id':_0x1a90b1[_0xe87b('0x48')]['id']}},_0x97161b={};_0x97161b[_0xe87b('0x33')]=_[_0xe87b('0x49')](db[_0xe87b('0x31')]['rawAttributes']);_0x97161b[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x1a90b1[_0xe87b('0x35')]);_0x97161b['filters']=_[_0xe87b('0x36')](_0x97161b['model'],_0x97161b[_0xe87b('0x35')]);_0x2aea37[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x97161b[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x1a90b1[_0xe87b('0x35')][_0xe87b('0x37')]));_0x2aea37[_0xe87b('0x38')]=_0x2aea37[_0xe87b('0x38')][_0xe87b('0x39')]?_0x2aea37['attributes']:_0x97161b[_0xe87b('0x33')];if(_0x1a90b1[_0xe87b('0x35')][_0xe87b('0x43')]){_0x2aea37[_0xe87b('0x44')]=[{'all':!![]}];}_0x2aea37=_[_0xe87b('0x40')]({},_0x2aea37,_0x1a90b1[_0xe87b('0x4a')]);return db[_0xe87b('0x31')][_0xe87b('0x4b')](_0x2aea37)['then'](handleEntityNotFound(_0x2e975a,null))[_0xe87b('0x25')](respondWithResult(_0x2e975a,null))[_0xe87b('0x46')](handleError(_0x2e975a,null));};exports[_0xe87b('0x4c')]=function(_0x104afb,_0x3a1415){return db[_0xe87b('0x31')][_0xe87b('0x4c')](_0x104afb[_0xe87b('0x4d')],{})[_0xe87b('0x25')](function(_0x528e72){var _0xf56ed4=_0x104afb[_0xe87b('0x4e')][_0xe87b('0x4f')]({'plain':!![]});if(!_0xf56ed4)throw new Error(_0xe87b('0x50'));if(_0xf56ed4[_0xe87b('0x51')]===_0xe87b('0x4e')){var _0x117e5b=_0x528e72[_0xe87b('0x4f')]({'plain':!![]});var _0x53078e=[{'name':_0xe87b('0x27'),'value':_0xe87b('0x52')},{'name':'QueueCampaigns','value':_0xe87b('0x28')}];var _0x1ab91f=_[_0xe87b('0x4b')](_0x53078e,[_0xe87b('0x2c'),_0x117e5b[_0xe87b('0x2b')]])['name'];return db[_0xe87b('0x53')][_0xe87b('0x4b')]({'where':{'name':_0x1ab91f,'userProfileId':_0xf56ed4[_0xe87b('0x54')]},'raw':!![]})[_0xe87b('0x25')](function(_0x584ec8){if(_0x584ec8&&_0x584ec8[_0xe87b('0x55')]===0x0){return db[_0xe87b('0x56')][_0xe87b('0x4c')]({'name':_0x117e5b[_0xe87b('0x34')],'resourceId':_0x117e5b['id'],'type':_0x584ec8[_0xe87b('0x34')],'sectionId':_0x584ec8['id']},{})[_0xe87b('0x25')](function(){return _0x528e72;});}else{return _0x528e72;}})['catch'](function(_0x229320){logger['error'](_0xe87b('0x57'),_0x229320);throw _0x229320;});}return _0x528e72;})[_0xe87b('0x25')](respondWithResult(_0x3a1415,0xc9))['catch'](handleError(_0x3a1415,null));};exports[_0xe87b('0x58')]=function(_0x1ff33e,_0x433ce1){var _0x1347f0={'where':{'id':_0x1ff33e['params']['id']}},_0x5f59de={};_0x5f59de[_0xe87b('0x33')]=_[_0xe87b('0x49')](db[_0xe87b('0x31')][_0xe87b('0x59')]);_0x1347f0['attributes']=_[_0xe87b('0x36')](_0x5f59de[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x1ff33e[_0xe87b('0x35')]['fields']));_0x1347f0[_0xe87b('0x38')]=_0x1347f0[_0xe87b('0x38')][_0xe87b('0x39')]?_0x1347f0[_0xe87b('0x38')]:_0x5f59de['model'];if(_0x1ff33e['query']['includeAll']){_0x1347f0[_0xe87b('0x44')]=[{'all':!![]}];}_0x1347f0=_['merge']({},_0x1347f0,_0x1ff33e['options']);return db[_0xe87b('0x31')]['find'](_0x1347f0)[_0xe87b('0x25')](handleEntityNotFound(_0x433ce1,null))[_0xe87b('0x25')](function(_0x15ecfd){if(_0x15ecfd){var _0x15b80f=_0x15ecfd[_0xe87b('0x4f')]({'plain':!![]});_0x15b80f=qs[_0xe87b('0x5a')](_0x15b80f,['id','createdAt',_0xe87b('0x5b')]);_0x1ff33e[_0xe87b('0x4d')]=_['omit'](_0x1ff33e[_0xe87b('0x4d')],['id','createdAt',_0xe87b('0x5b')]);return db[_0xe87b('0x31')]['create'](_[_0xe87b('0x40')](_0x15b80f,_0x1ff33e[_0xe87b('0x4d')]),{'include':_0x1ff33e[_0xe87b('0x35')][_0xe87b('0x43')]?[{'all':!![]}]:undefined})[_0xe87b('0x25')](function(_0x25c90b){var _0x50b52b=_0x1ff33e[_0xe87b('0x4e')][_0xe87b('0x4f')]({'plain':!![]});if(!_0x50b52b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50b52b[_0xe87b('0x51')]===_0xe87b('0x4e')){var _0x27172b=_0x25c90b[_0xe87b('0x4f')]({'plain':!![]});var _0x406590=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x5c3b22=_[_0xe87b('0x4b')](_0x406590,['value',_0x27172b[_0xe87b('0x2b')]])['name'];return db[_0xe87b('0x53')][_0xe87b('0x4b')]({'where':{'name':_0x5c3b22,'userProfileId':_0x50b52b[_0xe87b('0x54')]},'raw':!![]})[_0xe87b('0x25')](function(_0x3d32a7){if(_0x3d32a7&&_0x3d32a7[_0xe87b('0x55')]===0x0){return db[_0xe87b('0x56')][_0xe87b('0x4c')]({'name':_0x27172b['name'],'resourceId':_0x27172b['id'],'type':_0x3d32a7[_0xe87b('0x34')],'sectionId':_0x3d32a7['id']},{})['then'](function(){return _0x25c90b;});}else{return _0x25c90b;}})['catch'](function(_0x565538){logger[_0xe87b('0x2e')](_0xe87b('0x57'),_0x565538);throw _0x565538;});}return _0x25c90b;});}})[_0xe87b('0x25')](respondWithResult(_0x433ce1,0xc9))['catch'](handleError(_0x433ce1,null));};exports[_0xe87b('0x5c')]=function(_0x24e7e8,_0xcb6e33){if(_0x24e7e8['body']['id']){delete _0x24e7e8[_0xe87b('0x4d')]['id'];}return db[_0xe87b('0x31')][_0xe87b('0x4b')]({'where':{'id':_0x24e7e8[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0xcb6e33,null))[_0xe87b('0x25')](saveUpdates(_0x24e7e8[_0xe87b('0x4d')],null))[_0xe87b('0x25')](respondWithResult(_0xcb6e33,null))['catch'](handleError(_0xcb6e33,null));};exports[_0xe87b('0x26')]=function(_0x19b788,_0x10a9b5){return db[_0xe87b('0x31')]['find']({'where':{'id':_0x19b788[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x10a9b5,null))['then'](removeEntity(_0x10a9b5,null))[_0xe87b('0x46')](handleError(_0x10a9b5,null));};exports['getHoppers']=function(_0x133fcf,_0x309b8f,_0xa02f05){var _0x2153e8={'raw':![],'where':{}};var _0x2ba9e8={};var _0x1af07d={'count':0x0,'rows':[]};return db[_0xe87b('0x31')]['findOne']({'where':{'id':_0x133fcf['params']['id']}})['then'](handleEntityNotFound(_0x309b8f,null))[_0xe87b('0x25')](function(_0x1114ab){if(_0x1114ab){_0x2ba9e8['model']=_[_0xe87b('0x49')](db[_0xe87b('0x5d')][_0xe87b('0x59')]);_0x2ba9e8[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x133fcf['query']);_0x2ba9e8[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x2ba9e8[_0xe87b('0x33')],_0x2ba9e8['query']);_0x2153e8[_0xe87b('0x38')]=_['intersection'](_0x2ba9e8[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x133fcf['query'][_0xe87b('0x37')]));_0x2153e8[_0xe87b('0x38')]=_0x2153e8['attributes']['length']?_0x2153e8[_0xe87b('0x38')]:_0x2ba9e8[_0xe87b('0x33')];if(!_0x133fcf[_0xe87b('0x35')][_0xe87b('0x3a')]('nolimit')){_0x2153e8[_0xe87b('0x1e')]=qs['limit'](_0x133fcf[_0xe87b('0x35')][_0xe87b('0x1e')]);_0x2153e8[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x133fcf[_0xe87b('0x35')][_0xe87b('0x20')]);}_0x2153e8[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x133fcf[_0xe87b('0x35')]['sort']);_0x2153e8[_0xe87b('0x3d')]=qs['filters'](_[_0xe87b('0x3f')](_0x133fcf[_0xe87b('0x35')],_0x2ba9e8[_0xe87b('0x3e')]));_0x2153e8['where'][_0xe87b('0x5f')]=_0x1114ab['id'];if(_0x133fcf[_0xe87b('0x35')]['filter']){_0x2153e8[_0xe87b('0x3d')]=_['merge'](_0x2153e8['where'],{'$or':_[_0xe87b('0x29')](_0x2153e8[_0xe87b('0x38')],function(_0x21bbff){var _0x47ff8e={};_0x47ff8e[_0x21bbff]={'$like':'%'+_0x133fcf[_0xe87b('0x35')]['filter']+'%'};return _0x47ff8e;})});}_0x2153e8=_[_0xe87b('0x40')]({},_0x2153e8,_0x133fcf['options']);return db[_0xe87b('0x5d')][_0xe87b('0x1f')]({'where':_0x2153e8[_0xe87b('0x3d')]})[_0xe87b('0x25')](function(_0x254088){_0x1af07d[_0xe87b('0x1f')]=_0x254088;if(_0x133fcf[_0xe87b('0x35')]['includeAll']){_0x2153e8[_0xe87b('0x44')]=[{'all':!![]}];}return db[_0xe87b('0x5d')][_0xe87b('0x60')](_0x2153e8);})[_0xe87b('0x25')](function(_0xb0d15b){_0x1af07d['rows']=_0xb0d15b;return _0x1af07d;});}})[_0xe87b('0x25')](respondWithFilteredResult(_0x309b8f,_0x2153e8))[_0xe87b('0x46')](handleError(_0x309b8f,null));};exports[_0xe87b('0x61')]=function(_0x53d646,_0x578809,_0x1db190){var _0x58adc5={'raw':!![],'where':{}};var _0x59b41c={};var _0x3446a6={'count':0x0,'rows':[]};return db[_0xe87b('0x31')][_0xe87b('0x62')]({'where':{'id':_0x53d646[_0xe87b('0x48')]['id']}})['then'](handleEntityNotFound(_0x578809,null))[_0xe87b('0x25')](function(_0x343376){if(_0x343376){_0x59b41c[_0xe87b('0x33')]=_[_0xe87b('0x49')](db['CmHopperHistory'][_0xe87b('0x59')]);_0x59b41c[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x53d646['query']);_0x59b41c['filters']=_[_0xe87b('0x36')](_0x59b41c[_0xe87b('0x33')],_0x59b41c['query']);_0x58adc5[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x59b41c[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x53d646[_0xe87b('0x35')]['fields']));_0x58adc5['attributes']=_0x58adc5[_0xe87b('0x38')][_0xe87b('0x39')]?_0x58adc5['attributes']:_0x59b41c['model'];if(!_0x53d646[_0xe87b('0x35')]['hasOwnProperty'](_0xe87b('0x3b'))){_0x58adc5['limit']=qs[_0xe87b('0x1e')](_0x53d646[_0xe87b('0x35')][_0xe87b('0x1e')]);_0x58adc5[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x53d646[_0xe87b('0x35')]['offset']);}_0x58adc5[_0xe87b('0x3c')]=qs['sort'](_0x53d646['query'][_0xe87b('0x5e')]);_0x58adc5[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x53d646[_0xe87b('0x35')],_0x59b41c[_0xe87b('0x3e')]));_0x58adc5[_0xe87b('0x3d')][_0xe87b('0x5f')]=_0x343376['id'];if(_0x53d646['query']['filter']){_0x58adc5[_0xe87b('0x3d')]=_['merge'](_0x58adc5[_0xe87b('0x3d')],{'$or':_[_0xe87b('0x29')](_0x58adc5['attributes'],function(_0x3473f2){var _0x395bdc={};_0x395bdc[_0x3473f2]={'$like':'%'+_0x53d646[_0xe87b('0x35')]['filter']+'%'};return _0x395bdc;})});}_0x58adc5=_[_0xe87b('0x40')]({},_0x58adc5,_0x53d646[_0xe87b('0x4a')]);return db[_0xe87b('0x63')][_0xe87b('0x1f')]({'where':_0x58adc5[_0xe87b('0x3d')]})[_0xe87b('0x25')](function(_0x6d5b60){_0x3446a6[_0xe87b('0x1f')]=_0x6d5b60;if(_0x53d646[_0xe87b('0x35')][_0xe87b('0x43')]){_0x58adc5[_0xe87b('0x44')]=[{'all':!![]}];}return db[_0xe87b('0x63')][_0xe87b('0x60')](_0x58adc5);})[_0xe87b('0x25')](function(_0x3d96be){_0x3446a6[_0xe87b('0x45')]=_0x3d96be;return _0x3446a6;});}})[_0xe87b('0x25')](respondWithFilteredResult(_0x578809,_0x58adc5))[_0xe87b('0x46')](handleError(_0x578809,null));};exports[_0xe87b('0x64')]=function(_0x1a0c61,_0x3d011d,_0x3c5642){var _0x36dbcc={'raw':!![],'where':{}};var _0x15c03e={};var _0x172edf={'count':0x0,'rows':[]};return db[_0xe87b('0x31')]['findOne']({'where':{'id':_0x1a0c61[_0xe87b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d011d,null))['then'](function(_0x5922e5){if(_0x5922e5){_0x15c03e[_0xe87b('0x33')]=_[_0xe87b('0x49')](db['CmHopperFinal']['rawAttributes']);_0x15c03e[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x1a0c61[_0xe87b('0x35')]);_0x15c03e[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x15c03e[_0xe87b('0x33')],_0x15c03e['query']);_0x36dbcc[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x15c03e[_0xe87b('0x33')],qs['fields'](_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x37')]));_0x36dbcc[_0xe87b('0x38')]=_0x36dbcc[_0xe87b('0x38')][_0xe87b('0x39')]?_0x36dbcc[_0xe87b('0x38')]:_0x15c03e[_0xe87b('0x33')];if(!_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x3a')](_0xe87b('0x3b'))){_0x36dbcc[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x1a0c61[_0xe87b('0x35')]['limit']);_0x36dbcc['offset']=qs[_0xe87b('0x20')](_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x20')]);}_0x36dbcc[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x5e')]);_0x36dbcc['where']=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x1a0c61[_0xe87b('0x35')],_0x15c03e[_0xe87b('0x3e')]));_0x36dbcc[_0xe87b('0x3d')][_0xe87b('0x5f')]=_0x5922e5['id'];if(_0x1a0c61['query'][_0xe87b('0x42')]){_0x36dbcc[_0xe87b('0x3d')]=_['merge'](_0x36dbcc[_0xe87b('0x3d')],{'$or':_['map'](_0x36dbcc[_0xe87b('0x38')],function(_0x21e820){var _0x33abcf={};_0x33abcf[_0x21e820]={'$like':'%'+_0x1a0c61[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x33abcf;})});}_0x36dbcc=_[_0xe87b('0x40')]({},_0x36dbcc,_0x1a0c61['options']);return db['CmHopperFinal'][_0xe87b('0x1f')]({'where':_0x36dbcc[_0xe87b('0x3d')]})[_0xe87b('0x25')](function(_0x367426){_0x172edf[_0xe87b('0x1f')]=_0x367426;if(_0x1a0c61['query'][_0xe87b('0x43')]){_0x36dbcc[_0xe87b('0x44')]=[{'all':!![]}];}return db[_0xe87b('0x65')][_0xe87b('0x60')](_0x36dbcc);})[_0xe87b('0x25')](function(_0xaf7fcd){_0x172edf[_0xe87b('0x45')]=_0xaf7fcd;return _0x172edf;});}})['then'](respondWithFilteredResult(_0x3d011d,_0x36dbcc))[_0xe87b('0x46')](handleError(_0x3d011d,null));};exports[_0xe87b('0x66')]=function(_0x171009,_0x25c6ce,_0x3b423d){var _0x346df3={'raw':!![],'where':{}};var _0x36eec1={};var _0x586a1f={'count':0x0,'rows':[]};return db[_0xe87b('0x31')][_0xe87b('0x62')]({'where':{'id':_0x171009[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x25c6ce,null))[_0xe87b('0x25')](function(_0x3797f8){if(_0x3797f8){_0x36eec1[_0xe87b('0x33')]=_[_0xe87b('0x49')](db[_0xe87b('0x67')]['rawAttributes']);_0x36eec1[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x171009['query']);_0x36eec1[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x36eec1[_0xe87b('0x33')],_0x36eec1[_0xe87b('0x35')]);_0x346df3[_0xe87b('0x38')]=_['intersection'](_0x36eec1[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x171009[_0xe87b('0x35')][_0xe87b('0x37')]));_0x346df3[_0xe87b('0x38')]=_0x346df3[_0xe87b('0x38')][_0xe87b('0x39')]?_0x346df3[_0xe87b('0x38')]:_0x36eec1[_0xe87b('0x33')];if(!_0x171009[_0xe87b('0x35')]['hasOwnProperty'](_0xe87b('0x3b'))){_0x346df3['limit']=qs['limit'](_0x171009['query'][_0xe87b('0x1e')]);_0x346df3['offset']=qs[_0xe87b('0x20')](_0x171009[_0xe87b('0x35')][_0xe87b('0x20')]);}_0x346df3[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x171009[_0xe87b('0x35')]['sort']);_0x346df3['where']=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x171009[_0xe87b('0x35')],_0x36eec1[_0xe87b('0x3e')]));_0x346df3[_0xe87b('0x3d')][_0xe87b('0x5f')]=_0x3797f8['id'];if(_0x171009[_0xe87b('0x35')][_0xe87b('0x42')]){_0x346df3[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0x346df3[_0xe87b('0x3d')],{'$or':_['map'](_0x346df3[_0xe87b('0x38')],function(_0x2e4c48){var _0x2e9650={};_0x2e9650[_0x2e4c48]={'$like':'%'+_0x171009[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x2e9650;})});}_0x346df3=_[_0xe87b('0x40')]({},_0x346df3,_0x171009[_0xe87b('0x4a')]);return db['CmHopperBlack']['count']({'where':_0x346df3['where']})[_0xe87b('0x25')](function(_0x35333a){_0x586a1f[_0xe87b('0x1f')]=_0x35333a;if(_0x171009[_0xe87b('0x35')][_0xe87b('0x43')]){_0x346df3[_0xe87b('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xe87b('0x60')](_0x346df3);})[_0xe87b('0x25')](function(_0x1d7bef){_0x586a1f[_0xe87b('0x45')]=_0x1d7bef;return _0x586a1f;});}})[_0xe87b('0x25')](respondWithFilteredResult(_0x25c6ce,_0x346df3))['catch'](handleError(_0x25c6ce,null));};exports[_0xe87b('0x68')]=function(_0x312d84,_0xdf8cf0,_0xc1d2a6){var _0x4e4dcd={};var _0x353e7a={};var _0xee95d3;var _0x7225b0;return db['VoiceQueue']['findOne']({'where':{'id':_0x312d84['params']['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0xdf8cf0,null))['then'](function(_0x40e5bb){if(_0x40e5bb){_0xee95d3=_0x40e5bb;_0x353e7a['model']=_[_0xe87b('0x49')](db[_0xe87b('0x69')][_0xe87b('0x59')]);_0x353e7a[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x312d84[_0xe87b('0x35')]);_0x353e7a['filters']=_['intersection'](_0x353e7a[_0xe87b('0x33')],_0x353e7a[_0xe87b('0x35')]);_0x4e4dcd[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x353e7a[_0xe87b('0x33')],qs['fields'](_0x312d84[_0xe87b('0x35')][_0xe87b('0x37')]));_0x4e4dcd[_0xe87b('0x38')]=_0x4e4dcd[_0xe87b('0x38')][_0xe87b('0x39')]?_0x4e4dcd['attributes']:_0x353e7a['model'];_0x4e4dcd['order']=qs['sort'](_0x312d84[_0xe87b('0x35')][_0xe87b('0x5e')]);_0x4e4dcd[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x312d84[_0xe87b('0x35')],_0x353e7a[_0xe87b('0x3e')]));if(_0x312d84['query'][_0xe87b('0x42')]){_0x4e4dcd[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0x4e4dcd[_0xe87b('0x3d')],{'$or':_['map'](_0x4e4dcd[_0xe87b('0x38')],function(_0x1bb66d){var _0x372954={};_0x372954[_0x1bb66d]={'$like':'%'+_0x312d84['query'][_0xe87b('0x42')]+'%'};return _0x372954;})});}_0x4e4dcd=_[_0xe87b('0x40')]({},_0x4e4dcd,_0x312d84[_0xe87b('0x4a')]);return _0xee95d3['getTeams'](_0x4e4dcd);}})[_0xe87b('0x25')](function(_0x1c264c){if(_0x1c264c){_0x7225b0=_0x1c264c['length'];if(!_0x312d84[_0xe87b('0x35')][_0xe87b('0x3a')]('nolimit')){_0x4e4dcd[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x312d84[_0xe87b('0x35')][_0xe87b('0x1e')]);_0x4e4dcd[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x312d84['query'][_0xe87b('0x20')]);}return _0xee95d3[_0xe87b('0x68')](_0x4e4dcd);}})['then'](function(_0x5c8796){if(_0x5c8796){return _0x5c8796?{'count':_0x7225b0,'rows':_0x5c8796}:null;}})['then'](respondWithResult(_0xdf8cf0,null))[_0xe87b('0x46')](handleError(_0xdf8cf0,null));};exports[_0xe87b('0x6a')]=function(_0x3dd769,_0x4cbac1,_0x2ddbf4){var _0x22991a=_0x3dd769['body'][_0xe87b('0x6b')];var _0x1baf6a=_['map'](_0x22991a,'id');return db[_0xe87b('0x69')]['findAll']({'where':{'id':_0x1baf6a},'attributes':['id'],'include':[{'model':db[_0xe87b('0x6c')],'as':'Agents','attributes':['id',_0xe87b('0x34'),_0xe87b('0x6d'),_0xe87b('0x6e'),_0xe87b('0x6f')],'raw':!![]}]})[_0xe87b('0x25')](function(_0x3d2e37){if(_0x3d2e37){var _0x12ee77=_[_0xe87b('0x70')](_0x3d2e37,function(_0x1a6551){var _0x5a8233=_0x1a6551['get']({'plain':!![]});_0x5a8233['Agents']['forEach'](function(_0x2b1946){_0x2b1946['penalty']=_[_0xe87b('0x4b')](_0x22991a,{'id':_0x5a8233['id']})[_0xe87b('0x71')];});return _0x5a8233[_0xe87b('0x72')];});return db[_0xe87b('0x31')]['find']({'where':{'id':_0x3dd769[_0xe87b('0x48')]['id']}})['then'](function(_0x34c25f){return db[_0xe87b('0x73')]['transaction'](function(_0x20c04e){return _0x34c25f[_0xe87b('0x6a')](_0x1baf6a,{'transaction':_0x20c04e})['then'](function(){return BPromise[_0xe87b('0x74')](_0x22991a,function(_0x829d1f){return db[_0xe87b('0x75')][_0xe87b('0x76')]({'TeamId':_0x829d1f['id'],'VoiceQueueId':_0x3dd769[_0xe87b('0x48')]['id'],'penalty':_0x829d1f['penalty']},{'transaction':_0x20c04e});});})[_0xe87b('0x25')](function(){return BPromise['each'](_0x12ee77,function(_0x1eee15){return db['UserVoiceQueue'][_0xe87b('0x77')]({'where':{'UserId':_0x1eee15['id'],'VoiceQueueId':_0x3dd769[_0xe87b('0x48')]['id']},'defaults':{'penalty':_0x1eee15[_0xe87b('0x71')]},'transaction':_0x20c04e});});})[_0xe87b('0x25')](function(){return BPromise[_0xe87b('0x74')](_[_0xe87b('0x42')](_0x12ee77,{'online':!![]}),function(_0x585006){return db[_0xe87b('0x78')][_0xe87b('0x76')]({'membername':_0x585006['name'],'UserId':_0x585006['id'],'queue_name':_0x34c25f[_0xe87b('0x34')],'VoiceQueueId':_0x34c25f['id'],'interface':_[_0xe87b('0x79')](_0x585006['interface'])?util[_0xe87b('0x7a')](_0xe87b('0x7b'),_0x585006[_0xe87b('0x34')]):_0x585006[_0xe87b('0x6f')],'paused':_0x585006[_0xe87b('0x6e')]||![],'penalty':_0x585006['penalty']},{'transaction':_0x20c04e});});})[_0xe87b('0x25')](function(){_0x12ee77[_0xe87b('0x7c')](function(_0x64c108){socket[_0xe87b('0x7d')]('userVoiceQueue:save',{'UserId':_0x64c108['id'],'VoiceQueueId':_0x34c25f['id']});});});});});}})[_0xe87b('0x25')](respondWithStatusCode(_0x4cbac1,null))[_0xe87b('0x46')](handleError(_0x4cbac1,null));};exports['removeTeams']=function(_0x59f276,_0x1b938c,_0x5918b0){return db[_0xe87b('0x69')]['findAll']({'where':{'id':_0x59f276['query'][_0xe87b('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xe87b('0x6c')],'as':_0xe87b('0x72'),'attributes':['id'],'raw':!![]}]})[_0xe87b('0x25')](handleEntityNotFound(_0x1b938c,null))[_0xe87b('0x25')](function(_0x15c517){var _0x13590d=_[_0xe87b('0x29')](_0x15c517,'id');var _0x1b9162=[];var _0x2d309b=[];var _0x4ec8d7=squel[_0xe87b('0x7f')]();_0x4ec8d7[_0xe87b('0x80')](_0xe87b('0x81'))[_0xe87b('0x82')](_0xe87b('0x83'),'tq')[_0xe87b('0x84')](_0xe87b('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe87b('0x3d')](_0xe87b('0x86'),_0x59f276[_0xe87b('0x48')]['id']);for(var _0x53d8e3=0x0;_0x53d8e3<_0x15c517[_0xe87b('0x39')];_0x53d8e3+=0x1){let _0x2ec1b4=_0x15c517[_0x53d8e3];for(var _0x59f178=0x0;_0x59f178<_0x2ec1b4[_0xe87b('0x72')][_0xe87b('0x39')];_0x59f178+=0x1){let _0x377b02=_0x2ec1b4['Agents'][_0x59f178];var _0x1c8bfd=_0x4ec8d7[_0xe87b('0x58')]();_0x1c8bfd[_0xe87b('0x3d')](_0xe87b('0x87'),_0x377b02['id']);_0x2d309b[_0xe87b('0x88')](db[_0xe87b('0x73')][_0xe87b('0x35')](_0x1c8bfd[_0xe87b('0x89')](),{'type':db[_0xe87b('0x73')][_0xe87b('0x8a')][_0xe87b('0x8b')]})[_0xe87b('0x25')](function(_0x16a400){if(_0x16a400[_0xe87b('0x39')]===0x1){return _0x377b02['id'];}else{var _0x6e8c70=_[_0xe87b('0x8c')](_['map'](_0x16a400,'TeamId'),function(_0x15c7e9){return _[_0xe87b('0x2a')](_0x13590d,_0x15c7e9);});if(_0x6e8c70){return _0x377b02['id'];}}}));}}return BPromise['all'](_0x2d309b)[_0xe87b('0x25')](function(_0x3c6f9f){_0x1b9162=_(_0x1b9162)[_0xe87b('0x8d')](_0x3c6f9f)['compact']()['value']();return db[_0xe87b('0x31')][_0xe87b('0x4b')]({'where':{'id':_0x59f276[_0xe87b('0x48')]['id']}})['then'](function(_0x401965){return db[_0xe87b('0x73')][_0xe87b('0x8e')](function(_0x5e6abb){return _0x401965['removeTeams'](_0x59f276[_0xe87b('0x35')][_0xe87b('0x7e')],{'transaction':_0x5e6abb})['then'](function(){if(!_['isEmpty'](_0x1b9162)){return _0x401965['removeAgents'](_0x1b9162,{'transaction':_0x5e6abb})[_0xe87b('0x25')](function(){return db[_0xe87b('0x78')][_0xe87b('0x26')]({'where':{'VoiceQueueId':_0x59f276[_0xe87b('0x48')]['id'],'UserId':_0x1b9162},'transaction':_0x5e6abb});});}})[_0xe87b('0x25')](function(){_0x1b9162['forEach'](function(_0x458849){socket[_0xe87b('0x7d')](_0xe87b('0x8f'),{'UserId':_0x458849,'VoiceQueueId':_0x401965['id']});});});});});});})[_0xe87b('0x25')](respondWithStatusCode(_0x1b938c,null))[_0xe87b('0x46')](handleError(_0x1b938c,null));};exports[_0xe87b('0x90')]=function(_0x45d89f,_0xf6a248,_0x4c9c03){var _0x738651,_0x41b8c1;return db[_0xe87b('0x31')]['find']({'where':{'id':_0x45d89f['params']['id']}})['then'](handleEntityNotFound(_0xf6a248,null))[_0xe87b('0x25')](function(_0x5dc19f){if(_0x5dc19f){_0x41b8c1=_0x5dc19f;return _0x5dc19f[_0xe87b('0x90')](_0x45d89f[_0xe87b('0x4d')][_0xe87b('0x7e')],_[_0xe87b('0x5a')](_0x45d89f[_0xe87b('0x4d')],[_0xe87b('0x7e'),'id'])||{})[_0xe87b('0x91')](function(_0x1cd1fd){for(var _0xf9a597=0x0;_0xf9a597<_0x45d89f[_0xe87b('0x4d')][_0xe87b('0x7e')]['length'];_0xf9a597+=0x1){socket[_0xe87b('0x7d')](_0xe87b('0x92'),{'UserId':Number(_0x45d89f['body']['ids'][_0xf9a597]),'VoiceQueueId':Number(_0x45d89f['params']['id'])});}return _0x1cd1fd;});}})[_0xe87b('0x25')](function(_0x2aa6d5){_0x738651=_0x2aa6d5||[];if(_0x41b8c1){return db[_0xe87b('0x6c')][_0xe87b('0x60')]({'where':{'id':_0x45d89f['body'][_0xe87b('0x7e')]},'attributes':['id','name','online',_0xe87b('0x6e'),_0xe87b('0x6f')],'raw':!![]});}})[_0xe87b('0x25')](function(_0x16f97c){if(!_[_0xe87b('0x93')](_0x16f97c)){var _0x54a983=[];for(var _0x1918f4=0x0;_0x1918f4<_0x16f97c[_0xe87b('0x39')];_0x1918f4++){if(_0x16f97c[_0x1918f4]['online']){_0x54a983[_0xe87b('0x88')](db[_0xe87b('0x78')][_0xe87b('0x76')]({'membername':_0x16f97c[_0x1918f4]['name'],'UserId':_0x16f97c[_0x1918f4]['id'],'queue_name':_0x41b8c1[_0xe87b('0x34')],'VoiceQueueId':_0x41b8c1['id'],'interface':_[_0xe87b('0x79')](_0x16f97c[_0x1918f4][_0xe87b('0x6f')])?util[_0xe87b('0x7a')]('SIP/%s',_0x16f97c[_0x1918f4][_0xe87b('0x34')]):_0x16f97c[_0x1918f4][_0xe87b('0x6f')],'paused':_0x16f97c[_0x1918f4][_0xe87b('0x6e')]||![],'penalty':_0x45d89f[_0xe87b('0x4d')][_0xe87b('0x71')]||0x0}));}}return BPromise[_0xe87b('0x94')](_0x54a983);}})[_0xe87b('0x25')](function(){return _0x738651;})['then'](respondWithResult(_0xf6a248,null))[_0xe87b('0x46')](handleError(_0xf6a248,null));};exports['removeAgents']=function(_0x4a58f6,_0x31b94b,_0x421341){return db[_0xe87b('0x31')][_0xe87b('0x4b')]({'where':{'id':_0x4a58f6[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x31b94b,null))[_0xe87b('0x25')](function(_0x3f9162){if(_0x3f9162){return _0x3f9162[_0xe87b('0x95')](_0x4a58f6[_0xe87b('0x35')][_0xe87b('0x7e')])['then'](function(){if(_[_0xe87b('0x96')](_0x4a58f6[_0xe87b('0x35')]['ids'])){for(var _0xb75e76=0x0;_0xb75e76<_0x4a58f6[_0xe87b('0x35')][_0xe87b('0x7e')][_0xe87b('0x39')];_0xb75e76+=0x1){socket[_0xe87b('0x7d')](_0xe87b('0x8f'),{'UserId':Number(_0x4a58f6['query'][_0xe87b('0x7e')][_0xb75e76]),'VoiceQueueId':Number(_0x4a58f6[_0xe87b('0x48')]['id'])});}}else{socket[_0xe87b('0x7d')](_0xe87b('0x8f'),{'UserId':Number(_0x4a58f6['query']['ids']),'VoiceQueueId':Number(_0x4a58f6[_0xe87b('0x48')]['id'])});}});}})[_0xe87b('0x25')](function(_0x57deab){return db[_0xe87b('0x78')][_0xe87b('0x26')]({'where':{'VoiceQueueId':_0x4a58f6['params']['id'],'UserId':_0x4a58f6[_0xe87b('0x35')][_0xe87b('0x7e')]}})['then'](function(){return _0x57deab;});})['then'](respondWithStatusCode(_0x31b94b,null))['catch'](handleError(_0x31b94b,null));};exports[_0xe87b('0x97')]=function(_0x5ab2a0,_0x3d0818,_0x33dbb0){var _0x53d6a2={};var _0x5ce52d={};var _0x59696b;var _0x5b24f0;return db[_0xe87b('0x31')]['findOne']({'where':{'id':_0x5ab2a0[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x3d0818,null))[_0xe87b('0x25')](function(_0x1acadd){if(_0x1acadd){_0x59696b=_0x1acadd;_0x5ce52d['model']=_[_0xe87b('0x49')](db[_0xe87b('0x6c')][_0xe87b('0x59')]);_0x5ce52d['query']=_['keys'](_0x5ab2a0[_0xe87b('0x35')]);_0x5ce52d[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x5ce52d[_0xe87b('0x33')],_0x5ce52d['query']);_0x53d6a2[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x5ce52d[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x5ab2a0[_0xe87b('0x35')][_0xe87b('0x37')]));_0x53d6a2['attributes']=_0x53d6a2['attributes'][_0xe87b('0x39')]?_0x53d6a2['attributes']:_0x5ce52d[_0xe87b('0x33')];_0x53d6a2[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x5ab2a0[_0xe87b('0x35')]['sort']);_0x53d6a2[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x5ab2a0[_0xe87b('0x35')],_0x5ce52d[_0xe87b('0x3e')]));if(_0x5ab2a0[_0xe87b('0x35')][_0xe87b('0x42')]){_0x53d6a2[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0x53d6a2['where'],{'$or':_[_0xe87b('0x29')](_0x53d6a2[_0xe87b('0x38')],function(_0x3b489d){var _0x3fd552={};_0x3fd552[_0x3b489d]={'$like':'%'+_0x5ab2a0[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x3fd552;})});}_0x53d6a2=_[_0xe87b('0x40')]({},_0x53d6a2,_0x5ab2a0[_0xe87b('0x4a')]);return _0x59696b[_0xe87b('0x97')](_0x53d6a2);}})[_0xe87b('0x25')](function(_0x52f9a6){if(_0x52f9a6){_0x5b24f0=_0x52f9a6[_0xe87b('0x39')];if(!_0x5ab2a0['query'][_0xe87b('0x3a')](_0xe87b('0x3b'))){_0x53d6a2[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x5ab2a0[_0xe87b('0x35')]['limit']);_0x53d6a2[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x5ab2a0[_0xe87b('0x35')][_0xe87b('0x20')]);}return _0x59696b[_0xe87b('0x97')](_0x53d6a2);}})['then'](function(_0x5e28dd){if(_0x5e28dd){return _0x5e28dd?{'count':_0x5b24f0,'rows':_0x5e28dd}:null;}})[_0xe87b('0x25')](respondWithResult(_0x3d0818,null))[_0xe87b('0x46')](handleError(_0x3d0818,null));};exports['getMembers']=function(_0x32e901,_0x3d6ba4,_0x10a142){var _0x17f78b={};var _0x2d007c={};var _0x4efbf8;var _0x5809a6;return db[_0xe87b('0x31')][_0xe87b('0x62')]({'where':{'id':_0x32e901[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x3d6ba4,null))[_0xe87b('0x25')](function(_0x237696){if(_0x237696){_0x4efbf8=_0x237696;_0x2d007c['model']=_[_0xe87b('0x49')](db[_0xe87b('0x78')][_0xe87b('0x59')]);_0x2d007c[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x32e901[_0xe87b('0x35')]);_0x2d007c[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x2d007c[_0xe87b('0x33')],_0x2d007c['query']);_0x17f78b[_0xe87b('0x38')]=_['intersection'](_0x2d007c[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x32e901[_0xe87b('0x35')][_0xe87b('0x37')]));_0x17f78b[_0xe87b('0x38')]=_0x17f78b['attributes'][_0xe87b('0x39')]?_0x17f78b['attributes']:_0x2d007c[_0xe87b('0x33')];_0x17f78b[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x32e901[_0xe87b('0x35')][_0xe87b('0x5e')]);_0x17f78b[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_[_0xe87b('0x3f')](_0x32e901[_0xe87b('0x35')],_0x2d007c[_0xe87b('0x3e')]));if(_0x32e901['query'][_0xe87b('0x42')]){_0x17f78b['where']=_['merge'](_0x17f78b[_0xe87b('0x3d')],{'$or':_['map'](_0x17f78b[_0xe87b('0x38')],function(_0x2f0a9b){var _0x1d1e21={};_0x1d1e21[_0x2f0a9b]={'$like':'%'+_0x32e901[_0xe87b('0x35')]['filter']+'%'};return _0x1d1e21;})});}_0x17f78b=_['merge']({},_0x17f78b,_0x32e901[_0xe87b('0x4a')]);return _0x4efbf8[_0xe87b('0x98')](_0x17f78b);}})[_0xe87b('0x25')](function(_0x116eb9){if(_0x116eb9){_0x5809a6=_0x116eb9[_0xe87b('0x39')];if(!_0x32e901[_0xe87b('0x35')][_0xe87b('0x3a')]('nolimit')){_0x17f78b[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x32e901[_0xe87b('0x35')][_0xe87b('0x1e')]);_0x17f78b[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x32e901[_0xe87b('0x35')][_0xe87b('0x20')]);}return _0x4efbf8[_0xe87b('0x98')](_0x17f78b);}})['then'](function(_0x448434){return _0x448434?{'count':_0x5809a6,'rows':_0x448434}:null;})[_0xe87b('0x25')](respondWithResult(_0x3d6ba4,null))[_0xe87b('0x46')](handleError(_0x3d6ba4,null));};exports[_0xe87b('0x99')]=function(_0x4d5f9b,_0x51a568,_0x120394){var _0x502a96={};var _0x162f6d={};var _0xd2e665;var _0x299be3;return db['VoiceQueue'][_0xe87b('0x62')]({'where':{'id':_0x4d5f9b[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x51a568,null))['then'](function(_0x5a246d){if(_0x5a246d){_0xd2e665=_0x5a246d;_0x162f6d['model']=_[_0xe87b('0x49')](db[_0xe87b('0x9a')][_0xe87b('0x59')]);_0x162f6d[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x4d5f9b[_0xe87b('0x35')]);_0x162f6d[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x162f6d[_0xe87b('0x33')],_0x162f6d['query']);_0x502a96[_0xe87b('0x38')]=_['intersection'](_0x162f6d[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x4d5f9b[_0xe87b('0x35')]['fields']));_0x502a96[_0xe87b('0x38')]=_0x502a96[_0xe87b('0x38')]['length']?_0x502a96['attributes']:_0x162f6d[_0xe87b('0x33')];_0x502a96[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x4d5f9b[_0xe87b('0x35')][_0xe87b('0x5e')]);_0x502a96[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_['pick'](_0x4d5f9b[_0xe87b('0x35')],_0x162f6d[_0xe87b('0x3e')]));if(_0x4d5f9b[_0xe87b('0x35')][_0xe87b('0x42')]){_0x502a96[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0x502a96[_0xe87b('0x3d')],{'$or':_['map'](_0x502a96[_0xe87b('0x38')],function(_0x451241){var _0x4675d4={};_0x4675d4[_0x451241]={'$like':'%'+_0x4d5f9b[_0xe87b('0x35')]['filter']+'%'};return _0x4675d4;})});}_0x502a96=_['merge']({},_0x502a96,_0x4d5f9b[_0xe87b('0x4a')]);return _0xd2e665[_0xe87b('0x99')](_0x502a96);}})[_0xe87b('0x25')](function(_0x3780c0){if(_0x3780c0){_0x299be3=_0x3780c0[_0xe87b('0x39')];if(!_0x4d5f9b[_0xe87b('0x35')][_0xe87b('0x3a')](_0xe87b('0x3b'))){_0x502a96[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x4d5f9b['query']['limit']);_0x502a96[_0xe87b('0x20')]=qs[_0xe87b('0x20')](_0x4d5f9b[_0xe87b('0x35')][_0xe87b('0x20')]);}return _0xd2e665[_0xe87b('0x99')](_0x502a96);}})['then'](function(_0x4dc97b){if(_0x4dc97b){return _0x4dc97b?{'count':_0x299be3,'rows':_0x4dc97b}:null;}})[_0xe87b('0x25')](respondWithResult(_0x51a568,null))['catch'](handleError(_0x51a568,null));};exports['addLists']=function(_0x31639b,_0x483365,_0x57cfe8){var _0x1848fd,_0x11ec75;return db['VoiceQueue'][_0xe87b('0x4b')]({'where':{'id':_0x31639b[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x483365,null))['then'](function(_0x5e1d98){if(_0x5e1d98){_0x11ec75=_0x5e1d98;return _0x5e1d98['addLists'](_0x31639b[_0xe87b('0x4d')][_0xe87b('0x7e')],_[_0xe87b('0x5a')](_0x31639b[_0xe87b('0x4d')],[_0xe87b('0x7e'),'id'])||{});}return null;})['spread'](function(_0x2b4108){var _0x3223c4;_0x1848fd=_0x2b4108||[];var _0x3bc51a=[];if(_0x2b4108){for(var _0x330dd6=0x0;_0x330dd6<_0x2b4108[_0xe87b('0x39')];_0x330dd6+=0x1){var _0x5e2a2e=_0x2b4108[_0x330dd6][_0xe87b('0x4f')]({'plain':!![]});_0x11ec75[_0xe87b('0x9b')]=_0x31639b['body'][_0xe87b('0x9b')]?_0x31639b[_0xe87b('0x4d')][_0xe87b('0x9b')]:_0x11ec75[_0xe87b('0x9b')];switch(_0x11ec75[_0xe87b('0x9b')]){case _0xe87b('0x9c'):_0x3223c4=squel['insert']()[_0xe87b('0x9d')](_0xe87b('0x9e'))[_0xe87b('0x9f')]([_0xe87b('0xa0'),_0xe87b('0xa1'),_0xe87b('0xa2'),_0xe87b('0xa3'),_0xe87b('0x5f'),_0xe87b('0xa4'),_0xe87b('0x5b')],squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xa0'),_0xe87b('0xa0'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0xa1'))[_0xe87b('0x80')]('id',_0xe87b('0xa2'))[_0xe87b('0x80')](_0x5e2a2e[_0xe87b('0xa6')][_0xe87b('0x89')](),'ListId')['field'](_0x31639b[_0xe87b('0x48')]['id'][_0xe87b('0x89')](),_0xe87b('0x5f'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0xa4'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0x5b'))[_0xe87b('0x82')](_0xe87b('0xa7'))['where'](_0xe87b('0xa8'))[_0xe87b('0x3d')](_0xe87b('0xa9'),_0x5e2a2e[_0xe87b('0xa6')][_0xe87b('0x89')]())[_0xe87b('0x3d')](_0xe87b('0xaa'))[_0xe87b('0x3d')](_0xe87b('0xab'),squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xac'))[_0xe87b('0x82')]('cm_hopper_final')[_0xe87b('0x3d')](_0xe87b('0x86'),_0x31639b['params']['id'][_0xe87b('0x89')]()))[_0xe87b('0x3d')](_0xe87b('0xab'),squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xad'))['from']('cm_hopper')[_0xe87b('0x3d')](_0xe87b('0x86'),_0x31639b[_0xe87b('0x48')]['id']['toString']())))[_0xe87b('0x89')]();break;case'onlyIfOpen':_0x3223c4=squel[_0xe87b('0xae')]()[_0xe87b('0x9d')](_0xe87b('0x9e'))[_0xe87b('0x9f')]([_0xe87b('0xa0'),'scheduledAt','ContactId',_0xe87b('0xa3'),_0xe87b('0x5f'),_0xe87b('0xa4'),'updatedAt'],squel[_0xe87b('0x7f')]()['field'](_0xe87b('0xa0'),_0xe87b('0xa0'))[_0xe87b('0x80')](_0xe87b('0xa5'),'scheduledAt')['field']('id','ContactId')[_0xe87b('0x80')](_0x5e2a2e[_0xe87b('0xa6')][_0xe87b('0x89')](),_0xe87b('0xa3'))[_0xe87b('0x80')](_0x31639b[_0xe87b('0x48')]['id'][_0xe87b('0x89')](),'VoiceQueueId')[_0xe87b('0x80')](_0xe87b('0xa5'),'createdAt')[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0x5b'))[_0xe87b('0x82')](_0xe87b('0xa7'))[_0xe87b('0x3d')](_0xe87b('0xa8'))[_0xe87b('0x3d')](_0xe87b('0xa9'),_0x5e2a2e['CmListId'][_0xe87b('0x89')]())[_0xe87b('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xe87b('0x3d')](_0xe87b('0xab'),squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xad'))[_0xe87b('0x82')](_0xe87b('0x9e'))['where'](_0xe87b('0x86'),_0x31639b['params']['id'][_0xe87b('0x89')]())))[_0xe87b('0x89')]();break;default:_0x3223c4=squel['insert']()[_0xe87b('0x9d')](_0xe87b('0x9e'))[_0xe87b('0x9f')]([_0xe87b('0xa0'),_0xe87b('0xa1'),'ContactId','ListId',_0xe87b('0x5f'),_0xe87b('0xa4'),_0xe87b('0x5b')],squel[_0xe87b('0x7f')]()[_0xe87b('0x80')](_0xe87b('0xa0'),_0xe87b('0xa0'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0xa1'))[_0xe87b('0x80')]('id',_0xe87b('0xa2'))[_0xe87b('0x80')](_0x5e2a2e[_0xe87b('0xa6')]['toString'](),_0xe87b('0xa3'))[_0xe87b('0x80')](_0x31639b[_0xe87b('0x48')]['id'][_0xe87b('0x89')](),_0xe87b('0x5f'))[_0xe87b('0x80')]('NOW()',_0xe87b('0xa4'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0x5b'))['from'](_0xe87b('0xa7'))[_0xe87b('0x3d')](_0xe87b('0xa8'))[_0xe87b('0x3d')](_0xe87b('0xa9'),_0x5e2a2e[_0xe87b('0xa6')][_0xe87b('0x89')]())[_0xe87b('0x3d')](_0xe87b('0xaa')))[_0xe87b('0x89')]();}_0x3bc51a[_0xe87b('0x88')](db['sequelize'][_0xe87b('0x35')](_0x3223c4));}return BPromise[_0xe87b('0x94')](_0x3bc51a);}})[_0xe87b('0x25')](function(){return _0x1848fd;})[_0xe87b('0x25')](respondWithResult(_0x483365,null))[_0xe87b('0x46')](handleError(_0x483365,null));};exports['removeLists']=function(_0x161793,_0x534b35,_0x320bca){return db[_0xe87b('0x31')]['find']({'where':{'id':_0x161793[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x534b35,null))['then'](function(_0x97af20){if(_0x97af20){return _0x97af20[_0xe87b('0xaf')](_0x161793['query'][_0xe87b('0x7e')]);}})[_0xe87b('0x25')](function(_0x335cbf){if(_0x335cbf){return db['CmHopper']['destroy']({'where':{'ListId':_0x161793[_0xe87b('0x35')][_0xe87b('0x7e')],'VoiceQueueId':_0x161793[_0xe87b('0x48')]['id']}})['then'](function(){return _0x335cbf;});}})[_0xe87b('0x25')](respondWithStatusCode(_0x534b35,null))[_0xe87b('0x46')](handleError(_0x534b35,null));};exports[_0xe87b('0xb0')]=function(_0x32350c,_0x382d20,_0x49877f){var _0xd989fb={};var _0x9ef26f={};var _0xd31fb5;var _0x3f4d85;return db[_0xe87b('0x31')]['findOne']({'where':{'id':_0x32350c[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x382d20,null))['then'](function(_0x588838){if(_0x588838){_0xd31fb5=_0x588838;_0x9ef26f[_0xe87b('0x33')]=_[_0xe87b('0x49')](db[_0xe87b('0x9a')][_0xe87b('0x59')]);_0x9ef26f[_0xe87b('0x35')]=_[_0xe87b('0x49')](_0x32350c[_0xe87b('0x35')]);_0x9ef26f[_0xe87b('0x3e')]=_[_0xe87b('0x36')](_0x9ef26f['model'],_0x9ef26f[_0xe87b('0x35')]);_0xd989fb[_0xe87b('0x38')]=_[_0xe87b('0x36')](_0x9ef26f[_0xe87b('0x33')],qs[_0xe87b('0x37')](_0x32350c['query'][_0xe87b('0x37')]));_0xd989fb['attributes']=_0xd989fb[_0xe87b('0x38')][_0xe87b('0x39')]?_0xd989fb[_0xe87b('0x38')]:_0x9ef26f[_0xe87b('0x33')];_0xd989fb[_0xe87b('0x3c')]=qs[_0xe87b('0x5e')](_0x32350c[_0xe87b('0x35')]['sort']);_0xd989fb[_0xe87b('0x3d')]=qs[_0xe87b('0x3e')](_['pick'](_0x32350c[_0xe87b('0x35')],_0x9ef26f['filters']));if(_0x32350c[_0xe87b('0x35')][_0xe87b('0x42')]){_0xd989fb[_0xe87b('0x3d')]=_[_0xe87b('0x40')](_0xd989fb[_0xe87b('0x3d')],{'$or':_[_0xe87b('0x29')](_0xd989fb[_0xe87b('0x38')],function(_0x3ed05f){var _0x467b9f={};_0x467b9f[_0x3ed05f]={'$like':'%'+_0x32350c[_0xe87b('0x35')][_0xe87b('0x42')]+'%'};return _0x467b9f;})});}_0xd989fb=_[_0xe87b('0x40')]({},_0xd989fb,_0x32350c[_0xe87b('0x4a')]);return _0xd31fb5[_0xe87b('0xb0')](_0xd989fb);}})[_0xe87b('0x25')](function(_0x3a802d){if(_0x3a802d){_0x3f4d85=_0x3a802d[_0xe87b('0x39')];if(!_0x32350c[_0xe87b('0x35')]['hasOwnProperty'](_0xe87b('0x3b'))){_0xd989fb[_0xe87b('0x1e')]=qs[_0xe87b('0x1e')](_0x32350c[_0xe87b('0x35')][_0xe87b('0x1e')]);_0xd989fb['offset']=qs[_0xe87b('0x20')](_0x32350c['query']['offset']);}return _0xd31fb5[_0xe87b('0xb0')](_0xd989fb);}})[_0xe87b('0x25')](function(_0x418ac3){if(_0x418ac3){return _0x418ac3?{'count':_0x3f4d85,'rows':_0x418ac3}:null;}})['then'](respondWithResult(_0x382d20,null))['catch'](handleError(_0x382d20,null));};exports[_0xe87b('0xb1')]=function(_0xe1ca51,_0x3efef8,_0x1e0e9a){var _0x177463,_0x3158ae;return db[_0xe87b('0x31')][_0xe87b('0x4b')]({'where':{'id':_0xe1ca51['params']['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x3efef8,null))['then'](function(_0x536e1f){if(_0x536e1f){_0x3158ae=_0x536e1f;return _0x536e1f[_0xe87b('0xb1')](_0xe1ca51[_0xe87b('0x4d')]['ids'],_[_0xe87b('0x5a')](_0xe1ca51['body'],['ids','id'])||{});}return null;})[_0xe87b('0x91')](function(_0x1712cf){var _0x3ae192;_0x177463=_0x1712cf||[];var _0x355232=[];if(_0x1712cf){for(var _0x101e41=0x0;_0x101e41<_0x1712cf[_0xe87b('0x39')];_0x101e41+=0x1){var _0x211c93=_0x1712cf[_0x101e41][_0xe87b('0x4f')]({'plain':!![]});_0x3ae192=squel['insert']()['into']('cm_hopper_black')[_0xe87b('0x9f')]([_0xe87b('0xa0'),'ContactId',_0xe87b('0xa3'),'VoiceQueueId','createdAt',_0xe87b('0x5b')],squel[_0xe87b('0x7f')]()[_0xe87b('0x80')]('phone',_0xe87b('0xa0'))['field']('id',_0xe87b('0xa2'))[_0xe87b('0x80')](_0x211c93[_0xe87b('0xa6')]['toString'](),_0xe87b('0xa3'))[_0xe87b('0x80')](_0xe1ca51[_0xe87b('0x48')]['id']['toString'](),_0xe87b('0x5f'))[_0xe87b('0x80')](_0xe87b('0xa5'),_0xe87b('0xa4'))['field'](_0xe87b('0xa5'),_0xe87b('0x5b'))[_0xe87b('0x82')](_0xe87b('0xa7'))[_0xe87b('0x3d')](_0xe87b('0xa8'))[_0xe87b('0x3d')](_0xe87b('0xa9'),_0x211c93[_0xe87b('0xa6')][_0xe87b('0x89')]())[_0xe87b('0x3d')](_0xe87b('0xaa')))[_0xe87b('0x89')]();_0x355232[_0xe87b('0x88')](db['sequelize'][_0xe87b('0x35')](_0x3ae192));}return BPromise[_0xe87b('0x94')](_0x355232);}})[_0xe87b('0x25')](function(){return _0x177463;})[_0xe87b('0x25')](respondWithResult(_0x3efef8,null))['catch'](handleError(_0x3efef8,null));};exports[_0xe87b('0xb2')]=function(_0x97efb5,_0x24137f,_0x2f7c3a){return db[_0xe87b('0x31')]['find']({'where':{'id':_0x97efb5[_0xe87b('0x48')]['id']}})[_0xe87b('0x25')](handleEntityNotFound(_0x24137f,null))[_0xe87b('0x25')](function(_0x1f2997){if(_0x1f2997){return _0x1f2997[_0xe87b('0xb2')](_0x97efb5[_0xe87b('0x35')][_0xe87b('0x7e')]);}})[_0xe87b('0x25')](function(_0x293f4d){if(_0x293f4d){return db[_0xe87b('0x67')][_0xe87b('0x26')]({'where':{'ListId':_0x97efb5[_0xe87b('0x35')][_0xe87b('0x7e')],'VoiceQueueId':_0x97efb5['params']['id']}})[_0xe87b('0x25')](function(){return _0x293f4d;});}})[_0xe87b('0x25')](respondWithStatusCode(_0x24137f,null))[_0xe87b('0x46')](handleError(_0x24137f,null));}; \ No newline at end of file +var _0x9c27=['count','set','Content-Range','json','reject','save','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','params','includeAll','createdAt','updatedAt','body','omit','userProfileId','getHoppers','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','isNil','SIP/%s','forEach','userVoiceQueue:save','ids','select','tq.TeamId','from','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','union','compact','removeTeams','removeAgents','emit','userVoiceQueue:remove','addAgents','UserVoiceQueueRt','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','cm_hopper','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','insert','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit'];(function(_0x4e4aec,_0x4b2972){var _0x5b49ff=function(_0x232a46){while(--_0x232a46){_0x4e4aec['push'](_0x4e4aec['shift']());}};_0x5b49ff(++_0x4b2972);}(_0x9c27,0x147));var _0x79c2=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x9c27[_0x267c52];return _0x46c47b;};'use strict';var emlformat=require(_0x79c2('0x0'));var rimraf=require(_0x79c2('0x1'));var zipdir=require(_0x79c2('0x2'));var jsonpatch=require(_0x79c2('0x3'));var rp=require(_0x79c2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x79c2('0x5'));var util=require('util');var path=require(_0x79c2('0x6'));var sox=require(_0x79c2('0x7'));var csv=require(_0x79c2('0x8'));var ejs=require(_0x79c2('0x9'));var fs=require('fs');var fs_extra=require(_0x79c2('0xa'));var _=require(_0x79c2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x79c2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x79c2('0xd'));var Redis=require('ioredis');var authService=require(_0x79c2('0xe'));var qs=require(_0x79c2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x79c2('0x10'));var licenseUtil=require(_0x79c2('0x11'));var db=require(_0x79c2('0x12'))['db'];config[_0x79c2('0x13')]=_['defaults'](config[_0x79c2('0x13')],{'host':_0x79c2('0x14'),'port':0x18eb});var socket=require(_0x79c2('0x15'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x79c2('0x16')](socket);function respondWithStatusCode(_0x58f34c,_0x334cf4){_0x334cf4=_0x334cf4||0xcc;return function(_0x4e65f1){if(_0x4e65f1){return _0x58f34c[_0x79c2('0x17')](_0x334cf4);}return _0x58f34c[_0x79c2('0x18')](_0x334cf4)[_0x79c2('0x19')]();};}function respondWithResult(_0xc7fe6b,_0x1724c5){_0x1724c5=_0x1724c5||0xc8;return function(_0xd3b594){if(_0xd3b594){return _0xc7fe6b['status'](_0x1724c5)['json'](_0xd3b594);}};}function respondWithFilteredResult(_0x3f1f73,_0x2b1d81){return function(_0x58e8da){if(_0x58e8da){var _0x510cb4=typeof _0x2b1d81[_0x79c2('0x1a')]===_0x79c2('0x1b')&&typeof _0x2b1d81[_0x79c2('0x1c')]==='undefined';var _0x510209=_0x58e8da[_0x79c2('0x1d')];var _0x778289=_0x510cb4?0x0:_0x2b1d81[_0x79c2('0x1a')];var _0x477f79=_0x510cb4?_0x58e8da['count']:_0x2b1d81[_0x79c2('0x1a')]+_0x2b1d81[_0x79c2('0x1c')];var _0xdf61a3;if(_0x477f79>=_0x510209){_0x477f79=_0x510209;_0xdf61a3=0xc8;}else{_0xdf61a3=0xce;}_0x3f1f73[_0x79c2('0x18')](_0xdf61a3);return _0x3f1f73[_0x79c2('0x1e')](_0x79c2('0x1f'),_0x778289+'-'+_0x477f79+'/'+_0x510209)[_0x79c2('0x20')](_0x58e8da);}return null;};}function patchUpdates(_0x56f144){return function(_0x21ec69){try{jsonpatch['apply'](_0x21ec69,_0x56f144,!![]);}catch(_0x534b93){return BPromise[_0x79c2('0x21')](_0x534b93);}return _0x21ec69[_0x79c2('0x22')]();};}function saveUpdates(_0x111ef7,_0x4d24f5){return function(_0x59eb8d){if(_0x59eb8d){return _0x59eb8d[_0x79c2('0x23')](_0x111ef7)[_0x79c2('0x24')](function(_0x4bca1c){return _0x4bca1c;});}return null;};}function removeEntity(_0x2722a6,_0x3cd268){return function(_0x5831e0){if(_0x5831e0){return _0x5831e0['destroy']()[_0x79c2('0x24')](function(){var _0x40ae69=_0x5831e0['get']({'plain':!![]});var _0x49d573=[{'name':_0x79c2('0x25'),'value':_0x79c2('0x26'),'ignore':![]},{'name':_0x79c2('0x27'),'value':_0x79c2('0x28'),'ignore':![]}];var _0x1731f7=_(_0x49d573)[_0x79c2('0x29')](_0x79c2('0x2a'))[_0x79c2('0x2b')](_0x79c2('0x2c'))[_0x79c2('0x2c')]();if(_[_0x79c2('0x2d')](_0x1731f7,_0x40ae69[_0x79c2('0x2e')])){return;}var _0x87e8c6=_[_0x79c2('0x2f')](_0x49d573,['value',_0x40ae69['type']])[_0x79c2('0x30')];return db[_0x79c2('0x31')][_0x79c2('0x32')]({'where':{'type':_0x87e8c6,'resourceId':_0x40ae69['id']}})['then'](function(){return _0x5831e0;});})['then'](function(){_0x2722a6[_0x79c2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4953c7,_0x11a536){return function(_0x1421aa){if(!_0x1421aa){_0x4953c7['sendStatus'](0x194);}return _0x1421aa;};}function handleError(_0x48e8e3,_0x38d2f7){_0x38d2f7=_0x38d2f7||0x1f4;return function(_0x5c1dfc){logger[_0x79c2('0x33')](_0x5c1dfc[_0x79c2('0x34')]);if(_0x5c1dfc[_0x79c2('0x30')]){delete _0x5c1dfc[_0x79c2('0x30')];}_0x48e8e3[_0x79c2('0x18')](_0x38d2f7)[_0x79c2('0x35')](_0x5c1dfc);};}exports[_0x79c2('0x36')]=function(_0x2cf569,_0x35df0d){var _0x346bb1={},_0x52f956={},_0x30a5a2={'count':0x0,'rows':[]};var _0x328243=_[_0x79c2('0x2b')](db[_0x79c2('0x37')][_0x79c2('0x38')],function(_0x527737){return{'name':_0x527737[_0x79c2('0x39')],'type':_0x527737[_0x79c2('0x2e')]['key']};});_0x52f956[_0x79c2('0x3a')]=_[_0x79c2('0x2b')](_0x328243,'name');_0x52f956[_0x79c2('0x3b')]=_[_0x79c2('0x3c')](_0x2cf569[_0x79c2('0x3b')]);_0x52f956[_0x79c2('0x3d')]=_[_0x79c2('0x3e')](_0x52f956[_0x79c2('0x3a')],_0x52f956[_0x79c2('0x3b')]);_0x346bb1[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x52f956['model'],qs[_0x79c2('0x40')](_0x2cf569[_0x79c2('0x3b')][_0x79c2('0x40')]));_0x346bb1['attributes']=_0x346bb1['attributes'][_0x79c2('0x41')]?_0x346bb1['attributes']:_0x52f956[_0x79c2('0x3a')];if(!_0x2cf569[_0x79c2('0x3b')][_0x79c2('0x42')]('nolimit')){_0x346bb1[_0x79c2('0x1c')]=qs[_0x79c2('0x1c')](_0x2cf569[_0x79c2('0x3b')][_0x79c2('0x1c')]);_0x346bb1[_0x79c2('0x1a')]=qs[_0x79c2('0x1a')](_0x2cf569[_0x79c2('0x3b')][_0x79c2('0x1a')]);}_0x346bb1[_0x79c2('0x43')]=qs[_0x79c2('0x44')](_0x2cf569[_0x79c2('0x3b')]['sort']);_0x346bb1[_0x79c2('0x45')]=qs[_0x79c2('0x3d')](_[_0x79c2('0x46')](_0x2cf569[_0x79c2('0x3b')],_0x52f956['filters']),_0x328243);if(_0x2cf569[_0x79c2('0x3b')][_0x79c2('0x29')]){_0x346bb1[_0x79c2('0x45')]=_[_0x79c2('0x47')](_0x346bb1[_0x79c2('0x45')],{'$or':_['map'](_0x328243,function(_0x52ad42){if(_0x52ad42[_0x79c2('0x2e')]!==_0x79c2('0x48')){var _0x5e4c0e={};_0x5e4c0e[_0x52ad42[_0x79c2('0x30')]]={'$like':'%'+_0x2cf569[_0x79c2('0x3b')][_0x79c2('0x29')]+'%'};return _0x5e4c0e;}})});}_0x346bb1=_[_0x79c2('0x47')]({},_0x346bb1,_0x2cf569[_0x79c2('0x49')]);var _0x3fa111={'where':_0x346bb1[_0x79c2('0x45')]};return db[_0x79c2('0x37')]['count'](_0x3fa111)[_0x79c2('0x24')](function(_0x144f1f){_0x30a5a2['count']=_0x144f1f;if(_0x2cf569[_0x79c2('0x3b')]['includeAll']){_0x346bb1[_0x79c2('0x4a')]=[{'all':!![]}];}return db[_0x79c2('0x37')][_0x79c2('0x4b')](_0x346bb1);})[_0x79c2('0x24')](function(_0x4caaf7){_0x30a5a2[_0x79c2('0x4c')]=_0x4caaf7;return _0x30a5a2;})[_0x79c2('0x24')](respondWithFilteredResult(_0x35df0d,_0x346bb1))['catch'](handleError(_0x35df0d,null));};exports[_0x79c2('0x4d')]=function(_0x1e7f57,_0x3a08ac){var _0x27def4={'raw':![],'where':{'id':_0x1e7f57['params']['id']}},_0x1961c1={};_0x1961c1[_0x79c2('0x3a')]=_[_0x79c2('0x3c')](db[_0x79c2('0x37')][_0x79c2('0x38')]);_0x1961c1['query']=_['keys'](_0x1e7f57[_0x79c2('0x3b')]);_0x1961c1[_0x79c2('0x3d')]=_[_0x79c2('0x3e')](_0x1961c1[_0x79c2('0x3a')],_0x1961c1[_0x79c2('0x3b')]);_0x27def4[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x1961c1[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x1e7f57[_0x79c2('0x3b')][_0x79c2('0x40')]));_0x27def4[_0x79c2('0x3f')]=_0x27def4[_0x79c2('0x3f')][_0x79c2('0x41')]?_0x27def4['attributes']:_0x1961c1[_0x79c2('0x3a')];if(_0x1e7f57[_0x79c2('0x3b')]['includeAll']){_0x27def4[_0x79c2('0x4a')]=[{'all':!![]}];}_0x27def4=_[_0x79c2('0x47')]({},_0x27def4,_0x1e7f57['options']);return db[_0x79c2('0x37')][_0x79c2('0x2f')](_0x27def4)[_0x79c2('0x24')](handleEntityNotFound(_0x3a08ac,null))[_0x79c2('0x24')](respondWithResult(_0x3a08ac,null))['catch'](handleError(_0x3a08ac,null));};exports[_0x79c2('0x4e')]=function(_0xb57b92,_0x2f7c4b){return db[_0x79c2('0x37')][_0x79c2('0x4e')](_0xb57b92['body'],{})[_0x79c2('0x24')](function(_0x5479c3){var _0xb7ab2a=_0xb57b92[_0x79c2('0x4f')]['get']({'plain':!![]});if(!_0xb7ab2a)throw new Error(_0x79c2('0x50'));if(_0xb7ab2a[_0x79c2('0x51')]===_0x79c2('0x4f')){var _0xd5e606=_0x5479c3[_0x79c2('0x52')]({'plain':!![]});var _0x588717=[{'name':_0x79c2('0x25'),'value':_0x79c2('0x26')},{'name':'QueueCampaigns','value':_0x79c2('0x28')}];var _0x5bb579=_[_0x79c2('0x2f')](_0x588717,[_0x79c2('0x2c'),_0xd5e606['type']])[_0x79c2('0x30')];return db[_0x79c2('0x53')][_0x79c2('0x2f')]({'where':{'name':_0x5bb579,'userProfileId':_0xb7ab2a['userProfileId']},'raw':!![]})[_0x79c2('0x24')](function(_0x3c257a){if(_0x3c257a&&_0x3c257a[_0x79c2('0x54')]===0x0){return db['UserProfileResource'][_0x79c2('0x4e')]({'name':_0xd5e606[_0x79c2('0x30')],'resourceId':_0xd5e606['id'],'type':_0x3c257a[_0x79c2('0x30')],'sectionId':_0x3c257a['id']},{})['then'](function(){return _0x5479c3;});}else{return _0x5479c3;}})['catch'](function(_0x355d7d){logger[_0x79c2('0x33')](_0x79c2('0x55'),_0x355d7d);throw _0x355d7d;});}return _0x5479c3;})['then'](respondWithResult(_0x2f7c4b,0xc9))[_0x79c2('0x56')](handleError(_0x2f7c4b,null));};exports[_0x79c2('0x57')]=function(_0x12c8ed,_0x4cc43a){var _0x1ae724={'where':{'id':_0x12c8ed[_0x79c2('0x58')]['id']}},_0x37603e={};_0x37603e['model']=_[_0x79c2('0x3c')](db[_0x79c2('0x37')]['rawAttributes']);_0x1ae724[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x37603e[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x12c8ed[_0x79c2('0x3b')][_0x79c2('0x40')]));_0x1ae724[_0x79c2('0x3f')]=_0x1ae724['attributes'][_0x79c2('0x41')]?_0x1ae724[_0x79c2('0x3f')]:_0x37603e[_0x79c2('0x3a')];if(_0x12c8ed[_0x79c2('0x3b')][_0x79c2('0x59')]){_0x1ae724[_0x79c2('0x4a')]=[{'all':!![]}];}_0x1ae724=_[_0x79c2('0x47')]({},_0x1ae724,_0x12c8ed[_0x79c2('0x49')]);return db[_0x79c2('0x37')]['find'](_0x1ae724)['then'](handleEntityNotFound(_0x4cc43a,null))[_0x79c2('0x24')](function(_0x404878){if(_0x404878){var _0x1280e2=_0x404878['get']({'plain':!![]});_0x1280e2=qs['omit'](_0x1280e2,['id',_0x79c2('0x5a'),_0x79c2('0x5b')]);_0x12c8ed[_0x79c2('0x5c')]=_[_0x79c2('0x5d')](_0x12c8ed[_0x79c2('0x5c')],['id',_0x79c2('0x5a'),_0x79c2('0x5b')]);return db[_0x79c2('0x37')]['create'](_[_0x79c2('0x47')](_0x1280e2,_0x12c8ed[_0x79c2('0x5c')]),{'include':_0x12c8ed[_0x79c2('0x3b')][_0x79c2('0x59')]?[{'all':!![]}]:undefined})[_0x79c2('0x24')](function(_0x43a4f1){var _0x27ccf0=_0x12c8ed[_0x79c2('0x4f')][_0x79c2('0x52')]({'plain':!![]});if(!_0x27ccf0)throw new Error(_0x79c2('0x50'));if(_0x27ccf0[_0x79c2('0x51')]==='user'){var _0x4d5a32=_0x43a4f1['get']({'plain':!![]});var _0x43f851=[{'name':'VoiceQueues','value':_0x79c2('0x26')},{'name':'QueueCampaigns','value':_0x79c2('0x28')}];var _0x1d394c=_[_0x79c2('0x2f')](_0x43f851,[_0x79c2('0x2c'),_0x4d5a32[_0x79c2('0x2e')]])[_0x79c2('0x30')];return db[_0x79c2('0x53')]['find']({'where':{'name':_0x1d394c,'userProfileId':_0x27ccf0[_0x79c2('0x5e')]},'raw':!![]})[_0x79c2('0x24')](function(_0x3f944f){if(_0x3f944f&&_0x3f944f[_0x79c2('0x54')]===0x0){return db[_0x79c2('0x31')][_0x79c2('0x4e')]({'name':_0x4d5a32[_0x79c2('0x30')],'resourceId':_0x4d5a32['id'],'type':_0x3f944f[_0x79c2('0x30')],'sectionId':_0x3f944f['id']},{})[_0x79c2('0x24')](function(){return _0x43a4f1;});}else{return _0x43a4f1;}})[_0x79c2('0x56')](function(_0xb3148f){logger['error'](_0x79c2('0x55'),_0xb3148f);throw _0xb3148f;});}return _0x43a4f1;});}})[_0x79c2('0x24')](respondWithResult(_0x4cc43a,0xc9))[_0x79c2('0x56')](handleError(_0x4cc43a,null));};exports['update']=function(_0x54ebbf,_0x33ef76){if(_0x54ebbf[_0x79c2('0x5c')]['id']){delete _0x54ebbf['body']['id'];}return db[_0x79c2('0x37')][_0x79c2('0x2f')]({'where':{'id':_0x54ebbf['params']['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x33ef76,null))[_0x79c2('0x24')](saveUpdates(_0x54ebbf[_0x79c2('0x5c')],null))[_0x79c2('0x24')](respondWithResult(_0x33ef76,null))[_0x79c2('0x56')](handleError(_0x33ef76,null));};exports[_0x79c2('0x32')]=function(_0x5e1c7d,_0x5cabaa){return db['VoiceQueue'][_0x79c2('0x2f')]({'where':{'id':_0x5e1c7d[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x5cabaa,null))['then'](removeEntity(_0x5cabaa,null))[_0x79c2('0x56')](handleError(_0x5cabaa,null));};exports[_0x79c2('0x5f')]=function(_0x3beae5,_0x6f487c,_0x531cc2){var _0x24e2b6={'raw':![],'where':{}};var _0x5b24c3={};var _0x15962a={'count':0x0,'rows':[]};return db[_0x79c2('0x37')][_0x79c2('0x60')]({'where':{'id':_0x3beae5[_0x79c2('0x58')]['id']}})['then'](handleEntityNotFound(_0x6f487c,null))[_0x79c2('0x24')](function(_0x2f1f18){if(_0x2f1f18){_0x5b24c3['model']=_[_0x79c2('0x3c')](db[_0x79c2('0x61')][_0x79c2('0x38')]);_0x5b24c3[_0x79c2('0x3b')]=_[_0x79c2('0x3c')](_0x3beae5[_0x79c2('0x3b')]);_0x5b24c3[_0x79c2('0x3d')]=_[_0x79c2('0x3e')](_0x5b24c3['model'],_0x5b24c3[_0x79c2('0x3b')]);_0x24e2b6[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x5b24c3[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x3beae5[_0x79c2('0x3b')][_0x79c2('0x40')]));_0x24e2b6[_0x79c2('0x3f')]=_0x24e2b6[_0x79c2('0x3f')][_0x79c2('0x41')]?_0x24e2b6['attributes']:_0x5b24c3[_0x79c2('0x3a')];if(!_0x3beae5[_0x79c2('0x3b')][_0x79c2('0x42')](_0x79c2('0x62'))){_0x24e2b6[_0x79c2('0x1c')]=qs[_0x79c2('0x1c')](_0x3beae5['query'][_0x79c2('0x1c')]);_0x24e2b6[_0x79c2('0x1a')]=qs[_0x79c2('0x1a')](_0x3beae5[_0x79c2('0x3b')][_0x79c2('0x1a')]);}_0x24e2b6[_0x79c2('0x43')]=qs[_0x79c2('0x44')](_0x3beae5[_0x79c2('0x3b')]['sort']);_0x24e2b6[_0x79c2('0x45')]=qs[_0x79c2('0x3d')](_[_0x79c2('0x46')](_0x3beae5[_0x79c2('0x3b')],_0x5b24c3[_0x79c2('0x3d')]));_0x24e2b6[_0x79c2('0x45')]['VoiceQueueId']=_0x2f1f18['id'];if(_0x3beae5[_0x79c2('0x3b')][_0x79c2('0x29')]){_0x24e2b6['where']=_['merge'](_0x24e2b6[_0x79c2('0x45')],{'$or':_[_0x79c2('0x2b')](_0x24e2b6['attributes'],function(_0x1665f6){var _0x52faec={};_0x52faec[_0x1665f6]={'$like':'%'+_0x3beae5[_0x79c2('0x3b')][_0x79c2('0x29')]+'%'};return _0x52faec;})});}_0x24e2b6=_['merge']({},_0x24e2b6,_0x3beae5[_0x79c2('0x49')]);return db[_0x79c2('0x61')][_0x79c2('0x1d')]({'where':_0x24e2b6[_0x79c2('0x45')]})[_0x79c2('0x24')](function(_0x938ba9){_0x15962a[_0x79c2('0x1d')]=_0x938ba9;if(_0x3beae5[_0x79c2('0x3b')]['includeAll']){_0x24e2b6[_0x79c2('0x4a')]=[{'all':!![]}];}return db[_0x79c2('0x61')][_0x79c2('0x4b')](_0x24e2b6);})[_0x79c2('0x24')](function(_0x4237fe){_0x15962a[_0x79c2('0x4c')]=_0x4237fe;return _0x15962a;});}})[_0x79c2('0x24')](respondWithFilteredResult(_0x6f487c,_0x24e2b6))[_0x79c2('0x56')](handleError(_0x6f487c,null));};exports[_0x79c2('0x63')]=function(_0x2b328f,_0x53b07c,_0x9a91b7){var _0x2e9eda={'raw':!![],'where':{}};var _0x11e699={};var _0x1c3991={'count':0x0,'rows':[]};return db[_0x79c2('0x37')][_0x79c2('0x60')]({'where':{'id':_0x2b328f[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x53b07c,null))[_0x79c2('0x24')](function(_0x4fdfd8){if(_0x4fdfd8){_0x11e699[_0x79c2('0x3a')]=_['keys'](db[_0x79c2('0x64')][_0x79c2('0x38')]);_0x11e699[_0x79c2('0x3b')]=_['keys'](_0x2b328f['query']);_0x11e699[_0x79c2('0x3d')]=_['intersection'](_0x11e699['model'],_0x11e699['query']);_0x2e9eda[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x11e699['model'],qs[_0x79c2('0x40')](_0x2b328f[_0x79c2('0x3b')]['fields']));_0x2e9eda[_0x79c2('0x3f')]=_0x2e9eda[_0x79c2('0x3f')][_0x79c2('0x41')]?_0x2e9eda['attributes']:_0x11e699['model'];if(!_0x2b328f[_0x79c2('0x3b')][_0x79c2('0x42')](_0x79c2('0x62'))){_0x2e9eda[_0x79c2('0x1c')]=qs[_0x79c2('0x1c')](_0x2b328f[_0x79c2('0x3b')][_0x79c2('0x1c')]);_0x2e9eda[_0x79c2('0x1a')]=qs[_0x79c2('0x1a')](_0x2b328f[_0x79c2('0x3b')][_0x79c2('0x1a')]);}_0x2e9eda[_0x79c2('0x43')]=qs[_0x79c2('0x44')](_0x2b328f['query'][_0x79c2('0x44')]);_0x2e9eda[_0x79c2('0x45')]=qs[_0x79c2('0x3d')](_['pick'](_0x2b328f[_0x79c2('0x3b')],_0x11e699[_0x79c2('0x3d')]));_0x2e9eda[_0x79c2('0x45')][_0x79c2('0x65')]=_0x4fdfd8['id'];if(_0x2b328f[_0x79c2('0x3b')][_0x79c2('0x29')]){_0x2e9eda[_0x79c2('0x45')]=_[_0x79c2('0x47')](_0x2e9eda[_0x79c2('0x45')],{'$or':_['map'](_0x2e9eda['attributes'],function(_0x554fdb){var _0x1f851b={};_0x1f851b[_0x554fdb]={'$like':'%'+_0x2b328f[_0x79c2('0x3b')][_0x79c2('0x29')]+'%'};return _0x1f851b;})});}_0x2e9eda=_['merge']({},_0x2e9eda,_0x2b328f[_0x79c2('0x49')]);return db['CmHopperHistory']['count']({'where':_0x2e9eda[_0x79c2('0x45')]})[_0x79c2('0x24')](function(_0x5ace74){_0x1c3991['count']=_0x5ace74;if(_0x2b328f[_0x79c2('0x3b')][_0x79c2('0x59')]){_0x2e9eda[_0x79c2('0x4a')]=[{'all':!![]}];}return db[_0x79c2('0x64')][_0x79c2('0x4b')](_0x2e9eda);})[_0x79c2('0x24')](function(_0x8b7446){_0x1c3991[_0x79c2('0x4c')]=_0x8b7446;return _0x1c3991;});}})[_0x79c2('0x24')](respondWithFilteredResult(_0x53b07c,_0x2e9eda))[_0x79c2('0x56')](handleError(_0x53b07c,null));};exports[_0x79c2('0x66')]=function(_0x2c5151,_0x25eb77,_0x2f960b){var _0x2e64d0={'raw':!![],'where':{}};var _0x334689={};var _0x354d51={'count':0x0,'rows':[]};return db[_0x79c2('0x37')][_0x79c2('0x60')]({'where':{'id':_0x2c5151['params']['id']}})['then'](handleEntityNotFound(_0x25eb77,null))['then'](function(_0x200e27){if(_0x200e27){_0x334689['model']=_[_0x79c2('0x3c')](db['CmHopperFinal']['rawAttributes']);_0x334689['query']=_[_0x79c2('0x3c')](_0x2c5151[_0x79c2('0x3b')]);_0x334689[_0x79c2('0x3d')]=_[_0x79c2('0x3e')](_0x334689[_0x79c2('0x3a')],_0x334689[_0x79c2('0x3b')]);_0x2e64d0[_0x79c2('0x3f')]=_['intersection'](_0x334689[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x2c5151['query'][_0x79c2('0x40')]));_0x2e64d0[_0x79c2('0x3f')]=_0x2e64d0[_0x79c2('0x3f')][_0x79c2('0x41')]?_0x2e64d0[_0x79c2('0x3f')]:_0x334689[_0x79c2('0x3a')];if(!_0x2c5151[_0x79c2('0x3b')][_0x79c2('0x42')]('nolimit')){_0x2e64d0[_0x79c2('0x1c')]=qs[_0x79c2('0x1c')](_0x2c5151['query'][_0x79c2('0x1c')]);_0x2e64d0[_0x79c2('0x1a')]=qs['offset'](_0x2c5151[_0x79c2('0x3b')][_0x79c2('0x1a')]);}_0x2e64d0[_0x79c2('0x43')]=qs[_0x79c2('0x44')](_0x2c5151['query'][_0x79c2('0x44')]);_0x2e64d0[_0x79c2('0x45')]=qs['filters'](_[_0x79c2('0x46')](_0x2c5151['query'],_0x334689['filters']));_0x2e64d0[_0x79c2('0x45')]['VoiceQueueId']=_0x200e27['id'];if(_0x2c5151[_0x79c2('0x3b')][_0x79c2('0x29')]){_0x2e64d0['where']=_['merge'](_0x2e64d0[_0x79c2('0x45')],{'$or':_[_0x79c2('0x2b')](_0x2e64d0[_0x79c2('0x3f')],function(_0x28792){var _0x3a7288={};_0x3a7288[_0x28792]={'$like':'%'+_0x2c5151['query'][_0x79c2('0x29')]+'%'};return _0x3a7288;})});}_0x2e64d0=_[_0x79c2('0x47')]({},_0x2e64d0,_0x2c5151['options']);return db[_0x79c2('0x67')]['count']({'where':_0x2e64d0[_0x79c2('0x45')]})[_0x79c2('0x24')](function(_0x5f5a6f){_0x354d51[_0x79c2('0x1d')]=_0x5f5a6f;if(_0x2c5151['query']['includeAll']){_0x2e64d0[_0x79c2('0x4a')]=[{'all':!![]}];}return db[_0x79c2('0x67')][_0x79c2('0x4b')](_0x2e64d0);})['then'](function(_0x2f56d8){_0x354d51['rows']=_0x2f56d8;return _0x354d51;});}})[_0x79c2('0x24')](respondWithFilteredResult(_0x25eb77,_0x2e64d0))[_0x79c2('0x56')](handleError(_0x25eb77,null));};exports[_0x79c2('0x68')]=function(_0x51b70d,_0x2fd8a6,_0x1ecd9f){var _0x464ec6={'raw':!![],'where':{}};var _0x4b7e76={};var _0x5f0e84={'count':0x0,'rows':[]};return db[_0x79c2('0x37')][_0x79c2('0x60')]({'where':{'id':_0x51b70d[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x2fd8a6,null))[_0x79c2('0x24')](function(_0x34f696){if(_0x34f696){_0x4b7e76[_0x79c2('0x3a')]=_[_0x79c2('0x3c')](db[_0x79c2('0x69')][_0x79c2('0x38')]);_0x4b7e76['query']=_[_0x79c2('0x3c')](_0x51b70d[_0x79c2('0x3b')]);_0x4b7e76['filters']=_[_0x79c2('0x3e')](_0x4b7e76[_0x79c2('0x3a')],_0x4b7e76[_0x79c2('0x3b')]);_0x464ec6[_0x79c2('0x3f')]=_['intersection'](_0x4b7e76[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x51b70d[_0x79c2('0x3b')][_0x79c2('0x40')]));_0x464ec6[_0x79c2('0x3f')]=_0x464ec6['attributes'][_0x79c2('0x41')]?_0x464ec6[_0x79c2('0x3f')]:_0x4b7e76[_0x79c2('0x3a')];if(!_0x51b70d['query'][_0x79c2('0x42')](_0x79c2('0x62'))){_0x464ec6[_0x79c2('0x1c')]=qs['limit'](_0x51b70d['query'][_0x79c2('0x1c')]);_0x464ec6[_0x79c2('0x1a')]=qs['offset'](_0x51b70d['query'][_0x79c2('0x1a')]);}_0x464ec6['order']=qs[_0x79c2('0x44')](_0x51b70d['query'][_0x79c2('0x44')]);_0x464ec6[_0x79c2('0x45')]=qs[_0x79c2('0x3d')](_[_0x79c2('0x46')](_0x51b70d[_0x79c2('0x3b')],_0x4b7e76[_0x79c2('0x3d')]));_0x464ec6['where'][_0x79c2('0x65')]=_0x34f696['id'];if(_0x51b70d[_0x79c2('0x3b')][_0x79c2('0x29')]){_0x464ec6['where']=_[_0x79c2('0x47')](_0x464ec6['where'],{'$or':_[_0x79c2('0x2b')](_0x464ec6['attributes'],function(_0x351a6a){var _0x121ead={};_0x121ead[_0x351a6a]={'$like':'%'+_0x51b70d[_0x79c2('0x3b')][_0x79c2('0x29')]+'%'};return _0x121ead;})});}_0x464ec6=_[_0x79c2('0x47')]({},_0x464ec6,_0x51b70d[_0x79c2('0x49')]);return db['CmHopperBlack']['count']({'where':_0x464ec6[_0x79c2('0x45')]})[_0x79c2('0x24')](function(_0x3bb809){_0x5f0e84[_0x79c2('0x1d')]=_0x3bb809;if(_0x51b70d[_0x79c2('0x3b')][_0x79c2('0x59')]){_0x464ec6[_0x79c2('0x4a')]=[{'all':!![]}];}return db[_0x79c2('0x69')][_0x79c2('0x4b')](_0x464ec6);})['then'](function(_0x2d7420){_0x5f0e84['rows']=_0x2d7420;return _0x5f0e84;});}})[_0x79c2('0x24')](respondWithFilteredResult(_0x2fd8a6,_0x464ec6))[_0x79c2('0x56')](handleError(_0x2fd8a6,null));};exports[_0x79c2('0x6a')]=function(_0x2cc8fe,_0x5b0c60,_0x29a5d6){var _0x21a89c={};var _0xbf5249={};var _0x42aded;var _0x5c8cf3;return db['VoiceQueue'][_0x79c2('0x60')]({'where':{'id':_0x2cc8fe[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x5b0c60,null))[_0x79c2('0x24')](function(_0x3b3ae4){if(_0x3b3ae4){_0x42aded=_0x3b3ae4;_0xbf5249[_0x79c2('0x3a')]=_[_0x79c2('0x3c')](db[_0x79c2('0x6b')][_0x79c2('0x38')]);_0xbf5249['query']=_[_0x79c2('0x3c')](_0x2cc8fe[_0x79c2('0x3b')]);_0xbf5249['filters']=_[_0x79c2('0x3e')](_0xbf5249[_0x79c2('0x3a')],_0xbf5249[_0x79c2('0x3b')]);_0x21a89c['attributes']=_[_0x79c2('0x3e')](_0xbf5249[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x2cc8fe[_0x79c2('0x3b')][_0x79c2('0x40')]));_0x21a89c[_0x79c2('0x3f')]=_0x21a89c[_0x79c2('0x3f')][_0x79c2('0x41')]?_0x21a89c[_0x79c2('0x3f')]:_0xbf5249[_0x79c2('0x3a')];_0x21a89c[_0x79c2('0x43')]=qs['sort'](_0x2cc8fe[_0x79c2('0x3b')]['sort']);_0x21a89c[_0x79c2('0x45')]=qs['filters'](_[_0x79c2('0x46')](_0x2cc8fe[_0x79c2('0x3b')],_0xbf5249[_0x79c2('0x3d')]));if(_0x2cc8fe['query'][_0x79c2('0x29')]){_0x21a89c[_0x79c2('0x45')]=_['merge'](_0x21a89c[_0x79c2('0x45')],{'$or':_[_0x79c2('0x2b')](_0x21a89c[_0x79c2('0x3f')],function(_0x101b6a){var _0x532836={};_0x532836[_0x101b6a]={'$like':'%'+_0x2cc8fe[_0x79c2('0x3b')][_0x79c2('0x29')]+'%'};return _0x532836;})});}_0x21a89c=_['merge']({},_0x21a89c,_0x2cc8fe[_0x79c2('0x49')]);return _0x42aded[_0x79c2('0x6a')](_0x21a89c);}})['then'](function(_0x833dd1){if(_0x833dd1){_0x5c8cf3=_0x833dd1[_0x79c2('0x41')];if(!_0x2cc8fe[_0x79c2('0x3b')][_0x79c2('0x42')](_0x79c2('0x62'))){_0x21a89c['limit']=qs[_0x79c2('0x1c')](_0x2cc8fe['query'][_0x79c2('0x1c')]);_0x21a89c[_0x79c2('0x1a')]=qs[_0x79c2('0x1a')](_0x2cc8fe['query'][_0x79c2('0x1a')]);}return _0x42aded[_0x79c2('0x6a')](_0x21a89c);}})[_0x79c2('0x24')](function(_0x113bef){if(_0x113bef){return _0x113bef?{'count':_0x5c8cf3,'rows':_0x113bef}:null;}})[_0x79c2('0x24')](respondWithResult(_0x5b0c60,null))[_0x79c2('0x56')](handleError(_0x5b0c60,null));};exports[_0x79c2('0x6c')]=function(_0x25c161,_0x5b712d,_0x244f20){var _0x1a87ab=_0x25c161[_0x79c2('0x5c')]['teams'];var _0x452e4e=_[_0x79c2('0x2b')](_0x1a87ab,'id');return db['Team'][_0x79c2('0x4b')]({'where':{'id':_0x452e4e},'attributes':['id'],'include':[{'model':db[_0x79c2('0x6d')],'as':_0x79c2('0x6e'),'attributes':['id',_0x79c2('0x30'),_0x79c2('0x6f'),_0x79c2('0x70'),_0x79c2('0x71')],'raw':!![]}]})[_0x79c2('0x24')](function(_0x57543f){if(_0x57543f){var _0xcbd6e8=_['flatMap'](_0x57543f,function(_0x552c12){var _0x163d7d=_0x552c12[_0x79c2('0x52')]({'plain':!![]});_0x163d7d[_0x79c2('0x6e')]['forEach'](function(_0xccd576){_0xccd576[_0x79c2('0x72')]=_[_0x79c2('0x2f')](_0x1a87ab,{'id':_0x163d7d['id']})['penalty'];});return _0x163d7d[_0x79c2('0x6e')];});return db[_0x79c2('0x37')][_0x79c2('0x2f')]({'where':{'id':_0x25c161[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](function(_0x53d872){return db[_0x79c2('0x73')][_0x79c2('0x74')](function(_0x3c3e97){return _0x53d872[_0x79c2('0x6c')](_0x452e4e,{'transaction':_0x3c3e97})['then'](function(){return BPromise[_0x79c2('0x75')](_0x1a87ab,function(_0x1ea4c9){return db[_0x79c2('0x76')][_0x79c2('0x77')]({'TeamId':_0x1ea4c9['id'],'VoiceQueueId':_0x25c161[_0x79c2('0x58')]['id'],'penalty':_0x1ea4c9[_0x79c2('0x72')]},{'transaction':_0x3c3e97});});})['then'](function(){return BPromise[_0x79c2('0x75')](_0xcbd6e8,function(_0x3ede8a){return db[_0x79c2('0x78')][_0x79c2('0x79')]({'where':{'UserId':_0x3ede8a['id'],'VoiceQueueId':_0x25c161['params']['id']},'defaults':{'penalty':_0x3ede8a[_0x79c2('0x72')]},'transaction':_0x3c3e97});});})[_0x79c2('0x24')](function(){return BPromise[_0x79c2('0x75')](_[_0x79c2('0x29')](_0xcbd6e8,{'online':!![]}),function(_0x149d0b){return db['UserVoiceQueueRt'][_0x79c2('0x77')]({'membername':_0x149d0b[_0x79c2('0x30')],'UserId':_0x149d0b['id'],'queue_name':_0x53d872[_0x79c2('0x30')],'VoiceQueueId':_0x53d872['id'],'interface':_[_0x79c2('0x7a')](_0x149d0b[_0x79c2('0x71')])?util['format'](_0x79c2('0x7b'),_0x149d0b[_0x79c2('0x30')]):_0x149d0b[_0x79c2('0x71')],'paused':_0x149d0b[_0x79c2('0x70')]||![],'penalty':_0x149d0b[_0x79c2('0x72')]},{'transaction':_0x3c3e97});});})[_0x79c2('0x24')](function(){_0xcbd6e8[_0x79c2('0x7c')](function(_0x2f551f){socket['emit'](_0x79c2('0x7d'),{'UserId':_0x2f551f['id'],'VoiceQueueId':_0x53d872['id']});});});});});}})[_0x79c2('0x24')](respondWithStatusCode(_0x5b712d,null))[_0x79c2('0x56')](handleError(_0x5b712d,null));};exports['removeTeams']=function(_0x37e041,_0x40c4fc,_0x1900ce){return db[_0x79c2('0x6b')][_0x79c2('0x4b')]({'where':{'id':_0x37e041[_0x79c2('0x3b')][_0x79c2('0x7e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x79c2('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x40c4fc,null))[_0x79c2('0x24')](function(_0x566200){var _0x1a8b87=_[_0x79c2('0x2b')](_0x566200,'id');var _0x450234=[];var _0x2c3e64=[];var _0x2409fc=squel[_0x79c2('0x7f')]();_0x2409fc['field'](_0x79c2('0x80'))[_0x79c2('0x81')]('team_has_voice_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x79c2('0x45')](_0x79c2('0x82'),_0x37e041[_0x79c2('0x58')]['id']);for(var _0x5dff79=0x0;_0x5dff79<_0x566200[_0x79c2('0x41')];_0x5dff79+=0x1){let _0xf233ba=_0x566200[_0x5dff79];for(var _0x12eb10=0x0;_0x12eb10<_0xf233ba[_0x79c2('0x6e')][_0x79c2('0x41')];_0x12eb10+=0x1){let _0x13243f=_0xf233ba[_0x79c2('0x6e')][_0x12eb10];var _0x38b8de=_0x2409fc[_0x79c2('0x57')]();_0x38b8de['where'](_0x79c2('0x83'),_0x13243f['id']);_0x2c3e64[_0x79c2('0x84')](db['sequelize'][_0x79c2('0x3b')](_0x38b8de[_0x79c2('0x85')](),{'type':db[_0x79c2('0x73')]['QueryTypes']['SELECT']})[_0x79c2('0x24')](function(_0x55b570){if(_0x55b570[_0x79c2('0x41')]===0x1){return _0x13243f['id'];}else{var _0x30001d=_[_0x79c2('0x86')](_['map'](_0x55b570,_0x79c2('0x87')),function(_0x323f7d){return _['includes'](_0x1a8b87,_0x323f7d);});if(_0x30001d){return _0x13243f['id'];}}}));}}return BPromise[_0x79c2('0x88')](_0x2c3e64)['then'](function(_0x4cc927){_0x450234=_(_0x450234)[_0x79c2('0x89')](_0x4cc927)[_0x79c2('0x8a')]()[_0x79c2('0x2c')]();return db['VoiceQueue']['find']({'where':{'id':_0x37e041[_0x79c2('0x58')]['id']}})['then'](function(_0x35b598){return db['sequelize'][_0x79c2('0x74')](function(_0x2c6d23){return _0x35b598[_0x79c2('0x8b')](_0x37e041[_0x79c2('0x3b')]['ids'],{'transaction':_0x2c6d23})['then'](function(){if(!_['isEmpty'](_0x450234)){return _0x35b598[_0x79c2('0x8c')](_0x450234,{'transaction':_0x2c6d23})[_0x79c2('0x24')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x37e041[_0x79c2('0x58')]['id'],'UserId':_0x450234},'transaction':_0x2c6d23});});}})[_0x79c2('0x24')](function(){_0x450234[_0x79c2('0x7c')](function(_0x1cb595){socket[_0x79c2('0x8d')](_0x79c2('0x8e'),{'UserId':_0x1cb595,'VoiceQueueId':_0x35b598['id']});});});});});});})[_0x79c2('0x24')](respondWithStatusCode(_0x40c4fc,null))[_0x79c2('0x56')](handleError(_0x40c4fc,null));};exports[_0x79c2('0x8f')]=function(_0x32f1ab,_0x25f48e,_0x272f5f){var _0x42249a,_0x2482a3;return db[_0x79c2('0x37')][_0x79c2('0x2f')]({'where':{'id':_0x32f1ab[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x25f48e,null))['then'](function(_0x17054a){if(_0x17054a){_0x2482a3=_0x17054a;return _0x17054a['addAgents'](_0x32f1ab['body']['ids'],_[_0x79c2('0x5d')](_0x32f1ab[_0x79c2('0x5c')],['ids','id'])||{})['spread'](function(_0x41a5c6){for(var _0x4fa059=0x0;_0x4fa059<_0x32f1ab[_0x79c2('0x5c')][_0x79c2('0x7e')][_0x79c2('0x41')];_0x4fa059+=0x1){socket[_0x79c2('0x8d')]('userVoiceQueue:save',{'UserId':Number(_0x32f1ab[_0x79c2('0x5c')]['ids'][_0x4fa059]),'VoiceQueueId':Number(_0x32f1ab[_0x79c2('0x58')]['id'])});}return _0x41a5c6;});}})[_0x79c2('0x24')](function(_0x39233b){_0x42249a=_0x39233b||[];if(_0x2482a3){return db[_0x79c2('0x6d')][_0x79c2('0x4b')]({'where':{'id':_0x32f1ab['body'][_0x79c2('0x7e')]},'attributes':['id',_0x79c2('0x30'),_0x79c2('0x6f'),_0x79c2('0x70'),_0x79c2('0x71')],'raw':!![]});}})['then'](function(_0x1a2aa6){if(!_['isEmpty'](_0x1a2aa6)){var _0x92fc66=[];for(var _0x96f9a4=0x0;_0x96f9a4<_0x1a2aa6[_0x79c2('0x41')];_0x96f9a4++){if(_0x1a2aa6[_0x96f9a4][_0x79c2('0x6f')]){_0x92fc66[_0x79c2('0x84')](db[_0x79c2('0x90')][_0x79c2('0x77')]({'membername':_0x1a2aa6[_0x96f9a4]['name'],'UserId':_0x1a2aa6[_0x96f9a4]['id'],'queue_name':_0x2482a3['name'],'VoiceQueueId':_0x2482a3['id'],'interface':_[_0x79c2('0x7a')](_0x1a2aa6[_0x96f9a4][_0x79c2('0x71')])?util['format'](_0x79c2('0x7b'),_0x1a2aa6[_0x96f9a4][_0x79c2('0x30')]):_0x1a2aa6[_0x96f9a4][_0x79c2('0x71')],'paused':_0x1a2aa6[_0x96f9a4][_0x79c2('0x70')]||![],'penalty':_0x32f1ab[_0x79c2('0x5c')][_0x79c2('0x72')]||0x0}));}}return BPromise['all'](_0x92fc66);}})[_0x79c2('0x24')](function(){return _0x42249a;})['then'](respondWithResult(_0x25f48e,null))[_0x79c2('0x56')](handleError(_0x25f48e,null));};exports[_0x79c2('0x8c')]=function(_0x2ce49c,_0x4e993b,_0x5067fa){return db[_0x79c2('0x37')][_0x79c2('0x2f')]({'where':{'id':_0x2ce49c['params']['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x4e993b,null))['then'](function(_0x5de9b8){if(_0x5de9b8){return _0x5de9b8[_0x79c2('0x8c')](_0x2ce49c[_0x79c2('0x3b')][_0x79c2('0x7e')])[_0x79c2('0x24')](function(){if(_[_0x79c2('0x91')](_0x2ce49c[_0x79c2('0x3b')][_0x79c2('0x7e')])){for(var _0x53b7fd=0x0;_0x53b7fd<_0x2ce49c[_0x79c2('0x3b')]['ids'][_0x79c2('0x41')];_0x53b7fd+=0x1){socket[_0x79c2('0x8d')]('userVoiceQueue:remove',{'UserId':Number(_0x2ce49c[_0x79c2('0x3b')]['ids'][_0x53b7fd]),'VoiceQueueId':Number(_0x2ce49c['params']['id'])});}}else{socket[_0x79c2('0x8d')](_0x79c2('0x8e'),{'UserId':Number(_0x2ce49c['query'][_0x79c2('0x7e')]),'VoiceQueueId':Number(_0x2ce49c[_0x79c2('0x58')]['id'])});}});}})[_0x79c2('0x24')](function(_0x29f3e6){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x2ce49c['params']['id'],'UserId':_0x2ce49c[_0x79c2('0x3b')][_0x79c2('0x7e')]}})[_0x79c2('0x24')](function(){return _0x29f3e6;});})[_0x79c2('0x24')](respondWithStatusCode(_0x4e993b,null))['catch'](handleError(_0x4e993b,null));};exports['getAgents']=function(_0x562f02,_0x170889,_0x365c96){var _0x4c71b0={};var _0x46014f={};var _0x1b9d24;var _0x1b4a8a;return db[_0x79c2('0x37')][_0x79c2('0x60')]({'where':{'id':_0x562f02[_0x79c2('0x58')]['id']}})['then'](handleEntityNotFound(_0x170889,null))[_0x79c2('0x24')](function(_0x55f34f){if(_0x55f34f){_0x1b9d24=_0x55f34f;_0x46014f[_0x79c2('0x3a')]=_[_0x79c2('0x3c')](db[_0x79c2('0x6d')][_0x79c2('0x38')]);_0x46014f[_0x79c2('0x3b')]=_[_0x79c2('0x3c')](_0x562f02['query']);_0x46014f[_0x79c2('0x3d')]=_[_0x79c2('0x3e')](_0x46014f['model'],_0x46014f[_0x79c2('0x3b')]);_0x4c71b0[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x46014f['model'],qs[_0x79c2('0x40')](_0x562f02[_0x79c2('0x3b')][_0x79c2('0x40')]));_0x4c71b0['attributes']=_0x4c71b0[_0x79c2('0x3f')][_0x79c2('0x41')]?_0x4c71b0[_0x79c2('0x3f')]:_0x46014f[_0x79c2('0x3a')];_0x4c71b0[_0x79c2('0x43')]=qs['sort'](_0x562f02['query'][_0x79c2('0x44')]);_0x4c71b0[_0x79c2('0x45')]=qs['filters'](_[_0x79c2('0x46')](_0x562f02[_0x79c2('0x3b')],_0x46014f[_0x79c2('0x3d')]));if(_0x562f02['query'][_0x79c2('0x29')]){_0x4c71b0['where']=_[_0x79c2('0x47')](_0x4c71b0[_0x79c2('0x45')],{'$or':_['map'](_0x4c71b0[_0x79c2('0x3f')],function(_0x357ed3){var _0x4bb240={};_0x4bb240[_0x357ed3]={'$like':'%'+_0x562f02[_0x79c2('0x3b')][_0x79c2('0x29')]+'%'};return _0x4bb240;})});}_0x4c71b0=_[_0x79c2('0x47')]({},_0x4c71b0,_0x562f02[_0x79c2('0x49')]);return _0x1b9d24[_0x79c2('0x92')](_0x4c71b0);}})['then'](function(_0x15f121){if(_0x15f121){_0x1b4a8a=_0x15f121['length'];if(!_0x562f02[_0x79c2('0x3b')][_0x79c2('0x42')](_0x79c2('0x62'))){_0x4c71b0[_0x79c2('0x1c')]=qs[_0x79c2('0x1c')](_0x562f02[_0x79c2('0x3b')][_0x79c2('0x1c')]);_0x4c71b0['offset']=qs['offset'](_0x562f02[_0x79c2('0x3b')][_0x79c2('0x1a')]);}return _0x1b9d24[_0x79c2('0x92')](_0x4c71b0);}})[_0x79c2('0x24')](function(_0x4620b9){if(_0x4620b9){return _0x4620b9?{'count':_0x1b4a8a,'rows':_0x4620b9}:null;}})[_0x79c2('0x24')](respondWithResult(_0x170889,null))[_0x79c2('0x56')](handleError(_0x170889,null));};exports[_0x79c2('0x93')]=function(_0x27fc4a,_0x3b46b2,_0x168159){var _0x4deb05={};var _0x320ee1={};var _0x32e59b;var _0x548591;return db[_0x79c2('0x37')][_0x79c2('0x60')]({'where':{'id':_0x27fc4a['params']['id']}})['then'](handleEntityNotFound(_0x3b46b2,null))[_0x79c2('0x24')](function(_0x4d11f0){if(_0x4d11f0){_0x32e59b=_0x4d11f0;_0x320ee1[_0x79c2('0x3a')]=_[_0x79c2('0x3c')](db[_0x79c2('0x90')][_0x79c2('0x38')]);_0x320ee1[_0x79c2('0x3b')]=_[_0x79c2('0x3c')](_0x27fc4a[_0x79c2('0x3b')]);_0x320ee1[_0x79c2('0x3d')]=_[_0x79c2('0x3e')](_0x320ee1['model'],_0x320ee1['query']);_0x4deb05[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x320ee1[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x27fc4a['query'][_0x79c2('0x40')]));_0x4deb05['attributes']=_0x4deb05['attributes']['length']?_0x4deb05[_0x79c2('0x3f')]:_0x320ee1[_0x79c2('0x3a')];_0x4deb05[_0x79c2('0x43')]=qs['sort'](_0x27fc4a[_0x79c2('0x3b')][_0x79c2('0x44')]);_0x4deb05[_0x79c2('0x45')]=qs[_0x79c2('0x3d')](_[_0x79c2('0x46')](_0x27fc4a['query'],_0x320ee1['filters']));if(_0x27fc4a[_0x79c2('0x3b')][_0x79c2('0x29')]){_0x4deb05['where']=_[_0x79c2('0x47')](_0x4deb05['where'],{'$or':_[_0x79c2('0x2b')](_0x4deb05['attributes'],function(_0x3a12db){var _0x4654a5={};_0x4654a5[_0x3a12db]={'$like':'%'+_0x27fc4a[_0x79c2('0x3b')][_0x79c2('0x29')]+'%'};return _0x4654a5;})});}_0x4deb05=_[_0x79c2('0x47')]({},_0x4deb05,_0x27fc4a[_0x79c2('0x49')]);return _0x32e59b[_0x79c2('0x93')](_0x4deb05);}})[_0x79c2('0x24')](function(_0x27e538){if(_0x27e538){_0x548591=_0x27e538[_0x79c2('0x41')];if(!_0x27fc4a[_0x79c2('0x3b')][_0x79c2('0x42')](_0x79c2('0x62'))){_0x4deb05[_0x79c2('0x1c')]=qs['limit'](_0x27fc4a[_0x79c2('0x3b')][_0x79c2('0x1c')]);_0x4deb05[_0x79c2('0x1a')]=qs[_0x79c2('0x1a')](_0x27fc4a['query'][_0x79c2('0x1a')]);}return _0x32e59b[_0x79c2('0x93')](_0x4deb05);}})[_0x79c2('0x24')](function(_0x35b387){return _0x35b387?{'count':_0x548591,'rows':_0x35b387}:null;})[_0x79c2('0x24')](respondWithResult(_0x3b46b2,null))[_0x79c2('0x56')](handleError(_0x3b46b2,null));};exports[_0x79c2('0x94')]=function(_0x6dbcc4,_0x4b7194,_0x47bbe9){var _0x6653cd={};var _0x16f96f={};var _0x17e647;var _0x33e809;return db['VoiceQueue'][_0x79c2('0x60')]({'where':{'id':_0x6dbcc4[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x4b7194,null))[_0x79c2('0x24')](function(_0x5e2ec3){if(_0x5e2ec3){_0x17e647=_0x5e2ec3;_0x16f96f[_0x79c2('0x3a')]=_['keys'](db[_0x79c2('0x95')][_0x79c2('0x38')]);_0x16f96f[_0x79c2('0x3b')]=_[_0x79c2('0x3c')](_0x6dbcc4[_0x79c2('0x3b')]);_0x16f96f[_0x79c2('0x3d')]=_['intersection'](_0x16f96f[_0x79c2('0x3a')],_0x16f96f[_0x79c2('0x3b')]);_0x6653cd[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x16f96f[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x6dbcc4[_0x79c2('0x3b')]['fields']));_0x6653cd['attributes']=_0x6653cd[_0x79c2('0x3f')]['length']?_0x6653cd[_0x79c2('0x3f')]:_0x16f96f[_0x79c2('0x3a')];_0x6653cd['order']=qs[_0x79c2('0x44')](_0x6dbcc4[_0x79c2('0x3b')][_0x79c2('0x44')]);_0x6653cd[_0x79c2('0x45')]=qs['filters'](_[_0x79c2('0x46')](_0x6dbcc4[_0x79c2('0x3b')],_0x16f96f[_0x79c2('0x3d')]));if(_0x6dbcc4[_0x79c2('0x3b')][_0x79c2('0x29')]){_0x6653cd[_0x79c2('0x45')]=_['merge'](_0x6653cd[_0x79c2('0x45')],{'$or':_[_0x79c2('0x2b')](_0x6653cd[_0x79c2('0x3f')],function(_0x30e0bd){var _0x2a150e={};_0x2a150e[_0x30e0bd]={'$like':'%'+_0x6dbcc4[_0x79c2('0x3b')]['filter']+'%'};return _0x2a150e;})});}_0x6653cd=_[_0x79c2('0x47')]({},_0x6653cd,_0x6dbcc4['options']);return _0x17e647[_0x79c2('0x94')](_0x6653cd);}})[_0x79c2('0x24')](function(_0x4fee3b){if(_0x4fee3b){_0x33e809=_0x4fee3b[_0x79c2('0x41')];if(!_0x6dbcc4['query'][_0x79c2('0x42')](_0x79c2('0x62'))){_0x6653cd[_0x79c2('0x1c')]=qs[_0x79c2('0x1c')](_0x6dbcc4[_0x79c2('0x3b')][_0x79c2('0x1c')]);_0x6653cd[_0x79c2('0x1a')]=qs[_0x79c2('0x1a')](_0x6dbcc4['query'][_0x79c2('0x1a')]);}return _0x17e647[_0x79c2('0x94')](_0x6653cd);}})[_0x79c2('0x24')](function(_0x2e33e3){if(_0x2e33e3){return _0x2e33e3?{'count':_0x33e809,'rows':_0x2e33e3}:null;}})[_0x79c2('0x24')](respondWithResult(_0x4b7194,null))[_0x79c2('0x56')](handleError(_0x4b7194,null));};exports['addLists']=function(_0x5692ee,_0xfea55f,_0xe8267d){var _0x5a34bf,_0x5b3fc4;return db[_0x79c2('0x37')]['find']({'where':{'id':_0x5692ee['params']['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0xfea55f,null))['then'](function(_0x2e14cc){if(_0x2e14cc){_0x5b3fc4=_0x2e14cc;return _0x2e14cc[_0x79c2('0x96')](_0x5692ee[_0x79c2('0x5c')]['ids'],_[_0x79c2('0x5d')](_0x5692ee[_0x79c2('0x5c')],[_0x79c2('0x7e'),'id'])||{});}return null;})['spread'](function(_0x56fc61){var _0x54dae7;_0x5a34bf=_0x56fc61||[];var _0x3b8beb=[];if(_0x56fc61){for(var _0x251d78=0x0;_0x251d78<_0x56fc61[_0x79c2('0x41')];_0x251d78+=0x1){var _0x1b7ad7=_0x56fc61[_0x251d78][_0x79c2('0x52')]({'plain':!![]});_0x5b3fc4[_0x79c2('0x97')]=_0x5692ee[_0x79c2('0x5c')][_0x79c2('0x97')]?_0x5692ee[_0x79c2('0x5c')][_0x79c2('0x97')]:_0x5b3fc4[_0x79c2('0x97')];switch(_0x5b3fc4[_0x79c2('0x97')]){case _0x79c2('0x98'):_0x54dae7=squel['insert']()['into'](_0x79c2('0x99'))['fromQuery'](['phone',_0x79c2('0x9a'),_0x79c2('0x9b'),_0x79c2('0x9c'),_0x79c2('0x65'),_0x79c2('0x5a'),'updatedAt'],squel[_0x79c2('0x7f')]()[_0x79c2('0x9d')](_0x79c2('0x9e'),_0x79c2('0x9e'))[_0x79c2('0x9d')](_0x79c2('0x9f'),_0x79c2('0x9a'))[_0x79c2('0x9d')]('id',_0x79c2('0x9b'))['field'](_0x1b7ad7[_0x79c2('0xa0')][_0x79c2('0x85')](),'ListId')[_0x79c2('0x9d')](_0x5692ee[_0x79c2('0x58')]['id'][_0x79c2('0x85')](),_0x79c2('0x65'))['field']('NOW()',_0x79c2('0x5a'))[_0x79c2('0x9d')](_0x79c2('0x9f'),_0x79c2('0x5b'))[_0x79c2('0x81')](_0x79c2('0xa1'))[_0x79c2('0x45')](_0x79c2('0xa2'))[_0x79c2('0x45')](_0x79c2('0xa3'),_0x1b7ad7[_0x79c2('0xa0')]['toString']())[_0x79c2('0x45')](_0x79c2('0xa4'))[_0x79c2('0x45')](_0x79c2('0xa5'),squel[_0x79c2('0x7f')]()['field'](_0x79c2('0xa6'))[_0x79c2('0x81')]('cm_hopper_final')[_0x79c2('0x45')](_0x79c2('0x82'),_0x5692ee['params']['id'][_0x79c2('0x85')]()))['where'](_0x79c2('0xa5'),squel[_0x79c2('0x7f')]()[_0x79c2('0x9d')](_0x79c2('0xa7'))[_0x79c2('0x81')](_0x79c2('0x99'))[_0x79c2('0x45')]('VoiceQueueId\x20=\x20?',_0x5692ee[_0x79c2('0x58')]['id'][_0x79c2('0x85')]())))[_0x79c2('0x85')]();break;case _0x79c2('0xa8'):_0x54dae7=squel['insert']()[_0x79c2('0xa9')](_0x79c2('0x99'))[_0x79c2('0xaa')]([_0x79c2('0x9e'),'scheduledAt',_0x79c2('0x9b'),_0x79c2('0x9c'),_0x79c2('0x65'),'createdAt',_0x79c2('0x5b')],squel['select']()[_0x79c2('0x9d')](_0x79c2('0x9e'),_0x79c2('0x9e'))[_0x79c2('0x9d')](_0x79c2('0x9f'),'scheduledAt')['field']('id',_0x79c2('0x9b'))[_0x79c2('0x9d')](_0x1b7ad7[_0x79c2('0xa0')]['toString'](),_0x79c2('0x9c'))['field'](_0x5692ee[_0x79c2('0x58')]['id'][_0x79c2('0x85')](),_0x79c2('0x65'))[_0x79c2('0x9d')](_0x79c2('0x9f'),_0x79c2('0x5a'))['field'](_0x79c2('0x9f'),_0x79c2('0x5b'))['from'](_0x79c2('0xa1'))[_0x79c2('0x45')](_0x79c2('0xa2'))[_0x79c2('0x45')](_0x79c2('0xa3'),_0x1b7ad7[_0x79c2('0xa0')][_0x79c2('0x85')]())[_0x79c2('0x45')](_0x79c2('0xa4'))['where'](_0x79c2('0xa5'),squel[_0x79c2('0x7f')]()[_0x79c2('0x9d')](_0x79c2('0xa7'))[_0x79c2('0x81')](_0x79c2('0x99'))[_0x79c2('0x45')](_0x79c2('0x82'),_0x5692ee[_0x79c2('0x58')]['id'][_0x79c2('0x85')]())))[_0x79c2('0x85')]();break;default:_0x54dae7=squel[_0x79c2('0xab')]()[_0x79c2('0xa9')](_0x79c2('0x99'))[_0x79c2('0xaa')]([_0x79c2('0x9e'),_0x79c2('0x9a'),'ContactId','ListId',_0x79c2('0x65'),'createdAt','updatedAt'],squel[_0x79c2('0x7f')]()[_0x79c2('0x9d')](_0x79c2('0x9e'),'phone')['field'](_0x79c2('0x9f'),_0x79c2('0x9a'))[_0x79c2('0x9d')]('id',_0x79c2('0x9b'))['field'](_0x1b7ad7['CmListId']['toString'](),_0x79c2('0x9c'))[_0x79c2('0x9d')](_0x5692ee[_0x79c2('0x58')]['id'][_0x79c2('0x85')](),'VoiceQueueId')[_0x79c2('0x9d')](_0x79c2('0x9f'),_0x79c2('0x5a'))[_0x79c2('0x9d')]('NOW()',_0x79c2('0x5b'))[_0x79c2('0x81')](_0x79c2('0xa1'))[_0x79c2('0x45')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1b7ad7['CmListId']['toString']())[_0x79c2('0x45')](_0x79c2('0xa4')))[_0x79c2('0x85')]();}_0x3b8beb[_0x79c2('0x84')](db[_0x79c2('0x73')][_0x79c2('0x3b')](_0x54dae7));}return BPromise[_0x79c2('0x88')](_0x3b8beb);}})[_0x79c2('0x24')](function(){return _0x5a34bf;})[_0x79c2('0x24')](respondWithResult(_0xfea55f,null))[_0x79c2('0x56')](handleError(_0xfea55f,null));};exports['removeLists']=function(_0x2fbe00,_0x514b7f,_0x1ad1ed){return db['VoiceQueue'][_0x79c2('0x2f')]({'where':{'id':_0x2fbe00[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x514b7f,null))['then'](function(_0x2438c3){if(_0x2438c3){return _0x2438c3[_0x79c2('0xac')](_0x2fbe00[_0x79c2('0x3b')][_0x79c2('0x7e')]);}})[_0x79c2('0x24')](function(_0x30525c){if(_0x30525c){return db[_0x79c2('0x61')][_0x79c2('0x32')]({'where':{'ListId':_0x2fbe00[_0x79c2('0x3b')][_0x79c2('0x7e')],'VoiceQueueId':_0x2fbe00[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](function(){return _0x30525c;});}})[_0x79c2('0x24')](respondWithStatusCode(_0x514b7f,null))[_0x79c2('0x56')](handleError(_0x514b7f,null));};exports['getBlackLists']=function(_0x36a01d,_0x204fef,_0x28fdec){var _0x3d1c31={};var _0x1afa09={};var _0x1f4c0a;var _0x182ffb;return db[_0x79c2('0x37')][_0x79c2('0x60')]({'where':{'id':_0x36a01d[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x204fef,null))[_0x79c2('0x24')](function(_0x4793e8){if(_0x4793e8){_0x1f4c0a=_0x4793e8;_0x1afa09['model']=_[_0x79c2('0x3c')](db[_0x79c2('0x95')]['rawAttributes']);_0x1afa09[_0x79c2('0x3b')]=_['keys'](_0x36a01d[_0x79c2('0x3b')]);_0x1afa09[_0x79c2('0x3d')]=_[_0x79c2('0x3e')](_0x1afa09[_0x79c2('0x3a')],_0x1afa09['query']);_0x3d1c31[_0x79c2('0x3f')]=_[_0x79c2('0x3e')](_0x1afa09[_0x79c2('0x3a')],qs[_0x79c2('0x40')](_0x36a01d['query'][_0x79c2('0x40')]));_0x3d1c31['attributes']=_0x3d1c31[_0x79c2('0x3f')][_0x79c2('0x41')]?_0x3d1c31['attributes']:_0x1afa09[_0x79c2('0x3a')];_0x3d1c31[_0x79c2('0x43')]=qs[_0x79c2('0x44')](_0x36a01d[_0x79c2('0x3b')][_0x79c2('0x44')]);_0x3d1c31[_0x79c2('0x45')]=qs[_0x79c2('0x3d')](_[_0x79c2('0x46')](_0x36a01d['query'],_0x1afa09[_0x79c2('0x3d')]));if(_0x36a01d[_0x79c2('0x3b')]['filter']){_0x3d1c31[_0x79c2('0x45')]=_[_0x79c2('0x47')](_0x3d1c31[_0x79c2('0x45')],{'$or':_[_0x79c2('0x2b')](_0x3d1c31[_0x79c2('0x3f')],function(_0x390ff9){var _0x247916={};_0x247916[_0x390ff9]={'$like':'%'+_0x36a01d[_0x79c2('0x3b')]['filter']+'%'};return _0x247916;})});}_0x3d1c31=_[_0x79c2('0x47')]({},_0x3d1c31,_0x36a01d[_0x79c2('0x49')]);return _0x1f4c0a[_0x79c2('0xad')](_0x3d1c31);}})['then'](function(_0x1e0565){if(_0x1e0565){_0x182ffb=_0x1e0565[_0x79c2('0x41')];if(!_0x36a01d[_0x79c2('0x3b')][_0x79c2('0x42')](_0x79c2('0x62'))){_0x3d1c31[_0x79c2('0x1c')]=qs[_0x79c2('0x1c')](_0x36a01d['query'][_0x79c2('0x1c')]);_0x3d1c31['offset']=qs[_0x79c2('0x1a')](_0x36a01d[_0x79c2('0x3b')][_0x79c2('0x1a')]);}return _0x1f4c0a[_0x79c2('0xad')](_0x3d1c31);}})[_0x79c2('0x24')](function(_0x553094){if(_0x553094){return _0x553094?{'count':_0x182ffb,'rows':_0x553094}:null;}})['then'](respondWithResult(_0x204fef,null))[_0x79c2('0x56')](handleError(_0x204fef,null));};exports[_0x79c2('0xae')]=function(_0x7af6b7,_0x191000,_0x116b93){var _0x22ba6e,_0x41a88c;return db[_0x79c2('0x37')][_0x79c2('0x2f')]({'where':{'id':_0x7af6b7[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x191000,null))[_0x79c2('0x24')](function(_0x261e0a){if(_0x261e0a){_0x41a88c=_0x261e0a;return _0x261e0a[_0x79c2('0xae')](_0x7af6b7[_0x79c2('0x5c')]['ids'],_['omit'](_0x7af6b7[_0x79c2('0x5c')],[_0x79c2('0x7e'),'id'])||{});}return null;})[_0x79c2('0xaf')](function(_0x2518fd){var _0x38fbd4;_0x22ba6e=_0x2518fd||[];var _0x30aab6=[];if(_0x2518fd){for(var _0x2be065=0x0;_0x2be065<_0x2518fd[_0x79c2('0x41')];_0x2be065+=0x1){var _0x2edab4=_0x2518fd[_0x2be065][_0x79c2('0x52')]({'plain':!![]});_0x38fbd4=squel[_0x79c2('0xab')]()[_0x79c2('0xa9')](_0x79c2('0xb0'))[_0x79c2('0xaa')]([_0x79c2('0x9e'),_0x79c2('0x9b'),_0x79c2('0x9c'),_0x79c2('0x65'),_0x79c2('0x5a'),_0x79c2('0x5b')],squel['select']()[_0x79c2('0x9d')](_0x79c2('0x9e'),_0x79c2('0x9e'))[_0x79c2('0x9d')]('id','ContactId')[_0x79c2('0x9d')](_0x2edab4[_0x79c2('0xa0')][_0x79c2('0x85')](),_0x79c2('0x9c'))[_0x79c2('0x9d')](_0x7af6b7[_0x79c2('0x58')]['id'][_0x79c2('0x85')](),'VoiceQueueId')[_0x79c2('0x9d')](_0x79c2('0x9f'),_0x79c2('0x5a'))[_0x79c2('0x9d')](_0x79c2('0x9f'),'updatedAt')['from']('cm_contacts')[_0x79c2('0x45')](_0x79c2('0xa2'))[_0x79c2('0x45')](_0x79c2('0xa3'),_0x2edab4['CmListId'][_0x79c2('0x85')]())[_0x79c2('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0x79c2('0x85')]();_0x30aab6[_0x79c2('0x84')](db[_0x79c2('0x73')]['query'](_0x38fbd4));}return BPromise['all'](_0x30aab6);}})['then'](function(){return _0x22ba6e;})['then'](respondWithResult(_0x191000,null))['catch'](handleError(_0x191000,null));};exports[_0x79c2('0xb1')]=function(_0x20e3d0,_0x181c23,_0x51407e){return db[_0x79c2('0x37')]['find']({'where':{'id':_0x20e3d0[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](handleEntityNotFound(_0x181c23,null))['then'](function(_0x414f3f){if(_0x414f3f){return _0x414f3f[_0x79c2('0xb1')](_0x20e3d0[_0x79c2('0x3b')]['ids']);}})[_0x79c2('0x24')](function(_0x2628a0){if(_0x2628a0){return db[_0x79c2('0x69')][_0x79c2('0x32')]({'where':{'ListId':_0x20e3d0[_0x79c2('0x3b')][_0x79c2('0x7e')],'VoiceQueueId':_0x20e3d0[_0x79c2('0x58')]['id']}})[_0x79c2('0x24')](function(){return _0x2628a0;});}})[_0x79c2('0x24')](respondWithStatusCode(_0x181c23,null))[_0x79c2('0x56')](handleError(_0x181c23,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 8198298..c631481 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 _0xa793=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0xca8fb1,_0x461bba){var _0xc1ef8=function(_0xf27010){while(--_0xf27010){_0xca8fb1['push'](_0xca8fb1['shift']());}};_0xc1ef8(++_0x461bba);}(_0xa793,0x1a8));var _0x3a79=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0xa793[_0x2e6dbf];return _0x2680e5;};'use strict';var EventEmitter=require(_0x3a79('0x0'));var VoiceQueue=require(_0x3a79('0x1'))['db'][_0x3a79('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3a79('0x3')](0x0);var events={'afterCreate':_0x3a79('0x4'),'afterUpdate':_0x3a79('0x5'),'afterDestroy':_0x3a79('0x6')};function emitEvent(_0x1eea22){return function(_0x17c638,_0x2481fb,_0x3bf38b){VoiceQueueEvents[_0x3a79('0x7')](_0x1eea22+':'+_0x17c638['id'],_0x17c638);VoiceQueueEvents[_0x3a79('0x7')](_0x1eea22,_0x17c638);_0x3bf38b(null);};}for(var e in events){if(events[_0x3a79('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x3a79('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x8507=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x771ae0,_0x5181d6){var _0xa6a18b=function(_0x4dac27){while(--_0x4dac27){_0x771ae0['push'](_0x771ae0['shift']());}};_0xa6a18b(++_0x5181d6);}(_0x8507,0x1e2));var _0x7850=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8507[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x7850('0x0'));var VoiceQueue=require(_0x7850('0x1'))['db'][_0x7850('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7850('0x3')](0x0);var events={'afterCreate':_0x7850('0x4'),'afterUpdate':_0x7850('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c600c){return function(_0x23a11f,_0xdd8ad5,_0x39958e){VoiceQueueEvents['emit'](_0x4c600c+':'+_0x23a11f['id'],_0x23a11f);VoiceQueueEvents[_0x7850('0x6')](_0x4c600c,_0x23a11f);_0x39958e(null);};}for(var e in events){if(events[_0x7850('0x7')](e)){var event=events[e];VoiceQueue[_0x7850('0x8')](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 00ee475..633bfe3 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2cddee,_0x4abb1f){var _0x437838=function(_0x37ad8a){while(--_0x37ad8a){_0x2cddee['push'](_0x2cddee['shift']());}};_0x437838(++_0x4abb1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x335191,_0x249599){var _0x50e07d=function(_0x4084d6){while(--_0x4084d6){_0x335191['push'](_0x335191['shift']());}};_0x50e07d(++_0x249599);}(_0xedd9,0xfc));var _0x9edd=function(_0x5b1592,_0x21e925){_0x5b1592=_0x5b1592-0x0;var _0x1b36cd=_0xedd9[_0x5b1592];return _0x1b36cd;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 8d18486..85e185b 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 _0x6a14=['catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','ShowVoiceQueue','where','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','request','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x33a287,_0x529498){var _0x57cf0b=function(_0x30ccf9){while(--_0x30ccf9){_0x33a287['push'](_0x33a287['shift']());}};_0x57cf0b(++_0x529498);}(_0x6a14,0xc8));var _0x46a1=function(_0x58f0df,_0x192cfa){_0x58f0df=_0x58f0df-0x0;var _0x38de0c=_0x6a14[_0x58f0df];return _0x38de0c;};'use strict';var _=require('lodash');var util=require(_0x46a1('0x0'));var moment=require(_0x46a1('0x1'));var BPromise=require(_0x46a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46a1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46a1('0x4'))(_0x46a1('0x5'));var config=require(_0x46a1('0x6'));var jayson=require(_0x46a1('0x7'));var client=jayson[_0x46a1('0x8')][_0x46a1('0x9')]({'port':0x232a});config[_0x46a1('0xa')]=_[_0x46a1('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5863cf,_0xd64900,_0xde3296){return new BPromise(function(_0x5d8a59,_0x1ae4c3){return client[_0x46a1('0xc')](_0x5863cf,_0xde3296)[_0x46a1('0xd')](function(_0x14945d){logger[_0x46a1('0xe')](_0x46a1('0xf'),_0xd64900,'request\x20sent');logger['debug'](_0x46a1('0x10'),_0xd64900,_0x46a1('0x11'),JSON['stringify'](_0x14945d));if(_0x14945d[_0x46a1('0x12')]){if(_0x14945d['error'][_0x46a1('0x13')]===0x1f4){logger[_0x46a1('0x12')](_0x46a1('0xf'),_0xd64900,_0x14945d[_0x46a1('0x12')][_0x46a1('0x14')]);return _0x1ae4c3(_0x14945d[_0x46a1('0x12')][_0x46a1('0x14')]);}logger['error'](_0x46a1('0xf'),_0xd64900,_0x14945d[_0x46a1('0x12')][_0x46a1('0x14')]);return _0x5d8a59(_0x14945d[_0x46a1('0x12')][_0x46a1('0x14')]);}else{logger[_0x46a1('0xe')](_0x46a1('0xf'),_0xd64900,'request\x20sent');_0x5d8a59(_0x14945d[_0x46a1('0x15')][_0x46a1('0x14')]);}})[_0x46a1('0x16')](function(_0x1024ad){logger[_0x46a1('0x12')]('VoiceQueue,\x20%s,\x20%s',_0xd64900,_0x1024ad);_0x1ae4c3(_0x1024ad);});});}exports[_0x46a1('0x17')]=function(_0x3fd40c){var _0x8c1854=this;return new Promise(function(_0x4f5b59,_0x4205ac){return db[_0x46a1('0x18')][_0x46a1('0x19')]({'raw':_0x3fd40c[_0x46a1('0x1a')]?_0x3fd40c[_0x46a1('0x1a')][_0x46a1('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fd40c[_0x46a1('0x1a')]?_0x3fd40c['options']['where']||null:null,'attributes':_0x3fd40c[_0x46a1('0x1a')]?_0x3fd40c[_0x46a1('0x1a')][_0x46a1('0x1c')]||null:null,'limit':_0x3fd40c[_0x46a1('0x1a')]?_0x3fd40c['options'][_0x46a1('0x1d')]||null:null,'include':_0x3fd40c['options']?_0x3fd40c[_0x46a1('0x1a')][_0x46a1('0x1e')]?_[_0x46a1('0x1f')](_0x3fd40c[_0x46a1('0x1a')]['include'],function(_0xa03b8c){return{'model':db[_0xa03b8c[_0x46a1('0x20')]],'as':_0xa03b8c['as'],'attributes':_0xa03b8c[_0x46a1('0x1c')],'include':_0xa03b8c[_0x46a1('0x1e')]?_[_0x46a1('0x1f')](_0xa03b8c[_0x46a1('0x1e')],function(_0x10fe0c){return{'model':db[_0x10fe0c['model']],'as':_0x10fe0c['as'],'attributes':_0x10fe0c[_0x46a1('0x1c')],'include':_0x10fe0c[_0x46a1('0x1e')]?_[_0x46a1('0x1f')](_0x10fe0c[_0x46a1('0x1e')],function(_0x2e6d0a){return{'model':db[_0x2e6d0a[_0x46a1('0x20')]],'as':_0x2e6d0a['as'],'attributes':_0x2e6d0a['attributes']};}):[]};}):[]};}):[]:[]})[_0x46a1('0xd')](function(_0x4ac54e){logger[_0x46a1('0xe')]('GetVoiceQueue',_0x3fd40c);logger[_0x46a1('0x21')](_0x46a1('0x17'),_0x3fd40c,JSON[_0x46a1('0x22')](_0x4ac54e));_0x4f5b59(_0x4ac54e);})[_0x46a1('0x16')](function(_0x5ee7bb){logger[_0x46a1('0x12')](_0x46a1('0x17'),_0x5ee7bb[_0x46a1('0x14')],_0x3fd40c);_0x4205ac(_0x8c1854[_0x46a1('0x12')](0x1f4,_0x5ee7bb[_0x46a1('0x14')]));});});};exports[_0x46a1('0x23')]=function(_0x252026){var _0xe2e279=this;return new Promise(function(_0x684b14,_0x4158ab){return db[_0x46a1('0x18')]['find']({'raw':_0x252026[_0x46a1('0x1a')]?_0x252026[_0x46a1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x252026[_0x46a1('0x1a')]?_0x252026[_0x46a1('0x1a')][_0x46a1('0x24')]||null:null,'attributes':_0x252026[_0x46a1('0x1a')]?_0x252026[_0x46a1('0x1a')][_0x46a1('0x1c')]||null:null,'include':_0x252026[_0x46a1('0x1a')]?_0x252026['options'][_0x46a1('0x1e')]?_[_0x46a1('0x1f')](_0x252026['options']['include'],function(_0xc14a2c){return{'model':db[_0xc14a2c[_0x46a1('0x20')]],'as':_0xc14a2c['as'],'attributes':_0xc14a2c[_0x46a1('0x1c')],'include':_0xc14a2c[_0x46a1('0x1e')]?_['map'](_0xc14a2c['include'],function(_0x180a9c){return{'model':db[_0x180a9c[_0x46a1('0x20')]],'as':_0x180a9c['as'],'attributes':_0x180a9c[_0x46a1('0x1c')],'include':_0x180a9c[_0x46a1('0x1e')]?_['map'](_0x180a9c['include'],function(_0x16b0ba){return{'model':db[_0x16b0ba[_0x46a1('0x20')]],'as':_0x16b0ba['as'],'attributes':_0x16b0ba[_0x46a1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x46a1('0xd')](function(_0x49235d){logger[_0x46a1('0xe')](_0x46a1('0x23'),_0x252026);logger[_0x46a1('0x21')](_0x46a1('0x23'),_0x252026,JSON[_0x46a1('0x22')](_0x49235d));_0x684b14(_0x49235d);})[_0x46a1('0x16')](function(_0x5a332e){logger[_0x46a1('0x12')](_0x46a1('0x23'),_0x5a332e['message'],_0x252026);_0x4158ab(_0xe2e279[_0x46a1('0x12')](0x1f4,_0x5a332e[_0x46a1('0x14')]));});});}; \ No newline at end of file +var _0x0d8b=['../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','info','ShowVoiceQueue','find','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x0d8b,0x1dc));var _0xb0d8=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x0d8b[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0xb0d8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0d8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0d8('0x2'))['db'];var utils=require(_0xb0d8('0x3'));var logger=require(_0xb0d8('0x4'))('rpc');var config=require(_0xb0d8('0x5'));var jayson=require(_0xb0d8('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xb0d8('0x7')]=_[_0xb0d8('0x8')](config[_0xb0d8('0x7')],{'host':_0xb0d8('0x9'),'port':0x18eb});var socket=require(_0xb0d8('0xa'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0xb0d8('0xb')](socket);function respondWithRpcPromise(_0x4fb68b,_0x26076,_0x2c5863){return new BPromise(function(_0x17dfaa,_0x24a5ff){return client[_0xb0d8('0xc')](_0x4fb68b,_0x2c5863)[_0xb0d8('0xd')](function(_0x3d7006){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x26076,_0xb0d8('0xe'));logger[_0xb0d8('0xf')](_0xb0d8('0x10'),_0x26076,'request\x20sent',JSON[_0xb0d8('0x11')](_0x3d7006));if(_0x3d7006[_0xb0d8('0x12')]){if(_0x3d7006[_0xb0d8('0x12')][_0xb0d8('0x13')]===0x1f4){logger['error'](_0xb0d8('0x14'),_0x26076,_0x3d7006['error'][_0xb0d8('0x15')]);return _0x24a5ff(_0x3d7006[_0xb0d8('0x12')][_0xb0d8('0x15')]);}logger[_0xb0d8('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x26076,_0x3d7006['error'][_0xb0d8('0x15')]);return _0x17dfaa(_0x3d7006['error'][_0xb0d8('0x15')]);}else{logger['info'](_0xb0d8('0x14'),_0x26076,_0xb0d8('0xe'));_0x17dfaa(_0x3d7006[_0xb0d8('0x16')][_0xb0d8('0x15')]);}})[_0xb0d8('0x17')](function(_0x3bac3b){logger[_0xb0d8('0x12')](_0xb0d8('0x14'),_0x26076,_0x3bac3b);_0x24a5ff(_0x3bac3b);});});}exports[_0xb0d8('0x18')]=function(_0x791831){var _0x4984d0=this;return new Promise(function(_0x5be267,_0x38beea){return db[_0xb0d8('0x19')]['findAll']({'raw':_0x791831[_0xb0d8('0x1a')]?_0x791831[_0xb0d8('0x1a')][_0xb0d8('0x1b')]===undefined?!![]:![]:!![],'where':_0x791831[_0xb0d8('0x1a')]?_0x791831[_0xb0d8('0x1a')][_0xb0d8('0x1c')]||null:null,'attributes':_0x791831[_0xb0d8('0x1a')]?_0x791831['options'][_0xb0d8('0x1d')]||null:null,'limit':_0x791831[_0xb0d8('0x1a')]?_0x791831[_0xb0d8('0x1a')][_0xb0d8('0x1e')]||null:null,'include':_0x791831[_0xb0d8('0x1a')]?_0x791831[_0xb0d8('0x1a')][_0xb0d8('0x1f')]?_[_0xb0d8('0x20')](_0x791831[_0xb0d8('0x1a')][_0xb0d8('0x1f')],function(_0x2a4708){return{'model':db[_0x2a4708['model']],'as':_0x2a4708['as'],'attributes':_0x2a4708[_0xb0d8('0x1d')],'include':_0x2a4708[_0xb0d8('0x1f')]?_[_0xb0d8('0x20')](_0x2a4708[_0xb0d8('0x1f')],function(_0x814cf9){return{'model':db[_0x814cf9['model']],'as':_0x814cf9['as'],'attributes':_0x814cf9[_0xb0d8('0x1d')],'include':_0x814cf9[_0xb0d8('0x1f')]?_[_0xb0d8('0x20')](_0x814cf9[_0xb0d8('0x1f')],function(_0x409cda){return{'model':db[_0x409cda[_0xb0d8('0x21')]],'as':_0x409cda['as'],'attributes':_0x409cda[_0xb0d8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c897b){logger[_0xb0d8('0x22')](_0xb0d8('0x18'),_0x791831);logger[_0xb0d8('0xf')](_0xb0d8('0x18'),_0x791831,JSON[_0xb0d8('0x11')](_0x5c897b));_0x5be267(_0x5c897b);})[_0xb0d8('0x17')](function(_0x449d29){logger['error'](_0xb0d8('0x18'),_0x449d29[_0xb0d8('0x15')],_0x791831);_0x38beea(_0x4984d0[_0xb0d8('0x12')](0x1f4,_0x449d29[_0xb0d8('0x15')]));});});};exports[_0xb0d8('0x23')]=function(_0x437fb2){var _0x2c4467=this;return new Promise(function(_0x3fcb59,_0x214bcb){return db[_0xb0d8('0x19')][_0xb0d8('0x24')]({'raw':_0x437fb2['options']?_0x437fb2[_0xb0d8('0x1a')][_0xb0d8('0x1b')]===undefined?!![]:![]:!![],'where':_0x437fb2[_0xb0d8('0x1a')]?_0x437fb2[_0xb0d8('0x1a')][_0xb0d8('0x1c')]||null:null,'attributes':_0x437fb2[_0xb0d8('0x1a')]?_0x437fb2[_0xb0d8('0x1a')][_0xb0d8('0x1d')]||null:null,'include':_0x437fb2[_0xb0d8('0x1a')]?_0x437fb2[_0xb0d8('0x1a')][_0xb0d8('0x1f')]?_[_0xb0d8('0x20')](_0x437fb2[_0xb0d8('0x1a')][_0xb0d8('0x1f')],function(_0x3fd203){return{'model':db[_0x3fd203[_0xb0d8('0x21')]],'as':_0x3fd203['as'],'attributes':_0x3fd203[_0xb0d8('0x1d')],'include':_0x3fd203[_0xb0d8('0x1f')]?_[_0xb0d8('0x20')](_0x3fd203[_0xb0d8('0x1f')],function(_0x2ac8e5){return{'model':db[_0x2ac8e5[_0xb0d8('0x21')]],'as':_0x2ac8e5['as'],'attributes':_0x2ac8e5['attributes'],'include':_0x2ac8e5[_0xb0d8('0x1f')]?_[_0xb0d8('0x20')](_0x2ac8e5[_0xb0d8('0x1f')],function(_0x530f26){return{'model':db[_0x530f26[_0xb0d8('0x21')]],'as':_0x530f26['as'],'attributes':_0x530f26[_0xb0d8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb0d8('0xd')](function(_0x54ac75){logger[_0xb0d8('0x22')](_0xb0d8('0x23'),_0x437fb2);logger[_0xb0d8('0xf')](_0xb0d8('0x23'),_0x437fb2,JSON[_0xb0d8('0x11')](_0x54ac75));_0x3fcb59(_0x54ac75);})[_0xb0d8('0x17')](function(_0x278c06){logger[_0xb0d8('0x12')](_0xb0d8('0x23'),_0x278c06[_0xb0d8('0x15')],_0x437fb2);_0x214bcb(_0x2c4467[_0xb0d8('0x12')](0x1f4,_0x278c06[_0xb0d8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 2041a07..c1e2bc9 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 _0x9eb5=['remove','update','emit','register','voiceQueue:','./voiceQueue.events','save'];(function(_0x2f6be5,_0x2281c8){var _0x4e2a41=function(_0x455d0c){while(--_0x455d0c){_0x2f6be5['push'](_0x2f6be5['shift']());}};_0x4e2a41(++_0x2281c8);}(_0x9eb5,0x1cc));var _0x59eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9eb5[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceQueueEvents=require(_0x59eb('0x0'));var events=[_0x59eb('0x1'),_0x59eb('0x2'),_0x59eb('0x3')];function createListener(_0x3901c2,_0x30ca29){return function(_0x58e531){_0x30ca29[_0x59eb('0x4')](_0x3901c2,_0x58e531);};}function removeListener(_0x1c77d4,_0x3f425b){return function(){VoiceQueueEvents['removeListener'](_0x1c77d4,_0x3f425b);};}exports[_0x59eb('0x5')]=function(_0xff591a){for(var _0x165b32=0x0,_0x3f59d7=events['length'];_0x165b32<_0x3f59d7;_0x165b32++){var _0x1f790e=events[_0x165b32];var _0x287573=createListener(_0x59eb('0x6')+_0x1f790e,_0xff591a);VoiceQueueEvents['on'](_0x1f790e,_0x287573);}}; \ No newline at end of file +var _0x2cbd=['removeListener','length','voiceQueue:','save','remove','update'];(function(_0x2f34a7,_0x37d3a0){var _0x559266=function(_0x23e711){while(--_0x23e711){_0x2f34a7['push'](_0x2f34a7['shift']());}};_0x559266(++_0x37d3a0);}(_0x2cbd,0x123));var _0xd2cb=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0x2cbd[_0x1526e1];return _0x249a1e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xd2cb('0x0'),_0xd2cb('0x1'),_0xd2cb('0x2')];function createListener(_0x2323c4,_0x5ab705){return function(_0x5e0387){_0x5ab705['emit'](_0x2323c4,_0x5e0387);};}function removeListener(_0x75248c,_0x4f3e8e){return function(){VoiceQueueEvents[_0xd2cb('0x3')](_0x75248c,_0x4f3e8e);};}exports['register']=function(_0x2d6e5f){for(var _0x280b2d=0x0,_0x28ceee=events[_0xd2cb('0x4')];_0x280b2d<_0x28ceee;_0x280b2d++){var _0x33135b=events[_0x280b2d];var _0x1eb502=createListener(_0xd2cb('0x5')+_0x33135b,_0x2d6e5f);VoiceQueueEvents['on'](_0x33135b,_0x1eb502);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 8c4eeea..c975e6b 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 _0xb49b=['/index','getVoiceQueuesReport','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe'];(function(_0x22b6f6,_0x5ef2b4){var _0x11a407=function(_0x1ab284){while(--_0x1ab284){_0x22b6f6['push'](_0x22b6f6['shift']());}};_0x11a407(++_0x5ef2b4);}(_0xb49b,0x81));var _0xbb49=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb49b[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xbb49('0x0'));var util=require(_0xbb49('0x1'));var path=require(_0xbb49('0x2'));var timeout=require(_0xbb49('0x3'));var express=require(_0xbb49('0x4'));var router=express['Router']();var fs_extra=require(_0xbb49('0x5'));var auth=require(_0xbb49('0x6'));var interaction=require(_0xbb49('0x7'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xbb49('0x8')]('/',auth[_0xbb49('0x9')](),controller['index']);router[_0xbb49('0x8')](_0xbb49('0xa'),auth[_0xbb49('0x9')](),controller['describe']);router[_0xbb49('0x8')](_0xbb49('0xb'),auth['isAuthenticated'](),controller[_0xbb49('0xc')]);router[_0xbb49('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbb49('0xd')]('/',auth[_0xbb49('0x9')](),controller[_0xbb49('0xe')]);router[_0xbb49('0xf')](_0xbb49('0x10'),auth['isAuthenticated'](),controller[_0xbb49('0x11')]);router[_0xbb49('0x12')]('/:id',auth[_0xbb49('0x9')](),controller[_0xbb49('0x13')]);module['exports']=router; \ No newline at end of file +var _0x328d=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','/:id','update','delete','destroy','multer','util','path'];(function(_0x4b9138,_0x158b7d){var _0x3d7360=function(_0x11f987){while(--_0x11f987){_0x4b9138['push'](_0x4b9138['shift']());}};_0x3d7360(++_0x158b7d);}(_0x328d,0xbb));var _0xd328=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x328d[_0x341e0f];return _0x59555a;};'use strict';var multer=require(_0xd328('0x0'));var util=require(_0xd328('0x1'));var path=require(_0xd328('0x2'));var timeout=require('connect-timeout');var express=require(_0xd328('0x3'));var router=express[_0xd328('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd328('0x5'));var interaction=require(_0xd328('0x6'));var config=require(_0xd328('0x7'));var controller=require(_0xd328('0x8'));router[_0xd328('0x9')]('/',auth[_0xd328('0xa')](),controller[_0xd328('0xb')]);router[_0xd328('0x9')](_0xd328('0xc'),auth['isAuthenticated'](),controller[_0xd328('0xd')]);router[_0xd328('0x9')]('/index',auth[_0xd328('0xa')](),controller[_0xd328('0xe')]);router[_0xd328('0x9')](_0xd328('0xf'),auth[_0xd328('0xa')](),controller['show']);router['post']('/',auth[_0xd328('0xa')](),controller['create']);router['put'](_0xd328('0xf'),auth[_0xd328('0xa')](),controller[_0xd328('0x10')]);router[_0xd328('0x11')](_0xd328('0xf'),auth[_0xd328('0xa')](),controller[_0xd328('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index f6eae24..4c2f7f2 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 _0x46c9=['DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x46c9,0xfc));var _0x946c=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x46c9[_0x13cab0];return _0x38804f;};'use strict';var Sequelize=require(_0x946c('0x0'));var moment=require(_0x946c('0x1'));module[_0x946c('0x2')]={'type':{'type':Sequelize[_0x946c('0x3')]},'uniqueid':{'type':Sequelize[_0x946c('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x946c('0x3')]},'queue':{'type':Sequelize[_0x946c('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x946c('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x946c('0x4')],'set':function(_0x8b9068){var _0x492673=moment(_0x8b9068);var _0x42d098=moment(this['getDataValue'](_0x946c('0x5')))[_0x946c('0x6')](_0x946c('0x7'));var _0x6f9f77=_0x492673[_0x946c('0x8')](_0x42d098,'seconds');this[_0x946c('0x9')](_0x946c('0xa'),_0x8b9068);this[_0x946c('0x9')](_0x946c('0xb'),_0x6f9f77||null);}},'position':{'type':Sequelize[_0x946c('0xc')]},'count':{'type':Sequelize[_0x946c('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x946c('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x946c('0x4')]},'queuecallerexit':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x946c('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x946c('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x946c('0x3')]},'connectedlinenum':{'type':Sequelize[_0x946c('0x3')]},'connectedlinename':{'type':Sequelize[_0x946c('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x946c('0x3')]},'exten':{'type':Sequelize[_0x946c('0x3')]},'priority':{'type':Sequelize[_0x946c('0x3')]},'holdtime':{'type':Sequelize[_0x946c('0xc')]},'mohtime':{'type':Sequelize[_0x946c('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x946c('0x3')]},'transfer':{'type':Sequelize[_0x946c('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x946c('0x3')],'comment':_0x946c('0xf')},'transferexten':{'type':Sequelize[_0x946c('0x3')]},'transferuniqueid':{'type':Sequelize[_0x946c('0x3')]},'disposition':{'type':Sequelize[_0x946c('0x3')]},'secondDisposition':{'type':Sequelize[_0x946c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x946c('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfb90=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment','exports','STRING','DATE','queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x5eac33,_0x126183){var _0x5a5f17=function(_0x292781){while(--_0x292781){_0x5eac33['push'](_0x5eac33['shift']());}};_0x5a5f17(++_0x126183);}(_0xfb90,0x136));var _0x0fb9=function(_0x2b41e8,_0x86e285){_0x2b41e8=_0x2b41e8-0x0;var _0x396ab3=_0xfb90[_0x2b41e8];return _0x396ab3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0fb9('0x0'));module[_0x0fb9('0x1')]={'type':{'type':Sequelize[_0x0fb9('0x2')]},'uniqueid':{'type':Sequelize[_0x0fb9('0x2')]},'calleridnum':{'type':Sequelize[_0x0fb9('0x2')]},'calleridname':{'type':Sequelize[_0x0fb9('0x2')]},'queue':{'type':Sequelize[_0x0fb9('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x0fb9('0x3')],'set':function(_0x5b4ad8){var _0x4389ea=moment(_0x5b4ad8);var _0x3dd3f6=moment(this['getDataValue'](_0x0fb9('0x4')))[_0x0fb9('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4dbb35=_0x4389ea[_0x0fb9('0x6')](_0x3dd3f6,_0x0fb9('0x7'));this[_0x0fb9('0x8')](_0x0fb9('0x9'),_0x5b4ad8);this[_0x0fb9('0x8')](_0x0fb9('0xa'),_0x4dbb35||null);}},'position':{'type':Sequelize[_0x0fb9('0xb')]},'count':{'type':Sequelize[_0x0fb9('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x0fb9('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x0fb9('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x0fb9('0x3')]},'queuecallerexit':{'type':Sequelize[_0x0fb9('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x0fb9('0x2')],'comment':_0x0fb9('0xd')},'originalposition':{'type':Sequelize[_0x0fb9('0xb')]},'channel':{'type':Sequelize[_0x0fb9('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0fb9('0x2')]},'connectedlinename':{'type':Sequelize[_0x0fb9('0x2')]},'accountcode':{'type':Sequelize[_0x0fb9('0x2')]},'context':{'type':Sequelize[_0x0fb9('0x2')]},'exten':{'type':Sequelize[_0x0fb9('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x0fb9('0xb')]},'mohtime':{'type':Sequelize[_0x0fb9('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0fb9('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x0fb9('0x2')]},'transfer':{'type':Sequelize[_0x0fb9('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0fb9('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x0fb9('0x2')]},'secondDisposition':{'type':Sequelize[_0x0fb9('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0fb9('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x0fb9('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 2640e1d..1f00f97 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 _0xbb54=['stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','nolimit','options','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','end'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbb54,0x1bb));var _0x4bb5=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0xbb54[_0x36d203];return _0x2f9e62;};'use strict';var emlformat=require(_0x4bb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4bb5('0x1'));var jsonpatch=require(_0x4bb5('0x2'));var rp=require(_0x4bb5('0x3'));var moment=require(_0x4bb5('0x4'));var BPromise=require(_0x4bb5('0x5'));var Mustache=require('mustache');var util=require(_0x4bb5('0x6'));var path=require('path');var sox=require(_0x4bb5('0x7'));var csv=require(_0x4bb5('0x8'));var ejs=require(_0x4bb5('0x9'));var fs=require('fs');var fs_extra=require(_0x4bb5('0xa'));var _=require(_0x4bb5('0xb'));var squel=require('squel');var crypto=require(_0x4bb5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4bb5('0xd'));var toCsv=require(_0x4bb5('0x8'));var querystring=require(_0x4bb5('0xe'));var Papa=require(_0x4bb5('0xf'));var Redis=require('ioredis');var authService=require(_0x4bb5('0x10'));var qs=require(_0x4bb5('0x11'));var as=require(_0x4bb5('0x12'));var hardwareService=require(_0x4bb5('0x13'));var logger=require('../../config/logger')(_0x4bb5('0x14'));var utils=require(_0x4bb5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4bb5('0x16'));var db=require(_0x4bb5('0x17'))['db'];config['redis']=_[_0x4bb5('0x18')](config[_0x4bb5('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4bb5('0x1a'))(new Redis(config[_0x4bb5('0x19')]));require('./voiceQueueReport.socket')[_0x4bb5('0x1b')](socket);function respondWithStatusCode(_0x206670,_0x3cd558){_0x3cd558=_0x3cd558||0xcc;return function(_0x3d5500){if(_0x3d5500){return _0x206670[_0x4bb5('0x1c')](_0x3cd558);}return _0x206670[_0x4bb5('0x1d')](_0x3cd558)['end']();};}function respondWithResult(_0x277d8a,_0xe0e683){_0xe0e683=_0xe0e683||0xc8;return function(_0x9be978){if(_0x9be978){return _0x277d8a['status'](_0xe0e683)[_0x4bb5('0x1e')](_0x9be978);}};}function respondWithFilteredResult(_0x2d0caa,_0x52c5e8){return function(_0x32e888){if(_0x32e888){var _0x5e1846=typeof _0x52c5e8['offset']===_0x4bb5('0x1f')&&typeof _0x52c5e8[_0x4bb5('0x20')]===_0x4bb5('0x1f');var _0x33fb60=_0x32e888[_0x4bb5('0x21')];var _0x277b52=_0x5e1846?0x0:_0x52c5e8[_0x4bb5('0x22')];var _0x385071=_0x5e1846?_0x32e888[_0x4bb5('0x21')]:_0x52c5e8[_0x4bb5('0x22')]+_0x52c5e8[_0x4bb5('0x20')];var _0x77462b;if(_0x385071>=_0x33fb60){_0x385071=_0x33fb60;_0x77462b=0xc8;}else{_0x77462b=0xce;}_0x2d0caa['status'](_0x77462b);return _0x2d0caa[_0x4bb5('0x23')]('Content-Range',_0x277b52+'-'+_0x385071+'/'+_0x33fb60)['json'](_0x32e888);}return null;};}function patchUpdates(_0x469739){return function(_0x1615e4){try{jsonpatch[_0x4bb5('0x24')](_0x1615e4,_0x469739,!![]);}catch(_0x2ea123){return BPromise[_0x4bb5('0x25')](_0x2ea123);}return _0x1615e4[_0x4bb5('0x26')]();};}function saveUpdates(_0x1a172f,_0x187624){return function(_0x40fd06){if(_0x40fd06){return _0x40fd06[_0x4bb5('0x27')](_0x1a172f)['then'](function(_0x1f7543){return _0x1f7543;});}return null;};}function removeEntity(_0x545365,_0x426d87){return function(_0x5682c1){if(_0x5682c1){return _0x5682c1[_0x4bb5('0x28')]()[_0x4bb5('0x29')](function(){_0x545365[_0x4bb5('0x1d')](0xcc)[_0x4bb5('0x2a')]();});}};}function handleEntityNotFound(_0x221d5e,_0x5f4bac){return function(_0x2f40df){if(!_0x2f40df){_0x221d5e['sendStatus'](0x194);}return _0x2f40df;};}function handleError(_0x2e08fd,_0x3c2f78){_0x3c2f78=_0x3c2f78||0x1f4;return function(_0x5d4279){logger['error'](_0x5d4279[_0x4bb5('0x2b')]);if(_0x5d4279[_0x4bb5('0x2c')]){delete _0x5d4279[_0x4bb5('0x2c')];}_0x2e08fd['status'](_0x3c2f78)['send'](_0x5d4279);};}exports[_0x4bb5('0x2d')]=function(_0x3560f3,_0x2d441b){var _0x494c3b={},_0x38ca0e={},_0x48b093={'count':0x0,'rows':[]};var _0x2e2ffb=_[_0x4bb5('0x2e')](db[_0x4bb5('0x2f')][_0x4bb5('0x30')],function(_0x63e55e){return{'name':_0x63e55e[_0x4bb5('0x31')],'type':_0x63e55e[_0x4bb5('0x32')][_0x4bb5('0x33')]};});_0x38ca0e[_0x4bb5('0x34')]=_[_0x4bb5('0x2e')](_0x2e2ffb,_0x4bb5('0x2c'));_0x38ca0e['query']=_[_0x4bb5('0x35')](_0x3560f3[_0x4bb5('0x36')]);_0x38ca0e[_0x4bb5('0x37')]=_[_0x4bb5('0x38')](_0x38ca0e[_0x4bb5('0x34')],_0x38ca0e[_0x4bb5('0x36')]);_0x494c3b[_0x4bb5('0x39')]=_[_0x4bb5('0x38')](_0x38ca0e['model'],qs[_0x4bb5('0x3a')](_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x3a')]));_0x494c3b[_0x4bb5('0x39')]=_0x494c3b['attributes'][_0x4bb5('0x3b')]?_0x494c3b['attributes']:_0x38ca0e['model'];if(!_0x3560f3['query'][_0x4bb5('0x3c')]('nolimit')){_0x494c3b[_0x4bb5('0x20')]=qs['limit'](_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x20')]);_0x494c3b[_0x4bb5('0x22')]=qs[_0x4bb5('0x22')](_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x22')]);}_0x494c3b[_0x4bb5('0x3d')]=qs[_0x4bb5('0x3e')](_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x3e')]);_0x494c3b[_0x4bb5('0x3f')]=qs[_0x4bb5('0x37')](_[_0x4bb5('0x40')](_0x3560f3[_0x4bb5('0x36')],_0x38ca0e[_0x4bb5('0x37')]),_0x2e2ffb);if(_0x3560f3[_0x4bb5('0x36')]['filter']){_0x494c3b[_0x4bb5('0x3f')]=_[_0x4bb5('0x41')](_0x494c3b[_0x4bb5('0x3f')],{'$or':_[_0x4bb5('0x2e')](_0x2e2ffb,function(_0x15e7d1){if(_0x15e7d1[_0x4bb5('0x32')]!=='VIRTUAL'){var _0x3e0855={};_0x3e0855[_0x15e7d1[_0x4bb5('0x2c')]]={'$like':'%'+_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x42')]+'%'};return _0x3e0855;}})});}_0x494c3b=_[_0x4bb5('0x41')]({},_0x494c3b,_0x3560f3['options']);var _0x42c1ef={'where':_0x494c3b['where']};return db[_0x4bb5('0x2f')][_0x4bb5('0x21')](_0x42c1ef)[_0x4bb5('0x29')](function(_0x1b664d){_0x48b093[_0x4bb5('0x21')]=_0x1b664d;if(_0x3560f3[_0x4bb5('0x36')][_0x4bb5('0x43')]){_0x494c3b[_0x4bb5('0x44')]=[{'all':!![]}];}return db[_0x4bb5('0x2f')][_0x4bb5('0x45')](_0x494c3b);})['then'](function(_0x55f213){_0x48b093[_0x4bb5('0x46')]=_0x55f213;return _0x48b093;})[_0x4bb5('0x29')](respondWithFilteredResult(_0x2d441b,_0x494c3b))[_0x4bb5('0x47')](handleError(_0x2d441b,null));};exports[_0x4bb5('0x48')]=function(_0x5932b7,_0x2a84fa){var _0x572fc7={'raw':![],'where':{'id':_0x5932b7[_0x4bb5('0x49')]['id']}},_0x39c592={};_0x39c592[_0x4bb5('0x34')]=_[_0x4bb5('0x35')](db[_0x4bb5('0x2f')][_0x4bb5('0x30')]);_0x39c592[_0x4bb5('0x36')]=_[_0x4bb5('0x35')](_0x5932b7[_0x4bb5('0x36')]);_0x39c592[_0x4bb5('0x37')]=_[_0x4bb5('0x38')](_0x39c592[_0x4bb5('0x34')],_0x39c592[_0x4bb5('0x36')]);_0x572fc7[_0x4bb5('0x39')]=_[_0x4bb5('0x38')](_0x39c592[_0x4bb5('0x34')],qs[_0x4bb5('0x3a')](_0x5932b7['query'][_0x4bb5('0x3a')]));_0x572fc7[_0x4bb5('0x39')]=_0x572fc7[_0x4bb5('0x39')][_0x4bb5('0x3b')]?_0x572fc7[_0x4bb5('0x39')]:_0x39c592[_0x4bb5('0x34')];if(_0x5932b7[_0x4bb5('0x36')][_0x4bb5('0x43')]){_0x572fc7[_0x4bb5('0x44')]=[{'all':!![]}];}_0x572fc7=_[_0x4bb5('0x41')]({},_0x572fc7,_0x5932b7['options']);return db[_0x4bb5('0x2f')][_0x4bb5('0x4a')](_0x572fc7)[_0x4bb5('0x29')](handleEntityNotFound(_0x2a84fa,null))['then'](respondWithResult(_0x2a84fa,null))['catch'](handleError(_0x2a84fa,null));};exports[_0x4bb5('0x4b')]=function(_0x1eb3ee,_0x4cf340){return db['VoiceQueueReport'][_0x4bb5('0x4b')](_0x1eb3ee[_0x4bb5('0x4c')],{})[_0x4bb5('0x29')](respondWithResult(_0x4cf340,0xc9))[_0x4bb5('0x47')](handleError(_0x4cf340,null));};exports[_0x4bb5('0x27')]=function(_0x3dcf9c,_0xe190dd){if(_0x3dcf9c[_0x4bb5('0x4c')]['id']){delete _0x3dcf9c[_0x4bb5('0x4c')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x3dcf9c['params']['id']}})[_0x4bb5('0x29')](handleEntityNotFound(_0xe190dd,null))['then'](saveUpdates(_0x3dcf9c['body'],null))[_0x4bb5('0x29')](respondWithResult(_0xe190dd,null))[_0x4bb5('0x47')](handleError(_0xe190dd,null));};exports['destroy']=function(_0x215739,_0x53b191){return db[_0x4bb5('0x2f')]['find']({'where':{'id':_0x215739[_0x4bb5('0x49')]['id']}})['then'](handleEntityNotFound(_0x53b191,null))['then'](removeEntity(_0x53b191,null))['catch'](handleError(_0x53b191,null));};exports[_0x4bb5('0x4d')]=function(_0x5c3f7f,_0x59cdaf){return db[_0x4bb5('0x2f')]['describe']()[_0x4bb5('0x29')](respondWithResult(_0x59cdaf,null))[_0x4bb5('0x47')](handleError(_0x59cdaf,null));};exports[_0x4bb5('0x4e')]=function(_0x4afb7b,_0x4c8b0d){var _0x4abea4={},_0x3770e4={},_0x2ac4b9={'count':0x0,'rows':[]};_0x3770e4[_0x4bb5('0x34')]=_[_0x4bb5('0x35')](db['VoiceQueueReport'][_0x4bb5('0x30')]);_0x3770e4['query']=_[_0x4bb5('0x35')](_0x4afb7b[_0x4bb5('0x36')]);_0x3770e4[_0x4bb5('0x37')]=_['intersection'](_0x3770e4[_0x4bb5('0x34')],_0x3770e4['query']);_0x4abea4['attributes']=_['intersection'](_0x3770e4[_0x4bb5('0x34')],qs['fields'](_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x3a')]));_0x4abea4[_0x4bb5('0x39')]=_0x4abea4['attributes']['length']?_0x4abea4['attributes']:_0x3770e4[_0x4bb5('0x34')];if(!_0x4afb7b[_0x4bb5('0x36')]['hasOwnProperty'](_0x4bb5('0x4f'))){_0x4abea4[_0x4bb5('0x20')]=qs[_0x4bb5('0x20')](_0x4afb7b[_0x4bb5('0x36')]['limit']);_0x4abea4[_0x4bb5('0x22')]=qs[_0x4bb5('0x22')](_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x22')]);}_0x4abea4[_0x4bb5('0x3d')]=qs[_0x4bb5('0x3e')](_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x3e')]);_0x4abea4[_0x4bb5('0x3f')]=qs[_0x4bb5('0x37')](_['pick'](_0x4afb7b['query'],_0x3770e4['filters']));if(_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x42')]){_0x4abea4[_0x4bb5('0x3f')]=_['merge'](_0x4abea4[_0x4bb5('0x3f')],{'$or':_['map'](_0x4abea4[_0x4bb5('0x39')],function(_0x1c962f){var _0x10e62f={};_0x10e62f[_0x1c962f]={'$like':'%'+_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x42')]+'%'};return _0x10e62f;})});}_0x4abea4=_[_0x4bb5('0x41')]({},_0x4abea4,_0x4afb7b[_0x4bb5('0x50')]);var _0x4654b4={'where':_0x4abea4[_0x4bb5('0x3f')]};return db[_0x4bb5('0x2f')][_0x4bb5('0x21')](_0x4654b4)['then'](function(_0x5edeb0){_0x2ac4b9[_0x4bb5('0x21')]=_0x5edeb0;if(_0x4afb7b[_0x4bb5('0x36')][_0x4bb5('0x43')]){_0x4abea4[_0x4bb5('0x44')]=[{'all':!![]}];}return db[_0x4bb5('0x2f')][_0x4bb5('0x45')](_0x4abea4);})[_0x4bb5('0x29')](function(_0x30b0f2){_0x2ac4b9[_0x4bb5('0x46')]=_0x30b0f2;return _0x2ac4b9;})[_0x4bb5('0x29')](respondWithFilteredResult(_0x4c8b0d,_0x4abea4,_0x4bb5('0x4e')))[_0x4bb5('0x47')](handleError(_0x4c8b0d,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xaa09=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','VoiceQueueReport','fieldName','type','key','model','query','filters','intersection'];(function(_0x190681,_0x590f58){var _0x4f2ada=function(_0x4556db){while(--_0x4556db){_0x190681['push'](_0x190681['shift']());}};_0x4f2ada(++_0x590f58);}(_0xaa09,0xc3));var _0x9aa0=function(_0x391fe2,_0x14af24){_0x391fe2=_0x391fe2-0x0;var _0x19d44c=_0xaa09[_0x391fe2];return _0x19d44c;};'use strict';var emlformat=require(_0x9aa0('0x0'));var rimraf=require(_0x9aa0('0x1'));var zipdir=require(_0x9aa0('0x2'));var jsonpatch=require(_0x9aa0('0x3'));var rp=require('request-promise');var moment=require(_0x9aa0('0x4'));var BPromise=require(_0x9aa0('0x5'));var Mustache=require('mustache');var util=require(_0x9aa0('0x6'));var path=require(_0x9aa0('0x7'));var sox=require(_0x9aa0('0x8'));var csv=require(_0x9aa0('0x9'));var ejs=require(_0x9aa0('0xa'));var fs=require('fs');var fs_extra=require(_0x9aa0('0xb'));var _=require(_0x9aa0('0xc'));var squel=require(_0x9aa0('0xd'));var crypto=require(_0x9aa0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9aa0('0xf'));var toCsv=require(_0x9aa0('0x9'));var querystring=require(_0x9aa0('0x10'));var Papa=require(_0x9aa0('0x11'));var Redis=require(_0x9aa0('0x12'));var authService=require(_0x9aa0('0x13'));var qs=require(_0x9aa0('0x14'));var as=require(_0x9aa0('0x15'));var hardwareService=require(_0x9aa0('0x16'));var logger=require(_0x9aa0('0x17'))(_0x9aa0('0x18'));var utils=require('../../config/utils');var config=require(_0x9aa0('0x19'));var licenseUtil=require(_0x9aa0('0x1a'));var db=require(_0x9aa0('0x1b'))['db'];config[_0x9aa0('0x1c')]=_[_0x9aa0('0x1d')](config[_0x9aa0('0x1c')],{'host':_0x9aa0('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9aa0('0x1c')]));require(_0x9aa0('0x1f'))[_0x9aa0('0x20')](socket);function respondWithStatusCode(_0x3a8ecc,_0x3cd4cc){_0x3cd4cc=_0x3cd4cc||0xcc;return function(_0xbb3c6c){if(_0xbb3c6c){return _0x3a8ecc[_0x9aa0('0x21')](_0x3cd4cc);}return _0x3a8ecc['status'](_0x3cd4cc)[_0x9aa0('0x22')]();};}function respondWithResult(_0xf48648,_0x10c7dc){_0x10c7dc=_0x10c7dc||0xc8;return function(_0x47aca2){if(_0x47aca2){return _0xf48648[_0x9aa0('0x23')](_0x10c7dc)[_0x9aa0('0x24')](_0x47aca2);}};}function respondWithFilteredResult(_0x35b764,_0x5cd7fa){return function(_0x5c47cd){if(_0x5c47cd){var _0x13fc3a=typeof _0x5cd7fa[_0x9aa0('0x25')]===_0x9aa0('0x26')&&typeof _0x5cd7fa[_0x9aa0('0x27')]===_0x9aa0('0x26');var _0x2063f6=_0x5c47cd[_0x9aa0('0x28')];var _0x21e515=_0x13fc3a?0x0:_0x5cd7fa[_0x9aa0('0x25')];var _0x544040=_0x13fc3a?_0x5c47cd['count']:_0x5cd7fa['offset']+_0x5cd7fa['limit'];var _0x279068;if(_0x544040>=_0x2063f6){_0x544040=_0x2063f6;_0x279068=0xc8;}else{_0x279068=0xce;}_0x35b764[_0x9aa0('0x23')](_0x279068);return _0x35b764[_0x9aa0('0x29')](_0x9aa0('0x2a'),_0x21e515+'-'+_0x544040+'/'+_0x2063f6)['json'](_0x5c47cd);}return null;};}function patchUpdates(_0x48a78e){return function(_0x3f0b12){try{jsonpatch['apply'](_0x3f0b12,_0x48a78e,!![]);}catch(_0x359785){return BPromise[_0x9aa0('0x2b')](_0x359785);}return _0x3f0b12[_0x9aa0('0x2c')]();};}function saveUpdates(_0x372bc9,_0x5236c0){return function(_0x4db5bd){if(_0x4db5bd){return _0x4db5bd[_0x9aa0('0x2d')](_0x372bc9)[_0x9aa0('0x2e')](function(_0x4ddc11){return _0x4ddc11;});}return null;};}function removeEntity(_0x27f42f,_0x2d3956){return function(_0x5e9fd6){if(_0x5e9fd6){return _0x5e9fd6[_0x9aa0('0x2f')]()[_0x9aa0('0x2e')](function(){_0x27f42f[_0x9aa0('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ad0a3,_0x250a6c){return function(_0x7c5a0d){if(!_0x7c5a0d){_0x2ad0a3[_0x9aa0('0x21')](0x194);}return _0x7c5a0d;};}function handleError(_0x39b8d1,_0x133b8){_0x133b8=_0x133b8||0x1f4;return function(_0x4d2753){logger[_0x9aa0('0x30')](_0x4d2753['stack']);if(_0x4d2753[_0x9aa0('0x31')]){delete _0x4d2753[_0x9aa0('0x31')];}_0x39b8d1[_0x9aa0('0x23')](_0x133b8)['send'](_0x4d2753);};}exports[_0x9aa0('0x32')]=function(_0x313e93,_0x783786){var _0x2a27d9={},_0x324876={},_0xb1168b={'count':0x0,'rows':[]};var _0x5e53ee=_[_0x9aa0('0x33')](db[_0x9aa0('0x34')]['rawAttributes'],function(_0x161cb9){return{'name':_0x161cb9[_0x9aa0('0x35')],'type':_0x161cb9[_0x9aa0('0x36')][_0x9aa0('0x37')]};});_0x324876[_0x9aa0('0x38')]=_['map'](_0x5e53ee,_0x9aa0('0x31'));_0x324876[_0x9aa0('0x39')]=_['keys'](_0x313e93[_0x9aa0('0x39')]);_0x324876[_0x9aa0('0x3a')]=_[_0x9aa0('0x3b')](_0x324876[_0x9aa0('0x38')],_0x324876[_0x9aa0('0x39')]);_0x2a27d9[_0x9aa0('0x3c')]=_[_0x9aa0('0x3b')](_0x324876[_0x9aa0('0x38')],qs[_0x9aa0('0x3d')](_0x313e93[_0x9aa0('0x39')]['fields']));_0x2a27d9[_0x9aa0('0x3c')]=_0x2a27d9[_0x9aa0('0x3c')][_0x9aa0('0x3e')]?_0x2a27d9[_0x9aa0('0x3c')]:_0x324876[_0x9aa0('0x38')];if(!_0x313e93['query'][_0x9aa0('0x3f')]('nolimit')){_0x2a27d9[_0x9aa0('0x27')]=qs[_0x9aa0('0x27')](_0x313e93['query'][_0x9aa0('0x27')]);_0x2a27d9[_0x9aa0('0x25')]=qs['offset'](_0x313e93[_0x9aa0('0x39')][_0x9aa0('0x25')]);}_0x2a27d9[_0x9aa0('0x40')]=qs[_0x9aa0('0x41')](_0x313e93[_0x9aa0('0x39')][_0x9aa0('0x41')]);_0x2a27d9[_0x9aa0('0x42')]=qs[_0x9aa0('0x3a')](_[_0x9aa0('0x43')](_0x313e93[_0x9aa0('0x39')],_0x324876[_0x9aa0('0x3a')]),_0x5e53ee);if(_0x313e93[_0x9aa0('0x39')]['filter']){_0x2a27d9[_0x9aa0('0x42')]=_[_0x9aa0('0x44')](_0x2a27d9[_0x9aa0('0x42')],{'$or':_[_0x9aa0('0x33')](_0x5e53ee,function(_0x266db6){if(_0x266db6['type']!=='VIRTUAL'){var _0x102380={};_0x102380[_0x266db6[_0x9aa0('0x31')]]={'$like':'%'+_0x313e93['query'][_0x9aa0('0x45')]+'%'};return _0x102380;}})});}_0x2a27d9=_[_0x9aa0('0x44')]({},_0x2a27d9,_0x313e93[_0x9aa0('0x46')]);var _0x5224c2={'where':_0x2a27d9[_0x9aa0('0x42')]};return db['VoiceQueueReport'][_0x9aa0('0x28')](_0x5224c2)[_0x9aa0('0x2e')](function(_0x26493c){_0xb1168b[_0x9aa0('0x28')]=_0x26493c;if(_0x313e93[_0x9aa0('0x39')][_0x9aa0('0x47')]){_0x2a27d9[_0x9aa0('0x48')]=[{'all':!![]}];}return db[_0x9aa0('0x34')][_0x9aa0('0x49')](_0x2a27d9);})[_0x9aa0('0x2e')](function(_0x512f77){_0xb1168b[_0x9aa0('0x4a')]=_0x512f77;return _0xb1168b;})[_0x9aa0('0x2e')](respondWithFilteredResult(_0x783786,_0x2a27d9))[_0x9aa0('0x4b')](handleError(_0x783786,null));};exports[_0x9aa0('0x4c')]=function(_0x2549ae,_0x17b69f){var _0xaec23a={'raw':![],'where':{'id':_0x2549ae['params']['id']}},_0x247a77={};_0x247a77[_0x9aa0('0x38')]=_[_0x9aa0('0x4d')](db[_0x9aa0('0x34')][_0x9aa0('0x4e')]);_0x247a77['query']=_[_0x9aa0('0x4d')](_0x2549ae[_0x9aa0('0x39')]);_0x247a77[_0x9aa0('0x3a')]=_['intersection'](_0x247a77[_0x9aa0('0x38')],_0x247a77[_0x9aa0('0x39')]);_0xaec23a[_0x9aa0('0x3c')]=_[_0x9aa0('0x3b')](_0x247a77[_0x9aa0('0x38')],qs[_0x9aa0('0x3d')](_0x2549ae[_0x9aa0('0x39')][_0x9aa0('0x3d')]));_0xaec23a[_0x9aa0('0x3c')]=_0xaec23a[_0x9aa0('0x3c')][_0x9aa0('0x3e')]?_0xaec23a[_0x9aa0('0x3c')]:_0x247a77['model'];if(_0x2549ae[_0x9aa0('0x39')][_0x9aa0('0x47')]){_0xaec23a[_0x9aa0('0x48')]=[{'all':!![]}];}_0xaec23a=_['merge']({},_0xaec23a,_0x2549ae[_0x9aa0('0x46')]);return db[_0x9aa0('0x34')][_0x9aa0('0x4f')](_0xaec23a)[_0x9aa0('0x2e')](handleEntityNotFound(_0x17b69f,null))[_0x9aa0('0x2e')](respondWithResult(_0x17b69f,null))[_0x9aa0('0x4b')](handleError(_0x17b69f,null));};exports[_0x9aa0('0x50')]=function(_0x38c112,_0xf820ae){return db[_0x9aa0('0x34')]['create'](_0x38c112[_0x9aa0('0x51')],{})['then'](respondWithResult(_0xf820ae,0xc9))['catch'](handleError(_0xf820ae,null));};exports[_0x9aa0('0x2d')]=function(_0x27d4ff,_0x282d16){if(_0x27d4ff[_0x9aa0('0x51')]['id']){delete _0x27d4ff[_0x9aa0('0x51')]['id'];}return db[_0x9aa0('0x34')][_0x9aa0('0x4f')]({'where':{'id':_0x27d4ff['params']['id']}})['then'](handleEntityNotFound(_0x282d16,null))[_0x9aa0('0x2e')](saveUpdates(_0x27d4ff[_0x9aa0('0x51')],null))['then'](respondWithResult(_0x282d16,null))[_0x9aa0('0x4b')](handleError(_0x282d16,null));};exports['destroy']=function(_0x87c6e5,_0x342034){return db['VoiceQueueReport'][_0x9aa0('0x4f')]({'where':{'id':_0x87c6e5[_0x9aa0('0x52')]['id']}})[_0x9aa0('0x2e')](handleEntityNotFound(_0x342034,null))[_0x9aa0('0x2e')](removeEntity(_0x342034,null))['catch'](handleError(_0x342034,null));};exports['describe']=function(_0x4b98aa,_0x17f12d){return db[_0x9aa0('0x34')][_0x9aa0('0x53')]()['then'](respondWithResult(_0x17f12d,null))[_0x9aa0('0x4b')](handleError(_0x17f12d,null));};exports[_0x9aa0('0x54')]=function(_0x210c8e,_0x1bec90){var _0x7d359b={},_0x5505e6={},_0x2171e7={'count':0x0,'rows':[]};_0x5505e6['model']=_[_0x9aa0('0x4d')](db[_0x9aa0('0x34')][_0x9aa0('0x4e')]);_0x5505e6[_0x9aa0('0x39')]=_[_0x9aa0('0x4d')](_0x210c8e[_0x9aa0('0x39')]);_0x5505e6[_0x9aa0('0x3a')]=_['intersection'](_0x5505e6[_0x9aa0('0x38')],_0x5505e6[_0x9aa0('0x39')]);_0x7d359b[_0x9aa0('0x3c')]=_[_0x9aa0('0x3b')](_0x5505e6[_0x9aa0('0x38')],qs[_0x9aa0('0x3d')](_0x210c8e['query'][_0x9aa0('0x3d')]));_0x7d359b[_0x9aa0('0x3c')]=_0x7d359b[_0x9aa0('0x3c')][_0x9aa0('0x3e')]?_0x7d359b[_0x9aa0('0x3c')]:_0x5505e6[_0x9aa0('0x38')];if(!_0x210c8e[_0x9aa0('0x39')]['hasOwnProperty']('nolimit')){_0x7d359b[_0x9aa0('0x27')]=qs['limit'](_0x210c8e['query']['limit']);_0x7d359b['offset']=qs[_0x9aa0('0x25')](_0x210c8e['query'][_0x9aa0('0x25')]);}_0x7d359b[_0x9aa0('0x40')]=qs['sort'](_0x210c8e['query']['sort']);_0x7d359b[_0x9aa0('0x42')]=qs[_0x9aa0('0x3a')](_[_0x9aa0('0x43')](_0x210c8e[_0x9aa0('0x39')],_0x5505e6[_0x9aa0('0x3a')]));if(_0x210c8e[_0x9aa0('0x39')][_0x9aa0('0x45')]){_0x7d359b[_0x9aa0('0x42')]=_[_0x9aa0('0x44')](_0x7d359b[_0x9aa0('0x42')],{'$or':_[_0x9aa0('0x33')](_0x7d359b[_0x9aa0('0x3c')],function(_0xe926dc){var _0x190212={};_0x190212[_0xe926dc]={'$like':'%'+_0x210c8e['query'][_0x9aa0('0x45')]+'%'};return _0x190212;})});}_0x7d359b=_[_0x9aa0('0x44')]({},_0x7d359b,_0x210c8e[_0x9aa0('0x46')]);var _0x100d6b={'where':_0x7d359b[_0x9aa0('0x42')]};return db[_0x9aa0('0x34')]['count'](_0x100d6b)['then'](function(_0x53c7fc){_0x2171e7[_0x9aa0('0x28')]=_0x53c7fc;if(_0x210c8e[_0x9aa0('0x39')]['includeAll']){_0x7d359b['include']=[{'all':!![]}];}return db[_0x9aa0('0x34')][_0x9aa0('0x49')](_0x7d359b);})[_0x9aa0('0x2e')](function(_0x53bb33){_0x2171e7['rows']=_0x53bb33;return _0x2171e7;})[_0x9aa0('0x2e')](respondWithFilteredResult(_0x1bec90,_0x7d359b,'getVoiceQueuesReport'))[_0x9aa0('0x4b')](handleError(_0x1bec90,null,_0x9aa0('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index c1dfc7a..7f8a327 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 _0xf847=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','remove','hasOwnProperty'];(function(_0x39a255,_0x43c63b){var _0x427b92=function(_0x5d5805){while(--_0x5d5805){_0x39a255['push'](_0x39a255['shift']());}};_0x427b92(++_0x43c63b);}(_0xf847,0xea));var _0x7f84=function(_0x51da25,_0x426376){_0x51da25=_0x51da25-0x0;var _0x11ff0a=_0xf847[_0x51da25];return _0x11ff0a;};'use strict';var EventEmitter=require(_0x7f84('0x0'));var VoiceQueueReport=require(_0x7f84('0x1'))['db'][_0x7f84('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7f84('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7f84('0x4')};function emitEvent(_0x3d3f30){return function(_0x4e4eef,_0x521d5b,_0x628405){VoiceQueueReportEvents['emit'](_0x3d3f30+':'+_0x4e4eef['id'],_0x4e4eef);VoiceQueueReportEvents['emit'](_0x3d3f30,_0x4e4eef);_0x628405(null);};}for(var e in events){if(events[_0x7f84('0x5')](e)){var event=events[e];VoiceQueueReport[_0x7f84('0x6')](e,emitEvent(event));}}module[_0x7f84('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xc342=['remove','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xc342,0x19a));var _0x2c34=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0xc342[_0x473738];return _0x1df4ae;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x2c34('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2c34('0x1')](0x0);var events={'afterCreate':_0x2c34('0x2'),'afterUpdate':_0x2c34('0x3'),'afterDestroy':_0x2c34('0x4')};function emitEvent(_0x370c1b){return function(_0x2ca522,_0x323656,_0x3c0c7d){VoiceQueueReportEvents['emit'](_0x370c1b+':'+_0x2ca522['id'],_0x2ca522);VoiceQueueReportEvents['emit'](_0x370c1b,_0x2ca522);_0x3c0c7d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x2c34('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index dfcb394..647c4d1 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 _0xc588=['exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3165e9,_0x11b018){var _0x1a727c=function(_0x1cb3e7){while(--_0x1cb3e7){_0x3165e9['push'](_0x3165e9['shift']());}};_0x1a727c(++_0x11b018);}(_0xc588,0x14f));var _0x8c58=function(_0x37bcf9,_0x4d1a77){_0x37bcf9=_0x37bcf9-0x0;var _0x5049d3=_0xc588[_0x37bcf9];return _0x5049d3;};'use strict';var _=require(_0x8c58('0x0'));var util=require(_0x8c58('0x1'));var logger=require(_0x8c58('0x2'))(_0x8c58('0x3'));var moment=require(_0x8c58('0x4'));var BPromise=require(_0x8c58('0x5'));var rp=require(_0x8c58('0x6'));var fs=require('fs');var path=require(_0x8c58('0x7'));var rimraf=require(_0x8c58('0x8'));var config=require(_0x8c58('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x8c58('0xa')]=function(_0x58bf09,_0xf809bb){return _0x58bf09['define'](_0x8c58('0xb'),attributes,{'tableName':_0x8c58('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8c58('0xd')]},{'fields':[_0x8c58('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb322=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_queue','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb322,0x14f));var _0x2b32=function(_0x58cc29,_0x57dfaa){_0x58cc29=_0x58cc29-0x0;var _0x22b67b=_0xb322[_0x58cc29];return _0x22b67b;};'use strict';var _=require(_0x2b32('0x0'));var util=require(_0x2b32('0x1'));var logger=require(_0x2b32('0x2'))(_0x2b32('0x3'));var moment=require('moment');var BPromise=require(_0x2b32('0x4'));var rp=require(_0x2b32('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b32('0x6'));var config=require(_0x2b32('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x2b32('0x8')]=function(_0x257a20,_0x1ef217){return _0x257a20[_0x2b32('0x9')]('VoiceQueueReport',attributes,{'tableName':_0x2b32('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2b32('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 7673bcf..473a108 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 _0xec6d=['message','request\x20sent','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x48be34,_0xd7aeea){var _0x1621d6=function(_0x1924ca){while(--_0x1924ca){_0x48be34['push'](_0x48be34['shift']());}};_0x1621d6(++_0xd7aeea);}(_0xec6d,0x163));var _0xdec6=function(_0x21078d,_0x32216e){_0x21078d=_0x21078d-0x0;var _0x4a3608=_0xec6d[_0x21078d];return _0x4a3608;};'use strict';var _=require(_0xdec6('0x0'));var util=require(_0xdec6('0x1'));var moment=require(_0xdec6('0x2'));var BPromise=require(_0xdec6('0x3'));var rs=require(_0xdec6('0x4'));var fs=require('fs');var Redis=require(_0xdec6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdec6('0x6'));var logger=require('../../config/logger')(_0xdec6('0x7'));var config=require(_0xdec6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdec6('0x9')][_0xdec6('0xa')]({'port':0x232a});config[_0xdec6('0xb')]=_[_0xdec6('0xc')](config[_0xdec6('0xb')],{'host':_0xdec6('0xd'),'port':0x18eb});var socket=require(_0xdec6('0xe'))(new Redis(config[_0xdec6('0xb')]));require(_0xdec6('0xf'))['register'](socket);function respondWithRpcPromise(_0xe6136d,_0x5460a3,_0x4b8409){return new BPromise(function(_0x3c86d2,_0x3cddea){return client['request'](_0xe6136d,_0x4b8409)[_0xdec6('0x10')](function(_0x1d336f){logger[_0xdec6('0x11')](_0xdec6('0x12'),_0x5460a3,'request\x20sent');logger[_0xdec6('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x5460a3,'request\x20sent',JSON[_0xdec6('0x14')](_0x1d336f));if(_0x1d336f['error']){if(_0x1d336f[_0xdec6('0x15')][_0xdec6('0x16')]===0x1f4){logger[_0xdec6('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x5460a3,_0x1d336f[_0xdec6('0x15')]['message']);return _0x3cddea(_0x1d336f[_0xdec6('0x15')][_0xdec6('0x17')]);}logger[_0xdec6('0x15')](_0xdec6('0x12'),_0x5460a3,_0x1d336f[_0xdec6('0x15')][_0xdec6('0x17')]);return _0x3c86d2(_0x1d336f[_0xdec6('0x15')]['message']);}else{logger[_0xdec6('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x5460a3,_0xdec6('0x18'));_0x3c86d2(_0x1d336f[_0xdec6('0x19')][_0xdec6('0x17')]);}})[_0xdec6('0x1a')](function(_0x36cce9){logger['error'](_0xdec6('0x12'),_0x5460a3,_0x36cce9);_0x3cddea(_0x36cce9);});});}exports[_0xdec6('0x1b')]=function(_0x2b247b){var _0x3c001f=this;return new Promise(function(_0x398079,_0x44b552){return db['VoiceQueueReport'][_0xdec6('0x1c')]({'raw':_0x2b247b[_0xdec6('0x1d')]?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b247b[_0xdec6('0x1d')]?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x1f')]||null:null,'attributes':_0x2b247b[_0xdec6('0x1d')]?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x20')]||null:null,'limit':_0x2b247b[_0xdec6('0x1d')]?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x21')]||null:null,'include':_0x2b247b['options']?_0x2b247b[_0xdec6('0x1d')][_0xdec6('0x22')]?_[_0xdec6('0x23')](_0x2b247b['options'][_0xdec6('0x22')],function(_0xaa6bf1){return{'model':db[_0xaa6bf1[_0xdec6('0x24')]],'as':_0xaa6bf1['as'],'attributes':_0xaa6bf1[_0xdec6('0x20')],'include':_0xaa6bf1[_0xdec6('0x22')]?_[_0xdec6('0x23')](_0xaa6bf1['include'],function(_0x87474){return{'model':db[_0x87474[_0xdec6('0x24')]],'as':_0x87474['as'],'attributes':_0x87474[_0xdec6('0x20')],'include':_0x87474['include']?_[_0xdec6('0x23')](_0x87474[_0xdec6('0x22')],function(_0x173030){return{'model':db[_0x173030['model']],'as':_0x173030['as'],'attributes':_0x173030['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e1b7c){logger[_0xdec6('0x11')](_0xdec6('0x1b'),_0x2b247b);logger[_0xdec6('0x13')](_0xdec6('0x1b'),_0x2b247b,JSON[_0xdec6('0x14')](_0x2e1b7c));_0x398079(_0x2e1b7c);})['catch'](function(_0x339024){logger['error'](_0xdec6('0x1b'),_0x339024[_0xdec6('0x17')],_0x2b247b);_0x44b552(_0x3c001f[_0xdec6('0x15')](0x1f4,_0x339024[_0xdec6('0x17')]));});});};exports[_0xdec6('0x25')]=function(_0x53d4d3){var _0x478b07=this;return new Promise(function(_0x2a08b0,_0x342d66){return db[_0xdec6('0x26')]['create'](_0x53d4d3[_0xdec6('0x27')],{'raw':_0x53d4d3[_0xdec6('0x1d')]?_0x53d4d3[_0xdec6('0x1d')][_0xdec6('0x1e')]===undefined?!![]:![]:!![]})[_0xdec6('0x10')](function(_0xb45ce5){logger[_0xdec6('0x11')]('CreateVoiceQueueReport',_0x53d4d3);logger[_0xdec6('0x13')]('CreateVoiceQueueReport',_0x53d4d3,JSON[_0xdec6('0x14')](_0xb45ce5));_0x2a08b0(_0xb45ce5);})['catch'](function(_0x1a9111){logger[_0xdec6('0x15')]('CreateVoiceQueueReport',_0x1a9111[_0xdec6('0x17')],_0x53d4d3);_0x342d66(_0x478b07[_0xdec6('0x15')](0x1f4,_0x1a9111[_0xdec6('0x17')]));});});};exports[_0xdec6('0x28')]=function(_0x3f2459){var _0x3f85ab=this;return new Promise(function(_0xacc5aa,_0x10adc6){return db['VoiceQueueReport'][_0xdec6('0x29')](_0x3f2459[_0xdec6('0x27')],{'raw':_0x3f2459[_0xdec6('0x1d')]?_0x3f2459['options'][_0xdec6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2459[_0xdec6('0x1d')]?_0x3f2459[_0xdec6('0x1d')]['where']||null:null,'attributes':_0x3f2459[_0xdec6('0x1d')]?_0x3f2459[_0xdec6('0x1d')][_0xdec6('0x20')]||null:null,'limit':_0x3f2459['options']?_0x3f2459[_0xdec6('0x1d')][_0xdec6('0x21')]||null:null})[_0xdec6('0x10')](function(_0x206e41){logger[_0xdec6('0x11')]('UpdateVoiceQueueReport',_0x3f2459);logger[_0xdec6('0x13')](_0xdec6('0x28'),_0x3f2459,JSON[_0xdec6('0x14')](_0x206e41));_0xacc5aa(_0x206e41);})[_0xdec6('0x1a')](function(_0x2d755a){logger['error'](_0xdec6('0x28'),_0x2d755a[_0xdec6('0x17')],_0x3f2459);_0x10adc6(_0x3f85ab['error'](0x1f4,_0x2d755a[_0xdec6('0x17')]));});});}; \ No newline at end of file +var _0x5b3a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','VoiceQueueReport','options','where','limit','map','include','model','attributes','then','GetVoiceQueueReport','catch','CreateVoiceQueueReport','body','raw','stringify','update','UpdateVoiceQueueReport','lodash','util','moment'];(function(_0x35c3fe,_0x22f72d){var _0x2c9739=function(_0x259f1a){while(--_0x259f1a){_0x35c3fe['push'](_0x35c3fe['shift']());}};_0x2c9739(++_0x22f72d);}(_0x5b3a,0x192));var _0xa5b3=function(_0x216503,_0x4e266c){_0x216503=_0x216503-0x0;var _0xfe56e2=_0x5b3a[_0x216503];return _0xfe56e2;};'use strict';var _=require(_0xa5b3('0x0'));var util=require(_0xa5b3('0x1'));var moment=require(_0xa5b3('0x2'));var BPromise=require(_0xa5b3('0x3'));var rs=require(_0xa5b3('0x4'));var fs=require('fs');var Redis=require(_0xa5b3('0x5'));var db=require(_0xa5b3('0x6'))['db'];var utils=require(_0xa5b3('0x7'));var logger=require(_0xa5b3('0x8'))(_0xa5b3('0x9'));var config=require(_0xa5b3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa5b3('0xb')][_0xa5b3('0xc')]({'port':0x232a});config[_0xa5b3('0xd')]=_[_0xa5b3('0xe')](config['redis'],{'host':_0xa5b3('0xf'),'port':0x18eb});var socket=require(_0xa5b3('0x10'))(new Redis(config[_0xa5b3('0xd')]));require(_0xa5b3('0x11'))[_0xa5b3('0x12')](socket);function respondWithRpcPromise(_0x215fd4,_0x44eed9,_0x10906d){return new BPromise(function(_0x349f7d,_0x98c9b9){return client[_0xa5b3('0x13')](_0x215fd4,_0x10906d)['then'](function(_0x4c4f30){logger[_0xa5b3('0x14')](_0xa5b3('0x15'),_0x44eed9,_0xa5b3('0x16'));logger[_0xa5b3('0x17')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x44eed9,_0xa5b3('0x16'),JSON['stringify'](_0x4c4f30));if(_0x4c4f30['error']){if(_0x4c4f30[_0xa5b3('0x18')][_0xa5b3('0x19')]===0x1f4){logger[_0xa5b3('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x44eed9,_0x4c4f30[_0xa5b3('0x18')]['message']);return _0x98c9b9(_0x4c4f30[_0xa5b3('0x18')]['message']);}logger[_0xa5b3('0x18')](_0xa5b3('0x15'),_0x44eed9,_0x4c4f30['error'][_0xa5b3('0x1a')]);return _0x349f7d(_0x4c4f30[_0xa5b3('0x18')][_0xa5b3('0x1a')]);}else{logger['info'](_0xa5b3('0x15'),_0x44eed9,_0xa5b3('0x16'));_0x349f7d(_0x4c4f30[_0xa5b3('0x1b')][_0xa5b3('0x1a')]);}})['catch'](function(_0x4f4b16){logger[_0xa5b3('0x18')](_0xa5b3('0x15'),_0x44eed9,_0x4f4b16);_0x98c9b9(_0x4f4b16);});});}exports['GetVoiceQueueReport']=function(_0x17e894){var _0x137c4d=this;return new Promise(function(_0xfe0520,_0x1e622e){return db[_0xa5b3('0x1c')]['findAll']({'raw':_0x17e894[_0xa5b3('0x1d')]?_0x17e894['options']['raw']===undefined?!![]:![]:!![],'where':_0x17e894[_0xa5b3('0x1d')]?_0x17e894['options'][_0xa5b3('0x1e')]||null:null,'attributes':_0x17e894[_0xa5b3('0x1d')]?_0x17e894[_0xa5b3('0x1d')]['attributes']||null:null,'limit':_0x17e894[_0xa5b3('0x1d')]?_0x17e894[_0xa5b3('0x1d')][_0xa5b3('0x1f')]||null:null,'include':_0x17e894[_0xa5b3('0x1d')]?_0x17e894['options']['include']?_[_0xa5b3('0x20')](_0x17e894[_0xa5b3('0x1d')][_0xa5b3('0x21')],function(_0x5d8e90){return{'model':db[_0x5d8e90[_0xa5b3('0x22')]],'as':_0x5d8e90['as'],'attributes':_0x5d8e90['attributes'],'include':_0x5d8e90[_0xa5b3('0x21')]?_[_0xa5b3('0x20')](_0x5d8e90[_0xa5b3('0x21')],function(_0x424152){return{'model':db[_0x424152[_0xa5b3('0x22')]],'as':_0x424152['as'],'attributes':_0x424152[_0xa5b3('0x23')],'include':_0x424152['include']?_[_0xa5b3('0x20')](_0x424152['include'],function(_0x9cd5a3){return{'model':db[_0x9cd5a3[_0xa5b3('0x22')]],'as':_0x9cd5a3['as'],'attributes':_0x9cd5a3['attributes']};}):[]};}):[]};}):[]:[]})[_0xa5b3('0x24')](function(_0x352f14){logger[_0xa5b3('0x14')]('GetVoiceQueueReport',_0x17e894);logger[_0xa5b3('0x17')](_0xa5b3('0x25'),_0x17e894,JSON['stringify'](_0x352f14));_0xfe0520(_0x352f14);})[_0xa5b3('0x26')](function(_0x41baa9){logger['error'](_0xa5b3('0x25'),_0x41baa9[_0xa5b3('0x1a')],_0x17e894);_0x1e622e(_0x137c4d[_0xa5b3('0x18')](0x1f4,_0x41baa9[_0xa5b3('0x1a')]));});});};exports[_0xa5b3('0x27')]=function(_0x3f2d13){var _0x144d77=this;return new Promise(function(_0x2dcd04,_0x346dbb){return db[_0xa5b3('0x1c')]['create'](_0x3f2d13[_0xa5b3('0x28')],{'raw':_0x3f2d13[_0xa5b3('0x1d')]?_0x3f2d13[_0xa5b3('0x1d')][_0xa5b3('0x29')]===undefined?!![]:![]:!![]})[_0xa5b3('0x24')](function(_0x37b50d){logger['info'](_0xa5b3('0x27'),_0x3f2d13);logger[_0xa5b3('0x17')](_0xa5b3('0x27'),_0x3f2d13,JSON[_0xa5b3('0x2a')](_0x37b50d));_0x2dcd04(_0x37b50d);})[_0xa5b3('0x26')](function(_0x4c8de3){logger[_0xa5b3('0x18')](_0xa5b3('0x27'),_0x4c8de3[_0xa5b3('0x1a')],_0x3f2d13);_0x346dbb(_0x144d77[_0xa5b3('0x18')](0x1f4,_0x4c8de3['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x472f67){var _0x1825ee=this;return new Promise(function(_0x29442e,_0x4635fc){return db[_0xa5b3('0x1c')][_0xa5b3('0x2b')](_0x472f67[_0xa5b3('0x28')],{'raw':_0x472f67[_0xa5b3('0x1d')]?_0x472f67[_0xa5b3('0x1d')][_0xa5b3('0x29')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x472f67[_0xa5b3('0x1d')]?_0x472f67['options']['where']||null:null,'attributes':_0x472f67[_0xa5b3('0x1d')]?_0x472f67[_0xa5b3('0x1d')][_0xa5b3('0x23')]||null:null,'limit':_0x472f67[_0xa5b3('0x1d')]?_0x472f67['options'][_0xa5b3('0x1f')]||null:null})[_0xa5b3('0x24')](function(_0x3bf359){logger[_0xa5b3('0x14')](_0xa5b3('0x2c'),_0x472f67);logger[_0xa5b3('0x17')](_0xa5b3('0x2c'),_0x472f67,JSON[_0xa5b3('0x2a')](_0x3bf359));_0x29442e(_0x3bf359);})['catch'](function(_0x24c9bf){logger[_0xa5b3('0x18')](_0xa5b3('0x2c'),_0x24c9bf['message'],_0x472f67);_0x4635fc(_0x1825ee[_0xa5b3('0x18')](0x1f4,_0x24c9bf[_0xa5b3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 5f5b455..66f4473 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 _0xafdd=['emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x477d85,_0x3dd232){var _0x3d0334=function(_0x41c3e0){while(--_0x41c3e0){_0x477d85['push'](_0x477d85['shift']());}};_0x3d0334(++_0x3dd232);}(_0xafdd,0x19a));var _0xdafd=function(_0x4f3b1d,_0x40680e){_0x4f3b1d=_0x4f3b1d-0x0;var _0xcd63a5=_0xafdd[_0x4f3b1d];return _0xcd63a5;};'use strict';var VoiceQueueReportEvents=require(_0xdafd('0x0'));var events=[_0xdafd('0x1'),_0xdafd('0x2'),_0xdafd('0x3')];function createListener(_0xf13a21,_0x3ceef2){return function(_0x268b14){_0x3ceef2[_0xdafd('0x4')](_0xf13a21,_0x268b14);};}function removeListener(_0x5624f6,_0x283ab1){return function(){VoiceQueueReportEvents[_0xdafd('0x5')](_0x5624f6,_0x283ab1);};}exports[_0xdafd('0x6')]=function(_0x37f05a){for(var _0xfa4ad6=0x0,_0x57cfee=events[_0xdafd('0x7')];_0xfa4ad6<_0x57cfee;_0xfa4ad6++){var _0x53e09c=events[_0xfa4ad6];var _0x9b9c6b=createListener(_0xdafd('0x8')+_0x53e09c,_0x37f05a);VoiceQueueReportEvents['on'](_0x53e09c,_0x9b9c6b);}}; \ No newline at end of file +var _0x24ce=['register','voiceQueueReport:','save','remove','update','emit','removeListener'];(function(_0xc454ce,_0x62b968){var _0x51c7f9=function(_0x3075e8){while(--_0x3075e8){_0xc454ce['push'](_0xc454ce['shift']());}};_0x51c7f9(++_0x62b968);}(_0x24ce,0x1de));var _0xe24c=function(_0x125e90,_0x5d9813){_0x125e90=_0x125e90-0x0;var _0x1aa744=_0x24ce[_0x125e90];return _0x1aa744;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xe24c('0x0'),_0xe24c('0x1'),_0xe24c('0x2')];function createListener(_0x1ce128,_0x493bd8){return function(_0x5d60b2){_0x493bd8[_0xe24c('0x3')](_0x1ce128,_0x5d60b2);};}function removeListener(_0x48f802,_0x4d6727){return function(){VoiceQueueReportEvents[_0xe24c('0x4')](_0x48f802,_0x4d6727);};}exports[_0xe24c('0x5')]=function(_0x6f92e0){for(var _0x1ac59c=0x0,_0xe1d970=events['length'];_0x1ac59c<_0xe1d970;_0x1ac59c++){var _0x6d00e=events[_0x1ac59c];var _0x2d8dde=createListener(_0xe24c('0x6')+_0x6d00e,_0x6f92e0);VoiceQueueReportEvents['on'](_0x6d00e,_0x2d8dde);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 21367b1..ffc880c 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 _0xc6e6=['post','isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceQueuesLog.controller','get','index'];(function(_0x5c3e7c,_0x39ca9e){var _0x40cdf0=function(_0x251ddc){while(--_0x251ddc){_0x5c3e7c['push'](_0x5c3e7c['shift']());}};_0x40cdf0(++_0x39ca9e);}(_0xc6e6,0xc2));var _0x6c6e=function(_0x10490e,_0x4df0d9){_0x10490e=_0x10490e-0x0;var _0x35023c=_0xc6e6[_0x10490e];return _0x35023c;};'use strict';var multer=require(_0x6c6e('0x0'));var util=require(_0x6c6e('0x1'));var path=require(_0x6c6e('0x2'));var timeout=require(_0x6c6e('0x3'));var express=require('express');var router=express[_0x6c6e('0x4')]();var fs_extra=require(_0x6c6e('0x5'));var auth=require(_0x6c6e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6c6e('0x7'));router[_0x6c6e('0x8')]('/',auth['isAuthenticated'](),controller[_0x6c6e('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6c6e('0xa')]('/',auth[_0x6c6e('0xb')](),controller[_0x6c6e('0xc')]);router[_0x6c6e('0xd')](_0x6c6e('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6c6e('0xf')]);module[_0x6c6e('0x10')]=router; \ No newline at end of file +var _0x0995=['../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x2e65ee,_0x29dad9){var _0x4c712a=function(_0xca593f){while(--_0xca593f){_0x2e65ee['push'](_0x2e65ee['shift']());}};_0x4c712a(++_0x29dad9);}(_0x0995,0x7f));var _0x5099=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0995[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5099('0x0'));var util=require(_0x5099('0x1'));var path=require(_0x5099('0x2'));var timeout=require('connect-timeout');var express=require(_0x5099('0x3'));var router=express['Router']();var fs_extra=require(_0x5099('0x4'));var auth=require(_0x5099('0x5'));var interaction=require(_0x5099('0x6'));var config=require(_0x5099('0x7'));var controller=require(_0x5099('0x8'));router[_0x5099('0x9')]('/',auth[_0x5099('0xa')](),controller[_0x5099('0xb')]);router['get'](_0x5099('0xc'),auth[_0x5099('0xa')](),controller[_0x5099('0xd')]);router['post']('/',auth[_0x5099('0xa')](),controller[_0x5099('0xe')]);router[_0x5099('0xf')]('/:id',auth[_0x5099('0xa')](),controller[_0x5099('0x10')]);router[_0x5099('0x11')](_0x5099('0xc'),auth[_0x5099('0xa')](),controller['destroy']);module[_0x5099('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index c07371c..a8b7b61 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 _0x45ba=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x4dbe01,_0x503406){var _0x22d795=function(_0xf0d9f7){while(--_0xf0d9f7){_0x4dbe01['push'](_0x4dbe01['shift']());}};_0x22d795(++_0x503406);}(_0x45ba,0x1d7));var _0xa45b=function(_0x2adcaa,_0x261668){_0x2adcaa=_0x2adcaa-0x0;var _0x11101f=_0x45ba[_0x2adcaa];return _0x11101f;};'use strict';var Sequelize=require(_0xa45b('0x0'));var moment=require(_0xa45b('0x1'));module[_0xa45b('0x2')]={'time':{'type':Sequelize[_0xa45b('0x3')]},'callid':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa45b('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xa45b('0x4')](_0xa45b('0x5'))}}; \ No newline at end of file +var _0x3773=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2c4e58,_0x5408de){var _0x2c7a9d=function(_0xa8a07c){while(--_0xa8a07c){_0x2c4e58['push'](_0x2c4e58['shift']());}};_0x2c7a9d(++_0x5408de);}(_0x3773,0xb4));var _0x3377=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3773[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3377('0x0'));module[_0x3377('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x3377('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3377('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3377('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3377('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x3377('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x3377('0x3')],'allowNull':![],'defaultValue':moment()[_0x3377('0x4')](_0x3377('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a2b65aa..517785d 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 _0x6e8e=['send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','fields','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','then','destroy','end','stack','name'];(function(_0x41ca3e,_0x404068){var _0x25f8da=function(_0x50ac51){while(--_0x50ac51){_0x41ca3e['push'](_0x41ca3e['shift']());}};_0x25f8da(++_0x404068);}(_0x6e8e,0xe8));var _0xe6e8=function(_0x533494,_0x436dc5){_0x533494=_0x533494-0x0;var _0x59872a=_0x6e8e[_0x533494];return _0x59872a;};'use strict';var emlformat=require(_0xe6e8('0x0'));var rimraf=require(_0xe6e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6e8('0x2'));var rp=require(_0xe6e8('0x3'));var moment=require(_0xe6e8('0x4'));var BPromise=require(_0xe6e8('0x5'));var Mustache=require(_0xe6e8('0x6'));var util=require(_0xe6e8('0x7'));var path=require(_0xe6e8('0x8'));var sox=require('sox');var csv=require(_0xe6e8('0x9'));var ejs=require(_0xe6e8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6e8('0xb'));var squel=require('squel');var crypto=require(_0xe6e8('0xc'));var jsforce=require(_0xe6e8('0xd'));var deskjs=require(_0xe6e8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe6e8('0xf'));var Redis=require(_0xe6e8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6e8('0x11'));var logger=require(_0xe6e8('0x12'))('api');var utils=require(_0xe6e8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe6e8('0x14'));var db=require(_0xe6e8('0x15'))['db'];function respondWithStatusCode(_0x51a6b6,_0x17760b){_0x17760b=_0x17760b||0xcc;return function(_0x4ec910){if(_0x4ec910){return _0x51a6b6[_0xe6e8('0x16')](_0x17760b);}return _0x51a6b6['status'](_0x17760b)['end']();};}function respondWithResult(_0x107cd7,_0x2c54fe){_0x2c54fe=_0x2c54fe||0xc8;return function(_0x133cab){if(_0x133cab){return _0x107cd7[_0xe6e8('0x17')](_0x2c54fe)[_0xe6e8('0x18')](_0x133cab);}};}function respondWithFilteredResult(_0x4d36a0,_0x1c9698){return function(_0x1fda73){if(_0x1fda73){var _0x454e5c=typeof _0x1c9698[_0xe6e8('0x19')]===_0xe6e8('0x1a')&&typeof _0x1c9698[_0xe6e8('0x1b')]===_0xe6e8('0x1a');var _0x34132c=_0x1fda73[_0xe6e8('0x1c')];var _0x5feee8=_0x454e5c?0x0:_0x1c9698[_0xe6e8('0x19')];var _0x436e86=_0x454e5c?_0x1fda73['count']:_0x1c9698['offset']+_0x1c9698[_0xe6e8('0x1b')];var _0x2e26e4;if(_0x436e86>=_0x34132c){_0x436e86=_0x34132c;_0x2e26e4=0xc8;}else{_0x2e26e4=0xce;}_0x4d36a0[_0xe6e8('0x17')](_0x2e26e4);return _0x4d36a0['set']('Content-Range',_0x5feee8+'-'+_0x436e86+'/'+_0x34132c)[_0xe6e8('0x18')](_0x1fda73);}return null;};}function patchUpdates(_0x1c51b5){return function(_0x33b289){try{jsonpatch['apply'](_0x33b289,_0x1c51b5,!![]);}catch(_0x562965){return BPromise[_0xe6e8('0x1d')](_0x562965);}return _0x33b289[_0xe6e8('0x1e')]();};}function saveUpdates(_0x43c979,_0x460dc2){return function(_0x21c5f6){if(_0x21c5f6){return _0x21c5f6['update'](_0x43c979)[_0xe6e8('0x1f')](function(_0x3d8916){return _0x3d8916;});}return null;};}function removeEntity(_0x398edf,_0x1edb7b){return function(_0x1a41e5){if(_0x1a41e5){return _0x1a41e5[_0xe6e8('0x20')]()['then'](function(){_0x398edf['status'](0xcc)[_0xe6e8('0x21')]();});}};}function handleEntityNotFound(_0x5e7a72,_0x4f3024){return function(_0x3cc011){if(!_0x3cc011){_0x5e7a72[_0xe6e8('0x16')](0x194);}return _0x3cc011;};}function handleError(_0x4c83cc,_0x32b175){_0x32b175=_0x32b175||0x1f4;return function(_0x4ced6e){logger['error'](_0x4ced6e[_0xe6e8('0x22')]);if(_0x4ced6e['name']){delete _0x4ced6e[_0xe6e8('0x23')];}_0x4c83cc[_0xe6e8('0x17')](_0x32b175)[_0xe6e8('0x24')](_0x4ced6e);};}exports[_0xe6e8('0x25')]=function(_0x24a55c,_0x2673b1){var _0x28c049={},_0x28df98={},_0x58417c={'count':0x0,'rows':[]};var _0x1feb8e=_[_0xe6e8('0x26')](db[_0xe6e8('0x27')][_0xe6e8('0x28')],function(_0x4280f6){return{'name':_0x4280f6['fieldName'],'type':_0x4280f6[_0xe6e8('0x29')][_0xe6e8('0x2a')]};});_0x28df98[_0xe6e8('0x2b')]=_[_0xe6e8('0x26')](_0x1feb8e,_0xe6e8('0x23'));_0x28df98[_0xe6e8('0x2c')]=_['keys'](_0x24a55c['query']);_0x28df98['filters']=_[_0xe6e8('0x2d')](_0x28df98[_0xe6e8('0x2b')],_0x28df98[_0xe6e8('0x2c')]);_0x28c049[_0xe6e8('0x2e')]=_['intersection'](_0x28df98['model'],qs['fields'](_0x24a55c['query']['fields']));_0x28c049[_0xe6e8('0x2e')]=_0x28c049[_0xe6e8('0x2e')][_0xe6e8('0x2f')]?_0x28c049['attributes']:_0x28df98[_0xe6e8('0x2b')];if(!_0x24a55c[_0xe6e8('0x2c')][_0xe6e8('0x30')]('nolimit')){_0x28c049['limit']=qs['limit'](_0x24a55c['query'][_0xe6e8('0x1b')]);_0x28c049[_0xe6e8('0x19')]=qs[_0xe6e8('0x19')](_0x24a55c[_0xe6e8('0x2c')][_0xe6e8('0x19')]);}_0x28c049['order']=qs[_0xe6e8('0x31')](_0x24a55c[_0xe6e8('0x2c')][_0xe6e8('0x31')]);_0x28c049[_0xe6e8('0x32')]=qs[_0xe6e8('0x33')](_['pick'](_0x24a55c[_0xe6e8('0x2c')],_0x28df98[_0xe6e8('0x33')]),_0x1feb8e);if(_0x24a55c['query'][_0xe6e8('0x34')]){_0x28c049[_0xe6e8('0x32')]=_[_0xe6e8('0x35')](_0x28c049[_0xe6e8('0x32')],{'$or':_[_0xe6e8('0x26')](_0x1feb8e,function(_0x462511){if(_0x462511[_0xe6e8('0x29')]!==_0xe6e8('0x36')){var _0x3255f4={};_0x3255f4[_0x462511['name']]={'$like':'%'+_0x24a55c['query'][_0xe6e8('0x34')]+'%'};return _0x3255f4;}})});}_0x28c049=_[_0xe6e8('0x35')]({},_0x28c049,_0x24a55c[_0xe6e8('0x37')]);var _0x4b4e41={'where':_0x28c049[_0xe6e8('0x32')]};return db[_0xe6e8('0x27')][_0xe6e8('0x1c')](_0x4b4e41)[_0xe6e8('0x1f')](function(_0x4f3ff2){_0x58417c[_0xe6e8('0x1c')]=_0x4f3ff2;if(_0x24a55c['query'][_0xe6e8('0x38')]){_0x28c049[_0xe6e8('0x39')]=[{'all':!![]}];}return db[_0xe6e8('0x27')]['findAll'](_0x28c049);})[_0xe6e8('0x1f')](function(_0x7b6e23){_0x58417c['rows']=_0x7b6e23;return _0x58417c;})[_0xe6e8('0x1f')](respondWithFilteredResult(_0x2673b1,_0x28c049))[_0xe6e8('0x3a')](handleError(_0x2673b1,null));};exports[_0xe6e8('0x3b')]=function(_0x9cac05,_0xdbaea1){var _0x7acef8={'raw':!![],'where':{'id':_0x9cac05[_0xe6e8('0x3c')]['id']}},_0x41f2aa={};_0x41f2aa[_0xe6e8('0x2b')]=_[_0xe6e8('0x3d')](db[_0xe6e8('0x27')][_0xe6e8('0x28')]);_0x41f2aa[_0xe6e8('0x2c')]=_[_0xe6e8('0x3d')](_0x9cac05['query']);_0x41f2aa[_0xe6e8('0x33')]=_[_0xe6e8('0x2d')](_0x41f2aa[_0xe6e8('0x2b')],_0x41f2aa[_0xe6e8('0x2c')]);_0x7acef8[_0xe6e8('0x2e')]=_[_0xe6e8('0x2d')](_0x41f2aa[_0xe6e8('0x2b')],qs[_0xe6e8('0x3e')](_0x9cac05[_0xe6e8('0x2c')][_0xe6e8('0x3e')]));_0x7acef8[_0xe6e8('0x2e')]=_0x7acef8['attributes'][_0xe6e8('0x2f')]?_0x7acef8[_0xe6e8('0x2e')]:_0x41f2aa['model'];if(_0x9cac05[_0xe6e8('0x2c')][_0xe6e8('0x38')]){_0x7acef8[_0xe6e8('0x39')]=[{'all':!![]}];}_0x7acef8=_['merge']({},_0x7acef8,_0x9cac05[_0xe6e8('0x37')]);return db[_0xe6e8('0x27')][_0xe6e8('0x3f')](_0x7acef8)[_0xe6e8('0x1f')](handleEntityNotFound(_0xdbaea1,null))[_0xe6e8('0x1f')](respondWithResult(_0xdbaea1,null))[_0xe6e8('0x3a')](handleError(_0xdbaea1,null));};exports[_0xe6e8('0x40')]=function(_0x49ac23,_0x30b2a3){return db['VoiceQueuesLog']['create'](_0x49ac23[_0xe6e8('0x41')],{})[_0xe6e8('0x1f')](respondWithResult(_0x30b2a3,0xc9))[_0xe6e8('0x3a')](handleError(_0x30b2a3,null));};exports[_0xe6e8('0x42')]=function(_0x5f0406,_0x422cbb){if(_0x5f0406['body']['id']){delete _0x5f0406[_0xe6e8('0x41')]['id'];}return db[_0xe6e8('0x27')][_0xe6e8('0x3f')]({'where':{'id':_0x5f0406[_0xe6e8('0x3c')]['id']}})[_0xe6e8('0x1f')](handleEntityNotFound(_0x422cbb,null))[_0xe6e8('0x1f')](saveUpdates(_0x5f0406[_0xe6e8('0x41')],null))[_0xe6e8('0x1f')](respondWithResult(_0x422cbb,null))[_0xe6e8('0x3a')](handleError(_0x422cbb,null));};exports[_0xe6e8('0x20')]=function(_0x478429,_0xa5729){return db['VoiceQueuesLog'][_0xe6e8('0x3f')]({'where':{'id':_0x478429[_0xe6e8('0x3c')]['id']}})[_0xe6e8('0x1f')](handleEntityNotFound(_0xa5729,null))[_0xe6e8('0x1f')](removeEntity(_0xa5729,null))['catch'](handleError(_0xa5729,null));}; \ No newline at end of file +var _0x966b=['catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','map','VIRTUAL','options','includeAll','include','findAll','rows','show','merge','find'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x966b,0x1d8));var _0xb966=function(_0x177e72,_0x28bf32){_0x177e72=_0x177e72-0x0;var _0x392698=_0x966b[_0x177e72];return _0x392698;};'use strict';var emlformat=require(_0xb966('0x0'));var rimraf=require(_0xb966('0x1'));var zipdir=require(_0xb966('0x2'));var jsonpatch=require(_0xb966('0x3'));var rp=require(_0xb966('0x4'));var moment=require(_0xb966('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb966('0x6'));var util=require(_0xb966('0x7'));var path=require(_0xb966('0x8'));var sox=require(_0xb966('0x9'));var csv=require('to-csv');var ejs=require(_0xb966('0xa'));var fs=require('fs');var fs_extra=require(_0xb966('0xb'));var _=require('lodash');var squel=require(_0xb966('0xc'));var crypto=require(_0xb966('0xd'));var jsforce=require(_0xb966('0xe'));var deskjs=require(_0xb966('0xf'));var toCsv=require(_0xb966('0x10'));var querystring=require(_0xb966('0x11'));var Papa=require(_0xb966('0x12'));var Redis=require('ioredis');var authService=require(_0xb966('0x13'));var qs=require(_0xb966('0x14'));var as=require(_0xb966('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb966('0x16'));var utils=require(_0xb966('0x17'));var config=require(_0xb966('0x18'));var licenseUtil=require(_0xb966('0x19'));var db=require(_0xb966('0x1a'))['db'];function respondWithStatusCode(_0x1a0339,_0x26a753){_0x26a753=_0x26a753||0xcc;return function(_0x1246fe){if(_0x1246fe){return _0x1a0339[_0xb966('0x1b')](_0x26a753);}return _0x1a0339[_0xb966('0x1c')](_0x26a753)[_0xb966('0x1d')]();};}function respondWithResult(_0x523a51,_0x2fedec){_0x2fedec=_0x2fedec||0xc8;return function(_0x1f0bf3){if(_0x1f0bf3){return _0x523a51['status'](_0x2fedec)['json'](_0x1f0bf3);}};}function respondWithFilteredResult(_0x2a4f67,_0x17b464){return function(_0x29bab1){if(_0x29bab1){var _0x576d16=typeof _0x17b464[_0xb966('0x1e')]===_0xb966('0x1f')&&typeof _0x17b464[_0xb966('0x20')]==='undefined';var _0x374faa=_0x29bab1[_0xb966('0x21')];var _0x8d807f=_0x576d16?0x0:_0x17b464['offset'];var _0x40b716=_0x576d16?_0x29bab1[_0xb966('0x21')]:_0x17b464[_0xb966('0x1e')]+_0x17b464[_0xb966('0x20')];var _0x4d812e;if(_0x40b716>=_0x374faa){_0x40b716=_0x374faa;_0x4d812e=0xc8;}else{_0x4d812e=0xce;}_0x2a4f67['status'](_0x4d812e);return _0x2a4f67[_0xb966('0x22')](_0xb966('0x23'),_0x8d807f+'-'+_0x40b716+'/'+_0x374faa)[_0xb966('0x24')](_0x29bab1);}return null;};}function patchUpdates(_0x197e2e){return function(_0x3ac372){try{jsonpatch[_0xb966('0x25')](_0x3ac372,_0x197e2e,!![]);}catch(_0x4dbe4a){return BPromise[_0xb966('0x26')](_0x4dbe4a);}return _0x3ac372[_0xb966('0x27')]();};}function saveUpdates(_0x496da3,_0x322191){return function(_0xa4ea51){if(_0xa4ea51){return _0xa4ea51['update'](_0x496da3)[_0xb966('0x28')](function(_0x3c20ea){return _0x3c20ea;});}return null;};}function removeEntity(_0x329026,_0x5a9225){return function(_0x36410c){if(_0x36410c){return _0x36410c[_0xb966('0x29')]()[_0xb966('0x28')](function(){_0x329026[_0xb966('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17de26,_0x3b248f){return function(_0x329db8){if(!_0x329db8){_0x17de26[_0xb966('0x1b')](0x194);}return _0x329db8;};}function handleError(_0x518094,_0x37ca82){_0x37ca82=_0x37ca82||0x1f4;return function(_0x4953ec){logger[_0xb966('0x2a')](_0x4953ec['stack']);if(_0x4953ec[_0xb966('0x2b')]){delete _0x4953ec['name'];}_0x518094[_0xb966('0x1c')](_0x37ca82)[_0xb966('0x2c')](_0x4953ec);};}exports[_0xb966('0x2d')]=function(_0x21a758,_0xfa5658){var _0xc5d92c={},_0x4cf884={},_0x19e0cd={'count':0x0,'rows':[]};var _0x263b56=_['map'](db[_0xb966('0x2e')][_0xb966('0x2f')],function(_0x249c4c){return{'name':_0x249c4c[_0xb966('0x30')],'type':_0x249c4c[_0xb966('0x31')][_0xb966('0x32')]};});_0x4cf884['model']=_['map'](_0x263b56,'name');_0x4cf884[_0xb966('0x33')]=_[_0xb966('0x34')](_0x21a758[_0xb966('0x33')]);_0x4cf884[_0xb966('0x35')]=_[_0xb966('0x36')](_0x4cf884[_0xb966('0x37')],_0x4cf884['query']);_0xc5d92c[_0xb966('0x38')]=_[_0xb966('0x36')](_0x4cf884[_0xb966('0x37')],qs['fields'](_0x21a758[_0xb966('0x33')][_0xb966('0x39')]));_0xc5d92c[_0xb966('0x38')]=_0xc5d92c[_0xb966('0x38')][_0xb966('0x3a')]?_0xc5d92c['attributes']:_0x4cf884[_0xb966('0x37')];if(!_0x21a758['query']['hasOwnProperty'](_0xb966('0x3b'))){_0xc5d92c['limit']=qs[_0xb966('0x20')](_0x21a758[_0xb966('0x33')][_0xb966('0x20')]);_0xc5d92c[_0xb966('0x1e')]=qs['offset'](_0x21a758[_0xb966('0x33')][_0xb966('0x1e')]);}_0xc5d92c[_0xb966('0x3c')]=qs[_0xb966('0x3d')](_0x21a758[_0xb966('0x33')]['sort']);_0xc5d92c[_0xb966('0x3e')]=qs[_0xb966('0x35')](_['pick'](_0x21a758[_0xb966('0x33')],_0x4cf884[_0xb966('0x35')]),_0x263b56);if(_0x21a758[_0xb966('0x33')][_0xb966('0x3f')]){_0xc5d92c['where']=_['merge'](_0xc5d92c[_0xb966('0x3e')],{'$or':_[_0xb966('0x40')](_0x263b56,function(_0x43aa09){if(_0x43aa09[_0xb966('0x31')]!==_0xb966('0x41')){var _0x190887={};_0x190887[_0x43aa09[_0xb966('0x2b')]]={'$like':'%'+_0x21a758[_0xb966('0x33')][_0xb966('0x3f')]+'%'};return _0x190887;}})});}_0xc5d92c=_['merge']({},_0xc5d92c,_0x21a758[_0xb966('0x42')]);var _0x8962ea={'where':_0xc5d92c['where']};return db[_0xb966('0x2e')][_0xb966('0x21')](_0x8962ea)['then'](function(_0x39242c){_0x19e0cd[_0xb966('0x21')]=_0x39242c;if(_0x21a758['query'][_0xb966('0x43')]){_0xc5d92c[_0xb966('0x44')]=[{'all':!![]}];}return db[_0xb966('0x2e')][_0xb966('0x45')](_0xc5d92c);})[_0xb966('0x28')](function(_0x3ceb5c){_0x19e0cd[_0xb966('0x46')]=_0x3ceb5c;return _0x19e0cd;})[_0xb966('0x28')](respondWithFilteredResult(_0xfa5658,_0xc5d92c))['catch'](handleError(_0xfa5658,null));};exports[_0xb966('0x47')]=function(_0x5d3260,_0x25ba1b){var _0x44f0b2={'raw':!![],'where':{'id':_0x5d3260['params']['id']}},_0x5a70fb={};_0x5a70fb[_0xb966('0x37')]=_['keys'](db['VoiceQueuesLog'][_0xb966('0x2f')]);_0x5a70fb[_0xb966('0x33')]=_['keys'](_0x5d3260[_0xb966('0x33')]);_0x5a70fb[_0xb966('0x35')]=_[_0xb966('0x36')](_0x5a70fb['model'],_0x5a70fb[_0xb966('0x33')]);_0x44f0b2[_0xb966('0x38')]=_[_0xb966('0x36')](_0x5a70fb['model'],qs[_0xb966('0x39')](_0x5d3260['query'][_0xb966('0x39')]));_0x44f0b2[_0xb966('0x38')]=_0x44f0b2[_0xb966('0x38')][_0xb966('0x3a')]?_0x44f0b2[_0xb966('0x38')]:_0x5a70fb[_0xb966('0x37')];if(_0x5d3260['query']['includeAll']){_0x44f0b2[_0xb966('0x44')]=[{'all':!![]}];}_0x44f0b2=_[_0xb966('0x48')]({},_0x44f0b2,_0x5d3260[_0xb966('0x42')]);return db[_0xb966('0x2e')][_0xb966('0x49')](_0x44f0b2)[_0xb966('0x28')](handleEntityNotFound(_0x25ba1b,null))[_0xb966('0x28')](respondWithResult(_0x25ba1b,null))[_0xb966('0x4a')](handleError(_0x25ba1b,null));};exports[_0xb966('0x4b')]=function(_0xe17dc6,_0x10c909){return db['VoiceQueuesLog'][_0xb966('0x4b')](_0xe17dc6['body'],{})[_0xb966('0x28')](respondWithResult(_0x10c909,0xc9))[_0xb966('0x4a')](handleError(_0x10c909,null));};exports['update']=function(_0x1af949,_0x269e63){if(_0x1af949[_0xb966('0x4c')]['id']){delete _0x1af949[_0xb966('0x4c')]['id'];}return db[_0xb966('0x2e')]['find']({'where':{'id':_0x1af949[_0xb966('0x4d')]['id']}})[_0xb966('0x28')](handleEntityNotFound(_0x269e63,null))[_0xb966('0x28')](saveUpdates(_0x1af949[_0xb966('0x4c')],null))['then'](respondWithResult(_0x269e63,null))[_0xb966('0x4a')](handleError(_0x269e63,null));};exports[_0xb966('0x29')]=function(_0x54878f,_0x1dd3a6){return db[_0xb966('0x2e')][_0xb966('0x49')]({'where':{'id':_0x54878f[_0xb966('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1dd3a6,null))[_0xb966('0x28')](removeEntity(_0x1dd3a6,null))[_0xb966('0x4a')](handleError(_0x1dd3a6,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a8b0c07..b205ba2 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 _0x639d=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','define'];(function(_0x5c8d81,_0x4db846){var _0x15c102=function(_0x268773){while(--_0x268773){_0x5c8d81['push'](_0x5c8d81['shift']());}};_0x15c102(++_0x4db846);}(_0x639d,0xbb));var _0xd639=function(_0x55313f,_0x51a9b1){_0x55313f=_0x55313f-0x0;var _0x585681=_0x639d[_0x55313f];return _0x585681;};'use strict';var _=require(_0xd639('0x0'));var util=require(_0xd639('0x1'));var logger=require(_0xd639('0x2'))('api');var moment=require(_0xd639('0x3'));var BPromise=require(_0xd639('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd639('0x5'));var rimraf=require('rimraf');var config=require(_0xd639('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x2a71b9,_0x1cebd4){return _0x2a71b9[_0xd639('0x7')](_0xd639('0x8'),attributes,{'tableName':_0xd639('0x9'),'paranoid':![],'indexes':[{'name':_0xd639('0xa'),'fields':[_0xd639('0xb'),_0xd639('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9670=['path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c418a,_0x3f14fe){var _0x441455=function(_0x3cd934){while(--_0x3cd934){_0x4c418a['push'](_0x4c418a['shift']());}};_0x441455(++_0x3f14fe);}(_0x9670,0xea));var _0x0967=function(_0x2541e1,_0x36f711){_0x2541e1=_0x2541e1-0x0;var _0x1b194e=_0x9670[_0x2541e1];return _0x1b194e;};'use strict';var _=require(_0x0967('0x0'));var util=require('util');var logger=require(_0x0967('0x1'))(_0x0967('0x2'));var moment=require(_0x0967('0x3'));var BPromise=require(_0x0967('0x4'));var rp=require(_0x0967('0x5'));var fs=require('fs');var path=require(_0x0967('0x6'));var rimraf=require(_0x0967('0x7'));var config=require(_0x0967('0x8'));var attributes=require(_0x0967('0x9'));module[_0x0967('0xa')]=function(_0x2c60b9,_0x491d4c){return _0x2c60b9['define'](_0x0967('0xb'),attributes,{'tableName':_0x0967('0xc'),'paranoid':![],'indexes':[{'name':_0x0967('0xd'),'fields':[_0x0967('0xe'),_0x0967('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index a87dab5..a40ab7d 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 _0x2f90=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3deab6,_0x41da76){var _0x314d9d=function(_0x36d792){while(--_0x36d792){_0x3deab6['push'](_0x3deab6['shift']());}};_0x314d9d(++_0x41da76);}(_0x2f90,0x1e9));var _0x02f9=function(_0x3120e6,_0x324456){_0x3120e6=_0x3120e6-0x0;var _0x5b739f=_0x2f90[_0x3120e6];return _0x5b739f;};'use strict';var _=require('lodash');var util=require(_0x02f9('0x0'));var moment=require(_0x02f9('0x1'));var BPromise=require(_0x02f9('0x2'));var rs=require(_0x02f9('0x3'));var fs=require('fs');var Redis=require(_0x02f9('0x4'));var db=require(_0x02f9('0x5'))['db'];var utils=require(_0x02f9('0x6'));var logger=require(_0x02f9('0x7'))(_0x02f9('0x8'));var config=require('../../config/environment');var jayson=require(_0x02f9('0x9'));var client=jayson[_0x02f9('0xa')][_0x02f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bbcdb,_0x1e7531,_0x5f3841){return new BPromise(function(_0x34135f,_0x3b8788){return client[_0x02f9('0xc')](_0x4bbcdb,_0x5f3841)[_0x02f9('0xd')](function(_0x180237){logger[_0x02f9('0xe')](_0x02f9('0xf'),_0x1e7531,_0x02f9('0x10'));logger[_0x02f9('0x11')](_0x02f9('0x12'),_0x1e7531,_0x02f9('0x10'),JSON[_0x02f9('0x13')](_0x180237));if(_0x180237['error']){if(_0x180237[_0x02f9('0x14')][_0x02f9('0x15')]===0x1f4){logger['error'](_0x02f9('0xf'),_0x1e7531,_0x180237[_0x02f9('0x14')]['message']);return _0x3b8788(_0x180237[_0x02f9('0x14')][_0x02f9('0x16')]);}logger[_0x02f9('0x14')](_0x02f9('0xf'),_0x1e7531,_0x180237['error'][_0x02f9('0x16')]);return _0x34135f(_0x180237[_0x02f9('0x14')]['message']);}else{logger[_0x02f9('0xe')](_0x02f9('0xf'),_0x1e7531,_0x02f9('0x10'));_0x34135f(_0x180237['result'][_0x02f9('0x16')]);}})[_0x02f9('0x17')](function(_0x15705d){logger[_0x02f9('0x14')](_0x02f9('0xf'),_0x1e7531,_0x15705d);_0x3b8788(_0x15705d);});});} \ No newline at end of file +var _0xa87e=['client','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x422746,_0x159cc7){var _0x294ae1=function(_0x42b394){while(--_0x42b394){_0x422746['push'](_0x422746['shift']());}};_0x294ae1(++_0x159cc7);}(_0xa87e,0x173));var _0xea87=function(_0x2bd567,_0x999084){_0x2bd567=_0x2bd567-0x0;var _0xa2d549=_0xa87e[_0x2bd567];return _0xa2d549;};'use strict';var _=require('lodash');var util=require(_0xea87('0x0'));var moment=require(_0xea87('0x1'));var BPromise=require(_0xea87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea87('0x3'));var db=require(_0xea87('0x4'))['db'];var utils=require(_0xea87('0x5'));var logger=require(_0xea87('0x6'))(_0xea87('0x7'));var config=require('../../config/environment');var jayson=require(_0xea87('0x8'));var client=jayson[_0xea87('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3c3a,_0x1b566a,_0x36352b){return new BPromise(function(_0xd0dd3b,_0xa7d4f){return client['request'](_0x2f3c3a,_0x36352b)[_0xea87('0xa')](function(_0x1ea786){logger['info'](_0xea87('0xb'),_0x1b566a,_0xea87('0xc'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x1b566a,_0xea87('0xc'),JSON[_0xea87('0xd')](_0x1ea786));if(_0x1ea786[_0xea87('0xe')]){if(_0x1ea786[_0xea87('0xe')][_0xea87('0xf')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1b566a,_0x1ea786[_0xea87('0xe')][_0xea87('0x10')]);return _0xa7d4f(_0x1ea786['error'][_0xea87('0x10')]);}logger[_0xea87('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1b566a,_0x1ea786[_0xea87('0xe')][_0xea87('0x10')]);return _0xd0dd3b(_0x1ea786[_0xea87('0xe')][_0xea87('0x10')]);}else{logger[_0xea87('0x11')](_0xea87('0xb'),_0x1b566a,'request\x20sent');_0xd0dd3b(_0x1ea786[_0xea87('0x12')][_0xea87('0x10')]);}})['catch'](function(_0x22b62d){logger[_0xea87('0xe')](_0xea87('0xb'),_0x1b566a,_0x22b62d);_0xa7d4f(_0x22b62d);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 07129e8..6ba617c 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 _0x4e72=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xee0e8a,_0x20aba0){var _0x1c6e38=function(_0x45ab3b){while(--_0x45ab3b){_0xee0e8a['push'](_0xee0e8a['shift']());}};_0x1c6e38(++_0x20aba0);}(_0x4e72,0xa7));var _0x24e7=function(_0x4b699d,_0x13ca10){_0x4b699d=_0x4b699d-0x0;var _0x194915=_0x4e72[_0x4b699d];return _0x194915;};'use strict';var multer=require(_0x24e7('0x0'));var util=require(_0x24e7('0x1'));var path=require(_0x24e7('0x2'));var timeout=require(_0x24e7('0x3'));var express=require(_0x24e7('0x4'));var router=express[_0x24e7('0x5')]();var fs_extra=require(_0x24e7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x24e7('0x7'));var config=require(_0x24e7('0x8'));var controller=require(_0x24e7('0x9'));router[_0x24e7('0xa')]('/',auth[_0x24e7('0xb')](),controller[_0x24e7('0xc')]);router[_0x24e7('0xa')](_0x24e7('0xd'),auth[_0x24e7('0xb')](),controller[_0x24e7('0xe')]);router[_0x24e7('0xa')]('/:id',auth[_0x24e7('0xb')](),controller[_0x24e7('0xf')]);router[_0x24e7('0xa')](_0x24e7('0x10'),auth[_0x24e7('0xb')](),controller['download']);router[_0x24e7('0xa')](_0x24e7('0x11'),controller[_0x24e7('0x12')]);router[_0x24e7('0xa')](_0x24e7('0x13'),auth[_0x24e7('0xb')](),controller[_0x24e7('0x14')]);router[_0x24e7('0x15')]('/',auth[_0x24e7('0xb')](),controller[_0x24e7('0x16')]);router[_0x24e7('0x15')](_0x24e7('0x13'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0x24e7('0x17')](_0x24e7('0x18'),auth[_0x24e7('0xb')](),controller[_0x24e7('0x19')]);router[_0x24e7('0x1a')](_0x24e7('0x18'),auth[_0x24e7('0xb')](),controller[_0x24e7('0x1b')]);module[_0x24e7('0x1c')]=router; \ No newline at end of file +var _0x66e4=['Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','download','/:id/downloads','/:id/transcribe','post','runTranscribe','put','/:id','update','delete','destroy','util','connect-timeout','express'];(function(_0x1b9169,_0x40f904){var _0x59ea07=function(_0x4c2bec){while(--_0x4c2bec){_0x1b9169['push'](_0x1b9169['shift']());}};_0x59ea07(++_0x40f904);}(_0x66e4,0x6b));var _0x466e=function(_0x57cdc3,_0x99c792){_0x57cdc3=_0x57cdc3-0x0;var _0x526d01=_0x66e4[_0x57cdc3];return _0x526d01;};'use strict';var multer=require('multer');var util=require(_0x466e('0x0'));var path=require('path');var timeout=require(_0x466e('0x1'));var express=require(_0x466e('0x2'));var router=express[_0x466e('0x3')]();var fs_extra=require(_0x466e('0x4'));var auth=require(_0x466e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x466e('0x6'));var controller=require(_0x466e('0x7'));router[_0x466e('0x8')]('/',auth[_0x466e('0x9')](),controller['index']);router[_0x466e('0x8')](_0x466e('0xa'),auth['isAuthenticated'](),controller[_0x466e('0xb')]);router[_0x466e('0x8')]('/:id',auth[_0x466e('0x9')](),controller['show']);router[_0x466e('0x8')]('/:id/download',auth[_0x466e('0x9')](),controller[_0x466e('0xc')]);router[_0x466e('0x8')](_0x466e('0xd'),controller['downloads']);router[_0x466e('0x8')](_0x466e('0xe'),auth[_0x466e('0x9')](),controller['downloadTranscribe']);router[_0x466e('0xf')]('/',auth[_0x466e('0x9')](),controller['create']);router[_0x466e('0xf')](_0x466e('0xe'),auth['isAuthenticated'](),controller[_0x466e('0x10')]);router[_0x466e('0x11')](_0x466e('0x12'),auth[_0x466e('0x9')](),controller[_0x466e('0x13')]);router[_0x466e('0x14')]('/:id',auth[_0x466e('0x9')](),controller[_0x466e('0x15')]);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 fac2fff..49a6ed5 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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var 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 72d2ac8..ed07411 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 _0xe9aa=['transcribeStatus','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','.txt','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','model','format','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','keys','includeAll','find','catch','create','body','describe','download','uniqueid','params','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','downloads','sequelize','col','push','$and','Sequelize','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','listBuckets','createBucket','upload','TranscribeService','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets'];(function(_0x1232ec,_0x2df4b1){var _0x4483b4=function(_0x39bfff){while(--_0x39bfff){_0x1232ec['push'](_0x1232ec['shift']());}};_0x4483b4(++_0x2df4b1);}(_0xe9aa,0x1c0));var _0xae9a=function(_0x5c3911,_0x5036d7){_0x5c3911=_0x5c3911-0x0;var _0x553db7=_0xe9aa[_0x5c3911];return _0x553db7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae9a('0x0'));var zipdir=require(_0xae9a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae9a('0x2'));var moment=require(_0xae9a('0x3'));var BPromise=require(_0xae9a('0x4'));var Mustache=require('mustache');var util=require(_0xae9a('0x5'));var path=require('path');var sox=require(_0xae9a('0x6'));var csv=require('to-csv');var ejs=require(_0xae9a('0x7'));var fs=require('fs');var fs_extra=require(_0xae9a('0x8'));var _=require(_0xae9a('0x9'));var squel=require(_0xae9a('0xa'));var crypto=require(_0xae9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xae9a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xae9a('0xd'));var Papa=require(_0xae9a('0xe'));var AWS=require(_0xae9a('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0xae9a('0x10'));var authService=require(_0xae9a('0x11'));var qs=require(_0xae9a('0x12'));var as=require(_0xae9a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xae9a('0x14'));var utils=require(_0xae9a('0x15'));var config=require(_0xae9a('0x16'));var licenseUtil=require(_0xae9a('0x17'));var db=require(_0xae9a('0x18'))['db'];function respondWithStatusCode(_0x27b9e5,_0x4f041c){_0x4f041c=_0x4f041c||0xcc;return function(_0x4f6c04){if(_0x4f6c04){return _0x27b9e5[_0xae9a('0x19')](_0x4f041c);}return _0x27b9e5['status'](_0x4f041c)[_0xae9a('0x1a')]();};}function respondWithResult(_0x35b03e,_0x58058b){_0x58058b=_0x58058b||0xc8;return function(_0x2946b8){if(_0x2946b8){return _0x35b03e[_0xae9a('0x1b')](_0x58058b)['json'](_0x2946b8);}};}function respondWithFilteredResult(_0xf4c77d,_0x677a53){return function(_0x3ed297){if(_0x3ed297){var _0x2138ca=typeof _0x677a53[_0xae9a('0x1c')]==='undefined'&&typeof _0x677a53['limit']===_0xae9a('0x1d');var _0x117215=_0x3ed297[_0xae9a('0x1e')];var _0x5277ef=_0x2138ca?0x0:_0x677a53[_0xae9a('0x1c')];var _0x595ed8=_0x2138ca?_0x3ed297[_0xae9a('0x1e')]:_0x677a53['offset']+_0x677a53[_0xae9a('0x1f')];var _0x403135;if(_0x595ed8>=_0x117215){_0x595ed8=_0x117215;_0x403135=0xc8;}else{_0x403135=0xce;}_0xf4c77d[_0xae9a('0x1b')](_0x403135);return _0xf4c77d[_0xae9a('0x20')](_0xae9a('0x21'),_0x5277ef+'-'+_0x595ed8+'/'+_0x117215)['json'](_0x3ed297);}return null;};}function patchUpdates(_0x4a4fa7){return function(_0x5eaad9){try{jsonpatch[_0xae9a('0x22')](_0x5eaad9,_0x4a4fa7,!![]);}catch(_0x3cf594){return BPromise[_0xae9a('0x23')](_0x3cf594);}return _0x5eaad9[_0xae9a('0x24')]();};}function saveUpdates(_0x3ff137,_0x149996){return function(_0x1c46b3){if(_0x1c46b3){return _0x1c46b3[_0xae9a('0x25')](_0x3ff137)[_0xae9a('0x26')](function(_0x2bb3ea){return _0x2bb3ea;});}return null;};}function removeEntity(_0x26eec2,_0x30dfdc){return function(_0x116f42){if(_0x116f42){return _0x116f42[_0xae9a('0x27')]()[_0xae9a('0x26')](function(){_0x26eec2[_0xae9a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7c0a,_0x331817){return function(_0x18305d){if(!_0x18305d){_0x1c7c0a[_0xae9a('0x19')](0x194);}return _0x18305d;};}function handleError(_0x40018e,_0x33382d){_0x33382d=_0x33382d||0x1f4;return function(_0x4c533d){logger['error'](_0x4c533d[_0xae9a('0x28')]);if(_0x4c533d[_0xae9a('0x29')]){delete _0x4c533d[_0xae9a('0x29')];}_0x40018e[_0xae9a('0x1b')](_0x33382d)[_0xae9a('0x2a')](_0x4c533d);};}exports[_0xae9a('0x2b')]=function(_0x2c2150,_0x1e46fc){var _0x750351={},_0x346d59={},_0x2a26f9={'count':0x0,'rows':[]};var _0x3a0819=_[_0xae9a('0x2c')](db[_0xae9a('0x2d')][_0xae9a('0x2e')],function(_0x81287e){return{'name':_0x81287e[_0xae9a('0x2f')],'type':_0x81287e[_0xae9a('0x30')]['key']};});_0x346d59[_0xae9a('0x31')]=_['differenceBy'](_[_0xae9a('0x2c')](_0x3a0819,_0xae9a('0x29')),[_0xae9a('0x32')]);_0x346d59[_0xae9a('0x33')]=_['keys'](_0x2c2150['query']);_0x346d59[_0xae9a('0x34')]=_['intersection'](_0x346d59[_0xae9a('0x31')],_0x346d59[_0xae9a('0x33')]);_0x750351[_0xae9a('0x35')]=_[_0xae9a('0x36')](_0x346d59['model'],qs[_0xae9a('0x37')](_0x2c2150[_0xae9a('0x33')][_0xae9a('0x37')]));_0x750351[_0xae9a('0x35')]=_0x750351['attributes'][_0xae9a('0x38')]?_0x750351[_0xae9a('0x35')]:_0x346d59[_0xae9a('0x31')];if(!_0x2c2150[_0xae9a('0x33')][_0xae9a('0x39')](_0xae9a('0x3a'))){_0x750351[_0xae9a('0x1f')]=qs[_0xae9a('0x1f')](_0x2c2150[_0xae9a('0x33')][_0xae9a('0x1f')]);_0x750351[_0xae9a('0x1c')]=qs[_0xae9a('0x1c')](_0x2c2150[_0xae9a('0x33')][_0xae9a('0x1c')]);}_0x750351['order']=qs[_0xae9a('0x3b')](_0x2c2150[_0xae9a('0x33')]['sort']);_0x750351[_0xae9a('0x3c')]=qs[_0xae9a('0x34')](_[_0xae9a('0x3d')](_0x2c2150[_0xae9a('0x33')],_0x346d59[_0xae9a('0x34')]),_0x3a0819);if(_0x2c2150[_0xae9a('0x33')][_0xae9a('0x3e')]){_0x750351['where']=_[_0xae9a('0x3f')](_0x750351[_0xae9a('0x3c')],{'$or':_[_0xae9a('0x2c')](_0x3a0819,function(_0x5c6f3c){if(_0x5c6f3c['type']!==_0xae9a('0x40')){var _0x560f68={};_0x560f68[_0x5c6f3c[_0xae9a('0x29')]]={'$like':'%'+_0x2c2150[_0xae9a('0x33')][_0xae9a('0x3e')]+'%'};return _0x560f68;}})});}_0x750351=_[_0xae9a('0x3f')]({},_0x750351,_0x2c2150[_0xae9a('0x41')]);var _0x16442e={'where':_0x750351[_0xae9a('0x3c')]};return db[_0xae9a('0x2d')][_0xae9a('0x1e')](_0x16442e)[_0xae9a('0x26')](function(_0x2ce2bb){_0x2a26f9[_0xae9a('0x1e')]=_0x2ce2bb;if(_0x2c2150['query']['includeAll']){_0x750351[_0xae9a('0x42')]=[{'all':!![]}];}return db[_0xae9a('0x2d')]['findAll'](_0x750351);})['then'](function(_0x1c52c7){_0x2a26f9[_0xae9a('0x43')]=_0x1c52c7;return _0x2a26f9;})['then'](respondWithFilteredResult(_0x1e46fc,_0x750351))['catch'](handleError(_0x1e46fc,null));};exports[_0xae9a('0x44')]=function(_0x574518,_0x1001f7){var _0x318873={'raw':![],'where':{'id':_0x574518['params']['id']}},_0x3ded4b={};_0x3ded4b[_0xae9a('0x31')]=_[_0xae9a('0x45')](db[_0xae9a('0x2d')]['rawAttributes']);_0x3ded4b[_0xae9a('0x33')]=_[_0xae9a('0x45')](_0x574518[_0xae9a('0x33')]);_0x3ded4b['filters']=_[_0xae9a('0x36')](_0x3ded4b[_0xae9a('0x31')],_0x3ded4b[_0xae9a('0x33')]);_0x318873[_0xae9a('0x35')]=_[_0xae9a('0x36')](_0x3ded4b['model'],qs[_0xae9a('0x37')](_0x574518[_0xae9a('0x33')]['fields']));_0x318873['attributes']=_0x318873[_0xae9a('0x35')]['length']?_0x318873[_0xae9a('0x35')]:_0x3ded4b[_0xae9a('0x31')];if(_0x574518[_0xae9a('0x33')][_0xae9a('0x46')]){_0x318873[_0xae9a('0x42')]=[{'all':!![]}];}_0x318873=_['merge']({},_0x318873,_0x574518[_0xae9a('0x41')]);return db[_0xae9a('0x2d')][_0xae9a('0x47')](_0x318873)[_0xae9a('0x26')](handleEntityNotFound(_0x1001f7,null))[_0xae9a('0x26')](respondWithResult(_0x1001f7,null))[_0xae9a('0x48')](handleError(_0x1001f7,null));};exports[_0xae9a('0x49')]=function(_0x1c5d07,_0x5a596c){return db[_0xae9a('0x2d')][_0xae9a('0x49')](_0x1c5d07[_0xae9a('0x4a')],{})[_0xae9a('0x26')](respondWithResult(_0x5a596c,0xc9))[_0xae9a('0x48')](handleError(_0x5a596c,null));};exports[_0xae9a('0x25')]=function(_0x1a1959,_0x58af58){if(_0x1a1959[_0xae9a('0x4a')]['id']){delete _0x1a1959[_0xae9a('0x4a')]['id'];}return db[_0xae9a('0x2d')][_0xae9a('0x47')]({'where':{'id':_0x1a1959['params']['id']}})[_0xae9a('0x26')](handleEntityNotFound(_0x58af58,null))[_0xae9a('0x26')](saveUpdates(_0x1a1959[_0xae9a('0x4a')],null))[_0xae9a('0x26')](respondWithResult(_0x58af58,null))[_0xae9a('0x48')](handleError(_0x58af58,null));};exports[_0xae9a('0x4b')]=function(_0x30cc59,_0x21bdbe){return db[_0xae9a('0x2d')][_0xae9a('0x4b')]()[_0xae9a('0x26')](respondWithResult(_0x21bdbe,null))[_0xae9a('0x48')](handleError(_0x21bdbe,null));};exports[_0xae9a('0x4c')]=function(_0x6605e0,_0x44d133,_0x124d66){var _0x18a696=require('../../components/encryptor');var _0x3a96a0=![];var _0x284a55={};if(_0x6605e0['query'][_0xae9a('0x30')]&&_0x6605e0[_0xae9a('0x33')][_0xae9a('0x30')]===_0xae9a('0x4d')){_0x284a55[_0xae9a('0x4d')]=_0x6605e0[_0xae9a('0x4e')]['id'];}else{_0x284a55['id']=_0x6605e0['params']['id'];}return db[_0xae9a('0x2d')][_0xae9a('0x47')]({'where':_0x284a55,'attributes':['id',_0xae9a('0x4f')],'raw':!![]})[_0xae9a('0x26')](handleEntityNotFound(_0x44d133,null))['then'](function(_0x1f506f){if(_0x1f506f){var _0x835f6c=_0x1f506f[_0xae9a('0x4f')];var _0x741d62=util[_0xae9a('0x32')](_0xae9a('0x50'),_0x835f6c);if(fs[_0xae9a('0x51')](_0x741d62)){_0x3a96a0=!![];return _0x18a696[_0xae9a('0x52')](_0x741d62,_0x835f6c,config[_0xae9a('0x53')][_0xae9a('0x54')])[_0xae9a('0x26')](function(){return _0x1f506f;});}return _0x1f506f;}})[_0xae9a('0x26')](function(_0x453261){if(_0x453261){var _0x2056f8=_0x453261[_0xae9a('0x4f')];if(!fs[_0xae9a('0x51')](_0x2056f8)){throw new db['Sequelize'][(_0xae9a('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x453261[_0xae9a('0x56')]){return _0x44d133[_0xae9a('0x4c')](_0x2056f8,_0x453261[_0xae9a('0x56')]+path[_0xae9a('0x57')](_0x2056f8),function(){if(_0x3a96a0){fs['unlink'](_0x2056f8);}});}else{return _0x44d133[_0xae9a('0x4c')](_0x2056f8,function(_0x1f9181){if(_0x3a96a0){fs[_0xae9a('0x58')](_0x2056f8);}});}}})[_0xae9a('0x48')](function(_0x196844){if(_0x196844[_0xae9a('0x59')]===_0xae9a('0x5a')){_0x44d133[_0xae9a('0x1b')](0x194)[_0xae9a('0x2a')]('Not\x20found');}else{return handleError(_0x44d133,null);}});};exports[_0xae9a('0x5b')]=function(_0x2f4558,_0x47fec6,_0x8042e5){var _0x3cc64a=require('../../components/encryptor');var _0x32f9ef=![];var _0x66c035={'$and':[db[_0xae9a('0x5c')]['where'](db[_0xae9a('0x5c')]['fn']('MD5',db[_0xae9a('0x5c')][_0xae9a('0x5d')](_0xae9a('0x4d'))),_0x2f4558[_0xae9a('0x33')]['token'])]};if(_0x2f4558[_0xae9a('0x33')][_0xae9a('0x30')]&&_0x2f4558['query'][_0xae9a('0x30')]==='uniqueid'){_0x66c035['$and'][_0xae9a('0x5e')]({'uniqueid':_0x2f4558[_0xae9a('0x4e')]['id']});}else{_0x66c035[_0xae9a('0x5f')][_0xae9a('0x5e')]({'id':_0x2f4558[_0xae9a('0x4e')]['id']});}return db['VoiceRecording'][_0xae9a('0x47')]({'where':_0x66c035,'attributes':['id',_0xae9a('0x4f')],'raw':!![]})[_0xae9a('0x26')](handleEntityNotFound(_0x47fec6,null))[_0xae9a('0x26')](function(_0x34222d){if(_0x34222d){var _0x2bbea9=util[_0xae9a('0x32')]('%s.cypher',_0x34222d[_0xae9a('0x4f')]);if(fs[_0xae9a('0x51')](_0x2bbea9)){_0x32f9ef=!![];return _0x3cc64a['decryptFile'](_0x2bbea9,_0x34222d[_0xae9a('0x4f')],config[_0xae9a('0x53')][_0xae9a('0x54')])['then'](function(){return _0x34222d;});}return _0x34222d;}})[_0xae9a('0x26')](function(_0x2d436d){if(_0x2d436d){if(!fs[_0xae9a('0x51')](_0x2d436d[_0xae9a('0x4f')])){throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))](_0xae9a('0x5a'));}if(_0x2d436d['filename']){return _0x47fec6[_0xae9a('0x4c')](_0x2d436d[_0xae9a('0x4f')],_0x2d436d['filename']+path[_0xae9a('0x57')](_0x2d436d[_0xae9a('0x4f')]),function(){if(_0x32f9ef){fs[_0xae9a('0x58')](_0x2d436d['value']);}});}else{return _0x47fec6[_0xae9a('0x4c')](_0x2d436d[_0xae9a('0x4f')],function(_0x180ccf){if(_0x32f9ef){fs['unlink'](_0x2d436d[_0xae9a('0x4f')]);}});}}})[_0xae9a('0x48')](handleError(_0x47fec6,null));};exports[_0xae9a('0x27')]=function(_0x836538,_0x38727e){return db[_0xae9a('0x2d')][_0xae9a('0x47')]({'where':{'id':_0x836538[_0xae9a('0x4e')]['id']}})[_0xae9a('0x26')](function(_0x3cb72f){if(_[_0xae9a('0x61')](_0x3cb72f)){throw new ReferenceError(_0xae9a('0x62'));}return _0x3cb72f;})[_0xae9a('0x26')](function(_0x2adb5f){var _0x594e70=_0x2adb5f[_0xae9a('0x4f')];logger[_0xae9a('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x594e70);if(!_[_0xae9a('0x61')](_0x2adb5f[_0xae9a('0x4f')])&&fs[_0xae9a('0x51')](_0x594e70)){logger[_0xae9a('0x63')]('File:\x20\x22'+_0x594e70+_0xae9a('0x64'));fs['unlinkSync'](_0x594e70);}_0x594e70=_0x594e70+_0xae9a('0x65');if(!_[_0xae9a('0x61')](_0x2adb5f[_0xae9a('0x4f')])&&fs[_0xae9a('0x51')](_0x594e70)){logger[_0xae9a('0x63')](_0xae9a('0x66')+_0x594e70+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xae9a('0x67')](_0x594e70);}return _0x2adb5f;})[_0xae9a('0x26')](function(_0x385598){if(!_0x385598)throw new InternalError();return _0x385598['destroy']();})[_0xae9a('0x26')](function(){_0x38727e[_0xae9a('0x1b')](0xcc)[_0xae9a('0x1a')]();})[_0xae9a('0x48')](handleError(_0x38727e,null));};function getBucketslist(_0x32f318,_0x426e28,_0x5085d4){return new Promise(function(_0x274a9f,_0x2d9cf7){var _0x86c009=new AWS['S3']({'accessKeyId':_0x426e28,'secretAccessKey':_0x32f318,'region':_0x5085d4});_0x86c009[_0xae9a('0x68')]({},function(_0x2aa499,_0x2f3f9f){if(_0x2aa499){return _0x2d9cf7(_0x2aa499);}else{return _0x274a9f(_0x2f3f9f);}});});}function createBucket(_0xb32038,_0x324db1,_0x280d11,_0x32fc83){return new Promise(function(_0x32797f,_0x21b68d){var _0x4e606e=new AWS['S3']({'accessKeyId':_0x324db1,'secretAccessKey':_0xb32038,'region':_0x280d11});_0x4e606e[_0xae9a('0x69')]({'Bucket':_0x32fc83},function(_0x27dce6,_0x168038){if(_0x27dce6){return _0x21b68d(_0x27dce6);}else{return _0x32797f(_0x168038);}});});}function uploadFile(_0x3d974c,_0x5d88ec,_0x2e46c3,_0x332ce9,_0x7babef,_0x2ae4c0){return new Promise(function(_0x42e33c,_0x31b05e){var _0x40db49=new AWS['S3']({'accessKeyId':_0x5d88ec,'secretAccessKey':_0x3d974c,'region':_0x2e46c3});_0x40db49[_0xae9a('0x6a')]({'Bucket':_0x332ce9,'Key':_0x7babef,'Body':_0x2ae4c0},function(_0x596975,_0x5aac1a){if(_0x596975){return _0x31b05e(_0x596975);}else{return _0x42e33c(_0x5aac1a);}});});}function startTranscribe(_0xefa2f0,_0x3c85ec,_0x2e4555,_0x2eb36a,_0xcdd52c,_0x407b4c){return new Promise(function(_0x4a8ae8,_0x40ca42){var _0x41706e=new AWS[(_0xae9a('0x6b'))]({'accessKeyId':_0x3c85ec,'secretAccessKey':_0xefa2f0,'region':_0x2e4555});_0x41706e['startTranscriptionJob']({'TranscriptionJobName':_0x2eb36a,'LanguageCode':_0xcdd52c,'Media':{'MediaFileUri':_0x407b4c}},function(_0x2146c0,_0x20cca4){if(_0x2146c0){return _0x40ca42(_0x2146c0);}else{return _0x4a8ae8(_0x20cca4);}});});}function transcribe(_0x426f56,_0x3e248a,_0x4c46f3,_0x4ad1c3,_0x3550b2,_0x41dd25,_0x12cd7c){return new Promise(function(_0x20e6e6,_0x1fec65){var _0x59cb46={};logger[_0xae9a('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x426f56,_0x3550b2));return uploadFile(_0x3e248a,_0x4c46f3,_0x4ad1c3,_0x3550b2,path[_0xae9a('0x6c')](_0x41dd25),fs['readFileSync'](_0x41dd25))[_0xae9a('0x26')](function(_0x4b0712){logger['info'](util['format'](_0xae9a('0x6d'),_0x426f56,_0x3550b2,_0x4b0712[_0xae9a('0x6e')]));_0x59cb46['bucket']=_0x4b0712[_0xae9a('0x6f')];_0x59cb46[_0xae9a('0x70')]=_0x4b0712[_0xae9a('0x6e')];logger[_0xae9a('0x63')](util[_0xae9a('0x32')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x426f56));return startTranscribe(_0x3e248a,_0x4c46f3,_0x4ad1c3,uuidv4(),_0x12cd7c,_0x4b0712[_0xae9a('0x6e')]);})[_0xae9a('0x26')](function(_0x4e53dd){logger[_0xae9a('0x63')](util[_0xae9a('0x32')](_0xae9a('0x71'),_0x426f56,_0x4e53dd[_0xae9a('0x72')][_0xae9a('0x73')]));_0x59cb46[_0xae9a('0x74')]=_0x4e53dd[_0xae9a('0x72')]['TranscriptionJobName'];_0x59cb46['transcribeStatus']=_0x4e53dd[_0xae9a('0x72')][_0xae9a('0x75')];return _0x20e6e6(_0x59cb46);})[_0xae9a('0x48')](function(_0x222330){return _0x1fec65(_0x222330);});});}exports['runTranscribe']=function(_0x2c9a3a,_0x556a87,_0x4866c0){var _0x57a065;var _0x18ce8d;var _0x3cacfa;var _0x5be597=require(_0xae9a('0x76'));return db[_0xae9a('0x2d')][_0xae9a('0x77')]({'where':{'id':_0x2c9a3a[_0xae9a('0x4e')]['id']}})[_0xae9a('0x26')](function(_0x504299){if(_0x504299){var _0xd6153c=util[_0xae9a('0x32')]('%s.cypher',_0x504299[_0xae9a('0x4f')]);if(fs[_0xae9a('0x51')](_0xd6153c)){cypher=!![];return _0x5be597[_0xae9a('0x52')](_0xd6153c,_0x504299[_0xae9a('0x4f')],config['secrets'][_0xae9a('0x54')])[_0xae9a('0x26')](function(){return _0x504299;});}return _0x504299;}})['then'](function(_0xda247){if(!_0xda247){throw new db['Sequelize'][(_0xae9a('0x55'))](_0xae9a('0x78'));}_0x18ce8d=_0xda247;return db[_0xae9a('0x79')][_0xae9a('0x77')]({'where':{'id':0x1}});})[_0xae9a('0x26')](handleEntityNotFound(_0x556a87,null))['then'](function(_0x4fe455){if(_0x4fe455){_0x57a065=_0x4fe455;if(!_0x57a065['transcribe']||!_0x57a065['transcribeAccountId']||!_0x57a065[_0xae9a('0x7a')]||!_0x57a065['language']||!_0x57a065['bucket']){throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))](_0xae9a('0x7b'));}if(_0x2c9a3a[_0xae9a('0x4a')][_0xae9a('0x7c')]&&(!_0x57a065['sentiment']||!_0x57a065[_0xae9a('0x7d')]||!_0x57a065[_0xae9a('0x7e')]||!_0x57a065['language']||!_0x57a065[_0xae9a('0x7f')])){throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))](_0xae9a('0x80'));}return db[_0xae9a('0x81')]['findOne']({'where':{'id':_0x57a065[_0xae9a('0x82')]}});}})['then'](function(_0x389d82){if(!_0x389d82){throw new db[(_0xae9a('0x60'))]['ValidationError'](_0xae9a('0x83'));}if(!_0x389d82[_0xae9a('0x84')]||!_0x389d82[_0xae9a('0x85')]){throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))](_0xae9a('0x86'));}_0x3cacfa=_0x389d82;return getBucketslist(_0x3cacfa['data1'],_0x3cacfa[_0xae9a('0x85')],_0x57a065[_0xae9a('0x7a')]);})[_0xae9a('0x26')](function(_0x15c702){if(_0x15c702&&_0x15c702[_0xae9a('0x87')]){var _0x131e5d=_['find'](_0x15c702[_0xae9a('0x87')],function(_0x2654d5){return _0x2654d5['Name']===_0x57a065['bucket'];});if(!_0x131e5d){logger[_0xae9a('0x63')](util[_0xae9a('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x2c9a3a[_0xae9a('0x4e')]['id'],_0x57a065[_0xae9a('0x7f')]));return createBucket(_0x3cacfa[_0xae9a('0x84')],_0x3cacfa[_0xae9a('0x85')],_0x57a065[_0xae9a('0x7a')],_0x57a065[_0xae9a('0x7f')]);}logger[_0xae9a('0x63')](util[_0xae9a('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x2c9a3a[_0xae9a('0x4e')]['id'],_0x57a065[_0xae9a('0x7f')]));return;}})[_0xae9a('0x26')](function(_0x5eeac6){if(_0x18ce8d[_0xae9a('0x88')]==='NEW'){return transcribe(_0x2c9a3a[_0xae9a('0x4e')]['id'],_0x3cacfa['data1'],_0x3cacfa[_0xae9a('0x85')],_0x57a065['transcribeRegion'],_0x57a065[_0xae9a('0x7f')],_0x18ce8d[_0xae9a('0x4f')],_0x57a065[_0xae9a('0x89')]);}else{logger[_0xae9a('0x63')](util[_0xae9a('0x32')](_0xae9a('0x8a'),_0x2c9a3a[_0xae9a('0x4e')]['id']));return{'transcribeStatus':_0xae9a('0x8b')};}})['then'](function(_0x457cf0){if(_0x457cf0){_0x457cf0[_0xae9a('0x8c')]=_0x2c9a3a[_0xae9a('0x4a')][_0xae9a('0x7c')];return _0x18ce8d[_0xae9a('0x8d')](_0x457cf0);}})[_0xae9a('0x26')](respondWithResult(_0x556a87,null))[_0xae9a('0x48')](handleError(_0x556a87,null));};function writeFile(_0x5d17f4,_0xdde929){return new Promise(function(_0x107dcf,_0x388c52){fs['writeFile'](_0xdde929,_0x5d17f4,function(_0x2a7e0b,_0x522ff2){if(_0x2a7e0b){return _0x388c52(_0x2a7e0b);}else{return _0x107dcf(_0x522ff2);}});});}exports[_0xae9a('0x8e')]=function(_0x1ae7bd,_0x3718ba,_0x4e7e45){return db['VoiceRecording']['findOne']({'where':{'id':_0x1ae7bd[_0xae9a('0x4e')]['id']}})[_0xae9a('0x26')](handleEntityNotFound(_0x3718ba))[_0xae9a('0x26')](function(_0x421271){if(_0x421271&&_0x421271[_0xae9a('0x8f')]){var _0xd1fa3a=_0x421271[_0xae9a('0x8f')];var _0x4765b7=config[_0xae9a('0x90')]+'/server/files/transcribes/transcribe_'+_0x421271['id']+_0xae9a('0x91');if(fs['existsSync'](_0x4765b7)){return _0x4765b7;}return writeFile(_0xd1fa3a,_0x4765b7)[_0xae9a('0x26')](function(){return _0x4765b7;});}else{throw new db[(_0xae9a('0x60'))][(_0xae9a('0x55'))]('Transcript\x20not\x20available');}})[_0xae9a('0x26')](function(_0x507791){return _0x3718ba[_0xae9a('0x4c')](_0x507791);})[_0xae9a('0x48')](handleError(_0x3718ba));}; \ No newline at end of file +var _0x793d=['uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','findAll','rows','catch','show','params','keys','options','find','create','body','../../components/encryptor','uniqueid','value','format','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','filename','extname','unlink','message','send','sequelize','MD5','col','token','push','$and','isNil','Entity\x20not\x20found','info','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','createBucket','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','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','findOne','decryptFile','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','IN_PROGRESS','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','crypto','desk.js','papaparse','aws-sdk'];(function(_0x213a57,_0x1f6876){var _0x3d9f72=function(_0x2e40a7){while(--_0x2e40a7){_0x213a57['push'](_0x213a57['shift']());}};_0x3d9f72(++_0x1f6876);}(_0x793d,0x114));var _0xd793=function(_0x27a0b8,_0x17a9d3){_0x27a0b8=_0x27a0b8-0x0;var _0x4d7d23=_0x793d[_0x27a0b8];return _0x4d7d23;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd793('0x0'));var zipdir=require(_0xd793('0x1'));var jsonpatch=require(_0xd793('0x2'));var rp=require('request-promise');var moment=require(_0xd793('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd793('0x4'));var sox=require(_0xd793('0x5'));var csv=require(_0xd793('0x6'));var ejs=require(_0xd793('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd793('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd793('0x9'));var toCsv=require(_0xd793('0x6'));var querystring=require('querystring');var Papa=require(_0xd793('0xa'));var AWS=require(_0xd793('0xb'));var uuidv4=require(_0xd793('0xc'));var Redis=require(_0xd793('0xd'));var authService=require(_0xd793('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd793('0xf'));var hardwareService=require(_0xd793('0x10'));var logger=require(_0xd793('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd793('0x12'));var db=require(_0xd793('0x13'))['db'];function respondWithStatusCode(_0x35c935,_0x518230){_0x518230=_0x518230||0xcc;return function(_0x14852c){if(_0x14852c){return _0x35c935[_0xd793('0x14')](_0x518230);}return _0x35c935['status'](_0x518230)['end']();};}function respondWithResult(_0x493adb,_0x2ddf1e){_0x2ddf1e=_0x2ddf1e||0xc8;return function(_0x476d05){if(_0x476d05){return _0x493adb[_0xd793('0x15')](_0x2ddf1e)[_0xd793('0x16')](_0x476d05);}};}function respondWithFilteredResult(_0x188495,_0x42d8f6){return function(_0x341e7d){if(_0x341e7d){var _0x27ac9a=typeof _0x42d8f6[_0xd793('0x17')]===_0xd793('0x18')&&typeof _0x42d8f6[_0xd793('0x19')]===_0xd793('0x18');var _0x21e7e7=_0x341e7d[_0xd793('0x1a')];var _0x468b00=_0x27ac9a?0x0:_0x42d8f6['offset'];var _0xe68dd9=_0x27ac9a?_0x341e7d[_0xd793('0x1a')]:_0x42d8f6[_0xd793('0x17')]+_0x42d8f6[_0xd793('0x19')];var _0x1a333e;if(_0xe68dd9>=_0x21e7e7){_0xe68dd9=_0x21e7e7;_0x1a333e=0xc8;}else{_0x1a333e=0xce;}_0x188495[_0xd793('0x15')](_0x1a333e);return _0x188495[_0xd793('0x1b')](_0xd793('0x1c'),_0x468b00+'-'+_0xe68dd9+'/'+_0x21e7e7)['json'](_0x341e7d);}return null;};}function patchUpdates(_0xd4fb85){return function(_0x37dc4c){try{jsonpatch['apply'](_0x37dc4c,_0xd4fb85,!![]);}catch(_0x505b1c){return BPromise[_0xd793('0x1d')](_0x505b1c);}return _0x37dc4c[_0xd793('0x1e')]();};}function saveUpdates(_0x5c98da,_0x2e9c11){return function(_0xce453d){if(_0xce453d){return _0xce453d[_0xd793('0x1f')](_0x5c98da)[_0xd793('0x20')](function(_0x3b375f){return _0x3b375f;});}return null;};}function removeEntity(_0x189b97,_0x2f114a){return function(_0x6f27d){if(_0x6f27d){return _0x6f27d[_0xd793('0x21')]()[_0xd793('0x20')](function(){_0x189b97[_0xd793('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c092,_0x4955ef){return function(_0x469220){if(!_0x469220){_0x51c092[_0xd793('0x14')](0x194);}return _0x469220;};}function handleError(_0x574410,_0x3ff47f){_0x3ff47f=_0x3ff47f||0x1f4;return function(_0x442f9a){logger[_0xd793('0x22')](_0x442f9a['stack']);if(_0x442f9a[_0xd793('0x23')]){delete _0x442f9a[_0xd793('0x23')];}_0x574410[_0xd793('0x15')](_0x3ff47f)['send'](_0x442f9a);};}exports[_0xd793('0x24')]=function(_0x40423c,_0x19c211){var _0x2d60b7={},_0x260d03={},_0x4a6690={'count':0x0,'rows':[]};var _0x8e4b22=_[_0xd793('0x25')](db[_0xd793('0x26')][_0xd793('0x27')],function(_0x3ad555){return{'name':_0x3ad555[_0xd793('0x28')],'type':_0x3ad555[_0xd793('0x29')][_0xd793('0x2a')]};});_0x260d03[_0xd793('0x2b')]=_[_0xd793('0x2c')](_[_0xd793('0x25')](_0x8e4b22,_0xd793('0x23')),['format']);_0x260d03[_0xd793('0x2d')]=_['keys'](_0x40423c[_0xd793('0x2d')]);_0x260d03[_0xd793('0x2e')]=_['intersection'](_0x260d03[_0xd793('0x2b')],_0x260d03[_0xd793('0x2d')]);_0x2d60b7[_0xd793('0x2f')]=_[_0xd793('0x30')](_0x260d03['model'],qs[_0xd793('0x31')](_0x40423c[_0xd793('0x2d')][_0xd793('0x31')]));_0x2d60b7[_0xd793('0x2f')]=_0x2d60b7[_0xd793('0x2f')][_0xd793('0x32')]?_0x2d60b7[_0xd793('0x2f')]:_0x260d03[_0xd793('0x2b')];if(!_0x40423c[_0xd793('0x2d')][_0xd793('0x33')](_0xd793('0x34'))){_0x2d60b7['limit']=qs[_0xd793('0x19')](_0x40423c[_0xd793('0x2d')]['limit']);_0x2d60b7[_0xd793('0x17')]=qs[_0xd793('0x17')](_0x40423c[_0xd793('0x2d')][_0xd793('0x17')]);}_0x2d60b7[_0xd793('0x35')]=qs['sort'](_0x40423c[_0xd793('0x2d')][_0xd793('0x36')]);_0x2d60b7[_0xd793('0x37')]=qs['filters'](_[_0xd793('0x38')](_0x40423c[_0xd793('0x2d')],_0x260d03['filters']),_0x8e4b22);if(_0x40423c[_0xd793('0x2d')]['filter']){_0x2d60b7[_0xd793('0x37')]=_[_0xd793('0x39')](_0x2d60b7[_0xd793('0x37')],{'$or':_[_0xd793('0x25')](_0x8e4b22,function(_0x1825cf){if(_0x1825cf[_0xd793('0x29')]!=='VIRTUAL'){var _0x22097c={};_0x22097c[_0x1825cf['name']]={'$like':'%'+_0x40423c[_0xd793('0x2d')]['filter']+'%'};return _0x22097c;}})});}_0x2d60b7=_[_0xd793('0x39')]({},_0x2d60b7,_0x40423c['options']);var _0x5e9838={'where':_0x2d60b7[_0xd793('0x37')]};return db[_0xd793('0x26')][_0xd793('0x1a')](_0x5e9838)[_0xd793('0x20')](function(_0x58170f){_0x4a6690['count']=_0x58170f;if(_0x40423c[_0xd793('0x2d')]['includeAll']){_0x2d60b7[_0xd793('0x3a')]=[{'all':!![]}];}return db[_0xd793('0x26')][_0xd793('0x3b')](_0x2d60b7);})[_0xd793('0x20')](function(_0x339d8a){_0x4a6690[_0xd793('0x3c')]=_0x339d8a;return _0x4a6690;})[_0xd793('0x20')](respondWithFilteredResult(_0x19c211,_0x2d60b7))[_0xd793('0x3d')](handleError(_0x19c211,null));};exports[_0xd793('0x3e')]=function(_0x15e115,_0x56ade5){var _0x348df4={'raw':![],'where':{'id':_0x15e115[_0xd793('0x3f')]['id']}},_0x546749={};_0x546749[_0xd793('0x2b')]=_[_0xd793('0x40')](db[_0xd793('0x26')][_0xd793('0x27')]);_0x546749[_0xd793('0x2d')]=_[_0xd793('0x40')](_0x15e115[_0xd793('0x2d')]);_0x546749['filters']=_['intersection'](_0x546749[_0xd793('0x2b')],_0x546749[_0xd793('0x2d')]);_0x348df4[_0xd793('0x2f')]=_[_0xd793('0x30')](_0x546749[_0xd793('0x2b')],qs[_0xd793('0x31')](_0x15e115[_0xd793('0x2d')][_0xd793('0x31')]));_0x348df4[_0xd793('0x2f')]=_0x348df4[_0xd793('0x2f')][_0xd793('0x32')]?_0x348df4['attributes']:_0x546749[_0xd793('0x2b')];if(_0x15e115[_0xd793('0x2d')]['includeAll']){_0x348df4[_0xd793('0x3a')]=[{'all':!![]}];}_0x348df4=_[_0xd793('0x39')]({},_0x348df4,_0x15e115[_0xd793('0x41')]);return db[_0xd793('0x26')][_0xd793('0x42')](_0x348df4)['then'](handleEntityNotFound(_0x56ade5,null))[_0xd793('0x20')](respondWithResult(_0x56ade5,null))[_0xd793('0x3d')](handleError(_0x56ade5,null));};exports[_0xd793('0x43')]=function(_0x33bb64,_0x41f020){return db[_0xd793('0x26')][_0xd793('0x43')](_0x33bb64['body'],{})[_0xd793('0x20')](respondWithResult(_0x41f020,0xc9))[_0xd793('0x3d')](handleError(_0x41f020,null));};exports['update']=function(_0xc9dd35,_0x19c458){if(_0xc9dd35['body']['id']){delete _0xc9dd35[_0xd793('0x44')]['id'];}return db[_0xd793('0x26')]['find']({'where':{'id':_0xc9dd35[_0xd793('0x3f')]['id']}})['then'](handleEntityNotFound(_0x19c458,null))['then'](saveUpdates(_0xc9dd35[_0xd793('0x44')],null))['then'](respondWithResult(_0x19c458,null))['catch'](handleError(_0x19c458,null));};exports['describe']=function(_0x12ea20,_0x2c2c23){return db[_0xd793('0x26')]['describe']()[_0xd793('0x20')](respondWithResult(_0x2c2c23,null))[_0xd793('0x3d')](handleError(_0x2c2c23,null));};exports['download']=function(_0x21e5c7,_0x336963,_0x347488){var _0x6025c9=require(_0xd793('0x45'));var _0x3af424=![];var _0x3d7ec9={};if(_0x21e5c7[_0xd793('0x2d')]['type']&&_0x21e5c7[_0xd793('0x2d')][_0xd793('0x29')]===_0xd793('0x46')){_0x3d7ec9['uniqueid']=_0x21e5c7[_0xd793('0x3f')]['id'];}else{_0x3d7ec9['id']=_0x21e5c7[_0xd793('0x3f')]['id'];}return db['VoiceRecording'][_0xd793('0x42')]({'where':_0x3d7ec9,'attributes':['id',_0xd793('0x47')],'raw':!![]})[_0xd793('0x20')](handleEntityNotFound(_0x336963,null))['then'](function(_0x36324e){if(_0x36324e){var _0x168c54=_0x36324e[_0xd793('0x47')];var _0x21da36=util[_0xd793('0x48')](_0xd793('0x49'),_0x168c54);if(fs['existsSync'](_0x21da36)){_0x3af424=!![];return _0x6025c9['decryptFile'](_0x21da36,_0x168c54,config[_0xd793('0x4a')][_0xd793('0x4b')])[_0xd793('0x20')](function(){return _0x36324e;});}return _0x36324e;}})[_0xd793('0x20')](function(_0x465bb4){if(_0x465bb4){var _0x19fc85=_0x465bb4[_0xd793('0x47')];if(!fs[_0xd793('0x4c')](_0x19fc85)){throw new db[(_0xd793('0x4d'))][(_0xd793('0x4e'))](_0xd793('0x4f'));}if(_0x465bb4['filename']){return _0x336963[_0xd793('0x50')](_0x19fc85,_0x465bb4[_0xd793('0x51')]+path[_0xd793('0x52')](_0x19fc85),function(){if(_0x3af424){fs[_0xd793('0x53')](_0x19fc85);}});}else{return _0x336963[_0xd793('0x50')](_0x19fc85,function(_0x15075d){if(_0x3af424){fs[_0xd793('0x53')](_0x19fc85);}});}}})[_0xd793('0x3d')](function(_0xa9d1cc){if(_0xa9d1cc[_0xd793('0x54')]===_0xd793('0x4f')){_0x336963[_0xd793('0x15')](0x194)[_0xd793('0x55')]('Not\x20found');}else{return handleError(_0x336963,null);}});};exports['downloads']=function(_0x585828,_0x3d1b07,_0x32c2be){var _0xa13987=require(_0xd793('0x45'));var _0x2f02da=![];var _0x1846f0={'$and':[db[_0xd793('0x56')]['where'](db['sequelize']['fn'](_0xd793('0x57'),db[_0xd793('0x56')][_0xd793('0x58')](_0xd793('0x46'))),_0x585828[_0xd793('0x2d')][_0xd793('0x59')])]};if(_0x585828[_0xd793('0x2d')][_0xd793('0x29')]&&_0x585828[_0xd793('0x2d')]['type']===_0xd793('0x46')){_0x1846f0['$and'][_0xd793('0x5a')]({'uniqueid':_0x585828[_0xd793('0x3f')]['id']});}else{_0x1846f0[_0xd793('0x5b')]['push']({'id':_0x585828['params']['id']});}return db[_0xd793('0x26')][_0xd793('0x42')]({'where':_0x1846f0,'attributes':['id',_0xd793('0x47')],'raw':!![]})[_0xd793('0x20')](handleEntityNotFound(_0x3d1b07,null))[_0xd793('0x20')](function(_0x226bac){if(_0x226bac){var _0x24567b=util['format'](_0xd793('0x49'),_0x226bac[_0xd793('0x47')]);if(fs['existsSync'](_0x24567b)){_0x2f02da=!![];return _0xa13987['decryptFile'](_0x24567b,_0x226bac[_0xd793('0x47')],config[_0xd793('0x4a')][_0xd793('0x4b')])[_0xd793('0x20')](function(){return _0x226bac;});}return _0x226bac;}})[_0xd793('0x20')](function(_0x777063){if(_0x777063){if(!fs[_0xd793('0x4c')](_0x777063['value'])){throw new db[(_0xd793('0x4d'))]['ValidationError'](_0xd793('0x4f'));}if(_0x777063[_0xd793('0x51')]){return _0x3d1b07['download'](_0x777063['value'],_0x777063[_0xd793('0x51')]+path[_0xd793('0x52')](_0x777063[_0xd793('0x47')]),function(){if(_0x2f02da){fs['unlink'](_0x777063[_0xd793('0x47')]);}});}else{return _0x3d1b07[_0xd793('0x50')](_0x777063['value'],function(_0x3ad619){if(_0x2f02da){fs[_0xd793('0x53')](_0x777063[_0xd793('0x47')]);}});}}})[_0xd793('0x3d')](handleError(_0x3d1b07,null));};exports[_0xd793('0x21')]=function(_0x2f9e81,_0x1926e4){return db[_0xd793('0x26')][_0xd793('0x42')]({'where':{'id':_0x2f9e81[_0xd793('0x3f')]['id']}})[_0xd793('0x20')](function(_0x17604b){if(_[_0xd793('0x5c')](_0x17604b)){throw new ReferenceError(_0xd793('0x5d'));}return _0x17604b;})[_0xd793('0x20')](function(_0x4c9427){var _0x4aa5e7=_0x4c9427['value'];logger[_0xd793('0x5e')]('cancellazione\x20fisica\x20documento\x20%s',_0x4aa5e7);if(!_[_0xd793('0x5c')](_0x4c9427[_0xd793('0x47')])&&fs[_0xd793('0x4c')](_0x4aa5e7)){logger[_0xd793('0x5e')]('File:\x20\x22'+_0x4aa5e7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x4aa5e7);}_0x4aa5e7=_0x4aa5e7+_0xd793('0x5f');if(!_[_0xd793('0x5c')](_0x4c9427[_0xd793('0x47')])&&fs[_0xd793('0x4c')](_0x4aa5e7)){logger[_0xd793('0x5e')](_0xd793('0x60')+_0x4aa5e7+_0xd793('0x61'));fs[_0xd793('0x62')](_0x4aa5e7);}return _0x4c9427;})['then'](function(_0x2d1615){if(!_0x2d1615)throw new InternalError();return _0x2d1615['destroy']();})[_0xd793('0x20')](function(){_0x1926e4[_0xd793('0x15')](0xcc)['end']();})['catch'](handleError(_0x1926e4,null));};function getBucketslist(_0x19b835,_0x1f9e49,_0x5b1e49){return new Promise(function(_0x41c820,_0x8796a0){var _0x2ef28d=new AWS['S3']({'accessKeyId':_0x1f9e49,'secretAccessKey':_0x19b835,'region':_0x5b1e49});_0x2ef28d['listBuckets']({},function(_0x48b4a7,_0x11f95b){if(_0x48b4a7){return _0x8796a0(_0x48b4a7);}else{return _0x41c820(_0x11f95b);}});});}function createBucket(_0x44098f,_0x51b948,_0x4857c2,_0x7bd294){return new Promise(function(_0x285a42,_0x34b401){var _0x52c2ed=new AWS['S3']({'accessKeyId':_0x51b948,'secretAccessKey':_0x44098f,'region':_0x4857c2});_0x52c2ed[_0xd793('0x63')]({'Bucket':_0x7bd294},function(_0x177513,_0x1ea902){if(_0x177513){return _0x34b401(_0x177513);}else{return _0x285a42(_0x1ea902);}});});}function uploadFile(_0x1c0e0a,_0x1595c,_0x4ee978,_0x2ceebf,_0x50705f,_0x4d3629){return new Promise(function(_0x34aa70,_0x4165ae){var _0x4735c5=new AWS['S3']({'accessKeyId':_0x1595c,'secretAccessKey':_0x1c0e0a,'region':_0x4ee978});_0x4735c5['upload']({'Bucket':_0x2ceebf,'Key':_0x50705f,'Body':_0x4d3629},function(_0x3e8ee2,_0x193182){if(_0x3e8ee2){return _0x4165ae(_0x3e8ee2);}else{return _0x34aa70(_0x193182);}});});}function startTranscribe(_0x414bae,_0x5a2e44,_0x28ea5a,_0x28d3b4,_0x33096d,_0x128c56){return new Promise(function(_0x4e472b,_0x111ea0){var _0xff28ee=new AWS['TranscribeService']({'accessKeyId':_0x5a2e44,'secretAccessKey':_0x414bae,'region':_0x28ea5a});_0xff28ee[_0xd793('0x64')]({'TranscriptionJobName':_0x28d3b4,'LanguageCode':_0x33096d,'Media':{'MediaFileUri':_0x128c56}},function(_0x1dbad0,_0x465095){if(_0x1dbad0){return _0x111ea0(_0x1dbad0);}else{return _0x4e472b(_0x465095);}});});}function transcribe(_0x35c894,_0x25c067,_0x40f1c6,_0xbc025c,_0x5d8eb3,_0x3701af,_0x3bde80){return new Promise(function(_0x22eee4,_0x4d4e5e){var _0x27ad2d={};logger['info'](util[_0xd793('0x48')](_0xd793('0x65'),_0x35c894,_0x5d8eb3));return uploadFile(_0x25c067,_0x40f1c6,_0xbc025c,_0x5d8eb3,path[_0xd793('0x66')](_0x3701af),fs[_0xd793('0x67')](_0x3701af))['then'](function(_0x43b6b3){logger[_0xd793('0x5e')](util[_0xd793('0x48')](_0xd793('0x68'),_0x35c894,_0x5d8eb3,_0x43b6b3[_0xd793('0x69')]));_0x27ad2d[_0xd793('0x6a')]=_0x43b6b3[_0xd793('0x6b')];_0x27ad2d[_0xd793('0x6c')]=_0x43b6b3['Location'];logger[_0xd793('0x5e')](util['format'](_0xd793('0x6d'),_0x35c894));return startTranscribe(_0x25c067,_0x40f1c6,_0xbc025c,uuidv4(),_0x3bde80,_0x43b6b3[_0xd793('0x69')]);})[_0xd793('0x20')](function(_0x3924c){logger[_0xd793('0x5e')](util[_0xd793('0x48')](_0xd793('0x6e'),_0x35c894,_0x3924c[_0xd793('0x6f')][_0xd793('0x70')]));_0x27ad2d['transcribeName']=_0x3924c[_0xd793('0x6f')]['TranscriptionJobName'];_0x27ad2d['transcribeStatus']=_0x3924c[_0xd793('0x6f')][_0xd793('0x71')];return _0x22eee4(_0x27ad2d);})[_0xd793('0x3d')](function(_0x5997eb){return _0x4d4e5e(_0x5997eb);});});}exports['runTranscribe']=function(_0x78ac38,_0x6a9190,_0x1c4833){var _0x1638a6;var _0x5b28a6;var _0x24966d;var _0x3cbf15=require(_0xd793('0x45'));return db['VoiceRecording'][_0xd793('0x72')]({'where':{'id':_0x78ac38[_0xd793('0x3f')]['id']}})['then'](function(_0x57d025){if(_0x57d025){var _0x5f138d=util[_0xd793('0x48')](_0xd793('0x49'),_0x57d025[_0xd793('0x47')]);if(fs[_0xd793('0x4c')](_0x5f138d)){cypher=!![];return _0x3cbf15[_0xd793('0x73')](_0x5f138d,_0x57d025['value'],config['secrets'][_0xd793('0x4b')])['then'](function(){return _0x57d025;});}return _0x57d025;}})['then'](function(_0x5b7f75){if(!_0x5b7f75){throw new db['Sequelize'][(_0xd793('0x4e'))](_0xd793('0x74'));}_0x5b28a6=_0x5b7f75;return db[_0xd793('0x75')]['findOne']({'where':{'id':0x1}});})[_0xd793('0x20')](handleEntityNotFound(_0x6a9190,null))[_0xd793('0x20')](function(_0x1aa97e){if(_0x1aa97e){_0x1638a6=_0x1aa97e;if(!_0x1638a6[_0xd793('0x76')]||!_0x1638a6[_0xd793('0x77')]||!_0x1638a6[_0xd793('0x78')]||!_0x1638a6[_0xd793('0x79')]||!_0x1638a6[_0xd793('0x6a')]){throw new db[(_0xd793('0x4d'))]['ValidationError'](_0xd793('0x7a'));}if(_0x78ac38[_0xd793('0x44')][_0xd793('0x7b')]&&(!_0x1638a6['sentiment']||!_0x1638a6[_0xd793('0x7c')]||!_0x1638a6['sentimentRegion']||!_0x1638a6['language']||!_0x1638a6[_0xd793('0x6a')])){throw new db[(_0xd793('0x4d'))]['ValidationError'](_0xd793('0x7d'));}return db[_0xd793('0x7e')][_0xd793('0x72')]({'where':{'id':_0x1638a6[_0xd793('0x77')]}});}})[_0xd793('0x20')](function(_0x479b10){if(!_0x479b10){throw new db['Sequelize'][(_0xd793('0x4e'))](_0xd793('0x7f'));}if(!_0x479b10[_0xd793('0x80')]||!_0x479b10['data2']){throw new db[(_0xd793('0x4d'))][(_0xd793('0x4e'))](_0xd793('0x81'));}_0x24966d=_0x479b10;return getBucketslist(_0x24966d[_0xd793('0x80')],_0x24966d[_0xd793('0x82')],_0x1638a6['transcribeRegion']);})[_0xd793('0x20')](function(_0x4c5547){if(_0x4c5547&&_0x4c5547[_0xd793('0x83')]){var _0x26d3e4=_[_0xd793('0x42')](_0x4c5547[_0xd793('0x83')],function(_0x2ed826){return _0x2ed826[_0xd793('0x84')]===_0x1638a6[_0xd793('0x6a')];});if(!_0x26d3e4){logger['info'](util[_0xd793('0x48')](_0xd793('0x85'),_0x78ac38[_0xd793('0x3f')]['id'],_0x1638a6['bucket']));return createBucket(_0x24966d[_0xd793('0x80')],_0x24966d['data2'],_0x1638a6[_0xd793('0x78')],_0x1638a6['bucket']);}logger[_0xd793('0x5e')](util['format'](_0xd793('0x86'),_0x78ac38[_0xd793('0x3f')]['id'],_0x1638a6[_0xd793('0x6a')]));return;}})[_0xd793('0x20')](function(_0x42e960){if(_0x5b28a6[_0xd793('0x87')]===_0xd793('0x88')){return transcribe(_0x78ac38[_0xd793('0x3f')]['id'],_0x24966d[_0xd793('0x80')],_0x24966d[_0xd793('0x82')],_0x1638a6[_0xd793('0x78')],_0x1638a6[_0xd793('0x6a')],_0x5b28a6[_0xd793('0x47')],_0x1638a6[_0xd793('0x79')]);}else{logger[_0xd793('0x5e')](util[_0xd793('0x48')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x78ac38[_0xd793('0x3f')]['id']));return{'transcribeStatus':_0xd793('0x89')};}})['then'](function(_0x25b938){if(_0x25b938){_0x25b938['tempSentiment']=_0x78ac38['body'][_0xd793('0x7b')];return _0x5b28a6[_0xd793('0x8a')](_0x25b938);}})[_0xd793('0x20')](respondWithResult(_0x6a9190,null))['catch'](handleError(_0x6a9190,null));};function writeFile(_0x541f29,_0x583e2a){return new Promise(function(_0x2895bc,_0x423835){fs[_0xd793('0x8b')](_0x583e2a,_0x541f29,function(_0x4d8e8b,_0x511ccd){if(_0x4d8e8b){return _0x423835(_0x4d8e8b);}else{return _0x2895bc(_0x511ccd);}});});}exports['downloadTranscribe']=function(_0xb733b1,_0x557159,_0x1647ec){return db[_0xd793('0x26')][_0xd793('0x72')]({'where':{'id':_0xb733b1[_0xd793('0x3f')]['id']}})[_0xd793('0x20')](handleEntityNotFound(_0x557159))[_0xd793('0x20')](function(_0x47f70c){if(_0x47f70c&&_0x47f70c[_0xd793('0x8c')]){var _0x5a5dd9=_0x47f70c[_0xd793('0x8c')];var _0x648dbd=config[_0xd793('0x8d')]+_0xd793('0x8e')+_0x47f70c['id']+'.txt';if(fs[_0xd793('0x4c')](_0x648dbd)){return _0x648dbd;}return writeFile(_0x5a5dd9,_0x648dbd)['then'](function(){return _0x648dbd;});}else{throw new db['Sequelize'][(_0xd793('0x4e'))](_0xd793('0x8f'));}})['then'](function(_0x2527bd){return _0x557159[_0xd793('0x50')](_0x2527bd);})[_0xd793('0x3d')](handleError(_0x557159));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8dc0394..ae8e519 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 _0xf116=['VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0xb13538,_0x4d7f26){var _0xb2dd8c=function(_0x56c08a){while(--_0x56c08a){_0xb13538['push'](_0xb13538['shift']());}};_0xb2dd8c(++_0x4d7f26);}(_0xf116,0x16f));var _0x6f11=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0xf116[_0xcdac34];return _0x269d23;};'use strict';var _=require('lodash');var util=require(_0x6f11('0x0'));var logger=require(_0x6f11('0x1'))(_0x6f11('0x2'));var moment=require(_0x6f11('0x3'));var BPromise=require(_0x6f11('0x4'));var rp=require(_0x6f11('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f11('0x6'));var config=require(_0x6f11('0x7'));var attributes=require(_0x6f11('0x8'));module[_0x6f11('0x9')]=function(_0xe6f39,_0x48c0e8){return _0xe6f39[_0x6f11('0xa')](_0x6f11('0xb'),attributes,{'tableName':_0x6f11('0xc'),'paranoid':![],'indexes':[{'name':_0x6f11('0xd'),'fields':[_0x6f11('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a16=['bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','api','moment'];(function(_0xddc012,_0x5cf07a){var _0x395581=function(_0x483e9d){while(--_0x483e9d){_0xddc012['push'](_0xddc012['shift']());}};_0x395581(++_0x5cf07a);}(_0x8a16,0xe6));var _0x68a1=function(_0x5bec1f,_0x1cc63c){_0x5bec1f=_0x5bec1f-0x0;var _0x2228e1=_0x8a16[_0x5bec1f];return _0x2228e1;};'use strict';var _=require(_0x68a1('0x0'));var util=require('util');var logger=require(_0x68a1('0x1'))(_0x68a1('0x2'));var moment=require(_0x68a1('0x3'));var BPromise=require(_0x68a1('0x4'));var rp=require(_0x68a1('0x5'));var fs=require('fs');var path=require(_0x68a1('0x6'));var rimraf=require(_0x68a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x68a1('0x8'));module[_0x68a1('0x9')]=function(_0x4ad714,_0x428f13){return _0x4ad714['define'](_0x68a1('0xa'),attributes,{'tableName':_0x68a1('0xb'),'paranoid':![],'indexes':[{'name':_0x68a1('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 871db5d..d886a95 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 _0xcaf2=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','recording','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','stringify','catch'];(function(_0x3059d9,_0x119108){var _0x2928d4=function(_0x250580){while(--_0x250580){_0x3059d9['push'](_0x3059d9['shift']());}};_0x2928d4(++_0x119108);}(_0xcaf2,0x8a));var _0x2caf=function(_0x13ecca,_0xfd4f01){_0x13ecca=_0x13ecca-0x0;var _0x17c3b6=_0xcaf2[_0x13ecca];return _0x17c3b6;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['UpdateVoiceRecording']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['update'](_0x4a33fc[_0x2caf('0x15')],{'raw':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc['options'][_0x2caf('0x18')]||null:null,'attributes':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x19')]||null:null,'limit':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x1a')]||null:null})[_0x2caf('0xa')](function(_0x3332b1){logger[_0x2caf('0xb')](_0x2caf('0x1b'),_0x4a33fc);logger['debug'](_0x2caf('0x1b'),_0x4a33fc,JSON[_0x2caf('0x1c')](_0x3332b1));_0x58047b(_0x3332b1);})[_0x2caf('0x1d')](function(_0x401ea2){logger[_0x2caf('0x10')](_0x2caf('0x1b'),_0x401ea2[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x401ea2[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1e')]=function(_0x5ad211){var _0x6a32ac=this;return new Promise(function(_0x325eda,_0xbefce6){var _0x37b08f=require(_0x2caf('0x1f'));var _0x17d3c6;return db[_0x2caf('0x20')][_0x2caf('0x21')]({'attributes':['id',_0x2caf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x2caf('0xa')](function(_0x30da75){_0x17d3c6=_0x30da75;return db[_0x2caf('0x14')][_0x2caf('0x23')](_0x5ad211['body']);})[_0x2caf('0xa')](function(_0xda0ec5){if(_0x17d3c6[_0x2caf('0x22')]&&fs[_0x2caf('0x24')](_0xda0ec5[_0x2caf('0x25')])){var _0x1f52bf=util[_0x2caf('0x26')]('%s.cypher',_0xda0ec5[_0x2caf('0x25')]);return _0x37b08f[_0x2caf('0x27')](_0xda0ec5['value'],_0x1f52bf,config[_0x2caf('0x28')][_0x2caf('0x29')])[_0x2caf('0xa')](function(){fs['unlink'](_0xda0ec5[_0x2caf('0x25')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0xda0ec5;});}return _0xda0ec5;})[_0x2caf('0xa')](function(_0x28b715){logger[_0x2caf('0xb')](_0x2caf('0x1e'),_0x5ad211);logger[_0x2caf('0xe')](_0x2caf('0x1e'),_0x5ad211,JSON[_0x2caf('0x1c')](_0x28b715));_0x325eda(_0x28b715);})[_0x2caf('0x1d')](function(_0x20818e){logger['error'](_0x2caf('0x1e'),_0x20818e[_0x2caf('0x12')],_0x5ad211);_0xbefce6(_0x6a32ac[_0x2caf('0x10')](0x1f4,_0x20818e[_0x2caf('0x12')]));});});}; \ No newline at end of file +var _0x2272=['client','http','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','format','%s.cypher','encryptFile','secrets','recording','unlink','value','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x563eb4,_0x29bbae){var _0x97db86=function(_0x5f144f){while(--_0x5f144f){_0x563eb4['push'](_0x563eb4['shift']());}};_0x97db86(++_0x29bbae);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('VoiceRecording,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531f75['options']?_0x531f75[_0x2227('0x1c')][_0x2227('0x1e')]||null:null,'attributes':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x1f')]||null:null,'limit':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x20')]||null:null})[_0x2227('0xc')](function(_0x34c090){logger[_0x2227('0xd')]('UpdateVoiceRecording',_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x34c090));_0x620012(_0x34c090);})[_0x2227('0x17')](function(_0xbfdce1){logger['error']('UpdateVoiceRecording',_0xbfdce1[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0xbfdce1[_0x2227('0x15')]));});});};exports[_0x2227('0x21')]=function(_0x5be889){var _0x191a3e=this;return new Promise(function(_0x301304,_0x2d8ea0){var _0x1957ee=require('../../components/encryptor');var _0x204def;return db[_0x2227('0x22')][_0x2227('0x23')]({'attributes':['id',_0x2227('0x24')],'where':{'id':0x1},'raw':!![]})[_0x2227('0xc')](function(_0x4789eb){_0x204def=_0x4789eb;return db['VoiceRecording']['create'](_0x5be889[_0x2227('0x1b')]);})['then'](function(_0x2ba581){if(_0x204def[_0x2227('0x24')]&&fs['existsSync'](_0x2ba581['value'])){var _0x1f1ba7=util[_0x2227('0x25')](_0x2227('0x26'),_0x2ba581['value']);return _0x1957ee[_0x2227('0x27')](_0x2ba581['value'],_0x1f1ba7,config[_0x2227('0x28')][_0x2227('0x29')])[_0x2227('0xc')](function(){fs[_0x2227('0x2a')](_0x2ba581[_0x2227('0x2b')]);logger[_0x2227('0xd')](_0x2227('0x2c'));return _0x2ba581;});}return _0x2ba581;})[_0x2227('0xc')](function(_0xd38f59){logger[_0x2227('0xd')](_0x2227('0x21'),_0x5be889);logger['debug'](_0x2227('0x21'),_0x5be889,JSON[_0x2227('0x11')](_0xd38f59));_0x301304(_0xd38f59);})[_0x2227('0x17')](function(_0x6cd5d7){logger['error'](_0x2227('0x21'),_0x6cd5d7[_0x2227('0x15')],_0x5be889);_0x2d8ea0(_0x191a3e[_0x2227('0x12')](0x1f4,_0x6cd5d7[_0x2227('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 4b7ddcf..8a298f9 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 _0xe29f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2b173c,_0x27d0b2){var _0x51be42=function(_0x5592da){while(--_0x5592da){_0x2b173c['push'](_0x2b173c['shift']());}};_0x51be42(++_0x27d0b2);}(_0xe29f,0xeb));var _0xfe29=function(_0x4d63db,_0x2a8a0e){_0x4d63db=_0x4d63db-0x0;var _0x4a647e=_0xe29f[_0x4d63db];return _0x4a647e;};'use strict';var multer=require(_0xfe29('0x0'));var util=require('util');var path=require(_0xfe29('0x1'));var timeout=require(_0xfe29('0x2'));var express=require(_0xfe29('0x3'));var router=express[_0xfe29('0x4')]();var fs_extra=require(_0xfe29('0x5'));var auth=require(_0xfe29('0x6'));var interaction=require(_0xfe29('0x7'));var config=require(_0xfe29('0x8'));var controller=require('./voiceTransferReport.controller');router[_0xfe29('0x9')]('/',auth['isAuthenticated'](),controller[_0xfe29('0xa')]);router[_0xfe29('0x9')](_0xfe29('0xb'),auth[_0xfe29('0xc')](),controller[_0xfe29('0xd')]);router['get'](_0xfe29('0xe'),auth[_0xfe29('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xfe29('0xf')]);router['put'](_0xfe29('0xe'),auth[_0xfe29('0xc')](),controller[_0xfe29('0x10')]);router[_0xfe29('0x11')](_0xfe29('0xe'),auth['isAuthenticated'](),controller[_0xfe29('0x12')]);module[_0xfe29('0x13')]=router; \ No newline at end of file +var _0x7ae8=['show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','isAuthenticated','index','/describe','describe'];(function(_0x12a653,_0x4b7c50){var _0x596ea9=function(_0x556930){while(--_0x556930){_0x12a653['push'](_0x12a653['shift']());}};_0x596ea9(++_0x4b7c50);}(_0x7ae8,0x7a));var _0x87ae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ae8[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x87ae('0x0'));var util=require(_0x87ae('0x1'));var path=require(_0x87ae('0x2'));var timeout=require(_0x87ae('0x3'));var express=require(_0x87ae('0x4'));var router=express[_0x87ae('0x5')]();var fs_extra=require(_0x87ae('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x87ae('0x7')](),controller[_0x87ae('0x8')]);router['get'](_0x87ae('0x9'),auth[_0x87ae('0x7')](),controller[_0x87ae('0xa')]);router['get']('/:id',auth[_0x87ae('0x7')](),controller[_0x87ae('0xb')]);router[_0x87ae('0xc')]('/',auth[_0x87ae('0x7')](),controller[_0x87ae('0xd')]);router[_0x87ae('0xe')](_0x87ae('0xf'),auth[_0x87ae('0x7')](),controller[_0x87ae('0x10')]);router[_0x87ae('0x11')](_0x87ae('0xf'),auth['isAuthenticated'](),controller[_0x87ae('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 24daa3d..7492ef6 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 _0xcbfa=['exports','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0xdb409b,_0x18e328){var _0x5a2bd9=function(_0x18ffa0){while(--_0x18ffa0){_0xdb409b['push'](_0xdb409b['shift']());}};_0x5a2bd9(++_0x18e328);}(_0xcbfa,0x172));var _0xacbf=function(_0x567011,_0x273172){_0x567011=_0x567011-0x0;var _0x50ac02=_0xcbfa[_0x567011];return _0x50ac02;};'use strict';var Sequelize=require(_0xacbf('0x0'));var moment=require('moment');module[_0xacbf('0x1')]={'type':{'type':Sequelize[_0xacbf('0x2')](_0xacbf('0x3'),_0xacbf('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xacbf('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xacbf('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xacbf('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xacbf('0x5')]},'transferercontext':{'type':Sequelize[_0xacbf('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xacbf('0x5')]},'transfereechannel':{'type':Sequelize[_0xacbf('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xacbf('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xacbf('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xacbf('0x5')]},'transfereecontext':{'type':Sequelize[_0xacbf('0x5')]},'transfereeexten':{'type':Sequelize[_0xacbf('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xacbf('0x5')]},'isexternal':{'type':Sequelize[_0xacbf('0x2')](_0xacbf('0x6'),'No')},'context':{'type':Sequelize[_0xacbf('0x5')]},'extension':{'type':Sequelize[_0xacbf('0x5')]}}; \ No newline at end of file +var _0xb48d=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x1388a9,_0x5a533a){var _0x4c6cf7=function(_0x5148c8){while(--_0x5148c8){_0x1388a9['push'](_0x1388a9['shift']());}};_0x4c6cf7(++_0x5a533a);}(_0xb48d,0xfe));var _0xdb48=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xb48d[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require(_0xdb48('0x0'));var moment=require(_0xdb48('0x1'));module[_0xdb48('0x2')]={'type':{'type':Sequelize[_0xdb48('0x3')](_0xdb48('0x4'),_0xdb48('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xdb48('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xdb48('0x6')]},'transferercalleridname':{'type':Sequelize[_0xdb48('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xdb48('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xdb48('0x6')]},'transferercontext':{'type':Sequelize[_0xdb48('0x6')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xdb48('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xdb48('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xdb48('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xdb48('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xdb48('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xdb48('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0xdb48('0x7'),'No')},'context':{'type':Sequelize[_0xdb48('0x6')]},'extension':{'type':Sequelize[_0xdb48('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 216f817..2b1501d 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 _0xc35e=['filter','where','merge','type','options','VoiceTransferReport','include','findAll','then','rows','includeAll','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','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','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','end','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4685c6,_0x4d9867){var _0x32934f=function(_0x11e7dd){while(--_0x11e7dd){_0x4685c6['push'](_0x4685c6['shift']());}};_0x32934f(++_0x4d9867);}(_0xc35e,0x18e));var _0xec35=function(_0x5a2655,_0x3e36c3){_0x5a2655=_0x5a2655-0x0;var _0x4ddb50=_0xc35e[_0x5a2655];return _0x4ddb50;};'use strict';var emlformat=require(_0xec35('0x0'));var rimraf=require(_0xec35('0x1'));var zipdir=require(_0xec35('0x2'));var jsonpatch=require(_0xec35('0x3'));var rp=require('request-promise');var moment=require(_0xec35('0x4'));var BPromise=require(_0xec35('0x5'));var Mustache=require('mustache');var util=require(_0xec35('0x6'));var path=require(_0xec35('0x7'));var sox=require(_0xec35('0x8'));var csv=require(_0xec35('0x9'));var ejs=require(_0xec35('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec35('0xb'));var squel=require('squel');var crypto=require(_0xec35('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xec35('0xd'));var toCsv=require(_0xec35('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec35('0xe'));var authService=require(_0xec35('0xf'));var qs=require(_0xec35('0x10'));var as=require(_0xec35('0x11'));var hardwareService=require(_0xec35('0x12'));var logger=require(_0xec35('0x13'))(_0xec35('0x14'));var utils=require(_0xec35('0x15'));var config=require(_0xec35('0x16'));var licenseUtil=require(_0xec35('0x17'));var db=require(_0xec35('0x18'))['db'];function respondWithStatusCode(_0x21873b,_0x51fb90){_0x51fb90=_0x51fb90||0xcc;return function(_0x483b7b){if(_0x483b7b){return _0x21873b[_0xec35('0x19')](_0x51fb90);}return _0x21873b[_0xec35('0x1a')](_0x51fb90)['end']();};}function respondWithResult(_0x50da4d,_0x4f615d){_0x4f615d=_0x4f615d||0xc8;return function(_0x5802c9){if(_0x5802c9){return _0x50da4d['status'](_0x4f615d)[_0xec35('0x1b')](_0x5802c9);}};}function respondWithFilteredResult(_0x21f6b4,_0x153c07){return function(_0xf40aad){if(_0xf40aad){var _0x1c8f7f=typeof _0x153c07[_0xec35('0x1c')]===_0xec35('0x1d')&&typeof _0x153c07[_0xec35('0x1e')]===_0xec35('0x1d');var _0x437017=_0xf40aad[_0xec35('0x1f')];var _0x3fbd3a=_0x1c8f7f?0x0:_0x153c07[_0xec35('0x1c')];var _0x5bee1c=_0x1c8f7f?_0xf40aad[_0xec35('0x1f')]:_0x153c07[_0xec35('0x1c')]+_0x153c07[_0xec35('0x1e')];var _0xd4c7c9;if(_0x5bee1c>=_0x437017){_0x5bee1c=_0x437017;_0xd4c7c9=0xc8;}else{_0xd4c7c9=0xce;}_0x21f6b4[_0xec35('0x1a')](_0xd4c7c9);return _0x21f6b4['set'](_0xec35('0x20'),_0x3fbd3a+'-'+_0x5bee1c+'/'+_0x437017)[_0xec35('0x1b')](_0xf40aad);}return null;};}function patchUpdates(_0x2caa2e){return function(_0x297bdf){try{jsonpatch[_0xec35('0x21')](_0x297bdf,_0x2caa2e,!![]);}catch(_0xbfa0a7){return BPromise[_0xec35('0x22')](_0xbfa0a7);}return _0x297bdf[_0xec35('0x23')]();};}function saveUpdates(_0x543c45,_0x47f378){return function(_0x31274d){if(_0x31274d){return _0x31274d[_0xec35('0x24')](_0x543c45)['then'](function(_0x3caa47){return _0x3caa47;});}return null;};}function removeEntity(_0x121d8f,_0x5ac682){return function(_0x55d6bb){if(_0x55d6bb){return _0x55d6bb['destroy']()['then'](function(){_0x121d8f[_0xec35('0x1a')](0xcc)[_0xec35('0x25')]();});}};}function handleEntityNotFound(_0x19b9aa,_0x3693f2){return function(_0x426e80){if(!_0x426e80){_0x19b9aa[_0xec35('0x19')](0x194);}return _0x426e80;};}function handleError(_0x3c915f,_0x4d48d2){_0x4d48d2=_0x4d48d2||0x1f4;return function(_0x2a4880){logger[_0xec35('0x26')](_0x2a4880[_0xec35('0x27')]);if(_0x2a4880['name']){delete _0x2a4880[_0xec35('0x28')];}_0x3c915f[_0xec35('0x1a')](_0x4d48d2)['send'](_0x2a4880);};}exports[_0xec35('0x29')]=function(_0x4759a0,_0x710668){var _0x5e7957={},_0x4ae4c4={},_0x463a07={'count':0x0,'rows':[]};var _0x100c06=_[_0xec35('0x2a')](db['VoiceTransferReport'][_0xec35('0x2b')],function(_0x38adb7){return{'name':_0x38adb7[_0xec35('0x2c')],'type':_0x38adb7['type'][_0xec35('0x2d')]};});_0x4ae4c4[_0xec35('0x2e')]=_[_0xec35('0x2a')](_0x100c06,'name');_0x4ae4c4[_0xec35('0x2f')]=_[_0xec35('0x30')](_0x4759a0['query']);_0x4ae4c4[_0xec35('0x31')]=_[_0xec35('0x32')](_0x4ae4c4[_0xec35('0x2e')],_0x4ae4c4[_0xec35('0x2f')]);_0x5e7957[_0xec35('0x33')]=_[_0xec35('0x32')](_0x4ae4c4[_0xec35('0x2e')],qs['fields'](_0x4759a0[_0xec35('0x2f')][_0xec35('0x34')]));_0x5e7957[_0xec35('0x33')]=_0x5e7957[_0xec35('0x33')][_0xec35('0x35')]?_0x5e7957[_0xec35('0x33')]:_0x4ae4c4[_0xec35('0x2e')];if(!_0x4759a0[_0xec35('0x2f')][_0xec35('0x36')](_0xec35('0x37'))){_0x5e7957[_0xec35('0x1e')]=qs[_0xec35('0x1e')](_0x4759a0[_0xec35('0x2f')]['limit']);_0x5e7957['offset']=qs[_0xec35('0x1c')](_0x4759a0['query'][_0xec35('0x1c')]);}_0x5e7957[_0xec35('0x38')]=qs[_0xec35('0x39')](_0x4759a0[_0xec35('0x2f')][_0xec35('0x39')]);_0x5e7957['where']=qs[_0xec35('0x31')](_['pick'](_0x4759a0['query'],_0x4ae4c4[_0xec35('0x31')]),_0x100c06);if(_0x4759a0[_0xec35('0x2f')][_0xec35('0x3a')]){_0x5e7957[_0xec35('0x3b')]=_[_0xec35('0x3c')](_0x5e7957[_0xec35('0x3b')],{'$or':_['map'](_0x100c06,function(_0x5e2207){if(_0x5e2207[_0xec35('0x3d')]!=='VIRTUAL'){var _0x36e2dd={};_0x36e2dd[_0x5e2207[_0xec35('0x28')]]={'$like':'%'+_0x4759a0[_0xec35('0x2f')][_0xec35('0x3a')]+'%'};return _0x36e2dd;}})});}_0x5e7957=_['merge']({},_0x5e7957,_0x4759a0[_0xec35('0x3e')]);var _0x40a6eb={'where':_0x5e7957[_0xec35('0x3b')]};return db[_0xec35('0x3f')][_0xec35('0x1f')](_0x40a6eb)['then'](function(_0x58893d){_0x463a07[_0xec35('0x1f')]=_0x58893d;if(_0x4759a0[_0xec35('0x2f')]['includeAll']){_0x5e7957[_0xec35('0x40')]=[{'all':!![]}];}return db[_0xec35('0x3f')][_0xec35('0x41')](_0x5e7957);})[_0xec35('0x42')](function(_0x3fea57){_0x463a07[_0xec35('0x43')]=_0x3fea57;return _0x463a07;})['then'](respondWithFilteredResult(_0x710668,_0x5e7957))['catch'](handleError(_0x710668,null));};exports['show']=function(_0x1f9960,_0xdacf7f){var _0x4184de={'raw':!![],'where':{'id':_0x1f9960['params']['id']}},_0x23a3c4={};_0x23a3c4[_0xec35('0x2e')]=_[_0xec35('0x30')](db[_0xec35('0x3f')][_0xec35('0x2b')]);_0x23a3c4['query']=_[_0xec35('0x30')](_0x1f9960[_0xec35('0x2f')]);_0x23a3c4[_0xec35('0x31')]=_['intersection'](_0x23a3c4[_0xec35('0x2e')],_0x23a3c4['query']);_0x4184de[_0xec35('0x33')]=_[_0xec35('0x32')](_0x23a3c4[_0xec35('0x2e')],qs[_0xec35('0x34')](_0x1f9960[_0xec35('0x2f')][_0xec35('0x34')]));_0x4184de[_0xec35('0x33')]=_0x4184de[_0xec35('0x33')][_0xec35('0x35')]?_0x4184de[_0xec35('0x33')]:_0x23a3c4[_0xec35('0x2e')];if(_0x1f9960[_0xec35('0x2f')][_0xec35('0x44')]){_0x4184de['include']=[{'all':!![]}];}_0x4184de=_[_0xec35('0x3c')]({},_0x4184de,_0x1f9960['options']);return db[_0xec35('0x3f')][_0xec35('0x45')](_0x4184de)[_0xec35('0x42')](handleEntityNotFound(_0xdacf7f,null))[_0xec35('0x42')](respondWithResult(_0xdacf7f,null))[_0xec35('0x46')](handleError(_0xdacf7f,null));};exports['create']=function(_0x4d293f,_0x1635af){return db[_0xec35('0x3f')][_0xec35('0x47')](_0x4d293f[_0xec35('0x48')],{})[_0xec35('0x42')](respondWithResult(_0x1635af,0xc9))[_0xec35('0x46')](handleError(_0x1635af,null));};exports[_0xec35('0x24')]=function(_0x12735b,_0xa16971){if(_0x12735b[_0xec35('0x48')]['id']){delete _0x12735b[_0xec35('0x48')]['id'];}return db[_0xec35('0x3f')][_0xec35('0x45')]({'where':{'id':_0x12735b[_0xec35('0x49')]['id']}})[_0xec35('0x42')](handleEntityNotFound(_0xa16971,null))[_0xec35('0x42')](saveUpdates(_0x12735b[_0xec35('0x48')],null))['then'](respondWithResult(_0xa16971,null))['catch'](handleError(_0xa16971,null));};exports[_0xec35('0x4a')]=function(_0x594fee,_0x13d147){return db['VoiceTransferReport'][_0xec35('0x45')]({'where':{'id':_0x594fee[_0xec35('0x49')]['id']}})['then'](handleEntityNotFound(_0x13d147,null))[_0xec35('0x42')](removeEntity(_0x13d147,null))['catch'](handleError(_0x13d147,null));};exports[_0xec35('0x4b')]=function(_0x2037cc,_0x368f3c){return db[_0xec35('0x3f')][_0xec35('0x4b')]()[_0xec35('0x42')](respondWithResult(_0x368f3c,null))[_0xec35('0x46')](handleError(_0x368f3c,null));}; \ No newline at end of file +var _0x6493=['mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','error','stack','name','send','index','VoiceTransferReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','length','include','find','create','update','body','destroy','describe','eml-format','zip-dir','moment','bluebird'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x6493,0x124));var _0x3649=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0x6493[_0x4f83ca];return _0x1fbac3;};'use strict';var emlformat=require(_0x3649('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3649('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3649('0x2'));var BPromise=require(_0x3649('0x3'));var Mustache=require(_0x3649('0x4'));var util=require(_0x3649('0x5'));var path=require(_0x3649('0x6'));var sox=require('sox');var csv=require(_0x3649('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3649('0x8'));var _=require('lodash');var squel=require(_0x3649('0x9'));var crypto=require(_0x3649('0xa'));var jsforce=require(_0x3649('0xb'));var deskjs=require(_0x3649('0xc'));var toCsv=require(_0x3649('0x7'));var querystring=require(_0x3649('0xd'));var Papa=require(_0x3649('0xe'));var Redis=require(_0x3649('0xf'));var authService=require(_0x3649('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3649('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3649('0x12'))(_0x3649('0x13'));var utils=require(_0x3649('0x14'));var config=require(_0x3649('0x15'));var licenseUtil=require(_0x3649('0x16'));var db=require(_0x3649('0x17'))['db'];function respondWithStatusCode(_0x3a2cca,_0x52f0fa){_0x52f0fa=_0x52f0fa||0xcc;return function(_0x4b13ee){if(_0x4b13ee){return _0x3a2cca[_0x3649('0x18')](_0x52f0fa);}return _0x3a2cca[_0x3649('0x19')](_0x52f0fa)[_0x3649('0x1a')]();};}function respondWithResult(_0x38158d,_0x319e35){_0x319e35=_0x319e35||0xc8;return function(_0x511572){if(_0x511572){return _0x38158d[_0x3649('0x19')](_0x319e35)[_0x3649('0x1b')](_0x511572);}};}function respondWithFilteredResult(_0x1084f8,_0x876f23){return function(_0x9f000b){if(_0x9f000b){var _0x540b0d=typeof _0x876f23['offset']===_0x3649('0x1c')&&typeof _0x876f23[_0x3649('0x1d')]===_0x3649('0x1c');var _0x276026=_0x9f000b[_0x3649('0x1e')];var _0x14d9cc=_0x540b0d?0x0:_0x876f23[_0x3649('0x1f')];var _0x20a93d=_0x540b0d?_0x9f000b[_0x3649('0x1e')]:_0x876f23[_0x3649('0x1f')]+_0x876f23[_0x3649('0x1d')];var _0x4cd165;if(_0x20a93d>=_0x276026){_0x20a93d=_0x276026;_0x4cd165=0xc8;}else{_0x4cd165=0xce;}_0x1084f8['status'](_0x4cd165);return _0x1084f8[_0x3649('0x20')](_0x3649('0x21'),_0x14d9cc+'-'+_0x20a93d+'/'+_0x276026)[_0x3649('0x1b')](_0x9f000b);}return null;};}function patchUpdates(_0x498873){return function(_0x15706b){try{jsonpatch[_0x3649('0x22')](_0x15706b,_0x498873,!![]);}catch(_0x165ab2){return BPromise[_0x3649('0x23')](_0x165ab2);}return _0x15706b['save']();};}function saveUpdates(_0x3fc197,_0x5468ac){return function(_0x5003e9){if(_0x5003e9){return _0x5003e9['update'](_0x3fc197)[_0x3649('0x24')](function(_0x4921bd){return _0x4921bd;});}return null;};}function removeEntity(_0x31f96f,_0x3e53f2){return function(_0x4fc3b9){if(_0x4fc3b9){return _0x4fc3b9['destroy']()[_0x3649('0x24')](function(){_0x31f96f[_0x3649('0x19')](0xcc)[_0x3649('0x1a')]();});}};}function handleEntityNotFound(_0x4e38e2,_0x358152){return function(_0xd214ea){if(!_0xd214ea){_0x4e38e2[_0x3649('0x18')](0x194);}return _0xd214ea;};}function handleError(_0x2689ab,_0x283a49){_0x283a49=_0x283a49||0x1f4;return function(_0x705f9a){logger[_0x3649('0x25')](_0x705f9a[_0x3649('0x26')]);if(_0x705f9a[_0x3649('0x27')]){delete _0x705f9a[_0x3649('0x27')];}_0x2689ab[_0x3649('0x19')](_0x283a49)[_0x3649('0x28')](_0x705f9a);};}exports[_0x3649('0x29')]=function(_0x413a30,_0x1c097e){var _0x17e61c={},_0x3ca0b8={},_0x18b882={'count':0x0,'rows':[]};var _0xf0245c=_['map'](db[_0x3649('0x2a')][_0x3649('0x2b')],function(_0x13f914){return{'name':_0x13f914['fieldName'],'type':_0x13f914[_0x3649('0x2c')][_0x3649('0x2d')]};});_0x3ca0b8[_0x3649('0x2e')]=_[_0x3649('0x2f')](_0xf0245c,_0x3649('0x27'));_0x3ca0b8['query']=_[_0x3649('0x30')](_0x413a30[_0x3649('0x31')]);_0x3ca0b8[_0x3649('0x32')]=_[_0x3649('0x33')](_0x3ca0b8[_0x3649('0x2e')],_0x3ca0b8[_0x3649('0x31')]);_0x17e61c['attributes']=_[_0x3649('0x33')](_0x3ca0b8[_0x3649('0x2e')],qs[_0x3649('0x34')](_0x413a30['query'][_0x3649('0x34')]));_0x17e61c[_0x3649('0x35')]=_0x17e61c[_0x3649('0x35')]['length']?_0x17e61c[_0x3649('0x35')]:_0x3ca0b8[_0x3649('0x2e')];if(!_0x413a30[_0x3649('0x31')]['hasOwnProperty'](_0x3649('0x36'))){_0x17e61c[_0x3649('0x1d')]=qs[_0x3649('0x1d')](_0x413a30['query'][_0x3649('0x1d')]);_0x17e61c[_0x3649('0x1f')]=qs[_0x3649('0x1f')](_0x413a30['query'][_0x3649('0x1f')]);}_0x17e61c['order']=qs[_0x3649('0x37')](_0x413a30['query']['sort']);_0x17e61c[_0x3649('0x38')]=qs[_0x3649('0x32')](_[_0x3649('0x39')](_0x413a30[_0x3649('0x31')],_0x3ca0b8[_0x3649('0x32')]),_0xf0245c);if(_0x413a30['query'][_0x3649('0x3a')]){_0x17e61c[_0x3649('0x38')]=_[_0x3649('0x3b')](_0x17e61c[_0x3649('0x38')],{'$or':_[_0x3649('0x2f')](_0xf0245c,function(_0x59aa4b){if(_0x59aa4b[_0x3649('0x2c')]!==_0x3649('0x3c')){var _0x27b20a={};_0x27b20a[_0x59aa4b[_0x3649('0x27')]]={'$like':'%'+_0x413a30[_0x3649('0x31')]['filter']+'%'};return _0x27b20a;}})});}_0x17e61c=_['merge']({},_0x17e61c,_0x413a30['options']);var _0x6c9bc0={'where':_0x17e61c[_0x3649('0x38')]};return db[_0x3649('0x2a')]['count'](_0x6c9bc0)[_0x3649('0x24')](function(_0x4e4436){_0x18b882[_0x3649('0x1e')]=_0x4e4436;if(_0x413a30[_0x3649('0x31')][_0x3649('0x3d')]){_0x17e61c['include']=[{'all':!![]}];}return db[_0x3649('0x2a')]['findAll'](_0x17e61c);})[_0x3649('0x24')](function(_0x3f46bb){_0x18b882[_0x3649('0x3e')]=_0x3f46bb;return _0x18b882;})[_0x3649('0x24')](respondWithFilteredResult(_0x1c097e,_0x17e61c))[_0x3649('0x3f')](handleError(_0x1c097e,null));};exports[_0x3649('0x40')]=function(_0x41ce67,_0x497cbc){var _0x5f75bd={'raw':!![],'where':{'id':_0x41ce67[_0x3649('0x41')]['id']}},_0x414c73={};_0x414c73[_0x3649('0x2e')]=_['keys'](db[_0x3649('0x2a')][_0x3649('0x2b')]);_0x414c73['query']=_[_0x3649('0x30')](_0x41ce67['query']);_0x414c73[_0x3649('0x32')]=_[_0x3649('0x33')](_0x414c73[_0x3649('0x2e')],_0x414c73[_0x3649('0x31')]);_0x5f75bd[_0x3649('0x35')]=_[_0x3649('0x33')](_0x414c73[_0x3649('0x2e')],qs[_0x3649('0x34')](_0x41ce67[_0x3649('0x31')][_0x3649('0x34')]));_0x5f75bd['attributes']=_0x5f75bd['attributes'][_0x3649('0x42')]?_0x5f75bd[_0x3649('0x35')]:_0x414c73['model'];if(_0x41ce67['query'][_0x3649('0x3d')]){_0x5f75bd[_0x3649('0x43')]=[{'all':!![]}];}_0x5f75bd=_[_0x3649('0x3b')]({},_0x5f75bd,_0x41ce67['options']);return db[_0x3649('0x2a')][_0x3649('0x44')](_0x5f75bd)[_0x3649('0x24')](handleEntityNotFound(_0x497cbc,null))[_0x3649('0x24')](respondWithResult(_0x497cbc,null))[_0x3649('0x3f')](handleError(_0x497cbc,null));};exports[_0x3649('0x45')]=function(_0x35ed38,_0x59b946){return db['VoiceTransferReport'][_0x3649('0x45')](_0x35ed38['body'],{})['then'](respondWithResult(_0x59b946,0xc9))[_0x3649('0x3f')](handleError(_0x59b946,null));};exports[_0x3649('0x46')]=function(_0x2eba6b,_0x1a3522){if(_0x2eba6b[_0x3649('0x47')]['id']){delete _0x2eba6b[_0x3649('0x47')]['id'];}return db[_0x3649('0x2a')][_0x3649('0x44')]({'where':{'id':_0x2eba6b[_0x3649('0x41')]['id']}})[_0x3649('0x24')](handleEntityNotFound(_0x1a3522,null))['then'](saveUpdates(_0x2eba6b[_0x3649('0x47')],null))[_0x3649('0x24')](respondWithResult(_0x1a3522,null))['catch'](handleError(_0x1a3522,null));};exports[_0x3649('0x48')]=function(_0x19e20a,_0x5c8d9d){return db[_0x3649('0x2a')][_0x3649('0x44')]({'where':{'id':_0x19e20a[_0x3649('0x41')]['id']}})[_0x3649('0x24')](handleEntityNotFound(_0x5c8d9d,null))['then'](removeEntity(_0x5c8d9d,null))[_0x3649('0x3f')](handleError(_0x5c8d9d,null));};exports[_0x3649('0x49')]=function(_0x2ad8ad,_0xa6b86e){return db['VoiceTransferReport'][_0x3649('0x49')]()[_0x3649('0x24')](respondWithResult(_0xa6b86e,null))[_0x3649('0x3f')](handleError(_0xa6b86e,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c12dce2..bd1717f 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 _0xd603=['rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','request-promise'];(function(_0x36d04b,_0x386d0d){var _0x1a11f4=function(_0xcc0a49){while(--_0xcc0a49){_0x36d04b['push'](_0x36d04b['shift']());}};_0x1a11f4(++_0x386d0d);}(_0xd603,0x19f));var _0x3d60=function(_0x244862,_0x3da79e){_0x244862=_0x244862-0x0;var _0x2bce23=_0xd603[_0x244862];return _0x2bce23;};'use strict';var _=require(_0x3d60('0x0'));var util=require(_0x3d60('0x1'));var logger=require(_0x3d60('0x2'))(_0x3d60('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3d60('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d60('0x5'));var config=require('../../config/environment');var attributes=require(_0x3d60('0x6'));module[_0x3d60('0x7')]=function(_0x3ef253,_0x21252c){return _0x3ef253[_0x3d60('0x8')](_0x3d60('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32a0=['util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','report_call_transfer'];(function(_0x2f8dd4,_0x38373c){var _0x152c60=function(_0x422cb2){while(--_0x422cb2){_0x2f8dd4['push'](_0x2f8dd4['shift']());}};_0x152c60(++_0x38373c);}(_0x32a0,0x190));var _0x032a=function(_0x31f2dc,_0x4b13bd){_0x31f2dc=_0x31f2dc-0x0;var _0x2359b2=_0x32a0[_0x31f2dc];return _0x2359b2;};'use strict';var _=require('lodash');var util=require(_0x032a('0x0'));var logger=require(_0x032a('0x1'))(_0x032a('0x2'));var moment=require(_0x032a('0x3'));var BPromise=require(_0x032a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x032a('0x5'));var rimraf=require(_0x032a('0x6'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x032a('0x7')]=function(_0x222586,_0x2a5d59){return _0x222586[_0x032a('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x032a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index eaa6612..3f752a7 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 _0xb8ec=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','catch','CreateVoiceTransferReport','body','options','raw','util'];(function(_0x1e7f4d,_0x20acaa){var _0x5f0fd9=function(_0x4dbbf4){while(--_0x4dbbf4){_0x1e7f4d['push'](_0x1e7f4d['shift']());}};_0x5f0fd9(++_0x20acaa);}(_0xb8ec,0x95));var _0xcb8e=function(_0x390966,_0x3e06b7){_0x390966=_0x390966-0x0;var _0x4ae1ec=_0xb8ec[_0x390966];return _0x4ae1ec;};'use strict';var _=require('lodash');var util=require(_0xcb8e('0x0'));var moment=require(_0xcb8e('0x1'));var BPromise=require(_0xcb8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb8e('0x3'));var db=require(_0xcb8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb8e('0x5'))(_0xcb8e('0x6'));var config=require(_0xcb8e('0x7'));var jayson=require(_0xcb8e('0x8'));var client=jayson[_0xcb8e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x181d73,_0x216b51,_0x2c283a){return new BPromise(function(_0x3ba6ed,_0x5471ff){return client['request'](_0x181d73,_0x2c283a)[_0xcb8e('0xa')](function(_0x501daf){logger[_0xcb8e('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x216b51,_0xcb8e('0xc'));logger[_0xcb8e('0xd')](_0xcb8e('0xe'),_0x216b51,_0xcb8e('0xc'),JSON['stringify'](_0x501daf));if(_0x501daf[_0xcb8e('0xf')]){if(_0x501daf['error'][_0xcb8e('0x10')]===0x1f4){logger[_0xcb8e('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x216b51,_0x501daf[_0xcb8e('0xf')][_0xcb8e('0x11')]);return _0x5471ff(_0x501daf[_0xcb8e('0xf')][_0xcb8e('0x11')]);}logger[_0xcb8e('0xf')](_0xcb8e('0x12'),_0x216b51,_0x501daf['error']['message']);return _0x3ba6ed(_0x501daf[_0xcb8e('0xf')][_0xcb8e('0x11')]);}else{logger[_0xcb8e('0xb')](_0xcb8e('0x12'),_0x216b51,_0xcb8e('0xc'));_0x3ba6ed(_0x501daf[_0xcb8e('0x13')][_0xcb8e('0x11')]);}})[_0xcb8e('0x14')](function(_0x2727e1){logger['error'](_0xcb8e('0x12'),_0x216b51,_0x2727e1);_0x5471ff(_0x2727e1);});});}exports[_0xcb8e('0x15')]=function(_0x3ba064){var _0x44c26c=this;return new Promise(function(_0x5867ee,_0x58d422){return db['VoiceTransferReport']['create'](_0x3ba064[_0xcb8e('0x16')],{'raw':_0x3ba064[_0xcb8e('0x17')]?_0x3ba064['options'][_0xcb8e('0x18')]===undefined?!![]:![]:!![]})[_0xcb8e('0xa')](function(_0xdfdb4f){logger[_0xcb8e('0xb')](_0xcb8e('0x15'),_0x3ba064);logger[_0xcb8e('0xd')]('CreateVoiceTransferReport',_0x3ba064,JSON['stringify'](_0xdfdb4f));_0x5867ee(_0xdfdb4f);})['catch'](function(_0xe883b5){logger[_0xcb8e('0xf')](_0xcb8e('0x15'),_0xe883b5[_0xcb8e('0x11')],_0x3ba064);_0x58d422(_0x44c26c['error'](0x1f4,_0xe883b5[_0xcb8e('0x11')]));});});}; \ No newline at end of file +var _0x4cbb=['debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','VoiceTransferReport','options','CreateVoiceTransferReport'];(function(_0x1a8bbc,_0x17a086){var _0x212fc2=function(_0x55c718){while(--_0x55c718){_0x1a8bbc['push'](_0x1a8bbc['shift']());}};_0x212fc2(++_0x17a086);}(_0x4cbb,0xb7));var _0xb4cb=function(_0x2f6cbd,_0x4dbbd3){_0x2f6cbd=_0x2f6cbd-0x0;var _0x530361=_0x4cbb[_0x2f6cbd];return _0x530361;};'use strict';var _=require(_0xb4cb('0x0'));var util=require(_0xb4cb('0x1'));var moment=require(_0xb4cb('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4cb('0x3'));var fs=require('fs');var Redis=require(_0xb4cb('0x4'));var db=require(_0xb4cb('0x5'))['db'];var utils=require(_0xb4cb('0x6'));var logger=require(_0xb4cb('0x7'))(_0xb4cb('0x8'));var config=require(_0xb4cb('0x9'));var jayson=require(_0xb4cb('0xa'));var client=jayson[_0xb4cb('0xb')][_0xb4cb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10838a,_0x1699b7,_0xd70509){return new BPromise(function(_0x938948,_0x171931){return client['request'](_0x10838a,_0xd70509)[_0xb4cb('0xd')](function(_0x505e5f){logger['info'](_0xb4cb('0xe'),_0x1699b7,_0xb4cb('0xf'));logger['debug'](_0xb4cb('0x10'),_0x1699b7,'request\x20sent',JSON[_0xb4cb('0x11')](_0x505e5f));if(_0x505e5f[_0xb4cb('0x12')]){if(_0x505e5f[_0xb4cb('0x12')]['code']===0x1f4){logger[_0xb4cb('0x12')](_0xb4cb('0xe'),_0x1699b7,_0x505e5f[_0xb4cb('0x12')][_0xb4cb('0x13')]);return _0x171931(_0x505e5f['error'][_0xb4cb('0x13')]);}logger[_0xb4cb('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x1699b7,_0x505e5f[_0xb4cb('0x12')][_0xb4cb('0x13')]);return _0x938948(_0x505e5f[_0xb4cb('0x12')][_0xb4cb('0x13')]);}else{logger[_0xb4cb('0x14')](_0xb4cb('0xe'),_0x1699b7,_0xb4cb('0xf'));_0x938948(_0x505e5f['result'][_0xb4cb('0x13')]);}})[_0xb4cb('0x15')](function(_0x214e75){logger[_0xb4cb('0x12')](_0xb4cb('0xe'),_0x1699b7,_0x214e75);_0x171931(_0x214e75);});});}exports['CreateVoiceTransferReport']=function(_0x4cf186){var _0x157b8c=this;return new Promise(function(_0x47d7a5,_0x56545d){return db[_0xb4cb('0x16')]['create'](_0x4cf186['body'],{'raw':_0x4cf186[_0xb4cb('0x17')]?_0x4cf186[_0xb4cb('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xb4cb('0xd')](function(_0x485fbd){logger['info'](_0xb4cb('0x18'),_0x4cf186);logger[_0xb4cb('0x19')](_0xb4cb('0x18'),_0x4cf186,JSON[_0xb4cb('0x11')](_0x485fbd));_0x47d7a5(_0x485fbd);})[_0xb4cb('0x15')](function(_0x147a04){logger[_0xb4cb('0x12')](_0xb4cb('0x18'),_0x147a04[_0xb4cb('0x13')],_0x4cf186);_0x56545d(_0x157b8c[_0xb4cb('0x12')](0x1f4,_0x147a04[_0xb4cb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 544bf0c..acd3428 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 _0x762d=['/hangup','hangup','/answer','answer','/unhold','unhold','/calls','calls','transfer','exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','canUpdate'];(function(_0x2f21c6,_0x5b4f43){var _0x141489=function(_0x2c5356){while(--_0x2c5356){_0x2f21c6['push'](_0x2f21c6['shift']());}};_0x141489(++_0x5b4f43);}(_0x762d,0x1d5));var _0xd762=function(_0x30ee31,_0x311c91){_0x30ee31=_0x30ee31-0x0;var _0x47baa6=_0x762d[_0x30ee31];return _0x47baa6;};'use strict';var express=require(_0xd762('0x0'));var router=express[_0xd762('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd762('0x2'));router[_0xd762('0x3')](_0xd762('0x4'),auth[_0xd762('0x5')](),auth[_0xd762('0x6')](),controller['originate']);router[_0xd762('0x3')](_0xd762('0x7'),auth['isAuthenticated'](),auth[_0xd762('0x6')](),controller[_0xd762('0x8')]);router['post'](_0xd762('0x9'),auth['isAuthenticated'](),auth[_0xd762('0x6')](),controller[_0xd762('0xa')]);router['post']('/hold',auth[_0xd762('0x5')](),auth[_0xd762('0x6')](),controller['hold']);router['post'](_0xd762('0xb'),auth[_0xd762('0x5')](),auth[_0xd762('0x6')](),controller[_0xd762('0xc')]);router['post'](_0xd762('0xd'),auth[_0xd762('0x5')](),auth[_0xd762('0x6')](),controller[_0xd762('0xe')]);router['post']('/transfer',auth['isAuthenticated'](),auth[_0xd762('0x6')](),controller[_0xd762('0xf')]);module[_0xd762('0x10')]=router; \ No newline at end of file +var _0x216f=['unhold','/transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','canUpdate','originate','/hangup','/answer','isAuthenticated','answer','/hold','hold'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x216f,0x9c));var _0xf216=function(_0x541ab3,_0x3f4845){_0x541ab3=_0x541ab3-0x0;var _0x39f9c2=_0x216f[_0x541ab3];return _0x39f9c2;};'use strict';var express=require(_0xf216('0x0'));var router=express[_0xf216('0x1')]();var auth=require(_0xf216('0x2'));var controller=require(_0xf216('0x3'));router[_0xf216('0x4')](_0xf216('0x5'),auth['isAuthenticated'](),auth[_0xf216('0x6')](),controller[_0xf216('0x7')]);router[_0xf216('0x4')](_0xf216('0x8'),auth['isAuthenticated'](),auth[_0xf216('0x6')](),controller['hangup']);router[_0xf216('0x4')](_0xf216('0x9'),auth[_0xf216('0xa')](),auth[_0xf216('0x6')](),controller[_0xf216('0xb')]);router[_0xf216('0x4')](_0xf216('0xc'),auth[_0xf216('0xa')](),auth[_0xf216('0x6')](),controller[_0xf216('0xd')]);router['post']('/unhold',auth[_0xf216('0xa')](),auth[_0xf216('0x6')](),controller[_0xf216('0xe')]);router[_0xf216('0x4')]('/calls',auth[_0xf216('0xa')](),auth['canUpdate'](),controller['calls']);router[_0xf216('0x4')](_0xf216('0xf'),auth[_0xf216('0xa')](),auth[_0xf216('0x6')](),controller['transfer']);module[_0xf216('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 54bee14..85d6291 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 _0x684c=['NotFound','error','code','result','catch','User','agent','then','VoiceChannels','all','filter','rows','UserId','\x20not\x20found!','originate','info','body','json','userId','callNumber','format','user:%s','webbar:originate','originate\x20executed!','hangup\x20fired:','sessionId','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','length','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','emit','log','handleError:','stack','name','status','send'];(function(_0x2db36d,_0x344748){var _0x56fa6b=function(_0x53ea0a){while(--_0x53ea0a){_0x2db36d['push'](_0x2db36d['shift']());}};_0x56fa6b(++_0x344748);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xc684('0x0'));var fs=require('fs');var _=require(_0xc684('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xc684('0x2'));var util=require(_0xc684('0x3'));var BPromise=require(_0xc684('0x4'));var jayson=require(_0xc684('0x5'));var amiClient=jayson[_0xc684('0x6')]['http']({'port':0x232a});var logger=require(_0xc684('0x7'))(_0xc684('0x8'));var Redis=require(_0xc684('0x9'));config[_0xc684('0xa')]=_[_0xc684('0xb')](config[_0xc684('0xa')],{'host':_0xc684('0xc'),'port':0x18eb});var io=require(_0xc684('0xd'))(new Redis(config[_0xc684('0xa')]));var Schema=require(_0xc684('0xe'));var originateValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],_0xc684('0x10')]},'callNumber':{'type':_0xc684('0x11'),'required':[!![],_0xc684('0x12')]},'callerId':{'type':_0xc684('0x11')},'callbackUrl':{'type':_0xc684('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xc684('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],_0xc684('0x10')]},'sessionId':{'type':_0xc684('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],_0xc684('0x10')]},'sessionId':{'type':'string','required':[!![],_0xc684('0x13')]},'transferNumber':{'type':_0xc684('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc684('0x10')]},'sessionId':{'type':_0xc684('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],_0xc684('0x10')]},'sessionId':{'type':_0xc684('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xc684('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc684('0x10')]}});function emit(_0x599c93,_0x4f0ef9,_0x51f0a8){logger['info'](_0x599c93,_0x4f0ef9,JSON['stringify'](_0x51f0a8));io['to'](_0x599c93)[_0xc684('0x14')](_0x4f0ef9,_0x51f0a8);}function handleError(_0x33943d){return function(_0x3b6f5e){console[_0xc684('0x15')](_0xc684('0x16'),_0x3b6f5e,_0x3b6f5e instanceof RangeError);logger['error'](_0x3b6f5e[_0xc684('0x17')]);if(_0x3b6f5e instanceof RangeError){if(_0x3b6f5e[_0xc684('0x18')]){delete _0x3b6f5e['name'];}_0x33943d[_0xc684('0x19')](0x194)[_0xc684('0x1a')](_0x3b6f5e);}else{if(_0x3b6f5e[_0xc684('0x18')]){delete _0x3b6f5e['name'];}_0x33943d[_0xc684('0x19')](0x1f4)[_0xc684('0x1a')](_0x3b6f5e);}};}function checkError(){return function(_0x1eddc7){if(!_0x1eddc7){throw new RangeError(_0xc684('0x1b'));}return _0x1eddc7;};}function respondWithRpcPromise(_0x2d1241,_0x4b7769){return new BPromise(function(_0x13d43f,_0x39f39a){var _0x1fb8b0=amiClient;return _0x1fb8b0['request'](_0x2d1241,_0x4b7769)['then'](function(_0x5a7b2e){if(_0x5a7b2e[_0xc684('0x1c')]){if(_0x5a7b2e[_0xc684('0x1c')][_0xc684('0x1d')]===0x1f4){return _0x39f39a(_0x5a7b2e['error']['message']);}return _0x13d43f(_0x5a7b2e['error']['message']);}else{_0x13d43f(_0x5a7b2e[_0xc684('0x1e')]);}})[_0xc684('0x1f')](function(_0x236f02){_0x39f39a(_0x236f02);});});}function getAgent(_0x4edb38){return db[_0xc684('0x20')]['findOne']({'where':{'id':_0x4edb38,'role':_0xc684('0x21')}})[_0xc684('0x22')](checkError());}function getAgentCheckSession(_0x13e09d,_0x49dad1){return new BPromise(function(_0x1f8e85,_0x4d9094){var _0x279998=respondWithRpcPromise(_0xc684('0x23'));var _0x210dcd=getAgent(_0x13e09d);Promise[_0xc684('0x24')]([_0x279998,_0x210dcd])['then'](function(_0xc0f77b){var _0x2710c1=_0xc0f77b[0x0];var _0x28a48a=_0xc0f77b[0x1];var _0x3c8a4d=_[_0xc684('0x25')](_0x2710c1[_0xc684('0x26')],function(_0x10db0d){return _0x10db0d[_0xc684('0x27')]==_0x28a48a['id']&&_0x10db0d['sessionId']==_0x49dad1;});if(_0x3c8a4d['length']==0x1){_0x1f8e85(_0x28a48a);}else{_0x4d9094(new RangeError('sessionId\x20'+_0x49dad1+_0xc684('0x28')));}});});}exports[_0xc684('0x29')]=function(_0x5cd228,_0x4e46c2){logger[_0xc684('0x2a')]('originate\x20fired:',_0x5cd228[_0xc684('0x2b')]);var _0x164da7=originateValidation[_0xc684('0xe')](_0x5cd228['body']);if(_0x164da7['length']>0x0){return _0x4e46c2[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x164da7);}var _0x577ebe=_0x5cd228['body'][_0xc684('0x2d')];var _0x413128=_0x5cd228[_0xc684('0x2b')][_0xc684('0x2e')];var _0x35a790=_0x5cd228[_0xc684('0x2b')]['callerId'];var _0x1a0b08=_0x5cd228['body']['callbackUrl'];return getAgent(_0x577ebe)[_0xc684('0x22')](function(_0x46e014){logger['info']('entityFound:',_0x46e014[_0xc684('0x18')]);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x46e014[_0xc684('0x18')]),_0xc684('0x31'),{'callNumber':_0x413128,'callerId':_0x35a790,'callbackUrl':_0x1a0b08});return _0x4e46c2['status'](0xc8)[_0xc684('0x2c')]({'error':![],'message':_0xc684('0x32')});})['catch'](handleError(_0x4e46c2));};exports['hangup']=function(_0x1923d7,_0x139972){logger[_0xc684('0x2a')](_0xc684('0x33'),_0x1923d7[_0xc684('0x2b')]);var _0x2ae788=hangupValidation[_0xc684('0xe')](_0x1923d7['body']);if(_0x2ae788['length']>0x0){return _0x139972[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x2ae788);}var _0x56404b=_0x1923d7['body']['userId'];var _0x2c4e7c=_0x1923d7[_0xc684('0x2b')][_0xc684('0x34')];return getAgent(_0x56404b)[_0xc684('0x22')](function(_0x2649ee){logger['info'](_0xc684('0x35'),_0x2649ee['name']);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x2649ee[_0xc684('0x18')]),_0xc684('0x36'),{'sessionId':_0x2c4e7c});return _0x139972['status'](0xc8)[_0xc684('0x2c')]({'error':![],'message':_0xc684('0x37')});})[_0xc684('0x1f')](handleError(_0x139972));};exports[_0xc684('0x38')]=function(_0x1497c2,_0x2f16b3){logger['info'](_0xc684('0x39'),_0x1497c2['body']);var _0x566c61=answerValidation[_0xc684('0xe')](_0x1497c2[_0xc684('0x2b')]);if(_0x566c61[_0xc684('0x3a')]>0x0){return _0x2f16b3['status'](0x190)['json'](_0x566c61);}var _0x4f288b=_0x1497c2['body']['userId'];var _0x189b26=_0x1497c2[_0xc684('0x2b')][_0xc684('0x34')];return getAgent(_0x4f288b)['then'](function(_0x2cd123){logger['info'](_0xc684('0x35'),_0x2cd123['name']);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x2cd123[_0xc684('0x18')]),_0xc684('0x3b'),{'sessionId':_0x189b26});return _0x2f16b3[_0xc684('0x19')](0xc8)['json']({'error':![],'message':_0xc684('0x3c')});})[_0xc684('0x1f')](handleError(_0x2f16b3));};exports[_0xc684('0x3d')]=function(_0x3fd5e9,_0x1fb6ac){logger[_0xc684('0x2a')](_0xc684('0x3e'),_0x3fd5e9[_0xc684('0x2b')]);var _0x1bafa8=holdValidation['validate'](_0x3fd5e9[_0xc684('0x2b')]);if(_0x1bafa8[_0xc684('0x3a')]>0x0){return _0x1fb6ac['status'](0x190)[_0xc684('0x2c')](_0x1bafa8);}var _0x4fb1d5=_0x3fd5e9[_0xc684('0x2b')]['userId'];var _0x182534=_0x3fd5e9[_0xc684('0x2b')][_0xc684('0x34')];return getAgent(_0x4fb1d5)[_0xc684('0x22')](function(_0x1bfd8d){logger[_0xc684('0x2a')](_0xc684('0x35'),_0x1bfd8d[_0xc684('0x18')]);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x1bfd8d['name']),_0xc684('0x3f'),{'sessionId':_0x182534});return _0x1fb6ac[_0xc684('0x19')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x1fb6ac));};exports[_0xc684('0x40')]=function(_0x1304a2,_0x5439ae){logger[_0xc684('0x2a')](_0xc684('0x41'),_0x1304a2[_0xc684('0x2b')]);var _0x5c72c8=unholdValidation[_0xc684('0xe')](_0x1304a2[_0xc684('0x2b')]);if(_0x5c72c8[_0xc684('0x3a')]>0x0){return _0x5439ae[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x5c72c8);}var _0x5818b8=_0x1304a2[_0xc684('0x2b')][_0xc684('0x2d')];var _0x4ab2d6=_0x1304a2[_0xc684('0x2b')][_0xc684('0x34')];return getAgent(_0x5818b8)[_0xc684('0x22')](function(_0x28c0fa){logger[_0xc684('0x2a')]('entityFound:',_0x28c0fa[_0xc684('0x18')]);emit(util['format'](_0xc684('0x30'),_0x28c0fa[_0xc684('0x18')]),_0xc684('0x42'),{'sessionId':_0x4ab2d6});return _0x5439ae[_0xc684('0x19')](0xc8)[_0xc684('0x2c')]({'error':![],'message':_0xc684('0x43')});})[_0xc684('0x1f')](handleError(_0x5439ae));};exports[_0xc684('0x44')]=function(_0xcfb03e,_0x554301){logger['info'](_0xc684('0x45'),_0x554301['body']);var _0x2b2d54=callsValidation['validate'](_0xcfb03e['body']);if(_0x2b2d54[_0xc684('0x3a')]>0x0){return _0x554301[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x2b2d54);}var _0x147483=_0xcfb03e[_0xc684('0x2b')][_0xc684('0x2d')];var _0x507eff=respondWithRpcPromise(_0xc684('0x23'));var _0x3f1887=getAgent(_0x147483);return Promise[_0xc684('0x24')]([_0x507eff,_0x3f1887])['then'](function(_0xb1ab5b){var _0x50ba27=_0xb1ab5b[0x0];var _0x1e2a08=_0xb1ab5b[0x1];var _0x3eb497=_[_0xc684('0x25')](_0x50ba27['rows'],function(_0x4eddbb){return _0x4eddbb[_0xc684('0x27')]==_0x1e2a08['id'];});return _0x554301['status'](0xc8)[_0xc684('0x2c')]({'count':_0x3eb497['length'],'rows':_0x3eb497});})[_0xc684('0x1f')](handleError(_0x554301));};exports[_0xc684('0x46')]=function(_0x5e0367,_0x1ba002){logger['info'](_0xc684('0x47'),_0x5e0367['body']);var _0x1b5b54=conferenceValidation[_0xc684('0xe')](_0x5e0367[_0xc684('0x2b')]);if(_0x1b5b54[_0xc684('0x3a')]>0x0){return _0x1ba002[_0xc684('0x19')](0x190)['json'](_0x1b5b54);}var _0x2da62d=_0x5e0367[_0xc684('0x2b')][_0xc684('0x2d')];return getAgent(_0x2da62d)[_0xc684('0x22')](function(_0x258693){logger[_0xc684('0x2a')](_0xc684('0x35'),_0x258693[_0xc684('0x18')]);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x258693[_0xc684('0x18')]),_0xc684('0x48'));return _0x1ba002[_0xc684('0x19')](0xc8)[_0xc684('0x2c')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x1ba002));};exports['transfer']=function(_0x2a2c30,_0x519006){logger[_0xc684('0x2a')](_0xc684('0x49'),_0x2a2c30[_0xc684('0x2b')]);var _0x342bbf=transferValidation[_0xc684('0xe')](_0x2a2c30['body']);if(_0x342bbf[_0xc684('0x3a')]>0x0){return _0x519006[_0xc684('0x19')](0x190)[_0xc684('0x2c')](_0x342bbf);}var _0x5f4f6b=_0x2a2c30[_0xc684('0x2b')][_0xc684('0x2d')];var _0x2678cb=_0x2a2c30[_0xc684('0x2b')]['sessionId'];var _0x538b3f=_0x2a2c30[_0xc684('0x2b')][_0xc684('0x4a')];return getAgent(_0x5f4f6b)[_0xc684('0x22')](function(_0x1c967d){logger[_0xc684('0x2a')](_0xc684('0x35'),_0x1c967d[_0xc684('0x18')]);emit(util[_0xc684('0x2f')](_0xc684('0x30'),_0x1c967d[_0xc684('0x18')]),_0xc684('0x4b'),{'sessionId':_0x2678cb,'transferNumber':_0x538b3f});return _0x519006[_0xc684('0x19')](0xc8)['json']({'error':![],'message':_0xc684('0x4c')});})['catch'](handleError(_0x519006));}; \ No newline at end of file +var _0xd691=['conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','error','stack','name','status','send','NotFound','then','message','result','findOne','agent','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','sessionId','user:%s','catch','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference'];(function(_0x37b41a,_0x519f8d){var _0x23b187=function(_0x84d5f2){while(--_0x84d5f2){_0x37b41a['push'](_0x37b41a['shift']());}};_0x23b187(++_0x519f8d);}(_0xd691,0xe6));var _0x1d69=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0xd691[_0x3a1ea5];return _0xfac9b2;};'use strict';var path=require(_0x1d69('0x0'));var fs=require('fs');var _=require(_0x1d69('0x1'));var db=require(_0x1d69('0x2'))['db'];var config=require('../../config/environment');var util=require(_0x1d69('0x3'));var BPromise=require(_0x1d69('0x4'));var jayson=require(_0x1d69('0x5'));var amiClient=jayson[_0x1d69('0x6')][_0x1d69('0x7')]({'port':0x232a});var logger=require(_0x1d69('0x8'))(_0x1d69('0x9'));var Redis=require(_0x1d69('0xa'));config[_0x1d69('0xb')]=_[_0x1d69('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1d69('0xd'))(new Redis(config['redis']));var Schema=require(_0x1d69('0xe'));var originateValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'callNumber':{'type':_0x1d69('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x1d69('0x11')},'callbackUrl':{'type':_0x1d69('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'sessionId':{'type':_0x1d69('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1d69('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'sessionId':{'type':_0x1d69('0x11'),'required':[!![],_0x1d69('0x12')]},'transferNumber':{'type':_0x1d69('0x11'),'required':[!![],_0x1d69('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'sessionId':{'type':_0x1d69('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'sessionId':{'type':_0x1d69('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]}});function emit(_0x29dd32,_0x5fe486,_0x3ec720){logger[_0x1d69('0x14')](_0x29dd32,_0x5fe486,JSON['stringify'](_0x3ec720));io['to'](_0x29dd32)[_0x1d69('0x15')](_0x5fe486,_0x3ec720);}function handleError(_0xcf076b){return function(_0x34f6d4){console['log']('handleError:',_0x34f6d4,_0x34f6d4 instanceof RangeError);logger[_0x1d69('0x16')](_0x34f6d4[_0x1d69('0x17')]);if(_0x34f6d4 instanceof RangeError){if(_0x34f6d4[_0x1d69('0x18')]){delete _0x34f6d4['name'];}_0xcf076b[_0x1d69('0x19')](0x194)[_0x1d69('0x1a')](_0x34f6d4);}else{if(_0x34f6d4[_0x1d69('0x18')]){delete _0x34f6d4[_0x1d69('0x18')];}_0xcf076b[_0x1d69('0x19')](0x1f4)[_0x1d69('0x1a')](_0x34f6d4);}};}function checkError(){return function(_0x34c920){if(!_0x34c920){throw new RangeError(_0x1d69('0x1b'));}return _0x34c920;};}function respondWithRpcPromise(_0x5c90eb,_0x7821f8){return new BPromise(function(_0x122238,_0x1786e1){var _0x228d18=amiClient;return _0x228d18['request'](_0x5c90eb,_0x7821f8)[_0x1d69('0x1c')](function(_0x411ca0){if(_0x411ca0[_0x1d69('0x16')]){if(_0x411ca0['error']['code']===0x1f4){return _0x1786e1(_0x411ca0['error'][_0x1d69('0x1d')]);}return _0x122238(_0x411ca0[_0x1d69('0x16')][_0x1d69('0x1d')]);}else{_0x122238(_0x411ca0[_0x1d69('0x1e')]);}})['catch'](function(_0x3af518){_0x1786e1(_0x3af518);});});}function getAgent(_0x33b5e9){return db['User'][_0x1d69('0x1f')]({'where':{'id':_0x33b5e9,'role':_0x1d69('0x20')}})[_0x1d69('0x1c')](checkError());}function getAgentCheckSession(_0x30aefe,_0x2d3f2e){return new BPromise(function(_0x247130,_0x5cca6a){var _0x23043c=respondWithRpcPromise(_0x1d69('0x21'));var _0x3c6b2b=getAgent(_0x30aefe);Promise[_0x1d69('0x22')]([_0x23043c,_0x3c6b2b])[_0x1d69('0x1c')](function(_0x1e5818){var _0x2fd8d3=_0x1e5818[0x0];var _0x215052=_0x1e5818[0x1];var _0x156825=_[_0x1d69('0x23')](_0x2fd8d3[_0x1d69('0x24')],function(_0x5e8e8e){return _0x5e8e8e[_0x1d69('0x25')]==_0x215052['id']&&_0x5e8e8e['sessionId']==_0x2d3f2e;});if(_0x156825[_0x1d69('0x26')]==0x1){_0x247130(_0x215052);}else{_0x5cca6a(new RangeError(_0x1d69('0x27')+_0x2d3f2e+_0x1d69('0x28')));}});});}exports[_0x1d69('0x29')]=function(_0x582da2,_0x59b677){logger[_0x1d69('0x14')]('originate\x20fired:',_0x582da2[_0x1d69('0x2a')]);var _0x2db151=originateValidation[_0x1d69('0xe')](_0x582da2[_0x1d69('0x2a')]);if(_0x2db151[_0x1d69('0x26')]>0x0){return _0x59b677[_0x1d69('0x19')](0x190)[_0x1d69('0x2b')](_0x2db151);}var _0x1894d9=_0x582da2[_0x1d69('0x2a')][_0x1d69('0x2c')];var _0xa0d7f9=_0x582da2[_0x1d69('0x2a')][_0x1d69('0x2d')];var _0x441d1c=_0x582da2['body'][_0x1d69('0x2e')];var _0x2cf204=_0x582da2[_0x1d69('0x2a')][_0x1d69('0x2f')];return getAgent(_0x1894d9)[_0x1d69('0x1c')](function(_0x4c8414){logger[_0x1d69('0x14')](_0x1d69('0x30'),_0x4c8414[_0x1d69('0x18')]);emit(util[_0x1d69('0x31')]('user:%s',_0x4c8414[_0x1d69('0x18')]),_0x1d69('0x32'),{'callNumber':_0xa0d7f9,'callerId':_0x441d1c,'callbackUrl':_0x2cf204});return _0x59b677[_0x1d69('0x19')](0xc8)[_0x1d69('0x2b')]({'error':![],'message':_0x1d69('0x33')});})['catch'](handleError(_0x59b677));};exports['hangup']=function(_0x49ce52,_0x896d0e){logger[_0x1d69('0x14')]('hangup\x20fired:',_0x49ce52[_0x1d69('0x2a')]);var _0x23335c=hangupValidation[_0x1d69('0xe')](_0x49ce52['body']);if(_0x23335c[_0x1d69('0x26')]>0x0){return _0x896d0e[_0x1d69('0x19')](0x190)[_0x1d69('0x2b')](_0x23335c);}var _0x30be3e=_0x49ce52['body'][_0x1d69('0x2c')];var _0x353a83=_0x49ce52[_0x1d69('0x2a')][_0x1d69('0x34')];return getAgent(_0x30be3e)['then'](function(_0x1a46ae){logger[_0x1d69('0x14')](_0x1d69('0x30'),_0x1a46ae[_0x1d69('0x18')]);emit(util[_0x1d69('0x31')](_0x1d69('0x35'),_0x1a46ae[_0x1d69('0x18')]),'webbar:hangup',{'sessionId':_0x353a83});return _0x896d0e[_0x1d69('0x19')](0xc8)[_0x1d69('0x2b')]({'error':![],'message':'hangup\x20executed!'});})[_0x1d69('0x36')](handleError(_0x896d0e));};exports['answer']=function(_0x11b2e0,_0x399609){logger[_0x1d69('0x14')](_0x1d69('0x37'),_0x11b2e0['body']);var _0x1d6fee=answerValidation[_0x1d69('0xe')](_0x11b2e0[_0x1d69('0x2a')]);if(_0x1d6fee['length']>0x0){return _0x399609[_0x1d69('0x19')](0x190)['json'](_0x1d6fee);}var _0x531387=_0x11b2e0[_0x1d69('0x2a')][_0x1d69('0x2c')];var _0x5451b6=_0x11b2e0[_0x1d69('0x2a')]['sessionId'];return getAgent(_0x531387)[_0x1d69('0x1c')](function(_0x1dc676){logger['info'](_0x1d69('0x30'),_0x1dc676[_0x1d69('0x18')]);emit(util[_0x1d69('0x31')]('user:%s',_0x1dc676[_0x1d69('0x18')]),_0x1d69('0x38'),{'sessionId':_0x5451b6});return _0x399609[_0x1d69('0x19')](0xc8)[_0x1d69('0x2b')]({'error':![],'message':_0x1d69('0x39')});})[_0x1d69('0x36')](handleError(_0x399609));};exports[_0x1d69('0x3a')]=function(_0x746cdb,_0x357a76){logger[_0x1d69('0x14')](_0x1d69('0x3b'),_0x746cdb[_0x1d69('0x2a')]);var _0x2dbc0c=holdValidation[_0x1d69('0xe')](_0x746cdb[_0x1d69('0x2a')]);if(_0x2dbc0c[_0x1d69('0x26')]>0x0){return _0x357a76['status'](0x190)[_0x1d69('0x2b')](_0x2dbc0c);}var _0x11cf7c=_0x746cdb[_0x1d69('0x2a')]['userId'];var _0x4b38fd=_0x746cdb[_0x1d69('0x2a')]['sessionId'];return getAgent(_0x11cf7c)[_0x1d69('0x1c')](function(_0x370645){logger[_0x1d69('0x14')]('entityFound:',_0x370645['name']);emit(util[_0x1d69('0x31')]('user:%s',_0x370645[_0x1d69('0x18')]),'webbar:hold',{'sessionId':_0x4b38fd});return _0x357a76['status'](0xc8)[_0x1d69('0x2b')]({'error':![],'message':_0x1d69('0x3c')});})[_0x1d69('0x36')](handleError(_0x357a76));};exports[_0x1d69('0x3d')]=function(_0x442041,_0x4e6453){logger[_0x1d69('0x14')](_0x1d69('0x3e'),_0x442041['body']);var _0x28bb7b=unholdValidation[_0x1d69('0xe')](_0x442041[_0x1d69('0x2a')]);if(_0x28bb7b[_0x1d69('0x26')]>0x0){return _0x4e6453['status'](0x190)[_0x1d69('0x2b')](_0x28bb7b);}var _0x5a4e1c=_0x442041[_0x1d69('0x2a')][_0x1d69('0x2c')];var _0x37749b=_0x442041['body'][_0x1d69('0x34')];return getAgent(_0x5a4e1c)['then'](function(_0x2d90ec){logger[_0x1d69('0x14')](_0x1d69('0x30'),_0x2d90ec['name']);emit(util[_0x1d69('0x31')]('user:%s',_0x2d90ec[_0x1d69('0x18')]),_0x1d69('0x3f'),{'sessionId':_0x37749b});return _0x4e6453[_0x1d69('0x19')](0xc8)[_0x1d69('0x2b')]({'error':![],'message':_0x1d69('0x40')});})[_0x1d69('0x36')](handleError(_0x4e6453));};exports[_0x1d69('0x41')]=function(_0x143fd9,_0x29502a){logger[_0x1d69('0x14')](_0x1d69('0x42'),_0x29502a[_0x1d69('0x2a')]);var _0x25f7e5=callsValidation[_0x1d69('0xe')](_0x143fd9[_0x1d69('0x2a')]);if(_0x25f7e5[_0x1d69('0x26')]>0x0){return _0x29502a[_0x1d69('0x19')](0x190)['json'](_0x25f7e5);}var _0x2d2a7f=_0x143fd9[_0x1d69('0x2a')]['userId'];var _0x76ead1=respondWithRpcPromise('VoiceChannels');var _0x3b26c6=getAgent(_0x2d2a7f);return Promise[_0x1d69('0x22')]([_0x76ead1,_0x3b26c6])['then'](function(_0x5bd4d0){var _0x1d33c2=_0x5bd4d0[0x0];var _0x3b705d=_0x5bd4d0[0x1];var _0x329076=_[_0x1d69('0x23')](_0x1d33c2['rows'],function(_0x402b3c){return _0x402b3c[_0x1d69('0x25')]==_0x3b705d['id'];});return _0x29502a[_0x1d69('0x19')](0xc8)[_0x1d69('0x2b')]({'count':_0x329076[_0x1d69('0x26')],'rows':_0x329076});})[_0x1d69('0x36')](handleError(_0x29502a));};exports[_0x1d69('0x43')]=function(_0x323e7e,_0x8dcb5d){logger[_0x1d69('0x14')](_0x1d69('0x44'),_0x323e7e[_0x1d69('0x2a')]);var _0x362bdd=conferenceValidation['validate'](_0x323e7e[_0x1d69('0x2a')]);if(_0x362bdd[_0x1d69('0x26')]>0x0){return _0x8dcb5d[_0x1d69('0x19')](0x190)['json'](_0x362bdd);}var _0x44cd1c=_0x323e7e[_0x1d69('0x2a')][_0x1d69('0x2c')];return getAgent(_0x44cd1c)[_0x1d69('0x1c')](function(_0x8f8b31){logger[_0x1d69('0x14')](_0x1d69('0x30'),_0x8f8b31[_0x1d69('0x18')]);emit(util[_0x1d69('0x31')](_0x1d69('0x35'),_0x8f8b31[_0x1d69('0x18')]),_0x1d69('0x45'));return _0x8dcb5d[_0x1d69('0x19')](0xc8)[_0x1d69('0x2b')]({'error':![],'message':_0x1d69('0x46')});})['catch'](handleError(_0x8dcb5d));};exports[_0x1d69('0x47')]=function(_0x7bb6f5,_0x1df70c){logger[_0x1d69('0x14')](_0x1d69('0x48'),_0x7bb6f5['body']);var _0x38370e=transferValidation[_0x1d69('0xe')](_0x7bb6f5[_0x1d69('0x2a')]);if(_0x38370e['length']>0x0){return _0x1df70c[_0x1d69('0x19')](0x190)[_0x1d69('0x2b')](_0x38370e);}var _0x2e34bc=_0x7bb6f5['body'][_0x1d69('0x2c')];var _0x331d1a=_0x7bb6f5['body'][_0x1d69('0x34')];var _0x5d5bc4=_0x7bb6f5['body'][_0x1d69('0x49')];return getAgent(_0x2e34bc)['then'](function(_0x18d13c){logger['info'](_0x1d69('0x30'),_0x18d13c[_0x1d69('0x18')]);emit(util[_0x1d69('0x31')](_0x1d69('0x35'),_0x18d13c[_0x1d69('0x18')]),_0x1d69('0x4a'),{'sessionId':_0x331d1a,'transferNumber':_0x5d5bc4});return _0x1df70c['status'](0xc8)[_0x1d69('0x2b')]({'error':![],'message':'transfer\x20executed!'});})[_0x1d69('0x36')](handleError(_0x1df70c));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 45734d0..f6f099c 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 _0x8e3f=['addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create'];(function(_0x5d41e2,_0x203604){var _0xcb9ca3=function(_0x19458f){while(--_0x19458f){_0x5d41e2['push'](_0x5d41e2['shift']());}};_0xcb9ca3(++_0x203604);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var path=require(_0xf8e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8e3('0x3'));var router=express[_0xf8e3('0x4')]();var fs_extra=require(_0xf8e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var controller=require('./whatsappAccount.controller');router[_0xf8e3('0x8')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xa')]);router[_0xf8e3('0x8')]('/describe',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xb')]);router[_0xf8e3('0x8')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xd')]);router[_0xf8e3('0x8')](_0xf8e3('0xe'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xf')]);router[_0xf8e3('0x8')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller[_0xf8e3('0x11')]);router[_0xf8e3('0x8')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x13')]);router[_0xf8e3('0x8')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller['getApplications']);router[_0xf8e3('0x15')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x16')]);router['post'](_0xf8e3('0xe'),auth['isAuthenticated'](),controller[_0xf8e3('0x17')]);router[_0xf8e3('0x15')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xf8e3('0x15')](_0xf8e3('0x12'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x18')]);router[_0xf8e3('0x15')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x19')]);router[_0xf8e3('0x15')](_0xf8e3('0x1a'),controller['notify']);router[_0xf8e3('0x15')](_0xf8e3('0x1b'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1c')]);router[_0xf8e3('0x1d')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1e')]);router['delete'](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1f')]);router[_0xf8e3('0x20')]('/:id/dispositions',auth[_0xf8e3('0x9')](),controller['removeDispositions']);router[_0xf8e3('0x20')](_0xf8e3('0x10'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x21')]);router[_0xf8e3('0x20')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x22')]);module[_0xf8e3('0x23')]=router; \ No newline at end of file +var _0x896e=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','/:id/notify','notify','/:id/send','send','put','destroy','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x896e,0x1e9));var _0xe896=function(_0x22e250,_0x2404d8){_0x22e250=_0x22e250-0x0;var _0x510f12=_0x896e[_0x22e250];return _0x510f12;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['get'](_0xe896('0x12'),auth['isAuthenticated'](),controller[_0xe896('0x13')]);router['get'](_0xe896('0x14'),auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);router['get'](_0xe896('0x16'),auth[_0xe896('0xe')](),controller[_0xe896('0x17')]);router['get'](_0xe896('0x18'),auth[_0xe896('0xe')](),controller[_0xe896('0x19')]);router['post']('/',auth[_0xe896('0xe')](),controller[_0xe896('0x1a')]);router[_0xe896('0x1b')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe896('0x1c')]);router[_0xe896('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe896('0x1d')]);router[_0xe896('0x1b')]('/:id/users',auth[_0xe896('0xe')](),controller['addAgents']);router[_0xe896('0x1b')](_0xe896('0x18'),auth[_0xe896('0xe')](),controller['addApplications']);router[_0xe896('0x1b')](_0xe896('0x1e'),controller[_0xe896('0x1f')]);router[_0xe896('0x1b')](_0xe896('0x20'),auth[_0xe896('0xe')](),controller[_0xe896('0x21')]);router[_0xe896('0x22')]('/:id',auth[_0xe896('0xe')](),controller['update']);router['delete'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x23')]);router[_0xe896('0x24')]('/:id/dispositions',auth[_0xe896('0xe')](),controller['removeDispositions']);router['delete'](_0xe896('0x14'),auth[_0xe896('0xe')](),controller[_0xe896('0x25')]);router[_0xe896('0x24')](_0xe896('0x16'),auth[_0xe896('0xe')](),controller[_0xe896('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f2b2546..684d213 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 _0x2f6b=['randomstring','exports','STRING','name','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x25a52f,_0x1dce3c){var _0x93f60=function(_0x380da9){while(--_0x380da9){_0x25a52f['push'](_0x25a52f['shift']());}};_0x93f60(++_0x1dce3c);}(_0x2f6b,0x1af));var _0xb2f6=function(_0x254081,_0x20731a){_0x254081=_0x254081-0x0;var _0x5d1e2a=_0x2f6b[_0x254081];return _0x5d1e2a;};'use strict';var Sequelize=require(_0xb2f6('0x0'));var rs=require(_0xb2f6('0x1'));module[_0xb2f6('0x2')]={'name':{'type':Sequelize[_0xb2f6('0x3')],'unique':_0xb2f6('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xb2f6('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xb2f6('0x3')]},'type':{'type':Sequelize['ENUM'](_0xb2f6('0x5'))},'accountSid':{'type':Sequelize[_0xb2f6('0x3')]},'authToken':{'type':Sequelize[_0xb2f6('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb2f6('0x6');}},'notificationSound':{'type':Sequelize[_0xb2f6('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb2f6('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb2f6('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb2f6('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb2f6('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb2f6('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb2f6('0x8')],'comment':_0xb2f6('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d006c){if(!_0x2d006c){this['setDataValue'](_0xb2f6('0xa'),null);}this['setDataValue'](_0xb2f6('0xb'),_0x2d006c);}},'description':{'type':Sequelize[_0xb2f6('0x3')]}}; \ No newline at end of file +var _0x1a34=['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','sequelize','randomstring','STRING'];(function(_0x172a19,_0xc80c25){var _0x518989=function(_0x25b16f){while(--_0x25b16f){_0x172a19['push'](_0x172a19['shift']());}};_0x518989(++_0xc80c25);}(_0x1a34,0x177));var _0x41a3=function(_0xd7429,_0x163253){_0xd7429=_0xd7429-0x0;var _0xd99ae8=_0x1a34[_0xd7429];return _0xd99ae8;};'use strict';var Sequelize=require(_0x41a3('0x0'));var rs=require(_0x41a3('0x1'));module['exports']={'name':{'type':Sequelize[_0x41a3('0x2')],'unique':_0x41a3('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x41a3('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x41a3('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x41a3('0x2')],'defaultValue':function(){return rs[_0x41a3('0x4')]();}},'phone':{'type':Sequelize[_0x41a3('0x2')]},'type':{'type':Sequelize[_0x41a3('0x5')](_0x41a3('0x6'))},'accountSid':{'type':Sequelize[_0x41a3('0x2')]},'authToken':{'type':Sequelize[_0x41a3('0x2')]},'notificationTemplate':{'type':Sequelize[_0x41a3('0x7')],'defaultValue':function(){return _0x41a3('0x8');}},'notificationSound':{'type':Sequelize[_0x41a3('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x41a3('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x41a3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x41a3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x41a3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x41a3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x41a3('0xa')],'comment':_0x41a3('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x41a3('0x9')],'defaultValue':![],'comment':_0x41a3('0xc'),'set':function(_0x49b247){if(!_0x49b247){this[_0x41a3('0xd')]('mandatoryDispositionPauseId',null);}this['setDataValue']('mandatoryDisposition',_0x49b247);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index ebb52f2..98c9f58 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 _0xd31b=['orderBy','asc','account','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','replace','Body','MessageSid','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','list','omit','defaults','contact','WhatsappInteraction','spread','interaction','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','twilio','set','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','nolimit','order','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','whatsapp','Applications','applications'];(function(_0x597036,_0x1ca362){var _0x34bdca=function(_0x323b88){while(--_0x323b88){_0x597036['push'](_0x597036['shift']());}};_0x34bdca(++_0x1ca362);}(_0xd31b,0x1a9));var _0xbd31=function(_0x222a4b,_0x3d53d2){_0x222a4b=_0x222a4b-0x0;var _0x2bedb3=_0xd31b[_0x222a4b];return _0x2bedb3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbd31('0x0'));var jsonpatch=require(_0xbd31('0x1'));var rp=require('request-promise');var moment=require(_0xbd31('0x2'));var BPromise=require(_0xbd31('0x3'));var Mustache=require(_0xbd31('0x4'));var util=require(_0xbd31('0x5'));var path=require(_0xbd31('0x6'));var sox=require(_0xbd31('0x7'));var csv=require('to-csv');var ejs=require(_0xbd31('0x8'));var fs=require('fs');var fs_extra=require(_0xbd31('0x9'));var _=require(_0xbd31('0xa'));var squel=require(_0xbd31('0xb'));var crypto=require(_0xbd31('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbd31('0xd'));var toCsv=require(_0xbd31('0xe'));var querystring=require('querystring');var Papa=require(_0xbd31('0xf'));var Redis=require('ioredis');var authService=require(_0xbd31('0x10'));var qs=require(_0xbd31('0x11'));var as=require(_0xbd31('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd31('0x13'))(_0xbd31('0x14'));var utils=require(_0xbd31('0x15'));var config=require(_0xbd31('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xbd31('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xbd31('0x18'))(new Redis(config['redis']));require(_0xbd31('0x19'))[_0xbd31('0x1a')](socket);var jayson=require(_0xbd31('0x1b'));var client=jayson[_0xbd31('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x22ebca,_0x357b3b,_0xbd99ae,_0x29a94c){return new BPromise(function(_0x296596,_0x3e593b){var _0x37a5cc=_0x29a94c||client;return _0x37a5cc[_0xbd31('0x1d')](_0x22ebca,_0xbd99ae)[_0xbd31('0x1e')](function(_0x3de314){logger[_0xbd31('0x1f')](_0xbd31('0x20'),_0x357b3b,_0xbd31('0x21'));logger['debug'](_0xbd31('0x22'),_0x357b3b,_0xbd31('0x21'),JSON[_0xbd31('0x23')](_0x3de314));if(_0x3de314[_0xbd31('0x24')]){if(_0x3de314[_0xbd31('0x24')][_0xbd31('0x25')]===0x1f4){logger[_0xbd31('0x24')](_0xbd31('0x20'),_0x357b3b,_0x3de314['error'][_0xbd31('0x26')]);return _0x3e593b(_0x3de314[_0xbd31('0x24')][_0xbd31('0x26')]);}logger['error'](_0xbd31('0x20'),_0x357b3b,_0x3de314[_0xbd31('0x24')][_0xbd31('0x26')]);return _0x296596(_0x3de314[_0xbd31('0x24')][_0xbd31('0x26')]);}else{logger[_0xbd31('0x1f')](_0xbd31('0x20'),_0x357b3b,_0xbd31('0x21'));_0x296596(_0x3de314[_0xbd31('0x27')][_0xbd31('0x26')]);}})['catch'](function(_0x113411){logger[_0xbd31('0x24')](_0xbd31('0x20'),_0x357b3b,_0x113411);_0x3e593b(_0x113411);});});}function respondWithStatusCode(_0x4ba48b,_0x19a6c4){_0x19a6c4=_0x19a6c4||0xcc;return function(_0x41d60f){if(_0x41d60f){return _0x4ba48b['sendStatus'](_0x19a6c4);}return _0x4ba48b[_0xbd31('0x28')](_0x19a6c4)['end']();};}function respondWithResult(_0x2ffe05,_0x1dbe30){_0x1dbe30=_0x1dbe30||0xc8;return function(_0x4bb702){if(_0x4bb702){return _0x2ffe05['status'](_0x1dbe30)[_0xbd31('0x29')](_0x4bb702);}};}function respondWithFilteredResult(_0x235cfc,_0xbfae25){return function(_0x17c7a9){if(_0x17c7a9){var _0x5e7315=typeof _0xbfae25[_0xbd31('0x2a')]===_0xbd31('0x2b')&&typeof _0xbfae25[_0xbd31('0x2c')]===_0xbd31('0x2b');var _0xa3458c=_0x17c7a9['count'];var _0x5cc3b8=_0x5e7315?0x0:_0xbfae25[_0xbd31('0x2a')];var _0x5e98ae=_0x5e7315?_0x17c7a9[_0xbd31('0x2d')]:_0xbfae25[_0xbd31('0x2a')]+_0xbfae25['limit'];var _0x523577;if(_0x5e98ae>=_0xa3458c){_0x5e98ae=_0xa3458c;_0x523577=0xc8;}else{_0x523577=0xce;}_0x235cfc[_0xbd31('0x28')](_0x523577);return _0x235cfc['set'](_0xbd31('0x2e'),_0x5cc3b8+'-'+_0x5e98ae+'/'+_0xa3458c)[_0xbd31('0x29')](_0x17c7a9);}return null;};}function patchUpdates(_0x4f8195){return function(_0xc6e314){try{jsonpatch[_0xbd31('0x2f')](_0xc6e314,_0x4f8195,!![]);}catch(_0x280146){return BPromise[_0xbd31('0x30')](_0x280146);}return _0xc6e314[_0xbd31('0x31')]();};}function saveUpdates(_0x4d7f6c,_0x505281){return function(_0x1ba7c6){if(_0x1ba7c6){return _0x1ba7c6['update'](_0x4d7f6c)[_0xbd31('0x1e')](function(_0x162672){return _0x162672;});}return null;};}function removeEntity(_0xd75543,_0x292ff4){return function(_0x569d1c){if(_0x569d1c){return _0x569d1c['destroy']()[_0xbd31('0x1e')](function(){var _0x6dd1fb=_0x569d1c[_0xbd31('0x32')]({'plain':!![]});var _0x5ada82=_0xbd31('0x33');return db[_0xbd31('0x34')][_0xbd31('0x35')]({'where':{'type':_0x5ada82,'resourceId':_0x6dd1fb['id']}})[_0xbd31('0x1e')](function(){return _0x569d1c;});})[_0xbd31('0x1e')](function(){_0xd75543[_0xbd31('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x87f9fe,_0x4a5b0a){return function(_0x1d2a9f){if(!_0x1d2a9f){_0x87f9fe['sendStatus'](0x194);}return _0x1d2a9f;};}function handleError(_0x279023,_0x3fb450){_0x3fb450=_0x3fb450||0x1f4;return function(_0x28fa11){logger['error'](_0x28fa11[_0xbd31('0x36')]);if(_0x28fa11[_0xbd31('0x37')]){delete _0x28fa11[_0xbd31('0x37')];}_0x279023[_0xbd31('0x28')](_0x3fb450)[_0xbd31('0x38')](_0x28fa11);};}exports[_0xbd31('0x39')]=function(_0x247493,_0x1940d2){var _0xdf552a={'include':[{'model':db[_0xbd31('0x3a')],'as':'mandatoryDispositionPause'}]},_0x2fbf72={},_0xf721f4={'count':0x0,'rows':[]};var _0x23edd5=_[_0xbd31('0x3b')](db[_0xbd31('0x3c')][_0xbd31('0x3d')],function(_0x2fd4cf){return{'name':_0x2fd4cf[_0xbd31('0x3e')],'type':_0x2fd4cf[_0xbd31('0x3f')]['key']};});_0x2fbf72[_0xbd31('0x40')]=_['map'](_0x23edd5,_0xbd31('0x37'));_0x2fbf72[_0xbd31('0x41')]=_[_0xbd31('0x42')](_0x247493[_0xbd31('0x41')]);_0x2fbf72[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0x2fbf72['model'],_0x2fbf72[_0xbd31('0x41')]);_0xdf552a['attributes']=_['intersection'](_0x2fbf72[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x247493[_0xbd31('0x41')]['fields']));_0xdf552a[_0xbd31('0x46')]=_0xdf552a[_0xbd31('0x46')][_0xbd31('0x47')]?_0xdf552a['attributes']:_0x2fbf72[_0xbd31('0x40')];if(!_0x247493[_0xbd31('0x41')][_0xbd31('0x48')]('nolimit')){_0xdf552a[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x247493['query'][_0xbd31('0x2c')]);_0xdf552a[_0xbd31('0x2a')]=qs[_0xbd31('0x2a')](_0x247493[_0xbd31('0x41')][_0xbd31('0x2a')]);}_0xdf552a['order']=qs['sort'](_0x247493[_0xbd31('0x41')][_0xbd31('0x49')]);_0xdf552a['where']=qs['filters'](_[_0xbd31('0x4a')](_0x247493[_0xbd31('0x41')],_0x2fbf72['filters']),_0x23edd5);if(_0x247493['query'][_0xbd31('0x4b')]){_0xdf552a['where']=_['merge'](_0xdf552a['where'],{'$or':_[_0xbd31('0x3b')](_0x23edd5,function(_0x48a9d8){if(_0x48a9d8[_0xbd31('0x3f')]!==_0xbd31('0x4c')){var _0x4ab418={};_0x4ab418[_0x48a9d8['name']]={'$like':'%'+_0x247493[_0xbd31('0x41')][_0xbd31('0x4b')]+'%'};return _0x4ab418;}})});}_0xdf552a=_[_0xbd31('0x4d')]({},_0xdf552a,_0x247493[_0xbd31('0x4e')]);var _0x57f9df={'where':_0xdf552a[_0xbd31('0x4f')]};return db[_0xbd31('0x3c')][_0xbd31('0x2d')](_0x57f9df)['then'](function(_0x40bcc6){_0xf721f4[_0xbd31('0x2d')]=_0x40bcc6;if(_0x247493[_0xbd31('0x41')][_0xbd31('0x50')]){_0xdf552a['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xbd31('0x51')](_0xdf552a);})[_0xbd31('0x1e')](function(_0x546b05){_0xf721f4[_0xbd31('0x52')]=_0x546b05;return _0xf721f4;})[_0xbd31('0x1e')](respondWithFilteredResult(_0x1940d2,_0xdf552a))[_0xbd31('0x53')](handleError(_0x1940d2,null));};exports['show']=function(_0x11cffe,_0xecc87f){var _0x4d6f72={'raw':![],'where':{'id':_0x11cffe[_0xbd31('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5d980f={};_0x5d980f[_0xbd31('0x40')]=_[_0xbd31('0x42')](db['WhatsappAccount'][_0xbd31('0x3d')]);_0x5d980f[_0xbd31('0x41')]=_[_0xbd31('0x42')](_0x11cffe[_0xbd31('0x41')]);_0x5d980f[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0x5d980f[_0xbd31('0x40')],_0x5d980f[_0xbd31('0x41')]);_0x4d6f72[_0xbd31('0x46')]=_['intersection'](_0x5d980f[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x11cffe[_0xbd31('0x41')]['fields']));_0x4d6f72[_0xbd31('0x46')]=_0x4d6f72[_0xbd31('0x46')][_0xbd31('0x47')]?_0x4d6f72[_0xbd31('0x46')]:_0x5d980f[_0xbd31('0x40')];if(_0x11cffe[_0xbd31('0x41')]['includeAll']){_0x4d6f72['include']=[{'all':!![]}];}_0x4d6f72=_[_0xbd31('0x4d')]({},_0x4d6f72,_0x11cffe[_0xbd31('0x4e')]);return db[_0xbd31('0x3c')][_0xbd31('0x55')](_0x4d6f72)[_0xbd31('0x1e')](handleEntityNotFound(_0xecc87f,null))[_0xbd31('0x1e')](respondWithResult(_0xecc87f,null))[_0xbd31('0x53')](handleError(_0xecc87f,null));};exports[_0xbd31('0x56')]=function(_0x10d2ad,_0x6ccf09){return db[_0xbd31('0x3c')][_0xbd31('0x56')](_0x10d2ad[_0xbd31('0x57')],{})[_0xbd31('0x1e')](function(_0xe8436d){var _0x1f2e2f=_0x10d2ad[_0xbd31('0x58')][_0xbd31('0x32')]({'plain':!![]});if(!_0x1f2e2f)throw new Error(_0xbd31('0x59'));if(_0x1f2e2f['role']===_0xbd31('0x58')){var _0xbe9d63=_0xe8436d[_0xbd31('0x32')]({'plain':!![]});var _0x570e50=_0xbd31('0x33');return db[_0xbd31('0x5a')][_0xbd31('0x55')]({'where':{'name':_0x570e50,'userProfileId':_0x1f2e2f[_0xbd31('0x5b')]},'raw':!![]})[_0xbd31('0x1e')](function(_0x434e00){if(_0x434e00&&_0x434e00[_0xbd31('0x5c')]===0x0){return db[_0xbd31('0x34')][_0xbd31('0x56')]({'name':_0xbe9d63[_0xbd31('0x37')],'resourceId':_0xbe9d63['id'],'type':_0x434e00[_0xbd31('0x37')],'sectionId':_0x434e00['id']},{})['then'](function(){return _0xe8436d;});}else{return _0xe8436d;}})[_0xbd31('0x53')](function(_0x4fec59){logger[_0xbd31('0x24')](_0xbd31('0x5d'),_0x4fec59);throw _0x4fec59;});}return _0xe8436d;})['then'](respondWithResult(_0x6ccf09,0xc9))[_0xbd31('0x53')](handleError(_0x6ccf09,null));};exports[_0xbd31('0x5e')]=function(_0x2878b9,_0x516de3){if(_0x2878b9[_0xbd31('0x57')]['id']){delete _0x2878b9[_0xbd31('0x57')]['id'];}return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x2878b9['params']['id']},'include':[{'model':db[_0xbd31('0x3a')],'as':'mandatoryDispositionPause'}]})[_0xbd31('0x1e')](handleEntityNotFound(_0x516de3,null))[_0xbd31('0x1e')](saveUpdates(_0x2878b9[_0xbd31('0x57')],null))[_0xbd31('0x1e')](respondWithResult(_0x516de3,null))[_0xbd31('0x53')](handleError(_0x516de3,null));};exports[_0xbd31('0x35')]=function(_0x24a377,_0x4438bc){return db['WhatsappAccount'][_0xbd31('0x55')]({'where':{'id':_0x24a377[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x4438bc,null))[_0xbd31('0x1e')](removeEntity(_0x4438bc,null))[_0xbd31('0x53')](handleError(_0x4438bc,null));};exports[_0xbd31('0x5f')]=function(_0x24f44c,_0x6f5ff0){return db[_0xbd31('0x3c')]['describe']()[_0xbd31('0x1e')](respondWithResult(_0x6f5ff0,null))[_0xbd31('0x53')](handleError(_0x6f5ff0,null));};exports[_0xbd31('0x60')]=function(_0x4788e3,_0x5d7332,_0xb9bc3d){if(_0x4788e3[_0xbd31('0x57')]['id']){delete _0x4788e3['body']['id'];}return db[_0xbd31('0x3c')]['find']({'where':{'id':_0x4788e3[_0xbd31('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d7332,null))['then'](function(_0x3efedf){if(_0x3efedf){_0x4788e3[_0xbd31('0x57')][_0xbd31('0x61')]=_0x3efedf['id'];return db[_0xbd31('0x62')][_0xbd31('0x56')](_0x4788e3['body']);}})[_0xbd31('0x1e')](respondWithResult(_0x5d7332,null))[_0xbd31('0x53')](handleError(_0x5d7332,null));};exports[_0xbd31('0x63')]=function(_0x127441,_0x339bf1,_0x443b4a){var _0x398026={'raw':![],'where':{}};var _0x1eb6f4={};var _0x28140={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x127441[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x339bf1,null))[_0xbd31('0x1e')](function(_0x540443){if(_0x540443){_0x1eb6f4[_0xbd31('0x40')]=_[_0xbd31('0x42')](db[_0xbd31('0x62')][_0xbd31('0x3d')]);_0x1eb6f4['query']=_[_0xbd31('0x42')](_0x127441['query']);_0x1eb6f4[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0x1eb6f4[_0xbd31('0x40')],_0x1eb6f4[_0xbd31('0x41')]);_0x398026['attributes']=_[_0xbd31('0x44')](_0x1eb6f4[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x127441['query'][_0xbd31('0x45')]));_0x398026[_0xbd31('0x46')]=_0x398026[_0xbd31('0x46')][_0xbd31('0x47')]?_0x398026['attributes']:_0x1eb6f4[_0xbd31('0x40')];if(!_0x127441[_0xbd31('0x41')]['hasOwnProperty'](_0xbd31('0x64'))){_0x398026[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x127441[_0xbd31('0x41')]['limit']);_0x398026['offset']=qs[_0xbd31('0x2a')](_0x127441[_0xbd31('0x41')][_0xbd31('0x2a')]);}_0x398026[_0xbd31('0x65')]=qs['sort'](_0x127441[_0xbd31('0x41')][_0xbd31('0x49')]);_0x398026[_0xbd31('0x4f')]=qs[_0xbd31('0x43')](_['pick'](_0x127441[_0xbd31('0x41')],_0x1eb6f4[_0xbd31('0x43')]));_0x398026['where'][_0xbd31('0x61')]=_0x540443['id'];if(_0x127441[_0xbd31('0x41')][_0xbd31('0x4b')]){_0x398026[_0xbd31('0x4f')]=_[_0xbd31('0x4d')](_0x398026['where'],{'$or':_[_0xbd31('0x3b')](_0x398026['attributes'],function(_0x1e5305){var _0x17749a={};_0x17749a[_0x1e5305]={'$like':'%'+_0x127441[_0xbd31('0x41')][_0xbd31('0x4b')]+'%'};return _0x17749a;})});}_0x398026=_[_0xbd31('0x4d')]({},_0x398026,_0x127441[_0xbd31('0x4e')]);return db['Disposition'][_0xbd31('0x2d')]({'where':_0x398026['where']})[_0xbd31('0x1e')](function(_0x520b8e){_0x28140['count']=_0x520b8e;if(_0x127441[_0xbd31('0x41')]['includeAll']){_0x398026[_0xbd31('0x66')]=[{'all':!![]}];}return db[_0xbd31('0x62')]['findAll'](_0x398026);})['then'](function(_0x37eace){_0x28140[_0xbd31('0x52')]=_0x37eace;return _0x28140;});}})[_0xbd31('0x1e')](respondWithFilteredResult(_0x339bf1,_0x398026))[_0xbd31('0x53')](handleError(_0x339bf1,null));};exports['removeDispositions']=function(_0x2b8812,_0xff2dcb,_0x32202c){return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x2b8812['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0xff2dcb,null))['then'](function(_0x2c7e80){if(_0x2c7e80){return _0x2c7e80[_0xbd31('0x67')](_0x2b8812['query'][_0xbd31('0x68')]);}})[_0xbd31('0x1e')](respondWithStatusCode(_0xff2dcb,null))[_0xbd31('0x53')](handleError(_0xff2dcb,null));};exports[_0xbd31('0x69')]=function(_0x1dfe22,_0x32312e,_0x24cb17){if(_0x1dfe22[_0xbd31('0x57')]['id']){delete _0x1dfe22[_0xbd31('0x57')]['id'];}return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x1dfe22['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x32312e,null))[_0xbd31('0x1e')](function(_0x3f4dd8){if(_0x3f4dd8){_0x1dfe22[_0xbd31('0x57')][_0xbd31('0x61')]=_0x3f4dd8['id'];return db[_0xbd31('0x6a')][_0xbd31('0x56')](_0x1dfe22['body']);}})[_0xbd31('0x1e')](respondWithResult(_0x32312e,null))[_0xbd31('0x53')](handleError(_0x32312e,null));};exports[_0xbd31('0x6b')]=function(_0x321df3,_0x2832cf,_0x7f1048){var _0x5ac9cc={'raw':![],'where':{}};var _0x254b58={};var _0x1a3701={'count':0x0,'rows':[]};return db[_0xbd31('0x3c')][_0xbd31('0x6c')]({'where':{'id':_0x321df3[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x2832cf,null))['then'](function(_0x14e5e){if(_0x14e5e){_0x254b58['model']=_[_0xbd31('0x42')](db['CannedAnswer'][_0xbd31('0x3d')]);_0x254b58['query']=_[_0xbd31('0x42')](_0x321df3[_0xbd31('0x41')]);_0x254b58[_0xbd31('0x43')]=_['intersection'](_0x254b58[_0xbd31('0x40')],_0x254b58[_0xbd31('0x41')]);_0x5ac9cc[_0xbd31('0x46')]=_['intersection'](_0x254b58['model'],qs[_0xbd31('0x45')](_0x321df3[_0xbd31('0x41')][_0xbd31('0x45')]));_0x5ac9cc[_0xbd31('0x46')]=_0x5ac9cc[_0xbd31('0x46')]['length']?_0x5ac9cc[_0xbd31('0x46')]:_0x254b58[_0xbd31('0x40')];if(!_0x321df3[_0xbd31('0x41')][_0xbd31('0x48')](_0xbd31('0x64'))){_0x5ac9cc[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x321df3[_0xbd31('0x41')]['limit']);_0x5ac9cc[_0xbd31('0x2a')]=qs['offset'](_0x321df3[_0xbd31('0x41')][_0xbd31('0x2a')]);}_0x5ac9cc[_0xbd31('0x65')]=qs['sort'](_0x321df3['query']['sort']);_0x5ac9cc['where']=qs['filters'](_[_0xbd31('0x4a')](_0x321df3['query'],_0x254b58[_0xbd31('0x43')]));_0x5ac9cc['where']['WhatsappAccountId']=_0x14e5e['id'];if(_0x321df3[_0xbd31('0x41')][_0xbd31('0x4b')]){_0x5ac9cc[_0xbd31('0x4f')]=_[_0xbd31('0x4d')](_0x5ac9cc[_0xbd31('0x4f')],{'$or':_[_0xbd31('0x3b')](_0x5ac9cc[_0xbd31('0x46')],function(_0x5d795f){var _0x4a57d5={};_0x4a57d5[_0x5d795f]={'$like':'%'+_0x321df3['query'][_0xbd31('0x4b')]+'%'};return _0x4a57d5;})});}_0x5ac9cc=_[_0xbd31('0x4d')]({},_0x5ac9cc,_0x321df3[_0xbd31('0x4e')]);return db[_0xbd31('0x6a')][_0xbd31('0x2d')]({'where':_0x5ac9cc[_0xbd31('0x4f')]})[_0xbd31('0x1e')](function(_0x54d590){_0x1a3701[_0xbd31('0x2d')]=_0x54d590;if(_0x321df3[_0xbd31('0x41')][_0xbd31('0x50')]){_0x5ac9cc[_0xbd31('0x66')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbd31('0x51')](_0x5ac9cc);})[_0xbd31('0x1e')](function(_0x59edf6){_0x1a3701[_0xbd31('0x52')]=_0x59edf6;return _0x1a3701;});}})['then'](respondWithFilteredResult(_0x2832cf,_0x5ac9cc))['catch'](handleError(_0x2832cf,null));};exports[_0xbd31('0x6d')]=function(_0x13aa71,_0x3ef22f,_0x91c5b5){return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x13aa71['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x3ef22f,null))[_0xbd31('0x1e')](function(_0x4aea26){if(_0x4aea26){return _0x4aea26[_0xbd31('0x6d')](_0x13aa71[_0xbd31('0x41')][_0xbd31('0x68')]);}})['then'](respondWithStatusCode(_0x3ef22f,null))[_0xbd31('0x53')](handleError(_0x3ef22f,null));};exports['addAgents']=function(_0x27e951,_0x2e758a,_0x4ddbcd){return db[_0xbd31('0x3c')]['find']({'where':{'id':_0x27e951[_0xbd31('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e758a,null))[_0xbd31('0x1e')](function(_0x5864a9){if(_0x5864a9){return _0x5864a9[_0xbd31('0x6e')](_0x27e951['body'][_0xbd31('0x68')],_['omit'](_0x27e951[_0xbd31('0x57')],[_0xbd31('0x68'),'id'])||{})['spread'](function(_0x48b5d9){for(var _0x283720=0x0;_0x283720<_0x27e951[_0xbd31('0x57')][_0xbd31('0x68')][_0xbd31('0x47')];_0x283720+=0x1){socket[_0xbd31('0x6f')](_0xbd31('0x70'),{'UserId':Number(_0x27e951['body'][_0xbd31('0x68')][_0x283720]),'WhatsappAccountId':Number(_0x27e951[_0xbd31('0x54')]['id'])});}return _0x48b5d9;});}})[_0xbd31('0x1e')](respondWithResult(_0x2e758a,null))[_0xbd31('0x53')](handleError(_0x2e758a,null));};exports['removeAgents']=function(_0x4344a5,_0x504c45,_0xdeddf4){return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x4344a5['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x504c45,null))[_0xbd31('0x1e')](function(_0x316d8c){if(_0x316d8c){return _0x316d8c['removeAgents'](_0x4344a5[_0xbd31('0x41')][_0xbd31('0x68')])[_0xbd31('0x1e')](function(){if(_[_0xbd31('0x71')](_0x4344a5['query'][_0xbd31('0x68')])){for(var _0x44f986=0x0;_0x44f986<_0x4344a5[_0xbd31('0x41')][_0xbd31('0x68')][_0xbd31('0x47')];_0x44f986+=0x1){socket[_0xbd31('0x6f')](_0xbd31('0x72'),{'UserId':Number(_0x4344a5[_0xbd31('0x41')][_0xbd31('0x68')][_0x44f986]),'WhatsappAccountId':Number(_0x4344a5[_0xbd31('0x54')]['id'])});}}else{socket['emit'](_0xbd31('0x72'),{'UserId':Number(_0x4344a5['query']['ids']),'WhatsappAccountId':Number(_0x4344a5[_0xbd31('0x54')]['id'])});}});}})[_0xbd31('0x1e')](respondWithStatusCode(_0x504c45,null))[_0xbd31('0x53')](handleError(_0x504c45,null));};exports[_0xbd31('0x73')]=function(_0x16513,_0x13f812,_0x379422){var _0x4bf66e={};var _0x4412e3={};var _0x296167;var _0x1db2f3;return db[_0xbd31('0x3c')][_0xbd31('0x6c')]({'where':{'id':_0x16513[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x13f812,null))['then'](function(_0x296e88){if(_0x296e88){_0x296167=_0x296e88;_0x4412e3[_0xbd31('0x40')]=_['keys'](db[_0xbd31('0x74')][_0xbd31('0x3d')]);_0x4412e3[_0xbd31('0x41')]=_['keys'](_0x16513[_0xbd31('0x41')]);_0x4412e3[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0x4412e3[_0xbd31('0x40')],_0x4412e3['query']);_0x4bf66e[_0xbd31('0x46')]=_['intersection'](_0x4412e3[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x16513[_0xbd31('0x41')]['fields']));_0x4bf66e[_0xbd31('0x46')]=_0x4bf66e[_0xbd31('0x46')]['length']?_0x4bf66e[_0xbd31('0x46')]:_0x4412e3[_0xbd31('0x40')];_0x4bf66e[_0xbd31('0x65')]=qs[_0xbd31('0x49')](_0x16513[_0xbd31('0x41')][_0xbd31('0x49')]);_0x4bf66e[_0xbd31('0x4f')]=qs[_0xbd31('0x43')](_[_0xbd31('0x4a')](_0x16513[_0xbd31('0x41')],_0x4412e3[_0xbd31('0x43')]));if(_0x16513[_0xbd31('0x41')][_0xbd31('0x4b')]){_0x4bf66e[_0xbd31('0x4f')]=_['merge'](_0x4bf66e['where'],{'$or':_[_0xbd31('0x3b')](_0x4bf66e[_0xbd31('0x46')],function(_0x4f767b){var _0x463e99={};_0x463e99[_0x4f767b]={'$like':'%'+_0x16513[_0xbd31('0x41')][_0xbd31('0x4b')]+'%'};return _0x463e99;})});}_0x4bf66e=_[_0xbd31('0x4d')]({},_0x4bf66e,_0x16513[_0xbd31('0x4e')]);return _0x296167['getAgents'](_0x4bf66e);}})[_0xbd31('0x1e')](function(_0x43ae62){if(_0x43ae62){_0x1db2f3=_0x43ae62['length'];if(!_0x16513[_0xbd31('0x41')][_0xbd31('0x48')](_0xbd31('0x64'))){_0x4bf66e[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x16513[_0xbd31('0x41')][_0xbd31('0x2c')]);_0x4bf66e[_0xbd31('0x2a')]=qs[_0xbd31('0x2a')](_0x16513[_0xbd31('0x41')][_0xbd31('0x2a')]);}return _0x296167[_0xbd31('0x73')](_0x4bf66e);}})[_0xbd31('0x1e')](function(_0x38b861){if(_0x38b861){return _0x38b861?{'count':_0x1db2f3,'rows':_0x38b861}:null;}})[_0xbd31('0x1e')](respondWithResult(_0x13f812,null))['catch'](handleError(_0x13f812,null));};exports[_0xbd31('0x75')]=function(_0x12d168,_0x1b9957,_0x4c2ab7){return db[_0xbd31('0x3c')][_0xbd31('0x6c')]({'where':{'id':_0x12d168[_0xbd31('0x54')]['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x1b9957,null))[_0xbd31('0x1e')](function(_0x2f0b8c){if(_0x2f0b8c){return db[_0xbd31('0x76')][_0xbd31('0x77')](function(_0xef6f5b){return db[_0xbd31('0x78')]['destroy']({'where':{'WhatsappAccountId':_0x12d168[_0xbd31('0x54')]['id']},'transaction':_0xef6f5b})[_0xbd31('0x1e')](function(_0x4cbe10){var _0x1249ee=_[_0xbd31('0x3b')](_0x12d168[_0xbd31('0x57')],function(_0x539cc4){_0x539cc4[_0xbd31('0x61')]=_0x12d168['params']['id'];return _0x539cc4;});return db[_0xbd31('0x78')]['bulkCreate'](_0x1249ee,{'transaction':_0xef6f5b});});})['then'](function(){return db[_0xbd31('0x78')][_0xbd31('0x79')]({'where':{'WhatsappAccountId':_0x12d168[_0xbd31('0x54')]['id']},'order':_0xbd31('0x7a')});});}})[_0xbd31('0x1e')](respondWithResult(_0x1b9957,null))[_0xbd31('0x53')](handleError(_0x1b9957,null));};exports[_0xbd31('0x7b')]=function(_0x2fb2f9,_0x473e56,_0x3caf54){var _0x1adace={};var _0xd6658a={};var _0x135c58;var _0x451a9f;return db[_0xbd31('0x3c')][_0xbd31('0x6c')]({'where':{'id':_0x2fb2f9['params']['id']}})[_0xbd31('0x1e')](handleEntityNotFound(_0x473e56,null))[_0xbd31('0x1e')](function(_0x4d888d){if(_0x4d888d){_0x135c58=_0x4d888d;_0xd6658a['model']=_[_0xbd31('0x42')](db[_0xbd31('0x78')][_0xbd31('0x3d')]);_0xd6658a[_0xbd31('0x41')]=_[_0xbd31('0x42')](_0x2fb2f9[_0xbd31('0x41')]);_0xd6658a[_0xbd31('0x43')]=_[_0xbd31('0x44')](_0xd6658a[_0xbd31('0x40')],_0xd6658a[_0xbd31('0x41')]);_0x1adace[_0xbd31('0x46')]=_['intersection'](_0xd6658a[_0xbd31('0x40')],qs[_0xbd31('0x45')](_0x2fb2f9[_0xbd31('0x41')][_0xbd31('0x45')]));_0x1adace[_0xbd31('0x46')]=_0x1adace[_0xbd31('0x46')]['length']?_0x1adace[_0xbd31('0x46')]:_0xd6658a[_0xbd31('0x40')];_0x1adace[_0xbd31('0x65')]=qs['sort'](_0x2fb2f9['query'][_0xbd31('0x49')]);_0x1adace[_0xbd31('0x4f')]=qs['filters'](_[_0xbd31('0x4a')](_0x2fb2f9['query'],_0xd6658a[_0xbd31('0x43')]));if(_0x2fb2f9[_0xbd31('0x41')]['filter']){_0x1adace[_0xbd31('0x4f')]=_['merge'](_0x1adace[_0xbd31('0x4f')],{'$or':_[_0xbd31('0x3b')](_0x1adace[_0xbd31('0x46')],function(_0x17579c){var _0x3a8e9e={};_0x3a8e9e[_0x17579c]={'$like':'%'+_0x2fb2f9[_0xbd31('0x41')]['filter']+'%'};return _0x3a8e9e;})});}_0x1adace=_[_0xbd31('0x4d')]({},_0x1adace,_0x2fb2f9[_0xbd31('0x4e')]);return _0x135c58[_0xbd31('0x7b')](_0x1adace);}})[_0xbd31('0x1e')](function(_0x580024){if(_0x580024){_0x451a9f=_0x580024[_0xbd31('0x47')];if(!_0x2fb2f9['query'][_0xbd31('0x48')](_0xbd31('0x64'))){_0x1adace[_0xbd31('0x2c')]=qs[_0xbd31('0x2c')](_0x2fb2f9[_0xbd31('0x41')][_0xbd31('0x2c')]);_0x1adace[_0xbd31('0x2a')]=qs[_0xbd31('0x2a')](_0x2fb2f9[_0xbd31('0x41')][_0xbd31('0x2a')]);}return _0x135c58[_0xbd31('0x7b')](_0x1adace);}})[_0xbd31('0x1e')](function(_0x137375){if(_0x137375){return _0x137375?{'count':_0x451a9f,'rows':_0x137375}:null;}})[_0xbd31('0x1e')](respondWithResult(_0x473e56,null))['catch'](handleError(_0x473e56,null));};exports['notify']=function(_0x30a488,_0x4d7702,_0x5321b3){var _0x1b964e={'channel':_0xbd31('0x7c')};var _0x9000ad=[];var _0x20e763=[];var _0x27ce60={};return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x30a488[_0xbd31('0x54')]['id']},'include':[{'model':db[_0xbd31('0x78')],'as':_0xbd31('0x7d')}]})[_0xbd31('0x1e')](handleEntityNotFound(_0x4d7702,null))['then'](function(_0x8831c2){_0x1b964e['account']=_0x8831c2;_0x1b964e[_0xbd31('0x7e')]=_[_0xbd31('0x7f')](_0x8831c2[_0xbd31('0x7d')],[_0xbd31('0x7a')],[_0xbd31('0x80')]);if(_0x1b964e[_0xbd31('0x81')]['Applications']){delete _0x1b964e[_0xbd31('0x81')]['Applications'];}return db['CmContact'][_0xbd31('0x5f')]();})[_0xbd31('0x1e')](function(_0x2f3976){if(!_0x2f3976){throw new db[(_0xbd31('0x82'))]['ValidationError'](_0xbd31('0x83'));}_0x9000ad=_[_0xbd31('0x84')](_[_0xbd31('0x42')](_0x2f3976),[_0xbd31('0x85'),_0xbd31('0x86')]);_0x20e763=_[_0xbd31('0x84')](_['keys'](_0x2f3976),[_0xbd31('0x85'),_0xbd31('0x86'),'CompanyId',_0xbd31('0x87')]);_0x1b964e['body']={'mapKey':_0xbd31('0x88')};if(_0x1b964e['account'][_0xbd31('0x3f')]&&_0x1b964e['account'][_0xbd31('0x3f')]==='twilio'){_0x1b964e[_0xbd31('0x57')][_0xbd31('0x89')]=_0x30a488[_0xbd31('0x57')]['From'][_0xbd31('0x8a')]('whatsapp:','');_0x1b964e[_0xbd31('0x57')][_0xbd31('0x57')]=_0x30a488[_0xbd31('0x57')][_0xbd31('0x8b')];_0x1b964e[_0xbd31('0x57')]['messageId']=_0x30a488['body'][_0xbd31('0x8c')];}if(_0x1b964e[_0xbd31('0x57')]['id']){delete _0x1b964e['body']['id'];}if(_['isNil'](_0x1b964e['body'][_0xbd31('0x89')])){throw new db[(_0xbd31('0x82'))][(_0xbd31('0x8d'))](_0xbd31('0x8e'));}if(_[_0xbd31('0x8f')](_0x1b964e[_0xbd31('0x57')][_0xbd31('0x57')])||_0x1b964e['body']['body']===''){throw new db['Sequelize'][(_0xbd31('0x8d'))](_0xbd31('0x90'));}if(_['isNil'](_0x1b964e[_0xbd31('0x57')][_0xbd31('0x91')])){throw new db[(_0xbd31('0x82'))][(_0xbd31('0x8d'))](_0xbd31('0x92')+_0x20e763);}if(!_[_0xbd31('0x93')](_0x20e763,_0x1b964e[_0xbd31('0x57')][_0xbd31('0x91')])){throw new db[(_0xbd31('0x82'))][(_0xbd31('0x8d'))](_0xbd31('0x94')+_0x20e763);}_0x27ce60[_0x1b964e[_0xbd31('0x57')][_0xbd31('0x91')]]=_0x1b964e['body'][_0xbd31('0x89')];return db['CmList'][_0xbd31('0x55')]({'where':{'id':_0x1b964e['account'][_0xbd31('0x87')]},'include':[{'model':db[_0xbd31('0x95')],'as':_0xbd31('0x96'),'where':_0x27ce60,'limit':0x1,'order':[['updatedAt',_0xbd31('0x97')]]}]});})[_0xbd31('0x1e')](handleEntityNotFound(_0x4d7702,null))['then'](function(_0x5c3cf3){if(_0x5c3cf3){_0x1b964e[_0xbd31('0x98')]=_[_0xbd31('0x99')](_0x5c3cf3,[_0xbd31('0x96')]);if(_0x5c3cf3['Contacts'][_0xbd31('0x47')]){return _0x5c3cf3['Contacts'][0x0];}var _0x5b3c5e=_[_0xbd31('0x9a')](_0x1b964e['body'],{'firstName':_0x1b964e[_0xbd31('0x57')]['from'],'ListId':_0x5c3cf3['id']});_0x5b3c5e[_0x1b964e['body']['mapKey']]=_0x1b964e[_0xbd31('0x57')][_0xbd31('0x89')];return db[_0xbd31('0x95')][_0xbd31('0x56')](_0x5b3c5e,{'fields':_0x9000ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x4d7702,null))[_0xbd31('0x1e')](function(_0x3a2872){if(_0x3a2872){_0x1b964e[_0xbd31('0x9b')]=_0x3a2872;var _0x15a5de={'ContactId':_0x3a2872['id'],'phone':_0x1b964e[_0xbd31('0x57')][_0xbd31('0x89')],'WhatsappAccountId':_0x30a488[_0xbd31('0x54')]['id']};var _0x2e768e={'ContactId':_0x3a2872['id'],'WhatsappAccountId':_0x30a488[_0xbd31('0x54')]['id'],'closed':![]};return db[_0xbd31('0x9c')]['find']({'where':_0x2e768e})[_0xbd31('0x1e')](function(_0x3fef6e){if(_0x3fef6e){return[_0x3fef6e,![]];}return db[_0xbd31('0x9c')][_0xbd31('0x56')](_0x15a5de)['then'](function(_0x2c4e95){return[_0x2c4e95,!![]];});});}})[_0xbd31('0x9d')](function(_0x34f028,_0x2abd69){_0x1b964e[_0xbd31('0x9e')]=_0x34f028['get']({'plain':!![]});_0x1b964e[_0xbd31('0x9e')]['created']=![];if(_0x2abd69){if(_0x1b964e[_0xbd31('0x81')]['autoclose']){_0x1b964e[_0xbd31('0x7e')][_0xbd31('0x9f')]({'id':0x0,'priority':_0x1b964e['applications']['length']+0x1,'app':_0xbd31('0xa0'),'appdata':_0xbd31('0xa1'),'interval':_0xbd31('0xa2')});}_0x1b964e[_0xbd31('0x9e')][_0xbd31('0xa3')]=!![];}return db[_0xbd31('0xa4')][_0xbd31('0x56')]({'phone':_0x1b964e[_0xbd31('0x57')][_0xbd31('0x89')],'messageId':_0x1b964e[_0xbd31('0x57')][_0xbd31('0xa5')],'body':_0x1b964e[_0xbd31('0x57')]['body'],'WhatsappAccountId':_0x30a488[_0xbd31('0x54')]['id'],'WhatsappInteractionId':_0x34f028['id'],'direction':'in','ContactId':_0x34f028[_0xbd31('0xa6')],'AttachmentId':_0x1b964e[_0xbd31('0x57')][_0xbd31('0xa7')]});})[_0xbd31('0x1e')](function(_0x32950f){_0x1b964e[_0xbd31('0x26')]=_0x32950f;if(_0x1b964e['interaction'][_0xbd31('0xa8')]){return db[_0xbd31('0x74')][_0xbd31('0x55')]({'attributes':['id',_0xbd31('0x37')],'where':{'id':_0x1b964e['interaction']['UserId']}})[_0xbd31('0x1e')](function(_0x49e325){if(_0x49e325){_0x1b964e[_0xbd31('0x7e')][_0xbd31('0xa9')]({'id':0x0,'priority':0x0,'app':_0xbd31('0xaa'),'appdata':_0x49e325['name']+','+(_0x1b964e[_0xbd31('0x81')][_0xbd31('0xab')]||0xa),'interval':_0xbd31('0xa2')});}return respondWithRpcPromise(_0xbd31('0xac'),_0xbd31('0xad'),_0x1b964e);});}return respondWithRpcPromise(_0xbd31('0xac'),_0xbd31('0xad'),_0x1b964e);})['then'](function(_0x595217){if(_0x595217){var _0x584121=0xc8;var _0xcd6e6d=_0xbd31('0xae');logger[_0xbd31('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xcd6e6d,_0x584121,_0xbd31('0xaf'));logger[_0xbd31('0xb0')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xcd6e6d,_0x584121,_0xbd31('0xaf'),JSON[_0xbd31('0x23')](_0x595217));if(_0x1b964e[_0xbd31('0x81')][_0xbd31('0x3f')]===_0xbd31('0xb1')){return _0x4d7702[_0xbd31('0x28')](_0x584121)[_0xbd31('0xb2')]('Content-Type','text/xml')[_0xbd31('0x38')](_0xbd31('0xb3'));}else{return _0x4d7702[_0xbd31('0x28')](_0x584121)['json'](_0x595217);}}})['catch'](handleError(_0x4d7702,null));};exports[_0xbd31('0x38')]=function(_0x45f704,_0x541500,_0xad4e4c){var _0x45e1d0,_0x4bfa8e,_0x152c89;if(_[_0xbd31('0x8f')](_0x45f704[_0xbd31('0x57')][_0xbd31('0x57')])||_0x45f704[_0xbd31('0x57')]['body']===''){throw new db['Sequelize'][(_0xbd31('0x8d'))](_0xbd31('0x90'));}if(_['isNil'](_0x45f704[_0xbd31('0x57')]['to'])){throw new db['Sequelize']['ValidationError'](_0xbd31('0xb4'));}_0x45e1d0=_0x45f704['body']['to'];return db[_0xbd31('0x3c')][_0xbd31('0x55')]({'where':{'id':_0x45f704['params']['id']},'include':[{'model':db['CmList'],'as':_0xbd31('0xb5'),'include':[{'model':db[_0xbd31('0x95')],'as':'Contacts','where':{'mobile':_0x45e1d0},'limit':0x1,'order':[[_0xbd31('0x86'),_0xbd31('0x97')]]}]}]})[_0xbd31('0x1e')](handleEntityNotFound(_0x541500,null))[_0xbd31('0x1e')](function(_0x4eba5c){if(_0x4eba5c&&_0x4eba5c[_0xbd31('0xb5')]){_0x4bfa8e=_0x4eba5c[_0xbd31('0x32')]({'plain':!![]});if(_0x4bfa8e[_0xbd31('0xb5')]&&_0x4bfa8e[_0xbd31('0xb5')][_0xbd31('0x96')]['length']){return _0x4bfa8e[_0xbd31('0xb5')]['Contacts'][0x0];}return db[_0xbd31('0x95')][_0xbd31('0x56')](_[_0xbd31('0x9a')](_0x45f704['body'],{'firstName':_0x45e1d0,'mobile':_0x45e1d0,'phone':_0x45e1d0,'ListId':_0x4bfa8e[_0xbd31('0x87')]}));}})[_0xbd31('0x1e')](handleEntityNotFound(_0x541500,null))['then'](function(_0x5a3b96){if(_0x5a3b96){_0x152c89=_0x5a3b96;return db['WhatsappInteraction'][_0xbd31('0x55')]({'where':{'ContactId':_0x152c89['id'],'closed':![],'WhatsappAccountId':_0x4bfa8e['id']}})[_0xbd31('0x1e')](function(_0x108d85){if(_0x108d85){return[_0x108d85,![]];}return db['WhatsappInteraction'][_0xbd31('0x56')]({'UserId':_0x45f704['user']['id'],'ContactId':_0x152c89['id'],'WhatsappAccountId':_0x4bfa8e['id'],'phone':_0x45e1d0,'firstMsgDirection':'out','Messages':[_[_0xbd31('0x4d')](_0x45f704[_0xbd31('0x57')],{'read':![],'body':_0x45f704[_0xbd31('0x57')][_0xbd31('0x57')],'phone':_0x45e1d0,'WhatsappAccountId':_0x4bfa8e['id'],'UserId':_0x45f704[_0xbd31('0x58')]['id'],'ContactId':_0x152c89['id']})]},{'include':[{'model':db[_0xbd31('0xa4')],'as':_0xbd31('0xb6')}]})[_0xbd31('0x1e')](function(_0x34218d){return[_0x34218d,!![]];});});}})[_0xbd31('0x9d')](function(_0x5c95f5,_0x2e7c04){if(_0x2e7c04){return _0x5c95f5;}return db[_0xbd31('0xa4')][_0xbd31('0x56')](_[_0xbd31('0x4d')](_0x45f704[_0xbd31('0x57')],{'read':![],'body':_0x45f704[_0xbd31('0x57')]['body'],'phone':_0x45e1d0,'WhatsappAccountId':_0x4bfa8e['id'],'WhatsappInteractionId':_0x5c95f5['id'],'UserId':_0x45f704[_0xbd31('0x58')]['id'],'ContactId':_0x152c89['id']}))[_0xbd31('0x1e')](function(_0x3fac79){_0x5c95f5[_0xbd31('0xb7')][_0xbd31('0xb6')]=[];_0x5c95f5[_0xbd31('0xb7')][_0xbd31('0xb6')][_0xbd31('0x9f')](_0x3fac79[_0xbd31('0xb7')]);return _0x5c95f5;});})[_0xbd31('0x1e')](respondWithResult(_0x541500,null))[_0xbd31('0x53')](handleError(_0x541500,null));}; \ No newline at end of file +var _0x98d4=['findAll','rows','show','params','Pause','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','length','pick','includeAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','priority','getApplications','whatsapp','Applications','applications','orderBy','asc','account','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','MessageSid','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','close','*,*,*,*','created','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','startRouting','entity\x20found','debug','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','get','WhatsappAccounts','destroy','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','include'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x98d4,0x127));var _0x498d=function(_0x3acdb5,_0x5e531c){_0x3acdb5=_0x3acdb5-0x0;var _0x209253=_0x98d4[_0x3acdb5];return _0x209253;};'use strict';var emlformat=require(_0x498d('0x0'));var rimraf=require(_0x498d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x498d('0x2'));var rp=require(_0x498d('0x3'));var moment=require(_0x498d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x498d('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x498d('0x6'));var ejs=require(_0x498d('0x7'));var fs=require('fs');var fs_extra=require(_0x498d('0x8'));var _=require(_0x498d('0x9'));var squel=require(_0x498d('0xa'));var crypto=require('crypto');var jsforce=require(_0x498d('0xb'));var deskjs=require(_0x498d('0xc'));var toCsv=require(_0x498d('0x6'));var querystring=require('querystring');var Papa=require(_0x498d('0xd'));var Redis=require(_0x498d('0xe'));var authService=require(_0x498d('0xf'));var qs=require(_0x498d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x498d('0x11'));var logger=require(_0x498d('0x12'))(_0x498d('0x13'));var utils=require(_0x498d('0x14'));var config=require(_0x498d('0x15'));var licenseUtil=require(_0x498d('0x16'));var db=require(_0x498d('0x17'))['db'];config[_0x498d('0x18')]=_[_0x498d('0x19')](config[_0x498d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x498d('0x1a'))(new Redis(config[_0x498d('0x18')]));require('./whatsappAccount.socket')[_0x498d('0x1b')](socket);var jayson=require(_0x498d('0x1c'));var client=jayson['client'][_0x498d('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x2de38d,_0x4667d0,_0x44d611,_0x5d266b){return new BPromise(function(_0x143aa0,_0x17d56e){var _0x570120=_0x5d266b||client;return _0x570120[_0x498d('0x1e')](_0x2de38d,_0x44d611)[_0x498d('0x1f')](function(_0x29f61b){logger[_0x498d('0x20')](_0x498d('0x21'),_0x4667d0,_0x498d('0x22'));logger['debug'](_0x498d('0x23'),_0x4667d0,_0x498d('0x22'),JSON[_0x498d('0x24')](_0x29f61b));if(_0x29f61b[_0x498d('0x25')]){if(_0x29f61b[_0x498d('0x25')][_0x498d('0x26')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4667d0,_0x29f61b[_0x498d('0x25')][_0x498d('0x27')]);return _0x17d56e(_0x29f61b['error'][_0x498d('0x27')]);}logger[_0x498d('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x4667d0,_0x29f61b[_0x498d('0x25')][_0x498d('0x27')]);return _0x143aa0(_0x29f61b[_0x498d('0x25')][_0x498d('0x27')]);}else{logger[_0x498d('0x20')](_0x498d('0x21'),_0x4667d0,_0x498d('0x22'));_0x143aa0(_0x29f61b[_0x498d('0x28')][_0x498d('0x27')]);}})[_0x498d('0x29')](function(_0x519522){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4667d0,_0x519522);_0x17d56e(_0x519522);});});}function respondWithStatusCode(_0x311587,_0x29ae41){_0x29ae41=_0x29ae41||0xcc;return function(_0x22206a){if(_0x22206a){return _0x311587[_0x498d('0x2a')](_0x29ae41);}return _0x311587[_0x498d('0x2b')](_0x29ae41)[_0x498d('0x2c')]();};}function respondWithResult(_0x49fbb0,_0xcbd0c){_0xcbd0c=_0xcbd0c||0xc8;return function(_0x530b04){if(_0x530b04){return _0x49fbb0[_0x498d('0x2b')](_0xcbd0c)[_0x498d('0x2d')](_0x530b04);}};}function respondWithFilteredResult(_0x3ecd7a,_0x3f785c){return function(_0x3de452){if(_0x3de452){var _0x92956b=typeof _0x3f785c['offset']===_0x498d('0x2e')&&typeof _0x3f785c[_0x498d('0x2f')]===_0x498d('0x2e');var _0x236b97=_0x3de452[_0x498d('0x30')];var _0x6835b5=_0x92956b?0x0:_0x3f785c['offset'];var _0x9e6f51=_0x92956b?_0x3de452[_0x498d('0x30')]:_0x3f785c[_0x498d('0x31')]+_0x3f785c[_0x498d('0x2f')];var _0x2c5b36;if(_0x9e6f51>=_0x236b97){_0x9e6f51=_0x236b97;_0x2c5b36=0xc8;}else{_0x2c5b36=0xce;}_0x3ecd7a[_0x498d('0x2b')](_0x2c5b36);return _0x3ecd7a[_0x498d('0x32')](_0x498d('0x33'),_0x6835b5+'-'+_0x9e6f51+'/'+_0x236b97)[_0x498d('0x2d')](_0x3de452);}return null;};}function patchUpdates(_0x292465){return function(_0x4a0b06){try{jsonpatch[_0x498d('0x34')](_0x4a0b06,_0x292465,!![]);}catch(_0x4f5f76){return BPromise['reject'](_0x4f5f76);}return _0x4a0b06[_0x498d('0x35')]();};}function saveUpdates(_0x46fd96,_0x41869c){return function(_0x4aaeeb){if(_0x4aaeeb){return _0x4aaeeb[_0x498d('0x36')](_0x46fd96)[_0x498d('0x1f')](function(_0x15134d){return _0x15134d;});}return null;};}function removeEntity(_0x5d794a,_0x5d11fd){return function(_0x55ff95){if(_0x55ff95){return _0x55ff95['destroy']()[_0x498d('0x1f')](function(){var _0x228f76=_0x55ff95[_0x498d('0x37')]({'plain':!![]});var _0x40a3fe=_0x498d('0x38');return db['UserProfileResource'][_0x498d('0x39')]({'where':{'type':_0x40a3fe,'resourceId':_0x228f76['id']}})['then'](function(){return _0x55ff95;});})[_0x498d('0x1f')](function(){_0x5d794a[_0x498d('0x2b')](0xcc)[_0x498d('0x2c')]();});}};}function handleEntityNotFound(_0x455a74,_0x4880bc){return function(_0x5b82da){if(!_0x5b82da){_0x455a74[_0x498d('0x2a')](0x194);}return _0x5b82da;};}function handleError(_0x15add4,_0x2e8f9f){_0x2e8f9f=_0x2e8f9f||0x1f4;return function(_0x5621ec){logger['error'](_0x5621ec['stack']);if(_0x5621ec[_0x498d('0x3a')]){delete _0x5621ec[_0x498d('0x3a')];}_0x15add4[_0x498d('0x2b')](_0x2e8f9f)[_0x498d('0x3b')](_0x5621ec);};}exports[_0x498d('0x3c')]=function(_0x2bcafc,_0x2e1906){var _0x2b2ca1={'include':[{'model':db['Pause'],'as':_0x498d('0x3d')}]},_0x39d586={},_0x569771={'count':0x0,'rows':[]};var _0x4f7b66=_[_0x498d('0x3e')](db[_0x498d('0x3f')][_0x498d('0x40')],function(_0x2a602f){return{'name':_0x2a602f['fieldName'],'type':_0x2a602f['type'][_0x498d('0x41')]};});_0x39d586[_0x498d('0x42')]=_[_0x498d('0x3e')](_0x4f7b66,'name');_0x39d586[_0x498d('0x43')]=_['keys'](_0x2bcafc[_0x498d('0x43')]);_0x39d586['filters']=_['intersection'](_0x39d586[_0x498d('0x42')],_0x39d586[_0x498d('0x43')]);_0x2b2ca1[_0x498d('0x44')]=_[_0x498d('0x45')](_0x39d586['model'],qs['fields'](_0x2bcafc[_0x498d('0x43')][_0x498d('0x46')]));_0x2b2ca1[_0x498d('0x44')]=_0x2b2ca1[_0x498d('0x44')]['length']?_0x2b2ca1[_0x498d('0x44')]:_0x39d586[_0x498d('0x42')];if(!_0x2bcafc[_0x498d('0x43')][_0x498d('0x47')](_0x498d('0x48'))){_0x2b2ca1[_0x498d('0x2f')]=qs[_0x498d('0x2f')](_0x2bcafc['query']['limit']);_0x2b2ca1[_0x498d('0x31')]=qs[_0x498d('0x31')](_0x2bcafc[_0x498d('0x43')]['offset']);}_0x2b2ca1[_0x498d('0x49')]=qs[_0x498d('0x4a')](_0x2bcafc[_0x498d('0x43')][_0x498d('0x4a')]);_0x2b2ca1[_0x498d('0x4b')]=qs[_0x498d('0x4c')](_['pick'](_0x2bcafc[_0x498d('0x43')],_0x39d586[_0x498d('0x4c')]),_0x4f7b66);if(_0x2bcafc[_0x498d('0x43')][_0x498d('0x4d')]){_0x2b2ca1[_0x498d('0x4b')]=_['merge'](_0x2b2ca1['where'],{'$or':_[_0x498d('0x3e')](_0x4f7b66,function(_0x127c4a){if(_0x127c4a[_0x498d('0x4e')]!==_0x498d('0x4f')){var _0x344264={};_0x344264[_0x127c4a[_0x498d('0x3a')]]={'$like':'%'+_0x2bcafc[_0x498d('0x43')][_0x498d('0x4d')]+'%'};return _0x344264;}})});}_0x2b2ca1=_[_0x498d('0x50')]({},_0x2b2ca1,_0x2bcafc[_0x498d('0x51')]);var _0x1c2489={'where':_0x2b2ca1['where']};return db[_0x498d('0x3f')][_0x498d('0x30')](_0x1c2489)[_0x498d('0x1f')](function(_0x4de4cc){_0x569771[_0x498d('0x30')]=_0x4de4cc;if(_0x2bcafc[_0x498d('0x43')]['includeAll']){_0x2b2ca1[_0x498d('0x52')]=[{'all':!![]}];}return db[_0x498d('0x3f')][_0x498d('0x53')](_0x2b2ca1);})[_0x498d('0x1f')](function(_0xf467a3){_0x569771[_0x498d('0x54')]=_0xf467a3;return _0x569771;})[_0x498d('0x1f')](respondWithFilteredResult(_0x2e1906,_0x2b2ca1))[_0x498d('0x29')](handleError(_0x2e1906,null));};exports[_0x498d('0x55')]=function(_0x2fcf4f,_0x458533){var _0x178363={'raw':![],'where':{'id':_0x2fcf4f[_0x498d('0x56')]['id']},'include':[{'model':db[_0x498d('0x57')],'as':_0x498d('0x3d')}]},_0x53e7e0={};_0x53e7e0['model']=_[_0x498d('0x58')](db['WhatsappAccount'][_0x498d('0x40')]);_0x53e7e0['query']=_[_0x498d('0x58')](_0x2fcf4f[_0x498d('0x43')]);_0x53e7e0['filters']=_[_0x498d('0x45')](_0x53e7e0[_0x498d('0x42')],_0x53e7e0[_0x498d('0x43')]);_0x178363[_0x498d('0x44')]=_['intersection'](_0x53e7e0['model'],qs['fields'](_0x2fcf4f['query']['fields']));_0x178363[_0x498d('0x44')]=_0x178363['attributes']['length']?_0x178363['attributes']:_0x53e7e0[_0x498d('0x42')];if(_0x2fcf4f[_0x498d('0x43')]['includeAll']){_0x178363['include']=[{'all':!![]}];}_0x178363=_[_0x498d('0x50')]({},_0x178363,_0x2fcf4f['options']);return db[_0x498d('0x3f')][_0x498d('0x59')](_0x178363)[_0x498d('0x1f')](handleEntityNotFound(_0x458533,null))[_0x498d('0x1f')](respondWithResult(_0x458533,null))[_0x498d('0x29')](handleError(_0x458533,null));};exports[_0x498d('0x5a')]=function(_0x2d7863,_0x271c30){return db[_0x498d('0x3f')][_0x498d('0x5a')](_0x2d7863[_0x498d('0x5b')],{})[_0x498d('0x1f')](function(_0x5c74d7){var _0x119444=_0x2d7863[_0x498d('0x5c')][_0x498d('0x37')]({'plain':!![]});if(!_0x119444)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x119444[_0x498d('0x5d')]===_0x498d('0x5c')){var _0x218dcc=_0x5c74d7[_0x498d('0x37')]({'plain':!![]});var _0x9513b6=_0x498d('0x38');return db[_0x498d('0x5e')]['find']({'where':{'name':_0x9513b6,'userProfileId':_0x119444[_0x498d('0x5f')]},'raw':!![]})[_0x498d('0x1f')](function(_0x5d54a0){if(_0x5d54a0&&_0x5d54a0[_0x498d('0x60')]===0x0){return db[_0x498d('0x61')][_0x498d('0x5a')]({'name':_0x218dcc[_0x498d('0x3a')],'resourceId':_0x218dcc['id'],'type':_0x5d54a0['name'],'sectionId':_0x5d54a0['id']},{})[_0x498d('0x1f')](function(){return _0x5c74d7;});}else{return _0x5c74d7;}})['catch'](function(_0x3796ce){logger[_0x498d('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3796ce);throw _0x3796ce;});}return _0x5c74d7;})[_0x498d('0x1f')](respondWithResult(_0x271c30,0xc9))[_0x498d('0x29')](handleError(_0x271c30,null));};exports[_0x498d('0x36')]=function(_0x2a7250,_0x54233b){if(_0x2a7250[_0x498d('0x5b')]['id']){delete _0x2a7250['body']['id'];}return db[_0x498d('0x3f')][_0x498d('0x59')]({'where':{'id':_0x2a7250['params']['id']},'include':[{'model':db[_0x498d('0x57')],'as':_0x498d('0x3d')}]})[_0x498d('0x1f')](handleEntityNotFound(_0x54233b,null))[_0x498d('0x1f')](saveUpdates(_0x2a7250['body'],null))['then'](respondWithResult(_0x54233b,null))[_0x498d('0x29')](handleError(_0x54233b,null));};exports[_0x498d('0x39')]=function(_0x3ce14,_0x2d0b1b){return db['WhatsappAccount'][_0x498d('0x59')]({'where':{'id':_0x3ce14[_0x498d('0x56')]['id']}})['then'](handleEntityNotFound(_0x2d0b1b,null))[_0x498d('0x1f')](removeEntity(_0x2d0b1b,null))[_0x498d('0x29')](handleError(_0x2d0b1b,null));};exports[_0x498d('0x62')]=function(_0x5c2864,_0x51c392){return db[_0x498d('0x3f')][_0x498d('0x62')]()[_0x498d('0x1f')](respondWithResult(_0x51c392,null))['catch'](handleError(_0x51c392,null));};exports[_0x498d('0x63')]=function(_0x4b0d0d,_0x5742d3,_0x1f4555){if(_0x4b0d0d[_0x498d('0x5b')]['id']){delete _0x4b0d0d[_0x498d('0x5b')]['id'];}return db[_0x498d('0x3f')][_0x498d('0x59')]({'where':{'id':_0x4b0d0d[_0x498d('0x56')]['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0x5742d3,null))[_0x498d('0x1f')](function(_0x15d82a){if(_0x15d82a){_0x4b0d0d[_0x498d('0x5b')][_0x498d('0x64')]=_0x15d82a['id'];return db['Disposition'][_0x498d('0x5a')](_0x4b0d0d['body']);}})[_0x498d('0x1f')](respondWithResult(_0x5742d3,null))['catch'](handleError(_0x5742d3,null));};exports[_0x498d('0x65')]=function(_0x14433e,_0xda3f03,_0x285026){var _0x3007b5={'raw':![],'where':{}};var _0x2626e2={};var _0x44eb30={'count':0x0,'rows':[]};return db[_0x498d('0x3f')][_0x498d('0x66')]({'where':{'id':_0x14433e[_0x498d('0x56')]['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0xda3f03,null))[_0x498d('0x1f')](function(_0x5d92e0){if(_0x5d92e0){_0x2626e2[_0x498d('0x42')]=_[_0x498d('0x58')](db[_0x498d('0x67')][_0x498d('0x40')]);_0x2626e2[_0x498d('0x43')]=_[_0x498d('0x58')](_0x14433e['query']);_0x2626e2['filters']=_[_0x498d('0x45')](_0x2626e2[_0x498d('0x42')],_0x2626e2[_0x498d('0x43')]);_0x3007b5[_0x498d('0x44')]=_[_0x498d('0x45')](_0x2626e2[_0x498d('0x42')],qs[_0x498d('0x46')](_0x14433e[_0x498d('0x43')][_0x498d('0x46')]));_0x3007b5[_0x498d('0x44')]=_0x3007b5[_0x498d('0x44')][_0x498d('0x68')]?_0x3007b5[_0x498d('0x44')]:_0x2626e2[_0x498d('0x42')];if(!_0x14433e[_0x498d('0x43')][_0x498d('0x47')](_0x498d('0x48'))){_0x3007b5['limit']=qs[_0x498d('0x2f')](_0x14433e[_0x498d('0x43')][_0x498d('0x2f')]);_0x3007b5[_0x498d('0x31')]=qs[_0x498d('0x31')](_0x14433e[_0x498d('0x43')][_0x498d('0x31')]);}_0x3007b5['order']=qs[_0x498d('0x4a')](_0x14433e[_0x498d('0x43')][_0x498d('0x4a')]);_0x3007b5[_0x498d('0x4b')]=qs[_0x498d('0x4c')](_[_0x498d('0x69')](_0x14433e['query'],_0x2626e2[_0x498d('0x4c')]));_0x3007b5[_0x498d('0x4b')][_0x498d('0x64')]=_0x5d92e0['id'];if(_0x14433e['query'][_0x498d('0x4d')]){_0x3007b5[_0x498d('0x4b')]=_[_0x498d('0x50')](_0x3007b5[_0x498d('0x4b')],{'$or':_['map'](_0x3007b5[_0x498d('0x44')],function(_0x1d092e){var _0x30e07b={};_0x30e07b[_0x1d092e]={'$like':'%'+_0x14433e[_0x498d('0x43')][_0x498d('0x4d')]+'%'};return _0x30e07b;})});}_0x3007b5=_[_0x498d('0x50')]({},_0x3007b5,_0x14433e[_0x498d('0x51')]);return db[_0x498d('0x67')][_0x498d('0x30')]({'where':_0x3007b5[_0x498d('0x4b')]})[_0x498d('0x1f')](function(_0x2489d8){_0x44eb30[_0x498d('0x30')]=_0x2489d8;if(_0x14433e[_0x498d('0x43')][_0x498d('0x6a')]){_0x3007b5[_0x498d('0x52')]=[{'all':!![]}];}return db[_0x498d('0x67')][_0x498d('0x53')](_0x3007b5);})[_0x498d('0x1f')](function(_0x288ad9){_0x44eb30[_0x498d('0x54')]=_0x288ad9;return _0x44eb30;});}})[_0x498d('0x1f')](respondWithFilteredResult(_0xda3f03,_0x3007b5))[_0x498d('0x29')](handleError(_0xda3f03,null));};exports[_0x498d('0x6b')]=function(_0x519cdc,_0x3c2f41,_0x523c90){return db['WhatsappAccount'][_0x498d('0x59')]({'where':{'id':_0x519cdc[_0x498d('0x56')]['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0x3c2f41,null))[_0x498d('0x1f')](function(_0xc8f86d){if(_0xc8f86d){return _0xc8f86d[_0x498d('0x6b')](_0x519cdc[_0x498d('0x43')][_0x498d('0x6c')]);}})[_0x498d('0x1f')](respondWithStatusCode(_0x3c2f41,null))[_0x498d('0x29')](handleError(_0x3c2f41,null));};exports[_0x498d('0x6d')]=function(_0x57773d,_0x456971,_0x143391){if(_0x57773d[_0x498d('0x5b')]['id']){delete _0x57773d['body']['id'];}return db['WhatsappAccount'][_0x498d('0x59')]({'where':{'id':_0x57773d['params']['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0x456971,null))['then'](function(_0x298b99){if(_0x298b99){_0x57773d['body'][_0x498d('0x64')]=_0x298b99['id'];return db['CannedAnswer']['create'](_0x57773d[_0x498d('0x5b')]);}})[_0x498d('0x1f')](respondWithResult(_0x456971,null))['catch'](handleError(_0x456971,null));};exports[_0x498d('0x6e')]=function(_0x5462ee,_0x2ce89d,_0x1d8e39){var _0x1cce17={'raw':![],'where':{}};var _0x3e1cd9={};var _0x1221d6={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x498d('0x66')]({'where':{'id':_0x5462ee[_0x498d('0x56')]['id']}})['then'](handleEntityNotFound(_0x2ce89d,null))[_0x498d('0x1f')](function(_0x2a2d4e){if(_0x2a2d4e){_0x3e1cd9[_0x498d('0x42')]=_[_0x498d('0x58')](db[_0x498d('0x6f')]['rawAttributes']);_0x3e1cd9[_0x498d('0x43')]=_[_0x498d('0x58')](_0x5462ee['query']);_0x3e1cd9['filters']=_[_0x498d('0x45')](_0x3e1cd9[_0x498d('0x42')],_0x3e1cd9[_0x498d('0x43')]);_0x1cce17[_0x498d('0x44')]=_['intersection'](_0x3e1cd9['model'],qs['fields'](_0x5462ee[_0x498d('0x43')][_0x498d('0x46')]));_0x1cce17[_0x498d('0x44')]=_0x1cce17['attributes'][_0x498d('0x68')]?_0x1cce17[_0x498d('0x44')]:_0x3e1cd9[_0x498d('0x42')];if(!_0x5462ee[_0x498d('0x43')][_0x498d('0x47')](_0x498d('0x48'))){_0x1cce17[_0x498d('0x2f')]=qs[_0x498d('0x2f')](_0x5462ee[_0x498d('0x43')][_0x498d('0x2f')]);_0x1cce17[_0x498d('0x31')]=qs[_0x498d('0x31')](_0x5462ee[_0x498d('0x43')]['offset']);}_0x1cce17[_0x498d('0x49')]=qs['sort'](_0x5462ee['query'][_0x498d('0x4a')]);_0x1cce17[_0x498d('0x4b')]=qs['filters'](_[_0x498d('0x69')](_0x5462ee[_0x498d('0x43')],_0x3e1cd9[_0x498d('0x4c')]));_0x1cce17[_0x498d('0x4b')][_0x498d('0x64')]=_0x2a2d4e['id'];if(_0x5462ee[_0x498d('0x43')][_0x498d('0x4d')]){_0x1cce17[_0x498d('0x4b')]=_[_0x498d('0x50')](_0x1cce17[_0x498d('0x4b')],{'$or':_['map'](_0x1cce17[_0x498d('0x44')],function(_0x3ceafd){var _0xfef58a={};_0xfef58a[_0x3ceafd]={'$like':'%'+_0x5462ee[_0x498d('0x43')][_0x498d('0x4d')]+'%'};return _0xfef58a;})});}_0x1cce17=_[_0x498d('0x50')]({},_0x1cce17,_0x5462ee[_0x498d('0x51')]);return db[_0x498d('0x6f')]['count']({'where':_0x1cce17['where']})[_0x498d('0x1f')](function(_0x371287){_0x1221d6[_0x498d('0x30')]=_0x371287;if(_0x5462ee[_0x498d('0x43')][_0x498d('0x6a')]){_0x1cce17['include']=[{'all':!![]}];}return db[_0x498d('0x6f')][_0x498d('0x53')](_0x1cce17);})[_0x498d('0x1f')](function(_0x56bc7f){_0x1221d6['rows']=_0x56bc7f;return _0x1221d6;});}})[_0x498d('0x1f')](respondWithFilteredResult(_0x2ce89d,_0x1cce17))[_0x498d('0x29')](handleError(_0x2ce89d,null));};exports['removeAnswers']=function(_0x4828a1,_0x1c0405,_0x265ede){return db['WhatsappAccount'][_0x498d('0x59')]({'where':{'id':_0x4828a1[_0x498d('0x56')]['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0x1c0405,null))[_0x498d('0x1f')](function(_0x1f4c93){if(_0x1f4c93){return _0x1f4c93[_0x498d('0x70')](_0x4828a1[_0x498d('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x1c0405,null))[_0x498d('0x29')](handleError(_0x1c0405,null));};exports['addAgents']=function(_0x3559fb,_0x2c7406,_0x23ee8b){return db[_0x498d('0x3f')][_0x498d('0x59')]({'where':{'id':_0x3559fb[_0x498d('0x56')]['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0x2c7406,null))[_0x498d('0x1f')](function(_0x29744d){if(_0x29744d){return _0x29744d[_0x498d('0x71')](_0x3559fb[_0x498d('0x5b')][_0x498d('0x6c')],_[_0x498d('0x72')](_0x3559fb[_0x498d('0x5b')],[_0x498d('0x6c'),'id'])||{})[_0x498d('0x73')](function(_0x2a04ee){for(var _0x247074=0x0;_0x247074<_0x3559fb['body'][_0x498d('0x6c')]['length'];_0x247074+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x3559fb[_0x498d('0x5b')][_0x498d('0x6c')][_0x247074]),'WhatsappAccountId':Number(_0x3559fb[_0x498d('0x56')]['id'])});}return _0x2a04ee;});}})[_0x498d('0x1f')](respondWithResult(_0x2c7406,null))[_0x498d('0x29')](handleError(_0x2c7406,null));};exports[_0x498d('0x74')]=function(_0x4bd1b7,_0x529254,_0xa0b8c4){return db[_0x498d('0x3f')]['find']({'where':{'id':_0x4bd1b7[_0x498d('0x56')]['id']}})['then'](handleEntityNotFound(_0x529254,null))[_0x498d('0x1f')](function(_0x2669ac){if(_0x2669ac){return _0x2669ac[_0x498d('0x74')](_0x4bd1b7[_0x498d('0x43')][_0x498d('0x6c')])[_0x498d('0x1f')](function(){if(_[_0x498d('0x75')](_0x4bd1b7[_0x498d('0x43')][_0x498d('0x6c')])){for(var _0xc42c60=0x0;_0xc42c60<_0x4bd1b7[_0x498d('0x43')][_0x498d('0x6c')][_0x498d('0x68')];_0xc42c60+=0x1){socket[_0x498d('0x76')](_0x498d('0x77'),{'UserId':Number(_0x4bd1b7[_0x498d('0x43')][_0x498d('0x6c')][_0xc42c60]),'WhatsappAccountId':Number(_0x4bd1b7[_0x498d('0x56')]['id'])});}}else{socket[_0x498d('0x76')](_0x498d('0x77'),{'UserId':Number(_0x4bd1b7[_0x498d('0x43')]['ids']),'WhatsappAccountId':Number(_0x4bd1b7[_0x498d('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x529254,null))[_0x498d('0x29')](handleError(_0x529254,null));};exports[_0x498d('0x78')]=function(_0x53f43a,_0x4ad718,_0x4b4123){var _0x5f1d55={};var _0x46ebc1={};var _0x25243a;var _0xc2c0ad;return db[_0x498d('0x3f')][_0x498d('0x66')]({'where':{'id':_0x53f43a[_0x498d('0x56')]['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0x4ad718,null))[_0x498d('0x1f')](function(_0x4180ca){if(_0x4180ca){_0x25243a=_0x4180ca;_0x46ebc1[_0x498d('0x42')]=_['keys'](db[_0x498d('0x79')]['rawAttributes']);_0x46ebc1[_0x498d('0x43')]=_[_0x498d('0x58')](_0x53f43a['query']);_0x46ebc1[_0x498d('0x4c')]=_[_0x498d('0x45')](_0x46ebc1[_0x498d('0x42')],_0x46ebc1[_0x498d('0x43')]);_0x5f1d55[_0x498d('0x44')]=_['intersection'](_0x46ebc1[_0x498d('0x42')],qs['fields'](_0x53f43a[_0x498d('0x43')][_0x498d('0x46')]));_0x5f1d55[_0x498d('0x44')]=_0x5f1d55[_0x498d('0x44')]['length']?_0x5f1d55[_0x498d('0x44')]:_0x46ebc1[_0x498d('0x42')];_0x5f1d55[_0x498d('0x49')]=qs[_0x498d('0x4a')](_0x53f43a[_0x498d('0x43')]['sort']);_0x5f1d55[_0x498d('0x4b')]=qs[_0x498d('0x4c')](_[_0x498d('0x69')](_0x53f43a[_0x498d('0x43')],_0x46ebc1[_0x498d('0x4c')]));if(_0x53f43a[_0x498d('0x43')]['filter']){_0x5f1d55[_0x498d('0x4b')]=_[_0x498d('0x50')](_0x5f1d55[_0x498d('0x4b')],{'$or':_[_0x498d('0x3e')](_0x5f1d55[_0x498d('0x44')],function(_0x31835d){var _0x36dcfc={};_0x36dcfc[_0x31835d]={'$like':'%'+_0x53f43a[_0x498d('0x43')][_0x498d('0x4d')]+'%'};return _0x36dcfc;})});}_0x5f1d55=_[_0x498d('0x50')]({},_0x5f1d55,_0x53f43a[_0x498d('0x51')]);return _0x25243a[_0x498d('0x78')](_0x5f1d55);}})[_0x498d('0x1f')](function(_0x599f20){if(_0x599f20){_0xc2c0ad=_0x599f20[_0x498d('0x68')];if(!_0x53f43a['query'][_0x498d('0x47')](_0x498d('0x48'))){_0x5f1d55[_0x498d('0x2f')]=qs['limit'](_0x53f43a[_0x498d('0x43')]['limit']);_0x5f1d55[_0x498d('0x31')]=qs[_0x498d('0x31')](_0x53f43a[_0x498d('0x43')][_0x498d('0x31')]);}return _0x25243a['getAgents'](_0x5f1d55);}})[_0x498d('0x1f')](function(_0x1106cc){if(_0x1106cc){return _0x1106cc?{'count':_0xc2c0ad,'rows':_0x1106cc}:null;}})[_0x498d('0x1f')](respondWithResult(_0x4ad718,null))[_0x498d('0x29')](handleError(_0x4ad718,null));};exports[_0x498d('0x7a')]=function(_0xe1f9d3,_0x1cbd93,_0x3fd00c){return db[_0x498d('0x3f')][_0x498d('0x66')]({'where':{'id':_0xe1f9d3[_0x498d('0x56')]['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0x1cbd93,null))[_0x498d('0x1f')](function(_0x431e62){if(_0x431e62){return db[_0x498d('0x7b')][_0x498d('0x7c')](function(_0x1c0998){return db[_0x498d('0x7d')][_0x498d('0x39')]({'where':{'WhatsappAccountId':_0xe1f9d3[_0x498d('0x56')]['id']},'transaction':_0x1c0998})[_0x498d('0x1f')](function(_0x2b64fa){var _0x1544c3=_[_0x498d('0x3e')](_0xe1f9d3['body'],function(_0xfc1e56){_0xfc1e56['WhatsappAccountId']=_0xe1f9d3[_0x498d('0x56')]['id'];return _0xfc1e56;});return db['WhatsappApplication'][_0x498d('0x7e')](_0x1544c3,{'transaction':_0x1c0998});});})[_0x498d('0x1f')](function(){return db[_0x498d('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0xe1f9d3['params']['id']},'order':_0x498d('0x7f')});});}})[_0x498d('0x1f')](respondWithResult(_0x1cbd93,null))[_0x498d('0x29')](handleError(_0x1cbd93,null));};exports[_0x498d('0x80')]=function(_0x2de488,_0x39a607,_0x2ee8a9){var _0x350fb0={};var _0x43d750={};var _0x410976;var _0x18b1b3;return db['WhatsappAccount'][_0x498d('0x66')]({'where':{'id':_0x2de488['params']['id']}})[_0x498d('0x1f')](handleEntityNotFound(_0x39a607,null))[_0x498d('0x1f')](function(_0x23611f){if(_0x23611f){_0x410976=_0x23611f;_0x43d750[_0x498d('0x42')]=_[_0x498d('0x58')](db[_0x498d('0x7d')][_0x498d('0x40')]);_0x43d750[_0x498d('0x43')]=_['keys'](_0x2de488[_0x498d('0x43')]);_0x43d750[_0x498d('0x4c')]=_[_0x498d('0x45')](_0x43d750['model'],_0x43d750[_0x498d('0x43')]);_0x350fb0[_0x498d('0x44')]=_[_0x498d('0x45')](_0x43d750['model'],qs[_0x498d('0x46')](_0x2de488[_0x498d('0x43')][_0x498d('0x46')]));_0x350fb0['attributes']=_0x350fb0[_0x498d('0x44')][_0x498d('0x68')]?_0x350fb0['attributes']:_0x43d750[_0x498d('0x42')];_0x350fb0[_0x498d('0x49')]=qs[_0x498d('0x4a')](_0x2de488[_0x498d('0x43')]['sort']);_0x350fb0['where']=qs[_0x498d('0x4c')](_[_0x498d('0x69')](_0x2de488[_0x498d('0x43')],_0x43d750['filters']));if(_0x2de488[_0x498d('0x43')][_0x498d('0x4d')]){_0x350fb0[_0x498d('0x4b')]=_[_0x498d('0x50')](_0x350fb0[_0x498d('0x4b')],{'$or':_['map'](_0x350fb0[_0x498d('0x44')],function(_0x5280bf){var _0x54bdf3={};_0x54bdf3[_0x5280bf]={'$like':'%'+_0x2de488[_0x498d('0x43')][_0x498d('0x4d')]+'%'};return _0x54bdf3;})});}_0x350fb0=_[_0x498d('0x50')]({},_0x350fb0,_0x2de488[_0x498d('0x51')]);return _0x410976['getApplications'](_0x350fb0);}})[_0x498d('0x1f')](function(_0x412be3){if(_0x412be3){_0x18b1b3=_0x412be3['length'];if(!_0x2de488[_0x498d('0x43')][_0x498d('0x47')](_0x498d('0x48'))){_0x350fb0['limit']=qs['limit'](_0x2de488[_0x498d('0x43')][_0x498d('0x2f')]);_0x350fb0[_0x498d('0x31')]=qs['offset'](_0x2de488[_0x498d('0x43')][_0x498d('0x31')]);}return _0x410976['getApplications'](_0x350fb0);}})[_0x498d('0x1f')](function(_0x125e20){if(_0x125e20){return _0x125e20?{'count':_0x18b1b3,'rows':_0x125e20}:null;}})[_0x498d('0x1f')](respondWithResult(_0x39a607,null))['catch'](handleError(_0x39a607,null));};exports['notify']=function(_0x397b9d,_0x30fe1c,_0x813b2d){var _0x223fba={'channel':_0x498d('0x81')};var _0x2f3579=[];var _0x16e48f=[];var _0x3442b4={};return db[_0x498d('0x3f')][_0x498d('0x59')]({'where':{'id':_0x397b9d[_0x498d('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x498d('0x82')}]})['then'](handleEntityNotFound(_0x30fe1c,null))['then'](function(_0x437853){_0x223fba['account']=_0x437853;_0x223fba[_0x498d('0x83')]=_[_0x498d('0x84')](_0x437853[_0x498d('0x82')],[_0x498d('0x7f')],[_0x498d('0x85')]);if(_0x223fba['account'][_0x498d('0x82')]){delete _0x223fba[_0x498d('0x86')][_0x498d('0x82')];}return db[_0x498d('0x87')][_0x498d('0x62')]();})[_0x498d('0x1f')](function(_0x4ef2a0){if(!_0x4ef2a0){throw new db['Sequelize'][(_0x498d('0x88'))](_0x498d('0x89'));}_0x2f3579=_[_0x498d('0x8a')](_[_0x498d('0x58')](_0x4ef2a0),[_0x498d('0x8b'),'updatedAt']);_0x16e48f=_[_0x498d('0x8a')](_['keys'](_0x4ef2a0),['createdAt',_0x498d('0x8c'),_0x498d('0x8d'),_0x498d('0x8e')]);_0x223fba[_0x498d('0x5b')]={'mapKey':_0x498d('0x8f')};if(_0x223fba[_0x498d('0x86')][_0x498d('0x4e')]&&_0x223fba[_0x498d('0x86')][_0x498d('0x4e')]===_0x498d('0x90')){_0x223fba['body']['from']=_0x397b9d['body'][_0x498d('0x91')][_0x498d('0x92')](_0x498d('0x93'),'');_0x223fba[_0x498d('0x5b')][_0x498d('0x5b')]=_0x397b9d[_0x498d('0x5b')][_0x498d('0x94')];_0x223fba['body']['messageId']=_0x397b9d[_0x498d('0x5b')][_0x498d('0x95')];}if(_0x223fba['body']['id']){delete _0x223fba[_0x498d('0x5b')]['id'];}if(_['isNil'](_0x223fba[_0x498d('0x5b')][_0x498d('0x96')])){throw new db[(_0x498d('0x97'))]['ValidationError'](_0x498d('0x98'));}if(_['isNil'](_0x223fba[_0x498d('0x5b')]['body'])||_0x223fba[_0x498d('0x5b')][_0x498d('0x5b')]===''){throw new db[(_0x498d('0x97'))]['ValidationError'](_0x498d('0x99'));}if(_[_0x498d('0x9a')](_0x223fba[_0x498d('0x5b')][_0x498d('0x9b')])){throw new db[(_0x498d('0x97'))]['ValidationError'](_0x498d('0x9c')+_0x16e48f);}if(!_[_0x498d('0x9d')](_0x16e48f,_0x223fba[_0x498d('0x5b')]['mapKey'])){throw new db['Sequelize'][(_0x498d('0x88'))](_0x498d('0x9e')+_0x16e48f);}_0x3442b4[_0x223fba['body']['mapKey']]=_0x223fba['body'][_0x498d('0x96')];return db[_0x498d('0x9f')][_0x498d('0x59')]({'where':{'id':_0x223fba[_0x498d('0x86')][_0x498d('0x8e')]},'include':[{'model':db[_0x498d('0x87')],'as':'Contacts','where':_0x3442b4,'limit':0x1,'order':[[_0x498d('0x8c'),_0x498d('0xa0')]]}]});})['then'](handleEntityNotFound(_0x30fe1c,null))[_0x498d('0x1f')](function(_0x25af75){if(_0x25af75){_0x223fba[_0x498d('0xa1')]=_['omit'](_0x25af75,[_0x498d('0xa2')]);if(_0x25af75['Contacts']['length']){return _0x25af75[_0x498d('0xa2')][0x0];}var _0xaa49bb=_[_0x498d('0x19')](_0x223fba['body'],{'firstName':_0x223fba['body']['from'],'ListId':_0x25af75['id']});_0xaa49bb[_0x223fba[_0x498d('0x5b')][_0x498d('0x9b')]]=_0x223fba['body'][_0x498d('0x96')];return db['CmContact'][_0x498d('0x5a')](_0xaa49bb,{'fields':_0x2f3579,'raw':!![]});}})['then'](handleEntityNotFound(_0x30fe1c,null))['then'](function(_0x599472){if(_0x599472){_0x223fba[_0x498d('0xa3')]=_0x599472;var _0x4c91fb={'ContactId':_0x599472['id'],'phone':_0x223fba[_0x498d('0x5b')][_0x498d('0x96')],'WhatsappAccountId':_0x397b9d['params']['id']};var _0x480398={'ContactId':_0x599472['id'],'WhatsappAccountId':_0x397b9d[_0x498d('0x56')]['id'],'closed':![]};return db[_0x498d('0xa4')][_0x498d('0x59')]({'where':_0x480398})['then'](function(_0x3ceb6e){if(_0x3ceb6e){return[_0x3ceb6e,![]];}return db['WhatsappInteraction'][_0x498d('0x5a')](_0x4c91fb)[_0x498d('0x1f')](function(_0x45c4c0){return[_0x45c4c0,!![]];});});}})[_0x498d('0x73')](function(_0x5391fb,_0x419317){_0x223fba[_0x498d('0xa5')]=_0x5391fb[_0x498d('0x37')]({'plain':!![]});_0x223fba[_0x498d('0xa5')]['created']=![];if(_0x419317){if(_0x223fba[_0x498d('0x86')][_0x498d('0xa6')]){_0x223fba['applications'][_0x498d('0xa7')]({'id':0x0,'priority':_0x223fba[_0x498d('0x83')]['length']+0x1,'app':_0x498d('0xa8'),'appdata':'unmanaged','interval':_0x498d('0xa9')});}_0x223fba[_0x498d('0xa5')][_0x498d('0xaa')]=!![];}return db[_0x498d('0xab')][_0x498d('0x5a')]({'phone':_0x223fba[_0x498d('0x5b')][_0x498d('0x96')],'messageId':_0x223fba[_0x498d('0x5b')][_0x498d('0xac')],'body':_0x223fba['body'][_0x498d('0x5b')],'WhatsappAccountId':_0x397b9d[_0x498d('0x56')]['id'],'WhatsappInteractionId':_0x5391fb['id'],'direction':'in','ContactId':_0x5391fb[_0x498d('0xad')],'AttachmentId':_0x223fba[_0x498d('0x5b')][_0x498d('0xae')]});})[_0x498d('0x1f')](function(_0x595bea){_0x223fba['message']=_0x595bea;if(_0x223fba[_0x498d('0xa5')][_0x498d('0xaf')]){return db['User'][_0x498d('0x59')]({'attributes':['id','name'],'where':{'id':_0x223fba[_0x498d('0xa5')][_0x498d('0xaf')]}})[_0x498d('0x1f')](function(_0x30644a){if(_0x30644a){_0x223fba[_0x498d('0x83')][_0x498d('0xb0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x30644a[_0x498d('0x3a')]+','+(_0x223fba[_0x498d('0x86')][_0x498d('0xb1')]||0xa),'interval':_0x498d('0xa9')});}return respondWithRpcPromise('Start',_0x498d('0xb2'),_0x223fba);});}return respondWithRpcPromise('Start',_0x498d('0xb2'),_0x223fba);})[_0x498d('0x1f')](function(_0xb088a6){if(_0xb088a6){var _0x4465fe=0xc8;var _0x39c8d9='receiveMessage';logger[_0x498d('0x20')](_0x498d('0x23'),_0x39c8d9,_0x4465fe,_0x498d('0xb3'));logger[_0x498d('0xb4')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x39c8d9,_0x4465fe,_0x498d('0xb3'),JSON['stringify'](_0xb088a6));if(_0x223fba[_0x498d('0x86')]['type']===_0x498d('0x90')){return _0x30fe1c['status'](_0x4465fe)['set'](_0x498d('0xb5'),_0x498d('0xb6'))[_0x498d('0x3b')](_0x498d('0xb7'));}else{return _0x30fe1c[_0x498d('0x2b')](_0x4465fe)[_0x498d('0x2d')](_0xb088a6);}}})[_0x498d('0x29')](handleError(_0x30fe1c,null));};exports[_0x498d('0x3b')]=function(_0x3cc409,_0x347104,_0x2b2f27){var _0x513df9,_0x5c478c,_0x346e85;if(_[_0x498d('0x9a')](_0x3cc409[_0x498d('0x5b')][_0x498d('0x5b')])||_0x3cc409[_0x498d('0x5b')][_0x498d('0x5b')]===''){throw new db['Sequelize'][(_0x498d('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3cc409[_0x498d('0x5b')]['to'])){throw new db[(_0x498d('0x97'))][(_0x498d('0x88'))](_0x498d('0xb8'));}_0x513df9=_0x3cc409['body']['to'];return db[_0x498d('0x3f')]['find']({'where':{'id':_0x3cc409[_0x498d('0x56')]['id']},'include':[{'model':db[_0x498d('0x9f')],'as':'List','include':[{'model':db[_0x498d('0x87')],'as':_0x498d('0xa2'),'where':{'mobile':_0x513df9},'limit':0x1,'order':[[_0x498d('0x8c'),'DESC']]}]}]})[_0x498d('0x1f')](handleEntityNotFound(_0x347104,null))[_0x498d('0x1f')](function(_0xbf841d){if(_0xbf841d&&_0xbf841d['List']){_0x5c478c=_0xbf841d[_0x498d('0x37')]({'plain':!![]});if(_0x5c478c[_0x498d('0xb9')]&&_0x5c478c['List']['Contacts']['length']){return _0x5c478c[_0x498d('0xb9')][_0x498d('0xa2')][0x0];}return db[_0x498d('0x87')][_0x498d('0x5a')](_['defaults'](_0x3cc409[_0x498d('0x5b')],{'firstName':_0x513df9,'mobile':_0x513df9,'phone':_0x513df9,'ListId':_0x5c478c['ListId']}));}})[_0x498d('0x1f')](handleEntityNotFound(_0x347104,null))[_0x498d('0x1f')](function(_0x271988){if(_0x271988){_0x346e85=_0x271988;return db[_0x498d('0xa4')][_0x498d('0x59')]({'where':{'ContactId':_0x346e85['id'],'closed':![],'WhatsappAccountId':_0x5c478c['id']}})[_0x498d('0x1f')](function(_0x3f5b3a){if(_0x3f5b3a){return[_0x3f5b3a,![]];}return db[_0x498d('0xa4')][_0x498d('0x5a')]({'UserId':_0x3cc409['user']['id'],'ContactId':_0x346e85['id'],'WhatsappAccountId':_0x5c478c['id'],'phone':_0x513df9,'firstMsgDirection':_0x498d('0xba'),'Messages':[_[_0x498d('0x50')](_0x3cc409[_0x498d('0x5b')],{'read':![],'body':_0x3cc409[_0x498d('0x5b')][_0x498d('0x5b')],'phone':_0x513df9,'WhatsappAccountId':_0x5c478c['id'],'UserId':_0x3cc409['user']['id'],'ContactId':_0x346e85['id']})]},{'include':[{'model':db[_0x498d('0xab')],'as':_0x498d('0xbb')}]})['then'](function(_0x5eefe1){return[_0x5eefe1,!![]];});});}})[_0x498d('0x73')](function(_0x3c01f1,_0x46dc39){if(_0x46dc39){return _0x3c01f1;}return db[_0x498d('0xab')]['create'](_[_0x498d('0x50')](_0x3cc409[_0x498d('0x5b')],{'read':![],'body':_0x3cc409[_0x498d('0x5b')][_0x498d('0x5b')],'phone':_0x513df9,'WhatsappAccountId':_0x5c478c['id'],'WhatsappInteractionId':_0x3c01f1['id'],'UserId':_0x3cc409[_0x498d('0x5c')]['id'],'ContactId':_0x346e85['id']}))[_0x498d('0x1f')](function(_0x1ecc25){_0x3c01f1[_0x498d('0xbc')][_0x498d('0xbb')]=[];_0x3c01f1['dataValues'][_0x498d('0xbb')]['push'](_0x1ecc25['dataValues']);return _0x3c01f1;});})['then'](respondWithResult(_0x347104,null))[_0x498d('0x29')](handleError(_0x347104,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 4feaa8b..b56565b 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 _0x6351=['events','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x17ca87,_0x537b70){var _0xf236c5=function(_0x160e17){while(--_0x160e17){_0x17ca87['push'](_0x17ca87['shift']());}};_0xf236c5(++_0x537b70);}(_0x6351,0x6e));var _0x1635=function(_0x39b68b,_0x4ad96d){_0x39b68b=_0x39b68b-0x0;var _0xae091f=_0x6351[_0x39b68b];return _0xae091f;};'use strict';var EventEmitter=require(_0x1635('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x1635('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1635('0x2')](0x0);var events={'afterCreate':_0x1635('0x3'),'afterUpdate':_0x1635('0x4'),'afterDestroy':_0x1635('0x5')};function emitEvent(_0x39be17){return function(_0x466596,_0x255deb,_0x545ab2){WhatsappAccountEvents['emit'](_0x39be17+':'+_0x466596['id'],_0x466596);WhatsappAccountEvents[_0x1635('0x6')](_0x39be17,_0x466596);_0x545ab2(null);};}for(var e in events){if(events[_0x1635('0x7')](e)){var event=events[e];WhatsappAccount[_0x1635('0x8')](e,emitEvent(event));}}module[_0x1635('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x0bcc=['emit','hasOwnProperty','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x5de85c,_0x67c18e){var _0x515b90=function(_0x1a5cf4){while(--_0x1a5cf4){_0x5de85c['push'](_0x5de85c['shift']());}};_0x515b90(++_0x67c18e);}(_0x0bcc,0x72));var _0xc0bc=function(_0x48a86d,_0x16632b){_0x48a86d=_0x48a86d-0x0;var _0x5d8514=_0x0bcc[_0x48a86d];return _0x5d8514;};'use strict';var EventEmitter=require(_0xc0bc('0x0'));var WhatsappAccount=require(_0xc0bc('0x1'))['db'][_0xc0bc('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc0bc('0x3')](0x0);var events={'afterCreate':_0xc0bc('0x4'),'afterUpdate':_0xc0bc('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2988ea){return function(_0x32c052,_0x19e763,_0x5d137c){WhatsappAccountEvents['emit'](_0x2988ea+':'+_0x32c052['id'],_0x32c052);WhatsappAccountEvents[_0xc0bc('0x6')](_0x2988ea,_0x32c052);_0x5d137c(null);};}for(var e in events){if(events[_0xc0bc('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index a250307..81c6aab 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 _0xbfd2=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','whatsapp_accounts'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbfd2,0x136));var _0x2bfd=function(_0x8ea7b1,_0x557ad9){_0x8ea7b1=_0x8ea7b1-0x0;var _0x17e3fc=_0xbfd2[_0x8ea7b1];return _0x17e3fc;};'use strict';var _=require(_0x2bfd('0x0'));var util=require(_0x2bfd('0x1'));var logger=require(_0x2bfd('0x2'))(_0x2bfd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bfd('0x4'));var rimraf=require(_0x2bfd('0x5'));var config=require(_0x2bfd('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0x2bfd('0x7')]=function(_0x52ed51,_0x15b878){return _0x52ed51[_0x2bfd('0x8')]('WhatsappAccount',attributes,{'tableName':_0x2bfd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb879=['request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0xe7b242,_0x25faa6){var _0x232b57=function(_0x1ac23c){while(--_0x1ac23c){_0xe7b242['push'](_0xe7b242['shift']());}};_0x232b57(++_0x25faa6);}(_0xb879,0x119));var _0x9b87=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb879[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require(_0x9b87('0x0'));var logger=require(_0x9b87('0x1'))(_0x9b87('0x2'));var moment=require(_0x9b87('0x3'));var BPromise=require(_0x9b87('0x4'));var rp=require(_0x9b87('0x5'));var fs=require('fs');var path=require(_0x9b87('0x6'));var rimraf=require(_0x9b87('0x7'));var config=require(_0x9b87('0x8'));var attributes=require(_0x9b87('0x9'));module[_0x9b87('0xa')]=function(_0x9a3321,_0x4e7a8d){return _0x9a3321['define'](_0x9b87('0xb'),attributes,{'tableName':_0x9b87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 35d0fa7..1997137 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 _0x452d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappAccount.socket','register','then','info','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2920dd,_0x19d049){var _0x5d4e52=function(_0x46c751){while(--_0x46c751){_0x2920dd['push'](_0x2920dd['shift']());}};_0x5d4e52(++_0x19d049);}(_0x452d,0x92));var _0xd452=function(_0x3dc39c,_0x797cb9){_0x3dc39c=_0x3dc39c-0x0;var _0x2de747=_0x452d[_0x3dc39c];return _0x2de747;};'use strict';var _=require(_0xd452('0x0'));var util=require(_0xd452('0x1'));var moment=require(_0xd452('0x2'));var BPromise=require(_0xd452('0x3'));var rs=require(_0xd452('0x4'));var fs=require('fs');var Redis=require(_0xd452('0x5'));var db=require(_0xd452('0x6'))['db'];var utils=require(_0xd452('0x7'));var logger=require(_0xd452('0x8'))(_0xd452('0x9'));var config=require(_0xd452('0xa'));var jayson=require(_0xd452('0xb'));var client=jayson[_0xd452('0xc')][_0xd452('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd452('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xd452('0xf'))(new Redis(config[_0xd452('0xe')]));require(_0xd452('0x10'))[_0xd452('0x11')](socket);function respondWithRpcPromise(_0x3fffd4,_0x44dde1,_0x544995){return new BPromise(function(_0x147acf,_0x2149e8){return client['request'](_0x3fffd4,_0x544995)[_0xd452('0x12')](function(_0x5cdee6){logger[_0xd452('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x44dde1,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x44dde1,'request\x20sent',JSON[_0xd452('0x14')](_0x5cdee6));if(_0x5cdee6['error']){if(_0x5cdee6[_0xd452('0x15')][_0xd452('0x16')]===0x1f4){logger[_0xd452('0x15')](_0xd452('0x17'),_0x44dde1,_0x5cdee6[_0xd452('0x15')][_0xd452('0x18')]);return _0x2149e8(_0x5cdee6[_0xd452('0x15')][_0xd452('0x18')]);}logger[_0xd452('0x15')](_0xd452('0x17'),_0x44dde1,_0x5cdee6[_0xd452('0x15')][_0xd452('0x18')]);return _0x147acf(_0x5cdee6[_0xd452('0x15')][_0xd452('0x18')]);}else{logger['info'](_0xd452('0x17'),_0x44dde1,_0xd452('0x19'));_0x147acf(_0x5cdee6[_0xd452('0x1a')][_0xd452('0x18')]);}})[_0xd452('0x1b')](function(_0x141647){logger[_0xd452('0x15')](_0xd452('0x17'),_0x44dde1,_0x141647);_0x2149e8(_0x141647);});});}exports[_0xd452('0x1c')]=function(_0x3182e6){var _0x481133=this;return new Promise(function(_0xe4bec5,_0x29705c){return db[_0xd452('0x1d')][_0xd452('0x1e')]({'raw':_0x3182e6[_0xd452('0x1f')]?_0x3182e6['options'][_0xd452('0x20')]===undefined?!![]:![]:!![],'where':_0x3182e6[_0xd452('0x1f')]?_0x3182e6[_0xd452('0x1f')][_0xd452('0x21')]||null:null,'attributes':_0x3182e6[_0xd452('0x1f')]?_0x3182e6['options'][_0xd452('0x22')]||null:null,'include':_0x3182e6['options']?_0x3182e6[_0xd452('0x1f')]['include']?_[_0xd452('0x23')](_0x3182e6[_0xd452('0x1f')][_0xd452('0x24')],function(_0x467f9c){return{'model':db[_0x467f9c['model']],'as':_0x467f9c['as'],'attributes':_0x467f9c['attributes'],'include':_0x467f9c[_0xd452('0x24')]?_[_0xd452('0x23')](_0x467f9c[_0xd452('0x24')],function(_0x5adf14){return{'model':db[_0x5adf14[_0xd452('0x25')]],'as':_0x5adf14['as'],'attributes':_0x5adf14[_0xd452('0x22')],'include':_0x5adf14[_0xd452('0x24')]?_['map'](_0x5adf14[_0xd452('0x24')],function(_0x964691){return{'model':db[_0x964691[_0xd452('0x25')]],'as':_0x964691['as'],'attributes':_0x964691[_0xd452('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d1057){logger[_0xd452('0x13')]('ShowWhatsappAccount',_0x3182e6);logger['debug'](_0xd452('0x1c'),_0x3182e6,JSON['stringify'](_0x2d1057));_0xe4bec5(_0x2d1057);})[_0xd452('0x1b')](function(_0x29d1b2){logger[_0xd452('0x15')](_0xd452('0x1c'),_0x29d1b2[_0xd452('0x18')],_0x3182e6);_0x29705c(_0x481133[_0xd452('0x15')](0x1f4,_0x29d1b2['message']));});});}; \ No newline at end of file +var _0x3300=['../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','catch','ShowWhatsappAccount','find','options','raw','where','include','attributes','map','model','info','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd9c831,_0x28010a){var _0x31b463=function(_0x479c51){while(--_0x479c51){_0xd9c831['push'](_0xd9c831['shift']());}};_0x31b463(++_0x28010a);}(_0x3300,0x87));var _0x0330=function(_0xf529ba,_0x47f543){_0xf529ba=_0xf529ba-0x0;var _0xe7e86e=_0x3300[_0xf529ba];return _0xe7e86e;};'use strict';var _=require(_0x0330('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0330('0x1'));var rs=require(_0x0330('0x2'));var fs=require('fs');var Redis=require(_0x0330('0x3'));var db=require(_0x0330('0x4'))['db'];var utils=require(_0x0330('0x5'));var logger=require('../../config/logger')(_0x0330('0x6'));var config=require(_0x0330('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0330('0x8')][_0x0330('0x9')]({'port':0x232a});config[_0x0330('0xa')]=_[_0x0330('0xb')](config[_0x0330('0xa')],{'host':_0x0330('0xc'),'port':0x18eb});var socket=require(_0x0330('0xd'))(new Redis(config[_0x0330('0xa')]));require(_0x0330('0xe'))[_0x0330('0xf')](socket);function respondWithRpcPromise(_0x1b442a,_0x1e3fff,_0x194722){return new BPromise(function(_0x64ee0e,_0x1c21e3){return client[_0x0330('0x10')](_0x1b442a,_0x194722)[_0x0330('0x11')](function(_0x569d44){logger['info'](_0x0330('0x12'),_0x1e3fff,_0x0330('0x13'));logger[_0x0330('0x14')](_0x0330('0x15'),_0x1e3fff,_0x0330('0x13'),JSON['stringify'](_0x569d44));if(_0x569d44[_0x0330('0x16')]){if(_0x569d44[_0x0330('0x16')]['code']===0x1f4){logger[_0x0330('0x16')](_0x0330('0x12'),_0x1e3fff,_0x569d44[_0x0330('0x16')][_0x0330('0x17')]);return _0x1c21e3(_0x569d44['error'][_0x0330('0x17')]);}logger[_0x0330('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x1e3fff,_0x569d44['error'][_0x0330('0x17')]);return _0x64ee0e(_0x569d44['error']['message']);}else{logger['info'](_0x0330('0x12'),_0x1e3fff,'request\x20sent');_0x64ee0e(_0x569d44['result']['message']);}})[_0x0330('0x18')](function(_0x5d48e3){logger[_0x0330('0x16')](_0x0330('0x12'),_0x1e3fff,_0x5d48e3);_0x1c21e3(_0x5d48e3);});});}exports[_0x0330('0x19')]=function(_0x22c130){var _0x44f7b4=this;return new Promise(function(_0x4ed2c0,_0x565ff9){return db['WhatsappAccount'][_0x0330('0x1a')]({'raw':_0x22c130[_0x0330('0x1b')]?_0x22c130[_0x0330('0x1b')][_0x0330('0x1c')]===undefined?!![]:![]:!![],'where':_0x22c130[_0x0330('0x1b')]?_0x22c130[_0x0330('0x1b')][_0x0330('0x1d')]||null:null,'attributes':_0x22c130[_0x0330('0x1b')]?_0x22c130[_0x0330('0x1b')]['attributes']||null:null,'include':_0x22c130['options']?_0x22c130[_0x0330('0x1b')][_0x0330('0x1e')]?_['map'](_0x22c130['options']['include'],function(_0x1665d0){return{'model':db[_0x1665d0['model']],'as':_0x1665d0['as'],'attributes':_0x1665d0[_0x0330('0x1f')],'include':_0x1665d0[_0x0330('0x1e')]?_[_0x0330('0x20')](_0x1665d0[_0x0330('0x1e')],function(_0x3c24ca){return{'model':db[_0x3c24ca[_0x0330('0x21')]],'as':_0x3c24ca['as'],'attributes':_0x3c24ca[_0x0330('0x1f')],'include':_0x3c24ca[_0x0330('0x1e')]?_[_0x0330('0x20')](_0x3c24ca[_0x0330('0x1e')],function(_0x44cafa){return{'model':db[_0x44cafa['model']],'as':_0x44cafa['as'],'attributes':_0x44cafa['attributes']};}):[]};}):[]};}):[]:[]})[_0x0330('0x11')](function(_0x4adc4e){logger[_0x0330('0x22')](_0x0330('0x19'),_0x22c130);logger[_0x0330('0x14')](_0x0330('0x19'),_0x22c130,JSON['stringify'](_0x4adc4e));_0x4ed2c0(_0x4adc4e);})['catch'](function(_0x1df77f){logger['error'](_0x0330('0x19'),_0x1df77f[_0x0330('0x17')],_0x22c130);_0x565ff9(_0x44f7b4['error'](0x1f4,_0x1df77f[_0x0330('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index ccd9655..716344f 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 _0x3ba6=['emit','removeListener','register','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0x506bb3,_0x2bd140){var _0x89999d=function(_0x326ba8){while(--_0x326ba8){_0x506bb3['push'](_0x506bb3['shift']());}};_0x89999d(++_0x2bd140);}(_0x3ba6,0xcc));var _0x63ba=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0x3ba6[_0x323d87];return _0x5e8f74;};'use strict';var WhatsappAccountEvents=require(_0x63ba('0x0'));var events=[_0x63ba('0x1'),_0x63ba('0x2'),_0x63ba('0x3')];function createListener(_0x26b3c5,_0x31e38c){return function(_0x720379){_0x31e38c[_0x63ba('0x4')](_0x26b3c5,_0x720379);};}function removeListener(_0x495f79,_0x1a2e25){return function(){WhatsappAccountEvents[_0x63ba('0x5')](_0x495f79,_0x1a2e25);};}exports[_0x63ba('0x6')]=function(_0xf79761){for(var _0x53fe29=0x0,_0x4cfb56=events['length'];_0x53fe29<_0x4cfb56;_0x53fe29++){var _0x21a731=events[_0x53fe29];var _0x14a60a=createListener(_0x63ba('0x7')+_0x21a731,_0xf79761);WhatsappAccountEvents['on'](_0x21a731,_0x14a60a);}}; \ No newline at end of file +var _0x1c5f=['remove','update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x4d457b,_0x53b576){var _0x1dcfa9=function(_0x627e4b){while(--_0x627e4b){_0x4d457b['push'](_0x4d457b['shift']());}};_0x1dcfa9(++_0x53b576);}(_0x1c5f,0x16e));var _0xf1c5=function(_0x4944df,_0xa39a70){_0x4944df=_0x4944df-0x0;var _0x4dca00=_0x1c5f[_0x4944df];return _0x4dca00;};'use strict';var WhatsappAccountEvents=require(_0xf1c5('0x0'));var events=[_0xf1c5('0x1'),_0xf1c5('0x2'),_0xf1c5('0x3')];function createListener(_0x3cca87,_0x18dbc7){return function(_0x18f689){_0x18dbc7[_0xf1c5('0x4')](_0x3cca87,_0x18f689);};}function removeListener(_0x3b24f0,_0x19ecbf){return function(){WhatsappAccountEvents[_0xf1c5('0x5')](_0x3b24f0,_0x19ecbf);};}exports[_0xf1c5('0x6')]=function(_0xdc786a){for(var _0xed5ddb=0x0,_0x48f55f=events['length'];_0xed5ddb<_0x48f55f;_0xed5ddb++){var _0x5b95a1=events[_0xed5ddb];var _0x596ef9=createListener(_0xf1c5('0x7')+_0x5b95a1,_0xdc786a);WhatsappAccountEvents['on'](_0x5b95a1,_0x596ef9);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 53cf4e5..e8b3bf2 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 _0xa1f4=['../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x45d36d,_0x4b4dfe){var _0xa007f7=function(_0x170c4d){while(--_0x170c4d){_0x45d36d['push'](_0x45d36d['shift']());}};_0xa007f7(++_0x4b4dfe);}(_0xa1f4,0xf8));var _0x4a1f=function(_0x155999,_0xbb8070){_0x155999=_0x155999-0x0;var _0x476c58=_0xa1f4[_0x155999];return _0x476c58;};'use strict';var multer=require(_0x4a1f('0x0'));var util=require(_0x4a1f('0x1'));var path=require('path');var timeout=require(_0x4a1f('0x2'));var express=require(_0x4a1f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4a1f('0x4'));var interaction=require(_0x4a1f('0x5'));var config=require('../../config/environment');var controller=require(_0x4a1f('0x6'));router[_0x4a1f('0x7')]('/',auth[_0x4a1f('0x8')](),controller[_0x4a1f('0x9')]);router[_0x4a1f('0x7')](_0x4a1f('0xa'),auth[_0x4a1f('0x8')](),controller[_0x4a1f('0xb')]);router[_0x4a1f('0xc')]('/',auth[_0x4a1f('0x8')](),controller[_0x4a1f('0xd')]);router['put'](_0x4a1f('0xa'),auth[_0x4a1f('0x8')](),controller[_0x4a1f('0xe')]);router[_0x4a1f('0xf')](_0x4a1f('0xa'),auth[_0x4a1f('0x8')](),controller[_0x4a1f('0x10')]);module[_0x4a1f('0x11')]=router; \ No newline at end of file +var _0xff67=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3d79cf,_0x58047e){var _0x5298ec=function(_0x13bf2f){while(--_0x13bf2f){_0x3d79cf['push'](_0x3d79cf['shift']());}};_0x5298ec(++_0x58047e);}(_0xff67,0x18b));var _0x7ff6=function(_0x4f3332,_0x54c131){_0x4f3332=_0x4f3332-0x0;var _0x177e6b=_0xff67[_0x4f3332];return _0x177e6b;};'use strict';var multer=require(_0x7ff6('0x0'));var util=require(_0x7ff6('0x1'));var path=require('path');var timeout=require(_0x7ff6('0x2'));var express=require(_0x7ff6('0x3'));var router=express[_0x7ff6('0x4')]();var fs_extra=require(_0x7ff6('0x5'));var auth=require(_0x7ff6('0x6'));var interaction=require(_0x7ff6('0x7'));var config=require(_0x7ff6('0x8'));var controller=require(_0x7ff6('0x9'));router[_0x7ff6('0xa')]('/',auth[_0x7ff6('0xb')](),controller[_0x7ff6('0xc')]);router[_0x7ff6('0xa')](_0x7ff6('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7ff6('0xe')]('/',auth[_0x7ff6('0xb')](),controller['create']);router[_0x7ff6('0xf')](_0x7ff6('0xd'),auth['isAuthenticated'](),controller[_0x7ff6('0x10')]);router[_0x7ff6('0x11')](_0x7ff6('0xd'),auth[_0x7ff6('0xb')](),controller[_0x7ff6('0x12')]);module[_0x7ff6('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index dd663dd..e974968 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 _0x669c=['sequelize','exports','STRING','noop','TEXT'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x669c,0x154));var _0xc669=function(_0x265592,_0x5eeeb9){_0x265592=_0x265592-0x0;var _0x151a40=_0x669c[_0x265592];return _0x151a40;};'use strict';var Sequelize=require(_0xc669('0x0'));module[_0xc669('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc669('0x2')],'allowNull':![],'defaultValue':_0xc669('0x3')},'appdata':{'type':Sequelize[_0xc669('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc669('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x93a8=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x17bda6,_0x5421d9){var _0xd687ec=function(_0x31c9a5){while(--_0x31c9a5){_0x17bda6['push'](_0x17bda6['shift']());}};_0xd687ec(++_0x5421d9);}(_0x93a8,0x123));var _0x893a=function(_0x246382,_0x3631f5){_0x246382=_0x246382-0x0;var _0x28dfb0=_0x93a8[_0x246382];return _0x28dfb0;};'use strict';var Sequelize=require(_0x893a('0x0'));module[_0x893a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x893a('0x2')],'allowNull':![],'defaultValue':_0x893a('0x3')},'appdata':{'type':Sequelize[_0x893a('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x893a('0x2')],'defaultValue':_0x893a('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index f052bd4..9199263 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 _0x2aa3=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x1e00d4,_0x3b6de3){var _0x405890=function(_0x2ee1f3){while(--_0x2ee1f3){_0x1e00d4['push'](_0x1e00d4['shift']());}};_0x405890(++_0x3b6de3);}(_0x2aa3,0x83));var _0x32aa=function(_0x2432a2,_0x7842e1){_0x2432a2=_0x2432a2-0x0;var _0x476eb7=_0x2aa3[_0x2432a2];return _0x476eb7;};'use strict';var emlformat=require(_0x32aa('0x0'));var rimraf=require(_0x32aa('0x1'));var zipdir=require(_0x32aa('0x2'));var jsonpatch=require(_0x32aa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x32aa('0x4'));var Mustache=require(_0x32aa('0x5'));var util=require(_0x32aa('0x6'));var path=require(_0x32aa('0x7'));var sox=require(_0x32aa('0x8'));var csv=require(_0x32aa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32aa('0xa'));var _=require(_0x32aa('0xb'));var squel=require(_0x32aa('0xc'));var crypto=require(_0x32aa('0xd'));var jsforce=require(_0x32aa('0xe'));var deskjs=require(_0x32aa('0xf'));var toCsv=require(_0x32aa('0x9'));var querystring=require(_0x32aa('0x10'));var Papa=require('papaparse');var Redis=require(_0x32aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x32aa('0x12'));var as=require(_0x32aa('0x13'));var hardwareService=require(_0x32aa('0x14'));var logger=require(_0x32aa('0x15'))('api');var utils=require(_0x32aa('0x16'));var config=require(_0x32aa('0x17'));var licenseUtil=require(_0x32aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d341f,_0x32aca0){_0x32aca0=_0x32aca0||0xcc;return function(_0x3640f9){if(_0x3640f9){return _0x3d341f[_0x32aa('0x19')](_0x32aca0);}return _0x3d341f[_0x32aa('0x1a')](_0x32aca0)[_0x32aa('0x1b')]();};}function respondWithResult(_0x5e96e3,_0x46758f){_0x46758f=_0x46758f||0xc8;return function(_0x58d625){if(_0x58d625){return _0x5e96e3[_0x32aa('0x1a')](_0x46758f)[_0x32aa('0x1c')](_0x58d625);}};}function respondWithFilteredResult(_0x1140a6,_0x2cc92d){return function(_0x211278){if(_0x211278){var _0x47eadd=typeof _0x2cc92d[_0x32aa('0x1d')]===_0x32aa('0x1e')&&typeof _0x2cc92d[_0x32aa('0x1f')]===_0x32aa('0x1e');var _0x29c1c4=_0x211278['count'];var _0x5196c0=_0x47eadd?0x0:_0x2cc92d[_0x32aa('0x1d')];var _0x34dcaf=_0x47eadd?_0x211278[_0x32aa('0x20')]:_0x2cc92d['offset']+_0x2cc92d['limit'];var _0x1a0262;if(_0x34dcaf>=_0x29c1c4){_0x34dcaf=_0x29c1c4;_0x1a0262=0xc8;}else{_0x1a0262=0xce;}_0x1140a6[_0x32aa('0x1a')](_0x1a0262);return _0x1140a6[_0x32aa('0x21')](_0x32aa('0x22'),_0x5196c0+'-'+_0x34dcaf+'/'+_0x29c1c4)[_0x32aa('0x1c')](_0x211278);}return null;};}function patchUpdates(_0x1cb0eb){return function(_0x5729af){try{jsonpatch[_0x32aa('0x23')](_0x5729af,_0x1cb0eb,!![]);}catch(_0x327831){return BPromise[_0x32aa('0x24')](_0x327831);}return _0x5729af[_0x32aa('0x25')]();};}function saveUpdates(_0x2aa421,_0x90d165){return function(_0x1ce405){if(_0x1ce405){return _0x1ce405[_0x32aa('0x26')](_0x2aa421)[_0x32aa('0x27')](function(_0x53c65a){return _0x53c65a;});}return null;};}function removeEntity(_0x4e66e6,_0x5c82d2){return function(_0x6766da){if(_0x6766da){return _0x6766da[_0x32aa('0x28')]()['then'](function(){_0x4e66e6['status'](0xcc)[_0x32aa('0x1b')]();});}};}function handleEntityNotFound(_0x313930,_0x3ba6b2){return function(_0x13d610){if(!_0x13d610){_0x313930[_0x32aa('0x19')](0x194);}return _0x13d610;};}function handleError(_0x3606ae,_0x27df0e){_0x27df0e=_0x27df0e||0x1f4;return function(_0x405b03){logger[_0x32aa('0x29')](_0x405b03['stack']);if(_0x405b03[_0x32aa('0x2a')]){delete _0x405b03[_0x32aa('0x2a')];}_0x3606ae['status'](_0x27df0e)[_0x32aa('0x2b')](_0x405b03);};}exports['index']=function(_0x4f73d1,_0x21d730){var _0x212ee4={},_0x1d1c80={},_0x11c818={'count':0x0,'rows':[]};var _0x5903b8=_[_0x32aa('0x2c')](db[_0x32aa('0x2d')][_0x32aa('0x2e')],function(_0x29706e){return{'name':_0x29706e[_0x32aa('0x2f')],'type':_0x29706e[_0x32aa('0x30')]['key']};});_0x1d1c80['model']=_[_0x32aa('0x2c')](_0x5903b8,_0x32aa('0x2a'));_0x1d1c80[_0x32aa('0x31')]=_[_0x32aa('0x32')](_0x4f73d1['query']);_0x1d1c80['filters']=_[_0x32aa('0x33')](_0x1d1c80['model'],_0x1d1c80[_0x32aa('0x31')]);_0x212ee4[_0x32aa('0x34')]=_['intersection'](_0x1d1c80[_0x32aa('0x35')],qs[_0x32aa('0x36')](_0x4f73d1['query'][_0x32aa('0x36')]));_0x212ee4[_0x32aa('0x34')]=_0x212ee4[_0x32aa('0x34')][_0x32aa('0x37')]?_0x212ee4[_0x32aa('0x34')]:_0x1d1c80[_0x32aa('0x35')];if(!_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x38')](_0x32aa('0x39'))){_0x212ee4[_0x32aa('0x1f')]=qs[_0x32aa('0x1f')](_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x1f')]);_0x212ee4[_0x32aa('0x1d')]=qs['offset'](_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x1d')]);}_0x212ee4[_0x32aa('0x3a')]=qs[_0x32aa('0x3b')](_0x4f73d1[_0x32aa('0x31')]['sort']);_0x212ee4[_0x32aa('0x3c')]=qs[_0x32aa('0x3d')](_[_0x32aa('0x3e')](_0x4f73d1[_0x32aa('0x31')],_0x1d1c80[_0x32aa('0x3d')]),_0x5903b8);if(_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x3f')]){_0x212ee4[_0x32aa('0x3c')]=_[_0x32aa('0x40')](_0x212ee4[_0x32aa('0x3c')],{'$or':_[_0x32aa('0x2c')](_0x5903b8,function(_0x563a74){if(_0x563a74['type']!==_0x32aa('0x41')){var _0x3c4fb6={};_0x3c4fb6[_0x563a74[_0x32aa('0x2a')]]={'$like':'%'+_0x4f73d1[_0x32aa('0x31')][_0x32aa('0x3f')]+'%'};return _0x3c4fb6;}})});}_0x212ee4=_[_0x32aa('0x40')]({},_0x212ee4,_0x4f73d1[_0x32aa('0x42')]);var _0x555a83={'where':_0x212ee4[_0x32aa('0x3c')]};return db[_0x32aa('0x2d')][_0x32aa('0x20')](_0x555a83)[_0x32aa('0x27')](function(_0x517614){_0x11c818[_0x32aa('0x20')]=_0x517614;if(_0x4f73d1['query'][_0x32aa('0x43')]){_0x212ee4[_0x32aa('0x44')]=[{'all':!![]}];}return db[_0x32aa('0x2d')][_0x32aa('0x45')](_0x212ee4);})[_0x32aa('0x27')](function(_0x5c4052){_0x11c818[_0x32aa('0x46')]=_0x5c4052;return _0x11c818;})[_0x32aa('0x27')](respondWithFilteredResult(_0x21d730,_0x212ee4))[_0x32aa('0x47')](handleError(_0x21d730,null));};exports[_0x32aa('0x48')]=function(_0x4fb0f4,_0x142572){var _0x483a04={'raw':!![],'where':{'id':_0x4fb0f4[_0x32aa('0x49')]['id']}},_0x1640f3={};_0x1640f3['model']=_[_0x32aa('0x32')](db[_0x32aa('0x2d')][_0x32aa('0x2e')]);_0x1640f3[_0x32aa('0x31')]=_[_0x32aa('0x32')](_0x4fb0f4[_0x32aa('0x31')]);_0x1640f3[_0x32aa('0x3d')]=_[_0x32aa('0x33')](_0x1640f3['model'],_0x1640f3['query']);_0x483a04[_0x32aa('0x34')]=_[_0x32aa('0x33')](_0x1640f3[_0x32aa('0x35')],qs[_0x32aa('0x36')](_0x4fb0f4[_0x32aa('0x31')]['fields']));_0x483a04[_0x32aa('0x34')]=_0x483a04[_0x32aa('0x34')][_0x32aa('0x37')]?_0x483a04['attributes']:_0x1640f3[_0x32aa('0x35')];if(_0x4fb0f4['query']['includeAll']){_0x483a04[_0x32aa('0x44')]=[{'all':!![]}];}_0x483a04=_[_0x32aa('0x40')]({},_0x483a04,_0x4fb0f4[_0x32aa('0x42')]);return db['WhatsappApplication']['find'](_0x483a04)[_0x32aa('0x27')](handleEntityNotFound(_0x142572,null))[_0x32aa('0x27')](respondWithResult(_0x142572,null))[_0x32aa('0x47')](handleError(_0x142572,null));};exports[_0x32aa('0x4a')]=function(_0x10078d,_0x1bb782){return db[_0x32aa('0x2d')][_0x32aa('0x4a')](_0x10078d[_0x32aa('0x4b')],{})[_0x32aa('0x27')](respondWithResult(_0x1bb782,0xc9))[_0x32aa('0x47')](handleError(_0x1bb782,null));};exports[_0x32aa('0x26')]=function(_0x75bd4,_0x1955dc){if(_0x75bd4['body']['id']){delete _0x75bd4['body']['id'];}return db[_0x32aa('0x2d')][_0x32aa('0x4c')]({'where':{'id':_0x75bd4[_0x32aa('0x49')]['id']}})[_0x32aa('0x27')](handleEntityNotFound(_0x1955dc,null))[_0x32aa('0x27')](saveUpdates(_0x75bd4[_0x32aa('0x4b')],null))[_0x32aa('0x27')](respondWithResult(_0x1955dc,null))[_0x32aa('0x47')](handleError(_0x1955dc,null));};exports['destroy']=function(_0x5573f7,_0x7115ef){return db['WhatsappApplication']['find']({'where':{'id':_0x5573f7[_0x32aa('0x49')]['id']}})[_0x32aa('0x27')](handleEntityNotFound(_0x7115ef,null))[_0x32aa('0x27')](removeEntity(_0x7115ef,null))[_0x32aa('0x47')](handleError(_0x7115ef,null));}; \ No newline at end of file +var _0x6afc=['rows','show','params','rawAttributes','find','catch','create','body','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappApplication','type','key','query','intersection','model','attributes','fields','length','nolimit','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6afc,0x16b));var _0xc6af=function(_0x4cb81e,_0x532c13){_0x4cb81e=_0x4cb81e-0x0;var _0x3e9928=_0x6afc[_0x4cb81e];return _0x3e9928;};'use strict';var emlformat=require(_0xc6af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6af('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6af('0x2'));var moment=require(_0xc6af('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc6af('0x4'));var util=require(_0xc6af('0x5'));var path=require(_0xc6af('0x6'));var sox=require(_0xc6af('0x7'));var csv=require('to-csv');var ejs=require(_0xc6af('0x8'));var fs=require('fs');var fs_extra=require(_0xc6af('0x9'));var _=require(_0xc6af('0xa'));var squel=require(_0xc6af('0xb'));var crypto=require(_0xc6af('0xc'));var jsforce=require(_0xc6af('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc6af('0xe'));var querystring=require(_0xc6af('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc6af('0x10'));var qs=require(_0xc6af('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6af('0x12'));var logger=require(_0xc6af('0x13'))(_0xc6af('0x14'));var utils=require('../../config/utils');var config=require(_0xc6af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6af('0x16'))['db'];function respondWithStatusCode(_0x73a18b,_0x249554){_0x249554=_0x249554||0xcc;return function(_0x34c2f8){if(_0x34c2f8){return _0x73a18b[_0xc6af('0x17')](_0x249554);}return _0x73a18b[_0xc6af('0x18')](_0x249554)[_0xc6af('0x19')]();};}function respondWithResult(_0x2c8d30,_0x48be31){_0x48be31=_0x48be31||0xc8;return function(_0xb2f967){if(_0xb2f967){return _0x2c8d30[_0xc6af('0x18')](_0x48be31)[_0xc6af('0x1a')](_0xb2f967);}};}function respondWithFilteredResult(_0x2ef663,_0x12087d){return function(_0x165fea){if(_0x165fea){var _0x2a4b88=typeof _0x12087d[_0xc6af('0x1b')]===_0xc6af('0x1c')&&typeof _0x12087d[_0xc6af('0x1d')]===_0xc6af('0x1c');var _0x22366d=_0x165fea[_0xc6af('0x1e')];var _0x5dde9d=_0x2a4b88?0x0:_0x12087d[_0xc6af('0x1b')];var _0x3d75b8=_0x2a4b88?_0x165fea['count']:_0x12087d[_0xc6af('0x1b')]+_0x12087d[_0xc6af('0x1d')];var _0x28f9a9;if(_0x3d75b8>=_0x22366d){_0x3d75b8=_0x22366d;_0x28f9a9=0xc8;}else{_0x28f9a9=0xce;}_0x2ef663['status'](_0x28f9a9);return _0x2ef663[_0xc6af('0x1f')]('Content-Range',_0x5dde9d+'-'+_0x3d75b8+'/'+_0x22366d)[_0xc6af('0x1a')](_0x165fea);}return null;};}function patchUpdates(_0x488ca4){return function(_0xdd5f5b){try{jsonpatch[_0xc6af('0x20')](_0xdd5f5b,_0x488ca4,!![]);}catch(_0x1085b2){return BPromise[_0xc6af('0x21')](_0x1085b2);}return _0xdd5f5b[_0xc6af('0x22')]();};}function saveUpdates(_0x1e1ae,_0x85cc2c){return function(_0x1e0e37){if(_0x1e0e37){return _0x1e0e37[_0xc6af('0x23')](_0x1e1ae)[_0xc6af('0x24')](function(_0x3438aa){return _0x3438aa;});}return null;};}function removeEntity(_0x4bf7bf,_0x128933){return function(_0x4b1b68){if(_0x4b1b68){return _0x4b1b68[_0xc6af('0x25')]()[_0xc6af('0x24')](function(){_0x4bf7bf[_0xc6af('0x18')](0xcc)[_0xc6af('0x19')]();});}};}function handleEntityNotFound(_0x2f24c0,_0x5c844a){return function(_0x430795){if(!_0x430795){_0x2f24c0[_0xc6af('0x17')](0x194);}return _0x430795;};}function handleError(_0x35bb97,_0x38d134){_0x38d134=_0x38d134||0x1f4;return function(_0x4f931c){logger[_0xc6af('0x26')](_0x4f931c['stack']);if(_0x4f931c[_0xc6af('0x27')]){delete _0x4f931c[_0xc6af('0x27')];}_0x35bb97[_0xc6af('0x18')](_0x38d134)[_0xc6af('0x28')](_0x4f931c);};}exports[_0xc6af('0x29')]=function(_0x16c169,_0x4b98c8){var _0x1eabaa={},_0xf09541={},_0x173abf={'count':0x0,'rows':[]};var _0x165b64=_[_0xc6af('0x2a')](db[_0xc6af('0x2b')]['rawAttributes'],function(_0x3d8f1d){return{'name':_0x3d8f1d['fieldName'],'type':_0x3d8f1d[_0xc6af('0x2c')][_0xc6af('0x2d')]};});_0xf09541['model']=_[_0xc6af('0x2a')](_0x165b64,_0xc6af('0x27'));_0xf09541[_0xc6af('0x2e')]=_['keys'](_0x16c169[_0xc6af('0x2e')]);_0xf09541['filters']=_[_0xc6af('0x2f')](_0xf09541[_0xc6af('0x30')],_0xf09541['query']);_0x1eabaa[_0xc6af('0x31')]=_[_0xc6af('0x2f')](_0xf09541[_0xc6af('0x30')],qs['fields'](_0x16c169[_0xc6af('0x2e')][_0xc6af('0x32')]));_0x1eabaa['attributes']=_0x1eabaa[_0xc6af('0x31')][_0xc6af('0x33')]?_0x1eabaa[_0xc6af('0x31')]:_0xf09541[_0xc6af('0x30')];if(!_0x16c169[_0xc6af('0x2e')]['hasOwnProperty'](_0xc6af('0x34'))){_0x1eabaa['limit']=qs[_0xc6af('0x1d')](_0x16c169[_0xc6af('0x2e')][_0xc6af('0x1d')]);_0x1eabaa[_0xc6af('0x1b')]=qs[_0xc6af('0x1b')](_0x16c169['query'][_0xc6af('0x1b')]);}_0x1eabaa['order']=qs[_0xc6af('0x35')](_0x16c169[_0xc6af('0x2e')][_0xc6af('0x35')]);_0x1eabaa['where']=qs[_0xc6af('0x36')](_['pick'](_0x16c169[_0xc6af('0x2e')],_0xf09541['filters']),_0x165b64);if(_0x16c169[_0xc6af('0x2e')][_0xc6af('0x37')]){_0x1eabaa[_0xc6af('0x38')]=_['merge'](_0x1eabaa[_0xc6af('0x38')],{'$or':_[_0xc6af('0x2a')](_0x165b64,function(_0xf683ee){if(_0xf683ee[_0xc6af('0x2c')]!==_0xc6af('0x39')){var _0x257fd4={};_0x257fd4[_0xf683ee[_0xc6af('0x27')]]={'$like':'%'+_0x16c169[_0xc6af('0x2e')][_0xc6af('0x37')]+'%'};return _0x257fd4;}})});}_0x1eabaa=_[_0xc6af('0x3a')]({},_0x1eabaa,_0x16c169[_0xc6af('0x3b')]);var _0xf6098f={'where':_0x1eabaa[_0xc6af('0x38')]};return db[_0xc6af('0x2b')]['count'](_0xf6098f)[_0xc6af('0x24')](function(_0x51d257){_0x173abf[_0xc6af('0x1e')]=_0x51d257;if(_0x16c169[_0xc6af('0x2e')][_0xc6af('0x3c')]){_0x1eabaa[_0xc6af('0x3d')]=[{'all':!![]}];}return db[_0xc6af('0x2b')][_0xc6af('0x3e')](_0x1eabaa);})[_0xc6af('0x24')](function(_0x143e39){_0x173abf[_0xc6af('0x3f')]=_0x143e39;return _0x173abf;})[_0xc6af('0x24')](respondWithFilteredResult(_0x4b98c8,_0x1eabaa))['catch'](handleError(_0x4b98c8,null));};exports[_0xc6af('0x40')]=function(_0x1057ce,_0x46897d){var _0x365b48={'raw':!![],'where':{'id':_0x1057ce[_0xc6af('0x41')]['id']}},_0xcac00f={};_0xcac00f[_0xc6af('0x30')]=_['keys'](db['WhatsappApplication'][_0xc6af('0x42')]);_0xcac00f[_0xc6af('0x2e')]=_['keys'](_0x1057ce[_0xc6af('0x2e')]);_0xcac00f[_0xc6af('0x36')]=_['intersection'](_0xcac00f[_0xc6af('0x30')],_0xcac00f[_0xc6af('0x2e')]);_0x365b48[_0xc6af('0x31')]=_['intersection'](_0xcac00f['model'],qs['fields'](_0x1057ce['query'][_0xc6af('0x32')]));_0x365b48[_0xc6af('0x31')]=_0x365b48[_0xc6af('0x31')]['length']?_0x365b48[_0xc6af('0x31')]:_0xcac00f[_0xc6af('0x30')];if(_0x1057ce[_0xc6af('0x2e')][_0xc6af('0x3c')]){_0x365b48['include']=[{'all':!![]}];}_0x365b48=_['merge']({},_0x365b48,_0x1057ce['options']);return db[_0xc6af('0x2b')][_0xc6af('0x43')](_0x365b48)[_0xc6af('0x24')](handleEntityNotFound(_0x46897d,null))[_0xc6af('0x24')](respondWithResult(_0x46897d,null))[_0xc6af('0x44')](handleError(_0x46897d,null));};exports[_0xc6af('0x45')]=function(_0x15ffb2,_0x251311){return db['WhatsappApplication'][_0xc6af('0x45')](_0x15ffb2[_0xc6af('0x46')],{})['then'](respondWithResult(_0x251311,0xc9))[_0xc6af('0x44')](handleError(_0x251311,null));};exports[_0xc6af('0x23')]=function(_0x1696b3,_0x50c1b0){if(_0x1696b3[_0xc6af('0x46')]['id']){delete _0x1696b3['body']['id'];}return db[_0xc6af('0x2b')][_0xc6af('0x43')]({'where':{'id':_0x1696b3[_0xc6af('0x41')]['id']}})[_0xc6af('0x24')](handleEntityNotFound(_0x50c1b0,null))[_0xc6af('0x24')](saveUpdates(_0x1696b3[_0xc6af('0x46')],null))[_0xc6af('0x24')](respondWithResult(_0x50c1b0,null))[_0xc6af('0x44')](handleError(_0x50c1b0,null));};exports[_0xc6af('0x25')]=function(_0x47e83c,_0xc2219f){return db[_0xc6af('0x2b')][_0xc6af('0x43')]({'where':{'id':_0x47e83c[_0xc6af('0x41')]['id']}})['then'](handleEntityNotFound(_0xc2219f,null))[_0xc6af('0x24')](removeEntity(_0xc2219f,null))[_0xc6af('0x44')](handleError(_0xc2219f,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c2608fe..7974a8e 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 _0x4d9e=['lodash','api','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x439ac5,_0x2f9dd1){var _0x5a71df=function(_0x393fd){while(--_0x393fd){_0x439ac5['push'](_0x439ac5['shift']());}};_0x5a71df(++_0x2f9dd1);}(_0x4d9e,0x18c));var _0xe4d9=function(_0xd5616,_0x2d8fd9){_0xd5616=_0xd5616-0x0;var _0x557700=_0x4d9e[_0xd5616];return _0x557700;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe4d9('0x1'));var moment=require('moment');var BPromise=require(_0xe4d9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4d9('0x3'));var rimraf=require(_0xe4d9('0x4'));var config=require('../../config/environment');var attributes=require(_0xe4d9('0x5'));module[_0xe4d9('0x6')]=function(_0x278035,_0x34c2a2){return _0x278035[_0xe4d9('0x7')](_0xe4d9('0x8'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe4d9('0x9'),'collate':_0xe4d9('0xa')});}; \ No newline at end of file +var _0x815b=['./whatsappApplication.attributes','exports','define','whatsapp_applications','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x5ce658,_0x504f56){var _0x3fe0f0=function(_0x579f73){while(--_0x579f73){_0x5ce658['push'](_0x5ce658['shift']());}};_0x3fe0f0(++_0x504f56);}(_0x815b,0xb4));var _0xb815=function(_0x47bf41,_0x522307){_0x47bf41=_0x47bf41-0x0;var _0x4c3d96=_0x815b[_0x47bf41];return _0x4c3d96;};'use strict';var _=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var logger=require(_0xb815('0x2'))(_0xb815('0x3'));var moment=require(_0xb815('0x4'));var BPromise=require('bluebird');var rp=require(_0xb815('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb815('0x6'));var attributes=require(_0xb815('0x7'));module[_0xb815('0x8')]=function(_0x5a5c18,_0x466899){return _0x5a5c18[_0xb815('0x9')]('WhatsappApplication',attributes,{'tableName':_0xb815('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 710c346..470821a 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 _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x36f5b7,_0x1514ca){var _0x495dfb=function(_0xace77){while(--_0xace77){_0x36f5b7['push'](_0x36f5b7['shift']());}};_0x495dfb(++_0x1514ca);}(_0xe14d,0x1ee));var _0xde14=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xe14d[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappApplication,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x487595,_0xc11a77){var _0x43b7fb=function(_0x2a3146){while(--_0x2a3146){_0x487595['push'](_0x487595['shift']());}};_0x43b7fb(++_0xc11a77);}(_0x4b84,0x1cc));var _0x44b8=function(_0x52a857,_0xc99fa1){_0x52a857=_0x52a857-0x0;var _0x4e2aae=_0x4b84[_0x52a857];return _0x4e2aae;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('WhatsappApplication,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index d027504..cf9821a 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 _0x0e4b=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','express','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x25a319,_0x58c414){var _0x153b10=function(_0x4cdc02){while(--_0x4cdc02){_0x25a319['push'](_0x25a319['shift']());}};_0x153b10(++_0x58c414);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x59d8dc,_0x4aa442){_0x59d8dc=_0x59d8dc-0x0;var _0x5375e6=_0x0e4b[_0x59d8dc];return _0x5375e6;};'use strict';var multer=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var path=require(_0xb0e4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0e4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb0e4('0x4'));var controller=require(_0xb0e4('0x5'));router['get']('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x7')]);router[_0xb0e4('0x8')](_0xb0e4('0x9'),auth[_0xb0e4('0x6')](),controller['describe']);router['get'](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xb')]);router[_0xb0e4('0x8')](_0xb0e4('0xc'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xd')]);router[_0xb0e4('0x8')](_0xb0e4('0xe'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xf')]);router[_0xb0e4('0x10')]('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x11')]);router[_0xb0e4('0x10')]('/:id/messages',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x12')]);router['post'](_0xb0e4('0x13'),auth[_0xb0e4('0x6')](),interaction[_0xb0e4('0x14')](_0xb0e4('0x15'),_0xb0e4('0x16')),controller['addTags']);router['put'](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),interaction['tracked'](_0xb0e4('0x15'),_0xb0e4('0x17')),controller[_0xb0e4('0x18')]);router[_0xb0e4('0x19')](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0xb0e4('0x1a')]);router[_0xb0e4('0x19')](_0xb0e4('0x13'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x1b')]);module[_0xb0e4('0x1c')]=router; \ No newline at end of file +var _0x44e8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','delete','/:id/tags','removeTags','exports','multer','connect-timeout'];(function(_0x507527,_0x3d1f6e){var _0x2dec80=function(_0x5c1e5f){while(--_0x5c1e5f){_0x507527['push'](_0x507527['shift']());}};_0x2dec80(++_0x3d1f6e);}(_0x44e8,0xd7));var _0x844e=function(_0x4dfd56,_0x268ecc){_0x4dfd56=_0x4dfd56-0x0;var _0x25d67b=_0x44e8[_0x4dfd56];return _0x25d67b;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['describe']);router[_0x844e('0x8')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0x8')](_0x844e('0xe'),auth['isAuthenticated'](),controller[_0x844e('0xf')]);router[_0x844e('0x8')](_0x844e('0x10'),auth[_0x844e('0xb')](),controller[_0x844e('0x11')]);router[_0x844e('0x12')]('/',auth[_0x844e('0xb')](),controller['create']);router[_0x844e('0x12')](_0x844e('0xe'),auth['isAuthenticated'](),controller[_0x844e('0x13')]);router[_0x844e('0x12')]('/:id/tags',auth[_0x844e('0xb')](),interaction[_0x844e('0x14')](_0x844e('0x15'),'whatsappinteraction:addtags'),controller[_0x844e('0x16')]);router[_0x844e('0x17')](_0x844e('0xc'),auth[_0x844e('0xb')](),interaction[_0x844e('0x14')](_0x844e('0x15'),_0x844e('0x18')),controller[_0x844e('0x19')]);router['delete'](_0x844e('0xc'),auth['isAuthenticated'](),interaction[_0x844e('0x14')]('whatsapp',_0x844e('0x1a')),controller['destroy']);router[_0x844e('0x1b')](_0x844e('0x1c'),auth[_0x844e('0xb')](),controller[_0x844e('0x1d')]);module[_0x844e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 586956d..f2f8b2e 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 _0x6a88=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0x6a88,0xa9));var _0x86a8=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0x6a88[_0x414297];return _0x51ea47;};'use strict';var Sequelize=require(_0x86a8('0x0'));var moment=require(_0x86a8('0x1'));module[_0x86a8('0x2')]={'closed':{'type':Sequelize[_0x86a8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x86a8('0x4')]},'disposition':{'type':Sequelize[_0x86a8('0x5')]},'secondDisposition':{'type':Sequelize[_0x86a8('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x86a8('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x86a8('0x6')]('in',_0x86a8('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x86a8('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc492=['exports','STRING','ENUM','DATE','BOOLEAN','sequelize','moment'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0xc492,0xd7));var _0x2c49=function(_0x503962,_0x2b34db){_0x503962=_0x503962-0x0;var _0x32e772=_0xc492[_0x503962];return _0x32e772;};'use strict';var Sequelize=require(_0x2c49('0x0'));var moment=require(_0x2c49('0x1'));module[_0x2c49('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2c49('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2c49('0x3')]},'phone':{'type':Sequelize[_0x2c49('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2c49('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2c49('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2c49('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2c49('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 711b73e..b82f0de 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 _0x0a25=['i.id','Sequelize','QueryTypes','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','WhatsappInteractionId','all','rows','catch','rawAttributes','includeAll','include','options','create','body','update','params','describe','addMessage','WhatsappMessage','omit','ids','getMessages','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','download','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','Account','mkdirSync','Whatsapp','Owner','N.A.','closed','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','index','WhatsappInteraction','type','model','keys','query','filters','intersection','fields','attributes','length','order','sort','pick','field','color','from','tools_tags','select','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x4c1ecb,_0x1b5c2b){var _0x5759e4=function(_0x52c2e0){while(--_0x52c2e0){_0x4c1ecb['push'](_0x4c1ecb['shift']());}};_0x5759e4(++_0x1b5c2b);}(_0x0a25,0x68));var _0x50a2=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0x0a25[_0xfad1a7];return _0x571012;};'use strict';var emlformat=require(_0x50a2('0x0'));var rimraf=require(_0x50a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50a2('0x2'));var rp=require(_0x50a2('0x3'));var moment=require('moment');var BPromise=require(_0x50a2('0x4'));var Mustache=require(_0x50a2('0x5'));var util=require(_0x50a2('0x6'));var path=require(_0x50a2('0x7'));var sox=require(_0x50a2('0x8'));var csv=require(_0x50a2('0x9'));var ejs=require(_0x50a2('0xa'));var fs=require('fs');var fs_extra=require(_0x50a2('0xb'));var _=require(_0x50a2('0xc'));var squel=require(_0x50a2('0xd'));var crypto=require(_0x50a2('0xe'));var jsforce=require(_0x50a2('0xf'));var deskjs=require(_0x50a2('0x10'));var toCsv=require(_0x50a2('0x9'));var querystring=require(_0x50a2('0x11'));var Papa=require(_0x50a2('0x12'));var Redis=require(_0x50a2('0x13'));var authService=require(_0x50a2('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x50a2('0x15'));var pdf=require(_0x50a2('0x16'));var hardwareService=require(_0x50a2('0x17'));var logger=require(_0x50a2('0x18'))(_0x50a2('0x19'));var utils=require(_0x50a2('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x50a2('0x1b'));var db=require(_0x50a2('0x1c'))['db'];config[_0x50a2('0x1d')]=_[_0x50a2('0x1e')](config[_0x50a2('0x1d')],{'host':_0x50a2('0x1f'),'port':0x18eb});var socket=require(_0x50a2('0x20'))(new Redis(config[_0x50a2('0x1d')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x535230,_0x2dede9){_0x2dede9=_0x2dede9||0xcc;return function(_0x1aaf13){if(_0x1aaf13){return _0x535230[_0x50a2('0x21')](_0x2dede9);}return _0x535230['status'](_0x2dede9)[_0x50a2('0x22')]();};}function respondWithResult(_0x1e3b00,_0x20f00d){_0x20f00d=_0x20f00d||0xc8;return function(_0x922ce8){if(_0x922ce8){return _0x1e3b00[_0x50a2('0x23')](_0x20f00d)[_0x50a2('0x24')](_0x922ce8);}};}function respondWithFilteredResult(_0x399523,_0x5934d3){return function(_0x37301f){if(_0x37301f){var _0x3987d5=typeof _0x5934d3[_0x50a2('0x25')]===_0x50a2('0x26')&&typeof _0x5934d3[_0x50a2('0x27')]===_0x50a2('0x26');var _0x57c97b=_0x37301f[_0x50a2('0x28')];var _0x4f0d53=_0x3987d5?0x0:_0x5934d3[_0x50a2('0x25')];var _0x43daf1=_0x3987d5?_0x37301f[_0x50a2('0x28')]:_0x5934d3[_0x50a2('0x25')]+_0x5934d3['limit'];var _0x5afc6d;if(_0x43daf1>=_0x57c97b){_0x43daf1=_0x57c97b;_0x5afc6d=0xc8;}else{_0x5afc6d=0xce;}_0x399523[_0x50a2('0x23')](_0x5afc6d);return _0x399523[_0x50a2('0x29')](_0x50a2('0x2a'),_0x4f0d53+'-'+_0x43daf1+'/'+_0x57c97b)[_0x50a2('0x24')](_0x37301f);}return null;};}function patchUpdates(_0x5e5e1e){return function(_0xf093f8){try{jsonpatch[_0x50a2('0x2b')](_0xf093f8,_0x5e5e1e,!![]);}catch(_0x2c0f50){return BPromise[_0x50a2('0x2c')](_0x2c0f50);}return _0xf093f8[_0x50a2('0x2d')]();};}function saveUpdates(_0x33ed8b,_0x4a65d3){return function(_0x1827dc){if(_0x1827dc){return _0x1827dc['update'](_0x33ed8b)[_0x50a2('0x2e')](function(_0xc0c44f){return _0xc0c44f;});}return null;};}function removeEntity(_0x2e9769,_0x3b034f){return function(_0xf54ae){if(_0xf54ae){return _0xf54ae[_0x50a2('0x2f')]()[_0x50a2('0x2e')](function(){_0x2e9769[_0x50a2('0x23')](0xcc)[_0x50a2('0x22')]();});}};}function handleEntityNotFound(_0x1295d4,_0x534c10){return function(_0x193132){if(!_0x193132){_0x1295d4[_0x50a2('0x21')](0x194);}return _0x193132;};}function handleError(_0x40d633,_0x492fa1){_0x492fa1=_0x492fa1||0x1f4;return function(_0x2bec60){logger[_0x50a2('0x30')](_0x2bec60[_0x50a2('0x31')]);if(_0x2bec60[_0x50a2('0x32')]){delete _0x2bec60[_0x50a2('0x32')];}_0x40d633[_0x50a2('0x23')](_0x492fa1)[_0x50a2('0x33')](_0x2bec60);};}function getInteractionUsers(_0x17d167,_0x342e01){return new BPromise(function(_0x2a60ad,_0x5c9642){try{if(_0x342e01[_0x17d167['id']]){_0x17d167['Users']=_[_0x50a2('0x34')](_0x342e01[_0x17d167['id']],function(_0x30e3ef){return{'id':_0x30e3ef['id'],'fullname':_0x30e3ef[_0x50a2('0x35')]};});}}catch(_0x49dc45){_0x5c9642(_0x49dc45);}_0x2a60ad(_0x17d167);});}function getInteractionTags(_0x2a1917,_0x4e0e3d){return new BPromise(function(_0x2fef3d,_0x4f6e11){try{if(_0x2a1917[_0x50a2('0x36')]){_0x2a1917[_0x50a2('0x37')]=[];_0x2a1917['TagIds'][_0x50a2('0x38')](',')[_0x50a2('0x39')](function(_0x328266){_0x2a1917[_0x50a2('0x37')][_0x50a2('0x3a')](_0x4e0e3d[_0x328266]);});}delete _0x2a1917['TagIds'];}catch(_0x517879){_0x4f6e11(_0x517879);}_0x2fef3d(_0x2a1917);});}function updateWhatsappInteraction(_0x58a4d4,_0x1cfd3a,_0x1af6c5){return new BPromise(function(_0x2295d1,_0x106f16){return getInteractionUsers(_0x58a4d4,_0x1af6c5)['then'](function(_0x3df980){return getInteractionTags(_0x3df980,_0x1cfd3a);})[_0x50a2('0x2e')](function(_0x5b56f0){_0x2295d1(_0x5b56f0);})['catch'](function(_0x64df2e){_0x106f16(_0x64df2e);});});}exports[_0x50a2('0x3b')]=function(_0x6aa24d,_0x5db6cf){var _0x28b310={},_0x46fff6={},_0x50ab1a={'count':0x0,'rows':[]};var _0x4e5d14=_['map'](db[_0x50a2('0x3c')]['rawAttributes'],function(_0x13521b){return{'name':_0x13521b['fieldName'],'type':_0x13521b[_0x50a2('0x3d')]['key']};});_0x46fff6[_0x50a2('0x3e')]=_[_0x50a2('0x34')](_0x4e5d14,_0x50a2('0x32'));_0x46fff6['query']=_[_0x50a2('0x3f')](_0x6aa24d[_0x50a2('0x40')]);_0x46fff6[_0x50a2('0x41')]=_[_0x50a2('0x42')](_0x46fff6[_0x50a2('0x3e')],_0x46fff6[_0x50a2('0x40')]);_0x28b310['attributes']=_[_0x50a2('0x42')](_0x46fff6[_0x50a2('0x3e')],qs['fields'](_0x6aa24d['query'][_0x50a2('0x43')]));_0x28b310[_0x50a2('0x44')]=_0x28b310[_0x50a2('0x44')][_0x50a2('0x45')]?_0x28b310['attributes']:_0x46fff6[_0x50a2('0x3e')];if(!_0x6aa24d[_0x50a2('0x40')]['hasOwnProperty']('nolimit')){_0x28b310['limit']=qs['limit'](_0x6aa24d[_0x50a2('0x40')]['limit']);_0x28b310['offset']=qs[_0x50a2('0x25')](_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x25')]);}_0x28b310[_0x50a2('0x46')]=qs[_0x50a2('0x47')](_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x47')]);_0x28b310['where']=qs[_0x50a2('0x41')](_[_0x50a2('0x48')](_0x6aa24d[_0x50a2('0x40')],_0x46fff6[_0x50a2('0x41')]),_0x4e5d14);var _0x5a54fa=[];var _0xf7e280=squel['select']()[_0x50a2('0x49')]('id')[_0x50a2('0x49')](_0x50a2('0x32'))['field'](_0x50a2('0x4a'))[_0x50a2('0x4b')](_0x50a2('0x4c'));var _0x4b8890=squel[_0x50a2('0x4d')]()[_0x50a2('0x49')]('u.id')[_0x50a2('0x49')](_0x50a2('0x4e'))[_0x50a2('0x49')](_0x50a2('0x4f'))[_0x50a2('0x4b')](_0x50a2('0x50'),'ui')[_0x50a2('0x51')]('users','u','u.id\x20=\x20ui.UserId');var _0x453463=squel[_0x50a2('0x4d')]()[_0x50a2('0x4b')](_0x50a2('0x52'),'i')['left_join'](_0x50a2('0x53'),'c',_0x50a2('0x54'))[_0x50a2('0x51')](_0x50a2('0x55'),'o','o.id\x20=\x20i.UserId')[_0x50a2('0x51')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x50a2('0x51')]('whatsapp_messages','me',_0x50a2('0x56'))[_0x50a2('0x51')](_0x50a2('0x57'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x50a2('0x51')](_0x50a2('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x1aa8d6=squel[_0x50a2('0x58')]();var _0x4a0016=[];var _0x3b8167=squel[_0x50a2('0x58')]();var _0x1905bc;if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x59')]){_0x1905bc=as[_0x50a2('0x5a')](_0x6aa24d[_0x50a2('0x40')]['search']);var _0x34139f=_0x1905bc[_0x50a2('0x5b')];for(var _0x38fc18=0x0;_0x38fc18<_0x1905bc[_0x50a2('0x5c')]['length'];_0x38fc18++){var _0x40d14d=_0x1905bc[_0x50a2('0x5c')][_0x38fc18];var _0x1d844d='i';var _0x42bf48=_[_0x50a2('0x5d')](_0x4e5d14,[_0x50a2('0x32'),_0x40d14d[_0x50a2('0x49')]]);if(!_0x42bf48){switch(_0x40d14d[_0x50a2('0x49')]){case _0x50a2('0x5e'):if(_0x40d14d[_0x50a2('0x5f')]==0x1){_0x453463['having']('`'+_0x40d14d[_0x50a2('0x49')]+_0x50a2('0x60'));}else{_0x453463[_0x50a2('0x61')]('`'+_0x40d14d[_0x50a2('0x49')]+_0x50a2('0x62'));}break;case _0x50a2('0x63'):if(_0x40d14d[_0x50a2('0x64')]===_0x50a2('0x65')){if(_0x40d14d[_0x50a2('0x5f')]['split']('\x20')['length']>0x1){_0x1aa8d6[_0x34139f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x50a2('0x66')](_0x40d14d['value']),null);}else{var _0x2995ad='%'+_0x40d14d['value']+'%';_0x1aa8d6[_0x34139f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2995ad,_0x2995ad,_0x2995ad);}}else{_0x42bf48=_['find'](_0x4e5d14,[_0x50a2('0x32'),_0x50a2('0x67')]);_0x40d14d[_0x50a2('0x49')]=_0x50a2('0x67');_0x556482=as[_0x50a2('0x68')](_0x1d844d,_0x42bf48[_0x50a2('0x3d')],_0x40d14d);_0x1aa8d6[_0x34139f](_0x556482[_0x50a2('0x69')],_0x556482['value']['start'],_0x556482[_0x50a2('0x5f')][_0x50a2('0x22')]);}break;case _0x50a2('0x6a'):var _0x1dcbb2=_0x40d14d[_0x50a2('0x5f')][_0x50a2('0x38')](',')[_0x50a2('0x34')](function(_0xd52efb){return Number(_0xd52efb);});_0x1dcbb2[_0x50a2('0x39')](function(_0x4c7d9c){_0x3b8167['or'](_0x50a2('0x6b'),'%,'+_0x4c7d9c+',%');});_0x4a0016=_['union'](_0x4a0016,_0x1dcbb2);break;case'User':if(_0x40d14d[_0x50a2('0x64')]===_0x50a2('0x65')){_0x1aa8d6[_0x34139f](_0x50a2('0x6c'),'%'+_0x40d14d[_0x50a2('0x5f')]+'%',null);}else{_0x42bf48=_['find'](_0x4e5d14,[_0x50a2('0x32'),_0x50a2('0x6d')]);_0x40d14d[_0x50a2('0x49')]='UserId';_0x556482=as[_0x50a2('0x68')](_0x1d844d,_0x42bf48[_0x50a2('0x3d')],_0x40d14d);_0x1aa8d6[_0x34139f](_0x556482[_0x50a2('0x69')],_0x556482[_0x50a2('0x5f')][_0x50a2('0x6e')],_0x556482['value'][_0x50a2('0x22')]);}break;case'body':_0x556482=as['buildExpression']('me',null,_0x40d14d);_0x1aa8d6[_0x34139f](_0x556482[_0x50a2('0x69')],_0x556482[_0x50a2('0x5f')]['start'],_0x556482['value'][_0x50a2('0x22')]);break;}}else{var _0x556482=as[_0x50a2('0x68')](_0x1d844d,_0x42bf48[_0x50a2('0x3d')],_0x40d14d);_0x1aa8d6[_0x34139f](_0x556482[_0x50a2('0x69')],_0x556482[_0x50a2('0x5f')][_0x50a2('0x6e')],_0x556482['value'][_0x50a2('0x22')]);}}}else{var _0x3d9ed2=_(_0x6aa24d[_0x50a2('0x40')])['keys']()[_0x50a2('0x34')](function(_0xfe5820){return _[_0x50a2('0x6f')](_0x4e5d14,[_0x50a2('0x32'),_0xfe5820])?_0xfe5820:undefined;})[_0x50a2('0x70')]()['value']();if(!_[_0x50a2('0x71')](_0x3d9ed2)){_0x3d9ed2['forEach'](function(_0x16ddfb){if(_0x16ddfb===_0x50a2('0x72')){_0x453463[_0x50a2('0x73')](_0x50a2('0x74'),[][_0x50a2('0x75')](_0x6aa24d['query'][_0x16ddfb]));}else if(_0x16ddfb===_0x50a2('0x76')){var _0x35255c=JSON[_0x50a2('0x77')](_0x6aa24d[_0x50a2('0x40')][_0x16ddfb])['$gte'];var _0x1e1be0=JSON['parse'](_0x6aa24d[_0x50a2('0x40')][_0x16ddfb])[_0x50a2('0x78')];_0x453463[_0x50a2('0x73')](_0x50a2('0x79'),_0x35255c,_0x1e1be0);}else{if(_0x6aa24d[_0x50a2('0x40')][_0x16ddfb]===_0x50a2('0x7a')){_0x453463[_0x50a2('0x73')]('i.'+_0x16ddfb+'\x20IS\x20NULL');}else{_0x453463[_0x50a2('0x73')]('i.'+_0x16ddfb+_0x50a2('0x7b'),_0x6aa24d[_0x50a2('0x40')][_0x16ddfb]);}}});}if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x7c')]){if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x7c')]==0x1){_0x453463['having'](_0x50a2('0x7d'));}else{_0x453463[_0x50a2('0x61')](_0x50a2('0x7e'));}}if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x7f')]){_0x4a0016=_[_0x50a2('0x80')](_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x7f')])?_0x6aa24d['query'][_0x50a2('0x7f')]:new Array(_0x6aa24d['query'][_0x50a2('0x7f')]);_0x4a0016[_0x50a2('0x39')](function(_0x3915ba){_0x3b8167['or'](_0x50a2('0x6b'),'%,'+_0x3915ba+',%');});}if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x81')]){var _0x5a13e8=_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x81')][_0x50a2('0x82')]('\x5c','\x5c\x5c')[_0x50a2('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5a13e8)){_0x1aa8d6['or'](_0x50a2('0x83'),_0x5a13e8+'%')['or']('i.phone\x20LIKE\x20?',_0x5a13e8+'%');}else{_0x1aa8d6['or'](_0x50a2('0x84'),qs[_0x50a2('0x66')](_0x5a13e8))['or'](_0x50a2('0x85'),_0x5a13e8+'%');}}}_0x453463[_0x50a2('0x73')](_0x1aa8d6);_0x453463['group'](_0x50a2('0x86'));var _0x3509a1={'type':db[_0x50a2('0x87')][_0x50a2('0x88')]['SELECT'],'raw':!![]};var _0x24fadb=_0x453463['clone']();_0x24fadb[_0x50a2('0x49')]('i.id');_0x24fadb[_0x50a2('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x50a2('0x5e'));if(_0x28b310[_0x50a2('0x46')]){_0x28b310[_0x50a2('0x46')][_0x50a2('0x39')](function(_0x6c4dd3){var _0x407229=_0x6c4dd3[0x0]==='contactName'?_0x6c4dd3[0x0]:'i.'+_0x6c4dd3[0x0];_0x453463[_0x50a2('0x46')](_0x407229,_0x6c4dd3[0x1]===_0x50a2('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x4a0016)){_0x453463[_0x50a2('0x61')](_0x3b8167);_0x24fadb[_0x50a2('0x73')]('t.id\x20IN\x20?',_0x4a0016);}BPromise[_0x50a2('0x8a')]()[_0x50a2('0x2e')](function(){if(!_0x1905bc){if(_0x6aa24d['query'][_0x50a2('0x72')])return;_0x24fadb[_0x50a2('0x73')](_0x50a2('0x8b'));_0x453463[_0x50a2('0x73')](_0x50a2('0x8b'));return;}if(_0x6aa24d['user'][_0x50a2('0x8c')]!==_0x50a2('0x8d'))return;return _0x6aa24d[_0x50a2('0x8e')][_0x50a2('0x8f')]({'attributes':['id'],'raw':!![]})[_0x50a2('0x2e')](function(_0x428a55){if(_[_0x50a2('0x71')](_0x428a55)){_0x24fadb[_0x50a2('0x73')](_0x50a2('0x90'));_0x453463[_0x50a2('0x73')](_0x50a2('0x90'));}else{_0x24fadb[_0x50a2('0x73')]('i.WhatsappAccountId\x20IN\x20?',_[_0x50a2('0x34')](_0x428a55,'id'));_0x453463[_0x50a2('0x73')](_0x50a2('0x74'),_['map'](_0x428a55,'id'));}});})['then'](function(){if(_0x6aa24d[_0x50a2('0x8e')][_0x50a2('0x8c')]===_0x50a2('0x8d')&&!_0x1905bc&&!_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x72')])return[];return db[_0x50a2('0x91')][_0x50a2('0x40')](_0x24fadb[_0x50a2('0x92')](),_0x3509a1);})[_0x50a2('0x2e')](function(_0x249dd3){_0x50ab1a[_0x50a2('0x28')]=_0x249dd3['length'];if(_0x50ab1a[_0x50a2('0x28')]===0x0)return[];return db[_0x50a2('0x91')]['query'](_0xf7e280[_0x50a2('0x92')](),_0x3509a1)[_0x50a2('0x2e')](function(_0x1979a2){_0x5a54fa=_[_0x50a2('0x93')](_0x1979a2,'id');_0x3509a1=_[_0x50a2('0x94')](_0x3509a1,{'model':db[_0x50a2('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6aa24d[_0x50a2('0x40')][_0x50a2('0x43')]){_0x28b310['attributes'][_0x50a2('0x39')](function(_0x5a4f93){_0x453463[_0x50a2('0x49')]('i.'+_0x5a4f93);});}else{_0x453463[_0x50a2('0x49')](_0x50a2('0x95'),'unreadMessages');_0x453463[_0x50a2('0x49')](_0x50a2('0x96'),_0x50a2('0x97'));_0x453463[_0x50a2('0x49')](_0x50a2('0x98'),_0x50a2('0x99'));_0x453463[_0x50a2('0x49')](_0x50a2('0x9a'),_0x50a2('0x9b'));_0x453463[_0x50a2('0x49')](_0x50a2('0x9c'));_0x453463[_0x50a2('0x49')](_0x50a2('0x9d'),_0x50a2('0x9e'));_0x453463['field'](_0x50a2('0x9f'),_0x50a2('0xa0'));_0x453463['field'](_0x50a2('0xa1'),_0x50a2('0xa2'));_0x453463[_0x50a2('0x49')](_0x50a2('0xa3'),_0x50a2('0xa4'));_0x453463[_0x50a2('0x49')]('c.mobile',_0x50a2('0xa5'));_0x453463['field']('c.fax','Contact.fax');_0x453463['field'](_0x50a2('0xa6'),_0x50a2('0xa7'));_0x453463[_0x50a2('0x49')](_0x50a2('0xa8'),_0x50a2('0xa9'));_0x453463[_0x50a2('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x50a2('0x36'));}if(_0x28b310[_0x50a2('0x27')])_0x453463[_0x50a2('0x27')](_0x28b310[_0x50a2('0x27')]);if(_0x28b310[_0x50a2('0x25')])_0x453463[_0x50a2('0x25')](_0x28b310['offset']);return db['sequelize'][_0x50a2('0x40')](_0x453463[_0x50a2('0x92')](),_0x3509a1);})['then'](function(_0x2822d8){if(_0x2822d8[_0x50a2('0x45')]>0x0)_0x4b8890[_0x50a2('0x73')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x2822d8,'id'));return db[_0x50a2('0x91')][_0x50a2('0x40')](_0x4b8890[_0x50a2('0x92')](),_0x3509a1)[_0x50a2('0x2e')](function(_0x56c609){var _0x4acc68=_[_0x50a2('0xaa')](_0x56c609,_0x50a2('0xab'));var _0x1be4f3=[];_0x2822d8[_0x50a2('0x39')](function(_0x269fd4){_0x1be4f3[_0x50a2('0x3a')](updateWhatsappInteraction(_0x269fd4,_0x5a54fa,_0x4acc68));});return BPromise[_0x50a2('0xac')](_0x1be4f3);});});})[_0x50a2('0x2e')](function(_0x59564d){_0x50ab1a[_0x50a2('0xad')]=_0x59564d;return _0x50ab1a;})['then'](respondWithFilteredResult(_0x5db6cf,_0x28b310))[_0x50a2('0xae')](handleError(_0x5db6cf,null));};exports['show']=function(_0x3168fd,_0x3c16e0){var _0x5c01b9={'raw':![],'where':{'id':_0x3168fd['params']['id']}},_0x21e1c1={};_0x21e1c1[_0x50a2('0x3e')]=_[_0x50a2('0x3f')](db[_0x50a2('0x3c')][_0x50a2('0xaf')]);_0x21e1c1['query']=_[_0x50a2('0x3f')](_0x3168fd[_0x50a2('0x40')]);_0x21e1c1['filters']=_[_0x50a2('0x42')](_0x21e1c1[_0x50a2('0x3e')],_0x21e1c1[_0x50a2('0x40')]);_0x5c01b9['attributes']=_[_0x50a2('0x42')](_0x21e1c1['model'],qs[_0x50a2('0x43')](_0x3168fd[_0x50a2('0x40')][_0x50a2('0x43')]));_0x5c01b9['attributes']=_0x5c01b9[_0x50a2('0x44')][_0x50a2('0x45')]?_0x5c01b9[_0x50a2('0x44')]:_0x21e1c1['model'];if(_0x3168fd[_0x50a2('0x40')][_0x50a2('0xb0')]){_0x5c01b9[_0x50a2('0xb1')]=[{'all':!![]}];}_0x5c01b9=_[_0x50a2('0x94')]({},_0x5c01b9,_0x3168fd[_0x50a2('0xb2')]);return db['WhatsappInteraction'][_0x50a2('0x5d')](_0x5c01b9)['then'](handleEntityNotFound(_0x3c16e0,null))[_0x50a2('0x2e')](respondWithResult(_0x3c16e0,null))['catch'](handleError(_0x3c16e0,null));};exports[_0x50a2('0xb3')]=function(_0x4f4949,_0x526f92){return db['WhatsappInteraction'][_0x50a2('0xb3')](_0x4f4949[_0x50a2('0xb4')],{})['then'](respondWithResult(_0x526f92,0xc9))['catch'](handleError(_0x526f92,null));};exports[_0x50a2('0xb5')]=function(_0x45d7c6,_0x346488){if(_0x45d7c6['body']['id']){delete _0x45d7c6[_0x50a2('0xb4')]['id'];}return db[_0x50a2('0x3c')][_0x50a2('0x5d')]({'where':{'id':_0x45d7c6[_0x50a2('0xb6')]['id']}})[_0x50a2('0x2e')](handleEntityNotFound(_0x346488,null))[_0x50a2('0x2e')](saveUpdates(_0x45d7c6['body'],null))['then'](respondWithResult(_0x346488,null))[_0x50a2('0xae')](handleError(_0x346488,null));};exports[_0x50a2('0x2f')]=function(_0x53ac4a,_0x5c9971){return db[_0x50a2('0x3c')][_0x50a2('0x5d')]({'where':{'id':_0x53ac4a[_0x50a2('0xb6')]['id']}})[_0x50a2('0x2e')](handleEntityNotFound(_0x5c9971,null))[_0x50a2('0x2e')](removeEntity(_0x5c9971,null))[_0x50a2('0xae')](handleError(_0x5c9971,null));};exports[_0x50a2('0xb7')]=function(_0x16e490,_0x5396e4){return db[_0x50a2('0x3c')][_0x50a2('0xb7')]()[_0x50a2('0x2e')](respondWithResult(_0x5396e4,null))[_0x50a2('0xae')](handleError(_0x5396e4,null));};exports[_0x50a2('0xb8')]=function(_0x209655,_0x17bdd2,_0x37ec57){return db[_0x50a2('0xb9')][_0x50a2('0x5d')]({'where':{'id':_0x209655[_0x50a2('0xb6')]['id']}})[_0x50a2('0x2e')](handleEntityNotFound(_0x17bdd2,null))[_0x50a2('0x2e')](function(_0xdc394){if(_0xdc394){return _0xdc394[_0x50a2('0xb8')](_0x209655[_0x50a2('0xb4')]['ids'],_[_0x50a2('0xba')](_0x209655[_0x50a2('0xb4')],[_0x50a2('0xbb'),'id'])||{});}})[_0x50a2('0x2e')](respondWithResult(_0x17bdd2,null))[_0x50a2('0xae')](handleError(_0x17bdd2,null));};exports[_0x50a2('0xbc')]=function(_0x1a8bd0,_0x4e120d,_0x1484e6){var _0x2a65f2={'raw':![],'where':{}};var _0x502de0={};var _0x5189b9={'count':0x0,'rows':[]};return db[_0x50a2('0x3c')]['findOne']({'where':{'id':_0x1a8bd0[_0x50a2('0xb6')]['id']}})['then'](handleEntityNotFound(_0x4e120d,null))[_0x50a2('0x2e')](function(_0x1707e8){if(_0x1707e8){_0x502de0['model']=_[_0x50a2('0x3f')](db[_0x50a2('0xb9')][_0x50a2('0xaf')]);_0x502de0['query']=_[_0x50a2('0x3f')](_0x1a8bd0['query']);_0x502de0['filters']=_[_0x50a2('0x42')](_0x502de0[_0x50a2('0x3e')],_0x502de0[_0x50a2('0x40')]);_0x2a65f2[_0x50a2('0x44')]=_[_0x50a2('0x42')](_0x502de0[_0x50a2('0x3e')],qs['fields'](_0x1a8bd0[_0x50a2('0x40')][_0x50a2('0x43')]));_0x2a65f2[_0x50a2('0x44')]=_0x2a65f2[_0x50a2('0x44')][_0x50a2('0x45')]?_0x2a65f2[_0x50a2('0x44')]:_0x502de0[_0x50a2('0x3e')];if(!_0x1a8bd0[_0x50a2('0x40')]['hasOwnProperty'](_0x50a2('0xbd'))){_0x2a65f2[_0x50a2('0x27')]=qs['limit'](_0x1a8bd0[_0x50a2('0x40')]['limit']);_0x2a65f2['offset']=qs[_0x50a2('0x25')](_0x1a8bd0[_0x50a2('0x40')][_0x50a2('0x25')]);}_0x2a65f2[_0x50a2('0x46')]=qs[_0x50a2('0x47')](_0x1a8bd0['query']['sort']);_0x2a65f2[_0x50a2('0x73')]=qs['filters'](_[_0x50a2('0x48')](_0x1a8bd0[_0x50a2('0x40')],_0x502de0['filters']));_0x2a65f2[_0x50a2('0x73')]['WhatsappInteractionId']=_0x1707e8['id'];if(_0x1a8bd0[_0x50a2('0x40')]['filter']){_0x2a65f2[_0x50a2('0x73')]=_[_0x50a2('0x94')](_0x2a65f2[_0x50a2('0x73')],{'$or':_[_0x50a2('0x34')](_0x2a65f2[_0x50a2('0x44')],function(_0x23769f){var _0x330b85={};_0x330b85[_0x23769f]={'$like':'%'+_0x1a8bd0[_0x50a2('0x40')][_0x50a2('0x81')]+'%'};return _0x330b85;})});}if(_0x1a8bd0[_0x50a2('0x40')][_0x50a2('0xbe')]){var _0x2ca4b2=_0x1a8bd0[_0x50a2('0x40')]['$gte']['split'](',');var _0x467ace={};_0x467ace[_0x2ca4b2[0x0]]={'$gte':moment(_0x2ca4b2[0x1])[_0x50a2('0xbf')](_0x50a2('0xc0'))};_0x2a65f2[_0x50a2('0x73')]=_[_0x50a2('0x94')](_0x2a65f2[_0x50a2('0x73')],_0x467ace);}_0x2a65f2=_['merge']({},_0x2a65f2,_0x1a8bd0[_0x50a2('0xb2')]);return db[_0x50a2('0xb9')]['count']({'where':_0x2a65f2['where']})['then'](function(_0x4a625c){_0x5189b9[_0x50a2('0x28')]=_0x4a625c;if(_0x1a8bd0['query']['includeAll']){_0x2a65f2[_0x50a2('0xb1')]=[{'all':!![]}];}return db[_0x50a2('0xb9')]['findAll'](_0x2a65f2);})[_0x50a2('0x2e')](function(_0x56536c){_0x5189b9['rows']=_0x56536c;return _0x5189b9;});}})['then'](respondWithFilteredResult(_0x4e120d,_0x2a65f2))[_0x50a2('0xae')](handleError(_0x4e120d,null));};exports[_0x50a2('0xc1')]=function(_0x2bea57,_0x119ee2,_0x54d25b){return db['WhatsappInteraction'][_0x50a2('0x5d')]({'where':{'id':_0x2bea57[_0x50a2('0xb6')]['id']}})['then'](handleEntityNotFound(_0x119ee2,null))[_0x50a2('0x2e')](function(_0x5bd788){if(_0x5bd788){return _0x5bd788[_0x50a2('0xc2')](_0x2bea57[_0x50a2('0xb4')][_0x50a2('0xbb')],_['omit'](_0x2bea57[_0x50a2('0xb4')],[_0x50a2('0xbb'),'id'])||{})[_0x50a2('0xc3')](function(){return db[_0x50a2('0x6a')][_0x50a2('0xc4')]({'attributes':['id','name',_0x50a2('0x4a')],'where':{'id':_0x2bea57['body'][_0x50a2('0xbb')]}});})[_0x50a2('0x2e')](function(_0x517c96){socket[_0x50a2('0xc5')](_0x50a2('0xc6'),{'id':Number(_0x2bea57[_0x50a2('0xb6')]['id']),'tags':_0x517c96||[]});return{'id':Number(_0x2bea57[_0x50a2('0xb6')]['id']),'tags':_0x517c96||[]};});}})[_0x50a2('0x2e')](respondWithResult(_0x119ee2,null))['catch'](handleError(_0x119ee2,null));};exports['removeTags']=function(_0x2bab1d,_0x167fc5,_0x47c30c){return db[_0x50a2('0x3c')][_0x50a2('0x5d')]({'where':{'id':_0x2bab1d[_0x50a2('0xb6')]['id']}})['then'](handleEntityNotFound(_0x167fc5,null))[_0x50a2('0x2e')](function(_0x3abc5b){if(_0x3abc5b){return _0x3abc5b['removeTags'](_0x2bab1d['query'][_0x50a2('0xbb')]);}})[_0x50a2('0x2e')](respondWithStatusCode(_0x167fc5,null))[_0x50a2('0xae')](handleError(_0x167fc5,null));};exports[_0x50a2('0xc7')]=function(_0xd1e303,_0x25f89c){var _0x3e69d1=moment()[_0x50a2('0xc8')]()[_0x50a2('0x92')]();var _0x637b00=path['join'](config[_0x50a2('0xc9')],_0x50a2('0xca'),_0x50a2('0xcb'),_0x50a2('0xcc'));var _0x6b89c5=path['join'](config['root'],_0x50a2('0xca'),_0x50a2('0xcb'),_0x50a2('0xcd'));var _0x335f74=path[_0x50a2('0xce')](_0x637b00,_0x3e69d1);var _0x3eedcd=util['format'](_0x50a2('0xcf'),_0xd1e303['params']['id'],_0x3e69d1);var _0x37c3ff=path[_0x50a2('0xce')](_0x637b00,_0x3eedcd);var _0x31c5ac=[];_0x31c5ac['push']({'model':db[_0x50a2('0xd0')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x31c5ac[_0x50a2('0x3a')]({'model':db[_0x50a2('0xd1')],'as':_0x50a2('0x63'),'attributes':['id',_0x50a2('0xd2'),_0x50a2('0xd3')],'raw':!![]});if(_0xd1e303[_0x50a2('0x40')][_0x50a2('0xcd')]){_0x31c5ac['push']({'model':db['Attachment'],'as':_0x50a2('0xd4'),'raw':!![]});}var _0x56310a=[{'model':db[_0x50a2('0xb9')],'as':_0x50a2('0xd5'),'attributes':['id',_0x50a2('0xb4'),'createdAt',_0x50a2('0xd6'),'secret','read'],'include':_0x31c5ac}];_0x56310a[_0x50a2('0x3a')]({'model':db[_0x50a2('0xd7')],'as':_0x50a2('0xd8'),'attributes':['id',_0x50a2('0x32')]});_0x56310a[_0x50a2('0x3a')]({'model':db[_0x50a2('0xd0')],'as':'Owner','attributes':['id',_0x50a2('0x35')]});return db['WhatsappInteraction'][_0x50a2('0x5d')]({'where':{'id':_0xd1e303['params']['id']},'include':_0x56310a})['then'](handleEntityNotFound(_0x25f89c,null))[_0x50a2('0x2e')](function(_0x1b0dac){if(_0x1b0dac){var _0x1e44ba=_0x1b0dac['get']({'plain':!![]});fs[_0x50a2('0xd9')](_0x335f74);var _0x136053={'channel':_0x50a2('0xda'),'account':_0x1e44ba[_0x50a2('0xd8')][_0x50a2('0x32')],'agent':_0x1e44ba['Owner']?_0x1e44ba[_0x50a2('0xdb')][_0x50a2('0x35')]:_0x50a2('0xdc'),'createdAt':moment(_0x1e44ba[_0x50a2('0x76')])[_0x50a2('0xbf')](_0x50a2('0xc0'))[_0x50a2('0x92')](),'closedAt':_0x1e44ba[_0x50a2('0xdd')]?moment(_0x1e44ba[_0x50a2('0xde')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x50a2('0x92')]():'','disposition':_0x1e44ba['disposition'],'messages':_(_0x1e44ba[_0x50a2('0xd5')])[_0x50a2('0x81')]({'secret':![]})[_0x50a2('0x34')](function(_0x342b54){if(_0x342b54['Attachment']){var _0x35c5b2=path[_0x50a2('0xce')](_0x6b89c5,_0x342b54[_0x50a2('0xd4')][_0x50a2('0xdf')]);if(fs[_0x50a2('0xe0')](_0x35c5b2)){fs[_0x50a2('0xe1')](_0x35c5b2)[_0x50a2('0xe2')](fs[_0x50a2('0xe3')](path['join'](_0x335f74,_0x342b54['Attachment'][_0x50a2('0xdf')])));}}return{'date':moment(_0x342b54[_0x50a2('0x76')])[_0x50a2('0xbf')](_0x50a2('0xc0'))[_0x50a2('0x92')](),'sender':_0x342b54[_0x50a2('0xd6')]===_0x50a2('0xe4')?_0x342b54[_0x50a2('0xd0')]?_0x342b54[_0x50a2('0xd0')][_0x50a2('0x35')]:_0x50a2('0xe5'):_0x342b54[_0x50a2('0x63')]['firstName']+(_0x342b54[_0x50a2('0x63')][_0x50a2('0xd3')]?'\x20'+_0x342b54[_0x50a2('0x63')][_0x50a2('0xd3')]:''),'body':_0x342b54['Attachment']?_0x342b54[_0x50a2('0xd4')][_0x50a2('0xdf')]:_0x342b54[_0x50a2('0xb4')],'direction':_0x342b54[_0x50a2('0xd6')]==='out'?'A':'C','secret':_0x342b54[_0x50a2('0xe6')],'read':_0x342b54['read'],'attachment':_0x342b54[_0x50a2('0xd4')]};})[_0x50a2('0x5f')]()};return ejs[_0x50a2('0xe7')](path['join'](config[_0x50a2('0xc9')],_0x50a2('0xca'),_0x50a2('0xe8'),_0x50a2('0xe9')),{'interaction':_0x136053})[_0x50a2('0x2e')](function(_0x509e99){var _0x318a2b=path[_0x50a2('0xce')](_0x335f74,_0x50a2('0xea')+_0x1e44ba['id']+'-'+_0x3e69d1+_0x50a2('0xeb'));var _0xfa01ce={'path':_0x318a2b,'channel':'Whatsapp','interactionId':_0x1e44ba['id']};return pdf['createPdfFromHTML'](_0x509e99,_0xfa01ce);})[_0x50a2('0x2e')](function(){return new BPromise(function(_0x359fd6,_0x45ebc0){zipdir(_0x335f74,{'saveTo':_0x37c3ff},function(_0xaafbf9,_0x1cbf86){if(_0xaafbf9)return _0x45ebc0(_0xaafbf9);return _0x359fd6(_0x1cbf86);});})[_0x50a2('0x2e')](function(){return new BPromise(function(_0x42621f,_0x3b2ece){rimraf(_0x335f74,function(_0x1fcbab){if(_0x1fcbab)_0x3b2ece(_0x1fcbab);return _0x42621f();});});})[_0x50a2('0x2e')](function(){return _0x25f89c[_0x50a2('0xc7')](_0x37c3ff,_0x3eedcd,function(_0x5e38d3){if(_0x5e38d3){console[_0x50a2('0xec')](_0x50a2('0xed'),_0x5e38d3);}else{fs['unlinkSync'](_0x37c3ff);}});});});}else{return _0x25f89c[_0x50a2('0x21')](0xc8);}})[_0x50a2('0xae')](handleError(_0x25f89c,null));}; \ No newline at end of file +var _0x79a8=['../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','end','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','sendStatus','error','stack','name','send','Users','forEach','push','TagIds','catch','index','map','WhatsappInteraction','rawAttributes','type','key','model','filters','intersection','query','fields','attributes','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','length','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','null','\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','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','params','keys','includeAll','include','merge','options','find','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','nolimit','pick','WhatsappInteractionId','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','secret','WhatsappAccount','Account','Owner','Whatsapp','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis'];(function(_0x28f040,_0x5c90da){var _0x8c5715=function(_0x3da521){while(--_0x3da521){_0x28f040['push'](_0x28f040['shift']());}};_0x8c5715(++_0x5c90da);}(_0x79a8,0x1d0));var _0x879a=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x79a8[_0x26d6d9];return _0x1b4875;};'use strict';var emlformat=require(_0x879a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x879a('0x1'));var jsonpatch=require(_0x879a('0x2'));var rp=require(_0x879a('0x3'));var moment=require('moment');var BPromise=require(_0x879a('0x4'));var Mustache=require('mustache');var util=require(_0x879a('0x5'));var path=require(_0x879a('0x6'));var sox=require(_0x879a('0x7'));var csv=require(_0x879a('0x8'));var ejs=require(_0x879a('0x9'));var fs=require('fs');var fs_extra=require(_0x879a('0xa'));var _=require(_0x879a('0xb'));var squel=require(_0x879a('0xc'));var crypto=require('crypto');var jsforce=require(_0x879a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879a('0x8'));var querystring=require(_0x879a('0xe'));var Papa=require('papaparse');var Redis=require(_0x879a('0xf'));var authService=require(_0x879a('0x10'));var qs=require(_0x879a('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x879a('0x12'));var hardwareService=require(_0x879a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x879a('0x14'));var config=require(_0x879a('0x15'));var licenseUtil=require(_0x879a('0x16'));var db=require(_0x879a('0x17'))['db'];config['redis']=_[_0x879a('0x18')](config[_0x879a('0x19')],{'host':_0x879a('0x1a'),'port':0x18eb});var socket=require(_0x879a('0x1b'))(new Redis(config[_0x879a('0x19')]));require(_0x879a('0x1c'))[_0x879a('0x1d')](socket);function respondWithStatusCode(_0x5527a8,_0x1746b6){_0x1746b6=_0x1746b6||0xcc;return function(_0x16b649){if(_0x16b649){return _0x5527a8['sendStatus'](_0x1746b6);}return _0x5527a8['status'](_0x1746b6)[_0x879a('0x1e')]();};}function respondWithResult(_0x1c1f08,_0x4b1f67){_0x4b1f67=_0x4b1f67||0xc8;return function(_0x119260){if(_0x119260){return _0x1c1f08[_0x879a('0x1f')](_0x4b1f67)[_0x879a('0x20')](_0x119260);}};}function respondWithFilteredResult(_0x3d4462,_0x32d9f5){return function(_0x61427a){if(_0x61427a){var _0x4160bd=typeof _0x32d9f5[_0x879a('0x21')]===_0x879a('0x22')&&typeof _0x32d9f5[_0x879a('0x23')]===_0x879a('0x22');var _0x295caf=_0x61427a[_0x879a('0x24')];var _0x52607b=_0x4160bd?0x0:_0x32d9f5['offset'];var _0x830b36=_0x4160bd?_0x61427a[_0x879a('0x24')]:_0x32d9f5['offset']+_0x32d9f5[_0x879a('0x23')];var _0x4113e1;if(_0x830b36>=_0x295caf){_0x830b36=_0x295caf;_0x4113e1=0xc8;}else{_0x4113e1=0xce;}_0x3d4462['status'](_0x4113e1);return _0x3d4462['set']('Content-Range',_0x52607b+'-'+_0x830b36+'/'+_0x295caf)[_0x879a('0x20')](_0x61427a);}return null;};}function patchUpdates(_0x44cd33){return function(_0x79b806){try{jsonpatch[_0x879a('0x25')](_0x79b806,_0x44cd33,!![]);}catch(_0x4c3808){return BPromise['reject'](_0x4c3808);}return _0x79b806[_0x879a('0x26')]();};}function saveUpdates(_0x1be65f,_0x2b69be){return function(_0x259ad3){if(_0x259ad3){return _0x259ad3[_0x879a('0x27')](_0x1be65f)[_0x879a('0x28')](function(_0x7d67ed){return _0x7d67ed;});}return null;};}function removeEntity(_0x14213c,_0x358f0e){return function(_0x2ee375){if(_0x2ee375){return _0x2ee375[_0x879a('0x29')]()[_0x879a('0x28')](function(){_0x14213c[_0x879a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a665,_0x2cd769){return function(_0x92c805){if(!_0x92c805){_0x51a665[_0x879a('0x2a')](0x194);}return _0x92c805;};}function handleError(_0x20b1d5,_0x3030e0){_0x3030e0=_0x3030e0||0x1f4;return function(_0x3ef6c1){logger[_0x879a('0x2b')](_0x3ef6c1[_0x879a('0x2c')]);if(_0x3ef6c1[_0x879a('0x2d')]){delete _0x3ef6c1[_0x879a('0x2d')];}_0x20b1d5[_0x879a('0x1f')](_0x3030e0)[_0x879a('0x2e')](_0x3ef6c1);};}function getInteractionUsers(_0x355f66,_0x99559){return new BPromise(function(_0x26902c,_0x14c6c9){try{if(_0x99559[_0x355f66['id']]){_0x355f66[_0x879a('0x2f')]=_['map'](_0x99559[_0x355f66['id']],function(_0x3003b1){return{'id':_0x3003b1['id'],'fullname':_0x3003b1['fullname']};});}}catch(_0x3ac306){_0x14c6c9(_0x3ac306);}_0x26902c(_0x355f66);});}function getInteractionTags(_0x314899,_0x1a0358){return new BPromise(function(_0x4d001a,_0x24adad){try{if(_0x314899['TagIds']){_0x314899['Tags']=[];_0x314899['TagIds']['split'](',')[_0x879a('0x30')](function(_0x4267c4){_0x314899['Tags'][_0x879a('0x31')](_0x1a0358[_0x4267c4]);});}delete _0x314899[_0x879a('0x32')];}catch(_0x146fbc){_0x24adad(_0x146fbc);}_0x4d001a(_0x314899);});}function updateWhatsappInteraction(_0x4d3e7d,_0x2fd7e7,_0x92f79d){return new BPromise(function(_0x44444e,_0x281b80){return getInteractionUsers(_0x4d3e7d,_0x92f79d)['then'](function(_0x38bc4f){return getInteractionTags(_0x38bc4f,_0x2fd7e7);})[_0x879a('0x28')](function(_0xd5f921){_0x44444e(_0xd5f921);})[_0x879a('0x33')](function(_0x49e6f5){_0x281b80(_0x49e6f5);});});}exports[_0x879a('0x34')]=function(_0x4bbddc,_0x97cf7b){var _0x555d50={},_0x400bbb={},_0x34b867={'count':0x0,'rows':[]};var _0x5bffea=_[_0x879a('0x35')](db[_0x879a('0x36')][_0x879a('0x37')],function(_0x22c7c3){return{'name':_0x22c7c3['fieldName'],'type':_0x22c7c3[_0x879a('0x38')][_0x879a('0x39')]};});_0x400bbb[_0x879a('0x3a')]=_['map'](_0x5bffea,'name');_0x400bbb['query']=_['keys'](_0x4bbddc['query']);_0x400bbb[_0x879a('0x3b')]=_[_0x879a('0x3c')](_0x400bbb[_0x879a('0x3a')],_0x400bbb['query']);_0x555d50['attributes']=_['intersection'](_0x400bbb[_0x879a('0x3a')],qs['fields'](_0x4bbddc[_0x879a('0x3d')][_0x879a('0x3e')]));_0x555d50[_0x879a('0x3f')]=_0x555d50['attributes']['length']?_0x555d50[_0x879a('0x3f')]:_0x400bbb['model'];if(!_0x4bbddc[_0x879a('0x3d')][_0x879a('0x40')]('nolimit')){_0x555d50[_0x879a('0x23')]=qs[_0x879a('0x23')](_0x4bbddc[_0x879a('0x3d')]['limit']);_0x555d50[_0x879a('0x21')]=qs[_0x879a('0x21')](_0x4bbddc['query'][_0x879a('0x21')]);}_0x555d50[_0x879a('0x41')]=qs['sort'](_0x4bbddc[_0x879a('0x3d')][_0x879a('0x42')]);_0x555d50[_0x879a('0x43')]=qs[_0x879a('0x3b')](_['pick'](_0x4bbddc[_0x879a('0x3d')],_0x400bbb['filters']),_0x5bffea);var _0x257840=[];var _0x480dd4=squel[_0x879a('0x44')]()['field']('id')[_0x879a('0x45')](_0x879a('0x2d'))[_0x879a('0x45')](_0x879a('0x46'))[_0x879a('0x47')](_0x879a('0x48'));var _0x5ca74e=squel[_0x879a('0x44')]()[_0x879a('0x45')](_0x879a('0x49'))['field'](_0x879a('0x4a'))[_0x879a('0x45')](_0x879a('0x4b'))['from'](_0x879a('0x4c'),'ui')[_0x879a('0x4d')](_0x879a('0x4e'),'u',_0x879a('0x4f'));var _0x500f98=squel['select']()[_0x879a('0x47')](_0x879a('0x50'),'i')['left_join'](_0x879a('0x51'),'c',_0x879a('0x52'))['left_join'](_0x879a('0x4e'),'o',_0x879a('0x53'))[_0x879a('0x4d')](_0x879a('0x54'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x879a('0x4d')](_0x879a('0x55'),'me',_0x879a('0x56'))['left_join']('whatsapp_interaction_has_tags','it',_0x879a('0x57'))[_0x879a('0x4d')]('tools_tags','t',_0x879a('0x58'));var _0x4de855=squel[_0x879a('0x59')]();var _0x5dd7eb=[];var _0x27c58b=squel[_0x879a('0x59')]();var _0xc1c234;if(_0x4bbddc[_0x879a('0x3d')]['search']){_0xc1c234=as[_0x879a('0x5a')](_0x4bbddc[_0x879a('0x3d')]['search']);var _0x395983=_0xc1c234[_0x879a('0x5b')];for(var _0x59ff36=0x0;_0x59ff36<_0xc1c234['conditions'][_0x879a('0x5c')];_0x59ff36++){var _0x5695cb=_0xc1c234['conditions'][_0x59ff36];var _0x1fe260='i';var _0x397e90=_['find'](_0x5bffea,[_0x879a('0x2d'),_0x5695cb[_0x879a('0x45')]]);if(!_0x397e90){switch(_0x5695cb[_0x879a('0x45')]){case'unreadMessages':if(_0x5695cb[_0x879a('0x5d')]==0x1){_0x500f98[_0x879a('0x5e')]('`'+_0x5695cb[_0x879a('0x45')]+_0x879a('0x5f'));}else{_0x500f98[_0x879a('0x5e')]('`'+_0x5695cb[_0x879a('0x45')]+_0x879a('0x60'));}break;case _0x879a('0x61'):if(_0x5695cb['operator']===_0x879a('0x62')){if(_0x5695cb[_0x879a('0x5d')]['split']('\x20')['length']>0x1){_0x4de855[_0x395983](_0x879a('0x63'),qs['getFullTextValue'](_0x5695cb[_0x879a('0x5d')]),null);}else{var _0x457e4e='%'+_0x5695cb[_0x879a('0x5d')]+'%';_0x4de855[_0x395983](_0x879a('0x64'),_0x457e4e,_0x457e4e,_0x457e4e);}}else{_0x397e90=_['find'](_0x5bffea,['name',_0x879a('0x65')]);_0x5695cb[_0x879a('0x45')]='ContactId';_0xb6239a=as[_0x879a('0x66')](_0x1fe260,_0x397e90[_0x879a('0x38')],_0x5695cb);_0x4de855[_0x395983](_0xb6239a[_0x879a('0x67')],_0xb6239a[_0x879a('0x5d')]['start'],_0xb6239a['value']['end']);}break;case _0x879a('0x68'):var _0x228a27=_0x5695cb['value']['split'](',')[_0x879a('0x35')](function(_0x2dbfc6){return Number(_0x2dbfc6);});_0x228a27[_0x879a('0x30')](function(_0x10d81f){_0x27c58b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x10d81f+',%');});_0x5dd7eb=_[_0x879a('0x69')](_0x5dd7eb,_0x228a27);break;case _0x879a('0x6a'):if(_0x5695cb['operator']==='$substring'){_0x4de855[_0x395983](_0x879a('0x6b'),'%'+_0x5695cb[_0x879a('0x5d')]+'%',null);}else{_0x397e90=_['find'](_0x5bffea,[_0x879a('0x2d'),_0x879a('0x6c')]);_0x5695cb['field']=_0x879a('0x6c');_0xb6239a=as[_0x879a('0x66')](_0x1fe260,_0x397e90[_0x879a('0x38')],_0x5695cb);_0x4de855[_0x395983](_0xb6239a['text'],_0xb6239a[_0x879a('0x5d')][_0x879a('0x6d')],_0xb6239a[_0x879a('0x5d')][_0x879a('0x1e')]);}break;case _0x879a('0x6e'):_0xb6239a=as[_0x879a('0x66')]('me',null,_0x5695cb);_0x4de855[_0x395983](_0xb6239a[_0x879a('0x67')],_0xb6239a[_0x879a('0x5d')]['start'],_0xb6239a[_0x879a('0x5d')][_0x879a('0x1e')]);break;}}else{var _0xb6239a=as['buildExpression'](_0x1fe260,_0x397e90['type'],_0x5695cb);_0x4de855[_0x395983](_0xb6239a[_0x879a('0x67')],_0xb6239a[_0x879a('0x5d')][_0x879a('0x6d')],_0xb6239a['value'][_0x879a('0x1e')]);}}}else{var _0x2885ae=_(_0x4bbddc[_0x879a('0x3d')])['keys']()['map'](function(_0x3e1b01){return _['some'](_0x5bffea,['name',_0x3e1b01])?_0x3e1b01:undefined;})[_0x879a('0x6f')]()[_0x879a('0x5d')]();if(!_[_0x879a('0x70')](_0x2885ae)){_0x2885ae[_0x879a('0x30')](function(_0x53d172){if(_0x53d172===_0x879a('0x71')){_0x500f98[_0x879a('0x43')](_0x879a('0x72'),[]['concat'](_0x4bbddc[_0x879a('0x3d')][_0x53d172]));}else if(_0x53d172===_0x879a('0x73')){var _0x4b6474=JSON['parse'](_0x4bbddc[_0x879a('0x3d')][_0x53d172])[_0x879a('0x74')];var _0x2bc21c=JSON[_0x879a('0x75')](_0x4bbddc['query'][_0x53d172])[_0x879a('0x76')];_0x500f98[_0x879a('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4b6474,_0x2bc21c);}else{if(_0x4bbddc[_0x879a('0x3d')][_0x53d172]===_0x879a('0x77')){_0x500f98[_0x879a('0x43')]('i.'+_0x53d172+_0x879a('0x78'));}else{_0x500f98[_0x879a('0x43')]('i.'+_0x53d172+_0x879a('0x79'),_0x4bbddc[_0x879a('0x3d')][_0x53d172]);}}});}if(_0x4bbddc['query'][_0x879a('0x7a')]){if(_0x4bbddc['query'][_0x879a('0x7a')]==0x1){_0x500f98[_0x879a('0x5e')](_0x879a('0x7b'));}else{_0x500f98[_0x879a('0x5e')](_0x879a('0x7c'));}}if(_0x4bbddc[_0x879a('0x3d')][_0x879a('0x7d')]){_0x5dd7eb=_[_0x879a('0x7e')](_0x4bbddc['query'][_0x879a('0x7d')])?_0x4bbddc[_0x879a('0x3d')][_0x879a('0x7d')]:new Array(_0x4bbddc[_0x879a('0x3d')][_0x879a('0x7d')]);_0x5dd7eb[_0x879a('0x30')](function(_0x115339){_0x27c58b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x115339+',%');});}if(_0x4bbddc['query'][_0x879a('0x7f')]){var _0x39b00e=_0x4bbddc[_0x879a('0x3d')][_0x879a('0x7f')][_0x879a('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x879a('0x81')](_0x39b00e)){_0x4de855['or'](_0x879a('0x82'),_0x39b00e+'%')['or']('i.phone\x20LIKE\x20?',_0x39b00e+'%');}else{_0x4de855['or'](_0x879a('0x83'),qs[_0x879a('0x84')](_0x39b00e))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x39b00e+'%');}}}_0x500f98[_0x879a('0x43')](_0x4de855);_0x500f98['group'](_0x879a('0x85'));var _0x258ce2={'type':db['Sequelize'][_0x879a('0x86')][_0x879a('0x87')],'raw':!![]};var _0x33644f=_0x500f98['clone']();_0x33644f[_0x879a('0x45')](_0x879a('0x85'));_0x33644f[_0x879a('0x45')](_0x879a('0x88'),_0x879a('0x89'));if(_0x555d50[_0x879a('0x41')]){_0x555d50[_0x879a('0x41')]['forEach'](function(_0x4a10b1){var _0x7f69c0=_0x4a10b1[0x0]===_0x879a('0x8a')?_0x4a10b1[0x0]:'i.'+_0x4a10b1[0x0];_0x500f98[_0x879a('0x41')](_0x7f69c0,_0x4a10b1[0x1]===_0x879a('0x8b')?![]:!![]);});}if(!_[_0x879a('0x70')](_0x5dd7eb)){_0x500f98['having'](_0x27c58b);_0x33644f[_0x879a('0x43')](_0x879a('0x8c'),_0x5dd7eb);}BPromise[_0x879a('0x8d')]()[_0x879a('0x28')](function(){if(!_0xc1c234){if(_0x4bbddc[_0x879a('0x3d')]['WhatsappAccountId'])return;_0x33644f[_0x879a('0x43')](_0x879a('0x8e'));_0x500f98[_0x879a('0x43')](_0x879a('0x8e'));return;}if(_0x4bbddc[_0x879a('0x8f')]['role']!=='agent')return;return _0x4bbddc[_0x879a('0x8f')][_0x879a('0x90')]({'attributes':['id'],'raw':!![]})[_0x879a('0x28')](function(_0x273498){if(_[_0x879a('0x70')](_0x273498)){_0x33644f[_0x879a('0x43')](_0x879a('0x91'));_0x500f98[_0x879a('0x43')](_0x879a('0x91'));}else{_0x33644f[_0x879a('0x43')](_0x879a('0x72'),_[_0x879a('0x35')](_0x273498,'id'));_0x500f98['where'](_0x879a('0x72'),_[_0x879a('0x35')](_0x273498,'id'));}});})[_0x879a('0x28')](function(){if(_0x4bbddc[_0x879a('0x8f')][_0x879a('0x92')]==='agent'&&!_0xc1c234&&!_0x4bbddc[_0x879a('0x3d')]['WhatsappAccountId'])return[];return db[_0x879a('0x93')]['query'](_0x33644f[_0x879a('0x94')](),_0x258ce2);})[_0x879a('0x28')](function(_0x93f6e9){_0x34b867['count']=_0x93f6e9[_0x879a('0x5c')];if(_0x34b867[_0x879a('0x24')]===0x0)return[];return db[_0x879a('0x93')]['query'](_0x480dd4[_0x879a('0x94')](),_0x258ce2)[_0x879a('0x28')](function(_0x11ad50){_0x257840=_[_0x879a('0x95')](_0x11ad50,'id');_0x258ce2=_['merge'](_0x258ce2,{'model':db[_0x879a('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bbddc[_0x879a('0x3d')][_0x879a('0x3e')]){_0x555d50[_0x879a('0x3f')][_0x879a('0x30')](function(_0x41aaef){_0x500f98[_0x879a('0x45')]('i.'+_0x41aaef);});}else{_0x500f98[_0x879a('0x45')](_0x879a('0x88'),_0x879a('0x89'));_0x500f98[_0x879a('0x45')](_0x879a('0x96'),_0x879a('0x97'));_0x500f98['field'](_0x879a('0x98'),_0x879a('0x99'));_0x500f98[_0x879a('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','contactName');_0x500f98[_0x879a('0x45')](_0x879a('0x9a'));_0x500f98['field'](_0x879a('0x9b'),_0x879a('0x9c'));_0x500f98[_0x879a('0x45')](_0x879a('0x9d'),_0x879a('0x9e'));_0x500f98[_0x879a('0x45')](_0x879a('0x9f'),_0x879a('0xa0'));_0x500f98[_0x879a('0x45')](_0x879a('0xa1'),_0x879a('0xa2'));_0x500f98[_0x879a('0x45')](_0x879a('0xa3'),_0x879a('0xa4'));_0x500f98['field'](_0x879a('0xa5'),_0x879a('0xa6'));_0x500f98[_0x879a('0x45')](_0x879a('0xa7'),_0x879a('0xa8'));_0x500f98['field'](_0x879a('0xa9'),_0x879a('0xaa'));_0x500f98[_0x879a('0x45')](_0x879a('0xab'),_0x879a('0x32'));}if(_0x555d50[_0x879a('0x23')])_0x500f98['limit'](_0x555d50[_0x879a('0x23')]);if(_0x555d50[_0x879a('0x21')])_0x500f98['offset'](_0x555d50[_0x879a('0x21')]);return db[_0x879a('0x93')]['query'](_0x500f98[_0x879a('0x94')](),_0x258ce2);})[_0x879a('0x28')](function(_0x1dad22){if(_0x1dad22[_0x879a('0x5c')]>0x0)_0x5ca74e[_0x879a('0x43')](_0x879a('0xac'),_[_0x879a('0x35')](_0x1dad22,'id'));return db[_0x879a('0x93')][_0x879a('0x3d')](_0x5ca74e[_0x879a('0x94')](),_0x258ce2)[_0x879a('0x28')](function(_0x466d4d){var _0x3189a9=_[_0x879a('0xad')](_0x466d4d,'WhatsappInteractionId');var _0x3b85b0=[];_0x1dad22['forEach'](function(_0xb4f9d2){_0x3b85b0[_0x879a('0x31')](updateWhatsappInteraction(_0xb4f9d2,_0x257840,_0x3189a9));});return BPromise[_0x879a('0xae')](_0x3b85b0);});});})['then'](function(_0x5bb2a9){_0x34b867['rows']=_0x5bb2a9;return _0x34b867;})['then'](respondWithFilteredResult(_0x97cf7b,_0x555d50))[_0x879a('0x33')](handleError(_0x97cf7b,null));};exports['show']=function(_0x2cb300,_0x2de5a6){var _0x3bb63b={'raw':![],'where':{'id':_0x2cb300[_0x879a('0xaf')]['id']}},_0x342538={};_0x342538[_0x879a('0x3a')]=_['keys'](db[_0x879a('0x36')][_0x879a('0x37')]);_0x342538[_0x879a('0x3d')]=_[_0x879a('0xb0')](_0x2cb300['query']);_0x342538[_0x879a('0x3b')]=_['intersection'](_0x342538['model'],_0x342538[_0x879a('0x3d')]);_0x3bb63b[_0x879a('0x3f')]=_[_0x879a('0x3c')](_0x342538['model'],qs[_0x879a('0x3e')](_0x2cb300['query']['fields']));_0x3bb63b[_0x879a('0x3f')]=_0x3bb63b[_0x879a('0x3f')][_0x879a('0x5c')]?_0x3bb63b[_0x879a('0x3f')]:_0x342538[_0x879a('0x3a')];if(_0x2cb300['query'][_0x879a('0xb1')]){_0x3bb63b[_0x879a('0xb2')]=[{'all':!![]}];}_0x3bb63b=_[_0x879a('0xb3')]({},_0x3bb63b,_0x2cb300[_0x879a('0xb4')]);return db[_0x879a('0x36')][_0x879a('0xb5')](_0x3bb63b)[_0x879a('0x28')](handleEntityNotFound(_0x2de5a6,null))[_0x879a('0x28')](respondWithResult(_0x2de5a6,null))[_0x879a('0x33')](handleError(_0x2de5a6,null));};exports[_0x879a('0xb6')]=function(_0x2e4f5c,_0x21b21b){return db[_0x879a('0x36')][_0x879a('0xb6')](_0x2e4f5c['body'],{})['then'](respondWithResult(_0x21b21b,0xc9))[_0x879a('0x33')](handleError(_0x21b21b,null));};exports['update']=function(_0x5c4298,_0x2043cf){if(_0x5c4298[_0x879a('0x6e')]['id']){delete _0x5c4298[_0x879a('0x6e')]['id'];}return db['WhatsappInteraction'][_0x879a('0xb5')]({'where':{'id':_0x5c4298[_0x879a('0xaf')]['id']}})[_0x879a('0x28')](handleEntityNotFound(_0x2043cf,null))['then'](saveUpdates(_0x5c4298['body'],null))['then'](respondWithResult(_0x2043cf,null))[_0x879a('0x33')](handleError(_0x2043cf,null));};exports[_0x879a('0x29')]=function(_0x565611,_0x2d6a4d){return db[_0x879a('0x36')][_0x879a('0xb5')]({'where':{'id':_0x565611[_0x879a('0xaf')]['id']}})[_0x879a('0x28')](handleEntityNotFound(_0x2d6a4d,null))['then'](removeEntity(_0x2d6a4d,null))[_0x879a('0x33')](handleError(_0x2d6a4d,null));};exports[_0x879a('0xb7')]=function(_0x288533,_0x5ce956){return db[_0x879a('0x36')]['describe']()['then'](respondWithResult(_0x5ce956,null))[_0x879a('0x33')](handleError(_0x5ce956,null));};exports[_0x879a('0xb8')]=function(_0x4a66ec,_0x3dab92,_0x2e34a3){return db[_0x879a('0xb9')]['find']({'where':{'id':_0x4a66ec[_0x879a('0xaf')]['id']}})[_0x879a('0x28')](handleEntityNotFound(_0x3dab92,null))[_0x879a('0x28')](function(_0x5a41d5){if(_0x5a41d5){return _0x5a41d5[_0x879a('0xb8')](_0x4a66ec['body'][_0x879a('0xba')],_[_0x879a('0xbb')](_0x4a66ec['body'],[_0x879a('0xba'),'id'])||{});}})[_0x879a('0x28')](respondWithResult(_0x3dab92,null))[_0x879a('0x33')](handleError(_0x3dab92,null));};exports[_0x879a('0xbc')]=function(_0x5266e1,_0xe7faac,_0x1bb6d2){var _0x26ba26={'raw':![],'where':{}};var _0x2f5458={};var _0x4edfc4={'count':0x0,'rows':[]};return db[_0x879a('0x36')][_0x879a('0xbd')]({'where':{'id':_0x5266e1['params']['id']}})[_0x879a('0x28')](handleEntityNotFound(_0xe7faac,null))[_0x879a('0x28')](function(_0x3d03ad){if(_0x3d03ad){_0x2f5458[_0x879a('0x3a')]=_['keys'](db[_0x879a('0xb9')][_0x879a('0x37')]);_0x2f5458[_0x879a('0x3d')]=_[_0x879a('0xb0')](_0x5266e1[_0x879a('0x3d')]);_0x2f5458['filters']=_[_0x879a('0x3c')](_0x2f5458['model'],_0x2f5458[_0x879a('0x3d')]);_0x26ba26['attributes']=_[_0x879a('0x3c')](_0x2f5458[_0x879a('0x3a')],qs[_0x879a('0x3e')](_0x5266e1[_0x879a('0x3d')][_0x879a('0x3e')]));_0x26ba26[_0x879a('0x3f')]=_0x26ba26[_0x879a('0x3f')][_0x879a('0x5c')]?_0x26ba26[_0x879a('0x3f')]:_0x2f5458[_0x879a('0x3a')];if(!_0x5266e1[_0x879a('0x3d')][_0x879a('0x40')](_0x879a('0xbe'))){_0x26ba26[_0x879a('0x23')]=qs[_0x879a('0x23')](_0x5266e1[_0x879a('0x3d')][_0x879a('0x23')]);_0x26ba26[_0x879a('0x21')]=qs[_0x879a('0x21')](_0x5266e1[_0x879a('0x3d')]['offset']);}_0x26ba26[_0x879a('0x41')]=qs['sort'](_0x5266e1[_0x879a('0x3d')][_0x879a('0x42')]);_0x26ba26['where']=qs[_0x879a('0x3b')](_[_0x879a('0xbf')](_0x5266e1[_0x879a('0x3d')],_0x2f5458[_0x879a('0x3b')]));_0x26ba26[_0x879a('0x43')][_0x879a('0xc0')]=_0x3d03ad['id'];if(_0x5266e1[_0x879a('0x3d')][_0x879a('0x7f')]){_0x26ba26[_0x879a('0x43')]=_[_0x879a('0xb3')](_0x26ba26[_0x879a('0x43')],{'$or':_[_0x879a('0x35')](_0x26ba26[_0x879a('0x3f')],function(_0x1f6f42){var _0x3ce8df={};_0x3ce8df[_0x1f6f42]={'$like':'%'+_0x5266e1[_0x879a('0x3d')][_0x879a('0x7f')]+'%'};return _0x3ce8df;})});}if(_0x5266e1[_0x879a('0x3d')][_0x879a('0x74')]){var _0x5ba769=_0x5266e1[_0x879a('0x3d')][_0x879a('0x74')][_0x879a('0xc1')](',');var _0x4227de={};_0x4227de[_0x5ba769[0x0]]={'$gte':moment(_0x5ba769[0x1])[_0x879a('0xc2')](_0x879a('0xc3'))};_0x26ba26['where']=_[_0x879a('0xb3')](_0x26ba26[_0x879a('0x43')],_0x4227de);}_0x26ba26=_[_0x879a('0xb3')]({},_0x26ba26,_0x5266e1[_0x879a('0xb4')]);return db['WhatsappMessage'][_0x879a('0x24')]({'where':_0x26ba26['where']})['then'](function(_0x283258){_0x4edfc4[_0x879a('0x24')]=_0x283258;if(_0x5266e1[_0x879a('0x3d')]['includeAll']){_0x26ba26['include']=[{'all':!![]}];}return db[_0x879a('0xb9')][_0x879a('0xc4')](_0x26ba26);})['then'](function(_0x292667){_0x4edfc4[_0x879a('0xc5')]=_0x292667;return _0x4edfc4;});}})['then'](respondWithFilteredResult(_0xe7faac,_0x26ba26))[_0x879a('0x33')](handleError(_0xe7faac,null));};exports[_0x879a('0xc6')]=function(_0x1e0471,_0x430b21,_0x3cf032){return db[_0x879a('0x36')][_0x879a('0xb5')]({'where':{'id':_0x1e0471['params']['id']}})[_0x879a('0x28')](handleEntityNotFound(_0x430b21,null))[_0x879a('0x28')](function(_0x8e5d29){if(_0x8e5d29){return _0x8e5d29[_0x879a('0xc7')](_0x1e0471[_0x879a('0x6e')][_0x879a('0xba')],_['omit'](_0x1e0471[_0x879a('0x6e')],[_0x879a('0xba'),'id'])||{})[_0x879a('0xc8')](function(){return db['Tag']['findAll']({'attributes':['id',_0x879a('0x2d'),_0x879a('0x46')],'where':{'id':_0x1e0471[_0x879a('0x6e')][_0x879a('0xba')]}});})[_0x879a('0x28')](function(_0x3887fd){socket[_0x879a('0xc9')](_0x879a('0xca'),{'id':Number(_0x1e0471['params']['id']),'tags':_0x3887fd||[]});return{'id':Number(_0x1e0471[_0x879a('0xaf')]['id']),'tags':_0x3887fd||[]};});}})[_0x879a('0x28')](respondWithResult(_0x430b21,null))[_0x879a('0x33')](handleError(_0x430b21,null));};exports['removeTags']=function(_0x18e37f,_0x8077b1,_0x46c94d){return db[_0x879a('0x36')][_0x879a('0xb5')]({'where':{'id':_0x18e37f[_0x879a('0xaf')]['id']}})[_0x879a('0x28')](handleEntityNotFound(_0x8077b1,null))[_0x879a('0x28')](function(_0x1dfaec){if(_0x1dfaec){return _0x1dfaec[_0x879a('0xcb')](_0x18e37f[_0x879a('0x3d')][_0x879a('0xba')]);}})[_0x879a('0x28')](respondWithStatusCode(_0x8077b1,null))[_0x879a('0x33')](handleError(_0x8077b1,null));};exports['download']=function(_0x309a2c,_0x50ef89){var _0xa09a57=moment()[_0x879a('0xcc')]()[_0x879a('0x94')]();var _0x31c0f2=path[_0x879a('0xcd')](config[_0x879a('0xce')],_0x879a('0xcf'),_0x879a('0xd0'),_0x879a('0xd1'));var _0x1d2311=path[_0x879a('0xcd')](config[_0x879a('0xce')],_0x879a('0xcf'),_0x879a('0xd0'),_0x879a('0xd2'));var _0x14a142=path[_0x879a('0xcd')](_0x31c0f2,_0xa09a57);var _0x35145c=util['format'](_0x879a('0xd3'),_0x309a2c[_0x879a('0xaf')]['id'],_0xa09a57);var _0xcf120e=path[_0x879a('0xcd')](_0x31c0f2,_0x35145c);var _0x127203=[];_0x127203['push']({'model':db[_0x879a('0x6a')],'as':_0x879a('0x6a'),'attributes':['id',_0x879a('0xd4')],'raw':!![]});_0x127203[_0x879a('0x31')]({'model':db[_0x879a('0xd5')],'as':_0x879a('0x61'),'attributes':['id',_0x879a('0xd6'),_0x879a('0xd7')],'raw':!![]});if(_0x309a2c[_0x879a('0x3d')][_0x879a('0xd2')]){_0x127203[_0x879a('0x31')]({'model':db['Attachment'],'as':_0x879a('0xd8'),'raw':!![]});}var _0x37dfb0=[{'model':db[_0x879a('0xb9')],'as':_0x879a('0xd9'),'attributes':['id',_0x879a('0x6e'),'createdAt','direction',_0x879a('0xda'),_0x879a('0x7a')],'include':_0x127203}];_0x37dfb0[_0x879a('0x31')]({'model':db[_0x879a('0xdb')],'as':_0x879a('0xdc'),'attributes':['id','name']});_0x37dfb0[_0x879a('0x31')]({'model':db[_0x879a('0x6a')],'as':_0x879a('0xdd'),'attributes':['id',_0x879a('0xd4')]});return db['WhatsappInteraction'][_0x879a('0xb5')]({'where':{'id':_0x309a2c['params']['id']},'include':_0x37dfb0})[_0x879a('0x28')](handleEntityNotFound(_0x50ef89,null))['then'](function(_0x202931){if(_0x202931){var _0x54fa5d=_0x202931['get']({'plain':!![]});fs['mkdirSync'](_0x14a142);var _0x185395={'channel':_0x879a('0xde'),'account':_0x54fa5d[_0x879a('0xdc')]['name'],'agent':_0x54fa5d[_0x879a('0xdd')]?_0x54fa5d[_0x879a('0xdd')][_0x879a('0xd4')]:_0x879a('0xdf'),'createdAt':moment(_0x54fa5d[_0x879a('0x73')])[_0x879a('0xc2')](_0x879a('0xc3'))[_0x879a('0x94')](),'closedAt':_0x54fa5d['closed']?moment(_0x54fa5d[_0x879a('0xe0')])[_0x879a('0xc2')](_0x879a('0xc3'))['toString']():'','disposition':_0x54fa5d[_0x879a('0xe1')],'messages':_(_0x54fa5d[_0x879a('0xd9')])[_0x879a('0x7f')]({'secret':![]})[_0x879a('0x35')](function(_0x3dbd46){if(_0x3dbd46['Attachment']){var _0x15ae90=path[_0x879a('0xcd')](_0x1d2311,_0x3dbd46[_0x879a('0xd8')][_0x879a('0xe2')]);if(fs[_0x879a('0xe3')](_0x15ae90)){fs[_0x879a('0xe4')](_0x15ae90)[_0x879a('0xe5')](fs[_0x879a('0xe6')](path[_0x879a('0xcd')](_0x14a142,_0x3dbd46['Attachment'][_0x879a('0xe2')])));}}return{'date':moment(_0x3dbd46['createdAt'])[_0x879a('0xc2')](_0x879a('0xc3'))[_0x879a('0x94')](),'sender':_0x3dbd46[_0x879a('0xe7')]==='out'?_0x3dbd46[_0x879a('0x6a')]?_0x3dbd46[_0x879a('0x6a')][_0x879a('0xd4')]:_0x879a('0xe8'):_0x3dbd46['Contact']['firstName']+(_0x3dbd46[_0x879a('0x61')][_0x879a('0xd7')]?'\x20'+_0x3dbd46[_0x879a('0x61')][_0x879a('0xd7')]:''),'body':_0x3dbd46[_0x879a('0xd8')]?_0x3dbd46[_0x879a('0xd8')][_0x879a('0xe2')]:_0x3dbd46[_0x879a('0x6e')],'direction':_0x3dbd46['direction']==='out'?'A':'C','secret':_0x3dbd46['secret'],'read':_0x3dbd46[_0x879a('0x7a')],'attachment':_0x3dbd46[_0x879a('0xd8')]};})[_0x879a('0x5d')]()};return ejs[_0x879a('0xe9')](path[_0x879a('0xcd')](config[_0x879a('0xce')],_0x879a('0xcf'),'views',_0x879a('0xea')),{'interaction':_0x185395})[_0x879a('0x28')](function(_0x5f42a8){var _0x4b5be8=path[_0x879a('0xcd')](_0x14a142,_0x879a('0xeb')+_0x54fa5d['id']+'-'+_0xa09a57+_0x879a('0xec'));var _0x54f418={'path':_0x4b5be8,'channel':_0x879a('0xde'),'interactionId':_0x54fa5d['id']};return pdf['createPdfFromHTML'](_0x5f42a8,_0x54f418);})[_0x879a('0x28')](function(){return new BPromise(function(_0x13f261,_0x51eb1e){zipdir(_0x14a142,{'saveTo':_0xcf120e},function(_0x54dfc9,_0x319b23){if(_0x54dfc9)return _0x51eb1e(_0x54dfc9);return _0x13f261(_0x319b23);});})['then'](function(){return new BPromise(function(_0x44caf8,_0x9bb841){rimraf(_0x14a142,function(_0x520b45){if(_0x520b45)_0x9bb841(_0x520b45);return _0x44caf8();});});})['then'](function(){return _0x50ef89['download'](_0xcf120e,_0x35145c,function(_0xfdac50){if(_0xfdac50){console[_0x879a('0xed')](_0x879a('0xee'),_0xfdac50);}else{fs[_0x879a('0xef')](_0xcf120e);}});});});}else{return _0x50ef89['sendStatus'](0xc8);}})['catch'](handleError(_0x50ef89,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 72f180d..610b471 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 _0xbefe=['hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x34da1e,_0x38364b){var _0x4f291c=function(_0x2cdfa1){while(--_0x2cdfa1){_0x34da1e['push'](_0x34da1e['shift']());}};_0x4f291c(++_0x38364b);}(_0xbefe,0x168));var _0xebef=function(_0x34520d,_0x31419e){_0x34520d=_0x34520d-0x0;var _0x8b8eb=_0xbefe[_0x34520d];return _0x8b8eb;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xebef('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xebef('0x0'))['db'][_0xebef('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xebef('0x2')](0x0);var events={'afterCreate':_0xebef('0x3'),'afterUpdate':_0xebef('0x4'),'afterDestroy':_0xebef('0x5')};function emitEvent(_0x33b5a7){return function(_0x2e79b7,_0x563623,_0x3fe404){_0x2e79b7[_0xebef('0x6')]({'attributes':['id'],'raw':!![]})[_0xebef('0x7')](function(_0x4fb4fa){_0x2e79b7[_0xebef('0x8')](_0xebef('0x9'),_0x4fb4fa['map'](function(_0x4d28bb){return{'id':_0x4d28bb['id']};}));return WhatsappMessage[_0xebef('0xa')]({'where':{'WhatsappInteractionId':_0x2e79b7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xebef('0x7')](function(_0x187f3b){_0x2e79b7[_0xebef('0x8')](_0xebef('0xb'),_0x187f3b[_0xebef('0xc')]);WhatsappInteractionEvents[_0xebef('0xd')](_0x33b5a7+':'+_0x2e79b7['id'],_0x2e79b7);WhatsappInteractionEvents[_0xebef('0xd')](_0x33b5a7,_0x2e79b7);_0x3fe404(null);})['catch'](_0x3fe404(null));};}for(var e in events){if(events[_0xebef('0xe')](e)){var event=events[e];WhatsappInteraction[_0xebef('0xf')](e,emitEvent(event));}}module[_0xebef('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x2557=['WhatsappMessage','setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook','events','WhatsappInteraction','../../mysqldb'];(function(_0x5d2ed9,_0x16c436){var _0x4262c5=function(_0x124aee){while(--_0x124aee){_0x5d2ed9['push'](_0x5d2ed9['shift']());}};_0x4262c5(++_0x16c436);}(_0x2557,0x11e));var _0x7255=function(_0x277214,_0x4fd1a4){_0x277214=_0x277214-0x0;var _0x189448=_0x2557[_0x277214];return _0x189448;};'use strict';var EventEmitter=require(_0x7255('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x7255('0x1')];var WhatsappMessage=require(_0x7255('0x2'))['db'][_0x7255('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7255('0x4')](0x0);var events={'afterCreate':_0x7255('0x5'),'afterUpdate':_0x7255('0x6'),'afterDestroy':'remove'};function emitEvent(_0x4fc880){return function(_0x4c178b,_0x572124,_0x937dce){_0x4c178b[_0x7255('0x7')]({'attributes':['id'],'raw':!![]})[_0x7255('0x8')](function(_0x419dc0){_0x4c178b[_0x7255('0x9')]('Users',_0x419dc0[_0x7255('0xa')](function(_0x34511b){return{'id':_0x34511b['id']};}));return WhatsappMessage[_0x7255('0xb')]({'where':{'WhatsappInteractionId':_0x4c178b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x426b05){_0x4c178b[_0x7255('0x9')](_0x7255('0xc'),_0x426b05[_0x7255('0xd')]);WhatsappInteractionEvents[_0x7255('0xe')](_0x4fc880+':'+_0x4c178b['id'],_0x4c178b);WhatsappInteractionEvents[_0x7255('0xe')](_0x4fc880,_0x4c178b);_0x937dce(null);})[_0x7255('0xf')](_0x937dce(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x7255('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 37058c0..67924e6 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 _0xf234=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x2a7d55,_0x36bd70){var _0x137989=function(_0x51246a){while(--_0x51246a){_0x2a7d55['push'](_0x2a7d55['shift']());}};_0x137989(++_0x36bd70);}(_0xf234,0xeb));var _0x4f23=function(_0x1d4190,_0x1ade45){_0x1d4190=_0x1d4190-0x0;var _0x1af321=_0xf234[_0x1d4190];return _0x1af321;};'use strict';var _=require(_0x4f23('0x0'));var util=require(_0x4f23('0x1'));var logger=require(_0x4f23('0x2'))(_0x4f23('0x3'));var moment=require(_0x4f23('0x4'));var BPromise=require(_0x4f23('0x5'));var rp=require(_0x4f23('0x6'));var fs=require('fs');var path=require(_0x4f23('0x7'));var rimraf=require(_0x4f23('0x8'));var config=require(_0x4f23('0x9'));var attributes=require(_0x4f23('0xa'));module[_0x4f23('0xb')]=function(_0x1e01f7,_0x2315b2){return _0x1e01f7['define'](_0x4f23('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14ad4b,_0x5ee830,_0x172629){if(_0x14ad4b[_0x4f23('0xd')]('closed')){_0x14ad4b['closedAt']=moment()[_0x4f23('0xe')](_0x4f23('0xf'));}_0x172629(null,_0x14ad4b);}}});}; \ No newline at end of file +var _0x173d=['util','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','whatsapp_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xd308f,_0x3d0a33){var _0x24595c=function(_0x3e51b9){while(--_0x3e51b9){_0xd308f['push'](_0xd308f['shift']());}};_0x24595c(++_0x3d0a33);}(_0x173d,0x108));var _0xd173=function(_0x1798c4,_0x165968){_0x1798c4=_0x1798c4-0x0;var _0x11a800=_0x173d[_0x1798c4];return _0x11a800;};'use strict';var _=require('lodash');var util=require(_0xd173('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd173('0x1'));var BPromise=require('bluebird');var rp=require(_0xd173('0x2'));var fs=require('fs');var path=require(_0xd173('0x3'));var rimraf=require(_0xd173('0x4'));var config=require(_0xd173('0x5'));var attributes=require(_0xd173('0x6'));module['exports']=function(_0x24f796,_0x2d464b){return _0x24f796[_0xd173('0x7')]('WhatsappInteraction',attributes,{'tableName':_0xd173('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5229ad,_0x3a1529,_0x519963){if(_0x5229ad['changed'](_0xd173('0x9'))){_0x5229ad[_0xd173('0xa')]=moment()['format'](_0xd173('0xb'));}_0x519963(null,_0x5229ad);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 01ce96e..a924b3b 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 _0x9cb3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','register','request','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','UpdateWhatsappInteraction','WhatsappInteraction','update','options','where','limit','then','catch','find','addTags','ids','body','spread','AddTags'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9cb3,0x171));var _0x39cb=function(_0x4dbcd6,_0x34326c){_0x4dbcd6=_0x4dbcd6-0x0;var _0x541e55=_0x9cb3[_0x4dbcd6];return _0x541e55;};'use strict';var _=require(_0x39cb('0x0'));var util=require(_0x39cb('0x1'));var moment=require(_0x39cb('0x2'));var BPromise=require(_0x39cb('0x3'));var rs=require(_0x39cb('0x4'));var fs=require('fs');var Redis=require(_0x39cb('0x5'));var db=require(_0x39cb('0x6'))['db'];var utils=require(_0x39cb('0x7'));var logger=require(_0x39cb('0x8'))('rpc');var config=require(_0x39cb('0x9'));var jayson=require(_0x39cb('0xa'));var client=jayson['client'][_0x39cb('0xb')]({'port':0x232a});config['redis']=_[_0x39cb('0xc')](config['redis'],{'host':_0x39cb('0xd'),'port':0x18eb});var socket=require(_0x39cb('0xe'))(new Redis(config[_0x39cb('0xf')]));require(_0x39cb('0x10'))[_0x39cb('0x11')](socket);function respondWithRpcPromise(_0x444da2,_0x50eae9,_0x43462a){return new BPromise(function(_0xa4784e,_0x11011c){return client[_0x39cb('0x12')](_0x444da2,_0x43462a)['then'](function(_0x23b322){logger['info'](_0x39cb('0x13'),_0x50eae9,'request\x20sent');logger[_0x39cb('0x14')](_0x39cb('0x15'),_0x50eae9,_0x39cb('0x16'),JSON[_0x39cb('0x17')](_0x23b322));if(_0x23b322[_0x39cb('0x18')]){if(_0x23b322[_0x39cb('0x18')]['code']===0x1f4){logger[_0x39cb('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x50eae9,_0x23b322[_0x39cb('0x18')][_0x39cb('0x19')]);return _0x11011c(_0x23b322[_0x39cb('0x18')][_0x39cb('0x19')]);}logger['error'](_0x39cb('0x13'),_0x50eae9,_0x23b322[_0x39cb('0x18')][_0x39cb('0x19')]);return _0xa4784e(_0x23b322['error'][_0x39cb('0x19')]);}else{logger[_0x39cb('0x1a')](_0x39cb('0x13'),_0x50eae9,_0x39cb('0x16'));_0xa4784e(_0x23b322['result'][_0x39cb('0x19')]);}})['catch'](function(_0x3e7eaf){logger[_0x39cb('0x18')](_0x39cb('0x13'),_0x50eae9,_0x3e7eaf);_0x11011c(_0x3e7eaf);});});}exports[_0x39cb('0x1b')]=function(_0x3a733d){var _0x9b0d4c=this;return new Promise(function(_0x2a88b0,_0x26afa1){return db[_0x39cb('0x1c')][_0x39cb('0x1d')](_0x3a733d['body'],{'raw':_0x3a733d[_0x39cb('0x1e')]?_0x3a733d[_0x39cb('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a733d['options']?_0x3a733d[_0x39cb('0x1e')][_0x39cb('0x1f')]||null:null,'attributes':_0x3a733d[_0x39cb('0x1e')]?_0x3a733d[_0x39cb('0x1e')]['attributes']||null:null,'limit':_0x3a733d[_0x39cb('0x1e')]?_0x3a733d[_0x39cb('0x1e')][_0x39cb('0x20')]||null:null})[_0x39cb('0x21')](function(_0x10667b){logger[_0x39cb('0x1a')](_0x39cb('0x1b'),_0x3a733d);logger[_0x39cb('0x14')]('UpdateWhatsappInteraction',_0x3a733d,JSON[_0x39cb('0x17')](_0x10667b));_0x2a88b0(_0x10667b);})[_0x39cb('0x22')](function(_0x4518ee){logger[_0x39cb('0x18')](_0x39cb('0x1b'),_0x4518ee[_0x39cb('0x19')],_0x3a733d);_0x26afa1(_0x9b0d4c[_0x39cb('0x18')](0x1f4,_0x4518ee[_0x39cb('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x59b75a){return new Promise(function(_0x2021fc,_0x32878e){return db[_0x39cb('0x1c')][_0x39cb('0x23')]({'where':_0x59b75a[_0x39cb('0x1e')]?_0x59b75a[_0x39cb('0x1e')][_0x39cb('0x1f')]||null:null})[_0x39cb('0x21')](function(_0x246581){if(_0x246581){return _0x246581[_0x39cb('0x24')](_0x59b75a['body'][_0x39cb('0x25')],_['omit'](_0x59b75a[_0x39cb('0x26')],[_0x39cb('0x25'),'id'])||{});}})[_0x39cb('0x27')](function(_0xc46233){logger[_0x39cb('0x1a')](_0x39cb('0x28'),_0x59b75a);logger[_0x39cb('0x14')]('AddTags',_0x59b75a,JSON[_0x39cb('0x17')](_0xc46233));_0x2021fc(_0xc46233);})[_0x39cb('0x22')](function(_0x299285){logger[_0x39cb('0x18')](_0x39cb('0x28'),_0x299285[_0x39cb('0x19')],_0x59b75a);_0x32878e(_this[_0x39cb('0x18')](0x1f4,_0x299285[_0x39cb('0x19')]));});});}; \ No newline at end of file +var _0xf860=['attributes','limit','then','stringify','AddTagsToWhatsappInteraction','addTags','ids','omit','AddTags','lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where'];(function(_0x492275,_0x44cb8b){var _0xe2777d=function(_0x30f0a2){while(--_0x30f0a2){_0x492275['push'](_0x492275['shift']());}};_0xe2777d(++_0x44cb8b);}(_0xf860,0xed));var _0x0f86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf860[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0f86('0x0'));var util=require(_0x0f86('0x1'));var moment=require(_0x0f86('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f86('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f86('0x4'))(_0x0f86('0x5'));var config=require('../../config/environment');var jayson=require(_0x0f86('0x6'));var client=jayson[_0x0f86('0x7')][_0x0f86('0x8')]({'port':0x232a});config[_0x0f86('0x9')]=_[_0x0f86('0xa')](config[_0x0f86('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0f86('0xb'))(new Redis(config[_0x0f86('0x9')]));require('./whatsappInteraction.socket')[_0x0f86('0xc')](socket);function respondWithRpcPromise(_0x4255fe,_0x2785cc,_0x396d2c){return new BPromise(function(_0xf114eb,_0x4caf07){return client['request'](_0x4255fe,_0x396d2c)['then'](function(_0x58a249){logger[_0x0f86('0xd')](_0x0f86('0xe'),_0x2785cc,_0x0f86('0xf'));logger[_0x0f86('0x10')](_0x0f86('0x11'),_0x2785cc,_0x0f86('0xf'),JSON['stringify'](_0x58a249));if(_0x58a249[_0x0f86('0x12')]){if(_0x58a249['error'][_0x0f86('0x13')]===0x1f4){logger[_0x0f86('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x2785cc,_0x58a249['error'][_0x0f86('0x14')]);return _0x4caf07(_0x58a249[_0x0f86('0x12')]['message']);}logger[_0x0f86('0x12')](_0x0f86('0xe'),_0x2785cc,_0x58a249[_0x0f86('0x12')][_0x0f86('0x14')]);return _0xf114eb(_0x58a249[_0x0f86('0x12')]['message']);}else{logger[_0x0f86('0xd')]('WhatsappInteraction,\x20%s,\x20%s',_0x2785cc,'request\x20sent');_0xf114eb(_0x58a249[_0x0f86('0x15')][_0x0f86('0x14')]);}})[_0x0f86('0x16')](function(_0x3dd55d){logger[_0x0f86('0x12')](_0x0f86('0xe'),_0x2785cc,_0x3dd55d);_0x4caf07(_0x3dd55d);});});}exports[_0x0f86('0x17')]=function(_0x2242aa){var _0x1bf9f9=this;return new Promise(function(_0x468b2f,_0x3d3359){return db[_0x0f86('0x18')]['update'](_0x2242aa[_0x0f86('0x19')],{'raw':_0x2242aa[_0x0f86('0x1a')]?_0x2242aa['options'][_0x0f86('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2242aa['options']?_0x2242aa[_0x0f86('0x1a')][_0x0f86('0x1c')]||null:null,'attributes':_0x2242aa[_0x0f86('0x1a')]?_0x2242aa[_0x0f86('0x1a')][_0x0f86('0x1d')]||null:null,'limit':_0x2242aa[_0x0f86('0x1a')]?_0x2242aa[_0x0f86('0x1a')][_0x0f86('0x1e')]||null:null})[_0x0f86('0x1f')](function(_0xb37262){logger[_0x0f86('0xd')](_0x0f86('0x17'),_0x2242aa);logger[_0x0f86('0x10')](_0x0f86('0x17'),_0x2242aa,JSON[_0x0f86('0x20')](_0xb37262));_0x468b2f(_0xb37262);})[_0x0f86('0x16')](function(_0x18a9b0){logger[_0x0f86('0x12')]('UpdateWhatsappInteraction',_0x18a9b0[_0x0f86('0x14')],_0x2242aa);_0x3d3359(_0x1bf9f9[_0x0f86('0x12')](0x1f4,_0x18a9b0[_0x0f86('0x14')]));});});};exports[_0x0f86('0x21')]=function(_0x32c6d8){return new Promise(function(_0xb0123b,_0x321188){return db[_0x0f86('0x18')]['find']({'where':_0x32c6d8[_0x0f86('0x1a')]?_0x32c6d8[_0x0f86('0x1a')][_0x0f86('0x1c')]||null:null})[_0x0f86('0x1f')](function(_0x5c8410){if(_0x5c8410){return _0x5c8410[_0x0f86('0x22')](_0x32c6d8['body'][_0x0f86('0x23')],_[_0x0f86('0x24')](_0x32c6d8['body'],[_0x0f86('0x23'),'id'])||{});}})['spread'](function(_0x1326d9){logger['info'](_0x0f86('0x25'),_0x32c6d8);logger['debug'](_0x0f86('0x25'),_0x32c6d8,JSON[_0x0f86('0x20')](_0x1326d9));_0xb0123b(_0x1326d9);})[_0x0f86('0x16')](function(_0x411bd0){logger['error'](_0x0f86('0x25'),_0x411bd0[_0x0f86('0x14')],_0x32c6d8);_0x321188(_this[_0x0f86('0x12')](0x1f4,_0x411bd0[_0x0f86('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index bffae56..824c5dd 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 _0x1579=['save','remove','update','removeListener','register','./whatsappInteraction.events'];(function(_0x3e0191,_0x1d4b20){var _0xf2ae83=function(_0x277210){while(--_0x277210){_0x3e0191['push'](_0x3e0191['shift']());}};_0xf2ae83(++_0x1d4b20);}(_0x1579,0x14f));var _0x9157=function(_0x52e966,_0x3eb061){_0x52e966=_0x52e966-0x0;var _0x241eee=_0x1579[_0x52e966];return _0x241eee;};'use strict';var WhatsappInteractionEvents=require(_0x9157('0x0'));var events=[_0x9157('0x1'),_0x9157('0x2'),_0x9157('0x3')];function createListener(_0x73b89f,_0x541360){return function(_0x4d009f){_0x541360['emit'](_0x73b89f,_0x4d009f);};}function removeListener(_0xa30169,_0x5975a0){return function(){WhatsappInteractionEvents[_0x9157('0x4')](_0xa30169,_0x5975a0);};}exports[_0x9157('0x5')]=function(_0x5b5445){for(var _0x2b3601=0x0,_0x1543bb=events['length'];_0x2b3601<_0x1543bb;_0x2b3601++){var _0x147b46=events[_0x2b3601];var _0x3443ab=createListener('whatsappInteraction:'+_0x147b46,_0x5b5445);WhatsappInteractionEvents['on'](_0x147b46,_0x3443ab);}}; \ No newline at end of file +var _0x9df4=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9df4,0x78));var _0x49df=function(_0xb02766,_0xa37d90){_0xb02766=_0xb02766-0x0;var _0x560e6c=_0x9df4[_0xb02766];return _0x560e6c;};'use strict';var WhatsappInteractionEvents=require(_0x49df('0x0'));var events=[_0x49df('0x1'),_0x49df('0x2'),_0x49df('0x3')];function createListener(_0x626ca5,_0x51d96f){return function(_0xcdb0b){_0x51d96f[_0x49df('0x4')](_0x626ca5,_0xcdb0b);};}function removeListener(_0x5d0aef,_0x39016b){return function(){WhatsappInteractionEvents[_0x49df('0x5')](_0x5d0aef,_0x39016b);};}exports[_0x49df('0x6')]=function(_0x30cdb1){for(var _0xd694b7=0x0,_0x41031e=events[_0x49df('0x7')];_0xd694b7<_0x41031e;_0xd694b7++){var _0x1f2368=events[_0xd694b7];var _0x1d44a5=createListener(_0x49df('0x8')+_0x1f2368,_0x30cdb1);WhatsappInteractionEvents['on'](_0x1f2368,_0x1d44a5);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 4c90a6e..1b45175 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 _0xca09=['isAuthenticated','describe','show','post','tracked','whatsappmessage:create','/:id/status','put','/:id','update','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller'];(function(_0x3c69bc,_0x424700){var _0x3a0c87=function(_0x2d3c31){while(--_0x2d3c31){_0x3c69bc['push'](_0x3c69bc['shift']());}};_0x3a0c87(++_0x424700);}(_0xca09,0xdd));var _0x9ca0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca09[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x9ca0('0x0'));var util=require(_0x9ca0('0x1'));var path=require(_0x9ca0('0x2'));var timeout=require(_0x9ca0('0x3'));var express=require(_0x9ca0('0x4'));var router=express[_0x9ca0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9ca0('0x6'));var interaction=require(_0x9ca0('0x7'));var config=require('../../config/environment');var controller=require(_0x9ca0('0x8'));router['get']('/',auth[_0x9ca0('0x9')](),controller['index']);router['get']('/describe',auth[_0x9ca0('0x9')](),controller[_0x9ca0('0xa')]);router['get']('/:id',auth[_0x9ca0('0x9')](),controller[_0x9ca0('0xb')]);router[_0x9ca0('0xc')]('/',auth[_0x9ca0('0x9')](),interaction[_0x9ca0('0xd')]('whatsapp',_0x9ca0('0xe')),controller['create']);router[_0x9ca0('0xc')](_0x9ca0('0xf'),controller['status']);router[_0x9ca0('0x10')](_0x9ca0('0x11'),auth[_0x9ca0('0x9')](),controller[_0x9ca0('0x12')]);router['put']('/:id/accept',auth[_0x9ca0('0x9')](),controller['accept']);router['put'](_0x9ca0('0x13'),auth['isAuthenticated'](),controller[_0x9ca0('0x14')]);router[_0x9ca0('0x15')](_0x9ca0('0x11'),auth[_0x9ca0('0x9')](),controller[_0x9ca0('0x16')]);module['exports']=router; \ No newline at end of file +var _0xaba9=['whatsappmessage:create','create','status','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xaba9,0x83));var _0x9aba=function(_0x566657,_0x1fceb3){_0x566657=_0x566657-0x0;var _0x52dd34=_0xaba9[_0x566657];return _0x52dd34;};'use strict';var multer=require(_0x9aba('0x0'));var util=require(_0x9aba('0x1'));var path=require(_0x9aba('0x2'));var timeout=require(_0x9aba('0x3'));var express=require(_0x9aba('0x4'));var router=express[_0x9aba('0x5')]();var fs_extra=require(_0x9aba('0x6'));var auth=require(_0x9aba('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9aba('0x8'));var controller=require(_0x9aba('0x9'));router[_0x9aba('0xa')]('/',auth['isAuthenticated'](),controller[_0x9aba('0xb')]);router['get'](_0x9aba('0xc'),auth[_0x9aba('0xd')](),controller[_0x9aba('0xe')]);router['get'](_0x9aba('0xf'),auth[_0x9aba('0xd')](),controller[_0x9aba('0x10')]);router[_0x9aba('0x11')]('/',auth[_0x9aba('0xd')](),interaction[_0x9aba('0x12')]('whatsapp',_0x9aba('0x13')),controller[_0x9aba('0x14')]);router[_0x9aba('0x11')]('/:id/status',controller[_0x9aba('0x15')]);router[_0x9aba('0x16')](_0x9aba('0xf'),auth['isAuthenticated'](),controller[_0x9aba('0x17')]);router[_0x9aba('0x16')]('/:id/accept',auth[_0x9aba('0xd')](),controller[_0x9aba('0x18')]);router['put'](_0x9aba('0x19'),auth[_0x9aba('0xd')](),controller[_0x9aba('0x1a')]);router[_0x9aba('0x1b')](_0x9aba('0xf'),auth[_0x9aba('0xd')](),controller[_0x9aba('0x1c')]);module[_0x9aba('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index b251985..a5a19e4 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 _0xde0f=['DATE','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xde0f,0xa2));var _0xfde0=function(_0x7d6ce3,_0xb94a0b){_0x7d6ce3=_0x7d6ce3-0x0;var _0x23b20d=_0xde0f[_0x7d6ce3];return _0x23b20d;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xfde0('0x0')](_0xfde0('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfde0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfde0('0x3')]('in',_0xfde0('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xfde0('0x5')](0xbe)},'phone':{'type':Sequelize[_0xfde0('0x5')]},'readAt':{'type':Sequelize[_0xfde0('0x6')]},'secret':{'type':Sequelize[_0xfde0('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfde0('0x5')]},'providerResponse':{'type':Sequelize[_0xfde0('0x0')]}}; \ No newline at end of file +var _0x7627=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT'];(function(_0xc94586,_0x494f27){var _0x53dc74=function(_0x21d3a5){while(--_0x21d3a5){_0xc94586['push'](_0xc94586['shift']());}};_0x53dc74(++_0x494f27);}(_0x7627,0x172));var _0x7762=function(_0x24cc83,_0x2ca74e){_0x24cc83=_0x24cc83-0x0;var _0x9bb3e1=_0x7627[_0x24cc83];return _0x9bb3e1;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7762('0x0')](_0x7762('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7762('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7762('0x3')]('in',_0x7762('0x4')),'defaultValue':_0x7762('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7762('0x5')](0xbe)},'phone':{'type':Sequelize[_0x7762('0x5')]},'readAt':{'type':Sequelize[_0x7762('0x6')]},'secret':{'type':Sequelize[_0x7762('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7762('0x5')]},'providerResponse':{'type':Sequelize[_0x7762('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 291145b..481ebac 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 _0x64a5=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappMessage.socket','register','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','../../config/logger','whatsapp-interactions','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','SIP/%s','channel','motionChannel','accept','EventManager','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0xa3f3f4,_0x17569d){var _0x45f916=function(_0x1ed339){while(--_0x1ed339){_0xa3f3f4['push'](_0xa3f3f4['shift']());}};_0x45f916(++_0x17569d);}(_0x64a5,0x80));var _0x564a=function(_0x47503c,_0x3aee9b){_0x47503c=_0x47503c-0x0;var _0x2c3de5=_0x64a5[_0x47503c];return _0x2c3de5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x564a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x564a('0x1'));var rp=require(_0x564a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x564a('0x3'));var util=require(_0x564a('0x4'));var path=require(_0x564a('0x5'));var sox=require(_0x564a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x564a('0x7'));var _=require('lodash');var squel=require(_0x564a('0x8'));var crypto=require(_0x564a('0x9'));var jsforce=require(_0x564a('0xa'));var deskjs=require(_0x564a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x564a('0xc'));var Papa=require('papaparse');var Redis=require(_0x564a('0xd'));var authService=require(_0x564a('0xe'));var qs=require(_0x564a('0xf'));var as=require(_0x564a('0x10'));var hardwareService=require(_0x564a('0x11'));var logger=require('../../config/logger')(_0x564a('0x12'));var utils=require('../../config/utils');var config=require(_0x564a('0x13'));var licenseUtil=require(_0x564a('0x14'));var db=require('../../mysqldb')['db'];config[_0x564a('0x15')]=_[_0x564a('0x16')](config[_0x564a('0x15')],{'host':_0x564a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x564a('0x15')]));require(_0x564a('0x18'))[_0x564a('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x564a('0x1a')]({'port':0x232c});var client9002=jayson[_0x564a('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x967068,_0x66763,_0xa84a3c,_0x5328b4){return new BPromise(function(_0x35286c,_0x430d57){var _0x4e41ec=_0x5328b4||client;return _0x4e41ec[_0x564a('0x1c')](_0x967068,_0xa84a3c)[_0x564a('0x1d')](function(_0x181b2d){logger[_0x564a('0x1e')](_0x564a('0x1f'),_0x66763,'request\x20sent');logger[_0x564a('0x20')](_0x564a('0x21'),_0x66763,_0x564a('0x22'),JSON[_0x564a('0x23')](_0x181b2d));if(_0x181b2d['error']){if(_0x181b2d[_0x564a('0x24')]['code']===0x1f4){logger[_0x564a('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x66763,_0x181b2d[_0x564a('0x24')][_0x564a('0x25')]);return _0x430d57(_0x181b2d[_0x564a('0x24')][_0x564a('0x25')]);}logger[_0x564a('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x66763,_0x181b2d[_0x564a('0x24')][_0x564a('0x25')]);return _0x35286c(_0x181b2d['error'][_0x564a('0x25')]);}else{logger[_0x564a('0x1e')](_0x564a('0x1f'),_0x66763,_0x564a('0x22'));_0x35286c(_0x181b2d[_0x564a('0x26')][_0x564a('0x25')]);}})['catch'](function(_0x4f206c){logger[_0x564a('0x24')](_0x564a('0x1f'),_0x66763,_0x4f206c);_0x430d57(_0x4f206c);});});}function respondWithStatusCode(_0x4974bf,_0x5a5434){_0x5a5434=_0x5a5434||0xcc;return function(_0x17ac66){if(_0x17ac66){return _0x4974bf[_0x564a('0x27')](_0x5a5434);}return _0x4974bf[_0x564a('0x28')](_0x5a5434)[_0x564a('0x29')]();};}function respondWithResult(_0x20d782,_0x3a13c4){_0x3a13c4=_0x3a13c4||0xc8;return function(_0x114d54){if(_0x114d54){return _0x20d782['status'](_0x3a13c4)[_0x564a('0x2a')](_0x114d54);}};}function respondWithFilteredResult(_0x34f923,_0x18ce45){return function(_0x5b7399){if(_0x5b7399){var _0x591392=typeof _0x18ce45[_0x564a('0x2b')]===_0x564a('0x2c')&&typeof _0x18ce45[_0x564a('0x2d')]===_0x564a('0x2c');var _0x2f29a4=_0x5b7399[_0x564a('0x2e')];var _0x12624b=_0x591392?0x0:_0x18ce45[_0x564a('0x2b')];var _0x31bd66=_0x591392?_0x5b7399[_0x564a('0x2e')]:_0x18ce45[_0x564a('0x2b')]+_0x18ce45[_0x564a('0x2d')];var _0x47fa58;if(_0x31bd66>=_0x2f29a4){_0x31bd66=_0x2f29a4;_0x47fa58=0xc8;}else{_0x47fa58=0xce;}_0x34f923['status'](_0x47fa58);return _0x34f923[_0x564a('0x2f')](_0x564a('0x30'),_0x12624b+'-'+_0x31bd66+'/'+_0x2f29a4)[_0x564a('0x2a')](_0x5b7399);}return null;};}function patchUpdates(_0xbe7d53){return function(_0x1e16a4){try{jsonpatch[_0x564a('0x31')](_0x1e16a4,_0xbe7d53,!![]);}catch(_0x3d767c){return BPromise[_0x564a('0x32')](_0x3d767c);}return _0x1e16a4[_0x564a('0x33')]();};}function saveUpdates(_0x962c1e,_0x172104){return function(_0x8a6df6){if(_0x8a6df6){return _0x8a6df6[_0x564a('0x34')](_0x962c1e)[_0x564a('0x1d')](function(_0x1893bb){return _0x1893bb;});}return null;};}function removeEntity(_0x459a1b,_0x24fe4d){return function(_0x3dba1e){if(_0x3dba1e){return _0x3dba1e[_0x564a('0x35')]()[_0x564a('0x1d')](function(){_0x459a1b[_0x564a('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8b7e,_0x2e0f36){return function(_0x2ab763){if(!_0x2ab763){_0x5c8b7e[_0x564a('0x27')](0x194);}return _0x2ab763;};}function handleError(_0x4ccc7b,_0x507ab9){_0x507ab9=_0x507ab9||0x1f4;return function(_0x46ace5){logger['error'](_0x46ace5[_0x564a('0x36')]);if(_0x46ace5[_0x564a('0x37')]){delete _0x46ace5[_0x564a('0x37')];}_0x4ccc7b[_0x564a('0x28')](_0x507ab9)[_0x564a('0x38')](_0x46ace5);};}exports[_0x564a('0x39')]=function(_0x1b1c8b,_0x316fd1){var _0x5d996f={},_0x667ce4={},_0x180129={'count':0x0,'rows':[]};var _0x37b22d=_[_0x564a('0x3a')](db[_0x564a('0x3b')][_0x564a('0x3c')],function(_0x13dcf4){return{'name':_0x13dcf4['fieldName'],'type':_0x13dcf4[_0x564a('0x3d')][_0x564a('0x3e')]};});_0x667ce4[_0x564a('0x3f')]=_[_0x564a('0x3a')](_0x37b22d,_0x564a('0x37'));_0x667ce4[_0x564a('0x40')]=_[_0x564a('0x41')](_0x1b1c8b[_0x564a('0x40')]);_0x667ce4[_0x564a('0x42')]=_[_0x564a('0x43')](_0x667ce4[_0x564a('0x3f')],_0x667ce4[_0x564a('0x40')]);_0x5d996f['attributes']=_[_0x564a('0x43')](_0x667ce4[_0x564a('0x3f')],qs['fields'](_0x1b1c8b['query'][_0x564a('0x44')]));_0x5d996f[_0x564a('0x45')]=_0x5d996f[_0x564a('0x45')][_0x564a('0x46')]?_0x5d996f[_0x564a('0x45')]:_0x667ce4['model'];if(!_0x1b1c8b[_0x564a('0x40')][_0x564a('0x47')](_0x564a('0x48'))){_0x5d996f[_0x564a('0x2d')]=qs['limit'](_0x1b1c8b[_0x564a('0x40')][_0x564a('0x2d')]);_0x5d996f[_0x564a('0x2b')]=qs[_0x564a('0x2b')](_0x1b1c8b[_0x564a('0x40')][_0x564a('0x2b')]);}_0x5d996f[_0x564a('0x49')]=qs[_0x564a('0x4a')](_0x1b1c8b['query'][_0x564a('0x4a')]);_0x5d996f['where']=qs[_0x564a('0x42')](_['pick'](_0x1b1c8b[_0x564a('0x40')],_0x667ce4[_0x564a('0x42')]),_0x37b22d);if(_0x1b1c8b[_0x564a('0x40')][_0x564a('0x4b')]){_0x5d996f[_0x564a('0x4c')]=_[_0x564a('0x4d')](_0x5d996f['where'],{'$or':_[_0x564a('0x3a')](_0x37b22d,function(_0x249079){if(_0x249079[_0x564a('0x3d')]!==_0x564a('0x4e')){var _0x42c13b={};_0x42c13b[_0x249079[_0x564a('0x37')]]={'$like':'%'+_0x1b1c8b[_0x564a('0x40')][_0x564a('0x4b')]+'%'};return _0x42c13b;}})});}_0x5d996f=_['merge']({},_0x5d996f,_0x1b1c8b[_0x564a('0x4f')]);var _0xa6d59f={'where':_0x5d996f[_0x564a('0x4c')]};return db[_0x564a('0x3b')][_0x564a('0x2e')](_0xa6d59f)['then'](function(_0x373e99){_0x180129[_0x564a('0x2e')]=_0x373e99;if(_0x1b1c8b[_0x564a('0x40')][_0x564a('0x50')]){_0x5d996f[_0x564a('0x51')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x564a('0x52')](_0x5d996f);})['then'](function(_0x30d6e2){_0x180129[_0x564a('0x53')]=_0x30d6e2;return _0x180129;})['then'](respondWithFilteredResult(_0x316fd1,_0x5d996f))[_0x564a('0x54')](handleError(_0x316fd1,null));};exports[_0x564a('0x55')]=function(_0x24203c,_0x5696b7){var _0x2f6052={'raw':!![],'where':{'id':_0x24203c[_0x564a('0x56')]['id']}},_0x4f01a2={};_0x4f01a2[_0x564a('0x3f')]=_[_0x564a('0x41')](db[_0x564a('0x3b')][_0x564a('0x3c')]);_0x4f01a2['query']=_[_0x564a('0x41')](_0x24203c[_0x564a('0x40')]);_0x4f01a2[_0x564a('0x42')]=_['intersection'](_0x4f01a2[_0x564a('0x3f')],_0x4f01a2[_0x564a('0x40')]);_0x2f6052['attributes']=_[_0x564a('0x43')](_0x4f01a2[_0x564a('0x3f')],qs['fields'](_0x24203c['query'][_0x564a('0x44')]));_0x2f6052[_0x564a('0x45')]=_0x2f6052[_0x564a('0x45')][_0x564a('0x46')]?_0x2f6052[_0x564a('0x45')]:_0x4f01a2[_0x564a('0x3f')];if(_0x24203c[_0x564a('0x40')][_0x564a('0x50')]){_0x2f6052['include']=[{'all':!![]}];}_0x2f6052=_[_0x564a('0x4d')]({},_0x2f6052,_0x24203c['options']);return db[_0x564a('0x3b')][_0x564a('0x57')](_0x2f6052)[_0x564a('0x1d')](handleEntityNotFound(_0x5696b7,null))['then'](respondWithResult(_0x5696b7,null))[_0x564a('0x54')](handleError(_0x5696b7,null));};exports[_0x564a('0x58')]=function(_0x423b06,_0x36e0c6){return db[_0x564a('0x3b')][_0x564a('0x58')](_0x423b06['body'],{})[_0x564a('0x1d')](respondWithResult(_0x36e0c6,0xc9))['catch'](handleError(_0x36e0c6,null));};exports[_0x564a('0x34')]=function(_0x12ced7,_0x32002b){if(_0x12ced7[_0x564a('0x59')]['id']){delete _0x12ced7[_0x564a('0x59')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x12ced7[_0x564a('0x56')]['id']}})[_0x564a('0x1d')](handleEntityNotFound(_0x32002b,null))[_0x564a('0x1d')](saveUpdates(_0x12ced7[_0x564a('0x59')],null))[_0x564a('0x1d')](respondWithResult(_0x32002b,null))['catch'](handleError(_0x32002b,null));};exports[_0x564a('0x35')]=function(_0x5ea8d4,_0x5591a8){return db[_0x564a('0x3b')][_0x564a('0x57')]({'where':{'id':_0x5ea8d4['params']['id']}})[_0x564a('0x1d')](handleEntityNotFound(_0x5591a8,null))[_0x564a('0x1d')](removeEntity(_0x5591a8,null))[_0x564a('0x54')](handleError(_0x5591a8,null));};exports[_0x564a('0x5a')]=function(_0x4531a0,_0x2db3b4){return db[_0x564a('0x3b')][_0x564a('0x5a')]()[_0x564a('0x1d')](respondWithResult(_0x2db3b4,null))[_0x564a('0x54')](handleError(_0x2db3b4,null));};var interaction_log=require(_0x564a('0x5b'))(_0x564a('0x5c'));exports['accept']=function(_0x2d8022,_0x54be82,_0x528d1b){var _0x3c3c7d={'agent':{},'channel':_0x564a('0x5d')};if(_0x2d8022['body']['id']){delete _0x2d8022[_0x564a('0x59')]['id'];}_0x2d8022['body'][_0x564a('0x5e')]=!![];_0x2d8022[_0x564a('0x59')][_0x564a('0x5f')]=moment()['format'](_0x564a('0x60'));_0x2d8022[_0x564a('0x59')]['UserId']=_0x2d8022[_0x564a('0x59')]['UserId']||_0x2d8022['user']['id'];_0x3c3c7d['agent']['id']=_0x2d8022[_0x564a('0x59')][_0x564a('0x61')];return db[_0x564a('0x3b')][_0x564a('0x57')]({'where':{'id':_0x2d8022[_0x564a('0x56')]['id'],'UserId':null}})[_0x564a('0x1d')](handleEntityNotFound(_0x54be82,null))[_0x564a('0x1d')](saveUpdates(_0x2d8022[_0x564a('0x59')],null))['then'](function(_0x16f2da){if(_0x16f2da){_0x3c3c7d['message']=_0x16f2da['get']({'plain':!![]});return db[_0x564a('0x62')][_0x564a('0x57')]({'where':{'id':_0x16f2da[_0x564a('0x63')]}});}return null;})[_0x564a('0x1d')](handleEntityNotFound(_0x54be82,null))['then'](function(_0x72f5d5){if(_0x72f5d5){return _0x72f5d5[_0x564a('0x34')]({'UserId':_0x2d8022[_0x564a('0x59')][_0x564a('0x61')],'read1stAt':_[_0x564a('0x64')](_0x72f5d5[_0x564a('0x65')])?moment()[_0x564a('0x66')](_0x564a('0x60')):undefined});}return null;})[_0x564a('0x1d')](function(_0x5d0735){if(_0x5d0735){_0x3c3c7d['interaction']=_0x5d0735[_0x564a('0x67')]({'plain':!![]});interaction_log[_0x564a('0x1e')](_0x564a('0x68'),_0x2d8022[_0x564a('0x69')]['id'],_0x2d8022['user'][_0x564a('0x37')],_0x2d8022['user'][_0x564a('0x6a')],_0x3c3c7d['interaction']['id'],_0x2d8022[_0x564a('0x59')]?JSON[_0x564a('0x23')](_0x2d8022[_0x564a('0x59')]):'null');return respondWithRpcPromise(_0x564a('0x6b'),_0x564a('0x6c'),_0x3c3c7d);}return null;})[_0x564a('0x1d')](function(_0x1fdfd6){var _0x51b3f7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1fdfd6[_0x564a('0x25')][_0x564a('0x6d')];return db[_0x564a('0x6e')][_0x564a('0x40')](_0x51b3f7,{'type':db[_0x564a('0x6f')][_0x564a('0x70')][_0x564a('0x71')],'raw':!![]})[_0x564a('0x1d')](function(_0x12b1b4){return _0x12b1b4;});})[_0x564a('0x1d')](function(_0x506b91){if(_0x506b91){_0x3c3c7d[_0x564a('0x25')][_0x564a('0x72')]=_0x506b91[0x0];if(!_0x2d8022['body'][_0x564a('0x61')])return;return db[_0x564a('0x73')][_0x564a('0x57')]({'where':{'id':_0x2d8022[_0x564a('0x59')][_0x564a('0x61')],'role':'agent'},'attributes':['id','name',_0x564a('0x74'),_0x564a('0x75'),_0x564a('0x76')],'raw':!![]});}return null;})[_0x564a('0x1d')](function(_0x345fa4){if(!_0x345fa4)return null;_0x3c3c7d[_0x564a('0x25')][_0x564a('0x77')]=_0x345fa4;return _0x3c3c7d;})[_0x564a('0x1d')](function(_0x579479){if(_0x579479){if(_0x2d8022[_0x564a('0x59')]['manual']){_0x3c3c7d['message']['interface']=util[_0x564a('0x66')](_0x564a('0x78'),_0x2d8022[_0x564a('0x69')]['name']);_0x3c3c7d[_0x564a('0x25')][_0x564a('0x79')]=_0x3c3c7d[_0x564a('0x79')];_0x3c3c7d[_0x564a('0x25')][_0x564a('0x7a')]=_0x3c3c7d[_0x564a('0x79')];_0x3c3c7d[_0x564a('0x25')]['event']=_0x564a('0x7b');return respondWithRpcPromise(_0x564a('0x7c'),_0x564a('0x7c'),{'event':'acceptmessage','message':_0x3c3c7d['message']},client9002)[_0x564a('0x1d')](function(){return _0x3c3c7d;});}return _0x3c3c7d;}return null;})['then'](respondWithResult(_0x54be82,null))[_0x564a('0x54')](handleError(_0x54be82,null));};var interaction_log=require(_0x564a('0x5b'))(_0x564a('0x5c'));exports[_0x564a('0x32')]=function(_0x208874,_0x2afce0,_0x312aab){var _0x31bdad={'agent':{},'channel':_0x564a('0x5d')};if(_0x208874[_0x564a('0x59')]['id']){delete _0x208874[_0x564a('0x59')]['id'];}_0x208874[_0x564a('0x59')][_0x564a('0x61')]=_0x208874[_0x564a('0x59')][_0x564a('0x61')]||_0x208874[_0x564a('0x69')]['id'];_0x31bdad[_0x564a('0x77')]['id']=_0x208874[_0x564a('0x59')][_0x564a('0x61')];return db[_0x564a('0x3b')][_0x564a('0x57')]({'where':{'id':_0x208874['params']['id'],'UserId':null}})[_0x564a('0x1d')](handleEntityNotFound(_0x2afce0,null))['then'](function(_0x1ce6e8){if(_0x1ce6e8){_0x31bdad[_0x564a('0x25')]=_0x1ce6e8[_0x564a('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0x564a('0x57')]({'where':{'id':_0x1ce6e8[_0x564a('0x63')]}});}return null;})[_0x564a('0x1d')](handleEntityNotFound(_0x2afce0,null))[_0x564a('0x1d')](function(_0x2c3cdb){if(_0x2c3cdb){_0x31bdad[_0x564a('0x7d')]=_0x2c3cdb['get']({'plain':!![]});interaction_log[_0x564a('0x1e')](_0x564a('0x7e'),_0x208874[_0x564a('0x69')]['id'],_0x208874[_0x564a('0x69')]['name'],_0x208874[_0x564a('0x69')]['role'],_0x31bdad[_0x564a('0x7d')]['id'],_0x208874['body']?JSON[_0x564a('0x23')](_0x208874[_0x564a('0x59')]):_0x564a('0x7f'));return respondWithRpcPromise(_0x564a('0x80'),_0x564a('0x81'),_0x31bdad);}return null;})[_0x564a('0x1d')](function(_0x26a9be){var _0x413b31='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26a9be[_0x564a('0x25')]['ContactId'];return db[_0x564a('0x6e')][_0x564a('0x40')](_0x413b31,{'type':db[_0x564a('0x6f')][_0x564a('0x70')][_0x564a('0x71')],'raw':!![]})['then'](function(_0x21da29){return _0x21da29;});})[_0x564a('0x1d')](function(_0x26342e){if(_0x26342e){_0x31bdad[_0x564a('0x25')][_0x564a('0x72')]=_0x26342e[0x0];if(!_0x208874[_0x564a('0x59')][_0x564a('0x61')])return;return db[_0x564a('0x73')][_0x564a('0x57')]({'where':{'id':_0x208874[_0x564a('0x59')][_0x564a('0x61')],'role':_0x564a('0x77')},'attributes':['id',_0x564a('0x37'),_0x564a('0x74'),'email',_0x564a('0x76')],'raw':!![]});}return null;})[_0x564a('0x1d')](function(_0x570227){if(!_0x570227)return null;_0x31bdad[_0x564a('0x25')][_0x564a('0x77')]=_0x570227;return _0x31bdad;})[_0x564a('0x1d')](function(_0x511e03){if(_0x511e03){_0x511e03[_0x564a('0x25')][_0x564a('0x82')]=util[_0x564a('0x66')](_0x564a('0x78'),_0x208874[_0x564a('0x69')][_0x564a('0x37')]);_0x511e03[_0x564a('0x25')]['channel']=_0x31bdad['channel'];_0x511e03[_0x564a('0x25')]['motionChannel']=_0x31bdad[_0x564a('0x79')];_0x511e03['message']['event']=_0x564a('0x32');respondWithRpcPromise(_0x564a('0x7c'),_0x564a('0x7c'),{'event':'rejectmessage','message':_0x511e03[_0x564a('0x25')]},client9002);return _0x31bdad;}return null;})['then'](respondWithResult(_0x2afce0,null))[_0x564a('0x54')](handleError(_0x2afce0,null));};exports[_0x564a('0x28')]=function(_0x1d8359,_0x5bbb21,_0x4bf11f){if(_0x1d8359[_0x564a('0x59')]['id']){delete _0x1d8359[_0x564a('0x59')]['id'];}var _0xd85ab5;return db['WhatsappMessage']['find']({'where':{'id':_0x1d8359['params']['id']}})['then'](handleEntityNotFound(_0x5bbb21,null))[_0x564a('0x1d')](function(_0x5051d8){if(_0x5051d8){_0xd85ab5=_0x5051d8;return db[_0x564a('0x83')][_0x564a('0x57')]({'where':{'id':_0x5051d8[_0x564a('0x84')]}});}})['then'](handleEntityNotFound(_0x5bbb21,null))[_0x564a('0x1d')](function(_0x47524a){if(_0x47524a){logger[_0x564a('0x20')](_0x564a('0x85'),_0x564a('0x28'),_0x564a('0x86'),_0x47524a['type'],util[_0x564a('0x87')](_0x1d8359[_0x564a('0x59')],{'showHidden':![],'depth':null}));switch(_0x47524a[_0x564a('0x3d')]){case _0x564a('0x88'):if(_0x1d8359['body'][_0x564a('0x89')]&&_0x1d8359[_0x564a('0x59')][_0x564a('0x89')]===_0xd85ab5[_0x564a('0x8a')]&&_0x1d8359[_0x564a('0x59')][_0x564a('0x8b')]&&_0x1d8359[_0x564a('0x59')][_0x564a('0x8b')]===_0x564a('0x5e')){return _0xd85ab5[_0x564a('0x34')]({'read':!![]});}else{logger[_0x564a('0x24')](_0x564a('0x8c'),_0x564a('0x28'),_0x564a('0x88'),util[_0x564a('0x87')](_0x1d8359['body'],{'showHidden':![],'depth':null}));}break;}return _0xd85ab5;}})['then'](respondWithResult(_0x5bbb21,null))['catch'](handleError(_0x5bbb21,null));}; \ No newline at end of file +var _0x9bde=['count','offset','set','Content-Range','apply','update','destroy','end','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','rows','params','find','create','body','describe','read','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE: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','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp-interactions','whatsapp','rejectMessage','ContactId','email','reject','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit'];(function(_0x29f730,_0x23d7ed){var _0x189806=function(_0x2838a7){while(--_0x2838a7){_0x29f730['push'](_0x29f730['shift']());}};_0x189806(++_0x23d7ed);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3602de,_0x4001bf){_0x3602de=_0x3602de-0x0;var _0xc635d8=_0x9bde[_0x3602de];return _0xc635d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];config['redis']=_[_0xe9bd('0x19')](config['redis'],{'host':_0xe9bd('0x1a'),'port':0x18eb});var socket=require(_0xe9bd('0x1b'))(new Redis(config[_0xe9bd('0x1c')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0xe9bd('0x1d'));var client=jayson[_0xe9bd('0x1e')][_0xe9bd('0x1f')]({'port':0x232c});var client9002=jayson[_0xe9bd('0x1e')][_0xe9bd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x389e7b,_0x45a9f2,_0x573350,_0x1d11a0){return new BPromise(function(_0x464a1b,_0x160281){var _0x494b27=_0x1d11a0||client;return _0x494b27[_0xe9bd('0x20')](_0x389e7b,_0x573350)[_0xe9bd('0x21')](function(_0x34ba2b){logger[_0xe9bd('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x45a9f2,_0xe9bd('0x23'));logger['debug'](_0xe9bd('0x24'),_0x45a9f2,'request\x20sent',JSON[_0xe9bd('0x25')](_0x34ba2b));if(_0x34ba2b[_0xe9bd('0x26')]){if(_0x34ba2b[_0xe9bd('0x26')][_0xe9bd('0x27')]===0x1f4){logger[_0xe9bd('0x26')](_0xe9bd('0x28'),_0x45a9f2,_0x34ba2b[_0xe9bd('0x26')]['message']);return _0x160281(_0x34ba2b[_0xe9bd('0x26')][_0xe9bd('0x29')]);}logger['error'](_0xe9bd('0x28'),_0x45a9f2,_0x34ba2b['error'][_0xe9bd('0x29')]);return _0x464a1b(_0x34ba2b[_0xe9bd('0x26')][_0xe9bd('0x29')]);}else{logger[_0xe9bd('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x45a9f2,_0xe9bd('0x23'));_0x464a1b(_0x34ba2b[_0xe9bd('0x2a')][_0xe9bd('0x29')]);}})[_0xe9bd('0x2b')](function(_0x2641be){logger[_0xe9bd('0x26')](_0xe9bd('0x28'),_0x45a9f2,_0x2641be);_0x160281(_0x2641be);});});}function respondWithStatusCode(_0x43ea90,_0x1ae889){_0x1ae889=_0x1ae889||0xcc;return function(_0x5987af){if(_0x5987af){return _0x43ea90[_0xe9bd('0x2c')](_0x1ae889);}return _0x43ea90[_0xe9bd('0x2d')](_0x1ae889)['end']();};}function respondWithResult(_0x3b13b7,_0xc25248){_0xc25248=_0xc25248||0xc8;return function(_0x119672){if(_0x119672){return _0x3b13b7[_0xe9bd('0x2d')](_0xc25248)[_0xe9bd('0x2e')](_0x119672);}};}function respondWithFilteredResult(_0x183601,_0x519f48){return function(_0x5b7f1d){if(_0x5b7f1d){var _0x1de54c=typeof _0x519f48['offset']===_0xe9bd('0x2f')&&typeof _0x519f48[_0xe9bd('0x30')]===_0xe9bd('0x2f');var _0x36aa80=_0x5b7f1d[_0xe9bd('0x31')];var _0x509e36=_0x1de54c?0x0:_0x519f48['offset'];var _0x7f2c5=_0x1de54c?_0x5b7f1d[_0xe9bd('0x31')]:_0x519f48[_0xe9bd('0x32')]+_0x519f48[_0xe9bd('0x30')];var _0xe2436;if(_0x7f2c5>=_0x36aa80){_0x7f2c5=_0x36aa80;_0xe2436=0xc8;}else{_0xe2436=0xce;}_0x183601[_0xe9bd('0x2d')](_0xe2436);return _0x183601[_0xe9bd('0x33')](_0xe9bd('0x34'),_0x509e36+'-'+_0x7f2c5+'/'+_0x36aa80)[_0xe9bd('0x2e')](_0x5b7f1d);}return null;};}function patchUpdates(_0x4ec15c){return function(_0x426004){try{jsonpatch[_0xe9bd('0x35')](_0x426004,_0x4ec15c,!![]);}catch(_0x390a43){return BPromise['reject'](_0x390a43);}return _0x426004['save']();};}function saveUpdates(_0x25eeab,_0x2e9593){return function(_0x601649){if(_0x601649){return _0x601649[_0xe9bd('0x36')](_0x25eeab)[_0xe9bd('0x21')](function(_0x2950e8){return _0x2950e8;});}return null;};}function removeEntity(_0x1e50ac,_0x1c6173){return function(_0x1a1a29){if(_0x1a1a29){return _0x1a1a29[_0xe9bd('0x37')]()[_0xe9bd('0x21')](function(){_0x1e50ac[_0xe9bd('0x2d')](0xcc)[_0xe9bd('0x38')]();});}};}function handleEntityNotFound(_0x199477,_0xc50476){return function(_0x8ff624){if(!_0x8ff624){_0x199477[_0xe9bd('0x2c')](0x194);}return _0x8ff624;};}function handleError(_0x147da5,_0x4c689d){_0x4c689d=_0x4c689d||0x1f4;return function(_0x3f3cf5){logger[_0xe9bd('0x26')](_0x3f3cf5['stack']);if(_0x3f3cf5[_0xe9bd('0x39')]){delete _0x3f3cf5[_0xe9bd('0x39')];}_0x147da5['status'](_0x4c689d)['send'](_0x3f3cf5);};}exports[_0xe9bd('0x3a')]=function(_0xdf43b9,_0x4d2f3d){var _0x2d1289={},_0x3ea705={},_0x14927c={'count':0x0,'rows':[]};var _0x5b894a=_[_0xe9bd('0x3b')](db['WhatsappMessage'][_0xe9bd('0x3c')],function(_0x42238a){return{'name':_0x42238a[_0xe9bd('0x3d')],'type':_0x42238a[_0xe9bd('0x3e')]['key']};});_0x3ea705[_0xe9bd('0x3f')]=_[_0xe9bd('0x3b')](_0x5b894a,_0xe9bd('0x39'));_0x3ea705[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0xdf43b9[_0xe9bd('0x40')]);_0x3ea705[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x3ea705[_0xe9bd('0x3f')],_0x3ea705[_0xe9bd('0x40')]);_0x2d1289['attributes']=_['intersection'](_0x3ea705[_0xe9bd('0x3f')],qs['fields'](_0xdf43b9[_0xe9bd('0x40')][_0xe9bd('0x44')]));_0x2d1289[_0xe9bd('0x45')]=_0x2d1289['attributes'][_0xe9bd('0x46')]?_0x2d1289[_0xe9bd('0x45')]:_0x3ea705[_0xe9bd('0x3f')];if(!_0xdf43b9['query'][_0xe9bd('0x47')](_0xe9bd('0x48'))){_0x2d1289[_0xe9bd('0x30')]=qs[_0xe9bd('0x30')](_0xdf43b9[_0xe9bd('0x40')][_0xe9bd('0x30')]);_0x2d1289[_0xe9bd('0x32')]=qs[_0xe9bd('0x32')](_0xdf43b9[_0xe9bd('0x40')][_0xe9bd('0x32')]);}_0x2d1289[_0xe9bd('0x49')]=qs[_0xe9bd('0x4a')](_0xdf43b9[_0xe9bd('0x40')][_0xe9bd('0x4a')]);_0x2d1289[_0xe9bd('0x4b')]=qs['filters'](_['pick'](_0xdf43b9[_0xe9bd('0x40')],_0x3ea705[_0xe9bd('0x42')]),_0x5b894a);if(_0xdf43b9[_0xe9bd('0x40')]['filter']){_0x2d1289['where']=_[_0xe9bd('0x4c')](_0x2d1289[_0xe9bd('0x4b')],{'$or':_[_0xe9bd('0x3b')](_0x5b894a,function(_0x15da40){if(_0x15da40[_0xe9bd('0x3e')]!==_0xe9bd('0x4d')){var _0x40b606={};_0x40b606[_0x15da40['name']]={'$like':'%'+_0xdf43b9[_0xe9bd('0x40')]['filter']+'%'};return _0x40b606;}})});}_0x2d1289=_[_0xe9bd('0x4c')]({},_0x2d1289,_0xdf43b9[_0xe9bd('0x4e')]);var _0x33ba69={'where':_0x2d1289[_0xe9bd('0x4b')]};return db[_0xe9bd('0x4f')]['count'](_0x33ba69)[_0xe9bd('0x21')](function(_0x3e5d44){_0x14927c[_0xe9bd('0x31')]=_0x3e5d44;if(_0xdf43b9['query'][_0xe9bd('0x50')]){_0x2d1289[_0xe9bd('0x51')]=[{'all':!![]}];}return db[_0xe9bd('0x4f')]['findAll'](_0x2d1289);})[_0xe9bd('0x21')](function(_0x27e7b0){_0x14927c[_0xe9bd('0x52')]=_0x27e7b0;return _0x14927c;})[_0xe9bd('0x21')](respondWithFilteredResult(_0x4d2f3d,_0x2d1289))[_0xe9bd('0x2b')](handleError(_0x4d2f3d,null));};exports['show']=function(_0x3f4833,_0x4b8ff9){var _0x835697={'raw':!![],'where':{'id':_0x3f4833[_0xe9bd('0x53')]['id']}},_0x239be9={};_0x239be9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db['WhatsappMessage'][_0xe9bd('0x3c')]);_0x239be9['query']=_[_0xe9bd('0x41')](_0x3f4833[_0xe9bd('0x40')]);_0x239be9['filters']=_['intersection'](_0x239be9[_0xe9bd('0x3f')],_0x239be9['query']);_0x835697[_0xe9bd('0x45')]=_['intersection'](_0x239be9[_0xe9bd('0x3f')],qs[_0xe9bd('0x44')](_0x3f4833['query'][_0xe9bd('0x44')]));_0x835697['attributes']=_0x835697[_0xe9bd('0x45')][_0xe9bd('0x46')]?_0x835697[_0xe9bd('0x45')]:_0x239be9['model'];if(_0x3f4833[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0x835697[_0xe9bd('0x51')]=[{'all':!![]}];}_0x835697=_[_0xe9bd('0x4c')]({},_0x835697,_0x3f4833['options']);return db['WhatsappMessage'][_0xe9bd('0x54')](_0x835697)['then'](handleEntityNotFound(_0x4b8ff9,null))[_0xe9bd('0x21')](respondWithResult(_0x4b8ff9,null))[_0xe9bd('0x2b')](handleError(_0x4b8ff9,null));};exports[_0xe9bd('0x55')]=function(_0xc818b4,_0x159f68){return db[_0xe9bd('0x4f')][_0xe9bd('0x55')](_0xc818b4[_0xe9bd('0x56')],{})[_0xe9bd('0x21')](respondWithResult(_0x159f68,0xc9))[_0xe9bd('0x2b')](handleError(_0x159f68,null));};exports[_0xe9bd('0x36')]=function(_0x78fab0,_0x51500d){if(_0x78fab0['body']['id']){delete _0x78fab0['body']['id'];}return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x78fab0[_0xe9bd('0x53')]['id']}})[_0xe9bd('0x21')](handleEntityNotFound(_0x51500d,null))[_0xe9bd('0x21')](saveUpdates(_0x78fab0[_0xe9bd('0x56')],null))[_0xe9bd('0x21')](respondWithResult(_0x51500d,null))[_0xe9bd('0x2b')](handleError(_0x51500d,null));};exports[_0xe9bd('0x37')]=function(_0x46797c,_0x61b691){return db['WhatsappMessage'][_0xe9bd('0x54')]({'where':{'id':_0x46797c[_0xe9bd('0x53')]['id']}})[_0xe9bd('0x21')](handleEntityNotFound(_0x61b691,null))[_0xe9bd('0x21')](removeEntity(_0x61b691,null))['catch'](handleError(_0x61b691,null));};exports[_0xe9bd('0x57')]=function(_0xc44b92,_0x34bd38){return db['WhatsappMessage'][_0xe9bd('0x57')]()[_0xe9bd('0x21')](respondWithResult(_0x34bd38,null))[_0xe9bd('0x2b')](handleError(_0x34bd38,null));};var interaction_log=require(_0xe9bd('0x14'))('whatsapp-interactions');exports['accept']=function(_0x3e0de9,_0x188891,_0x434138){var _0xf02c5d={'agent':{},'channel':'whatsapp'};if(_0x3e0de9['body']['id']){delete _0x3e0de9[_0xe9bd('0x56')]['id'];}_0x3e0de9[_0xe9bd('0x56')][_0xe9bd('0x58')]=!![];_0x3e0de9[_0xe9bd('0x56')][_0xe9bd('0x59')]=moment()[_0xe9bd('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e0de9[_0xe9bd('0x56')]['UserId']=_0x3e0de9[_0xe9bd('0x56')][_0xe9bd('0x5b')]||_0x3e0de9[_0xe9bd('0x5c')]['id'];_0xf02c5d[_0xe9bd('0x5d')]['id']=_0x3e0de9['body'][_0xe9bd('0x5b')];return db[_0xe9bd('0x4f')][_0xe9bd('0x54')]({'where':{'id':_0x3e0de9['params']['id'],'UserId':null}})[_0xe9bd('0x21')](handleEntityNotFound(_0x188891,null))[_0xe9bd('0x21')](saveUpdates(_0x3e0de9[_0xe9bd('0x56')],null))[_0xe9bd('0x21')](function(_0x43dabe){if(_0x43dabe){_0xf02c5d[_0xe9bd('0x29')]=_0x43dabe[_0xe9bd('0x5e')]({'plain':!![]});return db[_0xe9bd('0x5f')][_0xe9bd('0x54')]({'where':{'id':_0x43dabe[_0xe9bd('0x60')]}});}return null;})[_0xe9bd('0x21')](handleEntityNotFound(_0x188891,null))[_0xe9bd('0x21')](function(_0x5d1e4b){if(_0x5d1e4b){return _0x5d1e4b[_0xe9bd('0x36')]({'UserId':_0x3e0de9[_0xe9bd('0x56')]['UserId'],'read1stAt':_[_0xe9bd('0x61')](_0x5d1e4b[_0xe9bd('0x62')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe9bd('0x21')](function(_0x4190f0){if(_0x4190f0){_0xf02c5d['interaction']=_0x4190f0['get']({'plain':!![]});interaction_log['info'](_0xe9bd('0x63'),_0x3e0de9['user']['id'],_0x3e0de9['user']['name'],_0x3e0de9['user'][_0xe9bd('0x64')],_0xf02c5d[_0xe9bd('0x65')]['id'],_0x3e0de9[_0xe9bd('0x56')]?JSON['stringify'](_0x3e0de9[_0xe9bd('0x56')]):_0xe9bd('0x66'));return respondWithRpcPromise(_0xe9bd('0x67'),_0xe9bd('0x68'),_0xf02c5d);}return null;})['then'](function(_0x2656e9){var _0x10ef2b=_0xe9bd('0x69')+_0x2656e9['message']['ContactId'];return db[_0xe9bd('0x6a')][_0xe9bd('0x40')](_0x10ef2b,{'type':db[_0xe9bd('0x6b')][_0xe9bd('0x6c')][_0xe9bd('0x6d')],'raw':!![]})[_0xe9bd('0x21')](function(_0x3fda4c){return _0x3fda4c;});})[_0xe9bd('0x21')](function(_0x578e85){if(_0x578e85){_0xf02c5d[_0xe9bd('0x29')][_0xe9bd('0x6e')]=_0x578e85[0x0];if(!_0x3e0de9[_0xe9bd('0x56')][_0xe9bd('0x5b')])return;return db[_0xe9bd('0x6f')]['find']({'where':{'id':_0x3e0de9[_0xe9bd('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0xe9bd('0x39'),_0xe9bd('0x70'),'email',_0xe9bd('0x71')],'raw':!![]});}return null;})[_0xe9bd('0x21')](function(_0x1c6644){if(!_0x1c6644)return null;_0xf02c5d[_0xe9bd('0x29')]['agent']=_0x1c6644;return _0xf02c5d;})[_0xe9bd('0x21')](function(_0x41fb41){if(_0x41fb41){if(_0x3e0de9['body'][_0xe9bd('0x72')]){_0xf02c5d[_0xe9bd('0x29')][_0xe9bd('0x73')]=util[_0xe9bd('0x5a')](_0xe9bd('0x74'),_0x3e0de9[_0xe9bd('0x5c')][_0xe9bd('0x39')]);_0xf02c5d['message'][_0xe9bd('0x75')]=_0xf02c5d[_0xe9bd('0x75')];_0xf02c5d[_0xe9bd('0x29')][_0xe9bd('0x76')]=_0xf02c5d[_0xe9bd('0x75')];_0xf02c5d[_0xe9bd('0x29')][_0xe9bd('0x77')]=_0xe9bd('0x78');return respondWithRpcPromise(_0xe9bd('0x79'),'EventManager',{'event':_0xe9bd('0x7a'),'message':_0xf02c5d[_0xe9bd('0x29')]},client9002)[_0xe9bd('0x21')](function(){return _0xf02c5d;});}return _0xf02c5d;}return null;})[_0xe9bd('0x21')](respondWithResult(_0x188891,null))[_0xe9bd('0x2b')](handleError(_0x188891,null));};var interaction_log=require(_0xe9bd('0x14'))(_0xe9bd('0x7b'));exports['reject']=function(_0x18519d,_0x3acb87,_0x56e916){var _0x32a61d={'agent':{},'channel':_0xe9bd('0x7c')};if(_0x18519d[_0xe9bd('0x56')]['id']){delete _0x18519d[_0xe9bd('0x56')]['id'];}_0x18519d[_0xe9bd('0x56')][_0xe9bd('0x5b')]=_0x18519d[_0xe9bd('0x56')]['UserId']||_0x18519d['user']['id'];_0x32a61d[_0xe9bd('0x5d')]['id']=_0x18519d[_0xe9bd('0x56')][_0xe9bd('0x5b')];return db[_0xe9bd('0x4f')][_0xe9bd('0x54')]({'where':{'id':_0x18519d[_0xe9bd('0x53')]['id'],'UserId':null}})[_0xe9bd('0x21')](handleEntityNotFound(_0x3acb87,null))['then'](function(_0x35390a){if(_0x35390a){_0x32a61d[_0xe9bd('0x29')]=_0x35390a[_0xe9bd('0x5e')]({'plain':!![]});return db[_0xe9bd('0x5f')][_0xe9bd('0x54')]({'where':{'id':_0x35390a[_0xe9bd('0x60')]}});}return null;})[_0xe9bd('0x21')](handleEntityNotFound(_0x3acb87,null))['then'](function(_0x55aacf){if(_0x55aacf){_0x32a61d['interaction']=_0x55aacf[_0xe9bd('0x5e')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x18519d['user']['id'],_0x18519d[_0xe9bd('0x5c')][_0xe9bd('0x39')],_0x18519d[_0xe9bd('0x5c')][_0xe9bd('0x64')],_0x32a61d[_0xe9bd('0x65')]['id'],_0x18519d[_0xe9bd('0x56')]?JSON[_0xe9bd('0x25')](_0x18519d[_0xe9bd('0x56')]):_0xe9bd('0x66'));return respondWithRpcPromise('RejectMessage',_0xe9bd('0x7d'),_0x32a61d);}return null;})['then'](function(_0x22cc79){var _0x433a98=_0xe9bd('0x69')+_0x22cc79[_0xe9bd('0x29')][_0xe9bd('0x7e')];return db['sequelize']['query'](_0x433a98,{'type':db['Sequelize'][_0xe9bd('0x6c')][_0xe9bd('0x6d')],'raw':!![]})['then'](function(_0x3c7875){return _0x3c7875;});})[_0xe9bd('0x21')](function(_0x2bf2f0){if(_0x2bf2f0){_0x32a61d[_0xe9bd('0x29')][_0xe9bd('0x6e')]=_0x2bf2f0[0x0];if(!_0x18519d['body'][_0xe9bd('0x5b')])return;return db[_0xe9bd('0x6f')][_0xe9bd('0x54')]({'where':{'id':_0x18519d[_0xe9bd('0x56')][_0xe9bd('0x5b')],'role':_0xe9bd('0x5d')},'attributes':['id',_0xe9bd('0x39'),_0xe9bd('0x70'),_0xe9bd('0x7f'),_0xe9bd('0x71')],'raw':!![]});}return null;})['then'](function(_0x4d5288){if(!_0x4d5288)return null;_0x32a61d['message']['agent']=_0x4d5288;return _0x32a61d;})[_0xe9bd('0x21')](function(_0x2c7ecc){if(_0x2c7ecc){_0x2c7ecc[_0xe9bd('0x29')]['interface']=util[_0xe9bd('0x5a')](_0xe9bd('0x74'),_0x18519d['user']['name']);_0x2c7ecc[_0xe9bd('0x29')][_0xe9bd('0x75')]=_0x32a61d[_0xe9bd('0x75')];_0x2c7ecc[_0xe9bd('0x29')][_0xe9bd('0x76')]=_0x32a61d['channel'];_0x2c7ecc['message']['event']=_0xe9bd('0x80');respondWithRpcPromise(_0xe9bd('0x79'),_0xe9bd('0x79'),{'event':_0xe9bd('0x81'),'message':_0x2c7ecc[_0xe9bd('0x29')]},client9002);return _0x32a61d;}return null;})[_0xe9bd('0x21')](respondWithResult(_0x3acb87,null))[_0xe9bd('0x2b')](handleError(_0x3acb87,null));};exports[_0xe9bd('0x2d')]=function(_0x2fae04,_0x1ecac3,_0x59a31e){if(_0x2fae04[_0xe9bd('0x56')]['id']){delete _0x2fae04['body']['id'];}var _0x116815;return db['WhatsappMessage']['find']({'where':{'id':_0x2fae04[_0xe9bd('0x53')]['id']}})['then'](handleEntityNotFound(_0x1ecac3,null))[_0xe9bd('0x21')](function(_0x5cdaa8){if(_0x5cdaa8){_0x116815=_0x5cdaa8;return db[_0xe9bd('0x82')][_0xe9bd('0x54')]({'where':{'id':_0x5cdaa8[_0xe9bd('0x83')]}});}})[_0xe9bd('0x21')](handleEntityNotFound(_0x1ecac3,null))[_0xe9bd('0x21')](function(_0x63dd8a){if(_0x63dd8a){logger['debug'](_0xe9bd('0x84'),_0xe9bd('0x2d'),'received\x20delivery\x20report\x20from',_0x63dd8a[_0xe9bd('0x3e')],util[_0xe9bd('0x85')](_0x2fae04[_0xe9bd('0x56')],{'showHidden':![],'depth':null}));switch(_0x63dd8a['type']){case _0xe9bd('0x86'):if(_0x2fae04[_0xe9bd('0x56')][_0xe9bd('0x87')]&&_0x2fae04[_0xe9bd('0x56')][_0xe9bd('0x87')]===_0x116815['messageId']&&_0x2fae04[_0xe9bd('0x56')][_0xe9bd('0x88')]&&_0x2fae04['body'][_0xe9bd('0x88')]===_0xe9bd('0x58')){return _0x116815[_0xe9bd('0x36')]({'read':!![]});}else{logger[_0xe9bd('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xe9bd('0x2d'),_0xe9bd('0x86'),util[_0xe9bd('0x85')](_0x2fae04[_0xe9bd('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x116815;}})[_0xe9bd('0x21')](respondWithResult(_0x1ecac3,null))[_0xe9bd('0x2b')](handleError(_0x1ecac3,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 272975e..afcba91 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 _0x55f1=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage','setMaxListeners','save','update'];(function(_0x3e0225,_0x1ddbb9){var _0x57259f=function(_0x548597){while(--_0x548597){_0x3e0225['push'](_0x3e0225['shift']());}};_0x57259f(++_0x1ddbb9);}(_0x55f1,0x9b));var _0x155f=function(_0x319c39,_0x48b266){_0x319c39=_0x319c39-0x0;var _0x4e85df=_0x55f1[_0x319c39];return _0x4e85df;};'use strict';var EventEmitter=require(_0x155f('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x155f('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x155f('0x2')](0x0);var events={'afterCreate':_0x155f('0x3'),'afterUpdate':_0x155f('0x4'),'afterDestroy':_0x155f('0x5')};function emitEvent(_0x13e2af){return function(_0x2089cc,_0x5c3d6c,_0x5cd807){WhatsappMessageEvents[_0x155f('0x6')](_0x13e2af+':'+_0x2089cc['id'],_0x2089cc);WhatsappMessageEvents['emit'](_0x13e2af,_0x2089cc);_0x5cd807(null);};}for(var e in events){if(events[_0x155f('0x7')](e)){var event=events[e];WhatsappMessage[_0x155f('0x8')](e,emitEvent(event));}}module[_0x155f('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0xbfcc=['hook','events','setMaxListeners','save','update','remove','emit'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xbfcc[_0x58a4fe];return _0x697de2;};'use strict';var EventEmitter=require(_0xcbfc('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xcbfc('0x1')](0x0);var events={'afterCreate':_0xcbfc('0x2'),'afterUpdate':_0xcbfc('0x3'),'afterDestroy':_0xcbfc('0x4')};function emitEvent(_0x57f2e3){return function(_0x59b1de,_0x54f81b,_0x4b8361){WhatsappMessageEvents[_0xcbfc('0x5')](_0x57f2e3+':'+_0x59b1de['id'],_0x59b1de);WhatsappMessageEvents[_0xcbfc('0x5')](_0x57f2e3,_0x59b1de);_0x4b8361(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xcbfc('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 32b39d9..e98c4ef 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 _0x5668=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','FULLTEXT','get','out','secret','isNil','UserId','WhatsappInteraction','createdAt','direction','toLowerCase','catch','WhatsappAccount','find','WhatsappAccountId','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x7000b3,_0x1b4543){var _0x43485c=function(_0x30830d){while(--_0x30830d){_0x7000b3['push'](_0x7000b3['shift']());}};_0x43485c(++_0x1b4543);}(_0x5668,0x8b));var _0x8566=function(_0x43b4de,_0x573680){_0x43b4de=_0x43b4de-0x0;var _0x3a19d4=_0x5668[_0x43b4de];return _0x3a19d4;};'use strict';var _=require(_0x8566('0x0'));var util=require(_0x8566('0x1'));var logger=require(_0x8566('0x2'))(_0x8566('0x3'));var moment=require(_0x8566('0x4'));var BPromise=require(_0x8566('0x5'));var rp=require(_0x8566('0x6'));var fs=require('fs');var path=require(_0x8566('0x7'));var rimraf=require(_0x8566('0x8'));var config=require(_0x8566('0x9'));var attributes=require(_0x8566('0xa'));module[_0x8566('0xb')]=function(_0x2f958c,_0x4885d6){return _0x2f958c[_0x8566('0xc')](_0x8566('0xd'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8566('0xe')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x8566('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47c21f,_0x3eb676,_0x4736e5){var _0x19cd09=_0x2f958c['models'];var _0x199b75=_0x47c21f[_0x8566('0x10')]({'plain':!![]});if(_0x199b75['direction']['toLowerCase']()==='in'||_0x199b75['direction']['toLowerCase']()===_0x8566('0x11')&&!_0x199b75[_0x8566('0x12')]&&!_[_0x8566('0x13')](_0x199b75[_0x8566('0x14')])){_0x19cd09[_0x8566('0x15')]['findOne']({'where':{'id':_0x199b75['WhatsappInteractionId']}})['then'](function(_0x489470){if(_0x489470){_0x489470['update']({'lastMsgAt':_0x199b75[_0x8566('0x16')],'lastMsgDirection':_0x199b75[_0x8566('0x17')][_0x8566('0x18')]()});}})[_0x8566('0x19')](function(_0x39faee){console['error'](_0x39faee);});}if(_0x199b75[_0x8566('0x17')]===_0x8566('0x11')&&!_0x199b75[_0x8566('0x12')]){var _0x4e20a2;_0x19cd09[_0x8566('0x1a')][_0x8566('0x1b')]({'where':{'id':_0x199b75[_0x8566('0x1c')]},'raw':!![]})['then'](function(_0x41cb27){_0x4e20a2=_0x41cb27;if(_0x4e20a2&&_0x4e20a2['type']){switch(_0x4e20a2['type']){case _0x8566('0x1d'):var _0x5e9ca7=require(_0x8566('0x1d'));if(_0x4e20a2['accountSid']&&_0x4e20a2[_0x8566('0x1e')]&&_0x4e20a2[_0x8566('0x1f')]){var _0x43fc7c=new _0x5e9ca7(_0x4e20a2[_0x8566('0x20')],_0x4e20a2[_0x8566('0x1e')]);_0x43fc7c[_0x8566('0x21')][_0x8566('0x22')]({'body':_0x199b75['body'],'to':'whatsapp:'+_0x199b75[_0x8566('0x1f')],'from':_0x8566('0x23')+_0x4e20a2[_0x8566('0x1f')],'statusCallback':_0x4e20a2[_0x8566('0x24')]+'/api/whatsapp/messages/'+_0x199b75['id']+_0x8566('0x25')+_0x4e20a2[_0x8566('0x26')]})['then'](function(_0x3f6fce){if(_0x3f6fce[_0x8566('0x27')]){return _0x47c21f['update']({'messageId':_0x3f6fce[_0x8566('0x27')]});}})[_0x8566('0x19')](function(_0x18ee17){logger['error'](_0x8566('0x28'),_0x8566('0x29'),_0x8566('0x1d'),util[_0x8566('0x2a')](_0x18ee17,{'showHidden':![],'depth':null}));});}else{logger[_0x8566('0x2b')](_0x8566('0x28'),_0x8566('0x29'),'twilio',_0x8566('0x2c'));}break;}}})[_0x8566('0x2d')](function(){_0x4736e5();});}else{_0x4736e5();}}},'charset':_0x8566('0x2e'),'collate':_0x8566('0x2f')});}; \ No newline at end of file +var _0x7af2=['body','FULLTEXT','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','direction','catch','error','out','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId'];(function(_0x5aa2bc,_0x283b7c){var _0x370b8b=function(_0x419d8a){while(--_0x419d8a){_0x5aa2bc['push'](_0x5aa2bc['shift']());}};_0x370b8b(++_0x283b7c);}(_0x7af2,0x119));var _0x27af=function(_0x24a0c2,_0x2619c9){_0x24a0c2=_0x24a0c2-0x0;var _0x434ece=_0x7af2[_0x24a0c2];return _0x434ece;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var logger=require(_0x27af('0x1'))(_0x27af('0x2'));var moment=require(_0x27af('0x3'));var BPromise=require('bluebird');var rp=require(_0x27af('0x4'));var fs=require('fs');var path=require(_0x27af('0x5'));var rimraf=require(_0x27af('0x6'));var config=require(_0x27af('0x7'));var attributes=require(_0x27af('0x8'));module[_0x27af('0x9')]=function(_0x350532,_0x184630){return _0x350532[_0x27af('0xa')]('WhatsappMessage',attributes,{'tableName':_0x27af('0xb'),'paranoid':![],'indexes':[{'name':_0x27af('0xc'),'fields':[_0x27af('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x27af('0xd')],'type':_0x27af('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5841aa,_0x4e27bf,_0x1617c0){var _0x582a9e=_0x350532['models'];var _0x3e4b33=_0x5841aa['get']({'plain':!![]});if(_0x3e4b33['direction'][_0x27af('0xf')]()==='in'||_0x3e4b33['direction'][_0x27af('0xf')]()==='out'&&!_0x3e4b33[_0x27af('0x10')]&&!_[_0x27af('0x11')](_0x3e4b33[_0x27af('0x12')])){_0x582a9e[_0x27af('0x13')][_0x27af('0x14')]({'where':{'id':_0x3e4b33[_0x27af('0x15')]}})[_0x27af('0x16')](function(_0x3da435){if(_0x3da435){_0x3da435[_0x27af('0x17')]({'lastMsgAt':_0x3e4b33[_0x27af('0x18')],'lastMsgDirection':_0x3e4b33[_0x27af('0x19')][_0x27af('0xf')]()});}})[_0x27af('0x1a')](function(_0x3102c4){console[_0x27af('0x1b')](_0x3102c4);});}if(_0x3e4b33[_0x27af('0x19')]===_0x27af('0x1c')&&!_0x3e4b33[_0x27af('0x10')]){var _0x58583a;_0x582a9e[_0x27af('0x1d')][_0x27af('0x1e')]({'where':{'id':_0x3e4b33['WhatsappAccountId']},'raw':!![]})['then'](function(_0x20a6d7){_0x58583a=_0x20a6d7;if(_0x58583a&&_0x58583a[_0x27af('0x1f')]){switch(_0x58583a[_0x27af('0x1f')]){case _0x27af('0x20'):var _0xec699a=require('twilio');if(_0x58583a[_0x27af('0x21')]&&_0x58583a[_0x27af('0x22')]&&_0x58583a[_0x27af('0x23')]){var _0x5e7c19=new _0xec699a(_0x58583a[_0x27af('0x21')],_0x58583a[_0x27af('0x22')]);_0x5e7c19[_0x27af('0x24')]['create']({'body':_0x3e4b33[_0x27af('0xd')],'to':_0x27af('0x25')+_0x3e4b33[_0x27af('0x23')],'from':_0x27af('0x25')+_0x58583a[_0x27af('0x23')],'statusCallback':_0x58583a[_0x27af('0x26')]+_0x27af('0x27')+_0x3e4b33['id']+_0x27af('0x28')+_0x58583a[_0x27af('0x29')]})['then'](function(_0x50c3ab){if(_0x50c3ab['sid']){return _0x5841aa[_0x27af('0x17')]({'messageId':_0x50c3ab['sid']});}})[_0x27af('0x1a')](function(_0x396326){logger['error'](_0x27af('0x2a'),_0x27af('0x2b'),_0x27af('0x20'),util[_0x27af('0x2c')](_0x396326,{'showHidden':![],'depth':null}));});}else{logger[_0x27af('0x1b')](_0x27af('0x2a'),_0x27af('0x2b'),'twilio',_0x27af('0x2d'));}break;}}})[_0x27af('0x2e')](function(){_0x1617c0();});}else{_0x1617c0();}}},'charset':_0x27af('0x2f'),'collate':_0x27af('0x30')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f9fd0e9..7609d1a 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 _0xeb30=['defaults','localhost','socket.io-emitter','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2f2d68,_0x3b4808){var _0x442f01=function(_0xdb46e7){while(--_0xdb46e7){_0x2f2d68['push'](_0x2f2d68['shift']());}};_0x442f01(++_0x3b4808);}(_0xeb30,0x13d));var _0x0eb3=function(_0x5293ce,_0x2fc552){_0x5293ce=_0x5293ce-0x0;var _0x2ac6ac=_0xeb30[_0x5293ce];return _0x2ac6ac;};'use strict';var _=require(_0x0eb3('0x0'));var util=require('util');var moment=require(_0x0eb3('0x1'));var BPromise=require(_0x0eb3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0eb3('0x3'));var db=require(_0x0eb3('0x4'))['db'];var utils=require(_0x0eb3('0x5'));var logger=require(_0x0eb3('0x6'))(_0x0eb3('0x7'));var config=require(_0x0eb3('0x8'));var jayson=require(_0x0eb3('0x9'));var client=jayson[_0x0eb3('0xa')][_0x0eb3('0xb')]({'port':0x232a});config[_0x0eb3('0xc')]=_[_0x0eb3('0xd')](config[_0x0eb3('0xc')],{'host':_0x0eb3('0xe'),'port':0x18eb});var socket=require(_0x0eb3('0xf'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4e2ab8,_0x3ba048,_0x1e9d9d){return new BPromise(function(_0x4ace3c,_0x40d072){return client[_0x0eb3('0x10')](_0x4e2ab8,_0x1e9d9d)[_0x0eb3('0x11')](function(_0x4d38fc){logger[_0x0eb3('0x12')](_0x0eb3('0x13'),_0x3ba048,'request\x20sent');logger[_0x0eb3('0x14')](_0x0eb3('0x15'),_0x3ba048,_0x0eb3('0x16'),JSON[_0x0eb3('0x17')](_0x4d38fc));if(_0x4d38fc[_0x0eb3('0x18')]){if(_0x4d38fc[_0x0eb3('0x18')][_0x0eb3('0x19')]===0x1f4){logger['error'](_0x0eb3('0x13'),_0x3ba048,_0x4d38fc[_0x0eb3('0x18')][_0x0eb3('0x1a')]);return _0x40d072(_0x4d38fc[_0x0eb3('0x18')][_0x0eb3('0x1a')]);}logger[_0x0eb3('0x18')](_0x0eb3('0x13'),_0x3ba048,_0x4d38fc[_0x0eb3('0x18')][_0x0eb3('0x1a')]);return _0x4ace3c(_0x4d38fc['error'][_0x0eb3('0x1a')]);}else{logger[_0x0eb3('0x12')](_0x0eb3('0x13'),_0x3ba048,_0x0eb3('0x16'));_0x4ace3c(_0x4d38fc[_0x0eb3('0x1b')][_0x0eb3('0x1a')]);}})[_0x0eb3('0x1c')](function(_0x21bafa){logger[_0x0eb3('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x3ba048,_0x21bafa);_0x40d072(_0x21bafa);});});}exports[_0x0eb3('0x1d')]=function(_0x5d4cec){var _0x5d19e0=this;return new Promise(function(_0xea996c,_0x40c905){return db[_0x0eb3('0x1e')][_0x0eb3('0x1f')](_0x5d4cec['body'],{'raw':_0x5d4cec['options']?_0x5d4cec[_0x0eb3('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x0eb3('0x11')](function(_0x4c1270){logger[_0x0eb3('0x12')]('CreateWhatsappMessage',_0x5d4cec);logger[_0x0eb3('0x14')](_0x0eb3('0x1d'),_0x5d4cec,JSON[_0x0eb3('0x17')](_0x4c1270));_0xea996c(_0x4c1270);})['catch'](function(_0x3ec9dd){logger[_0x0eb3('0x18')](_0x0eb3('0x1d'),_0x3ec9dd[_0x0eb3('0x1a')],_0x5d4cec);_0x40c905(_0x5d19e0[_0x0eb3('0x18')](0x1f4,_0x3ec9dd[_0x0eb3('0x1a')]));});});}; \ No newline at end of file +var _0xf17d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','info','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','raw','then','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0xf17d,0x19a));var _0xdf17=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf17d[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xdf17('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdf17('0x1'));var rs=require(_0xdf17('0x2'));var fs=require('fs');var Redis=require(_0xdf17('0x3'));var db=require(_0xdf17('0x4'))['db'];var utils=require(_0xdf17('0x5'));var logger=require(_0xdf17('0x6'))(_0xdf17('0x7'));var config=require(_0xdf17('0x8'));var jayson=require(_0xdf17('0x9'));var client=jayson[_0xdf17('0xa')][_0xdf17('0xb')]({'port':0x232a});config[_0xdf17('0xc')]=_[_0xdf17('0xd')](config[_0xdf17('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf17('0xc')]));require('./whatsappMessage.socket')[_0xdf17('0xe')](socket);function respondWithRpcPromise(_0x4148f5,_0x1b435e,_0x3d7e91){return new BPromise(function(_0x4a57cb,_0x28e5e1){return client[_0xdf17('0xf')](_0x4148f5,_0x3d7e91)['then'](function(_0x2a1c5c){logger[_0xdf17('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x1b435e,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1b435e,_0xdf17('0x11'),JSON[_0xdf17('0x12')](_0x2a1c5c));if(_0x2a1c5c[_0xdf17('0x13')]){if(_0x2a1c5c[_0xdf17('0x13')][_0xdf17('0x14')]===0x1f4){logger[_0xdf17('0x13')](_0xdf17('0x15'),_0x1b435e,_0x2a1c5c[_0xdf17('0x13')]['message']);return _0x28e5e1(_0x2a1c5c[_0xdf17('0x13')][_0xdf17('0x16')]);}logger[_0xdf17('0x13')](_0xdf17('0x15'),_0x1b435e,_0x2a1c5c['error'][_0xdf17('0x16')]);return _0x4a57cb(_0x2a1c5c[_0xdf17('0x13')][_0xdf17('0x16')]);}else{logger[_0xdf17('0x10')](_0xdf17('0x15'),_0x1b435e,_0xdf17('0x11'));_0x4a57cb(_0x2a1c5c[_0xdf17('0x17')][_0xdf17('0x16')]);}})[_0xdf17('0x18')](function(_0x2a9cc3){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1b435e,_0x2a9cc3);_0x28e5e1(_0x2a9cc3);});});}exports[_0xdf17('0x19')]=function(_0x3ec853){var _0x134891=this;return new Promise(function(_0x27c5b8,_0x51489c){return db[_0xdf17('0x1a')][_0xdf17('0x1b')](_0x3ec853[_0xdf17('0x1c')],{'raw':_0x3ec853['options']?_0x3ec853['options'][_0xdf17('0x1d')]===undefined?!![]:![]:!![]})[_0xdf17('0x1e')](function(_0x5c0a9b){logger[_0xdf17('0x10')](_0xdf17('0x19'),_0x3ec853);logger[_0xdf17('0x1f')]('CreateWhatsappMessage',_0x3ec853,JSON[_0xdf17('0x12')](_0x5c0a9b));_0x27c5b8(_0x5c0a9b);})['catch'](function(_0xa8ec96){logger[_0xdf17('0x13')](_0xdf17('0x19'),_0xa8ec96[_0xdf17('0x16')],_0x3ec853);_0x51489c(_0x134891[_0xdf17('0x13')](0x1f4,_0xa8ec96[_0xdf17('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index f179286..5737cae 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 _0x4b8a=['whatsappMessage:','./whatsappMessage.events','save','emit','removeListener','length'];(function(_0x3a5065,_0x1dfb9f){var _0x4e1cef=function(_0x224918){while(--_0x224918){_0x3a5065['push'](_0x3a5065['shift']());}};_0x4e1cef(++_0x1dfb9f);}(_0x4b8a,0x187));var _0xa4b8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4b8a[_0x5b644e];return _0x49c6bf;};'use strict';var WhatsappMessageEvents=require(_0xa4b8('0x0'));var events=[_0xa4b8('0x1'),'remove','update'];function createListener(_0x5b2bfb,_0x50b208){return function(_0x441d7d){_0x50b208[_0xa4b8('0x2')](_0x5b2bfb,_0x441d7d);};}function removeListener(_0x3eed21,_0x1f9dbd){return function(){WhatsappMessageEvents[_0xa4b8('0x3')](_0x3eed21,_0x1f9dbd);};}exports['register']=function(_0xaa380c){for(var _0x2a6d9b=0x0,_0x4741b5=events[_0xa4b8('0x4')];_0x2a6d9b<_0x4741b5;_0x2a6d9b++){var _0x19abc4=events[_0x2a6d9b];var _0x3b1825=createListener(_0xa4b8('0x5')+_0x19abc4,_0xaa380c);WhatsappMessageEvents['on'](_0x19abc4,_0x3b1825);}}; \ No newline at end of file +var _0xc586=['./whatsappMessage.events','remove','removeListener'];(function(_0x54e594,_0x39f121){var _0x56b2e0=function(_0x3eeb97){while(--_0x3eeb97){_0x54e594['push'](_0x54e594['shift']());}};_0x56b2e0(++_0x39f121);}(_0xc586,0x195));var _0x6c58=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xc586[_0x5a3cf0];return _0x5a64ee;};'use strict';var WhatsappMessageEvents=require(_0x6c58('0x0'));var events=['save',_0x6c58('0x1'),'update'];function createListener(_0x2336ed,_0x31837c){return function(_0x502655){_0x31837c['emit'](_0x2336ed,_0x502655);};}function removeListener(_0x12bcfa,_0xbc7c99){return function(){WhatsappMessageEvents[_0x6c58('0x2')](_0x12bcfa,_0xbc7c99);};}exports['register']=function(_0x3e680a){for(var _0x3441a9=0x0,_0x19d15b=events['length'];_0x3441a9<_0x19d15b;_0x3441a9++){var _0x31ef7c=events[_0x3441a9];var _0x2817b5=createListener('whatsappMessage:'+_0x31ef7c,_0x3e680a);WhatsappMessageEvents['on'](_0x31ef7c,_0x2817b5);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 542990d..f614306 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 _0x039f=['get','describe','/:id','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index'];(function(_0x54a1d8,_0x464a72){var _0x34b435=function(_0x6d3798){while(--_0x6d3798){_0x54a1d8['push'](_0x54a1d8['shift']());}};_0x34b435(++_0x464a72);}(_0x039f,0x90));var _0xf039=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x039f[_0x3e32a8];return _0x2997b0;};'use strict';var multer=require(_0xf039('0x0'));var util=require('util');var path=require(_0xf039('0x1'));var timeout=require(_0xf039('0x2'));var express=require(_0xf039('0x3'));var router=express[_0xf039('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf039('0x5'));var config=require(_0xf039('0x6'));var controller=require(_0xf039('0x7'));router['get']('/',auth[_0xf039('0x8')](),controller[_0xf039('0x9')]);router[_0xf039('0xa')]('/describe',auth[_0xf039('0x8')](),controller[_0xf039('0xb')]);router['get'](_0xf039('0xc'),auth[_0xf039('0x8')](),controller['show']);router[_0xf039('0xa')]('/:id/members',auth[_0xf039('0x8')](),controller['getMembers']);router['get'](_0xf039('0xd'),auth['isAuthenticated'](),controller[_0xf039('0xe')]);router['get'](_0xf039('0xf'),auth[_0xf039('0x8')](),controller['getAgents']);router[_0xf039('0x10')]('/',auth[_0xf039('0x8')](),controller[_0xf039('0x11')]);router['post'](_0xf039('0xd'),auth[_0xf039('0x8')](),controller[_0xf039('0x12')]);router[_0xf039('0x10')](_0xf039('0xf'),auth[_0xf039('0x8')](),controller['addAgents']);router[_0xf039('0x13')](_0xf039('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf039('0x14')](_0xf039('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xf039('0x14')](_0xf039('0xd'),auth[_0xf039('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xf039('0x8')](),controller['removeAgents']);module[_0xf039('0x15')]=router; \ No newline at end of file +var _0x3fe9=['addAgents','update','delete','destroy','removeTeams','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getAgents','post','/:id/users'];(function(_0x1d75cb,_0x2b2fc1){var _0x638563=function(_0x5f1b42){while(--_0x5f1b42){_0x1d75cb['push'](_0x1d75cb['shift']());}};_0x638563(++_0x2b2fc1);}(_0x3fe9,0x88));var _0x93fe=function(_0x52610a,_0x51d2da){_0x52610a=_0x52610a-0x0;var _0x33ff67=_0x3fe9[_0x52610a];return _0x33ff67;};'use strict';var multer=require(_0x93fe('0x0'));var util=require('util');var path=require(_0x93fe('0x1'));var timeout=require('connect-timeout');var express=require(_0x93fe('0x2'));var router=express[_0x93fe('0x3')]();var fs_extra=require(_0x93fe('0x4'));var auth=require(_0x93fe('0x5'));var interaction=require(_0x93fe('0x6'));var config=require('../../config/environment');var controller=require(_0x93fe('0x7'));router[_0x93fe('0x8')]('/',auth[_0x93fe('0x9')](),controller[_0x93fe('0xa')]);router[_0x93fe('0x8')](_0x93fe('0xb'),auth['isAuthenticated'](),controller[_0x93fe('0xc')]);router['get'](_0x93fe('0xd'),auth[_0x93fe('0x9')](),controller[_0x93fe('0xe')]);router['get']('/:id/members',auth[_0x93fe('0x9')](),controller[_0x93fe('0xf')]);router[_0x93fe('0x8')](_0x93fe('0x10'),auth[_0x93fe('0x9')](),controller['getTeams']);router[_0x93fe('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x93fe('0x11')]);router[_0x93fe('0x12')]('/',auth[_0x93fe('0x9')](),controller['create']);router['post'](_0x93fe('0x10'),auth[_0x93fe('0x9')](),controller['addTeams']);router[_0x93fe('0x12')](_0x93fe('0x13'),auth[_0x93fe('0x9')](),controller[_0x93fe('0x14')]);router['put'](_0x93fe('0xd'),auth['isAuthenticated'](),controller[_0x93fe('0x15')]);router[_0x93fe('0x16')](_0x93fe('0xd'),auth[_0x93fe('0x9')](),controller[_0x93fe('0x17')]);router[_0x93fe('0x16')](_0x93fe('0x10'),auth[_0x93fe('0x9')](),controller[_0x93fe('0x18')]);router[_0x93fe('0x16')]('/:id/users',auth[_0x93fe('0x9')](),controller['removeAgents']);module[_0x93fe('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index e21d31a..5b7c278 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 _0x38a5=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0xcc06cd,_0x3d2cff){var _0x25f721=function(_0x53f537){while(--_0x53f537){_0xcc06cd['push'](_0xcc06cd['shift']());}};_0x25f721(++_0x3d2cff);}(_0x38a5,0x69));var _0x538a=function(_0xd1c582,_0x16adb5){_0xd1c582=_0xd1c582-0x0;var _0x385ba0=_0x38a5[_0xd1c582];return _0x385ba0;};'use strict';var Sequelize=require(_0x538a('0x0'));module[_0x538a('0x1')]={'name':{'type':Sequelize[_0x538a('0x2')],'unique':_0x538a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x538a('0x4')](_0x538a('0x5'),_0x538a('0x6'),_0x538a('0x7'))},'description':{'type':Sequelize[_0x538a('0x2')]}}; \ No newline at end of file +var _0x7117=['rrmemory','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x26684c,_0x4f4f92){var _0xf867cd=function(_0x4cce70){while(--_0x4cce70){_0x26684c['push'](_0x26684c['shift']());}};_0xf867cd(++_0x4f4f92);}(_0x7117,0x1ec));var _0x7711=function(_0x56b6df,_0x4e1855){_0x56b6df=_0x56b6df-0x0;var _0x54791e=_0x7117[_0x56b6df];return _0x54791e;};'use strict';var Sequelize=require(_0x7711('0x0'));module[_0x7711('0x1')]={'name':{'type':Sequelize[_0x7711('0x2')],'unique':_0x7711('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7711('0x4')](_0x7711('0x5'),'beepall',_0x7711('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index d66bc0f..2867f5b 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 _0x0d1a=['join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','compact','value','transaction','removeTeams','forEach','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','json','offset','undefined','limit','count','apply','reject','update','then','destroy','WhatsappQueues','UserProfileResource','status','error','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','WhatsappQueue','includeAll','include','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','nolimit','merge','User','UserId','agent','createdAt','format','%s/%s','whatsappPause','getTeams','addTeams','ids','Team','findAll','Agents','online','voicePause','interface','flatMap','sequelize','findOrCreate','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues'];(function(_0x3d2054,_0x4cb833){var _0xb6f287=function(_0x1de76d){while(--_0x1de76d){_0x3d2054['push'](_0x3d2054['shift']());}};_0xb6f287(++_0x4cb833);}(_0x0d1a,0x9b));var _0xa0d1=function(_0x3411ce,_0x95ffb1){_0x3411ce=_0x3411ce-0x0;var _0x2cbc60=_0x0d1a[_0x3411ce];return _0x2cbc60;};'use strict';var emlformat=require(_0xa0d1('0x0'));var rimraf=require(_0xa0d1('0x1'));var zipdir=require(_0xa0d1('0x2'));var jsonpatch=require(_0xa0d1('0x3'));var rp=require(_0xa0d1('0x4'));var moment=require(_0xa0d1('0x5'));var BPromise=require(_0xa0d1('0x6'));var Mustache=require(_0xa0d1('0x7'));var util=require(_0xa0d1('0x8'));var path=require('path');var sox=require(_0xa0d1('0x9'));var csv=require(_0xa0d1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0d1('0xb'));var squel=require(_0xa0d1('0xc'));var crypto=require('crypto');var jsforce=require(_0xa0d1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa0d1('0xa'));var querystring=require(_0xa0d1('0xe'));var Papa=require(_0xa0d1('0xf'));var Redis=require(_0xa0d1('0x10'));var authService=require(_0xa0d1('0x11'));var qs=require(_0xa0d1('0x12'));var as=require(_0xa0d1('0x13'));var hardwareService=require(_0xa0d1('0x14'));var logger=require(_0xa0d1('0x15'))('api');var utils=require(_0xa0d1('0x16'));var config=require(_0xa0d1('0x17'));var licenseUtil=require(_0xa0d1('0x18'));var db=require(_0xa0d1('0x19'))['db'];config[_0xa0d1('0x1a')]=_[_0xa0d1('0x1b')](config['redis'],{'host':_0xa0d1('0x1c'),'port':0x18eb});var socket=require(_0xa0d1('0x1d'))(new Redis(config[_0xa0d1('0x1a')]));require('./whatsappQueue.socket')[_0xa0d1('0x1e')](socket);function respondWithStatusCode(_0x2a1191,_0x12fcea){_0x12fcea=_0x12fcea||0xcc;return function(_0x5dfcae){if(_0x5dfcae){return _0x2a1191[_0xa0d1('0x1f')](_0x12fcea);}return _0x2a1191['status'](_0x12fcea)['end']();};}function respondWithResult(_0x5e128e,_0x23b156){_0x23b156=_0x23b156||0xc8;return function(_0x5919c7){if(_0x5919c7){return _0x5e128e['status'](_0x23b156)[_0xa0d1('0x20')](_0x5919c7);}};}function respondWithFilteredResult(_0x2b0726,_0x217ab7){return function(_0x4e267b){if(_0x4e267b){var _0x4131ab=typeof _0x217ab7[_0xa0d1('0x21')]===_0xa0d1('0x22')&&typeof _0x217ab7[_0xa0d1('0x23')]===_0xa0d1('0x22');var _0xffc541=_0x4e267b[_0xa0d1('0x24')];var _0x21ea31=_0x4131ab?0x0:_0x217ab7[_0xa0d1('0x21')];var _0x1d170b=_0x4131ab?_0x4e267b[_0xa0d1('0x24')]:_0x217ab7[_0xa0d1('0x21')]+_0x217ab7[_0xa0d1('0x23')];var _0x490d46;if(_0x1d170b>=_0xffc541){_0x1d170b=_0xffc541;_0x490d46=0xc8;}else{_0x490d46=0xce;}_0x2b0726['status'](_0x490d46);return _0x2b0726['set']('Content-Range',_0x21ea31+'-'+_0x1d170b+'/'+_0xffc541)[_0xa0d1('0x20')](_0x4e267b);}return null;};}function patchUpdates(_0x1ce879){return function(_0x4dcc54){try{jsonpatch[_0xa0d1('0x25')](_0x4dcc54,_0x1ce879,!![]);}catch(_0x469912){return BPromise[_0xa0d1('0x26')](_0x469912);}return _0x4dcc54['save']();};}function saveUpdates(_0x42cc39,_0x37909e){return function(_0x23542a){if(_0x23542a){return _0x23542a[_0xa0d1('0x27')](_0x42cc39)[_0xa0d1('0x28')](function(_0x4fdae4){return _0x4fdae4;});}return null;};}function removeEntity(_0x4b16cc,_0x242ba5){return function(_0x4194a3){if(_0x4194a3){return _0x4194a3[_0xa0d1('0x29')]()[_0xa0d1('0x28')](function(){var _0xda92f6=_0x4194a3['get']({'plain':!![]});var _0x4edc19=_0xa0d1('0x2a');return db[_0xa0d1('0x2b')]['destroy']({'where':{'type':_0x4edc19,'resourceId':_0xda92f6['id']}})[_0xa0d1('0x28')](function(){return _0x4194a3;});})[_0xa0d1('0x28')](function(){_0x4b16cc[_0xa0d1('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x552f44,_0x13c319){return function(_0x5f167a){if(!_0x5f167a){_0x552f44[_0xa0d1('0x1f')](0x194);}return _0x5f167a;};}function handleError(_0x149d50,_0xfd7a1a){_0xfd7a1a=_0xfd7a1a||0x1f4;return function(_0xb76655){logger[_0xa0d1('0x2d')](_0xb76655['stack']);if(_0xb76655[_0xa0d1('0x2e')]){delete _0xb76655['name'];}_0x149d50['status'](_0xfd7a1a)[_0xa0d1('0x2f')](_0xb76655);};}exports['index']=function(_0x1b8c54,_0x4409d3){var _0x7c9482={},_0x574630={},_0x4f62fb={'count':0x0,'rows':[]};var _0x3c5990=_['map'](db['WhatsappQueue'][_0xa0d1('0x30')],function(_0x278dc9){return{'name':_0x278dc9[_0xa0d1('0x31')],'type':_0x278dc9[_0xa0d1('0x32')][_0xa0d1('0x33')]};});_0x574630[_0xa0d1('0x34')]=_[_0xa0d1('0x35')](_0x3c5990,_0xa0d1('0x2e'));_0x574630['query']=_[_0xa0d1('0x36')](_0x1b8c54[_0xa0d1('0x37')]);_0x574630[_0xa0d1('0x38')]=_[_0xa0d1('0x39')](_0x574630[_0xa0d1('0x34')],_0x574630[_0xa0d1('0x37')]);_0x7c9482['attributes']=_[_0xa0d1('0x39')](_0x574630[_0xa0d1('0x34')],qs['fields'](_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x3a')]));_0x7c9482['attributes']=_0x7c9482[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x7c9482['attributes']:_0x574630[_0xa0d1('0x34')];if(!_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x3d')]('nolimit')){_0x7c9482[_0xa0d1('0x23')]=qs[_0xa0d1('0x23')](_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x23')]);_0x7c9482[_0xa0d1('0x21')]=qs['offset'](_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x21')]);}_0x7c9482[_0xa0d1('0x3e')]=qs[_0xa0d1('0x3f')](_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x3f')]);_0x7c9482[_0xa0d1('0x40')]=qs[_0xa0d1('0x38')](_[_0xa0d1('0x41')](_0x1b8c54['query'],_0x574630[_0xa0d1('0x38')]),_0x3c5990);if(_0x1b8c54[_0xa0d1('0x37')]['filter']){_0x7c9482['where']=_['merge'](_0x7c9482[_0xa0d1('0x40')],{'$or':_[_0xa0d1('0x35')](_0x3c5990,function(_0x3d2428){if(_0x3d2428[_0xa0d1('0x32')]!==_0xa0d1('0x42')){var _0x28dde3={};_0x28dde3[_0x3d2428['name']]={'$like':'%'+_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x43')]+'%'};return _0x28dde3;}})});}_0x7c9482=_['merge']({},_0x7c9482,_0x1b8c54['options']);var _0x4511ae={'where':_0x7c9482[_0xa0d1('0x40')]};return db[_0xa0d1('0x44')][_0xa0d1('0x24')](_0x4511ae)[_0xa0d1('0x28')](function(_0x1526f3){_0x4f62fb['count']=_0x1526f3;if(_0x1b8c54[_0xa0d1('0x37')][_0xa0d1('0x45')]){_0x7c9482[_0xa0d1('0x46')]=[{'all':!![]}];}return db[_0xa0d1('0x44')]['findAll'](_0x7c9482);})[_0xa0d1('0x28')](function(_0x1a00fc){_0x4f62fb[_0xa0d1('0x47')]=_0x1a00fc;return _0x4f62fb;})[_0xa0d1('0x28')](respondWithFilteredResult(_0x4409d3,_0x7c9482))[_0xa0d1('0x48')](handleError(_0x4409d3,null));};exports[_0xa0d1('0x49')]=function(_0xe161b7,_0x4c018f){var _0x1a6a9d={'raw':!![],'where':{'id':_0xe161b7[_0xa0d1('0x4a')]['id']}},_0x34ef32={};_0x34ef32[_0xa0d1('0x34')]=_[_0xa0d1('0x36')](db[_0xa0d1('0x44')]['rawAttributes']);_0x34ef32[_0xa0d1('0x37')]=_['keys'](_0xe161b7['query']);_0x34ef32[_0xa0d1('0x38')]=_[_0xa0d1('0x39')](_0x34ef32[_0xa0d1('0x34')],_0x34ef32[_0xa0d1('0x37')]);_0x1a6a9d[_0xa0d1('0x3b')]=_[_0xa0d1('0x39')](_0x34ef32[_0xa0d1('0x34')],qs[_0xa0d1('0x3a')](_0xe161b7[_0xa0d1('0x37')]['fields']));_0x1a6a9d['attributes']=_0x1a6a9d[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x1a6a9d[_0xa0d1('0x3b')]:_0x34ef32[_0xa0d1('0x34')];if(_0xe161b7[_0xa0d1('0x37')][_0xa0d1('0x45')]){_0x1a6a9d[_0xa0d1('0x46')]=[{'all':!![]}];}_0x1a6a9d=_['merge']({},_0x1a6a9d,_0xe161b7[_0xa0d1('0x4b')]);return db[_0xa0d1('0x44')][_0xa0d1('0x4c')](_0x1a6a9d)[_0xa0d1('0x28')](handleEntityNotFound(_0x4c018f,null))['then'](respondWithResult(_0x4c018f,null))['catch'](handleError(_0x4c018f,null));};exports[_0xa0d1('0x4d')]=function(_0x56f51b,_0x1ad8c5){return db[_0xa0d1('0x44')][_0xa0d1('0x4d')](_0x56f51b[_0xa0d1('0x4e')],{})[_0xa0d1('0x28')](function(_0x566afa){var _0x11e461=_0x56f51b[_0xa0d1('0x4f')][_0xa0d1('0x50')]({'plain':!![]});if(!_0x11e461)throw new Error(_0xa0d1('0x51'));if(_0x11e461['role']==='user'){var _0x4a2039=_0x566afa['get']({'plain':!![]});var _0x464e85=_0xa0d1('0x2a');return db[_0xa0d1('0x52')]['find']({'where':{'name':_0x464e85,'userProfileId':_0x11e461['userProfileId']},'raw':!![]})[_0xa0d1('0x28')](function(_0xdfca4e){if(_0xdfca4e&&_0xdfca4e[_0xa0d1('0x53')]===0x0){return db[_0xa0d1('0x2b')]['create']({'name':_0x4a2039[_0xa0d1('0x2e')],'resourceId':_0x4a2039['id'],'type':_0xdfca4e['name'],'sectionId':_0xdfca4e['id']},{})[_0xa0d1('0x28')](function(){return _0x566afa;});}else{return _0x566afa;}})[_0xa0d1('0x48')](function(_0x354a34){logger[_0xa0d1('0x2d')](_0xa0d1('0x54'),_0x354a34);throw _0x354a34;});}return _0x566afa;})[_0xa0d1('0x28')](respondWithResult(_0x1ad8c5,0xc9))['catch'](handleError(_0x1ad8c5,null));};exports[_0xa0d1('0x27')]=function(_0x34e2e2,_0xc86a34){if(_0x34e2e2['body']['id']){delete _0x34e2e2[_0xa0d1('0x4e')]['id'];}return db[_0xa0d1('0x44')][_0xa0d1('0x4c')]({'where':{'id':_0x34e2e2['params']['id']}})[_0xa0d1('0x28')](handleEntityNotFound(_0xc86a34,null))[_0xa0d1('0x28')](saveUpdates(_0x34e2e2[_0xa0d1('0x4e')],null))['then'](respondWithResult(_0xc86a34,null))[_0xa0d1('0x48')](handleError(_0xc86a34,null));};exports['destroy']=function(_0x21f1e0,_0x3512c2){return db[_0xa0d1('0x44')][_0xa0d1('0x4c')]({'where':{'id':_0x21f1e0[_0xa0d1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3512c2,null))[_0xa0d1('0x28')](removeEntity(_0x3512c2,null))[_0xa0d1('0x48')](handleError(_0x3512c2,null));};exports[_0xa0d1('0x55')]=function(_0x576bdc,_0x35db3e){return db[_0xa0d1('0x44')][_0xa0d1('0x55')]()[_0xa0d1('0x28')](respondWithResult(_0x35db3e,null))['catch'](handleError(_0x35db3e,null));};exports[_0xa0d1('0x56')]=function(_0x4cffa9,_0x362827,_0x1a4140){var _0x2d0ade={'raw':!![],'where':{}},_0x1de7d8={},_0x151fe9;return db[_0xa0d1('0x44')][_0xa0d1('0x57')]({'where':{'id':_0x4cffa9[_0xa0d1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x362827,null))[_0xa0d1('0x28')](function(_0x56730c){if(_0x56730c){_0x151fe9=_0x56730c['get']({'plain':!![]});_0x1de7d8['model']=_[_0xa0d1('0x36')](db[_0xa0d1('0x58')][_0xa0d1('0x30')]);_0x1de7d8['query']=_[_0xa0d1('0x36')](_0x4cffa9['query']);_0x1de7d8[_0xa0d1('0x38')]=_[_0xa0d1('0x39')](_0x1de7d8['model'],_0x1de7d8['query']);_0x2d0ade[_0xa0d1('0x3b')]=_[_0xa0d1('0x39')](_0x1de7d8[_0xa0d1('0x34')],qs[_0xa0d1('0x3a')](_0x4cffa9[_0xa0d1('0x37')][_0xa0d1('0x3a')]));_0x2d0ade[_0xa0d1('0x3b')]=_0x2d0ade[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x2d0ade[_0xa0d1('0x3b')]:_0x1de7d8[_0xa0d1('0x34')];if(!_0x4cffa9[_0xa0d1('0x37')][_0xa0d1('0x3d')](_0xa0d1('0x59'))){_0x2d0ade[_0xa0d1('0x23')]=qs[_0xa0d1('0x23')](_0x4cffa9['query'][_0xa0d1('0x23')]);_0x2d0ade[_0xa0d1('0x21')]=qs[_0xa0d1('0x21')](_0x4cffa9[_0xa0d1('0x37')]['offset']);}_0x2d0ade['order']=qs[_0xa0d1('0x3f')](_0x4cffa9[_0xa0d1('0x37')]['sort']);_0x2d0ade[_0xa0d1('0x40')]=qs[_0xa0d1('0x38')](_[_0xa0d1('0x41')](_0x4cffa9[_0xa0d1('0x37')],_0x1de7d8['filters']));_0x2d0ade['where']['WhatsappQueueId']=_0x56730c['id'];if(_0x4cffa9[_0xa0d1('0x37')][_0xa0d1('0x43')]){_0x2d0ade[_0xa0d1('0x40')]=_[_0xa0d1('0x5a')](_0x2d0ade[_0xa0d1('0x40')],{'$or':_['map'](_0x2d0ade[_0xa0d1('0x3b')],function(_0x1942e0){var _0x5eb781={};_0x5eb781[_0x1942e0]={'$like':'%'+_0x4cffa9[_0xa0d1('0x37')]['filter']+'%'};return _0x5eb781;})});}_0x2d0ade=_[_0xa0d1('0x5a')]({},_0x2d0ade,_0x4cffa9[_0xa0d1('0x4b')]);return db[_0xa0d1('0x58')]['findAll'](_0x2d0ade);}})[_0xa0d1('0x28')](function(_0x199b8d){if(_0x199b8d){return db[_0xa0d1('0x5b')]['findAndCountAll']({'where':{'id':_[_0xa0d1('0x35')](_0x199b8d,_0xa0d1('0x5c')),'role':_0xa0d1('0x5d')},'attributes':['id',_0xa0d1('0x2e'),'whatsappPause','updatedAt',_0xa0d1('0x5e')]});}})[_0xa0d1('0x28')](function(_0x3cef52){if(_0x3cef52){return{'count':_0x3cef52['count'],'rows':_[_0xa0d1('0x35')](_0x3cef52['rows'],function(_0x50dff0){return{'membername':_0x50dff0[_0xa0d1('0x2e')],'UserId':_0x50dff0['id'],'queue_name':_0x151fe9[_0xa0d1('0x2e')],'WhatsappQueueId':_0x151fe9['id'],'interface':util[_0xa0d1('0x5f')](_0xa0d1('0x60'),'SIP',_0x50dff0[_0xa0d1('0x2e')]),'penalty':0x0,'paused':_0x50dff0[_0xa0d1('0x61')],'createdAt':_0x50dff0[_0xa0d1('0x5e')],'updatedAt':_0x50dff0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa0d1('0x28')](respondWithFilteredResult(_0x362827,_0x2d0ade))['catch'](handleError(_0x362827,null));};exports[_0xa0d1('0x62')]=function(_0x10d707,_0x39318a,_0x5ac6e5){var _0x10736d={};var _0x2d1061={};var _0x4760f5;var _0x3ad2ce;return db[_0xa0d1('0x44')][_0xa0d1('0x57')]({'where':{'id':_0x10d707['params']['id']}})[_0xa0d1('0x28')](handleEntityNotFound(_0x39318a,null))[_0xa0d1('0x28')](function(_0x316067){if(_0x316067){_0x4760f5=_0x316067;_0x2d1061['model']=_['keys'](db['Team']['rawAttributes']);_0x2d1061['query']=_[_0xa0d1('0x36')](_0x10d707['query']);_0x2d1061['filters']=_[_0xa0d1('0x39')](_0x2d1061['model'],_0x2d1061[_0xa0d1('0x37')]);_0x10736d[_0xa0d1('0x3b')]=_['intersection'](_0x2d1061[_0xa0d1('0x34')],qs[_0xa0d1('0x3a')](_0x10d707['query'][_0xa0d1('0x3a')]));_0x10736d['attributes']=_0x10736d[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x10736d[_0xa0d1('0x3b')]:_0x2d1061['model'];_0x10736d[_0xa0d1('0x3e')]=qs[_0xa0d1('0x3f')](_0x10d707[_0xa0d1('0x37')][_0xa0d1('0x3f')]);_0x10736d['where']=qs[_0xa0d1('0x38')](_['pick'](_0x10d707[_0xa0d1('0x37')],_0x2d1061[_0xa0d1('0x38')]));if(_0x10d707[_0xa0d1('0x37')][_0xa0d1('0x43')]){_0x10736d[_0xa0d1('0x40')]=_[_0xa0d1('0x5a')](_0x10736d['where'],{'$or':_[_0xa0d1('0x35')](_0x10736d['attributes'],function(_0x4ef9cc){var _0x1844f3={};_0x1844f3[_0x4ef9cc]={'$like':'%'+_0x10d707[_0xa0d1('0x37')]['filter']+'%'};return _0x1844f3;})});}_0x10736d=_[_0xa0d1('0x5a')]({},_0x10736d,_0x10d707[_0xa0d1('0x4b')]);return _0x4760f5[_0xa0d1('0x62')](_0x10736d);}})['then'](function(_0x1ff875){if(_0x1ff875){_0x3ad2ce=_0x1ff875[_0xa0d1('0x3c')];if(!_0x10d707['query'][_0xa0d1('0x3d')](_0xa0d1('0x59'))){_0x10736d[_0xa0d1('0x23')]=qs['limit'](_0x10d707[_0xa0d1('0x37')]['limit']);_0x10736d[_0xa0d1('0x21')]=qs['offset'](_0x10d707[_0xa0d1('0x37')]['offset']);}return _0x4760f5[_0xa0d1('0x62')](_0x10736d);}})[_0xa0d1('0x28')](function(_0x40e1a0){if(_0x40e1a0){return _0x40e1a0?{'count':_0x3ad2ce,'rows':_0x40e1a0}:null;}})[_0xa0d1('0x28')](respondWithResult(_0x39318a,null))[_0xa0d1('0x48')](handleError(_0x39318a,null));};exports[_0xa0d1('0x63')]=function(_0xf82a2e,_0x3e2616,_0x2747e0){var _0x18b7cf=_0xf82a2e['body'][_0xa0d1('0x64')];return db[_0xa0d1('0x65')][_0xa0d1('0x66')]({'where':{'id':_0x18b7cf},'attributes':['id'],'include':[{'model':db[_0xa0d1('0x5b')],'as':_0xa0d1('0x67'),'attributes':['id',_0xa0d1('0x2e'),_0xa0d1('0x68'),_0xa0d1('0x69'),_0xa0d1('0x6a')],'raw':!![]}]})[_0xa0d1('0x28')](function(_0x3027c6){if(_0x3027c6){var _0x278d84=_[_0xa0d1('0x6b')](_0x3027c6,function(_0x5be9b2){var _0x5e200c=_0x5be9b2[_0xa0d1('0x50')]({'plain':!![]});return _0x5e200c[_0xa0d1('0x67')];});return db[_0xa0d1('0x44')]['find']({'where':{'id':_0xf82a2e[_0xa0d1('0x4a')]['id']}})[_0xa0d1('0x28')](function(_0x43f9eb){return db[_0xa0d1('0x6c')]['transaction'](function(_0x302cbf){return _0x43f9eb[_0xa0d1('0x63')](_0x18b7cf,{'transaction':_0x302cbf})[_0xa0d1('0x28')](function(){return BPromise['each'](_0x278d84,function(_0x246bd8){return db['UserWhatsappQueue'][_0xa0d1('0x6d')]({'where':{'UserId':_0x246bd8['id'],'WhatsappQueueId':_0xf82a2e['params']['id']},'transaction':_0x302cbf});});})[_0xa0d1('0x28')](function(){_0x278d84['forEach'](function(_0x39084a){socket[_0xa0d1('0x6e')](_0xa0d1('0x6f'),{'UserId':_0x39084a['id'],'WhatsappQueueId':_0x43f9eb['id']});});});});});}})['then'](respondWithStatusCode(_0x3e2616,null))[_0xa0d1('0x48')](handleError(_0x3e2616,null));};exports['removeTeams']=function(_0x30172d,_0x25c7ae,_0x93118c){return db[_0xa0d1('0x65')][_0xa0d1('0x66')]({'where':{'id':_0x30172d[_0xa0d1('0x37')][_0xa0d1('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa0d1('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa0d1('0x28')](handleEntityNotFound(_0x25c7ae,null))[_0xa0d1('0x28')](function(_0x3971df){var _0x358d43=_[_0xa0d1('0x35')](_0x3971df,'id');var _0x1a7be5=[];var _0x1b3b12=[];var _0x28513c=squel[_0xa0d1('0x70')]();_0x28513c[_0xa0d1('0x71')](_0xa0d1('0x72'))[_0xa0d1('0x73')](_0xa0d1('0x74'),'tq')[_0xa0d1('0x75')](_0xa0d1('0x76'),'ut',_0xa0d1('0x77'))[_0xa0d1('0x40')](_0xa0d1('0x78'),_0x30172d['params']['id']);for(var _0x547da0=0x0;_0x547da0<_0x3971df[_0xa0d1('0x3c')];_0x547da0+=0x1){let _0xe8aff2=_0x3971df[_0x547da0];for(var _0x118973=0x0;_0x118973<_0xe8aff2[_0xa0d1('0x67')][_0xa0d1('0x3c')];_0x118973+=0x1){let _0x44c477=_0xe8aff2[_0xa0d1('0x67')][_0x118973];var _0x20d633=_0x28513c['clone']();_0x20d633[_0xa0d1('0x40')](_0xa0d1('0x79'),_0x44c477['id']);_0x1b3b12[_0xa0d1('0x7a')](db['sequelize'][_0xa0d1('0x37')](_0x20d633['toString'](),{'type':db[_0xa0d1('0x6c')][_0xa0d1('0x7b')]['SELECT']})[_0xa0d1('0x28')](function(_0x131779){if(_0x131779[_0xa0d1('0x3c')]===0x1){return _0x44c477['id'];}else{var _0x52c903=_[_0xa0d1('0x7c')](_[_0xa0d1('0x35')](_0x131779,'TeamId'),function(_0xd14e9b){return _['includes'](_0x358d43,_0xd14e9b);});if(_0x52c903){return _0x44c477['id'];}}}));}}return BPromise[_0xa0d1('0x7d')](_0x1b3b12)[_0xa0d1('0x28')](function(_0x4319da){_0x1a7be5=_(_0x1a7be5)[_0xa0d1('0x7e')](_0x4319da)[_0xa0d1('0x7f')]()[_0xa0d1('0x80')]();return db[_0xa0d1('0x44')]['find']({'where':{'id':_0x30172d[_0xa0d1('0x4a')]['id']}})[_0xa0d1('0x28')](function(_0x2aaba7){return db['sequelize'][_0xa0d1('0x81')](function(_0x25c2fc){return _0x2aaba7[_0xa0d1('0x82')](_0x30172d[_0xa0d1('0x37')]['ids'],{'transaction':_0x25c2fc})[_0xa0d1('0x28')](function(){if(!_['isEmpty'](_0x1a7be5)){return _0x2aaba7['removeAgents'](_0x1a7be5,{'transaction':_0x25c2fc});}})['then'](function(){_0x1a7be5[_0xa0d1('0x83')](function(_0x3946d0){socket[_0xa0d1('0x6e')]('userWhatsappQueue:remove',{'UserId':_0x3946d0,'WhatsappQueueId':_0x2aaba7['id']});});});});});});})[_0xa0d1('0x28')](respondWithStatusCode(_0x25c7ae,null))[_0xa0d1('0x48')](handleError(_0x25c7ae,null));};exports['addAgents']=function(_0x121013,_0x3e3a8c,_0xce836){return db[_0xa0d1('0x44')][_0xa0d1('0x4c')]({'where':{'id':_0x121013[_0xa0d1('0x4a')]['id']}})[_0xa0d1('0x28')](handleEntityNotFound(_0x3e3a8c,null))['then'](function(_0x1faa49){if(_0x1faa49){return _0x1faa49[_0xa0d1('0x84')](_0x121013[_0xa0d1('0x4e')][_0xa0d1('0x64')],_['omit'](_0x121013[_0xa0d1('0x4e')],[_0xa0d1('0x64'),'id'])||{})['spread'](function(_0x452ca5){for(var _0x5431cc=0x0;_0x5431cc<_0x121013[_0xa0d1('0x4e')][_0xa0d1('0x64')][_0xa0d1('0x3c')];_0x5431cc+=0x1){socket['emit'](_0xa0d1('0x6f'),{'UserId':Number(_0x121013[_0xa0d1('0x4e')][_0xa0d1('0x64')][_0x5431cc]),'WhatsappQueueId':Number(_0x121013[_0xa0d1('0x4a')]['id'])});}return _0x452ca5;});}})['then'](respondWithResult(_0x3e3a8c,null))[_0xa0d1('0x48')](handleError(_0x3e3a8c,null));};exports['removeAgents']=function(_0x3163b2,_0x405f02,_0x12e5d0){return db['WhatsappQueue'][_0xa0d1('0x4c')]({'where':{'id':_0x3163b2[_0xa0d1('0x4a')]['id']}})[_0xa0d1('0x28')](handleEntityNotFound(_0x405f02,null))['then'](function(_0x31f897){if(_0x31f897){return _0x31f897[_0xa0d1('0x85')](_0x3163b2[_0xa0d1('0x37')]['ids'])[_0xa0d1('0x28')](function(){if(_[_0xa0d1('0x86')](_0x3163b2[_0xa0d1('0x37')][_0xa0d1('0x64')])){for(var _0x3c61b0=0x0;_0x3c61b0<_0x3163b2['query'][_0xa0d1('0x64')]['length'];_0x3c61b0+=0x1){socket[_0xa0d1('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x3163b2[_0xa0d1('0x37')][_0xa0d1('0x64')][_0x3c61b0]),'WhatsappQueueId':Number(_0x3163b2[_0xa0d1('0x4a')]['id'])});}}else{socket[_0xa0d1('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x3163b2[_0xa0d1('0x37')][_0xa0d1('0x64')]),'WhatsappQueueId':Number(_0x3163b2['params']['id'])});}});}})[_0xa0d1('0x28')](respondWithStatusCode(_0x405f02,null))[_0xa0d1('0x48')](handleError(_0x405f02,null));};exports[_0xa0d1('0x87')]=function(_0x1c80e2,_0x37ee6e,_0x131678){var _0x215ca8={};var _0x3b8c07={};var _0x2b45b0;var _0x9182a9;return db[_0xa0d1('0x44')][_0xa0d1('0x57')]({'where':{'id':_0x1c80e2[_0xa0d1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x37ee6e,null))[_0xa0d1('0x28')](function(_0x2dd8d0){if(_0x2dd8d0){_0x2b45b0=_0x2dd8d0;_0x3b8c07[_0xa0d1('0x34')]=_[_0xa0d1('0x36')](db[_0xa0d1('0x5b')]['rawAttributes']);_0x3b8c07['query']=_[_0xa0d1('0x36')](_0x1c80e2[_0xa0d1('0x37')]);_0x3b8c07[_0xa0d1('0x38')]=_[_0xa0d1('0x39')](_0x3b8c07['model'],_0x3b8c07[_0xa0d1('0x37')]);_0x215ca8[_0xa0d1('0x3b')]=_['intersection'](_0x3b8c07[_0xa0d1('0x34')],qs[_0xa0d1('0x3a')](_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x3a')]));_0x215ca8[_0xa0d1('0x3b')]=_0x215ca8[_0xa0d1('0x3b')][_0xa0d1('0x3c')]?_0x215ca8[_0xa0d1('0x3b')]:_0x3b8c07[_0xa0d1('0x34')];_0x215ca8[_0xa0d1('0x3e')]=qs['sort'](_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x3f')]);_0x215ca8[_0xa0d1('0x40')]=qs['filters'](_['pick'](_0x1c80e2[_0xa0d1('0x37')],_0x3b8c07['filters']));if(_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x43')]){_0x215ca8[_0xa0d1('0x40')]=_[_0xa0d1('0x5a')](_0x215ca8[_0xa0d1('0x40')],{'$or':_[_0xa0d1('0x35')](_0x215ca8['attributes'],function(_0x14bb00){var _0x55ccf2={};_0x55ccf2[_0x14bb00]={'$like':'%'+_0x1c80e2[_0xa0d1('0x37')]['filter']+'%'};return _0x55ccf2;})});}_0x215ca8=_[_0xa0d1('0x5a')]({},_0x215ca8,_0x1c80e2[_0xa0d1('0x4b')]);return _0x2b45b0['getAgents'](_0x215ca8);}})[_0xa0d1('0x28')](function(_0x4b3a9b){if(_0x4b3a9b){_0x9182a9=_0x4b3a9b['length'];if(!_0x1c80e2[_0xa0d1('0x37')]['hasOwnProperty']('nolimit')){_0x215ca8['limit']=qs[_0xa0d1('0x23')](_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x23')]);_0x215ca8[_0xa0d1('0x21')]=qs[_0xa0d1('0x21')](_0x1c80e2[_0xa0d1('0x37')][_0xa0d1('0x21')]);}return _0x2b45b0[_0xa0d1('0x87')](_0x215ca8);}})[_0xa0d1('0x28')](function(_0x11a556){if(_0x11a556){return _0x11a556?{'count':_0x9182a9,'rows':_0x11a556}:null;}})[_0xa0d1('0x28')](respondWithResult(_0x37ee6e,null))[_0xa0d1('0x48')](handleError(_0x37ee6e,null));}; \ No newline at end of file +var _0xa699=['include','options','find','catch','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','findOne','UserWhatsappQueue','rawAttributes','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','getTeams','addTeams','ids','Team','online','voicePause','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','emit','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','WhatsappQueues','UserProfileResource','error','stack','name','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show'];(function(_0x5e8ec1,_0x275375){var _0x49e248=function(_0x40c903){while(--_0x40c903){_0x5e8ec1['push'](_0x5e8ec1['shift']());}};_0x49e248(++_0x275375);}(_0xa699,0x1f0));var _0x9a69=function(_0x10bcc4,_0x4400e2){_0x10bcc4=_0x10bcc4-0x0;var _0x2da988=_0xa699[_0x10bcc4];return _0x2da988;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a69('0x0'));var zipdir=require(_0x9a69('0x1'));var jsonpatch=require(_0x9a69('0x2'));var rp=require(_0x9a69('0x3'));var moment=require(_0x9a69('0x4'));var BPromise=require(_0x9a69('0x5'));var Mustache=require(_0x9a69('0x6'));var util=require('util');var path=require(_0x9a69('0x7'));var sox=require('sox');var csv=require(_0x9a69('0x8'));var ejs=require(_0x9a69('0x9'));var fs=require('fs');var fs_extra=require(_0x9a69('0xa'));var _=require(_0x9a69('0xb'));var squel=require('squel');var crypto=require(_0x9a69('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9a69('0xd'));var Papa=require(_0x9a69('0xe'));var Redis=require(_0x9a69('0xf'));var authService=require(_0x9a69('0x10'));var qs=require(_0x9a69('0x11'));var as=require(_0x9a69('0x12'));var hardwareService=require(_0x9a69('0x13'));var logger=require('../../config/logger')(_0x9a69('0x14'));var utils=require(_0x9a69('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9a69('0x16'));var db=require(_0x9a69('0x17'))['db'];config[_0x9a69('0x18')]=_[_0x9a69('0x19')](config[_0x9a69('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a69('0x1a'))(new Redis(config[_0x9a69('0x18')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0xc9d9e7,_0x523ff9){_0x523ff9=_0x523ff9||0xcc;return function(_0x16c884){if(_0x16c884){return _0xc9d9e7[_0x9a69('0x1b')](_0x523ff9);}return _0xc9d9e7[_0x9a69('0x1c')](_0x523ff9)[_0x9a69('0x1d')]();};}function respondWithResult(_0x5d64fa,_0x24f730){_0x24f730=_0x24f730||0xc8;return function(_0x505be9){if(_0x505be9){return _0x5d64fa[_0x9a69('0x1c')](_0x24f730)['json'](_0x505be9);}};}function respondWithFilteredResult(_0xbf1cc4,_0x3a2ea4){return function(_0x7a63be){if(_0x7a63be){var _0x156c7c=typeof _0x3a2ea4[_0x9a69('0x1e')]==='undefined'&&typeof _0x3a2ea4[_0x9a69('0x1f')]===_0x9a69('0x20');var _0x1d3644=_0x7a63be[_0x9a69('0x21')];var _0x4c3b62=_0x156c7c?0x0:_0x3a2ea4[_0x9a69('0x1e')];var _0x25875a=_0x156c7c?_0x7a63be['count']:_0x3a2ea4[_0x9a69('0x1e')]+_0x3a2ea4[_0x9a69('0x1f')];var _0x4f560a;if(_0x25875a>=_0x1d3644){_0x25875a=_0x1d3644;_0x4f560a=0xc8;}else{_0x4f560a=0xce;}_0xbf1cc4['status'](_0x4f560a);return _0xbf1cc4[_0x9a69('0x22')](_0x9a69('0x23'),_0x4c3b62+'-'+_0x25875a+'/'+_0x1d3644)[_0x9a69('0x24')](_0x7a63be);}return null;};}function patchUpdates(_0x55a5b6){return function(_0x369e77){try{jsonpatch[_0x9a69('0x25')](_0x369e77,_0x55a5b6,!![]);}catch(_0x4e038f){return BPromise['reject'](_0x4e038f);}return _0x369e77[_0x9a69('0x26')]();};}function saveUpdates(_0x4eb5a6,_0x224f26){return function(_0x465459){if(_0x465459){return _0x465459['update'](_0x4eb5a6)[_0x9a69('0x27')](function(_0x496bdd){return _0x496bdd;});}return null;};}function removeEntity(_0x4584fd,_0x3a01c5){return function(_0x502539){if(_0x502539){return _0x502539[_0x9a69('0x28')]()[_0x9a69('0x27')](function(){var _0x4cfff6=_0x502539['get']({'plain':!![]});var _0x555ceb=_0x9a69('0x29');return db[_0x9a69('0x2a')][_0x9a69('0x28')]({'where':{'type':_0x555ceb,'resourceId':_0x4cfff6['id']}})[_0x9a69('0x27')](function(){return _0x502539;});})[_0x9a69('0x27')](function(){_0x4584fd[_0x9a69('0x1c')](0xcc)[_0x9a69('0x1d')]();});}};}function handleEntityNotFound(_0x531ce4,_0x2e8de9){return function(_0xfecb9f){if(!_0xfecb9f){_0x531ce4['sendStatus'](0x194);}return _0xfecb9f;};}function handleError(_0x552162,_0x371ecc){_0x371ecc=_0x371ecc||0x1f4;return function(_0x565176){logger[_0x9a69('0x2b')](_0x565176[_0x9a69('0x2c')]);if(_0x565176[_0x9a69('0x2d')]){delete _0x565176[_0x9a69('0x2d')];}_0x552162['status'](_0x371ecc)['send'](_0x565176);};}exports['index']=function(_0x367ec7,_0x164cce){var _0x8305dd={},_0x2890ed={},_0x1a4c99={'count':0x0,'rows':[]};var _0x378c8d=_[_0x9a69('0x2e')](db[_0x9a69('0x2f')]['rawAttributes'],function(_0x5a862f){return{'name':_0x5a862f[_0x9a69('0x30')],'type':_0x5a862f[_0x9a69('0x31')][_0x9a69('0x32')]};});_0x2890ed[_0x9a69('0x33')]=_['map'](_0x378c8d,_0x9a69('0x2d'));_0x2890ed[_0x9a69('0x34')]=_[_0x9a69('0x35')](_0x367ec7[_0x9a69('0x34')]);_0x2890ed[_0x9a69('0x36')]=_[_0x9a69('0x37')](_0x2890ed['model'],_0x2890ed['query']);_0x8305dd[_0x9a69('0x38')]=_[_0x9a69('0x37')](_0x2890ed['model'],qs['fields'](_0x367ec7[_0x9a69('0x34')][_0x9a69('0x39')]));_0x8305dd['attributes']=_0x8305dd[_0x9a69('0x38')][_0x9a69('0x3a')]?_0x8305dd[_0x9a69('0x38')]:_0x2890ed[_0x9a69('0x33')];if(!_0x367ec7[_0x9a69('0x34')][_0x9a69('0x3b')](_0x9a69('0x3c'))){_0x8305dd[_0x9a69('0x1f')]=qs[_0x9a69('0x1f')](_0x367ec7[_0x9a69('0x34')][_0x9a69('0x1f')]);_0x8305dd[_0x9a69('0x1e')]=qs[_0x9a69('0x1e')](_0x367ec7[_0x9a69('0x34')][_0x9a69('0x1e')]);}_0x8305dd[_0x9a69('0x3d')]=qs[_0x9a69('0x3e')](_0x367ec7['query']['sort']);_0x8305dd[_0x9a69('0x3f')]=qs[_0x9a69('0x36')](_[_0x9a69('0x40')](_0x367ec7[_0x9a69('0x34')],_0x2890ed[_0x9a69('0x36')]),_0x378c8d);if(_0x367ec7[_0x9a69('0x34')][_0x9a69('0x41')]){_0x8305dd[_0x9a69('0x3f')]=_[_0x9a69('0x42')](_0x8305dd[_0x9a69('0x3f')],{'$or':_[_0x9a69('0x2e')](_0x378c8d,function(_0xb06013){if(_0xb06013[_0x9a69('0x31')]!==_0x9a69('0x43')){var _0x119aa6={};_0x119aa6[_0xb06013[_0x9a69('0x2d')]]={'$like':'%'+_0x367ec7[_0x9a69('0x34')][_0x9a69('0x41')]+'%'};return _0x119aa6;}})});}_0x8305dd=_[_0x9a69('0x42')]({},_0x8305dd,_0x367ec7['options']);var _0x103288={'where':_0x8305dd['where']};return db[_0x9a69('0x2f')][_0x9a69('0x21')](_0x103288)[_0x9a69('0x27')](function(_0x4aa592){_0x1a4c99['count']=_0x4aa592;if(_0x367ec7['query'][_0x9a69('0x44')]){_0x8305dd['include']=[{'all':!![]}];}return db[_0x9a69('0x2f')][_0x9a69('0x45')](_0x8305dd);})['then'](function(_0x335c24){_0x1a4c99[_0x9a69('0x46')]=_0x335c24;return _0x1a4c99;})[_0x9a69('0x27')](respondWithFilteredResult(_0x164cce,_0x8305dd))['catch'](handleError(_0x164cce,null));};exports[_0x9a69('0x47')]=function(_0x44cfe0,_0x1edcfd){var _0x334779={'raw':!![],'where':{'id':_0x44cfe0['params']['id']}},_0x4a27e7={};_0x4a27e7[_0x9a69('0x33')]=_[_0x9a69('0x35')](db[_0x9a69('0x2f')]['rawAttributes']);_0x4a27e7[_0x9a69('0x34')]=_[_0x9a69('0x35')](_0x44cfe0['query']);_0x4a27e7[_0x9a69('0x36')]=_[_0x9a69('0x37')](_0x4a27e7['model'],_0x4a27e7[_0x9a69('0x34')]);_0x334779[_0x9a69('0x38')]=_[_0x9a69('0x37')](_0x4a27e7['model'],qs[_0x9a69('0x39')](_0x44cfe0['query'][_0x9a69('0x39')]));_0x334779[_0x9a69('0x38')]=_0x334779['attributes'][_0x9a69('0x3a')]?_0x334779['attributes']:_0x4a27e7[_0x9a69('0x33')];if(_0x44cfe0[_0x9a69('0x34')][_0x9a69('0x44')]){_0x334779[_0x9a69('0x48')]=[{'all':!![]}];}_0x334779=_[_0x9a69('0x42')]({},_0x334779,_0x44cfe0[_0x9a69('0x49')]);return db['WhatsappQueue'][_0x9a69('0x4a')](_0x334779)['then'](handleEntityNotFound(_0x1edcfd,null))[_0x9a69('0x27')](respondWithResult(_0x1edcfd,null))[_0x9a69('0x4b')](handleError(_0x1edcfd,null));};exports[_0x9a69('0x4c')]=function(_0x1813f5,_0x587176){return db[_0x9a69('0x2f')][_0x9a69('0x4c')](_0x1813f5['body'],{})[_0x9a69('0x27')](function(_0x1efe31){var _0x5544c8=_0x1813f5[_0x9a69('0x4d')][_0x9a69('0x4e')]({'plain':!![]});if(!_0x5544c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5544c8[_0x9a69('0x4f')]==='user'){var _0x4ee9fb=_0x1efe31['get']({'plain':!![]});var _0x3df950='WhatsappQueues';return db[_0x9a69('0x50')][_0x9a69('0x4a')]({'where':{'name':_0x3df950,'userProfileId':_0x5544c8[_0x9a69('0x51')]},'raw':!![]})[_0x9a69('0x27')](function(_0x2650a6){if(_0x2650a6&&_0x2650a6[_0x9a69('0x52')]===0x0){return db[_0x9a69('0x2a')][_0x9a69('0x4c')]({'name':_0x4ee9fb[_0x9a69('0x2d')],'resourceId':_0x4ee9fb['id'],'type':_0x2650a6['name'],'sectionId':_0x2650a6['id']},{})['then'](function(){return _0x1efe31;});}else{return _0x1efe31;}})[_0x9a69('0x4b')](function(_0x429f45){logger['error'](_0x9a69('0x53'),_0x429f45);throw _0x429f45;});}return _0x1efe31;})[_0x9a69('0x27')](respondWithResult(_0x587176,0xc9))[_0x9a69('0x4b')](handleError(_0x587176,null));};exports[_0x9a69('0x54')]=function(_0x4c0d54,_0x1e7ac5){if(_0x4c0d54[_0x9a69('0x55')]['id']){delete _0x4c0d54['body']['id'];}return db[_0x9a69('0x2f')][_0x9a69('0x4a')]({'where':{'id':_0x4c0d54[_0x9a69('0x56')]['id']}})[_0x9a69('0x27')](handleEntityNotFound(_0x1e7ac5,null))[_0x9a69('0x27')](saveUpdates(_0x4c0d54['body'],null))['then'](respondWithResult(_0x1e7ac5,null))[_0x9a69('0x4b')](handleError(_0x1e7ac5,null));};exports['destroy']=function(_0x4ccd20,_0x39b2e9){return db['WhatsappQueue']['find']({'where':{'id':_0x4ccd20[_0x9a69('0x56')]['id']}})[_0x9a69('0x27')](handleEntityNotFound(_0x39b2e9,null))[_0x9a69('0x27')](removeEntity(_0x39b2e9,null))[_0x9a69('0x4b')](handleError(_0x39b2e9,null));};exports[_0x9a69('0x57')]=function(_0x1d2165,_0x5ee102){return db[_0x9a69('0x2f')]['describe']()[_0x9a69('0x27')](respondWithResult(_0x5ee102,null))[_0x9a69('0x4b')](handleError(_0x5ee102,null));};exports['getMembers']=function(_0x2abed7,_0x1d5ef0,_0x9f3e0f){var _0x247da0={'raw':!![],'where':{}},_0xbb4a64={},_0x435c7b;return db[_0x9a69('0x2f')][_0x9a69('0x58')]({'where':{'id':_0x2abed7[_0x9a69('0x56')]['id']}})['then'](handleEntityNotFound(_0x1d5ef0,null))[_0x9a69('0x27')](function(_0xf83b73){if(_0xf83b73){_0x435c7b=_0xf83b73['get']({'plain':!![]});_0xbb4a64[_0x9a69('0x33')]=_[_0x9a69('0x35')](db[_0x9a69('0x59')][_0x9a69('0x5a')]);_0xbb4a64['query']=_[_0x9a69('0x35')](_0x2abed7[_0x9a69('0x34')]);_0xbb4a64[_0x9a69('0x36')]=_[_0x9a69('0x37')](_0xbb4a64[_0x9a69('0x33')],_0xbb4a64[_0x9a69('0x34')]);_0x247da0['attributes']=_[_0x9a69('0x37')](_0xbb4a64[_0x9a69('0x33')],qs[_0x9a69('0x39')](_0x2abed7[_0x9a69('0x34')]['fields']));_0x247da0[_0x9a69('0x38')]=_0x247da0[_0x9a69('0x38')][_0x9a69('0x3a')]?_0x247da0[_0x9a69('0x38')]:_0xbb4a64[_0x9a69('0x33')];if(!_0x2abed7[_0x9a69('0x34')][_0x9a69('0x3b')]('nolimit')){_0x247da0[_0x9a69('0x1f')]=qs[_0x9a69('0x1f')](_0x2abed7[_0x9a69('0x34')][_0x9a69('0x1f')]);_0x247da0[_0x9a69('0x1e')]=qs[_0x9a69('0x1e')](_0x2abed7[_0x9a69('0x34')][_0x9a69('0x1e')]);}_0x247da0[_0x9a69('0x3d')]=qs[_0x9a69('0x3e')](_0x2abed7[_0x9a69('0x34')][_0x9a69('0x3e')]);_0x247da0[_0x9a69('0x3f')]=qs['filters'](_[_0x9a69('0x40')](_0x2abed7[_0x9a69('0x34')],_0xbb4a64[_0x9a69('0x36')]));_0x247da0[_0x9a69('0x3f')][_0x9a69('0x5b')]=_0xf83b73['id'];if(_0x2abed7['query']['filter']){_0x247da0[_0x9a69('0x3f')]=_['merge'](_0x247da0[_0x9a69('0x3f')],{'$or':_[_0x9a69('0x2e')](_0x247da0[_0x9a69('0x38')],function(_0x526c37){var _0x692fe8={};_0x692fe8[_0x526c37]={'$like':'%'+_0x2abed7['query'][_0x9a69('0x41')]+'%'};return _0x692fe8;})});}_0x247da0=_['merge']({},_0x247da0,_0x2abed7[_0x9a69('0x49')]);return db[_0x9a69('0x59')][_0x9a69('0x45')](_0x247da0);}})[_0x9a69('0x27')](function(_0x5ef2ee){if(_0x5ef2ee){return db[_0x9a69('0x5c')][_0x9a69('0x5d')]({'where':{'id':_[_0x9a69('0x2e')](_0x5ef2ee,_0x9a69('0x5e')),'role':_0x9a69('0x5f')},'attributes':['id',_0x9a69('0x2d'),_0x9a69('0x60'),_0x9a69('0x61'),_0x9a69('0x62')]});}})['then'](function(_0x19d1bd){if(_0x19d1bd){return{'count':_0x19d1bd['count'],'rows':_[_0x9a69('0x2e')](_0x19d1bd[_0x9a69('0x46')],function(_0x4849d2){return{'membername':_0x4849d2[_0x9a69('0x2d')],'UserId':_0x4849d2['id'],'queue_name':_0x435c7b[_0x9a69('0x2d')],'WhatsappQueueId':_0x435c7b['id'],'interface':util['format']('%s/%s','SIP',_0x4849d2[_0x9a69('0x2d')]),'penalty':0x0,'paused':_0x4849d2[_0x9a69('0x60')],'createdAt':_0x4849d2[_0x9a69('0x62')],'updatedAt':_0x4849d2[_0x9a69('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9a69('0x27')](respondWithFilteredResult(_0x1d5ef0,_0x247da0))[_0x9a69('0x4b')](handleError(_0x1d5ef0,null));};exports[_0x9a69('0x63')]=function(_0x34634c,_0x17e9b6,_0x24ac01){var _0x430443={};var _0x1aad33={};var _0x1b716f;var _0x512448;return db[_0x9a69('0x2f')][_0x9a69('0x58')]({'where':{'id':_0x34634c['params']['id']}})['then'](handleEntityNotFound(_0x17e9b6,null))[_0x9a69('0x27')](function(_0xdc24f0){if(_0xdc24f0){_0x1b716f=_0xdc24f0;_0x1aad33[_0x9a69('0x33')]=_[_0x9a69('0x35')](db['Team'][_0x9a69('0x5a')]);_0x1aad33[_0x9a69('0x34')]=_[_0x9a69('0x35')](_0x34634c[_0x9a69('0x34')]);_0x1aad33[_0x9a69('0x36')]=_[_0x9a69('0x37')](_0x1aad33[_0x9a69('0x33')],_0x1aad33[_0x9a69('0x34')]);_0x430443[_0x9a69('0x38')]=_['intersection'](_0x1aad33['model'],qs['fields'](_0x34634c[_0x9a69('0x34')][_0x9a69('0x39')]));_0x430443[_0x9a69('0x38')]=_0x430443[_0x9a69('0x38')]['length']?_0x430443[_0x9a69('0x38')]:_0x1aad33['model'];_0x430443[_0x9a69('0x3d')]=qs[_0x9a69('0x3e')](_0x34634c[_0x9a69('0x34')][_0x9a69('0x3e')]);_0x430443[_0x9a69('0x3f')]=qs[_0x9a69('0x36')](_[_0x9a69('0x40')](_0x34634c[_0x9a69('0x34')],_0x1aad33['filters']));if(_0x34634c[_0x9a69('0x34')]['filter']){_0x430443['where']=_[_0x9a69('0x42')](_0x430443[_0x9a69('0x3f')],{'$or':_['map'](_0x430443[_0x9a69('0x38')],function(_0x4cd6bb){var _0x56e4dd={};_0x56e4dd[_0x4cd6bb]={'$like':'%'+_0x34634c['query'][_0x9a69('0x41')]+'%'};return _0x56e4dd;})});}_0x430443=_[_0x9a69('0x42')]({},_0x430443,_0x34634c[_0x9a69('0x49')]);return _0x1b716f['getTeams'](_0x430443);}})[_0x9a69('0x27')](function(_0x2cf4cf){if(_0x2cf4cf){_0x512448=_0x2cf4cf[_0x9a69('0x3a')];if(!_0x34634c['query'][_0x9a69('0x3b')](_0x9a69('0x3c'))){_0x430443[_0x9a69('0x1f')]=qs['limit'](_0x34634c[_0x9a69('0x34')][_0x9a69('0x1f')]);_0x430443[_0x9a69('0x1e')]=qs[_0x9a69('0x1e')](_0x34634c[_0x9a69('0x34')][_0x9a69('0x1e')]);}return _0x1b716f[_0x9a69('0x63')](_0x430443);}})[_0x9a69('0x27')](function(_0x44c43f){if(_0x44c43f){return _0x44c43f?{'count':_0x512448,'rows':_0x44c43f}:null;}})[_0x9a69('0x27')](respondWithResult(_0x17e9b6,null))['catch'](handleError(_0x17e9b6,null));};exports[_0x9a69('0x64')]=function(_0x18e96c,_0x359cb2,_0x4e38db){var _0x5a0ed6=_0x18e96c[_0x9a69('0x55')][_0x9a69('0x65')];return db[_0x9a69('0x66')][_0x9a69('0x45')]({'where':{'id':_0x5a0ed6},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x9a69('0x67'),_0x9a69('0x68'),'interface'],'raw':!![]}]})[_0x9a69('0x27')](function(_0x3208ea){if(_0x3208ea){var _0x6acee=_[_0x9a69('0x69')](_0x3208ea,function(_0x5ccb1d){var _0x93da2d=_0x5ccb1d['get']({'plain':!![]});return _0x93da2d[_0x9a69('0x6a')];});return db[_0x9a69('0x2f')][_0x9a69('0x4a')]({'where':{'id':_0x18e96c[_0x9a69('0x56')]['id']}})[_0x9a69('0x27')](function(_0x3aa1f5){return db[_0x9a69('0x6b')][_0x9a69('0x6c')](function(_0x5031a5){return _0x3aa1f5[_0x9a69('0x64')](_0x5a0ed6,{'transaction':_0x5031a5})[_0x9a69('0x27')](function(){return BPromise['each'](_0x6acee,function(_0x279c82){return db[_0x9a69('0x59')][_0x9a69('0x6d')]({'where':{'UserId':_0x279c82['id'],'WhatsappQueueId':_0x18e96c[_0x9a69('0x56')]['id']},'transaction':_0x5031a5});});})[_0x9a69('0x27')](function(){_0x6acee[_0x9a69('0x6e')](function(_0x45da25){socket['emit'](_0x9a69('0x6f'),{'UserId':_0x45da25['id'],'WhatsappQueueId':_0x3aa1f5['id']});});});});});}})[_0x9a69('0x27')](respondWithStatusCode(_0x359cb2,null))[_0x9a69('0x4b')](handleError(_0x359cb2,null));};exports[_0x9a69('0x70')]=function(_0x37ea12,_0x191583,_0x460361){return db[_0x9a69('0x66')]['findAll']({'where':{'id':_0x37ea12[_0x9a69('0x34')][_0x9a69('0x65')]},'attributes':['id'],'include':[{'model':db[_0x9a69('0x5c')],'as':_0x9a69('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x9a69('0x27')](handleEntityNotFound(_0x191583,null))['then'](function(_0x4a0cf7){var _0x51653a=_[_0x9a69('0x2e')](_0x4a0cf7,'id');var _0x3f0113=[];var _0x1ad5fe=[];var _0x5b6a23=squel[_0x9a69('0x71')]();_0x5b6a23[_0x9a69('0x72')]('tq.TeamId')[_0x9a69('0x73')](_0x9a69('0x74'),'tq')['join'](_0x9a69('0x75'),'ut',_0x9a69('0x76'))[_0x9a69('0x3f')](_0x9a69('0x77'),_0x37ea12['params']['id']);for(var _0x37e5a5=0x0;_0x37e5a5<_0x4a0cf7['length'];_0x37e5a5+=0x1){let _0x360075=_0x4a0cf7[_0x37e5a5];for(var _0x4624fd=0x0;_0x4624fd<_0x360075[_0x9a69('0x6a')]['length'];_0x4624fd+=0x1){let _0x57e2f0=_0x360075[_0x9a69('0x6a')][_0x4624fd];var _0x451711=_0x5b6a23[_0x9a69('0x78')]();_0x451711[_0x9a69('0x3f')](_0x9a69('0x79'),_0x57e2f0['id']);_0x1ad5fe[_0x9a69('0x7a')](db[_0x9a69('0x6b')][_0x9a69('0x34')](_0x451711[_0x9a69('0x7b')](),{'type':db[_0x9a69('0x6b')][_0x9a69('0x7c')][_0x9a69('0x7d')]})[_0x9a69('0x27')](function(_0xca80ec){if(_0xca80ec[_0x9a69('0x3a')]===0x1){return _0x57e2f0['id'];}else{var _0x4b07f6=_[_0x9a69('0x7e')](_[_0x9a69('0x2e')](_0xca80ec,_0x9a69('0x7f')),function(_0x375d89){return _[_0x9a69('0x80')](_0x51653a,_0x375d89);});if(_0x4b07f6){return _0x57e2f0['id'];}}}));}}return BPromise[_0x9a69('0x81')](_0x1ad5fe)[_0x9a69('0x27')](function(_0x4f2e63){_0x3f0113=_(_0x3f0113)[_0x9a69('0x82')](_0x4f2e63)[_0x9a69('0x83')]()[_0x9a69('0x84')]();return db['WhatsappQueue']['find']({'where':{'id':_0x37ea12[_0x9a69('0x56')]['id']}})['then'](function(_0x3094c2){return db[_0x9a69('0x6b')][_0x9a69('0x6c')](function(_0x397350){return _0x3094c2['removeTeams'](_0x37ea12[_0x9a69('0x34')][_0x9a69('0x65')],{'transaction':_0x397350})['then'](function(){if(!_[_0x9a69('0x85')](_0x3f0113)){return _0x3094c2['removeAgents'](_0x3f0113,{'transaction':_0x397350});}})[_0x9a69('0x27')](function(){_0x3f0113['forEach'](function(_0x26f251){socket[_0x9a69('0x86')](_0x9a69('0x87'),{'UserId':_0x26f251,'WhatsappQueueId':_0x3094c2['id']});});});});});});})['then'](respondWithStatusCode(_0x191583,null))[_0x9a69('0x4b')](handleError(_0x191583,null));};exports[_0x9a69('0x88')]=function(_0x4c1fb5,_0x1c2fa1,_0xfd4040){return db[_0x9a69('0x2f')][_0x9a69('0x4a')]({'where':{'id':_0x4c1fb5[_0x9a69('0x56')]['id']}})[_0x9a69('0x27')](handleEntityNotFound(_0x1c2fa1,null))['then'](function(_0x1068e5){if(_0x1068e5){return _0x1068e5[_0x9a69('0x88')](_0x4c1fb5[_0x9a69('0x55')][_0x9a69('0x65')],_[_0x9a69('0x89')](_0x4c1fb5[_0x9a69('0x55')],['ids','id'])||{})[_0x9a69('0x8a')](function(_0x16ebb5){for(var _0x373362=0x0;_0x373362<_0x4c1fb5[_0x9a69('0x55')]['ids'][_0x9a69('0x3a')];_0x373362+=0x1){socket[_0x9a69('0x86')](_0x9a69('0x6f'),{'UserId':Number(_0x4c1fb5[_0x9a69('0x55')][_0x9a69('0x65')][_0x373362]),'WhatsappQueueId':Number(_0x4c1fb5[_0x9a69('0x56')]['id'])});}return _0x16ebb5;});}})[_0x9a69('0x27')](respondWithResult(_0x1c2fa1,null))[_0x9a69('0x4b')](handleError(_0x1c2fa1,null));};exports[_0x9a69('0x8b')]=function(_0x262696,_0x2c4c22,_0x4d4d78){return db[_0x9a69('0x2f')][_0x9a69('0x4a')]({'where':{'id':_0x262696['params']['id']}})['then'](handleEntityNotFound(_0x2c4c22,null))['then'](function(_0x199a93){if(_0x199a93){return _0x199a93[_0x9a69('0x8b')](_0x262696['query'][_0x9a69('0x65')])['then'](function(){if(_[_0x9a69('0x8c')](_0x262696[_0x9a69('0x34')]['ids'])){for(var _0x505077=0x0;_0x505077<_0x262696['query']['ids'][_0x9a69('0x3a')];_0x505077+=0x1){socket[_0x9a69('0x86')](_0x9a69('0x87'),{'UserId':Number(_0x262696[_0x9a69('0x34')][_0x9a69('0x65')][_0x505077]),'WhatsappQueueId':Number(_0x262696['params']['id'])});}}else{socket[_0x9a69('0x86')](_0x9a69('0x87'),{'UserId':Number(_0x262696[_0x9a69('0x34')][_0x9a69('0x65')]),'WhatsappQueueId':Number(_0x262696[_0x9a69('0x56')]['id'])});}});}})[_0x9a69('0x27')](respondWithStatusCode(_0x2c4c22,null))[_0x9a69('0x4b')](handleError(_0x2c4c22,null));};exports[_0x9a69('0x8d')]=function(_0x29a93b,_0x181b1b,_0x2a1ed6){var _0x5bea59={};var _0x217268={};var _0x31eb0e;var _0x16c573;return db[_0x9a69('0x2f')][_0x9a69('0x58')]({'where':{'id':_0x29a93b[_0x9a69('0x56')]['id']}})['then'](handleEntityNotFound(_0x181b1b,null))[_0x9a69('0x27')](function(_0x28f066){if(_0x28f066){_0x31eb0e=_0x28f066;_0x217268[_0x9a69('0x33')]=_['keys'](db[_0x9a69('0x5c')][_0x9a69('0x5a')]);_0x217268[_0x9a69('0x34')]=_['keys'](_0x29a93b[_0x9a69('0x34')]);_0x217268[_0x9a69('0x36')]=_['intersection'](_0x217268[_0x9a69('0x33')],_0x217268['query']);_0x5bea59[_0x9a69('0x38')]=_[_0x9a69('0x37')](_0x217268['model'],qs[_0x9a69('0x39')](_0x29a93b[_0x9a69('0x34')][_0x9a69('0x39')]));_0x5bea59['attributes']=_0x5bea59[_0x9a69('0x38')][_0x9a69('0x3a')]?_0x5bea59[_0x9a69('0x38')]:_0x217268[_0x9a69('0x33')];_0x5bea59[_0x9a69('0x3d')]=qs[_0x9a69('0x3e')](_0x29a93b[_0x9a69('0x34')][_0x9a69('0x3e')]);_0x5bea59[_0x9a69('0x3f')]=qs['filters'](_['pick'](_0x29a93b[_0x9a69('0x34')],_0x217268['filters']));if(_0x29a93b[_0x9a69('0x34')]['filter']){_0x5bea59[_0x9a69('0x3f')]=_[_0x9a69('0x42')](_0x5bea59[_0x9a69('0x3f')],{'$or':_[_0x9a69('0x2e')](_0x5bea59['attributes'],function(_0x324339){var _0x5a8e1e={};_0x5a8e1e[_0x324339]={'$like':'%'+_0x29a93b[_0x9a69('0x34')][_0x9a69('0x41')]+'%'};return _0x5a8e1e;})});}_0x5bea59=_[_0x9a69('0x42')]({},_0x5bea59,_0x29a93b['options']);return _0x31eb0e[_0x9a69('0x8d')](_0x5bea59);}})[_0x9a69('0x27')](function(_0x5c0847){if(_0x5c0847){_0x16c573=_0x5c0847[_0x9a69('0x3a')];if(!_0x29a93b[_0x9a69('0x34')][_0x9a69('0x3b')](_0x9a69('0x3c'))){_0x5bea59[_0x9a69('0x1f')]=qs['limit'](_0x29a93b['query'][_0x9a69('0x1f')]);_0x5bea59[_0x9a69('0x1e')]=qs['offset'](_0x29a93b[_0x9a69('0x34')][_0x9a69('0x1e')]);}return _0x31eb0e['getAgents'](_0x5bea59);}})[_0x9a69('0x27')](function(_0x1224aa){if(_0x1224aa){return _0x1224aa?{'count':_0x16c573,'rows':_0x1224aa}:null;}})[_0x9a69('0x27')](respondWithResult(_0x181b1b,null))[_0x9a69('0x4b')](handleError(_0x181b1b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b623dfb..3ec8da6 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 _0x722c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x722c,0xb7));var _0xc722=function(_0x282240,_0x47ad21){_0x282240=_0x282240-0x0;var _0x1f5d1c=_0x722c[_0x282240];return _0x1f5d1c;};'use strict';var EventEmitter=require(_0xc722('0x0'));var WhatsappQueue=require(_0xc722('0x1'))['db'][_0xc722('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc722('0x3')](0x0);var events={'afterCreate':_0xc722('0x4'),'afterUpdate':_0xc722('0x5'),'afterDestroy':_0xc722('0x6')};function emitEvent(_0x4dbadc){return function(_0x261224,_0x229a1b,_0x30ed79){WhatsappQueueEvents[_0xc722('0x7')](_0x4dbadc+':'+_0x261224['id'],_0x261224);WhatsappQueueEvents[_0xc722('0x7')](_0x4dbadc,_0x261224);_0x30ed79(null);};}for(var e in events){if(events[_0xc722('0x8')](e)){var event=events[e];WhatsappQueue[_0xc722('0x9')](e,emitEvent(event));}}module[_0xc722('0xa')]=WhatsappQueueEvents; \ No newline at end of file +var _0xe1d8=['hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit'];(function(_0x2436d0,_0x5ed0fb){var _0x2a6240=function(_0x16890b){while(--_0x16890b){_0x2436d0['push'](_0x2436d0['shift']());}};_0x2a6240(++_0x5ed0fb);}(_0xe1d8,0x1e8));var _0x8e1d=function(_0x102b5a,_0x15f9c2){_0x102b5a=_0x102b5a-0x0;var _0x58ebf0=_0xe1d8[_0x102b5a];return _0x58ebf0;};'use strict';var EventEmitter=require(_0x8e1d('0x0'));var WhatsappQueue=require(_0x8e1d('0x1'))['db'][_0x8e1d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8e1d('0x3')](0x0);var events={'afterCreate':_0x8e1d('0x4'),'afterUpdate':'update','afterDestroy':_0x8e1d('0x5')};function emitEvent(_0x2acd38){return function(_0x3b73cd,_0x467fd9,_0x1170bd){WhatsappQueueEvents[_0x8e1d('0x6')](_0x2acd38+':'+_0x3b73cd['id'],_0x3b73cd);WhatsappQueueEvents[_0x8e1d('0x6')](_0x2acd38,_0x3b73cd);_0x1170bd(null);};}for(var e in events){if(events[_0x8e1d('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x8e1d('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index c9a1dca..2d67268 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 _0x57a6=['../../config/environment','exports','define','WhatsappQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x57a6,0xc4));var _0x657a=function(_0x5825df,_0x4b733f){_0x5825df=_0x5825df-0x0;var _0x124d9b=_0x57a6[_0x5825df];return _0x124d9b;};'use strict';var _=require(_0x657a('0x0'));var util=require(_0x657a('0x1'));var logger=require(_0x657a('0x2'))(_0x657a('0x3'));var moment=require('moment');var BPromise=require(_0x657a('0x4'));var rp=require(_0x657a('0x5'));var fs=require('fs');var path=require(_0x657a('0x6'));var rimraf=require(_0x657a('0x7'));var config=require(_0x657a('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0x657a('0x9')]=function(_0x1ce0db,_0x29e1c6){return _0x1ce0db[_0x657a('0xa')](_0x657a('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf6b=['WhatsappQueue','whatsapp_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','./whatsappQueue.attributes','exports','define'];(function(_0x3ae147,_0x4ca19b){var _0x235663=function(_0x1a9a99){while(--_0x1a9a99){_0x3ae147['push'](_0x3ae147['shift']());}};_0x235663(++_0x4ca19b);}(_0xbf6b,0x14c));var _0xbbf6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbf6b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xbbf6('0x0'));var util=require('util');var logger=require(_0xbbf6('0x1'))('api');var moment=require(_0xbbf6('0x2'));var BPromise=require(_0xbbf6('0x3'));var rp=require(_0xbbf6('0x4'));var fs=require('fs');var path=require(_0xbbf6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbbf6('0x6'));module[_0xbbf6('0x7')]=function(_0x545302,_0x267333){return _0x545302[_0xbbf6('0x8')](_0xbbf6('0x9'),attributes,{'tableName':_0xbbf6('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 d35cbfe..70c9775 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 _0x3298=['WhatsappQueue,\x20%s,\x20%s','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','catch','ShowWhatsappQueue','find','where','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3298,0x182));var _0x8329=function(_0x28fab8,_0x5e9d0a){_0x28fab8=_0x28fab8-0x0;var _0x2a326c=_0x3298[_0x28fab8];return _0x2a326c;};'use strict';var _=require('lodash');var util=require(_0x8329('0x0'));var moment=require(_0x8329('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8329('0x2'));var db=require(_0x8329('0x3'))['db'];var utils=require(_0x8329('0x4'));var logger=require(_0x8329('0x5'))(_0x8329('0x6'));var config=require(_0x8329('0x7'));var jayson=require(_0x8329('0x8'));var client=jayson[_0x8329('0x9')]['http']({'port':0x232a});config[_0x8329('0xa')]=_[_0x8329('0xb')](config[_0x8329('0xa')],{'host':_0x8329('0xc'),'port':0x18eb});var socket=require(_0x8329('0xd'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x8329('0xe')](socket);function respondWithRpcPromise(_0x5d0508,_0x1eb034,_0x599f71){return new BPromise(function(_0x5085b8,_0x104fdd){return client[_0x8329('0xf')](_0x5d0508,_0x599f71)[_0x8329('0x10')](function(_0x3dd6b4){logger[_0x8329('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x1eb034,_0x8329('0x12'));logger[_0x8329('0x13')](_0x8329('0x14'),_0x1eb034,_0x8329('0x12'),JSON[_0x8329('0x15')](_0x3dd6b4));if(_0x3dd6b4['error']){if(_0x3dd6b4['error'][_0x8329('0x16')]===0x1f4){logger[_0x8329('0x17')](_0x8329('0x18'),_0x1eb034,_0x3dd6b4[_0x8329('0x17')][_0x8329('0x19')]);return _0x104fdd(_0x3dd6b4[_0x8329('0x17')][_0x8329('0x19')]);}logger[_0x8329('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x1eb034,_0x3dd6b4[_0x8329('0x17')][_0x8329('0x19')]);return _0x5085b8(_0x3dd6b4[_0x8329('0x17')][_0x8329('0x19')]);}else{logger[_0x8329('0x11')](_0x8329('0x18'),_0x1eb034,'request\x20sent');_0x5085b8(_0x3dd6b4[_0x8329('0x1a')]['message']);}})['catch'](function(_0x375e46){logger[_0x8329('0x17')](_0x8329('0x18'),_0x1eb034,_0x375e46);_0x104fdd(_0x375e46);});});}exports[_0x8329('0x1b')]=function(_0x224922){var _0x118969=this;return new Promise(function(_0x284a6e,_0x4cc5a0){return db[_0x8329('0x1c')][_0x8329('0x1d')]({'raw':_0x224922[_0x8329('0x1e')]?_0x224922[_0x8329('0x1e')][_0x8329('0x1f')]===undefined?!![]:![]:!![],'where':_0x224922[_0x8329('0x1e')]?_0x224922[_0x8329('0x1e')]['where']||null:null,'attributes':_0x224922[_0x8329('0x1e')]?_0x224922['options'][_0x8329('0x20')]||null:null,'limit':_0x224922[_0x8329('0x1e')]?_0x224922[_0x8329('0x1e')][_0x8329('0x21')]||null:null,'include':_0x224922[_0x8329('0x1e')]?_0x224922[_0x8329('0x1e')][_0x8329('0x22')]?_[_0x8329('0x23')](_0x224922['options']['include'],function(_0x1d0bbe){return{'model':db[_0x1d0bbe[_0x8329('0x24')]],'as':_0x1d0bbe['as'],'attributes':_0x1d0bbe[_0x8329('0x20')],'include':_0x1d0bbe[_0x8329('0x22')]?_[_0x8329('0x23')](_0x1d0bbe['include'],function(_0x9a2c0b){return{'model':db[_0x9a2c0b[_0x8329('0x24')]],'as':_0x9a2c0b['as'],'attributes':_0x9a2c0b[_0x8329('0x20')],'include':_0x9a2c0b[_0x8329('0x22')]?_['map'](_0x9a2c0b['include'],function(_0x2b1c50){return{'model':db[_0x2b1c50[_0x8329('0x24')]],'as':_0x2b1c50['as'],'attributes':_0x2b1c50[_0x8329('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8329('0x10')](function(_0xbd526a){logger[_0x8329('0x11')](_0x8329('0x1b'),_0x224922);logger[_0x8329('0x13')](_0x8329('0x1b'),_0x224922,JSON[_0x8329('0x15')](_0xbd526a));_0x284a6e(_0xbd526a);})[_0x8329('0x25')](function(_0x419cbc){logger[_0x8329('0x17')](_0x8329('0x1b'),_0x419cbc['message'],_0x224922);_0x4cc5a0(_0x118969[_0x8329('0x17')](0x1f4,_0x419cbc[_0x8329('0x19')]));});});};exports[_0x8329('0x26')]=function(_0x3bf142){var _0x1e85f7=this;return new Promise(function(_0x1dc626,_0x187300){return db['WhatsappQueue'][_0x8329('0x27')]({'raw':_0x3bf142['options']?_0x3bf142[_0x8329('0x1e')][_0x8329('0x1f')]===undefined?!![]:![]:!![],'where':_0x3bf142[_0x8329('0x1e')]?_0x3bf142[_0x8329('0x1e')][_0x8329('0x28')]||null:null,'attributes':_0x3bf142['options']?_0x3bf142[_0x8329('0x1e')][_0x8329('0x20')]||null:null,'include':_0x3bf142[_0x8329('0x1e')]?_0x3bf142['options'][_0x8329('0x22')]?_[_0x8329('0x23')](_0x3bf142[_0x8329('0x1e')][_0x8329('0x22')],function(_0x4297a1){return{'model':db[_0x4297a1[_0x8329('0x24')]],'as':_0x4297a1['as'],'attributes':_0x4297a1[_0x8329('0x20')],'include':_0x4297a1[_0x8329('0x22')]?_[_0x8329('0x23')](_0x4297a1[_0x8329('0x22')],function(_0x12fc7d){return{'model':db[_0x12fc7d['model']],'as':_0x12fc7d['as'],'attributes':_0x12fc7d['attributes'],'include':_0x12fc7d[_0x8329('0x22')]?_[_0x8329('0x23')](_0x12fc7d['include'],function(_0x34caab){return{'model':db[_0x34caab[_0x8329('0x24')]],'as':_0x34caab['as'],'attributes':_0x34caab[_0x8329('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8329('0x10')](function(_0x1e0d37){logger[_0x8329('0x11')](_0x8329('0x26'),_0x3bf142);logger[_0x8329('0x13')](_0x8329('0x26'),_0x3bf142,JSON[_0x8329('0x15')](_0x1e0d37));_0x1dc626(_0x1e0d37);})[_0x8329('0x25')](function(_0x3bf92c){logger[_0x8329('0x17')]('ShowWhatsappQueue',_0x3bf92c[_0x8329('0x19')],_0x3bf142);_0x187300(_0x1e85f7[_0x8329('0x17')](0x1f4,_0x3bf92c[_0x8329('0x19')]));});});}; \ No newline at end of file +var _0xf43c=['stringify','ShowWhatsappQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','catch','GetWhatsappQueue','options','raw','attributes','include','model','map'];(function(_0x55c9ba,_0x56c88b){var _0x17a098=function(_0x595b37){while(--_0x595b37){_0x55c9ba['push'](_0x55c9ba['shift']());}};_0x17a098(++_0x56c88b);}(_0xf43c,0x190));var _0xcf43=function(_0x3418e2,_0x57c992){_0x3418e2=_0x3418e2-0x0;var _0xb32aa9=_0xf43c[_0x3418e2];return _0xb32aa9;};'use strict';var _=require(_0xcf43('0x0'));var util=require('util');var moment=require(_0xcf43('0x1'));var BPromise=require(_0xcf43('0x2'));var rs=require(_0xcf43('0x3'));var fs=require('fs');var Redis=require(_0xcf43('0x4'));var db=require(_0xcf43('0x5'))['db'];var utils=require(_0xcf43('0x6'));var logger=require(_0xcf43('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcf43('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xcf43('0x9')]=_[_0xcf43('0xa')](config['redis'],{'host':_0xcf43('0xb'),'port':0x18eb});var socket=require(_0xcf43('0xc'))(new Redis(config['redis']));require(_0xcf43('0xd'))['register'](socket);function respondWithRpcPromise(_0x145c94,_0x4e2a1b,_0x4b2044){return new BPromise(function(_0x2c7048,_0x5cdfb0){return client[_0xcf43('0xe')](_0x145c94,_0x4b2044)[_0xcf43('0xf')](function(_0x33d31e){logger[_0xcf43('0x10')](_0xcf43('0x11'),_0x4e2a1b,_0xcf43('0x12'));logger[_0xcf43('0x13')](_0xcf43('0x14'),_0x4e2a1b,_0xcf43('0x12'),JSON['stringify'](_0x33d31e));if(_0x33d31e['error']){if(_0x33d31e['error'][_0xcf43('0x15')]===0x1f4){logger[_0xcf43('0x16')](_0xcf43('0x11'),_0x4e2a1b,_0x33d31e[_0xcf43('0x16')][_0xcf43('0x17')]);return _0x5cdfb0(_0x33d31e[_0xcf43('0x16')][_0xcf43('0x17')]);}logger['error'](_0xcf43('0x11'),_0x4e2a1b,_0x33d31e[_0xcf43('0x16')][_0xcf43('0x17')]);return _0x2c7048(_0x33d31e['error'][_0xcf43('0x17')]);}else{logger[_0xcf43('0x10')](_0xcf43('0x11'),_0x4e2a1b,_0xcf43('0x12'));_0x2c7048(_0x33d31e['result'][_0xcf43('0x17')]);}})[_0xcf43('0x18')](function(_0x102c39){logger[_0xcf43('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x4e2a1b,_0x102c39);_0x5cdfb0(_0x102c39);});});}exports[_0xcf43('0x19')]=function(_0x2ccf26){var _0x415b1a=this;return new Promise(function(_0x2ef372,_0x355a02){return db['WhatsappQueue']['findAll']({'raw':_0x2ccf26[_0xcf43('0x1a')]?_0x2ccf26['options'][_0xcf43('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ccf26[_0xcf43('0x1a')]?_0x2ccf26[_0xcf43('0x1a')]['where']||null:null,'attributes':_0x2ccf26[_0xcf43('0x1a')]?_0x2ccf26[_0xcf43('0x1a')][_0xcf43('0x1c')]||null:null,'limit':_0x2ccf26[_0xcf43('0x1a')]?_0x2ccf26[_0xcf43('0x1a')]['limit']||null:null,'include':_0x2ccf26[_0xcf43('0x1a')]?_0x2ccf26['options']['include']?_['map'](_0x2ccf26[_0xcf43('0x1a')][_0xcf43('0x1d')],function(_0x575c9b){return{'model':db[_0x575c9b[_0xcf43('0x1e')]],'as':_0x575c9b['as'],'attributes':_0x575c9b[_0xcf43('0x1c')],'include':_0x575c9b[_0xcf43('0x1d')]?_[_0xcf43('0x1f')](_0x575c9b['include'],function(_0x12977c){return{'model':db[_0x12977c['model']],'as':_0x12977c['as'],'attributes':_0x12977c['attributes'],'include':_0x12977c[_0xcf43('0x1d')]?_[_0xcf43('0x1f')](_0x12977c['include'],function(_0x2a2b53){return{'model':db[_0x2a2b53[_0xcf43('0x1e')]],'as':_0x2a2b53['as'],'attributes':_0x2a2b53[_0xcf43('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ec505){logger[_0xcf43('0x10')]('GetWhatsappQueue',_0x2ccf26);logger[_0xcf43('0x13')](_0xcf43('0x19'),_0x2ccf26,JSON[_0xcf43('0x20')](_0x5ec505));_0x2ef372(_0x5ec505);})[_0xcf43('0x18')](function(_0x3c4e54){logger['error'](_0xcf43('0x19'),_0x3c4e54[_0xcf43('0x17')],_0x2ccf26);_0x355a02(_0x415b1a[_0xcf43('0x16')](0x1f4,_0x3c4e54[_0xcf43('0x17')]));});});};exports[_0xcf43('0x21')]=function(_0x48fc45){var _0x2ed2f0=this;return new Promise(function(_0x3640b9,_0x411cad){return db['WhatsappQueue'][_0xcf43('0x22')]({'raw':_0x48fc45[_0xcf43('0x1a')]?_0x48fc45[_0xcf43('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x48fc45['options']?_0x48fc45[_0xcf43('0x1a')][_0xcf43('0x23')]||null:null,'attributes':_0x48fc45[_0xcf43('0x1a')]?_0x48fc45[_0xcf43('0x1a')][_0xcf43('0x1c')]||null:null,'include':_0x48fc45[_0xcf43('0x1a')]?_0x48fc45['options']['include']?_[_0xcf43('0x1f')](_0x48fc45[_0xcf43('0x1a')][_0xcf43('0x1d')],function(_0x5cffd6){return{'model':db[_0x5cffd6['model']],'as':_0x5cffd6['as'],'attributes':_0x5cffd6[_0xcf43('0x1c')],'include':_0x5cffd6[_0xcf43('0x1d')]?_[_0xcf43('0x1f')](_0x5cffd6[_0xcf43('0x1d')],function(_0x26ced4){return{'model':db[_0x26ced4[_0xcf43('0x1e')]],'as':_0x26ced4['as'],'attributes':_0x26ced4['attributes'],'include':_0x26ced4[_0xcf43('0x1d')]?_['map'](_0x26ced4[_0xcf43('0x1d')],function(_0x1e6a52){return{'model':db[_0x1e6a52['model']],'as':_0x1e6a52['as'],'attributes':_0x1e6a52[_0xcf43('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcf43('0xf')](function(_0x5d2e7d){logger[_0xcf43('0x10')](_0xcf43('0x21'),_0x48fc45);logger['debug'](_0xcf43('0x21'),_0x48fc45,JSON[_0xcf43('0x20')](_0x5d2e7d));_0x3640b9(_0x5d2e7d);})[_0xcf43('0x18')](function(_0x58728e){logger[_0xcf43('0x16')](_0xcf43('0x21'),_0x58728e[_0xcf43('0x17')],_0x48fc45);_0x411cad(_0x2ed2f0[_0xcf43('0x16')](0x1f4,_0x58728e[_0xcf43('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 4cc8c59..47209b2 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 _0xd566=['remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0xc19dfb,_0x29ba0c){var _0x1061b1=function(_0x22ae12){while(--_0x22ae12){_0xc19dfb['push'](_0xc19dfb['shift']());}};_0x1061b1(++_0x29ba0c);}(_0xd566,0x1cf));var _0x6d56=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd566[_0x4b369d];return _0x571a98;};'use strict';var WhatsappQueueEvents=require(_0x6d56('0x0'));var events=['save',_0x6d56('0x1'),_0x6d56('0x2')];function createListener(_0x21c45b,_0x36a641){return function(_0x35e0f){_0x36a641[_0x6d56('0x3')](_0x21c45b,_0x35e0f);};}function removeListener(_0x4533d7,_0x14a3c0){return function(){WhatsappQueueEvents[_0x6d56('0x4')](_0x4533d7,_0x14a3c0);};}exports[_0x6d56('0x5')]=function(_0x5ea150){for(var _0x1baf8e=0x0,_0x400ee2=events[_0x6d56('0x6')];_0x1baf8e<_0x400ee2;_0x1baf8e++){var _0x32c3c1=events[_0x1baf8e];var _0x46ca58=createListener(_0x6d56('0x7')+_0x32c3c1,_0x5ea150);WhatsappQueueEvents['on'](_0x32c3c1,_0x46ca58);}}; \ No newline at end of file +var _0x1a71=['whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x4257cf,_0x3cd364){var _0x5394a3=function(_0x3ae4da){while(--_0x3ae4da){_0x4257cf['push'](_0x4257cf['shift']());}};_0x5394a3(++_0x3cd364);}(_0x1a71,0xd9));var _0x11a7=function(_0x57e8cf,_0x23d09a){_0x57e8cf=_0x57e8cf-0x0;var _0x3831c4=_0x1a71[_0x57e8cf];return _0x3831c4;};'use strict';var WhatsappQueueEvents=require(_0x11a7('0x0'));var events=[_0x11a7('0x1'),_0x11a7('0x2'),_0x11a7('0x3')];function createListener(_0x33439d,_0x568753){return function(_0xa1a1bb){_0x568753[_0x11a7('0x4')](_0x33439d,_0xa1a1bb);};}function removeListener(_0xcf0cc2,_0x220b61){return function(){WhatsappQueueEvents[_0x11a7('0x5')](_0xcf0cc2,_0x220b61);};}exports['register']=function(_0x252bed){for(var _0x3bb2b9=0x0,_0x25f810=events[_0x11a7('0x6')];_0x3bb2b9<_0x25f810;_0x3bb2b9++){var _0x455b20=events[_0x3bb2b9];var _0x2bd934=createListener(_0x11a7('0x7')+_0x455b20,_0x252bed);WhatsappQueueEvents['on'](_0x455b20,_0x2bd934);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 407bc64..d3521df 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 _0xe2c7=['./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1af8bb,_0x5acd34){var _0x1704b8=function(_0x395922){while(--_0x395922){_0x1af8bb['push'](_0x1af8bb['shift']());}};_0x1704b8(++_0x5acd34);}(_0xe2c7,0x1ac));var _0x7e2c=function(_0x7d5a8b,_0x2aedef){_0x7d5a8b=_0x7d5a8b-0x0;var _0x56ac46=_0xe2c7[_0x7d5a8b];return _0x56ac46;};'use strict';var multer=require(_0x7e2c('0x0'));var util=require(_0x7e2c('0x1'));var path=require(_0x7e2c('0x2'));var timeout=require(_0x7e2c('0x3'));var express=require(_0x7e2c('0x4'));var router=express[_0x7e2c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7e2c('0x6'));var interaction=require(_0x7e2c('0x7'));var config=require(_0x7e2c('0x8'));var controller=require(_0x7e2c('0x9'));router['get']('/',auth[_0x7e2c('0xa')](),controller[_0x7e2c('0xb')]);router[_0x7e2c('0xc')](_0x7e2c('0xd'),auth[_0x7e2c('0xa')](),controller[_0x7e2c('0xe')]);router[_0x7e2c('0xc')](_0x7e2c('0xf'),auth[_0x7e2c('0xa')](),controller[_0x7e2c('0x10')]);router[_0x7e2c('0x11')]('/',auth['isAuthenticated'](),controller[_0x7e2c('0x12')]);router[_0x7e2c('0x13')](_0x7e2c('0xf'),auth[_0x7e2c('0xa')](),controller['update']);router[_0x7e2c('0x14')](_0x7e2c('0xf'),auth['isAuthenticated'](),controller[_0x7e2c('0x15')]);module[_0x7e2c('0x16')]=router; \ No newline at end of file +var _0x8c7b=['create','put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c7b,0x1be));var _0xb8c7=function(_0x231975,_0x469930){_0x231975=_0x231975-0x0;var _0x24f68a=_0x8c7b[_0x231975];return _0x24f68a;};'use strict';var multer=require(_0xb8c7('0x0'));var util=require('util');var path=require(_0xb8c7('0x1'));var timeout=require(_0xb8c7('0x2'));var express=require('express');var router=express[_0xb8c7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb8c7('0x4'));var interaction=require(_0xb8c7('0x5'));var config=require(_0xb8c7('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xb8c7('0x7')]('/',auth[_0xb8c7('0x8')](),controller[_0xb8c7('0x9')]);router[_0xb8c7('0x7')](_0xb8c7('0xa'),auth[_0xb8c7('0x8')](),controller[_0xb8c7('0xb')]);router[_0xb8c7('0x7')](_0xb8c7('0xc'),auth[_0xb8c7('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb8c7('0xd')]);router[_0xb8c7('0xe')](_0xb8c7('0xc'),auth[_0xb8c7('0x8')](),controller['update']);router[_0xb8c7('0xf')](_0xb8c7('0xc'),auth[_0xb8c7('0x8')](),controller['destroy']);module[_0xb8c7('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 08cfdef..b0dde11 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1bee04,_0x515ba3){var _0x157bfc=function(_0x19eff0){while(--_0x19eff0){_0x1bee04['push'](_0x1bee04['shift']());}};_0x157bfc(++_0x515ba3);}(_0x7a54,0x106));var _0x47a5=function(_0x2bf752,_0x2ca962){_0x2bf752=_0x2bf752-0x0;var _0x153116=_0x7a54[_0x2bf752];return _0x153116;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x338b07,_0x25c13b){var _0xb3414b=function(_0x149a6b){while(--_0x149a6b){_0x338b07['push'](_0x338b07['shift']());}};_0xb3414b(++_0x25c13b);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 4ac6b67..7c4b473 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 _0xbc9d=['index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','map','type','merge','options','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','stack','name','send'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x41ef55,_0xb33f15){_0x41ef55=_0x41ef55-0x0;var _0x3574d3=_0xbc9d[_0x41ef55];return _0x3574d3;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];function respondWithStatusCode(_0x103d54,_0x48bc83){_0x48bc83=_0x48bc83||0xcc;return function(_0x567e71){if(_0x567e71){return _0x103d54[_0xdbc9('0x19')](_0x48bc83);}return _0x103d54[_0xdbc9('0x1a')](_0x48bc83)[_0xdbc9('0x1b')]();};}function respondWithResult(_0x436e50,_0x53495d){_0x53495d=_0x53495d||0xc8;return function(_0x4a9dcb){if(_0x4a9dcb){return _0x436e50[_0xdbc9('0x1a')](_0x53495d)[_0xdbc9('0x1c')](_0x4a9dcb);}};}function respondWithFilteredResult(_0x3a8a7b,_0x4c7b4f){return function(_0x1b4616){if(_0x1b4616){var _0x1abee8=typeof _0x4c7b4f['offset']===_0xdbc9('0x1d')&&typeof _0x4c7b4f[_0xdbc9('0x1e')]===_0xdbc9('0x1d');var _0x14e655=_0x1b4616[_0xdbc9('0x1f')];var _0x33f1bd=_0x1abee8?0x0:_0x4c7b4f[_0xdbc9('0x20')];var _0xc2ddd2=_0x1abee8?_0x1b4616[_0xdbc9('0x1f')]:_0x4c7b4f[_0xdbc9('0x20')]+_0x4c7b4f['limit'];var _0x1ca5fd;if(_0xc2ddd2>=_0x14e655){_0xc2ddd2=_0x14e655;_0x1ca5fd=0xc8;}else{_0x1ca5fd=0xce;}_0x3a8a7b['status'](_0x1ca5fd);return _0x3a8a7b[_0xdbc9('0x21')](_0xdbc9('0x22'),_0x33f1bd+'-'+_0xc2ddd2+'/'+_0x14e655)['json'](_0x1b4616);}return null;};}function patchUpdates(_0x4408e9){return function(_0x5367dc){try{jsonpatch['apply'](_0x5367dc,_0x4408e9,!![]);}catch(_0x4ab00d){return BPromise['reject'](_0x4ab00d);}return _0x5367dc[_0xdbc9('0x23')]();};}function saveUpdates(_0x2011a2,_0x570ad9){return function(_0x16dcf7){if(_0x16dcf7){return _0x16dcf7[_0xdbc9('0x24')](_0x2011a2)['then'](function(_0x1bc073){return _0x1bc073;});}return null;};}function removeEntity(_0x6b788,_0x1b1c0d){return function(_0x119230){if(_0x119230){return _0x119230[_0xdbc9('0x25')]()[_0xdbc9('0x26')](function(){_0x6b788[_0xdbc9('0x1a')](0xcc)[_0xdbc9('0x1b')]();});}};}function handleEntityNotFound(_0x3c8c1d,_0x4a868b){return function(_0x550bef){if(!_0x550bef){_0x3c8c1d[_0xdbc9('0x19')](0x194);}return _0x550bef;};}function handleError(_0x446ab9,_0x1053ca){_0x1053ca=_0x1053ca||0x1f4;return function(_0x24fdec){logger['error'](_0x24fdec[_0xdbc9('0x27')]);if(_0x24fdec[_0xdbc9('0x28')]){delete _0x24fdec['name'];}_0x446ab9['status'](_0x1053ca)[_0xdbc9('0x29')](_0x24fdec);};}exports[_0xdbc9('0x2a')]=function(_0x473430,_0x59bfd2){var _0x13a432={},_0x539e57={},_0x561f8e={'count':0x0,'rows':[]};var _0x210a40=_['map'](db['WhatsappQueueReport'][_0xdbc9('0x2b')],function(_0x20eb4f){return{'name':_0x20eb4f[_0xdbc9('0x2c')],'type':_0x20eb4f['type'][_0xdbc9('0x2d')]};});_0x539e57[_0xdbc9('0x2e')]=_['map'](_0x210a40,'name');_0x539e57[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x473430[_0xdbc9('0x2f')]);_0x539e57[_0xdbc9('0x31')]=_[_0xdbc9('0x32')](_0x539e57[_0xdbc9('0x2e')],_0x539e57[_0xdbc9('0x2f')]);_0x13a432['attributes']=_[_0xdbc9('0x32')](_0x539e57[_0xdbc9('0x2e')],qs[_0xdbc9('0x33')](_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x33')]));_0x13a432[_0xdbc9('0x34')]=_0x13a432['attributes'][_0xdbc9('0x35')]?_0x13a432['attributes']:_0x539e57['model'];if(!_0x473430['query']['hasOwnProperty']('nolimit')){_0x13a432[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x473430[_0xdbc9('0x2f')]['limit']);_0x13a432[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x20')]);}_0x13a432[_0xdbc9('0x36')]=qs[_0xdbc9('0x37')](_0x473430['query'][_0xdbc9('0x37')]);_0x13a432[_0xdbc9('0x38')]=qs[_0xdbc9('0x31')](_['pick'](_0x473430[_0xdbc9('0x2f')],_0x539e57[_0xdbc9('0x31')]),_0x210a40);if(_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x39')]){_0x13a432['where']=_['merge'](_0x13a432[_0xdbc9('0x38')],{'$or':_[_0xdbc9('0x3a')](_0x210a40,function(_0x136392){if(_0x136392[_0xdbc9('0x3b')]!=='VIRTUAL'){var _0x1b651f={};_0x1b651f[_0x136392[_0xdbc9('0x28')]]={'$like':'%'+_0x473430[_0xdbc9('0x2f')]['filter']+'%'};return _0x1b651f;}})});}_0x13a432=_[_0xdbc9('0x3c')]({},_0x13a432,_0x473430[_0xdbc9('0x3d')]);var _0x444219={'where':_0x13a432['where']};return db[_0xdbc9('0x3e')][_0xdbc9('0x1f')](_0x444219)['then'](function(_0x5173c2){_0x561f8e[_0xdbc9('0x1f')]=_0x5173c2;if(_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x3f')]){_0x13a432[_0xdbc9('0x40')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xdbc9('0x41')](_0x13a432);})[_0xdbc9('0x26')](function(_0x577725){_0x561f8e[_0xdbc9('0x42')]=_0x577725;return _0x561f8e;})[_0xdbc9('0x26')](respondWithFilteredResult(_0x59bfd2,_0x13a432))['catch'](handleError(_0x59bfd2,null));};exports[_0xdbc9('0x43')]=function(_0x72dee3,_0x2adb23){var _0x3415c3={'raw':!![],'where':{'id':_0x72dee3[_0xdbc9('0x44')]['id']}},_0x3ed4de={};_0x3ed4de[_0xdbc9('0x2e')]=_['keys'](db['WhatsappQueueReport'][_0xdbc9('0x2b')]);_0x3ed4de[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x72dee3[_0xdbc9('0x2f')]);_0x3ed4de[_0xdbc9('0x31')]=_[_0xdbc9('0x32')](_0x3ed4de[_0xdbc9('0x2e')],_0x3ed4de[_0xdbc9('0x2f')]);_0x3415c3[_0xdbc9('0x34')]=_[_0xdbc9('0x32')](_0x3ed4de[_0xdbc9('0x2e')],qs['fields'](_0x72dee3['query'][_0xdbc9('0x33')]));_0x3415c3[_0xdbc9('0x34')]=_0x3415c3[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x3415c3[_0xdbc9('0x34')]:_0x3ed4de[_0xdbc9('0x2e')];if(_0x72dee3[_0xdbc9('0x2f')][_0xdbc9('0x3f')]){_0x3415c3['include']=[{'all':!![]}];}_0x3415c3=_['merge']({},_0x3415c3,_0x72dee3[_0xdbc9('0x3d')]);return db[_0xdbc9('0x3e')][_0xdbc9('0x45')](_0x3415c3)[_0xdbc9('0x26')](handleEntityNotFound(_0x2adb23,null))[_0xdbc9('0x26')](respondWithResult(_0x2adb23,null))[_0xdbc9('0x46')](handleError(_0x2adb23,null));};exports[_0xdbc9('0x47')]=function(_0x2ea096,_0x43e3ec){return db['WhatsappQueueReport'][_0xdbc9('0x47')](_0x2ea096[_0xdbc9('0x48')],{})['then'](respondWithResult(_0x43e3ec,0xc9))['catch'](handleError(_0x43e3ec,null));};exports[_0xdbc9('0x24')]=function(_0xc3db3c,_0x133a13){if(_0xc3db3c['body']['id']){delete _0xc3db3c[_0xdbc9('0x48')]['id'];}return db[_0xdbc9('0x3e')][_0xdbc9('0x45')]({'where':{'id':_0xc3db3c[_0xdbc9('0x44')]['id']}})['then'](handleEntityNotFound(_0x133a13,null))[_0xdbc9('0x26')](saveUpdates(_0xc3db3c[_0xdbc9('0x48')],null))[_0xdbc9('0x26')](respondWithResult(_0x133a13,null))[_0xdbc9('0x46')](handleError(_0x133a13,null));};exports['destroy']=function(_0x3e89f5,_0x36c70e){return db[_0xdbc9('0x3e')][_0xdbc9('0x45')]({'where':{'id':_0x3e89f5[_0xdbc9('0x44')]['id']}})[_0xdbc9('0x26')](handleEntityNotFound(_0x36c70e,null))[_0xdbc9('0x26')](removeEntity(_0x36c70e,null))[_0xdbc9('0x46')](handleError(_0x36c70e,null));};exports['describe']=function(_0x1c6e6e,_0x4d09e1){return db[_0xdbc9('0x3e')][_0xdbc9('0x49')]()['then'](respondWithResult(_0x4d09e1,null))['catch'](handleError(_0x4d09e1,null));}; \ No newline at end of file +var _0x065e=['limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','describe','eml-format','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x065e,0x1a7));var _0xe065=function(_0x1c3c3c,_0x3ddb08){_0x1c3c3c=_0x1c3c3c-0x0;var _0x10f940=_0x065e[_0x1c3c3c];return _0x10f940;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];function respondWithStatusCode(_0x13b697,_0xf5ab44){_0xf5ab44=_0xf5ab44||0xcc;return function(_0x5bd30f){if(_0x5bd30f){return _0x13b697[_0xe065('0x16')](_0xf5ab44);}return _0x13b697[_0xe065('0x17')](_0xf5ab44)[_0xe065('0x18')]();};}function respondWithResult(_0x2e9480,_0x29297b){_0x29297b=_0x29297b||0xc8;return function(_0x541985){if(_0x541985){return _0x2e9480[_0xe065('0x17')](_0x29297b)[_0xe065('0x19')](_0x541985);}};}function respondWithFilteredResult(_0x15d365,_0xc5ef4f){return function(_0x434e07){if(_0x434e07){var _0x352206=typeof _0xc5ef4f[_0xe065('0x1a')]==='undefined'&&typeof _0xc5ef4f[_0xe065('0x1b')]===_0xe065('0x1c');var _0x54d260=_0x434e07[_0xe065('0x1d')];var _0x1d2f7a=_0x352206?0x0:_0xc5ef4f[_0xe065('0x1a')];var _0x14c97c=_0x352206?_0x434e07[_0xe065('0x1d')]:_0xc5ef4f[_0xe065('0x1a')]+_0xc5ef4f[_0xe065('0x1b')];var _0x5000e1;if(_0x14c97c>=_0x54d260){_0x14c97c=_0x54d260;_0x5000e1=0xc8;}else{_0x5000e1=0xce;}_0x15d365[_0xe065('0x17')](_0x5000e1);return _0x15d365['set'](_0xe065('0x1e'),_0x1d2f7a+'-'+_0x14c97c+'/'+_0x54d260)[_0xe065('0x19')](_0x434e07);}return null;};}function patchUpdates(_0x55f55c){return function(_0x1c6567){try{jsonpatch['apply'](_0x1c6567,_0x55f55c,!![]);}catch(_0xe26e9b){return BPromise[_0xe065('0x1f')](_0xe26e9b);}return _0x1c6567[_0xe065('0x20')]();};}function saveUpdates(_0x110556,_0x3ecd13){return function(_0x105cb2){if(_0x105cb2){return _0x105cb2[_0xe065('0x21')](_0x110556)[_0xe065('0x22')](function(_0x1c5dd9){return _0x1c5dd9;});}return null;};}function removeEntity(_0x5081a3,_0x7208af){return function(_0x43b712){if(_0x43b712){return _0x43b712[_0xe065('0x23')]()[_0xe065('0x22')](function(){_0x5081a3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x164965,_0x530dc0){return function(_0x14e6b6){if(!_0x14e6b6){_0x164965[_0xe065('0x16')](0x194);}return _0x14e6b6;};}function handleError(_0x430ab9,_0x15b598){_0x15b598=_0x15b598||0x1f4;return function(_0x418731){logger[_0xe065('0x24')](_0x418731[_0xe065('0x25')]);if(_0x418731[_0xe065('0x26')]){delete _0x418731['name'];}_0x430ab9['status'](_0x15b598)[_0xe065('0x27')](_0x418731);};}exports[_0xe065('0x28')]=function(_0x23aee9,_0x441e96){var _0x5b1220={},_0x23f573={},_0x55ecaa={'count':0x0,'rows':[]};var _0x522420=_[_0xe065('0x29')](db[_0xe065('0x2a')][_0xe065('0x2b')],function(_0x5b8523){return{'name':_0x5b8523[_0xe065('0x2c')],'type':_0x5b8523['type'][_0xe065('0x2d')]};});_0x23f573[_0xe065('0x2e')]=_[_0xe065('0x29')](_0x522420,_0xe065('0x26'));_0x23f573['query']=_[_0xe065('0x2f')](_0x23aee9['query']);_0x23f573[_0xe065('0x30')]=_[_0xe065('0x31')](_0x23f573['model'],_0x23f573[_0xe065('0x32')]);_0x5b1220['attributes']=_[_0xe065('0x31')](_0x23f573['model'],qs[_0xe065('0x33')](_0x23aee9[_0xe065('0x32')][_0xe065('0x33')]));_0x5b1220[_0xe065('0x34')]=_0x5b1220['attributes'][_0xe065('0x35')]?_0x5b1220[_0xe065('0x34')]:_0x23f573[_0xe065('0x2e')];if(!_0x23aee9[_0xe065('0x32')][_0xe065('0x36')](_0xe065('0x37'))){_0x5b1220['limit']=qs[_0xe065('0x1b')](_0x23aee9[_0xe065('0x32')]['limit']);_0x5b1220[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0x23aee9[_0xe065('0x32')][_0xe065('0x1a')]);}_0x5b1220[_0xe065('0x38')]=qs[_0xe065('0x39')](_0x23aee9[_0xe065('0x32')]['sort']);_0x5b1220[_0xe065('0x3a')]=qs['filters'](_[_0xe065('0x3b')](_0x23aee9[_0xe065('0x32')],_0x23f573[_0xe065('0x30')]),_0x522420);if(_0x23aee9[_0xe065('0x32')][_0xe065('0x3c')]){_0x5b1220[_0xe065('0x3a')]=_['merge'](_0x5b1220[_0xe065('0x3a')],{'$or':_[_0xe065('0x29')](_0x522420,function(_0x351ac4){if(_0x351ac4['type']!==_0xe065('0x3d')){var _0x35e4d7={};_0x35e4d7[_0x351ac4[_0xe065('0x26')]]={'$like':'%'+_0x23aee9[_0xe065('0x32')][_0xe065('0x3c')]+'%'};return _0x35e4d7;}})});}_0x5b1220=_['merge']({},_0x5b1220,_0x23aee9[_0xe065('0x3e')]);var _0x23033c={'where':_0x5b1220['where']};return db[_0xe065('0x2a')]['count'](_0x23033c)[_0xe065('0x22')](function(_0x1493a9){_0x55ecaa['count']=_0x1493a9;if(_0x23aee9[_0xe065('0x32')][_0xe065('0x3f')]){_0x5b1220['include']=[{'all':!![]}];}return db[_0xe065('0x2a')][_0xe065('0x40')](_0x5b1220);})[_0xe065('0x22')](function(_0x44a3f6){_0x55ecaa[_0xe065('0x41')]=_0x44a3f6;return _0x55ecaa;})[_0xe065('0x22')](respondWithFilteredResult(_0x441e96,_0x5b1220))[_0xe065('0x42')](handleError(_0x441e96,null));};exports[_0xe065('0x43')]=function(_0x3068f0,_0x445738){var _0x326493={'raw':!![],'where':{'id':_0x3068f0[_0xe065('0x44')]['id']}},_0x4364c3={};_0x4364c3['model']=_['keys'](db[_0xe065('0x2a')][_0xe065('0x2b')]);_0x4364c3['query']=_[_0xe065('0x2f')](_0x3068f0[_0xe065('0x32')]);_0x4364c3[_0xe065('0x30')]=_[_0xe065('0x31')](_0x4364c3[_0xe065('0x2e')],_0x4364c3[_0xe065('0x32')]);_0x326493[_0xe065('0x34')]=_[_0xe065('0x31')](_0x4364c3[_0xe065('0x2e')],qs['fields'](_0x3068f0[_0xe065('0x32')][_0xe065('0x33')]));_0x326493[_0xe065('0x34')]=_0x326493['attributes'][_0xe065('0x35')]?_0x326493[_0xe065('0x34')]:_0x4364c3[_0xe065('0x2e')];if(_0x3068f0[_0xe065('0x32')]['includeAll']){_0x326493[_0xe065('0x45')]=[{'all':!![]}];}_0x326493=_[_0xe065('0x46')]({},_0x326493,_0x3068f0[_0xe065('0x3e')]);return db[_0xe065('0x2a')][_0xe065('0x47')](_0x326493)[_0xe065('0x22')](handleEntityNotFound(_0x445738,null))[_0xe065('0x22')](respondWithResult(_0x445738,null))['catch'](handleError(_0x445738,null));};exports[_0xe065('0x48')]=function(_0x810f30,_0x335744){return db[_0xe065('0x2a')][_0xe065('0x48')](_0x810f30[_0xe065('0x49')],{})[_0xe065('0x22')](respondWithResult(_0x335744,0xc9))['catch'](handleError(_0x335744,null));};exports[_0xe065('0x21')]=function(_0x5a2360,_0x45fe1f){if(_0x5a2360[_0xe065('0x49')]['id']){delete _0x5a2360[_0xe065('0x49')]['id'];}return db['WhatsappQueueReport'][_0xe065('0x47')]({'where':{'id':_0x5a2360[_0xe065('0x44')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x45fe1f,null))[_0xe065('0x22')](saveUpdates(_0x5a2360[_0xe065('0x49')],null))[_0xe065('0x22')](respondWithResult(_0x45fe1f,null))[_0xe065('0x42')](handleError(_0x45fe1f,null));};exports[_0xe065('0x23')]=function(_0x3095c8,_0x2ca55a){return db[_0xe065('0x2a')][_0xe065('0x47')]({'where':{'id':_0x3095c8[_0xe065('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ca55a,null))['then'](removeEntity(_0x2ca55a,null))['catch'](handleError(_0x2ca55a,null));};exports[_0xe065('0x4a')]=function(_0x48ed8e,_0x105bf7){return db[_0xe065('0x2a')][_0xe065('0x4a')]()['then'](respondWithResult(_0x105bf7,null))[_0xe065('0x42')](handleError(_0x105bf7,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 9c900d3..987ab21 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 _0x3556=['bluebird','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x2c02e4,_0x5ca6a5){var _0x523976=function(_0x5e6fc1){while(--_0x5e6fc1){_0x2c02e4['push'](_0x2c02e4['shift']());}};_0x523976(++_0x5ca6a5);}(_0x3556,0x1b8));var _0x6355=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x3556[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x6355('0x0'));var util=require('util');var logger=require(_0x6355('0x1'))(_0x6355('0x2'));var moment=require(_0x6355('0x3'));var BPromise=require(_0x6355('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6355('0x5'));var rimraf=require('rimraf');var config=require(_0x6355('0x6'));var attributes=require(_0x6355('0x7'));module[_0x6355('0x8')]=function(_0x20709f,_0x44fd57){return _0x20709f[_0x6355('0x9')](_0x6355('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x6355('0xb'),'fields':[_0x6355('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b34=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x4b34,0x193));var _0x44b3=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x4b34[_0x599f41];return _0x2e4d58;};'use strict';var _=require('lodash');var util=require(_0x44b3('0x0'));var logger=require(_0x44b3('0x1'))(_0x44b3('0x2'));var moment=require(_0x44b3('0x3'));var BPromise=require(_0x44b3('0x4'));var rp=require(_0x44b3('0x5'));var fs=require('fs');var path=require(_0x44b3('0x6'));var rimraf=require('rimraf');var config=require(_0x44b3('0x7'));var attributes=require(_0x44b3('0x8'));module[_0x44b3('0x9')]=function(_0x571b57,_0x23fe6e){return _0x571b57[_0x44b3('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0x44b3('0xb'),'paranoid':![],'indexes':[{'name':_0x44b3('0xc'),'fields':[_0x44b3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index c392e00..7109e23 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 _0xf123=['WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','where','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2e19ac,_0x5ee48a){var _0x29d578=function(_0x436f90){while(--_0x436f90){_0x2e19ac['push'](_0x2e19ac['shift']());}};_0x29d578(++_0x5ee48a);}(_0xf123,0x134));var _0x3f12=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0xf123[_0x273f77];return _0x71e147;};'use strict';var _=require('lodash');var util=require(_0x3f12('0x0'));var moment=require('moment');var BPromise=require(_0x3f12('0x1'));var rs=require(_0x3f12('0x2'));var fs=require('fs');var Redis=require(_0x3f12('0x3'));var db=require(_0x3f12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f12('0x5'))(_0x3f12('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f12('0x7'));var client=jayson[_0x3f12('0x8')][_0x3f12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x589443,_0x102c59,_0x4952b3){return new BPromise(function(_0x405186,_0x456ea3){return client[_0x3f12('0xa')](_0x589443,_0x4952b3)[_0x3f12('0xb')](function(_0xacff21){logger[_0x3f12('0xc')](_0x3f12('0xd'),_0x102c59,_0x3f12('0xe'));logger[_0x3f12('0xf')](_0x3f12('0x10'),_0x102c59,'request\x20sent',JSON[_0x3f12('0x11')](_0xacff21));if(_0xacff21[_0x3f12('0x12')]){if(_0xacff21['error'][_0x3f12('0x13')]===0x1f4){logger[_0x3f12('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x102c59,_0xacff21[_0x3f12('0x12')][_0x3f12('0x14')]);return _0x456ea3(_0xacff21['error']['message']);}logger[_0x3f12('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x102c59,_0xacff21['error'][_0x3f12('0x14')]);return _0x405186(_0xacff21[_0x3f12('0x12')]['message']);}else{logger[_0x3f12('0xc')](_0x3f12('0xd'),_0x102c59,'request\x20sent');_0x405186(_0xacff21['result'][_0x3f12('0x14')]);}})[_0x3f12('0x15')](function(_0x185f4b){logger[_0x3f12('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x102c59,_0x185f4b);_0x456ea3(_0x185f4b);});});}exports['CreateWhatsappQueueReport']=function(_0x313188){var _0x50d455=this;return new Promise(function(_0x361c57,_0x5eff18){return db[_0x3f12('0x16')]['create'](_0x313188[_0x3f12('0x17')],{'raw':_0x313188['options']?_0x313188[_0x3f12('0x18')][_0x3f12('0x19')]===undefined?!![]:![]:!![]})[_0x3f12('0xb')](function(_0xd9f2c3){logger[_0x3f12('0xc')](_0x3f12('0x1a'),_0x313188);logger[_0x3f12('0xf')](_0x3f12('0x1a'),_0x313188,JSON[_0x3f12('0x11')](_0xd9f2c3));_0x361c57(_0xd9f2c3);})[_0x3f12('0x15')](function(_0x1e53ae){logger[_0x3f12('0x12')](_0x3f12('0x1a'),_0x1e53ae[_0x3f12('0x14')],_0x313188);_0x5eff18(_0x50d455[_0x3f12('0x12')](0x1f4,_0x1e53ae[_0x3f12('0x14')]));});});};exports[_0x3f12('0x1b')]=function(_0xe22349){var _0x93cf07=this;return new Promise(function(_0x521935,_0x48df32){return db[_0x3f12('0x16')]['update'](_0xe22349['body'],{'raw':_0xe22349[_0x3f12('0x18')]?_0xe22349[_0x3f12('0x18')][_0x3f12('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe22349['options']?_0xe22349[_0x3f12('0x18')][_0x3f12('0x1c')]||null:null,'attributes':_0xe22349['options']?_0xe22349['options'][_0x3f12('0x1d')]||null:null,'limit':_0xe22349[_0x3f12('0x18')]?_0xe22349[_0x3f12('0x18')]['limit']||null:null})['then'](function(_0x1fee42){logger[_0x3f12('0xc')]('UpdateWhatsappQueueReport',_0xe22349);logger['debug'](_0x3f12('0x1b'),_0xe22349,JSON[_0x3f12('0x11')](_0x1fee42));_0x521935(_0x1fee42);})['catch'](function(_0x51cf33){logger[_0x3f12('0x12')](_0x3f12('0x1b'),_0x51cf33[_0x3f12('0x14')],_0xe22349);_0x48df32(_0x93cf07['error'](0x1f4,_0x51cf33[_0x3f12('0x14')]));});});}; \ No newline at end of file +var _0xb6de=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','message','WhatsappQueueReport,\x20%s,\x20%s','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','debug','catch','update','raw','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xb6de,0x16e));var _0xeb6d=function(_0x2373c2,_0x4a0498){_0x2373c2=_0x2373c2-0x0;var _0x1de046=_0xb6de[_0x2373c2];return _0x1de046;};'use strict';var _=require(_0xeb6d('0x0'));var util=require('util');var moment=require(_0xeb6d('0x1'));var BPromise=require(_0xeb6d('0x2'));var rs=require(_0xeb6d('0x3'));var fs=require('fs');var Redis=require(_0xeb6d('0x4'));var db=require(_0xeb6d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb6d('0x6'))(_0xeb6d('0x7'));var config=require(_0xeb6d('0x8'));var jayson=require(_0xeb6d('0x9'));var client=jayson[_0xeb6d('0xa')][_0xeb6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1087bc,_0x4a9670,_0x32f1ec){return new BPromise(function(_0x166c27,_0x9427b2){return client[_0xeb6d('0xc')](_0x1087bc,_0x32f1ec)[_0xeb6d('0xd')](function(_0x59f690){logger[_0xeb6d('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4a9670,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x4a9670,_0xeb6d('0xf'),JSON[_0xeb6d('0x10')](_0x59f690));if(_0x59f690[_0xeb6d('0x11')]){if(_0x59f690[_0xeb6d('0x11')]['code']===0x1f4){logger[_0xeb6d('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4a9670,_0x59f690[_0xeb6d('0x11')][_0xeb6d('0x12')]);return _0x9427b2(_0x59f690[_0xeb6d('0x11')][_0xeb6d('0x12')]);}logger[_0xeb6d('0x11')](_0xeb6d('0x13'),_0x4a9670,_0x59f690['error']['message']);return _0x166c27(_0x59f690[_0xeb6d('0x11')][_0xeb6d('0x12')]);}else{logger[_0xeb6d('0xe')](_0xeb6d('0x13'),_0x4a9670,_0xeb6d('0xf'));_0x166c27(_0x59f690[_0xeb6d('0x14')]['message']);}})['catch'](function(_0x2ceca0){logger[_0xeb6d('0x11')](_0xeb6d('0x13'),_0x4a9670,_0x2ceca0);_0x9427b2(_0x2ceca0);});});}exports[_0xeb6d('0x15')]=function(_0x503d4c){var _0x3e4796=this;return new Promise(function(_0x1a7e4f,_0x43d051){return db[_0xeb6d('0x16')][_0xeb6d('0x17')](_0x503d4c[_0xeb6d('0x18')],{'raw':_0x503d4c['options']?_0x503d4c[_0xeb6d('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x22f0db){logger[_0xeb6d('0xe')](_0xeb6d('0x15'),_0x503d4c);logger[_0xeb6d('0x1a')](_0xeb6d('0x15'),_0x503d4c,JSON[_0xeb6d('0x10')](_0x22f0db));_0x1a7e4f(_0x22f0db);})[_0xeb6d('0x1b')](function(_0xe02c85){logger[_0xeb6d('0x11')](_0xeb6d('0x15'),_0xe02c85[_0xeb6d('0x12')],_0x503d4c);_0x43d051(_0x3e4796[_0xeb6d('0x11')](0x1f4,_0xe02c85[_0xeb6d('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x42e57c){var _0x1a25d0=this;return new Promise(function(_0x554f83,_0x7bcf2b){return db[_0xeb6d('0x16')][_0xeb6d('0x1c')](_0x42e57c[_0xeb6d('0x18')],{'raw':_0x42e57c[_0xeb6d('0x19')]?_0x42e57c[_0xeb6d('0x19')][_0xeb6d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42e57c[_0xeb6d('0x19')]?_0x42e57c[_0xeb6d('0x19')][_0xeb6d('0x1e')]||null:null,'attributes':_0x42e57c[_0xeb6d('0x19')]?_0x42e57c['options'][_0xeb6d('0x1f')]||null:null,'limit':_0x42e57c[_0xeb6d('0x19')]?_0x42e57c[_0xeb6d('0x19')][_0xeb6d('0x20')]||null:null})[_0xeb6d('0xd')](function(_0x3c1d57){logger[_0xeb6d('0xe')]('UpdateWhatsappQueueReport',_0x42e57c);logger[_0xeb6d('0x1a')](_0xeb6d('0x21'),_0x42e57c,JSON[_0xeb6d('0x10')](_0x3c1d57));_0x554f83(_0x3c1d57);})['catch'](function(_0x14dcd1){logger[_0xeb6d('0x11')]('UpdateWhatsappQueueReport',_0x14dcd1[_0xeb6d('0x12')],_0x42e57c);_0x7bcf2b(_0x1a25d0[_0xeb6d('0x11')](0x1f4,_0x14dcd1[_0xeb6d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 3b48927..c7abb89 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 _0xd766=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','update','delete','destroy','util'];(function(_0x3427cf,_0x5da0a1){var _0x51733c=function(_0x4495ed){while(--_0x4495ed){_0x3427cf['push'](_0x3427cf['shift']());}};_0x51733c(++_0x5da0a1);}(_0xd766,0x84));var _0x6d76=function(_0x44caf2,_0x8ffb16){_0x44caf2=_0x44caf2-0x0;var _0x25978d=_0xd766[_0x44caf2];return _0x25978d;};'use strict';var multer=require('multer');var util=require(_0x6d76('0x0'));var path=require(_0x6d76('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d76('0x2'));var router=express[_0x6d76('0x3')]();var fs_extra=require(_0x6d76('0x4'));var auth=require(_0x6d76('0x5'));var interaction=require(_0x6d76('0x6'));var config=require('../../config/environment');var controller=require(_0x6d76('0x7'));router[_0x6d76('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d76('0x9')]);router[_0x6d76('0x8')](_0x6d76('0xa'),auth[_0x6d76('0xb')](),controller[_0x6d76('0xc')]);router[_0x6d76('0x8')](_0x6d76('0xd'),auth[_0x6d76('0xb')](),controller[_0x6d76('0xe')]);router['post']('/',auth[_0x6d76('0xb')](),controller[_0x6d76('0xf')]);router['put']('/:id',auth[_0x6d76('0xb')](),controller[_0x6d76('0x10')]);router[_0x6d76('0x11')](_0x6d76('0xd'),auth[_0x6d76('0xb')](),controller[_0x6d76('0x12')]);module['exports']=router; \ No newline at end of file +var _0x996b=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','/describe','isAuthenticated','describe','show','post'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x996b,0x8a));var _0xb996=function(_0x24fcb5,_0x2cadbf){_0x24fcb5=_0x24fcb5-0x0;var _0x1a1c58=_0x996b[_0x24fcb5];return _0x1a1c58;};'use strict';var multer=require(_0xb996('0x0'));var util=require(_0xb996('0x1'));var path=require(_0xb996('0x2'));var timeout=require(_0xb996('0x3'));var express=require(_0xb996('0x4'));var router=express[_0xb996('0x5')]();var fs_extra=require(_0xb996('0x6'));var auth=require(_0xb996('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb996('0x8'));var controller=require(_0xb996('0x9'));router[_0xb996('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb996('0xa')](_0xb996('0xb'),auth[_0xb996('0xc')](),controller[_0xb996('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb996('0xe')]);router[_0xb996('0xf')]('/',auth[_0xb996('0xc')](),controller[_0xb996('0x10')]);router[_0xb996('0x11')]('/:id',auth[_0xb996('0xc')](),controller[_0xb996('0x12')]);router[_0xb996('0x13')]('/:id',auth[_0xb996('0xc')](),controller[_0xb996('0x14')]);module[_0xb996('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 90f25bc..3ad071f 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 _0x5a1c=['queue','DATE','sequelize','exports','account'];(function(_0x1d6f59,_0x31cd87){var _0x11884b=function(_0x4a74d6){while(--_0x4a74d6){_0x1d6f59['push'](_0x1d6f59['shift']());}};_0x11884b(++_0x31cd87);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x15d0ed,_0x5698d1){_0x15d0ed=_0x15d0ed-0x0;var _0x548e26=_0x5a1c[_0x15d0ed];return _0x548e26;};'use strict';var Sequelize=require(_0xc5a1('0x0'));module[_0xc5a1('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc5a1('0x2'),'agent',_0xc5a1('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc5a1('0x4')]}}; \ No newline at end of file +var _0x753c=['exports','ENUM','account','agent','queue','DATE'];(function(_0x53411c,_0x27f434){var _0x5955d5=function(_0x1d89fa){while(--_0x1d89fa){_0x53411c['push'](_0x53411c['shift']());}};_0x5955d5(++_0x27f434);}(_0x753c,0x96));var _0xc753=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x753c[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xc753('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc753('0x1')](_0xc753('0x2'),_0xc753('0x3'),_0xc753('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc753('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 86a075e..4e21acd 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 _0x9b50=['to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','create','catch','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x1f6711,_0x325100){var _0x34640f=function(_0x342b02){while(--_0x342b02){_0x1f6711['push'](_0x1f6711['shift']());}};_0x34640f(++_0x325100);}(_0x9b50,0x11b));var _0x09b5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9b50[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x09b5('0x0'));var rimraf=require(_0x09b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09b5('0x2'));var rp=require('request-promise');var moment=require(_0x09b5('0x3'));var BPromise=require(_0x09b5('0x4'));var Mustache=require(_0x09b5('0x5'));var util=require(_0x09b5('0x6'));var path=require(_0x09b5('0x7'));var sox=require(_0x09b5('0x8'));var csv=require(_0x09b5('0x9'));var ejs=require(_0x09b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x09b5('0xb'));var crypto=require('crypto');var jsforce=require(_0x09b5('0xc'));var deskjs=require(_0x09b5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09b5('0xe'));var Papa=require('papaparse');var Redis=require(_0x09b5('0xf'));var authService=require(_0x09b5('0x10'));var qs=require(_0x09b5('0x11'));var as=require(_0x09b5('0x12'));var hardwareService=require(_0x09b5('0x13'));var logger=require(_0x09b5('0x14'))(_0x09b5('0x15'));var utils=require(_0x09b5('0x16'));var config=require(_0x09b5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x09b5('0x18'))['db'];function respondWithStatusCode(_0x7543ac,_0x1401fd){_0x1401fd=_0x1401fd||0xcc;return function(_0x32a06e){if(_0x32a06e){return _0x7543ac[_0x09b5('0x19')](_0x1401fd);}return _0x7543ac[_0x09b5('0x1a')](_0x1401fd)[_0x09b5('0x1b')]();};}function respondWithResult(_0x30ea86,_0x586f00){_0x586f00=_0x586f00||0xc8;return function(_0x25d878){if(_0x25d878){return _0x30ea86[_0x09b5('0x1a')](_0x586f00)[_0x09b5('0x1c')](_0x25d878);}};}function respondWithFilteredResult(_0x31e1b7,_0x1ea09c){return function(_0x4c916c){if(_0x4c916c){var _0xb00b9b=typeof _0x1ea09c[_0x09b5('0x1d')]===_0x09b5('0x1e')&&typeof _0x1ea09c['limit']===_0x09b5('0x1e');var _0x2eab46=_0x4c916c[_0x09b5('0x1f')];var _0x42ef3d=_0xb00b9b?0x0:_0x1ea09c[_0x09b5('0x1d')];var _0xc03190=_0xb00b9b?_0x4c916c[_0x09b5('0x1f')]:_0x1ea09c[_0x09b5('0x1d')]+_0x1ea09c[_0x09b5('0x20')];var _0x29b1d8;if(_0xc03190>=_0x2eab46){_0xc03190=_0x2eab46;_0x29b1d8=0xc8;}else{_0x29b1d8=0xce;}_0x31e1b7['status'](_0x29b1d8);return _0x31e1b7[_0x09b5('0x21')](_0x09b5('0x22'),_0x42ef3d+'-'+_0xc03190+'/'+_0x2eab46)['json'](_0x4c916c);}return null;};}function patchUpdates(_0x4ab5a3){return function(_0xfa67b3){try{jsonpatch['apply'](_0xfa67b3,_0x4ab5a3,!![]);}catch(_0x5515af){return BPromise[_0x09b5('0x23')](_0x5515af);}return _0xfa67b3['save']();};}function saveUpdates(_0x1e1c9e,_0x2bf0cb){return function(_0x3b6b53){if(_0x3b6b53){return _0x3b6b53[_0x09b5('0x24')](_0x1e1c9e)[_0x09b5('0x25')](function(_0xcb388e){return _0xcb388e;});}return null;};}function removeEntity(_0x49db1d,_0x5945dc){return function(_0x373352){if(_0x373352){return _0x373352[_0x09b5('0x26')]()['then'](function(){_0x49db1d[_0x09b5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30475d,_0x4be1c9){return function(_0x3cf02b){if(!_0x3cf02b){_0x30475d['sendStatus'](0x194);}return _0x3cf02b;};}function handleError(_0x4265b3,_0x23ddcc){_0x23ddcc=_0x23ddcc||0x1f4;return function(_0x2e7d7f){logger[_0x09b5('0x27')](_0x2e7d7f[_0x09b5('0x28')]);if(_0x2e7d7f[_0x09b5('0x29')]){delete _0x2e7d7f[_0x09b5('0x29')];}_0x4265b3[_0x09b5('0x1a')](_0x23ddcc)[_0x09b5('0x2a')](_0x2e7d7f);};}exports['index']=function(_0x19deae,_0x2bedd9){var _0x5976bc={},_0x2b62a0={},_0x49b2f0={'count':0x0,'rows':[]};var _0x435102=_[_0x09b5('0x2b')](db[_0x09b5('0x2c')][_0x09b5('0x2d')],function(_0x14d4ef){return{'name':_0x14d4ef['fieldName'],'type':_0x14d4ef[_0x09b5('0x2e')]['key']};});_0x2b62a0[_0x09b5('0x2f')]=_[_0x09b5('0x2b')](_0x435102,_0x09b5('0x29'));_0x2b62a0['query']=_[_0x09b5('0x30')](_0x19deae[_0x09b5('0x31')]);_0x2b62a0[_0x09b5('0x32')]=_[_0x09b5('0x33')](_0x2b62a0[_0x09b5('0x2f')],_0x2b62a0['query']);_0x5976bc[_0x09b5('0x34')]=_[_0x09b5('0x33')](_0x2b62a0['model'],qs[_0x09b5('0x35')](_0x19deae['query'][_0x09b5('0x35')]));_0x5976bc[_0x09b5('0x34')]=_0x5976bc[_0x09b5('0x34')][_0x09b5('0x36')]?_0x5976bc[_0x09b5('0x34')]:_0x2b62a0[_0x09b5('0x2f')];if(!_0x19deae[_0x09b5('0x31')]['hasOwnProperty'](_0x09b5('0x37'))){_0x5976bc[_0x09b5('0x20')]=qs[_0x09b5('0x20')](_0x19deae[_0x09b5('0x31')]['limit']);_0x5976bc[_0x09b5('0x1d')]=qs[_0x09b5('0x1d')](_0x19deae[_0x09b5('0x31')][_0x09b5('0x1d')]);}_0x5976bc[_0x09b5('0x38')]=qs['sort'](_0x19deae[_0x09b5('0x31')][_0x09b5('0x39')]);_0x5976bc[_0x09b5('0x3a')]=qs[_0x09b5('0x32')](_[_0x09b5('0x3b')](_0x19deae[_0x09b5('0x31')],_0x2b62a0[_0x09b5('0x32')]),_0x435102);if(_0x19deae[_0x09b5('0x31')][_0x09b5('0x3c')]){_0x5976bc['where']=_['merge'](_0x5976bc[_0x09b5('0x3a')],{'$or':_[_0x09b5('0x2b')](_0x435102,function(_0x1ce799){if(_0x1ce799[_0x09b5('0x2e')]!=='VIRTUAL'){var _0x164831={};_0x164831[_0x1ce799[_0x09b5('0x29')]]={'$like':'%'+_0x19deae[_0x09b5('0x31')][_0x09b5('0x3c')]+'%'};return _0x164831;}})});}_0x5976bc=_[_0x09b5('0x3d')]({},_0x5976bc,_0x19deae[_0x09b5('0x3e')]);var _0x14a507={'where':_0x5976bc['where']};return db[_0x09b5('0x2c')]['count'](_0x14a507)[_0x09b5('0x25')](function(_0x895ace){_0x49b2f0[_0x09b5('0x1f')]=_0x895ace;if(_0x19deae[_0x09b5('0x31')][_0x09b5('0x3f')]){_0x5976bc[_0x09b5('0x40')]=[{'all':!![]}];}return db[_0x09b5('0x2c')][_0x09b5('0x41')](_0x5976bc);})['then'](function(_0x41a4b4){_0x49b2f0[_0x09b5('0x42')]=_0x41a4b4;return _0x49b2f0;})[_0x09b5('0x25')](respondWithFilteredResult(_0x2bedd9,_0x5976bc))['catch'](handleError(_0x2bedd9,null));};exports['show']=function(_0x3f957e,_0x39e246){var _0x27f4eb={'raw':!![],'where':{'id':_0x3f957e[_0x09b5('0x43')]['id']}},_0x44e1f8={};_0x44e1f8['model']=_[_0x09b5('0x30')](db[_0x09b5('0x2c')][_0x09b5('0x2d')]);_0x44e1f8[_0x09b5('0x31')]=_['keys'](_0x3f957e['query']);_0x44e1f8[_0x09b5('0x32')]=_['intersection'](_0x44e1f8[_0x09b5('0x2f')],_0x44e1f8[_0x09b5('0x31')]);_0x27f4eb[_0x09b5('0x34')]=_[_0x09b5('0x33')](_0x44e1f8[_0x09b5('0x2f')],qs[_0x09b5('0x35')](_0x3f957e[_0x09b5('0x31')]['fields']));_0x27f4eb[_0x09b5('0x34')]=_0x27f4eb[_0x09b5('0x34')]['length']?_0x27f4eb[_0x09b5('0x34')]:_0x44e1f8[_0x09b5('0x2f')];if(_0x3f957e[_0x09b5('0x31')][_0x09b5('0x3f')]){_0x27f4eb[_0x09b5('0x40')]=[{'all':!![]}];}_0x27f4eb=_['merge']({},_0x27f4eb,_0x3f957e[_0x09b5('0x3e')]);return db[_0x09b5('0x2c')]['find'](_0x27f4eb)[_0x09b5('0x25')](handleEntityNotFound(_0x39e246,null))[_0x09b5('0x25')](respondWithResult(_0x39e246,null))['catch'](handleError(_0x39e246,null));};exports['create']=function(_0x9eb338,_0x2bde24){return db[_0x09b5('0x2c')][_0x09b5('0x44')](_0x9eb338['body'],{})[_0x09b5('0x25')](respondWithResult(_0x2bde24,0xc9))[_0x09b5('0x45')](handleError(_0x2bde24,null));};exports['update']=function(_0x341192,_0xb89f24){if(_0x341192[_0x09b5('0x46')]['id']){delete _0x341192[_0x09b5('0x46')]['id'];}return db[_0x09b5('0x2c')]['find']({'where':{'id':_0x341192[_0x09b5('0x43')]['id']}})[_0x09b5('0x25')](handleEntityNotFound(_0xb89f24,null))[_0x09b5('0x25')](saveUpdates(_0x341192['body'],null))[_0x09b5('0x25')](respondWithResult(_0xb89f24,null))[_0x09b5('0x45')](handleError(_0xb89f24,null));};exports[_0x09b5('0x26')]=function(_0x5832a6,_0x2ad693){return db[_0x09b5('0x2c')][_0x09b5('0x47')]({'where':{'id':_0x5832a6[_0x09b5('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ad693,null))[_0x09b5('0x25')](removeEntity(_0x2ad693,null))[_0x09b5('0x45')](handleError(_0x2ad693,null));};exports[_0x09b5('0x48')]=function(_0xb73dda,_0x2b428a){return db[_0x09b5('0x2c')]['describe']()[_0x09b5('0x25')](respondWithResult(_0x2b428a,null))[_0x09b5('0x45')](handleError(_0x2b428a,null));}; \ No newline at end of file +var _0xbb35=['rows','catch','length','includeAll','options','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x3f26b0,_0x2cb60b){_0x3f26b0=_0x3f26b0-0x0;var _0x54f361=_0xbb35[_0x3f26b0];return _0x54f361;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5bb3('0x0'));var zipdir=require(_0x5bb3('0x1'));var jsonpatch=require(_0x5bb3('0x2'));var rp=require(_0x5bb3('0x3'));var moment=require(_0x5bb3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5bb3('0x5'));var util=require(_0x5bb3('0x6'));var path=require(_0x5bb3('0x7'));var sox=require(_0x5bb3('0x8'));var csv=require(_0x5bb3('0x9'));var ejs=require(_0x5bb3('0xa'));var fs=require('fs');var fs_extra=require(_0x5bb3('0xb'));var _=require(_0x5bb3('0xc'));var squel=require(_0x5bb3('0xd'));var crypto=require('crypto');var jsforce=require(_0x5bb3('0xe'));var deskjs=require(_0x5bb3('0xf'));var toCsv=require(_0x5bb3('0x9'));var querystring=require(_0x5bb3('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bb3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bb3('0x13'));var logger=require(_0x5bb3('0x14'))(_0x5bb3('0x15'));var utils=require(_0x5bb3('0x16'));var config=require(_0x5bb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bb3('0x18'))['db'];function respondWithStatusCode(_0xdf7055,_0x159793){_0x159793=_0x159793||0xcc;return function(_0x5a1040){if(_0x5a1040){return _0xdf7055[_0x5bb3('0x19')](_0x159793);}return _0xdf7055[_0x5bb3('0x1a')](_0x159793)[_0x5bb3('0x1b')]();};}function respondWithResult(_0xf09aa,_0x7c066c){_0x7c066c=_0x7c066c||0xc8;return function(_0x2835b1){if(_0x2835b1){return _0xf09aa[_0x5bb3('0x1a')](_0x7c066c)[_0x5bb3('0x1c')](_0x2835b1);}};}function respondWithFilteredResult(_0x569002,_0x4f44a5){return function(_0x4aec89){if(_0x4aec89){var _0x3722f3=typeof _0x4f44a5[_0x5bb3('0x1d')]===_0x5bb3('0x1e')&&typeof _0x4f44a5[_0x5bb3('0x1f')]===_0x5bb3('0x1e');var _0x24bd58=_0x4aec89[_0x5bb3('0x20')];var _0xbbaf0=_0x3722f3?0x0:_0x4f44a5[_0x5bb3('0x1d')];var _0xab7e49=_0x3722f3?_0x4aec89['count']:_0x4f44a5['offset']+_0x4f44a5[_0x5bb3('0x1f')];var _0x41c9a5;if(_0xab7e49>=_0x24bd58){_0xab7e49=_0x24bd58;_0x41c9a5=0xc8;}else{_0x41c9a5=0xce;}_0x569002[_0x5bb3('0x1a')](_0x41c9a5);return _0x569002[_0x5bb3('0x21')](_0x5bb3('0x22'),_0xbbaf0+'-'+_0xab7e49+'/'+_0x24bd58)[_0x5bb3('0x1c')](_0x4aec89);}return null;};}function patchUpdates(_0x2630b4){return function(_0x52bb14){try{jsonpatch[_0x5bb3('0x23')](_0x52bb14,_0x2630b4,!![]);}catch(_0x3b1325){return BPromise[_0x5bb3('0x24')](_0x3b1325);}return _0x52bb14['save']();};}function saveUpdates(_0x30c982,_0x4e2770){return function(_0xa16d6e){if(_0xa16d6e){return _0xa16d6e['update'](_0x30c982)[_0x5bb3('0x25')](function(_0x384f57){return _0x384f57;});}return null;};}function removeEntity(_0x36ca41,_0x37ce7e){return function(_0x2f9ca3){if(_0x2f9ca3){return _0x2f9ca3[_0x5bb3('0x26')]()[_0x5bb3('0x25')](function(){_0x36ca41['status'](0xcc)[_0x5bb3('0x1b')]();});}};}function handleEntityNotFound(_0x41e28f,_0x4c4a7a){return function(_0x439ee4){if(!_0x439ee4){_0x41e28f[_0x5bb3('0x19')](0x194);}return _0x439ee4;};}function handleError(_0x333f5e,_0x36d35c){_0x36d35c=_0x36d35c||0x1f4;return function(_0x21da73){logger[_0x5bb3('0x27')](_0x21da73[_0x5bb3('0x28')]);if(_0x21da73[_0x5bb3('0x29')]){delete _0x21da73['name'];}_0x333f5e['status'](_0x36d35c)[_0x5bb3('0x2a')](_0x21da73);};}exports['index']=function(_0x182516,_0x4ce15a){var _0x831fd4={},_0xbdc0b5={},_0x104efe={'count':0x0,'rows':[]};var _0x55beda=_[_0x5bb3('0x2b')](db[_0x5bb3('0x2c')][_0x5bb3('0x2d')],function(_0x2cd20c){return{'name':_0x2cd20c['fieldName'],'type':_0x2cd20c['type'][_0x5bb3('0x2e')]};});_0xbdc0b5['model']=_[_0x5bb3('0x2b')](_0x55beda,_0x5bb3('0x29'));_0xbdc0b5['query']=_[_0x5bb3('0x2f')](_0x182516[_0x5bb3('0x30')]);_0xbdc0b5[_0x5bb3('0x31')]=_[_0x5bb3('0x32')](_0xbdc0b5[_0x5bb3('0x33')],_0xbdc0b5[_0x5bb3('0x30')]);_0x831fd4[_0x5bb3('0x34')]=_['intersection'](_0xbdc0b5[_0x5bb3('0x33')],qs['fields'](_0x182516[_0x5bb3('0x30')][_0x5bb3('0x35')]));_0x831fd4[_0x5bb3('0x34')]=_0x831fd4[_0x5bb3('0x34')]['length']?_0x831fd4['attributes']:_0xbdc0b5[_0x5bb3('0x33')];if(!_0x182516[_0x5bb3('0x30')][_0x5bb3('0x36')](_0x5bb3('0x37'))){_0x831fd4[_0x5bb3('0x1f')]=qs[_0x5bb3('0x1f')](_0x182516['query'][_0x5bb3('0x1f')]);_0x831fd4[_0x5bb3('0x1d')]=qs[_0x5bb3('0x1d')](_0x182516[_0x5bb3('0x30')][_0x5bb3('0x1d')]);}_0x831fd4['order']=qs[_0x5bb3('0x38')](_0x182516[_0x5bb3('0x30')][_0x5bb3('0x38')]);_0x831fd4[_0x5bb3('0x39')]=qs[_0x5bb3('0x31')](_[_0x5bb3('0x3a')](_0x182516[_0x5bb3('0x30')],_0xbdc0b5[_0x5bb3('0x31')]),_0x55beda);if(_0x182516[_0x5bb3('0x30')][_0x5bb3('0x3b')]){_0x831fd4['where']=_[_0x5bb3('0x3c')](_0x831fd4[_0x5bb3('0x39')],{'$or':_[_0x5bb3('0x2b')](_0x55beda,function(_0x460d85){if(_0x460d85[_0x5bb3('0x3d')]!==_0x5bb3('0x3e')){var _0xd9ef42={};_0xd9ef42[_0x460d85[_0x5bb3('0x29')]]={'$like':'%'+_0x182516[_0x5bb3('0x30')][_0x5bb3('0x3b')]+'%'};return _0xd9ef42;}})});}_0x831fd4=_[_0x5bb3('0x3c')]({},_0x831fd4,_0x182516['options']);var _0x3bafb6={'where':_0x831fd4[_0x5bb3('0x39')]};return db['WhatsappTransferReport'][_0x5bb3('0x20')](_0x3bafb6)[_0x5bb3('0x25')](function(_0x3c6d74){_0x104efe[_0x5bb3('0x20')]=_0x3c6d74;if(_0x182516[_0x5bb3('0x30')]['includeAll']){_0x831fd4[_0x5bb3('0x3f')]=[{'all':!![]}];}return db[_0x5bb3('0x2c')][_0x5bb3('0x40')](_0x831fd4);})[_0x5bb3('0x25')](function(_0x10bd3e){_0x104efe[_0x5bb3('0x41')]=_0x10bd3e;return _0x104efe;})['then'](respondWithFilteredResult(_0x4ce15a,_0x831fd4))[_0x5bb3('0x42')](handleError(_0x4ce15a,null));};exports['show']=function(_0x1db2c9,_0x2bef12){var _0x483bc0={'raw':!![],'where':{'id':_0x1db2c9['params']['id']}},_0x2f20c7={};_0x2f20c7[_0x5bb3('0x33')]=_[_0x5bb3('0x2f')](db[_0x5bb3('0x2c')][_0x5bb3('0x2d')]);_0x2f20c7[_0x5bb3('0x30')]=_[_0x5bb3('0x2f')](_0x1db2c9['query']);_0x2f20c7[_0x5bb3('0x31')]=_[_0x5bb3('0x32')](_0x2f20c7[_0x5bb3('0x33')],_0x2f20c7[_0x5bb3('0x30')]);_0x483bc0['attributes']=_[_0x5bb3('0x32')](_0x2f20c7[_0x5bb3('0x33')],qs[_0x5bb3('0x35')](_0x1db2c9[_0x5bb3('0x30')][_0x5bb3('0x35')]));_0x483bc0[_0x5bb3('0x34')]=_0x483bc0[_0x5bb3('0x34')][_0x5bb3('0x43')]?_0x483bc0[_0x5bb3('0x34')]:_0x2f20c7['model'];if(_0x1db2c9[_0x5bb3('0x30')][_0x5bb3('0x44')]){_0x483bc0[_0x5bb3('0x3f')]=[{'all':!![]}];}_0x483bc0=_[_0x5bb3('0x3c')]({},_0x483bc0,_0x1db2c9[_0x5bb3('0x45')]);return db[_0x5bb3('0x2c')][_0x5bb3('0x46')](_0x483bc0)[_0x5bb3('0x25')](handleEntityNotFound(_0x2bef12,null))[_0x5bb3('0x25')](respondWithResult(_0x2bef12,null))[_0x5bb3('0x42')](handleError(_0x2bef12,null));};exports[_0x5bb3('0x47')]=function(_0x41d0f2,_0x207a97){return db[_0x5bb3('0x2c')][_0x5bb3('0x47')](_0x41d0f2[_0x5bb3('0x48')],{})[_0x5bb3('0x25')](respondWithResult(_0x207a97,0xc9))[_0x5bb3('0x42')](handleError(_0x207a97,null));};exports[_0x5bb3('0x49')]=function(_0x3ad935,_0x1dfeb8){if(_0x3ad935[_0x5bb3('0x48')]['id']){delete _0x3ad935[_0x5bb3('0x48')]['id'];}return db[_0x5bb3('0x2c')][_0x5bb3('0x46')]({'where':{'id':_0x3ad935[_0x5bb3('0x4a')]['id']}})[_0x5bb3('0x25')](handleEntityNotFound(_0x1dfeb8,null))[_0x5bb3('0x25')](saveUpdates(_0x3ad935[_0x5bb3('0x48')],null))[_0x5bb3('0x25')](respondWithResult(_0x1dfeb8,null))[_0x5bb3('0x42')](handleError(_0x1dfeb8,null));};exports['destroy']=function(_0x114c35,_0x35be5e){return db['WhatsappTransferReport'][_0x5bb3('0x46')]({'where':{'id':_0x114c35[_0x5bb3('0x4a')]['id']}})[_0x5bb3('0x25')](handleEntityNotFound(_0x35be5e,null))['then'](removeEntity(_0x35be5e,null))[_0x5bb3('0x42')](handleError(_0x35be5e,null));};exports[_0x5bb3('0x4b')]=function(_0x163147,_0x44e6df){return db[_0x5bb3('0x2c')][_0x5bb3('0x4b')]()['then'](respondWithResult(_0x44e6df,null))[_0x5bb3('0x42')](handleError(_0x44e6df,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index c1ebe3a..5ea3e0b 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 _0x5c1a=['moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','api'];(function(_0x276289,_0x5acc1e){var _0xa71fc8=function(_0x44accd){while(--_0x44accd){_0x276289['push'](_0x276289['shift']());}};_0xa71fc8(++_0x5acc1e);}(_0x5c1a,0x101));var _0xa5c1=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x5c1a[_0x215dc8];return _0x583ea3;};'use strict';var _=require(_0xa5c1('0x0'));var util=require(_0xa5c1('0x1'));var logger=require('../../config/logger')(_0xa5c1('0x2'));var moment=require(_0xa5c1('0x3'));var BPromise=require(_0xa5c1('0x4'));var rp=require(_0xa5c1('0x5'));var fs=require('fs');var path=require(_0xa5c1('0x6'));var rimraf=require('rimraf');var config=require(_0xa5c1('0x7'));var attributes=require(_0xa5c1('0x8'));module[_0xa5c1('0x9')]=function(_0x492185,_0x5f1b8b){return _0x492185[_0xa5c1('0xa')]('WhatsappTransferReport',attributes,{'tableName':_0xa5c1('0xb'),'paranoid':![],'indexes':[{'name':_0xa5c1('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc0fe=['../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x34b935,_0x1b0e16){var _0x4acb3c=function(_0x111735){while(--_0x111735){_0x34b935['push'](_0x34b935['shift']());}};_0x4acb3c(++_0x1b0e16);}(_0xc0fe,0x96));var _0xec0f=function(_0x1221fd,_0x5488d7){_0x1221fd=_0x1221fd-0x0;var _0x1e5f6f=_0xc0fe[_0x1221fd];return _0x1e5f6f;};'use strict';var _=require(_0xec0f('0x0'));var util=require(_0xec0f('0x1'));var logger=require(_0xec0f('0x2'))(_0xec0f('0x3'));var moment=require('moment');var BPromise=require(_0xec0f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec0f('0x5'));var rimraf=require('rimraf');var config=require(_0xec0f('0x6'));var attributes=require(_0xec0f('0x7'));module[_0xec0f('0x8')]=function(_0x8340fb,_0x4bb2a1){return _0x8340fb[_0xec0f('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0xec0f('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xec0f('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 5dc0a04..f9da1fe 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 _0xf753=['../../config/logger','rpc','client','http','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','util','moment','bluebird','../../mysqldb'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0xf753,0xd9));var _0x3f75=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xf753[_0xe15270];return _0x1e813b;};'use strict';var _=require('lodash');var util=require(_0x3f75('0x0'));var moment=require(_0x3f75('0x1'));var BPromise=require(_0x3f75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f75('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f75('0x4'))(_0x3f75('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f75('0x6')][_0x3f75('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43f396,_0x2ad6e2,_0x135696){return new BPromise(function(_0x475a88,_0xcb6cac){return client['request'](_0x43f396,_0x135696)[_0x3f75('0x8')](function(_0x24f9ad){logger['info'](_0x3f75('0x9'),_0x2ad6e2,_0x3f75('0xa'));logger[_0x3f75('0xb')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2ad6e2,_0x3f75('0xa'),JSON['stringify'](_0x24f9ad));if(_0x24f9ad[_0x3f75('0xc')]){if(_0x24f9ad['error']['code']===0x1f4){logger[_0x3f75('0xc')](_0x3f75('0x9'),_0x2ad6e2,_0x24f9ad['error'][_0x3f75('0xd')]);return _0xcb6cac(_0x24f9ad[_0x3f75('0xc')]['message']);}logger['error'](_0x3f75('0x9'),_0x2ad6e2,_0x24f9ad[_0x3f75('0xc')][_0x3f75('0xd')]);return _0x475a88(_0x24f9ad[_0x3f75('0xc')][_0x3f75('0xd')]);}else{logger[_0x3f75('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ad6e2,_0x3f75('0xa'));_0x475a88(_0x24f9ad[_0x3f75('0xf')][_0x3f75('0xd')]);}})[_0x3f75('0x10')](function(_0x119b1f){logger[_0x3f75('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ad6e2,_0x119b1f);_0xcb6cac(_0x119b1f);});});} \ No newline at end of file +var _0x4351=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x42eb60,_0x570a6b){var _0x258aa9=function(_0x41de97){while(--_0x41de97){_0x42eb60['push'](_0x42eb60['shift']());}};_0x258aa9(++_0x570a6b);}(_0x4351,0x1b5));var _0x1435=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x4351[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var moment=require(_0x1435('0x2'));var BPromise=require(_0x1435('0x3'));var rs=require(_0x1435('0x4'));var fs=require('fs');var Redis=require(_0x1435('0x5'));var db=require(_0x1435('0x6'))['db'];var utils=require(_0x1435('0x7'));var logger=require(_0x1435('0x8'))(_0x1435('0x9'));var config=require(_0x1435('0xa'));var jayson=require(_0x1435('0xb'));var client=jayson[_0x1435('0xc')][_0x1435('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x337fd6,_0x56ce86,_0x10760d){return new BPromise(function(_0x5de4b0,_0x4d04c7){return client[_0x1435('0xe')](_0x337fd6,_0x10760d)[_0x1435('0xf')](function(_0x14a9e1){logger[_0x1435('0x10')](_0x1435('0x11'),_0x56ce86,'request\x20sent');logger[_0x1435('0x12')](_0x1435('0x13'),_0x56ce86,'request\x20sent',JSON['stringify'](_0x14a9e1));if(_0x14a9e1[_0x1435('0x14')]){if(_0x14a9e1['error'][_0x1435('0x15')]===0x1f4){logger['error'](_0x1435('0x11'),_0x56ce86,_0x14a9e1['error']['message']);return _0x4d04c7(_0x14a9e1['error'][_0x1435('0x16')]);}logger[_0x1435('0x14')](_0x1435('0x11'),_0x56ce86,_0x14a9e1['error']['message']);return _0x5de4b0(_0x14a9e1[_0x1435('0x14')]['message']);}else{logger[_0x1435('0x10')](_0x1435('0x11'),_0x56ce86,_0x1435('0x17'));_0x5de4b0(_0x14a9e1[_0x1435('0x18')][_0x1435('0x16')]);}})[_0x1435('0x19')](function(_0x5ecd){logger[_0x1435('0x14')](_0x1435('0x11'),_0x56ce86,_0x5ecd);_0x4d04c7(_0x5ecd);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 51e4f91..68eccd9 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45b9=['online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','info','start','Online\x20apps:','map','filter'];(function(_0x6ebb21,_0x269198){var _0x4a9204=function(_0x3301a3){while(--_0x3301a3){_0x6ebb21['push'](_0x6ebb21['shift']());}};_0x4a9204(++_0x269198);}(_0x45b9,0xbb));var _0x945b=function(_0x30a78e,_0x2f4fa9){_0x30a78e=_0x30a78e-0x0;var _0x1079bb=_0x45b9[_0x30a78e];return _0x1079bb;};'use strict';var _=require(_0x945b('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x945b('0x1'));var config=require(_0x945b('0x2'));var logger=require(_0x945b('0x3'))('app');var pm2=require(_0x945b('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x945b('0x5'));var chat=require(_0x945b('0x6'));var whatsapp=require(_0x945b('0x7'));var transcribe=require(_0x945b('0x8'));function main(){return mysqldb['db'][_0x945b('0x9')]['sync']()[_0x945b('0xa')](function(){return rpc['listen']();})[_0x945b('0xa')](function(_0xa7ed01){logger[_0x945b('0xb')](_0xa7ed01);return chat['start']();})[_0x945b('0xa')](function(){return whatsapp[_0x945b('0xc')]();})[_0x945b('0xa')](function(){return schedule[_0x945b('0xc')]();})['then'](function(){return transcribe['start']();})[_0x945b('0xa')](function(_0x1a8081){logger['info'](_0x1a8081);return pm2[_0x945b('0xc')](pm2Config);})[_0x945b('0xa')](function(_0x50e87a){logger['info'](_0x945b('0xd'),_[_0x945b('0xe')](_[_0x945b('0xf')](_0x50e87a,{'status':_0x945b('0x10')}),_0x945b('0x11'))[_0x945b('0x12')]());logger[_0x945b('0xb')](_0x945b('0x13'),_[_0x945b('0xe')](_[_0x945b('0xf')](_0x50e87a,function(_0x15be7b){return _0x15be7b[_0x945b('0x14')]!==_0x945b('0x10');}),_0x945b('0x11'))[_0x945b('0x12')]()||_0x945b('0x15'));config[_0x945b('0x16')]&&require(_0x945b('0x17'))[_0x945b('0x18')]();require(_0x945b('0x19'))[_0x945b('0x18')]();})[_0x945b('0x1a')](function(_0x2fcd1d){logger['error'](_0x945b('0x1b'),_0x2fcd1d);process[_0x945b('0x1c')](0x1);});}main(); \ No newline at end of file +var _0xf6af=['lodash','./mysqldb','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','listen','info','start','Online\x20apps:','map','filter','name','join','Offline\x20apps:','online','None','seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0xf6af,0xd8));var _0xff6a=function(_0x508be6,_0x5f13c7){_0x508be6=_0x508be6-0x0;var _0x1f637c=_0xf6af[_0x508be6];return _0x1f637c;};'use strict';var _=require(_0xff6a('0x0'));var mysqldb=require(_0xff6a('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0xff6a('0x2'))('app');var pm2=require(_0xff6a('0x3'));var pm2Config=require(_0xff6a('0x4'));var schedule=require(_0xff6a('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xff6a('0x6'));var transcribe=require(_0xff6a('0x7'));function main(){return mysqldb['db'][_0xff6a('0x8')]['sync']()[_0xff6a('0x9')](function(){return rpc[_0xff6a('0xa')]();})[_0xff6a('0x9')](function(_0x2622dc){logger[_0xff6a('0xb')](_0x2622dc);return chat[_0xff6a('0xc')]();})[_0xff6a('0x9')](function(){return whatsapp[_0xff6a('0xc')]();})['then'](function(){return schedule[_0xff6a('0xc')]();})[_0xff6a('0x9')](function(){return transcribe[_0xff6a('0xc')]();})[_0xff6a('0x9')](function(_0x4742aa){logger[_0xff6a('0xb')](_0x4742aa);return pm2['start'](pm2Config);})[_0xff6a('0x9')](function(_0x140da2){logger['info'](_0xff6a('0xd'),_[_0xff6a('0xe')](_[_0xff6a('0xf')](_0x140da2,{'status':'online'}),_0xff6a('0x10'))[_0xff6a('0x11')]());logger[_0xff6a('0xb')](_0xff6a('0x12'),_[_0xff6a('0xe')](_[_0xff6a('0xf')](_0x140da2,function(_0x2909e4){return _0x2909e4['status']!==_0xff6a('0x13');}),_0xff6a('0x10'))[_0xff6a('0x11')]()||_0xff6a('0x14'));config[_0xff6a('0x15')]&&require('./config/seedDB')[_0xff6a('0x16')]();require(_0xff6a('0x17'))['default']();})[_0xff6a('0x18')](function(_0x1c6697){logger['error'](_0xff6a('0x19'),_0x1c6697);process[_0xff6a('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index a6cefe2..9c033de 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 _0xaa12=['toString','../../config/environment','../../config/license/util','../encryptor','lodash','composable-middleware','basic-auth','crypto','bluebird','util','moment','session','fullname','name','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','disposition','then','closed','status','Unmanaged.','catch','headers','startsWith','authorization','User','find','pass','json','Wrong\x20credentials.','Bearer','query','apikey','getUuid','sub','Setting','isEqual','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','blockDuration','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','split','length','splice','encryptString','join','promisify','sign','secret','secrets','payload','options','randomBytes','hex','floor','now'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xaa12,0x163));var _0x2aa1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xaa12[_0x59ee6f];return _0x4c0979;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x2aa1('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x2aa1('0x1'));var encryptor=require(_0x2aa1('0x2'));var _=require(_0x2aa1('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0x2aa1('0x4'));var basicAuth=require(_0x2aa1('0x5'));var crypto=require(_0x2aa1('0x6'));var BPromise=require(_0x2aa1('0x7'));var util=require(_0x2aa1('0x8'));var moment=require(_0x2aa1('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x2aa1('0xa')]});var userAttributes=['id','role',_0x2aa1('0xb'),_0x2aa1('0xc'),_0x2aa1('0xd'),'email',_0x2aa1('0xe'),_0x2aa1('0xf'),'md5secret',_0x2aa1('0x10'),_0x2aa1('0x11'),_0x2aa1('0x12'),_0x2aa1('0x13'),_0x2aa1('0x14'),'openchannelPause','pauseType','showWebBar',_0x2aa1('0x15'),_0x2aa1('0x16'),'crudPermissions',_0x2aa1('0x17'),_0x2aa1('0x18'),_0x2aa1('0x19'),_0x2aa1('0x1a'),'phoneBarAutoAnswerDelay',_0x2aa1('0x1b'),_0x2aa1('0x1c'),_0x2aa1('0x1d'),_0x2aa1('0x1e'),_0x2aa1('0x1f'),_0x2aa1('0x20'),'phoneBarRemoteControl',_0x2aa1('0x21'),_0x2aa1('0x22'),_0x2aa1('0x23'),_0x2aa1('0x24'),_0x2aa1('0x25'),_0x2aa1('0x26'),_0x2aa1('0x27'),'downloadVoiceRecordings',_0x2aa1('0x28'),_0x2aa1('0x29')];exports[_0x2aa1('0x2a')]=function(){return this[_0x2aa1('0x2b')](!![])[_0x2aa1('0x2c')](function(_0x44b39d,_0x23452e,_0x27de83){if(_0x44b39d[_0x2aa1('0x2d')]){_0x27de83();}else{return db['ChatInteraction'][_0x2aa1('0x2e')]({'where':{'id':_0x44b39d[_0x2aa1('0x2f')]['id']},'attributes':['id','closed',_0x2aa1('0x30')],'raw':!![]})[_0x2aa1('0x31')](function(_0x15f40c){if(_0x15f40c&&_0x15f40c[_0x2aa1('0x32')]){return _0x23452e[_0x2aa1('0x33')](_0x15f40c[_0x2aa1('0x30')]==='unmanaged'?0x195:0x193)['json']({'message':_0x15f40c[_0x2aa1('0x30')]==='unmanaged'?_0x2aa1('0x34'):'Forbidden.'});}else{_0x27de83();}})[_0x2aa1('0x35')](function(_0x46e50f){_0x27de83(_0x46e50f);});}});};exports[_0x2aa1('0x2b')]=function isAuthenticated(_0x13badf){return compose()[_0x2aa1('0x2c')](function(_0x498bac,_0x3a1d73,_0x3c8661){var _0x884c52;if(_0x498bac[_0x2aa1('0x36')]['authorization']){if(_[_0x2aa1('0x37')](_0x498bac['headers'][_0x2aa1('0x38')],'Basic')){var _0x5f2a13=basicAuth(_0x498bac);db[_0x2aa1('0x39')][_0x2aa1('0x3a')]({'where':{'name':_0x5f2a13[_0x2aa1('0xc')]}})[_0x2aa1('0x31')](function(_0x67b085){if(!_0x67b085||!_0x67b085['authenticate'](_0x5f2a13[_0x2aa1('0x3b')])){return _0x3a1d73['status'](0x191)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x3d')});}_0x498bac[_0x2aa1('0x2d')]={'id':_0x67b085['id']};_0x3c8661();})[_0x2aa1('0x35')](function(_0x31ffb4){_0x3c8661(_0x31ffb4);});}else if(_[_0x2aa1('0x37')](_0x498bac['headers'][_0x2aa1('0x38')],_0x2aa1('0x3e'))){validateJwt(_0x498bac,_0x3a1d73,_0x3c8661);}else{if(_0x13badf){_0x3c8661();}else{return _0x3a1d73[_0x2aa1('0x33')](0x193)[_0x2aa1('0x3c')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x498bac[_0x2aa1('0x3f')][_0x2aa1('0x40')]){try{var _0xb08337={'audience':hardwareConf[_0x2aa1('0x41')](),'issuer':hardwareConf[_0x2aa1('0x41')]()};verifyJwt(_0x498bac[_0x2aa1('0x3f')]['apikey'],_0xb08337)[_0x2aa1('0x31')](function(_0x16565c){return db[_0x2aa1('0x39')]['find']({'where':{'id':_0x16565c[_0x2aa1('0x42')]}})[_0x2aa1('0x31')](function(_0xf18735){_0x884c52=_0xf18735;return db[_0x2aa1('0x43')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0x2aa1('0x31')](function(_0x8a5950){if(!_0x884c52||!_[_0x2aa1('0x44')](_0x884c52[_0x2aa1('0x45')],_0x16565c['nonce'])){return _0x3a1d73[_0x2aa1('0x33')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x884c52[_0x2aa1('0x46')]){return _0x3a1d73[_0x2aa1('0x33')](0x191)['json']({'message':_0x2aa1('0x47')});}if(_0x884c52['blocked']){if(_0x8a5950['blockDuration']>0x0){if(moment(_0x884c52[_0x2aa1('0x48')])[_0x2aa1('0x49')](_0x8a5950[_0x2aa1('0x4a')],_0x2aa1('0x4b'))>moment()){return _0x3a1d73[_0x2aa1('0x33')](0x191)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x47')});}}else{return _0x3a1d73['status'](0x191)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x47')});}}_0x498bac['user']={'id':_0x884c52['id']};_0x3c8661();});})[_0x2aa1('0x35')](function(){return _0x3a1d73[_0x2aa1('0x33')](0x191)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x47')});});}catch(_0x4414c7){_0x3c8661(_0x4414c7);}}else if(_0x13badf){_0x3c8661();}else{return _0x3a1d73['status'](0x193)[_0x2aa1('0x3c')]({'message':'Unknown\x20authorization\x20format'});}})[_0x2aa1('0x2c')](function(_0x23a5ef,_0xff167d,_0x5b1952){if(_0x23a5ef[_0x2aa1('0x2d')]){db['User']['find']({'where':{'id':_0x23a5ef[_0x2aa1('0x2d')]['id']},'attributes':userAttributes})[_0x2aa1('0x31')](function(_0x594b9c){if(!_0x594b9c){return _0xff167d[_0x2aa1('0x33')](0x194)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x4c')});}_0x23a5ef[_0x2aa1('0x2d')]=_0x594b9c;_0x5b1952();})[_0x2aa1('0x35')](function(_0x57ab4c){_0x5b1952(_0x57ab4c);});}else if(_0x13badf){_0x5b1952();}else{return _0xff167d[_0x2aa1('0x33')](0x194)[_0x2aa1('0x3c')]({'message':_0x2aa1('0x4d')});}});};exports[_0x2aa1('0x4e')]=function canUpdate(){return compose()[_0x2aa1('0x2c')](function(_0x3475d3,_0x474ec6,_0x35d449){return licenseUtil['getLicense']()['then'](function(_0x539ee7){if(_0x539ee7[_0x2aa1('0x4f')]){_0x35d449();}else{return _0x474ec6[_0x2aa1('0x33')](0x193)[_0x2aa1('0x3c')]({'message':'Forbidden'});}})['catch'](function(_0x18626a){_0x35d449(_0x18626a);});});};exports[_0x2aa1('0x50')]=function(_0x3bc6d9,_0x3848cb,_0x50be9f){_0x3bc6d9[_0x2aa1('0x50')]=!![];return _0x50be9f();};exports[_0x2aa1('0x51')]=function signToken(_0x199297){return signJwt(_0x199297);};exports[_0x2aa1('0x52')]=function(_0x8ea5df,_0x2c9ff8){if(!_0x8ea5df[_0x2aa1('0x2d')]){return _0x2c9ff8[_0x2aa1('0x33')](0x194)['json']({'message':_0x2aa1('0x53')});}var _0x15a34e={'payload':{'id':_0x8ea5df['user']['id'],'role':_0x8ea5df[_0x2aa1('0x2d')][_0x2aa1('0x54')]},'options':{'expiresIn':0x15180}};return signJwt(_0x15a34e)[_0x2aa1('0x31')](function(_0x3aaabb){_0x2c9ff8[_0x2aa1('0x55')]('motion.token',_0x3aaabb);_0x2c9ff8[_0x2aa1('0x56')](_0x2aa1('0x57'));})['catch'](function(_0x59763c){return _0x2c9ff8[_0x2aa1('0x33')](0x1f4)[_0x2aa1('0x58')](_0x59763c);});};exports[_0x2aa1('0x59')]=function(_0x5e2303){if(_['isNil'](_0x5e2303[_0x2aa1('0x45')])||_[_0x2aa1('0x5a')](_0x5e2303[_0x2aa1('0x5b')])){return null;}else{return createJwt(_0x5e2303);}};exports['generateApiKey']=function(_0x1f8b45){_0x1f8b45[_0x2aa1('0x45')]=generateNonce();_0x1f8b45[_0x2aa1('0x5b')]=generateIssuedAt();return createJwt(_0x1f8b45);};exports[_0x2aa1('0x5c')]=function(_0x85cc6e,_0x728ec3){var _0x17b2e3=_0x85cc6e[_0x2aa1('0x3f')][_0x2aa1('0x40')];if(_0x17b2e3){var _0x24a116={'nonce':_0x728ec3[_0x2aa1('0x45')],'iat':_0x728ec3['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x2aa1('0x41')]()};return verifyJwt(_0x17b2e3,_0x24a116)[_0x2aa1('0x31')](function(){return generateApiKey(_0x728ec3);});}else{throw{'message':_0x2aa1('0x5d')};}};exports[_0x2aa1('0x5e')]=function(_0x26866d){var _0xd54889=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xd54889[_0x2aa1('0x5f')](_0x26866d))throw new db[(_0x2aa1('0x60'))][(_0x2aa1('0x61'))](_0x2aa1('0x62'));return;};exports['validatePasswordHistory']=function(_0x1dd789,_0x547ebd,_0x4d3ac3){var _0x1268d5=encryptor[_0x2aa1('0x63')](_0x547ebd)['split'](',');for(var _0x46a532=0x0;_0x46a532<_0x4d3ac3;_0x46a532++){if(!_0x1268d5[_0x46a532])break;if(_0x1dd789[_0x2aa1('0x64')]()===_0x1268d5[_0x46a532][_0x2aa1('0x64')]()){var _0x5eb8b5=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x4d3ac3);if(_0x4d3ac3===0x1){_0x5eb8b5=_0x2aa1('0x65');}throw new db[(_0x2aa1('0x60'))][(_0x2aa1('0x61'))](_0x5eb8b5);}}return;};exports['updatePasswordsHistory']=function(_0x4535db,_0x3cc389){var _0x465896=_0x3cc389?encryptor[_0x2aa1('0x63')](_0x3cc389)[_0x2aa1('0x66')](','):[];if(_0x465896[_0x2aa1('0x67')]===0x5){_0x465896[_0x2aa1('0x68')](-0x1,0x1);}_0x465896['unshift'](_0x4535db);return encryptor[_0x2aa1('0x69')](_0x465896[_0x2aa1('0x6a')](','));};function signJwt(_0x1d8b86){var _0x3288b4=BPromise[_0x2aa1('0x6b')](jwt[_0x2aa1('0x6c')],{'context':jwt});var _0x4c4e3e=_0x1d8b86[_0x2aa1('0x6d')]||config[_0x2aa1('0x6e')][_0x2aa1('0xa')];return new BPromise(function(_0x44cd2a,_0x16f57a){_0x3288b4(_0x1d8b86[_0x2aa1('0x6f')],_0x4c4e3e,_0x1d8b86[_0x2aa1('0x70')])[_0x2aa1('0x31')](function(_0x2369a9){_0x44cd2a(_0x2369a9);})[_0x2aa1('0x35')](function(_0x36e7f7){_0x16f57a(_0x36e7f7);});});}function verifyJwt(_0x587c23,_0x152ad6,_0x382d23){var _0x492a64=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x53d41e=_0x382d23||config[_0x2aa1('0x6e')][_0x2aa1('0xa')];return new BPromise(function(_0x14f372,_0x5aa348){_0x492a64(_0x587c23,_0x53d41e,_0x152ad6)['then'](function(_0x2d0d01){_0x14f372(_0x2d0d01);})['catch'](function(_0x579436){_0x5aa348(_0x579436);});});}function generateNonce(){return crypto[_0x2aa1('0x71')](0x10)['toString'](_0x2aa1('0x72'));}function generateIssuedAt(){return Math[_0x2aa1('0x73')](Date[_0x2aa1('0x74')]()/0x3e8)[_0x2aa1('0x75')]();}function createJwt(_0x2d0945){var _0x206a2e={'payload':{'iat':_0x2d0945[_0x2aa1('0x5b')],'nonce':_0x2d0945['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x2d0945['id']['toString'](),'issuer':hardwareConf[_0x2aa1('0x41')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x206a2e)['then'](function(_0x461812){return{'iat':_0x2d0945[_0x2aa1('0x5b')],'nonce':_0x2d0945['apiKeyNonce'],'token':_0x461812};});} \ No newline at end of file +var _0xac42=['getUuid','query','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','catch','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','toString','floor','HS512','../../mysqldb','../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','session','role','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','crudPermissions','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','disposition','then','closed','status','unmanaged','json','authorization','User','find','authenticate','pass','Wrong\x20credentials.','headers','Bearer','Unknown\x20authorization\x20format','apikey'];(function(_0x3adb00,_0x11ef49){var _0x336a41=function(_0x3f1a7e){while(--_0x3f1a7e){_0x3adb00['push'](_0x3adb00['shift']());}};_0x336a41(++_0x11ef49);}(_0xac42,0x124));var _0x2ac4=function(_0x34b661,_0x507a7a){_0x34b661=_0x34b661-0x0;var _0x4a97dc=_0xac42[_0x34b661];return _0x4a97dc;};'use strict';var db=require(_0x2ac4('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x2ac4('0x1'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x2ac4('0x2'));var _=require(_0x2ac4('0x3'));var jwt=require(_0x2ac4('0x4'));var expressJwt=require(_0x2ac4('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x2ac4('0x6'));var crypto=require(_0x2ac4('0x7'));var BPromise=require(_0x2ac4('0x8'));var util=require(_0x2ac4('0x9'));var moment=require(_0x2ac4('0xa'));var validateJwt=expressJwt({'secret':config[_0x2ac4('0xb')][_0x2ac4('0xc')]});var userAttributes=['id',_0x2ac4('0xd'),'fullname',_0x2ac4('0xe'),_0x2ac4('0xf'),_0x2ac4('0x10'),_0x2ac4('0x11'),_0x2ac4('0x12'),_0x2ac4('0x13'),_0x2ac4('0x14'),_0x2ac4('0x15'),_0x2ac4('0x16'),_0x2ac4('0x17'),_0x2ac4('0x18'),'openchannelPause',_0x2ac4('0x19'),_0x2ac4('0x1a'),_0x2ac4('0x1b'),'lastPauseAt',_0x2ac4('0x1c'),'allowmessenger','passwordResetAt','alias',_0x2ac4('0x1d'),_0x2ac4('0x1e'),'phoneBarDnd',_0x2ac4('0x1f'),_0x2ac4('0x20'),'phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired',_0x2ac4('0x21'),_0x2ac4('0x22'),_0x2ac4('0x23'),_0x2ac4('0x24'),_0x2ac4('0x25'),_0x2ac4('0x26'),_0x2ac4('0x27'),_0x2ac4('0x28'),_0x2ac4('0x29'),_0x2ac4('0x2a'),'downloadAttachments'];exports[_0x2ac4('0x2b')]=function(){return this[_0x2ac4('0x2c')](!![])[_0x2ac4('0x2d')](function(_0x265f0e,_0x3cde86,_0x36ecfd){if(_0x265f0e[_0x2ac4('0x2e')]){_0x36ecfd();}else{return db['ChatInteraction'][_0x2ac4('0x2f')]({'where':{'id':_0x265f0e[_0x2ac4('0x30')]['id']},'attributes':['id','closed',_0x2ac4('0x31')],'raw':!![]})[_0x2ac4('0x32')](function(_0x449aac){if(_0x449aac&&_0x449aac[_0x2ac4('0x33')]){return _0x3cde86[_0x2ac4('0x34')](_0x449aac[_0x2ac4('0x31')]===_0x2ac4('0x35')?0x195:0x193)[_0x2ac4('0x36')]({'message':_0x449aac['disposition']===_0x2ac4('0x35')?'Unmanaged.':'Forbidden.'});}else{_0x36ecfd();}})['catch'](function(_0x86bc60){_0x36ecfd(_0x86bc60);});}});};exports[_0x2ac4('0x2c')]=function isAuthenticated(_0x35b529){return compose()[_0x2ac4('0x2d')](function(_0x584fd6,_0x3e539e,_0x57bf17){var _0x5628ab;if(_0x584fd6['headers']['authorization']){if(_['startsWith'](_0x584fd6['headers'][_0x2ac4('0x37')],'Basic')){var _0xbe7a5=basicAuth(_0x584fd6);db[_0x2ac4('0x38')][_0x2ac4('0x39')]({'where':{'name':_0xbe7a5[_0x2ac4('0xe')]}})[_0x2ac4('0x32')](function(_0x1f7df4){if(!_0x1f7df4||!_0x1f7df4[_0x2ac4('0x3a')](_0xbe7a5[_0x2ac4('0x3b')])){return _0x3e539e['status'](0x191)[_0x2ac4('0x36')]({'message':_0x2ac4('0x3c')});}_0x584fd6[_0x2ac4('0x2e')]={'id':_0x1f7df4['id']};_0x57bf17();})['catch'](function(_0x1c6c3b){_0x57bf17(_0x1c6c3b);});}else if(_['startsWith'](_0x584fd6[_0x2ac4('0x3d')][_0x2ac4('0x37')],_0x2ac4('0x3e'))){validateJwt(_0x584fd6,_0x3e539e,_0x57bf17);}else{if(_0x35b529){_0x57bf17();}else{return _0x3e539e['status'](0x193)[_0x2ac4('0x36')]({'message':_0x2ac4('0x3f')});}}}else if(_0x584fd6['query'][_0x2ac4('0x40')]){try{var _0x181657={'audience':hardwareConf[_0x2ac4('0x41')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x584fd6[_0x2ac4('0x42')][_0x2ac4('0x40')],_0x181657)[_0x2ac4('0x32')](function(_0x277597){return db[_0x2ac4('0x38')]['find']({'where':{'id':_0x277597[_0x2ac4('0x43')]}})[_0x2ac4('0x32')](function(_0x5895f2){_0x5628ab=_0x5895f2;return db[_0x2ac4('0x44')][_0x2ac4('0x2f')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2ac4('0x45')],'raw':!![]});})[_0x2ac4('0x32')](function(_0x5b9794){if(!_0x5628ab||!_[_0x2ac4('0x46')](_0x5628ab[_0x2ac4('0x47')],_0x277597[_0x2ac4('0x48')])){return _0x3e539e[_0x2ac4('0x34')](0x191)[_0x2ac4('0x36')]({'message':_0x2ac4('0x49')});}if(_0x5628ab['disabled']){return _0x3e539e[_0x2ac4('0x34')](0x191)[_0x2ac4('0x36')]({'message':_0x2ac4('0x4a')});}if(_0x5628ab[_0x2ac4('0x4b')]){if(_0x5b9794[_0x2ac4('0x45')]>0x0){if(moment(_0x5628ab[_0x2ac4('0x4c')])['add'](_0x5b9794[_0x2ac4('0x45')],'minutes')>moment()){return _0x3e539e[_0x2ac4('0x34')](0x191)[_0x2ac4('0x36')]({'message':_0x2ac4('0x4a')});}}else{return _0x3e539e['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x584fd6[_0x2ac4('0x2e')]={'id':_0x5628ab['id']};_0x57bf17();});})[_0x2ac4('0x4d')](function(){return _0x3e539e[_0x2ac4('0x34')](0x191)[_0x2ac4('0x36')]({'message':_0x2ac4('0x4a')});});}catch(_0x30097c){_0x57bf17(_0x30097c);}}else if(_0x35b529){_0x57bf17();}else{return _0x3e539e['status'](0x193)[_0x2ac4('0x36')]({'message':_0x2ac4('0x3f')});}})[_0x2ac4('0x2d')](function(_0x584d5b,_0xd5a4f7,_0x356ef9){if(_0x584d5b[_0x2ac4('0x2e')]){db[_0x2ac4('0x38')][_0x2ac4('0x39')]({'where':{'id':_0x584d5b[_0x2ac4('0x2e')]['id']},'attributes':userAttributes})['then'](function(_0x30c433){if(!_0x30c433){return _0xd5a4f7[_0x2ac4('0x34')](0x194)['json']({'message':_0x2ac4('0x4e')});}_0x584d5b[_0x2ac4('0x2e')]=_0x30c433;_0x356ef9();})[_0x2ac4('0x4d')](function(_0x597b3f){_0x356ef9(_0x597b3f);});}else if(_0x35b529){_0x356ef9();}else{return _0xd5a4f7['status'](0x194)[_0x2ac4('0x36')]({'message':_0x2ac4('0x4f')});}});};exports[_0x2ac4('0x50')]=function canUpdate(){return compose()['use'](function(_0x291e65,_0xc4c795,_0x4056b0){return licenseUtil[_0x2ac4('0x51')]()[_0x2ac4('0x32')](function(_0x29df8d){if(_0x29df8d['update']){_0x4056b0();}else{return _0xc4c795['status'](0x193)['json']({'message':'Forbidden'});}})[_0x2ac4('0x4d')](function(_0x2a062c){_0x4056b0(_0x2a062c);});});};exports[_0x2ac4('0x52')]=function(_0x944014,_0xc80629,_0x5f0e62){_0x944014[_0x2ac4('0x52')]=!![];return _0x5f0e62();};exports[_0x2ac4('0x53')]=function signToken(_0x2afcec){return signJwt(_0x2afcec);};exports[_0x2ac4('0x54')]=function(_0x57d6d0,_0x53f272){if(!_0x57d6d0[_0x2ac4('0x2e')]){return _0x53f272['status'](0x194)[_0x2ac4('0x36')]({'message':_0x2ac4('0x55')});}var _0x3d0019={'payload':{'id':_0x57d6d0['user']['id'],'role':_0x57d6d0[_0x2ac4('0x2e')][_0x2ac4('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3d0019)['then'](function(_0x445165){_0x53f272['cookie']('motion.token',_0x445165);_0x53f272[_0x2ac4('0x56')](_0x2ac4('0x57'));})[_0x2ac4('0x4d')](function(_0x3652ec){return _0x53f272[_0x2ac4('0x34')](0x1f4)[_0x2ac4('0x58')](_0x3652ec);});};exports[_0x2ac4('0x59')]=function(_0x3d6879){if(_['isNil'](_0x3d6879[_0x2ac4('0x47')])||_['isNil'](_0x3d6879[_0x2ac4('0x5a')])){return null;}else{return createJwt(_0x3d6879);}};exports[_0x2ac4('0x5b')]=function(_0x47a4f8){_0x47a4f8[_0x2ac4('0x47')]=generateNonce();_0x47a4f8['apiKeyIat']=generateIssuedAt();return createJwt(_0x47a4f8);};exports[_0x2ac4('0x5c')]=function(_0x59d29e,_0x111f27){var _0x22c103=_0x59d29e['query']['apikey'];if(_0x22c103){var _0x18f6c1={'nonce':_0x111f27[_0x2ac4('0x47')],'iat':_0x111f27[_0x2ac4('0x5a')],'audience':hardwareConf[_0x2ac4('0x41')](),'issuer':hardwareConf[_0x2ac4('0x41')]()};return verifyJwt(_0x22c103,_0x18f6c1)[_0x2ac4('0x32')](function(){return generateApiKey(_0x111f27);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x2ac4('0x5d')]=function(_0x686650){var _0x2c6fdd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2c6fdd[_0x2ac4('0x5e')](_0x686650))throw new db['Sequelize']['ValidationError'](_0x2ac4('0x5f'));return;};exports['validatePasswordHistory']=function(_0x4f19ad,_0x3db149,_0x522eec){var _0x30a173=encryptor[_0x2ac4('0x60')](_0x3db149)[_0x2ac4('0x61')](',');for(var _0x1775ba=0x0;_0x1775ba<_0x522eec;_0x1775ba++){if(!_0x30a173[_0x1775ba])break;if(_0x4f19ad[_0x2ac4('0x62')]()===_0x30a173[_0x1775ba][_0x2ac4('0x62')]()){var _0x5098f5=util[_0x2ac4('0x63')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x522eec);if(_0x522eec===0x1){_0x5098f5=_0x2ac4('0x64');}throw new db[(_0x2ac4('0x65'))][(_0x2ac4('0x66'))](_0x5098f5);}}return;};exports[_0x2ac4('0x67')]=function(_0x5b78f8,_0x36c101){var _0x4aa3d5=_0x36c101?encryptor[_0x2ac4('0x60')](_0x36c101)[_0x2ac4('0x61')](','):[];if(_0x4aa3d5[_0x2ac4('0x68')]===0x5){_0x4aa3d5[_0x2ac4('0x69')](-0x1,0x1);}_0x4aa3d5[_0x2ac4('0x6a')](_0x5b78f8);return encryptor[_0x2ac4('0x6b')](_0x4aa3d5[_0x2ac4('0x6c')](','));};function signJwt(_0xdf73a9){var _0x50818f=BPromise[_0x2ac4('0x6d')](jwt[_0x2ac4('0x6e')],{'context':jwt});var _0x2c5486=_0xdf73a9[_0x2ac4('0x6f')]||config['secrets']['session'];return new BPromise(function(_0x12bdf5,_0x2301d4){_0x50818f(_0xdf73a9[_0x2ac4('0x70')],_0x2c5486,_0xdf73a9[_0x2ac4('0x71')])['then'](function(_0x43f761){_0x12bdf5(_0x43f761);})['catch'](function(_0x2fa045){_0x2301d4(_0x2fa045);});});}function verifyJwt(_0x508c56,_0xb48ca6,_0x3117c1){var _0x3b3e80=BPromise[_0x2ac4('0x6d')](jwt[_0x2ac4('0x72')],{'context':jwt});var _0x3dc989=_0x3117c1||config[_0x2ac4('0xb')]['session'];return new BPromise(function(_0x155e23,_0x1f6eda){_0x3b3e80(_0x508c56,_0x3dc989,_0xb48ca6)['then'](function(_0xf958b6){_0x155e23(_0xf958b6);})[_0x2ac4('0x4d')](function(_0x4abe4f){_0x1f6eda(_0x4abe4f);});});}function generateNonce(){return crypto[_0x2ac4('0x73')](0x10)[_0x2ac4('0x74')]('hex');}function generateIssuedAt(){return Math[_0x2ac4('0x75')](Date['now']()/0x3e8)[_0x2ac4('0x74')]();}function createJwt(_0x4e3040){var _0x5bd374={'payload':{'iat':_0x4e3040[_0x2ac4('0x5a')],'nonce':_0x4e3040[_0x2ac4('0x47')]},'options':{'algorithm':_0x2ac4('0x76'),'subject':_0x4e3040['id'][_0x2ac4('0x74')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x5bd374)[_0x2ac4('0x32')](function(_0x4e0b7b){return{'iat':_0x4e3040[_0x2ac4('0x5a')],'nonce':_0x4e3040[_0x2ac4('0x47')],'token':_0x4e0b7b};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 67ced9c..411db26 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 _0xecbc=['aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','end','final','write','close','unlink','decryptFile','encryptString','secret','utf8','base64','decryptString','createDecipher','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xecbc,0x1a8));var _0xcecb=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xecbc[_0x11005e];return _0x29338f;};'use strict';var crypto=require(_0xcecb('0x0'));var fs=require('fs');var BPromise=require(_0xcecb('0x1'));var _=require(_0xcecb('0x2'));var config=require(_0xcecb('0x3'));var logger=require(_0xcecb('0x4'))(_0xcecb('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xcecb('0x6')][_0xcecb('0x7')],'algorithm':_0xcecb('0x8')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0xcecb('0x9')][_0xcecb('0xa')]){var isSupported=isAlgorithmSupported(config[_0xcecb('0x9')][_0xcecb('0xa')]);if(isSupported){fileOptions[_0xcecb('0xa')]=config[_0xcecb('0x9')][_0xcecb('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xcecb('0xb')](',\x20');logger[_0xcecb('0xc')](config[_0xcecb('0x9')][_0xcecb('0xa')],_0xcecb('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x327cb7){return AES_SUPPORTED_RX[_0xcecb('0xe')](_0x327cb7);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xcecb('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x484f96){return getSupportedCiphers()[_0xcecb('0x10')](_0x484f96)>-0x1;}function combineOptions(_0x3f230d){var _0x5243b2={};for(var _0xaef143 in fileOptions){if(fileOptions[_0xcecb('0x11')](_0xaef143)){_0x5243b2[_0xaef143]=fileOptions[_0xaef143];}}if(_0x3f230d){for(var _0x40fd2e in _0x3f230d){if(_0x3f230d[_0xcecb('0x11')](_0x40fd2e)){_0x5243b2[_0x40fd2e]=_0x3f230d[_0x40fd2e];}}}return _0x5243b2;}exports[_0xcecb('0x12')]=function(_0x4a1aa2,_0x3a3c51,_0x4e174e,_0x2f5789){return new BPromise(function(_0x5c0beb,_0x13aa19){_0x2f5789=combineOptions(_0x2f5789);var _0x1ac480=new Buffer(_0x4e174e);var _0xee0f7a=fs[_0xcecb('0x13')](_0x4a1aa2);var _0x4851f=fs[_0xcecb('0x14')](_0x3a3c51);var _0x1e4ecb=crypto['createCipher'](_0x2f5789[_0xcecb('0xa')],_0x1ac480);_0xee0f7a['on'](_0xcecb('0x15'),function(_0x5c83f5){var _0x2a43c2=new Buffer(_0x1e4ecb[_0xcecb('0x16')](_0x5c83f5),_0xcecb('0x17'));_0x4851f['write'](_0x2a43c2);});_0xee0f7a['on'](_0xcecb('0x18'),function(){try{var _0x315f93=new Buffer(_0x1e4ecb[_0xcecb('0x19')]('binary'),_0xcecb('0x17'));_0x4851f[_0xcecb('0x1a')](_0x315f93);_0x4851f[_0xcecb('0x18')]();_0x4851f['on'](_0xcecb('0x1b'),function(){return _0x5c0beb(_0x3a3c51);});}catch(_0x3312bf){fs[_0xcecb('0x1c')](_0x3a3c51);return _0x13aa19(_0x3312bf);}});});};exports[_0xcecb('0x1d')]=function(_0x152818,_0x3bd468,_0x566cdb,_0x225bb5){return new BPromise(function(_0x1d5b43,_0xe52504){_0x225bb5=combineOptions(_0x225bb5);var _0x53db7e=new Buffer(_0x566cdb);var _0x40e63f=fs[_0xcecb('0x13')](_0x152818);var _0x427146=fs[_0xcecb('0x14')](_0x3bd468);var _0x59407e=crypto['createDecipher'](_0x225bb5[_0xcecb('0xa')],_0x53db7e);_0x40e63f['on'](_0xcecb('0x15'),function(_0x1a050e){var _0x2e6d31=new Buffer(_0x59407e[_0xcecb('0x16')](_0x1a050e),'binary');_0x427146[_0xcecb('0x1a')](_0x2e6d31);});_0x40e63f['on'](_0xcecb('0x18'),function(){try{var _0x29f58d=new Buffer(_0x59407e[_0xcecb('0x19')](_0xcecb('0x17')),'binary');_0x427146[_0xcecb('0x1a')](_0x29f58d);_0x427146[_0xcecb('0x18')]();_0x427146['on']('close',function(){return _0x1d5b43(_0x3bd468);});}catch(_0x1f5045){fs[_0xcecb('0x1c')](_0x3bd468);return _0xe52504(_0x1f5045);}});});};exports[_0xcecb('0x1e')]=function(_0x3094a0,_0x49e307,_0xe46d88){var _0x2062c0=_0xe46d88||stringOptions[_0xcecb('0xa')];var _0x31cd19=_0x49e307||stringOptions[_0xcecb('0x1f')];var _0x4aa880=crypto['createCipher'](_0x2062c0,_0x31cd19);var _0x3f5ecb=_0x4aa880['update'](_0x3094a0,_0xcecb('0x20'),'base64');_0x3f5ecb+=_0x4aa880[_0xcecb('0x19')](_0xcecb('0x21'));return _0x3f5ecb;};exports[_0xcecb('0x22')]=function(_0x300bc5,_0x2be573,_0x557c62){var _0x2a3109=_0x557c62||stringOptions[_0xcecb('0xa')];var _0x25dd76=_0x2be573||stringOptions[_0xcecb('0x1f')];var _0x8320de=crypto[_0xcecb('0x23')](_0x2a3109,_0x25dd76);var _0x1511f9=_0x8320de[_0xcecb('0x16')](_0x300bc5,_0xcecb('0x21'),'utf8');_0x1511f9+=_0x8320de[_0xcecb('0x19')]('utf8');return _0x1511f9;}; \ No newline at end of file +var _0x3105=['crypto','bluebird','lodash','../../config/logger','app','session','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createWriteStream','data','write','end','final','binary','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','secret','createCipher','update','base64','decryptString','utf8'];(function(_0x4c49bb,_0x4fa114){var _0x29e643=function(_0x3a0073){while(--_0x3a0073){_0x4c49bb['push'](_0x4c49bb['shift']());}};_0x29e643(++_0x4fa114);}(_0x3105,0x66));var _0x5310=function(_0x41e2ce,_0x426903){_0x41e2ce=_0x41e2ce-0x0;var _0x40babe=_0x3105[_0x41e2ce];return _0x40babe;};'use strict';var crypto=require(_0x5310('0x0'));var fs=require('fs');var BPromise=require(_0x5310('0x1'));var _=require(_0x5310('0x2'));var config=require('../../config/environment');var logger=require(_0x5310('0x3'))(_0x5310('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x5310('0x5')],'algorithm':_0x5310('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0x5310('0x7')]&&config[_0x5310('0x7')][_0x5310('0x8')]){var isSupported=isAlgorithmSupported(config[_0x5310('0x7')][_0x5310('0x8')]);if(isSupported){fileOptions[_0x5310('0x8')]=config['encrypt'][_0x5310('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5310('0x9')](',\x20');logger['error'](config[_0x5310('0x7')][_0x5310('0x8')],_0x5310('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x1b2064){return AES_SUPPORTED_RX[_0x5310('0xb')](_0x1b2064);}function getSupportedCiphers(){return crypto[_0x5310('0xc')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x355224){return getSupportedCiphers()[_0x5310('0xd')](_0x355224)>-0x1;}function combineOptions(_0x1be88b){var _0x5e948b={};for(var _0x4015ab in fileOptions){if(fileOptions[_0x5310('0xe')](_0x4015ab)){_0x5e948b[_0x4015ab]=fileOptions[_0x4015ab];}}if(_0x1be88b){for(var _0x3a0df6 in _0x1be88b){if(_0x1be88b[_0x5310('0xe')](_0x3a0df6)){_0x5e948b[_0x3a0df6]=_0x1be88b[_0x3a0df6];}}}return _0x5e948b;}exports[_0x5310('0xf')]=function(_0x3f5fb,_0x7f4a76,_0xd9404e,_0x4da774){return new BPromise(function(_0x3764c4,_0x3f6504){_0x4da774=combineOptions(_0x4da774);var _0xc2354b=new Buffer(_0xd9404e);var _0x7c32b1=fs['createReadStream'](_0x3f5fb);var _0x38fe7f=fs[_0x5310('0x10')](_0x7f4a76);var _0x4fd3cb=crypto['createCipher'](_0x4da774[_0x5310('0x8')],_0xc2354b);_0x7c32b1['on'](_0x5310('0x11'),function(_0x36253e){var _0x93fdc1=new Buffer(_0x4fd3cb['update'](_0x36253e),'binary');_0x38fe7f[_0x5310('0x12')](_0x93fdc1);});_0x7c32b1['on'](_0x5310('0x13'),function(){try{var _0x45e699=new Buffer(_0x4fd3cb[_0x5310('0x14')]('binary'),_0x5310('0x15'));_0x38fe7f[_0x5310('0x12')](_0x45e699);_0x38fe7f[_0x5310('0x13')]();_0x38fe7f['on'](_0x5310('0x16'),function(){return _0x3764c4(_0x7f4a76);});}catch(_0x1959d5){fs[_0x5310('0x17')](_0x7f4a76);return _0x3f6504(_0x1959d5);}});});};exports[_0x5310('0x18')]=function(_0x2e00b5,_0x3ccefb,_0x54b232,_0x2f189e){return new BPromise(function(_0x26689e,_0x363964){_0x2f189e=combineOptions(_0x2f189e);var _0x28611f=new Buffer(_0x54b232);var _0x5e5e06=fs[_0x5310('0x19')](_0x2e00b5);var _0x3c3343=fs[_0x5310('0x10')](_0x3ccefb);var _0x2d8311=crypto[_0x5310('0x1a')](_0x2f189e[_0x5310('0x8')],_0x28611f);_0x5e5e06['on'](_0x5310('0x11'),function(_0x427095){var _0x279986=new Buffer(_0x2d8311['update'](_0x427095),_0x5310('0x15'));_0x3c3343[_0x5310('0x12')](_0x279986);});_0x5e5e06['on']('end',function(){try{var _0x4e9e72=new Buffer(_0x2d8311[_0x5310('0x14')](_0x5310('0x15')),_0x5310('0x15'));_0x3c3343['write'](_0x4e9e72);_0x3c3343['end']();_0x3c3343['on'](_0x5310('0x16'),function(){return _0x26689e(_0x3ccefb);});}catch(_0x3dbb26){fs[_0x5310('0x17')](_0x3ccefb);return _0x363964(_0x3dbb26);}});});};exports[_0x5310('0x1b')]=function(_0xdebbc4,_0x485313,_0x224477){var _0x419776=_0x224477||stringOptions[_0x5310('0x8')];var _0x143abe=_0x485313||stringOptions[_0x5310('0x1c')];var _0x3ce553=crypto[_0x5310('0x1d')](_0x419776,_0x143abe);var _0x1a3505=_0x3ce553[_0x5310('0x1e')](_0xdebbc4,'utf8','base64');_0x1a3505+=_0x3ce553['final'](_0x5310('0x1f'));return _0x1a3505;};exports[_0x5310('0x20')]=function(_0x4b6a80,_0x60ab93,_0x1601d6){var _0x34b9cc=_0x1601d6||stringOptions['algorithm'];var _0x3f2264=_0x60ab93||stringOptions['secret'];var _0x306c4a=crypto[_0x5310('0x1a')](_0x34b9cc,_0x3f2264);var _0x27bcc9=_0x306c4a[_0x5310('0x1e')](_0x4b6a80,'base64','utf8');_0x27bcc9+=_0x306c4a['final'](_0x5310('0x21'));return _0x27bcc9;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index cb73f14..d999cdb 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 _0xe28e=['dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','length','existsSync','join','mkdirSync','each','%s.%s','csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xe28e,0x1ba));var _0xee28=function(_0x3432d4,_0x20a858){_0x3432d4=_0x3432d4-0x0;var _0x2fd76c=_0xe28e[_0x3432d4];return _0x2fd76c;};'use strict';var util=require(_0xee28('0x0'));var path=require(_0xee28('0x1'));var _=require(_0xee28('0x2'));var csv=require(_0xee28('0x3'));var fs=require('fs');var BPromise=require(_0xee28('0x4'));var zipdir=require(_0xee28('0x5'));var rimraf=require(_0xee28('0x6'));var db=require(_0xee28('0x7'))['db'];var dbH=require(_0xee28('0x7'))[_0xee28('0x8')];var logger=require(_0xee28('0x9'))(_0xee28('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xee28('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xee28('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x30224a,_0x3f9bd9){var _0x66d0b6={'status':_0x30224a};var _0x156aad={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f9bd9){_0x66d0b6[_0xee28('0xc')]=_0x3f9bd9;}return db[_0xee28('0xd')]['update'](_0x66d0b6,_0x156aad);}function main(){var _0x5afe44=0x1388;var _0x561fe4;logger[_0xee28('0xe')](util[_0xee28('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xee28('0x10')));return db[_0xee28('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xee28('0x12'),_0xee28('0x13')]})[_0xee28('0x14')](function(_0x2488cf){if(_0x2488cf){_0x561fe4=_0x2488cf;_0x5afe44=_0x561fe4[_0xee28('0x13')]||0x1388;}})[_0xee28('0x14')](function(){return dbH[_0xee28('0x15')]['query'](util[_0xee28('0xf')](_0xee28('0x16'),QUERY),{'type':dbH[_0xee28('0x15')][_0xee28('0x17')][_0xee28('0x18')]});})['then'](function(_0x11ac93){if(!_0x11ac93[0x0][_0xee28('0x19')]){return analyticExtractedReport(_0xee28('0x1a'));}var _0x343358=[];var _0x1ff99e=0x0;var _0x11c95d=!![];if(_0x11ac93&&_0x11ac93['length']){var _0x1e9317=_0x11ac93[0x0]['num']%(_0x1ff99e+_0x5afe44);if(_0x561fe4[_0xee28('0x12')]){for(;_0x11c95d;_0x1ff99e+=_0x5afe44,_0x1e9317=_0x11ac93[0x0][_0xee28('0x19')]%(_0x1ff99e+_0x5afe44)){if(_0x1e9317==0x0||_0x1e9317==_0x11ac93[0x0]['num']){_0x11c95d=![];}_0x343358[_0xee28('0x1b')](dbH['sequelize'][_0xee28('0x1c')](util['format'](_0xee28('0x1d'),QUERY,_0x5afe44,_0x1ff99e),{'type':dbH['sequelize'][_0xee28('0x17')]['SELECT']}));}}else{_0x343358[_0xee28('0x1b')](dbH[_0xee28('0x15')][_0xee28('0x1c')](QUERY,{'type':dbH[_0xee28('0x15')][_0xee28('0x17')][_0xee28('0x18')]}));}}var _0x2dbd49=path['dirname'](PATH);var _0x342798=path[_0xee28('0x1e')](PATH,_0xee28('0x1f'));var _0x5a46cd=_0x561fe4['split']&&_0x343358[_0xee28('0x20')]>0x1;var _0x4a524d=[];if(!fs[_0xee28('0x21')](path[_0xee28('0x22')](_0x2dbd49,_0x342798))&&_0x5a46cd){fs[_0xee28('0x23')](path[_0xee28('0x22')](_0x2dbd49,_0x342798));}return BPromise[_0xee28('0x24')](_0x343358,function(_0x95d917){_0x4a524d[_0xee28('0x1b')](_0x95d917);})[_0xee28('0x14')](function(){for(var _0x281c8a=0x0;_0x281c8a<_0x4a524d['length'];_0x281c8a+=0x1){var _0x2c847b;var _0x5b1b1e=_0x4a524d[_0x281c8a];if(_0x5a46cd){_0x2c847b=path['join'](_0x2dbd49,_0x342798,util['format']('%s%d.%s',_0x342798,_0x281c8a,'csv'));}else{_0x2c847b=path[_0xee28('0x22')](_0x2dbd49,util[_0xee28('0xf')](_0xee28('0x25'),_0x342798,_0xee28('0x26')));}fs[_0xee28('0x27')](_0x2c847b,csv(_0x5b1b1e));}})[_0xee28('0x14')](function(){if(_0x5a46cd){zipdir(path[_0xee28('0x22')](_0x2dbd49,_0x342798),{'saveTo':path['join'](_0x2dbd49,util[_0xee28('0xf')](_0xee28('0x25'),_0x342798,_0xee28('0x28')))},function(_0x49644a,_0x14f7c4){});rimraf(path[_0xee28('0x22')](_0x2dbd49,_0x342798),function(){});}})[_0xee28('0x14')](function(){logger[_0xee28('0xe')](util[_0xee28('0xf')](_0xee28('0x29'),EXTRACTED_REPORT_ID,_0xee28('0x10')));return analyticExtractedReport('Completed',_0x5a46cd?util[_0xee28('0xf')](_0xee28('0x25'),_0x342798,_0x5a46cd?'zip':_0xee28('0x26')):null);});})[_0xee28('0x2a')](function(_0x3e84cc){logger[_0xee28('0xe')](util[_0xee28('0xf')](_0xee28('0x2b'),EXTRACTED_REPORT_ID,_0xee28('0x10')),util['inspect'](_0x3e84cc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xee28('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2e54=['Completed','inspect','Failed','exit','util','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','push','SELECT','basename','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0x99d2bf,_0x400e93){var _0x76f557=function(_0x31715c){while(--_0x31715c){_0x99d2bf['push'](_0x99d2bf['shift']());}};_0x76f557(++_0x400e93);}(_0x2e54,0x1dd));var _0x42e5=function(_0x9b02ec,_0x10c281){_0x9b02ec=_0x9b02ec-0x0;var _0x3c4d24=_0x2e54[_0x9b02ec];return _0x3c4d24;};'use strict';var util=require(_0x42e5('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x42e5('0x1'));var fs=require('fs');var BPromise=require(_0x42e5('0x2'));var zipdir=require(_0x42e5('0x3'));var rimraf=require(_0x42e5('0x4'));var db=require(_0x42e5('0x5'))['db'];var dbH=require(_0x42e5('0x5'))[_0x42e5('0x6')];var logger=require('../../config/logger')(_0x42e5('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x42e5('0x8')][0x2]);var QUERY=process[_0x42e5('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2af5bb,_0x56be20){var _0x335b92={'status':_0x2af5bb};var _0x490b99={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x56be20){_0x335b92[_0x42e5('0x9')]=_0x56be20;}return db[_0x42e5('0xa')][_0x42e5('0xb')](_0x335b92,_0x490b99);}function main(){var _0x15f9f1=0x1388;var _0x206bf3;logger[_0x42e5('0xc')](util[_0x42e5('0xd')](_0x42e5('0xe'),EXTRACTED_REPORT_ID,_0x42e5('0xf')));return db['Setting'][_0x42e5('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x42e5('0x11'),'splitSizeCsv']})[_0x42e5('0x12')](function(_0x12385d){if(_0x12385d){_0x206bf3=_0x12385d;_0x15f9f1=_0x206bf3[_0x42e5('0x13')]||0x1388;}})[_0x42e5('0x12')](function(){return dbH[_0x42e5('0x14')][_0x42e5('0x15')](util[_0x42e5('0xd')](_0x42e5('0x16'),QUERY),{'type':dbH[_0x42e5('0x14')][_0x42e5('0x17')]['SELECT']});})[_0x42e5('0x12')](function(_0x1d8e52){if(!_0x1d8e52[0x0][_0x42e5('0x18')]){return analyticExtractedReport(_0x42e5('0x19'));}var _0x2f4999=[];var _0x263a3d=0x0;var _0x1a26c6=!![];if(_0x1d8e52&&_0x1d8e52[_0x42e5('0x1a')]){var _0x16c753=_0x1d8e52[0x0][_0x42e5('0x18')]%(_0x263a3d+_0x15f9f1);if(_0x206bf3[_0x42e5('0x11')]){for(;_0x1a26c6;_0x263a3d+=_0x15f9f1,_0x16c753=_0x1d8e52[0x0][_0x42e5('0x18')]%(_0x263a3d+_0x15f9f1)){if(_0x16c753==0x0||_0x16c753==_0x1d8e52[0x0][_0x42e5('0x18')]){_0x1a26c6=![];}_0x2f4999[_0x42e5('0x1b')](dbH['sequelize'][_0x42e5('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x15f9f1,_0x263a3d),{'type':dbH[_0x42e5('0x14')][_0x42e5('0x17')]['SELECT']}));}}else{_0x2f4999[_0x42e5('0x1b')](dbH[_0x42e5('0x14')][_0x42e5('0x15')](QUERY,{'type':dbH[_0x42e5('0x14')][_0x42e5('0x17')][_0x42e5('0x1c')]}));}}var _0x36ca89=path['dirname'](PATH);var _0x4da508=path[_0x42e5('0x1d')](PATH,'.csv');var _0xa30900=_0x206bf3[_0x42e5('0x11')]&&_0x2f4999[_0x42e5('0x1a')]>0x1;var _0x49490f=[];if(!fs[_0x42e5('0x1e')](path['join'](_0x36ca89,_0x4da508))&&_0xa30900){fs[_0x42e5('0x1f')](path[_0x42e5('0x20')](_0x36ca89,_0x4da508));}return BPromise[_0x42e5('0x21')](_0x2f4999,function(_0x275c80){_0x49490f[_0x42e5('0x1b')](_0x275c80);})['then'](function(){for(var _0x4fb147=0x0;_0x4fb147<_0x49490f[_0x42e5('0x1a')];_0x4fb147+=0x1){var _0x534a26;var _0x56f812=_0x49490f[_0x4fb147];if(_0xa30900){_0x534a26=path[_0x42e5('0x20')](_0x36ca89,_0x4da508,util['format'](_0x42e5('0x22'),_0x4da508,_0x4fb147,_0x42e5('0x23')));}else{_0x534a26=path[_0x42e5('0x20')](_0x36ca89,util[_0x42e5('0xd')](_0x42e5('0x24'),_0x4da508,_0x42e5('0x23')));}fs['writeFileSync'](_0x534a26,csv(_0x56f812));}})[_0x42e5('0x12')](function(){if(_0xa30900){zipdir(path[_0x42e5('0x20')](_0x36ca89,_0x4da508),{'saveTo':path[_0x42e5('0x20')](_0x36ca89,util[_0x42e5('0xd')](_0x42e5('0x24'),_0x4da508,_0x42e5('0x25')))},function(_0x383e97,_0x282cbf){});rimraf(path[_0x42e5('0x20')](_0x36ca89,_0x4da508),function(){});}})[_0x42e5('0x12')](function(){logger[_0x42e5('0xc')](util[_0x42e5('0xd')](_0x42e5('0x26'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x42e5('0x27'),_0xa30900?util[_0x42e5('0xd')](_0x42e5('0x24'),_0x4da508,_0xa30900?_0x42e5('0x25'):'csv'):null);});})['catch'](function(_0x21d933){logger['info'](util[_0x42e5('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x42e5('0xf')),util[_0x42e5('0x28')](_0x21d933,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x42e5('0x29'));})['finally'](function(){process[_0x42e5('0x2a')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 35e5bd6..3de075c 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 _0x04fc=['../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','push','concat','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','before','toString','\x20/\x20','footer','Arial','basename','.pdf','join','format','%s.%s','Setting','split','then','num','sequelize','query','QueryTypes','SELECT','mkdirSync','all','flatten','createPdfKitDocument','%s%d.%s','pdf','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','channel','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window'];(function(_0xd745e9,_0x208bf6){var _0x2958f4=function(_0x5e3da4){while(--_0x5e3da4){_0xd745e9['push'](_0xd745e9['shift']());}};_0x2958f4(++_0x208bf6);}(_0x04fc,0xe9));var _0xc04f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04fc[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xc04f('0x0'));var path=require(_0xc04f('0x1'));var moment=require(_0xc04f('0x2'));var htmlToPdfmake=require(_0xc04f('0x3'));var PdfPrinter=require(_0xc04f('0x4'));var zipdir=require(_0xc04f('0x5'));var rimraf=require(_0xc04f('0x6'));var JSDOM=require(_0xc04f('0x7'))[_0xc04f('0x8')];var window=new JSDOM('')[_0xc04f('0x9')];var db=require('../../mysqldb')['db'];var dbH=require(_0xc04f('0xa'))[_0xc04f('0xb')];var logger=require(_0xc04f('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xc04f('0xd')][0x2]);var QUERY=process[_0xc04f('0xd')][0x3];var PATH=process[_0xc04f('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xc04f('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x130864,_0x1f27d9){var _0x1aede8={'status':_0x130864};var _0x4ddd1e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1f27d9){_0x1aede8[_0xc04f('0xf')]=_0x1f27d9;}return db[_0xc04f('0x10')][_0xc04f('0x11')](_0x1aede8,_0x4ddd1e);}function getHeaders(_0x4a7635){return _[_0xc04f('0x12')](_0x4a7635,function(_0x4d8ef9){return{'text':_0x4d8ef9,'style':_0xc04f('0x13')};});}function getRows(_0x94c5ba,_0x384f2a){return _[_0xc04f('0x12')](_0x384f2a,function(_0x51f9ae){return _(_0x51f9ae)[_0xc04f('0x14')](_0x94c5ba)['map'](function(_0xcc2416){return _0xcc2416?_['toString'](_0xcc2416):'';})[_0xc04f('0x15')]();});}function createTable(_0x3e63bd,_0x2dae3d){var _0x167cfc={'widths':_[_0xc04f('0x16')](Array(_0x3e63bd[_0xc04f('0x17')]),0x91),'heights':function(_0x1bf8a3){return _0x1bf8a3===0x0?_0xc04f('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2df89d=getHeaders(_0x3e63bd);_0x167cfc[_0xc04f('0x19')][_0xc04f('0x1a')](_0x2df89d);var _0x4aa940=getRows(_0x3e63bd,_0x2dae3d);_0x167cfc[_0xc04f('0x19')]=_0x167cfc[_0xc04f('0x19')][_0xc04f('0x1b')](_0x4aa940);return _0x167cfc;}function createTables(_0x8b6a2b){var _0x12acd3=[];var _0x1ee69d=_['chunk'](Object[_0xc04f('0x1c')](_0x8b6a2b[0x0]),0x5);_0x1ee69d[_0xc04f('0x1d')](function(_0x1e72c1){_0x12acd3[_0xc04f('0x1a')](createTable(_0x1e72c1,_0x8b6a2b));});return _0x12acd3;}function getPDFDocDefinition(_0x39fb60){var _0x5ee67d=util['format'](_0xc04f('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xc04f('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xc04f('0x20')])['format'](FORMAT));var _0x4daccf=[];for(var _0xcb6aa4=0x0;_0xcb6aa4<_0x39fb60['length'];_0xcb6aa4++){var _0x1cd2e9=[];if(_0xcb6aa4===0x0){_0x1cd2e9[_0xc04f('0x1a')]({'text':_0x5ee67d,'style':'header'});}var _0x5be55e={'table':_0x39fb60[_0xcb6aa4]};if(_0xcb6aa4>0x0){_0x5be55e['pageBreak']=_0xc04f('0x21');_0x5be55e['margin']=[0x0,0x46,0x0,0x0];}_0x1cd2e9[_0xc04f('0x1a')](_0x5be55e);_0x4daccf[_0xc04f('0x1a')](_0x1cd2e9);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4daccf,'footer':function(_0x27baac,_0x423085){return{'text':_0x27baac[_0xc04f('0x22')]()+_0xc04f('0x23')+_0x423085,'style':_0xc04f('0x24')};},'defaultStyle':{'font':_0xc04f('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x370ed4){var _0x4f3536=0x1388;var _0x27ce21;if(!_0x370ed4[0x0]['num']){return analyticExtractedReport('Empty');}var _0x4743cf=[];var _0x1e18a1=0x0;var _0x3bffcd=!![];var _0x416829=path['dirname'](PATH);var _0x27e431=path[_0xc04f('0x26')](PATH,_0xc04f('0x27'));var _0xcd786a=path[_0xc04f('0x28')](_0x416829,util[_0xc04f('0x29')](_0xc04f('0x2a'),_0x27e431,'pdf'));var _0x31bc28=![];return db[_0xc04f('0x2b')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc04f('0x2c'),'splitSizePdf']})[_0xc04f('0x2d')](function(_0x3b2f24){if(_0x3b2f24){_0x27ce21=_0x3b2f24;_0x4f3536=_0x27ce21['splitSizePdf']||0x3e8;}})[_0xc04f('0x2d')](function(){if(_0x370ed4&&_0x370ed4[_0xc04f('0x17')]){var _0x2c5efa=_0x370ed4[0x0][_0xc04f('0x2e')]%(_0x1e18a1+_0x4f3536);if(_0x27ce21[_0xc04f('0x2c')]){for(;_0x3bffcd;_0x1e18a1+=_0x4f3536,_0x2c5efa=_0x370ed4[0x0][_0xc04f('0x2e')]%(_0x1e18a1+_0x4f3536)){if(_0x2c5efa==0x0||_0x2c5efa==_0x370ed4[0x0][_0xc04f('0x2e')]){_0x3bffcd=![];}_0x4743cf['push'](dbH[_0xc04f('0x2f')][_0xc04f('0x30')](util[_0xc04f('0x29')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f3536,_0x1e18a1),{'type':dbH[_0xc04f('0x2f')][_0xc04f('0x31')][_0xc04f('0x32')]}));}}else{_0x4743cf[_0xc04f('0x1a')](dbH['sequelize'][_0xc04f('0x30')](QUERY,{'type':dbH['sequelize'][_0xc04f('0x31')][_0xc04f('0x32')]}));}}_0x31bc28=_0x27ce21[_0xc04f('0x2c')]&&_0x4743cf[_0xc04f('0x17')]>0x1;if(!fs['existsSync'](path[_0xc04f('0x28')](_0x416829,_0x27e431))&&_0x31bc28){fs[_0xc04f('0x33')](path['join'](_0x416829,_0x27e431));}return Promise[_0xc04f('0x34')](_0x4743cf);})[_0xc04f('0x2d')](function(_0x292b9f){return createTables(_[_0xc04f('0x35')](_0x292b9f));})[_0xc04f('0x2d')](function(_0x27667e){var _0x56bb70=getPDFDocDefinition(_0x27667e);var _0x3eb915=getPDFPrinter();var _0x275865=_0x3eb915[_0xc04f('0x36')](_0x56bb70);if(_0x31bc28)_0xcd786a=path[_0xc04f('0x28')](_0x416829,_0x27e431,util[_0xc04f('0x29')](_0xc04f('0x37'),_0x27e431,index,_0xc04f('0x38')));return writePDFDocument(_0x275865,_0xcd786a);})[_0xc04f('0x2d')](function(){if(!_0x31bc28)return;zipdir(path[_0xc04f('0x28')](_0x416829,_0x27e431),{'saveTo':path['join'](_0x416829,util[_0xc04f('0x29')](_0xc04f('0x2a'),_0x27e431,_0xc04f('0x39')))},function(_0x42b7ff){if(_0x42b7ff)throw _0x42b7ff;return;});})['then'](function(){if(!_0x31bc28)return;rimraf(path[_0xc04f('0x28')](_0x416829,_0x27e431),function(){});})[_0xc04f('0x2d')](function(){logger[_0xc04f('0x3a')](util[_0xc04f('0x29')](_0xc04f('0x3b'),EXTRACTED_REPORT_ID,_0xc04f('0x3c')));return analyticExtractedReport('Completed',_0x31bc28?util[_0xc04f('0x29')](_0xc04f('0x2a'),_0x27e431,_0x31bc28?_0xc04f('0x39'):_0xc04f('0x38')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc04f('0x3a')](util[_0xc04f('0x29')](_0xc04f('0x3d'),EXTRACTED_REPORT_ID,_0xc04f('0x3e')));return db['AnalyticExtractedReport'][_0xc04f('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x66734e){EXTRACTED_REPORT=_0x66734e;return dbH[_0xc04f('0x2f')]['query'](util[_0xc04f('0x29')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xc04f('0x2f')][_0xc04f('0x31')][_0xc04f('0x32')]});})[_0xc04f('0x2d')](extractReport)['catch'](function(_0x58d015){logger['info'](util[_0xc04f('0x29')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc04f('0x3e')),util[_0xc04f('0x40')](_0x58d015,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc04f('0x41'));})[_0xc04f('0x42')](function(){process[_0xc04f('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3f86e1=new PdfPrinter({'Arial':{'normal':__dirname+_0xc04f('0x44'),'bold':__dirname+_0xc04f('0x45'),'italics':__dirname+_0xc04f('0x46'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x3f86e1;}function getPDFDocDefinitionFromHTML(_0x2ab885,_0x293755){var _0x158dfa=util[_0xc04f('0x29')]('%s\x20#%d',_0x293755[_0xc04f('0x47')],_0x293755['interactionId']);var _0x3daccb=moment()['format']('YYYY-MM-DD')['toString']();var _0x43caa6=htmlToPdfmake(_0x2ab885,{'window':window,'tableAutoSize':!![]});return{'content':[_0x43caa6],'defaultStyle':{'font':_0xc04f('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','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':_0xc04f('0x48')}},'header':function(){return[{'text':_0xc04f('0x49'),'style':'header'}];},'footer':function(_0x425169,_0x8c5352){return[{'text':util[_0xc04f('0x29')](_0xc04f('0x4a'),_0x158dfa,_0x425169,_0x8c5352,_0x3daccb),'style':_0xc04f('0x24')}];}};}function writePDFDocument(_0x235a3a,_0x252150){return new Promise(function(_0x7ab04c,_0x5d8fa4){var _0x4a4b30=_0x235a3a[_0xc04f('0x4b')](fs[_0xc04f('0x4c')](_0x252150));_0x4a4b30['on']('finish',function(){_0x7ab04c(_0xc04f('0x4d'));});_0x4a4b30['on'](_0xc04f('0x4e'),function(_0x5261d9){_0x5d8fa4(_0x5261d9);});_0x235a3a[_0xc04f('0x4f')]();});}exports[_0xc04f('0x50')]=function(_0x46e349,_0x490e68){var _0x40adbf=getPDFPrinter();var _0x53fe52=getPDFDocDefinitionFromHTML(_0x46e349,_0x490e68);var _0x5733f7=_0x40adbf[_0xc04f('0x36')](_0x53fe52);return writePDFDocument(_0x5733f7,_0x490e68[_0xc04f('0x1')])['catch'](function(_0x18c29d){throw _0x18c29d;});}; \ No newline at end of file +var _0xc769=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','util','html-to-pdfmake','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','fill','length','auto','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','before','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','basename','.pdf','join','%s.%s','pdf','Setting','find','splitSizePdf','then','split','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','mkdirSync','all','flatten','%s%d.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','info','PDF','findOne'];(function(_0x2dc011,_0x98e4b7){var _0x57ec35=function(_0x12a1f9){while(--_0x12a1f9){_0x2dc011['push'](_0x2dc011['shift']());}};_0x57ec35(++_0x98e4b7);}(_0xc769,0xc0));var _0x9c76=function(_0x15922a,_0xa9c34f){_0x15922a=_0x15922a-0x0;var _0x1c6f96=_0xc769[_0x15922a];return _0x1c6f96;};'use strict';var _=require(_0x9c76('0x0'));var fs=require('fs');var util=require(_0x9c76('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x9c76('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x9c76('0x3'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var db=require(_0x9c76('0x4'))['db'];var dbH=require(_0x9c76('0x4'))['dbH'];var logger=require(_0x9c76('0x5'))(_0x9c76('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x9c76('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x9c76('0x7')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x16d795,_0xb92e74){var _0x2ef273={'status':_0x16d795};var _0x2e2130={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb92e74){_0x2ef273[_0x9c76('0x8')]=_0xb92e74;}return db[_0x9c76('0x9')][_0x9c76('0xa')](_0x2ef273,_0x2e2130);}function getHeaders(_0x3a3054){return _[_0x9c76('0xb')](_0x3a3054,function(_0x390219){return{'text':_0x390219,'style':_0x9c76('0xc')};});}function getRows(_0x3b0568,_0x4cc30d){return _[_0x9c76('0xb')](_0x4cc30d,function(_0x2c1ca8){return _(_0x2c1ca8)[_0x9c76('0xd')](_0x3b0568)['map'](function(_0x5f4524){return _0x5f4524?_[_0x9c76('0xe')](_0x5f4524):'';})['value']();});}function createTable(_0x57743d,_0xb623b7){var _0x1a3699={'widths':_[_0x9c76('0xf')](Array(_0x57743d[_0x9c76('0x10')]),0x91),'heights':function(_0x59c166){return _0x59c166===0x0?_0x9c76('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4e68d8=getHeaders(_0x57743d);_0x1a3699[_0x9c76('0x12')][_0x9c76('0x13')](_0x4e68d8);var _0x56337d=getRows(_0x57743d,_0xb623b7);_0x1a3699[_0x9c76('0x12')]=_0x1a3699['body'][_0x9c76('0x14')](_0x56337d);return _0x1a3699;}function createTables(_0x59c80c){var _0x1d6041=[];var _0x169ee8=_[_0x9c76('0x15')](Object['keys'](_0x59c80c[0x0]),0x5);_0x169ee8[_0x9c76('0x16')](function(_0x1f7f6c){_0x1d6041[_0x9c76('0x13')](createTable(_0x1f7f6c,_0x59c80c));});return _0x1d6041;}function getPDFDocDefinition(_0x2ccd1d){var _0xca5437=util[_0x9c76('0x17')](_0x9c76('0x18'),NAME,EXTRACTED_REPORT[_0x9c76('0x19')],moment(EXTRACTED_REPORT[_0x9c76('0x1a')])[_0x9c76('0x17')](FORMAT),moment(EXTRACTED_REPORT[_0x9c76('0x1b')])[_0x9c76('0x17')](FORMAT));var _0x2912a9=[];for(var _0xfa2f62=0x0;_0xfa2f62<_0x2ccd1d[_0x9c76('0x10')];_0xfa2f62++){var _0x3aba38=[];if(_0xfa2f62===0x0){_0x3aba38[_0x9c76('0x13')]({'text':_0xca5437,'style':'header'});}var _0xbf1a34={'table':_0x2ccd1d[_0xfa2f62]};if(_0xfa2f62>0x0){_0xbf1a34['pageBreak']=_0x9c76('0x1c');_0xbf1a34['margin']=[0x0,0x46,0x0,0x0];}_0x3aba38[_0x9c76('0x13')](_0xbf1a34);_0x2912a9[_0x9c76('0x13')](_0x3aba38);}return{'pageSize':'A4','pageOrientation':_0x9c76('0x1d'),'content':_0x2912a9,'footer':function(_0x1e053c,_0x9796d5){return{'text':_0x1e053c[_0x9c76('0xe')]()+_0x9c76('0x1e')+_0x9796d5,'style':_0x9c76('0x1f')};},'defaultStyle':{'font':_0x9c76('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9c76('0x21')},'footer':{'alignment':_0x9c76('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x594205){var _0xc8088=0x1388;var _0x236385;if(!_0x594205[0x0][_0x9c76('0x23')]){return analyticExtractedReport(_0x9c76('0x24'));}var _0x54c452=[];var _0x20b439=0x0;var _0x5925b6=!![];var _0x105d67=path['dirname'](PATH);var _0x45fc17=path[_0x9c76('0x25')](PATH,_0x9c76('0x26'));var _0x39bae0=path[_0x9c76('0x27')](_0x105d67,util[_0x9c76('0x17')](_0x9c76('0x28'),_0x45fc17,_0x9c76('0x29')));var _0x3e7fdd=![];return db[_0x9c76('0x2a')][_0x9c76('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x9c76('0x2c')]})['then'](function(_0x41101e){if(_0x41101e){_0x236385=_0x41101e;_0xc8088=_0x236385['splitSizePdf']||0x3e8;}})[_0x9c76('0x2d')](function(){if(_0x594205&&_0x594205[_0x9c76('0x10')]){var _0x5c403c=_0x594205[0x0][_0x9c76('0x23')]%(_0x20b439+_0xc8088);if(_0x236385[_0x9c76('0x2e')]){for(;_0x5925b6;_0x20b439+=_0xc8088,_0x5c403c=_0x594205[0x0][_0x9c76('0x23')]%(_0x20b439+_0xc8088)){if(_0x5c403c==0x0||_0x5c403c==_0x594205[0x0][_0x9c76('0x23')]){_0x5925b6=![];}_0x54c452[_0x9c76('0x13')](dbH[_0x9c76('0x2f')][_0x9c76('0x30')](util[_0x9c76('0x17')](_0x9c76('0x31'),QUERY,_0xc8088,_0x20b439),{'type':dbH[_0x9c76('0x2f')][_0x9c76('0x32')][_0x9c76('0x33')]}));}}else{_0x54c452[_0x9c76('0x13')](dbH['sequelize'][_0x9c76('0x30')](QUERY,{'type':dbH[_0x9c76('0x2f')][_0x9c76('0x32')][_0x9c76('0x33')]}));}}_0x3e7fdd=_0x236385[_0x9c76('0x2e')]&&_0x54c452[_0x9c76('0x10')]>0x1;if(!fs[_0x9c76('0x34')](path[_0x9c76('0x27')](_0x105d67,_0x45fc17))&&_0x3e7fdd){fs[_0x9c76('0x35')](path[_0x9c76('0x27')](_0x105d67,_0x45fc17));}return Promise[_0x9c76('0x36')](_0x54c452);})[_0x9c76('0x2d')](function(_0x7e651d){return createTables(_[_0x9c76('0x37')](_0x7e651d));})[_0x9c76('0x2d')](function(_0x424b62){var _0x1468a9=getPDFDocDefinition(_0x424b62);var _0x4a8c60=getPDFPrinter();var _0x27c5bd=_0x4a8c60['createPdfKitDocument'](_0x1468a9);if(_0x3e7fdd)_0x39bae0=path[_0x9c76('0x27')](_0x105d67,_0x45fc17,util['format'](_0x9c76('0x38'),_0x45fc17,index,'pdf'));return writePDFDocument(_0x27c5bd,_0x39bae0);})[_0x9c76('0x2d')](function(){if(!_0x3e7fdd)return;zipdir(path[_0x9c76('0x27')](_0x105d67,_0x45fc17),{'saveTo':path['join'](_0x105d67,util['format'](_0x9c76('0x28'),_0x45fc17,'zip'))},function(_0x5a06ed){if(_0x5a06ed)throw _0x5a06ed;return;});})[_0x9c76('0x2d')](function(){if(!_0x3e7fdd)return;rimraf(path['join'](_0x105d67,_0x45fc17),function(){});})[_0x9c76('0x2d')](function(){logger['info'](util['format'](_0x9c76('0x39'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x9c76('0x3a'),_0x3e7fdd?util[_0x9c76('0x17')]('%s.%s',_0x45fc17,_0x3e7fdd?_0x9c76('0x3b'):_0x9c76('0x29')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9c76('0x3c')](util[_0x9c76('0x17')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9c76('0x3d')));return db[_0x9c76('0x9')][_0x9c76('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9c76('0x2d')](function(_0x1cc73f){EXTRACTED_REPORT=_0x1cc73f;return dbH['sequelize'][_0x9c76('0x30')](util[_0x9c76('0x17')](_0x9c76('0x3f'),QUERY),{'type':dbH[_0x9c76('0x2f')]['QueryTypes'][_0x9c76('0x33')]});})['then'](extractReport)[_0x9c76('0x40')](function(_0x2a9cd2){logger['info'](util['format'](_0x9c76('0x41'),EXTRACTED_REPORT_ID,'PDF'),util[_0x9c76('0x42')](_0x2a9cd2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9c76('0x43'));})[_0x9c76('0x44')](function(){process[_0x9c76('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1024fc=new PdfPrinter({'Arial':{'normal':__dirname+_0x9c76('0x46'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9c76('0x47')}});return _0x1024fc;}function getPDFDocDefinitionFromHTML(_0x40f968,_0x226077){var _0x1b37ea=util[_0x9c76('0x17')](_0x9c76('0x48'),_0x226077[_0x9c76('0x49')],_0x226077['interactionId']);var _0x1beb20=moment()[_0x9c76('0x17')](_0x9c76('0x4a'))[_0x9c76('0xe')]();var _0x5c126f=htmlToPdfmake(_0x40f968,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5c126f],'defaultStyle':{'font':_0x9c76('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9c76('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9c76('0x4b'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9c76('0x4b')}},'header':function(){return[{'text':_0x9c76('0x4c'),'style':_0x9c76('0x4d')}];},'footer':function(_0x46cc05,_0x9d7548){return[{'text':util[_0x9c76('0x17')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x1b37ea,_0x46cc05,_0x9d7548,_0x1beb20),'style':_0x9c76('0x1f')}];}};}function writePDFDocument(_0x546771,_0x482aad){return new Promise(function(_0x3f5d50,_0x570875){var _0x4f5837=_0x546771[_0x9c76('0x4e')](fs[_0x9c76('0x4f')](_0x482aad));_0x4f5837['on'](_0x9c76('0x50'),function(){_0x3f5d50('finish');});_0x4f5837['on'](_0x9c76('0x51'),function(_0x36468a){_0x570875(_0x36468a);});_0x546771[_0x9c76('0x52')]();});}exports[_0x9c76('0x53')]=function(_0x48d533,_0x21358e){var _0x5e52be=getPDFPrinter();var _0x225416=getPDFDocDefinitionFromHTML(_0x48d533,_0x21358e);var _0x119a6a=_0x5e52be['createPdfKitDocument'](_0x225416);return writePDFDocument(_0x119a6a,_0x21358e[_0x9c76('0x54')])['catch'](function(_0xb7e6c7){throw _0xb7e6c7;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 4e7455a..e870970 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 _0xd3fc=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','push','dirname','basename','.xlsx','mkdirSync','each','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','rimraf','../../mysqldb','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','then','sequelize','query'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xd3fc,0xf7));var _0xcd3f=function(_0x175a50,_0x55b532){_0x175a50=_0x175a50-0x0;var _0x1cba0a=_0xd3fc[_0x175a50];return _0x1cba0a;};'use strict';var util=require(_0xcd3f('0x0'));var path=require(_0xcd3f('0x1'));var _=require(_0xcd3f('0x2'));var fs=require('fs');var json2xls=require(_0xcd3f('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xcd3f('0x4'));var db=require(_0xcd3f('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xcd3f('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcd3f('0x7')][0x2]);var QUERY=process[_0xcd3f('0x7')][0x3];var PATH=process[_0xcd3f('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x58888d,_0x5c00f1){var _0x3994ac={'status':_0x58888d};var _0x525dd4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c00f1){_0x3994ac[_0xcd3f('0x8')]=_0x5c00f1;}return db['AnalyticExtractedReport'][_0xcd3f('0x9')](_0x3994ac,_0x525dd4);}function main(){var _0x5b44b7=0x1388;var _0x333f24;logger[_0xcd3f('0xa')](util[_0xcd3f('0xb')](_0xcd3f('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xcd3f('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xcd3f('0xe')](function(_0x202940){if(_0x202940){_0x333f24=_0x202940;_0x5b44b7=_0x333f24['splitSizeXlsx']||0x1388;}})[_0xcd3f('0xe')](function(){return dbH[_0xcd3f('0xf')][_0xcd3f('0x10')](util['format'](_0xcd3f('0x11'),QUERY),{'type':dbH[_0xcd3f('0xf')][_0xcd3f('0x12')][_0xcd3f('0x13')]});})['then'](function(_0x382d25){if(!_0x382d25[0x0][_0xcd3f('0x14')]){return analyticExtractedReport(_0xcd3f('0x15'));}var _0x3599e1=[];var _0x223043=0x0;var _0x5515bd=!![];if(_0x333f24[_0xcd3f('0x16')]){if(_0x382d25&&_0x382d25[_0xcd3f('0x17')]){var _0x593bec=_0x382d25[0x0][_0xcd3f('0x14')]%(_0x223043+_0x5b44b7);for(;_0x5515bd;_0x223043+=_0x5b44b7,_0x593bec=_0x382d25[0x0]['num']%(_0x223043+_0x5b44b7)){if(_0x593bec==0x0||_0x593bec==_0x382d25[0x0][_0xcd3f('0x14')]){_0x5515bd=![];}_0x3599e1[_0xcd3f('0x18')](dbH[_0xcd3f('0xf')][_0xcd3f('0x10')](util[_0xcd3f('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5b44b7,_0x223043),{'type':dbH[_0xcd3f('0xf')]['QueryTypes'][_0xcd3f('0x13')]}));}}}else{_0x3599e1[_0xcd3f('0x18')](dbH[_0xcd3f('0xf')][_0xcd3f('0x10')](QUERY,{'type':dbH[_0xcd3f('0xf')][_0xcd3f('0x12')][_0xcd3f('0x13')]}));}var _0x384cab=path[_0xcd3f('0x19')](PATH);var _0x181775=path[_0xcd3f('0x1a')](PATH,_0xcd3f('0x1b'));var _0x1a7fed=_0x333f24['split']&&_0x3599e1[_0xcd3f('0x17')]>0x1;var _0xcc96ca=[];if(!fs['existsSync'](path['join'](_0x384cab,_0x181775))&&_0x1a7fed){fs[_0xcd3f('0x1c')](path['join'](_0x384cab,_0x181775));}return BPromise[_0xcd3f('0x1d')](_0x3599e1,function(_0x3a03e4){_0xcc96ca[_0xcd3f('0x18')](_0x3a03e4);})[_0xcd3f('0xe')](function(){for(var _0x151e39=0x0;_0x151e39<_0xcc96ca['length'];_0x151e39+=0x1){var _0x4261c2;var _0x11cc19=_0xcc96ca[_0x151e39];if(_0x1a7fed){_0x4261c2=path[_0xcd3f('0x1e')](_0x384cab,_0x181775,util[_0xcd3f('0xb')](_0xcd3f('0x1f'),_0x181775,_0x151e39,_0xcd3f('0x20')));}else{_0x4261c2=path[_0xcd3f('0x1e')](_0x384cab,util[_0xcd3f('0xb')]('%s.%s',_0x181775,'xlsx'));}fs[_0xcd3f('0x21')](_0x4261c2,json2xls(_0x11cc19),_0xcd3f('0x22'));}})[_0xcd3f('0xe')](function(){if(_0x1a7fed){zipdir(path['join'](_0x384cab,_0x181775),{'saveTo':path[_0xcd3f('0x1e')](_0x384cab,util[_0xcd3f('0xb')](_0xcd3f('0x23'),_0x181775,_0xcd3f('0x24')))},function(_0x14e624,_0x28267e){});rimraf(path[_0xcd3f('0x1e')](_0x384cab,_0x181775),function(){});}})['then'](function(){logger[_0xcd3f('0xa')](util[_0xcd3f('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcd3f('0x25')));return analyticExtractedReport(_0xcd3f('0x26'),_0x1a7fed?util[_0xcd3f('0xb')](_0xcd3f('0x23'),_0x181775,_0x1a7fed?'zip':_0xcd3f('0x20')):null);});})[_0xcd3f('0x27')](function(_0x3cbb2c){logger[_0xcd3f('0xa')](util[_0xcd3f('0xb')](_0xcd3f('0x28'),EXTRACTED_REPORT_ID,_0xcd3f('0x25')),util[_0xcd3f('0x29')](_0x3cbb2c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcd3f('0x2a'));})[_0xcd3f('0x2b')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x32b1=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','length','existsSync','join','mkdirSync','xlsx','%s.%s','writeFileSync','binary','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0x32b1,0x15d));var _0x132b=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x32b1[_0x337748];return _0x3bb03f;};'use strict';var util=require(_0x132b('0x0'));var path=require(_0x132b('0x1'));var _=require(_0x132b('0x2'));var fs=require('fs');var json2xls=require(_0x132b('0x3'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x132b('0x4'))['db'];var dbH=require(_0x132b('0x4'))[_0x132b('0x5')];var logger=require(_0x132b('0x6'))(_0x132b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x132b('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x132b('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5d830c,_0x1e6b4c){var _0x46cde1={'status':_0x5d830c};var _0x1a402f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1e6b4c){_0x46cde1[_0x132b('0x9')]=_0x1e6b4c;}return db['AnalyticExtractedReport'][_0x132b('0xa')](_0x46cde1,_0x1a402f);}function main(){var _0x5e56fa=0x1388;var _0x453acc;logger[_0x132b('0xb')](util[_0x132b('0xc')](_0x132b('0xd'),EXTRACTED_REPORT_ID,_0x132b('0xe')));return db[_0x132b('0xf')][_0x132b('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x132b('0x11'),_0x132b('0x12')]})[_0x132b('0x13')](function(_0xec832e){if(_0xec832e){_0x453acc=_0xec832e;_0x5e56fa=_0x453acc['splitSizeXlsx']||0x1388;}})[_0x132b('0x13')](function(){return dbH['sequelize'][_0x132b('0x14')](util['format'](_0x132b('0x15'),QUERY),{'type':dbH[_0x132b('0x16')][_0x132b('0x17')][_0x132b('0x18')]});})[_0x132b('0x13')](function(_0x28bd35){if(!_0x28bd35[0x0][_0x132b('0x19')]){return analyticExtractedReport(_0x132b('0x1a'));}var _0x26abdf=[];var _0x161529=0x0;var _0x52e340=!![];if(_0x453acc[_0x132b('0x11')]){if(_0x28bd35&&_0x28bd35['length']){var _0x3845ea=_0x28bd35[0x0][_0x132b('0x19')]%(_0x161529+_0x5e56fa);for(;_0x52e340;_0x161529+=_0x5e56fa,_0x3845ea=_0x28bd35[0x0][_0x132b('0x19')]%(_0x161529+_0x5e56fa)){if(_0x3845ea==0x0||_0x3845ea==_0x28bd35[0x0][_0x132b('0x19')]){_0x52e340=![];}_0x26abdf[_0x132b('0x1b')](dbH[_0x132b('0x16')]['query'](util[_0x132b('0xc')](_0x132b('0x1c'),QUERY,_0x5e56fa,_0x161529),{'type':dbH[_0x132b('0x16')][_0x132b('0x17')][_0x132b('0x18')]}));}}}else{_0x26abdf[_0x132b('0x1b')](dbH[_0x132b('0x16')][_0x132b('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x132b('0x18')]}));}var _0x13c0ff=path['dirname'](PATH);var _0x2271c1=path[_0x132b('0x1d')](PATH,_0x132b('0x1e'));var _0x105866=_0x453acc[_0x132b('0x11')]&&_0x26abdf[_0x132b('0x1f')]>0x1;var _0x4d90d4=[];if(!fs[_0x132b('0x20')](path[_0x132b('0x21')](_0x13c0ff,_0x2271c1))&&_0x105866){fs[_0x132b('0x22')](path[_0x132b('0x21')](_0x13c0ff,_0x2271c1));}return BPromise['each'](_0x26abdf,function(_0x5afcef){_0x4d90d4[_0x132b('0x1b')](_0x5afcef);})[_0x132b('0x13')](function(){for(var _0x3369ae=0x0;_0x3369ae<_0x4d90d4[_0x132b('0x1f')];_0x3369ae+=0x1){var _0x6a452e;var _0x48747c=_0x4d90d4[_0x3369ae];if(_0x105866){_0x6a452e=path['join'](_0x13c0ff,_0x2271c1,util[_0x132b('0xc')]('%s%d.%s',_0x2271c1,_0x3369ae,_0x132b('0x23')));}else{_0x6a452e=path[_0x132b('0x21')](_0x13c0ff,util['format'](_0x132b('0x24'),_0x2271c1,'xlsx'));}fs[_0x132b('0x25')](_0x6a452e,json2xls(_0x48747c),_0x132b('0x26'));}})[_0x132b('0x13')](function(){if(_0x105866){zipdir(path[_0x132b('0x21')](_0x13c0ff,_0x2271c1),{'saveTo':path[_0x132b('0x21')](_0x13c0ff,util[_0x132b('0xc')](_0x132b('0x24'),_0x2271c1,'zip'))},function(_0x553c9c,_0x1bd8b9){});rimraf(path['join'](_0x13c0ff,_0x2271c1),function(){});}})['then'](function(){logger[_0x132b('0xb')](util[_0x132b('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x105866?util[_0x132b('0xc')](_0x132b('0x24'),_0x2271c1,_0x105866?_0x132b('0x27'):'xlsx'):null);});})[_0x132b('0x28')](function(_0x201e11){logger[_0x132b('0xb')](util[_0x132b('0xc')](_0x132b('0x29'),EXTRACTED_REPORT_ID,_0x132b('0xe')),util[_0x132b('0x2a')](_0x201e11,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x132b('0x2b'));})[_0x132b('0x2c')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 93101e5..4d70444 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 _0x22d3=['extensions','CDR(routeid)=','outbound','cutdigits','${EXTEN}','context','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','transaction','destroy','then','bulkCreate','sortBy','error','lodash','models','Interval','findAll','VoiceExtension','uniq','filter','exten','queue','hasOwnProperty','priority','extension','push','type','Set','format','VoiceExtensionId','inbound'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0x22d3,0xee));var _0x322d=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x22d3[_0x3a04ab];return _0x4bff6d;};'use strict';var _=require(_0x322d('0x0'));var util=require('util');function rewrite(_0x64246f,_0x278131){var _0x1394c5=this;return _0x64246f[_0x322d('0x1')][_0x322d('0x2')][_0x322d('0x3')]({'raw':!![]})['then'](function(_0xe1cafb){_0x1394c5['intervals']=_0xe1cafb;return _0x64246f['models'][_0x322d('0x4')][_0x322d('0x3')]({'where':{'IntervalId':_0x278131['IntervalId']},'raw':!![]});})['then'](function(_0x432dce){return _0x64246f['models']['VoiceExtension'][_0x322d('0x3')]({'where':{'exten':{'$in':_[_0x322d('0x5')](_['map'](_0x432dce,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x2fa9af){var _0x22673a=_[_0x322d('0x6')](_0x2fa9af,{'priority':'1'});var _0x1c79d1=_[_0x322d('0x6')](_0x2fa9af,{'isApp':0x1});var _0x2ad669=_['groupBy'](_0x1c79d1,_0x322d('0x7'));var _0x21dc74=[_0x322d('0x8'),'playback'];var _0x55cb86=[];var _0x6caf46=[];for(var _0x129a27 in _0x2ad669){if(_0x2ad669[_0x322d('0x9')](_0x129a27)){_0x1394c5[_0x322d('0xa')]=0x2;_0x1394c5['extensions']=[];_0x1394c5[_0x322d('0xb')]=_['find'](_0x22673a,{'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')]});_0x1394c5['extensions'][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':util[_0x322d('0xf')]('CDR(type)=%s',_0x2ad669[_0x129a27][0x0][_0x322d('0xd')]),'context':_0x2ad669[_0x129a27][0x0]['context'],'exten':_0x2ad669[_0x129a27][0x0]['exten'],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});if(_0x2ad669[_0x129a27][0x0][_0x322d('0xd')]===_0x322d('0x11')){_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':'Set','appdata':_0x322d('0x13')+_0x2ad669[_0x129a27][0x0][_0x322d('0x10')],'context':_0x2ad669[_0x129a27][0x0]['context'],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});}else if(_0x2ad669[_0x129a27][0x0][_0x322d('0xd')]===_0x322d('0x14')){if(_0x1394c5[_0x322d('0xb')]){_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0]['type'],'app':_0x322d('0xe'),'appdata':'CDR(destination)='+(_0x1394c5['extension'][_0x322d('0x15')]?'${EXTEN:'+_0x1394c5[_0x322d('0xb')][_0x322d('0x15')]+'}':_0x322d('0x16')),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5['priority']++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});}_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0]['type'],'app':'Set','appdata':_0x322d('0x13')+_0x2ad669[_0x129a27][0x0]['VoiceExtensionId'],'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0]['exten'],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});var _0x2ae898=_0x1394c5[_0x322d('0xa')]++;_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0x18'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2ae898+0x2)+_0x322d('0x19')+(_0x2ae898+0x1)+')','context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x2ae898,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});if(_0x1394c5[_0x322d('0xb')]){_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x1394c5[_0x322d('0xb')][_0x322d('0x15')]?_0x322d('0x1a')+_0x1394c5['extension'][_0x322d('0x15')]+'}':_0x322d('0x1b'),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});}_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x1c')+_0x2ad669[_0x129a27][0x0][_0x322d('0x10')],'context':_0x2ad669[_0x129a27][0x0]['context'],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});if(_0x1394c5['extension']&&_0x1394c5['extension'][_0x322d('0x9')](_0x322d('0x1d'))&&_0x1394c5[_0x322d('0xb')][_0x322d('0x1d')]!==_0x322d('0x1e')){_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x1f'),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1394c5[_0x322d('0xb')]['recordingFormat']||'wav','context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});}}_0x1394c5[_0x322d('0x12')][_0x322d('0xc')]({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x20'),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']});_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5['priority']++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0]['type'],'app':_0x322d('0xe'),'appdata':_0x322d('0x21'),'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'exten':_0x2ad669[_0x129a27][0x0][_0x322d('0x7')],'priority':_0x1394c5[_0x322d('0xa')]++,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});for(var _0x30198a=0x0,_0x1b2b58=0x0;_0x30198a<_0x2ad669[_0x129a27][_0x322d('0x22')];_0x30198a+=0x1,_0x1b2b58=0x0){var _0x4933f6=_0x2ad669[_0x129a27][_0x30198a];if(_0x4933f6[_0x322d('0xd')]){_0x4933f6[_0x322d('0xd')]=_0x4933f6[_0x322d('0xd')][_0x322d('0x23')]();}var _0x4d03b7=[];var _0x27dd88=[];delete _0x4933f6['id'];delete _0x4933f6[_0x322d('0x24')];delete _0x4933f6[_0x322d('0x25')];var _0x1b10f3=_0x4933f6[_0x322d('0x26')]!==_0x322d('0x27')?[_0x4933f6['interval']]:_0x4933f6[_0x322d('0x28')]?_[_0x322d('0x29')](_[_0x322d('0x6')](_0x1394c5[_0x322d('0x2a')],{'IntervalId':_0x4933f6['IntervalId']}),_0x322d('0x26')):[];if(_0x4933f6[_0x322d('0x9')](_0x322d('0x2b'))){if(_0x4933f6[_0x322d('0x2b')]&&_0x4933f6[_0x322d('0x2b')]!=='--'){_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x2c')+_0x4933f6['tag'],'context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3['length']+_0x1394c5['priority']+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});}}if(_0x4933f6[_0x322d('0xd')]===_0x322d('0x14')&&_0x4933f6[_0x322d('0x9')]('callerID')){if(_0x4933f6[_0x322d('0x2d')]){_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0x18'),'appdata':_0x322d('0x2e')+_0x4933f6[_0x322d('0x2d')]+')','context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3['length']+_0x1394c5['priority']+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});}else{_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':'ExecIf','appdata':_0x322d('0x2f'),'context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6['exten'],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5[_0x322d('0xa')]+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});}}if(_0x4933f6[_0x322d('0x9')](_0x322d('0x30'))){if(_0x21dc74[_0x322d('0x31')](_0x4933f6['app'][_0x322d('0x23')]())>=0x0&&_0x4933f6[_0x322d('0x32')]!==_0x322d('0x33')){if(_0x4933f6[_0x322d('0x30')]){_0x4d03b7['push']({'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0x18'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5[_0x322d('0xa')]+_0x1b2b58++,'VoiceExtensionId':_0x4933f6['VoiceExtensionId']});_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6['type'],'app':_0x322d('0xe'),'appdata':_0x322d('0x34'),'context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5['priority']+_0x1b2b58++,'VoiceExtensionId':_0x4933f6['VoiceExtensionId']});}else{_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6['exten'],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5[_0x322d('0xa')]+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});_0x4d03b7[_0x322d('0xc')]({'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0xe'),'appdata':_0x322d('0x35'),'context':_0x4933f6[_0x322d('0x17')],'exten':_0x4933f6[_0x322d('0x7')],'priority':_0x1b10f3[_0x322d('0x22')]+_0x1394c5[_0x322d('0xa')]+_0x1b2b58++,'VoiceExtensionId':_0x4933f6[_0x322d('0x10')]});}}}for(var _0xe8f97=0x0;_0xe8f97<_0x1b10f3[_0x322d('0x22')];_0xe8f97+=0x1){var _0x3857b0=_0x1394c5[_0x322d('0xa')]+_0x1b10f3[_0x322d('0x22')];var _0x2611a2=_0xe8f97===_0x1b10f3[_0x322d('0x22')]-0x1?_0x1394c5[_0x322d('0xa')]+_0x4d03b7['length']+_0x27dd88[_0x322d('0x22')]+0x2:_0x1394c5['priority']+_0xe8f97+0x1;_0x4d03b7[_0x322d('0x36')](_0xe8f97,0x0,{'type':_0x4933f6[_0x322d('0xd')],'app':_0x322d('0x37'),'appdata':_0x1b10f3[_0xe8f97]+'?'+_0x4933f6[_0x322d('0x17')]+_0x322d('0x38')+_0x3857b0+':'+_0x4933f6['context']+_0x322d('0x38')+_0x2611a2,'exten':_0x4933f6[_0x322d('0x7')],'context':_0x4933f6[_0x322d('0x17')],'priority':_0x1394c5['priority']+_0xe8f97,'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});}_0x4933f6[_0x322d('0xa')]=_0x4d03b7[_0x322d('0x22')]?_['last'](_0x4d03b7)[_0x322d('0xa')]+0x1:_0x1394c5[_0x322d('0xa')];_0x1394c5[_0x322d('0xa')]=(_0x27dd88['length']?_['last'](_0x27dd88)[_0x322d('0xa')]:_0x4933f6[_0x322d('0xa')])+0x1;_0x1394c5[_0x322d('0x12')]=_[_0x322d('0x39')](_0x1394c5[_0x322d('0x12')],_0x4d03b7,[_0x4933f6],_0x27dd88);}_0x1394c5[_0x322d('0x12')]['push']({'type':_0x2ad669[_0x129a27][0x0][_0x322d('0xd')],'app':'Hangup','exten':_0x2ad669[_0x129a27][0x0]['exten'],'context':_0x2ad669[_0x129a27][0x0][_0x322d('0x17')],'priority':_0x1394c5['priority'],'VoiceExtensionId':_0x2ad669[_0x129a27][0x0][_0x322d('0x10')]});_0x55cb86['push'](_0x2ad669[_0x129a27][0x0]['VoiceExtensionId']);_0x6caf46=_[_0x322d('0x39')](_0x6caf46,_0x1394c5[_0x322d('0x12')]);}}return _0x64246f[_0x322d('0x3a')](function(_0x24f6c3){return _0x64246f[_0x322d('0x1')][_0x322d('0x4')][_0x322d('0x3b')]({'where':{'VoiceExtensionId':{'$in':_0x55cb86}},'transaction':_0x24f6c3})[_0x322d('0x3c')](function(_0x345525){return _0x64246f[_0x322d('0x1')][_0x322d('0x4')][_0x322d('0x3d')](_[_0x322d('0x3e')](_0x6caf46,_0x322d('0xa')),{'transaction':_0x24f6c3});});});})['catch'](function(_0x4cab70){console[_0x322d('0x3f')](_0x4cab70);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x358d=['toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','error','rewrite','lodash','util','models','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','playback','priority','find','extensions','push','type','format','VoiceExtensionId','inbound','Set','CDR(routeid)=','context','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','hasOwnProperty','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer'];(function(_0x3ad78c,_0x3b911b){var _0x1eb20c=function(_0xf2c686){while(--_0xf2c686){_0x3ad78c['push'](_0x3ad78c['shift']());}};_0x1eb20c(++_0x3b911b);}(_0x358d,0xe8));var _0xd358=function(_0x20d970,_0x454832){_0x20d970=_0x20d970-0x0;var _0x5e9c45=_0x358d[_0x20d970];return _0x5e9c45;};'use strict';var _=require(_0xd358('0x0'));var util=require(_0xd358('0x1'));function rewrite(_0x4c9289,_0x1366ff){var _0x2b55ca=this;return _0x4c9289[_0xd358('0x2')]['Interval'][_0xd358('0x3')]({'raw':!![]})['then'](function(_0x1fec93){_0x2b55ca[_0xd358('0x4')]=_0x1fec93;return _0x4c9289[_0xd358('0x2')][_0xd358('0x5')][_0xd358('0x3')]({'where':{'IntervalId':_0x1366ff[_0xd358('0x6')]},'raw':!![]});})[_0xd358('0x7')](function(_0x2e95f9){return _0x4c9289[_0xd358('0x2')][_0xd358('0x5')]['findAll']({'where':{'exten':{'$in':_[_0xd358('0x8')](_[_0xd358('0x9')](_0x2e95f9,'exten'))}},'order':[{'raw':_0xd358('0xa')}],'raw':!![]});})['then'](function(_0x1494ae){var _0x1a9ca1=_[_0xd358('0xb')](_0x1494ae,{'priority':'1'});var _0x577969=_['filter'](_0x1494ae,{'isApp':0x1});var _0x3accd6=_['groupBy'](_0x577969,_0xd358('0xc'));var _0x21073e=[_0xd358('0xd'),_0xd358('0xe')];var _0x1d1bd9=[];var _0x18cc8c=[];for(var _0x5a1c9c in _0x3accd6){if(_0x3accd6['hasOwnProperty'](_0x5a1c9c)){_0x2b55ca[_0xd358('0xf')]=0x2;_0x2b55ca['extensions']=[];_0x2b55ca['extension']=_[_0xd358('0x10')](_0x1a9ca1,{'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')]});_0x2b55ca[_0xd358('0x11')][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':'Set','appdata':util[_0xd358('0x14')]('CDR(type)=%s',_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')]),'context':_0x3accd6[_0x5a1c9c][0x0]['context'],'exten':_0x3accd6[_0x5a1c9c][0x0]['exten'],'priority':_0x2b55ca['priority']++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x15')]});if(_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')]===_0xd358('0x16')){_0x2b55ca[_0xd358('0x11')]['push']({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x18')+_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId'],'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2b55ca[_0xd358('0xf')]++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId']});}else if(_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')]===_0xd358('0x1a')){if(_0x2b55ca[_0xd358('0x1b')]){_0x2b55ca[_0xd358('0x11')][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x1c')+(_0x2b55ca['extension'][_0xd358('0x1d')]?_0xd358('0x1e')+_0x2b55ca[_0xd358('0x1b')]['cutdigits']+'}':_0xd358('0x1f')),'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2b55ca[_0xd358('0xf')]++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x15')]});}_0x2b55ca[_0xd358('0x11')]['push']({'type':_0x3accd6[_0x5a1c9c][0x0]['type'],'app':_0xd358('0x17'),'appdata':_0xd358('0x18')+_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId'],'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2b55ca[_0xd358('0xf')]++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x15')]});var _0x2188af=_0x2b55ca[_0xd358('0xf')]++;_0x2b55ca[_0xd358('0x11')][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0]['type'],'app':_0xd358('0x20'),'appdata':_0xd358('0x21')+(_0x2188af+0x2)+_0xd358('0x22')+(_0x2188af+0x1)+')','context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2188af,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId']});if(_0x2b55ca[_0xd358('0x1b')]){_0x2b55ca[_0xd358('0x11')][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0x2b55ca[_0xd358('0x1b')]['cutdigits']?_0xd358('0x23')+_0x2b55ca[_0xd358('0x1b')][_0xd358('0x1d')]+'}':_0xd358('0x24'),'context':_0x3accd6[_0x5a1c9c][0x0]['context'],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2b55ca[_0xd358('0xf')]++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId']});}_0x2b55ca[_0xd358('0x11')][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x25')+_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId'],'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0]['exten'],'priority':_0x2b55ca[_0xd358('0xf')]++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x15')]});if(_0x2b55ca[_0xd358('0x1b')]&&_0x2b55ca[_0xd358('0x1b')]['hasOwnProperty'](_0xd358('0x26'))&&_0x2b55ca[_0xd358('0x1b')]['recordingFormat']!==_0xd358('0x27')){_0x2b55ca[_0xd358('0x11')]['push']({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x28'),'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2b55ca[_0xd358('0xf')]++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x15')]});_0x2b55ca['extensions'][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x2b55ca[_0xd358('0x1b')][_0xd358('0x26')]||_0xd358('0x29'),'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2b55ca[_0xd358('0xf')]++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x15')]});}}_0x2b55ca[_0xd358('0x11')]['push']({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x2a'),'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2b55ca['priority']++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId']});_0x2b55ca[_0xd358('0x11')][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0]['exten'],'priority':_0x2b55ca[_0xd358('0xf')]++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId']});_0x2b55ca[_0xd358('0x11')][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x2b'),'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'priority':_0x2b55ca['priority']++,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId']});for(var _0x8ae423=0x0,_0x2bfb35=0x0;_0x8ae423<_0x3accd6[_0x5a1c9c][_0xd358('0x2c')];_0x8ae423+=0x1,_0x2bfb35=0x0){var _0x4f5848=_0x3accd6[_0x5a1c9c][_0x8ae423];if(_0x4f5848[_0xd358('0x13')]){_0x4f5848[_0xd358('0x13')]=_0x4f5848[_0xd358('0x13')]['toLowerCase']();}var _0x2d764c=[];var _0x33d5a3=[];delete _0x4f5848['id'];delete _0x4f5848[_0xd358('0x2d')];delete _0x4f5848[_0xd358('0x2e')];var _0x3de42c=_0x4f5848[_0xd358('0x2f')]!==_0xd358('0x30')?[_0x4f5848['interval']]:_0x4f5848['IntervalId']?_[_0xd358('0x9')](_['filter'](_0x2b55ca[_0xd358('0x4')],{'IntervalId':_0x4f5848[_0xd358('0x6')]}),_0xd358('0x2f')):[];if(_0x4f5848[_0xd358('0x31')](_0xd358('0x32'))){if(_0x4f5848['tag']&&_0x4f5848[_0xd358('0x32')]!=='--'){_0x2d764c[_0xd358('0x12')]({'type':_0x4f5848[_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x33')+_0x4f5848[_0xd358('0x32')],'context':_0x4f5848[_0xd358('0x19')],'exten':_0x4f5848['exten'],'priority':_0x3de42c[_0xd358('0x2c')]+_0x2b55ca[_0xd358('0xf')]+_0x2bfb35++,'VoiceExtensionId':_0x4f5848[_0xd358('0x15')]});}}if(_0x4f5848[_0xd358('0x13')]===_0xd358('0x1a')&&_0x4f5848['hasOwnProperty'](_0xd358('0x34'))){if(_0x4f5848[_0xd358('0x34')]){_0x2d764c[_0xd358('0x12')]({'type':_0x4f5848[_0xd358('0x13')],'app':_0xd358('0x20'),'appdata':_0xd358('0x35')+_0x4f5848[_0xd358('0x34')]+')','context':_0x4f5848[_0xd358('0x19')],'exten':_0x4f5848['exten'],'priority':_0x3de42c['length']+_0x2b55ca[_0xd358('0xf')]+_0x2bfb35++,'VoiceExtensionId':_0x4f5848[_0xd358('0x15')]});}else{_0x2d764c[_0xd358('0x12')]({'type':_0x4f5848[_0xd358('0x13')],'app':_0xd358('0x20'),'appdata':_0xd358('0x36'),'context':_0x4f5848['context'],'exten':_0x4f5848[_0xd358('0xc')],'priority':_0x3de42c[_0xd358('0x2c')]+_0x2b55ca['priority']+_0x2bfb35++,'VoiceExtensionId':_0x4f5848[_0xd358('0x15')]});}}if(_0x4f5848[_0xd358('0x31')](_0xd358('0x37'))){if(_0x21073e['indexOf'](_0x4f5848['app'][_0xd358('0x38')]())>=0x0&&_0x4f5848['appType']!==_0xd358('0x39')){if(_0x4f5848[_0xd358('0x37')]){_0x2d764c[_0xd358('0x12')]({'type':_0x4f5848[_0xd358('0x13')],'app':_0xd358('0x20'),'appdata':_0xd358('0x3a'),'context':_0x4f5848[_0xd358('0x19')],'exten':_0x4f5848[_0xd358('0xc')],'priority':_0x3de42c[_0xd358('0x2c')]+_0x2b55ca['priority']+_0x2bfb35++,'VoiceExtensionId':_0x4f5848[_0xd358('0x15')]});_0x2d764c[_0xd358('0x12')]({'type':_0x4f5848[_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x3b'),'context':_0x4f5848[_0xd358('0x19')],'exten':_0x4f5848[_0xd358('0xc')],'priority':_0x3de42c['length']+_0x2b55ca[_0xd358('0xf')]+_0x2bfb35++,'VoiceExtensionId':_0x4f5848['VoiceExtensionId']});}else{_0x2d764c[_0xd358('0x12')]({'type':_0x4f5848[_0xd358('0x13')],'app':_0xd358('0x20'),'appdata':_0xd358('0x3c'),'context':_0x4f5848[_0xd358('0x19')],'exten':_0x4f5848[_0xd358('0xc')],'priority':_0x3de42c['length']+_0x2b55ca['priority']+_0x2bfb35++,'VoiceExtensionId':_0x4f5848[_0xd358('0x15')]});_0x2d764c[_0xd358('0x12')]({'type':_0x4f5848[_0xd358('0x13')],'app':_0xd358('0x17'),'appdata':_0xd358('0x3d'),'context':_0x4f5848[_0xd358('0x19')],'exten':_0x4f5848[_0xd358('0xc')],'priority':_0x3de42c[_0xd358('0x2c')]+_0x2b55ca['priority']+_0x2bfb35++,'VoiceExtensionId':_0x4f5848[_0xd358('0x15')]});}}}for(var _0xeb3b4e=0x0;_0xeb3b4e<_0x3de42c[_0xd358('0x2c')];_0xeb3b4e+=0x1){var _0x5c067a=_0x2b55ca[_0xd358('0xf')]+_0x3de42c['length'];var _0x71fe25=_0xeb3b4e===_0x3de42c[_0xd358('0x2c')]-0x1?_0x2b55ca[_0xd358('0xf')]+_0x2d764c['length']+_0x33d5a3['length']+0x2:_0x2b55ca[_0xd358('0xf')]+_0xeb3b4e+0x1;_0x2d764c[_0xd358('0x3e')](_0xeb3b4e,0x0,{'type':_0x4f5848[_0xd358('0x13')],'app':'GotoIfTime','appdata':_0x3de42c[_0xeb3b4e]+'?'+_0x4f5848[_0xd358('0x19')]+',${EXTEN},'+_0x5c067a+':'+_0x4f5848[_0xd358('0x19')]+_0xd358('0x3f')+_0x71fe25,'exten':_0x4f5848[_0xd358('0xc')],'context':_0x4f5848[_0xd358('0x19')],'priority':_0x2b55ca['priority']+_0xeb3b4e,'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x15')]});}_0x4f5848['priority']=_0x2d764c[_0xd358('0x2c')]?_[_0xd358('0x40')](_0x2d764c)['priority']+0x1:_0x2b55ca[_0xd358('0xf')];_0x2b55ca['priority']=(_0x33d5a3[_0xd358('0x2c')]?_['last'](_0x33d5a3)[_0xd358('0xf')]:_0x4f5848['priority'])+0x1;_0x2b55ca['extensions']=_[_0xd358('0x41')](_0x2b55ca[_0xd358('0x11')],_0x2d764c,[_0x4f5848],_0x33d5a3);}_0x2b55ca[_0xd358('0x11')][_0xd358('0x12')]({'type':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x13')],'app':_0xd358('0x42'),'exten':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0xc')],'context':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x19')],'priority':_0x2b55ca[_0xd358('0xf')],'VoiceExtensionId':_0x3accd6[_0x5a1c9c][0x0][_0xd358('0x15')]});_0x1d1bd9[_0xd358('0x12')](_0x3accd6[_0x5a1c9c][0x0]['VoiceExtensionId']);_0x18cc8c=_[_0xd358('0x41')](_0x18cc8c,_0x2b55ca[_0xd358('0x11')]);}}return _0x4c9289[_0xd358('0x43')](function(_0x560cd2){return _0x4c9289[_0xd358('0x2')]['VoiceExtension'][_0xd358('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x1d1bd9}},'transaction':_0x560cd2})[_0xd358('0x7')](function(_0x286f86){return _0x4c9289[_0xd358('0x2')][_0xd358('0x5')]['bulkCreate'](_[_0xd358('0x45')](_0x18cc8c,_0xd358('0xf')),{'transaction':_0x560cd2});});});})['catch'](function(_0x2d3a21){console[_0xd358('0x46')](_0x2d3a21);});}exports[_0xd358('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 2dd7a41..cd2fa21 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 _0x00e7=['Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','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','ListId','CompanyId','length','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','insert','into','fromQuery','scheduledAt','createdAt','select','field','toString','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ContactId','id\x20IN\x20?','str','cm_hopper','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','always','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','resume','resolve','emit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','Error\x20executing\x20contact\x20csv\x20import:','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split'];(function(_0x413877,_0x1f240a){var _0x542f81=function(_0x571a00){while(--_0x571a00){_0x413877['push'](_0x413877['shift']());}};_0x542f81(++_0x1f240a);}(_0x00e7,0xbc));var _0x700e=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0x00e7[_0x1ae31c];return _0x19519d;};'use strict';var BPromise=require(_0x700e('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x700e('0x1'));var Papa=require('papaparse');var Redis=require(_0x700e('0x2'));var db=require(_0x700e('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x700e('0x4'))(_0x700e('0x5'));config[_0x700e('0x6')]=_[_0x700e('0x7')](config[_0x700e('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x700e('0x8'))(new Redis(config[_0x700e('0x6')]));require(_0x700e('0x9'))[_0x700e('0xa')](socket);try{if(!process[_0x700e('0xb')][0x2]||process[_0x700e('0xb')][0x2]===_0x700e('0xc')||process[_0x700e('0xb')][0x2]==='null'){throw new Error(_0x700e('0xd'));}var FILEPATH=process[_0x700e('0xb')][0x2];if(!process[_0x700e('0xb')][0x3]||process[_0x700e('0xb')][0x3]===_0x700e('0xc')||process[_0x700e('0xb')][0x3]===_0x700e('0xe')||!process[_0x700e('0xb')][0x4]||process[_0x700e('0xb')][0x4]===_0x700e('0xc')||process[_0x700e('0xb')][0x4]==='null'){throw new Error(_0x700e('0xf'));}var FIELDS=_[_0x700e('0x10')](process[_0x700e('0xb')][0x3][_0x700e('0x11')](','),process[_0x700e('0xb')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x700e('0xc')||process[_0x700e('0xb')][0x5]===_0x700e('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x700e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x700e('0xb')][0x6]!=='undefined'&&process[_0x700e('0xb')][0x6]!==_0x700e('0xe')?process[_0x700e('0xb')][0x6]:null;var DUPLICATES=process[_0x700e('0xb')][0x7]&&process[_0x700e('0xb')][0x7]!==_0x700e('0xc')&&process['argv'][0x7]!=='null'?process[_0x700e('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0x700e('0xb')][0x8]==='undefined'||process[_0x700e('0xb')][0x8]===_0x700e('0xe')){throw new Error(_0x700e('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x34a9d5){logger[_0x700e('0x13')](_0x34a9d5);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(_0x40de25,_0x4c49e8,_0x3bff7e,_0x5c7096){var _0x50bae9={'message':_0x4c49e8};_0x50bae9[_0x40de25]=!![];if(_0x3bff7e){_0x50bae9[_0x700e('0x14')]=_0x3bff7e;}if(_0x5c7096){_0x50bae9[_0x700e('0x15')]=_0x5c7096;}return _0x50bae9;}function isEmail(_0x360f50){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))*$/[_0x700e('0x16')](_0x360f50);}function checkRow(_0x2e9eca,_0x3bfa5a,_0x39060e){return new BPromise(function(_0x366447,_0x1a91e9){if(_['isNil'](_0x2e9eca)){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x700e('0x17'),null,_0x39060e));}if(_0x2e9eca[_0x700e('0x18')]&&_0x2e9eca['errors']['length']){var _0x4fb2ad=_['map'](_0x2e9eca[_0x700e('0x18')],_0x700e('0x19'))[_0x700e('0x1a')](';');return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x4fb2ad,null,_0x39060e));}var _0x1329b5={};for(var _0x114cbe in FIELDS){if(FIELDS[_0x700e('0x1b')](_0x114cbe)&&FIELDS[_0x114cbe]){_0x1329b5[_0x114cbe]=_0x2e9eca[_0x700e('0x1c')][0x0][FIELDS[_0x114cbe]]||_0x2e9eca[_0x700e('0x1c')][0x0]['\ufeff'+FIELDS[_0x114cbe]];}}if(!_0x1329b5[_0x700e('0x1d')]){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x700e('0x1e'),null,_0x39060e));}if(!_0x1329b5[_0x700e('0x1f')]){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x700e('0x20'),null,_0x39060e));}if(_0x1329b5['birthDate']){var _0x4462a4=moment(_0x1329b5[_0x700e('0x21')],_0x700e('0x22'));if(!_0x4462a4[_0x700e('0x23')]()){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),_0x700e('0x24'),null,_0x39060e));}}if(_0x1329b5['email']){if(!isEmail(_0x1329b5[_0x700e('0x25')])){return _0x1a91e9(handleCheckRowError(_0x700e('0x13'),'email\x20format\x20is\x20not\x20valid!',null,_0x39060e));}}_0x1329b5[_0x700e('0x26')]=LISTID;_0x1329b5[_0x700e('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x700e('0x28')]&&_0x3bfa5a){var _0x4f8d62={};for(var _0x15f92f=0x0,_0x15d766=DUPLICATES[_0x700e('0x28')];_0x15f92f<_0x15d766;_0x15f92f+=0x1){_0x4f8d62[DUPLICATES[_0x15f92f]]=_0x1329b5[DUPLICATES[_0x15f92f]];}var _0x1345a9=_['find'](_0x3bfa5a,_0x4f8d62);if(_0x1345a9){return _0x1a91e9(handleCheckRowError(_0x700e('0x29'),_0x700e('0x2a'),_0x1345a9,_0x39060e));}}return db[_0x700e('0x2b')][_0x700e('0x2c')](_0x1329b5,{'raw':!![],'hooks':![],'fields':_[_0x700e('0x2d')](_0x1329b5)})[_0x700e('0x2e')](function(_0xbbd304){if(DUPLICATES&&DUPLICATES[_0x700e('0x28')]&&_0x3bfa5a){_0x3bfa5a[_0x700e('0x2f')](_[_0x700e('0x30')](_0x1329b5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xbbd304['id'];return _0x366447();})[_0x700e('0x31')](function(_0x6fa149){return _0x1a91e9(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x6fa149[_0x700e('0x19')]||JSON[_0x700e('0x32')](_0x6fa149)),null,_0x39060e));});});}function checkHopper(){function _0x45290b(){return function(_0x321f94){logger[_0x700e('0x13')](_0x700e('0x33'),_0x700e('0x34'),util['inspect'](_0x321f94,{'showHidden':![],'depth':null}));};}var _0xef0e99=function(_0x17028c,_0x13086d){var _0x10e5ce=squel[_0x700e('0x35')]()[_0x700e('0x36')]('cm_hopper')[_0x700e('0x37')](['phone',_0x700e('0x38'),'ContactId','ListId',_0x13086d,_0x700e('0x39'),'updatedAt'],squel[_0x700e('0x3a')]()['field'](_0x700e('0x1f'),_0x700e('0x1f'))[_0x700e('0x3b')]('NOW()',_0x700e('0x38'))[_0x700e('0x3b')]('id','ContactId')[_0x700e('0x3b')](LISTID[_0x700e('0x3c')](),_0x700e('0x26'))['field'](_0x17028c['id'][_0x700e('0x3c')](),_0x13086d)['field']('NOW()','createdAt')[_0x700e('0x3b')](_0x700e('0x3d'),_0x700e('0x3e'))[_0x700e('0x3f')](_0x700e('0x40'))[_0x700e('0x41')](_0x700e('0x42'))[_0x700e('0x41')](_0x700e('0x43'),LISTID[_0x700e('0x3c')]())[_0x700e('0x41')](_0x700e('0x44'))[_0x700e('0x41')](_0x700e('0x45'),squel[_0x700e('0x3a')]()[_0x700e('0x3b')](_0x700e('0x1f'))[_0x700e('0x3f')]('cm_hopper')[_0x700e('0x41')](_0x13086d+_0x700e('0x46'),_0x17028c['id']['toString']())))[_0x700e('0x3c')]();return _0x10e5ce;};var _0x4f1343=function(_0x106f1e,_0xa296a3){var _0x4b0405=squel[_0x700e('0x35')]()['into']('cm_hopper')[_0x700e('0x37')]([_0x700e('0x1f'),_0x700e('0x38'),_0x700e('0x47'),'ListId',_0xa296a3,_0x700e('0x39'),_0x700e('0x3e')],squel[_0x700e('0x3a')]()[_0x700e('0x3b')](_0x700e('0x1f'),_0x700e('0x1f'))[_0x700e('0x3b')](_0x700e('0x3d'),'scheduledAt')[_0x700e('0x3b')]('id',_0x700e('0x47'))[_0x700e('0x3b')](LISTID[_0x700e('0x3c')](),_0x700e('0x26'))[_0x700e('0x3b')](_0x106f1e['id'][_0x700e('0x3c')](),_0xa296a3)['field'](_0x700e('0x3d'),_0x700e('0x39'))['field'](_0x700e('0x3d'),_0x700e('0x3e'))[_0x700e('0x3f')]('cm_contacts')['where'](_0x700e('0x42'))[_0x700e('0x41')](_0x700e('0x43'),LISTID[_0x700e('0x3c')]())[_0x700e('0x41')](_0x700e('0x48'),squel[_0x700e('0x49')](hopperContacts))['where'](_0x700e('0x44'))[_0x700e('0x41')](_0x700e('0x45'),squel[_0x700e('0x3a')]()[_0x700e('0x3b')]('calleridnum')[_0x700e('0x3f')]('cm_hopper_final')['where'](_0xa296a3+'\x20=\x20?',_0x106f1e['id'][_0x700e('0x3c')]()))[_0x700e('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x700e('0x3a')]()[_0x700e('0x3b')](_0x700e('0x1f'))[_0x700e('0x3f')](_0x700e('0x4a'))['where'](_0xa296a3+_0x700e('0x46'),_0x106f1e['id']['toString']())))[_0x700e('0x3c')]();return _0x4b0405;};function _0x3e373b(_0x320783,_0x1b8314){var _0x20ddcc=squel[_0x700e('0x35')]()[_0x700e('0x36')]('cm_hopper')[_0x700e('0x37')]([_0x700e('0x1f'),_0x700e('0x38'),_0x700e('0x47'),_0x700e('0x26'),_0x1b8314,_0x700e('0x39'),_0x700e('0x3e')],squel[_0x700e('0x3a')]()['field']('phone',_0x700e('0x1f'))[_0x700e('0x3b')](_0x700e('0x3d'),_0x700e('0x38'))[_0x700e('0x3b')]('id',_0x700e('0x47'))[_0x700e('0x3b')](LISTID[_0x700e('0x3c')](),_0x700e('0x26'))[_0x700e('0x3b')](_0x320783['id'][_0x700e('0x3c')](),_0x1b8314)[_0x700e('0x3b')](_0x700e('0x3d'),'createdAt')[_0x700e('0x3b')]('NOW()',_0x700e('0x3e'))[_0x700e('0x3f')](_0x700e('0x40'))['where'](_0x700e('0x42'))[_0x700e('0x41')](_0x700e('0x43'),LISTID[_0x700e('0x3c')]())['where']('id\x20IN\x20?',squel[_0x700e('0x49')](hopperContacts))[_0x700e('0x41')](_0x700e('0x44')))[_0x700e('0x3c')]();return _0x20ddcc;}function _0x545719(_0x4f1447,_0x1a7dcf){var _0x4e7214=squel['insert']()['into'](_0x700e('0x4b'))['fromQuery'](['phone',_0x700e('0x47'),_0x700e('0x26'),_0x1a7dcf,'createdAt',_0x700e('0x3e')],squel[_0x700e('0x3a')]()[_0x700e('0x3b')](_0x700e('0x1f'),_0x700e('0x1f'))[_0x700e('0x3b')]('id','ContactId')[_0x700e('0x3b')](LISTID[_0x700e('0x3c')](),'ListId')['field'](_0x4f1447['id'][_0x700e('0x3c')](),_0x1a7dcf)[_0x700e('0x3b')](_0x700e('0x3d'),_0x700e('0x39'))[_0x700e('0x3b')](_0x700e('0x3d'),_0x700e('0x3e'))[_0x700e('0x3f')](_0x700e('0x40'))[_0x700e('0x41')](_0x700e('0x42'))[_0x700e('0x41')]('ListId\x20=\x20?',LISTID[_0x700e('0x3c')]())['where'](_0x700e('0x48'),squel[_0x700e('0x49')](hopperContacts))[_0x700e('0x41')](_0x700e('0x44')))['toString']();return _0x4e7214;}return db[_0x700e('0x4c')][_0x700e('0x4d')]({'where':{'type':_0x700e('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x700e('0x4f')],'as':_0x700e('0x50'),'where':{'id':LISTID}}]})[_0x700e('0x2e')](function(_0x10d296){var _0x5167f8=[];if(_0x10d296){var _0x53e523;for(var _0x5309ab=0x0,_0x3ba100;_0x5309ab<_0x10d296[_0x700e('0x28')];_0x5309ab+=0x1){_0x3ba100=_0x10d296[_0x5309ab][_0x700e('0x51')]({'plain':!![]});switch(_0x3ba100[_0x700e('0x52')]){case'always':_0x5167f8['push'](db[_0x700e('0x53')][_0x700e('0x54')](_0x4f1343(_0x3ba100,_0x700e('0x55')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));break;case _0x700e('0x56'):_0x5167f8[_0x700e('0x2f')](db['sequelize'][_0x700e('0x54')](_0xef0e99(_0x3ba100,_0x700e('0x55')))['then'](function(){})[_0x700e('0x31')](_0x45290b()));break;default:_0x5167f8['push'](db[_0x700e('0x53')]['query'](_0x3e373b(_0x3ba100,_0x700e('0x55')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));}}}return _0x5167f8;})[_0x700e('0x57')]()[_0x700e('0x2e')](function(){return db[_0x700e('0x4c')][_0x700e('0x4d')]({'where':{'type':_0x700e('0x4e')},'attributes':['id'],'include':[{'model':db[_0x700e('0x4f')],'as':_0x700e('0x58'),'where':{'id':LISTID}}]})[_0x700e('0x2e')](function(_0x26f732){var _0x24114e=[];if(_0x26f732){var _0xfe005f;for(var _0x357b47=0x0,_0x4d7cc0;_0x357b47<_0x26f732[_0x700e('0x28')];_0x357b47+=0x1){_0x4d7cc0=_0x26f732[_0x357b47]['get']({'plain':!![]});_0x24114e[_0x700e('0x2f')](db[_0x700e('0x53')][_0x700e('0x54')](_0x545719(_0x4d7cc0,_0x700e('0x55')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));}}return _0x24114e;})['all']();})[_0x700e('0x2e')](function(){return db[_0x700e('0x59')][_0x700e('0x4d')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x700e('0x4f')],'as':_0x700e('0x50'),'where':{'id':LISTID}}]})[_0x700e('0x2e')](function(_0x5d1bad){var _0x28008e=[];if(_0x5d1bad){for(var _0x2aa545=0x0,_0x4ad081;_0x2aa545<_0x5d1bad[_0x700e('0x28')];_0x2aa545+=0x1){_0x4ad081=_0x5d1bad[_0x2aa545][_0x700e('0x51')]({'plain':!![]});switch(_0x4ad081[_0x700e('0x52')]){case _0x700e('0x5a'):_0x28008e['push'](db[_0x700e('0x53')][_0x700e('0x54')](_0x4f1343(_0x4ad081,_0x700e('0x5b')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));break;case _0x700e('0x56'):_0x28008e[_0x700e('0x2f')](db[_0x700e('0x53')][_0x700e('0x54')](_0xef0e99(_0x4ad081,'CampaignId'))[_0x700e('0x2e')](function(){})['catch'](_0x45290b()));break;default:_0x28008e[_0x700e('0x2f')](db['sequelize'][_0x700e('0x54')](_0x3e373b(_0x4ad081,_0x700e('0x5b')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));}}}return _0x28008e;})[_0x700e('0x57')]();})[_0x700e('0x2e')](function(){return db[_0x700e('0x59')][_0x700e('0x4d')]({'attributes':['id'],'include':[{'model':db[_0x700e('0x4f')],'as':_0x700e('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x32627a){var _0x7137ac=[];if(_0x32627a){for(var _0x5015d6=0x0,_0x11921d;_0x5015d6<_0x32627a[_0x700e('0x28')];_0x5015d6+=0x1){_0x11921d=_0x32627a[_0x5015d6][_0x700e('0x51')]({'plain':!![]});_0x7137ac[_0x700e('0x2f')](db[_0x700e('0x53')][_0x700e('0x54')](_0x545719(_0x11921d,_0x700e('0x5b')))[_0x700e('0x2e')](function(){})[_0x700e('0x31')](_0x45290b()));}}return _0x7137ac;})[_0x700e('0x57')]();})[_0x700e('0x31')](function(_0x291b58){logger['error']('cmContact,\x20%s,\x20%s',_0x700e('0x5c'),_0x291b58[_0x700e('0x19')]);});}var processPromises=function(_0x37f2ed){return BPromise[_0x700e('0x57')](promises)[_0x700e('0x2e')](function(_0x57af9f){})[_0x700e('0x31')](function(_0x44f6e1){logger[_0x700e('0x13')](_0x700e('0x5d'),JSON[_0x700e('0x32')](_0x44f6e1));})['finally'](function(){socket['emit'](_0x700e('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x37f2ed){return _0x37f2ed[_0x700e('0x5f')]();}});};var endCsv=function(){return BPromise[_0x700e('0x60')]()[_0x700e('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x700e('0x2e')](function(){socket[_0x700e('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x5c1c7e){logger[_0x700e('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x700e('0x32')](_0x5c1c7e));}finally{process['exit'](0x0);}});};process['on'](_0x700e('0x62'),function(){logger[_0x700e('0x63')](_0x700e('0x64'));endCsv();});function main(){return BPromise[_0x700e('0x60')]()[_0x700e('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x700e('0x11')](',');return db[_0x700e('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x700e('0x2e')](function(_0x47ba77){var _0x3c14e6=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x700e('0x65')](_0x3c14e6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x958126,_0x20b3cd){total+=0x1;var _0x5480ed=total;promises['push'](checkRow(_0x958126,_0x47ba77,_0x5480ed)[_0x700e('0x2e')](function(){success+=0x1;})[_0x700e('0x31')](function(_0x3a2159){if(_0x3a2159[_0x700e('0x13')]){errors+=0x1;delete _0x3a2159[_0x700e('0x13')];}else if(_0x3a2159[_0x700e('0x29')]){duplicates+=0x1;delete _0x3a2159[_0x700e('0x29')];}rows['push'](_0x3a2159);}));if(total%0xc8===0x0){_0x20b3cd['pause']();return processPromises(_0x20b3cd);}},'complete':function(){return processPromises()[_0x700e('0x2e')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3de4ff,_0x391639){logger[_0x700e('0x63')]('CSV\x20parse\x20error',JSON[_0x700e('0x32')](_0x3de4ff));endCsv();}});})[_0x700e('0x31')](function(_0x3b649d){logger[_0x700e('0x13')](_0x700e('0x66'),JSON[_0x700e('0x32')](_0x3b649d));});}main(); \ No newline at end of file +var _0x2cfb=['zipObject','split','null','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','field','NOW()','toString','createdAt','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','\x20=\x20?','str','id\x20IN\x20?','VoiceQueue','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','then','onlyIfOpen','push','all','findAll','outbound','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','unlinkSync','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined'];(function(_0x38782c,_0x5c9fef){var _0x3708bf=function(_0x595e13){while(--_0x595e13){_0x38782c['push'](_0x38782c['shift']());}};_0x3708bf(++_0x5c9fef);}(_0x2cfb,0x19e));var _0xb2cf=function(_0x3382f4,_0x32b70b){_0x3382f4=_0x3382f4-0x0;var _0x3a3368=_0x2cfb[_0x3382f4];return _0x3a3368;};'use strict';var BPromise=require(_0xb2cf('0x0'));var util=require(_0xb2cf('0x1'));var _=require(_0xb2cf('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xb2cf('0x3'));var Redis=require(_0xb2cf('0x4'));var db=require(_0xb2cf('0x5'))['db'];var config=require(_0xb2cf('0x6'));var logger=require('../../../config/logger')('api');config[_0xb2cf('0x7')]=_[_0xb2cf('0x8')](config[_0xb2cf('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xb2cf('0x9'))(new Redis(config[_0xb2cf('0x7')]));require(_0xb2cf('0xa'))[_0xb2cf('0xb')](socket);try{if(!process[_0xb2cf('0xc')][0x2]||process[_0xb2cf('0xc')][0x2]===_0xb2cf('0xd')||process[_0xb2cf('0xc')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xb2cf('0xc')][0x2];if(!process[_0xb2cf('0xc')][0x3]||process[_0xb2cf('0xc')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process['argv'][0x4]||process[_0xb2cf('0xc')][0x4]===_0xb2cf('0xd')||process[_0xb2cf('0xc')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xb2cf('0xe')](process[_0xb2cf('0xc')][0x3][_0xb2cf('0xf')](','),process[_0xb2cf('0xc')][0x4][_0xb2cf('0xf')](','));if(!process[_0xb2cf('0xc')][0x5]||process['argv'][0x5]===_0xb2cf('0xd')||process[_0xb2cf('0xc')][0x5]===_0xb2cf('0x10')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xb2cf('0xc')][0x5];var COMPANYID=process[_0xb2cf('0xc')][0x6]&&process[_0xb2cf('0xc')][0x6]!=='undefined'&&process[_0xb2cf('0xc')][0x6]!==_0xb2cf('0x10')?process[_0xb2cf('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0xb2cf('0xd')&&process[_0xb2cf('0xc')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0xb2cf('0xc')][0x8]||process[_0xb2cf('0xc')][0x8]===_0xb2cf('0xd')||process['argv'][0x8]===_0xb2cf('0x10')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x215b5d){logger[_0xb2cf('0x11')](_0x215b5d);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(_0x152e67,_0x4a8499,_0x30a4a4,_0x34c3f1){var _0x1a8ba0={'message':_0x4a8499};_0x1a8ba0[_0x152e67]=!![];if(_0x30a4a4){_0x1a8ba0[_0xb2cf('0x12')]=_0x30a4a4;}if(_0x34c3f1){_0x1a8ba0[_0xb2cf('0x13')]=_0x34c3f1;}return _0x1a8ba0;}function isEmail(_0x1c3a4f){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))*$/[_0xb2cf('0x14')](_0x1c3a4f);}function checkRow(_0x63762e,_0x1d6da9,_0x880c37){return new BPromise(function(_0x3b3ae2,_0xa7b1a){if(_[_0xb2cf('0x15')](_0x63762e)){return _0xa7b1a(handleCheckRowError(_0xb2cf('0x11'),_0xb2cf('0x16'),null,_0x880c37));}if(_0x63762e[_0xb2cf('0x17')]&&_0x63762e['errors'][_0xb2cf('0x18')]){var _0xbdca50=_[_0xb2cf('0x19')](_0x63762e['errors'],_0xb2cf('0x1a'))[_0xb2cf('0x1b')](';');return _0xa7b1a(handleCheckRowError('error',_0xbdca50,null,_0x880c37));}var _0x3557a7={};for(var _0x98ea22 in FIELDS){if(FIELDS[_0xb2cf('0x1c')](_0x98ea22)&&FIELDS[_0x98ea22]){_0x3557a7[_0x98ea22]=_0x63762e[_0xb2cf('0x1d')][0x0][FIELDS[_0x98ea22]]||_0x63762e[_0xb2cf('0x1d')][0x0]['\ufeff'+FIELDS[_0x98ea22]];}}if(!_0x3557a7[_0xb2cf('0x1e')]){return _0xa7b1a(handleCheckRowError(_0xb2cf('0x11'),_0xb2cf('0x1f'),null,_0x880c37));}if(!_0x3557a7[_0xb2cf('0x20')]){return _0xa7b1a(handleCheckRowError(_0xb2cf('0x11'),'phone\x20not\x20specified!',null,_0x880c37));}if(_0x3557a7[_0xb2cf('0x21')]){var _0x46d87e=moment(_0x3557a7['birthDate'],_0xb2cf('0x22'));if(!_0x46d87e[_0xb2cf('0x23')]()){return _0xa7b1a(handleCheckRowError('error',_0xb2cf('0x24'),null,_0x880c37));}}if(_0x3557a7['email']){if(!isEmail(_0x3557a7[_0xb2cf('0x25')])){return _0xa7b1a(handleCheckRowError('error',_0xb2cf('0x26'),null,_0x880c37));}}_0x3557a7[_0xb2cf('0x27')]=LISTID;_0x3557a7[_0xb2cf('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb2cf('0x18')]&&_0x1d6da9){var _0x4c9594={};for(var _0x1f73d5=0x0,_0x4f63c7=DUPLICATES[_0xb2cf('0x18')];_0x1f73d5<_0x4f63c7;_0x1f73d5+=0x1){_0x4c9594[DUPLICATES[_0x1f73d5]]=_0x3557a7[DUPLICATES[_0x1f73d5]];}var _0x2159af=_[_0xb2cf('0x29')](_0x1d6da9,_0x4c9594);if(_0x2159af){return _0xa7b1a(handleCheckRowError('duplicate',_0xb2cf('0x2a'),_0x2159af,_0x880c37));}}return db[_0xb2cf('0x2b')][_0xb2cf('0x2c')](_0x3557a7,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3557a7)})['then'](function(_0x86dee2){if(DUPLICATES&&DUPLICATES[_0xb2cf('0x18')]&&_0x1d6da9){_0x1d6da9['push'](_[_0xb2cf('0x2d')](_0x3557a7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x86dee2['id'];return _0x3b3ae2();})[_0xb2cf('0x2e')](function(_0x4f602a){return _0xa7b1a(handleCheckRowError('error',_0xb2cf('0x2f')+(_0x4f602a[_0xb2cf('0x1a')]||JSON[_0xb2cf('0x30')](_0x4f602a)),null,_0x880c37));});});}function checkHopper(){function _0x21edad(){return function(_0x36b4a0){logger[_0xb2cf('0x11')](_0xb2cf('0x31'),'checkHopper',util['inspect'](_0x36b4a0,{'showHidden':![],'depth':null}));};}var _0x5a4ed7=function(_0x1c2aec,_0x473b53){var _0xbf9c0a=squel[_0xb2cf('0x32')]()[_0xb2cf('0x33')](_0xb2cf('0x34'))[_0xb2cf('0x35')]([_0xb2cf('0x20'),_0xb2cf('0x36'),_0xb2cf('0x37'),_0xb2cf('0x27'),_0x473b53,'createdAt',_0xb2cf('0x38')],squel['select']()[_0xb2cf('0x39')](_0xb2cf('0x20'),_0xb2cf('0x20'))[_0xb2cf('0x39')](_0xb2cf('0x3a'),_0xb2cf('0x36'))['field']('id',_0xb2cf('0x37'))['field'](LISTID['toString'](),_0xb2cf('0x27'))[_0xb2cf('0x39')](_0x1c2aec['id'][_0xb2cf('0x3b')](),_0x473b53)[_0xb2cf('0x39')](_0xb2cf('0x3a'),_0xb2cf('0x3c'))[_0xb2cf('0x39')]('NOW()',_0xb2cf('0x38'))[_0xb2cf('0x3d')](_0xb2cf('0x3e'))['where'](_0xb2cf('0x3f'))[_0xb2cf('0x40')](_0xb2cf('0x41'),LISTID[_0xb2cf('0x3b')]())[_0xb2cf('0x40')](_0xb2cf('0x42'))[_0xb2cf('0x40')](_0xb2cf('0x43'),squel[_0xb2cf('0x44')]()['field'](_0xb2cf('0x20'))['from']('cm_hopper')[_0xb2cf('0x40')](_0x473b53+'\x20=\x20?',_0x1c2aec['id'][_0xb2cf('0x3b')]())))[_0xb2cf('0x3b')]();return _0xbf9c0a;};var _0x1c44bc=function(_0x45ad0b,_0x27b65e){var _0x186c3b=squel[_0xb2cf('0x32')]()[_0xb2cf('0x33')](_0xb2cf('0x34'))[_0xb2cf('0x35')]([_0xb2cf('0x20'),_0xb2cf('0x36'),'ContactId',_0xb2cf('0x27'),_0x27b65e,_0xb2cf('0x3c'),_0xb2cf('0x38')],squel[_0xb2cf('0x44')]()[_0xb2cf('0x39')](_0xb2cf('0x20'),_0xb2cf('0x20'))['field'](_0xb2cf('0x3a'),'scheduledAt')[_0xb2cf('0x39')]('id',_0xb2cf('0x37'))[_0xb2cf('0x39')](LISTID[_0xb2cf('0x3b')](),'ListId')[_0xb2cf('0x39')](_0x45ad0b['id'][_0xb2cf('0x3b')](),_0x27b65e)[_0xb2cf('0x39')](_0xb2cf('0x3a'),_0xb2cf('0x3c'))[_0xb2cf('0x39')](_0xb2cf('0x3a'),'updatedAt')['from']('cm_contacts')['where'](_0xb2cf('0x3f'))[_0xb2cf('0x40')](_0xb2cf('0x41'),LISTID['toString']())[_0xb2cf('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0xb2cf('0x42'))[_0xb2cf('0x40')](_0xb2cf('0x43'),squel[_0xb2cf('0x44')]()['field']('calleridnum')[_0xb2cf('0x3d')](_0xb2cf('0x45'))[_0xb2cf('0x40')](_0x27b65e+_0xb2cf('0x46'),_0x45ad0b['id']['toString']()))[_0xb2cf('0x40')](_0xb2cf('0x43'),squel[_0xb2cf('0x44')]()[_0xb2cf('0x39')](_0xb2cf('0x20'))['from'](_0xb2cf('0x34'))['where'](_0x27b65e+_0xb2cf('0x46'),_0x45ad0b['id']['toString']())))[_0xb2cf('0x3b')]();return _0x186c3b;};function _0x34c894(_0x47b631,_0xb552b4){var _0x5641fd=squel[_0xb2cf('0x32')]()[_0xb2cf('0x33')](_0xb2cf('0x34'))[_0xb2cf('0x35')]([_0xb2cf('0x20'),_0xb2cf('0x36'),_0xb2cf('0x37'),_0xb2cf('0x27'),_0xb552b4,_0xb2cf('0x3c'),'updatedAt'],squel[_0xb2cf('0x44')]()[_0xb2cf('0x39')](_0xb2cf('0x20'),'phone')[_0xb2cf('0x39')](_0xb2cf('0x3a'),_0xb2cf('0x36'))[_0xb2cf('0x39')]('id',_0xb2cf('0x37'))[_0xb2cf('0x39')](LISTID[_0xb2cf('0x3b')](),_0xb2cf('0x27'))[_0xb2cf('0x39')](_0x47b631['id'][_0xb2cf('0x3b')](),_0xb552b4)[_0xb2cf('0x39')](_0xb2cf('0x3a'),'createdAt')['field'](_0xb2cf('0x3a'),_0xb2cf('0x38'))[_0xb2cf('0x3d')](_0xb2cf('0x3e'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xb2cf('0x41'),LISTID[_0xb2cf('0x3b')]())['where']('id\x20IN\x20?',squel[_0xb2cf('0x47')](hopperContacts))[_0xb2cf('0x40')](_0xb2cf('0x42')))[_0xb2cf('0x3b')]();return _0x5641fd;}function _0x3fff9c(_0x4dd01e,_0x5d5410){var _0x4f4815=squel[_0xb2cf('0x32')]()['into']('cm_hopper_black')[_0xb2cf('0x35')]([_0xb2cf('0x20'),'ContactId',_0xb2cf('0x27'),_0x5d5410,_0xb2cf('0x3c'),_0xb2cf('0x38')],squel[_0xb2cf('0x44')]()['field'](_0xb2cf('0x20'),_0xb2cf('0x20'))[_0xb2cf('0x39')]('id',_0xb2cf('0x37'))['field'](LISTID[_0xb2cf('0x3b')](),_0xb2cf('0x27'))[_0xb2cf('0x39')](_0x4dd01e['id'][_0xb2cf('0x3b')](),_0x5d5410)[_0xb2cf('0x39')](_0xb2cf('0x3a'),'createdAt')[_0xb2cf('0x39')]('NOW()','updatedAt')[_0xb2cf('0x3d')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xb2cf('0x40')]('ListId\x20=\x20?',LISTID[_0xb2cf('0x3b')]())[_0xb2cf('0x40')](_0xb2cf('0x48'),squel[_0xb2cf('0x47')](hopperContacts))[_0xb2cf('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0xb2cf('0x3b')]();return _0x4f4815;}return db[_0xb2cf('0x49')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xb2cf('0x4a')],'include':[{'model':db[_0xb2cf('0x4b')],'as':_0xb2cf('0x4c'),'where':{'id':LISTID}}]})['then'](function(_0x45130a){var _0x15961=[];if(_0x45130a){var _0x22f5e8;for(var _0x239123=0x0,_0x345dab;_0x239123<_0x45130a['length'];_0x239123+=0x1){_0x345dab=_0x45130a[_0x239123][_0xb2cf('0x4d')]({'plain':!![]});switch(_0x345dab['dialCheckDuplicateType']){case _0xb2cf('0x4e'):_0x15961['push'](db[_0xb2cf('0x4f')][_0xb2cf('0x50')](_0x1c44bc(_0x345dab,_0xb2cf('0x51')))[_0xb2cf('0x52')](function(){})['catch'](_0x21edad()));break;case _0xb2cf('0x53'):_0x15961[_0xb2cf('0x54')](db[_0xb2cf('0x4f')][_0xb2cf('0x50')](_0x5a4ed7(_0x345dab,_0xb2cf('0x51')))[_0xb2cf('0x52')](function(){})[_0xb2cf('0x2e')](_0x21edad()));break;default:_0x15961[_0xb2cf('0x54')](db[_0xb2cf('0x4f')][_0xb2cf('0x50')](_0x34c894(_0x345dab,'VoiceQueueId'))['then'](function(){})[_0xb2cf('0x2e')](_0x21edad()));}}}return _0x15961;})[_0xb2cf('0x55')]()[_0xb2cf('0x52')](function(){return db[_0xb2cf('0x49')][_0xb2cf('0x56')]({'where':{'type':_0xb2cf('0x57')},'attributes':['id'],'include':[{'model':db[_0xb2cf('0x4b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb2cf('0x52')](function(_0x4e1ce6){var _0x53d501=[];if(_0x4e1ce6){var _0x4b3531;for(var _0x1d5a3e=0x0,_0x1b3718;_0x1d5a3e<_0x4e1ce6['length'];_0x1d5a3e+=0x1){_0x1b3718=_0x4e1ce6[_0x1d5a3e][_0xb2cf('0x4d')]({'plain':!![]});_0x53d501[_0xb2cf('0x54')](db[_0xb2cf('0x4f')][_0xb2cf('0x50')](_0x3fff9c(_0x1b3718,_0xb2cf('0x51')))[_0xb2cf('0x52')](function(){})[_0xb2cf('0x2e')](_0x21edad()));}}return _0x53d501;})['all']();})[_0xb2cf('0x52')](function(){return db[_0xb2cf('0x58')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb2cf('0x4b')],'as':_0xb2cf('0x4c'),'where':{'id':LISTID}}]})[_0xb2cf('0x52')](function(_0x13ba72){var _0x430f46=[];if(_0x13ba72){for(var _0x4bab3b=0x0,_0x1cb373;_0x4bab3b<_0x13ba72[_0xb2cf('0x18')];_0x4bab3b+=0x1){_0x1cb373=_0x13ba72[_0x4bab3b]['get']({'plain':!![]});switch(_0x1cb373[_0xb2cf('0x4a')]){case'always':_0x430f46[_0xb2cf('0x54')](db[_0xb2cf('0x4f')][_0xb2cf('0x50')](_0x1c44bc(_0x1cb373,_0xb2cf('0x59')))[_0xb2cf('0x52')](function(){})[_0xb2cf('0x2e')](_0x21edad()));break;case _0xb2cf('0x53'):_0x430f46['push'](db[_0xb2cf('0x4f')]['query'](_0x5a4ed7(_0x1cb373,_0xb2cf('0x59')))[_0xb2cf('0x52')](function(){})['catch'](_0x21edad()));break;default:_0x430f46[_0xb2cf('0x54')](db['sequelize']['query'](_0x34c894(_0x1cb373,_0xb2cf('0x59')))[_0xb2cf('0x52')](function(){})['catch'](_0x21edad()));}}}return _0x430f46;})[_0xb2cf('0x55')]();})[_0xb2cf('0x52')](function(){return db[_0xb2cf('0x58')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xb2cf('0x4b')],'as':_0xb2cf('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x1d413b){var _0xf69da2=[];if(_0x1d413b){for(var _0x53861e=0x0,_0xdbf2bd;_0x53861e<_0x1d413b[_0xb2cf('0x18')];_0x53861e+=0x1){_0xdbf2bd=_0x1d413b[_0x53861e][_0xb2cf('0x4d')]({'plain':!![]});_0xf69da2[_0xb2cf('0x54')](db['sequelize'][_0xb2cf('0x50')](_0x3fff9c(_0xdbf2bd,_0xb2cf('0x59')))[_0xb2cf('0x52')](function(){})[_0xb2cf('0x2e')](_0x21edad()));}}return _0xf69da2;})[_0xb2cf('0x55')]();})[_0xb2cf('0x2e')](function(_0x26039c){logger['error'](_0xb2cf('0x5b'),_0xb2cf('0x5c'),_0x26039c['message']);});}var processPromises=function(_0x12350f){return BPromise['all'](promises)[_0xb2cf('0x52')](function(_0x39204c){})[_0xb2cf('0x2e')](function(_0x5ca0d1){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xb2cf('0x30')](_0x5ca0d1));})[_0xb2cf('0x5d')](function(){socket[_0xb2cf('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x12350f){return _0x12350f[_0xb2cf('0x5f')]();}});};var endCsv=function(){return BPromise[_0xb2cf('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xb2cf('0x52')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb2cf('0x61')](FILEPATH);}catch(_0x3d0de9){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xb2cf('0x30')](_0x3d0de9));}finally{process['exit'](0x0);}});};process['on'](_0xb2cf('0x62'),function(){logger['info'](_0xb2cf('0x63'));endCsv();});function main(){return BPromise['resolve']()[_0xb2cf('0x52')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xb2cf('0x2b')][_0xb2cf('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x532aa7){var _0x77d3ba=fs[_0xb2cf('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb2cf('0x65')](_0x77d3ba,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1a445c,_0x21c8b2){total+=0x1;var _0x569a05=total;promises[_0xb2cf('0x54')](checkRow(_0x1a445c,_0x532aa7,_0x569a05)[_0xb2cf('0x52')](function(){success+=0x1;})[_0xb2cf('0x2e')](function(_0xa3fc96){if(_0xa3fc96[_0xb2cf('0x11')]){errors+=0x1;delete _0xa3fc96[_0xb2cf('0x11')];}else if(_0xa3fc96[_0xb2cf('0x66')]){duplicates+=0x1;delete _0xa3fc96[_0xb2cf('0x66')];}rows[_0xb2cf('0x54')](_0xa3fc96);}));if(total%0xc8===0x0){_0x21c8b2[_0xb2cf('0x67')]();return processPromises(_0x21c8b2);}},'complete':function(){return processPromises()[_0xb2cf('0x52')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x44bf9e,_0x7f4b6c){logger[_0xb2cf('0x68')](_0xb2cf('0x69'),JSON[_0xb2cf('0x30')](_0x44bf9e));endCsv();}});})[_0xb2cf('0x2e')](function(_0x58950c){logger[_0xb2cf('0x11')](_0xb2cf('0x6a'),JSON[_0xb2cf('0x30')](_0x58950c));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 116ffaa..9c9db58 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 _0xffe6=['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()','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','insert','cm_hopper_black','fromQuery','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','field','min_id','toString','Received\x20SIGINT','error','message','exit','push','code','sequelize','query','spread','catch','info','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','rows','errors','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20'];(function(_0x53aed1,_0x27c2ae){var _0x414724=function(_0x18a8d5){while(--_0x18a8d5){_0x53aed1['push'](_0x53aed1['shift']());}};_0x414724(++_0x27c2ae);}(_0xffe6,0x9e));var _0x6ffe=function(_0x4e8251,_0x4aedeb){_0x4e8251=_0x4e8251-0x0;var _0x13849e=_0xffe6[_0x4e8251];return _0x13849e;};'use strict';var fs=require('fs');var path=require(_0x6ffe('0x0'));var _=require(_0x6ffe('0x1'));var Papa=require(_0x6ffe('0x2'));var util=require(_0x6ffe('0x3'));var BPromise=require(_0x6ffe('0x4'));var moment=require(_0x6ffe('0x5'));var squel=require(_0x6ffe('0x6'));var Redis=require(_0x6ffe('0x7'));var db=require(_0x6ffe('0x8'))['db'];var config=require(_0x6ffe('0x9'));var logger=require(_0x6ffe('0xa'))(_0x6ffe('0xb'));config[_0x6ffe('0xc')]=_[_0x6ffe('0xd')](config[_0x6ffe('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ffe('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x6ffe('0xf')](_0x6ffe('0x10'));function isEmail(_0x2b0b1a){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))*$/[_0x6ffe('0x11')](_0x2b0b1a);}function selectNotIn(_0xfc02a6,_0x168610,_0x3133f4,_0x4af8e0,_0x35bb1d){return squel[_0x6ffe('0x12')]()['field'](_0x6ffe('0x13'))[_0x6ffe('0x14')](_0x4af8e0)[_0x6ffe('0x15')](_0x168610,null,_0x168610+_0x6ffe('0x16')+_0x4af8e0+'.'+_0x3133f4)[_0x6ffe('0x17')](_0x4af8e0+'.'+_0x3133f4+_0x6ffe('0x18')+_0xfc02a6+'.'+_0x3133f4)[_0x6ffe('0x17')](_0x168610+_0x6ffe('0x19')+_0x35bb1d[_0x6ffe('0x15')]()+')');}function insertCmHopper(_0x8aa948,_0x1cce05,_0x291138,_0x63fb7,_0x534f9f){var _0x2ee008=['cm_contacts.phone',_0x6ffe('0x1a'),_0x6ffe('0x1b'),'cm_contacts.ListId',_0x1cce05+'.'+_0x63fb7,_0x6ffe('0x1c'),_0x6ffe('0x1d'),'cm_contacts.priority',_0x6ffe('0x1e'),'\x22'+_0x534f9f+'\x22'];return squel['insert']()[_0x6ffe('0x1f')](_0x6ffe('0x20'))['fromQuery']([_0x6ffe('0x13'),_0x6ffe('0x21'),_0x6ffe('0x22'),_0x6ffe('0x23'),_0x63fb7,_0x6ffe('0x24'),_0x6ffe('0x25'),'priority',_0x6ffe('0x26'),_0x6ffe('0x27')],squel['select']()['fields'](_0x2ee008)[_0x6ffe('0x14')](_0x1cce05)[_0x6ffe('0x15')](_0x6ffe('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x1cce05+_0x6ffe('0x29'))[_0x6ffe('0x15')](_0x291138,null,_0x291138+'.id\x20=\x20'+_0x1cce05+'.'+_0x63fb7)[_0x6ffe('0x17')](_0x1cce05+'.CmListId\x20=\x20?',_0x8aa948)[_0x6ffe('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6ffe('0x17')](_0x6ffe('0x2a'),selectNotIn(_0x1cce05,_0x291138,_0x63fb7,_0x6ffe('0x20'),[_0x6ffe('0x2b'),_0x6ffe('0x2c')]))[_0x6ffe('0x17')](_0x6ffe('0x2a'),selectNotIn(_0x1cce05,_0x291138,_0x63fb7,'cm_hopper',[_0x6ffe('0x2b')])))['toString']();}function insertCmHopperBlack(_0x43b6e4,_0x84bf72,_0x158bab,_0x49a547){var _0x5b9504=[_0x6ffe('0x2d'),_0x6ffe('0x1b'),'cm_contacts.ListId',_0x84bf72+'.'+_0x49a547,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x6ffe('0x2e')]()[_0x6ffe('0x1f')](_0x6ffe('0x2f'))[_0x6ffe('0x30')]([_0x6ffe('0x13'),_0x6ffe('0x22'),'ListId',_0x49a547,_0x6ffe('0x24'),_0x6ffe('0x25')],squel[_0x6ffe('0x12')]()[_0x6ffe('0x31')](_0x5b9504)[_0x6ffe('0x14')](_0x84bf72)[_0x6ffe('0x15')]('cm_contacts',null,_0x6ffe('0x32')+_0x84bf72+_0x6ffe('0x29'))[_0x6ffe('0x15')](_0x158bab,null,_0x158bab+'.id\x20=\x20'+_0x84bf72+'.'+_0x49a547)[_0x6ffe('0x17')](_0x84bf72+_0x6ffe('0x33'),_0x43b6e4)[_0x6ffe('0x17')](_0x6ffe('0x34'),NOW)[_0x6ffe('0x17')](_0x6ffe('0x2a'),squel[_0x6ffe('0x12')]()['field'](_0x6ffe('0x13'))[_0x6ffe('0x14')]('cm_hopper_black')[_0x6ffe('0x17')]('ListId\x20=\x20?',_0x43b6e4)[_0x6ffe('0x17')](_0x49a547+_0x6ffe('0x35'),_0x84bf72+'.'+_0x49a547)))['toString']();}function insertCmContact(_0x1c5839,_0x250dca,_0x14adc0,_0xd56be1){var _0xb529b7=_[_0x6ffe('0x36')](_[_0x6ffe('0x37')](_0xd56be1),[_0x6ffe('0x23'),_0x6ffe('0x38'),_0x6ffe('0x24'),_0x6ffe('0x25')]);return squel[_0x6ffe('0x2e')]()[_0x6ffe('0x1f')](_0x6ffe('0x28'))[_0x6ffe('0x30')](_0xb529b7,squel[_0x6ffe('0x12')]()[_0x6ffe('0x31')](_0xb529b7)[_0x6ffe('0x14')](_0x250dca)[_0x6ffe('0x17')]('('+_0x14adc0['join'](',')+_0x6ffe('0x39'),squel[_0x6ffe('0x12')]()[_0x6ffe('0x31')](_0x14adc0)[_0x6ffe('0x14')]('cm_contacts')['where']('ListId\x20=\x20?',_0x1c5839)['where']('deletedAt\x20IS\x20NULL'))[_0x6ffe('0x17')](_0x6ffe('0x3a'),squel[_0x6ffe('0x12')]()[_0x6ffe('0x3b')]('MIN(id)',_0x6ffe('0x3c'))[_0x6ffe('0x14')](_0x250dca)['group'](_0x14adc0[_0x6ffe('0x15')](','))))[_0x6ffe('0x3d')]();}function handleStop(){logger['info'](_0x6ffe('0x3e'));stopped=!![];}function handleUncaughtException(_0x564267){logger[_0x6ffe('0x3f')](_0x564267[_0x6ffe('0x40')]);process[_0x6ffe('0x41')](0x1);}function handleError(_0x3841ae,_0x54e721){stats['errors'][_0x6ffe('0x42')]({'name':_0x54e721[_0x6ffe('0x43')],'message':_0x54e721[_0x6ffe('0x40')],'row':_0x3841ae});}function handleQuery(_0x13f6ec){logger['info'](_0x13f6ec);return db[_0x6ffe('0x44')][_0x6ffe('0x45')](_0x13f6ec)[_0x6ffe('0x46')](function(_0x1fe1eb){results['push'](_0x1fe1eb);})[_0x6ffe('0x47')](function(_0x12e580){logger['error'](_0x12e580[_0x6ffe('0x40')]);});}function main(_0x19341f,_0x23d802,_0x47cd3b,_0x5b2e0f){logger[_0x6ffe('0x48')](_0x6ffe('0x49'),_0x19341f,JSON[_0x6ffe('0x4a')](_0x23d802));process[_0x6ffe('0x4b')](_0x6ffe('0x4c'));var _0x183869=_0x23d802[_0x6ffe('0x4d')];var _0x48ef5b=_0x23d802[_0x6ffe('0x4e')];var _0x10361a=path[_0x6ffe('0x15')](config[_0x6ffe('0x4f')],_0x6ffe('0x50'),_0x48ef5b+'.csv');var _0x2e51a2=_['keys'](_0x183869)[_0x6ffe('0x15')]();logger[_0x6ffe('0x48')](_0x6ffe('0x51'),_0x2e51a2);fs[_0x6ffe('0x52')](_0x10361a,_0x2e51a2+'\x0a');Papa[_0x6ffe('0x53')](fs[_0x6ffe('0x54')](_0x19341f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x41544e,_0x2f5a8d){try{for(var _0x384ce3=0x0,_0x22fb02=[];_0x384ce3<_0x41544e[_0x6ffe('0x55')][_0x6ffe('0x56')];_0x384ce3++){stats[_0x6ffe('0x57')]+=0x1;if(_0x41544e[_0x6ffe('0x58')][_0x384ce3]){handleError(_0x41544e[_0x6ffe('0x55')][_0x384ce3],_0x41544e[_0x6ffe('0x58')][_0x384ce3]);}else{var _0x355993=[];for(var _0x59b26c in _0x183869){if(_0x183869[_0x6ffe('0x59')](_0x59b26c)){if(_0x41544e[_0x6ffe('0x55')][_0x384ce3][_0x183869[_0x59b26c]]){var _0x39f798=_['trim'](_0x41544e[_0x6ffe('0x55')][_0x384ce3][_0x183869[_0x59b26c]][_0x6ffe('0x5a')](/"/g,'\x27'));switch(_0x59b26c){case _0x6ffe('0x21'):var _0x4b6a07=moment(_0x39f798,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4b6a07[_0x6ffe('0x5b')]()){_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');}else{_0x355993[_0x6ffe('0x42')](_0x6ffe('0x5c'));}break;case _0x6ffe('0x5d'):var _0x2f1154=parseInt(_0x39f798);_0x39f798=_[_0x6ffe('0x5e')](_0x2f1154)||_0x2f1154<0x0||_0x2f1154>0x4?_0x5b2e0f?0x3:0x2:_0x2f1154;_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');break;case _0x6ffe('0x26'):var _0x1a5afe=parseInt(_0x39f798);if(_[_0x6ffe('0x5f')](_0x1a5afe)&&_['includes'](_0x47cd3b,_0x1a5afe)){_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x1a5afe+'\x22');}else{_0x355993[_0x6ffe('0x42')](_0x6ffe('0x60'));}break;case'email':if(isEmail(_0x39f798)){_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');}else{_0x355993[_0x6ffe('0x42')](_0x6ffe('0x61'));}break;case'dateOfBirth':var _0x242a8a=moment(_0x39f798,_0x6ffe('0x62'),!![]);if(_0x242a8a[_0x6ffe('0x5b')]()){_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');}else{_0x355993[_0x6ffe('0x42')](_0x6ffe('0x63'));}break;default:_0x22fb02[_0x6ffe('0x42')]('\x22'+_0x39f798+'\x22');}}else{switch(_0x59b26c){case _0x6ffe('0x64'):case _0x6ffe('0x13'):_0x355993[_0x6ffe('0x42')](_0x59b26c+'\x20not\x20specified');break;default:_0x22fb02[_0x6ffe('0x42')]('\x22\x22');}}}}if(_0x355993[_0x6ffe('0x56')]){handleError(_0x41544e[_0x6ffe('0x55')][_0x384ce3],{'code':_0x6ffe('0x65'),'message':_0x355993[_0x6ffe('0x15')]()});}else{fs[_0x6ffe('0x66')](_0x10361a,_0x22fb02['join']()+'\x0a');}_0x22fb02=[];}if(!(stats[_0x6ffe('0x57')]%0xc8)){socket['emit']('contact:import:'+_0x48ef5b,stats);stats[_0x6ffe('0x58')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x2f5a8d['abort']();}}catch(_0x1c42de){handleError(_0x41544e[_0x6ffe('0x55')][_0x384ce3],{'code':_0x6ffe('0x67'),'message':_0x1c42de['message']});logger[_0x6ffe('0x3f')](_0x6ffe('0x68'),_0x1c42de[_0x6ffe('0x40')]);}},'complete':function(){try{var _0x1df36c=[];var _0x506ec7=_0x6ffe('0x28');if(_0x23d802[_0x6ffe('0x69')]&&_0x23d802['duplicates'][_0x6ffe('0x56')]){_0x506ec7=_0x6ffe('0x6a')+_0x48ef5b;_0x1df36c[_0x6ffe('0x42')](_0x6ffe('0x6b')+_0x506ec7+'\x20LIKE\x20cm_contacts;');}var _0x3dff2f=util[_0x6ffe('0xf')](_0x6ffe('0x6c'),_0x10361a,_0x506ec7,_0x2e51a2,_0x23d802[_0x6ffe('0x23')],_0x23d802[_0x6ffe('0x38')]||null,NOW,NOW);if(_['isNil'](_0x183869['scheduledat'])){_0x3dff2f+=_0x6ffe('0x6d');}_0x1df36c[_0x6ffe('0x42')](_0x3dff2f);if(_0x23d802['duplicates']&&_0x23d802[_0x6ffe('0x69')][_0x6ffe('0x56')]){_0x1df36c[_0x6ffe('0x42')](insertCmContact(_0x23d802['ListId'],_0x506ec7,_0x23d802[_0x6ffe('0x69')],_0x183869));_0x1df36c[_0x6ffe('0x42')]('DROP\x20TABLE\x20'+_0x506ec7+';');}_0x1df36c[_0x6ffe('0x42')](insertCmHopper(_0x23d802[_0x6ffe('0x23')],_0x6ffe('0x6e'),'voice_queues',_0x6ffe('0x6f'),_0x5b2e0f));_0x1df36c[_0x6ffe('0x42')](insertCmHopperBlack(_0x23d802['ListId'],_0x6ffe('0x70'),'voice_queues','VoiceQueueId'));_0x1df36c['push'](insertCmHopper(_0x23d802['ListId'],'campaigns_has_cm_lists',_0x6ffe('0x71'),'CampaignId',_0x5b2e0f));_0x1df36c['push'](insertCmHopperBlack(_0x23d802[_0x6ffe('0x23')],_0x6ffe('0x72'),_0x6ffe('0x71'),'CampaignId'));BPromise[_0x6ffe('0x73')](_0x1df36c,handleQuery)[_0x6ffe('0x74')](function(_0x3a8e91){stats[_0x6ffe('0x75')]=!![];stats[_0x6ffe('0x76')]=_0x23d802[_0x6ffe('0x69')]&&_0x23d802['duplicates'][_0x6ffe('0x56')]?results[0x2][_0x6ffe('0x76')]:results[0x0][_0x6ffe('0x76')];socket['emit'](_0x6ffe('0x77')+_0x48ef5b,stats);fs[_0x6ffe('0x78')](_0x19341f);fs[_0x6ffe('0x78')](_0x10361a);process[_0x6ffe('0x41')](0x0);})['catch'](function(_0x5c941c){logger[_0x6ffe('0x3f')](_0x5c941c['message']);process[_0x6ffe('0x41')](0x1);});}catch(_0x39e09d){logger[_0x6ffe('0x3f')](_0x6ffe('0x79'),_0x39e09d[_0x6ffe('0x40')]);process[_0x6ffe('0x41')](0x1);}},'error':function(_0x3e895a,_0x3b10d9,_0x56b728,_0x131f51){throw new Error(_0x131f51);}});}function validate(){if(process[_0x6ffe('0x7a')]&&process[_0x6ffe('0x7a')][_0x6ffe('0x56')]<0x4){throw new Error(_0x6ffe('0x7b'));}var _0x205e6=path[_0x6ffe('0x15')](config[_0x6ffe('0x4f')],_0x6ffe('0x50'),process[_0x6ffe('0x7a')][0x2]);if(!fs[_0x6ffe('0x7c')](_0x205e6)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x182283={};try{_0x182283=JSON[_0x6ffe('0x53')](process[_0x6ffe('0x7a')][0x3]);if(!_0x182283['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x182283[_0x6ffe('0x4d')]['phone']){throw new Error(_0x6ffe('0x7d'));}if(!_0x182283[_0x6ffe('0x4d')][_0x6ffe('0x64')]){throw new Error(_0x6ffe('0x7e'));}var _0x41fe49=0x0;if(_0x182283[_0x6ffe('0x4d')][_0x6ffe('0x26')]){_0x41fe49=0x1;}if(!_0x182283[_0x6ffe('0x23')]){throw new Error(_0x6ffe('0x7f'));}}catch(_0x40b032){throw new Error(_0x6ffe('0x80'));}var _0x1c3925=[];try{_0x1c3925=_[_0x6ffe('0x81')](JSON[_0x6ffe('0x53')](process[_0x6ffe('0x7a')][0x4]),'id');}catch(_0x52116d){logger[_0x6ffe('0x48')](_0x6ffe('0x82'));}main(_0x205e6,_0x182283,_0x1c3925,_0x41fe49);}validate();process['on'](_0x6ffe('0x83'),handleStop);process['on'](_0x6ffe('0x84'),handleUncaughtException); \ No newline at end of file +var _0x71bb=['from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_hopper_black','updatedAt','.CmListId','ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','field','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','code','sequelize','spread','catch','main','send','start','root','server/files/tmp','.csv','keys','parse','createReadStream','data','length','hasOwnProperty','trim','replace','isValid','push','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','agent\x20not\x20exists','email','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','then','affectedRows','unlink','argv','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','lodash','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','UserId','recallme','fields'];(function(_0x41f034,_0x193e1d){var _0x3f4447=function(_0x4aebdf){while(--_0x4aebdf){_0x41f034['push'](_0x41f034['shift']());}};_0x3f4447(++_0x193e1d);}(_0x71bb,0xd9));var _0xb71b=function(_0x17769b,_0x4e0c56){_0x17769b=_0x17769b-0x0;var _0x19c8cc=_0x71bb[_0x17769b];return _0x19c8cc;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xb71b('0x0'));var Papa=require('papaparse');var util=require(_0xb71b('0x1'));var BPromise=require(_0xb71b('0x2'));var moment=require(_0xb71b('0x3'));var squel=require(_0xb71b('0x4'));var Redis=require(_0xb71b('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xb71b('0x6'));var logger=require(_0xb71b('0x7'))(_0xb71b('0x8'));config['redis']=_['defaults'](config[_0xb71b('0x9')],{'host':_0xb71b('0xa'),'port':0x18eb});var socket=require(_0xb71b('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xb71b('0xc')](_0xb71b('0xd'));function isEmail(_0x1635f5){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))*$/[_0xb71b('0xe')](_0x1635f5);}function selectNotIn(_0x28cb13,_0x5d146b,_0x106bb7,_0x131a48,_0x56e941){return squel[_0xb71b('0xf')]()['field'](_0xb71b('0x10'))['from'](_0x131a48)[_0xb71b('0x11')](_0x5d146b,null,_0x5d146b+_0xb71b('0x12')+_0x131a48+'.'+_0x106bb7)[_0xb71b('0x13')](_0x131a48+'.'+_0x106bb7+'\x20=\x20'+_0x28cb13+'.'+_0x106bb7)['where'](_0x5d146b+_0xb71b('0x14')+_0x56e941['join']()+')');}function insertCmHopper(_0x3720c6,_0x59d33c,_0x23a971,_0x48e545,_0xd48540){var _0x267077=[_0xb71b('0x15'),_0xb71b('0x16'),_0xb71b('0x17'),_0xb71b('0x18'),_0x59d33c+'.'+_0x48e545,_0xb71b('0x19'),'cm_contacts.updatedAt',_0xb71b('0x1a'),_0xb71b('0x1b'),'\x22'+_0xd48540+'\x22'];return squel[_0xb71b('0x1c')]()[_0xb71b('0x1d')](_0xb71b('0x1e'))[_0xb71b('0x1f')]([_0xb71b('0x10'),_0xb71b('0x20'),_0xb71b('0x21'),_0xb71b('0x22'),_0x48e545,_0xb71b('0x23'),'updatedAt','priority',_0xb71b('0x24'),_0xb71b('0x25')],squel[_0xb71b('0xf')]()[_0xb71b('0x26')](_0x267077)[_0xb71b('0x27')](_0x59d33c)[_0xb71b('0x11')](_0xb71b('0x28'),null,_0xb71b('0x29')+_0x59d33c+'.CmListId')[_0xb71b('0x11')](_0x23a971,null,_0x23a971+_0xb71b('0x12')+_0x59d33c+'.'+_0x48e545)[_0xb71b('0x13')](_0x59d33c+_0xb71b('0x2a'),_0x3720c6)[_0xb71b('0x13')](_0xb71b('0x2b'),NOW)[_0xb71b('0x13')](_0xb71b('0x2c'),selectNotIn(_0x59d33c,_0x23a971,_0x48e545,'cm_hopper',[_0xb71b('0x2d'),_0xb71b('0x2e')]))[_0xb71b('0x13')](_0xb71b('0x2c'),selectNotIn(_0x59d33c,_0x23a971,_0x48e545,_0xb71b('0x1e'),['\x22always\x22'])))[_0xb71b('0x2f')]();}function insertCmHopperBlack(_0x8172ba,_0x6815f2,_0x4dcff3,_0x5e429a){var _0x2f389f=['cm_contacts.phone','cm_contacts.id',_0xb71b('0x18'),_0x6815f2+'.'+_0x5e429a,_0xb71b('0x19'),_0xb71b('0x30')];return squel[_0xb71b('0x1c')]()[_0xb71b('0x1d')](_0xb71b('0x31'))[_0xb71b('0x1f')]([_0xb71b('0x10'),_0xb71b('0x21'),_0xb71b('0x22'),_0x5e429a,_0xb71b('0x23'),_0xb71b('0x32')],squel[_0xb71b('0xf')]()['fields'](_0x2f389f)[_0xb71b('0x27')](_0x6815f2)[_0xb71b('0x11')](_0xb71b('0x28'),null,_0xb71b('0x29')+_0x6815f2+_0xb71b('0x33'))[_0xb71b('0x11')](_0x4dcff3,null,_0x4dcff3+'.id\x20=\x20'+_0x6815f2+'.'+_0x5e429a)['where'](_0x6815f2+_0xb71b('0x2a'),_0x8172ba)[_0xb71b('0x13')](_0xb71b('0x2b'),NOW)[_0xb71b('0x13')](_0xb71b('0x2c'),squel['select']()['field']('phone')[_0xb71b('0x27')](_0xb71b('0x31'))[_0xb71b('0x13')](_0xb71b('0x34'),_0x8172ba)['where'](_0x5e429a+'\x20=\x20?',_0x6815f2+'.'+_0x5e429a)))[_0xb71b('0x2f')]();}function insertCmContact(_0x2d5068,_0x33e3de,_0x5af710,_0x491c30){var _0x2a6ccc=_[_0xb71b('0x35')](_['keys'](_0x491c30),[_0xb71b('0x22'),_0xb71b('0x36'),_0xb71b('0x23'),'updatedAt']);return squel[_0xb71b('0x1c')]()['into'](_0xb71b('0x28'))['fromQuery'](_0x2a6ccc,squel[_0xb71b('0xf')]()[_0xb71b('0x26')](_0x2a6ccc)['from'](_0x33e3de)[_0xb71b('0x13')]('('+_0x5af710['join'](',')+_0xb71b('0x37'),squel[_0xb71b('0xf')]()[_0xb71b('0x26')](_0x5af710)['from'](_0xb71b('0x28'))[_0xb71b('0x13')](_0xb71b('0x34'),_0x2d5068)[_0xb71b('0x13')](_0xb71b('0x38')))[_0xb71b('0x13')]('id\x20IN\x20?',squel[_0xb71b('0xf')]()[_0xb71b('0x39')](_0xb71b('0x3a'),_0xb71b('0x3b'))[_0xb71b('0x27')](_0x33e3de)[_0xb71b('0x3c')](_0x5af710['join'](','))))[_0xb71b('0x2f')]();}function handleStop(){logger[_0xb71b('0x3d')](_0xb71b('0x3e'));stopped=!![];}function handleUncaughtException(_0x288a76){logger[_0xb71b('0x3f')](_0x288a76[_0xb71b('0x40')]);process[_0xb71b('0x41')](0x1);}function handleError(_0x41022f,_0xae0c0b){stats['errors']['push']({'name':_0xae0c0b[_0xb71b('0x42')],'message':_0xae0c0b['message'],'row':_0x41022f});}function handleQuery(_0x5498da){logger['info'](_0x5498da);return db[_0xb71b('0x43')]['query'](_0x5498da)[_0xb71b('0x44')](function(_0x588824){results['push'](_0x588824);})[_0xb71b('0x45')](function(_0x38dfbb){logger[_0xb71b('0x3f')](_0x38dfbb[_0xb71b('0x40')]);});}function main(_0x87569f,_0x431f3b,_0xc03078,_0x44e2e1){logger[_0xb71b('0x3d')](_0xb71b('0x46'),_0x87569f,JSON['stringify'](_0x431f3b));process[_0xb71b('0x47')](_0xb71b('0x48'));var _0x2e124a=_0x431f3b['binding'];var _0x316b5e=_0x431f3b['socket_timestamp'];var _0xf71933=path[_0xb71b('0x11')](config[_0xb71b('0x49')],_0xb71b('0x4a'),_0x316b5e+_0xb71b('0x4b'));var _0xd97f85=_[_0xb71b('0x4c')](_0x2e124a)[_0xb71b('0x11')]();logger['info']('header',_0xd97f85);fs['writeFileSync'](_0xf71933,_0xd97f85+'\x0a');Papa[_0xb71b('0x4d')](fs[_0xb71b('0x4e')](_0x87569f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x27800a,_0x39b6b2){try{for(var _0x5551a7=0x0,_0x5c17e1=[];_0x5551a7<_0x27800a[_0xb71b('0x4f')][_0xb71b('0x50')];_0x5551a7++){stats['rows']+=0x1;if(_0x27800a['errors'][_0x5551a7]){handleError(_0x27800a[_0xb71b('0x4f')][_0x5551a7],_0x27800a['errors'][_0x5551a7]);}else{var _0x151909=[];for(var _0xd94f28 in _0x2e124a){if(_0x2e124a[_0xb71b('0x51')](_0xd94f28)){if(_0x27800a[_0xb71b('0x4f')][_0x5551a7][_0x2e124a[_0xd94f28]]){var _0x100266=_[_0xb71b('0x52')](_0x27800a[_0xb71b('0x4f')][_0x5551a7][_0x2e124a[_0xd94f28]][_0xb71b('0x53')](/"/g,'\x27'));switch(_0xd94f28){case _0xb71b('0x20'):var _0x57fa2e=moment(_0x100266,_0xb71b('0xd'),!![]);if(_0x57fa2e[_0xb71b('0x54')]()){_0x5c17e1['push']('\x22'+_0x100266+'\x22');}else{_0x151909[_0xb71b('0x55')](_0xb71b('0x56'));}break;case _0xb71b('0x57'):var _0x18fdf8=parseInt(_0x100266);_0x100266=_['isNaN'](_0x18fdf8)||_0x18fdf8<0x0||_0x18fdf8>0x4?_0x44e2e1?0x3:0x2:_0x18fdf8;_0x5c17e1[_0xb71b('0x55')]('\x22'+_0x100266+'\x22');break;case _0xb71b('0x24'):var _0x497cd2=parseInt(_0x100266);if(_[_0xb71b('0x58')](_0x497cd2)&&_['includes'](_0xc03078,_0x497cd2)){_0x5c17e1[_0xb71b('0x55')]('\x22'+_0x497cd2+'\x22');}else{_0x151909['push'](_0xb71b('0x59'));}break;case _0xb71b('0x5a'):if(isEmail(_0x100266)){_0x5c17e1[_0xb71b('0x55')]('\x22'+_0x100266+'\x22');}else{_0x151909[_0xb71b('0x55')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x5819d8=moment(_0x100266,'YYYY-MM-DD',!![]);if(_0x5819d8[_0xb71b('0x54')]()){_0x5c17e1[_0xb71b('0x55')]('\x22'+_0x100266+'\x22');}else{_0x151909[_0xb71b('0x55')](_0xb71b('0x5b'));}break;default:_0x5c17e1[_0xb71b('0x55')]('\x22'+_0x100266+'\x22');}}else{switch(_0xd94f28){case _0xb71b('0x5c'):case _0xb71b('0x10'):_0x151909[_0xb71b('0x55')](_0xd94f28+_0xb71b('0x5d'));break;default:_0x5c17e1[_0xb71b('0x55')]('\x22\x22');}}}}if(_0x151909[_0xb71b('0x50')]){handleError(_0x27800a['data'][_0x5551a7],{'code':_0xb71b('0x5e'),'message':_0x151909[_0xb71b('0x11')]()});}else{fs['appendFileSync'](_0xf71933,_0x5c17e1[_0xb71b('0x11')]()+'\x0a');}_0x5c17e1=[];}if(!(stats['rows']%0xc8)){socket[_0xb71b('0x5f')](_0xb71b('0x60')+_0x316b5e,stats);stats['errors']=[];}}if(stopped){logger[_0xb71b('0x3d')](_0xb71b('0x61'));_0x39b6b2[_0xb71b('0x62')]();}}catch(_0xb3acdf){handleError(_0x27800a[_0xb71b('0x4f')][_0x5551a7],{'code':_0xb71b('0x63'),'message':_0xb3acdf[_0xb71b('0x40')]});logger[_0xb71b('0x3f')](_0xb71b('0x64'),_0xb3acdf[_0xb71b('0x40')]);}},'complete':function(){try{var _0x13eef6=[];var _0xddb6be=_0xb71b('0x28');if(_0x431f3b[_0xb71b('0x65')]&&_0x431f3b[_0xb71b('0x65')][_0xb71b('0x50')]){_0xddb6be=_0xb71b('0x66')+_0x316b5e;_0x13eef6[_0xb71b('0x55')]('CREATE\x20TABLE\x20'+_0xddb6be+_0xb71b('0x67'));}var _0x2df674=util[_0xb71b('0xc')](_0xb71b('0x68'),_0xf71933,_0xddb6be,_0xd97f85,_0x431f3b[_0xb71b('0x22')],_0x431f3b[_0xb71b('0x36')]||null,NOW,NOW);if(_[_0xb71b('0x69')](_0x2e124a[_0xb71b('0x20')])){_0x2df674+=_0xb71b('0x6a');}_0x13eef6[_0xb71b('0x55')](_0x2df674);if(_0x431f3b[_0xb71b('0x65')]&&_0x431f3b[_0xb71b('0x65')][_0xb71b('0x50')]){_0x13eef6[_0xb71b('0x55')](insertCmContact(_0x431f3b[_0xb71b('0x22')],_0xddb6be,_0x431f3b[_0xb71b('0x65')],_0x2e124a));_0x13eef6[_0xb71b('0x55')](_0xb71b('0x6b')+_0xddb6be+';');}_0x13eef6[_0xb71b('0x55')](insertCmHopper(_0x431f3b[_0xb71b('0x22')],_0xb71b('0x6c'),'voice_queues',_0xb71b('0x6d'),_0x44e2e1));_0x13eef6[_0xb71b('0x55')](insertCmHopperBlack(_0x431f3b[_0xb71b('0x22')],_0xb71b('0x6e'),_0xb71b('0x6f'),_0xb71b('0x6d')));_0x13eef6[_0xb71b('0x55')](insertCmHopper(_0x431f3b[_0xb71b('0x22')],_0xb71b('0x70'),_0xb71b('0x71'),'CampaignId',_0x44e2e1));_0x13eef6[_0xb71b('0x55')](insertCmHopperBlack(_0x431f3b['ListId'],_0xb71b('0x72'),_0xb71b('0x71'),_0xb71b('0x73')));BPromise['each'](_0x13eef6,handleQuery)[_0xb71b('0x74')](function(_0x4e8434){stats['finish']=!![];stats[_0xb71b('0x75')]=_0x431f3b[_0xb71b('0x65')]&&_0x431f3b[_0xb71b('0x65')][_0xb71b('0x50')]?results[0x2][_0xb71b('0x75')]:results[0x0][_0xb71b('0x75')];socket[_0xb71b('0x5f')](_0xb71b('0x60')+_0x316b5e,stats);fs[_0xb71b('0x76')](_0x87569f);fs[_0xb71b('0x76')](_0xf71933);process['exit'](0x0);})['catch'](function(_0x2ee38b){logger[_0xb71b('0x3f')](_0x2ee38b[_0xb71b('0x40')]);process[_0xb71b('0x41')](0x1);});}catch(_0x502eb8){logger[_0xb71b('0x3f')]('complete',_0x502eb8['message']);process[_0xb71b('0x41')](0x1);}},'error':function(_0x56e319,_0x44214d,_0x4d123c,_0x15cd95){throw new Error(_0x15cd95);}});}function validate(){if(process[_0xb71b('0x77')]&&process[_0xb71b('0x77')][_0xb71b('0x50')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x27cf10=path[_0xb71b('0x11')](config['root'],'server/files/tmp',process[_0xb71b('0x77')][0x2]);if(!fs[_0xb71b('0x78')](_0x27cf10)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x39b0f0={};try{_0x39b0f0=JSON['parse'](process[_0xb71b('0x77')][0x3]);if(!_0x39b0f0[_0xb71b('0x79')]){throw new Error(_0xb71b('0x7a'));}if(!_0x39b0f0[_0xb71b('0x79')]['phone']){throw new Error(_0xb71b('0x7b'));}if(!_0x39b0f0[_0xb71b('0x79')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x2bd80e=0x0;if(_0x39b0f0['binding'][_0xb71b('0x24')]){_0x2bd80e=0x1;}if(!_0x39b0f0[_0xb71b('0x22')]){throw new Error(_0xb71b('0x7c'));}}catch(_0x426081){throw new Error(_0xb71b('0x7d'));}var _0xed0e0b=[];try{_0xed0e0b=_['map'](JSON[_0xb71b('0x4d')](process['argv'][0x4]),'id');}catch(_0x3570b3){logger[_0xb71b('0x3d')]('No\x20agent\x20available');}main(_0x27cf10,_0x39b0f0,_0xed0e0b,_0x2bd80e);}validate();process['on'](_0xb71b('0x7e'),handleStop);process['on'](_0xb71b('0x7f'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 87b8567..d2639f8 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eea=['UniqueId','starttime','answertime','Complete\x20Time','endtime','Duration','duration','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','outbound','string','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','Call\x20To','destexten','uniqueid','Date','agentcalledAt','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','membername'];(function(_0x507dad,_0x1e3344){var _0x4f474a=function(_0xc86cfa){while(--_0xc86cfa){_0x507dad['push'](_0x507dad['shift']());}};_0x4f474a(++_0x1e3344);}(_0x4eea,0x183));var _0xa4ee=function(_0x124491,_0x1778c4){_0x124491=_0x124491-0x0;var _0x414580=_0x4eea[_0x124491];return _0x414580;};'use strict';exports[_0xa4ee('0x0')]=function(_0x3b5e4b,_0x5dd3f0){var _0x1e798e=[{'type':'string','content':_0xa4ee('0x1'),'variableName':null}];switch(_0x3b5e4b[_0xa4ee('0x2')]()){case _0xa4ee('0x3'):switch(_0x5dd3f0[_0xa4ee('0x2')]()){case _0xa4ee('0x4'):_0x1e798e[_0xa4ee('0x5')]({'type':_0xa4ee('0x6'),'content':'','variableName':_0xa4ee('0x7')});_0x1e798e['push']({'type':_0xa4ee('0x6'),'content':'','variableName':'calleridnum'});break;case _0xa4ee('0x8'):_0x1e798e['push']({'type':_0xa4ee('0x9'),'content':'Outbound\x20Call','variableName':null});_0x1e798e['push']({'type':_0xa4ee('0x6'),'content':'','variableName':_0xa4ee('0xa')});break;}}return _0x1e798e;};exports['getDescriptions']=function(_0x53e265,_0x1c2ab0){var _0x3f82d1=[];switch(_0x53e265[_0xa4ee('0x2')]()){case _0xa4ee('0x3'):switch(_0x1c2ab0[_0xa4ee('0x2')]()){case'inbound':_0x3f82d1=[{'type':'string','content':_0xa4ee('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0xd'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0xe')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0xf'),'keyType':'variable','variableName':_0xa4ee('0x10')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x11'),'keyType':'variable','variableName':_0xa4ee('0x12')},{'type':_0xa4ee('0xc'),'content':'','key':'Queue','keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x7')},{'type':_0xa4ee('0xc'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0xa4ee('0x13')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x14'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x15')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa4ee('0xc'),'content':'','key':'Agent\x20Name','keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x16')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':'variable','variableName':'destcalleridnum'},{'type':_0xa4ee('0x9'),'content':_0xa4ee('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x18'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x15')},{'type':_0xa4ee('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':'agentconnectAt'},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x19'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x1a')},{'type':_0xa4ee('0xc'),'content':'','key':'Hold\x20Time','keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x1b')},{'type':'keyValue','content':'','key':_0xa4ee('0x1c'),'keyType':_0xa4ee('0x6'),'variableName':_0xa4ee('0x1d')}];break;case _0xa4ee('0x8'):_0x3f82d1=[{'type':_0xa4ee('0x9'),'content':_0xa4ee('0xb'),'variableName':null},{'type':_0xa4ee('0xc'),'content':'','key':'Called\x20Number','keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0xa')},{'type':_0xa4ee('0xc'),'content':'','key':'Member\x20Name','keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x1e')},{'type':'keyValue','content':'','key':_0xa4ee('0x1f'),'keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x13')},{'type':_0xa4ee('0xc'),'content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0xa4ee('0x20')},{'type':_0xa4ee('0x9'),'content':_0xa4ee('0x17')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x21')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x22'),'keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x23')},{'type':_0xa4ee('0xc'),'content':'','key':_0xa4ee('0x24'),'keyType':_0xa4ee('0x6'),'keyContent':'','variableName':_0xa4ee('0x25')},{'type':_0xa4ee('0xc'),'content':'','key':'Billable\x20Time','keyType':_0xa4ee('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x3f82d1;}; \ No newline at end of file +var _0x406e=['***\x20Time\x20Info\x20***','Answer\x20Time','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','variable','queue','calleridnum','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','outbound','Called\x20Number','starttime'];(function(_0x4e5c46,_0x27afb9){var _0x31e6f0=function(_0x4c6a85){while(--_0x4c6a85){_0x4e5c46['push'](_0x4e5c46['shift']());}};_0x31e6f0(++_0x27afb9);}(_0x406e,0xae));var _0xe406=function(_0x840300,_0x3fa1df){_0x840300=_0x840300-0x0;var _0x4be032=_0x406e[_0x840300];return _0x4be032;};'use strict';exports[_0xe406('0x0')]=function(_0x671012,_0x5ce39c){var _0x708c51=[{'type':_0xe406('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x671012[_0xe406('0x2')]()){case _0xe406('0x3'):switch(_0x5ce39c[_0xe406('0x2')]()){case _0xe406('0x4'):_0x708c51[_0xe406('0x5')]({'type':_0xe406('0x6'),'content':'','variableName':_0xe406('0x7')});_0x708c51[_0xe406('0x5')]({'type':_0xe406('0x6'),'content':'','variableName':_0xe406('0x8')});break;case'outbound':_0x708c51[_0xe406('0x5')]({'type':_0xe406('0x1'),'content':'Outbound\x20Call','variableName':null});_0x708c51[_0xe406('0x5')]({'type':_0xe406('0x6'),'content':'','variableName':_0xe406('0x9')});break;}}return _0x708c51;};exports[_0xe406('0xa')]=function(_0x1c5707,_0x13f027){var _0x1c0e86=[];switch(_0x1c5707['toLowerCase']()){case _0xe406('0x3'):switch(_0x13f027[_0xe406('0x2')]()){case'inbound':_0x1c0e86=[{'type':_0xe406('0x1'),'content':_0xe406('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0xd'),'keyType':_0xe406('0x6'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0xe406('0xe'),'keyType':_0xe406('0x6'),'variableName':_0xe406('0xf')},{'type':'keyValue','content':'','key':_0xe406('0x10'),'keyType':_0xe406('0x6'),'variableName':_0xe406('0x11')},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x12'),'keyType':'variable','variableName':_0xe406('0x7')},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x13'),'keyType':_0xe406('0x6'),'variableName':_0xe406('0x14')},{'type':'keyValue','content':'','key':_0xe406('0x15'),'keyType':_0xe406('0x6'),'variableName':'agentcalledAt'},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x16'),'keyType':_0xe406('0x6'),'variableName':_0xe406('0x17')},{'type':'keyValue','content':'','key':_0xe406('0x18'),'keyType':'variable','variableName':_0xe406('0x9')},{'type':_0xe406('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xe406('0x19'),'keyType':'variable','variableName':_0xe406('0x1a')},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x1b'),'keyType':_0xe406('0x6'),'variableName':_0xe406('0x1c')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0xe406('0x6'),'variableName':_0xe406('0x1d')},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x1e'),'keyType':_0xe406('0x6'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0xe406('0x1f'),'keyType':_0xe406('0x6'),'variableName':_0xe406('0x20')}];break;case _0xe406('0x21'):_0x1c0e86=[{'type':_0xe406('0x1'),'content':_0xe406('0xb'),'variableName':null},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x22'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0xe406('0xc'),'content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x13'),'keyType':_0xe406('0x6'),'keyContent':'','variableName':_0xe406('0x14')},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x15'),'keyType':_0xe406('0x6'),'keyContent':'','variableName':_0xe406('0x23')},{'type':_0xe406('0x1'),'content':_0xe406('0x24')},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x25'),'keyType':_0xe406('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xe406('0xc'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xe406('0x26')},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x27'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xe406('0xc'),'content':'','key':_0xe406('0x28'),'keyType':_0xe406('0x6'),'keyContent':'','variableName':_0xe406('0x29')}];break;}}return _0x1c0e86;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index db1f8ab..dd9a829 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf663=['mail-interactions','fax-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','Interaction','findOne','then','info','catch','error','tracked','user','query','omit','body','html','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0xf663,0xf0));var _0x3f66=function(_0xaf8280,_0x5c1176){_0xaf8280=_0xaf8280-0x0;var _0x1b92a5=_0xf663[_0xaf8280];return _0x1b92a5;};'use strict';var _=require('lodash');var db=require(_0x3f66('0x0'))['db'];var loggers={'openchannel':require(_0x3f66('0x1'))(_0x3f66('0x2')),'mail':require(_0x3f66('0x1'))(_0x3f66('0x3')),'fax':require(_0x3f66('0x1'))(_0x3f66('0x4')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x3f66('0x1'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0x3f66('0x5'))};function getInteractionId(_0xdf08b5,_0x49ed72,_0x54d258){if(_0xdf08b5&&_0xdf08b5[_[_0x3f66('0x6')](_0x54d258)+_0x3f66('0x7')]){return _0xdf08b5[_[_0x3f66('0x6')](_0x54d258)+_0x3f66('0x7')];}else if(_0xdf08b5&&_0xdf08b5['id']){return _0xdf08b5['id'];}else if(_0x49ed72&&_0x49ed72['id']){return _0x49ed72['id'];}else{return _0x3f66('0x8');}}function log(_0x5be4ea,_0x139fe2,_0x429540,_0x1f65e2,_0x2617f7,_0x1b1596){loggers[_0x2617f7[_0x3f66('0x9')]()][_0x5be4ea](_0x3f66('0xa'),_0x1b1596[_0x3f66('0xb')](),_0x139fe2?_0x139fe2['id']:null,_0x139fe2?_0x139fe2['name']:null,_0x139fe2?_0x139fe2['role']:null,getInteractionId(_0x429540,_0x1f65e2,_0x2617f7),_0x429540?JSON[_0x3f66('0xc')](_0x429540):'null');}function updateUser(_0x467c44,_0x14bd14,_0x16ac6a,_0x338617,_0x16b278){db[_['upperFirst'](_0x338617)+_0x3f66('0xd')][_0x3f66('0xe')]({'where':{'id':getInteractionId(_0x14bd14,_0x16ac6a,_0x338617)}})[_0x3f66('0xf')](function(_0x52d367){if(_0x52d367){return _0x52d367['update']({'UserId':_0x467c44?_0x467c44['id']:null});}})['then'](function(_0x5bc561){if(_0x5bc561){log(_0x3f66('0x10'),_0x467c44,_0x14bd14,_0x16ac6a,_0x338617,_0x16b278);}})[_0x3f66('0x11')](function(){log(_0x3f66('0x12'),_0x467c44,_0x14bd14,_0x16ac6a,_0x338617,_0x16b278);});}exports[_0x3f66('0x13')]=function(_0x122029,_0x3cd418){return function(_0xc8e58e,_0x22ed8f,_0x37c1f2){var _0x51d2fe=_0xc8e58e[_0x3f66('0x14')];var _0xec3436={};var _0x43a8d1=_0xc8e58e[_0x3f66('0x15')];if(_0xec3436){_0xec3436=_['clone'](_0xc8e58e['body']);_0xec3436=_[_0x3f66('0x16')](_0xec3436,[_0x3f66('0x17'),_0x3f66('0x18'),'phone',_0x3f66('0x19'),_0x3f66('0x1a')]);}updateUser(_0x51d2fe,_0xec3436,_0x43a8d1,_0x122029,_0x3cd418);_0x37c1f2(null);};}; \ No newline at end of file +var _0x9d1c=['info','catch','query','clone','omit','body','html','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','findOne','then','update'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9d1c,0xd1));var _0xc9d1=function(_0x3cfd8c,_0x375f30){_0x3cfd8c=_0x3cfd8c-0x0;var _0x38ed4e=_0x9d1c[_0x3cfd8c];return _0x38ed4e;};'use strict';var _=require(_0xc9d1('0x0'));var db=require(_0xc9d1('0x1'))['db'];var loggers={'openchannel':require(_0xc9d1('0x2'))(_0xc9d1('0x3')),'mail':require(_0xc9d1('0x2'))(_0xc9d1('0x4')),'fax':require(_0xc9d1('0x2'))(_0xc9d1('0x5')),'sms':require(_0xc9d1('0x2'))(_0xc9d1('0x6')),'chat':require(_0xc9d1('0x2'))('chat-interactions'),'whatsapp':require(_0xc9d1('0x2'))('whatsapp-interactions')};function getInteractionId(_0x3c70b0,_0x1946b9,_0x22d8f1){if(_0x3c70b0&&_0x3c70b0[_[_0xc9d1('0x7')](_0x22d8f1)+_0xc9d1('0x8')]){return _0x3c70b0[_['upperFirst'](_0x22d8f1)+_0xc9d1('0x8')];}else if(_0x3c70b0&&_0x3c70b0['id']){return _0x3c70b0['id'];}else if(_0x1946b9&&_0x1946b9['id']){return _0x1946b9['id'];}else{return'unknown';}}function log(_0x284c67,_0x5d6fc2,_0x32bb82,_0x330b9b,_0x95a023,_0x3d942e){loggers[_0x95a023['toLowerCase']()][_0x284c67](_0xc9d1('0x9'),_0x3d942e['toUpperCase'](),_0x5d6fc2?_0x5d6fc2['id']:null,_0x5d6fc2?_0x5d6fc2['name']:null,_0x5d6fc2?_0x5d6fc2[_0xc9d1('0xa')]:null,getInteractionId(_0x32bb82,_0x330b9b,_0x95a023),_0x32bb82?JSON[_0xc9d1('0xb')](_0x32bb82):_0xc9d1('0xc'));}function updateUser(_0x1c088a,_0x560bfd,_0x155429,_0x426dd7,_0x23b40a){db[_['upperFirst'](_0x426dd7)+'Interaction'][_0xc9d1('0xd')]({'where':{'id':getInteractionId(_0x560bfd,_0x155429,_0x426dd7)}})[_0xc9d1('0xe')](function(_0x27a5d8){if(_0x27a5d8){return _0x27a5d8[_0xc9d1('0xf')]({'UserId':_0x1c088a?_0x1c088a['id']:null});}})['then'](function(_0x56ad12){if(_0x56ad12){log(_0xc9d1('0x10'),_0x1c088a,_0x560bfd,_0x155429,_0x426dd7,_0x23b40a);}})[_0xc9d1('0x11')](function(){log('error',_0x1c088a,_0x560bfd,_0x155429,_0x426dd7,_0x23b40a);});}exports['tracked']=function(_0x1a08ed,_0x5b0d66){return function(_0x2bfb1c,_0x551824,_0x1b0cec){var _0x5ab9f1=_0x2bfb1c['user'];var _0xa81f5b={};var _0x45e551=_0x2bfb1c[_0xc9d1('0x12')];if(_0xa81f5b){_0xa81f5b=_[_0xc9d1('0x13')](_0x2bfb1c['body']);_0xa81f5b=_[_0xc9d1('0x14')](_0xa81f5b,[_0xc9d1('0x15'),_0xc9d1('0x16'),'phone',_0xc9d1('0x17'),_0xc9d1('0x18')]);}updateUser(_0x5ab9f1,_0xa81f5b,_0x45e551,_0x1a08ed,_0x5b0d66);_0x1b0cec(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index a748027..f32e706 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7595=['catch','users','admin','user','isUserLimit','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x1aab9d,_0x503b9e){var _0x3840b2=function(_0x338c19){while(--_0x338c19){_0x1aab9d['push'](_0x1aab9d['shift']());}};_0x3840b2(++_0x503b9e);}(_0x7595,0xcd));var _0x5759=function(_0x55d408,_0x25416e){_0x55d408=_0x55d408-0x0;var _0x46fec2=_0x7595[_0x55d408];return _0x46fec2;};'use strict';var crypto=require('crypto');var util=require(_0x5759('0x0'));var compose=require(_0x5759('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x5759('0x2'));function getValueFromLicense(_0x902611,_0x36ae86){if(_0x902611&&_0x36ae86){if(_0x36ae86[_0x5759('0x3')]&&_0x36ae86[_0x5759('0x4')]){var _0x3632a4=_0x36ae86[_0x5759('0x3')];var _0x1b0a0a=_0x36ae86[_0x5759('0x4')];var _0x5ebdda=_0x3632a4['split']('-')[0x4];var _0x3a2851=_0x3632a4[_0x5759('0x5')]('-')[0x0];var _0x4253b8=crypto[_0x5759('0x6')]('aes-256-ctr',util['format']('%s:%s:%s',_0x5ebdda,_0x3632a4,_0x3a2851));var _0x3894b7=_0x4253b8['update'](_0x1b0a0a,_0x5759('0x7'),_0x5759('0x8'));_0x3894b7+=_0x4253b8[_0x5759('0x9')](_0x5759('0x8'));var _0x647102=JSON[_0x5759('0xa')](_0x3894b7);return _0x647102[_0x5759('0xb')](_0x902611)?_0x647102[_0x902611]:null;}}return null;}function isLimit(_0x221a46,_0xa7acf7,_0xdc70d6,_0x437477){var _0x1e0bd2=_0xa7acf7;return compose()[_0x5759('0xc')](function(_0x109c60,_0x17611f,_0x5c4291){return db[_0x5759('0xd')][_0x5759('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x5759('0xf')](function(_0x345c9d){var _0x2cc5c7=getValueFromLicense(_0x221a46,_0x345c9d);return _0x2cc5c7?_0x2cc5c7:_0x1e0bd2;})[_0x5759('0xf')](function(_0x3e4836){_0x1e0bd2=_0x3e4836;return _0xdc70d6[_0x5759('0x10')](_0x437477);})['then'](function(_0x4355fa){if(_0x4355fa>=_0x1e0bd2){return _0x17611f[_0x5759('0x11')](0x193)['json']({'message':util[_0x5759('0x12')](_0x5759('0x13'),_0x221a46)});}_0x5c4291();})[_0x5759('0x14')](function(_0x4f5fd4){_0x5c4291(_0x4f5fd4);});});}function isUserLimit(){return isLimit(_0x5759('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x5759('0x16')},{'role':_0x5759('0x17')}]}});}exports[_0x5759('0x18')]=isUserLimit; \ No newline at end of file +var _0x466a=['data1','license','split','createDecipher','aes-256-ctr','format','update','utf8','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x466a,0x7e));var _0xa466=function(_0x24617c,_0x393ce4){_0x24617c=_0x24617c-0x0;var _0x22f136=_0x466a[_0x24617c];return _0x22f136;};'use strict';var crypto=require(_0xa466('0x0'));var util=require(_0xa466('0x1'));var compose=require(_0xa466('0x2'));var db=require(_0xa466('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1e55e0,_0x40a548){if(_0x1e55e0&&_0x40a548){if(_0x40a548[_0xa466('0x4')]&&_0x40a548[_0xa466('0x5')]){var _0x4aa4b8=_0x40a548['data1'];var _0x1d8cb7=_0x40a548[_0xa466('0x5')];var _0x143de6=_0x4aa4b8[_0xa466('0x6')]('-')[0x4];var _0x297e9b=_0x4aa4b8[_0xa466('0x6')]('-')[0x0];var _0x4762aa=crypto[_0xa466('0x7')](_0xa466('0x8'),util[_0xa466('0x9')]('%s:%s:%s',_0x143de6,_0x4aa4b8,_0x297e9b));var _0x53af75=_0x4762aa[_0xa466('0xa')](_0x1d8cb7,'base64','utf8');_0x53af75+=_0x4762aa['final'](_0xa466('0xb'));var _0xae51e2=JSON['parse'](_0x53af75);return _0xae51e2[_0xa466('0xc')](_0x1e55e0)?_0xae51e2[_0x1e55e0]:null;}}return null;}function isLimit(_0x50e7b4,_0x4639f0,_0x3be6d8,_0x3e7601){var _0x25beb2=_0x4639f0;return compose()[_0xa466('0xd')](function(_0x5374c1,_0x10d271,_0x23e9d5){return db[_0xa466('0xe')][_0xa466('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xa466('0x10')](function(_0x1566a1){var _0x4d64f2=getValueFromLicense(_0x50e7b4,_0x1566a1);return _0x4d64f2?_0x4d64f2:_0x25beb2;})[_0xa466('0x10')](function(_0x420095){_0x25beb2=_0x420095;return _0x3be6d8[_0xa466('0x11')](_0x3e7601);})['then'](function(_0x59d075){if(_0x59d075>=_0x25beb2){return _0x10d271[_0xa466('0x12')](0x193)[_0xa466('0x13')]({'message':util[_0xa466('0x9')](_0xa466('0x14'),_0x50e7b4)});}_0x23e9d5();})[_0xa466('0x15')](function(_0x4533ec){_0x23e9d5(_0x4533ec);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xa466('0x16')],{'where':{'$or':[{'role':_0xa466('0x17')},{'role':_0xa466('0x18')}]}});}exports[_0xa466('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 9fe3877..fd049ce 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 _0xbeaf=['parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','includes','$lte','value','days','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','start','utcOffset','add','hours','minutes','seconds','format','lodash','moment'];(function(_0x494108,_0x106ac5){var _0x310cfa=function(_0x4a9560){while(--_0x4a9560){_0x494108['push'](_0x494108['shift']());}};_0x310cfa(++_0x106ac5);}(_0xbeaf,0x12a));var _0xfbea=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbeaf[_0x432682];return _0x463d05;};'use strict';var _=require(_0xfbea('0x0'));var moment=require(_0xfbea('0x1'));exports[_0xfbea('0x2')]=function(_0x54ee13){var _0xb7768a={'conditions':[]};_0xb7768a[_0xfbea('0x3')]=_[_0xfbea('0x4')](_0x54ee13,_0xfbea('0x5'))?'or':_0xfbea('0x6');var _0x57fb78=_0x54ee13[_0xfbea('0x7')](_0xfbea('0x8'),'')['replace'](_0xfbea('0x5'),'')[_0xfbea('0x9')]('||');for(var _0x4b76c0=0x0;_0x4b76c0<_0x57fb78[_0xfbea('0xa')];_0x4b76c0++){var _0xb43e41=_0x57fb78[_0x4b76c0][_0xfbea('0x9')](':=');var _0x291705=_0xb43e41[0x0];var _0x4110d3=_0xb43e41['slice'](0x1);_0x4110d3[_0xfbea('0xb')](function(_0xf670f3){var _0x377494=_0xf670f3[_0xfbea('0x9')]('[')[_0xfbea('0xc')]();var _0x39068e=_0xf670f3[_0xfbea('0xd')](/\[(.*?)\]/g);_0x39068e[_0xfbea('0xb')](function(_0x382ba6){var _0x109a14=_0x382ba6[_0xfbea('0x9')]('[')[_0xfbea('0xe')](function(_0x961de0){return _0x961de0[_0xfbea('0xf')](']')>-0x1;})[_0xfbea('0x10')](function(_0x182cf5){return _0x182cf5[_0xfbea('0x9')](']')[0x0];})[0x0];_0xb7768a[_0xfbea('0x11')][_0xfbea('0x12')]({'field':_0x291705,'operator':_0x377494,'value':_0x109a14});});});}return _0xb7768a;};exports[_0xfbea('0x13')]=function(_0x234d0f,_0xcb1bdf,_0x5a97db){var _0x4b96d1={};if(_0xcb1bdf===_0xfbea('0x14')){if(_0x5a97db['operator']==='$eq'){_0x5a97db[_0xfbea('0x15')]=_0xfbea('0x16');_0x5a97db['value']+=','+_0x5a97db['value'];}else if(_[_0xfbea('0x17')](['$gt',_0xfbea('0x18')],_0x5a97db['operator'])){_0x5a97db[_0xfbea('0x19')]=moment(_0x5a97db[_0xfbea('0x19')])['add'](0x1,_0xfbea('0x1a'))['format']('YYYY-MM-DD');}}if(_0x5a97db[_0xfbea('0x1b')]){_0xcb1bdf=_0x5a97db[_0xfbea('0x1b')];_0x4b96d1[_0xfbea('0x1c')]=_0xfbea('0x1d')+_0x234d0f+'.'+_0x5a97db[_0xfbea('0x1e')]+_0xfbea('0x1f')+_0x5a97db['castTo']+')\x20'+parseOperator(_0x5a97db[_0xfbea('0x15')]);}else{_0x4b96d1['text']=_0x234d0f+'.'+_0x5a97db[_0xfbea('0x1e')]+'\x20'+parseOperator(_0x5a97db[_0xfbea('0x15')]);}if(_[_0xfbea('0x17')]([_0xfbea('0x20'),_0xfbea('0x21')],_0x5a97db[_0xfbea('0x15')]))_0x4b96d1[_0xfbea('0x1c')]='('+_0x4b96d1[_0xfbea('0x1c')]+_0xfbea('0x22')+_0x234d0f+'.'+_0x5a97db[_0xfbea('0x1e')]+_0xfbea('0x23');_0x4b96d1[_0xfbea('0x19')]=parseValue(_0xcb1bdf,_0x5a97db[_0xfbea('0x15')],_0x5a97db[_0xfbea('0x19')]);return _0x4b96d1;};function parseOperator(_0x2fb158){var _0x5a2237;switch(_0x2fb158){case _0xfbea('0x24'):_0x5a2237=_0xfbea('0x25');break;case'$notIn':_0x5a2237=_0xfbea('0x26');break;case _0xfbea('0x27'):_0x5a2237=_0xfbea('0x28');break;case _0xfbea('0x20'):_0x5a2237=_0xfbea('0x29');break;case _0xfbea('0x2a'):case _0xfbea('0x2b'):case _0xfbea('0x2c'):_0x5a2237=_0xfbea('0x2d');break;case _0xfbea('0x2e'):_0x5a2237=_0xfbea('0x2f');break;case _0xfbea('0x30'):_0x5a2237=_0xfbea('0x31');break;case _0xfbea('0x18'):_0x5a2237=_0xfbea('0x32');break;case _0xfbea('0x33'):_0x5a2237=_0xfbea('0x34');break;case'$between':_0x5a2237='BETWEEN\x20?\x20AND\x20?';break;}return _0x5a2237;}function parseValue(_0x179ec5,_0x290eb9,_0x2cbd52){var _0x407a51={'start':undefined,'end':undefined};switch(_0x290eb9){case _0xfbea('0x24'):case _0xfbea('0x21'):_0x407a51[_0xfbea('0x35')]=_0x2cbd52[_0xfbea('0x9')](',');break;case _0xfbea('0x2a'):_0x407a51[_0xfbea('0x35')]='%'+_0x2cbd52+'%';break;case _0xfbea('0x2b'):_0x407a51['start']=_0x2cbd52+'%';break;case _0xfbea('0x2c'):_0x407a51[_0xfbea('0x35')]='%'+_0x2cbd52;break;case _0xfbea('0x16'):var _0x139d8f=_0x2cbd52['split'](',');var _0x2cbd52=_0x139d8f[_0xfbea('0xc')]();var _0x5e399c=_0x139d8f['pop']();if(_0x179ec5===_0xfbea('0x14')){_0x2cbd52=moment(_0x2cbd52)[_0xfbea('0x36')](0x0,!![])['format']();_0x5e399c=moment(_0x5e399c)['utcOffset'](0x0,!![])[_0xfbea('0x37')](0x17,_0xfbea('0x38'))[_0xfbea('0x37')](0x3b,_0xfbea('0x39'))[_0xfbea('0x37')](0x3b,_0xfbea('0x3a'))[_0xfbea('0x3b')]();}_0x407a51={'start':_0x2cbd52,'end':_0x5e399c};break;default:_0x407a51[_0xfbea('0x35')]=_0x2cbd52;break;}return _0x407a51;} \ No newline at end of file +var _0xabc0=['<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','sqlOperator','startsWith','[$and]','replace','split','slice','forEach','shift','match','indexOf','map','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','add','days','format','castTo','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','field','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$lte'];(function(_0x18c0a0,_0x4b1cd7){var _0x3b3cc4=function(_0x6a27ae){while(--_0x6a27ae){_0x18c0a0['push'](_0x18c0a0['shift']());}};_0x3b3cc4(++_0x4b1cd7);}(_0xabc0,0xa8));var _0x0abc=function(_0x57387b,_0x25df6a){_0x57387b=_0x57387b-0x0;var _0x281d3f=_0xabc0[_0x57387b];return _0x281d3f;};'use strict';var _=require(_0x0abc('0x0'));var moment=require(_0x0abc('0x1'));exports['parseSearch']=function(_0x2aa1aa){var _0x1086c5={'conditions':[]};_0x1086c5[_0x0abc('0x2')]=_[_0x0abc('0x3')](_0x2aa1aa,'[$or]')?'or':'and';var _0x916565=_0x2aa1aa['replace'](_0x0abc('0x4'),'')[_0x0abc('0x5')]('[$or]','')[_0x0abc('0x6')]('||');for(var _0x150499=0x0;_0x150499<_0x916565['length'];_0x150499++){var _0x5076ad=_0x916565[_0x150499][_0x0abc('0x6')](':=');var _0x563c0b=_0x5076ad[0x0];var _0x516b55=_0x5076ad[_0x0abc('0x7')](0x1);_0x516b55[_0x0abc('0x8')](function(_0x49215e){var _0x3fcd7e=_0x49215e[_0x0abc('0x6')]('[')[_0x0abc('0x9')]();var _0xbff67=_0x49215e[_0x0abc('0xa')](/\[(.*?)\]/g);_0xbff67[_0x0abc('0x8')](function(_0x455340){var _0x5a50bd=_0x455340[_0x0abc('0x6')]('[')['filter'](function(_0x4efab4){return _0x4efab4[_0x0abc('0xb')](']')>-0x1;})[_0x0abc('0xc')](function(_0x531e5a){return _0x531e5a[_0x0abc('0x6')](']')[0x0];})[0x0];_0x1086c5['conditions'][_0x0abc('0xd')]({'field':_0x563c0b,'operator':_0x3fcd7e,'value':_0x5a50bd});});});}return _0x1086c5;};exports[_0x0abc('0xe')]=function(_0x4ff209,_0x36ea49,_0x1d5b2d){var _0x6b40fd={};if(_0x36ea49===_0x0abc('0xf')){if(_0x1d5b2d['operator']===_0x0abc('0x10')){_0x1d5b2d[_0x0abc('0x11')]=_0x0abc('0x12');_0x1d5b2d[_0x0abc('0x13')]+=','+_0x1d5b2d[_0x0abc('0x13')];}else if(_[_0x0abc('0x14')]([_0x0abc('0x15'),'$lte'],_0x1d5b2d[_0x0abc('0x11')])){_0x1d5b2d[_0x0abc('0x13')]=moment(_0x1d5b2d[_0x0abc('0x13')])[_0x0abc('0x16')](0x1,_0x0abc('0x17'))[_0x0abc('0x18')]('YYYY-MM-DD');}}if(_0x1d5b2d[_0x0abc('0x19')]){_0x36ea49=_0x1d5b2d[_0x0abc('0x19')];_0x6b40fd['text']='CAST('+_0x4ff209+'.'+_0x1d5b2d['field']+_0x0abc('0x1a')+_0x1d5b2d['castTo']+')\x20'+parseOperator(_0x1d5b2d[_0x0abc('0x11')]);}else{_0x6b40fd[_0x0abc('0x1b')]=_0x4ff209+'.'+_0x1d5b2d['field']+'\x20'+parseOperator(_0x1d5b2d[_0x0abc('0x11')]);}if(_[_0x0abc('0x14')]([_0x0abc('0x1c'),_0x0abc('0x1d')],_0x1d5b2d[_0x0abc('0x11')]))_0x6b40fd['text']='('+_0x6b40fd[_0x0abc('0x1b')]+_0x0abc('0x1e')+_0x4ff209+'.'+_0x1d5b2d[_0x0abc('0x1f')]+_0x0abc('0x20');_0x6b40fd[_0x0abc('0x13')]=parseValue(_0x36ea49,_0x1d5b2d['operator'],_0x1d5b2d['value']);return _0x6b40fd;};function parseOperator(_0x4a7356){var _0x289085;switch(_0x4a7356){case _0x0abc('0x21'):_0x289085=_0x0abc('0x22');break;case _0x0abc('0x1d'):_0x289085=_0x0abc('0x23');break;case _0x0abc('0x10'):_0x289085='=\x20?';break;case _0x0abc('0x1c'):_0x289085=_0x0abc('0x24');break;case _0x0abc('0x25'):case _0x0abc('0x26'):case _0x0abc('0x27'):_0x289085=_0x0abc('0x28');break;case _0x0abc('0x29'):_0x289085='<\x20?';break;case _0x0abc('0x15'):_0x289085=_0x0abc('0x2a');break;case _0x0abc('0x2b'):_0x289085=_0x0abc('0x2c');break;case _0x0abc('0x2d'):_0x289085='>=\x20?';break;case _0x0abc('0x12'):_0x289085=_0x0abc('0x2e');break;}return _0x289085;}function parseValue(_0x5e8730,_0x1cdacf,_0x530595){var _0x482c75={'start':undefined,'end':undefined};switch(_0x1cdacf){case'$in':case _0x0abc('0x1d'):_0x482c75['start']=_0x530595[_0x0abc('0x6')](',');break;case _0x0abc('0x25'):_0x482c75[_0x0abc('0x2f')]='%'+_0x530595+'%';break;case _0x0abc('0x26'):_0x482c75[_0x0abc('0x2f')]=_0x530595+'%';break;case _0x0abc('0x27'):_0x482c75[_0x0abc('0x2f')]='%'+_0x530595;break;case'$between':var _0x324f20=_0x530595['split'](',');var _0x530595=_0x324f20[_0x0abc('0x9')]();var _0x45f65f=_0x324f20[_0x0abc('0x30')]();if(_0x5e8730===_0x0abc('0xf')){_0x530595=moment(_0x530595)[_0x0abc('0x31')](0x0,!![])['format']();_0x45f65f=moment(_0x45f65f)[_0x0abc('0x31')](0x0,!![])[_0x0abc('0x16')](0x17,_0x0abc('0x32'))[_0x0abc('0x16')](0x3b,_0x0abc('0x33'))['add'](0x3b,_0x0abc('0x34'))[_0x0abc('0x18')]();}_0x482c75={'start':_0x530595,'end':_0x45f65f};break;default:_0x482c75[_0x0abc('0x2f')]=_0x530595;break;}return _0x482c75;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 7949b2c..47d3e08 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 _0x3e6b=['map','indexOf','priority','col','unsigned','DESC','cast','ASC','omit','length','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','getFullTextValue','replace','join','getOptions','query','$id','model','attributes','intersection','nolimit','order','where','pick','filter','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','sort'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x3e6b,0x1af));var _0xb3e6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3e6b[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var sequelize=require(_0xb3e6('0x0'));var moment=require(_0xb3e6('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3022ed){var _0x5df16b=['ne'];try{var _0x1a1f9a=JSON[_0xb3e6('0x2')](_0x3022ed);var _0x58ce3a=Object[_0xb3e6('0x3')](_0x1a1f9a)[0x0];return _0x5df16b[_0xb3e6('0x4')](_0x58ce3a);}catch(_0xa45fec){return![];}}function getOperatorValue(_0x166299){var _0x1429c0=JSON[_0xb3e6('0x2')](_0x166299);var _0x5540f9=Object['keys'](_0x1429c0)[0x0];var _0x5e137b=_0x1429c0[_0x5540f9];return{['$'+_0x5540f9]:_0x5e137b};}exports[_0xb3e6('0x5')]=function(_0x1d4860){var _0xbe7168=null;if(_0x1d4860){_0xbe7168=_0x1d4860[_0xb3e6('0x6')](',');}return _0xbe7168;};exports[_0xb3e6('0x7')]=function(_0x4c231f,_0x407af8){var _0x2fc85c={};if(!_[_0xb3e6('0x8')](_0x4c231f)){_[_0xb3e6('0x9')](_0x4c231f,function(_0x39473c,_0x19fe49){try{if(_0x407af8){var _0x4dc8be=_[_0xb3e6('0xa')](_0x407af8,{'name':_0x19fe49})||{};if(hasSequelizeOperator(_0x39473c)){_0x2fc85c[_0x19fe49]=getOperatorValue(_0x39473c);}else if(_0x4dc8be[_0xb3e6('0xb')]===_0xb3e6('0xc')&&_[_0xb3e6('0xd')](_0x39473c)){var _0x43145f=JSON[_0xb3e6('0x2')](_0x39473c);var _0x2eb6bf={'$gte':moment(moment(_0x43145f[_0xb3e6('0xe')])[_0xb3e6('0xf')](_0xb3e6('0x10')))[_0xb3e6('0x11')]()['format'](),'$lte':moment(moment(_0x43145f[_0xb3e6('0x12')])[_0xb3e6('0xf')]('YYYY-MM-DD'))[_0xb3e6('0x11')]()['subtract'](0x1,'s')[_0xb3e6('0xf')]()};_0x2fc85c[_0x19fe49]=_0x2eb6bf;}else if(_0x4dc8be[_0xb3e6('0x13')]===_0xb3e6('0x14')){_0x2fc85c[_0x19fe49]=_0x39473c;}else{_0x2fc85c[_0x19fe49]=_[_0xb3e6('0x15')](_0x39473c)?_0x39473c:JSON['parse'](_0x39473c);}}else{_0x2fc85c[_0x19fe49]=_[_0xb3e6('0x15')](_0x39473c)?_0x39473c:JSON['parse'](_0x39473c);}}catch(_0x49d85b){_0x2fc85c[_0x19fe49]=_0x39473c[_0xb3e6('0x6')](',');}});}return _0x2fc85c;};exports[_0xb3e6('0x16')]=function(_0x54b58b){_0x54b58b=parseInt(_0x54b58b,0xa);if(!_0x54b58b||_0x54b58b<0x0){_0x54b58b=LIMIT_VALUE;}return _0x54b58b;};exports[_0xb3e6('0x17')]=function(_0x12eb6c){_0x12eb6c=parseInt(_0x12eb6c,0xa);if(!_0x12eb6c||_0x12eb6c<0x0){_0x12eb6c=0x0;}return _0x12eb6c;};exports[_0xb3e6('0x18')]=function(_0x279c56){var _0x2b36d9,_0x2cfe0e=null;if(_0x279c56){_0x2b36d9=_0x279c56[_0xb3e6('0x6')](',');_0x2cfe0e=_[_0xb3e6('0x19')](_0x2b36d9,function(_0x376874){if(_0x376874[_0xb3e6('0x1a')]('-')===0x0){return[_0x376874===_0xb3e6('0x1b')?sequelize['cast'](sequelize[_0xb3e6('0x1c')](_0xb3e6('0x1b')),_0xb3e6('0x1d')):_0x376874['substr'](0x1),_0xb3e6('0x1e')];}else{return[_0x376874==='priority'?sequelize[_0xb3e6('0x1f')](sequelize[_0xb3e6('0x1c')](_0xb3e6('0x1b')),_0xb3e6('0x1d')):_0x376874,_0xb3e6('0x20')];}});}return _0x2cfe0e;};exports[_0xb3e6('0x21')]=function(_0xda2b9c,_0x4288a1){if(_[_0xb3e6('0x8')](_0xda2b9c)){return _0xda2b9c;}if(_[_0xb3e6('0x15')](_0xda2b9c)){for(var _0x4d0840=0x0;_0x4d0840<_0xda2b9c[_0xb3e6('0x22')];_0x4d0840+=0x1){_0xda2b9c[_0x4d0840]=this[_0xb3e6('0x21')](_0xda2b9c[_0x4d0840],_0x4288a1);}return _0xda2b9c;}if(!_['isObject'](_0xda2b9c)){return _0xda2b9c;}if(_['isString'](_0x4288a1)){_0x4288a1=[_0x4288a1];}if(!_[_0xb3e6('0x15')](_0x4288a1)){return _0xda2b9c;}for(var _0x482cce=0x0;_0x482cce<_0x4288a1[_0xb3e6('0x22')];_0x482cce+=0x1){_[_0xb3e6('0x23')](_0xda2b9c,_0x4288a1[_0x482cce]);}for(var _0x1b9769 in _0xda2b9c){if(_0xda2b9c[_0xb3e6('0x24')](_0x1b9769)){_0xda2b9c[_0x1b9769]=this[_0xb3e6('0x21')](_0xda2b9c[_0x1b9769],_0x4288a1);}}return _0xda2b9c;};exports[_0xb3e6('0x25')]=function(_0x296316){return _0x296316['match'](RegExp(_0xb3e6('0x26')))?!![]:![];};exports['isEmail']=function(_0x5bf0d2){return _0x5bf0d2['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xb3e6('0x27')]=function(_0x2ebd40){var _0x4dce35=[];_0x2ebd40[_0xb3e6('0x6')](/[ ,]+/)['forEach'](function(_0x42fa1e){_0x42fa1e=_0x42fa1e[_0xb3e6('0x28')](/([^:]")"+/g,'$1');_0x42fa1e='+'+_0x42fa1e+'*';if(_0x42fa1e[_0xb3e6('0x4')]('@'))_0x42fa1e='\x22'+_0x42fa1e+'\x22';_0x4dce35['push'](_0x42fa1e);});return _0x4dce35[_0xb3e6('0x29')]('\x20');};exports[_0xb3e6('0x2a')]=function(_0x3a528d,_0x5d2758,_0x2b65a9){var _0x36f9ca={},_0x50d02c={};if(_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x2c')]){_0x5d2758[_0xb3e6('0x2b')]['id']=_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x2c')];delete _0x5d2758[_0xb3e6('0x2b')]['$id'];}_0x36f9ca[_0xb3e6('0x2d')]=_[_0xb3e6('0x19')](_0x3a528d,_0xb3e6('0x13'));_0x36f9ca[_0xb3e6('0x2b')]=_[_0xb3e6('0x3')](_0x5d2758[_0xb3e6('0x2b')]);_0x36f9ca['filters']=_['intersection'](_0x36f9ca[_0xb3e6('0x2d')],_0x36f9ca[_0xb3e6('0x2b')]);_0x50d02c[_0xb3e6('0x2e')]=_[_0xb3e6('0x2f')](_0x36f9ca[_0xb3e6('0x2d')],this[_0xb3e6('0x5')](_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x5')]));_0x50d02c[_0xb3e6('0x2e')]=_0x50d02c[_0xb3e6('0x2e')][_0xb3e6('0x22')]?_0x50d02c[_0xb3e6('0x2e')]:_0x36f9ca[_0xb3e6('0x2d')];if(!_0x5d2758[_0xb3e6('0x2b')]['hasOwnProperty'](_0xb3e6('0x30'))){_0x50d02c[_0xb3e6('0x16')]=this['limit'](_0x5d2758['query'][_0xb3e6('0x16')]);_0x50d02c[_0xb3e6('0x17')]=this[_0xb3e6('0x17')](_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x17')]);}_0x50d02c[_0xb3e6('0x31')]=this[_0xb3e6('0x18')](_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x18')]);_0x50d02c[_0xb3e6('0x32')]=this[_0xb3e6('0x7')](_[_0xb3e6('0x33')](_0x5d2758[_0xb3e6('0x2b')],_0x36f9ca[_0xb3e6('0x7')]),_0x3a528d);if(_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x34')]){_0x50d02c[_0xb3e6('0x32')]=_[_0xb3e6('0x35')](_0x50d02c[_0xb3e6('0x32')],{'$or':_[_0xb3e6('0x19')](_0x3a528d,function(_0x4ebe51){if(_0x4ebe51[_0xb3e6('0xb')]!==_0xb3e6('0x36')){if(_0x2b65a9){return sequelize[_0xb3e6('0x32')](sequelize['fn'](_0xb3e6('0x37'),sequelize[_0xb3e6('0x1c')](_0x4ebe51[_0xb3e6('0x13')])),{'$like':sequelize['fn']('lower','%'+_0x5d2758[_0xb3e6('0x2b')][_0xb3e6('0x34')]+'%')});}else{var _0x4f8c16={};_0x4f8c16[_0x4ebe51[_0xb3e6('0x13')]]={'$like':'%'+_0x5d2758['query']['filter']+'%'};return _0x4f8c16;}}})});}_0x50d02c=_[_0xb3e6('0x35')]({},_0x50d02c,_0x5d2758[_0xb3e6('0x38')]);return _0x50d02c;}; \ No newline at end of file +var _0xb519=['attributes','nolimit','order','sort','where','filter','merge','lower','name','lodash','moment','parse','keys','includes','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','isArray','limit','offset','map','indexOf','priority','cast','col','substr','unsigned','ASC','omit','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','forEach','replace','push','getOptions','query','$id','model','intersection'];(function(_0x1ef0d1,_0x173f12){var _0x5c9edf=function(_0x773716){while(--_0x773716){_0x1ef0d1['push'](_0x1ef0d1['shift']());}};_0x5c9edf(++_0x173f12);}(_0xb519,0x18a));var _0x9b51=function(_0x2e359f,_0x299664){_0x2e359f=_0x2e359f-0x0;var _0x1ba85d=_0xb519[_0x2e359f];return _0x1ba85d;};'use strict';var _=require(_0x9b51('0x0'));var sequelize=require('sequelize');var moment=require(_0x9b51('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x26cfa0){var _0x5077a6=['ne'];try{var _0x57cd92=JSON[_0x9b51('0x2')](_0x26cfa0);var _0x4a40ad=Object[_0x9b51('0x3')](_0x57cd92)[0x0];return _0x5077a6[_0x9b51('0x4')](_0x4a40ad);}catch(_0x439db0){return![];}}function getOperatorValue(_0x3e0539){var _0x4c35c8=JSON[_0x9b51('0x2')](_0x3e0539);var _0x458c89=Object[_0x9b51('0x3')](_0x4c35c8)[0x0];var _0x388c09=_0x4c35c8[_0x458c89];return{['$'+_0x458c89]:_0x388c09};}exports[_0x9b51('0x5')]=function(_0x14aad4){var _0x35cc78=null;if(_0x14aad4){_0x35cc78=_0x14aad4[_0x9b51('0x6')](',');}return _0x35cc78;};exports[_0x9b51('0x7')]=function(_0x2e2af8,_0xfbdf9f){var _0x9ac839={};if(!_[_0x9b51('0x8')](_0x2e2af8)){_['forOwn'](_0x2e2af8,function(_0x1d2919,_0x5e5d52){try{if(_0xfbdf9f){var _0x590604=_[_0x9b51('0x9')](_0xfbdf9f,{'name':_0x5e5d52})||{};if(hasSequelizeOperator(_0x1d2919)){_0x9ac839[_0x5e5d52]=getOperatorValue(_0x1d2919);}else if(_0x590604[_0x9b51('0xa')]===_0x9b51('0xb')&&_[_0x9b51('0xc')](_0x1d2919)){var _0x407e70=JSON[_0x9b51('0x2')](_0x1d2919);var _0x26896a={'$gte':moment(moment(_0x407e70[_0x9b51('0xd')])[_0x9b51('0xe')]('YYYY-MM-DD'))[_0x9b51('0xf')]()['format'](),'$lte':moment(moment(_0x407e70[_0x9b51('0x10')])[_0x9b51('0xe')](_0x9b51('0x11')))[_0x9b51('0xf')]()[_0x9b51('0x12')](0x1,'s')[_0x9b51('0xe')]()};_0x9ac839[_0x5e5d52]=_0x26896a;}else if(_0x590604['name']==='uniqueid'){_0x9ac839[_0x5e5d52]=_0x1d2919;}else{_0x9ac839[_0x5e5d52]=_[_0x9b51('0x13')](_0x1d2919)?_0x1d2919:JSON[_0x9b51('0x2')](_0x1d2919);}}else{_0x9ac839[_0x5e5d52]=_[_0x9b51('0x13')](_0x1d2919)?_0x1d2919:JSON['parse'](_0x1d2919);}}catch(_0x4e38da){_0x9ac839[_0x5e5d52]=_0x1d2919[_0x9b51('0x6')](',');}});}return _0x9ac839;};exports[_0x9b51('0x14')]=function(_0x8c0c56){_0x8c0c56=parseInt(_0x8c0c56,0xa);if(!_0x8c0c56||_0x8c0c56<0x0){_0x8c0c56=LIMIT_VALUE;}return _0x8c0c56;};exports[_0x9b51('0x15')]=function(_0x336a78){_0x336a78=parseInt(_0x336a78,0xa);if(!_0x336a78||_0x336a78<0x0){_0x336a78=0x0;}return _0x336a78;};exports['sort']=function(_0x1a0ee3){var _0x5abfee,_0x687d14=null;if(_0x1a0ee3){_0x5abfee=_0x1a0ee3['split'](',');_0x687d14=_[_0x9b51('0x16')](_0x5abfee,function(_0x10ea6e){if(_0x10ea6e[_0x9b51('0x17')]('-')===0x0){return[_0x10ea6e===_0x9b51('0x18')?sequelize[_0x9b51('0x19')](sequelize[_0x9b51('0x1a')]('priority'),'unsigned'):_0x10ea6e[_0x9b51('0x1b')](0x1),'DESC'];}else{return[_0x10ea6e===_0x9b51('0x18')?sequelize[_0x9b51('0x19')](sequelize[_0x9b51('0x1a')](_0x9b51('0x18')),_0x9b51('0x1c')):_0x10ea6e,_0x9b51('0x1d')];}});}return _0x687d14;};exports[_0x9b51('0x1e')]=function(_0x4bad4c,_0x1d3731){if(_['isEmpty'](_0x4bad4c)){return _0x4bad4c;}if(_[_0x9b51('0x13')](_0x4bad4c)){for(var _0x29113f=0x0;_0x29113f<_0x4bad4c['length'];_0x29113f+=0x1){_0x4bad4c[_0x29113f]=this['omit'](_0x4bad4c[_0x29113f],_0x1d3731);}return _0x4bad4c;}if(!_['isObject'](_0x4bad4c)){return _0x4bad4c;}if(_[_0x9b51('0x1f')](_0x1d3731)){_0x1d3731=[_0x1d3731];}if(!_[_0x9b51('0x13')](_0x1d3731)){return _0x4bad4c;}for(var _0x4751cc=0x0;_0x4751cc<_0x1d3731[_0x9b51('0x20')];_0x4751cc+=0x1){_[_0x9b51('0x21')](_0x4bad4c,_0x1d3731[_0x4751cc]);}for(var _0x12092f in _0x4bad4c){if(_0x4bad4c[_0x9b51('0x22')](_0x12092f)){_0x4bad4c[_0x12092f]=this[_0x9b51('0x1e')](_0x4bad4c[_0x12092f],_0x1d3731);}}return _0x4bad4c;};exports[_0x9b51('0x23')]=function(_0x523197){return _0x523197[_0x9b51('0x24')](RegExp(_0x9b51('0x25')))?!![]:![];};exports['isEmail']=function(_0x3bbaff){return _0x3bbaff[_0x9b51('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4f0799){var _0x16c244=[];_0x4f0799[_0x9b51('0x6')](/[ ,]+/)[_0x9b51('0x26')](function(_0x306a00){_0x306a00=_0x306a00[_0x9b51('0x27')](/([^:]")"+/g,'$1');_0x306a00='+'+_0x306a00+'*';if(_0x306a00[_0x9b51('0x4')]('@'))_0x306a00='\x22'+_0x306a00+'\x22';_0x16c244[_0x9b51('0x28')](_0x306a00);});return _0x16c244['join']('\x20');};exports[_0x9b51('0x29')]=function(_0x2173e3,_0xb4a27,_0x5b0deb){var _0x3134cc={},_0x3f7971={};if(_0xb4a27[_0x9b51('0x2a')]['$id']){_0xb4a27[_0x9b51('0x2a')]['id']=_0xb4a27[_0x9b51('0x2a')][_0x9b51('0x2b')];delete _0xb4a27[_0x9b51('0x2a')][_0x9b51('0x2b')];}_0x3134cc[_0x9b51('0x2c')]=_[_0x9b51('0x16')](_0x2173e3,'name');_0x3134cc[_0x9b51('0x2a')]=_[_0x9b51('0x3')](_0xb4a27[_0x9b51('0x2a')]);_0x3134cc[_0x9b51('0x7')]=_[_0x9b51('0x2d')](_0x3134cc[_0x9b51('0x2c')],_0x3134cc[_0x9b51('0x2a')]);_0x3f7971[_0x9b51('0x2e')]=_['intersection'](_0x3134cc['model'],this[_0x9b51('0x5')](_0xb4a27[_0x9b51('0x2a')][_0x9b51('0x5')]));_0x3f7971[_0x9b51('0x2e')]=_0x3f7971[_0x9b51('0x2e')][_0x9b51('0x20')]?_0x3f7971[_0x9b51('0x2e')]:_0x3134cc[_0x9b51('0x2c')];if(!_0xb4a27[_0x9b51('0x2a')][_0x9b51('0x22')](_0x9b51('0x2f'))){_0x3f7971[_0x9b51('0x14')]=this[_0x9b51('0x14')](_0xb4a27[_0x9b51('0x2a')]['limit']);_0x3f7971['offset']=this[_0x9b51('0x15')](_0xb4a27[_0x9b51('0x2a')]['offset']);}_0x3f7971[_0x9b51('0x30')]=this['sort'](_0xb4a27['query'][_0x9b51('0x31')]);_0x3f7971[_0x9b51('0x32')]=this['filters'](_['pick'](_0xb4a27['query'],_0x3134cc[_0x9b51('0x7')]),_0x2173e3);if(_0xb4a27[_0x9b51('0x2a')][_0x9b51('0x33')]){_0x3f7971['where']=_[_0x9b51('0x34')](_0x3f7971[_0x9b51('0x32')],{'$or':_[_0x9b51('0x16')](_0x2173e3,function(_0x23924d){if(_0x23924d[_0x9b51('0xa')]!=='VIRTUAL'){if(_0x5b0deb){return sequelize['where'](sequelize['fn'](_0x9b51('0x35'),sequelize[_0x9b51('0x1a')](_0x23924d['name'])),{'$like':sequelize['fn'](_0x9b51('0x35'),'%'+_0xb4a27[_0x9b51('0x2a')][_0x9b51('0x33')]+'%')});}else{var _0x5dc040={};_0x5dc040[_0x23924d[_0x9b51('0x36')]]={'$like':'%'+_0xb4a27['query'][_0x9b51('0x33')]+'%'};return _0x5dc040;}}})});}_0x3f7971=_[_0x9b51('0x34')]({},_0x3f7971,_0xb4a27['options']);return _0x3f7971;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 81c8971..414ae03 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbfe=['appPath','join','public','development','test','root','client','use','json\x20replacer','split','static','views','/server/views','engine','html','renderFile','view\x20engine','urlencoded','50mb','json','initialize','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xcbfe,0x1c5));var _0xecbf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcbfe[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var favicon=require(_0xecbf('0x0'));var bodyParser=require(_0xecbf('0x1'));var methodOverride=require(_0xecbf('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xecbf('0x3'));var path=require(_0xecbf('0x4'));var passport=require(_0xecbf('0x5'));var cors=require(_0xecbf('0x6'));var moment=require(_0xecbf('0x7'));var config=require(_0xecbf('0x8'));var db=require(_0xecbf('0x9'))['db'];exports[_0xecbf('0xa')]=function(_0x23baf9){var _0x1e0cc6=_0x23baf9[_0xecbf('0xb')](_0xecbf('0xc'));if(_0x1e0cc6===_0xecbf('0xd')){_0x23baf9[_0xecbf('0xe')](_0xecbf('0xf'),path[_0xecbf('0x10')](config['root'],_0xecbf('0x11')));}if(_0x1e0cc6===_0xecbf('0x12')||_0x1e0cc6===_0xecbf('0x13')){_0x23baf9[_0xecbf('0xe')](_0xecbf('0xf'),path[_0xecbf('0x10')](config[_0xecbf('0x14')],_0xecbf('0x15')));_0x23baf9[_0xecbf('0x16')](errorHandler());}_0x23baf9[_0xecbf('0xe')](_0xecbf('0x17'),function(_0x105bb9,_0xffd03c){if(this[_0x105bb9]instanceof Date){_0xffd03c=this[_0x105bb9]['toISOString']()[_0xecbf('0x18')]('.')[0x0]+'Z';}return _0xffd03c;});_0x23baf9[_0xecbf('0x16')](express[_0xecbf('0x19')](_0x23baf9[_0xecbf('0xb')](_0xecbf('0xf'))));_0x23baf9[_0xecbf('0xe')](_0xecbf('0x1a'),config[_0xecbf('0x14')]+_0xecbf('0x1b'));_0x23baf9[_0xecbf('0x1c')](_0xecbf('0x1d'),require('ejs')[_0xecbf('0x1e')]);_0x23baf9[_0xecbf('0xe')](_0xecbf('0x1f'),_0xecbf('0x1d'));_0x23baf9[_0xecbf('0x16')](bodyParser[_0xecbf('0x20')]({'limit':_0xecbf('0x21'),'extended':!![]}));_0x23baf9['use'](bodyParser[_0xecbf('0x22')]({'limit':_0xecbf('0x21')}));_0x23baf9[_0xecbf('0x16')](cors());_0x23baf9[_0xecbf('0x16')](methodOverride());_0x23baf9[_0xecbf('0x16')](cookieParser());_0x23baf9[_0xecbf('0x16')](passport[_0xecbf('0x23')]());}; \ No newline at end of file +var _0xa315=['cookie-parser','errorhandler','path','passport','moment','./environment','../mysqldb','default','get','env','production','set','appPath','join','root','client','use','json\x20replacer','split','static','views','/server/views','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','serve-favicon','body-parser','method-override'];(function(_0x2753fb,_0x59be93){var _0x12e1d8=function(_0x11a0d6){while(--_0x11a0d6){_0x2753fb['push'](_0x2753fb['shift']());}};_0x12e1d8(++_0x59be93);}(_0xa315,0x147));var _0x5a31=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0xa315[_0x1e8b1e];return _0x4a0fde;};'use strict';var express=require('express');var favicon=require(_0x5a31('0x0'));var bodyParser=require(_0x5a31('0x1'));var methodOverride=require(_0x5a31('0x2'));var cookieParser=require(_0x5a31('0x3'));var errorHandler=require(_0x5a31('0x4'));var path=require(_0x5a31('0x5'));var passport=require(_0x5a31('0x6'));var cors=require('cors');var moment=require(_0x5a31('0x7'));var config=require(_0x5a31('0x8'));var db=require(_0x5a31('0x9'))['db'];exports[_0x5a31('0xa')]=function(_0x470bab){var _0x1ef9e7=_0x470bab[_0x5a31('0xb')](_0x5a31('0xc'));if(_0x1ef9e7===_0x5a31('0xd')){_0x470bab[_0x5a31('0xe')](_0x5a31('0xf'),path[_0x5a31('0x10')](config[_0x5a31('0x11')],'public'));}if(_0x1ef9e7==='development'||_0x1ef9e7==='test'){_0x470bab['set'](_0x5a31('0xf'),path[_0x5a31('0x10')](config[_0x5a31('0x11')],_0x5a31('0x12')));_0x470bab[_0x5a31('0x13')](errorHandler());}_0x470bab[_0x5a31('0xe')](_0x5a31('0x14'),function(_0x51b8f1,_0x13c165){if(this[_0x51b8f1]instanceof Date){_0x13c165=this[_0x51b8f1]['toISOString']()[_0x5a31('0x15')]('.')[0x0]+'Z';}return _0x13c165;});_0x470bab[_0x5a31('0x13')](express[_0x5a31('0x16')](_0x470bab['get'](_0x5a31('0xf'))));_0x470bab[_0x5a31('0xe')](_0x5a31('0x17'),config[_0x5a31('0x11')]+_0x5a31('0x18'));_0x470bab['engine'](_0x5a31('0x19'),require(_0x5a31('0x1a'))[_0x5a31('0x1b')]);_0x470bab[_0x5a31('0xe')](_0x5a31('0x1c'),_0x5a31('0x19'));_0x470bab[_0x5a31('0x13')](bodyParser[_0x5a31('0x1d')]({'limit':_0x5a31('0x1e'),'extended':!![]}));_0x470bab[_0x5a31('0x13')](bodyParser[_0x5a31('0x1f')]({'limit':_0x5a31('0x1e')}));_0x470bab['use'](cors());_0x470bab[_0x5a31('0x13')](methodOverride());_0x470bab['use'](cookieParser());_0x470bab[_0x5a31('0x13')](passport[_0x5a31('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 9d262b5..8ee666b 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 _0xdf37=['digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','length','filter','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','hex','getUuid','test','licenseToken','replace','hostname','ipAddress'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdf37,0x9d));var _0x7df3=function(_0x2f3ee0,_0x2d1874){_0x2f3ee0=_0x2f3ee0-0x0;var _0x31f227=_0xdf37[_0x2f3ee0];return _0x31f227;};'use strict';var _=require(_0x7df3('0x0'));var os=require('os');var crypto=require(_0x7df3('0x1'));var machine=require(_0x7df3('0x2'));var exec=require(_0x7df3('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x92dc8=[];var _0x24c1ef=os[_0x7df3('0x4')]();var _0x248b7f=_[_0x7df3('0x5')](_[_0x7df3('0x6')](_0x24c1ef));for(var _0x1b14ea=0x0;_0x1b14ea<_0x248b7f[_0x7df3('0x7')];_0x1b14ea++){var _0x4edcc7=_0x24c1ef[_0x248b7f[_0x1b14ea]][_0x7df3('0x8')](function(_0x4eb5b6){return _0x4eb5b6['family']==='IPv4'&&_0x4eb5b6[_0x7df3('0x9')]===![];});_0x92dc8=_0x92dc8[_0x7df3('0xa')](_0x4edcc7);}return _0x92dc8;}function getFirstInterface(){var _0x4e91c0=_[_0x7df3('0xb')](getInterfaces());return{'macAddress':_0x4e91c0&&_0x4e91c0[_0x7df3('0xc')]?_0x4e91c0[_0x7df3('0xc')]:_0x7df3('0xd'),'ipAddress':_0x4e91c0&&_0x4e91c0[_0x7df3('0xe')]?_0x4e91c0[_0x7df3('0xe')]:_0x7df3('0xf')};}exports[_0x7df3('0x10')]=getFirstInterface;function getCPUhash(){var _0x46cece=_['orderBy'](os['cpus']()['map'](function(_0x50e8b5){return _0x50e8b5[_0x7df3('0x11')];}))[_0x7df3('0x12')](':');return crypto[_0x7df3('0x13')](_0x7df3('0x14'))[_0x7df3('0x15')](_0x46cece)['digest'](_0x7df3('0x16'));}exports[_0x7df3('0x17')]=function(){var _0x1f148b=os['platform']();var _0x4de61b=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4de61b[_0x7df3('0x18')](config[_0x7df3('0x19')])){return config[_0x7df3('0x19')];}else if(_0x1f148b==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x7df3('0x1a')]('\x0d\x0a','');}else{var _0x1771df=getFirstInterface();var _0x3b234c=getCPUhash();var _0xee0269=_0x3b234c+'|'+os[_0x7df3('0x1b')]()+'|'+_0x1771df['macAddress']+'|'+_0x1771df[_0x7df3('0x1c')];var _0x175a04=crypto['createHash'](_0x7df3('0x14'))[_0x7df3('0x15')](_0xee0269)[_0x7df3('0x1d')](_0x7df3('0x16'));return _0x175a04['substring'](0x0,0x8)+'-'+_0x175a04[_0x7df3('0x1e')](0x8,0xc)+'-'+_0x175a04['substring'](0xc,0x10)+'-'+_0x175a04[_0x7df3('0x1e')](0x10,0x14)+'-'+_0x175a04[_0x7df3('0x1e')](0x14);}}; \ No newline at end of file +var _0x1d3c=['model','join','createHash','update','digest','hex','getUuid','licenseToken','test','utf8','macAddress','ipAddress','md5','substring','crypto','bimedia-machine-uuid','execSync','../environment','orderBy','keys','length','filter','family','concat','head','mac','address','127.0.0.1','cpus','map'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0x1d3c,0xc2));var _0xc1d3=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x1d3c[_0x35d4e9];return _0x5c2770;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xc1d3('0x0'));var machine=require(_0xc1d3('0x1'));var exec=require('child_process')[_0xc1d3('0x2')];var config=require(_0xc1d3('0x3'));function getInterfaces(){var _0x5897dd=[];var _0x91790b=os['networkInterfaces']();var _0x513024=_[_0xc1d3('0x4')](_[_0xc1d3('0x5')](_0x91790b));for(var _0x22f36c=0x0;_0x22f36c<_0x513024[_0xc1d3('0x6')];_0x22f36c++){var _0x159422=_0x91790b[_0x513024[_0x22f36c]][_0xc1d3('0x7')](function(_0x4206a3){return _0x4206a3[_0xc1d3('0x8')]==='IPv4'&&_0x4206a3['internal']===![];});_0x5897dd=_0x5897dd[_0xc1d3('0x9')](_0x159422);}return _0x5897dd;}function getFirstInterface(){var _0x46c109=_[_0xc1d3('0xa')](getInterfaces());return{'macAddress':_0x46c109&&_0x46c109[_0xc1d3('0xb')]?_0x46c109[_0xc1d3('0xb')]:'00:00:00:00:00:00','ipAddress':_0x46c109&&_0x46c109[_0xc1d3('0xc')]?_0x46c109['address']:_0xc1d3('0xd')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xf7dbdc=_[_0xc1d3('0x4')](os[_0xc1d3('0xe')]()[_0xc1d3('0xf')](function(_0x11fa3e){return _0x11fa3e[_0xc1d3('0x10')];}))[_0xc1d3('0x11')](':');return crypto[_0xc1d3('0x12')]('md5')[_0xc1d3('0x13')](_0xf7dbdc)[_0xc1d3('0x14')](_0xc1d3('0x15'));}exports[_0xc1d3('0x16')]=function(){var _0x12b547=os['platform']();var _0x2a4102=/[0-9a-f-]{36}/;if(config[_0xc1d3('0x17')]&&_0x2a4102[_0xc1d3('0x18')](config['licenseToken'])){return config[_0xc1d3('0x17')];}else if(_0x12b547==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xc1d3('0x19')})['replace']('\x0d\x0a','');}else{var _0x5272f2=getFirstInterface();var _0x27bd81=getCPUhash();var _0x4d751b=_0x27bd81+'|'+os['hostname']()+'|'+_0x5272f2[_0xc1d3('0x1a')]+'|'+_0x5272f2[_0xc1d3('0x1b')];var _0x5637be=crypto[_0xc1d3('0x12')](_0xc1d3('0x1c'))[_0xc1d3('0x13')](_0x4d751b)['digest'](_0xc1d3('0x15'));return _0x5637be[_0xc1d3('0x1d')](0x0,0x8)+'-'+_0x5637be[_0xc1d3('0x1d')](0x8,0xc)+'-'+_0x5637be[_0xc1d3('0x1d')](0xc,0x10)+'-'+_0x5637be[_0xc1d3('0x1d')](0x10,0x14)+'-'+_0x5637be[_0xc1d3('0x1d')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 3758bda..de99699 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 _0x373d=['DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','then','catch','get','data1','data2','active','info','update','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days'];(function(_0x15fce8,_0x7612b7){var _0x3f54aa=function(_0x4c1752){while(--_0x4c1752){_0x15fce8['push'](_0x15fce8['shift']());}};_0x3f54aa(++_0x7612b7);}(_0x373d,0xa2));var _0xd373=function(_0x51e026,_0x509ce9){_0x51e026=_0x51e026-0x0;var _0x2fb4bf=_0x373d[_0x51e026];return _0x2fb4bf;};'use strict';var util=require(_0xd373('0x0'));var moment=require(_0xd373('0x1'));var rp=require(_0xd373('0x2'));var BPromise=require(_0xd373('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0xd373('0x4'))['db'];var encryptor=require(_0xd373('0x5'));var hardware=require(_0xd373('0x6'));var logger=require(_0xd373('0x7'))(_0xd373('0x8'));var HOST=_0xd373('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x426502){return new BPromise(function(_0x65be35,_0x33dbdf){var _0x42a314=util[_0xd373('0xa')](_0xd373('0xb'),HOST,_0x426502,module[_0xd373('0xc')][_0xd373('0xd')]);if(oldToken){_0x42a314=util[_0xd373('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x426502,module['exports'][_0xd373('0xd')],oldToken);}var _0x1d6728={'uri':_0x42a314,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x1d6728)[_0xd373('0xe')](function(_0x5382a7){_0x65be35(_0x5382a7);})[_0xd373('0xf')](function(_0x24fc35){_0x33dbdf(_0x24fc35);});});}function manageLicense(_0x28f938,_0x5da1cd){var _0x11ee6b=_0x5da1cd[_0xd373('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x11ee6b[_0xd373('0x11')]!==_0x28f938&&!_0x11ee6b[_0xd373('0x12')]){oldToken=_0x11ee6b['data1'];}httpRequest(_0x28f938)[_0xd373('0xe')](function(_0x1a70d8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1a70d8[_0xd373('0x13')]){isOldTokenSent=![];if(!_0x11ee6b[_0xd373('0x8')]&&_0x11ee6b[_0xd373('0x8')]!=_0x1a70d8[_0xd373('0x8')]||_0x11ee6b[_0xd373('0x8')]&&_0x11ee6b['data2']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x11ee6b[_0xd373('0x8')]&&!_0x11ee6b[_0xd373('0x12')]&&_0x11ee6b[_0xd373('0x8')]!=_0x1a70d8[_0xd373('0x8')]){logger[_0xd373('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x11ee6b[_0xd373('0x8')]&&!_0x11ee6b[_0xd373('0x12')]&&_0x11ee6b[_0xd373('0x8')]==_0x1a70d8[_0xd373('0x8')]){return _0x5da1cd;}return _0x5da1cd[_0xd373('0x15')]({'data1':_0x28f938,'data2':null,'license':_0x1a70d8[_0xd373('0x8')]});}else{if(_0x1a70d8[_0xd373('0x8')]||_0x11ee6b[_0xd373('0x8')]){if(!_0x11ee6b[_0xd373('0x12')]){if(_0x11ee6b[_0xd373('0x11')]==_0x28f938){GRAY_PERIOD_REASON='Disabled';logger[_0xd373('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xd373('0x16');logger[_0xd373('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x11ee6b['data1'],_0x28f938);}logger[_0xd373('0x14')](_0xd373('0x17'),GRAY_PERIOD_REASON[_0xd373('0x18')](),moment()[_0xd373('0xa')](_0xd373('0x19')));return _0x5da1cd[_0xd373('0x15')]({'data2':encryptor['encryptString'](moment()['format'](_0xd373('0x19')))});}else{if(moment()[_0xd373('0x1a')](encryptor['decryptString'](_0x11ee6b['data2']),_0xd373('0x1b'))>DAYS){logger['info'](_0xd373('0x1c'),moment()[_0xd373('0xa')](_0xd373('0x19')));isOldTokenSent=![];return _0x5da1cd[_0xd373('0x15')]({'data1':_0x28f938,'data2':null,'license':null});}}}else{if(_0x11ee6b[_0xd373('0x11')]!=_0x28f938){logger[_0xd373('0x14')](_0xd373('0x1d'),_0x11ee6b[_0xd373('0x11')],_0x28f938);return _0x5da1cd[_0xd373('0x15')]({'data1':_0x28f938,'data2':null,'license':null});}}}return _0x5da1cd;})['then'](function(_0xcd6ed2){_0x5da1cd=_0xcd6ed2;})[_0xd373('0xf')](function(_0x28595f){logger[_0xd373('0x1e')](_0x28595f[_0xd373('0x1f')]);})[_0xd373('0x20')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x5da1cd);},TIME);});}function defaultLicense(){var _0x52414d=hardware[_0xd373('0x21')]();if(_0x52414d){return db[_0xd373('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x52414d}})[_0xd373('0x23')](function(_0x18bba7,_0x4a5b60){logger['info'](_0xd373('0x24'),_0x52414d);manageLicense(_0x52414d,_0x18bba7);})[_0xd373('0xf')](function(_0x5c96ea){logger['error'](_0x5c96ea['message']);});}}exports[_0xd373('0x25')]=defaultLicense; \ No newline at end of file +var _0x75ea=['THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','version','../../mysqldb','../../components/encryptor','./hardware','../logger','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','get','data1','data2','then','license','info'];(function(_0x2a568e,_0x4788b1){var _0xe1df87=function(_0x493678){while(--_0x493678){_0x2a568e['push'](_0x2a568e['shift']());}};_0xe1df87(++_0x4788b1);}(_0x75ea,0x82));var _0xa75e=function(_0x25474b,_0x57611b){_0x25474b=_0x25474b-0x0;var _0x38ac9e=_0x75ea[_0x25474b];return _0x38ac9e;};'use strict';var util=require(_0xa75e('0x0'));var moment=require(_0xa75e('0x1'));var rp=require(_0xa75e('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xa75e('0x3'));var db=require(_0xa75e('0x4'))['db'];var encryptor=require(_0xa75e('0x5'));var hardware=require(_0xa75e('0x6'));var logger=require(_0xa75e('0x7'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3dc7e3){return new BPromise(function(_0x25f1b8,_0x16c44e){var _0x24c63f=util[_0xa75e('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x3dc7e3,module[_0xa75e('0x9')]['version']);if(oldToken){_0x24c63f=util[_0xa75e('0x8')](_0xa75e('0xa'),HOST,_0x3dc7e3,module[_0xa75e('0x9')]['version'],oldToken);}var _0x26afa8={'uri':_0x24c63f,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x26afa8)['then'](function(_0x5419b5){_0x25f1b8(_0x5419b5);})[_0xa75e('0xb')](function(_0x71f5d6){_0x16c44e(_0x71f5d6);});});}function manageLicense(_0x4f775f,_0x3b108f){var _0xa26220=_0x3b108f[_0xa75e('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0xa26220[_0xa75e('0xd')]!==_0x4f775f&&!_0xa26220[_0xa75e('0xe')]){oldToken=_0xa26220[_0xa75e('0xd')];}httpRequest(_0x4f775f)[_0xa75e('0xf')](function(_0x21fe45){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x21fe45['active']){isOldTokenSent=![];if(!_0xa26220[_0xa75e('0x10')]&&_0xa26220[_0xa75e('0x10')]!=_0x21fe45['license']||_0xa26220[_0xa75e('0x10')]&&_0xa26220['data2']){logger[_0xa75e('0x11')](_0xa75e('0x12'));}if(_0xa26220[_0xa75e('0x10')]&&!_0xa26220[_0xa75e('0xe')]&&_0xa26220[_0xa75e('0x10')]!=_0x21fe45[_0xa75e('0x10')]){logger[_0xa75e('0x11')](_0xa75e('0x13'));}if(_0xa26220[_0xa75e('0x10')]&&!_0xa26220['data2']&&_0xa26220[_0xa75e('0x10')]==_0x21fe45[_0xa75e('0x10')]){return _0x3b108f;}return _0x3b108f[_0xa75e('0x14')]({'data1':_0x4f775f,'data2':null,'license':_0x21fe45[_0xa75e('0x10')]});}else{if(_0x21fe45[_0xa75e('0x10')]||_0xa26220['license']){if(!_0xa26220['data2']){if(_0xa26220['data1']==_0x4f775f){GRAY_PERIOD_REASON='Disabled';logger[_0xa75e('0x11')](_0xa75e('0x15'));}else{GRAY_PERIOD_REASON=_0xa75e('0x16');logger[_0xa75e('0x11')](_0xa75e('0x17'),_0xa26220[_0xa75e('0xd')],_0x4f775f);}logger['info'](_0xa75e('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xa75e('0x8')](_0xa75e('0x19')));return _0x3b108f['update']({'data2':encryptor['encryptString'](moment()[_0xa75e('0x8')](_0xa75e('0x19')))});}else{if(moment()[_0xa75e('0x1a')](encryptor[_0xa75e('0x1b')](_0xa26220[_0xa75e('0xe')]),_0xa75e('0x1c'))>DAYS){logger[_0xa75e('0x11')](_0xa75e('0x1d'),moment()[_0xa75e('0x8')](_0xa75e('0x19')));isOldTokenSent=![];return _0x3b108f['update']({'data1':_0x4f775f,'data2':null,'license':null});}}}else{if(_0xa26220[_0xa75e('0xd')]!=_0x4f775f){logger[_0xa75e('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xa26220[_0xa75e('0xd')],_0x4f775f);return _0x3b108f['update']({'data1':_0x4f775f,'data2':null,'license':null});}}}return _0x3b108f;})[_0xa75e('0xf')](function(_0x1ad64b){_0x3b108f=_0x1ad64b;})[_0xa75e('0xb')](function(_0x11b4f0){logger[_0xa75e('0x1e')](_0x11b4f0[_0xa75e('0x1f')]);})[_0xa75e('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xa75e('0x21')](),_0x3b108f);},TIME);});}function defaultLicense(){var _0x3c9479=hardware[_0xa75e('0x21')]();if(_0x3c9479){return db['License'][_0xa75e('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x3c9479}})['spread'](function(_0x431777,_0x169a13){logger[_0xa75e('0x11')](_0xa75e('0x23'),_0x3c9479);manageLicense(_0x3c9479,_0x431777);})['catch'](function(_0x373d1c){logger[_0xa75e('0x1e')](_0x373d1c[_0xa75e('0x1f')]);});}}exports[_0xa75e('0x24')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index efab404..8ea4923 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 _0xf858=['deadline','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','count','admin','users','telephones','forEach','user','catch','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','then','uuid','data1','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray'];(function(_0x4c2f30,_0xa91340){var _0xb8854d=function(_0x5ddf3d){while(--_0x5ddf3d){_0x4c2f30['push'](_0x4c2f30['shift']());}};_0xb8854d(++_0xa91340);}(_0xf858,0x186));var _0x8f85=function(_0x53e8be,_0x1f76d9){_0x53e8be=_0x53e8be-0x0;var _0x5ed9d0=_0xf858[_0x53e8be];return _0x5ed9d0;};'use strict';var util=require(_0x8f85('0x0'));var _=require(_0x8f85('0x1'));var moment=require(_0x8f85('0x2'));var BPromise=require(_0x8f85('0x3'));var hardware=require(_0x8f85('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0x8f85('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8f85('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x8f85('0x7'),'machineUuid':hardware[_0x8f85('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8f85('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8f85('0x9'),'machineUuid':hardware[_0x8f85('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5695f2){return new BPromise(function(_0x10907f,_0x31700c){return db[_0x8f85('0xa')]['find'](_['defaults'](_0x5695f2,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x194213){return checkLicense(_0x194213,null);})[_0x8f85('0xb')](function(_0x304478){_0x10907f(_0x304478);return;})['catch'](function(_0x4a72f0){_0x31700c(_0x4a72f0);});});}function checkLicense(_0x3d885c,_0x41ca76){if(!_0x3d885c){demoLicense[_0x8f85('0xc')]=_0x3d885c[_0x8f85('0xd')];return demoLicense;}try{var _0x14fe1f=_0x41ca76||_0x3d885c['license'];if(_[_0x8f85('0xe')](_0x14fe1f)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x205751=_0x3d885c[_0x8f85('0xd')];var _0x5a9e70=_0x3d885c[_0x8f85('0xf')];var _0x3b51e1=_0x205751['split']('-')[0x4];var _0x3989ef=_0x205751[_0x8f85('0x10')]('-')[0x0];var _0x446499=encryptor[_0x8f85('0x11')](_0x14fe1f,util[_0x8f85('0x12')](_0x8f85('0x13'),_0x3b51e1,_0x205751,_0x3989ef));var _0x5a61b7=JSON[_0x8f85('0x14')](_0x446499);_0x5a61b7[_0x8f85('0x15')]=![];_0x5a61b7[_0x8f85('0xc')]=_0x205751;_0x5a61b7[_0x8f85('0x16')]=hardware['getUuid']();if(_0x5a9e70){var _0x265ae8=encryptor[_0x8f85('0x11')](_0x5a9e70);_0x5a61b7[_0x8f85('0x17')]=_0x265ae8;_0x5a61b7[_0x8f85('0x18')]=moment(_0x265ae8)['add'](0x7,_0x8f85('0x19'))[_0x8f85('0x12')]();_0x5a61b7[_0x8f85('0x1a')]=_0x5a61b7[_0x8f85('0xc')]!=_0x5a61b7['machineUuid']?_0x8f85('0x1b'):_0x8f85('0x1c');}return _0x5a61b7;}catch(_0x78c307){breakingLicense[_0x8f85('0xc')]=_0x3d885c[_0x8f85('0xd')];breakingLicense[_0x8f85('0x1d')]=_0x78c307[_0x8f85('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x29d136,_0x34d47d){getLicense()[_0x8f85('0xb')](function(_0xd685e5){return db[_0x8f85('0x1e')][_0x8f85('0x1f')]({'attributes':[_0x8f85('0x20'),[db[_0x8f85('0x21')]['fn']('COUNT',db[_0x8f85('0x21')]['col'](_0x8f85('0x20'))),_0x8f85('0x22')]],'group':'role','where':{'role':{'$or':[_0x8f85('0x23'),'user','telephone']}},'raw':!![]})['then'](function(_0x3416f7){var _0x361007={'user':_0xd685e5[_0x8f85('0x24')]||0x0,'telephone':_0xd685e5[_0x8f85('0x25')]||0x0};_0x3416f7[_0x8f85('0x26')](function(_0x207ca9){var _0x540610=_0x207ca9[_0x8f85('0x20')]===_0x8f85('0x23')?_0x8f85('0x27'):_0x207ca9[_0x8f85('0x20')];_0x361007[_0x540610]-=_0x207ca9['count'];if(_0x361007[_0x540610]<0x0)_0x361007[_0x540610]=0x0;});_0x29d136(_0x361007);return;});})[_0x8f85('0x28')](function(_0x1aec0e){_0x34d47d(_0x1aec0e);});});}function checkUserLimits(_0x3bdfd9){return new BPromise(function(_0x14b2d6,_0x2bb5b9){getLimits()[_0x8f85('0xb')](function(_0x3ab1a0){var _0x2556c5=_[_0x8f85('0x29')](_[_0x8f85('0x2a')](_0x3bdfd9,_0x8f85('0x20')),[_0x8f85('0x23'),_0x8f85('0x27'),_0x8f85('0x2b')]);var _0x4d1fcf=(_0x2556c5['admin']||0x0)+(_0x2556c5[_0x8f85('0x27')]||0x0);var _0x252af8=_0x2556c5['telephone']||0x0;if(_0x4d1fcf>_0x3ab1a0[_0x8f85('0x27')])return _0x2bb5b9('License\x20limit\x20reached\x20for\x20users');if(_0x252af8>_0x3ab1a0[_0x8f85('0x2b')])return _0x2bb5b9(_0x8f85('0x2c'));return _0x14b2d6();})[_0x8f85('0x28')](function(_0xd1d9ae){_0x2bb5b9(_0xd1d9ae);});});}module[_0x8f85('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xbc7f=['telephone','users','telephones','forEach','admin','user','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','days','grayReason','uuid','disabled','message','User','findAll','role','sequelize','COUNT','col','count'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0xbc7f,0x1cc));var _0xfbc7=function(_0x5464e2,_0x47bc78){_0x5464e2=_0x5464e2-0x0;var _0x5ad880=_0xbc7f[_0x5464e2];return _0x5ad880;};'use strict';var util=require(_0xfbc7('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xfbc7('0x1'));var hardware=require('./hardware');var encryptor=require(_0xfbc7('0x2'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfbc7('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfbc7('0x4'),'machineUuid':hardware[_0xfbc7('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfbc7('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xfbc7('0x6'),'machineUuid':hardware[_0xfbc7('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x566604){return new BPromise(function(_0x2377e2,_0xa6e121){return db[_0xfbc7('0x7')][_0xfbc7('0x8')](_[_0xfbc7('0x9')](_0x566604,{'raw':!![],'where':{'id':0x1}}))[_0xfbc7('0xa')](function(_0x4447df){return checkLicense(_0x4447df,null);})['then'](function(_0x2ff88d){_0x2377e2(_0x2ff88d);return;})[_0xfbc7('0xb')](function(_0x84dbdd){_0xa6e121(_0x84dbdd);});});}function checkLicense(_0x5046d6,_0x2f70cc){if(!_0x5046d6){demoLicense['uuid']=_0x5046d6[_0xfbc7('0xc')];return demoLicense;}try{var _0x4094e0=_0x2f70cc||_0x5046d6[_0xfbc7('0xd')];if(_[_0xfbc7('0xe')](_0x4094e0)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x532939=_0x5046d6['data1'];var _0x40acce=_0x5046d6[_0xfbc7('0xf')];var _0x38355a=_0x532939['split']('-')[0x4];var _0x4bb215=_0x532939[_0xfbc7('0x10')]('-')[0x0];var _0x4359a3=encryptor[_0xfbc7('0x11')](_0x4094e0,util[_0xfbc7('0x12')](_0xfbc7('0x13'),_0x38355a,_0x532939,_0x4bb215));var _0x44746b=JSON[_0xfbc7('0x14')](_0x4359a3);_0x44746b[_0xfbc7('0x15')]=![];_0x44746b['uuid']=_0x532939;_0x44746b[_0xfbc7('0x16')]=hardware[_0xfbc7('0x5')]();if(_0x40acce){var _0x24117d=encryptor[_0xfbc7('0x11')](_0x40acce);_0x44746b['gray']=_0x24117d;_0x44746b['deadline']=moment(_0x24117d)['add'](0x7,_0xfbc7('0x17'))[_0xfbc7('0x12')]();_0x44746b[_0xfbc7('0x18')]=_0x44746b[_0xfbc7('0x19')]!=_0x44746b['machineUuid']?'changed':_0xfbc7('0x1a');}return _0x44746b;}catch(_0xfa9ba2){breakingLicense['uuid']=_0x5046d6[_0xfbc7('0xc')];breakingLicense['message']=_0xfa9ba2[_0xfbc7('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x54d937,_0x1fd0f6){getLicense()['then'](function(_0x106567){return db[_0xfbc7('0x1c')][_0xfbc7('0x1d')]({'attributes':[_0xfbc7('0x1e'),[db[_0xfbc7('0x1f')]['fn'](_0xfbc7('0x20'),db[_0xfbc7('0x1f')][_0xfbc7('0x21')](_0xfbc7('0x1e'))),_0xfbc7('0x22')]],'group':'role','where':{'role':{'$or':['admin','user',_0xfbc7('0x23')]}},'raw':!![]})['then'](function(_0x26906b){var _0x583315={'user':_0x106567[_0xfbc7('0x24')]||0x0,'telephone':_0x106567[_0xfbc7('0x25')]||0x0};_0x26906b[_0xfbc7('0x26')](function(_0xc83837){var _0x3fae4c=_0xc83837[_0xfbc7('0x1e')]===_0xfbc7('0x27')?_0xfbc7('0x28'):_0xc83837[_0xfbc7('0x1e')];_0x583315[_0x3fae4c]-=_0xc83837[_0xfbc7('0x22')];if(_0x583315[_0x3fae4c]<0x0)_0x583315[_0x3fae4c]=0x0;});_0x54d937(_0x583315);return;});})[_0xfbc7('0xb')](function(_0x8c765){_0x1fd0f6(_0x8c765);});});}function checkUserLimits(_0x3414c9){return new BPromise(function(_0x1d43c2,_0x280646){getLimits()[_0xfbc7('0xa')](function(_0x3d6c54){var _0x52dab9=_['pick'](_[_0xfbc7('0x29')](_0x3414c9,_0xfbc7('0x1e')),[_0xfbc7('0x27'),_0xfbc7('0x28'),_0xfbc7('0x23')]);var _0xdc06ed=(_0x52dab9[_0xfbc7('0x27')]||0x0)+(_0x52dab9[_0xfbc7('0x28')]||0x0);var _0x5833f6=_0x52dab9[_0xfbc7('0x23')]||0x0;if(_0xdc06ed>_0x3d6c54['user'])return _0x280646(_0xfbc7('0x2a'));if(_0x5833f6>_0x3d6c54['telephone'])return _0x280646(_0xfbc7('0x2b'));return _0x1d43c2();})[_0xfbc7('0xb')](function(_0x314ac6){_0x280646(_0x314ac6);});});}module[_0xfbc7('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 3f5254a..95301ec 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 _0xbbbc=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x2f67cf,_0x28f7bb){var _0x599e53=function(_0x12b9d8){while(--_0x12b9d8){_0x2f67cf['push'](_0x2f67cf['shift']());}};_0x599e53(++_0x28f7bb);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x24681b,_0x31424e){_0x24681b=_0x24681b-0x0;var _0x10d992=_0xbbbc[_0x24681b];return _0x10d992;};'use strict';module[_0xcbbb('0x0')]={'DOMAIN':_0xcbbb('0x1'),'SESSION_SECRET':_0xcbbb('0x2'),'GOOGLE_ID':_0xcbbb('0x3'),'GOOGLE_SECRET':_0xcbbb('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x02ce=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x59f3c0,_0xd19951){var _0x346b10=function(_0x50e724){while(--_0x50e724){_0x59f3c0['push'](_0x59f3c0['shift']());}};_0x346b10(++_0xd19951);}(_0x02ce,0x1ac));var _0xe02c=function(_0x141ca7,_0x2cd61b){_0x141ca7=_0x141ca7-0x0;var _0x5c4a52=_0x02ce[_0x141ca7];return _0x5c4a52;};'use strict';module[_0xe02c('0x0')]={'DOMAIN':_0xe02c('0x1'),'SESSION_SECRET':_0xe02c('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe02c('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index bd12484..64b2f3c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x761c=['transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','join','/var','xcally','%s-%s.log','message','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x761c,0x1e8));var _0xc761=function(_0x333f3c,_0x26fd61){_0x333f3c=_0x333f3c-0x0;var _0x572190=_0x761c[_0x333f3c];return _0x572190;};'use strict';var moment=require(_0xc761('0x0'));var winston=require(_0xc761('0x1'));var util=require(_0xc761('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x21c076,_0x9bcb78){return path[_0xc761('0x3')](_0xc761('0x4'),'log',_0xc761('0x5'),util['format'](_0xc761('0x6'),_0x21c076,_0x9bcb78));}function formatter(_0x51c3ce,_0x24bfe2){_0x24bfe2[_0xc761('0x7')]=_0x24bfe2[_0xc761('0x7')][_0xc761('0x8')](/@@{/g,'{{{')['replace'](/}@@/g,_0xc761('0x9'))[_0xc761('0x8')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xc761('0xa')](_0xc761('0xb'),moment()[_0xc761('0xa')](_0xc761('0xc')),_0x24bfe2['level'][_0xc761('0xd')](),_0x51c3ce,_0x24bfe2[_0xc761('0x7')]);}module[_0xc761('0xe')]=function(_0x525bfc){return new winston[(_0xc761('0xf'))]({'transports':[new winston[(_0xc761('0x10'))][(_0xc761('0x11'))]({'name':util[_0xc761('0xa')](_0xc761('0x12'),_0x525bfc,_0xc761('0x13')),'filename':filename(_0x525bfc,_0xc761('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xfcd29d){return formatter(_0x525bfc,_0xfcd29d);}}),new winston[(_0xc761('0x10'))][(_0xc761('0x11'))]({'name':util[_0xc761('0xa')](_0xc761('0x12'),_0x525bfc,_0xc761('0x14')),'filename':filename(_0x525bfc,_0xc761('0x14')),'level':_0xc761('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x18e5b1){return formatter(_0x525bfc,_0x18e5b1);}}),new winston[(_0xc761('0x10'))][(_0xc761('0x15'))]({'level':process[_0xc761('0x16')][_0xc761('0x17')]||debugLevel,'json':![],'formatter':function(_0x3fe4a0){return formatter(_0x525bfc,_0x3fe4a0);}})]});}; \ No newline at end of file +var _0x18be=['}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','exports','Logger','transports','File','%s-%s','error','info','env','debugLevel','moment','winston','util','path','INFO','/var','log','xcally','format','message','replace'];(function(_0x123008,_0x40c3e4){var _0x2ed411=function(_0x368489){while(--_0x368489){_0x123008['push'](_0x123008['shift']());}};_0x2ed411(++_0x40c3e4);}(_0x18be,0x165));var _0xe18b=function(_0x363d62,_0xdad2dc){_0x363d62=_0x363d62-0x0;var _0xef4ccb=_0x18be[_0x363d62];return _0xef4ccb;};'use strict';var moment=require(_0xe18b('0x0'));var winston=require(_0xe18b('0x1'));var util=require(_0xe18b('0x2'));var path=require(_0xe18b('0x3'));var debugLevel=_0xe18b('0x4');function filename(_0xd85ad,_0x28cd48){return path['join'](_0xe18b('0x5'),_0xe18b('0x6'),_0xe18b('0x7'),util[_0xe18b('0x8')]('%s-%s.log',_0xd85ad,_0x28cd48));}function formatter(_0x1f25bc,_0x58242a){_0x58242a['message']=_0x58242a[_0xe18b('0x9')][_0xe18b('0xa')](/@@{/g,'{{{')[_0xe18b('0xa')](/}@@/g,_0xe18b('0xb'))['replace'](/@{/g,'{{')[_0xe18b('0xa')](/}@/g,'}}');return util[_0xe18b('0x8')](_0xe18b('0xc'),moment()[_0xe18b('0x8')](_0xe18b('0xd')),_0x58242a['level']['toUpperCase'](),_0x1f25bc,_0x58242a['message']);}module[_0xe18b('0xe')]=function(_0x4c7cbe){return new winston[(_0xe18b('0xf'))]({'transports':[new winston[(_0xe18b('0x10'))][(_0xe18b('0x11'))]({'name':util[_0xe18b('0x8')](_0xe18b('0x12'),_0x4c7cbe,_0xe18b('0x13')),'filename':filename(_0x4c7cbe,_0xe18b('0x13')),'level':_0xe18b('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5950f2){return formatter(_0x4c7cbe,_0x5950f2);}}),new winston['transports'][(_0xe18b('0x11'))]({'name':util[_0xe18b('0x8')](_0xe18b('0x12'),_0x4c7cbe,_0xe18b('0x14')),'filename':filename(_0x4c7cbe,'info'),'level':_0xe18b('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x46cd8b){return formatter(_0x4c7cbe,_0x46cd8b);}}),new winston['transports']['Console']({'level':process[_0xe18b('0x15')][_0xe18b('0x16')]||debugLevel,'json':![],'formatter':function(_0x509bd9){return formatter(_0x4c7cbe,_0x509bd9);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4e01cd5..9192b0f 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 _0xaf3a=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','join','../../services/express/index.js','ami'];(function(_0x2604c0,_0x48b77d){var _0x2f3b4a=function(_0x3d0030){while(--_0x3d0030){_0x2604c0['push'](_0x2604c0['shift']());}};_0x2f3b4a(++_0x48b77d);}(_0xaf3a,0x75));var _0xaaf3=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xaf3a[_0x31a576];return _0x30b1d3;};'use strict';var path=require(_0xaaf3('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xaaf3('0x1')](__dirname,_0xaaf3('0x2'))},{'name':_0xaaf3('0x3'),'script':path['join'](__dirname,_0xaaf3('0x4'))},{'name':_0xaaf3('0x5'),'script':path[_0xaaf3('0x1')](__dirname,_0xaaf3('0x6'))},{'name':_0xaaf3('0x7'),'script':path[_0xaaf3('0x1')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0xaaf3('0x1')](__dirname,_0xaaf3('0x8'))},{'name':_0xaaf3('0x9'),'script':path[_0xaaf3('0x1')](__dirname,_0xaaf3('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0x8cac=['../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','email'];(function(_0x2ba37d,_0x1ec6c9){var _0x20ed72=function(_0x385717){while(--_0x385717){_0x2ba37d['push'](_0x2ba37d['shift']());}};_0x20ed72(++_0x1ec6c9);}(_0x8cac,0x116));var _0xc8ca=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x8cac[_0x3511d3];return _0x5d6321;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xc8ca('0x0'),'script':path['join'](__dirname,_0xc8ca('0x1'))},{'name':_0xc8ca('0x2'),'script':path[_0xc8ca('0x3')](__dirname,_0xc8ca('0x4'))},{'name':_0xc8ca('0x5'),'script':path[_0xc8ca('0x3')](__dirname,_0xc8ca('0x6'))},{'name':_0xc8ca('0x7'),'script':path['join'](__dirname,_0xc8ca('0x8'))},{'name':'routing','script':path[_0xc8ca('0x3')](__dirname,_0xc8ca('0x9'))},{'name':_0xc8ca('0xa'),'script':path[_0xc8ca('0x3')](__dirname,_0xc8ca('0xb'))}]};module[_0xc8ca('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 097d507..8d72462 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 _0x4a15=['describe','delete','dump','saved','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a15,0xc8));var _0x54a1=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0x4a15[_0x13594e];return _0x1a4f42;};'use strict';var pm2=require('pm2');var BPromise=require(_0x54a1('0x0'));var config=require(_0x54a1('0x1'));function connect(){return new BPromise(function(_0x5b4dc4,_0x22b732){return pm2[_0x54a1('0x2')](function(_0x5758a0){if(_0x5758a0){return _0x22b732(_0x5758a0);}return _0x5b4dc4(_0x54a1('0x3'));});});};exports[_0x54a1('0x4')]=function(_0x13c502){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x11dcc3,_0x2bc2c4){return pm2[_0x54a1('0x4')](_0x13c502,function(_0x141f13,_0x40179a){if(_0x141f13){return _0x2bc2c4(_0x141f13);}pm2[_0x54a1('0x6')]();return _0x11dcc3(_0x40179a);});});});};exports[_0x54a1('0x7')]=function(_0x5f055b){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x5f3e41,_0x11053a){return pm2[_0x54a1('0x7')](_0x5f055b,function(_0x57ab43,_0x1a4bcb){if(_0x57ab43){return _0x11053a(_0x57ab43);}pm2[_0x54a1('0x6')]();return _0x5f3e41(_0x1a4bcb);});});});};exports['restart']=function(_0x30dc69){return connect()['then'](function(){return new BPromise(function(_0x97eb65,_0x320ed6){return pm2[_0x54a1('0x8')](_0x30dc69,function(_0x5cd40d,_0x41e733){if(_0x5cd40d){return _0x320ed6(_0x5cd40d);}pm2[_0x54a1('0x6')]();return _0x97eb65(_0x41e733);});});});};exports['list']=function(){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x4dcf80,_0x11bfdc){return pm2[_0x54a1('0x9')](function(_0x58889a,_0x24b088){if(_0x58889a){return _0x11bfdc(_0x58889a);}pm2['disconnect']();return _0x4dcf80(_0x24b088);});});});};exports['describe']=function(_0x1a01c0){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x39bec1,_0x2fe903){return pm2[_0x54a1('0xa')](_0x1a01c0,function(_0x9611a3,_0x2ef2b8){if(_0x9611a3){return _0x2fe903(_0x9611a3);}pm2[_0x54a1('0x6')]();return _0x39bec1(_0x2ef2b8);});});});};exports[_0x54a1('0xb')]=function(_0x657b8b){return connect()['then'](function(){return new BPromise(function(_0x104b10,_0x49905a){return pm2[_0x54a1('0xb')](_0x657b8b,function(_0x149e1a,_0x3559d4){if(_0x149e1a){return _0x49905a(_0x149e1a);}pm2['disconnect']();return _0x104b10(_0x3559d4);});});});};exports[_0x54a1('0xc')]=function(){return connect()[_0x54a1('0x5')](function(){return new BPromise(function(_0x4602aa,_0x50d173){return pm2[_0x54a1('0xc')](function(_0x230a05){if(_0x230a05){return _0x50d173(_0x230a05);}return _0x4602aa(_0x54a1('0xd'));});});});}; \ No newline at end of file +var _0xb0fd=['start','disconnect','stop','then','restart','list','describe','delete','dump','pm2','bluebird','./config','connect','connected'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb0fd,0x183));var _0xdb0f=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0xb0fd[_0x2b6600];return _0x912ee2;};'use strict';var pm2=require(_0xdb0f('0x0'));var BPromise=require(_0xdb0f('0x1'));var config=require(_0xdb0f('0x2'));function connect(){return new BPromise(function(_0x20c698,_0x1f59c7){return pm2[_0xdb0f('0x3')](function(_0x1757ed){if(_0x1757ed){return _0x1f59c7(_0x1757ed);}return _0x20c698(_0xdb0f('0x4'));});});};exports[_0xdb0f('0x5')]=function(_0x1873ba){return connect()['then'](function(){return new BPromise(function(_0xad17b2,_0x27346d){return pm2[_0xdb0f('0x5')](_0x1873ba,function(_0x523796,_0x2b5b79){if(_0x523796){return _0x27346d(_0x523796);}pm2[_0xdb0f('0x6')]();return _0xad17b2(_0x2b5b79);});});});};exports[_0xdb0f('0x7')]=function(_0x3ecac8){return connect()[_0xdb0f('0x8')](function(){return new BPromise(function(_0x12dc9b,_0x4ed986){return pm2[_0xdb0f('0x7')](_0x3ecac8,function(_0x2384bd,_0x5da410){if(_0x2384bd){return _0x4ed986(_0x2384bd);}pm2[_0xdb0f('0x6')]();return _0x12dc9b(_0x5da410);});});});};exports[_0xdb0f('0x9')]=function(_0x707a9f){return connect()[_0xdb0f('0x8')](function(){return new BPromise(function(_0x43d8bc,_0x458b1a){return pm2['restart'](_0x707a9f,function(_0x23dfa3,_0x1d79c7){if(_0x23dfa3){return _0x458b1a(_0x23dfa3);}pm2['disconnect']();return _0x43d8bc(_0x1d79c7);});});});};exports[_0xdb0f('0xa')]=function(){return connect()[_0xdb0f('0x8')](function(){return new BPromise(function(_0x5a27f3,_0x16937e){return pm2[_0xdb0f('0xa')](function(_0x3e412e,_0x31438e){if(_0x3e412e){return _0x16937e(_0x3e412e);}pm2[_0xdb0f('0x6')]();return _0x5a27f3(_0x31438e);});});});};exports[_0xdb0f('0xb')]=function(_0x5eb7e8){return connect()['then'](function(){return new BPromise(function(_0x53809e,_0xb03c2b){return pm2['describe'](_0x5eb7e8,function(_0x14b8da,_0x35d742){if(_0x14b8da){return _0xb03c2b(_0x14b8da);}pm2['disconnect']();return _0x53809e(_0x35d742);});});});};exports[_0xdb0f('0xc')]=function(_0x1bc84b){return connect()[_0xdb0f('0x8')](function(){return new BPromise(function(_0x3d3421,_0x58c059){return pm2[_0xdb0f('0xc')](_0x1bc84b,function(_0x2c656d,_0x4f84e6){if(_0x2c656d){return _0x58c059(_0x2c656d);}pm2['disconnect']();return _0x3d3421(_0x4f84e6);});});});};exports['dump']=function(){return connect()[_0xdb0f('0x8')](function(){return new BPromise(function(_0x3335b7,_0x33a9fb){return pm2[_0xdb0f('0xd')](function(_0xbdf302){if(_0xbdf302){return _0x33a9fb(_0xbdf302);}return _0x3335b7('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 491c78b..78788bf 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 _0x4e64=['start','moment','ioredis','util','../../config/environment','../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','join','length','emit','chatInteraction:update','catch','error','inspect'];(function(_0x48c147,_0x492051){var _0x3de81c=function(_0x1bc2aa){while(--_0x1bc2aa){_0x48c147['push'](_0x48c147['shift']());}};_0x3de81c(++_0x492051);}(_0x4e64,0x79));var _0x44e6=function(_0xe04ebf,_0x5b44cd){_0xe04ebf=_0xe04ebf-0x0;var _0x36256f=_0x4e64[_0xe04ebf];return _0x36256f;};'use strict';var _=require('lodash');var moment=require(_0x44e6('0x0'));var Redis=require(_0x44e6('0x1'));var util=require(_0x44e6('0x2'));var config=require(_0x44e6('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x44e6('0x4'))(_0x44e6('0x5'));config['redis']=_[_0x44e6('0x6')](config[_0x44e6('0x7')],{'host':_0x44e6('0x8'),'port':0x18eb});var io=require(_0x44e6('0x9'))(new Redis(config[_0x44e6('0x7')]));function closeInteractions(){var _0x5b891c=0x0;var _0x76cb05=[];return db[_0x44e6('0xa')]['find']({'raw':!![],'attributes':['id',_0x44e6('0xb')],'where':{'id':0x1}})[_0x44e6('0xc')](function(_0x510c77){_0x5b891c=_0x510c77[_0x44e6('0xb')];if(_0x5b891c){return db[_0x44e6('0xd')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x510c77[_0x44e6('0xb')],_0x44e6('0xe'))}}});}else{return[];}})[_0x44e6('0xc')](function(_0x284d1b){if(_0x284d1b&&_0x284d1b['length']){_0x76cb05=_['map'](_0x284d1b||[],'id');logger[_0x44e6('0xf')](_0x44e6('0x10'),_0x76cb05['join']());return db[_0x44e6('0xd')][_0x44e6('0x11')]({'closeReason':_0x44e6('0x12'),'disposition':_0x44e6('0x13'),'closed':!![],'closedAt':moment()[_0x44e6('0x14')](_0x44e6('0x15'))},{'where':{'id':_0x76cb05}});}})['then'](function(){if(_0x76cb05&&_0x76cb05['length']){logger[_0x44e6('0xf')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x76cb05[_0x44e6('0x16')]());for(var _0x9d82a8=0x0;_0x9d82a8<_0x76cb05[_0x44e6('0x17')];_0x9d82a8++){io[_0x44e6('0x18')](_0x44e6('0x19'),{'id':_0x76cb05[_0x9d82a8],'closed':!![]});}}})[_0x44e6('0x1a')](function(_0x870960){logger[_0x44e6('0x1b')]('[CHAT]\x20Error\x20closing\x20interactions',_0x870960?util[_0x44e6('0x1c')](_0x870960,{'showHidden':![],'depth':null}):'');});}exports[_0x44e6('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xde83=['map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','localhost','socket.io-emitter','redis','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length'];(function(_0x2c1ae2,_0x465d30){var _0x1364c4=function(_0x10cc5c){while(--_0x10cc5c){_0x2c1ae2['push'](_0x2c1ae2['shift']());}};_0x1364c4(++_0x465d30);}(_0xde83,0xb2));var _0x3de8=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xde83[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x3de8('0x0'));var moment=require(_0x3de8('0x1'));var Redis=require('ioredis');var util=require(_0x3de8('0x2'));var config=require(_0x3de8('0x3'));var db=require(_0x3de8('0x4'))['db'];var logger=require(_0x3de8('0x5'))(_0x3de8('0x6'));config['redis']=_[_0x3de8('0x7')](config['redis'],{'host':_0x3de8('0x8'),'port':0x18eb});var io=require(_0x3de8('0x9'))(new Redis(config[_0x3de8('0xa')]));function closeInteractions(){var _0x42c7e5=0x0;var _0x1749ff=[];return db[_0x3de8('0xb')][_0x3de8('0xc')]({'raw':!![],'attributes':['id',_0x3de8('0xd')],'where':{'id':0x1}})[_0x3de8('0xe')](function(_0x2e40ea){_0x42c7e5=_0x2e40ea[_0x3de8('0xd')];if(_0x42c7e5){return db['ChatInteraction'][_0x3de8('0xf')]({'raw':!![],'attributes':['id',_0x3de8('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3de8('0x11')](_0x2e40ea[_0x3de8('0xd')],_0x3de8('0x12'))}}});}else{return[];}})['then'](function(_0x1e5822){if(_0x1e5822&&_0x1e5822[_0x3de8('0x13')]){_0x1749ff=_[_0x3de8('0x14')](_0x1e5822||[],'id');logger[_0x3de8('0x15')](_0x3de8('0x16'),_0x1749ff[_0x3de8('0x17')]());return db['ChatInteraction'][_0x3de8('0x18')]({'closeReason':'system','disposition':_0x3de8('0x19'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1749ff}});}})[_0x3de8('0xe')](function(){if(_0x1749ff&&_0x1749ff[_0x3de8('0x13')]){logger[_0x3de8('0x15')](_0x3de8('0x1a'),_0x1749ff['join']());for(var _0x2e1dfe=0x0;_0x2e1dfe<_0x1749ff['length'];_0x2e1dfe++){io[_0x3de8('0x1b')](_0x3de8('0x1c'),{'id':_0x1749ff[_0x2e1dfe],'closed':!![]});}}})['catch'](function(_0x2829ff){logger[_0x3de8('0x1d')](_0x3de8('0x1e'),_0x2829ff?util[_0x3de8('0x1f')](_0x2829ff,{'showHidden':![],'depth':null}):'');});}exports[_0x3de8('0x20')]=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 6f82ba3..fd807fa 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 _0x0967=['join','../../files/reports','savename','format','basename','extname','zip','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','keys','jobs','keyBy','toString','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','update','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','service','MailAccount','Smtp','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit'];(function(_0x228412,_0x2bd9b9){var _0x424798=function(_0x3dd047){while(--_0x3dd047){_0x228412['push'](_0x228412['shift']());}};_0x424798(++_0x2bd9b9);}(_0x0967,0x155));var _0x7096=function(_0x595edc,_0x20ca61){_0x595edc=_0x595edc-0x0;var _0x1177e6=_0x0967[_0x595edc];return _0x1177e6;};'use strict';var fs=require('fs');var util=require(_0x7096('0x0'));var path=require(_0x7096('0x1'));var _=require(_0x7096('0x2'));var moment=require(_0x7096('0x3'));var CronJobManager=require(_0x7096('0x4'));var jayson=require(_0x7096('0x5'));var BPromise=require('bluebird');var logger=require(_0x7096('0x6'))(_0x7096('0x7'));var db=require(_0x7096('0x8'))['db'];var analyticCustomReportController=require(_0x7096('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x7096('0xa')][_0x7096('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2b9f19,_0x52ae0d){return function(){logger[_0x7096('0xc')](_0x7096('0xd'),_0x2b9f19['email']);var _0x7eae7c=!![];var _0x5bbf92={'tls':{'rejectUnauthorized':![]}};if(_0x2b9f19['MailAccount']['Smtp'][_0x7096('0xe')]){_0x5bbf92['service']=_0x2b9f19[_0x7096('0xf')][_0x7096('0x10')]['service'];}else{_0x5bbf92[_0x7096('0x11')]=_0x2b9f19[_0x7096('0xf')][_0x7096('0x10')]['host'];_0x5bbf92[_0x7096('0x12')]=_0x2b9f19['MailAccount'][_0x7096('0x10')][_0x7096('0x12')];_0x5bbf92[_0x7096('0x13')]=_0x2b9f19['MailAccount']['Smtp'][_0x7096('0x13')];}if(_0x2b9f19['MailAccount']['Smtp'][_0x7096('0x14')]){_0x5bbf92[_0x7096('0x15')]={'user':_0x2b9f19[_0x7096('0xf')]['Smtp']['user'],'pass':_0x2b9f19[_0x7096('0xf')][_0x7096('0x10')][_0x7096('0x16')]};}var _0x1bf3ac={'account':_0x5bbf92,'message':{'from':util['format'](_0x7096('0x17'),_0x2b9f19[_0x7096('0xf')]['name'],_0x2b9f19[_0x7096('0xf')][_0x7096('0x18')]||_0x2b9f19[_0x7096('0xf')]['Smtp'][_0x7096('0x19')]),'to':_0x2b9f19[_0x7096('0x18')],'cc':_0x2b9f19['cc'],'bcc':_0x2b9f19[_0x7096('0x1a')],'subject':util['format'](_0x7096('0x1b'),_0x52ae0d[_0x7096('0x1c')],_0x2b9f19[_0x7096('0x1d')],_0x2b9f19[_0x7096('0x1e')])}};var _0x5a2d0f=path[_0x7096('0x1f')](__dirname,_0x7096('0x20'));var _0x3854dd=_0x52ae0d[_0x7096('0x21')];var _0x56799c=util[_0x7096('0x22')]('%s.%s',path[_0x7096('0x23')](_0x52ae0d[_0x7096('0x21')],path[_0x7096('0x24')](_0x52ae0d[_0x7096('0x21')])),_0x7096('0x25'));var _0x2b0c69=path['join'](_0x5a2d0f,_0x3854dd);var _0x2d86be=path[_0x7096('0x1f')](_0x5a2d0f,_0x56799c);if(fs['existsSync'](_0x2b0c69)){_0x52ae0d[_0x7096('0x26')]=_0x7096('0x27');_0x1bf3ac['message'][_0x7096('0x28')]=[{'filename':_0x3854dd,'path':_0x2b0c69}];_0x1bf3ac[_0x7096('0x29')][_0x7096('0x2a')]=util[_0x7096('0x22')](_0x7096('0x2b'),JSON['stringify'](_0x52ae0d,null,0x2));}else if(fs[_0x7096('0x2c')](_0x2d86be)){_0x52ae0d[_0x7096('0x26')]=_0x7096('0x27');_0x1bf3ac[_0x7096('0x29')][_0x7096('0x28')]=[{'filename':_0x56799c,'path':_0x2d86be}];}else{_0x1bf3ac[_0x7096('0x29')][_0x7096('0x2a')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2b9f19[_0x7096('0x2d')]){_0x7eae7c=![];logger[_0x7096('0xc')](_0x7096('0x2e'));}}if(_0x7eae7c){return client[_0x7096('0x2f')](_0x7096('0x30'),_0x1bf3ac)[_0x7096('0x31')](function(_0x28f566){if(_0x28f566[_0x7096('0x32')]){return logger[_0x7096('0x32')](_0x7096('0x33'),JSON[_0x7096('0x34')](_0x28f566));}return logger['info'](_0x7096('0x35'));})[_0x7096('0x36')](function(_0x54b464){return logger[_0x7096('0x32')](_0x7096('0x33'),JSON[_0x7096('0x34')](_0x54b464));});}};}function handleError(){return function(_0x2cea5a){return logger['error'](JSON[_0x7096('0x34')](_0x2cea5a));};}function handleResult(_0x1ed63b){return function(_0x2d3bba){logger[_0x7096('0xc')](_0x7096('0x37'),JSON[_0x7096('0x34')](_0x2d3bba));if(_0x1ed63b[_0x7096('0xf')]&&_0x1ed63b[_0x7096('0xf')][_0x7096('0x10')]&&!_[_0x7096('0x38')](_0x1ed63b[_0x7096('0x18')])){setTimeout(handleSendEmail(_0x1ed63b,_0x2d3bba),0x3c*0x3e8);}};}function handleJob(_0x5800e6){return function(){try{if(_[_0x7096('0x38')](_0x5800e6[_0x7096('0x1d')])){return logger['info'](_0x7096('0x39'));}if(_[_0x7096('0x38')](_0x5800e6[_0x7096('0x1e')])){return logger[_0x7096('0xc')](_0x7096('0x3a'));}var _0x3e6de1={'startDate':moment()[_0x7096('0x3b')](_0x5800e6[_0x7096('0x1d')],_0x5800e6['subtractUnit'])['format'](_0x7096('0x3c')),'endDate':moment()[_0x7096('0x22')](_0x7096('0x3c')),'type':_0x7096('0x3d'),'output':_0x5800e6['output'],'name':_0x5800e6[_0x7096('0x1c')]};if(!_['isNil'](_0x5800e6[_0x7096('0x3e')])){logger[_0x7096('0xc')](_0x7096('0x3f'),_0x5800e6['DefaultReportId']);return analyticDefaultReportController[_0x7096('0x40')]({'id':_0x5800e6[_0x7096('0x3e')]},_0x3e6de1)[_0x7096('0x31')](handleResult(_0x5800e6))[_0x7096('0x36')](handleError());}if(!_[_0x7096('0x38')](_0x5800e6[_0x7096('0x41')])){logger[_0x7096('0xc')](_0x7096('0x42'),_0x5800e6[_0x7096('0x41')]);return analyticCustomReportController[_0x7096('0x40')]({'id':_0x5800e6[_0x7096('0x41')]},_0x3e6de1)[_0x7096('0x31')](handleResult(_0x5800e6))['catch'](handleError());}}catch(_0x99ace4){logger[_0x7096('0x32')](JSON[_0x7096('0x34')](_0x99ace4));}return logger[_0x7096('0xc')]('no\x20report\x20id');};}function getJobs(_0x166c1b){var _0x30cdb6={};if(_0x166c1b){_0x30cdb6['id']=_0x166c1b;}return db[_0x7096('0x43')][_0x7096('0x44')]({'where':_0x30cdb6,'include':[{'model':db[_0x7096('0xf')],'attributes':['id',_0x7096('0x1c'),_0x7096('0x18')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x7096('0x31')](function(_0x54eeba){var _0x110e89=_[_0x7096('0x45')](manager[_0x7096('0x46')]);var _0x1b00df=_['map'](_0x54eeba,function(_0x2b3c47){return _0x2b3c47['id']['toString']();});var _0x24f6f7=_[_0x7096('0x47')](_0x54eeba,function(_0xf35b0c){return _0xf35b0c['id'][_0x7096('0x48')]();});var _0x17045a=_0x166c1b?_0x1b00df:_['difference'](_0x1b00df,_0x110e89);var _0x2a12ec=_[_0x7096('0x49')](_0x1b00df,_0x110e89);var _0x176fbf=_[_0x7096('0x4a')](_0x110e89,_0x1b00df);var _0x51f4fd;var _0x3c2e12;for(_0x51f4fd=0x0;_0x51f4fd<_0x176fbf[_0x7096('0x4b')]&&!_0x166c1b;_0x51f4fd+=0x1){_0x3c2e12=_0x176fbf[_0x51f4fd]['toString']();if(manager[_0x7096('0x4c')](_0x3c2e12)){manager[_0x7096('0x4d')](_0x3c2e12);manager[_0x7096('0x4e')](_0x3c2e12);logger[_0x7096('0xc')](_0x7096('0x4f'),_0x3c2e12);}}logger[_0x7096('0xc')](_0x7096('0x50'),JSON[_0x7096('0x34')](_0x17045a));for(_0x51f4fd=0x0;_0x51f4fd<_0x17045a[_0x7096('0x4b')];_0x51f4fd+=0x1){_0x3c2e12=_0x17045a[_0x51f4fd][_0x7096('0x48')]();logger[_0x7096('0xc')](_0x7096('0x51'),_0x3c2e12);if(_0x166c1b){logger['info']('my\x20id',_0x166c1b);logger[_0x7096('0xc')](JSON['stringify'](_0x24f6f7[_0x3c2e12]));BPromise['resolve']()[_0x7096('0x31')](handleJob(_0x24f6f7[_0x3c2e12]));logger['info']('run\x20job',_0x24f6f7[_0x3c2e12]['name'],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}else if(_0x24f6f7[_0x3c2e12][_0x7096('0x52')]&&_0x24f6f7[_0x3c2e12]['active']&&moment()[_0x7096('0x53')](_0x24f6f7[_0x3c2e12][_0x7096('0x54')],_0x24f6f7[_0x3c2e12][_0x7096('0x55')])){manager[_0x7096('0x56')](_0x3c2e12,_0x24f6f7[_0x3c2e12][_0x7096('0x52')],handleJob(_0x24f6f7[_0x3c2e12]));manager[_0x7096('0x57')](_0x3c2e12);logger[_0x7096('0xc')](_0x7096('0x58'),_0x24f6f7[_0x3c2e12][_0x7096('0x1c')],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}else if(manager['exists'](_0x3c2e12)){manager[_0x7096('0x4d')](_0x3c2e12);manager['deleteJob'](_0x3c2e12);logger['info'](_0x7096('0x59'),_0x24f6f7[_0x3c2e12]['name'],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}}for(_0x51f4fd=0x0,_0x3c2e12;_0x51f4fd<_0x2a12ec[_0x7096('0x4b')]&&!_0x166c1b;_0x51f4fd+=0x1){_0x3c2e12=_0x2a12ec[_0x51f4fd][_0x7096('0x48')]();if(manager[_0x7096('0x4c')](_0x3c2e12)){if(_0x24f6f7[_0x3c2e12][_0x7096('0x52')]&&_0x24f6f7[_0x3c2e12][_0x7096('0x5a')]&&moment()[_0x7096('0x53')](_0x24f6f7[_0x3c2e12][_0x7096('0x54')],_0x24f6f7[_0x3c2e12][_0x7096('0x55')])){manager[_0x7096('0x5b')](_0x3c2e12,_0x24f6f7[_0x3c2e12][_0x7096('0x52')],handleJob(_0x24f6f7[_0x3c2e12]));logger[_0x7096('0xc')]('update\x20cron',_0x24f6f7[_0x3c2e12][_0x7096('0x1c')],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}else{manager[_0x7096('0x4d')](_0x3c2e12);manager[_0x7096('0x4e')](_0x3c2e12);logger[_0x7096('0xc')]('stop\x20cron',_0x24f6f7[_0x3c2e12][_0x7096('0x1c')],_0x24f6f7[_0x3c2e12][_0x7096('0x52')]);}}}})[_0x7096('0x36')](function(_0x5c256f){logger[_0x7096('0x32')](JSON['stringify'](_0x5c256f));});}exports[_0x7096('0x5c')]=function(_0x4585f4){return getJobs(_0x4585f4);};exports[_0x7096('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb203=['secure','auth','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','Sent','message','attachments','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','then','CustomReportId','no\x20report\x20id','Schedule','findAll','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','start','update\x20cron','lodash','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','service','MailAccount','Smtp','host','port'];(function(_0x4f0c2b,_0x2c9d14){var _0x526436=function(_0x2e13b6){while(--_0x2e13b6){_0x4f0c2b['push'](_0x4f0c2b['shift']());}};_0x526436(++_0x2c9d14);}(_0xb203,0x18e));var _0x3b20=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb203[_0x122ef9];return _0x42fba0;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x3b20('0x0'));var moment=require('moment');var CronJobManager=require(_0x3b20('0x1'));var jayson=require(_0x3b20('0x2'));var BPromise=require(_0x3b20('0x3'));var logger=require('../logger')(_0x3b20('0x4'));var db=require(_0x3b20('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x3b20('0x6'));var client=jayson[_0x3b20('0x7')][_0x3b20('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x55206d,_0x4e80ae){return function(){logger[_0x3b20('0x9')](_0x3b20('0xa'),_0x55206d[_0x3b20('0xb')]);var _0x42cc7b=!![];var _0x34659c={'tls':{'rejectUnauthorized':![]}};if(_0x55206d['MailAccount']['Smtp'][_0x3b20('0xc')]){_0x34659c[_0x3b20('0xc')]=_0x55206d[_0x3b20('0xd')][_0x3b20('0xe')][_0x3b20('0xc')];}else{_0x34659c[_0x3b20('0xf')]=_0x55206d[_0x3b20('0xd')][_0x3b20('0xe')][_0x3b20('0xf')];_0x34659c[_0x3b20('0x10')]=_0x55206d[_0x3b20('0xd')][_0x3b20('0xe')]['port'];_0x34659c[_0x3b20('0x11')]=_0x55206d[_0x3b20('0xd')]['Smtp'][_0x3b20('0x11')];}if(_0x55206d[_0x3b20('0xd')][_0x3b20('0xe')]['authentication']){_0x34659c[_0x3b20('0x12')]={'user':_0x55206d[_0x3b20('0xd')]['Smtp']['user'],'pass':_0x55206d[_0x3b20('0xd')][_0x3b20('0xe')][_0x3b20('0x13')]};}var _0x58d322={'account':_0x34659c,'message':{'from':util[_0x3b20('0x14')](_0x3b20('0x15'),_0x55206d[_0x3b20('0xd')][_0x3b20('0x16')],_0x55206d[_0x3b20('0xd')][_0x3b20('0xb')]||_0x55206d[_0x3b20('0xd')][_0x3b20('0xe')][_0x3b20('0x17')]),'to':_0x55206d[_0x3b20('0xb')],'cc':_0x55206d['cc'],'bcc':_0x55206d[_0x3b20('0x18')],'subject':util[_0x3b20('0x14')](_0x3b20('0x19'),_0x4e80ae[_0x3b20('0x16')],_0x55206d[_0x3b20('0x1a')],_0x55206d[_0x3b20('0x1b')])}};var _0x25fcd0=path[_0x3b20('0x1c')](__dirname,_0x3b20('0x1d'));var _0x4cb40d=_0x4e80ae[_0x3b20('0x1e')];var _0x2e81ab=util[_0x3b20('0x14')](_0x3b20('0x1f'),path['basename'](_0x4e80ae[_0x3b20('0x1e')],path[_0x3b20('0x20')](_0x4e80ae[_0x3b20('0x1e')])),_0x3b20('0x21'));var _0x476b63=path[_0x3b20('0x1c')](_0x25fcd0,_0x4cb40d);var _0x26acfe=path['join'](_0x25fcd0,_0x2e81ab);if(fs[_0x3b20('0x22')](_0x476b63)){_0x4e80ae[_0x3b20('0x23')]=_0x3b20('0x24');_0x58d322[_0x3b20('0x25')]['attachments']=[{'filename':_0x4cb40d,'path':_0x476b63}];_0x58d322[_0x3b20('0x25')]['text']=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x4e80ae,null,0x2));}else if(fs[_0x3b20('0x22')](_0x26acfe)){_0x4e80ae[_0x3b20('0x23')]=_0x3b20('0x24');_0x58d322[_0x3b20('0x25')][_0x3b20('0x26')]=[{'filename':_0x2e81ab,'path':_0x26acfe}];}else{_0x58d322['message'][_0x3b20('0x27')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x55206d[_0x3b20('0x28')]){_0x42cc7b=![];logger[_0x3b20('0x9')](_0x3b20('0x29'));}}if(_0x42cc7b){return client[_0x3b20('0x2a')](_0x3b20('0x2b'),_0x58d322)['then'](function(_0x3183e8){if(_0x3183e8[_0x3b20('0x2c')]){return logger['error']('error\x20mail',JSON[_0x3b20('0x2d')](_0x3183e8));}return logger[_0x3b20('0x9')]('email\x20sent');})[_0x3b20('0x2e')](function(_0x24e1ea){return logger['error']('error\x20mail',JSON[_0x3b20('0x2d')](_0x24e1ea));});}};}function handleError(){return function(_0x229c93){return logger[_0x3b20('0x2c')](JSON['stringify'](_0x229c93));};}function handleResult(_0x510298){return function(_0x66dc61){logger[_0x3b20('0x9')](_0x3b20('0x2f'),JSON['stringify'](_0x66dc61));if(_0x510298[_0x3b20('0xd')]&&_0x510298['MailAccount'][_0x3b20('0xe')]&&!_[_0x3b20('0x30')](_0x510298['email'])){setTimeout(handleSendEmail(_0x510298,_0x66dc61),0x3c*0x3e8);}};}function handleJob(_0x19ee9f){return function(){try{if(_[_0x3b20('0x30')](_0x19ee9f[_0x3b20('0x1a')])){return logger[_0x3b20('0x9')](_0x3b20('0x31'));}if(_[_0x3b20('0x30')](_0x19ee9f[_0x3b20('0x1b')])){return logger[_0x3b20('0x9')](_0x3b20('0x32'));}var _0x486af0={'startDate':moment()['subtract'](_0x19ee9f[_0x3b20('0x1a')],_0x19ee9f[_0x3b20('0x1b')])[_0x3b20('0x14')](_0x3b20('0x33')),'endDate':moment()['format'](_0x3b20('0x33')),'type':_0x3b20('0x34'),'output':_0x19ee9f[_0x3b20('0x35')],'name':_0x19ee9f['name']};if(!_['isNil'](_0x19ee9f[_0x3b20('0x36')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x19ee9f[_0x3b20('0x36')]);return analyticDefaultReportController[_0x3b20('0x37')]({'id':_0x19ee9f[_0x3b20('0x36')]},_0x486af0)[_0x3b20('0x38')](handleResult(_0x19ee9f))['catch'](handleError());}if(!_[_0x3b20('0x30')](_0x19ee9f['CustomReportId'])){logger[_0x3b20('0x9')]('exec\x20custom\x20report\x20id:%s',_0x19ee9f['CustomReportId']);return analyticCustomReportController[_0x3b20('0x37')]({'id':_0x19ee9f[_0x3b20('0x39')]},_0x486af0)[_0x3b20('0x38')](handleResult(_0x19ee9f))[_0x3b20('0x2e')](handleError());}}catch(_0x4980d3){logger['error'](JSON[_0x3b20('0x2d')](_0x4980d3));}return logger[_0x3b20('0x9')](_0x3b20('0x3a'));};}function getJobs(_0x4735d9){var _0x4bada2={};if(_0x4735d9){_0x4bada2['id']=_0x4735d9;}return db[_0x3b20('0x3b')][_0x3b20('0x3c')]({'where':_0x4bada2,'include':[{'model':db['MailAccount'],'attributes':['id',_0x3b20('0x16'),_0x3b20('0xb')],'include':[{'model':db['MailServerOut'],'as':_0x3b20('0xe')}]}]})[_0x3b20('0x38')](function(_0x2ba640){var _0x18b572=_[_0x3b20('0x3d')](manager[_0x3b20('0x3e')]);var _0x259522=_[_0x3b20('0x3f')](_0x2ba640,function(_0x4aca08){return _0x4aca08['id']['toString']();});var _0x4f05b8=_['keyBy'](_0x2ba640,function(_0x20d661){return _0x20d661['id'][_0x3b20('0x40')]();});var _0x1fa6c9=_0x4735d9?_0x259522:_[_0x3b20('0x41')](_0x259522,_0x18b572);var _0x36a153=_[_0x3b20('0x42')](_0x259522,_0x18b572);var _0x44e427=_[_0x3b20('0x41')](_0x18b572,_0x259522);var _0x2a1793;var _0x577adb;for(_0x2a1793=0x0;_0x2a1793<_0x44e427[_0x3b20('0x43')]&&!_0x4735d9;_0x2a1793+=0x1){_0x577adb=_0x44e427[_0x2a1793][_0x3b20('0x40')]();if(manager[_0x3b20('0x44')](_0x577adb)){manager[_0x3b20('0x45')](_0x577adb);manager[_0x3b20('0x46')](_0x577adb);logger[_0x3b20('0x9')](_0x3b20('0x47'),_0x577adb);}}logger[_0x3b20('0x9')](_0x3b20('0x48'),JSON['stringify'](_0x1fa6c9));for(_0x2a1793=0x0;_0x2a1793<_0x1fa6c9[_0x3b20('0x43')];_0x2a1793+=0x1){_0x577adb=_0x1fa6c9[_0x2a1793][_0x3b20('0x40')]();logger[_0x3b20('0x9')](_0x3b20('0x49'),_0x577adb);if(_0x4735d9){logger[_0x3b20('0x9')](_0x3b20('0x4a'),_0x4735d9);logger['info'](JSON[_0x3b20('0x2d')](_0x4f05b8[_0x577adb]));BPromise[_0x3b20('0x4b')]()[_0x3b20('0x38')](handleJob(_0x4f05b8[_0x577adb]));logger['info'](_0x3b20('0x4c'),_0x4f05b8[_0x577adb][_0x3b20('0x16')],_0x4f05b8[_0x577adb][_0x3b20('0x4d')]);}else if(_0x4f05b8[_0x577adb][_0x3b20('0x4d')]&&_0x4f05b8[_0x577adb][_0x3b20('0x4e')]&&moment()[_0x3b20('0x4f')](_0x4f05b8[_0x577adb]['startAt'],_0x4f05b8[_0x577adb][_0x3b20('0x50')])){manager['add'](_0x577adb,_0x4f05b8[_0x577adb]['cron'],handleJob(_0x4f05b8[_0x577adb]));manager[_0x3b20('0x51')](_0x577adb);logger['info']('add\x20cron',_0x4f05b8[_0x577adb][_0x3b20('0x16')],_0x4f05b8[_0x577adb]['cron']);}else if(manager[_0x3b20('0x44')](_0x577adb)){manager[_0x3b20('0x45')](_0x577adb);manager['deleteJob'](_0x577adb);logger[_0x3b20('0x9')]('stop\x20cron',_0x4f05b8[_0x577adb][_0x3b20('0x16')],_0x4f05b8[_0x577adb]['cron']);}}for(_0x2a1793=0x0,_0x577adb;_0x2a1793<_0x36a153[_0x3b20('0x43')]&&!_0x4735d9;_0x2a1793+=0x1){_0x577adb=_0x36a153[_0x2a1793][_0x3b20('0x40')]();if(manager[_0x3b20('0x44')](_0x577adb)){if(_0x4f05b8[_0x577adb][_0x3b20('0x4d')]&&_0x4f05b8[_0x577adb][_0x3b20('0x4e')]&&moment()[_0x3b20('0x4f')](_0x4f05b8[_0x577adb]['startAt'],_0x4f05b8[_0x577adb][_0x3b20('0x50')])){manager['update'](_0x577adb,_0x4f05b8[_0x577adb][_0x3b20('0x4d')],handleJob(_0x4f05b8[_0x577adb]));logger['info'](_0x3b20('0x52'),_0x4f05b8[_0x577adb][_0x3b20('0x16')],_0x4f05b8[_0x577adb]['cron']);}else{manager[_0x3b20('0x45')](_0x577adb);manager[_0x3b20('0x46')](_0x577adb);logger[_0x3b20('0x9')]('stop\x20cron',_0x4f05b8[_0x577adb][_0x3b20('0x16')],_0x4f05b8[_0x577adb]['cron']);}}}})['catch'](function(_0x5a70d8){logger['error'](JSON['stringify'](_0x5a70d8));});}exports['run']=function(_0xfc12cd){return getJobs(_0xfc12cd);};exports[_0x3b20('0x51')]=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 9783ac9..616a1bb 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 _0x63ef=['getTranscriptionJob','Comprehend','detectSentiment','info','format','transcribeName','data2','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','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','resolve','bucket','CloudProvider','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','catch','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','TranscribeService'];(function(_0x1dd164,_0x41cde1){var _0x429553=function(_0x4bc985){while(--_0x4bc985){_0x1dd164['push'](_0x1dd164['shift']());}};_0x429553(++_0x41cde1);}(_0x63ef,0x11a));var _0xf63e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x63ef[_0x387777];return _0x3f84c0;};var _=require(_0xf63e('0x0'));var AWS=require(_0xf63e('0x1'));var rp=require(_0xf63e('0x2'));var util=require('util');var BPromise=require(_0xf63e('0x3'));var db=require(_0xf63e('0x4'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x46fba1,_0x25a189,_0x5a53a8,_0x2ee15e){return new Promise(function(_0x367f73,_0x519a33){var _0x45ad8d=new AWS[(_0xf63e('0x5'))]({'accessKeyId':_0x25a189,'secretAccessKey':_0x46fba1,'region':_0x5a53a8});_0x45ad8d[_0xf63e('0x6')]({'TranscriptionJobName':_0x2ee15e},function(_0x15d430,_0x31d785){if(_0x15d430){return _0x519a33(_0x15d430);}else{return _0x367f73(_0x31d785);}});});}function sentiment(_0x239b0e,_0x3a2185,_0x2cc2de,_0x29f321,_0xe8f9f9){return new Promise(function(_0x237479,_0x450c6c){var _0x2dac2d=new AWS[(_0xf63e('0x7'))]({'accessKeyId':_0x3a2185,'secretAccessKey':_0x239b0e,'region':_0x2cc2de});_0x2dac2d[_0xf63e('0x8')]({'Text':_0x29f321,'LanguageCode':_0xe8f9f9['substring'](0x0,0x2)},function(_0x448d1b,_0x3be454){if(_0x448d1b){return _0x450c6c(_0x448d1b);}else{return _0x237479(_0x3be454);}});});}function checkTranscribeJob(_0x1295c2,_0x296e43,_0x415c50){var _0x1c2fe9;return new BPromise(function(_0x536a8c,_0x32a98b){logger[_0xf63e('0x9')](util[_0xf63e('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1295c2['id'],_0x1295c2[_0xf63e('0xb')]));return getTranscriptionJob(_0x415c50['data1'],_0x415c50[_0xf63e('0xc')],_0x296e43['transcribeRegion'],_0x1295c2[_0xf63e('0xb')])[_0xf63e('0xd')](function(_0x13f9db){logger['info'](util[_0xf63e('0xa')](_0xf63e('0xe'),_0x1295c2['id'],_0x1295c2['transcribeName'],_0x13f9db[_0xf63e('0xf')][_0xf63e('0x10')]));if(!_0x1295c2[_0xf63e('0x11')]){switch(_0x13f9db['TranscriptionJob'][_0xf63e('0x10')]){case _0xf63e('0x12'):var _0x2a1726={'transcribeStatus':_0x13f9db[_0xf63e('0xf')][_0xf63e('0x10')],'fileUri':_0x13f9db[_0xf63e('0xf')][_0xf63e('0x13')][_0xf63e('0x14')]};logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x15'),_0x1295c2['id']));return rp({'uri':_0x13f9db['TranscriptionJob'][_0xf63e('0x13')][_0xf63e('0x14')],'json':!![]})[_0xf63e('0xd')](function(_0x2cfb37){logger['info'](util[_0xf63e('0xa')](_0xf63e('0x16'),_0x1295c2['id']));if(_0x2cfb37&&_0x2cfb37[_0xf63e('0x17')]&&_0x2cfb37[_0xf63e('0x17')][_0xf63e('0x18')]&&_0x2cfb37['results'][_0xf63e('0x18')]['length']){_0x2a1726['fileText']='';for(var _0x40952c=0x0;_0x40952c<_0x2cfb37['results']['transcripts'][_0xf63e('0x19')];_0x40952c++){_0x2a1726['fileText']+=_0x2cfb37[_0xf63e('0x17')][_0xf63e('0x18')][_0x40952c]['transcript']+'';}}return _0x1295c2[_0xf63e('0x1a')](_0x2a1726);})[_0xf63e('0xd')](function(){logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x1b'),_0x1295c2['id']));if(!_0x1295c2[_0xf63e('0x1c')]){throw new db[(_0xf63e('0x1d'))]['ValidationError'](_0xf63e('0x1e'));}if(!_0x296e43[_0xf63e('0x1f')]||!_0x296e43[_0xf63e('0x20')]||!_0x296e43[_0xf63e('0x21')]||!_0x296e43[_0xf63e('0x22')]||!_0x296e43['bucket']){throw new db['Sequelize'][(_0xf63e('0x23'))](_0xf63e('0x24'));}if(!_0x2a1726[_0xf63e('0x11')]){throw new Error(_0xf63e('0x25'));}if(_0x296e43[_0xf63e('0x20')]===_0x415c50['id']){return _0x415c50;}else{return db['CloudProvider'][_0xf63e('0x26')]({'where':{'id':_settings[_0xf63e('0x20')]}});}})['then'](function(_0x3c666a){if(!_0x3c666a){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x27'));}if(!_0x3c666a[_0xf63e('0x28')]||!_0x3c666a[_0xf63e('0xc')]){throw new db['Sequelize']['ValidationError'](_0xf63e('0x29'));}_0x1c2fe9=_0x3c666a;logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x2a'),_0x1295c2['id']));return sentiment(_0x1c2fe9[_0xf63e('0x28')],_0x1c2fe9['data2'],_0x296e43['sentimentRegion'],_0x2a1726[_0xf63e('0x11')],_0x296e43[_0xf63e('0x22')]);})[_0xf63e('0xd')](function(_0x582272){logger['info'](util[_0xf63e('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1295c2['id']));return _0x1295c2[_0xf63e('0x1a')]({'sentiment':_0x582272[_0xf63e('0x2b')],'sPositive':_0x582272[_0xf63e('0x2c')][_0xf63e('0x2d')],'sNegative':_0x582272['SentimentScore'][_0xf63e('0x2e')],'sMixed':_0x582272['SentimentScore'][_0xf63e('0x2f')],'sNeutral':_0x582272[_0xf63e('0x2c')][_0xf63e('0x30')]});})['then'](function(){logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x1b'),_0x1295c2['id']));_0x536a8c();});case _0xf63e('0x31'):return _0x1295c2['update']({'transcribeStatus':_0xf63e('0x31'),'failureReason':_0x13f9db['TranscriptionJob']['FailureReason']})[_0xf63e('0xd')](function(){logger['info'](util[_0xf63e('0xa')](_0xf63e('0x1b'),_0x1295c2['id']));_0x536a8c();});default:logger['info'](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1295c2['id']));break;}}else{return BPromise[_0xf63e('0x32')]()[_0xf63e('0xd')](function(){if(!_0x1295c2[_0xf63e('0x1c')]){throw new db[(_0xf63e('0x1d'))]['ValidationError'](_0xf63e('0x1e'));}if(!_0x296e43[_0xf63e('0x1f')]||!_0x296e43[_0xf63e('0x20')]||!_0x296e43[_0xf63e('0x21')]||!_0x296e43[_0xf63e('0x22')]||!_0x296e43[_0xf63e('0x33')]){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1295c2[_0xf63e('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x296e43[_0xf63e('0x20')]===_0x415c50['id']){return _0x415c50;}else{return db[_0xf63e('0x34')]['findOne']({'where':{'id':_settings[_0xf63e('0x20')]}});}})['then'](function(_0x3baa79){if(!_0x3baa79){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x27'));}if(!_0x3baa79[_0xf63e('0x28')]||!_0x3baa79[_0xf63e('0xc')]){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x29'));}_0x1c2fe9=_0x3baa79;logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x2a'),_0x1295c2['id']));return sentiment(_0x1c2fe9[_0xf63e('0x28')],_0x1c2fe9[_0xf63e('0xc')],_0x296e43[_0xf63e('0x21')],_0x1295c2[_0xf63e('0x11')],_0x296e43[_0xf63e('0x22')]);})['then'](function(_0x59283b){logger[_0xf63e('0x9')](util['format'](_0xf63e('0x35'),_0x1295c2['id']));return _0x1295c2[_0xf63e('0x1a')]({'sentiment':_0x59283b[_0xf63e('0x2b')],'sPositive':_0x59283b[_0xf63e('0x2c')][_0xf63e('0x2d')],'sNegative':_0x59283b[_0xf63e('0x2c')][_0xf63e('0x2e')],'sMixed':_0x59283b[_0xf63e('0x2c')]['Mixed'],'sNeutral':_0x59283b[_0xf63e('0x2c')][_0xf63e('0x30')],'transcribeStatus':_0xf63e('0x12')});})[_0xf63e('0xd')](function(){logger[_0xf63e('0x9')](util[_0xf63e('0xa')](_0xf63e('0x1b'),_0x1295c2['id']));_0x536a8c();});}})['catch'](function(_0x31c400){if(_0x31c400){if(!_0x31c400[_0xf63e('0x36')]||_0x31c400[_0xf63e('0x36')]!==_0xf63e('0x37')){logger[_0xf63e('0x38')](util[_0xf63e('0xa')](_0xf63e('0x39'),_0x1295c2['id']),util[_0xf63e('0x3a')](_0x31c400,{'showHidden':![],'depth':null}));}}_0x536a8c();});});}function checkTranscribe(){var _0x14ce18;var _0x3bbd5e;var _0x28c916;return db['VoiceRecording'][_0xf63e('0x3b')]({'where':{'transcribeStatus':_0xf63e('0x3c')}})[_0xf63e('0xd')](function(_0x37d868){if(!_0x37d868||!_0x37d868[_0xf63e('0x19')]){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x3d'));}_0x14ce18=_0x37d868;return db[_0xf63e('0x3e')][_0xf63e('0x26')]({'where':{'id':0x1}});})[_0xf63e('0xd')](function(_0x8c6d5){if(!_0x8c6d5){throw new db[(_0xf63e('0x1d'))]['ValidationError']('Settings\x20not\x20available');}_0x3bbd5e=_0x8c6d5;if(!_0x3bbd5e[_0xf63e('0x3f')]||!_0x3bbd5e[_0xf63e('0x40')]||!_0x3bbd5e[_0xf63e('0x41')]||!_0x3bbd5e[_0xf63e('0x22')]||!_0x3bbd5e[_0xf63e('0x33')]){throw new db[(_0xf63e('0x1d'))][(_0xf63e('0x23'))](_0xf63e('0x42'));}return db[_0xf63e('0x34')][_0xf63e('0x26')]({'where':{'id':_0x3bbd5e[_0xf63e('0x40')]}});})[_0xf63e('0xd')](function(_0x56dcea){if(!_0x56dcea){throw new db['Sequelize']['ValidationError'](_0xf63e('0x27'));}if(!_0x56dcea[_0xf63e('0x28')]||!_0x56dcea[_0xf63e('0xc')]){throw new db['Sequelize']['ValidationError'](_0xf63e('0x29'));}_0x28c916=_0x56dcea;var _0x141630=[];_0x14ce18[_0xf63e('0x43')](function(_0x4e496b){_0x141630[_0xf63e('0x44')](checkTranscribeJob(_0x4e496b,_0x3bbd5e,_0x28c916));});return BPromise[_0xf63e('0x45')](_0x141630);})[_0xf63e('0x46')](function(_0xce3fb6){if(_0xce3fb6){if(!_0xce3fb6[_0xf63e('0x36')]||_0xce3fb6[_0xf63e('0x36')]!=='SequelizeValidationError'){logger[_0xf63e('0x38')](util['inspect'](_0xce3fb6,{'showHidden':![],'depth':null}));}}});}exports[_0xf63e('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x7cda=['TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','then','transcripts','length','results','tempSentiment','Sequelize','sentimentAccountId','language','bucket','ValidationError','CloudProvider','Cloud\x20Provider\x20not\x20available','sentimentRegion','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','COMPLETED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','inspect','start','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','getTranscriptionJob','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var AWS=require(_0xa7cd('0x0'));var rp=require(_0xa7cd('0x1'));var util=require(_0xa7cd('0x2'));var BPromise=require('bluebird');var db=require(_0xa7cd('0x3'))['db'];var logger=require(_0xa7cd('0x4'))('transcribe');function getTranscriptionJob(_0x232be5,_0xdb8470,_0x5560e0,_0x37990d){return new Promise(function(_0x5f20a2,_0x3d43e6){var _0x5c2b39=new AWS['TranscribeService']({'accessKeyId':_0xdb8470,'secretAccessKey':_0x232be5,'region':_0x5560e0});_0x5c2b39[_0xa7cd('0x5')]({'TranscriptionJobName':_0x37990d},function(_0x4a9e39,_0x2554e8){if(_0x4a9e39){return _0x3d43e6(_0x4a9e39);}else{return _0x5f20a2(_0x2554e8);}});});}function sentiment(_0x205075,_0x108be3,_0x6d21d3,_0x31879f,_0x372273){return new Promise(function(_0x39d8c4,_0x1a66f7){var _0xd20e5d=new AWS['Comprehend']({'accessKeyId':_0x108be3,'secretAccessKey':_0x205075,'region':_0x6d21d3});_0xd20e5d['detectSentiment']({'Text':_0x31879f,'LanguageCode':_0x372273[_0xa7cd('0x6')](0x0,0x2)},function(_0xf902eb,_0x53cf92){if(_0xf902eb){return _0x1a66f7(_0xf902eb);}else{return _0x39d8c4(_0x53cf92);}});});}function checkTranscribeJob(_0xc60cec,_0x4056ee,_0x57fb93){var _0x3bbf3b;return new BPromise(function(_0x3f72f8,_0x136aae){logger['info'](util[_0xa7cd('0x7')](_0xa7cd('0x8'),_0xc60cec['id'],_0xc60cec[_0xa7cd('0x9')]));return getTranscriptionJob(_0x57fb93[_0xa7cd('0xa')],_0x57fb93[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0xc')],_0xc60cec['transcribeName'])['then'](function(_0x44d991){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0xc60cec['id'],_0xc60cec[_0xa7cd('0x9')],_0x44d991[_0xa7cd('0xe')]['TranscriptionJobStatus']));if(!_0xc60cec[_0xa7cd('0xf')]){switch(_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x10')]){case'COMPLETED':var _0x111774={'transcribeStatus':_0x44d991[_0xa7cd('0xe')]['TranscriptionJobStatus'],'fileUri':_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x11')][_0xa7cd('0x12')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0xc60cec['id']));return rp({'uri':_0x44d991[_0xa7cd('0xe')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0xa7cd('0x13')](function(_0x4dc29b){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xc60cec['id']));if(_0x4dc29b&&_0x4dc29b['results']&&_0x4dc29b['results'][_0xa7cd('0x14')]&&_0x4dc29b['results'][_0xa7cd('0x14')][_0xa7cd('0x15')]){_0x111774['fileText']='';for(var _0x39f093=0x0;_0x39f093<_0x4dc29b['results'][_0xa7cd('0x14')][_0xa7cd('0x15')];_0x39f093++){_0x111774['fileText']+=_0x4dc29b[_0xa7cd('0x16')][_0xa7cd('0x14')][_0x39f093]['transcript']+'';}}return _0xc60cec['update'](_0x111774);})[_0xa7cd('0x13')](function(){logger['info'](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));if(!_0xc60cec[_0xa7cd('0x17')]){throw new db[(_0xa7cd('0x18'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4056ee['sentiment']||!_0x4056ee[_0xa7cd('0x19')]||!_0x4056ee['sentimentRegion']||!_0x4056ee[_0xa7cd('0x1a')]||!_0x4056ee[_0xa7cd('0x1b')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x111774[_0xa7cd('0xf')]){throw new Error('Transcript\x20not\x20available');}if(_0x4056ee[_0xa7cd('0x19')]===_0x57fb93['id']){return _0x57fb93;}else{return db[_0xa7cd('0x1d')]['findOne']({'where':{'id':_settings[_0xa7cd('0x19')]}});}})[_0xa7cd('0x13')](function(_0xb4cfa){if(!_0xb4cfa){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0xb4cfa[_0xa7cd('0xa')]||!_0xb4cfa[_0xa7cd('0xb')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Cloud\x20Provider\x20not\x20configured');}_0x3bbf3b=_0xb4cfa;logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xc60cec['id']));return sentiment(_0x3bbf3b['data1'],_0x3bbf3b[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0x1f')],_0x111774['fileText'],_0x4056ee[_0xa7cd('0x1a')]);})[_0xa7cd('0x13')](function(_0x29c3d2){logger['info'](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xc60cec['id']));return _0xc60cec[_0xa7cd('0x20')]({'sentiment':_0x29c3d2[_0xa7cd('0x21')],'sPositive':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x23')],'sNegative':_0x29c3d2['SentimentScore']['Negative'],'sMixed':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x24')],'sNeutral':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x25')]});})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));_0x3f72f8();});case _0xa7cd('0x26'):return _0xc60cec[_0xa7cd('0x20')]({'transcribeStatus':_0xa7cd('0x26'),'failureReason':_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x27')]})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));_0x3f72f8();});default:logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x28'),_0xc60cec['id']));break;}}else{return BPromise[_0xa7cd('0x29')]()[_0xa7cd('0x13')](function(){if(!_0xc60cec[_0xa7cd('0x17')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4056ee['sentiment']||!_0x4056ee[_0xa7cd('0x19')]||!_0x4056ee[_0xa7cd('0x1f')]||!_0x4056ee[_0xa7cd('0x1a')]||!_0x4056ee['bucket']){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x2a'));}if(!_0xc60cec[_0xa7cd('0xf')]){throw new Error('Transcript\x20not\x20available');}if(_0x4056ee[_0xa7cd('0x19')]===_0x57fb93['id']){return _0x57fb93;}else{return db[_0xa7cd('0x1d')][_0xa7cd('0x2b')]({'where':{'id':_settings[_0xa7cd('0x19')]}});}})['then'](function(_0x5d2b48){if(!_0x5d2b48){throw new db['Sequelize'][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0x5d2b48[_0xa7cd('0xa')]||!_0x5d2b48['data2']){throw new db['Sequelize'][(_0xa7cd('0x1c'))](_0xa7cd('0x2c'));}_0x3bbf3b=_0x5d2b48;logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x2d'),_0xc60cec['id']));return sentiment(_0x3bbf3b[_0xa7cd('0xa')],_0x3bbf3b[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0x1f')],_0xc60cec[_0xa7cd('0xf')],_0x4056ee[_0xa7cd('0x1a')]);})[_0xa7cd('0x13')](function(_0x31577f){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x2e'),_0xc60cec['id']));return _0xc60cec[_0xa7cd('0x20')]({'sentiment':_0x31577f['Sentiment'],'sPositive':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x23')],'sNegative':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x2f')],'sMixed':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x24')],'sNeutral':_0x31577f[_0xa7cd('0x22')]['Neutral'],'transcribeStatus':_0xa7cd('0x30')});})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util['format'](_0xa7cd('0x31'),_0xc60cec['id']));_0x3f72f8();});}})[_0xa7cd('0x32')](function(_0x6ee082){if(_0x6ee082){if(!_0x6ee082[_0xa7cd('0x33')]||_0x6ee082[_0xa7cd('0x33')]!==_0xa7cd('0x34')){logger[_0xa7cd('0x35')](util[_0xa7cd('0x7')](_0xa7cd('0x36'),_0xc60cec['id']),util['inspect'](_0x6ee082,{'showHidden':![],'depth':null}));}}_0x3f72f8();});});}function checkTranscribe(){var _0x5d1d6d;var _0x54299b;var _0x35e023;return db[_0xa7cd('0x37')][_0xa7cd('0x38')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xa7cd('0x13')](function(_0x2104fe){if(!_0x2104fe||!_0x2104fe['length']){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x5d1d6d=_0x2104fe;return db[_0xa7cd('0x39')][_0xa7cd('0x2b')]({'where':{'id':0x1}});})[_0xa7cd('0x13')](function(_0x11f0d0){if(!_0x11f0d0){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x3a'));}_0x54299b=_0x11f0d0;if(!_0x54299b['transcribe']||!_0x54299b[_0xa7cd('0x3b')]||!_0x54299b['transcribeRegion']||!_0x54299b[_0xa7cd('0x1a')]||!_0x54299b[_0xa7cd('0x1b')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x3c'));}return db[_0xa7cd('0x1d')][_0xa7cd('0x2b')]({'where':{'id':_0x54299b['transcribeAccountId']}});})[_0xa7cd('0x13')](function(_0x51c67f){if(!_0x51c67f){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0x51c67f[_0xa7cd('0xa')]||!_0x51c67f[_0xa7cd('0xb')]){throw new db['Sequelize']['ValidationError'](_0xa7cd('0x2c'));}_0x35e023=_0x51c67f;var _0x46b48a=[];_0x5d1d6d[_0xa7cd('0x3d')](function(_0x2101ea){_0x46b48a['push'](checkTranscribeJob(_0x2101ea,_0x54299b,_0x35e023));});return BPromise[_0xa7cd('0x3e')](_0x46b48a);})[_0xa7cd('0x32')](function(_0x2dd1a2){if(_0x2dd1a2){if(!_0x2dd1a2[_0xa7cd('0x33')]||_0x2dd1a2['name']!=='SequelizeValidationError'){logger['error'](util[_0xa7cd('0x3f')](_0x2dd1a2,{'showHidden':![],'depth':null}));}}});}exports[_0xa7cd('0x40')]=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 81ae126..4721400 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 _0xe666=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','inspect','lodash','util','../../mysqldb','schedule','defaults','redis','localhost','socket.io-emitter','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update'];(function(_0x58b762,_0xf590ba){var _0x2dd236=function(_0x3b6d37){while(--_0x3b6d37){_0x58b762['push'](_0x58b762['shift']());}};_0x2dd236(++_0xf590ba);}(_0xe666,0x189));var _0x6e66=function(_0x1a30c7,_0x5d5441){_0x1a30c7=_0x1a30c7-0x0;var _0x3be1e6=_0xe666[_0x1a30c7];return _0x3be1e6;};'use strict';var _=require(_0x6e66('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x6e66('0x1'));var config=require('../../config/environment');var db=require(_0x6e66('0x2'))['db'];var logger=require('../logger')(_0x6e66('0x3'));config['redis']=_[_0x6e66('0x4')](config[_0x6e66('0x5')],{'host':_0x6e66('0x6'),'port':0x18eb});var io=require(_0x6e66('0x7'))(new Redis(config[_0x6e66('0x5')]));function closeInteractions(){var _0x4db3ea=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x6e66('0x8'))}}})[_0x6e66('0x9')](function(_0x3e409e){if(_0x3e409e&&_0x3e409e[_0x6e66('0xa')]){_0x4db3ea=_[_0x6e66('0xb')](_0x3e409e||[],'id');logger['info'](_0x6e66('0xc'),_0x4db3ea[_0x6e66('0xd')]());return db['WhatsappInteraction'][_0x6e66('0xe')]({'closeReason':'system','disposition':_0x6e66('0xf'),'closed':!![],'closedAt':moment()[_0x6e66('0x10')](_0x6e66('0x11'))},{'where':{'id':_0x4db3ea}});}})[_0x6e66('0x9')](function(){if(_0x4db3ea&&_0x4db3ea['length']){logger[_0x6e66('0x12')](_0x6e66('0x13'),_0x4db3ea[_0x6e66('0xd')]());for(var _0x344a11=0x0;_0x344a11<_0x4db3ea['length'];_0x344a11++){io['emit'](_0x6e66('0x14'),{'id':_0x4db3ea[_0x344a11],'closed':!![]});}}})[_0x6e66('0x15')](function(_0x146115){logger[_0x6e66('0x16')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x146115?util[_0x6e66('0x17')](_0x146115,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8591=['../../mysqldb','schedule','redis','defaults','localhost','WhatsappInteraction','findAll','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','error','lodash','moment','ioredis','util','../../config/environment'];(function(_0xc09b83,_0x4a8f7c){var _0x986879=function(_0x55f96f){while(--_0x55f96f){_0xc09b83['push'](_0xc09b83['shift']());}};_0x986879(++_0x4a8f7c);}(_0x8591,0xd3));var _0x1859=function(_0x1f4585,_0x2b37e3){_0x1f4585=_0x1f4585-0x0;var _0x494875=_0x8591[_0x1f4585];return _0x494875;};'use strict';var _=require(_0x1859('0x0'));var moment=require(_0x1859('0x1'));var Redis=require(_0x1859('0x2'));var util=require(_0x1859('0x3'));var config=require(_0x1859('0x4'));var db=require(_0x1859('0x5'))['db'];var logger=require('../logger')(_0x1859('0x6'));config[_0x1859('0x7')]=_[_0x1859('0x8')](config[_0x1859('0x7')],{'host':_0x1859('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x3efcdd=[];return db[_0x1859('0xa')][_0x1859('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1859('0xc')](0x18,'hours')}}})[_0x1859('0xd')](function(_0x23e596){if(_0x23e596&&_0x23e596[_0x1859('0xe')]){_0x3efcdd=_[_0x1859('0xf')](_0x23e596||[],'id');logger[_0x1859('0x10')](_0x1859('0x11'),_0x3efcdd['join']());return db[_0x1859('0xa')]['update']({'closeReason':_0x1859('0x12'),'disposition':_0x1859('0x13'),'closed':!![],'closedAt':moment()[_0x1859('0x14')](_0x1859('0x15'))},{'where':{'id':_0x3efcdd}});}})[_0x1859('0xd')](function(){if(_0x3efcdd&&_0x3efcdd[_0x1859('0xe')]){logger[_0x1859('0x10')](_0x1859('0x16'),_0x3efcdd[_0x1859('0x17')]());for(var _0x2e1eea=0x0;_0x2e1eea<_0x3efcdd['length'];_0x2e1eea++){io[_0x1859('0x18')](_0x1859('0x19'),{'id':_0x3efcdd[_0x2e1eea],'closed':!![]});}}})['catch'](function(_0x5956c7){logger[_0x1859('0x1a')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x5956c7?util['inspect'](_0x5956c7,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index e56a559..82be1eb 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c3a=['destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x161dc8,_0x6ffc9){var _0x39df8e=function(_0x46dd63){while(--_0x46dd63){_0x161dc8['push'](_0x161dc8['shift']());}};_0x39df8e(++_0x6ffc9);}(_0x9c3a,0x1c3));var _0xa9c3=function(_0x336209,_0x3058bf){_0x336209=_0x336209-0x0;var _0x51246e=_0x9c3a[_0x336209];return _0x51246e;};'use strict';var util=require(_0xa9c3('0x0'));var db=require(_0xa9c3('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa9c3('0x2')]({'id':i,'firstName':_0xa9c3('0x3')+i,'lastName':_0xa9c3('0x4')+i,'phone':0xf879fb460+i,'email':_0xa9c3('0x5')+i+_0xa9c3('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa9c3('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa9c3('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xa9c3('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa9c3('0x2')]({'id':i,'firstName':_0xa9c3('0x3')+i,'lastName':_0xa9c3('0x4')+i,'phone':0xf879fb460+i,'email':_0xa9c3('0x5')+i+_0xa9c3('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xa9c3('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa9c3('0x7')](),'updatedAt':Date['now']()});}db[_0xa9c3('0x8')][_0xa9c3('0x9')]({'where':{}})[_0xa9c3('0xa')](function(){return db['CmContact'][_0xa9c3('0xb')](contacts);})[_0xa9c3('0xa')](function(){console[_0xa9c3('0xc')](_0xa9c3('0xd'),_0xa9c3('0xe'));return db[_0xa9c3('0xf')][_0xa9c3('0x9')]({'where':{}});})[_0xa9c3('0xa')](function(){return db[_0xa9c3('0xf')]['bulkCreate'](hopper);})[_0xa9c3('0xa')](function(){console[_0xa9c3('0xc')](_0xa9c3('0xd'),_0xa9c3('0x10'));return db[_0xa9c3('0x8')]['bulkCreate'](contacts2);})[_0xa9c3('0xa')](function(){console[_0xa9c3('0xc')](_0xa9c3('0xd'),_0xa9c3('0x11'));return db[_0xa9c3('0xf')][_0xa9c3('0xb')](hopper2);})['then'](function(){console['log'](_0xa9c3('0xd'),_0xa9c3('0x12'));})[_0xa9c3('0x13')](function(_0x4b9801){console['log'](_0x4b9801);}); \ No newline at end of file +var _0xa5af=['then','log','contacts1','CmHopper','finished\x20populating','contacts2','hopper2','catch','util','../mysqldb','push','Biondo','now','Innocenzo','innocenzo.biondo','@xcally.com','CmContact','destroy','bulkCreate'];(function(_0x28f9b8,_0x3334af){var _0x269fcb=function(_0x5e8ad5){while(--_0x5e8ad5){_0x28f9b8['push'](_0x28f9b8['shift']());}};_0x269fcb(++_0x3334af);}(_0xa5af,0xb3));var _0xfa5a=function(_0x5877cd,_0x1af032){_0x5877cd=_0x5877cd-0x0;var _0x42628f=_0xa5af[_0x5877cd];return _0x42628f;};'use strict';var util=require(_0xfa5a('0x0'));var db=require(_0xfa5a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xfa5a('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xfa5a('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xfa5a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xfa5a('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xfa5a('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xfa5a('0x5')+i,'lastName':_0xfa5a('0x3')+i,'phone':0xf879fb460+i,'email':_0xfa5a('0x6')+i+_0xfa5a('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xfa5a('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xfa5a('0x4')](),'updatedAt':Date[_0xfa5a('0x4')]()});}db[_0xfa5a('0x8')][_0xfa5a('0x9')]({'where':{}})['then'](function(){return db['CmContact'][_0xfa5a('0xa')](contacts);})[_0xfa5a('0xb')](function(){console[_0xfa5a('0xc')]('finished\x20populating',_0xfa5a('0xd'));return db[_0xfa5a('0xe')][_0xfa5a('0x9')]({'where':{}});})[_0xfa5a('0xb')](function(){return db[_0xfa5a('0xe')][_0xfa5a('0xa')](hopper);})[_0xfa5a('0xb')](function(){console[_0xfa5a('0xc')](_0xfa5a('0xf'),'hopper1');return db['CmContact'][_0xfa5a('0xa')](contacts2);})[_0xfa5a('0xb')](function(){console['log'](_0xfa5a('0xf'),_0xfa5a('0x10'));return db[_0xfa5a('0xe')]['bulkCreate'](hopper2);})[_0xfa5a('0xb')](function(){console[_0xfa5a('0xc')](_0xfa5a('0xf'),_0xfa5a('0x11'));})[_0xfa5a('0x12')](function(_0x2d84cb){console[_0xfa5a('0xc')](_0x2d84cb);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 444eddb..3609ab7 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2f7=['udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password'];(function(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0xc2f7,0x128));var _0x7c2f=function(_0x188d52,_0x14d606){_0x188d52=_0x188d52-0x0;var _0x36c90b=_0xc2f7[_0x188d52];return _0x36c90b;};'use strict';var util=require(_0x7c2f('0x0'));var db=require(_0x7c2f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7c2f('0x2')]({'name':util[_0x7c2f('0x3')](_0x7c2f('0x4'),_0x7c2f('0x5'),i),'fullname':util['format'](_0x7c2f('0x4'),_0x7c2f('0x5'),i),'email':util['format'](_0x7c2f('0x6'),_0x7c2f('0x5'),i),'role':_0x7c2f('0x5'),'password':_0x7c2f('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x7c2f('0x8'),'ws','wss'],'disallow':[_0x7c2f('0x9')],'allow':[_0x7c2f('0xa')],'defaultuser':util[_0x7c2f('0x3')](_0x7c2f('0x4'),_0x7c2f('0x5'),i),'encryption':_0x7c2f('0xb'),'avpf':_0x7c2f('0xb'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x7c2f('0xb'),'dtlsverify':'no','dtlscertfile':_0x7c2f('0xc'),'dtlsprivatekey':_0x7c2f('0xd'),'dtlssetup':'actpass','callerid':util[_0x7c2f('0x3')](_0x7c2f('0xe'),util['format'](_0x7c2f('0x4'),_0x7c2f('0x5'),i),0xfa0+i)});}db[_0x7c2f('0xf')]['bulkCreate'](users)[_0x7c2f('0x10')](function(){console['log'](_0x7c2f('0x11'));})[_0x7c2f('0x12')](function(_0xc76394){console['log'](_0xc76394);}); \ No newline at end of file +var _0x6e86=['yes','\x22%s\x22\x20<%s>','bulkCreate','then','catch','log','util','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','ulaw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e86,0xba));var _0x66e8=function(_0x3bf957,_0x168c65){_0x3bf957=_0x3bf957-0x0;var _0x551cc=_0x6e86[_0x3bf957];return _0x551cc;};'use strict';var util=require(_0x66e8('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x66e8('0x1')]({'name':util[_0x66e8('0x2')](_0x66e8('0x3'),_0x66e8('0x4'),i),'fullname':util[_0x66e8('0x2')](_0x66e8('0x3'),'agent',i),'email':util[_0x66e8('0x2')](_0x66e8('0x5'),_0x66e8('0x4'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x66e8('0x6'),'transport':[_0x66e8('0x7'),'ws','wss'],'disallow':['all'],'allow':[_0x66e8('0x8')],'defaultuser':util[_0x66e8('0x2')]('%s%s','agent',i),'encryption':_0x66e8('0x9'),'avpf':_0x66e8('0x9'),'force_avp':_0x66e8('0x9'),'icesupport':_0x66e8('0x9'),'dtlsenable':_0x66e8('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x66e8('0x2')](_0x66e8('0xa'),util['format']('%s%s','agent',i),0xfa0+i)});}db['User'][_0x66e8('0xb')](users)[_0x66e8('0xc')](function(){console['log']('add\x20user');})[_0x66e8('0xd')](function(_0x3210a5){console[_0x66e8('0xe')](_0x3210a5);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 4a8eeb2..43f8151 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cf5=['ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','userProfileId','VoiceQueue','ChatQueues','FaxQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','trunk:%s','campaign:%s:%s','removeChatInteractions','leave','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','SmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','agent','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','role','Campaign','ivr','format','%s:queue:%s','length','user:%s','handshake','query','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push'];(function(_0x306c5b,_0x12989a){var _0x4dab8f=function(_0x1ab685){while(--_0x1ab685){_0x306c5b['push'](_0x306c5b['shift']());}};_0x4dab8f(++_0x12989a);}(_0x6cf5,0x1cf));var _0x56cf=function(_0x1f2c93,_0x5bfe8a){_0x1f2c93=_0x1f2c93-0x0;var _0x46542c=_0x6cf5[_0x1f2c93];return _0x46542c;};'use strict';var _=require(_0x56cf('0x0'));var util=require(_0x56cf('0x1'));var BPromise=require(_0x56cf('0x2'));var db=require(_0x56cf('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x56cf('0x4')],'include':[{'as':_0x56cf('0x5'),'model':db[_0x56cf('0x6')],'attributes':['id',_0x56cf('0x4'),'role'],'raw':!![],'where':{'role':_0x56cf('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x56cf('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x56cf('0x4')],'where':{'role':_0x56cf('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x56cf('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x51b676,_0x4b65ac,_0x4b78ce){return db[_0x56cf('0xa')][_0x56cf('0xb')]({'where':{'name':_0x51b676,'userProfileId':_0x4b65ac},'raw':!![]})[_0x56cf('0xc')](function(_0x61d258){if(_0x61d258){if(_0x61d258[_0x56cf('0xd')]){switch(_0x51b676){case _0x56cf('0xe'):case'ChatQueues':case _0x56cf('0xf'):case _0x56cf('0x10'):case _0x56cf('0x11'):case _0x56cf('0x12'):case _0x56cf('0x13'):return db[_0x4b78ce][_0x56cf('0x14')](queryQueues);case _0x56cf('0x15'):return db[_0x4b78ce]['findAll'](queryTelephones);case _0x56cf('0x16'):return db[_0x4b78ce][_0x56cf('0x14')](queryTrunks);case _0x56cf('0x17'):return db[_0x4b78ce][_0x56cf('0x14')](queryCampaigns);}}else{return db[_0x56cf('0x18')][_0x56cf('0x14')]({'attributes':['resourceId'],'where':{'sectionId':_0x61d258['id']},'raw':!![]})[_0x56cf('0xc')](function(_0x164e8d){if(_0x164e8d){var _0x1b4cb4={'where':{'id':_[_0x56cf('0x19')](_0x164e8d,_0x56cf('0x1a'))},'raw':!![]};switch(_0x4b78ce){case'User':_0x1b4cb4[_0x56cf('0x1b')][_0x56cf('0x1c')]=_0x56cf('0x8');break;case _0x56cf('0x1d'):_0x1b4cb4[_0x56cf('0x1b')][_0x56cf('0x9')]=_0x56cf('0x1e');break;}return db[_0x4b78ce][_0x56cf('0x14')](_0x1b4cb4);}else{return[];}});}}else{return[];}})[_0x56cf('0xc')](function(_0x55047d){return _0x55047d;});}function joinOrLeaveQueues(_0x45487f,_0x2736d1,_0x44b16a,_0x17b782){_0x45487f[_0x2736d1](util[_0x56cf('0x1f')](_0x56cf('0x20'),_0x44b16a,_0x17b782[_0x56cf('0x4')]));if(_0x17b782[_0x56cf('0x5')]){for(var _0x41a9e1=0x0;_0x41a9e1<_0x17b782[_0x56cf('0x5')][_0x56cf('0x21')];_0x41a9e1+=0x1){_0x45487f[_0x2736d1](util[_0x56cf('0x1f')](_0x56cf('0x22'),_0x17b782[_0x56cf('0x5')][_0x41a9e1][_0x56cf('0x4')]));}}}function joinOrLeave(_0x303926,_0x250e9f,_0x6bface){var _0xb54ba9;if(_0x303926[_0x56cf('0x23')][_0x56cf('0x24')]['id']){db[_0x56cf('0x6')]['find']({'attributes':['id',_0x56cf('0x4'),_0x56cf('0x1c'),'userProfileId'],'where':{'id':_0x303926['handshake'][_0x56cf('0x24')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x56cf('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x56cf('0x26')],'as':_0x56cf('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x56cf('0x28')],'as':_0x56cf('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x56cf('0x2a')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x56cf('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x56cf('0x2c')],'as':_0x56cf('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x56cf('0xc')](function(_0x321f1e){if(_0x321f1e){_0xb54ba9=_0x321f1e;_0x303926[_0x250e9f](util[_0x56cf('0x1f')](_0x56cf('0x22'),_0x321f1e[_0x56cf('0x4')]));var _0x1fd3c8=[];switch(_0x321f1e[_0x56cf('0x1c')]){case _0x56cf('0x2e'):_0x303926[_0x250e9f](_0x56cf('0x2f'));_0x303926[_0x250e9f](_0x56cf('0x30'));if(queryQueues[_0x56cf('0x31')](_0x56cf('0x32'))){delete queryQueues[_0x56cf('0x32')];}_0x1fd3c8[_0x56cf('0x33')](db['VoiceQueue'][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x34')][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db['FaxQueue'][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x35')][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x36')][_0x56cf('0x14')](queryQueues));_0x1fd3c8['push'](db[_0x56cf('0x37')][_0x56cf('0x14')](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x38')]['findAll'](queryQueues));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x6')][_0x56cf('0x14')](queryTelephones));_0x1fd3c8[_0x56cf('0x33')](db['Trunk'][_0x56cf('0x14')](queryTrunks));_0x1fd3c8[_0x56cf('0x33')](db['Campaign'][_0x56cf('0x14')](queryCampaigns));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x6')][_0x56cf('0x14')](queryAgents));break;case _0x56cf('0x39'):_0x303926[_0x250e9f](_0x56cf('0x2f'));_0x303926[_0x250e9f](_0x56cf('0x30'));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0xe'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x3b')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x3c'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x34')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0xf'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x3d')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x10'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x35')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources('MailQueues',_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x36')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x12'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x37')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x13'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x38')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x15'),_0x321f1e['userProfileId'],_0x56cf('0x6')));_0x1fd3c8['push'](getAssociatedResources(_0x56cf('0x16'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x3e')));_0x1fd3c8[_0x56cf('0x33')](getAssociatedResources(_0x56cf('0x17'),_0x321f1e[_0x56cf('0x3a')],_0x56cf('0x1d')));_0x1fd3c8[_0x56cf('0x33')](db[_0x56cf('0x6')]['findAll'](queryAgents));break;case'agent':_0x303926[_0x250e9f](_0x56cf('0x2f'));_0x303926[_0x250e9f]('voice:outbound');_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x3f')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x40')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8['push'](_0x321f1e[_0x56cf('0x41')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x42')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x43')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x44')]({'attributes':['id',_0x56cf('0x4')]}));_0x1fd3c8[_0x56cf('0x33')](_0x321f1e[_0x56cf('0x45')]({'attributes':['id',_0x56cf('0x4')]}));break;}return BPromise[_0x56cf('0x46')](_0x1fd3c8);}})[_0x56cf('0xc')](function(_0x480e4a){if(_0x480e4a&&_0x480e4a[_0x56cf('0x21')]){for(var _0x1b4b1e=0x0;_0x1b4b1e<_0x480e4a[_0x56cf('0x21')];_0x1b4b1e+=0x1){for(var _0x2e4da2=0x0;_0x2e4da2<_0x480e4a[_0x1b4b1e]['length'];_0x2e4da2+=0x1){switch(_0x1b4b1e){case 0x0:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x47'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x1:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x48'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x2:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x49'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x3:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x4a'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x4:joinOrLeaveQueues(_0x303926,_0x250e9f,'mail',_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x5:joinOrLeaveQueues(_0x303926,_0x250e9f,_0x56cf('0x4b'),_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x6:joinOrLeaveQueues(_0x303926,_0x250e9f,'whatsapp',_0x480e4a[_0x1b4b1e][_0x2e4da2]);break;case 0x7:if(_0xb54ba9[_0x56cf('0x1c')]!==_0x56cf('0x7'))_0x303926[_0x250e9f](util[_0x56cf('0x1f')]('telephone:%s',_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x4')]));break;case 0x8:if(_0xb54ba9[_0x56cf('0x1c')]!==_0x56cf('0x7'))_0x303926[_0x250e9f](util[_0x56cf('0x1f')](_0x56cf('0x4c'),_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x4')]));break;case 0x9:if(_0xb54ba9[_0x56cf('0x1c')]!=='agent')_0x303926[_0x250e9f](util['format'](_0x56cf('0x4d'),_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x9')],_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x4')]));break;case 0xa:_0x303926[_0x250e9f](util[_0x56cf('0x1f')](_0x56cf('0x22'),_0x480e4a[_0x1b4b1e][_0x2e4da2][_0x56cf('0x4')]));break;}}}}})['then'](function(){if(_0x250e9f==='leave'){var _0x577b8d=_['map'](_0xb54ba9[_0x56cf('0x25')],'id');return _0xb54ba9[_0x56cf('0x4e')](_0x577b8d)['then'](function(){for(var _0xa95589=0x0;_0xa95589<_0x577b8d[_0x56cf('0x21')];_0xa95589+=0x1){_0x6bface['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x577b8d[_0xa95589]),'UserId':Number(_0xb54ba9['id'])});}});}})[_0x56cf('0xc')](function(){if(_0x250e9f===_0x56cf('0x4f')){var _0x55d3e0=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x27')],'id');return _0xb54ba9[_0x56cf('0x50')](_0x55d3e0)['then'](function(){for(var _0x56fad3=0x0;_0x56fad3<_0x55d3e0[_0x56cf('0x21')];_0x56fad3+=0x1){_0x6bface[_0x56cf('0x51')](_0x56cf('0x52'),{'MailInteractionId':Number(_0x55d3e0[_0x56fad3]),'UserId':Number(_0xb54ba9['id'])});}});}})['then'](function(){if(_0x250e9f==='leave'){var _0x2072ef=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x29')],'id');return _0xb54ba9[_0x56cf('0x53')](_0x2072ef)[_0x56cf('0xc')](function(){for(var _0x389cb1=0x0;_0x389cb1<_0x2072ef[_0x56cf('0x21')];_0x389cb1+=0x1){_0x6bface['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2072ef[_0x389cb1]),'UserId':Number(_0xb54ba9['id'])});}});}})['then'](function(){if(_0x250e9f===_0x56cf('0x4f')){var _0x5d0048=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x54')],'id');return _0xb54ba9['removeSmsInteractions'](_0x5d0048)[_0x56cf('0xc')](function(){for(var _0x3e9a41=0x0;_0x3e9a41<_0x5d0048[_0x56cf('0x21')];_0x3e9a41+=0x1){_0x6bface[_0x56cf('0x51')](_0x56cf('0x55'),{'SmsInteractionId':Number(_0x5d0048[_0x3e9a41]),'UserId':Number(_0xb54ba9['id'])});}});}})[_0x56cf('0xc')](function(){if(_0x250e9f===_0x56cf('0x4f')){var _0x2d4553=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x2b')],'id');return _0xb54ba9[_0x56cf('0x56')](_0x2d4553)[_0x56cf('0xc')](function(){for(var _0x1da0d2=0x0;_0x1da0d2<_0x2d4553[_0x56cf('0x21')];_0x1da0d2+=0x1){_0x6bface['emit'](_0x56cf('0x57'),{'OpenchannelInteractionId':Number(_0x2d4553[_0x1da0d2]),'UserId':Number(_0xb54ba9['id'])});}});}})[_0x56cf('0xc')](function(){if(_0x250e9f==='leave'){var _0x34c5d3=_[_0x56cf('0x19')](_0xb54ba9[_0x56cf('0x2d')],'id');return _0xb54ba9[_0x56cf('0x58')](_0x34c5d3)[_0x56cf('0xc')](function(){for(var _0x2d6157=0x0;_0x2d6157<_0x34c5d3[_0x56cf('0x21')];_0x2d6157+=0x1){_0x6bface[_0x56cf('0x51')](_0x56cf('0x59'),{'WhatsappInteractionId':Number(_0x34c5d3[_0x2d6157]),'UserId':Number(_0xb54ba9['id'])});}});}})[_0x56cf('0x5a')](function(_0x3d9836){_0x303926[_0x56cf('0x5b')](_0x3d9836);});}}function onDisconnect(_0x5c328d,_0xce3144){joinOrLeave(_0x5c328d,_0x56cf('0x4f'),_0xce3144);}function onConnect(_0x2d5b12){joinOrLeave(_0x2d5b12,_0x56cf('0x5c'));}exports[_0x56cf('0x5d')]=function(_0x53e048){_0x53e048['on'](_0x56cf('0x5e'),function(_0x43ecaa){_0x43ecaa[_0x56cf('0x5f')](0x0);_0x43ecaa[_0x56cf('0x60')]=_0x43ecaa['request'][_0x56cf('0x5e')]['remoteAddress']+':'+_0x43ecaa[_0x56cf('0x61')][_0x56cf('0x5e')]['remotePort'];_0x43ecaa['connectedAt']=new Date();_0x43ecaa[_0x56cf('0x5b')]=function(_0x3993b5){console[_0x56cf('0x5b')](_0x56cf('0x62')+_0x43ecaa[_0x56cf('0x63')][_0x56cf('0x4')]+'['+_0x43ecaa[_0x56cf('0x60')]+']',_0x3993b5);};_0x43ecaa['on'](_0x56cf('0x64'),function(){onDisconnect(_0x43ecaa,_0x53e048);_0x43ecaa['log'](_0x56cf('0x65'));});onConnect(_0x43ecaa);_0x43ecaa[_0x56cf('0x5b')](_0x56cf('0x66'));});}; \ No newline at end of file +var _0x9147=['sms','openchannel','whatsapp','telephone:%s','trunk:%s','map','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','leave','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','User','where','Campaign','type','ivr','%s:queue:%s','format','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','voice:inbound','hasOwnProperty','include','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:outbound','VoiceQueues','VoiceQueue','FaxQueue','WhatsappQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9147,0x81));var _0x7914=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9147[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7914('0x0'));var util=require(_0x7914('0x1'));var BPromise=require(_0x7914('0x2'));var db=require(_0x7914('0x3'))['db'];var config=require(_0x7914('0x4'));var queryQueues={'attributes':['id',_0x7914('0x5')],'include':[{'as':_0x7914('0x6'),'model':db['User'],'attributes':['id',_0x7914('0x5'),_0x7914('0x7')],'raw':!![],'where':{'role':_0x7914('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7914('0x5')],'where':{'role':_0x7914('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x7914('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7914('0x5'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0xa22f08,_0x8ce32,_0x2d6ea3){return db['UserProfileSection'][_0x7914('0xa')]({'where':{'name':_0xa22f08,'userProfileId':_0x8ce32},'raw':!![]})[_0x7914('0xb')](function(_0x5e8bc5){if(_0x5e8bc5){if(_0x5e8bc5[_0x7914('0xc')]){switch(_0xa22f08){case'VoiceQueues':case _0x7914('0xd'):case _0x7914('0xe'):case _0x7914('0xf'):case _0x7914('0x10'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x2d6ea3][_0x7914('0x11')](queryQueues);case _0x7914('0x12'):return db[_0x2d6ea3]['findAll'](queryTelephones);case _0x7914('0x13'):return db[_0x2d6ea3][_0x7914('0x11')](queryTrunks);case _0x7914('0x14'):return db[_0x2d6ea3][_0x7914('0x11')](queryCampaigns);}}else{return db[_0x7914('0x15')][_0x7914('0x11')]({'attributes':[_0x7914('0x16')],'where':{'sectionId':_0x5e8bc5['id']},'raw':!![]})['then'](function(_0x289740){if(_0x289740){var _0x26561a={'where':{'id':_['map'](_0x289740,_0x7914('0x16'))},'raw':!![]};switch(_0x2d6ea3){case _0x7914('0x17'):_0x26561a[_0x7914('0x18')][_0x7914('0x7')]=_0x7914('0x9');break;case _0x7914('0x19'):_0x26561a['where'][_0x7914('0x1a')]=_0x7914('0x1b');break;}return db[_0x2d6ea3][_0x7914('0x11')](_0x26561a);}else{return[];}});}}else{return[];}})[_0x7914('0xb')](function(_0x463e70){return _0x463e70;});}function joinOrLeaveQueues(_0x10d5d2,_0x59c2b1,_0xf9f7fa,_0x2c91c9){_0x10d5d2[_0x59c2b1](util['format'](_0x7914('0x1c'),_0xf9f7fa,_0x2c91c9[_0x7914('0x5')]));if(_0x2c91c9[_0x7914('0x6')]){for(var _0x38af0a=0x0;_0x38af0a<_0x2c91c9[_0x7914('0x6')]['length'];_0x38af0a+=0x1){_0x10d5d2[_0x59c2b1](util[_0x7914('0x1d')](_0x7914('0x1e'),_0x2c91c9[_0x7914('0x6')][_0x38af0a][_0x7914('0x5')]));}}}function joinOrLeave(_0x37cc3a,_0x560436,_0x87fe22){var _0x50b341;if(_0x37cc3a[_0x7914('0x1f')][_0x7914('0x20')]['id']){db[_0x7914('0x17')]['find']({'attributes':['id','name',_0x7914('0x7'),_0x7914('0x21')],'where':{'id':_0x37cc3a[_0x7914('0x1f')][_0x7914('0x20')]['id']},'include':[{'model':db[_0x7914('0x22')],'as':_0x7914('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x7914('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7914('0x25')],'as':_0x7914('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x7914('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7914('0x28')],'as':_0x7914('0x29'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x7914('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x7914('0xb')](function(_0x106120){if(_0x106120){_0x50b341=_0x106120;_0x37cc3a[_0x560436](util[_0x7914('0x1d')]('user:%s',_0x106120[_0x7914('0x5')]));var _0x4d45ae=[];switch(_0x106120[_0x7914('0x7')]){case'admin':_0x37cc3a[_0x560436](_0x7914('0x2b'));_0x37cc3a[_0x560436]('voice:outbound');if(queryQueues[_0x7914('0x2c')](_0x7914('0x2d'))){delete queryQueues['include'];}_0x4d45ae[_0x7914('0x2e')](db['VoiceQueue']['findAll'](queryQueues));_0x4d45ae[_0x7914('0x2e')](db[_0x7914('0x2f')][_0x7914('0x11')](queryQueues));_0x4d45ae[_0x7914('0x2e')](db['FaxQueue'][_0x7914('0x11')](queryQueues));_0x4d45ae['push'](db[_0x7914('0x30')][_0x7914('0x11')](queryQueues));_0x4d45ae[_0x7914('0x2e')](db[_0x7914('0x31')][_0x7914('0x11')](queryQueues));_0x4d45ae[_0x7914('0x2e')](db[_0x7914('0x32')][_0x7914('0x11')](queryQueues));_0x4d45ae[_0x7914('0x2e')](db[_0x7914('0x33')]['findAll'](queryQueues));_0x4d45ae[_0x7914('0x2e')](db[_0x7914('0x17')]['findAll'](queryTelephones));_0x4d45ae['push'](db[_0x7914('0x34')][_0x7914('0x11')](queryTrunks));_0x4d45ae[_0x7914('0x2e')](db[_0x7914('0x19')][_0x7914('0x11')](queryCampaigns));_0x4d45ae[_0x7914('0x2e')](db['User'][_0x7914('0x11')](queryAgents));break;case'user':_0x37cc3a[_0x560436]('voice:inbound');_0x37cc3a[_0x560436](_0x7914('0x35'));_0x4d45ae[_0x7914('0x2e')](getAssociatedResources(_0x7914('0x36'),_0x106120[_0x7914('0x21')],_0x7914('0x37')));_0x4d45ae['push'](getAssociatedResources(_0x7914('0xd'),_0x106120[_0x7914('0x21')],_0x7914('0x2f')));_0x4d45ae[_0x7914('0x2e')](getAssociatedResources(_0x7914('0xe'),_0x106120[_0x7914('0x21')],_0x7914('0x38')));_0x4d45ae[_0x7914('0x2e')](getAssociatedResources('SmsQueues',_0x106120[_0x7914('0x21')],'SmsQueue'));_0x4d45ae['push'](getAssociatedResources('MailQueues',_0x106120[_0x7914('0x21')],_0x7914('0x31')));_0x4d45ae['push'](getAssociatedResources('OpenchannelQueues',_0x106120['userProfileId'],_0x7914('0x32')));_0x4d45ae['push'](getAssociatedResources(_0x7914('0x39'),_0x106120[_0x7914('0x21')],_0x7914('0x33')));_0x4d45ae[_0x7914('0x2e')](getAssociatedResources(_0x7914('0x12'),_0x106120[_0x7914('0x21')],_0x7914('0x17')));_0x4d45ae[_0x7914('0x2e')](getAssociatedResources('Trunks',_0x106120['userProfileId'],_0x7914('0x34')));_0x4d45ae['push'](getAssociatedResources(_0x7914('0x14'),_0x106120['userProfileId'],_0x7914('0x19')));_0x4d45ae[_0x7914('0x2e')](db[_0x7914('0x17')]['findAll'](queryAgents));break;case'agent':_0x37cc3a[_0x560436](_0x7914('0x2b'));_0x37cc3a[_0x560436](_0x7914('0x35'));_0x4d45ae['push'](_0x106120['getVoiceQueues']({'attributes':['id',_0x7914('0x5')]}));_0x4d45ae['push'](_0x106120['getChatQueues']({'attributes':['id','name']}));_0x4d45ae[_0x7914('0x2e')](_0x106120[_0x7914('0x3a')]({'attributes':['id',_0x7914('0x5')]}));_0x4d45ae[_0x7914('0x2e')](_0x106120[_0x7914('0x3b')]({'attributes':['id',_0x7914('0x5')]}));_0x4d45ae[_0x7914('0x2e')](_0x106120[_0x7914('0x3c')]({'attributes':['id',_0x7914('0x5')]}));_0x4d45ae['push'](_0x106120[_0x7914('0x3d')]({'attributes':['id',_0x7914('0x5')]}));_0x4d45ae[_0x7914('0x2e')](_0x106120[_0x7914('0x3e')]({'attributes':['id','name']}));break;}return BPromise[_0x7914('0x3f')](_0x4d45ae);}})['then'](function(_0xa02ddc){if(_0xa02ddc&&_0xa02ddc[_0x7914('0x40')]){for(var _0x3e03f5=0x0;_0x3e03f5<_0xa02ddc[_0x7914('0x40')];_0x3e03f5+=0x1){for(var _0x12f05e=0x0;_0x12f05e<_0xa02ddc[_0x3e03f5][_0x7914('0x40')];_0x12f05e+=0x1){switch(_0x3e03f5){case 0x0:joinOrLeaveQueues(_0x37cc3a,_0x560436,_0x7914('0x41'),_0xa02ddc[_0x3e03f5][_0x12f05e]);break;case 0x1:joinOrLeaveQueues(_0x37cc3a,_0x560436,_0x7914('0x42'),_0xa02ddc[_0x3e03f5][_0x12f05e]);break;case 0x2:joinOrLeaveQueues(_0x37cc3a,_0x560436,'fax',_0xa02ddc[_0x3e03f5][_0x12f05e]);break;case 0x3:joinOrLeaveQueues(_0x37cc3a,_0x560436,_0x7914('0x43'),_0xa02ddc[_0x3e03f5][_0x12f05e]);break;case 0x4:joinOrLeaveQueues(_0x37cc3a,_0x560436,'mail',_0xa02ddc[_0x3e03f5][_0x12f05e]);break;case 0x5:joinOrLeaveQueues(_0x37cc3a,_0x560436,_0x7914('0x44'),_0xa02ddc[_0x3e03f5][_0x12f05e]);break;case 0x6:joinOrLeaveQueues(_0x37cc3a,_0x560436,_0x7914('0x45'),_0xa02ddc[_0x3e03f5][_0x12f05e]);break;case 0x7:if(_0x50b341[_0x7914('0x7')]!=='agent')_0x37cc3a[_0x560436](util[_0x7914('0x1d')](_0x7914('0x46'),_0xa02ddc[_0x3e03f5][_0x12f05e]['name']));break;case 0x8:if(_0x50b341[_0x7914('0x7')]!==_0x7914('0x8'))_0x37cc3a[_0x560436](util['format'](_0x7914('0x47'),_0xa02ddc[_0x3e03f5][_0x12f05e][_0x7914('0x5')]));break;case 0x9:if(_0x50b341[_0x7914('0x7')]!=='agent')_0x37cc3a[_0x560436](util[_0x7914('0x1d')]('campaign:%s:%s',_0xa02ddc[_0x3e03f5][_0x12f05e]['type'],_0xa02ddc[_0x3e03f5][_0x12f05e][_0x7914('0x5')]));break;case 0xa:_0x37cc3a[_0x560436](util[_0x7914('0x1d')](_0x7914('0x1e'),_0xa02ddc[_0x3e03f5][_0x12f05e][_0x7914('0x5')]));break;}}}}})[_0x7914('0xb')](function(){if(_0x560436==='leave'){var _0x24b773=_[_0x7914('0x48')](_0x50b341[_0x7914('0x23')],'id');return _0x50b341[_0x7914('0x49')](_0x24b773)[_0x7914('0xb')](function(){for(var _0x49c1f3=0x0;_0x49c1f3<_0x24b773[_0x7914('0x40')];_0x49c1f3+=0x1){_0x87fe22['emit'](_0x7914('0x4a'),{'ChatInteractionId':Number(_0x24b773[_0x49c1f3]),'UserId':Number(_0x50b341['id'])});}});}})[_0x7914('0xb')](function(){if(_0x560436==='leave'){var _0x72013e=_[_0x7914('0x48')](_0x50b341[_0x7914('0x24')],'id');return _0x50b341[_0x7914('0x4b')](_0x72013e)[_0x7914('0xb')](function(){for(var _0x3285fc=0x0;_0x3285fc<_0x72013e[_0x7914('0x40')];_0x3285fc+=0x1){_0x87fe22[_0x7914('0x4c')](_0x7914('0x4d'),{'MailInteractionId':Number(_0x72013e[_0x3285fc]),'UserId':Number(_0x50b341['id'])});}});}})[_0x7914('0xb')](function(){if(_0x560436===_0x7914('0x4e')){var _0x3b1fdb=_[_0x7914('0x48')](_0x50b341[_0x7914('0x26')],'id');return _0x50b341[_0x7914('0x4f')](_0x3b1fdb)[_0x7914('0xb')](function(){for(var _0x56a3d6=0x0;_0x56a3d6<_0x3b1fdb[_0x7914('0x40')];_0x56a3d6+=0x1){_0x87fe22[_0x7914('0x4c')](_0x7914('0x50'),{'FaxInteractionId':Number(_0x3b1fdb[_0x56a3d6]),'UserId':Number(_0x50b341['id'])});}});}})[_0x7914('0xb')](function(){if(_0x560436===_0x7914('0x4e')){var _0x44aa64=_[_0x7914('0x48')](_0x50b341[_0x7914('0x27')],'id');return _0x50b341['removeSmsInteractions'](_0x44aa64)['then'](function(){for(var _0x334f52=0x0;_0x334f52<_0x44aa64[_0x7914('0x40')];_0x334f52+=0x1){_0x87fe22[_0x7914('0x4c')](_0x7914('0x51'),{'SmsInteractionId':Number(_0x44aa64[_0x334f52]),'UserId':Number(_0x50b341['id'])});}});}})['then'](function(){if(_0x560436===_0x7914('0x4e')){var _0x5c3969=_[_0x7914('0x48')](_0x50b341['OpenchannelInteractions'],'id');return _0x50b341[_0x7914('0x52')](_0x5c3969)[_0x7914('0xb')](function(){for(var _0x3e94e0=0x0;_0x3e94e0<_0x5c3969[_0x7914('0x40')];_0x3e94e0+=0x1){_0x87fe22[_0x7914('0x4c')](_0x7914('0x53'),{'OpenchannelInteractionId':Number(_0x5c3969[_0x3e94e0]),'UserId':Number(_0x50b341['id'])});}});}})['then'](function(){if(_0x560436===_0x7914('0x4e')){var _0x59cf20=_[_0x7914('0x48')](_0x50b341[_0x7914('0x2a')],'id');return _0x50b341['removeWhatsappInteractions'](_0x59cf20)['then'](function(){for(var _0x401406=0x0;_0x401406<_0x59cf20[_0x7914('0x40')];_0x401406+=0x1){_0x87fe22['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x59cf20[_0x401406]),'UserId':Number(_0x50b341['id'])});}});}})['catch'](function(_0x191a05){_0x37cc3a[_0x7914('0x54')](_0x191a05);});}}function onDisconnect(_0x2612ac,_0x2467f4){joinOrLeave(_0x2612ac,'leave',_0x2467f4);}function onConnect(_0x33180b){joinOrLeave(_0x33180b,_0x7914('0x55'));}exports[_0x7914('0x56')]=function(_0x32f7f1){_0x32f7f1['on']('connection',function(_0xf2c3f5){_0xf2c3f5[_0x7914('0x57')](0x0);_0xf2c3f5[_0x7914('0x58')]=_0xf2c3f5[_0x7914('0x59')][_0x7914('0x5a')][_0x7914('0x5b')]+':'+_0xf2c3f5[_0x7914('0x59')][_0x7914('0x5a')][_0x7914('0x5c')];_0xf2c3f5['connectedAt']=new Date();_0xf2c3f5[_0x7914('0x54')]=function(_0x1ebce6){console[_0x7914('0x54')](_0x7914('0x5d')+_0xf2c3f5[_0x7914('0x5e')][_0x7914('0x5')]+'['+_0xf2c3f5[_0x7914('0x58')]+']',_0x1ebce6);};_0xf2c3f5['on'](_0x7914('0x5f'),function(){onDisconnect(_0xf2c3f5,_0x32f7f1);_0xf2c3f5[_0x7914('0x54')](_0x7914('0x60'));});onConnect(_0xf2c3f5);_0xf2c3f5[_0x7914('0x54')](_0x7914('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 398c9f3..3b2fb91 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 _0x6423=['get','channel','motionChannel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','User','email','format','SIP/%s','name','agent','incomingmessage','catch','outgoingmessage','opened','changed','closed','fullname','internal','interface','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','lodash','client','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','OpenchannelInteraction','Openchannel','then','info','EventManager','error','code','Trigger,\x20%s'];(function(_0x2b5cd0,_0x42a0d1){var _0x28ae02=function(_0x6dfcdb){while(--_0x6dfcdb){_0x2b5cd0['push'](_0x2b5cd0['shift']());}};_0x28ae02(++_0x42a0d1);}(_0x6423,0x134));var _0x3642=function(_0x40d2f2,_0x178354){_0x40d2f2=_0x40d2f2-0x0;var _0x4e56ba=_0x6423[_0x40d2f2];return _0x4e56ba;};'use strict';var util=require(_0x3642('0x0'));var db=require(_0x3642('0x1'))['db'];var jayson=require(_0x3642('0x2'));var logger=require(_0x3642('0x3'))('triggers');var _=require(_0x3642('0x4'));var client=jayson[_0x3642('0x5')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0x3642('0x6'),'condition':_0x3642('0x7'),'callback':afterCreate},{'channel':_0x3642('0x8'),'model':'ChatInteraction','event':_0x3642('0x9'),'condition':_0x3642('0xa'),'callback':afterUpdate},{'channel':_0x3642('0x8'),'model':_0x3642('0xb'),'event':_0x3642('0x6'),'condition':_0x3642('0xc'),'callback':afterCreateMessage},{'channel':_0x3642('0xd'),'model':'SmsInteraction','event':_0x3642('0x6'),'condition':_0x3642('0x7'),'callback':afterCreate},{'channel':_0x3642('0xd'),'model':_0x3642('0xe'),'event':_0x3642('0x9'),'condition':_0x3642('0xa'),'callback':afterUpdate},{'channel':_0x3642('0xd'),'model':_0x3642('0xf'),'event':_0x3642('0x6'),'condition':_0x3642('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':'afterCreate','condition':_0x3642('0x7'),'callback':afterCreate},{'channel':_0x3642('0x10'),'model':_0x3642('0x11'),'event':_0x3642('0x9'),'condition':_0x3642('0xa'),'callback':afterUpdate},{'channel':_0x3642('0x10'),'model':_0x3642('0x12'),'event':'afterCreate','condition':_0x3642('0xc'),'callback':afterCreateMessage},{'channel':_0x3642('0x13'),'model':'FaxInteraction','event':'afterCreate','condition':_0x3642('0x7'),'callback':afterCreate},{'channel':_0x3642('0x13'),'model':_0x3642('0x14'),'event':_0x3642('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x3642('0x13'),'model':_0x3642('0x15'),'event':'afterCreate','condition':_0x3642('0xc'),'callback':afterCreateMessage},{'channel':_0x3642('0x16'),'model':_0x3642('0x17'),'event':_0x3642('0x6'),'condition':_0x3642('0x7'),'callback':afterCreate},{'channel':_0x3642('0x16'),'model':_0x3642('0x17'),'event':_0x3642('0x9'),'condition':_0x3642('0xa'),'callback':afterUpdate},{'channel':_0x3642('0x16'),'model':'MailMessage','event':'afterCreate','condition':_0x3642('0xc'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x3642('0x18'),'event':_0x3642('0x6'),'condition':_0x3642('0x7'),'callback':afterCreate},{'channel':_0x3642('0x19'),'model':_0x3642('0x18'),'event':_0x3642('0x9'),'condition':_0x3642('0xa'),'callback':afterUpdate},{'channel':_0x3642('0x19'),'model':'OpenchannelMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x125cb2){return client['request']('EventManager',_0x125cb2)[_0x3642('0x1a')](function(_0x1d56c5){logger[_0x3642('0x1b')]('Trigger,\x20%s',_0x3642('0x1c'),_0x1d56c5);if(_0x1d56c5[_0x3642('0x1d')]){if(_0x1d56c5['error'][_0x3642('0x1e')]===0x1f4){logger['error'](_0x3642('0x1f'),_0x3642('0x1c'),_0x1d56c5[_0x3642('0x1d')]);}}})['catch'](function(_0x20b6f2){logger['error'](_0x3642('0x1f'),_0x3642('0x1c'),_0x20b6f2);});}function afterCreateMessage(_0x32a10e,_0x415c99){return function(_0x361f2c,_0xbd6fe0){_0x361f2c=_0x361f2c[_0x3642('0x20')]({'plain':!![]});_0x361f2c[_0x3642('0x21')]=_0x32a10e;_0x361f2c[_0x3642('0x22')]=_0x32a10e;_0x361f2c[_0x3642('0x23')]=_0x361f2c['direction'];var _0x3fd6b8=_0x3642('0x24')+_0x361f2c[_0x3642('0x25')];return db[_0x3642('0x26')][_0x3642('0x27')](_0x3fd6b8,{'type':db[_0x3642('0x28')][_0x3642('0x29')][_0x3642('0x2a')],'raw':!![]})[_0x3642('0x1a')](function(_0x24493b){return _0x24493b;})[_0x3642('0x1a')](function(_0x35fdf0){if(_0x35fdf0){_0x361f2c[_0x3642('0x2b')]=_0x35fdf0[0x0];}if(_0x361f2c[_0x3642('0x2c')]){return db[_0x3642('0x2d')]['find']({'where':{'id':_0x361f2c[_0x3642('0x2c')]},'attributes':['id','name','fullname',_0x3642('0x2e'),'internal'],'raw':!![]})[_0x3642('0x1a')](function(_0x2c1965){_0x361f2c['interface']=util[_0x3642('0x2f')](_0x3642('0x30'),_0x2c1965[_0x3642('0x31')]);_0x361f2c[_0x3642('0x21')]=_0x32a10e;_0x361f2c[_0x3642('0x32')]=_0x2c1965;return request({'event':_0x3642('0x33'),'message':_0x361f2c});})[_0x3642('0x34')](function(_0x5d7356){console[_0x3642('0x1d')](_0x5d7356);});}else{return request({'event':_0x3642('0x35'),'message':_0x361f2c});}});};}function afterCreate(_0x48f0c4,_0x414cda){return function(_0x3c13d7,_0x2a4b34){_0x3c13d7=_0x3c13d7[_0x3642('0x20')]({'plain':!![]});_0x3c13d7[_0x3642('0x21')]=_0x48f0c4;_0x3c13d7[_0x3642('0x22')]=_0x48f0c4;_0x3c13d7[_0x3642('0x23')]=_0x3642('0x36');var _0x510490=_0x3642('0x24')+_0x3c13d7[_0x3642('0x25')];return db[_0x3642('0x26')]['query'](_0x510490,{'type':db[_0x3642('0x28')]['QueryTypes'][_0x3642('0x2a')],'raw':!![]})[_0x3642('0x1a')](function(_0x550017){return _0x550017;})[_0x3642('0x1a')](function(_0x3a5aca){if(_0x3a5aca){_0x3c13d7[_0x3642('0x2b')]=_0x3a5aca[0x0];}return request({'event':_0x414cda,'message':_0x3c13d7});});};}function afterUpdate(_0x144020,_0x47ea2a){return function(_0xcb41ed,_0x533d79){if(_0xcb41ed[_0x3642('0x37')](_0x3642('0x38'))&&_0xcb41ed[_0x3642('0x38')]){_0xcb41ed=_0xcb41ed[_0x3642('0x20')]({'plain':!![]});_0xcb41ed[_0x3642('0x21')]=_0x144020;_0xcb41ed[_0x3642('0x22')]=_0x144020;_0xcb41ed[_0x3642('0x23')]=_0x3642('0x38');var _0x1bbf52=_0x3642('0x24')+_0xcb41ed[_0x3642('0x25')];return db[_0x3642('0x26')][_0x3642('0x27')](_0x1bbf52,{'type':db[_0x3642('0x28')][_0x3642('0x29')][_0x3642('0x2a')],'raw':!![]})[_0x3642('0x1a')](function(_0x10d3c5){return _0x10d3c5;})[_0x3642('0x1a')](function(_0x5410a4){if(_0x5410a4){_0xcb41ed['contact']=_0x5410a4[0x0];}if(_0xcb41ed['UserId']){return db['User']['find']({'where':{'id':_0xcb41ed[_0x3642('0x2c')]},'attributes':['id',_0x3642('0x31'),_0x3642('0x39'),_0x3642('0x2e'),_0x3642('0x3a')],'raw':!![]})['then'](function(_0x4690cc){_0xcb41ed[_0x3642('0x3b')]=util[_0x3642('0x2f')](_0x3642('0x30'),_0x4690cc[_0x3642('0x31')]);_0xcb41ed[_0x3642('0x32')]=_0x4690cc;return request({'event':_0x47ea2a,'message':_0xcb41ed});})[_0x3642('0x34')](function(_0xc57d8f){console['error'](_0xc57d8f);});}else{return request({'event':_0x47ea2a,'message':_0xcb41ed});}});}};}exports[_0x3642('0x3c')]=function(){for(var _0x4e6c72=0x0;_0x4e6c72=_0x331656[_0x6b09('0x15')]){throw Error(_0x6b09('0x16'));}_0x402f1f(_0x2f7ecb);})[_0x6b09('0x17')](function(_0x28f15d){_0x10dadf(_0x28f15d);});});}; \ No newline at end of file +var _0xffc4=['blockedAt','updateAttributes','getLicense','role','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','mail','chat','fax','sms','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined'];(function(_0x3a8332,_0x580560){var _0x54b193=function(_0x52645a){while(--_0x52645a){_0x3a8332['push'](_0x3a8332['shift']());}};_0x54b193(++_0x580560);}(_0xffc4,0x17a));var _0x4ffc=function(_0x158982,_0x2633d1){_0x158982=_0x158982-0x0;var _0x133e0e=_0xffc4[_0x158982];return _0x133e0e;};'use strict';var _=require(_0x4ffc('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0x4ffc('0x1'));var channels=[_0x4ffc('0x2'),_0x4ffc('0x3'),_0x4ffc('0x4'),_0x4ffc('0x5'),_0x4ffc('0x6'),'whatsapp',_0x4ffc('0x7')];exports['getChannels']=function(){return channels;};exports[_0x4ffc('0x8')]=function(_0x583f3d){_0x583f3d=_0x583f3d[_0x4ffc('0x9')]();return _[_0x4ffc('0xa')](channels,_0x583f3d);};exports[_0x4ffc('0xb')]=function(_0x34bc06,_0x2336fe,_0xb86bfc,_0x5d39ef){var _0x551f08={'loginAttempts':_0x2336fe,'blocked':_0xb86bfc};if(!_[_0x4ffc('0xc')](_0x5d39ef)){_0x551f08[_0x4ffc('0xd')]=_0x5d39ef;}return _0x34bc06[_0x4ffc('0xe')](_0x551f08);};exports[_0x4ffc('0xf')]=function(_0x2960f0){return new BPromise(function(_0x3c4fd7,_0x9ad04f){var _0x367abc=0x0;if(_0x2960f0[_0x4ffc('0x10')]!=='agent'){_0x3c4fd7(_0x2960f0);}db[_0x4ffc('0x11')][_0x4ffc('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x2960f0['id']}}})[_0x4ffc('0x13')](function(_0x214a84){_0x367abc=_0x214a84;return util[_0x4ffc('0xf')]();})[_0x4ffc('0x13')](function(_0x5b513b){if(_0x5b513b&&_0x5b513b[_0x4ffc('0x14')]&&_0x367abc>=_0x5b513b[_0x4ffc('0x14')]){throw Error(_0x4ffc('0x15'));}_0x3c4fd7(_0x2960f0);})[_0x4ffc('0x16')](function(_0x543b37){_0x9ad04f(_0x543b37);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index d47ce77..bcc6315 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b79=['404','status','render','send'];(function(_0x512891,_0x46005a){var _0x1c190c=function(_0x42b95b){while(--_0x42b95b){_0x512891['push'](_0x512891['shift']());}};_0x1c190c(++_0x46005a);}(_0x2b79,0x138));var _0x92b7=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x2b79[_0x271537];return _0x19dc22;};'use strict';module['exports'][0x194]=function pageNotFound(_0x1d3de3,_0x452277){var _0x45ef03=_0x92b7('0x0');var _0x31072b=0x194;var _0x45bfae={'status':_0x31072b};_0x452277[_0x92b7('0x1')](_0x45bfae[_0x92b7('0x1')]);_0x452277[_0x92b7('0x2')](_0x45ef03,{},function(_0x2c359f,_0x8baab){if(_0x2c359f){return _0x452277['status'](_0x45bfae[_0x92b7('0x1')])['json'](_0x45bfae);}_0x452277[_0x92b7('0x3')](_0x8baab);});}; \ No newline at end of file +var _0x473a=['send','exports','404','status','render'];(function(_0x3a7efd,_0x457caf){var _0x2d33ab=function(_0x476042){while(--_0x476042){_0x3a7efd['push'](_0x3a7efd['shift']());}};_0x2d33ab(++_0x457caf);}(_0x473a,0x1cd));var _0xa473=function(_0x323f9c,_0x11b56a){_0x323f9c=_0x323f9c-0x0;var _0x2d1c51=_0x473a[_0x323f9c];return _0x2d1c51;};'use strict';module[_0xa473('0x0')][0x194]=function pageNotFound(_0x49b871,_0x53c060){var _0x28d027=_0xa473('0x1');var _0x3c0816=0x194;var _0xc2147d={'status':_0x3c0816};_0x53c060[_0xa473('0x2')](_0xc2147d[_0xa473('0x2')]);_0x53c060[_0xa473('0x3')](_0x28d027,{},function(_0x11777a,_0x5be1cf){if(_0x11777a){return _0x53c060[_0xa473('0x2')](_0xc2147d[_0xa473('0x2')])['json'](_0xc2147d);}_0x53c060[_0xa473('0x4')](_0x5be1cf);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 531f666..d37878a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb51=['VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../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/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','userProfileId','ChatGroup','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_lists','user_has_teams','ChatInteraction','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceMusicOnHold','VoiceQueueId','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPauseId','Lists','Agents','mailboxuser','mailbox','uniqueid','AgentReports','Contact','ContactId','MailServerOut','MailAccountId','Imap','Smtp','Disposition','Messages','Interactions','Applications','List','ListId','Template','TemplateId','mandatoryDispositionPause','team_has_mail_queues','Teams','Account','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','MailInteractionId','Attachments','Interaction','restrict','TagId','Dashboard','Items','Dispositions','FaxAccountId','Answers','FaxInteractionId','fax_interaction_has_tags','Tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','Owner','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelAccount','OpenchannelInteractionId','OpenchannelInteraction','openchannel_interaction_has_tags','OpenchannelQueueId','ChatWebsiteId','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','ChatGroupId','Members','Website','CompanyId','HopperHistories','MailInteractions','CmCompany','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','moh_has_sounds','whatsapp_interaction_has_tags','Trigger','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','CustomReportId','MetricId','AnalyticMetric','AccountId','Subjects','Descriptions','FieldId','Subject','SubjectId','Description','DescriptionId','Field','Variable','SugarcrmConfiguration','Configurations','VariableId','int_desk_configuration_has_tags','ZohoAccount','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowField','Dynamics365Account','FreshsalesField','ChatQueueReport','FromId','ToId','JscriptyQuestionReport','SessionId','ProjectId','team_has_chat_queues','team_has_sms_queues','team_has_openchannel_queues','team_has_whatsapp_queues','Hoppers','SquareProjectId','FromMailAccountId','FromAgent','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToUserId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','FromOpenchannelAccountId','FromAccount','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','voice_queues_has_cm_lists','Resources','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_interactions','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','database','username','password','User','import','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model'];(function(_0x441dd8,_0x240597){var _0x5cb253=function(_0x3dfa30){while(--_0x3dfa30){_0x441dd8['push'](_0x441dd8['shift']());}};_0x5cb253(++_0x240597);}(_0xfb51,0x1ca));var _0x1fb5=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xfb51[_0x2a5099];return _0x2802f1;};'use strict';var config=require(_0x1fb5('0x0'));var Sequelize=require(_0x1fb5('0x1'));var _=require(_0x1fb5('0x2'));var jstz=require('jstz');var timezone=jstz[_0x1fb5('0x3')]();config[_0x1fb5('0x1')]=_[_0x1fb5('0x4')](config[_0x1fb5('0x1')],{'database':'motion2','username':'xcall','password':_0x1fb5('0x5'),'options':{'host':_0x1fb5('0x6'),'port':0xcea,'dialect':_0x1fb5('0x7'),'dialectOptions':{'charset':_0x1fb5('0x8')},'logging':![],'timezone':timezone[_0x1fb5('0x9')](),'define':{'charset':_0x1fb5('0xa'),'collate':_0x1fb5('0xb')}}});config[_0x1fb5('0xc')]=_[_0x1fb5('0x4')](config[_0x1fb5('0xc')],{'database':_0x1fb5('0xd'),'username':_0x1fb5('0xe'),'password':_0x1fb5('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x1fb5('0x7'),'dialectOptions':{'charset':_0x1fb5('0x8')},'logging':![],'timezone':timezone[_0x1fb5('0x9')](),'define':{'charset':_0x1fb5('0xa'),'collate':_0x1fb5('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1fb5('0x1')][_0x1fb5('0xf')],config[_0x1fb5('0x1')][_0x1fb5('0x10')],config[_0x1fb5('0x1')][_0x1fb5('0x11')],config[_0x1fb5('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x1fb5('0xf')],config[_0x1fb5('0xc')][_0x1fb5('0x10')],config[_0x1fb5('0xc')][_0x1fb5('0x11')],config[_0x1fb5('0xc')]['options'])};db[_0x1fb5('0x12')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/user/user.model');db[_0x1fb5('0x14')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x15'));db[_0x1fb5('0x16')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x17'));db['VoiceMusicOnHold']=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x18'));db[_0x1fb5('0x19')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x1a'));db[_0x1fb5('0x1b')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x1c'));db['ScreenRecording']=db['sequelize']['import'](_0x1fb5('0x1d'));db[_0x1fb5('0x1e')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x1f'));db[_0x1fb5('0x20')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x21'));db[_0x1fb5('0x22')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x23'));db[_0x1fb5('0x24')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x25'));db[_0x1fb5('0x26')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x27'));db[_0x1fb5('0x28')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x29'));db[_0x1fb5('0x2a')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/memberReport/memberReport.model');db[_0x1fb5('0x2b')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x2c'));db['VoiceTransferReport']=db['sequelize'][_0x1fb5('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x1fb5('0x2d')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x2e'));db[_0x1fb5('0x2f')]=db[_0x1fb5('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x1fb5('0x30')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x31'));db[_0x1fb5('0x32')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x33'));db['UserFaxQueue']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x34'));db[_0x1fb5('0x35')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x36'));db[_0x1fb5('0x37')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x38'));db[_0x1fb5('0x39')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x3a'));db[_0x1fb5('0x3b')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x3c'));db['MailServerOut']=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x3d'));db['MailAccount']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x3e'));db[_0x1fb5('0x3f')]=db['sequelize'][_0x1fb5('0x13')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x1fb5('0x40')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x41'));db[_0x1fb5('0x42')]=db['sequelize'][_0x1fb5('0x13')]('../api/mailMessage/mailMessage.model');db[_0x1fb5('0x43')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x44'));db[_0x1fb5('0x45')]=db['sequelize']['import'](_0x1fb5('0x46'));db['Dashboard']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x47'));db[_0x1fb5('0x48')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x49'));db[_0x1fb5('0x4a')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x4b'));db[_0x1fb5('0x4c')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x4d'));db[_0x1fb5('0x4e')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x4f'));db[_0x1fb5('0x50')]=db['sequelize'][_0x1fb5('0x13')]('../api/faxMessage/faxMessage.model');db[_0x1fb5('0x51')]=db[_0x1fb5('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0x1fb5('0x52')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/faxQueueReport/faxQueueReport.model');db[_0x1fb5('0x53')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x54'));db[_0x1fb5('0x55')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/smsApplication/smsApplication.model');db[_0x1fb5('0x56')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x57'));db[_0x1fb5('0x58')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x59'));db[_0x1fb5('0x5a')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x5b'));db['OpenchannelAccount']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x1fb5('0x5c')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x5d'));db['OpenchannelInteraction']=db['sequelize']['import'](_0x1fb5('0x5e'));db[_0x1fb5('0x5f')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x60'));db[_0x1fb5('0x61')]=db[_0x1fb5('0x1')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0x1fb5('0x62')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x1fb5('0x63')]=db[_0x1fb5('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x1fb5('0x64')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x65'));db['ChatInteraction']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x66'));db[_0x1fb5('0x67')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/chatMessage/chatMessage.model');db[_0x1fb5('0x68')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x1fb5('0x69')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x6a'));db['ChatGroup']=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x6b'));db['CmCompany']=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x6c'));db[_0x1fb5('0x6d')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x6e'));db[_0x1fb5('0x6f')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/cmHopper/cmHopper.model');db[_0x1fb5('0x70')]=db[_0x1fb5('0x1')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x1fb5('0x71')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x72'));db[_0x1fb5('0x73')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x74'));db['ReportAgentPreview']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x1fb5('0x75')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x76'));db[_0x1fb5('0x77')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0x78'));db[_0x1fb5('0x79')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x7a'));db[_0x1fb5('0x7b')]=db['sequelize'][_0x1fb5('0x13')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x7c'));db[_0x1fb5('0x7d')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/condition/condition.model');db[_0x1fb5('0x7e')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x7f'));db['Pause']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x80'));db[_0x1fb5('0x81')]=db['sequelize']['import']('../api/cdr/cdr.model');db[_0x1fb5('0x82')]=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x1fb5('0x83')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x84'));db[_0x1fb5('0x85')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x86'));db[_0x1fb5('0x87')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x88'));db['Template']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x89'));db['Trigger']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x8a'));db['Variable']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x8b'));db[_0x1fb5('0x8c')]=db['sequelize']['import'](_0x1fb5('0x8d'));db[_0x1fb5('0x8e')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x8f'));db[_0x1fb5('0x90')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x91'));db[_0x1fb5('0x92')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x93'));db['AnalyticExtractedReport']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x94'));db[_0x1fb5('0x95')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x96'));db[_0x1fb5('0x97')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x98'));db[_0x1fb5('0x99')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x9a'));db[_0x1fb5('0x9b')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0x9c'));db[_0x1fb5('0x9d')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x9e'));db[_0x1fb5('0x9f')]=db['sequelize'][_0x1fb5('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xa0'));db[_0x1fb5('0xa1')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x1fb5('0xa2')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xa3'));db[_0x1fb5('0xa4')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xa5'));db[_0x1fb5('0xa6')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xa7'));db['ZohoAccount']=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xa8'));db[_0x1fb5('0xa9')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x1fb5('0xaa')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xab'));db['ZendeskAccount']=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xac'));db[_0x1fb5('0xad')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xae'));db['ZendeskField']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xaf'));db[_0x1fb5('0xb0')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xb1'));db[_0x1fb5('0xb2')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xb3'));db[_0x1fb5('0xb4')]=db[_0x1fb5('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x1fb5('0xb5')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xb6'));db[_0x1fb5('0xb7')]=db['sequelize'][_0x1fb5('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x1fb5('0xb8')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xb9'));db[_0x1fb5('0xba')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xbb'));db[_0x1fb5('0xbc')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xbd'));db['ServicenowField']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xbe'));db['Dynamics365Account']=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xbf'));db[_0x1fb5('0xc0')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xc1'));db[_0x1fb5('0xc2')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xc3'));db[_0x1fb5('0xc4')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xc5'));db[_0x1fb5('0xc6')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xc7'));db['FreshsalesField']=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xc8'));db[_0x1fb5('0x8c')]=db[_0x1fb5('0x1')]['import']('../api/integration/integration.model');db[_0x1fb5('0xc9')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/network/network.model');db['ChatQueueReport']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xca'));db[_0x1fb5('0xcb')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xcc'));db[_0x1fb5('0xcd')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xce'));db['JscriptyQuestionReport']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xcf'));db[_0x1fb5('0xd0')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xd1'));db[_0x1fb5('0xd2')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0x1fb5('0xd3')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xd4'));db[_0x1fb5('0xd5')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xd6'));db[_0x1fb5('0xd7')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xd8'));db[_0x1fb5('0xd9')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xda'));db['SquareOdbc']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xdb'));db[_0x1fb5('0xdc')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xdd'));db[_0x1fb5('0xde')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/squareRecording/squareRecording.model');db[_0x1fb5('0xdf')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xe0'));db[_0x1fb5('0xe1')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xe2'));db['License']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xe3'));db[_0x1fb5('0xe4')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/campaign/campaign.model');db[_0x1fb5('0xe5')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xe6'));db[_0x1fb5('0xe7')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xe8'));db[_0x1fb5('0xe9')]=db[_0x1fb5('0x1')]['import']('../api/plugin/plugin.model');db[_0x1fb5('0xea')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xeb'));db['ChatTransferReport']=db['sequelize'][_0x1fb5('0x13')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0x1fb5('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x1fb5('0xec')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xed'));db[_0x1fb5('0xee')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xef'));db[_0x1fb5('0xf0')]=db['sequelize'][_0x1fb5('0x13')]('../api/cmList/cmList.model');db[_0x1fb5('0xf1')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0x1fb5('0xf2')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/userProfile/userProfile.model');db[_0x1fb5('0xf3')]=db['sequelize']['import'](_0x1fb5('0xf4'));db[_0x1fb5('0xf5')]=db[_0x1fb5('0x1')]['import'](_0x1fb5('0xf6'));db[_0x1fb5('0xf7')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xf8'));db[_0x1fb5('0xf9')]=db['sequelize']['import']('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xfa'));db[_0x1fb5('0xfb')]=db['sequelize'][_0x1fb5('0x13')](_0x1fb5('0xfc'));db[_0x1fb5('0xfd')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0xfe'));db[_0x1fb5('0xff')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x100'));db['WhatsappTransferReport']=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x101'));db['WhatsappQueue']=db[_0x1fb5('0x1')][_0x1fb5('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0x1fb5('0x102')]=db[_0x1fb5('0x1')][_0x1fb5('0x13')](_0x1fb5('0x103'));db[_0x1fb5('0x104')]=db['sequelize'][_0x1fb5('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['User'][_0x1fb5('0x105')](db[_0x1fb5('0x1e')],{'as':'VoiceMail','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db[_0x1fb5('0x1b')],{'as':_0x1fb5('0x109'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')]['hasMany'](db[_0x1fb5('0x2d')],{'as':_0x1fb5('0x10a'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db['VoiceExtension'],{'as':_0x1fb5('0x10b'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db['User'][_0x1fb5('0x108')](db['CmHopperFinal'],{'as':_0x1fb5('0x10c'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db['CmHopperHistory'],{'as':_0x1fb5('0x10d'),'foreignKey':_0x1fb5('0x107')});db['User'][_0x1fb5('0x108')](db[_0x1fb5('0x10e')],{'as':_0x1fb5('0x10e'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x1fb5('0x10f'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db['ChatInteraction'],{'as':_0x1fb5('0x110'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')]['hasMany'](db[_0x1fb5('0x56')],{'as':_0x1fb5('0x111'),'foreignKey':_0x1fb5('0x107')});db['User'][_0x1fb5('0x108')](db[_0x1fb5('0x4e')],{'as':_0x1fb5('0x112'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x12')][_0x1fb5('0x108')](db[_0x1fb5('0x40')],{'as':'MailInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0x1fb5('0xfb')],{'as':_0x1fb5('0x113'),'foreignKey':_0x1fb5('0x107')});db['User'][_0x1fb5('0x108')](db[_0x1fb5('0xf7')],{'as':_0x1fb5('0x114'),'foreignKey':'SenderId'});db[_0x1fb5('0x12')]['belongsTo'](db[_0x1fb5('0xf2')],{'as':_0x1fb5('0xf2'),'foreignKey':_0x1fb5('0x115')});db[_0x1fb5('0x12')]['belongsToMany'](db[_0x1fb5('0x116')],{'as':_0x1fb5('0x117'),'through':_0x1fb5('0x118')});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x11a'),'through':'cm_user_has_contacts'});db[_0x1fb5('0x12')]['belongsToMany'](db[_0x1fb5('0xf0')],{'as':'Lists','through':_0x1fb5('0x11b')});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':_0x1fb5('0x11c')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x40')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x11d')],{'as':_0x1fb5('0x110'),'through':_0x1fb5('0x11e')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x4e')],{'as':_0x1fb5('0x112'),'through':_0x1fb5('0x11f')});db[_0x1fb5('0x12')]['belongsToMany'](db[_0x1fb5('0x56')],{'as':'SmsInteractions','through':_0x1fb5('0x120')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['OpenchannelInteraction'],{'as':_0x1fb5('0x10f'),'through':_0x1fb5('0x121')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0xfb')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x19')],{'as':_0x1fb5('0x122'),'through':_0x1fb5('0x2f'),'required':![]});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x3f')],{'as':_0x1fb5('0x123'),'through':_0x1fb5('0x32'),'required':![]});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x69')],{'as':'ChatQueues','through':_0x1fb5('0x30'),'required':![],'hooks':!![]});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x51')],{'as':_0x1fb5('0x124'),'through':_0x1fb5('0x125'),'required':![]});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['SmsQueue'],{'as':_0x1fb5('0x126'),'through':_0x1fb5('0x35'),'required':![]});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0x61')],{'as':_0x1fb5('0x127'),'through':_0x1fb5('0x37'),'required':![]});db[_0x1fb5('0x12')]['belongsToMany'](db[_0x1fb5('0x128')],{'as':_0x1fb5('0x129'),'through':_0x1fb5('0x39'),'required':![]});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'through':_0x1fb5('0x11b')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['VoicePrefix'],{'as':_0x1fb5('0x12a'),'through':_0x1fb5('0x12b'),'required':![]});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0x62')],{'as':_0x1fb5('0x12c'),'through':_0x1fb5('0x12d')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['FaxAccount'],{'as':_0x1fb5('0x12e'),'through':_0x1fb5('0x12f')});db['User'][_0x1fb5('0x119')](db[_0x1fb5('0x130')],{'as':'MailAccounts','through':_0x1fb5('0x131')});db['User'][_0x1fb5('0x119')](db['OpenchannelAccount'],{'as':_0x1fb5('0x132'),'through':_0x1fb5('0x133')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0x53')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db[_0x1fb5('0xf9')],{'as':_0x1fb5('0x134'),'through':_0x1fb5('0x135')});db[_0x1fb5('0x12')][_0x1fb5('0x119')](db['SquareProject'],{'as':_0x1fb5('0x136'),'through':_0x1fb5('0x137')});db['VoiceChanSpy'][_0x1fb5('0x108')](db[_0x1fb5('0x16')],{'as':_0x1fb5('0x138'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x139')});db['VoiceContext']['hasMany'](db[_0x1fb5('0x16')],{'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x16')][_0x1fb5('0x108')](db['VoiceExtension'],{'as':'Applications','onDelete':'cascade'});db[_0x1fb5('0x13a')]['belongsToMany'](db[_0x1fb5('0x85')],{'as':'Sounds','through':'moh_has_sounds'});db[_0x1fb5('0x19')][_0x1fb5('0x108')](db[_0x1fb5('0x2d')],{'as':'Members','foreignKey':_0x1fb5('0x13b')});db['VoiceQueue'][_0x1fb5('0x108')](db[_0x1fb5('0x6f')],{'as':'Hoppers','foreignKey':_0x1fb5('0x13b')});db['VoiceQueue'][_0x1fb5('0x108')](db[_0x1fb5('0x71')],{'as':_0x1fb5('0x10c'),'foreignKey':_0x1fb5('0x13b')});db[_0x1fb5('0x19')][_0x1fb5('0x108')](db[_0x1fb5('0x73')],{'as':'HopperHistories','foreignKey':_0x1fb5('0x13b')});db['VoiceQueue'][_0x1fb5('0x108')](db[_0x1fb5('0x10e')],{'as':_0x1fb5('0x10e'),'foreignKey':_0x1fb5('0x13b')});db[_0x1fb5('0x19')][_0x1fb5('0x108')](db['CmHopperBlack'],{'as':_0x1fb5('0x13c'),'foreignKey':'VoiceQueueId'});db[_0x1fb5('0x19')][_0x1fb5('0x108')](db[_0x1fb5('0xd0')],{'as':_0x1fb5('0x13d'),'foreignKey':_0x1fb5('0x13b')});db[_0x1fb5('0x19')][_0x1fb5('0x13e')](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x2b'),'foreignKey':_0x1fb5('0x13f')});db[_0x1fb5('0x19')][_0x1fb5('0x13e')](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x140'),'foreignKey':_0x1fb5('0x141')});db[_0x1fb5('0x19')]['belongsTo'](db[_0x1fb5('0x7e')],{'as':_0x1fb5('0x7e'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0x19')][_0x1fb5('0x13e')](db[_0x1fb5('0x143')],{'as':'mandatoryDispositionPause','foreignKey':_0x1fb5('0x144')});db[_0x1fb5('0x19')][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x145'),'through':'voice_queues_has_cm_lists'});db[_0x1fb5('0x19')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x2f')});db['VoiceQueue'][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'as':'Teams','through':_0x1fb5('0x104')});db['VoiceQueue'][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db['VoiceRecording']['belongsTo'](db[_0x1fb5('0x12')],{'as':'User','foreignKey':_0x1fb5('0x107')});db['ScreenRecording']['belongsTo'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x12'),'foreignKey':'UserId'});db[_0x1fb5('0x1e')][_0x1fb5('0x108')](db[_0x1fb5('0x20')],{'as':'Messages','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x147'),'sourceKey':_0x1fb5('0x148')});db[_0x1fb5('0x20')]['belongsTo'](db[_0x1fb5('0x1e')],{'foreignKey':_0x1fb5('0x147'),'targetKey':_0x1fb5('0x148')});db['VoiceCallReport'][_0x1fb5('0x108')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x1fb5('0x149'),'constraints':![]});db[_0x1fb5('0x22')][_0x1fb5('0x108')](db[_0x1fb5('0x26')],{'as':_0x1fb5('0x14a'),'foreignKey':'uniqueid','constraints':![]});db[_0x1fb5('0x22')]['belongsTo'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x12'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x22')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x3b')]['belongsTo'](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x130'),'foreignKey':'MailAccountId'});db[_0x1fb5('0x14d')][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x130'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x130')]['hasOne'](db[_0x1fb5('0x3b')],{'as':_0x1fb5('0x14f'),'onDelete':'cascade'});db['MailAccount'][_0x1fb5('0x105')](db[_0x1fb5('0x14d')],{'as':_0x1fb5('0x150'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x130')]['hasMany'](db[_0x1fb5('0x151')],{'as':'Dispositions','foreignKey':_0x1fb5('0x14e'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x130')][_0x1fb5('0x108')](db[_0x1fb5('0x7b')],{'as':'Answers','foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x130')][_0x1fb5('0x108')](db[_0x1fb5('0x42')],{'as':_0x1fb5('0x152'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x130')]['hasMany'](db[_0x1fb5('0x40')],{'as':_0x1fb5('0x153')});db[_0x1fb5('0x130')][_0x1fb5('0x108')](db[_0x1fb5('0x43')],{'as':_0x1fb5('0x154')});db[_0x1fb5('0x130')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x130')]['belongsTo'](db[_0x1fb5('0x157')],{'as':_0x1fb5('0x157'),'foreignKey':_0x1fb5('0x158')});db[_0x1fb5('0x130')][_0x1fb5('0x13e')](db['Pause'],{'as':_0x1fb5('0x159'),'foreignKey':_0x1fb5('0x144')});db[_0x1fb5('0x130')][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x131')});db[_0x1fb5('0x3f')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x32')});db['MailQueue'][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':_0x1fb5('0x15a'),'as':_0x1fb5('0x15b')});db[_0x1fb5('0x40')][_0x1fb5('0x108')](db['MailMessage'],{'as':_0x1fb5('0x152'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x1fb5('0x40')][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x40')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x40')][_0x1fb5('0x13e')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0x1fb5('0x40')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x15d'),'as':'Tags'});db[_0x1fb5('0x40')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x15d'),'as':_0x1fb5('0x15e')});db[_0x1fb5('0x40')]['belongsToMany'](db['User'],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x160'),'foreignKey':_0x1fb5('0x161')});db[_0x1fb5('0x42')]['hasMany'](db[_0x1fb5('0xe7')],{'as':_0x1fb5('0x162'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x42')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'as':'User'});db[_0x1fb5('0x42')]['belongsTo'](db[_0x1fb5('0x6d')],{'onDelete':_0x1fb5('0x106'),'as':'Contact'});db['MailMessage'][_0x1fb5('0x13e')](db[_0x1fb5('0x40')],{'as':_0x1fb5('0x163'),'foreignKey':_0x1fb5('0x161')});db['MailMessage'][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x42')][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{'as':_0x1fb5('0x62'),'foreignKey':'ChatWebsiteId'});db[_0x1fb5('0x42')][_0x1fb5('0x13e')](db[_0x1fb5('0x68')],{'as':_0x1fb5('0x68'),'foreignKey':'ChatOfflineMessageId'});db[_0x1fb5('0x43')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'onDelete':'restrict'});db[_0x1fb5('0x43')][_0x1fb5('0x13e')](db[_0x1fb5('0x3f')],{'onDelete':'restrict'});db[_0x1fb5('0x43')][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'onDelete':'restrict'});db[_0x1fb5('0x43')][_0x1fb5('0x13e')](db[_0x1fb5('0x7e')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x142')});db['MailApplication']['belongsTo'](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x165')});db[_0x1fb5('0x45')][_0x1fb5('0x13e')](db['MailAccount'],{});db['MailQueueReport']['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db['MailQueueReport'][_0x1fb5('0x13e')](db['CmContact'],{'as':'Contact','foreignKey':_0x1fb5('0x14c')});db['MailQueueReport']['belongsTo'](db[_0x1fb5('0x40')],{});db['MailQueueReport']['belongsTo'](db[_0x1fb5('0x42')],{});db['MailQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{});db['MailQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x3f')],{});db[_0x1fb5('0x166')]['hasMany'](db[_0x1fb5('0x48')],{'as':_0x1fb5('0x167'),'onDelete':'cascade'});db['FaxAccount'][_0x1fb5('0x108')](db['Disposition'],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x169'),'onDelete':'cascade'});db[_0x1fb5('0x4a')][_0x1fb5('0x108')](db['CannedAnswer'],{'as':_0x1fb5('0x16a'),'foreignKey':_0x1fb5('0x169')});db['FaxAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x4e')],{'as':_0x1fb5('0x153')});db[_0x1fb5('0x4a')][_0x1fb5('0x108')](db['FaxApplication'],{'as':_0x1fb5('0x154')});db[_0x1fb5('0x4a')][_0x1fb5('0x108')](db[_0x1fb5('0x16')],{'as':'Exntensions','onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x4a')][_0x1fb5('0x108')](db['FaxMessage'],{'as':'Messages'});db['FaxAccount'][_0x1fb5('0x13e')](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x2b')});db[_0x1fb5('0x4a')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':'List','foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x4a')]['belongsTo'](db[_0x1fb5('0x143')],{'as':_0x1fb5('0x159'),'foreignKey':_0x1fb5('0x144')});db[_0x1fb5('0x4a')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':'Agents','through':_0x1fb5('0x12f')});db[_0x1fb5('0x4c')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x4c')][_0x1fb5('0x13e')](db[_0x1fb5('0x51')],{'onDelete':_0x1fb5('0x164')});db['FaxApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x4a')],{'onDelete':_0x1fb5('0x164')});db['FaxApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'TagId'});db[_0x1fb5('0x4e')]['hasMany'](db[_0x1fb5('0x50')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1fb5('0x16b')});db[_0x1fb5('0x4e')][_0x1fb5('0x13e')](db[_0x1fb5('0x4a')],{'as':_0x1fb5('0x15c'),'foreignKey':'FaxAccountId'});db[_0x1fb5('0x4e')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':'ContactId'});db[_0x1fb5('0x4e')][_0x1fb5('0x13e')](db['User'],{'as':'Owner','foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x4e')]['belongsToMany'](db['Tag'],{'through':_0x1fb5('0x16c'),'as':_0x1fb5('0x16d')});db[_0x1fb5('0x4e')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x16c'),'as':_0x1fb5('0x15e')});db[_0x1fb5('0x4e')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x11f'),'foreignKey':_0x1fb5('0x16b')});db[_0x1fb5('0x50')]['belongsTo'](db[_0x1fb5('0x12')],{'onDelete':'cascade','as':_0x1fb5('0x12')});db['FaxMessage']['belongsTo'](db[_0x1fb5('0x4e')],{'as':'Interaction','foreignKey':_0x1fb5('0x16b')});db[_0x1fb5('0x50')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x14b')});db['FaxMessage']['belongsTo'](db[_0x1fb5('0xe7')],{'as':'Attachment','foreignKey':_0x1fb5('0x16e')});db['FaxMessage'][_0x1fb5('0x13e')](db['FaxAccount'],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x169')});db['FaxQueue']['belongsToMany'](db[_0x1fb5('0x12')],{'as':'Agents','through':_0x1fb5('0x125')});db[_0x1fb5('0x51')][_0x1fb5('0x119')](db['Team'],{'through':_0x1fb5('0x16f'),'as':_0x1fb5('0x15b')});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db['FaxAccount'],{});db['FaxQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':'ListId'});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db['CmContact'],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db[_0x1fb5('0x4e')],{});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db[_0x1fb5('0x50')],{});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{});db[_0x1fb5('0x52')][_0x1fb5('0x13e')](db['FaxQueue'],{});db[_0x1fb5('0x53')][_0x1fb5('0x108')](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x170'),'onDelete':_0x1fb5('0x106')});db['SmsAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x7b')],{'as':_0x1fb5('0x16a'),'foreignKey':_0x1fb5('0x170')});db[_0x1fb5('0x53')][_0x1fb5('0x108')](db[_0x1fb5('0x58')],{'as':_0x1fb5('0x152'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x56')],{'as':'Interactions'});db[_0x1fb5('0x53')]['hasMany'](db[_0x1fb5('0x55')],{'as':_0x1fb5('0x154')});db['SmsAccount'][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x53')]['belongsTo'](db[_0x1fb5('0x143')],{'as':_0x1fb5('0x159'),'foreignKey':_0x1fb5('0x144')});db['SmsAccount']['belongsToMany'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':'user_has_sms_accounts'});db[_0x1fb5('0x55')][_0x1fb5('0x13e')](db['User'],{'onDelete':_0x1fb5('0x164')});db['SmsApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x5a')],{'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x55')][_0x1fb5('0x13e')](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0x1fb5('0x7e')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0x55')][_0x1fb5('0x13e')](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'TagId'});db[_0x1fb5('0x56')]['hasMany'](db[_0x1fb5('0x58')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1fb5('0x171')});db[_0x1fb5('0x56')]['belongsTo'](db[_0x1fb5('0x53')],{'as':_0x1fb5('0x15c'),'foreignKey':'SmsAccountId'});db[_0x1fb5('0x56')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':'ContactId'});db[_0x1fb5('0x56')][_0x1fb5('0x13e')](db['User'],{'as':_0x1fb5('0x172'),'foreignKey':_0x1fb5('0x107')});db['SmsInteraction'][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x173'),'as':_0x1fb5('0x16d')});db[_0x1fb5('0x56')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x173'),'as':'ThroughTags'});db['SmsInteraction'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x120'),'foreignKey':_0x1fb5('0x171')});db[_0x1fb5('0x58')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x12')});db['SmsMessage'][_0x1fb5('0x13e')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x1fb5('0x58')][_0x1fb5('0x13e')](db['SmsInteraction'],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x163'),'foreignKey':_0x1fb5('0x171')});db[_0x1fb5('0x58')]['belongsTo'](db[_0x1fb5('0x53')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x170')});db[_0x1fb5('0x5a')]['belongsToMany'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x1fb5('0x5a')][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':'team_has_sms_queues','as':_0x1fb5('0x15b')});db['OpenchannelAccount']['hasMany'](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x174'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x175')]['hasMany'](db[_0x1fb5('0x7b')],{'as':_0x1fb5('0x16a'),'foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x175')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x1fb5('0x153'),'foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x175')][_0x1fb5('0x108')](db[_0x1fb5('0x5f')],{'as':_0x1fb5('0x152'),'foreignKey':_0x1fb5('0x174')});db['OpenchannelAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x5c')],{'as':'Applications','foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x175')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x175')][_0x1fb5('0x13e')](db[_0x1fb5('0x143')],{'as':'mandatoryDispositionPause','foreignKey':_0x1fb5('0x144')});db[_0x1fb5('0x175')][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x133')});db[_0x1fb5('0x5c')][_0x1fb5('0x13e')](db['User'],{'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x5c')][_0x1fb5('0x13e')](db[_0x1fb5('0x61')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x175')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x5c')][_0x1fb5('0x13e')](db[_0x1fb5('0x7e')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'IntervalId'});db[_0x1fb5('0x5c')]['belongsTo'](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':'TagId'});db['OpenchannelInteraction']['hasMany'](db[_0x1fb5('0x5f')],{'as':_0x1fb5('0x152'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x176')});db['OpenchannelInteraction'][_0x1fb5('0x13e')](db[_0x1fb5('0x175')],{'as':'Account','foreignKey':_0x1fb5('0x174')});db[_0x1fb5('0x177')]['belongsTo'](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db['OpenchannelInteraction']['belongsTo'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x172'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x177')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x178'),'as':_0x1fb5('0x16d')});db[_0x1fb5('0x177')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x178'),'as':_0x1fb5('0x15e')});db[_0x1fb5('0x177')]['belongsToMany'](db['User'],{'as':_0x1fb5('0x15f'),'through':'user_has_openchannel_interactions','foreignKey':_0x1fb5('0x176')});db[_0x1fb5('0x5f')]['belongsTo'](db['User'],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x12')});db[_0x1fb5('0x5f')][_0x1fb5('0x13e')](db['CmContact'],{'onDelete':_0x1fb5('0x106'),'as':'Contact'});db[_0x1fb5('0x5f')][_0x1fb5('0x13e')](db[_0x1fb5('0x177')],{'onDelete':_0x1fb5('0x106'),'as':'Interaction','foreignKey':_0x1fb5('0x176')});db[_0x1fb5('0x5f')][_0x1fb5('0x13e')](db['Attachment'],{'as':_0x1fb5('0xe7'),'foreignKey':_0x1fb5('0x16e')});db[_0x1fb5('0x5f')][_0x1fb5('0x13e')](db['OpenchannelAccount'],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x174')});db['OpenchannelQueue'][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':'UserOpenchannelQueue','foreignKey':_0x1fb5('0x179')});db['OpenchannelQueue'][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':'team_has_openchannel_queues','as':_0x1fb5('0x15b')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x17a'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db[_0x1fb5('0x7b')],{'as':'Answers','foreignKey':_0x1fb5('0x17a')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db[_0x1fb5('0x17b')],{'as':_0x1fb5('0x17c')});db['ChatWebsite'][_0x1fb5('0x108')](db['ChatInteraction'],{'as':_0x1fb5('0x153')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db['ChatApplication'],{'as':_0x1fb5('0x154')});db[_0x1fb5('0x62')][_0x1fb5('0x108')](db[_0x1fb5('0x67')],{'as':'Messages'});db[_0x1fb5('0x62')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x62')][_0x1fb5('0x13e')](db[_0x1fb5('0x7e')],{'as':_0x1fb5('0x7e'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0x1fb5('0x13e')](db[_0x1fb5('0x130')],{'as':_0x1fb5('0x130'),'foreignKey':_0x1fb5('0x14e')});db[_0x1fb5('0x62')][_0x1fb5('0x13e')](db[_0x1fb5('0x143')],{'as':_0x1fb5('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1fb5('0x62')][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x12d')});db['OpenchannelQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x175')],{});db[_0x1fb5('0x63')][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x63')]['belongsTo'](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x63')]['belongsTo'](db[_0x1fb5('0x177')],{});db[_0x1fb5('0x63')][_0x1fb5('0x13e')](db['OpenchannelMessage'],{});db[_0x1fb5('0x63')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{});db[_0x1fb5('0x63')][_0x1fb5('0x13e')](db[_0x1fb5('0x61')],{});db[_0x1fb5('0x64')][_0x1fb5('0x13e')](db['User'],{'as':_0x1fb5('0x17d'),'foreignKey':'UserId','onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x64')][_0x1fb5('0x13e')](db[_0x1fb5('0x69')],{'as':_0x1fb5('0x17e'),'foreignKey':_0x1fb5('0x17f'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x64')][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{'as':'Website','foreignKey':_0x1fb5('0x17a'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x64')][_0x1fb5('0x13e')](db['Tag'],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x165')});db[_0x1fb5('0x11d')]['hasMany'](db[_0x1fb5('0x67')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x1fb5('0x180')});db[_0x1fb5('0x11d')]['belongsTo'](db[_0x1fb5('0x62')],{'as':'Account','foreignKey':_0x1fb5('0x17a')});db[_0x1fb5('0x11d')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x11d')]['belongsTo'](db[_0x1fb5('0x12')],{'as':'Owner','foreignKey':_0x1fb5('0x107')});db['ChatInteraction']['belongsToMany'](db[_0x1fb5('0x87')],{'through':'chat_interaction_has_tags','as':_0x1fb5('0x16d')});db[_0x1fb5('0x11d')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x181'),'as':_0x1fb5('0x15e')});db[_0x1fb5('0x11d')]['belongsToMany'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':'user_has_chat_interactions','foreignKey':_0x1fb5('0x180')});db[_0x1fb5('0x67')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x12')});db[_0x1fb5('0x67')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x67')][_0x1fb5('0x13e')](db[_0x1fb5('0x11d')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x163'),'foreignKey':_0x1fb5('0x180')});db[_0x1fb5('0x67')][_0x1fb5('0x13e')](db[_0x1fb5('0xe7')],{'as':'Attachment','foreignKey':_0x1fb5('0x16e')});db['ChatMessage'][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x17a')});db[_0x1fb5('0x68')][_0x1fb5('0x108')](db[_0x1fb5('0xe7')],{'as':_0x1fb5('0x162'),'foreignKey':_0x1fb5('0x182'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db[_0x1fb5('0x68')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'onDelete':_0x1fb5('0x106'),'as':'Contact','foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x68')][_0x1fb5('0x13e')](db['ChatWebsite'],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x17a')});db[_0x1fb5('0x69')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x30'),'hooks':!![]});db[_0x1fb5('0x69')][_0x1fb5('0x119')](db[_0x1fb5('0xe1')],{'through':'team_has_chat_queues','as':_0x1fb5('0x15b')});db[_0x1fb5('0x116')][_0x1fb5('0x108')](db[_0x1fb5('0xcb')],{'as':_0x1fb5('0x152'),'foreignKey':_0x1fb5('0x183'),'onDelete':_0x1fb5('0x106')});db['ChatGroup']['belongsToMany'](db['User'],{'as':_0x1fb5('0x184'),'through':_0x1fb5('0x118')});db[_0x1fb5('0x17b')]['belongsTo'](db[_0x1fb5('0x62')],{'as':_0x1fb5('0x185'),'foreignKey':_0x1fb5('0x17a')});db['CmCompany'][_0x1fb5('0x108')](db[_0x1fb5('0x6d')],{'as':'Contacts','foreignKey':_0x1fb5('0x186')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0x6f')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db['CmHopperFinal'],{'as':_0x1fb5('0x10c'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0x73')],{'as':_0x1fb5('0x187'),'foreignKey':_0x1fb5('0x14c')});db['CmContact']['hasMany'](db[_0x1fb5('0x10e')],{'as':_0x1fb5('0x10e'),'foreignKey':'ContactId'});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0xd0')],{'as':_0x1fb5('0x13d'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0x177')],{'as':_0x1fb5('0x10f'),'foreignKey':'ContactId','onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db[_0x1fb5('0x11d')],{'as':_0x1fb5('0x110'),'foreignKey':_0x1fb5('0x14c'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x6d')][_0x1fb5('0x108')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x1fb5('0x14c'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x6d')]['hasMany'](db[_0x1fb5('0x4e')],{'as':'FaxInteractions','foreignKey':_0x1fb5('0x14c'),'onDelete':'restrict'});db[_0x1fb5('0x6d')]['hasMany'](db['MailInteraction'],{'as':_0x1fb5('0x188'),'foreignKey':_0x1fb5('0x14c'),'onDelete':'restrict'});db[_0x1fb5('0x6d')][_0x1fb5('0x13e')](db[_0x1fb5('0x189')],{'as':_0x1fb5('0x18a'),'foreignKey':'CompanyId'});db['CmContact'][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':'List','foreignKey':_0x1fb5('0x156'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x6d')]['belongsToMany'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x18b')});db['CmContact']['belongsToMany'](db[_0x1fb5('0x87')],{'as':'Tags','through':_0x1fb5('0x18c')});db[_0x1fb5('0x6d')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x18c'),'as':_0x1fb5('0x15e')});db['CmHopper']['belongsTo'](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c'),'onDelete':'cascade'});db[_0x1fb5('0x6f')][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x6f')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x17d'),'foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0x6f')]['belongsTo'](db[_0x1fb5('0x19')],{'as':'Queue','foreignKey':_0x1fb5('0x13b'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x6f')][_0x1fb5('0x13e')](db[_0x1fb5('0xe4')],{'as':_0x1fb5('0xe4'),'foreignKey':_0x1fb5('0x18d'),'onDelete':'cascade'});db[_0x1fb5('0x6f')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'as':'Owner','foreignKey':_0x1fb5('0x18e')});db[_0x1fb5('0x70')][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x70')][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':'ListId','onDelete':_0x1fb5('0x106')});db['CmHopperBlack'][_0x1fb5('0x13e')](db[_0x1fb5('0x19')],{'as':_0x1fb5('0x17e'),'foreignKey':_0x1fb5('0x13b'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x70')][_0x1fb5('0x13e')](db[_0x1fb5('0xe4')],{'as':_0x1fb5('0xe4'),'foreignKey':_0x1fb5('0x18d'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0x79')][_0x1fb5('0x108')](db['Condition'],{'as':{'plural':'All','singular':_0x1fb5('0x18f')},'foreignKey':_0x1fb5('0x190'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db[_0x1fb5('0x79')]['hasMany'](db[_0x1fb5('0x7d')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0x1fb5('0x191'),'foreignKey':_0x1fb5('0x192'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db['Disposition'][_0x1fb5('0x108')](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x193'),'onDelete':_0x1fb5('0x106')});db['Interval'][_0x1fb5('0x108')](db['Interval'],{'as':_0x1fb5('0x194'),'foreignKey':'IntervalId','onDelete':_0x1fb5('0x106'),'hooks':!![],'required':![]});db['Interval'][_0x1fb5('0x108')](db[_0x1fb5('0x16')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x1fb5('0x164')});db['Interval'][_0x1fb5('0x108')](db[_0x1fb5('0x43')],{'as':_0x1fb5('0x195'),'foreignKey':'IntervalId'});db[_0x1fb5('0x7e')]['hasMany'](db[_0x1fb5('0x64')],{'as':_0x1fb5('0x196'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0x7e')][_0x1fb5('0x108')](db[_0x1fb5('0x4c')],{'as':_0x1fb5('0x197'),'foreignKey':_0x1fb5('0x142')});db['Interval'][_0x1fb5('0x108')](db['SmsApplication'],{'as':_0x1fb5('0x198'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0x83')]['belongsTo'](db[_0x1fb5('0x130')],{});db[_0x1fb5('0x83')][_0x1fb5('0x13e')](db[_0x1fb5('0x92')],{'foreignKey':_0x1fb5('0x199')});db['Schedule'][_0x1fb5('0x13e')](db[_0x1fb5('0x90')],{'foreignKey':'CustomReportId'});db[_0x1fb5('0x85')][_0x1fb5('0x119')](db[_0x1fb5('0x13a')],{'as':'Mohs','through':_0x1fb5('0x19a'),'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x87')][_0x1fb5('0x119')](db[_0x1fb5('0x6d')],{'through':_0x1fb5('0x18c')});db[_0x1fb5('0x87')][_0x1fb5('0x119')](db[_0x1fb5('0x11d')],{'through':_0x1fb5('0x181')});db['Tag'][_0x1fb5('0x119')](db[_0x1fb5('0x40')],{'through':_0x1fb5('0x15d')});db['Tag']['belongsToMany'](db[_0x1fb5('0x56')],{'through':'sms_interaction_has_tags'});db[_0x1fb5('0x87')][_0x1fb5('0x119')](db[_0x1fb5('0x4e')],{'through':_0x1fb5('0x16c')});db['Tag']['belongsToMany'](db[_0x1fb5('0x177')],{'through':_0x1fb5('0x178')});db[_0x1fb5('0x87')][_0x1fb5('0x119')](db[_0x1fb5('0xfb')],{'through':_0x1fb5('0x19b')});db[_0x1fb5('0x19c')][_0x1fb5('0x108')](db['Condition'],{'as':{'plural':_0x1fb5('0x19d'),'singular':'AllCondition'},'foreignKey':_0x1fb5('0x19e'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db[_0x1fb5('0x19c')]['hasMany'](db[_0x1fb5('0x7d')],{'as':{'plural':_0x1fb5('0x19f'),'singular':_0x1fb5('0x1a0')},'foreignKey':'TriggerAnyId','onDelete':_0x1fb5('0x106'),'hooks':!![]});db['Trigger'][_0x1fb5('0x108')](db[_0x1fb5('0x77')],{'as':_0x1fb5('0x191'),'foreignKey':_0x1fb5('0x1a1'),'onDelete':_0x1fb5('0x106'),'hooks':!![]});db[_0x1fb5('0x90')][_0x1fb5('0x108')](db[_0x1fb5('0x95')],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a3'),'hooks':!![]});db[_0x1fb5('0x92')][_0x1fb5('0x108')](db[_0x1fb5('0x95')],{'as':_0x1fb5('0x1a2'),'onDelete':'cascade','foreignKey':_0x1fb5('0x199')});db['AnalyticMetric'][_0x1fb5('0x108')](db[_0x1fb5('0x95')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x1fb5('0x1a4')});db[_0x1fb5('0x95')][_0x1fb5('0x13e')](db[_0x1fb5('0x1a5')],{'foreignKey':_0x1fb5('0x1a4')});db[_0x1fb5('0x99')][_0x1fb5('0x108')](db[_0x1fb5('0x9b')],{'as':'Configurations','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0x9b')][_0x1fb5('0x108')](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1a7'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x1fb5('0x9b')][_0x1fb5('0x108')](db['SalesforceField'],{'as':_0x1fb5('0x1a8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0x1fb5('0x108')](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0x9b')][_0x1fb5('0x13e')](db[_0x1fb5('0x99')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x1fb5('0x108')](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0x9d')]['hasMany'](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1ac'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0x9d')][_0x1fb5('0x108')](db[_0x1fb5('0x9d')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db['SalesforceField']['belongsTo'](db['Variable'],{'as':_0x1fb5('0x1af'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0x1fb5('0x108')](db[_0x1fb5('0x1b0')],{'as':_0x1fb5('0x1b1'),'onDelete':'cascade','foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0x1b0')][_0x1fb5('0x108')](db[_0x1fb5('0xa1')],{'as':_0x1fb5('0x1a7'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ab')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x1fb5('0x1a8'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ad')});db['SugarcrmConfiguration'][_0x1fb5('0x108')](db[_0x1fb5('0xa1')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x1fb5('0x1b0')][_0x1fb5('0x13e')](db[_0x1fb5('0x9f')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xa1')]['hasMany'](db['SugarcrmField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x1fb5('0xa1')][_0x1fb5('0x108')](db[_0x1fb5('0xa1')],{'as':'Description','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xa1')]['hasMany'](db[_0x1fb5('0xa1')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db['SugarcrmField'][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':'Variable','foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0xa2')]['hasMany'](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x1fb5('0x106'),'foreignKey':'AccountId'});db[_0x1fb5('0xa4')][_0x1fb5('0x108')](db[_0x1fb5('0xa6')],{'as':_0x1fb5('0x1a7'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xa4')]['hasMany'](db[_0x1fb5('0xa6')],{'as':_0x1fb5('0x1a8'),'onDelete':'cascade','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xa4')][_0x1fb5('0x108')](db[_0x1fb5('0xa6')],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xa4')][_0x1fb5('0x13e')](db[_0x1fb5('0xa2')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xa4')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x1b3')});db[_0x1fb5('0xa6')][_0x1fb5('0x108')](db[_0x1fb5('0xa6')],{'as':'Subject','foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xa6')][_0x1fb5('0x108')](db[_0x1fb5('0xa6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x1fb5('0xa6')]['hasMany'](db['DeskField'],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db['DeskField'][_0x1fb5('0x13e')](db['Variable'],{'as':_0x1fb5('0x1af'),'foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0x1b4')][_0x1fb5('0x108')](db[_0x1fb5('0xa9')],{'as':_0x1fb5('0x1b1'),'onDelete':_0x1fb5('0x106'),'foreignKey':'AccountId'});db[_0x1fb5('0xa9')][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':_0x1fb5('0x1a7'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xa9')][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':_0x1fb5('0x1a8'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xa9')]['hasMany'](db['ZohoField'],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xa9')][_0x1fb5('0x13e')](db[_0x1fb5('0x1b4')],{'as':_0x1fb5('0x15c'),'foreignKey':'AccountId'});db[_0x1fb5('0xaa')][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':'Subject','foreignKey':_0x1fb5('0x1ab')});db['ZohoField'][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':_0x1fb5('0x1ac'),'foreignKey':_0x1fb5('0x1ad')});db['ZohoField'][_0x1fb5('0x108')](db[_0x1fb5('0xaa')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xaa')][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':'Variable','foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0x1b5')][_0x1fb5('0x108')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xad')][_0x1fb5('0x108')](db[_0x1fb5('0x1b6')],{'as':_0x1fb5('0x1a7'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xad')]['hasMany'](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xad')][_0x1fb5('0x108')](db['ZendeskField'],{'as':_0x1fb5('0x1a2'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xad')][_0x1fb5('0x13e')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xad')]['belongsToMany'](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x1b7')});db[_0x1fb5('0x1b6')][_0x1fb5('0x108')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0x1b6')][_0x1fb5('0x108')](db[_0x1fb5('0x1b6')],{'as':_0x1fb5('0x1ac'),'foreignKey':'DescriptionId'});db[_0x1fb5('0x1b6')][_0x1fb5('0x108')](db['ZendeskField'],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0x1b6')][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':_0x1fb5('0x1af'),'foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0xb0')][_0x1fb5('0x108')](db[_0x1fb5('0xb2')],{'as':_0x1fb5('0x1b1'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xb2')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1a7'),'onDelete':'cascade','foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xb2')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1a8'),'onDelete':_0x1fb5('0x106'),'foreignKey':'DescriptionId'});db[_0x1fb5('0xb2')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':'Fields','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xb2')][_0x1fb5('0x13e')](db[_0x1fb5('0xb0')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db['FreshdeskConfiguration'][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x1b8')});db['FreshdeskField'][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xb4')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1ac'),'foreignKey':'DescriptionId'});db[_0x1fb5('0xb4')][_0x1fb5('0x108')](db[_0x1fb5('0xb4')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xb4')]['belongsTo'](db[_0x1fb5('0x1af')],{'as':_0x1fb5('0x1af'),'foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0xb5')][_0x1fb5('0x108')](db[_0x1fb5('0xb7')],{'as':_0x1fb5('0x1b1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x1fb5('0xb7')][_0x1fb5('0x108')](db[_0x1fb5('0xb8')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x1fb5('0xb7')][_0x1fb5('0x108')](db[_0x1fb5('0xb8')],{'as':_0x1fb5('0x1a8'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xb7')][_0x1fb5('0x108')](db['VtigerField'],{'as':_0x1fb5('0x1a2'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0x1fb5('0x13e')](db['VtigerAccount'],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db['VtigerField'][_0x1fb5('0x108')](db[_0x1fb5('0xb8')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db['VtigerField']['hasMany'](db[_0x1fb5('0xb8')],{'as':'Description','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xb8')][_0x1fb5('0x108')](db[_0x1fb5('0xb8')],{'as':_0x1fb5('0x1ae'),'foreignKey':'FieldId'});db['VtigerField'][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':_0x1fb5('0x1af'),'foreignKey':'VariableId'});db[_0x1fb5('0xba')][_0x1fb5('0x108')](db[_0x1fb5('0xbc')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x1fb5('0x1a6')});db['ServicenowConfiguration'][_0x1fb5('0x108')](db[_0x1fb5('0x1b9')],{'as':_0x1fb5('0x1a7'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xbc')][_0x1fb5('0x108')](db[_0x1fb5('0x1b9')],{'as':_0x1fb5('0x1a8'),'foreignKey':_0x1fb5('0x1ad')});db['ServicenowConfiguration'][_0x1fb5('0x108')](db['ServicenowField'],{'as':_0x1fb5('0x1a2'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xbc')][_0x1fb5('0x13e')](db[_0x1fb5('0xba')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0x1b9')][_0x1fb5('0x108')](db[_0x1fb5('0x1b9')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db['ServicenowField'][_0x1fb5('0x108')](db['ServicenowField'],{'as':_0x1fb5('0x1ac'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0x1b9')]['hasMany'](db['ServicenowField'],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0x1b9')][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':'Variable','foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0x1ba')][_0x1fb5('0x108')](db[_0x1fb5('0xc0')],{'as':'Configurations','onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0xc0')]['hasMany'](db[_0x1fb5('0xc2')],{'as':_0x1fb5('0x1a7'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xc0')]['hasMany'](db[_0x1fb5('0xc2')],{'as':_0x1fb5('0x1a8'),'onDelete':'cascade','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xc0')][_0x1fb5('0x108')](db[_0x1fb5('0xc2')],{'as':_0x1fb5('0x1a2'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xc0')][_0x1fb5('0x13e')](db[_0x1fb5('0x1ba')],{'as':_0x1fb5('0x15c'),'foreignKey':'AccountId'});db[_0x1fb5('0xc2')][_0x1fb5('0x108')](db[_0x1fb5('0xc2')],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xc2')][_0x1fb5('0x108')](db[_0x1fb5('0xc2')],{'as':'Description','foreignKey':_0x1fb5('0x1ad')});db['Dynamics365Field'][_0x1fb5('0x108')](db[_0x1fb5('0xc2')],{'as':'Field','foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0xc2')][_0x1fb5('0x13e')](db[_0x1fb5('0x1af')],{'as':_0x1fb5('0x1af'),'foreignKey':_0x1fb5('0x1b2')});db[_0x1fb5('0xc4')][_0x1fb5('0x108')](db[_0x1fb5('0xc6')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x1fb5('0xc6')][_0x1fb5('0x108')](db[_0x1fb5('0x1bb')],{'as':_0x1fb5('0x1a7'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0xc6')][_0x1fb5('0x108')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0xc6')][_0x1fb5('0x108')](db[_0x1fb5('0x1bb')],{'as':_0x1fb5('0x1a2'),'foreignKey':_0x1fb5('0x1a9')});db['FreshsalesConfiguration']['belongsTo'](db[_0x1fb5('0xc4')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1a6')});db[_0x1fb5('0x1bb')][_0x1fb5('0x108')](db['FreshsalesField'],{'as':_0x1fb5('0x1aa'),'foreignKey':_0x1fb5('0x1ab')});db[_0x1fb5('0x1bb')][_0x1fb5('0x108')](db['FreshsalesField'],{'as':_0x1fb5('0x1ac'),'foreignKey':_0x1fb5('0x1ad')});db[_0x1fb5('0x1bb')]['hasMany'](db[_0x1fb5('0x1bb')],{'as':_0x1fb5('0x1ae'),'foreignKey':_0x1fb5('0x1a9')});db[_0x1fb5('0x1bb')][_0x1fb5('0x13e')](db['Variable'],{'as':'Variable','foreignKey':_0x1fb5('0x1b2')});db['ChatQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{});db[_0x1fb5('0x1bc')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0x1bc')][_0x1fb5('0x13e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['ChatQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x11d')],{});db['ChatQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x67')],{});db[_0x1fb5('0x1bc')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{});db[_0x1fb5('0x1bc')]['belongsTo'](db[_0x1fb5('0x69')],{});db[_0x1fb5('0xcb')][_0x1fb5('0x13e')](db['User'],{'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1bd')});db[_0x1fb5('0xcb')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x1be')});db['JscriptySessionReport'][_0x1fb5('0x108')](db[_0x1fb5('0x1bf')],{'foreignKey':_0x1fb5('0x1c0'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xd0')][_0x1fb5('0x108')](db[_0x1fb5('0xcd')],{'foreignKey':_0x1fb5('0x1c0'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db['SmsAccount'],{});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db['CmList'],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db['SmsQueueReport'][_0x1fb5('0x13e')](db['CmContact'],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db['SmsInteraction'],{});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db['SmsMessage'],{});db['SmsQueueReport']['belongsTo'](db[_0x1fb5('0x12')],{});db[_0x1fb5('0xd2')][_0x1fb5('0x13e')](db[_0x1fb5('0x5a')],{});db[_0x1fb5('0xd7')][_0x1fb5('0x108')](db[_0x1fb5('0xd0')],{'foreignKey':_0x1fb5('0x1c1')});db[_0x1fb5('0xd7')][_0x1fb5('0x108')](db[_0x1fb5('0x1bf')],{'foreignKey':_0x1fb5('0x1c1')});db[_0x1fb5('0xd7')][_0x1fb5('0x108')](db['JscriptyAnswerReport'],{'foreignKey':_0x1fb5('0x1c1')});db['SquareProject'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x137')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db['User'],{'as':'Agents','through':_0x1fb5('0x11c')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db[_0x1fb5('0x19')],{'through':_0x1fb5('0x104'),'as':_0x1fb5('0x122')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db['MailQueue'],{'through':_0x1fb5('0x15a'),'as':_0x1fb5('0x123')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db['ChatQueue'],{'through':_0x1fb5('0x1c2'),'as':'ChatQueues'});db['Team'][_0x1fb5('0x119')](db[_0x1fb5('0x51')],{'through':'team_has_fax_queues','as':_0x1fb5('0x124')});db['Team'][_0x1fb5('0x119')](db[_0x1fb5('0x5a')],{'through':_0x1fb5('0x1c3'),'as':_0x1fb5('0x126')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db['OpenchannelQueue'],{'through':_0x1fb5('0x1c4'),'as':_0x1fb5('0x127')});db[_0x1fb5('0xe1')][_0x1fb5('0x119')](db[_0x1fb5('0x128')],{'through':_0x1fb5('0x1c5'),'as':_0x1fb5('0x129')});db[_0x1fb5('0xe4')][_0x1fb5('0x108')](db[_0x1fb5('0x6f')],{'as':_0x1fb5('0x1c6'),'foreignKey':_0x1fb5('0x18d')});db['Campaign'][_0x1fb5('0x108')](db[_0x1fb5('0x71')],{'as':_0x1fb5('0x10c'),'foreignKey':_0x1fb5('0x18d')});db[_0x1fb5('0xe4')][_0x1fb5('0x108')](db[_0x1fb5('0x73')],{'as':_0x1fb5('0x187'),'foreignKey':_0x1fb5('0x18d')});db[_0x1fb5('0xe4')]['hasMany'](db['CmHopperBlack'],{'as':_0x1fb5('0x13c'),'foreignKey':'CampaignId'});db['Campaign'][_0x1fb5('0x13e')](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x2b'),'foreignKey':_0x1fb5('0x13f')});db['Campaign']['belongsTo'](db[_0x1fb5('0x2b')],{'as':_0x1fb5('0x140'),'foreignKey':_0x1fb5('0x141')});db[_0x1fb5('0xe4')][_0x1fb5('0x13e')](db[_0x1fb5('0x7e')],{'as':_0x1fb5('0x7e'),'foreignKey':_0x1fb5('0x142')});db[_0x1fb5('0xe4')][_0x1fb5('0x13e')](db[_0x1fb5('0xdc')],{'as':'SquareProject','foreignKey':_0x1fb5('0x1c7')});db[_0x1fb5('0xe4')][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x145'),'through':'campaigns_has_cm_lists'});db[_0x1fb5('0xe4')][_0x1fb5('0x119')](db[_0x1fb5('0xf0')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0x1fb5('0xe7')]['belongsTo'](db[_0x1fb5('0x68')],{'as':_0x1fb5('0x68'),'foreignKey':_0x1fb5('0x182')});db[_0x1fb5('0xea')][_0x1fb5('0x13e')](db[_0x1fb5('0x42')],{});db[_0x1fb5('0xea')][_0x1fb5('0x13e')](db[_0x1fb5('0x40')],{});db['MailTransferReport'][_0x1fb5('0x13e')](db['MailAccount'],{'foreignKey':_0x1fb5('0x1c8'),'as':'FromAccount'});db['MailTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':'FromUserId','as':_0x1fb5('0x1c9')});db[_0x1fb5('0xea')][_0x1fb5('0x13e')](db['User'],{'foreignKey':'ToUserId','as':_0x1fb5('0x1ca')});db[_0x1fb5('0xea')][_0x1fb5('0x13e')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x1fb5('0x1cb')});db[_0x1fb5('0xea')]['belongsTo'](db[_0x1fb5('0x130')],{'foreignKey':_0x1fb5('0x1cc'),'as':_0x1fb5('0x1cd')});db['ChatTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x67')],{});db[_0x1fb5('0x1ce')]['belongsTo'](db[_0x1fb5('0x11d')],{});db['ChatTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x62')],{'foreignKey':_0x1fb5('0x1cf'),'as':'FromAccount'});db[_0x1fb5('0x1ce')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0x1ce')][_0x1fb5('0x13e')](db['User'],{'foreignKey':_0x1fb5('0x1d1'),'as':_0x1fb5('0x1ca')});db[_0x1fb5('0x1ce')][_0x1fb5('0x13e')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x1fb5('0x1cb')});db[_0x1fb5('0x1ce')]['belongsTo'](db[_0x1fb5('0x62')],{'foreignKey':_0x1fb5('0x1d2'),'as':_0x1fb5('0x1cd')});db[_0x1fb5('0x1d3')]['belongsTo'](db[_0x1fb5('0x50')],{});db['FaxTransferReport']['belongsTo'](db[_0x1fb5('0x4e')],{});db[_0x1fb5('0x1d3')][_0x1fb5('0x13e')](db[_0x1fb5('0x4a')],{'foreignKey':_0x1fb5('0x1d4'),'as':'FromAccount'});db['FaxTransferReport'][_0x1fb5('0x13e')](db['User'],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0x1d3')]['belongsTo'](db['User'],{'foreignKey':_0x1fb5('0x1d1'),'as':_0x1fb5('0x1ca')});db[_0x1fb5('0x1d3')][_0x1fb5('0x13e')](db[_0x1fb5('0x51')],{'foreignKey':'ToFaxQueueId','as':_0x1fb5('0x1cb')});db[_0x1fb5('0x1d3')]['belongsTo'](db[_0x1fb5('0x4a')],{'foreignKey':'ToFaxAccountId','as':_0x1fb5('0x1cd')});db[_0x1fb5('0xec')][_0x1fb5('0x13e')](db[_0x1fb5('0x5f')],{});db['OpenchannelTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x177')],{});db[_0x1fb5('0xec')]['belongsTo'](db[_0x1fb5('0x175')],{'foreignKey':_0x1fb5('0x1d5'),'as':_0x1fb5('0x1d6')});db[_0x1fb5('0xec')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0xec')][_0x1fb5('0x13e')](db['User'],{'foreignKey':_0x1fb5('0x1d1'),'as':_0x1fb5('0x1ca')});db['OpenchannelTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x61')],{'foreignKey':_0x1fb5('0x1d7'),'as':_0x1fb5('0x1cb')});db['OpenchannelTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x175')],{'foreignKey':_0x1fb5('0x1d8'),'as':_0x1fb5('0x1cd')});db[_0x1fb5('0xee')][_0x1fb5('0x13e')](db[_0x1fb5('0x58')],{});db[_0x1fb5('0xee')][_0x1fb5('0x13e')](db[_0x1fb5('0x56')],{});db['SmsTransferReport'][_0x1fb5('0x13e')](db['SmsAccount'],{'foreignKey':_0x1fb5('0x1d9'),'as':_0x1fb5('0x1d6')});db[_0x1fb5('0xee')][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0xee')]['belongsTo'](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d1'),'as':_0x1fb5('0x1ca')});db[_0x1fb5('0xee')][_0x1fb5('0x13e')](db[_0x1fb5('0x5a')],{'foreignKey':_0x1fb5('0x1da'),'as':_0x1fb5('0x1cb')});db['SmsTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x53')],{'foreignKey':_0x1fb5('0x1db'),'as':_0x1fb5('0x1cd')});db[_0x1fb5('0xf0')]['hasMany'](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':_0x1fb5('0x156'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xf0')][_0x1fb5('0x108')](db[_0x1fb5('0x75')],{'as':'CustomFields','foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf0')][_0x1fb5('0x108')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x11a'),'onDelete':_0x1fb5('0x106'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf0')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x1fb5('0xf0')][_0x1fb5('0x108')](db[_0x1fb5('0x73')],{'as':_0x1fb5('0x10d'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf0')][_0x1fb5('0x108')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf0')][_0x1fb5('0x119')](db[_0x1fb5('0x19')],{'as':'Queues','through':_0x1fb5('0x1dc')});db[_0x1fb5('0xf0')][_0x1fb5('0x119')](db['User'],{'as':_0x1fb5('0x146'),'through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x1fb5('0x16')],{'as':_0x1fb5('0x10b'),'onDelete':_0x1fb5('0x106')});db['VoicePrefix'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x12b')});db[_0x1fb5('0xf2')][_0x1fb5('0x108')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'foreignKey':'userProfileId'});db[_0x1fb5('0xf2')][_0x1fb5('0x108')](db[_0x1fb5('0xf3')],{'as':'UserProfileSections','foreignKey':_0x1fb5('0x115'),'onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xf3')]['hasMany'](db[_0x1fb5('0xf5')],{'as':_0x1fb5('0x1dd'),'foreignKey':_0x1fb5('0x1de'),'onDelete':'cascade'});db[_0x1fb5('0xf9')][_0x1fb5('0x108')](db[_0x1fb5('0x151')],{'as':_0x1fb5('0x168'),'foreignKey':'WhatsappAccountId','onDelete':_0x1fb5('0x106')});db[_0x1fb5('0xf9')][_0x1fb5('0x108')](db[_0x1fb5('0x7b')],{'as':_0x1fb5('0x16a'),'foreignKey':_0x1fb5('0x1df')});db['WhatsappAccount']['hasMany'](db[_0x1fb5('0xfd')],{'as':_0x1fb5('0x152'),'foreignKey':_0x1fb5('0x1df')});db[_0x1fb5('0xf9')]['hasMany'](db[_0x1fb5('0xfb')],{'as':_0x1fb5('0x153')});db['WhatsappAccount']['hasMany'](db[_0x1fb5('0x1e0')],{'as':'Applications'});db[_0x1fb5('0xf9')]['belongsTo'](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xf9')][_0x1fb5('0x13e')](db[_0x1fb5('0x143')],{'as':_0x1fb5('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1fb5('0xf9')][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x135')});db['WhatsappApplication'][_0x1fb5('0x13e')](db['User'],{'onDelete':_0x1fb5('0x164')});db['WhatsappApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0x128')],{'onDelete':_0x1fb5('0x164')});db['WhatsappApplication'][_0x1fb5('0x13e')](db[_0x1fb5('0xf9')],{'onDelete':_0x1fb5('0x164')});db[_0x1fb5('0x1e0')][_0x1fb5('0x13e')](db['Interval'],{'onDelete':_0x1fb5('0x164'),'foreignKey':'IntervalId'});db[_0x1fb5('0x1e0')][_0x1fb5('0x13e')](db[_0x1fb5('0x87')],{'onDelete':_0x1fb5('0x164'),'foreignKey':_0x1fb5('0x165')});db[_0x1fb5('0xfb')][_0x1fb5('0x108')](db[_0x1fb5('0xfd')],{'as':'Messages','onDelete':_0x1fb5('0x106'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x1fb5('0x13e')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x1fb5('0x1df')});db['WhatsappInteraction'][_0x1fb5('0x13e')](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0xfb')][_0x1fb5('0x13e')](db['User'],{'as':'Owner','foreignKey':_0x1fb5('0x107')});db[_0x1fb5('0xfb')][_0x1fb5('0x119')](db[_0x1fb5('0x87')],{'through':_0x1fb5('0x19b'),'as':_0x1fb5('0x16d')});db[_0x1fb5('0xfb')][_0x1fb5('0x119')](db['Tag'],{'through':_0x1fb5('0x19b'),'as':_0x1fb5('0x15e')});db['WhatsappInteraction'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x15f'),'through':_0x1fb5('0x1e1'),'foreignKey':_0x1fb5('0x1e2')});db[_0x1fb5('0xfd')]['belongsTo'](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x12')});db['WhatsappMessage'][_0x1fb5('0x13e')](db['CmContact'],{'onDelete':'cascade','as':_0x1fb5('0x14b')});db['WhatsappMessage'][_0x1fb5('0x13e')](db[_0x1fb5('0xfb')],{'onDelete':_0x1fb5('0x106'),'as':_0x1fb5('0x163'),'foreignKey':_0x1fb5('0x1e2')});db[_0x1fb5('0xfd')]['belongsTo'](db[_0x1fb5('0xf9')],{'as':_0x1fb5('0x15c'),'foreignKey':_0x1fb5('0x1df')});db[_0x1fb5('0xff')][_0x1fb5('0x13e')](db['WhatsappAccount'],{});db[_0x1fb5('0xff')][_0x1fb5('0x13e')](db[_0x1fb5('0xf0')],{'as':_0x1fb5('0x155'),'foreignKey':_0x1fb5('0x156')});db[_0x1fb5('0xff')]['belongsTo'](db[_0x1fb5('0x6d')],{'as':_0x1fb5('0x14b'),'foreignKey':_0x1fb5('0x14c')});db[_0x1fb5('0xff')][_0x1fb5('0x13e')](db[_0x1fb5('0xfb')],{});db[_0x1fb5('0xff')]['belongsTo'](db[_0x1fb5('0x128')],{});db['WhatsappQueueReport'][_0x1fb5('0x13e')](db[_0x1fb5('0xfd')],{});db[_0x1fb5('0xff')]['belongsTo'](db['User'],{});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db['WhatsappMessage'],{});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db[_0x1fb5('0xfb')],{});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db[_0x1fb5('0xf9')],{'foreignKey':_0x1fb5('0x1e4'),'as':_0x1fb5('0x1d6')});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db[_0x1fb5('0xf9')],{'foreignKey':_0x1fb5('0x1e5'),'as':'ToAccount'});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db['WhatsappQueue'],{'foreignKey':_0x1fb5('0x1e6'),'as':_0x1fb5('0x1cb')});db['WhatsappTransferReport'][_0x1fb5('0x13e')](db[_0x1fb5('0x12')],{'foreignKey':_0x1fb5('0x1d0'),'as':_0x1fb5('0x1c9')});db[_0x1fb5('0x1e3')][_0x1fb5('0x13e')](db['User'],{'foreignKey':'ToUserId','as':_0x1fb5('0x1ca')});db['WhatsappQueue'][_0x1fb5('0x119')](db[_0x1fb5('0x12')],{'as':_0x1fb5('0x146'),'through':_0x1fb5('0x39'),'foreignKey':'WhatsappQueueId'});db[_0x1fb5('0x128')][_0x1fb5('0x119')](db['Team'],{'through':_0x1fb5('0x1c5'),'as':_0x1fb5('0x15b')});module[_0x1fb5('0x1e7')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xcfa4=['sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','OpenchannelAccountId','OpenchannelAccount','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','Condition','All','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Sound','Mohs','mail_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','Configurations','DeskField','int_zendesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Field','FreshsalesConfiguration','FromId','SessionId','ProjectId','JscriptyAnswerReport','VoiceQueues','FaxQueues','team_has_sms_queues','team_has_whatsapp_queues','WhatsappQueues','TrunkId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','FromAccount','FromAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','Queues','user_has_voice_prefixes','userProfileId','UserProfileSections','Resources','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','defaultsDeep','motion2','utf8_general_ci','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userMailQueue/userMailQueue.model','../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','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','FaxQueue','FaxQueueReport','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','Integration','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','UserProfileResource','UserNotification','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','UserId','hasMany','VoiceQueuesRt','Extensions','cascade','CmHopperFinal','HopperFinals','ReportAgentPreview','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','belongsTo','chat_group_has_users','belongsToMany','Lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueue','MailQueues','ChatQueues','UserFaxQueue','SmsQueue','SmsQueues','cm_user_has_lists','VoicePrefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperHistory','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPauseId','CmList','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','hasOne','Imap','Answers','Messages','Interactions','List','ListId','mandatoryDispositionPause','UserMailQueue','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','Items','Dispositions','FaxAccountId','Applications','Exntensions','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId'];(function(_0x54e63b,_0x4123c6){var _0x2efef2=function(_0x1b896c){while(--_0x1b896c){_0x54e63b['push'](_0x54e63b['shift']());}};_0x2efef2(++_0x4123c6);}(_0xcfa4,0x73));var _0x4cfa=function(_0x25614a,_0x2540fa){_0x25614a=_0x25614a-0x0;var _0x1a1495=_0xcfa4[_0x25614a];return _0x1a1495;};'use strict';var config=require(_0x4cfa('0x0'));var Sequelize=require(_0x4cfa('0x1'));var _=require(_0x4cfa('0x2'));var jstz=require(_0x4cfa('0x3'));var timezone=jstz[_0x4cfa('0x4')]();config[_0x4cfa('0x1')]=_['defaultsDeep'](config[_0x4cfa('0x1')],{'database':'motion2','username':_0x4cfa('0x5'),'password':_0x4cfa('0x6'),'options':{'host':_0x4cfa('0x7'),'port':0xcea,'dialect':_0x4cfa('0x8'),'dialectOptions':{'charset':_0x4cfa('0x9')},'logging':![],'timezone':timezone[_0x4cfa('0xa')](),'define':{'charset':_0x4cfa('0xb'),'collate':'utf8_general_ci'}}});config[_0x4cfa('0xc')]=_[_0x4cfa('0xd')](config[_0x4cfa('0xc')],{'database':_0x4cfa('0xe'),'username':_0x4cfa('0x5'),'password':_0x4cfa('0x6'),'options':{'host':_0x4cfa('0x7'),'port':0xcea,'dialect':_0x4cfa('0x8'),'dialectOptions':{'charset':_0x4cfa('0x9')},'logging':![],'timezone':timezone[_0x4cfa('0xa')](),'define':{'charset':_0x4cfa('0xb'),'collate':_0x4cfa('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4cfa('0x1')][_0x4cfa('0x10')],config[_0x4cfa('0x1')][_0x4cfa('0x11')],config[_0x4cfa('0x1')][_0x4cfa('0x12')],config[_0x4cfa('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4cfa('0xc')][_0x4cfa('0x10')],config[_0x4cfa('0xc')][_0x4cfa('0x11')],config['sequelizeHistory'][_0x4cfa('0x12')],config[_0x4cfa('0xc')][_0x4cfa('0x13')])};db[_0x4cfa('0x14')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x16'));db[_0x4cfa('0x17')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x18'));db[_0x4cfa('0x19')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x1a'));db[_0x4cfa('0x1b')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x1c'));db[_0x4cfa('0x1d')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x1e'));db['VoiceQueue']=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x1f'));db[_0x4cfa('0x20')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x21'));db[_0x4cfa('0x22')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x23'));db[_0x4cfa('0x24')]=db['sequelize']['import'](_0x4cfa('0x25'));db[_0x4cfa('0x26')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x27'));db[_0x4cfa('0x28')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x29'));db[_0x4cfa('0x2a')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x4cfa('0x2b')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x2c'));db[_0x4cfa('0x2d')]=db['sequelize']['import'](_0x4cfa('0x2e'));db[_0x4cfa('0x2f')]=db['sequelize']['import'](_0x4cfa('0x30'));db[_0x4cfa('0x31')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x32'));db[_0x4cfa('0x33')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x34'));db[_0x4cfa('0x35')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x36'));db[_0x4cfa('0x37')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x38'));db['UserChatQueue']=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x39'));db['UserFaxQueue']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x3a'));db[_0x4cfa('0x3b')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x3c'));db[_0x4cfa('0x3d')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x3e'));db[_0x4cfa('0x3f')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x4cfa('0x40')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x41'));db[_0x4cfa('0x42')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x43'));db[_0x4cfa('0x44')]=db['sequelize']['import']('../api/mailAccount/mailAccount.model');db[_0x4cfa('0x45')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x46'));db[_0x4cfa('0x47')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x48'));db['MailInteraction']=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x49'));db[_0x4cfa('0x4a')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/mailMessage/mailMessage.model');db[_0x4cfa('0x4b')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x4c'));db[_0x4cfa('0x4d')]=db['sequelize']['import'](_0x4cfa('0x4e'));db[_0x4cfa('0x4f')]=db['sequelize']['import']('../api/dashboard/dashboard.model');db[_0x4cfa('0x50')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x51'));db[_0x4cfa('0x52')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x53'));db[_0x4cfa('0x54')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x55'));db[_0x4cfa('0x56')]=db[_0x4cfa('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x4cfa('0x57')]=db[_0x4cfa('0x1')]['import']('../api/faxMessage/faxMessage.model');db[_0x4cfa('0x58')]=db[_0x4cfa('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0x4cfa('0x59')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x5a'));db['SmsApplication']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x5b'));db[_0x4cfa('0x5c')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/smsInteraction/smsInteraction.model');db[_0x4cfa('0x5d')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x5e'));db['SmsQueue']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x5f'));db['OpenchannelAccount']=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x60'));db[_0x4cfa('0x61')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0x4cfa('0x62')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x63'));db[_0x4cfa('0x64')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x65'));db[_0x4cfa('0x66')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x67'));db[_0x4cfa('0x68')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x4cfa('0x69')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x6a'));db['ChatInteraction']=db['sequelize']['import'](_0x4cfa('0x6b'));db[_0x4cfa('0x6c')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x6d'));db['ChatOfflineMessage']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x6e'));db[_0x4cfa('0x6f')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x70'));db[_0x4cfa('0x71')]=db[_0x4cfa('0x1')]['import']('../api/chatGroup/chatGroup.model');db[_0x4cfa('0x72')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x73'));db[_0x4cfa('0x74')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x75'));db[_0x4cfa('0x76')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x77'));db[_0x4cfa('0x78')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x79'));db[_0x4cfa('0x7a')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x7b'));db['CmHopperFinal']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x7c'));db['CmHopperHistory']=db['sequelize'][_0x4cfa('0x15')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x7d'));db['CmCustomField']=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x7e'));db[_0x4cfa('0x7f')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x80'));db[_0x4cfa('0x81')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x82'));db[_0x4cfa('0x83')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/cannedAnswer/cannedAnswer.model');db[_0x4cfa('0x84')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x85'));db['Condition']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x86'));db[_0x4cfa('0x87')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x88'));db['Pause']=db['sequelize'][_0x4cfa('0x15')]('../api/pause/pause.model');db['Cdr']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x89'));db['VoiceQueuesLog']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x8a'));db[_0x4cfa('0x8b')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0x8c'));db['Sound']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x8d'));db[_0x4cfa('0x8e')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x8f'));db[_0x4cfa('0x90')]=db['sequelize'][_0x4cfa('0x15')]('../api/template/template.model');db[_0x4cfa('0x91')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/trigger/trigger.model');db['Variable']=db['sequelize'][_0x4cfa('0x15')]('../api/variable/variable.model');db[_0x4cfa('0x92')]=db[_0x4cfa('0x1')]['import']('../api/integration/integration.model');db[_0x4cfa('0x93')]=db['sequelize'][_0x4cfa('0x15')]('../api/integrationReport/integrationReport.model');db[_0x4cfa('0x94')]=db['sequelize'][_0x4cfa('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x4cfa('0x95')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x4cfa('0x96')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x97'));db['AnalyticMetric']=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/analyticMetric/analyticMetric.model');db[_0x4cfa('0x98')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x99'));db['AnalyticTreeReport']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x9a'));db[_0x4cfa('0x9b')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x9c'));db[_0x4cfa('0x9d')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x9e'));db[_0x4cfa('0x9f')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0x4cfa('0xa0')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xa1'));db[_0x4cfa('0xa2')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xa3'));db[_0x4cfa('0xa4')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xa5'));db[_0x4cfa('0xa6')]=db[_0x4cfa('0x1')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x4cfa('0xa7')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0xa8'));db['DeskField']=db[_0x4cfa('0x1')]['import'](_0x4cfa('0xa9'));db[_0x4cfa('0xaa')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xab'));db[_0x4cfa('0xac')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0xad'));db[_0x4cfa('0xae')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xaf'));db[_0x4cfa('0xb0')]=db['sequelize'][_0x4cfa('0x15')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x4cfa('0xb1')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xb2'));db[_0x4cfa('0xb3')]=db['sequelize'][_0x4cfa('0x15')]('../api/intZendeskField/intZendeskField.model');db[_0x4cfa('0xb4')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xb5'));db[_0x4cfa('0xb6')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xb7'));db[_0x4cfa('0xb8')]=db['sequelize'][_0x4cfa('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x4cfa('0xb9')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xba'));db[_0x4cfa('0xbb')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xbc'));db[_0x4cfa('0xbd')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xbe'));db[_0x4cfa('0xbf')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0xc0'));db['ServicenowConfiguration']=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x4cfa('0xc1')]=db['sequelize'][_0x4cfa('0x15')]('../api/intServicenowField/intServicenowField.model');db[_0x4cfa('0xc2')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xc3'));db[_0x4cfa('0xc4')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x4cfa('0xc5')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xc6'));db['FreshsalesConfiguration']=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x4cfa('0xc7')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xc8'));db[_0x4cfa('0x92')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xc9'));db[_0x4cfa('0xca')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xcb'));db[_0x4cfa('0xcc')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xcd'));db[_0x4cfa('0xce')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0xcf'));db['JscriptyAnswerReport']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xd0'));db[_0x4cfa('0xd1')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0xd2'));db['JscriptySessionReport']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xd3'));db[_0x4cfa('0xd4')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0xd5'));db[_0x4cfa('0xd6')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0xd7'));db[_0x4cfa('0xd8')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0xd9'));db[_0x4cfa('0xda')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xdb'));db[_0x4cfa('0xdc')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xdd'));db[_0x4cfa('0xde')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/squareOdbc/squareOdbc.model');db[_0x4cfa('0xdf')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xe0'));db[_0x4cfa('0xe1')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xe2'));db[_0x4cfa('0xe3')]=db['sequelize']['import'](_0x4cfa('0xe4'));db[_0x4cfa('0xe5')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xe6'));db['License']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xe7'));db[_0x4cfa('0xe8')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xe9'));db[_0x4cfa('0xea')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0xeb'));db[_0x4cfa('0xec')]=db['sequelize'][_0x4cfa('0x15')]('../api/attachment/attachment.model');db[_0x4cfa('0xed')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0xee'));db[_0x4cfa('0xef')]=db[_0x4cfa('0x1')]['import'](_0x4cfa('0xf0'));db[_0x4cfa('0xf1')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xf2'));db['FaxTransferReport']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xf3'));db[_0x4cfa('0xf4')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xf5'));db['SmsTransferReport']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0xf6'));db['CmList']=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0xf7'));db[_0x4cfa('0xf8')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0xf9'));db[_0x4cfa('0xfa')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/userProfile/userProfile.model');db[_0x4cfa('0xfb')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/userProfileSection/userProfileSection.model');db[_0x4cfa('0xfc')]=db['sequelize'][_0x4cfa('0x15')]('../api/userProfileResource/userProfileResource.model');db[_0x4cfa('0xfd')]=db[_0x4cfa('0x1')]['import']('../api/userNotification/userNotification.model');db[_0x4cfa('0xfe')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/whatsappAccount/whatsappAccount.model');db[_0x4cfa('0xff')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x100'));db[_0x4cfa('0x101')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x102'));db['WhatsappMessage']=db[_0x4cfa('0x1')][_0x4cfa('0x15')]('../api/whatsappMessage/whatsappMessage.model');db[_0x4cfa('0x103')]=db[_0x4cfa('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x4cfa('0x104')]=db['sequelize'][_0x4cfa('0x15')](_0x4cfa('0x105'));db[_0x4cfa('0x106')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x107'));db[_0x4cfa('0x108')]=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x109'));db['TeamVoiceQueue']=db[_0x4cfa('0x1')][_0x4cfa('0x15')](_0x4cfa('0x10a'));db['User']['hasOne'](db[_0x4cfa('0x24')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x14')][_0x4cfa('0x10c')](db[_0x4cfa('0x20')],{'as':'Recordings','foreignKey':_0x4cfa('0x10b')});db['User'][_0x4cfa('0x10c')](db[_0x4cfa('0x35')],{'as':_0x4cfa('0x10d'),'foreignKey':_0x4cfa('0x10b')});db['User']['hasMany'](db[_0x4cfa('0x1b')],{'as':_0x4cfa('0x10e'),'onDelete':_0x4cfa('0x10f'),'hooks':!![]});db[_0x4cfa('0x14')]['hasMany'](db[_0x4cfa('0x110')],{'as':_0x4cfa('0x111'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x14')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x4cfa('0x10b')});db['User'][_0x4cfa('0x10c')](db[_0x4cfa('0x112')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db['User'][_0x4cfa('0x10c')](db[_0x4cfa('0x62')],{'as':_0x4cfa('0x113'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x14')]['hasMany'](db[_0x4cfa('0x114')],{'as':_0x4cfa('0x115'),'foreignKey':_0x4cfa('0x10b')});db['User'][_0x4cfa('0x10c')](db[_0x4cfa('0x5c')],{'as':_0x4cfa('0x116'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x14')]['hasMany'](db[_0x4cfa('0x56')],{'as':_0x4cfa('0x117'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x14')][_0x4cfa('0x10c')](db[_0x4cfa('0x118')],{'as':_0x4cfa('0x119'),'foreignKey':_0x4cfa('0x10b')});db['User']['hasMany'](db[_0x4cfa('0x101')],{'as':'WhatsappInteractions','foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x14')]['hasMany'](db[_0x4cfa('0xfd')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0x4cfa('0x14')][_0x4cfa('0x11a')](db['UserProfile'],{'as':_0x4cfa('0xfa'),'foreignKey':'userProfileId'});db[_0x4cfa('0x14')]['belongsToMany'](db[_0x4cfa('0x71')],{'as':'Groups','through':_0x4cfa('0x11b')});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0x76')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db['CmList'],{'as':_0x4cfa('0x11d'),'through':'cm_user_has_lists'});db['User']['belongsToMany'](db[_0x4cfa('0xe5')],{'through':_0x4cfa('0x11e')});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0x118')],{'as':_0x4cfa('0x119'),'through':'user_has_mail_interactions'});db['User']['belongsToMany'](db[_0x4cfa('0x114')],{'as':_0x4cfa('0x115'),'through':_0x4cfa('0x11f')});db['User'][_0x4cfa('0x11c')](db[_0x4cfa('0x56')],{'as':_0x4cfa('0x117'),'through':_0x4cfa('0x120')});db['User'][_0x4cfa('0x11c')](db[_0x4cfa('0x5c')],{'as':_0x4cfa('0x116'),'through':'user_has_sms_interactions'});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0x62')],{'as':_0x4cfa('0x113'),'through':_0x4cfa('0x121')});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0x101')],{'as':_0x4cfa('0x122'),'through':_0x4cfa('0x123')});db[_0x4cfa('0x14')]['belongsToMany'](db[_0x4cfa('0x124')],{'as':'VoiceQueues','through':_0x4cfa('0x37'),'required':![]});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0x45')],{'as':_0x4cfa('0x125'),'through':'UserMailQueue','required':![]});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0x6f')],{'as':_0x4cfa('0x126'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x4cfa('0x11c')](db[_0x4cfa('0x58')],{'as':'FaxQueues','through':_0x4cfa('0x127'),'required':![]});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0x128')],{'as':_0x4cfa('0x129'),'through':_0x4cfa('0x3b'),'required':![]});db[_0x4cfa('0x14')]['belongsToMany'](db[_0x4cfa('0x64')],{'as':'OpenchannelQueues','through':_0x4cfa('0x3d'),'required':![]});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x4cfa('0x3f'),'required':![]});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db['CmList'],{'through':_0x4cfa('0x12a')});db['User'][_0x4cfa('0x11c')](db['VoicePrefix'],{'as':_0x4cfa('0x12b'),'through':'user_has_voice_prefixes','required':![]});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0x66')],{'as':_0x4cfa('0x12c'),'through':_0x4cfa('0x12d')});db[_0x4cfa('0x14')]['belongsToMany'](db[_0x4cfa('0x52')],{'as':_0x4cfa('0x12e'),'through':_0x4cfa('0x12f')});db[_0x4cfa('0x14')]['belongsToMany'](db['MailAccount'],{'as':_0x4cfa('0x130'),'through':_0x4cfa('0x131')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':_0x4cfa('0x132'),'through':_0x4cfa('0x133')});db[_0x4cfa('0x14')]['belongsToMany'](db[_0x4cfa('0x134')],{'as':_0x4cfa('0x135'),'through':'user_has_sms_accounts'});db[_0x4cfa('0x14')]['belongsToMany'](db[_0x4cfa('0xfe')],{'as':_0x4cfa('0x136'),'through':_0x4cfa('0x137')});db[_0x4cfa('0x14')][_0x4cfa('0x11c')](db[_0x4cfa('0xdf')],{'as':_0x4cfa('0x138'),'through':'user_has_square_projects'});db[_0x4cfa('0x17')][_0x4cfa('0x10c')](db[_0x4cfa('0x1b')],{'as':_0x4cfa('0x139'),'onDelete':'cascade','foreignKey':_0x4cfa('0x13a')});db[_0x4cfa('0x19')][_0x4cfa('0x10c')](db[_0x4cfa('0x1b')],{'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x1b')]['hasMany'](db[_0x4cfa('0x1b')],{'as':'Applications','onDelete':_0x4cfa('0x10f')});db['VoiceMusicOnHold'][_0x4cfa('0x11c')](db['Sound'],{'as':'Sounds','through':_0x4cfa('0x13b')});db['VoiceQueue'][_0x4cfa('0x10c')](db['UserVoiceQueueRt'],{'as':_0x4cfa('0x13c'),'foreignKey':_0x4cfa('0x13d')});db[_0x4cfa('0x124')]['hasMany'](db['CmHopper'],{'as':_0x4cfa('0x13e'),'foreignKey':_0x4cfa('0x13d')});db[_0x4cfa('0x124')][_0x4cfa('0x10c')](db[_0x4cfa('0x110')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x4cfa('0x124')]['hasMany'](db[_0x4cfa('0x13f')],{'as':'HopperHistories','foreignKey':_0x4cfa('0x13d')});db[_0x4cfa('0x124')][_0x4cfa('0x10c')](db[_0x4cfa('0x112')],{'as':_0x4cfa('0x112'),'foreignKey':_0x4cfa('0x13d')});db[_0x4cfa('0x124')][_0x4cfa('0x10c')](db[_0x4cfa('0x7a')],{'as':_0x4cfa('0x140'),'foreignKey':_0x4cfa('0x13d')});db[_0x4cfa('0x124')][_0x4cfa('0x10c')](db[_0x4cfa('0x141')],{'as':_0x4cfa('0x142'),'foreignKey':_0x4cfa('0x13d')});db[_0x4cfa('0x124')][_0x4cfa('0x11a')](db['Trunk'],{'as':_0x4cfa('0x31'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0x4cfa('0x11a')](db[_0x4cfa('0x31')],{'as':_0x4cfa('0x143'),'foreignKey':_0x4cfa('0x144')});db[_0x4cfa('0x124')][_0x4cfa('0x11a')](db['Interval'],{'as':_0x4cfa('0x87'),'foreignKey':_0x4cfa('0x145')});db[_0x4cfa('0x124')][_0x4cfa('0x11a')](db[_0x4cfa('0x146')],{'as':'mandatoryDispositionPause','foreignKey':_0x4cfa('0x147')});db[_0x4cfa('0x124')][_0x4cfa('0x11c')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x11d'),'through':_0x4cfa('0x149')});db[_0x4cfa('0x124')][_0x4cfa('0x11c')](db['User'],{'as':_0x4cfa('0x14a'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x4cfa('0x11c')](db[_0x4cfa('0xe5')],{'as':'Teams','through':_0x4cfa('0x14b')});db[_0x4cfa('0x124')][_0x4cfa('0x11c')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x14c'),'through':_0x4cfa('0x14d')});db[_0x4cfa('0x20')]['belongsTo'](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x22')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':'User','foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x24')][_0x4cfa('0x10c')](db[_0x4cfa('0x26')],{'as':'Messages','onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x14e'),'sourceKey':_0x4cfa('0x14f')});db[_0x4cfa('0x26')]['belongsTo'](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x4cfa('0x14f')});db[_0x4cfa('0x28')][_0x4cfa('0x10c')](db[_0x4cfa('0x2d')],{'as':_0x4cfa('0x150'),'foreignKey':_0x4cfa('0x151'),'constraints':![]});db[_0x4cfa('0x28')]['hasMany'](db[_0x4cfa('0x2b')],{'as':'AgentReports','foreignKey':_0x4cfa('0x151'),'constraints':![]});db[_0x4cfa('0x28')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x28')]['belongsTo'](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x40')]['belongsTo'](db[_0x4cfa('0x44')],{'as':'MailAccount','foreignKey':_0x4cfa('0x154')});db['MailServerOut'][_0x4cfa('0x11a')](db[_0x4cfa('0x44')],{'as':'MailAccount','foreignKey':_0x4cfa('0x154')});db[_0x4cfa('0x44')][_0x4cfa('0x155')](db[_0x4cfa('0x40')],{'as':_0x4cfa('0x156'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x44')][_0x4cfa('0x155')](db[_0x4cfa('0x42')],{'as':'Smtp','onDelete':_0x4cfa('0x10f')});db['MailAccount'][_0x4cfa('0x10c')](db[_0x4cfa('0x84')],{'as':'Dispositions','foreignKey':_0x4cfa('0x154'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x44')][_0x4cfa('0x10c')](db['CannedAnswer'],{'as':_0x4cfa('0x157'),'foreignKey':_0x4cfa('0x154')});db['MailAccount']['hasMany'](db[_0x4cfa('0x4a')],{'as':_0x4cfa('0x158'),'foreignKey':_0x4cfa('0x154')});db[_0x4cfa('0x44')][_0x4cfa('0x10c')](db[_0x4cfa('0x118')],{'as':_0x4cfa('0x159')});db[_0x4cfa('0x44')][_0x4cfa('0x10c')](db[_0x4cfa('0x4b')],{'as':'Applications'});db['MailAccount']['belongsTo'](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':_0x4cfa('0x15b')});db['MailAccount'][_0x4cfa('0x11a')](db[_0x4cfa('0x90')],{'as':_0x4cfa('0x90'),'foreignKey':'TemplateId'});db[_0x4cfa('0x44')][_0x4cfa('0x11a')](db[_0x4cfa('0x146')],{'as':_0x4cfa('0x15c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4cfa('0x44')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':'Agents','through':_0x4cfa('0x131')});db[_0x4cfa('0x45')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':_0x4cfa('0x15d')});db[_0x4cfa('0x45')][_0x4cfa('0x11c')](db['Team'],{'through':_0x4cfa('0x15e'),'as':_0x4cfa('0x15f')});db['MailInteraction'][_0x4cfa('0x10c')](db[_0x4cfa('0x4a')],{'as':_0x4cfa('0x158'),'onDelete':'cascade','foreignKey':_0x4cfa('0x160')});db[_0x4cfa('0x118')][_0x4cfa('0x11a')](db[_0x4cfa('0x44')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x154')});db[_0x4cfa('0x118')][_0x4cfa('0x11a')](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x118')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x162'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x118')][_0x4cfa('0x11c')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x4cfa('0x163')});db['MailInteraction'][_0x4cfa('0x11c')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x4cfa('0x164')});db[_0x4cfa('0x118')][_0x4cfa('0x11c')](db['User'],{'as':_0x4cfa('0x165'),'through':_0x4cfa('0x166'),'foreignKey':_0x4cfa('0x160')});db[_0x4cfa('0x4a')]['hasMany'](db[_0x4cfa('0xec')],{'as':_0x4cfa('0x167'),'onDelete':_0x4cfa('0x10f')});db['MailMessage'][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':'User'});db[_0x4cfa('0x4a')][_0x4cfa('0x11a')](db[_0x4cfa('0x76')],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x152')});db[_0x4cfa('0x4a')][_0x4cfa('0x11a')](db[_0x4cfa('0x118')],{'as':_0x4cfa('0x168'),'foreignKey':_0x4cfa('0x160')});db[_0x4cfa('0x4a')]['belongsTo'](db['MailAccount'],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x154')});db[_0x4cfa('0x4a')][_0x4cfa('0x11a')](db[_0x4cfa('0x66')],{'as':_0x4cfa('0x66'),'foreignKey':_0x4cfa('0x169')});db[_0x4cfa('0x4a')][_0x4cfa('0x11a')](db[_0x4cfa('0x16a')],{'as':_0x4cfa('0x16a'),'foreignKey':_0x4cfa('0x16b')});db[_0x4cfa('0x4b')]['belongsTo'](db[_0x4cfa('0x14')],{'onDelete':'restrict'});db[_0x4cfa('0x4b')][_0x4cfa('0x11a')](db[_0x4cfa('0x45')],{'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x4b')]['belongsTo'](db[_0x4cfa('0x44')],{'onDelete':_0x4cfa('0x16c')});db['MailApplication'][_0x4cfa('0x11a')](db['Interval'],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x145')});db['MailApplication'][_0x4cfa('0x11a')](db[_0x4cfa('0x8e')],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x16d')});db[_0x4cfa('0x4d')][_0x4cfa('0x11a')](db[_0x4cfa('0x44')],{});db[_0x4cfa('0x4d')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':'List','foreignKey':'ListId'});db[_0x4cfa('0x4d')]['belongsTo'](db['CmContact'],{'as':_0x4cfa('0x152'),'foreignKey':'ContactId'});db[_0x4cfa('0x4d')]['belongsTo'](db[_0x4cfa('0x118')],{});db[_0x4cfa('0x4d')]['belongsTo'](db['MailMessage'],{});db[_0x4cfa('0x4d')]['belongsTo'](db[_0x4cfa('0x14')],{});db[_0x4cfa('0x4d')][_0x4cfa('0x11a')](db[_0x4cfa('0x45')],{});db[_0x4cfa('0x4f')][_0x4cfa('0x10c')](db[_0x4cfa('0x50')],{'as':_0x4cfa('0x16e'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x52')][_0x4cfa('0x10c')](db[_0x4cfa('0x84')],{'as':_0x4cfa('0x16f'),'foreignKey':_0x4cfa('0x170'),'onDelete':'cascade'});db[_0x4cfa('0x52')]['hasMany'](db['CannedAnswer'],{'as':_0x4cfa('0x157'),'foreignKey':_0x4cfa('0x170')});db[_0x4cfa('0x52')][_0x4cfa('0x10c')](db[_0x4cfa('0x56')],{'as':'Interactions'});db[_0x4cfa('0x52')][_0x4cfa('0x10c')](db[_0x4cfa('0x54')],{'as':_0x4cfa('0x171')});db['FaxAccount']['hasMany'](db[_0x4cfa('0x1b')],{'as':_0x4cfa('0x172'),'onDelete':'cascade'});db[_0x4cfa('0x52')][_0x4cfa('0x10c')](db[_0x4cfa('0x57')],{'as':_0x4cfa('0x158')});db[_0x4cfa('0x52')]['belongsTo'](db[_0x4cfa('0x31')],{'as':'Trunk'});db[_0x4cfa('0x52')]['belongsTo'](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x52')][_0x4cfa('0x11a')](db[_0x4cfa('0x146')],{'as':_0x4cfa('0x15c'),'foreignKey':_0x4cfa('0x147')});db[_0x4cfa('0x52')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':_0x4cfa('0x12f')});db['FaxApplication'][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'onDelete':'restrict'});db[_0x4cfa('0x54')][_0x4cfa('0x11a')](db[_0x4cfa('0x58')],{'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x54')][_0x4cfa('0x11a')](db[_0x4cfa('0x52')],{'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x54')]['belongsTo'](db['Tag'],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x16d')});db[_0x4cfa('0x56')]['hasMany'](db[_0x4cfa('0x57')],{'as':_0x4cfa('0x158'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x173')});db[_0x4cfa('0x56')][_0x4cfa('0x11a')](db['FaxAccount'],{'as':'Account','foreignKey':_0x4cfa('0x170')});db['FaxInteraction']['belongsTo'](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':'ContactId'});db['FaxInteraction'][_0x4cfa('0x11a')](db['User'],{'as':_0x4cfa('0x162'),'foreignKey':'UserId'});db['FaxInteraction'][_0x4cfa('0x11c')](db[_0x4cfa('0x8e')],{'through':_0x4cfa('0x174'),'as':_0x4cfa('0x163')});db[_0x4cfa('0x56')][_0x4cfa('0x11c')](db[_0x4cfa('0x8e')],{'through':'fax_interaction_has_tags','as':_0x4cfa('0x164')});db[_0x4cfa('0x56')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x165'),'through':'user_has_fax_interactions','foreignKey':_0x4cfa('0x173')});db['FaxMessage'][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'onDelete':'cascade','as':_0x4cfa('0x14')});db[_0x4cfa('0x57')][_0x4cfa('0x11a')](db[_0x4cfa('0x56')],{'as':'Interaction','foreignKey':_0x4cfa('0x173')});db[_0x4cfa('0x57')][_0x4cfa('0x11a')](db['CmContact'],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x152')});db['FaxMessage'][_0x4cfa('0x11a')](db[_0x4cfa('0xec')],{'as':_0x4cfa('0xec'),'foreignKey':_0x4cfa('0x175')});db[_0x4cfa('0x57')]['belongsTo'](db[_0x4cfa('0x52')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x170')});db[_0x4cfa('0x58')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':'UserFaxQueue'});db[_0x4cfa('0x58')][_0x4cfa('0x11c')](db[_0x4cfa('0xe5')],{'through':_0x4cfa('0x176'),'as':_0x4cfa('0x15f')});db[_0x4cfa('0x59')][_0x4cfa('0x11a')](db[_0x4cfa('0x52')],{});db[_0x4cfa('0x59')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x59')][_0x4cfa('0x11a')](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db['FaxQueueReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x56')],{});db['FaxQueueReport']['belongsTo'](db[_0x4cfa('0x57')],{});db[_0x4cfa('0x59')][_0x4cfa('0x11a')](db['User'],{});db['FaxQueueReport']['belongsTo'](db[_0x4cfa('0x58')],{});db[_0x4cfa('0x134')][_0x4cfa('0x10c')](db[_0x4cfa('0x84')],{'as':_0x4cfa('0x16f'),'foreignKey':_0x4cfa('0x177'),'onDelete':_0x4cfa('0x10f')});db['SmsAccount'][_0x4cfa('0x10c')](db['CannedAnswer'],{'as':_0x4cfa('0x157'),'foreignKey':_0x4cfa('0x177')});db[_0x4cfa('0x134')][_0x4cfa('0x10c')](db[_0x4cfa('0x5d')],{'as':'Messages','foreignKey':_0x4cfa('0x177')});db[_0x4cfa('0x134')][_0x4cfa('0x10c')](db['SmsInteraction'],{'as':_0x4cfa('0x159')});db[_0x4cfa('0x134')]['hasMany'](db['SmsApplication'],{'as':_0x4cfa('0x171')});db[_0x4cfa('0x134')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':'List','foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x134')][_0x4cfa('0x11a')](db[_0x4cfa('0x146')],{'as':_0x4cfa('0x15c'),'foreignKey':_0x4cfa('0x147')});db[_0x4cfa('0x134')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':'Agents','through':'user_has_sms_accounts'});db[_0x4cfa('0x178')]['belongsTo'](db['User'],{'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x178')][_0x4cfa('0x11a')](db[_0x4cfa('0x128')],{'onDelete':_0x4cfa('0x16c')});db['SmsApplication'][_0x4cfa('0x11a')](db[_0x4cfa('0x134')],{'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x178')][_0x4cfa('0x11a')](db[_0x4cfa('0x87')],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x145')});db['SmsApplication'][_0x4cfa('0x11a')](db[_0x4cfa('0x8e')],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x16d')});db['SmsInteraction'][_0x4cfa('0x10c')](db[_0x4cfa('0x5d')],{'as':_0x4cfa('0x158'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x179')});db[_0x4cfa('0x5c')][_0x4cfa('0x11a')](db[_0x4cfa('0x134')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x177')});db['SmsInteraction'][_0x4cfa('0x11a')](db['CmContact'],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x5c')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x162'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x5c')][_0x4cfa('0x11c')](db[_0x4cfa('0x8e')],{'through':_0x4cfa('0x17a'),'as':_0x4cfa('0x163')});db[_0x4cfa('0x5c')]['belongsToMany'](db[_0x4cfa('0x8e')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x4cfa('0x5c')][_0x4cfa('0x11c')](db['User'],{'as':'Users','through':_0x4cfa('0x17b'),'foreignKey':'SmsInteractionId'});db[_0x4cfa('0x5d')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14')});db[_0x4cfa('0x5d')][_0x4cfa('0x11a')](db['CmContact'],{'onDelete':_0x4cfa('0x10f'),'as':'Contact'});db[_0x4cfa('0x5d')]['belongsTo'](db[_0x4cfa('0x5c')],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x168'),'foreignKey':_0x4cfa('0x179')});db[_0x4cfa('0x5d')][_0x4cfa('0x11a')](db['SmsAccount'],{'as':'Account','foreignKey':_0x4cfa('0x177')});db[_0x4cfa('0x128')]['belongsToMany'](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':_0x4cfa('0x3b'),'foreignKey':_0x4cfa('0x17c')});db[_0x4cfa('0x128')][_0x4cfa('0x11c')](db[_0x4cfa('0xe5')],{'through':'team_has_sms_queues','as':_0x4cfa('0x15f')});db['OpenchannelAccount']['hasMany'](db[_0x4cfa('0x84')],{'as':_0x4cfa('0x16f'),'foreignKey':_0x4cfa('0x17d'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x17e')][_0x4cfa('0x10c')](db[_0x4cfa('0x83')],{'as':_0x4cfa('0x157'),'foreignKey':_0x4cfa('0x17d')});db[_0x4cfa('0x17e')][_0x4cfa('0x10c')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x4cfa('0x17d')});db[_0x4cfa('0x17e')][_0x4cfa('0x10c')](db[_0x4cfa('0x17f')],{'as':_0x4cfa('0x158'),'foreignKey':_0x4cfa('0x17d')});db[_0x4cfa('0x17e')][_0x4cfa('0x10c')](db[_0x4cfa('0x61')],{'as':_0x4cfa('0x171'),'foreignKey':_0x4cfa('0x17d')});db[_0x4cfa('0x17e')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':'ListId'});db['OpenchannelAccount']['belongsTo'](db[_0x4cfa('0x146')],{'as':_0x4cfa('0x15c'),'foreignKey':_0x4cfa('0x147')});db['OpenchannelAccount'][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':'Agents','through':_0x4cfa('0x133')});db[_0x4cfa('0x61')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x61')][_0x4cfa('0x11a')](db[_0x4cfa('0x64')],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x180')});db[_0x4cfa('0x61')]['belongsTo'](db[_0x4cfa('0x17e')],{'onDelete':'restrict','foreignKey':_0x4cfa('0x17d')});db[_0x4cfa('0x61')][_0x4cfa('0x11a')](db[_0x4cfa('0x87')],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x145')});db[_0x4cfa('0x61')][_0x4cfa('0x11a')](db['Tag'],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x16d')});db['OpenchannelInteraction'][_0x4cfa('0x10c')](db[_0x4cfa('0x17f')],{'as':_0x4cfa('0x158'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x181')});db['OpenchannelInteraction']['belongsTo'](db[_0x4cfa('0x17e')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x17d')});db[_0x4cfa('0x62')]['belongsTo'](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x62')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x162'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x62')][_0x4cfa('0x11c')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x4cfa('0x163')});db[_0x4cfa('0x62')][_0x4cfa('0x11c')](db[_0x4cfa('0x8e')],{'through':_0x4cfa('0x182'),'as':'ThroughTags'});db[_0x4cfa('0x62')][_0x4cfa('0x11c')](db['User'],{'as':_0x4cfa('0x165'),'through':'user_has_openchannel_interactions','foreignKey':_0x4cfa('0x181')});db[_0x4cfa('0x17f')][_0x4cfa('0x11a')](db['User'],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x14')});db[_0x4cfa('0x17f')][_0x4cfa('0x11a')](db[_0x4cfa('0x76')],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x152')});db['OpenchannelMessage'][_0x4cfa('0x11a')](db['OpenchannelInteraction'],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x168'),'foreignKey':_0x4cfa('0x181')});db[_0x4cfa('0x17f')]['belongsTo'](db[_0x4cfa('0xec')],{'as':_0x4cfa('0xec'),'foreignKey':_0x4cfa('0x175')});db['OpenchannelMessage'][_0x4cfa('0x11a')](db[_0x4cfa('0x17e')],{'as':_0x4cfa('0x161'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue']['belongsToMany'](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':_0x4cfa('0x3d'),'foreignKey':'OpenchannelQueueId'});db[_0x4cfa('0x64')][_0x4cfa('0x11c')](db['Team'],{'through':_0x4cfa('0x183'),'as':_0x4cfa('0x15f')});db[_0x4cfa('0x66')]['hasMany'](db[_0x4cfa('0x84')],{'as':'Dispositions','foreignKey':_0x4cfa('0x169'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x66')][_0x4cfa('0x10c')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x4cfa('0x169')});db[_0x4cfa('0x66')][_0x4cfa('0x10c')](db[_0x4cfa('0x72')],{'as':_0x4cfa('0x184')});db[_0x4cfa('0x66')][_0x4cfa('0x10c')](db[_0x4cfa('0x114')],{'as':_0x4cfa('0x159')});db[_0x4cfa('0x66')][_0x4cfa('0x10c')](db['ChatApplication'],{'as':_0x4cfa('0x171')});db[_0x4cfa('0x66')]['hasMany'](db[_0x4cfa('0x6c')],{'as':_0x4cfa('0x158')});db[_0x4cfa('0x66')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':'List','foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x66')][_0x4cfa('0x11a')](db[_0x4cfa('0x87')],{'as':'Interval','foreignKey':'IntervalId'});db['ChatWebsite'][_0x4cfa('0x11a')](db[_0x4cfa('0x44')],{'as':_0x4cfa('0x44'),'foreignKey':_0x4cfa('0x154')});db[_0x4cfa('0x66')][_0x4cfa('0x11a')](db[_0x4cfa('0x146')],{'as':_0x4cfa('0x15c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4cfa('0x66')]['belongsToMany'](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':_0x4cfa('0x12d')});db[_0x4cfa('0x68')][_0x4cfa('0x11a')](db[_0x4cfa('0x17e')],{});db['OpenchannelQueueReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x68')][_0x4cfa('0x11a')](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':'ContactId'});db[_0x4cfa('0x68')][_0x4cfa('0x11a')](db[_0x4cfa('0x62')],{});db[_0x4cfa('0x68')][_0x4cfa('0x11a')](db[_0x4cfa('0x17f')],{});db[_0x4cfa('0x68')][_0x4cfa('0x11a')](db['User'],{});db['OpenchannelQueueReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x64')],{});db['ChatApplication'][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x185'),'foreignKey':_0x4cfa('0x10b'),'onDelete':_0x4cfa('0x16c')});db['ChatApplication'][_0x4cfa('0x11a')](db[_0x4cfa('0x6f')],{'as':_0x4cfa('0x186'),'foreignKey':_0x4cfa('0x187'),'onDelete':_0x4cfa('0x16c')});db['ChatApplication'][_0x4cfa('0x11a')](db[_0x4cfa('0x66')],{'as':_0x4cfa('0x188'),'foreignKey':_0x4cfa('0x169'),'onDelete':_0x4cfa('0x16c')});db['ChatApplication'][_0x4cfa('0x11a')](db['Tag'],{'onDelete':_0x4cfa('0x16c'),'foreignKey':_0x4cfa('0x16d')});db[_0x4cfa('0x114')]['hasMany'](db['ChatMessage'],{'as':_0x4cfa('0x158'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x189')});db[_0x4cfa('0x114')][_0x4cfa('0x11a')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x4cfa('0x114')][_0x4cfa('0x11a')](db['User'],{'as':_0x4cfa('0x162'),'foreignKey':'UserId'});db[_0x4cfa('0x114')]['belongsToMany'](db['Tag'],{'through':_0x4cfa('0x18a'),'as':_0x4cfa('0x163')});db[_0x4cfa('0x114')][_0x4cfa('0x11c')](db[_0x4cfa('0x8e')],{'through':_0x4cfa('0x18a'),'as':'ThroughTags'});db['ChatInteraction'][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x165'),'through':_0x4cfa('0x11f'),'foreignKey':_0x4cfa('0x189')});db[_0x4cfa('0x6c')][_0x4cfa('0x11a')](db['User'],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x14')});db[_0x4cfa('0x6c')]['belongsTo'](db[_0x4cfa('0x76')],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x6c')][_0x4cfa('0x11a')](db[_0x4cfa('0x114')],{'onDelete':_0x4cfa('0x10f'),'as':'Interaction','foreignKey':_0x4cfa('0x189')});db['ChatMessage'][_0x4cfa('0x11a')](db[_0x4cfa('0xec')],{'as':_0x4cfa('0xec'),'foreignKey':_0x4cfa('0x175')});db['ChatMessage'][_0x4cfa('0x11a')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x4cfa('0x16a')][_0x4cfa('0x10c')](db[_0x4cfa('0xec')],{'as':_0x4cfa('0x167'),'foreignKey':_0x4cfa('0x16b'),'onDelete':_0x4cfa('0x10f'),'hooks':!![]});db[_0x4cfa('0x16a')]['belongsTo'](db[_0x4cfa('0x76')],{'onDelete':_0x4cfa('0x10f'),'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db['ChatOfflineMessage'][_0x4cfa('0x11a')](db[_0x4cfa('0x66')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x169')});db[_0x4cfa('0x6f')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':_0x4cfa('0x18b'),'hooks':!![]});db['ChatQueue'][_0x4cfa('0x11c')](db['Team'],{'through':_0x4cfa('0x18c'),'as':_0x4cfa('0x15f')});db[_0x4cfa('0x71')][_0x4cfa('0x10c')](db[_0x4cfa('0xce')],{'as':'Messages','foreignKey':_0x4cfa('0x18d'),'onDelete':_0x4cfa('0x10f')});db['ChatGroup'][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x13c'),'through':_0x4cfa('0x11b')});db[_0x4cfa('0x72')][_0x4cfa('0x11a')](db['ChatWebsite'],{'as':_0x4cfa('0x188'),'foreignKey':_0x4cfa('0x169')});db[_0x4cfa('0x74')][_0x4cfa('0x10c')](db['CmContact'],{'as':_0x4cfa('0x18e'),'foreignKey':_0x4cfa('0x18f')});db[_0x4cfa('0x76')][_0x4cfa('0x10c')](db[_0x4cfa('0x78')],{'as':'Hoppers','foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x76')]['hasMany'](db[_0x4cfa('0x110')],{'as':_0x4cfa('0x111'),'foreignKey':'ContactId'});db[_0x4cfa('0x76')][_0x4cfa('0x10c')](db[_0x4cfa('0x13f')],{'as':'HopperHistories','foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x76')][_0x4cfa('0x10c')](db[_0x4cfa('0x112')],{'as':'ReportAgentPreview','foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x76')][_0x4cfa('0x10c')](db[_0x4cfa('0x141')],{'as':_0x4cfa('0x142'),'foreignKey':'ContactId'});db['CmContact'][_0x4cfa('0x10c')](db[_0x4cfa('0x62')],{'as':_0x4cfa('0x113'),'foreignKey':_0x4cfa('0x153'),'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x76')][_0x4cfa('0x10c')](db['ChatInteraction'],{'as':_0x4cfa('0x115'),'foreignKey':_0x4cfa('0x153'),'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x76')]['hasMany'](db[_0x4cfa('0x5c')],{'as':_0x4cfa('0x116'),'foreignKey':'ContactId','onDelete':_0x4cfa('0x16c')});db['CmContact'][_0x4cfa('0x10c')](db[_0x4cfa('0x56')],{'as':_0x4cfa('0x117'),'foreignKey':_0x4cfa('0x153'),'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x76')][_0x4cfa('0x10c')](db[_0x4cfa('0x118')],{'as':_0x4cfa('0x119'),'foreignKey':_0x4cfa('0x153'),'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x76')]['belongsTo'](db[_0x4cfa('0x74')],{'as':'Company','foreignKey':_0x4cfa('0x18f')});db[_0x4cfa('0x76')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':_0x4cfa('0x15b'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x76')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x165'),'through':'cm_user_has_contacts'});db[_0x4cfa('0x76')][_0x4cfa('0x11c')](db['Tag'],{'as':_0x4cfa('0x163'),'through':_0x4cfa('0x190')});db[_0x4cfa('0x76')]['belongsToMany'](db[_0x4cfa('0x8e')],{'through':_0x4cfa('0x190'),'as':_0x4cfa('0x164')});db[_0x4cfa('0x78')]['belongsTo'](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x78')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':'ListId','onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x78')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x185'),'foreignKey':_0x4cfa('0x10b')});db[_0x4cfa('0x78')][_0x4cfa('0x11a')](db[_0x4cfa('0x124')],{'as':_0x4cfa('0x186'),'foreignKey':_0x4cfa('0x13d'),'onDelete':'cascade'});db[_0x4cfa('0x78')][_0x4cfa('0x11a')](db[_0x4cfa('0xe8')],{'as':_0x4cfa('0xe8'),'foreignKey':_0x4cfa('0x191'),'onDelete':'cascade'});db['CmHopper'][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':'Owner','foreignKey':_0x4cfa('0x192')});db[_0x4cfa('0x7a')][_0x4cfa('0x11a')](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153'),'onDelete':_0x4cfa('0x10f')});db['CmHopperBlack'][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':'ListId','onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x7a')][_0x4cfa('0x11a')](db[_0x4cfa('0x124')],{'as':'Queue','foreignKey':_0x4cfa('0x13d'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x7a')][_0x4cfa('0x11a')](db[_0x4cfa('0xe8')],{'as':'Campaign','foreignKey':_0x4cfa('0x191'),'onDelete':'cascade'});db[_0x4cfa('0x81')][_0x4cfa('0x10c')](db[_0x4cfa('0x193')],{'as':{'plural':_0x4cfa('0x194'),'singular':'OneAll'},'foreignKey':_0x4cfa('0x195'),'onDelete':'cascade','hooks':!![]});db[_0x4cfa('0x81')][_0x4cfa('0x10c')](db[_0x4cfa('0x193')],{'as':{'plural':'Any','singular':_0x4cfa('0x196')},'foreignKey':_0x4cfa('0x197'),'onDelete':_0x4cfa('0x10f'),'hooks':!![]});db[_0x4cfa('0x81')][_0x4cfa('0x10c')](db[_0x4cfa('0x7f')],{'as':_0x4cfa('0x198'),'foreignKey':_0x4cfa('0x199'),'onDelete':_0x4cfa('0x10f'),'hooks':!![]});db[_0x4cfa('0x84')]['hasMany'](db[_0x4cfa('0x84')],{'as':'Dispositions','foreignKey':_0x4cfa('0x19a'),'onDelete':'cascade'});db[_0x4cfa('0x87')][_0x4cfa('0x10c')](db['Interval'],{'as':'Intervals','foreignKey':_0x4cfa('0x145'),'onDelete':_0x4cfa('0x10f'),'hooks':!![],'required':![]});db[_0x4cfa('0x87')][_0x4cfa('0x10c')](db['VoiceExtension'],{'as':_0x4cfa('0x10e'),'foreignKey':_0x4cfa('0x145'),'onDelete':_0x4cfa('0x16c')});db['Interval'][_0x4cfa('0x10c')](db[_0x4cfa('0x4b')],{'as':_0x4cfa('0x19b'),'foreignKey':_0x4cfa('0x145')});db[_0x4cfa('0x87')][_0x4cfa('0x10c')](db[_0x4cfa('0x69')],{'as':_0x4cfa('0x19c'),'foreignKey':_0x4cfa('0x145')});db[_0x4cfa('0x87')][_0x4cfa('0x10c')](db[_0x4cfa('0x54')],{'as':_0x4cfa('0x19d'),'foreignKey':_0x4cfa('0x145')});db[_0x4cfa('0x87')][_0x4cfa('0x10c')](db[_0x4cfa('0x178')],{'as':_0x4cfa('0x19e'),'foreignKey':_0x4cfa('0x145')});db[_0x4cfa('0x8b')][_0x4cfa('0x11a')](db[_0x4cfa('0x44')],{});db[_0x4cfa('0x8b')][_0x4cfa('0x11a')](db[_0x4cfa('0x95')],{'foreignKey':_0x4cfa('0x19f')});db[_0x4cfa('0x8b')][_0x4cfa('0x11a')](db[_0x4cfa('0x94')],{'foreignKey':_0x4cfa('0x1a0')});db[_0x4cfa('0x1a1')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x4cfa('0x1a2'),'through':_0x4cfa('0x13b'),'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0x8e')][_0x4cfa('0x11c')](db[_0x4cfa('0x76')],{'through':_0x4cfa('0x190')});db[_0x4cfa('0x8e')][_0x4cfa('0x11c')](db[_0x4cfa('0x114')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x4cfa('0x11c')](db[_0x4cfa('0x118')],{'through':_0x4cfa('0x1a3')});db[_0x4cfa('0x8e')][_0x4cfa('0x11c')](db[_0x4cfa('0x5c')],{'through':_0x4cfa('0x17a')});db[_0x4cfa('0x8e')][_0x4cfa('0x11c')](db['FaxInteraction'],{'through':_0x4cfa('0x174')});db[_0x4cfa('0x8e')][_0x4cfa('0x11c')](db[_0x4cfa('0x62')],{'through':'openchannel_interaction_has_tags'});db[_0x4cfa('0x8e')][_0x4cfa('0x11c')](db['WhatsappInteraction'],{'through':_0x4cfa('0x1a4')});db['Trigger'][_0x4cfa('0x10c')](db[_0x4cfa('0x193')],{'as':{'plural':_0x4cfa('0x1a5'),'singular':_0x4cfa('0x1a6')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0x4cfa('0x10c')](db[_0x4cfa('0x193')],{'as':{'plural':_0x4cfa('0x1a7'),'singular':_0x4cfa('0x1a8')},'foreignKey':_0x4cfa('0x1a9'),'onDelete':_0x4cfa('0x10f'),'hooks':!![]});db[_0x4cfa('0x91')][_0x4cfa('0x10c')](db['Action'],{'as':_0x4cfa('0x198'),'foreignKey':_0x4cfa('0x1aa'),'onDelete':_0x4cfa('0x10f'),'hooks':!![]});db[_0x4cfa('0x94')][_0x4cfa('0x10c')](db[_0x4cfa('0x98')],{'as':_0x4cfa('0x1ab'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x4cfa('0x95')][_0x4cfa('0x10c')](db[_0x4cfa('0x98')],{'as':_0x4cfa('0x1ab'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'DefaultReportId'});db[_0x4cfa('0x1ac')][_0x4cfa('0x10c')](db[_0x4cfa('0x98')],{'as':'Fields','onDelete':'cascade','foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x1ac')],{'foreignKey':_0x4cfa('0x1ad')});db[_0x4cfa('0x9b')][_0x4cfa('0x10c')](db[_0x4cfa('0x9d')],{'as':'Configurations','onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0x9d')]['hasMany'](db[_0x4cfa('0x9f')],{'as':_0x4cfa('0x1af'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0x9d')][_0x4cfa('0x10c')](db[_0x4cfa('0x9f')],{'as':_0x4cfa('0x1b1'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b2')});db[_0x4cfa('0x9d')][_0x4cfa('0x10c')](db[_0x4cfa('0x9f')],{'as':_0x4cfa('0x1ab'),'onDelete':'cascade','foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0x9d')]['belongsTo'](db[_0x4cfa('0x9b')],{'as':_0x4cfa('0x161'),'foreignKey':'AccountId'});db[_0x4cfa('0x9f')][_0x4cfa('0x10c')](db[_0x4cfa('0x9f')],{'as':_0x4cfa('0x1b4'),'foreignKey':'SubjectId'});db[_0x4cfa('0x9f')][_0x4cfa('0x10c')](db[_0x4cfa('0x9f')],{'as':_0x4cfa('0x1b5'),'foreignKey':_0x4cfa('0x1b2')});db[_0x4cfa('0x9f')]['hasMany'](db[_0x4cfa('0x9f')],{'as':_0x4cfa('0x1b6'),'foreignKey':_0x4cfa('0x1b3')});db['SalesforceField'][_0x4cfa('0x11a')](db[_0x4cfa('0x1b7')],{'as':_0x4cfa('0x1b7'),'foreignKey':_0x4cfa('0x1b8')});db[_0x4cfa('0xa0')][_0x4cfa('0x10c')](db[_0x4cfa('0xa2')],{'as':_0x4cfa('0x1b9'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'AccountId'});db[_0x4cfa('0xa2')]['hasMany'](db[_0x4cfa('0xa4')],{'as':_0x4cfa('0x1af'),'onDelete':'cascade','foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xa2')]['hasMany'](db['SugarcrmField'],{'as':_0x4cfa('0x1b1'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b2')});db[_0x4cfa('0xa2')]['hasMany'](db[_0x4cfa('0xa4')],{'as':_0x4cfa('0x1ab'),'onDelete':'cascade','foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xa2')]['belongsTo'](db[_0x4cfa('0xa0')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0xa4')][_0x4cfa('0x10c')](db[_0x4cfa('0xa4')],{'as':_0x4cfa('0x1b4'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x4cfa('0x10c')](db['SugarcrmField'],{'as':_0x4cfa('0x1b5'),'foreignKey':_0x4cfa('0x1b2')});db['SugarcrmField'][_0x4cfa('0x10c')](db[_0x4cfa('0xa4')],{'as':_0x4cfa('0x1b6'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xa4')][_0x4cfa('0x11a')](db[_0x4cfa('0x1b7')],{'as':_0x4cfa('0x1b7'),'foreignKey':_0x4cfa('0x1b8')});db[_0x4cfa('0xa6')][_0x4cfa('0x10c')](db[_0x4cfa('0xa7')],{'as':_0x4cfa('0x1b9'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'AccountId'});db[_0x4cfa('0xa7')]['hasMany'](db['DeskField'],{'as':_0x4cfa('0x1af'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'SubjectId'});db[_0x4cfa('0xa7')][_0x4cfa('0x10c')](db['DeskField'],{'as':_0x4cfa('0x1b1'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'DescriptionId'});db[_0x4cfa('0xa7')][_0x4cfa('0x10c')](db[_0x4cfa('0x1ba')],{'as':_0x4cfa('0x1ab'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b3')});db['DeskConfiguration'][_0x4cfa('0x11a')](db['DeskAccount'],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0xa7')][_0x4cfa('0x11c')](db[_0x4cfa('0x8e')],{'through':'int_desk_configuration_has_tags'});db[_0x4cfa('0x1ba')]['hasMany'](db[_0x4cfa('0x1ba')],{'as':'Subject','foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0x1ba')][_0x4cfa('0x10c')](db[_0x4cfa('0x1ba')],{'as':'Description','foreignKey':_0x4cfa('0x1b2')});db['DeskField'][_0x4cfa('0x10c')](db[_0x4cfa('0x1ba')],{'as':_0x4cfa('0x1b6'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0x1ba')][_0x4cfa('0x11a')](db[_0x4cfa('0x1b7')],{'as':'Variable','foreignKey':_0x4cfa('0x1b8')});db[_0x4cfa('0xaa')]['hasMany'](db[_0x4cfa('0xac')],{'as':_0x4cfa('0x1b9'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'AccountId'});db[_0x4cfa('0xac')][_0x4cfa('0x10c')](db[_0x4cfa('0xae')],{'as':_0x4cfa('0x1af'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xac')][_0x4cfa('0x10c')](db[_0x4cfa('0xae')],{'as':_0x4cfa('0x1b1'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b2')});db[_0x4cfa('0xac')][_0x4cfa('0x10c')](db['ZohoField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xac')][_0x4cfa('0x11a')](db[_0x4cfa('0xaa')],{'as':'Account','foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0xae')][_0x4cfa('0x10c')](db[_0x4cfa('0xae')],{'as':_0x4cfa('0x1b4'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xae')][_0x4cfa('0x10c')](db[_0x4cfa('0xae')],{'as':_0x4cfa('0x1b5'),'foreignKey':'DescriptionId'});db['ZohoField'][_0x4cfa('0x10c')](db[_0x4cfa('0xae')],{'as':_0x4cfa('0x1b6'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xae')][_0x4cfa('0x11a')](db['Variable'],{'as':_0x4cfa('0x1b7'),'foreignKey':_0x4cfa('0x1b8')});db[_0x4cfa('0xb0')][_0x4cfa('0x10c')](db[_0x4cfa('0xb1')],{'as':_0x4cfa('0x1b9'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x4cfa('0xb1')][_0x4cfa('0x10c')](db[_0x4cfa('0xb3')],{'as':_0x4cfa('0x1af'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xb1')][_0x4cfa('0x10c')](db[_0x4cfa('0xb3')],{'as':_0x4cfa('0x1b1'),'foreignKey':'DescriptionId'});db[_0x4cfa('0xb1')][_0x4cfa('0x10c')](db[_0x4cfa('0xb3')],{'as':'Fields','foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x4cfa('0x11a')](db['ZendeskAccount'],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x1ae')});db['ZendeskConfiguration'][_0x4cfa('0x11c')](db['Tag'],{'through':_0x4cfa('0x1bb')});db['ZendeskField'][_0x4cfa('0x10c')](db[_0x4cfa('0xb3')],{'as':_0x4cfa('0x1b4'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xb3')][_0x4cfa('0x10c')](db[_0x4cfa('0xb3')],{'as':_0x4cfa('0x1b5'),'foreignKey':_0x4cfa('0x1b2')});db[_0x4cfa('0xb3')]['hasMany'](db[_0x4cfa('0xb3')],{'as':_0x4cfa('0x1b6'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xb3')]['belongsTo'](db[_0x4cfa('0x1b7')],{'as':_0x4cfa('0x1b7'),'foreignKey':'VariableId'});db[_0x4cfa('0xb4')][_0x4cfa('0x10c')](db[_0x4cfa('0xb6')],{'as':_0x4cfa('0x1b9'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1ae')});db['FreshdeskConfiguration'][_0x4cfa('0x10c')](db[_0x4cfa('0xb8')],{'as':_0x4cfa('0x1af'),'onDelete':'cascade','foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xb6')][_0x4cfa('0x10c')](db[_0x4cfa('0xb8')],{'as':'Descriptions','onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b2')});db['FreshdeskConfiguration'][_0x4cfa('0x10c')](db[_0x4cfa('0xb8')],{'as':'Fields','onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xb6')][_0x4cfa('0x11a')](db[_0x4cfa('0xb4')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0xb6')][_0x4cfa('0x11c')](db[_0x4cfa('0x8e')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x4cfa('0xb8')]['hasMany'](db[_0x4cfa('0xb8')],{'as':_0x4cfa('0x1b4'),'foreignKey':_0x4cfa('0x1b0')});db['FreshdeskField'][_0x4cfa('0x10c')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4cfa('0xb8')][_0x4cfa('0x10c')](db[_0x4cfa('0xb8')],{'as':_0x4cfa('0x1b6'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xb8')][_0x4cfa('0x11a')](db['Variable'],{'as':_0x4cfa('0x1b7'),'foreignKey':_0x4cfa('0x1b8')});db[_0x4cfa('0xb9')]['hasMany'](db[_0x4cfa('0xbb')],{'as':_0x4cfa('0x1b9'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0xbb')]['hasMany'](db[_0x4cfa('0xbd')],{'as':_0x4cfa('0x1af'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xbb')]['hasMany'](db[_0x4cfa('0xbd')],{'as':_0x4cfa('0x1b1'),'foreignKey':'DescriptionId'});db[_0x4cfa('0xbb')][_0x4cfa('0x10c')](db['VtigerField'],{'as':_0x4cfa('0x1ab'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0x4cfa('0x11a')](db[_0x4cfa('0xb9')],{'as':'Account','foreignKey':'AccountId'});db[_0x4cfa('0xbd')][_0x4cfa('0x10c')](db[_0x4cfa('0xbd')],{'as':'Subject','foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xbd')][_0x4cfa('0x10c')](db[_0x4cfa('0xbd')],{'as':_0x4cfa('0x1b5'),'foreignKey':_0x4cfa('0x1b2')});db[_0x4cfa('0xbd')][_0x4cfa('0x10c')](db[_0x4cfa('0xbd')],{'as':_0x4cfa('0x1b6'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xbd')][_0x4cfa('0x11a')](db[_0x4cfa('0x1b7')],{'as':_0x4cfa('0x1b7'),'foreignKey':'VariableId'});db['ServicenowAccount']['hasMany'](db[_0x4cfa('0x1bc')],{'as':_0x4cfa('0x1b9'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'AccountId'});db[_0x4cfa('0x1bc')][_0x4cfa('0x10c')](db[_0x4cfa('0xc1')],{'as':_0x4cfa('0x1af'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0x1bc')][_0x4cfa('0x10c')](db['ServicenowField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x4cfa('0x1bc')][_0x4cfa('0x10c')](db[_0x4cfa('0xc1')],{'as':_0x4cfa('0x1ab'),'foreignKey':_0x4cfa('0x1b3')});db['ServicenowConfiguration'][_0x4cfa('0x11a')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0xc1')][_0x4cfa('0x10c')](db[_0x4cfa('0xc1')],{'as':_0x4cfa('0x1b4'),'foreignKey':'SubjectId'});db[_0x4cfa('0xc1')][_0x4cfa('0x10c')](db[_0x4cfa('0xc1')],{'as':_0x4cfa('0x1b5'),'foreignKey':'DescriptionId'});db['ServicenowField']['hasMany'](db[_0x4cfa('0xc1')],{'as':'Field','foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xc1')]['belongsTo'](db[_0x4cfa('0x1b7')],{'as':'Variable','foreignKey':_0x4cfa('0x1b8')});db[_0x4cfa('0xc2')][_0x4cfa('0x10c')](db[_0x4cfa('0xc4')],{'as':_0x4cfa('0x1b9'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0xc4')][_0x4cfa('0x10c')](db['Dynamics365Field'],{'as':_0x4cfa('0x1af'),'onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xc4')][_0x4cfa('0x10c')](db[_0x4cfa('0x1bd')],{'as':_0x4cfa('0x1b1'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'DescriptionId'});db[_0x4cfa('0xc4')][_0x4cfa('0x10c')](db['Dynamics365Field'],{'as':_0x4cfa('0x1ab'),'onDelete':_0x4cfa('0x10f'),'foreignKey':'FieldId'});db['Dynamics365Configuration']['belongsTo'](db[_0x4cfa('0xc2')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x1ae')});db[_0x4cfa('0x1bd')][_0x4cfa('0x10c')](db[_0x4cfa('0x1bd')],{'as':'Subject','foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0x1bd')][_0x4cfa('0x10c')](db[_0x4cfa('0x1bd')],{'as':_0x4cfa('0x1b5'),'foreignKey':'DescriptionId'});db[_0x4cfa('0x1bd')]['hasMany'](db['Dynamics365Field'],{'as':_0x4cfa('0x1b6'),'foreignKey':'FieldId'});db[_0x4cfa('0x1bd')][_0x4cfa('0x11a')](db[_0x4cfa('0x1b7')],{'as':'Variable','foreignKey':_0x4cfa('0x1b8')});db['FreshsalesAccount'][_0x4cfa('0x10c')](db[_0x4cfa('0x1be')],{'as':_0x4cfa('0x1b9'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x4cfa('0x10c')](db['FreshsalesField'],{'as':_0x4cfa('0x1af'),'foreignKey':'SubjectId'});db[_0x4cfa('0x1be')][_0x4cfa('0x10c')](db['FreshsalesField'],{'as':_0x4cfa('0x1b1'),'foreignKey':_0x4cfa('0x1b2')});db[_0x4cfa('0x1be')][_0x4cfa('0x10c')](db[_0x4cfa('0xc7')],{'as':_0x4cfa('0x1ab'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0x1be')][_0x4cfa('0x11a')](db[_0x4cfa('0xc5')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x1ae')});db['FreshsalesField'][_0x4cfa('0x10c')](db[_0x4cfa('0xc7')],{'as':_0x4cfa('0x1b4'),'foreignKey':_0x4cfa('0x1b0')});db[_0x4cfa('0xc7')][_0x4cfa('0x10c')](db['FreshsalesField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4cfa('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0x4cfa('0x1b6'),'foreignKey':_0x4cfa('0x1b3')});db[_0x4cfa('0xc7')][_0x4cfa('0x11a')](db[_0x4cfa('0x1b7')],{'as':'Variable','foreignKey':_0x4cfa('0x1b8')});db[_0x4cfa('0xcc')][_0x4cfa('0x11a')](db[_0x4cfa('0x66')],{});db[_0x4cfa('0xcc')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':_0x4cfa('0x15b')});db['ChatQueueReport']['belongsTo'](db[_0x4cfa('0x76')],{'as':'Contact','foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0xcc')][_0x4cfa('0x11a')](db[_0x4cfa('0x114')],{});db[_0x4cfa('0xcc')][_0x4cfa('0x11a')](db[_0x4cfa('0x6c')],{});db['ChatQueueReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{});db[_0x4cfa('0xcc')][_0x4cfa('0x11a')](db[_0x4cfa('0x6f')],{});db[_0x4cfa('0xce')]['belongsTo'](db[_0x4cfa('0x14')],{'onDelete':'cascade','foreignKey':_0x4cfa('0x1bf')});db['ChatInternalMessage'][_0x4cfa('0x11a')](db['User'],{'onDelete':_0x4cfa('0x10f'),'foreignKey':'ToId'});db[_0x4cfa('0x141')][_0x4cfa('0x10c')](db[_0x4cfa('0xd1')],{'foreignKey':_0x4cfa('0x1c0'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0x141')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x4cfa('0x1c0'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0xd4')]['belongsTo'](db[_0x4cfa('0x134')],{});db[_0x4cfa('0xd4')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':'List','foreignKey':'ListId'});db[_0x4cfa('0xd4')]['belongsTo'](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db['SmsQueueReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x5c')],{});db[_0x4cfa('0xd4')][_0x4cfa('0x11a')](db['SmsMessage'],{});db[_0x4cfa('0xd4')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{});db[_0x4cfa('0xd4')][_0x4cfa('0x11a')](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db[_0x4cfa('0x141')],{'foreignKey':_0x4cfa('0x1c1')});db[_0x4cfa('0xda')][_0x4cfa('0x10c')](db[_0x4cfa('0xd1')],{'foreignKey':_0x4cfa('0x1c1')});db[_0x4cfa('0xda')][_0x4cfa('0x10c')](db[_0x4cfa('0x1c2')],{'foreignKey':_0x4cfa('0x1c1')});db[_0x4cfa('0xdf')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x165'),'through':'user_has_square_projects'});db[_0x4cfa('0xe5')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':'Agents','through':_0x4cfa('0x11e')});db[_0x4cfa('0xe5')][_0x4cfa('0x11c')](db[_0x4cfa('0x124')],{'through':_0x4cfa('0x14b'),'as':_0x4cfa('0x1c3')});db[_0x4cfa('0xe5')][_0x4cfa('0x11c')](db[_0x4cfa('0x45')],{'through':_0x4cfa('0x15e'),'as':'MailQueues'});db[_0x4cfa('0xe5')][_0x4cfa('0x11c')](db[_0x4cfa('0x6f')],{'through':_0x4cfa('0x18c'),'as':_0x4cfa('0x126')});db['Team'][_0x4cfa('0x11c')](db[_0x4cfa('0x58')],{'through':_0x4cfa('0x176'),'as':_0x4cfa('0x1c4')});db[_0x4cfa('0xe5')][_0x4cfa('0x11c')](db[_0x4cfa('0x128')],{'through':_0x4cfa('0x1c5'),'as':'SmsQueues'});db[_0x4cfa('0xe5')]['belongsToMany'](db[_0x4cfa('0x64')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db['Team'][_0x4cfa('0x11c')](db[_0x4cfa('0x106')],{'through':_0x4cfa('0x1c6'),'as':_0x4cfa('0x1c7')});db[_0x4cfa('0xe8')]['hasMany'](db['CmHopper'],{'as':_0x4cfa('0x13e'),'foreignKey':_0x4cfa('0x191')});db[_0x4cfa('0xe8')]['hasMany'](db[_0x4cfa('0x110')],{'as':_0x4cfa('0x111'),'foreignKey':_0x4cfa('0x191')});db[_0x4cfa('0xe8')][_0x4cfa('0x10c')](db[_0x4cfa('0x13f')],{'as':'HopperHistories','foreignKey':_0x4cfa('0x191')});db[_0x4cfa('0xe8')][_0x4cfa('0x10c')](db[_0x4cfa('0x7a')],{'as':'HopperBlacks','foreignKey':_0x4cfa('0x191')});db['Campaign']['belongsTo'](db[_0x4cfa('0x31')],{'as':_0x4cfa('0x31'),'foreignKey':_0x4cfa('0x1c8')});db[_0x4cfa('0xe8')][_0x4cfa('0x11a')](db[_0x4cfa('0x31')],{'as':_0x4cfa('0x143'),'foreignKey':_0x4cfa('0x144')});db[_0x4cfa('0xe8')]['belongsTo'](db[_0x4cfa('0x87')],{'as':_0x4cfa('0x87'),'foreignKey':'IntervalId'});db[_0x4cfa('0xe8')][_0x4cfa('0x11a')](db[_0x4cfa('0xdf')],{'as':_0x4cfa('0xdf'),'foreignKey':'SquareProjectId'});db['Campaign'][_0x4cfa('0x11c')](db['CmList'],{'as':_0x4cfa('0x11d'),'through':_0x4cfa('0x1c9')});db[_0x4cfa('0xe8')][_0x4cfa('0x11c')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x14c'),'through':_0x4cfa('0x1ca')});db[_0x4cfa('0xec')][_0x4cfa('0x11a')](db[_0x4cfa('0x16a')],{'as':'ChatOfflineMessage','foreignKey':_0x4cfa('0x16b')});db[_0x4cfa('0xef')][_0x4cfa('0x11a')](db['MailMessage'],{});db['MailTransferReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x118')],{});db[_0x4cfa('0xef')]['belongsTo'](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0x4cfa('0xef')]['belongsTo'](db[_0x4cfa('0x14')],{'foreignKey':_0x4cfa('0x1cb'),'as':'FromAgent'});db[_0x4cfa('0xef')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'foreignKey':_0x4cfa('0x1cc'),'as':_0x4cfa('0x1cd')});db[_0x4cfa('0xef')][_0x4cfa('0x11a')](db['MailQueue'],{'foreignKey':_0x4cfa('0x1ce'),'as':_0x4cfa('0x1cf')});db[_0x4cfa('0xef')]['belongsTo'](db[_0x4cfa('0x44')],{'foreignKey':'ToMailAccountId','as':_0x4cfa('0x1d0')});db[_0x4cfa('0xf1')][_0x4cfa('0x11a')](db[_0x4cfa('0x6c')],{});db[_0x4cfa('0xf1')][_0x4cfa('0x11a')](db['ChatInteraction'],{});db[_0x4cfa('0xf1')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x4cfa('0x1d1'),'as':_0x4cfa('0x1d2')});db[_0x4cfa('0xf1')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'foreignKey':_0x4cfa('0x1cb'),'as':_0x4cfa('0x1d3')});db['ChatTransferReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'foreignKey':_0x4cfa('0x1cc'),'as':_0x4cfa('0x1cd')});db[_0x4cfa('0xf1')]['belongsTo'](db[_0x4cfa('0x6f')],{'foreignKey':_0x4cfa('0x1d4'),'as':_0x4cfa('0x1cf')});db[_0x4cfa('0xf1')][_0x4cfa('0x11a')](db['ChatWebsite'],{'foreignKey':_0x4cfa('0x1d5'),'as':_0x4cfa('0x1d0')});db[_0x4cfa('0x1d6')][_0x4cfa('0x11a')](db[_0x4cfa('0x57')],{});db[_0x4cfa('0x1d6')][_0x4cfa('0x11a')](db[_0x4cfa('0x56')],{});db[_0x4cfa('0x1d6')][_0x4cfa('0x11a')](db[_0x4cfa('0x52')],{'foreignKey':_0x4cfa('0x1d7'),'as':_0x4cfa('0x1d2')});db[_0x4cfa('0x1d6')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'foreignKey':'FromUserId','as':_0x4cfa('0x1d3')});db['FaxTransferReport']['belongsTo'](db[_0x4cfa('0x14')],{'foreignKey':_0x4cfa('0x1cc'),'as':'ToAgent'});db[_0x4cfa('0x1d6')][_0x4cfa('0x11a')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x4cfa('0x1cf')});db[_0x4cfa('0x1d6')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x4cfa('0x1d8'),'as':'ToAccount'});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelMessage'],{});db[_0x4cfa('0xf4')]['belongsTo'](db[_0x4cfa('0x62')],{});db[_0x4cfa('0xf4')][_0x4cfa('0x11a')](db[_0x4cfa('0x17e')],{'foreignKey':_0x4cfa('0x1d9'),'as':'FromAccount'});db[_0x4cfa('0xf4')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'foreignKey':'FromUserId','as':_0x4cfa('0x1d3')});db[_0x4cfa('0xf4')][_0x4cfa('0x11a')](db['User'],{'foreignKey':'ToUserId','as':_0x4cfa('0x1cd')});db[_0x4cfa('0xf4')][_0x4cfa('0x11a')](db[_0x4cfa('0x64')],{'foreignKey':_0x4cfa('0x1da'),'as':_0x4cfa('0x1cf')});db['OpenchannelTransferReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x17e')],{'foreignKey':_0x4cfa('0x1db'),'as':_0x4cfa('0x1d0')});db[_0x4cfa('0x1dc')][_0x4cfa('0x11a')](db[_0x4cfa('0x5d')],{});db[_0x4cfa('0x1dc')][_0x4cfa('0x11a')](db['SmsInteraction'],{});db[_0x4cfa('0x1dc')][_0x4cfa('0x11a')](db[_0x4cfa('0x134')],{'foreignKey':_0x4cfa('0x1dd'),'as':_0x4cfa('0x1d2')});db[_0x4cfa('0x1dc')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'foreignKey':_0x4cfa('0x1cb'),'as':_0x4cfa('0x1d3')});db['SmsTransferReport'][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'foreignKey':'ToUserId','as':_0x4cfa('0x1cd')});db['SmsTransferReport'][_0x4cfa('0x11a')](db['SmsQueue'],{'foreignKey':_0x4cfa('0x1de'),'as':_0x4cfa('0x1cf')});db['SmsTransferReport'][_0x4cfa('0x11a')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0x4cfa('0x1d0')});db[_0x4cfa('0x148')][_0x4cfa('0x10c')](db['Disposition'],{'as':_0x4cfa('0x16f'),'foreignKey':_0x4cfa('0x15b'),'onDelete':_0x4cfa('0x10f')});db['CmList'][_0x4cfa('0x10c')](db[_0x4cfa('0x1df')],{'as':_0x4cfa('0x1e0'),'foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x148')][_0x4cfa('0x10c')](db[_0x4cfa('0x76')],{'as':'Contacts','onDelete':_0x4cfa('0x10f'),'foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x148')][_0x4cfa('0x10c')](db[_0x4cfa('0x110')],{'as':_0x4cfa('0x111'),'foreignKey':'ListId'});db[_0x4cfa('0x148')]['hasMany'](db[_0x4cfa('0x13f')],{'as':'HopperHistory','foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x148')][_0x4cfa('0x10c')](db[_0x4cfa('0x112')],{'as':_0x4cfa('0x112'),'foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0x148')][_0x4cfa('0x11c')](db[_0x4cfa('0x124')],{'as':_0x4cfa('0x1e1'),'through':_0x4cfa('0x149')});db['CmList'][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':_0x4cfa('0x12a')});db[_0x4cfa('0xf8')][_0x4cfa('0x10c')](db[_0x4cfa('0x1b')],{'as':'Extensions','onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0xf8')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14a'),'through':_0x4cfa('0x1e2')});db['UserProfile'][_0x4cfa('0x10c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x165'),'foreignKey':_0x4cfa('0x1e3')});db[_0x4cfa('0xfa')][_0x4cfa('0x10c')](db[_0x4cfa('0xfb')],{'as':_0x4cfa('0x1e4'),'foreignKey':'userProfileId','onDelete':'cascade'});db['UserProfileSection'][_0x4cfa('0x10c')](db[_0x4cfa('0xfc')],{'as':_0x4cfa('0x1e5'),'foreignKey':'sectionId','onDelete':'cascade'});db[_0x4cfa('0xfe')][_0x4cfa('0x10c')](db[_0x4cfa('0x84')],{'as':_0x4cfa('0x16f'),'foreignKey':_0x4cfa('0x1e6'),'onDelete':_0x4cfa('0x10f')});db[_0x4cfa('0xfe')][_0x4cfa('0x10c')](db['CannedAnswer'],{'as':_0x4cfa('0x157'),'foreignKey':'WhatsappAccountId'});db[_0x4cfa('0xfe')][_0x4cfa('0x10c')](db['WhatsappMessage'],{'as':_0x4cfa('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x4cfa('0xfe')][_0x4cfa('0x10c')](db[_0x4cfa('0x101')],{'as':'Interactions'});db[_0x4cfa('0xfe')][_0x4cfa('0x10c')](db[_0x4cfa('0xff')],{'as':'Applications'});db[_0x4cfa('0xfe')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':_0x4cfa('0x15b')});db[_0x4cfa('0xfe')][_0x4cfa('0x11a')](db[_0x4cfa('0x146')],{'as':_0x4cfa('0x15c'),'foreignKey':_0x4cfa('0x147')});db[_0x4cfa('0xfe')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x4cfa('0x137')});db[_0x4cfa('0xff')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0xff')]['belongsTo'](db['WhatsappQueue'],{'onDelete':_0x4cfa('0x16c')});db['WhatsappApplication']['belongsTo'](db[_0x4cfa('0xfe')],{'onDelete':_0x4cfa('0x16c')});db[_0x4cfa('0xff')]['belongsTo'](db[_0x4cfa('0x87')],{'onDelete':'restrict','foreignKey':_0x4cfa('0x145')});db[_0x4cfa('0xff')][_0x4cfa('0x11a')](db[_0x4cfa('0x8e')],{'onDelete':_0x4cfa('0x16c'),'foreignKey':'TagId'});db[_0x4cfa('0x101')][_0x4cfa('0x10c')](db[_0x4cfa('0x1e7')],{'as':_0x4cfa('0x158'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db[_0x4cfa('0x101')][_0x4cfa('0x11a')](db['WhatsappAccount'],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x1e6')});db[_0x4cfa('0x101')][_0x4cfa('0x11a')](db[_0x4cfa('0x76')],{'as':_0x4cfa('0x152'),'foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x101')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':'Owner','foreignKey':_0x4cfa('0x10b')});db['WhatsappInteraction'][_0x4cfa('0x11c')](db[_0x4cfa('0x8e')],{'through':_0x4cfa('0x1a4'),'as':_0x4cfa('0x163')});db[_0x4cfa('0x101')]['belongsToMany'](db[_0x4cfa('0x8e')],{'through':_0x4cfa('0x1a4'),'as':_0x4cfa('0x164')});db[_0x4cfa('0x101')][_0x4cfa('0x11c')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x165'),'through':_0x4cfa('0x123'),'foreignKey':'WhatsappInteractionId'});db[_0x4cfa('0x1e7')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'as':_0x4cfa('0x14')});db[_0x4cfa('0x1e7')][_0x4cfa('0x11a')](db[_0x4cfa('0x76')],{'onDelete':'cascade','as':_0x4cfa('0x152')});db[_0x4cfa('0x1e7')]['belongsTo'](db[_0x4cfa('0x101')],{'onDelete':'cascade','as':_0x4cfa('0x168'),'foreignKey':_0x4cfa('0x1e8')});db[_0x4cfa('0x1e7')][_0x4cfa('0x11a')](db[_0x4cfa('0xfe')],{'as':_0x4cfa('0x161'),'foreignKey':_0x4cfa('0x1e6')});db[_0x4cfa('0x103')][_0x4cfa('0x11a')](db[_0x4cfa('0xfe')],{});db[_0x4cfa('0x103')][_0x4cfa('0x11a')](db[_0x4cfa('0x148')],{'as':_0x4cfa('0x15a'),'foreignKey':_0x4cfa('0x15b')});db['WhatsappQueueReport'][_0x4cfa('0x11a')](db['CmContact'],{'as':'Contact','foreignKey':_0x4cfa('0x153')});db[_0x4cfa('0x103')][_0x4cfa('0x11a')](db['WhatsappInteraction'],{});db[_0x4cfa('0x103')][_0x4cfa('0x11a')](db[_0x4cfa('0x106')],{});db[_0x4cfa('0x103')][_0x4cfa('0x11a')](db['WhatsappMessage'],{});db[_0x4cfa('0x103')]['belongsTo'](db[_0x4cfa('0x14')],{});db[_0x4cfa('0x104')][_0x4cfa('0x11a')](db[_0x4cfa('0x1e7')],{});db[_0x4cfa('0x104')][_0x4cfa('0x11a')](db[_0x4cfa('0x101')],{});db[_0x4cfa('0x104')][_0x4cfa('0x11a')](db['WhatsappAccount'],{'foreignKey':_0x4cfa('0x1e9'),'as':'FromAccount'});db['WhatsappTransferReport']['belongsTo'](db[_0x4cfa('0xfe')],{'foreignKey':_0x4cfa('0x1ea'),'as':_0x4cfa('0x1d0')});db[_0x4cfa('0x104')][_0x4cfa('0x11a')](db[_0x4cfa('0x106')],{'foreignKey':_0x4cfa('0x1eb'),'as':_0x4cfa('0x1cf')});db['WhatsappTransferReport']['belongsTo'](db[_0x4cfa('0x14')],{'foreignKey':'FromUserId','as':_0x4cfa('0x1d3')});db[_0x4cfa('0x104')][_0x4cfa('0x11a')](db[_0x4cfa('0x14')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x4cfa('0x106')][_0x4cfa('0x11c')](db['User'],{'as':_0x4cfa('0x14a'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x4cfa('0x106')][_0x4cfa('0x11c')](db[_0x4cfa('0xe5')],{'through':_0x4cfa('0x1c6'),'as':_0x4cfa('0x15f')});module[_0x4cfa('0x1ec')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 67a1ed6..dcc7565 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3efa=['./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/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/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','/apidoc','join','/www','static','root','/demo','/snippet','snippet','3.0.0','/plugins','route','get','sendFile','resolve','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','securityToken','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','isString','replace','@@{','}@@','includes','lodash','path','express','util','./errors','api','./config/logger','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','remoteAddress','other','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/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/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailQueue','./api/mailSubstatus','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/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/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./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/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','/api/license','./api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment'];(function(_0x4c733b,_0x3294e4){var _0xdc957d=function(_0x23d0c9){while(--_0x23d0c9){_0x4c733b['push'](_0x4c733b['shift']());}};_0xdc957d(++_0x3294e4);}(_0x3efa,0x1a6));var _0xa3ef=function(_0x27a039,_0x3d7ce4){_0x27a039=_0x27a039-0x0;var _0x7a87e6=_0x3efa[_0x27a039];return _0x7a87e6;};'use strict';var _=require(_0xa3ef('0x0'));var path=require(_0xa3ef('0x1'));var express=require(_0xa3ef('0x2'));var ewinston=require('express-winston');var util=require(_0xa3ef('0x3'));var errors=require(_0xa3ef('0x4'));var config=require('./config/environment');var logger=require('./config/logger')(_0xa3ef('0x5'));var authLogger=require(_0xa3ef('0x6'))(_0xa3ef('0x7'));exports[_0xa3ef('0x8')]=function(_0x1c6df4){_0x1c6df4[_0xa3ef('0x9')](ewinston[_0xa3ef('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x408245,_0x285fc0){var _0x50540a=_0xa3ef('0xb');if(!_[_0xa3ef('0xc')](_0x408245[_0xa3ef('0xd')])){_0x50540a+=_0xa3ef('0xe');var _0x487449=_0x408245[_0xa3ef('0xd')];maskSensitiveData(_0x487449);}return util[_0xa3ef('0xf')](_0x50540a,_0x408245[_0xa3ef('0x10')],_0x408245[_0xa3ef('0x11')][_0xa3ef('0x12')]?_0x408245[_0xa3ef('0x11')][_0xa3ef('0x12')]:_0x408245[_0xa3ef('0x13')]['remoteAddress']||_0x408245['ip'],_0x408245[_0xa3ef('0x14')],_0x285fc0[_0xa3ef('0x15')],_0x285fc0[_0xa3ef('0x16')],_0x408245[_0xa3ef('0x17')]?_0x408245[_0xa3ef('0x17')]['id']:null,_0x408245[_0xa3ef('0x17')]?_0x408245[_0xa3ef('0x17')][_0xa3ef('0x18')]:null,_0x408245[_0xa3ef('0x17')]?_0x408245[_0xa3ef('0x17')][_0xa3ef('0x19')]:null,_0x487449?util[_0xa3ef('0x1a')](_0x487449,![],null):'');}}));_0x1c6df4[_0xa3ef('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1f8042,_0x405396){var _0x4a8914=_0xa3ef('0x1b');if(_0x1f8042['body']&&_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1c')]&&_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1d')]){_0x4a8914='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xa3ef('0xf')](_0x4a8914,_0x1f8042[_0xa3ef('0x10')],_0x1f8042[_0xa3ef('0x11')]['x-forwarded-for']?_0x1f8042['headers'][_0xa3ef('0x12')]:_0x1f8042[_0xa3ef('0x13')][_0xa3ef('0x1e')]||_0x1f8042['ip'],_0x1f8042[_0xa3ef('0x14')],_0x405396['statusCode'],_0x405396[_0xa3ef('0x16')],_0x1f8042[_0xa3ef('0x17')]?_0x1f8042[_0xa3ef('0x17')]['id']:null,_0x1f8042['user']?_0x1f8042[_0xa3ef('0x17')]['name']:null,_0x1f8042[_0xa3ef('0x17')]?_0x1f8042['user'][_0xa3ef('0x19')]:null,_0x1f8042[_0xa3ef('0xd')]&&_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1c')]?_0x1f8042[_0xa3ef('0xd')]['device']:_0xa3ef('0x1f'),_0x1f8042['body']&&_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1d')]?_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x1d')]:'',_0x1f8042[_0xa3ef('0xd')]&&_0x1f8042['body']['agent_name']?_0x1f8042[_0xa3ef('0xd')][_0xa3ef('0x20')]:'');},'ignoreRoute':function(_0x19f024){var _0x7d5b7=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x7d5b7[_0xa3ef('0x21')](_0x19f024['url']);}}));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x22'),require(_0xa3ef('0x23')));_0x1c6df4[_0xa3ef('0x9')]('/api/voice/chanspy',require(_0xa3ef('0x24')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x25'),require(_0xa3ef('0x26')));_0x1c6df4['use']('/api/voice/extensions',require(_0xa3ef('0x27')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x28'),require('./api/voiceMusicOnHold'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x29'),require(_0xa3ef('0x2a')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x2b'),require(_0xa3ef('0x2c')));_0x1c6df4[_0xa3ef('0x9')]('/api/screen/recordings',require('./api/screenRecording'));_0x1c6df4['use'](_0xa3ef('0x2d'),require(_0xa3ef('0x2e')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x2f'),require('./api/voiceMailMessage'));_0x1c6df4['use'](_0xa3ef('0x30'),require(_0xa3ef('0x31')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x32'),require(_0xa3ef('0x33')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x34'),require(_0xa3ef('0x35')));_0x1c6df4[_0xa3ef('0x9')]('/api/voice/queues/reports',require(_0xa3ef('0x36')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x37'),require(_0xa3ef('0x38')));_0x1c6df4[_0xa3ef('0x9')]('/api/trunks',require(_0xa3ef('0x39')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x3a'),require(_0xa3ef('0x3b')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x3c'),require(_0xa3ef('0x3d')));_0x1c6df4[_0xa3ef('0x9')]('/api/mail/accounts',require('./api/mailAccount'));_0x1c6df4[_0xa3ef('0x9')]('/api/mail/queues',require(_0xa3ef('0x3e')));_0x1c6df4[_0xa3ef('0x9')]('/api/mail/substatuses',require(_0xa3ef('0x3f')));_0x1c6df4['use']('/api/mail/interactions',require('./api/mailInteraction'));_0x1c6df4['use']('/api/mail/messages',require(_0xa3ef('0x40')));_0x1c6df4['use'](_0xa3ef('0x41'),require(_0xa3ef('0x42')));_0x1c6df4['use'](_0xa3ef('0x43'),require(_0xa3ef('0x44')));_0x1c6df4[_0xa3ef('0x9')]('/api/dashboards',require(_0xa3ef('0x45')));_0x1c6df4[_0xa3ef('0x9')]('/api/dashboards/items',require(_0xa3ef('0x46')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x47'),require(_0xa3ef('0x48')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x49'),require(_0xa3ef('0x4a')));_0x1c6df4['use'](_0xa3ef('0x4b'),require(_0xa3ef('0x4c')));_0x1c6df4[_0xa3ef('0x9')]('/api/fax/messages',require('./api/faxMessage'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x4d'),require(_0xa3ef('0x4e')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x4f'),require(_0xa3ef('0x50')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x51'),require('./api/smsAccount'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x52'),require(_0xa3ef('0x53')));_0x1c6df4[_0xa3ef('0x9')]('/api/sms/interactions',require('./api/smsInteraction'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x54'),require(_0xa3ef('0x55')));_0x1c6df4[_0xa3ef('0x9')]('/api/sms/queues',require(_0xa3ef('0x56')));_0x1c6df4[_0xa3ef('0x9')]('/api/openchannel/accounts',require(_0xa3ef('0x57')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x58'),require(_0xa3ef('0x59')));_0x1c6df4['use']('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x1c6df4['use'](_0xa3ef('0x5a'),require(_0xa3ef('0x5b')));_0x1c6df4[_0xa3ef('0x9')]('/api/openchannel/queues',require(_0xa3ef('0x5c')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x5d'),require('./api/chatWebsite'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x5e'),require(_0xa3ef('0x5f')));_0x1c6df4[_0xa3ef('0x9')]('/api/chat/applications',require(_0xa3ef('0x60')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x61'),require(_0xa3ef('0x62')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x63'),require(_0xa3ef('0x64')));_0x1c6df4['use'](_0xa3ef('0x65'),require('./api/chatOfflineMessage'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x66'),require(_0xa3ef('0x67')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x68'),require(_0xa3ef('0x69')));_0x1c6df4[_0xa3ef('0x9')]('/api/chat/proactive_actions',require(_0xa3ef('0x6a')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x6b'),require(_0xa3ef('0x6c')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x6d'),require(_0xa3ef('0x6e')));_0x1c6df4['use'](_0xa3ef('0x6f'),require(_0xa3ef('0x70')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x71'),require(_0xa3ef('0x72')));_0x1c6df4[_0xa3ef('0x9')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x73'),require(_0xa3ef('0x74')));_0x1c6df4[_0xa3ef('0x9')]('/api/cm/custom_fields',require(_0xa3ef('0x75')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x76'),require(_0xa3ef('0x77')));_0x1c6df4[_0xa3ef('0x9')]('/api/automations',require(_0xa3ef('0x78')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x79'),require(_0xa3ef('0x7a')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x7b'),require(_0xa3ef('0x7c')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x7d'),require(_0xa3ef('0x7e')));_0x1c6df4[_0xa3ef('0x9')]('/api/intervals',require(_0xa3ef('0x7f')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x80'),require(_0xa3ef('0x81')));_0x1c6df4[_0xa3ef('0x9')]('/api/cdr',require(_0xa3ef('0x82')));_0x1c6df4['use']('/api/voiceQueuesLog',require(_0xa3ef('0x83')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x84'),require(_0xa3ef('0x85')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x86'),require(_0xa3ef('0x87')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x88'),require('./api/tag'));_0x1c6df4['use'](_0xa3ef('0x89'),require('./api/template'));_0x1c6df4[_0xa3ef('0x9')]('/api/triggers',require(_0xa3ef('0x8a')));_0x1c6df4['use'](_0xa3ef('0x8b'),require(_0xa3ef('0x8c')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x8d'),require(_0xa3ef('0x8e')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x8f'),require(_0xa3ef('0x90')));_0x1c6df4['use'](_0xa3ef('0x91'),require(_0xa3ef('0x92')));_0x1c6df4[_0xa3ef('0x9')]('/api/analytics/default_reports',require(_0xa3ef('0x93')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x94'),require(_0xa3ef('0x95')));_0x1c6df4['use']('/api/analytics/metrics',require(_0xa3ef('0x96')));_0x1c6df4['use'](_0xa3ef('0x97'),require(_0xa3ef('0x98')));_0x1c6df4['use'](_0xa3ef('0x99'),require(_0xa3ef('0x9a')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x9b'),require('./api/intSalesforceAccount'));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/salesforce/configurations',require(_0xa3ef('0x9c')));_0x1c6df4['use'](_0xa3ef('0x9d'),require(_0xa3ef('0x9e')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x9f'),require(_0xa3ef('0xa0')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xa1'),require(_0xa3ef('0xa2')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xa3'),require(_0xa3ef('0xa4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xa5'),require('./api/intDeskAccount'));_0x1c6df4['use'](_0xa3ef('0xa6'),require(_0xa3ef('0xa7')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xa8'),require(_0xa3ef('0xa9')));_0x1c6df4['use'](_0xa3ef('0xaa'),require(_0xa3ef('0xab')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/zoho/configurations',require(_0xa3ef('0xac')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xad'),require('./api/intZohoField'));_0x1c6df4['use'](_0xa3ef('0xae'),require(_0xa3ef('0xaf')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/zendesk/configurations',require(_0xa3ef('0xb0')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/zendesk/fields',require(_0xa3ef('0xb1')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/freshdesk/accounts',require(_0xa3ef('0xb2')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xb3'),require(_0xa3ef('0xb4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xb5'),require(_0xa3ef('0xb6')));_0x1c6df4['use']('/api/integrations/vtiger/accounts',require(_0xa3ef('0xb7')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xb8'),require(_0xa3ef('0xb9')));_0x1c6df4['use'](_0xa3ef('0xba'),require(_0xa3ef('0xbb')));_0x1c6df4['use'](_0xa3ef('0xbc'),require(_0xa3ef('0xbd')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xbe'),require(_0xa3ef('0xbf')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/servicenow/fields',require(_0xa3ef('0xc0')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xc1'),require(_0xa3ef('0xc2')));_0x1c6df4['use'](_0xa3ef('0xc3'),require(_0xa3ef('0xc4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xc5'),require(_0xa3ef('0xc6')));_0x1c6df4['use'](_0xa3ef('0xc7'),require(_0xa3ef('0xc8')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xc9'),require(_0xa3ef('0xca')));_0x1c6df4[_0xa3ef('0x9')]('/api/integrations/freshsales/fields',require(_0xa3ef('0xcb')));_0x1c6df4[_0xa3ef('0x9')]('/api/networks',require('./api/network'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xcc'),require(_0xa3ef('0xcd')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xce'),require(_0xa3ef('0xcf')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd0'),require(_0xa3ef('0xd1')));_0x1c6df4['use']('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd2'),require('./api/jscriptySessionReport'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd3'),require(_0xa3ef('0xd4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd5'),require(_0xa3ef('0xd6')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd7'),require(_0xa3ef('0xd8')));_0x1c6df4['use']('/api/jscripty/projects',require('./api/jscriptyProject'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xd9'),require(_0xa3ef('0xda')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xdb'),require(_0xa3ef('0xdc')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xdd'),require('./api/squareProject'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xde'),require(_0xa3ef('0xdf')));_0x1c6df4['use']('/api/square/messages',require(_0xa3ef('0xe0')));_0x1c6df4['use'](_0xa3ef('0xe1'),require('./api/team'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xe2'),require(_0xa3ef('0xe3')));_0x1c6df4[_0xa3ef('0x9')]('/api/campaigns',require(_0xa3ef('0xe4')));_0x1c6df4[_0xa3ef('0x9')]('/api/migrations',require(_0xa3ef('0xe5')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xe6'),require(_0xa3ef('0xe7')));_0x1c6df4[_0xa3ef('0x9')]('/api/plugins',require(_0xa3ef('0xe8')));_0x1c6df4['use'](_0xa3ef('0xe9'),require('./api/mailTransferReport'));_0x1c6df4['use'](_0xa3ef('0xea'),require('./api/chatTransferReport'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xeb'),require('./api/faxTransferReport'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xec'),require(_0xa3ef('0xed')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xee'),require(_0xa3ef('0xef')));_0x1c6df4['use'](_0xa3ef('0xf0'),require(_0xa3ef('0xf1')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xf2'),require('./api/voicePrefix'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xf3'),require(_0xa3ef('0xf4')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xf5'),require('./api/userProfileSection'));_0x1c6df4[_0xa3ef('0x9')]('/api/userProfile/resources',require(_0xa3ef('0xf6')));_0x1c6df4['use'](_0xa3ef('0xf7'),require(_0xa3ef('0xf8')));_0x1c6df4[_0xa3ef('0x9')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xf9'),require(_0xa3ef('0xfa')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xfb'),require('./api/whatsappInteraction'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xfc'),require('./api/whatsappMessage'));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xfd'),require(_0xa3ef('0xfe')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0xff'),require(_0xa3ef('0x100')));_0x1c6df4['use'](_0xa3ef('0x101'),require(_0xa3ef('0x102')));_0x1c6df4['use'](_0xa3ef('0x103'),require(_0xa3ef('0x104')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x105'),require('./api/realtime'));_0x1c6df4['use'](_0xa3ef('0x106'),require(_0xa3ef('0x107')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x108'),require(_0xa3ef('0x109')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x10a'),require('./api/jira'));_0x1c6df4[_0xa3ef('0x9')]('/api/rpc',require(_0xa3ef('0x10b')));_0x1c6df4['use']('/api/version',require(_0xa3ef('0x10c')));_0x1c6df4['use'](_0xa3ef('0x10d'),require(_0xa3ef('0x10e')));_0x1c6df4['use'](_0xa3ef('0x10f'),require('./api/pm2'));_0x1c6df4[_0xa3ef('0x9')]('/api/webbar',require('./api/webbar'));_0x1c6df4['use'](_0xa3ef('0x110'),express['static'](path[_0xa3ef('0x111')](config['root'],'/apidoc')));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x112'),express[_0xa3ef('0x113')](path[_0xa3ef('0x111')](config[_0xa3ef('0x114')],_0xa3ef('0x112'))));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x115'),express[_0xa3ef('0x113')](path['join'](config[_0xa3ef('0x114')],_0xa3ef('0x115'))));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x116'),express[_0xa3ef('0x113')](path[_0xa3ef('0x111')](config[_0xa3ef('0x114')],_0xa3ef('0x117'),_0xa3ef('0x118'))));_0x1c6df4[_0xa3ef('0x9')](_0xa3ef('0x119'),express['static'](path[_0xa3ef('0x111')](config['root'],'/server/files/plugins')));_0x1c6df4[_0xa3ef('0x11a')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xa3ef('0x11b')](errors[0x194]);_0x1c6df4[_0xa3ef('0x11a')]('/*')[_0xa3ef('0x11b')](function(_0x25c259,_0x3a517f){_0x3a517f[_0xa3ef('0x11c')](path[_0xa3ef('0x11d')](_0x1c6df4[_0xa3ef('0x11b')]('appPath')+_0xa3ef('0x11e')));});};var sensitiveFields=[_0xa3ef('0x11f'),_0xa3ef('0x120'),_0xa3ef('0x121'),_0xa3ef('0x122'),_0xa3ef('0x123'),_0xa3ef('0x124'),_0xa3ef('0x125'),_0xa3ef('0x126'),_0xa3ef('0x127'),_0xa3ef('0x128'),_0xa3ef('0x129'),'clientId',_0xa3ef('0x12a'),_0xa3ef('0x12b'),'code',_0xa3ef('0x12c'),_0xa3ef('0x12d'),'token',_0xa3ef('0x12e'),'accessToken',_0xa3ef('0x12f'),_0xa3ef('0x130'),_0xa3ef('0x131'),_0xa3ef('0x132'),'membername',_0xa3ef('0x133'),'calleridnum',_0xa3ef('0x134'),_0xa3ef('0x135'),_0xa3ef('0x136'),'privateKey',_0xa3ef('0x137'),_0xa3ef('0x138'),_0xa3ef('0x139'),_0xa3ef('0x17'),_0xa3ef('0x13a'),_0xa3ef('0x13b'),_0xa3ef('0x13c'),_0xa3ef('0x13d'),_0xa3ef('0x13e'),_0xa3ef('0x13f'),'oldPassword'];function maskSensitiveData(_0x279a48){var _0x454f79=/(?!^)[\s\S](?!$)/g;if(!_[_0xa3ef('0x140')](_0x279a48))return;for(var _0x3f8aca in _0x279a48){if(_[_0xa3ef('0x141')](_0x279a48[_0x3f8aca])){for(var _0x57cc2e=0x0;_0x57cc2e<_0x279a48[_0x3f8aca]['length'];_0x57cc2e++){maskSensitiveData(_0x279a48[_0x3f8aca][_0x57cc2e]);}}else if(_['isPlainObject'](_0x279a48[_0x3f8aca])){maskSensitiveData(_0x279a48[_0x3f8aca]);}else if(_[_0xa3ef('0x142')](_0x279a48[_0x3f8aca])){_0x279a48[_0x3f8aca]=_0x279a48[_0x3f8aca][_0xa3ef('0x143')](/{{{/g,_0xa3ef('0x144'))[_0xa3ef('0x143')](/}}}/g,_0xa3ef('0x145'))[_0xa3ef('0x143')](/{{/g,'@{')[_0xa3ef('0x143')](/}}/g,'}@');if(_[_0xa3ef('0x146')](sensitiveFields,_0x3f8aca)){_0x279a48[_0x3f8aca]=_0x279a48[_0x3f8aca]['replace'](_0x454f79,'*');}}}} \ No newline at end of file +var _0x06a5=['./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','./api/realtime','./api/authLocal','/api/auth/google','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','newPassword','apiKey','firstName','lastName','street','mobile','fax','email','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','pass','localstationid','secret','registry','oldPassword','isPlainObject','isArray','@@{','replace','}@@','lodash','express','express-winston','./errors','./config/logger','api','auth','default','use','logger','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./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/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/reports/queue','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/actions','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/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/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','/api/jscripty/projects','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage'];(function(_0x238c67,_0x4c409e){var _0x51d179=function(_0x24ab46){while(--_0x24ab46){_0x238c67['push'](_0x238c67['shift']());}};_0x51d179(++_0x4c409e);}(_0x06a5,0x17e));var _0x506a=function(_0x55c307,_0x22b2ce){_0x55c307=_0x55c307-0x0;var _0xcca0a9=_0x06a5[_0x55c307];return _0xcca0a9;};'use strict';var _=require(_0x506a('0x0'));var path=require('path');var express=require(_0x506a('0x1'));var ewinston=require(_0x506a('0x2'));var util=require('util');var errors=require(_0x506a('0x3'));var config=require('./config/environment');var logger=require(_0x506a('0x4'))(_0x506a('0x5'));var authLogger=require(_0x506a('0x4'))(_0x506a('0x6'));exports[_0x506a('0x7')]=function(_0x293861){_0x293861[_0x506a('0x8')](ewinston[_0x506a('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x43d195,_0x157196){var _0x1c7af1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x506a('0xa')](_0x43d195[_0x506a('0xb')])){_0x1c7af1+=_0x506a('0xc');var _0x221421=_0x43d195[_0x506a('0xb')];maskSensitiveData(_0x221421);}return util[_0x506a('0xd')](_0x1c7af1,_0x43d195[_0x506a('0xe')],_0x43d195[_0x506a('0xf')][_0x506a('0x10')]?_0x43d195[_0x506a('0xf')][_0x506a('0x10')]:_0x43d195[_0x506a('0x11')][_0x506a('0x12')]||_0x43d195['ip'],_0x43d195['url'],_0x157196['statusCode'],_0x157196[_0x506a('0x13')],_0x43d195[_0x506a('0x14')]?_0x43d195[_0x506a('0x14')]['id']:null,_0x43d195[_0x506a('0x14')]?_0x43d195['user'][_0x506a('0x15')]:null,_0x43d195[_0x506a('0x14')]?_0x43d195[_0x506a('0x14')][_0x506a('0x16')]:null,_0x221421?util[_0x506a('0x17')](_0x221421,![],null):'');}}));_0x293861[_0x506a('0x8')](ewinston[_0x506a('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4728e4,_0x4581b6){var _0x19f24e=_0x506a('0x18');if(_0x4728e4[_0x506a('0xb')]&&_0x4728e4[_0x506a('0xb')][_0x506a('0x19')]&&_0x4728e4[_0x506a('0xb')][_0x506a('0x1a')]){_0x19f24e=_0x506a('0x1b');}return util[_0x506a('0xd')](_0x19f24e,_0x4728e4[_0x506a('0xe')],_0x4728e4['headers']['x-forwarded-for']?_0x4728e4[_0x506a('0xf')][_0x506a('0x10')]:_0x4728e4[_0x506a('0x11')]['remoteAddress']||_0x4728e4['ip'],_0x4728e4['url'],_0x4581b6[_0x506a('0x1c')],_0x4581b6[_0x506a('0x13')],_0x4728e4[_0x506a('0x14')]?_0x4728e4['user']['id']:null,_0x4728e4[_0x506a('0x14')]?_0x4728e4[_0x506a('0x14')]['name']:null,_0x4728e4[_0x506a('0x14')]?_0x4728e4['user']['role']:null,_0x4728e4[_0x506a('0xb')]&&_0x4728e4['body']['device']?_0x4728e4[_0x506a('0xb')][_0x506a('0x19')]:_0x506a('0x1d'),_0x4728e4[_0x506a('0xb')]&&_0x4728e4[_0x506a('0xb')]['agent_id']?_0x4728e4[_0x506a('0xb')][_0x506a('0x1a')]:'',_0x4728e4[_0x506a('0xb')]&&_0x4728e4[_0x506a('0xb')][_0x506a('0x1e')]?_0x4728e4[_0x506a('0xb')][_0x506a('0x1e')]:'');},'ignoreRoute':function(_0x3ec1a7){var _0x2cc68f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2cc68f['test'](_0x3ec1a7['url']);}}));_0x293861[_0x506a('0x8')](_0x506a('0x1f'),require(_0x506a('0x20')));_0x293861[_0x506a('0x8')](_0x506a('0x21'),require(_0x506a('0x22')));_0x293861[_0x506a('0x8')]('/api/voice/contexts',require(_0x506a('0x23')));_0x293861[_0x506a('0x8')](_0x506a('0x24'),require('./api/voiceExtension'));_0x293861[_0x506a('0x8')]('/api/voice/mohs',require(_0x506a('0x25')));_0x293861[_0x506a('0x8')](_0x506a('0x26'),require(_0x506a('0x27')));_0x293861[_0x506a('0x8')](_0x506a('0x28'),require(_0x506a('0x29')));_0x293861[_0x506a('0x8')](_0x506a('0x2a'),require(_0x506a('0x2b')));_0x293861[_0x506a('0x8')]('/api/voice/mails',require(_0x506a('0x2c')));_0x293861[_0x506a('0x8')](_0x506a('0x2d'),require('./api/voiceMailMessage'));_0x293861[_0x506a('0x8')](_0x506a('0x2e'),require(_0x506a('0x2f')));_0x293861['use'](_0x506a('0x30'),require(_0x506a('0x31')));_0x293861[_0x506a('0x8')](_0x506a('0x32'),require(_0x506a('0x33')));_0x293861[_0x506a('0x8')](_0x506a('0x34'),require('./api/voiceQueueReport'));_0x293861['use']('/api/members/reports',require(_0x506a('0x35')));_0x293861[_0x506a('0x8')](_0x506a('0x36'),require(_0x506a('0x37')));_0x293861[_0x506a('0x8')]('/api/voice/transfers/reports',require(_0x506a('0x38')));_0x293861['use'](_0x506a('0x39'),require(_0x506a('0x3a')));_0x293861[_0x506a('0x8')](_0x506a('0x3b'),require(_0x506a('0x3c')));_0x293861['use'](_0x506a('0x3d'),require('./api/mailQueue'));_0x293861[_0x506a('0x8')](_0x506a('0x3e'),require(_0x506a('0x3f')));_0x293861[_0x506a('0x8')](_0x506a('0x40'),require(_0x506a('0x41')));_0x293861[_0x506a('0x8')](_0x506a('0x42'),require('./api/mailMessage'));_0x293861[_0x506a('0x8')]('/api/mail/applications',require('./api/mailApplication'));_0x293861[_0x506a('0x8')](_0x506a('0x43'),require('./api/mailQueueReport'));_0x293861['use']('/api/dashboards',require('./api/dashboard'));_0x293861[_0x506a('0x8')]('/api/dashboards/items',require('./api/dashboardItem'));_0x293861[_0x506a('0x8')](_0x506a('0x44'),require(_0x506a('0x45')));_0x293861[_0x506a('0x8')]('/api/fax/applications',require('./api/faxApplication'));_0x293861[_0x506a('0x8')](_0x506a('0x46'),require(_0x506a('0x47')));_0x293861[_0x506a('0x8')](_0x506a('0x48'),require(_0x506a('0x49')));_0x293861[_0x506a('0x8')](_0x506a('0x4a'),require(_0x506a('0x4b')));_0x293861[_0x506a('0x8')](_0x506a('0x4c'),require(_0x506a('0x4d')));_0x293861['use'](_0x506a('0x4e'),require(_0x506a('0x4f')));_0x293861[_0x506a('0x8')](_0x506a('0x50'),require(_0x506a('0x51')));_0x293861[_0x506a('0x8')]('/api/sms/interactions',require(_0x506a('0x52')));_0x293861[_0x506a('0x8')](_0x506a('0x53'),require(_0x506a('0x54')));_0x293861[_0x506a('0x8')](_0x506a('0x55'),require(_0x506a('0x56')));_0x293861[_0x506a('0x8')](_0x506a('0x57'),require(_0x506a('0x58')));_0x293861[_0x506a('0x8')](_0x506a('0x59'),require(_0x506a('0x5a')));_0x293861[_0x506a('0x8')](_0x506a('0x5b'),require(_0x506a('0x5c')));_0x293861[_0x506a('0x8')](_0x506a('0x5d'),require(_0x506a('0x5e')));_0x293861[_0x506a('0x8')]('/api/openchannel/queues',require(_0x506a('0x5f')));_0x293861['use'](_0x506a('0x60'),require('./api/chatWebsite'));_0x293861[_0x506a('0x8')](_0x506a('0x61'),require(_0x506a('0x62')));_0x293861[_0x506a('0x8')](_0x506a('0x63'),require(_0x506a('0x64')));_0x293861['use'](_0x506a('0x65'),require(_0x506a('0x66')));_0x293861['use'](_0x506a('0x67'),require('./api/chatMessage'));_0x293861[_0x506a('0x8')](_0x506a('0x68'),require(_0x506a('0x69')));_0x293861[_0x506a('0x8')](_0x506a('0x6a'),require(_0x506a('0x6b')));_0x293861[_0x506a('0x8')](_0x506a('0x6c'),require(_0x506a('0x6d')));_0x293861[_0x506a('0x8')](_0x506a('0x6e'),require('./api/chatProactiveAction'));_0x293861[_0x506a('0x8')](_0x506a('0x6f'),require('./api/cmCompany'));_0x293861[_0x506a('0x8')](_0x506a('0x70'),require('./api/cmContact'));_0x293861[_0x506a('0x8')](_0x506a('0x71'),require(_0x506a('0x72')));_0x293861[_0x506a('0x8')](_0x506a('0x73'),require('./api/cmHopperBlack'));_0x293861[_0x506a('0x8')](_0x506a('0x74'),require(_0x506a('0x75')));_0x293861[_0x506a('0x8')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x293861[_0x506a('0x8')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x293861[_0x506a('0x8')](_0x506a('0x76'),require('./api/action'));_0x293861[_0x506a('0x8')]('/api/automations',require('./api/automation'));_0x293861['use'](_0x506a('0x77'),require(_0x506a('0x78')));_0x293861[_0x506a('0x8')](_0x506a('0x79'),require('./api/disposition'));_0x293861['use'](_0x506a('0x7a'),require(_0x506a('0x7b')));_0x293861[_0x506a('0x8')]('/api/intervals',require(_0x506a('0x7c')));_0x293861['use']('/api/pauses',require(_0x506a('0x7d')));_0x293861[_0x506a('0x8')](_0x506a('0x7e'),require(_0x506a('0x7f')));_0x293861[_0x506a('0x8')](_0x506a('0x80'),require('./api/voiceQueuesLog'));_0x293861[_0x506a('0x8')](_0x506a('0x81'),require(_0x506a('0x82')));_0x293861[_0x506a('0x8')](_0x506a('0x83'),require(_0x506a('0x84')));_0x293861[_0x506a('0x8')](_0x506a('0x85'),require('./api/tag'));_0x293861[_0x506a('0x8')](_0x506a('0x86'),require(_0x506a('0x87')));_0x293861[_0x506a('0x8')]('/api/triggers',require(_0x506a('0x88')));_0x293861[_0x506a('0x8')](_0x506a('0x89'),require('./api/variable'));_0x293861['use'](_0x506a('0x8a'),require(_0x506a('0x8b')));_0x293861[_0x506a('0x8')](_0x506a('0x8c'),require(_0x506a('0x8d')));_0x293861[_0x506a('0x8')]('/api/analytics/custom_reports',require(_0x506a('0x8e')));_0x293861[_0x506a('0x8')](_0x506a('0x8f'),require(_0x506a('0x90')));_0x293861[_0x506a('0x8')]('/api/analytics/extracted_reports',require(_0x506a('0x91')));_0x293861[_0x506a('0x8')](_0x506a('0x92'),require(_0x506a('0x93')));_0x293861[_0x506a('0x8')]('/api/analytics/field_reports',require(_0x506a('0x94')));_0x293861[_0x506a('0x8')](_0x506a('0x95'),require('./api/analyticTreeReport'));_0x293861[_0x506a('0x8')](_0x506a('0x96'),require(_0x506a('0x97')));_0x293861[_0x506a('0x8')](_0x506a('0x98'),require(_0x506a('0x99')));_0x293861[_0x506a('0x8')](_0x506a('0x9a'),require(_0x506a('0x9b')));_0x293861[_0x506a('0x8')](_0x506a('0x9c'),require(_0x506a('0x9d')));_0x293861[_0x506a('0x8')](_0x506a('0x9e'),require(_0x506a('0x9f')));_0x293861[_0x506a('0x8')](_0x506a('0xa0'),require(_0x506a('0xa1')));_0x293861[_0x506a('0x8')](_0x506a('0xa2'),require(_0x506a('0xa3')));_0x293861[_0x506a('0x8')](_0x506a('0xa4'),require('./api/intDeskConfiguration'));_0x293861[_0x506a('0x8')](_0x506a('0xa5'),require(_0x506a('0xa6')));_0x293861['use']('/api/integrations/zoho/accounts',require(_0x506a('0xa7')));_0x293861['use'](_0x506a('0xa8'),require(_0x506a('0xa9')));_0x293861[_0x506a('0x8')](_0x506a('0xaa'),require('./api/intZohoField'));_0x293861[_0x506a('0x8')](_0x506a('0xab'),require(_0x506a('0xac')));_0x293861[_0x506a('0x8')](_0x506a('0xad'),require('./api/intZendeskConfiguration'));_0x293861[_0x506a('0x8')](_0x506a('0xae'),require('./api/intZendeskField'));_0x293861['use'](_0x506a('0xaf'),require(_0x506a('0xb0')));_0x293861[_0x506a('0x8')](_0x506a('0xb1'),require(_0x506a('0xb2')));_0x293861['use'](_0x506a('0xb3'),require('./api/intFreshdeskField'));_0x293861[_0x506a('0x8')](_0x506a('0xb4'),require(_0x506a('0xb5')));_0x293861[_0x506a('0x8')](_0x506a('0xb6'),require('./api/intVtigerConfiguration'));_0x293861['use'](_0x506a('0xb7'),require(_0x506a('0xb8')));_0x293861['use']('/api/integrations/servicenow/accounts',require(_0x506a('0xb9')));_0x293861[_0x506a('0x8')](_0x506a('0xba'),require(_0x506a('0xbb')));_0x293861[_0x506a('0x8')]('/api/integrations/servicenow/fields',require(_0x506a('0xbc')));_0x293861[_0x506a('0x8')]('/api/integrations/dynamics365/accounts',require(_0x506a('0xbd')));_0x293861[_0x506a('0x8')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x293861['use'](_0x506a('0xbe'),require(_0x506a('0xbf')));_0x293861['use']('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x293861[_0x506a('0x8')](_0x506a('0xc0'),require('./api/intFreshsalesConfiguration'));_0x293861[_0x506a('0x8')](_0x506a('0xc1'),require(_0x506a('0xc2')));_0x293861[_0x506a('0x8')](_0x506a('0xc3'),require('./api/network'));_0x293861['use'](_0x506a('0xc4'),require(_0x506a('0xc5')));_0x293861[_0x506a('0x8')](_0x506a('0xc6'),require(_0x506a('0xc7')));_0x293861[_0x506a('0x8')](_0x506a('0xc8'),require('./api/jscriptyAnswerReport'));_0x293861['use']('/api/jscripty/questions/reports',require(_0x506a('0xc9')));_0x293861[_0x506a('0x8')](_0x506a('0xca'),require('./api/jscriptySessionReport'));_0x293861[_0x506a('0x8')](_0x506a('0xcb'),require(_0x506a('0xcc')));_0x293861[_0x506a('0x8')](_0x506a('0xcd'),require('./api/squareReport'));_0x293861[_0x506a('0x8')](_0x506a('0xce'),require('./api/squareReportDetail'));_0x293861[_0x506a('0x8')](_0x506a('0xcf'),require('./api/jscriptyProject'));_0x293861[_0x506a('0x8')]('/api/settings',require('./api/setting'));_0x293861[_0x506a('0x8')]('/api/square/odbc',require(_0x506a('0xd0')));_0x293861[_0x506a('0x8')](_0x506a('0xd1'),require(_0x506a('0xd2')));_0x293861[_0x506a('0x8')](_0x506a('0xd3'),require(_0x506a('0xd4')));_0x293861[_0x506a('0x8')]('/api/square/messages',require(_0x506a('0xd5')));_0x293861['use'](_0x506a('0xd6'),require('./api/team'));_0x293861[_0x506a('0x8')](_0x506a('0xd7'),require(_0x506a('0xd8')));_0x293861[_0x506a('0x8')](_0x506a('0xd9'),require(_0x506a('0xda')));_0x293861['use'](_0x506a('0xdb'),require('./api/migration'));_0x293861[_0x506a('0x8')](_0x506a('0xdc'),require(_0x506a('0xdd')));_0x293861[_0x506a('0x8')](_0x506a('0xde'),require(_0x506a('0xdf')));_0x293861['use']('/api/mail/reports/transfer',require(_0x506a('0xe0')));_0x293861[_0x506a('0x8')](_0x506a('0xe1'),require('./api/chatTransferReport'));_0x293861[_0x506a('0x8')](_0x506a('0xe2'),require(_0x506a('0xe3')));_0x293861['use']('/api/openchannel/reports/transfer',require(_0x506a('0xe4')));_0x293861[_0x506a('0x8')](_0x506a('0xe5'),require(_0x506a('0xe6')));_0x293861[_0x506a('0x8')]('/api/cm/lists',require(_0x506a('0xe7')));_0x293861[_0x506a('0x8')](_0x506a('0xe8'),require(_0x506a('0xe9')));_0x293861[_0x506a('0x8')](_0x506a('0xea'),require(_0x506a('0xeb')));_0x293861[_0x506a('0x8')](_0x506a('0xec'),require(_0x506a('0xed')));_0x293861[_0x506a('0x8')](_0x506a('0xee'),require('./api/userProfileResource'));_0x293861['use'](_0x506a('0xef'),require('./api/userNotification'));_0x293861['use']('/api/whatsapp/accounts',require(_0x506a('0xf0')));_0x293861[_0x506a('0x8')](_0x506a('0xf1'),require(_0x506a('0xf2')));_0x293861[_0x506a('0x8')]('/api/whatsapp/interactions',require(_0x506a('0xf3')));_0x293861['use'](_0x506a('0xf4'),require(_0x506a('0xf5')));_0x293861[_0x506a('0x8')]('/api/whatsapp/reports/queue',require(_0x506a('0xf6')));_0x293861[_0x506a('0x8')](_0x506a('0xf7'),require(_0x506a('0xf8')));_0x293861[_0x506a('0x8')](_0x506a('0xf9'),require(_0x506a('0xfa')));_0x293861[_0x506a('0x8')]('/api/cloudProviders',require(_0x506a('0xfb')));_0x293861['use']('/api/realtime',require(_0x506a('0xfc')));_0x293861[_0x506a('0x8')]('/api/auth/local',require(_0x506a('0xfd')));_0x293861[_0x506a('0x8')](_0x506a('0xfe'),require('./api/authGoogle'));_0x293861['use']('/api/jira',require(_0x506a('0xff')));_0x293861[_0x506a('0x8')](_0x506a('0x100'),require(_0x506a('0x101')));_0x293861[_0x506a('0x8')](_0x506a('0x102'),require(_0x506a('0x103')));_0x293861[_0x506a('0x8')](_0x506a('0x104'),require(_0x506a('0x105')));_0x293861[_0x506a('0x8')](_0x506a('0x106'),require(_0x506a('0x107')));_0x293861[_0x506a('0x8')]('/api/webbar',require('./api/webbar'));_0x293861[_0x506a('0x8')](_0x506a('0x108'),express[_0x506a('0x109')](path[_0x506a('0x10a')](config[_0x506a('0x10b')],_0x506a('0x108'))));_0x293861[_0x506a('0x8')](_0x506a('0x10c'),express[_0x506a('0x109')](path['join'](config[_0x506a('0x10b')],_0x506a('0x10c'))));_0x293861[_0x506a('0x8')](_0x506a('0x10d'),express[_0x506a('0x109')](path['join'](config[_0x506a('0x10b')],_0x506a('0x10d'))));_0x293861[_0x506a('0x8')]('/snippet',express[_0x506a('0x109')](path[_0x506a('0x10a')](config['root'],_0x506a('0x10e'),_0x506a('0x10f'))));_0x293861[_0x506a('0x8')](_0x506a('0x110'),express['static'](path[_0x506a('0x10a')](config['root'],_0x506a('0x111'))));_0x293861[_0x506a('0x112')](_0x506a('0x113'))['get'](errors[0x194]);_0x293861[_0x506a('0x112')]('/*')[_0x506a('0x114')](function(_0x3d075e,_0x43fa08){_0x43fa08['sendFile'](path[_0x506a('0x115')](_0x293861[_0x506a('0x114')](_0x506a('0x116'))+_0x506a('0x117')));});};var sensitiveFields=[_0x506a('0x118'),'password',_0x506a('0x119'),_0x506a('0x11a'),_0x506a('0x11b'),_0x506a('0x11c'),_0x506a('0x11d'),'phone',_0x506a('0x11e'),_0x506a('0x11f'),_0x506a('0x120'),'clientId',_0x506a('0x121'),_0x506a('0x122'),_0x506a('0x123'),_0x506a('0x124'),_0x506a('0x125'),_0x506a('0x126'),_0x506a('0x127'),_0x506a('0x128'),'accessTokenSecret','authToken',_0x506a('0x129'),'consumerSecret','membername','calleridname',_0x506a('0x12a'),_0x506a('0x12b'),_0x506a('0x12c'),_0x506a('0x12d'),_0x506a('0x12e'),_0x506a('0x12f'),'secretaccesskey','key',_0x506a('0x14'),_0x506a('0x130'),'accountSid',_0x506a('0x131'),'dsn',_0x506a('0x132'),_0x506a('0x133'),_0x506a('0x134')];function maskSensitiveData(_0x32d008){var _0x521ab0=/(?!^)[\s\S](?!$)/g;if(!_[_0x506a('0x135')](_0x32d008))return;for(var _0x233a58 in _0x32d008){if(_[_0x506a('0x136')](_0x32d008[_0x233a58])){for(var _0xf92401=0x0;_0xf92401<_0x32d008[_0x233a58]['length'];_0xf92401++){maskSensitiveData(_0x32d008[_0x233a58][_0xf92401]);}}else if(_[_0x506a('0x135')](_0x32d008[_0x233a58])){maskSensitiveData(_0x32d008[_0x233a58]);}else if(_['isString'](_0x32d008[_0x233a58])){_0x32d008[_0x233a58]=_0x32d008[_0x233a58]['replace'](/{{{/g,_0x506a('0x137'))[_0x506a('0x138')](/}}}/g,_0x506a('0x139'))['replace'](/{{/g,'@{')[_0x506a('0x138')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x233a58)){_0x32d008[_0x233a58]=_0x32d008[_0x233a58][_0x506a('0x138')](_0x521ab0,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index cd90999..227da6a 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e81=['../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.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/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc'];(function(_0x5d6fcd,_0x2c17c3){var _0x537687=function(_0x1cd585){while(--_0x1cd585){_0x5d6fcd['push'](_0x5d6fcd['shift']());}};_0x537687(++_0x2c17c3);}(_0x6e81,0x18d));var _0x16e8=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6e81[_0x4b369d];return _0x571a98;};'use strict';var jayson=require(_0x16e8('0x0'));var BPromise=require(_0x16e8('0x1'));var _=require('lodash');var config=require(_0x16e8('0x2'));exports[_0x16e8('0x3')]=function(){return new BPromise(function(_0x588e5e,_0x3257fd){var _0x190bc8={};_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x5')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x6')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x7')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x8')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x9')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xa')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xb')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xc')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xd')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0xe')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0xf')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x10')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x11')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x12')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x13')));_0x190bc8=_['merge'](_0x190bc8,require('../api/mailMessage/mailMessage.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/mailApplication/mailApplication.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x14')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x15')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x16')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/faxInteraction/faxInteraction.rpc'));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x17')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x18')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x19')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x1a')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/smsInteraction/smsInteraction.rpc'));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x1b')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x1c')));_0x190bc8=_['merge'](_0x190bc8,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x1d')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x1e')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x1f')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/chatMessage/chatMessage.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/chatQueue/chatQueue.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x20')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x21')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x22')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x23')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x24')));_0x190bc8=_['merge'](_0x190bc8,require('../api/interval/interval.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x25')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x26')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/template/template.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x27')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x28')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x29')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x2a')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x2b')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x2c')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x2d')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x2e')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x2f')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x30')));_0x190bc8=_['merge'](_0x190bc8,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x31')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x32')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x33')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x34')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x35')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/squareProject/squareProject.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x36')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x37')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x38')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/attachment/attachment.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x39')));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x190bc8=_[_0x16e8('0x4')](_0x190bc8,require(_0x16e8('0x3a')));_0x190bc8=_['merge'](_0x190bc8,require(_0x16e8('0x3b')));_0x190bc8=_['merge'](_0x190bc8,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x209143=jayson[_0x16e8('0x3c')](_0x190bc8)[_0x16e8('0x3d')]();var _0x26b9c7=config[_0x16e8('0x3e')][_0x16e8('0x3f')]||config[_0x16e8('0x3f')]+0x1;var _0x2cb6f6=config[_0x16e8('0x3e')]['ip']||'localhost';_0x209143['on'](_0x16e8('0x40'),function(_0x8bc877){return _0x3257fd(_0x8bc877);});_0x209143['listen'](_0x26b9c7,_0x2cb6f6,function(){console[_0x16e8('0x41')](_0x16e8('0x42'),_0x2cb6f6,_0x26b9c7);require(_0x16e8('0x43'))['default']();return _0x588e5e(_0x16e8('0x44')+_0x2cb6f6+':'+_0x26b9c7);});});}; \ No newline at end of file +var _0xf169=['../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.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/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/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','http','port','rpc','localhost','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.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/mailAccount/mailAccount.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x5755f0,_0x101bb7){var _0x5b25aa=function(_0x3ca0b4){while(--_0x3ca0b4){_0x5755f0['push'](_0x5755f0['shift']());}};_0x5b25aa(++_0x101bb7);}(_0xf169,0x19a));var _0x9f16=function(_0x1ab229,_0x55570e){_0x1ab229=_0x1ab229-0x0;var _0x403d18=_0xf169[_0x1ab229];return _0x403d18;};'use strict';var jayson=require(_0x9f16('0x0'));var BPromise=require(_0x9f16('0x1'));var _=require('lodash');var config=require(_0x9f16('0x2'));exports[_0x9f16('0x3')]=function(){return new BPromise(function(_0x458ca1,_0x5da34c){var _0x5538bc={};_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x4')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/voiceExtension/voiceExtension.rpc'));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x6')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/voiceRecording/voiceRecording.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x7')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x8')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x9')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0xa')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0xb')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0xc')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0xd')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/mailServerIn/mailServerIn.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0xe')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/mailQueue/mailQueue.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/mailInteraction/mailInteraction.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0xf')));_0x5538bc=_['merge'](_0x5538bc,require('../api/mailApplication/mailApplication.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x10')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/faxAccount/faxAccount.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x11')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/faxInteraction/faxInteraction.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x12')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x13')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x14')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/smsAccount/smsAccount.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x15')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x16')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/smsQueue/smsQueue.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x17')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x18')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x19')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x1a')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x1b')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x1c')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x1d')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x1e')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x1f')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x20')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x21')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x22')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x23')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x24')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/interval/interval.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x25')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x26')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x27')));_0x5538bc=_['merge'](_0x5538bc,require('../api/trigger/trigger.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/variable/variable.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x28')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x29')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x2a')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x2b')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x2c')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x2d')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x2e')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x2f')));_0x5538bc=_['merge'](_0x5538bc,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x30')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x31')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x32')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x33')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x34')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x35')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x36')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x37')));_0x5538bc=_['merge'](_0x5538bc,require(_0x9f16('0x38')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require('../api/attachment/attachment.rpc'));_0x5538bc=_['merge'](_0x5538bc,require('../api/plugin/plugin.rpc'));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x39')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x3a')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x3b')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x3c')));_0x5538bc=_[_0x9f16('0x5')](_0x5538bc,require(_0x9f16('0x3d')));var _0x1a96ca=jayson[_0x9f16('0x3e')](_0x5538bc)[_0x9f16('0x3f')]();var _0x328884=config['rpc'][_0x9f16('0x40')]||config[_0x9f16('0x40')]+0x1;var _0x6aad13=config[_0x9f16('0x41')]['ip']||_0x9f16('0x42');_0x1a96ca['on'](_0x9f16('0x43'),function(_0x402166){return _0x5da34c(_0x402166);});_0x1a96ca[_0x9f16('0x3')](_0x328884,_0x6aad13,function(){console[_0x9f16('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x6aad13,_0x328884);require(_0x9f16('0x45'))[_0x9f16('0x46')]();return _0x458ca1(_0x9f16('0x47')+_0x6aad13+':'+_0x328884);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 047f57f..4758193 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 _0x5302=['BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','sendRequest','command','sync','prototype','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','setPriority','GET\x20VARIABLE\x20\x22%s\x22','wav'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x5302,0x1b5));var _0x2530=function(_0x3ac42c,_0x128452){_0x3ac42c=_0x3ac42c-0x0;var _0x53170b=_0x5302[_0x3ac42c];return _0x53170b;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x2530('0x0'))[_0x2530('0x1')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x1b3a90){var _0x5d56c2=this,_0x1561a1=new AGIReply(),_0x4ae9db=![],_0x371cf1={};EventEmitter[_0x2530('0x2')](_0x5d56c2);_0x1b3a90[_0x2530('0x3')](_0x2530('0x4'));_0x1b3a90[_0x2530('0x5')](0x8*0x3c*0x3c*0x3e8);_0x1561a1['setEncoding'](_0x2530('0x4'));_0x1561a1['on'](_0x2530('0x6'),function(_0x22fb53){for(var _0x1070de in _0x22fb53){_0x5d56c2[_0x1070de]=_0x22fb53[_0x1070de];}_0x5d56c2[_0x2530('0x7')](_0x2530('0x8'));});_0x1561a1['on'](_0x2530('0x9'),function(_0x29ad3a){if(_0x29ad3a[_0x2530('0xa')]()==_0x2530('0xb')){_0x5d56c2[_0x2530('0x7')](_0x2530('0xb'));return;}if(_0x29ad3a[_0x2530('0xc')](0x0,0xb)==_0x2530('0xd')){_0x4ae9db=!![];}if(_0x4ae9db){_0x371cf1['rx']+=_0x29ad3a+'\x0a';if(_0x29ad3a[_0x2530('0xe')](_0x2530('0xf'))!=-0x1){_0x4ae9db=![];}}else{_0x371cf1['rx']=_0x29ad3a;}if(_0x4ae9db){return;}if(typeof _0x371cf1['cb']==_0x2530('0x10')){var _0x4d69e3=_0x371cf1['rx'][_0x2530('0xc')](0x0,0x3),_0x22821d=null,_0x296401=null;_0x4d69e3=parseInt(_0x4d69e3);if(isNaN(_0x4d69e3)){_0x371cf1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2530('0x11')});return;}if(_0x4d69e3!=0xc8){_0x371cf1['cb'](null,{'code':_0x4d69e3,'result':-0x1,'extra':'KO'});return;}_0x22821d=_0x371cf1['rx'][_0x2530('0xc')](0x4)[_0x2530('0x12')](_0x2530('0x13'),'');if(_0x22821d['indexOf']('\x20')!=-0x1){_0x22821d=_0x22821d['substr'](0x0,_0x22821d['indexOf']('\x20'));}if(_['startsWith'](_0x22821d,'-1')){_0x22821d=parseInt(_0x22821d);}_0x296401=_0x371cf1['rx'][_0x2530('0x14')]('\x20');if(_0x296401[_0x2530('0x15')]==0x3){_0x296401=_0x296401[0x2]['substring'](0x1,_0x296401[0x2][_0x2530('0x15')]-0x1);}else if(_0x296401[_0x2530('0x15')]>0x3){var _0x157d70=/\((.+)\)/;var _0x21676b=_0x371cf1['rx'][_0x2530('0x16')](_0x157d70);if(_0x21676b){_0x296401=_0x21676b[0x1];}else{_0x296401=null;}}else{_0x296401=null;}_0x371cf1['cb'](null,{'code':_0x4d69e3,'result':_0x22821d,'extra':_0x296401});}});_0x1b3a90['on'](_0x2530('0x17'),function(_0x3aac94){_0x5d56c2[_0x2530('0x7')](_0x2530('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x3aac94[_0x2530('0x18')]));});_0x1b3a90['on'](_0x2530('0x19'),function(){_0x5d56c2[_0x2530('0x7')](_0x2530('0x19'),new AGIError(_0x2530('0x1a')));});_0x1b3a90['on'](_0x2530('0x1b'),function(){_0x5d56c2[_0x2530('0x7')](_0x2530('0x1b'),new AGIError(_0x2530('0x1c')));_0x1b3a90[_0x2530('0x1d')]();});_0x1b3a90[_0x2530('0x1e')](_0x1561a1);this['command']=function(_0x1c2c2c,_0x301018){var _0x1c2c2c=_0x1c2c2c||'',_0x301018=typeof _0x301018==_0x2530('0x10')?_0x301018:new Function();_0x371cf1={'tx':_0x1c2c2c,'rx':'','cb':_0x301018};_0x1b3a90[_0x2530('0x1f')](_0x1c2c2c+'\x0a');},this[_0x2530('0x19')]=function(){_0x1b3a90[_0x2530('0x1d')]();};}util[_0x2530('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x2530('0x21')]=function(_0x302d4d){return this[_0x2530('0x22')][_0x2530('0x23')](this,_0x302d4d);};AGIChannel[_0x2530('0x24')]['answer']=function(){return this[_0x2530('0x21')]('ANSWER');};AGIChannel[_0x2530('0x24')][_0x2530('0x25')]=function(_0x3c0a0c,_0x5261a3,_0x146e97){_0x3c0a0c=_0x3c0a0c===undefined?'beep':_0x3c0a0c;_0x5261a3=_0x5261a3===undefined?'5':_0x5261a3;_0x146e97=_0x146e97===undefined?'1':_0x146e97;return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x27'),_0x3c0a0c,_0x5261a3*0x3e8,_0x146e97));};AGIChannel[_0x2530('0x24')]['noop']=function(_0x27e7e2){_0x27e7e2=_0x27e7e2||'NO\x20MESSAGE';return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x28'),_0x27e7e2));};AGIChannel[_0x2530('0x24')]['exec']=function(_0x4ed6c2,_0x16248d){if(_[_0x2530('0x29')](_0x16248d)){return this[_0x2530('0x21')](util['format']('EXEC\x20%s\x20%s',_0x4ed6c2,_0x16248d[_0x2530('0x2a')](',')));}return this[_0x2530('0x21')](util[_0x2530('0x26')](_0x2530('0x2b'),_0x4ed6c2,_0x16248d));};AGIChannel['prototype'][_0x2530('0x2c')]=function(_0x4f84e4){return this[_0x2530('0x21')](util[_0x2530('0x26')](_0x2530('0x2d'),_0x4f84e4));};AGIChannel[_0x2530('0x24')][_0x2530('0x2e')]=function(_0x3471de){return this[_0x2530('0x21')](util[_0x2530('0x26')](_0x2530('0x2f'),_0x3471de));};AGIChannel['prototype']['setPriority']=function(_0x5d375a){return this['sendRequest'](util[_0x2530('0x26')]('SET\x20PRIORITY\x20%s',_0x5d375a));};AGIChannel['prototype'][_0x2530('0xb')]=function(){return this[_0x2530('0x21')](_0x2530('0x30'));};AGIChannel[_0x2530('0x24')]['setVariable']=function(_0x2219dd,_0x45c183){var _0x57d493=_[_0x2530('0x31')](_0x45c183)||_['isNumber'](_0x45c183)?_0x45c183[_0x2530('0x32')]():_0x45c183;return this[_0x2530('0x21')](util['format'](_0x2530('0x33'),_0x2219dd,_0x57d493?_0x57d493[_0x2530('0x32')]()[_0x2530('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x2530('0x24')][_0x2530('0x34')]=function(_0x5a3291,_0x4e2e51){return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x35'),_0x5a3291,_0x4e2e51));};AGIChannel[_0x2530('0x24')][_0x2530('0x36')]=function(_0x2be799,_0x5058c8){return this['sendRequest'](util[_0x2530('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x2be799,_0x5058c8));};AGIChannel[_0x2530('0x24')][_0x2530('0x37')]=function(_0x13b82c,_0x2bb18e){return this[_0x2530('0x21')](util[_0x2530('0x26')](_0x2530('0x38'),_0x13b82c,_0x2bb18e));};AGIChannel[_0x2530('0x24')]['continueAt']=function(_0x5387d0,_0x39fdc5,_0x2b1c9b){_0x39fdc5=_0x39fdc5||this['extension'];_0x2b1c9b=_0x2b1c9b||0x1;this[_0x2530('0x2c')](_0x5387d0);this[_0x2530('0x2e')](_0x39fdc5);this[_0x2530('0x39')](_0x2b1c9b);return this['noop'](util['format']('GOTO\x20%s\x20%s\x20%s',_0x5387d0,_0x39fdc5,_0x2b1c9b));};AGIChannel[_0x2530('0x24')]['getVariable']=function(_0x15ae7e){return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x3a'),_0x15ae7e));};AGIChannel['prototype']['recordFile']=function(_0x544b89,_0x57f2cd,_0x544b8b,_0x5f08af,_0x317dee,_0x47aed3){_0x57f2cd=_0x57f2cd||_0x2530('0x3b');_0x544b8b=_0x544b8b||'';_0x5f08af=_0x5f08af===undefined?-0x1:_0x5f08af==='-1'?-0x1:_0x5f08af*0x3e8;_0x317dee=_0x317dee===undefined?'':'s='+_0x317dee;_0x47aed3=_0x47aed3?_0x2530('0x3c'):'';return this['sendRequest'](util[_0x2530('0x26')](_0x2530('0x3d'),_0x544b89,_0x57f2cd,_0x544b8b,_0x5f08af,_0x47aed3,_0x317dee));};AGIChannel[_0x2530('0x24')]['streamFile']=function(_0x3f7e30,_0x72e471){_0x72e471=_0x72e471||'';return this['sendRequest'](util['format'](_0x2530('0x3e'),_0x3f7e30,_0x72e471));};AGIChannel[_0x2530('0x24')][_0x2530('0x3f')]=function(_0x16ef9b){return this[_0x2530('0x40')](_0x2530('0x41'),_0x16ef9b);};AGIChannel['prototype'][_0x2530('0x42')]=function(_0x456d6c){return this[_0x2530('0x40')](_0x2530('0x43'),_0x456d6c);};AGIChannel['prototype']['error']=function(_0xd28d0d,_0x263aa6){this['noop'](util[_0x2530('0x26')](_0x2530('0x44'),_0xd28d0d['id'],_0xd28d0d[_0x2530('0x45')],_0x263aa6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2530('0x46')]=AGIChannel; \ No newline at end of file +var _0x481d=['noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','exports','util','lodash','events','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','command','function','write','destroy','inherits','sendRequest','prototype','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','exec','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setExtension'];(function(_0x4a0eaf,_0x312bfa){var _0x13ba23=function(_0x37fb9a){while(--_0x37fb9a){_0x4a0eaf['push'](_0x4a0eaf['shift']());}};_0x13ba23(++_0x312bfa);}(_0x481d,0x9c));var _0xd481=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0x481d[_0x45c262];return _0x4f2ba6;};'use strict';var util=require(_0xd481('0x0'));var _=require(_0xd481('0x1'));var EventEmitter=require(_0xd481('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x2a73ad){var _0x50d7b9=this,_0x58c5e3=new AGIReply(),_0x4caff3=![],_0x5c6a64={};EventEmitter[_0xd481('0x3')](_0x50d7b9);_0x2a73ad[_0xd481('0x4')](_0xd481('0x5'));_0x2a73ad[_0xd481('0x6')](0x8*0x3c*0x3c*0x3e8);_0x58c5e3['setEncoding']('utf8');_0x58c5e3['on'](_0xd481('0x7'),function(_0x46e782){for(var _0x1190e7 in _0x46e782){_0x50d7b9[_0x1190e7]=_0x46e782[_0x1190e7];}_0x50d7b9[_0xd481('0x8')](_0xd481('0x9'));});_0x58c5e3['on'](_0xd481('0xa'),function(_0x44f44e){if(_0x44f44e['toLowerCase']()==_0xd481('0xb')){_0x50d7b9[_0xd481('0x8')](_0xd481('0xb'));return;}if(_0x44f44e[_0xd481('0xc')](0x0,0xb)==_0xd481('0xd')){_0x4caff3=!![];}if(_0x4caff3){_0x5c6a64['rx']+=_0x44f44e+'\x0a';if(_0x44f44e[_0xd481('0xe')](_0xd481('0xf'))!=-0x1){_0x4caff3=![];}}else{_0x5c6a64['rx']=_0x44f44e;}if(_0x4caff3){return;}if(typeof _0x5c6a64['cb']=='function'){var _0x466a3f=_0x5c6a64['rx'][_0xd481('0xc')](0x0,0x3),_0x3fcdb8=null,_0xa414e8=null;_0x466a3f=parseInt(_0x466a3f);if(isNaN(_0x466a3f)){_0x5c6a64['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd481('0x10')});return;}if(_0x466a3f!=0xc8){_0x5c6a64['cb'](null,{'code':_0x466a3f,'result':-0x1,'extra':'KO'});return;}_0x3fcdb8=_0x5c6a64['rx']['substring'](0x4)[_0xd481('0x11')](_0xd481('0x12'),'');if(_0x3fcdb8[_0xd481('0x13')]('\x20')!=-0x1){_0x3fcdb8=_0x3fcdb8['substr'](0x0,_0x3fcdb8[_0xd481('0x13')]('\x20'));}if(_[_0xd481('0x14')](_0x3fcdb8,'-1')){_0x3fcdb8=parseInt(_0x3fcdb8);}_0xa414e8=_0x5c6a64['rx'][_0xd481('0x15')]('\x20');if(_0xa414e8[_0xd481('0x16')]==0x3){_0xa414e8=_0xa414e8[0x2][_0xd481('0xc')](0x1,_0xa414e8[0x2][_0xd481('0x16')]-0x1);}else if(_0xa414e8[_0xd481('0x16')]>0x3){var _0x2e5496=/\((.+)\)/;var _0x315803=_0x5c6a64['rx'][_0xd481('0x17')](_0x2e5496);if(_0x315803){_0xa414e8=_0x315803[0x1];}else{_0xa414e8=null;}}else{_0xa414e8=null;}_0x5c6a64['cb'](null,{'code':_0x466a3f,'result':_0x3fcdb8,'extra':_0xa414e8});}});_0x2a73ad['on'](_0xd481('0x18'),function(_0x42d486){_0x50d7b9[_0xd481('0x8')](_0xd481('0x18'),new AGIError(_0xd481('0x19'),_0x42d486[_0xd481('0x1a')]));});_0x2a73ad['on'](_0xd481('0x1b'),function(){_0x50d7b9[_0xd481('0x8')]('close',new AGIError(_0xd481('0x1c')));});_0x2a73ad['on']('timeout',function(){_0x50d7b9['emit']('timeout',new AGIError(_0xd481('0x1d')));_0x2a73ad['destroy']();});_0x2a73ad['pipe'](_0x58c5e3);this[_0xd481('0x1e')]=function(_0x438502,_0x181ac9){var _0x438502=_0x438502||'',_0x181ac9=typeof _0x181ac9==_0xd481('0x1f')?_0x181ac9:new Function();_0x5c6a64={'tx':_0x438502,'rx':'','cb':_0x181ac9};_0x2a73ad[_0xd481('0x20')](_0x438502+'\x0a');},this[_0xd481('0x1b')]=function(){_0x2a73ad[_0xd481('0x21')]();};}util[_0xd481('0x22')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xd481('0x23')]=function(_0xaad8ee){return this[_0xd481('0x1e')]['sync'](this,_0xaad8ee);};AGIChannel[_0xd481('0x24')]['answer']=function(){return this[_0xd481('0x23')]('ANSWER');};AGIChannel[_0xd481('0x24')][_0xd481('0x25')]=function(_0x4a9211,_0x213dd2,_0x59c139){_0x4a9211=_0x4a9211===undefined?'beep':_0x4a9211;_0x213dd2=_0x213dd2===undefined?'5':_0x213dd2;_0x59c139=_0x59c139===undefined?'1':_0x59c139;return this[_0xd481('0x23')](util[_0xd481('0x26')](_0xd481('0x27'),_0x4a9211,_0x213dd2*0x3e8,_0x59c139));};AGIChannel[_0xd481('0x24')]['noop']=function(_0x12524d){_0x12524d=_0x12524d||'NO\x20MESSAGE';return this[_0xd481('0x23')](util[_0xd481('0x26')]('VERBOSE\x20\x22%s\x22',_0x12524d));};AGIChannel[_0xd481('0x24')][_0xd481('0x28')]=function(_0x3c4755,_0x4e99b9){if(_['isArray'](_0x4e99b9)){return this['sendRequest'](util[_0xd481('0x26')](_0xd481('0x29'),_0x3c4755,_0x4e99b9[_0xd481('0x2a')](',')));}return this[_0xd481('0x23')](util[_0xd481('0x26')]('EXEC\x20%s\x20%s',_0x3c4755,_0x4e99b9));};AGIChannel[_0xd481('0x24')]['setContext']=function(_0x22a0bf){return this[_0xd481('0x23')](util[_0xd481('0x26')](_0xd481('0x2b'),_0x22a0bf));};AGIChannel[_0xd481('0x24')]['setExtension']=function(_0x30a5f9){return this[_0xd481('0x23')](util[_0xd481('0x26')](_0xd481('0x2c'),_0x30a5f9));};AGIChannel[_0xd481('0x24')][_0xd481('0x2d')]=function(_0x246349){return this[_0xd481('0x23')](util[_0xd481('0x26')](_0xd481('0x2e'),_0x246349));};AGIChannel[_0xd481('0x24')][_0xd481('0xb')]=function(){return this[_0xd481('0x23')]('HANGUP');};AGIChannel[_0xd481('0x24')][_0xd481('0x2f')]=function(_0x20ca5f,_0x36481e){var _0x10e118=_['isBoolean'](_0x36481e)||_[_0xd481('0x30')](_0x36481e)?_0x36481e[_0xd481('0x31')]():_0x36481e;return this['sendRequest'](util[_0xd481('0x26')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x20ca5f,_0x10e118?_0x10e118[_0xd481('0x31')]()[_0xd481('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd481('0x24')][_0xd481('0x32')]=function(_0xc408a8,_0x3491c8){return this[_0xd481('0x23')](util['format'](_0xd481('0x33'),_0xc408a8,_0x3491c8));};AGIChannel['prototype'][_0xd481('0x34')]=function(_0x182462,_0x52af80){return this[_0xd481('0x23')](util[_0xd481('0x26')](_0xd481('0x35'),_0x182462,_0x52af80));};AGIChannel[_0xd481('0x24')][_0xd481('0x36')]=function(_0x3e6517,_0x3485b6){return this[_0xd481('0x23')](util[_0xd481('0x26')](_0xd481('0x37'),_0x3e6517,_0x3485b6));};AGIChannel[_0xd481('0x24')][_0xd481('0x38')]=function(_0x1721f1,_0x25b58f,_0x19071e){_0x25b58f=_0x25b58f||this[_0xd481('0x39')];_0x19071e=_0x19071e||0x1;this[_0xd481('0x3a')](_0x1721f1);this[_0xd481('0x3b')](_0x25b58f);this[_0xd481('0x2d')](_0x19071e);return this[_0xd481('0x3c')](util[_0xd481('0x26')](_0xd481('0x3d'),_0x1721f1,_0x25b58f,_0x19071e));};AGIChannel[_0xd481('0x24')][_0xd481('0x3e')]=function(_0x42322a){return this[_0xd481('0x23')](util['format'](_0xd481('0x3f'),_0x42322a));};AGIChannel[_0xd481('0x24')][_0xd481('0x40')]=function(_0x4d2807,_0x4ff102,_0x16bc7b,_0xae5e2e,_0x20afa2,_0x488b89){_0x4ff102=_0x4ff102||_0xd481('0x41');_0x16bc7b=_0x16bc7b||'';_0xae5e2e=_0xae5e2e===undefined?-0x1:_0xae5e2e==='-1'?-0x1:_0xae5e2e*0x3e8;_0x20afa2=_0x20afa2===undefined?'':'s='+_0x20afa2;_0x488b89=_0x488b89?'BEEP':'';return this['sendRequest'](util['format'](_0xd481('0x42'),_0x4d2807,_0x4ff102,_0x16bc7b,_0xae5e2e,_0x488b89,_0x20afa2));};AGIChannel[_0xd481('0x24')][_0xd481('0x43')]=function(_0x3db127,_0x20748b){_0x20748b=_0x20748b||'';return this[_0xd481('0x23')](util[_0xd481('0x26')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3db127,_0x20748b));};AGIChannel[_0xd481('0x24')][_0xd481('0x44')]=function(_0x3f4a55){return this[_0xd481('0x28')](_0xd481('0x45'),_0x3f4a55);};AGIChannel['prototype'][_0xd481('0x46')]=function(_0x113388){return this['exec']('WAIT',_0x113388);};AGIChannel[_0xd481('0x24')][_0xd481('0x18')]=function(_0x3b35af,_0x3617c7){this[_0xd481('0x3c')](util[_0xd481('0x26')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x3b35af['id'],_0x3b35af['label'],_0x3617c7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd481('0x47')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7157ef2..0bb9874 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 _0x1c63=['format','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x15fefe,_0x2d6859){var _0x50e35c=function(_0x4327fa){while(--_0x4327fa){_0x15fefe['push'](_0x15fefe['shift']());}};_0x50e35c(++_0x2d6859);}(_0x1c63,0x94));var _0x31c6=function(_0x58675f,_0x390355){_0x58675f=_0x58675f-0x0;var _0x1cc7f0=_0x1c63[_0x58675f];return _0x1cc7f0;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x31c6('0x0'),'E_AGI_ARGUMENT_PORT':_0x31c6('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x31c6('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x31c6('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x31c6('0x4'),'E_AGI_SOCKET_ERROR':_0x31c6('0x5'),'E_AGI_SOCKET_CLOSE':_0x31c6('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x31c6('0x7'),'E_AGI_COMMAND_EMPTY':_0x31c6('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x31c6('0x9')};function AGIError(_0x5e61ef){var _0x5e61ef=_0x5e61ef||null,_0x144fe1=_0x144fe1||[],_0x549260=0x1,_0x4030b0='';if(!error[_0x5e61ef]){_0x5e61ef=_0x31c6('0xa');}_0x144fe1['push'](error[_0x5e61ef]);while(arguments[_0x549260]){_0x144fe1[_0x31c6('0xb')](arguments[_0x549260]);_0x549260++;}_0x4030b0=util[_0x31c6('0xc')]['apply'](util,_0x144fe1);this[_0x31c6('0xd')]=_0x4030b0;this[_0x31c6('0xe')]=_0x5e61ef;}module[_0x31c6('0xf')]=AGIError; \ No newline at end of file +var _0x70d7=['name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message'];(function(_0x54e6f5,_0x4f4e99){var _0x5e8794=function(_0x27512b){while(--_0x27512b){_0x54e6f5['push'](_0x54e6f5['shift']());}};_0x5e8794(++_0x4f4e99);}(_0x70d7,0x1bc));var _0x770d=function(_0x8a7bcb,_0x2cf7d1){_0x8a7bcb=_0x8a7bcb-0x0;var _0x23ccc0=_0x70d7[_0x8a7bcb];return _0x23ccc0;};'use strict';var util=require(_0x770d('0x0'));var error={'E_AGI_UNDEFINED':_0x770d('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x770d('0x2'),'E_AGI_SERVER_CLOSE':_0x770d('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x770d('0x4'),'E_AGI_SOCKET_ERROR':_0x770d('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x770d('0x6')};function AGIError(_0x5d7e6c){var _0x5d7e6c=_0x5d7e6c||null,_0x534907=_0x534907||[],_0x442d3b=0x1,_0x39dc23='';if(!error[_0x5d7e6c]){_0x5d7e6c=_0x770d('0x7');}_0x534907[_0x770d('0x8')](error[_0x5d7e6c]);while(arguments[_0x442d3b]){_0x534907[_0x770d('0x8')](arguments[_0x442d3b]);_0x442d3b++;}_0x39dc23=util[_0x770d('0x9')]['apply'](util,_0x534907);this[_0x770d('0xa')]=_0x39dc23;this[_0x770d('0xb')]=_0x5d7e6c;}module[_0x770d('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index c59fb06..3f8659f 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 _0x7407=['addVertex','prototype','addEdge','push','size','relations','numberOfEdges','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','getdigits','getsecretdigits','vertices','edges'];(function(_0x2e174b,_0xcf509d){var _0x1237a6=function(_0x3b70ef){while(--_0x3b70ef){_0x2e174b['push'](_0x2e174b['shift']());}};_0x1237a6(++_0xcf509d);}(_0x7407,0x86));var _0x7740=function(_0x59a4a7,_0x227a48){_0x59a4a7=_0x59a4a7-0x0;var _0x1f1d0a=_0x7407[_0x59a4a7];return _0x1f1d0a;};'use strict';var _=require(_0x7740('0x0'));var logger=require(_0x7740('0x1'))('agi');var verticesWithRetry=['menu',_0x7740('0x2'),_0x7740('0x3')];var Graph=function(){this[_0x7740('0x4')]={};this[_0x7740('0x5')]={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x7740('0x6')]=function(_0x3a4d7d){this[_0x7740('0x4')][_0x3a4d7d['id']]=_0x3a4d7d;this[_0x7740('0x5')][_0x3a4d7d['id']]=[];};Graph[_0x7740('0x7')][_0x7740('0x8')]=function(_0x26f674,_0x2f325d,_0x5bb051){this['edges'][_0x26f674][_0x7740('0x9')]({'target':_0x2f325d,'condition':_0x5bb051});this['numberOfEdges']+=0x1;};Graph[_0x7740('0x7')][_0x7740('0xa')]=function(){return _[_0x7740('0xa')](this[_0x7740('0x4')]);};Graph[_0x7740('0x7')][_0x7740('0xb')]=function(){return this[_0x7740('0xc')];};Graph[_0x7740('0x7')][_0x7740('0xd')]=function(_0x1aa064){return this[_0x7740('0x4')][_0x1aa064];};Graph[_0x7740('0x7')][_0x7740('0xe')]=function(_0x27f820,_0x42deee){if(!this[_0x7740('0x4')][_0x27f820]){return logger['info']('no\x20vertex\x20found');}var _0x56110e=_0x42deee(this[_0x7740('0x4')][_0x27f820]);if(!_0x56110e){return logger[_0x7740('0xf')](_0x7740('0x10'));}if(this[_0x7740('0x5')][_0x27f820][_0x7740('0x11')]===0x0){return logger[_0x7740('0xf')](_0x7740('0x12'));}for(var _0x21ace5=0x0,_0x3934d2=[],_0x110697=![];_0x21ace5\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','vertex','isUndefined','toString','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','error','stack','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','addVertex','omit','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','agi_','inspect','debug','variables','close','timeout','hangup','sync','production','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x4d9ac4,_0xc6a93e){var _0x56fe9e=function(_0x5bc4b8){while(--_0x5bc4b8){_0x4d9ac4['push'](_0x4d9ac4['shift']());}};_0x56fe9e(++_0xc6a93e);}(_0xc7f7,0x1dd));var _0x7c7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7f7[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require(_0x7c7f('0x0'));var _=require(_0x7c7f('0x1'));var syncho=require(_0x7c7f('0x2'));var util=require(_0x7c7f('0x3'));var moment=require(_0x7c7f('0x4'));var config=require(_0x7c7f('0x5'));var logger=require('../../config/logger')(_0x7c7f('0x6'));var utilLicense=require(_0x7c7f('0x7'));var rpc=require(_0x7c7f('0x8'));var mailRpc=require(_0x7c7f('0x9'));var Graph=require(_0x7c7f('0xa'));var Vertices=require(_0x7c7f('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7c7f('0x6')]=_['defaults'](config['agi'],{'ip':_0x7c7f('0xc'),'port':0x11dd});function connectionHandler(_0x2fa18b){process[_0x7c7f('0xd')](function(){syncho(function(){try{setChannelVariables(_0x2fa18b);agiHandler(_0x2fa18b);}catch(_0x3b4c78){logger[_0x7c7f('0xe')](_0x3b4c78[_0x7c7f('0xf')]);}});});}function listeningHandler(){console[_0x7c7f('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x7c7f('0x6')][_0x7c7f('0x11')]);logger['info'](util[_0x7c7f('0x12')](_0x7c7f('0x13'),config[_0x7c7f('0x6')]['ip'],config[_0x7c7f('0x6')][_0x7c7f('0x11')]));}function errorHandler(_0x372924){if(_0x372924&&_0x372924[_0x7c7f('0x14')]&&_0x372924[_0x7c7f('0x15')]){logger['error'](util['format']('[%s]\x20%s',_0x372924[_0x7c7f('0x14')],_0x372924[_0x7c7f('0x15')]));}else{logger[_0x7c7f('0xe')](util[_0x7c7f('0x12')]('[ERROR]\x20%s',_0x372924[_0x7c7f('0xf')]));}}function closeHandler(){logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')](_0x7c7f('0x17'),this[_0x7c7f('0x18')],this['calleridname'],this[_0x7c7f('0x19')],this[_0x7c7f('0x1a')],this[_0x7c7f('0x1b')]));try{createSquareReport(this);}catch(_0x8fca31){logger['error'](_0x8fca31[_0x7c7f('0xf')]);}}function timeoutHandler(){logger[_0x7c7f('0x16')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7c7f('0x18')],this[_0x7c7f('0x1c')],this[_0x7c7f('0x19')],this[_0x7c7f('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')](_0x7c7f('0x1d'),this[_0x7c7f('0x18')],this[_0x7c7f('0x1c')],this[_0x7c7f('0x19')],this[_0x7c7f('0x1a')],this[_0x7c7f('0x1b')]));this[_0x7c7f('0x1e')]=!![];}function getRoot(_0x3daf9c){return parser[_0x7c7f('0x1f')](_0x3daf9c,{'object':!![]})[_0x7c7f('0x20')][_0x7c7f('0x21')];}function addVertex(_0x41f524,_0x51ce95,_0xecbbbc){_0x51ce95[_0x7c7f('0x22')]=_0xecbbbc;if(_0x51ce95[_0x7c7f('0x23')]('retry')){_0x51ce95[_0x7c7f('0x24')]=parseInt(_0x51ce95['retry'],0xa);}_0x41f524[_0x7c7f('0x25')](_[_0x7c7f('0x26')](_0x51ce95,'mxCell'));}function initGraph(_0x3605cf,_0x5b3765){var _0x3d601a=new Graph();for(var _0x2968e6 in _0x3605cf){if(_0x3605cf['hasOwnProperty'](_0x2968e6)){if(_[_0x7c7f('0x27')](_0x3605cf[_0x2968e6])){for(var _0x438efe=0x0;_0x438efe<_0x3605cf[_0x2968e6]['length'];_0x438efe+=0x1){addVertex(_0x3d601a,_0x3605cf[_0x2968e6][_0x438efe],_0x2968e6);}}else{addVertex(_0x3d601a,_0x3605cf[_0x2968e6],_0x2968e6);}}}for(var _0x77ff98=0x0;_0x77ff98<_0x5b3765[_0x7c7f('0x28')];_0x77ff98+=0x1){if(_0x5b3765[_0x77ff98][_0x7c7f('0x29')]&&_0x5b3765[_0x77ff98][_0x7c7f('0x2a')]){_0x3d601a[_0x7c7f('0x2b')](_0x5b3765[_0x77ff98][_0x7c7f('0x29')],_0x5b3765[_0x77ff98][_0x7c7f('0x2a')],_0x5b3765[_0x77ff98][_0x7c7f('0x2c')]);}}return _0x3d601a;}function getSquareProject(_0x54e8d7,_0x1efbe1){rpc[_0x7c7f('0x2d')](_0x54e8d7)[_0x7c7f('0x2e')](function(_0x195c0a){_0x1efbe1(null,_0x195c0a);})[_0x7c7f('0x2f')](function(_0x5c1fe2){_0x1efbe1(null,_0x5c1fe2);});}function createSquareReport(_0x45c755,_0x44e48d){rpc[_0x7c7f('0x30')](_0x45c755)[_0x7c7f('0x2e')](function(_0x197bee){if(_0x44e48d){_0x44e48d(null,_0x197bee);}})[_0x7c7f('0x2f')](function(_0x4ef9d3){if(_0x44e48d){_0x44e48d(null,_0x4ef9d3);}});}function setChannelVariables(_0x5738b0){for(var _0x39626a in _0x5738b0){if(_0x5738b0[_0x7c7f('0x23')](_0x39626a)){if(_0x39626a['indexOf'](_0x7c7f('0x31'))===0x0){_0x5738b0[_0x39626a['substring'](0x4)]=_0x5738b0[_0x39626a];delete _0x5738b0[_0x39626a];}}}}function getLogFromObject(_0x5c0a46){return util[_0x7c7f('0x32')](_0x5c0a46,{'showHidden':![],'depth':null});}function agiHandler(_0x49ce43){var _0x374a9c,_0x24fcb7,_0x3e92ee,_0x56562b,_0x23c911;logger[_0x7c7f('0x33')](_0x7c7f('0x34'),JSON['stringify'](_0x49ce43,null,0x2));logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x49ce43[_0x7c7f('0x18')],_0x49ce43[_0x7c7f('0x1c')],_0x49ce43[_0x7c7f('0x19')],_0x49ce43[_0x7c7f('0x1a')],_0x49ce43[_0x7c7f('0x1b')]));_0x49ce43['on'](_0x7c7f('0xe'),errorHandler);_0x49ce43['on'](_0x7c7f('0x35'),closeHandler);_0x49ce43['on'](_0x7c7f('0x36'),timeoutHandler);_0x49ce43[_0x7c7f('0x1e')]=![];_0x49ce43['on'](_0x7c7f('0x37'),hangupHandler);var _0x52148f=getSquareProject[_0x7c7f('0x38')](null,_0x49ce43[_0x7c7f('0x18')]);if(_0x52148f){if(_0x52148f[_0x7c7f('0x39')]){_0x374a9c=getRoot(_0x52148f[_0x7c7f('0x39')]);if(_0x374a9c&&_0x374a9c['start']){logger[_0x7c7f('0x33')](_0x7c7f('0x21'),JSON[_0x7c7f('0x3a')](_0x374a9c,null,0x2));_0x49ce43[_0x7c7f('0x3b')]=moment()[_0x7c7f('0x12')](_0x7c7f('0x3c'));_0x24fcb7=initGraph(_[_0x7c7f('0x26')](_0x374a9c,_0x7c7f('0x3d')),_0x374a9c[_0x7c7f('0x3d')]);_0x3e92ee=new Vertices(_0x49ce43,rpc,mailRpc);logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')](_0x7c7f('0x3e'),_0x49ce43[_0x7c7f('0x18')],_0x49ce43['calleridname'],_0x49ce43[_0x7c7f('0x19')],_0x49ce43[_0x7c7f('0x1a')],_0x49ce43['uniqueid']));_0x24fcb7[_0x7c7f('0x3f')](_0x374a9c['start']['id'],function(_0x47d0e1){try{_0x47d0e1=_0x3e92ee[_0x7c7f('0x40')](_0x47d0e1);logger[_0x7c7f('0x33')]('vertex',JSON[_0x7c7f('0x3a')](_0x47d0e1,null,0x2));if(_0x47d0e1[_0x7c7f('0x22')]===_0x7c7f('0x41')){logger[_0x7c7f('0x16')](_0x7c7f('0x42'));_0x49ce43[_0x7c7f('0x43')]=_0x47d0e1['context']||_0x49ce43['context'];_0x49ce43[_0x7c7f('0x44')]=_0x47d0e1['extension'];_0x49ce43[_0x7c7f('0x45')]=_0x47d0e1[_0x7c7f('0x45')]?_0x47d0e1[_0x7c7f('0x45')]-0x1:0x1;return null;}else if(_0x47d0e1&&_0x3e92ee[_0x47d0e1['agicommand']]){_0x23c911=_0x3e92ee[_0x47d0e1[_0x7c7f('0x22')]](_0x47d0e1);logger[_0x7c7f('0x16')]('response',JSON[_0x7c7f('0x3a')](_0x23c911,null,0x2));if(_0x23c911&&_0x23c911['code']===AGI_CODE_SUCCESS&&_0x23c911['result']!==AGI_RESULT_ERROR&&!_0x49ce43[_0x7c7f('0x1e')]){logger[_0x7c7f('0x33')]('response',getLogFromObject(_0x23c911));return _['isUndefined'](_0x23c911['result'])?null:_0x23c911[_0x7c7f('0x46')]['toString']();}else{logger[_0x7c7f('0xe')](_0x7c7f('0x47'),getLogFromObject(_0x23c911));return null;}}else{logger[_0x7c7f('0xe')](_0x7c7f('0x48'));return null;}}catch(_0x1f1d19){logger['error'](_0x1f1d19['stack']);return null;}});if(_0x374a9c['finally']){logger['info'](util['format'](_0x7c7f('0x49'),_0x49ce43[_0x7c7f('0x18')],_0x49ce43[_0x7c7f('0x1c')],_0x49ce43[_0x7c7f('0x19')],_0x49ce43[_0x7c7f('0x1a')],_0x49ce43[_0x7c7f('0x1b')]));_0x24fcb7[_0x7c7f('0x3f')](_0x374a9c[_0x7c7f('0x4a')]['id'],function(_0x36897f){try{_0x36897f=_0x3e92ee['clear'](_0x36897f);logger[_0x7c7f('0x33')](_0x7c7f('0x4b'),JSON[_0x7c7f('0x3a')](_0x36897f,null,0x2));if(_0x36897f&&_0x3e92ee[_0x36897f[_0x7c7f('0x22')]]){_0x23c911=_0x3e92ee[_0x36897f['agicommand']](_0x36897f);if(_0x23c911){logger[_0x7c7f('0x33')]('response',getLogFromObject(_0x23c911));return _[_0x7c7f('0x4c')](_0x23c911[_0x7c7f('0x46')])?null:_0x23c911['result'][_0x7c7f('0x4d')]();}else{logger[_0x7c7f('0xe')](_0x7c7f('0x47'),getLogFromObject(_0x23c911));return null;}}else{logger[_0x7c7f('0xe')](_0x7c7f('0x48'));return null;}}catch(_0x273e4c){logger[_0x7c7f('0xe')](_0x273e4c[_0x7c7f('0xf')]);return null;}});}logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x49ce43['arg_1'],_0x49ce43['calleridname'],_0x49ce43['callerid'],_0x49ce43['dnid'],_0x49ce43[_0x7c7f('0x1b')]));logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x49ce43[_0x7c7f('0x43')],_0x49ce43[_0x7c7f('0x44')],parseInt(_0x49ce43[_0x7c7f('0x45')],0xa)+0x1));_0x49ce43[_0x7c7f('0x4e')](_0x49ce43['context'],_0x49ce43[_0x7c7f('0x44')],parseInt(_0x49ce43[_0x7c7f('0x45')],0xa)+0x1);_0x49ce43[_0x7c7f('0x35')]();}}else{logger[_0x7c7f('0xe')](util[_0x7c7f('0x12')](_0x7c7f('0x4f'),_0x49ce43[_0x7c7f('0x18')]));_0x49ce43[_0x7c7f('0x4e')](_0x49ce43[_0x7c7f('0x43')],_0x49ce43[_0x7c7f('0x44')],parseInt(_0x49ce43[_0x7c7f('0x45')],0xa)+0x1);_0x49ce43['close']();}}else{logger[_0x7c7f('0xe')](util[_0x7c7f('0x12')](_0x7c7f('0x50'),_0x49ce43[_0x7c7f('0x18')]));_0x49ce43[_0x7c7f('0x4e')](_0x49ce43[_0x7c7f('0x43')],_0x49ce43[_0x7c7f('0x44')],parseInt(_0x49ce43['priority'],0xa)+0x1);_0x49ce43['close']();}}function main(){var _0x5b9ebe;return utilLicense[_0x7c7f('0x51')]()['then'](function(_0x5c64f4){if(_0x5c64f4){if(_0x5c64f4['voice']){if(_0x5c64f4[_0x7c7f('0x52')]&&_0x5c64f4[_0x7c7f('0x52')]>0x0){logger[_0x7c7f('0x16')](util[_0x7c7f('0x12')](_0x7c7f('0x53'),_0x5c64f4['callysquare']));_0x5b9ebe=_0x5c64f4[_0x7c7f('0x52')];}else{logger[_0x7c7f('0x16')](_0x7c7f('0x54'));}}else{logger['info'](_0x7c7f('0x55'));_0x5b9ebe=-0x1;}}})[_0x7c7f('0x2f')](function(_0x37b557){logger[_0x7c7f('0xe')](_0x7c7f('0x56'),_0x37b557[_0x7c7f('0xf')]);})[_0x7c7f('0x4a')](function(){var _0x290caf=require(_0x7c7f('0x57'))(config[_0x7c7f('0x6')][_0x7c7f('0x11')],config[_0x7c7f('0x6')]['ip'],_0x5b9ebe);_0x290caf['on'](_0x7c7f('0xe'),errorHandler);_0x290caf['on'](_0x7c7f('0x58'),listeningHandler);_0x290caf['on'](_0x7c7f('0x59'),connectionHandler);_0x290caf['on'](_0x7c7f('0x35'),closeHandler);});}main(); \ No newline at end of file +var _0x0c1f=['finally','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','./server','xml2json','lodash','syncho','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','defaults','127.0.0.1','nextTick','error','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\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','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','length','source','target','getSquareProject','then','catch','createSquareReport','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','arg_1','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found'];(function(_0x2c8277,_0xd6c2a7){var _0x174443=function(_0x48ca79){while(--_0x48ca79){_0x2c8277['push'](_0x2c8277['shift']());}};_0x174443(++_0xd6c2a7);}(_0x0c1f,0x101));var _0xf0c1=function(_0xf24f30,_0x77205b){_0xf24f30=_0xf24f30-0x0;var _0x364bea=_0x0c1f[_0xf24f30];return _0x364bea;};'use strict';var parser=require(_0xf0c1('0x0'));var _=require(_0xf0c1('0x1'));var syncho=require(_0xf0c1('0x2'));var util=require('util');var moment=require('moment');var config=require(_0xf0c1('0x3'));var logger=require('../../config/logger')(_0xf0c1('0x4'));var utilLicense=require(_0xf0c1('0x5'));var rpc=require(_0xf0c1('0x6'));var mailRpc=require(_0xf0c1('0x7'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xf0c1('0x4')]=_[_0xf0c1('0x8')](config[_0xf0c1('0x4')],{'ip':_0xf0c1('0x9'),'port':0x11dd});function connectionHandler(_0x2d7576){process[_0xf0c1('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2d7576);agiHandler(_0x2d7576);}catch(_0x17ae7d){logger[_0xf0c1('0xb')](_0x17ae7d['stack']);}});});}function listeningHandler(){console['log'](_0xf0c1('0xc'),config[_0xf0c1('0x4')][_0xf0c1('0xd')]);logger[_0xf0c1('0xe')](util[_0xf0c1('0xf')](_0xf0c1('0x10'),config[_0xf0c1('0x4')]['ip'],config[_0xf0c1('0x4')][_0xf0c1('0xd')]));}function errorHandler(_0x4fdb7e){if(_0x4fdb7e&&_0x4fdb7e['name']&&_0x4fdb7e[_0xf0c1('0x11')]){logger['error'](util[_0xf0c1('0xf')](_0xf0c1('0x12'),_0x4fdb7e[_0xf0c1('0x13')],_0x4fdb7e[_0xf0c1('0x11')]));}else{logger['error'](util[_0xf0c1('0xf')]('[ERROR]\x20%s',_0x4fdb7e[_0xf0c1('0x14')]));}}function closeHandler(){logger[_0xf0c1('0xe')](util[_0xf0c1('0xf')](_0xf0c1('0x15'),this['arg_1'],this[_0xf0c1('0x16')],this[_0xf0c1('0x17')],this[_0xf0c1('0x18')],this['uniqueid']));try{createSquareReport(this);}catch(_0x22b685){logger[_0xf0c1('0xb')](_0x22b685[_0xf0c1('0x14')]);}}function timeoutHandler(){logger[_0xf0c1('0xe')](util[_0xf0c1('0xf')](_0xf0c1('0x19'),this['arg_1'],this[_0xf0c1('0x16')],this[_0xf0c1('0x17')],this[_0xf0c1('0x18')],this[_0xf0c1('0x1a')]));}function hangupHandler(){logger[_0xf0c1('0xe')](util[_0xf0c1('0xf')](_0xf0c1('0x1b'),this['arg_1'],this[_0xf0c1('0x16')],this['callerid'],this['dnid'],this[_0xf0c1('0x1a')]));this[_0xf0c1('0x1c')]=!![];}function getRoot(_0x1dd47b){return parser[_0xf0c1('0x1d')](_0x1dd47b,{'object':!![]})[_0xf0c1('0x1e')][_0xf0c1('0x1f')];}function addVertex(_0x49d8c8,_0x2a358b,_0x390afe){_0x2a358b[_0xf0c1('0x20')]=_0x390afe;if(_0x2a358b[_0xf0c1('0x21')](_0xf0c1('0x22'))){_0x2a358b[_0xf0c1('0x23')]=parseInt(_0x2a358b[_0xf0c1('0x22')],0xa);}_0x49d8c8[_0xf0c1('0x24')](_[_0xf0c1('0x25')](_0x2a358b,'mxCell'));}function initGraph(_0x478ae1,_0x3feadf){var _0x57f102=new Graph();for(var _0x22566d in _0x478ae1){if(_0x478ae1[_0xf0c1('0x21')](_0x22566d)){if(_['isArray'](_0x478ae1[_0x22566d])){for(var _0x3171a7=0x0;_0x3171a7<_0x478ae1[_0x22566d][_0xf0c1('0x26')];_0x3171a7+=0x1){addVertex(_0x57f102,_0x478ae1[_0x22566d][_0x3171a7],_0x22566d);}}else{addVertex(_0x57f102,_0x478ae1[_0x22566d],_0x22566d);}}}for(var _0x215800=0x0;_0x215800<_0x3feadf[_0xf0c1('0x26')];_0x215800+=0x1){if(_0x3feadf[_0x215800]['source']&&_0x3feadf[_0x215800]['target']){_0x57f102['addEdge'](_0x3feadf[_0x215800][_0xf0c1('0x27')],_0x3feadf[_0x215800][_0xf0c1('0x28')],_0x3feadf[_0x215800]['value']);}}return _0x57f102;}function getSquareProject(_0x41c954,_0x131c52){rpc[_0xf0c1('0x29')](_0x41c954)[_0xf0c1('0x2a')](function(_0x4e3e87){_0x131c52(null,_0x4e3e87);})[_0xf0c1('0x2b')](function(_0xb25881){_0x131c52(null,_0xb25881);});}function createSquareReport(_0x57939d,_0x5d62d5){rpc[_0xf0c1('0x2c')](_0x57939d)[_0xf0c1('0x2a')](function(_0x71d1d9){if(_0x5d62d5){_0x5d62d5(null,_0x71d1d9);}})[_0xf0c1('0x2b')](function(_0x51e152){if(_0x5d62d5){_0x5d62d5(null,_0x51e152);}});}function setChannelVariables(_0x5768d8){for(var _0x39c369 in _0x5768d8){if(_0x5768d8[_0xf0c1('0x21')](_0x39c369)){if(_0x39c369['indexOf']('agi_')===0x0){_0x5768d8[_0x39c369[_0xf0c1('0x2d')](0x4)]=_0x5768d8[_0x39c369];delete _0x5768d8[_0x39c369];}}}}function getLogFromObject(_0xa5ebbe){return util[_0xf0c1('0x2e')](_0xa5ebbe,{'showHidden':![],'depth':null});}function agiHandler(_0x1b00ce){var _0x19b38c,_0x349b67,_0x3440c0,_0x1dc5b3,_0x1c8ea1;logger[_0xf0c1('0x2f')](_0xf0c1('0x30'),JSON[_0xf0c1('0x31')](_0x1b00ce,null,0x2));logger['info'](util['format'](_0xf0c1('0x32'),_0x1b00ce['arg_1'],_0x1b00ce[_0xf0c1('0x16')],_0x1b00ce[_0xf0c1('0x17')],_0x1b00ce[_0xf0c1('0x18')],_0x1b00ce[_0xf0c1('0x1a')]));_0x1b00ce['on'](_0xf0c1('0xb'),errorHandler);_0x1b00ce['on']('close',closeHandler);_0x1b00ce['on']('timeout',timeoutHandler);_0x1b00ce[_0xf0c1('0x1c')]=![];_0x1b00ce['on'](_0xf0c1('0x33'),hangupHandler);var _0x238c34=getSquareProject[_0xf0c1('0x34')](null,_0x1b00ce[_0xf0c1('0x35')]);if(_0x238c34){if(_0x238c34['production']){_0x19b38c=getRoot(_0x238c34['production']);if(_0x19b38c&&_0x19b38c['start']){logger[_0xf0c1('0x2f')](_0xf0c1('0x1f'),JSON[_0xf0c1('0x31')](_0x19b38c,null,0x2));_0x1b00ce[_0xf0c1('0x36')]=moment()['format'](_0xf0c1('0x37'));_0x349b67=initGraph(_[_0xf0c1('0x25')](_0x19b38c,_0xf0c1('0x38')),_0x19b38c[_0xf0c1('0x38')]);_0x3440c0=new Vertices(_0x1b00ce,rpc,mailRpc);logger['info'](util[_0xf0c1('0xf')](_0xf0c1('0x39'),_0x1b00ce['arg_1'],_0x1b00ce[_0xf0c1('0x16')],_0x1b00ce['callerid'],_0x1b00ce[_0xf0c1('0x18')],_0x1b00ce['uniqueid']));_0x349b67[_0xf0c1('0x3a')](_0x19b38c[_0xf0c1('0x3b')]['id'],function(_0x2f741e){try{_0x2f741e=_0x3440c0[_0xf0c1('0x3c')](_0x2f741e);logger[_0xf0c1('0x2f')](_0xf0c1('0x3d'),JSON['stringify'](_0x2f741e,null,0x2));if(_0x2f741e['agicommand']==='gotoc'){logger[_0xf0c1('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1b00ce[_0xf0c1('0x3e')]=_0x2f741e[_0xf0c1('0x3e')]||_0x1b00ce[_0xf0c1('0x3e')];_0x1b00ce[_0xf0c1('0x3f')]=_0x2f741e['extension'];_0x1b00ce['priority']=_0x2f741e['priority']?_0x2f741e[_0xf0c1('0x40')]-0x1:0x1;return null;}else if(_0x2f741e&&_0x3440c0[_0x2f741e[_0xf0c1('0x20')]]){_0x1c8ea1=_0x3440c0[_0x2f741e[_0xf0c1('0x20')]](_0x2f741e);logger[_0xf0c1('0xe')](_0xf0c1('0x41'),JSON[_0xf0c1('0x31')](_0x1c8ea1,null,0x2));if(_0x1c8ea1&&_0x1c8ea1[_0xf0c1('0x42')]===AGI_CODE_SUCCESS&&_0x1c8ea1[_0xf0c1('0x43')]!==AGI_RESULT_ERROR&&!_0x1b00ce[_0xf0c1('0x1c')]){logger[_0xf0c1('0x2f')](_0xf0c1('0x41'),getLogFromObject(_0x1c8ea1));return _[_0xf0c1('0x44')](_0x1c8ea1[_0xf0c1('0x43')])?null:_0x1c8ea1[_0xf0c1('0x43')][_0xf0c1('0x45')]();}else{logger[_0xf0c1('0xb')]('response',getLogFromObject(_0x1c8ea1));return null;}}else{logger[_0xf0c1('0xb')](_0xf0c1('0x46'));return null;}}catch(_0xa9fab2){logger[_0xf0c1('0xb')](_0xa9fab2['stack']);return null;}});if(_0x19b38c[_0xf0c1('0x47')]){logger[_0xf0c1('0xe')](util[_0xf0c1('0xf')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1b00ce[_0xf0c1('0x35')],_0x1b00ce['calleridname'],_0x1b00ce[_0xf0c1('0x17')],_0x1b00ce[_0xf0c1('0x18')],_0x1b00ce[_0xf0c1('0x1a')]));_0x349b67[_0xf0c1('0x3a')](_0x19b38c[_0xf0c1('0x47')]['id'],function(_0xc2b90c){try{_0xc2b90c=_0x3440c0[_0xf0c1('0x3c')](_0xc2b90c);logger[_0xf0c1('0x2f')](_0xf0c1('0x3d'),JSON['stringify'](_0xc2b90c,null,0x2));if(_0xc2b90c&&_0x3440c0[_0xc2b90c['agicommand']]){_0x1c8ea1=_0x3440c0[_0xc2b90c['agicommand']](_0xc2b90c);if(_0x1c8ea1){logger[_0xf0c1('0x2f')]('response',getLogFromObject(_0x1c8ea1));return _[_0xf0c1('0x44')](_0x1c8ea1[_0xf0c1('0x43')])?null:_0x1c8ea1['result'][_0xf0c1('0x45')]();}else{logger[_0xf0c1('0xb')](_0xf0c1('0x41'),getLogFromObject(_0x1c8ea1));return null;}}else{logger[_0xf0c1('0xb')](_0xf0c1('0x46'));return null;}}catch(_0x359c97){logger[_0xf0c1('0xb')](_0x359c97['stack']);return null;}});}logger[_0xf0c1('0xe')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1b00ce[_0xf0c1('0x35')],_0x1b00ce[_0xf0c1('0x16')],_0x1b00ce[_0xf0c1('0x17')],_0x1b00ce[_0xf0c1('0x18')],_0x1b00ce[_0xf0c1('0x1a')]));logger[_0xf0c1('0xe')](util[_0xf0c1('0xf')](_0xf0c1('0x48'),_0x1b00ce[_0xf0c1('0x3e')],_0x1b00ce[_0xf0c1('0x3f')],parseInt(_0x1b00ce[_0xf0c1('0x40')],0xa)+0x1));_0x1b00ce['continueAt'](_0x1b00ce[_0xf0c1('0x3e')],_0x1b00ce[_0xf0c1('0x3f')],parseInt(_0x1b00ce[_0xf0c1('0x40')],0xa)+0x1);_0x1b00ce[_0xf0c1('0x49')]();}}else{logger[_0xf0c1('0xb')](util['format']('Project\x20%s\x20not\x20published',_0x1b00ce[_0xf0c1('0x35')]));_0x1b00ce[_0xf0c1('0x4a')](_0x1b00ce[_0xf0c1('0x3e')],_0x1b00ce['extension'],parseInt(_0x1b00ce['priority'],0xa)+0x1);_0x1b00ce[_0xf0c1('0x49')]();}}else{logger[_0xf0c1('0xb')](util[_0xf0c1('0xf')](_0xf0c1('0x4b'),_0x1b00ce[_0xf0c1('0x35')]));_0x1b00ce['continueAt'](_0x1b00ce[_0xf0c1('0x3e')],_0x1b00ce[_0xf0c1('0x3f')],parseInt(_0x1b00ce['priority'],0xa)+0x1);_0x1b00ce[_0xf0c1('0x49')]();}}function main(){var _0x327373;return utilLicense[_0xf0c1('0x4c')]()[_0xf0c1('0x2a')](function(_0x2e44c0){if(_0x2e44c0){if(_0x2e44c0[_0xf0c1('0x4d')]){if(_0x2e44c0['callysquare']&&_0x2e44c0[_0xf0c1('0x4e')]>0x0){logger[_0xf0c1('0xe')](util[_0xf0c1('0xf')](_0xf0c1('0x4f'),_0x2e44c0[_0xf0c1('0x4e')]));_0x327373=_0x2e44c0['callysquare'];}else{logger[_0xf0c1('0xe')](_0xf0c1('0x50'));}}else{logger[_0xf0c1('0xe')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x327373=-0x1;}}})['catch'](function(_0x17d109){logger[_0xf0c1('0xb')]('[LICENSE]',_0x17d109[_0xf0c1('0x14')]);})['finally'](function(){var _0x20e5e1=require(_0xf0c1('0x51'))(config[_0xf0c1('0x4')][_0xf0c1('0xd')],config['agi']['ip'],_0x327373);_0x20e5e1['on'](_0xf0c1('0xb'),errorHandler);_0x20e5e1['on']('listening',listeningHandler);_0x20e5e1['on']('connection',connectionHandler);_0x20e5e1['on'](_0xf0c1('0x49'),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 e1db8bf..107f0a3 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 _0x8052=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x1e844e,_0x3293b0){var _0x57a52d=function(_0x208667){while(--_0x208667){_0x1e844e['push'](_0x1e844e['shift']());}};_0x57a52d(++_0x3293b0);}(_0x8052,0xa8));var _0x2805=function(_0x3dddb9,_0x3b2f73){_0x3dddb9=_0x3dddb9-0x0;var _0x4df584=_0x8052[_0x3dddb9];return _0x4df584;};'use strict';var BPromise=require(_0x2805('0x0'));var jayson=require(_0x2805('0x1'));var client=jayson[_0x2805('0x2')][_0x2805('0x3')]({'port':0x232b});function request(_0x93052b,_0x8dd67f){return new BPromise(function(_0x143905,_0x3f768a){return client[_0x2805('0x4')](_0x93052b,_0x8dd67f)[_0x2805('0x5')](function(_0x489a1e){if(_0x489a1e[_0x2805('0x6')]){return _0x3f768a(_0x489a1e[_0x2805('0x6')][_0x2805('0x7')]);}else{return _0x143905(_0x489a1e['result']);}})[_0x2805('0x8')](function(_0x5a5bf8){return _0x3f768a(_0x5a5bf8);});});}exports[_0x2805('0x9')]=function(_0x8a76de,_0x508ff2){return request(_0x2805('0xa'),{'account':_0x8a76de,'message':_0x508ff2});}; \ No newline at end of file +var _0xaa4f=['message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xaa4f,0xbf));var _0xfaa4=function(_0x39f929,_0x430248){_0x39f929=_0x39f929-0x0;var _0x178229=_0xaa4f[_0x39f929];return _0x178229;};'use strict';var BPromise=require(_0xfaa4('0x0'));var jayson=require(_0xfaa4('0x1'));var client=jayson[_0xfaa4('0x2')][_0xfaa4('0x3')]({'port':0x232b});function request(_0xb1c10a,_0x1ebead){return new BPromise(function(_0x4be0bc,_0x1e0e61){return client[_0xfaa4('0x4')](_0xb1c10a,_0x1ebead)[_0xfaa4('0x5')](function(_0x16b6e1){if(_0x16b6e1[_0xfaa4('0x6')]){return _0x1e0e61(_0x16b6e1['error'][_0xfaa4('0x7')]);}else{return _0x4be0bc(_0x16b6e1[_0xfaa4('0x8')]);}})['catch'](function(_0x19dd58){return _0x1e0e61(_0x19dd58);});});}exports[_0xfaa4('0x9')]=function(_0x462b16,_0x56079e){return request(_0xfaa4('0xa'),{'account':_0x462b16,'message':_0x56079e});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 420f527..c1e3779 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 _0xdaec=['Transform','call','_localBuffer','_inBody','inherits','toString','indexOf','substring','length','split','slice','trim','headers','line','util','stream'];(function(_0x381501,_0x3f0251){var _0x1e94fe=function(_0x968389){while(--_0x968389){_0x381501['push'](_0x381501['shift']());}};_0x1e94fe(++_0x3f0251);}(_0xdaec,0x14e));var _0xcdae=function(_0x411289,_0x36dbc8){_0x411289=_0x411289-0x0;var _0x5e72ec=_0xdaec[_0x411289];return _0x5e72ec;};'use strict';var util=require(_0xcdae('0x0'));var Transform=require(_0xcdae('0x1'))[_0xcdae('0x2')];function AGIReply(_0x22ed09){Transform[_0xcdae('0x3')](this,_0x22ed09);this[_0xcdae('0x4')]='';this[_0xcdae('0x5')]=![];}util[_0xcdae('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x3a897a,_0x2977b5,_0xbe278e){var _0x4e79aa='\x0a',_0x5a0f11=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x3b524a=-0x1,_0x578a03=-0x1,_0x3ebc30='',_0x519b9f=0x0,_0x29e376='',_0xf3fccf='';this[_0xcdae('0x4')]+=_0x3a897a[_0xcdae('0x7')]();_0x29e376=this[_0xcdae('0x4')];if(!this['_inBody']){_0x519b9f=0x0;while(_0x5a0f11[_0x519b9f]){while((_0x578a03=_0x29e376[_0xcdae('0x8')](_0x5a0f11[_0x519b9f]))!=-0x1){_0x3ebc30=_0x5a0f11[_0x519b9f];_0xf3fccf=_0x29e376['substring'](0x0,_0x578a03);_0x29e376=_0x29e376[_0xcdae('0x9')](_0x578a03+_0x3ebc30[_0xcdae('0xa')]);var _0x347810=_0xf3fccf[_0xcdae('0xb')](_0x4e79aa),_0x492dec=0x0,_0x2db9b8={},_0x117b45='',_0x5c231f='',_0x48f076=-0x1;while(_0x347810[_0x492dec]){_0x48f076=_0x347810[_0x492dec]['indexOf'](':');if(_0x48f076!=-0x1){_0x117b45=_0x347810[_0x492dec][_0xcdae('0xc')](0x0,_0x48f076)[_0xcdae('0xd')]();_0x5c231f=_0x347810[_0x492dec][_0xcdae('0xc')](_0x48f076+0x1)[_0xcdae('0xd')]();if(_0x117b45[_0xcdae('0xa')]>0x0){_0x2db9b8[_0x117b45]=_0x5c231f;}}else{}_0x492dec++;}this['emit'](_0xcdae('0xe'),_0x2db9b8);this['_inBody']=!![];}_0x519b9f++;}this['_localBuffer']=_0x29e376;}else{while((_0x3b524a=_0x29e376['indexOf'](_0x4e79aa))!=-0x1){_0xf3fccf=_0x29e376[_0xcdae('0x9')](0x0,_0x3b524a);this['emit'](_0xcdae('0xf'),_0xf3fccf);_0x29e376=_0x29e376[_0xcdae('0x9')](_0x3b524a+_0x4e79aa[_0xcdae('0xa')]);}this[_0xcdae('0x4')]=_0x29e376;}_0xbe278e();};module['exports']=AGIReply; \ No newline at end of file +var _0x825f=['inherits','prototype','indexOf','substring','length','split','slice','trim','headers','emit','line','exports','stream','call','_localBuffer','_inBody'];(function(_0x16fd31,_0x10015b){var _0x2b5ace=function(_0xecf720){while(--_0xecf720){_0x16fd31['push'](_0x16fd31['shift']());}};_0x2b5ace(++_0x10015b);}(_0x825f,0xbc));var _0xf825=function(_0x59f1ef,_0x8233e2){_0x59f1ef=_0x59f1ef-0x0;var _0x3647f1=_0x825f[_0x59f1ef];return _0x3647f1;};'use strict';var util=require('util');var Transform=require(_0xf825('0x0'))['Transform'];function AGIReply(_0x1ed631){Transform[_0xf825('0x1')](this,_0x1ed631);this[_0xf825('0x2')]='';this[_0xf825('0x3')]=![];}util[_0xf825('0x4')](AGIReply,Transform);AGIReply[_0xf825('0x5')]['_transform']=function(_0x454c5c,_0x29f623,_0x365feb){var _0x5a87fa='\x0a',_0x4a0eae=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5dc621=-0x1,_0x3f561b=-0x1,_0x2be424='',_0x41594b=0x0,_0x2f14e7='',_0x13b06d='';this[_0xf825('0x2')]+=_0x454c5c['toString']();_0x2f14e7=this['_localBuffer'];if(!this[_0xf825('0x3')]){_0x41594b=0x0;while(_0x4a0eae[_0x41594b]){while((_0x3f561b=_0x2f14e7[_0xf825('0x6')](_0x4a0eae[_0x41594b]))!=-0x1){_0x2be424=_0x4a0eae[_0x41594b];_0x13b06d=_0x2f14e7[_0xf825('0x7')](0x0,_0x3f561b);_0x2f14e7=_0x2f14e7[_0xf825('0x7')](_0x3f561b+_0x2be424[_0xf825('0x8')]);var _0x3245a1=_0x13b06d[_0xf825('0x9')](_0x5a87fa),_0x14b5e6=0x0,_0x5a838c={},_0x339de9='',_0x16472d='',_0x174860=-0x1;while(_0x3245a1[_0x14b5e6]){_0x174860=_0x3245a1[_0x14b5e6][_0xf825('0x6')](':');if(_0x174860!=-0x1){_0x339de9=_0x3245a1[_0x14b5e6][_0xf825('0xa')](0x0,_0x174860)[_0xf825('0xb')]();_0x16472d=_0x3245a1[_0x14b5e6]['slice'](_0x174860+0x1)[_0xf825('0xb')]();if(_0x339de9[_0xf825('0x8')]>0x0){_0x5a838c[_0x339de9]=_0x16472d;}}else{}_0x14b5e6++;}this['emit'](_0xf825('0xc'),_0x5a838c);this[_0xf825('0x3')]=!![];}_0x41594b++;}this[_0xf825('0x2')]=_0x2f14e7;}else{while((_0x5dc621=_0x2f14e7[_0xf825('0x6')](_0x5a87fa))!=-0x1){_0x13b06d=_0x2f14e7[_0xf825('0x7')](0x0,_0x5dc621);this[_0xf825('0xd')](_0xf825('0xe'),_0x13b06d);_0x2f14e7=_0x2f14e7[_0xf825('0x7')](_0x5dc621+_0x5a87fa[_0xf825('0x8')]);}this['_localBuffer']=_0x2f14e7;}_0x365feb();};module[_0xf825('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index fe8c5ac..d161342 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 _0x7be8=['MailServerOut','Smtp','getSquareProjectById','name','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','agentLogin','LoginUser','agentPause','PauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','catch','getSquareProject','getMailAccountById'];(function(_0x283454,_0x1563cd){var _0x4e9dfb=function(_0x53b2fb){while(--_0x53b2fb){_0x283454['push'](_0x283454['shift']());}};_0x4e9dfb(++_0x1563cd);}(_0x7be8,0x148));var _0x87be=function(_0x2a27d2,_0x328861){_0x2a27d2=_0x2a27d2-0x0;var _0x5c2e3b=_0x7be8[_0x2a27d2];return _0x5c2e3b;};'use strict';var BPromise=require(_0x87be('0x0'));var moment=require(_0x87be('0x1'));var _=require(_0x87be('0x2'));var util=require(_0x87be('0x3'));var jayson=require(_0x87be('0x4'));var client=jayson[_0x87be('0x5')][_0x87be('0x6')]({'port':0x2329});function request(_0x5eef54,_0xc1fd1e){return new BPromise(function(_0x2c8b33,_0xec7abc){return client[_0x87be('0x7')](_0x5eef54,_0xc1fd1e)[_0x87be('0x8')](function(_0x4bf18c){if(_0x4bf18c[_0x87be('0x9')]){return _0xec7abc(_0x4bf18c[_0x87be('0x9')][_0x87be('0xa')]);}else{return _0x2c8b33(_0x4bf18c['result']);}})[_0x87be('0xb')](function(_0x6bbf3f){return _0xec7abc(_0x6bbf3f);});});}exports[_0x87be('0xc')]=function(_0x3374d){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x3374d},'attributes':['production']}});};exports[_0x87be('0xd')]=function(_0x3d7677){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3d7677},'include':[{'model':_0x87be('0xe'),'as':_0x87be('0xf')}],'attributes':['id','name','email']}});};exports[_0x87be('0x10')]=function(_0x562af8){return request('ShowSquareProject',{'options':{'where':{'id':_0x562af8},'attributes':[_0x87be('0x11')]}});};exports['getVoiceQueueById']=function(_0x31f36c){return request(_0x87be('0x12'),{'options':{'where':{'id':_0x31f36c},'attributes':[_0x87be('0x11')]}});};exports['getVariableById']=function(_0x5b44c7){return request(_0x87be('0x13'),{'options':{'where':{'id':_0x5b44c7},'attributes':['name']}});};exports[_0x87be('0x14')]=function(_0x426587){return request(_0x87be('0x15'),{'options':{'where':{'id':_0x426587},'attributes':[_0x87be('0x16')]}});};exports[_0x87be('0x17')]=function(_0xf4fa4d){return request(_0x87be('0x18'),{'options':{'where':{'id':_0xf4fa4d},'attributes':[_0x87be('0x11')]}});};exports[_0x87be('0x19')]=function(_0x5ddc0d){return request(_0x87be('0x1a'),{'options':{'where':{'id':_0x5ddc0d},'attributes':[_0x87be('0x11')]}});};exports[_0x87be('0x1b')]=function(_0xc79a47){return request('ShowSound',{'options':{'where':{'id':_0xc79a47},'attributes':['save_name']}});};exports[_0x87be('0x1c')]=function(_0x56b737){return request(_0x87be('0x1d'),{'options':{'raw':![],'where':{'id':_0x56b737},'include':[{'model':_0x87be('0x1e'),'as':_0x87be('0x1f')}]}});};exports[_0x87be('0x20')]=function(_0x3fd252){return request(_0x87be('0x21'),{'options':{'where':{'id':_0x3fd252},'attributes':['id',_0x87be('0x11')]}});};exports[_0x87be('0x22')]=function(_0x2d91b5){return request(_0x87be('0x23'),{'body':_0x2d91b5});};exports['createSquareDetailsReport']=function(_0x3335ca){return request(_0x87be('0x24'),{'body':_0x3335ca});};exports[_0x87be('0x25')]=function(_0xaac736){return request(_0x87be('0x26'),{'body':_[_0x87be('0x27')](_0xaac736,{'project_name':_0xaac736[_0x87be('0x28')],'prev_project_name':_0xaac736[_0x87be('0x29')]||'','is_subproject':_0xaac736[_0x87be('0x29')]?!![]:![],'leaveAt':moment()['format'](_0x87be('0x2a'))})});};exports[_0x87be('0x2b')]=function(_0x243ae0){return request(_0x87be('0x2c'),{'body':_0x243ae0});};exports[_0x87be('0x2d')]=function(_0x36f361){return request(_0x87be('0x2e'),{'body':_0x36f361});};exports[_0x87be('0x2f')]=function(_0x353eda){return request(_0x87be('0x30'),{'options':{'raw':![],'where':{'phone':_0x353eda[_0x87be('0x31')],'ListId':_0x353eda[_0x87be('0x32')]}}})[_0x87be('0x8')](function(_0x3594dd){if(_0x3594dd){return _0x3594dd;}return request(_0x87be('0x33'),{'body':_0x353eda});});};exports['getPauseById']=function(_0x59f8fb){return request('ShowPause',{'options':{'where':{'id':_0x59f8fb},'attributes':[_0x87be('0x11')]}});};exports[_0x87be('0x34')]=function(_0x2d9f2e,_0x554458){return request(_0x87be('0x35'),{'body':{'interface':_0x554458},'options':{'where':_0x2d9f2e}});};exports[_0x87be('0x36')]=function(_0x398644,_0x3f5a34,_0x53fb70){return request(_0x87be('0x37'),{'body':{'type':_0x3f5a34,'uniqueid':_0x53fb70},'options':{'where':_0x398644}});};exports['agentUnpause']=function(_0x5e11bb){return request('UnpauseUser',{'body':{},'options':{'where':_0x5e11bb}});};exports['agentLogout']=function(_0x1856ef){return request(_0x87be('0x38'),{'body':{},'options':{'where':_0x1856ef}});}; \ No newline at end of file +var _0x0bdc=['jayson/promise','client','http','request','error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','getSquareProjectById','ShowVariable','getSquareOdbcById','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash'];(function(_0x5b26d1,_0x363a3d){var _0x940da3=function(_0x305d19){while(--_0x305d19){_0x5b26d1['push'](_0x5b26d1['shift']());}};_0x940da3(++_0x363a3d);}(_0x0bdc,0x141));var _0xc0bd=function(_0xb2b7c3,_0x1832bd){_0xb2b7c3=_0xb2b7c3-0x0;var _0x5160e2=_0x0bdc[_0xb2b7c3];return _0x5160e2;};'use strict';var BPromise=require(_0xc0bd('0x0'));var moment=require(_0xc0bd('0x1'));var _=require(_0xc0bd('0x2'));var util=require('util');var jayson=require(_0xc0bd('0x3'));var client=jayson[_0xc0bd('0x4')][_0xc0bd('0x5')]({'port':0x2329});function request(_0x2bdd7b,_0x22bd77){return new BPromise(function(_0x140d67,_0x2dba13){return client[_0xc0bd('0x6')](_0x2bdd7b,_0x22bd77)['then'](function(_0x5f40a3){if(_0x5f40a3['error']){return _0x2dba13(_0x5f40a3[_0xc0bd('0x7')][_0xc0bd('0x8')]);}else{return _0x140d67(_0x5f40a3['result']);}})[_0xc0bd('0x9')](function(_0x25dc44){return _0x2dba13(_0x25dc44);});});}exports[_0xc0bd('0xa')]=function(_0xfa6356){return request(_0xc0bd('0xb'),{'options':{'raw':![],'where':{'name':_0xfa6356},'attributes':[_0xc0bd('0xc')]}});};exports[_0xc0bd('0xd')]=function(_0x1fd8f6){return request(_0xc0bd('0xe'),{'options':{'raw':![],'where':{'id':_0x1fd8f6},'include':[{'model':'MailServerOut','as':_0xc0bd('0xf')}],'attributes':['id',_0xc0bd('0x10'),'email']}});};exports[_0xc0bd('0x11')]=function(_0x4a4f34){return request('ShowSquareProject',{'options':{'where':{'id':_0x4a4f34},'attributes':[_0xc0bd('0x10')]}});};exports['getVoiceQueueById']=function(_0x43add4){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x43add4},'attributes':[_0xc0bd('0x10')]}});};exports['getVariableById']=function(_0x3d8197){return request(_0xc0bd('0x12'),{'options':{'where':{'id':_0x3d8197},'attributes':[_0xc0bd('0x10')]}});};exports[_0xc0bd('0x13')]=function(_0x56b5ac){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x56b5ac},'attributes':['dsn']}});};exports[_0xc0bd('0x14')]=function(_0x3e3e09){return request(_0xc0bd('0x15'),{'options':{'where':{'id':_0x3e3e09},'attributes':['name']}});};exports[_0xc0bd('0x16')]=function(_0x4271d8){return request('ShowTrunk',{'options':{'where':{'id':_0x4271d8},'attributes':['name']}});};exports[_0xc0bd('0x17')]=function(_0x28527c){return request(_0xc0bd('0x18'),{'options':{'where':{'id':_0x28527c},'attributes':[_0xc0bd('0x19')]}});};exports[_0xc0bd('0x1a')]=function(_0x61246f){return request(_0xc0bd('0x1b'),{'options':{'raw':![],'where':{'id':_0x61246f},'include':[{'model':'Interval','as':_0xc0bd('0x1c')}]}});};exports['getSmsAccountById']=function(_0x386738){return request(_0xc0bd('0x1d'),{'options':{'where':{'id':_0x386738},'attributes':['id',_0xc0bd('0x10')]}});};exports[_0xc0bd('0x1e')]=function(_0x756de3){return request('CreateSmsMessage',{'body':_0x756de3});};exports[_0xc0bd('0x1f')]=function(_0x3cf69a){return request('CreateSquareDetailsReport',{'body':_0x3cf69a});};exports[_0xc0bd('0x20')]=function(_0x468722){return request(_0xc0bd('0x21'),{'body':_[_0xc0bd('0x22')](_0x468722,{'project_name':_0x468722['arg_1'],'prev_project_name':_0x468722['arg_2']||'','is_subproject':_0x468722['arg_2']?!![]:![],'leaveAt':moment()[_0xc0bd('0x23')](_0xc0bd('0x24'))})});};exports[_0xc0bd('0x25')]=function(_0x40bfb8){return request(_0xc0bd('0x26'),{'body':_0x40bfb8});};exports[_0xc0bd('0x27')]=function(_0x59daa9){return request(_0xc0bd('0x28'),{'body':_0x59daa9});};exports[_0xc0bd('0x29')]=function(_0x26d1db){return request(_0xc0bd('0x2a'),{'options':{'raw':![],'where':{'phone':_0x26d1db[_0xc0bd('0x2b')],'ListId':_0x26d1db[_0xc0bd('0x2c')]}}})[_0xc0bd('0x2d')](function(_0x32277d){if(_0x32277d){return _0x32277d;}return request(_0xc0bd('0x2e'),{'body':_0x26d1db});});};exports[_0xc0bd('0x2f')]=function(_0xa003c6){return request(_0xc0bd('0x30'),{'options':{'where':{'id':_0xa003c6},'attributes':[_0xc0bd('0x10')]}});};exports['agentLogin']=function(_0x3e2799,_0x45da1a){return request(_0xc0bd('0x31'),{'body':{'interface':_0x45da1a},'options':{'where':_0x3e2799}});};exports[_0xc0bd('0x32')]=function(_0x4115cc,_0x39608b,_0x256dca){return request('PauseUser',{'body':{'type':_0x39608b,'uniqueid':_0x256dca},'options':{'where':_0x4115cc}});};exports[_0xc0bd('0x33')]=function(_0x29ed7c){return request(_0xc0bd('0x34'),{'body':{},'options':{'where':_0x29ed7c}});};exports[_0xc0bd('0x35')]=function(_0x32c900){return request('LogoutUser',{'body':{},'options':{'where':_0x32c900}});}; \ 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 a588968..d4caced 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 _0xc9ab=['./lex','exports','./polly'];(function(_0x90c108,_0xf97d3b){var _0x47f929=function(_0x4139dd){while(--_0x4139dd){_0x90c108['push'](_0x90c108['shift']());}};_0x47f929(++_0xf97d3b);}(_0xc9ab,0x125));var _0xbc9a=function(_0x3ebdd4,_0x4fdca1){_0x3ebdd4=_0x3ebdd4-0x0;var _0x12766e=_0xc9ab[_0x3ebdd4];return _0x12766e;};var polly=require(_0xbc9a('0x0'));var lex=require(_0xbc9a('0x1'));module[_0xbc9a('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x31f0=['exports','./polly'];(function(_0x2dbd64,_0x4cce1f){var _0x4d9b97=function(_0x5a5196){while(--_0x5a5196){_0x2dbd64['push'](_0x2dbd64['shift']());}};_0x4d9b97(++_0x4cce1f);}(_0x31f0,0xb7));var _0x031f=function(_0x4a1b75,_0x44dbf4){_0x4a1b75=_0x4a1b75-0x0;var _0x573fd8=_0x31f0[_0x4a1b75];return _0x573fd8;};var polly=require(_0x031f('0x0'));var lex=require('./lex');module[_0x031f('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 6c6d4a1..a9ec881 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x352a8d,_0x2a91b2,_0x4611be,_0x20aa4b,_0x447096,_0x192d48){return lex(_0x352a8d,_0x2a91b2,_0x4611be,_0x20aa4b,_0x447096,_0x192d48);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e){return lex(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e);}; \ 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 2dd0b86..711e5af 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(_0xfb6bf4,_0x911231){var _0xfa2c4e=function(_0x17264b){while(--_0x17264b){_0xfb6bf4['push'](_0xfb6bf4['shift']());}};_0xfa2c4e(++_0x911231);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x428286,_0x5ab700){var _0x1b377e=function(_0x3de5c3){while(--_0x3de5c3){_0x428286['push'](_0x428286['shift']());}};_0x1b377e(++_0x5ab700);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 d3e5c9d..3889e51 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 _0x3a9e=['exports','./lib/api'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0x3a9e,0x125));var _0xe3a9=function(_0xae2cbf,_0x1446a6){_0xae2cbf=_0xae2cbf-0x0;var _0x31931b=_0x3a9e[_0xae2cbf];return _0x31931b;};'use strict';var polly=require(_0xe3a9('0x0'));module[_0xe3a9('0x1')]=function(_0xf04e0a,_0x184077,_0x2c3297,_0x198bb9,_0x151314,_0x56083d,_0x29fd6f){return polly(_0xf04e0a,_0x184077,_0x2c3297,_0x198bb9,_0x151314,_0x56083d,_0x29fd6f);}; \ No newline at end of file +var _0x3024=['exports','./lib/api'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x3024,0x10f));var _0x4302=function(_0x2c04cc,_0x217034){_0x2c04cc=_0x2c04cc-0x0;var _0x2bb10b=_0x3024[_0x2c04cc];return _0x2bb10b;};'use strict';var polly=require(_0x4302('0x0'));module[_0x4302('0x1')]=function(_0x2249bc,_0x1bc161,_0x2f6836,_0x2ccc49,_0xd03d59,_0x578992,_0x30cae8){return polly(_0x2249bc,_0x1bc161,_0x2f6836,_0x2ccc49,_0xd03d59,_0x578992,_0x30cae8);}; \ 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 8bb8a68..c156f42 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 _0x7098=['text','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly'];(function(_0x450bc8,_0x346a23){var _0x1a9af2=function(_0x5a5ea5){while(--_0x5a5ea5){_0x450bc8['push'](_0x450bc8['shift']());}};_0x1a9af2(++_0x346a23);}(_0x7098,0x121));var _0x8709=function(_0x351f64,_0x385f62){_0x351f64=_0x351f64-0x0;var _0xd14797=_0x7098[_0x351f64];return _0xd14797;};'use strict';var fs=require('fs');var path=require(_0x8709('0x0'));var BPromise=require(_0x8709('0x1'));var rs=require('randomstring');var AWS=require(_0x8709('0x2'));function pollyResult(_0x52933b,_0x2358e9,_0x4a7470){return new BPromise(function(_0x2755c4,_0x13f575){_0x52933b[_0x8709('0x3')](_0x2358e9,function(_0x53a886,_0x32bbe0){if(_0x53a886){_0x13f575(_0x53a886);}else if(_0x32bbe0){if(_0x32bbe0[_0x8709('0x4')]instanceof Buffer){fs['writeFile'](_0x4a7470,_0x32bbe0[_0x8709('0x4')],function(_0x38b507){if(_0x38b507){_0x13f575(_0x38b507);}else{_0x2755c4();}});}else{_0x13f575(new Error(_0x8709('0x5')));}}else{_0x13f575(new Error(_0x8709('0x6')));}});});}module['exports']=function(_0x107654,_0x481ca4,_0x1db33c,_0x400735,_0x4ff32e,_0xea1a7b,_0x25ce21){var _0x1873f7=new AWS[(_0x8709('0x7'))]({'accessKeyId':_0x107654,'secretAccessKey':_0x481ca4,'region':_0x1db33c});var _0x3174ca={'Text':_0x4ff32e,'TextType':_0xea1a7b||_0x8709('0x8'),'OutputFormat':'mp3','VoiceId':_0x400735};return pollyResult(_0x1873f7,_0x3174ca,_0x25ce21);}; \ No newline at end of file +var _0x58ef=['Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x2fc03c,_0x27d8cb){var _0x187df2=function(_0x20e1b3){while(--_0x20e1b3){_0x2fc03c['push'](_0x2fc03c['shift']());}};_0x187df2(++_0x27d8cb);}(_0x58ef,0x19d));var _0xf58e=function(_0x49f2bf,_0x461315){_0x49f2bf=_0x49f2bf-0x0;var _0x1897ac=_0x58ef[_0x49f2bf];return _0x1897ac;};'use strict';var fs=require('fs');var path=require(_0xf58e('0x0'));var BPromise=require('bluebird');var rs=require(_0xf58e('0x1'));var AWS=require(_0xf58e('0x2'));function pollyResult(_0x108a5b,_0x3c3696,_0x552165){return new BPromise(function(_0x6fda40,_0x132137){_0x108a5b[_0xf58e('0x3')](_0x3c3696,function(_0x4692bf,_0x42e056){if(_0x4692bf){_0x132137(_0x4692bf);}else if(_0x42e056){if(_0x42e056[_0xf58e('0x4')]instanceof Buffer){fs[_0xf58e('0x5')](_0x552165,_0x42e056['AudioStream'],function(_0x19ae21){if(_0x19ae21){_0x132137(_0x19ae21);}else{_0x6fda40();}});}else{_0x132137(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x132137(new Error(_0xf58e('0x6')));}});});}module['exports']=function(_0x3bad01,_0x344eb5,_0x1c0493,_0x4cf19a,_0x1cd5d9,_0x142dd7,_0x35f13d){var _0x1c0a9a=new AWS[(_0xf58e('0x7'))]({'accessKeyId':_0x3bad01,'secretAccessKey':_0x344eb5,'region':_0x1c0493});var _0x224eef={'Text':_0x1cd5d9,'TextType':_0x142dd7||_0xf58e('0x8'),'OutputFormat':_0xf58e('0x9'),'VoiceId':_0x4cf19a};return pollyResult(_0x1c0a9a,_0x224eef,_0x35f13d);}; \ 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 4c9f4cf..54c2bc3 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 _0x1b41=['exports','./lib/api'];(function(_0x8ee32b,_0x434714){var _0x891c84=function(_0x2a0214){while(--_0x2a0214){_0x8ee32b['push'](_0x8ee32b['shift']());}};_0x891c84(++_0x434714);}(_0x1b41,0xcf));var _0x11b4=function(_0x55a89d,_0x584ea7){_0x55a89d=_0x55a89d-0x0;var _0x1b0e5a=_0x1b41[_0x55a89d];return _0x1b0e5a;};'use strict';var asr=require(_0x11b4('0x0'));module[_0x11b4('0x1')]=function(_0x104f89,_0x11bc2a,_0x1d72b6,_0x3e0623){return asr(_0x104f89,_0x11bc2a,_0x1d72b6);}; \ No newline at end of file +var _0x76d9=['exports'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x76d9,0x78));var _0x976d=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x76d9[_0x2dadb9];return _0x2f0097;};'use strict';var asr=require('./lib/api');module[_0x976d('0x0')]=function(_0x106005,_0x397955,_0x53ab75,_0x5989d7){return asr(_0x106005,_0x397955,_0x53ab75);}; \ 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 4be9bca..0d6f6d5 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 _0x6fad=['length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string'];(function(_0x1a4c4a,_0x32312a){var _0x1118aa=function(_0x1ac78d){while(--_0x1ac78d){_0x1a4c4a['push'](_0x1a4c4a['shift']());}};_0x1118aa(++_0x32312a);}(_0x6fad,0x174));var _0xd6fa=function(_0x3f848a,_0x57e33f){_0x3f848a=_0x3f848a-0x0;var _0x504c7b=_0x6fad[_0x3f848a];return _0x504c7b;};'use strict';var url=require(_0xd6fa('0x0'));var BPromise=require(_0xd6fa('0x1'));var fs=require('fs');var host=_0xd6fa('0x2');module[_0xd6fa('0x3')]=function(_0x4f8a1c,_0x2f5f9b,_0x4ae415){return new BPromise(function(_0x3e08a3,_0x48f433){var _0x3e76d0;if(typeof _0x4f8a1c!==_0xd6fa('0x4')||_0x4f8a1c['length']===0x0){return _0x48f433(_0xd6fa('0x5'));}if(typeof _0x2f5f9b!==_0xd6fa('0x4')||_0x2f5f9b[_0xd6fa('0x6')]===0x0){return _0x48f433(_0xd6fa('0x7'));}if(typeof _0x4ae415!=='undefined'&&(typeof _0x4ae415!==_0xd6fa('0x4')||_0x4ae415['length']===0x0)){return _0x48f433(_0xd6fa('0x8'));}try{_0x3e76d0=fs[_0xd6fa('0x9')](_0x4f8a1c)[_0xd6fa('0xa')](_0xd6fa('0xb'));}catch(_0x331241){return _0x48f433(_0x331241);}return _0x3e08a3({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x2f5f9b,'body':{'config':{'encoding':_0xd6fa('0xc'),'sampleRateHertz':_0xd6fa('0xd'),'languageCode':_0x4ae415},'audio':{'content':_0x3e76d0}},'json':!![]});});}; \ No newline at end of file +var _0xb2ff=['readFileSync','base64','POST','LINEAR16','8000','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb2ff[_0x3ab51d];return _0x29a04e;};'use strict';var url=require(_0xfb2f('0x0'));var BPromise=require(_0xfb2f('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xfb2f('0x2')]=function(_0x54e80d,_0x584330,_0x51e1fe){return new BPromise(function(_0x13cb60,_0x484368){var _0x145e77;if(typeof _0x54e80d!==_0xfb2f('0x3')||_0x54e80d[_0xfb2f('0x4')]===0x0){return _0x484368(_0xfb2f('0x5'));}if(typeof _0x584330!=='string'||_0x584330['length']===0x0){return _0x484368(_0xfb2f('0x6'));}if(typeof _0x51e1fe!=='undefined'&&(typeof _0x51e1fe!==_0xfb2f('0x3')||_0x51e1fe[_0xfb2f('0x4')]===0x0)){return _0x484368(_0xfb2f('0x7'));}try{_0x145e77=fs[_0xfb2f('0x8')](_0x54e80d)['toString'](_0xfb2f('0x9'));}catch(_0x5084f0){return _0x484368(_0x5084f0);}return _0x13cb60({'method':_0xfb2f('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x584330,'body':{'config':{'encoding':_0xfb2f('0xb'),'sampleRateHertz':_0xfb2f('0xc'),'languageCode':_0x51e1fe},'audio':{'content':_0x145e77}},'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 1998d04..dde7ff4 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 _0xbf19=['./asr','exports'];(function(_0x319a03,_0x4456d4){var _0x3b6704=function(_0x1f3476){while(--_0x1f3476){_0x319a03['push'](_0x319a03['shift']());}};_0x3b6704(++_0x4456d4);}(_0xbf19,0x1e4));var _0x9bf1=function(_0x14df51,_0x705140){_0x14df51=_0x14df51-0x0;var _0x4937f0=_0xbf19[_0x14df51];return _0x4937f0;};var asr=require(_0x9bf1('0x0'));module[_0x9bf1('0x1')]={'asr':asr}; \ No newline at end of file +var _0x9e89=['exports','./asr'];(function(_0x405790,_0xf7b5f9){var _0x10a417=function(_0x204a66){while(--_0x204a66){_0x405790['push'](_0x405790['shift']());}};_0x10a417(++_0xf7b5f9);}(_0x9e89,0x11f));var _0x99e8=function(_0xcb2c54,_0x23194f){_0xcb2c54=_0xcb2c54-0x0;var _0x54adcb=_0x9e89[_0xcb2c54];return _0x54adcb;};var asr=require(_0x99e8('0x0'));module[_0x99e8('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 f177938..1d4b754 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 _0xd925=['https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','statusCode','data','transcode','wav','error\x20convert','finish\x20to\x20convert','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','resolve','tmp','audioContent','googleTTS','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','.mp3','goggleTTS\x20path','googleASR','results','alternatives','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','queryText','tildeASR','asr','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','channelData','CustomActionData','AudioFromTts','.wav','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','agi'];(function(_0x466507,_0x62475b){var _0xf766db=function(_0x531243){while(--_0x531243){_0x466507['push'](_0x466507['shift']());}};_0xf766db(++_0x62475b);}(_0xd925,0x16a));var _0x5d92=function(_0x155f35,_0x9d54f7){_0x155f35=_0x155f35-0x0;var _0x38e884=_0xd925[_0x155f35];return _0x38e884;};'use strict';var apiai=require(_0x5d92('0x0'));var BPromise=require(_0x5d92('0x1'));var dialogflow=require(_0x5d92('0x2'));var fs=require('fs');var http=require(_0x5d92('0x3'));var https=require('https');var md5=require(_0x5d92('0x4'));var path=require(_0x5d92('0x5'));var querystring=require('querystring');var rp=require(_0x5d92('0x6'));var rs=require(_0x5d92('0x7'));var sox=require(_0x5d92('0x8'));var tts=require(_0x5d92('0x9'));var urlParse=require(_0x5d92('0xa'))[_0x5d92('0xb')];var util=require(_0x5d92('0xc'));var aws=require(_0x5d92('0xd'));var google=require('./google');var sestek=require(_0x5d92('0xe'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x5d92('0xf'));var ISPEECH_API=_0x5d92('0x10');function downloadFile(_0x5e3dee,_0x4c6585){return new BPromise(function(_0x4e995b,_0x2f441a){var _0x5edfed=urlParse(_0x5e3dee);var _0x5d25be=_0x5edfed[_0x5d92('0x11')]===_0x5d92('0x12')?https:http;var _0x58a41d={'host':_0x5edfed['host'],'path':_0x5edfed[_0x5d92('0x5')],'headers':{'user-agent':_0x5d92('0x13')}};_0x5d25be[_0x5d92('0x14')](_0x58a41d,function(_0x4a8fb0){if(_0x4a8fb0['statusCode']!==0xc8){logger[_0x5d92('0x15')](_0x5d92('0x16')+_0x5e3dee+_0x5d92('0x17')+_0x4a8fb0['statusCode']+'\x20('+_0x4a8fb0[_0x5d92('0x18')]+')');_0x2f441a(new Error(_0x5d92('0x16')+_0x5e3dee+'\x20failed,\x20status\x20code\x20=\x20'+_0x4a8fb0['statusCode']+'\x20('+_0x4a8fb0[_0x5d92('0x18')]+')'));return;}var _0x2ea333=fs[_0x5d92('0x19')](_0x4c6585);_0x2ea333['on'](_0x5d92('0x1a'),function(){logger[_0x5d92('0x1b')](_0x5d92('0x1c'));_0x2ea333[_0x5d92('0x1d')](_0x4e995b);});_0x2ea333['on'](_0x5d92('0x15'),function(_0x6e4fb0){fs[_0x5d92('0x1e')](_0x4c6585);logger[_0x5d92('0x15')](_0x5d92('0x1f'),_0x6e4fb0);_0x2f441a(_0x6e4fb0);});_0x4a8fb0[_0x5d92('0x20')](_0x2ea333);})['on'](_0x5d92('0x15'),function(_0x513d60){logger['error'](_0x513d60);_0x2f441a(_0x513d60);})[_0x5d92('0x21')]();});}function uploadFile(_0x4d5678){return new BPromise(function(_0x2e4f20,_0x4d2f3d){var _0x180be1=urlParse(_0x4d5678);var _0x442bea=_0x180be1[_0x5d92('0x11')]===_0x5d92('0x12')?https:http;var _0x5d8ac4={'host':_0x180be1['host'],'path':_0x180be1[_0x5d92('0x5')],'headers':{'user-agent':_0x5d92('0x13')}};_0x442bea[_0x5d92('0x14')](_0x5d8ac4,function(_0x5d05eb){if(_0x5d05eb[_0x5d92('0x22')]!==0xc8){_0x4d2f3d(new Error(_0x5d92('0x16')+_0x4d5678+_0x5d92('0x17')+_0x5d05eb[_0x5d92('0x22')]+'\x20('+_0x5d05eb[_0x5d92('0x18')]+')'));return;}var _0x44d8eb='';_0x5d05eb['on'](_0x5d92('0x23'),function(_0x2dc1ec){_0x44d8eb+=_0x2dc1ec;});_0x5d05eb['on']('end',function(){_0x2e4f20(_0x44d8eb);});})['on'](_0x5d92('0x15'),function(_0x43eebd){_0x4d2f3d(_0x43eebd);})[_0x5d92('0x21')]();});}function convertFile(_0x1ceca7,_0x436187){return new BPromise(function(_0x16066f,_0x302495){var _0x3f1648=sox[_0x5d92('0x24')](_0x1ceca7,_0x436187,{'sampleRate':0x1f40,'format':_0x5d92('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3f1648['on']('error',function(_0x3b32ad){logger['error'](_0x5d92('0x26'),_0x3b32ad);_0x302495(_0x3b32ad);});_0x3f1648['on'](_0x5d92('0x21'),function(){logger[_0x5d92('0x1b')](_0x5d92('0x27'));_0x16066f();});_0x3f1648['start']();});}function base64Decode(_0x42a6f2,_0x3cb7f2){var _0x2a5e72=path['resolve'](__dirname,'tmp',rs[_0x5d92('0x28')](0x4)+'.wav');fs[_0x5d92('0x29')](_0x2a5e72,_0x42a6f2,_0x5d92('0x2a'));return convertFile(_0x2a5e72,_0x3cb7f2)[_0x5d92('0x2b')](function(){try{fs['unlink'](_0x2a5e72);fs[_0x5d92('0x2c')](_0x3cb7f2,_0x5d92('0x2d'));}catch(_0x2dc287){logger[_0x5d92('0x15')](_0x2dc287);}return _0x3cb7f2[_0x5d92('0x2e')]('.')[0x0];});}function base64Encode(_0x21d0d4){var _0x178013=fs[_0x5d92('0x2f')](_0x21d0d4);return new Buffer(_0x178013)['toString']('base64');}exports['googleCloudTTS']=function(_0x109c77,_0x59dfea,_0x4bd739,_0x4f7668,_0x547593,_0x31bdec){var _0x5480b6,_0x3e422d;var _0x28eec7=_0x5d92('0x30');var _0x46f75a=_0x5d92('0x31')+_0x109c77;var _0x28ac8f={};if(_0x59dfea===_0x5d92('0x32')){_0x28ac8f['input']={'ssml':_0x4bd739};}else{_0x28ac8f[_0x5d92('0x33')]={'text':_0x4bd739};};_0x28ac8f['voice']={'languageCode':_0x4f7668,'ssmlGender':_0x547593};_0x28ac8f[_0x5d92('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x493e18={'url':_0x28eec7+_0x5d92('0x35')+_0x46f75a,'method':'POST','json':!![],'body':_0x28ac8f};return rp(_0x493e18)[_0x5d92('0x2b')](function(_0x2195cb){return new BPromise(function(_0x3cf199,_0x46e8fe){_0x5480b6=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs[_0x5d92('0x28')](0x4)+'.mp3');var _0x52f6e7=Buffer['from'](_0x2195cb[_0x5d92('0x38')],_0x5d92('0x2a'));return fs['writeFile'](_0x5480b6,_0x52f6e7,function(_0x28b163){_0x46e8fe(_0x28b163);},function(_0x1d2474){fs[_0x5d92('0x2c')](_0x5480b6,'777');_0x3cf199(_0x1d2474);});});})[_0x5d92('0x2b')](function(_0x4502f7){_0x3e422d=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0x5480b6,_0x3e422d);})[_0x5d92('0x2b')](function(){try{fs['unlink'](_0x5480b6);fs[_0x5d92('0x2c')](_0x3e422d,_0x5d92('0x2d'));}catch(_0x37280d){logger[_0x5d92('0x15')](_0x37280d);}logger[_0x5d92('0x1b')]('googleCloudTTS\x20path',_0x3e422d[_0x5d92('0x2e')]('.')[0x0]);return _0x3e422d['split']('.')[0x0];});};exports[_0x5d92('0x39')]=function(_0x3b41cf,_0x5b2fc9){var _0x14a4ce='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x54e824,_0x3e439e;var _0x449d9e;var _0x4fcab7={'encoding':'utf8','method':_0x5d92('0x3a'),'timeout':0x2710,'url':_0x14a4ce,'headers':{'Content-Type':_0x5d92('0x3b')},'body':_0x5d92('0x3c')+encodeURIComponent(JSON[_0x5d92('0x3d')]([[[_0x5d92('0x3e'),JSON[_0x5d92('0x3d')]([_0x3b41cf,_0x5b2fc9||'en',![],_0x5d92('0x3f')]),null,_0x5d92('0x40')]]]))};return rp(_0x4fcab7)[_0x5d92('0x2b')](function(_0x57c77b){try{_0x449d9e=eval(_0x57c77b[_0x5d92('0x41')](0x5))[0x0][0x2];}catch(_0x3cb21){throw new Error(_0x5d92('0x42')+_0x57c77b[_0x5d92('0x23')]);}if(!_0x449d9e){if(_0x3b41cf[_0x5d92('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x5d92('0x44')+_0x5b2fc9+'\x22\x20might\x20not\x20exist');}}try{_0x449d9e=eval(_0x449d9e)[0x0];}catch(_0x1782ae){throw new Error(_0x5d92('0x42')+res[_0x5d92('0x23')]);}const _0x2184f0=_0x449d9e;_0x54e824=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs['generate'](0x4)+_0x5d92('0x45'));fs[_0x5d92('0x29')](_0x54e824,_0x449d9e,{'encoding':_0x5d92('0x2a')});_0x3e439e=path['resolve'](__dirname,_0x5d92('0x37'),rs[_0x5d92('0x28')](0x4)+'.wav');return convertFile(_0x54e824,_0x3e439e);})[_0x5d92('0x2b')](function(){try{fs[_0x5d92('0x1e')](_0x54e824);fs[_0x5d92('0x2c')](_0x3e439e,_0x5d92('0x2d'));}catch(_0x51a198){logger['error'](_0x51a198);}logger['info'](_0x5d92('0x46'),_0x3e439e[_0x5d92('0x2e')]('.')[0x0]);return _0x3e439e[_0x5d92('0x2e')]('.')[0x0];});};exports[_0x5d92('0x47')]=function(_0x3bcc06,_0x4fdd0b,_0x429812){return google['asr'](_0x3bcc06,_0x4fdd0b,_0x429812)[_0x5d92('0x2b')](function(_0x5d36bc){logger[_0x5d92('0x1b')](_0x5d36bc['uri']);return rp(_0x5d36bc);})[_0x5d92('0x2b')](function(_0x5cfc8c){var _0x390cc1='';var _0x4c7690=0x0;try{fs[_0x5d92('0x1e')](_0x3bcc06);}catch(_0x30ff5b){logger[_0x5d92('0x15')](_0x30ff5b);}if(_0x5cfc8c&&_0x5cfc8c[_0x5d92('0x48')]){_0x390cc1=_0x5cfc8c[_0x5d92('0x48')]['map'](function(_0xc0912a){return _0xc0912a&&_0xc0912a[_0x5d92('0x49')][0x0]&&_0xc0912a[_0x5d92('0x49')][0x0]['transcript']?_0xc0912a[_0x5d92('0x49')][0x0]['transcript']:'';})[_0x5d92('0x4a')]('\x0a');_0x4c7690=_0x5cfc8c[_0x5d92('0x48')]['map'](function(_0x5961fd){return _0x5961fd&&_0x5961fd[_0x5d92('0x49')][0x0]&&_0x5961fd[_0x5d92('0x49')][0x0][_0x5d92('0x4b')]?_0x5961fd[_0x5d92('0x49')][0x0][_0x5d92('0x4b')]:0x0;})[_0x5d92('0x4a')]('\x0a');}logger[_0x5d92('0x1b')](_0x5d92('0x4c'),_0x390cc1);logger[_0x5d92('0x1b')](_0x5d92('0x4d'),_0x4c7690);return{'transcript':_0x390cc1,'confidence':_0x4c7690};})[_0x5d92('0x4e')](function(_0xd10f8b){logger[_0x5d92('0x15')](_0x5d92('0x4f'),_0xd10f8b[_0x5d92('0x22')],_0xd10f8b[_0x5d92('0x50')],_0xd10f8b['message']);});};exports['googleDialogflow']=function(_0x39a2b8,_0x473fa6,_0x175ff5,_0x1d4659){var _0x362d22=apiai(_0x473fa6,{'language':_0x1d4659||'en'});return _0x362d22[_0x5d92('0x51')](_0x175ff5,{'sessionId':md5(_0x39a2b8)})[_0x5d92('0x2b')](function(_0x5a6709){logger[_0x5d92('0x1b')](JSON[_0x5d92('0x3d')](_0x5a6709));return{'source':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x53')],'resolvedQuery':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x54')],'action':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x55')],'actionIncomplete':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x56')],'speech':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x57')]['speech'],'score':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x58')],'statusCode':_0x5a6709[_0x5d92('0x59')][_0x5d92('0x5a')],'endConversation':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x5b')][_0x5d92('0x5c')]||![],'isFallbackIntent':_0x5a6709[_0x5d92('0x52')][_0x5d92('0x5b')][_0x5d92('0x5d')]};});};exports['googleDialogflowV2']=function(_0xc81b20,_0x3f9a9a,_0x3c0202,_0x5db1a4,_0x365dbb,_0x2f6462){var _0x517100=_0x5db1a4['replace'](/\\n/g,'\x0a');var _0x53fc23={'credentials':{'private_key':_0x517100,'client_email':_0x3c0202}};var _0x1dd951=new dialogflow['SessionsClient'](_0x53fc23);var _0x432bf4=_0x1dd951[_0x5d92('0x5e')](_0x3f9a9a,md5(_0xc81b20));var _0x4f583d={'session':_0x432bf4,'queryInput':{'text':{'text':_0x365dbb,'languageCode':_0x2f6462}}};return _0x1dd951[_0x5d92('0x5f')](_0x4f583d)[_0x5d92('0x2b')](function(_0x265c23){if(_0x265c23&&_0x265c23[_0x5d92('0x43')]){logger[_0x5d92('0x1b')](_0x5d92('0x60'),JSON['stringify'](_0x265c23));var _0x773a52=_0x265c23[0x0];if(_0x773a52){var _0x54e128={'action':_0x773a52[_0x5d92('0x61')]['action'],'allRequiredParamsPresent':_0x773a52[_0x5d92('0x61')]['allRequiredParamsPresent'],'endConversation':_0x773a52[_0x5d92('0x61')][_0x5d92('0x62')]&&_0x773a52['queryResult'][_0x5d92('0x62')][_0x5d92('0x63')]?_0x773a52[_0x5d92('0x61')][_0x5d92('0x62')][_0x5d92('0x63')][_0x5d92('0x64')]['boolValue']:![],'fulfillmentText':_0x773a52[_0x5d92('0x61')][_0x5d92('0x65')],'intentName':_0x773a52['queryResult'][_0x5d92('0x66')]['name'],'intentDisplayName':_0x773a52[_0x5d92('0x61')][_0x5d92('0x66')][_0x5d92('0x67')],'isFallbackIntent':_0x773a52[_0x5d92('0x61')][_0x5d92('0x66')][_0x5d92('0x68')],'languageCode':_0x773a52[_0x5d92('0x61')]['languageCode'],'queryText':_0x773a52[_0x5d92('0x61')][_0x5d92('0x69')],'responseId':_0x773a52['responseId'],'score':_0x773a52[_0x5d92('0x61')]['intentDetectionConfidence'],'speech':_0x773a52['queryResult'][_0x5d92('0x65')],'providerResponse':JSON[_0x5d92('0x3d')](_0x265c23)};return _0x54e128;}}});};exports[_0x5d92('0x6a')]=function(_0x312419,_0x1e8f52,_0x5e253b,_0x415b95){return tilde[_0x5d92('0x6b')](_0x312419,_0x1e8f52,_0x5e253b,_0x415b95)['then'](function(_0x56b964){try{fs['unlink'](_0x312419);}catch(_0x48095d){logger[_0x5d92('0x15')](_0x48095d);}logger[_0x5d92('0x1b')]('Tilde\x20ASR\x20transcription',_0x56b964[_0x5d92('0x6c')]);logger[_0x5d92('0x1b')](_0x5d92('0x6d'),_0x56b964[_0x5d92('0x4b')]);return _0x56b964;});};exports[_0x5d92('0x6e')]=function(_0x57dbd2,_0x5edbee,_0x50e92b,_0x3a7f40,_0x2d1d74,_0x377358){var _0x201de2=path[_0x5d92('0x36')](__dirname,'tmp',rs[_0x5d92('0x28')](0x4)+_0x5d92('0x45'));var _0xe0b9a7;return aws[_0x5d92('0x6f')](_0x57dbd2,_0x5edbee,_0x50e92b,_0x3a7f40,_0x2d1d74,_0x377358,_0x201de2)['then'](function(){_0xe0b9a7=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0x201de2,_0xe0b9a7);})[_0x5d92('0x2b')](function(){try{fs['unlink'](_0x201de2);fs[_0x5d92('0x2c')](_0xe0b9a7,'777');}catch(_0x55eaa5){logger[_0x5d92('0x15')](_0x55eaa5);}return _0xe0b9a7[_0x5d92('0x2e')]('.')[0x0];});};exports[_0x5d92('0x70')]=function(_0xc2025a,_0x41752f,_0x4a9331,_0x5d7757,_0x3cdae7,_0x41f2c6){return aws[_0x5d92('0x71')](_0xc2025a,_0x41752f,_0x4a9331,_0x5d7757,_0x3cdae7,_0x41f2c6)[_0x5d92('0x2b')](function(_0x5337fe){logger[_0x5d92('0x1b')](JSON[_0x5d92('0x3d')](_0x5337fe));return _0x5337fe;});};exports[_0x5d92('0x72')]=function(_0x241cda,_0x32a7b3,_0x3d9395,_0x5a062e){var _0x3ddccc=util[_0x5d92('0x73')](_0x5d92('0x74'),ISPEECH_API,_0x241cda,encodeURIComponent(_0x32a7b3),_0x3d9395,_0x5a062e);var _0xef2826=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x5d92('0x45'));var _0x48eb36;return downloadFile(_0x3ddccc,_0xef2826)[_0x5d92('0x2b')](function(){_0x48eb36=path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0xef2826,_0x48eb36);})[_0x5d92('0x2b')](function(){try{fs[_0x5d92('0x1e')](_0xef2826);fs['chmodSync'](_0x48eb36,'777');}catch(_0x5c31ee){logger['error'](_0x5c31ee);}return _0x48eb36[_0x5d92('0x2e')]('.')[0x0];});};exports['ispeechASR']=function(_0x5c4821,_0x4dbc38,_0x177b29,_0x4721c1){var _0xc18d7d=util[_0x5d92('0x73')](_0x5d92('0x75'),ISPEECH_API,_0x4dbc38,_0x177b29,base64Encode(_0x5c4821),_0x4721c1?util[_0x5d92('0x73')]('model=%s',encodeURIComponent(_0x4721c1)):_0x5d92('0x76'));return uploadFile(_0xc18d7d)['then'](function(_0x33f057){return querystring[_0x5d92('0xb')](_0x33f057);});};exports['sestekNDA']=function(_0x607465,_0x321e96){return sestek[_0x5d92('0x77')](_0x607465,_0x321e96)[_0x5d92('0x2b')](function(_0x5bfc36){logger['info'](JSON[_0x5d92('0x3d')](_0x5bfc36));var _0x1d591b={'speech':_0x5bfc36['text'],'action':_0x5bfc36[_0x5d92('0x78')]?_0x5bfc36[_0x5d92('0x78')]['CustomAction']:undefined,'actiondata':_0x5bfc36[_0x5d92('0x78')]?_0x5bfc36[_0x5d92('0x78')][_0x5d92('0x79')]:undefined};if(_0x5bfc36[_0x5d92('0x78')]&&_0x5bfc36['channelData'][_0x5d92('0x7a')]){return base64Decode(_0x5bfc36[_0x5d92('0x78')][_0x5d92('0x7a')]['Data'],path[_0x5d92('0x36')](__dirname,_0x5d92('0x37'),rs[_0x5d92('0x28')](0x4)+_0x5d92('0x7b')))['then'](function(_0x2bbdb8){_0x1d591b[_0x5d92('0x7c')]=_0x2bbdb8;return _0x1d591b;});}return _0x1d591b;});};exports[_0x5d92('0x7d')]=function(){return __dirname;}; \ No newline at end of file +var _0x8f85=['WHAT_EVER','get','error','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','end','protocol','host','data','transcode','wav','start','resolve','tmp','generate','writeFileSync','base64','then','unlink','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','text:synthesize','POST','from','audioContent','.wav','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','.mp3','goggleTTS\x20path','googleASR','uri','results','map','transcript','alternatives','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','replace','SessionsClient','length','action','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','chmodSync','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','bluebird','dialogflow','https','md5','querystring','sox','google-tts-api','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https:','path'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x8f85,0x78));var _0x58f8=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x8f85[_0x4a747d];return _0x3a5b5c;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x58f8('0x0'));var dialogflow=require(_0x58f8('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x58f8('0x2'));var md5=require(_0x58f8('0x3'));var path=require('path');var querystring=require(_0x58f8('0x4'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x58f8('0x5'));var tts=require(_0x58f8('0x6'));var urlParse=require('url')[_0x58f8('0x7')];var util=require('util');var aws=require(_0x58f8('0x8'));var google=require(_0x58f8('0x9'));var sestek=require(_0x58f8('0xa'));var tilde=require(_0x58f8('0xb'));var logger=require(_0x58f8('0xc'))(_0x58f8('0xd'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x5dcaaa,_0x445a5b){return new BPromise(function(_0x154873,_0x2b4c40){var _0x1adfe2=urlParse(_0x5dcaaa);var _0x419bde=_0x1adfe2['protocol']===_0x58f8('0xe')?https:http;var _0xc76b0a={'host':_0x1adfe2['host'],'path':_0x1adfe2[_0x58f8('0xf')],'headers':{'user-agent':_0x58f8('0x10')}};_0x419bde[_0x58f8('0x11')](_0xc76b0a,function(_0x1c6328){if(_0x1c6328['statusCode']!==0xc8){logger[_0x58f8('0x12')]('request\x20to\x20'+_0x5dcaaa+_0x58f8('0x13')+_0x1c6328[_0x58f8('0x14')]+'\x20('+_0x1c6328[_0x58f8('0x15')]+')');_0x2b4c40(new Error(_0x58f8('0x16')+_0x5dcaaa+'\x20failed,\x20status\x20code\x20=\x20'+_0x1c6328[_0x58f8('0x14')]+'\x20('+_0x1c6328[_0x58f8('0x15')]+')'));return;}var _0x19b497=fs[_0x58f8('0x17')](_0x445a5b);_0x19b497['on'](_0x58f8('0x18'),function(){logger[_0x58f8('0x19')](_0x58f8('0x1a'));_0x19b497[_0x58f8('0x1b')](_0x154873);});_0x19b497['on']('error',function(_0x1fc823){fs['unlink'](_0x445a5b);logger[_0x58f8('0x12')](_0x58f8('0x1c'),_0x1fc823);_0x2b4c40(_0x1fc823);});_0x1c6328['pipe'](_0x19b497);})['on']('error',function(_0x46f46c){logger[_0x58f8('0x12')](_0x46f46c);_0x2b4c40(_0x46f46c);})[_0x58f8('0x1d')]();});}function uploadFile(_0x339757){return new BPromise(function(_0x3f1a6d,_0x18bccd){var _0x4d1467=urlParse(_0x339757);var _0x3917b9=_0x4d1467[_0x58f8('0x1e')]==='https:'?https:http;var _0x441556={'host':_0x4d1467[_0x58f8('0x1f')],'path':_0x4d1467[_0x58f8('0xf')],'headers':{'user-agent':_0x58f8('0x10')}};_0x3917b9[_0x58f8('0x11')](_0x441556,function(_0x541c59){if(_0x541c59['statusCode']!==0xc8){_0x18bccd(new Error('request\x20to\x20'+_0x339757+_0x58f8('0x13')+_0x541c59[_0x58f8('0x14')]+'\x20('+_0x541c59[_0x58f8('0x15')]+')'));return;}var _0x581544='';_0x541c59['on'](_0x58f8('0x20'),function(_0x45a0df){_0x581544+=_0x45a0df;});_0x541c59['on']('end',function(){_0x3f1a6d(_0x581544);});})['on'](_0x58f8('0x12'),function(_0x55d3b9){_0x18bccd(_0x55d3b9);})[_0x58f8('0x1d')]();});}function convertFile(_0x2396e5,_0x5071c7){return new BPromise(function(_0x14143f,_0x405071){var _0x2dda2=sox[_0x58f8('0x21')](_0x2396e5,_0x5071c7,{'sampleRate':0x1f40,'format':_0x58f8('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2dda2['on'](_0x58f8('0x12'),function(_0x5c9e01){logger[_0x58f8('0x12')]('error\x20convert',_0x5c9e01);_0x405071(_0x5c9e01);});_0x2dda2['on'](_0x58f8('0x1d'),function(){logger['info']('finish\x20to\x20convert');_0x14143f();});_0x2dda2[_0x58f8('0x23')]();});}function base64Decode(_0x5784b2,_0x2a0235){var _0x47a4f9=path[_0x58f8('0x24')](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+'.wav');fs[_0x58f8('0x27')](_0x47a4f9,_0x5784b2,_0x58f8('0x28'));return convertFile(_0x47a4f9,_0x2a0235)[_0x58f8('0x29')](function(){try{fs[_0x58f8('0x2a')](_0x47a4f9);fs['chmodSync'](_0x2a0235,_0x58f8('0x2b'));}catch(_0x376f35){logger[_0x58f8('0x12')](_0x376f35);}return _0x2a0235[_0x58f8('0x2c')]('.')[0x0];});}function base64Encode(_0x1cb00c){var _0x528ed9=fs[_0x58f8('0x2d')](_0x1cb00c);return new Buffer(_0x528ed9)[_0x58f8('0x2e')](_0x58f8('0x28'));}exports[_0x58f8('0x2f')]=function(_0x2d0ed2,_0x44abdd,_0x4c7aaf,_0xec533,_0x187309,_0x3fa3d6){var _0x3d6959,_0x1b850e;var _0x4c19ec=_0x58f8('0x30');var _0x47fd65=_0x58f8('0x31')+_0x2d0ed2;var _0x1975f1={};if(_0x44abdd==='ssml'){_0x1975f1[_0x58f8('0x32')]={'ssml':_0x4c7aaf};}else{_0x1975f1['input']={'text':_0x4c7aaf};};_0x1975f1[_0x58f8('0x33')]={'languageCode':_0xec533,'ssmlGender':_0x187309};_0x1975f1[_0x58f8('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2a5811={'url':_0x4c19ec+_0x58f8('0x35')+_0x47fd65,'method':_0x58f8('0x36'),'json':!![],'body':_0x1975f1};return rp(_0x2a5811)[_0x58f8('0x29')](function(_0x557e61){return new BPromise(function(_0x40b6c0,_0x195045){_0x3d6959=path[_0x58f8('0x24')](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+'.mp3');var _0x3bff7d=Buffer[_0x58f8('0x37')](_0x557e61[_0x58f8('0x38')],_0x58f8('0x28'));return fs['writeFile'](_0x3d6959,_0x3bff7d,function(_0x156678){_0x195045(_0x156678);},function(_0x4a503c){fs['chmodSync'](_0x3d6959,_0x58f8('0x2b'));_0x40b6c0(_0x4a503c);});});})[_0x58f8('0x29')](function(_0x57f63c){_0x1b850e=path[_0x58f8('0x24')](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+_0x58f8('0x39'));return convertFile(_0x3d6959,_0x1b850e);})[_0x58f8('0x29')](function(){try{fs[_0x58f8('0x2a')](_0x3d6959);fs['chmodSync'](_0x1b850e,_0x58f8('0x2b'));}catch(_0x375c42){logger['error'](_0x375c42);}logger[_0x58f8('0x19')](_0x58f8('0x3a'),_0x1b850e[_0x58f8('0x2c')]('.')[0x0]);return _0x1b850e[_0x58f8('0x2c')]('.')[0x0];});};exports[_0x58f8('0x3b')]=function(_0x2e6e58,_0x4fe758){var _0xbab01c='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x8d6703,_0x175c12;var _0x39bc59;var _0x19a75={'encoding':_0x58f8('0x3c'),'method':'POST','timeout':0x2710,'url':_0xbab01c,'headers':{'Content-Type':_0x58f8('0x3d')},'body':'f.req='+encodeURIComponent(JSON[_0x58f8('0x3e')]([[[_0x58f8('0x3f'),JSON['stringify']([_0x2e6e58,_0x4fe758||'en',![],_0x58f8('0x40')]),null,_0x58f8('0x41')]]]))};return rp(_0x19a75)[_0x58f8('0x29')](function(_0x52de2e){try{_0x39bc59=eval(_0x52de2e[_0x58f8('0x42')](0x5))[0x0][0x2];}catch(_0x72735a){throw new Error(_0x58f8('0x43')+_0x52de2e[_0x58f8('0x20')]);}if(!_0x39bc59){if(_0x2e6e58['length']>0xc8){throw new Error(_0x58f8('0x44'));}else{throw new Error('lang\x20\x22'+_0x4fe758+'\x22\x20might\x20not\x20exist');}}try{_0x39bc59=eval(_0x39bc59)[0x0];}catch(_0x6c81c3){throw new Error(_0x58f8('0x43')+res[_0x58f8('0x20')]);}const _0x448429=_0x39bc59;_0x8d6703=path[_0x58f8('0x24')](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+_0x58f8('0x45'));fs[_0x58f8('0x27')](_0x8d6703,_0x39bc59,{'encoding':_0x58f8('0x28')});_0x175c12=path['resolve'](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+_0x58f8('0x39'));return convertFile(_0x8d6703,_0x175c12);})['then'](function(){try{fs[_0x58f8('0x2a')](_0x8d6703);fs['chmodSync'](_0x175c12,_0x58f8('0x2b'));}catch(_0xff2b85){logger[_0x58f8('0x12')](_0xff2b85);}logger['info'](_0x58f8('0x46'),_0x175c12[_0x58f8('0x2c')]('.')[0x0]);return _0x175c12[_0x58f8('0x2c')]('.')[0x0];});};exports[_0x58f8('0x47')]=function(_0x54a1f4,_0x49847a,_0xde96c3){return google['asr'](_0x54a1f4,_0x49847a,_0xde96c3)[_0x58f8('0x29')](function(_0x2dfb80){logger[_0x58f8('0x19')](_0x2dfb80[_0x58f8('0x48')]);return rp(_0x2dfb80);})['then'](function(_0x2e028b){var _0x553742='';var _0x2bf901=0x0;try{fs['unlink'](_0x54a1f4);}catch(_0x1e9d52){logger[_0x58f8('0x12')](_0x1e9d52);}if(_0x2e028b&&_0x2e028b[_0x58f8('0x49')]){_0x553742=_0x2e028b[_0x58f8('0x49')][_0x58f8('0x4a')](function(_0x3e248b){return _0x3e248b&&_0x3e248b['alternatives'][0x0]&&_0x3e248b['alternatives'][0x0]['transcript']?_0x3e248b['alternatives'][0x0][_0x58f8('0x4b')]:'';})['join']('\x0a');_0x2bf901=_0x2e028b['results'][_0x58f8('0x4a')](function(_0x522bc6){return _0x522bc6&&_0x522bc6['alternatives'][0x0]&&_0x522bc6[_0x58f8('0x4c')][0x0][_0x58f8('0x4d')]?_0x522bc6['alternatives'][0x0][_0x58f8('0x4d')]:0x0;})[_0x58f8('0x4e')]('\x0a');}logger[_0x58f8('0x19')](_0x58f8('0x4f'),_0x553742);logger[_0x58f8('0x19')](_0x58f8('0x50'),_0x2bf901);return{'transcript':_0x553742,'confidence':_0x2bf901};})[_0x58f8('0x51')](function(_0x44b98f){logger[_0x58f8('0x12')](_0x58f8('0x52'),_0x44b98f[_0x58f8('0x14')],_0x44b98f[_0x58f8('0x53')],_0x44b98f[_0x58f8('0x54')]);});};exports['googleDialogflow']=function(_0x7d19c7,_0x56ece1,_0x3cb243,_0x19f838){var _0x23ce04=apiai(_0x56ece1,{'language':_0x19f838||'en'});return _0x23ce04[_0x58f8('0x55')](_0x3cb243,{'sessionId':md5(_0x7d19c7)})[_0x58f8('0x29')](function(_0x52f040){logger[_0x58f8('0x19')](JSON['stringify'](_0x52f040));return{'source':_0x52f040[_0x58f8('0x56')][_0x58f8('0x57')],'resolvedQuery':_0x52f040[_0x58f8('0x56')][_0x58f8('0x58')],'action':_0x52f040[_0x58f8('0x56')]['action'],'actionIncomplete':_0x52f040[_0x58f8('0x56')][_0x58f8('0x59')],'speech':_0x52f040['result'][_0x58f8('0x5a')][_0x58f8('0x5b')],'score':_0x52f040[_0x58f8('0x56')][_0x58f8('0x5c')],'statusCode':_0x52f040[_0x58f8('0x5d')][_0x58f8('0x5e')],'endConversation':_0x52f040[_0x58f8('0x56')][_0x58f8('0x5f')]['endConversation']||![],'isFallbackIntent':_0x52f040['result']['metadata'][_0x58f8('0x60')]};});};exports['googleDialogflowV2']=function(_0x4979f6,_0x298479,_0x6c320b,_0x12d40d,_0x3451dc,_0x21b663){var _0x21cee0=_0x12d40d[_0x58f8('0x61')](/\\n/g,'\x0a');var _0x5d2982={'credentials':{'private_key':_0x21cee0,'client_email':_0x6c320b}};var _0x4a89c7=new dialogflow[(_0x58f8('0x62'))](_0x5d2982);var _0x4c8705=_0x4a89c7['sessionPath'](_0x298479,md5(_0x4979f6));var _0x49877a={'session':_0x4c8705,'queryInput':{'text':{'text':_0x3451dc,'languageCode':_0x21b663}}};return _0x4a89c7['detectIntent'](_0x49877a)['then'](function(_0xa45814){if(_0xa45814&&_0xa45814[_0x58f8('0x63')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x58f8('0x3e')](_0xa45814));var _0x503e10=_0xa45814[0x0];if(_0x503e10){var _0x4b78b4={'action':_0x503e10['queryResult'][_0x58f8('0x64')],'allRequiredParamsPresent':_0x503e10[_0x58f8('0x65')]['allRequiredParamsPresent'],'endConversation':_0x503e10[_0x58f8('0x65')][_0x58f8('0x66')]&&_0x503e10[_0x58f8('0x65')]['diagnosticInfo'][_0x58f8('0x67')]?_0x503e10['queryResult'][_0x58f8('0x66')][_0x58f8('0x67')][_0x58f8('0x68')][_0x58f8('0x69')]:![],'fulfillmentText':_0x503e10['queryResult'][_0x58f8('0x6a')],'intentName':_0x503e10[_0x58f8('0x65')][_0x58f8('0x6b')][_0x58f8('0x53')],'intentDisplayName':_0x503e10[_0x58f8('0x65')][_0x58f8('0x6b')][_0x58f8('0x6c')],'isFallbackIntent':_0x503e10['queryResult'][_0x58f8('0x6b')][_0x58f8('0x6d')],'languageCode':_0x503e10[_0x58f8('0x65')][_0x58f8('0x6e')],'queryText':_0x503e10[_0x58f8('0x65')][_0x58f8('0x6f')],'responseId':_0x503e10[_0x58f8('0x70')],'score':_0x503e10['queryResult'][_0x58f8('0x71')],'speech':_0x503e10[_0x58f8('0x65')][_0x58f8('0x6a')],'providerResponse':JSON[_0x58f8('0x3e')](_0xa45814)};return _0x4b78b4;}}});};exports[_0x58f8('0x72')]=function(_0x58734e,_0x2d52ec,_0x24ba5a,_0x1ab9a2){return tilde['asr'](_0x58734e,_0x2d52ec,_0x24ba5a,_0x1ab9a2)[_0x58f8('0x29')](function(_0x53d0e2){try{fs[_0x58f8('0x2a')](_0x58734e);}catch(_0x295eed){logger[_0x58f8('0x12')](_0x295eed);}logger[_0x58f8('0x19')]('Tilde\x20ASR\x20transcription',_0x53d0e2['transcript']);logger[_0x58f8('0x19')](_0x58f8('0x73'),_0x53d0e2[_0x58f8('0x4d')]);return _0x53d0e2;});};exports[_0x58f8('0x74')]=function(_0x4db9e5,_0x581057,_0x3f6455,_0x4ca535,_0x312773,_0x44855d){var _0x3b9697=path['resolve'](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+_0x58f8('0x45'));var _0x4c1efc;return aws[_0x58f8('0x75')](_0x4db9e5,_0x581057,_0x3f6455,_0x4ca535,_0x312773,_0x44855d,_0x3b9697)[_0x58f8('0x29')](function(){_0x4c1efc=path['resolve'](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+'.wav');return convertFile(_0x3b9697,_0x4c1efc);})['then'](function(){try{fs['unlink'](_0x3b9697);fs[_0x58f8('0x76')](_0x4c1efc,'777');}catch(_0xa3d9c5){logger['error'](_0xa3d9c5);}return _0x4c1efc[_0x58f8('0x2c')]('.')[0x0];});};exports[_0x58f8('0x77')]=function(_0x2e1227,_0x22e112,_0x3cf03d,_0x2ebe99,_0x25b89e,_0x17f3da){return aws[_0x58f8('0x78')](_0x2e1227,_0x22e112,_0x3cf03d,_0x2ebe99,_0x25b89e,_0x17f3da)[_0x58f8('0x29')](function(_0xf4077b){logger['info'](JSON[_0x58f8('0x3e')](_0xf4077b));return _0xf4077b;});};exports[_0x58f8('0x79')]=function(_0x3acc3a,_0x5586b5,_0x171013,_0x4b416d){var _0x21b70a=util[_0x58f8('0x7a')](_0x58f8('0x7b'),ISPEECH_API,_0x3acc3a,encodeURIComponent(_0x5586b5),_0x171013,_0x4b416d);var _0x397d30=path['resolve'](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+'.mp3');var _0x28ed14;return downloadFile(_0x21b70a,_0x397d30)['then'](function(){_0x28ed14=path['resolve'](__dirname,_0x58f8('0x25'),rs[_0x58f8('0x26')](0x4)+_0x58f8('0x39'));return convertFile(_0x397d30,_0x28ed14);})[_0x58f8('0x29')](function(){try{fs['unlink'](_0x397d30);fs[_0x58f8('0x76')](_0x28ed14,_0x58f8('0x2b'));}catch(_0x28f8d7){logger['error'](_0x28f8d7);}return _0x28ed14['split']('.')[0x0];});};exports[_0x58f8('0x7c')]=function(_0x29847c,_0x1604f2,_0x591211,_0x32e8d0){var _0x590a43=util[_0x58f8('0x7a')](_0x58f8('0x7d'),ISPEECH_API,_0x1604f2,_0x591211,base64Encode(_0x29847c),_0x32e8d0?util[_0x58f8('0x7a')](_0x58f8('0x7e'),encodeURIComponent(_0x32e8d0)):'freeform=3');return uploadFile(_0x590a43)['then'](function(_0x53065c){return querystring['parse'](_0x53065c);});};exports[_0x58f8('0x7f')]=function(_0x5b1207,_0x28438a){return sestek[_0x58f8('0x80')](_0x5b1207,_0x28438a)[_0x58f8('0x29')](function(_0x4bc7f0){logger[_0x58f8('0x19')](JSON[_0x58f8('0x3e')](_0x4bc7f0));var _0x31c9ba={'speech':_0x4bc7f0[_0x58f8('0x81')],'action':_0x4bc7f0['channelData']?_0x4bc7f0[_0x58f8('0x82')][_0x58f8('0x83')]:undefined,'actiondata':_0x4bc7f0[_0x58f8('0x82')]?_0x4bc7f0[_0x58f8('0x82')][_0x58f8('0x84')]:undefined};if(_0x4bc7f0[_0x58f8('0x82')]&&_0x4bc7f0[_0x58f8('0x82')][_0x58f8('0x85')]){return base64Decode(_0x4bc7f0['channelData'][_0x58f8('0x85')][_0x58f8('0x86')],path['resolve'](__dirname,'tmp',rs[_0x58f8('0x26')](0x4)+_0x58f8('0x39')))[_0x58f8('0x29')](function(_0x2c8d25){_0x31c9ba['audiofile']=_0x2c8d25;return _0x31c9ba;});}return _0x31c9ba;});};exports[_0x58f8('0x87')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 8f34e03..98747f3 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 nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file +var _0x38b5=['./nda','exports'];(function(_0x13323e,_0x41135e){var _0x1a26b3=function(_0x41f6d2){while(--_0x41f6d2){_0x13323e['push'](_0x13323e['shift']());}};_0x1a26b3(++_0x41135e);}(_0x38b5,0xc2));var _0x538b=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0x38b5[_0x24875d];return _0x181471;};var nda=require(_0x538b('0x0'));module[_0x538b('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 9546233..db64be1 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 _0xfe57=['url','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','calleridname','text','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','body','info','stringify','request-promise'];(function(_0x5eb726,_0x3d28db){var _0x58f872=function(_0x53850d){while(--_0x53850d){_0x5eb726['push'](_0x5eb726['shift']());}};_0x58f872(++_0x3d28db);}(_0xfe57,0x195));var _0x7fe5=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xfe57[_0x377a6e];return _0x37f751;};'use strict';var rp=require(_0x7fe5('0x0'));var url=require(_0x7fe5('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x7fe5('0x2')]=function(_0x4744a9,_0xc27f79){var _0x421809={'method':_0x7fe5('0x3'),'uri':url[_0x7fe5('0x4')](_0xc27f79[_0x7fe5('0x5')],_0x7fe5('0x6')),'form':{'grant_type':_0x7fe5('0x7'),'username':_0xc27f79[_0x7fe5('0x8')],'password':_0xc27f79[_0x7fe5('0x7')]},'json':!![]};return rp(_0x421809)[_0x7fe5('0x9')](function(_0x36ff81){var _0x4ab081={'method':_0x7fe5('0x3'),'uri':url['resolve'](_0xc27f79[_0x7fe5('0xa')],_0x7fe5('0xb')),'body':{'type':_0xc27f79['ndaactivity_type']||'message','channelId':_0x7fe5('0xc'),'conversation':{'id':_0x4744a9[_0x7fe5('0xd')]},'from':{'id':_0x4744a9['callerid'],'name':_0x4744a9[_0x7fe5('0xe')]},'recipient':{'id':_0x4744a9['dnid'],'name':_0x4744a9['extension']},'text':_0xc27f79[_0x7fe5('0xf')],'channelData':{}},'headers':{'Authorization':_0x7fe5('0x10')+_0x36ff81[_0x7fe5('0x11')]},'json':!![]};if(_0xc27f79[_0x7fe5('0x12')]){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x14')]=_0xc27f79['project'];}if(_0xc27f79[_0x7fe5('0x15')]=='1'){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xc27f79[_0x7fe5('0x17')]){_0x4ab081['body'][_0x7fe5('0x13')][_0x7fe5('0x18')]=_0xc27f79[_0x7fe5('0x17')];if(_0xc27f79[_0x7fe5('0x19')]){_0x4ab081[_0x7fe5('0x1a')][_0x7fe5('0x13')]['CustomActionData']=_0xc27f79[_0x7fe5('0x19')];}}logger[_0x7fe5('0x1b')](JSON[_0x7fe5('0x1c')](_0x4ab081));return rp(_0x4ab081);});}; \ No newline at end of file +var _0xbf5c=['custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','access_token','channelData','project','ndagenerate_audio','body','custom_action'];(function(_0x32f50c,_0x5bc16a){var _0x4c4772=function(_0x45af78){while(--_0x45af78){_0x32f50c['push'](_0x32f50c['shift']());}};_0x4c4772(++_0x5bc16a);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x4eab9a,_0x442123){_0x4eab9a=_0x4eab9a-0x0;var _0x2861cd=_0xbf5c[_0x4eab9a];return _0x2861cd;};'use strict';var rp=require(_0xcbf5('0x0'));var url=require(_0xcbf5('0x1'));var logger=require(_0xcbf5('0x2'))('agi');module[_0xcbf5('0x3')]=function(_0x3b2043,_0x3850e7){var _0x536351={'method':_0xcbf5('0x4'),'uri':url[_0xcbf5('0x5')](_0x3850e7['ndauth_url'],_0xcbf5('0x6')),'form':{'grant_type':_0xcbf5('0x7'),'username':_0x3850e7[_0xcbf5('0x8')],'password':_0x3850e7['password']},'json':!![]};return rp(_0x536351)[_0xcbf5('0x9')](function(_0x31b6d1){var _0x54d2d4={'method':'POST','uri':url[_0xcbf5('0x5')](_0x3850e7[_0xcbf5('0xa')],_0xcbf5('0xb')),'body':{'type':_0x3850e7['ndaactivity_type']||_0xcbf5('0xc'),'channelId':_0xcbf5('0xd'),'conversation':{'id':_0x3b2043[_0xcbf5('0xe')]},'from':{'id':_0x3b2043[_0xcbf5('0xf')],'name':_0x3b2043[_0xcbf5('0x10')]},'recipient':{'id':_0x3b2043[_0xcbf5('0x11')],'name':_0x3b2043['extension']},'text':_0x3850e7[_0xcbf5('0x12')],'channelData':{}},'headers':{'Authorization':_0xcbf5('0x13')+_0x31b6d1[_0xcbf5('0x14')]},'json':!![]};if(_0x3850e7['project']){_0x54d2d4['body'][_0xcbf5('0x15')]['ProjectName']=_0x3850e7[_0xcbf5('0x16')];}if(_0x3850e7[_0xcbf5('0x17')]=='1'){_0x54d2d4[_0xcbf5('0x18')][_0xcbf5('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3850e7[_0xcbf5('0x19')]){_0x54d2d4['body'][_0xcbf5('0x15')]['CustomAction']=_0x3850e7['custom_action'];if(_0x3850e7[_0xcbf5('0x1a')]){_0x54d2d4[_0xcbf5('0x18')][_0xcbf5('0x15')][_0xcbf5('0x1b')]=_0x3850e7[_0xcbf5('0x1a')];}}logger[_0xcbf5('0x1c')](JSON[_0xcbf5('0x1d')](_0x54d2d4));return rp(_0x54d2d4);});}; \ 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 34cc8a5..f37d3aa 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 _0xa0b2=['exports'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xa0b2,0x1ac));var _0x2a0b=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xa0b2[_0x5e6ea3];return _0x4048b5;};'use strict';var asr=require('./lib/api');module[_0x2a0b('0x0')]=function(_0x397350,_0x521c52,_0xd5aeb6,_0x2b13f0){return asr(_0x397350,_0x521c52,_0xd5aeb6,_0x2b13f0);}; \ No newline at end of file +var _0xcdd2=['./lib/api','exports'];(function(_0x3becf9,_0x5003e1){var _0x3bab19=function(_0x21c3c7){while(--_0x21c3c7){_0x3becf9['push'](_0x3becf9['shift']());}};_0x3bab19(++_0x5003e1);}(_0xcdd2,0xa6));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require(_0x2cdd('0x0'));module[_0x2cdd('0x1')]=function(_0x19a011,_0x6f520f,_0x176b0f,_0x1a8f64){return asr(_0x19a011,_0x6f520f,_0x176b0f,_0x1a8f64);}; \ 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 94fc6d4..cfb056c 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 _0x995f=['../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash','moment','crypto'];(function(_0x436079,_0xb058b1){var _0x54477a=function(_0x3e8d68){while(--_0x3e8d68){_0x436079['push'](_0x436079['shift']());}};_0x54477a(++_0xb058b1);}(_0x995f,0xca));var _0xf995=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0x995f[_0xa3400];return _0x33dba2;};'use strict';var BPromise=require('bluebird');var _=require(_0xf995('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf995('0x1'));var crypto=require(_0xf995('0x2'));var logger=require(_0xf995('0x3'))(_0xf995('0x4'));module['exports']=function(_0x76800d,_0x2943d1,_0x5e8d1e,_0x2dcbfc){return new BPromise(function(_0x4c522c,_0x14b987){logger[_0xf995('0x5')](_0xf995('0x6'),_0x2dcbfc||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x5d0285=new WebSocket(_0x2dcbfc||_0xf995('0x7'),{'perMessageDeflate':![]});var _0x49c021='';var _0x4fe6da='0';var _0x576fd0='1';var _0x86332e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x43eeaf(_0x482544){var _0x3e3442=crypto[_0xf995('0x8')](_0xf995('0x9'));_0x3e3442[_0xf995('0xa')](_0x482544);return _0x3e3442[_0xf995('0xb')](_0xf995('0xc'));}function _0x3099f2(){try{logger[_0xf995('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x2b053d=moment()['unix']();var _0x4c002e=_0x43eeaf(_0x2b053d+_0x2943d1+_0x5e8d1e);_0x5d0285[_0xf995('0xd')](JSON[_0xf995('0xe')]({'appID':_0x2943d1,'timestamp':_0x2b053d,'appKey':_0x4c002e}));var _0x3be320=fs[_0xf995('0xf')](_0x76800d);_0x3be320['on'](_0xf995('0x10'),function(_0x280e4d){_0x5d0285['send'](_0x280e4d);});_0x3be320['on'](_0xf995('0x11'),function(){_0x5d0285['send'](_0xf995('0x12'));});}catch(_0x1b30a0){logger['error'](_0xf995('0x13'),JSON[_0xf995('0xe')](_0x1b30a0));_0x5d0285['terminate']();}}function _0x3a024e(_0x151d94){try{if(_0x151d94){var _0x2532ef=JSON[_0xf995('0x14')](_0x151d94);switch(_0x2532ef['status']){case 0x0:if(_0x2532ef['result']){if(_0x2532ef[_0xf995('0x15')][_0xf995('0x16')]){logger[_0xf995('0x5')](_0xf995('0x17'),JSON['stringify'](_0x2532ef[_0xf995('0x15')][_0xf995('0x18')]));_0x49c021=_0x2532ef['result'][_0xf995('0x18')][0x0]['transcript'];_0x4fe6da=_0x2532ef[_0xf995('0x15')][_0xf995('0x18')][0x0][_0xf995('0x19')];_0x576fd0='0';_0x86332e=_0xf995('0x1a');_0x5d0285['terminate']();}}break;case 0x1:logger[_0xf995('0x5')](_0xf995('0x1b'));_0x576fd0='1';_0x86332e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xf995('0x5')](_0xf995('0x1c'));_0x576fd0='2';_0x86332e=_0xf995('0x1c');break;case 0x9:logger[_0xf995('0x5')](_0xf995('0x1d'));_0x576fd0='9';_0x86332e=_0xf995('0x1d');break;case 0xa:logger[_0xf995('0x5')](_0xf995('0x1e'));_0x576fd0='10';_0x86332e=_0xf995('0x1e');break;case 0xb:logger[_0xf995('0x5')](_0xf995('0x1f'));_0x576fd0='11';_0x86332e=_0xf995('0x1f');}}}catch(_0x1de2e2){logger[_0xf995('0x20')](_0xf995('0x21'),JSON['stringify'](_0x1de2e2));_0x5d0285[_0xf995('0x22')]();}}function _0x5632e4(){logger['info'](_0xf995('0x23'));_0x4c522c({'transcript':_0x49c021,'confidence':_0x4fe6da,'status':_0x576fd0,'status_message':_0x86332e});}function _0x4cbfad(_0x54e6a6){logger[_0xf995('0x20')](_0xf995('0x24'));if(!_[_0xf995('0x25')](_0x54e6a6)){logger[_0xf995('0x20')](_[_0xf995('0x26')](_0x54e6a6)?JSON[_0xf995('0xe')](_0x54e6a6):_0x54e6a6);}}_0x5d0285['on'](_0xf995('0x27'),_0x3099f2);_0x5d0285['on'](_0xf995('0x28'),_0x3a024e);_0x5d0285['on'](_0xf995('0x11'),_0x5632e4);_0x5d0285['on'](_0xf995('0x20'),_0x4cbfad);});}; \ No newline at end of file +var _0xb0dc=['bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','digest','hex','unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message'];(function(_0x2af03e,_0x20582c){var _0x4a8157=function(_0x251c38){while(--_0x251c38){_0x2af03e['push'](_0x2af03e['shift']());}};_0x4a8157(++_0x20582c);}(_0xb0dc,0x186));var _0xcb0d=function(_0x40042c,_0x4e4976){_0x40042c=_0x40042c-0x0;var _0x4c43bd=_0xb0dc[_0x40042c];return _0x4c43bd;};'use strict';var BPromise=require(_0xcb0d('0x0'));var _=require(_0xcb0d('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcb0d('0x2'));var crypto=require(_0xcb0d('0x3'));var logger=require(_0xcb0d('0x4'))(_0xcb0d('0x5'));module[_0xcb0d('0x6')]=function(_0xc79365,_0xab5e76,_0x5b8433,_0x5ecae8){return new BPromise(function(_0x460a3e,_0x1f023d){logger[_0xcb0d('0x7')](_0xcb0d('0x8'),_0x5ecae8||_0xcb0d('0x9'));var _0xfad13a=new WebSocket(_0x5ecae8||_0xcb0d('0x9'),{'perMessageDeflate':![]});var _0x537d6e='';var _0x7262fa='0';var _0x3cde14='1';var _0x4bf2f5='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2e4746(_0x586e78){var _0x4ef062=crypto[_0xcb0d('0xa')]('sha1');_0x4ef062['update'](_0x586e78);return _0x4ef062[_0xcb0d('0xb')](_0xcb0d('0xc'));}function _0x7ee4c3(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x3dceb2=moment()[_0xcb0d('0xd')]();var _0x132674=_0x2e4746(_0x3dceb2+_0xab5e76+_0x5b8433);_0xfad13a[_0xcb0d('0xe')](JSON[_0xcb0d('0xf')]({'appID':_0xab5e76,'timestamp':_0x3dceb2,'appKey':_0x132674}));var _0x354d8a=fs[_0xcb0d('0x10')](_0xc79365);_0x354d8a['on'](_0xcb0d('0x11'),function(_0x2a5bbc){_0xfad13a[_0xcb0d('0xe')](_0x2a5bbc);});_0x354d8a['on'](_0xcb0d('0x12'),function(){_0xfad13a[_0xcb0d('0xe')]('EOS');});}catch(_0x96b592){logger[_0xcb0d('0x13')](_0xcb0d('0x14'),JSON[_0xcb0d('0xf')](_0x96b592));_0xfad13a[_0xcb0d('0x15')]();}}function _0x2fe2c1(_0x252a0f){try{if(_0x252a0f){var _0x429aa6=JSON[_0xcb0d('0x16')](_0x252a0f);switch(_0x429aa6[_0xcb0d('0x17')]){case 0x0:if(_0x429aa6[_0xcb0d('0x18')]){if(_0x429aa6[_0xcb0d('0x18')][_0xcb0d('0x19')]){logger[_0xcb0d('0x7')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x429aa6[_0xcb0d('0x18')][_0xcb0d('0x1a')]));_0x537d6e=_0x429aa6['result'][_0xcb0d('0x1a')][0x0][_0xcb0d('0x1b')];_0x7262fa=_0x429aa6['result'][_0xcb0d('0x1a')][0x0]['likelihood'];_0x3cde14='0';_0x4bf2f5=_0xcb0d('0x1c');_0xfad13a[_0xcb0d('0x15')]();}}break;case 0x1:logger[_0xcb0d('0x7')](_0xcb0d('0x1d'));_0x3cde14='1';_0x4bf2f5=_0xcb0d('0x1d');break;case 0x2:logger[_0xcb0d('0x7')](_0xcb0d('0x1e'));_0x3cde14='2';_0x4bf2f5='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xcb0d('0x7')](_0xcb0d('0x1f'));_0x3cde14='9';_0x4bf2f5='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xcb0d('0x7')](_0xcb0d('0x20'));_0x3cde14='10';_0x4bf2f5=_0xcb0d('0x20');break;case 0xb:logger[_0xcb0d('0x7')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x3cde14='11';_0x4bf2f5='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x1cdefb){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xcb0d('0xf')](_0x1cdefb));_0xfad13a['terminate']();}}function _0x15c1df(){logger[_0xcb0d('0x7')](_0xcb0d('0x21'));_0x460a3e({'transcript':_0x537d6e,'confidence':_0x7262fa,'status':_0x3cde14,'status_message':_0x4bf2f5});}function _0x4faf7d(_0x5adfb5){logger['error'](_0xcb0d('0x22'));if(!_[_0xcb0d('0x23')](_0x5adfb5)){logger[_0xcb0d('0x13')](_[_0xcb0d('0x24')](_0x5adfb5)?JSON[_0xcb0d('0xf')](_0x5adfb5):_0x5adfb5);}}_0xfad13a['on'](_0xcb0d('0x25'),_0x7ee4c3);_0xfad13a['on'](_0xcb0d('0x26'),_0x2fe2c1);_0xfad13a['on'](_0xcb0d('0x12'),_0x15c1df);_0xfad13a['on'](_0xcb0d('0x13'),_0x4faf7d);});}; \ 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 a0c931f..45877e3 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 _0x747c=['exports','./asr'];(function(_0xdebee8,_0x4b0db1){var _0xc21146=function(_0x171d49){while(--_0x171d49){_0xdebee8['push'](_0xdebee8['shift']());}};_0xc21146(++_0x4b0db1);}(_0x747c,0x8d));var _0xc747=function(_0x3f8a59,_0x1cb3cd){_0x3f8a59=_0x3f8a59-0x0;var _0xc46d64=_0x747c[_0x3f8a59];return _0xc46d64;};var asr=require(_0xc747('0x0'));module[_0xc747('0x1')]={'asr':asr}; \ No newline at end of file +var _0xcea4=['exports','./asr'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xcea4,0xab));var _0x4cea=function(_0x3838a4,_0x2ae1e6){_0x3838a4=_0x3838a4-0x0;var _0x3c56b4=_0xcea4[_0x3838a4];return _0x3c56b4;};var asr=require(_0x4cea('0x0'));module[_0x4cea('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 427a4d6..56dbf06 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 _0xe88e=['listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','nextTick','inherits','util','net','events','./error','./channel','call','error','createServer'];(function(_0x322803,_0xa0022){var _0x2452eb=function(_0x53ff0d){while(--_0x53ff0d){_0x322803['push'](_0x322803['shift']());}};_0x2452eb(++_0xa0022);}(_0xe88e,0x98));var _0xee88=function(_0x81e6e2,_0x3565ca){_0x81e6e2=_0x81e6e2-0x0;var _0x56bb71=_0xe88e[_0x81e6e2];return _0x56bb71;};'use strict';var util=require(_0xee88('0x0'));var net=require(_0xee88('0x1'));var EventEmitter=require(_0xee88('0x2'))['EventEmitter'];var AGIError=require(_0xee88('0x3'));var AGIChannel=require(_0xee88('0x4'));var AGIServer=function(_0x234359,_0x548e3e,_0x1df4de){var _0x34486e=this,_0x234359=_0x234359||0x11dd,_0x548e3e=_0x548e3e||'127.0.0.1',_0x18c0de=null,_0x4232a3=0x0;EventEmitter[_0xee88('0x5')](_0x34486e);function _0x318957(){if(!_0x234359){_0x34486e['emit'](_0xee88('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x18c0de=net[_0xee88('0x7')]();_0x18c0de['listen'](_0x234359,_0x548e3e);_0x18c0de['on'](_0xee88('0x8'),function(){_0x34486e[_0xee88('0x9')](_0xee88('0x8'));});_0x18c0de['on'](_0xee88('0xa'),function(_0x1bcaa1){_0x18c0de[_0xee88('0xb')](function(_0x316c98,_0x1978eb){if(_0x316c98){_0x34486e[_0xee88('0x9')]('error',new AGIError(_0xee88('0xc'),_0x316c98));}else if(_0x1df4de&&_0x1df4de<0x0){_0x34486e[_0xee88('0x9')](_0xee88('0x6'),new AGIError(_0xee88('0xd')));_0x1bcaa1[_0xee88('0xe')]();}else if(_0x1df4de&&_0x1df4de>0x0&&_0x1df4de<_0x1978eb){_0x4232a3+=0x1;_0x34486e[_0xee88('0x9')](_0xee88('0x6'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4232a3));_0x1bcaa1[_0xee88('0xe')]();}else{var _0x239bfa=new AGIChannel(_0x1bcaa1);_0x239bfa['on'](_0xee88('0xf'),function(){_0x34486e[_0xee88('0x9')](_0xee88('0xa'),_0x239bfa);});}});});_0x18c0de['on'](_0xee88('0x6'),function(_0x94ad4a){_0x34486e['emit'](_0xee88('0x6'),new AGIError(_0xee88('0xc'),_0x94ad4a[_0xee88('0x10')]));});_0x18c0de['on']('close',function(){_0x34486e[_0xee88('0x9')](_0xee88('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xee88('0x12')](function(){_0x318957();});};util[_0xee88('0x13')](AGIServer,EventEmitter);module['exports']=function(_0x4e0051,_0x3f769e,_0x17fc0f){return new AGIServer(_0x4e0051,_0x3f769e,_0x17fc0f);}; \ No newline at end of file +var _0x2b99=['getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','nextTick','inherits','exports','net','events','./error','./channel','call','E_AGI_ARGUMENT_PORT','createServer','listening','emit','connection'];(function(_0x3172c8,_0xc728b5){var _0x2894a1=function(_0x24747e){while(--_0x24747e){_0x3172c8['push'](_0x3172c8['shift']());}};_0x2894a1(++_0xc728b5);}(_0x2b99,0x16c));var _0x92b9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2b99[_0x17d9e3];return _0x14192d;};'use strict';var util=require('util');var net=require(_0x92b9('0x0'));var EventEmitter=require(_0x92b9('0x1'))['EventEmitter'];var AGIError=require(_0x92b9('0x2'));var AGIChannel=require(_0x92b9('0x3'));var AGIServer=function(_0x190f39,_0x3ab4fb,_0xf53a50){var _0x270c6e=this,_0x190f39=_0x190f39||0x11dd,_0x3ab4fb=_0x3ab4fb||'127.0.0.1',_0x14f8a9=null,_0x4837bc=0x0;EventEmitter[_0x92b9('0x4')](_0x270c6e);function _0x2b9730(){if(!_0x190f39){_0x270c6e['emit']('error',new AGIError(_0x92b9('0x5')));return![];}_0x14f8a9=net[_0x92b9('0x6')]();_0x14f8a9['listen'](_0x190f39,_0x3ab4fb);_0x14f8a9['on'](_0x92b9('0x7'),function(){_0x270c6e[_0x92b9('0x8')]('listening');});_0x14f8a9['on'](_0x92b9('0x9'),function(_0xeaeb5b){_0x14f8a9[_0x92b9('0xa')](function(_0x1dd4ee,_0x23e029){if(_0x1dd4ee){_0x270c6e[_0x92b9('0x8')](_0x92b9('0xb'),new AGIError(_0x92b9('0xc'),_0x1dd4ee));}else if(_0xf53a50&&_0xf53a50<0x0){_0x270c6e[_0x92b9('0x8')]('error',new AGIError(_0x92b9('0xd')));_0xeaeb5b[_0x92b9('0xe')]();}else if(_0xf53a50&&_0xf53a50>0x0&&_0xf53a50<_0x23e029){_0x4837bc+=0x1;_0x270c6e['emit']('error',new AGIError(_0x92b9('0xf'),_0x4837bc));_0xeaeb5b[_0x92b9('0xe')]();}else{var _0x1d8058=new AGIChannel(_0xeaeb5b);_0x1d8058['on'](_0x92b9('0x10'),function(){_0x270c6e['emit']('connection',_0x1d8058);});}});});_0x14f8a9['on'](_0x92b9('0xb'),function(_0x37caec){_0x270c6e[_0x92b9('0x8')](_0x92b9('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x37caec[_0x92b9('0x11')]));});_0x14f8a9['on'](_0x92b9('0x12'),function(){_0x270c6e['emit'](_0x92b9('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x92b9('0x13')](function(){_0x2b9730();});};util[_0x92b9('0x14')](AGIServer,EventEmitter);module[_0x92b9('0x15')]=function(_0x48ec02,_0x36802b,_0x397217){return new AGIServer(_0x48ec02,_0x36802b,_0x397217);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 97f5423..9e1a80a 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 _0xbdcf=['error','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','timeout','includes','POST','PUT','method','toUpperCase','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','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','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','agicommand','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','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','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','opts','url','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','recordFile','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','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\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','%s_STATUS_CODE','200','statusMessage','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','service','host','port','secure','authentication','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','lodash','shelljs','odbc','randomstring','mustache','../../config/logger','../../config/environment','./scripts','rawHeaders','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','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','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0xbdcf,0x173));var _0xfbdc=function(_0x1cd68e,_0x572278){_0x1cd68e=_0x1cd68e-0x0;var _0x1db69a=_0xbdcf[_0x1cd68e];return _0x1db69a;};'use strict';var fs=require('fs');var path=require(_0xfbdc('0x0'));var util=require('util');var _=require(_0xfbdc('0x1'));var sh=require(_0xfbdc('0x2'));var odbc=require(_0xfbdc('0x3'))();var rs=require(_0xfbdc('0x4'));var moment=require('moment');var Mustache=require(_0xfbdc('0x5'));var rp=require('request-promise');var logger=require(_0xfbdc('0x6'))('agi');var config=require(_0xfbdc('0x7'));var scripts=require(_0xfbdc('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xfbdc('0x9'),'rawBody'];var verticesWithRetry=['menu',_0xfbdc('0xa'),_0xfbdc('0xb')];var AGIVertices=function(_0x40a59f,_0x1eaf1a,_0x130684){this[_0xfbdc('0xc')]=_0x40a59f;this[_0xfbdc('0xd')]=_0x1eaf1a;this['mailRpc']=_0x130684;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xf')]=function(_0x44d535,_0x2a560a){this[_0xfbdc('0xd')][_0xfbdc('0x10')](_0x44d535)[_0xfbdc('0x11')](function(_0x2f7358){_0x2a560a(null,_0x2f7358?_0x2f7358['name']:![]);})[_0xfbdc('0x12')](function(_0x26612c){_0x2a560a(_0x26612c);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x13')]=function(_0x2704cb,_0x875139){this[_0xfbdc('0xd')][_0xfbdc('0x14')](_0x2704cb)['then'](function(_0x54be47){_0x875139(null,_0x54be47?_0x54be47[_0xfbdc('0x15')]:![]);})[_0xfbdc('0x12')](function(_0x34da8d){_0x875139(_0x34da8d);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x16')]=function(_0x18279b,_0x9e356d){this[_0xfbdc('0xd')][_0xfbdc('0x17')](_0x18279b)[_0xfbdc('0x11')](function(_0x399870){_0x9e356d(null,_0x399870?_0x399870[_0xfbdc('0x15')]:![]);})['catch'](function(_0x4ec435){_0x9e356d(_0x4ec435);});};AGIVertices['prototype'][_0xfbdc('0x18')]=function(_0x4f7301,_0x5376e0){this[_0xfbdc('0xd')][_0xfbdc('0x19')](_0x4f7301)['then'](function(_0xc26c0a){_0x5376e0(null,_0xc26c0a?_0xc26c0a[_0xfbdc('0x1a')]:![]);})[_0xfbdc('0x12')](function(_0xa6a096){_0x5376e0(_0xa6a096);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1b')]=function(_0x200d5f,_0x3a259e){this[_0xfbdc('0xd')][_0xfbdc('0x1c')](_0x200d5f)[_0xfbdc('0x11')](function(_0x5a12ad){_0x3a259e(null,_0x5a12ad?_0x5a12ad[_0xfbdc('0x15')]:![]);})[_0xfbdc('0x12')](function(_0x1edaa4){_0x3a259e(_0x1edaa4);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1d')]=function(_0x3bfe91,_0x3c5a4f){this[_0xfbdc('0xd')][_0xfbdc('0x1e')](_0x3bfe91)['then'](function(_0x307ea1){_0x3c5a4f(null,_0x307ea1?_0x307ea1[_0xfbdc('0x15')]:![]);})[_0xfbdc('0x12')](function(_0x2bdeeb){_0x3c5a4f(_0x2bdeeb);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1f')]=function(_0x2df0ea,_0x54c960){var _0x4e39fe=this;this[_0xfbdc('0xd')][_0xfbdc('0x20')](_0x2df0ea)['then'](function(_0x3c30c2){_0x54c960(null,_0x3c30c2?_0x4e39fe[_0xfbdc('0x21')](_0x3c30c2[_0xfbdc('0x22')]):![]);})[_0xfbdc('0x12')](function(_0x1929e1){_0x54c960(_0x1929e1);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x23')]=function(_0x4dca7c,_0xdee931){this[_0xfbdc('0xd')][_0xfbdc('0x24')](_0x4dca7c)[_0xfbdc('0x11')](function(_0x293241){_0xdee931(null,_0x293241?_0x293241:![]);})[_0xfbdc('0x12')](function(_0x27e0d0){_0xdee931(_0x27e0d0);});};AGIVertices[_0xfbdc('0xe')]['sendMailMessage']=function(_0x33105d,_0x200132,_0x3e06fc){this['mailRpc'][_0xfbdc('0x25')](_0x33105d,_0x200132)[_0xfbdc('0x11')](function(){_0x3e06fc(null);})[_0xfbdc('0x12')](function(_0xe9814c){_0x3e06fc(_0xe9814c);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x26')]=function(_0x4eb85c,_0x310f28){this['rpc'][_0xfbdc('0x27')](_0x4eb85c)[_0xfbdc('0x11')](function(_0x5a81e7){if(_0x5a81e7){if(_0x5a81e7['IntervalId']){_0x310f28(null,[_0x5a81e7[_0xfbdc('0x28')]]);}else{_0x310f28(null,_[_0xfbdc('0x29')](_0x5a81e7[_0xfbdc('0x2a')],_0xfbdc('0x28')));}}else{_0x310f28(null,![]);}})[_0xfbdc('0x12')](function(_0x2ad8ec){_0x310f28(_0x2ad8ec);});};AGIVertices['prototype'][_0xfbdc('0x21')]=function(_0x42a7be){return util[_0xfbdc('0x2b')](_0xfbdc('0x2c'),FILES_PATH,_0x42a7be);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x2d')]=function(_0x539571,_0x4ebdfc,_0x3f995b){odbc[_0xfbdc('0x2e')](_0x539571,function(_0x3ad751){if(_0x3ad751){logger['error'](_0xfbdc('0x2f'),_0x3ad751);_0x3f995b(_0x3ad751);}else{logger[_0xfbdc('0x30')](_0xfbdc('0x31'));odbc[_0xfbdc('0x32')](_0x4ebdfc,function(_0x2a3fd1,_0xf66878){if(_0x2a3fd1){logger[_0xfbdc('0x30')](_0xfbdc('0x33'),_0x4ebdfc);_0x3f995b(_0x2a3fd1);}else{logger[_0xfbdc('0x30')](_0xfbdc('0x34'),_0x4ebdfc);odbc[_0xfbdc('0x35')](function(_0x6368c4){if(_0x6368c4){logger['error'](_0xfbdc('0x36'),_0x6368c4);}_0x3f995b(null,_0xf66878);});}});}});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x37')]=function(_0x1b0c14,_0x5d4334){this['rpc'][_0xfbdc('0x38')](_0x1b0c14)[_0xfbdc('0x11')](function(_0x4bd608){_0x5d4334(null,_0x4bd608?_0x4bd608:![]);})['catch'](function(_0x36bf1f){_0x5d4334(_0x36bf1f);});};AGIVertices['prototype'][_0xfbdc('0x39')]=function(_0x1c8d66,_0x7f388e){this[_0xfbdc('0xd')][_0xfbdc('0x39')](_0x1c8d66)['then'](function(_0x58bc71){_0x7f388e(null,_0x58bc71);})[_0xfbdc('0x12')](function(_0x1ecc61){_0x7f388e(_0x1ecc61);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x3a')]=function(_0x43b6ae,_0x2a7ea4,_0x263dad){this[_0xfbdc('0xd')][_0xfbdc('0x3a')]({'uniqueid':this['channel']['uniqueid'],'node':_0x43b6ae['label'],'application':_0x43b6ae['agicommand'],'data':_0x2a7ea4||null,'project_name':this[_0xfbdc('0xc')][_0xfbdc('0x3b')],'callerid':this[_0xfbdc('0xc')][_0xfbdc('0x3c')]})[_0xfbdc('0x11')](function(_0xfcddf7){if(_0x263dad){_0x263dad(null,_0xfcddf7);}})['catch'](function(_0x52bacb){if(_0x263dad){_0x263dad(_0x52bacb);}});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x3d')]=function(_0x3e5941,_0x2f25dd,_0x33f9ce,_0x55e67e){this[_0xfbdc('0xd')][_0xfbdc('0x3d')]({'uniqueid':this['channel'][_0xfbdc('0x3e')],'callerid':this['channel'][_0xfbdc('0x3c')],'calleridname':this[_0xfbdc('0xc')][_0xfbdc('0x3f')],'context':this[_0xfbdc('0xc')][_0xfbdc('0x40')],'extension':this['channel'][_0xfbdc('0x41')],'priority':this[_0xfbdc('0xc')][_0xfbdc('0x42')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xfbdc('0xc')][_0xfbdc('0x43')],'projectName':this['channel'][_0xfbdc('0x3b')],'saveName':_0x2f25dd,'filename':_0x3e5941[_0xfbdc('0x44')]||_0x2f25dd,'savePath':_0x33f9ce})[_0xfbdc('0x11')](function(_0x5e05f6){_0x55e67e(null,_0x5e05f6);})[_0xfbdc('0x12')](function(_0x8c0eab){_0x55e67e(_0x8c0eab);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x45')]=function(_0x2086b3,_0x5b8967,_0x351c81,_0x5613f1,_0x56e9bc){this[_0xfbdc('0xd')][_0xfbdc('0x45')]({'uniqueid':this[_0xfbdc('0xc')][_0xfbdc('0x3e')],'body':_0x2086b3,'direction':_0x5b8967,'providerName':_0x351c81,'providerResponse':_0x5613f1})[_0xfbdc('0x11')](function(_0x408062){if(_0x56e9bc){_0x56e9bc(null,_0x408062);}})['catch'](function(_0x41deb0){if(_0x56e9bc){_0x56e9bc(_0x41deb0);}});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x46')]=function(_0x386dba,_0x35f424){this[_0xfbdc('0xd')]['createCmContact']({'firstName':_[_0xfbdc('0x47')](_0x386dba[_0xfbdc('0x15')])||_[_0xfbdc('0x48')](_0x386dba[_0xfbdc('0x15')])?_0xfbdc('0x49')+Math[_0xfbdc('0x4a')]():_0x386dba['name'],'lastName':_[_0xfbdc('0x47')](_0x386dba[_0xfbdc('0x4b')])||_['isNil'](_0x386dba[_0xfbdc('0x4b')])?null:_0x386dba[_0xfbdc('0x4b')],'phone':_0x386dba[_0xfbdc('0x4c')],'ListId':_0x386dba[_0xfbdc('0x4d')],'scheduledat':_0x386dba[_0xfbdc('0x4e')],'callbackUniqueid':this['channel'][_0xfbdc('0x3e')],'tags':_0xfbdc('0x4f'),'description':_0xfbdc('0x50')+_0x386dba['scheduledAt'][_0xfbdc('0x51')](),'priority':_0x386dba[_0xfbdc('0x52')]})[_0xfbdc('0x11')](function(_0x10a5de){_0x35f424(null,_0x10a5de);})[_0xfbdc('0x12')](function(_0x20a3b7){_0x35f424(_0x20a3b7);});};AGIVertices['prototype']['getPause']=function(_0x5a773a,_0x532bbc){this[_0xfbdc('0xd')][_0xfbdc('0x53')](_0x5a773a)['then'](function(_0x2b14d5){_0x532bbc(null,_0x2b14d5?_0x2b14d5[_0xfbdc('0x15')]:![]);})[_0xfbdc('0x12')](function(_0x178343){_0x532bbc(_0x178343);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x54')]=function(_0x7f1ebc,_0x51c8ff,_0x451db9){var _0x45d197={'role':_0xfbdc('0x55')};_0x45d197[_0x7f1ebc]=this[_0xfbdc('0xc')][_0xfbdc('0x3c')];this['rpc'][_0xfbdc('0x54')](_0x45d197,_0x51c8ff,this[_0xfbdc('0xc')][_0xfbdc('0x3e')])[_0xfbdc('0x11')](function(_0x1013d7){_0x451db9(null,_[_0xfbdc('0x48')](_0x1013d7)?![]:!![]);})[_0xfbdc('0x12')](function(_0x396dac){logger[_0xfbdc('0x56')](_0x396dac);_0x451db9(null,![]);});};AGIVertices['prototype'][_0xfbdc('0x57')]=function(_0x58a3fc,_0x2e2147){var _0xd16be6={'role':_0xfbdc('0x55')};_0xd16be6[_0x58a3fc]=this[_0xfbdc('0xc')][_0xfbdc('0x3c')];this[_0xfbdc('0xd')][_0xfbdc('0x57')](_0xd16be6)[_0xfbdc('0x11')](function(_0x2dc056){_0x2e2147(null,_[_0xfbdc('0x48')](_0x2dc056)?![]:!![]);})['catch'](function(_0x1beaa8){logger[_0xfbdc('0x56')](_0x1beaa8);_0x2e2147(null,![]);});};AGIVertices[_0xfbdc('0xe')]['agentLogout']=function(_0x44223d,_0x34e329){var _0x466b08={'role':_0xfbdc('0x55')};_0x466b08[_0x44223d]=this[_0xfbdc('0xc')][_0xfbdc('0x3c')];this[_0xfbdc('0xd')][_0xfbdc('0x58')](_0x466b08)['then'](function(_0x402dd0){_0x34e329(null,_[_0xfbdc('0x48')](_0x402dd0)?![]:!![]);})[_0xfbdc('0x12')](function(_0x47e4b4){logger[_0xfbdc('0x56')](_0x47e4b4);_0x34e329(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x23df96,_0x19a3d9){var _0x55e298={'role':_0xfbdc('0x55')};_0x55e298[_0x23df96]=this['channel']['callerid'];var _0x2a703e=_0x23df96!=_0xfbdc('0x59')?util['format'](_0xfbdc('0x5a'),'LOCAL',this[_0xfbdc('0xc')][_0xfbdc('0x3c')]):undefined;this[_0xfbdc('0xd')][_0xfbdc('0x5b')](_0x55e298,_0x2a703e)[_0xfbdc('0x11')](function(_0x3fa024){_0x19a3d9(null,_['isNil'](_0x3fa024)?![]:!![]);})[_0xfbdc('0x12')](function(_0x390af4){logger[_0xfbdc('0x56')](_0x390af4);_0x19a3d9(null,![]);});};AGIVertices['prototype'][_0xfbdc('0x5c')]=function(_0x597461,_0x2c7420){sh[_0xfbdc('0x5d')](_['trim'](_0x597461),function(_0xf5d8c6,_0x2dec93){var _0xf9cc42=_0x2dec93[_0xfbdc('0x5e')](/(\r\n|\n|\r)/gm,'');_0x2c7420(null,_0xf9cc42);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x5f')]=function(_0x5bbe92,_0x355c83){scripts[_0xfbdc('0x5f')](_0x5bbe92[_0xfbdc('0x60')],_0x5bbe92[_0xfbdc('0x61')]||_0xfbdc('0x62'),_0x5bbe92[_0xfbdc('0x62')],_0x5bbe92[_0xfbdc('0x63')]||_0xfbdc('0x64'),_0x5bbe92['ssmlGender']||_0xfbdc('0x65'),_0x5bbe92[_0xfbdc('0x66')]||_0xfbdc('0x67'))[_0xfbdc('0x11')](function(_0x25f403){_0x355c83(null,_0x25f403);})[_0xfbdc('0x12')](function(_0x4137cb){_0x355c83(_0x4137cb);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x68')]=function(_0x263be0,_0x1921a4){scripts[_0xfbdc('0x68')](_0x263be0[_0xfbdc('0x62')],_0x263be0[_0xfbdc('0x69')]||'en',0x1)[_0xfbdc('0x11')](function(_0x24a73b){_0x1921a4(null,_0x24a73b);})[_0xfbdc('0x12')](function(_0x444bc4){_0x1921a4(_0x444bc4);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x6a')]=function(_0x580623,_0x55532a){var _0xa718a={'uri':_0x580623['url'],'method':_0x580623['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x580623['timeout'])==='number'&&parseInt(_0x580623[_0xfbdc('0x6b')])>=0x1?parseInt(_0x580623[_0xfbdc('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0xfbdc('0x6c')]([_0xfbdc('0x6d'),_0xfbdc('0x6e')],_0xa718a[_0xfbdc('0x6f')][_0xfbdc('0x70')]())){try{_0xa718a['body']=_0x580623[_0xfbdc('0x71')]?JSON['parse'](_0x580623['rawBody']):{};}catch(_0xceb40a){logger[_0xfbdc('0x56')](_0xfbdc('0x72'),_0xceb40a);}}try{_0xa718a['headers']=_0x580623[_0xfbdc('0x9')]?JSON[_0xfbdc('0x73')](_0x580623[_0xfbdc('0x9')]):{};}catch(_0x29e646){logger['error'](_0xfbdc('0x74'),_0x29e646);}if(_0x580623[_0xfbdc('0x75')]){try{var _0x232c1a=require(_0x580623[_0xfbdc('0x75')])[_0xfbdc('0x76')](this,_0xa718a);_0xa718a[_0xfbdc('0x77')]=Mustache[_0xfbdc('0x78')](_0x580623['url'],_0x232c1a,{},['$$','$$']);if(_0xa718a[_0xfbdc('0x79')]){_0xa718a[_0xfbdc('0x79')]=JSON[_0xfbdc('0x73')](Mustache['render'](JSON[_0xfbdc('0x7a')](_0xa718a[_0xfbdc('0x79')]),_0x232c1a,{},['$$','$$']));}if(_0xa718a[_0xfbdc('0x7b')]){_0xa718a[_0xfbdc('0x7b')]=JSON[_0xfbdc('0x73')](Mustache['render'](JSON[_0xfbdc('0x7a')](_0xa718a[_0xfbdc('0x7b')]),_0x232c1a,{},['$$','$$']));}}catch(_0x4fd63c){logger[_0xfbdc('0x56')](_0xfbdc('0x7c'),_0x4fd63c);}}rp(_0xa718a)[_0xfbdc('0x11')](function(_0x2cfdf6){var _0x514562={'statusCode':_0x2cfdf6[_0xfbdc('0x7d')]||0xc8,'statusMessage':_0x2cfdf6['statusMessage']||'OK','headers':_0x2cfdf6[_0xfbdc('0x79')]||{},'body':_0x2cfdf6['body']||{}};_0x55532a(null,_0x514562);})[_0xfbdc('0x12')](function(_0x21f25e){var _0x385130={'statusCode':_0x21f25e['statusCode']||0x1f4,'statusMessage':_0x21f25e['message']||_0xfbdc('0x7e'),'headers':_0x21f25e[_0xfbdc('0x7f')][_0xfbdc('0x79')]||{},'body':_0x21f25e['options'][_0xfbdc('0x7b')]||{}};_0x55532a(null,_0x385130);});};AGIVertices['prototype'][_0xfbdc('0x80')]=function(_0x1f15d2,_0x49eff1){scripts[_0xfbdc('0x80')](this[_0xfbdc('0xc')]['uniqueid'],_0x1f15d2['key'],_0x1f15d2[_0xfbdc('0x62')],_0x1f15d2['dialogflow_language']||'en')['then'](function(_0x1cf3c3){_0x49eff1(null,_0x1cf3c3);})[_0xfbdc('0x12')](function(_0x1de8d4){_0x49eff1(_0x1de8d4);});};AGIVertices['prototype'][_0xfbdc('0x81')]=function(_0x4dca0f,_0x2f08b1){scripts[_0xfbdc('0x81')](this['channel'][_0xfbdc('0x3e')],_0x4dca0f[_0xfbdc('0x82')],_0x4dca0f['client_email'],_0x4dca0f[_0xfbdc('0x83')],_0x4dca0f[_0xfbdc('0x62')],_0x4dca0f[_0xfbdc('0x84')]||'en')[_0xfbdc('0x11')](function(_0x28cda1){_0x2f08b1(null,_0x28cda1);})[_0xfbdc('0x12')](function(_0x1c6c05){_0x2f08b1(_0x1c6c05);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x85')]=function(_0x2cc45d,_0x29b200){scripts[_0xfbdc('0x85')](this['channel'],_0x2cc45d)[_0xfbdc('0x11')](function(_0x1a2481){_0x29b200(null,_0x1a2481);})[_0xfbdc('0x12')](function(_0x24ae6a){_0x29b200(_0x24ae6a);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x86')]=function(_0x1e7f51,_0x5169e5){scripts[_0xfbdc('0x86')](_0x1e7f51[_0xfbdc('0x87')],_0x1e7f51[_0xfbdc('0x62')],_0x1e7f51['ispeech_tts_language']||_0xfbdc('0x64'),_0x1e7f51[_0xfbdc('0x88')])['then'](function(_0x2eda14){_0x5169e5(null,_0x2eda14);})[_0xfbdc('0x12')](function(_0x2f195d){_0x5169e5(_0x2f195d);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x89')]=function(_0x5f10f8,_0x38bf3e,_0x2d44b5){scripts['ispeechASR'](_0x38bf3e,_0x5f10f8[_0xfbdc('0x87')],_0x5f10f8[_0xfbdc('0x8a')]||_0xfbdc('0x64'),this[_0xfbdc('0x8b')](_0x5f10f8['model'])?_0x5f10f8[_0xfbdc('0x8c')]:undefined)[_0xfbdc('0x11')](function(_0xa0bcfb){_0x2d44b5(null,_0xa0bcfb);})['catch'](function(_0x3ab970){_0x2d44b5(_0x3ab970);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x8d')]=function(_0x494d39,_0x31b072){scripts['awsPolly'](_0x494d39[_0xfbdc('0x8e')],_0x494d39['aws_secret_access_key'],_0x494d39[_0xfbdc('0x8f')],_0x494d39[_0xfbdc('0x90')]||_0xfbdc('0x91'),_0x494d39[_0xfbdc('0x62')],_0x494d39['aws_text_type']||_0xfbdc('0x62'))[_0xfbdc('0x11')](function(_0x5d5639){_0x31b072(null,_0x5d5639);})[_0xfbdc('0x12')](function(_0x430638){_0x31b072(_0x430638);});};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x92')]=function(_0x48d975,_0x2ba12b){scripts[_0xfbdc('0x92')](this[_0xfbdc('0xc')]['uniqueid'],_0x48d975[_0xfbdc('0x8e')],_0x48d975[_0xfbdc('0x93')],_0x48d975[_0xfbdc('0x94')],_0x48d975[_0xfbdc('0x62')],_0x48d975[_0xfbdc('0x95')])[_0xfbdc('0x11')](function(_0x52c5dd){_0x2ba12b(null,_0x52c5dd);})[_0xfbdc('0x12')](function(_0x2543cb){_0x2ba12b(_0x2543cb);});};AGIVertices['prototype']['googleASR']=function(_0x52bf91,_0x5c105b,_0x5bd001){scripts[_0xfbdc('0x96')](_0x5c105b,_0x52bf91[_0xfbdc('0x87')],_0x52bf91[_0xfbdc('0x97')]||_0xfbdc('0x64'))[_0xfbdc('0x11')](function(_0x2cd611){_0x5bd001(null,_0x2cd611);})[_0xfbdc('0x12')](function(_0x5219ff){_0x5bd001(_0x5219ff);});};AGIVertices[_0xfbdc('0xe')]['tildeASR']=function(_0x43d3db,_0x5f17c4,_0x41a3ab){scripts[_0xfbdc('0x98')](_0x5f17c4,_0x43d3db[_0xfbdc('0x99')],_0x43d3db[_0xfbdc('0x9a')],_0x43d3db[_0xfbdc('0x77')])[_0xfbdc('0x11')](function(_0x3237c5){_0x41a3ab(null,_0x3237c5);})[_0xfbdc('0x12')](function(_0x3dc166){_0x41a3ab(_0x3dc166);});};AGIVertices[_0xfbdc('0xe')]['clear']=function(_0xda07a){var _0x50d7a9=_[_0xfbdc('0x6c')](verticesWithRetry,_0xda07a[_0xfbdc('0x9b')])?_0xda07a:_[_0xfbdc('0x9c')](_0xda07a);for(var _0x558854 in _0x50d7a9){if(_0x50d7a9[_0xfbdc('0x9d')](_0x558854)){if(_0x50d7a9[_0x558854]&&_['isString'](_0x50d7a9[_0x558854])){if(_[_0xfbdc('0x6c')](recursiveMapAttributes,_0x558854)){_0x50d7a9[_0x558854]=this[_0xfbdc('0x9e')](_0x50d7a9[_0x558854]);}else{_0x50d7a9[_0x558854]=this[_0xfbdc('0x9f')](_0x50d7a9[_0x558854]);}}}}return _0x50d7a9;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xa0')]=function(_0x2fd0ab){for(var _0x324853 in _0x2fd0ab){if(_0x2fd0ab[_0xfbdc('0x9d')](_0x324853)){if(_[_0xfbdc('0xa1')](_0x2fd0ab[_0x324853])){this['recursiveNodeIndex'](_0x2fd0ab[_0x324853]);}else if(_[_0xfbdc('0xa2')](_0x2fd0ab[_0x324853])){for(var _0x346bb5=0x0;_0x346bb5<_0x2fd0ab[_0x324853][_0xfbdc('0xa3')];_0x346bb5++){this[_0xfbdc('0xa0')](_0x2fd0ab[_0x324853][_0x346bb5]);}}else if(_[_0xfbdc('0xa4')](_0x2fd0ab[_0x324853])){_0x2fd0ab[_0x324853]=this[_0xfbdc('0x9f')](_0x2fd0ab[_0x324853]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x46c6c8,_0x1dbbba){for(var _0x3bbf5d in _0x46c6c8){if(_0x46c6c8[_0xfbdc('0x9d')](_0x3bbf5d)){if(_['isPlainObject'](_0x46c6c8[_0x3bbf5d])){if(!_[_0xfbdc('0x47')](_0x46c6c8[_0x3bbf5d])){this[_0xfbdc('0xa5')](_0x46c6c8[_0x3bbf5d],util['format'](_0xfbdc('0xa6'),_0x1dbbba,_0x3bbf5d));}}else if(_[_0xfbdc('0xa2')](_0x46c6c8[_0x3bbf5d])){for(var _0x28bf35=0x0;_0x28bf35<_0x46c6c8[_0x3bbf5d][_0xfbdc('0xa3')];_0x28bf35++){this['saveRestApiResult'](_0x46c6c8[_0x3bbf5d][_0x28bf35],util[_0xfbdc('0x2b')](_0xfbdc('0xa6'),_0x1dbbba,_0x3bbf5d+'['+_0x28bf35+']'));}}else{if(!_[_0xfbdc('0x48')](_0x46c6c8[_0x3bbf5d])){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util['format'](_0xfbdc('0xa6'),_0x1dbbba,_0x3bbf5d),_0x46c6c8[_0x3bbf5d]);}}}}};AGIVertices['prototype'][_0xfbdc('0x9e')]=function(_0x49e7d1){try{var _0x26bebe=JSON[_0xfbdc('0x73')](_0x49e7d1);this[_0xfbdc('0xa0')](_0x26bebe);return JSON[_0xfbdc('0x7a')](_0x26bebe);}catch(_0xd75725){return this[_0xfbdc('0x9f')](_0x49e7d1);}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x9f')]=function(_0x21357f){var _0x26fc3b=_0x21357f[_0xfbdc('0xa8')]('{');for(var _0x2acc8a=0x1;_0x2acc8a<_0x26fc3b[_0xfbdc('0xa3')];_0x2acc8a+=0x1){var _0x2fd9e0=_0x26fc3b[_0x2acc8a][_0xfbdc('0xa8')]('}');if(_0x2fd9e0[_0xfbdc('0xa3')]>0x1){_0x21357f=_0x21357f[_0xfbdc('0xa9')]('{'+_0x2fd9e0[0x0]+'}',this[_0xfbdc('0xc')][_0xfbdc('0xf')](_0x2fd9e0[0x0])[_0xfbdc('0xaa')]||_0x2fd9e0[0x0]);}}if(_0x26fc3b[_0xfbdc('0xa3')]===0x1){return _0x21357f[_0xfbdc('0x51')]();}return this[_0xfbdc('0x9f')](_0x21357f);};AGIVertices[_0xfbdc('0xe')]['getAndSetVariable']=function(_0x12094c,_0x46cf55){var _0x1ac87e=this[_0xfbdc('0xc')][_0xfbdc('0xf')](_0x12094c);if(_0x1ac87e[_0xfbdc('0xab')]===-0x1){return _0x1ac87e;}logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0xac'),_0x46cf55,_0x1ac87e[_0xfbdc('0xaa')]));return this[_0xfbdc('0xc')][_0xfbdc('0xa7')](_0x46cf55,_0x1ac87e['extra']);};AGIVertices['prototype'][_0xfbdc('0x8b')]=function(_0x4d12e3){return _0x4d12e3&&_0x4d12e3!=='0'&&_0x4d12e3!=='-1'&&_0x4d12e3!=='';};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xad')]=function(_0x2ded71){this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x2ded71,'-');_0x2ded71[_0xfbdc('0xae')]=_0x2ded71[_0xfbdc('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xfbdc('0xe')]['mrcpsynth']=function(_0x13c58b){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x13c58b['label']));if(!this['isConfigured'](_0x13c58b[_0xfbdc('0x62')])){return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}var _0xf14362='\x22'+_0x13c58b[_0xfbdc('0x62')]+'\x22';if(this[_0xfbdc('0x8b')](_0x13c58b[_0xfbdc('0x7f')])){_0xf14362+=','+_0x13c58b[_0xfbdc('0x7f')];}var _0x14ab79=this['channel']['exec'](_0xfbdc('0xb1'),_0xf14362);if(_0x14ab79[_0xfbdc('0xab')]===-0x1){return _0x14ab79;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xb2'),_0xf14362));};AGIVertices['prototype'][_0xfbdc('0xb3')]=function(_0x30f681){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0xb4'),_0x30f681[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x30f681[_0xfbdc('0xb6')])){return this['channel']['noop'](_0xfbdc('0xb7'));}var _0x50ff60=_0x30f681[_0xfbdc('0xb6')];if(this['isConfigured'](_0x30f681[_0xfbdc('0x7f')])){_0x50ff60+=','+_0x30f681[_0xfbdc('0x7f')];}var _0x530eb7=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0xb8'),_0x50ff60);if(_0x530eb7[_0xfbdc('0xab')]===-0x1){return _0x530eb7;}var _0x534ead=this['getAndSetVariable'](_0xfbdc('0xb9'),_0xfbdc('0xba'));if(_0x534ead['result']===-0x1){return _0x534ead;}var _0x16cf5f=this[_0xfbdc('0xbb')](_0xfbdc('0xbc'),_0xfbdc('0xbd'));if(_0x16cf5f['result']===-0x1){return _0x16cf5f;}var _0x12e626=this[_0xfbdc('0xbb')](_0xfbdc('0xbe'),_0xfbdc('0xbf'));if(_0x12e626[_0xfbdc('0xab')]===-0x1){return _0x12e626;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xc0'),_0x50ff60));};AGIVertices[_0xfbdc('0xe')]['agi']=function(_0x5a8f94){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xc1'),_0x5a8f94['label']));return this[_0xfbdc('0xc')][_0xfbdc('0xc2')]([_0x5a8f94[_0xfbdc('0xc3')],_0x5a8f94[_0xfbdc('0xc4')]]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xc5')]=function(_0x351527){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0xc6'),_0x351527['label']));if(this[_0xfbdc('0x8b')](_0x351527[_0xfbdc('0x6b')])){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xc7'),_0x351527[_0xfbdc('0x6b')]));var _0xe17221=this['channel'][_0xfbdc('0xc8')](_0x351527[_0xfbdc('0x6b')]);if(_0xe17221['result']===-0x1){return _0xe17221;}}return this['channel']['answer']();};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x4f')]=function(_0x756114){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xc9'),_0x756114[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x756114[_0xfbdc('0x4d')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x756114,_0xfbdc('0xca'));}_0x756114[_0xfbdc('0x4e')]=moment();if(this[_0xfbdc('0x8b')](_0x756114['delay'])){_0x756114[_0xfbdc('0x4e')]=moment()['add'](_0x756114[_0xfbdc('0xcb')],'minutes');}if(!this[_0xfbdc('0x8b')](_0x756114[_0xfbdc('0x52')])){_0x756114[_0xfbdc('0x52')]=0x2;}this[_0xfbdc('0x46')][_0xfbdc('0x76')](this,_0x756114);return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x756114[_0xfbdc('0x4c')],_0x756114[_0xfbdc('0x4d')],_0x756114[_0xfbdc('0x4e')]));};AGIVertices['prototype']['custom_app']=function(_0x51277f){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x51277f[_0xfbdc('0xb5')]));var _0x1f31dc=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0x51277f['application'],_0x51277f[_0xfbdc('0x7f')]);if(_0x1f31dc[_0xfbdc('0xab')]===-0x1){return _0x1f31dc;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xcc'),_0x51277f[_0xfbdc('0xcd')],_0x51277f[_0xfbdc('0x7f')]));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xce')]=function(_0x57705d){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xcf'),_0x57705d[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x57705d[_0xfbdc('0x62')])){return this['channel'][_0xfbdc('0xaf')]('no\x20text\x20configured');}var _0x1bf4b9='\x22'+_0x57705d[_0xfbdc('0x62')]+'\x22';if(this[_0xfbdc('0x8b')](_0x57705d[_0xfbdc('0x7f')])){_0x1bf4b9+=','+_0x57705d['options'];}var _0x2ad45f=this[_0xfbdc('0xc')]['exec'](_0xfbdc('0xb1'),_0x1bf4b9);if(_0x2ad45f[_0xfbdc('0xab')]===-0x1){return _0x2ad45f;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1bf4b9));};AGIVertices['prototype']['sestektts']=function(_0x5a2cbb){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xd0'),_0x5a2cbb[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x5a2cbb[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}var _0x4a36cf='\x22'+_0x5a2cbb['text']+'\x22';if(this[_0xfbdc('0x8b')](_0x5a2cbb[_0xfbdc('0x7f')])){_0x4a36cf+=','+_0x5a2cbb['options'];}var _0x5edbf3=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0xb1'),_0x4a36cf);if(_0x5edbf3[_0xfbdc('0xab')]===-0x1){return _0x5edbf3;}return this['channel']['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0xb2'),_0x4a36cf));};AGIVertices['prototype'][_0xfbdc('0xd1')]=function(_0x200ce3){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xd2'),_0x200ce3[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x200ce3['grammar'])){return this['channel']['noop'](_0xfbdc('0xb7'));}var _0x17e77=_0x200ce3[_0xfbdc('0xb6')];if(this[_0xfbdc('0x8b')](_0x200ce3[_0xfbdc('0x7f')])){_0x17e77+=','+_0x200ce3[_0xfbdc('0x7f')];}var _0x2525a6=this['channel'][_0xfbdc('0x5d')](_0xfbdc('0xb8'),_0x17e77);if(_0x2525a6[_0xfbdc('0xab')]===-0x1){return _0x2525a6;}var _0x8cfd=this['getAndSetVariable'](_0xfbdc('0xb9'),_0xfbdc('0xd3'));if(_0x8cfd[_0xfbdc('0xab')]===-0x1){return _0x8cfd;}var _0x2c7e2c=this[_0xfbdc('0xbb')](_0xfbdc('0xbc'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2c7e2c[_0xfbdc('0xab')]===-0x1){return _0x2c7e2c;}var _0x15a6a0=this['getAndSetVariable']('RECOG_INSTANCE()',_0xfbdc('0xd4'));if(_0x15a6a0[_0xfbdc('0xab')]===-0x1){return _0x15a6a0;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xc0'),_0x17e77));};AGIVertices['prototype']['sestekasr']=function(_0x3ce909){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0xd5'),_0x3ce909[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x3ce909[_0xfbdc('0xb6')])){return this['channel']['noop'](_0xfbdc('0xb7'));}var _0x2a2e39=_0x3ce909[_0xfbdc('0xb6')];if(this[_0xfbdc('0x8b')](_0x3ce909[_0xfbdc('0x7f')])){_0x2a2e39+=','+_0x3ce909[_0xfbdc('0x7f')];}var _0x4eb810=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0xb8'),_0x2a2e39);if(_0x4eb810[_0xfbdc('0xab')]===-0x1){return _0x4eb810;}var _0x202960=this[_0xfbdc('0xbb')](_0xfbdc('0xb9'),_0xfbdc('0xd6'));if(_0x202960[_0xfbdc('0xab')]===-0x1){return _0x202960;}var _0x4cfb1a=this[_0xfbdc('0xbb')](_0xfbdc('0xbc'),'SESTEK_ASR_TRANSCRIPT');if(_0x4cfb1a[_0xfbdc('0xab')]===-0x1){return _0x4cfb1a;}var _0x1e92b1=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x1e92b1[_0xfbdc('0xab')]===-0x1){return _0x1e92b1;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xc0'),_0x2a2e39));};AGIVertices[_0xfbdc('0xe')]['database']=function(_0x2b1d27){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0xd7'),_0x2b1d27['label']));if(!this[_0xfbdc('0x8b')](_0x2b1d27['odbc_id'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2b1d27,'no\x20database\x20selected');}var _0x2e85f3=this[_0xfbdc('0x18')][_0xfbdc('0x76')](this,_0x2b1d27['odbc_id']);if(!_0x2e85f3){return this['channel']['error'](_0x2b1d27,_0xfbdc('0xd8'));}if(!this[_0xfbdc('0x8b')](_0x2b1d27['query'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2b1d27,'no\x20query\x20configured');}var _0x16892b=_0x2b1d27[_0xfbdc('0x32')][_0xfbdc('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format'](_0xfbdc('0xd9'),_0x16892b));var _0x16118f=this[_0xfbdc('0x2d')][_0xfbdc('0x76')](this,_0x2e85f3,_0x16892b);this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x2b1d27,_0x16892b);if(!this[_0xfbdc('0x8b')](_0x2b1d27[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xdb'));}var _0x1fad86=this[_0xfbdc('0xf')]['sync'](this,_0x2b1d27[_0xfbdc('0xda')]);if(!_0x1fad86){return this['channel'][_0xfbdc('0x56')](_0x2b1d27,_0xfbdc('0xdc'));}var _0x2e4e04=this;_0x16118f[_0xfbdc('0xdd')](function(_0x56e7b5,_0x2270b6){Object[_0xfbdc('0xde')](_0x56e7b5)['forEach'](function(_0x49aad7){_0x2e4e04[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')]('%s[%s][%s]',_0x1fad86,_0x2270b6,_0x49aad7),_0x56e7b5[_0x49aad7]);});});this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util['format'](_0xfbdc('0xdf'),_0x1fad86),_0x16118f[_0xfbdc('0xa3')]);return this['channel']['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0xe0'),_0x1fad86));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xe1')]=function(_0x692d2b){logger[_0xfbdc('0xe2')](util[_0xfbdc('0x2b')](_0xfbdc('0xe3'),_0x692d2b[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x692d2b[_0xfbdc('0xe4')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x692d2b,_0xfbdc('0xe5'));}var _0x2f050d=this[_0xfbdc('0x1b')][_0xfbdc('0x76')](this,_0x692d2b[_0xfbdc('0xe4')]);if(!_0x2f050d){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x692d2b,_0xfbdc('0xe6'));}var _0xf10f46=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0xe7'),[util[_0xfbdc('0x2b')](_0xfbdc('0xe8'),_0x2f050d),_0x692d2b[_0xfbdc('0x6b')],_0x692d2b['opts'],_0x692d2b['url']]);if(_0xf10f46['result']===-0x1){return _0xf10f46;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xe9'),_0xfbdc('0xe7')));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xea')]=function(_0x53614b){logger['info'](util['format'](_0xfbdc('0xeb'),_0x53614b['label']));if(!this[_0xfbdc('0x8b')](_0x53614b[_0xfbdc('0x87')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0xec'));}if(!this[_0xfbdc('0x8b')](_0x53614b[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}this[_0xfbdc('0xc')][_0xfbdc('0xed')]=!![];this['createSquareDetailsReport'](_0x53614b);this[_0xfbdc('0x45')](_0x53614b[_0xfbdc('0x62')],'in','','');this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Trying\x20Dialogflow:\x20%s',_0x53614b[_0xfbdc('0x62')]));var _0x456288=this['googleDialogflow'][_0xfbdc('0x76')](this,_0x53614b);if(_0x456288){for(var _0x56ce84 in _0x456288){if(_0x456288[_0xfbdc('0x9d')](_0x56ce84)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')]('DIALOGFLOW_%s',_0x56ce84[_0xfbdc('0x70')]()),_0x456288[_0x56ce84]);}}this[_0xfbdc('0x45')](_0x456288[_0xfbdc('0xee')],_0xfbdc('0xef'),_0xfbdc('0xea'),'');return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xf0'),_0x456288['speech']));}return this[_0xfbdc('0xc')]['error'](_0x53614b,_0xfbdc('0xf1'));};AGIVertices[_0xfbdc('0xe')]['dialogflowV2']=function(_0x22d0fd){logger['info'](util['format'](_0xfbdc('0xf2'),_0x22d0fd[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x22d0fd[_0xfbdc('0x82')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0xf3'));}if(!this[_0xfbdc('0x8b')](_0x22d0fd['client_email'])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xf4'));}if(!this['isConfigured'](_0x22d0fd[_0xfbdc('0x83')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0xf5'));}if(!this['isConfigured'](_0x22d0fd[_0xfbdc('0x84')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20anguage\x20configured');}if(!this[_0xfbdc('0x8b')](_0x22d0fd[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}this[_0xfbdc('0xc')][_0xfbdc('0xed')]=!![];this[_0xfbdc('0x3a')](_0x22d0fd);this[_0xfbdc('0x45')](_0x22d0fd['text'],'in','','');this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0xf6'),_0x22d0fd[_0xfbdc('0x62')]));var _0x3956da=this['googleDialogflowV2'][_0xfbdc('0x76')](this,_0x22d0fd);if(_0x3956da){for(var _0x3e8cee in _0x3956da){if(_0x3956da[_0xfbdc('0x9d')](_0x3e8cee)){if(_0x3e8cee!==_0xfbdc('0xf7')){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util['format'](_0xfbdc('0xf8'),_0x3e8cee[_0xfbdc('0x70')]()),_0x3956da[_0x3e8cee]);}}}this[_0xfbdc('0x45')](_0x3956da[_0xfbdc('0xee')],_0xfbdc('0xef'),_0xfbdc('0xf9'),_0x3956da[_0xfbdc('0xf7')]);return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xfa'),_0x3956da['speech']));}return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x22d0fd,_0xfbdc('0xfb'));};AGIVertices['prototype'][_0xfbdc('0xfc')]=function(_0x178550){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0xfd'),_0x178550[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x178550['ndauth_url'])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xfe'));}if(!this[_0xfbdc('0x8b')](_0x178550[_0xfbdc('0xff')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x100'));}if(!this[_0xfbdc('0x8b')](_0x178550[_0xfbdc('0x101')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x102'));}if(!this[_0xfbdc('0x8b')](_0x178550[_0xfbdc('0x103')])){return this['channel'][_0xfbdc('0xaf')]('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xed')]=!![];this[_0xfbdc('0x3a')](_0x178550);this[_0xfbdc('0x45')](_0x178550['text'],'in','','');this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format']('Trying\x20SestekNDA:\x20%s',_0x178550[_0xfbdc('0x62')]));var _0x24ce34=this[_0xfbdc('0x85')]['sync'](this,_0x178550);if(_0x24ce34){for(var _0x369a74 in _0x24ce34){if(_0x24ce34[_0xfbdc('0x9d')](_0x369a74)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x104'),_0x369a74[_0xfbdc('0x70')]()),_0x24ce34[_0x369a74]);}}this[_0xfbdc('0x45')](_0x24ce34['speech'],_0xfbdc('0xef'),'sesteknda','');if(_0x24ce34['audiofile']){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x105'),_0x24ce34[_0xfbdc('0x106')]));var _0x1806bf=this['channel'][_0xfbdc('0x107')](_0x24ce34['audiofile']);try{fs[_0xfbdc('0x108')](_0x24ce34['audiofile']+_0xfbdc('0x109'));}catch(_0x22fdb4){logger['error'](_0x22fdb4);}return _0x1806bf;}else{return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x10a'),_0x24ce34[_0xfbdc('0xee')]));}}return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x178550,_0xfbdc('0x10b'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x10c')]=function(_0x14caad){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x10d'),_0x14caad[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x10c'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x10e')]=function(_0x1d43f1){logger[_0xfbdc('0x30')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1d43f1[_0xfbdc('0xb5')]));var _0x549915='';if(_0x1d43f1['trunk_id']){if(!this[_0xfbdc('0x8b')](_0x1d43f1['trunk_id'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x1d43f1,_0xfbdc('0x10f'));}else{var _0x3aa076=parseInt(_0x1d43f1[_0xfbdc('0x110')],0xa);if(isNaN(_0x3aa076)){_0x549915=_0x1d43f1[_0xfbdc('0x110')];}else{_0x549915=this[_0xfbdc('0x1d')][_0xfbdc('0x76')](this,_0x1d43f1[_0xfbdc('0x110')]);if(!_0x549915){return this[_0xfbdc('0xc')]['error'](_0x1d43f1,_0xfbdc('0x111'));}}}}else if(_0x1d43f1[_0xfbdc('0x112')]){_0x549915=_0x1d43f1['trunk_name'];}else{return this['channel'][_0xfbdc('0x56')](_0x1d43f1,_0xfbdc('0x10f'));}var _0x5067fc=this['channel']['exec'](_0xfbdc('0xe7'),[util[_0xfbdc('0x2b')]('SIP/%s/%s',_0x549915,_0x1d43f1[_0xfbdc('0x4c')]),_0x1d43f1[_0xfbdc('0x6b')],_0x1d43f1[_0xfbdc('0x113')],_0x1d43f1[_0xfbdc('0x114')]]);if(_0x5067fc[_0xfbdc('0xab')]===-0x1){return _0x5067fc;}return this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0xe9'),_0xfbdc('0xe7')));};AGIVertices[_0xfbdc('0xe')]['finally']=function(_0x597e98){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x115'),_0x597e98['label']));return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('finally');};AGIVertices['prototype'][_0xfbdc('0xa')]=function(_0x5c323c){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x116'),_0x5c323c[_0xfbdc('0xb5')]));if(_0x5c323c[_0xfbdc('0xae')]===0x0){return this['maxRetry'](_0x5c323c);}_0x5c323c['retry']-=0x1;if(!this[_0xfbdc('0x8b')](_0x5c323c[_0xfbdc('0x117')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x5c323c,_0xfbdc('0x118'));}var _0x39bbfb=this[_0xfbdc('0x1f')][_0xfbdc('0x76')](this,_0x5c323c[_0xfbdc('0x117')]);if(!_0x39bbfb){return this['channel'][_0xfbdc('0x56')](_0x5c323c,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x5c323c[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0xfbdc('0xdb'));}var _0xc08d4f=this['channel'][_0xfbdc('0x119')](_0x39bbfb,_0x5c323c[_0xfbdc('0x11a')],_0x5c323c[_0xfbdc('0x11b')]);var _0xc0b6c4=_0xc08d4f[_0xfbdc('0xab')]?_0xc08d4f[_0xfbdc('0xab')][_0xfbdc('0x51')]():'';logger['info'](_0xfbdc('0x11c'),JSON[_0xfbdc('0x7a')](_0xc08d4f));if(_0xc08d4f[_0xfbdc('0xab')]===-0x1){this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x5c323c,_0xc0b6c4);return _0xc08d4f;}else if(_0xc08d4f[_0xfbdc('0xaa')]==='timeout'){_0xc08d4f[_0xfbdc('0xab')]=_0xc0b6c4['length']>=parseInt(_0x5c323c['mindigit'])?'x':'i';}else{_0xc08d4f['result']=_0xc0b6c4[_0xfbdc('0xa3')]>=parseInt(_0x5c323c['mindigit'])&&_0xc0b6c4['length']<=parseInt(_0x5c323c[_0xfbdc('0x11b')])?'x':'i';}var _0x23cd3b=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x5c323c[_0xfbdc('0xda')]);if(!_0x23cd3b){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x5c323c,_0xfbdc('0xdc'));}this[_0xfbdc('0xc')][_0xfbdc('0xa7')](_0x23cd3b,_0xc0b6c4);if(this[_0xfbdc('0x8b')](_0x5c323c[_0xfbdc('0x11d')])){var _0x248406=parseInt(_0x5c323c[_0xfbdc('0x11d')],0xa);var _0x49f9c3=rs[_0xfbdc('0x11e')]({'charset':'*','length':_0x248406});var _0x38cbd5=_0xc0b6c4[_0xfbdc('0xa3')];if(_0x38cbd5>0x0){if(_0x38cbd5>_0x248406){this[_0xfbdc('0x3a')]['sync'](this,_0x5c323c,_0x5c323c[_0xfbdc('0x11f')]==='first'?_0x49f9c3+_0xc0b6c4[_0xfbdc('0x120')](_0x248406):_0xc0b6c4[_0xfbdc('0x120')](0x0,_0x38cbd5-_0x248406)+_0x49f9c3);}else{this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x5c323c,rs[_0xfbdc('0x11e')]({'charset':'*','length':_0x38cbd5}));}}else{this['createSquareDetailsReport'][_0xfbdc('0x76')](this,_0x5c323c,'');}}else{this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x5c323c,_0xc0b6c4);}return _0xc08d4f;};AGIVertices['prototype'][_0xfbdc('0xb')]=function(_0x97313){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x121'),_0x97313[_0xfbdc('0xb5')]));return this[_0xfbdc('0xa')](_0x97313);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x122')]=function(_0x4dcf69){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x123'),_0x4dcf69[_0xfbdc('0xb5')]));this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x4dcf69,_0x4dcf69[_0xfbdc('0x124')]);return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x125'),_0x4dcf69[_0xfbdc('0x124')]));};AGIVertices['prototype'][_0xfbdc('0x126')]=function(_0x28e7a6){logger['info'](util['format'](_0xfbdc('0x127'),_0x28e7a6[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x28e7a6[_0xfbdc('0x8e')])||!this[_0xfbdc('0x8b')](_0x28e7a6[_0xfbdc('0x93')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x128'));}if(!this[_0xfbdc('0x8b')](_0x28e7a6[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Trying\x20aws\x20Polly\x20%s',_0x28e7a6[_0xfbdc('0x62')]));var _0x358d93=this[_0xfbdc('0x8d')][_0xfbdc('0x76')](this,_0x28e7a6);if(_0x358d93){this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x129'),_0x358d93));var _0x2bd999=this[_0xfbdc('0xc')][_0xfbdc('0x107')](_0x358d93);try{fs['unlink'](_0x358d93+_0xfbdc('0x109'));}catch(_0x1050aa){logger[_0xfbdc('0x56')](_0x1050aa);}return _0x2bd999;}return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x28e7a6,_0xfbdc('0x12a'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x12b')]=function(_0x2ae4c1){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x12c'),_0x2ae4c1[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x2ae4c1[_0xfbdc('0x8e')])||!this[_0xfbdc('0x8b')](_0x2ae4c1['aws_secret_access_key'])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x128'));}if(!this[_0xfbdc('0x8b')](_0x2ae4c1['aws_bot_name'])){return this[_0xfbdc('0xc')]['noop']('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x2ae4c1[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xed')]=!![];this[_0xfbdc('0x3a')](_0x2ae4c1);this[_0xfbdc('0x45')](_0x2ae4c1[_0xfbdc('0x62')],'in','','');this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x12d'),_0x2ae4c1[_0xfbdc('0x62')]));var _0x3d8dbb=this[_0xfbdc('0x92')]['sync'](this,_0x2ae4c1);if(_0x3d8dbb){for(var _0x2154ee in _0x3d8dbb){if(_0x3d8dbb[_0xfbdc('0x9d')](_0x2154ee)&&_['isString'](_0x3d8dbb[_0x2154ee])){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x12e'),_0x2154ee[_0xfbdc('0x70')]()),_0x3d8dbb[_0x2154ee]);}}if(_[_0xfbdc('0x48')](_0x3d8dbb[_0xfbdc('0x12f')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x130'));}else{this[_0xfbdc('0x45')](_0x3d8dbb[_0xfbdc('0x12f')],'out',_0xfbdc('0x131'),'');return this['channel'][_0xfbdc('0xaf')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x3d8dbb[_0xfbdc('0x12f')]));}}return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2ae4c1,_0xfbdc('0x132'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x133')]=function(_0x535aa7){logger['info'](util['format'](_0xfbdc('0x134'),_0x535aa7[_0xfbdc('0xb5')],_0x535aa7[_0xfbdc('0x6b')]));if(!this[_0xfbdc('0x8b')](_0x535aa7['key'])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xec'));}var _0x30727f=_0xfbdc('0x135');var _0x5051fa=util[_0xfbdc('0x2b')](_0xfbdc('0x136'),FILES_PATH,rs[_0xfbdc('0x11e')](0x4));var _0x56bdd6=util[_0xfbdc('0x2b')]('%s.%s',_0x5051fa,_0x30727f);var _0xe87fbf=!![];if(_0x535aa7[_0xfbdc('0x137')]===_0xfbdc('0x138')){_0xe87fbf=![];}var _0x4fc43b=this[_0xfbdc('0xc')]['recordFile'](_0x5051fa,_0x30727f,_0x535aa7[_0xfbdc('0x139')],_0x535aa7[_0xfbdc('0x6b')],undefined,_0xe87fbf);if(_0x4fc43b['result']!==-0x1){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x13a'),_0x56bdd6));var _0x1b2dfd=this['googleASR'][_0xfbdc('0x76')](this,_0x535aa7,_0x56bdd6);if(_0x1b2dfd){for(var _0x1912a6 in _0x1b2dfd){if(_0x1b2dfd[_0xfbdc('0x9d')](_0x1912a6)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x13b'),_0x1912a6[_0xfbdc('0x70')]()),_0x1b2dfd[_0x1912a6]);}}return this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')]('GoogleASR\x20Result\x20%s',JSON[_0xfbdc('0x7a')](_0x1b2dfd)));}}return _0x4fc43b;};AGIVertices[_0xfbdc('0xe')]['tildeasr']=function(_0x48f2fb){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x13c'),_0x48f2fb[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x48f2fb[_0xfbdc('0x99')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x13d'));}if(!this[_0xfbdc('0x8b')](_0x48f2fb[_0xfbdc('0x9a')])){return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0x13e'));}var _0x3bc4d0=_0xfbdc('0x135');var _0x4e5abe=util['format'](_0xfbdc('0x136'),FILES_PATH,rs['generate'](0x4));var _0x4f60b6=util[_0xfbdc('0x2b')](_0xfbdc('0xa6'),_0x4e5abe,_0x3bc4d0);var _0xe05ba5=!![];if(_0x48f2fb[_0xfbdc('0x137')]===_0xfbdc('0x138')){_0xe05ba5=![];}var _0x5df3b8=this[_0xfbdc('0xc')]['recordFile'](_0x4e5abe,_0x3bc4d0,_0x48f2fb[_0xfbdc('0x139')],_0x48f2fb[_0xfbdc('0x6b')],undefined,_0xe05ba5);if(_0x5df3b8[_0xfbdc('0xab')]!==-0x1){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x13f'),_0x4f60b6));var _0x48faf1=this['tildeASR'][_0xfbdc('0x76')](this,_0x48f2fb,_0x4f60b6);if(_0x48faf1){for(var _0x3c8a1c in _0x48faf1){if(_0x48faf1['hasOwnProperty'](_0x3c8a1c)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x140'),_0x3c8a1c[_0xfbdc('0x70')]()),_0x48faf1[_0x3c8a1c]);}}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x141'),JSON['stringify'](_0x48faf1)));}}return _0x5df3b8;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x142')]=function(_0xcf493b){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x143'),_0xcf493b[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0x144')](_0xcf493b[_0xfbdc('0x40')],_0xcf493b[_0xfbdc('0x41')],_0xcf493b[_0xfbdc('0x42')]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x145')]=function(_0x22a94d){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x146'),_0x22a94d[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x22a94d[_0xfbdc('0x147')])){return this['channel'][_0xfbdc('0x56')](_0x22a94d,_0xfbdc('0x148'));}try{var _0x50c522=eval(_0x22a94d[_0xfbdc('0x147')])?_0xfbdc('0x149'):_0xfbdc('0x14a');this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')]('EVAL\x20CONDITION\x20%s\x20%s',_0x22a94d[_0xfbdc('0x147')],_0x50c522));return{'code':0xc8,'result':_0x50c522};}catch(_0x30b96e){return{'code':0xc8,'result':_0xfbdc('0x14a')};}};AGIVertices['prototype']['gotoiftime']=function(_0x2814d2){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x14b'),_0x2814d2['label']));if(!this[_0xfbdc('0x8b')](_0x2814d2['interval_id'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2814d2,_0xfbdc('0x14c'));}var _0x49dda9=this[_0xfbdc('0x26')][_0xfbdc('0x76')](this,_0x2814d2[_0xfbdc('0x14d')]);if(!_0x49dda9){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x2814d2,_0xfbdc('0x14e'));}for(var _0x1e428d=0x0;_0x1e428d<_0x49dda9['length'];_0x1e428d+=0x1){var _0x3dfa85=this[_0xfbdc('0xc')][_0xfbdc('0xf')](util['format'](_0xfbdc('0x14f'),_0x49dda9[_0x1e428d]));if(_0x3dfa85['result']===-0x1){return _0x3dfa85;}logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0x3dfa85[_0xfbdc('0xaa')]));if(_0x3dfa85[_0xfbdc('0xaa')]===_0xfbdc('0x149')){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0xfbdc('0x149')));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0xfbdc('0x149')));return{'code':0xc8,'result':_0xfbdc('0x149')};}else{logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0xfbdc('0x14a')));this[_0xfbdc('0xc')]['noop'](util['format'](_0xfbdc('0x150'),_0x49dda9[_0x1e428d],_0xfbdc('0x14a')));}}return{'code':0xc8,'result':_0xfbdc('0x14a')};};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x151')]=function(_0x4455a9){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x152'),_0x4455a9[_0xfbdc('0xb5')]));return this['channel']['hangup']();};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x153')]=function(_0x4216e7){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x154'),_0x4216e7[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x4216e7[_0xfbdc('0x87')])){return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0xec'));}var _0x58a23c='wav';var _0x5a5af1=util[_0xfbdc('0x2b')](_0xfbdc('0x136'),FILES_PATH,rs['generate'](0x4));var _0x37281a=util[_0xfbdc('0x2b')](_0xfbdc('0xa6'),_0x5a5af1,_0x58a23c);var _0x2afe5a=!![];if(_0x4216e7[_0xfbdc('0x137')]==='NOBEEP'){_0x2afe5a=![];}var _0x46ee0b=this[_0xfbdc('0xc')][_0xfbdc('0x155')](_0x5a5af1,_0x58a23c,_0x4216e7[_0xfbdc('0x139')],_0x4216e7[_0xfbdc('0x6b')],undefined,_0x2afe5a);if(_0x46ee0b[_0xfbdc('0xab')]!==-0x1){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('ispeech\x20%s\x20file\x20created',_0x37281a));var _0x5def3a=this['ispeechASR'][_0xfbdc('0x76')](this,_0x4216e7,_0x37281a);if(_0x5def3a){for(var _0x1faf22 in _0x5def3a){if(_0x5def3a[_0xfbdc('0x9d')](_0x1faf22)){this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')]('ISPEECH_ASR_%s',_0x1faf22[_0xfbdc('0x70')]()),_0x5def3a[_0x1faf22]);}}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x156'),JSON[_0xfbdc('0x7a')](_0x5def3a)));}}return _0x46ee0b;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x157')]=function(_0x463ff1){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x158'),_0x463ff1[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x463ff1[_0xfbdc('0x87')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xec'));}if(!this['isConfigured'](_0x463ff1[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')]['noop']('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x159'),_0x463ff1['text']));var _0x455d2c=this[_0xfbdc('0x86')][_0xfbdc('0x76')](this,_0x463ff1);if(_0x455d2c){this[_0xfbdc('0xc')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x455d2c));var _0x59cedf=this[_0xfbdc('0xc')][_0xfbdc('0x107')](_0x455d2c,_0x463ff1['intKey']);try{fs[_0xfbdc('0x108')](_0x455d2c+'.wav');}catch(_0x4bfd6d){logger[_0xfbdc('0x56')](_0x4bfd6d);}return _0x59cedf;}return this['channel'][_0xfbdc('0x56')](_0x463ff1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x15a')]=function(_0x1c0dd6){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x1c0dd6[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x1c0dd6['findBy'])){return this[_0xfbdc('0xc')]['error'](_0x1c0dd6,_0xfbdc('0x15b'));}logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x15c'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1c0dd6[_0xfbdc('0x15d')]));var _0x38a973=this[_0xfbdc('0x5b')][_0xfbdc('0x76')](this,_0x1c0dd6['findBy']);if(_0x38a973){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x15e'),this['channel']['callerid'],_0x1c0dd6[_0xfbdc('0x15d')]));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1c0dd6[_0xfbdc('0x15d')]));return{'code':0xc8,'result':_0xfbdc('0x15f')};}else{logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x160'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1c0dd6[_0xfbdc('0x15d')]));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x160'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1c0dd6['findBy']));return{'code':0xc8,'result':_0xfbdc('0x161')};}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x162')]=function(_0x1dbd46){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x163'),_0x1dbd46[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x1dbd46[_0xfbdc('0x15d')])){return this['channel'][_0xfbdc('0x56')](_0x1dbd46,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xfbdc('0x15c'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1dbd46[_0xfbdc('0x15d')]));var _0x4d8609=this[_0xfbdc('0x58')]['sync'](this,_0x1dbd46[_0xfbdc('0x15d')]);if(_0x4d8609){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this['channel'][_0xfbdc('0x3c')],_0x1dbd46[_0xfbdc('0x15d')]));this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x15e'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1dbd46[_0xfbdc('0x15d')]));return{'code':0xc8,'result':_0xfbdc('0x15f')};}else{logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x160'),this[_0xfbdc('0xc')]['callerid'],_0x1dbd46['findBy']));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x1dbd46[_0xfbdc('0x15d')]));return{'code':0xc8,'result':_0xfbdc('0x161')};}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x164')]=function(_0x1772b2){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x165'),_0x1772b2[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x1772b2['operation'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x1772b2,_0xfbdc('0x166'));}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('math\x20%s',_0x1772b2[_0xfbdc('0x167')]));var _0x3a9438=eval(_0x1772b2['operation']);if(!this[_0xfbdc('0x8b')](_0x1772b2[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xdb'));}var _0x2a8539=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x1772b2[_0xfbdc('0xda')]);if(!_0x2a8539){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x1772b2,_0xfbdc('0xdc'));}if(_[_0xfbdc('0xa2')](_0x3a9438)){var _0x33ff38=this;_0x3a9438[_0xfbdc('0xdd')](function(_0x3e1e90,_0x414d5d){_0x33ff38[_0xfbdc('0xc')]['setVariable'](util[_0xfbdc('0x2b')](_0xfbdc('0x168'),_0x2a8539,_0x414d5d),_0x3e1e90);});return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x169'),_0x2a8539));}else{return this['channel'][_0xfbdc('0xa7')](_0x2a8539,_0x3a9438);}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x16a')]=function(_0x442372){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x16b'),_0x442372['label']));if(_0x442372['retry']===0x0){return this[_0xfbdc('0xad')](_0x442372);}_0x442372[_0xfbdc('0xae')]-=0x1;if(!this[_0xfbdc('0x8b')](_0x442372[_0xfbdc('0x117')])){return this[_0xfbdc('0xc')]['error'](_0x442372,_0xfbdc('0x118'));}var _0x1d9b16=this[_0xfbdc('0x1f')][_0xfbdc('0x76')](this,_0x442372[_0xfbdc('0x117')]);if(!_0x1d9b16){return this['channel'][_0xfbdc('0x56')](_0x442372,_0xfbdc('0x16c'));}var _0x1ecbb8=this[_0xfbdc('0xc')][_0xfbdc('0x119')](_0x1d9b16,_0x442372[_0xfbdc('0x11a')],_0x442372[_0xfbdc('0x16d')]);var _0x285159=_0x1ecbb8[_0xfbdc('0xab')];if(_0x1ecbb8[_0xfbdc('0xab')]===-0x1){this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x442372,'-1');return _0x1ecbb8;}else if(_0x1ecbb8['extra']===_0xfbdc('0x6b')){_0x1ecbb8['result']=_0x1ecbb8[_0xfbdc('0xab')][_0xfbdc('0xa3')]>0x0?_0x1ecbb8[_0xfbdc('0xab')]:'t';}else if(_[_0xfbdc('0x47')](_0x1ecbb8[_0xfbdc('0xab')])){_0x1ecbb8[_0xfbdc('0xab')]='#';_0x285159='#';}if(!this[_0xfbdc('0x8b')](_0x442372[_0xfbdc('0xda')])){this[_0xfbdc('0xc')]['noop'](_0xfbdc('0xdb'));}else{var _0x4c1c77=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x442372['variable_id']);if(!_0x4c1c77){return this[_0xfbdc('0xc')]['error'](_0x442372,_0xfbdc('0xdc'));}this[_0xfbdc('0xc')][_0xfbdc('0xa7')](_0x4c1c77,_0x285159);}this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x442372,_0x285159);return _0x1ecbb8;};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0xaf')]=function(_0x2d97ab){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x16e'),_0x2d97ab[_0xfbdc('0xb5')]));return this['channel'][_0xfbdc('0xaf')](_0x2d97ab['output']||_0x2d97ab[_0xfbdc('0xb5')]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x16f')]=function(_0x515329){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x170'),_0x515329[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x515329['findBy'])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x515329,_0xfbdc('0x15b'));}logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x15c'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x515329[_0xfbdc('0x15d')]));var _0x4c5ab5=this[_0xfbdc('0x171')][_0xfbdc('0x76')](this,_0x515329[_0xfbdc('0x172')]);var _0x376f37=this[_0xfbdc('0x54')][_0xfbdc('0x76')](this,_0x515329[_0xfbdc('0x15d')],_0x4c5ab5);if(_0x376f37){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x515329[_0xfbdc('0x15d')]));this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this[_0xfbdc('0xc')]['callerid'],_0x515329['findBy']));return{'code':0xc8,'result':_0xfbdc('0x15f')};}else{logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x515329['findBy']));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x15e'),this['channel'][_0xfbdc('0x3c')],_0x515329['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xfbdc('0x173')]=function(_0x5bdec8){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x174'),_0x5bdec8[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x5bdec8[_0xfbdc('0x117')])){return this['channel'][_0xfbdc('0x56')](_0x5bdec8,'no\x20file\x20audio\x20selected');}var _0x33e800=this[_0xfbdc('0x1f')][_0xfbdc('0x76')](this,_0x5bdec8[_0xfbdc('0x117')]);if(!_0x33e800){return this['channel'][_0xfbdc('0x56')](_0x5bdec8,_0xfbdc('0x16c'));}var _0x11b78c=this['channel'][_0xfbdc('0x5d')]('PLAYBACK',[_0x33e800,_0x5bdec8[_0xfbdc('0x113')]]);if(_0x11b78c[_0xfbdc('0xab')]===-0x1){return _0x11b78c;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format'](_0xfbdc('0xcc'),_0xfbdc('0x175'),_0x33e800));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x176')]=function(_0x8cdbee){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x177'),_0x8cdbee[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x8cdbee[_0xfbdc('0x178')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x8cdbee,_0xfbdc('0x179'));}var _0x1210c6='';var _0x180e39=parseInt(_0x8cdbee[_0xfbdc('0x178')],0xa);if(isNaN(_0x180e39)){_0x1210c6=_0x8cdbee[_0xfbdc('0x178')];}else{_0x1210c6=this[_0xfbdc('0x13')][_0xfbdc('0x76')](this,_0x8cdbee[_0xfbdc('0x178')]);if(!_0x1210c6){return this[_0xfbdc('0xc')]['error'](_0x8cdbee,_0xfbdc('0x17a'));}}var _0x4e65ad='';if(this[_0xfbdc('0x8b')](_0x8cdbee['file_id'])){var _0x322df3=this[_0xfbdc('0x1f')][_0xfbdc('0x76')](this,_0x8cdbee[_0xfbdc('0x117')]);if(_0x322df3){_0x4e65ad=_0x322df3;}}this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x8cdbee,_0x1210c6);if(_0x8cdbee[_0xfbdc('0x113')]['indexOf']('x')<0x0){_0x8cdbee['opts']+='x';}if(_0x8cdbee['opts']['indexOf']('X')<0x0){_0x8cdbee[_0xfbdc('0x113')]+='X';}this[_0xfbdc('0xc')][_0xfbdc('0xa7')](_0xfbdc('0x17b'),_0x1210c6?_0x1210c6[_0xfbdc('0x17c')]():'');var _0x33ba16=this[_0xfbdc('0xc')][_0xfbdc('0x5d')](_0xfbdc('0x17d'),[_0x1210c6,_0x8cdbee[_0xfbdc('0x113')],_0x8cdbee[_0xfbdc('0x114')],_0x4e65ad,_0x8cdbee[_0xfbdc('0x6b')],_0x8cdbee[_0xfbdc('0xc2')],_0x8cdbee[_0xfbdc('0x17e')],_0x8cdbee[_0xfbdc('0x17f')],'',_0x8cdbee['position']]);if(_0x33ba16[_0xfbdc('0xab')]===-0x1){return _0x33ba16;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util['format']('Executed\x20command\x20%s\x20%s','QUEUE',_0x1210c6));};AGIVertices['prototype'][_0xfbdc('0x180')]=function(_0x4809f6){logger['info'](util['format'](_0xfbdc('0x181'),_0x4809f6['label']));var _0x184f50=_0x4809f6['recordingFormat']||'wav';var _0x5cb19c=util[_0xfbdc('0x2b')](_0xfbdc('0x182'),this[_0xfbdc('0xc')][_0xfbdc('0x3e')],rs[_0xfbdc('0x11e')](0x5));var _0x113826=util[_0xfbdc('0x2b')]('%s/recordings/%s.%s',FILES_PATH,_0x5cb19c,_0x184f50);var _0x4bd132=util['format'](_0xfbdc('0x136'),FILES_PATH,_0x5cb19c);this['createSquareRecording'][_0xfbdc('0x76')](this,_0x4809f6,_0x5cb19c,_0x113826);this[_0xfbdc('0xc')]['setVariable']('RECORDING_SAVENAME',_0x5cb19c);logger[_0xfbdc('0x30')](_0xfbdc('0x183'),_0x4bd132,_0x184f50,_0x4809f6[_0xfbdc('0x184')],_0x4809f6['timeout']);return this[_0xfbdc('0xc')][_0xfbdc('0x155')](_0x4bd132,_0x184f50,_0x4809f6[_0xfbdc('0x184')],_0x4809f6[_0xfbdc('0x6b')],undefined,!![]);};AGIVertices['prototype'][_0xfbdc('0x185')]=function(_0x5cc7a2){logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x186'),_0x5cc7a2[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x5cc7a2[_0xfbdc('0x114')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x187'));}var _0x6a810b=this[_0xfbdc('0x6a')][_0xfbdc('0x76')](this,_0x5cc7a2);logger['info'](util[_0xfbdc('0x2b')]('Response:',util[_0xfbdc('0x188')](_0x6a810b,{'showHidden':![],'depth':null})));if(!this[_0xfbdc('0x8b')](_0x5cc7a2[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1304d6=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x5cc7a2['variable_id']);if(!_0x1304d6){return this['channel']['error'](_0x5cc7a2,_0xfbdc('0xdc'));}this[_0xfbdc('0xc')][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')](_0xfbdc('0x189'),_0x1304d6),_0x6a810b[_0xfbdc('0x7d')]?_0x6a810b['statusCode']:_0xfbdc('0x18a'));this['channel'][_0xfbdc('0xa7')](util[_0xfbdc('0x2b')]('%s_STATUS_MESSAGE',_0x1304d6),_0x6a810b[_0xfbdc('0x18b')]?_0x6a810b[_0xfbdc('0x18b')]:'OK');if(_0x6a810b[_0xfbdc('0x7b')]){try{this[_0xfbdc('0xa5')](_0x6a810b['body'],_0x1304d6);}catch(_0x5cf050){logger[_0xfbdc('0x56')](util[_0xfbdc('0x2b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x1304d6));}}return this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0xe0'),_0x1304d6));};AGIVertices[_0xfbdc('0xe')]['saydigits']=function(_0x11ed16){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x18c'),_0x11ed16[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0x18d')](_0x11ed16[_0xfbdc('0x18e')][_0xfbdc('0x5e')](/\s+/g,''),_0x11ed16[_0xfbdc('0x184')]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x18f')]=function(_0x28021f){logger[_0xfbdc('0x30')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x28021f[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0x190')](_0x28021f[_0xfbdc('0x191')][_0xfbdc('0x5e')](/\s+/g,''),_0x28021f[_0xfbdc('0x184')]);};AGIVertices[_0xfbdc('0xe')]['sayphonetic']=function(_0x388481){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x192'),_0x388481['label']));return this[_0xfbdc('0xc')][_0xfbdc('0x193')](_0x388481[_0xfbdc('0x62')],_0x388481['escape_digits']);};AGIVertices['prototype'][_0xfbdc('0x194')]=function(_0x515f4f){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x195'),_0x515f4f[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x515f4f[_0xfbdc('0x196')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x197'));}var _0xee99e4=this[_0xfbdc('0x23')][_0xfbdc('0x76')](this,_0x515f4f[_0xfbdc('0x196')]);if(!_0xee99e4||!_0xee99e4[_0xfbdc('0x198')]){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x515f4f,'no\x20mail\x20account\x20found');}var _0x44cd8c={'from':util[_0xfbdc('0x2b')](_0xfbdc('0x199'),_0xee99e4[_0xfbdc('0x15')],_0xee99e4['email']||_0xee99e4[_0xfbdc('0x198')]['user']),'to':_0x515f4f['to']||'','cc':_0x515f4f['cc']||'','bcc':_0x515f4f['bcc']||'','subject':_0x515f4f['subject'],'html':_0x515f4f[_0xfbdc('0x62')],'text':_0x515f4f['text']};var _0x1ba29a={'tls':{'rejectUnauthorized':![]}};if(_0xee99e4[_0xfbdc('0x198')]['service']){_0x1ba29a[_0xfbdc('0x19a')]=_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19a')];}else{_0x1ba29a[_0xfbdc('0x19b')]=_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19b')];_0x1ba29a['port']=_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19c')];_0x1ba29a[_0xfbdc('0x19d')]=_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19d')];}if(_0xee99e4[_0xfbdc('0x198')][_0xfbdc('0x19e')]){_0x1ba29a[_0xfbdc('0x19f')]={'user':_0xee99e4[_0xfbdc('0x198')]['user'],'pass':_0xee99e4[_0xfbdc('0x198')]['pass']};}if(this[_0xfbdc('0x8b')](_0x515f4f[_0xfbdc('0x1a0')])){}logger[_0xfbdc('0xe2')]('sendMail\x20message',JSON[_0xfbdc('0x7a')](_0x44cd8c));this[_0xfbdc('0x3a')]['sync'](this,_0x515f4f,_0x515f4f[_0xfbdc('0x196')]);this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x1a1'),_0xee99e4[_0xfbdc('0x15')]));this[_0xfbdc('0x25')]['sync'](this,_0x1ba29a,_0x44cd8c);return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0x1a2'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1a3')]=function(_0x519895){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x1a4'),_0x519895[_0xfbdc('0xb5')]));return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x1a5'));};AGIVertices['prototype'][_0xfbdc('0x1a6')]=function(_0x5fdcbe){logger['info'](util[_0xfbdc('0x2b')](_0xfbdc('0x1a7'),_0x5fdcbe[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x5fdcbe[_0xfbdc('0x1a8')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20sms\x20account\x20configured');}var _0x3aa252=this[_0xfbdc('0x37')][_0xfbdc('0x76')](this,_0x5fdcbe[_0xfbdc('0x1a8')]);if(!_0x3aa252){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x5fdcbe,_0xfbdc('0x1a9'));}var _0xf271e6={'body':_0x5fdcbe['sms_text'],'phone':_0x5fdcbe['to']||'','SmsAccountId':_0x3aa252['id']};logger['debug'](_0xfbdc('0x1aa'),JSON[_0xfbdc('0x7a')](_0xf271e6));this[_0xfbdc('0x3a')]['sync'](this,_0x5fdcbe,_0x5fdcbe[_0xfbdc('0x1a8')]);this['channel'][_0xfbdc('0xaf')](util['format'](_0xfbdc('0x1ab'),_0x3aa252[_0xfbdc('0x15')]));this[_0xfbdc('0x39')]['sync'](this,_0xf271e6);return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x1ac'));};AGIVertices[_0xfbdc('0xe')]['set']=function(_0x138ae9){logger[_0xfbdc('0x30')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x138ae9[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x138ae9[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x138ae9,_0xfbdc('0x1ad'));}var _0x4b2c73=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x138ae9[_0xfbdc('0xda')]);if(!_0x4b2c73){return this['channel'][_0xfbdc('0x56')](_0x138ae9,_0xfbdc('0xdc'));}return this['channel'][_0xfbdc('0xa7')](_0x4b2c73,_0x138ae9[_0xfbdc('0x1ae')]);};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1af')]=function(_0xf696ab){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('Enter\x20in\x20START\x20(%s)\x20block',_0xf696ab['label']));this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x1b0'));if(_0xf696ab[_0xfbdc('0xc5')]==='yes'){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0x1b1'));return this[_0xfbdc('0xc')][_0xfbdc('0xc5')]();}return this['channel'][_0xfbdc('0xaf')](_0xfbdc('0x1b2'));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1b3')]=function(_0x13747a){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x1b4'),_0x13747a['label']));if(!this[_0xfbdc('0x8b')](_0x13747a[_0xfbdc('0x1b5')])){return this['channel'][_0xfbdc('0x56')](_0x13747a,_0xfbdc('0x1b6'));}var _0x1180b8=this[_0xfbdc('0x16')][_0xfbdc('0x76')](this,_0x13747a[_0xfbdc('0x1b5')]);if(!this[_0xfbdc('0x8b')](_0x1180b8)){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x13747a,util['format'](_0xfbdc('0x1b7'),_0x13747a[_0xfbdc('0x1b5')]));}if(_0x1180b8===this[_0xfbdc('0xc')][_0xfbdc('0x3b')]){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x13747a,_0xfbdc('0x1b8'));}this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x13747a,_0x1180b8);var _0x120658=this['channel'][_0xfbdc('0x5d')](_0xfbdc('0x1b9'),util[_0xfbdc('0x2b')](_0xfbdc('0x1ba'),config[_0xfbdc('0xc2')][_0xfbdc('0x19b')]||'127.0.0.1',_0x1180b8,this[_0xfbdc('0xc')][_0xfbdc('0x3b')]));if(_0x120658[_0xfbdc('0xab')]===-0x1){return _0x120658;}return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Executed\x20command\x20%s\x20%s',_0xfbdc('0x1b9'),_0x1180b8));};AGIVertices['prototype']['system']=function(_0x21599b){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x21599b[_0xfbdc('0xb5')]));var _0x5dd1f0=this['shellCommand'][_0xfbdc('0x76')](this,_0x21599b[_0xfbdc('0xc3')]);this[_0xfbdc('0x3a')][_0xfbdc('0x76')](this,_0x21599b,_0x21599b[_0xfbdc('0xc3')]);if(this[_0xfbdc('0x8b')](_0x21599b['variable_id'])){var _0x2e3501=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x21599b[_0xfbdc('0xda')]);if(_0x2e3501){this['channel'][_0xfbdc('0xa7')](_0x2e3501,_0x5dd1f0);return this[_0xfbdc('0xc')]['noop'](util[_0xfbdc('0x2b')](_0xfbdc('0x1bb'),_0x21599b[_0xfbdc('0xc3')],_0x2e3501));}}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x21599b[_0xfbdc('0xc3')]));};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1bc')]=function(_0x343150){logger['info'](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x343150[_0xfbdc('0xb5')]));_0x343150[_0xfbdc('0x62')]=_0x343150[_0xfbdc('0x62')][_0xfbdc('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x343150[_0xfbdc('0x60')])){return this[_0xfbdc('0xc')]['noop'](_0xfbdc('0x1bd'));}if(!this['isConfigured'](_0x343150[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')](_0xfbdc('0xb0'));}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x343150['text']));var _0x53abd7=this['googleCloudTTS'][_0xfbdc('0x76')](this,_0x343150);if(_0x53abd7){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x1be'),_0x53abd7));var _0x1e725b=this[_0xfbdc('0xc')]['streamFile'](_0x53abd7);try{fs['unlink'](_0x53abd7+'.wav');}catch(_0x42b042){logger[_0xfbdc('0x56')](_0x42b042);}return _0x1e725b;}return this['channel'][_0xfbdc('0x56')](_0x343150,_0xfbdc('0x1bf'));};AGIVertices['prototype']['tts']=function(_0x17ccd4){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x1c0'),_0x17ccd4[_0xfbdc('0xb5')]));_0x17ccd4[_0xfbdc('0x62')]=_0x17ccd4[_0xfbdc('0x62')][_0xfbdc('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x17ccd4[_0xfbdc('0x62')])){return this[_0xfbdc('0xc')][_0xfbdc('0xaf')]('no\x20text\x20configured');}this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x17ccd4[_0xfbdc('0x62')]));var _0xbc6d61=this[_0xfbdc('0x68')]['sync'](this,_0x17ccd4);if(_0xbc6d61){this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x1c1'),_0xbc6d61));var _0x1888d3=this[_0xfbdc('0xc')][_0xfbdc('0x107')](_0xbc6d61);try{fs[_0xfbdc('0x108')](_0xbc6d61+'.wav');}catch(_0x3889b3){logger[_0xfbdc('0x56')](_0x3889b3);}return _0x1888d3;}return this['channel']['error'](_0x17ccd4,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1c2')]=function(_0x4b95fa){logger['info'](util[_0xfbdc('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x4b95fa[_0xfbdc('0xb5')]));if(!this['isConfigured'](_0x4b95fa[_0xfbdc('0x15d')])){return this['channel'][_0xfbdc('0x56')](_0x4b95fa,_0xfbdc('0x15b'));}logger['info'](util['format'](_0xfbdc('0x15c'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x4b95fa['findBy']));var _0x2e9e00=this[_0xfbdc('0x57')][_0xfbdc('0x76')](this,_0x4b95fa[_0xfbdc('0x15d')]);if(_0x2e9e00){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x4b95fa[_0xfbdc('0x15d')]));this[_0xfbdc('0xc')][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x15e'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x4b95fa[_0xfbdc('0x15d')]));return{'code':0xc8,'result':_0xfbdc('0x15f')};}else{logger[_0xfbdc('0x30')](util['format'](_0xfbdc('0x160'),this[_0xfbdc('0xc')]['callerid'],_0x4b95fa[_0xfbdc('0x15d')]));this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0x160'),this[_0xfbdc('0xc')][_0xfbdc('0x3c')],_0x4b95fa[_0xfbdc('0x15d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xfbdc('0xe')][_0xfbdc('0x1c3')]=function(_0x43de3f){logger[_0xfbdc('0x30')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x43de3f['label']));var _0x2bc383=this['channel']['exec'](_0xfbdc('0x1c4'),[_0x43de3f[_0xfbdc('0x1c5')],_0x43de3f['options']]);if(_0x2bc383[_0xfbdc('0xab')]===-0x1){return _0x2bc383;}return this['channel'][_0xfbdc('0xaf')](util[_0xfbdc('0x2b')](_0xfbdc('0xcc'),_0xfbdc('0x1c4'),_0x43de3f[_0xfbdc('0x1c5')]));};AGIVertices['prototype'][_0xfbdc('0x1c6')]=function(_0x49a7e0){logger[_0xfbdc('0x30')](util[_0xfbdc('0x2b')](_0xfbdc('0x1c7'),_0x49a7e0[_0xfbdc('0xb5')]));if(!this[_0xfbdc('0x8b')](_0x49a7e0[_0xfbdc('0xda')])){return this[_0xfbdc('0xc')][_0xfbdc('0x56')](_0x49a7e0,_0xfbdc('0x1ad'));}var _0x1b277a=this[_0xfbdc('0xf')][_0xfbdc('0x76')](this,_0x49a7e0[_0xfbdc('0xda')]);if(!_0x1b277a){return this[_0xfbdc('0xc')]['error'](_0x49a7e0,_0xfbdc('0xdc'));}var _0x2ca9fb=this['channel'][_0xfbdc('0xf')](_0x1b277a);return{'code':0xc8,'result':_0x2ca9fb['extra']?_0x2ca9fb['extra']:'-'};};String[_0xfbdc('0xe')]['replaceAll']=function(_0x593686,_0x328185){return this[_0xfbdc('0xa8')](_0x593686)['join'](_0x328185);};module[_0xfbdc('0x1c8')]=AGIVertices; \ No newline at end of file +var _0x9338=['getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','open','error','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','headers','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','isArray','length','format','setVariable','split','extra','getAndSetVariable','result','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','DIAL','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','bot','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','no\x20key\x20configured','wav','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','intKey','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawHeaders','rawBody','getdigits','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk'];(function(_0x25a649,_0x261752){var _0x3c720d=function(_0x46d759){while(--_0x46d759){_0x25a649['push'](_0x25a649['shift']());}};_0x3c720d(++_0x261752);}(_0x9338,0x1b6));var _0x8933=function(_0x101dce,_0x3b887c){_0x101dce=_0x101dce-0x0;var _0x5a92bb=_0x9338[_0x101dce];return _0x5a92bb;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x8933('0x0'));var _=require(_0x8933('0x1'));var sh=require(_0x8933('0x2'));var odbc=require(_0x8933('0x3'))();var rs=require(_0x8933('0x4'));var moment=require(_0x8933('0x5'));var Mustache=require(_0x8933('0x6'));var rp=require(_0x8933('0x7'));var logger=require(_0x8933('0x8'))(_0x8933('0x9'));var config=require(_0x8933('0xa'));var scripts=require(_0x8933('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x8933('0xc'),_0x8933('0xd')];var verticesWithRetry=['menu',_0x8933('0xe'),'getsecretdigits'];var AGIVertices=function(_0x2347ac,_0x5026c2,_0x40982e){this['channel']=_0x2347ac;this['rpc']=_0x5026c2;this[_0x8933('0xf')]=_0x40982e;};AGIVertices[_0x8933('0x10')][_0x8933('0x11')]=function(_0x3b4f5c,_0x1b0f02){this[_0x8933('0x12')][_0x8933('0x13')](_0x3b4f5c)[_0x8933('0x14')](function(_0x49f4cb){_0x1b0f02(null,_0x49f4cb?_0x49f4cb[_0x8933('0x15')]:![]);})[_0x8933('0x16')](function(_0x4817c3){_0x1b0f02(_0x4817c3);});};AGIVertices[_0x8933('0x10')]['getVoiceQueue']=function(_0x1f015b,_0xd5fddd){this[_0x8933('0x12')][_0x8933('0x17')](_0x1f015b)[_0x8933('0x14')](function(_0x1ed614){_0xd5fddd(null,_0x1ed614?_0x1ed614[_0x8933('0x15')]:![]);})['catch'](function(_0x47f6f2){_0xd5fddd(_0x47f6f2);});};AGIVertices[_0x8933('0x10')][_0x8933('0x18')]=function(_0x1c41eb,_0x13a3ec){this[_0x8933('0x12')]['getSquareProjectById'](_0x1c41eb)[_0x8933('0x14')](function(_0x23287f){_0x13a3ec(null,_0x23287f?_0x23287f['name']:![]);})['catch'](function(_0x2a626b){_0x13a3ec(_0x2a626b);});};AGIVertices[_0x8933('0x10')][_0x8933('0x19')]=function(_0x57f5f0,_0x27c2ee){this['rpc'][_0x8933('0x1a')](_0x57f5f0)[_0x8933('0x14')](function(_0x164de5){_0x27c2ee(null,_0x164de5?_0x164de5[_0x8933('0x1b')]:![]);})['catch'](function(_0x327493){_0x27c2ee(_0x327493);});};AGIVertices[_0x8933('0x10')][_0x8933('0x1c')]=function(_0x32392d,_0x2e1dc6){this[_0x8933('0x12')]['getUserById'](_0x32392d)[_0x8933('0x14')](function(_0x2154b8){_0x2e1dc6(null,_0x2154b8?_0x2154b8['name']:![]);})[_0x8933('0x16')](function(_0x3b7c50){_0x2e1dc6(_0x3b7c50);});};AGIVertices[_0x8933('0x10')][_0x8933('0x1d')]=function(_0x4e63b1,_0x210a88){this['rpc'][_0x8933('0x1e')](_0x4e63b1)[_0x8933('0x14')](function(_0x740db4){_0x210a88(null,_0x740db4?_0x740db4[_0x8933('0x15')]:![]);})['catch'](function(_0x334e83){_0x210a88(_0x334e83);});};AGIVertices[_0x8933('0x10')][_0x8933('0x1f')]=function(_0x131daf,_0x3dd3e6){var _0x27ca78=this;this['rpc']['getSoundById'](_0x131daf)[_0x8933('0x14')](function(_0x521818){_0x3dd3e6(null,_0x521818?_0x27ca78['getSoundPath'](_0x521818[_0x8933('0x20')]):![]);})[_0x8933('0x16')](function(_0x4b7bbd){_0x3dd3e6(_0x4b7bbd);});};AGIVertices[_0x8933('0x10')][_0x8933('0x21')]=function(_0x1a240b,_0x239881){this[_0x8933('0x12')][_0x8933('0x22')](_0x1a240b)['then'](function(_0x33b37d){_0x239881(null,_0x33b37d?_0x33b37d:![]);})['catch'](function(_0x532376){_0x239881(_0x532376);});};AGIVertices[_0x8933('0x10')][_0x8933('0x23')]=function(_0x1b39f2,_0xff3dd6,_0x416077){this[_0x8933('0xf')]['sendMailMessage'](_0x1b39f2,_0xff3dd6)['then'](function(){_0x416077(null);})[_0x8933('0x16')](function(_0x3d6347){_0x416077(_0x3d6347);});};AGIVertices[_0x8933('0x10')][_0x8933('0x24')]=function(_0x29a5e7,_0x652623){this['rpc'][_0x8933('0x25')](_0x29a5e7)[_0x8933('0x14')](function(_0x38b38d){if(_0x38b38d){if(_0x38b38d[_0x8933('0x26')]){_0x652623(null,[_0x38b38d['interval']]);}else{_0x652623(null,_[_0x8933('0x27')](_0x38b38d[_0x8933('0x28')],_0x8933('0x29')));}}else{_0x652623(null,![]);}})[_0x8933('0x16')](function(_0x1dd24f){_0x652623(_0x1dd24f);});};AGIVertices[_0x8933('0x10')][_0x8933('0x2a')]=function(_0xbc5386){return util['format'](_0x8933('0x2b'),FILES_PATH,_0xbc5386);};AGIVertices[_0x8933('0x10')][_0x8933('0x2c')]=function(_0x341ee0,_0x381b2f,_0x1ba8c5){odbc[_0x8933('0x2d')](_0x341ee0,function(_0x4379ab){if(_0x4379ab){logger[_0x8933('0x2e')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x4379ab);_0x1ba8c5(_0x4379ab);}else{logger[_0x8933('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0x8933('0x30')](_0x381b2f,function(_0x30a796,_0xdd874){if(_0x30a796){logger[_0x8933('0x2f')](_0x8933('0x31'),_0x381b2f);_0x1ba8c5(_0x30a796);}else{logger[_0x8933('0x2f')](_0x8933('0x32'),_0x381b2f);odbc[_0x8933('0x33')](function(_0x41391b){if(_0x41391b){logger['error'](_0x8933('0x34'),_0x41391b);}_0x1ba8c5(null,_0xdd874);});}});}});};AGIVertices['prototype'][_0x8933('0x35')]=function(_0x3c957c,_0x5b45a9){this['rpc'][_0x8933('0x36')](_0x3c957c)[_0x8933('0x14')](function(_0x2eb110){_0x5b45a9(null,_0x2eb110?_0x2eb110:![]);})[_0x8933('0x16')](function(_0x124f0d){_0x5b45a9(_0x124f0d);});};AGIVertices[_0x8933('0x10')][_0x8933('0x37')]=function(_0x34af0c,_0x486b2c){this[_0x8933('0x12')][_0x8933('0x37')](_0x34af0c)[_0x8933('0x14')](function(_0x4588cd){_0x486b2c(null,_0x4588cd);})[_0x8933('0x16')](function(_0x177a68){_0x486b2c(_0x177a68);});};AGIVertices[_0x8933('0x10')][_0x8933('0x38')]=function(_0x49a898,_0x2a9490,_0x135adf){this[_0x8933('0x12')]['createSquareDetailsReport']({'uniqueid':this[_0x8933('0x39')][_0x8933('0x3a')],'node':_0x49a898['label'],'application':_0x49a898[_0x8933('0x3b')],'data':_0x2a9490||null,'project_name':this[_0x8933('0x39')][_0x8933('0x3c')],'callerid':this[_0x8933('0x39')][_0x8933('0x3d')]})[_0x8933('0x14')](function(_0x2a55d0){if(_0x135adf){_0x135adf(null,_0x2a55d0);}})[_0x8933('0x16')](function(_0x468fcb){if(_0x135adf){_0x135adf(_0x468fcb);}});};AGIVertices['prototype'][_0x8933('0x3e')]=function(_0x351229,_0x58af3d,_0xcce0fd,_0x389f35){this[_0x8933('0x12')]['createSquareRecording']({'uniqueid':this[_0x8933('0x39')]['uniqueid'],'callerid':this[_0x8933('0x39')][_0x8933('0x3d')],'calleridname':this[_0x8933('0x39')][_0x8933('0x3f')],'context':this[_0x8933('0x39')][_0x8933('0x40')],'extension':this['channel'][_0x8933('0x41')],'priority':this[_0x8933('0x39')][_0x8933('0x42')],'accountcode':this['channel'][_0x8933('0x43')],'dnid':this[_0x8933('0x39')][_0x8933('0x44')],'projectName':this[_0x8933('0x39')][_0x8933('0x3c')],'saveName':_0x58af3d,'filename':_0x351229[_0x8933('0x45')]||_0x58af3d,'savePath':_0xcce0fd})[_0x8933('0x14')](function(_0x3cd8d1){_0x389f35(null,_0x3cd8d1);})[_0x8933('0x16')](function(_0x575718){_0x389f35(_0x575718);});};AGIVertices[_0x8933('0x10')]['createSquareMessage']=function(_0x457fb6,_0x19bfae,_0xa97366,_0x5af059,_0x1c39f6){this[_0x8933('0x12')][_0x8933('0x46')]({'uniqueid':this[_0x8933('0x39')]['uniqueid'],'body':_0x457fb6,'direction':_0x19bfae,'providerName':_0xa97366,'providerResponse':_0x5af059})['then'](function(_0x5d7dc7){if(_0x1c39f6){_0x1c39f6(null,_0x5d7dc7);}})[_0x8933('0x16')](function(_0x50de87){if(_0x1c39f6){_0x1c39f6(_0x50de87);}});};AGIVertices[_0x8933('0x10')][_0x8933('0x47')]=function(_0xcbf578,_0x35cd3a){this[_0x8933('0x12')][_0x8933('0x47')]({'firstName':_[_0x8933('0x48')](_0xcbf578[_0x8933('0x15')])||_[_0x8933('0x49')](_0xcbf578[_0x8933('0x15')])?_0x8933('0x4a')+Math[_0x8933('0x4b')]():_0xcbf578[_0x8933('0x15')],'lastName':_[_0x8933('0x48')](_0xcbf578[_0x8933('0x4c')])||_['isNil'](_0xcbf578[_0x8933('0x4c')])?null:_0xcbf578[_0x8933('0x4c')],'phone':_0xcbf578[_0x8933('0x4d')],'ListId':_0xcbf578[_0x8933('0x4e')],'scheduledat':_0xcbf578[_0x8933('0x4f')],'callbackUniqueid':this[_0x8933('0x39')][_0x8933('0x3a')],'tags':_0x8933('0x50'),'description':_0x8933('0x51')+_0xcbf578[_0x8933('0x4f')][_0x8933('0x52')](),'priority':_0xcbf578[_0x8933('0x53')]})['then'](function(_0x31f8f6){_0x35cd3a(null,_0x31f8f6);})[_0x8933('0x16')](function(_0x231040){_0x35cd3a(_0x231040);});};AGIVertices[_0x8933('0x10')][_0x8933('0x54')]=function(_0x181006,_0x20c25e){this[_0x8933('0x12')][_0x8933('0x55')](_0x181006)[_0x8933('0x14')](function(_0x35bf12){_0x20c25e(null,_0x35bf12?_0x35bf12[_0x8933('0x15')]:![]);})[_0x8933('0x16')](function(_0x3893de){_0x20c25e(_0x3893de);});};AGIVertices[_0x8933('0x10')][_0x8933('0x56')]=function(_0x35cbd1,_0x50f87b,_0x55cf95){var _0x24c977={'role':_0x8933('0x57')};_0x24c977[_0x35cbd1]=this['channel']['callerid'];this[_0x8933('0x12')][_0x8933('0x56')](_0x24c977,_0x50f87b,this[_0x8933('0x39')]['uniqueid'])[_0x8933('0x14')](function(_0x5e63d7){_0x55cf95(null,_['isNil'](_0x5e63d7)?![]:!![]);})[_0x8933('0x16')](function(_0x4b93e4){logger[_0x8933('0x2e')](_0x4b93e4);_0x55cf95(null,![]);});};AGIVertices['prototype'][_0x8933('0x58')]=function(_0x4f92ed,_0x20268b){var _0x2067ce={'role':'agent'};_0x2067ce[_0x4f92ed]=this[_0x8933('0x39')]['callerid'];this[_0x8933('0x12')][_0x8933('0x58')](_0x2067ce)[_0x8933('0x14')](function(_0x21a1cd){_0x20268b(null,_[_0x8933('0x49')](_0x21a1cd)?![]:!![]);})[_0x8933('0x16')](function(_0x22f750){logger[_0x8933('0x2e')](_0x22f750);_0x20268b(null,![]);});};AGIVertices['prototype'][_0x8933('0x59')]=function(_0x242513,_0xa6b85e){var _0x2746c2={'role':_0x8933('0x57')};_0x2746c2[_0x242513]=this['channel'][_0x8933('0x3d')];this[_0x8933('0x12')][_0x8933('0x59')](_0x2746c2)[_0x8933('0x14')](function(_0x3435ea){_0xa6b85e(null,_['isNil'](_0x3435ea)?![]:!![]);})[_0x8933('0x16')](function(_0x3605d2){logger[_0x8933('0x2e')](_0x3605d2);_0xa6b85e(null,![]);});};AGIVertices[_0x8933('0x10')][_0x8933('0x5a')]=function(_0x1ba61b,_0x295ae9){var _0x5d4bc6={'role':_0x8933('0x57')};_0x5d4bc6[_0x1ba61b]=this['channel'][_0x8933('0x3d')];var _0x57e499=_0x1ba61b!=_0x8933('0x5b')?util['format']('%s/%s@from-sip/n',_0x8933('0x5c'),this['channel'][_0x8933('0x3d')]):undefined;this[_0x8933('0x12')][_0x8933('0x5a')](_0x5d4bc6,_0x57e499)[_0x8933('0x14')](function(_0x5e2fb7){_0x295ae9(null,_[_0x8933('0x49')](_0x5e2fb7)?![]:!![]);})[_0x8933('0x16')](function(_0xf92a34){logger['error'](_0xf92a34);_0x295ae9(null,![]);});};AGIVertices[_0x8933('0x10')][_0x8933('0x5d')]=function(_0x2b50cc,_0x496762){sh[_0x8933('0x5e')](_[_0x8933('0x5f')](_0x2b50cc),function(_0x3222ce,_0x4e6d81){var _0x312b94=_0x4e6d81[_0x8933('0x60')](/(\r\n|\n|\r)/gm,'');_0x496762(null,_0x312b94);});};AGIVertices[_0x8933('0x10')][_0x8933('0x61')]=function(_0x28f0e9,_0x2cf462){scripts[_0x8933('0x61')](_0x28f0e9['apiKey'],_0x28f0e9['google_cloud_tts_text_type']||_0x8933('0x62'),_0x28f0e9[_0x8933('0x62')],_0x28f0e9[_0x8933('0x63')]||'en-US',_0x28f0e9[_0x8933('0x64')]||'MALE',_0x28f0e9[_0x8933('0x65')]||_0x8933('0x66'))['then'](function(_0x25d0a3){_0x2cf462(null,_0x25d0a3);})['catch'](function(_0x40e0ab){_0x2cf462(_0x40e0ab);});};AGIVertices[_0x8933('0x10')][_0x8933('0x67')]=function(_0x132b00,_0x1d2feb){scripts['googleTTS'](_0x132b00[_0x8933('0x62')],_0x132b00[_0x8933('0x68')]||'en',0x1)[_0x8933('0x14')](function(_0x1d0b60){_0x1d2feb(null,_0x1d0b60);})[_0x8933('0x16')](function(_0x3de698){_0x1d2feb(_0x3de698);});};AGIVertices[_0x8933('0x10')][_0x8933('0x69')]=function(_0x24d41b,_0x51e579){var _0x3303da={'uri':_0x24d41b[_0x8933('0x6a')],'method':_0x24d41b[_0x8933('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x24d41b[_0x8933('0x6c')])===_0x8933('0x6d')&&parseInt(_0x24d41b['timeout'])>=0x1?parseInt(_0x24d41b['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x8933('0x6e')]([_0x8933('0x6f'),'PUT'],_0x3303da['method'][_0x8933('0x70')]())){try{_0x3303da['body']=_0x24d41b[_0x8933('0xd')]?JSON['parse'](_0x24d41b[_0x8933('0xd')]):{};}catch(_0x45f8d4){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x45f8d4);}}try{_0x3303da['headers']=_0x24d41b[_0x8933('0xc')]?JSON[_0x8933('0x71')](_0x24d41b[_0x8933('0xc')]):{};}catch(_0x5d1195){logger[_0x8933('0x2e')](_0x8933('0x72'),_0x5d1195);}if(_0x24d41b[_0x8933('0x73')]){try{var _0x5c97dc=require(_0x24d41b['computedVariables'])['sync'](this,_0x3303da);_0x3303da[_0x8933('0x74')]=Mustache[_0x8933('0x75')](_0x24d41b[_0x8933('0x6a')],_0x5c97dc,{},['$$','$$']);if(_0x3303da[_0x8933('0x76')]){_0x3303da[_0x8933('0x76')]=JSON[_0x8933('0x71')](Mustache[_0x8933('0x75')](JSON[_0x8933('0x77')](_0x3303da[_0x8933('0x76')]),_0x5c97dc,{},['$$','$$']));}if(_0x3303da['body']){_0x3303da[_0x8933('0x78')]=JSON[_0x8933('0x71')](Mustache[_0x8933('0x75')](JSON['stringify'](_0x3303da[_0x8933('0x78')]),_0x5c97dc,{},['$$','$$']));}}catch(_0x551cd5){logger[_0x8933('0x2e')](_0x8933('0x79'),_0x551cd5);}}rp(_0x3303da)[_0x8933('0x14')](function(_0x216d71){var _0x3f0453={'statusCode':_0x216d71[_0x8933('0x7a')]||0xc8,'statusMessage':_0x216d71[_0x8933('0x7b')]||'OK','headers':_0x216d71['headers']||{},'body':_0x216d71[_0x8933('0x78')]||{}};_0x51e579(null,_0x3f0453);})['catch'](function(_0x4e1a23){var _0x13fd24={'statusCode':_0x4e1a23['statusCode']||0x1f4,'statusMessage':_0x4e1a23['message']||_0x8933('0x7c'),'headers':_0x4e1a23[_0x8933('0x7d')]['headers']||{},'body':_0x4e1a23[_0x8933('0x7d')][_0x8933('0x78')]||{}};_0x51e579(null,_0x13fd24);});};AGIVertices[_0x8933('0x10')][_0x8933('0x7e')]=function(_0x5d42bc,_0x469ad5){scripts[_0x8933('0x7e')](this['channel'][_0x8933('0x3a')],_0x5d42bc[_0x8933('0x7f')],_0x5d42bc[_0x8933('0x62')],_0x5d42bc[_0x8933('0x80')]||'en')['then'](function(_0x3b53ef){_0x469ad5(null,_0x3b53ef);})['catch'](function(_0x24670f){_0x469ad5(_0x24670f);});};AGIVertices[_0x8933('0x10')][_0x8933('0x81')]=function(_0x1a5a87,_0x42afce){scripts[_0x8933('0x81')](this['channel'][_0x8933('0x3a')],_0x1a5a87[_0x8933('0x82')],_0x1a5a87[_0x8933('0x83')],_0x1a5a87['private_key'],_0x1a5a87[_0x8933('0x62')],_0x1a5a87[_0x8933('0x84')]||'en')[_0x8933('0x14')](function(_0x5458b4){_0x42afce(null,_0x5458b4);})['catch'](function(_0xb62206){_0x42afce(_0xb62206);});};AGIVertices['prototype'][_0x8933('0x85')]=function(_0x39de48,_0x3f78c3){scripts[_0x8933('0x85')](this[_0x8933('0x39')],_0x39de48)[_0x8933('0x14')](function(_0x401781){_0x3f78c3(null,_0x401781);})[_0x8933('0x16')](function(_0x295b1e){_0x3f78c3(_0x295b1e);});};AGIVertices[_0x8933('0x10')][_0x8933('0x86')]=function(_0x480d30,_0x293d67){scripts[_0x8933('0x86')](_0x480d30[_0x8933('0x7f')],_0x480d30['text'],_0x480d30[_0x8933('0x87')]||_0x8933('0x88'),_0x480d30['speed'])[_0x8933('0x14')](function(_0x4908a0){_0x293d67(null,_0x4908a0);})[_0x8933('0x16')](function(_0x1db716){_0x293d67(_0x1db716);});};AGIVertices[_0x8933('0x10')][_0x8933('0x89')]=function(_0x493fda,_0x5634a0,_0x39880f){scripts[_0x8933('0x89')](_0x5634a0,_0x493fda['key'],_0x493fda[_0x8933('0x8a')]||'en-US',this[_0x8933('0x8b')](_0x493fda[_0x8933('0x8c')])?_0x493fda[_0x8933('0x8c')]:undefined)[_0x8933('0x14')](function(_0x562bc4){_0x39880f(null,_0x562bc4);})[_0x8933('0x16')](function(_0x16c4dd){_0x39880f(_0x16c4dd);});};AGIVertices[_0x8933('0x10')][_0x8933('0x8d')]=function(_0x19f3f9,_0x5e7861){scripts[_0x8933('0x8d')](_0x19f3f9['aws_access_key_id'],_0x19f3f9[_0x8933('0x8e')],_0x19f3f9[_0x8933('0x8f')],_0x19f3f9[_0x8933('0x90')]||_0x8933('0x91'),_0x19f3f9['text'],_0x19f3f9['aws_text_type']||_0x8933('0x62'))[_0x8933('0x14')](function(_0x5723ee){_0x5e7861(null,_0x5723ee);})[_0x8933('0x16')](function(_0x406f9f){_0x5e7861(_0x406f9f);});};AGIVertices[_0x8933('0x10')]['awsLex']=function(_0x2cfb42,_0x2b909c){scripts[_0x8933('0x92')](this['channel'][_0x8933('0x3a')],_0x2cfb42['aws_access_key_id'],_0x2cfb42[_0x8933('0x8e')],_0x2cfb42[_0x8933('0x93')],_0x2cfb42[_0x8933('0x62')],_0x2cfb42[_0x8933('0x94')])[_0x8933('0x14')](function(_0x5ca8c6){_0x2b909c(null,_0x5ca8c6);})[_0x8933('0x16')](function(_0x4bec1c){_0x2b909c(_0x4bec1c);});};AGIVertices[_0x8933('0x10')]['googleASR']=function(_0x1169fa,_0x4315ee,_0xf232dc){scripts[_0x8933('0x95')](_0x4315ee,_0x1169fa[_0x8933('0x7f')],_0x1169fa[_0x8933('0x96')]||_0x8933('0x88'))[_0x8933('0x14')](function(_0x53533e){_0xf232dc(null,_0x53533e);})[_0x8933('0x16')](function(_0x6b3817){_0xf232dc(_0x6b3817);});};AGIVertices['prototype'][_0x8933('0x97')]=function(_0x212a01,_0x41a5c5,_0x19b3ff){scripts[_0x8933('0x97')](_0x41a5c5,_0x212a01['appid'],_0x212a01[_0x8933('0x98')],_0x212a01['uri'])[_0x8933('0x14')](function(_0x2f741c){_0x19b3ff(null,_0x2f741c);})[_0x8933('0x16')](function(_0x367f72){_0x19b3ff(_0x367f72);});};AGIVertices[_0x8933('0x10')]['clear']=function(_0x109ed4){var _0x163b79=_[_0x8933('0x6e')](verticesWithRetry,_0x109ed4[_0x8933('0x3b')])?_0x109ed4:_[_0x8933('0x99')](_0x109ed4);for(var _0x3e07bf in _0x163b79){if(_0x163b79[_0x8933('0x9a')](_0x3e07bf)){if(_0x163b79[_0x3e07bf]&&_[_0x8933('0x9b')](_0x163b79[_0x3e07bf])){if(_[_0x8933('0x6e')](recursiveMapAttributes,_0x3e07bf)){_0x163b79[_0x3e07bf]=this[_0x8933('0x9c')](_0x163b79[_0x3e07bf]);}else{_0x163b79[_0x3e07bf]=this[_0x8933('0x9d')](_0x163b79[_0x3e07bf]);}}}}return _0x163b79;};AGIVertices['prototype'][_0x8933('0x9e')]=function(_0x4ca5ff){for(var _0x30942a in _0x4ca5ff){if(_0x4ca5ff['hasOwnProperty'](_0x30942a)){if(_[_0x8933('0x9f')](_0x4ca5ff[_0x30942a])){this['recursiveNodeIndex'](_0x4ca5ff[_0x30942a]);}else if(_['isArray'](_0x4ca5ff[_0x30942a])){for(var _0x5147be=0x0;_0x5147be<_0x4ca5ff[_0x30942a]['length'];_0x5147be++){this[_0x8933('0x9e')](_0x4ca5ff[_0x30942a][_0x5147be]);}}else if(_['isString'](_0x4ca5ff[_0x30942a])){_0x4ca5ff[_0x30942a]=this[_0x8933('0x9d')](_0x4ca5ff[_0x30942a]);}}}};AGIVertices[_0x8933('0x10')][_0x8933('0xa0')]=function(_0x21819b,_0x20e063){for(var _0x3b792c in _0x21819b){if(_0x21819b['hasOwnProperty'](_0x3b792c)){if(_['isPlainObject'](_0x21819b[_0x3b792c])){if(!_['isEmpty'](_0x21819b[_0x3b792c])){this[_0x8933('0xa0')](_0x21819b[_0x3b792c],util['format'](_0x8933('0xa1'),_0x20e063,_0x3b792c));}}else if(_[_0x8933('0xa2')](_0x21819b[_0x3b792c])){for(var _0x2754d5=0x0;_0x2754d5<_0x21819b[_0x3b792c][_0x8933('0xa3')];_0x2754d5++){this[_0x8933('0xa0')](_0x21819b[_0x3b792c][_0x2754d5],util[_0x8933('0xa4')](_0x8933('0xa1'),_0x20e063,_0x3b792c+'['+_0x2754d5+']'));}}else{if(!_['isNil'](_0x21819b[_0x3b792c])){this[_0x8933('0x39')][_0x8933('0xa5')](util[_0x8933('0xa4')](_0x8933('0xa1'),_0x20e063,_0x3b792c),_0x21819b[_0x3b792c]);}}}}};AGIVertices[_0x8933('0x10')][_0x8933('0x9c')]=function(_0x233400){try{var _0x3862db=JSON[_0x8933('0x71')](_0x233400);this[_0x8933('0x9e')](_0x3862db);return JSON['stringify'](_0x3862db);}catch(_0x3cb13e){return this['replaceAllVariables'](_0x233400);}};AGIVertices[_0x8933('0x10')]['replaceAllVariables']=function(_0x205123){var _0x10d8f8=_0x205123[_0x8933('0xa6')]('{');for(var _0x9f0229=0x1;_0x9f0229<_0x10d8f8['length'];_0x9f0229+=0x1){var _0x388e8b=_0x10d8f8[_0x9f0229][_0x8933('0xa6')]('}');if(_0x388e8b['length']>0x1){_0x205123=_0x205123['replaceAll']('{'+_0x388e8b[0x0]+'}',this[_0x8933('0x39')][_0x8933('0x11')](_0x388e8b[0x0])[_0x8933('0xa7')]||_0x388e8b[0x0]);}}if(_0x10d8f8['length']===0x1){return _0x205123[_0x8933('0x52')]();}return this[_0x8933('0x9d')](_0x205123);};AGIVertices[_0x8933('0x10')][_0x8933('0xa8')]=function(_0x17531c,_0x510098){var _0x58de72=this['channel']['getVariable'](_0x17531c);if(_0x58de72[_0x8933('0xa9')]===-0x1){return _0x58de72;}logger[_0x8933('0x2f')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x510098,_0x58de72[_0x8933('0xa7')]));return this[_0x8933('0x39')][_0x8933('0xa5')](_0x510098,_0x58de72['extra']);};AGIVertices[_0x8933('0x10')][_0x8933('0x8b')]=function(_0x40a628){return _0x40a628&&_0x40a628!=='0'&&_0x40a628!=='-1'&&_0x40a628!=='';};AGIVertices['prototype'][_0x8933('0xaa')]=function(_0x2c5a91){this[_0x8933('0x38')][_0x8933('0xab')](this,_0x2c5a91,'-');_0x2c5a91[_0x8933('0xac')]=_0x2c5a91[_0x8933('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8933('0x10')][_0x8933('0xad')]=function(_0x2285d0){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0xae'),_0x2285d0['label']));if(!this[_0x8933('0x8b')](_0x2285d0['text'])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xb0'));}var _0xeebed='\x22'+_0x2285d0[_0x8933('0x62')]+'\x22';if(this[_0x8933('0x8b')](_0x2285d0[_0x8933('0x7d')])){_0xeebed+=','+_0x2285d0[_0x8933('0x7d')];}var _0x10dbae=this[_0x8933('0x39')][_0x8933('0x5e')](_0x8933('0xb1'),_0xeebed);if(_0x10dbae[_0x8933('0xa9')]===-0x1){return _0x10dbae;}return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')]('Executed\x20command\x20MRCPSynth\x20%s',_0xeebed));};AGIVertices['prototype']['mrcprecog']=function(_0x5b7279){logger['info'](util[_0x8933('0xa4')](_0x8933('0xb2'),_0x5b7279[_0x8933('0xb3')]));if(!this['isConfigured'](_0x5b7279[_0x8933('0xb4')])){return this[_0x8933('0x39')][_0x8933('0xaf')]('no\x20grammar\x20configured');}var _0x567fb8=_0x5b7279[_0x8933('0xb4')];if(this[_0x8933('0x8b')](_0x5b7279[_0x8933('0x7d')])){_0x567fb8+=','+_0x5b7279[_0x8933('0x7d')];}var _0x2af76f=this[_0x8933('0x39')][_0x8933('0x5e')](_0x8933('0xb5'),_0x567fb8);if(_0x2af76f['result']===-0x1){return _0x2af76f;}var _0x487997=this[_0x8933('0xa8')]('RECOG_CONFIDENCE()',_0x8933('0xb6'));if(_0x487997[_0x8933('0xa9')]===-0x1){return _0x487997;}var _0x26340b=this[_0x8933('0xa8')]('RECOG_INPUT()',_0x8933('0xb7'));if(_0x26340b[_0x8933('0xa9')]===-0x1){return _0x26340b;}var _0x135421=this[_0x8933('0xa8')]('RECOG_INSTANCE()',_0x8933('0xb8'));if(_0x135421[_0x8933('0xa9')]===-0x1){return _0x135421;}return this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')](_0x8933('0xb9'),_0x567fb8));};AGIVertices[_0x8933('0x10')]['agi']=function(_0x349b98){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0xba'),_0x349b98[_0x8933('0xb3')]));return this[_0x8933('0x39')][_0x8933('0x9')]([_0x349b98[_0x8933('0xbb')],_0x349b98[_0x8933('0xbc')]]);};AGIVertices['prototype'][_0x8933('0xbd')]=function(_0x4849cb){logger[_0x8933('0x2f')](util['format'](_0x8933('0xbe'),_0x4849cb['label']));if(this['isConfigured'](_0x4849cb['timeout'])){logger['info'](util[_0x8933('0xa4')](_0x8933('0xbf'),_0x4849cb[_0x8933('0x6c')]));var _0x3f86fb=this[_0x8933('0x39')]['wait'](_0x4849cb[_0x8933('0x6c')]);if(_0x3f86fb[_0x8933('0xa9')]===-0x1){return _0x3f86fb;}}return this[_0x8933('0x39')][_0x8933('0xbd')]();};AGIVertices[_0x8933('0x10')][_0x8933('0x50')]=function(_0xbc2627){logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0xbc2627[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0xbc2627[_0x8933('0x4e')])){return this[_0x8933('0x39')]['error'](_0xbc2627,_0x8933('0xc0'));}_0xbc2627[_0x8933('0x4f')]=moment();if(this[_0x8933('0x8b')](_0xbc2627[_0x8933('0xc1')])){_0xbc2627[_0x8933('0x4f')]=moment()[_0x8933('0xc2')](_0xbc2627[_0x8933('0xc1')],_0x8933('0xc3'));}if(!this[_0x8933('0x8b')](_0xbc2627[_0x8933('0x53')])){_0xbc2627[_0x8933('0x53')]=0x2;}this['createCmContact'][_0x8933('0xab')](this,_0xbc2627);return this[_0x8933('0x39')][_0x8933('0xaf')](util['format'](_0x8933('0xc4'),_0xbc2627[_0x8933('0x4d')],_0xbc2627[_0x8933('0x4e')],_0xbc2627[_0x8933('0x4f')]));};AGIVertices[_0x8933('0x10')][_0x8933('0xc5')]=function(_0x327581){logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x327581['label']));var _0x34a53c=this[_0x8933('0x39')]['exec'](_0x327581[_0x8933('0xc6')],_0x327581[_0x8933('0x7d')]);if(_0x34a53c['result']===-0x1){return _0x34a53c;}return this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')]('Executed\x20command\x20%s\x20%s',_0x327581[_0x8933('0xc6')],_0x327581[_0x8933('0x7d')]));};AGIVertices[_0x8933('0x10')][_0x8933('0xc7')]=function(_0x2a2a78){logger[_0x8933('0x2f')](util['format'](_0x8933('0xc8'),_0x2a2a78[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x2a2a78['text'])){return this[_0x8933('0x39')]['noop'](_0x8933('0xb0'));}var _0x1f60c9='\x22'+_0x2a2a78[_0x8933('0x62')]+'\x22';if(this[_0x8933('0x8b')](_0x2a2a78['options'])){_0x1f60c9+=','+_0x2a2a78['options'];}var _0x4ea487=this[_0x8933('0x39')][_0x8933('0x5e')]('MRCPSynth',_0x1f60c9);if(_0x4ea487['result']===-0x1){return _0x4ea487;}return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0xc9'),_0x1f60c9));};AGIVertices[_0x8933('0x10')][_0x8933('0xca')]=function(_0x32bbb9){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0xcb'),_0x32bbb9['label']));if(!this['isConfigured'](_0x32bbb9[_0x8933('0x62')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xb0'));}var _0x26b56d='\x22'+_0x32bbb9[_0x8933('0x62')]+'\x22';if(this['isConfigured'](_0x32bbb9[_0x8933('0x7d')])){_0x26b56d+=','+_0x32bbb9[_0x8933('0x7d')];}var _0x133989=this['channel'][_0x8933('0x5e')](_0x8933('0xb1'),_0x26b56d);if(_0x133989[_0x8933('0xa9')]===-0x1){return _0x133989;}return this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0xc9'),_0x26b56d));};AGIVertices['prototype']['lumenvoxasr']=function(_0xdd0e9e){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0xcc'),_0xdd0e9e['label']));if(!this[_0x8933('0x8b')](_0xdd0e9e[_0x8933('0xb4')])){return this['channel'][_0x8933('0xaf')]('no\x20grammar\x20configured');}var _0x26b1e2=_0xdd0e9e[_0x8933('0xb4')];if(this[_0x8933('0x8b')](_0xdd0e9e['options'])){_0x26b1e2+=','+_0xdd0e9e[_0x8933('0x7d')];}var _0x1a3cca=this[_0x8933('0x39')][_0x8933('0x5e')](_0x8933('0xb5'),_0x26b1e2);if(_0x1a3cca['result']===-0x1){return _0x1a3cca;}var _0x2a6bee=this[_0x8933('0xa8')](_0x8933('0xcd'),_0x8933('0xce'));if(_0x2a6bee['result']===-0x1){return _0x2a6bee;}var _0x558271=this[_0x8933('0xa8')]('RECOG_INPUT()',_0x8933('0xcf'));if(_0x558271[_0x8933('0xa9')]===-0x1){return _0x558271;}var _0x50337c=this[_0x8933('0xa8')](_0x8933('0xd0'),_0x8933('0xd1'));if(_0x50337c[_0x8933('0xa9')]===-0x1){return _0x50337c;}return this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0xb9'),_0x26b1e2));};AGIVertices[_0x8933('0x10')]['sestekasr']=function(_0x5015fb){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0xd2'),_0x5015fb[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x5015fb['grammar'])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xd3'));}var _0x1e4e2a=_0x5015fb['grammar'];if(this[_0x8933('0x8b')](_0x5015fb[_0x8933('0x7d')])){_0x1e4e2a+=','+_0x5015fb[_0x8933('0x7d')];}var _0x3cd24e=this[_0x8933('0x39')][_0x8933('0x5e')](_0x8933('0xb5'),_0x1e4e2a);if(_0x3cd24e[_0x8933('0xa9')]===-0x1){return _0x3cd24e;}var _0x293453=this[_0x8933('0xa8')]('RECOG_CONFIDENCE()',_0x8933('0xd4'));if(_0x293453['result']===-0x1){return _0x293453;}var _0x480ca8=this[_0x8933('0xa8')](_0x8933('0xd5'),'SESTEK_ASR_TRANSCRIPT');if(_0x480ca8[_0x8933('0xa9')]===-0x1){return _0x480ca8;}var _0x5149dc=this[_0x8933('0xa8')](_0x8933('0xd0'),'SESTEK_ASR_INSTANCE');if(_0x5149dc['result']===-0x1){return _0x5149dc;}return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1e4e2a));};AGIVertices[_0x8933('0x10')]['database']=function(_0x43f80f){logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x43f80f['label']));if(!this[_0x8933('0x8b')](_0x43f80f['odbc_id'])){return this['channel']['error'](_0x43f80f,_0x8933('0xd6'));}var _0x535a64=this['getSquareOdbc']['sync'](this,_0x43f80f[_0x8933('0xd7')]);if(!_0x535a64){return this['channel'][_0x8933('0x2e')](_0x43f80f,_0x8933('0xd8'));}if(!this['isConfigured'](_0x43f80f['query'])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x43f80f,_0x8933('0xd9'));}var _0x139499=_0x43f80f['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0xda'),_0x139499));var _0x1a04d9=this[_0x8933('0x2c')][_0x8933('0xab')](this,_0x535a64,_0x139499);this[_0x8933('0x38')][_0x8933('0xab')](this,_0x43f80f,_0x139499);if(!this[_0x8933('0x8b')](_0x43f80f['variable_id'])){return this['channel'][_0x8933('0xaf')](_0x8933('0xdb'));}var _0x3d6ea6=this[_0x8933('0x11')][_0x8933('0xab')](this,_0x43f80f[_0x8933('0xdc')]);if(!_0x3d6ea6){return this[_0x8933('0x39')]['error'](_0x43f80f,_0x8933('0xdd'));}var _0x5dc166=this;_0x1a04d9[_0x8933('0xde')](function(_0x9b9b6c,_0x5ccf30){Object['keys'](_0x9b9b6c)[_0x8933('0xde')](function(_0x162e5b){_0x5dc166[_0x8933('0x39')][_0x8933('0xa5')](util[_0x8933('0xa4')]('%s[%s][%s]',_0x3d6ea6,_0x5ccf30,_0x162e5b),_0x9b9b6c[_0x162e5b]);});});this['channel'][_0x8933('0xa5')](util[_0x8933('0xa4')](_0x8933('0xdf'),_0x3d6ea6),_0x1a04d9[_0x8933('0xa3')]);return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0xe0'),_0x3d6ea6));};AGIVertices['prototype'][_0x8933('0xe1')]=function(_0x16fa95){logger[_0x8933('0xe2')](util[_0x8933('0xa4')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x16fa95[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x16fa95[_0x8933('0xe3')])){return this['channel'][_0x8933('0x2e')](_0x16fa95,_0x8933('0xe4'));}var _0x18fa01=this[_0x8933('0x1c')][_0x8933('0xab')](this,_0x16fa95['sip_id']);if(!_0x18fa01){return this['channel']['error'](_0x16fa95,_0x8933('0xe5'));}var _0x92f9e9=this['channel'][_0x8933('0x5e')]('DIAL',[util[_0x8933('0xa4')](_0x8933('0xe6'),_0x18fa01),_0x16fa95[_0x8933('0x6c')],_0x16fa95[_0x8933('0xe7')],_0x16fa95['url']]);if(_0x92f9e9[_0x8933('0xa9')]===-0x1){return _0x92f9e9;}return this[_0x8933('0x39')][_0x8933('0xaf')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x8933('0x10')]['dialogflow']=function(_0x3a03a9){logger[_0x8933('0x2f')](util['format'](_0x8933('0xe8'),_0x3a03a9[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x3a03a9[_0x8933('0x7f')])){return this[_0x8933('0x39')][_0x8933('0xaf')]('no\x20key\x20configured');}if(!this[_0x8933('0x8b')](_0x3a03a9[_0x8933('0x62')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xb0'));}this[_0x8933('0x39')]['bot']=!![];this[_0x8933('0x38')](_0x3a03a9);this['createSquareMessage'](_0x3a03a9[_0x8933('0x62')],'in','','');this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0xe9'),_0x3a03a9[_0x8933('0x62')]));var _0x3b044a=this[_0x8933('0x7e')][_0x8933('0xab')](this,_0x3a03a9);if(_0x3b044a){for(var _0x23857b in _0x3b044a){if(_0x3b044a[_0x8933('0x9a')](_0x23857b)){this[_0x8933('0x39')][_0x8933('0xa5')](util['format'](_0x8933('0xea'),_0x23857b[_0x8933('0x70')]()),_0x3b044a[_0x23857b]);}}this[_0x8933('0x46')](_0x3b044a[_0x8933('0xeb')],'out',_0x8933('0xec'),'');return this['channel']['noop'](util[_0x8933('0xa4')](_0x8933('0xed'),_0x3b044a[_0x8933('0xeb')]));}return this['channel'][_0x8933('0x2e')](_0x3a03a9,_0x8933('0xee'));};AGIVertices[_0x8933('0x10')][_0x8933('0xef')]=function(_0x4b152d){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0xf0'),_0x4b152d['label']));if(!this['isConfigured'](_0x4b152d[_0x8933('0x82')])){return this[_0x8933('0x39')][_0x8933('0xaf')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x4b152d[_0x8933('0x83')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xf1'));}if(!this[_0x8933('0x8b')](_0x4b152d[_0x8933('0xf2')])){return this[_0x8933('0x39')][_0x8933('0xaf')]('no\x20private_key\x20configured');}if(!this[_0x8933('0x8b')](_0x4b152d[_0x8933('0x84')])){return this[_0x8933('0x39')]['noop'](_0x8933('0xf3'));}if(!this['isConfigured'](_0x4b152d[_0x8933('0x62')])){return this[_0x8933('0x39')]['noop'](_0x8933('0xb0'));}this[_0x8933('0x39')]['bot']=!![];this[_0x8933('0x38')](_0x4b152d);this[_0x8933('0x46')](_0x4b152d[_0x8933('0x62')],'in','','');this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')]('Trying\x20DialogflowV2:\x20%s',_0x4b152d[_0x8933('0x62')]));var _0x2652e3=this[_0x8933('0x81')][_0x8933('0xab')](this,_0x4b152d);if(_0x2652e3){for(var _0x1dacea in _0x2652e3){if(_0x2652e3['hasOwnProperty'](_0x1dacea)){if(_0x1dacea!==_0x8933('0xf4')){this['channel']['setVariable'](util[_0x8933('0xa4')](_0x8933('0xea'),_0x1dacea[_0x8933('0x70')]()),_0x2652e3[_0x1dacea]);}}}this['createSquareMessage'](_0x2652e3[_0x8933('0xeb')],_0x8933('0xf5'),'dialogflowV2',_0x2652e3[_0x8933('0xf4')]);return this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')](_0x8933('0xf6'),_0x2652e3['speech']));}return this[_0x8933('0x39')][_0x8933('0x2e')](_0x4b152d,_0x8933('0xf7'));};AGIVertices[_0x8933('0x10')]['sesteknda']=function(_0x25846a){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0xf8'),_0x25846a['label']));if(!this[_0x8933('0x8b')](_0x25846a[_0x8933('0xf9')])){return this[_0x8933('0x39')]['noop'](_0x8933('0xfa'));}if(!this[_0x8933('0x8b')](_0x25846a[_0x8933('0xfb')])){return this[_0x8933('0x39')]['noop'](_0x8933('0xfc'));}if(!this['isConfigured'](_0x25846a[_0x8933('0xfd')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xfe'));}if(!this[_0x8933('0x8b')](_0x25846a[_0x8933('0xff')])){return this['channel'][_0x8933('0xaf')]('no\x20text\x20configured');}this[_0x8933('0x39')]['bot']=!![];this[_0x8933('0x38')](_0x25846a);this[_0x8933('0x46')](_0x25846a[_0x8933('0x62')],'in','','');this['channel']['noop'](util[_0x8933('0xa4')]('Trying\x20SestekNDA:\x20%s',_0x25846a[_0x8933('0x62')]));var _0xbb4a6e=this[_0x8933('0x85')][_0x8933('0xab')](this,_0x25846a);if(_0xbb4a6e){for(var _0x13900d in _0xbb4a6e){if(_0xbb4a6e[_0x8933('0x9a')](_0x13900d)){this[_0x8933('0x39')]['setVariable'](util[_0x8933('0xa4')]('SESTEK_NDA_%s',_0x13900d[_0x8933('0x70')]()),_0xbb4a6e[_0x13900d]);}}this[_0x8933('0x46')](_0xbb4a6e[_0x8933('0xeb')],_0x8933('0xf5'),_0x8933('0x100'),'');if(_0xbb4a6e[_0x8933('0x101')]){this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')](_0x8933('0x102'),_0xbb4a6e['audiofile']));var _0x2b9887=this['channel'][_0x8933('0x103')](_0xbb4a6e['audiofile']);try{fs[_0x8933('0x104')](_0xbb4a6e[_0x8933('0x101')]+_0x8933('0x105'));}catch(_0x1932a5){logger[_0x8933('0x2e')](_0x1932a5);}return _0x2b9887;}else{return this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')](_0x8933('0x106'),_0xbb4a6e[_0x8933('0xeb')]));}}return this[_0x8933('0x39')][_0x8933('0x2e')](_0x25846a,_0x8933('0x107'));};AGIVertices['prototype'][_0x8933('0x108')]=function(_0x142d13){logger[_0x8933('0x2f')](util['format'](_0x8933('0x109'),_0x142d13['label']));return this[_0x8933('0x39')]['noop']('end');};AGIVertices['prototype'][_0x8933('0x10a')]=function(_0x24dbb5){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x10b'),_0x24dbb5[_0x8933('0xb3')]));var _0x55fc6d='';if(_0x24dbb5[_0x8933('0x10c')]){if(!this[_0x8933('0x8b')](_0x24dbb5[_0x8933('0x10c')])){return this['channel'][_0x8933('0x2e')](_0x24dbb5,_0x8933('0x10d'));}else{var _0x2b1151=parseInt(_0x24dbb5[_0x8933('0x10c')],0xa);if(isNaN(_0x2b1151)){_0x55fc6d=_0x24dbb5[_0x8933('0x10c')];}else{_0x55fc6d=this['getTrunk'][_0x8933('0xab')](this,_0x24dbb5['trunk_id']);if(!_0x55fc6d){return this['channel'][_0x8933('0x2e')](_0x24dbb5,_0x8933('0x10e'));}}}}else if(_0x24dbb5['trunk_name']){_0x55fc6d=_0x24dbb5['trunk_name'];}else{return this[_0x8933('0x39')][_0x8933('0x2e')](_0x24dbb5,_0x8933('0x10d'));}var _0x18c689=this[_0x8933('0x39')]['exec'](_0x8933('0x10f'),[util['format'](_0x8933('0x110'),_0x55fc6d,_0x24dbb5['phone']),_0x24dbb5['timeout'],_0x24dbb5[_0x8933('0xe7')],_0x24dbb5[_0x8933('0x6a')]]);if(_0x18c689[_0x8933('0xa9')]===-0x1){return _0x18c689;}return this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x111'),'DIAL'));};AGIVertices['prototype']['finally']=function(_0xb542e2){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x112'),_0xb542e2[_0x8933('0xb3')]));return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x113'));};AGIVertices[_0x8933('0x10')]['getdigits']=function(_0x52ebef){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x114'),_0x52ebef[_0x8933('0xb3')]));if(_0x52ebef[_0x8933('0xac')]===0x0){return this[_0x8933('0xaa')](_0x52ebef);}_0x52ebef[_0x8933('0xac')]-=0x1;if(!this[_0x8933('0x8b')](_0x52ebef[_0x8933('0x115')])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x52ebef,_0x8933('0x116'));}var _0x17c5c7=this[_0x8933('0x1f')][_0x8933('0xab')](this,_0x52ebef[_0x8933('0x115')]);if(!_0x17c5c7){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x52ebef,_0x8933('0x117'));}if(!this['isConfigured'](_0x52ebef[_0x8933('0xdc')])){return this[_0x8933('0x39')][_0x8933('0x2e')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x468202=this[_0x8933('0x39')][_0x8933('0x118')](_0x17c5c7,_0x52ebef[_0x8933('0x119')],_0x52ebef[_0x8933('0x11a')]);var _0x4c6d22=_0x468202[_0x8933('0xa9')]?_0x468202['result'][_0x8933('0x52')]():'';logger[_0x8933('0x2f')](_0x8933('0x11b'),JSON[_0x8933('0x77')](_0x468202));if(_0x468202[_0x8933('0xa9')]===-0x1){this[_0x8933('0x38')][_0x8933('0xab')](this,_0x52ebef,_0x4c6d22);return _0x468202;}else if(_0x468202[_0x8933('0xa7')]===_0x8933('0x6c')){_0x468202[_0x8933('0xa9')]=_0x4c6d22[_0x8933('0xa3')]>=parseInt(_0x52ebef[_0x8933('0x11c')])?'x':'i';}else{_0x468202[_0x8933('0xa9')]=_0x4c6d22[_0x8933('0xa3')]>=parseInt(_0x52ebef[_0x8933('0x11c')])&&_0x4c6d22[_0x8933('0xa3')]<=parseInt(_0x52ebef[_0x8933('0x11a')])?'x':'i';}var _0x52cea7=this[_0x8933('0x11')][_0x8933('0xab')](this,_0x52ebef[_0x8933('0xdc')]);if(!_0x52cea7){return this['channel'][_0x8933('0x2e')](_0x52ebef,_0x8933('0xdd'));}this[_0x8933('0x39')][_0x8933('0xa5')](_0x52cea7,_0x4c6d22);if(this['isConfigured'](_0x52ebef['hiddendigitsnum'])){var _0x1fe94a=parseInt(_0x52ebef[_0x8933('0x11d')],0xa);var _0xc99cdb=rs['generate']({'charset':'*','length':_0x1fe94a});var _0x4775b6=_0x4c6d22['length'];if(_0x4775b6>0x0){if(_0x4775b6>_0x1fe94a){this[_0x8933('0x38')][_0x8933('0xab')](this,_0x52ebef,_0x52ebef[_0x8933('0x11e')]===_0x8933('0x11f')?_0xc99cdb+_0x4c6d22[_0x8933('0x120')](_0x1fe94a):_0x4c6d22['substr'](0x0,_0x4775b6-_0x1fe94a)+_0xc99cdb);}else{this['createSquareDetailsReport']['sync'](this,_0x52ebef,rs[_0x8933('0x121')]({'charset':'*','length':_0x4775b6}));}}else{this[_0x8933('0x38')][_0x8933('0xab')](this,_0x52ebef,'');}}else{this[_0x8933('0x38')][_0x8933('0xab')](this,_0x52ebef,_0x4c6d22);}return _0x468202;};AGIVertices[_0x8933('0x10')][_0x8933('0x122')]=function(_0x5d5ad2){logger['info'](util['format'](_0x8933('0x123'),_0x5d5ad2[_0x8933('0xb3')]));return this[_0x8933('0xe')](_0x5d5ad2);};AGIVertices['prototype'][_0x8933('0x124')]=function(_0x11d657){logger[_0x8933('0x2f')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x11d657[_0x8933('0xb3')]));this[_0x8933('0x38')]['sync'](this,_0x11d657,_0x11d657[_0x8933('0x125')]);return this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')](_0x8933('0x126'),_0x11d657[_0x8933('0x125')]));};AGIVertices['prototype']['awspolly']=function(_0x2a115a){logger['info'](util[_0x8933('0xa4')](_0x8933('0x127'),_0x2a115a[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x2a115a[_0x8933('0x128')])||!this[_0x8933('0x8b')](_0x2a115a[_0x8933('0x8e')])){return this['channel'][_0x8933('0xaf')](_0x8933('0x129'));}if(!this[_0x8933('0x8b')](_0x2a115a[_0x8933('0x62')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xb0'));}this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x12a'),_0x2a115a[_0x8933('0x62')]));var _0x117f7b=this[_0x8933('0x8d')][_0x8933('0xab')](this,_0x2a115a);if(_0x117f7b){this['channel'][_0x8933('0xaf')](util['format'](_0x8933('0x12b'),_0x117f7b));var _0xaa5084=this[_0x8933('0x39')][_0x8933('0x103')](_0x117f7b);try{fs[_0x8933('0x104')](_0x117f7b+_0x8933('0x105'));}catch(_0x592121){logger[_0x8933('0x2e')](_0x592121);}return _0xaa5084;}return this[_0x8933('0x39')][_0x8933('0x2e')](_0x2a115a,_0x8933('0x12c'));};AGIVertices['prototype'][_0x8933('0x12d')]=function(_0xdd380d){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x12e'),_0xdd380d[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0xdd380d['aws_access_key_id'])||!this[_0x8933('0x8b')](_0xdd380d['aws_secret_access_key'])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x129'));}if(!this[_0x8933('0x8b')](_0xdd380d[_0x8933('0x94')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x12f'));}if(!this['isConfigured'](_0xdd380d[_0x8933('0x62')])){return this[_0x8933('0x39')]['noop'](_0x8933('0xb0'));}this['channel'][_0x8933('0x130')]=!![];this['createSquareDetailsReport'](_0xdd380d);this[_0x8933('0x46')](_0xdd380d[_0x8933('0x62')],'in','','');this['channel'][_0x8933('0xaf')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0xdd380d[_0x8933('0x62')]));var _0x5ae45e=this['awsLex'][_0x8933('0xab')](this,_0xdd380d);if(_0x5ae45e){for(var _0x1e3147 in _0x5ae45e){if(_0x5ae45e[_0x8933('0x9a')](_0x1e3147)&&_[_0x8933('0x9b')](_0x5ae45e[_0x1e3147])){this[_0x8933('0x39')]['setVariable'](util['format'](_0x8933('0x131'),_0x1e3147[_0x8933('0x70')]()),_0x5ae45e[_0x1e3147]);}}if(_[_0x8933('0x49')](_0x5ae45e[_0x8933('0x132')])){return this['channel'][_0x8933('0xaf')](_0x8933('0x133'));}else{this[_0x8933('0x46')](_0x5ae45e['message'],_0x8933('0xf5'),_0x8933('0x134'),'');return this[_0x8933('0x39')][_0x8933('0xaf')](util['format'](_0x8933('0x135'),_0x5ae45e[_0x8933('0x132')]));}}return this['channel']['error'](_0xdd380d,_0x8933('0x136'));};AGIVertices[_0x8933('0x10')]['googleasr']=function(_0x719e67){logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x719e67[_0x8933('0xb3')],_0x719e67[_0x8933('0x6c')]));if(!this[_0x8933('0x8b')](_0x719e67[_0x8933('0x7f')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x137'));}var _0x5b489b=_0x8933('0x138');var _0x1ff26f=util[_0x8933('0xa4')]('%s/recordings/%s',FILES_PATH,rs[_0x8933('0x121')](0x4));var _0x29db84=util['format'](_0x8933('0xa1'),_0x1ff26f,_0x5b489b);var _0x578621=!![];if(_0x719e67[_0x8933('0x139')]===_0x8933('0x13a')){_0x578621=![];}var _0x2eb2bf=this[_0x8933('0x39')]['recordFile'](_0x1ff26f,_0x5b489b,_0x719e67['intKey'],_0x719e67['timeout'],undefined,_0x578621);if(_0x2eb2bf[_0x8933('0xa9')]!==-0x1){this['channel']['noop'](util['format'](_0x8933('0x13b'),_0x29db84));var _0x6ffb42=this['googleASR'][_0x8933('0xab')](this,_0x719e67,_0x29db84);if(_0x6ffb42){for(var _0x52a107 in _0x6ffb42){if(_0x6ffb42[_0x8933('0x9a')](_0x52a107)){this['channel'][_0x8933('0xa5')](util[_0x8933('0xa4')](_0x8933('0x13c'),_0x52a107[_0x8933('0x70')]()),_0x6ffb42[_0x52a107]);}}return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')]('GoogleASR\x20Result\x20%s',JSON[_0x8933('0x77')](_0x6ffb42)));}}return _0x2eb2bf;};AGIVertices['prototype']['tildeasr']=function(_0x4214ad){logger[_0x8933('0x2f')](util['format'](_0x8933('0x13d'),_0x4214ad[_0x8933('0xb3')]));if(!this['isConfigured'](_0x4214ad[_0x8933('0x13e')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x13f'));}if(!this[_0x8933('0x8b')](_0x4214ad['appsecret'])){return this['channel'][_0x8933('0xaf')](_0x8933('0x140'));}var _0x3d4f59=_0x8933('0x138');var _0x2b047b=util[_0x8933('0xa4')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x148d42=util[_0x8933('0xa4')](_0x8933('0xa1'),_0x2b047b,_0x3d4f59);var _0x1a2043=!![];if(_0x4214ad[_0x8933('0x139')]==='NOBEEP'){_0x1a2043=![];}var _0x869f0e=this['channel'][_0x8933('0x141')](_0x2b047b,_0x3d4f59,_0x4214ad[_0x8933('0x142')],_0x4214ad[_0x8933('0x6c')],undefined,_0x1a2043);if(_0x869f0e['result']!==-0x1){this[_0x8933('0x39')][_0x8933('0xaf')](util['format']('tilde\x20%s\x20file\x20created',_0x148d42));var _0x45bc08=this['tildeASR'][_0x8933('0xab')](this,_0x4214ad,_0x148d42);if(_0x45bc08){for(var _0xbc1a1c in _0x45bc08){if(_0x45bc08[_0x8933('0x9a')](_0xbc1a1c)){this[_0x8933('0x39')][_0x8933('0xa5')](util[_0x8933('0xa4')]('TILDE_ASR_%s',_0xbc1a1c[_0x8933('0x70')]()),_0x45bc08[_0xbc1a1c]);}}return this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x45bc08)));}}return _0x869f0e;};AGIVertices[_0x8933('0x10')]['gotoc']=function(_0x235879){logger[_0x8933('0x2f')](util['format'](_0x8933('0x143'),_0x235879[_0x8933('0xb3')]));return this[_0x8933('0x39')]['continueAt'](_0x235879[_0x8933('0x40')],_0x235879[_0x8933('0x41')],_0x235879[_0x8933('0x42')]);};AGIVertices[_0x8933('0x10')][_0x8933('0x144')]=function(_0x33b0c1){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x145'),_0x33b0c1[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x33b0c1[_0x8933('0x146')])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x33b0c1,_0x8933('0x147'));}try{var _0x157150=eval(_0x33b0c1[_0x8933('0x146')])?_0x8933('0x148'):_0x8933('0x149');this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')]('EVAL\x20CONDITION\x20%s\x20%s',_0x33b0c1['condition'],_0x157150));return{'code':0xc8,'result':_0x157150};}catch(_0x2b9d48){return{'code':0xc8,'result':_0x8933('0x149')};}};AGIVertices[_0x8933('0x10')][_0x8933('0x14a')]=function(_0x51289d){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x14b'),_0x51289d[_0x8933('0xb3')]));if(!this['isConfigured'](_0x51289d[_0x8933('0x14c')])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x51289d,_0x8933('0x14d'));}var _0x19ae40=this[_0x8933('0x24')]['sync'](this,_0x51289d['interval_id']);if(!_0x19ae40){return this[_0x8933('0x39')]['error'](_0x51289d,'no\x20intervals\x20found');}for(var _0x385ae8=0x0;_0x385ae8<_0x19ae40['length'];_0x385ae8+=0x1){var _0x5b76c1=this['channel'][_0x8933('0x11')](util[_0x8933('0xa4')](_0x8933('0x14e'),_0x19ae40[_0x385ae8]));if(_0x5b76c1[_0x8933('0xa9')]===-0x1){return _0x5b76c1;}logger[_0x8933('0x2f')](util['format'](_0x8933('0x14f'),_0x19ae40[_0x385ae8],_0x5b76c1[_0x8933('0xa7')]));if(_0x5b76c1[_0x8933('0xa7')]===_0x8933('0x148')){logger[_0x8933('0x2f')](util['format'](_0x8933('0x14f'),_0x19ae40[_0x385ae8],_0x8933('0x148')));this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')](_0x8933('0x14f'),_0x19ae40[_0x385ae8],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x8933('0xa4')](_0x8933('0x14f'),_0x19ae40[_0x385ae8],'false'));this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x14f'),_0x19ae40[_0x385ae8],_0x8933('0x149')));}}return{'code':0xc8,'result':_0x8933('0x149')};};AGIVertices[_0x8933('0x10')][_0x8933('0x150')]=function(_0x5b39e5){logger[_0x8933('0x2f')](util['format'](_0x8933('0x151'),_0x5b39e5[_0x8933('0xb3')]));return this[_0x8933('0x39')]['hangup']();};AGIVertices[_0x8933('0x10')][_0x8933('0x152')]=function(_0x2b9fed){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x153'),_0x2b9fed['label']));if(!this[_0x8933('0x8b')](_0x2b9fed[_0x8933('0x7f')])){return this[_0x8933('0x39')]['noop'](_0x8933('0x137'));}var _0x1af744=_0x8933('0x138');var _0x1eac6a=util[_0x8933('0xa4')](_0x8933('0x154'),FILES_PATH,rs['generate'](0x4));var _0x2afa32=util[_0x8933('0xa4')](_0x8933('0xa1'),_0x1eac6a,_0x1af744);var _0x5a1839=!![];if(_0x2b9fed[_0x8933('0x139')]===_0x8933('0x13a')){_0x5a1839=![];}var _0x151fff=this[_0x8933('0x39')]['recordFile'](_0x1eac6a,_0x1af744,_0x2b9fed['intKey'],_0x2b9fed[_0x8933('0x6c')],undefined,_0x5a1839);if(_0x151fff['result']!==-0x1){this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')]('ispeech\x20%s\x20file\x20created',_0x2afa32));var _0x1dc8cd=this[_0x8933('0x89')][_0x8933('0xab')](this,_0x2b9fed,_0x2afa32);if(_0x1dc8cd){for(var _0x59de86 in _0x1dc8cd){if(_0x1dc8cd[_0x8933('0x9a')](_0x59de86)){this[_0x8933('0x39')][_0x8933('0xa5')](util[_0x8933('0xa4')](_0x8933('0x155'),_0x59de86[_0x8933('0x70')]()),_0x1dc8cd[_0x59de86]);}}return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x156'),JSON[_0x8933('0x77')](_0x1dc8cd)));}}return _0x151fff;};AGIVertices[_0x8933('0x10')][_0x8933('0x157')]=function(_0x23933a){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x158'),_0x23933a[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x23933a['key'])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x137'));}if(!this[_0x8933('0x8b')](_0x23933a[_0x8933('0x62')])){return this['channel'][_0x8933('0xaf')](_0x8933('0xb0'));}this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')](_0x8933('0x159'),_0x23933a['text']));var _0x4c24f9=this[_0x8933('0x86')]['sync'](this,_0x23933a);if(_0x4c24f9){this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x15a'),_0x4c24f9));var _0x5d7304=this[_0x8933('0x39')][_0x8933('0x103')](_0x4c24f9,_0x23933a[_0x8933('0x142')]);try{fs['unlink'](_0x4c24f9+_0x8933('0x105'));}catch(_0x251819){logger[_0x8933('0x2e')](_0x251819);}return _0x5d7304;}return this[_0x8933('0x39')]['error'](_0x23933a,_0x8933('0x15b'));};AGIVertices[_0x8933('0x10')][_0x8933('0x15c')]=function(_0x5a8579){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x15d'),_0x5a8579[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x5a8579['findBy'])){return this[_0x8933('0x39')]['error'](_0x5a8579,_0x8933('0x15e'));}logger['info'](util[_0x8933('0xa4')](_0x8933('0x15f'),this[_0x8933('0x39')][_0x8933('0x3d')],_0x5a8579[_0x8933('0x160')]));var _0x3c8306=this[_0x8933('0x5a')][_0x8933('0xab')](this,_0x5a8579[_0x8933('0x160')]);if(_0x3c8306){logger[_0x8933('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8933('0x3d')],_0x5a8579[_0x8933('0x160')]));this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x161'),this['channel']['callerid'],_0x5a8579[_0x8933('0x160')]));return{'code':0xc8,'result':_0x8933('0x162')};}else{logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x163'),this['channel'][_0x8933('0x3d')],_0x5a8579[_0x8933('0x160')]));this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x163'),this['channel'][_0x8933('0x3d')],_0x5a8579[_0x8933('0x160')]));return{'code':0xc8,'result':_0x8933('0x164')};}};AGIVertices[_0x8933('0x10')][_0x8933('0x165')]=function(_0x3f6e83){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x166'),_0x3f6e83[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x3f6e83[_0x8933('0x160')])){return this['channel'][_0x8933('0x2e')](_0x3f6e83,_0x8933('0x15e'));}logger[_0x8933('0x2f')](util['format'](_0x8933('0x15f'),this['channel'][_0x8933('0x3d')],_0x3f6e83[_0x8933('0x160')]));var _0x5c51a2=this[_0x8933('0x59')][_0x8933('0xab')](this,_0x3f6e83['findBy']);if(_0x5c51a2){logger[_0x8933('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8933('0x3d')],_0x3f6e83[_0x8933('0x160')]));this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x161'),this[_0x8933('0x39')][_0x8933('0x3d')],_0x3f6e83['findBy']));return{'code':0xc8,'result':_0x8933('0x162')};}else{logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x163'),this[_0x8933('0x39')][_0x8933('0x3d')],_0x3f6e83[_0x8933('0x160')]));this[_0x8933('0x39')][_0x8933('0xaf')](util['format'](_0x8933('0x163'),this[_0x8933('0x39')][_0x8933('0x3d')],_0x3f6e83['findBy']));return{'code':0xc8,'result':_0x8933('0x164')};}};AGIVertices[_0x8933('0x10')][_0x8933('0x167')]=function(_0x24ee40){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x168'),_0x24ee40['label']));if(!this[_0x8933('0x8b')](_0x24ee40['operation'])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x24ee40,'no\x20operation\x20configured');}this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')](_0x8933('0x169'),_0x24ee40[_0x8933('0x16a')]));var _0x20aa50=eval(_0x24ee40[_0x8933('0x16a')]);if(!this['isConfigured'](_0x24ee40['variable_id'])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xdb'));}var _0xeb3798=this[_0x8933('0x11')]['sync'](this,_0x24ee40[_0x8933('0xdc')]);if(!_0xeb3798){return this['channel'][_0x8933('0x2e')](_0x24ee40,_0x8933('0xdd'));}if(_[_0x8933('0xa2')](_0x20aa50)){var _0x58b4a1=this;_0x20aa50[_0x8933('0xde')](function(_0x3f88d2,_0x4e3cb9){_0x58b4a1[_0x8933('0x39')]['setVariable'](util[_0x8933('0xa4')](_0x8933('0x16b'),_0xeb3798,_0x4e3cb9),_0x3f88d2);});return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x16c'),_0xeb3798));}else{return this[_0x8933('0x39')][_0x8933('0xa5')](_0xeb3798,_0x20aa50);}};AGIVertices[_0x8933('0x10')][_0x8933('0x16d')]=function(_0xe84883){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x16e'),_0xe84883[_0x8933('0xb3')]));if(_0xe84883['retry']===0x0){return this[_0x8933('0xaa')](_0xe84883);}_0xe84883['retry']-=0x1;if(!this['isConfigured'](_0xe84883[_0x8933('0x115')])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0xe84883,_0x8933('0x116'));}var _0x3ae5b1=this[_0x8933('0x1f')][_0x8933('0xab')](this,_0xe84883[_0x8933('0x115')]);if(!_0x3ae5b1){return this[_0x8933('0x39')][_0x8933('0x2e')](_0xe84883,_0x8933('0x117'));}var _0x2bf9d0=this[_0x8933('0x39')][_0x8933('0x118')](_0x3ae5b1,_0xe84883[_0x8933('0x119')],_0xe84883[_0x8933('0x16f')]);var _0x57c3bd=_0x2bf9d0[_0x8933('0xa9')];if(_0x2bf9d0['result']===-0x1){this[_0x8933('0x38')][_0x8933('0xab')](this,_0xe84883,'-1');return _0x2bf9d0;}else if(_0x2bf9d0[_0x8933('0xa7')]===_0x8933('0x6c')){_0x2bf9d0[_0x8933('0xa9')]=_0x2bf9d0[_0x8933('0xa9')]['length']>0x0?_0x2bf9d0[_0x8933('0xa9')]:'t';}else if(_[_0x8933('0x48')](_0x2bf9d0[_0x8933('0xa9')])){_0x2bf9d0[_0x8933('0xa9')]='#';_0x57c3bd='#';}if(!this[_0x8933('0x8b')](_0xe84883[_0x8933('0xdc')])){this['channel']['noop'](_0x8933('0xdb'));}else{var _0x69ca16=this[_0x8933('0x11')][_0x8933('0xab')](this,_0xe84883[_0x8933('0xdc')]);if(!_0x69ca16){return this[_0x8933('0x39')][_0x8933('0x2e')](_0xe84883,_0x8933('0xdd'));}this['channel'][_0x8933('0xa5')](_0x69ca16,_0x57c3bd);}this[_0x8933('0x38')][_0x8933('0xab')](this,_0xe84883,_0x57c3bd);return _0x2bf9d0;};AGIVertices[_0x8933('0x10')][_0x8933('0xaf')]=function(_0x287d26){logger['info'](util[_0x8933('0xa4')](_0x8933('0x170'),_0x287d26['label']));return this['channel'][_0x8933('0xaf')](_0x287d26[_0x8933('0x171')]||_0x287d26[_0x8933('0xb3')]);};AGIVertices[_0x8933('0x10')][_0x8933('0x172')]=function(_0x575746){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x173'),_0x575746[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x575746[_0x8933('0x160')])){return this['channel'][_0x8933('0x2e')](_0x575746,_0x8933('0x15e'));}logger[_0x8933('0x2f')](util['format'](_0x8933('0x15f'),this[_0x8933('0x39')][_0x8933('0x3d')],_0x575746[_0x8933('0x160')]));var _0xcdcc2e=this[_0x8933('0x54')][_0x8933('0xab')](this,_0x575746[_0x8933('0x174')]);var _0xf41988=this[_0x8933('0x56')][_0x8933('0xab')](this,_0x575746[_0x8933('0x160')],_0xcdcc2e);if(_0xf41988){logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8933('0x39')][_0x8933('0x3d')],_0x575746['findBy']));this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x161'),this[_0x8933('0x39')]['callerid'],_0x575746[_0x8933('0x160')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8933('0x39')]['callerid'],_0x575746[_0x8933('0x160')]));this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x161'),this[_0x8933('0x39')][_0x8933('0x3d')],_0x575746[_0x8933('0x160')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8933('0x10')]['playback']=function(_0x1e13b2){logger['info'](util[_0x8933('0xa4')](_0x8933('0x175'),_0x1e13b2['label']));if(!this[_0x8933('0x8b')](_0x1e13b2['file_id'])){return this['channel'][_0x8933('0x2e')](_0x1e13b2,_0x8933('0x116'));}var _0x257bdc=this[_0x8933('0x1f')]['sync'](this,_0x1e13b2[_0x8933('0x115')]);if(!_0x257bdc){return this['channel'][_0x8933('0x2e')](_0x1e13b2,'no\x20file\x20audio\x20found');}var _0xf6fe36=this['channel'][_0x8933('0x5e')](_0x8933('0x176'),[_0x257bdc,_0x1e13b2[_0x8933('0xe7')]]);if(_0xf6fe36[_0x8933('0xa9')]===-0x1){return _0xf6fe36;}return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x177'),_0x8933('0x176'),_0x257bdc));};AGIVertices[_0x8933('0x10')][_0x8933('0x178')]=function(_0x4daadc){logger['info'](util[_0x8933('0xa4')](_0x8933('0x179'),_0x4daadc['label']));if(!this['isConfigured'](_0x4daadc[_0x8933('0x17a')])){return this['channel'][_0x8933('0x2e')](_0x4daadc,'no\x20queue\x20selected');}var _0x50c07b='';var _0x91984a=parseInt(_0x4daadc[_0x8933('0x17a')],0xa);if(isNaN(_0x91984a)){_0x50c07b=_0x4daadc[_0x8933('0x17a')];}else{_0x50c07b=this[_0x8933('0x17b')][_0x8933('0xab')](this,_0x4daadc[_0x8933('0x17a')]);if(!_0x50c07b){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x4daadc,_0x8933('0x17c'));}}var _0x1d5273='';if(this[_0x8933('0x8b')](_0x4daadc[_0x8933('0x115')])){var _0x1a5d43=this['getSound'][_0x8933('0xab')](this,_0x4daadc[_0x8933('0x115')]);if(_0x1a5d43){_0x1d5273=_0x1a5d43;}}this[_0x8933('0x38')][_0x8933('0xab')](this,_0x4daadc,_0x50c07b);if(_0x4daadc['opts'][_0x8933('0x17d')]('x')<0x0){_0x4daadc[_0x8933('0xe7')]+='x';}if(_0x4daadc[_0x8933('0xe7')]['indexOf']('X')<0x0){_0x4daadc[_0x8933('0xe7')]+='X';}this[_0x8933('0x39')][_0x8933('0xa5')]('XMCS-QUEUE',_0x50c07b?_0x50c07b[_0x8933('0x17e')]():'');var _0x17cf0c=this[_0x8933('0x39')]['exec'](_0x8933('0x17f'),[_0x50c07b,_0x4daadc[_0x8933('0xe7')],_0x4daadc['url'],_0x1d5273,_0x4daadc[_0x8933('0x6c')],_0x4daadc['agi'],_0x4daadc[_0x8933('0x180')],_0x4daadc[_0x8933('0x181')],'',_0x4daadc[_0x8933('0x182')]]);if(_0x17cf0c[_0x8933('0xa9')]===-0x1){return _0x17cf0c;}return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x177'),_0x8933('0x17f'),_0x50c07b));};AGIVertices[_0x8933('0x10')][_0x8933('0x183')]=function(_0x61e031){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x184'),_0x61e031['label']));var _0x15ad80=_0x61e031[_0x8933('0x185')]||'wav';var _0x4f6db8=util['format'](_0x8933('0x186'),this['channel']['uniqueid'],rs['generate'](0x5));var _0x2ced3b=util[_0x8933('0xa4')](_0x8933('0x187'),FILES_PATH,_0x4f6db8,_0x15ad80);var _0x2956bc=util[_0x8933('0xa4')](_0x8933('0x154'),FILES_PATH,_0x4f6db8);this[_0x8933('0x3e')][_0x8933('0xab')](this,_0x61e031,_0x4f6db8,_0x2ced3b);this[_0x8933('0x39')][_0x8933('0xa5')](_0x8933('0x188'),_0x4f6db8);logger['info'](_0x8933('0x189'),_0x2956bc,_0x15ad80,_0x61e031['escape_digits'],_0x61e031[_0x8933('0x6c')]);return this[_0x8933('0x39')]['recordFile'](_0x2956bc,_0x15ad80,_0x61e031[_0x8933('0x18a')],_0x61e031[_0x8933('0x6c')],undefined,!![]);};AGIVertices[_0x8933('0x10')][_0x8933('0x18b')]=function(_0xb8794d){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x18c'),_0xb8794d[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0xb8794d[_0x8933('0x6a')])){return this['channel'][_0x8933('0xaf')](_0x8933('0x18d'));}var _0xe8e35b=this['restAPI']['sync'](this,_0xb8794d);logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x18e'),util[_0x8933('0x18f')](_0xe8e35b,{'showHidden':![],'depth':null})));if(!this[_0x8933('0x8b')](_0xb8794d[_0x8933('0xdc')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x190'));}var _0x56f710=this[_0x8933('0x11')][_0x8933('0xab')](this,_0xb8794d[_0x8933('0xdc')]);if(!_0x56f710){return this[_0x8933('0x39')][_0x8933('0x2e')](_0xb8794d,_0x8933('0xdd'));}this['channel']['setVariable'](util[_0x8933('0xa4')]('%s_STATUS_CODE',_0x56f710),_0xe8e35b[_0x8933('0x7a')]?_0xe8e35b[_0x8933('0x7a')]:_0x8933('0x191'));this[_0x8933('0x39')][_0x8933('0xa5')](util[_0x8933('0xa4')](_0x8933('0x192'),_0x56f710),_0xe8e35b[_0x8933('0x7b')]?_0xe8e35b[_0x8933('0x7b')]:'OK');if(_0xe8e35b['body']){try{this[_0x8933('0xa0')](_0xe8e35b[_0x8933('0x78')],_0x56f710);}catch(_0x5ae63b){logger[_0x8933('0x2e')](util['format'](_0x8933('0x193'),_0x56f710));}}return this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0xe0'),_0x56f710));};AGIVertices[_0x8933('0x10')][_0x8933('0x194')]=function(_0x1c3314){logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1c3314['label']));return this[_0x8933('0x39')][_0x8933('0x195')](_0x1c3314[_0x8933('0x196')][_0x8933('0x60')](/\s+/g,''),_0x1c3314[_0x8933('0x18a')]);};AGIVertices[_0x8933('0x10')][_0x8933('0x197')]=function(_0x1bbd8a){logger[_0x8933('0x2f')](util['format'](_0x8933('0x198'),_0x1bbd8a[_0x8933('0xb3')]));return this[_0x8933('0x39')]['sayNumber'](_0x1bbd8a[_0x8933('0x6d')][_0x8933('0x60')](/\s+/g,''),_0x1bbd8a[_0x8933('0x18a')]);};AGIVertices['prototype'][_0x8933('0x199')]=function(_0x3fb66f){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x19a'),_0x3fb66f[_0x8933('0xb3')]));return this['channel'][_0x8933('0x19b')](_0x3fb66f[_0x8933('0x62')],_0x3fb66f[_0x8933('0x18a')]);};AGIVertices['prototype']['sendMail']=function(_0x1d4b99){logger['info'](util[_0x8933('0xa4')](_0x8933('0x19c'),_0x1d4b99[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x1d4b99['account_id'])){return this[_0x8933('0x39')]['noop']('no\x20mail\x20account\x20configured');}var _0x3df3c9=this[_0x8933('0x21')]['sync'](this,_0x1d4b99['account_id']);if(!_0x3df3c9||!_0x3df3c9[_0x8933('0x19d')]){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x1d4b99,_0x8933('0x19e'));}var _0x4cfb07={'from':util['format'](_0x8933('0x19f'),_0x3df3c9['name'],_0x3df3c9[_0x8933('0x1a0')]||_0x3df3c9[_0x8933('0x19d')][_0x8933('0x1a1')]),'to':_0x1d4b99['to']||'','cc':_0x1d4b99['cc']||'','bcc':_0x1d4b99[_0x8933('0x1a2')]||'','subject':_0x1d4b99['subject'],'html':_0x1d4b99[_0x8933('0x62')],'text':_0x1d4b99['text']};var _0x5ba7fa={'tls':{'rejectUnauthorized':![]}};if(_0x3df3c9[_0x8933('0x19d')][_0x8933('0x1a3')]){_0x5ba7fa[_0x8933('0x1a3')]=_0x3df3c9[_0x8933('0x19d')]['service'];}else{_0x5ba7fa[_0x8933('0x1a4')]=_0x3df3c9['Smtp'][_0x8933('0x1a4')];_0x5ba7fa[_0x8933('0x1a5')]=_0x3df3c9[_0x8933('0x19d')][_0x8933('0x1a5')];_0x5ba7fa[_0x8933('0x1a6')]=_0x3df3c9[_0x8933('0x19d')]['secure'];}if(_0x3df3c9[_0x8933('0x19d')][_0x8933('0x1a7')]){_0x5ba7fa[_0x8933('0x1a8')]={'user':_0x3df3c9[_0x8933('0x19d')][_0x8933('0x1a1')],'pass':_0x3df3c9[_0x8933('0x19d')]['pass']};}if(this[_0x8933('0x8b')](_0x1d4b99[_0x8933('0x1a9')])){}logger[_0x8933('0xe2')](_0x8933('0x1aa'),JSON[_0x8933('0x77')](_0x4cfb07));this[_0x8933('0x38')][_0x8933('0xab')](this,_0x1d4b99,_0x1d4b99['account_id']);this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3df3c9[_0x8933('0x15')]));this[_0x8933('0x23')][_0x8933('0xab')](this,_0x5ba7fa,_0x4cfb07);return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x1ab'));};AGIVertices[_0x8933('0x10')][_0x8933('0x1ac')]=function(_0x7a257d){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x1ad'),_0x7a257d[_0x8933('0xb3')]));return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x1ae'));};AGIVertices['prototype'][_0x8933('0x1af')]=function(_0x34170d){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x1b0'),_0x34170d[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x34170d[_0x8933('0x1b1')])){return this['channel']['noop'](_0x8933('0x1b2'));}var _0xc250b0=this[_0x8933('0x35')]['sync'](this,_0x34170d[_0x8933('0x1b1')]);if(!_0xc250b0){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x34170d,_0x8933('0x1b3'));}var _0x4eb72a={'body':_0x34170d[_0x8933('0x1b4')],'phone':_0x34170d['to']||'','SmsAccountId':_0xc250b0['id']};logger[_0x8933('0xe2')](_0x8933('0x1b5'),JSON['stringify'](_0x4eb72a));this[_0x8933('0x38')]['sync'](this,_0x34170d,_0x34170d['sms_account_id']);this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x1b6'),_0xc250b0[_0x8933('0x15')]));this[_0x8933('0x37')]['sync'](this,_0x4eb72a);return this[_0x8933('0x39')][_0x8933('0xaf')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x8933('0x10')][_0x8933('0x1b7')]=function(_0x4f6393){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x1b8'),_0x4f6393[_0x8933('0xb3')]));if(!this['isConfigured'](_0x4f6393[_0x8933('0xdc')])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x4f6393,_0x8933('0x1b9'));}var _0x5e47ab=this[_0x8933('0x11')][_0x8933('0xab')](this,_0x4f6393[_0x8933('0xdc')]);if(!_0x5e47ab){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x4f6393,_0x8933('0xdd'));}return this['channel']['setVariable'](_0x5e47ab,_0x4f6393[_0x8933('0x1ba')]);};AGIVertices[_0x8933('0x10')][_0x8933('0x1bb')]=function(_0x263b45){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x1bc'),_0x263b45['label']));this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0x1bd'));if(_0x263b45['answer']==='yes'){this[_0x8933('0x39')][_0x8933('0xaf')]('Answer');return this['channel']['answer']();}return this[_0x8933('0x39')][_0x8933('0xaf')]('Skipped\x20Answer');};AGIVertices[_0x8933('0x10')]['subproject']=function(_0x1a5dcb){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x1be'),_0x1a5dcb[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x1a5dcb[_0x8933('0x1bf')])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x1a5dcb,_0x8933('0x1c0'));}var _0x2f15a9=this[_0x8933('0x18')][_0x8933('0xab')](this,_0x1a5dcb['project_id']);if(!this[_0x8933('0x8b')](_0x2f15a9)){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x1a5dcb,util[_0x8933('0xa4')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x1a5dcb[_0x8933('0x1bf')]));}if(_0x2f15a9===this[_0x8933('0x39')][_0x8933('0x3c')]){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x1a5dcb,_0x8933('0x1c1'));}this[_0x8933('0x38')][_0x8933('0xab')](this,_0x1a5dcb,_0x2f15a9);var _0x37834a=this['channel'][_0x8933('0x5e')](_0x8933('0x1c2'),util[_0x8933('0xa4')](_0x8933('0x1c3'),config[_0x8933('0x9')]['host']||_0x8933('0x1c4'),_0x2f15a9,this[_0x8933('0x39')][_0x8933('0x3c')]));if(_0x37834a['result']===-0x1){return _0x37834a;}return this[_0x8933('0x39')]['noop'](util[_0x8933('0xa4')]('Executed\x20command\x20%s\x20%s','AGI',_0x2f15a9));};AGIVertices[_0x8933('0x10')]['system']=function(_0x1d7c48){logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1d7c48[_0x8933('0xb3')]));var _0x219c94=this[_0x8933('0x5d')]['sync'](this,_0x1d7c48[_0x8933('0xbb')]);this[_0x8933('0x38')][_0x8933('0xab')](this,_0x1d7c48,_0x1d7c48[_0x8933('0xbb')]);if(this[_0x8933('0x8b')](_0x1d7c48[_0x8933('0xdc')])){var _0x405d25=this[_0x8933('0x11')]['sync'](this,_0x1d7c48[_0x8933('0xdc')]);if(_0x405d25){this[_0x8933('0x39')][_0x8933('0xa5')](_0x405d25,_0x219c94);return this[_0x8933('0x39')][_0x8933('0xaf')](util['format'](_0x8933('0x1c5'),_0x1d7c48[_0x8933('0xbb')],_0x405d25));}}return this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1d7c48['command']));};AGIVertices['prototype'][_0x8933('0x1c6')]=function(_0x17acaf){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x1c7'),_0x17acaf[_0x8933('0xb3')]));_0x17acaf[_0x8933('0x62')]=_0x17acaf[_0x8933('0x62')][_0x8933('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x17acaf['apiKey'])){return this[_0x8933('0x39')][_0x8933('0xaf')]('no\x20apiKey\x20configured');}if(!this[_0x8933('0x8b')](_0x17acaf[_0x8933('0x62')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xb0'));}this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x1c8'),_0x17acaf[_0x8933('0x62')]));var _0x1dfbab=this[_0x8933('0x61')][_0x8933('0xab')](this,_0x17acaf);if(_0x1dfbab){this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x1c9'),_0x1dfbab));var _0x6f1726=this[_0x8933('0x39')][_0x8933('0x103')](_0x1dfbab);try{fs[_0x8933('0x104')](_0x1dfbab+_0x8933('0x105'));}catch(_0x3e94cb){logger['error'](_0x3e94cb);}return _0x6f1726;}return this[_0x8933('0x39')]['error'](_0x17acaf,_0x8933('0x1ca'));};AGIVertices[_0x8933('0x10')][_0x8933('0x1cb')]=function(_0x5ce6e2){logger[_0x8933('0x2f')](util[_0x8933('0xa4')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5ce6e2[_0x8933('0xb3')]));_0x5ce6e2[_0x8933('0x62')]=_0x5ce6e2[_0x8933('0x62')][_0x8933('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5ce6e2[_0x8933('0x62')])){return this[_0x8933('0x39')][_0x8933('0xaf')](_0x8933('0xb0'));}this[_0x8933('0x39')][_0x8933('0xaf')](util['format'](_0x8933('0x1cc'),_0x5ce6e2['text']));var _0x17a28b=this[_0x8933('0x67')][_0x8933('0xab')](this,_0x5ce6e2);if(_0x17a28b){this[_0x8933('0x39')][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x1cd'),_0x17a28b));var _0x6b451c=this[_0x8933('0x39')]['streamFile'](_0x17a28b);try{fs['unlink'](_0x17a28b+_0x8933('0x105'));}catch(_0x66775f){logger['error'](_0x66775f);}return _0x6b451c;}return this[_0x8933('0x39')][_0x8933('0x2e')](_0x5ce6e2,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8933('0x10')]['unpause']=function(_0x4d4096){logger['info'](util[_0x8933('0xa4')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x4d4096[_0x8933('0xb3')]));if(!this[_0x8933('0x8b')](_0x4d4096[_0x8933('0x160')])){return this['channel'][_0x8933('0x2e')](_0x4d4096,'no\x20find\x20by\x20configured');}logger[_0x8933('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x4d4096[_0x8933('0x160')]));var _0xe53553=this[_0x8933('0x58')][_0x8933('0xab')](this,_0x4d4096[_0x8933('0x160')]);if(_0xe53553){logger[_0x8933('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8933('0x3d')],_0x4d4096[_0x8933('0x160')]));this['channel'][_0x8933('0xaf')](util[_0x8933('0xa4')](_0x8933('0x161'),this[_0x8933('0x39')][_0x8933('0x3d')],_0x4d4096['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x163'),this[_0x8933('0x39')][_0x8933('0x3d')],_0x4d4096['findBy']));this['channel']['noop'](util[_0x8933('0xa4')](_0x8933('0x163'),this[_0x8933('0x39')]['callerid'],_0x4d4096['findBy']));return{'code':0xc8,'result':_0x8933('0x164')};}};AGIVertices['prototype'][_0x8933('0x1ce')]=function(_0x112bb0){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x1cf'),_0x112bb0[_0x8933('0xb3')]));var _0x18f3da=this[_0x8933('0x39')][_0x8933('0x5e')]('VOICEMAIL',[_0x112bb0['mailbox'],_0x112bb0[_0x8933('0x7d')]]);if(_0x18f3da[_0x8933('0xa9')]===-0x1){return _0x18f3da;}return this[_0x8933('0x39')][_0x8933('0xaf')](util['format']('Executed\x20command\x20%s\x20%s',_0x8933('0x1d0'),_0x112bb0['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x3c06ac){logger[_0x8933('0x2f')](util[_0x8933('0xa4')](_0x8933('0x1d1'),_0x3c06ac[_0x8933('0xb3')]));if(!this['isConfigured'](_0x3c06ac['variable_id'])){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x3c06ac,'no\x20variable\x20selected');}var _0x5c94c1=this[_0x8933('0x11')]['sync'](this,_0x3c06ac[_0x8933('0xdc')]);if(!_0x5c94c1){return this[_0x8933('0x39')][_0x8933('0x2e')](_0x3c06ac,'no\x20variable\x20found');}var _0x495207=this[_0x8933('0x39')]['getVariable'](_0x5c94c1);return{'code':0xc8,'result':_0x495207[_0x8933('0xa7')]?_0x495207[_0x8933('0xa7')]:'-'};};String[_0x8933('0x10')]['replaceAll']=function(_0x388f65,_0x4fbcfb){return this['split'](_0x388f65)[_0x8933('0x1d2')](_0x4fbcfb);};module[_0x8933('0x1d3')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 989e5f5..8d61ab1 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 _0xa85d=['agents','timers','channels','syncAgentConnect','hanguprequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','voiceQueues','ACW','mandatoryDisposition','name','mandatoryDispositionPause','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','message','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport'];(function(_0x2bb0ff,_0x22c9e2){var _0x497825=function(_0x168536){while(--_0x168536){_0x2bb0ff['push'](_0x2bb0ff['shift']());}};_0x497825(++_0x22c9e2);}(_0xa85d,0x152));var _0xda85=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0xa85d[_0x191154];return _0x3dcd73;};'use strict';var util=require(_0xda85('0x0'));var _=require('lodash');var moment=require(_0xda85('0x1'));var ami=require(_0xda85('0x2'));var logger=require('../../../config/logger')(_0xda85('0x3'));var RpcUser=require(_0xda85('0x4'));var RpcVoiceAgentReport=require(_0xda85('0x5'));function Acw(_0x3d0a4e){this['voiceQueues']=_0x3d0a4e['voiceQueues'];this[_0xda85('0x6')]=_0x3d0a4e[_0xda85('0x6')];this[_0xda85('0x7')]=_0x3d0a4e[_0xda85('0x7')];this[_0xda85('0x8')]={};ami['on']('agentconnect',this[_0xda85('0x9')]['bind'](this));ami['on'](_0xda85('0xa'),this['syncHangupRequest'][_0xda85('0xb')](this));ami['on'](_0xda85('0xc'),this[_0xda85('0xd')][_0xda85('0xb')](this));ami['on'](_0xda85('0xe'),this[_0xda85('0xf')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xda85('0xb')](this));ami['on']('blindtransfer',this[_0xda85('0x10')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0xda85('0x11')][_0xda85('0xb')](this));}function getDiff(_0x1cad19){var _0x1379d5=moment()[_0xda85('0x12')](0x0);var _0x28ec2c=moment(_0x1cad19)['milliseconds'](0x0);return _0x1379d5[_0xda85('0x13')](_0x28ec2c,_0xda85('0x14'));}Acw[_0xda85('0x15')][_0xda85('0x16')]=function(_0x383dd5){try{var _0x35d956=this;var _0xf23d57=this[_0xda85('0x8')][_0x383dd5][_0xda85('0x17')];var _0x1303a1=this[_0xda85('0x8')][_0x383dd5][_0xda85('0x18')];var _0x1713e2=this[_0xda85('0x19')][_0x1303a1];var _0x325090=![];var _0xfcbfe2=_0xda85('0x1a');if(_0x1713e2[_0xda85('0x1b')]){if(_0x1713e2['mandatoryDispositionPause'][_0xda85('0x1c')]){_0x325090=!![];_0xfcbfe2=_0x1713e2[_0xda85('0x1d')][_0xda85('0x1c')];}}ami['Action']({'action':_0xda85('0x1e'),'interface':_0xf23d57,'paused':!![],'reason':_0xfcbfe2})[_0xda85('0x1f')](function(_0x4d4a7f){if(_0x35d956[_0xda85('0x6')][_0xf23d57]){return RpcUser[_0xda85('0x20')](_0x35d956[_0xda85('0x6')][_0xf23d57]['id'])[_0xda85('0x1f')](function(_0x268c72){if(_0x268c72&&!_0x268c72[_0xda85('0x21')]){logger[_0xda85('0x22')](_0xda85('0x23'),_0x383dd5,_0xf23d57,_0x1303a1);var _0xb6161e=_0x35d956[_0xda85('0x8')][_0x383dd5][_0xda85('0x24')]&&_0x35d956[_0xda85('0x8')][_0x383dd5][_0xda85('0x25')]?_0x35d956[_0xda85('0x8')][_0x383dd5][_0xda85('0x25')]:_0x383dd5;return RpcUser[_0xda85('0x26')](_0x35d956['agents'][_0xf23d57],_0xfcbfe2,_0xb6161e)[_0xda85('0x1f')](function(_0x18a323){if(!_0x325090){_0x35d956[_0xda85('0x7')][_0xf23d57]={};logger[_0xda85('0x22')](_0xda85('0x27'),_0x383dd5,_0x35d956[_0xda85('0x19')][_0x1303a1]['acwTimeout'],_0xf23d57,_0x1303a1);_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x28')]=setTimeout(_0x35d956['stopAcw'][_0xda85('0xb')](_0x35d956,_0xf23d57),_0x35d956['voiceQueues'][_0x1303a1][_0xda85('0x29')]*0x3e8);_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x2a')]=moment()[_0xda85('0x2b')](_0xda85('0x2c'));_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x2d')]=_0x383dd5;_0x35d956['timers'][_0xf23d57][_0xda85('0x18')]=_0x1303a1;_0x35d956['timers'][_0xf23d57][_0xda85('0x2e')]=function(){var _0x5198f2=getDiff(_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x2a')]);clearTimeout(_0x35d956[_0xda85('0x7')][_0xf23d57]['timer']);_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x28')]=![];RpcVoiceAgentReport[_0xda85('0x2f')]({'acwtime':_0x5198f2},_0x35d956[_0xda85('0x7')][_0xf23d57][_0xda85('0x2d')],_0xf23d57)[_0xda85('0x1f')](function(_0x169f24){logger[_0xda85('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x383dd5,_0x5198f2,_0x169f24);})['catch'](function(_0x1ec327){logger[_0xda85('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x383dd5,_0x1ec327);});delete _0x35d956['timers'][_0xf23d57];};}});}else{logger[_0xda85('0x22')](_0xda85('0x31'),_0x383dd5,_0xf23d57,_0x1303a1);}});}})[_0xda85('0x32')](function(_0x24adcd){logger[_0xda85('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x383dd5,_0x35d956['voiceQueues'][_0x1303a1][_0xda85('0x29')],_0xf23d57,_0x1303a1);})[_0xda85('0x33')](function(){delete _0x35d956[_0xda85('0x8')][_0x383dd5];});}catch(_0x3b1c2d){logger[_0xda85('0x30')]('[ACW][START]\x20%s',_0x3b1c2d[_0xda85('0x34')]);}};Acw['prototype']['stopAcw']=function(_0x4e6f91){try{var _0x3e046f=this;if(_0x3e046f['timers'][_0x4e6f91]){_0x3e046f['timers'][_0x4e6f91]['timer']=![];var _0x579635=_0x3e046f['timers'][_0x4e6f91][_0xda85('0x2d')];var _0x5a1d0e=_0x3e046f[_0xda85('0x7')][_0x4e6f91]['queue'];var _0x2332e9=_0x3e046f[_0xda85('0x19')][_0x5a1d0e][_0xda85('0x29')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x579635,_0x4e6f91);RpcUser[_0xda85('0x35')](this[_0xda85('0x6')][_0x4e6f91]);RpcVoiceAgentReport[_0xda85('0x2f')]({'acwtime':_0x2332e9,'agentacw':!![]},_0x579635,_0x4e6f91)[_0xda85('0x1f')](function(_0x4a36b2){logger[_0xda85('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x579635,_0x2332e9,_0x4a36b2);})[_0xda85('0x32')](function(_0x356b27){logger[_0xda85('0x30')](_0xda85('0x36'),_0x579635,_0x356b27);});}else{logger[_0xda85('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x4e6f91);if(_0x3e046f[_0xda85('0x7')]){logger[_0xda85('0x22')](_0xda85('0x37'),JSON[_0xda85('0x38')](_0x3e046f[_0xda85('0x7')]));}}}catch(_0x5936c3){logger[_0xda85('0x30')](_0xda85('0x39'),_0x5936c3['message']);}};Acw[_0xda85('0x15')][_0xda85('0x9')]=function(_0x457c06){try{if(this[_0xda85('0x19')][_0x457c06[_0xda85('0x18')]]&&(this[_0xda85('0x19')][_0x457c06[_0xda85('0x18')]][_0xda85('0x3')]||this[_0xda85('0x19')][_0x457c06['queue']][_0xda85('0x1b')])){if(this[_0xda85('0x6')][_0x457c06['interface']]){this[_0xda85('0x8')][_0x457c06[_0xda85('0x2d')]]={'queue':_0x457c06[_0xda85('0x18')],'interface':_0x457c06[_0xda85('0x17')],'destlinkedid':_0x457c06['destlinkedid']};}}}catch(_0x2fa4e8){logger[_0xda85('0x30')](_0xda85('0x3a'),_0x2fa4e8[_0xda85('0x34')]);}};Acw[_0xda85('0x15')][_0xda85('0x11')]=function(_0x58b35f){try{if(this[_0xda85('0x19')][_0x58b35f['queue']]&&(this[_0xda85('0x19')][_0x58b35f[_0xda85('0x18')]][_0xda85('0x3')]||this['voiceQueues'][_0x58b35f['queue']][_0xda85('0x1b')])){if(this[_0xda85('0x6')][_0x58b35f[_0xda85('0x17')]]){this['channels'][_0x58b35f[_0xda85('0x2d')]]={'queue':_0x58b35f['queue'],'interface':_0x58b35f[_0xda85('0x17')]};}}}catch(_0x1263d2){logger[_0xda85('0x30')](_0xda85('0x3b'),_0x1263d2[_0xda85('0x34')]);}};Acw['prototype'][_0xda85('0x3c')]=function(_0x12766a){try{if(this[_0xda85('0x8')][_0x12766a[_0xda85('0x2d')]]&&_[_0xda85('0x3d')](this[_0xda85('0x8')][_0x12766a[_0xda85('0x2d')]][_0xda85('0x24')])){logger[_0xda85('0x22')](_0xda85('0x3e'),_0x12766a[_0xda85('0x2d')]);this['startAcw'](_0x12766a[_0xda85('0x2d')]);}else if(this[_0xda85('0x8')][_0x12766a['linkedid']]&&_['isUndefined'](this[_0xda85('0x8')][_0x12766a['linkedid']][_0xda85('0x24')])){logger[_0xda85('0x22')](_0xda85('0x3f'),_0x12766a[_0xda85('0x40')]);this[_0xda85('0x16')](_0x12766a['linkedid']);}}catch(_0x4d59bc){logger['error'](_0xda85('0x41'),_0x4d59bc[_0xda85('0x34')]);}};Acw[_0xda85('0x15')][_0xda85('0xd')]=function(_0x32e289){try{if(this['channels'][_0x32e289[_0xda85('0x2d')]]&&this['channels'][_0x32e289[_0xda85('0x2d')]][_0xda85('0x24')]){logger[_0xda85('0x22')](_0xda85('0x42'),_0x32e289['uniqueid']);this[_0xda85('0x16')](_0x32e289[_0xda85('0x2d')]);}else if(this[_0xda85('0x8')][_0x32e289[_0xda85('0x40')]]&&this[_0xda85('0x8')][_0x32e289['linkedid']][_0xda85('0x24')]){logger[_0xda85('0x22')](_0xda85('0x43'),_0x32e289[_0xda85('0x40')]);this['startAcw'](_0x32e289[_0xda85('0x40')]);}}catch(_0x2f297b){logger['error'](_0xda85('0x44'),_0x2f297b[_0xda85('0x34')]);}};Acw[_0xda85('0x15')][_0xda85('0x45')]=function(_0x2e2cc8){try{if(!_[_0xda85('0x46')](this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x47')]])){this[_0xda85('0x16')](_0x2e2cc8[_0xda85('0x47')]);if(this[_0xda85('0x8')][_0x2e2cc8['secondtransfereruniqueid']]){this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x48')]][_0xda85('0x24')]=!![];this[_0xda85('0x8')][_0x2e2cc8['transfertargetuniqueid']]=this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x48')]];delete this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x48')]];}}else if(!_[_0xda85('0x46')](this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x49')]])){this[_0xda85('0x16')](_0x2e2cc8[_0xda85('0x49')]);if(this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x4a')]]){this['channels'][_0x2e2cc8[_0xda85('0x4a')]][_0xda85('0x24')]=!![];this['channels'][_0x2e2cc8[_0xda85('0x47')]]=this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x4a')]];delete this[_0xda85('0x8')][_0x2e2cc8[_0xda85('0x4a')]];}}}catch(_0x520597){logger[_0xda85('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x520597['message']);}};Acw[_0xda85('0x15')][_0xda85('0x10')]=function(_0x43afa5){try{if(this[_0xda85('0x8')][_0x43afa5[_0xda85('0x4b')]]){logger[_0xda85('0x22')](_0xda85('0x4c'),JSON[_0xda85('0x38')](_0x43afa5[_0xda85('0x4b')]));this[_0xda85('0x16')](_0x43afa5['transfereruniqueid']);}else if(this['channels'][_0x43afa5[_0xda85('0x4d')]]){logger[_0xda85('0x22')](_0xda85('0x4e'),JSON[_0xda85('0x38')](_0x43afa5[_0xda85('0x4d')]));this[_0xda85('0x16')](_0x43afa5[_0xda85('0x4d')]);}}catch(_0x269d75){logger[_0xda85('0x30')](_0xda85('0x4f'),_0x269d75[_0xda85('0x34')]);}};Acw[_0xda85('0x15')]['syncAgentRingNoAnswer']=function(_0x49cb75){try{if(this['voiceQueues'][_0x49cb75[_0xda85('0x18')]]&&this['voiceQueues'][_0x49cb75['queue']][_0xda85('0x50')]===_0xda85('0x51')){if(this['agents'][_0x49cb75['interface']]){logger[_0xda85('0x22')](_0xda85('0x52'),_0x49cb75[_0xda85('0x2d')],_0x49cb75[_0xda85('0x17')],_0x49cb75[_0xda85('0x18')]);return RpcUser[_0xda85('0x26')](this[_0xda85('0x6')][_0x49cb75[_0xda85('0x17')]],_0xda85('0x53'),_0x49cb75[_0xda85('0x2d')]);}}}catch(_0x1962cc){logger['error'](_0xda85('0x54'),_0x1962cc[_0xda85('0x34')]);}};module[_0xda85('0x55')]=Acw; \ No newline at end of file +var _0xd680=['[ACW][syncAgentConnect]\x20%s','interface','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','startAcw','queue','ACW','mandatoryDispositionPause','Action','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','update','uniqueid','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20%s','mandatoryDisposition'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0xd680,0xba));var _0x0d68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd680[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0d68('0x0'));var _=require(_0x0d68('0x1'));var moment=require(_0x0d68('0x2'));var ami=require(_0x0d68('0x3'));var logger=require('../../../config/logger')(_0x0d68('0x4'));var RpcUser=require(_0x0d68('0x5'));var RpcVoiceAgentReport=require(_0x0d68('0x6'));function Acw(_0x49cc0c){this['voiceQueues']=_0x49cc0c[_0x0d68('0x7')];this[_0x0d68('0x8')]=_0x49cc0c[_0x0d68('0x8')];this[_0x0d68('0x9')]=_0x49cc0c['timers'];this[_0x0d68('0xa')]={};ami['on']('agentconnect',this[_0x0d68('0xb')][_0x0d68('0xc')](this));ami['on'](_0x0d68('0xd'),this[_0x0d68('0xe')][_0x0d68('0xc')](this));ami['on'](_0x0d68('0xf'),this['syncHangup'][_0x0d68('0xc')](this));ami['on'](_0x0d68('0x10'),this[_0x0d68('0x11')]['bind'](this));ami['on'](_0x0d68('0x12'),this[_0x0d68('0x13')][_0x0d68('0xc')](this));ami['on'](_0x0d68('0x14'),this[_0x0d68('0x15')][_0x0d68('0xc')](this));ami['on'](_0x0d68('0x16'),this[_0x0d68('0x17')][_0x0d68('0xc')](this));}function getDiff(_0x4dcab1){var _0x57a7ae=moment()[_0x0d68('0x18')](0x0);var _0x379c0c=moment(_0x4dcab1)[_0x0d68('0x18')](0x0);return _0x57a7ae['diff'](_0x379c0c,_0x0d68('0x19'));}Acw['prototype'][_0x0d68('0x1a')]=function(_0x809cbc){try{var _0x5bd996=this;var _0x222c10=this[_0x0d68('0xa')][_0x809cbc]['interface'];var _0x12e044=this['channels'][_0x809cbc][_0x0d68('0x1b')];var _0x11e259=this['voiceQueues'][_0x12e044];var _0x24d109=![];var _0x3eb52d=_0x0d68('0x1c');if(_0x11e259['mandatoryDisposition']){if(_0x11e259[_0x0d68('0x1d')]['name']){_0x24d109=!![];_0x3eb52d=_0x11e259[_0x0d68('0x1d')]['name'];}}ami[_0x0d68('0x1e')]({'action':'QueuePause','interface':_0x222c10,'paused':!![],'reason':_0x3eb52d})['then'](function(_0x19d6d5){if(_0x5bd996[_0x0d68('0x8')][_0x222c10]){return RpcUser['getAgent'](_0x5bd996[_0x0d68('0x8')][_0x222c10]['id'])['then'](function(_0x55c067){if(_0x55c067&&!_0x55c067[_0x0d68('0x1f')]){logger[_0x0d68('0x20')](_0x0d68('0x21'),_0x809cbc,_0x222c10,_0x12e044);var _0x5d7f74=_0x5bd996[_0x0d68('0xa')][_0x809cbc]['attended']&&_0x5bd996['channels'][_0x809cbc][_0x0d68('0x22')]?_0x5bd996[_0x0d68('0xa')][_0x809cbc][_0x0d68('0x22')]:_0x809cbc;return RpcUser[_0x0d68('0x23')](_0x5bd996['agents'][_0x222c10],_0x3eb52d,_0x5d7f74)[_0x0d68('0x24')](function(_0x1953d9){if(!_0x24d109){_0x5bd996[_0x0d68('0x9')][_0x222c10]={};logger['info'](_0x0d68('0x25'),_0x809cbc,_0x5bd996[_0x0d68('0x7')][_0x12e044][_0x0d68('0x26')],_0x222c10,_0x12e044);_0x5bd996[_0x0d68('0x9')][_0x222c10][_0x0d68('0x27')]=setTimeout(_0x5bd996[_0x0d68('0x28')][_0x0d68('0xc')](_0x5bd996,_0x222c10),_0x5bd996[_0x0d68('0x7')][_0x12e044]['acwTimeout']*0x3e8);_0x5bd996['timers'][_0x222c10][_0x0d68('0x29')]=moment()['format'](_0x0d68('0x2a'));_0x5bd996['timers'][_0x222c10]['uniqueid']=_0x809cbc;_0x5bd996['timers'][_0x222c10][_0x0d68('0x1b')]=_0x12e044;_0x5bd996[_0x0d68('0x9')][_0x222c10]['updateAcw']=function(){var _0x4fa46e=getDiff(_0x5bd996[_0x0d68('0x9')][_0x222c10][_0x0d68('0x29')]);clearTimeout(_0x5bd996['timers'][_0x222c10]['timer']);_0x5bd996['timers'][_0x222c10][_0x0d68('0x27')]=![];RpcVoiceAgentReport[_0x0d68('0x2b')]({'acwtime':_0x4fa46e},_0x5bd996['timers'][_0x222c10][_0x0d68('0x2c')],_0x222c10)[_0x0d68('0x24')](function(_0x476662){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x809cbc,_0x4fa46e,_0x476662);})[_0x0d68('0x2d')](function(_0x49037f){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x809cbc,_0x49037f);});delete _0x5bd996['timers'][_0x222c10];};}});}else{logger[_0x0d68('0x20')](_0x0d68('0x2e'),_0x809cbc,_0x222c10,_0x12e044);}});}})[_0x0d68('0x2d')](function(_0x3b33d1){logger['error'](_0x0d68('0x25'),_0x809cbc,_0x5bd996['voiceQueues'][_0x12e044][_0x0d68('0x26')],_0x222c10,_0x12e044);})[_0x0d68('0x2f')](function(){delete _0x5bd996['channels'][_0x809cbc];});}catch(_0x150e0b){logger[_0x0d68('0x30')](_0x0d68('0x31'),_0x150e0b[_0x0d68('0x32')]);}};Acw[_0x0d68('0x33')]['stopAcw']=function(_0x3bb742){try{var _0x1ec90f=this;if(_0x1ec90f['timers'][_0x3bb742]){_0x1ec90f[_0x0d68('0x9')][_0x3bb742][_0x0d68('0x27')]=![];var _0x33d216=_0x1ec90f[_0x0d68('0x9')][_0x3bb742][_0x0d68('0x2c')];var _0x12cea7=_0x1ec90f['timers'][_0x3bb742][_0x0d68('0x1b')];var _0x21f0f8=_0x1ec90f[_0x0d68('0x7')][_0x12cea7][_0x0d68('0x26')];logger[_0x0d68('0x20')](_0x0d68('0x34'),_0x33d216,_0x3bb742);RpcUser['saveUnpause'](this[_0x0d68('0x8')][_0x3bb742]);RpcVoiceAgentReport['update']({'acwtime':_0x21f0f8,'agentacw':!![]},_0x33d216,_0x3bb742)[_0x0d68('0x24')](function(_0x2bd1b2){logger[_0x0d68('0x20')](_0x0d68('0x35'),_0x33d216,_0x21f0f8,_0x2bd1b2);})['catch'](function(_0x10e5bb){logger['error'](_0x0d68('0x36'),_0x33d216,_0x10e5bb);});}else{logger[_0x0d68('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x3bb742);if(_0x1ec90f[_0x0d68('0x9')]){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0x1ec90f['timers']));}}}catch(_0x28f32d){logger[_0x0d68('0x30')](_0x0d68('0x37'),_0x28f32d[_0x0d68('0x32')]);}};Acw[_0x0d68('0x33')]['syncAgentConnect']=function(_0x12cf62){try{if(this[_0x0d68('0x7')][_0x12cf62[_0x0d68('0x1b')]]&&(this[_0x0d68('0x7')][_0x12cf62[_0x0d68('0x1b')]][_0x0d68('0x4')]||this['voiceQueues'][_0x12cf62[_0x0d68('0x1b')]][_0x0d68('0x38')])){if(this[_0x0d68('0x8')][_0x12cf62['interface']]){this['channels'][_0x12cf62['uniqueid']]={'queue':_0x12cf62[_0x0d68('0x1b')],'interface':_0x12cf62['interface'],'destlinkedid':_0x12cf62['destlinkedid']};}}}catch(_0x2241b3){logger['error'](_0x0d68('0x39'),_0x2241b3['message']);}};Acw[_0x0d68('0x33')][_0x0d68('0x17')]=function(_0x4cb900){try{if(this['voiceQueues'][_0x4cb900['queue']]&&(this[_0x0d68('0x7')][_0x4cb900[_0x0d68('0x1b')]][_0x0d68('0x4')]||this['voiceQueues'][_0x4cb900[_0x0d68('0x1b')]]['mandatoryDisposition'])){if(this[_0x0d68('0x8')][_0x4cb900[_0x0d68('0x3a')]]){this[_0x0d68('0xa')][_0x4cb900[_0x0d68('0x2c')]]={'queue':_0x4cb900['queue'],'interface':_0x4cb900[_0x0d68('0x3a')]};}}}catch(_0x41e557){logger[_0x0d68('0x30')]('[ACW][syncAgentConnectPreview]\x20%s',_0x41e557[_0x0d68('0x32')]);}};Acw[_0x0d68('0x33')][_0x0d68('0xe')]=function(_0x49677c){try{if(this[_0x0d68('0xa')][_0x49677c[_0x0d68('0x2c')]]&&_[_0x0d68('0x3b')](this[_0x0d68('0xa')][_0x49677c['uniqueid']][_0x0d68('0x3c')])){logger[_0x0d68('0x20')](_0x0d68('0x3d'),_0x49677c[_0x0d68('0x2c')]);this['startAcw'](_0x49677c[_0x0d68('0x2c')]);}else if(this['channels'][_0x49677c[_0x0d68('0x3e')]]&&_['isUndefined'](this[_0x0d68('0xa')][_0x49677c['linkedid']][_0x0d68('0x3c')])){logger[_0x0d68('0x20')](_0x0d68('0x3f'),_0x49677c[_0x0d68('0x3e')]);this[_0x0d68('0x1a')](_0x49677c['linkedid']);}}catch(_0x23f432){logger[_0x0d68('0x30')]('[ACW][syncHangupRequest]\x20%s',_0x23f432[_0x0d68('0x32')]);}};Acw[_0x0d68('0x33')][_0x0d68('0x40')]=function(_0x495069){try{if(this[_0x0d68('0xa')][_0x495069[_0x0d68('0x2c')]]&&this[_0x0d68('0xa')][_0x495069['uniqueid']][_0x0d68('0x3c')]){logger[_0x0d68('0x20')](_0x0d68('0x41'),_0x495069[_0x0d68('0x2c')]);this[_0x0d68('0x1a')](_0x495069[_0x0d68('0x2c')]);}else if(this['channels'][_0x495069[_0x0d68('0x3e')]]&&this[_0x0d68('0xa')][_0x495069['linkedid']]['attended']){logger[_0x0d68('0x20')](_0x0d68('0x42'),_0x495069[_0x0d68('0x3e')]);this[_0x0d68('0x1a')](_0x495069[_0x0d68('0x3e')]);}}catch(_0x2547ad){logger[_0x0d68('0x30')]('[ACW][syncHangup]\x20%s',_0x2547ad[_0x0d68('0x32')]);}};Acw[_0x0d68('0x33')][_0x0d68('0x13')]=function(_0x3017aa){try{if(!_['isNil'](this[_0x0d68('0xa')][_0x3017aa['transfereeuniqueid']])){this[_0x0d68('0x1a')](_0x3017aa[_0x0d68('0x43')]);if(this['channels'][_0x3017aa['secondtransfereruniqueid']]){this['channels'][_0x3017aa[_0x0d68('0x44')]][_0x0d68('0x3c')]=!![];this['channels'][_0x3017aa[_0x0d68('0x45')]]=this[_0x0d68('0xa')][_0x3017aa[_0x0d68('0x44')]];delete this[_0x0d68('0xa')][_0x3017aa[_0x0d68('0x44')]];}}else if(!_['isNil'](this[_0x0d68('0xa')][_0x3017aa[_0x0d68('0x45')]])){this[_0x0d68('0x1a')](_0x3017aa['transfertargetuniqueid']);if(this['channels'][_0x3017aa[_0x0d68('0x46')]]){this[_0x0d68('0xa')][_0x3017aa[_0x0d68('0x46')]][_0x0d68('0x3c')]=!![];this[_0x0d68('0xa')][_0x3017aa[_0x0d68('0x43')]]=this[_0x0d68('0xa')][_0x3017aa[_0x0d68('0x46')]];delete this['channels'][_0x3017aa[_0x0d68('0x46')]];}}}catch(_0x4d9781){logger[_0x0d68('0x30')](_0x0d68('0x47'),_0x4d9781[_0x0d68('0x32')]);}};Acw[_0x0d68('0x33')][_0x0d68('0x15')]=function(_0x58700c){try{if(this[_0x0d68('0xa')][_0x58700c[_0x0d68('0x48')]]){logger[_0x0d68('0x20')](_0x0d68('0x49'),JSON[_0x0d68('0x4a')](_0x58700c[_0x0d68('0x48')]));this['startAcw'](_0x58700c['transfereruniqueid']);}else if(this[_0x0d68('0xa')][_0x58700c[_0x0d68('0x4b')]]){logger[_0x0d68('0x20')](_0x0d68('0x4c'),JSON[_0x0d68('0x4a')](_0x58700c[_0x0d68('0x4b')]));this[_0x0d68('0x1a')](_0x58700c['transfererlinkedid']);}}catch(_0x1a8ace){logger[_0x0d68('0x30')](_0x0d68('0x4d'),_0x1a8ace[_0x0d68('0x32')]);}};Acw[_0x0d68('0x33')][_0x0d68('0x11')]=function(_0x46f535){try{if(this['voiceQueues'][_0x46f535[_0x0d68('0x1b')]]&&this['voiceQueues'][_0x46f535[_0x0d68('0x1b')]]['autopause']===_0x0d68('0x4e')){if(this[_0x0d68('0x8')][_0x46f535[_0x0d68('0x3a')]]){logger[_0x0d68('0x20')](_0x0d68('0x4f'),_0x46f535[_0x0d68('0x2c')],_0x46f535[_0x0d68('0x3a')],_0x46f535[_0x0d68('0x1b')]);return RpcUser[_0x0d68('0x23')](this[_0x0d68('0x8')][_0x46f535[_0x0d68('0x3a')]],_0x0d68('0x50'),_0x46f535[_0x0d68('0x2c')]);}}}catch(_0x2b89f4){logger[_0x0d68('0x30')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x2b89f4[_0x0d68('0x32')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e8f7ea2..31c5d75 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 _0x75a8=['password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','username','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','log','exports','asterisk-manager','util','lodash','../../config/logger','ami','asterisk','port'];(function(_0x4e3f12,_0x60aded){var _0x2f7b03=function(_0xc625d0){while(--_0xc625d0){_0x4e3f12['push'](_0x4e3f12['shift']());}};_0x2f7b03(++_0x60aded);}(_0x75a8,0xfc));var _0x875a=function(_0x4a1456,_0x401436){_0x4a1456=_0x4a1456-0x0;var _0x33f119=_0x75a8[_0x4a1456];return _0x33f119;};'use strict';var Manager=require(_0x875a('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require(_0x875a('0x1'));var _=require(_0x875a('0x2'));var logger=require(_0x875a('0x3'))(_0x875a('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x875a('0x5')][_0x875a('0x6')],config[_0x875a('0x5')]['ip'],config['asterisk']['username'],config[_0x875a('0x5')][_0x875a('0x7')],!![]);ami['keepConnected']();ami[_0x875a('0x8')]=BPromise[_0x875a('0x9')](ami[_0x875a('0xa')]);function error(_0x27d123){logger[_0x875a('0xb')](util[_0x875a('0xc')](_0x875a('0xd'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x875a('0x5')][_0x875a('0x6')],util['inspect'](_0x27d123,![],null)));}function close(){logger[_0x875a('0xb')](util['format'](_0x875a('0xe'),config[_0x875a('0x5')]['username'],config[_0x875a('0x5')]['ip'],config[_0x875a('0x5')][_0x875a('0x6')]));}ami[_0x875a('0xf')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x875a('0x10')]=function(){return function(){return ami['Action']({'action':_0x875a('0x11')});};};ami[_0x875a('0x12')]=function(){return function(){return ami[_0x875a('0x8')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x875a('0x8')]({'action':_0x875a('0x13')});};};ami[_0x875a('0x14')]=function(){return function(){return ami['Action']({'action':_0x875a('0x15')});};};function connect(_0x363f42){logger[_0x875a('0x16')](util[_0x875a('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x875a('0x5')]['username'],config['asterisk']['ip'],config[_0x875a('0x5')][_0x875a('0x6')]));ami['once'](_0x875a('0xb'),error);ami[_0x875a('0x17')](_0x875a('0x18'),close);}ami['on'](_0x875a('0x19'),connect);ami['on'](_0x875a('0x1a'),function(_0x1d2333){logger['info'](util['format'](_0x875a('0x1b'),config['asterisk'][_0x875a('0x1c')],config['asterisk']['ip'],config['asterisk'][_0x875a('0x6')],util['inspect'](_0x1d2333,![],null)));});ami['on'](_0x875a('0x1d'),function(_0x544729){logger[_0x875a('0x16')](util[_0x875a('0xc')](_0x875a('0x1e'),config[_0x875a('0x5')]['username'],config[_0x875a('0x5')]['ip'],config[_0x875a('0x5')][_0x875a('0x6')]));return BPromise[_0x875a('0x1f')]()['then'](ami['actionSipShowRegistry']())[_0x875a('0x20')](ami[_0x875a('0x10')]())['then'](ami[_0x875a('0x12')]())['then'](ami[_0x875a('0x21')]())['then'](ami['actionCoreShowChannels']())[_0x875a('0x22')](function(_0x28a307){console[_0x875a('0x23')](_0x28a307);});});ami[_0x875a('0x17')](_0x875a('0xb'),error);ami[_0x875a('0x17')](_0x875a('0x18'),close);module[_0x875a('0x24')]=ami; \ No newline at end of file +var _0xbb35=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','resolve','actionSipShowRegistry','then','catch','log','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','port','asterisk','username','password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','info'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xbb35,0x187));var _0x5bb3=function(_0x3552f9,_0x5ef563){_0x3552f9=_0x3552f9-0x0;var _0x597c0a=_0xbb35[_0x3552f9];return _0x597c0a;};'use strict';var Manager=require(_0x5bb3('0x0'));var BPromise=require(_0x5bb3('0x1'));var moment=require(_0x5bb3('0x2'));var util=require(_0x5bb3('0x3'));var _=require(_0x5bb3('0x4'));var logger=require(_0x5bb3('0x5'))('ami');var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0x5bb3('0x6')],config[_0x5bb3('0x7')]['ip'],config[_0x5bb3('0x7')][_0x5bb3('0x8')],config[_0x5bb3('0x7')][_0x5bb3('0x9')],!![]);ami[_0x5bb3('0xa')]();ami[_0x5bb3('0xb')]=BPromise[_0x5bb3('0xc')](ami[_0x5bb3('0xd')]);function error(_0x5f4f5a){logger['error'](util[_0x5bb3('0xe')](_0x5bb3('0xf'),config[_0x5bb3('0x7')][_0x5bb3('0x8')],config[_0x5bb3('0x7')]['ip'],config[_0x5bb3('0x7')][_0x5bb3('0x6')],util[_0x5bb3('0x10')](_0x5f4f5a,![],null)));}function close(){logger[_0x5bb3('0x11')](util[_0x5bb3('0xe')](_0x5bb3('0x12'),config[_0x5bb3('0x7')][_0x5bb3('0x8')],config[_0x5bb3('0x7')]['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x5bb3('0xb')]({'action':_0x5bb3('0x13')});};};ami[_0x5bb3('0x14')]=function(){return function(){return ami[_0x5bb3('0xb')]({'action':_0x5bb3('0x15')});};};ami[_0x5bb3('0x16')]=function(){return function(){return ami[_0x5bb3('0xb')]({'action':_0x5bb3('0x17')});};};ami[_0x5bb3('0x18')]=function(){return function(){return ami[_0x5bb3('0xb')]({'action':_0x5bb3('0x19')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(_0xeee9c4){logger[_0x5bb3('0x1a')](util[_0x5bb3('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x5bb3('0x7')][_0x5bb3('0x8')],config['asterisk']['ip'],config[_0x5bb3('0x7')][_0x5bb3('0x6')]));ami[_0x5bb3('0x1b')](_0x5bb3('0x11'),error);ami[_0x5bb3('0x1b')](_0x5bb3('0x1c'),close);}ami['on'](_0x5bb3('0x1d'),connect);ami['on'](_0x5bb3('0x1e'),function(_0x2008ca){logger[_0x5bb3('0x1a')](util[_0x5bb3('0xe')](_0x5bb3('0x1f'),config['asterisk'][_0x5bb3('0x8')],config[_0x5bb3('0x7')]['ip'],config['asterisk'][_0x5bb3('0x6')],util[_0x5bb3('0x10')](_0x2008ca,![],null)));});ami['on']('fullybooted',function(_0x5b4602){logger[_0x5bb3('0x1a')](util[_0x5bb3('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x5bb3('0x7')][_0x5bb3('0x8')],config['asterisk']['ip'],config[_0x5bb3('0x7')][_0x5bb3('0x6')]));return BPromise[_0x5bb3('0x20')]()['then'](ami[_0x5bb3('0x21')]())[_0x5bb3('0x22')](ami[_0x5bb3('0x14')]())[_0x5bb3('0x22')](ami[_0x5bb3('0x16')]())[_0x5bb3('0x22')](ami[_0x5bb3('0x18')]())[_0x5bb3('0x22')](ami['actionCoreShowChannels']())[_0x5bb3('0x23')](function(_0xedfe3b){console[_0x5bb3('0x24')](_0xedfe3b);});});ami[_0x5bb3('0x1b')](_0x5bb3('0x11'),error);ami[_0x5bb3('0x1b')](_0x5bb3('0x1c'),close);module[_0x5bb3('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a4d51a2..a8cfe5c 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x28a1e4,_0x36b53c){var _0x1c1cca=function(_0x576f1e){while(--_0x576f1e){_0x28a1e4['push'](_0x28a1e4['shift']());}};_0x1c1cca(++_0x36b53c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1a5ad1,_0x357407){_0x1a5ad1=_0x1a5ad1-0x0;var _0x7b8b22=_0xbdb7[_0x1a5ad1];return _0x7b8b22;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x49ba25,_0x187b5c){var _0x320a2f=function(_0x3bd2a6){while(--_0x3bd2a6){_0x49ba25['push'](_0x49ba25['shift']());}};_0x320a2f(++_0x187b5c);}(_0xaa88,0x137));var _0x8aa8=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xaa88[_0x39780c];return _0x53c19b;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 66f1b14..89c7999 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 _0xbade=['voiceQueue','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype'];(function(_0x5c43e1,_0x4c1705){var _0x397fa7=function(_0x4485e8){while(--_0x4485e8){_0x5c43e1['push'](_0x5c43e1['shift']());}};_0x397fa7(++_0x4c1705);}(_0xbade,0x88));var _0xebad=function(_0x2bb66c,_0x36c6c6){_0x2bb66c=_0x2bb66c-0x0;var _0x1e0f98=_0xbade[_0x2bb66c];return _0x1e0f98;};'use strict';var util=require(_0xebad('0x0'));var _=require(_0xebad('0x1'));var moment=require(_0xebad('0x2'));function checkNameSurname(_0x3f6a16,_0x2bbe2a,_0x40ac13){var _0x354158='';if(!_[_0xebad('0x3')](_0x2bbe2a)&&_0xebad('0x4')===typeof _0x2bbe2a){_0x354158+=_0x2bbe2a;}if(!_[_0xebad('0x3')](_0x40ac13)&&_0xebad('0x4')===typeof _0x40ac13){_0x354158+='\x20'+_0x40ac13;}if(_0x354158!==''){return _0x354158;}return _0x3f6a16;}function Action(_0xb6c903,_0x5c9d9d,_0x27bc88){this['voiceQueue']=_0xb6c903;this[_0xebad('0x5')]=_0x27bc88||undefined;this[_0xebad('0x6')]=checkNameSurname(_0x5c9d9d[_0xebad('0x7')][_0xebad('0x8')],_0x5c9d9d[_0xebad('0x7')]['firstName'],_0x5c9d9d[_0xebad('0x7')][_0xebad('0x9')]);this[_0xebad('0xa')]=_0x5c9d9d[_0xebad('0x7')][_0xebad('0x8')];this[_0xebad('0xb')]=_0xb6c903[_0xebad('0x6')];this[_0xebad('0xc')]=_0x5c9d9d[_0xebad('0xc')]||![];this[_0xebad('0xd')]=_0xb6c903['type'];this[_0xebad('0xe')]=_0xb6c903[_0xebad('0xe')]||0x3;this[_0xebad('0xf')]=_0x5c9d9d[_0xebad('0xf')];this['countbusyretry']=_0x5c9d9d[_0xebad('0x10')];this[_0xebad('0x11')]=_0x5c9d9d['countcongestionretry'];this[_0xebad('0x12')]=_0x5c9d9d[_0xebad('0x12')];this[_0xebad('0x13')]=_0x5c9d9d[_0xebad('0x13')];this[_0xebad('0x14')]=_0x5c9d9d[_0xebad('0x14')];this[_0xebad('0x15')]=_0x5c9d9d[_0xebad('0x15')];this[_0xebad('0x16')]=_0x5c9d9d['countmachineretry'];this[_0xebad('0x17')]=_0x5c9d9d[_0xebad('0x17')];this['ContactId']=_0x5c9d9d[_0xebad('0x18')];this[_0xebad('0x19')]=_0x5c9d9d[_0xebad('0x19')];this['UserId']=_0x5c9d9d[_0xebad('0x1a')];this[_0xebad('0x1b')]=_0x5c9d9d['VoiceQueueId'];this[_0xebad('0x1c')]=_0x5c9d9d[_0xebad('0x1c')];this[_0xebad('0x1d')]=_0x5c9d9d['id'];this[_0xebad('0x1e')]=_0x5c9d9d[_0xebad('0x7')][_0xebad('0x1f')]||'';this[_0xebad('0x20')]=moment()[_0xebad('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x5c9d9d[_0xebad('0x22')];this[_0xebad('0x23')]=_0x5c9d9d[_0xebad('0x23')];this['callbackat']=_0x5c9d9d[_0xebad('0x24')];this['recallme']=_0x5c9d9d[_0xebad('0x25')];this[_0xebad('0x26')]='';this['originatecalleridname']='';}Action[_0xebad('0x27')]['getCaller']=function(){return util[_0xebad('0x21')]('\x22%s\x22\x20<%s>',this[_0xebad('0x6')],this[_0xebad('0x28')][_0xebad('0x29')]>0x0?this[_0xebad('0xa')]['substring'](this[_0xebad('0x28')][_0xebad('0x29')]):this[_0xebad('0xa')]);};Action[_0xebad('0x27')][_0xebad('0x2a')]=function(){return this[_0xebad('0xb')];};module[_0xebad('0x2b')]=Action; \ No newline at end of file +var _0x0428=['number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0428,0xa6));var _0x8042=function(_0x29db84,_0xf4b291){_0x29db84=_0x29db84-0x0;var _0x4381ef=_0x0428[_0x29db84];return _0x4381ef;};'use strict';var util=require(_0x8042('0x0'));var _=require(_0x8042('0x1'));var moment=require('moment');function checkNameSurname(_0x491922,_0x184bab,_0x5ee989){var _0x18de8f='';if(!_['isNil'](_0x184bab)&&'string'===typeof _0x184bab){_0x18de8f+=_0x184bab;}if(!_[_0x8042('0x2')](_0x5ee989)&&_0x8042('0x3')===typeof _0x5ee989){_0x18de8f+='\x20'+_0x5ee989;}if(_0x18de8f!==''){return _0x18de8f;}return _0x491922;}function Action(_0x502ae9,_0xa35eae,_0x48a029){this[_0x8042('0x4')]=_0x502ae9;this[_0x8042('0x5')]=_0x48a029||undefined;this[_0x8042('0x6')]=checkNameSurname(_0xa35eae[_0x8042('0x7')][_0x8042('0x8')],_0xa35eae[_0x8042('0x7')]['firstName'],_0xa35eae[_0x8042('0x7')][_0x8042('0x9')]);this[_0x8042('0xa')]=_0xa35eae[_0x8042('0x7')][_0x8042('0x8')];this[_0x8042('0xb')]=_0x502ae9[_0x8042('0x6')];this['active']=_0xa35eae[_0x8042('0xc')]||![];this['type']=_0x502ae9[_0x8042('0xd')];this['dialQueueTimeout']=_0x502ae9[_0x8042('0xe')]||0x3;this['scheduledat']=_0xa35eae[_0x8042('0xf')];this['countbusyretry']=_0xa35eae[_0x8042('0x10')];this[_0x8042('0x11')]=_0xa35eae['countcongestionretry'];this[_0x8042('0x12')]=_0xa35eae[_0x8042('0x12')];this[_0x8042('0x13')]=_0xa35eae[_0x8042('0x13')];this[_0x8042('0x14')]=_0xa35eae[_0x8042('0x14')];this[_0x8042('0x15')]=_0xa35eae[_0x8042('0x15')];this['countmachineretry']=_0xa35eae[_0x8042('0x16')];this[_0x8042('0x17')]=_0xa35eae[_0x8042('0x17')];this['ContactId']=_0xa35eae[_0x8042('0x18')];this[_0x8042('0x19')]=_0xa35eae[_0x8042('0x19')];this['UserId']=_0xa35eae[_0x8042('0x1a')];this[_0x8042('0x1b')]=_0xa35eae[_0x8042('0x1b')];this[_0x8042('0x1c')]=_0xa35eae[_0x8042('0x1c')];this[_0x8042('0x1d')]=_0xa35eae['id'];this['ContactFirstName']=_0xa35eae['Contact'][_0x8042('0x1e')]||'';this[_0x8042('0x1f')]=moment()['format'](_0x8042('0x20'));this[_0x8042('0x21')]=_0xa35eae[_0x8042('0x21')];this['callbackuniqueid']=_0xa35eae['callbackuniqueid'];this[_0x8042('0x22')]=_0xa35eae[_0x8042('0x22')];this[_0x8042('0x23')]=_0xa35eae[_0x8042('0x23')];this[_0x8042('0x24')]='';this[_0x8042('0x25')]='';}Action['prototype'][_0x8042('0x26')]=function(){return util['format'](_0x8042('0x27'),this[_0x8042('0x6')],this['voiceQueue'][_0x8042('0x28')]>0x0?this[_0x8042('0xa')][_0x8042('0x29')](this[_0x8042('0x4')][_0x8042('0x28')]):this[_0x8042('0xa')]);};Action['prototype'][_0x8042('0x2a')]=function(){return this[_0x8042('0xb')];};module[_0x8042('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 791c1cb..1441600 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 _0x654f=['calleridnum','starttime','responsetime','answertime','endtime','format','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name'];(function(_0x1be6fe,_0x108331){var _0x146a5b=function(_0x3f433a){while(--_0x3f433a){_0x1be6fe['push'](_0x1be6fe['shift']());}};_0x146a5b(++_0x108331);}(_0x654f,0x16d));var _0xf654=function(_0x436ee7,_0xb176c1){_0x436ee7=_0x436ee7-0x0;var _0x38f88e=_0x654f[_0x436ee7];return _0x38f88e;};'use strict';var util=require('util');var _=require(_0xf654('0x0'));var moment=require(_0xf654('0x1'));function getSeconds(_0x2021dd,_0x178009){var _0xed491f=moment(_0x2021dd)[_0xf654('0x2')](0x0);var _0x4bb3b6=moment(_0x178009)[_0xf654('0x2')](0x0);return _0xed491f[_0xf654('0x3')](_0x4bb3b6,'seconds');}function AgentComplete(_0x16fa31,_0x3fb143){this[_0xf654('0x4')]=0x4;this[_0xf654('0x5')]=_0xf654('0x6');this[_0xf654('0x7')]=_0x16fa31[_0xf654('0x7')];this['type']=_0x16fa31[_0xf654('0x8')];this[_0xf654('0x9')]=_0x16fa31[_0xf654('0x8')]===_0xf654('0xa')?_0xf654('0xb'):_0x16fa31[_0xf654('0x8')];this[_0xf654('0xc')]=_0x16fa31[_0xf654('0xc')];this[_0xf654('0xd')]=_0x16fa31[_0xf654('0xd')];this['countnoanswerretry']=_0x16fa31[_0xf654('0xe')];this['countglobal']=_0x16fa31[_0xf654('0xc')]+_0x16fa31[_0xf654('0xd')]+_0x16fa31['countnoanswerretry']+_0x16fa31[_0xf654('0xf')]+_0x16fa31[_0xf654('0x10')]+_0x16fa31[_0xf654('0x11')]+_0x16fa31[_0xf654('0x12')]+_0x16fa31['countagentrejectretry'];this[_0xf654('0xf')]=_0x16fa31['countnosuchnumberretry'];this[_0xf654('0x10')]=_0x16fa31[_0xf654('0x10')];this[_0xf654('0x11')]=_0x16fa31[_0xf654('0x11')];this[_0xf654('0x12')]=_0x16fa31['countmachineretry'];this[_0xf654('0x13')]=_0x16fa31['countagentrejectretry'];this[_0xf654('0x14')]=_0x3fb143[_0xf654('0x14')];this['calleridname']=_0x16fa31[_0xf654('0x15')];this[_0xf654('0x16')]=_0x16fa31['number'];this[_0xf654('0x17')]=_0x16fa31[_0xf654('0x17')];this['responsetime']=_0x16fa31[_0xf654('0x18')];this['answertime']=_0x16fa31[_0xf654('0x19')];this[_0xf654('0x1a')]=moment()[_0xf654('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x16fa31['responsetime'],_0x16fa31[_0xf654('0x17')]);this[_0xf654('0x1c')]=getSeconds(_0x16fa31[_0xf654('0x19')],_0x16fa31[_0xf654('0x18')]);this[_0xf654('0x1d')]=getSeconds(this[_0xf654('0x1a')],_0x16fa31[_0xf654('0x19')]);this[_0xf654('0xb')]=_0x3fb143[_0xf654('0xb')];this[_0xf654('0x1e')]=_0x3fb143[_0xf654('0x1e')];this['reason']=_0x3fb143['reason'];this['callback']=_0x16fa31[_0xf654('0x1f')];this['callbackuniqueid']=_0x16fa31[_0xf654('0x20')];this[_0xf654('0x21')]=_0x16fa31['callbackat'];this[_0xf654('0x22')]=_0x16fa31[_0xf654('0x22')];this[_0xf654('0x23')]=_0x16fa31['ContactId'];this[_0xf654('0x24')]=_0x16fa31[_0xf654('0x24')];this[_0xf654('0x25')]=_0x16fa31[_0xf654('0x25')];this[_0xf654('0x26')]=_0x16fa31[_0xf654('0x26')];this[_0xf654('0x27')]=_0x16fa31[_0xf654('0x27')];this[_0xf654('0x28')]=_0x16fa31[_0xf654('0x28')]||'';this[_0xf654('0x29')]=_0x16fa31['originatecalleridname']||'';}module[_0xf654('0x2a')]=AgentComplete; \ No newline at end of file +var _0xc2a5=['countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xc2a5,0x171));var _0x5c2a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc2a5[_0x432682];return _0x463d05;};'use strict';var util=require('util');var _=require(_0x5c2a('0x0'));var moment=require(_0x5c2a('0x1'));function getSeconds(_0xf8f57,_0x245eb0){var _0x113ef8=moment(_0xf8f57)['milliseconds'](0x0);var _0x4338fc=moment(_0x245eb0)[_0x5c2a('0x2')](0x0);return _0x113ef8[_0x5c2a('0x3')](_0x4338fc,'seconds');}function AgentComplete(_0x5cde38,_0x4d2246){this[_0x5c2a('0x4')]=0x4;this[_0x5c2a('0x5')]=_0x5c2a('0x6');this['scheduledat']=_0x5cde38[_0x5c2a('0x7')];this['type']=_0x5cde38[_0x5c2a('0x8')];this[_0x5c2a('0x9')]=_0x5cde38[_0x5c2a('0x8')]==='outbound'?_0x5c2a('0xa'):_0x5cde38['type'];this[_0x5c2a('0xb')]=_0x5cde38[_0x5c2a('0xb')];this[_0x5c2a('0xc')]=_0x5cde38[_0x5c2a('0xc')];this[_0x5c2a('0xd')]=_0x5cde38[_0x5c2a('0xd')];this[_0x5c2a('0xe')]=_0x5cde38['countbusyretry']+_0x5cde38[_0x5c2a('0xc')]+_0x5cde38[_0x5c2a('0xd')]+_0x5cde38[_0x5c2a('0xf')]+_0x5cde38[_0x5c2a('0x10')]+_0x5cde38[_0x5c2a('0x11')]+_0x5cde38[_0x5c2a('0x12')]+_0x5cde38[_0x5c2a('0x13')];this[_0x5c2a('0xf')]=_0x5cde38[_0x5c2a('0xf')];this['countdropretry']=_0x5cde38[_0x5c2a('0x10')];this[_0x5c2a('0x11')]=_0x5cde38[_0x5c2a('0x11')];this[_0x5c2a('0x12')]=_0x5cde38[_0x5c2a('0x12')];this[_0x5c2a('0x13')]=_0x5cde38[_0x5c2a('0x13')];this['uniqueid']=_0x4d2246[_0x5c2a('0x14')];this['calleridname']=_0x5cde38[_0x5c2a('0x15')];this['calleridnum']=_0x5cde38[_0x5c2a('0x16')];this[_0x5c2a('0x17')]=_0x5cde38[_0x5c2a('0x17')];this[_0x5c2a('0x18')]=_0x5cde38[_0x5c2a('0x18')];this['answertime']=_0x5cde38[_0x5c2a('0x19')];this[_0x5c2a('0x1a')]=moment()['format'](_0x5c2a('0x1b'));this[_0x5c2a('0x1c')]=getSeconds(_0x5cde38['responsetime'],_0x5cde38[_0x5c2a('0x17')]);this['holdtime']=getSeconds(_0x5cde38[_0x5c2a('0x19')],_0x5cde38['responsetime']);this['talktime']=getSeconds(this[_0x5c2a('0x1a')],_0x5cde38[_0x5c2a('0x19')]);this['queue']=_0x4d2246['queue'];this[_0x5c2a('0x1d')]=_0x4d2246[_0x5c2a('0x1d')];this['reason']=_0x4d2246[_0x5c2a('0x1e')];this[_0x5c2a('0x1f')]=_0x5cde38[_0x5c2a('0x1f')];this[_0x5c2a('0x20')]=_0x5cde38['callbackuniqueid'];this[_0x5c2a('0x21')]=_0x5cde38['callbackat'];this[_0x5c2a('0x22')]=_0x5cde38['recallme'];this[_0x5c2a('0x23')]=_0x5cde38[_0x5c2a('0x23')];this[_0x5c2a('0x24')]=_0x5cde38[_0x5c2a('0x24')];this[_0x5c2a('0x25')]=_0x5cde38['UserId'];this[_0x5c2a('0x26')]=_0x5cde38['VoiceQueueId'];this[_0x5c2a('0x27')]=_0x5cde38[_0x5c2a('0x27')];this[_0x5c2a('0x28')]=_0x5cde38[_0x5c2a('0x28')]||'';this['originatecalleridname']=_0x5cde38[_0x5c2a('0x29')]||'';}module[_0x5c2a('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 2bcc893..4bef624 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 _0x3c17=['countglobal','countnoanswerretry','countdropretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry'];(function(_0xe002df,_0x3ec72c){var _0x238399=function(_0x382fa7){while(--_0x382fa7){_0xe002df['push'](_0xe002df['shift']());}};_0x238399(++_0x3ec72c);}(_0x3c17,0x1a1));var _0x73c1=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x3c17[_0x40bffc];return _0x3007e9;};'use strict';var util=require(_0x73c1('0x0'));var _=require('lodash');var moment=require(_0x73c1('0x1'));function getSeconds(_0x58a810,_0x1a088c){var _0x19c8cc=moment(_0x58a810)[_0x73c1('0x2')](0x0);var _0x4cd427=moment(_0x1a088c)[_0x73c1('0x2')](0x0);return _0x19c8cc[_0x73c1('0x3')](_0x4cd427,_0x73c1('0x4'));}function Final(_0x64f862){this['uniqueid']=_0x64f862[_0x73c1('0x5')];this['scheduledat']=_0x64f862[_0x73c1('0x6')];this[_0x73c1('0x7')]=_0x64f862[_0x73c1('0x7')];this['campaigntype']=_0x64f862['type']===_0x73c1('0x8')?_0x73c1('0x9'):_0x64f862[_0x73c1('0x7')];this[_0x73c1('0xa')]=_0x64f862[_0x73c1('0xa')];this[_0x73c1('0xb')]=_0x64f862[_0x73c1('0xb')];this['countnoanswerretry']=_0x64f862['countnoanswerretry'];this[_0x73c1('0xc')]=_0x64f862[_0x73c1('0xa')]+_0x64f862[_0x73c1('0xb')]+_0x64f862[_0x73c1('0xd')]+_0x64f862['countnosuchnumberretry']+_0x64f862[_0x73c1('0xe')]+_0x64f862['countabandonedretry']+_0x64f862[_0x73c1('0xf')]+_0x64f862['countagentrejectretry'];this[_0x73c1('0x10')]=_0x64f862[_0x73c1('0x10')];this['countdropretry']=_0x64f862['countdropretry'];this[_0x73c1('0x11')]=_0x64f862['countabandonedretry'];this[_0x73c1('0xf')]=_0x64f862['countmachineretry'];this[_0x73c1('0x12')]=_0x64f862['countagentrejectretry'];this[_0x73c1('0x9')]=_0x64f862[_0x73c1('0x9')];this[_0x73c1('0x13')]=_0x64f862[_0x73c1('0x13')];this[_0x73c1('0x14')]=_0x64f862[_0x73c1('0x14')];this[_0x73c1('0x15')]=_0x64f862[_0x73c1('0x15')];this[_0x73c1('0x16')]=_0x64f862['responsetime'];this[_0x73c1('0x17')]=_0x64f862[_0x73c1('0x16')];this[_0x73c1('0x18')]=_0x64f862[_0x73c1('0x18')]||0x0;this['holdtime']=_0x64f862[_0x73c1('0x19')]||0x0;this[_0x73c1('0x1a')]=_0x64f862[_0x73c1('0x1a')]||0x0;this[_0x73c1('0x1b')]=_0x64f862[_0x73c1('0x1b')];this[_0x73c1('0x1c')]=_0x64f862[_0x73c1('0x1c')];this[_0x73c1('0x1d')]=_0x64f862['callbackat'];this[_0x73c1('0x1e')]=_0x64f862[_0x73c1('0x1e')];this[_0x73c1('0x1f')]=_0x64f862['ContactId'];this[_0x73c1('0x20')]=_0x64f862[_0x73c1('0x20')];this[_0x73c1('0x21')]=_0x64f862[_0x73c1('0x21')];this[_0x73c1('0x22')]=_0x64f862['VoiceQueueId'];this[_0x73c1('0x23')]=_0x64f862['CampaignId'];this['originatecalleridnum']=_0x64f862[_0x73c1('0x24')]||'';this[_0x73c1('0x25')]=_0x64f862[_0x73c1('0x25')]||'';}module[_0x73c1('0x26')]=Final; \ No newline at end of file +var _0x7bae=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','exports','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime'];(function(_0x3b65a8,_0x12003a){var _0x34258e=function(_0x97d66){while(--_0x97d66){_0x3b65a8['push'](_0x3b65a8['shift']());}};_0x34258e(++_0x12003a);}(_0x7bae,0x13b));var _0xe7ba=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7bae[_0x1035c1];return _0x308d67;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe7ba('0x0'));function getSeconds(_0x1e05c4,_0x503803){var _0x3963c7=moment(_0x1e05c4)['milliseconds'](0x0);var _0x120efa=moment(_0x503803)[_0xe7ba('0x1')](0x0);return _0x3963c7[_0xe7ba('0x2')](_0x120efa,_0xe7ba('0x3'));}function Final(_0x398a6a){this[_0xe7ba('0x4')]=_0x398a6a[_0xe7ba('0x4')];this[_0xe7ba('0x5')]=_0x398a6a[_0xe7ba('0x5')];this[_0xe7ba('0x6')]=_0x398a6a[_0xe7ba('0x6')];this[_0xe7ba('0x7')]=_0x398a6a[_0xe7ba('0x6')]===_0xe7ba('0x8')?'queue':_0x398a6a[_0xe7ba('0x6')];this[_0xe7ba('0x9')]=_0x398a6a[_0xe7ba('0x9')];this[_0xe7ba('0xa')]=_0x398a6a[_0xe7ba('0xa')];this[_0xe7ba('0xb')]=_0x398a6a[_0xe7ba('0xb')];this[_0xe7ba('0xc')]=_0x398a6a[_0xe7ba('0x9')]+_0x398a6a['countcongestionretry']+_0x398a6a[_0xe7ba('0xb')]+_0x398a6a['countnosuchnumberretry']+_0x398a6a[_0xe7ba('0xd')]+_0x398a6a[_0xe7ba('0xe')]+_0x398a6a[_0xe7ba('0xf')]+_0x398a6a[_0xe7ba('0x10')];this[_0xe7ba('0x11')]=_0x398a6a[_0xe7ba('0x11')];this['countdropretry']=_0x398a6a['countdropretry'];this[_0xe7ba('0xe')]=_0x398a6a[_0xe7ba('0xe')];this[_0xe7ba('0xf')]=_0x398a6a['countmachineretry'];this[_0xe7ba('0x10')]=_0x398a6a['countagentrejectretry'];this['queue']=_0x398a6a['queue'];this[_0xe7ba('0x12')]=_0x398a6a['calleridname'];this[_0xe7ba('0x13')]=_0x398a6a['calleridnum'];this['starttime']=_0x398a6a['starttime'];this[_0xe7ba('0x14')]=_0x398a6a[_0xe7ba('0x14')];this[_0xe7ba('0x15')]=_0x398a6a[_0xe7ba('0x14')];this[_0xe7ba('0x16')]=_0x398a6a['ringtime']||0x0;this[_0xe7ba('0x17')]=_0x398a6a[_0xe7ba('0x17')]||0x0;this[_0xe7ba('0x18')]=_0x398a6a[_0xe7ba('0x18')]||0x0;this['callback']=_0x398a6a[_0xe7ba('0x19')];this[_0xe7ba('0x1a')]=_0x398a6a['callbackuniqueid'];this[_0xe7ba('0x1b')]=_0x398a6a[_0xe7ba('0x1b')];this[_0xe7ba('0x1c')]=_0x398a6a[_0xe7ba('0x1c')];this[_0xe7ba('0x1d')]=_0x398a6a[_0xe7ba('0x1d')];this[_0xe7ba('0x1e')]=_0x398a6a[_0xe7ba('0x1e')];this[_0xe7ba('0x1f')]=_0x398a6a[_0xe7ba('0x1f')];this['VoiceQueueId']=_0x398a6a['VoiceQueueId'];this['CampaignId']=_0x398a6a['CampaignId'];this[_0xe7ba('0x20')]=_0x398a6a['originatecalleridnum']||'';this['originatecalleridname']=_0x398a6a['originatecalleridname']||'';}module[_0xe7ba('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 54cca13..50af029 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 _0xf85e=['ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xade57c,_0x557dda){var _0x3c133a=function(_0x361dfc){while(--_0x361dfc){_0xade57c['push'](_0xade57c['shift']());}};_0x3c133a(++_0x557dda);}(_0xf85e,0x8d));var _0xef85=function(_0x5cc68b,_0x446421){_0x5cc68b=_0x5cc68b-0x0;var _0x5c3fbe=_0xf85e[_0x5cc68b];return _0x5c3fbe;};'use strict';var util=require(_0xef85('0x0'));var _=require('lodash');var moment=require(_0xef85('0x1'));function getSeconds(_0x4618c6,_0x532a58){var _0x249640=moment(_0x4618c6)['milliseconds'](0x0);var _0x33c51d=moment(_0x532a58)[_0xef85('0x2')](0x0);return _0x249640[_0xef85('0x3')](_0x33c51d,_0xef85('0x4'));}function Hangup(_0x59e432,_0x4c9053){this['state']=0x4;this['statedesc']=_0xef85('0x5');this[_0xef85('0x6')]=_0x59e432[_0xef85('0x6')];this[_0xef85('0x7')]=_0x59e432[_0xef85('0x7')];this['campaigntype']=_0x59e432[_0xef85('0x7')]===_0xef85('0x8')?_0xef85('0x9'):_0x59e432[_0xef85('0x7')];this['countbusyretry']=_0x59e432[_0xef85('0xa')];this[_0xef85('0xb')]=_0x59e432[_0xef85('0xb')];this[_0xef85('0xc')]=_0x59e432[_0xef85('0xc')];this['countglobal']=_0x59e432['countbusyretry']+_0x59e432[_0xef85('0xb')]+_0x59e432[_0xef85('0xc')]+_0x59e432[_0xef85('0xd')]+_0x59e432[_0xef85('0xe')]+_0x59e432[_0xef85('0xf')]+_0x59e432[_0xef85('0x10')]+_0x59e432[_0xef85('0x11')];this['countnosuchnumberretry']=_0x59e432[_0xef85('0xd')];this[_0xef85('0xe')]=_0x59e432['countdropretry'];this['countabandonedretry']=_0x59e432[_0xef85('0xf')];this[_0xef85('0x10')]=_0x59e432[_0xef85('0x10')];this[_0xef85('0x11')]=_0x59e432['countagentrejectretry'];this['uniqueid']=_0x4c9053[_0xef85('0x12')];this[_0xef85('0x13')]=_0x59e432[_0xef85('0x14')];this[_0xef85('0x15')]=_0x59e432['number'];this[_0xef85('0x16')]=_0x59e432['starttime'];this[_0xef85('0x17')]=_0x59e432[_0xef85('0x17')];this[_0xef85('0x18')]=moment()[_0xef85('0x19')](_0xef85('0x1a'));this[_0xef85('0x1b')]=getSeconds(_0x59e432[_0xef85('0x17')],_0x59e432[_0xef85('0x16')]);this[_0xef85('0x1c')]=0x0;this[_0xef85('0x1d')]=getSeconds(this[_0xef85('0x18')],_0x59e432[_0xef85('0x17')]);this[_0xef85('0x9')]=_0x59e432[_0xef85('0x9')];this[_0xef85('0x1e')]='IVR';this[_0xef85('0x1f')]=_0x4c9053[_0xef85('0x20')];this[_0xef85('0x21')]=_0x59e432[_0xef85('0x21')];this[_0xef85('0x22')]=_0x59e432[_0xef85('0x22')];this[_0xef85('0x23')]=_0x59e432[_0xef85('0x23')];this[_0xef85('0x24')]=_0x59e432[_0xef85('0x24')];this[_0xef85('0x25')]=_0x59e432['ContactId'];this['ListId']=_0x59e432['ListId'];this[_0xef85('0x26')]=_0x59e432[_0xef85('0x26')];this['VoiceQueueId']=_0x59e432[_0xef85('0x27')];this['CampaignId']=_0x59e432[_0xef85('0x28')];}module[_0xef85('0x29')]=Hangup; \ No newline at end of file +var _0x2550=['talktime','queue','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime'];(function(_0x2774a7,_0x370440){var _0x5aadbf=function(_0x275ebc){while(--_0x275ebc){_0x2774a7['push'](_0x2774a7['shift']());}};_0x5aadbf(++_0x370440);}(_0x2550,0x15e));var _0x0255=function(_0x26ef45,_0xe8ca61){_0x26ef45=_0x26ef45-0x0;var _0x45d365=_0x2550[_0x26ef45];return _0x45d365;};'use strict';var util=require('util');var _=require(_0x0255('0x0'));var moment=require(_0x0255('0x1'));function getSeconds(_0x6284c1,_0x5c72d0){var _0x419242=moment(_0x6284c1)[_0x0255('0x2')](0x0);var _0x27b71a=moment(_0x5c72d0)[_0x0255('0x2')](0x0);return _0x419242[_0x0255('0x3')](_0x27b71a,_0x0255('0x4'));}function Hangup(_0xa41b67,_0x526c62){this[_0x0255('0x5')]=0x4;this[_0x0255('0x6')]=_0x0255('0x7');this[_0x0255('0x8')]=_0xa41b67['scheduledat'];this[_0x0255('0x9')]=_0xa41b67[_0x0255('0x9')];this[_0x0255('0xa')]=_0xa41b67[_0x0255('0x9')]===_0x0255('0xb')?'queue':_0xa41b67[_0x0255('0x9')];this[_0x0255('0xc')]=_0xa41b67['countbusyretry'];this[_0x0255('0xd')]=_0xa41b67[_0x0255('0xd')];this[_0x0255('0xe')]=_0xa41b67[_0x0255('0xe')];this[_0x0255('0xf')]=_0xa41b67[_0x0255('0xc')]+_0xa41b67['countcongestionretry']+_0xa41b67[_0x0255('0xe')]+_0xa41b67[_0x0255('0x10')]+_0xa41b67['countdropretry']+_0xa41b67[_0x0255('0x11')]+_0xa41b67[_0x0255('0x12')]+_0xa41b67[_0x0255('0x13')];this[_0x0255('0x10')]=_0xa41b67['countnosuchnumberretry'];this['countdropretry']=_0xa41b67['countdropretry'];this['countabandonedretry']=_0xa41b67[_0x0255('0x11')];this[_0x0255('0x12')]=_0xa41b67[_0x0255('0x12')];this[_0x0255('0x13')]=_0xa41b67[_0x0255('0x13')];this[_0x0255('0x14')]=_0x526c62[_0x0255('0x14')];this[_0x0255('0x15')]=_0xa41b67['name'];this[_0x0255('0x16')]=_0xa41b67['number'];this[_0x0255('0x17')]=_0xa41b67[_0x0255('0x17')];this['responsetime']=_0xa41b67[_0x0255('0x18')];this[_0x0255('0x19')]=moment()['format'](_0x0255('0x1a'));this['ringtime']=getSeconds(_0xa41b67[_0x0255('0x18')],_0xa41b67[_0x0255('0x17')]);this[_0x0255('0x1b')]=0x0;this[_0x0255('0x1c')]=getSeconds(this[_0x0255('0x19')],_0xa41b67['responsetime']);this[_0x0255('0x1d')]=_0xa41b67[_0x0255('0x1d')];this['membername']='IVR';this[_0x0255('0x1e')]=_0x526c62[_0x0255('0x1f')];this['callback']=_0xa41b67[_0x0255('0x20')];this[_0x0255('0x21')]=_0xa41b67[_0x0255('0x21')];this[_0x0255('0x22')]=_0xa41b67['callbackat'];this[_0x0255('0x23')]=_0xa41b67[_0x0255('0x23')];this[_0x0255('0x24')]=_0xa41b67[_0x0255('0x24')];this['ListId']=_0xa41b67[_0x0255('0x25')];this[_0x0255('0x26')]=_0xa41b67[_0x0255('0x26')];this[_0x0255('0x27')]=_0xa41b67[_0x0255('0x27')];this[_0x0255('0x28')]=_0xa41b67[_0x0255('0x28')];}module[_0x0255('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index c34b76f..34d175c 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 _0x66a4=['talktime','callback','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','starttime','responsetime','ringtime','holdtime'];(function(_0x1e5588,_0x147cc3){var _0x453c1a=function(_0x8ba9b2){while(--_0x8ba9b2){_0x1e5588['push'](_0x1e5588['shift']());}};_0x453c1a(++_0x147cc3);}(_0x66a4,0x122));var _0x466a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x66a4[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x466a('0x0'));var _=require(_0x466a('0x1'));var moment=require('moment');function getSeconds(_0xe9780,_0x28c7e8){var _0x15b2ef=moment(_0xe9780)[_0x466a('0x2')](0x0);var _0x182211=moment(_0x28c7e8)[_0x466a('0x2')](0x0);return _0x15b2ef[_0x466a('0x3')](_0x182211,_0x466a('0x4'));}function History(_0x574b6d){this[_0x466a('0x5')]=_0x574b6d['uniqueid'];this[_0x466a('0x6')]=_0x574b6d[_0x466a('0x6')]||undefined;this[_0x466a('0x7')]=_0x574b6d[_0x466a('0x7')];this[_0x466a('0x8')]=_0x574b6d[_0x466a('0x7')]==='outbound'?'queue':_0x574b6d['type'];this['countbusyretry']=_0x574b6d[_0x466a('0x9')];this['countcongestionretry']=_0x574b6d[_0x466a('0xa')];this[_0x466a('0xb')]=_0x574b6d['countnoanswerretry'];this[_0x466a('0xc')]=_0x574b6d[_0x466a('0x9')]+_0x574b6d[_0x466a('0xa')]+_0x574b6d[_0x466a('0xb')]+_0x574b6d[_0x466a('0xd')]+_0x574b6d[_0x466a('0xe')]+_0x574b6d[_0x466a('0xf')]+_0x574b6d['countmachineretry']+_0x574b6d['countagentrejectretry'];this['countnosuchnumberretry']=_0x574b6d[_0x466a('0xd')];this[_0x466a('0xe')]=_0x574b6d[_0x466a('0xe')];this['countabandonedretry']=_0x574b6d[_0x466a('0xf')];this[_0x466a('0x10')]=_0x574b6d['countmachineretry'];this[_0x466a('0x11')]=_0x574b6d[_0x466a('0x11')];this[_0x466a('0x12')]=_0x574b6d['queue'];this[_0x466a('0x13')]=_0x574b6d[_0x466a('0x14')];this['calleridnum']=_0x574b6d['number'];this[_0x466a('0x15')]=_0x574b6d[_0x466a('0x15')];this[_0x466a('0x16')]=_0x574b6d[_0x466a('0x16')];this['endtime']=_0x574b6d[_0x466a('0x16')];this[_0x466a('0x17')]=getSeconds(_0x574b6d[_0x466a('0x16')],_0x574b6d[_0x466a('0x15')]);this[_0x466a('0x18')]=0x0;this[_0x466a('0x19')]=0x0;this[_0x466a('0x1a')]=_0x574b6d[_0x466a('0x1a')];this['callbackuniqueid']=_0x574b6d['callbackuniqueid'];this['callbackat']=_0x574b6d[_0x466a('0x1b')];this['recallme']=_0x574b6d[_0x466a('0x1c')];this[_0x466a('0x1d')]=_0x574b6d[_0x466a('0x1d')];this[_0x466a('0x1e')]=_0x574b6d[_0x466a('0x1e')];this['UserId']=_0x574b6d['UserId'];this[_0x466a('0x1f')]=_0x574b6d['VoiceQueueId'];this[_0x466a('0x20')]=_0x574b6d[_0x466a('0x20')];this['originatecalleridnum']=_0x574b6d[_0x466a('0x21')]||'';this['originatecalleridname']=_0x574b6d[_0x466a('0x22')]||'';}module['exports']=History; \ No newline at end of file +var _0xedf9=['type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0xedf9,0x85));var _0x9edf=function(_0x5d3f51,_0x3025b6){_0x5d3f51=_0x5d3f51-0x0;var _0x24bcdb=_0xedf9[_0x5d3f51];return _0x24bcdb;};'use strict';var util=require('util');var _=require(_0x9edf('0x0'));var moment=require(_0x9edf('0x1'));function getSeconds(_0x26add0,_0x5ee1bd){var _0x468817=moment(_0x26add0)[_0x9edf('0x2')](0x0);var _0x1f5b1f=moment(_0x5ee1bd)[_0x9edf('0x2')](0x0);return _0x468817[_0x9edf('0x3')](_0x1f5b1f,_0x9edf('0x4'));}function History(_0x36a990){this[_0x9edf('0x5')]=_0x36a990[_0x9edf('0x5')];this[_0x9edf('0x6')]=_0x36a990[_0x9edf('0x6')]||undefined;this[_0x9edf('0x7')]=_0x36a990[_0x9edf('0x7')];this[_0x9edf('0x8')]=_0x36a990[_0x9edf('0x7')]===_0x9edf('0x9')?_0x9edf('0xa'):_0x36a990[_0x9edf('0x7')];this[_0x9edf('0xb')]=_0x36a990[_0x9edf('0xb')];this['countcongestionretry']=_0x36a990['countcongestionretry'];this['countnoanswerretry']=_0x36a990[_0x9edf('0xc')];this['countglobal']=_0x36a990[_0x9edf('0xb')]+_0x36a990[_0x9edf('0xd')]+_0x36a990['countnoanswerretry']+_0x36a990['countnosuchnumberretry']+_0x36a990[_0x9edf('0xe')]+_0x36a990[_0x9edf('0xf')]+_0x36a990['countmachineretry']+_0x36a990['countagentrejectretry'];this[_0x9edf('0x10')]=_0x36a990[_0x9edf('0x10')];this['countdropretry']=_0x36a990[_0x9edf('0xe')];this[_0x9edf('0xf')]=_0x36a990[_0x9edf('0xf')];this[_0x9edf('0x11')]=_0x36a990['countmachineretry'];this['countagentrejectretry']=_0x36a990[_0x9edf('0x12')];this[_0x9edf('0xa')]=_0x36a990[_0x9edf('0xa')];this[_0x9edf('0x13')]=_0x36a990['name'];this[_0x9edf('0x14')]=_0x36a990['number'];this[_0x9edf('0x15')]=_0x36a990[_0x9edf('0x15')];this['responsetime']=_0x36a990[_0x9edf('0x16')];this['endtime']=_0x36a990[_0x9edf('0x16')];this[_0x9edf('0x17')]=getSeconds(_0x36a990['responsetime'],_0x36a990[_0x9edf('0x15')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x9edf('0x18')]=_0x36a990['callback'];this['callbackuniqueid']=_0x36a990['callbackuniqueid'];this[_0x9edf('0x19')]=_0x36a990[_0x9edf('0x19')];this[_0x9edf('0x1a')]=_0x36a990[_0x9edf('0x1a')];this[_0x9edf('0x1b')]=_0x36a990[_0x9edf('0x1b')];this[_0x9edf('0x1c')]=_0x36a990['ListId'];this[_0x9edf('0x1d')]=_0x36a990[_0x9edf('0x1d')];this[_0x9edf('0x1e')]=_0x36a990[_0x9edf('0x1e')];this[_0x9edf('0x1f')]=_0x36a990[_0x9edf('0x1f')];this[_0x9edf('0x20')]=_0x36a990['originatecalleridnum']||'';this['originatecalleridname']=_0x36a990[_0x9edf('0x21')]||'';}module[_0x9edf('0x22')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index f97e8ea..8291ad2 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 _0xe6d7=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','Trunk','callerid','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\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','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','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','\x22%s\x22\x20<%s>','string','error','inspect','stack','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','MACHINE','Machine','membername','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countabandonedretry','countagentrejectretry','createStateFinal','minutes','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','locked','paused','stateinterface','push','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','dialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIfTime','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','pow','replace','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','dialer','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\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]','lodash','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','emit','type','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x2aa83a,_0x4b5c0b){_0x2aa83a=_0x2aa83a-0x0;var _0x36a653=_0xe6d7[_0x2aa83a];return _0x36a653;};'use strict';var util=require('util');var _=require(_0x7e6d('0x0'));var BPromise=require('bluebird');var uuid=require(_0x7e6d('0x1'));var moment=require(_0x7e6d('0x2'));var rr=require('rr');var md5=require(_0x7e6d('0x3'));var Redis=require(_0x7e6d('0x4'));var ut=require('../preview/util/util');var config=require(_0x7e6d('0x5'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x7e6d('0x6'))(_0x7e6d('0x7'));var loggerPredictive=require('../../../config/logger')(_0x7e6d('0x8'));var loggerPredictiveCalls=require(_0x7e6d('0x6'))(_0x7e6d('0x9'));var loggerSyncQueueSummary=require(_0x7e6d('0x6'))(_0x7e6d('0xa'));var ami=require(_0x7e6d('0xb'));config[_0x7e6d('0xc')]=_[_0x7e6d('0xd')](config[_0x7e6d('0xc')],{'host':_0x7e6d('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7e6d('0xc')]));var cmHopper=require(_0x7e6d('0xf'));var cmHopperHistory=require(_0x7e6d('0x10'));var cmHopperBlack=require(_0x7e6d('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x7e6d('0x12'));var History=require(_0x7e6d('0x13'));var Final=require('./final');var AgentComplete=require(_0x7e6d('0x14'));var QueueCallerAbandon=require(_0x7e6d('0x15'));var Hangup=require(_0x7e6d('0x16'));var ipAgi=process[_0x7e6d('0x17')][_0x7e6d('0x18')]||_0x7e6d('0x19');var strategy={'rrmemory':_0x7e6d('0x1a'),'roundrobin':_0x7e6d('0x1b')};var Sequence=function(){};Sequence[_0x7e6d('0x1c')][_0x7e6d('0x1d')]=function(_0x5cad83){this['tail']=this[_0x7e6d('0x1e')]?this[_0x7e6d('0x1e')]['finally'](_0x5cad83):_0x5cad83();};function Dialer(_0x3cfc3a,_0x52596b){this[_0x7e6d('0x1f')]=new Sequence();this[_0x7e6d('0x20')]=_0x52596b;this[_0x7e6d('0x21')]=_0x3cfc3a[_0x7e6d('0x21')];this['campaigns']=_0x3cfc3a[_0x7e6d('0x22')];this[_0x7e6d('0x23')]=_0x3cfc3a['agents'];this[_0x7e6d('0x24')]=_0x3cfc3a[_0x7e6d('0x24')];this[_0x7e6d('0x25')]=config[_0x7e6d('0x25')]||0x2;this['channels']={};this[_0x7e6d('0x26')]={};this[_0x7e6d('0x27')]={};this[_0x7e6d('0x28')]={};this['optionPredictive']={};this[_0x7e6d('0x29')]={};this[_0x7e6d('0x2a')]={};this[_0x7e6d('0x2b')]={};this[_0x7e6d('0x2c')]={};this['queueBookedRR']={};ami['on'](_0x7e6d('0x2d'),this[_0x7e6d('0x2e')][_0x7e6d('0x2f')](this));ami['on']('queuecallerabandon',this[_0x7e6d('0x30')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x31'),this[_0x7e6d('0x32')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x33'),this[_0x7e6d('0x34')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x35'),this[_0x7e6d('0xa')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x36'),this[_0x7e6d('0x37')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x38'),this[_0x7e6d('0x39')]['bind'](this));ami['on']('varset',this[_0x7e6d('0x3a')][_0x7e6d('0x2f')](this));ami['on']('queuemember',this[_0x7e6d('0x3b')][_0x7e6d('0x2f')](this));ami['on'](_0x7e6d('0x3c'),this[_0x7e6d('0x3d')]['bind'](this));this[_0x7e6d('0x3e')]();this[_0x7e6d('0x3f')]();}function isNotNull(_0x3f1a6b){return _0x3f1a6b!==null&&!_[_0x7e6d('0x40')](_0x3f1a6b);}function checkIsLoggedIn(_0x113d27,_0x31f642){return function(){if(_0x31f642<=0x0){_0x113d27[_0x7e6d('0x41')]=_0x7e6d('0x42');throw _0x113d27[_0x7e6d('0x43')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x5f05f8){return _0x5f05f8;}function checkIsActive(_0x2f8fb6,_0x159e7d){return function(){if(!isActive(_0x159e7d)){_0x2f8fb6['message']='NOT_ACTIVE';throw _0x2f8fb6[_0x7e6d('0x43')]+_0x7e6d('0x44');}};}function checkInterval(_0x5773e2){return function(){if(!isNotNull(_0x5773e2['Interval'])){_0x5773e2['message']=_0x7e6d('0x45');throw _0x5773e2[_0x7e6d('0x43')]+_0x7e6d('0x46');}if(!isNotNull(_0x5773e2[_0x7e6d('0x47')][_0x7e6d('0x48')])){_0x5773e2[_0x7e6d('0x41')]='INTERVAL_IS_NULL';throw _0x5773e2['name']+_0x7e6d('0x46');}if(!isNotNull(_[_0x7e6d('0x49')](_0x5773e2[_0x7e6d('0x47')]['Intervals']))){_0x5773e2[_0x7e6d('0x41')]='INTERVAL_IS_NULL';throw _0x5773e2[_0x7e6d('0x43')]+_0x7e6d('0x46');}};}function msgResponse(_0x3c3e59,_0x10c545,_0x34133e){return{'action':_0x3c3e59,'response':_0x10c545,'message':_0x34133e,'stack':_0x34133e};}function myreject(_0x338f68){return function(_0x18781f){return _0x338f68(msgResponse(_0x7e6d('0x4a'),'Error',JSON[_0x7e6d('0x4b')](_0x18781f)));};}function getSeconds(_0x386e01,_0x145f53){var _0x2597a7=moment(_0x386e01)[_0x7e6d('0x4c')](0x0);var _0x15abd3=moment(_0x145f53)['milliseconds'](0x0);return _0x2597a7[_0x7e6d('0x4d')](_0x15abd3,'seconds');}function emit(_0x4ca8fe,_0x4a31ff,_0x539143){io['to'](_0x4ca8fe)[_0x7e6d('0x4e')](_0x4a31ff,_0x539143);}function emitVoiceQueueSummary(_0x2de2bc){if(_0x2de2bc[_0x7e6d('0x4f')]==='outbound'){var _0x3ab0d1={'id':_0x2de2bc['id'],'name':_0x2de2bc[_0x7e6d('0x43')],'strategy':_0x2de2bc['strategy'],'answered':_0x2de2bc['answered'],'available':_0x2de2bc[_0x7e6d('0x50')],'loggedIn':_0x2de2bc[_0x7e6d('0x51')],'pTalking':_0x2de2bc[_0x7e6d('0x52')],'sumBillable':_0x2de2bc[_0x7e6d('0x53')],'sumDuration':_0x2de2bc[_0x7e6d('0x54')],'sumHoldTime':_0x2de2bc[_0x7e6d('0x55')]||0x0,'talking':_0x2de2bc['talking'],'total':_0x2de2bc['total'],'type':_0x2de2bc[_0x7e6d('0x4f')],'unmanaged':_0x2de2bc[_0x7e6d('0x56')],'abandoned':_0x2de2bc[_0x7e6d('0x57')],'waiting':_0x2de2bc[_0x7e6d('0x58')],'loggedInDb':_0x2de2bc[_0x7e6d('0x59')],'dialActive':_0x2de2bc[_0x7e6d('0x5a')],'dialMethod':_0x2de2bc['dialMethod'],'dialOriginateCallerIdName':_0x2de2bc['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2de2bc[_0x7e6d('0x5b')],'dialOriginateTimeout':_0x2de2bc[_0x7e6d('0x5c')],'dialPrefix':_0x2de2bc['dialPrefix'],'outboundAnswerAgiCallsDay':_0x2de2bc['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2de2bc[_0x7e6d('0x5d')],'outboundBlacklistCallsDay':_0x2de2bc[_0x7e6d('0x5e')],'outboundBusyCallsDay':_0x2de2bc[_0x7e6d('0x5f')],'outboundCongestionCallsDay':_0x2de2bc[_0x7e6d('0x60')],'outboundDropCallsDayACS':_0x2de2bc[_0x7e6d('0x61')],'outboundDropCallsDayCallersExit':_0x2de2bc[_0x7e6d('0x62')],'outboundDropCallsDayTimeout':_0x2de2bc[_0x7e6d('0x63')],'outboundNoAnswerCallsDay':_0x2de2bc['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2de2bc[_0x7e6d('0x64')],'outboundOriginateFailureCallsDay':_0x2de2bc['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2de2bc[_0x7e6d('0x65')],'outboundRejectCallsDay':_0x2de2bc[_0x7e6d('0x66')],'outboundUnknownCallsDay':_0x2de2bc[_0x7e6d('0x67')],'predictiveIntervalAnsweredCalls':_0x2de2bc['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x2de2bc[_0x7e6d('0x68')],'predictiveIntervalAvgTalktime':_0x2de2bc[_0x7e6d('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x2de2bc[_0x7e6d('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x2de2bc[_0x7e6d('0x6b')],'predictiveIntervalErlangCalls':_0x2de2bc[_0x7e6d('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x2de2bc['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2de2bc[_0x7e6d('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x2de2bc['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2de2bc['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2de2bc[_0x7e6d('0x6e')],'predictiveIntervalTotalCalls':_0x2de2bc['predictiveIntervalTotalCalls'],'message':_0x2de2bc[_0x7e6d('0x41')],'originated':_0x2de2bc['originated'],'erlangCalls':_0x2de2bc[_0x7e6d('0x6f')],'erlangCallToSecond':_0x2de2bc[_0x7e6d('0x70')],'erlangAbandonmentRate':_0x2de2bc['erlangAbandonmentRate'],'erlangBusyFactor':_0x2de2bc['erlangBusyFactor'],'startPredictive':_0x2de2bc[_0x7e6d('0x29')],'startProgressive':_0x2de2bc['startProgressive']};if(_0x2de2bc[_0x7e6d('0x71')]){_0x3ab0d1[_0x7e6d('0x71')]={'id':_0x2de2bc[_0x7e6d('0x71')]['id'],'name':_0x2de2bc['Trunk'][_0x7e6d('0x43')],'active':_0x2de2bc[_0x7e6d('0x71')]['active'],'callerid':_0x2de2bc[_0x7e6d('0x71')][_0x7e6d('0x72')]};}if(_0x2de2bc[_0x7e6d('0x47')]){_0x3ab0d1[_0x7e6d('0x47')]={'id':_0x2de2bc[_0x7e6d('0x47')]['id'],'name':_0x2de2bc[_0x7e6d('0x47')]['name']};}var _0x430ba8=md5(JSON[_0x7e6d('0x4b')](_0x3ab0d1));if(_0x2de2bc[_0x7e6d('0x3')]!==_0x430ba8){_0x2de2bc[_0x7e6d('0x3')]=_0x430ba8;emit(util['format']('voice:queue:%s',_0x3ab0d1[_0x7e6d('0x43')]),_0x7e6d('0x73'),_0x3ab0d1);}}}function emitCampaignSummary(_0x2f60cb){if(_0x2f60cb['type']===_0x7e6d('0x74')){emit(util[_0x7e6d('0x75')](_0x7e6d('0x76'),_0x2f60cb['name']),_0x7e6d('0x77'),_0x2f60cb);}}function checkGetDataPredictive(_0x5eefe2){if(isNotNull(_0x5eefe2)&&!_['isEmpty'](_0x5eefe2)){loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x79'));loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x7a'),_0x5eefe2[_0x7e6d('0x7b')]);loggerPredictive[_0x7e6d('0x78')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5eefe2[_0x7e6d('0x7c')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x7d'),_0x5eefe2[_0x7e6d('0x6b')]);loggerPredictive['info'](_0x7e6d('0x7e'),_0x5eefe2[_0x7e6d('0x6a')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x7f'),_0x5eefe2[_0x7e6d('0x68')]);loggerPredictive[_0x7e6d('0x78')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5eefe2[_0x7e6d('0x69')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x80'));if(_0x5eefe2['predictiveIntervalTotalCalls']>0x0){if(!_[_0x7e6d('0x40')](_0x5eefe2[_0x7e6d('0x69')])&&_0x5eefe2[_0x7e6d('0x69')]>0x0){return!![];}loggerPredictive[_0x7e6d('0x78')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x7e6d('0x40')](_0x5eefe2[_0x7e6d('0x68')])&&_0x5eefe2['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x81'));}else{loggerPredictive[_0x7e6d('0x78')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x82'));}return![];}function mergeDataErlangB(_0x2db212){return function(_0x50944f){loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x83'));loggerPredictive['info'](_0x7e6d('0x84'),_0x50944f[_0x7e6d('0x6f')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x85'),_0x50944f[_0x7e6d('0x70')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x86'),_0x50944f[_0x7e6d('0x87')]);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x88'),_0x50944f['erlangBusyFactor']);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x86'),_0x50944f[_0x7e6d('0x87')]);loggerPredictive['info'](_0x7e6d('0x80'));_[_0x7e6d('0x89')](_0x2db212,_0x50944f);};}function getDiff(_0x5cad18){var _0x340846=moment()[_0x7e6d('0x4c')](0x0);var _0x3c0f3a=moment(_0x5cad18)[_0x7e6d('0x4c')](0x0);return _0x340846[_0x7e6d('0x4d')](_0x3c0f3a,_0x7e6d('0x8a'));}function ifInterval(_0x49103f,_0xdae377){if(_['isUndefined'](_0xdae377)){return![];}return getDiff(_0xdae377)<_0x49103f*0x3c;}function freeVariablesPredictive(_0x16dab6){if(isNotNull(_0x16dab6)){if(!_[_0x7e6d('0x40')](_0x16dab6[_0x7e6d('0x2a')])){_0x16dab6[_0x7e6d('0x2a')]=undefined;loggerPredictive['info'](_0x16dab6[_0x7e6d('0x43')],_0x7e6d('0x8b'));}if(!_[_0x7e6d('0x40')](_0x16dab6['startPredictive'])){_0x16dab6[_0x7e6d('0x29')]=undefined;loggerPredictive['info'](_0x16dab6['name'],_0x7e6d('0x8c'));}if(!_[_0x7e6d('0x40')](_0x16dab6['handlePredictive'])){clearInterval(_0x16dab6[_0x7e6d('0x8d')]);_0x16dab6[_0x7e6d('0x8d')]=undefined;loggerPredictive[_0x7e6d('0x78')](_0x16dab6[_0x7e6d('0x43')],_0x7e6d('0x8e'));}}}function erlangb(_0x1a3054,_0x2a9f40){if(_0x2a9f40===0x0){return 0x0;}var _0x3843c9=0x1;for(var _0x2dc829=0x1;_0x2dc829<=_0x2a9f40;_0x2dc829+=0x1){_0x3843c9=0x1+_0x3843c9*_0x2dc829/_0x1a3054;}return 0x1/_0x3843c9;}function isVoiceQueueOutbound(_0x1a42df){return _0x1a42df===_0x7e6d('0x8f');}function isNotPreview(_0x1fcec1){return _0x1fcec1!==_0x7e6d('0x20');}function isCampaignIvr(_0x536533){return _0x536533===_0x7e6d('0x74');}function getCallerId(_0x12891f,_0x5c81bf,_0x22ba71){if(!_[_0x7e6d('0x40')](_0x22ba71)&&typeof _0x22ba71==='string'&&!_[_0x7e6d('0x49')](_0x22ba71)){if(!_[_0x7e6d('0x40')](_0x5c81bf)&&typeof _0x5c81bf==='string'&&!_[_0x7e6d('0x49')](_0x5c81bf)){return util[_0x7e6d('0x75')]('\x22%s\x22\x20<%s>',_0x5c81bf,_0x22ba71);}return util['format'](_0x7e6d('0x90'),_0x22ba71,_0x22ba71);}if(!_[_0x7e6d('0x40')](_0x12891f)&&typeof _0x12891f===_0x7e6d('0x91')&&!_['isEmpty'](_0x12891f)){return _0x12891f;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x22a2e9,_0x27ac69){return function(_0x209679){freeVariablesPredictive(_0x27ac69);emitVoiceQueueSummary(_0x27ac69);emitCampaignSummary(_0x27ac69);loggerSyncQueueSummary[_0x7e6d('0x92')](_0x22a2e9,util[_0x7e6d('0x93')](_0x209679,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4c36b8,_0x1a3640){return function(_0x2659ed){loggerPredictive[_0x7e6d('0x92')](_0x1a3640[_0x7e6d('0x43')],_0x4c36b8);loggerPredictive[_0x7e6d('0x92')](_0x2659ed[_0x7e6d('0x94')]);freeVariablesPredictive(_0x1a3640);};}function loggerCatch(_0x3dccc7){return function(_0x119605){logger['error'](_0x3dccc7,util[_0x7e6d('0x93')](_0x119605,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3e33ff){return _0x3e33ff&&!_[_0x7e6d('0x40')](_0x3e33ff)&&_0x3e33ff['length']>0x0;}function decremetOriginate(_0x5afb4c){if(!_[_0x7e6d('0x40')](_0x5afb4c)&&_0x5afb4c!==null){if(typeof _0x5afb4c[_0x7e6d('0x95')]!==_0x7e6d('0x96')){if(_0x5afb4c[_0x7e6d('0x95')]>0x0){_0x5afb4c[_0x7e6d('0x95')]-=0x1;}else{logger['error'](_0x7e6d('0x97'));}}}else{logger[_0x7e6d('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x26d979,_0x3b8772,_0x3e4443){if(_0x3b8772>_0x3e4443){for(var _0x2866cc=0x0;_0x2866cc<_0x3b8772-_0x3e4443;_0x2866cc+=0x1){decremetOriginate(_0x26d979);}}}function loggerGetContactDialer(_0x2b1135,_0x360203,_0x19d44a){return function(_0x4b3ddf){checkContactLowerLimitOriginate(_0x360203,_0x19d44a,0x0);logger[_0x7e6d('0x92')](_0x2b1135,util['inspect'](_0x4b3ddf,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1d1a29){return function(_0xfbfd2e){if(isNotNull(_0xfbfd2e)&&isNotNull(_0xfbfd2e[0x0])){if(_0xfbfd2e[0x0]['contactsRescheduled']>0x0){_0x1d1a29['message']=_0x7e6d('0x98');logger['info'](_0x7e6d('0x99')+_0x1d1a29['name'],_0xfbfd2e[0x0][_0x7e6d('0x9a')],_0x7e6d('0x9b'));}else{_0x1d1a29[_0x7e6d('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x7e6d('0x9c')+_0x1d1a29[_0x7e6d('0x43')]);}}};}function notSendMessagesQueue(_0x48682f){if(_0x48682f[_0x7e6d('0x9d')]){freeVariablesPredictive(_0x48682f);if(_0x48682f[_0x7e6d('0x95')]===0x0&&_0x48682f[_0x7e6d('0x9e')]===0x0&&_0x48682f['waiting']===0x0&&(_0x48682f[_0x7e6d('0x52')]||0x0)===0x0){_0x48682f[_0x7e6d('0x9d')]=![];_0x48682f['available']=0x0;_0x48682f[_0x7e6d('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x7e6d('0x92')](_0x7e6d('0x9f'),_0x48682f[_0x7e6d('0x43')],_0x7e6d('0xa0'));}else{_0x48682f['message']=_0x7e6d('0xa1');loggerSyncQueueSummary[_0x7e6d('0x92')](_0x7e6d('0x9f'),_0x48682f[_0x7e6d('0x43')],'is\x20disactive');}emitVoiceQueueSummary(_0x48682f);}}function notSendMessagesCampaign(_0x127149){if(_0x127149[_0x7e6d('0x9d')]){if(_0x127149[_0x7e6d('0x95')]===0x0){_0x127149[_0x7e6d('0x9d')]=![];_0x127149['message']=_0x7e6d('0xa2');loggerSyncQueueSummary[_0x7e6d('0x92')](_0x7e6d('0xa3'),_0x127149[_0x7e6d('0x43')],_0x7e6d('0xa0'));}else{_0x127149['message']=_0x7e6d('0xa1');loggerSyncQueueSummary[_0x7e6d('0x92')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x127149[_0x7e6d('0x43')],'is\x20disactive');}emitCampaignSummary(_0x127149);}}function createObjHistory(_0x298f4b,_0x597f5c,_0x3d22e1,_0x1f83fa,_0x2238a1){_0x298f4b[_0x7e6d('0x41')]=_0x3d22e1;var _0x33f2ed=new Action(_0x298f4b,_0x597f5c);var _0x4843be=new History(_0x33f2ed);_0x4843be[_0x7e6d('0xa4')]=_0x1f83fa;_0x4843be[_0x7e6d('0xa5')]=_0x2238a1;_0x4843be[_0x7e6d('0xa6')]=_0x33f2ed[_0x7e6d('0xa7')];return _0x4843be;}Dialer[_0x7e6d('0x1c')][_0x7e6d('0x3f')]=function(){var _0x3613c7=this;setInterval(function(){_0x3613c7[_0x7e6d('0xa8')](_0x3613c7['uniqueId'],_0x7e6d('0xa9'));_0x3613c7[_0x7e6d('0xa8')](_0x3613c7[_0x7e6d('0x26')],'[actions]');},0x32c8);};Dialer['prototype'][_0x7e6d('0xa8')]=function(_0x26b8c6,_0x2b5c64){var _0x691a59=this;for(var _0x181edd in _0x26b8c6){if(typeof _0x26b8c6[_0x181edd]!=='undefined'){this[_0x7e6d('0x1f')][_0x7e6d('0x1d')](function(){if(!_['isNil'](_0x26b8c6[_0x181edd])){return ami[_0x7e6d('0xaa')]({'action':_0x7e6d('0xab'),'channel':_0x26b8c6[_0x181edd]['channel']})[_0x7e6d('0xac')](function(_0x29e7b2){if(_0x29e7b2[_0x7e6d('0x41')]===_0x7e6d('0xad')){setTimeout(function(){if(_0x26b8c6[_0x181edd]&&_0x26b8c6[_0x181edd][_0x7e6d('0x4f')]!==_0x7e6d('0x74')){_0x691a59[_0x7e6d('0xae')](_0x691a59[_0x7e6d('0x21')][_0x26b8c6[_0x181edd][_0x7e6d('0xaf')]]);logger['error']('[Dialer][checkChannel]',_0x2b5c64,_0x181edd,_0x26b8c6[_0x181edd][_0x7e6d('0xaf')]);delete _0x26b8c6[_0x181edd];}if(_0x26b8c6[_0x181edd]&&_0x26b8c6[_0x181edd][_0x7e6d('0x4f')]===_0x7e6d('0x74')){_0x691a59['updateOriginated'](_0x691a59[_0x7e6d('0x22')][_0x26b8c6[_0x181edd][_0x7e6d('0xaf')]]);logger[_0x7e6d('0x92')]('[Dialer][checkChannel][ivr]',_0x2b5c64,_0x181edd,_0x26b8c6[_0x181edd]['queue']);delete _0x26b8c6[_0x181edd];}},0x2328);}});}});}}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xb0')]=function(_0x57091f){return BPromise['resolve']()[_0x7e6d('0xb1')](cmHopper[_0x7e6d('0xb0')](_0x57091f))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xb2')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xb3')]=function(_0x1a5461){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopperBlack[_0x7e6d('0xb3')](_0x1a5461))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xb5')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xb6')]=function(_0x1df110){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopperBlack[_0x7e6d('0xb6')](_0x1df110))['catch'](loggerCatch(_0x7e6d('0xb7')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xb8')]=function(_0x35e3d0){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopperHistory[_0x7e6d('0xb9')](_0x35e3d0))['catch'](loggerCatch(_0x7e6d('0xba')));};Dialer['prototype'][_0x7e6d('0xbb')]=function(_0x4e4776){return BPromise['resolve']()[_0x7e6d('0xb1')](cmHopper['rescheduleContact'](_0x4e4776))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xbc')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xbd')]=function(_0x565145,_0x32199a,_0x41334b){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopper[_0x7e6d('0xbd')](_0x565145,_0x32199a,_0x41334b))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xbe')]=function(_0x2867af,_0x32f192,_0x5311b1,_0x3b3b08,_0x37392c){return BPromise[_0x7e6d('0xb4')]()['then'](cmHopper[_0x7e6d('0xbe')](_0x2867af,_0x32f192,_0x5311b1,_0x3b3b08))[_0x7e6d('0xac')](function(_0x2c5f3d){_0x37392c[_0x7e6d('0xbf')]-=_0x5311b1;_0x37392c[_0x7e6d('0xbf')]=_0x37392c['temp']>0x0?_0x37392c[_0x7e6d('0xbf')]:0x0;loggerCatch(_0x7e6d('0xc0'))(_0x2c5f3d);});};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xc1')]=function(_0x29b0fd,_0x5813ee,_0x24f266,_0x15fa9e){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopper[_0x7e6d('0xc1')](_0x29b0fd,_0x5813ee,_0x24f266))['catch'](function(_0x262415){_0x15fa9e['temp']-=_0x5813ee;_0x15fa9e[_0x7e6d('0xbf')]=_0x15fa9e[_0x7e6d('0xbf')]>0x0?_0x15fa9e[_0x7e6d('0xbf')]:0x0;loggerCatch(_0x7e6d('0xc2'))(_0x262415);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x522ba2){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](voiceQueueRt[_0x7e6d('0xc3')](_0x522ba2))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xc4')));};Dialer['prototype'][_0x7e6d('0xc5')]=function(_0x58ea0b){return BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](cmHopper[_0x7e6d('0xc5')](_0x58ea0b))['catch'](loggerCatch(_0x7e6d('0xc6')));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xc7')]=function(_0x222271){return BPromise['resolve']()[_0x7e6d('0xb1')](cmHopperHistory[_0x7e6d('0xc7')](_0x222271))[_0x7e6d('0xac')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0x7e6d('0xae')]=function(_0x271d08){if(!_[_0x7e6d('0x40')](_0x271d08)&&_0x271d08!==null){if(typeof _0x271d08[_0x7e6d('0x95')]!==_0x7e6d('0x96')){if(_0x271d08[_0x7e6d('0x95')]>0x0){_0x271d08[_0x7e6d('0x95')]-=0x1;}else{logger[_0x7e6d('0x92')](_0x7e6d('0xc8'));}}}else{logger[_0x7e6d('0x92')](_0x7e6d('0xc9'));}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xca')]=function(_0x1fe656,_0x106038){var _0x2b5b5c=this;return function(_0x2aa908){_0x2b5b5c['updateOriginated'](_0x106038);logger[_0x7e6d('0x92')](_0x1fe656,util[_0x7e6d('0x93')](_0x2aa908,{'showHidden':![],'depth':null}));};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xcb')]=function(_0x274777,_0x498146,_0x42a665){var _0x179912={'state':0x19,'statedesc':_0x7e6d('0xcc')};this['updateOriginated'](_0x498146);this[_0x7e6d('0xcd')](_[_0x7e6d('0x89')](_0x179912,_[_0x7e6d('0xce')](_0x42a665,['ContactId',_0x7e6d('0xcf'),_0x7e6d('0xd0'),_0x7e6d('0xd1'),_0x7e6d('0xd2')])),_0x7e6d('0xd3'),_0x7e6d('0xd4'));logger[_0x7e6d('0x92')](_0x274777);};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xd5')]=function(_0x1ce11b){return _0x1ce11b===_0x7e6d('0xd6');};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xd7')]=function(_0x177317){return!_['isUndefined'](_0x177317)&&_0x177317&&!_[_0x7e6d('0x40')](_0x177317['name'])&&!_[_0x7e6d('0x40')](_0x177317['active'])&&_0x177317[_0x7e6d('0xd8')]&&(this['trunks'][util[_0x7e6d('0x75')](_0x7e6d('0xd9'),_0x177317[_0x7e6d('0x43')])]['status']===_0x7e6d('0xda')||this[_0x7e6d('0x24')][util['format'](_0x7e6d('0xd9'),_0x177317[_0x7e6d('0x43')])][_0x7e6d('0xab')]===_0x7e6d('0xdb'));};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xcd')]=function(_0x468e2c,_0x178502,_0x13e3b1){this[_0x7e6d('0xc7')](_0x468e2c)[_0x7e6d('0xac')](loggerCatch(_0x178502));this['moveContactManagedDialer'](_0x468e2c)[_0x7e6d('0xac')](loggerCatch(_0x13e3b1));};Dialer['prototype'][_0x7e6d('0x3a')]=function(_0xfb1a87){var _0x5b93da=this[_0x7e6d('0x28')][_0xfb1a87[_0x7e6d('0xdc')]];var _0x18f2df;if(!_['isNil'](_0xfb1a87)&&!_[_0x7e6d('0xdd')](_0xfb1a87[_0x7e6d('0xde')])&&!_[_0x7e6d('0xdd')](_0xfb1a87[_0x7e6d('0xde')][_0x7e6d('0xdf')])&&_0xfb1a87[_0x7e6d('0xe0')]==='xcally-motion-dialer'&&_0x5b93da){if(_0x5b93da['type']!=='ivr'&&this[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe1')]&&_0xfb1a87[_0x7e6d('0xe2')]==='HANGUP'){delete this[_0x7e6d('0x28')][_0xfb1a87[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]]);this[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0x5d')]+=0x1;this[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe3')]+=0x1;_0x18f2df=new Hangup(_0x5b93da,_0xfb1a87);_0x18f2df[_0x7e6d('0xa4')]=0x12;_0x18f2df['statedesc']=_0x7e6d('0xe4');_0x18f2df['membername']=_0x7e6d('0xe5');ami[_0x7e6d('0x4e')](_0x7e6d('0xe6'),ut[_0x7e6d('0xe7')](_0x18f2df,_0x7e6d('0xe8')));this[_0x7e6d('0xcd')](_0x18f2df,'[syncHangupInAMD][createHistory]',_0x7e6d('0xe9'));}if(_0x5b93da[_0x7e6d('0x4f')]!==_0x7e6d('0x74')&&this['voiceQueues'][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe1')]&&_0xfb1a87[_0x7e6d('0xe2')]===_0x7e6d('0xea')){var _0x431bca=this;return new BPromise(function(_0x48ba6d,_0x491b00){delete _0x431bca[_0x7e6d('0x28')][_0xfb1a87[_0x7e6d('0xdc')]];_0x431bca['updateOriginated'](_0x431bca[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]]);_0x431bca[_0x7e6d('0x21')][_0x5b93da['queue']]['outboundAnswerCallsDay']+=0x1;_0x431bca[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe3')]+=0x1;var _0x90f5b2=_0x431bca[_0x7e6d('0x21')][_0x5b93da[_0x7e6d('0xaf')]];var _0x399adf=new Hangup(_0x5b93da,_0xfb1a87);_0x399adf[_0x7e6d('0xa4')]=0x13;_0x399adf[_0x7e6d('0xa5')]=_0x7e6d('0xeb');_0x399adf[_0x7e6d('0xec')]=_0x7e6d('0xe5');_0x399adf[_0x7e6d('0xed')]+=0x1;_0x399adf[_0x7e6d('0xee')]+=0x1;_0x399adf[_0x7e6d('0xe8')]=!![];ami[_0x7e6d('0x4e')]('custom:amd',ut[_0x7e6d('0xe7')](_0x399adf,_0x7e6d('0xe8')));_0x431bca[_0x7e6d('0xc7')](_0x399adf)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xef')));if(_0x399adf[_0x7e6d('0xf0')]+_0x399adf[_0x7e6d('0xf1')]+_0x399adf[_0x7e6d('0xf2')]+_0x399adf[_0x7e6d('0xf3')]+_0x399adf[_0x7e6d('0xf4')]+_0x399adf['countabandonedretry']+_0x399adf[_0x7e6d('0xed')]+_0x399adf['countagentrejectretry']>=_0x90f5b2[_0x7e6d('0xf5')]){_0x431bca[_0x7e6d('0xf6')](_0x399adf,_0x48ba6d,_0x491b00,_0x7e6d('0xf7'));}else{if(_0x399adf[_0x7e6d('0xed')]>=_0x90f5b2['dialMachineMaxRetry']){_0x431bca['createStateFinal'](_0x399adf,_0x48ba6d,_0x491b00,_0x7e6d('0xf8'));}else{_0x431bca['rescheduleContact']({'active':![],'countmachineretry':_0x399adf[_0x7e6d('0xed')],'scheduledat':moment()[_0x7e6d('0xf9')](_0x90f5b2[_0x7e6d('0xfa')],'minutes')[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x399adf[_0x7e6d('0xfc')],'ListId':_0x399adf[_0x7e6d('0xcf')],'VoiceQueueId':_0x399adf[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x399adf[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch('[rescheduleContact][Machine]'));_0x48ba6d({'reschedule':0x1});}}});}if(_0x5b93da[_0x7e6d('0x4f')]===_0x7e6d('0x74')&&this[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe1')]&&_0xfb1a87[_0x7e6d('0xe2')]===_0x7e6d('0xfd')){delete this['uniqueId'][_0xfb1a87[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this['campaigns'][_0x5b93da[_0x7e6d('0xaf')]]);_0x18f2df=new Hangup(_0x5b93da,_0xfb1a87);_0x18f2df['state']=0x12;_0x18f2df[_0x7e6d('0xa5')]=_0x7e6d('0xe4');_0x18f2df[_0x7e6d('0xec')]=_0x7e6d('0xe5');ami[_0x7e6d('0x4e')]('custom:amd',ut['buildObj'](_0x18f2df,_0x7e6d('0xe8')));this['saveInDb'](_0x18f2df,_0x7e6d('0xfe'),_0x7e6d('0xff'));}if(_0x5b93da['type']===_0x7e6d('0x74')&&this[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe1')]&&_0xfb1a87[_0x7e6d('0xe2')]===_0x7e6d('0xea')){var _0x431bca=this;return new BPromise(function(_0x21fecc,_0x2b1faa){delete _0x431bca[_0x7e6d('0x28')][_0xfb1a87['uniqueid']];_0x431bca[_0x7e6d('0xae')](_0x431bca[_0x7e6d('0x22')][_0x5b93da['queue']]);_0x431bca[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0x5d')]+=0x1;_0x431bca[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]][_0x7e6d('0xe3')]+=0x1;var _0x831146=_0x431bca[_0x7e6d('0x22')][_0x5b93da[_0x7e6d('0xaf')]];var _0x39ccf3=new Hangup(_0x5b93da,_0xfb1a87);_0x39ccf3[_0x7e6d('0xa4')]=0x13;_0x39ccf3['statedesc']=_0x7e6d('0xeb');_0x39ccf3[_0x7e6d('0xec')]=_0x7e6d('0xe5');_0x39ccf3['countmachineretry']+=0x1;_0x39ccf3[_0x7e6d('0xee')]+=0x1;_0x39ccf3['amd']=!![];ami[_0x7e6d('0x4e')]('custom:amd',ut[_0x7e6d('0xe7')](_0x39ccf3,_0x7e6d('0xe8')));_0x431bca[_0x7e6d('0xc7')](_0x39ccf3)[_0x7e6d('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x39ccf3[_0x7e6d('0xf0')]+_0x39ccf3['countcongestionretry']+_0x39ccf3[_0x7e6d('0xf2')]+_0x39ccf3['countnosuchnumberretry']+_0x39ccf3[_0x7e6d('0xf4')]+_0x39ccf3[_0x7e6d('0x100')]+_0x39ccf3['countmachineretry']+_0x39ccf3[_0x7e6d('0x101')]>=_0x831146[_0x7e6d('0xf5')]){_0x431bca[_0x7e6d('0xf6')](_0x39ccf3,_0x21fecc,_0x2b1faa,_0x7e6d('0xf7'));}else{if(_0x39ccf3[_0x7e6d('0xed')]>=_0x831146['dialMachineMaxRetry']){_0x431bca[_0x7e6d('0x102')](_0x39ccf3,_0x21fecc,_0x2b1faa,_0x7e6d('0xf8'));}else{_0x431bca[_0x7e6d('0xbb')]({'active':![],'countmachineretry':_0x39ccf3['countmachineretry'],'scheduledat':moment()[_0x7e6d('0xf9')](_0x831146['dialMachineRetryFrequency'],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x39ccf3[_0x7e6d('0xfc')],'ListId':_0x39ccf3[_0x7e6d('0xcf')],'VoiceQueueId':_0x39ccf3[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x39ccf3[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch(_0x7e6d('0x104')));_0x21fecc({'reschedule':0x1});}}});}}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x37')]=function(_0x489a67){var _0x1298b7=this[_0x7e6d('0x28')][_0x489a67[_0x7e6d('0xdc')]];var _0x4efd72=this;var _0x2e5647;if(_0x1298b7&&_0x1298b7[_0x7e6d('0x4f')]===_0x7e6d('0x74')){delete this[_0x7e6d('0x28')][_0x489a67[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this[_0x7e6d('0x22')][_0x1298b7['queue']]);this[_0x7e6d('0x22')][_0x1298b7['queue']][_0x7e6d('0x105')]+=0x1;_0x2e5647=new Hangup(_0x1298b7,_0x489a67);this[_0x7e6d('0xc7')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x106')));this[_0x7e6d('0xc5')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x107')));}if(_0x1298b7&&_0x1298b7[_0x7e6d('0x4f')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x1298b7[_0x7e6d('0xaf')]][_0x7e6d('0x108')])){delete this[_0x7e6d('0x28')][_0x489a67[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this['voiceQueues'][_0x1298b7[_0x7e6d('0xaf')]]);this[_0x7e6d('0x21')][_0x1298b7[_0x7e6d('0xaf')]][_0x7e6d('0x5d')]+=0x1;this[_0x7e6d('0x21')][_0x1298b7[_0x7e6d('0xaf')]][_0x7e6d('0xe3')]+=0x1;_0x2e5647=new Hangup(_0x1298b7,_0x489a67);_0x2e5647[_0x7e6d('0xa4')]=0x10;_0x2e5647[_0x7e6d('0xa5')]=_0x7e6d('0x109');_0x2e5647[_0x7e6d('0xec')]=_0x7e6d('0x10a');this[_0x7e6d('0xc7')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x106')));this[_0x7e6d('0xc5')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x107')));}if(_0x1298b7&&_0x1298b7[_0x7e6d('0x4f')]!==_0x7e6d('0x74')&&!isNotNull(this['voiceQueues'][_0x1298b7[_0x7e6d('0xaf')]]['dialQueueProject'])){delete this['uniqueId'][_0x489a67[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][_0x1298b7[_0x7e6d('0xaf')]]);this[_0x7e6d('0x21')][_0x1298b7[_0x7e6d('0xaf')]][_0x7e6d('0x67')]+=0x1;_0x2e5647=new Hangup(_0x1298b7,_0x489a67);_0x2e5647[_0x7e6d('0xa4')]=0xc;_0x2e5647[_0x7e6d('0xa5')]=_0x489a67[_0x7e6d('0x10b')];_0x2e5647[_0x7e6d('0xec')]=_0x7e6d('0x10c');this[_0x7e6d('0xc7')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7e6d('0xc5')](_0x2e5647)[_0x7e6d('0xac')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype']['syncAgentComplete']=function(_0x2a25c8){var _0xf10c14=this[_0x7e6d('0x28')][_0x2a25c8[_0x7e6d('0xdc')]];var _0x331761=this;if(this[_0x7e6d('0x21')][_0x2a25c8['queue']]){if(_0xf10c14&&_0xf10c14[_0x7e6d('0x4f')]!==_0x7e6d('0x74')){delete this['uniqueId'][_0x2a25c8[_0x7e6d('0xdc')]];this[_0x7e6d('0x21')][_0x2a25c8['queue']][_0x7e6d('0x5d')]+=0x1;var _0x527180=new AgentComplete(_0xf10c14,_0x2a25c8);if(_0x2a25c8['reason']===_0x7e6d('0x10d')){_0x527180[_0x7e6d('0x10e')]=this[_0x7e6d('0x21')][_0x2a25c8[_0x7e6d('0xaf')]][_0x7e6d('0x10f')]&&this['voiceQueues'][_0x2a25c8[_0x7e6d('0xaf')]][_0x7e6d('0x110')]?moment()[_0x7e6d('0x75')](_0x7e6d('0xfb')):undefined;}this[_0x7e6d('0xc7')](_0x527180)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x111')));this[_0x7e6d('0xc5')](_0x527180)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x7e6d('0x1c')]['syncAgentConnect']=function(_0x556a9e){if(this[_0x7e6d('0x21')][_0x556a9e[_0x7e6d('0xaf')]]){if(this[_0x7e6d('0x28')][_0x556a9e['uniqueid']]&&this[_0x7e6d('0x28')][_0x556a9e[_0x7e6d('0xdc')]][_0x7e6d('0x4f')]!==_0x7e6d('0x74')){this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][_0x556a9e[_0x7e6d('0xaf')]]);this[_0x7e6d('0x28')][_0x556a9e['uniqueid']][_0x7e6d('0x112')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));}}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x113')]=function(_0x4381e5){this[_0x7e6d('0xc7')](_0x4381e5)['catch'](loggerCatch(_0x7e6d('0x111')));this[_0x7e6d('0xc5')](_0x4381e5)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x114')));};Dialer['prototype'][_0x7e6d('0x30')]=function(_0x53e270){var _0x4c89a3=this[_0x7e6d('0x28')][_0x53e270[_0x7e6d('0xdc')]];var _0x10ae78=this;if(this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]]){if(_0x4c89a3&&_0x4c89a3[_0x7e6d('0x4f')]!=='ivr'){delete this[_0x7e6d('0x28')][_0x53e270[_0x7e6d('0xdc')]];this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][_0x53e270['queue']]);_0x4c89a3[_0x7e6d('0x115')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));var _0x475dba=new QueueCallerAbandon(_0x4c89a3,_0x53e270);if(getSeconds(_0x4c89a3[_0x7e6d('0x115')],_0x4c89a3['responsetime'])>=_0x4c89a3[_0x7e6d('0x116')]){this['voiceQueues'][_0x53e270[_0x7e6d('0xaf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]][_0x7e6d('0x63')]+=0x1;this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]][_0x7e6d('0x117')]+=0x1;_0x475dba['state']=0xa;_0x475dba['statedesc']=_0x7e6d('0x118');_0x475dba[_0x7e6d('0x119')]='TIMEOUT';_0x475dba[_0x7e6d('0x10e')]=this[_0x7e6d('0x21')][_0x53e270['queue']][_0x7e6d('0x10f')]?moment()[_0x7e6d('0x75')](_0x7e6d('0xfb')):undefined;_0x475dba[_0x7e6d('0xf4')]+=0x1;_0x475dba[_0x7e6d('0xee')]+=0x1;if(_0x475dba[_0x7e6d('0xf4')]>=this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]]['dialDropMaxRetry']){this[_0x7e6d('0x113')](_0x475dba);}else{this[_0x7e6d('0xbb')]({'active':![],'countdropretry':_0x475dba[_0x7e6d('0xf4')],'scheduledat':moment()['add'](this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]]['dialDropRetryFrequency'],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x4c89a3[_0x7e6d('0xfc')],'ListId':_0x4c89a3[_0x7e6d('0xcf')],'VoiceQueueId':_0x4c89a3['VoiceQueueId']||undefined,'CampaignId':_0x4c89a3[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch(_0x7e6d('0x11a')));var _0x1179fb=new History(_0x475dba);_0x1179fb[_0x7e6d('0xa4')]=0xa;_0x1179fb[_0x7e6d('0xa5')]='Drop';_0x1179fb[_0x7e6d('0xa7')]=moment()[_0x7e6d('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0x1179fb[_0x7e6d('0xa6')]=_0x1179fb[_0x7e6d('0xa7')];_0x1179fb['calleridname']=_0x475dba[_0x7e6d('0x11b')];_0x1179fb[_0x7e6d('0x11c')]=_0x475dba[_0x7e6d('0x11c')];this[_0x7e6d('0xc7')](_0x1179fb)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x11d')));}}else{this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]][_0x7e6d('0x6a')]+=0x1;this['voiceQueues'][_0x53e270[_0x7e6d('0xaf')]]['outboundDropCallsDayCallersExit']+=0x1;_0x475dba[_0x7e6d('0xa4')]=0xb;_0x475dba['statedesc']=_0x7e6d('0x11e');_0x475dba[_0x7e6d('0x119')]=_0x7e6d('0x11f');_0x475dba[_0x7e6d('0x100')]+=0x1;_0x475dba[_0x7e6d('0xee')]+=0x1;if(_0x475dba[_0x7e6d('0x100')]>=this[_0x7e6d('0x21')][_0x53e270[_0x7e6d('0xaf')]][_0x7e6d('0x120')]){this[_0x7e6d('0x113')](_0x475dba);}else{this[_0x7e6d('0xbb')]({'active':![],'countabandonedretry':_0x475dba[_0x7e6d('0x100')],'scheduledat':moment()[_0x7e6d('0xf9')](this['voiceQueues'][_0x53e270['queue']][_0x7e6d('0x121')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x4c89a3[_0x7e6d('0xfc')],'ListId':_0x4c89a3[_0x7e6d('0xcf')],'VoiceQueueId':_0x4c89a3[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x4c89a3[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x122')));var _0x1179fb=new History(_0x475dba);_0x1179fb[_0x7e6d('0xa4')]=0xb;_0x1179fb[_0x7e6d('0xa5')]=_0x7e6d('0x11e');_0x1179fb[_0x7e6d('0xa7')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));_0x1179fb[_0x7e6d('0xa6')]=_0x1179fb[_0x7e6d('0xa7')];_0x1179fb[_0x7e6d('0x11b')]=_0x475dba['calleridname'];_0x1179fb['calleridnum']=_0x475dba[_0x7e6d('0x11c')];this[_0x7e6d('0xc7')](_0x1179fb)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x123')));}}}}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x39')]=function(_0x317e08){if(this[_0x7e6d('0x26')][_0x317e08[_0x7e6d('0xdc')]]){this['actions'][_0x317e08[_0x7e6d('0xdc')]][_0x7e6d('0x124')]=_0x317e08[_0x7e6d('0x124')];}if(this[_0x7e6d('0x28')][_0x317e08[_0x7e6d('0xdc')]]){this[_0x7e6d('0x28')][_0x317e08[_0x7e6d('0xdc')]]['channel']=_0x317e08[_0x7e6d('0x124')];}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x3b')]=function(_0x12487a){if(strategy[this['voiceQueues'][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0xaf')]][_0x7e6d('0x126')]]==='roundrobin'){if(this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]]&&_[_0x7e6d('0xdd')](this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0x127')])&&_0x12487a[_0x7e6d('0xab')]==='1'&&_0x12487a[_0x7e6d('0x128')]==='0'){if(this['agents'][_0x12487a['stateinterface']]){if(!this['agents'][_0x12487a[_0x7e6d('0x129')]][_0x7e6d('0x127')]){this[_0x7e6d('0x23')][_0x12487a[_0x7e6d('0x129')]][_0x7e6d('0x127')]=!![];this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0x127')]=!![];this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]]['stateinterface']=_0x12487a[_0x7e6d('0x129')];}}}}else if((strategy[this[_0x7e6d('0x21')][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]]['queue']][_0x7e6d('0x126')]]||_0x7e6d('0x1a'))===_0x7e6d('0x1a')){if(this['actions'][_0x12487a[_0x7e6d('0x125')]]){if(this['agents'][_0x12487a[_0x7e6d('0x129')]]){this[_0x7e6d('0x26')][_0x12487a['actionid']]['stateinterface']=_0x12487a[_0x7e6d('0x129')];if(_[_0x7e6d('0xdd')](this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0xaf')]])){this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]]['queue']]=[];}this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x12487a[_0x7e6d('0x125')]][_0x7e6d('0xaf')]][_0x7e6d('0x12a')](_[_0x7e6d('0x89')](_[_0x7e6d('0xce')](this['actions'][_0x12487a[_0x7e6d('0x125')]],['idHopper',_0x7e6d('0x129')]),{'status':_0x12487a[_0x7e6d('0xab')],'paused':_0x12487a['paused']}));}}}};function unlockQueueStatus(_0x1f47b6,_0x54d68f){setTimeout(function(){if(_[_0x7e6d('0x40')](_0x1f47b6[_0x7e6d('0x12b')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x54d68f);}_0x1f47b6['queueStatusComplete']=!![];loggerBooked['info'](_0x7e6d('0x12c'),_0x54d68f,JSON[_0x7e6d('0x4b')](_[_0x7e6d('0xce')](_0x1f47b6,[_0x7e6d('0x43'),_0x7e6d('0x12b')])));},0x1f3);}Dialer[_0x7e6d('0x1c')][_0x7e6d('0x3d')]=function(_0x4b0fc1){var _0x3cd207=this;var _0x48d4b3=_0x3cd207[_0x7e6d('0x21')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]];if(strategy[this[_0x7e6d('0x21')][this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0xaf')]][_0x7e6d('0x126')]]===_0x7e6d('0x1b')){if(this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]&&this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0x129')]){this[_0x7e6d('0x20')][_0x7e6d('0x12d')](this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0x12e')],this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0x129')])[_0x7e6d('0xac')](function(_0x2e8a01){logger[_0x7e6d('0x92')](_0x7e6d('0x12f'),util[_0x7e6d('0x93')](_0x2e8a01,{'showHidden':![],'depth':null}));})[_0x7e6d('0x130')](function(){_0x3cd207[_0x7e6d('0xae')](_0x3cd207[_0x7e6d('0x21')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]]);_0x3cd207[_0x7e6d('0x23')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0x129')]][_0x7e6d('0x127')]=![];delete _0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]];unlockQueueStatus(_0x48d4b3);});}else{this[_0x7e6d('0xae')](this[_0x7e6d('0x21')][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]['queue']]);this[_0x7e6d('0xbb')]({'active':![],'ContactId':this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xfc')],'ListId':this['actions'][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xcf')],'VoiceQueueId':this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xd1')]||undefined,'CampaignId':this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch(_0x7e6d('0x131')));delete this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]];unlockQueueStatus(_0x48d4b3);}}else if((strategy[this[_0x7e6d('0x21')][this['actions'][_0x4b0fc1['actionid']][_0x7e6d('0xaf')]]['strategy']]||_0x7e6d('0x1a'))===_0x7e6d('0x1a')){var _0x357f6b;if(this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]&&!_[_0x7e6d('0x49')](this[_0x7e6d('0x2c')][this['actions'][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]])){if(this[_0x7e6d('0x132')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]['queue']]){this[_0x7e6d('0x132')][_0x3cd207[_0x7e6d('0x26')][_0x4b0fc1['actionid']]['queue']]=this['queueBookedRR'][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]]?this['queueBookedRR'][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]['queue']]:this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x4b0fc1['actionid']][_0x7e6d('0xaf')]]?this[_0x7e6d('0x2c')][this['actions'][_0x4b0fc1['actionid']][_0x7e6d('0xaf')]][_0x7e6d('0x133')]||0x0:0x0;}this[_0x7e6d('0x2c')][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]]['queue']][_0x7e6d('0x133')]=this[_0x7e6d('0x132')][this[_0x7e6d('0x26')][_0x4b0fc1[_0x7e6d('0x125')]][_0x7e6d('0xaf')]];for(var _0x241dd=0x0;_0x241dd=0x0;})[_0x7e6d('0xac')](myreject(_0x4a6b57)));}}else{_0x3bbcc4[_0x7e6d('0x12a')](ami['Action']({'action':_0x7e6d('0x148'),'command':util[_0x7e6d('0x75')](_0x7e6d('0x14d'),_0x4fa5bd,!_[_0x7e6d('0x40')](config[_0x7e6d('0x145')][_0x168a59])?_0x168a59:'')})['then'](function(_0x597464){return _0x597464[_0x7e6d('0x14a')][_0x7e6d('0x14b')](_0x7e6d('0x14c'))>=0x0;})['catch'](myreject(_0x4a6b57)));}BPromise[_0x7e6d('0x14e')](_0x3bbcc4)[_0x7e6d('0xb1')](function(_0x3def00){var _0xba3c86=_[_0x7e6d('0x14f')](_0x3def00);if(_0xba3c86){return _0x343521(_0xba3c86);}else{_0x576eca[_0x7e6d('0x41')]=_0x47b0c9?_0x7e6d('0x150'):_0x7e6d('0x151');return _0x4a6b57(msgResponse(_0x7e6d('0x152'),_0x7e6d('0x142'),_0x7e6d('0x153')+_0x47b0c9+'\x20'+_0x1ce596+_0x7e6d('0x154')+util[_0x7e6d('0x93')](_0x4fa5bd,{'showHidden':![],'depth':null})+_0x7e6d('0x155')+_0x168a59));}})['catch'](function(_0x52e193){return _0x4a6b57(msgResponse(_0x7e6d('0x140'),_0x7e6d('0x142'),JSON[_0x7e6d('0x4b')](_0x52e193)));});});};Dialer[_0x7e6d('0x1c')]['checkDialMethod']=function(_0x191690){var _0x1b671d=this;return function(){switch(_0x191690[_0x7e6d('0x156')]){case'progressive':freeVariablesPredictive(_0x191690);_0x1b671d[_0x7e6d('0x157')](_0x191690,0x1);break;case _0x7e6d('0x158'):freeVariablesPredictive(_0x191690);_0x1b671d[_0x7e6d('0x157')](_0x191690,_0x191690[_0x7e6d('0x159')]);break;case'predictive':_0x1b671d[_0x7e6d('0x8')](_0x191690);break;case'booked':freeVariablesPredictive(_0x191690);_0x1b671d[_0x7e6d('0x157')](_0x191690,0x1);break;default:freeVariablesPredictive(_0x191690);logger[_0x7e6d('0x92')](_0x7e6d('0x15a'),_0x191690['name'],_0x7e6d('0x15b'));}};};Dialer['prototype'][_0x7e6d('0x15c')]=function(_0x408128){var _0x2f8d96=this;return function(){_0x2f8d96[_0x7e6d('0x15d')](_0x408128);};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0xa')]=function(_0x199338){var _0x5c396f=this;if(isNotPreview(_0x199338['dialMethod'])){if(isVoiceQueueOutbound(_0x199338[_0x7e6d('0x4f')])&&isActive(_0x199338[_0x7e6d('0x5a')])){_0x199338['sendMessageOneNotActive']=!![];BPromise[_0x7e6d('0xb4')]()[_0x7e6d('0xb1')](checkIsLoggedIn(_0x199338,_0x199338[_0x7e6d('0x51')]))[_0x7e6d('0xb1')](checkIsActive(_0x199338,_0x199338[_0x7e6d('0x5a')]))[_0x7e6d('0xb1')](checkInterval(_0x199338))['then'](_0x5c396f[_0x7e6d('0x13d')](_0x199338))[_0x7e6d('0xb1')](_0x5c396f[_0x7e6d('0x15e')](_0x199338[_0x7e6d('0x15f')],_0x199338[_0x7e6d('0x160')],_0x199338['name'],_0x199338))[_0x7e6d('0xb1')](_0x5c396f[_0x7e6d('0x141')](_0x199338[_0x7e6d('0x47')],_0x199338['dialTimezone'],_0x199338[_0x7e6d('0x43')],_0x199338))[_0x7e6d('0xb1')](_0x5c396f[_0x7e6d('0x161')](_0x199338))['catch'](loggerCatchQueueSummary(_0x7e6d('0x162'),_0x199338));}else{notSendMessagesQueue(_0x199338);}}else{freeVariablesPredictive(_0x199338);}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x13c')]=function(){var _0x34a65b=this;var _0x1916ed;for(var _0x277afe in this[_0x7e6d('0x22')]){if(typeof this[_0x7e6d('0x22')][_0x277afe]!==_0x7e6d('0x96')){_0x1916ed=this[_0x7e6d('0x22')][_0x277afe];if(isCampaignIvr(_0x1916ed['type'])&&isActive(_0x1916ed[_0x7e6d('0xd8')])){_0x1916ed[_0x7e6d('0x9d')]=!![];BPromise[_0x7e6d('0xb4')]()['then'](checkIsActive(_0x1916ed,_0x1916ed[_0x7e6d('0xd8')]))[_0x7e6d('0xb1')](checkInterval(_0x1916ed))[_0x7e6d('0xb1')](_0x34a65b[_0x7e6d('0x13d')](_0x1916ed))['then'](_0x34a65b[_0x7e6d('0x15e')](_0x1916ed['dialGlobalInterval'],_0x1916ed[_0x7e6d('0x160')],_0x1916ed[_0x7e6d('0x43')],_0x1916ed))[_0x7e6d('0xb1')](_0x34a65b['checkIfTimeIntervals'](_0x1916ed['Interval'],_0x1916ed[_0x7e6d('0x160')],_0x1916ed[_0x7e6d('0x43')],_0x1916ed))['then'](_0x34a65b[_0x7e6d('0x15c')](_0x1916ed))['catch'](loggerCatchQueueSummary(_0x7e6d('0x163'),_0x1916ed));}else{notSendMessagesCampaign(_0x1916ed);}}}};function getCallerIdRandom(_0x34fc52,_0x3af23b){var _0x1feafd;var _0x56871d;var _0x79424c;if(_0x3af23b<=0x0){_0x3af23b=0x1;}_0x1feafd=new RegExp('\x5cw{0,'+_0x3af23b+'}$');_0x56871d=Math['pow'](0xa,_0x3af23b-0x1);_0x79424c=Math[_0x7e6d('0x164')](0xa,_0x3af23b)-0x1;return util[_0x7e6d('0x75')]('%s',_[_0x7e6d('0x165')](_0x34fc52,_0x1feafd,_['random'](_0x56871d,_0x79424c)));}function extractCalleridName(_0xe59409){var _0xeab0=_0xe59409[_0x7e6d('0x166')](/"(.*?)"/);return _0xeab0?_0xeab0[0x1]:_0xe59409;}function extractCalleridNumber(_0x57b90a){var _0x1b712a=_0x57b90a[_0x7e6d('0x166')](/<(.*?)>/);return _0x1b712a?_0x1b712a[0x1]:_0x57b90a;}Dialer['prototype'][_0x7e6d('0x167')]=function(_0x5258d5,_0x8c6ffd){var _0x4f5402=this;var _0xd1fc5e=uuid['v4']();this[_0x7e6d('0x26')][_0xd1fc5e]=new Action(_0x5258d5,_0x8c6ffd,_0xd1fc5e);return new BPromise(function(_0x5958a1,_0x31e363){if(_[_0x7e6d('0x40')](_0x5258d5)&&typeof _0x5258d5!=='object'){return _0x31e363(msgResponse(_0x7e6d('0x168'),_0x7e6d('0x142'),_0x7e6d('0x169')));}if(_[_0x7e6d('0x40')](_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')])||_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')]===null){return _0x31e363(msgResponse(_0x7e6d('0x168'),'Failure',_0x7e6d('0x16c')));}var _0x190467={'XMD-CALLERID':_0x4f5402[_0x7e6d('0x26')][_0xd1fc5e][_0x7e6d('0x16d')](),'XMD-AGI':_0x5258d5[_0x7e6d('0x108')]?util[_0x7e6d('0x75')](_0x7e6d('0x16e'),ipAgi,_0x5258d5[_0x7e6d('0x108')]):'NONE','XMD-AGIAFTER':_0x5258d5['dialQueueProject2']?util[_0x7e6d('0x75')](_0x7e6d('0x16e'),ipAgi,_0x5258d5[_0x7e6d('0x10f')]):'NONE','XMD-QUEUE':_0x5258d5['type']===_0x7e6d('0x8f')?util[_0x7e6d('0x75')](_0x7e6d('0x16f'),_0x5258d5['name'],_0x5258d5[_0x7e6d('0x170')]||'',_0x5258d5[_0x7e6d('0x110')]?'c':'',_0x5258d5[_0x7e6d('0x116')]||0x3):_0x7e6d('0x171'),'XMD-CONTACTID':_0x8c6ffd[_0x7e6d('0xfc')],'XMD-CDRTYPE':_0x7e6d('0x172'),'CALLERID(all)':_0x4f5402[_0x7e6d('0x26')][_0xd1fc5e][_0x7e6d('0x16d')](),'XMD-AMD':_0x5258d5[_0x7e6d('0xe1')]?_0x7e6d('0x173'):_0x7e6d('0x171'),'XMD-DESTINATION':_0x7e6d('0x174')};if(_0x5258d5['dialAMDActive']){_0x190467[_0x7e6d('0x175')]=_0x5258d5[_0x7e6d('0x176')]||0x9c4;_0x190467[_0x7e6d('0x177')]=_0x5258d5[_0x7e6d('0x178')]||0x5dc;_0x190467[_0x7e6d('0x179')]=_0x5258d5[_0x7e6d('0x17a')]||0x320;_0x190467['XMD-AMDTOTALANALYSISTIME']=_0x5258d5[_0x7e6d('0x17b')]||0x1388;_0x190467['XMD-AMDMINWORDLENGTH']=_0x5258d5[_0x7e6d('0x17c')]||0x64;_0x190467[_0x7e6d('0x17d')]=_0x5258d5[_0x7e6d('0x17e')]||0x32;_0x190467[_0x7e6d('0x17f')]=_0x5258d5[_0x7e6d('0x180')]||0x3;_0x190467[_0x7e6d('0x181')]=_0x5258d5[_0x7e6d('0x182')]||0x100;_0x190467[_0x7e6d('0x183')]=_0x5258d5[_0x7e6d('0x184')]||0x1388;}if(_0x5258d5[_0x7e6d('0x4f')]===_0x7e6d('0x8f')){_0x190467[_0x7e6d('0x185')]=_0x8c6ffd['VoiceQueueId'];}else{_0x190467[_0x7e6d('0x186')]=_0x8c6ffd[_0x7e6d('0xd2')];}for(var _0x59352d in _0x8c6ffd['Contact']){if(typeof _0x8c6ffd[_0x7e6d('0x16a')][_0x59352d]!=='undefined'){if(isNotNull(_0x8c6ffd[_0x7e6d('0x16a')][_0x59352d])&&_0x59352d!=='id'&&_0x59352d!==_0x7e6d('0x187')&&_0x59352d!==_0x7e6d('0x188')&&_0x59352d!==_0x7e6d('0x189')){_0x190467[util[_0x7e6d('0x75')]('%s%s',_0x7e6d('0x18a'),_['toUpper'](_0x59352d))]=_0x8c6ffd['Contact'][_0x59352d];}}}var _0x52244=_0x4f5402['isTrunkReachable'](_0x5258d5['Trunk'])?getCallerId(_0x5258d5['Trunk']['callerid'],_0x5258d5[_0x7e6d('0x18b')],_0x5258d5[_0x7e6d('0x18c')]>0x0?getCallerIdRandom(_0x5258d5[_0x7e6d('0x5b')],_0x5258d5[_0x7e6d('0x18c')]):_0x5258d5['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x5258d5[_0x7e6d('0x13e')])?_0x5258d5['Trunk']['callerid']:_0x5258d5[_0x7e6d('0x13e')][_0x7e6d('0x72')],_0x5258d5[_0x7e6d('0x18b')],_0x5258d5[_0x7e6d('0x18c')]>0x0?getCallerIdRandom(_0x5258d5[_0x7e6d('0x5b')],_0x5258d5['dialRandomLastDigitCallerIdNumber']):_0x5258d5[_0x7e6d('0x5b')]);if(_0x52244){_0x190467[_0x7e6d('0x18d')]=_0x4f5402[_0x7e6d('0x26')][_0xd1fc5e]['originatecalleridname']=extractCalleridName(_0x52244);_0x190467[_0x7e6d('0x18e')]=_0x4f5402['actions'][_0xd1fc5e][_0x7e6d('0x18f')]=extractCalleridNumber(_0x52244);}return ami[_0x7e6d('0xaa')]({'actionid':_0xd1fc5e,'action':'originate','channel':_0x4f5402[_0x7e6d('0xd7')](_0x5258d5[_0x7e6d('0x71')])?util[_0x7e6d('0x75')]('SIP/%s/%s%s',_0x5258d5[_0x7e6d('0x71')]['name'],isNotNull(_0x5258d5[_0x7e6d('0x190')])?_0x5258d5[_0x7e6d('0x190')][_0x7e6d('0x191')]()||'':'',_0x5258d5[_0x7e6d('0x192')]>0x0?_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')][_0x7e6d('0x193')](_0x5258d5['dialCutDigit']):_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')]):util[_0x7e6d('0x75')]('SIP/%s/%s%s',_[_0x7e6d('0xdd')](_0x5258d5['TrunkBackup'])?_0x5258d5[_0x7e6d('0x71')][_0x7e6d('0x43')]:_0x5258d5[_0x7e6d('0x13e')][_0x7e6d('0x43')],isNotNull(_0x5258d5[_0x7e6d('0x190')])?_0x5258d5[_0x7e6d('0x190')][_0x7e6d('0x191')]()||'':'',_0x5258d5[_0x7e6d('0x192')]>0x0?_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')][_0x7e6d('0x193')](_0x5258d5[_0x7e6d('0x192')]):_0x8c6ffd[_0x7e6d('0x16a')][_0x7e6d('0x16b')]),'callerid':_0x52244,'Exten':_0x7e6d('0x174'),'Context':_0x7e6d('0x194'),'Priority':'1','variable':_0x190467,'timeout':(_0x5258d5[_0x7e6d('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd1fc5e})[_0x7e6d('0xb1')](function(_0x2818f3){return _0x5958a1(_0x2818f3);})[_0x7e6d('0xac')](function(_0x5b828b){_0x5258d5['outboundOriginateFailureCallsDay']+=0x1;var _0xfa6d93=new History(_0x4f5402['actions'][_0xd1fc5e]);logger[_0x7e6d('0x92')](util[_0x7e6d('0x75')](_0x7e6d('0x195'),JSON[_0x7e6d('0x4b')](_0x5b828b)));_0xfa6d93['state']=0xe;_0xfa6d93[_0x7e6d('0xa5')]=_0x7e6d('0x196');_0xfa6d93[_0x7e6d('0xa7')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));_0xfa6d93[_0x7e6d('0xa6')]=_0xfa6d93[_0x7e6d('0xa7')];_0x4f5402[_0x7e6d('0xc7')](_0xfa6d93)[_0x7e6d('0xac')](loggerCatch('[originate][error]'));_0x4f5402['moveContactManagedDialer'](_0xfa6d93)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x197')))[_0x7e6d('0x130')](function(){delete _0x4f5402['actions'][_0xd1fc5e];return _0x31e363(msgResponse('originate',_0x7e6d('0x198'),_0x7e6d('0x199')));});});});};Dialer['prototype'][_0x7e6d('0x32')]=function(_0x5fbca2){var _0x153473=this[_0x7e6d('0x26')][_0x5fbca2['actionid']];if(_0x153473){delete this[_0x7e6d('0x26')][_0x5fbca2['actionid']];_0x153473['responsetime']=moment()[_0x7e6d('0x75')]('YYYY-MM-DD\x20HH:mm:ss');var _0x498d7f=_0x153473[_0x7e6d('0x4f')]==='ivr'?this[_0x7e6d('0x22')][_0x153473[_0x7e6d('0xaf')]]:this[_0x7e6d('0x21')][_0x153473[_0x7e6d('0x19a')]()];if(!this['isSuccess'](_0x5fbca2['response'])){this[_0x7e6d('0xae')](_0x498d7f);return this[_0x7e6d('0x19b')](_0x153473,_0x498d7f,_0x5fbca2)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x19c')));}this['uniqueId'][_0x5fbca2[_0x7e6d('0xdc')]]=_0x153473;}};Dialer[_0x7e6d('0x1c')]['checkRetriveMax']=function(_0x57f2d0,_0xb074a,_0x1d4d06){var _0x22c380=new History(_0xb074a);if(_0x22c380[_0x7e6d('0xf0')]+_0x22c380['countcongestionretry']+_0x22c380['countnoanswerretry']+_0x22c380['countnosuchnumberretry']+_0x22c380['countdropretry']+_0x22c380[_0x7e6d('0x100')]+_0x22c380[_0x7e6d('0xed')]+_0x22c380['countagentrejectretry']>=_0x1d4d06[_0x7e6d('0xf5')]-0x1){return!![];}switch(_0x57f2d0){case 0x3:if(_0x22c380[_0x7e6d('0xf2')]>=_0x1d4d06[_0x7e6d('0x19d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x22c380[_0x7e6d('0xf2')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x19e')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380['VoiceQueueId']||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x19f')));break;case 0x5:if(_0x22c380['countbusyretry']>=_0x1d4d06[_0x7e6d('0x1a0')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countbusyretry':_0x22c380[_0x7e6d('0xf0')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x1a1')],_0x7e6d('0x103'))['format'](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380['VoiceQueueId']||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1a2')));break;case 0x8:if(_0x22c380[_0x7e6d('0xf1')]>=_0x1d4d06[_0x7e6d('0x1a3')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countcongestionretry':_0x22c380[_0x7e6d('0xf1')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x1a4')],'minutes')[_0x7e6d('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22c380['ContactId'],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380['VoiceQueueId']||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch(_0x7e6d('0x1a5')));break;case 0x0:if(_0x22c380[_0x7e6d('0xf3')]>=_0x1d4d06[_0x7e6d('0x1a6')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x22c380[_0x7e6d('0xf3')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x1a7')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x22c380[_0x7e6d('0xf4')]>=_0x1d4d06[_0x7e6d('0x1a8')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countdropretry':_0x22c380['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x1d4d06[_0x7e6d('0x1a9')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380['ListId'],'VoiceQueueId':_0x22c380[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x22c380[_0x7e6d('0x100')]>=_0x1d4d06[_0x7e6d('0x120')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countabandonedretry':_0x22c380[_0x7e6d('0x100')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0x121')],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380['VoiceQueueId']||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x22c380[_0x7e6d('0xed')]>=_0x1d4d06[_0x7e6d('0x1aa')]-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countmachineretry':_0x22c380[_0x7e6d('0xed')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06[_0x7e6d('0xfa')],_0x7e6d('0x103'))['format'](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x22c380['CampaignId']||undefined})[_0x7e6d('0xac')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x22c380[_0x7e6d('0x101')]>=_0x1d4d06['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x7e6d('0xbb')]({'active':![],'countagentrejectretry':_0x22c380[_0x7e6d('0x101')]+=0x1,'scheduledat':moment()[_0x7e6d('0xf9')](_0x1d4d06['dialAgentRejectRetryFrequency'],_0x7e6d('0x103'))[_0x7e6d('0x75')](_0x7e6d('0xfb')),'ContactId':_0x22c380[_0x7e6d('0xfc')],'ListId':_0x22c380[_0x7e6d('0xcf')],'VoiceQueueId':_0x22c380[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x22c380[_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1ab')));break;default:return!![];}};Dialer[_0x7e6d('0x1c')]['callProgressDetecting']=function(_0x19ab25,_0x589562,_0x26d6d8){var _0x3ab61a=this;var _0x2e5871=new History(_0x19ab25);return new BPromise(function(_0x427185,_0x26895e){if(_['isUndefined'](_0x589562)&&typeof _0x589562!==_0x7e6d('0x1ac')){return _0x26895e(msgResponse(_0x7e6d('0x1ad'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x26d6d8)&&typeof _0x26d6d8!==_0x7e6d('0x1ac')){return _0x26895e(msgResponse('[callProgressDetecting]',_0x7e6d('0x142'),_0x7e6d('0x1ae')));}switch(_0x26d6d8[_0x7e6d('0x1af')]){case'0':_0x589562['outboundNoSuchCallsDay']+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0x0;_0x2e5871[_0x7e6d('0xa5')]='NoSuchNumber';_0x2e5871[_0x7e6d('0xf3')]+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami[_0x7e6d('0x4e')](_0x7e6d('0x1b0'),ut['buildObj'](_0x19ab25,_0x7e6d('0x1b1')));_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xef')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x0,_0x19ab25,_0x589562)){if(_0x2e5871[_0x7e6d('0xf3')]>=_0x589562[_0x7e6d('0x1a6')]){_0x3ab61a['createStateFinal'](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1b3'));}else{_0x3ab61a['stateGlobal'](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1b3'));}}break;case'3':_0x589562[_0x7e6d('0x1b4')]+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0x3;_0x2e5871[_0x7e6d('0xa5')]=_0x7e6d('0x1b5');_0x2e5871[_0x7e6d('0xf2')]+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami[_0x7e6d('0x4e')](_0x7e6d('0x1b6'),ut['buildObj'](_0x19ab25,_0x7e6d('0x1b7')));_0x3ab61a['createHistory'](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1b8')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x3,_0x19ab25,_0x589562)){if(_0x2e5871['countnoanswerretry']>=_0x589562[_0x7e6d('0x19d')]){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1b9'));}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1b9'));}}break;case'5':_0x589562[_0x7e6d('0x5f')]+=0x1;_0x2e5871['state']=0x5;_0x2e5871['statedesc']='Busy';_0x2e5871[_0x7e6d('0xf0')]+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami['emit'](_0x7e6d('0x1ba'),ut['buildObj'](_0x19ab25,_0x7e6d('0x1bb')));_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1bc')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x5,_0x19ab25,_0x589562)){if(_0x2e5871['countbusyretry']>=_0x589562[_0x7e6d('0x1a0')]){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1bd'));}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,'reason\x205\x20busy');}}break;case'8':_0x589562['outboundCongestionCallsDay']+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0x8;_0x2e5871['statedesc']=_0x7e6d('0x1be');_0x2e5871['countcongestionretry']+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami[_0x7e6d('0x4e')]('custom:agentcongestion',ut[_0x7e6d('0xe7')](_0x19ab25,_0x7e6d('0x1bf')));_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)['catch'](loggerCatch(_0x7e6d('0x1c0')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x8,_0x19ab25,_0x589562)){if(_0x2e5871['countcongestionretry']>=_0x589562[_0x7e6d('0x1a3')]){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,'reason\x208\x20congestion');}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1c1'));}}break;case'11':_0x589562['outboundAbandonedCallsDay']+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0xb;_0x2e5871[_0x7e6d('0xa5')]=_0x7e6d('0x11e');_0x2e5871['countabandonedretry']+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;_0x3ab61a['createHistory'](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x123')));if(_0x3ab61a['checkRetriveMax'](0xb,_0x19ab25,_0x589562)){if(_0x2e5871[_0x7e6d('0x100')]>=_0x589562['dialAbandonedMaxRetry']){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,'reason\x2011\x20abandoned');}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1c2'));}}break;case'20':_0x589562['outboundRejectCallsDay']+=0x1;_0x2e5871[_0x7e6d('0xa4')]=0x14;_0x2e5871[_0x7e6d('0xa5')]=_0x7e6d('0x1c3');_0x2e5871[_0x7e6d('0x101')]+=0x1;_0x2e5871[_0x7e6d('0xee')]+=0x1;ami['emit'](_0x7e6d('0x1c4'),ut[_0x7e6d('0xe7')](_0x19ab25,_0x7e6d('0x1c5')));_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1c6')));if(_0x3ab61a[_0x7e6d('0x1b2')](0x14,_0x19ab25,_0x589562)){if(_0x2e5871['countagentrejectretry']>=_0x589562[_0x7e6d('0x1c7')]){_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,'reason\x2020\x20agentreject');}else{_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x7e6d('0x1c8'));}}break;default:_0x589562[_0x7e6d('0x67')]+=0x1;_0x2e5871['state']=0xc;_0x2e5871[_0x7e6d('0xa5')]=_0x26d6d8['reason'];_0x3ab61a[_0x7e6d('0xc7')](_0x2e5871)[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1c9')));if(_0x3ab61a[_0x7e6d('0x1b2')](_0x26d6d8[_0x7e6d('0x1af')],_0x19ab25,_0x589562)){if(_0x2e5871['countbusyretry']+_0x2e5871['countcongestionretry']+_0x2e5871[_0x7e6d('0xf2')]+_0x2e5871['countnosuchnumberretry']+_0x2e5871[_0x7e6d('0xf4')]+_0x2e5871[_0x7e6d('0x100')]+_0x2e5871[_0x7e6d('0xed')]+_0x2e5871['countagentrejectretry']>=_0x589562[_0x7e6d('0xf5')]){_0x3ab61a[_0x7e6d('0xf6')](_0x2e5871,_0x427185,_0x26895e,_0x26d6d8[_0x7e6d('0x1af')]);}else{_0x3ab61a[_0x7e6d('0x102')](_0x2e5871,_0x427185,_0x26895e,_0x26d6d8[_0x7e6d('0x1af')]);}}}});};Dialer[_0x7e6d('0x1c')]['stateGlobal']=function(_0x3d0dee,_0x24465a,_0x2b31ec,_0x1aad63){var _0x2a8d2d=new Final(_0x3d0dee);_0x2a8d2d[_0x7e6d('0xa4')]=0xf;_0x2a8d2d[_0x7e6d('0xa5')]=_0x7e6d('0x1ca');this[_0x7e6d('0x102')](_0x2a8d2d,_0x24465a,_0x2b31ec,_0x1aad63);};Dialer[_0x7e6d('0x1c')]['createStateFinal']=function(_0x480f08,_0x3bafcc,_0x282cf8,_0x4b7ff2){this[_0x7e6d('0xc5')](_0x480f08)[_0x7e6d('0xb1')](function(){return _0x3bafcc(msgResponse(_0x7e6d('0x1ad'),_0x7e6d('0xd6'),_0x4b7ff2));})[_0x7e6d('0xac')](function(){return _0x282cf8(msgResponse(_0x7e6d('0x1cb'),_0x7e6d('0x142'),'contact\x20not\x20moved'));});};Dialer[_0x7e6d('0x1c')]['predictive']=function(_0x2c80e9){var _0x6f01d6=_0x2c80e9[_0x7e6d('0x1cc')]/0x64;var _0x11e778=_0x2c80e9['outboundDropCallsDayTimeout']/(_0x2c80e9[_0x7e6d('0x63')]+_0x2c80e9[_0x7e6d('0x5d')]);var _0x308c91=Math['round'](_0x2c80e9[_0x7e6d('0x6e')]*(_0x2c80e9[_0x7e6d('0x1cd')]/0x64));var _0x188b96=Math[_0x7e6d('0x1ce')](_0x2c80e9[_0x7e6d('0x6e')]*(_0x2c80e9['predictiveIntervalMinThreshold']/0x64));var _0x16647b=_0x2c80e9[_0x7e6d('0x50')]+_0x2c80e9[_0x7e6d('0x9e')];var _0x446460=Math[_0x7e6d('0x1cf')](_0x2c80e9[_0x7e6d('0x6f')]*_0x2c80e9[_0x7e6d('0x87')]*_0x2c80e9[_0x7e6d('0x6d')]*_0x2c80e9[_0x7e6d('0x1d0')]);if(_[_0x7e6d('0x40')](_0x2c80e9[_0x7e6d('0x2a')])){if(!_['isUndefined'](_0x2c80e9['startPredictive'])){_0x2c80e9[_0x7e6d('0x29')]=undefined;loggerPredictive['error'](_0x7e6d('0x1d1'),_0x7e6d('0x1d2'));}if(!_[_0x7e6d('0x40')](_0x2c80e9[_0x7e6d('0x8d')])){loggerPredictive[_0x7e6d('0x92')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2c80e9['handlePredictive']);_0x2c80e9[_0x7e6d('0x8d')]=undefined;}_0x2c80e9[_0x7e6d('0x2a')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));loggerPredictive[_0x7e6d('0x78')](_0x2c80e9[_0x7e6d('0x43')],'collection\x20data\x20in\x20progressive\x20at',_0x2c80e9[_0x7e6d('0x2a')]);this[_0x7e6d('0x157')](_0x2c80e9,0x1);}else if(ifInterval(_0x2c80e9[_0x7e6d('0x1d3')],_0x2c80e9['startProgressive'])){this[_0x7e6d('0x157')](_0x2c80e9,0x1);loggerPredictiveCalls[_0x7e6d('0x78')](_0x7e6d('0x1d4'),_0x2c80e9['startProgressive'],_0x2c80e9[_0x7e6d('0x43')]);_0x2c80e9[_0x7e6d('0x6f')]=0x0;_0x2c80e9[_0x7e6d('0x117')]=0x0;}else if(_0x6f01d6<_0x11e778&&_0x2c80e9[_0x7e6d('0x1d5')]==='dropRate'){freeVariablesPredictive(_0x2c80e9);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x1d6'),_0x7e6d('0x1d7'),_0x11e778,_0x7e6d('0x2a'),_0x2c80e9['name']);}else if(_0x446460<_0x2c80e9[_0x7e6d('0x117')]&&_0x2c80e9[_0x7e6d('0x1d5')]==='dropRate'){freeVariablesPredictive(_0x2c80e9);loggerPredictive['info'](_0x7e6d('0x1d8'),'Max\x20Drop\x20',_0x446460,_0x7e6d('0x1d9'),_0x2c80e9[_0x7e6d('0x117')],_0x7e6d('0x2a'),_0x2c80e9[_0x7e6d('0x43')]);}else if(!ifInterval(_0x2c80e9[_0x7e6d('0x1d3')],_0x2c80e9[_0x7e6d('0x2a')])&&_[_0x7e6d('0x40')](_0x2c80e9[_0x7e6d('0x29')])&&!_[_0x7e6d('0x40')](_0x2c80e9[_0x7e6d('0x2a')])){_0x2c80e9[_0x7e6d('0x29')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));loggerPredictive['info'](_0x2c80e9['name'],'started\x20in\x20predictive\x20at',_0x2c80e9[_0x7e6d('0x29')]);this[_0x7e6d('0xb8')](_0x2c80e9[_0x7e6d('0x1d3')])[_0x7e6d('0xb1')](this[_0x7e6d('0x1da')](_0x2c80e9))[_0x7e6d('0xb1')](mergeDataErlangB(_0x2c80e9))[_0x7e6d('0xb1')](this['startMethodPredictive'](_0x2c80e9))[_0x7e6d('0xac')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2c80e9));}else if(!ifInterval(_0x2c80e9[_0x7e6d('0x1d3')],_0x2c80e9[_0x7e6d('0x29')])){_0x2c80e9[_0x7e6d('0x117')]=0x0;_0x2c80e9[_0x7e6d('0x29')]=moment()[_0x7e6d('0x75')](_0x7e6d('0xfb'));loggerPredictive[_0x7e6d('0x78')](_0x2c80e9[_0x7e6d('0x43')],'recalculate\x20predictive\x20at',_0x2c80e9['startPredictive']);clearInterval(_0x2c80e9[_0x7e6d('0x8d')]);_0x2c80e9[_0x7e6d('0x8d')]=undefined;this[_0x7e6d('0xb8')](_0x2c80e9[_0x7e6d('0x1d3')])[_0x7e6d('0xb1')](this[_0x7e6d('0x1da')](_0x2c80e9))[_0x7e6d('0xb1')](mergeDataErlangB(_0x2c80e9))[_0x7e6d('0xb1')](this[_0x7e6d('0x1db')](_0x2c80e9))[_0x7e6d('0xac')](loggerCatchPredictive(_0x7e6d('0x1dc'),_0x2c80e9));}else if(_0x2c80e9['predictiveIntervalAvailable']&&_0x16647b<_0x2c80e9['predictiveIntervalAvailable']-_0x188b96){freeVariablesPredictive(_0x2c80e9);loggerPredictive['info'](_0x2c80e9[_0x7e6d('0x43')],_0x7e6d('0x1dd'),_0x16647b,_0x7e6d('0x1de'),_0x2c80e9['predictiveIntervalAvailable'],'-',_0x188b96,'=',_0x2c80e9[_0x7e6d('0x6e')]-_0x188b96,')');}else if(_0x2c80e9[_0x7e6d('0x6e')]&&_0x16647b>_0x2c80e9[_0x7e6d('0x6e')]+_0x308c91){freeVariablesPredictive(_0x2c80e9);loggerPredictive[_0x7e6d('0x78')](_0x2c80e9[_0x7e6d('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x16647b,_0x7e6d('0x1df'),_0x2c80e9[_0x7e6d('0x6e')],'+',_0x308c91,'=',_0x2c80e9['predictiveIntervalAvailable']+_0x308c91,')');}};Dialer[_0x7e6d('0x1c')]['getDataPredictive']=function(_0x437375){var _0x3f6ccb=this;return function(_0x20b457){return new BPromise(function(_0x25ba52,_0x1ceab7){_['merge'](_0x437375,_0x20b457[0x0]);if(checkGetDataPredictive(_0x20b457[0x0])){var _0x3b7880=_0x437375['predictiveIntervalAvailable']=_0x437375['talking']+_0x437375['available'];var _0x526c2e=_0x437375[_0x7e6d('0x1d3')]*0x3c;var _0x1a43de=_0x20b457[0x0][_0x7e6d('0x69')]+_0x20b457[0x0]['predictiveIntervalAvgHoldtime'];var _0x38ed71=(_0x20b457[0x0][_0x7e6d('0x7c')]+_0x20b457[0x0][_0x7e6d('0x6b')]+_0x20b457[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x20b457[0x0][_0x7e6d('0x7b')];_0x437375[_0x7e6d('0x6d')]=_0x38ed71>0x0?_0x38ed71:0x1;switch(_0x437375[_0x7e6d('0x1d5')]){case _0x7e6d('0x1e0'):var _0x3c09df=_0x437375[_0x7e6d('0x1cc')]/0x64;return _0x3f6ccb[_0x7e6d('0x1e1')](_0x3b7880,_0x526c2e,_0x1a43de,_0x38ed71,_0x3c09df)[_0x7e6d('0xb1')](function(_0x12b641){return _0x25ba52(_0x12b641);});case _0x7e6d('0x1e2'):var _0x1e4885=_0x437375[_0x7e6d('0x1cc')]/0x64;return _0x3f6ccb[_0x7e6d('0x1e3')](_0x3b7880,_0x526c2e,_0x1a43de,_0x38ed71,_0x1e4885)[_0x7e6d('0xb1')](function(_0x355293){return _0x25ba52(_0x355293);});default:return _0x1ceab7(msgResponse(_0x7e6d('0x1e4'),_0x7e6d('0x142'),_0x7e6d('0x1e5')));}}else{return _0x1ceab7(msgResponse(_0x7e6d('0x1e4'),_0x7e6d('0x142'),_0x7e6d('0x1e6')));}});};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1e7')]=function(_0x2cda56){var _0x2b8e3b=this;return function(_0x33b483){return new BPromise(function(_0x2697b3,_0x1d555f){_[_0x7e6d('0x89')](_0x2cda56,_0x33b483[0x0]);if(checkGetDataPredictive(_0x33b483[0x0])){loggerPredictive[_0x7e6d('0x78')](JSON['stringify'](_0x33b483[0x0]));if(_0x2cda56[_0x7e6d('0x1d5')]===_0x7e6d('0x1e0')){return _0x2b8e3b[_0x7e6d('0xc3')](_0x2cda56['id'])[_0x7e6d('0xb1')](function(_0x39006f){var _0x5ba5c4=_0x2cda56['loggedIn']-_0x39006f[0x0][_0x7e6d('0x1e8')];var _0x42fd96=_0x2cda56[_0x7e6d('0x1d3')]*0x3c;var _0x3137b7=_0x33b483[0x0][_0x7e6d('0x69')]+_0x33b483[0x0]['predictiveIntervalAvgHoldtime'];var _0x229421=(_0x33b483[0x0][_0x7e6d('0x7c')]+_0x33b483[0x0][_0x7e6d('0x6b')]+_0x33b483[0x0][_0x7e6d('0x6a')])/_0x33b483[0x0]['predictiveIntervalTotalCalls'];var _0x5a12b1=_0x2cda56[_0x7e6d('0x1cc')]/0x64;_0x2cda56['predictiveIntervalPauses']=_0x39006f[0x0]['outboundQueuePauses']||0x0;_0x2cda56[_0x7e6d('0x6d')]=_0x229421>0x0?_0x229421:0x1;return _0x2b8e3b[_0x7e6d('0x1e1')](_0x5ba5c4,_0x42fd96,_0x3137b7,_0x229421,_0x5a12b1);})[_0x7e6d('0xb1')](function(_0x3a5c03){return _0x2697b3(_0x3a5c03);})['catch'](function(_0x3fc41f){return _0x1d555f(msgResponse('[CatchErlangB]',_0x7e6d('0x142'),JSON['stringify'](_0x3fc41f)));});}if(_0x2cda56[_0x7e6d('0x1d5')]==='agentBusyFactor'){return _0x2b8e3b[_0x7e6d('0xc3')](_0x2cda56['id'])[_0x7e6d('0xb1')](function(_0x5264e3){var _0x3d219b=_0x2cda56['loggedIn']-_0x5264e3[0x0][_0x7e6d('0x1e8')];var _0x5621b8=_0x2cda56['dialPredictiveInterval']*0x3c;var _0x1c7ffe=_0x33b483[0x0][_0x7e6d('0x69')]+_0x33b483[0x0][_0x7e6d('0x68')];var _0x2a7c71=(_0x33b483[0x0][_0x7e6d('0x7c')]+_0x33b483[0x0][_0x7e6d('0x6b')]+_0x33b483[0x0][_0x7e6d('0x6a')])/_0x33b483[0x0][_0x7e6d('0x7b')];var _0x8d6822=_0x2cda56[_0x7e6d('0x1cc')]/0x64;_0x2cda56[_0x7e6d('0x1e9')]=_0x5264e3[0x0][_0x7e6d('0x1e8')]||0x0;_0x2cda56[_0x7e6d('0x6d')]=_0x2a7c71>0x0?_0x2a7c71:0x1;return _0x2b8e3b[_0x7e6d('0x1e3')](_0x3d219b,_0x5621b8,_0x1c7ffe,_0x2a7c71,_0x8d6822);})[_0x7e6d('0xb1')](function(_0x29fdff){return _0x2697b3(_0x29fdff);})[_0x7e6d('0xac')](function(_0x27e8cf){return _0x1d555f(msgResponse(_0x7e6d('0x1ea'),'Failure',JSON[_0x7e6d('0x4b')](_0x27e8cf)));});}}else{return _0x1d555f(msgResponse(_0x7e6d('0x1e4'),_0x7e6d('0x142'),'check\x20failure'));}});};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1db')]=function(_0x37af1e){var _0x3311d3=this;return function(){var _0x4646b4=0x0;var _0x284fb3=Math[_0x7e6d('0x1cf')](_0x37af1e['erlangCallToSecond']*0x3e8);if(_0x284fb3>0x0){_0x284fb3=_0x284fb3<0x64?0x64:_0x284fb3;loggerPredictive[_0x7e6d('0x78')](_0x37af1e[_0x7e6d('0x43')],_0x7e6d('0x1eb'),_0x284fb3,_0x7e6d('0x4c'));_0x37af1e[_0x7e6d('0x8d')]=setInterval(function(){_0x3311d3[_0x7e6d('0x8d')](_0x37af1e);loggerPredictiveCalls['info'](_0x7e6d('0x1ec'),_0x4646b4+=0x1);},_0x284fb3);}else{loggerPredictive[_0x7e6d('0x78')](_0x37af1e['name'],_0x7e6d('0x1ed'));}};};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1ee')]=function(_0x5acdf5,_0x1f7802){var _0xbe9b09=this;return function(_0x9f227b){if(_[_0x7e6d('0x49')](_0x9f227b)){if(_[_0x7e6d('0xdd')](_0x1f7802[_0x7e6d('0xd0')])||!_0x1f7802['recallme']){if(_0x5acdf5[_0x7e6d('0x156')]===_0x7e6d('0x7')){_0x5acdf5[_0x7e6d('0x12b')]=_[_0x7e6d('0x40')](_0x5acdf5[_0x7e6d('0x12b')])?!![]:_0x5acdf5[_0x7e6d('0x12b')];var _0x335fc3=uuid['v4']();_0xbe9b09[_0x7e6d('0x26')][_0x335fc3]=new Action(_0x5acdf5,_0x1f7802,_0x335fc3);loggerBooked[_0x7e6d('0x78')]('[booked][checkContactBlack]',_0x335fc3,'queueStatusComplete:\x20',JSON[_0x7e6d('0x4b')](_0x5acdf5[_0x7e6d('0x12b')]),_0x7e6d('0x1ef'),_0x5acdf5['name']);if(_0x5acdf5['queueStatusComplete']){_0x5acdf5[_0x7e6d('0x12b')]=![];_0xbe9b09[_0x7e6d('0x2c')][_0xbe9b09['actions'][_0x335fc3][_0x7e6d('0xaf')]]=[];ami[_0x7e6d('0xaa')]({'actionid':_0x335fc3,'action':_0x7e6d('0x1f0'),'queue':_0x5acdf5[_0x7e6d('0x43')]})[_0x7e6d('0xac')](function(){_0xbe9b09[_0x7e6d('0xae')](_0x5acdf5);_0xbe9b09['rescheduleContact']({'active':![],'ContactId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xfc')],'ListId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3]['ListId'],'VoiceQueueId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xd1')]||undefined,'CampaignId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1f1')));delete _0xbe9b09[_0x7e6d('0x26')][_0x335fc3];});}else{loggerBooked[_0x7e6d('0x78')](_0x7e6d('0x1f2'),JSON[_0x7e6d('0x4b')](_0x5acdf5['queueStatusComplete']),_0x7e6d('0x1ef'),_0x5acdf5['name']);_0xbe9b09[_0x7e6d('0xae')](_0x5acdf5);_0xbe9b09[_0x7e6d('0xbb')]({'active':![],'ContactId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xfc')],'ListId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xcf')],'VoiceQueueId':_0xbe9b09['actions'][_0x335fc3][_0x7e6d('0xd1')]||undefined,'CampaignId':_0xbe9b09[_0x7e6d('0x26')][_0x335fc3][_0x7e6d('0xd2')]||undefined})[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1f1')));delete _0xbe9b09[_0x7e6d('0x26')][_0x335fc3];}}else{return _0xbe9b09[_0x7e6d('0x167')](_0x5acdf5,_0x1f7802);}}else{if(getDiff(_0x1f7802[_0x7e6d('0x1f3')])<_0x5acdf5[_0x7e6d('0x1f4')]*0x3c){if(_0x1f7802[_0x7e6d('0x1f5')]&&!_0x1f7802['Agent']['voicePause']){_0xbe9b09['preview'][_0x7e6d('0x12d')](_0x1f7802['id'])[_0x7e6d('0x130')](function(){_0xbe9b09['updateOriginated'](_0x5acdf5);});}else{_0xbe9b09['unlockContact']({'active':![]},_0x1f7802['id'],0x1)[_0x7e6d('0x130')](function(){_0xbe9b09[_0x7e6d('0xae')](_0x5acdf5);});}}else{_0x5acdf5[_0x7e6d('0x65')]+=0x1;_0xbe9b09['updateOriginated'](_0x5acdf5);if(_0x5acdf5['dialRecallInQueue']){_0xbe9b09['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1f7802[_0x7e6d('0xfc')],'ListId':_0x1f7802[_0x7e6d('0xcf')],'VoiceQueueId':_0x1f7802[_0x7e6d('0xd1')]||undefined,'CampaignId':_0x1f7802[_0x7e6d('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0xbe9b09[_0x7e6d('0xc7')](createObjHistory(_0x5acdf5,_0x1f7802,_0x7e6d('0x1f6'),0x17,'RecallInQueue'))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0x1f7')));}else{_0xbe9b09[_0x7e6d('0xcd')](createObjHistory(_0x5acdf5,_0x1f7802,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x7e6d('0x1f8'),_0x7e6d('0x1f9'));}}}}else{_0x5acdf5[_0x7e6d('0x5e')]+=0x1;_0xbe9b09[_0x7e6d('0xcd')](createObjHistory(_0x5acdf5,_0x1f7802,'BLACKLIST',0xd,_0x7e6d('0x1fa')),_0x7e6d('0x1fb'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer['prototype'][_0x7e6d('0x15d')]=function(_0x387690){var _0xb2c2d=this;var _0x13061f=_0x387690[_0x7e6d('0x1fc')]-_0x387690[_0x7e6d('0x95')]-_0x387690[_0x7e6d('0xbf')];emitCampaignSummary(_0x387690);if(_0x13061f>0x0){if(_0x13061f>this[_0x7e6d('0x25')]){_0x13061f=this[_0x7e6d('0x25')];}_0x387690['temp']+=_0x13061f;this['getContactDialerIvr'](_0x387690['id'],_0x13061f,_0x387690[_0x7e6d('0x1fd')],_0x387690)['then'](function(_0x35beec){_0x387690[_0x7e6d('0xbf')]-=_0x13061f;_0x387690[_0x7e6d('0xbf')]=_0x387690[_0x7e6d('0xbf')]>0x0?_0x387690[_0x7e6d('0xbf')]:0x0;if(!checkContactEmpty(_0x35beec)){_0x387690[_0x7e6d('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x7e6d('0x78')]('[getContactCampaign2][Empty]'+_0x387690[_0x7e6d('0x43')]);}else{_0x387690[_0x7e6d('0x95')]+=_0x35beec[_0x7e6d('0x134')];_0x387690[_0x7e6d('0x41')]=_0x7e6d('0x1fe');for(var _0x5ed01f=0x0;_0x5ed01f<_0x35beec['length'];_0x5ed01f+=0x1){_0x387690[_0x7e6d('0x1ff')]+=0x1;if(_[_0x7e6d('0xdd')](_0x35beec[_0x5ed01f])||_[_0x7e6d('0xdd')](_0x35beec[_0x5ed01f]['Contact'])||_[_0x7e6d('0xdd')](_0x35beec[_0x5ed01f][_0x7e6d('0x16a')][_0x7e6d('0x16b')])){_0xb2c2d[_0x7e6d('0xcb')]('[actionOriginate]\x20',_0x387690,_0x35beec[_0x5ed01f]);}else{_0xb2c2d[_0x7e6d('0xb6')](_[_0x7e6d('0xce')](_0x35beec[_0x5ed01f],[_0x7e6d('0xd2'),_0x7e6d('0x200')]))['then'](_0xb2c2d[_0x7e6d('0x1ee')](_0x387690,_0x35beec[_0x5ed01f]))[_0x7e6d('0xac')](_0xb2c2d[_0x7e6d('0xca')](_0x7e6d('0x201'),_0x387690));}}}})['catch'](loggerGetContactDialer(_0x7e6d('0x202'),_0x387690,_0x13061f));}};Dialer['prototype'][_0x7e6d('0x157')]=function(_0x214c02,_0x207b92){var _0x35786d=this;var _0x246e24=[];var _0x4956b6=_0x207b92>=0x1?_0x207b92:0x1;if(_0x214c02[_0x7e6d('0x156')]===_0x7e6d('0x7')){_0x4956b6=0x1;}var _0x340c45=Math[_0x7e6d('0x1cf')](_0x214c02[_0x7e6d('0x50')]*_0x4956b6)-_0x214c02[_0x7e6d('0x95')]-_0x214c02['temp'];emitVoiceQueueSummary(_0x214c02);if(_0x214c02[_0x7e6d('0x203')]>0x0){var _0x5a6607=_0x214c02[_0x7e6d('0x203')]-_0x214c02[_0x7e6d('0x95')]-_0x214c02[_0x7e6d('0x9e')]-_0x214c02[_0x7e6d('0xbf')]-_0x214c02[_0x7e6d('0x52')];if(_0x340c45>_0x5a6607){_0x340c45=_0x5a6607;}}if(_0x340c45>0x0){if(_0x214c02[_0x7e6d('0x156')]===_0x7e6d('0x7')){_0x340c45=0x1;}if(_0x340c45>this[_0x7e6d('0x25')]){_0x340c45=this[_0x7e6d('0x25')];}_0x214c02['temp']+=_0x340c45;for(var _0x40be72 in this['agents']){if(typeof this[_0x7e6d('0x23')][_0x40be72]!==_0x7e6d('0x96')){if(this[_0x7e6d('0x23')][_0x40be72][_0x7e6d('0xa4')]==='not_inuse'&&this['agents'][_0x40be72]['status']===_0x7e6d('0xda')){_0x246e24[_0x7e6d('0x12a')](this['agents'][_0x40be72]['id']);}}}this[_0x7e6d('0xbe')](_0x214c02['id'],_0x246e24,_0x340c45,_0x214c02[_0x7e6d('0x1fd')],_0x214c02)[_0x7e6d('0xb1')](function(_0x35a7f5){_0x214c02[_0x7e6d('0xbf')]-=_0x340c45;_0x214c02['temp']=_0x214c02[_0x7e6d('0xbf')]>0x0?_0x214c02[_0x7e6d('0xbf')]:0x0;if(!checkContactEmpty(_0x35a7f5)){_0x35786d[_0x7e6d('0xb0')](_0x214c02)[_0x7e6d('0xb1')](sendMessageReschedule(_0x214c02))[_0x7e6d('0xac')](loggerCatch('[countReScheduled]\x20'));}else{_0x214c02[_0x7e6d('0x95')]+=_0x35a7f5[_0x7e6d('0x134')];_0x214c02[_0x7e6d('0x41')]=_0x214c02[_0x7e6d('0x156')]===_0x7e6d('0x7')?_0x7e6d('0x173'):'RUNNING';for(var _0xe14eed=0x0;_0xe14eed<_0x35a7f5[_0x7e6d('0x134')];_0xe14eed+=0x1){if(_[_0x7e6d('0xdd')](_0x35a7f5[_0xe14eed])||_['isNil'](_0x35a7f5[_0xe14eed]['Contact'])||_[_0x7e6d('0xdd')](_0x35a7f5[_0xe14eed][_0x7e6d('0x16a')][_0x7e6d('0x16b')])){_0x35786d[_0x7e6d('0xcb')](_0x7e6d('0x204'),_0x214c02,_0x35a7f5[_0xe14eed]);}else{_0x35786d[_0x7e6d('0xb3')](_[_0x7e6d('0xce')](_0x35a7f5[_0xe14eed],[_0x7e6d('0xd1'),'Contact.phone']))[_0x7e6d('0xb1')](_0x35786d[_0x7e6d('0x1ee')](_0x214c02,_0x35a7f5[_0xe14eed]))[_0x7e6d('0xac')](_0x35786d['loggerHandler'](_0x7e6d('0x204'),_0x214c02));}}}})[_0x7e6d('0xac')](loggerGetContactDialer(_0x7e6d('0x205'),_0x214c02,_0x340c45));}};Dialer['prototype'][_0x7e6d('0x8d')]=function(_0x4cfbb2){if(_0x4cfbb2[_0x7e6d('0x203')]>0x0){var _0x1d5f47=_0x4cfbb2['dialLimitQueue']-_0x4cfbb2[_0x7e6d('0x95')]-_0x4cfbb2[_0x7e6d('0x9e')];if(_0x1d5f47>0x0){this[_0x7e6d('0x206')](_0x4cfbb2);}else{loggerPredictiveCalls[_0x7e6d('0x78')](_0x7e6d('0x207'));}}else{this[_0x7e6d('0x206')](_0x4cfbb2);}};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x206')]=function(_0x5109e2){var _0x1f55f5=this;var _0x3346b6=[];_0x5109e2[_0x7e6d('0x95')]+=0x1;for(var _0x3cea3f in this[_0x7e6d('0x23')]){if(typeof this[_0x7e6d('0x23')][_0x3cea3f]!=='undefined'){if(this[_0x7e6d('0x23')][_0x3cea3f][_0x7e6d('0xa4')]===_0x7e6d('0x208')&&this['agents'][_0x3cea3f]['status']==='reachable'){_0x3346b6[_0x7e6d('0x12a')](this[_0x7e6d('0x23')][_0x3cea3f]['id']);}}}this[_0x7e6d('0xbe')](_0x5109e2['id'],_0x3346b6,0x1,_0x5109e2['dialOrderByScheduledAt'],_0x5109e2)['then'](function(_0x3781aa){if(!checkContactEmpty(_0x3781aa)){checkContactLowerLimitOriginate(_0x5109e2,0x1,0x0);_0x1f55f5[_0x7e6d('0xb0')](_0x5109e2)[_0x7e6d('0xb1')](sendMessageReschedule(_0x5109e2))[_0x7e6d('0xac')](loggerCatch(_0x7e6d('0xb2')));}else{_0x5109e2[_0x7e6d('0x41')]=_0x7e6d('0x1fe');if(_['isNil'](_0x3781aa[0x0])||_[_0x7e6d('0xdd')](_0x3781aa[0x0]['Contact'])||_['isNil'](_0x3781aa[0x0][_0x7e6d('0x16a')][_0x7e6d('0x16b')])){_0x1f55f5[_0x7e6d('0xcb')](_0x7e6d('0x204'),_0x5109e2,_0x3781aa[0x0]);}else{_0x1f55f5['checkIsBlackList'](_[_0x7e6d('0xce')](_0x3781aa[0x0],[_0x7e6d('0xd1'),_0x7e6d('0x200')]))[_0x7e6d('0xb1')](_0x1f55f5[_0x7e6d('0x1ee')](_0x5109e2,_0x3781aa[0x0]))[_0x7e6d('0xac')](_0x1f55f5[_0x7e6d('0xca')](_0x7e6d('0x209'),_0x5109e2));}}})[_0x7e6d('0xac')](loggerGetContactDialer(_0x7e6d('0x20a'),_0x5109e2,0x1));emitVoiceQueueSummary(_0x5109e2);};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1e1')]=function(_0x5f33b6,_0x32908a,_0x4a483e,_0x3c4a49,_0x2aca10,_0x1e06e7){loggerPredictive['info'](_0x7e6d('0x20b'));loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20c'),_0x5f33b6);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20d'),_0x32908a);loggerPredictive[_0x7e6d('0x78')]('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',_0x4a483e);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20e'),_0x3c4a49);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20f'),_0x2aca10);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x80'));return new BPromise(function(_0x39b2b6,_0x5a071d){if(_0x5f33b6<=0x0||isNaN(_0x5f33b6)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),_0x7e6d('0x198'),_0x7e6d('0x211')+_0x5f33b6));}if(_0x4a483e<=0x0||isNaN(_0x4a483e)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),'Error',_0x7e6d('0x212')+_0x4a483e));}if(_0x3c4a49<=0x0||isNaN(_0x3c4a49)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),'Error',_0x7e6d('0x213')+_0x3c4a49));}if(_0x32908a<=0x0||isNaN(_0x32908a)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),'Error',_0x7e6d('0x214')+_0x32908a));}if(_0x2aca10<=0x0||isNaN(_0x2aca10)){return _0x5a071d(msgResponse(_0x7e6d('0x210'),_0x7e6d('0x198'),'Amax\x20=\x20'+_0x2aca10));}_0x1e06e7=_0x1e06e7||0x0;var _0x3417b4=0x1/_0x4a483e;var _0xb87819=0x0;var _0x2ef1e8=0x0;var _0x199995=0x0;var _0x3e340a=0x0;for(var _0xd48a49=0x0;_0x199995<_0x2aca10;_0xd48a49+=0x1){_0x2ef1e8=_0xd48a49/_0x32908a;_0xb87819=(_0x3c4a49*_0x2ef1e8+_0x1e06e7)/_0x3417b4;_0x199995=erlangb(_0xb87819,_0x5f33b6);_0x3e340a=_0xb87819/_0x5f33b6*(0x1-erlangb(_0xb87819,_0x5f33b6));}return _0x39b2b6({'erlangCalls':_0xd48a49,'erlangCallToSecond':_0x32908a/_0xd48a49,'erlangAbandonmentRate':_0x199995,'erlangBusyFactor':_0x3e340a});});};Dialer[_0x7e6d('0x1c')][_0x7e6d('0x1e3')]=function(_0x1e2a56,_0xb72cf7,_0x26fb0d,_0x4a9fc3,_0x3adbee,_0x4fd092){loggerPredictive['info'](_0x7e6d('0x215'));loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20c'),_0x1e2a56);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20d'),_0xb72cf7);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x216'),_0x26fb0d);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x20e'),_0x4a9fc3);loggerPredictive[_0x7e6d('0x78')](_0x7e6d('0x217'),_0x3adbee);loggerPredictive[_0x7e6d('0x78')]('---------------------------');return new BPromise(function(_0x5ccb06,_0x49afce){if(_0x1e2a56<=0x0||isNaN(_0x1e2a56)){return _0x49afce(msgResponse(_0x7e6d('0x218'),_0x7e6d('0x198'),_0x7e6d('0x211')+_0x1e2a56));}if(_0x26fb0d<=0x0||isNaN(_0x26fb0d)){return _0x49afce(msgResponse(_0x7e6d('0x218'),'Error',_0x7e6d('0x212')+_0x26fb0d));}if(_0x4a9fc3<=0x0||isNaN(_0x4a9fc3)){return _0x49afce(msgResponse('[busyFactor]',_0x7e6d('0x198'),_0x7e6d('0x213')+_0x4a9fc3));}if(_0xb72cf7<=0x0||isNaN(_0xb72cf7)){return _0x49afce(msgResponse(_0x7e6d('0x218'),_0x7e6d('0x198'),_0x7e6d('0x214')+_0xb72cf7));}if(_0x3adbee<=0x0||isNaN(_0x3adbee)){return _0x49afce(msgResponse(_0x7e6d('0x218'),_0x7e6d('0x198'),'Umin\x20=\x20'+_0x3adbee));}_0x4fd092=_0x4fd092||0x0;var _0x1ccdb7=0x1/_0x26fb0d;var _0x5d284e=0x0;var _0x5620ab=0x0;var _0x1f1260=0x0;var _0x4ac37b=0x0;for(var _0x3c113c=0x0;_0x4ac37b<_0x3adbee;_0x3c113c+=0x1){_0x5620ab=_0x3c113c/_0xb72cf7;_0x5d284e=(_0x4a9fc3*_0x5620ab+_0x4fd092)/_0x1ccdb7;_0x1f1260=erlangb(_0x5d284e,_0x1e2a56);_0x4ac37b=_0x5d284e/_0x1e2a56*(0x1-erlangb(_0x5d284e,_0x1e2a56));}return _0x5ccb06({'erlangCalls':_0x3c113c,'erlangCallToSecond':_0xb72cf7/_0x3c113c,'erlangAbandonmentRate':_0x1f1260,'erlangBusyFactor':_0x4ac37b});});};module['exports']=Dialer; \ No newline at end of file +var _0x8d53=['available','loggedIn','pTalking','sumBillable','total','type','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','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','predictiveIntervalDroppedCallsTimeout','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','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','talking','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','sequence','isNil','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','isTrunkReachable','SIP/%s','status','reachable','unmonitored','variable','amdstatus','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','membername','AMD','amd','MACHINE','Machine','countglobal','custom:amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','countmachineretry','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','ListId','[rescheduleContact][Machine]','state','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','uniqueid','dialGlobalMaxRetry','createStateFinal','add','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','[syncHangupIvr]','Unknow','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','responsetime','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','queueBooked','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','Action','command','timezones','content','indexOf','true','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','Contact','phone','originate','contact\x20is\x20undefine','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueTimeout','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','maxNumberOriginate','getContactDialerIvr','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[actionOriginate]\x20','checkContactBlack','tryOriginatePredictive','[handlePredictive][limitChannel]','Contact.phone','--------\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','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./history','./final','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','agents','trunks','channels','actions','contactsId','startPredictive','startProgressive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','isEmpty','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','outbound','strategy'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x8d53,0x1c2));var _0x38d5=function(_0x10eb40,_0x3f5002){_0x10eb40=_0x10eb40-0x0;var _0x36e2d1=_0x8d53[_0x10eb40];return _0x36e2d1;};'use strict';var util=require(_0x38d5('0x0'));var _=require(_0x38d5('0x1'));var BPromise=require('bluebird');var uuid=require(_0x38d5('0x2'));var moment=require(_0x38d5('0x3'));var rr=require('rr');var md5=require(_0x38d5('0x4'));var Redis=require(_0x38d5('0x5'));var ut=require(_0x38d5('0x6'));var config=require(_0x38d5('0x7'));var logger=require(_0x38d5('0x8'))(_0x38d5('0x9'));var loggerBooked=require('../../../config/logger')(_0x38d5('0xa'));var loggerPredictive=require(_0x38d5('0x8'))(_0x38d5('0xb'));var loggerPredictiveCalls=require('../../../config/logger')(_0x38d5('0xc'));var loggerSyncQueueSummary=require(_0x38d5('0x8'))(_0x38d5('0xd'));var ami=require(_0x38d5('0xe'));config[_0x38d5('0xf')]=_['defaults'](config[_0x38d5('0xf')],{'host':_0x38d5('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x38d5('0xf')]));var cmHopper=require(_0x38d5('0x11'));var cmHopperHistory=require(_0x38d5('0x12'));var cmHopperBlack=require(_0x38d5('0x13'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x38d5('0x14'));var Final=require(_0x38d5('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x38d5('0x16'));var Hangup=require('./hangup');var ipAgi=process[_0x38d5('0x17')][_0x38d5('0x18')]||_0x38d5('0x19');var strategy={'rrmemory':_0x38d5('0x1a'),'roundrobin':_0x38d5('0x1b')};var Sequence=function(){};Sequence[_0x38d5('0x1c')]['enqueue']=function(_0x41656c){this['tail']=this[_0x38d5('0x1d')]?this['tail'][_0x38d5('0x1e')](_0x41656c):_0x41656c();};function Dialer(_0x463e2e,_0x1fa26c){this['sequence']=new Sequence();this[_0x38d5('0x1f')]=_0x1fa26c;this[_0x38d5('0x20')]=_0x463e2e[_0x38d5('0x20')];this[_0x38d5('0x21')]=_0x463e2e[_0x38d5('0x21')];this[_0x38d5('0x22')]=_0x463e2e['agents'];this[_0x38d5('0x23')]=_0x463e2e['trunks'];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0x38d5('0x24')]={};this[_0x38d5('0x25')]={};this[_0x38d5('0x26')]={};this['uniqueId']={};this['optionPredictive']={};this[_0x38d5('0x27')]={};this[_0x38d5('0x28')]={};this[_0x38d5('0x29')]={};this['queueBooked']={};this[_0x38d5('0x2a')]={};ami['on']('agentconnect',this[_0x38d5('0x2b')][_0x38d5('0x2c')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x38d5('0x2c')](this));ami['on']('originateresponse',this[_0x38d5('0x2d')]['bind'](this));ami['on'](_0x38d5('0x2e'),this[_0x38d5('0x2f')][_0x38d5('0x2c')](this));ami['on']('custom:queuesummary',this[_0x38d5('0xd')][_0x38d5('0x2c')](this));ami['on']('hangup',this[_0x38d5('0x30')][_0x38d5('0x2c')](this));ami['on'](_0x38d5('0x31'),this[_0x38d5('0x32')][_0x38d5('0x2c')](this));ami['on'](_0x38d5('0x33'),this[_0x38d5('0x34')][_0x38d5('0x2c')](this));ami['on'](_0x38d5('0x35'),this[_0x38d5('0x36')][_0x38d5('0x2c')](this));ami['on'](_0x38d5('0x37'),this[_0x38d5('0x38')]['bind'](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x44f70d){return _0x44f70d!==null&&!_[_0x38d5('0x39')](_0x44f70d);}function checkIsLoggedIn(_0x4ff0d4,_0x2f44be){return function(){if(_0x2f44be<=0x0){_0x4ff0d4[_0x38d5('0x3a')]=_0x38d5('0x3b');throw _0x4ff0d4[_0x38d5('0x3c')]+_0x38d5('0x3d');}};}function isActive(_0x594fdb){return _0x594fdb;}function checkIsActive(_0x37c886,_0xb2fd7a){return function(){if(!isActive(_0xb2fd7a)){_0x37c886[_0x38d5('0x3a')]=_0x38d5('0x3e');throw _0x37c886['name']+_0x38d5('0x3f');}};}function checkInterval(_0x56752f){return function(){if(!isNotNull(_0x56752f[_0x38d5('0x40')])){_0x56752f['message']=_0x38d5('0x41');throw _0x56752f[_0x38d5('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x56752f[_0x38d5('0x40')][_0x38d5('0x42')])){_0x56752f[_0x38d5('0x3a')]='INTERVAL_IS_NULL';throw _0x56752f[_0x38d5('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x38d5('0x43')](_0x56752f[_0x38d5('0x40')][_0x38d5('0x42')]))){_0x56752f[_0x38d5('0x3a')]='INTERVAL_IS_NULL';throw _0x56752f[_0x38d5('0x3c')]+_0x38d5('0x44');}};}function msgResponse(_0x51f439,_0x13ed34,_0x13858f){return{'action':_0x51f439,'response':_0x13ed34,'message':_0x13858f,'stack':_0x13858f};}function myreject(_0x294ff1){return function(_0x2e14c4){return _0x294ff1(msgResponse(_0x38d5('0x45'),_0x38d5('0x46'),JSON[_0x38d5('0x47')](_0x2e14c4)));};}function getSeconds(_0x2db03d,_0x50c3a4){var _0x19826f=moment(_0x2db03d)['milliseconds'](0x0);var _0x2d0a21=moment(_0x50c3a4)[_0x38d5('0x48')](0x0);return _0x19826f[_0x38d5('0x49')](_0x2d0a21,'seconds');}function emit(_0x4999a2,_0xb1db28,_0x33b8ae){io['to'](_0x4999a2)[_0x38d5('0x4a')](_0xb1db28,_0x33b8ae);}function emitVoiceQueueSummary(_0x4affd3){if(_0x4affd3['type']===_0x38d5('0x4b')){var _0x34b7ca={'id':_0x4affd3['id'],'name':_0x4affd3[_0x38d5('0x3c')],'strategy':_0x4affd3[_0x38d5('0x4c')],'answered':_0x4affd3['answered'],'available':_0x4affd3[_0x38d5('0x4d')],'loggedIn':_0x4affd3[_0x38d5('0x4e')],'pTalking':_0x4affd3[_0x38d5('0x4f')],'sumBillable':_0x4affd3[_0x38d5('0x50')],'sumDuration':_0x4affd3['sumDuration'],'sumHoldTime':_0x4affd3['sumHoldTime']||0x0,'talking':_0x4affd3['talking'],'total':_0x4affd3[_0x38d5('0x51')],'type':_0x4affd3[_0x38d5('0x52')],'unmanaged':_0x4affd3[_0x38d5('0x53')],'abandoned':_0x4affd3[_0x38d5('0x54')],'waiting':_0x4affd3[_0x38d5('0x55')],'loggedInDb':_0x4affd3[_0x38d5('0x56')],'dialActive':_0x4affd3['dialActive'],'dialMethod':_0x4affd3[_0x38d5('0x57')],'dialOriginateCallerIdName':_0x4affd3[_0x38d5('0x58')],'dialOriginateCallerIdNumber':_0x4affd3[_0x38d5('0x59')],'dialOriginateTimeout':_0x4affd3[_0x38d5('0x5a')],'dialPrefix':_0x4affd3[_0x38d5('0x5b')],'outboundAnswerAgiCallsDay':_0x4affd3[_0x38d5('0x5c')],'outboundAnswerCallsDay':_0x4affd3['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x4affd3[_0x38d5('0x5d')],'outboundBusyCallsDay':_0x4affd3[_0x38d5('0x5e')],'outboundCongestionCallsDay':_0x4affd3[_0x38d5('0x5f')],'outboundDropCallsDayACS':_0x4affd3[_0x38d5('0x60')],'outboundDropCallsDayCallersExit':_0x4affd3[_0x38d5('0x61')],'outboundDropCallsDayTimeout':_0x4affd3[_0x38d5('0x62')],'outboundNoAnswerCallsDay':_0x4affd3[_0x38d5('0x63')],'outboundNoSuchCallsDay':_0x4affd3[_0x38d5('0x64')],'outboundOriginateFailureCallsDay':_0x4affd3[_0x38d5('0x65')],'outboundReCallsDay':_0x4affd3[_0x38d5('0x66')],'outboundRejectCallsDay':_0x4affd3[_0x38d5('0x67')],'outboundUnknownCallsDay':_0x4affd3['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4affd3[_0x38d5('0x68')],'predictiveIntervalAvgHoldtime':_0x4affd3['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4affd3['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4affd3[_0x38d5('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x4affd3['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4affd3['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4affd3['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4affd3['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4affd3['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4affd3['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4affd3['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4affd3['predictiveIntervalTotalCalls'],'message':_0x4affd3[_0x38d5('0x3a')],'originated':_0x4affd3[_0x38d5('0x6a')],'erlangCalls':_0x4affd3[_0x38d5('0x6b')],'erlangCallToSecond':_0x4affd3[_0x38d5('0x6c')],'erlangAbandonmentRate':_0x4affd3[_0x38d5('0x6d')],'erlangBusyFactor':_0x4affd3[_0x38d5('0x6e')],'startPredictive':_0x4affd3[_0x38d5('0x27')],'startProgressive':_0x4affd3[_0x38d5('0x28')]};if(_0x4affd3[_0x38d5('0x6f')]){_0x34b7ca[_0x38d5('0x6f')]={'id':_0x4affd3[_0x38d5('0x6f')]['id'],'name':_0x4affd3[_0x38d5('0x6f')][_0x38d5('0x3c')],'active':_0x4affd3[_0x38d5('0x6f')][_0x38d5('0x70')],'callerid':_0x4affd3[_0x38d5('0x6f')][_0x38d5('0x71')]};}if(_0x4affd3[_0x38d5('0x40')]){_0x34b7ca[_0x38d5('0x40')]={'id':_0x4affd3['Interval']['id'],'name':_0x4affd3['Interval']['name']};}var _0x91cd1d=md5(JSON[_0x38d5('0x47')](_0x34b7ca));if(_0x4affd3[_0x38d5('0x4')]!==_0x91cd1d){_0x4affd3[_0x38d5('0x4')]=_0x91cd1d;emit(util[_0x38d5('0x72')](_0x38d5('0x73'),_0x34b7ca[_0x38d5('0x3c')]),_0x38d5('0x74'),_0x34b7ca);}}}function emitCampaignSummary(_0x25d04b){if(_0x25d04b[_0x38d5('0x52')]===_0x38d5('0x75')){emit(util[_0x38d5('0x72')](_0x38d5('0x76'),_0x25d04b[_0x38d5('0x3c')]),'campaign:save',_0x25d04b);}}function checkGetDataPredictive(_0xa2e87d){if(isNotNull(_0xa2e87d)&&!_[_0x38d5('0x43')](_0xa2e87d)){loggerPredictive[_0x38d5('0x77')](_0x38d5('0x78'));loggerPredictive['info'](_0x38d5('0x79'),_0xa2e87d['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x38d5('0x7a'),_0xa2e87d[_0x38d5('0x68')]);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x7b'),_0xa2e87d[_0x38d5('0x7c')]);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x7d'),_0xa2e87d['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x7e'),_0xa2e87d['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xa2e87d[_0x38d5('0x7f')]);loggerPredictive['info'](_0x38d5('0x80'));if(_0xa2e87d[_0x38d5('0x81')]>0x0){if(!_[_0x38d5('0x39')](_0xa2e87d[_0x38d5('0x7f')])&&_0xa2e87d[_0x38d5('0x7f')]>0x0){return!![];}loggerPredictive[_0x38d5('0x77')](_0x38d5('0x82'));if(!_[_0x38d5('0x39')](_0xa2e87d[_0x38d5('0x83')])&&_0xa2e87d['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x38d5('0x77')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x38d5('0x77')](_0x38d5('0x84'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2bd8d2){return function(_0x432003){loggerPredictive[_0x38d5('0x77')](_0x38d5('0x85'));loggerPredictive[_0x38d5('0x77')](_0x38d5('0x86'),_0x432003[_0x38d5('0x6b')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x432003[_0x38d5('0x6c')]);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x87'),_0x432003['erlangAbandonmentRate']);loggerPredictive['info'](_0x38d5('0x88'),_0x432003[_0x38d5('0x6e')]);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x87'),_0x432003[_0x38d5('0x6d')]);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x80'));_[_0x38d5('0x89')](_0x2bd8d2,_0x432003);};}function getDiff(_0x5cc4d4){var _0x1e9016=moment()[_0x38d5('0x48')](0x0);var _0x1494e1=moment(_0x5cc4d4)['milliseconds'](0x0);return _0x1e9016[_0x38d5('0x49')](_0x1494e1,_0x38d5('0x8a'));}function ifInterval(_0x14b2d3,_0x5c3526){if(_[_0x38d5('0x39')](_0x5c3526)){return![];}return getDiff(_0x5c3526)<_0x14b2d3*0x3c;}function freeVariablesPredictive(_0x475cd3){if(isNotNull(_0x475cd3)){if(!_[_0x38d5('0x39')](_0x475cd3[_0x38d5('0x28')])){_0x475cd3[_0x38d5('0x28')]=undefined;loggerPredictive[_0x38d5('0x77')](_0x475cd3[_0x38d5('0x3c')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x38d5('0x39')](_0x475cd3[_0x38d5('0x27')])){_0x475cd3['startPredictive']=undefined;loggerPredictive['info'](_0x475cd3[_0x38d5('0x3c')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x38d5('0x39')](_0x475cd3['handlePredictive'])){clearInterval(_0x475cd3[_0x38d5('0x8b')]);_0x475cd3[_0x38d5('0x8b')]=undefined;loggerPredictive[_0x38d5('0x77')](_0x475cd3[_0x38d5('0x3c')],_0x38d5('0x8c'));}}}function erlangb(_0x591190,_0x675eb5){if(_0x675eb5===0x0){return 0x0;}var _0x2cce1b=0x1;for(var _0x320e07=0x1;_0x320e07<=_0x675eb5;_0x320e07+=0x1){_0x2cce1b=0x1+_0x2cce1b*_0x320e07/_0x591190;}return 0x1/_0x2cce1b;}function isVoiceQueueOutbound(_0x41385c){return _0x41385c==='outbound';}function isNotPreview(_0x539f2f){return _0x539f2f!==_0x38d5('0x1f');}function isCampaignIvr(_0x3dc796){return _0x3dc796===_0x38d5('0x75');}function getCallerId(_0x19ebea,_0x114484,_0x31de09){if(!_['isUndefined'](_0x31de09)&&typeof _0x31de09===_0x38d5('0x8d')&&!_[_0x38d5('0x43')](_0x31de09)){if(!_['isUndefined'](_0x114484)&&typeof _0x114484==='string'&&!_[_0x38d5('0x43')](_0x114484)){return util['format'](_0x38d5('0x8e'),_0x114484,_0x31de09);}return util['format']('\x22%s\x22\x20<%s>',_0x31de09,_0x31de09);}if(!_['isUndefined'](_0x19ebea)&&typeof _0x19ebea===_0x38d5('0x8d')&&!_[_0x38d5('0x43')](_0x19ebea)){return _0x19ebea;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2ac0e4,_0x442093){return function(_0x2aa615){freeVariablesPredictive(_0x442093);emitVoiceQueueSummary(_0x442093);emitCampaignSummary(_0x442093);loggerSyncQueueSummary[_0x38d5('0x8f')](_0x2ac0e4,util[_0x38d5('0x90')](_0x2aa615,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4fbf6f,_0x395764){return function(_0x43a4c8){loggerPredictive['error'](_0x395764[_0x38d5('0x3c')],_0x4fbf6f);loggerPredictive[_0x38d5('0x8f')](_0x43a4c8[_0x38d5('0x91')]);freeVariablesPredictive(_0x395764);};}function loggerCatch(_0x21c1c6){return function(_0x325000){logger[_0x38d5('0x8f')](_0x21c1c6,util[_0x38d5('0x90')](_0x325000,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x9e82c1){return _0x9e82c1&&!_['isUndefined'](_0x9e82c1)&&_0x9e82c1[_0x38d5('0x92')]>0x0;}function decremetOriginate(_0x4499ff){if(!_[_0x38d5('0x39')](_0x4499ff)&&_0x4499ff!==null){if(typeof _0x4499ff[_0x38d5('0x6a')]!==_0x38d5('0x93')){if(_0x4499ff[_0x38d5('0x6a')]>0x0){_0x4499ff[_0x38d5('0x6a')]-=0x1;}else{logger[_0x38d5('0x8f')](_0x38d5('0x94'));}}}else{logger[_0x38d5('0x8f')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x4b81af,_0x206bd7,_0x235528){if(_0x206bd7>_0x235528){for(var _0xa8b363=0x0;_0xa8b363<_0x206bd7-_0x235528;_0xa8b363+=0x1){decremetOriginate(_0x4b81af);}}}function loggerGetContactDialer(_0x164c91,_0x553652,_0x355ecc){return function(_0x49c70f){checkContactLowerLimitOriginate(_0x553652,_0x355ecc,0x0);logger[_0x38d5('0x8f')](_0x164c91,util[_0x38d5('0x90')](_0x49c70f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4f3f17){return function(_0x3ac90e){if(isNotNull(_0x3ac90e)&&isNotNull(_0x3ac90e[0x0])){if(_0x3ac90e[0x0][_0x38d5('0x95')]>0x0){_0x4f3f17[_0x38d5('0x3a')]=_0x38d5('0x96');logger[_0x38d5('0x77')]('[getContactDialer2][ReScheduled]'+_0x4f3f17['name'],_0x3ac90e[0x0][_0x38d5('0x95')],_0x38d5('0x97'));}else{_0x4f3f17[_0x38d5('0x3a')]=_0x38d5('0x98');logger[_0x38d5('0x77')](_0x38d5('0x99')+_0x4f3f17['name']);}}};}function notSendMessagesQueue(_0x261de2){if(_0x261de2['sendMessageOneNotActive']){freeVariablesPredictive(_0x261de2);if(_0x261de2[_0x38d5('0x6a')]===0x0&&_0x261de2[_0x38d5('0x9a')]===0x0&&_0x261de2[_0x38d5('0x55')]===0x0&&(_0x261de2[_0x38d5('0x4f')]||0x0)===0x0){_0x261de2[_0x38d5('0x9b')]=![];_0x261de2[_0x38d5('0x4d')]=0x0;_0x261de2['message']=_0x38d5('0x3e');loggerSyncQueueSummary[_0x38d5('0x8f')](_0x38d5('0x9c'),_0x261de2['name'],'is\x20not\x20active');}else{_0x261de2['message']=_0x38d5('0x9d');loggerSyncQueueSummary[_0x38d5('0x8f')](_0x38d5('0x9c'),_0x261de2[_0x38d5('0x3c')],_0x38d5('0x9e'));}emitVoiceQueueSummary(_0x261de2);}}function notSendMessagesCampaign(_0x3f6463){if(_0x3f6463[_0x38d5('0x9b')]){if(_0x3f6463[_0x38d5('0x6a')]===0x0){_0x3f6463[_0x38d5('0x9b')]=![];_0x3f6463['message']=_0x38d5('0x3e');loggerSyncQueueSummary[_0x38d5('0x8f')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3f6463[_0x38d5('0x3c')],'is\x20not\x20active');}else{_0x3f6463['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x38d5('0x8f')](_0x38d5('0x9f'),_0x3f6463[_0x38d5('0x3c')],'is\x20disactive');}emitCampaignSummary(_0x3f6463);}}function createObjHistory(_0x449682,_0x3c6095,_0xe41908,_0x41401d,_0x5a2a20){_0x449682['message']=_0xe41908;var _0x2c7443=new Action(_0x449682,_0x3c6095);var _0x20a4b0=new History(_0x2c7443);_0x20a4b0['state']=_0x41401d;_0x20a4b0[_0x38d5('0xa0')]=_0x5a2a20;_0x20a4b0[_0x38d5('0xa1')]=_0x2c7443[_0x38d5('0xa2')];return _0x20a4b0;}Dialer[_0x38d5('0x1c')]['loopClearZombieChannels']=function(){var _0x4d3027=this;setInterval(function(){_0x4d3027[_0x38d5('0xa3')](_0x4d3027[_0x38d5('0xa4')],_0x38d5('0xa5'));_0x4d3027[_0x38d5('0xa3')](_0x4d3027[_0x38d5('0x25')],_0x38d5('0xa6'));},0x32c8);};Dialer[_0x38d5('0x1c')][_0x38d5('0xa3')]=function(_0x214a88,_0x3575d7){var _0x1cb91e=this;for(var _0x180378 in _0x214a88){if(typeof _0x214a88[_0x180378]!==_0x38d5('0x93')){this[_0x38d5('0xa7')]['enqueue'](function(){if(!_[_0x38d5('0xa8')](_0x214a88[_0x180378])){return ami['Action']({'action':'status','channel':_0x214a88[_0x180378][_0x38d5('0xa9')]})[_0x38d5('0xaa')](function(_0x3bf43b){if(_0x3bf43b[_0x38d5('0x3a')]===_0x38d5('0xab')){setTimeout(function(){if(_0x214a88[_0x180378]&&_0x214a88[_0x180378]['type']!==_0x38d5('0x75')){_0x1cb91e[_0x38d5('0xac')](_0x1cb91e[_0x38d5('0x20')][_0x214a88[_0x180378][_0x38d5('0xad')]]);logger[_0x38d5('0x8f')](_0x38d5('0xae'),_0x3575d7,_0x180378,_0x214a88[_0x180378][_0x38d5('0xad')]);delete _0x214a88[_0x180378];}if(_0x214a88[_0x180378]&&_0x214a88[_0x180378]['type']===_0x38d5('0x75')){_0x1cb91e[_0x38d5('0xac')](_0x1cb91e[_0x38d5('0x21')][_0x214a88[_0x180378][_0x38d5('0xad')]]);logger[_0x38d5('0x8f')](_0x38d5('0xaf'),_0x3575d7,_0x180378,_0x214a88[_0x180378][_0x38d5('0xad')]);delete _0x214a88[_0x180378];}},0x2328);}});}});}}};Dialer[_0x38d5('0x1c')][_0x38d5('0xb0')]=function(_0x3930fb){return BPromise[_0x38d5('0xb1')]()['then'](cmHopper[_0x38d5('0xb0')](_0x3930fb))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xb2')));};Dialer[_0x38d5('0x1c')][_0x38d5('0xb3')]=function(_0x1ac061){return BPromise['resolve']()[_0x38d5('0xb4')](cmHopperBlack[_0x38d5('0xb3')](_0x1ac061))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xb5')));};Dialer[_0x38d5('0x1c')][_0x38d5('0xb6')]=function(_0x395c38){return BPromise[_0x38d5('0xb1')]()[_0x38d5('0xb4')](cmHopperBlack[_0x38d5('0xb6')](_0x395c38))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xb7')));};Dialer[_0x38d5('0x1c')][_0x38d5('0xb8')]=function(_0x10e030){return BPromise[_0x38d5('0xb1')]()[_0x38d5('0xb4')](cmHopperHistory['avgHandleTime'](_0x10e030))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xb9')));};Dialer[_0x38d5('0x1c')][_0x38d5('0xba')]=function(_0x32f1d4){return BPromise[_0x38d5('0xb1')]()[_0x38d5('0xb4')](cmHopper[_0x38d5('0xba')](_0x32f1d4))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xbb')));};Dialer['prototype'][_0x38d5('0xbc')]=function(_0x55c2d7,_0x4dd9cc,_0x5655f9){return BPromise['resolve']()[_0x38d5('0xb4')](cmHopper[_0x38d5('0xbc')](_0x55c2d7,_0x4dd9cc,_0x5655f9))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xbd')));};Dialer[_0x38d5('0x1c')][_0x38d5('0xbe')]=function(_0x4d14a1,_0x5d20e7,_0x3a0b39,_0x8285fb,_0x44e8e2){return BPromise[_0x38d5('0xb1')]()[_0x38d5('0xb4')](cmHopper[_0x38d5('0xbe')](_0x4d14a1,_0x5d20e7,_0x3a0b39,_0x8285fb))[_0x38d5('0xaa')](function(_0x3996ec){_0x44e8e2[_0x38d5('0xbf')]-=_0x3a0b39;_0x44e8e2[_0x38d5('0xbf')]=_0x44e8e2[_0x38d5('0xbf')]>0x0?_0x44e8e2[_0x38d5('0xbf')]:0x0;loggerCatch(_0x38d5('0xc0'))(_0x3996ec);});};Dialer[_0x38d5('0x1c')]['getContactDialerIvr']=function(_0x1d39e2,_0x485134,_0x19e8db,_0x52fdc2){return BPromise[_0x38d5('0xb1')]()['then'](cmHopper['getContactDialerIvr'](_0x1d39e2,_0x485134,_0x19e8db))['catch'](function(_0x650d44){_0x52fdc2[_0x38d5('0xbf')]-=_0x485134;_0x52fdc2[_0x38d5('0xbf')]=_0x52fdc2[_0x38d5('0xbf')]>0x0?_0x52fdc2['temp']:0x0;loggerCatch(_0x38d5('0xc1'))(_0x650d44);});};Dialer['prototype'][_0x38d5('0xc2')]=function(_0x2a015f){return BPromise[_0x38d5('0xb1')]()['then'](voiceQueueRt[_0x38d5('0xc2')](_0x2a015f))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xc3')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x2d4d97){return BPromise[_0x38d5('0xb1')]()[_0x38d5('0xb4')](cmHopper[_0x38d5('0xc4')](_0x2d4d97))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xc5')));};Dialer['prototype'][_0x38d5('0xc6')]=function(_0xdcce03){return BPromise[_0x38d5('0xb1')]()[_0x38d5('0xb4')](cmHopperHistory[_0x38d5('0xc6')](_0xdcce03))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xc7')));};Dialer[_0x38d5('0x1c')][_0x38d5('0xac')]=function(_0x24f496){if(!_[_0x38d5('0x39')](_0x24f496)&&_0x24f496!==null){if(typeof _0x24f496[_0x38d5('0x6a')]!==_0x38d5('0x93')){if(_0x24f496['originated']>0x0){_0x24f496[_0x38d5('0x6a')]-=0x1;}else{logger[_0x38d5('0x8f')](_0x38d5('0xc8'));}}}else{logger[_0x38d5('0x8f')](_0x38d5('0xc9'));}};Dialer['prototype'][_0x38d5('0xca')]=function(_0x5bc01b,_0x5b1dfa){var _0x4118ed=this;return function(_0x40d445){_0x4118ed['updateOriginated'](_0x5b1dfa);logger[_0x38d5('0x8f')](_0x5bc01b,util[_0x38d5('0x90')](_0x40d445,{'showHidden':![],'depth':null}));};};Dialer[_0x38d5('0x1c')]['emptyContact']=function(_0x1083f8,_0x466dd0,_0x20fdbf){var _0x59d0e7={'state':0x19,'statedesc':_0x38d5('0xcb')};this[_0x38d5('0xac')](_0x466dd0);this[_0x38d5('0xcc')](_[_0x38d5('0x89')](_0x59d0e7,_[_0x38d5('0xcd')](_0x20fdbf,[_0x38d5('0xce'),'ListId','UserId',_0x38d5('0xcf'),_0x38d5('0xd0')])),_0x38d5('0xd1'),'[emptyContact]');logger['error'](_0x1083f8);};Dialer['prototype']['isSuccess']=function(_0x50a7ed){return _0x50a7ed===_0x38d5('0xd2');};Dialer[_0x38d5('0x1c')][_0x38d5('0xd3')]=function(_0xe7932c){return!_[_0x38d5('0x39')](_0xe7932c)&&_0xe7932c&&!_[_0x38d5('0x39')](_0xe7932c[_0x38d5('0x3c')])&&!_[_0x38d5('0x39')](_0xe7932c['active'])&&_0xe7932c[_0x38d5('0x70')]&&(this['trunks'][util[_0x38d5('0x72')](_0x38d5('0xd4'),_0xe7932c[_0x38d5('0x3c')])][_0x38d5('0xd5')]===_0x38d5('0xd6')||this[_0x38d5('0x23')][util[_0x38d5('0x72')]('SIP/%s',_0xe7932c[_0x38d5('0x3c')])][_0x38d5('0xd5')]===_0x38d5('0xd7'));};Dialer[_0x38d5('0x1c')][_0x38d5('0xcc')]=function(_0x1432f6,_0x4eae10,_0x8a35a){this[_0x38d5('0xc6')](_0x1432f6)['catch'](loggerCatch(_0x4eae10));this['moveContactManagedDialer'](_0x1432f6)['catch'](loggerCatch(_0x8a35a));};Dialer['prototype']['syncVarSet']=function(_0x128bfa){var _0x57208b=this['uniqueId'][_0x128bfa['uniqueid']];var _0x120b3d;if(!_[_0x38d5('0xa8')](_0x128bfa)&&!_[_0x38d5('0xa8')](_0x128bfa[_0x38d5('0xd8')])&&!_[_0x38d5('0xa8')](_0x128bfa[_0x38d5('0xd8')][_0x38d5('0xd9')])&&_0x128bfa['exten']==='xcally-motion-dialer'&&_0x57208b){if(_0x57208b[_0x38d5('0x52')]!==_0x38d5('0x75')&&this[_0x38d5('0x20')][_0x57208b[_0x38d5('0xad')]][_0x38d5('0xda')]&&_0x128bfa[_0x38d5('0xdb')]===_0x38d5('0xdc')){delete this[_0x38d5('0xa4')][_0x128bfa['uniqueid']];this[_0x38d5('0xac')](this[_0x38d5('0x20')][_0x57208b[_0x38d5('0xad')]]);this['voiceQueues'][_0x57208b[_0x38d5('0xad')]][_0x38d5('0xdd')]+=0x1;this[_0x38d5('0x20')][_0x57208b[_0x38d5('0xad')]][_0x38d5('0x5c')]+=0x1;_0x120b3d=new Hangup(_0x57208b,_0x128bfa);_0x120b3d['state']=0x12;_0x120b3d['statedesc']=_0x38d5('0xde');_0x120b3d[_0x38d5('0xdf')]=_0x38d5('0xe0');ami['emit']('custom:amd',ut['buildObj'](_0x120b3d,_0x38d5('0xe1')));this[_0x38d5('0xcc')](_0x120b3d,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x57208b[_0x38d5('0x52')]!=='ivr'&&this[_0x38d5('0x20')][_0x57208b[_0x38d5('0xad')]][_0x38d5('0xda')]&&_0x128bfa[_0x38d5('0xdb')]===_0x38d5('0xe2')){var _0x200f01=this;return new BPromise(function(_0x3619ba,_0x257f41){delete _0x200f01[_0x38d5('0xa4')][_0x128bfa['uniqueid']];_0x200f01[_0x38d5('0xac')](_0x200f01['voiceQueues'][_0x57208b[_0x38d5('0xad')]]);_0x200f01[_0x38d5('0x20')][_0x57208b[_0x38d5('0xad')]]['outboundAnswerCallsDay']+=0x1;_0x200f01['voiceQueues'][_0x57208b[_0x38d5('0xad')]][_0x38d5('0x5c')]+=0x1;var _0x48afdb=_0x200f01[_0x38d5('0x20')][_0x57208b['queue']];var _0x27f8cb=new Hangup(_0x57208b,_0x128bfa);_0x27f8cb['state']=0x13;_0x27f8cb[_0x38d5('0xa0')]=_0x38d5('0xe3');_0x27f8cb[_0x38d5('0xdf')]=_0x38d5('0xe0');_0x27f8cb['countmachineretry']+=0x1;_0x27f8cb[_0x38d5('0xe4')]+=0x1;_0x27f8cb[_0x38d5('0xe1')]=!![];ami[_0x38d5('0x4a')](_0x38d5('0xe5'),ut[_0x38d5('0xe6')](_0x27f8cb,_0x38d5('0xe1')));_0x200f01[_0x38d5('0xc6')](_0x27f8cb)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xe7')));if(_0x27f8cb[_0x38d5('0xe8')]+_0x27f8cb[_0x38d5('0xe9')]+_0x27f8cb[_0x38d5('0xea')]+_0x27f8cb[_0x38d5('0xeb')]+_0x27f8cb[_0x38d5('0xec')]+_0x27f8cb[_0x38d5('0xed')]+_0x27f8cb['countmachineretry']+_0x27f8cb[_0x38d5('0xee')]>=_0x48afdb['dialGlobalMaxRetry']){_0x200f01[_0x38d5('0xef')](_0x27f8cb,_0x3619ba,_0x257f41,_0x38d5('0xf0'));}else{if(_0x27f8cb[_0x38d5('0xf1')]>=_0x48afdb[_0x38d5('0xf2')]){_0x200f01['createStateFinal'](_0x27f8cb,_0x3619ba,_0x257f41,_0x38d5('0xf3'));}else{_0x200f01[_0x38d5('0xba')]({'active':![],'countmachineretry':_0x27f8cb[_0x38d5('0xf1')],'scheduledat':moment()['add'](_0x48afdb[_0x38d5('0xf4')],_0x38d5('0xf5'))[_0x38d5('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x27f8cb[_0x38d5('0xce')],'ListId':_0x27f8cb[_0x38d5('0xf6')],'VoiceQueueId':_0x27f8cb[_0x38d5('0xcf')]||undefined,'CampaignId':_0x27f8cb[_0x38d5('0xd0')]||undefined})[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xf7')));_0x3619ba({'reschedule':0x1});}}});}if(_0x57208b[_0x38d5('0x52')]===_0x38d5('0x75')&&this[_0x38d5('0x21')][_0x57208b['queue']][_0x38d5('0xda')]&&_0x128bfa[_0x38d5('0xdb')]===_0x38d5('0xdc')){delete this[_0x38d5('0xa4')][_0x128bfa['uniqueid']];this[_0x38d5('0xac')](this[_0x38d5('0x21')][_0x57208b['queue']]);_0x120b3d=new Hangup(_0x57208b,_0x128bfa);_0x120b3d[_0x38d5('0xf8')]=0x12;_0x120b3d[_0x38d5('0xa0')]=_0x38d5('0xde');_0x120b3d[_0x38d5('0xdf')]=_0x38d5('0xe0');ami['emit'](_0x38d5('0xe5'),ut[_0x38d5('0xe6')](_0x120b3d,_0x38d5('0xe1')));this['saveInDb'](_0x120b3d,_0x38d5('0xf9'),_0x38d5('0xfa'));}if(_0x57208b['type']===_0x38d5('0x75')&&this[_0x38d5('0x21')][_0x57208b['queue']][_0x38d5('0xda')]&&_0x128bfa['value']==='MACHINE'){var _0x200f01=this;return new BPromise(function(_0x14bdae,_0x45a218){delete _0x200f01[_0x38d5('0xa4')][_0x128bfa[_0x38d5('0xfb')]];_0x200f01[_0x38d5('0xac')](_0x200f01['campaigns'][_0x57208b[_0x38d5('0xad')]]);_0x200f01[_0x38d5('0x21')][_0x57208b[_0x38d5('0xad')]][_0x38d5('0xdd')]+=0x1;_0x200f01['campaigns'][_0x57208b[_0x38d5('0xad')]][_0x38d5('0x5c')]+=0x1;var _0x222b27=_0x200f01[_0x38d5('0x21')][_0x57208b['queue']];var _0x31df61=new Hangup(_0x57208b,_0x128bfa);_0x31df61[_0x38d5('0xf8')]=0x13;_0x31df61[_0x38d5('0xa0')]=_0x38d5('0xe3');_0x31df61[_0x38d5('0xdf')]=_0x38d5('0xe0');_0x31df61[_0x38d5('0xf1')]+=0x1;_0x31df61[_0x38d5('0xe4')]+=0x1;_0x31df61['amd']=!![];ami[_0x38d5('0x4a')](_0x38d5('0xe5'),ut[_0x38d5('0xe6')](_0x31df61,_0x38d5('0xe1')));_0x200f01[_0x38d5('0xc6')](_0x31df61)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0xe7')));if(_0x31df61[_0x38d5('0xe8')]+_0x31df61[_0x38d5('0xe9')]+_0x31df61[_0x38d5('0xea')]+_0x31df61[_0x38d5('0xeb')]+_0x31df61['countdropretry']+_0x31df61[_0x38d5('0xed')]+_0x31df61['countmachineretry']+_0x31df61['countagentrejectretry']>=_0x222b27[_0x38d5('0xfc')]){_0x200f01[_0x38d5('0xef')](_0x31df61,_0x14bdae,_0x45a218,'reason19\x20machine....');}else{if(_0x31df61[_0x38d5('0xf1')]>=_0x222b27[_0x38d5('0xf2')]){_0x200f01[_0x38d5('0xfd')](_0x31df61,_0x14bdae,_0x45a218,_0x38d5('0xf3'));}else{_0x200f01[_0x38d5('0xba')]({'active':![],'countmachineretry':_0x31df61[_0x38d5('0xf1')],'scheduledat':moment()[_0x38d5('0xfe')](_0x222b27[_0x38d5('0xf4')],_0x38d5('0xf5'))[_0x38d5('0x72')](_0x38d5('0xff')),'ContactId':_0x31df61[_0x38d5('0xce')],'ListId':_0x31df61[_0x38d5('0xf6')],'VoiceQueueId':_0x31df61[_0x38d5('0xcf')]||undefined,'CampaignId':_0x31df61[_0x38d5('0xd0')]||undefined})['catch'](loggerCatch(_0x38d5('0xf7')));_0x14bdae({'reschedule':0x1});}}});}}};Dialer[_0x38d5('0x1c')]['syncHangup']=function(_0x12362c){var _0x47a278=this[_0x38d5('0xa4')][_0x12362c[_0x38d5('0xfb')]];var _0x5f37c0=this;var _0x366120;if(_0x47a278&&_0x47a278[_0x38d5('0x52')]===_0x38d5('0x75')){delete this[_0x38d5('0xa4')][_0x12362c[_0x38d5('0xfb')]];this['updateOriginated'](this[_0x38d5('0x21')][_0x47a278[_0x38d5('0xad')]]);this[_0x38d5('0x21')][_0x47a278[_0x38d5('0xad')]][_0x38d5('0x100')]+=0x1;_0x366120=new Hangup(_0x47a278,_0x12362c);this[_0x38d5('0xc6')](_0x366120)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x101')));this[_0x38d5('0xc4')](_0x366120)[_0x38d5('0xaa')](loggerCatch('[syncHangupIvr]'));}if(_0x47a278&&_0x47a278[_0x38d5('0x52')]!==_0x38d5('0x75')&&isNotNull(this['voiceQueues'][_0x47a278[_0x38d5('0xad')]]['dialQueueProject'])){delete this[_0x38d5('0xa4')][_0x12362c['uniqueid']];this[_0x38d5('0xac')](this[_0x38d5('0x20')][_0x47a278[_0x38d5('0xad')]]);this[_0x38d5('0x20')][_0x47a278[_0x38d5('0xad')]][_0x38d5('0xdd')]+=0x1;this['voiceQueues'][_0x47a278[_0x38d5('0xad')]]['outboundAnswerAgiCallsDay']+=0x1;_0x366120=new Hangup(_0x47a278,_0x12362c);_0x366120[_0x38d5('0xf8')]=0x10;_0x366120[_0x38d5('0xa0')]=_0x38d5('0x102');_0x366120['membername']='AGI';this[_0x38d5('0xc6')](_0x366120)[_0x38d5('0xaa')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x366120)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x103')));}if(_0x47a278&&_0x47a278[_0x38d5('0x52')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x47a278['queue']]['dialQueueProject'])){delete this[_0x38d5('0xa4')][_0x12362c[_0x38d5('0xfb')]];this[_0x38d5('0xac')](this[_0x38d5('0x20')][_0x47a278[_0x38d5('0xad')]]);this[_0x38d5('0x20')][_0x47a278['queue']]['outboundUnknownCallsDay']+=0x1;_0x366120=new Hangup(_0x47a278,_0x12362c);_0x366120[_0x38d5('0xf8')]=0xc;_0x366120[_0x38d5('0xa0')]=_0x12362c['cause-txt'];_0x366120[_0x38d5('0xdf')]=_0x38d5('0x104');this['createHistory'](_0x366120)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x101')));this[_0x38d5('0xc4')](_0x366120)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x103')));}};Dialer['prototype'][_0x38d5('0x2f')]=function(_0x5a8817){var _0x5dc4cf=this[_0x38d5('0xa4')][_0x5a8817[_0x38d5('0xfb')]];var _0x4ae1e1=this;if(this[_0x38d5('0x20')][_0x5a8817['queue']]){if(_0x5dc4cf&&_0x5dc4cf[_0x38d5('0x52')]!==_0x38d5('0x75')){delete this[_0x38d5('0xa4')][_0x5a8817[_0x38d5('0xfb')]];this[_0x38d5('0x20')][_0x5a8817[_0x38d5('0xad')]]['outboundAnswerCallsDay']+=0x1;var _0x173d2d=new AgentComplete(_0x5dc4cf,_0x5a8817);if(_0x5a8817['reason']==='agent'){_0x173d2d[_0x38d5('0x105')]=this[_0x38d5('0x20')][_0x5a8817[_0x38d5('0xad')]]['dialQueueProject2']&&this[_0x38d5('0x20')][_0x5a8817[_0x38d5('0xad')]][_0x38d5('0x106')]?moment()['format'](_0x38d5('0xff')):undefined;}this[_0x38d5('0xc6')](_0x173d2d)['catch'](loggerCatch(_0x38d5('0x107')));this[_0x38d5('0xc4')](_0x173d2d)[_0x38d5('0xaa')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x38d5('0x1c')][_0x38d5('0x2b')]=function(_0x3f5c5c){if(this[_0x38d5('0x20')][_0x3f5c5c[_0x38d5('0xad')]]){if(this[_0x38d5('0xa4')][_0x3f5c5c[_0x38d5('0xfb')]]&&this[_0x38d5('0xa4')][_0x3f5c5c['uniqueid']][_0x38d5('0x52')]!=='ivr'){this[_0x38d5('0xac')](this[_0x38d5('0x20')][_0x3f5c5c[_0x38d5('0xad')]]);this[_0x38d5('0xa4')][_0x3f5c5c[_0x38d5('0xfb')]][_0x38d5('0x108')]=moment()[_0x38d5('0x72')](_0x38d5('0xff'));}}};Dialer[_0x38d5('0x1c')][_0x38d5('0x109')]=function(_0x5bc758){this[_0x38d5('0xc6')](_0x5bc758)[_0x38d5('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x38d5('0xc4')](_0x5bc758)[_0x38d5('0xaa')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x38d5('0x1c')]['syncQueueCallerAbandon']=function(_0x132235){var _0x3ecf50=this[_0x38d5('0xa4')][_0x132235[_0x38d5('0xfb')]];var _0x3a2d36=this;if(this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]]){if(_0x3ecf50&&_0x3ecf50[_0x38d5('0x52')]!==_0x38d5('0x75')){delete this[_0x38d5('0xa4')][_0x132235[_0x38d5('0xfb')]];this[_0x38d5('0xac')](this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]]);_0x3ecf50[_0x38d5('0x10a')]=moment()['format'](_0x38d5('0xff'));var _0x3ab209=new QueueCallerAbandon(_0x3ecf50,_0x132235);if(getSeconds(_0x3ecf50[_0x38d5('0x10a')],_0x3ecf50[_0x38d5('0x10b')])>=_0x3ecf50['dialQueueTimeout']){this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]][_0x38d5('0x7c')]+=0x1;this['voiceQueues'][_0x132235[_0x38d5('0xad')]][_0x38d5('0x62')]+=0x1;this[_0x38d5('0x20')][_0x132235['queue']][_0x38d5('0x10c')]+=0x1;_0x3ab209['state']=0xa;_0x3ab209[_0x38d5('0xa0')]=_0x38d5('0x10d');_0x3ab209['dropreason']=_0x38d5('0x10e');_0x3ab209[_0x38d5('0x105')]=this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]][_0x38d5('0x10f')]?moment()['format'](_0x38d5('0xff')):undefined;_0x3ab209[_0x38d5('0xec')]+=0x1;_0x3ab209['countglobal']+=0x1;if(_0x3ab209[_0x38d5('0xec')]>=this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]][_0x38d5('0x110')]){this['queueCallerAbandonCreateState'](_0x3ab209);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x3ab209['countdropretry'],'scheduledat':moment()[_0x38d5('0xfe')](this['voiceQueues'][_0x132235[_0x38d5('0xad')]][_0x38d5('0x111')],'minutes')[_0x38d5('0x72')](_0x38d5('0xff')),'ContactId':_0x3ecf50[_0x38d5('0xce')],'ListId':_0x3ecf50[_0x38d5('0xf6')],'VoiceQueueId':_0x3ecf50['VoiceQueueId']||undefined,'CampaignId':_0x3ecf50[_0x38d5('0xd0')]||undefined})['catch'](loggerCatch(_0x38d5('0x112')));var _0xf81dc7=new History(_0x3ab209);_0xf81dc7[_0x38d5('0xf8')]=0xa;_0xf81dc7[_0x38d5('0xa0')]=_0x38d5('0x10d');_0xf81dc7[_0x38d5('0xa2')]=moment()[_0x38d5('0x72')](_0x38d5('0xff'));_0xf81dc7[_0x38d5('0xa1')]=_0xf81dc7[_0x38d5('0xa2')];_0xf81dc7[_0x38d5('0x113')]=_0x3ab209[_0x38d5('0x113')];_0xf81dc7['calleridnum']=_0x3ab209[_0x38d5('0x114')];this[_0x38d5('0xc6')](_0xf81dc7)[_0x38d5('0xaa')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]][_0x38d5('0x69')]+=0x1;this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]][_0x38d5('0x61')]+=0x1;_0x3ab209['state']=0xb;_0x3ab209[_0x38d5('0xa0')]='Abandoned';_0x3ab209[_0x38d5('0x115')]=_0x38d5('0x116');_0x3ab209[_0x38d5('0xed')]+=0x1;_0x3ab209['countglobal']+=0x1;if(_0x3ab209[_0x38d5('0xed')]>=this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]][_0x38d5('0x117')]){this[_0x38d5('0x109')](_0x3ab209);}else{this[_0x38d5('0xba')]({'active':![],'countabandonedretry':_0x3ab209[_0x38d5('0xed')],'scheduledat':moment()[_0x38d5('0xfe')](this[_0x38d5('0x20')][_0x132235[_0x38d5('0xad')]][_0x38d5('0x118')],_0x38d5('0xf5'))[_0x38d5('0x72')](_0x38d5('0xff')),'ContactId':_0x3ecf50['ContactId'],'ListId':_0x3ecf50[_0x38d5('0xf6')],'VoiceQueueId':_0x3ecf50[_0x38d5('0xcf')]||undefined,'CampaignId':_0x3ecf50[_0x38d5('0xd0')]||undefined})[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x119')));var _0xf81dc7=new History(_0x3ab209);_0xf81dc7[_0x38d5('0xf8')]=0xb;_0xf81dc7[_0x38d5('0xa0')]=_0x38d5('0x11a');_0xf81dc7[_0x38d5('0xa2')]=moment()['format'](_0x38d5('0xff'));_0xf81dc7['endtime']=_0xf81dc7[_0x38d5('0xa2')];_0xf81dc7[_0x38d5('0x113')]=_0x3ab209[_0x38d5('0x113')];_0xf81dc7['calleridnum']=_0x3ab209[_0x38d5('0x114')];this[_0x38d5('0xc6')](_0xf81dc7)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x11b')));}}}}};Dialer[_0x38d5('0x1c')][_0x38d5('0x32')]=function(_0x52d7cc){if(this[_0x38d5('0x25')][_0x52d7cc[_0x38d5('0xfb')]]){this['actions'][_0x52d7cc[_0x38d5('0xfb')]][_0x38d5('0xa9')]=_0x52d7cc[_0x38d5('0xa9')];}if(this[_0x38d5('0xa4')][_0x52d7cc[_0x38d5('0xfb')]]){this[_0x38d5('0xa4')][_0x52d7cc[_0x38d5('0xfb')]][_0x38d5('0xa9')]=_0x52d7cc[_0x38d5('0xa9')];}};Dialer[_0x38d5('0x1c')][_0x38d5('0x36')]=function(_0x93929b){if(strategy[this[_0x38d5('0x20')][this[_0x38d5('0x25')][_0x93929b['actionid']][_0x38d5('0xad')]][_0x38d5('0x4c')]]===_0x38d5('0x1b')){if(this[_0x38d5('0x25')][_0x93929b[_0x38d5('0x11c')]]&&_[_0x38d5('0xa8')](this[_0x38d5('0x25')][_0x93929b[_0x38d5('0x11c')]][_0x38d5('0x11d')])&&_0x93929b['status']==='1'&&_0x93929b[_0x38d5('0x11e')]==='0'){if(this[_0x38d5('0x22')][_0x93929b[_0x38d5('0x11f')]]){if(!this['agents'][_0x93929b[_0x38d5('0x11f')]][_0x38d5('0x11d')]){this['agents'][_0x93929b[_0x38d5('0x11f')]][_0x38d5('0x11d')]=!![];this['actions'][_0x93929b[_0x38d5('0x11c')]][_0x38d5('0x11d')]=!![];this[_0x38d5('0x25')][_0x93929b['actionid']][_0x38d5('0x11f')]=_0x93929b[_0x38d5('0x11f')];}}}}else if((strategy[this[_0x38d5('0x20')][this[_0x38d5('0x25')][_0x93929b[_0x38d5('0x11c')]][_0x38d5('0xad')]][_0x38d5('0x4c')]]||_0x38d5('0x1a'))===_0x38d5('0x1a')){if(this[_0x38d5('0x25')][_0x93929b[_0x38d5('0x11c')]]){if(this[_0x38d5('0x22')][_0x93929b['stateinterface']]){this['actions'][_0x93929b['actionid']][_0x38d5('0x11f')]=_0x93929b['stateinterface'];if(_[_0x38d5('0xa8')](this[_0x38d5('0x120')][this[_0x38d5('0x25')][_0x93929b['actionid']][_0x38d5('0xad')]])){this[_0x38d5('0x120')][this[_0x38d5('0x25')][_0x93929b[_0x38d5('0x11c')]][_0x38d5('0xad')]]=[];}this[_0x38d5('0x120')][this[_0x38d5('0x25')][_0x93929b['actionid']]['queue']][_0x38d5('0x121')](_[_0x38d5('0x89')](_[_0x38d5('0xcd')](this['actions'][_0x93929b[_0x38d5('0x11c')]],['idHopper',_0x38d5('0x11f')]),{'status':_0x93929b[_0x38d5('0xd5')],'paused':_0x93929b['paused']}));}}}};function unlockQueueStatus(_0x1c5ee3,_0x148d4d){setTimeout(function(){if(_[_0x38d5('0x39')](_0x1c5ee3[_0x38d5('0x122')])){loggerBooked[_0x38d5('0x8f')](_0x38d5('0x123'),_0x148d4d);}_0x1c5ee3['queueStatusComplete']=!![];loggerBooked[_0x38d5('0x77')](_0x38d5('0x124'),_0x148d4d,JSON[_0x38d5('0x47')](_[_0x38d5('0xcd')](_0x1c5ee3,[_0x38d5('0x3c'),_0x38d5('0x122')])));},0x1f3);}Dialer[_0x38d5('0x1c')]['syncQueueStatusComplete']=function(_0xe3e908){var _0x4621d6=this;var _0x5d774c=_0x4621d6[_0x38d5('0x20')][_0x4621d6[_0x38d5('0x25')][_0xe3e908['actionid']][_0x38d5('0xad')]];if(strategy[this['voiceQueues'][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]][_0x38d5('0x4c')]]==='roundrobin'){if(this['actions'][_0xe3e908[_0x38d5('0x11c')]]&&this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]]['stateinterface']){this[_0x38d5('0x1f')][_0x38d5('0x125')](this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]]['idHopper'],this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0x11f')])[_0x38d5('0xaa')](function(_0x357d3d){logger[_0x38d5('0x8f')](_0x38d5('0x126'),util[_0x38d5('0x90')](_0x357d3d,{'showHidden':![],'depth':null}));})[_0x38d5('0x1e')](function(){_0x4621d6[_0x38d5('0xac')](_0x4621d6[_0x38d5('0x20')][_0x4621d6[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]]);_0x4621d6[_0x38d5('0x22')][_0x4621d6[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0x11f')]][_0x38d5('0x11d')]=![];delete _0x4621d6['actions'][_0xe3e908['actionid']];unlockQueueStatus(_0x5d774c);});}else{this['updateOriginated'](this[_0x38d5('0x20')][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]]);this[_0x38d5('0xba')]({'active':![],'ContactId':this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xce')],'ListId':this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xf6')],'VoiceQueueId':this['actions'][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xcf')]||undefined,'CampaignId':this['actions'][_0xe3e908['actionid']]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0xe3e908[_0x38d5('0x11c')]];unlockQueueStatus(_0x5d774c);}}else if((strategy[this[_0x38d5('0x20')][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]][_0x38d5('0x4c')]]||_0x38d5('0x1a'))==='rrmemory'){var _0x5290ee;if(this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]]&&!_['isEmpty'](this['queueBooked'][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]])){if(this[_0x38d5('0x2a')][_0x4621d6[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]]){this[_0x38d5('0x2a')][_0x4621d6['actions'][_0xe3e908['actionid']][_0x38d5('0xad')]]=this[_0x38d5('0x2a')][this[_0x38d5('0x25')][_0xe3e908['actionid']]['queue']]?this[_0x38d5('0x2a')][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]]:this['queueBooked'][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]]?this[_0x38d5('0x120')][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]][_0x38d5('0x127')]||0x0:0x0;}this['queueBooked'][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]][_0x38d5('0xad')]][_0x38d5('0x127')]=this[_0x38d5('0x2a')][this[_0x38d5('0x25')][_0xe3e908[_0x38d5('0x11c')]]['queue']];for(var _0x57e313=0x0;_0x57e313=0x0;})[_0x38d5('0xaa')](myreject(_0x472134)));}}else{_0x27181f[_0x38d5('0x121')](ami[_0x38d5('0x13b')]({'action':'command','command':util[_0x38d5('0x72')]('iftime\x20%s,%s',_0x5e502f,!_[_0x38d5('0x39')](config['timezones'][_0x5a9152])?_0x5a9152:'')})[_0x38d5('0xb4')](function(_0x5d719a){return _0x5d719a[_0x38d5('0x13e')]['indexOf']('true')>=0x0;})[_0x38d5('0xaa')](myreject(_0x472134)));}BPromise['all'](_0x27181f)[_0x38d5('0xb4')](function(_0x2b82a4){var _0x309074=_['some'](_0x2b82a4);if(_0x309074){return _0x4bb51c(_0x309074);}else{_0xd570dd['message']=_0x454bde?_0x38d5('0x141'):_0x38d5('0x142');return _0x472134(msgResponse(_0x38d5('0x143'),_0x38d5('0x136'),_0x38d5('0x144')+_0x454bde+'\x20'+_0x12eeaf+_0x38d5('0x145')+util[_0x38d5('0x90')](_0x5e502f,{'showHidden':![],'depth':null})+_0x38d5('0x146')+_0x5a9152));}})['catch'](function(_0xdd845c){return _0x472134(msgResponse(_0x38d5('0x135'),_0x38d5('0x136'),JSON['stringify'](_0xdd845c)));});});};Dialer[_0x38d5('0x1c')][_0x38d5('0x147')]=function(_0x56ec41){var _0x4ef31a=this;return function(){switch(_0x56ec41[_0x38d5('0x57')]){case'progressive':freeVariablesPredictive(_0x56ec41);_0x4ef31a[_0x38d5('0x148')](_0x56ec41,0x1);break;case _0x38d5('0x149'):freeVariablesPredictive(_0x56ec41);_0x4ef31a[_0x38d5('0x148')](_0x56ec41,_0x56ec41[_0x38d5('0x14a')]);break;case _0x38d5('0xb'):_0x4ef31a[_0x38d5('0xb')](_0x56ec41);break;case'booked':freeVariablesPredictive(_0x56ec41);_0x4ef31a['handlePower'](_0x56ec41,0x1);break;default:freeVariablesPredictive(_0x56ec41);logger[_0x38d5('0x8f')]('Queue',_0x56ec41['name'],_0x38d5('0x14b'));}};};Dialer[_0x38d5('0x1c')][_0x38d5('0x14c')]=function(_0x28c263){var _0x2b2b88=this;return function(){_0x2b2b88[_0x38d5('0x14d')](_0x28c263);};};Dialer[_0x38d5('0x1c')]['syncQueueSummary']=function(_0x1e5d7e){var _0xe1983d=this;if(isNotPreview(_0x1e5d7e[_0x38d5('0x57')])){if(isVoiceQueueOutbound(_0x1e5d7e[_0x38d5('0x52')])&&isActive(_0x1e5d7e[_0x38d5('0x14e')])){_0x1e5d7e[_0x38d5('0x9b')]=!![];BPromise[_0x38d5('0xb1')]()['then'](checkIsLoggedIn(_0x1e5d7e,_0x1e5d7e[_0x38d5('0x4e')]))[_0x38d5('0xb4')](checkIsActive(_0x1e5d7e,_0x1e5d7e['dialActive']))['then'](checkInterval(_0x1e5d7e))[_0x38d5('0xb4')](_0xe1983d[_0x38d5('0x132')](_0x1e5d7e))['then'](_0xe1983d[_0x38d5('0x133')](_0x1e5d7e[_0x38d5('0x14f')],_0x1e5d7e[_0x38d5('0x150')],_0x1e5d7e[_0x38d5('0x3c')],_0x1e5d7e))[_0x38d5('0xb4')](_0xe1983d[_0x38d5('0x134')](_0x1e5d7e[_0x38d5('0x40')],_0x1e5d7e[_0x38d5('0x150')],_0x1e5d7e[_0x38d5('0x3c')],_0x1e5d7e))[_0x38d5('0xb4')](_0xe1983d['checkDialMethod'](_0x1e5d7e))[_0x38d5('0xaa')](loggerCatchQueueSummary(_0x38d5('0x151'),_0x1e5d7e));}else{notSendMessagesQueue(_0x1e5d7e);}}else{freeVariablesPredictive(_0x1e5d7e);}};Dialer[_0x38d5('0x1c')][_0x38d5('0x131')]=function(){var _0xcb4831=this;var _0x2a3410;for(var _0x7486ab in this[_0x38d5('0x21')]){if(typeof this[_0x38d5('0x21')][_0x7486ab]!==_0x38d5('0x93')){_0x2a3410=this['campaigns'][_0x7486ab];if(isCampaignIvr(_0x2a3410[_0x38d5('0x52')])&&isActive(_0x2a3410[_0x38d5('0x70')])){_0x2a3410[_0x38d5('0x9b')]=!![];BPromise['resolve']()[_0x38d5('0xb4')](checkIsActive(_0x2a3410,_0x2a3410[_0x38d5('0x70')]))['then'](checkInterval(_0x2a3410))[_0x38d5('0xb4')](_0xcb4831[_0x38d5('0x132')](_0x2a3410))[_0x38d5('0xb4')](_0xcb4831[_0x38d5('0x133')](_0x2a3410['dialGlobalInterval'],_0x2a3410[_0x38d5('0x150')],_0x2a3410['name'],_0x2a3410))[_0x38d5('0xb4')](_0xcb4831[_0x38d5('0x134')](_0x2a3410['Interval'],_0x2a3410[_0x38d5('0x150')],_0x2a3410[_0x38d5('0x3c')],_0x2a3410))['then'](_0xcb4831[_0x38d5('0x14c')](_0x2a3410))['catch'](loggerCatchQueueSummary(_0x38d5('0x152'),_0x2a3410));}else{notSendMessagesCampaign(_0x2a3410);}}}};function getCallerIdRandom(_0xa0d270,_0x582691){var _0x2886cc;var _0x3c6c35;var _0x273d8d;if(_0x582691<=0x0){_0x582691=0x1;}_0x2886cc=new RegExp(_0x38d5('0x153')+_0x582691+'}$');_0x3c6c35=Math[_0x38d5('0x154')](0xa,_0x582691-0x1);_0x273d8d=Math['pow'](0xa,_0x582691)-0x1;return util[_0x38d5('0x72')]('%s',_[_0x38d5('0x155')](_0xa0d270,_0x2886cc,_[_0x38d5('0x156')](_0x3c6c35,_0x273d8d)));}function extractCalleridName(_0x4e804f){var _0x199e3b=_0x4e804f[_0x38d5('0x157')](/"(.*?)"/);return _0x199e3b?_0x199e3b[0x1]:_0x4e804f;}function extractCalleridNumber(_0x423443){var _0x208456=_0x423443['match'](/<(.*?)>/);return _0x208456?_0x208456[0x1]:_0x423443;}Dialer[_0x38d5('0x1c')][_0x38d5('0x158')]=function(_0x4fa784,_0x2932e7){var _0x2ee9d8=this;var _0x38851a=uuid['v4']();this[_0x38d5('0x25')][_0x38851a]=new Action(_0x4fa784,_0x2932e7,_0x38851a);return new BPromise(function(_0xca613f,_0x5e8ee7){if(_[_0x38d5('0x39')](_0x4fa784)&&typeof _0x4fa784!=='object'){return _0x5e8ee7(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x38d5('0x39')](_0x2932e7[_0x38d5('0x159')][_0x38d5('0x15a')])||_0x2932e7['Contact'][_0x38d5('0x15a')]===null){return _0x5e8ee7(msgResponse(_0x38d5('0x15b'),_0x38d5('0x136'),_0x38d5('0x15c')));}var _0x1a9cc2={'XMD-CALLERID':_0x2ee9d8[_0x38d5('0x25')][_0x38851a][_0x38d5('0x15d')](),'XMD-AGI':_0x4fa784[_0x38d5('0x15e')]?util['format'](_0x38d5('0x15f'),ipAgi,_0x4fa784[_0x38d5('0x15e')]):'NONE','XMD-AGIAFTER':_0x4fa784[_0x38d5('0x10f')]?util['format'](_0x38d5('0x15f'),ipAgi,_0x4fa784[_0x38d5('0x10f')]):_0x38d5('0x160'),'XMD-QUEUE':_0x4fa784['type']===_0x38d5('0x4b')?util[_0x38d5('0x72')]('\x22%s,%s%s,,,%s\x22',_0x4fa784[_0x38d5('0x3c')],_0x4fa784['dialQueueOptions']||'',_0x4fa784[_0x38d5('0x106')]?'c':'',_0x4fa784[_0x38d5('0x161')]||0x3):_0x38d5('0x160'),'XMD-CONTACTID':_0x2932e7['ContactId'],'XMD-CDRTYPE':_0x38d5('0x9'),'CALLERID(all)':_0x2ee9d8['actions'][_0x38851a][_0x38d5('0x15d')](),'XMD-AMD':_0x4fa784[_0x38d5('0xda')]?_0x38d5('0x162'):'NONE','XMD-DESTINATION':_0x38d5('0x163')};if(_0x4fa784['dialAMDActive']){_0x1a9cc2[_0x38d5('0x164')]=_0x4fa784['dialAMDInitialSilence']||0x9c4;_0x1a9cc2['XMD-AMDGREETING']=_0x4fa784[_0x38d5('0x165')]||0x5dc;_0x1a9cc2[_0x38d5('0x166')]=_0x4fa784[_0x38d5('0x167')]||0x320;_0x1a9cc2['XMD-AMDTOTALANALYSISTIME']=_0x4fa784[_0x38d5('0x168')]||0x1388;_0x1a9cc2[_0x38d5('0x169')]=_0x4fa784[_0x38d5('0x16a')]||0x64;_0x1a9cc2['XMD-AMDBETWEENWORDSSILENCE']=_0x4fa784[_0x38d5('0x16b')]||0x32;_0x1a9cc2[_0x38d5('0x16c')]=_0x4fa784['dialAMDMaximumNumberOfWords']||0x3;_0x1a9cc2[_0x38d5('0x16d')]=_0x4fa784[_0x38d5('0x16e')]||0x100;_0x1a9cc2[_0x38d5('0x16f')]=_0x4fa784[_0x38d5('0x170')]||0x1388;}if(_0x4fa784[_0x38d5('0x52')]==='outbound'){_0x1a9cc2[_0x38d5('0x171')]=_0x2932e7[_0x38d5('0xcf')];}else{_0x1a9cc2[_0x38d5('0x172')]=_0x2932e7[_0x38d5('0xd0')];}for(var _0x5cabdc in _0x2932e7['Contact']){if(typeof _0x2932e7[_0x38d5('0x159')][_0x5cabdc]!=='undefined'){if(isNotNull(_0x2932e7['Contact'][_0x5cabdc])&&_0x5cabdc!=='id'&&_0x5cabdc!=='tags'&&_0x5cabdc!==_0x38d5('0x173')&&_0x5cabdc!=='updatedAt'){_0x1a9cc2[util[_0x38d5('0x72')](_0x38d5('0x174'),'XMD-',_[_0x38d5('0x175')](_0x5cabdc))]=_0x2932e7[_0x38d5('0x159')][_0x5cabdc];}}}var _0xffa24e=_0x2ee9d8[_0x38d5('0xd3')](_0x4fa784[_0x38d5('0x6f')])?getCallerId(_0x4fa784['Trunk'][_0x38d5('0x71')],_0x4fa784['dialOriginateCallerIdName'],_0x4fa784[_0x38d5('0x176')]>0x0?getCallerIdRandom(_0x4fa784['dialOriginateCallerIdNumber'],_0x4fa784[_0x38d5('0x176')]):_0x4fa784[_0x38d5('0x59')]):getCallerId(_[_0x38d5('0xa8')](_0x4fa784[_0x38d5('0x177')])?_0x4fa784['Trunk'][_0x38d5('0x71')]:_0x4fa784[_0x38d5('0x177')]['callerid'],_0x4fa784[_0x38d5('0x58')],_0x4fa784['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4fa784[_0x38d5('0x59')],_0x4fa784[_0x38d5('0x176')]):_0x4fa784[_0x38d5('0x59')]);if(_0xffa24e){_0x1a9cc2[_0x38d5('0x178')]=_0x2ee9d8[_0x38d5('0x25')][_0x38851a][_0x38d5('0x179')]=extractCalleridName(_0xffa24e);_0x1a9cc2[_0x38d5('0x17a')]=_0x2ee9d8[_0x38d5('0x25')][_0x38851a][_0x38d5('0x17b')]=extractCalleridNumber(_0xffa24e);}return ami[_0x38d5('0x13b')]({'actionid':_0x38851a,'action':_0x38d5('0x15b'),'channel':_0x2ee9d8['isTrunkReachable'](_0x4fa784[_0x38d5('0x6f')])?util[_0x38d5('0x72')](_0x38d5('0x17c'),_0x4fa784[_0x38d5('0x6f')]['name'],isNotNull(_0x4fa784[_0x38d5('0x5b')])?_0x4fa784['dialPrefix']['trim']()||'':'',_0x4fa784[_0x38d5('0x17d')]>0x0?_0x2932e7[_0x38d5('0x159')][_0x38d5('0x15a')][_0x38d5('0x17e')](_0x4fa784['dialCutDigit']):_0x2932e7['Contact'][_0x38d5('0x15a')]):util[_0x38d5('0x72')](_0x38d5('0x17c'),_['isNil'](_0x4fa784[_0x38d5('0x177')])?_0x4fa784[_0x38d5('0x6f')][_0x38d5('0x3c')]:_0x4fa784['TrunkBackup']['name'],isNotNull(_0x4fa784['dialPrefix'])?_0x4fa784['dialPrefix']['trim']()||'':'',_0x4fa784['dialCutDigit']>0x0?_0x2932e7[_0x38d5('0x159')]['phone'][_0x38d5('0x17e')](_0x4fa784[_0x38d5('0x17d')]):_0x2932e7['Contact'][_0x38d5('0x15a')]),'callerid':_0xffa24e,'Exten':_0x38d5('0x163'),'Context':_0x38d5('0x17f'),'Priority':'1','variable':_0x1a9cc2,'timeout':(_0x4fa784[_0x38d5('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x38851a})[_0x38d5('0xb4')](function(_0x4fa2fe){return _0xca613f(_0x4fa2fe);})['catch'](function(_0x202824){_0x4fa784[_0x38d5('0x65')]+=0x1;var _0x470a2c=new History(_0x2ee9d8['actions'][_0x38851a]);logger[_0x38d5('0x8f')](util[_0x38d5('0x72')](_0x38d5('0x180'),JSON['stringify'](_0x202824)));_0x470a2c['state']=0xe;_0x470a2c['statedesc']=_0x38d5('0x181');_0x470a2c[_0x38d5('0xa2')]=moment()[_0x38d5('0x72')](_0x38d5('0xff'));_0x470a2c['endtime']=_0x470a2c[_0x38d5('0xa2')];_0x2ee9d8[_0x38d5('0xc6')](_0x470a2c)['catch'](loggerCatch(_0x38d5('0x182')));_0x2ee9d8[_0x38d5('0xc4')](_0x470a2c)[_0x38d5('0xaa')](loggerCatch('[originate][error]'))[_0x38d5('0x1e')](function(){delete _0x2ee9d8[_0x38d5('0x25')][_0x38851a];return _0x5e8ee7(msgResponse(_0x38d5('0x15b'),_0x38d5('0x46'),_0x38d5('0x183')));});});});};Dialer[_0x38d5('0x1c')][_0x38d5('0x2d')]=function(_0xc47204){var _0x4d09b6=this['actions'][_0xc47204[_0x38d5('0x11c')]];if(_0x4d09b6){delete this[_0x38d5('0x25')][_0xc47204[_0x38d5('0x11c')]];_0x4d09b6[_0x38d5('0x10b')]=moment()[_0x38d5('0x72')](_0x38d5('0xff'));var _0xc2e3bd=_0x4d09b6[_0x38d5('0x52')]===_0x38d5('0x75')?this['campaigns'][_0x4d09b6[_0x38d5('0xad')]]:this['voiceQueues'][_0x4d09b6['getQueue']()];if(!this[_0x38d5('0x184')](_0xc47204[_0x38d5('0x185')])){this['updateOriginated'](_0xc2e3bd);return this[_0x38d5('0x186')](_0x4d09b6,_0xc2e3bd,_0xc47204)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x187')));}this[_0x38d5('0xa4')][_0xc47204['uniqueid']]=_0x4d09b6;}};Dialer['prototype'][_0x38d5('0x188')]=function(_0x40a05b,_0x24e209,_0x42e385){var _0x5231a8=new History(_0x24e209);if(_0x5231a8[_0x38d5('0xe8')]+_0x5231a8[_0x38d5('0xe9')]+_0x5231a8['countnoanswerretry']+_0x5231a8[_0x38d5('0xeb')]+_0x5231a8['countdropretry']+_0x5231a8[_0x38d5('0xed')]+_0x5231a8['countmachineretry']+_0x5231a8[_0x38d5('0xee')]>=_0x42e385['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x40a05b){case 0x3:if(_0x5231a8[_0x38d5('0xea')]>=_0x42e385[_0x38d5('0x189')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x5231a8[_0x38d5('0xea')]+=0x1,'scheduledat':moment()[_0x38d5('0xfe')](_0x42e385[_0x38d5('0x18a')],_0x38d5('0xf5'))[_0x38d5('0x72')](_0x38d5('0xff')),'ContactId':_0x5231a8[_0x38d5('0xce')],'ListId':_0x5231a8[_0x38d5('0xf6')],'VoiceQueueId':_0x5231a8[_0x38d5('0xcf')]||undefined,'CampaignId':_0x5231a8[_0x38d5('0xd0')]||undefined})[_0x38d5('0xaa')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x5231a8[_0x38d5('0xe8')]>=_0x42e385[_0x38d5('0x18b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x5231a8[_0x38d5('0xe8')]+=0x1,'scheduledat':moment()[_0x38d5('0xfe')](_0x42e385[_0x38d5('0x18c')],'minutes')['format'](_0x38d5('0xff')),'ContactId':_0x5231a8[_0x38d5('0xce')],'ListId':_0x5231a8[_0x38d5('0xf6')],'VoiceQueueId':_0x5231a8[_0x38d5('0xcf')]||undefined,'CampaignId':_0x5231a8['CampaignId']||undefined})[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x18d')));break;case 0x8:if(_0x5231a8[_0x38d5('0xe9')]>=_0x42e385[_0x38d5('0x18e')]-0x1){return!![];}this[_0x38d5('0xba')]({'active':![],'countcongestionretry':_0x5231a8[_0x38d5('0xe9')]+=0x1,'scheduledat':moment()['add'](_0x42e385[_0x38d5('0x18f')],_0x38d5('0xf5'))[_0x38d5('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5231a8[_0x38d5('0xce')],'ListId':_0x5231a8[_0x38d5('0xf6')],'VoiceQueueId':_0x5231a8['VoiceQueueId']||undefined,'CampaignId':_0x5231a8[_0x38d5('0xd0')]||undefined})[_0x38d5('0xaa')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x5231a8[_0x38d5('0xeb')]>=_0x42e385[_0x38d5('0x190')]-0x1){return!![];}else{this[_0x38d5('0xba')]({'active':![],'countnosuchnumberretry':_0x5231a8[_0x38d5('0xeb')]+=0x1,'scheduledat':moment()[_0x38d5('0xfe')](_0x42e385[_0x38d5('0x191')],_0x38d5('0xf5'))[_0x38d5('0x72')](_0x38d5('0xff')),'ContactId':_0x5231a8[_0x38d5('0xce')],'ListId':_0x5231a8['ListId'],'VoiceQueueId':_0x5231a8[_0x38d5('0xcf')]||undefined,'CampaignId':_0x5231a8[_0x38d5('0xd0')]||undefined})[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x192')));}break;case 0xa:if(_0x5231a8['countdropretry']>=_0x42e385['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x5231a8['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x42e385['dialDropRetryFrequency'],_0x38d5('0xf5'))[_0x38d5('0x72')](_0x38d5('0xff')),'ContactId':_0x5231a8[_0x38d5('0xce')],'ListId':_0x5231a8[_0x38d5('0xf6')],'VoiceQueueId':_0x5231a8['VoiceQueueId']||undefined,'CampaignId':_0x5231a8[_0x38d5('0xd0')]||undefined})[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x112')));break;case 0xb:if(_0x5231a8[_0x38d5('0xed')]>=_0x42e385[_0x38d5('0x117')]-0x1){return!![];}this[_0x38d5('0xba')]({'active':![],'countabandonedretry':_0x5231a8[_0x38d5('0xed')]+=0x1,'scheduledat':moment()[_0x38d5('0xfe')](_0x42e385[_0x38d5('0x118')],_0x38d5('0xf5'))['format'](_0x38d5('0xff')),'ContactId':_0x5231a8[_0x38d5('0xce')],'ListId':_0x5231a8[_0x38d5('0xf6')],'VoiceQueueId':_0x5231a8[_0x38d5('0xcf')]||undefined,'CampaignId':_0x5231a8['CampaignId']||undefined})[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x119')));break;case 0x13:if(_0x5231a8['countmachineretry']>=_0x42e385['dialMachineMaxRetry']-0x1){return!![];}this[_0x38d5('0xba')]({'active':![],'countmachineretry':_0x5231a8[_0x38d5('0xf1')]+=0x1,'scheduledat':moment()[_0x38d5('0xfe')](_0x42e385[_0x38d5('0xf4')],_0x38d5('0xf5'))[_0x38d5('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5231a8[_0x38d5('0xce')],'ListId':_0x5231a8['ListId'],'VoiceQueueId':_0x5231a8[_0x38d5('0xcf')]||undefined,'CampaignId':_0x5231a8[_0x38d5('0xd0')]||undefined})['catch'](loggerCatch(_0x38d5('0xf7')));break;case 0x14:if(_0x5231a8[_0x38d5('0xee')]>=_0x42e385[_0x38d5('0x193')]-0x1){return!![];}this[_0x38d5('0xba')]({'active':![],'countagentrejectretry':_0x5231a8['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x42e385[_0x38d5('0x194')],_0x38d5('0xf5'))[_0x38d5('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5231a8[_0x38d5('0xce')],'ListId':_0x5231a8[_0x38d5('0xf6')],'VoiceQueueId':_0x5231a8['VoiceQueueId']||undefined,'CampaignId':_0x5231a8[_0x38d5('0xd0')]||undefined})['catch'](loggerCatch(_0x38d5('0x195')));break;default:return!![];}};Dialer[_0x38d5('0x1c')][_0x38d5('0x186')]=function(_0x381fb5,_0x461d80,_0x19dce2){var _0x5dcde1=this;var _0x3edf3b=new History(_0x381fb5);return new BPromise(function(_0x4908c5,_0x2a28de){if(_[_0x38d5('0x39')](_0x461d80)&&typeof _0x461d80!==_0x38d5('0x196')){return _0x2a28de(msgResponse(_0x38d5('0x197'),_0x38d5('0x136'),'entity\x20is\x20undefine'));}if(_[_0x38d5('0x39')](_0x19dce2)&&typeof _0x19dce2!=='object'){return _0x2a28de(msgResponse('[callProgressDetecting]',_0x38d5('0x136'),_0x38d5('0x198')));}switch(_0x19dce2[_0x38d5('0x199')]){case'0':_0x461d80[_0x38d5('0x64')]+=0x1;_0x3edf3b[_0x38d5('0xf8')]=0x0;_0x3edf3b[_0x38d5('0xa0')]=_0x38d5('0x19a');_0x3edf3b[_0x38d5('0xeb')]+=0x1;_0x3edf3b[_0x38d5('0xe4')]+=0x1;ami[_0x38d5('0x4a')]('custom:agentnosuchnumber',ut[_0x38d5('0xe6')](_0x381fb5,'nosuchnumber'));_0x5dcde1[_0x38d5('0xc6')](_0x3edf3b)[_0x38d5('0xaa')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5dcde1['checkRetriveMax'](0x0,_0x381fb5,_0x461d80)){if(_0x3edf3b[_0x38d5('0xeb')]>=_0x461d80[_0x38d5('0x190')]){_0x5dcde1[_0x38d5('0xfd')](_0x3edf3b,_0x4908c5,_0x2a28de,_0x38d5('0x19b'));}else{_0x5dcde1[_0x38d5('0xef')](_0x3edf3b,_0x4908c5,_0x2a28de,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x461d80[_0x38d5('0x63')]+=0x1;_0x3edf3b[_0x38d5('0xf8')]=0x3;_0x3edf3b[_0x38d5('0xa0')]=_0x38d5('0x19c');_0x3edf3b[_0x38d5('0xea')]+=0x1;_0x3edf3b['countglobal']+=0x1;ami['emit']('custom:agentnoanswer',ut[_0x38d5('0xe6')](_0x381fb5,_0x38d5('0x19d')));_0x5dcde1[_0x38d5('0xc6')](_0x3edf3b)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x19e')));if(_0x5dcde1['checkRetriveMax'](0x3,_0x381fb5,_0x461d80)){if(_0x3edf3b[_0x38d5('0xea')]>=_0x461d80['dialNoAnswerMaxRetry']){_0x5dcde1[_0x38d5('0xfd')](_0x3edf3b,_0x4908c5,_0x2a28de,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5dcde1[_0x38d5('0xef')](_0x3edf3b,_0x4908c5,_0x2a28de,_0x38d5('0x19f'));}}break;case'5':_0x461d80['outboundBusyCallsDay']+=0x1;_0x3edf3b['state']=0x5;_0x3edf3b[_0x38d5('0xa0')]=_0x38d5('0x1a0');_0x3edf3b[_0x38d5('0xe8')]+=0x1;_0x3edf3b[_0x38d5('0xe4')]+=0x1;ami['emit'](_0x38d5('0x1a1'),ut[_0x38d5('0xe6')](_0x381fb5,'busy'));_0x5dcde1['createHistory'](_0x3edf3b)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x1a2')));if(_0x5dcde1[_0x38d5('0x188')](0x5,_0x381fb5,_0x461d80)){if(_0x3edf3b['countbusyretry']>=_0x461d80['dialBusyMaxRetry']){_0x5dcde1['createStateFinal'](_0x3edf3b,_0x4908c5,_0x2a28de,'reason\x205\x20busy');}else{_0x5dcde1[_0x38d5('0xef')](_0x3edf3b,_0x4908c5,_0x2a28de,_0x38d5('0x1a3'));}}break;case'8':_0x461d80[_0x38d5('0x5f')]+=0x1;_0x3edf3b[_0x38d5('0xf8')]=0x8;_0x3edf3b[_0x38d5('0xa0')]=_0x38d5('0x1a4');_0x3edf3b[_0x38d5('0xe9')]+=0x1;_0x3edf3b['countglobal']+=0x1;ami[_0x38d5('0x4a')](_0x38d5('0x1a5'),ut[_0x38d5('0xe6')](_0x381fb5,_0x38d5('0x1a6')));_0x5dcde1[_0x38d5('0xc6')](_0x3edf3b)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x1a7')));if(_0x5dcde1[_0x38d5('0x188')](0x8,_0x381fb5,_0x461d80)){if(_0x3edf3b['countcongestionretry']>=_0x461d80[_0x38d5('0x18e')]){_0x5dcde1['createStateFinal'](_0x3edf3b,_0x4908c5,_0x2a28de,_0x38d5('0x1a8'));}else{_0x5dcde1[_0x38d5('0xef')](_0x3edf3b,_0x4908c5,_0x2a28de,'reason\x208\x20congestion');}}break;case'11':_0x461d80[_0x38d5('0x1a9')]+=0x1;_0x3edf3b['state']=0xb;_0x3edf3b[_0x38d5('0xa0')]='Abandoned';_0x3edf3b[_0x38d5('0xed')]+=0x1;_0x3edf3b[_0x38d5('0xe4')]+=0x1;_0x5dcde1[_0x38d5('0xc6')](_0x3edf3b)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x11b')));if(_0x5dcde1[_0x38d5('0x188')](0xb,_0x381fb5,_0x461d80)){if(_0x3edf3b[_0x38d5('0xed')]>=_0x461d80['dialAbandonedMaxRetry']){_0x5dcde1[_0x38d5('0xfd')](_0x3edf3b,_0x4908c5,_0x2a28de,_0x38d5('0x1aa'));}else{_0x5dcde1[_0x38d5('0xef')](_0x3edf3b,_0x4908c5,_0x2a28de,_0x38d5('0x1aa'));}}break;case'20':_0x461d80[_0x38d5('0x67')]+=0x1;_0x3edf3b[_0x38d5('0xf8')]=0x14;_0x3edf3b[_0x38d5('0xa0')]=_0x38d5('0x1ab');_0x3edf3b[_0x38d5('0xee')]+=0x1;_0x3edf3b[_0x38d5('0xe4')]+=0x1;ami[_0x38d5('0x4a')](_0x38d5('0x1ac'),ut[_0x38d5('0xe6')](_0x381fb5,_0x38d5('0x1ad')));_0x5dcde1[_0x38d5('0xc6')](_0x3edf3b)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x1ae')));if(_0x5dcde1[_0x38d5('0x188')](0x14,_0x381fb5,_0x461d80)){if(_0x3edf3b[_0x38d5('0xee')]>=_0x461d80[_0x38d5('0x193')]){_0x5dcde1[_0x38d5('0xfd')](_0x3edf3b,_0x4908c5,_0x2a28de,_0x38d5('0x1af'));}else{_0x5dcde1['stateGlobal'](_0x3edf3b,_0x4908c5,_0x2a28de,'reason\x2020\x20agentreject');}}break;default:_0x461d80[_0x38d5('0x1b0')]+=0x1;_0x3edf3b['state']=0xc;_0x3edf3b[_0x38d5('0xa0')]=_0x19dce2[_0x38d5('0x199')];_0x5dcde1[_0x38d5('0xc6')](_0x3edf3b)[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x1b1')));if(_0x5dcde1[_0x38d5('0x188')](_0x19dce2['reason'],_0x381fb5,_0x461d80)){if(_0x3edf3b[_0x38d5('0xe8')]+_0x3edf3b[_0x38d5('0xe9')]+_0x3edf3b[_0x38d5('0xea')]+_0x3edf3b[_0x38d5('0xeb')]+_0x3edf3b[_0x38d5('0xec')]+_0x3edf3b[_0x38d5('0xed')]+_0x3edf3b[_0x38d5('0xf1')]+_0x3edf3b[_0x38d5('0xee')]>=_0x461d80[_0x38d5('0xfc')]){_0x5dcde1[_0x38d5('0xef')](_0x3edf3b,_0x4908c5,_0x2a28de,_0x19dce2[_0x38d5('0x199')]);}else{_0x5dcde1['createStateFinal'](_0x3edf3b,_0x4908c5,_0x2a28de,_0x19dce2[_0x38d5('0x199')]);}}}});};Dialer[_0x38d5('0x1c')][_0x38d5('0xef')]=function(_0x1f44a8,_0x3cda99,_0x2706c7,_0x2cf95c){var _0x390213=new Final(_0x1f44a8);_0x390213[_0x38d5('0xf8')]=0xf;_0x390213[_0x38d5('0xa0')]=_0x38d5('0x1b2');this['createStateFinal'](_0x390213,_0x3cda99,_0x2706c7,_0x2cf95c);};Dialer[_0x38d5('0x1c')][_0x38d5('0xfd')]=function(_0x18ff8f,_0x1fcff6,_0x4e7e11,_0x5705e5){this[_0x38d5('0xc4')](_0x18ff8f)[_0x38d5('0xb4')](function(){return _0x1fcff6(msgResponse(_0x38d5('0x197'),_0x38d5('0xd2'),_0x5705e5));})[_0x38d5('0xaa')](function(){return _0x4e7e11(msgResponse(_0x38d5('0x1b3'),_0x38d5('0x136'),_0x38d5('0x1b4')));});};Dialer['prototype'][_0x38d5('0xb')]=function(_0x19d467){var _0x472976=_0x19d467['dialPredictiveOptimizationPercentage']/0x64;var _0x375203=_0x19d467[_0x38d5('0x62')]/(_0x19d467[_0x38d5('0x62')]+_0x19d467[_0x38d5('0xdd')]);var _0x4b1ca5=Math[_0x38d5('0x1b5')](_0x19d467[_0x38d5('0x1b6')]*(_0x19d467['predictiveIntervalMaxThreshold']/0x64));var _0x26fde2=Math[_0x38d5('0x1b5')](_0x19d467[_0x38d5('0x1b6')]*(_0x19d467[_0x38d5('0x1b7')]/0x64));var _0x1df140=_0x19d467[_0x38d5('0x4d')]+_0x19d467[_0x38d5('0x9a')];var _0x189fcd=Math[_0x38d5('0x1b8')](_0x19d467['erlangCalls']*_0x19d467[_0x38d5('0x6d')]*_0x19d467[_0x38d5('0x1b9')]*_0x19d467[_0x38d5('0x1ba')]);if(_[_0x38d5('0x39')](_0x19d467[_0x38d5('0x28')])){if(!_[_0x38d5('0x39')](_0x19d467[_0x38d5('0x27')])){_0x19d467[_0x38d5('0x27')]=undefined;loggerPredictive[_0x38d5('0x8f')](_0x38d5('0x1bb'),_0x38d5('0x1bc'));}if(!_['isUndefined'](_0x19d467[_0x38d5('0x8b')])){loggerPredictive[_0x38d5('0x8f')](_0x38d5('0x1bb'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x19d467[_0x38d5('0x8b')]);_0x19d467[_0x38d5('0x8b')]=undefined;}_0x19d467[_0x38d5('0x28')]=moment()[_0x38d5('0x72')](_0x38d5('0xff'));loggerPredictive[_0x38d5('0x77')](_0x19d467[_0x38d5('0x3c')],_0x38d5('0x1bd'),_0x19d467[_0x38d5('0x28')]);this[_0x38d5('0x148')](_0x19d467,0x1);}else if(ifInterval(_0x19d467['dialPredictiveInterval'],_0x19d467['startProgressive'])){this[_0x38d5('0x148')](_0x19d467,0x1);loggerPredictiveCalls['info'](_0x38d5('0x1be'),_0x19d467['startProgressive'],_0x19d467['name']);_0x19d467[_0x38d5('0x6b')]=0x0;_0x19d467[_0x38d5('0x10c')]=0x0;}else if(_0x472976<_0x375203&&_0x19d467[_0x38d5('0x1bf')]==='dropRate'){freeVariablesPredictive(_0x19d467);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x1c0'),_0x38d5('0x1c1'),_0x375203,_0x38d5('0x28'),_0x19d467[_0x38d5('0x3c')]);}else if(_0x189fcd<_0x19d467['predictiveIntervalErlangCallsDroppedCalls']&&_0x19d467[_0x38d5('0x1bf')]===_0x38d5('0x1c2')){freeVariablesPredictive(_0x19d467);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x1c3'),_0x38d5('0x1c4'),_0x189fcd,'Drop\x20in\x20this\x20interval',_0x19d467['predictiveIntervalErlangCallsDroppedCalls'],_0x38d5('0x28'),_0x19d467[_0x38d5('0x3c')]);}else if(!ifInterval(_0x19d467[_0x38d5('0x1c5')],_0x19d467[_0x38d5('0x28')])&&_[_0x38d5('0x39')](_0x19d467[_0x38d5('0x27')])&&!_[_0x38d5('0x39')](_0x19d467[_0x38d5('0x28')])){_0x19d467[_0x38d5('0x27')]=moment()[_0x38d5('0x72')](_0x38d5('0xff'));loggerPredictive['info'](_0x19d467[_0x38d5('0x3c')],_0x38d5('0x1c6'),_0x19d467[_0x38d5('0x27')]);this['averageHandleTime'](_0x19d467[_0x38d5('0x1c5')])[_0x38d5('0xb4')](this[_0x38d5('0x1c7')](_0x19d467))[_0x38d5('0xb4')](mergeDataErlangB(_0x19d467))[_0x38d5('0xb4')](this[_0x38d5('0x1c8')](_0x19d467))[_0x38d5('0xaa')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x19d467));}else if(!ifInterval(_0x19d467[_0x38d5('0x1c5')],_0x19d467[_0x38d5('0x27')])){_0x19d467[_0x38d5('0x10c')]=0x0;_0x19d467['startPredictive']=moment()[_0x38d5('0x72')](_0x38d5('0xff'));loggerPredictive[_0x38d5('0x77')](_0x19d467[_0x38d5('0x3c')],_0x38d5('0x1c9'),_0x19d467[_0x38d5('0x27')]);clearInterval(_0x19d467[_0x38d5('0x8b')]);_0x19d467[_0x38d5('0x8b')]=undefined;this[_0x38d5('0xb8')](_0x19d467[_0x38d5('0x1c5')])[_0x38d5('0xb4')](this['getDataPredictive'](_0x19d467))[_0x38d5('0xb4')](mergeDataErlangB(_0x19d467))['then'](this[_0x38d5('0x1c8')](_0x19d467))[_0x38d5('0xaa')](loggerCatchPredictive(_0x38d5('0x1ca'),_0x19d467));}else if(_0x19d467[_0x38d5('0x1b6')]&&_0x1df140<_0x19d467[_0x38d5('0x1b6')]-_0x26fde2){freeVariablesPredictive(_0x19d467);loggerPredictive[_0x38d5('0x77')](_0x19d467[_0x38d5('0x3c')],_0x38d5('0x1cb'),_0x1df140,_0x38d5('0x1cc'),_0x19d467[_0x38d5('0x1b6')],'-',_0x26fde2,'=',_0x19d467['predictiveIntervalAvailable']-_0x26fde2,')');}else if(_0x19d467[_0x38d5('0x1b6')]&&_0x1df140>_0x19d467['predictiveIntervalAvailable']+_0x4b1ca5){freeVariablesPredictive(_0x19d467);loggerPredictive[_0x38d5('0x77')](_0x19d467[_0x38d5('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1df140,_0x38d5('0x1cd'),_0x19d467[_0x38d5('0x1b6')],'+',_0x4b1ca5,'=',_0x19d467['predictiveIntervalAvailable']+_0x4b1ca5,')');}};Dialer[_0x38d5('0x1c')]['getDataPredictive']=function(_0x17abb8){var _0x4bbf0d=this;return function(_0x4cb683){return new BPromise(function(_0x12c43d,_0x391e5a){_[_0x38d5('0x89')](_0x17abb8,_0x4cb683[0x0]);if(checkGetDataPredictive(_0x4cb683[0x0])){var _0x16251b=_0x17abb8[_0x38d5('0x1b6')]=_0x17abb8[_0x38d5('0x9a')]+_0x17abb8[_0x38d5('0x4d')];var _0x49a033=_0x17abb8[_0x38d5('0x1c5')]*0x3c;var _0x396797=_0x4cb683[0x0][_0x38d5('0x7f')]+_0x4cb683[0x0][_0x38d5('0x83')];var _0x482b85=(_0x4cb683[0x0][_0x38d5('0x68')]+_0x4cb683[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4cb683[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4cb683[0x0]['predictiveIntervalTotalCalls'];_0x17abb8[_0x38d5('0x1b9')]=_0x482b85>0x0?_0x482b85:0x1;switch(_0x17abb8[_0x38d5('0x1bf')]){case _0x38d5('0x1c2'):var _0x33517c=_0x17abb8['dialPredictiveOptimizationPercentage']/0x64;return _0x4bbf0d[_0x38d5('0x1ce')](_0x16251b,_0x49a033,_0x396797,_0x482b85,_0x33517c)[_0x38d5('0xb4')](function(_0x5bf5ee){return _0x12c43d(_0x5bf5ee);});case _0x38d5('0x1cf'):var _0x3f6956=_0x17abb8[_0x38d5('0x1d0')]/0x64;return _0x4bbf0d[_0x38d5('0x1d1')](_0x16251b,_0x49a033,_0x396797,_0x482b85,_0x3f6956)[_0x38d5('0xb4')](function(_0x1b8037){return _0x12c43d(_0x1b8037);});default:return _0x391e5a(msgResponse('[getDataPredictive]','Failure',_0x38d5('0x1d2')));}}else{return _0x391e5a(msgResponse(_0x38d5('0x1d3'),_0x38d5('0x136'),_0x38d5('0x1d4')));}});};};Dialer[_0x38d5('0x1c')]['getDataPredictiveOld']=function(_0x37f3e5){var _0x3e8ade=this;return function(_0x5c4de1){return new BPromise(function(_0x291df1,_0x2e7ab2){_[_0x38d5('0x89')](_0x37f3e5,_0x5c4de1[0x0]);if(checkGetDataPredictive(_0x5c4de1[0x0])){loggerPredictive[_0x38d5('0x77')](JSON['stringify'](_0x5c4de1[0x0]));if(_0x37f3e5[_0x38d5('0x1bf')]===_0x38d5('0x1c2')){return _0x3e8ade[_0x38d5('0xc2')](_0x37f3e5['id'])[_0x38d5('0xb4')](function(_0x3e1c3c){var _0x513406=_0x37f3e5['loggedIn']-_0x3e1c3c[0x0][_0x38d5('0x1d5')];var _0x25aac6=_0x37f3e5[_0x38d5('0x1c5')]*0x3c;var _0x15fb7d=_0x5c4de1[0x0][_0x38d5('0x7f')]+_0x5c4de1[0x0][_0x38d5('0x83')];var _0x116d2a=(_0x5c4de1[0x0][_0x38d5('0x68')]+_0x5c4de1[0x0][_0x38d5('0x7c')]+_0x5c4de1[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5c4de1[0x0][_0x38d5('0x81')];var _0x339868=_0x37f3e5[_0x38d5('0x1d0')]/0x64;_0x37f3e5[_0x38d5('0x1d6')]=_0x3e1c3c[0x0][_0x38d5('0x1d5')]||0x0;_0x37f3e5[_0x38d5('0x1b9')]=_0x116d2a>0x0?_0x116d2a:0x1;return _0x3e8ade['abandonmentRate'](_0x513406,_0x25aac6,_0x15fb7d,_0x116d2a,_0x339868);})[_0x38d5('0xb4')](function(_0x439794){return _0x291df1(_0x439794);})['catch'](function(_0x183df2){return _0x2e7ab2(msgResponse(_0x38d5('0x1d7'),_0x38d5('0x136'),JSON[_0x38d5('0x47')](_0x183df2)));});}if(_0x37f3e5[_0x38d5('0x1bf')]===_0x38d5('0x1cf')){return _0x3e8ade[_0x38d5('0xc2')](_0x37f3e5['id'])[_0x38d5('0xb4')](function(_0x1a1524){var _0x38860c=_0x37f3e5[_0x38d5('0x4e')]-_0x1a1524[0x0][_0x38d5('0x1d5')];var _0x56d09f=_0x37f3e5['dialPredictiveInterval']*0x3c;var _0xc83652=_0x5c4de1[0x0][_0x38d5('0x7f')]+_0x5c4de1[0x0][_0x38d5('0x83')];var _0x7ccfd6=(_0x5c4de1[0x0]['predictiveIntervalAnsweredCalls']+_0x5c4de1[0x0][_0x38d5('0x7c')]+_0x5c4de1[0x0][_0x38d5('0x69')])/_0x5c4de1[0x0][_0x38d5('0x81')];var _0x9fadf9=_0x37f3e5[_0x38d5('0x1d0')]/0x64;_0x37f3e5[_0x38d5('0x1d6')]=_0x1a1524[0x0][_0x38d5('0x1d5')]||0x0;_0x37f3e5[_0x38d5('0x1b9')]=_0x7ccfd6>0x0?_0x7ccfd6:0x1;return _0x3e8ade[_0x38d5('0x1d1')](_0x38860c,_0x56d09f,_0xc83652,_0x7ccfd6,_0x9fadf9);})[_0x38d5('0xb4')](function(_0x10d580){return _0x291df1(_0x10d580);})['catch'](function(_0x19cb5f){return _0x2e7ab2(msgResponse(_0x38d5('0x1d7'),_0x38d5('0x136'),JSON[_0x38d5('0x47')](_0x19cb5f)));});}}else{return _0x2e7ab2(msgResponse('[getDataPredictive]',_0x38d5('0x136'),_0x38d5('0x1d4')));}});};};Dialer['prototype'][_0x38d5('0x1c8')]=function(_0x2c6787){var _0x482efb=this;return function(){var _0x25a141=0x0;var _0x539975=Math[_0x38d5('0x1b8')](_0x2c6787[_0x38d5('0x6c')]*0x3e8);if(_0x539975>0x0){_0x539975=_0x539975<0x64?0x64:_0x539975;loggerPredictive['info'](_0x2c6787[_0x38d5('0x3c')],'one\x20call\x20every:',_0x539975,_0x38d5('0x48'));_0x2c6787[_0x38d5('0x8b')]=setInterval(function(){_0x482efb[_0x38d5('0x8b')](_0x2c6787);loggerPredictiveCalls[_0x38d5('0x77')](_0x38d5('0x1d8'),_0x25a141+=0x1);},_0x539975);}else{loggerPredictive[_0x38d5('0x77')](_0x2c6787['name'],_0x38d5('0x1d9'));}};};Dialer[_0x38d5('0x1c')]['checkContactBlack']=function(_0x189f4e,_0x442932){var _0x4116b1=this;return function(_0xbb8956){if(_[_0x38d5('0x43')](_0xbb8956)){if(_[_0x38d5('0xa8')](_0x442932['UserId'])||!_0x442932[_0x38d5('0x1da')]){if(_0x189f4e['dialMethod']==='booked'){_0x189f4e[_0x38d5('0x122')]=_['isUndefined'](_0x189f4e[_0x38d5('0x122')])?!![]:_0x189f4e[_0x38d5('0x122')];var _0x24a90b=uuid['v4']();_0x4116b1[_0x38d5('0x25')][_0x24a90b]=new Action(_0x189f4e,_0x442932,_0x24a90b);loggerBooked[_0x38d5('0x77')](_0x38d5('0x1db'),_0x24a90b,_0x38d5('0x1dc'),JSON[_0x38d5('0x47')](_0x189f4e[_0x38d5('0x122')]),_0x38d5('0x1dd'),_0x189f4e[_0x38d5('0x3c')]);if(_0x189f4e[_0x38d5('0x122')]){_0x189f4e[_0x38d5('0x122')]=![];_0x4116b1[_0x38d5('0x120')][_0x4116b1[_0x38d5('0x25')][_0x24a90b][_0x38d5('0xad')]]=[];ami[_0x38d5('0x13b')]({'actionid':_0x24a90b,'action':_0x38d5('0x1de'),'queue':_0x189f4e['name']})[_0x38d5('0xaa')](function(){_0x4116b1[_0x38d5('0xac')](_0x189f4e);_0x4116b1[_0x38d5('0xba')]({'active':![],'ContactId':_0x4116b1[_0x38d5('0x25')][_0x24a90b][_0x38d5('0xce')],'ListId':_0x4116b1[_0x38d5('0x25')][_0x24a90b]['ListId'],'VoiceQueueId':_0x4116b1[_0x38d5('0x25')][_0x24a90b][_0x38d5('0xcf')]||undefined,'CampaignId':_0x4116b1['actions'][_0x24a90b]['CampaignId']||undefined})['catch'](loggerCatch(_0x38d5('0x1df')));delete _0x4116b1[_0x38d5('0x25')][_0x24a90b];});}else{loggerBooked[_0x38d5('0x77')](_0x38d5('0x1e0'),JSON[_0x38d5('0x47')](_0x189f4e[_0x38d5('0x122')]),_0x38d5('0x1dd'),_0x189f4e['name']);_0x4116b1[_0x38d5('0xac')](_0x189f4e);_0x4116b1[_0x38d5('0xba')]({'active':![],'ContactId':_0x4116b1[_0x38d5('0x25')][_0x24a90b][_0x38d5('0xce')],'ListId':_0x4116b1[_0x38d5('0x25')][_0x24a90b][_0x38d5('0xf6')],'VoiceQueueId':_0x4116b1['actions'][_0x24a90b][_0x38d5('0xcf')]||undefined,'CampaignId':_0x4116b1[_0x38d5('0x25')][_0x24a90b][_0x38d5('0xd0')]||undefined})[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x1df')));delete _0x4116b1[_0x38d5('0x25')][_0x24a90b];}}else{return _0x4116b1[_0x38d5('0x158')](_0x189f4e,_0x442932);}}else{if(getDiff(_0x442932[_0x38d5('0x1e1')])<_0x189f4e[_0x38d5('0x1e2')]*0x3c){if(_0x442932[_0x38d5('0x1e3')]&&!_0x442932[_0x38d5('0x1e3')][_0x38d5('0x1e4')]){_0x4116b1['preview'][_0x38d5('0x125')](_0x442932['id'])['finally'](function(){_0x4116b1['updateOriginated'](_0x189f4e);});}else{_0x4116b1[_0x38d5('0xbc')]({'active':![]},_0x442932['id'],0x1)['finally'](function(){_0x4116b1[_0x38d5('0xac')](_0x189f4e);});}}else{_0x189f4e[_0x38d5('0x66')]+=0x1;_0x4116b1[_0x38d5('0xac')](_0x189f4e);if(_0x189f4e['dialRecallInQueue']){_0x4116b1[_0x38d5('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x442932[_0x38d5('0xce')],'ListId':_0x442932['ListId'],'VoiceQueueId':_0x442932[_0x38d5('0xcf')]||undefined,'CampaignId':_0x442932[_0x38d5('0xd0')]||undefined})[_0x38d5('0xaa')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x4116b1[_0x38d5('0xc6')](createObjHistory(_0x189f4e,_0x442932,_0x38d5('0x1e5'),0x17,_0x38d5('0x1e6')))[_0x38d5('0xaa')](loggerCatch(_0x38d5('0x1e7')));}else{_0x4116b1['saveInDb'](createObjHistory(_0x189f4e,_0x442932,_0x38d5('0x1e8'),0x16,'RecallFailedTimeout'),_0x38d5('0x1e9'),_0x38d5('0x1ea'));}}}}else{_0x189f4e[_0x38d5('0x5d')]+=0x1;_0x4116b1[_0x38d5('0xcc')](createObjHistory(_0x189f4e,_0x442932,_0x38d5('0x1eb'),0xd,_0x38d5('0x1ec')),_0x38d5('0x1ed'),_0x38d5('0x1ee'));throw _0x38d5('0x1ef');}};};Dialer['prototype'][_0x38d5('0x14d')]=function(_0x1b8041){var _0x55f855=this;var _0x4ee27d=_0x1b8041[_0x38d5('0x1f0')]-_0x1b8041[_0x38d5('0x6a')]-_0x1b8041[_0x38d5('0xbf')];emitCampaignSummary(_0x1b8041);if(_0x4ee27d>0x0){if(_0x4ee27d>this[_0x38d5('0x1f1')]){_0x4ee27d=this[_0x38d5('0x1f1')];}_0x1b8041[_0x38d5('0xbf')]+=_0x4ee27d;this[_0x38d5('0x1f2')](_0x1b8041['id'],_0x4ee27d,_0x1b8041[_0x38d5('0x1f3')],_0x1b8041)[_0x38d5('0xb4')](function(_0x1f73d5){_0x1b8041[_0x38d5('0xbf')]-=_0x4ee27d;_0x1b8041['temp']=_0x1b8041[_0x38d5('0xbf')]>0x0?_0x1b8041[_0x38d5('0xbf')]:0x0;if(!checkContactEmpty(_0x1f73d5)){_0x1b8041[_0x38d5('0x3a')]=_0x38d5('0x98');logger[_0x38d5('0x77')](_0x38d5('0x1f4')+_0x1b8041[_0x38d5('0x3c')]);}else{_0x1b8041[_0x38d5('0x6a')]+=_0x1f73d5['length'];_0x1b8041['message']=_0x38d5('0x1f5');for(var _0x5f3059=0x0;_0x5f3059<_0x1f73d5['length'];_0x5f3059+=0x1){_0x1b8041[_0x38d5('0x1f6')]+=0x1;if(_[_0x38d5('0xa8')](_0x1f73d5[_0x5f3059])||_[_0x38d5('0xa8')](_0x1f73d5[_0x5f3059][_0x38d5('0x159')])||_[_0x38d5('0xa8')](_0x1f73d5[_0x5f3059]['Contact'][_0x38d5('0x15a')])){_0x55f855[_0x38d5('0x1f7')]('[actionOriginate]\x20',_0x1b8041,_0x1f73d5[_0x5f3059]);}else{_0x55f855[_0x38d5('0xb6')](_['pick'](_0x1f73d5[_0x5f3059],[_0x38d5('0xd0'),'Contact.phone']))['then'](_0x55f855['checkContactBlack'](_0x1b8041,_0x1f73d5[_0x5f3059]))[_0x38d5('0xaa')](_0x55f855['loggerHandler'](_0x38d5('0x1f8'),_0x1b8041));}}}})[_0x38d5('0xaa')](loggerGetContactDialer('[getContactCampaign2]',_0x1b8041,_0x4ee27d));}};Dialer[_0x38d5('0x1c')][_0x38d5('0x148')]=function(_0x478a12,_0x2638eb){var _0x1eae32=this;var _0x32725e=[];var _0x5c80ff=_0x2638eb>=0x1?_0x2638eb:0x1;if(_0x478a12[_0x38d5('0x57')]===_0x38d5('0xa')){_0x5c80ff=0x1;}var _0x456ded=Math['floor'](_0x478a12[_0x38d5('0x4d')]*_0x5c80ff)-_0x478a12[_0x38d5('0x6a')]-_0x478a12[_0x38d5('0xbf')];emitVoiceQueueSummary(_0x478a12);if(_0x478a12['dialLimitQueue']>0x0){var _0xd83379=_0x478a12[_0x38d5('0x1f9')]-_0x478a12[_0x38d5('0x6a')]-_0x478a12[_0x38d5('0x9a')]-_0x478a12[_0x38d5('0xbf')]-_0x478a12['pTalking'];if(_0x456ded>_0xd83379){_0x456ded=_0xd83379;}}if(_0x456ded>0x0){if(_0x478a12['dialMethod']===_0x38d5('0xa')){_0x456ded=0x1;}if(_0x456ded>this['maxNumberOriginate']){_0x456ded=this[_0x38d5('0x1f1')];}_0x478a12[_0x38d5('0xbf')]+=_0x456ded;for(var _0x2e7c96 in this[_0x38d5('0x22')]){if(typeof this[_0x38d5('0x22')][_0x2e7c96]!==_0x38d5('0x93')){if(this['agents'][_0x2e7c96]['state']===_0x38d5('0x1fa')&&this[_0x38d5('0x22')][_0x2e7c96][_0x38d5('0xd5')]===_0x38d5('0xd6')){_0x32725e[_0x38d5('0x121')](this[_0x38d5('0x22')][_0x2e7c96]['id']);}}}this[_0x38d5('0xbe')](_0x478a12['id'],_0x32725e,_0x456ded,_0x478a12[_0x38d5('0x1f3')],_0x478a12)['then'](function(_0x2bbe2f){_0x478a12[_0x38d5('0xbf')]-=_0x456ded;_0x478a12[_0x38d5('0xbf')]=_0x478a12[_0x38d5('0xbf')]>0x0?_0x478a12[_0x38d5('0xbf')]:0x0;if(!checkContactEmpty(_0x2bbe2f)){_0x1eae32[_0x38d5('0xb0')](_0x478a12)[_0x38d5('0xb4')](sendMessageReschedule(_0x478a12))[_0x38d5('0xaa')](loggerCatch('[countReScheduled]\x20'));}else{_0x478a12[_0x38d5('0x6a')]+=_0x2bbe2f['length'];_0x478a12[_0x38d5('0x3a')]=_0x478a12[_0x38d5('0x57')]===_0x38d5('0xa')?_0x38d5('0x162'):_0x38d5('0x1f5');for(var _0x43f8f1=0x0;_0x43f8f1<_0x2bbe2f[_0x38d5('0x92')];_0x43f8f1+=0x1){if(_[_0x38d5('0xa8')](_0x2bbe2f[_0x43f8f1])||_[_0x38d5('0xa8')](_0x2bbe2f[_0x43f8f1]['Contact'])||_['isNil'](_0x2bbe2f[_0x43f8f1]['Contact'][_0x38d5('0x15a')])){_0x1eae32['emptyContact'](_0x38d5('0x1fb'),_0x478a12,_0x2bbe2f[_0x43f8f1]);}else{_0x1eae32['checkIsBlackList'](_[_0x38d5('0xcd')](_0x2bbe2f[_0x43f8f1],[_0x38d5('0xcf'),'Contact.phone']))['then'](_0x1eae32[_0x38d5('0x1fc')](_0x478a12,_0x2bbe2f[_0x43f8f1]))['catch'](_0x1eae32[_0x38d5('0xca')](_0x38d5('0x1fb'),_0x478a12));}}}})[_0x38d5('0xaa')](loggerGetContactDialer('[getContactDialer2]',_0x478a12,_0x456ded));}};Dialer[_0x38d5('0x1c')][_0x38d5('0x8b')]=function(_0x31b860){if(_0x31b860[_0x38d5('0x1f9')]>0x0){var _0x43b04d=_0x31b860[_0x38d5('0x1f9')]-_0x31b860[_0x38d5('0x6a')]-_0x31b860['talking'];if(_0x43b04d>0x0){this[_0x38d5('0x1fd')](_0x31b860);}else{loggerPredictiveCalls['info'](_0x38d5('0x1fe'));}}else{this[_0x38d5('0x1fd')](_0x31b860);}};Dialer['prototype'][_0x38d5('0x1fd')]=function(_0x40f921){var _0x1412eb=this;var _0x1cf110=[];_0x40f921[_0x38d5('0x6a')]+=0x1;for(var _0x537c3d in this['agents']){if(typeof this[_0x38d5('0x22')][_0x537c3d]!=='undefined'){if(this[_0x38d5('0x22')][_0x537c3d][_0x38d5('0xf8')]===_0x38d5('0x1fa')&&this['agents'][_0x537c3d][_0x38d5('0xd5')]===_0x38d5('0xd6')){_0x1cf110[_0x38d5('0x121')](this[_0x38d5('0x22')][_0x537c3d]['id']);}}}this[_0x38d5('0xbe')](_0x40f921['id'],_0x1cf110,0x1,_0x40f921[_0x38d5('0x1f3')],_0x40f921)['then'](function(_0x25f085){if(!checkContactEmpty(_0x25f085)){checkContactLowerLimitOriginate(_0x40f921,0x1,0x0);_0x1412eb[_0x38d5('0xb0')](_0x40f921)[_0x38d5('0xb4')](sendMessageReschedule(_0x40f921))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x40f921[_0x38d5('0x3a')]='RUNNING';if(_[_0x38d5('0xa8')](_0x25f085[0x0])||_['isNil'](_0x25f085[0x0][_0x38d5('0x159')])||_[_0x38d5('0xa8')](_0x25f085[0x0][_0x38d5('0x159')][_0x38d5('0x15a')])){_0x1412eb['emptyContact'](_0x38d5('0x1fb'),_0x40f921,_0x25f085[0x0]);}else{_0x1412eb['checkIsBlackList'](_['pick'](_0x25f085[0x0],['VoiceQueueId',_0x38d5('0x1ff')]))[_0x38d5('0xb4')](_0x1412eb[_0x38d5('0x1fc')](_0x40f921,_0x25f085[0x0]))['catch'](_0x1412eb[_0x38d5('0xca')]('[actionOriginatePredictive]\x20',_0x40f921));}}})[_0x38d5('0xaa')](loggerGetContactDialer('[getContactDialerPredictive]',_0x40f921,0x1));emitVoiceQueueSummary(_0x40f921);};Dialer['prototype'][_0x38d5('0x1ce')]=function(_0x44299d,_0x53420f,_0x3a1ab4,_0xf42a29,_0x179e57,_0x196069){loggerPredictive['info'](_0x38d5('0x200'));loggerPredictive[_0x38d5('0x77')](_0x38d5('0x201'),_0x44299d);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x202'),_0x53420f);loggerPredictive[_0x38d5('0x77')]('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',_0x3a1ab4);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x203'),_0xf42a29);loggerPredictive['info'](_0x38d5('0x204'),_0x179e57);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x80'));return new BPromise(function(_0xb0b2b3,_0x1a3ced){if(_0x44299d<=0x0||isNaN(_0x44299d)){return _0x1a3ced(msgResponse(_0x38d5('0x205'),_0x38d5('0x46'),'m\x20=\x20'+_0x44299d));}if(_0x3a1ab4<=0x0||isNaN(_0x3a1ab4)){return _0x1a3ced(msgResponse(_0x38d5('0x205'),_0x38d5('0x46'),_0x38d5('0x206')+_0x3a1ab4));}if(_0xf42a29<=0x0||isNaN(_0xf42a29)){return _0x1a3ced(msgResponse('[abandonmentRate]',_0x38d5('0x46'),_0x38d5('0x207')+_0xf42a29));}if(_0x53420f<=0x0||isNaN(_0x53420f)){return _0x1a3ced(msgResponse(_0x38d5('0x205'),_0x38d5('0x46'),_0x38d5('0x208')+_0x53420f));}if(_0x179e57<=0x0||isNaN(_0x179e57)){return _0x1a3ced(msgResponse(_0x38d5('0x205'),_0x38d5('0x46'),'Amax\x20=\x20'+_0x179e57));}_0x196069=_0x196069||0x0;var _0x497285=0x1/_0x3a1ab4;var _0x3768df=0x0;var _0x2c8198=0x0;var _0x47ada2=0x0;var _0x478978=0x0;for(var _0x1577dd=0x0;_0x47ada2<_0x179e57;_0x1577dd+=0x1){_0x2c8198=_0x1577dd/_0x53420f;_0x3768df=(_0xf42a29*_0x2c8198+_0x196069)/_0x497285;_0x47ada2=erlangb(_0x3768df,_0x44299d);_0x478978=_0x3768df/_0x44299d*(0x1-erlangb(_0x3768df,_0x44299d));}return _0xb0b2b3({'erlangCalls':_0x1577dd,'erlangCallToSecond':_0x53420f/_0x1577dd,'erlangAbandonmentRate':_0x47ada2,'erlangBusyFactor':_0x478978});});};Dialer[_0x38d5('0x1c')]['busyFactor']=function(_0x1c4b32,_0x208faf,_0x3785a9,_0x5790e5,_0x1ed5b6,_0x139b4a){loggerPredictive[_0x38d5('0x77')](_0x38d5('0x209'));loggerPredictive[_0x38d5('0x77')](_0x38d5('0x201'),_0x1c4b32);loggerPredictive['info'](_0x38d5('0x202'),_0x208faf);loggerPredictive['info'](_0x38d5('0x20a'),_0x3785a9);loggerPredictive[_0x38d5('0x77')]('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',_0x5790e5);loggerPredictive[_0x38d5('0x77')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ed5b6);loggerPredictive[_0x38d5('0x77')](_0x38d5('0x80'));return new BPromise(function(_0x2b20de,_0x182cb2){if(_0x1c4b32<=0x0||isNaN(_0x1c4b32)){return _0x182cb2(msgResponse(_0x38d5('0x20b'),'Error',_0x38d5('0x20c')+_0x1c4b32));}if(_0x3785a9<=0x0||isNaN(_0x3785a9)){return _0x182cb2(msgResponse(_0x38d5('0x20b'),_0x38d5('0x46'),_0x38d5('0x206')+_0x3785a9));}if(_0x5790e5<=0x0||isNaN(_0x5790e5)){return _0x182cb2(msgResponse(_0x38d5('0x20b'),_0x38d5('0x46'),_0x38d5('0x207')+_0x5790e5));}if(_0x208faf<=0x0||isNaN(_0x208faf)){return _0x182cb2(msgResponse(_0x38d5('0x20b'),_0x38d5('0x46'),_0x38d5('0x208')+_0x208faf));}if(_0x1ed5b6<=0x0||isNaN(_0x1ed5b6)){return _0x182cb2(msgResponse(_0x38d5('0x20b'),_0x38d5('0x46'),_0x38d5('0x20d')+_0x1ed5b6));}_0x139b4a=_0x139b4a||0x0;var _0xde90d=0x1/_0x3785a9;var _0x7a29b7=0x0;var _0x5f3657=0x0;var _0x153a86=0x0;var _0x2bae6b=0x0;for(var _0x1a3935=0x0;_0x2bae6b<_0x1ed5b6;_0x1a3935+=0x1){_0x5f3657=_0x1a3935/_0x208faf;_0x7a29b7=(_0x5790e5*_0x5f3657+_0x139b4a)/_0xde90d;_0x153a86=erlangb(_0x7a29b7,_0x1c4b32);_0x2bae6b=_0x7a29b7/_0x1c4b32*(0x1-erlangb(_0x7a29b7,_0x1c4b32));}return _0x2b20de({'erlangCalls':_0x1a3935,'erlangCallToSecond':_0x208faf/_0x1a3935,'erlangAbandonmentRate':_0x153a86,'erlangBusyFactor':_0x2bae6b});});};module[_0x38d5('0x20e')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5956756..9d9d12a 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 _0x383c=['responsetime','droptime','endtime','ringtime','holdtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','number','starttime'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x383c,0xe6));var _0xc383=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x383c[_0x178e48];return _0x440d7e;};'use strict';var util=require(_0xc383('0x0'));var _=require(_0xc383('0x1'));var moment=require(_0xc383('0x2'));function getSeconds(_0x32e911,_0x131957){var _0x1d62e7=moment(_0x32e911)['milliseconds'](0x0);var _0x548122=moment(_0x131957)[_0xc383('0x3')](0x0);return _0x1d62e7[_0xc383('0x4')](_0x548122,_0xc383('0x5'));}function QueueCallerAbandon(_0xaa904c,_0x5b5485){this[_0xc383('0x6')]=_0xaa904c[_0xc383('0x6')];this['type']=_0xaa904c[_0xc383('0x7')];this['campaigntype']=_0xaa904c[_0xc383('0x7')]===_0xc383('0x8')?'queue':_0xaa904c[_0xc383('0x7')];this[_0xc383('0x9')]=_0xaa904c[_0xc383('0x9')];this['countcongestionretry']=_0xaa904c[_0xc383('0xa')];this[_0xc383('0xb')]=_0xaa904c['countnoanswerretry'];this[_0xc383('0xc')]=_0xaa904c[_0xc383('0x9')]+_0xaa904c['countcongestionretry']+_0xaa904c[_0xc383('0xb')]+_0xaa904c[_0xc383('0xd')]+_0xaa904c[_0xc383('0xe')]+_0xaa904c['countabandonedretry']+_0xaa904c[_0xc383('0xf')]+_0xaa904c[_0xc383('0x10')];this['countnosuchnumberretry']=_0xaa904c[_0xc383('0xd')];this[_0xc383('0xe')]=_0xaa904c[_0xc383('0xe')];this['countabandonedretry']=_0xaa904c[_0xc383('0x11')];this['countmachineretry']=_0xaa904c[_0xc383('0xf')];this['countagentrejectretry']=_0xaa904c['countagentrejectretry'];this[_0xc383('0x12')]=_0x5b5485['uniqueid'];this['calleridname']=_0xaa904c[_0xc383('0x13')];this['calleridnum']=_0xaa904c[_0xc383('0x14')];this['starttime']=_0xaa904c[_0xc383('0x15')];this[_0xc383('0x16')]=_0xaa904c['responsetime'];this[_0xc383('0x17')]=_0xaa904c[_0xc383('0x17')];this[_0xc383('0x18')]=this[_0xc383('0x17')];this[_0xc383('0x19')]=getSeconds(_0xaa904c[_0xc383('0x16')],_0xaa904c[_0xc383('0x15')]);this[_0xc383('0x1a')]=getSeconds(this[_0xc383('0x17')],_0xaa904c[_0xc383('0x16')]);this['talktime']=0x0;this[_0xc383('0x1b')]=_0x5b5485[_0xc383('0x1b')];this[_0xc383('0x1c')]=_0x5b5485[_0xc383('0x1d')];this[_0xc383('0x1e')]=_0x5b5485['reason'];this[_0xc383('0x1f')]=_0xaa904c[_0xc383('0x1f')];this[_0xc383('0x20')]=_0xaa904c[_0xc383('0x20')];this[_0xc383('0x21')]=_0xaa904c['callbackat'];this[_0xc383('0x22')]=_0xaa904c[_0xc383('0x22')];this[_0xc383('0x23')]=_0xaa904c[_0xc383('0x23')];this['ListId']=_0xaa904c[_0xc383('0x24')];this[_0xc383('0x25')]=_0xaa904c[_0xc383('0x25')];this[_0xc383('0x26')]=_0xaa904c[_0xc383('0x26')];this[_0xc383('0x27')]=_0xaa904c[_0xc383('0x27')];this[_0xc383('0x28')]=_0xaa904c[_0xc383('0x28')]||'';this['originatecalleridname']=_0xaa904c['originatecalleridname']||'';}module[_0xc383('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x5fab=['countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','droptime','endtime','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countabandonedretry'];(function(_0x522f2a,_0x4f2722){var _0x258f2d=function(_0x35b958){while(--_0x35b958){_0x522f2a['push'](_0x522f2a['shift']());}};_0x258f2d(++_0x4f2722);}(_0x5fab,0x177));var _0xb5fa=function(_0x11239b,_0xdfd2b0){_0x11239b=_0x11239b-0x0;var _0x1d51c4=_0x5fab[_0x11239b];return _0x1d51c4;};'use strict';var util=require(_0xb5fa('0x0'));var _=require(_0xb5fa('0x1'));var moment=require('moment');function getSeconds(_0xc34cfd,_0x2e2a50){var _0x3fc227=moment(_0xc34cfd)[_0xb5fa('0x2')](0x0);var _0x67e8e8=moment(_0x2e2a50)[_0xb5fa('0x2')](0x0);return _0x3fc227[_0xb5fa('0x3')](_0x67e8e8,_0xb5fa('0x4'));}function QueueCallerAbandon(_0x10361d,_0x44df89){this['scheduledat']=_0x10361d['scheduledat'];this[_0xb5fa('0x5')]=_0x10361d[_0xb5fa('0x5')];this[_0xb5fa('0x6')]=_0x10361d['type']===_0xb5fa('0x7')?_0xb5fa('0x8'):_0x10361d[_0xb5fa('0x5')];this['countbusyretry']=_0x10361d['countbusyretry'];this[_0xb5fa('0x9')]=_0x10361d[_0xb5fa('0x9')];this[_0xb5fa('0xa')]=_0x10361d[_0xb5fa('0xa')];this[_0xb5fa('0xb')]=_0x10361d[_0xb5fa('0xc')]+_0x10361d[_0xb5fa('0x9')]+_0x10361d[_0xb5fa('0xa')]+_0x10361d[_0xb5fa('0xd')]+_0x10361d['countdropretry']+_0x10361d[_0xb5fa('0xe')]+_0x10361d[_0xb5fa('0xf')]+_0x10361d['countagentrejectretry'];this[_0xb5fa('0xd')]=_0x10361d['countnosuchnumberretry'];this[_0xb5fa('0x10')]=_0x10361d[_0xb5fa('0x10')];this[_0xb5fa('0xe')]=_0x10361d[_0xb5fa('0xe')];this[_0xb5fa('0xf')]=_0x10361d['countmachineretry'];this['countagentrejectretry']=_0x10361d[_0xb5fa('0x11')];this[_0xb5fa('0x12')]=_0x44df89[_0xb5fa('0x12')];this[_0xb5fa('0x13')]=_0x10361d['name'];this['calleridnum']=_0x10361d[_0xb5fa('0x14')];this[_0xb5fa('0x15')]=_0x10361d[_0xb5fa('0x15')];this[_0xb5fa('0x16')]=_0x10361d[_0xb5fa('0x16')];this[_0xb5fa('0x17')]=_0x10361d[_0xb5fa('0x17')];this[_0xb5fa('0x18')]=this[_0xb5fa('0x17')];this[_0xb5fa('0x19')]=getSeconds(_0x10361d[_0xb5fa('0x16')],_0x10361d[_0xb5fa('0x15')]);this['holdtime']=getSeconds(this[_0xb5fa('0x17')],_0x10361d['responsetime']);this[_0xb5fa('0x1a')]=0x0;this['queue']=_0x44df89[_0xb5fa('0x8')];this[_0xb5fa('0x1b')]=_0x44df89['connectedlinename'];this[_0xb5fa('0x1c')]=_0x44df89[_0xb5fa('0x1c')];this[_0xb5fa('0x1d')]=_0x10361d['callback'];this[_0xb5fa('0x1e')]=_0x10361d[_0xb5fa('0x1e')];this[_0xb5fa('0x1f')]=_0x10361d['callbackat'];this[_0xb5fa('0x20')]=_0x10361d['recallme'];this[_0xb5fa('0x21')]=_0x10361d[_0xb5fa('0x21')];this[_0xb5fa('0x22')]=_0x10361d[_0xb5fa('0x22')];this[_0xb5fa('0x23')]=_0x10361d[_0xb5fa('0x23')];this[_0xb5fa('0x24')]=_0x10361d[_0xb5fa('0x24')];this['CampaignId']=_0x10361d['CampaignId'];this['originatecalleridnum']=_0x10361d['originatecalleridnum']||'';this[_0xb5fa('0x25')]=_0x10361d[_0xb5fa('0x25')]||'';}module[_0xb5fa('0x26')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index cfe4554..3825f0e 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(_0x3caa18,_0x2b538c){var _0x3abfc7=function(_0x397641){while(--_0x397641){_0x3caa18['push'](_0x3caa18['shift']());}};_0x3abfc7(++_0x2b538c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x4e1a7c,_0x1c3999){var _0x5ed5c1=function(_0x5f5813){while(--_0x5f5813){_0x4e1a7c['push'](_0x4e1a7c['shift']());}};_0x5ed5c1(++_0x1c3999);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 8c556bc..0d86557 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 _0xd5f0=['%s/%s.tif','dir','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','.pdf','catch','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','update','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format'];(function(_0x1ff8ab,_0x347825){var _0x3c93b4=function(_0x468afb){while(--_0x468afb){_0x1ff8ab['push'](_0x1ff8ab['shift']());}};_0x3c93b4(++_0x347825);}(_0xd5f0,0x1e3));var _0x0d5f=function(_0x45317b,_0xc0002c){_0x45317b=_0x45317b-0x0;var _0x26443d=_0xd5f0[_0x45317b];return _0x26443d;};'use strict';var util=require(_0x0d5f('0x0'));var _=require(_0x0d5f('0x1'));var BPromise=require('bluebird');var uuid=require(_0x0d5f('0x2'));var moment=require(_0x0d5f('0x3'));var path=require(_0x0d5f('0x4'));var tiff2pdf=require(_0x0d5f('0x5'));var gs=require(_0x0d5f('0x6'));var logger=require(_0x0d5f('0x7'))(_0x0d5f('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x0d5f('0x9'));var Action=require(_0x0d5f('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x0d5f('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x43b1f1){this[_0x0d5f('0xc')]={};this['faxAccounts']=_0x43b1f1[_0x0d5f('0xd')];this[_0x0d5f('0xe')]=_0x43b1f1[_0x0d5f('0xe')];this[_0x0d5f('0xf')]={};ami['on'](_0x0d5f('0x10'),this[_0x0d5f('0x11')][_0x0d5f('0x12')](this));ami['on'](_0x0d5f('0x13'),this[_0x0d5f('0x14')][_0x0d5f('0x12')](this));ami['on'](_0x0d5f('0x15'),this['syncNewState'][_0x0d5f('0x12')](this));ami['on'](_0x0d5f('0x16'),this['syncNewExten'][_0x0d5f('0x12')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x0d5f('0x12')](this));ami['on']('receivefax',this[_0x0d5f('0x17')][_0x0d5f('0x12')](this));ami['on'](_0x0d5f('0x18'),this[_0x0d5f('0x19')]['bind'](this));ami['on'](_0x0d5f('0x1a'),this[_0x0d5f('0x1b')][_0x0d5f('0x12')](this));}Fax[_0x0d5f('0x1c')]['syncNewchannel']=function(_0x120ecb){if(_0x120ecb['context']===_0x0d5f('0x1d')){for(var _0x226c3e in this[_0x0d5f('0xd')]){if(this[_0x0d5f('0xd')][_0x0d5f('0x1e')](_0x226c3e)){if(_0x120ecb[_0x0d5f('0x1f')]===this[_0x0d5f('0xd')][_0x226c3e]['localstationid']){this['channels'][_0x120ecb[_0x0d5f('0x20')]]={};this[_0x0d5f('0xc')][_0x120ecb[_0x0d5f('0x20')]][_0x0d5f('0x21')]=_0x120ecb[_0x0d5f('0x21')];this['channels'][_0x120ecb['uniqueid']]['id']=this['faxAccounts'][_0x226c3e]['id'];this['channels'][_0x120ecb['uniqueid']][_0x0d5f('0x22')]=this['faxAccounts'][_0x226c3e][_0x0d5f('0x22')];logger[_0x0d5f('0x23')](_0x120ecb[_0x0d5f('0x20')],'\x20syncNewchannel\x20');}}}}if(this[_0x0d5f('0xf')][_0x120ecb[_0x0d5f('0x20')]]){this[_0x0d5f('0xc')][_0x120ecb[_0x0d5f('0x20')]]={};this['channels'][_0x120ecb[_0x0d5f('0x20')]][_0x0d5f('0x21')]=_0x120ecb[_0x0d5f('0x21')];logger[_0x0d5f('0x23')](_0x120ecb[_0x0d5f('0x20')],_0x0d5f('0x24'));}};Fax['prototype']['syncVarSet']=function(_0x128f6b){if(this[_0x0d5f('0xc')][_0x128f6b[_0x0d5f('0x20')]]){for(var _0x3eead9 in _0x128f6b[_0x0d5f('0x25')]){if(_0x128f6b[_0x0d5f('0x25')][_0x0d5f('0x1e')](_0x3eead9)){this[_0x0d5f('0xc')][_0x128f6b['uniqueid']][_0x3eead9]=_0x128f6b[_0x0d5f('0x26')];}}}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x27')]=function(_0x22df44){if(this[_0x0d5f('0xc')][_0x22df44[_0x0d5f('0x20')]]){this['channels'][_0x22df44['uniqueid']]['channelstate']=_0x22df44[_0x0d5f('0x28')];this[_0x0d5f('0xc')][_0x22df44[_0x0d5f('0x20')]][_0x0d5f('0x29')]=_0x22df44[_0x0d5f('0x29')];}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x2a')]=function(_0x24dd96){if(this[_0x0d5f('0xc')][_0x24dd96[_0x0d5f('0x20')]]){for(var _0x332cfc in _0x24dd96[_0x0d5f('0x25')]){if(_0x24dd96['variable']['hasOwnProperty'](_0x332cfc)){this[_0x0d5f('0xc')][_0x24dd96['uniqueid']][_0x332cfc]=_0x24dd96['value'];}}}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x2b')]=function(_0x49e056){if(this[_0x0d5f('0xc')][_0x49e056['uniqueid']]){this['channels'][_0x49e056[_0x0d5f('0x20')]][_0x0d5f('0x2c')]=_0x49e056[_0x0d5f('0x2c')];this[_0x0d5f('0xc')][_0x49e056['uniqueid']]['status']=_0x49e056[_0x0d5f('0x2d')];this['channels'][_0x49e056[_0x0d5f('0x20')]]['localstationid']=_0x49e056[_0x0d5f('0x2e')];this[_0x0d5f('0xc')][_0x49e056[_0x0d5f('0x20')]][_0x0d5f('0x2f')]=_0x49e056[_0x0d5f('0x2f')];logger[_0x0d5f('0x23')](_0x49e056['uniqueid'],_0x0d5f('0x30'));}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x17')]=function(_0x37d208){var _0x180469=this;if(this[_0x0d5f('0xc')][_0x37d208['uniqueid']]){var _0x46f6cb=this[_0x0d5f('0xc')][_0x37d208['uniqueid']]['id'];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x31')]=_0x37d208[_0x0d5f('0x31')];this[_0x0d5f('0xc')][_0x37d208['uniqueid']][_0x0d5f('0x32')]=_0x37d208[_0x0d5f('0x32')];this['channels'][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x2e')]=_0x37d208['localstationid'];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x33')]=_0x37d208[_0x0d5f('0x33')];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x34')]=_0x37d208[_0x0d5f('0x34')];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]][_0x0d5f('0x2f')]=_0x37d208[_0x0d5f('0x2f')];this[_0x0d5f('0xc')][_0x37d208[_0x0d5f('0x20')]]['calleridnum']=_0x37d208[_0x0d5f('0x35')];if(this['channels'][_0x37d208['uniqueid']][_0x0d5f('0x32')]>0x0){tiff2pdf(_0x37d208[_0x0d5f('0x2f')],_0x0d5f('0x36'),function(_0x40433b){logger['info'](_0x37d208[_0x0d5f('0x20')],_0x0d5f('0x37'),_0x40433b['message']);attachment[_0x0d5f('0x38')]({'name':path['parse'](_0x37d208['filename'])[_0x0d5f('0x22')],'basename':path[_0x0d5f('0x39')](_0x37d208['filename'])['name']+'.pdf','type':_0x0d5f('0x3a')})[_0x0d5f('0x3b')](function(_0x3e541e){faxAccount[_0x0d5f('0x3c')](_0x46f6cb,{'from':_0x37d208['calleridnum'],'mapKey':_0x0d5f('0x8'),'body':path[_0x0d5f('0x39')](_0x37d208['filename'])[_0x0d5f('0x22')]+_0x0d5f('0x3d'),'AttachmentId':_0x3e541e['id']})[_0x0d5f('0x3e')](function(_0x38525b){logger['error'](_0x37d208[_0x0d5f('0x20')],'\x20notify\x20',JSON['stringify'](_0x38525b));});})[_0x0d5f('0x3e')](function(_0x32d8c5){logger['error'](_0x37d208['uniqueid'],_0x0d5f('0x3f'),JSON[_0x0d5f('0x40')](_0x32d8c5));});});}logger[_0x0d5f('0x23')](_0x37d208[_0x0d5f('0x20')],_0x0d5f('0x3f'));}};Fax[_0x0d5f('0x1c')]['syncOriginateResponse']=function(_0x309383){if(this['actions'][_0x309383['uniqueid']]){_[_0x0d5f('0x41')](this[_0x0d5f('0xc')][_0x309383[_0x0d5f('0x20')]],_[_0x0d5f('0x42')](_0x309383,[_0x0d5f('0x43'),_0x0d5f('0x44')]));}};function updateStatus(_0x2ba04b){if(_0x2ba04b[_0x0d5f('0x45')]){faxMessage[_0x0d5f('0x46')](_0x2ba04b['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x0d5f('0x3b')](function(_0x125fbc){ut['logger']('[Fax][Message][Error][Updated]',_0x125fbc);})[_0x0d5f('0x3e')](function(_0x229ea0){ut['logger'](_0x0d5f('0x47'),_0x229ea0);});}else{ut[_0x0d5f('0x48')](_0x0d5f('0x49'));}}Fax[_0x0d5f('0x1c')][_0x0d5f('0x4a')]=function(_0x4e01c9,_0x564a5a,_0x26fad9){var _0x30d79b=this;var _0x56e898={};if(_0x564a5a){_0x56e898={'read':_0x564a5a};}else{_0x56e898={'failMessage':_0x26fad9};}if(this['actions'][_0x4e01c9][_0x0d5f('0x45')]){faxMessage['update'](this['actions'][_0x4e01c9]['AttachmentId'],_0x56e898)[_0x0d5f('0x3b')](function(_0x4ef4f9){ut[_0x0d5f('0x48')](_0x0d5f('0x4b'),_0x4ef4f9);})['catch'](function(_0x4443e6){ut['logger'](_0x0d5f('0x4c'),_0x4443e6);})[_0x0d5f('0x4d')](function(){delete _0x30d79b[_0x0d5f('0xc')][_0x4e01c9];delete _0x30d79b[_0x0d5f('0xf')][_0x4e01c9];});}else{ut[_0x0d5f('0x48')](_0x0d5f('0x4e'));delete this['channels'][_0x4e01c9];delete this[_0x0d5f('0xf')][_0x4e01c9];}};Fax[_0x0d5f('0x1c')]['syncHangup']=function(_0x2f1f58){var _0x3df332=this;if(this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]){if(this[_0x0d5f('0xf')][_0x2f1f58[_0x0d5f('0x20')]]){this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]['id']=this[_0x0d5f('0xf')][_0x2f1f58[_0x0d5f('0x20')]]['id'];this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]][_0x0d5f('0x22')]=this[_0x0d5f('0xf')][_0x2f1f58[_0x0d5f('0x20')]][_0x0d5f('0x22')];}logger[_0x0d5f('0x23')](_0x2f1f58[_0x0d5f('0x20')],this[_0x0d5f('0xf')][_0x2f1f58['uniqueid']]?_0x0d5f('0x4f'):_0x0d5f('0x50'),JSON[_0x0d5f('0x40')](this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]));if(this[_0x0d5f('0xf')][_0x2f1f58['uniqueid']]){if(this['channels'][_0x2f1f58[_0x0d5f('0x20')]]['faxpages']>0x0&&this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]['faxstatus']===_0x0d5f('0x51')){this[_0x0d5f('0x4a')](_0x2f1f58[_0x0d5f('0x20')],!![]);}else{this[_0x0d5f('0x4a')](_0x2f1f58[_0x0d5f('0x20')],![],this[_0x0d5f('0xc')][_0x2f1f58[_0x0d5f('0x20')]]['faxstatusstring']?_0x0d5f('0x52')+this['channels'][_0x2f1f58[_0x0d5f('0x20')]]['faxstatusstring']:_0x0d5f('0x53'));}}}};Fax[_0x0d5f('0x1c')][_0x0d5f('0x54')]=function(_0x55f06c){var _0x36dc8d=this;return new BPromise(function(_0x8f5426,_0xf861d9){_0x36dc8d[_0x0d5f('0x55')](_0x55f06c,_0x36dc8d[_0x0d5f('0xd')][_0x55f06c[_0x0d5f('0x56')]])[_0x0d5f('0x3b')](function(_0x17161b){ut[_0x0d5f('0x48')](_0x0d5f('0x57'),_0x17161b);_0x8f5426(ut[_0x0d5f('0x58')]('Fax\x20received'));})[_0x0d5f('0x3e')](function(_0x55815f){ut['logger'](_0x0d5f('0x59'),_0x55815f);updateStatus(_0x55f06c);_0xf861d9(ut[_0x0d5f('0x58')](_0x0d5f('0x5a')));});});};Fax['prototype'][_0x0d5f('0x5b')]=function(_0x1db2eb){var _0x5b7e3b=this;return new BPromise(function(_0x11678e,_0x1fbb09){var _0x3cc54c=_0x5b7e3b[_0x0d5f('0x5c')](_0x5b7e3b['faxAccounts'][_0x1db2eb['FaxAccountId']][_0x0d5f('0x5d')],_0x1db2eb);if(_0x3cc54c[_0x0d5f('0x5e')]){_0x11678e(ut['message'](_0x0d5f('0x5f')));}else{_0x1fbb09(ut['message'](_0x3cc54c[_0x0d5f('0x58')]));}});};function originate(_0x488d55,_0x1555e1,_0x3cdfe0){return new BPromise(function(_0x16c747,_0x18b318){if(_0x3cdfe0){var _0x5947f5=util[_0x0d5f('0x60')]('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',path[_0x0d5f('0x39')](_0x488d55[_0x0d5f('0x4')])[_0x0d5f('0x22')],_0x488d55[_0x0d5f('0x4')]);gs['execute'](_0x5947f5)[_0x0d5f('0x3b')](function(){_0x488d55[_0x0d5f('0x4')]=util['format'](_0x0d5f('0x61'),path[_0x0d5f('0x39')](_0x488d55[_0x0d5f('0x4')])[_0x0d5f('0x62')],path['parse'](_0x488d55[_0x0d5f('0x4')])['name']);_0x1555e1['XMF-PATH']=_0x488d55[_0x0d5f('0x4')];ut[_0x0d5f('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x0d5f('0x63')](ut['variablesAction'](_0x488d55,_0x1555e1))[_0x0d5f('0x3b')](function(_0x360b04){_0x16c747(_0x360b04);})['catch'](function(_0x5719e9){_0x18b318(_0x5719e9);});})['catch'](function(_0x25012a){_0x18b318(_0x25012a);});}else{ami['Action'](ut[_0x0d5f('0x64')](_0x488d55,_0x1555e1))['then'](function(_0x3f9e2d){_0x16c747(_0x3f9e2d);})[_0x0d5f('0x3e')](function(_0xd3704c){_0x18b318(_0xd3704c);});}});}Fax[_0x0d5f('0x1c')][_0x0d5f('0x55')]=function(_0x3a6463,_0x4bb1a2){var _0x3a57be=this;return new BPromise(function(_0x4fbfa1,_0x2e589e){var _0x255228=uuid['v4']();var _0x205f11=ut[_0x0d5f('0x65')](_0x3a6463,_0x4bb1a2);_0x3a57be[_0x0d5f('0xf')][_0x255228]=new Action(_0x255228,_0x4bb1a2,_0x3a6463);var _0x41d17f=_0x3a57be[_0x0d5f('0xf')][_0x255228];if(path[_0x0d5f('0x39')](_0x3a6463[_0x0d5f('0x4')])[_0x0d5f('0x66')]===_0x0d5f('0x3d')){originate(_0x41d17f,_0x205f11,!![])[_0x0d5f('0x3b')](function(_0x1bd858){_0x4fbfa1(_0x1bd858);})[_0x0d5f('0x3e')](function(_0x12ca47){_0x2e589e(_0x12ca47);});}else{originate(_0x41d17f,_0x205f11,![])[_0x0d5f('0x3b')](function(_0x19ec23){_0x4fbfa1(_0x19ec23);})['catch'](function(_0x3af69e){_0x2e589e(_0x3af69e);});}});};Fax[_0x0d5f('0x1c')][_0x0d5f('0x67')]=function(_0x3a716e){return!_['isNil'](_0x3a716e)&&!_[_0x0d5f('0x68')](_0x3a716e['name'])&&!_[_0x0d5f('0x68')](_0x3a716e[_0x0d5f('0x69')])&&_0x3a716e['active']&&!_['isNil'](this[_0x0d5f('0xe')][util[_0x0d5f('0x60')](_0x0d5f('0x6a'),_0x3a716e[_0x0d5f('0x22')])])&&!_[_0x0d5f('0x68')](this[_0x0d5f('0xe')][util[_0x0d5f('0x60')]('SIP/%s',_0x3a716e[_0x0d5f('0x22')])][_0x0d5f('0x2d')])&&(this[_0x0d5f('0xe')][util[_0x0d5f('0x60')]('SIP/%s',_0x3a716e[_0x0d5f('0x22')])][_0x0d5f('0x2d')]===_0x0d5f('0x6b')||this[_0x0d5f('0xe')][util['format']('SIP/%s',_0x3a716e[_0x0d5f('0x22')])][_0x0d5f('0x2d')]===_0x0d5f('0x6c'));};Fax[_0x0d5f('0x1c')][_0x0d5f('0x5c')]=function(_0x268322,_0x3b886d){if(!this[_0x0d5f('0x67')](_0x268322)){ut['logger'](_0x0d5f('0x6d'),_['isNil'](_0x268322)?'':_0x268322[_0x0d5f('0x22')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x0d5f('0x6e')};}if(_[_0x0d5f('0x68')](_0x3b886d[_0x0d5f('0x8')])){ut[_0x0d5f('0x48')](_0x0d5f('0x6f'),JSON[_0x0d5f('0x40')](_0x3b886d));return{'isValid':![],'message':_0x0d5f('0x70')};}if(_[_0x0d5f('0x68')](_0x3b886d[_0x0d5f('0x4')])){ut[_0x0d5f('0x48')](_0x0d5f('0x71'),JSON['stringify'](_0x3b886d));return{'isValid':![],'message':_0x0d5f('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x0d5f('0x73')]=Fax; \ No newline at end of file +var _0xc8fb=['status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','calleridnum','.pdf','error','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','Trunk\x20Reachable','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20work]','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','actions','info','variable','channelstate','channelstatedesc','value','syncFaxStatus','operation'];(function(_0x569a1c,_0xf30bfe){var _0x324398=function(_0x357902){while(--_0x357902){_0x569a1c['push'](_0x569a1c['shift']());}};_0x324398(++_0xf30bfe);}(_0xc8fb,0x13a));var _0xbc8f=function(_0x506244,_0x124239){_0x506244=_0x506244-0x0;var _0x1c5ae4=_0xc8fb[_0x506244];return _0x1c5ae4;};'use strict';var util=require('util');var _=require(_0xbc8f('0x0'));var BPromise=require(_0xbc8f('0x1'));var uuid=require(_0xbc8f('0x2'));var moment=require(_0xbc8f('0x3'));var path=require(_0xbc8f('0x4'));var tiff2pdf=require(_0xbc8f('0x5'));var gs=require(_0xbc8f('0x6'));var logger=require(_0xbc8f('0x7'))(_0xbc8f('0x8'));var ami=require(_0xbc8f('0x9'));var rpcDb=require(_0xbc8f('0xa'));var Channel=require('./channel');var ut=require(_0xbc8f('0xb'));var Action=require(_0xbc8f('0xc'));var faxAccount=require(_0xbc8f('0xd'));var attachment=require(_0xbc8f('0xe'));var faxMessage=require(_0xbc8f('0xf'));function Fax(_0x452373){this['channels']={};this[_0xbc8f('0x10')]=_0x452373[_0xbc8f('0x10')];this[_0xbc8f('0x11')]=_0x452373[_0xbc8f('0x11')];this['actions']={};ami['on'](_0xbc8f('0x12'),this['syncNewchannel'][_0xbc8f('0x13')](this));ami['on'](_0xbc8f('0x14'),this[_0xbc8f('0x15')][_0xbc8f('0x13')](this));ami['on'](_0xbc8f('0x16'),this[_0xbc8f('0x17')][_0xbc8f('0x13')](this));ami['on']('newexten',this[_0xbc8f('0x18')][_0xbc8f('0x13')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0xbc8f('0x13')](this));ami['on']('receivefax',this[_0xbc8f('0x19')][_0xbc8f('0x13')](this));ami['on']('hangup',this[_0xbc8f('0x1a')][_0xbc8f('0x13')](this));ami['on'](_0xbc8f('0x1b'),this[_0xbc8f('0x1c')][_0xbc8f('0x13')](this));}Fax[_0xbc8f('0x1d')][_0xbc8f('0x1e')]=function(_0x40f44a){if(_0x40f44a[_0xbc8f('0x1f')]===_0xbc8f('0x20')){for(var _0x5645a3 in this[_0xbc8f('0x10')]){if(this[_0xbc8f('0x10')][_0xbc8f('0x21')](_0x5645a3)){if(_0x40f44a[_0xbc8f('0x22')]===this[_0xbc8f('0x10')][_0x5645a3][_0xbc8f('0x23')]){this[_0xbc8f('0x24')][_0x40f44a[_0xbc8f('0x25')]]={};this[_0xbc8f('0x24')][_0x40f44a['uniqueid']][_0xbc8f('0x26')]=_0x40f44a[_0xbc8f('0x26')];this[_0xbc8f('0x24')][_0x40f44a[_0xbc8f('0x25')]]['id']=this[_0xbc8f('0x10')][_0x5645a3]['id'];this[_0xbc8f('0x24')][_0x40f44a[_0xbc8f('0x25')]][_0xbc8f('0x27')]=this['faxAccounts'][_0x5645a3]['name'];logger['info'](_0x40f44a[_0xbc8f('0x25')],_0xbc8f('0x28'));}}}}if(this[_0xbc8f('0x29')][_0x40f44a[_0xbc8f('0x25')]]){this[_0xbc8f('0x24')][_0x40f44a[_0xbc8f('0x25')]]={};this[_0xbc8f('0x24')][_0x40f44a[_0xbc8f('0x25')]][_0xbc8f('0x26')]=_0x40f44a[_0xbc8f('0x26')];logger[_0xbc8f('0x2a')](_0x40f44a[_0xbc8f('0x25')],_0xbc8f('0x28'));}};Fax[_0xbc8f('0x1d')][_0xbc8f('0x15')]=function(_0x2297ef){if(this[_0xbc8f('0x24')][_0x2297ef['uniqueid']]){for(var _0x4503d2 in _0x2297ef[_0xbc8f('0x2b')]){if(_0x2297ef['variable'][_0xbc8f('0x21')](_0x4503d2)){this[_0xbc8f('0x24')][_0x2297ef[_0xbc8f('0x25')]][_0x4503d2]=_0x2297ef['value'];}}}};Fax[_0xbc8f('0x1d')]['syncNewState']=function(_0x257502){if(this['channels'][_0x257502['uniqueid']]){this[_0xbc8f('0x24')][_0x257502[_0xbc8f('0x25')]][_0xbc8f('0x2c')]=_0x257502['channelstate'];this[_0xbc8f('0x24')][_0x257502['uniqueid']][_0xbc8f('0x2d')]=_0x257502['channelstatedesc'];}};Fax['prototype'][_0xbc8f('0x18')]=function(_0x42c461){if(this[_0xbc8f('0x24')][_0x42c461[_0xbc8f('0x25')]]){for(var _0x768ad6 in _0x42c461[_0xbc8f('0x2b')]){if(_0x42c461[_0xbc8f('0x2b')][_0xbc8f('0x21')](_0x768ad6)){this[_0xbc8f('0x24')][_0x42c461[_0xbc8f('0x25')]][_0x768ad6]=_0x42c461[_0xbc8f('0x2e')];}}}};Fax[_0xbc8f('0x1d')][_0xbc8f('0x2f')]=function(_0x19ecbe){if(this[_0xbc8f('0x24')][_0x19ecbe[_0xbc8f('0x25')]]){this['channels'][_0x19ecbe[_0xbc8f('0x25')]][_0xbc8f('0x30')]=_0x19ecbe['operation'];this[_0xbc8f('0x24')][_0x19ecbe[_0xbc8f('0x25')]]['status']=_0x19ecbe[_0xbc8f('0x31')];this[_0xbc8f('0x24')][_0x19ecbe[_0xbc8f('0x25')]][_0xbc8f('0x23')]=_0x19ecbe[_0xbc8f('0x23')];this[_0xbc8f('0x24')][_0x19ecbe[_0xbc8f('0x25')]][_0xbc8f('0x32')]=_0x19ecbe[_0xbc8f('0x32')];logger[_0xbc8f('0x2a')](_0x19ecbe[_0xbc8f('0x25')],_0xbc8f('0x33'));}};Fax['prototype'][_0xbc8f('0x19')]=function(_0x3ae62c){var _0x2d796e=this;if(this[_0xbc8f('0x24')][_0x3ae62c['uniqueid']]){var _0x4ccb6d=this[_0xbc8f('0x24')][_0x3ae62c[_0xbc8f('0x25')]]['id'];this[_0xbc8f('0x24')][_0x3ae62c[_0xbc8f('0x25')]][_0xbc8f('0x34')]=_0x3ae62c[_0xbc8f('0x34')];this[_0xbc8f('0x24')][_0x3ae62c['uniqueid']][_0xbc8f('0x35')]=_0x3ae62c[_0xbc8f('0x35')];this[_0xbc8f('0x24')][_0x3ae62c['uniqueid']][_0xbc8f('0x23')]=_0x3ae62c[_0xbc8f('0x23')];this[_0xbc8f('0x24')][_0x3ae62c[_0xbc8f('0x25')]]['resolution']=_0x3ae62c[_0xbc8f('0x36')];this[_0xbc8f('0x24')][_0x3ae62c[_0xbc8f('0x25')]][_0xbc8f('0x37')]=_0x3ae62c[_0xbc8f('0x37')];this['channels'][_0x3ae62c[_0xbc8f('0x25')]][_0xbc8f('0x32')]=_0x3ae62c['filename'];this[_0xbc8f('0x24')][_0x3ae62c[_0xbc8f('0x25')]]['calleridnum']=_0x3ae62c['calleridnum'];if(this[_0xbc8f('0x24')][_0x3ae62c[_0xbc8f('0x25')]][_0xbc8f('0x35')]>0x0){tiff2pdf(_0x3ae62c[_0xbc8f('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x41a6f7){logger[_0xbc8f('0x2a')](_0x3ae62c[_0xbc8f('0x25')],_0xbc8f('0x38'),_0x41a6f7[_0xbc8f('0x39')]);attachment[_0xbc8f('0x3a')]({'name':path[_0xbc8f('0x3b')](_0x3ae62c['filename'])[_0xbc8f('0x27')],'basename':path[_0xbc8f('0x3b')](_0x3ae62c['filename'])[_0xbc8f('0x27')]+'.pdf','type':_0xbc8f('0x3c')})[_0xbc8f('0x3d')](function(_0x221bf0){faxAccount[_0xbc8f('0x3e')](_0x4ccb6d,{'from':_0x3ae62c[_0xbc8f('0x3f')],'mapKey':'fax','body':path[_0xbc8f('0x3b')](_0x3ae62c[_0xbc8f('0x32')])['name']+_0xbc8f('0x40'),'AttachmentId':_0x221bf0['id']})['catch'](function(_0xaf644f){logger[_0xbc8f('0x41')](_0x3ae62c[_0xbc8f('0x25')],'\x20notify\x20',JSON[_0xbc8f('0x42')](_0xaf644f));});})[_0xbc8f('0x43')](function(_0x8ed82a){logger[_0xbc8f('0x41')](_0x3ae62c[_0xbc8f('0x25')],_0xbc8f('0x44'),JSON[_0xbc8f('0x42')](_0x8ed82a));});});}logger[_0xbc8f('0x2a')](_0x3ae62c[_0xbc8f('0x25')],'\x20receiveFax\x20');}};Fax[_0xbc8f('0x1d')][_0xbc8f('0x1c')]=function(_0x24ccad){if(this[_0xbc8f('0x29')][_0x24ccad['uniqueid']]){_[_0xbc8f('0x45')](this[_0xbc8f('0x24')][_0x24ccad[_0xbc8f('0x25')]],_[_0xbc8f('0x46')](_0x24ccad,[_0xbc8f('0x47'),_0xbc8f('0x48')]));}};function updateStatus(_0x173076){if(_0x173076['AttachmentId']){faxMessage[_0xbc8f('0x49')](_0x173076[_0xbc8f('0x4a')],{'failMessage':_0xbc8f('0x4b')})[_0xbc8f('0x3d')](function(_0x5498f3){ut[_0xbc8f('0x4c')](_0xbc8f('0x4d'),_0x5498f3);})[_0xbc8f('0x43')](function(_0x1aaa6a){ut[_0xbc8f('0x4c')](_0xbc8f('0x4e'),_0x1aaa6a);});}else{ut[_0xbc8f('0x4c')](_0xbc8f('0x4f'));}}Fax[_0xbc8f('0x1d')][_0xbc8f('0x50')]=function(_0x388758,_0x270eb0,_0x2f5d77){var _0x427d06=this;var _0x564334={};if(_0x270eb0){_0x564334={'read':_0x270eb0};}else{_0x564334={'failMessage':_0x2f5d77};}if(this[_0xbc8f('0x29')][_0x388758][_0xbc8f('0x4a')]){faxMessage[_0xbc8f('0x49')](this[_0xbc8f('0x29')][_0x388758][_0xbc8f('0x4a')],_0x564334)[_0xbc8f('0x3d')](function(_0x26d087){ut['logger'](_0xbc8f('0x51'),_0x26d087);})[_0xbc8f('0x43')](function(_0xd68b95){ut['logger']('[Fax][Message][NoUpdate1]',_0xd68b95);})[_0xbc8f('0x52')](function(){delete _0x427d06[_0xbc8f('0x24')][_0x388758];delete _0x427d06['actions'][_0x388758];});}else{ut['logger'](_0xbc8f('0x53'));delete this[_0xbc8f('0x24')][_0x388758];delete this['actions'][_0x388758];}};Fax[_0xbc8f('0x1d')][_0xbc8f('0x1a')]=function(_0x2d3146){var _0x1389f7=this;if(this['channels'][_0x2d3146[_0xbc8f('0x25')]]){if(this['actions'][_0x2d3146[_0xbc8f('0x25')]]){this[_0xbc8f('0x24')][_0x2d3146[_0xbc8f('0x25')]]['id']=this[_0xbc8f('0x29')][_0x2d3146[_0xbc8f('0x25')]]['id'];this[_0xbc8f('0x24')][_0x2d3146[_0xbc8f('0x25')]]['name']=this[_0xbc8f('0x29')][_0x2d3146[_0xbc8f('0x25')]][_0xbc8f('0x27')];}logger[_0xbc8f('0x2a')](_0x2d3146[_0xbc8f('0x25')],this[_0xbc8f('0x29')][_0x2d3146['uniqueid']]?_0xbc8f('0x54'):'\x20hangup\x20faxRiceive\x20',JSON[_0xbc8f('0x42')](this[_0xbc8f('0x24')][_0x2d3146[_0xbc8f('0x25')]]));if(this[_0xbc8f('0x29')][_0x2d3146[_0xbc8f('0x25')]]){if(this[_0xbc8f('0x24')][_0x2d3146[_0xbc8f('0x25')]][_0xbc8f('0x55')]>0x0&&this[_0xbc8f('0x24')][_0x2d3146[_0xbc8f('0x25')]][_0xbc8f('0x56')]===_0xbc8f('0x57')){this[_0xbc8f('0x50')](_0x2d3146[_0xbc8f('0x25')],!![]);}else{this[_0xbc8f('0x50')](_0x2d3146[_0xbc8f('0x25')],![],this[_0xbc8f('0x24')][_0x2d3146[_0xbc8f('0x25')]][_0xbc8f('0x58')]?_0xbc8f('0x59')+this[_0xbc8f('0x24')][_0x2d3146['uniqueid']]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0xbc8f('0x1d')][_0xbc8f('0x5a')]=function(_0x457c03){var _0x3931c6=this;return new BPromise(function(_0x57a05f,_0x10362c){_0x3931c6[_0xbc8f('0x5b')](_0x457c03,_0x3931c6[_0xbc8f('0x10')][_0x457c03[_0xbc8f('0x5c')]])['then'](function(_0x5dfd0e){ut['logger'](_0xbc8f('0x5d'),_0x5dfd0e);_0x57a05f(ut[_0xbc8f('0x39')](_0xbc8f('0x5e')));})['catch'](function(_0x47119a){ut[_0xbc8f('0x4c')](_0xbc8f('0x5f'),_0x47119a);updateStatus(_0x457c03);_0x10362c(ut[_0xbc8f('0x39')](_0xbc8f('0x60')));});});};Fax[_0xbc8f('0x1d')]['checkAfterSend']=function(_0x3c50d2){var _0x2164f=this;return new BPromise(function(_0x8f53f5,_0x29a959){var _0x71bbda=_0x2164f[_0xbc8f('0x61')](_0x2164f[_0xbc8f('0x10')][_0x3c50d2['FaxAccountId']]['Trunk'],_0x3c50d2);if(_0x71bbda[_0xbc8f('0x62')]){_0x8f53f5(ut[_0xbc8f('0x39')](_0xbc8f('0x63')));}else{_0x29a959(ut[_0xbc8f('0x39')](_0x71bbda[_0xbc8f('0x39')]));}});};function originate(_0x2b6f93,_0x3e3ea1,_0xb809e6){return new BPromise(function(_0x400e95,_0x404eff){if(_0xb809e6){var _0x139a7c=util['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',path[_0xbc8f('0x3b')](_0x2b6f93[_0xbc8f('0x4')])[_0xbc8f('0x27')],_0x2b6f93[_0xbc8f('0x4')]);gs[_0xbc8f('0x64')](_0x139a7c)['then'](function(){_0x2b6f93[_0xbc8f('0x4')]=util[_0xbc8f('0x65')](_0xbc8f('0x66'),path[_0xbc8f('0x3b')](_0x2b6f93[_0xbc8f('0x4')])[_0xbc8f('0x67')],path['parse'](_0x2b6f93[_0xbc8f('0x4')])[_0xbc8f('0x27')]);_0x3e3ea1[_0xbc8f('0x68')]=_0x2b6f93[_0xbc8f('0x4')];ut[_0xbc8f('0x4c')](_0xbc8f('0x69'),'');ami['Action'](ut[_0xbc8f('0x6a')](_0x2b6f93,_0x3e3ea1))[_0xbc8f('0x3d')](function(_0x5b928f){_0x400e95(_0x5b928f);})[_0xbc8f('0x43')](function(_0xd23180){_0x404eff(_0xd23180);});})[_0xbc8f('0x43')](function(_0x552583){_0x404eff(_0x552583);});}else{ami[_0xbc8f('0x6b')](ut[_0xbc8f('0x6a')](_0x2b6f93,_0x3e3ea1))[_0xbc8f('0x3d')](function(_0x59f6b5){_0x400e95(_0x59f6b5);})[_0xbc8f('0x43')](function(_0x28ddfa){_0x404eff(_0x28ddfa);});}});}Fax[_0xbc8f('0x1d')]['execOriginate']=function(_0x28f2c6,_0xb78007){var _0x434894=this;return new BPromise(function(_0x19072d,_0x14cbf1){var _0x562bf0=uuid['v4']();var _0x372768=ut[_0xbc8f('0x6c')](_0x28f2c6,_0xb78007);_0x434894[_0xbc8f('0x29')][_0x562bf0]=new Action(_0x562bf0,_0xb78007,_0x28f2c6);var _0x47b926=_0x434894[_0xbc8f('0x29')][_0x562bf0];if(path[_0xbc8f('0x3b')](_0x28f2c6['path'])[_0xbc8f('0x6d')]===_0xbc8f('0x40')){originate(_0x47b926,_0x372768,!![])[_0xbc8f('0x3d')](function(_0x19ff96){_0x19072d(_0x19ff96);})['catch'](function(_0x3d7e3a){_0x14cbf1(_0x3d7e3a);});}else{originate(_0x47b926,_0x372768,![])[_0xbc8f('0x3d')](function(_0x37a479){_0x19072d(_0x37a479);})[_0xbc8f('0x43')](function(_0x12e6ed){_0x14cbf1(_0x12e6ed);});}});};Fax[_0xbc8f('0x1d')][_0xbc8f('0x6e')]=function(_0x1af91d){return!_['isNil'](_0x1af91d)&&!_[_0xbc8f('0x6f')](_0x1af91d['name'])&&!_[_0xbc8f('0x6f')](_0x1af91d[_0xbc8f('0x70')])&&_0x1af91d[_0xbc8f('0x70')]&&!_[_0xbc8f('0x6f')](this[_0xbc8f('0x11')][util[_0xbc8f('0x65')](_0xbc8f('0x71'),_0x1af91d[_0xbc8f('0x27')])])&&!_[_0xbc8f('0x6f')](this[_0xbc8f('0x11')][util['format'](_0xbc8f('0x71'),_0x1af91d['name'])][_0xbc8f('0x31')])&&(this[_0xbc8f('0x11')][util[_0xbc8f('0x65')]('SIP/%s',_0x1af91d['name'])][_0xbc8f('0x31')]==='reachable'||this[_0xbc8f('0x11')][util[_0xbc8f('0x65')]('SIP/%s',_0x1af91d[_0xbc8f('0x27')])][_0xbc8f('0x31')]==='unmonitored');};Fax[_0xbc8f('0x1d')][_0xbc8f('0x61')]=function(_0x3ea8ed,_0x436038){if(!this['isTrunkReachable'](_0x3ea8ed)){ut[_0xbc8f('0x4c')](_0xbc8f('0x72'),_[_0xbc8f('0x6f')](_0x3ea8ed)?'':_0x3ea8ed[_0xbc8f('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_['isNil'](_0x436038['fax'])){ut[_0xbc8f('0x4c')](_0xbc8f('0x73'),JSON['stringify'](_0x436038));return{'isValid':![],'message':_0xbc8f('0x74')};}if(_[_0xbc8f('0x6f')](_0x436038[_0xbc8f('0x4')])){ut[_0xbc8f('0x4c')](_0xbc8f('0x75'),JSON['stringify'](_0x436038));return{'isValid':![],'message':_0xbc8f('0x76')};}return{'isValid':!![],'message':_0xbc8f('0x77')};};module[_0xbc8f('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 12498cd..21368c9 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 _0x4d04=['[Notify]\x20','lodash','../rpc/faxAccount','inspect','resolve','then','catch'];(function(_0x18af5d,_0x22cbbf){var _0x7540dc=function(_0x225b41){while(--_0x225b41){_0x18af5d['push'](_0x18af5d['shift']());}};_0x7540dc(++_0x22cbbf);}(_0x4d04,0x10b));var _0x44d0=function(_0x25536a,_0x1c8b6c){_0x25536a=_0x25536a-0x0;var _0x4658e4=_0x4d04[_0x25536a];return _0x4658e4;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0x44d0('0x0'));var faxAccount=require(_0x44d0('0x1'));function loggerCatch(_0xaecf59){return function(_0x3fabd1){logger['error'](_0xaecf59,util[_0x44d0('0x2')](_0x3fabd1,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x47b0e5,_0x413949){return BPromise[_0x44d0('0x3')]()[_0x44d0('0x4')](faxAccount['notify'](_0x47b0e5,_0x413949))[_0x44d0('0x5')](loggerCatch(_0x44d0('0x6')));}; \ No newline at end of file +var _0x313b=['[Notify]\x20','bluebird','../../../config/logger','preview','error','inspect','notify','then'];(function(_0x4a6c67,_0x188093){var _0x10f560=function(_0x451dc0){while(--_0x451dc0){_0x4a6c67['push'](_0x4a6c67['shift']());}};_0x10f560(++_0x188093);}(_0x313b,0x171));var _0xb313=function(_0xd0998c,_0x3dc756){_0xd0998c=_0xd0998c-0x0;var _0x3b55d5=_0x313b[_0xd0998c];return _0x3b55d5;};'use strict';var util=require('util');var BPromise=require(_0xb313('0x0'));var logger=require(_0xb313('0x1'))(_0xb313('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x3ee874){return function(_0x2864e7){logger[_0xb313('0x3')](_0x3ee874,util[_0xb313('0x4')](_0x2864e7,{'showHidden':![],'depth':null}));};}exports[_0xb313('0x5')]=function(_0x521ac8,_0x821666){return BPromise['resolve']()[_0xb313('0x6')](faxAccount[_0xb313('0x5')](_0x521ac8,_0x821666))['catch'](loggerCatch(_0xb313('0x7')));}; \ 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 ec14b7c..ec0707b 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 _0xd8e4=['../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x4da75a,_0x3ffca8){var _0x516a79=function(_0x5c9d8a){while(--_0x5c9d8a){_0x4da75a['push'](_0x4da75a['shift']());}};_0x516a79(++_0x3ffca8);}(_0xd8e4,0x117));var _0x4d8e=function(_0x500b95,_0x1c12c5){_0x500b95=_0x500b95-0x0;var _0x6befc4=_0xd8e4[_0x500b95];return _0x6befc4;};'use strict';var util=require('util');var logger=require(_0x4d8e('0x0'))(_0x4d8e('0x1'));var BPromise=require(_0x4d8e('0x2'));var exec=require('child_process')[_0x4d8e('0x3')];exports[_0x4d8e('0x4')]=function(_0x49eeb8){return new BPromise(function(_0x39aff8,_0x44e392){exec(_0x49eeb8,function(_0x5e1d66,_0x1da4e8,_0x5f1b49){logger[_0x4d8e('0x5')](_0x4d8e('0x6'),_0x1da4e8);if(_0x5e1d66){logger[_0x4d8e('0x5')](_0x4d8e('0x6'),_0x4d8e('0x7'),util[_0x4d8e('0x8')](_0x5e1d66,{'showHidden':![],'depth':null}),_0x1da4e8,_0x5f1b49);_0x44e392(_0x5e1d66);}_0x39aff8(_0x1da4e8);});});}; \ No newline at end of file +var _0x2ecc=['info','Exec\x20gs','util','../../../../config/logger','bluebird','child_process','exec'];(function(_0x173a78,_0x10e882){var _0x4ae2e1=function(_0x392622){while(--_0x392622){_0x173a78['push'](_0x173a78['shift']());}};_0x4ae2e1(++_0x10e882);}(_0x2ecc,0x19f));var _0xc2ec=function(_0x3d424d,_0x49a490){_0x3d424d=_0x3d424d-0x0;var _0x8e139d=_0x2ecc[_0x3d424d];return _0x8e139d;};'use strict';var util=require(_0xc2ec('0x0'));var logger=require(_0xc2ec('0x1'))('fax');var BPromise=require(_0xc2ec('0x2'));var exec=require(_0xc2ec('0x3'))[_0xc2ec('0x4')];exports['execute']=function(_0x5f29ac){return new BPromise(function(_0x9eacdd,_0x1c83d1){exec(_0x5f29ac,function(_0x5317d8,_0xc9798c,_0x4d2827){logger[_0xc2ec('0x5')](_0xc2ec('0x6'),_0xc9798c);if(_0x5317d8){logger[_0xc2ec('0x5')](_0xc2ec('0x6'),'\x20Error\x20:',util['inspect'](_0x5317d8,{'showHidden':![],'depth':null}),_0xc9798c,_0x4d2827);_0x1c83d1(_0x5317d8);}_0x9eacdd(_0xc9798c);});});}; \ 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 4c79f6f..19649a3 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 _0xdcdc=['channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','t38timeout','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdcdc,0x8f));var _0xcdcd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdcdc[_0x502c7d];return _0x30b7ed;};'use strict';var util=require('util');var _=require(_0xcdcd('0x0'));var moment=require(_0xcdcd('0x1'));var logger=require(_0xcdcd('0x2'))(_0xcdcd('0x3'));exports[_0xcdcd('0x4')]=function(_0x171191){return{'message':_0x171191};};exports[_0xcdcd('0x5')]=function(_0x37f157,_0x1e92ad){logger[_0xcdcd('0x6')](_0x37f157,util[_0xcdcd('0x7')](_0x1e92ad,{'showHidden':![],'depth':null}));};exports[_0xcdcd('0x8')]=function(_0x8b0f0d,_0x4c7f91){var _0x4871a8={'XMF-ECM':_0x4c7f91[_0xcdcd('0x9')],'XMF-HEADERINFO':_0x4c7f91[_0xcdcd('0xa')],'XMF-MINRATE':_0x4c7f91[_0xcdcd('0xb')],'XMF-MAXRATE':_0x4c7f91[_0xcdcd('0xc')],'XMF-MODEM':util[_0xcdcd('0xd')](_0xcdcd('0xe'),_0x4c7f91['modem']),'XMF-GATEWAY':_0x4c7f91[_0xcdcd('0xf')],'XMF-FAXDETECT':_0x4c7f91['faxdetect'],'XMF-T38TIMEOUT':_0x4c7f91[_0xcdcd('0x10')],'XMF-LOCALSTATIONID':_0x4c7f91['localstationid'],'XMF-PATH':_0x8b0f0d['path']};return _0x4871a8;};exports['variablesAction']=function(_0x3f8827,_0x1d1abc){return{'actionid':_0x3f8827[_0xcdcd('0x11')],'action':'originate','channel':_0x3f8827[_0xcdcd('0x12')],'Exten':_0xcdcd('0x13'),'Context':_0xcdcd('0x14'),'Priority':'1','callerid':util[_0xcdcd('0xd')](_0xcdcd('0x15'),_0x3f8827[_0xcdcd('0xa')]?_0x3f8827['headerinfo']:'',_0x3f8827[_0xcdcd('0x16')]),'variable':_0x1d1abc,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3f8827['uniqueid']};}; \ No newline at end of file +var _0xc9f8=['originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','uniqueid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','minrate','maxrate','format','\x22%s\x22','modem','t38timeout','localstationid','path'];(function(_0x3887e2,_0x1062bf){var _0x3d9177=function(_0x432a5b){while(--_0x432a5b){_0x3887e2['push'](_0x3887e2['shift']());}};_0x3d9177(++_0x1062bf);}(_0xc9f8,0x15f));var _0x8c9f=function(_0x30ac61,_0x5ee006){_0x30ac61=_0x30ac61-0x0;var _0x4d6841=_0xc9f8[_0x30ac61];return _0x4d6841;};'use strict';var util=require(_0x8c9f('0x0'));var _=require(_0x8c9f('0x1'));var moment=require(_0x8c9f('0x2'));var logger=require(_0x8c9f('0x3'))(_0x8c9f('0x4'));exports[_0x8c9f('0x5')]=function(_0x358678){return{'message':_0x358678};};exports[_0x8c9f('0x6')]=function(_0x3047de,_0x2b9ef0){logger[_0x8c9f('0x7')](_0x3047de,util['inspect'](_0x2b9ef0,{'showHidden':![],'depth':null}));};exports[_0x8c9f('0x8')]=function(_0x48f75b,_0xb029a0){var _0x539c94={'XMF-ECM':_0xb029a0['ecm'],'XMF-HEADERINFO':_0xb029a0['headerinfo'],'XMF-MINRATE':_0xb029a0[_0x8c9f('0x9')],'XMF-MAXRATE':_0xb029a0[_0x8c9f('0xa')],'XMF-MODEM':util[_0x8c9f('0xb')](_0x8c9f('0xc'),_0xb029a0[_0x8c9f('0xd')]),'XMF-GATEWAY':_0xb029a0['gateway'],'XMF-FAXDETECT':_0xb029a0['faxdetect'],'XMF-T38TIMEOUT':_0xb029a0[_0x8c9f('0xe')],'XMF-LOCALSTATIONID':_0xb029a0[_0x8c9f('0xf')],'XMF-PATH':_0x48f75b[_0x8c9f('0x10')]};return _0x539c94;};exports['variablesAction']=function(_0x9db343,_0x2c43dd){return{'actionid':_0x9db343['uniqueid'],'action':_0x8c9f('0x11'),'channel':_0x9db343['channel'],'Exten':_0x8c9f('0x12'),'Context':_0x8c9f('0x13'),'Priority':'1','callerid':util[_0x8c9f('0xb')](_0x8c9f('0x14'),_0x9db343[_0x8c9f('0x15')]?_0x9db343[_0x8c9f('0x15')]:'',_0x9db343[_0x8c9f('0xf')]),'variable':_0x2c43dd,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x9db343[_0x8c9f('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index b926a0c..e363d50 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 _0x71f5=['./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','then','initAgents','getTelephones','getTrunks','initTrunks','initVoiceQueues','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','listen','catch','bluebird','util','moment','./server','./report','./acw','./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/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger'];(function(_0xea22ad,_0x42ce50){var _0x3505e4=function(_0x107985){while(--_0x107985){_0xea22ad['push'](_0xea22ad['shift']());}};_0x3505e4(++_0x42ce50);}(_0x71f5,0x1bc));var _0x571f=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0x71f5[_0x573c9e];return _0x5d0714;};'use strict';var BPromise=require(_0x571f('0x0'));var util=require(_0x571f('0x1'));var moment=require(_0x571f('0x2'));var server=require(_0x571f('0x3'));var Realtime=require('./realtime');var Report=require(_0x571f('0x4'));var Acw=require(_0x571f('0x5'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x571f('0x6'));var Fax=require(_0x571f('0x7'));var user=require(_0x571f('0x8'));var voiceQueue=require(_0x571f('0x9'));var voiceQueueReport=require(_0x571f('0xa'));var voiceCallReport=require(_0x571f('0xb'));var trunk=require(_0x571f('0xc'));var trigger=require(_0x571f('0xd'));var template=require(_0x571f('0xe'));var cmHopperHistory=require(_0x571f('0xf'));var campaign=require(_0x571f('0x10'));var voiceExtension=require(_0x571f('0x11'));var faxAccount=require(_0x571f('0x12'));var zendesk=require(_0x571f('0x13'));var salesforce=require(_0x571f('0x14'));var sugarcrm=require(_0x571f('0x15'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x571f('0x16'));var zoho=require(_0x571f('0x17'));var vtiger=require(_0x571f('0x18'));var freshsales=require(_0x571f('0x19'));var servicenow=require(_0x571f('0x1a'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x571f('0x1b')](_0x571f('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x571f('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x571f('0x1d')]()['then'](user['getAgents']())[_0x571f('0x1e')](realtime[_0x571f('0x1f')]())[_0x571f('0x1e')](user[_0x571f('0x20')]())['then'](realtime['initTelephones']())[_0x571f('0x1e')](trunk[_0x571f('0x21')]())[_0x571f('0x1e')](realtime[_0x571f('0x22')]())[_0x571f('0x1e')](voiceQueue['getVoiceQueues']())[_0x571f('0x1e')](realtime[_0x571f('0x23')]())['then'](trigger['getTriggers']())['then'](realtime['initTriggers']())[_0x571f('0x1e')](template['getTemplates']())['then'](realtime[_0x571f('0x24')]())[_0x571f('0x1e')](zendesk[_0x571f('0x25')]())['then'](realtime[_0x571f('0x26')]())[_0x571f('0x1e')](salesforce[_0x571f('0x27')]())[_0x571f('0x1e')](realtime[_0x571f('0x28')]())[_0x571f('0x1e')](sugarcrm[_0x571f('0x29')]())[_0x571f('0x1e')](realtime['initSugarcrmAccounts']())[_0x571f('0x1e')](freshdesk[_0x571f('0x2a')]())[_0x571f('0x1e')](realtime['initFreshdeskAccounts']())[_0x571f('0x1e')](desk[_0x571f('0x2b')]())[_0x571f('0x1e')](realtime[_0x571f('0x2c')]())[_0x571f('0x1e')](zoho['getZohoAccounts']())[_0x571f('0x1e')](realtime[_0x571f('0x2d')]())[_0x571f('0x1e')](vtiger[_0x571f('0x2e')]())[_0x571f('0x1e')](realtime[_0x571f('0x2f')]())['then'](freshsales[_0x571f('0x30')]())[_0x571f('0x1e')](realtime[_0x571f('0x31')]())[_0x571f('0x1e')](servicenow[_0x571f('0x32')]())[_0x571f('0x1e')](realtime[_0x571f('0x33')]())[_0x571f('0x1e')](dynamics365[_0x571f('0x34')]())['then'](realtime[_0x571f('0x35')]())['then'](campaign[_0x571f('0x36')]())[_0x571f('0x1e')](realtime[_0x571f('0x37')]())['then'](voiceExtension[_0x571f('0x38')]())[_0x571f('0x1e')](realtime[_0x571f('0x39')]())[_0x571f('0x1e')](faxAccount[_0x571f('0x3a')]())[_0x571f('0x1e')](realtime['initFaxAccounts']())[_0x571f('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x571f('0x1d')]()[_0x571f('0x1e')](voiceQueueReport[_0x571f('0x3b')]())[_0x571f('0x1e')](realtime[_0x571f('0x3c')]())[_0x571f('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x571f('0x1e')](realtime[_0x571f('0x3d')]())[_0x571f('0x1e')](cmHopperHistory[_0x571f('0x3e')]())[_0x571f('0x1e')](realtime[_0x571f('0x3f')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x571f('0x1e')](realtime[_0x571f('0x40')]())[_0x571f('0x1e')](function(_0x3b8fd6){})['catch'](function(_0x28138f){console['log'](_0x28138f);});}function main(){return server[_0x571f('0x41')](realtime,preview,fax)[_0x571f('0x1e')](function(_0x153143){return initRealtime();})[_0x571f('0x1e')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x571f('0x42')](function(_0x211072){console['log'](_0x211072);});}main(); \ No newline at end of file +var _0x196b=['hour','get','initAgents','then','getTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365'];(function(_0x413db1,_0x45de87){var _0x4b9acb=function(_0x3311ab){while(--_0x3311ab){_0x413db1['push'](_0x413db1['shift']());}};_0x4b9acb(++_0x45de87);}(_0x196b,0x1b8));var _0xb196=function(_0x31b0bd,_0x1adb4c){_0x31b0bd=_0x31b0bd-0x0;var _0x4e1e7a=_0x196b[_0x31b0bd];return _0x4e1e7a;};'use strict';var BPromise=require(_0xb196('0x0'));var util=require(_0xb196('0x1'));var moment=require('moment');var server=require(_0xb196('0x2'));var Realtime=require(_0xb196('0x3'));var Report=require(_0xb196('0x4'));var Acw=require(_0xb196('0x5'));var Trigger=require(_0xb196('0x6'));var Dialer=require(_0xb196('0x7'));var Preview=require('./preview');var Fax=require(_0xb196('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xb196('0x9'));var voiceQueueReport=require(_0xb196('0xa'));var voiceCallReport=require(_0xb196('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0xb196('0xc'));var campaign=require(_0xb196('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xb196('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xb196('0xf'));var freshdesk=require(_0xb196('0x10'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xb196('0x11'));var vtiger=require(_0xb196('0x12'));var freshsales=require(_0xb196('0x13'));var servicenow=require(_0xb196('0x14'));var dynamics365=require(_0xb196('0x15'));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()['get'](_0xb196('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xb196('0x17')](_0xb196('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user['getAgents']())['then'](realtime[_0xb196('0x18')]())[_0xb196('0x19')](user[_0xb196('0x1a')]())['then'](realtime['initTelephones']())['then'](trunk[_0xb196('0x1b')]())[_0xb196('0x19')](realtime[_0xb196('0x1c')]())['then'](voiceQueue['getVoiceQueues']())[_0xb196('0x19')](realtime[_0xb196('0x1d')]())[_0xb196('0x19')](trigger[_0xb196('0x1e')]())[_0xb196('0x19')](realtime['initTriggers']())['then'](template[_0xb196('0x1f')]())[_0xb196('0x19')](realtime['initTemplates']())[_0xb196('0x19')](zendesk[_0xb196('0x20')]())['then'](realtime[_0xb196('0x21')]())[_0xb196('0x19')](salesforce[_0xb196('0x22')]())[_0xb196('0x19')](realtime[_0xb196('0x23')]())[_0xb196('0x19')](sugarcrm[_0xb196('0x24')]())[_0xb196('0x19')](realtime[_0xb196('0x25')]())[_0xb196('0x19')](freshdesk[_0xb196('0x26')]())[_0xb196('0x19')](realtime[_0xb196('0x27')]())['then'](desk[_0xb196('0x28')]())['then'](realtime['initDeskAccounts']())[_0xb196('0x19')](zoho['getZohoAccounts']())[_0xb196('0x19')](realtime[_0xb196('0x29')]())[_0xb196('0x19')](vtiger[_0xb196('0x2a')]())[_0xb196('0x19')](realtime[_0xb196('0x2b')]())[_0xb196('0x19')](freshsales[_0xb196('0x2c')]())[_0xb196('0x19')](realtime[_0xb196('0x2d')]())['then'](servicenow['getServicenowAccounts']())[_0xb196('0x19')](realtime[_0xb196('0x2e')]())[_0xb196('0x19')](dynamics365[_0xb196('0x2f')]())['then'](realtime[_0xb196('0x30')]())[_0xb196('0x19')](campaign[_0xb196('0x31')]())[_0xb196('0x19')](realtime[_0xb196('0x32')]())[_0xb196('0x19')](voiceExtension['getVoiceExtensions']())[_0xb196('0x19')](realtime[_0xb196('0x33')]())[_0xb196('0x19')](faxAccount[_0xb196('0x34')]())[_0xb196('0x19')](realtime[_0xb196('0x35')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xb196('0x36')]()[_0xb196('0x19')](voiceQueueReport['getVoiceQueueReports']())[_0xb196('0x19')](realtime[_0xb196('0x37')]())[_0xb196('0x19')](cmHopperHistory[_0xb196('0x38')]())[_0xb196('0x19')](realtime[_0xb196('0x39')]())[_0xb196('0x19')](cmHopperHistory[_0xb196('0x3a')]())[_0xb196('0x19')](realtime[_0xb196('0x3b')]())['then'](voiceCallReport[_0xb196('0x3c')]())['then'](realtime[_0xb196('0x3d')]())[_0xb196('0x19')](function(_0x183c7e){})[_0xb196('0x3e')](function(_0x49f10c){console[_0xb196('0x3f')](_0x49f10c);});}function main(){return server[_0xb196('0x40')](realtime,preview,fax)[_0xb196('0x19')](function(_0x4a5b48){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0xb196('0x41')]();setInterval(initRealtime,0x1388);})[_0xb196('0x3e')](function(_0x33cf70){console['log'](_0x33cf70);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 260a47e..1c64971 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 _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x1de7e8,_0x355ee5){var _0x41b9ea=function(_0x4742eb){while(--_0x4742eb){_0x1de7e8['push'](_0x1de7e8['shift']());}};_0x41b9ea(++_0x355ee5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file +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(_0x452862,_0x41daee){var _0x136fc2=function(_0x511328){while(--_0x511328){_0x452862['push'](_0x452862['shift']());}};_0x136fc2(++_0x41daee);}(_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 diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 3b27b1f..bfb0667 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 _0xbcaf=['dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x518e15,_0x568735){var _0x3bd658=function(_0x6a579f){while(--_0x6a579f){_0x518e15['push'](_0x518e15['shift']());}};_0x3bd658(++_0x568735);}(_0xbcaf,0xcf));var _0xfbca=function(_0x55ddee,_0x1c80ad){_0x55ddee=_0x55ddee-0x0;var _0x3fc0c9=_0xbcaf[_0x55ddee];return _0x3fc0c9;};'use strict';function Campaign(_0x1b298d){this['id']=_0x1b298d['id']||0x0;this['name']=_0x1b298d['name']||'';this[_0xfbca('0x0')]=_0x1b298d[_0xfbca('0x0')]||'campaign';this[_0xfbca('0x1')]=0x0;this[_0xfbca('0x2')]=0x0;this[_0xfbca('0x3')]=0x0;this[_0xfbca('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x1b298d[_0xfbca('0x5')];this['limitCalls']=_0x1b298d[_0xfbca('0x6')];this[_0xfbca('0x7')]=_0x1b298d[_0xfbca('0x7')]||null;this[_0xfbca('0x8')]=_0x1b298d[_0xfbca('0x8')]?_0x1b298d[_0xfbca('0x8')]:null;this['dialOriginateCallerIdName']=_0x1b298d[_0xfbca('0x9')];this[_0xfbca('0xa')]=_0x1b298d['dialOriginateCallerIdNumber'];this[_0xfbca('0xb')]=_0x1b298d[_0xfbca('0xb')]||0x1e;this[_0xfbca('0xc')]=_0x1b298d['dialCongestionMaxRetry'];this[_0xfbca('0xd')]=_0x1b298d[_0xfbca('0xd')];this[_0xfbca('0xe')]=_0x1b298d[_0xfbca('0xe')];this['dialBusyRetryFrequency']=_0x1b298d[_0xfbca('0xf')];this[_0xfbca('0x10')]=_0x1b298d[_0xfbca('0x10')];this[_0xfbca('0x11')]=_0x1b298d[_0xfbca('0x11')];this[_0xfbca('0x12')]=_0x1b298d['dialGlobalMaxRetry'];this[_0xfbca('0x13')]=_0x1b298d['dialNoSuchNumberMaxRetry']||0x3;this[_0xfbca('0x14')]=_0x1b298d['dialNoSuchNumberRetryFrequency']||0x96;this[_0xfbca('0x15')]=_0x1b298d['dialDropMaxRetry']||0x3;this[_0xfbca('0x16')]=_0x1b298d['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x1b298d['dialAbandonedMaxRetry']||0x3;this[_0xfbca('0x17')]=_0x1b298d['dialAbandonedRetryFrequency']||0x96;this[_0xfbca('0x18')]=_0x1b298d['dialMachineMaxRetry']||0x3;this[_0xfbca('0x19')]=_0x1b298d[_0xfbca('0x19')]||0x96;this[_0xfbca('0x1a')]=_0x1b298d[_0xfbca('0x1a')]||0x3;this[_0xfbca('0x1b')]=_0x1b298d[_0xfbca('0x1b')]||0x96;this[_0xfbca('0x1c')]=_0x1b298d[_0xfbca('0x1c')]||'DESC';this[_0xfbca('0x1d')]=_0x1b298d[_0xfbca('0x1d')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1b298d[_0xfbca('0x1e')]||undefined;this[_0xfbca('0x1f')]=_0x1b298d[_0xfbca('0x1f')]||undefined;this['TrunkBackup']=_0x1b298d['TrunkBackup']?_0x1b298d[_0xfbca('0x20')]:undefined;this['Trunk']=_0x1b298d[_0xfbca('0x21')]?_0x1b298d[_0xfbca('0x21')]:undefined;this['Interval']=_0x1b298d['Interval']?_0x1b298d['Interval']:undefined;this[_0xfbca('0x22')]=_0x1b298d['SquareProject']?_0x1b298d['SquareProject']:undefined;this['dialQueueProject']=_0x1b298d['SquareProject']?_0x1b298d[_0xfbca('0x22')][_0xfbca('0x23')]:undefined;this[_0xfbca('0x24')]=_0x1b298d[_0xfbca('0x24')]||![];this['dialAMDInitialSilence']=_0x1b298d[_0xfbca('0x25')];this[_0xfbca('0x26')]=_0x1b298d[_0xfbca('0x26')];this['dialAMDAfterGreetingSilence']=_0x1b298d[_0xfbca('0x27')];this[_0xfbca('0x28')]=_0x1b298d['dialAMDTotalAnalysisTime'];this[_0xfbca('0x29')]=_0x1b298d[_0xfbca('0x29')];this[_0xfbca('0x2a')]=_0x1b298d['dialAMDBetweenWordsSilence'];this[_0xfbca('0x2b')]=_0x1b298d[_0xfbca('0x2b')];this[_0xfbca('0x2c')]=_0x1b298d[_0xfbca('0x2c')];this[_0xfbca('0x2d')]=_0x1b298d[_0xfbca('0x2d')];}module[_0xfbca('0x2e')]=Campaign; \ No newline at end of file +var _0x1a8e=['Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0x1a8e,0x15c));var _0xe1a8=function(_0x51951a,_0x14e19f){_0x51951a=_0x51951a-0x0;var _0x57274e=_0x1a8e[_0x51951a];return _0x57274e;};'use strict';function Campaign(_0x542527){this['id']=_0x542527['id']||0x0;this[_0xe1a8('0x0')]=_0x542527[_0xe1a8('0x0')]||'';this[_0xe1a8('0x1')]=_0x542527[_0xe1a8('0x1')]||_0xe1a8('0x2');this[_0xe1a8('0x3')]=0x0;this[_0xe1a8('0x4')]=0x0;this[_0xe1a8('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xe1a8('0x6')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x542527[_0xe1a8('0x7')];this[_0xe1a8('0x8')]=_0x542527[_0xe1a8('0x8')];this['dialTimezone']=_0x542527[_0xe1a8('0x9')]||null;this[_0xe1a8('0xa')]=_0x542527[_0xe1a8('0xa')]?_0x542527[_0xe1a8('0xa')]:null;this['dialOriginateCallerIdName']=_0x542527[_0xe1a8('0xb')];this['dialOriginateCallerIdNumber']=_0x542527[_0xe1a8('0xc')];this['dialOriginateTimeout']=_0x542527[_0xe1a8('0xd')]||0x1e;this[_0xe1a8('0xe')]=_0x542527[_0xe1a8('0xe')];this[_0xe1a8('0xf')]=_0x542527['dialCongestionRetryFrequency'];this[_0xe1a8('0x10')]=_0x542527[_0xe1a8('0x10')];this[_0xe1a8('0x11')]=_0x542527[_0xe1a8('0x11')];this[_0xe1a8('0x12')]=_0x542527[_0xe1a8('0x12')];this[_0xe1a8('0x13')]=_0x542527['dialNoAnswerRetryFrequency'];this[_0xe1a8('0x14')]=_0x542527[_0xe1a8('0x14')];this[_0xe1a8('0x15')]=_0x542527[_0xe1a8('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x542527['dialNoSuchNumberRetryFrequency']||0x96;this[_0xe1a8('0x16')]=_0x542527[_0xe1a8('0x16')]||0x3;this[_0xe1a8('0x17')]=_0x542527[_0xe1a8('0x17')]||0x96;this[_0xe1a8('0x18')]=_0x542527[_0xe1a8('0x18')]||0x3;this[_0xe1a8('0x19')]=_0x542527[_0xe1a8('0x19')]||0x96;this[_0xe1a8('0x1a')]=_0x542527['dialMachineMaxRetry']||0x3;this[_0xe1a8('0x1b')]=_0x542527['dialMachineRetryFrequency']||0x96;this[_0xe1a8('0x1c')]=_0x542527[_0xe1a8('0x1c')]||0x3;this[_0xe1a8('0x1d')]=_0x542527[_0xe1a8('0x1d')]||0x96;this[_0xe1a8('0x1e')]=_0x542527[_0xe1a8('0x1e')]||_0xe1a8('0x1f');this[_0xe1a8('0x20')]=_0x542527[_0xe1a8('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x542527[_0xe1a8('0x21')]||undefined;this[_0xe1a8('0x22')]=_0x542527['dialCutDigit']||undefined;this[_0xe1a8('0x23')]=_0x542527[_0xe1a8('0x23')]?_0x542527['TrunkBackup']:undefined;this['Trunk']=_0x542527['Trunk']?_0x542527['Trunk']:undefined;this['Interval']=_0x542527[_0xe1a8('0x24')]?_0x542527[_0xe1a8('0x24')]:undefined;this['SquareProject']=_0x542527[_0xe1a8('0x25')]?_0x542527['SquareProject']:undefined;this['dialQueueProject']=_0x542527[_0xe1a8('0x25')]?_0x542527[_0xe1a8('0x25')][_0xe1a8('0x0')]:undefined;this[_0xe1a8('0x26')]=_0x542527[_0xe1a8('0x26')]||![];this[_0xe1a8('0x27')]=_0x542527[_0xe1a8('0x27')];this['dialAMDGreeting']=_0x542527[_0xe1a8('0x28')];this[_0xe1a8('0x29')]=_0x542527[_0xe1a8('0x29')];this['dialAMDTotalAnalysisTime']=_0x542527['dialAMDTotalAnalysisTime'];this[_0xe1a8('0x2a')]=_0x542527[_0xe1a8('0x2a')];this[_0xe1a8('0x2b')]=_0x542527[_0xe1a8('0x2b')];this[_0xe1a8('0x2c')]=_0x542527[_0xe1a8('0x2c')];this[_0xe1a8('0x2d')]=_0x542527['dialAMDSilenceThreshold'];this[_0xe1a8('0x2e')]=_0x542527[_0xe1a8('0x2e')];}module[_0xe1a8('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 160df5a..34ef263 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 _0x5288=['unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','disposition','monitorFilename','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','linkedid','exten','answered','endtime'];(function(_0x4658d9,_0x4b695e){var _0x3a5386=function(_0x5976f7){while(--_0x5976f7){_0x4658d9['push'](_0x4658d9['shift']());}};_0x3a5386(++_0x4b695e);}(_0x5288,0x1ed));var _0x8528=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x5288[_0x4a3898];return _0x25ceb0;};'use strict';function Channel(){this[_0x8528('0x0')]=null;this['channel']='';this[_0x8528('0x1')]='';this[_0x8528('0x2')]=0x0;this[_0x8528('0x3')]='';this[_0x8528('0x4')]=undefined;this[_0x8528('0x5')]=undefined;this[_0x8528('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x8528('0x7')]=0x0;this[_0x8528('0x8')]=0x0;this[_0x8528('0x9')]=![];this['answertime']=null;this[_0x8528('0xa')]=null;this[_0x8528('0xb')]=![];this[_0x8528('0xc')]=![];this[_0x8528('0xd')]='';this[_0x8528('0xe')]='';this[_0x8528('0xf')]=0x0;this[_0x8528('0x10')]=0x0;this[_0x8528('0x11')]=0x0;this['type']=null;this['tag']=null;this[_0x8528('0x12')]=null;this['monitor']=![];this[_0x8528('0x13')]=null;this['queue']=null;this['monitors']=[];this[_0x8528('0x14')]=undefined;this[_0x8528('0x15')]=undefined;this[_0x8528('0x16')]=undefined;this['mohtime']=0x0;}module[_0x8528('0x17')]=Channel; \ No newline at end of file +var _0x0c19=['lastdata','duration','billableseconds','type','tag','monitor','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','exten','answered','endtime','unmanaged','abandoned','lastapplication'];(function(_0x3e1e6a,_0x310303){var _0x1d185a=function(_0x1d57dd){while(--_0x1d57dd){_0x3e1e6a['push'](_0x3e1e6a['shift']());}};_0x1d185a(++_0x310303);}(_0x0c19,0xf5));var _0x90c1=function(_0xef6aac,_0x543e4d){_0xef6aac=_0xef6aac-0x0;var _0x280b87=_0x0c19[_0xef6aac];return _0x280b87;};'use strict';function Channel(){this[_0x90c1('0x0')]=null;this[_0x90c1('0x1')]='';this[_0x90c1('0x2')]='';this[_0x90c1('0x3')]=0x0;this[_0x90c1('0x4')]='';this[_0x90c1('0x5')]=undefined;this['connectedlinename']=undefined;this[_0x90c1('0x6')]=0x0;this[_0x90c1('0x7')]='';this[_0x90c1('0x8')]=0x0;this['linkedid']=0x0;this[_0x90c1('0x9')]=0x0;this[_0x90c1('0xa')]=![];this['answertime']=null;this[_0x90c1('0xb')]=null;this[_0x90c1('0xc')]=![];this[_0x90c1('0xd')]=![];this[_0x90c1('0xe')]='';this[_0x90c1('0xf')]='';this[_0x90c1('0x10')]=0x0;this[_0x90c1('0x11')]=0x0;this['holdtime']=0x0;this[_0x90c1('0x12')]=null;this[_0x90c1('0x13')]=null;this['disposition']=null;this[_0x90c1('0x14')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x90c1('0x15')]=[];this['transfercalleridnum']=undefined;this[_0x90c1('0x16')]=undefined;this[_0x90c1('0x17')]=undefined;this[_0x90c1('0x18')]=0x0;}module[_0x90c1('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 9779c3e..26a799d 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 _0xc1ab=['tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xc1ab,0x131));var _0xbc1a=function(_0x46833b,_0x3c0859){_0x46833b=_0x46833b-0x0;var _0x2ba218=_0xc1ab[_0x46833b];return _0x2ba218;};'use strict';function DeskAccount(_0x43af56){this['id']=_0x43af56['id']||0x0;this['name']=_0x43af56['name']||'';this[_0xbc1a('0x0')]=_0x43af56[_0xbc1a('0x0')]||'';this['remoteUri']=_0x43af56[_0xbc1a('0x1')]||'';this[_0xbc1a('0x2')]=_0x43af56[_0xbc1a('0x2')]||'';this[_0xbc1a('0x3')]=_0x43af56[_0xbc1a('0x3')]||'';this[_0xbc1a('0x4')]=_0x43af56[_0xbc1a('0x4')]||'';this[_0xbc1a('0x5')]=_0x43af56[_0xbc1a('0x5')]||'';this[_0xbc1a('0x6')]=_0x43af56[_0xbc1a('0x6')]||'';this[_0xbc1a('0x7')]=_0x43af56[_0xbc1a('0x7')]||'';this['type']=_0x43af56[_0xbc1a('0x8')]||'';this[_0xbc1a('0x9')]=_0x43af56[_0xbc1a('0x9')]||'';this[_0xbc1a('0xa')]=_0x43af56[_0xbc1a('0xa')]||{};}module[_0xbc1a('0xb')]=DeskAccount; \ No newline at end of file +var _0x789c=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name'];(function(_0x4ebbc4,_0x4bd3ab){var _0x17c498=function(_0xa45a50){while(--_0xa45a50){_0x4ebbc4['push'](_0x4ebbc4['shift']());}};_0x17c498(++_0x4bd3ab);}(_0x789c,0x107));var _0xc789=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x789c[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x46266e){this['id']=_0x46266e['id']||0x0;this[_0xc789('0x0')]=_0x46266e[_0xc789('0x0')]||'';this[_0xc789('0x1')]=_0x46266e['username']||'';this[_0xc789('0x2')]=_0x46266e[_0xc789('0x2')]||'';this[_0xc789('0x3')]=_0x46266e[_0xc789('0x3')]||'';this[_0xc789('0x4')]=_0x46266e[_0xc789('0x4')]||'';this['consumerKey']=_0x46266e[_0xc789('0x5')]||'';this[_0xc789('0x6')]=_0x46266e['consumerSecret']||'';this[_0xc789('0x7')]=_0x46266e[_0xc789('0x7')]||'';this[_0xc789('0x8')]=_0x46266e[_0xc789('0x8')]||'';this['type']=_0x46266e['type']||'';this[_0xc789('0x9')]=_0x46266e[_0xc789('0x9')]||'';this[_0xc789('0xa')]=_0x46266e['Configurations']||{};}module[_0xc789('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c15ca53..5420174 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 _0x2750=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x95ea83,_0x4a103d){var _0x1ea2f0=function(_0x2bca37){while(--_0x2bca37){_0x95ea83['push'](_0x95ea83['shift']());}};_0x1ea2f0(++_0x4a103d);}(_0x2750,0x13b));var _0x0275=function(_0x4b61ff,_0x111cfd){_0x4b61ff=_0x4b61ff-0x0;var _0x55c0b0=_0x2750[_0x4b61ff];return _0x55c0b0;};'use strict';function Dynamics365Account(_0x1c9f4d){this['id']=_0x1c9f4d['id']||0x0;this['name']=_0x1c9f4d[_0x0275('0x0')]||'';this[_0x0275('0x1')]=_0x1c9f4d[_0x0275('0x1')]||'';this[_0x0275('0x2')]=_0x1c9f4d[_0x0275('0x2')]||'';this[_0x0275('0x3')]=_0x1c9f4d[_0x0275('0x3')]||'';this[_0x0275('0x4')]=_0x1c9f4d[_0x0275('0x4')]||'';this[_0x0275('0x5')]=_0x1c9f4d['clientId']||'';this[_0x0275('0x6')]=_0x1c9f4d[_0x0275('0x6')]||{};this[_0x0275('0x7')]=_0x1c9f4d[_0x0275('0x7')]||'';this['Configurations']=_0x1c9f4d[_0x0275('0x8')]||{};}module[_0x0275('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xd64b=['exports','name','username','password','remoteUri','clientSecret','serverUrl','Configurations'];(function(_0x377813,_0x549dde){var _0x5a1ebf=function(_0x1a2715){while(--_0x1a2715){_0x377813['push'](_0x377813['shift']());}};_0x5a1ebf(++_0x549dde);}(_0xd64b,0xc1));var _0xbd64=function(_0x343dfb,_0xed8587){_0x343dfb=_0x343dfb-0x0;var _0x297fe2=_0xd64b[_0x343dfb];return _0x297fe2;};'use strict';function Dynamics365Account(_0x272488){this['id']=_0x272488['id']||0x0;this['name']=_0x272488[_0xbd64('0x0')]||'';this['username']=_0x272488[_0xbd64('0x1')]||'';this[_0xbd64('0x2')]=_0x272488[_0xbd64('0x2')]||'';this[_0xbd64('0x3')]=_0x272488[_0xbd64('0x3')]||'';this['tenantId']=_0x272488['tenantId']||'';this['clientId']=_0x272488['clientId']||'';this[_0xbd64('0x4')]=_0x272488[_0xbd64('0x4')]||{};this[_0xbd64('0x5')]=_0x272488[_0xbd64('0x5')]||'';this[_0xbd64('0x6')]=_0x272488[_0xbd64('0x6')]||{};}module[_0xbd64('0x7')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 037e751..9b7180b 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 _0xd4e3=['minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','ecm','headerinfo'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xd4e3,0x1a1));var _0x3d4e=function(_0x324915,_0x5ec142){_0x324915=_0x324915-0x0;var _0x569bad=_0xd4e3[_0x324915];return _0x569bad;};'use strict';function FaxAccount(_0xe3d1d0){this['id']=_0xe3d1d0['id']||0x0;this[_0x3d4e('0x0')]=_0xe3d1d0[_0x3d4e('0x0')]||'';this['description']=_0xe3d1d0['description'];this[_0x3d4e('0x1')]=_0xe3d1d0[_0x3d4e('0x1')];this[_0x3d4e('0x2')]=_0xe3d1d0[_0x3d4e('0x2')];this['localstationid']=_0xe3d1d0['localstationid'];this[_0x3d4e('0x3')]=_0xe3d1d0[_0x3d4e('0x3')]||0x960;this['maxrate']=_0xe3d1d0['maxrate']||0x3840;this[_0x3d4e('0x4')]=_0xe3d1d0[_0x3d4e('0x4')]||_0x3d4e('0x5');this['gateway']=_0xe3d1d0[_0x3d4e('0x6')]||'no';this[_0x3d4e('0x7')]=_0xe3d1d0[_0x3d4e('0x7')]||'no';this[_0x3d4e('0x8')]=_0xe3d1d0[_0x3d4e('0x8')]||0x1388;this[_0x3d4e('0x9')]=_0xe3d1d0[_0x3d4e('0x9')]||'SIP';this[_0x3d4e('0xa')]=_0xe3d1d0[_0x3d4e('0xa')]?_0xe3d1d0[_0x3d4e('0xa')]:undefined;this[_0x3d4e('0xb')]=_0xe3d1d0[_0x3d4e('0xb')];this[_0x3d4e('0xc')]=_0xe3d1d0[_0x3d4e('0xc')];}module[_0x3d4e('0xd')]=FaxAccount; \ No newline at end of file +var _0x0b3a=['SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x2a1fa9,_0x332bde){var _0x463350=function(_0x39ed14){while(--_0x39ed14){_0x2a1fa9['push'](_0x2a1fa9['shift']());}};_0x463350(++_0x332bde);}(_0x0b3a,0x114));var _0xa0b3=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x0b3a[_0x5ad771];return _0x5b5dce;};'use strict';function FaxAccount(_0x1b8be9){this['id']=_0x1b8be9['id']||0x0;this['name']=_0x1b8be9[_0xa0b3('0x0')]||'';this[_0xa0b3('0x1')]=_0x1b8be9[_0xa0b3('0x1')];this[_0xa0b3('0x2')]=_0x1b8be9[_0xa0b3('0x2')];this[_0xa0b3('0x3')]=_0x1b8be9[_0xa0b3('0x3')];this[_0xa0b3('0x4')]=_0x1b8be9[_0xa0b3('0x4')];this[_0xa0b3('0x5')]=_0x1b8be9['minrate']||0x960;this[_0xa0b3('0x6')]=_0x1b8be9[_0xa0b3('0x6')]||0x3840;this['modem']=_0x1b8be9[_0xa0b3('0x7')]||_0xa0b3('0x8');this['gateway']=_0x1b8be9[_0xa0b3('0x9')]||'no';this[_0xa0b3('0xa')]=_0x1b8be9[_0xa0b3('0xa')]||'no';this[_0xa0b3('0xb')]=_0x1b8be9[_0xa0b3('0xb')]||0x1388;this[_0xa0b3('0xc')]=_0x1b8be9[_0xa0b3('0xc')]||_0xa0b3('0xd');this[_0xa0b3('0xe')]=_0x1b8be9['Trunk']?_0x1b8be9[_0xa0b3('0xe')]:undefined;this[_0xa0b3('0xf')]=_0x1b8be9[_0xa0b3('0xf')];this['key']=_0x1b8be9[_0xa0b3('0x10')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 00eac6d..50a615e 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 _0xdaeb=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x1a966d,_0x440322){var _0x475c4=function(_0x4d034c){while(--_0x4d034c){_0x1a966d['push'](_0x1a966d['shift']());}};_0x475c4(++_0x440322);}(_0xdaeb,0x6d));var _0xbdae=function(_0x11cd9c,_0x40db3f){_0x11cd9c=_0x11cd9c-0x0;var _0x47bd1e=_0xdaeb[_0x11cd9c];return _0x47bd1e;};'use strict';function FreshdeskAccount(_0x4785b2){this['id']=_0x4785b2['id']||0x0;this['name']=_0x4785b2[_0xbdae('0x0')]||'';this['username']=_0x4785b2[_0xbdae('0x1')]||'';this[_0xbdae('0x2')]=_0x4785b2[_0xbdae('0x3')]||'';this[_0xbdae('0x4')]=_0x4785b2['remoteUri']||'';this[_0xbdae('0x5')]=_0x4785b2[_0xbdae('0x5')]||'';this[_0xbdae('0x6')]=_0x4785b2[_0xbdae('0x6')]||{};}module[_0xbdae('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xf5f3=['exports','name','username','apiKey','token','remoteUri','Configurations'];(function(_0x25fafc,_0xaaa662){var _0x2f6110=function(_0x3e4cc7){while(--_0x3e4cc7){_0x25fafc['push'](_0x25fafc['shift']());}};_0x2f6110(++_0xaaa662);}(_0xf5f3,0x1c1));var _0x3f5f=function(_0x16b257,_0x25b6fa){_0x16b257=_0x16b257-0x0;var _0x156f90=_0xf5f3[_0x16b257];return _0x156f90;};'use strict';function FreshdeskAccount(_0x53d0c6){this['id']=_0x53d0c6['id']||0x0;this[_0x3f5f('0x0')]=_0x53d0c6[_0x3f5f('0x0')]||'';this[_0x3f5f('0x1')]=_0x53d0c6[_0x3f5f('0x1')]||'';this[_0x3f5f('0x2')]=_0x53d0c6[_0x3f5f('0x3')]||'';this['remoteUri']=_0x53d0c6[_0x3f5f('0x4')]||'';this['serverUrl']=_0x53d0c6['serverUrl']||'';this[_0x3f5f('0x5')]=_0x53d0c6[_0x3f5f('0x5')]||{};}module[_0x3f5f('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index c461191..021037c 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 _0x038b=['name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x1124e6,_0x5db98a){var _0x2c7735=function(_0x1ffefd){while(--_0x1ffefd){_0x1124e6['push'](_0x1124e6['shift']());}};_0x2c7735(++_0x5db98a);}(_0x038b,0x114));var _0xb038=function(_0x424369,_0x2abbef){_0x424369=_0x424369-0x0;var _0x2d511d=_0x038b[_0x424369];return _0x2d511d;};'use strict';function FreshsalesAccount(_0x493b50){this['id']=_0x493b50['id']||0x0;this[_0xb038('0x0')]=_0x493b50[_0xb038('0x0')]||'';this[_0xb038('0x1')]=_0x493b50['username']||'';this[_0xb038('0x2')]=_0x493b50['token']||'';this[_0xb038('0x3')]=_0x493b50[_0xb038('0x3')]||'';this['serverUrl']=_0x493b50[_0xb038('0x4')]||'';this[_0xb038('0x5')]=_0x493b50['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xc4a1=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x341016,_0x2a6e14){var _0x426a77=function(_0x4b778d){while(--_0x4b778d){_0x341016['push'](_0x341016['shift']());}};_0x426a77(++_0x2a6e14);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x48e368,_0x771ab2){_0x48e368=_0x48e368-0x0;var _0x104bfa=_0xc4a1[_0x48e368];return _0x104bfa;};'use strict';function FreshsalesAccount(_0x47034f){this['id']=_0x47034f['id']||0x0;this['name']=_0x47034f[_0x1c4a('0x0')]||'';this[_0x1c4a('0x1')]=_0x47034f[_0x1c4a('0x1')]||'';this['apiKey']=_0x47034f[_0x1c4a('0x2')]||'';this[_0x1c4a('0x3')]=_0x47034f[_0x1c4a('0x3')]||'';this[_0x1c4a('0x4')]=_0x47034f[_0x1c4a('0x4')]||'';this[_0x1c4a('0x5')]=_0x47034f[_0x1c4a('0x5')]||{};}module[_0x1c4a('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 e195e82..3e737da 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 _0x5279=['accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','exports','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum'];(function(_0xcc0417,_0x4ec944){var _0x41efa3=function(_0x558c08){while(--_0x558c08){_0xcc0417['push'](_0xcc0417['shift']());}};_0x41efa3(++_0x4ec944);}(_0x5279,0x176));var _0x9527=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x5279[_0xc6be3a];return _0x56a310;};'use strict';function QueueReport(){this['type']=_0x9527('0x0');this[_0x9527('0x1')]='';this[_0x9527('0x2')]='';this[_0x9527('0x3')]='';this['queue']='';this[_0x9527('0x4')]=null;this[_0x9527('0x5')]=null;this[_0x9527('0x6')]=0x1;this[_0x9527('0x7')]=0x1;this[_0x9527('0x8')]=![];this[_0x9527('0x9')]=null;this[_0x9527('0xa')]=![];this[_0x9527('0xb')]=null;this[_0x9527('0xc')]=![];this['queuecallerexitAt']=null;this[_0x9527('0xd')]=0x1;this[_0x9527('0xe')]='';this[_0x9527('0xf')]='';this['connectedlinename']='';this[_0x9527('0x10')]='';this['context']='';this[_0x9527('0x11')]='';this[_0x9527('0x12')]='';this[_0x9527('0x13')]=0x0;this[_0x9527('0x14')]=![];this[_0x9527('0x15')]='';this[_0x9527('0x16')]=_0x9527('0x17');this[_0x9527('0x18')]=0x0;this['variables']={};}module[_0x9527('0x19')]=QueueReport; \ No newline at end of file +var _0xd2dd=['queuecallerexit','originalposition','channel','connectedlinename','context','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x29e207,_0x912d97){var _0x255779=function(_0x4dfe7f){while(--_0x4dfe7f){_0x29e207['push'](_0x29e207['shift']());}};_0x255779(++_0x912d97);}(_0xd2dd,0x18d));var _0xdd2d=function(_0x2a65cc,_0x1ca81f){_0x2a65cc=_0x2a65cc-0x0;var _0x186d73=_0xd2dd[_0x2a65cc];return _0x186d73;};'use strict';function QueueReport(){this[_0xdd2d('0x0')]='inbound';this[_0xdd2d('0x1')]='';this[_0xdd2d('0x2')]='';this[_0xdd2d('0x3')]='';this[_0xdd2d('0x4')]='';this[_0xdd2d('0x5')]=null;this['queuecallerleaveAt']=null;this[_0xdd2d('0x6')]=0x1;this[_0xdd2d('0x7')]=0x1;this['queuecallerabandon']=![];this[_0xdd2d('0x8')]=null;this[_0xdd2d('0x9')]=![];this[_0xdd2d('0xa')]=null;this[_0xdd2d('0xb')]=![];this['queuecallerexitAt']=null;this[_0xdd2d('0xc')]=0x1;this[_0xdd2d('0xd')]='';this['connectedlinenum']='';this[_0xdd2d('0xe')]='';this['accountcode']='';this[_0xdd2d('0xf')]='';this['exten']='';this[_0xdd2d('0x10')]='';this['holdtime']=0x0;this[_0xdd2d('0x11')]=![];this[_0xdd2d('0x12')]='';this[_0xdd2d('0x13')]=_0xdd2d('0x14');this[_0xdd2d('0x15')]=0x0;this[_0xdd2d('0x16')]={};}module[_0xdd2d('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 0b452ee..5c28fa0 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 _0xc06a=['clientId','clientSecret','type','integrationTab','Configurations','exports','name','username','remoteUri','password'];(function(_0x2061ac,_0x3ec169){var _0x2b565c=function(_0x3c3fb2){while(--_0x3c3fb2){_0x2061ac['push'](_0x2061ac['shift']());}};_0x2b565c(++_0x3ec169);}(_0xc06a,0x1be));var _0xac06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc06a[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x48a029){this['id']=_0x48a029['id']||0x0;this[_0xac06('0x0')]=_0x48a029['name']||'';this[_0xac06('0x1')]=_0x48a029['username']||'';this[_0xac06('0x2')]=_0x48a029[_0xac06('0x2')]||'';this[_0xac06('0x3')]=_0x48a029['password']||'';this['clientId']=_0x48a029[_0xac06('0x4')]||'';this[_0xac06('0x5')]=_0x48a029[_0xac06('0x5')]||'';this['securityToken']=_0x48a029['securityToken']||'';this[_0xac06('0x6')]=_0x48a029['type']||_0xac06('0x7');this['serverUrl']=_0x48a029['serverUrl']||'';this[_0xac06('0x8')]=_0x48a029[_0xac06('0x8')]||{};}module[_0xac06('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x6c8f=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x35f8aa,_0x4916f0){var _0x540eed=function(_0x2799c6){while(--_0x2799c6){_0x35f8aa['push'](_0x35f8aa['shift']());}};_0x540eed(++_0x4916f0);}(_0x6c8f,0xa1));var _0xf6c8=function(_0x238d9c,_0x23a4c5){_0x238d9c=_0x238d9c-0x0;var _0x156c87=_0x6c8f[_0x238d9c];return _0x156c87;};'use strict';function SalesforceAccount(_0x482b33){this['id']=_0x482b33['id']||0x0;this[_0xf6c8('0x0')]=_0x482b33[_0xf6c8('0x0')]||'';this[_0xf6c8('0x1')]=_0x482b33['username']||'';this[_0xf6c8('0x2')]=_0x482b33[_0xf6c8('0x2')]||'';this[_0xf6c8('0x3')]=_0x482b33[_0xf6c8('0x3')]||'';this[_0xf6c8('0x4')]=_0x482b33[_0xf6c8('0x4')]||'';this[_0xf6c8('0x5')]=_0x482b33['clientSecret']||'';this[_0xf6c8('0x6')]=_0x482b33[_0xf6c8('0x6')]||'';this[_0xf6c8('0x7')]=_0x482b33[_0xf6c8('0x7')]||_0xf6c8('0x8');this[_0xf6c8('0x9')]=_0x482b33[_0xf6c8('0x9')]||'';this[_0xf6c8('0xa')]=_0x482b33[_0xf6c8('0xa')]||{};}module[_0xf6c8('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index eacd46a..113fb61 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 _0xe230=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x143ca0,_0x586bd3){var _0x11f1c5=function(_0xe32f94){while(--_0xe32f94){_0x143ca0['push'](_0x143ca0['shift']());}};_0x11f1c5(++_0x586bd3);}(_0xe230,0x1d5));var _0x0e23=function(_0x56ae67,_0xe051db){_0x56ae67=_0x56ae67-0x0;var _0x2b480d=_0xe230[_0x56ae67];return _0x2b480d;};'use strict';function ServicenowAccount(_0x372d05){this['id']=_0x372d05['id']||0x0;this['name']=_0x372d05[_0x0e23('0x0')]||'';this[_0x0e23('0x1')]=_0x372d05[_0x0e23('0x1')]||'';this['password']=_0x372d05[_0x0e23('0x2')]||'';this[_0x0e23('0x3')]=_0x372d05[_0x0e23('0x3')]||'';this['serverUrl']=_0x372d05[_0x0e23('0x4')]||'';this[_0x0e23('0x5')]=_0x372d05['Configurations']||{};}module[_0x0e23('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xff8c=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xff8c,0xcf));var _0xcff8=function(_0x488818,_0x17c6de){_0x488818=_0x488818-0x0;var _0x30783c=_0xff8c[_0x488818];return _0x30783c;};'use strict';function ServicenowAccount(_0x35a730){this['id']=_0x35a730['id']||0x0;this['name']=_0x35a730[_0xcff8('0x0')]||'';this[_0xcff8('0x1')]=_0x35a730[_0xcff8('0x1')]||'';this[_0xcff8('0x2')]=_0x35a730[_0xcff8('0x2')]||'';this[_0xcff8('0x3')]=_0x35a730[_0xcff8('0x3')]||'';this[_0xcff8('0x4')]=_0x35a730['serverUrl']||'';this[_0xcff8('0x5')]=_0x35a730['Configurations']||{};}module[_0xcff8('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index b2aa8a4..60a067b 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 _0x04eb=['serverUrl','Configurations','name','username','remoteUri'];(function(_0x505684,_0x2c1dc9){var _0x4389b0=function(_0x86b26e){while(--_0x86b26e){_0x505684['push'](_0x505684['shift']());}};_0x4389b0(++_0x2c1dc9);}(_0x04eb,0x129));var _0xb04e=function(_0x4863d2,_0x84d14f){_0x4863d2=_0x4863d2-0x0;var _0x21e91f=_0x04eb[_0x4863d2];return _0x21e91f;};'use strict';function SugarcrmAccount(_0x1f3a6a){this['id']=_0x1f3a6a['id']||0x0;this[_0xb04e('0x0')]=_0x1f3a6a[_0xb04e('0x0')]||'';this[_0xb04e('0x1')]=_0x1f3a6a[_0xb04e('0x1')]||'';this['password']=_0x1f3a6a['password']||'';this[_0xb04e('0x2')]=_0x1f3a6a[_0xb04e('0x2')]||'';this[_0xb04e('0x3')]=_0x1f3a6a[_0xb04e('0x3')]||'';this[_0xb04e('0x4')]=_0x1f3a6a[_0xb04e('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xd8fa=['name','username','remoteUri','serverUrl','Configurations'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xd8fa,0x159));var _0xad8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8fa[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x2b9d67){this['id']=_0x2b9d67['id']||0x0;this[_0xad8f('0x0')]=_0x2b9d67['name']||'';this[_0xad8f('0x1')]=_0x2b9d67[_0xad8f('0x1')]||'';this['password']=_0x2b9d67['password']||'';this[_0xad8f('0x2')]=_0x2b9d67[_0xad8f('0x2')]||'';this[_0xad8f('0x3')]=_0x2b9d67[_0xad8f('0x3')]||'';this[_0xad8f('0x4')]=_0x2b9d67[_0xad8f('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 2de2200..9b57014 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 _0x6554=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x2b4e5d,_0x49bf74){var _0x1aabe2=function(_0x54c90c){while(--_0x54c90c){_0x2b4e5d['push'](_0x2b4e5d['shift']());}};_0x1aabe2(++_0x49bf74);}(_0x6554,0x181));var _0x4655=function(_0x3d6df7,_0x1a766b){_0x3d6df7=_0x3d6df7-0x0;var _0x54049f=_0x6554[_0x3d6df7];return _0x54049f;};'use strict';function Telephone(_0x305798){this['id']=_0x305798['id']||0x0;this[_0x4655('0x0')]=_0x305798[_0x4655('0x0')]||'';this[_0x4655('0x1')]=_0x305798[_0x4655('0x1')]||'';this[_0x4655('0x2')]=_0x4655('0x3');this[_0x4655('0x4')]=0x0;this[_0x4655('0x5')]=_0x4655('0x3');this[_0x4655('0x6')]='';}module[_0x4655('0x7')]=Telephone; \ No newline at end of file +var _0x60d7=['state','stateTime','status','unknown','address','name','accountcode'];(function(_0x2183ab,_0x50a437){var _0xd17640=function(_0x3a34b7){while(--_0x3a34b7){_0x2183ab['push'](_0x2183ab['shift']());}};_0xd17640(++_0x50a437);}(_0x60d7,0x139));var _0x760d=function(_0x29265b,_0x1d301f){_0x29265b=_0x29265b-0x0;var _0x2434be=_0x60d7[_0x29265b];return _0x2434be;};'use strict';function Telephone(_0xe99cda){this['id']=_0xe99cda['id']||0x0;this[_0x760d('0x0')]=_0xe99cda['name']||'';this[_0x760d('0x1')]=_0xe99cda['accountcode']||'';this[_0x760d('0x2')]='unknown';this[_0x760d('0x3')]=0x0;this[_0x760d('0x4')]=_0x760d('0x5');this[_0x760d('0x6')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 8a50f6b..5f24cb2 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x4beac0,_0x38e112){var _0x5c4260=function(_0xdcdb67){while(--_0xdcdb67){_0x4beac0['push'](_0x4beac0['shift']());}};_0x5c4260(++_0x38e112);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x10484f,_0x3cd78a){var _0x13023c=function(_0x143b46){while(--_0x143b46){_0x10484f['push'](_0x10484f['shift']());}};_0x13023c(++_0x3cd78a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4880fd,_0x2cc70d){_0x4880fd=_0x4880fd-0x0;var _0x4a4b50=_0xb10b[_0x4880fd];return _0x4a4b50;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index aa5f4a0..c6ca707 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 _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x25f797,_0x449916){_0x25f797=_0x25f797-0x0;var _0x157fdd=_0x5eb8[_0x25f797];return _0x157fdd;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x47e693,_0x45cc11){var _0x3f4dc2=function(_0xb64816){while(--_0xb64816){_0x47e693['push'](_0x47e693['shift']());}};_0x3f4dc2(++_0x45cc11);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f15bb,_0x4663fb){_0x1f15bb=_0x1f15bb-0x0;var _0x3a49ef=_0xb10b[_0x1f15bb];return _0x3a49ef;};'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 diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index ca575f0..02b7b16 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 _0x66b0=['status','registry','indexOf','split','host','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','name','state','unknown'];(function(_0x3893f5,_0x207595){var _0x5cf9d0=function(_0x452928){while(--_0x452928){_0x3893f5['push'](_0x3893f5['shift']());}};_0x5cf9d0(++_0x207595);}(_0x66b0,0xc0));var _0x066b=function(_0x5ef2fd,_0x116727){_0x5ef2fd=_0x5ef2fd-0x0;var _0x11b657=_0x66b0[_0x5ef2fd];return _0x11b657;};'use strict';function Trunk(_0x2bd2a1){this['id']=_0x2bd2a1['id']||0x0;this['active']=_0x2bd2a1['active']||![];this[_0x066b('0x0')]=_0x2bd2a1[_0x066b('0x0')]||'';this[_0x066b('0x1')]=_0x066b('0x2');this['stateTime']=0x0;this[_0x066b('0x3')]=_0x066b('0x2');this[_0x066b('0x4')]=_0x2bd2a1[_0x066b('0x4')]&&_0x2bd2a1['registry'][_0x066b('0x5')](':')?_0x2bd2a1[_0x066b('0x4')][_0x066b('0x6')](':')[0x0]:'';this[_0x066b('0x7')]='';this[_0x066b('0x8')]='';this[_0x066b('0x9')]='';this['domainport']='';this[_0x066b('0xa')]='';this[_0x066b('0xb')]=_0x066b('0x2');this[_0x066b('0xc')]='';this[_0x066b('0xd')]='';this['defaultuser']=_0x2bd2a1[_0x066b('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x5343=['unknown','status','registry','indexOf','split','port','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state'];(function(_0x4aeb44,_0x419730){var _0x1aa240=function(_0x113ba9){while(--_0x113ba9){_0x4aeb44['push'](_0x4aeb44['shift']());}};_0x1aa240(++_0x419730);}(_0x5343,0x1ce));var _0x3534=function(_0x1df5e0,_0x1f0ef1){_0x1df5e0=_0x1df5e0-0x0;var _0x39e886=_0x5343[_0x1df5e0];return _0x39e886;};'use strict';function Trunk(_0x2743bb){this['id']=_0x2743bb['id']||0x0;this[_0x3534('0x0')]=_0x2743bb['active']||![];this[_0x3534('0x1')]=_0x2743bb[_0x3534('0x1')]||'';this[_0x3534('0x2')]=_0x3534('0x3');this['stateTime']=0x0;this[_0x3534('0x4')]='unknown';this[_0x3534('0x5')]=_0x2743bb[_0x3534('0x5')]&&_0x2743bb[_0x3534('0x5')][_0x3534('0x6')](':')?_0x2743bb['registry'][_0x3534('0x7')](':')[0x0]:'';this['host']='';this[_0x3534('0x8')]='';this['domain']='';this[_0x3534('0x9')]='';this['refresh']='';this[_0x3534('0xa')]=_0x3534('0x3');this[_0x3534('0xb')]='';this[_0x3534('0xc')]='';this[_0x3534('0xd')]=_0x2743bb[_0x3534('0xd')]||'';}module[_0x3534('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index c06470e..0b45308 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 _0xc9e7=['mandatoryDisposition','recordingFormat'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc9e7,0x17d));var _0x7c9e=function(_0xa4dd2a,_0x475be0){_0xa4dd2a=_0xa4dd2a-0x0;var _0x29ed61=_0xc9e7[_0xa4dd2a];return _0x29ed61;};'use strict';function voiceExtension(_0x806f77){this['id']=_0x806f77['id']||0x0;this['exten']=_0x806f77['exten']||'';this[_0x7c9e('0x0')]=_0x806f77[_0x7c9e('0x0')]||'none';this['mandatoryDisposition']=_0x806f77[_0x7c9e('0x1')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x3854=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x3854,0xd9));var _0x4385=function(_0x33e72b,_0x5c5225){_0x33e72b=_0x33e72b-0x0;var _0xfd689f=_0x3854[_0x33e72b];return _0xfd689f;};'use strict';function voiceExtension(_0x4dc812){this['id']=_0x4dc812['id']||0x0;this[_0x4385('0x0')]=_0x4dc812['exten']||'';this[_0x4385('0x1')]=_0x4dc812[_0x4385('0x1')]||_0x4385('0x2');this[_0x4385('0x3')]=_0x4dc812[_0x4385('0x3')]||![];}module[_0x4385('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index afe4744..4aa333f 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 _0x3cc7=['strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','onhold','wav49','gsm','rrmemory','name','type','inbound','total','answered','sumHoldTime','loggedIn','available','acw','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x18de94,_0x576612){var _0x33623b=function(_0x4f855e){while(--_0x4f855e){_0x18de94['push'](_0x18de94['shift']());}};_0x33623b(++_0x576612);}(_0x3cc7,0x11f));var _0x73cc=function(_0x118733,_0x2bd820){_0x118733=_0x118733-0x0;var _0x4777af=_0x3cc7[_0x118733];return _0x4777af;};'use strict';var statusDesc=[_0x73cc('0x0'),_0x73cc('0x1'),_0x73cc('0x2'),_0x73cc('0x3'),_0x73cc('0x4'),'unavailable',_0x73cc('0x5'),'ringinuse',_0x73cc('0x6')];var monitorFormat={'wav':'wav','wav49':_0x73cc('0x7'),'gsm':_0x73cc('0x8')};var strategy={'rrmemory':_0x73cc('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x1b2eab){this['id']=_0x1b2eab['id']||0x0;this[_0x73cc('0xa')]=_0x1b2eab[_0x73cc('0xa')]||'';this['monitor_format']=_0x1b2eab['monitor_format']||'';this['type']=_0x1b2eab[_0x73cc('0xb')]||_0x73cc('0xc');this['waiting']=0x0;this['talking']=0x0;this[_0x73cc('0xd')]=0x0;this[_0x73cc('0xe')]=0x0;this['sumDuration']=0x0;this[_0x73cc('0xf')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x73cc('0x10')]=0x0;this[_0x73cc('0x11')]=0x0;this[_0x73cc('0x12')]=_0x1b2eab[_0x73cc('0x12')]||![];this['acwTimeout']=_0x1b2eab['acwTimeout']||0xa;this['autopause']=_0x1b2eab[_0x73cc('0x13')]||'no';this[_0x73cc('0x14')]=!![];this['message']='';this[_0x73cc('0x15')]=0x0;this['temp']=0x0;this[_0x73cc('0x16')]=_0x1b2eab[_0x73cc('0x16')]||null;this[_0x73cc('0x17')]=_0x1b2eab[_0x73cc('0x17')]?_0x1b2eab[_0x73cc('0x17')]:null;this['dialActive']=_0x1b2eab[_0x73cc('0x18')];this[_0x73cc('0x19')]=_0x1b2eab[_0x73cc('0x19')]||_0x73cc('0x1a');this[_0x73cc('0x1b')]=_0x1b2eab[_0x73cc('0x1b')]||0x0;this[_0x73cc('0x1c')]=_0x1b2eab[_0x73cc('0x1c')]||0x0;this[_0x73cc('0x1d')]=_0x1b2eab['dialPowerLevel']||0x1;this[_0x73cc('0x1e')]=_0x1b2eab[_0x73cc('0x1e')]||_0x73cc('0x1f');this[_0x73cc('0x20')]=_0x1b2eab[_0x73cc('0x20')]||0.03;this[_0x73cc('0x21')]=_0x1b2eab['dialPredictiveInterval']||0x258;this[_0x73cc('0x22')]=_0x1b2eab['dialOriginateCallerIdName']||_0x73cc('0x23');this[_0x73cc('0x24')]=_0x1b2eab[_0x73cc('0x24')]||_0x73cc('0x23');this[_0x73cc('0x25')]=_0x1b2eab[_0x73cc('0x25')]||0x1e;this[_0x73cc('0x26')]=_0x1b2eab[_0x73cc('0x26')]||'tTxX';this[_0x73cc('0x27')]=_0x1b2eab[_0x73cc('0x27')]||0x3;this['dialQueueProject']=_0x1b2eab[_0x73cc('0x28')]||undefined;this[_0x73cc('0x29')]=_0x1b2eab[_0x73cc('0x29')]||0x3;this[_0x73cc('0x2a')]=_0x1b2eab[_0x73cc('0x2a')]||0x96;this[_0x73cc('0x2b')]=_0x1b2eab[_0x73cc('0x2b')]||0x3;this[_0x73cc('0x2c')]=_0x1b2eab['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x1b2eab['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x1b2eab[_0x73cc('0x2d')]||0x96;this[_0x73cc('0x2e')]=_0x1b2eab[_0x73cc('0x2e')]||0x3;this[_0x73cc('0x2f')]=_0x1b2eab['dialNoSuchNumberRetryFrequency']||0x96;this[_0x73cc('0x30')]=_0x1b2eab[_0x73cc('0x30')]||0x3;this[_0x73cc('0x31')]=_0x1b2eab['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x1b2eab[_0x73cc('0x32')]||0x3;this[_0x73cc('0x33')]=_0x1b2eab[_0x73cc('0x33')]||0x96;this['dialMachineMaxRetry']=_0x1b2eab['dialMachineMaxRetry']||0x3;this[_0x73cc('0x34')]=_0x1b2eab[_0x73cc('0x34')]||0x96;this[_0x73cc('0x35')]=_0x1b2eab[_0x73cc('0x35')]||0x3;this[_0x73cc('0x36')]=_0x1b2eab[_0x73cc('0x36')]||0x96;this[_0x73cc('0x37')]=_0x1b2eab[_0x73cc('0x37')]||0x4;this[_0x73cc('0x38')]=_0x1b2eab[_0x73cc('0x38')]?_0x1b2eab[_0x73cc('0x38')]:undefined;this[_0x73cc('0x39')]=_0x1b2eab[_0x73cc('0x39')]?_0x1b2eab[_0x73cc('0x39')]:undefined;this[_0x73cc('0x3a')]=_0x1b2eab[_0x73cc('0x3a')]||undefined;this['Interval']=_0x1b2eab[_0x73cc('0x3b')]?_0x1b2eab[_0x73cc('0x3b')]:undefined;this[_0x73cc('0x3c')]=_0x1b2eab[_0x73cc('0x3c')]||_0x73cc('0x3d');this[_0x73cc('0x3e')]=_0x1b2eab[_0x73cc('0x3e')]||undefined;this[_0x73cc('0x3f')]=_0x1b2eab[_0x73cc('0x3f')]||undefined;this[_0x73cc('0x40')]=strategy[_0x1b2eab[_0x73cc('0x40')]]||_0x73cc('0x9');this[_0x73cc('0x41')]=!![];this[_0x73cc('0x42')]=_0x1b2eab[_0x73cc('0x42')]||![];this[_0x73cc('0x43')]=_0x1b2eab[_0x73cc('0x43')];this[_0x73cc('0x44')]=_0x1b2eab[_0x73cc('0x44')];this[_0x73cc('0x45')]=_0x1b2eab[_0x73cc('0x45')];this[_0x73cc('0x46')]=_0x1b2eab['dialAMDTotalAnalysisTime'];this[_0x73cc('0x47')]=_0x1b2eab[_0x73cc('0x47')];this[_0x73cc('0x48')]=_0x1b2eab[_0x73cc('0x48')];this[_0x73cc('0x49')]=_0x1b2eab[_0x73cc('0x49')];this[_0x73cc('0x4a')]=_0x1b2eab[_0x73cc('0x4a')];this[_0x73cc('0x4b')]=_0x1b2eab[_0x73cc('0x4b')];this['outboundRejectCallsDay']=0x0;this[_0x73cc('0x4c')]=0x0;this[_0x73cc('0x4d')]=_0x1b2eab['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x73cc('0x4e')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x73cc('0x4f')]=0x0;this[_0x73cc('0x50')]=0x0;this[_0x73cc('0x51')]=0x0;this[_0x73cc('0x52')]=0x0;this[_0x73cc('0x53')]=0x0;this[_0x73cc('0x54')]=0x0;this[_0x73cc('0x55')]=0x0;this[_0x73cc('0x56')]=0x0;this[_0x73cc('0x57')]=0x0;this[_0x73cc('0x58')]=0x0;this[_0x73cc('0x59')]=0x0;this[_0x73cc('0x5a')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x73cc('0x5b')]=1.05;this[_0x73cc('0x5c')]=0x0;this[_0x73cc('0x5d')]=0x0;this[_0x73cc('0x5e')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x73cc('0x5f')]=0x0;this[_0x73cc('0x60')]=0x0;this[_0x73cc('0x61')]=0x0;this[_0x73cc('0x62')]=_0x1b2eab[_0x73cc('0x63')]||0x14;this[_0x73cc('0x64')]=_0x1b2eab[_0x73cc('0x63')]||0xa;this[_0x73cc('0x65')]=0x0;this[_0x73cc('0x66')]=0x0;this[_0x73cc('0x67')]=0x1;this[_0x73cc('0x68')]=0x0;this[_0x73cc('0x69')]=0x0;this[_0x73cc('0x6a')]=0x0;this[_0x73cc('0x6b')]=0x0;this['dialRecallMeTimeout']=_0x1b2eab[_0x73cc('0x6c')]||0x1e;this['dialRecallInQueue']=_0x1b2eab[_0x73cc('0x6d')]||![];this[_0x73cc('0x6e')]=_0x1b2eab[_0x73cc('0x6e')]||undefined;this[_0x73cc('0x6f')]=_0x1b2eab[_0x73cc('0x6f')]||![];this[_0x73cc('0x70')]=_0x1b2eab[_0x73cc('0x70')]||![];this[_0x73cc('0x71')]=monitorFormat[_0x1b2eab[_0x73cc('0x71')]]?monitorFormat[_0x1b2eab[_0x73cc('0x71')]]:undefined;this[_0x73cc('0x72')]=_0x1b2eab['mandatoryDisposition']||![];this[_0x73cc('0x73')]=_0x1b2eab[_0x73cc('0x73')]?_0x1b2eab[_0x73cc('0x73')]:undefined;}module[_0x73cc('0x74')]=VoiceQueue; \ No newline at end of file +var _0x120e=['outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','monitor_format','type','waiting','talking','total','answered','sumHoldTime','sumBillable','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x2f2798,_0x391f43){var _0x34c53d=function(_0x527f46){while(--_0x527f46){_0x2f2798['push'](_0x2f2798['shift']());}};_0x34c53d(++_0x391f43);}(_0x120e,0x17a));var _0xe120=function(_0x23333d,_0x3be7d0){_0x23333d=_0x23333d-0x0;var _0x2fbe1a=_0x120e[_0x23333d];return _0x2fbe1a;};'use strict';var statusDesc=['unknown','not_inuse',_0xe120('0x0'),_0xe120('0x1'),'invalid',_0xe120('0x2'),_0xe120('0x3'),_0xe120('0x4'),_0xe120('0x5')];var monitorFormat={'wav':_0xe120('0x6'),'wav49':_0xe120('0x7'),'gsm':_0xe120('0x8')};var strategy={'rrmemory':_0xe120('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x6eb594){this['id']=_0x6eb594['id']||0x0;this['name']=_0x6eb594['name']||'';this[_0xe120('0xa')]=_0x6eb594[_0xe120('0xa')]||'';this[_0xe120('0xb')]=_0x6eb594[_0xe120('0xb')]||'inbound';this[_0xe120('0xc')]=0x0;this[_0xe120('0xd')]=0x0;this[_0xe120('0xe')]=0x0;this[_0xe120('0xf')]=0x0;this['sumDuration']=0x0;this[_0xe120('0x10')]=0x0;this[_0xe120('0x11')]=0x0;this['unmanaged']=0x0;this[_0xe120('0x12')]=0x0;this[_0xe120('0x13')]=0x0;this['available']=0x0;this[_0xe120('0x14')]=_0x6eb594[_0xe120('0x14')]||![];this[_0xe120('0x15')]=_0x6eb594[_0xe120('0x15')]||0xa;this[_0xe120('0x16')]=_0x6eb594['autopause']||'no';this[_0xe120('0x17')]=!![];this[_0xe120('0x18')]='';this[_0xe120('0x19')]=0x0;this[_0xe120('0x1a')]=0x0;this[_0xe120('0x1b')]=_0x6eb594[_0xe120('0x1b')]||null;this[_0xe120('0x1c')]=_0x6eb594[_0xe120('0x1c')]?_0x6eb594[_0xe120('0x1c')]:null;this[_0xe120('0x1d')]=_0x6eb594[_0xe120('0x1d')];this[_0xe120('0x1e')]=_0x6eb594['dialMethod']||'progressive';this[_0xe120('0x1f')]=_0x6eb594[_0xe120('0x1f')]||0x0;this[_0xe120('0x20')]=_0x6eb594[_0xe120('0x20')]||0x0;this[_0xe120('0x21')]=_0x6eb594[_0xe120('0x21')]||0x1;this[_0xe120('0x22')]=_0x6eb594['dialPredictiveOptimization']||_0xe120('0x23');this['dialPredictiveOptimizationPercentage']=_0x6eb594['dialPredictiveOptimizationPercentage']||0.03;this[_0xe120('0x24')]=_0x6eb594[_0xe120('0x24')]||0x258;this[_0xe120('0x25')]=_0x6eb594['dialOriginateCallerIdName']||_0xe120('0x26');this[_0xe120('0x27')]=_0x6eb594[_0xe120('0x27')]||_0xe120('0x26');this[_0xe120('0x28')]=_0x6eb594[_0xe120('0x28')]||0x1e;this[_0xe120('0x29')]=_0x6eb594[_0xe120('0x29')]||_0xe120('0x2a');this[_0xe120('0x2b')]=_0x6eb594[_0xe120('0x2b')]||0x3;this[_0xe120('0x2c')]=_0x6eb594['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x6eb594['dialCongestionMaxRetry']||0x3;this[_0xe120('0x2d')]=_0x6eb594[_0xe120('0x2d')]||0x96;this[_0xe120('0x2e')]=_0x6eb594[_0xe120('0x2e')]||0x3;this[_0xe120('0x2f')]=_0x6eb594[_0xe120('0x2f')]||0x96;this[_0xe120('0x30')]=_0x6eb594[_0xe120('0x30')]||0x3;this[_0xe120('0x31')]=_0x6eb594[_0xe120('0x31')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x6eb594[_0xe120('0x32')]||0x3;this[_0xe120('0x33')]=_0x6eb594[_0xe120('0x33')]||0x96;this[_0xe120('0x34')]=_0x6eb594[_0xe120('0x34')]||0x3;this['dialDropRetryFrequency']=_0x6eb594['dialDropRetryFrequency']||0x96;this[_0xe120('0x35')]=_0x6eb594[_0xe120('0x35')]||0x3;this[_0xe120('0x36')]=_0x6eb594['dialAbandonedRetryFrequency']||0x96;this[_0xe120('0x37')]=_0x6eb594[_0xe120('0x37')]||0x3;this[_0xe120('0x38')]=_0x6eb594[_0xe120('0x38')]||0x96;this['dialAgentRejectMaxRetry']=_0x6eb594[_0xe120('0x39')]||0x3;this[_0xe120('0x3a')]=_0x6eb594[_0xe120('0x3a')]||0x96;this[_0xe120('0x3b')]=_0x6eb594['dialGlobalMaxRetry']||0x4;this[_0xe120('0x3c')]=_0x6eb594[_0xe120('0x3c')]?_0x6eb594['Trunk']:undefined;this[_0xe120('0x3d')]=_0x6eb594[_0xe120('0x3d')]?_0x6eb594[_0xe120('0x3d')]:undefined;this[_0xe120('0x3e')]=_0x6eb594[_0xe120('0x3e')]||undefined;this['Interval']=_0x6eb594[_0xe120('0x3f')]?_0x6eb594[_0xe120('0x3f')]:undefined;this[_0xe120('0x40')]=_0x6eb594[_0xe120('0x40')]||_0xe120('0x41');this[_0xe120('0x42')]=_0x6eb594[_0xe120('0x42')]||undefined;this['dialCutDigit']=_0x6eb594[_0xe120('0x43')]||undefined;this[_0xe120('0x44')]=strategy[_0x6eb594[_0xe120('0x44')]]||_0xe120('0x9');this[_0xe120('0x45')]=!![];this['dialAMDActive']=_0x6eb594['dialAMDActive']||![];this[_0xe120('0x46')]=_0x6eb594[_0xe120('0x46')];this[_0xe120('0x47')]=_0x6eb594[_0xe120('0x47')];this[_0xe120('0x48')]=_0x6eb594['dialAMDAfterGreetingSilence'];this[_0xe120('0x49')]=_0x6eb594[_0xe120('0x49')];this['dialAMDMinWordLength']=_0x6eb594['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x6eb594[_0xe120('0x4a')];this[_0xe120('0x4b')]=_0x6eb594[_0xe120('0x4b')];this[_0xe120('0x4c')]=_0x6eb594[_0xe120('0x4c')];this[_0xe120('0x4d')]=_0x6eb594[_0xe120('0x4d')];this[_0xe120('0x4e')]=0x0;this[_0xe120('0x4f')]=0x0;this[_0xe120('0x50')]=_0x6eb594[_0xe120('0x50')];this[_0xe120('0x51')]=0x0;this[_0xe120('0x52')]=0x0;this[_0xe120('0x53')]=0x0;this[_0xe120('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xe120('0x55')]=0x0;this[_0xe120('0x56')]=0x0;this[_0xe120('0x57')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xe120('0x58')]=0x0;this[_0xe120('0x59')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0xe120('0x5a')]=undefined;this[_0xe120('0x5b')]=undefined;this[_0xe120('0x5c')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xe120('0x5d')]=0x0;this[_0xe120('0x5e')]=0x0;this[_0xe120('0x5f')]=0x0;this[_0xe120('0x60')]=0x0;this[_0xe120('0x61')]=0x0;this[_0xe120('0x62')]=0x0;this[_0xe120('0x63')]=0x0;this[_0xe120('0x64')]=0x0;this['predictiveIntervalMaxThreshold']=_0x6eb594[_0xe120('0x65')]||0x14;this[_0xe120('0x66')]=_0x6eb594[_0xe120('0x65')]||0xa;this[_0xe120('0x67')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xe120('0x68')]=0x0;this[_0xe120('0x69')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xe120('0x6a')]=0x0;this[_0xe120('0x6b')]=_0x6eb594[_0xe120('0x6b')]||0x1e;this[_0xe120('0x6c')]=_0x6eb594[_0xe120('0x6c')]||![];this[_0xe120('0x6d')]=_0x6eb594[_0xe120('0x6d')]||undefined;this[_0xe120('0x6e')]=_0x6eb594[_0xe120('0x6e')]||![];this[_0xe120('0x6f')]=_0x6eb594[_0xe120('0x6f')]||![];this[_0xe120('0xa')]=monitorFormat[_0x6eb594[_0xe120('0xa')]]?monitorFormat[_0x6eb594[_0xe120('0xa')]]:undefined;this[_0xe120('0x70')]=_0x6eb594[_0xe120('0x70')]||![];this['mandatoryDispositionPause']=_0x6eb594['mandatoryDispositionPause']?_0x6eb594[_0xe120('0x71')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index ca201b8..80d9569 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 _0x58dc=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x58dc,0x199));var _0xc58d=function(_0x2bf706,_0x366989){_0x2bf706=_0x2bf706-0x0;var _0x59f9dc=_0x58dc[_0x2bf706];return _0x59f9dc;};'use strict';function VtigerAccount(_0x3ea7a0){this['id']=_0x3ea7a0['id']||0x0;this[_0xc58d('0x0')]=_0x3ea7a0['name']||'';this[_0xc58d('0x1')]=_0x3ea7a0[_0xc58d('0x1')]||'';this[_0xc58d('0x2')]=_0x3ea7a0['accessKey']||'';this[_0xc58d('0x3')]=_0x3ea7a0[_0xc58d('0x3')]||'';this[_0xc58d('0x4')]=_0x3ea7a0[_0xc58d('0x4')]||'';this[_0xc58d('0x5')]=_0x3ea7a0[_0xc58d('0x5')]||{};}module[_0xc58d('0x6')]=VtigerAccount; \ No newline at end of file +var _0xa363=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x54bd18,_0x40b483){var _0x87a498=function(_0x1cb338){while(--_0x1cb338){_0x54bd18['push'](_0x54bd18['shift']());}};_0x87a498(++_0x40b483);}(_0xa363,0x107));var _0x3a36=function(_0xcdfc4f,_0x8a111a){_0xcdfc4f=_0xcdfc4f-0x0;var _0x3f70d1=_0xa363[_0xcdfc4f];return _0x3f70d1;};'use strict';function VtigerAccount(_0x308249){this['id']=_0x308249['id']||0x0;this[_0x3a36('0x0')]=_0x308249['name']||'';this[_0x3a36('0x1')]=_0x308249['username']||'';this['accessKey']=_0x308249['accessKey']||'';this[_0x3a36('0x2')]=_0x308249[_0x3a36('0x2')]||'';this[_0x3a36('0x3')]=_0x308249['serverUrl']||'';this[_0x3a36('0x4')]=_0x308249[_0x3a36('0x4')]||{};}module[_0x3a36('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 cca958a..bc6db17 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 _0x284d=['name','username','password','token','remoteUri','authType','type','serverUrl','Configurations','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x284d,0xc8));var _0xd284=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0x284d[_0x21b74b];return _0x518cc6;};'use strict';function ZendeskAccount(_0x3020bb){this['id']=_0x3020bb['id']||0x0;this[_0xd284('0x0')]=_0x3020bb[_0xd284('0x0')]||'';this[_0xd284('0x1')]=_0x3020bb[_0xd284('0x1')]||'';this[_0xd284('0x2')]=_0x3020bb[_0xd284('0x2')]||'';this[_0xd284('0x3')]=_0x3020bb['token']||'';this[_0xd284('0x4')]=_0x3020bb[_0xd284('0x4')]||'';this[_0xd284('0x5')]=_0x3020bb[_0xd284('0x5')]||'';this[_0xd284('0x6')]=_0x3020bb[_0xd284('0x6')]||'integrationTab';this[_0xd284('0x7')]=_0x3020bb[_0xd284('0x7')]||'';this[_0xd284('0x8')]=_0x3020bb['Configurations']||{};}module[_0xd284('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x3c57=['exports','name','username','password','token','remoteUri','type','integrationTab','serverUrl','Configurations'];(function(_0x4608ac,_0x3fbb09){var _0x1eb62f=function(_0x327950){while(--_0x327950){_0x4608ac['push'](_0x4608ac['shift']());}};_0x1eb62f(++_0x3fbb09);}(_0x3c57,0xa1));var _0x73c5=function(_0xe93785,_0x4066d6){_0xe93785=_0xe93785-0x0;var _0x17dc5b=_0x3c57[_0xe93785];return _0x17dc5b;};'use strict';function ZendeskAccount(_0x468944){this['id']=_0x468944['id']||0x0;this[_0x73c5('0x0')]=_0x468944['name']||'';this[_0x73c5('0x1')]=_0x468944[_0x73c5('0x1')]||'';this[_0x73c5('0x2')]=_0x468944[_0x73c5('0x2')]||'';this[_0x73c5('0x3')]=_0x468944[_0x73c5('0x3')]||'';this[_0x73c5('0x4')]=_0x468944[_0x73c5('0x4')]||'';this['authType']=_0x468944['authType']||'';this[_0x73c5('0x5')]=_0x468944[_0x73c5('0x5')]||_0x73c5('0x6');this['serverUrl']=_0x468944[_0x73c5('0x7')]||'';this[_0x73c5('0x8')]=_0x468944[_0x73c5('0x8')]||{};}module[_0x73c5('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 e4c088b..d0d4469 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 _0xc152=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x242cbc,_0x3d8fa1){var _0x2cb425=function(_0x411a3f){while(--_0x411a3f){_0x242cbc['push'](_0x242cbc['shift']());}};_0x2cb425(++_0x3d8fa1);}(_0xc152,0x112));var _0x2c15=function(_0xd3e16a,_0x28517e){_0xd3e16a=_0xd3e16a-0x0;var _0x449538=_0xc152[_0xd3e16a];return _0x449538;};'use strict';function ZohoAccount(_0x873e64){this['id']=_0x873e64['id']||0x0;this[_0x2c15('0x0')]=_0x873e64['name']||'';this[_0x2c15('0x1')]=_0x873e64[_0x2c15('0x1')]||'';this[_0x2c15('0x2')]=_0x873e64[_0x2c15('0x2')]||'';this[_0x2c15('0x3')]=_0x873e64[_0x2c15('0x3')]||'';this['clientId']=_0x873e64[_0x2c15('0x4')]||'';this[_0x2c15('0x5')]=_0x873e64[_0x2c15('0x5')]||'';this[_0x2c15('0x6')]=_0x873e64[_0x2c15('0x6')]||'';this[_0x2c15('0x7')]=_0x873e64[_0x2c15('0x7')]||'';this['refreshToken']=_0x873e64[_0x2c15('0x8')]||'';this[_0x2c15('0x9')]=_0x873e64[_0x2c15('0x9')]||{};}module[_0x2c15('0xa')]=ZohoAccount; \ No newline at end of file +var _0x2798=['Configurations','exports','name','description','host','zone','clientId','clientSecret','code','refreshToken'];(function(_0x27b4d0,_0x1fc9ba){var _0xf8f8b2=function(_0x4f5267){while(--_0x4f5267){_0x27b4d0['push'](_0x27b4d0['shift']());}};_0xf8f8b2(++_0x1fc9ba);}(_0x2798,0xca));var _0x8279=function(_0xd42924,_0x479947){_0xd42924=_0xd42924-0x0;var _0x59251a=_0x2798[_0xd42924];return _0x59251a;};'use strict';function ZohoAccount(_0x49bf8c){this['id']=_0x49bf8c['id']||0x0;this[_0x8279('0x0')]=_0x49bf8c['name']||'';this[_0x8279('0x1')]=_0x49bf8c[_0x8279('0x1')]||'';this[_0x8279('0x2')]=_0x49bf8c[_0x8279('0x2')]||'';this[_0x8279('0x3')]=_0x49bf8c['zone']||'';this[_0x8279('0x4')]=_0x49bf8c[_0x8279('0x4')]||'';this[_0x8279('0x5')]=_0x49bf8c[_0x8279('0x5')]||'';this['serverUrl']=_0x49bf8c['serverUrl']||'';this[_0x8279('0x6')]=_0x49bf8c[_0x8279('0x6')]||'';this[_0x8279('0x7')]=_0x49bf8c[_0x8279('0x7')]||'';this['Configurations']=_0x49bf8c[_0x8279('0x8')]||{};}module[_0x8279('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index a1b609b..6062161 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 _0x4836=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum'];(function(_0x437eab,_0x16334c){var _0x4b30c5=function(_0x49603d){while(--_0x49603d){_0x437eab['push'](_0x437eab['shift']());}};_0x4b30c5(++_0x16334c);}(_0x4836,0xf9));var _0x6483=function(_0x517a5e,_0x2a4936){_0x517a5e=_0x517a5e-0x0;var _0x31f2c6=_0x4836[_0x517a5e];return _0x31f2c6;};'use strict';var util=require(_0x6483('0x0'));var _=require(_0x6483('0x1'));var moment=require('moment');function checkNameSurname(_0x56d06d,_0x3e11fc,_0x109f34){var _0x2e9d50='';if(!_[_0x6483('0x2')](_0x3e11fc)&&_0x6483('0x3')===typeof _0x3e11fc){_0x2e9d50+=_0x3e11fc;}if(!_[_0x6483('0x2')](_0x109f34)&&_0x6483('0x3')===typeof _0x109f34){_0x2e9d50+='\x20'+_0x109f34;}if(_0x2e9d50!==''){return _0x2e9d50;}return _0x56d06d;}function Action(_0x2e0a47,_0x3dbf8a,_0x2d5b80,_0x357b4a,_0x4fab22){this['uniqueid']=_0x2d5b80||undefined;this[_0x6483('0x4')]=_0x2e0a47['id'];this[_0x6483('0x5')]=_0x3dbf8a[_0x6483('0x6')];this[_0x6483('0x7')]=_0x3dbf8a[_0x6483('0x7')];this['campaigntype']=_0x6483('0x5');this[_0x6483('0x8')]=![];this[_0x6483('0x9')]=_['isNil'](_0x2e0a47[_0x6483('0xa')])?undefined:_0x2e0a47['Agent'][_0x6483('0x6')];this[_0x6483('0xb')]=this[_0x6483('0x9')]?util[_0x6483('0xc')](_0x6483('0xd'),this['membername']):_0x357b4a||undefined;this[_0x6483('0xe')]=checkNameSurname(_0x2e0a47[_0x6483('0xf')][_0x6483('0x10')],_0x2e0a47[_0x6483('0xf')][_0x6483('0x11')],_0x2e0a47['Contact'][_0x6483('0x12')]);this[_0x6483('0x13')]=_0x2e0a47[_0x6483('0x13')]||![];this[_0x6483('0x14')]=_0x2e0a47[_0x6483('0xf')][_0x6483('0x10')];this[_0x6483('0x15')]=_0x2e0a47[_0x6483('0x15')];this[_0x6483('0x16')]=_0x2e0a47[_0x6483('0x16')]||0x0;this['countcongestionretry']=_0x2e0a47[_0x6483('0x17')]||0x0;this[_0x6483('0x18')]=_0x2e0a47[_0x6483('0x18')]||0x0;this['countglobal']=(_0x2e0a47[_0x6483('0x16')]||0x0)+(_0x2e0a47[_0x6483('0x17')]||0x0)+(_0x2e0a47['countnoanswerretry']||0x0)+(_0x2e0a47[_0x6483('0x19')]||0x0)+(_0x2e0a47[_0x6483('0x1a')]||0x0)+(_0x2e0a47[_0x6483('0x1b')]||0x0)+(_0x2e0a47[_0x6483('0x1c')]||0x0)+(_0x2e0a47['countagentrejectretry']||0x0);this[_0x6483('0x19')]=_0x2e0a47[_0x6483('0x19')]||0x0;this[_0x6483('0x1a')]=_0x2e0a47['countdropretry']||0x0;this['countabandonedretry']=_0x2e0a47[_0x6483('0x1b')]||0x0;this[_0x6483('0x1c')]=_0x2e0a47[_0x6483('0x1c')]||0x0;this['countagentrejectretry']=_0x2e0a47[_0x6483('0x1d')]||0x0;this[_0x6483('0x1e')]=_0x2e0a47[_0x6483('0x1e')];this[_0x6483('0x1f')]=_0x2e0a47[_0x6483('0x1f')];this[_0x6483('0x20')]=_0x2e0a47[_0x6483('0x20')];this[_0x6483('0x21')]=_0x2e0a47['recallme'];this['ContactId']=_0x2e0a47[_0x6483('0x22')];this['ListId']=_0x2e0a47[_0x6483('0x23')];this[_0x6483('0x24')]=_[_0x6483('0x2')](_0x2e0a47['Agent'])?_0x2e0a47[_0x6483('0x24')]:_0x2e0a47[_0x6483('0xa')]['id'];this[_0x6483('0x25')]=_0x2e0a47[_0x6483('0x25')];this[_0x6483('0x26')]='';this[_0x6483('0x27')]='';}Action[_0x6483('0x28')][_0x6483('0x29')]=function(){return util[_0x6483('0xc')](_0x6483('0x2a'),this['calleridname'],this[_0x6483('0x2b')]);};module[_0x6483('0x2c')]=Action; \ No newline at end of file +var _0x5ffd=['firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone'];(function(_0x521ee2,_0x1c2a7c){var _0x426497=function(_0x1a0043){while(--_0x1a0043){_0x521ee2['push'](_0x521ee2['shift']());}};_0x426497(++_0x1c2a7c);}(_0x5ffd,0x19d));var _0xd5ff=function(_0x576abe,_0x1eff89){_0x576abe=_0x576abe-0x0;var _0x24df8d=_0x5ffd[_0x576abe];return _0x24df8d;};'use strict';var util=require(_0xd5ff('0x0'));var _=require(_0xd5ff('0x1'));var moment=require('moment');function checkNameSurname(_0x12cbd1,_0x3d20bf,_0x51f242){var _0xca5c97='';if(!_[_0xd5ff('0x2')](_0x3d20bf)&&_0xd5ff('0x3')===typeof _0x3d20bf){_0xca5c97+=_0x3d20bf;}if(!_['isNil'](_0x51f242)&&'string'===typeof _0x51f242){_0xca5c97+='\x20'+_0x51f242;}if(_0xca5c97!==''){return _0xca5c97;}return _0x12cbd1;}function Action(_0x31658e,_0xbf0c85,_0x36b01d,_0x45ca62,_0x36c835){this[_0xd5ff('0x4')]=_0x36b01d||undefined;this[_0xd5ff('0x5')]=_0x31658e['id'];this[_0xd5ff('0x6')]=_0xbf0c85[_0xd5ff('0x7')];this[_0xd5ff('0x8')]=_0xbf0c85[_0xd5ff('0x8')];this[_0xd5ff('0x9')]=_0xd5ff('0x6');this[_0xd5ff('0xa')]=![];this[_0xd5ff('0xb')]=_[_0xd5ff('0x2')](_0x31658e[_0xd5ff('0xc')])?undefined:_0x31658e[_0xd5ff('0xc')][_0xd5ff('0x7')];this[_0xd5ff('0xd')]=this['membername']?util[_0xd5ff('0xe')](_0xd5ff('0xf'),this[_0xd5ff('0xb')]):_0x45ca62||undefined;this[_0xd5ff('0x10')]=checkNameSurname(_0x31658e[_0xd5ff('0x11')][_0xd5ff('0x12')],_0x31658e[_0xd5ff('0x11')][_0xd5ff('0x13')],_0x31658e[_0xd5ff('0x11')][_0xd5ff('0x14')]);this[_0xd5ff('0x15')]=_0x31658e[_0xd5ff('0x15')]||![];this[_0xd5ff('0x16')]=_0x31658e[_0xd5ff('0x11')][_0xd5ff('0x12')];this['scheduledat']=_0x31658e[_0xd5ff('0x17')];this[_0xd5ff('0x18')]=_0x31658e[_0xd5ff('0x18')]||0x0;this[_0xd5ff('0x19')]=_0x31658e[_0xd5ff('0x19')]||0x0;this[_0xd5ff('0x1a')]=_0x31658e['countnoanswerretry']||0x0;this[_0xd5ff('0x1b')]=(_0x31658e['countbusyretry']||0x0)+(_0x31658e[_0xd5ff('0x19')]||0x0)+(_0x31658e['countnoanswerretry']||0x0)+(_0x31658e[_0xd5ff('0x1c')]||0x0)+(_0x31658e[_0xd5ff('0x1d')]||0x0)+(_0x31658e[_0xd5ff('0x1e')]||0x0)+(_0x31658e['countmachineretry']||0x0)+(_0x31658e[_0xd5ff('0x1f')]||0x0);this[_0xd5ff('0x1c')]=_0x31658e[_0xd5ff('0x1c')]||0x0;this[_0xd5ff('0x1d')]=_0x31658e['countdropretry']||0x0;this[_0xd5ff('0x1e')]=_0x31658e[_0xd5ff('0x1e')]||0x0;this[_0xd5ff('0x20')]=_0x31658e['countmachineretry']||0x0;this[_0xd5ff('0x1f')]=_0x31658e[_0xd5ff('0x1f')]||0x0;this[_0xd5ff('0x21')]=_0x31658e['callback'];this[_0xd5ff('0x22')]=_0x31658e['callbackuniqueid'];this[_0xd5ff('0x23')]=_0x31658e[_0xd5ff('0x23')];this['recallme']=_0x31658e[_0xd5ff('0x24')];this[_0xd5ff('0x25')]=_0x31658e[_0xd5ff('0x25')];this[_0xd5ff('0x26')]=_0x31658e[_0xd5ff('0x26')];this[_0xd5ff('0x27')]=_['isNil'](_0x31658e[_0xd5ff('0xc')])?_0x31658e[_0xd5ff('0x27')]:_0x31658e[_0xd5ff('0xc')]['id'];this[_0xd5ff('0x28')]=_0x31658e[_0xd5ff('0x28')];this[_0xd5ff('0x29')]='';this[_0xd5ff('0x2a')]='';}Action[_0xd5ff('0x2b')][_0xd5ff('0x2c')]=function(){return util[_0xd5ff('0xe')](_0xd5ff('0x2d'),this[_0xd5ff('0x10')],this[_0xd5ff('0x2e')]);};module[_0xd5ff('0x2f')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 8cae4b9..ae0a75d 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 _0xb09d=['outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','clearZombieChannels','dialActive','setMessage','recallMe','clearZombieChannel','enqueue','isNil','info','Queue','queue','stringify','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[action]','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','voicePause','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','createCustomerFinal','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','countbusyretry','totalGlobal','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','unmonitored','run','execRun','unlock','disableContact','getContactPreview','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','validateContact','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','campaign\x20Name:\x20','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','Contact','dialCutDigit','phone','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','Action','variablesAction','destconnectedlinenum','calleridnum','user:agentconnect','accountcode','[originated][increment]','OriginateError','logLookAgent','clone','isFailure','response','unlockContact','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','isUndefined','transfer','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','sumBillable','sumDuration','talking','total','unmanaged','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix'];(function(_0x38f355,_0x2dbe8f){var _0xc9fd27=function(_0x3659f6){while(--_0x3659f6){_0x38f355['push'](_0x38f355['shift']());}};_0xc9fd27(++_0x2dbe8f);}(_0xb09d,0x119));var _0xdb09=function(_0x4fbbb7,_0x162a08){_0x4fbbb7=_0x4fbbb7-0x0;var _0x265ce5=_0xb09d[_0x4fbbb7];return _0x265ce5;};'use strict';var util=require('util');var _=require(_0xdb09('0x0'));var BPromise=require(_0xdb09('0x1'));var uuid=require('uuid');var moment=require(_0xdb09('0x2'));var md5=require(_0xdb09('0x3'));var Redis=require(_0xdb09('0x4'));var config=require(_0xdb09('0x5'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xdb09('0x6'))(_0xdb09('0x7'));var ami=require(_0xdb09('0x8'));var rpcDb=require(_0xdb09('0x9'));var Action=require(_0xdb09('0xa'));var ut=require(_0xdb09('0xb'));config[_0xdb09('0xc')]=_[_0xdb09('0xd')](config['redis'],{'host':_0xdb09('0xe'),'port':0x18eb});var io=require(_0xdb09('0xf'))(new Redis(config[_0xdb09('0xc')]));var Sequence=function(){};Sequence[_0xdb09('0x10')]['enqueue']=function(_0x2bc8e0){this[_0xdb09('0x11')]=this[_0xdb09('0x11')]?this['tail']['finally'](_0x2bc8e0):_0x2bc8e0();};function Preview(_0x3a08b7){this[_0xdb09('0x12')]=new Sequence();this[_0xdb09('0x13')]=_0x3a08b7[_0xdb09('0x14')];this[_0xdb09('0x15')]=_0x3a08b7[_0xdb09('0x15')];this[_0xdb09('0x16')]={};this[_0xdb09('0x17')]=_0x3a08b7[_0xdb09('0x17')];this[_0xdb09('0x18')]=0x0;ami['on'](_0xdb09('0x19'),this[_0xdb09('0x1a')][_0xdb09('0x1b')](this));ami['on'](_0xdb09('0x1c'),this[_0xdb09('0x1d')][_0xdb09('0x1b')](this));ami['on'](_0xdb09('0x1e'),this[_0xdb09('0x1f')]['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0xdb09('0x1b')](this));ami['on']('newexten',this[_0xdb09('0x20')]['bind'](this));ami['on'](_0xdb09('0x21'),this[_0xdb09('0x22')][_0xdb09('0x1b')](this));ami['on'](_0xdb09('0x23'),this[_0xdb09('0x24')]['bind'](this));ami['on']('blindtransfer',this[_0xdb09('0x25')][_0xdb09('0x1b')](this));this[_0xdb09('0x26')](this[_0xdb09('0x13')]);}function emit(_0x144550,_0x16c6a2,_0x4803e6){io['to'](_0x144550)[_0xdb09('0x27')](_0x16c6a2,_0x4803e6);}function emitCampaignPreview(_0x27f8c2){if(_0x27f8c2[_0xdb09('0x28')]===_0xdb09('0x29')){var _0xf744a9={'id':_0x27f8c2['id'],'name':_0x27f8c2[_0xdb09('0x2a')],'strategy':_0x27f8c2[_0xdb09('0x2b')],'answered':_0x27f8c2[_0xdb09('0x2c')],'available':_0x27f8c2[_0xdb09('0x2d')],'loggedIn':_0x27f8c2['loggedIn'],'pTalking':_0x27f8c2['pTalking'],'sumBillable':_0x27f8c2[_0xdb09('0x2e')],'sumDuration':_0x27f8c2[_0xdb09('0x2f')],'sumHoldTime':_0x27f8c2['sumHoldTime']||0x0,'talking':_0x27f8c2[_0xdb09('0x30')],'total':_0x27f8c2[_0xdb09('0x31')],'type':_0x27f8c2['type'],'unmanaged':_0x27f8c2[_0xdb09('0x32')],'abandoned':_0x27f8c2['abandoned'],'waiting':_0x27f8c2[_0xdb09('0x33')],'loggedInDb':_0x27f8c2['loggedInDb'],'dialActive':_0x27f8c2['dialActive'],'dialMethod':_0x27f8c2[_0xdb09('0x34')],'dialOriginateCallerIdName':_0x27f8c2[_0xdb09('0x35')],'dialOriginateCallerIdNumber':_0x27f8c2[_0xdb09('0x36')],'dialOriginateTimeout':_0x27f8c2[_0xdb09('0x37')],'dialPrefix':_0x27f8c2[_0xdb09('0x38')],'outboundAnswerAgiCallsDay':_0x27f8c2[_0xdb09('0x39')],'outboundAnswerCallsDay':_0x27f8c2[_0xdb09('0x3a')],'outboundBlacklistCallsDay':_0x27f8c2[_0xdb09('0x3b')],'outboundBusyCallsDay':_0x27f8c2[_0xdb09('0x3c')],'outboundCongestionCallsDay':_0x27f8c2['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x27f8c2[_0xdb09('0x3d')],'outboundDropCallsDayCallersExit':_0x27f8c2[_0xdb09('0x3e')],'outboundDropCallsDayTimeout':_0x27f8c2[_0xdb09('0x3f')],'outboundNoAnswerCallsDay':_0x27f8c2[_0xdb09('0x40')],'outboundNoSuchCallsDay':_0x27f8c2[_0xdb09('0x41')],'outboundOriginateFailureCallsDay':_0x27f8c2['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x27f8c2['outboundReCallsDay'],'outboundRejectCallsDay':_0x27f8c2[_0xdb09('0x42')],'outboundUnknownCallsDay':_0x27f8c2[_0xdb09('0x43')],'outboundAbandonedCallsDay':_0x27f8c2[_0xdb09('0x44')],'predictiveIntervalAnsweredCalls':_0x27f8c2[_0xdb09('0x45')],'predictiveIntervalAvgHoldtime':_0x27f8c2['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x27f8c2[_0xdb09('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x27f8c2[_0xdb09('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x27f8c2[_0xdb09('0x48')],'predictiveIntervalErlangCalls':_0x27f8c2[_0xdb09('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x27f8c2[_0xdb09('0x4a')],'predictiveIntervalHitRate':_0x27f8c2[_0xdb09('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x27f8c2[_0xdb09('0x4c')],'predictiveIntervalPauses':_0x27f8c2[_0xdb09('0x4d')],'predictiveIntervalAvailable':_0x27f8c2[_0xdb09('0x4e')],'predictiveIntervalTotalCalls':_0x27f8c2['predictiveIntervalTotalCalls'],'message':_0x27f8c2[_0xdb09('0x4f')],'originated':_0x27f8c2[_0xdb09('0x50')],'erlangCalls':_0x27f8c2[_0xdb09('0x51')],'erlangCallToSecond':_0x27f8c2['erlangCallToSecond'],'erlangAbandonmentRate':_0x27f8c2[_0xdb09('0x52')],'erlangBusyFactor':_0x27f8c2[_0xdb09('0x53')],'startPredictive':_0x27f8c2[_0xdb09('0x54')],'startProgressive':_0x27f8c2[_0xdb09('0x55')]};if(_0x27f8c2[_0xdb09('0x56')]){_0xf744a9['Trunk']={'id':_0x27f8c2[_0xdb09('0x56')]['id'],'name':_0x27f8c2['Trunk'][_0xdb09('0x2a')],'active':_0x27f8c2[_0xdb09('0x56')][_0xdb09('0x57')],'callerid':_0x27f8c2[_0xdb09('0x56')][_0xdb09('0x58')]};}if(_0x27f8c2[_0xdb09('0x59')]){_0xf744a9[_0xdb09('0x59')]={'id':_0x27f8c2['Interval']['id'],'name':_0x27f8c2[_0xdb09('0x59')]['name']};}var _0xb9dc26=md5(JSON['stringify'](_0xf744a9));if(_0x27f8c2[_0xdb09('0x3')]!==_0xb9dc26){_0x27f8c2[_0xdb09('0x3')]=_0xb9dc26;emit(util[_0xdb09('0x5a')](_0xdb09('0x5b'),_0xf744a9['name']),_0xdb09('0x5c'),_0xf744a9);}}}function emitVoiceQueueChannelRemove(_0x223de6){logger['info'](_0xdb09('0x5d'),JSON['stringify'](_0x223de6));emit(util[_0xdb09('0x5a')](_0xdb09('0x5b'),_0x223de6[_0xdb09('0x2a')]),_0xdb09('0x5e'),_0x223de6);io[_0xdb09('0x27')]('voice_queue_presence:remove',_0x223de6);}function notSendMessagesQueue(_0xe694df){if(_0xe694df[_0xdb09('0x5f')]){if(_0xe694df[_0xdb09('0x50')]===0x0&&_0xe694df[_0xdb09('0x60')]===0x0){_0xe694df[_0xdb09('0x5f')]=![];_0xe694df[_0xdb09('0x2d')]=0x0;_0xe694df['paused']=0x0;_0xe694df[_0xdb09('0x4f')]=_0xdb09('0x61');ut[_0xdb09('0x62')](_0xdb09('0x63'),_0xe694df[_0xdb09('0x2a')]+_0xdb09('0x64'));}else{_0xe694df[_0xdb09('0x4f')]=_0xdb09('0x65');ut[_0xdb09('0x62')](_0xdb09('0x63'),_0xe694df[_0xdb09('0x2a')]+_0xdb09('0x66'));}emitCampaignPreview(_0xe694df);}}Preview[_0xdb09('0x10')][_0xdb09('0x26')]=function(){var _0x52f149=this;setInterval(function(){_0x52f149[_0xdb09('0x67')]();},0x7cf);};Preview[_0xdb09('0x10')][_0xdb09('0x67')]=function(){var _0x5ee721=this[_0xdb09('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x18bc38 in _0x5ee721){if(_0x5ee721[_0xdb09('0x68')](_0x18bc38)&&(_0x5ee721[_0x18bc38][_0xdb09('0x34')]===_0xdb09('0x69')||_0x5ee721[_0x18bc38][_0xdb09('0x34')]==='booked')&&_0x5ee721[_0x18bc38][_0xdb09('0x28')]==='outbound'){if(this[_0xdb09('0x18')]>0x7){this[_0xdb09('0x18')]=0x0;this[_0xdb09('0x6a')]();}}if(_0x5ee721[_0xdb09('0x68')](_0x18bc38)&&_0x5ee721[_0x18bc38][_0xdb09('0x34')]==='preview'&&_0x5ee721[_0x18bc38][_0xdb09('0x28')]==='outbound'){if(_0x5ee721[_0x18bc38][_0xdb09('0x6b')]){this[_0xdb09('0x6c')](_0x5ee721[_0x18bc38]);this[_0xdb09('0x6d')](_0x5ee721[_0x18bc38]);}else{notSendMessagesQueue(_0x5ee721[_0x18bc38]);}}}};Preview[_0xdb09('0x10')][_0xdb09('0x6e')]=function(_0x5995b8){var _0xeb8931=this;this[_0xdb09('0x12')][_0xdb09('0x6f')](function(){if(!_[_0xdb09('0x70')](_0xeb8931['actions'][_0x5995b8])){loggerAction[_0xdb09('0x71')]('[clearZombieChannels][talking]',_0x5995b8,_0xdb09('0x72'),_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')],'originated:\x20',JSON[_0xdb09('0x74')](_0xeb8931['campaignsPreview'][_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')]][_0xdb09('0x50')]),_0xdb09('0x75'),JSON['stringify'](_0xeb8931[_0xdb09('0x13')][_0xeb8931['actions'][_0x5995b8][_0xdb09('0x73')]][_0xdb09('0x60')]),JSON['stringify'](_0xeb8931['actions'][_0x5995b8][_0xdb09('0x76')]),JSON['stringify'](_[_0xdb09('0x77')](_0xeb8931[_0xdb09('0x16')][_0x5995b8],[_0xdb09('0x78'),_0xdb09('0x79'),_0xdb09('0x7a'),_0xdb09('0x7b')])));return ami['Action']({'action':_0xdb09('0x7c'),'channel':_0xeb8931['actions'][_0x5995b8][_0xdb09('0x7d')]})[_0xdb09('0x7e')](function(_0x4f1dc7){if(_0x4f1dc7[_0xdb09('0x4f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xeb8931['actions'][_0x5995b8]){ut[_0xdb09('0x7f')](_0xeb8931['campaignsPreview'][_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')]],'[clearZombieChannel]');if(_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x76')]===!![]){ut[_0xdb09('0x80')](_0xeb8931[_0xdb09('0x13')][_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')]],_0xdb09('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x5995b8,_0xeb8931[_0xdb09('0x16')][_0x5995b8]['queue']);}ut[_0xdb09('0x82')]('[Dialer][checkChannel][Preview]'+_0x5995b8,_0xeb8931[_0xdb09('0x16')][_0x5995b8][_0xdb09('0x73')]);delete _0xeb8931[_0xdb09('0x16')][_0x5995b8];}},0x2328);}});}});};Preview['prototype'][_0xdb09('0x6a')]=function(){var _0x5b6789=this;loggerAction[_0xdb09('0x71')](_0xdb09('0x83'),_['size'](this['actions']));for(var _0x472579 in this[_0xdb09('0x16')]){if(_0x5b6789[_0xdb09('0x16')]['hasOwnProperty'](_0x472579)){_0x5b6789[_0xdb09('0x6e')](_0x472579);}}};Preview[_0xdb09('0x10')]['recallMe']=function(_0x57a7c3){var _0x1887b7=this;rpcDb[_0xdb09('0x84')](_0x57a7c3['id'],ut[_0xdb09('0x85')](this[_0xdb09('0x17')]))[_0xdb09('0x86')](function(_0x424e50){if(!_[_0xdb09('0x70')](_0x424e50)){for(var _0x48fd2f=0x0;_0x48fd2f<_0x424e50[_0xdb09('0x87')];_0x48fd2f+=0x1){if(ut[_0xdb09('0x88')](_0x424e50[_0x48fd2f][_0xdb09('0x89')])<_0x57a7c3['dialRecallMeTimeout']*0x3c){if(_0x424e50[_0x48fd2f][_0xdb09('0x8a')]&&!_0x424e50[_0x48fd2f][_0xdb09('0x8a')][_0xdb09('0x8b')]){_0x1887b7['run'](_0x424e50[_0x48fd2f]['id'])[_0xdb09('0x86')](ut[_0xdb09('0x8c')](_0xdb09('0x8d')))[_0xdb09('0x7e')](ut[_0xdb09('0x8c')](_0xdb09('0x8d')));}else{rpcDb['disableContact'](_0x424e50[_0x48fd2f]['id']);}}else{var _0x57fe76=new Action(_0x424e50[_0x48fd2f],_0x57a7c3);_0x57fe76['starttime']=moment()['format'](_0xdb09('0x8e'));_0x57a7c3[_0xdb09('0x8f')]+=0x1;ut['logCustomer'](_0x57fe76,0x17,_0xdb09('0x90'));if(_0x57a7c3[_0xdb09('0x91')]){rpcDb[_0xdb09('0x92')](ut[_0xdb09('0x93')](_0x424e50[_0x48fd2f]));rpcDb[_0xdb09('0x94')](_0x57fe76,_0xdb09('0x95'));}else{ut[_0xdb09('0x96')](_0x57fe76,0x16,'RecallFailedTimeout');rpcDb[_0xdb09('0x94')](_0x57fe76,'[HistoryRecallClose]');rpcDb[_0xdb09('0x97')](_0x57fe76,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xdb09('0x8c')]('[getContactRecallMe]'));};Preview[_0xdb09('0x10')][_0xdb09('0x6c')]=function(_0xa7cb05){_0xa7cb05[_0xdb09('0x5f')]=!![];if(ut['IsNotLoggedIn'](_0xa7cb05[_0xdb09('0x98')])){_0xa7cb05[_0xdb09('0x4f')]=_0xdb09('0x99');}else if(!ut[_0xdb09('0x9a')](_0xa7cb05[_0xdb09('0x6b')])){_0xa7cb05['message']=_0xdb09('0x61');}else if(!this[_0xdb09('0x9b')](_0xa7cb05['Trunk'])){if(!this[_0xdb09('0x9b')](_0xa7cb05[_0xdb09('0x9c')])){_0xa7cb05[_0xdb09('0x4f')]='TRUNK_IS_NOT_REACHABLE';}else{_0xa7cb05[_0xdb09('0x4f')]=_0xdb09('0x9d');}}else{_0xa7cb05[_0xdb09('0x4f')]=_0xdb09('0x9d');}emitCampaignPreview(_0xa7cb05);};Preview[_0xdb09('0x10')][_0xdb09('0x9e')]=function(_0xfbbfc4,_0xfc4c48,_0x2a8c76){var _0x1ee32c=this;var _0x26302f=this[_0xdb09('0x16')][_0xfc4c48];var _0x21634e=this[_0xdb09('0x13')][_0x26302f['queue']];var _0x172c44;if(_0x21634e){switch(_0x2a8c76){case'1':_0x21634e[_0xdb09('0x41')]+=0x1;_0x26302f[_0xdb09('0x9f')]+=0x1;_0x26302f['countglobal']=ut['totalGlobal'](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x0,_0xdb09('0xa0'));ami[_0xdb09('0x27')](_0xdb09('0xa1'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xa3')));rpcDb[_0xdb09('0x94')](_0x26302f,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x26302f[_0xdb09('0x9f')]>=_0x21634e[_0xdb09('0xa7')]){rpcDb[_0xdb09('0x97')](_0x26302f,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xdb09('0xa8')](ut['scheduledAt'](_0x26302f,_0xdb09('0x9f'),_0x21634e[_0xdb09('0xa9')]),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}delete this[_0xdb09('0x16')][_0xfbbfc4[_0xdb09('0xac')]];break;case _0xdb09('0xad'):var _0x1b46ee=moment()[_0xdb09('0x5a')](_0xdb09('0x8e'));_0x26302f[_0xdb09('0xae')]=_0x1b46ee;_0x26302f['answertime']=_0x1b46ee;_0x26302f[_0xdb09('0x76')]=!![];_0x21634e[_0xdb09('0x60')]+=0x1;logger[_0xdb09('0x71')](_0xdb09('0xaf'),_0x26302f[_0xdb09('0xb0')],_0xdb09('0xb1'),_0x21634e[_0xdb09('0x2a')],_0xdb09('0x75'),_0x21634e[_0xdb09('0x60')]);ami[_0xdb09('0x27')]('custom:agentconnect',ut['buildObj'](_0x26302f,_0xdb09('0xb2'),this['campaignsPreview'][_0x26302f['queue']]));if(_0x21634e[_0xdb09('0xb3')]){ami[_0xdb09('0x27')](_0xdb09('0xb4'),ut[_0xdb09('0xb5')](_0x26302f));}break;case'16':ami[_0xdb09('0x27')](_0xdb09('0xb6'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xb7'),this[_0xdb09('0x13')][_0x26302f['queue']]));emitVoiceQueueChannelRemove(ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xb7')));_0x21634e[_0xdb09('0x3a')]+=0x1;_0x21634e['total']+=0x1;_0x21634e[_0xdb09('0x2c')]+=0x1;ut[_0xdb09('0x80')](_0x21634e,_0xdb09('0xb8'));_0x26302f[_0xdb09('0xb9')]=ut['totalGlobal'](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x4,_0xdb09('0xba'));rpcDb['createCustomerHistory'](_0x26302f,_0xdb09('0xbb'));rpcDb[_0xdb09('0x97')](_0x26302f,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x26302f);_0x21634e[_0xdb09('0x2f')]+=_0x26302f[_0xdb09('0xbc')];_0x21634e['sumBillable']+=_0x26302f[_0xdb09('0xbc')];logger[_0xdb09('0x71')](_0xdb09('0xbd'),_0x26302f[_0xdb09('0xb0')],_0xdb09('0xb1'),_0x21634e['name'],'pTalking:\x20',_0x21634e[_0xdb09('0x60')]);delete this[_0xdb09('0x16')][_0xfbbfc4['linkedid']];break;case'BUSY':_0x21634e[_0xdb09('0x3c')]+=0x1;_0x26302f[_0xdb09('0xbe')]+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut['logCustomer'](_0x26302f,0x5,_0xdb09('0xc0'));ami[_0xdb09('0x27')](_0xdb09('0xc1'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xc2')));rpcDb[_0xdb09('0x94')](_0x26302f,_0xdb09('0xc3'));if(ut[_0xdb09('0xbf')](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb['createCustomerFinal'](_0x172c44,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x26302f['countbusyretry']>=_0x21634e[_0xdb09('0xc4')]){rpcDb['createCustomerFinal'](_0x26302f,_0xdb09('0xc3'));}else{rpcDb[_0xdb09('0xa8')](ut[_0xdb09('0xc5')](_0x26302f,_0xdb09('0xbe'),_0x21634e[_0xdb09('0xc6')]),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}break;case'NOANSWER':_0x21634e['outboundNoAnswerCallsDay']+=0x1;_0x26302f[_0xdb09('0xc7')]+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x3,'NoAnswer');ami[_0xdb09('0x27')](_0xdb09('0xc8'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xc9')));rpcDb['createCustomerHistory'](_0x26302f,_0xdb09('0xca'));if(ut['totalGlobal'](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xcb'));}else{if(_0x26302f[_0xdb09('0xc7')]>=_0x21634e[_0xdb09('0xcc')]){rpcDb['createCustomerFinal'](_0x26302f,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xdb09('0xa8')](ut[_0xdb09('0xc5')](_0x26302f,'countnoanswerretry',_0x21634e['dialNoAnswerRetryFrequency']),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}break;case _0xdb09('0xcd'):_0x21634e[_0xdb09('0xce')]+=0x1;_0x26302f['countcongestionretry']+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x8,_0xdb09('0xcf'));ami[_0xdb09('0x27')](_0xdb09('0xd0'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xd1')));rpcDb[_0xdb09('0x94')](_0x26302f,_0xdb09('0xd2'));if(ut['totalGlobal'](_0x26302f)>=_0x21634e['dialGlobalMaxRetry']){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xd3'));}else{if(_0x26302f[_0xdb09('0xd4')]>=_0x21634e['dialCongestionMaxRetry']){rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xd2'));}else{rpcDb[_0xdb09('0xa8')](ut['scheduledAt'](_0x26302f,_0xdb09('0xd4'),_0x21634e['dialBusyRetryFrequency']),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}break;case _0xdb09('0xd5'):_0x21634e[_0xdb09('0x42')]+=0x1;_0x26302f[_0xdb09('0xd6')]+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut['logCustomer'](_0x26302f,0x14,_0xdb09('0xd7'));ami[_0xdb09('0x27')](_0xdb09('0xd8'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xd9')));rpcDb['createCustomerHistory'](_0x26302f,_0xdb09('0xda'));if(ut['totalGlobal'](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0x14,_0xdb09('0xd7'));rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xdb'));}else{if(_0x26302f['countagentrejectretry']>=_0x21634e['dialAgentRejectMaxRetry']){rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xdb'));}else{rpcDb[_0xdb09('0xa8')](ut['scheduledAt'](_0x26302f,_0xdb09('0xd6'),_0x21634e['dialAgentRejectRetryFrequency']),_0x26302f[_0xdb09('0xaa')],_0x26302f[_0xdb09('0xab')]);}}break;case _0xdb09('0xdc'):_0x21634e[_0xdb09('0x44')]+=0x1;_0x26302f[_0xdb09('0xdd')]+=0x1;_0x26302f[_0xdb09('0xb9')]=ut[_0xdb09('0xbf')](_0x26302f);ut['logCustomer'](_0x26302f,0xb,'Abandoned');rpcDb[_0xdb09('0x94')](_0x26302f,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xdb09('0xbf')](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb['createCustomerFinal'](_0x172c44,_0xdb09('0xde'));}else{if(_0x26302f['countabandonedetry']>=_0x21634e[_0xdb09('0xdf')]){rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xde'));}else{rpcDb['rescheduleContact'](ut[_0xdb09('0xc5')](_0x26302f,'countabandonedretry',_0x21634e[_0xdb09('0xe0')]),_0x26302f['unlockAgent'],_0x26302f[_0xdb09('0xab')]);}}break;case'18':_0x21634e[_0xdb09('0x43')]+=0x1;_0x26302f[_0xdb09('0xe1')]+=0x1;_0x26302f['countglobal']=ut[_0xdb09('0xbf')](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x12,_0xfbbfc4[_0xdb09('0xe2')]||_0xfbbfc4[_0xdb09('0xe3')]);ami['emit'](_0xdb09('0xe4'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xe5')));rpcDb['createCustomerHistory'](_0x26302f,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xdb09('0xbf')](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xe6'));}else{rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xe6'));}delete this['actions'][_0xfbbfc4[_0xdb09('0xac')]];break;case'19':_0x21634e[_0xdb09('0x43')]+=0x1;_0x26302f['countglobal']=ut['totalGlobal'](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0x13,_0xfbbfc4['cause-txt']||_0xfbbfc4['dialstatus']);ami[_0xdb09('0x27')](_0xdb09('0xe4'),ut[_0xdb09('0xa2')](_0x26302f,_0xdb09('0xe5')));rpcDb[_0xdb09('0x94')](_0x26302f,_0xdb09('0xe7'));if(ut['totalGlobal'](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut[_0xdb09('0xa5')](_0x26302f,0xf,'Global');rpcDb[_0xdb09('0x97')](_0x172c44,_0xdb09('0xe7'));}else{rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xe7'));}delete this[_0xdb09('0x16')][_0xfbbfc4[_0xdb09('0xac')]];break;default:if(_0x26302f['dialAnswer']){ut['decrementTalkink'](_0x21634e,_0xdb09('0xe8'));ut['loggerError'](_0xdb09('0xe9')+_0x21634e[_0xdb09('0x2a')],_0xfbbfc4);}_0x21634e[_0xdb09('0x43')]+=0x1;_0x26302f['countglobal']=ut[_0xdb09('0xbf')](_0x26302f);ut[_0xdb09('0x96')](_0x26302f,0xc,_0xfbbfc4[_0xdb09('0xe2')]||_0xfbbfc4[_0xdb09('0xe3')]);rpcDb[_0xdb09('0x94')](_0x26302f,_0xdb09('0xea'));if(ut[_0xdb09('0xbf')](_0x26302f)>=_0x21634e[_0xdb09('0xa4')]){_0x172c44=ut['cloneAction'](_0x26302f,0xf,_0xdb09('0xa6'));rpcDb[_0xdb09('0x97')](_0x172c44,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xdb09('0x97')](_0x26302f,_0xdb09('0xeb'));}delete this[_0xdb09('0x16')][_0xfbbfc4[_0xdb09('0xac')]];}if(!(_0x26302f[_0xdb09('0x76')]&&_0x2a8c76==='16')){ut['updateOriginated'](_0x21634e,_0xdb09('0xec'));logger[_0xdb09('0x71')](_0xdb09('0xed'),_0x26302f[_0xdb09('0xb0')],_0xdb09('0xb1'),_0x21634e[_0xdb09('0x2a')],_0xdb09('0xee'),_0x21634e[_0xdb09('0x50')]);}if(_0x2a8c76!=='ANSWER'){delete this[_0xdb09('0x16')][_0xfbbfc4[_0xdb09('0xac')]];delete this[_0xdb09('0x16')][_0xfbbfc4['destlinkedid']];}}};Preview['prototype'][_0xdb09('0xef')]=function(_0x16aaed,_0x30cdb3,_0x59ee88){if(_['isUndefined'](_0x30cdb3)&&_0xdb09('0xf0')!==typeof _0x30cdb3){return;}if(_['isUndefined'](_0x59ee88)&&_0xdb09('0xf0')!==typeof _0x59ee88){return;}switch(_0x59ee88[_0xdb09('0xf1')]){case'0':ut[_0xdb09('0xf2')](_0x16aaed,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x16aaed,_0xdb09('0xf3'));break;case'3':ut[_0xdb09('0xf2')](_0x16aaed,0x3,_0xdb09('0xf4'));rpcDb['createAgentHistory'](_0x16aaed,_0xdb09('0xf5'));break;case'5':ut[_0xdb09('0xf2')](_0x16aaed,0x5,_0xdb09('0xc0'));rpcDb[_0xdb09('0xf6')](_0x16aaed,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x16aaed,0x8,_0xdb09('0xcf'));rpcDb[_0xdb09('0xf6')](_0x16aaed,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x16aaed,0x16,_0xdb09('0xf7'));rpcDb[_0xdb09('0xf6')](_0x16aaed,_0xdb09('0xf8'));break;default:ut[_0xdb09('0xf2')](_0x16aaed,0xc,_0x59ee88['reason']);rpcDb[_0xdb09('0xf6')](_0x16aaed,_0xdb09('0xf9'));}ut['updateOriginated'](_0x30cdb3,'[callProgressDetectingAgent]');logger['info'](_0xdb09('0xfa'),_0x16aaed['uniqueid'],_0xdb09('0xb1'),_0x30cdb3[_0xdb09('0x2a')],'originated:\x20',_0x30cdb3[_0xdb09('0x50')]);delete this[_0xdb09('0x16')][_0x16aaed[_0xdb09('0xb0')]];};Preview['prototype'][_0xdb09('0xfb')]=function(_0x25bb73,_0xd20095,_0x4e4725,_0x195f65,_0x102936){var _0x4a7c0a=this;return new BPromise(function(_0x49065b,_0x46308f){if(_['isNil'](_0xd20095)||_[_0xdb09('0x70')](_0xd20095['Contact'])||_['isNil'](_0xd20095['Contact']['phone'])||_[_0xdb09('0x70')](_0xd20095['VoiceQueueId'])){_0x46308f(ut['message']('Contact\x20is\x20undefined',_0x195f65,_0x102936));return;}var _0x37281c=uuid['v4']();var _0x119187=_0x4a7c0a[_0xdb09('0x13')][_0xd20095[_0xdb09('0x72')]['name']];var _0x51c0ca=_0x4e4725?_0x4a7c0a[_0xdb09('0x17')][_0x4e4725]['id']:undefined;_0x4a7c0a[_0xdb09('0x16')][_0x37281c]=new Action(_0xd20095,_0x119187,_0x37281c,_0x4e4725,_0x51c0ca);var _0x1b41ad=_0x4a7c0a['actions'][_0x37281c];_0x1b41ad[_0xdb09('0xaa')]=_0x195f65;_0x1b41ad[_0xdb09('0xab')]=_0x102936;_0x1b41ad[_0xdb09('0xfc')]=_0x4e4725;if(_['isEmpty'](_0x25bb73)){_0x4a7c0a[_0xdb09('0xfd')](_0x1b41ad,_0x119187,_0xd20095,_0x4e4725)[_0xdb09('0x86')](function(_0x20f5b9){logger[_0xdb09('0x71')]('[Preview][execCall][success]',_0xdb09('0xfe')+_0x1b41ad[_0xdb09('0x73')]+_0xdb09('0xff')+_0x1b41ad[_0xdb09('0x100')],JSON[_0xdb09('0x74')](_0x20f5b9));ami[_0xdb09('0x27')](_0xdb09('0x101'),ut[_0xdb09('0xa2')](_0x1b41ad,_0xdb09('0x102'),_0x4a7c0a[_0xdb09('0x13')][_0x1b41ad[_0xdb09('0x73')]]));_0x49065b(ut[_0xdb09('0x4f')](_0xdb09('0x103')));})['catch'](function(_0x3d164e){ut[_0xdb09('0x62')](_0xdb09('0x104'),_0x3d164e);_0x46308f(ut[_0xdb09('0x4f')]('Call\x20failed',_0x195f65,_0x102936));});}else{_0x119187[_0xdb09('0x3b')]+=0x1;ut[_0xdb09('0x105')](_0x1b41ad);rpcDb[_0xdb09('0x106')](_0x1b41ad,_0xdb09('0x107'));delete _0x4a7c0a[_0xdb09('0x16')][_0x37281c];_0x46308f(ut['message']('Contact\x20in\x20black\x20List',_0x195f65,_0x102936));}});};Preview[_0xdb09('0x10')]['isTrunkReachable']=function(_0x584d36){return!_[_0xdb09('0x70')](_0x584d36)&&!_[_0xdb09('0x70')](_0x584d36[_0xdb09('0x2a')])&&!_[_0xdb09('0x70')](_0x584d36['active'])&&_0x584d36['active']&&!_[_0xdb09('0x70')](this[_0xdb09('0x15')][util[_0xdb09('0x5a')](_0xdb09('0x108'),_0x584d36[_0xdb09('0x2a')])])&&!_['isNil'](this[_0xdb09('0x15')][util[_0xdb09('0x5a')]('SIP/%s',_0x584d36['name'])][_0xdb09('0x7c')])&&(this[_0xdb09('0x15')][util[_0xdb09('0x5a')]('SIP/%s',_0x584d36[_0xdb09('0x2a')])][_0xdb09('0x7c')]==='reachable'||this[_0xdb09('0x15')][util[_0xdb09('0x5a')]('SIP/%s',_0x584d36[_0xdb09('0x2a')])][_0xdb09('0x7c')]===_0xdb09('0x109'));};Preview[_0xdb09('0x10')][_0xdb09('0x10a')]=function(_0x5bf0e3,_0x3a0f40){var _0x559f8b=this;return new BPromise(function(_0x249b9a,_0x4ef4a6){_0x559f8b[_0xdb09('0x10b')](_0x5bf0e3,_0x3a0f40)[_0xdb09('0x86')](function(_0x3011f9){_0x249b9a(_[_0xdb09('0x77')](_0x3011f9,[_0xdb09('0x4f')]));})[_0xdb09('0x7e')](function(_0x58de85){if(_0x58de85[_0xdb09('0x10c')]){rpcDb['unlockContact'](_0x5bf0e3);}if(_0x58de85[_0xdb09('0x57')]){rpcDb[_0xdb09('0x10d')](_0x5bf0e3);}_0x4ef4a6(_[_0xdb09('0x77')](_0x58de85,[_0xdb09('0x4f')]));});});};Preview[_0xdb09('0x10')][_0xdb09('0x10b')]=function(_0x438693,_0x15be9e){var _0x13a2d1=this;return new BPromise(function(_0x5d78eb,_0x3f5a27){var _0x43e705,_0x2a9df0;rpcDb[_0xdb09('0x10e')](_0x438693)[_0xdb09('0x86')](function(_0x189660){if(!_[_0xdb09('0x70')](_0x189660[0x0])){_0x2a9df0=_0x189660[0x0]['recallme']?![]:!![];_0x43e705=_0x189660[0x0]['recallme']?!![]:![];_0x43e705=_0x15be9e?!![]:_0x43e705;}var _0x4ee645=_0x13a2d1['validateContact'](_0x189660);if(_0x4ee645[_0xdb09('0x10f')]){rpcDb[_0xdb09('0x110')](_['pick'](_0x189660[0x0],[_0xdb09('0x7a'),'Contact.phone']))['then'](function(_0x358865){_0x13a2d1[_0xdb09('0xfb')](_0x358865,_0x189660[0x0],_0x15be9e,_0x2a9df0,_0x43e705)[_0xdb09('0x86')](function(_0xe1b2e7){_0x5d78eb(_0xe1b2e7);})[_0xdb09('0x7e')](function(_0x53e2e3){_0x3f5a27(_0x53e2e3);});})['catch'](function(_0x4bef31){ut[_0xdb09('0x62')](_0xdb09('0x111'),_0x4bef31);_0x3f5a27(ut['message'](_0xdb09('0x112'),_0x2a9df0,_0x43e705));});}else{_0x3f5a27(ut[_0xdb09('0x4f')](_0x4ee645[_0xdb09('0x4f')],_0x2a9df0,_0x43e705));}})[_0xdb09('0x7e')](function(_0x5f1b8e){ut[_0xdb09('0x62')]('[Preview][getContactPreview]',_0x5f1b8e);_0x3f5a27(ut[_0xdb09('0x4f')](_0xdb09('0x112'),![],!![]));});});};Preview[_0xdb09('0x10')][_0xdb09('0x113')]=function(_0x4f038d){if(_[_0xdb09('0x70')](_0x4f038d)||_[_0xdb09('0x114')](_0x4f038d)||!_[_0xdb09('0x70')](_0x4f038d[0x0][_0xdb09('0x8a')])&&_[_0xdb09('0x70')](_0x4f038d[0x0][_0xdb09('0x8a')][_0xdb09('0x2a')])){ut[_0xdb09('0x62')](_0xdb09('0x115'),_0x4f038d);return{'isValid':![],'message':_0xdb09('0x116')};}var _0x451649=this[_0xdb09('0x13')][_0x4f038d[0x0][_0xdb09('0x72')][_0xdb09('0x2a')]];_0x451649[_0xdb09('0x4f')]=_0xdb09('0x9d');if(_[_0xdb09('0x70')](_0x451649)){ut[_0xdb09('0x62')]('[Preview][validateContact][Empty\x20Campaign]',_0x451649);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xdb09('0x9b')](_0x451649[_0xdb09('0x56')])){ut['logger'](_0xdb09('0x117'),'campaign\x20Name:\x20'+_0x451649[_0xdb09('0x2a')]+_0xdb09('0x118'));if(!this[_0xdb09('0x9b')](_0x451649[_0xdb09('0x9c')])){ut['logger'](_0xdb09('0x117'),_0x451649[_0xdb09('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xdb09('0x119')};}}if(!ut[_0xdb09('0x9a')](_0x451649['dialActive'])){ut[_0xdb09('0x62')]('[Preview][validateContact][Campaign\x20Active]',_0x451649[_0xdb09('0x2a')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xdb09('0x11a')+_0x451649['name']+_0xdb09('0x11b')};}return{'isValid':!![],'message':_0xdb09('0x11c')};};Preview[_0xdb09('0x10')][_0xdb09('0xfd')]=function(_0x467127,_0x50d9a8,_0x198585,_0x5885ad){var _0x25e4cd=this;return new BPromise(function(_0xd0f60e,_0x500904){var _0x3fe96d=_0x467127[_0xdb09('0xb0')];var _0x342ffa=_0x25e4cd[_0xdb09('0x9b')](_0x50d9a8[_0xdb09('0x56')])?util[_0xdb09('0x5a')](_0xdb09('0x11d'),_0x50d9a8['Trunk'][_0xdb09('0x2a')],_[_0xdb09('0x70')](_0x50d9a8[_0xdb09('0x38')])?'':_0x50d9a8['dialPrefix'][_0xdb09('0x11e')]()||'',_0x50d9a8['dialCutDigit']>0x0?_0x198585[_0xdb09('0x11f')]['phone']['substring'](_0x50d9a8[_0xdb09('0x120')]):_0x198585[_0xdb09('0x11f')][_0xdb09('0x121')]):util[_0xdb09('0x5a')](_0xdb09('0x11d'),_['isNil'](_0x50d9a8[_0xdb09('0x9c')])?_0x50d9a8[_0xdb09('0x56')][_0xdb09('0x2a')]:_0x50d9a8[_0xdb09('0x9c')][_0xdb09('0x2a')],_[_0xdb09('0x70')](_0x50d9a8['dialPrefix'])?'':_0x50d9a8['dialPrefix'][_0xdb09('0x11e')]()||'',_0x50d9a8[_0xdb09('0x120')]>0x0?_0x198585[_0xdb09('0x11f')][_0xdb09('0x121')][_0xdb09('0x122')](_0x50d9a8[_0xdb09('0x120')]):_0x198585[_0xdb09('0x11f')][_0xdb09('0x121')]);var _0x1c96bc=_0x25e4cd[_0xdb09('0x9b')](_0x50d9a8[_0xdb09('0x56')])?ut[_0xdb09('0x123')](_0x50d9a8['Trunk'][_0xdb09('0x58')],_0x50d9a8[_0xdb09('0x35')],_0x50d9a8['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xdb09('0x124')](_0x50d9a8[_0xdb09('0x36')],_0x50d9a8['dialRandomLastDigitCallerIdNumber']):_0x50d9a8[_0xdb09('0x36')]):ut[_0xdb09('0x123')](_['isNil'](_0x50d9a8[_0xdb09('0x9c')])?_0x50d9a8[_0xdb09('0x56')][_0xdb09('0x58')]:_0x50d9a8['TrunkBackup'][_0xdb09('0x58')],_0x50d9a8['dialOriginateCallerIdName'],_0x50d9a8[_0xdb09('0x125')]>0x0?ut[_0xdb09('0x124')](_0x50d9a8[_0xdb09('0x36')],_0x50d9a8['dialRandomLastDigitCallerIdNumber']):_0x50d9a8[_0xdb09('0x36')]);if(_0x1c96bc){_0x467127[_0xdb09('0x126')]=ut[_0xdb09('0x127')](_0x1c96bc);_0x467127[_0xdb09('0x128')]=ut[_0xdb09('0x129')](_0x1c96bc);}var _0x536558=ut[_0xdb09('0x12a')](_0x50d9a8,_0x198585,_0x342ffa,_0x1c96bc,_0x3fe96d,_0x467127);_[_0xdb09('0x12b')](_0x467127,ut['toLowerVariables'](_0x536558));_0x467127['starttime']=moment()[_0xdb09('0x5a')](_0xdb09('0x8e'));ami[_0xdb09('0x12c')](ut[_0xdb09('0x12d')](_0x467127,_0x50d9a8,_0x536558,_0x467127[_0xdb09('0xab')],_0x5885ad))[_0xdb09('0x86')](function(_0x36f4cc){var _0x42ae13=_0x467127['channelAgent'];if(!_[_0xdb09('0x70')](_0x42ae13)){if(!_[_0xdb09('0x70')](_0x25e4cd[_0xdb09('0x17')][_0x42ae13])){_0x25e4cd[_0xdb09('0x17')][_0x42ae13][_0xdb09('0x12e')]=_0x467127[_0xdb09('0x12f')];emit(util[_0xdb09('0x5a')]('user:%s',_0x25e4cd[_0xdb09('0x17')][_0x42ae13][_0xdb09('0x2a')]),_0xdb09('0x130'),{'destaccountcode':_0x25e4cd[_0xdb09('0x17')][_0x42ae13][_0xdb09('0x131')],'destconnectedlinenum':_0x467127['calleridnum']});}}_0x50d9a8[_0xdb09('0x50')]+=0x1;logger['info'](_0xdb09('0x132'),_0x3fe96d,'\x20Queue',_0x50d9a8['name'],_0xdb09('0xee'),_0x50d9a8[_0xdb09('0x50')]);_0xd0f60e(_0x36f4cc);})[_0xdb09('0x7e')](function(_0x1b1b94){ut['logAgent'](_0x467127,0xe,_0xdb09('0x133'));rpcDb['createAgentHistory'](_0x467127,'[originateFailure][logOriginateFailure]');_0x500904(_0x1b1b94);});});};Preview[_0xdb09('0x10')][_0xdb09('0x20')]=function(_0x4b4413){if(this[_0xdb09('0x16')][_0x4b4413[_0xdb09('0xac')]]){this[_0xdb09('0x16')][_0x4b4413[_0xdb09('0xac')]][_0xdb09('0x7d')]=_0x4b4413[_0xdb09('0x7d')];}};Preview[_0xdb09('0x10')]['syncOriginateResponse']=function(_0x24029e){var _0x1ab4d0=this;var _0x321166=this['actions'][_0x24029e['actionid']];if(_0x321166){if(_0x321166[_0xdb09('0xfc')]&&this[_0xdb09('0x17')][_0x321166[_0xdb09('0xfc')]]){ut[_0xdb09('0x134')](_0x321166,this[_0xdb09('0x17')][_0x321166[_0xdb09('0xfc')]]['name'],this[_0xdb09('0x17')][_0x321166[_0xdb09('0xfc')]]['id']);}var _0x4ebea3=_[_0xdb09('0x135')](_0x321166);_0x4ebea3[_0xdb09('0xae')]=moment()['format'](_0xdb09('0x8e'));var _0x2783b7=_0x1ab4d0['campaignsPreview'][_0x321166[_0xdb09('0x73')]];if(ut[_0xdb09('0x136')](_0x24029e[_0xdb09('0x137')])){if(_0x321166[_0xdb09('0xaa')]){rpcDb[_0xdb09('0x138')](_0x321166[_0xdb09('0x100')]);}if(_0x321166['activeContact']){rpcDb['disableContact'](_0x321166[_0xdb09('0x100')]);}ami[_0xdb09('0x27')]('custom:agentringnoanswer',ut['buildObj'](_0x321166,_0xdb09('0x139'),this[_0xdb09('0x13')][_0x321166[_0xdb09('0x73')]]));this['callProgressDetectingAgent'](_0x4ebea3,_0x2783b7,_0x24029e);}else{_0x321166[_0xdb09('0x13a')]=moment()[_0xdb09('0x5a')](_0xdb09('0x8e'));ut['logAgent'](_0x4ebea3,0x4,_0xdb09('0xba'));rpcDb[_0xdb09('0xf6')](_0x4ebea3,_0xdb09('0x13b'));}}};Preview[_0xdb09('0x10')]['syncHangup']=function(_0xc8962b){var _0x400797=this;var _0x44f596=this['actions'][_0xc8962b[_0xdb09('0xac')]];var _0x1ed73b;if(_0x44f596){_0x1ed73b=this[_0xdb09('0x13')][_0x44f596[_0xdb09('0x73')]];logger['info'](_0xdb09('0x13c'),_0xc8962b[_0xdb09('0xac')],_0xdb09('0xb1'),_0x1ed73b[_0xdb09('0x2a')],_0xdb09('0x75'),_0x1ed73b['pTalking']);}if(this[_0xdb09('0x16')][_0xc8962b[_0xdb09('0xac')]]&&_0xc8962b[_0xdb09('0xac')]!==_0xc8962b['uniqueid']){if(_0xc8962b[_0xdb09('0x13d')]==='16'&&this[_0xdb09('0x16')][_0xc8962b['linkedid']][_0xdb09('0x76')]){this[_0xdb09('0x9e')](_0xc8962b,_0xc8962b[_0xdb09('0xac')],_0xc8962b['cause']);}else if(this[_0xdb09('0x16')][_0xc8962b['linkedid']][_0xdb09('0x76')]){logger['info'](_0xdb09('0x13e'),_0xc8962b[_0xdb09('0xac')],_0xc8962b[_0xdb09('0x13d')],_0xdb09('0xb1'),_0x1ed73b[_0xdb09('0x2a')],_0xdb09('0x75'),_0x1ed73b['pTalking']);this[_0xdb09('0x9e')](_0xc8962b,_0xc8962b[_0xdb09('0xac')],_0xc8962b[_0xdb09('0x13d')]);}}else if(_0x44f596&&_['isNil'](_0x44f596[_0xdb09('0x13f')])&&_0x1ed73b[_0xdb09('0x140')]&&_0xc8962b[_0xdb09('0xac')]===_0xc8962b['uniqueid']&&_['isNil'](_0xc8962b['reason'])&&_0xc8962b[_0xdb09('0x13d')]==='16'&&_0xc8962b[_0xdb09('0x141')]==='6'&&_[_0xdb09('0x142')](_0x44f596['transfer'])){if(_0x44f596[_0xdb09('0xaa')]){rpcDb[_0xdb09('0x138')](_0x44f596['idContact']);}if(_0x44f596[_0xdb09('0xab')]){rpcDb[_0xdb09('0x10d')](_0x44f596[_0xdb09('0x100')]);}_0xc8962b[_0xdb09('0xf1')]='22';this[_0xdb09('0xef')](_0x44f596,_0x1ed73b,_0xc8962b);}else if(_0x44f596&&_0x44f596[_0xdb09('0x143')]){if(_0xc8962b['cause']==='16'&&this[_0xdb09('0x16')][_0xc8962b[_0xdb09('0xac')]][_0xdb09('0x76')]){logger[_0xdb09('0x71')]('[syncHangup][talking][transfer]',_0xc8962b[_0xdb09('0xac')],_0xc8962b['cause'],_0xdb09('0xb1'),_0x1ed73b[_0xdb09('0x2a')],_0xdb09('0x75'),_0x1ed73b['pTalking']);this[_0xdb09('0x9e')](_0xc8962b,_0xc8962b['linkedid'],_0xc8962b[_0xdb09('0x13d')]);}else if(this[_0xdb09('0x16')][_0xc8962b['linkedid']][_0xdb09('0x76')]){logger[_0xdb09('0x71')](_0xdb09('0x13e'),_0xc8962b[_0xdb09('0xac')],_0xc8962b[_0xdb09('0x13d')],_0xdb09('0xb1'),_0x1ed73b[_0xdb09('0x2a')],_0xdb09('0x75'),_0x1ed73b[_0xdb09('0x60')]);this[_0xdb09('0x9e')](_0xc8962b,_0xc8962b[_0xdb09('0xac')],_0xc8962b[_0xdb09('0x13d')]);}}};Preview['prototype']['syncDialEnd']=function(_0x588bde){if(this[_0xdb09('0x16')][_0x588bde[_0xdb09('0x144')]]&&_0x588bde[_0xdb09('0x144')]!==_0x588bde[_0xdb09('0x145')]){this[_0xdb09('0x9e')](_0x588bde,_0x588bde[_0xdb09('0x144')],_0x588bde[_0xdb09('0xe3')]);}};Preview[_0xdb09('0x10')][_0xdb09('0x1f')]=function(_0x4a7543){if(this[_0xdb09('0x16')][_0x4a7543[_0xdb09('0xac')]]&&_0x4a7543[_0xdb09('0xac')]!==_0x4a7543[_0xdb09('0xb0')]&&!this[_0xdb09('0x16')][_0x4a7543[_0xdb09('0xac')]][_0xdb09('0x76')]){if(_0x4a7543[_0xdb09('0x13d')]==='1'){this[_0xdb09('0x9e')](_0x4a7543,_0x4a7543[_0xdb09('0xac')],_0x4a7543['cause']);}}};Preview['prototype'][_0xdb09('0x146')]=function(_0x7a0237,_0x5994b8,_0x14fb72){if(this[_0xdb09('0x16')][_0x7a0237]){if(_[_0xdb09('0x70')](this[_0xdb09('0x16')][_0x7a0237][_0xdb09('0x147')])){this['actions'][_0x7a0237]['variables']={};}this[_0xdb09('0x16')][_0x7a0237][_0xdb09('0x147')][_0x5994b8]=_0x14fb72;}};Preview['prototype'][_0xdb09('0x22')]=function(_0x1a0e05){try{if(!_[_0xdb09('0x70')](_0x1a0e05)){if(ut[_0xdb09('0x148')](_[_0xdb09('0x149')](_0x1a0e05[_0xdb09('0x14a')])[0x0])){this['addVariable'](_0x1a0e05['uniqueid'],_['keys'](_0x1a0e05[_0xdb09('0x14a')])[0x0],_0x1a0e05[_0xdb09('0x14b')]);}}}catch(_0x1e8be8){logger[_0xdb09('0x14c')](_0xdb09('0x14d'),util[_0xdb09('0x14e')](_0x1e8be8,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xdb09('0x24')]=function(_0x244448){if(_0x244448){if(this[_0xdb09('0x16')][_0x244448[_0xdb09('0x14f')]]){this['actions'][_0x244448[_0xdb09('0x14f')]][_0xdb09('0x143')]=!![];}}};Preview[_0xdb09('0x10')][_0xdb09('0x25')]=function(_0x52f20d){if(_0x52f20d){if(this['actions'][_0x52f20d[_0xdb09('0x150')]]){this[_0xdb09('0x16')][_0x52f20d['transfererlinkedid']][_0xdb09('0x143')]=!![];}}};module[_0xdb09('0x151')]=Preview; \ No newline at end of file +var _0x9249=['[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','unlockAgent','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlock','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','validateContact','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','callerid','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','[originated][increment]','OriginateError','actionid','logLookAgent','clone','isFailure','response','idContact','[callProgressDetectingAgent][logAnswer]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','syncHangupRequest','variables','filterKey','keys','variable','addVariable','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','syncHangup','bind','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','outbound','strategy','answered','available','loggedIn','pTalking','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','name','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_presence:remove','originated','paused','NOT_ACTIVE','IS_DISACTIVED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','hasOwnProperty','preview','booked','clearZombieChannels','setMessage','clearZombieChannel','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','isNil','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','catch','[getContactRecallMe]','sendMessageOneNotActive','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','responsetime','answertime','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','complete','Answer'];(function(_0x54157d,_0xd13e80){var _0x26e96d=function(_0x4de10e){while(--_0x4de10e){_0x54157d['push'](_0x54157d['shift']());}};_0x26e96d(++_0xd13e80);}(_0x9249,0x1ee));var _0x9924=function(_0x48e6f1,_0x1bd3e8){_0x48e6f1=_0x48e6f1-0x0;var _0x154ae1=_0x9249[_0x48e6f1];return _0x154ae1;};'use strict';var util=require(_0x9924('0x0'));var _=require(_0x9924('0x1'));var BPromise=require(_0x9924('0x2'));var uuid=require(_0x9924('0x3'));var moment=require('moment');var md5=require(_0x9924('0x4'));var Redis=require(_0x9924('0x5'));var config=require(_0x9924('0x6'));var logger=require(_0x9924('0x7'))('preview');var loggerAction=require(_0x9924('0x7'))(_0x9924('0x8'));var ami=require(_0x9924('0x9'));var rpcDb=require(_0x9924('0xa'));var Action=require(_0x9924('0xb'));var ut=require(_0x9924('0xc'));config[_0x9924('0xd')]=_[_0x9924('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9924('0xf'))(new Redis(config[_0x9924('0xd')]));var Sequence=function(){};Sequence[_0x9924('0x10')][_0x9924('0x11')]=function(_0x171d90){this[_0x9924('0x12')]=this[_0x9924('0x12')]?this[_0x9924('0x12')][_0x9924('0x13')](_0x171d90):_0x171d90();};function Preview(_0x7a0e21){this[_0x9924('0x14')]=new Sequence();this['campaignsPreview']=_0x7a0e21['voiceQueues'];this[_0x9924('0x15')]=_0x7a0e21[_0x9924('0x15')];this[_0x9924('0x16')]={};this['agents']=_0x7a0e21[_0x9924('0x17')];this[_0x9924('0x18')]=0x0;ami['on']('originateresponse',this[_0x9924('0x19')]['bind'](this));ami['on'](_0x9924('0x1a'),this[_0x9924('0x1b')][_0x9924('0x1c')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x9924('0x1c')](this));ami['on'](_0x9924('0x1d'),this[_0x9924('0x1e')][_0x9924('0x1c')](this));ami['on'](_0x9924('0x1f'),this[_0x9924('0x20')][_0x9924('0x1c')](this));ami['on'](_0x9924('0x21'),this[_0x9924('0x22')]['bind'](this));ami['on'](_0x9924('0x23'),this[_0x9924('0x24')][_0x9924('0x1c')](this));ami['on'](_0x9924('0x25'),this[_0x9924('0x26')][_0x9924('0x1c')](this));this[_0x9924('0x27')](this[_0x9924('0x28')]);}function emit(_0x164666,_0x189717,_0x30796d){io['to'](_0x164666)[_0x9924('0x29')](_0x189717,_0x30796d);}function emitCampaignPreview(_0xb981af){if(_0xb981af['type']===_0x9924('0x2a')){var _0x29d66e={'id':_0xb981af['id'],'name':_0xb981af['name'],'strategy':_0xb981af[_0x9924('0x2b')],'answered':_0xb981af[_0x9924('0x2c')],'available':_0xb981af[_0x9924('0x2d')],'loggedIn':_0xb981af[_0x9924('0x2e')],'pTalking':_0xb981af[_0x9924('0x2f')],'sumBillable':_0xb981af['sumBillable'],'sumDuration':_0xb981af['sumDuration'],'sumHoldTime':_0xb981af['sumHoldTime']||0x0,'talking':_0xb981af[_0x9924('0x30')],'total':_0xb981af[_0x9924('0x31')],'type':_0xb981af[_0x9924('0x32')],'unmanaged':_0xb981af[_0x9924('0x33')],'abandoned':_0xb981af[_0x9924('0x34')],'waiting':_0xb981af[_0x9924('0x35')],'loggedInDb':_0xb981af[_0x9924('0x36')],'dialActive':_0xb981af[_0x9924('0x37')],'dialMethod':_0xb981af[_0x9924('0x38')],'dialOriginateCallerIdName':_0xb981af[_0x9924('0x39')],'dialOriginateCallerIdNumber':_0xb981af[_0x9924('0x3a')],'dialOriginateTimeout':_0xb981af['dialOriginateTimeout'],'dialPrefix':_0xb981af[_0x9924('0x3b')],'outboundAnswerAgiCallsDay':_0xb981af[_0x9924('0x3c')],'outboundAnswerCallsDay':_0xb981af[_0x9924('0x3d')],'outboundBlacklistCallsDay':_0xb981af[_0x9924('0x3e')],'outboundBusyCallsDay':_0xb981af[_0x9924('0x3f')],'outboundCongestionCallsDay':_0xb981af[_0x9924('0x40')],'outboundDropCallsDayACS':_0xb981af['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0xb981af[_0x9924('0x41')],'outboundDropCallsDayTimeout':_0xb981af['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xb981af[_0x9924('0x42')],'outboundNoSuchCallsDay':_0xb981af[_0x9924('0x43')],'outboundOriginateFailureCallsDay':_0xb981af[_0x9924('0x44')],'outboundReCallsDay':_0xb981af[_0x9924('0x45')],'outboundRejectCallsDay':_0xb981af[_0x9924('0x46')],'outboundUnknownCallsDay':_0xb981af[_0x9924('0x47')],'outboundAbandonedCallsDay':_0xb981af[_0x9924('0x48')],'predictiveIntervalAnsweredCalls':_0xb981af[_0x9924('0x49')],'predictiveIntervalAvgHoldtime':_0xb981af[_0x9924('0x4a')],'predictiveIntervalAvgTalktime':_0xb981af[_0x9924('0x4b')],'predictiveIntervalDroppedCallsCallersExit':_0xb981af['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0xb981af[_0x9924('0x4c')],'predictiveIntervalErlangCalls':_0xb981af[_0x9924('0x4d')],'predictiveIntervalErlangCallsDroppedCalls':_0xb981af['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xb981af[_0x9924('0x4e')],'predictiveIntervalMultiplicativeFactor':_0xb981af[_0x9924('0x4f')],'predictiveIntervalPauses':_0xb981af['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xb981af[_0x9924('0x50')],'predictiveIntervalTotalCalls':_0xb981af[_0x9924('0x51')],'message':_0xb981af[_0x9924('0x52')],'originated':_0xb981af['originated'],'erlangCalls':_0xb981af[_0x9924('0x53')],'erlangCallToSecond':_0xb981af[_0x9924('0x54')],'erlangAbandonmentRate':_0xb981af[_0x9924('0x55')],'erlangBusyFactor':_0xb981af['erlangBusyFactor'],'startPredictive':_0xb981af[_0x9924('0x56')],'startProgressive':_0xb981af[_0x9924('0x57')]};if(_0xb981af['Trunk']){_0x29d66e['Trunk']={'id':_0xb981af['Trunk']['id'],'name':_0xb981af[_0x9924('0x58')][_0x9924('0x59')],'active':_0xb981af['Trunk'][_0x9924('0x5a')],'callerid':_0xb981af['Trunk']['callerid']};}if(_0xb981af[_0x9924('0x5b')]){_0x29d66e[_0x9924('0x5b')]={'id':_0xb981af['Interval']['id'],'name':_0xb981af['Interval'][_0x9924('0x59')]};}var _0x16f4df=md5(JSON[_0x9924('0x5c')](_0x29d66e));if(_0xb981af[_0x9924('0x4')]!==_0x16f4df){_0xb981af['md5']=_0x16f4df;emit(util[_0x9924('0x5d')](_0x9924('0x5e'),_0x29d66e[_0x9924('0x59')]),_0x9924('0x5f'),_0x29d66e);}}}function emitVoiceQueueChannelRemove(_0x4f5d6f){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x9924('0x5c')](_0x4f5d6f));emit(util[_0x9924('0x5d')](_0x9924('0x5e'),_0x4f5d6f[_0x9924('0x59')]),'voice_queue_channel:remove',_0x4f5d6f);io[_0x9924('0x29')](_0x9924('0x60'),_0x4f5d6f);}function notSendMessagesQueue(_0x3173d9){if(_0x3173d9['sendMessageOneNotActive']){if(_0x3173d9[_0x9924('0x61')]===0x0&&_0x3173d9[_0x9924('0x2f')]===0x0){_0x3173d9['sendMessageOneNotActive']=![];_0x3173d9[_0x9924('0x2d')]=0x0;_0x3173d9[_0x9924('0x62')]=0x0;_0x3173d9[_0x9924('0x52')]=_0x9924('0x63');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3173d9[_0x9924('0x59')]+'\x20is\x20not\x20active');}else{_0x3173d9[_0x9924('0x52')]=_0x9924('0x64');ut[_0x9924('0x65')](_0x9924('0x66'),_0x3173d9[_0x9924('0x59')]+_0x9924('0x67'));}emitCampaignPreview(_0x3173d9);}}Preview[_0x9924('0x10')]['loopCampaigns']=function(){var _0x15fd74=this;setInterval(function(){_0x15fd74['syncCampaigns']();},0x7cf);};Preview[_0x9924('0x10')]['syncCampaigns']=function(){var _0x143680=this[_0x9924('0x28')];this[_0x9924('0x18')]+=0x1;for(var _0x30171f in _0x143680){if(_0x143680[_0x9924('0x68')](_0x30171f)&&(_0x143680[_0x30171f]['dialMethod']===_0x9924('0x69')||_0x143680[_0x30171f]['dialMethod']===_0x9924('0x6a'))&&_0x143680[_0x30171f][_0x9924('0x32')]===_0x9924('0x2a')){if(this[_0x9924('0x18')]>0x7){this[_0x9924('0x18')]=0x0;this[_0x9924('0x6b')]();}}if(_0x143680[_0x9924('0x68')](_0x30171f)&&_0x143680[_0x30171f]['dialMethod']==='preview'&&_0x143680[_0x30171f]['type']===_0x9924('0x2a')){if(_0x143680[_0x30171f][_0x9924('0x37')]){this[_0x9924('0x6c')](_0x143680[_0x30171f]);this['recallMe'](_0x143680[_0x30171f]);}else{notSendMessagesQueue(_0x143680[_0x30171f]);}}}};Preview[_0x9924('0x10')][_0x9924('0x6d')]=function(_0x30399f){var _0x5c0195=this;this[_0x9924('0x14')][_0x9924('0x11')](function(){if(!_['isNil'](_0x5c0195[_0x9924('0x16')][_0x30399f])){loggerAction[_0x9924('0x6e')](_0x9924('0x6f'),_0x30399f,_0x9924('0x70'),_0x5c0195[_0x9924('0x16')][_0x30399f][_0x9924('0x71')],_0x9924('0x72'),JSON[_0x9924('0x5c')](_0x5c0195['campaignsPreview'][_0x5c0195[_0x9924('0x16')][_0x30399f]['queue']]['originated']),_0x9924('0x73'),JSON[_0x9924('0x5c')](_0x5c0195[_0x9924('0x28')][_0x5c0195[_0x9924('0x16')][_0x30399f][_0x9924('0x71')]][_0x9924('0x2f')]),JSON['stringify'](_0x5c0195[_0x9924('0x16')][_0x30399f][_0x9924('0x74')]),JSON[_0x9924('0x5c')](_[_0x9924('0x75')](_0x5c0195[_0x9924('0x16')][_0x30399f],[_0x9924('0x76'),_0x9924('0x77'),_0x9924('0x78'),_0x9924('0x79')])));return ami[_0x9924('0x7a')]({'action':_0x9924('0x7b'),'channel':_0x5c0195['actions'][_0x30399f][_0x9924('0x7c')]})['catch'](function(_0x1021f2){if(_0x1021f2[_0x9924('0x52')]===_0x9924('0x7d')){setTimeout(function(){if(_0x5c0195[_0x9924('0x16')][_0x30399f]){ut[_0x9924('0x7e')](_0x5c0195[_0x9924('0x28')][_0x5c0195[_0x9924('0x16')][_0x30399f][_0x9924('0x71')]],_0x9924('0x7f'));if(_0x5c0195[_0x9924('0x16')][_0x30399f][_0x9924('0x74')]===!![]){ut[_0x9924('0x80')](_0x5c0195[_0x9924('0x28')][_0x5c0195[_0x9924('0x16')][_0x30399f]['queue']],_0x9924('0x7f'));ut['loggerError'](_0x9924('0x81')+_0x30399f,_0x5c0195[_0x9924('0x16')][_0x30399f][_0x9924('0x71')]);}ut[_0x9924('0x82')](_0x9924('0x83')+_0x30399f,_0x5c0195[_0x9924('0x16')][_0x30399f][_0x9924('0x71')]);delete _0x5c0195[_0x9924('0x16')][_0x30399f];}},0x2328);}});}});};Preview[_0x9924('0x10')]['clearZombieChannels']=function(){var _0x1700dd=this;loggerAction[_0x9924('0x6e')](_0x9924('0x84'),_[_0x9924('0x85')](this[_0x9924('0x16')]));for(var _0x2a0bd5 in this[_0x9924('0x16')]){if(_0x1700dd[_0x9924('0x16')][_0x9924('0x68')](_0x2a0bd5)){_0x1700dd[_0x9924('0x6d')](_0x2a0bd5);}}};Preview[_0x9924('0x10')]['recallMe']=function(_0x382d8b){var _0x1e4339=this;rpcDb['getContactRecallMe'](_0x382d8b['id'],ut[_0x9924('0x86')](this[_0x9924('0x17')]))[_0x9924('0x87')](function(_0xf7eb94){if(!_[_0x9924('0x88')](_0xf7eb94)){for(var _0x8e56b=0x0;_0x8e56b<_0xf7eb94[_0x9924('0x89')];_0x8e56b+=0x1){if(ut['getDiff'](_0xf7eb94[_0x8e56b][_0x9924('0x8a')])<_0x382d8b[_0x9924('0x8b')]*0x3c){if(_0xf7eb94[_0x8e56b][_0x9924('0x8c')]&&!_0xf7eb94[_0x8e56b][_0x9924('0x8c')][_0x9924('0x8d')]){_0x1e4339[_0x9924('0x8e')](_0xf7eb94[_0x8e56b]['id'])[_0x9924('0x87')](ut[_0x9924('0x8f')](_0x9924('0x90')))['catch'](ut[_0x9924('0x8f')](_0x9924('0x90')));}else{rpcDb[_0x9924('0x91')](_0xf7eb94[_0x8e56b]['id']);}}else{var _0x111104=new Action(_0xf7eb94[_0x8e56b],_0x382d8b);_0x111104[_0x9924('0x92')]=moment()[_0x9924('0x5d')](_0x9924('0x93'));_0x382d8b[_0x9924('0x45')]+=0x1;ut['logCustomer'](_0x111104,0x17,_0x9924('0x94'));if(_0x382d8b[_0x9924('0x95')]){rpcDb['rescheduleContactInQueue'](ut[_0x9924('0x96')](_0xf7eb94[_0x8e56b]));rpcDb[_0x9924('0x97')](_0x111104,_0x9924('0x98'));}else{ut[_0x9924('0x99')](_0x111104,0x16,_0x9924('0x9a'));rpcDb[_0x9924('0x97')](_0x111104,_0x9924('0x9b'));rpcDb[_0x9924('0x9c')](_0x111104,_0x9924('0x9b'));}}}}})[_0x9924('0x9d')](ut[_0x9924('0x8f')](_0x9924('0x9e')));};Preview['prototype'][_0x9924('0x6c')]=function(_0x44e3ea){_0x44e3ea[_0x9924('0x9f')]=!![];if(ut[_0x9924('0xa0')](_0x44e3ea[_0x9924('0x2e')])){_0x44e3ea[_0x9924('0x52')]=_0x9924('0xa1');}else if(!ut['isActive'](_0x44e3ea['dialActive'])){_0x44e3ea[_0x9924('0x52')]=_0x9924('0x63');}else if(!this[_0x9924('0xa2')](_0x44e3ea[_0x9924('0x58')])){if(!this[_0x9924('0xa2')](_0x44e3ea[_0x9924('0xa3')])){_0x44e3ea[_0x9924('0x52')]='TRUNK_IS_NOT_REACHABLE';}else{_0x44e3ea[_0x9924('0x52')]=_0x9924('0xa4');}}else{_0x44e3ea['message']=_0x9924('0xa4');}emitCampaignPreview(_0x44e3ea);};Preview['prototype'][_0x9924('0xa5')]=function(_0x5f70c9,_0x3db1e8,_0xbe02ec){var _0x33ec1a=this;var _0xdd4feb=this['actions'][_0x3db1e8];var _0x360e83=this[_0x9924('0x28')][_0xdd4feb[_0x9924('0x71')]];var _0x3910f3;if(_0x360e83){switch(_0xbe02ec){case'1':_0x360e83[_0x9924('0x43')]+=0x1;_0xdd4feb[_0x9924('0xa6')]+=0x1;_0xdd4feb[_0x9924('0xa7')]=ut[_0x9924('0xa8')](_0xdd4feb);ut[_0x9924('0x99')](_0xdd4feb,0x0,_0x9924('0xa9'));ami[_0x9924('0x29')]('custom:agentnosuchnumber',ut[_0x9924('0xaa')](_0xdd4feb,_0x9924('0xab')));rpcDb['createCustomerHistory'](_0xdd4feb,_0x9924('0xac'));if(ut[_0x9924('0xa8')](_0xdd4feb)>=_0x360e83[_0x9924('0xad')]){_0x3910f3=ut[_0x9924('0xae')](_0xdd4feb,0xf,_0x9924('0xaf'));rpcDb[_0x9924('0x9c')](_0x3910f3,_0x9924('0xb0'));}else{if(_0xdd4feb[_0x9924('0xa6')]>=_0x360e83[_0x9924('0xb1')]){rpcDb[_0x9924('0x9c')](_0xdd4feb,_0x9924('0xb0'));}else{rpcDb[_0x9924('0xb2')](ut[_0x9924('0xb3')](_0xdd4feb,_0x9924('0xa6'),_0x360e83[_0x9924('0xb4')]),_0xdd4feb['unlockAgent'],_0xdd4feb['activeContact']);}}delete this[_0x9924('0x16')][_0x5f70c9['linkedid']];break;case'ANSWER':var _0x5a9d18=moment()[_0x9924('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0xdd4feb[_0x9924('0xb5')]=_0x5a9d18;_0xdd4feb[_0x9924('0xb6')]=_0x5a9d18;_0xdd4feb[_0x9924('0x74')]=!![];_0x360e83[_0x9924('0x2f')]+=0x1;logger[_0x9924('0x6e')]('[syncHangup][talking][increment]',_0xdd4feb[_0x9924('0xb7')],_0x9924('0xb8'),_0x360e83['name'],'pTalking:\x20',_0x360e83['pTalking']);ami[_0x9924('0x29')]('custom:agentconnect',ut[_0x9924('0xaa')](_0xdd4feb,_0x9924('0xb9'),this[_0x9924('0x28')][_0xdd4feb[_0x9924('0x71')]]));if(_0x360e83[_0x9924('0xba')]){ami[_0x9924('0x29')](_0x9924('0xbb'),ut['buildAcw'](_0xdd4feb));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x9924('0xaa')](_0xdd4feb,_0x9924('0xbc'),this[_0x9924('0x28')][_0xdd4feb['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0xdd4feb,_0x9924('0xbc')));_0x360e83[_0x9924('0x3d')]+=0x1;_0x360e83[_0x9924('0x31')]+=0x1;_0x360e83[_0x9924('0x2c')]+=0x1;ut[_0x9924('0x80')](_0x360e83,'[16]');_0xdd4feb[_0x9924('0xa7')]=ut[_0x9924('0xa8')](_0xdd4feb);ut[_0x9924('0x99')](_0xdd4feb,0x4,_0x9924('0xbd'));rpcDb['createCustomerHistory'](_0xdd4feb,_0x9924('0xbe'));rpcDb['createCustomerFinal'](_0xdd4feb,_0x9924('0xbf'));rpcDb[_0x9924('0xc0')](_0xdd4feb);_0x360e83[_0x9924('0xc1')]+=_0xdd4feb[_0x9924('0xc2')];_0x360e83[_0x9924('0xc3')]+=_0xdd4feb[_0x9924('0xc2')];logger[_0x9924('0x6e')](_0x9924('0xc4'),_0xdd4feb['uniqueid'],_0x9924('0xb8'),_0x360e83['name'],'pTalking:\x20',_0x360e83[_0x9924('0x2f')]);delete this[_0x9924('0x16')][_0x5f70c9[_0x9924('0xc5')]];break;case _0x9924('0xc6'):_0x360e83[_0x9924('0x3f')]+=0x1;_0xdd4feb[_0x9924('0xc7')]+=0x1;_0xdd4feb[_0x9924('0xa7')]=ut['totalGlobal'](_0xdd4feb);ut['logCustomer'](_0xdd4feb,0x5,_0x9924('0xc8'));ami[_0x9924('0x29')](_0x9924('0xc9'),ut['buildObj'](_0xdd4feb,'busy'));rpcDb['createCustomerHistory'](_0xdd4feb,_0x9924('0xca'));if(ut[_0x9924('0xa8')](_0xdd4feb)>=_0x360e83[_0x9924('0xad')]){_0x3910f3=ut['cloneAction'](_0xdd4feb,0xf,_0x9924('0xaf'));rpcDb[_0x9924('0x9c')](_0x3910f3,_0x9924('0xcb'));}else{if(_0xdd4feb[_0x9924('0xc7')]>=_0x360e83[_0x9924('0xcc')]){rpcDb[_0x9924('0x9c')](_0xdd4feb,_0x9924('0xca'));}else{rpcDb[_0x9924('0xb2')](ut['scheduledAt'](_0xdd4feb,_0x9924('0xc7'),_0x360e83['dialBusyRetryFrequency']),_0xdd4feb['unlockAgent'],_0xdd4feb[_0x9924('0xcd')]);}}break;case _0x9924('0xce'):_0x360e83['outboundNoAnswerCallsDay']+=0x1;_0xdd4feb[_0x9924('0xcf')]+=0x1;_0xdd4feb['countglobal']=ut[_0x9924('0xa8')](_0xdd4feb);ut['logCustomer'](_0xdd4feb,0x3,_0x9924('0xd0'));ami['emit'](_0x9924('0xd1'),ut[_0x9924('0xaa')](_0xdd4feb,'noanswer'));rpcDb[_0x9924('0x97')](_0xdd4feb,_0x9924('0xd2'));if(ut[_0x9924('0xa8')](_0xdd4feb)>=_0x360e83[_0x9924('0xad')]){_0x3910f3=ut[_0x9924('0xae')](_0xdd4feb,0xf,_0x9924('0xaf'));rpcDb[_0x9924('0x9c')](_0x3910f3,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0xdd4feb['countnoanswerretry']>=_0x360e83['dialNoAnswerMaxRetry']){rpcDb[_0x9924('0x9c')](_0xdd4feb,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x9924('0xb2')](ut[_0x9924('0xb3')](_0xdd4feb,_0x9924('0xcf'),_0x360e83['dialNoAnswerRetryFrequency']),_0xdd4feb['unlockAgent'],_0xdd4feb[_0x9924('0xcd')]);}}break;case'CONGESTION':_0x360e83[_0x9924('0x40')]+=0x1;_0xdd4feb[_0x9924('0xd3')]+=0x1;_0xdd4feb[_0x9924('0xa7')]=ut[_0x9924('0xa8')](_0xdd4feb);ut[_0x9924('0x99')](_0xdd4feb,0x8,_0x9924('0xd4'));ami[_0x9924('0x29')](_0x9924('0xd5'),ut[_0x9924('0xaa')](_0xdd4feb,_0x9924('0xd6')));rpcDb[_0x9924('0x97')](_0xdd4feb,_0x9924('0xd7'));if(ut[_0x9924('0xa8')](_0xdd4feb)>=_0x360e83[_0x9924('0xad')]){_0x3910f3=ut[_0x9924('0xae')](_0xdd4feb,0xf,'Global');rpcDb[_0x9924('0x9c')](_0x3910f3,_0x9924('0xd8'));}else{if(_0xdd4feb[_0x9924('0xd3')]>=_0x360e83['dialCongestionMaxRetry']){rpcDb[_0x9924('0x9c')](_0xdd4feb,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x9924('0xb3')](_0xdd4feb,'countcongestionretry',_0x360e83[_0x9924('0xd9')]),_0xdd4feb['unlockAgent'],_0xdd4feb[_0x9924('0xcd')]);}}break;case _0x9924('0xda'):_0x360e83[_0x9924('0x46')]+=0x1;_0xdd4feb[_0x9924('0xdb')]+=0x1;_0xdd4feb[_0x9924('0xa7')]=ut['totalGlobal'](_0xdd4feb);ut[_0x9924('0x99')](_0xdd4feb,0x14,_0x9924('0xdc'));ami[_0x9924('0x29')](_0x9924('0xdd'),ut[_0x9924('0xaa')](_0xdd4feb,_0x9924('0xde')));rpcDb[_0x9924('0x97')](_0xdd4feb,_0x9924('0xdf'));if(ut[_0x9924('0xa8')](_0xdd4feb)>=_0x360e83[_0x9924('0xad')]){_0x3910f3=ut['cloneAction'](_0xdd4feb,0x14,_0x9924('0xdc'));rpcDb['createCustomerFinal'](_0x3910f3,_0x9924('0xe0'));}else{if(_0xdd4feb[_0x9924('0xdb')]>=_0x360e83[_0x9924('0xe1')]){rpcDb[_0x9924('0x9c')](_0xdd4feb,_0x9924('0xe0'));}else{rpcDb['rescheduleContact'](ut[_0x9924('0xb3')](_0xdd4feb,_0x9924('0xdb'),_0x360e83[_0x9924('0xe2')]),_0xdd4feb[_0x9924('0xe3')],_0xdd4feb['activeContact']);}}break;case _0x9924('0xe4'):_0x360e83[_0x9924('0x48')]+=0x1;_0xdd4feb[_0x9924('0xe5')]+=0x1;_0xdd4feb['countglobal']=ut[_0x9924('0xa8')](_0xdd4feb);ut[_0x9924('0x99')](_0xdd4feb,0xb,_0x9924('0xe6'));rpcDb['createCustomerHistory'](_0xdd4feb,_0x9924('0xe7'));if(ut['totalGlobal'](_0xdd4feb)>=_0x360e83[_0x9924('0xad')]){_0x3910f3=ut['cloneAction'](_0xdd4feb,0xf,'Global');rpcDb[_0x9924('0x9c')](_0x3910f3,_0x9924('0xe7'));}else{if(_0xdd4feb[_0x9924('0xe8')]>=_0x360e83['dialAbandonedMaxRety']){rpcDb[_0x9924('0x9c')](_0xdd4feb,_0x9924('0xe7'));}else{rpcDb[_0x9924('0xb2')](ut[_0x9924('0xb3')](_0xdd4feb,_0x9924('0xe5'),_0x360e83[_0x9924('0xe9')]),_0xdd4feb[_0x9924('0xe3')],_0xdd4feb[_0x9924('0xcd')]);}}break;case'18':_0x360e83['outboundUnknownCallsDay']+=0x1;_0xdd4feb['countmachineretry']+=0x1;_0xdd4feb[_0x9924('0xa7')]=ut[_0x9924('0xa8')](_0xdd4feb);ut['logCustomer'](_0xdd4feb,0x12,_0x5f70c9[_0x9924('0xea')]||_0x5f70c9[_0x9924('0xeb')]);ami[_0x9924('0x29')](_0x9924('0xec'),ut[_0x9924('0xaa')](_0xdd4feb,_0x9924('0xed')));rpcDb[_0x9924('0x97')](_0xdd4feb,_0x9924('0xee'));if(ut[_0x9924('0xa8')](_0xdd4feb)>=_0x360e83['dialGlobalMaxRetry']){_0x3910f3=ut[_0x9924('0xae')](_0xdd4feb,0xf,'Global');rpcDb['createCustomerFinal'](_0x3910f3,_0x9924('0xee'));}else{rpcDb[_0x9924('0x9c')](_0xdd4feb,_0x9924('0xee'));}delete this[_0x9924('0x16')][_0x5f70c9['linkedid']];break;case'19':_0x360e83[_0x9924('0x47')]+=0x1;_0xdd4feb[_0x9924('0xa7')]=ut[_0x9924('0xa8')](_0xdd4feb);ut[_0x9924('0x99')](_0xdd4feb,0x13,_0x5f70c9['cause-txt']||_0x5f70c9[_0x9924('0xeb')]);ami[_0x9924('0x29')](_0x9924('0xec'),ut[_0x9924('0xaa')](_0xdd4feb,'amd'));rpcDb[_0x9924('0x97')](_0xdd4feb,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0xdd4feb)>=_0x360e83['dialGlobalMaxRetry']){_0x3910f3=ut[_0x9924('0xae')](_0xdd4feb,0xf,'Global');rpcDb[_0x9924('0x9c')](_0x3910f3,_0x9924('0xef'));}else{rpcDb[_0x9924('0x9c')](_0xdd4feb,_0x9924('0xef'));}delete this[_0x9924('0x16')][_0x5f70c9['linkedid']];break;default:if(_0xdd4feb[_0x9924('0x74')]){ut['decrementTalkink'](_0x360e83,_0x9924('0xf0'));ut['loggerError'](_0x9924('0xf1')+_0x360e83[_0x9924('0x59')],_0x5f70c9);}_0x360e83[_0x9924('0x47')]+=0x1;_0xdd4feb[_0x9924('0xa7')]=ut[_0x9924('0xa8')](_0xdd4feb);ut[_0x9924('0x99')](_0xdd4feb,0xc,_0x5f70c9[_0x9924('0xea')]||_0x5f70c9[_0x9924('0xeb')]);rpcDb['createCustomerHistory'](_0xdd4feb,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x9924('0xa8')](_0xdd4feb)>=_0x360e83[_0x9924('0xad')]){_0x3910f3=ut[_0x9924('0xae')](_0xdd4feb,0xf,_0x9924('0xaf'));rpcDb['createCustomerFinal'](_0x3910f3,_0x9924('0xf2'));}else{rpcDb[_0x9924('0x9c')](_0xdd4feb,_0x9924('0xf2'));}delete this[_0x9924('0x16')][_0x5f70c9[_0x9924('0xc5')]];}if(!(_0xdd4feb[_0x9924('0x74')]&&_0xbe02ec==='16')){ut['updateOriginated'](_0x360e83,'[callProgressDetectingCustomer]');logger[_0x9924('0x6e')](_0x9924('0xf3'),_0xdd4feb['uniqueid'],_0x9924('0xb8'),_0x360e83[_0x9924('0x59')],'originated:\x20',_0x360e83[_0x9924('0x61')]);}if(_0xbe02ec!==_0x9924('0xf4')){delete this['actions'][_0x5f70c9[_0x9924('0xc5')]];delete this[_0x9924('0x16')][_0x5f70c9['destlinkedid']];}}};Preview[_0x9924('0x10')][_0x9924('0xf5')]=function(_0xbb830e,_0x50c9c5,_0x14bf97){if(_[_0x9924('0xf6')](_0x50c9c5)&&_0x9924('0xf7')!==typeof _0x50c9c5){return;}if(_[_0x9924('0xf6')](_0x14bf97)&&'object'!==typeof _0x14bf97){return;}switch(_0x14bf97[_0x9924('0xf8')]){case'0':ut[_0x9924('0xf9')](_0xbb830e,0x0,'NoSuchNumber');rpcDb[_0x9924('0xfa')](_0xbb830e,_0x9924('0xfb'));break;case'3':ut[_0x9924('0xf9')](_0xbb830e,0x3,_0x9924('0xd0'));rpcDb['createAgentHistory'](_0xbb830e,_0x9924('0xfc'));break;case'5':ut[_0x9924('0xf9')](_0xbb830e,0x5,_0x9924('0xc8'));rpcDb[_0x9924('0xfa')](_0xbb830e,_0x9924('0xfd'));break;case'8':ut['logAgent'](_0xbb830e,0x8,_0x9924('0xd4'));rpcDb[_0x9924('0xfa')](_0xbb830e,_0x9924('0xfe'));break;case'22':ut[_0x9924('0xf9')](_0xbb830e,0x16,_0x9924('0xff'));rpcDb[_0x9924('0xfa')](_0xbb830e,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x9924('0xf9')](_0xbb830e,0xc,_0x14bf97['reason']);rpcDb['createAgentHistory'](_0xbb830e,_0x9924('0xfe'));}ut[_0x9924('0x7e')](_0x50c9c5,_0x9924('0x100'));logger[_0x9924('0x6e')](_0x9924('0x101'),_0xbb830e[_0x9924('0xb7')],_0x9924('0xb8'),_0x50c9c5[_0x9924('0x59')],_0x9924('0x72'),_0x50c9c5['originated']);delete this[_0x9924('0x16')][_0xbb830e['uniqueid']];};Preview[_0x9924('0x10')][_0x9924('0x102')]=function(_0x1b8129,_0x8091a9,_0x31be9d,_0x638414,_0x2b79dd){var _0x39e6cc=this;return new BPromise(function(_0xb7c65c,_0x191a52){if(_[_0x9924('0x88')](_0x8091a9)||_[_0x9924('0x88')](_0x8091a9['Contact'])||_['isNil'](_0x8091a9[_0x9924('0x103')][_0x9924('0x104')])||_[_0x9924('0x88')](_0x8091a9[_0x9924('0x78')])){_0x191a52(ut[_0x9924('0x52')](_0x9924('0x105'),_0x638414,_0x2b79dd));return;}var _0x5d7a8e=uuid['v4']();var _0x6b9257=_0x39e6cc[_0x9924('0x28')][_0x8091a9['Queue'][_0x9924('0x59')]];var _0x4c2dca=_0x31be9d?_0x39e6cc['agents'][_0x31be9d]['id']:undefined;_0x39e6cc['actions'][_0x5d7a8e]=new Action(_0x8091a9,_0x6b9257,_0x5d7a8e,_0x31be9d,_0x4c2dca);var _0xa280c5=_0x39e6cc[_0x9924('0x16')][_0x5d7a8e];_0xa280c5[_0x9924('0xe3')]=_0x638414;_0xa280c5['activeContact']=_0x2b79dd;_0xa280c5[_0x9924('0x106')]=_0x31be9d;if(_['isEmpty'](_0x1b8129)){_0x39e6cc[_0x9924('0x107')](_0xa280c5,_0x6b9257,_0x8091a9,_0x31be9d)[_0x9924('0x87')](function(_0x25d24e){logger[_0x9924('0x6e')](_0x9924('0x108'),_0x9924('0x109')+_0xa280c5[_0x9924('0x71')]+_0x9924('0x10a')+_0xa280c5['idContact'],JSON['stringify'](_0x25d24e));ami[_0x9924('0x29')](_0x9924('0x10b'),ut[_0x9924('0xaa')](_0xa280c5,_0x9924('0x10c'),_0x39e6cc[_0x9924('0x28')][_0xa280c5['queue']]));_0xb7c65c(ut[_0x9924('0x52')](_0x9924('0x10d')));})['catch'](function(_0xe006e2){ut['logger']('[Preview][execCall][failure]',_0xe006e2);_0x191a52(ut[_0x9924('0x52')]('Call\x20failed',_0x638414,_0x2b79dd));});}else{_0x6b9257[_0x9924('0x3e')]+=0x1;ut['logBlacklist'](_0xa280c5);rpcDb[_0x9924('0x10e')](_0xa280c5,'[Blacklist][error]');delete _0x39e6cc[_0x9924('0x16')][_0x5d7a8e];_0x191a52(ut[_0x9924('0x52')](_0x9924('0x10f'),_0x638414,_0x2b79dd));}});};Preview['prototype'][_0x9924('0xa2')]=function(_0xb82f55){return!_[_0x9924('0x88')](_0xb82f55)&&!_['isNil'](_0xb82f55[_0x9924('0x59')])&&!_[_0x9924('0x88')](_0xb82f55['active'])&&_0xb82f55['active']&&!_[_0x9924('0x88')](this[_0x9924('0x15')][util[_0x9924('0x5d')](_0x9924('0x110'),_0xb82f55[_0x9924('0x59')])])&&!_[_0x9924('0x88')](this[_0x9924('0x15')][util[_0x9924('0x5d')](_0x9924('0x110'),_0xb82f55['name'])][_0x9924('0x7b')])&&(this['trunks'][util['format'](_0x9924('0x110'),_0xb82f55[_0x9924('0x59')])]['status']===_0x9924('0x111')||this['trunks'][util[_0x9924('0x5d')]('SIP/%s',_0xb82f55['name'])][_0x9924('0x7b')]==='unmonitored');};Preview['prototype'][_0x9924('0x8e')]=function(_0x161fc6,_0x45d878){var _0x16e9b8=this;return new BPromise(function(_0x517369,_0x492444){_0x16e9b8[_0x9924('0x112')](_0x161fc6,_0x45d878)[_0x9924('0x87')](function(_0x14f48b){_0x517369(_[_0x9924('0x75')](_0x14f48b,[_0x9924('0x52')]));})['catch'](function(_0x31ba2c){if(_0x31ba2c[_0x9924('0x113')]){rpcDb['unlockContact'](_0x161fc6);}if(_0x31ba2c['active']){rpcDb[_0x9924('0x91')](_0x161fc6);}_0x492444(_[_0x9924('0x75')](_0x31ba2c,['message']));});});};Preview['prototype'][_0x9924('0x112')]=function(_0x8bbb96,_0x299ecd){var _0x2aba53=this;return new BPromise(function(_0x4e1830,_0x55415e){var _0x17c829,_0xf1663;rpcDb[_0x9924('0x114')](_0x8bbb96)['then'](function(_0x4fffc2){if(!_[_0x9924('0x88')](_0x4fffc2[0x0])){_0xf1663=_0x4fffc2[0x0][_0x9924('0x115')]?![]:!![];_0x17c829=_0x4fffc2[0x0]['recallme']?!![]:![];_0x17c829=_0x299ecd?!![]:_0x17c829;}var _0x3f1be4=_0x2aba53['validateContact'](_0x4fffc2);if(_0x3f1be4[_0x9924('0x116')]){rpcDb[_0x9924('0x117')](_[_0x9924('0x75')](_0x4fffc2[0x0],[_0x9924('0x78'),_0x9924('0x118')]))[_0x9924('0x87')](function(_0x548703){_0x2aba53[_0x9924('0x102')](_0x548703,_0x4fffc2[0x0],_0x299ecd,_0xf1663,_0x17c829)[_0x9924('0x87')](function(_0x8257a){_0x4e1830(_0x8257a);})[_0x9924('0x9d')](function(_0x3d676d){_0x55415e(_0x3d676d);});})[_0x9924('0x9d')](function(_0x2882ae){ut[_0x9924('0x65')](_0x9924('0x119'),_0x2882ae);_0x55415e(ut[_0x9924('0x52')]('Call\x20unsuccessful',_0xf1663,_0x17c829));});}else{_0x55415e(ut[_0x9924('0x52')](_0x3f1be4[_0x9924('0x52')],_0xf1663,_0x17c829));}})[_0x9924('0x9d')](function(_0xb40a02){ut[_0x9924('0x65')](_0x9924('0x11a'),_0xb40a02);_0x55415e(ut[_0x9924('0x52')](_0x9924('0x11b'),![],!![]));});});};Preview['prototype'][_0x9924('0x11c')]=function(_0x1fe910){if(_[_0x9924('0x88')](_0x1fe910)||_[_0x9924('0x11d')](_0x1fe910)||!_[_0x9924('0x88')](_0x1fe910[0x0][_0x9924('0x8c')])&&_[_0x9924('0x88')](_0x1fe910[0x0][_0x9924('0x8c')][_0x9924('0x59')])){ut[_0x9924('0x65')](_0x9924('0x11e'),_0x1fe910);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x463902=this[_0x9924('0x28')][_0x1fe910[0x0][_0x9924('0x70')][_0x9924('0x59')]];_0x463902[_0x9924('0x52')]=_0x9924('0xa4');if(_[_0x9924('0x88')](_0x463902)){ut[_0x9924('0x65')](_0x9924('0x11f'),_0x463902);return{'isValid':![],'message':_0x9924('0x120')};}if(!this[_0x9924('0xa2')](_0x463902[_0x9924('0x58')])){ut[_0x9924('0x65')](_0x9924('0x121'),_0x9924('0x122')+_0x463902[_0x9924('0x59')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x463902['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x463902[_0x9924('0x59')]+_0x9924('0x123'));return{'isValid':![],'message':_0x9924('0x124')};}}if(!ut[_0x9924('0x125')](_0x463902[_0x9924('0x37')])){ut[_0x9924('0x65')]('[Preview][validateContact][Campaign\x20Active]',_0x463902[_0x9924('0x59')]+_0x9924('0x126'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x463902[_0x9924('0x59')]+_0x9924('0x126')};}return{'isValid':!![],'message':_0x9924('0x127')};};Preview[_0x9924('0x10')]['execCall']=function(_0x2f0d7a,_0x12177a,_0x49c518,_0x411e0f){var _0x195e5a=this;return new BPromise(function(_0x2c2bed,_0x517cc3){var _0x2fa901=_0x2f0d7a[_0x9924('0xb7')];var _0x903e59=_0x195e5a[_0x9924('0xa2')](_0x12177a[_0x9924('0x58')])?util[_0x9924('0x5d')](_0x9924('0x128'),_0x12177a[_0x9924('0x58')]['name'],_[_0x9924('0x88')](_0x12177a[_0x9924('0x3b')])?'':_0x12177a['dialPrefix']['trim']()||'',_0x12177a['dialCutDigit']>0x0?_0x49c518[_0x9924('0x103')][_0x9924('0x104')]['substring'](_0x12177a[_0x9924('0x129')]):_0x49c518['Contact'][_0x9924('0x104')]):util[_0x9924('0x5d')](_0x9924('0x128'),_[_0x9924('0x88')](_0x12177a[_0x9924('0xa3')])?_0x12177a[_0x9924('0x58')][_0x9924('0x59')]:_0x12177a[_0x9924('0xa3')][_0x9924('0x59')],_['isNil'](_0x12177a[_0x9924('0x3b')])?'':_0x12177a['dialPrefix'][_0x9924('0x12a')]()||'',_0x12177a['dialCutDigit']>0x0?_0x49c518[_0x9924('0x103')][_0x9924('0x104')]['substring'](_0x12177a[_0x9924('0x129')]):_0x49c518['Contact']['phone']);var _0x1f1e24=_0x195e5a[_0x9924('0xa2')](_0x12177a[_0x9924('0x58')])?ut[_0x9924('0x12b')](_0x12177a['Trunk']['callerid'],_0x12177a[_0x9924('0x39')],_0x12177a[_0x9924('0x12c')]>0x0?ut[_0x9924('0x12d')](_0x12177a[_0x9924('0x3a')],_0x12177a[_0x9924('0x12c')]):_0x12177a[_0x9924('0x3a')]):ut['getCallerId'](_[_0x9924('0x88')](_0x12177a[_0x9924('0xa3')])?_0x12177a['Trunk'][_0x9924('0x12e')]:_0x12177a[_0x9924('0xa3')][_0x9924('0x12e')],_0x12177a[_0x9924('0x39')],_0x12177a[_0x9924('0x12c')]>0x0?ut[_0x9924('0x12d')](_0x12177a[_0x9924('0x3a')],_0x12177a['dialRandomLastDigitCallerIdNumber']):_0x12177a[_0x9924('0x3a')]);if(_0x1f1e24){_0x2f0d7a[_0x9924('0x12f')]=ut['extractCalleridName'](_0x1f1e24);_0x2f0d7a[_0x9924('0x130')]=ut[_0x9924('0x131')](_0x1f1e24);}var _0x21ecf1=ut[_0x9924('0x132')](_0x12177a,_0x49c518,_0x903e59,_0x1f1e24,_0x2fa901,_0x2f0d7a);_[_0x9924('0x133')](_0x2f0d7a,ut[_0x9924('0x134')](_0x21ecf1));_0x2f0d7a[_0x9924('0x92')]=moment()[_0x9924('0x5d')](_0x9924('0x93'));ami[_0x9924('0x7a')](ut[_0x9924('0x135')](_0x2f0d7a,_0x12177a,_0x21ecf1,_0x2f0d7a[_0x9924('0xcd')],_0x411e0f))['then'](function(_0x56bdf7){var _0x44be85=_0x2f0d7a[_0x9924('0x136')];if(!_[_0x9924('0x88')](_0x44be85)){if(!_['isNil'](_0x195e5a['agents'][_0x44be85])){_0x195e5a[_0x9924('0x17')][_0x44be85][_0x9924('0x137')]=_0x2f0d7a[_0x9924('0x138')];emit(util[_0x9924('0x5d')](_0x9924('0x139'),_0x195e5a[_0x9924('0x17')][_0x44be85][_0x9924('0x59')]),_0x9924('0x13a'),{'destaccountcode':_0x195e5a[_0x9924('0x17')][_0x44be85]['accountcode'],'destconnectedlinenum':_0x2f0d7a[_0x9924('0x138')]});}}_0x12177a[_0x9924('0x61')]+=0x1;logger[_0x9924('0x6e')](_0x9924('0x13b'),_0x2fa901,_0x9924('0xb8'),_0x12177a[_0x9924('0x59')],_0x9924('0x72'),_0x12177a[_0x9924('0x61')]);_0x2c2bed(_0x56bdf7);})[_0x9924('0x9d')](function(_0x249a86){ut[_0x9924('0xf9')](_0x2f0d7a,0xe,_0x9924('0x13c'));rpcDb['createAgentHistory'](_0x2f0d7a,'[originateFailure][logOriginateFailure]');_0x517cc3(_0x249a86);});});};Preview[_0x9924('0x10')][_0x9924('0x20')]=function(_0x4bd599){if(this[_0x9924('0x16')][_0x4bd599[_0x9924('0xc5')]]){this[_0x9924('0x16')][_0x4bd599[_0x9924('0xc5')]][_0x9924('0x7c')]=_0x4bd599[_0x9924('0x7c')];}};Preview['prototype']['syncOriginateResponse']=function(_0x204674){var _0x21335d=this;var _0x301e22=this[_0x9924('0x16')][_0x204674[_0x9924('0x13d')]];if(_0x301e22){if(_0x301e22[_0x9924('0x106')]&&this[_0x9924('0x17')][_0x301e22['lookAgent']]){ut[_0x9924('0x13e')](_0x301e22,this[_0x9924('0x17')][_0x301e22[_0x9924('0x106')]][_0x9924('0x59')],this['agents'][_0x301e22['lookAgent']]['id']);}var _0x488e71=_[_0x9924('0x13f')](_0x301e22);_0x488e71[_0x9924('0xb5')]=moment()[_0x9924('0x5d')](_0x9924('0x93'));var _0x26ce4f=_0x21335d[_0x9924('0x28')][_0x301e22[_0x9924('0x71')]];if(ut[_0x9924('0x140')](_0x204674[_0x9924('0x141')])){if(_0x301e22[_0x9924('0xe3')]){rpcDb['unlockContact'](_0x301e22[_0x9924('0x142')]);}if(_0x301e22['activeContact']){rpcDb[_0x9924('0x91')](_0x301e22['idContact']);}ami[_0x9924('0x29')]('custom:agentringnoanswer',ut[_0x9924('0xaa')](_0x301e22,'rejected',this[_0x9924('0x28')][_0x301e22['queue']]));this[_0x9924('0xf5')](_0x488e71,_0x26ce4f,_0x204674);}else{_0x301e22['starttime']=moment()[_0x9924('0x5d')](_0x9924('0x93'));ut[_0x9924('0xf9')](_0x488e71,0x4,_0x9924('0xbd'));rpcDb[_0x9924('0xfa')](_0x488e71,_0x9924('0x143'));}}};Preview[_0x9924('0x10')][_0x9924('0x1b')]=function(_0x4e9b09){var _0x33e5fc=this;var _0x3d6a48=this[_0x9924('0x16')][_0x4e9b09[_0x9924('0xc5')]];var _0x3ee134;if(_0x3d6a48){_0x3ee134=this[_0x9924('0x28')][_0x3d6a48['queue']];logger[_0x9924('0x6e')]('[syncHangup][talking]',_0x4e9b09['linkedid'],'\x20Queue',_0x3ee134[_0x9924('0x59')],_0x9924('0x73'),_0x3ee134['pTalking']);}if(this[_0x9924('0x16')][_0x4e9b09['linkedid']]&&_0x4e9b09['linkedid']!==_0x4e9b09[_0x9924('0xb7')]){if(_0x4e9b09[_0x9924('0x144')]==='16'&&this[_0x9924('0x16')][_0x4e9b09[_0x9924('0xc5')]][_0x9924('0x74')]){this['callProgressDetectingCustomer'](_0x4e9b09,_0x4e9b09[_0x9924('0xc5')],_0x4e9b09['cause']);}else if(this[_0x9924('0x16')][_0x4e9b09[_0x9924('0xc5')]][_0x9924('0x74')]){logger['info']('[syncHangup][talking][cause]',_0x4e9b09[_0x9924('0xc5')],_0x4e9b09[_0x9924('0x144')],'\x20Queue',_0x3ee134[_0x9924('0x59')],_0x9924('0x73'),_0x3ee134[_0x9924('0x2f')]);this[_0x9924('0xa5')](_0x4e9b09,_0x4e9b09['linkedid'],_0x4e9b09[_0x9924('0x144')]);}}else if(_0x3d6a48&&_[_0x9924('0x88')](_0x3d6a48['statedesc'])&&_0x3ee134[_0x9924('0x145')]&&_0x4e9b09[_0x9924('0xc5')]===_0x4e9b09[_0x9924('0xb7')]&&_['isNil'](_0x4e9b09['reason'])&&_0x4e9b09[_0x9924('0x144')]==='16'&&_0x4e9b09[_0x9924('0x146')]==='6'&&_['isUndefined'](_0x3d6a48['transfer'])){if(_0x3d6a48['unlockAgent']){rpcDb['unlockContact'](_0x3d6a48[_0x9924('0x142')]);}if(_0x3d6a48['activeContact']){rpcDb[_0x9924('0x91')](_0x3d6a48['idContact']);}_0x4e9b09['reason']='22';this['callProgressDetectingAgent'](_0x3d6a48,_0x3ee134,_0x4e9b09);}else if(_0x3d6a48&&_0x3d6a48[_0x9924('0x147')]){if(_0x4e9b09[_0x9924('0x144')]==='16'&&this[_0x9924('0x16')][_0x4e9b09['linkedid']][_0x9924('0x74')]){logger[_0x9924('0x6e')](_0x9924('0x148'),_0x4e9b09[_0x9924('0xc5')],_0x4e9b09[_0x9924('0x144')],_0x9924('0xb8'),_0x3ee134[_0x9924('0x59')],_0x9924('0x73'),_0x3ee134[_0x9924('0x2f')]);this[_0x9924('0xa5')](_0x4e9b09,_0x4e9b09[_0x9924('0xc5')],_0x4e9b09[_0x9924('0x144')]);}else if(this[_0x9924('0x16')][_0x4e9b09[_0x9924('0xc5')]]['dialAnswer']){logger['info'](_0x9924('0x149'),_0x4e9b09['linkedid'],_0x4e9b09[_0x9924('0x144')],'\x20Queue',_0x3ee134[_0x9924('0x59')],_0x9924('0x73'),_0x3ee134[_0x9924('0x2f')]);this[_0x9924('0xa5')](_0x4e9b09,_0x4e9b09[_0x9924('0xc5')],_0x4e9b09[_0x9924('0x144')]);}}};Preview['prototype']['syncDialEnd']=function(_0x5c62cc){if(this[_0x9924('0x16')][_0x5c62cc[_0x9924('0x14a')]]&&_0x5c62cc[_0x9924('0x14a')]!==_0x5c62cc['destuniqueid']){this[_0x9924('0xa5')](_0x5c62cc,_0x5c62cc[_0x9924('0x14a')],_0x5c62cc[_0x9924('0xeb')]);}};Preview[_0x9924('0x10')][_0x9924('0x14b')]=function(_0x4b1209){if(this['actions'][_0x4b1209[_0x9924('0xc5')]]&&_0x4b1209['linkedid']!==_0x4b1209[_0x9924('0xb7')]&&!this[_0x9924('0x16')][_0x4b1209[_0x9924('0xc5')]]['dialAnswer']){if(_0x4b1209[_0x9924('0x144')]==='1'){this[_0x9924('0xa5')](_0x4b1209,_0x4b1209['linkedid'],_0x4b1209[_0x9924('0x144')]);}}};Preview[_0x9924('0x10')]['addVariable']=function(_0x424d8c,_0xb426ac,_0x228242){if(this['actions'][_0x424d8c]){if(_[_0x9924('0x88')](this[_0x9924('0x16')][_0x424d8c][_0x9924('0x14c')])){this[_0x9924('0x16')][_0x424d8c][_0x9924('0x14c')]={};}this[_0x9924('0x16')][_0x424d8c]['variables'][_0xb426ac]=_0x228242;}};Preview[_0x9924('0x10')][_0x9924('0x22')]=function(_0x545641){try{if(!_[_0x9924('0x88')](_0x545641)){if(ut[_0x9924('0x14d')](_[_0x9924('0x14e')](_0x545641[_0x9924('0x14f')])[0x0])){this[_0x9924('0x150')](_0x545641[_0x9924('0xb7')],_[_0x9924('0x14e')](_0x545641[_0x9924('0x14f')])[0x0],_0x545641['value']);}}}catch(_0xd2ded6){logger['error'](_0x9924('0x151'),util[_0x9924('0x152')](_0xd2ded6,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x9924('0x24')]=function(_0x3449ab){if(_0x3449ab){if(this[_0x9924('0x16')][_0x3449ab[_0x9924('0x153')]]){this['actions'][_0x3449ab[_0x9924('0x153')]][_0x9924('0x147')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0xe4d343){if(_0xe4d343){if(this['actions'][_0xe4d343[_0x9924('0x154')]]){this[_0x9924('0x16')][_0xe4d343[_0x9924('0x154')]][_0x9924('0x147')]=!![];}}};module[_0x9924('0x155')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index c314bbb..b839163 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 _0xa12a=['inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error'];(function(_0x4f50d6,_0x100adc){var _0x412340=function(_0x71d209){while(--_0x71d209){_0x4f50d6['push'](_0x4f50d6['shift']());}};_0x412340(++_0x100adc);}(_0xa12a,0x67));var _0xaa12=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa12a[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0xaa12('0x0'));var BPromise=require(_0xaa12('0x1'));var logger=require(_0xaa12('0x2'))(_0xaa12('0x3'));var _=require(_0xaa12('0x4'));var cmHopper=require(_0xaa12('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xaa12('0x6'));var cmHopperBlack=require(_0xaa12('0x7'));var voiceQueueRt=require(_0xaa12('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xaa12('0x9'));function loggerCatch(_0x48fc4d){return function(_0x4c361f){logger[_0xaa12('0xa')](_0x48fc4d,util[_0xaa12('0xb')](_0x4c361f,{'showHidden':![],'depth':null}));};}function create(_0x480c9f){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopperHistory[_0xaa12('0xe')](_0x480c9f))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x10')));}function createAgent(_0x33f7d6){return BPromise['resolve']()[_0xaa12('0xd')](agentReportPreview[_0xaa12('0xe')](_0x33f7d6))[_0xaa12('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0xe8c7cf){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x11')](_0xe8c7cf,!![]))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x12')));}exports['checkIsBlackList']=function(_0x4474c4){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopperBlack[_0xaa12('0x13')](_0x4474c4))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x14')));};exports[_0xaa12('0x15')]=function(_0x35985a){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper['getContactPreview'](_0x35985a))[_0xaa12('0xf')](loggerCatch('[getContactPreview]\x20'));};exports[_0xaa12('0xe')]=function(_0x516c1f,_0x419e9b){create(_0x516c1f)[_0xaa12('0xf')](loggerCatch(_0x419e9b));moveContact(_0x516c1f)[_0xaa12('0xf')](loggerCatch(_0x419e9b));};exports[_0xaa12('0x16')]=function(_0x5be2f2,_0x199f71){createAgent(_0x5be2f2)[_0xaa12('0xf')](loggerCatch(_0x199f71));};exports[_0xaa12('0x17')]=function(_0x4e8970,_0x571207){create(_0x4e8970)[_0xaa12('0xf')](loggerCatch(_0x571207));};exports[_0xaa12('0x18')]=function(_0x2698c9,_0x3ce9cc){moveContact(_0x2698c9)[_0xaa12('0xf')](loggerCatch(_0x3ce9cc));};exports[_0xaa12('0x19')]=function(_0x4cad3e,_0x1cea84,_0x286d01){if(_0x1cea84){_0x4cad3e[_0xaa12('0x1a')]=null;}if(_0x286d01){_0x4cad3e[_0xaa12('0x1b')]=![];}return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x19')](_0x4cad3e))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x1c')));};exports[_0xaa12('0x1d')]=function(_0x4b3a70){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x1d')](_0x4b3a70))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x1e')));};exports[_0xaa12('0x1f')]=function(_0x2458f8){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x1f')]({'UserId':null},_0x2458f8,0x1))[_0xaa12('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0xaa12('0x20')]=function(_0x4d5338){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x1f')]({'active':![]},_0x4d5338,0x1))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x21')));};exports[_0xaa12('0x22')]=function(_0x371c99){var _0x14594f={};_0x14594f[_0xaa12('0x23')]=_0x371c99[_0xaa12('0x23')];_0x14594f['uniqueid']=_0x371c99[_0xaa12('0x24')];_0x14594f['calleridnum']=_0x371c99[_0xaa12('0x25')];_0x14594f[_0xaa12('0x26')]=_0x371c99['calleridname'];_0x14594f[_0xaa12('0x27')]=_0x371c99[_0xaa12('0x27')];_0x14594f[_0xaa12('0x28')]=_0x371c99['answertime'];_0x14594f[_0xaa12('0x29')]=_0x371c99['answertime'];_0x14594f[_0xaa12('0x2a')]=0x1;_0x14594f[_0xaa12('0x2b')]=_0x371c99[_0xaa12('0x2c')];_0x14594f[_0xaa12('0x2d')]=_0x371c99['membername'];_0x14594f[_0xaa12('0x2e')]=_0xaa12('0x2f');_0x14594f['exten']='xcally-motion-preview';_0x14594f[_0xaa12('0x30')]=0x0;_0x14594f[_0xaa12('0x31')]=0x1;_0x14594f[_0xaa12('0x32')]=_0x371c99[_0xaa12('0x33')];_0x14594f[_0xaa12('0x34')]='COMPLETED';return BPromise['resolve']()[_0xaa12('0xd')](voiceQueueReport[_0xaa12('0x35')](_0x14594f))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x36')));};exports['getContactRecallMe']=function(_0x35b52a,_0xc773e3){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper['getContactRecallMe'](_0x35b52a,_0xc773e3))[_0xaa12('0xf')](loggerCatch(_0xaa12('0x37')));};exports[_0xaa12('0x38')]=function(_0x2c1e88){return BPromise[_0xaa12('0xc')]()[_0xaa12('0xd')](cmHopper[_0xaa12('0x19')](_0x2c1e88,!![],!![]))[_0xaa12('0xf')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x09d4=['createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','resolve','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory'];(function(_0x4d6e3f,_0x416586){var _0x4c9254=function(_0x53a8c6){while(--_0x53a8c6){_0x4d6e3f['push'](_0x4d6e3f['shift']());}};_0x4c9254(++_0x416586);}(_0x09d4,0x94));var _0x409d=function(_0x5170a8,_0x135451){_0x5170a8=_0x5170a8-0x0;var _0xeb5908=_0x09d4[_0x5170a8];return _0xeb5908;};'use strict';var util=require(_0x409d('0x0'));var BPromise=require('bluebird');var logger=require(_0x409d('0x1'))(_0x409d('0x2'));var _=require(_0x409d('0x3'));var cmHopper=require(_0x409d('0x4'));var cmHopperFinal=require(_0x409d('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x409d('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x409d('0x7'));var voiceQueueReport=require(_0x409d('0x8'));function loggerCatch(_0x39d2aa){return function(_0x445c64){logger[_0x409d('0x9')](_0x39d2aa,util[_0x409d('0xa')](_0x445c64,{'showHidden':![],'depth':null}));};}function create(_0x218ab1){return BPromise['resolve']()[_0x409d('0xb')](cmHopperHistory[_0x409d('0xc')](_0x218ab1))[_0x409d('0xd')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x436a1d){return BPromise[_0x409d('0xe')]()[_0x409d('0xb')](agentReportPreview[_0x409d('0xc')](_0x436a1d))[_0x409d('0xd')](loggerCatch(_0x409d('0xf')));}function moveContact(_0x22a8a8){return BPromise[_0x409d('0xe')]()['then'](cmHopper[_0x409d('0x10')](_0x22a8a8,!![]))[_0x409d('0xd')](loggerCatch(_0x409d('0x11')));}exports['checkIsBlackList']=function(_0x246e17){return BPromise[_0x409d('0xe')]()[_0x409d('0xb')](cmHopperBlack[_0x409d('0x12')](_0x246e17))[_0x409d('0xd')](loggerCatch(_0x409d('0x13')));};exports[_0x409d('0x14')]=function(_0x1fd5d7){return BPromise[_0x409d('0xe')]()[_0x409d('0xb')](cmHopper[_0x409d('0x14')](_0x1fd5d7))[_0x409d('0xd')](loggerCatch(_0x409d('0x15')));};exports[_0x409d('0xc')]=function(_0x32003d,_0x1be920){create(_0x32003d)['catch'](loggerCatch(_0x1be920));moveContact(_0x32003d)[_0x409d('0xd')](loggerCatch(_0x1be920));};exports[_0x409d('0x16')]=function(_0x521276,_0x4efc1a){createAgent(_0x521276)[_0x409d('0xd')](loggerCatch(_0x4efc1a));};exports['createCustomerHistory']=function(_0x43868f,_0x1a99bd){create(_0x43868f)[_0x409d('0xd')](loggerCatch(_0x1a99bd));};exports[_0x409d('0x17')]=function(_0x2c24b9,_0x1fdfd3){moveContact(_0x2c24b9)[_0x409d('0xd')](loggerCatch(_0x1fdfd3));};exports[_0x409d('0x18')]=function(_0x40b487,_0x5c13fc,_0x1ac215){if(_0x5c13fc){_0x40b487[_0x409d('0x19')]=null;}if(_0x1ac215){_0x40b487[_0x409d('0x1a')]=![];}return BPromise['resolve']()[_0x409d('0xb')](cmHopper[_0x409d('0x18')](_0x40b487))[_0x409d('0xd')](loggerCatch(_0x409d('0x1b')));};exports['countReScheduled']=function(_0x180173){return BPromise[_0x409d('0xe')]()['then'](cmHopper[_0x409d('0x1c')](_0x180173))['catch'](loggerCatch(_0x409d('0x1d')));};exports[_0x409d('0x1e')]=function(_0x714011){return BPromise[_0x409d('0xe')]()[_0x409d('0xb')](cmHopper[_0x409d('0x1e')]({'UserId':null},_0x714011,0x1))[_0x409d('0xd')](loggerCatch(_0x409d('0x1f')));};exports[_0x409d('0x20')]=function(_0x4c0a32){return BPromise[_0x409d('0xe')]()[_0x409d('0xb')](cmHopper[_0x409d('0x1e')]({'active':![]},_0x4c0a32,0x1))[_0x409d('0xd')](loggerCatch(_0x409d('0x21')));};exports[_0x409d('0x22')]=function(_0x3ad590){var _0x39cd39={};_0x39cd39[_0x409d('0x23')]=_0x3ad590['type'];_0x39cd39[_0x409d('0x24')]=_0x3ad590[_0x409d('0x24')];_0x39cd39[_0x409d('0x25')]=_0x3ad590[_0x409d('0x25')];_0x39cd39[_0x409d('0x26')]=_0x3ad590[_0x409d('0x26')];_0x39cd39['queue']=_0x3ad590['queue'];_0x39cd39[_0x409d('0x27')]=_0x3ad590[_0x409d('0x28')];_0x39cd39['queuecallerleaveAt']=_0x3ad590[_0x409d('0x28')];_0x39cd39[_0x409d('0x29')]=0x1;_0x39cd39[_0x409d('0x2a')]=_0x3ad590['endtime'];_0x39cd39[_0x409d('0x2b')]=_0x3ad590[_0x409d('0x2c')];_0x39cd39[_0x409d('0x2d')]=_0x409d('0x2e');_0x39cd39[_0x409d('0x2f')]=_0x409d('0x30');_0x39cd39['holdtime']=0x0;_0x39cd39[_0x409d('0x31')]=0x1;_0x39cd39[_0x409d('0x32')]=_0x3ad590[_0x409d('0x2c')];_0x39cd39[_0x409d('0x33')]='COMPLETED';return BPromise[_0x409d('0xe')]()[_0x409d('0xb')](voiceQueueReport[_0x409d('0x34')](_0x39cd39))[_0x409d('0xd')](loggerCatch(_0x409d('0x35')));};exports['getContactRecallMe']=function(_0x2894fa,_0x1bf327){return BPromise['resolve']()['then'](cmHopper[_0x409d('0x36')](_0x2894fa,_0x1bf327))['catch'](loggerCatch(_0x409d('0x37')));};exports['rescheduleContactInQueue']=function(_0x18930b){return BPromise['resolve']()['then'](cmHopper[_0x409d('0x18')](_0x18930b,!![],!![]))[_0x409d('0xd')](loggerCatch(_0x409d('0x38')));}; \ 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 56f3818..f5d392c 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 _0xf865=['callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isNil','Queue','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','logAgent','responsetime','membername','UserId','logCustomer','ringtime','talktime','answertime','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','clone','statedesc','scheduledAt','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','interface','motionChannel','mandatoryDisposition','buildAcw','queue','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','active','countnoanswerretry','countglobal'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf865,0xaa));var _0x5f86=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0xf865[_0x1ca9eb];return _0x2e284e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5f86('0x0'));var logger=require(_0x5f86('0x1'))(_0x5f86('0x2'));var ipAgi=process[_0x5f86('0x3')]['XCALLY_IP_AGI']||_0x5f86('0x4');function getSeconds(_0x1e1378,_0x276d29){var _0x1cf477=moment(_0x1e1378)[_0x5f86('0x5')](0x0);var _0x5901ec=moment(_0x276d29)[_0x5f86('0x5')](0x0);return _0x1cf477[_0x5f86('0x6')](_0x5901ec,_0x5f86('0x7'));}exports[_0x5f86('0x8')]=function(_0xd8fe03){return function(_0xd1f735){logger[_0x5f86('0x9')](_0xd8fe03,util[_0x5f86('0xa')](_0xd1f735,{'showHidden':![],'depth':null}));};};exports[_0x5f86('0xb')]=function(_0x21609b,_0x47248c){logger[_0x5f86('0xc')](_0x21609b,util['inspect'](_0x47248c,{'showHidden':![],'depth':null}));};exports[_0x5f86('0xd')]=function(_0x1466dd,_0x54f008){logger[_0x5f86('0x9')](_0x1466dd,util[_0x5f86('0xa')](_0x54f008,{'showHidden':![],'depth':null}));};exports[_0x5f86('0xe')]=function(_0x26b0fd){return function(_0x5c68b8){logger[_0x5f86('0xc')](_0x26b0fd,util['inspect'](_0x5c68b8,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x49d10d,_0x200347,_0x79d367){return{'message':_0x49d10d,'unlock':_0x200347,'active':_0x79d367};};exports[_0x5f86('0xf')]=function(_0x4f7b91,_0x200d4d,_0x1852ad){if(!_[_0x5f86('0x10')](_0x1852ad)&&'string'===typeof _0x1852ad&&!_['isEmpty'](_0x1852ad)){if(!_[_0x5f86('0x10')](_0x200d4d)&&_0x5f86('0x11')===typeof _0x200d4d&&!_['isEmpty'](_0x200d4d)){return util[_0x5f86('0x12')](_0x5f86('0x13'),_0x200d4d,_0x1852ad);}return util[_0x5f86('0x12')]('\x22%s\x22\x20<%s>',_0x1852ad,_0x1852ad);}if(!_[_0x5f86('0x10')](_0x4f7b91)&&_0x5f86('0x11')===typeof _0x4f7b91&&!_[_0x5f86('0x14')](_0x4f7b91)){return _0x4f7b91;}return _0x5f86('0x15');};exports['isActive']=function(_0x28cd0f){if(_[_0x5f86('0x16')](_0x28cd0f)){return![];}return _0x28cd0f;};exports['addVariables']=function(_0x3d315f,_0xc3f479,_0x4e5ae6,_0x1ad061,_0x4f730a,_0x389461){var _0x2643fc={'XMD-QUEUE':_0xc3f479['Queue']?_0xc3f479[_0x5f86('0x17')]['name']:'','XMD-CALLERID':_0x1ad061,'XMD-CALLERID-PREVIEW':_0x389461?util['format'](_0x5f86('0x13'),_0x389461['calleridname'],_0x389461[_0x5f86('0x18')]):_0x1ad061,'XMD-DIALID':_0x4f730a,'XMD-CONTACTID':_0xc3f479[_0x5f86('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1ad061,'XMD-VOICEQUEUEID':_0xc3f479[_0x5f86('0x1a')],'XMD-DIALCHANNEL':_0x4e5ae6,'XMD-DIALTIMEOUT':_0x3d315f[_0x5f86('0x1b')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x5f86('0x1c'),_0x3d315f[_0x5f86('0x1d')]?'g':'',_[_0x5f86('0x14')](_0x3d315f[_0x5f86('0x1e')])?'':_0x5f86('0x1f')),'XMD-DIALURL':_0x3d315f[_0x5f86('0x20')]||'','XMD-AGI':_0x3d315f[_0x5f86('0x21')]?util[_0x5f86('0x12')](_0x5f86('0x22'),ipAgi,_0x3d315f[_0x5f86('0x21')]):_0x5f86('0x23'),'XMD-AGIAFTER':_0x3d315f[_0x5f86('0x1d')]?util['format'](_0x5f86('0x22'),ipAgi,_0x3d315f['dialQueueProject2']):_0x5f86('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x389461?_0x389461['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x389461?_0x389461[_0x5f86('0x24')]:'','XMD-DESTINATION':_0x5f86('0x25')};if(!_['isEmpty'](_0x3d315f[_0x5f86('0x1e')])){_0x2643fc[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3d315f[_0x5f86('0x1e')];_0x2643fc[util[_0x5f86('0x12')]('%s',_0x5f86('0x26'))]=_0x4f730a;}if(_0xc3f479&&_0xc3f479[_0x5f86('0x27')]){for(var _0x4234ff in _0xc3f479[_0x5f86('0x27')]){if(_0xc3f479[_0x5f86('0x27')][_0x5f86('0x28')](_0x4234ff)){if(!_['isNil'](_0xc3f479[_0x5f86('0x27')][_0x4234ff])&&_0x4234ff!=='id'&&_0x4234ff!==_0x5f86('0x29')&&_0x4234ff!==_0x5f86('0x2a')&&_0x4234ff!==_0x5f86('0x2b')){_0x2643fc[util['format'](_0x5f86('0x2c'),_0x5f86('0x2d'),_[_0x5f86('0x2e')](_0x4234ff))]=_0xc3f479[_0x5f86('0x27')][_0x4234ff];}}}}return _0x2643fc;};exports['toLowerVariables']=function(_0x5908be){var _0x44b6d1={};for(var _0x3a30c8 in _0x5908be){if(_0x5908be[_0x5f86('0x28')](_0x3a30c8)){_0x44b6d1[util[_0x5f86('0x12')]('%s',_[_0x5f86('0x2f')](_0x3a30c8))]=_0x5908be[_0x3a30c8];}}return{'variables':_0x44b6d1};};exports[_0x5f86('0x30')]=function(_0xd3b2f2,_0x4eff01){if(!_[_0x5f86('0x16')](_0xd3b2f2)){if(_0xd3b2f2['hasOwnProperty'](_0x5f86('0x31'))){if(_0xd3b2f2['originated']>0x0){_0xd3b2f2[_0x5f86('0x31')]-=0x1;}else{logger[_0x5f86('0x9')](_0x5f86('0x32'),_0x4eff01);}}}else{logger['error'](_0x5f86('0x33'),_0x4eff01);}};exports[_0x5f86('0x34')]=function(_0x4a2922){var _0x250e82=moment()[_0x5f86('0x12')](_0x5f86('0x35'));_0x4a2922[_0x5f86('0x36')]=0xd;_0x4a2922['statedesc']=_0x5f86('0x37');_0x4a2922[_0x5f86('0x38')]=_0x250e82;_0x4a2922['responsetime']=_0x250e82;_0x4a2922[_0x5f86('0x39')]=_0x250e82;};exports[_0x5f86('0x3a')]=function(_0x2b0272,_0x540913,_0x493f7e){var _0x3d91da=moment()['format'](_0x5f86('0x35'));_0x2b0272[_0x5f86('0x36')]=_0x540913;_0x2b0272['statedesc']=_0x493f7e;_0x2b0272[_0x5f86('0x3b')]=_0x3d91da;_0x2b0272['ringtime']=getSeconds(_0x2b0272[_0x5f86('0x3b')],_0x2b0272[_0x5f86('0x38')]);};exports['logLookAgent']=function(_0x905e25,_0x3fee33,_0x14ccc8){_0x905e25[_0x5f86('0x3c')]=_0x3fee33;_0x905e25[_0x5f86('0x3d')]=_0x14ccc8;};exports[_0x5f86('0x3e')]=function(_0x42fdd2,_0x2abce5,_0x39c59a){var _0x3c2963=moment()[_0x5f86('0x12')](_0x5f86('0x35'));_0x42fdd2[_0x5f86('0x36')]=_0x2abce5;_0x42fdd2['statedesc']=_0x39c59a;_0x42fdd2[_0x5f86('0x3b')]=_0x42fdd2[_0x5f86('0x3b')]?_0x42fdd2[_0x5f86('0x3b')]:_0x3c2963;_0x42fdd2[_0x5f86('0x39')]=_0x42fdd2[_0x5f86('0x39')]?_0x42fdd2['endtime']:_0x3c2963;_0x42fdd2[_0x5f86('0x3f')]=getSeconds(_0x42fdd2[_0x5f86('0x3b')]||0x0,_0x42fdd2['starttime']||0x0);_0x42fdd2[_0x5f86('0x40')]=_0x42fdd2[_0x5f86('0x41')]?getSeconds(_0x42fdd2[_0x5f86('0x39')],_0x42fdd2[_0x5f86('0x41')]):0x0;};exports['isFailure']=function(_0x2bcc2a){return _0x2bcc2a===_0x5f86('0x42');};exports[_0x5f86('0x43')]=function(_0x11f406,_0x4a961e,_0x465222,_0x4b6b0e,_0x2972b0){var _0x313095=_0x4b6b0e?_0x5f86('0x44'):_0x11f406[_0x5f86('0x45')];_0x313095=_0x2972b0?_0x5f86('0x46'):_0x313095;return{'actionid':_0x11f406[_0x5f86('0x47')],'action':_0x5f86('0x48'),'channel':_0x11f406[_0x5f86('0x49')],'callerid':util[_0x5f86('0x12')](_0x5f86('0x13'),_0x313095,_0x11f406[_0x5f86('0x18')]),'Exten':_0x5f86('0x25'),'Context':_0x5f86('0x4a'),'Priority':'1','variable':_0x465222,'timeout':(_0x4a961e[_0x5f86('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x11f406[_0x5f86('0x47')]};};exports[_0x5f86('0x4c')]=function(_0x364ec5){return _0x364ec5[_0x5f86('0x4d')]+_0x364ec5[_0x5f86('0x4e')]+_0x364ec5['countnoanswerretry']+_0x364ec5[_0x5f86('0x4f')]+_0x364ec5['countnosuchnumberretry'];};exports[_0x5f86('0x50')]=function(_0x31ed6f){var _0x9eaee0=_[_0x5f86('0x51')](_0x31ed6f);_0x9eaee0[_0x5f86('0x36')]=0xf;_0x9eaee0[_0x5f86('0x52')]='Global';return _0x9eaee0;};exports[_0x5f86('0x53')]=function(_0x549026,_0x35f938,_0x2c504e){var _0x26c759={};_0x26c759[_0x35f938]=_0x549026[_0x35f938];_0x26c759['active']=![];_0x26c759[_0x5f86('0x54')]=moment()[_0x5f86('0x55')](_0x2c504e,_0x5f86('0x56'))['format'](_0x5f86('0x35'));_0x26c759['ContactId']=_0x549026[_0x5f86('0x19')];_0x26c759[_0x5f86('0x57')]=_0x549026[_0x5f86('0x57')];_0x26c759[_0x5f86('0x1a')]=_0x549026['VoiceQueueId']||undefined;return _0x26c759;};exports['decrementTalkink']=function(_0x3dcd32,_0xc8ff66){if(!_['isNil'](_0x3dcd32)){if(_0x3dcd32[_0x5f86('0x58')]>0x0){_0x3dcd32[_0x5f86('0x58')]-=0x1;}else{logger['error'](_0xc8ff66,_0x5f86('0x59'));}}else{logger[_0x5f86('0x9')](_0xc8ff66,_0x5f86('0x5a'));}};exports[_0x5f86('0x5b')]=function(_0x253a8f){if(_0x253a8f<=0x0){return!![];}return![];};exports[_0x5f86('0x5c')]=function(_0x422f39,_0x2d463b,_0x4bf2b8){_0x422f39['lastevent']=_0x2d463b;_0x422f39['name']=_0x422f39['queue'];_0x422f39[_0x5f86('0x5d')]=_0x422f39[_0x5f86('0x49')];_0x422f39[_0x5f86('0x5e')]='voice';if(_0x4bf2b8){_0x422f39[_0x5f86('0x5f')]=_0x4bf2b8[_0x5f86('0x5f')];}return _0x422f39;};exports[_0x5f86('0x60')]=function(_0x2b7c0a){var _0x4b696f={};_0x4b696f['queue']=_0x2b7c0a[_0x5f86('0x61')];_0x4b696f[_0x5f86('0x5d')]=_0x2b7c0a[_0x5f86('0x49')];_0x4b696f[_0x5f86('0x47')]=_0x2b7c0a[_0x5f86('0x47')];return _0x4b696f;};exports['agentReadyId']=function(_0x1aeb17){var _0x5d9535=[];for(var _0x3a66b1 in _0x1aeb17){if(_0x1aeb17['hasOwnProperty'](_0x3a66b1)){if(!_[_0x5f86('0x16')](_0x1aeb17[_0x3a66b1])&&_0x1aeb17[_0x3a66b1][_0x5f86('0x36')]===_0x5f86('0x62')&&_0x1aeb17[_0x3a66b1][_0x5f86('0x63')]===_0x5f86('0x64')){_0x5d9535[_0x5f86('0x65')](_0x1aeb17[_0x3a66b1]['id']);}}}return _0x5d9535;};exports[_0x5f86('0x66')]=function(_0x55fcca){var _0x473621=moment()['milliseconds'](0x0);var _0x150173=moment(_0x55fcca)[_0x5f86('0x5')](0x0);return _0x473621[_0x5f86('0x6')](_0x150173,_0x5f86('0x7'));};exports[_0x5f86('0x67')]=function(_0x383824){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x383824['ContactId'],'ListId':_0x383824[_0x5f86('0x57')],'VoiceQueueId':_0x383824[_0x5f86('0x1a')]||undefined,'CampaignId':_0x383824[_0x5f86('0x68')]||undefined};};exports[_0x5f86('0x69')]=function(_0x36fc3f){if(_0x36fc3f==='uniqueid'||_0x36fc3f===_0x5f86('0x6a')||_0x36fc3f===_0x5f86('0x61')||_0x36fc3f==='type'||_0x36fc3f===_0x5f86('0x6b')||_0x36fc3f===_0x5f86('0x6c')||_0x36fc3f==='membername'||_0x36fc3f===_0x5f86('0x49')||_0x36fc3f===_0x5f86('0x45')||_0x36fc3f===_0x5f86('0x6d')||_0x36fc3f===_0x5f86('0x18')||_0x36fc3f===_0x5f86('0x54')||_0x36fc3f===_0x5f86('0x4d')||_0x36fc3f===_0x5f86('0x4e')||_0x36fc3f===_0x5f86('0x6e')||_0x36fc3f===_0x5f86('0x6f')||_0x36fc3f===_0x5f86('0x70')||_0x36fc3f===_0x5f86('0x71')||_0x36fc3f===_0x5f86('0x72')||_0x36fc3f==='recallme'||_0x36fc3f===_0x5f86('0x19')||_0x36fc3f===_0x5f86('0x57')||_0x36fc3f==='UserId'||_0x36fc3f===_0x5f86('0x1a')||_0x36fc3f===_0x5f86('0x73')||_0x36fc3f===_0x5f86('0x74')||_0x36fc3f===_0x5f86('0x75')||_0x36fc3f===_0x5f86('0x76')||_0x36fc3f===_0x5f86('0x77')||_0x36fc3f===_0x5f86('0x78')||_0x36fc3f===_0x5f86('0x79')||_0x36fc3f==='xmd-dialoptions'||_0x36fc3f===_0x5f86('0x7a')||_0x36fc3f===_0x5f86('0x7b')||_0x36fc3f===_0x5f86('0x7c')||_0x36fc3f==='xmd-cdrtype'||_0x36fc3f==='xmd-callerid'||_0x36fc3f==='xmd-agiafter'||_0x36fc3f===_0x5f86('0x7d')||_0x36fc3f===_0x5f86('0x7e')||_0x36fc3f==='rtpaudioqosbridged'||_0x36fc3f===_0x5f86('0x7f')||_0x36fc3f==='rtpaudioqosjitterbridged'||_0x36fc3f===_0x5f86('0x80')||_0x36fc3f===_0x5f86('0x81')||_0x36fc3f===_0x5f86('0x82')||_0x36fc3f===_0x5f86('0x83')||_0x36fc3f==='rtpaudioqos'||_0x36fc3f===_0x5f86('0x84')||_0x36fc3f===_0x5f86('0x7f')||_0x36fc3f==='rtpaudioqosjitterbridged'||_0x36fc3f===_0x5f86('0x80')||_0x36fc3f===_0x5f86('0x81')||_0x36fc3f===_0x5f86('0x82')||_0x36fc3f==='rtpaudioqosrttbridged'||_0x36fc3f===_0x5f86('0x85')||_0x36fc3f===_0x5f86('0x86')||_0x36fc3f===_0x5f86('0x36')||_0x36fc3f==='statedesc'){return![];}return!![];};exports[_0x5f86('0x87')]=function(_0x370bf3,_0x281df4){var _0x152e39,_0x1c33da,_0x4be341;if(_0x281df4<=0x0){_0x281df4=0x1;}_0x152e39=new RegExp(_0x5f86('0x88')+_0x281df4+'}$');_0x1c33da=Math[_0x5f86('0x89')](0xa,_0x281df4-0x1);_0x4be341=Math[_0x5f86('0x89')](0xa,_0x281df4)-0x1;return util['format']('%s',_[_0x5f86('0x8a')](_0x370bf3,_0x152e39,_[_0x5f86('0x8b')](_0x1c33da,_0x4be341)));};exports['extractCalleridName']=function(_0x1e9ab7){var _0x3c2218=_0x1e9ab7[_0x5f86('0x8c')](/"(.*?)"/);return _0x3c2218?_0x3c2218[0x1]:_0x1e9ab7;};exports['extractCalleridNumber']=function(_0x314dfe){var _0x38837d=_0x314dfe[_0x5f86('0x8c')](/<(.*?)>/);return _0x38837d?_0x38837d[0x1]:_0x314dfe;}; \ No newline at end of file +var _0x7e49=['inspect','logger','loggerError','error','info','message','getCallerId','isUndefined','string','isEmpty','\x22\x22\x20<>','isNil','addVariables','Queue','name','format','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','membername','UserId','endtime','ringtime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','\x22%s\x22\x20<%s>','calleridnum','xcally-motion-preview','timeout','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','statedesc','Global','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','channelAgent','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch'];(function(_0x5e92b7,_0x47623){var _0x2554d0=function(_0x15905b){while(--_0x15905b){_0x5e92b7['push'](_0x5e92b7['shift']());}};_0x2554d0(++_0x47623);}(_0x7e49,0x197));var _0x97e4=function(_0x44ec92,_0x74bc6){_0x44ec92=_0x44ec92-0x0;var _0x25b191=_0x7e49[_0x44ec92];return _0x25b191;};'use strict';var util=require(_0x97e4('0x0'));var _=require(_0x97e4('0x1'));var moment=require(_0x97e4('0x2'));var logger=require(_0x97e4('0x3'))(_0x97e4('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x97e4('0x5');function getSeconds(_0xfaed7c,_0xd96cb2){var _0x25444e=moment(_0xfaed7c)['milliseconds'](0x0);var _0x2fce46=moment(_0xd96cb2)[_0x97e4('0x6')](0x0);return _0x25444e[_0x97e4('0x7')](_0x2fce46,_0x97e4('0x8'));}exports[_0x97e4('0x9')]=function(_0x41cedf){return function(_0x1a3d77){logger['error'](_0x41cedf,util[_0x97e4('0xa')](_0x1a3d77,{'showHidden':![],'depth':null}));};};exports[_0x97e4('0xb')]=function(_0x2ce329,_0x34a5d5){logger['info'](_0x2ce329,util[_0x97e4('0xa')](_0x34a5d5,{'showHidden':![],'depth':null}));};exports[_0x97e4('0xc')]=function(_0x325552,_0x9de497){logger[_0x97e4('0xd')](_0x325552,util[_0x97e4('0xa')](_0x9de497,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x356965){return function(_0x56275a){logger[_0x97e4('0xe')](_0x356965,util[_0x97e4('0xa')](_0x56275a,{'showHidden':![],'depth':null}));};};exports[_0x97e4('0xf')]=function(_0x14e4fa,_0x257b0c,_0x3dd2f3){return{'message':_0x14e4fa,'unlock':_0x257b0c,'active':_0x3dd2f3};};exports[_0x97e4('0x10')]=function(_0x1ba887,_0x2b52f6,_0x1cd9ac){if(!_[_0x97e4('0x11')](_0x1cd9ac)&&_0x97e4('0x12')===typeof _0x1cd9ac&&!_[_0x97e4('0x13')](_0x1cd9ac)){if(!_['isUndefined'](_0x2b52f6)&&_0x97e4('0x12')===typeof _0x2b52f6&&!_['isEmpty'](_0x2b52f6)){return util['format']('\x22%s\x22\x20<%s>',_0x2b52f6,_0x1cd9ac);}return util['format']('\x22%s\x22\x20<%s>',_0x1cd9ac,_0x1cd9ac);}if(!_[_0x97e4('0x11')](_0x1ba887)&&_0x97e4('0x12')===typeof _0x1ba887&&!_[_0x97e4('0x13')](_0x1ba887)){return _0x1ba887;}return _0x97e4('0x14');};exports['isActive']=function(_0x46ae4b){if(_[_0x97e4('0x15')](_0x46ae4b)){return![];}return _0x46ae4b;};exports[_0x97e4('0x16')]=function(_0x1c9599,_0x1150b3,_0x96f3fa,_0x4eb27e,_0xc9ac6,_0x58e611){var _0x476f39={'XMD-QUEUE':_0x1150b3[_0x97e4('0x17')]?_0x1150b3[_0x97e4('0x17')][_0x97e4('0x18')]:'','XMD-CALLERID':_0x4eb27e,'XMD-CALLERID-PREVIEW':_0x58e611?util[_0x97e4('0x19')]('\x22%s\x22\x20<%s>',_0x58e611[_0x97e4('0x1a')],_0x58e611['calleridnum']):_0x4eb27e,'XMD-DIALID':_0xc9ac6,'XMD-CONTACTID':_0x1150b3[_0x97e4('0x1b')],'XMD-CDRTYPE':_0x97e4('0x1c'),'CALLERID(all)':_0x4eb27e,'XMD-VOICEQUEUEID':_0x1150b3[_0x97e4('0x1d')],'XMD-DIALCHANNEL':_0x96f3fa,'XMD-DIALTIMEOUT':_0x1c9599[_0x97e4('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x1c9599[_0x97e4('0x1f')]?'g':'',_[_0x97e4('0x13')](_0x1c9599[_0x97e4('0x20')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x1c9599[_0x97e4('0x21')]||'','XMD-AGI':_0x1c9599[_0x97e4('0x22')]?util[_0x97e4('0x19')](_0x97e4('0x23'),ipAgi,_0x1c9599[_0x97e4('0x22')]):'NONE','XMD-AGIAFTER':_0x1c9599[_0x97e4('0x1f')]?util[_0x97e4('0x19')](_0x97e4('0x23'),ipAgi,_0x1c9599[_0x97e4('0x1f')]):_0x97e4('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x58e611?_0x58e611[_0x97e4('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x58e611?_0x58e611[_0x97e4('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x97e4('0x13')](_0x1c9599['monitor_format'])){_0x476f39[util[_0x97e4('0x19')]('%s',_0x97e4('0x27'))]=_0x1c9599[_0x97e4('0x20')];_0x476f39[util['format']('%s',_0x97e4('0x28'))]=_0xc9ac6;}if(_0x1150b3&&_0x1150b3[_0x97e4('0x29')]){for(var _0x389dc3 in _0x1150b3['Contact']){if(_0x1150b3[_0x97e4('0x29')][_0x97e4('0x2a')](_0x389dc3)){if(!_['isNil'](_0x1150b3['Contact'][_0x389dc3])&&_0x389dc3!=='id'&&_0x389dc3!==_0x97e4('0x2b')&&_0x389dc3!==_0x97e4('0x2c')&&_0x389dc3!==_0x97e4('0x2d')){_0x476f39[util['format']('%s%s','XMD-',_[_0x97e4('0x2e')](_0x389dc3))]=_0x1150b3[_0x97e4('0x29')][_0x389dc3];}}}}return _0x476f39;};exports[_0x97e4('0x2f')]=function(_0xf50d1b){var _0x5dfc9b={};for(var _0x138ecd in _0xf50d1b){if(_0xf50d1b[_0x97e4('0x2a')](_0x138ecd)){_0x5dfc9b[util[_0x97e4('0x19')]('%s',_['toLower'](_0x138ecd))]=_0xf50d1b[_0x138ecd];}}return{'variables':_0x5dfc9b};};exports[_0x97e4('0x30')]=function(_0x34cf18,_0x2be435){if(!_['isNil'](_0x34cf18)){if(_0x34cf18['hasOwnProperty'](_0x97e4('0x31'))){if(_0x34cf18['originated']>0x0){_0x34cf18[_0x97e4('0x31')]-=0x1;}else{logger[_0x97e4('0xd')](_0x97e4('0x32'),_0x2be435);}}}else{logger[_0x97e4('0xd')](_0x97e4('0x33'),_0x2be435);}};exports[_0x97e4('0x34')]=function(_0x5ee39c){var _0x53cb00=moment()[_0x97e4('0x19')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ee39c[_0x97e4('0x35')]=0xd;_0x5ee39c['statedesc']=_0x97e4('0x36');_0x5ee39c[_0x97e4('0x37')]=_0x53cb00;_0x5ee39c[_0x97e4('0x38')]=_0x53cb00;_0x5ee39c['endtime']=_0x53cb00;};exports[_0x97e4('0x39')]=function(_0x2408e4,_0x288a98,_0x239fbc){var _0xf0a8f3=moment()['format'](_0x97e4('0x3a'));_0x2408e4['state']=_0x288a98;_0x2408e4['statedesc']=_0x239fbc;_0x2408e4[_0x97e4('0x38')]=_0xf0a8f3;_0x2408e4['ringtime']=getSeconds(_0x2408e4[_0x97e4('0x38')],_0x2408e4[_0x97e4('0x37')]);};exports['logLookAgent']=function(_0x27084e,_0x7fc6bb,_0x3233b7){_0x27084e[_0x97e4('0x3b')]=_0x7fc6bb;_0x27084e[_0x97e4('0x3c')]=_0x3233b7;};exports['logCustomer']=function(_0x3afeca,_0x43e942,_0x278c2f){var _0x18f5bb=moment()['format'](_0x97e4('0x3a'));_0x3afeca['state']=_0x43e942;_0x3afeca['statedesc']=_0x278c2f;_0x3afeca['responsetime']=_0x3afeca[_0x97e4('0x38')]?_0x3afeca['responsetime']:_0x18f5bb;_0x3afeca[_0x97e4('0x3d')]=_0x3afeca[_0x97e4('0x3d')]?_0x3afeca[_0x97e4('0x3d')]:_0x18f5bb;_0x3afeca[_0x97e4('0x3e')]=getSeconds(_0x3afeca[_0x97e4('0x38')]||0x0,_0x3afeca['starttime']||0x0);_0x3afeca[_0x97e4('0x3f')]=_0x3afeca[_0x97e4('0x40')]?getSeconds(_0x3afeca[_0x97e4('0x3d')],_0x3afeca[_0x97e4('0x40')]):0x0;};exports[_0x97e4('0x41')]=function(_0x4e4d51){return _0x4e4d51==='Failure';};exports[_0x97e4('0x42')]=function(_0x1a2013,_0x590efd,_0x385865,_0x396a94,_0x31240d){var _0xe6ad4f=_0x396a94?_0x97e4('0x43'):_0x1a2013[_0x97e4('0x1a')];_0xe6ad4f=_0x31240d?_0x97e4('0x44'):_0xe6ad4f;return{'actionid':_0x1a2013[_0x97e4('0x45')],'action':_0x97e4('0x46'),'channel':_0x1a2013['channelAgent'],'callerid':util[_0x97e4('0x19')](_0x97e4('0x47'),_0xe6ad4f,_0x1a2013[_0x97e4('0x48')]),'Exten':_0x97e4('0x49'),'Context':'from-sip','Priority':'1','variable':_0x385865,'timeout':(_0x590efd[_0x97e4('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1a2013[_0x97e4('0x45')]};};exports['totalGlobal']=function(_0x1e9c3b){return _0x1e9c3b['countbusyretry']+_0x1e9c3b['countcongestionretry']+_0x1e9c3b['countnoanswerretry']+_0x1e9c3b[_0x97e4('0x4b')]+_0x1e9c3b[_0x97e4('0x4c')];};exports[_0x97e4('0x4d')]=function(_0xb4e36c){var _0x6cec63=_[_0x97e4('0x4e')](_0xb4e36c);_0x6cec63[_0x97e4('0x35')]=0xf;_0x6cec63[_0x97e4('0x4f')]=_0x97e4('0x50');return _0x6cec63;};exports['scheduledAt']=function(_0x147648,_0x138927,_0x2b39bf){var _0x57e61a={};_0x57e61a[_0x138927]=_0x147648[_0x138927];_0x57e61a[_0x97e4('0x51')]=![];_0x57e61a[_0x97e4('0x52')]=moment()[_0x97e4('0x53')](_0x2b39bf,_0x97e4('0x54'))[_0x97e4('0x19')]('YYYY-MM-DD\x20HH:mm:ss');_0x57e61a[_0x97e4('0x1b')]=_0x147648[_0x97e4('0x1b')];_0x57e61a[_0x97e4('0x55')]=_0x147648[_0x97e4('0x55')];_0x57e61a[_0x97e4('0x1d')]=_0x147648[_0x97e4('0x1d')]||undefined;return _0x57e61a;};exports['decrementTalkink']=function(_0x55599d,_0x5c67d5){if(!_['isNil'](_0x55599d)){if(_0x55599d['pTalking']>0x0){_0x55599d[_0x97e4('0x56')]-=0x1;}else{logger['error'](_0x5c67d5,_0x97e4('0x57'));}}else{logger[_0x97e4('0xd')](_0x5c67d5,_0x97e4('0x58'));}};exports[_0x97e4('0x59')]=function(_0x49bd82){if(_0x49bd82<=0x0){return!![];}return![];};exports['buildObj']=function(_0x49a845,_0x43545e,_0x2d1b82){_0x49a845[_0x97e4('0x5a')]=_0x43545e;_0x49a845[_0x97e4('0x18')]=_0x49a845['queue'];_0x49a845[_0x97e4('0x5b')]=_0x49a845[_0x97e4('0x5c')];_0x49a845['motionChannel']='voice';if(_0x2d1b82){_0x49a845[_0x97e4('0x5d')]=_0x2d1b82[_0x97e4('0x5d')];}return _0x49a845;};exports[_0x97e4('0x5e')]=function(_0x495a46){var _0xe71368={};_0xe71368[_0x97e4('0x5f')]=_0x495a46[_0x97e4('0x5f')];_0xe71368['interface']=_0x495a46[_0x97e4('0x5c')];_0xe71368[_0x97e4('0x45')]=_0x495a46[_0x97e4('0x45')];return _0xe71368;};exports[_0x97e4('0x60')]=function(_0x25ae0a){var _0x5f2691=[];for(var _0x55c9db in _0x25ae0a){if(_0x25ae0a[_0x97e4('0x2a')](_0x55c9db)){if(!_[_0x97e4('0x15')](_0x25ae0a[_0x55c9db])&&_0x25ae0a[_0x55c9db][_0x97e4('0x35')]===_0x97e4('0x61')&&_0x25ae0a[_0x55c9db][_0x97e4('0x62')]==='reachable'){_0x5f2691['push'](_0x25ae0a[_0x55c9db]['id']);}}}return _0x5f2691;};exports[_0x97e4('0x63')]=function(_0x258d26){var _0x316d83=moment()[_0x97e4('0x6')](0x0);var _0x32517f=moment(_0x258d26)[_0x97e4('0x6')](0x0);return _0x316d83['diff'](_0x32517f,_0x97e4('0x8'));};exports[_0x97e4('0x64')]=function(_0x20fa95){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x20fa95[_0x97e4('0x1b')],'ListId':_0x20fa95[_0x97e4('0x55')],'VoiceQueueId':_0x20fa95[_0x97e4('0x1d')]||undefined,'CampaignId':_0x20fa95[_0x97e4('0x65')]||undefined};};exports[_0x97e4('0x66')]=function(_0x21c9ce){if(_0x21c9ce===_0x97e4('0x45')||_0x21c9ce===_0x97e4('0x67')||_0x21c9ce===_0x97e4('0x5f')||_0x21c9ce===_0x97e4('0x68')||_0x21c9ce===_0x97e4('0x69')||_0x21c9ce===_0x97e4('0x6a')||_0x21c9ce===_0x97e4('0x3b')||_0x21c9ce===_0x97e4('0x5c')||_0x21c9ce===_0x97e4('0x1a')||_0x21c9ce===_0x97e4('0x51')||_0x21c9ce===_0x97e4('0x48')||_0x21c9ce===_0x97e4('0x52')||_0x21c9ce===_0x97e4('0x6b')||_0x21c9ce===_0x97e4('0x6c')||_0x21c9ce===_0x97e4('0x6d')||_0x21c9ce===_0x97e4('0x6e')||_0x21c9ce===_0x97e4('0x6f')||_0x21c9ce===_0x97e4('0x70')||_0x21c9ce===_0x97e4('0x71')||_0x21c9ce==='recallme'||_0x21c9ce===_0x97e4('0x1b')||_0x21c9ce===_0x97e4('0x55')||_0x21c9ce==='UserId'||_0x21c9ce===_0x97e4('0x1d')||_0x21c9ce==='sipcallid'||_0x21c9ce===_0x97e4('0x72')||_0x21c9ce===_0x97e4('0x73')||_0x21c9ce==='xmd-phone'||_0x21c9ce===_0x97e4('0x74')||_0x21c9ce===_0x97e4('0x75')||_0x21c9ce===_0x97e4('0x76')||_0x21c9ce==='xmd-dialoptions'||_0x21c9ce==='xmd-dialid'||_0x21c9ce===_0x97e4('0x77')||_0x21c9ce==='xmd-contactid'||_0x21c9ce===_0x97e4('0x78')||_0x21c9ce===_0x97e4('0x79')||_0x21c9ce===_0x97e4('0x7a')||_0x21c9ce===_0x97e4('0x7b')||_0x21c9ce===_0x97e4('0x7c')||_0x21c9ce===_0x97e4('0x7d')||_0x21c9ce===_0x97e4('0x7e')||_0x21c9ce===_0x97e4('0x7f')||_0x21c9ce===_0x97e4('0x80')||_0x21c9ce===_0x97e4('0x81')||_0x21c9ce===_0x97e4('0x82')||_0x21c9ce===_0x97e4('0x83')||_0x21c9ce===_0x97e4('0x7c')||_0x21c9ce===_0x97e4('0x7d')||_0x21c9ce===_0x97e4('0x7e')||_0x21c9ce==='rtpaudioqosjitterbridged'||_0x21c9ce===_0x97e4('0x80')||_0x21c9ce===_0x97e4('0x81')||_0x21c9ce===_0x97e4('0x82')||_0x21c9ce===_0x97e4('0x83')||_0x21c9ce===_0x97e4('0x84')||_0x21c9ce==='bridgepvtcallid'||_0x21c9ce===_0x97e4('0x35')||_0x21c9ce===_0x97e4('0x4f')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2faa51,_0x2eac4f){var _0x487700,_0x329273,_0x40074a;if(_0x2eac4f<=0x0){_0x2eac4f=0x1;}_0x487700=new RegExp(_0x97e4('0x85')+_0x2eac4f+'}$');_0x329273=Math[_0x97e4('0x86')](0xa,_0x2eac4f-0x1);_0x40074a=Math[_0x97e4('0x86')](0xa,_0x2eac4f)-0x1;return util['format']('%s',_[_0x97e4('0x87')](_0x2faa51,_0x487700,_[_0x97e4('0x88')](_0x329273,_0x40074a)));};exports['extractCalleridName']=function(_0x50db42){var _0x254120=_0x50db42[_0x97e4('0x89')](/"(.*?)"/);return _0x254120?_0x254120[0x1]:_0x50db42;};exports[_0x97e4('0x8a')]=function(_0x4a7786){var _0x118b9c=_0x4a7786[_0x97e4('0x89')](/<(.*?)>/);return _0x118b9c?_0x118b9c[0x1]:_0x4a7786;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 034028a..9aa70ea 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 _0x00e2=['queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove'];(function(_0x469515,_0x19aba8){var _0x5b5c08=function(_0x342288){while(--_0x342288){_0x469515['push'](_0x469515['shift']());}};_0x5b5c08(++_0x19aba8);}(_0x00e2,0x109));var _0x200e=function(_0x3cf1b1,_0x445a0a){_0x3cf1b1=_0x3cf1b1-0x0;var _0x347602=_0x00e2[_0x3cf1b1];return _0x347602;};'use strict';exports[_0x200e('0x0')]={'queue':{'type':_0x200e('0x1'),'required':!![]},'interface':{'type':_0x200e('0x1'),'required':!![]},'membername':{'type':_0x200e('0x1'),'required':!![]},'penalty':{'type':_0x200e('0x2'),'required':![]},'paused':{'type':_0x200e('0x3'),'required':![]}};exports[_0x200e('0x4')]={'queue':{'type':_0x200e('0x1'),'required':!![]},'interface':{'type':_0x200e('0x1'),'required':!![]}};exports[_0x200e('0x5')]={'interface':{'type':_0x200e('0x1'),'required':!![]},'paused':{'type':_0x200e('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x200e('0x1'),'required':![]}};exports[_0x200e('0x6')]={'uniqueid':{'type':_0x200e('0x1'),'required':!![]}};exports[_0x200e('0x7')]={'uniqueid':{'type':_0x200e('0x1'),'required':!![]},'filename':{'type':_0x200e('0x1')},'format':{'type':_0x200e('0x1')},'mixmonitorid':{'type':_0x200e('0x1')}};exports[_0x200e('0x8')]={'uniqueid':{'type':_0x200e('0x1'),'required':!![]}};exports[_0x200e('0x9')]={'uniqueid':{'type':_0x200e('0x1'),'required':!![]},'exten':{'type':_0x200e('0x1'),'required':!![]},'context':{'type':_0x200e('0x1')}}; \ No newline at end of file +var _0x5e8a=['queueremove','voicequeuechannel','voicequeuechannelredirect','string','number','boolean'];(function(_0x50e9fd,_0x551b88){var _0x3a202e=function(_0x28a9b7){while(--_0x28a9b7){_0x50e9fd['push'](_0x50e9fd['shift']());}};_0x3a202e(++_0x551b88);}(_0x5e8a,0x8d));var _0xa5e8=function(_0x567403,_0x29eb04){_0x567403=_0x567403-0x0;var _0x27cef5=_0x5e8a[_0x567403];return _0x27cef5;};'use strict';exports['queueadd']={'queue':{'type':_0xa5e8('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xa5e8('0x0'),'required':!![]},'penalty':{'type':_0xa5e8('0x1'),'required':![]},'paused':{'type':_0xa5e8('0x2'),'required':![]}};exports[_0xa5e8('0x3')]={'queue':{'type':_0xa5e8('0x0'),'required':!![]},'interface':{'type':_0xa5e8('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xa5e8('0x0'),'required':!![]},'paused':{'type':_0xa5e8('0x2')},'reason':{'type':_0xa5e8('0x0'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xa5e8('0x4')]={'uniqueid':{'type':_0xa5e8('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xa5e8('0x0'),'required':!![]},'filename':{'type':_0xa5e8('0x0')},'format':{'type':_0xa5e8('0x0')},'mixmonitorid':{'type':_0xa5e8('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xa5e8('0x0'),'required':!![]}};exports[_0xa5e8('0x5')]={'uniqueid':{'type':_0xa5e8('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xa5e8('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 7f07152..30625a3 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 _0x64b9=['deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','interface','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','seconds','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initCampaignHopperHistory','initFaxAccounts','bluebird','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','freshdeskAccounts','zohoAccounts'];(function(_0x1a73e7,_0x166be4){var _0xa7db77=function(_0x118490){while(--_0x118490){_0x1a73e7['push'](_0x1a73e7['shift']());}};_0xa7db77(++_0x166be4);}(_0x64b9,0x127));var _0x964b=function(_0x297694,_0x2d99fa){_0x297694=_0x297694-0x0;var _0x322aee=_0x64b9[_0x297694];return _0x322aee;};'use strict';var BPromise=require(_0x964b('0x0'));var util=require('util');var _=require(_0x964b('0x1'));var moment=require('moment');var Agent=require(_0x964b('0x2'));var Telephone=require(_0x964b('0x3'));var Trunk=require(_0x964b('0x4'));var VoiceQueue=require(_0x964b('0x5'));var Trigger=require(_0x964b('0x6'));var Template=require(_0x964b('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x964b('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x964b('0x9'));var ZohoAccount=require(_0x964b('0xa'));var DeskAccount=require(_0x964b('0xb'));var VtigerAccount=require(_0x964b('0xc'));var ServicenowAccount=require(_0x964b('0xd'));var Dynamics365Account=require(_0x964b('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x964b('0xf'));var Realtime=function(){this[_0x964b('0x10')]={};this[_0x964b('0x11')]={};this[_0x964b('0x12')]={};this[_0x964b('0x13')]={};this['triggers']={};this[_0x964b('0x14')]={};this[_0x964b('0x15')]={};this[_0x964b('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x964b('0x17')]={};this[_0x964b('0x18')]={};this[_0x964b('0x19')]={};this[_0x964b('0x1a')]={};this[_0x964b('0x1b')]={};this[_0x964b('0x1c')]={};this[_0x964b('0x1d')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x964b('0x1e')]={};this[_0x964b('0x1f')]={};this[_0x964b('0x20')]={};this['vtigerAccounts']={};this[_0x964b('0x21')]={};this[_0x964b('0x22')]={};this[_0x964b('0x23')]={};this[_0x964b('0x24')]={};};function freeIsNotKey(_0xeb34e8,_0x13b380,_0x1b128a){var _0x463769=_['mapKeys'](_0xeb34e8,function(_0x4e80fb,_0x88ba8d){return _0x4e80fb[_0x1b128a];});for(var _0x5f1530 in _0x13b380){if(_0x13b380[_0x964b('0x25')](_0x5f1530)){if(!_0x463769[_0x5f1530]){delete _0x13b380[_0x5f1530];}}}}function freeIsNotKeySip(_0x2dd47e,_0x4acdb0){var _0x3776d7=_[_0x964b('0x26')](_0x2dd47e,function(_0xec9a09,_0x5afac3){return util[_0x964b('0x27')](_0x964b('0x28'),_0xec9a09['name']);});for(var _0xa87da9 in _0x4acdb0){if(_0x4acdb0[_0x964b('0x25')](_0xa87da9)){if(!_0x3776d7[_0xa87da9]){delete _0x4acdb0[_0xa87da9];}}}}function freeIsNotKeyAgent(_0x1065ae,_0x39cf4b){var _0x32d026=_['mapKeys'](_0x1065ae,function(_0x837e0c,_0x3cc27e){var _0x102814=_['isNil'](_0x837e0c[_0x964b('0x29')])?util['format']('SIP/%s',_0x837e0c[_0x964b('0x2a')]):_0x837e0c[_0x964b('0x29')];return _0x102814;});for(var _0x13b61b in _0x39cf4b){if(_0x39cf4b[_0x964b('0x25')](_0x13b61b)){if(!_0x32d026[_0x13b61b]){delete _0x39cf4b[_0x13b61b];}}}}function clearVoiceCallReports(_0x56d4d0){_0x56d4d0[_0x964b('0x2b')]=0x0;_0x56d4d0[_0x964b('0x2c')]=0x0;_0x56d4d0[_0x964b('0x2d')]=0x0;_0x56d4d0[_0x964b('0x2e')]=0x0;_0x56d4d0[_0x964b('0x2f')]=0x0;}function clearCampaigns(_0xbdfc6c){if(!_[_0x964b('0x30')](_0xbdfc6c)){for(var _0x5da64c in _0xbdfc6c){if(_0xbdfc6c[_0x964b('0x25')](_0x5da64c)){_0xbdfc6c[_0x5da64c][_0x964b('0x31')]=0x0;_0xbdfc6c[_0x5da64c][_0x964b('0x32')]=0x0;}}}}function clearVoiceQueues(_0x22f80e){if(!_['isEmpty'](_0x22f80e)){for(var _0x5d777b in _0x22f80e){if(_0x22f80e[_0x964b('0x25')](_0x5d777b)){_0x22f80e[_0x5d777b][_0x964b('0x2b')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x2c')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x33')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x34')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x2d')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x2e')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x2f')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x35')]=0x0;_0x22f80e[_0x5d777b]['outboundNoAnswerCallsDay']=0x0;_0x22f80e[_0x5d777b][_0x964b('0x36')]=0x0;_0x22f80e[_0x5d777b]['outboundCongestionCallsDay']=0x0;_0x22f80e[_0x5d777b][_0x964b('0x37')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x38')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x39')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x3a')]=0x0;_0x22f80e[_0x5d777b]['outboundBlacklistCallsDay']=0x0;_0x22f80e[_0x5d777b]['outboundOriginateFailureCallsDay']=0x0;_0x22f80e[_0x5d777b][_0x964b('0x3b')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x3c')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x35')]=0x0;_0x22f80e[_0x5d777b][_0x964b('0x3d')]=0x0;_0x22f80e[_0x5d777b]['queueStatusComplete']=!![];}}}}Realtime[_0x964b('0x3e')][_0x964b('0x3f')]=function(_0x172b08,_0x17b489){for(var _0x5a863a in _0x17b489){if(_0x172b08[_0x964b('0x25')](_0x5a863a)){_0x172b08[_0x5a863a]=_0x17b489[_0x5a863a];}}};Realtime[_0x964b('0x3e')][_0x964b('0x40')]=function(){var _0x543db3=this;return function(_0x2e53ab){if(_0x2e53ab){freeIsNotKeyAgent(_0x2e53ab,_0x543db3[_0x964b('0x10')]);for(var _0x5d4fdc=0x0,_0x53b1b9={},_0x3c15ab={};_0x5d4fdc<_0x2e53ab[_0x964b('0x41')];_0x5d4fdc+=0x1){_0x53b1b9=_0x2e53ab[_0x5d4fdc];var _0x14e352=_[_0x964b('0x42')](_0x53b1b9['interface'])?util[_0x964b('0x27')](_0x964b('0x28'),_0x53b1b9[_0x964b('0x2a')]):_0x53b1b9[_0x964b('0x29')];if(_[_0x964b('0x43')](_0x543db3[_0x964b('0x10')][_0x14e352])){_0x543db3[_0x964b('0x10')][_0x14e352]=new Agent(_0x53b1b9);}else{_0x543db3[_0x964b('0x3f')](_0x543db3[_0x964b('0x10')][_0x14e352],_0x53b1b9);}}}return _0x543db3[_0x964b('0x10')];};};Realtime[_0x964b('0x3e')][_0x964b('0x44')]=function(){var _0x13a3fd=this;return function(_0x23e2e8){if(_0x23e2e8){freeIsNotKeySip(_0x23e2e8,_0x13a3fd[_0x964b('0x11')]);for(var _0x22e45f=0x0,_0x542af5={},_0x534a82={};_0x22e45f<_0x23e2e8[_0x964b('0x41')];_0x22e45f+=0x1){_0x542af5=_0x23e2e8[_0x22e45f];if(_[_0x964b('0x43')](_0x13a3fd[_0x964b('0x11')][util[_0x964b('0x27')](_0x964b('0x28'),_0x542af5[_0x964b('0x2a')])])){_0x13a3fd[_0x964b('0x11')][util[_0x964b('0x27')]('SIP/%s',_0x542af5[_0x964b('0x2a')])]=new Telephone(_0x542af5);}else{_0x13a3fd['mergeFromDatabase'](_0x13a3fd[_0x964b('0x11')][util['format'](_0x964b('0x28'),_0x542af5['name'])],_0x542af5);}}}return _0x13a3fd['telephones'];};};Realtime[_0x964b('0x3e')][_0x964b('0x45')]=function(){var _0x50e8c8=this;return function(_0x1ca7d8){if(_0x1ca7d8){freeIsNotKeySip(_0x1ca7d8,_0x50e8c8['trunks']);for(var _0xfe5b68=0x0,_0xe0a768={},_0x3c9192={};_0xfe5b68<_0x1ca7d8[_0x964b('0x41')];_0xfe5b68+=0x1){_0xe0a768=_0x1ca7d8[_0xfe5b68];if(_[_0x964b('0x43')](_0x50e8c8['trunks'][util['format'](_0x964b('0x28'),_0xe0a768[_0x964b('0x2a')])])){_0x50e8c8['trunks'][util[_0x964b('0x27')]('SIP/%s',_0xe0a768['name'])]=new Trunk(_0xe0a768);}else{_0x50e8c8[_0x964b('0x3f')](_0x50e8c8[_0x964b('0x12')][util[_0x964b('0x27')](_0x964b('0x28'),_0xe0a768[_0x964b('0x2a')])],_0xe0a768);}}}return _0x50e8c8['trunks'];};};Realtime[_0x964b('0x3e')][_0x964b('0x46')]=function(){var _0x77275f=this;return function(_0x39ec27){if(_0x39ec27){freeIsNotKey(_0x39ec27,_0x77275f['voiceQueues'],_0x964b('0x2a'));for(var _0x901b2c=0x0,_0x509d1c={},_0x43c0a6={};_0x901b2c<_0x39ec27[_0x964b('0x41')];_0x901b2c+=0x1){_0x509d1c=_0x39ec27[_0x901b2c];if(_[_0x964b('0x43')](_0x77275f[_0x964b('0x13')][_0x509d1c[_0x964b('0x2a')]])){_0x77275f[_0x964b('0x13')][_0x509d1c[_0x964b('0x2a')]]=new VoiceQueue(_0x509d1c);}else{_0x77275f['mergeFromDatabase'](_0x77275f[_0x964b('0x13')][_0x509d1c['name']],_0x509d1c);}}}return _0x77275f[_0x964b('0x13')];};};Realtime[_0x964b('0x3e')][_0x964b('0x47')]=function(){var _0x5906a7=this;return function(_0x4fa1cb){if(_0x4fa1cb){freeIsNotKey(_0x4fa1cb,_0x5906a7[_0x964b('0x48')],'id');for(var _0xa69dfb=0x0,_0x8a4e6d={},_0x558092={};_0xa69dfb<_0x4fa1cb[_0x964b('0x41')];_0xa69dfb+=0x1){_0x8a4e6d=_0x4fa1cb[_0xa69dfb];if(_[_0x964b('0x43')](_0x5906a7['triggers'][_0x8a4e6d['id']])){_0x5906a7[_0x964b('0x48')][_0x8a4e6d['id']]=new Trigger(_0x8a4e6d);}else{_0x5906a7[_0x964b('0x3f')](_0x5906a7[_0x964b('0x48')][_0x8a4e6d['id']],_0x8a4e6d);}}}return _0x5906a7[_0x964b('0x48')];};};Realtime[_0x964b('0x3e')][_0x964b('0x49')]=function(){var _0x55d90e=this;return function(_0x6b004e){if(_0x6b004e){freeIsNotKey(_0x6b004e,_0x55d90e[_0x964b('0x15')],'id');for(var _0x12c93c=0x0,_0x10b27d={},_0xa8ba96={};_0x12c93c<_0x6b004e[_0x964b('0x41')];_0x12c93c+=0x1){_0x10b27d=_0x6b004e[_0x12c93c];if(_[_0x964b('0x43')](_0x55d90e[_0x964b('0x15')][_0x10b27d['id']])){_0x55d90e[_0x964b('0x15')][_0x10b27d['id']]=new Template(_0x10b27d);}else{_0x55d90e[_0x964b('0x3f')](_0x55d90e[_0x964b('0x15')][_0x10b27d['id']],_0x10b27d);}}}return _0x55d90e['templates'];};};Realtime[_0x964b('0x3e')][_0x964b('0x4a')]=function(){var _0x54d977=this;return function(_0x358be8){if(_0x358be8){freeIsNotKey(_0x358be8,_0x54d977['zendeskAccounts'],'id');for(var _0x50d9c3=0x0,_0xecf675={},_0x6f1e4e={};_0x50d9c3<_0x358be8[_0x964b('0x41')];_0x50d9c3+=0x1){_0xecf675=_0x358be8[_0x50d9c3];if(_[_0x964b('0x43')](_0x54d977[_0x964b('0x1d')][_0xecf675['id']])){_0x54d977[_0x964b('0x1d')][_0xecf675['id']]=new ZendeskAccount(_0xecf675);}else{_0x54d977['mergeFromDatabase'](_0x54d977[_0x964b('0x1d')][_0xecf675['id']],_0xecf675);}}}return _0x54d977[_0x964b('0x1d')];};};Realtime[_0x964b('0x3e')][_0x964b('0x4b')]=function(){var _0x12dd16=this;return function(_0x3dc1c4){if(_0x3dc1c4){freeIsNotKey(_0x3dc1c4,_0x12dd16['salesforceAccounts'],'id');for(var _0x5986d7=0x0,_0x47ae71={},_0x4e9c92={};_0x5986d7<_0x3dc1c4[_0x964b('0x41')];_0x5986d7+=0x1){_0x47ae71=_0x3dc1c4[_0x5986d7];if(_['isUndefined'](_0x12dd16[_0x964b('0x4c')][_0x47ae71['id']])){_0x12dd16['salesforceAccounts'][_0x47ae71['id']]=new SalesforceAccount(_0x47ae71);}else{_0x12dd16['mergeFromDatabase'](_0x12dd16[_0x964b('0x4c')][_0x47ae71['id']],_0x47ae71);}}}return _0x12dd16[_0x964b('0x4c')];};};Realtime['prototype'][_0x964b('0x4d')]=function(){var _0x2c728d=this;return function(_0xe60c32){if(_0xe60c32){freeIsNotKey(_0xe60c32,_0x2c728d[_0x964b('0x1e')],'id');for(var _0x1bdff3=0x0,_0x41eeef={},_0x52f75b={};_0x1bdff3<_0xe60c32[_0x964b('0x41')];_0x1bdff3+=0x1){_0x41eeef=_0xe60c32[_0x1bdff3];if(_[_0x964b('0x43')](_0x2c728d[_0x964b('0x1e')][_0x41eeef['id']])){_0x2c728d['freshdeskAccounts'][_0x41eeef['id']]=new FreshdeskAccount(_0x41eeef);}else{_0x2c728d['mergeFromDatabase'](_0x2c728d[_0x964b('0x1e')][_0x41eeef['id']],_0x41eeef);}}}return _0x2c728d[_0x964b('0x1e')];};};Realtime[_0x964b('0x3e')][_0x964b('0x4e')]=function(){var _0x1b14b1=this;return function(_0x162605){if(_0x162605){freeIsNotKey(_0x162605,_0x1b14b1['zohoAccounts'],'id');for(var _0x9fcc53=0x0,_0x126327={},_0xc72e4f={};_0x9fcc53<_0x162605[_0x964b('0x41')];_0x9fcc53+=0x1){_0x126327=_0x162605[_0x9fcc53];if(_['isUndefined'](_0x1b14b1[_0x964b('0x1f')][_0x126327['id']])){_0x1b14b1[_0x964b('0x1f')][_0x126327['id']]=new ZohoAccount(_0x126327);}else{_0x1b14b1[_0x964b('0x3f')](_0x1b14b1['zohoAccounts'][_0x126327['id']],_0x126327);}}}return _0x1b14b1[_0x964b('0x1f')];};};Realtime[_0x964b('0x3e')][_0x964b('0x4f')]=function(){var _0x3a0b4d=this;return function(_0xa7f201){if(_0xa7f201){freeIsNotKey(_0xa7f201,_0x3a0b4d[_0x964b('0x20')],'id');for(var _0x2c19d5=0x0,_0xc03ffb={},_0x22227f={};_0x2c19d5<_0xa7f201[_0x964b('0x41')];_0x2c19d5+=0x1){_0xc03ffb=_0xa7f201[_0x2c19d5];if(_['isUndefined'](_0x3a0b4d['deskAccounts'][_0xc03ffb['id']])){_0x3a0b4d[_0x964b('0x20')][_0xc03ffb['id']]=new DeskAccount(_0xc03ffb);}else{_0x3a0b4d[_0x964b('0x3f')](_0x3a0b4d[_0x964b('0x20')][_0xc03ffb['id']],_0xc03ffb);}}}return _0x3a0b4d[_0x964b('0x20')];};};Realtime['prototype'][_0x964b('0x50')]=function(){var _0x4c92fc=this;return function(_0x55ee0b){if(_0x55ee0b){freeIsNotKey(_0x55ee0b,_0x4c92fc[_0x964b('0x51')],'id');for(var _0x226d72=0x0,_0xd4260f={},_0x52f214={};_0x226d72<_0x55ee0b[_0x964b('0x41')];_0x226d72+=0x1){_0xd4260f=_0x55ee0b[_0x226d72];if(_[_0x964b('0x43')](_0x4c92fc[_0x964b('0x51')][_0xd4260f['id']])){_0x4c92fc[_0x964b('0x51')][_0xd4260f['id']]=new SugarcrmAccount(_0xd4260f);}else{_0x4c92fc[_0x964b('0x3f')](_0x4c92fc[_0x964b('0x51')][_0xd4260f['id']],_0xd4260f);}}}return _0x4c92fc['sugarcrmAccounts'];};};Realtime['prototype'][_0x964b('0x52')]=function(){var _0x28d47d=this;return function(_0x1553ac){if(_0x1553ac){freeIsNotKey(_0x1553ac,_0x28d47d['vtigerAccounts'],'id');for(var _0x26bdc3=0x0,_0x100c76={},_0x21319c={};_0x26bdc3<_0x1553ac['length'];_0x26bdc3+=0x1){_0x100c76=_0x1553ac[_0x26bdc3];if(_[_0x964b('0x43')](_0x28d47d[_0x964b('0x53')][_0x100c76['id']])){_0x28d47d[_0x964b('0x53')][_0x100c76['id']]=new VtigerAccount(_0x100c76);}else{_0x28d47d['mergeFromDatabase'](_0x28d47d[_0x964b('0x53')][_0x100c76['id']],_0x100c76);}}}return _0x28d47d[_0x964b('0x53')];};};Realtime[_0x964b('0x3e')][_0x964b('0x54')]=function(){var _0x2cc648=this;return function(_0x235f83){if(_0x235f83){freeIsNotKey(_0x235f83,_0x2cc648[_0x964b('0x21')],'id');for(var _0x33cd30=0x0,_0x37e3cf={},_0x26d4a4={};_0x33cd30<_0x235f83[_0x964b('0x41')];_0x33cd30+=0x1){_0x37e3cf=_0x235f83[_0x33cd30];if(_[_0x964b('0x43')](_0x2cc648[_0x964b('0x21')][_0x37e3cf['id']])){_0x2cc648[_0x964b('0x21')][_0x37e3cf['id']]=new ServicenowAccount(_0x37e3cf);}else{_0x2cc648[_0x964b('0x3f')](_0x2cc648[_0x964b('0x21')][_0x37e3cf['id']],_0x37e3cf);}}}return _0x2cc648[_0x964b('0x21')];};};Realtime['prototype'][_0x964b('0x55')]=function(){var _0x511c90=this;return function(_0x57f467){if(_0x57f467){freeIsNotKey(_0x57f467,_0x511c90[_0x964b('0x22')],'id');for(var _0x499cb5=0x0,_0x2eac01={},_0x13462b={};_0x499cb5<_0x57f467[_0x964b('0x41')];_0x499cb5+=0x1){_0x2eac01=_0x57f467[_0x499cb5];if(_[_0x964b('0x43')](_0x511c90[_0x964b('0x22')][_0x2eac01['id']])){_0x511c90['dynamics365Accounts'][_0x2eac01['id']]=new Dynamics365Account(_0x2eac01);}else{_0x511c90[_0x964b('0x3f')](_0x511c90[_0x964b('0x22')][_0x2eac01['id']],_0x2eac01);}}}return _0x511c90['dynamics365Accounts'];};};Realtime['prototype'][_0x964b('0x56')]=function(){var _0x550188=this;return function(_0xa76de4){if(_0xa76de4){freeIsNotKey(_0xa76de4,_0x550188[_0x964b('0x23')],'id');for(var _0x2301bb=0x0,_0x5dcd0e={},_0x256679={};_0x2301bb<_0xa76de4['length'];_0x2301bb+=0x1){_0x5dcd0e=_0xa76de4[_0x2301bb];if(_['isUndefined'](_0x550188[_0x964b('0x23')][_0x5dcd0e['id']])){_0x550188[_0x964b('0x23')][_0x5dcd0e['id']]=new FreshsalesAccount(_0x5dcd0e);}else{_0x550188[_0x964b('0x3f')](_0x550188['freshsalesAccounts'][_0x5dcd0e['id']],_0x5dcd0e);}}}return _0x550188['freshsalesAccounts'];};};Realtime[_0x964b('0x3e')]['initVoiceQueueHopperHistory']=function(){var _0x270386=this;return function(_0x34217c){for(var _0x19d5dd=0x0;_0x19d5dd<_0x34217c[_0x964b('0x41')];_0x19d5dd+=0x1){_[_0x964b('0x57')](_0x270386['voiceQueues'][_0x34217c[_0x19d5dd][_0x964b('0x2a')]],_0x34217c[_0x19d5dd]);}return _0x270386['voiceQueues'];};};Realtime[_0x964b('0x3e')]['initVoiceQueueReports']=function(){var _0x1a4400=this;return function(_0x44dd37){clearVoiceQueues(_0x1a4400[_0x964b('0x13')]);if(_0x44dd37){_0x44dd37=_[_0x964b('0x58')](_0x44dd37,_0x964b('0x59'));for(var _0x404b4b in _0x44dd37){if(_0x44dd37['hasOwnProperty'](_0x404b4b)){var _0x239648={};for(var _0x32e1c8=0x0;_0x32e1c8<_0x44dd37[_0x404b4b][_0x964b('0x41')];_0x32e1c8+=0x1){var _0x58eed3=_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5a')];if(_0x1a4400[_0x964b('0x13')][_0x58eed3]){if(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5b')]){_0x1a4400['voiceQueues'][_0x58eed3][_0x964b('0x33')]+=0x1;}if(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5c')]){_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x34')]+=0x1;}_0x1a4400[_0x964b('0x13')][_0x58eed3]['sumHoldTime']+=moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5d')])[_0x964b('0x5e')](moment(_0x44dd37[_0x404b4b][_0x32e1c8]['queuecallerjoinAt']),'seconds')||0x0;if(_0x32e1c8===_0x44dd37[_0x404b4b][_0x964b('0x41')]-0x1){_0x1a4400[_0x964b('0x13')][_0x58eed3]['sumDuration']+=moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5f')]||_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x60')]||_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x61')])[_0x964b('0x5e')](moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x62')]),_0x964b('0x63'))||0x0;_0x1a4400[_0x964b('0x13')][_0x58eed3]['total']+=0x1;if(_0x44dd37[_0x404b4b][_0x32e1c8]['queuecallercomplete']){_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x2c')]+=0x1;_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x2f')]+=moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5f')])[_0x964b('0x5e')](moment(_0x44dd37[_0x404b4b][_0x32e1c8][_0x964b('0x5d')]),_0x964b('0x63'))||0x0;}}else{_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x2e')]+=_0x1a4400[_0x964b('0x13')][_0x58eed3][_0x964b('0x2d')]||0x0;}}}}}}return _0x1a4400[_0x964b('0x13')];};};Realtime[_0x964b('0x3e')][_0x964b('0x64')]=function(){var _0x32e0e3=this;return function(_0x351e2c){clearVoiceCallReports(_0x32e0e3[_0x964b('0x16')]);if(_0x351e2c){for(var _0x38c7dc=0x0;_0x38c7dc<_0x351e2c['length'];_0x38c7dc+=0x1){_0x32e0e3[_0x964b('0x16')][_0x964b('0x2b')]+=0x1;_0x32e0e3[_0x964b('0x16')][_0x964b('0x2e')]+=_0x351e2c[_0x38c7dc][_0x964b('0x65')];if(_0x351e2c[_0x38c7dc][_0x964b('0x66')]===_0x964b('0x67')){_0x32e0e3[_0x964b('0x16')][_0x964b('0x2c')]+=0x1;_0x32e0e3[_0x964b('0x16')][_0x964b('0x2d')]+=_0x351e2c[_0x38c7dc][_0x964b('0x65')]-_0x351e2c[_0x38c7dc][_0x964b('0x68')]||0x0;_0x32e0e3['outbound'][_0x964b('0x2f')]+=_0x351e2c[_0x38c7dc][_0x964b('0x68')];}}}return _0x32e0e3[_0x964b('0x16')];};};Realtime[_0x964b('0x3e')][_0x964b('0x69')]=function(){var _0x36ebce=this;return function(_0x14efbe){if(_0x14efbe){freeIsNotKey(_0x14efbe,_0x36ebce['campaigns'],'name');for(var _0x28fe5c=0x0,_0x1b1dfd={};_0x28fe5c<_0x14efbe[_0x964b('0x41')];_0x28fe5c+=0x1){_0x1b1dfd=_0x14efbe[_0x28fe5c];if(_['isUndefined'](_0x36ebce[_0x964b('0x14')][_0x1b1dfd[_0x964b('0x2a')]])){_0x36ebce[_0x964b('0x14')][_0x1b1dfd[_0x964b('0x2a')]]=new Campaign(_0x1b1dfd);}else{_0x36ebce[_0x964b('0x3f')](_0x36ebce[_0x964b('0x14')][_0x1b1dfd[_0x964b('0x2a')]],_0x1b1dfd);_0x36ebce[_0x964b('0x14')][_0x1b1dfd[_0x964b('0x2a')]]['dialQueueProject']=_0x1b1dfd[_0x964b('0x6a')]?_0x1b1dfd['SquareProject'][_0x964b('0x2a')]:undefined;}}}return _0x36ebce[_0x964b('0x14')];};};Realtime[_0x964b('0x3e')]['initVoiceExtensions']=function(){var _0x11de8a=this;return function(_0x37f05e){if(_0x37f05e){freeIsNotKey(_0x37f05e,_0x11de8a[_0x964b('0x17')],'id');for(var _0x2154dd=0x0,_0x34750c={};_0x2154dd<_0x37f05e[_0x964b('0x41')];_0x2154dd+=0x1){_0x34750c=_0x37f05e[_0x2154dd];if(_['isUndefined'](_0x11de8a[_0x964b('0x17')][_0x34750c['id']])){_0x11de8a[_0x964b('0x17')][_0x34750c['id']]=new VoiceExtension(_0x34750c);}else{_0x11de8a[_0x964b('0x3f')](_0x11de8a[_0x964b('0x17')][_0x34750c['id']],_0x34750c);}}}return _0x11de8a[_0x964b('0x17')];};};Realtime[_0x964b('0x3e')][_0x964b('0x6b')]=function(){var _0x3e4a3f=this;return function(_0x512f6b){clearCampaigns(_0x3e4a3f[_0x964b('0x14')]);for(var _0x175d2f=0x0;_0x175d2f<_0x512f6b[_0x964b('0x41')];_0x175d2f+=0x1){_['merge'](_0x3e4a3f[_0x964b('0x14')][_0x512f6b[_0x175d2f][_0x964b('0x2a')]],_0x512f6b[_0x175d2f]);}return _0x3e4a3f[_0x964b('0x14')];};};Realtime['prototype'][_0x964b('0x6c')]=function(){var _0x39fcd6=this;return function(_0x187037){if(_0x187037){freeIsNotKey(_0x187037,_0x39fcd6[_0x964b('0x24')],'id');for(var _0x55a17b=0x0,_0x5a2952={},_0x5b1a0a={};_0x55a17b<_0x187037[_0x964b('0x41')];_0x55a17b+=0x1){_0x5a2952=_0x187037[_0x55a17b];if(_[_0x964b('0x43')](_0x39fcd6[_0x964b('0x24')][_0x5a2952['id']])){_0x39fcd6[_0x964b('0x24')][_0x5a2952['id']]=new FaxAccount(_0x5a2952);}else{_0x39fcd6['mergeFromDatabase'](_0x39fcd6['faxAccounts'][_0x5a2952['id']],_0x5a2952);}}}return _0x39fcd6[_0x964b('0x24')];};};module['exports']=Realtime; \ No newline at end of file +var _0xa5e7=['initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','templates','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','interface','format','SIP/%s','name','sumBillable','isEmpty','ivrTotalCallsDays','answered','unmanaged','abandoned','sumHoldTime','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initVoiceQueues','voiceQueues','initTriggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts'];(function(_0x55c338,_0x31fcdf){var _0x1c1016=function(_0x446f12){while(--_0x446f12){_0x55c338['push'](_0x55c338['shift']());}};_0x1c1016(++_0x31fcdf);}(_0xa5e7,0x1d5));var _0x7a5e=function(_0x51614d,_0x4038d7){_0x51614d=_0x51614d-0x0;var _0x3ffc34=_0xa5e7[_0x51614d];return _0x3ffc34;};'use strict';var BPromise=require(_0x7a5e('0x0'));var util=require('util');var _=require(_0x7a5e('0x1'));var moment=require(_0x7a5e('0x2'));var Agent=require(_0x7a5e('0x3'));var Telephone=require(_0x7a5e('0x4'));var Trunk=require(_0x7a5e('0x5'));var VoiceQueue=require(_0x7a5e('0x6'));var Trigger=require('../model/trigger');var Template=require(_0x7a5e('0x7'));var Campaign=require(_0x7a5e('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x7a5e('0x9'));var SalesforceAccount=require(_0x7a5e('0xa'));var FreshdeskAccount=require(_0x7a5e('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x7a5e('0xc'));var VtigerAccount=require(_0x7a5e('0xd'));var ServicenowAccount=require(_0x7a5e('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x7a5e('0xf'));var FaxAccount=require(_0x7a5e('0x10'));var Realtime=function(){this[_0x7a5e('0x11')]={};this[_0x7a5e('0x12')]={};this['trunks']={};this['voiceQueues']={};this[_0x7a5e('0x13')]={};this['campaigns']={};this[_0x7a5e('0x14')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7a5e('0x15')]={};this[_0x7a5e('0x16')]={};this[_0x7a5e('0x17')]={};this[_0x7a5e('0x18')]={};this['timers']={};this[_0x7a5e('0x19')]={};this[_0x7a5e('0x1a')]={};this[_0x7a5e('0x1b')]={};this[_0x7a5e('0x1c')]={};this['freshdeskAccounts']={};this[_0x7a5e('0x1d')]={};this[_0x7a5e('0x1e')]={};this[_0x7a5e('0x1f')]={};this[_0x7a5e('0x20')]={};this['dynamics365Accounts']={};this[_0x7a5e('0x21')]={};this[_0x7a5e('0x22')]={};};function freeIsNotKey(_0x1e802d,_0x1de02f,_0x299a08){var _0x25e8f0=_[_0x7a5e('0x23')](_0x1e802d,function(_0x4848cf,_0x24b0a8){return _0x4848cf[_0x299a08];});for(var _0x22ebea in _0x1de02f){if(_0x1de02f[_0x7a5e('0x24')](_0x22ebea)){if(!_0x25e8f0[_0x22ebea]){delete _0x1de02f[_0x22ebea];}}}}function freeIsNotKeySip(_0x39917c,_0x48ac97){var _0x75a3f5=_[_0x7a5e('0x23')](_0x39917c,function(_0x1fae9d,_0x529827){return util['format']('SIP/%s',_0x1fae9d['name']);});for(var _0x239a69 in _0x48ac97){if(_0x48ac97[_0x7a5e('0x24')](_0x239a69)){if(!_0x75a3f5[_0x239a69]){delete _0x48ac97[_0x239a69];}}}}function freeIsNotKeyAgent(_0x3e6815,_0x23a8ce){var _0x2692ca=_[_0x7a5e('0x23')](_0x3e6815,function(_0x1bedfc,_0x3d6004){var _0x3989ca=_['isNil'](_0x1bedfc[_0x7a5e('0x25')])?util[_0x7a5e('0x26')](_0x7a5e('0x27'),_0x1bedfc[_0x7a5e('0x28')]):_0x1bedfc[_0x7a5e('0x25')];return _0x3989ca;});for(var _0x34dacc in _0x23a8ce){if(_0x23a8ce['hasOwnProperty'](_0x34dacc)){if(!_0x2692ca[_0x34dacc]){delete _0x23a8ce[_0x34dacc];}}}}function clearVoiceCallReports(_0x151a75){_0x151a75['total']=0x0;_0x151a75['answered']=0x0;_0x151a75['sumHoldTime']=0x0;_0x151a75['sumDuration']=0x0;_0x151a75[_0x7a5e('0x29')]=0x0;}function clearCampaigns(_0x3e1024){if(!_[_0x7a5e('0x2a')](_0x3e1024)){for(var _0x11d06a in _0x3e1024){if(_0x3e1024[_0x7a5e('0x24')](_0x11d06a)){_0x3e1024[_0x11d06a][_0x7a5e('0x2b')]=0x0;_0x3e1024[_0x11d06a]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x1e249f){if(!_[_0x7a5e('0x2a')](_0x1e249f)){for(var _0xd651af in _0x1e249f){if(_0x1e249f[_0x7a5e('0x24')](_0xd651af)){_0x1e249f[_0xd651af]['total']=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x2c')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x2d')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x2e')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x2f')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x30')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x29')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x31')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x32')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x33')]=0x0;_0x1e249f[_0xd651af]['outboundCongestionCallsDay']=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x34')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x35')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x36')]=0x0;_0x1e249f[_0xd651af]['outboundDropCallsDayCallersExit']=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x37')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x38')]=0x0;_0x1e249f[_0xd651af]['outboundRejectCallsDay']=0x0;_0x1e249f[_0xd651af]['outboundReCallsDay']=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x31')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x39')]=0x0;_0x1e249f[_0xd651af][_0x7a5e('0x3a')]=!![];}}}}Realtime['prototype'][_0x7a5e('0x3b')]=function(_0x4e6828,_0x206fa0){for(var _0x5cb2d5 in _0x206fa0){if(_0x4e6828['hasOwnProperty'](_0x5cb2d5)){_0x4e6828[_0x5cb2d5]=_0x206fa0[_0x5cb2d5];}}};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x3d')]=function(){var _0x27d57a=this;return function(_0xb2f5aa){if(_0xb2f5aa){freeIsNotKeyAgent(_0xb2f5aa,_0x27d57a[_0x7a5e('0x11')]);for(var _0x2ec2f9=0x0,_0x501413={},_0x3461fc={};_0x2ec2f9<_0xb2f5aa[_0x7a5e('0x3e')];_0x2ec2f9+=0x1){_0x501413=_0xb2f5aa[_0x2ec2f9];var _0x1574dd=_[_0x7a5e('0x3f')](_0x501413[_0x7a5e('0x25')])?util['format'](_0x7a5e('0x27'),_0x501413['name']):_0x501413[_0x7a5e('0x25')];if(_[_0x7a5e('0x40')](_0x27d57a[_0x7a5e('0x11')][_0x1574dd])){_0x27d57a[_0x7a5e('0x11')][_0x1574dd]=new Agent(_0x501413);}else{_0x27d57a['mergeFromDatabase'](_0x27d57a[_0x7a5e('0x11')][_0x1574dd],_0x501413);}}}return _0x27d57a[_0x7a5e('0x11')];};};Realtime['prototype'][_0x7a5e('0x41')]=function(){var _0x5f080f=this;return function(_0x1e2bee){if(_0x1e2bee){freeIsNotKeySip(_0x1e2bee,_0x5f080f[_0x7a5e('0x12')]);for(var _0xfc0985=0x0,_0x5353d9={},_0x2e8cdc={};_0xfc0985<_0x1e2bee[_0x7a5e('0x3e')];_0xfc0985+=0x1){_0x5353d9=_0x1e2bee[_0xfc0985];if(_[_0x7a5e('0x40')](_0x5f080f[_0x7a5e('0x12')][util[_0x7a5e('0x26')](_0x7a5e('0x27'),_0x5353d9['name'])])){_0x5f080f[_0x7a5e('0x12')][util[_0x7a5e('0x26')](_0x7a5e('0x27'),_0x5353d9['name'])]=new Telephone(_0x5353d9);}else{_0x5f080f[_0x7a5e('0x3b')](_0x5f080f['telephones'][util['format'](_0x7a5e('0x27'),_0x5353d9[_0x7a5e('0x28')])],_0x5353d9);}}}return _0x5f080f[_0x7a5e('0x12')];};};Realtime[_0x7a5e('0x3c')]['initTrunks']=function(){var _0x1515b0=this;return function(_0x455db7){if(_0x455db7){freeIsNotKeySip(_0x455db7,_0x1515b0['trunks']);for(var _0xf4f966=0x0,_0x2be99d={},_0x1e6a51={};_0xf4f966<_0x455db7[_0x7a5e('0x3e')];_0xf4f966+=0x1){_0x2be99d=_0x455db7[_0xf4f966];if(_['isUndefined'](_0x1515b0['trunks'][util[_0x7a5e('0x26')]('SIP/%s',_0x2be99d[_0x7a5e('0x28')])])){_0x1515b0[_0x7a5e('0x42')][util[_0x7a5e('0x26')](_0x7a5e('0x27'),_0x2be99d[_0x7a5e('0x28')])]=new Trunk(_0x2be99d);}else{_0x1515b0['mergeFromDatabase'](_0x1515b0[_0x7a5e('0x42')][util[_0x7a5e('0x26')](_0x7a5e('0x27'),_0x2be99d['name'])],_0x2be99d);}}}return _0x1515b0[_0x7a5e('0x42')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x43')]=function(){var _0x5ddfa5=this;return function(_0x435c72){if(_0x435c72){freeIsNotKey(_0x435c72,_0x5ddfa5[_0x7a5e('0x44')],'name');for(var _0x20b45d=0x0,_0x8d053a={},_0xce7bf1={};_0x20b45d<_0x435c72[_0x7a5e('0x3e')];_0x20b45d+=0x1){_0x8d053a=_0x435c72[_0x20b45d];if(_['isUndefined'](_0x5ddfa5[_0x7a5e('0x44')][_0x8d053a['name']])){_0x5ddfa5[_0x7a5e('0x44')][_0x8d053a[_0x7a5e('0x28')]]=new VoiceQueue(_0x8d053a);}else{_0x5ddfa5[_0x7a5e('0x3b')](_0x5ddfa5['voiceQueues'][_0x8d053a[_0x7a5e('0x28')]],_0x8d053a);}}}return _0x5ddfa5[_0x7a5e('0x44')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x45')]=function(){var _0x5d82af=this;return function(_0x438aa5){if(_0x438aa5){freeIsNotKey(_0x438aa5,_0x5d82af[_0x7a5e('0x13')],'id');for(var _0x19bf50=0x0,_0x34be1d={},_0x2dabd3={};_0x19bf50<_0x438aa5[_0x7a5e('0x3e')];_0x19bf50+=0x1){_0x34be1d=_0x438aa5[_0x19bf50];if(_['isUndefined'](_0x5d82af[_0x7a5e('0x13')][_0x34be1d['id']])){_0x5d82af[_0x7a5e('0x13')][_0x34be1d['id']]=new Trigger(_0x34be1d);}else{_0x5d82af[_0x7a5e('0x3b')](_0x5d82af['triggers'][_0x34be1d['id']],_0x34be1d);}}}return _0x5d82af['triggers'];};};Realtime[_0x7a5e('0x3c')]['initTemplates']=function(){var _0x282b4b=this;return function(_0x34e6c7){if(_0x34e6c7){freeIsNotKey(_0x34e6c7,_0x282b4b[_0x7a5e('0x14')],'id');for(var _0x48a309=0x0,_0x55a654={},_0x101066={};_0x48a309<_0x34e6c7[_0x7a5e('0x3e')];_0x48a309+=0x1){_0x55a654=_0x34e6c7[_0x48a309];if(_[_0x7a5e('0x40')](_0x282b4b[_0x7a5e('0x14')][_0x55a654['id']])){_0x282b4b[_0x7a5e('0x14')][_0x55a654['id']]=new Template(_0x55a654);}else{_0x282b4b[_0x7a5e('0x3b')](_0x282b4b['templates'][_0x55a654['id']],_0x55a654);}}}return _0x282b4b[_0x7a5e('0x14')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x46')]=function(){var _0x5c79e0=this;return function(_0x3e0e9e){if(_0x3e0e9e){freeIsNotKey(_0x3e0e9e,_0x5c79e0['zendeskAccounts'],'id');for(var _0x552b4d=0x0,_0x3a63c7={},_0x12dad1={};_0x552b4d<_0x3e0e9e[_0x7a5e('0x3e')];_0x552b4d+=0x1){_0x3a63c7=_0x3e0e9e[_0x552b4d];if(_['isUndefined'](_0x5c79e0[_0x7a5e('0x1a')][_0x3a63c7['id']])){_0x5c79e0[_0x7a5e('0x1a')][_0x3a63c7['id']]=new ZendeskAccount(_0x3a63c7);}else{_0x5c79e0[_0x7a5e('0x3b')](_0x5c79e0[_0x7a5e('0x1a')][_0x3a63c7['id']],_0x3a63c7);}}}return _0x5c79e0[_0x7a5e('0x1a')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x47')]=function(){var _0x223a50=this;return function(_0x45bb48){if(_0x45bb48){freeIsNotKey(_0x45bb48,_0x223a50[_0x7a5e('0x1b')],'id');for(var _0x47b2a4=0x0,_0x4798b8={},_0x48cc56={};_0x47b2a4<_0x45bb48['length'];_0x47b2a4+=0x1){_0x4798b8=_0x45bb48[_0x47b2a4];if(_[_0x7a5e('0x40')](_0x223a50[_0x7a5e('0x1b')][_0x4798b8['id']])){_0x223a50[_0x7a5e('0x1b')][_0x4798b8['id']]=new SalesforceAccount(_0x4798b8);}else{_0x223a50[_0x7a5e('0x3b')](_0x223a50[_0x7a5e('0x1b')][_0x4798b8['id']],_0x4798b8);}}}return _0x223a50[_0x7a5e('0x1b')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x48')]=function(){var _0x391399=this;return function(_0x406986){if(_0x406986){freeIsNotKey(_0x406986,_0x391399[_0x7a5e('0x49')],'id');for(var _0x3d6536=0x0,_0x2c4fdc={},_0x15be1d={};_0x3d6536<_0x406986[_0x7a5e('0x3e')];_0x3d6536+=0x1){_0x2c4fdc=_0x406986[_0x3d6536];if(_[_0x7a5e('0x40')](_0x391399['freshdeskAccounts'][_0x2c4fdc['id']])){_0x391399['freshdeskAccounts'][_0x2c4fdc['id']]=new FreshdeskAccount(_0x2c4fdc);}else{_0x391399[_0x7a5e('0x3b')](_0x391399[_0x7a5e('0x49')][_0x2c4fdc['id']],_0x2c4fdc);}}}return _0x391399[_0x7a5e('0x49')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x4a')]=function(){var _0x24f79f=this;return function(_0x1a965d){if(_0x1a965d){freeIsNotKey(_0x1a965d,_0x24f79f[_0x7a5e('0x1d')],'id');for(var _0x377ad6=0x0,_0x3d8cbd={},_0x3bc0cf={};_0x377ad6<_0x1a965d['length'];_0x377ad6+=0x1){_0x3d8cbd=_0x1a965d[_0x377ad6];if(_[_0x7a5e('0x40')](_0x24f79f[_0x7a5e('0x1d')][_0x3d8cbd['id']])){_0x24f79f[_0x7a5e('0x1d')][_0x3d8cbd['id']]=new ZohoAccount(_0x3d8cbd);}else{_0x24f79f[_0x7a5e('0x3b')](_0x24f79f[_0x7a5e('0x1d')][_0x3d8cbd['id']],_0x3d8cbd);}}}return _0x24f79f[_0x7a5e('0x1d')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x4b')]=function(){var _0x3037aa=this;return function(_0x25efc0){if(_0x25efc0){freeIsNotKey(_0x25efc0,_0x3037aa['deskAccounts'],'id');for(var _0x4e3808=0x0,_0x53d151={},_0x4f5773={};_0x4e3808<_0x25efc0[_0x7a5e('0x3e')];_0x4e3808+=0x1){_0x53d151=_0x25efc0[_0x4e3808];if(_['isUndefined'](_0x3037aa[_0x7a5e('0x1e')][_0x53d151['id']])){_0x3037aa[_0x7a5e('0x1e')][_0x53d151['id']]=new DeskAccount(_0x53d151);}else{_0x3037aa['mergeFromDatabase'](_0x3037aa[_0x7a5e('0x1e')][_0x53d151['id']],_0x53d151);}}}return _0x3037aa['deskAccounts'];};};Realtime['prototype'][_0x7a5e('0x4c')]=function(){var _0x2f62b0=this;return function(_0xcbef7e){if(_0xcbef7e){freeIsNotKey(_0xcbef7e,_0x2f62b0[_0x7a5e('0x1c')],'id');for(var _0x73e03a=0x0,_0x151b85={},_0x4a9f07={};_0x73e03a<_0xcbef7e['length'];_0x73e03a+=0x1){_0x151b85=_0xcbef7e[_0x73e03a];if(_['isUndefined'](_0x2f62b0[_0x7a5e('0x1c')][_0x151b85['id']])){_0x2f62b0[_0x7a5e('0x1c')][_0x151b85['id']]=new SugarcrmAccount(_0x151b85);}else{_0x2f62b0[_0x7a5e('0x3b')](_0x2f62b0[_0x7a5e('0x1c')][_0x151b85['id']],_0x151b85);}}}return _0x2f62b0[_0x7a5e('0x1c')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x4d')]=function(){var _0x31ec55=this;return function(_0xb2c244){if(_0xb2c244){freeIsNotKey(_0xb2c244,_0x31ec55[_0x7a5e('0x1f')],'id');for(var _0x248030=0x0,_0x77b717={},_0x3522d2={};_0x248030<_0xb2c244['length'];_0x248030+=0x1){_0x77b717=_0xb2c244[_0x248030];if(_[_0x7a5e('0x40')](_0x31ec55[_0x7a5e('0x1f')][_0x77b717['id']])){_0x31ec55[_0x7a5e('0x1f')][_0x77b717['id']]=new VtigerAccount(_0x77b717);}else{_0x31ec55['mergeFromDatabase'](_0x31ec55[_0x7a5e('0x1f')][_0x77b717['id']],_0x77b717);}}}return _0x31ec55[_0x7a5e('0x1f')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x4e')]=function(){var _0x2734dd=this;return function(_0x1d2103){if(_0x1d2103){freeIsNotKey(_0x1d2103,_0x2734dd['servicenowAccounts'],'id');for(var _0x270da4=0x0,_0x412e8c={},_0x43cfda={};_0x270da4<_0x1d2103[_0x7a5e('0x3e')];_0x270da4+=0x1){_0x412e8c=_0x1d2103[_0x270da4];if(_[_0x7a5e('0x40')](_0x2734dd[_0x7a5e('0x20')][_0x412e8c['id']])){_0x2734dd[_0x7a5e('0x20')][_0x412e8c['id']]=new ServicenowAccount(_0x412e8c);}else{_0x2734dd[_0x7a5e('0x3b')](_0x2734dd[_0x7a5e('0x20')][_0x412e8c['id']],_0x412e8c);}}}return _0x2734dd['servicenowAccounts'];};};Realtime[_0x7a5e('0x3c')]['initDynamics365Accounts']=function(){var _0x3d83cd=this;return function(_0x5c4445){if(_0x5c4445){freeIsNotKey(_0x5c4445,_0x3d83cd[_0x7a5e('0x4f')],'id');for(var _0x82c80d=0x0,_0x348938={},_0x1b9253={};_0x82c80d<_0x5c4445['length'];_0x82c80d+=0x1){_0x348938=_0x5c4445[_0x82c80d];if(_[_0x7a5e('0x40')](_0x3d83cd[_0x7a5e('0x4f')][_0x348938['id']])){_0x3d83cd[_0x7a5e('0x4f')][_0x348938['id']]=new Dynamics365Account(_0x348938);}else{_0x3d83cd[_0x7a5e('0x3b')](_0x3d83cd[_0x7a5e('0x4f')][_0x348938['id']],_0x348938);}}}return _0x3d83cd[_0x7a5e('0x4f')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x3b069c=this;return function(_0x52e063){if(_0x52e063){freeIsNotKey(_0x52e063,_0x3b069c[_0x7a5e('0x21')],'id');for(var _0x43704c=0x0,_0x22b13d={},_0x24e178={};_0x43704c<_0x52e063[_0x7a5e('0x3e')];_0x43704c+=0x1){_0x22b13d=_0x52e063[_0x43704c];if(_[_0x7a5e('0x40')](_0x3b069c[_0x7a5e('0x21')][_0x22b13d['id']])){_0x3b069c[_0x7a5e('0x21')][_0x22b13d['id']]=new FreshsalesAccount(_0x22b13d);}else{_0x3b069c['mergeFromDatabase'](_0x3b069c['freshsalesAccounts'][_0x22b13d['id']],_0x22b13d);}}}return _0x3b069c[_0x7a5e('0x21')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x50')]=function(){var _0x58d7f2=this;return function(_0x338383){for(var _0x2c2901=0x0;_0x2c2901<_0x338383[_0x7a5e('0x3e')];_0x2c2901+=0x1){_[_0x7a5e('0x51')](_0x58d7f2[_0x7a5e('0x44')][_0x338383[_0x2c2901][_0x7a5e('0x28')]],_0x338383[_0x2c2901]);}return _0x58d7f2['voiceQueues'];};};Realtime[_0x7a5e('0x3c')]['initVoiceQueueReports']=function(){var _0x48a70f=this;return function(_0x4f3c66){clearVoiceQueues(_0x48a70f[_0x7a5e('0x44')]);if(_0x4f3c66){_0x4f3c66=_[_0x7a5e('0x52')](_0x4f3c66,_0x7a5e('0x53'));for(var _0x9363de in _0x4f3c66){if(_0x4f3c66[_0x7a5e('0x24')](_0x9363de)){var _0x5c01f0={};for(var _0xcecb42=0x0;_0xcecb42<_0x4f3c66[_0x9363de][_0x7a5e('0x3e')];_0xcecb42+=0x1){var _0x4754f8=_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x54')];if(_0x48a70f[_0x7a5e('0x44')][_0x4754f8]){if(_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x55')]){_0x48a70f[_0x7a5e('0x44')][_0x4754f8][_0x7a5e('0x2d')]+=0x1;}if(_0x4f3c66[_0x9363de][_0xcecb42]['queuecallerabandon']){_0x48a70f['voiceQueues'][_0x4754f8]['abandoned']+=0x1;}_0x48a70f[_0x7a5e('0x44')][_0x4754f8]['sumHoldTime']+=moment(_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x56')])[_0x7a5e('0x57')](moment(_0x4f3c66[_0x9363de][_0xcecb42]['queuecallerjoinAt']),_0x7a5e('0x58'))||0x0;if(_0xcecb42===_0x4f3c66[_0x9363de][_0x7a5e('0x3e')]-0x1){_0x48a70f[_0x7a5e('0x44')][_0x4754f8][_0x7a5e('0x30')]+=moment(_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x59')]||_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x5a')]||_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x5b')])['diff'](moment(_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x5c')]),_0x7a5e('0x58'))||0x0;_0x48a70f[_0x7a5e('0x44')][_0x4754f8][_0x7a5e('0x5d')]+=0x1;if(_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x5e')]){_0x48a70f[_0x7a5e('0x44')][_0x4754f8][_0x7a5e('0x2c')]+=0x1;_0x48a70f[_0x7a5e('0x44')][_0x4754f8]['sumBillable']+=moment(_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x59')])[_0x7a5e('0x57')](moment(_0x4f3c66[_0x9363de][_0xcecb42][_0x7a5e('0x56')]),_0x7a5e('0x58'))||0x0;}}else{_0x48a70f[_0x7a5e('0x44')][_0x4754f8][_0x7a5e('0x30')]+=_0x48a70f[_0x7a5e('0x44')][_0x4754f8]['sumHoldTime']||0x0;}}}}}}return _0x48a70f[_0x7a5e('0x44')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x5f')]=function(){var _0x4c5da8=this;return function(_0x2632d8){clearVoiceCallReports(_0x4c5da8[_0x7a5e('0x60')]);if(_0x2632d8){for(var _0x45a683=0x0;_0x45a683<_0x2632d8['length'];_0x45a683+=0x1){_0x4c5da8[_0x7a5e('0x60')]['total']+=0x1;_0x4c5da8[_0x7a5e('0x60')]['sumDuration']+=_0x2632d8[_0x45a683][_0x7a5e('0x61')];if(_0x2632d8[_0x45a683][_0x7a5e('0x62')]===_0x7a5e('0x63')){_0x4c5da8[_0x7a5e('0x60')][_0x7a5e('0x2c')]+=0x1;_0x4c5da8[_0x7a5e('0x60')][_0x7a5e('0x2f')]+=_0x2632d8[_0x45a683][_0x7a5e('0x61')]-_0x2632d8[_0x45a683][_0x7a5e('0x64')]||0x0;_0x4c5da8['outbound'][_0x7a5e('0x29')]+=_0x2632d8[_0x45a683][_0x7a5e('0x64')];}}}return _0x4c5da8['outbound'];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x65')]=function(){var _0x24318e=this;return function(_0x52f1af){if(_0x52f1af){freeIsNotKey(_0x52f1af,_0x24318e[_0x7a5e('0x66')],_0x7a5e('0x28'));for(var _0x199aa7=0x0,_0x175b15={};_0x199aa7<_0x52f1af[_0x7a5e('0x3e')];_0x199aa7+=0x1){_0x175b15=_0x52f1af[_0x199aa7];if(_[_0x7a5e('0x40')](_0x24318e['campaigns'][_0x175b15[_0x7a5e('0x28')]])){_0x24318e['campaigns'][_0x175b15[_0x7a5e('0x28')]]=new Campaign(_0x175b15);}else{_0x24318e[_0x7a5e('0x3b')](_0x24318e['campaigns'][_0x175b15[_0x7a5e('0x28')]],_0x175b15);_0x24318e[_0x7a5e('0x66')][_0x175b15[_0x7a5e('0x28')]][_0x7a5e('0x67')]=_0x175b15['SquareProject']?_0x175b15[_0x7a5e('0x68')][_0x7a5e('0x28')]:undefined;}}}return _0x24318e[_0x7a5e('0x66')];};};Realtime[_0x7a5e('0x3c')][_0x7a5e('0x69')]=function(){var _0x596fa5=this;return function(_0x4f3cfe){if(_0x4f3cfe){freeIsNotKey(_0x4f3cfe,_0x596fa5['voiceExtensions'],'id');for(var _0x5d4297=0x0,_0x44ee9c={};_0x5d4297<_0x4f3cfe[_0x7a5e('0x3e')];_0x5d4297+=0x1){_0x44ee9c=_0x4f3cfe[_0x5d4297];if(_[_0x7a5e('0x40')](_0x596fa5[_0x7a5e('0x15')][_0x44ee9c['id']])){_0x596fa5[_0x7a5e('0x15')][_0x44ee9c['id']]=new VoiceExtension(_0x44ee9c);}else{_0x596fa5[_0x7a5e('0x3b')](_0x596fa5[_0x7a5e('0x15')][_0x44ee9c['id']],_0x44ee9c);}}}return _0x596fa5[_0x7a5e('0x15')];};};Realtime['prototype'][_0x7a5e('0x6a')]=function(){var _0x439fbc=this;return function(_0x2c19a4){clearCampaigns(_0x439fbc[_0x7a5e('0x66')]);for(var _0x578bca=0x0;_0x578bca<_0x2c19a4[_0x7a5e('0x3e')];_0x578bca+=0x1){_['merge'](_0x439fbc[_0x7a5e('0x66')][_0x2c19a4[_0x578bca]['name']],_0x2c19a4[_0x578bca]);}return _0x439fbc['campaigns'];};};Realtime['prototype'][_0x7a5e('0x6b')]=function(){var _0x9f63c=this;return function(_0x3756fb){if(_0x3756fb){freeIsNotKey(_0x3756fb,_0x9f63c['faxAccounts'],'id');for(var _0x264e5a=0x0,_0x220b40={},_0xc4533a={};_0x264e5a<_0x3756fb[_0x7a5e('0x3e')];_0x264e5a+=0x1){_0x220b40=_0x3756fb[_0x264e5a];if(_['isUndefined'](_0x9f63c[_0x7a5e('0x22')][_0x220b40['id']])){_0x9f63c[_0x7a5e('0x22')][_0x220b40['id']]=new FaxAccount(_0x220b40);}else{_0x9f63c['mergeFromDatabase'](_0x9f63c[_0x7a5e('0x22')][_0x220b40['id']],_0x220b40);}}}return _0x9f63c[_0x7a5e('0x22')];};};module[_0x7a5e('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index e139628..c92521a 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 _0xe94c=['monitors','createdAt','xcally-motion-preview','connectedlinenum','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','find','interface','format','SIP/%s','length','lastAssignedTo','name','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','uniqueid','blindTransfer','monitor'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0xe94c,0xcc));var _0xce94=function(_0x171e28,_0x2cc797){_0x171e28=_0x171e28-0x0;var _0x7a3417=_0xe94c[_0x171e28];return _0x7a3417;};'use strict';var _=require(_0xce94('0x0'));var moment=require(_0xce94('0x1'));var util=require(_0xce94('0x2'));var config=require(_0xce94('0x3'));var ami=require(_0xce94('0x4'));var RpcVoiceAgentReport=require(_0xce94('0x5'));var RpcVoiceCallReport=require(_0xce94('0x6'));var RpcVoiceDialReport=require(_0xce94('0x7'));var RpcMemberReport=require(_0xce94('0x8'));var RpcVoiceQueueReport=require(_0xce94('0x9'));var RpcVoiceRecording=require(_0xce94('0xa'));var RpcVoiceTransferReport=require(_0xce94('0xb'));var VoiceQueueReport=require(_0xce94('0xc'));var VoiceCallReport=require(_0xce94('0xd'));var VoiceAgentReport=require(_0xce94('0xe'));var VoiceDialReport=require(_0xce94('0xf'));var UserReport=require(_0xce94('0x10'));function Report(_0x240aa2){this[_0xce94('0x11')]=_0x240aa2;this[_0xce94('0x12')]=_0x240aa2[_0xce94('0x12')];this['telephones']=_0x240aa2[_0xce94('0x13')];}Report[_0xce94('0x14')][_0xce94('0x15')]=function(_0x53f578){var _0x12804e=new VoiceQueueReport(this[_0xce94('0x11')]);var _0x3899d2=new VoiceAgentReport(this[_0xce94('0x11')]);var _0x341ca0=new VoiceDialReport(this[_0xce94('0x11')]);var _0x41694a=new VoiceCallReport(this[_0xce94('0x11')]);var _0x86a1bc=new UserReport(this['realtime']);if(config['xdr']&&config['xdr'][_0xce94('0x16')]){ami['on'](_0xce94('0x17'),this[_0xce94('0x18')]['bind'](this));ami['on'](_0xce94('0x19'),this[_0xce94('0x1a')][_0xce94('0x1b')](this));ami['on'](_0xce94('0x1c'),this[_0xce94('0x1d')]['bind'](this));ami['on'](_0xce94('0x1e'),this[_0xce94('0x1f')][_0xce94('0x1b')](this));ami['on'](_0xce94('0x20'),this['blindTransfer'][_0xce94('0x1b')](this));ami['on'](_0xce94('0x21'),this[_0xce94('0x22')][_0xce94('0x1b')](this));}};Report[_0xce94('0x14')][_0xce94('0x23')]=function(_0x55d3d6){var _0x385f2a;_0x385f2a=_['find'](this['agents'],function(_0x1e8aa7){return _0x1e8aa7[_0xce94('0x24')]==_0x55d3d6||_0x1e8aa7['name']==_0x55d3d6;});if(_['isNil'](_0x385f2a)){var _0x779b7e=_['find'](this[_0xce94('0x13')],function(_0x134343){return _0x134343[_0xce94('0x24')]==_0x55d3d6||_0x134343['name']==_0x55d3d6;});if(_0x779b7e){_0x385f2a=_[_0xce94('0x25')](this[_0xce94('0x12')],function(_0x5a4c4c){return _0x5a4c4c[_0xce94('0x26')]==util[_0xce94('0x27')](_0xce94('0x28'),_0x779b7e['name']);});}}return _0x385f2a;};Report[_0xce94('0x14')][_0xce94('0x18')]=function(_0x58ca14){for(var _0x3ca8cf=0x0;_0x3ca8cf<_0x58ca14[_0xce94('0x29')];_0x3ca8cf+=0x1){var _0x4e573d=this[_0xce94('0x23')](_0x58ca14[_0x3ca8cf]['connectedlinenum']);if(_0x4e573d){_0x58ca14[_0x3ca8cf][_0xce94('0x24')]=_0x4e573d[_0xce94('0x24')];_0x58ca14[_0x3ca8cf]['assigned']=!![];_0x58ca14[_0x3ca8cf][_0xce94('0x2a')]=_0x4e573d[_0xce94('0x2b')];_0x58ca14[_0x3ca8cf][_0xce94('0x26')]=_[_0xce94('0x2c')](_0x4e573d['interface'])?util['format']('SIP/%s',_0x4e573d[_0xce94('0x2b')]):_0x4e573d['interface'];if(_0x58ca14[_0x3ca8cf][_0xce94('0x2d')]){_0x58ca14[_0x3ca8cf][_0xce94('0x2e')]=moment()[_0xce94('0x27')](_0xce94('0x2f'));}if(_0x58ca14[_0x3ca8cf][_0xce94('0x30')]){_0x58ca14[_0x3ca8cf][_0xce94('0x31')]=moment()[_0xce94('0x27')](_0xce94('0x2f'));}RpcMemberReport['voiceQueueReport'](_0x58ca14[_0x3ca8cf]);}RpcVoiceQueueReport[_0xce94('0x32')](_0x58ca14[_0x3ca8cf]);}};function extractCalleridNumber(_0x5194eb){var _0x2d39fc=_0x5194eb[_0xce94('0x33')](/<(.*?)>/);return _0x2d39fc?_0x2d39fc[0x1]:_0x5194eb;}Report[_0xce94('0x14')][_0xce94('0x1a')]=function(_0x28f111){_0x28f111[_0xce94('0x34')]=_0x28f111[_0xce94('0x34')]||_0x28f111[_0xce94('0x35')];if(_0x28f111[_0xce94('0x36')]==_0xce94('0x37')){_0x28f111['lastapplication']=_0xce94('0x38');_0x28f111[_0xce94('0x39')]=_0x28f111[_0xce94('0x38')];if(_0x28f111[_0xce94('0x3a')]==_0xce94('0x3b')){_0x28f111[_0xce94('0x24')]='';_0x28f111[_0xce94('0x34')]=extractCalleridNumber(_0x28f111[_0xce94('0x3c')]);}else if(_0x28f111['context']=='from-sip'){if(_0x28f111['destination']=='xcally-motion-preview'){_0x28f111[_0xce94('0x34')]=extractCalleridNumber(_0x28f111[_0xce94('0x3d')]);_0x28f111[_0xce94('0x3e')]=_0x28f111[_0xce94('0x3f')];_0x28f111[_0xce94('0x40')]=[_0x28f111[_0xce94('0x41')],_0x28f111[_0xce94('0x41')]=_0x28f111[_0xce94('0x40')]][0x0];_0x28f111[_0xce94('0x3c')]=_0x28f111[_0xce94('0x3d')];}else{_0x28f111[_0xce94('0x34')]=_0x28f111['calleridnum'];_0x28f111[_0xce94('0x3e')]=_0x28f111['originatecalleridnum'];if(_0x28f111[_0xce94('0x42')]==_0xce94('0x43')){_0x28f111['accountcode']=_0x28f111['connectedlinenum'];}else{_0x28f111[_0xce94('0x24')]='';}}}}else{_0x28f111[_0xce94('0x3c')]=util['format'](_0xce94('0x44'),_0x28f111[_0xce94('0x45')],_0x28f111[_0xce94('0x3e')]);}if(RpcVoiceTransferReport['transfers'][_0x28f111[_0xce94('0x46')]]){var _0x24ff1e=RpcVoiceTransferReport[_0xce94('0x47')][_0x28f111['linkedid']];_0x24ff1e['transfereelinkedid']=_0x28f111[_0xce94('0x48')];RpcVoiceTransferReport[_0xce94('0x49')](_0x24ff1e);delete RpcVoiceTransferReport[_0xce94('0x47')][_0x28f111[_0xce94('0x46')]];}RpcVoiceCallReport[_0xce94('0x32')](_0x28f111);if(_0x28f111[_0xce94('0x4a')]){for(var _0x216e70=0x0;_0x216e70<_0x28f111['monitors'][_0xce94('0x29')];_0x216e70+=0x1){_0x28f111['monitorFilename']=_0x28f111[_0xce94('0x4b')][_0x216e70]['filename'];_0x28f111[_0xce94('0x4c')]=_0x28f111['monitors'][_0x216e70][_0xce94('0x4c')];if(_0x28f111['exten']==_0xce94('0x4d')){_0x28f111[_0xce94('0x3e')]=_0x28f111[_0xce94('0x4e')];_0x28f111[_0xce94('0x45')]=_0x28f111['connectedlinename'];_0x28f111[_0xce94('0x4e')]=_0x28f111[_0xce94('0x24')];_0x28f111[_0xce94('0x4f')]=_0x28f111['membername'];_0x28f111[_0xce94('0x35')]=_0x28f111['originatecalleridnum'];}else if(_0x28f111[_0xce94('0x35')]==_0xce94('0x50')){_0x28f111[_0xce94('0x3e')]=_0x28f111[_0xce94('0x34')];_0x28f111[_0xce94('0x35')]=_0x28f111[_0xce94('0x3f')];}RpcVoiceRecording[_0xce94('0x32')](_0x28f111);}}};Report[_0xce94('0x14')]['voiceAgentReport']=function(_0x5e963f){if(_[_0xce94('0x51')](_0x5e963f)){_0x5e963f[_0xce94('0x52')](function(_0x2c143b){RpcVoiceAgentReport[_0xce94('0x32')](_0x2c143b);});}else{RpcVoiceAgentReport['create'](_0x5e963f);}};Report[_0xce94('0x14')][_0xce94('0x1f')]=function(_0x41783a){RpcVoiceDialReport[_0xce94('0x32')](_0x41783a);var _0xf89a54;var _0x74cb16;var _0x730398=_0x41783a[_0xce94('0x41')];if(_[_0xce94('0x53')](_0x730398,_0xce94('0x54'))){_0x74cb16=_0x730398[_0xce94('0x55')](_0x730398[_0xce94('0x56')]('/')+0x1,_0x730398[_0xce94('0x56')]('@'));_0xf89a54=_[_0xce94('0x25')](this[_0xce94('0x12')],function(_0x6c7fdc){return _0x6c7fdc[_0xce94('0x57')]==_0x74cb16||_0x6c7fdc[_0xce94('0x58')]==_0x74cb16||_0x6c7fdc[_0xce94('0x24')]==_0x74cb16;});}else{_0x74cb16=_0x730398[_0xce94('0x55')](_0x730398[_0xce94('0x56')]('/')+0x1,_0x730398[_0xce94('0x59')]('-'));_0xf89a54=this[_0xce94('0x23')](_0x74cb16);}if(_0xf89a54){_0x41783a['interface']=_[_0xce94('0x2c')](_0xf89a54[_0xce94('0x26')])?util[_0xce94('0x27')](_0xce94('0x28'),_0xf89a54[_0xce94('0x2b')]):_0xf89a54['interface'];_0x41783a[_0xce94('0x5a')]=_0xf89a54[_0xce94('0x2b')];_0x41783a[_0xce94('0x24')]=_0xf89a54['accountcode'];RpcMemberReport[_0xce94('0x1f')](_0x41783a);}};Report[_0xce94('0x14')][_0xce94('0x49')]=function(_0x5b96b8){RpcVoiceTransferReport[_0xce94('0x47')][_0x5b96b8[_0xce94('0x5b')]]=_0x5b96b8;};Report[_0xce94('0x14')]['attendedTransfer']=function(_0x13565a){RpcVoiceTransferReport[_0xce94('0x22')](_0x13565a);};module[_0xce94('0x5c')]=Report; \ No newline at end of file +var _0x0cf5=['destinationchannel','callerid','disposition','transfers','linkedid','transfereelinkedid','monitor','monitors','monitorFilename','createdAt','calleridname','connectedlinename','membername','isArray','forEach','voiceDialReport','startsWith','substring','indexOf','mobile','lastIndexOf','exports','lodash','util','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','name','interface','SIP/%s','length','findAgent','connectedlinenum','assigned','isNil','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel'];(function(_0x1eac9a,_0x372388){var _0x58f732=function(_0x515f0b){while(--_0x515f0b){_0x1eac9a['push'](_0x1eac9a['shift']());}};_0x58f732(++_0x372388);}(_0x0cf5,0x109));var _0x50cf=function(_0x5783c1,_0x573975){_0x5783c1=_0x5783c1-0x0;var _0x4cab08=_0x0cf5[_0x5783c1];return _0x4cab08;};'use strict';var _=require(_0x50cf('0x0'));var moment=require('moment');var util=require(_0x50cf('0x1'));var config=require('../../../config/environment');var ami=require(_0x50cf('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x50cf('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x50cf('0x4'));var RpcVoiceQueueReport=require(_0x50cf('0x5'));var RpcVoiceRecording=require(_0x50cf('0x6'));var RpcVoiceTransferReport=require(_0x50cf('0x7'));var VoiceQueueReport=require(_0x50cf('0x8'));var VoiceCallReport=require(_0x50cf('0x9'));var VoiceAgentReport=require(_0x50cf('0xa'));var VoiceDialReport=require(_0x50cf('0xb'));var UserReport=require(_0x50cf('0xc'));function Report(_0x54c144){this[_0x50cf('0xd')]=_0x54c144;this[_0x50cf('0xe')]=_0x54c144['agents'];this[_0x50cf('0xf')]=_0x54c144[_0x50cf('0xf')];}Report[_0x50cf('0x10')]['sync']=function(_0x519047){var _0x922a77=new VoiceQueueReport(this[_0x50cf('0xd')]);var _0x2f367e=new VoiceAgentReport(this['realtime']);var _0x35a5d8=new VoiceDialReport(this[_0x50cf('0xd')]);var _0x2a16d6=new VoiceCallReport(this[_0x50cf('0xd')]);var _0x13cbdb=new UserReport(this[_0x50cf('0xd')]);if(config[_0x50cf('0x11')]&&config[_0x50cf('0x11')][_0x50cf('0x12')]){ami['on']('custom:voiceQueueReport',this[_0x50cf('0x13')]['bind'](this));ami['on'](_0x50cf('0x14'),this['voiceCallReport'][_0x50cf('0x15')](this));ami['on'](_0x50cf('0x16'),this[_0x50cf('0x17')][_0x50cf('0x15')](this));ami['on'](_0x50cf('0x18'),this['voiceDialReport']['bind'](this));ami['on'](_0x50cf('0x19'),this[_0x50cf('0x1a')]['bind'](this));ami['on'](_0x50cf('0x1b'),this[_0x50cf('0x1c')][_0x50cf('0x15')](this));}};Report['prototype']['findAgent']=function(_0x1133ed){var _0x3120ef;_0x3120ef=_[_0x50cf('0x1d')](this['agents'],function(_0x18f333){return _0x18f333[_0x50cf('0x1e')]==_0x1133ed||_0x18f333[_0x50cf('0x1f')]==_0x1133ed;});if(_['isNil'](_0x3120ef)){var _0x957660=_[_0x50cf('0x1d')](this['telephones'],function(_0x5df8d0){return _0x5df8d0['accountcode']==_0x1133ed||_0x5df8d0[_0x50cf('0x1f')]==_0x1133ed;});if(_0x957660){_0x3120ef=_[_0x50cf('0x1d')](this[_0x50cf('0xe')],function(_0xb0ee36){return _0xb0ee36[_0x50cf('0x20')]==util['format'](_0x50cf('0x21'),_0x957660[_0x50cf('0x1f')]);});}}return _0x3120ef;};Report[_0x50cf('0x10')]['voiceQueueReport']=function(_0x2725b6){for(var _0x3f9294=0x0;_0x3f9294<_0x2725b6[_0x50cf('0x22')];_0x3f9294+=0x1){var _0x57eedf=this[_0x50cf('0x23')](_0x2725b6[_0x3f9294][_0x50cf('0x24')]);if(_0x57eedf){_0x2725b6[_0x3f9294][_0x50cf('0x1e')]=_0x57eedf['accountcode'];_0x2725b6[_0x3f9294][_0x50cf('0x25')]=!![];_0x2725b6[_0x3f9294]['lastAssignedTo']=_0x57eedf['name'];_0x2725b6[_0x3f9294]['interface']=_[_0x50cf('0x26')](_0x57eedf[_0x50cf('0x20')])?util['format'](_0x50cf('0x21'),_0x57eedf['name']):_0x57eedf[_0x50cf('0x20')];if(_0x2725b6[_0x3f9294][_0x50cf('0x27')]){_0x2725b6[_0x3f9294][_0x50cf('0x28')]=moment()[_0x50cf('0x29')](_0x50cf('0x2a'));}if(_0x2725b6[_0x3f9294]['queuecallerexit']){_0x2725b6[_0x3f9294][_0x50cf('0x2b')]=moment()['format'](_0x50cf('0x2a'));}RpcMemberReport['voiceQueueReport'](_0x2725b6[_0x3f9294]);}RpcVoiceQueueReport[_0x50cf('0x2c')](_0x2725b6[_0x3f9294]);}};function extractCalleridNumber(_0x4e3c3a){var _0x1a34c9=_0x4e3c3a[_0x50cf('0x2d')](/<(.*?)>/);return _0x1a34c9?_0x1a34c9[0x1]:_0x4e3c3a;}Report[_0x50cf('0x10')]['voiceCallReport']=function(_0x48f16a){_0x48f16a[_0x50cf('0x2e')]=_0x48f16a[_0x50cf('0x2e')]||_0x48f16a[_0x50cf('0x2f')];if(_0x48f16a[_0x50cf('0x30')]==_0x50cf('0x31')){_0x48f16a[_0x50cf('0x32')]=_0x50cf('0x33');_0x48f16a['lastdata']=_0x48f16a['queue'];if(_0x48f16a[_0x50cf('0x34')]==_0x50cf('0x35')){_0x48f16a[_0x50cf('0x1e')]='';_0x48f16a[_0x50cf('0x2e')]=extractCalleridNumber(_0x48f16a['callerid']);}else if(_0x48f16a['context']=='from-sip'){if(_0x48f16a['destination']==_0x50cf('0x36')){_0x48f16a[_0x50cf('0x2e')]=extractCalleridNumber(_0x48f16a[_0x50cf('0x37')]);_0x48f16a[_0x50cf('0x38')]=_0x48f16a[_0x50cf('0x39')];_0x48f16a['destinationchannel']=[_0x48f16a[_0x50cf('0x3a')],_0x48f16a[_0x50cf('0x3a')]=_0x48f16a[_0x50cf('0x3b')]][0x0];_0x48f16a[_0x50cf('0x3c')]=_0x48f16a['calleridpreview'];}else{_0x48f16a[_0x50cf('0x2e')]=_0x48f16a['calleridnum'];_0x48f16a[_0x50cf('0x38')]=_0x48f16a[_0x50cf('0x39')];if(_0x48f16a[_0x50cf('0x3d')]=='ANSWERED'){_0x48f16a[_0x50cf('0x1e')]=_0x48f16a[_0x50cf('0x24')];}else{_0x48f16a[_0x50cf('0x1e')]='';}}}}else{_0x48f16a[_0x50cf('0x3c')]=util[_0x50cf('0x29')]('\x22%s\x22\x20<%s>',_0x48f16a['calleridname'],_0x48f16a[_0x50cf('0x38')]);}if(RpcVoiceTransferReport[_0x50cf('0x3e')][_0x48f16a['linkedid']]){var _0x290b74=RpcVoiceTransferReport[_0x50cf('0x3e')][_0x48f16a[_0x50cf('0x3f')]];_0x290b74[_0x50cf('0x40')]=_0x48f16a['uniqueid'];RpcVoiceTransferReport['blindTransfer'](_0x290b74);delete RpcVoiceTransferReport[_0x50cf('0x3e')][_0x48f16a[_0x50cf('0x3f')]];}RpcVoiceCallReport[_0x50cf('0x2c')](_0x48f16a);if(_0x48f16a[_0x50cf('0x41')]){for(var _0x1320a6=0x0;_0x1320a6<_0x48f16a[_0x50cf('0x42')][_0x50cf('0x22')];_0x1320a6+=0x1){_0x48f16a[_0x50cf('0x43')]=_0x48f16a[_0x50cf('0x42')][_0x1320a6]['filename'];_0x48f16a[_0x50cf('0x44')]=_0x48f16a['monitors'][_0x1320a6][_0x50cf('0x44')];if(_0x48f16a[_0x50cf('0x2f')]==_0x50cf('0x36')){_0x48f16a[_0x50cf('0x38')]=_0x48f16a[_0x50cf('0x24')];_0x48f16a[_0x50cf('0x45')]=_0x48f16a[_0x50cf('0x46')];_0x48f16a[_0x50cf('0x24')]=_0x48f16a[_0x50cf('0x1e')];_0x48f16a[_0x50cf('0x46')]=_0x48f16a[_0x50cf('0x47')];_0x48f16a[_0x50cf('0x2f')]=_0x48f16a[_0x50cf('0x39')];}else if(_0x48f16a[_0x50cf('0x2f')]=='xcally-motion-dialer'){_0x48f16a[_0x50cf('0x38')]=_0x48f16a[_0x50cf('0x2e')];_0x48f16a[_0x50cf('0x2f')]=_0x48f16a[_0x50cf('0x39')];}RpcVoiceRecording[_0x50cf('0x2c')](_0x48f16a);}}};Report[_0x50cf('0x10')][_0x50cf('0x17')]=function(_0x416995){if(_[_0x50cf('0x48')](_0x416995)){_0x416995[_0x50cf('0x49')](function(_0x536c4a){RpcVoiceAgentReport[_0x50cf('0x2c')](_0x536c4a);});}else{RpcVoiceAgentReport[_0x50cf('0x2c')](_0x416995);}};Report[_0x50cf('0x10')][_0x50cf('0x4a')]=function(_0x54c58d){RpcVoiceDialReport[_0x50cf('0x2c')](_0x54c58d);var _0x57f1dc;var _0x4e2c78;var _0x1d925d=_0x54c58d[_0x50cf('0x3a')];if(_[_0x50cf('0x4b')](_0x1d925d,'Local')){_0x4e2c78=_0x1d925d[_0x50cf('0x4c')](_0x1d925d[_0x50cf('0x4d')]('/')+0x1,_0x1d925d[_0x50cf('0x4d')]('@'));_0x57f1dc=_[_0x50cf('0x1d')](this['agents'],function(_0x509384){return _0x509384[_0x50cf('0x4e')]==_0x4e2c78||_0x509384['phone']==_0x4e2c78||_0x509384[_0x50cf('0x1e')]==_0x4e2c78;});}else{_0x4e2c78=_0x1d925d[_0x50cf('0x4c')](_0x1d925d[_0x50cf('0x4d')]('/')+0x1,_0x1d925d[_0x50cf('0x4f')]('-'));_0x57f1dc=this[_0x50cf('0x23')](_0x4e2c78);}if(_0x57f1dc){_0x54c58d['interface']=_[_0x50cf('0x26')](_0x57f1dc[_0x50cf('0x20')])?util[_0x50cf('0x29')]('SIP/%s',_0x57f1dc[_0x50cf('0x1f')]):_0x57f1dc[_0x50cf('0x20')];_0x54c58d[_0x50cf('0x47')]=_0x57f1dc[_0x50cf('0x1f')];_0x54c58d['accountcode']=_0x57f1dc[_0x50cf('0x1e')];RpcMemberReport[_0x50cf('0x4a')](_0x54c58d);}};Report[_0x50cf('0x10')][_0x50cf('0x1a')]=function(_0x27cf27){RpcVoiceTransferReport['transfers'][_0x27cf27['transfererlinkedid']]=_0x27cf27;};Report['prototype']['attendedTransfer']=function(_0x29a69f){RpcVoiceTransferReport['attendedTransfer'](_0x29a69f);};module[_0x50cf('0x50')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 7acd595..cd88a06 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 _0x2560=['[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','catch','error','[userReport][sipshowregistry]','inspect','[userReport][devicestatelist]','prototype','isNotNull','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','find','username','stateRegistry','omit','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','[userReport][registry]','device','[userReport][devicestatechange]','local','toLowerCase','toNumber','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','startsWith','Local','substring','indexOf','mobile','phone','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address'];(function(_0x1ce1e9,_0x4b7c04){var _0x572136=function(_0x175fe1){while(--_0x175fe1){_0x1ce1e9['push'](_0x1ce1e9['shift']());}};_0x572136(++_0x4b7c04);}(_0x2560,0x9a));var _0x0256=function(_0x31fb93,_0x359977){_0x31fb93=_0x31fb93-0x0;var _0x380ef0=_0x2560[_0x31fb93];return _0x380ef0;};'use strict';var _=require(_0x0256('0x0'));var moment=require(_0x0256('0x1'));var util=require(_0x0256('0x2'));var Redis=require(_0x0256('0x3'));var BPromise=require(_0x0256('0x4'));var config=require(_0x0256('0x5'));var logger=require(_0x0256('0x6'))(_0x0256('0x7'));var ami=require(_0x0256('0x8'));config[_0x0256('0x9')]=_['defaults'](config[_0x0256('0x9')],{'host':_0x0256('0xa'),'port':0x18eb});var io=require(_0x0256('0xb'))(new Redis(config[_0x0256('0x9')]));function UserReport(_0x52b118){this[_0x0256('0xc')]=_0x52b118['trunks'];this[_0x0256('0xd')]=_0x52b118[_0x0256('0xd')];this[_0x0256('0xe')]=_0x52b118[_0x0256('0xe')];ami['on'](_0x0256('0xf'),this['syncRegistry'][_0x0256('0x10')](this));ami['on'](_0x0256('0x11'),this[_0x0256('0x12')][_0x0256('0x10')](this));ami['on'](_0x0256('0x13'),this[_0x0256('0x14')][_0x0256('0x10')](this));ami['on'](_0x0256('0x15'),this['syncPeerStatus']['bind'](this));return this[_0x0256('0x16')]();}function showSipRegistrations(){Promise[_0x0256('0x17')]()[_0x0256('0x18')](ami['actionSipShowRegistry']())[_0x0256('0x19')](function(_0x2a9c88){logger[_0x0256('0x1a')](_0x0256('0x1b'),util[_0x0256('0x1c')](_0x2a9c88,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x0256('0x18')](ami['actionDeviceStateList']())[_0x0256('0x19')](function(_0x5a6da6){logger[_0x0256('0x1a')](_0x0256('0x1d'),util[_0x0256('0x1c')](_0x5a6da6,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x0256('0x17')]()[_0x0256('0x18')](ami['actionSipPeerStatus']())[_0x0256('0x19')](function(_0x4fc7d1){logger[_0x0256('0x1a')]('[userReport][sippeerstatus]',util[_0x0256('0x1c')](_0x4fc7d1,{'showHidden':![],'depth':null}));});}UserReport[_0x0256('0x1e')][_0x0256('0x16')]=function(){setInterval(function(){BPromise['resolve']()[_0x0256('0x18')](showSipRegistrations())[_0x0256('0x18')](listDeviceStates())[_0x0256('0x18')](showPeersStatus());},0x32c8);};UserReport[_0x0256('0x1e')][_0x0256('0x1f')]=function(_0x211386){return _0x211386!==null&&!_['isUndefined'](_0x211386);};UserReport[_0x0256('0x1e')][_0x0256('0x20')]=function(_0x2a54d9,_0x2f048a,_0x5e77de){io['to'](_0x2a54d9)[_0x0256('0x20')](_0x2f048a,_0x5e77de);};UserReport[_0x0256('0x1e')]['syncRegistry']=function(_0x42e3a8){try{if(this[_0x0256('0x1f')](_0x42e3a8)){logger[_0x0256('0x21')](_0x0256('0x22'),_0x42e3a8['username'],_0x42e3a8[_0x0256('0x23')]);logger['debug']('[userReport][registry]',util[_0x0256('0x1c')](_0x42e3a8,{'showHidden':![],'depth':null}));var _0x3d7873=_[_0x0256('0x24')](this[_0x0256('0xc')],{'defaultuser':_0x42e3a8[_0x0256('0x25')]});if(_0x3d7873){_0x42e3a8[_0x0256('0x26')]=_0x42e3a8[_0x0256('0x23')];_['merge'](_0x3d7873,_[_0x0256('0x27')](_0x42e3a8,['event','actionid',_0x0256('0x25'),_0x0256('0x23')]));logger[_0x0256('0x28')](_0x0256('0x29'),util['inspect'](_0x3d7873,{'showHidden':![],'depth':null}));this[_0x0256('0x20')](util[_0x0256('0x2a')](_0x0256('0x2b'),_0x3d7873[_0x0256('0x2c')]),'trunk:save',_0x3d7873);}}}catch(_0x3ec115){logger['error'](_0x0256('0x2d'),util[_0x0256('0x1c')](_0x3ec115,{'showHidden':![],'depth':null}));}};UserReport[_0x0256('0x1e')][_0x0256('0x14')]=function(_0x4d29ef){try{if(this['isNotNull'](_0x4d29ef)){logger[_0x0256('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x4d29ef[_0x0256('0x2e')],_0x4d29ef[_0x0256('0x23')]);logger[_0x0256('0x28')](_0x0256('0x2f'),util[_0x0256('0x1c')](_0x4d29ef,{'showHidden':![],'depth':null}));if(this[_0x0256('0xd')][_0x4d29ef[_0x0256('0x2e')]]){if(!this[_0x0256('0xd')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x30')]||_0x4d29ef[_0x0256('0x23')]['toLowerCase']()=='inuse'){this[_0x0256('0xd')][_0x4d29ef['device']][_0x0256('0x30')]=![];if(this[_0x0256('0xd')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x23')]!==_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]()){this[_0x0256('0xd')][_0x4d29ef['device']]['stateTime']=_[_0x0256('0x32')](moment()['format']('x'));}this[_0x0256('0xd')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x23')]=_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]();this['agents'][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x33')](_0x4d29ef);}}else if(this[_0x0256('0xe')][_0x4d29ef[_0x0256('0x2e')]]){if(this[_0x0256('0xe')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x23')]!==_0x4d29ef[_0x0256('0x23')]['toLowerCase']()){this['telephones'][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x34')]=_['toNumber'](moment()[_0x0256('0x2a')]('x'));}this['telephones'][_0x4d29ef[_0x0256('0x2e')]]['state']=_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]();logger['debug'](_0x0256('0x35'),util['inspect'](this[_0x0256('0xe')][_0x4d29ef[_0x0256('0x2e')]],{'showHidden':![],'depth':null}));this[_0x0256('0x20')](util[_0x0256('0x2a')](_0x0256('0x36'),this['telephones'][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x2c')]),_0x0256('0x37'),this['telephones'][_0x4d29ef['device']]);}else if(this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]]){if(this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]]['state']!==_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]()){this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]][_0x0256('0x34')]=_[_0x0256('0x32')](moment()['format']('x'));}this[_0x0256('0xc')][_0x4d29ef['device']][_0x0256('0x23')]=_0x4d29ef[_0x0256('0x23')]['toLowerCase']();logger['debug'](_0x0256('0x38'),util[_0x0256('0x1c')](this[_0x0256('0xc')][_0x4d29ef['device']],{'showHidden':![],'depth':null}));this[_0x0256('0x20')](util[_0x0256('0x2a')](_0x0256('0x2b'),this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]]['name']),_0x0256('0x39'),this[_0x0256('0xc')][_0x4d29ef[_0x0256('0x2e')]]);}else if(_[_0x0256('0x3a')](_0x4d29ef[_0x0256('0x2e')],_0x0256('0x3b'))){var _0x38da44=_0x4d29ef[_0x0256('0x2e')];var _0x3afe47=_0x38da44[_0x0256('0x3c')](_0x38da44['indexOf']('/')+0x1,_0x38da44[_0x0256('0x3d')]('@'));var _0x1aa5fe=_[_0x0256('0x24')](this['agents'],function(_0x403aa2){return _0x403aa2[_0x0256('0x3e')]==_0x3afe47||_0x403aa2[_0x0256('0x3f')]==_0x3afe47||_0x403aa2[_0x0256('0x40')]==_0x3afe47;});if(_0x1aa5fe){if(_0x1aa5fe[_0x0256('0x23')]!==_0x4d29ef[_0x0256('0x23')][_0x0256('0x31')]()){_0x1aa5fe[_0x0256('0x34')]=_[_0x0256('0x32')](moment()[_0x0256('0x2a')]('x'));}_0x1aa5fe[_0x0256('0x23')]=_0x4d29ef[_0x0256('0x23')]['toLowerCase']();_0x1aa5fe['local']=!![];_0x1aa5fe[_0x0256('0x33')](_0x4d29ef);}}}}catch(_0x4632fe){logger[_0x0256('0x1a')](_0x0256('0x2f'),util[_0x0256('0x1c')](_0x4632fe,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x0256('0x41')]=function(_0x4bcf5f){try{if(this[_0x0256('0x1f')](_0x4bcf5f)&&this['isNotNull'](_0x4bcf5f[_0x0256('0x15')])){logger['info'](_0x0256('0x42'),_0x4bcf5f[_0x0256('0x43')],_0x4bcf5f['address'],_0x4bcf5f[_0x0256('0x15')]);logger[_0x0256('0x28')]('[userReport][peerstatus]',util[_0x0256('0x1c')](_0x4bcf5f,{'showHidden':![],'depth':null}));if(this['agents'][_0x4bcf5f[_0x0256('0x43')]]){if(!this[_0x0256('0xd')][_0x4bcf5f[_0x0256('0x43')]][_0x0256('0x30')]||_0x4bcf5f[_0x0256('0x15')][_0x0256('0x31')]()==_0x0256('0x44')){this[_0x0256('0xd')][_0x4bcf5f['peer']][_0x0256('0x30')]=![];this[_0x0256('0xd')][_0x4bcf5f['peer']][_0x0256('0x45')]=_0x4bcf5f['peerstatus'][_0x0256('0x31')]();this[_0x0256('0xd')][_0x4bcf5f['peer']][_0x0256('0x46')]=_0x4bcf5f['address'];this['agents'][_0x4bcf5f[_0x0256('0x43')]][_0x0256('0x33')](_0x4bcf5f);}}else if(this[_0x0256('0xe')][_0x4bcf5f[_0x0256('0x43')]]){this[_0x0256('0xe')][_0x4bcf5f['peer']]['status']=_0x4bcf5f[_0x0256('0x15')][_0x0256('0x31')]();this[_0x0256('0xe')][_0x4bcf5f[_0x0256('0x43')]]['address']=_0x4bcf5f[_0x0256('0x46')];logger[_0x0256('0x28')](_0x0256('0x47'),util[_0x0256('0x1c')](this[_0x0256('0xe')][_0x4bcf5f[_0x0256('0x43')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0256('0x2a')](_0x0256('0x36'),this[_0x0256('0xe')][_0x4bcf5f['peer']][_0x0256('0x2c')]),'telephone:save',this['telephones'][_0x4bcf5f[_0x0256('0x43')]]);}else if(this[_0x0256('0xc')][_0x4bcf5f[_0x0256('0x43')]]){this[_0x0256('0xc')][_0x4bcf5f['peer']][_0x0256('0x45')]=_0x4bcf5f[_0x0256('0x15')][_0x0256('0x31')]();this['trunks'][_0x4bcf5f[_0x0256('0x43')]]['address']=_0x4bcf5f['address'];logger[_0x0256('0x28')](_0x0256('0x48'),util[_0x0256('0x1c')](this[_0x0256('0xc')][_0x4bcf5f[_0x0256('0x43')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0256('0x2a')](_0x0256('0x2b'),this[_0x0256('0xc')][_0x4bcf5f[_0x0256('0x43')]][_0x0256('0x2c')]),_0x0256('0x39'),this['trunks'][_0x4bcf5f['peer']]);}}}catch(_0x2c3fa3){logger[_0x0256('0x1a')](_0x0256('0x49'),util[_0x0256('0x1c')](_0x2c3fa3,{'showHidden':![],'depth':null}));}};module[_0x0256('0x4a')]=UserReport; \ No newline at end of file +var _0x33a8=['format','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','agents','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','mobile','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','trunks','telephones','registryentry','syncRegistry','bind','devicestatechange','syncPeerStatus','syncRealtimeShow','actionSipShowRegistry','error','[userReport][sipshowregistry]','inspect','resolve','then','actionDeviceStateList','catch','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','debug','[userReport][registry]','find','state','merge','omit','event','actionid','username','[userReport][registry]\x20sending\x20trunk:save\x20event:'];(function(_0x2579a3,_0x3ad6f9){var _0x44b2c8=function(_0x3fe83b){while(--_0x3fe83b){_0x2579a3['push'](_0x2579a3['shift']());}};_0x44b2c8(++_0x3ad6f9);}(_0x33a8,0xea));var _0x833a=function(_0x14b2fe,_0x176bc8){_0x14b2fe=_0x14b2fe-0x0;var _0x1bb7d3=_0x33a8[_0x14b2fe];return _0x1bb7d3;};'use strict';var _=require(_0x833a('0x0'));var moment=require(_0x833a('0x1'));var util=require('util');var Redis=require(_0x833a('0x2'));var BPromise=require(_0x833a('0x3'));var config=require(_0x833a('0x4'));var logger=require(_0x833a('0x5'))(_0x833a('0x6'));var ami=require('../ami');config[_0x833a('0x7')]=_[_0x833a('0x8')](config[_0x833a('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x833a('0x7')]));function UserReport(_0x563778){this[_0x833a('0x9')]=_0x563778[_0x833a('0x9')];this['agents']=_0x563778['agents'];this[_0x833a('0xa')]=_0x563778['telephones'];ami['on'](_0x833a('0xb'),this[_0x833a('0xc')][_0x833a('0xd')](this));ami['on']('registry',this[_0x833a('0xc')][_0x833a('0xd')](this));ami['on'](_0x833a('0xe'),this['syncDeviceState'][_0x833a('0xd')](this));ami['on']('peerstatus',this[_0x833a('0xf')][_0x833a('0xd')](this));return this[_0x833a('0x10')]();}function showSipRegistrations(){Promise['resolve']()['then'](ami[_0x833a('0x11')]())['catch'](function(_0x5e0c90){logger[_0x833a('0x12')](_0x833a('0x13'),util[_0x833a('0x14')](_0x5e0c90,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x833a('0x15')]()[_0x833a('0x16')](ami[_0x833a('0x17')]())[_0x833a('0x18')](function(_0x2f80f6){logger[_0x833a('0x12')](_0x833a('0x19'),util['inspect'](_0x2f80f6,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x833a('0x15')]()['then'](ami['actionSipPeerStatus']())[_0x833a('0x18')](function(_0x2d36a1){logger[_0x833a('0x12')](_0x833a('0x1a'),util[_0x833a('0x14')](_0x2d36a1,{'showHidden':![],'depth':null}));});}UserReport[_0x833a('0x1b')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x833a('0x15')]()[_0x833a('0x16')](showSipRegistrations())[_0x833a('0x16')](listDeviceStates())[_0x833a('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x833a('0x1b')][_0x833a('0x1c')]=function(_0x43661a){return _0x43661a!==null&&!_[_0x833a('0x1d')](_0x43661a);};UserReport[_0x833a('0x1b')][_0x833a('0x1e')]=function(_0x283a5f,_0x49d5ed,_0x532235){io['to'](_0x283a5f)['emit'](_0x49d5ed,_0x532235);};UserReport[_0x833a('0x1b')]['syncRegistry']=function(_0x4987fd){try{if(this['isNotNull'](_0x4987fd)){logger[_0x833a('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x4987fd['username'],_0x4987fd['state']);logger[_0x833a('0x20')](_0x833a('0x21'),util[_0x833a('0x14')](_0x4987fd,{'showHidden':![],'depth':null}));var _0x20bda6=_[_0x833a('0x22')](this[_0x833a('0x9')],{'defaultuser':_0x4987fd['username']});if(_0x20bda6){_0x4987fd['stateRegistry']=_0x4987fd[_0x833a('0x23')];_[_0x833a('0x24')](_0x20bda6,_[_0x833a('0x25')](_0x4987fd,[_0x833a('0x26'),_0x833a('0x27'),_0x833a('0x28'),_0x833a('0x23')]));logger[_0x833a('0x20')](_0x833a('0x29'),util[_0x833a('0x14')](_0x20bda6,{'showHidden':![],'depth':null}));this[_0x833a('0x1e')](util[_0x833a('0x2a')]('trunk:%s',_0x20bda6[_0x833a('0x2b')]),_0x833a('0x2c'),_0x20bda6);}}}catch(_0x37f106){logger[_0x833a('0x12')](_0x833a('0x21'),util[_0x833a('0x14')](_0x37f106,{'showHidden':![],'depth':null}));}};UserReport[_0x833a('0x1b')]['syncDeviceState']=function(_0x4db890){try{if(this[_0x833a('0x1c')](_0x4db890)){logger[_0x833a('0x1f')](_0x833a('0x2d'),_0x4db890[_0x833a('0x2e')],_0x4db890[_0x833a('0x23')]);logger[_0x833a('0x20')](_0x833a('0x2f'),util[_0x833a('0x14')](_0x4db890,{'showHidden':![],'depth':null}));if(this[_0x833a('0x30')][_0x4db890[_0x833a('0x2e')]]){if(!this[_0x833a('0x30')][_0x4db890[_0x833a('0x2e')]][_0x833a('0x31')]||_0x4db890[_0x833a('0x23')][_0x833a('0x32')]()==_0x833a('0x33')){this[_0x833a('0x30')][_0x4db890[_0x833a('0x2e')]][_0x833a('0x31')]=![];if(this[_0x833a('0x30')][_0x4db890[_0x833a('0x2e')]][_0x833a('0x23')]!==_0x4db890[_0x833a('0x23')][_0x833a('0x32')]()){this[_0x833a('0x30')][_0x4db890[_0x833a('0x2e')]][_0x833a('0x34')]=_[_0x833a('0x35')](moment()[_0x833a('0x2a')]('x'));}this[_0x833a('0x30')][_0x4db890[_0x833a('0x2e')]]['state']=_0x4db890[_0x833a('0x23')]['toLowerCase']();this['agents'][_0x4db890[_0x833a('0x2e')]][_0x833a('0x36')](_0x4db890);}}else if(this['telephones'][_0x4db890[_0x833a('0x2e')]]){if(this['telephones'][_0x4db890['device']]['state']!==_0x4db890[_0x833a('0x23')][_0x833a('0x32')]()){this[_0x833a('0xa')][_0x4db890[_0x833a('0x2e')]]['stateTime']=_[_0x833a('0x35')](moment()[_0x833a('0x2a')]('x'));}this[_0x833a('0xa')][_0x4db890[_0x833a('0x2e')]]['state']=_0x4db890[_0x833a('0x23')][_0x833a('0x32')]();logger[_0x833a('0x20')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x833a('0x14')](this[_0x833a('0xa')][_0x4db890['device']],{'showHidden':![],'depth':null}));this[_0x833a('0x1e')](util['format'](_0x833a('0x37'),this[_0x833a('0xa')][_0x4db890[_0x833a('0x2e')]]['name']),_0x833a('0x38'),this[_0x833a('0xa')][_0x4db890[_0x833a('0x2e')]]);}else if(this[_0x833a('0x9')][_0x4db890[_0x833a('0x2e')]]){if(this[_0x833a('0x9')][_0x4db890[_0x833a('0x2e')]][_0x833a('0x23')]!==_0x4db890[_0x833a('0x23')][_0x833a('0x32')]()){this[_0x833a('0x9')][_0x4db890[_0x833a('0x2e')]][_0x833a('0x34')]=_[_0x833a('0x35')](moment()[_0x833a('0x2a')]('x'));}this[_0x833a('0x9')][_0x4db890[_0x833a('0x2e')]]['state']=_0x4db890[_0x833a('0x23')][_0x833a('0x32')]();logger[_0x833a('0x20')](_0x833a('0x39'),util['inspect'](this[_0x833a('0x9')][_0x4db890[_0x833a('0x2e')]],{'showHidden':![],'depth':null}));this[_0x833a('0x1e')](util['format'](_0x833a('0x3a'),this[_0x833a('0x9')][_0x4db890[_0x833a('0x2e')]][_0x833a('0x2b')]),'trunk:save',this[_0x833a('0x9')][_0x4db890[_0x833a('0x2e')]]);}else if(_['startsWith'](_0x4db890['device'],'Local')){var _0x531ccc=_0x4db890[_0x833a('0x2e')];var _0x4a29fc=_0x531ccc['substring'](_0x531ccc['indexOf']('/')+0x1,_0x531ccc['indexOf']('@'));var _0x21d380=_[_0x833a('0x22')](this[_0x833a('0x30')],function(_0x1afbb4){return _0x1afbb4[_0x833a('0x3b')]==_0x4a29fc||_0x1afbb4['phone']==_0x4a29fc||_0x1afbb4['accountcode']==_0x4a29fc;});if(_0x21d380){if(_0x21d380[_0x833a('0x23')]!==_0x4db890['state'][_0x833a('0x32')]()){_0x21d380[_0x833a('0x34')]=_[_0x833a('0x35')](moment()[_0x833a('0x2a')]('x'));}_0x21d380[_0x833a('0x23')]=_0x4db890[_0x833a('0x23')]['toLowerCase']();_0x21d380['local']=!![];_0x21d380[_0x833a('0x36')](_0x4db890);}}}}catch(_0x362a9b){logger[_0x833a('0x12')]('[userReport][devicestatechange]',util[_0x833a('0x14')](_0x362a9b,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x833a('0xf')]=function(_0x31ef10){try{if(this['isNotNull'](_0x31ef10)&&this[_0x833a('0x1c')](_0x31ef10[_0x833a('0x3c')])){logger['info'](_0x833a('0x3d'),_0x31ef10['peer'],_0x31ef10[_0x833a('0x3e')],_0x31ef10[_0x833a('0x3c')]);logger[_0x833a('0x20')](_0x833a('0x3f'),util[_0x833a('0x14')](_0x31ef10,{'showHidden':![],'depth':null}));if(this[_0x833a('0x30')][_0x31ef10[_0x833a('0x40')]]){if(!this[_0x833a('0x30')][_0x31ef10[_0x833a('0x40')]][_0x833a('0x31')]||_0x31ef10[_0x833a('0x3c')][_0x833a('0x32')]()==_0x833a('0x41')){this[_0x833a('0x30')][_0x31ef10[_0x833a('0x40')]][_0x833a('0x31')]=![];this[_0x833a('0x30')][_0x31ef10[_0x833a('0x40')]][_0x833a('0x42')]=_0x31ef10[_0x833a('0x3c')]['toLowerCase']();this[_0x833a('0x30')][_0x31ef10[_0x833a('0x40')]][_0x833a('0x3e')]=_0x31ef10['address'];this[_0x833a('0x30')][_0x31ef10[_0x833a('0x40')]][_0x833a('0x36')](_0x31ef10);}}else if(this['telephones'][_0x31ef10[_0x833a('0x40')]]){this[_0x833a('0xa')][_0x31ef10[_0x833a('0x40')]][_0x833a('0x42')]=_0x31ef10[_0x833a('0x3c')][_0x833a('0x32')]();this[_0x833a('0xa')][_0x31ef10[_0x833a('0x40')]][_0x833a('0x3e')]=_0x31ef10['address'];logger[_0x833a('0x20')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x833a('0x14')](this[_0x833a('0xa')][_0x31ef10[_0x833a('0x40')]],{'showHidden':![],'depth':null}));this[_0x833a('0x1e')](util['format'](_0x833a('0x37'),this['telephones'][_0x31ef10[_0x833a('0x40')]][_0x833a('0x2b')]),'telephone:save',this['telephones'][_0x31ef10['peer']]);}else if(this[_0x833a('0x9')][_0x31ef10[_0x833a('0x40')]]){this[_0x833a('0x9')][_0x31ef10[_0x833a('0x40')]]['status']=_0x31ef10[_0x833a('0x3c')][_0x833a('0x32')]();this[_0x833a('0x9')][_0x31ef10['peer']][_0x833a('0x3e')]=_0x31ef10[_0x833a('0x3e')];logger[_0x833a('0x20')](_0x833a('0x43'),util['inspect'](this[_0x833a('0x9')][_0x31ef10['peer']],{'showHidden':![],'depth':null}));this[_0x833a('0x1e')](util[_0x833a('0x2a')]('trunk:%s',this[_0x833a('0x9')][_0x31ef10['peer']][_0x833a('0x2b')]),'trunk:save',this['trunks'][_0x31ef10['peer']]);}}}catch(_0x10cdbc){logger['error']('[userReport][peerstatus]',util[_0x833a('0x14')](_0x10cdbc,{'showHidden':![],'depth':null}));}};module[_0x833a('0x44')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 541563f..a3efd86 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 _0x184e=['[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','voice','merge','omit','privilege','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','membername','user:agentconnect','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','transfer','talktime','acw','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','syncAgentCalled','isNotNull'];(function(_0x30ee4f,_0x6630c7){var _0x420824=function(_0x27ea09){while(--_0x27ea09){_0x30ee4f['push'](_0x30ee4f['shift']());}};_0x420824(++_0x6630c7);}(_0x184e,0x1a0));var _0xe184=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x184e[_0x5a7e3c];return _0x59252b;};'use strict';var _=require(_0xe184('0x0'));var moment=require(_0xe184('0x1'));var util=require(_0xe184('0x2'));var Redis=require(_0xe184('0x3'));var config=require(_0xe184('0x4'));var logger=require(_0xe184('0x5'))(_0xe184('0x6'));var ami=require('../ami');config[_0xe184('0x7')]=_[_0xe184('0x8')](config[_0xe184('0x7')],{'host':_0xe184('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x4d0a6e){this[_0xe184('0xa')]={};this['voiceChannels']=_0x4d0a6e[_0xe184('0xa')];this[_0xe184('0xb')]=_0x4d0a6e[_0xe184('0xb')];this[_0xe184('0xc')]=_0x4d0a6e[_0xe184('0xc')];this[_0xe184('0xd')]={};ami['on'](_0xe184('0xe'),this['syncAgentCalled']['bind'](this));ami['on'](_0xe184('0xf'),this[_0xe184('0x10')][_0xe184('0x11')](this));ami['on'](_0xe184('0x12'),this['syncAgentRingNoAnswer'][_0xe184('0x11')](this));ami['on'](_0xe184('0x13'),this[_0xe184('0x14')]['bind'](this));ami['on'](_0xe184('0x15'),this[_0xe184('0x16')][_0xe184('0x11')](this));ami['on']('varset',this[_0xe184('0x17')][_0xe184('0x11')](this));ami['on']('hangup',this['syncHangup'][_0xe184('0x11')](this));ami['on'](_0xe184('0x18'),this['syncMusicOnHoldStart'][_0xe184('0x11')](this));ami['on']('musiconholdstop',this[_0xe184('0x19')][_0xe184('0x11')](this));ami['on'](_0xe184('0x1a'),this['syncAttendedTransfer'][_0xe184('0x11')](this));ami['on'](_0xe184('0x1b'),this[_0xe184('0x1c')][_0xe184('0x11')](this));}VoiceAgentReport[_0xe184('0x1d')][_0xe184('0x1e')]=function(_0x164ac1,_0x1ec00a,_0x2d8b32){io['to'](_0x164ac1)[_0xe184('0x1e')](_0x1ec00a,_0x2d8b32);};VoiceAgentReport[_0xe184('0x1d')]['isNotNull']=function(_0x59fa2e){return _0x59fa2e!==null&&!_[_0xe184('0x1f')](_0x59fa2e);};VoiceAgentReport[_0xe184('0x1d')][_0xe184('0x20')]=function(_0x2fd3be){try{if(this[_0xe184('0x21')](_0x2fd3be)){logger['info'](_0xe184('0x22'),_0x2fd3be[_0xe184('0x23')],_0x2fd3be['membername'],_0x2fd3be[_0xe184('0x24')]);logger[_0xe184('0x25')](_0xe184('0x26'),_0x2fd3be[_0xe184('0x23')],util[_0xe184('0x27')](_0x2fd3be,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xe184('0xa')][_0x2fd3be['uniqueid']])){this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]]={};}if(_[_0xe184('0x1f')](this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be[_0xe184('0x24')]])){this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be[_0xe184('0x24')]]={'agentcalledAt':moment()[_0xe184('0x28')](_0xe184('0x29')),'lastevent':_0xe184('0x2a'),'mandatoryDisposition':this[_0xe184('0xb')][_0x2fd3be[_0xe184('0x2b')]]?this[_0xe184('0xb')][_0x2fd3be[_0xe184('0x2b')]]['mandatoryDisposition']||![]:![],'type':this[_0xe184('0xb')][_0x2fd3be[_0xe184('0x2b')]]?this['voiceQueues'][_0x2fd3be[_0xe184('0x2b')]][_0xe184('0x2c')]||_0xe184('0x2d'):_0xe184('0x2d'),'variables':this[_0xe184('0xd')][_0x2fd3be[_0xe184('0x23')]],'motionChannel':_0xe184('0x2e')};}_[_0xe184('0x2f')](this['channels'][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be[_0xe184('0x24')]],_[_0xe184('0x30')](_0x2fd3be,['event',_0xe184('0x31')]));logger[_0xe184('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x2fd3be[_0xe184('0x23')],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x2fd3be['uniqueid']][_0x2fd3be[_0xe184('0x24')]],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')](_0xe184('0x32'),this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be['destuniqueid']]);logger[_0xe184('0x25')](_0xe184('0x33'),_0x2fd3be[_0xe184('0x23')],util[_0xe184('0x27')](this['channels'][_0x2fd3be['uniqueid']][_0x2fd3be[_0xe184('0x24')]],{'showHidden':![],'depth':null}));this[_0xe184('0x1e')](util['format'](_0xe184('0x34'),_0x2fd3be['membername']),_0xe184('0x35'),this[_0xe184('0xa')][_0x2fd3be[_0xe184('0x23')]][_0x2fd3be[_0xe184('0x24')]]);}}catch(_0x46f80a){logger[_0xe184('0x36')]('[%s][voiceAgentReport][agentcalled]',_0x2fd3be['uniqueid'],util['inspect'](_0x46f80a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe184('0x10')]=function(_0x4647e9){try{if(this[_0xe184('0x21')](_0x4647e9)){if(this['channels'][_0x4647e9['uniqueid']]){logger[_0xe184('0x25')](_0xe184('0x37'),_0x4647e9[_0xe184('0x23')],util[_0xe184('0x27')](_0x4647e9,{'showHidden':![],'depth':null}));for(var _0x387608 in this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]]){if(this[_0xe184('0xa')][_0x4647e9['uniqueid']]['hasOwnProperty'](_0x387608)){if(_0x4647e9['destuniqueid']===_0x387608){logger[_0xe184('0x38')](_0xe184('0x39'),_0x4647e9[_0xe184('0x23')],_0x4647e9['membername'],_0x4647e9['destuniqueid']);this[_0xe184('0xa')][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x3a')]=moment()['format'](_0xe184('0x29'));this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608]['connectedlinename']=_0x4647e9[_0xe184('0x3b')];this['channels'][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x3c')]=_0x4647e9[_0xe184('0x3c')];this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x3d')]=_0x4647e9[_0xe184('0x3d')];this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x3e')]=_0x4647e9[_0xe184('0x3e')];this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x3f')]=_0x4647e9[_0xe184('0x3f')];this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x40')]=_0xe184('0x41');if(this[_0xe184('0x42')][this[_0xe184('0xa')][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x23')]]){var _0x2f9d4e=this['voiceChannels'][this[_0xe184('0xa')][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x23')]][_0xe184('0x43')];this[_0xe184('0xa')][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x43')]=_0x2f9d4e;_0x4647e9[_0xe184('0x43')]=_0x2f9d4e;}_['merge'](this['agents'][_0x4647e9[_0xe184('0x44')]],_[_0xe184('0x45')](_0x4647e9,[_0xe184('0x2b'),_0xe184('0x46'),_0xe184('0x43')]));logger['debug'](_0xe184('0x47'),_0x4647e9[_0xe184('0x23')],util['inspect'](this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x4647e9[_0xe184('0x24')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x4647e9['destuniqueid']]);logger['debug'](_0xe184('0x48'),_0x4647e9[_0xe184('0x23')],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x4647e9[_0xe184('0x24')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xe184('0x34'),_0x4647e9[_0xe184('0x49')]),_0xe184('0x4a'),this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x4647e9[_0xe184('0x24')]]);}else if(!this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608]['agentringnoanswer']&&!this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608]['agentcomplete']){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4647e9[_0xe184('0x23')],this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x49')],_0x387608);this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x12')]=!![];this['channels'][_0x4647e9['uniqueid']][_0x387608][_0xe184('0x4b')]=moment()[_0xe184('0x28')](_0xe184('0x29'));this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x4c')]=_0x4647e9[_0xe184('0x24')];this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x4d')]=_0x4647e9[_0xe184('0x49')];this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608]['lastevent']='answered_elsewhere';this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608][_0xe184('0x4e')]=_0xe184('0x4f');logger['debug'](_0xe184('0x50'),_0x4647e9['uniqueid'],util[_0xe184('0x27')](this['channels'][_0x4647e9[_0xe184('0x23')]][_0x387608],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')]('custom:agentansweredelsewhere',this[_0xe184('0xa')][_0x4647e9[_0xe184('0x23')]][_0x387608]);}}}}}}catch(_0x3e80eb){logger[_0xe184('0x36')]('[%s][voiceAgentReport][agentconnect]',_0x4647e9[_0xe184('0x23')],util['inspect'](_0x3e80eb,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe184('0x51')]=function(_0x492a58){try{if(this[_0xe184('0x21')](_0x492a58)){logger['debug'](_0xe184('0x52'),_0x492a58[_0xe184('0x23')],util[_0xe184('0x27')](_0x492a58,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x492a58['uniqueid']]&&this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]]){logger[_0xe184('0x38')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x492a58[_0xe184('0x23')],_0x492a58[_0xe184('0x49')],_0x492a58[_0xe184('0x24')]);this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]]['agentringnoanswer']=!![];this['channels'][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]][_0xe184('0x4b')]=moment()[_0xe184('0x28')](_0xe184('0x29'));this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]][_0xe184('0x40')]=_0xe184('0x53');this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]][_0xe184('0x4e')]=_0xe184('0x53');logger[_0xe184('0x25')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x492a58['uniqueid'],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')](_0xe184('0x54'),this[_0xe184('0xa')][_0x492a58[_0xe184('0x23')]][_0x492a58[_0xe184('0x24')]]);}}}catch(_0x43926a){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x492a58[_0xe184('0x23')],util[_0xe184('0x27')](_0x43926a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x1446d9){try{if(this[_0xe184('0x21')](_0x1446d9)){logger[_0xe184('0x25')](_0xe184('0x55'),_0x1446d9[_0xe184('0x23')],util[_0xe184('0x27')](_0x1446d9,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]]){for(var _0x53efe1 in this[_0xe184('0xa')][_0x1446d9['uniqueid']]){if(this['channels'][_0x1446d9['uniqueid']][_0xe184('0x56')](_0x53efe1)&&!this[_0xe184('0xa')][_0x1446d9['uniqueid']][_0x53efe1][_0xe184('0x12')]&&!this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1]['agentcomplete']){logger[_0xe184('0x38')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1446d9[_0xe184('0x23')],this['channels'][_0x1446d9['uniqueid']][_0x53efe1][_0xe184('0x49')],_0x53efe1);this['channels'][_0x1446d9[_0xe184('0x23')]][_0x53efe1][_0xe184('0x12')]=!![];this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1][_0xe184('0x4b')]=moment()['format'](_0xe184('0x29'));this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1][_0xe184('0x40')]=_0xe184('0x57');this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1][_0xe184('0x4e')]=_0xe184('0x57');logger[_0xe184('0x25')](_0xe184('0x58'),_0x1446d9[_0xe184('0x23')],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')](_0xe184('0x59'),this[_0xe184('0xa')][_0x1446d9[_0xe184('0x23')]][_0x53efe1]);}}}}}catch(_0x3a00b8){logger[_0xe184('0x36')](_0xe184('0x5a'),_0x1446d9[_0xe184('0x23')],util[_0xe184('0x27')](_0x3a00b8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe184('0x1d')][_0xe184('0x16')]=function(_0x4f5459){try{if(this[_0xe184('0x21')](_0x4f5459)){logger['debug'](_0xe184('0x5b'),_0x4f5459[_0xe184('0x23')],util[_0xe184('0x27')](_0x4f5459,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]]){for(var _0xf0f650 in this[_0xe184('0xa')][_0x4f5459['uniqueid']]){if(this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xe184('0x56')](_0xf0f650)){if(this['channels'][_0x4f5459['uniqueid']][_0xf0f650][_0xe184('0x3a')]&&!this[_0xe184('0xa')][_0x4f5459['uniqueid']][_0xf0f650]['agentcomplete']){logger[_0xe184('0x38')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4f5459[_0xe184('0x23')],this['channels'][_0x4f5459[_0xe184('0x23')]][_0xf0f650][_0xe184('0x49')],_0xf0f650);this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]['agentcomplete']=!![];this[_0xe184('0xa')][_0x4f5459['uniqueid']][_0xf0f650][_0xe184('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650][_0xe184('0x40')]=_0xe184('0x5d');this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]['reason']=_0x4f5459[_0xe184('0x4e')]==_0xe184('0x5e')?'agent':_0x4f5459[_0xe184('0x4e')];this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650][_0xe184('0x5f')]=_0x4f5459['talktime'];if(this[_0xe184('0xb')][_0x4f5459[_0xe184('0x2b')]]&&this[_0xe184('0xb')][_0x4f5459[_0xe184('0x2b')]][_0xe184('0x60')]){this['channels'][_0x4f5459['uniqueid']][_0xf0f650][_0xe184('0x61')]=this['voiceQueues'][_0x4f5459[_0xe184('0x2b')]][_0xe184('0x62')];this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]['agentacw']=!![];}this[_0xe184('0xc')][_0x4f5459[_0xe184('0x44')]]=_[_0xe184('0x30')](this[_0xe184('0xc')][_0x4f5459[_0xe184('0x44')]],['queue','destconnectedlinenum']);logger['debug'](_0xe184('0x63'),_0x4f5459[_0xe184('0x23')],util[_0xe184('0x27')](this[_0xe184('0xa')][_0x4f5459['uniqueid']][_0xf0f650],{'showHidden':![],'depth':null}));ami[_0xe184('0x1e')](_0xe184('0x64'),this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]);logger['debug'](_0xe184('0x65'),_0x4f5459[_0xe184('0x23')],util['inspect'](this['channels'][_0x4f5459[_0xe184('0x23')]][_0xf0f650],{'showHidden':![],'depth':null}));this[_0xe184('0x1e')](util[_0xe184('0x28')]('user:%s',_0x4f5459[_0xe184('0x49')]),'user:agentcomplete',this[_0xe184('0xa')][_0x4f5459[_0xe184('0x23')]][_0xf0f650]);}}}}}}catch(_0x5ef8c0){logger[_0xe184('0x36')](_0xe184('0x66'),_0x4f5459[_0xe184('0x23')],util[_0xe184('0x27')](_0x5ef8c0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x27e55b){try{if(this[_0xe184('0x21')](_0x27e55b)){logger['debug'](_0xe184('0x67'),_0x27e55b[_0xe184('0x23')],util['inspect'](_0x27e55b,{'showHidden':![],'depth':null}));this[_0xe184('0x68')](_0x27e55b[_0xe184('0x23')],_[_0xe184('0x69')](_0x27e55b[_0xe184('0x6a')])[0x0],_0x27e55b[_0xe184('0x6b')]);if(this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]]){for(var _0x5f22f6 in this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]]){if(this['channels'][_0x27e55b[_0xe184('0x23')]][_0xe184('0x56')](_0x5f22f6)){logger[_0xe184('0x38')](_0xe184('0x6c'),_0x27e55b['uniqueid'],_0x5f22f6,_['keys'](_0x27e55b[_0xe184('0x6a')])[0x0],_0x27e55b[_0xe184('0x6b')]);if(_[_0xe184('0x1f')](this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]][_0x5f22f6][_0xe184('0xd')])){this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]][_0x5f22f6][_0xe184('0xd')]={};}this[_0xe184('0xa')][_0x27e55b[_0xe184('0x23')]][_0x5f22f6][_0xe184('0xd')]=this[_0xe184('0xd')][_0x27e55b['uniqueid']];}}}}}catch(_0x2b7e91){logger['error'](_0xe184('0x6d'),_0x27e55b[_0xe184('0x23')],util[_0xe184('0x27')](_0x2b7e91,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe184('0x68')]=function(_0x164d53,_0x472058,_0x7676a3){var _0x1583c4=['rtpaudioqos',_0xe184('0x6e'),'rtpaudioqosjitter',_0xe184('0x6f'),_0xe184('0x70'),_0xe184('0x71'),_0xe184('0x72'),_0xe184('0x73'),_0xe184('0x74'),_0xe184('0x75'),_0xe184('0x76'),_0xe184('0x77'),_0xe184('0x78'),_0xe184('0x79'),'memberinterface','memberlastcall',_0xe184('0x49'),'memberpenalty',_0xe184('0x7a')];if(!_[_0xe184('0x7b')](_0x472058)&&!_[_0xe184('0x7c')](_0x1583c4,_0x472058)){if(_['isUndefined'](this['variables'][_0x164d53])){this[_0xe184('0xd')][_0x164d53]={};}this[_0xe184('0xd')][_0x164d53][_0x472058]=_0x7676a3;}};VoiceAgentReport['prototype'][_0xe184('0x7d')]=function(_0x50110c){try{if(this[_0xe184('0x21')](_0x50110c)){logger['debug'](_0xe184('0x7e'),_0x50110c[_0xe184('0x23')],util[_0xe184('0x27')](_0x50110c,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]]){for(var _0x3b0441 in this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]]){if(this['channels'][_0x50110c['uniqueid']]['hasOwnProperty'](_0x3b0441)){if(this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]][_0x3b0441][_0xe184('0x4e')]==_0xe184('0x5e')&&this['channels'][_0x50110c[_0xe184('0x23')]][_0x3b0441]['agentcomplete']){logger['info'](_0xe184('0x7f'),_0x50110c[_0xe184('0x23')],_0x3b0441);this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]][_0x3b0441][_0xe184('0x5c')]=moment()[_0xe184('0x28')](_0xe184('0x29'));}}}logger[_0xe184('0x25')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x50110c[_0xe184('0x23')],util['inspect'](_[_0xe184('0x80')](this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_['values'](this[_0xe184('0xa')][_0x50110c[_0xe184('0x23')]]));delete this[_0xe184('0xa')][_0x50110c['uniqueid']];}if(this[_0xe184('0xd')][_0x50110c['uniqueid']]){delete this[_0xe184('0xd')][_0x50110c['uniqueid']];}}}catch(_0x596864){logger['error'](_0xe184('0x81'),_0x50110c[_0xe184('0x23')],util[_0xe184('0x27')](_0x596864,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe184('0x1d')]['syncAttendedTransfer']=function(_0x25541f){try{if(this[_0xe184('0x21')](_0x25541f)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x25541f[_0xe184('0x23')],util[_0xe184('0x27')](_0x25541f,{'showHidden':![],'depth':null}));if(this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]]){for(var _0x123e53 in this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]]){if(this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]][_0xe184('0x56')](_0x123e53)){if(_0x25541f[_0xe184('0x83')]===_0x123e53){logger['info'](_0xe184('0x84'),_0x25541f[_0xe184('0x23')],this['channels'][_0x25541f[_0xe184('0x82')]][_0x123e53]['membername'],_0x123e53);var _0x2ba51b=moment();this['channels'][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x15')]=!![];this['channels'][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x5c')]=moment()[_0xe184('0x28')](_0xe184('0x29'));this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x40')]='complete';this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x4e')]='transfer';this[_0xe184('0xa')][_0x25541f['transfereeuniqueid']][_0x123e53]['talktime']=_0x2ba51b[_0xe184('0x85')](this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]][_0x123e53][_0xe184('0x3a')],_0xe184('0x86'));}}}}if(this[_0xe184('0xa')][_0x25541f[_0xe184('0x87')]]){var _0x4a9835=this[_0xe184('0xa')][_0x25541f[_0xe184('0x87')]];this['channels'][_0x25541f['secondtransfereruniqueid']]=this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]];this[_0xe184('0xa')][_0x25541f[_0xe184('0x82')]]=_0x4a9835;}}}catch(_0x1ff2a2){logger[_0xe184('0x36')](_0xe184('0x88'),_0x25541f[_0xe184('0x23')],util[_0xe184('0x27')](_0x1ff2a2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe184('0x1d')][_0xe184('0x1c')]=function(_0x8542f9){try{if(this['isNotNull'](_0x8542f9)){logger['debug'](_0xe184('0x89'),_0x8542f9['uniqueid'],util[_0xe184('0x27')](_0x8542f9,{'showHidden':![],'depth':null}));if(this['channels'][_0x8542f9[_0xe184('0x82')]]){for(var _0x2bedf9 in this[_0xe184('0xa')][_0x8542f9[_0xe184('0x82')]]){if(this[_0xe184('0xa')][_0x8542f9['transfereeuniqueid']][_0xe184('0x56')](_0x2bedf9)){if(_0x8542f9[_0xe184('0x8a')]===_0x2bedf9){logger['info'](_0xe184('0x8b'),_0x8542f9[_0xe184('0x23')],this['channels'][_0x8542f9['transfereeuniqueid']][_0x2bedf9]['membername'],_0x2bedf9);var _0x1b6147=moment();this[_0xe184('0xa')][_0x8542f9['transfereeuniqueid']][_0x2bedf9][_0xe184('0x15')]=!![];this[_0xe184('0xa')][_0x8542f9['transfereeuniqueid']][_0x2bedf9]['agentcompleteAt']=_0x1b6147;this[_0xe184('0xa')][_0x8542f9[_0xe184('0x82')]][_0x2bedf9][_0xe184('0x40')]=_0xe184('0x5d');this[_0xe184('0xa')][_0x8542f9[_0xe184('0x82')]][_0x2bedf9]['reason']=_0xe184('0x5e');this['channels'][_0x8542f9[_0xe184('0x82')]][_0x2bedf9][_0xe184('0x5f')]=_0x1b6147[_0xe184('0x85')](this[_0xe184('0xa')][_0x8542f9[_0xe184('0x82')]][_0x2bedf9][_0xe184('0x3a')],_0xe184('0x86'));}}}}}}catch(_0x5dfdda){logger[_0xe184('0x36')]('[%s][voiceAgentReport][blindtransfer]',_0x8542f9[_0xe184('0x23')],util[_0xe184('0x27')](_0x5dfdda,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe184('0x1d')]['syncMusicOnHoldStart']=function(_0x5b911c){var _0x365f0a='';try{if(this[_0xe184('0x21')](_0x5b911c)){logger[_0xe184('0x25')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x5b911c['uniqueid'],util[_0xe184('0x27')](_0x5b911c,{'showHidden':![],'depth':null}));if(_0x5b911c[_0xe184('0x8c')]){_0x365f0a=_0x5b911c[_0xe184('0x8c')][_0xe184('0x8d')](0x0,_0x5b911c['channel'][_0xe184('0x8e')]('-'));if(this['agents'][_0x365f0a]){logger['info'](_0xe184('0x8f'),_0x5b911c['uniqueid'],_0x365f0a);this['agents'][_0x365f0a][_0xe184('0x90')]=!![];}}}}catch(_0x439ace){logger[_0xe184('0x36')](_0xe184('0x91'),_0x5b911c[_0xe184('0x23')],util[_0xe184('0x27')](_0x439ace,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe184('0x19')]=function(_0x166009){var _0x2c0498='';try{if(this[_0xe184('0x21')](_0x166009)){logger['debug'](_0xe184('0x92'),_0x166009[_0xe184('0x23')],util['inspect'](_0x166009,{'showHidden':![],'depth':null}));if(_0x166009[_0xe184('0x8c')]){_0x2c0498=_0x166009[_0xe184('0x8c')][_0xe184('0x8d')](0x0,_0x166009['channel'][_0xe184('0x8e')]('-'));if(this[_0xe184('0xc')][_0x2c0498]){logger[_0xe184('0x38')](_0xe184('0x93'),_0x166009[_0xe184('0x23')],_0x2c0498);this['agents'][_0x2c0498][_0xe184('0x90')]=![];}}}}catch(_0x4dc09f){logger[_0xe184('0x36')](_0xe184('0x94'),_0x166009[_0xe184('0x23')],util[_0xe184('0x27')](_0x4dc09f,{'showHidden':![],'depth':null}));}};module[_0xe184('0x95')]=VoiceAgentReport; \ No newline at end of file +var _0xa46e=['../../../config/environment','../../../config/logger','../ami','defaults','localhost','redis','voiceChannels','channels','voiceQueues','agents','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','queuecallerabandon','agentcomplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','membername','destuniqueid','debug','uniqueid','isUndefined','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','agent','talktime','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variables','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa46e,0x8a));var _0xea46=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xa46e[_0x4327fe];return _0x138651;};'use strict';var _=require(_0xea46('0x0'));var moment=require(_0xea46('0x1'));var util=require('util');var Redis=require(_0xea46('0x2'));var config=require(_0xea46('0x3'));var logger=require(_0xea46('0x4'))('ami');var ami=require(_0xea46('0x5'));config['redis']=_[_0xea46('0x6')](config['redis'],{'host':_0xea46('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea46('0x8')]));function VoiceAgentReport(_0x3dc26f){this['channels']={};this[_0xea46('0x9')]=_0x3dc26f[_0xea46('0xa')];this[_0xea46('0xb')]=_0x3dc26f[_0xea46('0xb')];this[_0xea46('0xc')]=_0x3dc26f['agents'];this['variables']={};ami['on']('agentcalled',this[_0xea46('0xd')][_0xea46('0xe')](this));ami['on']('agentconnect',this[_0xea46('0xf')][_0xea46('0xe')](this));ami['on'](_0xea46('0x10'),this['syncAgentRingNoAnswer'][_0xea46('0xe')](this));ami['on'](_0xea46('0x11'),this['syncQueueCallerAbandon'][_0xea46('0xe')](this));ami['on'](_0xea46('0x12'),this['syncAgentComplete'][_0xea46('0xe')](this));ami['on']('varset',this[_0xea46('0x13')][_0xea46('0xe')](this));ami['on'](_0xea46('0x14'),this[_0xea46('0x15')][_0xea46('0xe')](this));ami['on'](_0xea46('0x16'),this[_0xea46('0x17')][_0xea46('0xe')](this));ami['on'](_0xea46('0x18'),this['syncMusicOnHoldStop'][_0xea46('0xe')](this));ami['on'](_0xea46('0x19'),this[_0xea46('0x1a')]['bind'](this));ami['on']('blindtransfer',this[_0xea46('0x1b')][_0xea46('0xe')](this));}VoiceAgentReport['prototype']['emit']=function(_0x1932c4,_0x9b7d04,_0x4ff93d){io['to'](_0x1932c4)[_0xea46('0x1c')](_0x9b7d04,_0x4ff93d);};VoiceAgentReport[_0xea46('0x1d')][_0xea46('0x1e')]=function(_0x18ccea){return _0x18ccea!==null&&!_['isUndefined'](_0x18ccea);};VoiceAgentReport[_0xea46('0x1d')]['syncAgentCalled']=function(_0x515e32){try{if(this[_0xea46('0x1e')](_0x515e32)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x515e32['uniqueid'],_0x515e32[_0xea46('0x1f')],_0x515e32[_0xea46('0x20')]);logger[_0xea46('0x21')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x515e32[_0xea46('0x22')],util['inspect'](_0x515e32,{'showHidden':![],'depth':null}));if(_[_0xea46('0x23')](this[_0xea46('0xa')][_0x515e32['uniqueid']])){this[_0xea46('0xa')][_0x515e32['uniqueid']]={};}if(_[_0xea46('0x23')](this[_0xea46('0xa')][_0x515e32[_0xea46('0x22')]][_0x515e32['destuniqueid']])){this['channels'][_0x515e32[_0xea46('0x22')]][_0x515e32[_0xea46('0x20')]]={'agentcalledAt':moment()['format'](_0xea46('0x24')),'lastevent':'called','mandatoryDisposition':this[_0xea46('0xb')][_0x515e32['queue']]?this[_0xea46('0xb')][_0x515e32[_0xea46('0x25')]][_0xea46('0x26')]||![]:![],'type':this[_0xea46('0xb')][_0x515e32[_0xea46('0x25')]]?this[_0xea46('0xb')][_0x515e32['queue']][_0xea46('0x27')]||_0xea46('0x28'):_0xea46('0x28'),'variables':this['variables'][_0x515e32[_0xea46('0x22')]],'motionChannel':_0xea46('0x29')};}_[_0xea46('0x2a')](this['channels'][_0x515e32['uniqueid']][_0x515e32['destuniqueid']],_[_0xea46('0x2b')](_0x515e32,[_0xea46('0x2c'),_0xea46('0x2d')]));logger[_0xea46('0x21')](_0xea46('0x2e'),_0x515e32[_0xea46('0x22')],util[_0xea46('0x2f')](this[_0xea46('0xa')][_0x515e32[_0xea46('0x22')]][_0x515e32[_0xea46('0x20')]],{'showHidden':![],'depth':null}));ami[_0xea46('0x1c')]('custom:agentcalled',this[_0xea46('0xa')][_0x515e32[_0xea46('0x22')]][_0x515e32[_0xea46('0x20')]]);logger[_0xea46('0x21')](_0xea46('0x30'),_0x515e32[_0xea46('0x22')],util[_0xea46('0x2f')](this['channels'][_0x515e32[_0xea46('0x22')]][_0x515e32[_0xea46('0x20')]],{'showHidden':![],'depth':null}));this[_0xea46('0x1c')](util[_0xea46('0x31')](_0xea46('0x32'),_0x515e32['membername']),'user:called',this[_0xea46('0xa')][_0x515e32[_0xea46('0x22')]][_0x515e32['destuniqueid']]);}}catch(_0x38d970){logger[_0xea46('0x33')](_0xea46('0x34'),_0x515e32[_0xea46('0x22')],util['inspect'](_0x38d970,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xea46('0xf')]=function(_0x556e11){try{if(this[_0xea46('0x1e')](_0x556e11)){if(this[_0xea46('0xa')][_0x556e11['uniqueid']]){logger[_0xea46('0x21')](_0xea46('0x35'),_0x556e11['uniqueid'],util[_0xea46('0x2f')](_0x556e11,{'showHidden':![],'depth':null}));for(var _0xefad3e in this['channels'][_0x556e11[_0xea46('0x22')]]){if(this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xea46('0x36')](_0xefad3e)){if(_0x556e11['destuniqueid']===_0xefad3e){logger[_0xea46('0x37')](_0xea46('0x38'),_0x556e11[_0xea46('0x22')],_0x556e11[_0xea46('0x1f')],_0x556e11[_0xea46('0x20')]);this['channels'][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x39')]=moment()['format'](_0xea46('0x24'));this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x3a')]=_0x556e11['connectedlinename'];this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x3b')]=_0x556e11['connectedlinenum'];this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x3c')]=_0x556e11[_0xea46('0x3c')];this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x3d')]=_0x556e11[_0xea46('0x3d')];this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x3e')]=_0x556e11[_0xea46('0x3e')];this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x3f')]='connect';if(this['voiceChannels'][this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x22')]]){var _0x202b3a=this['voiceChannels'][this['channels'][_0x556e11['uniqueid']][_0xefad3e][_0xea46('0x22')]][_0xea46('0x40')];this['channels'][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x40')]=_0x202b3a;_0x556e11[_0xea46('0x40')]=_0x202b3a;}_[_0xea46('0x2a')](this[_0xea46('0xc')][_0x556e11['interface']],_[_0xea46('0x41')](_0x556e11,['queue',_0xea46('0x42'),_0xea46('0x40')]));logger[_0xea46('0x21')](_0xea46('0x43'),_0x556e11[_0xea46('0x22')],util[_0xea46('0x2f')](this[_0xea46('0xa')][_0x556e11['uniqueid']][_0x556e11[_0xea46('0x20')]],{'showHidden':![],'depth':null}));ami[_0xea46('0x1c')]('custom:agentconnect',this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0x556e11[_0xea46('0x20')]]);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x556e11[_0xea46('0x22')],util[_0xea46('0x2f')](this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0x556e11[_0xea46('0x20')]],{'showHidden':![],'depth':null}));this[_0xea46('0x1c')](util[_0xea46('0x31')](_0xea46('0x32'),_0x556e11[_0xea46('0x1f')]),_0xea46('0x44'),this['channels'][_0x556e11[_0xea46('0x22')]][_0x556e11['destuniqueid']]);}else if(!this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x10')]&&!this['channels'][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x12')]){logger[_0xea46('0x37')](_0xea46('0x45'),_0x556e11['uniqueid'],this['channels'][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x1f')],_0xefad3e);this['channels'][_0x556e11[_0xea46('0x22')]][_0xefad3e]['agentringnoanswer']=!![];this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e][_0xea46('0x46')]=moment()[_0xea46('0x31')](_0xea46('0x24'));this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e]['answeredelsewheredestinationuniqueid']=_0x556e11['destuniqueid'];this[_0xea46('0xa')][_0x556e11['uniqueid']][_0xefad3e][_0xea46('0x47')]=_0x556e11[_0xea46('0x1f')];this[_0xea46('0xa')][_0x556e11['uniqueid']][_0xefad3e][_0xea46('0x3f')]='answered_elsewhere';this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e]['reason']='answered_elsewhere';logger[_0xea46('0x21')](_0xea46('0x48'),_0x556e11[_0xea46('0x22')],util['inspect'](this[_0xea46('0xa')][_0x556e11['uniqueid']][_0xefad3e],{'showHidden':![],'depth':null}));ami[_0xea46('0x1c')]('custom:agentansweredelsewhere',this[_0xea46('0xa')][_0x556e11[_0xea46('0x22')]][_0xefad3e]);}}}}}}catch(_0x394ffc){logger[_0xea46('0x33')](_0xea46('0x49'),_0x556e11['uniqueid'],util[_0xea46('0x2f')](_0x394ffc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xea46('0x1d')][_0xea46('0x4a')]=function(_0x5c336d){try{if(this['isNotNull'](_0x5c336d)){logger[_0xea46('0x21')](_0xea46('0x4b'),_0x5c336d[_0xea46('0x22')],util[_0xea46('0x2f')](_0x5c336d,{'showHidden':![],'depth':null}));if(this[_0xea46('0xa')][_0x5c336d[_0xea46('0x22')]]&&this[_0xea46('0xa')][_0x5c336d[_0xea46('0x22')]][_0x5c336d[_0xea46('0x20')]]){logger[_0xea46('0x37')](_0xea46('0x4c'),_0x5c336d[_0xea46('0x22')],_0x5c336d[_0xea46('0x1f')],_0x5c336d[_0xea46('0x20')]);this[_0xea46('0xa')][_0x5c336d['uniqueid']][_0x5c336d[_0xea46('0x20')]][_0xea46('0x10')]=!![];this[_0xea46('0xa')][_0x5c336d[_0xea46('0x22')]][_0x5c336d['destuniqueid']][_0xea46('0x46')]=moment()[_0xea46('0x31')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xea46('0xa')][_0x5c336d[_0xea46('0x22')]][_0x5c336d['destuniqueid']][_0xea46('0x3f')]=_0xea46('0x4d');this[_0xea46('0xa')][_0x5c336d['uniqueid']][_0x5c336d[_0xea46('0x20')]][_0xea46('0x4e')]=_0xea46('0x4d');logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5c336d['uniqueid'],util[_0xea46('0x2f')](this[_0xea46('0xa')][_0x5c336d[_0xea46('0x22')]][_0x5c336d[_0xea46('0x20')]],{'showHidden':![],'depth':null}));ami[_0xea46('0x1c')]('custom:agentringnoanswer',this[_0xea46('0xa')][_0x5c336d['uniqueid']][_0x5c336d[_0xea46('0x20')]]);}}}catch(_0x283dc8){logger[_0xea46('0x33')]('[%s][voiceAgentReport][agentringnoanswer]',_0x5c336d['uniqueid'],util[_0xea46('0x2f')](_0x283dc8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xea46('0x1d')]['syncQueueCallerAbandon']=function(_0x3be948){try{if(this[_0xea46('0x1e')](_0x3be948)){logger[_0xea46('0x21')](_0xea46('0x4f'),_0x3be948[_0xea46('0x22')],util['inspect'](_0x3be948,{'showHidden':![],'depth':null}));if(this[_0xea46('0xa')][_0x3be948[_0xea46('0x22')]]){for(var _0xb69e55 in this[_0xea46('0xa')][_0x3be948[_0xea46('0x22')]]){if(this[_0xea46('0xa')][_0x3be948[_0xea46('0x22')]][_0xea46('0x36')](_0xb69e55)&&!this['channels'][_0x3be948[_0xea46('0x22')]][_0xb69e55][_0xea46('0x10')]&&!this[_0xea46('0xa')][_0x3be948[_0xea46('0x22')]][_0xb69e55][_0xea46('0x12')]){logger[_0xea46('0x37')](_0xea46('0x50'),_0x3be948['uniqueid'],this['channels'][_0x3be948[_0xea46('0x22')]][_0xb69e55][_0xea46('0x1f')],_0xb69e55);this[_0xea46('0xa')][_0x3be948[_0xea46('0x22')]][_0xb69e55][_0xea46('0x10')]=!![];this[_0xea46('0xa')][_0x3be948[_0xea46('0x22')]][_0xb69e55][_0xea46('0x46')]=moment()[_0xea46('0x31')](_0xea46('0x24'));this[_0xea46('0xa')][_0x3be948['uniqueid']][_0xb69e55][_0xea46('0x3f')]=_0xea46('0x51');this[_0xea46('0xa')][_0x3be948[_0xea46('0x22')]][_0xb69e55]['reason']=_0xea46('0x51');logger[_0xea46('0x21')](_0xea46('0x52'),_0x3be948[_0xea46('0x22')],util['inspect'](this[_0xea46('0xa')][_0x3be948[_0xea46('0x22')]][_0xb69e55],{'showHidden':![],'depth':null}));ami[_0xea46('0x1c')](_0xea46('0x53'),this['channels'][_0x3be948[_0xea46('0x22')]][_0xb69e55]);}}}}}catch(_0x137bf5){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x3be948[_0xea46('0x22')],util[_0xea46('0x2f')](_0x137bf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xea46('0x1d')][_0xea46('0x54')]=function(_0x938815){try{if(this[_0xea46('0x1e')](_0x938815)){logger[_0xea46('0x21')](_0xea46('0x55'),_0x938815[_0xea46('0x22')],util[_0xea46('0x2f')](_0x938815,{'showHidden':![],'depth':null}));if(this[_0xea46('0xa')][_0x938815[_0xea46('0x22')]]){for(var _0x1f577e in this['channels'][_0x938815[_0xea46('0x22')]]){if(this[_0xea46('0xa')][_0x938815['uniqueid']][_0xea46('0x36')](_0x1f577e)){if(this[_0xea46('0xa')][_0x938815[_0xea46('0x22')]][_0x1f577e][_0xea46('0x39')]&&!this['channels'][_0x938815[_0xea46('0x22')]][_0x1f577e]['agentcomplete']){logger[_0xea46('0x37')](_0xea46('0x56'),_0x938815[_0xea46('0x22')],this[_0xea46('0xa')][_0x938815['uniqueid']][_0x1f577e][_0xea46('0x1f')],_0x1f577e);this['channels'][_0x938815[_0xea46('0x22')]][_0x1f577e][_0xea46('0x12')]=!![];this['channels'][_0x938815[_0xea46('0x22')]][_0x1f577e][_0xea46('0x57')]=moment()['format'](_0xea46('0x24'));this[_0xea46('0xa')][_0x938815['uniqueid']][_0x1f577e]['lastevent']='complete';this['channels'][_0x938815[_0xea46('0x22')]][_0x1f577e][_0xea46('0x4e')]=_0x938815[_0xea46('0x4e')]==_0xea46('0x58')?_0xea46('0x59'):_0x938815[_0xea46('0x4e')];this[_0xea46('0xa')][_0x938815[_0xea46('0x22')]][_0x1f577e]['talktime']=_0x938815[_0xea46('0x5a')];if(this[_0xea46('0xb')][_0x938815[_0xea46('0x25')]]&&this[_0xea46('0xb')][_0x938815[_0xea46('0x25')]]['acw']){this['channels'][_0x938815[_0xea46('0x22')]][_0x1f577e][_0xea46('0x5b')]=this[_0xea46('0xb')][_0x938815[_0xea46('0x25')]][_0xea46('0x5c')];this['channels'][_0x938815[_0xea46('0x22')]][_0x1f577e][_0xea46('0x5d')]=!![];}this['agents'][_0x938815['interface']]=_[_0xea46('0x2b')](this[_0xea46('0xc')][_0x938815[_0xea46('0x5e')]],[_0xea46('0x25'),_0xea46('0x42')]);logger['debug'](_0xea46('0x5f'),_0x938815['uniqueid'],util[_0xea46('0x2f')](this[_0xea46('0xa')][_0x938815[_0xea46('0x22')]][_0x1f577e],{'showHidden':![],'depth':null}));ami[_0xea46('0x1c')]('custom:agentcomplete',this[_0xea46('0xa')][_0x938815[_0xea46('0x22')]][_0x1f577e]);logger[_0xea46('0x21')](_0xea46('0x60'),_0x938815[_0xea46('0x22')],util[_0xea46('0x2f')](this[_0xea46('0xa')][_0x938815[_0xea46('0x22')]][_0x1f577e],{'showHidden':![],'depth':null}));this[_0xea46('0x1c')](util['format'](_0xea46('0x32'),_0x938815[_0xea46('0x1f')]),'user:agentcomplete',this[_0xea46('0xa')][_0x938815[_0xea46('0x22')]][_0x1f577e]);}}}}}}catch(_0x2fc069){logger[_0xea46('0x33')]('[%s][voiceAgentReport][agentcomplete]',_0x938815[_0xea46('0x22')],util[_0xea46('0x2f')](_0x2fc069,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x2e96ad){try{if(this[_0xea46('0x1e')](_0x2e96ad)){logger[_0xea46('0x21')](_0xea46('0x61'),_0x2e96ad[_0xea46('0x22')],util['inspect'](_0x2e96ad,{'showHidden':![],'depth':null}));this[_0xea46('0x62')](_0x2e96ad[_0xea46('0x22')],_['keys'](_0x2e96ad[_0xea46('0x63')])[0x0],_0x2e96ad[_0xea46('0x64')]);if(this[_0xea46('0xa')][_0x2e96ad['uniqueid']]){for(var _0x1d2653 in this[_0xea46('0xa')][_0x2e96ad[_0xea46('0x22')]]){if(this[_0xea46('0xa')][_0x2e96ad['uniqueid']][_0xea46('0x36')](_0x1d2653)){logger[_0xea46('0x37')](_0xea46('0x65'),_0x2e96ad[_0xea46('0x22')],_0x1d2653,_['keys'](_0x2e96ad[_0xea46('0x63')])[0x0],_0x2e96ad['value']);if(_[_0xea46('0x23')](this[_0xea46('0xa')][_0x2e96ad[_0xea46('0x22')]][_0x1d2653][_0xea46('0x66')])){this[_0xea46('0xa')][_0x2e96ad[_0xea46('0x22')]][_0x1d2653][_0xea46('0x66')]={};}this['channels'][_0x2e96ad[_0xea46('0x22')]][_0x1d2653][_0xea46('0x66')]=this[_0xea46('0x66')][_0x2e96ad[_0xea46('0x22')]];}}}}}catch(_0x5edd8c){logger[_0xea46('0x33')]('[%s][voiceAgentReport][varset]',_0x2e96ad[_0xea46('0x22')],util['inspect'](_0x5edd8c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xea46('0x62')]=function(_0x2a5b0b,_0x1d5e79,_0x2a8e57){var _0x3bb071=['rtpaudioqos',_0xea46('0x67'),_0xea46('0x68'),_0xea46('0x69'),_0xea46('0x6a'),_0xea46('0x6b'),_0xea46('0x6c'),'rtpaudioqosrttbridged',_0xea46('0x6d'),_0xea46('0x6e'),'bridgepeer',_0xea46('0x6f'),'membercalls',_0xea46('0x70'),_0xea46('0x71'),_0xea46('0x72'),_0xea46('0x1f'),_0xea46('0x73'),_0xea46('0x74')];if(!_['isNil'](_0x1d5e79)&&!_['includes'](_0x3bb071,_0x1d5e79)){if(_['isUndefined'](this['variables'][_0x2a5b0b])){this[_0xea46('0x66')][_0x2a5b0b]={};}this['variables'][_0x2a5b0b][_0x1d5e79]=_0x2a8e57;}};VoiceAgentReport[_0xea46('0x1d')]['syncHangup']=function(_0x1fe0bb){try{if(this[_0xea46('0x1e')](_0x1fe0bb)){logger['debug'](_0xea46('0x75'),_0x1fe0bb[_0xea46('0x22')],util['inspect'](_0x1fe0bb,{'showHidden':![],'depth':null}));if(this[_0xea46('0xa')][_0x1fe0bb[_0xea46('0x22')]]){for(var _0x118001 in this[_0xea46('0xa')][_0x1fe0bb[_0xea46('0x22')]]){if(this[_0xea46('0xa')][_0x1fe0bb[_0xea46('0x22')]][_0xea46('0x36')](_0x118001)){if(this[_0xea46('0xa')][_0x1fe0bb[_0xea46('0x22')]][_0x118001][_0xea46('0x4e')]=='transfer'&&this['channels'][_0x1fe0bb[_0xea46('0x22')]][_0x118001][_0xea46('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x1fe0bb['uniqueid'],_0x118001);this['channels'][_0x1fe0bb[_0xea46('0x22')]][_0x118001][_0xea46('0x57')]=moment()[_0xea46('0x31')](_0xea46('0x24'));}}}logger['debug'](_0xea46('0x76'),_0x1fe0bb[_0xea46('0x22')],util[_0xea46('0x2f')](_[_0xea46('0x77')](this[_0xea46('0xa')][_0x1fe0bb[_0xea46('0x22')]]),{'showHidden':![],'depth':null}));ami[_0xea46('0x1c')](_0xea46('0x78'),_['values'](this[_0xea46('0xa')][_0x1fe0bb[_0xea46('0x22')]]));delete this[_0xea46('0xa')][_0x1fe0bb[_0xea46('0x22')]];}if(this[_0xea46('0x66')][_0x1fe0bb[_0xea46('0x22')]]){delete this[_0xea46('0x66')][_0x1fe0bb[_0xea46('0x22')]];}}}catch(_0x14edb8){logger[_0xea46('0x33')]('[%s][voiceAgentReport][hangup]',_0x1fe0bb[_0xea46('0x22')],util[_0xea46('0x2f')](_0x14edb8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xea46('0x1d')][_0xea46('0x1a')]=function(_0x395d84){try{if(this[_0xea46('0x1e')](_0x395d84)){logger[_0xea46('0x21')](_0xea46('0x79'),_0x395d84['uniqueid'],util[_0xea46('0x2f')](_0x395d84,{'showHidden':![],'depth':null}));if(this[_0xea46('0xa')][_0x395d84['transfereeuniqueid']]){for(var _0x27e31f in this['channels'][_0x395d84[_0xea46('0x7a')]]){if(this['channels'][_0x395d84['transfereeuniqueid']]['hasOwnProperty'](_0x27e31f)){if(_0x395d84[_0xea46('0x7b')]===_0x27e31f){logger[_0xea46('0x37')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x395d84['uniqueid'],this[_0xea46('0xa')][_0x395d84[_0xea46('0x7a')]][_0x27e31f][_0xea46('0x1f')],_0x27e31f);var _0x761719=moment();this[_0xea46('0xa')][_0x395d84['transfereeuniqueid']][_0x27e31f][_0xea46('0x12')]=!![];this[_0xea46('0xa')][_0x395d84['transfereeuniqueid']][_0x27e31f]['agentcompleteAt']=moment()[_0xea46('0x31')](_0xea46('0x24'));this[_0xea46('0xa')][_0x395d84['transfereeuniqueid']][_0x27e31f]['lastevent']='complete';this[_0xea46('0xa')][_0x395d84['transfereeuniqueid']][_0x27e31f][_0xea46('0x4e')]=_0xea46('0x58');this[_0xea46('0xa')][_0x395d84['transfereeuniqueid']][_0x27e31f][_0xea46('0x5a')]=_0x761719['diff'](this[_0xea46('0xa')][_0x395d84[_0xea46('0x7a')]][_0x27e31f][_0xea46('0x39')],_0xea46('0x7c'));}}}}if(this[_0xea46('0xa')][_0x395d84[_0xea46('0x7d')]]){var _0x55d2f6=this[_0xea46('0xa')][_0x395d84['secondtransfereruniqueid']];this[_0xea46('0xa')][_0x395d84[_0xea46('0x7d')]]=this[_0xea46('0xa')][_0x395d84[_0xea46('0x7a')]];this['channels'][_0x395d84[_0xea46('0x7a')]]=_0x55d2f6;}}}catch(_0x2f0e4){logger[_0xea46('0x33')](_0xea46('0x7e'),_0x395d84[_0xea46('0x22')],util['inspect'](_0x2f0e4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xea46('0x1d')][_0xea46('0x1b')]=function(_0x355c91){try{if(this[_0xea46('0x1e')](_0x355c91)){logger[_0xea46('0x21')](_0xea46('0x7f'),_0x355c91[_0xea46('0x22')],util[_0xea46('0x2f')](_0x355c91,{'showHidden':![],'depth':null}));if(this[_0xea46('0xa')][_0x355c91[_0xea46('0x7a')]]){for(var _0x8d18c8 in this[_0xea46('0xa')][_0x355c91['transfereeuniqueid']]){if(this[_0xea46('0xa')][_0x355c91['transfereeuniqueid']]['hasOwnProperty'](_0x8d18c8)){if(_0x355c91[_0xea46('0x80')]===_0x8d18c8){logger[_0xea46('0x37')](_0xea46('0x81'),_0x355c91[_0xea46('0x22')],this[_0xea46('0xa')][_0x355c91[_0xea46('0x7a')]][_0x8d18c8][_0xea46('0x1f')],_0x8d18c8);var _0x2de6b1=moment();this[_0xea46('0xa')][_0x355c91[_0xea46('0x7a')]][_0x8d18c8]['agentcomplete']=!![];this[_0xea46('0xa')][_0x355c91['transfereeuniqueid']][_0x8d18c8][_0xea46('0x57')]=_0x2de6b1;this[_0xea46('0xa')][_0x355c91['transfereeuniqueid']][_0x8d18c8][_0xea46('0x3f')]=_0xea46('0x82');this[_0xea46('0xa')][_0x355c91[_0xea46('0x7a')]][_0x8d18c8][_0xea46('0x4e')]=_0xea46('0x58');this[_0xea46('0xa')][_0x355c91[_0xea46('0x7a')]][_0x8d18c8][_0xea46('0x5a')]=_0x2de6b1[_0xea46('0x83')](this[_0xea46('0xa')][_0x355c91['transfereeuniqueid']][_0x8d18c8][_0xea46('0x39')],_0xea46('0x7c'));}}}}}}catch(_0x25ffe8){logger[_0xea46('0x33')](_0xea46('0x84'),_0x355c91['uniqueid'],util['inspect'](_0x25ffe8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xea46('0x1d')][_0xea46('0x17')]=function(_0x40326b){var _0x1322b3='';try{if(this['isNotNull'](_0x40326b)){logger['debug'](_0xea46('0x85'),_0x40326b[_0xea46('0x22')],util['inspect'](_0x40326b,{'showHidden':![],'depth':null}));if(_0x40326b['channel']){_0x1322b3=_0x40326b[_0xea46('0x86')][_0xea46('0x87')](0x0,_0x40326b[_0xea46('0x86')][_0xea46('0x88')]('-'));if(this[_0xea46('0xc')][_0x1322b3]){logger[_0xea46('0x37')](_0xea46('0x89'),_0x40326b[_0xea46('0x22')],_0x1322b3);this[_0xea46('0xc')][_0x1322b3]['onhold']=!![];}}}}catch(_0x25eb5f){logger[_0xea46('0x33')]('[%s][voiceAgentReport][musiconholdstart]',_0x40326b[_0xea46('0x22')],util[_0xea46('0x2f')](_0x25eb5f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xea46('0x1d')]['syncMusicOnHoldStop']=function(_0x478fe9){var _0x51a220='';try{if(this[_0xea46('0x1e')](_0x478fe9)){logger[_0xea46('0x21')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x478fe9[_0xea46('0x22')],util[_0xea46('0x2f')](_0x478fe9,{'showHidden':![],'depth':null}));if(_0x478fe9[_0xea46('0x86')]){_0x51a220=_0x478fe9[_0xea46('0x86')]['substring'](0x0,_0x478fe9[_0xea46('0x86')][_0xea46('0x88')]('-'));if(this[_0xea46('0xc')][_0x51a220]){logger['info'](_0xea46('0x8a'),_0x478fe9[_0xea46('0x22')],_0x51a220);this['agents'][_0x51a220]['onhold']=![];}}}}catch(_0x2380f2){logger[_0xea46('0x33')](_0xea46('0x8b'),_0x478fe9[_0xea46('0x22')],util['inspect'](_0x2380f2,{'showHidden':![],'depth':null}));}};module[_0xea46('0x8c')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 6c663cf..21f0708 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 _0xe5c9=['stopRecordingOnTransfer','Action','StopMixMonitor','catch','then','finally','webbar:stopmonitors','event','BlindTransfer','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','outbound','routeid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','transfereecalleridnum','BLIND','transfererchannel','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','bluebird','lodash','moment','path','../../../config/environment','../../../config/logger','ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','set','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','newexten','bind','newchannel','varset','syncVarSet','syncHangup','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','keys','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','error','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','pick','includes','lastapplication','lastdata','cdr(','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','holdtime','diff','destinationchannel','UserId','membername','routealias','user:%s','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','isNil','monitors','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','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','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','answertime','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','undefined','isEmpty','getSettings'];(function(_0x139805,_0x545173){var _0x517318=function(_0x506c5d){while(--_0x506c5d){_0x139805['push'](_0x139805['shift']());}};_0x517318(++_0x545173);}(_0xe5c9,0x1be));var _0x9e5c=function(_0x10da54,_0x4d9107){_0x10da54=_0x10da54-0x0;var _0x508202=_0xe5c9[_0x10da54];return _0x508202;};'use strict';var BPromise=require(_0x9e5c('0x0'));var _=require(_0x9e5c('0x1'));var moment=require(_0x9e5c('0x2'));var util=require('util');var path=require(_0x9e5c('0x3'));var Redis=require('ioredis');var config=require(_0x9e5c('0x4'));var logger=require(_0x9e5c('0x5'))(_0x9e5c('0x6'));var ami=require('../ami');var Channel=require(_0x9e5c('0x7'));var RpcSetting=require(_0x9e5c('0x8'));var statusDesc=[_0x9e5c('0x9'),_0x9e5c('0xa'),_0x9e5c('0xb'),_0x9e5c('0xc'),_0x9e5c('0xd'),_0x9e5c('0xe'),_0x9e5c('0xf'),_0x9e5c('0x10'),'onhold'];var applications=[_0x9e5c('0x11'),_0x9e5c('0x12'),_0x9e5c('0x13'),'dial',_0x9e5c('0x14'),_0x9e5c('0x15')];var dispositions=['NO\x20ANSWER',_0x9e5c('0x16'),_0x9e5c('0x16'),_0x9e5c('0x17'),_0x9e5c('0x17'),_0x9e5c('0x17'),_0x9e5c('0x18'),_0x9e5c('0x19'),'FAILED','FAILED','FAILED'];var actions={};config[_0x9e5c('0x1a')]=_[_0x9e5c('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9e5c('0x1c'))(new Redis(config['redis']));function VoiceCallReport(_0x94de3b){this[_0x9e5c('0x1d')]=_0x94de3b['channels'];this[_0x9e5c('0x1e')]=_0x94de3b[_0x9e5c('0x1e')];this[_0x9e5c('0x1f')]={};ami['on'](_0x9e5c('0x20'),this[_0x9e5c('0x21')]['bind'](this));ami['on'](_0x9e5c('0x22'),this['syncNewExten'][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x24'),this['syncNewChannel'][_0x9e5c('0x23')](this));ami['on']('newstate',this['syncNewState'][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x25'),this[_0x9e5c('0x26')]['bind'](this));ami['on']('hangup',this[_0x9e5c('0x27')][_0x9e5c('0x23')](this));ami['on']('newcallerid',this[_0x9e5c('0x28')]['bind'](this));ami['on'](_0x9e5c('0x29'),this['syncAttendedTransfer'][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x2a'),this[_0x9e5c('0x2b')][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x2c'),this['syncMusicOnHoldStart'][_0x9e5c('0x23')](this));ami['on'](_0x9e5c('0x2d'),this[_0x9e5c('0x2e')][_0x9e5c('0x23')](this));try{logger[_0x9e5c('0x2f')](_0x9e5c('0x30'));ami[_0x9e5c('0x31')]();}catch(_0xae0ddd){logger['error'](_0x9e5c('0x32'),util[_0x9e5c('0x33')](_0xae0ddd,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9e5c('0x34')][_0x9e5c('0x35')]=function(_0x22caad){return _0x22caad!==null&&!_[_0x9e5c('0x36')](_0x22caad);};VoiceCallReport[_0x9e5c('0x34')][_0x9e5c('0x37')]=function(_0x1d522d,_0x439aef,_0x3568cb){io['to'](_0x1d522d)[_0x9e5c('0x37')](_0x439aef,_0x3568cb);};VoiceCallReport['prototype'][_0x9e5c('0x28')]=function(_0x14715a){try{if(this['isNotNull'](_0x14715a)){logger['info'](_0x9e5c('0x38'),_0x14715a[_0x9e5c('0x39')],_0x14715a[_0x9e5c('0x3a')],_0x14715a[_0x9e5c('0x3b')]);logger[_0x9e5c('0x3c')](_0x9e5c('0x3d'),_0x14715a[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x14715a,{'showHidden':![],'depth':null}));if(_0x14715a[_0x9e5c('0x39')]===_0x14715a['linkedid']){if(!_['isUndefined'](this[_0x9e5c('0x1d')][_0x14715a['uniqueid']])){_[_0x9e5c('0x3e')](this[_0x9e5c('0x1d')][_0x14715a[_0x9e5c('0x39')]],_['pick'](_0x14715a,_[_0x9e5c('0x3f')](this[_0x9e5c('0x1d')][_0x14715a[_0x9e5c('0x39')]])));}}if(_0x14715a['context']===_0x9e5c('0x40')){if(this[_0x9e5c('0x1e')][_0x14715a[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]){if(_0x14715a[_0x9e5c('0x43')]==_0x9e5c('0x44')){this[_0x9e5c('0x1e')][_0x14715a['channel'][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x45')]=_0x14715a['connectedlinenum'];this['emit'](util[_0x9e5c('0x46')]('user:%s',this[_0x9e5c('0x1e')][_0x14715a['channel'][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')]),_0x9e5c('0x48'),{'destaccountcode':this['agents'][_0x14715a[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x49')],'destconnectedlinenum':_0x14715a['connectedlinenum']});}}}}}catch(_0x236d01){logger['error'](_0x9e5c('0x4a'),_0x14715a[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x236d01,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e5c('0x4b')]=function(_0x3f71ac){try{if(this[_0x9e5c('0x35')](_0x3f71ac)){logger['debug'](_0x9e5c('0x4c'),_0x3f71ac[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x3f71ac,{'showHidden':![],'depth':null}));if(_0x3f71ac['uniqueid']===_0x3f71ac[_0x9e5c('0x4d')]&&_0x3f71ac[_0x9e5c('0x41')]!=_0x9e5c('0x4e')){if(_[_0x9e5c('0x36')](this[_0x9e5c('0x1d')][_0x3f71ac['uniqueid']])){logger[_0x9e5c('0x2f')](_0x9e5c('0x4f'),_0x3f71ac[_0x9e5c('0x39')],_0x3f71ac[_0x9e5c('0x50')],_0x3f71ac['exten']);this[_0x9e5c('0x1d')][_0x3f71ac[_0x9e5c('0x39')]]=new Channel();this[_0x9e5c('0x1d')][_0x3f71ac['uniqueid']][_0x9e5c('0x51')]=moment()['format'](_0x9e5c('0x52'));this[_0x9e5c('0x1d')][_0x3f71ac[_0x9e5c('0x39')]][_0x9e5c('0x53')]=dispositions[_[_0x9e5c('0x54')](_0x3f71ac['channelstate'])];_[_0x9e5c('0x3e')](this[_0x9e5c('0x1d')][_0x3f71ac[_0x9e5c('0x39')]],_['pick'](_0x3f71ac,_[_0x9e5c('0x3f')](this[_0x9e5c('0x1d')][_0x3f71ac[_0x9e5c('0x39')]])));if(_0x3f71ac[_0x9e5c('0x50')]===_0x9e5c('0x40')){if(this[_0x9e5c('0x1e')][_0x3f71ac['channel'][_0x9e5c('0x42')]('-')[0x0]]){if(_[_0x9e5c('0x36')](this[_0x9e5c('0x1e')][_0x3f71ac[_0x9e5c('0x41')]['split']('-')[0x0]][_0x9e5c('0x45')])){this['agents'][_0x3f71ac[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x45')]=_0x3f71ac[_0x9e5c('0x43')];logger[_0x9e5c('0x3c')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3f71ac[_0x9e5c('0x39')],util[_0x9e5c('0x33')]({'destaccountcode':this['agents'][_0x3f71ac[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x49')],'destconnectedlinenum':_0x3f71ac[_0x9e5c('0x43')]},{'showHidden':![],'depth':null}));this[_0x9e5c('0x37')](util[_0x9e5c('0x46')]('user:%s',this[_0x9e5c('0x1e')][_0x3f71ac[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')]),_0x9e5c('0x48'),{'destaccountcode':this[_0x9e5c('0x1e')][_0x3f71ac[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3f71ac[_0x9e5c('0x43')]});}}}}}}}catch(_0x2b7f30){logger[_0x9e5c('0x55')]('[%s][voiceCallReport][newchannel]',_0x3f71ac[_0x9e5c('0x39')],util['inspect'](_0x2b7f30,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')]['syncNewExten']=function(_0x400c63){try{if(this['isNotNull'](_0x400c63)){logger[_0x9e5c('0x3c')](_0x9e5c('0x56'),_0x400c63[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x400c63,{'showHidden':![],'depth':null}));if(_0x400c63[_0x9e5c('0x39')]===_0x400c63[_0x9e5c('0x4d')]&&_0x400c63[_0x9e5c('0x43')]!='h'&&_0x400c63[_0x9e5c('0x41')]!='OutgoingSpoolFailed'){_0x400c63[_0x9e5c('0x57')]=_0x400c63['application'][_0x9e5c('0x58')]();_0x400c63['applicationdata']=_0x400c63[_0x9e5c('0x59')]&&_0x400c63[_0x9e5c('0x59')][_0x9e5c('0x5a')]('CDR(routeAlias)')?_0x400c63[_0x9e5c('0x59')]:(_0x400c63[_0x9e5c('0x59')]||_0x400c63[_0x9e5c('0x5b')])[_0x9e5c('0x58')]();logger[_0x9e5c('0x2f')](_0x9e5c('0x5c'),_0x400c63[_0x9e5c('0x39')],_0x400c63['application'],_0x400c63['applicationdata']);if(_['isUndefined'](this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]])){this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]]=new Channel();this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]][_0x9e5c('0x51')]=_0x400c63[_0x9e5c('0x5d')]?moment()[_0x9e5c('0x5e')](moment['duration'](_0x400c63[_0x9e5c('0x5d')])[_0x9e5c('0x5f')](),'seconds')[_0x9e5c('0x46')](_0x9e5c('0x52')):moment()['format'](_0x9e5c('0x52'));this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]][_0x9e5c('0x53')]='NO\x20ANSWER';}_['merge'](this['channels'][_0x400c63[_0x9e5c('0x39')]],_[_0x9e5c('0x60')](_0x400c63,_[_0x9e5c('0x3f')](this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]])));if(_[_0x9e5c('0x61')](applications,_0x400c63[_0x9e5c('0x57')])){this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]][_0x9e5c('0x62')]=_0x400c63[_0x9e5c('0x57')];this[_0x9e5c('0x1d')][_0x400c63[_0x9e5c('0x39')]][_0x9e5c('0x63')]=_0x400c63[_0x9e5c('0x5b')];if(_0x400c63[_0x9e5c('0x57')]===_0x9e5c('0x11')&&_[_0x9e5c('0x5a')](_0x400c63[_0x9e5c('0x5b')][_0x9e5c('0x58')](),_0x9e5c('0x64'))){var _0x549720=_0x400c63['applicationdata'][_0x9e5c('0x42')]('=');var _0x414cb5=_0x549720[0x0][_0x9e5c('0x58')]()['match'](/cdr\((.*)\)/);if(_0x414cb5){this['channels'][_0x400c63[_0x9e5c('0x39')]][_0x414cb5[0x1]]=_0x549720[0x1];}}else if(_0x400c63['application']==='queue'){this[_0x9e5c('0x1d')][_0x400c63['uniqueid']]['queue']=_0x400c63[_0x9e5c('0x5b')][_0x9e5c('0x42')](',')[0x0];}}}}}catch(_0x449001){logger[_0x9e5c('0x55')](_0x9e5c('0x65'),_0x400c63[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x449001,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e5c('0x66')]=function(_0x40d88e){try{if(this['isNotNull'](_0x40d88e)){logger[_0x9e5c('0x2f')](_0x9e5c('0x67'),_0x40d88e[_0x9e5c('0x39')],_0x40d88e[_0x9e5c('0x4d')],_0x40d88e[_0x9e5c('0x3a')],_0x40d88e[_0x9e5c('0x3b')]);logger[_0x9e5c('0x3c')](_0x9e5c('0x68'),_0x40d88e[_0x9e5c('0x39')],util['inspect'](_0x40d88e,{'showHidden':![],'depth':null}));if(_0x40d88e[_0x9e5c('0x39')]!==_0x40d88e['linkedid']){if(this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]]){if(_0x40d88e[_0x9e5c('0x69')]==='6'){if(!this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6a')]){var _0x4f836b=moment();this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6a')]=!![];this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]]['answertime']=_0x4f836b[_0x9e5c('0x46')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x51')]){this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6b')]=_0x4f836b[_0x9e5c('0x6c')](this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x51')],_0x9e5c('0x5f'));}}this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x4d')]=_0x40d88e[_0x9e5c('0x39')];if(_0x40d88e[_0x9e5c('0x3b')]!==_0x9e5c('0x44')){this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]]['connectedlinenum']=_0x40d88e[_0x9e5c('0x3b')];}this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]]['connectedlinename']=_0x40d88e[_0x9e5c('0x3a')];this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6d')]=_0x40d88e[_0x9e5c('0x41')];this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x53')]=dispositions[_[_0x9e5c('0x54')](_0x40d88e[_0x9e5c('0x69')])];if(this[_0x9e5c('0x1e')][_0x40d88e['channel'][_0x9e5c('0x42')]('-')[0x0]]){this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x6e')]=this[_0x9e5c('0x1e')][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['id'];this[_0x9e5c('0x1d')][_0x40d88e['linkedid']][_0x9e5c('0x6f')]=this[_0x9e5c('0x1e')][_0x40d88e['channel'][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')];}}}}else{if(this[_0x9e5c('0x1d')][_0x40d88e['uniqueid']]){if(_0x40d88e['channelstate']==='6'){if(this[_0x9e5c('0x1e')][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]){this[_0x9e5c('0x1d')][_0x40d88e['uniqueid']]['UserId']=this[_0x9e5c('0x1e')][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['id'];this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x39')]][_0x9e5c('0x6f')]=this['agents'][_0x40d88e['channel'][_0x9e5c('0x42')]('-')[0x0]]['name'];}}}}if(_0x40d88e['channelstate']==='6'&&_0x40d88e[_0x9e5c('0x50')]===_0x9e5c('0x40')){if(this[_0x9e5c('0x1e')][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]){this['agents'][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x45')]=_0x40d88e['exten'];var _0x3eed33;if(this[_0x9e5c('0x1d')][_0x40d88e['uniqueid']])_0x3eed33=this[_0x9e5c('0x1d')][_0x40d88e['uniqueid']]['routealias'];else if(this['channels'][_0x40d88e[_0x9e5c('0x4d')]])_0x3eed33=this[_0x9e5c('0x1d')][_0x40d88e[_0x9e5c('0x4d')]][_0x9e5c('0x70')];logger[_0x9e5c('0x3c')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x40d88e['uniqueid'],util[_0x9e5c('0x33')]({'destaccountcode':this['agents'][_0x40d88e[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x40d88e[_0x9e5c('0x43')],'routealias':_0x3eed33},{'showHidden':![],'depth':null}));this[_0x9e5c('0x37')](util[_0x9e5c('0x46')](_0x9e5c('0x71'),this['agents'][_0x40d88e['channel'][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')]),'user:agentconnect',{'destaccountcode':this[_0x9e5c('0x1e')][_0x40d88e['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x40d88e[_0x9e5c('0x43')],'routealias':_0x3eed33});}}}}catch(_0x4d32cb){logger[_0x9e5c('0x55')](_0x9e5c('0x72'),_0x40d88e[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x4d32cb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')][_0x9e5c('0x73')]=function(_0x53d0cf,_0x491888){try{if(this[_0x9e5c('0x1d')][_0x53d0cf]){logger[_0x9e5c('0x2f')](_0x9e5c('0x74'),_0x53d0cf,_0x491888);this[_0x9e5c('0x1d')][_0x53d0cf][_0x9e5c('0x75')]=!![];if(_[_0x9e5c('0x76')](_0x491888,_0x9e5c('0x77'))){_0x491888=_0x491888[_0x9e5c('0x78')](_0x9e5c('0x77'),_0x9e5c('0x79'));}this[_0x9e5c('0x1d')][_0x53d0cf][_0x9e5c('0x7a')]=_0x491888;var _0x48f123=_['find'](this[_0x9e5c('0x1d')][_0x53d0cf]['monitors'],{'filename':_0x491888});if(_[_0x9e5c('0x7b')](_0x48f123)){this[_0x9e5c('0x1d')][_0x53d0cf][_0x9e5c('0x7c')][_0x9e5c('0x7d')]({'filename':_0x491888,'createdAt':moment()[_0x9e5c('0x46')](_0x9e5c('0x52')),'mixmonitorid':'','status':_0x9e5c('0x7e')});}}}catch(_0x414c42){logger[_0x9e5c('0x55')]('[%s][voiceCallReport][mixMonitorFilename]',_0x53d0cf,util[_0x9e5c('0x33')](_0x414c42,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')]['syncVarSet']=function(_0x1d034f){try{if(this['isNotNull'](_0x1d034f)){logger[_0x9e5c('0x3c')](_0x9e5c('0x7f'),_0x1d034f[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x1d034f,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x1d034f['uniqueid']]&&_0x1d034f[_0x9e5c('0x41')]!=_0x9e5c('0x4e')){if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')])){if(this[_0x9e5c('0x35')](_0x1d034f['variable'][_0x9e5c('0x81')])){logger['info'](_0x9e5c('0x82'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f['value']);this[_0x9e5c('0x73')](_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);}else if(this[_0x9e5c('0x35')](_0x1d034f['variable'][_0x9e5c('0x84')])){logger[_0x9e5c('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this[_0x9e5c('0x1d')][_0x1d034f['uniqueid']][_0x9e5c('0x3b')]=_0x1d034f['value'];}else if(this['isNotNull'](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x85')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x86'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this[_0x9e5c('0x1d')][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x87')]=_0x1d034f['value'];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x88')])){logger[_0x9e5c('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1d034f[_0x9e5c('0x39')],_0x1d034f['value']);this['channels'][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x89')]=_0x1d034f['value'];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x8a')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x8b'),_0x1d034f['uniqueid'],_0x1d034f[_0x9e5c('0x83')][_0x9e5c('0x42')](',')[0x0]);this['channels'][_0x1d034f[_0x9e5c('0x39')]]['queue']=_0x1d034f['value'][_0x9e5c('0x42')](',')[0x0];}else if(this[_0x9e5c('0x35')](_0x1d034f['variable'][_0x9e5c('0x8c')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1d034f[_0x9e5c('0x39')],_0x1d034f['value']);this['channels'][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x8d')]=_0x1d034f[_0x9e5c('0x83')];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x8e')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x8f'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this['channels'][_0x1d034f['uniqueid']][_0x9e5c('0x90')]=_0x1d034f[_0x9e5c('0x83')];}else if(this['isNotNull'](_0x1d034f['variable'][_0x9e5c('0x91')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x92'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this['channels'][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x93')]=_0x1d034f['value'];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')]['xmcs-queue'])){logger[_0x9e5c('0x2f')](_0x9e5c('0x94'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f['value']);this[_0x9e5c('0x1d')][_0x1d034f[_0x9e5c('0x39')]][_0x9e5c('0x12')]=_0x1d034f['value'];}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x95')])){logger[_0x9e5c('0x2f')](_0x9e5c('0x96'),_0x1d034f[_0x9e5c('0x39')],_0x1d034f[_0x9e5c('0x83')]);this[_0x9e5c('0x1d')][_0x1d034f[_0x9e5c('0x39')]]['sipcalluniqueid']=_0x1d034f['value'];}}}else if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x81')])){if(_0x1d034f[_0x9e5c('0x83')]){var _0x10db6e=path['parse'](_0x1d034f[_0x9e5c('0x83')])[_0x9e5c('0x47')];logger['info'](_0x9e5c('0x82'),_0x10db6e,_0x1d034f[_0x9e5c('0x83')]);this[_0x9e5c('0x73')](_0x10db6e,_0x1d034f[_0x9e5c('0x83')]);}}else if(this[_0x9e5c('0x1d')][_0x1d034f['linkedid']]){if(this['isNotNull'](_0x1d034f['variable'])){if(this[_0x9e5c('0x35')](_0x1d034f[_0x9e5c('0x80')][_0x9e5c('0x95')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1d034f[_0x9e5c('0x4d')],_0x1d034f[_0x9e5c('0x83')]);this['channels'][_0x1d034f[_0x9e5c('0x4d')]][_0x9e5c('0x97')]=_0x1d034f[_0x9e5c('0x83')];}}}}}catch(_0xcc4d36){logger[_0x9e5c('0x55')]('[%s][voiceCallReport][varset]',_0x1d034f['uniqueid'],util[_0x9e5c('0x33')](_0xcc4d36,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')]['syncHangup']=function(_0x4e55cf){try{if(this[_0x9e5c('0x35')](_0x4e55cf)){logger['debug'](_0x9e5c('0x98'),_0x4e55cf[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x4e55cf,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]]){logger[_0x9e5c('0x2f')](_0x9e5c('0x99'),_0x4e55cf[_0x9e5c('0x39')],_0x4e55cf[_0x9e5c('0x9a')]);var _0x1b7258=moment();this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x9b')]=_0x1b7258[_0x9e5c('0x46')](_0x9e5c('0x52'));this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]]['duration']=_0x1b7258[_0x9e5c('0x6c')](this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x51')],'seconds');if(this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x6a')]){this['channels'][_0x4e55cf[_0x9e5c('0x39')]]['billableseconds']=_0x1b7258[_0x9e5c('0x6c')](this[_0x9e5c('0x1d')][_0x4e55cf['uniqueid']][_0x9e5c('0x9c')],_0x9e5c('0x5f'));this[_0x9e5c('0x1d')][_0x4e55cf['uniqueid']][_0x9e5c('0x6b')]=this['channels'][_0x4e55cf['uniqueid']][_0x9e5c('0x5d')]-this[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]]['billableseconds'];}if(_0x4e55cf[_0x9e5c('0x50')]===_0x9e5c('0x40')){if(this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]){this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]=_['omit'](this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')]['split']('-')[0x0]],[_0x9e5c('0x45')]);logger[_0x9e5c('0x3c')](_0x9e5c('0x9d'),_0x4e55cf['uniqueid'],util[_0x9e5c('0x33')]({'id':this['agents'][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x49')]},{'showHidden':![],'depth':null}));this[_0x9e5c('0x37')](util[_0x9e5c('0x46')](_0x9e5c('0x71'),this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]][_0x9e5c('0x47')]),_0x9e5c('0x9e'),{'id':this[_0x9e5c('0x1e')][_0x4e55cf['channel'][_0x9e5c('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0x9e5c('0x1e')][_0x4e55cf[_0x9e5c('0x41')][_0x9e5c('0x42')]('-')[0x0]]['accountcode']});}}var _0x1c9b6c=this;Promise[_0x9e5c('0x9f')]()['then'](function(){var _0x144b78=_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]];if(typeof _0x144b78['transferType']===_0x9e5c('0xa0'))return;if(_[_0x9e5c('0xa1')](_0x144b78[_0x9e5c('0x7c')]))return;return RpcSetting[_0x9e5c('0xa2')]()['then'](function(_0x45c65c){if(!_0x45c65c[_0x9e5c('0xa3')])return;return Promise['resolve']()['then'](function(){return ami[_0x9e5c('0xa4')]({'action':_0x9e5c('0xa5'),'channel':_0x144b78[_0x9e5c('0x41')]})[_0x9e5c('0xa6')](function(){});})[_0x9e5c('0xa7')](function(){return ami[_0x9e5c('0xa4')]({'action':'StopMixMonitor','channel':_0x144b78[_0x9e5c('0x6d')]})[_0x9e5c('0xa6')](function(){})[_0x9e5c('0xa8')](function(){var _0x5489e6=_0x1c9b6c[_0x9e5c('0x1e')][_0x144b78[_0x9e5c('0x6d')][_0x9e5c('0x42')]('-')[0x0]];if(!_0x5489e6)return;io['emit'](_0x9e5c('0xa9'),{'agentId':_0x5489e6['id'],'uniqueid':_0x144b78[_0x9e5c('0x39')]});});});});})['then'](function(){if(_0x4e55cf[_0x9e5c('0xaa')]===_0x9e5c('0xab')){_0x1c9b6c[_0x9e5c('0x1f')][_0x4e55cf[_0x9e5c('0x39')]]=_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]];}else{if(_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x89')]==='outbound'&&_0x1c9b6c[_0x9e5c('0x1f')][_0x4e55cf[_0x9e5c('0x39')]]){_0x1c9b6c['channels'][_0x4e55cf[_0x9e5c('0x39')]]['uniqueid']=[_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x4d')],_0x1c9b6c['channels'][_0x4e55cf[_0x9e5c('0x39')]][_0x9e5c('0x4d')]=_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]]['uniqueid']][0x0];delete _0x1c9b6c[_0x9e5c('0x1f')][_0x4e55cf['uniqueid']];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x4e55cf['uniqueid'],util[_0x9e5c('0x33')](_0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]],{'showHidden':![],'depth':null}));ami['emit'](_0x9e5c('0xac'),_0x1c9b6c['channels'][_0x4e55cf[_0x9e5c('0x39')]]);delete _0x1c9b6c[_0x9e5c('0x1d')][_0x4e55cf[_0x9e5c('0x39')]];});}}}catch(_0x1dfaa0){logger[_0x9e5c('0x55')](_0x9e5c('0xad'),_0x4e55cf[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x1dfaa0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')][_0x9e5c('0xae')]=function(_0x2ae864){try{if(this[_0x9e5c('0x35')](_0x2ae864)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x2ae864[_0x9e5c('0x39')],_0x2ae864[_0x9e5c('0xaf')],_0x2ae864[_0x9e5c('0xb0')]);logger[_0x9e5c('0x3c')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x2ae864[_0x9e5c('0x39')],util['inspect'](_0x2ae864,{'showHidden':![],'depth':null}));if(this['channels'][_0x2ae864['transfereeuniqueid']]){this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb1')]]['transfercalleridnum']=_0x2ae864[_0x9e5c('0xaf')];this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb1')]][_0x9e5c('0xb2')]=_0x2ae864[_0x9e5c('0xb0')];if(this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb3')]]){var _0x187f9f=this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb3')]];this['channels'][_0x2ae864[_0x9e5c('0xb3')]]=this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb1')]];this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb1')]]=_0x187f9f;}}else if(this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb4')]]){this[_0x9e5c('0x1d')][_0x2ae864['transfertargetuniqueid']]['transfercalleridnum']=_0x2ae864[_0x9e5c('0xaf')];this['channels'][_0x2ae864[_0x9e5c('0xb4')]][_0x9e5c('0xb2')]=_0x2ae864[_0x9e5c('0xb0')];if(this[_0x9e5c('0x1d')][_0x2ae864['origtransfereruniqueid']]){var _0x187f9f=this[_0x9e5c('0x1d')][_0x2ae864['origtransfereruniqueid']];this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb5')]]=this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb4')]];this[_0x9e5c('0x1d')][_0x2ae864['transfertargetuniqueid']]=_0x187f9f;}}if((this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb5')]]||this[_0x9e5c('0x1d')][_0x2ae864['origtransfererlinkedid']])&&this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb3')]]){var _0x3ba594=_[_0x9e5c('0xb6')]([this[_0x9e5c('0x1d')][_0x2ae864['origtransfereruniqueid']],this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb7')]],this[_0x9e5c('0x1d')][_0x2ae864['secondtransfereruniqueid']]],function(_0x3133d2){return _0x3133d2&&_0x3133d2[_0x9e5c('0x89')]===_0x9e5c('0xb8')&&_0x3133d2[_0x9e5c('0xb9')];});if(_0x3ba594){if(this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb5')]])this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb5')]][_0x9e5c('0xba')]=_0x9e5c('0xbb');if(this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb7')]])this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb7')]][_0x9e5c('0xba')]='ATTENDED';this[_0x9e5c('0x1d')][_0x2ae864[_0x9e5c('0xb3')]][_0x9e5c('0xba')]=_0x9e5c('0xbb');}}}}catch(_0x3243de){logger['error'](_0x9e5c('0xbc'),_0x2ae864[_0x9e5c('0x39')],util['inspect'](_0x3243de,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e5c('0x2b')]=function(_0x1280f8){try{if(this[_0x9e5c('0x35')](_0x1280f8)){logger[_0x9e5c('0x2f')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x1280f8[_0x9e5c('0x39')],_0x1280f8['transfereecalleridnum'],_0x1280f8[_0x9e5c('0xbd')]);logger[_0x9e5c('0x3c')](_0x9e5c('0xbe'),_0x1280f8[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x1280f8,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x1280f8[_0x9e5c('0xb1')]]){this['channels'][_0x1280f8['transfereeuniqueid']][_0x9e5c('0xbf')]=_0x1280f8[_0x9e5c('0xc0')];this['channels'][_0x1280f8[_0x9e5c('0xb1')]][_0x9e5c('0xb2')]=_0x1280f8[_0x9e5c('0xbd')];this[_0x9e5c('0x1d')][_0x1280f8[_0x9e5c('0xb1')]][_0x9e5c('0xba')]=_0x9e5c('0xc1');this[_0x9e5c('0x27')]({'event':_0x9e5c('0xab'),'uniqueid':_0x1280f8['transfereeuniqueid'],'context':_0x1280f8[_0x9e5c('0x50')],'channel':_0x1280f8[_0x9e5c('0xc2')]});}else{this[_0x9e5c('0x1d')][_0x1280f8['transfereruniqueid']]['transferType']=_0x9e5c('0xc1');}}}catch(_0x2411ea){logger[_0x9e5c('0x55')]('[%s][voiceCallReport][blindtransfer]',_0x1280f8[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x2411ea,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e5c('0xc3')]=function(_0x309044){try{if(this[_0x9e5c('0x35')](_0x309044)){logger[_0x9e5c('0x3c')](_0x9e5c('0xc4'),_0x309044[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x309044,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x309044[_0x9e5c('0x39')]]){if(!_[_0x9e5c('0x7b')](this['channels'][_0x309044[_0x9e5c('0x39')]][_0x9e5c('0x9c')])){this['channels'][_0x309044[_0x9e5c('0x39')]][_0x9e5c('0xc5')]=moment()[_0x9e5c('0x46')](_0x9e5c('0x52'));logger[_0x9e5c('0x2f')](_0x9e5c('0xc6'),_0x309044[_0x9e5c('0x39')],this['channels'][_0x309044[_0x9e5c('0x39')]]['mohstarttime']);}}}}catch(_0x5cfc1f){logger[_0x9e5c('0x55')](_0x9e5c('0xc7'),_0x309044['uniqueid'],util['inspect'](_0x5cfc1f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e5c('0x34')]['syncMusicOnHoldStop']=function(_0x58894b){try{if(this[_0x9e5c('0x35')](_0x58894b)){logger[_0x9e5c('0x3c')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x58894b[_0x9e5c('0x39')],util[_0x9e5c('0x33')](_0x58894b,{'showHidden':![],'depth':null}));if(this[_0x9e5c('0x1d')][_0x58894b[_0x9e5c('0x39')]]){if(!_[_0x9e5c('0x7b')](this[_0x9e5c('0x1d')][_0x58894b[_0x9e5c('0x39')]][_0x9e5c('0xc5')])){this[_0x9e5c('0x1d')][_0x58894b[_0x9e5c('0x39')]][_0x9e5c('0xc8')]+=moment()[_0x9e5c('0xc9')](0x0)[_0x9e5c('0x6c')](this['channels'][_0x58894b[_0x9e5c('0x39')]]['mohstarttime'],'seconds');logger[_0x9e5c('0x2f')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x58894b['uniqueid'],this[_0x9e5c('0x1d')][_0x58894b[_0x9e5c('0x39')]]['mohtime']);delete this['channels'][_0x58894b['uniqueid']]['mohstarttime'];}}}}catch(_0x590f15){logger['error'](_0x9e5c('0xca'),_0x58894b['uniqueid'],util[_0x9e5c('0x33')](_0x590f15,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xb0fd=['transferType','undefined','isEmpty','stopRecordingOnTransfer','catch','Action','finally','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','mohtime','[%s][voiceCallReport][musiconholdstop]','bluebird','lodash','moment','util','path','ioredis','../../../config/logger','ami','unknown','not_inuse','inuse','busy','unavailable','onhold','set','queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','blindTransfers','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','inspect','prototype','isNotNull','isUndefined','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','keys','context','from-sip','channel','split','exten','xcally-motion-preview','agents','destconnectedlinenum','connectedlinenum','emit','format','user:%s','name','user:agentconnect','accountcode','error','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','pick','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','includes','lastdata','cdr(','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answertime','diff','seconds','connectedlinename','destinationchannel','channelstate','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','[%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','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','syncHangup','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','answered','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then'];(function(_0x41b850,_0x276d02){var _0x384aff=function(_0x48a375){while(--_0x48a375){_0x41b850['push'](_0x41b850['shift']());}};_0x384aff(++_0x276d02);}(_0xb0fd,0x1b5));var _0xdb0f=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0xb0fd[_0x18afca];return _0x11603f;};'use strict';var BPromise=require(_0xdb0f('0x0'));var _=require(_0xdb0f('0x1'));var moment=require(_0xdb0f('0x2'));var util=require(_0xdb0f('0x3'));var path=require(_0xdb0f('0x4'));var Redis=require(_0xdb0f('0x5'));var config=require('../../../config/environment');var logger=require(_0xdb0f('0x6'))(_0xdb0f('0x7'));var ami=require('../ami');var Channel=require('../model/channel');var RpcSetting=require('../rpc/setting');var statusDesc=[_0xdb0f('0x8'),_0xdb0f('0x9'),_0xdb0f('0xa'),_0xdb0f('0xb'),'invalid',_0xdb0f('0xc'),'ringing','ringinuse',_0xdb0f('0xd')];var applications=[_0xdb0f('0xe'),_0xdb0f('0xf'),_0xdb0f('0x10'),_0xdb0f('0x11'),_0xdb0f('0x12'),_0xdb0f('0x13')];var dispositions=['NO\x20ANSWER',_0xdb0f('0x14'),_0xdb0f('0x14'),_0xdb0f('0x15'),_0xdb0f('0x15'),_0xdb0f('0x15'),_0xdb0f('0x16'),_0xdb0f('0x17'),_0xdb0f('0x14'),_0xdb0f('0x14'),_0xdb0f('0x14')];var actions={};config['redis']=_['defaults'](config[_0xdb0f('0x18')],{'host':_0xdb0f('0x19'),'port':0x18eb});var io=require(_0xdb0f('0x1a'))(new Redis(config[_0xdb0f('0x18')]));function VoiceCallReport(_0x4967d9){this['channels']=_0x4967d9[_0xdb0f('0x1b')];this['agents']=_0x4967d9['agents'];this[_0xdb0f('0x1c')]={};ami['on'](_0xdb0f('0x1d'),this[_0xdb0f('0x1e')]['bind'](this));ami['on'](_0xdb0f('0x1f'),this[_0xdb0f('0x1e')][_0xdb0f('0x20')](this));ami['on'](_0xdb0f('0x21'),this[_0xdb0f('0x22')]['bind'](this));ami['on'](_0xdb0f('0x23'),this[_0xdb0f('0x24')][_0xdb0f('0x20')](this));ami['on'](_0xdb0f('0x25'),this[_0xdb0f('0x26')][_0xdb0f('0x20')](this));ami['on'](_0xdb0f('0x27'),this['syncHangup'][_0xdb0f('0x20')](this));ami['on'](_0xdb0f('0x28'),this[_0xdb0f('0x29')]['bind'](this));ami['on'](_0xdb0f('0x2a'),this[_0xdb0f('0x2b')][_0xdb0f('0x20')](this));ami['on'](_0xdb0f('0x2c'),this['syncBlindTransfer']['bind'](this));ami['on'](_0xdb0f('0x2d'),this[_0xdb0f('0x2e')]['bind'](this));ami['on'](_0xdb0f('0x2f'),this[_0xdb0f('0x30')]['bind'](this));try{logger['info'](_0xdb0f('0x31'));ami['actionCoreShowChannels']();}catch(_0x10d72c){logger['error']('[voiceCallReport][coreshowchannels]',util[_0xdb0f('0x32')](_0x10d72c,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xdb0f('0x33')][_0xdb0f('0x34')]=function(_0x7314e9){return _0x7314e9!==null&&!_[_0xdb0f('0x35')](_0x7314e9);};VoiceCallReport[_0xdb0f('0x33')]['emit']=function(_0x33217c,_0x33039e,_0x18c4e2){io['to'](_0x33217c)['emit'](_0x33039e,_0x18c4e2);};VoiceCallReport[_0xdb0f('0x33')][_0xdb0f('0x29')]=function(_0x142b4e){try{if(this[_0xdb0f('0x34')](_0x142b4e)){logger[_0xdb0f('0x36')](_0xdb0f('0x37'),_0x142b4e[_0xdb0f('0x38')],_0x142b4e[_0xdb0f('0x39')],_0x142b4e['calleridnum']);logger[_0xdb0f('0x3a')](_0xdb0f('0x3b'),_0x142b4e[_0xdb0f('0x38')],util['inspect'](_0x142b4e,{'showHidden':![],'depth':null}));if(_0x142b4e[_0xdb0f('0x38')]===_0x142b4e[_0xdb0f('0x3c')]){if(!_[_0xdb0f('0x35')](this[_0xdb0f('0x1b')][_0x142b4e[_0xdb0f('0x38')]])){_[_0xdb0f('0x3d')](this[_0xdb0f('0x1b')][_0x142b4e['uniqueid']],_['pick'](_0x142b4e,_[_0xdb0f('0x3e')](this['channels'][_0x142b4e[_0xdb0f('0x38')]])));}}if(_0x142b4e[_0xdb0f('0x3f')]===_0xdb0f('0x40')){if(this['agents'][_0x142b4e[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]]){if(_0x142b4e[_0xdb0f('0x43')]==_0xdb0f('0x44')){this[_0xdb0f('0x45')][_0x142b4e['channel']['split']('-')[0x0]][_0xdb0f('0x46')]=_0x142b4e[_0xdb0f('0x47')];this[_0xdb0f('0x48')](util[_0xdb0f('0x49')](_0xdb0f('0x4a'),this[_0xdb0f('0x45')][_0x142b4e['channel'][_0xdb0f('0x42')]('-')[0x0]][_0xdb0f('0x4b')]),_0xdb0f('0x4c'),{'destaccountcode':this[_0xdb0f('0x45')][_0x142b4e[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]][_0xdb0f('0x4d')],'destconnectedlinenum':_0x142b4e['connectedlinenum']});}}}}}catch(_0x19f4fc){logger[_0xdb0f('0x4e')]('[%s][voiceCallReport][newcallerid]',_0x142b4e['uniqueid'],util[_0xdb0f('0x32')](_0x19f4fc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdb0f('0x33')][_0xdb0f('0x22')]=function(_0x3a3c53){try{if(this[_0xdb0f('0x34')](_0x3a3c53)){logger['debug'](_0xdb0f('0x4f'),_0x3a3c53[_0xdb0f('0x38')],util[_0xdb0f('0x32')](_0x3a3c53,{'showHidden':![],'depth':null}));if(_0x3a3c53['uniqueid']===_0x3a3c53[_0xdb0f('0x3c')]&&_0x3a3c53[_0xdb0f('0x41')]!=_0xdb0f('0x50')){if(_[_0xdb0f('0x35')](this[_0xdb0f('0x1b')][_0x3a3c53[_0xdb0f('0x38')]])){logger[_0xdb0f('0x36')](_0xdb0f('0x51'),_0x3a3c53['uniqueid'],_0x3a3c53['context'],_0x3a3c53['exten']);this[_0xdb0f('0x1b')][_0x3a3c53[_0xdb0f('0x38')]]=new Channel();this['channels'][_0x3a3c53[_0xdb0f('0x38')]][_0xdb0f('0x52')]=moment()[_0xdb0f('0x49')](_0xdb0f('0x53'));this[_0xdb0f('0x1b')][_0x3a3c53[_0xdb0f('0x38')]][_0xdb0f('0x54')]=dispositions[_[_0xdb0f('0x55')](_0x3a3c53['channelstate'])];_['merge'](this[_0xdb0f('0x1b')][_0x3a3c53[_0xdb0f('0x38')]],_[_0xdb0f('0x56')](_0x3a3c53,_[_0xdb0f('0x3e')](this[_0xdb0f('0x1b')][_0x3a3c53[_0xdb0f('0x38')]])));if(_0x3a3c53[_0xdb0f('0x3f')]===_0xdb0f('0x40')){if(this['agents'][_0x3a3c53[_0xdb0f('0x41')]['split']('-')[0x0]]){if(_[_0xdb0f('0x35')](this['agents'][_0x3a3c53[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]][_0xdb0f('0x46')])){this[_0xdb0f('0x45')][_0x3a3c53[_0xdb0f('0x41')]['split']('-')[0x0]][_0xdb0f('0x46')]=_0x3a3c53['exten'];logger[_0xdb0f('0x3a')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3a3c53['uniqueid'],util[_0xdb0f('0x32')]({'destaccountcode':this[_0xdb0f('0x45')][_0x3a3c53[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]][_0xdb0f('0x4d')],'destconnectedlinenum':_0x3a3c53['exten']},{'showHidden':![],'depth':null}));this[_0xdb0f('0x48')](util['format']('user:%s',this[_0xdb0f('0x45')][_0x3a3c53[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]][_0xdb0f('0x4b')]),'user:agentconnect',{'destaccountcode':this[_0xdb0f('0x45')][_0x3a3c53[_0xdb0f('0x41')]['split']('-')[0x0]][_0xdb0f('0x4d')],'destconnectedlinenum':_0x3a3c53[_0xdb0f('0x43')]});}}}}}}}catch(_0x319963){logger[_0xdb0f('0x4e')](_0xdb0f('0x57'),_0x3a3c53['uniqueid'],util[_0xdb0f('0x32')](_0x319963,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdb0f('0x33')]['syncNewExten']=function(_0x2ad663){try{if(this[_0xdb0f('0x34')](_0x2ad663)){logger[_0xdb0f('0x3a')](_0xdb0f('0x58'),_0x2ad663[_0xdb0f('0x38')],util['inspect'](_0x2ad663,{'showHidden':![],'depth':null}));if(_0x2ad663[_0xdb0f('0x38')]===_0x2ad663[_0xdb0f('0x3c')]&&_0x2ad663[_0xdb0f('0x43')]!='h'&&_0x2ad663[_0xdb0f('0x41')]!=_0xdb0f('0x50')){_0x2ad663['application']=_0x2ad663[_0xdb0f('0x59')][_0xdb0f('0x5a')]();_0x2ad663[_0xdb0f('0x5b')]=_0x2ad663[_0xdb0f('0x5c')]&&_0x2ad663['appdata'][_0xdb0f('0x5d')](_0xdb0f('0x5e'))?_0x2ad663['appdata']:(_0x2ad663[_0xdb0f('0x5c')]||_0x2ad663[_0xdb0f('0x5b')])[_0xdb0f('0x5a')]();logger[_0xdb0f('0x36')](_0xdb0f('0x5f'),_0x2ad663[_0xdb0f('0x38')],_0x2ad663['application'],_0x2ad663[_0xdb0f('0x5b')]);if(_[_0xdb0f('0x35')](this[_0xdb0f('0x1b')][_0x2ad663[_0xdb0f('0x38')]])){this[_0xdb0f('0x1b')][_0x2ad663[_0xdb0f('0x38')]]=new Channel();this[_0xdb0f('0x1b')][_0x2ad663[_0xdb0f('0x38')]]['starttime']=_0x2ad663[_0xdb0f('0x60')]?moment()[_0xdb0f('0x61')](moment[_0xdb0f('0x60')](_0x2ad663[_0xdb0f('0x60')])['seconds'](),'seconds')[_0xdb0f('0x49')](_0xdb0f('0x53')):moment()[_0xdb0f('0x49')](_0xdb0f('0x53'));this[_0xdb0f('0x1b')][_0x2ad663['uniqueid']][_0xdb0f('0x54')]='NO\x20ANSWER';}_[_0xdb0f('0x3d')](this[_0xdb0f('0x1b')][_0x2ad663[_0xdb0f('0x38')]],_[_0xdb0f('0x56')](_0x2ad663,_[_0xdb0f('0x3e')](this[_0xdb0f('0x1b')][_0x2ad663[_0xdb0f('0x38')]])));if(_[_0xdb0f('0x62')](applications,_0x2ad663[_0xdb0f('0x59')])){this[_0xdb0f('0x1b')][_0x2ad663['uniqueid']]['lastapplication']=_0x2ad663[_0xdb0f('0x59')];this[_0xdb0f('0x1b')][_0x2ad663[_0xdb0f('0x38')]][_0xdb0f('0x63')]=_0x2ad663['applicationdata'];if(_0x2ad663['application']===_0xdb0f('0xe')&&_[_0xdb0f('0x5d')](_0x2ad663[_0xdb0f('0x5b')][_0xdb0f('0x5a')](),_0xdb0f('0x64'))){var _0x14061c=_0x2ad663[_0xdb0f('0x5b')]['split']('=');var _0x3ca049=_0x14061c[0x0][_0xdb0f('0x5a')]()['match'](/cdr\((.*)\)/);if(_0x3ca049){this[_0xdb0f('0x1b')][_0x2ad663[_0xdb0f('0x38')]][_0x3ca049[0x1]]=_0x14061c[0x1];}}else if(_0x2ad663[_0xdb0f('0x59')]===_0xdb0f('0xf')){this[_0xdb0f('0x1b')][_0x2ad663[_0xdb0f('0x38')]]['queue']=_0x2ad663[_0xdb0f('0x5b')][_0xdb0f('0x42')](',')[0x0];}}}}}catch(_0x22734a){logger[_0xdb0f('0x4e')](_0xdb0f('0x65'),_0x2ad663[_0xdb0f('0x38')],util[_0xdb0f('0x32')](_0x22734a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdb0f('0x33')][_0xdb0f('0x24')]=function(_0x36506b){try{if(this[_0xdb0f('0x34')](_0x36506b)){logger[_0xdb0f('0x36')](_0xdb0f('0x66'),_0x36506b['uniqueid'],_0x36506b[_0xdb0f('0x3c')],_0x36506b[_0xdb0f('0x39')],_0x36506b[_0xdb0f('0x67')]);logger[_0xdb0f('0x3a')](_0xdb0f('0x68'),_0x36506b[_0xdb0f('0x38')],util[_0xdb0f('0x32')](_0x36506b,{'showHidden':![],'depth':null}));if(_0x36506b['uniqueid']!==_0x36506b[_0xdb0f('0x3c')]){if(this[_0xdb0f('0x1b')][_0x36506b['linkedid']]){if(_0x36506b['channelstate']==='6'){if(!this['channels'][_0x36506b['linkedid']]['answered']){var _0x569103=moment();this[_0xdb0f('0x1b')][_0x36506b['linkedid']]['answered']=!![];this[_0xdb0f('0x1b')][_0x36506b[_0xdb0f('0x3c')]][_0xdb0f('0x69')]=_0x569103[_0xdb0f('0x49')](_0xdb0f('0x53'));if(this[_0xdb0f('0x1b')][_0x36506b['linkedid']][_0xdb0f('0x52')]){this['channels'][_0x36506b[_0xdb0f('0x3c')]]['holdtime']=_0x569103[_0xdb0f('0x6a')](this[_0xdb0f('0x1b')][_0x36506b['linkedid']]['starttime'],_0xdb0f('0x6b'));}}this['channels'][_0x36506b[_0xdb0f('0x3c')]]['linkedid']=_0x36506b[_0xdb0f('0x38')];if(_0x36506b[_0xdb0f('0x67')]!==_0xdb0f('0x44')){this['channels'][_0x36506b[_0xdb0f('0x3c')]][_0xdb0f('0x47')]=_0x36506b[_0xdb0f('0x67')];}this[_0xdb0f('0x1b')][_0x36506b[_0xdb0f('0x3c')]][_0xdb0f('0x6c')]=_0x36506b[_0xdb0f('0x39')];this['channels'][_0x36506b[_0xdb0f('0x3c')]][_0xdb0f('0x6d')]=_0x36506b[_0xdb0f('0x41')];this[_0xdb0f('0x1b')][_0x36506b[_0xdb0f('0x3c')]]['disposition']=dispositions[_[_0xdb0f('0x55')](_0x36506b[_0xdb0f('0x6e')])];if(this[_0xdb0f('0x45')][_0x36506b['channel'][_0xdb0f('0x42')]('-')[0x0]]){this[_0xdb0f('0x1b')][_0x36506b[_0xdb0f('0x3c')]][_0xdb0f('0x6f')]=this[_0xdb0f('0x45')][_0x36506b[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]]['id'];this[_0xdb0f('0x1b')][_0x36506b[_0xdb0f('0x3c')]]['membername']=this[_0xdb0f('0x45')][_0x36506b[_0xdb0f('0x41')]['split']('-')[0x0]]['name'];}}}}else{if(this[_0xdb0f('0x1b')][_0x36506b[_0xdb0f('0x38')]]){if(_0x36506b[_0xdb0f('0x6e')]==='6'){if(this[_0xdb0f('0x45')][_0x36506b['channel'][_0xdb0f('0x42')]('-')[0x0]]){this[_0xdb0f('0x1b')][_0x36506b['uniqueid']]['UserId']=this[_0xdb0f('0x45')][_0x36506b[_0xdb0f('0x41')]['split']('-')[0x0]]['id'];this['channels'][_0x36506b['uniqueid']][_0xdb0f('0x70')]=this[_0xdb0f('0x45')][_0x36506b[_0xdb0f('0x41')]['split']('-')[0x0]][_0xdb0f('0x4b')];}}}}if(_0x36506b[_0xdb0f('0x6e')]==='6'&&_0x36506b['context']==='from-sip'){if(this[_0xdb0f('0x45')][_0x36506b[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]]){this[_0xdb0f('0x45')][_0x36506b['channel']['split']('-')[0x0]][_0xdb0f('0x46')]=_0x36506b['exten'];var _0x23b87a;if(this['channels'][_0x36506b['uniqueid']])_0x23b87a=this[_0xdb0f('0x1b')][_0x36506b[_0xdb0f('0x38')]][_0xdb0f('0x71')];else if(this[_0xdb0f('0x1b')][_0x36506b[_0xdb0f('0x3c')]])_0x23b87a=this[_0xdb0f('0x1b')][_0x36506b['linkedid']][_0xdb0f('0x71')];logger[_0xdb0f('0x3a')](_0xdb0f('0x72'),_0x36506b[_0xdb0f('0x38')],util['inspect']({'destaccountcode':this[_0xdb0f('0x45')][_0x36506b[_0xdb0f('0x41')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x36506b[_0xdb0f('0x43')],'routealias':_0x23b87a},{'showHidden':![],'depth':null}));this['emit'](util[_0xdb0f('0x49')](_0xdb0f('0x4a'),this['agents'][_0x36506b[_0xdb0f('0x41')]['split']('-')[0x0]][_0xdb0f('0x4b')]),_0xdb0f('0x4c'),{'destaccountcode':this['agents'][_0x36506b[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]][_0xdb0f('0x4d')],'destconnectedlinenum':_0x36506b['exten'],'routealias':_0x23b87a});}}}}catch(_0x71ece1){logger[_0xdb0f('0x4e')]('[%s][voiceCallReport][newstate]',_0x36506b['uniqueid'],util['inspect'](_0x71ece1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdb0f('0x33')][_0xdb0f('0x73')]=function(_0x1ee2cb,_0x451f75){try{if(this[_0xdb0f('0x1b')][_0x1ee2cb]){logger[_0xdb0f('0x36')](_0xdb0f('0x74'),_0x1ee2cb,_0x451f75);this[_0xdb0f('0x1b')][_0x1ee2cb][_0xdb0f('0x75')]=!![];if(_[_0xdb0f('0x76')](_0x451f75,_0xdb0f('0x77'))){_0x451f75=_0x451f75[_0xdb0f('0x78')]('.wav49','.WAV');}this[_0xdb0f('0x1b')][_0x1ee2cb][_0xdb0f('0x79')]=_0x451f75;var _0x575221=_[_0xdb0f('0x7a')](this[_0xdb0f('0x1b')][_0x1ee2cb][_0xdb0f('0x7b')],{'filename':_0x451f75});if(_['isNil'](_0x575221)){this[_0xdb0f('0x1b')][_0x1ee2cb][_0xdb0f('0x7b')]['push']({'filename':_0x451f75,'createdAt':moment()[_0xdb0f('0x49')](_0xdb0f('0x53')),'mixmonitorid':'','status':_0xdb0f('0x7c')});}}}catch(_0x285712){logger['error'](_0xdb0f('0x7d'),_0x1ee2cb,util[_0xdb0f('0x32')](_0x285712,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdb0f('0x33')]['syncVarSet']=function(_0x26ee1c){try{if(this['isNotNull'](_0x26ee1c)){logger[_0xdb0f('0x3a')](_0xdb0f('0x7e'),_0x26ee1c[_0xdb0f('0x38')],util['inspect'](_0x26ee1c,{'showHidden':![],'depth':null}));if(this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x38')]]&&_0x26ee1c[_0xdb0f('0x41')]!=_0xdb0f('0x50')){if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')])){if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')][_0xdb0f('0x80')])){logger['info'](_0xdb0f('0x81'),_0x26ee1c[_0xdb0f('0x38')],_0x26ee1c['value']);this[_0xdb0f('0x73')](_0x26ee1c[_0xdb0f('0x38')],_0x26ee1c['value']);}else if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')][_0xdb0f('0x82')])){logger['info'](_0xdb0f('0x83'),_0x26ee1c['uniqueid'],_0x26ee1c[_0xdb0f('0x84')]);this[_0xdb0f('0x1b')][_0x26ee1c['uniqueid']][_0xdb0f('0x67')]=_0x26ee1c[_0xdb0f('0x84')];}else if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')]['xmd-callerid'])){logger[_0xdb0f('0x36')](_0xdb0f('0x85'),_0x26ee1c['uniqueid'],_0x26ee1c[_0xdb0f('0x84')]);this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x38')]][_0xdb0f('0x86')]=_0x26ee1c[_0xdb0f('0x84')];}else if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')][_0xdb0f('0x87')])){logger[_0xdb0f('0x36')](_0xdb0f('0x88'),_0x26ee1c[_0xdb0f('0x38')],_0x26ee1c['value']);this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x38')]][_0xdb0f('0x89')]=_0x26ee1c[_0xdb0f('0x84')];}else if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')][_0xdb0f('0x8a')])){logger[_0xdb0f('0x36')](_0xdb0f('0x8b'),_0x26ee1c[_0xdb0f('0x38')],_0x26ee1c[_0xdb0f('0x84')][_0xdb0f('0x42')](',')[0x0]);this['channels'][_0x26ee1c[_0xdb0f('0x38')]][_0xdb0f('0xf')]=_0x26ee1c['value'][_0xdb0f('0x42')](',')[0x0];}else if(this[_0xdb0f('0x34')](_0x26ee1c['variable'][_0xdb0f('0x8c')])){logger[_0xdb0f('0x36')](_0xdb0f('0x8d'),_0x26ee1c[_0xdb0f('0x38')],_0x26ee1c[_0xdb0f('0x84')]);this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x38')]][_0xdb0f('0x8e')]=_0x26ee1c[_0xdb0f('0x84')];}else if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')][_0xdb0f('0x8f')])){logger[_0xdb0f('0x36')](_0xdb0f('0x90'),_0x26ee1c['uniqueid'],_0x26ee1c['value']);this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x38')]][_0xdb0f('0x91')]=_0x26ee1c[_0xdb0f('0x84')];}else if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')]['xmd-callerid-preview'])){logger[_0xdb0f('0x36')](_0xdb0f('0x92'),_0x26ee1c[_0xdb0f('0x38')],_0x26ee1c[_0xdb0f('0x84')]);this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x38')]][_0xdb0f('0x93')]=_0x26ee1c['value'];}else if(this['isNotNull'](_0x26ee1c['variable'][_0xdb0f('0x94')])){logger[_0xdb0f('0x36')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x26ee1c[_0xdb0f('0x38')],_0x26ee1c[_0xdb0f('0x84')]);this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x38')]][_0xdb0f('0xf')]=_0x26ee1c[_0xdb0f('0x84')];}else if(this['isNotNull'](_0x26ee1c[_0xdb0f('0x7f')][_0xdb0f('0x95')])){logger[_0xdb0f('0x36')](_0xdb0f('0x96'),_0x26ee1c['uniqueid'],_0x26ee1c[_0xdb0f('0x84')]);this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x38')]]['sipcalluniqueid']=_0x26ee1c[_0xdb0f('0x84')];}}}else if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')][_0xdb0f('0x80')])){if(_0x26ee1c[_0xdb0f('0x84')]){var _0x4cc0f1=path[_0xdb0f('0x97')](_0x26ee1c['value'])[_0xdb0f('0x4b')];logger[_0xdb0f('0x36')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x4cc0f1,_0x26ee1c[_0xdb0f('0x84')]);this[_0xdb0f('0x73')](_0x4cc0f1,_0x26ee1c[_0xdb0f('0x84')]);}}else if(this[_0xdb0f('0x1b')][_0x26ee1c[_0xdb0f('0x3c')]]){if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')])){if(this[_0xdb0f('0x34')](_0x26ee1c[_0xdb0f('0x7f')][_0xdb0f('0x95')])){logger[_0xdb0f('0x36')](_0xdb0f('0x96'),_0x26ee1c[_0xdb0f('0x3c')],_0x26ee1c['value']);this[_0xdb0f('0x1b')][_0x26ee1c['linkedid']]['sipcalllinkedid']=_0x26ee1c[_0xdb0f('0x84')];}}}}}catch(_0x218dd1){logger[_0xdb0f('0x4e')]('[%s][voiceCallReport][varset]',_0x26ee1c['uniqueid'],util['inspect'](_0x218dd1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdb0f('0x33')][_0xdb0f('0x98')]=function(_0x14c349){try{if(this[_0xdb0f('0x34')](_0x14c349)){logger[_0xdb0f('0x3a')](_0xdb0f('0x99'),_0x14c349[_0xdb0f('0x38')],util[_0xdb0f('0x32')](_0x14c349,{'showHidden':![],'depth':null}));if(this['channels'][_0x14c349[_0xdb0f('0x38')]]){logger[_0xdb0f('0x36')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x14c349['uniqueid'],_0x14c349[_0xdb0f('0x9a')]);var _0x179c57=moment();this['channels'][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x9b')]=_0x179c57[_0xdb0f('0x49')](_0xdb0f('0x53'));this['channels'][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x60')]=_0x179c57[_0xdb0f('0x6a')](this[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x52')],_0xdb0f('0x6b'));if(this[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x9c')]){this[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]]['billableseconds']=_0x179c57[_0xdb0f('0x6a')](this['channels'][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x69')],_0xdb0f('0x6b'));this[_0xdb0f('0x1b')][_0x14c349['uniqueid']][_0xdb0f('0x9d')]=this[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x60')]-this[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]]['billableseconds'];}if(_0x14c349[_0xdb0f('0x3f')]===_0xdb0f('0x40')){if(this[_0xdb0f('0x45')][_0x14c349['channel'][_0xdb0f('0x42')]('-')[0x0]]){this[_0xdb0f('0x45')][_0x14c349['channel']['split']('-')[0x0]]=_[_0xdb0f('0x9e')](this[_0xdb0f('0x45')][_0x14c349[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]],['destconnectedlinenum']);logger[_0xdb0f('0x3a')](_0xdb0f('0x9f'),_0x14c349[_0xdb0f('0x38')],util[_0xdb0f('0x32')]({'id':this[_0xdb0f('0x45')][_0x14c349[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0xdb0f('0x45')][_0x14c349[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]][_0xdb0f('0x4d')]},{'showHidden':![],'depth':null}));this[_0xdb0f('0x48')](util[_0xdb0f('0x49')](_0xdb0f('0x4a'),this[_0xdb0f('0x45')][_0x14c349[_0xdb0f('0x41')]['split']('-')[0x0]][_0xdb0f('0x4b')]),_0xdb0f('0xa0'),{'id':this[_0xdb0f('0x45')][_0x14c349['channel'][_0xdb0f('0x42')]('-')[0x0]]['id'],'destaccountcode':this[_0xdb0f('0x45')][_0x14c349[_0xdb0f('0x41')][_0xdb0f('0x42')]('-')[0x0]][_0xdb0f('0x4d')]});}}var _0x47e2eb=this;Promise[_0xdb0f('0xa1')]()[_0xdb0f('0xa2')](function(){var _0x1a2f65=_0x47e2eb[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]];if(typeof _0x1a2f65[_0xdb0f('0xa3')]===_0xdb0f('0xa4'))return;if(_[_0xdb0f('0xa5')](_0x1a2f65['monitors']))return;return RpcSetting['getSettings']()[_0xdb0f('0xa2')](function(_0x1b59d0){if(!_0x1b59d0[_0xdb0f('0xa6')])return;return Promise['resolve']()[_0xdb0f('0xa2')](function(){return ami['Action']({'action':'StopMixMonitor','channel':_0x1a2f65[_0xdb0f('0x41')]})[_0xdb0f('0xa7')](function(){});})[_0xdb0f('0xa2')](function(){return ami[_0xdb0f('0xa8')]({'action':'StopMixMonitor','channel':_0x1a2f65[_0xdb0f('0x6d')]})[_0xdb0f('0xa7')](function(){})[_0xdb0f('0xa9')](function(){var _0x5c1db6=_0x47e2eb['agents'][_0x1a2f65[_0xdb0f('0x6d')][_0xdb0f('0x42')]('-')[0x0]];if(!_0x5c1db6)return;io[_0xdb0f('0x48')]('webbar:stopmonitors',{'agentId':_0x5c1db6['id'],'uniqueid':_0x1a2f65[_0xdb0f('0x38')]});});});});})[_0xdb0f('0xa2')](function(){if(_0x14c349[_0xdb0f('0xaa')]===_0xdb0f('0xab')){_0x47e2eb[_0xdb0f('0x1c')][_0x14c349['uniqueid']]=_0x47e2eb[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]];}else{if(_0x47e2eb[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x89')]==='outbound'&&_0x47e2eb[_0xdb0f('0x1c')][_0x14c349[_0xdb0f('0x38')]]){_0x47e2eb[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x38')]=[_0x47e2eb[_0xdb0f('0x1b')][_0x14c349['uniqueid']][_0xdb0f('0x3c')],_0x47e2eb['channels'][_0x14c349[_0xdb0f('0x38')]]['linkedid']=_0x47e2eb[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]][_0xdb0f('0x38')]][0x0];delete _0x47e2eb['blindTransfers'][_0x14c349[_0xdb0f('0x38')]];}}logger[_0xdb0f('0x3a')](_0xdb0f('0xac'),_0x14c349[_0xdb0f('0x38')],util['inspect'](_0x47e2eb[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]],{'showHidden':![],'depth':null}));ami[_0xdb0f('0x48')](_0xdb0f('0xad'),_0x47e2eb[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]]);delete _0x47e2eb[_0xdb0f('0x1b')][_0x14c349[_0xdb0f('0x38')]];});}}}catch(_0x3170ea){logger[_0xdb0f('0x4e')](_0xdb0f('0xae'),_0x14c349[_0xdb0f('0x38')],util['inspect'](_0x3170ea,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdb0f('0x33')][_0xdb0f('0x2b')]=function(_0x72fd35){try{if(this[_0xdb0f('0x34')](_0x72fd35)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x72fd35[_0xdb0f('0x38')],_0x72fd35['origtransferercalleridnum'],_0x72fd35[_0xdb0f('0xaf')]);logger[_0xdb0f('0x3a')](_0xdb0f('0xb0'),_0x72fd35['uniqueid'],util['inspect'](_0x72fd35,{'showHidden':![],'depth':null}));if(this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb1')]]){this['channels'][_0x72fd35[_0xdb0f('0xb1')]]['transfercalleridnum']=_0x72fd35[_0xdb0f('0xb2')];this['channels'][_0x72fd35[_0xdb0f('0xb1')]][_0xdb0f('0xb3')]=_0x72fd35[_0xdb0f('0xaf')];if(this[_0xdb0f('0x1b')][_0x72fd35['secondtransfereruniqueid']]){var _0x16965f=this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb4')]];this[_0xdb0f('0x1b')][_0x72fd35['secondtransfereruniqueid']]=this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb1')]];this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb1')]]=_0x16965f;}}else if(this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb5')]]){this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb5')]][_0xdb0f('0xb6')]=_0x72fd35[_0xdb0f('0xb2')];this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb5')]][_0xdb0f('0xb3')]=_0x72fd35[_0xdb0f('0xaf')];if(this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb7')]]){var _0x16965f=this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb7')]];this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb7')]]=this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb5')]];this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb5')]]=_0x16965f;}}if((this['channels'][_0x72fd35[_0xdb0f('0xb7')]]||this['channels'][_0x72fd35[_0xdb0f('0xb8')]])&&this['channels'][_0x72fd35[_0xdb0f('0xb4')]]){var _0x3615d8=_['some']([this[_0xdb0f('0x1b')][_0x72fd35['origtransfereruniqueid']],this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb8')]],this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb4')]]],function(_0x71e47){return _0x71e47&&_0x71e47['type']==='outbound'&&_0x71e47[_0xdb0f('0xb9')];});if(_0x3615d8){if(this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb7')]])this['channels'][_0x72fd35['origtransfereruniqueid']][_0xdb0f('0xa3')]=_0xdb0f('0xba');if(this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb8')]])this[_0xdb0f('0x1b')][_0x72fd35[_0xdb0f('0xb8')]][_0xdb0f('0xa3')]=_0xdb0f('0xba');this['channels'][_0x72fd35[_0xdb0f('0xb4')]]['transferType']=_0xdb0f('0xba');}}}}catch(_0x11182a){logger[_0xdb0f('0x4e')](_0xdb0f('0xbb'),_0x72fd35['uniqueid'],util[_0xdb0f('0x32')](_0x11182a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncBlindTransfer']=function(_0x3ea631){try{if(this['isNotNull'](_0x3ea631)){logger['info'](_0xdb0f('0xbc'),_0x3ea631[_0xdb0f('0x38')],_0x3ea631[_0xdb0f('0xbd')],_0x3ea631[_0xdb0f('0xbe')]);logger[_0xdb0f('0x3a')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x3ea631[_0xdb0f('0x38')],util[_0xdb0f('0x32')](_0x3ea631,{'showHidden':![],'depth':null}));if(this[_0xdb0f('0x1b')][_0x3ea631[_0xdb0f('0xb1')]]){this['channels'][_0x3ea631['transfereeuniqueid']]['transfercalleridnum']=_0x3ea631['transfereecalleridnum'];this['channels'][_0x3ea631[_0xdb0f('0xb1')]][_0xdb0f('0xb3')]=_0x3ea631['extension'];this['channels'][_0x3ea631[_0xdb0f('0xb1')]][_0xdb0f('0xa3')]=_0xdb0f('0xbf');this[_0xdb0f('0x98')]({'event':'BlindTransfer','uniqueid':_0x3ea631[_0xdb0f('0xb1')],'context':_0x3ea631[_0xdb0f('0x3f')],'channel':_0x3ea631['transfererchannel']});}else{this['channels'][_0x3ea631['transfereruniqueid']][_0xdb0f('0xa3')]='BLIND';}}}catch(_0x6a23be){logger[_0xdb0f('0x4e')](_0xdb0f('0xc0'),_0x3ea631[_0xdb0f('0x38')],util[_0xdb0f('0x32')](_0x6a23be,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xdb0f('0x33')][_0xdb0f('0x2e')]=function(_0x416fad){try{if(this[_0xdb0f('0x34')](_0x416fad)){logger[_0xdb0f('0x3a')](_0xdb0f('0xc1'),_0x416fad[_0xdb0f('0x38')],util[_0xdb0f('0x32')](_0x416fad,{'showHidden':![],'depth':null}));if(this[_0xdb0f('0x1b')][_0x416fad['uniqueid']]){if(!_['isNil'](this[_0xdb0f('0x1b')][_0x416fad[_0xdb0f('0x38')]][_0xdb0f('0x69')])){this[_0xdb0f('0x1b')][_0x416fad['uniqueid']][_0xdb0f('0xc2')]=moment()[_0xdb0f('0x49')](_0xdb0f('0x53'));logger[_0xdb0f('0x36')](_0xdb0f('0xc3'),_0x416fad[_0xdb0f('0x38')],this['channels'][_0x416fad[_0xdb0f('0x38')]]['mohstarttime']);}}}}catch(_0x142178){logger[_0xdb0f('0x4e')]('[%s][voiceCallReport][musiconholdstart]',_0x416fad[_0xdb0f('0x38')],util['inspect'](_0x142178,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x2edbf8){try{if(this['isNotNull'](_0x2edbf8)){logger[_0xdb0f('0x3a')](_0xdb0f('0xc4'),_0x2edbf8['uniqueid'],util[_0xdb0f('0x32')](_0x2edbf8,{'showHidden':![],'depth':null}));if(this[_0xdb0f('0x1b')][_0x2edbf8['uniqueid']]){if(!_['isNil'](this[_0xdb0f('0x1b')][_0x2edbf8[_0xdb0f('0x38')]][_0xdb0f('0xc2')])){this[_0xdb0f('0x1b')][_0x2edbf8[_0xdb0f('0x38')]]['mohtime']+=moment()[_0xdb0f('0xc5')](0x0)[_0xdb0f('0x6a')](this[_0xdb0f('0x1b')][_0x2edbf8[_0xdb0f('0x38')]][_0xdb0f('0xc2')],_0xdb0f('0x6b'));logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x2edbf8['uniqueid'],this[_0xdb0f('0x1b')][_0x2edbf8['uniqueid']][_0xdb0f('0xc6')]);delete this[_0xdb0f('0x1b')][_0x2edbf8['uniqueid']][_0xdb0f('0xc2')];}}}}catch(_0xcffba1){logger['error'](_0xdb0f('0xc7'),_0x2edbf8[_0xdb0f('0x38')],util[_0xdb0f('0x32')](_0xcffba1,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 0a29366..52b6e6d 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 _0x9daf=['lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','outboundrouteid','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','duration','endtime','starttime','seconds','answered','holdtime','diff','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outbound','applications','dialbegin','bind','dialend','varset','newexten','syncNewExten','syncHangup','prototype','isNotNull','isUndefined','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','called','channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4c4ab6,_0x67ee9b){var _0x386bdd=function(_0x5189f5){while(--_0x5189f5){_0x4c4ab6['push'](_0x4c4ab6['shift']());}};_0x386bdd(++_0x67ee9b);}(_0x9daf,0xbf));var _0xf9da=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0x9daf[_0x3ad7ad];return _0x225a60;};'use strict';var _=require(_0xf9da('0x0'));var moment=require(_0xf9da('0x1'));var util=require(_0xf9da('0x2'));var Redis=require(_0xf9da('0x3'));var config=require(_0xf9da('0x4'));var logger=require(_0xf9da('0x5'))(_0xf9da('0x6'));var ami=require(_0xf9da('0x7'));config[_0xf9da('0x8')]=_['defaults'](config[_0xf9da('0x8')],{'host':_0xf9da('0x9'),'port':0x18eb});var io=require(_0xf9da('0xa'))(new Redis(config[_0xf9da('0x8')]));function VoiceDialReport(_0x28be5d){this[_0xf9da('0xb')]=_0x28be5d['outboundChannels'];this[_0xf9da('0xc')]=_0x28be5d[_0xf9da('0xc')];this[_0xf9da('0xd')]={};this['variables']={};ami['on'](_0xf9da('0xe'),this['syncDialBegin'][_0xf9da('0xf')](this));ami['on'](_0xf9da('0x10'),this['syncDialEnd'][_0xf9da('0xf')](this));ami['on'](_0xf9da('0x11'),this['syncVarSet']['bind'](this));ami['on'](_0xf9da('0x12'),this[_0xf9da('0x13')][_0xf9da('0xf')](this));ami['on']('hangup',this[_0xf9da('0x14')][_0xf9da('0xf')](this));}VoiceDialReport[_0xf9da('0x15')][_0xf9da('0x16')]=function(_0x741605){return _0x741605!==null&&!_[_0xf9da('0x17')](_0x741605);};VoiceDialReport[_0xf9da('0x15')][_0xf9da('0x18')]=function(_0x74aa19,_0xb3f573,_0x5ee2da){io['to'](_0x74aa19)[_0xf9da('0x18')](_0xb3f573,_0x5ee2da);};VoiceDialReport['prototype'][_0xf9da('0x19')]=function(_0x9ea3a7){try{if(this[_0xf9da('0x16')](_0x9ea3a7)){logger[_0xf9da('0x1a')](_0xf9da('0x1b'),_0x9ea3a7[_0xf9da('0x1c')],util[_0xf9da('0x1d')](_0x9ea3a7,{'showHidden':![],'depth':null}));if(this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]]){_[_0xf9da('0x1e')](this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xf9da('0x1f'),'interface':_0x9ea3a7[_0xf9da('0x20')][_0xf9da('0x21')](0x0,_0x9ea3a7[_0xf9da('0x20')]['lastIndexOf']('-')),'membername':_0x9ea3a7['channel'][_0xf9da('0x21')](_0x9ea3a7['channel'][_0xf9da('0x22')]('/')+0x1,_0x9ea3a7[_0xf9da('0x20')][_0xf9da('0x22')]('-'))},_[_0xf9da('0x23')](_0x9ea3a7,[_0xf9da('0x24'),_0xf9da('0x25')]));logger[_0xf9da('0x26')](_0xf9da('0x27'),_0x9ea3a7[_0xf9da('0x1c')],this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]]['membername'],this['channels'][_0x9ea3a7['uniqueid']][_0xf9da('0x28')]);logger['debug'](_0xf9da('0x29'),_0x9ea3a7['uniqueid'],util[_0xf9da('0x1d')](this['channels'][_0x9ea3a7[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0xf9da('0xd')][_0x9ea3a7['uniqueid']])_[_0xf9da('0x1e')](this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]],this[_0xf9da('0xd')][_0x9ea3a7[_0xf9da('0x1c')]]);this[_0xf9da('0x18')](_0xf9da('0x2a'),_0xf9da('0x2b'),this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]]);logger[_0xf9da('0x1a')](_0xf9da('0x2c'),_0x9ea3a7['uniqueid'],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xf9da('0x18')](_0xf9da('0x2d'),this[_0xf9da('0xb')][_0x9ea3a7[_0xf9da('0x1c')]]);}}}catch(_0x41fae4){logger[_0xf9da('0x2e')]('[%s][voiceDialReport][dialbegin]',_0x9ea3a7['uniqueid'],util[_0xf9da('0x1d')](_0x41fae4,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf9da('0x15')][_0xf9da('0x2f')]=function(_0x250120){try{if(this['isNotNull'](_0x250120)){logger[_0xf9da('0x1a')]('[%s][voiceDialReport][dialend]\x20event:',_0x250120['uniqueid'],util[_0xf9da('0x1d')](_0x250120,{'showHidden':![],'depth':null}));if(this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]]){this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]][_0xf9da('0x30')]=_0x250120[_0xf9da('0x30')];if(_0x250120['dialstatus']===_0xf9da('0x31')){this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]][_0xf9da('0x32')]=_0x250120['connectedlinenum'];this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]]['connectedlinename']=_0x250120[_0xf9da('0x33')];this[_0xf9da('0xb')][_0x250120['uniqueid']][_0xf9da('0x34')]=moment()[_0xf9da('0x35')](_0xf9da('0x36'));this['channels'][_0x250120[_0xf9da('0x1c')]][_0xf9da('0x37')]=_0xf9da('0x38');logger[_0xf9da('0x26')](_0xf9da('0x39'),_0x250120[_0xf9da('0x1c')],_0x250120[_0xf9da('0x20')][_0xf9da('0x21')](_0x250120[_0xf9da('0x20')]['lastIndexOf']('/')+0x1,_0x250120[_0xf9da('0x20')][_0xf9da('0x22')]('-')));logger[_0xf9da('0x1a')](_0xf9da('0x3a'),_0x250120[_0xf9da('0x1c')],util['inspect'](this[_0xf9da('0xb')][_0x250120['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xf9da('0x18')](_0xf9da('0x3b'),this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]]);}logger[_0xf9da('0x1a')](_0xf9da('0x3c'),_0x250120[_0xf9da('0x1c')],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x250120['uniqueid']],{'showHidden':![],'depth':null}));this[_0xf9da('0x18')](_0xf9da('0x2a'),_0xf9da('0x2b'),this[_0xf9da('0xb')][_0x250120[_0xf9da('0x1c')]]);}}}catch(_0x52fee6){logger['error'](_0xf9da('0x3d'),_0x250120['uniqueid'],util[_0xf9da('0x1d')](_0x52fee6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf9da('0x15')]['syncVarSet']=function(_0x4cbb36){try{if(this['isNotNull'](_0x4cbb36)){logger[_0xf9da('0x1a')](_0xf9da('0x3e'),_0x4cbb36['uniqueid'],util['inspect'](_0x4cbb36,{'showHidden':![],'depth':null}));this[_0xf9da('0x3f')](_0x4cbb36[_0xf9da('0x1c')],_[_0xf9da('0x40')](_0x4cbb36['variable'])[0x0],_0x4cbb36[_0xf9da('0x41')]);if(this[_0xf9da('0x16')](_0x4cbb36[_0xf9da('0x42')])&&this['isNotNull'](_0x4cbb36['variable'][_0xf9da('0x43')])){if(_['isUndefined'](this[_0xf9da('0xb')][_0x4cbb36[_0xf9da('0x1c')]])){this['channels'][_0x4cbb36[_0xf9da('0x1c')]]={'routeId':_0x4cbb36[_0xf9da('0x41')],'variables':this[_0xf9da('0x44')][_0x4cbb36[_0xf9da('0x1c')]],'motionChannel':'voice'};logger['info'](_0xf9da('0x45'),_0x4cbb36['uniqueid'],_0x4cbb36['variable'][_0xf9da('0x43')],_[_0xf9da('0x40')](_0x4cbb36[_0xf9da('0x42')])[0x0],_0x4cbb36[_0xf9da('0x41')]);logger[_0xf9da('0x1a')](_0xf9da('0x46'),_0x4cbb36[_0xf9da('0x1c')],util['inspect'](this[_0xf9da('0xb')][_0x4cbb36[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf9da('0x18')](_0xf9da('0x2a'),_0xf9da('0x2b'),this[_0xf9da('0xb')][_0x4cbb36[_0xf9da('0x1c')]]);}}}}catch(_0x1b6912){logger[_0xf9da('0x2e')](_0xf9da('0x47'),_0x4cbb36[_0xf9da('0x1c')],util[_0xf9da('0x1d')](_0x1b6912,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xf9da('0x3f')]=function(_0x4f3cda,_0x1b6379,_0x1435e7){var _0x1022ac=[_0xf9da('0x48'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xf9da('0x49'),_0xf9da('0x4a'),_0xf9da('0x4b'),_0xf9da('0x4c'),_0xf9da('0x4d'),_0xf9da('0x4e'),_0xf9da('0x4f'),'bridgepeer',_0xf9da('0x50'),'membercalls','memberdynamic',_0xf9da('0x51'),_0xf9da('0x52'),_0xf9da('0x53'),_0xf9da('0x54'),'memberrealtime'];if(!_[_0xf9da('0x55')](_0x1b6379)&&!_[_0xf9da('0x56')](_0x1022ac,_0x1b6379)){if(_[_0xf9da('0x17')](this[_0xf9da('0x44')][_0x4f3cda])){this[_0xf9da('0x44')][_0x4f3cda]={};}this['variables'][_0x4f3cda][_0x1b6379]=_0x1435e7;}};VoiceDialReport[_0xf9da('0x15')][_0xf9da('0x14')]=function(_0x4ed735){try{if(this['isNotNull'](_0x4ed735)){logger[_0xf9da('0x1a')](_0xf9da('0x57'),_0x4ed735[_0xf9da('0x1c')],util['inspect'](_0x4ed735,{'showHidden':![],'depth':null}));if(this['channels'][_0x4ed735[_0xf9da('0x1c')]]){logger[_0xf9da('0x26')](_0xf9da('0x58'),_0x4ed735[_0xf9da('0x1c')],_0x4ed735[_0xf9da('0x59')]);this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]]['endtime']=moment()['format'](_0xf9da('0x36'));this[_0xf9da('0xb')][_0x4ed735['uniqueid']][_0xf9da('0x5a')]=moment(this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5b')])['diff'](this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5c')],_0xf9da('0x5d'));this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x37')]='complete';this['outbound']['total']+=0x1;if(this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x34')]){this[_0xf9da('0xc')][_0xf9da('0x5e')]+=0x1;this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5f')]=moment(this[_0xf9da('0xb')][_0x4ed735['uniqueid']][_0xf9da('0x34')])[_0xf9da('0x60')](this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5c')],_0xf9da('0x5d'));this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x61')]=moment(this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]]['endtime'])[_0xf9da('0x60')](this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x34')],_0xf9da('0x5d'));this[_0xf9da('0xc')][_0xf9da('0x62')]+=this['channels'][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x5f')]||0x0;this[_0xf9da('0xc')][_0xf9da('0x63')]+=this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]][_0xf9da('0x61')];}this[_0xf9da('0xc')][_0xf9da('0x64')]+=this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]]['duration'];logger[_0xf9da('0x1a')](_0xf9da('0x65'),_0x4ed735['uniqueid'],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xf9da('0x18')](_0xf9da('0x66'),this[_0xf9da('0xb')][_0x4ed735['uniqueid']]);logger['debug'](_0xf9da('0x67'),_0x4ed735[_0xf9da('0x1c')],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x4ed735['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xf9da('0x18')](_0xf9da('0x68'),this[_0xf9da('0xb')][_0x4ed735['uniqueid']]);logger[_0xf9da('0x1a')](_0xf9da('0x69'),_0x4ed735['uniqueid'],util[_0xf9da('0x1d')](this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf9da('0x18')]('voice:outbound',_0xf9da('0x6a'),this[_0xf9da('0xc')]);logger[_0xf9da('0x26')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xf9da('0x6b')](this[_0xf9da('0xb')][_0x4ed735['uniqueid']]));logger[_0xf9da('0x1a')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x4ed735['uniqueid'],util['inspect'](this['channels'][_0x4ed735[_0xf9da('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf9da('0x18')](_0xf9da('0x2a'),_0xf9da('0x6c'),this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]]);delete this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x1c')]];}else if(this['channels'][_0x4ed735['linkedid']]){this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x6d')]][_0xf9da('0x1c')]=this[_0xf9da('0xb')][_0x4ed735[_0xf9da('0x6d')]][_0xf9da('0x6e')];}if(this[_0xf9da('0x44')][_0x4ed735[_0xf9da('0x1c')]]){delete this[_0xf9da('0x44')][_0x4ed735[_0xf9da('0x1c')]];}}}catch(_0x1c0fa1){logger[_0xf9da('0x2e')](_0xf9da('0x6f'),_0x4ed735[_0xf9da('0x1c')],util['inspect'](_0x1c0fa1,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xf9da('0x13')]=function(_0x2fa4b8){try{if(this[_0xf9da('0x16')](_0x2fa4b8)){logger['debug'](_0xf9da('0x70'),_0x2fa4b8[_0xf9da('0x1c')],util[_0xf9da('0x1d')](_0x2fa4b8,{'showHidden':![],'depth':null}));if(_0x2fa4b8[_0xf9da('0x71')][_0xf9da('0x72')]()==='set'){_0x2fa4b8[_0xf9da('0x73')]=(_0x2fa4b8[_0xf9da('0x74')]||_0x2fa4b8[_0xf9da('0x73')])['toLowerCase']();if(_[_0xf9da('0x75')](_0x2fa4b8[_0xf9da('0x73')],_0xf9da('0x76'))){if(_[_0xf9da('0x17')](this[_0xf9da('0xd')][_0x2fa4b8[_0xf9da('0x1c')]]))this[_0xf9da('0xd')][_0x2fa4b8[_0xf9da('0x1c')]]={};logger[_0xf9da('0x26')](_0xf9da('0x77'),_0x2fa4b8['uniqueid'],_0x2fa4b8[_0xf9da('0x71')],_0x2fa4b8['applicationdata']);var _0x2c9500=_0x2fa4b8[_0xf9da('0x73')][_0xf9da('0x78')]('=');var _0x2159ea=_0x2c9500[0x0][_0xf9da('0x79')](/cdr\((.*)\)/);if(_0x2159ea)this[_0xf9da('0xd')][_0x2fa4b8['uniqueid']][_0x2159ea[0x1]]=_0x2c9500[0x1];}}}}catch(_0x3c3ccd){logger[_0xf9da('0x2e')](_0xf9da('0x7a'),_0x2fa4b8[_0xf9da('0x1c')],util[_0xf9da('0x1d')](_0x3c3ccd,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0xeec4=['error','[%s][voiceDialReport][dialend]','isNotNull','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','outboundrouteid','isUndefined','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','duration','diff','starttime','seconds','lastevent','complete','answered','holdtime','billableseconds','sumBillable','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','toLowerCase','set','applicationdata','appdata','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','bind','syncDialEnd','syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','privilege','info','membername','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:'];(function(_0x582585,_0x477138){var _0x28c639=function(_0x1f0ebe){while(--_0x1f0ebe){_0x582585['push'](_0x582585['shift']());}};_0x28c639(++_0x477138);}(_0xeec4,0x126));var _0x4eec=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0xeec4[_0x25cd2c];return _0x1e364c;};'use strict';var _=require(_0x4eec('0x0'));var moment=require(_0x4eec('0x1'));var util=require(_0x4eec('0x2'));var Redis=require(_0x4eec('0x3'));var config=require(_0x4eec('0x4'));var logger=require(_0x4eec('0x5'))(_0x4eec('0x6'));var ami=require(_0x4eec('0x7'));config[_0x4eec('0x8')]=_[_0x4eec('0x9')](config[_0x4eec('0x8')],{'host':_0x4eec('0xa'),'port':0x18eb});var io=require(_0x4eec('0xb'))(new Redis(config['redis']));function VoiceDialReport(_0x3e1eab){this[_0x4eec('0xc')]=_0x3e1eab[_0x4eec('0xd')];this[_0x4eec('0xe')]=_0x3e1eab[_0x4eec('0xe')];this[_0x4eec('0xf')]={};this[_0x4eec('0x10')]={};ami['on']('dialbegin',this[_0x4eec('0x11')][_0x4eec('0x12')](this));ami['on']('dialend',this[_0x4eec('0x13')][_0x4eec('0x12')](this));ami['on']('varset',this[_0x4eec('0x14')][_0x4eec('0x12')](this));ami['on'](_0x4eec('0x15'),this[_0x4eec('0x16')]['bind'](this));ami['on'](_0x4eec('0x17'),this[_0x4eec('0x18')][_0x4eec('0x12')](this));}VoiceDialReport[_0x4eec('0x19')]['isNotNull']=function(_0x8d05b2){return _0x8d05b2!==null&&!_['isUndefined'](_0x8d05b2);};VoiceDialReport[_0x4eec('0x19')]['emit']=function(_0x2f657b,_0x2af1fa,_0x3fc6d1){io['to'](_0x2f657b)[_0x4eec('0x1a')](_0x2af1fa,_0x3fc6d1);};VoiceDialReport[_0x4eec('0x19')][_0x4eec('0x11')]=function(_0x2e92d6){try{if(this['isNotNull'](_0x2e92d6)){logger[_0x4eec('0x1b')](_0x4eec('0x1c'),_0x2e92d6['uniqueid'],util[_0x4eec('0x1d')](_0x2e92d6,{'showHidden':![],'depth':null}));if(this['channels'][_0x2e92d6[_0x4eec('0x1e')]]){_[_0x4eec('0x1f')](this[_0x4eec('0xc')][_0x2e92d6[_0x4eec('0x1e')]],{'starttime':moment()['format'](_0x4eec('0x20')),'lastevent':_0x4eec('0x21'),'interface':_0x2e92d6[_0x4eec('0x22')][_0x4eec('0x23')](0x0,_0x2e92d6[_0x4eec('0x22')][_0x4eec('0x24')]('-')),'membername':_0x2e92d6['channel'][_0x4eec('0x23')](_0x2e92d6[_0x4eec('0x22')][_0x4eec('0x24')]('/')+0x1,_0x2e92d6[_0x4eec('0x22')][_0x4eec('0x24')]('-'))},_['omit'](_0x2e92d6,['event',_0x4eec('0x25')]));logger[_0x4eec('0x26')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x2e92d6['uniqueid'],this[_0x4eec('0xc')][_0x2e92d6[_0x4eec('0x1e')]][_0x4eec('0x27')],this[_0x4eec('0xc')][_0x2e92d6['uniqueid']]['interface']);logger[_0x4eec('0x1b')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2e92d6[_0x4eec('0x1e')],util[_0x4eec('0x1d')](this['channels'][_0x2e92d6[_0x4eec('0x1e')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x2e92d6[_0x4eec('0x1e')]])_[_0x4eec('0x1f')](this[_0x4eec('0xc')][_0x2e92d6[_0x4eec('0x1e')]],this[_0x4eec('0xf')][_0x2e92d6[_0x4eec('0x1e')]]);this[_0x4eec('0x1a')](_0x4eec('0x28'),_0x4eec('0x29'),this[_0x4eec('0xc')][_0x2e92d6[_0x4eec('0x1e')]]);logger['debug'](_0x4eec('0x2a'),_0x2e92d6[_0x4eec('0x1e')],util[_0x4eec('0x1d')](this['channels'][_0x2e92d6[_0x4eec('0x1e')]],{'showHidden':![],'depth':null}));ami[_0x4eec('0x1a')](_0x4eec('0x2b'),this[_0x4eec('0xc')][_0x2e92d6['uniqueid']]);}}}catch(_0x9f9b67){logger['error'](_0x4eec('0x2c'),_0x2e92d6[_0x4eec('0x1e')],util[_0x4eec('0x1d')](_0x9f9b67,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4eec('0x19')][_0x4eec('0x13')]=function(_0xb13a11){try{if(this['isNotNull'](_0xb13a11)){logger[_0x4eec('0x1b')]('[%s][voiceDialReport][dialend]\x20event:',_0xb13a11['uniqueid'],util['inspect'](_0xb13a11,{'showHidden':![],'depth':null}));if(this[_0x4eec('0xc')][_0xb13a11[_0x4eec('0x1e')]]){this[_0x4eec('0xc')][_0xb13a11['uniqueid']][_0x4eec('0x2d')]=_0xb13a11['dialstatus'];if(_0xb13a11[_0x4eec('0x2d')]==='ANSWER'){this['channels'][_0xb13a11[_0x4eec('0x1e')]][_0x4eec('0x2e')]=_0xb13a11[_0x4eec('0x2e')];this[_0x4eec('0xc')][_0xb13a11[_0x4eec('0x1e')]]['connectedlinename']=_0xb13a11[_0x4eec('0x2f')];this[_0x4eec('0xc')][_0xb13a11[_0x4eec('0x1e')]][_0x4eec('0x30')]=moment()['format'](_0x4eec('0x20'));this[_0x4eec('0xc')][_0xb13a11[_0x4eec('0x1e')]]['lastevent']=_0x4eec('0x31');logger['info'](_0x4eec('0x32'),_0xb13a11[_0x4eec('0x1e')],_0xb13a11[_0x4eec('0x22')][_0x4eec('0x23')](_0xb13a11[_0x4eec('0x22')][_0x4eec('0x24')]('/')+0x1,_0xb13a11[_0x4eec('0x22')][_0x4eec('0x24')]('-')));logger[_0x4eec('0x1b')](_0x4eec('0x33'),_0xb13a11[_0x4eec('0x1e')],util[_0x4eec('0x1d')](this[_0x4eec('0xc')][_0xb13a11[_0x4eec('0x1e')]],{'showHidden':![],'depth':null}));ami[_0x4eec('0x1a')](_0x4eec('0x34'),this[_0x4eec('0xc')][_0xb13a11[_0x4eec('0x1e')]]);}logger[_0x4eec('0x1b')](_0x4eec('0x35'),_0xb13a11[_0x4eec('0x1e')],util[_0x4eec('0x1d')](this[_0x4eec('0xc')][_0xb13a11[_0x4eec('0x1e')]],{'showHidden':![],'depth':null}));this[_0x4eec('0x1a')](_0x4eec('0x28'),_0x4eec('0x29'),this['channels'][_0xb13a11['uniqueid']]);}}}catch(_0x3250f8){logger[_0x4eec('0x36')](_0x4eec('0x37'),_0xb13a11['uniqueid'],util['inspect'](_0x3250f8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4eec('0x19')][_0x4eec('0x14')]=function(_0x169d29){try{if(this[_0x4eec('0x38')](_0x169d29)){logger[_0x4eec('0x1b')](_0x4eec('0x39'),_0x169d29[_0x4eec('0x1e')],util['inspect'](_0x169d29,{'showHidden':![],'depth':null}));this[_0x4eec('0x3a')](_0x169d29['uniqueid'],_[_0x4eec('0x3b')](_0x169d29['variable'])[0x0],_0x169d29[_0x4eec('0x3c')]);if(this['isNotNull'](_0x169d29['variable'])&&this[_0x4eec('0x38')](_0x169d29[_0x4eec('0x3d')][_0x4eec('0x3e')])){if(_[_0x4eec('0x3f')](this[_0x4eec('0xc')][_0x169d29['uniqueid']])){this['channels'][_0x169d29[_0x4eec('0x1e')]]={'routeId':_0x169d29[_0x4eec('0x3c')],'variables':this[_0x4eec('0x10')][_0x169d29['uniqueid']],'motionChannel':_0x4eec('0x40')};logger['info'](_0x4eec('0x41'),_0x169d29[_0x4eec('0x1e')],_0x169d29[_0x4eec('0x3d')][_0x4eec('0x3e')],_[_0x4eec('0x3b')](_0x169d29[_0x4eec('0x3d')])[0x0],_0x169d29['value']);logger['debug']('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x169d29[_0x4eec('0x1e')],util[_0x4eec('0x1d')](this[_0x4eec('0xc')][_0x169d29[_0x4eec('0x1e')]],{'showHidden':![],'depth':null}));this[_0x4eec('0x1a')](_0x4eec('0x28'),_0x4eec('0x29'),this[_0x4eec('0xc')][_0x169d29['uniqueid']]);}}}}catch(_0x4ba122){logger['error'](_0x4eec('0x42'),_0x169d29[_0x4eec('0x1e')],util[_0x4eec('0x1d')](_0x4ba122,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x4eec('0x19')][_0x4eec('0x3a')]=function(_0x426363,_0xe911e3,_0x488ec6){var _0x54cb39=['rtpaudioqos',_0x4eec('0x43'),_0x4eec('0x44'),_0x4eec('0x45'),_0x4eec('0x46'),_0x4eec('0x47'),_0x4eec('0x48'),'rtpaudioqosrttbridged',_0x4eec('0x49'),_0x4eec('0x4a'),_0x4eec('0x4b'),_0x4eec('0x4c'),_0x4eec('0x4d'),_0x4eec('0x4e'),_0x4eec('0x4f'),_0x4eec('0x50'),_0x4eec('0x27'),'memberpenalty',_0x4eec('0x51')];if(!_['isNil'](_0xe911e3)&&!_[_0x4eec('0x52')](_0x54cb39,_0xe911e3)){if(_[_0x4eec('0x3f')](this[_0x4eec('0x10')][_0x426363])){this[_0x4eec('0x10')][_0x426363]={};}this[_0x4eec('0x10')][_0x426363][_0xe911e3]=_0x488ec6;}};VoiceDialReport[_0x4eec('0x19')][_0x4eec('0x18')]=function(_0x5bb0ec){try{if(this['isNotNull'](_0x5bb0ec)){logger['debug'](_0x4eec('0x53'),_0x5bb0ec['uniqueid'],util[_0x4eec('0x1d')](_0x5bb0ec,{'showHidden':![],'depth':null}));if(this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]]){logger[_0x4eec('0x26')](_0x4eec('0x54'),_0x5bb0ec[_0x4eec('0x1e')],_0x5bb0ec['cause-txt']);this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x55')]=moment()['format'](_0x4eec('0x20'));this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x56')]=moment(this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x55')])[_0x4eec('0x57')](this['channels'][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x58')],_0x4eec('0x59'));this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x5a')]=_0x4eec('0x5b');this[_0x4eec('0xe')]['total']+=0x1;if(this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]]['answertime']){this[_0x4eec('0xe')][_0x4eec('0x5c')]+=0x1;this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x5d')]=moment(this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x30')])[_0x4eec('0x57')](this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x58')],_0x4eec('0x59'));this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x5e')]=moment(this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x55')])['diff'](this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x30')],_0x4eec('0x59'));this[_0x4eec('0xe')]['sumHoldTime']+=this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x5d')]||0x0;this[_0x4eec('0xe')][_0x4eec('0x5f')]+=this[_0x4eec('0xc')][_0x5bb0ec['uniqueid']][_0x4eec('0x5e')];}this[_0x4eec('0xe')][_0x4eec('0x60')]+=this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]][_0x4eec('0x56')];logger[_0x4eec('0x1b')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x5bb0ec[_0x4eec('0x1e')],util[_0x4eec('0x1d')](this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]],{'showHidden':![],'depth':null}));ami[_0x4eec('0x1a')](_0x4eec('0x61'),this['channels'][_0x5bb0ec[_0x4eec('0x1e')]]);logger[_0x4eec('0x1b')](_0x4eec('0x62'),_0x5bb0ec[_0x4eec('0x1e')],util['inspect'](this['channels'][_0x5bb0ec['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x4eec('0x1a')]('custom:dialend',this['channels'][_0x5bb0ec[_0x4eec('0x1e')]]);logger['debug'](_0x4eec('0x63'),_0x5bb0ec[_0x4eec('0x1e')],util[_0x4eec('0x1d')](this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]],{'showHidden':![],'depth':null}));this[_0x4eec('0x1a')](_0x4eec('0x28'),_0x4eec('0x64'),this['outbound']);logger[_0x4eec('0x26')](_0x4eec('0x65'),JSON[_0x4eec('0x66')](this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]]));logger['debug'](_0x4eec('0x67'),_0x5bb0ec['uniqueid'],util[_0x4eec('0x1d')](this['channels'][_0x5bb0ec[_0x4eec('0x1e')]],{'showHidden':![],'depth':null}));this[_0x4eec('0x1a')](_0x4eec('0x28'),_0x4eec('0x68'),this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x1e')]]);delete this[_0x4eec('0xc')][_0x5bb0ec['uniqueid']];}else if(this[_0x4eec('0xc')][_0x5bb0ec['linkedid']]){this['channels'][_0x5bb0ec['linkedid']][_0x4eec('0x1e')]=this[_0x4eec('0xc')][_0x5bb0ec[_0x4eec('0x69')]][_0x4eec('0x6a')];}if(this[_0x4eec('0x10')][_0x5bb0ec[_0x4eec('0x1e')]]){delete this[_0x4eec('0x10')][_0x5bb0ec['uniqueid']];}}}catch(_0x5d4074){logger[_0x4eec('0x36')]('[%s][voiceDialReport][hangup]',_0x5bb0ec[_0x4eec('0x1e')],util[_0x4eec('0x1d')](_0x5d4074,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x4eec('0x16')]=function(_0x3468cb){try{if(this[_0x4eec('0x38')](_0x3468cb)){logger['debug']('[%s][voiceDialReport][newexten]\x20event:',_0x3468cb[_0x4eec('0x1e')],util[_0x4eec('0x1d')](_0x3468cb,{'showHidden':![],'depth':null}));if(_0x3468cb['application'][_0x4eec('0x6b')]()===_0x4eec('0x6c')){_0x3468cb[_0x4eec('0x6d')]=(_0x3468cb[_0x4eec('0x6e')]||_0x3468cb[_0x4eec('0x6d')])[_0x4eec('0x6b')]();if(_['startsWith'](_0x3468cb['applicationdata'],'cdr(')){if(_[_0x4eec('0x3f')](this[_0x4eec('0xf')][_0x3468cb['uniqueid']]))this[_0x4eec('0xf')][_0x3468cb['uniqueid']]={};logger[_0x4eec('0x26')](_0x4eec('0x6f'),_0x3468cb[_0x4eec('0x1e')],_0x3468cb[_0x4eec('0x70')],_0x3468cb[_0x4eec('0x6d')]);var _0x8fc262=_0x3468cb[_0x4eec('0x6d')]['split']('=');var _0x57ba8b=_0x8fc262[0x0][_0x4eec('0x71')](/cdr\((.*)\)/);if(_0x57ba8b)this[_0x4eec('0xf')][_0x3468cb[_0x4eec('0x1e')]][_0x57ba8b[0x1]]=_0x8fc262[0x1];}}}}catch(_0x3d6913){logger[_0x4eec('0x36')](_0x4eec('0x72'),_0x3468cb[_0x4eec('0x1e')],util[_0x4eec('0x1d')](_0x3d6913,{'showHidden':![],'depth':null}));}};module[_0x4eec('0x73')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index d0472b7..b387aa4 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 _0x37a4=['syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','fullybooted','newexten','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','unlockRR','prototype','clearZombieChannels','switch','isNil','channels','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','available','pTalking','sumBillable','sumHoldTime','total','unmanaged','abandoned','waiting','Trunk','active','callerid','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','Action','queues','[voiceQueueReport][queues]','queuesummary','then','[voiceQueueReport][queuesummary]','isNotNull','[voiceQueueReport][queuesummary]\x20event:','queue','info','callers','loggedIn','loggedin','toNumber','custom:queuesummary','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','seconds','FORWARDTRANSFER','transfertype','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','CONTINUE','TIMEOUT','lastevent','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','diff','sumDuration','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transferexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfereeuniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','application','toLowerCase','applicationdata','appdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','../model/queueReport','redis','defaults','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete'];(function(_0x3beda0,_0x260ccc){var _0x5ef049=function(_0x50f83b){while(--_0x50f83b){_0x3beda0['push'](_0x3beda0['shift']());}};_0x5ef049(++_0x260ccc);}(_0x37a4,0xcb));var _0x437a=function(_0xe536ca,_0x40f108){_0xe536ca=_0xe536ca-0x0;var _0x19ef44=_0x37a4[_0xe536ca];return _0x19ef44;};'use strict';var _=require(_0x437a('0x0'));var moment=require('moment');var util=require(_0x437a('0x1'));var md5=require('md5');var Redis=require(_0x437a('0x2'));var config=require(_0x437a('0x3'));var logger=require(_0x437a('0x4'))('ami');var ami=require('../ami');var QueueReport=require(_0x437a('0x5'));config[_0x437a('0x6')]=_[_0x437a('0x7')](config[_0x437a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x437a('0x8'))(new Redis(config[_0x437a('0x6')]));var Sequence=function(){};Sequence['prototype'][_0x437a('0x9')]=function(_0x15ac16){this[_0x437a('0xa')]=this[_0x437a('0xa')]?this[_0x437a('0xa')][_0x437a('0xb')](_0x15ac16):_0x15ac16();};function VoiceQueueReport(_0x294d71){this[_0x437a('0xc')]=new Sequence();this[_0x437a('0xd')]={};this[_0x437a('0xe')]=_0x294d71[_0x437a('0xe')];this['channels']=_0x294d71[_0x437a('0xf')];this[_0x437a('0x10')]=_0x294d71[_0x437a('0x10')];this[_0x437a('0x11')]=!![];this[_0x437a('0x12')]=_0x294d71['campaigns'];this[_0x437a('0x13')]={};ami['on']('queuesummary',this[_0x437a('0x14')][_0x437a('0x15')](this));ami['on'](_0x437a('0x16'),this[_0x437a('0x17')][_0x437a('0x15')](this));ami['on'](_0x437a('0x18'),this[_0x437a('0x19')][_0x437a('0x15')](this));ami['on'](_0x437a('0x1a'),this[_0x437a('0x1b')][_0x437a('0x15')](this));ami['on'](_0x437a('0x1c'),this['syncQueueCallerLeave'][_0x437a('0x15')](this));ami['on']('agentcomplete',this[_0x437a('0x1d')][_0x437a('0x15')](this));ami['on'](_0x437a('0x1e'),this[_0x437a('0x1f')][_0x437a('0x15')](this));ami['on'](_0x437a('0x20'),this['syncVarSet'][_0x437a('0x15')](this));ami['on'](_0x437a('0x21'),this[_0x437a('0x22')]['bind'](this));ami['on'](_0x437a('0x23'),this['syncFullyBooted'][_0x437a('0x15')](this));ami['on'](_0x437a('0x24'),this['syncNewExten'][_0x437a('0x15')](this));ami['on']('musiconholdstart',this[_0x437a('0x25')][_0x437a('0x15')](this));ami['on'](_0x437a('0x26'),this[_0x437a('0x27')][_0x437a('0x15')](this));ami['on'](_0x437a('0x28'),this[_0x437a('0x29')][_0x437a('0x15')](this));ami['on'](_0x437a('0x2a'),this[_0x437a('0x2b')][_0x437a('0x15')](this));this[_0x437a('0x2c')]();this['loopQueueShow']();}function clearChannels(_0x33f906){if(!_[_0x437a('0x2d')](_0x33f906)){for(var _0x39f79b in _0x33f906){if(_0x33f906['hasOwnProperty'](_0x39f79b)){delete _0x33f906[_0x39f79b];}}}}function clearCampaigns(_0x224d7){if(!_['isEmpty'](_0x224d7)){for(var _0xb6c4bd in _0x224d7){if(_0x224d7[_0x437a('0x2e')](_0xb6c4bd)){_0x224d7[_0xb6c4bd][_0x437a('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x335659){if(!_[_0x437a('0x2d')](_0x335659)){for(var _0x1c00f1 in _0x335659){if(_0x335659[_0x437a('0x2e')](_0x1c00f1)){_0x335659[_0x1c00f1][_0x437a('0x2f')]=0x0;_0x335659[_0x1c00f1][_0x437a('0x30')]=0x0;_0x335659[_0x1c00f1]['pTalking']=0x0;_0x335659[_0x1c00f1]['waiting']=0x0;_0x335659[_0x1c00f1]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x434eb1){if(!_[_0x437a('0x2d')](_0x434eb1)){for(var _0x120c2a in _0x434eb1){if(_0x434eb1['hasOwnProperty'](_0x120c2a)){_0x434eb1[_0x120c2a][_0x437a('0x31')]=!![];}}}}VoiceQueueReport[_0x437a('0x32')][_0x437a('0x33')]=function(){var _0x2b886c=this;for(var _0x902594 in this['channels']){if(this['channels']['hasOwnProperty'](_0x902594)&&!this['channels'][_0x902594][_0x437a('0x34')]){this[_0x437a('0xc')][_0x437a('0x9')](function(){if(!_[_0x437a('0x35')](_0x2b886c['channels'][_0x902594])){return ami['Action']({'action':'status','channel':_0x2b886c[_0x437a('0x36')][_0x902594][_0x437a('0x37')]})[_0x437a('0x38')](function(_0x503789){if(_0x503789['message']===_0x437a('0x39')){setTimeout(function(){if(_0x2b886c['channels'][_0x902594]){delete _0x2b886c[_0x437a('0x36')][_0x902594];logger[_0x437a('0x3a')](_0x437a('0x3b'),_0x902594,util[_0x437a('0x3c')](_0x503789,{'showHidden':![],'depth':null}));}if(_0x2b886c[_0x437a('0xd')][_0x902594]){delete _0x2b886c[_0x437a('0xd')][_0x902594];logger[_0x437a('0x3a')](_0x437a('0x3d'),_0x902594,util['inspect'](_0x503789,{'showHidden':![],'depth':null}));}if(_0x2b886c[_0x437a('0x13')][_0x902594]){delete _0x2b886c[_0x437a('0x13')][_0x902594];logger['error'](_0x437a('0x3e'),_0x902594,util[_0x437a('0x3c')](_0x503789,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger['error'](_0x437a('0x3f'));clearChannels(this[_0x437a('0x36')]);this[_0x437a('0x40')](this[_0x437a('0xd')]);clearAgentBooked(this[_0x437a('0xe')]);clearVoiceQueues(this[_0x437a('0x10')]);clearCampaigns(this[_0x437a('0x12')]);};VoiceQueueReport[_0x437a('0x32')]['clearQueueReport']=function(_0xaf5021){var _0x43793c=this;if(!_[_0x437a('0x2d')](_0xaf5021)){for(var _0x876d62 in _0xaf5021){if(_0xaf5021[_0x437a('0x2e')](_0x876d62)){_0x43793c[_0x437a('0x41')](_0xaf5021[_0x876d62],_0x437a('0x42'));delete _0xaf5021[_0x876d62];}}}};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x43')]=function(_0x57c972,_0xf00b52,_0x4b9956){io['to'](_0x57c972)[_0x437a('0x43')](_0xf00b52,_0x4b9956);};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x44')]=function(_0x458967,_0x1306d0){logger[_0x437a('0x45')]('[%s][voiceQueueReport]['+_0x1306d0+_0x437a('0x46'),_0x458967[_0x437a('0x47')],util[_0x437a('0x3c')](_0x458967,{'showHidden':![],'depth':null}));this[_0x437a('0x43')](util[_0x437a('0x48')](_0x437a('0x49'),_0x458967[_0x437a('0x4a')]),'voice_queue_channel:save',_0x458967);io['emit']('voice_queue_presence:save',_0x458967);};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x41')]=function(_0xe6a586,_0x5cbde8){logger[_0x437a('0x45')](_0x437a('0x4b')+_0x5cbde8+_0x437a('0x4c'),_0xe6a586['uniqueid'],util['inspect'](_0xe6a586,{'showHidden':![],'depth':null}));this['emit'](util[_0x437a('0x48')](_0x437a('0x49'),_0xe6a586[_0x437a('0x4a')]),_0x437a('0x4d'),_0xe6a586);io[_0x437a('0x43')](_0x437a('0x4e'),_0xe6a586);};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x4f')]=function(_0xd90e28,_0x5b4bc2){if(_0xd90e28[_0x437a('0x50')]===_0x437a('0x51')){var _0x27d989={'id':_0xd90e28['id'],'name':_0xd90e28[_0x437a('0x4a')],'strategy':_0xd90e28['strategy'],'answered':_0xd90e28[_0x437a('0x52')],'available':_0xd90e28[_0x437a('0x53')],'loggedIn':_0xd90e28['loggedIn'],'pTalking':_0xd90e28[_0x437a('0x54')],'sumBillable':_0xd90e28[_0x437a('0x55')],'sumDuration':_0xd90e28['sumDuration'],'sumHoldTime':_0xd90e28[_0x437a('0x56')]||0x0,'talking':_0xd90e28[_0x437a('0x30')],'total':_0xd90e28[_0x437a('0x57')],'type':_0xd90e28[_0x437a('0x50')],'unmanaged':_0xd90e28[_0x437a('0x58')],'abandoned':_0xd90e28[_0x437a('0x59')],'waiting':_0xd90e28[_0x437a('0x5a')]};if(_0xd90e28['Trunk']){_0x27d989['Trunk']={'id':_0xd90e28[_0x437a('0x5b')]['id'],'name':_0xd90e28['Trunk'][_0x437a('0x4a')],'active':_0xd90e28['Trunk'][_0x437a('0x5c')],'callerid':_0xd90e28[_0x437a('0x5b')][_0x437a('0x5d')]};}if(_0xd90e28[_0x437a('0x5e')]){_0x27d989['Interval']={'id':_0xd90e28['Interval']['id'],'name':_0xd90e28[_0x437a('0x5e')][_0x437a('0x4a')]};}var _0x318234=md5(JSON[_0x437a('0x5f')](_0x27d989));if(_0xd90e28[_0x437a('0x60')]!==_0x318234){_0xd90e28[_0x437a('0x60')]=_0x318234;logger[_0x437a('0x45')](_0x437a('0x61')+_0x5b4bc2+_0x437a('0x62'),util['inspect'](_0x27d989,{'showHidden':![],'depth':null}));this[_0x437a('0x43')](util[_0x437a('0x48')](_0x437a('0x49'),_0x27d989[_0x437a('0x4a')]),_0x437a('0x63'),_0x27d989);}}};VoiceQueueReport[_0x437a('0x32')]['isNotNull']=function(_0x25a6fd){return _0x25a6fd!==null&&!_[_0x437a('0x64')](_0x25a6fd);};VoiceQueueReport[_0x437a('0x32')]['loopQueueShow']=function(){var _0x56cc15=this;setInterval(function(){_0x56cc15[_0x437a('0x33')]();ami[_0x437a('0x65')]({'action':_0x437a('0x66')})[_0x437a('0x38')](function(_0x54175d){logger[_0x437a('0x3a')](_0x437a('0x67'),util['inspect'](_0x54175d,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x437a('0x32')]['loopQueueSummary']=function(){var _0x491aa2=this;setInterval(function(){if(_0x491aa2[_0x437a('0x11')]){return ami[_0x437a('0x65')]({'action':_0x437a('0x68')})[_0x437a('0x69')](function(_0x17715e){_0x491aa2[_0x437a('0x11')]=![];})[_0x437a('0x38')](function(_0x118095){logger[_0x437a('0x3a')](_0x437a('0x6a'),util[_0x437a('0x3c')](_0x118095,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x14')]=function(_0x1d3d96){try{if(this[_0x437a('0x6b')](_0x1d3d96)&&this[_0x437a('0x6b')](_0x1d3d96['queue'])){logger['debug'](_0x437a('0x6c'),util[_0x437a('0x3c')](_0x1d3d96,{'showHidden':![],'depth':null}));if(this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]){logger[_0x437a('0x6e')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x1d3d96[_0x437a('0x6d')]);var _0x3168b7=_['countBy'](this[_0x437a('0x36')],_0x437a('0x6d'))[_0x1d3d96[_0x437a('0x6d')]]||0x0;var _0x5f15f6=_0x3168b7-_0x1d3d96[_0x437a('0x6f')];if(this['voiceQueues'][_0x1d3d96[_0x437a('0x6d')]][_0x437a('0x5a')]!==_['toNumber'](_0x1d3d96[_0x437a('0x6f')])||this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]][_0x437a('0x70')]!==_['toNumber'](_0x1d3d96[_0x437a('0x71')])||this['voiceQueues'][_0x1d3d96[_0x437a('0x6d')]][_0x437a('0x53')]!==_[_0x437a('0x72')](_0x1d3d96[_0x437a('0x53')])||this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]['talking']!==_0x5f15f6){this[_0x437a('0x10')][_0x1d3d96['queue']]['waiting']=_[_0x437a('0x72')](_0x1d3d96[_0x437a('0x6f')]);this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]['loggedIn']=_[_0x437a('0x72')](_0x1d3d96[_0x437a('0x71')]);this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]['available']=_[_0x437a('0x72')](_0x1d3d96['available']);this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]['talking']=_0x5f15f6>0x0?_0x5f15f6:0x0;this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]][_0x437a('0x30')]=this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]['talking']>_[_0x437a('0x72')](_0x1d3d96[_0x437a('0x71')])?_['toNumber'](_0x1d3d96[_0x437a('0x71')]):this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]['talking'];this[_0x437a('0x4f')](this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]],_0x437a('0x68'));}logger[_0x437a('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x437a('0x3c')](this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]],{'showHidden':![],'depth':null}));ami[_0x437a('0x43')](_0x437a('0x73'),this[_0x437a('0x10')][_0x1d3d96[_0x437a('0x6d')]]);}}}catch(_0x5c9013){logger['error'](_0x437a('0x6a'),util[_0x437a('0x3c')](_0x5c9013,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x17')]=function(_0x2d098b){logger[_0x437a('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x437a('0x3c')](_0x2d098b,{'showHidden':![],'depth':null}));this[_0x437a('0x11')]=!![];};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x19')]=function(_0x3f782a){try{if(this['isNotNull'](_0x3f782a)){logger[_0x437a('0x45')](_0x437a('0x74'),_0x3f782a[_0x437a('0x47')],util[_0x437a('0x3c')](_0x3f782a,{'showHidden':![],'depth':null}));if(_[_0x437a('0x64')](this[_0x437a('0xd')][_0x3f782a[_0x437a('0x47')]]))this[_0x437a('0xd')][_0x3f782a[_0x437a('0x47')]]=[];if(_['isUndefined'](this[_0x437a('0x36')][_0x3f782a['uniqueid']]))this['channels'][_0x3f782a[_0x437a('0x47')]]={};var _0x3fb37e=new QueueReport();_0x3fb37e[_0x437a('0x4a')]=_0x3f782a[_0x437a('0x6d')];_0x3fb37e['type']=this[_0x437a('0x10')][_0x3fb37e['name']]&&this[_0x437a('0x10')][_0x3fb37e[_0x437a('0x4a')]][_0x437a('0x50')]?this[_0x437a('0x10')][_0x3fb37e[_0x437a('0x4a')]][_0x437a('0x50')]||_0x437a('0x51'):_0x437a('0x51');_0x3fb37e['queue']=_0x3f782a[_0x437a('0x6d')];_0x3fb37e[_0x437a('0x75')]=moment()[_0x437a('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fb37e[_0x437a('0x76')]=_0x3f782a[_0x437a('0x76')];_0x3fb37e[_0x437a('0x77')]=_0x3f782a[_0x437a('0x77')];_0x3fb37e[_0x437a('0x47')]=_0x3f782a[_0x437a('0x47')];_0x3fb37e[_0x437a('0x78')]=this['channels'][_0x3f782a[_0x437a('0x47')]]['routealias'];logger[_0x437a('0x6e')](_0x437a('0x79'),_0x3fb37e[_0x437a('0x4a')],_0x3fb37e[_0x437a('0x50')]);_[_0x437a('0x7a')](_0x3fb37e,_[_0x437a('0x7b')](_0x3f782a,_['keys'](_0x3fb37e)));this[_0x437a('0xd')][_0x3f782a[_0x437a('0x47')]][_0x437a('0x7c')](_0x3fb37e);this[_0x437a('0x36')][_0x3f782a[_0x437a('0x47')]]=_0x3fb37e;this['emitVoiceQueueChannelSave'](_0x3fb37e,'queuecallerjoin');}}catch(_0x3ff398){logger[_0x437a('0x3a')](_0x437a('0x74'),_0x3f782a['uniqueid'],util[_0x437a('0x3c')](_0x3ff398,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x1b')]=function(_0x58cdb0){try{if(this[_0x437a('0x6b')](_0x58cdb0)){logger[_0x437a('0x45')](_0x437a('0x7d'),_0x58cdb0[_0x437a('0x47')],util[_0x437a('0x3c')](_0x58cdb0,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x58cdb0[_0x437a('0x47')]]){var _0x90c883=_[_0x437a('0x7e')](this[_0x437a('0xd')][_0x58cdb0[_0x437a('0x47')]]);_0x90c883[_0x437a('0x7f')]=![];_0x90c883[_0x437a('0x80')]=null;_0x90c883[_0x437a('0x81')]=_0x58cdb0[_0x437a('0x81')];_0x90c883[_0x437a('0x82')]=_0x58cdb0['originalposition'];_0x90c883[_0x437a('0x1a')]=!![];_0x90c883[_0x437a('0x83')]=moment()[_0x437a('0x48')](_0x437a('0x84'));_0x90c883[_0x437a('0x85')]='ABANDONED';_0x90c883['lastAssignedTo']=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x90c883['name'],_0x90c883[_0x437a('0x50')]);this[_0x437a('0x36')][_0x58cdb0[_0x437a('0x47')]]=_0x90c883;this[_0x437a('0x41')](_0x90c883,_0x437a('0x1a'));}}}catch(_0x2c34fb){logger[_0x437a('0x3a')](_0x437a('0x7d'),_0x58cdb0[_0x437a('0x47')],util[_0x437a('0x3c')](_0x2c34fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x437a('0x32')][_0x437a('0x86')]=function(_0x470f2f){try{if(this[_0x437a('0x6b')](_0x470f2f)){logger['debug'](_0x437a('0x87'),_0x470f2f[_0x437a('0x47')],util[_0x437a('0x3c')](_0x470f2f,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x470f2f[_0x437a('0x47')]]){var _0x124f43=_['last'](this[_0x437a('0xd')][_0x470f2f[_0x437a('0x47')]]);_0x124f43['queuecallerleaveAt']=moment()[_0x437a('0x48')](_0x437a('0x84'));_0x124f43[_0x437a('0x88')]=_0x470f2f[_0x437a('0x88')];_0x124f43[_0x437a('0x89')]=_0x470f2f[_0x437a('0x89')];logger['info'](_0x437a('0x8a'),_0x124f43['name'],_0x124f43[_0x437a('0x50')],_0x470f2f['connectedlinenum'],_0x470f2f['connectedlinename']);this[_0x437a('0x36')][_0x470f2f[_0x437a('0x47')]]=_0x124f43;this[_0x437a('0x44')](_0x124f43,_0x437a('0x1c'));}}}catch(_0x44c5dd){logger[_0x437a('0x3a')](_0x437a('0x87'),_0x470f2f[_0x437a('0x47')],util[_0x437a('0x3c')](_0x44c5dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x437a('0x1f')]=function(_0x3a2ba3){try{if(this['isNotNull'](_0x3a2ba3)){logger['debug'](_0x437a('0x8b'),_0x3a2ba3[_0x437a('0x47')],util[_0x437a('0x3c')](_0x3a2ba3,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x3a2ba3['uniqueid']]){var _0x44701a=_[_0x437a('0x7e')](this['queueReports'][_0x3a2ba3[_0x437a('0x47')]]);_0x44701a[_0x437a('0x7f')]=!![];_0x44701a[_0x437a('0x85')]='COMPLETEDBYAGENT';logger[_0x437a('0x6e')](_0x437a('0x8c'),_0x44701a[_0x437a('0x4a')],_0x44701a[_0x437a('0x50')]);}}}catch(_0x25ea62){logger[_0x437a('0x3a')](_0x437a('0x8b'),_0x3a2ba3[_0x437a('0x47')],util[_0x437a('0x3c')](_0x25ea62,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x437a('0x1d')]=function(_0x280307){try{if(this[_0x437a('0x6b')](_0x280307)){logger[_0x437a('0x45')](_0x437a('0x8d'),_0x280307[_0x437a('0x47')],util['inspect'](_0x280307,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x280307['uniqueid']]){var _0x1b7be4=_[_0x437a('0x7e')](this[_0x437a('0xd')][_0x280307[_0x437a('0x47')]]);_0x1b7be4[_0x437a('0x1a')]=![];_0x1b7be4[_0x437a('0x83')]=null;_0x1b7be4['assigned']=!![];_0x1b7be4['lastAssignedTo']=_0x280307[_0x437a('0x8e')];_0x1b7be4[_0x437a('0x81')]=_0x280307[_0x437a('0x81')];_0x1b7be4[_0x437a('0x7f')]=!![];_0x1b7be4[_0x437a('0x8f')]=![];_0x1b7be4[_0x437a('0x90')]=null;if(!_0x1b7be4[_0x437a('0x91')]){if(_0x280307['reason']=='transfer'){_0x1b7be4[_0x437a('0x85')]=_0x437a('0x92');logger[_0x437a('0x6e')](_0x437a('0x93'),_0x1b7be4['name'],_0x1b7be4[_0x437a('0x50')]);}else{if(_[_0x437a('0x94')](_0x280307[_0x437a('0x37')]['toLowerCase'](),_0x437a('0x95'))){if(this[_0x437a('0xd')][_0x280307[_0x437a('0x96')]]){var _0x2e7bf2=_['last'](this['queueReports'][_0x280307[_0x437a('0x96')]]);_0x2e7bf2[_0x437a('0x7f')]=![];_0x2e7bf2[_0x437a('0x8f')]=!![];_0x2e7bf2['queuecallerexitAt']=moment(_0x1b7be4['queuecallerjoinAt'])['add'](_0x280307['holdtime'],_0x437a('0x97'))[_0x437a('0x48')](_0x437a('0x84'));_0x2e7bf2[_0x437a('0x85')]=_0x437a('0x98');_0x2e7bf2[_0x437a('0x91')]=!![];_0x2e7bf2[_0x437a('0x99')]='FORWARD';_0x2e7bf2['transferexten']=_0x280307[_0x437a('0x9a')];_0x2e7bf2[_0x437a('0x9b')]=_0x280307[_0x437a('0x47')];logger[_0x437a('0x6e')](_0x437a('0x9c'),_0x2e7bf2[_0x437a('0x4a')],_0x2e7bf2['type']);var _0x2abbe4=this[_0x437a('0xd')][_0x280307[_0x437a('0x96')]];this[_0x437a('0xd')][_0x280307[_0x437a('0x96')]]=this[_0x437a('0xd')][_0x280307[_0x437a('0x47')]];this[_0x437a('0xd')][_0x280307[_0x437a('0x47')]]=_0x2abbe4;}}else{_0x1b7be4['queuecallerexitreason']=_0x437a('0x9d')+_0x280307['reason']['toUpperCase']();logger[_0x437a('0x6e')](_0x437a('0x9e'),_0x1b7be4['name'],_0x1b7be4[_0x437a('0x50')],_0x1b7be4[_0x437a('0x85')]);}}}this[_0x437a('0x36')][_0x280307['uniqueid']]=_0x1b7be4;this['emitVoiceQueueChannelRemove'](_0x1b7be4,_0x437a('0x9f'));}}}catch(_0x14b933){logger[_0x437a('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x280307[_0x437a('0x47')],util['inspect'](_0x14b933,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x437a('0xa0')]=function(_0x3db04e){try{if(this[_0x437a('0x6b')](_0x3db04e)){logger[_0x437a('0x45')](_0x437a('0xa1'),_0x3db04e[_0x437a('0x47')],util[_0x437a('0x3c')](_0x3db04e,{'showHidden':![],'depth':null}));this[_0x437a('0xa2')](_0x3db04e['uniqueid'],_[_0x437a('0xa3')](_0x3db04e[_0x437a('0xa4')])[0x0],_0x3db04e[_0x437a('0xa5')]);if(this[_0x437a('0xd')][_0x3db04e[_0x437a('0x47')]]){var _0x507970=_[_0x437a('0x7e')](this[_0x437a('0xd')][_0x3db04e[_0x437a('0x47')]]);if(_0x507970){if(this[_0x437a('0x6b')](_0x3db04e[_0x437a('0xa4')])&&this[_0x437a('0x6b')](_0x3db04e[_0x437a('0xa4')]['queuestatus'])){switch(_0x3db04e[_0x437a('0xa5')]){case _0x437a('0xa6'):_0x507970[_0x437a('0x8f')]=![];_0x507970[_0x437a('0x90')]=null;break;case _0x437a('0xa7'):_0x507970[_0x437a('0xa8')]='timeout';_0x507970[_0x437a('0x8f')]=!![];_0x507970['queuecallerexitAt']=moment()[_0x437a('0x48')](_0x437a('0x84'));_0x507970[_0x437a('0xa9')]=moment()[_0x437a('0x48')](_0x437a('0x84'));logger[_0x437a('0x45')](_0x437a('0xaa'),_0x3db04e[_0x437a('0x47')],util[_0x437a('0x3c')](_0x507970,{'showHidden':![],'depth':null}));ami[_0x437a('0x43')](_0x437a('0xab'),_0x507970);break;default:_0x507970['queuecallerexit']=!![];_0x507970[_0x437a('0x90')]=moment()[_0x437a('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x507970[_0x437a('0xa9')]=moment()['format'](_0x437a('0x84'));}_0x507970[_0x437a('0x1a')]=![];_0x507970[_0x437a('0x83')]=null;_0x507970[_0x437a('0x85')]=_0x3db04e[_0x437a('0xa5')];this[_0x437a('0x36')][_0x3db04e[_0x437a('0x47')]]=_0x507970;this[_0x437a('0x41')](_0x507970,'varset');}else if(this[_0x437a('0x6b')](_0x3db04e['variable'])&&this[_0x437a('0x6b')](_0x3db04e[_0x437a('0xa4')]['queueposition'])){if(!_0x507970[_0x437a('0x1a')]){_0x507970[_0x437a('0x8f')]=!![];_0x507970[_0x437a('0x90')]=moment()[_0x437a('0x48')](_0x437a('0x84'));_0x507970['queuecallerexitreason']='EXITWITHKEY';_0x507970[_0x437a('0xa9')]=moment()[_0x437a('0x48')](_0x437a('0x84'));this['channels'][_0x3db04e[_0x437a('0x47')]]=_0x507970;}}logger[_0x437a('0x6e')](_0x437a('0xac'),_0x3db04e[_0x437a('0x47')],_0x507970['name'],_0x507970['type'],_['keys'](_0x3db04e['variable'])[0x0],_0x3db04e['value']);_0x507970[_0x437a('0x13')]=this['variables'][_0x3db04e[_0x437a('0x47')]];}}}}catch(_0x15f2da){logger[_0x437a('0x3a')]('[%s][voiceQueueReport][varset]',_0x3db04e[_0x437a('0x47')],util[_0x437a('0x3c')](_0x15f2da,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x437a('0xa2')]=function(_0x33e300,_0x19a4d9,_0x425137){var _0x4747f7=['rtpaudioqos',_0x437a('0xad'),'rtpaudioqosjitter',_0x437a('0xae'),'rtpaudioqosloss',_0x437a('0xaf'),_0x437a('0xb0'),_0x437a('0xb1'),'sipcallid',_0x437a('0xb2'),_0x437a('0xb3'),_0x437a('0xb4'),'membercalls',_0x437a('0xb5'),_0x437a('0xb6'),'memberlastcall',_0x437a('0x8e'),_0x437a('0xb7'),_0x437a('0xb8')];if(!_['isNil'](_0x19a4d9)&&!_[_0x437a('0xb9')](_0x4747f7,_0x19a4d9)){if(_[_0x437a('0x64')](this['variables'][_0x33e300])){this['variables'][_0x33e300]={};}this[_0x437a('0x13')][_0x33e300][_0x19a4d9]=_0x425137;}};VoiceQueueReport[_0x437a('0x32')]['syncHangup']=function(_0x34f7b8){try{if(this['isNotNull'](_0x34f7b8)){logger[_0x437a('0x45')](_0x437a('0xba'),_0x34f7b8[_0x437a('0x47')],util[_0x437a('0x3c')](_0x34f7b8,{'showHidden':![],'depth':null}));if(this[_0x437a('0xd')][_0x34f7b8[_0x437a('0x47')]]){for(var _0x105999=0x0,_0x1442c9={};_0x1059990x0?_0x2b816e:0x0;this['voiceQueues'][_0x21b3cf['queue']][_0x7d95('0x2f')]=this[_0x7d95('0x10')][_0x21b3cf[_0x7d95('0x6d')]]['talking']>_[_0x7d95('0x72')](_0x21b3cf[_0x7d95('0x74')])?_[_0x7d95('0x72')](_0x21b3cf[_0x7d95('0x74')]):this[_0x7d95('0x10')][_0x21b3cf[_0x7d95('0x6d')]][_0x7d95('0x2f')];this[_0x7d95('0x51')](this[_0x7d95('0x10')][_0x21b3cf['queue']],'queuesummary');}logger[_0x7d95('0x45')](_0x7d95('0x75'),util['inspect'](this['voiceQueues'][_0x21b3cf[_0x7d95('0x6d')]],{'showHidden':![],'depth':null}));ami[_0x7d95('0x43')](_0x7d95('0x76'),this[_0x7d95('0x10')][_0x21b3cf['queue']]);}}}catch(_0x3dbdd3){logger[_0x7d95('0x3e')](_0x7d95('0x6c'),util[_0x7d95('0x3d')](_0x3dbdd3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d95('0x33')][_0x7d95('0x16')]=function(_0x2abdb1){logger['debug'](_0x7d95('0x77'),util[_0x7d95('0x3d')](_0x2abdb1,{'showHidden':![],'depth':null}));this[_0x7d95('0x6a')]=!![];};VoiceQueueReport[_0x7d95('0x33')][_0x7d95('0x78')]=function(_0x17f428){try{if(this[_0x7d95('0x64')](_0x17f428)){logger[_0x7d95('0x45')]('[%s][voiceQueueReport][queuecallerjoin]',_0x17f428[_0x7d95('0x48')],util['inspect'](_0x17f428,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7d95('0xe')][_0x17f428[_0x7d95('0x48')]]))this[_0x7d95('0xe')][_0x17f428[_0x7d95('0x48')]]=[];if(_['isUndefined'](this['channels'][_0x17f428[_0x7d95('0x48')]]))this[_0x7d95('0x34')][_0x17f428['uniqueid']]={};var _0xe074a=new QueueReport();_0xe074a['name']=_0x17f428[_0x7d95('0x6d')];_0xe074a[_0x7d95('0x52')]=this[_0x7d95('0x10')][_0xe074a['name']]&&this['voiceQueues'][_0xe074a[_0x7d95('0x4a')]][_0x7d95('0x52')]?this[_0x7d95('0x10')][_0xe074a[_0x7d95('0x4a')]][_0x7d95('0x52')]||_0x7d95('0x53'):'inbound';_0xe074a[_0x7d95('0x6d')]=_0x17f428[_0x7d95('0x6d')];_0xe074a[_0x7d95('0x79')]=moment()[_0x7d95('0x49')](_0x7d95('0x7a'));_0xe074a[_0x7d95('0x7b')]=_0x17f428[_0x7d95('0x7b')];_0xe074a[_0x7d95('0x7c')]=_0x17f428[_0x7d95('0x7c')];_0xe074a[_0x7d95('0x48')]=_0x17f428['uniqueid'];_0xe074a['routealias']=this['channels'][_0x17f428[_0x7d95('0x48')]][_0x7d95('0x7d')];logger[_0x7d95('0x6f')](_0x7d95('0x7e'),_0xe074a['name'],_0xe074a[_0x7d95('0x52')]);_[_0x7d95('0x7f')](_0xe074a,_[_0x7d95('0x80')](_0x17f428,_[_0x7d95('0x81')](_0xe074a)));this['queueReports'][_0x17f428[_0x7d95('0x48')]][_0x7d95('0x82')](_0xe074a);this[_0x7d95('0x34')][_0x17f428[_0x7d95('0x48')]]=_0xe074a;this['emitVoiceQueueChannelSave'](_0xe074a,_0x7d95('0x17'));}}catch(_0x2bbb1f){logger[_0x7d95('0x3e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x17f428[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x2bbb1f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d95('0x33')][_0x7d95('0x18')]=function(_0x58e84e){try{if(this[_0x7d95('0x64')](_0x58e84e)){logger[_0x7d95('0x45')](_0x7d95('0x83'),_0x58e84e[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x58e84e,{'showHidden':![],'depth':null}));if(this[_0x7d95('0xe')][_0x58e84e[_0x7d95('0x48')]]){var _0x483e5e=_[_0x7d95('0x84')](this[_0x7d95('0xe')][_0x58e84e[_0x7d95('0x48')]]);_0x483e5e[_0x7d95('0x85')]=![];_0x483e5e[_0x7d95('0x86')]=null;_0x483e5e[_0x7d95('0x87')]=_0x58e84e[_0x7d95('0x87')];_0x483e5e['originalposition']=_0x58e84e[_0x7d95('0x88')];_0x483e5e[_0x7d95('0x89')]=!![];_0x483e5e[_0x7d95('0x8a')]=moment()[_0x7d95('0x49')](_0x7d95('0x7a'));_0x483e5e[_0x7d95('0x8b')]=_0x7d95('0x8c');_0x483e5e[_0x7d95('0x8d')]=null;logger[_0x7d95('0x6f')](_0x7d95('0x8e'),_0x483e5e[_0x7d95('0x4a')],_0x483e5e[_0x7d95('0x52')]);this['channels'][_0x58e84e[_0x7d95('0x48')]]=_0x483e5e;this[_0x7d95('0x41')](_0x483e5e,_0x7d95('0x89'));}}}catch(_0x176541){logger[_0x7d95('0x3e')](_0x7d95('0x83'),_0x58e84e[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x176541,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7d95('0x1a')]=function(_0x2e04ac){try{if(this[_0x7d95('0x64')](_0x2e04ac)){logger['debug'](_0x7d95('0x8f'),_0x2e04ac[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x2e04ac,{'showHidden':![],'depth':null}));if(this[_0x7d95('0xe')][_0x2e04ac['uniqueid']]){var _0x126d0f=_[_0x7d95('0x84')](this[_0x7d95('0xe')][_0x2e04ac['uniqueid']]);_0x126d0f['queuecallerleaveAt']=moment()['format'](_0x7d95('0x7a'));_0x126d0f['connectedlinenum']=_0x2e04ac[_0x7d95('0x90')];_0x126d0f[_0x7d95('0x91')]=_0x2e04ac[_0x7d95('0x91')];logger['info'](_0x7d95('0x92'),_0x126d0f[_0x7d95('0x4a')],_0x126d0f[_0x7d95('0x52')],_0x2e04ac[_0x7d95('0x90')],_0x2e04ac['connectedlinename']);this[_0x7d95('0x34')][_0x2e04ac[_0x7d95('0x48')]]=_0x126d0f;this['emitVoiceQueueChannelSave'](_0x126d0f,'queuecallerleave');}}}catch(_0x22b918){logger[_0x7d95('0x3e')]('[%s][voiceQueueReport][queuecallerleave]',_0x2e04ac[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x22b918,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x1780b8){try{if(this[_0x7d95('0x64')](_0x1780b8)){logger[_0x7d95('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x1780b8['uniqueid'],util[_0x7d95('0x3d')](_0x1780b8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1780b8['uniqueid']]){var _0x7f85fc=_[_0x7d95('0x84')](this[_0x7d95('0xe')][_0x1780b8[_0x7d95('0x48')]]);_0x7f85fc[_0x7d95('0x85')]=!![];_0x7f85fc[_0x7d95('0x8b')]=_0x7d95('0x93');logger[_0x7d95('0x6f')](_0x7d95('0x94'),_0x7f85fc['name'],_0x7f85fc[_0x7d95('0x52')]);}}}catch(_0x429576){logger[_0x7d95('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x1780b8[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x429576,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7d95('0x1b')]=function(_0x4226cd){try{if(this[_0x7d95('0x64')](_0x4226cd)){logger[_0x7d95('0x45')](_0x7d95('0x95'),_0x4226cd[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x4226cd,{'showHidden':![],'depth':null}));if(this[_0x7d95('0xe')][_0x4226cd[_0x7d95('0x48')]]){var _0x30682a=_[_0x7d95('0x84')](this[_0x7d95('0xe')][_0x4226cd[_0x7d95('0x48')]]);_0x30682a[_0x7d95('0x89')]=![];_0x30682a['queuecallerabandonAt']=null;_0x30682a[_0x7d95('0x96')]=!![];_0x30682a[_0x7d95('0x8d')]=_0x4226cd[_0x7d95('0x97')];_0x30682a[_0x7d95('0x87')]=_0x4226cd[_0x7d95('0x87')];_0x30682a[_0x7d95('0x85')]=!![];_0x30682a[_0x7d95('0x98')]=![];_0x30682a[_0x7d95('0x99')]=null;if(!_0x30682a[_0x7d95('0x9a')]){if(_0x4226cd['reason']=='transfer'){_0x30682a[_0x7d95('0x8b')]=_0x7d95('0x9b');logger[_0x7d95('0x6f')](_0x7d95('0x9c'),_0x30682a['name'],_0x30682a[_0x7d95('0x52')]);}else{if(_[_0x7d95('0x9d')](_0x4226cd[_0x7d95('0x39')]['toLowerCase'](),_0x7d95('0x9e'))){if(this[_0x7d95('0xe')][_0x4226cd[_0x7d95('0x9f')]]){var _0x24bc36=_[_0x7d95('0x84')](this[_0x7d95('0xe')][_0x4226cd[_0x7d95('0x9f')]]);_0x24bc36[_0x7d95('0x85')]=![];_0x24bc36['queuecallerexit']=!![];_0x24bc36[_0x7d95('0x99')]=moment(_0x30682a[_0x7d95('0x79')])[_0x7d95('0xa0')](_0x4226cd[_0x7d95('0x87')],_0x7d95('0xa1'))[_0x7d95('0x49')](_0x7d95('0x7a'));_0x24bc36['queuecallerexitreason']=_0x7d95('0xa2');_0x24bc36['transfer']=!![];_0x24bc36['transfertype']='FORWARD';_0x24bc36[_0x7d95('0xa3')]=_0x4226cd[_0x7d95('0xa4')];_0x24bc36[_0x7d95('0xa5')]=_0x4226cd[_0x7d95('0x48')];logger['info'](_0x7d95('0xa6'),_0x24bc36[_0x7d95('0x4a')],_0x24bc36[_0x7d95('0x52')]);var _0x5df62c=this['queueReports'][_0x4226cd[_0x7d95('0x9f')]];this[_0x7d95('0xe')][_0x4226cd[_0x7d95('0x9f')]]=this[_0x7d95('0xe')][_0x4226cd[_0x7d95('0x48')]];this[_0x7d95('0xe')][_0x4226cd[_0x7d95('0x48')]]=_0x5df62c;}}else{_0x30682a[_0x7d95('0x8b')]='COMPLETEDBY'+_0x4226cd[_0x7d95('0xa7')][_0x7d95('0xa8')]();logger['info'](_0x7d95('0xa9'),_0x30682a[_0x7d95('0x4a')],_0x30682a[_0x7d95('0x52')],_0x30682a[_0x7d95('0x8b')]);}}}this[_0x7d95('0x34')][_0x4226cd['uniqueid']]=_0x30682a;this[_0x7d95('0x41')](_0x30682a,_0x7d95('0xaa'));}}}catch(_0x308023){logger[_0x7d95('0x3e')](_0x7d95('0x95'),_0x4226cd[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x308023,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d95('0x33')][_0x7d95('0x1f')]=function(_0x14ee12){try{if(this[_0x7d95('0x64')](_0x14ee12)){logger[_0x7d95('0x45')](_0x7d95('0xab'),_0x14ee12[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x14ee12,{'showHidden':![],'depth':null}));this[_0x7d95('0xac')](_0x14ee12['uniqueid'],_[_0x7d95('0x81')](_0x14ee12['variable'])[0x0],_0x14ee12[_0x7d95('0xad')]);if(this['queueReports'][_0x14ee12[_0x7d95('0x48')]]){var _0x75247a=_[_0x7d95('0x84')](this[_0x7d95('0xe')][_0x14ee12['uniqueid']]);if(_0x75247a){if(this['isNotNull'](_0x14ee12[_0x7d95('0xae')])&&this[_0x7d95('0x64')](_0x14ee12[_0x7d95('0xae')][_0x7d95('0xaf')])){switch(_0x14ee12['value']){case _0x7d95('0xb0'):_0x75247a[_0x7d95('0x98')]=![];_0x75247a[_0x7d95('0x99')]=null;break;case _0x7d95('0xb1'):_0x75247a[_0x7d95('0xb2')]=_0x7d95('0xb3');_0x75247a[_0x7d95('0x98')]=!![];_0x75247a['queuecallerexitAt']=moment()[_0x7d95('0x49')](_0x7d95('0x7a'));_0x75247a[_0x7d95('0xb4')]=moment()['format'](_0x7d95('0x7a'));logger[_0x7d95('0x45')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x14ee12[_0x7d95('0x48')],util['inspect'](_0x75247a,{'showHidden':![],'depth':null}));ami[_0x7d95('0x43')]('custom:timeout',_0x75247a);break;default:_0x75247a[_0x7d95('0x98')]=!![];_0x75247a[_0x7d95('0x99')]=moment()[_0x7d95('0x49')](_0x7d95('0x7a'));_0x75247a[_0x7d95('0xb4')]=moment()[_0x7d95('0x49')](_0x7d95('0x7a'));}_0x75247a[_0x7d95('0x89')]=![];_0x75247a[_0x7d95('0x8a')]=null;_0x75247a['queuecallerexitreason']=_0x14ee12[_0x7d95('0xad')];this[_0x7d95('0x34')][_0x14ee12[_0x7d95('0x48')]]=_0x75247a;this[_0x7d95('0x41')](_0x75247a,_0x7d95('0x1e'));}else if(this[_0x7d95('0x64')](_0x14ee12[_0x7d95('0xae')])&&this[_0x7d95('0x64')](_0x14ee12[_0x7d95('0xae')]['queueposition'])){if(!_0x75247a['queuecallerabandon']){_0x75247a['queuecallerexit']=!![];_0x75247a['queuecallerexitAt']=moment()[_0x7d95('0x49')](_0x7d95('0x7a'));_0x75247a[_0x7d95('0x8b')]='EXITWITHKEY';_0x75247a[_0x7d95('0xb4')]=moment()[_0x7d95('0x49')](_0x7d95('0x7a'));this['channels'][_0x14ee12[_0x7d95('0x48')]]=_0x75247a;}}logger[_0x7d95('0x6f')](_0x7d95('0xb5'),_0x14ee12['uniqueid'],_0x75247a['name'],_0x75247a['type'],_[_0x7d95('0x81')](_0x14ee12['variable'])[0x0],_0x14ee12[_0x7d95('0xad')]);_0x75247a['variables']=this[_0x7d95('0x12')][_0x14ee12['uniqueid']];}}}}catch(_0x583184){logger[_0x7d95('0x3e')](_0x7d95('0xab'),_0x14ee12[_0x7d95('0x48')],util[_0x7d95('0x3d')](_0x583184,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7d95('0x33')][_0x7d95('0xac')]=function(_0xccb474,_0x413ae9,_0x33c738){var _0x572b44=[_0x7d95('0xb6'),_0x7d95('0xb7'),'rtpaudioqosjitter',_0x7d95('0xb8'),'rtpaudioqosloss',_0x7d95('0xb9'),_0x7d95('0xba'),_0x7d95('0xbb'),_0x7d95('0xbc'),_0x7d95('0xbd'),_0x7d95('0xbe'),_0x7d95('0xbf'),_0x7d95('0xc0'),_0x7d95('0xc1'),'memberinterface',_0x7d95('0xc2'),'membername',_0x7d95('0xc3'),_0x7d95('0xc4')];if(!_[_0x7d95('0x36')](_0x413ae9)&&!_[_0x7d95('0xc5')](_0x572b44,_0x413ae9)){if(_[_0x7d95('0x65')](this[_0x7d95('0x12')][_0xccb474])){this['variables'][_0xccb474]={};}this[_0x7d95('0x12')][_0xccb474][_0x413ae9]=_0x33c738;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x217ecf){try{if(this[_0x7d95('0x64')](_0x217ecf)){logger[_0x7d95('0x45')]('[%s][voiceQueueReport][hangup]',_0x217ecf['uniqueid'],util[_0x7d95('0x3d')](_0x217ecf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x217ecf['uniqueid']]){for(var _0x5f4b27=0x0,_0x1d4226={};_0x5f4b27=0x0?moment(_0x10ef42['endtime'])['diff'](_0x10ef42[_0x60b7('0x19')],_0x60b7('0x1b')):null,'data1':_0x60b7('0x1c'),'data2':_0x10ef42['accountcode'],'data3':_0x10ef42[_0x60b7('0x13')],'data4':_0x10ef42[_0x60b7('0x1d')]||null,'role':_0x60b7('0x15'),'internal':_0x10ef42[_0x60b7('0x16')]?_[_0x60b7('0x1e')](_0x10ef42['accountcode']):undefined,'uniqueid':_0x10ef42[_0x60b7('0x17')]},'log':_0x60b7('0x7')});}; \ No newline at end of file +var _0x380d=['dialstring','toNumber','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','accountcode','uniqueid','voiceDialReport','membername','TALKING','starttime','endtime'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0x380d,0x124));var _0xd380=function(_0x48a375,_0x42fd2b){_0x48a375=_0x48a375-0x0;var _0x3b3e84=_0x380d[_0x48a375];return _0x3b3e84;};'use strict';var moment=require(_0xd380('0x0'));var _=require(_0xd380('0x1'));var util=require('util');var client=require(_0xd380('0x2'));exports[_0xd380('0x3')]=function(_0xef8272){var _0x2c2c89=_0xef8272[_0xd380('0x4')]||_0xef8272[_0xd380('0x5')];return client[_0xd380('0x6')](_0xd380('0x7'),{'body':{'channel':_0xd380('0x8'),'membername':_0xef8272[_0xd380('0x9')],'interface':_[_0xd380('0xa')](_0xef8272[_0xd380('0xb')])?util[_0xd380('0xc')](_0xd380('0xd'),_0xef8272[_0xd380('0x9')]):_0xef8272[_0xd380('0xb')],'type':'TALKING','enterAt':_0xef8272[_0xd380('0xe')],'exitAt':_0x2c2c89,'duration':moment(_0x2c2c89)[_0xd380('0xf')](_0xef8272[_0xd380('0xe')],_0xd380('0x10')),'data1':'inbound','data2':_0xef8272[_0xd380('0x11')],'data3':_0xef8272[_0xd380('0x12')],'data4':null,'data5':_0xef8272[_0xd380('0x13')],'role':'agent','internal':_0xef8272[_0xd380('0x14')]?_['toNumber'](_0xef8272[_0xd380('0x14')]):undefined,'uniqueid':_0xef8272[_0xd380('0x15')]},'log':_0xd380('0x7')});};exports[_0xd380('0x16')]=function(_0x9c5a9a){return client[_0xd380('0x6')](_0xd380('0x7'),{'body':{'channel':_0xd380('0x8'),'membername':_0x9c5a9a[_0xd380('0x17')],'interface':_0x9c5a9a['interface'],'type':_0xd380('0x18'),'enterAt':_0x9c5a9a[_0xd380('0x19')],'exitAt':_0x9c5a9a[_0xd380('0x1a')],'duration':moment(_0x9c5a9a[_0xd380('0x1a')])[_0xd380('0xf')](_0x9c5a9a[_0xd380('0x19')],_0xd380('0x10'))>=0x0?moment(_0x9c5a9a[_0xd380('0x1a')])[_0xd380('0xf')](_0x9c5a9a[_0xd380('0x19')],'seconds'):null,'data1':'outbound','data2':_0x9c5a9a[_0xd380('0x14')],'data3':_0x9c5a9a[_0xd380('0x12')],'data4':_0x9c5a9a[_0xd380('0x1b')]||null,'role':'agent','internal':_0x9c5a9a['accountcode']?_[_0xd380('0x1c')](_0x9c5a9a['accountcode']):undefined,'uniqueid':_0x9c5a9a['uniqueid']},'log':_0xd380('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 5032fb7..d7cdc3a 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 _0x0b30=['ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings','Request'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x0b30,0x1a7));var _0x00b3=function(_0xc70310,_0x4c6be0){_0xc70310=_0xc70310-0x0;var _0x535a4f=_0x0b30[_0xc70310];return _0x535a4f;};'use strict';var client=require(_0x00b3('0x0'));exports[_0x00b3('0x1')]=function(){return client[_0x00b3('0x2')](_0x00b3('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x00b3('0x4')]},'log':_0x00b3('0x5')});}; \ No newline at end of file +var _0x1f31=['ShowSetting'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x1f31,0xca));var _0x11f3=function(_0xe56790,_0x5f304d){_0xe56790=_0xe56790-0x0;var _0x145cf7=_0x1f31[_0xe56790];return _0x145cf7;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request'](_0x11f3('0x0'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 62f9762..7683b62 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 _0xceda=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x5a6a80,_0x466b3f){var _0xb468de=function(_0x2fa9ab){while(--_0x2fa9ab){_0x5a6a80['push'](_0x5a6a80['shift']());}};_0xb468de(++_0x466b3f);}(_0xceda,0x1c4));var _0xaced=function(_0x4132ae,_0x5d8c08){_0x4132ae=_0x4132ae-0x0;var _0x210763=_0xceda[_0x4132ae];return _0x210763;};'use strict';var client=require(_0xaced('0x0'));exports[_0xaced('0x1')]=function(_0x4ab563){return function(_0x261f5e){return client[_0xaced('0x2')](_0xaced('0x3'),{'options':{'raw':!![],'attributes':['id',_0xaced('0x4'),_0xaced('0x5')]},'log':_0xaced('0x3')});};}; \ No newline at end of file +var _0x5c36=['Request','GetTemplate','name'];(function(_0x11572d,_0x24cc0c){var _0x327fb6=function(_0x2c4adf){while(--_0x2c4adf){_0x11572d['push'](_0x11572d['shift']());}};_0x327fb6(++_0x24cc0c);}(_0x5c36,0x1d1));var _0x65c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c36[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x31d3e5){return function(_0x384d4b){return client[_0x65c3('0x0')](_0x65c3('0x1'),{'options':{'raw':!![],'attributes':['id',_0x65c3('0x2'),'html']},'log':_0x65c3('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index d3649a6..1361a58 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 _0xd6af=['AllConditions','field','operator','Condition','AnyConditions','value','Action','Actions','action','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','status'];(function(_0x7a7770,_0xc7970e){var _0x131a0e=function(_0x165ad2){while(--_0x165ad2){_0x7a7770['push'](_0x7a7770['shift']());}};_0x131a0e(++_0xc7970e);}(_0xd6af,0xa6));var _0xfd6a=function(_0x25f334,_0x44aab9){_0x25f334=_0x25f334-0x0;var _0x11fb6e=_0xd6af[_0x25f334];return _0x11fb6e;};'use strict';var client=require(_0xfd6a('0x0'));exports[_0xfd6a('0x1')]=function(_0x3a71d5){return function(_0xbbfcfb){return client['Request'](_0xfd6a('0x2'),{'options':{'raw':![],'attributes':['id',_0xfd6a('0x3'),'channel',_0xfd6a('0x4')],'include':[{'model':'Condition','as':_0xfd6a('0x5'),'attributes':['id',_0xfd6a('0x6'),_0xfd6a('0x7'),'value']},{'model':_0xfd6a('0x8'),'as':_0xfd6a('0x9'),'attributes':['id','field',_0xfd6a('0x7'),_0xfd6a('0xa')]},{'model':_0xfd6a('0xb'),'as':_0xfd6a('0xc'),'attributes':['id',_0xfd6a('0xd'),'data1','data2',_0xfd6a('0xe'),_0xfd6a('0xf'),_0xfd6a('0x10'),_0xfd6a('0x11'),_0xfd6a('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x8c9c=['data3','data4','data5','data6','data7','GetTrigger','../client','getTriggers','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions'];(function(_0x38c292,_0x24693c){var _0x1aa9ed=function(_0x3e8428){while(--_0x3e8428){_0x38c292['push'](_0x38c292['shift']());}};_0x1aa9ed(++_0x24693c);}(_0x8c9c,0xb1));var _0xc8c9=function(_0x2929ba,_0x506aa6){_0x2929ba=_0x2929ba-0x0;var _0x365e6e=_0x8c9c[_0x2929ba];return _0x365e6e;};'use strict';var client=require(_0xc8c9('0x0'));exports[_0xc8c9('0x1')]=function(_0x18f6ff){return function(_0x49a388){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xc8c9('0x2'),_0xc8c9('0x3'),_0xc8c9('0x4')],'include':[{'model':_0xc8c9('0x5'),'as':_0xc8c9('0x6'),'attributes':['id',_0xc8c9('0x7'),_0xc8c9('0x8'),_0xc8c9('0x9')]},{'model':'Condition','as':_0xc8c9('0xa'),'attributes':['id',_0xc8c9('0x7'),_0xc8c9('0x8'),'value']},{'model':_0xc8c9('0xb'),'as':_0xc8c9('0xc'),'attributes':['id','action','data1','data2',_0xc8c9('0xd'),_0xc8c9('0xe'),_0xc8c9('0xf'),_0xc8c9('0x10'),_0xc8c9('0x11')]}]},'log':_0xc8c9('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index db827ef..4fcab95 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 _0x64b3=['GetTrunk','registry','defaultuser','../client','Request'];(function(_0xd60d7e,_0x58aaf5){var _0xa4a3fa=function(_0x3cbfc1){while(--_0x3cbfc1){_0xd60d7e['push'](_0xd60d7e['shift']());}};_0xa4a3fa(++_0x58aaf5);}(_0x64b3,0x1de));var _0x364b=function(_0x14839f,_0x2d6011){_0x14839f=_0x14839f-0x0;var _0x3678c0=_0x64b3[_0x14839f];return _0x3678c0;};'use strict';var client=require(_0x364b('0x0'));exports['getTrunks']=function(_0x49a796){return function(_0x41a472){return client[_0x364b('0x1')](_0x364b('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x364b('0x3'),_0x364b('0x4')]},'log':_0x364b('0x2')});};}; \ No newline at end of file +var _0x5b02=['Request','name','registry','defaultuser','GetTrunk','../client'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x5b02,0xbf));var _0x25b0=function(_0x5aa4a2,_0x16111a){_0x5aa4a2=_0x5aa4a2-0x0;var _0x3b83e5=_0x5b02[_0x5aa4a2];return _0x3b83e5;};'use strict';var client=require(_0x25b0('0x0'));exports['getTrunks']=function(_0xa45eac){return function(_0x35fd13){return client[_0x25b0('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x25b0('0x2'),_0x25b0('0x3'),_0x25b0('0x4')]},'log':_0x25b0('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 967481f..df0a722 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe706,0xa3));var _0x6e70=function(_0x50c96f,_0x2ee009){_0x50c96f=_0x50c96f-0x0;var _0x38fcf2=_0xe706[_0x50c96f];return _0x38fcf2;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x50079e,_0x2fd209){var _0x449e0e=function(_0x3638a7){while(--_0x3638a7){_0x50079e['push'](_0x50079e['shift']());}};_0x449e0e(++_0x2fd209);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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 0c18c8a..3087e42 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 _0x35a8=['CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x935ec0,_0x42e171){var _0x36e898=function(_0x2b768a){while(--_0x2b768a){_0x935ec0['push'](_0x935ec0['shift']());}};_0x36e898(++_0x42e171);}(_0x35a8,0x18c));var _0x835a=function(_0x5c0064,_0x53f78c){_0x5c0064=_0x5c0064-0x0;var _0x4db306=_0x35a8[_0x5c0064];return _0x4db306;};'use strict';var client=require('../client');exports['create']=function(_0x38eef3){return client['Request']('CreateVoiceAgentReport',{'body':_0x38eef3,'log':_0x835a('0x0')});};exports[_0x835a('0x1')]=function(_0xf0db1c,_0x2c3e5b,_0xd7d4d3){return client[_0x835a('0x2')](_0x835a('0x3'),{'body':_0xf0db1c,'options':{'where':{'uniqueid':_0x2c3e5b,'interface':_0xd7d4d3,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x985c=['CreateVoiceAgentReport','UpdateVoiceAgentReport','create','Request'];(function(_0x2dea9b,_0x6f3b03){var _0x6fcafd=function(_0x2cfd63){while(--_0x2cfd63){_0x2dea9b['push'](_0x2dea9b['shift']());}};_0x6fcafd(++_0x6f3b03);}(_0x985c,0x12e));var _0xc985=function(_0x564993,_0x4fc1cf){_0x564993=_0x564993-0x0;var _0x1d9d04=_0x985c[_0x564993];return _0x1d9d04;};'use strict';var client=require('../client');exports[_0xc985('0x0')]=function(_0x15b04d){return client[_0xc985('0x1')](_0xc985('0x2'),{'body':_0x15b04d,'log':_0xc985('0x2')});};exports['update']=function(_0x2aaf3d,_0x483d9e,_0x24a429){return client[_0xc985('0x1')]('UpdateVoiceAgentReport',{'body':_0x2aaf3d,'options':{'where':{'uniqueid':_0x483d9e,'interface':_0x24a429,'agentcomplete':!![]}},'log':_0xc985('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 8eb655a..36540bb 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 _0xf43f=['endOf','duration','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf43f,0x82));var _0xff43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf43f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xff43('0x0'));var util=require(_0xff43('0x1'));var _=require('lodash');var client=require(_0xff43('0x2'));exports[_0xff43('0x3')]=function(_0x3ee906){return client[_0xff43('0x4')](_0xff43('0x5'),{'body':_[_0xff43('0x6')](_0x3ee906,{'source':_0x3ee906[_0xff43('0x7')],'destinationcontext':_0x3ee906[_0xff43('0x8')],'callerid':_0x3ee906[_0xff43('0x9')],'amaflags':_0xff43('0xa')}),'log':_0xff43('0x5')});};exports[_0xff43('0xb')]=function(){return function(){return client[_0xff43('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xff43('0xc')],'createdAt':{'$between':[moment()[_0xff43('0xd')](_0xff43('0xe'))[_0xff43('0xf')](_0xff43('0x10')),moment()[_0xff43('0x11')](_0xff43('0xe'))[_0xff43('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0xff43('0x12'),_0xff43('0x13')]},'log':_0xff43('0x14')});};}; \ No newline at end of file +var _0xfeff=['create','Request','CreateVoiceCallReport','merge','callerid','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','util','lodash'];(function(_0x1f3b96,_0x45215e){var _0x5dedd9=function(_0x26c1da){while(--_0x26c1da){_0x1f3b96['push'](_0x1f3b96['shift']());}};_0x5dedd9(++_0x45215e);}(_0xfeff,0x13e));var _0xffef=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xfeff[_0x273c39];return _0x46d6b5;};'use strict';var moment=require('moment');var util=require(_0xffef('0x0'));var _=require(_0xffef('0x1'));var client=require('../client');exports[_0xffef('0x2')]=function(_0x19ae56){return client[_0xffef('0x3')](_0xffef('0x4'),{'body':_[_0xffef('0x5')](_0x19ae56,{'source':_0x19ae56['calleridnum'],'destinationcontext':_0x19ae56['context'],'callerid':_0x19ae56[_0xffef('0x6')],'amaflags':'DOCUMENTATION'}),'log':_0xffef('0x4')});};exports[_0xffef('0x7')]=function(){return function(){return client[_0xffef('0x3')](_0xffef('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xffef('0x9')](_0xffef('0xa'))[_0xffef('0xb')](_0xffef('0xc')),moment()['endOf'](_0xffef('0xa'))[_0xffef('0xb')](_0xffef('0xc'))]}},'attributes':[_0xffef('0xd'),_0xffef('0xe'),'duration',_0xffef('0xf')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index e6b7a43..e88d52d 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 _0xb545=['CreateVoiceDialReport','../client'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0xb545,0x135));var _0x5b54=function(_0x476392,_0x43d678){_0x476392=_0x476392-0x0;var _0x25d9f4=_0xb545[_0x476392];return _0x25d9f4;};'use strict';var client=require(_0x5b54('0x0'));exports['create']=function(_0xf4b48b){return client['Request']('CreateVoiceDialReport',{'body':_0xf4b48b,'log':_0x5b54('0x1')});}; \ No newline at end of file +var _0x0605=['Request','CreateVoiceDialReport','../client','create'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x0605,0x14a));var _0x5060=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x0605[_0x3a6efd];return _0x487b9a;};'use strict';var client=require(_0x5060('0x0'));exports[_0x5060('0x1')]=function(_0x2e1af9){return client[_0x5060('0x2')](_0x5060('0x3'),{'body':_0x2e1af9,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index bac53c1..94d37c4 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 _0x71f4=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','Request'];(function(_0x2576bf,_0x5c99fb){var _0x10fde1=function(_0x2bc7e6){while(--_0x2bc7e6){_0x2576bf['push'](_0x2576bf['shift']());}};_0x10fde1(++_0x5c99fb);}(_0x71f4,0xf9));var _0x471f=function(_0x1bdaf5,_0x22045a){_0x1bdaf5=_0x1bdaf5-0x0;var _0x2af1f2=_0x71f4[_0x1bdaf5];return _0x2af1f2;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x471f('0x0')](_0x471f('0x1'),{'options':{'raw':!![],'attributes':['id',_0x471f('0x2'),_0x471f('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x471f('0x4')});};}; \ No newline at end of file +var _0x9086=['exten','recordingFormat','../client','getVoiceExtensions','GetVoiceExtension'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9086,0x10b));var _0x6908=function(_0x187826,_0x357251){_0x187826=_0x187826-0x0;var _0x2c22f5=_0x9086[_0x187826];return _0x2c22f5;};'use strict';var client=require(_0x6908('0x0'));exports[_0x6908('0x1')]=function(){return function(){return client['Request'](_0x6908('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6908('0x3'),_0x6908('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x6908('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b5e6201..84548e2 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 _0xdf1a=['interval','../client','getVoiceQueues','name','acwTimeout','autopause','monitor_format','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdf1a,0x1b9));var _0xadf1=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0xdf1a[_0x919445];return _0x511b3e;};'use strict';var client=require(_0xadf1('0x0'));exports[_0xadf1('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xadf1('0x2'),'acw',_0xadf1('0x3'),_0xadf1('0x4'),_0xadf1('0x5'),'type','dialActive','dialMethod','dialLimitChannel',_0xadf1('0x6'),_0xadf1('0x7'),_0xadf1('0x8'),'dialPredictiveOptimizationPercentage',_0xadf1('0x9'),_0xadf1('0xa'),_0xadf1('0xb'),_0xadf1('0xc'),'dialQueueOptions',_0xadf1('0xd'),'dialQueueProject',_0xadf1('0xe'),_0xadf1('0xf'),_0xadf1('0x10'),_0xadf1('0x11'),_0xadf1('0x12'),'dialNoAnswerRetryFrequency',_0xadf1('0x13'),_0xadf1('0x14'),'dialGlobalInterval',_0xadf1('0x15'),_0xadf1('0x16'),'dialAMDActive',_0xadf1('0x17'),'dialAMDGreeting',_0xadf1('0x18'),_0xadf1('0x19'),_0xadf1('0x1a'),_0xadf1('0x1b'),_0xadf1('0x1c'),_0xadf1('0x1d'),_0xadf1('0x1e'),_0xadf1('0x1f'),_0xadf1('0x20'),_0xadf1('0x21'),_0xadf1('0x22'),_0xadf1('0x23'),'dialAgiAfterHangupClient','dialQueueProject2',_0xadf1('0x5'),_0xadf1('0x24'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xadf1('0x25'),_0xadf1('0x26'),'dialDropMaxRetry',_0xadf1('0x27'),'dialAbandonedMaxRetry',_0xadf1('0x28'),_0xadf1('0x29'),_0xadf1('0x2a'),_0xadf1('0x2b'),_0xadf1('0x2c'),_0xadf1('0x2d'),'dialPredictiveIntervalMaxThreshold',_0xadf1('0x2e')],'include':[{'model':_0xadf1('0x2f'),'as':_0xadf1('0x2f'),'attributes':['id','name',_0xadf1('0x30'),_0xadf1('0x31')]},{'model':_0xadf1('0x32'),'as':_0xadf1('0x33'),'attributes':['id',_0xadf1('0x2')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id','name','callerid',_0xadf1('0x31')]},{'model':_0xadf1('0x34'),'as':'Interval','attributes':['id',_0xadf1('0x2')],'include':[{'model':_0xadf1('0x34'),'as':_0xadf1('0x35'),'attributes':['id',_0xadf1('0x2'),_0xadf1('0x36')]}]}]},'log':_0xadf1('0x1')});};}; \ No newline at end of file +var _0x8f59=['acwTimeout','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0x8f59,0x151));var _0x98f5=function(_0x1d4e21,_0x4e8096){_0x1d4e21=_0x1d4e21-0x0;var _0x178fef=_0x8f59[_0x1d4e21];return _0x178fef;};'use strict';var client=require(_0x98f5('0x0'));exports[_0x98f5('0x1')]=function(){return function(){return client[_0x98f5('0x2')](_0x98f5('0x3'),{'options':{'raw':![],'attributes':['id',_0x98f5('0x4'),'acw',_0x98f5('0x5'),'autopause',_0x98f5('0x6'),'type',_0x98f5('0x7'),'dialMethod',_0x98f5('0x8'),_0x98f5('0x9'),'dialPowerLevel',_0x98f5('0xa'),_0x98f5('0xb'),_0x98f5('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout',_0x98f5('0xd'),_0x98f5('0xe'),_0x98f5('0xf'),_0x98f5('0x10'),_0x98f5('0x11'),_0x98f5('0x12'),_0x98f5('0x13'),_0x98f5('0x14'),_0x98f5('0x15'),_0x98f5('0x16'),_0x98f5('0x17'),'dialGlobalInterval','dialPrefix',_0x98f5('0x18'),_0x98f5('0x19'),_0x98f5('0x1a'),_0x98f5('0x1b'),_0x98f5('0x1c'),'dialAMDTotalAnalysisTime',_0x98f5('0x1d'),_0x98f5('0x1e'),_0x98f5('0x1f'),_0x98f5('0x20'),_0x98f5('0x21'),_0x98f5('0x22'),'dialRecallMeTimeout',_0x98f5('0x23'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x98f5('0x24'),_0x98f5('0x6'),'strategy',_0x98f5('0x25'),_0x98f5('0x26'),'dialNoSuchNumberMaxRetry',_0x98f5('0x27'),'dialDropMaxRetry',_0x98f5('0x28'),_0x98f5('0x29'),_0x98f5('0x2a'),_0x98f5('0x2b'),_0x98f5('0x2c'),'dialAgentRejectMaxRetry',_0x98f5('0x2d'),'mandatoryDisposition',_0x98f5('0x2e'),_0x98f5('0x2f')],'include':[{'model':_0x98f5('0x30'),'as':'Trunk','attributes':['id','name',_0x98f5('0x31'),'active']},{'model':_0x98f5('0x32'),'as':_0x98f5('0x33'),'attributes':['id',_0x98f5('0x4')]},{'model':_0x98f5('0x30'),'as':_0x98f5('0x34'),'attributes':['id',_0x98f5('0x4'),_0x98f5('0x31'),_0x98f5('0x35')]},{'model':_0x98f5('0x36'),'as':_0x98f5('0x36'),'attributes':['id',_0x98f5('0x4')],'include':[{'model':'Interval','as':_0x98f5('0x37'),'attributes':['id','name',_0x98f5('0x38')]}]}]},'log':_0x98f5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index e3e6409..12caa90 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(_0x4e52f8,_0x308a08){var _0x5c00dc=function(_0x22ccaa){while(--_0x22ccaa){_0x4e52f8['push'](_0x4e52f8['shift']());}};_0x5c00dc(++_0x308a08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x12c388,_0x4ee371){var _0x54f5fa=function(_0x385070){while(--_0x385070){_0x12c388['push'](_0x12c388['shift']());}};_0x54f5fa(++_0x4ee371);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 5a50ce8..a105c51 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 _0xc729=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x47e92b,_0x29e3b5){var _0x2da694=function(_0x312ce0){while(--_0x312ce0){_0x47e92b['push'](_0x47e92b['shift']());}};_0x2da694(++_0x29e3b5);}(_0xc729,0x12b));var _0x9c72=function(_0x3c06e2,_0x247e9d){_0x3c06e2=_0x3c06e2-0x0;var _0x3eb59f=_0xc729[_0x3c06e2];return _0x3eb59f;};'use strict';var client=require(_0x9c72('0x0'));exports[_0x9c72('0x1')]=function(_0x47ded0){return function(){return client['Request'](_0x9c72('0x2'),{'options':{'where':{'VoiceQueueId':_0x47ded0,'paused':!![]},'raw':!![]},'log':_0x9c72('0x1')});};}; \ No newline at end of file +var _0x1239=['Request','../client','getVoiceQueueRtPauses'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1239,0x169));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x9123('0x0'));exports[_0x9123('0x1')]=function(_0x14fa18){return function(){return client[_0x9123('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x14fa18,'paused':!![]},'raw':!![]},'log':_0x9123('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d13dc1c..7c14be9 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(_0x2a5b78,_0x5074e2){var _0x5e05df=function(_0x5d1ae6){while(--_0x5d1ae6){_0x2a5b78['push'](_0x2a5b78['shift']());}};_0x5e05df(++_0x5074e2);}(_0x7a54,0x106));var _0x47a5=function(_0x55fe8b,_0xe4ca39){_0x55fe8b=_0x55fe8b-0x0;var _0x109c1e=_0x7a54[_0x55fe8b];return _0x109c1e;};'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(_0x5306ce,_0x309202){var _0xea727e=function(_0x5ca731){while(--_0x5ca731){_0x5306ce['push'](_0x5306ce['shift']());}};_0xea727e(++_0x309202);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 dcb1ba4..652aef7 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 _0x14d2=['transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','attendedTransfer','Request','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid'];(function(_0x41a652,_0x1b41d5){var _0x397ba5=function(_0x2cc18d){while(--_0x2cc18d){_0x41a652['push'](_0x41a652['shift']());}};_0x397ba5(++_0x1b41d5);}(_0x14d2,0x15a));var _0x214d=function(_0x25d074,_0x1950eb){_0x25d074=_0x25d074-0x0;var _0x43c987=_0x14d2[_0x25d074];return _0x43c987;};'use strict';var client=require(_0x214d('0x0'));exports[_0x214d('0x1')]={};exports[_0x214d('0x2')]=function(_0x5f2251){return client['Request'](_0x214d('0x3'),{'body':{'result':_0x5f2251[_0x214d('0x4')],'transfererchannel':_0x5f2251[_0x214d('0x5')],'transferercalleridnum':_0x5f2251[_0x214d('0x6')],'transferercalleridname':_0x5f2251[_0x214d('0x7')],'transfererconnectedlinenum':_0x5f2251['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5f2251[_0x214d('0x8')],'transfereraccountcode':_0x5f2251[_0x214d('0x9')],'transferercontext':_0x5f2251[_0x214d('0xa')],'transfererexten':_0x5f2251[_0x214d('0xb')],'transfererlinkedid':_0x5f2251[_0x214d('0xc')],'transfereechannel':_0x5f2251[_0x214d('0xd')],'transfereecalleridnum':_0x5f2251['transfereecalleridnum'],'transfereecalleridname':_0x5f2251[_0x214d('0xe')],'transfereeconnectedlinenum':_0x5f2251[_0x214d('0xf')],'transfereeconnectedlinename':_0x5f2251[_0x214d('0x10')],'transfereeaccountcode':_0x5f2251[_0x214d('0x11')],'transfereecontext':_0x5f2251[_0x214d('0x12')],'transfereeexten':_0x5f2251[_0x214d('0x13')],'transfereelinkedid':_0x5f2251[_0x214d('0x14')],'isexternal':_0x5f2251[_0x214d('0x15')],'context':_0x5f2251[_0x214d('0x16')],'extension':_0x5f2251['extension'],'type':'blind'},'log':_0x214d('0x3')});};exports[_0x214d('0x17')]=function(_0x467350){return client[_0x214d('0x18')](_0x214d('0x3'),{'body':{'result':_0x467350[_0x214d('0x4')],'transfererchannel':_0x467350['origtransfererchannel'],'transferercalleridnum':_0x467350[_0x214d('0x19')],'transferercalleridname':_0x467350[_0x214d('0x1a')],'transfererconnectedlinenum':_0x467350[_0x214d('0x1b')],'transfererconnectedlinename':_0x467350[_0x214d('0x1c')],'transfereraccountcode':_0x467350[_0x214d('0x1d')],'transferercontext':_0x467350['secondtransferercontext'],'transfererexten':_0x467350[_0x214d('0x1e')],'transfererlinkedid':_0x467350[_0x214d('0x1f')],'transfereechannel':_0x467350[_0x214d('0x20')],'transfereecalleridnum':_0x467350[_0x214d('0x21')],'transfereecalleridname':_0x467350[_0x214d('0x22')],'transfereeconnectedlinenum':_0x467350[_0x214d('0x23')],'transfereeconnectedlinename':_0x467350[_0x214d('0x24')],'transfereeaccountcode':_0x467350[_0x214d('0x25')],'transfereecontext':_0x467350[_0x214d('0x26')],'transfereeexten':_0x467350['transfertargetexten'],'transfereelinkedid':_0x467350['transfertargetlinkedid'],'isexternal':_0x467350[_0x214d('0x15')],'context':_0x467350[_0x214d('0x27')],'extension':_0x467350[_0x214d('0x28')],'type':_0x214d('0x29')},'log':_0x214d('0x3')});}; \ No newline at end of file +var _0xaa3f=['transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x19770a,_0xa051c4){var _0x121317=function(_0x4569af){while(--_0x4569af){_0x19770a['push'](_0x19770a['shift']());}};_0x121317(++_0xa051c4);}(_0xaa3f,0x16e));var _0xfaa3=function(_0xbbc258,_0x54d2b0){_0xbbc258=_0xbbc258-0x0;var _0x19380b=_0xaa3f[_0xbbc258];return _0x19380b;};'use strict';var client=require(_0xfaa3('0x0'));exports['transfers']={};exports[_0xfaa3('0x1')]=function(_0x37866f){return client[_0xfaa3('0x2')](_0xfaa3('0x3'),{'body':{'result':_0x37866f[_0xfaa3('0x4')],'transfererchannel':_0x37866f[_0xfaa3('0x5')],'transferercalleridnum':_0x37866f[_0xfaa3('0x6')],'transferercalleridname':_0x37866f['transferercalleridname'],'transfererconnectedlinenum':_0x37866f[_0xfaa3('0x7')],'transfererconnectedlinename':_0x37866f[_0xfaa3('0x8')],'transfereraccountcode':_0x37866f['transfereraccountcode'],'transferercontext':_0x37866f['transferercontext'],'transfererexten':_0x37866f[_0xfaa3('0x9')],'transfererlinkedid':_0x37866f[_0xfaa3('0xa')],'transfereechannel':_0x37866f[_0xfaa3('0xb')],'transfereecalleridnum':_0x37866f[_0xfaa3('0xc')],'transfereecalleridname':_0x37866f[_0xfaa3('0xd')],'transfereeconnectedlinenum':_0x37866f['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x37866f[_0xfaa3('0xe')],'transfereeaccountcode':_0x37866f[_0xfaa3('0xf')],'transfereecontext':_0x37866f['transfereecontext'],'transfereeexten':_0x37866f[_0xfaa3('0x10')],'transfereelinkedid':_0x37866f[_0xfaa3('0x11')],'isexternal':_0x37866f[_0xfaa3('0x12')],'context':_0x37866f[_0xfaa3('0x13')],'extension':_0x37866f[_0xfaa3('0x14')],'type':_0xfaa3('0x15')},'log':_0xfaa3('0x3')});};exports['attendedTransfer']=function(_0x153631){return client[_0xfaa3('0x2')](_0xfaa3('0x3'),{'body':{'result':_0x153631[_0xfaa3('0x4')],'transfererchannel':_0x153631[_0xfaa3('0x16')],'transferercalleridnum':_0x153631[_0xfaa3('0x17')],'transferercalleridname':_0x153631['origtransferercalleridname'],'transfererconnectedlinenum':_0x153631['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x153631['secondtransfererconnectedlinename'],'transfereraccountcode':_0x153631[_0xfaa3('0x18')],'transferercontext':_0x153631[_0xfaa3('0x19')],'transfererexten':_0x153631['secondtransfererexten'],'transfererlinkedid':_0x153631[_0xfaa3('0x1a')],'transfereechannel':_0x153631[_0xfaa3('0x1b')],'transfereecalleridnum':_0x153631['transfertargetcalleridnum'],'transfereecalleridname':_0x153631[_0xfaa3('0x1c')],'transfereeconnectedlinenum':_0x153631[_0xfaa3('0x1d')],'transfereeconnectedlinename':_0x153631['transfertargetconnectedlinename'],'transfereeaccountcode':_0x153631[_0xfaa3('0x1e')],'transfereecontext':_0x153631[_0xfaa3('0x1f')],'transfereeexten':_0x153631[_0xfaa3('0x20')],'transfereelinkedid':_0x153631[_0xfaa3('0x21')],'isexternal':_0x153631[_0xfaa3('0x12')],'context':_0x153631['origtransferercontext'],'extension':_0x153631[_0xfaa3('0x22')],'type':_0xfaa3('0x23')},'log':_0xfaa3('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index d5fd56f..63f2e7e 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 _0xaf1b=['bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','catch','message','username','Command','then','content','voiceQueues','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x331305,_0x2f6659){_0x331305=_0x331305-0x0;var _0x487ba8=_0xaf1b[_0x331305];return _0x487ba8;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var jayson=require(_0xbaf1('0x2'));var schema=require(_0xbaf1('0x3'));var BPromise=require(_0xbaf1('0x4'));var moment=require(_0xbaf1('0x5'));var config=require(_0xbaf1('0x6'));var properties=require(_0xbaf1('0x7'));var ami=require(_0xbaf1('0x8'));exports[_0xbaf1('0x9')]=function(_0x156a67,_0x97aab,_0x7dd657){return new BPromise(function(_0x2f05ad,_0x548a29){var _0x2e05b5={'QueuePause':function(_0x5f337d){return new Promise(function(_0x16a74d,_0x4eeec4){var _0x2052c8=util[_0xbaf1('0xa')](_0xbaf1('0xb'),'SIP',_0x5f337d[_0xbaf1('0xc')]);if(_0x156a67[_0xbaf1('0xd')]&&_0x156a67['timers'][_0x2052c8]&&_0x156a67[_0xbaf1('0xd')][_0x2052c8]['timer']){_0x156a67[_0xbaf1('0xd')][_0x2052c8][_0xbaf1('0xe')]();}if(_0x156a67[_0xbaf1('0xf')][_0x2052c8]){_0x156a67[_0xbaf1('0xf')][_0x2052c8][_0xbaf1('0x10')]({'statePause':_0x5f337d[_0xbaf1('0x11')]?!![]:![]});}_0x16a74d({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x493f3f){var _0x322058=this;return new Promise(function(_0x1a10d6,_0x22edd9){if(ami[_0xbaf1('0x12')]()==![]){return _0x22edd9(_0x322058[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')]['username'],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}_0x493f3f=_[_0xbaf1('0x17')](_0x493f3f,_[_0xbaf1('0x18')](properties[_0xbaf1('0x19')]));_0x493f3f[_0xbaf1('0x1a')]=_0xbaf1('0x1b');return ami[_0xbaf1('0x1c')](_0x493f3f)['then'](function(_0x33c23b){_0x1a10d6({'code':0xc8,'message':_0x33c23b['message']});})[_0xbaf1('0x1d')](function(_0x3b13b2){_0x22edd9(_0x322058[_0xbaf1('0x13')](0x1f5,_0x3b13b2[_0xbaf1('0x1e')]));});});},'Command':function(_0x498435){var _0x43291c=this;return new Promise(function(_0x52b6da,_0x2ac412){if(ami[_0xbaf1('0x12')]()==![]){return _0x2ac412(_0x43291c['error'](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}_0x498435=_[_0xbaf1('0x17')](_0x498435,'command');_0x498435['action']=_0xbaf1('0x20');return ami[_0xbaf1('0x1c')](_0x498435)[_0xbaf1('0x21')](function(_0x496344){_0x52b6da({'code':0xc8,'message':_0x496344[_0xbaf1('0x22')]});})[_0xbaf1('0x1d')](function(_0x40a0fa){_0x2ac412(_0x43291c['error'](0x1f5,_0x40a0fa[_0xbaf1('0x1e')]));});});},'VoiceQueues':function(_0x5ef6db){return new Promise(function(_0x1e7847,_0x181c9d){var _0xae3b42=[];for(var _0x2afb55 in _0x156a67[_0xbaf1('0x23')]){if(_0x156a67['voiceQueues']['hasOwnProperty'](_0x2afb55)){var _0x1cfbcd=_0x156a67[_0xbaf1('0x23')][_0x2afb55];var _0x33abc0={'id':_0x1cfbcd['id'],'name':_0x1cfbcd[_0xbaf1('0xc')],'strategy':_0x1cfbcd['strategy'],'answered':_0x1cfbcd[_0xbaf1('0x24')],'available':_0x1cfbcd['available'],'loggedIn':_0x1cfbcd[_0xbaf1('0x25')],'pTalking':_0x1cfbcd[_0xbaf1('0x26')],'sumBillable':_0x1cfbcd[_0xbaf1('0x27')],'sumDuration':_0x1cfbcd[_0xbaf1('0x28')],'sumHoldTime':_0x1cfbcd[_0xbaf1('0x29')]||0x0,'talking':_0x1cfbcd[_0xbaf1('0x2a')],'total':_0x1cfbcd[_0xbaf1('0x2b')],'type':_0x1cfbcd['type'],'unmanaged':_0x1cfbcd[_0xbaf1('0x2c')],'abandoned':_0x1cfbcd[_0xbaf1('0x2d')],'waiting':_0x1cfbcd[_0xbaf1('0x2e')],'loggedInDb':_0x1cfbcd[_0xbaf1('0x2f')]};if(_0x1cfbcd[_0xbaf1('0x30')]===_0xbaf1('0x31')){_0x33abc0[_0xbaf1('0x32')]=_0x1cfbcd[_0xbaf1('0x32')];_0x33abc0['dialMethod']=_0x1cfbcd[_0xbaf1('0x33')];_0x33abc0[_0xbaf1('0x34')]=_0x1cfbcd[_0xbaf1('0x34')];_0x33abc0[_0xbaf1('0x35')]=_0x1cfbcd['dialOriginateCallerIdNumber'];_0x33abc0[_0xbaf1('0x36')]=_0x1cfbcd['dialOriginateTimeout'];_0x33abc0[_0xbaf1('0x37')]=_0x1cfbcd['dialPrefix'];_0x33abc0[_0xbaf1('0x38')]=_0x1cfbcd[_0xbaf1('0x38')];_0x33abc0[_0xbaf1('0x39')]=_0x1cfbcd[_0xbaf1('0x39')];_0x33abc0['outboundAnswerCallsDay']=_0x1cfbcd[_0xbaf1('0x3a')];_0x33abc0[_0xbaf1('0x3b')]=_0x1cfbcd[_0xbaf1('0x3b')];_0x33abc0[_0xbaf1('0x3c')]=_0x1cfbcd[_0xbaf1('0x3c')];_0x33abc0[_0xbaf1('0x3d')]=_0x1cfbcd[_0xbaf1('0x3d')];_0x33abc0['outboundDropCallsDayACS']=_0x1cfbcd[_0xbaf1('0x3e')];_0x33abc0[_0xbaf1('0x3f')]=_0x1cfbcd[_0xbaf1('0x3f')];_0x33abc0[_0xbaf1('0x40')]=_0x1cfbcd[_0xbaf1('0x40')];_0x33abc0[_0xbaf1('0x41')]=_0x1cfbcd[_0xbaf1('0x41')];_0x33abc0['outboundNoSuchCallsDay']=_0x1cfbcd[_0xbaf1('0x42')];_0x33abc0['outboundOriginateFailureCallsDay']=_0x1cfbcd[_0xbaf1('0x43')];_0x33abc0[_0xbaf1('0x44')]=_0x1cfbcd[_0xbaf1('0x44')];_0x33abc0[_0xbaf1('0x45')]=_0x1cfbcd[_0xbaf1('0x45')];_0x33abc0[_0xbaf1('0x46')]=_0x1cfbcd[_0xbaf1('0x46')];_0x33abc0[_0xbaf1('0x47')]=_0x1cfbcd[_0xbaf1('0x47')];_0x33abc0['predictiveIntervalAvgHoldtime']=_0x1cfbcd['predictiveIntervalAvgHoldtime'];_0x33abc0['predictiveIntervalAvgTalktime']=_0x1cfbcd[_0xbaf1('0x48')];_0x33abc0[_0xbaf1('0x49')]=_0x1cfbcd['predictiveIntervalDroppedCallsCallersExit'];_0x33abc0[_0xbaf1('0x4a')]=_0x1cfbcd[_0xbaf1('0x4a')];_0x33abc0[_0xbaf1('0x4b')]=_0x1cfbcd['predictiveIntervalErlangCalls'];_0x33abc0[_0xbaf1('0x4c')]=_0x1cfbcd[_0xbaf1('0x4c')];_0x33abc0[_0xbaf1('0x4d')]=_0x1cfbcd['predictiveIntervalHitRate'];_0x33abc0[_0xbaf1('0x4e')]=_0x1cfbcd[_0xbaf1('0x4e')];_0x33abc0['predictiveIntervalPauses']=_0x1cfbcd['predictiveIntervalPauses'];_0x33abc0[_0xbaf1('0x4f')]=_0x1cfbcd['predictiveIntervalAvailable'];_0x33abc0['predictiveIntervalTotalCalls']=_0x1cfbcd['predictiveIntervalTotalCalls'];_0x33abc0[_0xbaf1('0x1e')]=_0x1cfbcd[_0xbaf1('0x1e')];_0x33abc0[_0xbaf1('0x50')]=_0x1cfbcd[_0xbaf1('0x50')];_0x33abc0[_0xbaf1('0x51')]=_0x1cfbcd[_0xbaf1('0x51')];_0x33abc0[_0xbaf1('0x52')]=_0x1cfbcd[_0xbaf1('0x52')];_0x33abc0['erlangAbandonmentRate']=_0x1cfbcd[_0xbaf1('0x53')];_0x33abc0[_0xbaf1('0x54')]=_0x1cfbcd[_0xbaf1('0x54')];_0x33abc0[_0xbaf1('0x55')]=_0x1cfbcd['startPredictive'];_0x33abc0[_0xbaf1('0x56')]=_0x1cfbcd['startProgressive'];}if(_0x1cfbcd[_0xbaf1('0x57')]){_0x33abc0[_0xbaf1('0x57')]={'id':_0x1cfbcd[_0xbaf1('0x57')]['id'],'name':_0x1cfbcd['Trunk'][_0xbaf1('0xc')],'active':_0x1cfbcd[_0xbaf1('0x57')][_0xbaf1('0x58')],'callerid':_0x1cfbcd['Trunk'][_0xbaf1('0x59')]};}if(_0x1cfbcd['Interval']){_0x33abc0['Interval']={'id':_0x1cfbcd['Interval']['id'],'name':_0x1cfbcd[_0xbaf1('0x5a')][_0xbaf1('0xc')]};}_0xae3b42[_0xbaf1('0x5b')](_0x33abc0);}}_0x1e7847({'count':_0xae3b42[_0xbaf1('0x5c')],'rows':_0xae3b42});});},'UpdateVoiceQueue':function(_0x3ed8a0){return new Promise(function(_0x1e5955,_0x52bd9a){var _0x2e09b3=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x23')],{'id':parseInt(_0x3ed8a0['id'])});var _0x752e07=_[_0xbaf1('0x5e')](_0x3ed8a0,['id']);if(_0x2e09b3){for(var _0x21cf40 in _0x752e07){if(typeof _0x752e07[_0x21cf40]!=='undefined'&&typeof _0x2e09b3[_0x21cf40]!==_0xbaf1('0x5f')){_0x2e09b3[_0x21cf40]=_0x752e07[_0x21cf40];}}_0x1e5955(_0x2e09b3);}else{_0x52bd9a();}});},'VoiceChannels':function(_0x58b5a7){return new Promise(function(_0x5847ea,_0x300f67){var _0x12a9a1=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x61')]);_0x5847ea({'count':_0x12a9a1[_0xbaf1('0x5c')],'rows':_0x12a9a1});});},'VoiceChannelMixMonitor':function(_0x55ff0a){var _0x471d44=this;return new Promise(function(_0x4cf95d,_0x20bb7f){if(ami[_0xbaf1('0x12')]()==![]){return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x3a1f4d=schema(properties[_0xbaf1('0x62')])[_0xbaf1('0x3')](_0x55ff0a);if(_0x3a1f4d[_0xbaf1('0x5c')]>0x0){return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x3a1f4d,_0xbaf1('0x1e'))[_0xbaf1('0x16')](',\x20')));}var _0x54f00c=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x61')],{'uniqueid':_0x55ff0a[_0xbaf1('0x64')]});if(_0x54f00c&&_0x54f00c[_0xbaf1('0x65')]){var _0x55aa1e=util[_0xbaf1('0xa')](_0xbaf1('0x66'),_0x55ff0a[_0xbaf1('0x67')]||_0x55ff0a[_0xbaf1('0x64')],_0x55ff0a[_0xbaf1('0xa')]||_0xbaf1('0x68'));return ami['Action']({'action':_0xbaf1('0x69'),'channel':_0x54f00c[_0xbaf1('0x65')],'file':_0x55aa1e,'options':_0xbaf1('0x6a')})[_0xbaf1('0x21')](function(_0x20de2b){var _0x37ee43=_['find'](_0x54f00c[_0xbaf1('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x55aa1e[_0xbaf1('0x6c')]()});if(_[_0xbaf1('0x6d')](_0x37ee43)){_0x54f00c[_0xbaf1('0x6b')][_0xbaf1('0x5b')]({'filename':_0xbaf1('0x6e')+_0x55aa1e[_0xbaf1('0x6c')](),'createdAt':moment()[_0xbaf1('0xa')](_0xbaf1('0x6f')),'mixmonitorid':_0x20de2b[_0xbaf1('0x70')],'status':_0xbaf1('0x71')});}else{_0x37ee43[_0xbaf1('0x70')]=_0x20de2b['mixmonitorid'];_0x37ee43[_0xbaf1('0x72')]='rec';}_0x4cf95d({'code':0xc8,'message':[_0x55ff0a['uniqueid'],'MixMonitor\x20Success',_0x20de2b[_0xbaf1('0x70')]]['join']('\x20'),'mixmonitorid':_0x20de2b['mixmonitorid']});})[_0xbaf1('0x1d')](function(_0x131281){_0x20bb7f(_0x471d44['error'](0x1f5,[_0x55ff0a[_0xbaf1('0x64')],_0x131281[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()][_0xbaf1('0x16')]('\x20')));});}else{return _0x20bb7f(_0x471d44[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceChannelStopMixMonitor':function(_0x1784d8){var _0x18034a=this;return new Promise(function(_0x915a43,_0x2b55aa){if(ami['isConnected']()==![]){return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xbaf1('0x14')]['username'],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x3b2146=schema(properties[_0xbaf1('0x62')])[_0xbaf1('0x3')](_0x1784d8);if(_0x3b2146[_0xbaf1('0x5c')]>0x0){return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x3b2146,_0xbaf1('0x1e'))[_0xbaf1('0x16')](',\x20')));}var _0x369c22=_['find'](_0x156a67[_0xbaf1('0x61')],{'uniqueid':_0x1784d8['uniqueid']});if(_0x369c22){return BPromise[_0xbaf1('0x74')]()['then'](function(){if(_0x369c22[_0xbaf1('0x65')]){return ami[_0xbaf1('0x1c')]({'action':_0xbaf1('0x75'),'channel':_0x369c22[_0xbaf1('0x65')],'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]})['catch'](function(_0x157d17){});}})[_0xbaf1('0x21')](function(){if(_0x369c22[_0xbaf1('0x76')]){return ami['Action']({'action':_0xbaf1('0x75'),'channel':_0x369c22[_0xbaf1('0x76')],'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]})[_0xbaf1('0x1d')](function(_0x1b695e){});}})[_0xbaf1('0x21')](function(_0x547b62){var _0x2f56d6=_[_0xbaf1('0x5d')](_0x369c22[_0xbaf1('0x6b')],{'mixmonitorid':_0x1784d8[_0xbaf1('0x70')]});if(_0x2f56d6){_0x2f56d6[_0xbaf1('0x72')]=_0xbaf1('0x77');}})['then'](function(){var _0x1c886a=util[_0xbaf1('0xa')](_0xbaf1('0x66'),_0x1784d8['filename']||_0x1784d8['uniqueid'],_0x1784d8[_0xbaf1('0xa')]||_0xbaf1('0x68'));var _0x178dd6=_['find'](_0x369c22[_0xbaf1('0x6b')],{'filename':_0xbaf1('0x6e')+_0x1c886a[_0xbaf1('0x6c')]()});if(_0x178dd6){_0x178dd6[_0xbaf1('0x72')]=_0xbaf1('0x77');}})['then'](function(){_0x915a43({'code':0xc8,'message':[_0x1784d8[_0xbaf1('0x64')],_0xbaf1('0x78')][_0xbaf1('0x16')]('\x20')});})['catch'](function(_0x4f9b26){_0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f5,[_0x1784d8[_0xbaf1('0x64')],_0x4f9b26[_0xbaf1('0x1e')]['toLowerCase']()][_0xbaf1('0x16')]('\x20')));});}else{return _0x2b55aa(_0x18034a[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceQueuesChannels':function(_0x50334e){return new Promise(function(_0x464421,_0x41afbd){var _0x50e9dd=_['values'](_0x156a67[_0xbaf1('0x79')]);_0x464421({'count':_0x50e9dd[_0xbaf1('0x5c')],'rows':_0x50e9dd});});},'VoiceQueuesChannel':function(_0x5d0909){var _0x5d28b9=this;return new Promise(function(_0x38bf32,_0x4d28d7){var _0x1f94a9=schema(properties[_0xbaf1('0x7a')])[_0xbaf1('0x3')](_0x5d0909);if(_0x1f94a9[_0xbaf1('0x5c')]>0x0){return _0x4d28d7(_0x5d28b9[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x1f94a9,_0xbaf1('0x1e'))['join'](',\x20')));}var _0x47df91=_['find'](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0x5d0909[_0xbaf1('0x64')]});if(_0x47df91){_0x38bf32(_0x47df91);}else{return _0x4d28d7(_0x5d28b9[_0xbaf1('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0xab1f6e){var _0x12e901=this;return new Promise(function(_0x436da0,_0xf6a307){if(ami['isConnected']()==![]){return _0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f4,[config[_0xbaf1('0x14')]['ip'],config[_0xbaf1('0x14')][_0xbaf1('0x1f')],_0xbaf1('0x15')]['join']('\x20')));}var _0x567211=schema(properties['voicequeuechannelhangup'])[_0xbaf1('0x3')](_0xab1f6e);if(_0x567211[_0xbaf1('0x5c')]>0x0){return _0xf6a307(_0x12e901['error'](0x1f4,_[_0xbaf1('0x63')](_0x567211,'message')[_0xbaf1('0x16')](',\x20')));}var _0x56629a=_[_0xbaf1('0x5d')](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0xab1f6e['uniqueid']});if(_0x56629a&&_0x56629a[_0xbaf1('0x65')]){return ami[_0xbaf1('0x1c')]({'action':_0xbaf1('0x7b'),'channel':_0x56629a[_0xbaf1('0x65')]})[_0xbaf1('0x21')](function(_0x4f64c7){_0x436da0({'code':0xc8,'message':[_0xab1f6e[_0xbaf1('0x64')],_0x4f64c7[_0xbaf1('0x1e')]['toLowerCase']()][_0xbaf1('0x16')]('\x20')});})[_0xbaf1('0x1d')](function(_0x479a1d){_0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f5,[_0xab1f6e[_0xbaf1('0x64')],_0x479a1d[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()][_0xbaf1('0x16')]('\x20')));});}else{return _0xf6a307(_0x12e901[_0xbaf1('0x13')](0x1f5,_0xbaf1('0x73')));}});},'VoiceQueuesChannelRedirect':function(_0x215f54){var _0x32bfca=this;return new Promise(function(_0x116b32,_0x1d6e58){if(ami[_0xbaf1('0x12')]()==![]){return _0x1d6e58(_0x32bfca['error'](0x1f4,[config[_0xbaf1('0x14')]['ip'],config['asterisk'][_0xbaf1('0x1f')],_0xbaf1('0x15')][_0xbaf1('0x16')]('\x20')));}var _0x1a5d4b=schema(properties[_0xbaf1('0x7c')])[_0xbaf1('0x3')](_0x215f54);if(_0x1a5d4b[_0xbaf1('0x5c')]>0x0){return _0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f4,_[_0xbaf1('0x63')](_0x1a5d4b,'message')[_0xbaf1('0x16')](',\x20')));}var _0x57505c=_['find'](_0x156a67[_0xbaf1('0x79')],{'uniqueid':_0x215f54[_0xbaf1('0x64')]});if(_0x57505c&&_0x57505c[_0xbaf1('0x65')]){return ami['Action']({'action':'Redirect','channel':_0x57505c[_0xbaf1('0x65')],'exten':_0x215f54[_0xbaf1('0x7d')],'context':_0x215f54['context']||_0x57505c[_0xbaf1('0x7e')],'priority':0x1})[_0xbaf1('0x21')](function(_0x446682){_0x116b32({'code':0xc8,'message':[_0x215f54[_0xbaf1('0x64')],_0x446682[_0xbaf1('0x1e')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x516da1){_0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f5,[_0x215f54[_0xbaf1('0x64')],_0x516da1[_0xbaf1('0x1e')][_0xbaf1('0x6c')]()]['join']('\x20')));});}else{return _0x1d6e58(_0x32bfca[_0xbaf1('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x21ad47){return new Promise(function(_0x537ce3,_0x35814b){var _0x5a999c=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0xf')]);_0x537ce3({'count':_0x5a999c[_0xbaf1('0x5c')],'rows':_0x5a999c});});},'Telephones':function(_0x20cdc9){return new Promise(function(_0x4973c9,_0xde578b){var _0x12c371=_['values'](_0x156a67[_0xbaf1('0x7f')]);_0x4973c9({'count':_0x12c371[_0xbaf1('0x5c')],'rows':_0x12c371});});},'Trunks':function(_0x46d111){return new Promise(function(_0x11ee42,_0x8f2a02){var _0x2ee0d8=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x80')]);_0x11ee42({'count':_0x2ee0d8['length'],'rows':_0x2ee0d8});});},'OutboundChannels':function(_0x3834dc){return new Promise(function(_0x341715,_0x2eea9c){var _0x539508=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x81')]);_0x341715({'count':_0x539508[_0xbaf1('0x5c')],'rows':_0x539508});});},'Outbound':function(_0x133089){return new Promise(function(_0x204920,_0x481aeb){_0x204920(_0x156a67[_0xbaf1('0x31')]);});},'Campaigns':function(_0x2c0572){return new Promise(function(_0x4609c2,_0x3fa01a){var _0x4ae168=_[_0xbaf1('0x60')](_0x156a67['campaigns']);_0x4609c2({'count':_0x4ae168[_0xbaf1('0x5c')],'rows':_0x4ae168});});},'VoiceQueuesPreview':function(_0x1538ec){var _0x4f1136=this;return new Promise(function(_0xca83ff,_0x57eb50){_0x97aab[_0xbaf1('0x82')](_0x1538ec['id'])[_0xbaf1('0x21')](function(_0x195218){_0xca83ff({'code':0xc8,'message':_0x195218[_0xbaf1('0x1e')]});})[_0xbaf1('0x1d')](function(_0x141e1f){_0x57eb50(_0x4f1136[_0xbaf1('0x13')](0x1f4,_0x141e1f[_0xbaf1('0x1e')]));});});},'EventManager':function(_0x24f73a){var _0x52b7ca=this;return new Promise(function(_0x453231,_0x114cdd){if(!_0x24f73a[_0xbaf1('0x83')]){return _0x114cdd(_0x52b7ca[_0xbaf1('0x13')](0x1f4,_0xbaf1('0x84')));}ami[_0xbaf1('0x85')](_0xbaf1('0x86')+_0x24f73a[_0xbaf1('0x83')],_0x24f73a[_0xbaf1('0x1e')]);_0x453231({'code':0xc8,'message':_0x24f73a});});},'FaxAccounts':function(_0x280213){return new Promise(function(_0x13b4ab,_0x281060){var _0x383b8e=_[_0xbaf1('0x60')](_0x156a67[_0xbaf1('0x87')]);_0x13b4ab({'count':_0x383b8e[_0xbaf1('0x5c')],'rows':_0x383b8e});});},'SendFax':function(_0x2098ee){var _0x28f833=this;return new Promise(function(_0x5a914e,_0x21f6b2){_0x7dd657[_0xbaf1('0x88')](_0x2098ee)[_0xbaf1('0x21')](function(_0x584900){_0x5a914e({'code':0xc8,'message':_0x584900['message']});})[_0xbaf1('0x1d')](function(_0x4706cc){_0x21f6b2(_0x28f833[_0xbaf1('0x13')](0x1f4,_0x4706cc['message']));});});},'CheckAfterSend':function(_0x2349c5){var _0x3516fc=this;return new Promise(function(_0x280f35,_0x44fd6c){_0x7dd657[_0xbaf1('0x89')](_0x2349c5)[_0xbaf1('0x21')](function(_0xd9436f){_0x280f35({'code':0xc8,'message':_0xd9436f[_0xbaf1('0x1e')]});})['catch'](function(_0x56b458){_0x44fd6c(_0x3516fc[_0xbaf1('0x13')](0x1f4,_0x56b458[_0xbaf1('0x1e')]));});});}};var _0x1ff946=jayson['server'](_0x2e05b5)[_0xbaf1('0x8a')]();_0x1ff946['on'](_0xbaf1('0x13'),function(_0x1728cf){return _0x548a29(_0x1728cf);});_0x1ff946['listen'](0x232a,_0xbaf1('0x8b'),function(){console[_0xbaf1('0x8c')](_0xbaf1('0x8d'),0x232a);return _0x2f05ad(_0xbaf1('0x8e')+0x232a);});});}; \ No newline at end of file +var _0x6f44=['dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','uniqueid','channel','%s.%s','format','wav','MixMonitor','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','map','resolve','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outbound','run','custom:','event','faxAccounts','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','join','module','action','Reload','catch','message','error','ami\x20disconnected','pick','command','Action','then','content','voiceQueues','hasOwnProperty','answered','sumBillable','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x29b189,_0xd06e03){var _0x179382=function(_0x4a68dd){while(--_0x4a68dd){_0x29b189['push'](_0x29b189['shift']());}};_0x179382(++_0xd06e03);}(_0x6f44,0x1ea));var _0x46f4=function(_0x3255c2,_0x4aa0cf){_0x3255c2=_0x3255c2-0x0;var _0x36fd5a=_0x6f44[_0x3255c2];return _0x36fd5a;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var jayson=require('jayson/promise');var schema=require(_0x46f4('0x2'));var BPromise=require(_0x46f4('0x3'));var moment=require(_0x46f4('0x4'));var config=require(_0x46f4('0x5'));var properties=require(_0x46f4('0x6'));var ami=require(_0x46f4('0x7'));exports[_0x46f4('0x8')]=function(_0x200f8b,_0xfb0203,_0x57f1a9){return new BPromise(function(_0x169a5a,_0x2a50b1){var _0x37d6a2={'QueuePause':function(_0x4b791c){return new Promise(function(_0x5ce344,_0x357069){var _0x132ae1=util['format'](_0x46f4('0x9'),'SIP',_0x4b791c[_0x46f4('0xa')]);if(_0x200f8b['timers']&&_0x200f8b[_0x46f4('0xb')][_0x132ae1]&&_0x200f8b[_0x46f4('0xb')][_0x132ae1][_0x46f4('0xc')]){_0x200f8b[_0x46f4('0xb')][_0x132ae1][_0x46f4('0xd')]();}if(_0x200f8b[_0x46f4('0xe')][_0x132ae1]){_0x200f8b[_0x46f4('0xe')][_0x132ae1][_0x46f4('0xf')]({'statePause':_0x4b791c[_0x46f4('0x10')]?!![]:![]});}_0x5ce344({'code':0xc8,'message':_0x46f4('0x11')});});},'Reload':function(_0x1dd233){var _0x1262f6=this;return new Promise(function(_0x5649ad,_0x3b3b92){if(ami[_0x46f4('0x12')]()==![]){return _0x3b3b92(_0x1262f6['error'](0x1f4,[config[_0x46f4('0x13')]['ip'],config[_0x46f4('0x13')][_0x46f4('0x14')],'ami\x20disconnected'][_0x46f4('0x15')]('\x20')));}_0x1dd233=_['pick'](_0x1dd233,_['keys'](properties[_0x46f4('0x16')]));_0x1dd233[_0x46f4('0x17')]=_0x46f4('0x18');return ami['Action'](_0x1dd233)['then'](function(_0x5e237d){_0x5649ad({'code':0xc8,'message':_0x5e237d['message']});})[_0x46f4('0x19')](function(_0x433297){_0x3b3b92(_0x1262f6['error'](0x1f5,_0x433297[_0x46f4('0x1a')]));});});},'Command':function(_0x108e6d){var _0x2232d6=this;return new Promise(function(_0x33521e,_0x4b0650){if(ami[_0x46f4('0x12')]()==![]){return _0x4b0650(_0x2232d6[_0x46f4('0x1b')](0x1f4,[config[_0x46f4('0x13')]['ip'],config[_0x46f4('0x13')][_0x46f4('0x14')],_0x46f4('0x1c')]['join']('\x20')));}_0x108e6d=_[_0x46f4('0x1d')](_0x108e6d,_0x46f4('0x1e'));_0x108e6d[_0x46f4('0x17')]='Command';return ami[_0x46f4('0x1f')](_0x108e6d)[_0x46f4('0x20')](function(_0x185ec2){_0x33521e({'code':0xc8,'message':_0x185ec2[_0x46f4('0x21')]});})[_0x46f4('0x19')](function(_0x41be5e){_0x4b0650(_0x2232d6[_0x46f4('0x1b')](0x1f5,_0x41be5e[_0x46f4('0x1a')]));});});},'VoiceQueues':function(_0x39eb2f){return new Promise(function(_0x301e24,_0x2ad553){var _0x16cd7f=[];for(var _0x197e55 in _0x200f8b['voiceQueues']){if(_0x200f8b[_0x46f4('0x22')][_0x46f4('0x23')](_0x197e55)){var _0xb23194=_0x200f8b[_0x46f4('0x22')][_0x197e55];var _0x57eb00={'id':_0xb23194['id'],'name':_0xb23194[_0x46f4('0xa')],'strategy':_0xb23194['strategy'],'answered':_0xb23194[_0x46f4('0x24')],'available':_0xb23194['available'],'loggedIn':_0xb23194['loggedIn'],'pTalking':_0xb23194['pTalking'],'sumBillable':_0xb23194[_0x46f4('0x25')],'sumDuration':_0xb23194['sumDuration'],'sumHoldTime':_0xb23194[_0x46f4('0x26')]||0x0,'talking':_0xb23194[_0x46f4('0x27')],'total':_0xb23194[_0x46f4('0x28')],'type':_0xb23194[_0x46f4('0x29')],'unmanaged':_0xb23194[_0x46f4('0x2a')],'abandoned':_0xb23194['abandoned'],'waiting':_0xb23194[_0x46f4('0x2b')],'loggedInDb':_0xb23194[_0x46f4('0x2c')]};if(_0xb23194[_0x46f4('0x29')]==='outbound'){_0x57eb00[_0x46f4('0x2d')]=_0xb23194[_0x46f4('0x2d')];_0x57eb00[_0x46f4('0x2e')]=_0xb23194['dialMethod'];_0x57eb00['dialOriginateCallerIdName']=_0xb23194[_0x46f4('0x2f')];_0x57eb00[_0x46f4('0x30')]=_0xb23194[_0x46f4('0x30')];_0x57eb00['dialOriginateTimeout']=_0xb23194[_0x46f4('0x31')];_0x57eb00[_0x46f4('0x32')]=_0xb23194['dialPrefix'];_0x57eb00[_0x46f4('0x33')]=_0xb23194['temp'];_0x57eb00[_0x46f4('0x34')]=_0xb23194[_0x46f4('0x34')];_0x57eb00[_0x46f4('0x35')]=_0xb23194[_0x46f4('0x35')];_0x57eb00[_0x46f4('0x36')]=_0xb23194['outboundBlacklistCallsDay'];_0x57eb00[_0x46f4('0x37')]=_0xb23194[_0x46f4('0x37')];_0x57eb00['outboundCongestionCallsDay']=_0xb23194[_0x46f4('0x38')];_0x57eb00[_0x46f4('0x39')]=_0xb23194[_0x46f4('0x39')];_0x57eb00[_0x46f4('0x3a')]=_0xb23194['outboundDropCallsDayCallersExit'];_0x57eb00[_0x46f4('0x3b')]=_0xb23194['outboundDropCallsDayTimeout'];_0x57eb00[_0x46f4('0x3c')]=_0xb23194[_0x46f4('0x3c')];_0x57eb00[_0x46f4('0x3d')]=_0xb23194[_0x46f4('0x3d')];_0x57eb00['outboundOriginateFailureCallsDay']=_0xb23194[_0x46f4('0x3e')];_0x57eb00['outboundReCallsDay']=_0xb23194['outboundReCallsDay'];_0x57eb00[_0x46f4('0x3f')]=_0xb23194['outboundRejectCallsDay'];_0x57eb00['outboundUnknownCallsDay']=_0xb23194[_0x46f4('0x40')];_0x57eb00[_0x46f4('0x41')]=_0xb23194['predictiveIntervalAnsweredCalls'];_0x57eb00[_0x46f4('0x42')]=_0xb23194['predictiveIntervalAvgHoldtime'];_0x57eb00[_0x46f4('0x43')]=_0xb23194[_0x46f4('0x43')];_0x57eb00[_0x46f4('0x44')]=_0xb23194[_0x46f4('0x44')];_0x57eb00['predictiveIntervalDroppedCallsTimeout']=_0xb23194[_0x46f4('0x45')];_0x57eb00[_0x46f4('0x46')]=_0xb23194[_0x46f4('0x46')];_0x57eb00['predictiveIntervalErlangCallsDroppedCalls']=_0xb23194['predictiveIntervalErlangCallsDroppedCalls'];_0x57eb00['predictiveIntervalHitRate']=_0xb23194[_0x46f4('0x47')];_0x57eb00[_0x46f4('0x48')]=_0xb23194[_0x46f4('0x48')];_0x57eb00[_0x46f4('0x49')]=_0xb23194['predictiveIntervalPauses'];_0x57eb00[_0x46f4('0x4a')]=_0xb23194[_0x46f4('0x4a')];_0x57eb00[_0x46f4('0x4b')]=_0xb23194[_0x46f4('0x4b')];_0x57eb00[_0x46f4('0x1a')]=_0xb23194['message'];_0x57eb00[_0x46f4('0x4c')]=_0xb23194[_0x46f4('0x4c')];_0x57eb00[_0x46f4('0x4d')]=_0xb23194[_0x46f4('0x4d')];_0x57eb00[_0x46f4('0x4e')]=_0xb23194['erlangCallToSecond'];_0x57eb00['erlangAbandonmentRate']=_0xb23194['erlangAbandonmentRate'];_0x57eb00[_0x46f4('0x4f')]=_0xb23194[_0x46f4('0x4f')];_0x57eb00[_0x46f4('0x50')]=_0xb23194['startPredictive'];_0x57eb00[_0x46f4('0x51')]=_0xb23194[_0x46f4('0x51')];}if(_0xb23194[_0x46f4('0x52')]){_0x57eb00[_0x46f4('0x52')]={'id':_0xb23194[_0x46f4('0x52')]['id'],'name':_0xb23194[_0x46f4('0x52')][_0x46f4('0xa')],'active':_0xb23194[_0x46f4('0x52')][_0x46f4('0x53')],'callerid':_0xb23194[_0x46f4('0x52')][_0x46f4('0x54')]};}if(_0xb23194[_0x46f4('0x55')]){_0x57eb00[_0x46f4('0x55')]={'id':_0xb23194['Interval']['id'],'name':_0xb23194[_0x46f4('0x55')][_0x46f4('0xa')]};}_0x16cd7f[_0x46f4('0x56')](_0x57eb00);}}_0x301e24({'count':_0x16cd7f[_0x46f4('0x57')],'rows':_0x16cd7f});});},'UpdateVoiceQueue':function(_0x3dc58d){return new Promise(function(_0x39c024,_0x5ee613){var _0x5e1cd3=_['find'](_0x200f8b[_0x46f4('0x22')],{'id':parseInt(_0x3dc58d['id'])});var _0x1c933f=_[_0x46f4('0x58')](_0x3dc58d,['id']);if(_0x5e1cd3){for(var _0x19b357 in _0x1c933f){if(typeof _0x1c933f[_0x19b357]!==_0x46f4('0x59')&&typeof _0x5e1cd3[_0x19b357]!==_0x46f4('0x59')){_0x5e1cd3[_0x19b357]=_0x1c933f[_0x19b357];}}_0x39c024(_0x5e1cd3);}else{_0x5ee613();}});},'VoiceChannels':function(_0x2ca55d){return new Promise(function(_0xf76f55,_0x35b5a4){var _0xf73c15=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x5b')]);_0xf76f55({'count':_0xf73c15['length'],'rows':_0xf73c15});});},'VoiceChannelMixMonitor':function(_0x109d2f){var _0x23939f=this;return new Promise(function(_0x159fa8,_0x5e2024){if(ami['isConnected']()==![]){return _0x5e2024(_0x23939f[_0x46f4('0x1b')](0x1f4,[config[_0x46f4('0x13')]['ip'],config[_0x46f4('0x13')]['username'],'ami\x20disconnected'][_0x46f4('0x15')]('\x20')));}var _0x1e3551=schema(properties[_0x46f4('0x5c')])[_0x46f4('0x2')](_0x109d2f);if(_0x1e3551[_0x46f4('0x57')]>0x0){return _0x5e2024(_0x23939f[_0x46f4('0x1b')](0x1f4,_['map'](_0x1e3551,_0x46f4('0x1a'))[_0x46f4('0x15')](',\x20')));}var _0x11906a=_['find'](_0x200f8b[_0x46f4('0x5b')],{'uniqueid':_0x109d2f[_0x46f4('0x5d')]});if(_0x11906a&&_0x11906a[_0x46f4('0x5e')]){var _0x58e3b5=util['format'](_0x46f4('0x5f'),_0x109d2f['filename']||_0x109d2f[_0x46f4('0x5d')],_0x109d2f[_0x46f4('0x60')]||_0x46f4('0x61'));return ami['Action']({'action':_0x46f4('0x62'),'channel':_0x11906a[_0x46f4('0x5e')],'file':_0x58e3b5,'options':'ai(mixmonitorid)'})[_0x46f4('0x20')](function(_0x4a0fe7){var _0x5e6271=_[_0x46f4('0x63')](_0x11906a[_0x46f4('0x64')],{'filename':_0x46f4('0x65')+_0x58e3b5[_0x46f4('0x66')]()});if(_['isNil'](_0x5e6271)){_0x11906a['monitors']['push']({'filename':_0x46f4('0x65')+_0x58e3b5[_0x46f4('0x66')](),'createdAt':moment()['format'](_0x46f4('0x67')),'mixmonitorid':_0x4a0fe7[_0x46f4('0x68')],'status':_0x46f4('0x69')});}else{_0x5e6271[_0x46f4('0x68')]=_0x4a0fe7['mixmonitorid'];_0x5e6271[_0x46f4('0x6a')]='rec';}_0x159fa8({'code':0xc8,'message':[_0x109d2f[_0x46f4('0x5d')],_0x46f4('0x6b'),_0x4a0fe7[_0x46f4('0x68')]][_0x46f4('0x15')]('\x20'),'mixmonitorid':_0x4a0fe7[_0x46f4('0x68')]});})[_0x46f4('0x19')](function(_0x1cd5f0){_0x5e2024(_0x23939f[_0x46f4('0x1b')](0x1f5,[_0x109d2f[_0x46f4('0x5d')],_0x1cd5f0[_0x46f4('0x1a')][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')));});}else{return _0x5e2024(_0x23939f[_0x46f4('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3c23a8){var _0x228435=this;return new Promise(function(_0x5538b9,_0x509f82){if(ami[_0x46f4('0x12')]()==![]){return _0x509f82(_0x228435[_0x46f4('0x1b')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x46f4('0x14')],'ami\x20disconnected'][_0x46f4('0x15')]('\x20')));}var _0x16908b=schema(properties[_0x46f4('0x5c')])[_0x46f4('0x2')](_0x3c23a8);if(_0x16908b[_0x46f4('0x57')]>0x0){return _0x509f82(_0x228435['error'](0x1f4,_[_0x46f4('0x6c')](_0x16908b,'message')['join'](',\x20')));}var _0x265b1a=_[_0x46f4('0x63')](_0x200f8b[_0x46f4('0x5b')],{'uniqueid':_0x3c23a8[_0x46f4('0x5d')]});if(_0x265b1a){return BPromise[_0x46f4('0x6d')]()[_0x46f4('0x20')](function(){if(_0x265b1a['channel']){return ami[_0x46f4('0x1f')]({'action':_0x46f4('0x6e'),'channel':_0x265b1a[_0x46f4('0x5e')],'mixmonitorid':_0x3c23a8[_0x46f4('0x68')]})[_0x46f4('0x19')](function(_0x115d77){});}})[_0x46f4('0x20')](function(){if(_0x265b1a[_0x46f4('0x6f')]){return ami[_0x46f4('0x1f')]({'action':_0x46f4('0x6e'),'channel':_0x265b1a[_0x46f4('0x6f')],'mixmonitorid':_0x3c23a8[_0x46f4('0x68')]})[_0x46f4('0x19')](function(_0x2ffbc9){});}})[_0x46f4('0x20')](function(_0x1d4e0b){var _0x23e6b9=_[_0x46f4('0x63')](_0x265b1a['monitors'],{'mixmonitorid':_0x3c23a8[_0x46f4('0x68')]});if(_0x23e6b9){_0x23e6b9[_0x46f4('0x6a')]=_0x46f4('0x70');}})[_0x46f4('0x20')](function(){var _0x36ae73=util['format'](_0x46f4('0x5f'),_0x3c23a8[_0x46f4('0x71')]||_0x3c23a8[_0x46f4('0x5d')],_0x3c23a8[_0x46f4('0x60')]||_0x46f4('0x61'));var _0x2a3a17=_[_0x46f4('0x63')](_0x265b1a[_0x46f4('0x64')],{'filename':_0x46f4('0x65')+_0x36ae73[_0x46f4('0x66')]()});if(_0x2a3a17){_0x2a3a17[_0x46f4('0x6a')]=_0x46f4('0x70');}})[_0x46f4('0x20')](function(){_0x5538b9({'code':0xc8,'message':[_0x3c23a8[_0x46f4('0x5d')],_0x46f4('0x72')][_0x46f4('0x15')]('\x20')});})[_0x46f4('0x19')](function(_0x32ce0c){_0x509f82(_0x228435[_0x46f4('0x1b')](0x1f5,[_0x3c23a8[_0x46f4('0x5d')],_0x32ce0c[_0x46f4('0x1a')][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')));});}else{return _0x509f82(_0x228435[_0x46f4('0x1b')](0x1f5,_0x46f4('0x73')));}});},'VoiceQueuesChannels':function(_0x4dd498){return new Promise(function(_0x43d3d0,_0x55a419){var _0x2a23b8=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x74')]);_0x43d3d0({'count':_0x2a23b8[_0x46f4('0x57')],'rows':_0x2a23b8});});},'VoiceQueuesChannel':function(_0x462e0e){var _0x20fdb1=this;return new Promise(function(_0x1b29cd,_0x2d804c){var _0x576574=schema(properties[_0x46f4('0x75')])[_0x46f4('0x2')](_0x462e0e);if(_0x576574['length']>0x0){return _0x2d804c(_0x20fdb1[_0x46f4('0x1b')](0x1f4,_[_0x46f4('0x6c')](_0x576574,_0x46f4('0x1a'))[_0x46f4('0x15')](',\x20')));}var _0x33581c=_['find'](_0x200f8b[_0x46f4('0x74')],{'uniqueid':_0x462e0e['uniqueid']});if(_0x33581c){_0x1b29cd(_0x33581c);}else{return _0x2d804c(_0x20fdb1[_0x46f4('0x1b')](0x1f5,_0x46f4('0x73')));}});},'VoiceQueuesChannelHangup':function(_0x460f00){var _0x54900c=this;return new Promise(function(_0x33da2d,_0x2a2e0b){if(ami[_0x46f4('0x12')]()==![]){return _0x2a2e0b(_0x54900c[_0x46f4('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x46f4('0x13')][_0x46f4('0x14')],_0x46f4('0x1c')][_0x46f4('0x15')]('\x20')));}var _0x433340=schema(properties[_0x46f4('0x76')])[_0x46f4('0x2')](_0x460f00);if(_0x433340[_0x46f4('0x57')]>0x0){return _0x2a2e0b(_0x54900c['error'](0x1f4,_[_0x46f4('0x6c')](_0x433340,_0x46f4('0x1a'))[_0x46f4('0x15')](',\x20')));}var _0x19ad9b=_[_0x46f4('0x63')](_0x200f8b['queueChannels'],{'uniqueid':_0x460f00[_0x46f4('0x5d')]});if(_0x19ad9b&&_0x19ad9b['channel']){return ami[_0x46f4('0x1f')]({'action':'Hangup','channel':_0x19ad9b[_0x46f4('0x5e')]})[_0x46f4('0x20')](function(_0x4edeb9){_0x33da2d({'code':0xc8,'message':[_0x460f00['uniqueid'],_0x4edeb9[_0x46f4('0x1a')][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')});})[_0x46f4('0x19')](function(_0x439197){_0x2a2e0b(_0x54900c[_0x46f4('0x1b')](0x1f5,[_0x460f00[_0x46f4('0x5d')],_0x439197['message'][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')));});}else{return _0x2a2e0b(_0x54900c[_0x46f4('0x1b')](0x1f5,_0x46f4('0x73')));}});},'VoiceQueuesChannelRedirect':function(_0x2c91be){var _0x43d539=this;return new Promise(function(_0x58489d,_0x28925c){if(ami[_0x46f4('0x12')]()==![]){return _0x28925c(_0x43d539['error'](0x1f4,[config[_0x46f4('0x13')]['ip'],config['asterisk'][_0x46f4('0x14')],'ami\x20disconnected'][_0x46f4('0x15')]('\x20')));}var _0x8e0a4d=schema(properties[_0x46f4('0x77')])['validate'](_0x2c91be);if(_0x8e0a4d[_0x46f4('0x57')]>0x0){return _0x28925c(_0x43d539[_0x46f4('0x1b')](0x1f4,_[_0x46f4('0x6c')](_0x8e0a4d,_0x46f4('0x1a'))['join'](',\x20')));}var _0x1c522f=_[_0x46f4('0x63')](_0x200f8b['queueChannels'],{'uniqueid':_0x2c91be[_0x46f4('0x5d')]});if(_0x1c522f&&_0x1c522f[_0x46f4('0x5e')]){return ami[_0x46f4('0x1f')]({'action':_0x46f4('0x78'),'channel':_0x1c522f['channel'],'exten':_0x2c91be[_0x46f4('0x79')],'context':_0x2c91be[_0x46f4('0x7a')]||_0x1c522f['context'],'priority':0x1})[_0x46f4('0x20')](function(_0x50d2b3){_0x58489d({'code':0xc8,'message':[_0x2c91be[_0x46f4('0x5d')],_0x50d2b3[_0x46f4('0x1a')][_0x46f4('0x66')]()]['join']('\x20')});})[_0x46f4('0x19')](function(_0xa5ec18){_0x28925c(_0x43d539['error'](0x1f5,[_0x2c91be[_0x46f4('0x5d')],_0xa5ec18[_0x46f4('0x1a')][_0x46f4('0x66')]()][_0x46f4('0x15')]('\x20')));});}else{return _0x28925c(_0x43d539[_0x46f4('0x1b')](0x1f5,_0x46f4('0x73')));}});},'Agents':function(_0x3ed2ea){return new Promise(function(_0x31fb77,_0x197f19){var _0x32034a=_['values'](_0x200f8b[_0x46f4('0xe')]);_0x31fb77({'count':_0x32034a[_0x46f4('0x57')],'rows':_0x32034a});});},'Telephones':function(_0x42a2be){return new Promise(function(_0x513d58,_0x2df7dc){var _0x2f7ca8=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x7b')]);_0x513d58({'count':_0x2f7ca8[_0x46f4('0x57')],'rows':_0x2f7ca8});});},'Trunks':function(_0x1087a5){return new Promise(function(_0x963a74,_0x21e260){var _0x181690=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x7c')]);_0x963a74({'count':_0x181690[_0x46f4('0x57')],'rows':_0x181690});});},'OutboundChannels':function(_0x21411f){return new Promise(function(_0x4a0a02,_0x139714){var _0x58c781=_[_0x46f4('0x5a')](_0x200f8b['outboundChannels']);_0x4a0a02({'count':_0x58c781[_0x46f4('0x57')],'rows':_0x58c781});});},'Outbound':function(_0x3d56b5){return new Promise(function(_0xe6f4b6,_0x53d656){_0xe6f4b6(_0x200f8b[_0x46f4('0x7d')]);});},'Campaigns':function(_0x1b438d){return new Promise(function(_0x30ada9,_0x5dec66){var _0x4eabcd=_[_0x46f4('0x5a')](_0x200f8b['campaigns']);_0x30ada9({'count':_0x4eabcd[_0x46f4('0x57')],'rows':_0x4eabcd});});},'VoiceQueuesPreview':function(_0x102c46){var _0x50ae14=this;return new Promise(function(_0x31219b,_0x1d95e2){_0xfb0203[_0x46f4('0x7e')](_0x102c46['id'])['then'](function(_0x4d0729){_0x31219b({'code':0xc8,'message':_0x4d0729[_0x46f4('0x1a')]});})[_0x46f4('0x19')](function(_0x3798b4){_0x1d95e2(_0x50ae14[_0x46f4('0x1b')](0x1f4,_0x3798b4[_0x46f4('0x1a')]));});});},'EventManager':function(_0x52250f){var _0x3fcd7e=this;return new Promise(function(_0x11fef8,_0x31f01b){if(!_0x52250f['event']){return _0x31f01b(_0x3fcd7e[_0x46f4('0x1b')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x46f4('0x7f')+_0x52250f[_0x46f4('0x80')],_0x52250f[_0x46f4('0x1a')]);_0x11fef8({'code':0xc8,'message':_0x52250f});});},'FaxAccounts':function(_0x110fc0){return new Promise(function(_0x51bbde,_0x24abb3){var _0x21cfb6=_[_0x46f4('0x5a')](_0x200f8b[_0x46f4('0x81')]);_0x51bbde({'count':_0x21cfb6[_0x46f4('0x57')],'rows':_0x21cfb6});});},'SendFax':function(_0x577c48){var _0xa1d6bf=this;return new Promise(function(_0x31acdc,_0x2f3aed){_0x57f1a9['send'](_0x577c48)[_0x46f4('0x20')](function(_0x1256cb){_0x31acdc({'code':0xc8,'message':_0x1256cb['message']});})[_0x46f4('0x19')](function(_0x2b1bb4){_0x2f3aed(_0xa1d6bf[_0x46f4('0x1b')](0x1f4,_0x2b1bb4['message']));});});},'CheckAfterSend':function(_0x41959b){var _0x3bcf24=this;return new Promise(function(_0x4ffca2,_0x2748be){_0x57f1a9[_0x46f4('0x82')](_0x41959b)['then'](function(_0x3304d0){_0x4ffca2({'code':0xc8,'message':_0x3304d0[_0x46f4('0x1a')]});})[_0x46f4('0x19')](function(_0x133a4c){_0x2748be(_0x3bcf24[_0x46f4('0x1b')](0x1f4,_0x133a4c[_0x46f4('0x1a')]));});});}};var _0x10ba2e=jayson[_0x46f4('0x83')](_0x37d6a2)[_0x46f4('0x84')]();_0x10ba2e['on'](_0x46f4('0x1b'),function(_0x150ace){return _0x2a50b1(_0x150ace);});_0x10ba2e[_0x46f4('0x8')](0x232a,_0x46f4('0x85'),function(){console['log'](_0x46f4('0x86'),0x232a);return _0x169a5a('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 33241a2..9b80432 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 _0x877d=['union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','isNil','routeId','calleridname','','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','push','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','$or','map','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt'];(function(_0x26b5e4,_0x1a4fa0){var _0x37ee61=function(_0x5550e8){while(--_0x5550e8){_0x26b5e4['push'](_0x26b5e4['shift']());}};_0x37ee61(++_0x1a4fa0);}(_0x877d,0x7c));var _0xd877=function(_0x123092,_0x4655bc){_0x123092=_0x123092-0x0;var _0x2816cc=_0x877d[_0x123092];return _0x2816cc;};'use strict';var _=require(_0xd877('0x0'));var BPromise=require(_0xd877('0x1'));var Redis=require(_0xd877('0x2'));var util=require(_0xd877('0x3'));var config=require(_0xd877('0x4'));var logger=require(_0xd877('0x5'))(_0xd877('0x6'));var cmContactRpc=require(_0xd877('0x7'));config[_0xd877('0x8')]=_[_0xd877('0x9')](config[_0xd877('0x8')],{'host':_0xd877('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd877('0x8')]));function emit(_0x3822b5,_0x19bed7,_0x2db92d,_0x4f5a82,_0x2ba74a){logger[_0xd877('0xb')](_0xd877('0xc'),_0x3822b5,_0x19bed7['id'],_0x2db92d,_0x4f5a82,JSON['stringify'](_0x2ba74a));io['to'](_0x2db92d)[_0xd877('0xd')](_0x4f5a82,_0x2ba74a);}exports[_0xd877('0xe')]=function(_0x1cf6c9,_0x5f2afc,_0x53d9a2,_0x39db30){var _0x1ccb15,_0x32691d;var _0x30e8b4={};var _0x3c5831=Number(_0x53d9a2[_0xd877('0xf')]);var _0xa42b1f=_0x53d9a2[_0xd877('0x10')]?Boolean(Number(_0x53d9a2['data2'])):![];var _0x3d0448;if(_0x39db30[_0xd877('0x11')]){_0x30e8b4['id']=_0x39db30[_0xd877('0x11')];}if(!_0x30e8b4['id']){_0x30e8b4[_0xd877('0x12')]=_0x3c5831;_0x3d0448=_0x53d9a2[_0xd877('0x13')]&&_0x53d9a2['data3']!=='0'?_0x53d9a2[_0xd877('0x13')][_0xd877('0x14')](','):['phone'];_0x30e8b4[_0xd877('0x15')]=_[_0xd877('0x16')](_0x3d0448,function(_0x221228){var _0x4d079d={};_0x4d079d[_0x221228]=_0x39db30['routeId']?_0x39db30[_0xd877('0x17')]:_0x39db30[_0xd877('0x18')];return _0x4d079d;});}var _0x93b90b=['id',_0xd877('0x19'),_0xd877('0x1a'),_0xd877('0x1b'),_0xd877('0x1c'),_0xd877('0x1d'),_0xd877('0x12'),_0xd877('0x1e'),_0xd877('0x1f'),'updatedAt'];var _0x56087b=_[_0xd877('0x20')](_0x93b90b,_0x3d0448);BPromise[_0xd877('0x21')]()[_0xd877('0x22')](cmContactRpc['getContacts']({'attributes':_0x56087b,'where':_0x30e8b4}))[_0xd877('0x22')](function(_0x3e2348){_0x32691d=_0x3e2348;if(!_[_0xd877('0x23')](_0x32691d)){if(_0x32691d[_0xd877('0x24')]===0x1){_0x1ccb15=_0x32691d[0x0];logger[_0xd877('0xb')](_0xd877('0x25'),_0x39db30[_0xd877('0x26')],_0x5f2afc['id'],_0x1ccb15['id']);}else{logger[_0xd877('0xb')](_0xd877('0x27'),_0x39db30[_0xd877('0x26')],_0x5f2afc['id'],_[_0xd877('0x16')](_0x32691d,'id')[_0xd877('0x28')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x39db30[_0xd877('0x26')],_0x5f2afc['id']);var _0x25d685={'ListId':_0x3c5831};var _0x5ad6aa=_0x53d9a2[_0xd877('0x29')]&&_0x53d9a2[_0xd877('0x29')]!=='0'?_0x53d9a2[_0xd877('0x29')]:_0xd877('0x1b');if(_0xa42b1f){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x39db30[_0xd877('0x26')],_0x5f2afc['id']);_0x25d685[_0x5ad6aa]=_[_0xd877('0x2a')](_0x39db30[_0xd877('0x2b')])?_0x39db30['calleridnum']:_0x39db30[_0xd877('0x17')];if(_[_0xd877('0x2a')](_0x39db30[_0xd877('0x2b')])){_0x25d685[_0xd877('0x19')]=_0x39db30[_0xd877('0x2c')]&&_0x39db30[_0xd877('0x2c')]!==_0xd877('0x2d')?_0x39db30['calleridname']:'Unknown';}else{_0x25d685[_0xd877('0x19')]=_0x39db30['destcalleridname']&&_0x39db30[_0xd877('0x2e')]!==_0xd877('0x2d')?_0x39db30[_0xd877('0x2e')]:'Unknown';}return BPromise[_0xd877('0x21')]()[_0xd877('0x22')](cmContactRpc[_0xd877('0x2f')](_0x25d685))[_0xd877('0x22')](function(_0x396928){_0x1ccb15=_0x396928;_0x32691d['push'](_0x396928);if(_0x1ccb15){logger[_0xd877('0xb')](_0xd877('0x30'),_0x39db30[_0xd877('0x26')],_0x5f2afc['id'],_0x1ccb15['id']);}return;});}else{logger['info'](_0xd877('0x31'),_0x39db30[_0xd877('0x26')],_0x5f2afc['id']);_0x25d685[_0x5ad6aa]=_[_0xd877('0x2a')](_0x39db30[_0xd877('0x2b')])?_0x39db30[_0xd877('0x18')]:_0x39db30['destcalleridnum'];if(_['isNil'](_0x39db30[_0xd877('0x2b')])){_0x25d685['firstName']=_0x39db30[_0xd877('0x2c')]&&_0x39db30['calleridname']!==_0xd877('0x2d')?_0x39db30[_0xd877('0x2c')]:'Unknown';}else{_0x25d685[_0xd877('0x19')]=_0x39db30[_0xd877('0x2e')]&&_0x39db30[_0xd877('0x2e')]!==_0xd877('0x2d')?_0x39db30[_0xd877('0x2e')]:_0xd877('0x32');}_0x1ccb15=_0x25d685;_0x32691d[_0xd877('0x33')](_0x25d685);return;}}})[_0xd877('0x22')](function(){if(_0x1cf6c9){emit(_0x39db30[_0xd877('0x26')],_0x5f2afc,util['format']('user:%s',_0x1cf6c9['name']),util['format']('trigger:%s',_0x53d9a2['action']['toLowerCase']()),{'evt':_['merge'](_0x39db30,{'autoCreate':_0xa42b1f}),'contact':_0x1ccb15===undefined?{}:_0x1ccb15,'contacts':_0x32691d[_0xd877('0x24')]===0x0?undefined:_0x32691d});}});}; \ No newline at end of file +var _0xa0dc=['phone','$or','map','routeId','calleridnum','lastName','mobile','fax','scheduledAt','updatedAt','union','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact','push','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','ListId','data3','split'];(function(_0x398eab,_0xfab58a){var _0x57deb3=function(_0x15fbf0){while(--_0x15fbf0){_0x398eab['push'](_0x398eab['shift']());}};_0x57deb3(++_0xfab58a);}(_0xa0dc,0x98));var _0xca0d=function(_0x2714d8,_0x5d16f3){_0x2714d8=_0x2714d8-0x0;var _0x2d1680=_0xa0dc[_0x2714d8];return _0x2d1680;};'use strict';var _=require(_0xca0d('0x0'));var BPromise=require('bluebird');var Redis=require(_0xca0d('0x1'));var util=require(_0xca0d('0x2'));var config=require(_0xca0d('0x3'));var logger=require('../../../../config/logger')(_0xca0d('0x4'));var cmContactRpc=require(_0xca0d('0x5'));config[_0xca0d('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xca0d('0x7'))(new Redis(config['redis']));function emit(_0x554203,_0x4cbaa9,_0x40043e,_0x63df02,_0x5bdedf){logger[_0xca0d('0x8')](_0xca0d('0x9'),_0x554203,_0x4cbaa9['id'],_0x40043e,_0x63df02,JSON[_0xca0d('0xa')](_0x5bdedf));io['to'](_0x40043e)[_0xca0d('0xb')](_0x63df02,_0x5bdedf);}exports[_0xca0d('0xc')]=function(_0x2f7a52,_0xfc240a,_0x5d1f93,_0x2e0f8d){var _0x1f00bd,_0x482f47;var _0x326b68={};var _0x666a64=Number(_0x5d1f93[_0xca0d('0xd')]);var _0x4fae96=_0x5d1f93[_0xca0d('0xe')]?Boolean(Number(_0x5d1f93['data2'])):![];var _0x42320b;if(_0x2e0f8d['xmd-contactid']){_0x326b68['id']=_0x2e0f8d[_0xca0d('0xf')];}if(!_0x326b68['id']){_0x326b68[_0xca0d('0x10')]=_0x666a64;_0x42320b=_0x5d1f93[_0xca0d('0x11')]&&_0x5d1f93[_0xca0d('0x11')]!=='0'?_0x5d1f93[_0xca0d('0x11')][_0xca0d('0x12')](','):[_0xca0d('0x13')];_0x326b68[_0xca0d('0x14')]=_[_0xca0d('0x15')](_0x42320b,function(_0x5a6ff8){var _0x462709={};_0x462709[_0x5a6ff8]=_0x2e0f8d[_0xca0d('0x16')]?_0x2e0f8d['destcalleridnum']:_0x2e0f8d[_0xca0d('0x17')];return _0x462709;});}var _0x421886=['id','firstName',_0xca0d('0x18'),_0xca0d('0x13'),_0xca0d('0x19'),_0xca0d('0x1a'),_0xca0d('0x10'),'createdAt',_0xca0d('0x1b'),_0xca0d('0x1c')];var _0x3c7d84=_[_0xca0d('0x1d')](_0x421886,_0x42320b);BPromise['resolve']()['then'](cmContactRpc[_0xca0d('0x1e')]({'attributes':_0x3c7d84,'where':_0x326b68}))[_0xca0d('0x1f')](function(_0x338789){_0x482f47=_0x338789;if(!_[_0xca0d('0x20')](_0x482f47)){if(_0x482f47[_0xca0d('0x21')]===0x1){_0x1f00bd=_0x482f47[0x0];logger[_0xca0d('0x8')](_0xca0d('0x22'),_0x2e0f8d[_0xca0d('0x23')],_0xfc240a['id'],_0x1f00bd['id']);}else{logger[_0xca0d('0x8')](_0xca0d('0x24'),_0x2e0f8d[_0xca0d('0x23')],_0xfc240a['id'],_[_0xca0d('0x15')](_0x482f47,'id')[_0xca0d('0x25')](','));}return;}else{logger[_0xca0d('0x8')](_0xca0d('0x26'),_0x2e0f8d['uniqueid'],_0xfc240a['id']);var _0x4f6a0b={'ListId':_0x666a64};var _0x5ca2a2=_0x5d1f93[_0xca0d('0x27')]&&_0x5d1f93['data4']!=='0'?_0x5d1f93[_0xca0d('0x27')]:'phone';if(_0x4fae96){logger[_0xca0d('0x8')](_0xca0d('0x28'),_0x2e0f8d[_0xca0d('0x23')],_0xfc240a['id']);_0x4f6a0b[_0x5ca2a2]=_[_0xca0d('0x29')](_0x2e0f8d[_0xca0d('0x16')])?_0x2e0f8d[_0xca0d('0x17')]:_0x2e0f8d['destcalleridnum'];if(_[_0xca0d('0x29')](_0x2e0f8d[_0xca0d('0x16')])){_0x4f6a0b[_0xca0d('0x2a')]=_0x2e0f8d[_0xca0d('0x2b')]&&_0x2e0f8d[_0xca0d('0x2b')]!==_0xca0d('0x2c')?_0x2e0f8d['calleridname']:_0xca0d('0x2d');}else{_0x4f6a0b['firstName']=_0x2e0f8d[_0xca0d('0x2e')]&&_0x2e0f8d['destcalleridname']!==_0xca0d('0x2c')?_0x2e0f8d[_0xca0d('0x2e')]:'Unknown';}return BPromise[_0xca0d('0x2f')]()[_0xca0d('0x1f')](cmContactRpc[_0xca0d('0x30')](_0x4f6a0b))[_0xca0d('0x1f')](function(_0x2867ab){_0x1f00bd=_0x2867ab;_0x482f47[_0xca0d('0x31')](_0x2867ab);if(_0x1f00bd){logger[_0xca0d('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2e0f8d[_0xca0d('0x23')],_0xfc240a['id'],_0x1f00bd['id']);}return;});}else{logger[_0xca0d('0x8')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2e0f8d[_0xca0d('0x23')],_0xfc240a['id']);_0x4f6a0b[_0x5ca2a2]=_[_0xca0d('0x29')](_0x2e0f8d[_0xca0d('0x16')])?_0x2e0f8d[_0xca0d('0x17')]:_0x2e0f8d['destcalleridnum'];if(_['isNil'](_0x2e0f8d[_0xca0d('0x16')])){_0x4f6a0b[_0xca0d('0x2a')]=_0x2e0f8d['calleridname']&&_0x2e0f8d[_0xca0d('0x2b')]!==_0xca0d('0x2c')?_0x2e0f8d[_0xca0d('0x2b')]:_0xca0d('0x2d');}else{_0x4f6a0b[_0xca0d('0x2a')]=_0x2e0f8d[_0xca0d('0x2e')]&&_0x2e0f8d[_0xca0d('0x2e')]!==_0xca0d('0x2c')?_0x2e0f8d['destcalleridname']:'Unknown';}_0x1f00bd=_0x4f6a0b;_0x482f47[_0xca0d('0x31')](_0x4f6a0b);return;}}})[_0xca0d('0x1f')](function(){if(_0x2f7a52){emit(_0x2e0f8d[_0xca0d('0x23')],_0xfc240a,util[_0xca0d('0x32')](_0xca0d('0x33'),_0x2f7a52[_0xca0d('0x34')]),util[_0xca0d('0x32')](_0xca0d('0x35'),_0x5d1f93[_0xca0d('0x36')][_0xca0d('0x37')]()),{'evt':_[_0xca0d('0x38')](_0x2e0f8d,{'autoCreate':_0x4fae96}),'contact':_0x1f00bd===undefined?{}:_0x1f00bd,'contacts':_0x482f47['length']===0x0?undefined:_0x482f47});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 2f9ffc0..5dbd098 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 _0xb7e7=['data2','template\x20not\x20found','uri','buildUri','isNil','data3','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','winApplication','render','format','user:%s','name','trigger:%s:%s','data1','merge','jscripty','trigger:%s','exec','queue','urlforward','script','parse','query','search','replace','evt,\x20trigger.channel,\x20evt.channel','channel','every','AllConditions','checkConditions','AnyConditions','some','log','triggerChannel\x20&&\x20triggerEvery\x20&&\x20triggerSome','account','chat','ChatWebsiteId','value','upperFirst','AccountId','operator','event','agent','membername','lastevent','routeId','exports','util','url','ioredis','./integration','./script','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','freshdeskAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','motionChannel','undefined','checkTriggers','interface','hasOwnProperty','status','checkTrigger','Actions','length','action','toLowerCase','contactmanager','html'];(function(_0x304e0e,_0x33b054){var _0x568db1=function(_0x3db7dc){while(--_0x3db7dc){_0x304e0e['push'](_0x304e0e['shift']());}};_0x568db1(++_0x33b054);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'use strict';var util=require(_0x7b7e('0x0'));var _=require('lodash');var url=require(_0x7b7e('0x1'));var Mustache=require('mustache');var Redis=require(_0x7b7e('0x2'));var urlforward=require('./urlforward');var integration=require(_0x7b7e('0x3'));var cmContact=require('./cmContact');var script=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var logger=require(_0x7b7e('0x6'))('trigger');var ami=require('../ami');config[_0x7b7e('0x7')]=_[_0x7b7e('0x8')](config[_0x7b7e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x7b7e('0x9'))(new Redis(config[_0x7b7e('0x7')]));var operators={'equals':function(_0x2917f9,_0x1647e5){return _0x2917f9==_0x1647e5;},'not_equals':function(_0x148964,_0x26bb8d){return _0x148964!=_0x26bb8d;}};var barAndWebActions=[_0x7b7e('0xa'),'url',_0x7b7e('0xb')];function Trigger(_0x1eef0a){this[_0x7b7e('0xc')]=_0x1eef0a[_0x7b7e('0xc')];this[_0x7b7e('0xd')]=_0x1eef0a[_0x7b7e('0xd')];this[_0x7b7e('0xe')]=_0x1eef0a[_0x7b7e('0xe')];this[_0x7b7e('0xf')]=_0x1eef0a['templates'];this[_0x7b7e('0x10')]=_0x1eef0a[_0x7b7e('0x10')];this['zendeskAccounts']=_0x1eef0a[_0x7b7e('0x11')];this['freshdeskAccounts']=_0x1eef0a['freshdeskAccounts'];this[_0x7b7e('0x12')]=_0x1eef0a[_0x7b7e('0x12')];this[_0x7b7e('0x13')]=_0x1eef0a[_0x7b7e('0x13')];this[_0x7b7e('0x14')]=_0x1eef0a['zohoAccounts'];this['deskAccounts']=_0x1eef0a[_0x7b7e('0x15')];this[_0x7b7e('0x16')]=_0x1eef0a[_0x7b7e('0x16')];this[_0x7b7e('0x17')]=_0x1eef0a[_0x7b7e('0x17')];this[_0x7b7e('0x18')]=_0x1eef0a[_0x7b7e('0x18')];this[_0x7b7e('0x19')]=_0x1eef0a[_0x7b7e('0x19')];this[_0x7b7e('0x1a')]={'zendesk':this[_0x7b7e('0x11')],'salesforce':this[_0x7b7e('0x12')],'freshdesk':this[_0x7b7e('0x1b')],'sugarcrm':this[_0x7b7e('0x13')],'zoho':this[_0x7b7e('0x14')],'desk':this[_0x7b7e('0x15')],'vtiger':this[_0x7b7e('0x16')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x7b7e('0x19')],'servicenow':this[_0x7b7e('0x17')]};ami['on'](_0x7b7e('0x1c'),this['syncCustomEvent'][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x1e'),this[_0x7b7e('0x1f')][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x20'),this[_0x7b7e('0x1f')][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x21'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x7b7e('0x1f')][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x22'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentbusy',this[_0x7b7e('0x1f')][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x23'),this[_0x7b7e('0x1f')][_0x7b7e('0x1d')](this));ami['on']('custom:agentreject',this[_0x7b7e('0x1f')][_0x7b7e('0x1d')](this));ami['on']('custom:amd',this['syncCustomEvent']['bind'](this));ami['on'](_0x7b7e('0x24'),this[_0x7b7e('0x1f')]['bind'](this));ami['on'](_0x7b7e('0x25'),this['syncCustomEvent'][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x26'),this[_0x7b7e('0x27')]['bind'](this));ami['on'](_0x7b7e('0x28'),this[_0x7b7e('0x27')][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x29'),this[_0x7b7e('0x27')]['bind'](this));ami['on'](_0x7b7e('0x2a'),this['syncCustomEvent'][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x2b'),this[_0x7b7e('0x1f')][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x2c'),this[_0x7b7e('0x1f')][_0x7b7e('0x1d')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x2d'),this['syncCustomEvent'][_0x7b7e('0x1d')](this));ami['on'](_0x7b7e('0x2e'),this[_0x7b7e('0x1f')]['bind'](this));}Trigger[_0x7b7e('0x2f')][_0x7b7e('0x30')]=function(_0x187184,_0xf1225,_0x31043a){logger[_0x7b7e('0x31')](_0x187184,_0xf1225,JSON[_0x7b7e('0x32')](_0x31043a));io['to'](_0x187184)[_0x7b7e('0x30')](_0xf1225,_0x31043a);};Trigger[_0x7b7e('0x2f')][_0x7b7e('0x1f')]=function(_0xd5a64d){var _0x2d0620=_[_0x7b7e('0x33')](_0xd5a64d);if(typeof _0x2d0620[_0x7b7e('0x34')]===_0x7b7e('0x35')){_0x2d0620[_0x7b7e('0x34')]='voice';}this[_0x7b7e('0x36')](_0x2d0620);};Trigger[_0x7b7e('0x2f')][_0x7b7e('0x27')]=function(_0x242609){if(this[_0x7b7e('0xd')][_0x242609[_0x7b7e('0x37')]]){this[_0x7b7e('0x1f')](_0x242609);}};Trigger[_0x7b7e('0x2f')][_0x7b7e('0x36')]=function(_0x18011c){var _0x5f3de5;for(var _0x3d6571 in this[_0x7b7e('0xc')]){if(this[_0x7b7e('0xc')][_0x7b7e('0x38')](_0x3d6571)){if(this['triggers'][_0x3d6571][_0x7b7e('0x39')]){_0x5f3de5=this[_0x7b7e('0x3a')](this[_0x7b7e('0xc')][_0x3d6571],_0x18011c);if(_0x5f3de5){_['merge'](_0x18011c,_0x18011c['variables']);for(var _0x22651e=0x0,_0x48aa0e,_0x35382c,_0x3b16d7;_0x22651e0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ 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(_0x1ee621,_0x138860){var _0x2d9cc1=function(_0x3065f1){while(--_0x3065f1){_0x1ee621['push'](_0x1ee621['shift']());}};_0x2d9cc1(++_0x138860);}(_0x3e74,0x175));var _0x43e7=function(_0x54f9e9,_0xf35c4a){_0x54f9e9=_0x54f9e9-0x0;var _0x41830f=_0x3e74[_0x54f9e9];return _0x41830f;};'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 6b5580d..38b4606 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 _0x11fa=['trigger:browser:url','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','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20email\x20is:',']\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...','inspect','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','redis','POST','clientId','remoteUri','password','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','username','internalemailaddress','userId','catch','toLowerCase','outbound','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','length','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','picklist','type','nameField','customField','indexOf','content','incident','incidents','assign','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecalls','getString','callDirection','queue','ticketId','format','user:%s','emit'];(function(_0x4cbf09,_0x5abcfc){var _0x503383=function(_0x294c6b){while(--_0x294c6b){_0x4cbf09['push'](_0x4cbf09['shift']());}};_0x503383(++_0x5abcfc);}(_0x11fa,0x7b));var _0xa11f=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x11fa[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require('lodash');var BPromise=require(_0xa11f('0x0'));var rp=require(_0xa11f('0x1'));var util=require(_0xa11f('0x2'));var intUtil=require('./util');var md5=require(_0xa11f('0x3'));var Redis=require(_0xa11f('0x4'));var logger=require(_0xa11f('0x5'))(_0xa11f('0x6'));var config=require(_0xa11f('0x7'));config['redis']=_[_0xa11f('0x8')](config['redis'],{'host':_0xa11f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa11f('0xa')]));function getAuthToken(_0x2c8f6a,_0x4196b3,_0xb836a){var _0x9f3a19={'method':_0xa11f('0xb'),'uri':_0x4196b3,'form':{'client_id':_0x2c8f6a[_0xa11f('0xc')],'resource':_0x2c8f6a[_0xa11f('0xd')],'username':_0x2c8f6a['username'],'password':_0x2c8f6a[_0xa11f('0xe')],'grant_type':'password','client_secret':_0x2c8f6a['clientSecret']},'json':!![]};return rp(_0x9f3a19)[_0xa11f('0xf')](function(_0x492ca9){return _0x492ca9[_0xa11f('0x10')];})['catch'](function(_0x3798e1){logger[_0xa11f('0x11')]('['+[_0xb836a[_0xa11f('0x12')]()]+_0xa11f('0x13'));return _0x3798e1[_0xa11f('0x14')];});}function getUser(_0x4dd0f0,_0x404c50,_0x19c6b0,_0x3d4c61,_0xdbdade,_0x18815b){return new BPromise(function(_0x152fb2,_0x3bad10){return getAuthToken(_0x404c50,_0x3d4c61,_0x18815b)[_0xa11f('0xf')](function(_0x390b71){var _0xb0735e={'method':'GET','uri':_0xdbdade+_0xa11f('0x15'),'headers':{'Authorization':_0xa11f('0x16')+_0x390b71,'OData-Version':_0xa11f('0x17')},'json':!![]};return rp(_0xb0735e);})[_0xa11f('0xf')](function(_0x1f22c5){var _0x57d860=_0x1f22c5[_0xa11f('0x18')];var _0x55b04c=![];var _0x1718df=null;if(!_['isNil'](_0x19c6b0)){if(intUtil[_0xa11f('0x19')](_0x19c6b0[_0xa11f('0x1a')])){_0x4dd0f0[_0xa11f('0x1b')]=_0x19c6b0[_0xa11f('0x1a')];for(_0x1718df=0x0;_0x1718df<_0x57d860['length'];_0x1718df++){if(_0x57d860[_0x1718df]['internalemailaddress']===_0x19c6b0[_0xa11f('0x1a')]&&!_0x57d860[_0x1718df][_0xa11f('0x1c')]){_0x55b04c=!![];logger[_0xa11f('0x1d')]('['+[_0x18815b['toUpperCase']()]+_0xa11f('0x1e')+_0x57d860[_0x1718df][_0xa11f('0x1f')]+'!');_0x4dd0f0['userId']=_0x57d860[_0x1718df][_0xa11f('0x1f')];}}}}if(!_0x55b04c){logger[_0xa11f('0x1d')]('['+[_0x18815b['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4dd0f0[_0xa11f('0x1b')]=_0x404c50[_0xa11f('0x20')];for(_0x1718df=0x0;_0x1718df<_0x57d860['length'];_0x1718df++){if(_0x57d860[_0x1718df][_0xa11f('0x21')]===_0x404c50[_0xa11f('0x20')]){_0x4dd0f0[_0xa11f('0x22')]=_0x57d860[_0x1718df][_0xa11f('0x1f')];}}}_0x152fb2(_0x4dd0f0);})[_0xa11f('0x23')](function(_0x471d5c){_0x3bad10(_0x471d5c[_0xa11f('0x14')]);});});}function createEndUser(_0x268a5d,_0x1b97dc,_0x478a7c,_0x43d826,_0x4fb9de,_0xa7a77b){return new BPromise(function(_0x15d8cb,_0x56eb9a){return getAuthToken(_0x1b97dc,_0x478a7c,_0xa7a77b)[_0xa11f('0xf')](function(_0x260d04){var _0x44d869=_0xa7a77b[_0xa11f('0x24')]()===_0xa11f('0x25')?_0x4fb9de[_0xa11f('0x26')]:_0x4fb9de['calleridnum'];var _0x2c0987={'method':_0xa11f('0xb'),'uri':_0x43d826+_0xa11f('0x27'),'body':{'telephone1':_0x44d869,'fullname':_0x44d869,'firstname':_0x44d869,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xa11f('0x28')+_0x268a5d['userId']+')'},'headers':{'Authorization':_0xa11f('0x16')+_0x260d04,'OData-Version':_0xa11f('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2c0987);})[_0xa11f('0xf')](function(_0x2f4637){var _0x241f1d=_0x2f4637[_0xa11f('0x29')][_0xa11f('0x2a')];var _0x312e17=_0x241f1d[_0xa11f('0x2b')](_0x241f1d[_0xa11f('0x2c')]('(')+0x1,_0x241f1d['lastIndexOf'](')'));_0x268a5d[_0xa11f('0x2d')]=_0x312e17;_0x15d8cb(_0x268a5d);})['catch'](function(_0x3ef50a){_0x56eb9a(_0x3ef50a[_0xa11f('0x14')]);});});}function getEndUser(_0x111ec4,_0x4da0d6,_0x5765ef,_0x3ea28e,_0x4fd974,_0x1bf9f9){return new BPromise(function(_0x243a80,_0x12affa){var _0x35364c=_0x1bf9f9['toLowerCase']()===_0xa11f('0x25')?_0x4fd974['destcalleridnum']:_0x4fd974[_0xa11f('0x2e')];return getAuthToken(_0x4da0d6,_0x5765ef,_0x1bf9f9)[_0xa11f('0xf')](function(_0x281b96){var _0x5a1f96={'method':'GET','uri':_0x3ea28e+_0xa11f('0x2f')+_0x35364c[_0xa11f('0x30')]('+',_0xa11f('0x31'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x281b96,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5a1f96);})['then'](function(_0x3988a5){var _0x57f2f2=null;if(_0x3988a5){var _0x434c27=_0x3988a5[_0xa11f('0x18')];var _0x57458b=![];for(_0x57f2f2=0x0;_0x57f2f2<_0x434c27[_0xa11f('0x32')];_0x57f2f2++){if(_0x434c27[_0x57f2f2][_0xa11f('0x33')]===_0x35364c){_0x57458b=!![];_0x111ec4['enduserId']=_0x434c27[_0x57f2f2][_0xa11f('0x34')];}}if(_0x57458b){_0x243a80(_0x111ec4);}else{return createEndUser(_0x111ec4,_0x4da0d6,_0x5765ef,_0x3ea28e,_0x4fd974,_0x1bf9f9)[_0xa11f('0xf')](function(_0x5b4988){logger['info']('['+[_0x1bf9f9[_0xa11f('0x12')]()]+_0xa11f('0x35'),_0x5b4988[_0xa11f('0x2d')]);_0x243a80(_0x5b4988);});}}else{return createEndUser(_0x111ec4,_0x4da0d6,_0x5765ef,_0x3ea28e,_0x4fd974,_0x1bf9f9)[_0xa11f('0xf')](function(_0x272815){logger[_0xa11f('0x1d')]('['+[_0x1bf9f9[_0xa11f('0x12')]()]+_0xa11f('0x36'),_0x272815[_0xa11f('0x2d')]);_0x243a80(_0x272815);});}});});}function getCustomFields(_0x232429,_0x58e949,_0x4cc8f2){var _0x4af4ed={};if(_0x232429[_0xa11f('0x32')]>0x0){_[_0xa11f('0x37')](_0x232429,function(_0x2e08ed){if(_[_0xa11f('0x38')](['string',_0xa11f('0x39')],_0x2e08ed[_0xa11f('0x3a')])&&_0x2e08ed[_0xa11f('0x3b')]&&!_0x2e08ed[_0xa11f('0x3c')]){var _0x176559=_0x2e08ed['idField'][_0xa11f('0x24')]();var _0x2b4a55=_0x176559['substring'](0x0,_0x176559[_0xa11f('0x3d')]('_'));var _0x1cc7ea=_0x176559['substring'](_0x176559[_0xa11f('0x3d')]('_')+0x1);if(_0x2b4a55===_0x4cc8f2){_0x4af4ed[_0x1cc7ea]=_0x2e08ed[_0xa11f('0x3e')];}}});}return _0x4af4ed;}function getTicket(_0x1e86fd,_0x3f6ff1,_0x5a56bd,_0x54bfbe,_0x2f627e,_0x425c4d,_0x12b013){return new BPromise(function(_0x3627f5,_0x2c8a74){var _0x3d20a4;return getAuthToken(_0x3f6ff1,_0x5a56bd,_0x12b013)[_0xa11f('0xf')](function(_0x2d8257){if(_0x425c4d['ticketType']===_0xa11f('0x3f')){_0x3d20a4={'method':_0xa11f('0xb'),'uri':_0x54bfbe+_0xa11f('0x40'),'body':Object[_0xa11f('0x41')]({},{'title':intUtil['getString'](_0x425c4d[_0xa11f('0x42')],_0x2f627e,'\x20'),'description':intUtil['getString'](_0x425c4d[_0xa11f('0x43')],_0x2f627e,'\x0a'),'customerid_contact@odata.bind':_0xa11f('0x44')+_0x1e86fd[_0xa11f('0x2d')]+')','ownerid@odata.bind':_0xa11f('0x28')+_0x1e86fd[_0xa11f('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x425c4d[_0xa11f('0x45')],_0x2f627e,_0x425c4d[_0xa11f('0x46')])),'headers':{'Authorization':_0xa11f('0x16')+_0x2d8257,'OData-Version':_0xa11f('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x425c4d[_0xa11f('0x46')]==='phonecall'){_0x3d20a4={'method':_0xa11f('0xb'),'uri':_0x54bfbe+_0xa11f('0x47'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x425c4d['Subjects'],_0x2f627e,'\x20'),'phonenumber':String(_0x2f627e['calleridnum']),'description':intUtil[_0xa11f('0x48')](_0x425c4d[_0xa11f('0x43')],_0x2f627e,'\x0a'),'regardingobjectid_contact@odata.bind':_0xa11f('0x44')+_0x1e86fd[_0xa11f('0x2d')]+')','ownerid@odata.bind':_0xa11f('0x28')+_0x1e86fd[_0xa11f('0x22')]+')','directioncode':_0x1e86fd[_0xa11f('0x49')]===_0xa11f('0x4a')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xa11f('0x28')+_0x1e86fd[_0xa11f('0x22')]+')','participationtypemask':_0x1e86fd['callDirection']===_0xa11f('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0xa11f('0x44')+_0x1e86fd['enduserId']+')','participationtypemask':_0x1e86fd[_0xa11f('0x49')]===_0xa11f('0x4a')?0x1:0x2}]},getCustomFields(_0x425c4d[_0xa11f('0x45')],_0x2f627e,_0x425c4d['ticketType'])),'headers':{'Authorization':_0xa11f('0x16')+_0x2d8257,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3d20a4);})['then'](function(_0x148582){var _0x3324a6=_0x148582[_0xa11f('0x29')][_0xa11f('0x2a')];var _0x4c6a01=_0x3324a6[_0xa11f('0x2b')](_0x3324a6['lastIndexOf']('(')+0x1,_0x3324a6[_0xa11f('0x2c')](')'));_0x1e86fd[_0xa11f('0x4b')]=_0x4c6a01;_0x3627f5(_0x1e86fd);})[_0xa11f('0x23')](function(_0x14a55b){_0x2c8a74(_0x14a55b[_0xa11f('0x14')]);});});}function emit(_0x37ab67,_0x57d38a,_0xeaaba7,_0x530484){var _0x3dd596={'uri':util[_0xa11f('0x4c')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x37ab67,_0xeaaba7,_0x530484)};io['to'](util[_0xa11f('0x4c')](_0xa11f('0x4d'),_0x57d38a))[_0xa11f('0x4e')](_0xa11f('0x4f'),_0x3dd596);}exports['cs']=function(_0x100d21,_0x4ef995,_0x1574cd,_0x3b896a,_0x57bad2,_0x189e1d,_0x42c411,_0x545d38){var _0x50852f={};_0x189e1d[_0xa11f('0xd')]=intUtil[_0xa11f('0x50')](_0x189e1d[_0xa11f('0xd')]);_0x189e1d[_0xa11f('0x51')]=intUtil[_0xa11f('0x50')](_0x189e1d['serverUrl']);_0x50852f[_0xa11f('0x49')]=_0x545d38==='queue'||_0x545d38===_0xa11f('0x52')?'queue':_0xa11f('0x25');var _0x508347=util[_0xa11f('0x4c')](_0xa11f('0x53'),_0x189e1d[_0xa11f('0xd')]);var _0x2b91a0=util[_0xa11f('0x4c')](_0xa11f('0x54'),_0x189e1d[_0xa11f('0x55')]);var _0x4c15d2=util[_0xa11f('0x4c')](_0xa11f('0x56'),_0x189e1d['serverUrl'],_0x4ef995[_0xa11f('0x57')],md5(_0x4ef995[_0xa11f('0x57')]));if(_0x57bad2&&_0x57bad2[_0xa11f('0x58')]){logger[_0xa11f('0x1d')](_0xa11f('0x59'),_0xa11f('0x5a'));_0x4ef995[_0xa11f('0x5b')]=_0x4c15d2;}else if(_0x42c411&&_0x42c411[_0xa11f('0x5c')]&&_0x42c411[_0xa11f('0x5c')]!==_0xa11f('0x5d')){logger[_0xa11f('0x1d')]('[OUTBOUND]',_0xa11f('0x5a'));_0x4ef995['recordingURL']=_0x4c15d2;}else{_0x4ef995['recordingURL']='';}return getUser(_0x50852f,_0x189e1d,_0x3b896a,_0x2b91a0,_0x508347,_0x545d38)[_0xa11f('0xf')](function(_0x3387fb){logger[_0xa11f('0x1d')]('['+_0x545d38[_0xa11f('0x12')]()+']\x20The\x20User\x20ID\x20is:',_0x3387fb[_0xa11f('0x22')]);logger['info']('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x5e'),_0x3387fb[_0xa11f('0x1b')]);return getEndUser(_0x3387fb,_0x189e1d,_0x2b91a0,_0x508347,_0x4ef995,_0x545d38);})[_0xa11f('0xf')](function(_0x41277f){logger[_0xa11f('0x1d')]('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x5f'),_0x41277f[_0xa11f('0x2d')]);logger[_0xa11f('0x1d')]('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x60'),_0x4ef995[_0xa11f('0x2e')]);return getTicket(_0x41277f,_0x189e1d,_0x2b91a0,_0x508347,_0x4ef995,_0x1574cd,_0x545d38);})[_0xa11f('0xf')](function(_0x49bfa7){logger[_0xa11f('0x1d')](util[_0xa11f('0x4c')]('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x61'),_0x1574cd[_0xa11f('0x46')],_0x49bfa7['ticketId']));logger[_0xa11f('0x1d')](util['format']('['+_0x545d38[_0xa11f('0x12')]()+_0xa11f('0x62'),_0x545d38));if(_0x545d38!==_0xa11f('0x52')){logger[_0xa11f('0x1d')]('['+_0x545d38[_0xa11f('0x12')]()+']',_0xa11f('0x63'));emit(_0x189e1d[_0xa11f('0xd')],_0x3b896a['name'],_0x1574cd[_0xa11f('0x46')],_0x49bfa7[_0xa11f('0x4b')]);}})['catch'](function(_0x3fdf0b){logger[_0xa11f('0x11')]('['+_0x545d38[_0xa11f('0x12')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xa11f('0x64')](_0x3fdf0b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe685=['[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:','name','error','inspect','request-promise','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','socket.io-emitter','POST','username','password','clientSecret','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userEmail','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','Bearer\x20','4.0','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','picklist','type','nameField','customField','idField','indexOf','content','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xe685,0x133));var _0x5e68=function(_0x430a3f,_0x31ee63){_0x430a3f=_0x430a3f-0x0;var _0x47a5f6=_0xe685[_0x430a3f];return _0x47a5f6;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x5e68('0x0'));var util=require('util');var intUtil=require(_0x5e68('0x1'));var md5=require(_0x5e68('0x2'));var Redis=require(_0x5e68('0x3'));var logger=require(_0x5e68('0x4'))('dynamics365');var config=require(_0x5e68('0x5'));config[_0x5e68('0x6')]=_['defaults'](config[_0x5e68('0x6')],{'host':_0x5e68('0x7'),'port':0x18eb});var io=require(_0x5e68('0x8'))(new Redis(config[_0x5e68('0x6')]));function getAuthToken(_0x126e2b,_0xeaacda,_0x1dee06){var _0x1e77d9={'method':_0x5e68('0x9'),'uri':_0xeaacda,'form':{'client_id':_0x126e2b['clientId'],'resource':_0x126e2b['remoteUri'],'username':_0x126e2b[_0x5e68('0xa')],'password':_0x126e2b[_0x5e68('0xb')],'grant_type':_0x5e68('0xb'),'client_secret':_0x126e2b[_0x5e68('0xc')]},'json':!![]};return rp(_0x1e77d9)[_0x5e68('0xd')](function(_0x33263b){return _0x33263b[_0x5e68('0xe')];})[_0x5e68('0xf')](function(_0x2ee85d){logger['error']('['+[_0x1dee06['toUpperCase']()]+_0x5e68('0x10'));return _0x2ee85d[_0x5e68('0x11')];});}function getUser(_0x4dc2f5,_0x1e23cf,_0x4f38e4,_0x235c19,_0x4b23a1,_0x30a695){return new BPromise(function(_0x48301a,_0x513897){return getAuthToken(_0x1e23cf,_0x235c19,_0x30a695)[_0x5e68('0xd')](function(_0x3fa05e){var _0x2b28ca={'method':_0x5e68('0x12'),'uri':_0x4b23a1+_0x5e68('0x13'),'headers':{'Authorization':'Bearer\x20'+_0x3fa05e,'OData-Version':'4.0'},'json':!![]};return rp(_0x2b28ca);})[_0x5e68('0xd')](function(_0x1e1243){var _0x17dcee=_0x1e1243[_0x5e68('0x14')];var _0x531e55=![];var _0xfe5478=null;if(!_[_0x5e68('0x15')](_0x4f38e4)){if(intUtil[_0x5e68('0x16')](_0x4f38e4[_0x5e68('0x17')])){_0x4dc2f5['userEmail']=_0x4f38e4['email'];for(_0xfe5478=0x0;_0xfe5478<_0x17dcee[_0x5e68('0x18')];_0xfe5478++){if(_0x17dcee[_0xfe5478][_0x5e68('0x19')]===_0x4f38e4['email']&&!_0x17dcee[_0xfe5478][_0x5e68('0x1a')]){_0x531e55=!![];logger[_0x5e68('0x1b')]('['+[_0x30a695[_0x5e68('0x1c')]()]+_0x5e68('0x1d')+_0x17dcee[_0xfe5478][_0x5e68('0x1e')]+'!');_0x4dc2f5['userId']=_0x17dcee[_0xfe5478][_0x5e68('0x1e')];}}}}if(!_0x531e55){logger['info']('['+[_0x30a695[_0x5e68('0x1c')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4dc2f5[_0x5e68('0x1f')]=_0x1e23cf[_0x5e68('0xa')];for(_0xfe5478=0x0;_0xfe5478<_0x17dcee[_0x5e68('0x18')];_0xfe5478++){if(_0x17dcee[_0xfe5478][_0x5e68('0x19')]===_0x1e23cf[_0x5e68('0xa')]){_0x4dc2f5[_0x5e68('0x20')]=_0x17dcee[_0xfe5478][_0x5e68('0x1e')];}}}_0x48301a(_0x4dc2f5);})[_0x5e68('0xf')](function(_0x5442c6){_0x513897(_0x5442c6[_0x5e68('0x11')]);});});}function createEndUser(_0x325bc0,_0x18e59f,_0x1835e9,_0x5c9a5d,_0x5d9bf0,_0x4190a7){return new BPromise(function(_0x172bb2,_0x3f2b92){return getAuthToken(_0x18e59f,_0x1835e9,_0x4190a7)['then'](function(_0x3cf674){var _0x560a4b=_0x4190a7[_0x5e68('0x21')]()===_0x5e68('0x22')?_0x5d9bf0[_0x5e68('0x23')]:_0x5d9bf0[_0x5e68('0x24')];var _0x4dd946={'method':'POST','uri':_0x5c9a5d+_0x5e68('0x25'),'body':{'telephone1':_0x560a4b,'fullname':_0x560a4b,'firstname':_0x560a4b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5e68('0x26')+_0x325bc0[_0x5e68('0x20')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x3cf674,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4dd946);})[_0x5e68('0xd')](function(_0x6eb659){var _0x5ae306=_0x6eb659[_0x5e68('0x27')][_0x5e68('0x28')];var _0x2c8648=_0x5ae306[_0x5e68('0x29')](_0x5ae306[_0x5e68('0x2a')]('(')+0x1,_0x5ae306[_0x5e68('0x2a')](')'));_0x325bc0[_0x5e68('0x2b')]=_0x2c8648;_0x172bb2(_0x325bc0);})['catch'](function(_0x11b447){_0x3f2b92(_0x11b447[_0x5e68('0x11')]);});});}function getEndUser(_0x4943d4,_0x1b7a74,_0x4a1211,_0x6990e4,_0x861baf,_0x2bc37e){return new BPromise(function(_0x2cf6ae,_0x5b5f2a){var _0x3784d5=_0x2bc37e[_0x5e68('0x21')]()==='outbound'?_0x861baf[_0x5e68('0x23')]:_0x861baf[_0x5e68('0x24')];return getAuthToken(_0x1b7a74,_0x4a1211,_0x2bc37e)['then'](function(_0x6f5e3d){var _0x404143={'method':_0x5e68('0x12'),'uri':_0x6990e4+_0x5e68('0x2c')+_0x3784d5[_0x5e68('0x2d')]('+',_0x5e68('0x2e'))+'\x27','headers':{'Authorization':_0x5e68('0x2f')+_0x6f5e3d,'If-None-Match':null,'OData-Version':_0x5e68('0x30')},'json':!![]};return rp(_0x404143);})[_0x5e68('0xd')](function(_0x33cb06){var _0x2d35a=null;if(_0x33cb06){var _0xf39e04=_0x33cb06[_0x5e68('0x14')];var _0x4e3798=![];for(_0x2d35a=0x0;_0x2d35a<_0xf39e04[_0x5e68('0x18')];_0x2d35a++){if(_0xf39e04[_0x2d35a][_0x5e68('0x31')]===_0x3784d5){_0x4e3798=!![];_0x4943d4['enduserId']=_0xf39e04[_0x2d35a][_0x5e68('0x32')];}}if(_0x4e3798){_0x2cf6ae(_0x4943d4);}else{return createEndUser(_0x4943d4,_0x1b7a74,_0x4a1211,_0x6990e4,_0x861baf,_0x2bc37e)['then'](function(_0x5a5073){logger[_0x5e68('0x1b')]('['+[_0x2bc37e[_0x5e68('0x1c')]()]+_0x5e68('0x33'),_0x5a5073[_0x5e68('0x2b')]);_0x2cf6ae(_0x5a5073);});}}else{return createEndUser(_0x4943d4,_0x1b7a74,_0x4a1211,_0x6990e4,_0x861baf,_0x2bc37e)['then'](function(_0x551e6c){logger[_0x5e68('0x1b')]('['+[_0x2bc37e['toUpperCase']()]+_0x5e68('0x34'),_0x551e6c[_0x5e68('0x2b')]);_0x2cf6ae(_0x551e6c);});}});});}function getCustomFields(_0xad7a54,_0x3840d8,_0x1e0103){var _0x2c27d9={};if(_0xad7a54['length']>0x0){_[_0x5e68('0x35')](_0xad7a54,function(_0x3fe8f7){if(_['includes'](['string',_0x5e68('0x36')],_0x3fe8f7[_0x5e68('0x37')])&&_0x3fe8f7[_0x5e68('0x38')]&&!_0x3fe8f7[_0x5e68('0x39')]){var _0x44f8a9=_0x3fe8f7[_0x5e68('0x3a')]['toLowerCase']();var _0x1058df=_0x44f8a9[_0x5e68('0x29')](0x0,_0x44f8a9[_0x5e68('0x3b')]('_'));var _0x327579=_0x44f8a9['substring'](_0x44f8a9[_0x5e68('0x3b')]('_')+0x1);if(_0x1058df===_0x1e0103){_0x2c27d9[_0x327579]=_0x3fe8f7[_0x5e68('0x3c')];}}});}return _0x2c27d9;}function getTicket(_0xc8f923,_0x5e178f,_0x1c6ee9,_0x1b18a2,_0x336a62,_0x49ccad,_0x3d09cf){return new BPromise(function(_0x372eef,_0x13b94a){var _0xcdeee2;return getAuthToken(_0x5e178f,_0x1c6ee9,_0x3d09cf)[_0x5e68('0xd')](function(_0x303f97){if(_0x49ccad['ticketType']===_0x5e68('0x3d')){_0xcdeee2={'method':_0x5e68('0x9'),'uri':_0x1b18a2+_0x5e68('0x3e'),'body':Object[_0x5e68('0x3f')]({},{'title':intUtil['getString'](_0x49ccad[_0x5e68('0x40')],_0x336a62,'\x20'),'description':intUtil[_0x5e68('0x41')](_0x49ccad[_0x5e68('0x42')],_0x336a62,'\x0a'),'customerid_contact@odata.bind':_0x5e68('0x43')+_0xc8f923['enduserId']+')','ownerid@odata.bind':_0x5e68('0x26')+_0xc8f923[_0x5e68('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x49ccad[_0x5e68('0x44')],_0x336a62,_0x49ccad[_0x5e68('0x45')])),'headers':{'Authorization':'Bearer\x20'+_0x303f97,'OData-Version':_0x5e68('0x30')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x49ccad[_0x5e68('0x45')]===_0x5e68('0x46')){_0xcdeee2={'method':_0x5e68('0x9'),'uri':_0x1b18a2+_0x5e68('0x47'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x49ccad[_0x5e68('0x40')],_0x336a62,'\x20'),'phonenumber':String(_0x336a62[_0x5e68('0x24')]),'description':intUtil['getString'](_0x49ccad[_0x5e68('0x42')],_0x336a62,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0xc8f923[_0x5e68('0x2b')]+')','ownerid@odata.bind':_0x5e68('0x26')+_0xc8f923[_0x5e68('0x20')]+')','directioncode':_0xc8f923[_0x5e68('0x48')]===_0x5e68('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x5e68('0x26')+_0xc8f923[_0x5e68('0x20')]+')','participationtypemask':_0xc8f923['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x5e68('0x43')+_0xc8f923['enduserId']+')','participationtypemask':_0xc8f923[_0x5e68('0x48')]==='queue'?0x1:0x2}]},getCustomFields(_0x49ccad[_0x5e68('0x44')],_0x336a62,_0x49ccad[_0x5e68('0x45')])),'headers':{'Authorization':_0x5e68('0x2f')+_0x303f97,'OData-Version':_0x5e68('0x30')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xcdeee2);})[_0x5e68('0xd')](function(_0x26bbc1){var _0x441c01=_0x26bbc1[_0x5e68('0x27')][_0x5e68('0x28')];var _0x4abfbe=_0x441c01[_0x5e68('0x29')](_0x441c01[_0x5e68('0x2a')]('(')+0x1,_0x441c01[_0x5e68('0x2a')](')'));_0xc8f923[_0x5e68('0x4a')]=_0x4abfbe;_0x372eef(_0xc8f923);})[_0x5e68('0xf')](function(_0x2d1ad9){_0x13b94a(_0x2d1ad9[_0x5e68('0x11')]);});});}function emit(_0x47acdc,_0x2d835d,_0xb98a20,_0x57e337){var _0x25b4e6={'uri':util[_0x5e68('0x4b')](_0x5e68('0x4c'),_0x47acdc,_0xb98a20,_0x57e337)};io['to'](util[_0x5e68('0x4b')](_0x5e68('0x4d'),_0x2d835d))[_0x5e68('0x4e')](_0x5e68('0x4f'),_0x25b4e6);}exports['cs']=function(_0x2f9e06,_0x592c6e,_0x29408e,_0x4cdf75,_0x5e0a8b,_0xcca4fb,_0x1a21d1,_0xb5eab7){var _0x69cf4b={};_0xcca4fb[_0x5e68('0x50')]=intUtil[_0x5e68('0x51')](_0xcca4fb[_0x5e68('0x50')]);_0xcca4fb[_0x5e68('0x52')]=intUtil[_0x5e68('0x51')](_0xcca4fb['serverUrl']);_0x69cf4b[_0x5e68('0x48')]=_0xb5eab7===_0x5e68('0x49')||_0xb5eab7===_0x5e68('0x53')?_0x5e68('0x49'):_0x5e68('0x22');var _0x6af2e3=util[_0x5e68('0x4b')](_0x5e68('0x54'),_0xcca4fb['remoteUri']);var _0x441ae0=util[_0x5e68('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0xcca4fb[_0x5e68('0x55')]);var _0x273dc5=util[_0x5e68('0x4b')](_0x5e68('0x56'),_0xcca4fb[_0x5e68('0x52')],_0x592c6e[_0x5e68('0x57')],md5(_0x592c6e[_0x5e68('0x57')]));if(_0x5e0a8b&&_0x5e0a8b[_0x5e68('0x58')]){logger['info']('[QUEUE]',_0x5e68('0x59'));_0x592c6e[_0x5e68('0x5a')]=_0x273dc5;}else if(_0x1a21d1&&_0x1a21d1[_0x5e68('0x5b')]&&_0x1a21d1[_0x5e68('0x5b')]!==_0x5e68('0x5c')){logger['info'](_0x5e68('0x5d'),'Recording\x20is\x20enabled!');_0x592c6e[_0x5e68('0x5a')]=_0x273dc5;}else{_0x592c6e[_0x5e68('0x5a')]='';}return getUser(_0x69cf4b,_0xcca4fb,_0x4cdf75,_0x441ae0,_0x6af2e3,_0xb5eab7)[_0x5e68('0xd')](function(_0x4df0cb){logger['info']('['+_0xb5eab7[_0x5e68('0x1c')]()+_0x5e68('0x5e'),_0x4df0cb[_0x5e68('0x20')]);logger['info']('['+_0xb5eab7[_0x5e68('0x1c')]()+_0x5e68('0x5f'),_0x4df0cb[_0x5e68('0x1f')]);return getEndUser(_0x4df0cb,_0xcca4fb,_0x441ae0,_0x6af2e3,_0x592c6e,_0xb5eab7);})['then'](function(_0x3641d6){logger['info']('['+_0xb5eab7[_0x5e68('0x1c')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3641d6[_0x5e68('0x2b')]);logger[_0x5e68('0x1b')]('['+_0xb5eab7[_0x5e68('0x1c')]()+_0x5e68('0x60'),_0x592c6e[_0x5e68('0x24')]);return getTicket(_0x3641d6,_0xcca4fb,_0x441ae0,_0x6af2e3,_0x592c6e,_0x29408e,_0xb5eab7);})[_0x5e68('0xd')](function(_0x4e2495){logger['info'](util[_0x5e68('0x4b')]('['+_0xb5eab7[_0x5e68('0x1c')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x29408e[_0x5e68('0x45')],_0x4e2495['ticketId']));logger[_0x5e68('0x1b')](util[_0x5e68('0x4b')]('['+_0xb5eab7[_0x5e68('0x1c')]()+']\x20Call\x20direction:\x20%s',_0xb5eab7));if(_0xb5eab7!==_0x5e68('0x53')){logger[_0x5e68('0x1b')]('['+_0xb5eab7['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xcca4fb['remoteUri'],_0x4cdf75[_0x5e68('0x61')],_0x29408e[_0x5e68('0x45')],_0x4e2495[_0x5e68('0x4a')]);}})[_0x5e68('0xf')](function(_0x4dc990){logger[_0x5e68('0x62')]('['+_0xb5eab7[_0x5e68('0x1c')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x5e68('0x63')](_0x4dc990,{'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 9bfd27b..4fab087 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 _0xd3ac=['idField','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','unmanaged','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridnum','getString','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','value','format','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','string','picklist','type','customField','nameField','toLowerCase','content'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xd3ac,0x194));var _0xcd3a=function(_0x3b8339,_0x477c6a){_0x3b8339=_0x3b8339-0x0;var _0x20d062=_0xd3ac[_0x3b8339];return _0x20d062;};'use strict';var _=require(_0xcd3a('0x0'));var rp=require('request-promise');var md5=require(_0xcd3a('0x1'));var util=require(_0xcd3a('0x2'));var Redis=require(_0xcd3a('0x3'));var intUtil=require(_0xcd3a('0x4'));var config=require(_0xcd3a('0x5'));var logger=require(_0xcd3a('0x6'))(_0xcd3a('0x7'));config['redis']=_[_0xcd3a('0x8')](config[_0xcd3a('0x9')],{'host':_0xcd3a('0xa'),'port':0x18eb});var io=require(_0xcd3a('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0xcd3a('0xc'),'Accept':_0xcd3a('0xc')};function emit(_0x3a103b,_0x3cc83b,_0x386c86){io['to'](_0x3a103b)['emit'](_0x3cc83b,_0x386c86);}function getTicket(_0x1ab27a,_0x5757a9,_0x675e7,_0xf791c5,_0xe5e0e2){logger[_0xcd3a('0xd')](_0xcd3a('0xe'));var _0x3a9c57=_[_0xcd3a('0xf')]({'responder_id':_0x5757a9['id'],'requester_id':_0x675e7['id'],'name':util['format'](_0xcd3a('0x10'),_0xe5e0e2['calleridname']),'phone':_0xe5e0e2[_0xcd3a('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcd3a('0x12')](_0xf791c5['Subjects'],_0xe5e0e2,'\x20'),'description':intUtil[_0xcd3a('0x12')](_0xf791c5[_0xcd3a('0x13')],_0xe5e0e2,_0xcd3a('0x14')),'tags':getTags(_0xf791c5[_0xcd3a('0x15')],_0xcd3a('0x16'))},getCustomFields(_0xf791c5[_0xcd3a('0x17')],_0xe5e0e2));_0x3a9c57[_0xcd3a('0x18')]=_['mapValues'](_[_0xcd3a('0x19')](_0x3a9c57[_0xcd3a('0x18')],'id'),_0xcd3a('0x1a'));return request({'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x1c'),_0x1ab27a['remoteUri']),'method':_0xcd3a('0x1d'),'body':_0x3a9c57})[_0xcd3a('0x1e')](function(_0x282f97){logger['info'](_0xcd3a('0x1f'));return _0x282f97;});}function getUser(_0xbc0f9c,_0x18ec81){if(intUtil[_0xcd3a('0x20')](_0x18ec81)){return request({'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x21'),_0xbc0f9c['remoteUri']),'qs':{'email':_0x18ec81}})[_0xcd3a('0x1e')](function(_0x52212c){if(_0x52212c[_0xcd3a('0x22')]){logger[_0xcd3a('0xd')]('Agent\x20found!');return _[_0xcd3a('0x23')](_0x52212c,function(_0x442997){return _0x442997[_0xcd3a('0x24')]['email']===_0x18ec81;});}else{logger[_0xcd3a('0xd')](_0xcd3a('0x25'));return request({'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x26'),_0xbc0f9c[_0xcd3a('0x27')])})[_0xcd3a('0x1e')](function(_0x37ce60){logger[_0xcd3a('0xd')]('Admin\x20account\x20selected.');return _0x37ce60;});}});}else{logger[_0xcd3a('0xd')](_0xcd3a('0x28'));return request({'uri':util['format'](_0xcd3a('0x26'),_0xbc0f9c['remoteUri'])})[_0xcd3a('0x1e')](function(_0x1d12d0){logger[_0xcd3a('0xd')](_0xcd3a('0x29'));return _0x1d12d0;});}}function getEndUser(_0x55afc4,_0x5db7f1,_0x2e37d2){logger[_0xcd3a('0xd')]('Searching\x20enduser\x20with\x20phone',_0x2e37d2);return request({'uri':util[_0xcd3a('0x1b')]('%s/api/v2/contacts',_0x55afc4[_0xcd3a('0x27')]),'qs':{'phone':_0x2e37d2}})['then'](function(_0x38f5d8){if(_0x38f5d8[_0xcd3a('0x22')]){logger[_0xcd3a('0xd')](_0xcd3a('0x2a'));return _[_0xcd3a('0x23')](_0x38f5d8,{'phone':_0x2e37d2});}else{logger[_0xcd3a('0xd')](_0xcd3a('0x2b'));return request({'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x2c'),_0x55afc4[_0xcd3a('0x27')]),'method':_0xcd3a('0x1d'),'body':{'name':_0x5db7f1,'phone':_0x2e37d2}})[_0xcd3a('0x1e')](function(_0x6842d1){logger[_0xcd3a('0xd')](_0xcd3a('0x2d'));return _0x6842d1;});}});}function getAuth(_0x5b6c68){return util[_0xcd3a('0x1b')](_0xcd3a('0x2e'),new Buffer(_0x5b6c68[_0xcd3a('0x2f')]+':X')[_0xcd3a('0x30')](_0xcd3a('0x31')));}function request(_0x14d591){logger['debug'](_0xcd3a('0x32'),JSON[_0xcd3a('0x33')](_0x14d591));return rp(_[_0xcd3a('0x8')](_0x14d591,{'method':_0xcd3a('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x17bf06,_0x12504e){var _0x482ecd=[];if(_0x17bf06&&_0x17bf06[_0xcd3a('0x22')]>0x0){_0x482ecd=_[_0xcd3a('0x35')](_0x17bf06,_0x12504e);}return _0x482ecd;}function getCustomFields(_0x3059a3,_0x34b0c4){var _0x3c1e0c=[];var _0x218438={'custom_fields':[]};if(_0x3059a3[_0xcd3a('0x22')]>0x0){_['forEach'](_0x3059a3,function(_0x1b0b68){if(_['includes']([_0xcd3a('0x36'),_0xcd3a('0x37')],_0x1b0b68[_0xcd3a('0x38')])&&_0x1b0b68['nameField']&&!_0x1b0b68[_0xcd3a('0x39')]){_0x218438[_0x1b0b68[_0xcd3a('0x3a')][_0xcd3a('0x3b')]()]=_0x1b0b68[_0xcd3a('0x3c')][_0xcd3a('0x30')]();}else if(_['includes'](['string',_0xcd3a('0x37')],_0x1b0b68[_0xcd3a('0x38')])&&_0x1b0b68[_0xcd3a('0x3d')]&&_0x1b0b68[_0xcd3a('0x39')]){_0x218438[_0xcd3a('0x18')]['push']({'id':_0x1b0b68[_0xcd3a('0x3d')],'value':_0x1b0b68['content'][_0xcd3a('0x30')]()});}else if(_0x1b0b68['type']==='variable'&&_0x1b0b68[_0xcd3a('0x3e')]&&_0x1b0b68[_0xcd3a('0x3d')]&&_0x1b0b68['customField']){_0x34b0c4[_0x1b0b68['variableName']]&&_0x218438[_0xcd3a('0x18')][_0xcd3a('0x3f')]({'id':_0x1b0b68[_0xcd3a('0x3d')],'value':_0x34b0c4[_0x1b0b68[_0xcd3a('0x3e')]]['toString']()});}else if(_0x1b0b68['type']===_0xcd3a('0x40')&&_0x1b0b68[_0xcd3a('0x41')]&&_0x1b0b68[_0xcd3a('0x41')][_0xcd3a('0x16')]&&_0x1b0b68[_0xcd3a('0x3d')]&&_0x1b0b68[_0xcd3a('0x39')]){_0x34b0c4[_0x1b0b68[_0xcd3a('0x41')]['name'][_0xcd3a('0x3b')]()]&&_0x218438[_0xcd3a('0x18')][_0xcd3a('0x3f')]({'id':_0x1b0b68[_0xcd3a('0x3d')],'value':_0x34b0c4[_0x1b0b68[_0xcd3a('0x41')][_0xcd3a('0x16')]['toLowerCase']()][_0xcd3a('0x30')]()});}});}return _0x218438;}exports[_0xcd3a('0x42')]=function(_0x364b9e,_0x40e878,_0x24bd44,_0x178196,_0x49bd69,_0x6411eb){var _0x2f8f2f,_0x592ad0;_0x6411eb['remoteUri']=intUtil[_0xcd3a('0x43')](_0x6411eb[_0xcd3a('0x27')]);_0x6411eb[_0xcd3a('0x44')]=intUtil[_0xcd3a('0x43')](_0x6411eb[_0xcd3a('0x44')]);if(_0x49bd69&&_0x49bd69[_0xcd3a('0x45')]){logger[_0xcd3a('0xd')](_0xcd3a('0x46'),'Recording\x20is\x20enabled!');_0x40e878[_0xcd3a('0x47')]=util[_0xcd3a('0x1b')](_0xcd3a('0x48'),_0x6411eb[_0xcd3a('0x44')],_0x40e878[_0xcd3a('0x49')],md5(_0x40e878[_0xcd3a('0x49')]));}else{_0x40e878[_0xcd3a('0x47')]='';}headers[_0xcd3a('0x4a')]=getAuth(_0x6411eb);return getUser(_0x6411eb,_0x178196['email'])[_0xcd3a('0x1e')](function(_0x200ce1){_0x2f8f2f=_0x200ce1;logger[_0xcd3a('0xd')](_0xcd3a('0x4b'),_0x2f8f2f['id']);return getEndUser(_0x6411eb,_0x40e878[_0xcd3a('0x4c')],_0x40e878[_0xcd3a('0x11')]);})[_0xcd3a('0x1e')](function(_0x16960b){_0x592ad0=_0x16960b;logger[_0xcd3a('0xd')](_0xcd3a('0x4d'),_0x592ad0['id']);return getTicket(_0x6411eb,_0x2f8f2f,_0x592ad0,_0x24bd44,_0x40e878);})[_0xcd3a('0x1e')](function(_0x598cb4){if(_0x598cb4&&_0x598cb4['id']){logger[_0xcd3a('0xd')](_0xcd3a('0x1f'));logger[_0xcd3a('0xd')](_0xcd3a('0x4e'),_0x598cb4['id']);logger[_0xcd3a('0xd')](_0xcd3a('0x46'),_0xcd3a('0x4f'));emit(util['format'](_0xcd3a('0x50'),_0x178196[_0xcd3a('0x16')]),_0xcd3a('0x51'),{'uri':util[_0xcd3a('0x1b')](_0xcd3a('0x52'),_0x6411eb[_0xcd3a('0x27')],_0x598cb4['id'])});}})[_0xcd3a('0x53')](function(_0x254d15){logger[_0xcd3a('0x54')](_0xcd3a('0x46'),JSON[_0xcd3a('0x33')](_0x254d15));});};exports[_0xcd3a('0x55')]=function(_0x20fa69,_0x5f153a,_0x1fbe44,_0x1f4f53,_0x39f050,_0x188c10,_0x31f79b){var _0x4b1fdb,_0x1076b4;_0x188c10['remoteUri']=intUtil[_0xcd3a('0x43')](_0x188c10[_0xcd3a('0x27')]);_0x188c10[_0xcd3a('0x44')]=intUtil[_0xcd3a('0x43')](_0x188c10[_0xcd3a('0x44')]);if(_0x31f79b&&_0x31f79b[_0xcd3a('0x56')]&&_0x31f79b[_0xcd3a('0x56')]!==_0xcd3a('0x57')){logger[_0xcd3a('0xd')](_0xcd3a('0x58'),_0xcd3a('0x59'));_0x5f153a[_0xcd3a('0x47')]=util[_0xcd3a('0x1b')](_0xcd3a('0x48'),_0x188c10[_0xcd3a('0x44')],_0x5f153a[_0xcd3a('0x49')],md5(_0x5f153a['uniqueid']));}headers['Authorization']=getAuth(_0x188c10);return getUser(_0x188c10,_0x1f4f53['email'])[_0xcd3a('0x1e')](function(_0xf45d59){_0x4b1fdb=_0xf45d59;logger[_0xcd3a('0xd')](_0xcd3a('0x4b'),_0x4b1fdb['id']);return getEndUser(_0x188c10,_0x5f153a[_0xcd3a('0x5a')],_0x5f153a['destcalleridnum']);})[_0xcd3a('0x1e')](function(_0xbeea18){_0x1076b4=_0xbeea18;logger[_0xcd3a('0xd')](_0xcd3a('0x4d'),_0x1076b4['id']);return getTicket(_0x188c10,_0x4b1fdb,_0x1076b4,_0x1fbe44,_0x5f153a);})[_0xcd3a('0x1e')](function(_0x38470f){if(_0x38470f&&_0x38470f['id']){logger[_0xcd3a('0xd')]('Ticket\x20created!');logger[_0xcd3a('0xd')](_0xcd3a('0x4e'),_0x38470f['id']);logger['info']('[OUTBOUND]',_0xcd3a('0x4f'));emit(util[_0xcd3a('0x1b')](_0xcd3a('0x50'),_0x1f4f53[_0xcd3a('0x16')]),_0xcd3a('0x51'),{'uri':util[_0xcd3a('0x1b')]('%s/helpdesk/tickets/%d',_0x188c10[_0xcd3a('0x27')],_0x38470f['id'])});}})['catch'](function(_0x1fb000){logger[_0xcd3a('0x54')](_0xcd3a('0x58'),JSON[_0xcd3a('0x33')](_0x1fb000));});};exports[_0xcd3a('0x5b')]=function(_0x537c11,_0x3210da,_0x2c8cca,_0x1e877f,_0x598069,_0xa506e9){var _0x533db6,_0xf87533;_0xa506e9[_0xcd3a('0x27')]=intUtil[_0xcd3a('0x43')](_0xa506e9['remoteUri']);_0xa506e9[_0xcd3a('0x44')]=intUtil[_0xcd3a('0x43')](_0xa506e9[_0xcd3a('0x44')]);if(_0x598069&&_0x598069[_0xcd3a('0x45')]){logger[_0xcd3a('0xd')]('['+_0x3210da['lastevent']['toUpperCase']()+']',_0xcd3a('0x59'));_0x3210da[_0xcd3a('0x47')]=util[_0xcd3a('0x1b')](_0xcd3a('0x48'),_0xa506e9[_0xcd3a('0x44')],_0x3210da[_0xcd3a('0x49')],md5(_0x3210da[_0xcd3a('0x49')]));}else{_0x3210da['recordingURL']='';}headers[_0xcd3a('0x4a')]=getAuth(_0xa506e9);return getUser(_0xa506e9,'')[_0xcd3a('0x1e')](function(_0x1f3282){_0x533db6=_0x1f3282;logger['info']('The\x20User\x20ID\x20is:',_0x533db6['id']);return getEndUser(_0xa506e9,_0x3210da[_0xcd3a('0x4c')],_0x3210da[_0xcd3a('0x11')]);})['then'](function(_0x228be2){_0xf87533=_0x228be2;logger['info'](_0xcd3a('0x4d'),_0xf87533['id']);return getTicket(_0xa506e9,_0x533db6,_0xf87533,_0x2c8cca,_0x3210da);})[_0xcd3a('0x1e')](function(_0x21c604){if(_0x21c604){logger['info'](_0xcd3a('0x1f'));logger['info'](_0xcd3a('0x4e'),_0x21c604['id']);}})[_0xcd3a('0x53')](function(_0x15be01){logger[_0xcd3a('0x54')]('['+_0x3210da['lastevent'][_0xcd3a('0x5c')]()+']',JSON[_0xcd3a('0x33')](_0x15be01));});}; \ No newline at end of file +var _0x1dbc=['catch','error','unmanaged','lastevent','lodash','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','redis','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','includes','idField','push','content','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x1dbc,0x1c6));var _0xc1db=function(_0x59e815,_0x8c9d72){_0x59e815=_0x59e815-0x0;var _0x16bf37=_0x1dbc[_0x59e815];return _0x16bf37;};'use strict';var _=require(_0xc1db('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xc1db('0x1'));var config=require(_0xc1db('0x2'));var logger=require(_0xc1db('0x3'))('freshdesk');config['redis']=_[_0xc1db('0x4')](config['redis'],{'host':_0xc1db('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc1db('0x6')]));var headers={'Content-Type':_0xc1db('0x7'),'Accept':'application/json'};function emit(_0x4cc32c,_0xdeccb,_0x19db11){io['to'](_0x4cc32c)[_0xc1db('0x8')](_0xdeccb,_0x19db11);}function getTicket(_0x563af2,_0x4c84c6,_0x4a7623,_0x31781f,_0x24be6c){logger[_0xc1db('0x9')](_0xc1db('0xa'));var _0x81e65d=_[_0xc1db('0xb')]({'responder_id':_0x4c84c6['id'],'requester_id':_0x4a7623['id'],'name':util[_0xc1db('0xc')](_0xc1db('0xd'),_0x24be6c[_0xc1db('0xe')]),'phone':_0x24be6c[_0xc1db('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc1db('0x10')](_0x31781f[_0xc1db('0x11')],_0x24be6c,'\x20'),'description':intUtil[_0xc1db('0x10')](_0x31781f['Descriptions'],_0x24be6c,'
'),'tags':getTags(_0x31781f['Tags'],_0xc1db('0x12'))},getCustomFields(_0x31781f[_0xc1db('0x13')],_0x24be6c));_0x81e65d[_0xc1db('0x14')]=_[_0xc1db('0x15')](_['keyBy'](_0x81e65d['custom_fields'],'id'),_0xc1db('0x16'));return request({'uri':util[_0xc1db('0xc')](_0xc1db('0x17'),_0x563af2[_0xc1db('0x18')]),'method':_0xc1db('0x19'),'body':_0x81e65d})[_0xc1db('0x1a')](function(_0x1878b5){logger['info'](_0xc1db('0x1b'));return _0x1878b5;});}function getUser(_0x22a6e7,_0x334a4b){if(intUtil[_0xc1db('0x1c')](_0x334a4b)){return request({'uri':util[_0xc1db('0xc')](_0xc1db('0x1d'),_0x22a6e7[_0xc1db('0x18')]),'qs':{'email':_0x334a4b}})[_0xc1db('0x1a')](function(_0x5b8981){if(_0x5b8981[_0xc1db('0x1e')]){logger[_0xc1db('0x9')](_0xc1db('0x1f'));return _[_0xc1db('0x20')](_0x5b8981,function(_0x451255){return _0x451255[_0xc1db('0x21')][_0xc1db('0x22')]===_0x334a4b;});}else{logger[_0xc1db('0x9')](_0xc1db('0x23'));return request({'uri':util[_0xc1db('0xc')]('%s/api/v2/agents/me',_0x22a6e7[_0xc1db('0x18')])})[_0xc1db('0x1a')](function(_0x4e1a51){logger[_0xc1db('0x9')](_0xc1db('0x24'));return _0x4e1a51;});}});}else{logger[_0xc1db('0x9')](_0xc1db('0x25'));return request({'uri':util[_0xc1db('0xc')](_0xc1db('0x26'),_0x22a6e7[_0xc1db('0x18')])})[_0xc1db('0x1a')](function(_0x211645){logger[_0xc1db('0x9')](_0xc1db('0x24'));return _0x211645;});}}function getEndUser(_0x11b5b9,_0x1fa25e,_0x828dc3){logger[_0xc1db('0x9')]('Searching\x20enduser\x20with\x20phone',_0x828dc3);return request({'uri':util['format']('%s/api/v2/contacts',_0x11b5b9[_0xc1db('0x18')]),'qs':{'phone':_0x828dc3}})[_0xc1db('0x1a')](function(_0xdac16f){if(_0xdac16f[_0xc1db('0x1e')]){logger[_0xc1db('0x9')](_0xc1db('0x27'));return _[_0xc1db('0x20')](_0xdac16f,{'phone':_0x828dc3});}else{logger[_0xc1db('0x9')](_0xc1db('0x28'));return request({'uri':util[_0xc1db('0xc')]('%s/api/v2/contacts',_0x11b5b9[_0xc1db('0x18')]),'method':_0xc1db('0x19'),'body':{'name':_0x1fa25e,'phone':_0x828dc3}})[_0xc1db('0x1a')](function(_0x2513f0){logger['info'](_0xc1db('0x29'));return _0x2513f0;});}});}function getAuth(_0x1d3307){return util['format'](_0xc1db('0x2a'),new Buffer(_0x1d3307[_0xc1db('0x2b')]+':X')[_0xc1db('0x2c')]('base64'));}function request(_0xe3b579){logger[_0xc1db('0x2d')](_0xc1db('0x2e'),JSON[_0xc1db('0x2f')](_0xe3b579));return rp(_['defaults'](_0xe3b579,{'method':_0xc1db('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x54c134,_0x1c637c){var _0x2a096c=[];if(_0x54c134&&_0x54c134['length']>0x0){_0x2a096c=_[_0xc1db('0x31')](_0x54c134,_0x1c637c);}return _0x2a096c;}function getCustomFields(_0xb162dd,_0x434a1b){var _0x56e5ef=[];var _0x28fd85={'custom_fields':[]};if(_0xb162dd[_0xc1db('0x1e')]>0x0){_[_0xc1db('0x32')](_0xb162dd,function(_0x39630b){if(_['includes']([_0xc1db('0x33'),_0xc1db('0x34')],_0x39630b[_0xc1db('0x35')])&&_0x39630b[_0xc1db('0x36')]&&!_0x39630b[_0xc1db('0x37')]){_0x28fd85[_0x39630b[_0xc1db('0x36')][_0xc1db('0x38')]()]=_0x39630b['content']['toString']();}else if(_[_0xc1db('0x39')]([_0xc1db('0x33'),'picklist'],_0x39630b[_0xc1db('0x35')])&&_0x39630b[_0xc1db('0x3a')]&&_0x39630b[_0xc1db('0x37')]){_0x28fd85[_0xc1db('0x14')][_0xc1db('0x3b')]({'id':_0x39630b[_0xc1db('0x3a')],'value':_0x39630b[_0xc1db('0x3c')][_0xc1db('0x2c')]()});}else if(_0x39630b[_0xc1db('0x35')]==='variable'&&_0x39630b[_0xc1db('0x3d')]&&_0x39630b['idField']&&_0x39630b[_0xc1db('0x37')]){_0x434a1b[_0x39630b[_0xc1db('0x3d')]]&&_0x28fd85[_0xc1db('0x14')][_0xc1db('0x3b')]({'id':_0x39630b[_0xc1db('0x3a')],'value':_0x434a1b[_0x39630b[_0xc1db('0x3d')]][_0xc1db('0x2c')]()});}else if(_0x39630b[_0xc1db('0x35')]===_0xc1db('0x3e')&&_0x39630b[_0xc1db('0x3f')]&&_0x39630b[_0xc1db('0x3f')][_0xc1db('0x12')]&&_0x39630b[_0xc1db('0x3a')]&&_0x39630b[_0xc1db('0x37')]){_0x434a1b[_0x39630b[_0xc1db('0x3f')][_0xc1db('0x12')][_0xc1db('0x38')]()]&&_0x28fd85[_0xc1db('0x14')][_0xc1db('0x3b')]({'id':_0x39630b[_0xc1db('0x3a')],'value':_0x434a1b[_0x39630b[_0xc1db('0x3f')][_0xc1db('0x12')][_0xc1db('0x38')]()][_0xc1db('0x2c')]()});}});}return _0x28fd85;}exports['queue']=function(_0x238f5f,_0xbdbfa1,_0x4195ee,_0x3caec7,_0x3aa643,_0x3a42bb){var _0x5e3d75,_0x43cae1;_0x3a42bb[_0xc1db('0x18')]=intUtil[_0xc1db('0x40')](_0x3a42bb[_0xc1db('0x18')]);_0x3a42bb['serverUrl']=intUtil['stripTrailingSlash'](_0x3a42bb[_0xc1db('0x41')]);if(_0x3aa643&&_0x3aa643[_0xc1db('0x42')]){logger[_0xc1db('0x9')](_0xc1db('0x43'),_0xc1db('0x44'));_0xbdbfa1['recordingURL']=util[_0xc1db('0xc')](_0xc1db('0x45'),_0x3a42bb[_0xc1db('0x41')],_0xbdbfa1[_0xc1db('0x46')],md5(_0xbdbfa1[_0xc1db('0x46')]));}else{_0xbdbfa1[_0xc1db('0x47')]='';}headers[_0xc1db('0x48')]=getAuth(_0x3a42bb);return getUser(_0x3a42bb,_0x3caec7[_0xc1db('0x22')])[_0xc1db('0x1a')](function(_0x18b69c){_0x5e3d75=_0x18b69c;logger[_0xc1db('0x9')]('The\x20User\x20ID\x20is:',_0x5e3d75['id']);return getEndUser(_0x3a42bb,_0xbdbfa1[_0xc1db('0xe')],_0xbdbfa1[_0xc1db('0xf')]);})['then'](function(_0x4f23eb){_0x43cae1=_0x4f23eb;logger[_0xc1db('0x9')]('The\x20Enduser\x20ID\x20is:',_0x43cae1['id']);return getTicket(_0x3a42bb,_0x5e3d75,_0x43cae1,_0x4195ee,_0xbdbfa1);})[_0xc1db('0x1a')](function(_0x3001c2){if(_0x3001c2&&_0x3001c2['id']){logger[_0xc1db('0x9')]('Ticket\x20created!');logger[_0xc1db('0x9')](_0xc1db('0x49'),_0x3001c2['id']);logger[_0xc1db('0x9')](_0xc1db('0x43'),_0xc1db('0x4a'));emit(util['format'](_0xc1db('0x4b'),_0x3caec7['name']),_0xc1db('0x4c'),{'uri':util[_0xc1db('0xc')](_0xc1db('0x4d'),_0x3a42bb['remoteUri'],_0x3001c2['id'])});}})['catch'](function(_0x399c2d){logger['error'](_0xc1db('0x43'),JSON[_0xc1db('0x2f')](_0x399c2d));});};exports[_0xc1db('0x4e')]=function(_0x598532,_0x4ce9a8,_0x11ef36,_0x169bc3,_0x411ac5,_0x47d385,_0x3e4770){var _0x2158ef,_0x386a4c;_0x47d385[_0xc1db('0x18')]=intUtil['stripTrailingSlash'](_0x47d385[_0xc1db('0x18')]);_0x47d385[_0xc1db('0x41')]=intUtil['stripTrailingSlash'](_0x47d385[_0xc1db('0x41')]);if(_0x3e4770&&_0x3e4770[_0xc1db('0x4f')]&&_0x3e4770[_0xc1db('0x4f')]!==_0xc1db('0x50')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4ce9a8[_0xc1db('0x47')]=util[_0xc1db('0xc')](_0xc1db('0x45'),_0x47d385['serverUrl'],_0x4ce9a8['uniqueid'],md5(_0x4ce9a8[_0xc1db('0x46')]));}headers['Authorization']=getAuth(_0x47d385);return getUser(_0x47d385,_0x169bc3[_0xc1db('0x22')])[_0xc1db('0x1a')](function(_0x275662){_0x2158ef=_0x275662;logger[_0xc1db('0x9')](_0xc1db('0x51'),_0x2158ef['id']);return getEndUser(_0x47d385,_0x4ce9a8[_0xc1db('0x52')],_0x4ce9a8[_0xc1db('0x53')]);})[_0xc1db('0x1a')](function(_0x3a71d7){_0x386a4c=_0x3a71d7;logger[_0xc1db('0x9')](_0xc1db('0x54'),_0x386a4c['id']);return getTicket(_0x47d385,_0x2158ef,_0x386a4c,_0x11ef36,_0x4ce9a8);})['then'](function(_0x1cdf65){if(_0x1cdf65&&_0x1cdf65['id']){logger[_0xc1db('0x9')]('Ticket\x20created!');logger[_0xc1db('0x9')](_0xc1db('0x49'),_0x1cdf65['id']);logger['info'](_0xc1db('0x55'),_0xc1db('0x4a'));emit(util['format']('user:%s',_0x169bc3[_0xc1db('0x12')]),_0xc1db('0x4c'),{'uri':util[_0xc1db('0xc')](_0xc1db('0x4d'),_0x47d385[_0xc1db('0x18')],_0x1cdf65['id'])});}})[_0xc1db('0x56')](function(_0x3f0a99){logger[_0xc1db('0x57')](_0xc1db('0x55'),JSON[_0xc1db('0x2f')](_0x3f0a99));});};exports[_0xc1db('0x58')]=function(_0x822f31,_0x164505,_0x35fded,_0x2f4675,_0x4a0796,_0x499623){var _0x1f879b,_0x3bdcf9;_0x499623[_0xc1db('0x18')]=intUtil[_0xc1db('0x40')](_0x499623[_0xc1db('0x18')]);_0x499623[_0xc1db('0x41')]=intUtil[_0xc1db('0x40')](_0x499623[_0xc1db('0x41')]);if(_0x4a0796&&_0x4a0796[_0xc1db('0x42')]){logger[_0xc1db('0x9')]('['+_0x164505[_0xc1db('0x59')]['toUpperCase']()+']',_0xc1db('0x44'));_0x164505[_0xc1db('0x47')]=util[_0xc1db('0xc')](_0xc1db('0x45'),_0x499623['serverUrl'],_0x164505[_0xc1db('0x46')],md5(_0x164505[_0xc1db('0x46')]));}else{_0x164505[_0xc1db('0x47')]='';}headers[_0xc1db('0x48')]=getAuth(_0x499623);return getUser(_0x499623,'')[_0xc1db('0x1a')](function(_0x107610){_0x1f879b=_0x107610;logger[_0xc1db('0x9')](_0xc1db('0x51'),_0x1f879b['id']);return getEndUser(_0x499623,_0x164505[_0xc1db('0xe')],_0x164505[_0xc1db('0xf')]);})[_0xc1db('0x1a')](function(_0x434b9d){_0x3bdcf9=_0x434b9d;logger[_0xc1db('0x9')](_0xc1db('0x54'),_0x3bdcf9['id']);return getTicket(_0x499623,_0x1f879b,_0x3bdcf9,_0x35fded,_0x164505);})['then'](function(_0x539a11){if(_0x539a11){logger[_0xc1db('0x9')]('Ticket\x20created!');logger['info'](_0xc1db('0x49'),_0x539a11['id']);}})[_0xc1db('0x56')](function(_0x25bd85){logger[_0xc1db('0x57')]('['+_0x164505[_0xc1db('0x59')]['toUpperCase']()+']',JSON[_0xc1db('0x2f')](_0x25bd85));});}; \ 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 09f2b3a..d10b1c2 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 _0x48c9=['Creating\x20new\x20task','/api/tasks','getString','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','localhost','socket.io-emitter','redis','GET','/api/selector/owners','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','info','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','Admin\x20selected','/api/lookup?q=','&entities=contact','find','contacts','catch','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact'];(function(_0x43cd28,_0x5f42ee){var _0x23d607=function(_0x43833d){while(--_0x43833d){_0x43cd28['push'](_0x43cd28['shift']());}};_0x23d607(++_0x5f42ee);}(_0x48c9,0x1b2));var _0x948c=function(_0x3c60fc,_0x593ef5){_0x3c60fc=_0x3c60fc-0x0;var _0x495fd2=_0x48c9[_0x3c60fc];return _0x495fd2;};'use strict';var _=require(_0x948c('0x0'));var rp=require(_0x948c('0x1'));var md5=require(_0x948c('0x2'));var util=require(_0x948c('0x3'));var moment=require(_0x948c('0x4'));var Promise=require(_0x948c('0x5'));var Redis=require(_0x948c('0x6'));var intUtil=require(_0x948c('0x7'));var config=require(_0x948c('0x8'));var logger=require(_0x948c('0x9'))(_0x948c('0xa'));config['redis']=_[_0x948c('0xb')](config['redis'],{'host':_0x948c('0xc'),'port':0x18eb});var io=require(_0x948c('0xd'))(new Redis(config[_0x948c('0xe')]));function getAdminId(_0x37d718,_0x5128b4,_0x18fe15,_0x25aa15){return new Promise(function(_0x5c11ed,_0xb8276){var _0x56175e=![];var _0x2eeee4={'method':_0x948c('0xf'),'uri':_0x25aa15+_0x948c('0x10'),'json':!![]};_0x2eeee4['headers']=_0x18fe15;logger['info'](_0x948c('0x11'));return rp(_0x2eeee4)[_0x948c('0x12')](function(_0x2441f4){if(_0x2441f4){var _0x3d740b=_0x2441f4[_0x948c('0x13')];var _0x59e291=null;for(_0x59e291=0x0;_0x59e291<_0x3d740b[_0x948c('0x14')];_0x59e291++){if(_0x3d740b[_0x59e291][_0x948c('0x15')]===_0x37d718[_0x948c('0x16')]){_0x37d718[_0x948c('0x17')]=_0x3d740b[_0x59e291]['id'];_0x56175e=!![];}}if(_0x56175e){logger[_0x948c('0x18')]('Admin\x20found:',_0x37d718[_0x948c('0x17')]);_0x5c11ed(_0x37d718);}else{_0xb8276({'statusCode':0x194,'message':_0x948c('0x19')});}}else{_0xb8276({'statusCode':0x194,'message':_0x948c('0x19')});}})['catch'](function(_0x234b2f){logger[_0x948c('0x1a')]('['+[_0x5128b4[_0x948c('0x1b')]()]+']',_0x234b2f[_0x948c('0x1c')]);_0xb8276(_0x234b2f);});});}function getUser(_0x579503,_0x38a3b4,_0x2a135c){return function(_0x173af7){return new Promise(function(_0x1f6e7a,_0x3e18bd){var _0x526e58={'method':_0x948c('0xf'),'uri':_0x2a135c+'/api/selector/owners','json':!![]};_0x526e58[_0x948c('0x1d')]=_0x38a3b4;logger[_0x948c('0x18')](_0x948c('0x1e'));return rp(_0x526e58)['then'](function(_0x1d90d6){if(_0x1d90d6){var _0x12785f=_0x1d90d6['users'];var _0x23b61b=![];var _0x538fdd=null;if(_0x173af7['agentEmail']!==null){logger['info'](_0x948c('0x1f'),_0x173af7[_0x948c('0x20')]);_0x173af7[_0x948c('0x21')]=_0x173af7[_0x948c('0x20')];for(_0x538fdd=0x0;_0x538fdd<_0x12785f[_0x948c('0x14')];_0x538fdd++){if(_0x12785f[_0x538fdd][_0x948c('0x15')]===_0x173af7[_0x948c('0x20')]){_0x23b61b=!![];_0x173af7[_0x948c('0x22')]=_0x12785f[_0x538fdd]['id'];logger[_0x948c('0x18')]('User\x20found:',_0x173af7['userId']);}}}if(!_0x23b61b){logger['info'](_0x948c('0x23'));_0x173af7[_0x948c('0x21')]=_0x173af7[_0x948c('0x16')];_0x173af7[_0x948c('0x22')]=_0x173af7[_0x948c('0x17')];_0x23b61b=!![];}if(_0x23b61b){_0x1f6e7a(_0x173af7);}else{_0x3e18bd({'statusCode':0x194,'message':_0x948c('0x19')});}}else{_0x3e18bd({'statusCode':0x194,'message':_0x948c('0x19')});}})['catch'](function(_0xafaa4f){logger[_0x948c('0x1a')]('['+[_0x579503['toUpperCase']()]+']',_0xafaa4f[_0x948c('0x1c')]);_0x3e18bd(_0xafaa4f);});});};}function searchContact(_0x3b991f,_0x3f1c2b,_0x4ca59e,_0x24d5db){return new Promise(function(_0x203201,_0x206147){var _0x475c28={'method':_0x948c('0xf'),'headers':_0x3f1c2b,'uri':_0x3b991f+_0x948c('0x24')+_0x24d5db+'&f='+_0x4ca59e+_0x948c('0x25'),'json':!![]};rp(_0x475c28)['then'](function(_0x3a86e8){var _0x51c3f9=_[_0x948c('0x26')](_0x3a86e8[_0x948c('0x27')][_0x948c('0x27')],[_0x4ca59e,_0x24d5db]);_0x203201(_0x51c3f9);})[_0x948c('0x28')](function(_0x5b6d0b){_0x206147(_0x5b6d0b);});});}function getEndUser(_0x26944c,_0x14821e,_0x1cc0b5){return function(_0x22f42d){return new Promise(function(_0x391d29,_0x17c88c){logger[_0x948c('0x18')](util['format'](_0x948c('0x29'),_0x22f42d[_0x948c('0x2a')]));searchContact(_0x1cc0b5,_0x14821e,_0x948c('0x2b'),_0x22f42d[_0x948c('0x2a')])[_0x948c('0x12')](function(_0xaff7c3){if(_0xaff7c3){_0x22f42d['endUserId']=_0xaff7c3['id'];logger[_0x948c('0x18')](_0x948c('0x2c'),_0x22f42d[_0x948c('0x2d')]);return _0x391d29(_0x22f42d);}searchContact(_0x1cc0b5,_0x14821e,'work_number',_0x22f42d['contactNumber'])['then'](function(_0x3bd463){if(_0x3bd463){_0x22f42d[_0x948c('0x2d')]=_0x3bd463['id'];logger[_0x948c('0x18')]('Contact\x20found\x20work_number:',_0x22f42d[_0x948c('0x2d')]);return _0x391d29(_0x22f42d);}createEndUser(_0x22f42d,_0x26944c,_0x14821e,_0x1cc0b5)['then'](function(_0x549587){logger[_0x948c('0x18')](_0x948c('0x2e'),_0x549587['endUserId']);return _0x391d29(_0x549587);});});})[_0x948c('0x28')](function(_0xb873c){_0x17c88c(_0xb873c);});});};}function createEndUser(_0x30138d,_0x2419c,_0x2fe757,_0x18926c){return new Promise(function(_0x1592b9,_0x582409){var _0x18524d=moment();var _0xf484b={'method':_0x948c('0x2f'),'uri':_0x18926c+_0x948c('0x30'),'body':{'contact':{'last_name':_0x30138d['contactNumber'],'work_number':_0x30138d[_0x948c('0x2a')],'mobile_number':_0x30138d[_0x948c('0x2a')],'owner_id':_0x30138d[_0x948c('0x22')],'created_at':_0x18524d[_0x948c('0x31')](_0x948c('0x32'))}},'json':!![]};_0xf484b[_0x948c('0x1d')]=_0x2fe757;logger['info'](_0x948c('0x33'));return rp(_0xf484b)[_0x948c('0x12')](function(_0x196794){_0x30138d['endUserId']=_0x196794['contact']['id'];_0x1592b9(_0x30138d);})[_0x948c('0x28')](function(_0x1360fe){logger['error']('['+[_0x2419c[_0x948c('0x1b')]()]+']',_0x1360fe[_0x948c('0x1c')]);_0x582409(_0x1360fe[_0x948c('0x1c')]);});});}function getTicket(_0x9f3ce9,_0x4efa7c,_0xa12569,_0x9eba71,_0x98ed38){return function(_0x4d0007){logger[_0x948c('0x18')](_0x948c('0x34'));return new Promise(function(_0x4a3923,_0x26f6dc){var _0x1a6c62=moment();var _0x2639d7={'method':'POST','uri':_0xa12569+_0x948c('0x35'),'body':{'title':intUtil[_0x948c('0x36')](_0x9eba71['Subjects'],_0x98ed38,'\x20'),'description':intUtil['getString'](_0x9eba71['Descriptions'],_0x98ed38,'\x0a'),'owner_id':_0x4d0007[_0x948c('0x22')],'creater_id':_0x4d0007[_0x948c('0x17')],'targetable_id':_0x4d0007['endUserId'],'targetable_type':'Contact','created_at':_0x1a6c62[_0x948c('0x31')](_0x948c('0x32')),'due_date':_0x1a6c62[_0x948c('0x37')](0x1e,'m')[_0x948c('0x31')](_0x948c('0x32'))},'json':!![]};_0x2639d7[_0x948c('0x1d')]=_0x4efa7c;return rp(_0x2639d7)[_0x948c('0x12')](function(_0x4ee62f){_0x4d0007[_0x948c('0x38')]=_0x4ee62f[_0x948c('0x39')]['id'];logger['info']('Task\x20created:',_0x4d0007[_0x948c('0x38')]);_0x4a3923(_0x4d0007);})[_0x948c('0x28')](function(_0x629ded){logger[_0x948c('0x1a')]('['+[_0x9f3ce9['toUpperCase']()]+']',_0x629ded['message']);_0x26f6dc(_0x629ded['message']);});});};}function emit(_0x58c2ff,_0x43a89a,_0x29035e){var _0x326f26={'uri':_0x58c2ff+_0x948c('0x3a')+_0x29035e};io['to'](util[_0x948c('0x31')](_0x948c('0x3b'),_0x43a89a))[_0x948c('0x3c')](_0x948c('0x3d'),_0x326f26);}exports['cs']=function(_0x4c61ac,_0x301fee,_0x39ee24,_0x471db9,_0x1a8340,_0x2eee6e,_0x481ece,_0x69ee42){var _0x21a0e4={};var _0x43a4b9={'Authorization':_0x948c('0x3e')+_0x2eee6e[_0x948c('0x3f')]};_0x2eee6e[_0x948c('0x40')]=intUtil[_0x948c('0x41')](_0x2eee6e[_0x948c('0x40')]);_0x2eee6e['serverUrl']=intUtil[_0x948c('0x41')](_0x2eee6e['serverUrl']);var _0x9ffe2=_0x2eee6e['remoteUri'];_0x21a0e4['adminEmail']=_0x2eee6e[_0x948c('0x42')];_0x21a0e4['contactNumber']=_0x69ee42[_0x948c('0x43')]()==='outbound'?_0x301fee[_0x948c('0x44')]:_0x301fee['calleridnum'];_0x21a0e4['callDirection']=_0x69ee42===_0x948c('0x45')||_0x69ee42===_0x948c('0x46')?_0x948c('0x45'):'outbound';if(_0x471db9){_0x21a0e4[_0x948c('0x20')]=_0x471db9[_0x948c('0x15')];}var _0x5bf671=util[_0x948c('0x31')](_0x948c('0x47'),_0x2eee6e['serverUrl'],_0x301fee[_0x948c('0x48')],md5(_0x301fee[_0x948c('0x48')]));if(_0x1a8340&&_0x1a8340[_0x948c('0x49')]){logger[_0x948c('0x18')]('[QUEUE]',_0x948c('0x4a'));_0x301fee['recordingURL']=_0x5bf671;}else if(_0x481ece&&_0x481ece[_0x948c('0x4b')]&&_0x481ece[_0x948c('0x4b')]!==_0x948c('0x4c')){logger[_0x948c('0x18')]('[OUTBOUND]',_0x948c('0x4a'));_0x301fee[_0x948c('0x4d')]=_0x5bf671;}else{_0x301fee[_0x948c('0x4d')]='';}return getAdminId(_0x21a0e4,_0x69ee42,_0x43a4b9,_0x9ffe2)[_0x948c('0x12')](getUser(_0x69ee42,_0x43a4b9,_0x9ffe2))[_0x948c('0x12')](getEndUser(_0x69ee42,_0x43a4b9,_0x9ffe2))[_0x948c('0x12')](getTicket(_0x69ee42,_0x43a4b9,_0x9ffe2,_0x39ee24,_0x301fee))[_0x948c('0x12')](function(_0x3b21b9){logger['info'](util['format'](_0x948c('0x4e'),_0x3b21b9[_0x948c('0x38')]));if(_0x69ee42!==_0x948c('0x46')){logger[_0x948c('0x18')]('['+[_0x69ee42['toUpperCase']()]+']',_0x948c('0x4f'));emit(_0x9ffe2,_0x471db9[_0x948c('0x50')],_0x3b21b9['endUserId']);}})[_0x948c('0x28')](function(_0x2307e3){logger[_0x948c('0x1a')]('['+[_0x69ee42[_0x948c('0x1b')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x2307e3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc298=['task','Task\x20created:','error','emit','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','queue','unmanaged','email','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','users','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','&entities=contact','find','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Contact','ticketId'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xc298,0xfe));var _0x8c29=function(_0x55d2de,_0x55dc43){_0x55d2de=_0x55d2de-0x0;var _0x384a9b=_0xc298[_0x55d2de];return _0x384a9b;};'use strict';var _=require('lodash');var rp=require(_0x8c29('0x0'));var md5=require(_0x8c29('0x1'));var util=require(_0x8c29('0x2'));var moment=require(_0x8c29('0x3'));var Promise=require(_0x8c29('0x4'));var Redis=require('ioredis');var intUtil=require(_0x8c29('0x5'));var config=require(_0x8c29('0x6'));var logger=require(_0x8c29('0x7'))(_0x8c29('0x8'));config[_0x8c29('0x9')]=_[_0x8c29('0xa')](config[_0x8c29('0x9')],{'host':_0x8c29('0xb'),'port':0x18eb});var io=require(_0x8c29('0xc'))(new Redis(config[_0x8c29('0x9')]));function getAdminId(_0x20a887,_0x38a666,_0x2dc373,_0x310c84){return new Promise(function(_0x2b436f,_0x1a3588){var _0x524d90=![];var _0x44714c={'method':_0x8c29('0xd'),'uri':_0x310c84+_0x8c29('0xe'),'json':!![]};_0x44714c['headers']=_0x2dc373;logger[_0x8c29('0xf')]('Getting\x20admin\x20information');return rp(_0x44714c)[_0x8c29('0x10')](function(_0x31cac1){if(_0x31cac1){var _0x32b0c4=_0x31cac1[_0x8c29('0x11')];var _0x5eaf64=null;for(_0x5eaf64=0x0;_0x5eaf64<_0x32b0c4[_0x8c29('0x12')];_0x5eaf64++){if(_0x32b0c4[_0x5eaf64]['email']===_0x20a887[_0x8c29('0x13')]){_0x20a887[_0x8c29('0x14')]=_0x32b0c4[_0x5eaf64]['id'];_0x524d90=!![];}}if(_0x524d90){logger[_0x8c29('0xf')]('Admin\x20found:',_0x20a887[_0x8c29('0x14')]);_0x2b436f(_0x20a887);}else{_0x1a3588({'statusCode':0x194,'message':_0x8c29('0x15')});}}else{_0x1a3588({'statusCode':0x194,'message':_0x8c29('0x15')});}})[_0x8c29('0x16')](function(_0x4d2027){logger['error']('['+[_0x38a666[_0x8c29('0x17')]()]+']',_0x4d2027[_0x8c29('0x18')]);_0x1a3588(_0x4d2027);});});}function getUser(_0x13e97e,_0x257176,_0x4cdebf){return function(_0x4854df){return new Promise(function(_0x1b6f17,_0x4844f5){var _0x5ea5a1={'method':'GET','uri':_0x4cdebf+_0x8c29('0xe'),'json':!![]};_0x5ea5a1[_0x8c29('0x19')]=_0x257176;logger[_0x8c29('0xf')](_0x8c29('0x1a'));return rp(_0x5ea5a1)[_0x8c29('0x10')](function(_0x3135ee){if(_0x3135ee){var _0x155482=_0x3135ee[_0x8c29('0x11')];var _0x2da233=![];var _0x13ab41=null;if(_0x4854df[_0x8c29('0x1b')]!==null){logger[_0x8c29('0xf')](_0x8c29('0x1c'),_0x4854df[_0x8c29('0x1b')]);_0x4854df[_0x8c29('0x1d')]=_0x4854df[_0x8c29('0x1b')];for(_0x13ab41=0x0;_0x13ab41<_0x155482[_0x8c29('0x12')];_0x13ab41++){if(_0x155482[_0x13ab41]['email']===_0x4854df['agentEmail']){_0x2da233=!![];_0x4854df[_0x8c29('0x1e')]=_0x155482[_0x13ab41]['id'];logger[_0x8c29('0xf')](_0x8c29('0x1f'),_0x4854df[_0x8c29('0x1e')]);}}}if(!_0x2da233){logger[_0x8c29('0xf')]('Admin\x20selected');_0x4854df[_0x8c29('0x1d')]=_0x4854df['adminEmail'];_0x4854df['userId']=_0x4854df[_0x8c29('0x14')];_0x2da233=!![];}if(_0x2da233){_0x1b6f17(_0x4854df);}else{_0x4844f5({'statusCode':0x194,'message':_0x8c29('0x15')});}}else{_0x4844f5({'statusCode':0x194,'message':_0x8c29('0x15')});}})[_0x8c29('0x16')](function(_0x5d2f5f){logger['error']('['+[_0x13e97e[_0x8c29('0x17')]()]+']',_0x5d2f5f[_0x8c29('0x18')]);_0x4844f5(_0x5d2f5f);});});};}function searchContact(_0xdde71b,_0x581a14,_0x48929e,_0x5f11c6){return new Promise(function(_0x539e93,_0x50a566){var _0x5a93b1={'method':_0x8c29('0xd'),'headers':_0x581a14,'uri':_0xdde71b+'/api/lookup?q='+_0x5f11c6+'&f='+_0x48929e+_0x8c29('0x20'),'json':!![]};rp(_0x5a93b1)[_0x8c29('0x10')](function(_0x527540){var _0x1e4e4e=_[_0x8c29('0x21')](_0x527540['contacts']['contacts'],[_0x48929e,_0x5f11c6]);_0x539e93(_0x1e4e4e);})[_0x8c29('0x16')](function(_0x162191){_0x50a566(_0x162191);});});}function getEndUser(_0x5bdf93,_0x1665a2,_0x20f825){return function(_0x28ef37){return new Promise(function(_0x4288e3,_0x27606a){logger['info'](util[_0x8c29('0x22')](_0x8c29('0x23'),_0x28ef37['contactNumber']));searchContact(_0x20f825,_0x1665a2,_0x8c29('0x24'),_0x28ef37[_0x8c29('0x25')])[_0x8c29('0x10')](function(_0x41d21c){if(_0x41d21c){_0x28ef37[_0x8c29('0x26')]=_0x41d21c['id'];logger[_0x8c29('0xf')](_0x8c29('0x27'),_0x28ef37[_0x8c29('0x26')]);return _0x4288e3(_0x28ef37);}searchContact(_0x20f825,_0x1665a2,_0x8c29('0x28'),_0x28ef37[_0x8c29('0x25')])[_0x8c29('0x10')](function(_0xbeb389){if(_0xbeb389){_0x28ef37[_0x8c29('0x26')]=_0xbeb389['id'];logger[_0x8c29('0xf')](_0x8c29('0x29'),_0x28ef37['endUserId']);return _0x4288e3(_0x28ef37);}createEndUser(_0x28ef37,_0x5bdf93,_0x1665a2,_0x20f825)[_0x8c29('0x10')](function(_0x3afc6c){logger['info'](_0x8c29('0x2a'),_0x3afc6c['endUserId']);return _0x4288e3(_0x3afc6c);});});})['catch'](function(_0x1e981c){_0x27606a(_0x1e981c);});});};}function createEndUser(_0x452b16,_0x62cec6,_0x4b78b1,_0x417cbc){return new Promise(function(_0x5169ef,_0x4a70a4){var _0x1276b4=moment();var _0x4f047f={'method':'POST','uri':_0x417cbc+_0x8c29('0x2b'),'body':{'contact':{'last_name':_0x452b16['contactNumber'],'work_number':_0x452b16['contactNumber'],'mobile_number':_0x452b16[_0x8c29('0x25')],'owner_id':_0x452b16[_0x8c29('0x1e')],'created_at':_0x1276b4['format'](_0x8c29('0x2c'))}},'json':!![]};_0x4f047f[_0x8c29('0x19')]=_0x4b78b1;logger['info'](_0x8c29('0x2d'));return rp(_0x4f047f)[_0x8c29('0x10')](function(_0x504b5c){_0x452b16[_0x8c29('0x26')]=_0x504b5c[_0x8c29('0x2e')]['id'];_0x5169ef(_0x452b16);})['catch'](function(_0x4092e4){logger['error']('['+[_0x62cec6['toUpperCase']()]+']',_0x4092e4[_0x8c29('0x18')]);_0x4a70a4(_0x4092e4[_0x8c29('0x18')]);});});}function getTicket(_0x19e17d,_0x5653b6,_0x40b2d2,_0x4b499b,_0x8f5f96){return function(_0x540a4d){logger[_0x8c29('0xf')](_0x8c29('0x2f'));return new Promise(function(_0x1186e4,_0x1fa389){var _0x453d66=moment();var _0x5c9079={'method':_0x8c29('0x30'),'uri':_0x40b2d2+_0x8c29('0x31'),'body':{'title':intUtil[_0x8c29('0x32')](_0x4b499b[_0x8c29('0x33')],_0x8f5f96,'\x20'),'description':intUtil[_0x8c29('0x32')](_0x4b499b['Descriptions'],_0x8f5f96,'\x0a'),'owner_id':_0x540a4d[_0x8c29('0x1e')],'creater_id':_0x540a4d['adminId'],'targetable_id':_0x540a4d[_0x8c29('0x26')],'targetable_type':_0x8c29('0x34'),'created_at':_0x453d66['format'](_0x8c29('0x2c')),'due_date':_0x453d66['add'](0x1e,'m')[_0x8c29('0x22')](_0x8c29('0x2c'))},'json':!![]};_0x5c9079[_0x8c29('0x19')]=_0x5653b6;return rp(_0x5c9079)[_0x8c29('0x10')](function(_0xd89600){_0x540a4d[_0x8c29('0x35')]=_0xd89600[_0x8c29('0x36')]['id'];logger['info'](_0x8c29('0x37'),_0x540a4d[_0x8c29('0x35')]);_0x1186e4(_0x540a4d);})[_0x8c29('0x16')](function(_0x50640f){logger[_0x8c29('0x38')]('['+[_0x19e17d['toUpperCase']()]+']',_0x50640f['message']);_0x1fa389(_0x50640f[_0x8c29('0x18')]);});});};}function emit(_0x5d04fa,_0x52bbd1,_0x35facd){var _0x293fef={'uri':_0x5d04fa+'/contacts/'+_0x35facd};io['to'](util[_0x8c29('0x22')]('user:%s',_0x52bbd1))[_0x8c29('0x39')]('trigger:browser:url',_0x293fef);}exports['cs']=function(_0x304f9c,_0x410d69,_0x3d5dff,_0x1e9841,_0xc1d91f,_0x5e5f46,_0x51069e,_0x2b8f52){var _0x32203f={};var _0x44e7ff={'Authorization':'Token\x20token='+_0x5e5f46[_0x8c29('0x3a')]};_0x5e5f46[_0x8c29('0x3b')]=intUtil[_0x8c29('0x3c')](_0x5e5f46[_0x8c29('0x3b')]);_0x5e5f46[_0x8c29('0x3d')]=intUtil[_0x8c29('0x3c')](_0x5e5f46[_0x8c29('0x3d')]);var _0x5b86bc=_0x5e5f46[_0x8c29('0x3b')];_0x32203f[_0x8c29('0x13')]=_0x5e5f46[_0x8c29('0x3e')];_0x32203f['contactNumber']=_0x2b8f52[_0x8c29('0x3f')]()===_0x8c29('0x40')?_0x410d69['destcalleridnum']:_0x410d69['calleridnum'];_0x32203f['callDirection']=_0x2b8f52===_0x8c29('0x41')||_0x2b8f52===_0x8c29('0x42')?_0x8c29('0x41'):'outbound';if(_0x1e9841){_0x32203f[_0x8c29('0x1b')]=_0x1e9841[_0x8c29('0x43')];}var _0x2fee55=util[_0x8c29('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e5f46[_0x8c29('0x3d')],_0x410d69[_0x8c29('0x44')],md5(_0x410d69[_0x8c29('0x44')]));if(_0xc1d91f&&_0xc1d91f[_0x8c29('0x45')]){logger[_0x8c29('0xf')]('[QUEUE]','Recording\x20is\x20enabled!');_0x410d69[_0x8c29('0x46')]=_0x2fee55;}else if(_0x51069e&&_0x51069e[_0x8c29('0x47')]&&_0x51069e['recordingFormat']!==_0x8c29('0x48')){logger['info'](_0x8c29('0x49'),'Recording\x20is\x20enabled!');_0x410d69[_0x8c29('0x46')]=_0x2fee55;}else{_0x410d69['recordingURL']='';}return getAdminId(_0x32203f,_0x2b8f52,_0x44e7ff,_0x5b86bc)[_0x8c29('0x10')](getUser(_0x2b8f52,_0x44e7ff,_0x5b86bc))[_0x8c29('0x10')](getEndUser(_0x2b8f52,_0x44e7ff,_0x5b86bc))[_0x8c29('0x10')](getTicket(_0x2b8f52,_0x44e7ff,_0x5b86bc,_0x3d5dff,_0x410d69))['then'](function(_0x2ccab7){logger[_0x8c29('0xf')](util[_0x8c29('0x22')](_0x8c29('0x4a'),_0x2ccab7['ticketId']));if(_0x2b8f52!=='unmanaged'){logger['info']('['+[_0x2b8f52[_0x8c29('0x17')]()]+']',_0x8c29('0x4b'));emit(_0x5b86bc,_0x1e9841['name'],_0x2ccab7[_0x8c29('0x26')]);}})[_0x8c29('0x16')](function(_0x5cc90e){logger[_0x8c29('0x38')]('['+[_0x2b8f52[_0x8c29('0x17')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x8c29('0x4c')](_0x5cc90e,{'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 aec616a..d888359 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 _0xe3da=['./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','servicenow','exec','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','freshsales','dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho'];(function(_0x3c88e5,_0x3c4490){var _0x54c015=function(_0x55477b){while(--_0x55477b){_0x3c88e5['push'](_0x3c88e5['shift']());}};_0x54c015(++_0x3c4490);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var zendesk=require(_0xae3d('0x2'));var salesforce=require(_0xae3d('0x3'));var sugarcrm=require(_0xae3d('0x4'));var freshdesk=require(_0xae3d('0x5'));var zoho=require(_0xae3d('0x6'));var desk=require(_0xae3d('0x7'));var vtiger=require(_0xae3d('0x8'));var servicenow=require(_0xae3d('0x9'));var dynamics365=require(_0xae3d('0xa'));var freshsales=require(_0xae3d('0xb'));var integrations=[_0xae3d('0xc'),_0xae3d('0xd'),_0xae3d('0xe'),_0xae3d('0xf'),'zoho',_0xae3d('0x10'),_0xae3d('0x11'),'dynamics365','freshsales',_0xae3d('0x12')];exports[_0xae3d('0x13')]=function(_0x420e28,_0x124833,_0x2705b8,_0x15d6da,_0x4bd4ec,_0x145762){if(_0x2705b8){if(_['includes'](integrations,_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')]())){try{var _0x7770eb=null;var _0x172f7a='';var _0x48aa74=_0x2705b8[_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')]()];if(_0x48aa74){var _0x16fd19=_0x48aa74[_0x420e28[_0xae3d('0x16')]];if(_0x16fd19){var _0x2afdd3=_[_0xae3d('0x17')](_0x16fd19[_0xae3d('0x18')],{'id':parseInt(_0x420e28['data3'],0xa)});if(_0x2afdd3){if(_0x15d6da){if(_0x4bd4ec&&_0x124833[_0xae3d('0x19')]){_0x172f7a=_0xae3d('0x19');}else if(_0x124833[_0xae3d('0x1a')]){_0x172f7a=_0xae3d('0x1b');}else{console[_0xae3d('0x1c')](_0xae3d('0x1d'),_0x124833);}}else{_0x172f7a='unmanaged';}switch(_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')]()){case _0xae3d('0xc'):zendesk[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case'salesforce':salesforce[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case _0xae3d('0xe'):sugarcrm[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case _0xae3d('0xf'):freshdesk[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case'zoho':zoho[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case'desk':desk[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case _0xae3d('0x11'):vtiger[_0x172f7a](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762);break;case _0xae3d('0x1e'):freshsales['cs'](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762,_0x172f7a);break;case _0xae3d('0x12'):servicenow['cs'](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762,_0x172f7a);break;case _0xae3d('0x1f'):dynamics365['cs'](_0x420e28,_0x124833,_0x2afdd3,_0x15d6da,_0x4bd4ec,_0x16fd19,_0x145762,_0x172f7a);break;default:console[_0xae3d('0x1c')]('unknown\x20integration');}}else{_0x7770eb=require(_0xae3d('0x20'))(_0x420e28['data1'][_0xae3d('0x15')]());_0x7770eb[_0xae3d('0x21')](_0xae3d('0x22'),util[_0xae3d('0x23')](_0xae3d('0x24'),_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')](),_0x420e28[_0xae3d('0x25')]));}}else{_0x7770eb=require(_0xae3d('0x20'))(_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')]());_0x7770eb[_0xae3d('0x21')](_0xae3d('0x22'),util[_0xae3d('0x23')](_0xae3d('0x26'),_0x420e28[_0xae3d('0x14')][_0xae3d('0x15')](),_0x420e28[_0xae3d('0x16')]));}}else{}}catch(_0x2131e9){console[_0xae3d('0x21')](_0x2131e9);}}}}; \ No newline at end of file +var _0x294c=['./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','salesforce','freshdesk','zoho','vtiger','dynamics365','servicenow','includes','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','sugarcrm','desk','freshsales','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce'];(function(_0x1c883a,_0x36ff38){var _0xbb8ec0=function(_0xb7d30){while(--_0xb7d30){_0x1c883a['push'](_0x1c883a['shift']());}};_0xbb8ec0(++_0x36ff38);}(_0x294c,0x153));var _0xc294=function(_0x3fc4b1,_0x2b3f55){_0x3fc4b1=_0x3fc4b1-0x0;var _0x57058a=_0x294c[_0x3fc4b1];return _0x57058a;};'use strict';var _=require(_0xc294('0x0'));var util=require('util');var zendesk=require(_0xc294('0x1'));var salesforce=require(_0xc294('0x2'));var sugarcrm=require(_0xc294('0x3'));var freshdesk=require(_0xc294('0x4'));var zoho=require(_0xc294('0x5'));var desk=require(_0xc294('0x6'));var vtiger=require(_0xc294('0x7'));var servicenow=require(_0xc294('0x8'));var dynamics365=require(_0xc294('0x9'));var freshsales=require('./freshsales');var integrations=['zendesk',_0xc294('0xa'),'sugarcrm',_0xc294('0xb'),_0xc294('0xc'),'desk',_0xc294('0xd'),_0xc294('0xe'),'freshsales',_0xc294('0xf')];exports['exec']=function(_0x17ead9,_0x508ca0,_0x3a43ef,_0x4e6f07,_0x1bd436,_0xcf28a6){if(_0x3a43ef){if(_[_0xc294('0x10')](integrations,_0x17ead9[_0xc294('0x11')][_0xc294('0x12')]())){try{var _0x5801d0=null;var _0x4bec69='';var _0x672999=_0x3a43ef[_0x17ead9[_0xc294('0x11')][_0xc294('0x12')]()];if(_0x672999){var _0x1694d3=_0x672999[_0x17ead9[_0xc294('0x13')]];if(_0x1694d3){var _0x88ec98=_['find'](_0x1694d3[_0xc294('0x14')],{'id':parseInt(_0x17ead9[_0xc294('0x15')],0xa)});if(_0x88ec98){if(_0x4e6f07){if(_0x1bd436&&_0x508ca0['queue']){_0x4bec69=_0xc294('0x16');}else if(_0x508ca0[_0xc294('0x17')]){_0x4bec69=_0xc294('0x18');}else{console[_0xc294('0x19')](_0xc294('0x1a'),_0x508ca0);}}else{_0x4bec69=_0xc294('0x1b');}switch(_0x17ead9[_0xc294('0x11')]['toLowerCase']()){case _0xc294('0x1c'):zendesk[_0x4bec69](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6);break;case _0xc294('0xa'):salesforce[_0x4bec69](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6);break;case _0xc294('0x1d'):sugarcrm[_0x4bec69](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6);break;case _0xc294('0xb'):freshdesk[_0x4bec69](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6);break;case _0xc294('0xc'):zoho[_0x4bec69](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6);break;case _0xc294('0x1e'):desk[_0x4bec69](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6);break;case _0xc294('0xd'):vtiger[_0x4bec69](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6);break;case _0xc294('0x1f'):freshsales['cs'](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6,_0x4bec69);break;case _0xc294('0xf'):servicenow['cs'](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6,_0x4bec69);break;case'dynamics365':dynamics365['cs'](_0x17ead9,_0x508ca0,_0x88ec98,_0x4e6f07,_0x1bd436,_0x1694d3,_0xcf28a6,_0x4bec69);break;default:console['log'](_0xc294('0x20'));}}else{_0x5801d0=require(_0xc294('0x21'))(_0x17ead9[_0xc294('0x11')][_0xc294('0x12')]());_0x5801d0['error'](_0xc294('0x22'),util[_0xc294('0x23')](_0xc294('0x24'),_0x17ead9[_0xc294('0x11')][_0xc294('0x12')](),_0x17ead9[_0xc294('0x15')]));}}else{_0x5801d0=require(_0xc294('0x21'))(_0x17ead9[_0xc294('0x11')][_0xc294('0x12')]());_0x5801d0['error']('[EXEC]',util[_0xc294('0x23')](_0xc294('0x25'),_0x17ead9[_0xc294('0x11')][_0xc294('0x12')](),_0x17ead9[_0xc294('0x13')]));}}else{}}catch(_0x206e25){console['error'](_0x206e25);}}}}; \ 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 b07f262..86b0519 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 _0x1657=['queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lastevent','request-promise','bluebird','jsforce','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','contact','WhoId','endUserType','account','WhatId','Case','ContactId','lead','leadId','info','sobject','create','isNil','validateEmail','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','account_contact_lead','Account','Contact','additionalSearchAccount','first','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','LastName','','Caller\x20-\x20%s','upperFirst','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.'];(function(_0x10b2c4,_0x4b10ed){var _0xb10a8e=function(_0x58ff68){while(--_0x58ff68){_0x10b2c4['push'](_0x10b2c4['shift']());}};_0xb10a8e(++_0x4b10ed);}(_0x1657,0x11d));var _0x7165=function(_0x5cff60,_0x4172af){_0x5cff60=_0x5cff60-0x0;var _0x4fd7cd=_0x1657[_0x5cff60];return _0x4fd7cd;};'use strict';var _=require('lodash');var rp=require(_0x7165('0x0'));var moment=require('moment');var BPromise=require(_0x7165('0x1'));var md5=require('md5');var jsforce=require(_0x7165('0x2'));var util=require('util');var Redis=require(_0x7165('0x3'));var intUtil=require('./util');var config=require(_0x7165('0x4'));var logger=require(_0x7165('0x5'))(_0x7165('0x6'));config[_0x7165('0x7')]=_[_0x7165('0x8')](config[_0x7165('0x7')],{'host':_0x7165('0x9'),'port':0x18eb});var io=require(_0x7165('0xa'))(new Redis(config[_0x7165('0x7')]));function emit(_0x48d102,_0x2fa6a7,_0x4f19b0){io['to'](_0x48d102)[_0x7165('0xb')](_0x2fa6a7,_0x4f19b0);}function getTicket(_0x71d98e,_0x178541,_0xf33005,_0x572001,_0xc433a9,_0x1035c2,_0x4e47ad,_0x20917c){var _0x3ca102=Object['assign']({},{'OwnerId':_0x178541['id'],'Subject':intUtil[_0x7165('0xc')](_0x572001[_0x7165('0xd')],_0xc433a9,'\x20'),'Description':intUtil[_0x7165('0xc')](_0x572001[_0x7165('0xe')],_0xc433a9,'\x0a')},getCustomFields(_0x1035c2,_0xc433a9));if(_0xf33005){if(_0x572001[_0x7165('0xf')]===_0x7165('0x10')){_0x3ca102['ActivityDate']=moment[_0x7165('0x11')]();_0x3ca102[_0x7165('0x12')]=![];_0x3ca102[_0x7165('0x13')]=![];if(_0xf33005['endUserType']===_0x7165('0x14')||_0xf33005['endUserType']==='lead'){_0x3ca102[_0x7165('0x15')]=_0xf33005['id'];}else if(_0xf33005[_0x7165('0x16')]===_0x7165('0x17')){_0x3ca102[_0x7165('0x18')]=_0xf33005['id'];}}else if(_0x572001[_0x7165('0xf')]===_0x7165('0x19')){if(_0xf33005[_0x7165('0x16')]==='contact'){_0x3ca102[_0x7165('0x1a')]=_0xf33005['id'];}else if(_0xf33005['endUserType']===_0x7165('0x17')){_0x3ca102['AccountId']=_0xf33005['id'];}else if(_0xf33005['endUserType']===_0x7165('0x1b')&&_0x572001[_0x7165('0x1c')]){_0x3ca102[_0x572001[_0x7165('0x1c')]]=_0xf33005['id'];}else{logger[_0x7165('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4e47ad[_0x7165('0x1e')](_0x572001['ticketType'])[_0x7165('0x1f')](_0x3ca102);}function getUser(_0x2954e7,_0x246886,_0x5bb5fa){if(!_[_0x7165('0x20')](_0x246886)&&intUtil[_0x7165('0x21')](_0x246886)){var _0x39022d={'Email':_0x246886};var _0x377bb9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5bb5fa[_0x7165('0x1e')]('User')[_0x7165('0x22')](_0x39022d,_0x377bb9)[_0x7165('0x23')]()[_0x7165('0x24')](function(_0x21ca39){if(_0x21ca39['length']){var _0x3502db=_[_0x7165('0x22')](_0x21ca39,function(_0x4e92c5){return _0x4e92c5[_0x7165('0x25')]===_0x246886;});if(_0x3502db){logger[_0x7165('0x1d')](_0x7165('0x26'),_0x246886);return BPromise[_0x7165('0x27')]({'id':_0x3502db['Id'],'name':_0x3502db[_0x7165('0x28')]});}}else{logger[_0x7165('0x1d')](_0x7165('0x29'),_0x246886);return _0x5bb5fa['identity']()[_0x7165('0x24')](function(_0x128383){return BPromise['resolve']({'id':_0x128383['user_id'],'name':_0x128383['display_name']});});}});}else{logger[_0x7165('0x1d')](_0x7165('0x29'),_0x246886);return _0x5bb5fa[_0x7165('0x2a')]()[_0x7165('0x24')](function(_0x1bd252){return BPromise['resolve']({'id':_0x1bd252[_0x7165('0x2b')],'name':_0x1bd252[_0x7165('0x2c')]});});}}function getEndUser(_0x5bf989,_0x3e9b37,_0x45f911,_0x5ed509,_0x3789fe){var _0x1dfb2a={'$or':{'Phone':_0x5ed509}};var _0x44ee14={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7165('0x27')]()[_0x7165('0x24')](function(){logger[_0x7165('0x1d')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5ed509,_0x3e9b37[_0x7165('0x2d')]);switch(_0x3e9b37[_0x7165('0x2d')]){case'contact_lead':var _0x163f11=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37['additionalSearchContact']){var _0x5530f2={};_0x5530f2[_0x3e9b37[_0x7165('0x2f')]]=_0x5ed509;_[_0x7165('0x30')](_0x163f11[_0x7165('0x31')],_0x5530f2);}return _0x3789fe[_0x7165('0x1e')]('Contact')[_0x7165('0x22')](_0x163f11,_0x44ee14)[_0x7165('0x23')]()[_0x7165('0x24')](function(_0x4a5c0e){if(_0x4a5c0e&&_0x4a5c0e[_0x7165('0x32')]){return _0x4a5c0e;}else{var _0x65e2a8=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37['additionalSearchLead']){var _0x67c180={};_0x67c180[_0x3e9b37[_0x7165('0x33')]]=_0x5ed509;_[_0x7165('0x30')](_0x65e2a8[_0x7165('0x31')],_0x67c180);}return _0x3789fe[_0x7165('0x1e')](_0x7165('0x34'))[_0x7165('0x22')](_0x65e2a8,_0x44ee14);}});case _0x7165('0x35'):var _0x2c524b=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37['additionalSearchAccount']){var _0x5530f2={};_0x5530f2[_0x3e9b37['additionalSearchAccount']]=_0x5ed509;_[_0x7165('0x30')](_0x2c524b[_0x7165('0x31')],_0x5530f2);}return _0x3789fe[_0x7165('0x1e')](_0x7165('0x36'))[_0x7165('0x22')](_0x2c524b,_0x44ee14)[_0x7165('0x23')]()[_0x7165('0x24')](function(_0x58a438){if(_0x58a438&&_0x58a438[_0x7165('0x32')]){return _0x58a438;}else{var _0xf9a662=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37['additionalSearchContact']){var _0x253520={};_0x253520[_0x3e9b37[_0x7165('0x2f')]]=_0x5ed509;_[_0x7165('0x30')](_0xf9a662[_0x7165('0x31')],_0x253520);}return _0x3789fe[_0x7165('0x1e')](_0x7165('0x37'))[_0x7165('0x22')](_0xf9a662,_0x44ee14)[_0x7165('0x24')](function(_0x266448){if(_0x266448&&_0x266448['length']){return _0x266448;}else{var _0x1305e4=_[_0x7165('0x2e')](_0x1dfb2a);if(_0x3e9b37[_0x7165('0x33')]){var _0xe4d529={};_0xe4d529[_0x3e9b37['additionalSearchLead']]=_0x5ed509;_[_0x7165('0x30')](_0x1305e4[_0x7165('0x31')],_0xe4d529);}return _0x3789fe[_0x7165('0x1e')]('Lead')['find'](_0x1305e4,_0x44ee14);}});}});case _0x7165('0x14'):var _0x163f11=_['cloneDeep'](_0x1dfb2a);if(_0x3e9b37[_0x7165('0x2f')]){var _0x5530f2={};_0x5530f2[_0x3e9b37[_0x7165('0x2f')]]=_0x5ed509;_[_0x7165('0x30')](_0x163f11['$or'],_0x5530f2);}return _0x3789fe[_0x7165('0x1e')](_0x7165('0x37'))[_0x7165('0x22')](_0x163f11,_0x44ee14)[_0x7165('0x23')]();case _0x7165('0x1b'):var _0x5039ac=_['cloneDeep'](_0x1dfb2a);if(_0x3e9b37[_0x7165('0x33')]){var _0x5530f2={};_0x5530f2[_0x3e9b37[_0x7165('0x33')]]=_0x5ed509;_['merge'](_0x5039ac['$or'],_0x5530f2);}return _0x3789fe['sobject']('Lead')['find'](_0x5039ac,_0x44ee14);case _0x7165('0x17'):var _0x2c524b=_['cloneDeep'](_0x1dfb2a);if(_0x3e9b37[_0x7165('0x38')]){var _0x5530f2={};_0x5530f2[_0x3e9b37[_0x7165('0x38')]]=_0x5ed509;_[_0x7165('0x30')](_0x2c524b[_0x7165('0x31')],_0x5530f2);}return _0x3789fe['sobject'](_0x7165('0x36'))[_0x7165('0x22')](_0x2c524b,_0x44ee14);default:return null;}})[_0x7165('0x24')](function(_0x31a762){if(_0x31a762&&_0x31a762['length']){var _0x547307=_[_0x7165('0x39')](_0x31a762);if(_0x547307){return BPromise[_0x7165('0x27')]({'id':_0x547307['Id'],'name':_0x547307[_0x7165('0x28')],'phone':_0x547307[_0x7165('0x3a')],'endUserType':_0x547307[_0x7165('0x3b')]['type'][_0x7165('0x3c')]()});}}})[_0x7165('0x24')](function(_0x5ae188){if(_0x5ae188){logger[_0x7165('0x1d')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5ae188['endUserType'],_0x5ed509);return BPromise[_0x7165('0x27')](_0x5ae188);}else{logger[_0x7165('0x1d')](_0x7165('0x3d'),_0x5ed509);var _0x4580df={'Phone':_0x5ed509};if(_0x3e9b37[_0x7165('0x3e')]){if(_0x3e9b37[_0x7165('0x3e')]===_0x7165('0x14')){logger[_0x7165('0x1d')](_0x7165('0x3f'),_0x5ed509,_0x3e9b37['moduleCreate']);_0x4580df['LastName']=_0x45f911!==''?_0x45f911:util[_0x7165('0x40')]('Caller\x20-\x20%s',_0x5ed509);}else if(_0x3e9b37[_0x7165('0x3e')]===_0x7165('0x1b')){logger[_0x7165('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5ed509,_0x3e9b37['moduleCreate']);_0x4580df[_0x7165('0x41')]=_0x45f911!==_0x7165('0x42')?_0x45f911:util[_0x7165('0x40')](_0x7165('0x43'),_0x5ed509);_0x4580df['Company']='No\x20Company';}else if(_0x3e9b37[_0x7165('0x3e')]===_0x7165('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5ed509,_0x3e9b37[_0x7165('0x3e')]);_0x4580df['Name']=_0x45f911!==''?_0x45f911:util[_0x7165('0x40')](_0x7165('0x43'),_0x5ed509);}else{return null;}}return _0x3789fe[_0x7165('0x1e')](_[_0x7165('0x44')](_0x3e9b37[_0x7165('0x3e')]))[_0x7165('0x1f')](_0x4580df)[_0x7165('0x24')](function(_0x4b41d0){return BPromise[_0x7165('0x27')]({'id':_0x4b41d0['id'],'endUserType':_0x3e9b37[_0x7165('0x3e')]});});}});}function getCustomFields(_0x3663db,_0x5ae104){var _0xca1acd={};if(_0x3663db[_0x7165('0x32')]>0x0){_['forEach'](_0x3663db,function(_0x78241b){if(_[_0x7165('0x45')](['string',_0x7165('0x46')],_0x78241b[_0x7165('0x47')])&&_0x78241b[_0x7165('0x48')]){_0xca1acd[_0x78241b[_0x7165('0x48')]]=_0x78241b[_0x7165('0x49')][_0x7165('0x4a')]();}else if(_0x78241b['type']===_0x7165('0x4b')&&_0x78241b[_0x7165('0x4c')]&&_0x78241b[_0x7165('0x48')]){_0x5ae104[_0x78241b[_0x7165('0x4c')]]&&(_0xca1acd[_0x78241b[_0x7165('0x48')]]=_0x5ae104[_0x78241b[_0x7165('0x4c')]][_0x7165('0x4a')]());}else if(_0x78241b['type']===_0x7165('0x4d')&&_0x78241b[_0x7165('0x4e')]&&_0x78241b[_0x7165('0x4e')][_0x7165('0x4f')]&&_0x78241b[_0x7165('0x48')]){_0x5ae104[_0x78241b[_0x7165('0x4e')]['name'][_0x7165('0x3c')]()]&&(_0xca1acd[_0x78241b[_0x7165('0x48')]]=_0x5ae104[_0x78241b[_0x7165('0x4e')][_0x7165('0x4f')][_0x7165('0x3c')]()][_0x7165('0x4a')]());}});}return _0xca1acd;}function getConnection(_0x3550f1){var _0x5071c9=_0x3550f1[_0x7165('0x50')][_0x7165('0x51')](_0x3550f1[_0x7165('0x52')]);var _0x5043a8=new jsforce[(_0x7165('0x53'))]({'oauth2':{'loginUrl':_0x3550f1[_0x7165('0x54')]||_0x7165('0x55'),'clientId':_0x3550f1[_0x7165('0x56')],'clientSecret':_0x3550f1['clientSecret']}});return _0x5043a8[_0x7165('0x57')](_0x3550f1[_0x7165('0x58')],_0x5071c9)[_0x7165('0x24')](function(){logger[_0x7165('0x1d')](_0x7165('0x59'));return _0x5043a8;});}exports[_0x7165('0x5a')]=function(_0x3428cb,_0x568f39,_0x3852cb,_0x38bcdb,_0x532d5b,_0x23ae71){var _0x145497,_0x4e0230,_0x39e774,_0x3f5d83;_0x23ae71['serverUrl']=intUtil['stripTrailingSlash'](_0x23ae71[_0x7165('0x5b')]);_0x23ae71[_0x7165('0x54')]=intUtil[_0x7165('0x5c')](_0x23ae71['remoteUri']);if(_0x532d5b&&_0x532d5b[_0x7165('0x5d')]){logger[_0x7165('0x1d')]('[QUEUE]',_0x7165('0x5e'));_0x568f39[_0x7165('0x5f')]=util[_0x7165('0x40')](_0x7165('0x60'),_0x23ae71[_0x7165('0x5b')],_0x568f39[_0x7165('0x61')],md5(_0x568f39[_0x7165('0x61')]));}else{_0x568f39[_0x7165('0x5f')]='';}return getConnection(_0x23ae71)['then'](function(_0x47bbfc){_0x3f5d83=_0x47bbfc;return getUser(_0x23ae71,_0x38bcdb[_0x7165('0x62')],_0x3f5d83);})[_0x7165('0x24')](function(_0x370bd5){_0x145497=_0x370bd5;return getEndUser(_0x23ae71,_0x3852cb,_0x568f39[_0x7165('0x63')],_0x568f39['calleridnum'],_0x3f5d83);})[_0x7165('0x24')](function(_0x17da61){_0x4e0230=_0x17da61;return getTicket(_0x23ae71,_0x145497,_0x4e0230,_0x3852cb,_0x568f39,_0x3852cb['Fields'],_0x3f5d83,_0x7165('0x5a'));})[_0x7165('0x24')](function(_0x32dd60){_0x39e774=_0x32dd60;logger[_0x7165('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x39e774['id']);logger['info'](_0x7165('0x64'),_0x39e774['id'],_0x38bcdb[_0x7165('0x4f')],_0x23ae71[_0x7165('0x47')]);switch(_0x23ae71['type']){case'integrationTab':emit(util['format']('user:%s',_0x38bcdb['name']),'trigger:salesforce:display',{'recordId':_0x39e774['id']});break;case _0x7165('0x65'):emit(util['format'](_0x7165('0x66'),_0x38bcdb[_0x7165('0x4f')]),_0x7165('0x67'),{'uri':util[_0x7165('0x40')](_0x7165('0x68'),_0x3f5d83[_0x7165('0x69')],_0x39e774['id'])});break;default:logger[_0x7165('0x6a')](_0x7165('0x6b'));}})[_0x7165('0x6c')](function(_0x5a1864){logger[_0x7165('0x6a')]('[QUEUE]',_0x5a1864);});};exports[_0x7165('0x6d')]=function(_0x4cad19,_0x54385f,_0x224d46,_0x3f92d8,_0x51bed3,_0x3d0fe2,_0x127fa1){var _0x105e16,_0x44cfc5,_0xae3920,_0x3e4545;_0x3d0fe2[_0x7165('0x5b')]=intUtil[_0x7165('0x5c')](_0x3d0fe2[_0x7165('0x5b')]);_0x3d0fe2[_0x7165('0x54')]=intUtil[_0x7165('0x5c')](_0x3d0fe2['remoteUri']);if(_0x127fa1&&_0x127fa1[_0x7165('0x6e')]&&_0x127fa1[_0x7165('0x6e')]!==_0x7165('0x6f')){logger[_0x7165('0x1d')](_0x7165('0x70'),_0x7165('0x5e'));_0x54385f[_0x7165('0x5f')]=util[_0x7165('0x40')](_0x7165('0x60'),_0x3d0fe2[_0x7165('0x5b')],_0x54385f[_0x7165('0x61')],md5(_0x54385f['uniqueid']));}return getConnection(_0x3d0fe2)[_0x7165('0x24')](function(_0x554c61){_0x3e4545=_0x554c61;return getUser(_0x3d0fe2,_0x3f92d8[_0x7165('0x62')],_0x3e4545);})['then'](function(_0x129734){_0x105e16=_0x129734;return getEndUser(_0x3d0fe2,_0x224d46,_0x54385f['destcalleridname'],_0x54385f[_0x7165('0x71')],_0x3e4545);})['then'](function(_0x12e6c6){_0x44cfc5=_0x12e6c6;return getTicket(_0x3d0fe2,_0x105e16,_0x44cfc5,_0x224d46,_0x54385f,_0x224d46[_0x7165('0x72')],_0x3e4545,_0x7165('0x6d'));})[_0x7165('0x24')](function(_0x322b83){_0xae3920=_0x322b83;logger[_0x7165('0x1d')](_0x7165('0x73'),_0xae3920['id']);logger[_0x7165('0x1d')](_0x7165('0x74'),_0xae3920['id'],_0x3f92d8[_0x7165('0x4f')],_0x3d0fe2['type']);switch(_0x3d0fe2[_0x7165('0x47')]){case _0x7165('0x75'):emit(util[_0x7165('0x40')]('user:%s',_0x3f92d8[_0x7165('0x4f')]),_0x7165('0x76'),{'recordId':_0xae3920['id']});break;case _0x7165('0x65'):emit(util[_0x7165('0x40')](_0x7165('0x66'),_0x3f92d8[_0x7165('0x4f')]),_0x7165('0x67'),{'uri':util[_0x7165('0x40')](_0x7165('0x68'),_0x3e4545[_0x7165('0x69')],_0xae3920['id'])});break;default:logger['error']('[OUTBOUND]',_0x7165('0x77'));}})[_0x7165('0x6c')](function(_0x3adf0c){logger[_0x7165('0x6a')]('[OUTBOUND]',_0x3adf0c);});};exports['unmanaged']=function(_0x27119b,_0xdfde2a,_0x23d4f0,_0x153eff,_0x298ff6,_0x56f4ee){var _0x546c6a,_0x3a8a85,_0x5c7cba,_0x3a72a2;_0x56f4ee['serverUrl']=intUtil[_0x7165('0x5c')](_0x56f4ee[_0x7165('0x5b')]);_0x56f4ee['remoteUri']=intUtil[_0x7165('0x5c')](_0x56f4ee[_0x7165('0x54')]);if(_0x298ff6&&_0x298ff6[_0x7165('0x5d')]){logger[_0x7165('0x1d')]('['+_0xdfde2a['lastevent'][_0x7165('0x78')]()+']',_0x7165('0x5e'));_0xdfde2a[_0x7165('0x5f')]=util[_0x7165('0x40')](_0x7165('0x60'),_0x56f4ee['serverUrl'],_0xdfde2a[_0x7165('0x61')],md5(_0xdfde2a['uniqueid']));}else{_0xdfde2a['recordingURL']='';}return getConnection(_0x56f4ee)['then'](function(_0x4c22c5){_0x3a72a2=_0x4c22c5;if(!_[_0x7165('0x20')](_0x153eff)){return getUser(_0x56f4ee,_0x153eff[_0x7165('0x4f')],_0x3a72a2);}else{return getUser(_0x56f4ee,null,_0x3a72a2);}})[_0x7165('0x24')](function(_0x3056d7){_0x546c6a=_0x3056d7;return getEndUser(_0x56f4ee,_0x23d4f0,_0xdfde2a['calleridname'],_0xdfde2a[_0x7165('0x79')],_0x3a72a2);})['then'](function(_0x337068){_0x3a8a85=_0x337068;return getTicket(_0x56f4ee,_0x546c6a,_0x3a8a85,_0x23d4f0,_0xdfde2a,_0x23d4f0[_0x7165('0x72')],_0x3a72a2);})[_0x7165('0x24')](function(_0x56e24d){_0x5c7cba=_0x56e24d;logger[_0x7165('0x1d')]('['+_0xdfde2a['lastevent'][_0x7165('0x78')]()+_0x7165('0x7a'),_0x5c7cba['id']);logger[_0x7165('0x1d')]('['+_0xdfde2a['lastevent'][_0x7165('0x78')]()+_0x7165('0x7b'),_0x56f4ee[_0x7165('0x47')]);})[_0x7165('0x6c')](function(_0x21f88b){logger[_0x7165('0x6a')]('['+_0xdfde2a[_0x7165('0x7c')][_0x7165('0x78')]()+']',_0x21f88b);});}; \ No newline at end of file +var _0x1510=['instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','WhatId','Case','ContactId','account','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','execute','then','length','find','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','Name','upperFirst','create','forEach','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','password','concat','https://login.salesforce.com','clientId','clientSecret','login','username','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','newTab','trigger:browser:url','error','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridnum','trigger:salesforce:display'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1510,0x183));var _0x0151=function(_0x5ebf27,_0x4514e0){_0x5ebf27=_0x5ebf27-0x0;var _0x121c72=_0x1510[_0x5ebf27];return _0x121c72;};'use strict';var _=require(_0x0151('0x0'));var rp=require(_0x0151('0x1'));var moment=require(_0x0151('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x0151('0x3'));var Redis=require(_0x0151('0x4'));var intUtil=require(_0x0151('0x5'));var config=require(_0x0151('0x6'));var logger=require(_0x0151('0x7'))(_0x0151('0x8'));config[_0x0151('0x9')]=_[_0x0151('0xa')](config[_0x0151('0x9')],{'host':_0x0151('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0151('0x9')]));function emit(_0x3c32e1,_0x445c7a,_0x6c6104){io['to'](_0x3c32e1)[_0x0151('0xc')](_0x445c7a,_0x6c6104);}function getTicket(_0x20a8dc,_0xff9df0,_0x460d4a,_0x2d4956,_0x57719b,_0x36a921,_0x4e75bb,_0xd4dc57){var _0x42854a=Object['assign']({},{'OwnerId':_0xff9df0['id'],'Subject':intUtil[_0x0151('0xd')](_0x2d4956[_0x0151('0xe')],_0x57719b,'\x20'),'Description':intUtil[_0x0151('0xd')](_0x2d4956[_0x0151('0xf')],_0x57719b,'\x0a')},getCustomFields(_0x36a921,_0x57719b));if(_0x460d4a){if(_0x2d4956[_0x0151('0x10')]===_0x0151('0x11')){_0x42854a[_0x0151('0x12')]=moment[_0x0151('0x13')]();_0x42854a[_0x0151('0x14')]=![];_0x42854a[_0x0151('0x15')]=![];if(_0x460d4a[_0x0151('0x16')]===_0x0151('0x17')||_0x460d4a[_0x0151('0x16')]==='lead'){_0x42854a[_0x0151('0x18')]=_0x460d4a['id'];}else if(_0x460d4a[_0x0151('0x16')]==='account'){_0x42854a[_0x0151('0x19')]=_0x460d4a['id'];}}else if(_0x2d4956[_0x0151('0x10')]===_0x0151('0x1a')){if(_0x460d4a[_0x0151('0x16')]==='contact'){_0x42854a[_0x0151('0x1b')]=_0x460d4a['id'];}else if(_0x460d4a[_0x0151('0x16')]===_0x0151('0x1c')){_0x42854a[_0x0151('0x1d')]=_0x460d4a['id'];}else if(_0x460d4a[_0x0151('0x16')]===_0x0151('0x1e')&&_0x2d4956[_0x0151('0x1f')]){_0x42854a[_0x2d4956['leadId']]=_0x460d4a['id'];}else{logger[_0x0151('0x20')](_0x0151('0x21'));}}}return _0x4e75bb[_0x0151('0x22')](_0x2d4956[_0x0151('0x10')])['create'](_0x42854a);}function getUser(_0x368689,_0x468c9f,_0x55ff12){if(!_[_0x0151('0x23')](_0x468c9f)&&intUtil[_0x0151('0x24')](_0x468c9f)){var _0x3f4459={'Email':_0x468c9f};var _0x164a7b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x55ff12[_0x0151('0x22')]('User')['find'](_0x3f4459,_0x164a7b)[_0x0151('0x25')]()[_0x0151('0x26')](function(_0x10eb21){if(_0x10eb21[_0x0151('0x27')]){var _0x439441=_[_0x0151('0x28')](_0x10eb21,function(_0x41542e){return _0x41542e[_0x0151('0x29')]===_0x468c9f;});if(_0x439441){logger[_0x0151('0x20')](_0x0151('0x2a'),_0x468c9f);return BPromise[_0x0151('0x2b')]({'id':_0x439441['Id'],'name':_0x439441['Name']});}}else{logger['info'](_0x0151('0x2c'),_0x468c9f);return _0x55ff12['identity']()[_0x0151('0x26')](function(_0x19c737){return BPromise['resolve']({'id':_0x19c737[_0x0151('0x2d')],'name':_0x19c737[_0x0151('0x2e')]});});}});}else{logger[_0x0151('0x20')](_0x0151('0x2c'),_0x468c9f);return _0x55ff12[_0x0151('0x2f')]()[_0x0151('0x26')](function(_0x989d5b){return BPromise['resolve']({'id':_0x989d5b[_0x0151('0x2d')],'name':_0x989d5b[_0x0151('0x2e')]});});}}function getEndUser(_0x14e7e9,_0x4c2978,_0x4b0dc0,_0x129d57,_0x5c5ab9){var _0xcd29f0={'$or':{'Phone':_0x129d57}};var _0x280466={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x0151('0x26')](function(){logger[_0x0151('0x20')](_0x0151('0x30'),_0x129d57,_0x4c2978[_0x0151('0x31')]);switch(_0x4c2978[_0x0151('0x31')]){case'contact_lead':var _0x5619aa=_[_0x0151('0x32')](_0xcd29f0);if(_0x4c2978[_0x0151('0x33')]){var _0x113a71={};_0x113a71[_0x4c2978[_0x0151('0x33')]]=_0x129d57;_[_0x0151('0x34')](_0x5619aa[_0x0151('0x35')],_0x113a71);}return _0x5c5ab9[_0x0151('0x22')](_0x0151('0x36'))[_0x0151('0x28')](_0x5619aa,_0x280466)[_0x0151('0x25')]()['then'](function(_0x4c2f4b){if(_0x4c2f4b&&_0x4c2f4b[_0x0151('0x27')]){return _0x4c2f4b;}else{var _0x940bc0=_['cloneDeep'](_0xcd29f0);if(_0x4c2978[_0x0151('0x37')]){var _0x141eea={};_0x141eea[_0x4c2978[_0x0151('0x37')]]=_0x129d57;_[_0x0151('0x34')](_0x940bc0[_0x0151('0x35')],_0x141eea);}return _0x5c5ab9[_0x0151('0x22')](_0x0151('0x38'))[_0x0151('0x28')](_0x940bc0,_0x280466);}});case _0x0151('0x39'):var _0x36010c=_[_0x0151('0x32')](_0xcd29f0);if(_0x4c2978[_0x0151('0x3a')]){var _0x113a71={};_0x113a71[_0x4c2978['additionalSearchAccount']]=_0x129d57;_[_0x0151('0x34')](_0x36010c['$or'],_0x113a71);}return _0x5c5ab9['sobject'](_0x0151('0x3b'))[_0x0151('0x28')](_0x36010c,_0x280466)[_0x0151('0x25')]()[_0x0151('0x26')](function(_0x32be81){if(_0x32be81&&_0x32be81['length']){return _0x32be81;}else{var _0x5d6f03=_[_0x0151('0x32')](_0xcd29f0);if(_0x4c2978[_0x0151('0x33')]){var _0x2a4b78={};_0x2a4b78[_0x4c2978[_0x0151('0x33')]]=_0x129d57;_[_0x0151('0x34')](_0x5d6f03[_0x0151('0x35')],_0x2a4b78);}return _0x5c5ab9[_0x0151('0x22')](_0x0151('0x36'))[_0x0151('0x28')](_0x5d6f03,_0x280466)['then'](function(_0x3d7121){if(_0x3d7121&&_0x3d7121['length']){return _0x3d7121;}else{var _0xffbe58=_[_0x0151('0x32')](_0xcd29f0);if(_0x4c2978[_0x0151('0x37')]){var _0x13ae06={};_0x13ae06[_0x4c2978['additionalSearchLead']]=_0x129d57;_['merge'](_0xffbe58['$or'],_0x13ae06);}return _0x5c5ab9['sobject'](_0x0151('0x38'))[_0x0151('0x28')](_0xffbe58,_0x280466);}});}});case _0x0151('0x17'):var _0x5619aa=_[_0x0151('0x32')](_0xcd29f0);if(_0x4c2978[_0x0151('0x33')]){var _0x113a71={};_0x113a71[_0x4c2978[_0x0151('0x33')]]=_0x129d57;_[_0x0151('0x34')](_0x5619aa['$or'],_0x113a71);}return _0x5c5ab9[_0x0151('0x22')](_0x0151('0x36'))[_0x0151('0x28')](_0x5619aa,_0x280466)[_0x0151('0x25')]();case _0x0151('0x1e'):var _0x26923f=_[_0x0151('0x32')](_0xcd29f0);if(_0x4c2978[_0x0151('0x37')]){var _0x113a71={};_0x113a71[_0x4c2978[_0x0151('0x37')]]=_0x129d57;_[_0x0151('0x34')](_0x26923f[_0x0151('0x35')],_0x113a71);}return _0x5c5ab9[_0x0151('0x22')](_0x0151('0x38'))[_0x0151('0x28')](_0x26923f,_0x280466);case _0x0151('0x1c'):var _0x36010c=_['cloneDeep'](_0xcd29f0);if(_0x4c2978['additionalSearchAccount']){var _0x113a71={};_0x113a71[_0x4c2978[_0x0151('0x3a')]]=_0x129d57;_[_0x0151('0x34')](_0x36010c['$or'],_0x113a71);}return _0x5c5ab9[_0x0151('0x22')](_0x0151('0x3b'))[_0x0151('0x28')](_0x36010c,_0x280466);default:return null;}})[_0x0151('0x26')](function(_0x3e6dab){if(_0x3e6dab&&_0x3e6dab[_0x0151('0x27')]){var _0x58d764=_[_0x0151('0x3c')](_0x3e6dab);if(_0x58d764){return BPromise['resolve']({'id':_0x58d764['Id'],'name':_0x58d764['Name'],'phone':_0x58d764[_0x0151('0x3d')],'endUserType':_0x58d764[_0x0151('0x3e')][_0x0151('0x3f')][_0x0151('0x40')]()});}}})[_0x0151('0x26')](function(_0x144e41){if(_0x144e41){logger[_0x0151('0x20')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x144e41['endUserType'],_0x129d57);return BPromise[_0x0151('0x2b')](_0x144e41);}else{logger[_0x0151('0x20')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x129d57);var _0x42a92f={'Phone':_0x129d57};if(_0x4c2978[_0x0151('0x41')]){if(_0x4c2978[_0x0151('0x41')]==='contact'){logger[_0x0151('0x20')](_0x0151('0x42'),_0x129d57,_0x4c2978[_0x0151('0x41')]);_0x42a92f['LastName']=_0x4b0dc0!==_0x0151('0x43')?_0x4b0dc0:util[_0x0151('0x44')](_0x0151('0x45'),_0x129d57);}else if(_0x4c2978[_0x0151('0x41')]==='lead'){logger[_0x0151('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x129d57,_0x4c2978[_0x0151('0x41')]);_0x42a92f[_0x0151('0x46')]=_0x4b0dc0!==_0x0151('0x43')?_0x4b0dc0:util[_0x0151('0x44')](_0x0151('0x45'),_0x129d57);_0x42a92f[_0x0151('0x47')]=_0x0151('0x48');}else if(_0x4c2978[_0x0151('0x41')]===_0x0151('0x1c')){logger[_0x0151('0x20')](_0x0151('0x42'),_0x129d57,_0x4c2978['moduleCreate']);_0x42a92f[_0x0151('0x49')]=_0x4b0dc0!==_0x0151('0x43')?_0x4b0dc0:util[_0x0151('0x44')](_0x0151('0x45'),_0x129d57);}else{return null;}}return _0x5c5ab9[_0x0151('0x22')](_[_0x0151('0x4a')](_0x4c2978['moduleCreate']))[_0x0151('0x4b')](_0x42a92f)['then'](function(_0x3e0e7b){return BPromise['resolve']({'id':_0x3e0e7b['id'],'endUserType':_0x4c2978[_0x0151('0x41')]});});}});}function getCustomFields(_0x10a53f,_0x1fe735){var _0x3c1a08={};if(_0x10a53f[_0x0151('0x27')]>0x0){_[_0x0151('0x4c')](_0x10a53f,function(_0x4de9a4){if(_[_0x0151('0x4d')]([_0x0151('0x4e'),_0x0151('0x4f')],_0x4de9a4[_0x0151('0x3f')])&&_0x4de9a4[_0x0151('0x50')]){_0x3c1a08[_0x4de9a4[_0x0151('0x50')]]=_0x4de9a4[_0x0151('0x51')][_0x0151('0x52')]();}else if(_0x4de9a4[_0x0151('0x3f')]===_0x0151('0x53')&&_0x4de9a4[_0x0151('0x54')]&&_0x4de9a4[_0x0151('0x50')]){_0x1fe735[_0x4de9a4[_0x0151('0x54')]]&&(_0x3c1a08[_0x4de9a4['idField']]=_0x1fe735[_0x4de9a4[_0x0151('0x54')]][_0x0151('0x52')]());}else if(_0x4de9a4[_0x0151('0x3f')]==='customVariable'&&_0x4de9a4['Variable']&&_0x4de9a4[_0x0151('0x55')]['name']&&_0x4de9a4[_0x0151('0x50')]){_0x1fe735[_0x4de9a4[_0x0151('0x55')][_0x0151('0x56')][_0x0151('0x40')]()]&&(_0x3c1a08[_0x4de9a4['idField']]=_0x1fe735[_0x4de9a4[_0x0151('0x55')][_0x0151('0x56')][_0x0151('0x40')]()][_0x0151('0x52')]());}});}return _0x3c1a08;}function getConnection(_0x1d0ac4){var _0x388972=_0x1d0ac4[_0x0151('0x57')][_0x0151('0x58')](_0x1d0ac4['securityToken']);var _0x23a945=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1d0ac4['remoteUri']||_0x0151('0x59'),'clientId':_0x1d0ac4[_0x0151('0x5a')],'clientSecret':_0x1d0ac4[_0x0151('0x5b')]}});return _0x23a945[_0x0151('0x5c')](_0x1d0ac4[_0x0151('0x5d')],_0x388972)['then'](function(){logger['info']('Connection\x20established.');return _0x23a945;});}exports['queue']=function(_0x580675,_0x422910,_0x6e6f83,_0x4f4a08,_0x2079aa,_0x10e9e3){var _0x53bfac,_0x44ef06,_0x8b7dfc,_0x15eed4;_0x10e9e3[_0x0151('0x5e')]=intUtil[_0x0151('0x5f')](_0x10e9e3[_0x0151('0x5e')]);_0x10e9e3[_0x0151('0x60')]=intUtil[_0x0151('0x5f')](_0x10e9e3[_0x0151('0x60')]);if(_0x2079aa&&_0x2079aa[_0x0151('0x61')]){logger[_0x0151('0x20')](_0x0151('0x62'),'Recording\x20is\x20enabled!');_0x422910[_0x0151('0x63')]=util[_0x0151('0x44')](_0x0151('0x64'),_0x10e9e3['serverUrl'],_0x422910[_0x0151('0x65')],md5(_0x422910[_0x0151('0x65')]));}else{_0x422910['recordingURL']='';}return getConnection(_0x10e9e3)['then'](function(_0x14ba9e){_0x15eed4=_0x14ba9e;return getUser(_0x10e9e3,_0x4f4a08['email'],_0x15eed4);})[_0x0151('0x26')](function(_0x121a82){_0x53bfac=_0x121a82;return getEndUser(_0x10e9e3,_0x6e6f83,_0x422910[_0x0151('0x66')],_0x422910[_0x0151('0x67')],_0x15eed4);})['then'](function(_0x3f9880){_0x44ef06=_0x3f9880;return getTicket(_0x10e9e3,_0x53bfac,_0x44ef06,_0x6e6f83,_0x422910,_0x6e6f83[_0x0151('0x68')],_0x15eed4,_0x0151('0x69'));})[_0x0151('0x26')](function(_0x53a20c){_0x8b7dfc=_0x53a20c;logger['info'](_0x0151('0x6a'),_0x8b7dfc['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x8b7dfc['id'],_0x4f4a08[_0x0151('0x56')],_0x10e9e3[_0x0151('0x3f')]);switch(_0x10e9e3[_0x0151('0x3f')]){case _0x0151('0x6b'):emit(util[_0x0151('0x44')](_0x0151('0x6c'),_0x4f4a08['name']),'trigger:salesforce:display',{'recordId':_0x8b7dfc['id']});break;case _0x0151('0x6d'):emit(util['format'](_0x0151('0x6c'),_0x4f4a08[_0x0151('0x56')]),_0x0151('0x6e'),{'uri':util[_0x0151('0x44')]('%s/%s/e',_0x15eed4['instanceUrl'],_0x8b7dfc['id'])});break;default:logger[_0x0151('0x6f')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0151('0x70')](function(_0x44d142){logger['error'](_0x0151('0x62'),_0x44d142);});};exports[_0x0151('0x71')]=function(_0x4f37ad,_0x51178f,_0x2b6399,_0x1a8537,_0x47ce50,_0x195989,_0x546126){var _0x36312c,_0x1df37a,_0x195b0b,_0x1c33db;_0x195989[_0x0151('0x5e')]=intUtil[_0x0151('0x5f')](_0x195989[_0x0151('0x5e')]);_0x195989['remoteUri']=intUtil[_0x0151('0x5f')](_0x195989[_0x0151('0x60')]);if(_0x546126&&_0x546126[_0x0151('0x72')]&&_0x546126[_0x0151('0x72')]!==_0x0151('0x73')){logger[_0x0151('0x20')](_0x0151('0x74'),_0x0151('0x75'));_0x51178f[_0x0151('0x63')]=util[_0x0151('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x195989[_0x0151('0x5e')],_0x51178f[_0x0151('0x65')],md5(_0x51178f[_0x0151('0x65')]));}return getConnection(_0x195989)['then'](function(_0x2ed1cd){_0x1c33db=_0x2ed1cd;return getUser(_0x195989,_0x1a8537[_0x0151('0x76')],_0x1c33db);})[_0x0151('0x26')](function(_0x1aeaa2){_0x36312c=_0x1aeaa2;return getEndUser(_0x195989,_0x2b6399,_0x51178f['destcalleridname'],_0x51178f[_0x0151('0x77')],_0x1c33db);})[_0x0151('0x26')](function(_0x4bfaff){_0x1df37a=_0x4bfaff;return getTicket(_0x195989,_0x36312c,_0x1df37a,_0x2b6399,_0x51178f,_0x2b6399['Fields'],_0x1c33db,_0x0151('0x71'));})[_0x0151('0x26')](function(_0x3d75a9){_0x195b0b=_0x3d75a9;logger[_0x0151('0x20')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x195b0b['id']);logger[_0x0151('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x195b0b['id'],_0x1a8537[_0x0151('0x56')],_0x195989[_0x0151('0x3f')]);switch(_0x195989[_0x0151('0x3f')]){case _0x0151('0x6b'):emit(util['format'](_0x0151('0x6c'),_0x1a8537['name']),_0x0151('0x78'),{'recordId':_0x195b0b['id']});break;case _0x0151('0x6d'):emit(util[_0x0151('0x44')](_0x0151('0x6c'),_0x1a8537['name']),_0x0151('0x6e'),{'uri':util[_0x0151('0x44')]('%s/%s/e',_0x1c33db[_0x0151('0x79')],_0x195b0b['id'])});break;default:logger[_0x0151('0x6f')]('[OUTBOUND]',_0x0151('0x7a'));}})['catch'](function(_0x3d942c){logger[_0x0151('0x6f')](_0x0151('0x74'),_0x3d942c);});};exports[_0x0151('0x7b')]=function(_0x1cf8c5,_0x157773,_0x1c3a12,_0x40c1ce,_0x5ca57b,_0x545ff5){var _0x4c77e4,_0x26917d,_0x27ce3e,_0x524a0f;_0x545ff5[_0x0151('0x5e')]=intUtil[_0x0151('0x5f')](_0x545ff5[_0x0151('0x5e')]);_0x545ff5[_0x0151('0x60')]=intUtil[_0x0151('0x5f')](_0x545ff5[_0x0151('0x60')]);if(_0x5ca57b&&_0x5ca57b[_0x0151('0x61')]){logger[_0x0151('0x20')]('['+_0x157773[_0x0151('0x7c')][_0x0151('0x7d')]()+']','Recording\x20is\x20enabled!');_0x157773['recordingURL']=util[_0x0151('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x545ff5['serverUrl'],_0x157773[_0x0151('0x65')],md5(_0x157773[_0x0151('0x65')]));}else{_0x157773['recordingURL']='';}return getConnection(_0x545ff5)[_0x0151('0x26')](function(_0x447f0c){_0x524a0f=_0x447f0c;if(!_['isNil'](_0x40c1ce)){return getUser(_0x545ff5,_0x40c1ce[_0x0151('0x56')],_0x524a0f);}else{return getUser(_0x545ff5,null,_0x524a0f);}})[_0x0151('0x26')](function(_0x574a06){_0x4c77e4=_0x574a06;return getEndUser(_0x545ff5,_0x1c3a12,_0x157773[_0x0151('0x66')],_0x157773[_0x0151('0x67')],_0x524a0f);})[_0x0151('0x26')](function(_0x1a6db8){_0x26917d=_0x1a6db8;return getTicket(_0x545ff5,_0x4c77e4,_0x26917d,_0x1c3a12,_0x157773,_0x1c3a12[_0x0151('0x68')],_0x524a0f);})[_0x0151('0x26')](function(_0x89f9ad){_0x27ce3e=_0x89f9ad;logger['info']('['+_0x157773[_0x0151('0x7c')][_0x0151('0x7d')]()+']\x20Ticket\x20%s\x20created.',_0x27ce3e['id']);logger[_0x0151('0x20')]('['+_0x157773['lastevent']['toUpperCase']()+_0x0151('0x7e'),_0x545ff5[_0x0151('0x3f')]);})[_0x0151('0x70')](function(_0x3bfe52){logger[_0x0151('0x6f')]('['+_0x157773[_0x0151('0x7c')][_0x0151('0x7d')]()+']',_0x3bfe52);});}; \ 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 33acb73..235efc5 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 _0xcb77=['Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','format','user:%s','emit','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminEmail','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','picklist','type','nameField','customField','toString','includes','idField','toLowerCase','content','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketId','ticketNumber','push','forEach','all'];(function(_0xbd46d,_0x39d268){var _0x18f795=function(_0x19361a){while(--_0x19361a){_0xbd46d['push'](_0xbd46d['shift']());}};_0x18f795(++_0x39d268);}(_0xcb77,0x1da));var _0x7cb7=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0xcb77[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0x7cb7('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x7cb7('0x1'));var md5=require(_0x7cb7('0x2'));var Redis=require(_0x7cb7('0x3'));var intUtil=require(_0x7cb7('0x4'));var config=require(_0x7cb7('0x5'));var logger=require(_0x7cb7('0x6'))('servicenow');config['redis']=_[_0x7cb7('0x7')](config[_0x7cb7('0x8')],{'host':_0x7cb7('0x9'),'port':0x18eb});var io=require(_0x7cb7('0xa'))(new Redis(config[_0x7cb7('0x8')]));function getAdminUser(_0x14579b,_0x3d5f12,_0x51961f,_0x193edb,_0x35d695,_0x17b2a2){return new Promise(function(_0x403559,_0x5246a0){var _0x2c2efa={'method':_0x7cb7('0xb'),'uri':_0x193edb+_0x7cb7('0xc')+'&'+_0x35d695+'&'+_0x17b2a2,'auth':_0x3d5f12,'json':!![]};return rp(_0x2c2efa)[_0x7cb7('0xd')](function(_0x57239b){if(_0x57239b[_0x7cb7('0xe')][_0x7cb7('0xf')]>0x0){_0x51961f[_0x7cb7('0x10')]=_0x57239b[_0x7cb7('0xe')][0x0][_0x7cb7('0x11')];}logger[_0x7cb7('0x12')]('['+[_0x14579b[_0x7cb7('0x13')]()]+_0x7cb7('0x14'),_0x51961f);_0x403559(_0x51961f);})[_0x7cb7('0x15')](function(_0x59c7ac){logger['error']('['+[_0x14579b[_0x7cb7('0x13')]()]+']',_0x59c7ac[_0x7cb7('0x16')]);_0x5246a0(_0x59c7ac[_0x7cb7('0x16')]);});});}function getUser(_0x465f50,_0x5bbb4c,_0x2f4544,_0x41fb57,_0x48fe39){return function(_0x3c0eb9){logger[_0x7cb7('0x12')]('['+[_0x465f50[_0x7cb7('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x3c0eb9);return new Promise(function(_0x3a222d,_0x522512){if(intUtil['validateEmail'](_0x3c0eb9[_0x7cb7('0x17')])){var _0x4d0a4c={'method':_0x7cb7('0xb'),'uri':_0x2f4544+_0x7cb7('0x18')+_0x3c0eb9[_0x7cb7('0x17')]+'&'+_0x41fb57+'&'+_0x48fe39,'auth':_0x5bbb4c,'json':!![]};logger[_0x7cb7('0x12')]('['+[_0x465f50[_0x7cb7('0x13')]()]+_0x7cb7('0x19'),_0x4d0a4c);return rp(_0x4d0a4c)['then'](function(_0x55af79){logger[_0x7cb7('0x12')]('['+[_0x465f50[_0x7cb7('0x13')]()]+_0x7cb7('0x1a'),_0x55af79);if(_0x55af79['result']['length']>0x0&&String(_0x55af79['result'][0x0][_0x7cb7('0x1b')])==='true'){_0x3c0eb9[_0x7cb7('0x1c')]=_0x55af79[_0x7cb7('0xe')][0x0][_0x7cb7('0x11')];}else{_0x3c0eb9[_0x7cb7('0x1c')]=_0x3c0eb9[_0x7cb7('0x10')];_0x3c0eb9[_0x7cb7('0x17')]=_0x3c0eb9[_0x7cb7('0x1d')];}logger[_0x7cb7('0x12')]('['+[_0x465f50['toUpperCase']()]+'],\x20getUser\x20crm',_0x3c0eb9);_0x3a222d(_0x3c0eb9);})[_0x7cb7('0x15')](function(_0x2a72b0){logger[_0x7cb7('0x1e')]('['+[_0x465f50[_0x7cb7('0x13')]()]+']',_0x2a72b0[_0x7cb7('0x16')]);_0x522512(_0x2a72b0['message']);});}else{logger['info']('['+[_0x465f50[_0x7cb7('0x13')]()]+_0x7cb7('0x1f'));_0x3c0eb9[_0x7cb7('0x1c')]=_0x3c0eb9[_0x7cb7('0x10')];_0x3c0eb9['userEmail']=_0x3c0eb9[_0x7cb7('0x1d')];_0x3a222d(_0x3c0eb9);}});};}function createEndUser(_0x27d898,_0x470c45,_0x5bc22c,_0x87d108,_0x2fd04e){logger['info']('['+[_0x27d898[_0x7cb7('0x13')]()]+_0x7cb7('0x20'),_0x5bc22c);return new Promise(function(_0x1fd886,_0x18d3e6){var _0x18caed={'method':_0x7cb7('0x21'),'uri':_0x87d108+_0x7cb7('0x22')+_0x2fd04e,'body':{'user_name':_0x5bc22c[_0x7cb7('0x23')],'roles':_0x7cb7('0x24'),'first_name':_0x5bc22c[_0x7cb7('0x23')],'active':_0x7cb7('0x25'),'date_format':_0x7cb7('0x26'),'phone':_0x5bc22c[_0x7cb7('0x23')]},'auth':_0x470c45,'json':!![]};return rp(_0x18caed)[_0x7cb7('0xd')](function(_0x5df259){logger[_0x7cb7('0x12')]('['+[_0x27d898['toUpperCase']()]+'],\x20EndUser\x20schema',_0x5df259[_0x7cb7('0xe')]);_0x5bc22c[_0x7cb7('0x27')]=_0x5df259[_0x7cb7('0xe')][_0x7cb7('0x11')];_0x1fd886(_0x5bc22c);})['catch'](function(_0x52111e){logger['error']('['+[_0x27d898['toUpperCase']()]+']',_0x52111e['message']);_0x18d3e6(_0x52111e[_0x7cb7('0x16')]);});});}function getEndUser(_0xeed042,_0x761365,_0x191a81,_0x28dfbc,_0x4db294){return function(_0x588544){logger[_0x7cb7('0x12')]('['+[_0xeed042[_0x7cb7('0x13')]()]+_0x7cb7('0x28'),_0x588544);return new Promise(function(_0x58c5a1,_0x423087){var _0x15a6aa={'method':_0x7cb7('0xb'),'uri':_0x191a81+_0x7cb7('0x29')+_0x588544[_0x7cb7('0x23')]+'&'+_0x28dfbc+'&'+_0x4db294,'auth':_0x761365,'json':!![]};return rp(_0x15a6aa)[_0x7cb7('0xd')](function(_0x36bf19){if(_0x36bf19[_0x7cb7('0xe')]['length']>0x0){_0x588544['endUserId']=_0x36bf19[_0x7cb7('0xe')][0x0]['sys_id'];logger[_0x7cb7('0x12')]('['+[_0xeed042[_0x7cb7('0x13')]()]+_0x7cb7('0x2a'),_0x588544);_0x58c5a1(_0x588544);}else{return createEndUser(_0xeed042,_0x761365,_0x588544,_0x191a81,_0x28dfbc)[_0x7cb7('0xd')](function(_0x395d18){logger[_0x7cb7('0x12')]('['+[_0xeed042[_0x7cb7('0x13')]()]+_0x7cb7('0x2b'),_0x395d18);_0x58c5a1(_0x395d18);});}})[_0x7cb7('0x15')](function(_0x34f1a7){logger[_0x7cb7('0x1e')]('['+[_0xeed042[_0x7cb7('0x13')]()]+']',_0x34f1a7[_0x7cb7('0x16')]);_0x423087(_0x34f1a7[_0x7cb7('0x16')]);});});};}function getCustomFields(_0x3bfe51,_0x2d8ee3){var _0x4b97da={};if(_0x3bfe51[_0x7cb7('0xf')]>0x0){_['forEach'](_0x3bfe51,function(_0x1fbb36){if(_['includes']([_0x7cb7('0x2c'),_0x7cb7('0x2d')],_0x1fbb36[_0x7cb7('0x2e')])&&_0x1fbb36[_0x7cb7('0x2f')]&&!_0x1fbb36[_0x7cb7('0x30')]){_0x4b97da[_0x1fbb36['nameField']['toLowerCase']()]=_0x1fbb36['content'][_0x7cb7('0x31')]();}else if(_[_0x7cb7('0x32')]([_0x7cb7('0x2c'),'picklist'],_0x1fbb36[_0x7cb7('0x2e')])&&_0x1fbb36[_0x7cb7('0x33')]&&_0x1fbb36[_0x7cb7('0x30')]){_0x4b97da[_0x1fbb36[_0x7cb7('0x33')][_0x7cb7('0x34')]()]=_0x1fbb36[_0x7cb7('0x35')][_0x7cb7('0x31')]();}else if(_0x1fbb36['type']==='variable'&&_0x1fbb36['variableName']&&_0x1fbb36[_0x7cb7('0x33')]&&_0x1fbb36[_0x7cb7('0x30')]){_0x4b97da[_0x1fbb36[_0x7cb7('0x33')]['toLowerCase']()]=_0x2d8ee3[_0x1fbb36[_0x7cb7('0x36')]][_0x7cb7('0x31')]();}else if(_0x1fbb36[_0x7cb7('0x2e')]===_0x7cb7('0x37')&&_0x1fbb36[_0x7cb7('0x38')]&&_0x1fbb36[_0x7cb7('0x38')][_0x7cb7('0x39')]&&_0x1fbb36[_0x7cb7('0x33')]&&_0x1fbb36[_0x7cb7('0x30')]){_0x4b97da[_0x1fbb36['idField'][_0x7cb7('0x34')]()]=_0x2d8ee3[_0x1fbb36[_0x7cb7('0x38')][_0x7cb7('0x39')]['toLowerCase']()][_0x7cb7('0x31')]();}});}return _0x4b97da;}function getTicket(_0x49f799,_0x217620,_0x5adad6,_0x52f6de,_0x3406b3,_0x307678){return function(_0x36182a){logger[_0x7cb7('0x12')]('['+[_0x49f799[_0x7cb7('0x13')]()]+_0x7cb7('0x3a'),_0x36182a);return new Promise(function(_0x21d81b,_0x278fec){var _0x4c99c4=_0x49f799[_0x7cb7('0x34')]()===_0x7cb7('0x3b')?_0x36182a[_0x7cb7('0x1c')]:_0x36182a[_0x7cb7('0x27')];var _0x35a038={'method':'POST','uri':_0x5adad6+'incident'+'?'+_0x307678,'body':Object[_0x7cb7('0x3c')]({},{'active':_0x7cb7('0x25'),'caller_id':_0x4c99c4,'assigned_to':_0x36182a['userId'],'short_description':intUtil[_0x7cb7('0x3d')](_0x52f6de['Subjects'],_0x3406b3,'\x20'),'description':intUtil[_0x7cb7('0x3d')](_0x52f6de[_0x7cb7('0x3e')],_0x3406b3,'\x0a')},getCustomFields(_0x52f6de['Fields'],_0x3406b3)),'auth':_0x217620,'json':!![]};return rp(_0x35a038)[_0x7cb7('0xd')](function(_0x97a606){logger[_0x7cb7('0x12')]('['+[_0x49f799['toUpperCase']()]+_0x7cb7('0x3f'),_0x97a606['result']);_0x36182a['ticketId']=_0x97a606['result']['sys_id'];_0x36182a['ticketNumber']=_0x97a606[_0x7cb7('0xe')][_0x7cb7('0x40')];logger['info']('['+[_0x49f799[_0x7cb7('0x13')]()]+_0x7cb7('0x41'),_0x36182a);_0x21d81b(_0x36182a);})[_0x7cb7('0x15')](function(_0x5aaa02){logger[_0x7cb7('0x1e')]('['+[_0x49f799[_0x7cb7('0x13')]()]+']',_0x5aaa02[_0x7cb7('0x16')]);_0x278fec(_0x5aaa02[_0x7cb7('0x16')]);});});};}function createRemoteTag(_0x465467,_0x1a9d7f,_0x334e7b,_0x1799e0){return new Promise(function(_0x510e46,_0x3fd3c9){var _0x174d6f={'method':_0x7cb7('0x21'),'uri':_0x334e7b+_0x7cb7('0x42')+'?'+_0x1799e0,'body':{'short_description':_0x465467,'global':!![],'active':!![],'name':_0x465467},'auth':_0x1a9d7f,'json':!![]};return rp(_0x174d6f)[_0x7cb7('0xd')](function(_0x92bd9d){var _0x30d46d=_0x92bd9d[_0x7cb7('0xe')][_0x7cb7('0x11')];_0x510e46(_0x30d46d);});});}function getRemoteTag(_0x162ad6,_0x5195a4,_0xccc495,_0x42cf01,_0x18f4f4){return new Promise(function(_0x14f2dd,_0x3da755){var _0x3f6ba0={'method':_0x7cb7('0xb'),'uri':_0xccc495+_0x7cb7('0x42')+_0x7cb7('0x43')+_0x162ad6+'&'+_0x42cf01,'auth':_0x5195a4,'json':!![]};return rp(_0x3f6ba0)[_0x7cb7('0xd')](function(_0x404adc){if(_0x404adc[_0x7cb7('0xe')]['length']>0x0){var _0x26b691=_0x404adc[_0x7cb7('0xe')][0x0][_0x7cb7('0x11')];_0x14f2dd(_0x26b691);}else{return createRemoteTag(_0x162ad6,_0x5195a4,_0xccc495,_0x42cf01)[_0x7cb7('0xd')](function(_0x446de0){_0x14f2dd(_0x446de0);});}});});}function assignTagToIncident(_0xbdd1c1,_0x2750a7,_0x4bd2bb,_0x2ee2ec,_0x480448){return new Promise(function(_0x5a38e6,_0x5ba31c){var _0x431bd6={'method':_0x7cb7('0x21'),'uri':_0x4bd2bb+_0x7cb7('0x44')+'?'+_0x480448,'body':{'label':_0xbdd1c1,'table':_0x7cb7('0x45'),'id_type':_0x7cb7('0x46'),'table_key':_0x2ee2ec[_0x7cb7('0x47')],'title':'Incident\x20-\x20'+_0x2ee2ec[_0x7cb7('0x48')],'id_display':_0x2ee2ec[_0x7cb7('0x48')]},'auth':_0x2750a7,'json':!![]};return rp(_0x431bd6)[_0x7cb7('0xd')](function(_0x491629){_0x5a38e6();})[_0x7cb7('0x15')](function(){_0x5a38e6();});});}function manageTags(_0x4e4a22,_0x5731b6,_0x217e5a,_0x3baafe,_0x3decf8,_0x32dc84,_0x4a9eac){return new Promise(function(_0x334eeb,_0x26cffd){var _0x2f827e=[];_0x5731b6['forEach'](function(_0x465424){_0x2f827e[_0x7cb7('0x49')](getRemoteTag(_0x465424,_0x217e5a,_0x3baafe,_0x32dc84,_0x4a9eac));});return Promise['all'](_0x2f827e)['then'](function(_0x27edc4){if(_0x27edc4[_0x7cb7('0xf')]){logger[_0x7cb7('0x12')]('['+[_0x4e4a22['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x27edc4);var _0x622418=[];_0x27edc4[_0x7cb7('0x4a')](function(_0x463c78){_0x622418[_0x7cb7('0x49')](assignTagToIncident(_0x463c78,_0x217e5a,_0x3baafe,_0x3decf8,_0x32dc84));});return Promise[_0x7cb7('0x4b')](_0x622418)[_0x7cb7('0xd')](function(){_0x334eeb();})[_0x7cb7('0x15')](function(){_0x334eeb();});}else{_0x334eeb();}});});}function getTags(_0x21176d,_0x24c2d9,_0x131f1d,_0x59ffda,_0x1c5106,_0x412bbb){return function(_0x4c4018){return new Promise(function(_0x23ede9,_0x1f487e){var _0x5468e3=[];var _0x1976ea=_0x59ffda[_0x7cb7('0x4c')];if(_0x1976ea&&_0x1976ea[_0x7cb7('0xf')]>0x0){_0x5468e3=_[_0x7cb7('0x4d')](_0x1976ea,_0x7cb7('0x39'));}if(_0x5468e3[_0x7cb7('0xf')]>0x0){return manageTags(_0x21176d,_0x5468e3,_0x24c2d9,_0x131f1d,_0x4c4018,_0x1c5106,_0x412bbb)[_0x7cb7('0xd')](function(){_0x23ede9(_0x4c4018);});}else{_0x23ede9(_0x4c4018);}});};}function emit(_0x31bc07,_0x4fc086,_0x258cb2){var _0x382867=_0x7cb7('0x4e')+_0x7cb7('0x4f')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x31abb9={'uri':_0x31bc07+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x258cb2+_0x382867};io['to'](util[_0x7cb7('0x50')](_0x7cb7('0x51'),_0x4fc086))[_0x7cb7('0x52')]('trigger:browser:url',_0x31abb9);}exports['cs']=function(_0x170a9b,_0x5f2e91,_0xe1a213,_0x12d7ad,_0x58f707,_0x277c15,_0x255fbf,_0x4ab8ab){var _0x2a88d1={};var _0x2ca674={'user':_0x277c15[_0x7cb7('0x53')],'pass':_0x277c15['password']};var _0x13889c=_0x7cb7('0x54');var _0xb89300=_0x7cb7('0x55');_0x277c15[_0x7cb7('0x56')]=intUtil['stripTrailingSlash'](_0x277c15[_0x7cb7('0x56')]);_0x277c15['serverUrl']=intUtil[_0x7cb7('0x57')](_0x277c15[_0x7cb7('0x58')]);var _0x191c2d=util['format'](_0x7cb7('0x59'),_0x277c15[_0x7cb7('0x56')]);_0x2a88d1[_0x7cb7('0x17')]=!_[_0x7cb7('0x5a')](_0x12d7ad)?_0x12d7ad[_0x7cb7('0x5b')]:null;_0x2a88d1[_0x7cb7('0x1d')]=_0x277c15[_0x7cb7('0x5b')];_0x2a88d1[_0x7cb7('0x23')]=_0x4ab8ab['toLowerCase']()===_0x7cb7('0x3b')?_0x5f2e91[_0x7cb7('0x5c')]:_0x5f2e91[_0x7cb7('0x5d')];_0x2a88d1[_0x7cb7('0x5e')]=_0x4ab8ab==='queue'||_0x4ab8ab===_0x7cb7('0x5f')?_0x7cb7('0x60'):'outbound';var _0x5a5f78=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x277c15[_0x7cb7('0x58')],_0x5f2e91[_0x7cb7('0x61')],md5(_0x5f2e91[_0x7cb7('0x61')]));if(_0x58f707&&_0x58f707[_0x7cb7('0x62')]){logger['info'](_0x7cb7('0x63'),_0x7cb7('0x64'));_0x5f2e91[_0x7cb7('0x65')]=_0x5a5f78;}else if(_0x255fbf&&_0x255fbf[_0x7cb7('0x66')]&&_0x255fbf[_0x7cb7('0x66')]!==_0x7cb7('0x67')){logger[_0x7cb7('0x12')](_0x7cb7('0x68'),'Recording\x20is\x20enabled!');_0x5f2e91[_0x7cb7('0x65')]=_0x5a5f78;}else{_0x5f2e91[_0x7cb7('0x65')]='';}return getAdminUser(_0x4ab8ab,_0x2ca674,_0x2a88d1,_0x191c2d,_0xb89300,_0x13889c)[_0x7cb7('0xd')](getUser(_0x4ab8ab,_0x2ca674,_0x191c2d,_0xb89300,_0x13889c))['then'](getEndUser(_0x4ab8ab,_0x2ca674,_0x191c2d,_0xb89300,_0x13889c))[_0x7cb7('0xd')](getTicket(_0x4ab8ab,_0x2ca674,_0x191c2d,_0xe1a213,_0x5f2e91,_0xb89300))[_0x7cb7('0xd')](function(_0x388ed2){logger['info'](util[_0x7cb7('0x50')](_0x7cb7('0x69'),_0x388ed2[_0x7cb7('0x47')]));logger[_0x7cb7('0x12')](util[_0x7cb7('0x50')](_0x7cb7('0x6a'),_0x4ab8ab));if(_0x4ab8ab!==_0x7cb7('0x5f')){logger[_0x7cb7('0x12')]('['+[_0x4ab8ab[_0x7cb7('0x13')]()]+']',_0x7cb7('0x6b'));emit(_0x277c15['remoteUri'],_0x12d7ad[_0x7cb7('0x39')],_0x388ed2[_0x7cb7('0x47')]);}})['catch'](function(_0xcd56d3){logger[_0x7cb7('0x1e')]('['+[_0x4ab8ab[_0x7cb7('0x13')]()]+_0x7cb7('0x6c'),util[_0x7cb7('0x6d')](_0xcd56d3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdee1=['error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','true','userId','sys_id','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','content','toString','includes','idField','customField','variable','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketId','Incident\x20-\x20','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','recordingURL','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm'];(function(_0x3bdcdb,_0x152dcf){var _0x1c2063=function(_0x43c228){while(--_0x43c228){_0x3bdcdb['push'](_0x3bdcdb['shift']());}};_0x1c2063(++_0x152dcf);}(_0xdee1,0x18c));var _0x1dee=function(_0x1591f7,_0x5aedd6){_0x1591f7=_0x1591f7-0x0;var _0x4e1517=_0xdee1[_0x1591f7];return _0x4e1517;};'use strict';var _=require(_0x1dee('0x0'));var Promise=require(_0x1dee('0x1'));var rp=require(_0x1dee('0x2'));var util=require(_0x1dee('0x3'));var md5=require('md5');var Redis=require(_0x1dee('0x4'));var intUtil=require(_0x1dee('0x5'));var config=require(_0x1dee('0x6'));var logger=require(_0x1dee('0x7'))(_0x1dee('0x8'));config[_0x1dee('0x9')]=_['defaults'](config[_0x1dee('0x9')],{'host':_0x1dee('0xa'),'port':0x18eb});var io=require(_0x1dee('0xb'))(new Redis(config[_0x1dee('0x9')]));function getAdminUser(_0x5400d4,_0x652329,_0x32e340,_0x58f803,_0x3419f0,_0x448018){return new Promise(function(_0x4b00c1,_0x47610c){var _0x51ab8d={'method':_0x1dee('0xc'),'uri':_0x58f803+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x3419f0+'&'+_0x448018,'auth':_0x652329,'json':!![]};return rp(_0x51ab8d)[_0x1dee('0xd')](function(_0x3b147b){if(_0x3b147b[_0x1dee('0xe')][_0x1dee('0xf')]>0x0){_0x32e340[_0x1dee('0x10')]=_0x3b147b[_0x1dee('0xe')][0x0]['sys_id'];}logger[_0x1dee('0x11')]('['+[_0x5400d4[_0x1dee('0x12')]()]+_0x1dee('0x13'),_0x32e340);_0x4b00c1(_0x32e340);})['catch'](function(_0x36e311){logger[_0x1dee('0x14')]('['+[_0x5400d4['toUpperCase']()]+']',_0x36e311['message']);_0x47610c(_0x36e311[_0x1dee('0x15')]);});});}function getUser(_0x30cb90,_0x30917a,_0xc253e8,_0x4f7a65,_0x59c3d7){return function(_0x4f40b9){logger['info']('['+[_0x30cb90[_0x1dee('0x12')]()]+_0x1dee('0x16'),_0x4f40b9);return new Promise(function(_0x1b174a,_0x4bf982){if(intUtil[_0x1dee('0x17')](_0x4f40b9['userEmail'])){var _0x4faa9e={'method':_0x1dee('0xc'),'uri':_0xc253e8+_0x1dee('0x18')+_0x4f40b9[_0x1dee('0x19')]+'&'+_0x4f7a65+'&'+_0x59c3d7,'auth':_0x30917a,'json':!![]};logger['info']('['+[_0x30cb90['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x4faa9e);return rp(_0x4faa9e)[_0x1dee('0xd')](function(_0x3b9e45){logger[_0x1dee('0x11')]('['+[_0x30cb90[_0x1dee('0x12')]()]+_0x1dee('0x1a'),_0x3b9e45);if(_0x3b9e45['result'][_0x1dee('0xf')]>0x0&&String(_0x3b9e45['result'][0x0]['active'])===_0x1dee('0x1b')){_0x4f40b9[_0x1dee('0x1c')]=_0x3b9e45['result'][0x0][_0x1dee('0x1d')];}else{_0x4f40b9['userId']=_0x4f40b9[_0x1dee('0x10')];_0x4f40b9['userEmail']=_0x4f40b9[_0x1dee('0x1e')];}logger[_0x1dee('0x11')]('['+[_0x30cb90[_0x1dee('0x12')]()]+_0x1dee('0x1f'),_0x4f40b9);_0x1b174a(_0x4f40b9);})[_0x1dee('0x20')](function(_0x2452fa){logger[_0x1dee('0x14')]('['+[_0x30cb90[_0x1dee('0x12')]()]+']',_0x2452fa[_0x1dee('0x15')]);_0x4bf982(_0x2452fa[_0x1dee('0x15')]);});}else{logger[_0x1dee('0x11')]('['+[_0x30cb90[_0x1dee('0x12')]()]+']\x20using\x20admin\x20profile');_0x4f40b9['userId']=_0x4f40b9['adminId'];_0x4f40b9[_0x1dee('0x19')]=_0x4f40b9[_0x1dee('0x1e')];_0x1b174a(_0x4f40b9);}});};}function createEndUser(_0x5bc75f,_0x53fefc,_0x33f31f,_0x515a91,_0x6acb20){logger[_0x1dee('0x11')]('['+[_0x5bc75f[_0x1dee('0x12')]()]+_0x1dee('0x21'),_0x33f31f);return new Promise(function(_0x1f9efc,_0x452b89){var _0x46d4bf={'method':_0x1dee('0x22'),'uri':_0x515a91+'sys_user?'+_0x6acb20,'body':{'user_name':_0x33f31f[_0x1dee('0x23')],'roles':_0x1dee('0x24'),'first_name':_0x33f31f[_0x1dee('0x23')],'active':_0x1dee('0x1b'),'date_format':_0x1dee('0x25'),'phone':_0x33f31f[_0x1dee('0x23')]},'auth':_0x53fefc,'json':!![]};return rp(_0x46d4bf)[_0x1dee('0xd')](function(_0x2ea817){logger[_0x1dee('0x11')]('['+[_0x5bc75f['toUpperCase']()]+'],\x20EndUser\x20schema',_0x2ea817['result']);_0x33f31f[_0x1dee('0x26')]=_0x2ea817[_0x1dee('0xe')][_0x1dee('0x1d')];_0x1f9efc(_0x33f31f);})[_0x1dee('0x20')](function(_0x1356a4){logger[_0x1dee('0x14')]('['+[_0x5bc75f[_0x1dee('0x12')]()]+']',_0x1356a4[_0x1dee('0x15')]);_0x452b89(_0x1356a4[_0x1dee('0x15')]);});});}function getEndUser(_0x8341b8,_0x13e6fc,_0x524beb,_0x40cddd,_0x23e38a){return function(_0x4016b9){logger[_0x1dee('0x11')]('['+[_0x8341b8[_0x1dee('0x12')]()]+_0x1dee('0x27'),_0x4016b9);return new Promise(function(_0x29d12b,_0x100be6){var _0x1b84a2={'method':_0x1dee('0xc'),'uri':_0x524beb+'sys_user?sysparm_query=phone%3D'+_0x4016b9[_0x1dee('0x23')]+'&'+_0x40cddd+'&'+_0x23e38a,'auth':_0x13e6fc,'json':!![]};return rp(_0x1b84a2)[_0x1dee('0xd')](function(_0x4fdf34){if(_0x4fdf34[_0x1dee('0xe')][_0x1dee('0xf')]>0x0){_0x4016b9[_0x1dee('0x26')]=_0x4fdf34[_0x1dee('0xe')][0x0][_0x1dee('0x1d')];logger[_0x1dee('0x11')]('['+[_0x8341b8['toUpperCase']()]+_0x1dee('0x28'),_0x4016b9);_0x29d12b(_0x4016b9);}else{return createEndUser(_0x8341b8,_0x13e6fc,_0x4016b9,_0x524beb,_0x40cddd)[_0x1dee('0xd')](function(_0x43d732){logger[_0x1dee('0x11')]('['+[_0x8341b8[_0x1dee('0x12')]()]+_0x1dee('0x29'),_0x43d732);_0x29d12b(_0x43d732);});}})[_0x1dee('0x20')](function(_0x16a4e9){logger[_0x1dee('0x14')]('['+[_0x8341b8[_0x1dee('0x12')]()]+']',_0x16a4e9['message']);_0x100be6(_0x16a4e9['message']);});});};}function getCustomFields(_0x106b68,_0x37cd7c){var _0x1212bb={};if(_0x106b68['length']>0x0){_[_0x1dee('0x2a')](_0x106b68,function(_0x1e34b6){if(_['includes']([_0x1dee('0x2b'),_0x1dee('0x2c')],_0x1e34b6[_0x1dee('0x2d')])&&_0x1e34b6[_0x1dee('0x2e')]&&!_0x1e34b6['customField']){_0x1212bb[_0x1e34b6[_0x1dee('0x2e')][_0x1dee('0x2f')]()]=_0x1e34b6[_0x1dee('0x30')][_0x1dee('0x31')]();}else if(_[_0x1dee('0x32')]([_0x1dee('0x2b'),_0x1dee('0x2c')],_0x1e34b6[_0x1dee('0x2d')])&&_0x1e34b6[_0x1dee('0x33')]&&_0x1e34b6[_0x1dee('0x34')]){_0x1212bb[_0x1e34b6['idField'][_0x1dee('0x2f')]()]=_0x1e34b6[_0x1dee('0x30')][_0x1dee('0x31')]();}else if(_0x1e34b6[_0x1dee('0x2d')]===_0x1dee('0x35')&&_0x1e34b6['variableName']&&_0x1e34b6[_0x1dee('0x33')]&&_0x1e34b6['customField']){_0x1212bb[_0x1e34b6['idField'][_0x1dee('0x2f')]()]=_0x37cd7c[_0x1e34b6[_0x1dee('0x36')]][_0x1dee('0x31')]();}else if(_0x1e34b6[_0x1dee('0x2d')]===_0x1dee('0x37')&&_0x1e34b6['Variable']&&_0x1e34b6[_0x1dee('0x38')][_0x1dee('0x39')]&&_0x1e34b6[_0x1dee('0x33')]&&_0x1e34b6[_0x1dee('0x34')]){_0x1212bb[_0x1e34b6[_0x1dee('0x33')]['toLowerCase']()]=_0x37cd7c[_0x1e34b6['Variable']['name']['toLowerCase']()][_0x1dee('0x31')]();}});}return _0x1212bb;}function getTicket(_0x2d836f,_0x61bece,_0x4153ba,_0x39fb13,_0x3b0c26,_0x418abf){return function(_0xc48cf4){logger[_0x1dee('0x11')]('['+[_0x2d836f[_0x1dee('0x12')]()]+']\x20getTicket\x20input\x20crm',_0xc48cf4);return new Promise(function(_0x3c174a,_0x56dd76){var _0x1a8ed0=_0x2d836f['toLowerCase']()===_0x1dee('0x3a')?_0xc48cf4[_0x1dee('0x1c')]:_0xc48cf4[_0x1dee('0x26')];var _0x476882={'method':_0x1dee('0x22'),'uri':_0x4153ba+_0x1dee('0x3b')+'?'+_0x418abf,'body':Object[_0x1dee('0x3c')]({},{'active':_0x1dee('0x1b'),'caller_id':_0x1a8ed0,'assigned_to':_0xc48cf4[_0x1dee('0x1c')],'short_description':intUtil[_0x1dee('0x3d')](_0x39fb13[_0x1dee('0x3e')],_0x3b0c26,'\x20'),'description':intUtil[_0x1dee('0x3d')](_0x39fb13[_0x1dee('0x3f')],_0x3b0c26,'\x0a')},getCustomFields(_0x39fb13['Fields'],_0x3b0c26)),'auth':_0x61bece,'json':!![]};return rp(_0x476882)[_0x1dee('0xd')](function(_0x5e971c){logger[_0x1dee('0x11')]('['+[_0x2d836f['toUpperCase']()]+_0x1dee('0x40'),_0x5e971c[_0x1dee('0xe')]);_0xc48cf4['ticketId']=_0x5e971c[_0x1dee('0xe')][_0x1dee('0x1d')];_0xc48cf4['ticketNumber']=_0x5e971c[_0x1dee('0xe')][_0x1dee('0x41')];logger[_0x1dee('0x11')]('['+[_0x2d836f[_0x1dee('0x12')]()]+_0x1dee('0x42'),_0xc48cf4);_0x3c174a(_0xc48cf4);})[_0x1dee('0x20')](function(_0x44e700){logger['error']('['+[_0x2d836f['toUpperCase']()]+']',_0x44e700[_0x1dee('0x15')]);_0x56dd76(_0x44e700[_0x1dee('0x15')]);});});};}function createRemoteTag(_0x6dbb53,_0x283f42,_0x145726,_0x1de21f){return new Promise(function(_0x238b6e,_0x12b83d){var _0x3548ad={'method':_0x1dee('0x22'),'uri':_0x145726+_0x1dee('0x43')+'?'+_0x1de21f,'body':{'short_description':_0x6dbb53,'global':!![],'active':!![],'name':_0x6dbb53},'auth':_0x283f42,'json':!![]};return rp(_0x3548ad)[_0x1dee('0xd')](function(_0x36f802){var _0xbb245d=_0x36f802['result']['sys_id'];_0x238b6e(_0xbb245d);});});}function getRemoteTag(_0x26727b,_0x905234,_0x48117d,_0x1a1f9a,_0x329aab){return new Promise(function(_0x37df07,_0xbfe208){var _0xccd0a3={'method':'GET','uri':_0x48117d+'label'+'?sysparm_query=name%3D'+_0x26727b+'&'+_0x1a1f9a,'auth':_0x905234,'json':!![]};return rp(_0xccd0a3)[_0x1dee('0xd')](function(_0x3ca764){if(_0x3ca764[_0x1dee('0xe')]['length']>0x0){var _0x539b96=_0x3ca764[_0x1dee('0xe')][0x0][_0x1dee('0x1d')];_0x37df07(_0x539b96);}else{return createRemoteTag(_0x26727b,_0x905234,_0x48117d,_0x1a1f9a)[_0x1dee('0xd')](function(_0x2fbc81){_0x37df07(_0x2fbc81);});}});});}function assignTagToIncident(_0x2b0811,_0x4de3e2,_0x159775,_0x4e034d,_0x1d9676){return new Promise(function(_0x5e007f,_0x209774){var _0x4658e6={'method':_0x1dee('0x22'),'uri':_0x159775+_0x1dee('0x44')+'?'+_0x1d9676,'body':{'label':_0x2b0811,'table':'incident','id_type':_0x1dee('0x45'),'table_key':_0x4e034d[_0x1dee('0x46')],'title':_0x1dee('0x47')+_0x4e034d['ticketNumber'],'id_display':_0x4e034d['ticketNumber']},'auth':_0x4de3e2,'json':!![]};return rp(_0x4658e6)[_0x1dee('0xd')](function(_0x345538){_0x5e007f();})[_0x1dee('0x20')](function(){_0x5e007f();});});}function manageTags(_0x44b1c6,_0x12653a,_0x162a07,_0x7ef4b8,_0x1844b4,_0x3327c7,_0x286783){return new Promise(function(_0x3424a8,_0x5356d2){var _0x5b216c=[];_0x12653a[_0x1dee('0x2a')](function(_0x58f93c){_0x5b216c['push'](getRemoteTag(_0x58f93c,_0x162a07,_0x7ef4b8,_0x3327c7,_0x286783));});return Promise[_0x1dee('0x48')](_0x5b216c)['then'](function(_0x5154dc){if(_0x5154dc[_0x1dee('0xf')]){logger[_0x1dee('0x11')]('['+[_0x44b1c6[_0x1dee('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5154dc);var _0x34f5ca=[];_0x5154dc[_0x1dee('0x2a')](function(_0x238e19){_0x34f5ca['push'](assignTagToIncident(_0x238e19,_0x162a07,_0x7ef4b8,_0x1844b4,_0x3327c7));});return Promise['all'](_0x34f5ca)[_0x1dee('0xd')](function(){_0x3424a8();})[_0x1dee('0x20')](function(){_0x3424a8();});}else{_0x3424a8();}});});}function getTags(_0x2ac517,_0x37a5d4,_0x1b888d,_0x41f9f6,_0x170e16,_0x467e7c){return function(_0x568248){return new Promise(function(_0x5253c5,_0x4a6d28){var _0x4370a4=[];var _0x2ff0fd=_0x41f9f6[_0x1dee('0x49')];if(_0x2ff0fd&&_0x2ff0fd[_0x1dee('0xf')]>0x0){_0x4370a4=_['map'](_0x2ff0fd,_0x1dee('0x39'));}if(_0x4370a4[_0x1dee('0xf')]>0x0){return manageTags(_0x2ac517,_0x4370a4,_0x37a5d4,_0x1b888d,_0x568248,_0x170e16,_0x467e7c)[_0x1dee('0xd')](function(){_0x5253c5(_0x568248);});}else{_0x5253c5(_0x568248);}});};}function emit(_0x2d99a8,_0x1ac164,_0x32d7f2){var _0x509e70=_0x1dee('0x4a')+_0x1dee('0x4b')+_0x1dee('0x4c')+_0x1dee('0x4d');var _0x3fd235={'uri':_0x2d99a8+_0x1dee('0x4e')+_0x32d7f2+_0x509e70};io['to'](util[_0x1dee('0x4f')](_0x1dee('0x50'),_0x1ac164))[_0x1dee('0x51')](_0x1dee('0x52'),_0x3fd235);}exports['cs']=function(_0x2f4ebc,_0x90b762,_0x51ad4b,_0x3e99e6,_0x1ac5c9,_0x240e83,_0x5f36a7,_0x28f3e2){var _0x175ae5={};var _0x3a6bff={'user':_0x240e83[_0x1dee('0x53')],'pass':_0x240e83[_0x1dee('0x54')]};var _0xbb0872=_0x1dee('0x55');var _0x21c47c='sysparm_display_value=true';_0x240e83[_0x1dee('0x56')]=intUtil[_0x1dee('0x57')](_0x240e83[_0x1dee('0x56')]);_0x240e83['serverUrl']=intUtil[_0x1dee('0x57')](_0x240e83[_0x1dee('0x58')]);var _0x4b7c29=util[_0x1dee('0x4f')](_0x1dee('0x59'),_0x240e83[_0x1dee('0x56')]);_0x175ae5[_0x1dee('0x19')]=!_[_0x1dee('0x5a')](_0x3e99e6)?_0x3e99e6[_0x1dee('0x5b')]:null;_0x175ae5[_0x1dee('0x1e')]=_0x240e83['email'];_0x175ae5['endUserNumber']=_0x28f3e2[_0x1dee('0x2f')]()===_0x1dee('0x3a')?_0x90b762[_0x1dee('0x5c')]:_0x90b762['calleridnum'];_0x175ae5['callDirection']=_0x28f3e2===_0x1dee('0x5d')||_0x28f3e2===_0x1dee('0x5e')?_0x1dee('0x5d'):'outbound';var _0x51c9ad=util[_0x1dee('0x4f')](_0x1dee('0x5f'),_0x240e83[_0x1dee('0x58')],_0x90b762[_0x1dee('0x60')],md5(_0x90b762[_0x1dee('0x60')]));if(_0x1ac5c9&&_0x1ac5c9['monitor_format']){logger['info'](_0x1dee('0x61'),_0x1dee('0x62'));_0x90b762['recordingURL']=_0x51c9ad;}else if(_0x5f36a7&&_0x5f36a7[_0x1dee('0x63')]&&_0x5f36a7[_0x1dee('0x63')]!=='none'){logger[_0x1dee('0x11')]('[OUTBOUND]',_0x1dee('0x62'));_0x90b762[_0x1dee('0x64')]=_0x51c9ad;}else{_0x90b762[_0x1dee('0x64')]='';}return getAdminUser(_0x28f3e2,_0x3a6bff,_0x175ae5,_0x4b7c29,_0x21c47c,_0xbb0872)[_0x1dee('0xd')](getUser(_0x28f3e2,_0x3a6bff,_0x4b7c29,_0x21c47c,_0xbb0872))[_0x1dee('0xd')](getEndUser(_0x28f3e2,_0x3a6bff,_0x4b7c29,_0x21c47c,_0xbb0872))[_0x1dee('0xd')](getTicket(_0x28f3e2,_0x3a6bff,_0x4b7c29,_0x51ad4b,_0x90b762,_0x21c47c))[_0x1dee('0xd')](function(_0x5204d4){logger[_0x1dee('0x11')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x5204d4[_0x1dee('0x46')]));logger[_0x1dee('0x11')](util[_0x1dee('0x4f')](_0x1dee('0x65'),_0x28f3e2));if(_0x28f3e2!==_0x1dee('0x5e')){logger[_0x1dee('0x11')]('['+[_0x28f3e2[_0x1dee('0x12')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x240e83[_0x1dee('0x56')],_0x3e99e6[_0x1dee('0x39')],_0x5204d4[_0x1dee('0x46')]);}})[_0x1dee('0x20')](function(_0x5d1775){logger[_0x1dee('0x14')]('['+[_0x28f3e2[_0x1dee('0x12')]()]+_0x1dee('0x66'),util[_0x1dee('0x67')](_0x5d1775,{'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 768a66a..1b79683 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 _0xe842=['remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','recordingURL','uniqueid','destcalleridnum','Outbound','[OUTBOUND]','error','unmanaged','monitor_format','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','Inbound','users','contacts','lodash','request-promise','bluebird','../../../../config/environment','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_minutes','parent_type','parent_name','length','forEach','idField','variableName','JSON','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','then','Enduser\x20found!','Contacts','Caller\x20-\x20%s','Enduser\x20created.','first_name','[HTTP]','map','type','string','nameField','customField','toLowerCase','content','custom_fields','push','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue'];(function(_0x171813,_0x3d890a){var _0x51f380=function(_0x3ff6ce){while(--_0x3ff6ce){_0x171813['push'](_0x171813['shift']());}};_0x51f380(++_0x3d890a);}(_0xe842,0x18b));var _0x2e84=function(_0x14b62e,_0x3b8096){_0x14b62e=_0x14b62e-0x0;var _0x42ad69=_0xe842[_0x14b62e];return _0x42ad69;};'use strict';var _=require(_0x2e84('0x0'));var rp=require(_0x2e84('0x1'));var BPromise=require(_0x2e84('0x2'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x2e84('0x3'));var logger=require('../../../../config/logger')(_0x2e84('0x4'));config[_0x2e84('0x5')]=_['defaults'](config[_0x2e84('0x5')],{'host':_0x2e84('0x6'),'port':0x18eb});var io=require(_0x2e84('0x7'))(new Redis(config[_0x2e84('0x5')]));var def={'method':_0x2e84('0x8'),'json':!![]};function emit(_0x1ea9e4,_0x44b8e7,_0x565af6){io['to'](_0x1ea9e4)[_0x2e84('0x9')](_0x44b8e7,_0x565af6);}function getTicket(_0x299b16,_0xa05216,_0x28df05,_0x5a7331,_0x2bddab,_0x37d173,_0x24564c,_0x98e0aa){logger[_0x2e84('0xa')](_0x2e84('0xb'));var _0x4cea18=new Date();var _0x13f6db=[{'name':_0x2e84('0xc'),'value':intUtil[_0x2e84('0xd')](_0x5a7331[_0x2e84('0xe')],_0x2bddab,'\x20')},{'name':_0x2e84('0xf'),'value':_0xa05216['id']},{'name':_0x2e84('0x10'),'value':_0xa05216['id']},{'name':_0x2e84('0x11'),'value':intUtil[_0x2e84('0xd')](_0x5a7331[_0x2e84('0x12')],_0x2bddab,'\x0a')},{'name':_0x2e84('0x13'),'value':_0x4cea18[_0x2e84('0x14')]()['slice'](0x0,0x13)[_0x2e84('0x15')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x2e84('0x16'),'value':'15'},{'name':'parent_id','value':_0x28df05['id']},{'name':_0x2e84('0x17'),'value':'Contacts'},{'name':_0x2e84('0x18'),'value':_0x28df05[_0x2e84('0xc')]},{'name':'direction','value':_0x98e0aa}];if(_0x37d173[_0x2e84('0x19')]){_[_0x2e84('0x1a')](_0x37d173,function(_0x297e77){if(_0x2bddab[_0x297e77['variableName']]){_0x13f6db['push']({'name':_0x297e77[_0x2e84('0x1b')],'value':_0x2bddab[_0x297e77[_0x2e84('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x2e84('0x1d'),'response_type':_0x2e84('0x1d'),'rest_data':JSON['stringify']({'session':_0x24564c['id'],'module_name':'Calls','name_value_list':_0x13f6db})}});}function getAuth(_0x51e36d){return util[_0x2e84('0x1e')](_0x2e84('0x1f'),new Buffer(_0x51e36d[_0x2e84('0x20')]+':X')[_0x2e84('0x21')](_0x2e84('0x22')));}function getServerInfo(_0x36781a){return request({'form':{'method':_0x2e84('0x23'),'input_type':_0x2e84('0x1d'),'response_type':_0x2e84('0x1d'),'rest_data':JSON[_0x2e84('0x24')]({'session':_0x36781a['id']})}});}function getUser(_0x30410f,_0x18d731,_0x284fc9){if(!_[_0x2e84('0x25')](_0x18d731)){logger['info']('Getting\x20agent\x20with\x20name',_0x18d731);return request({'form':{'method':_0x2e84('0x26'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x2e84('0x24')]({'session':_0x284fc9['id'],'module_name':_0x2e84('0x27'),'query':util[_0x2e84('0x1e')](_0x2e84('0x28'),_0x18d731),'order_by':'','offset':'0','select_fields':['id',_0x2e84('0xc'),_0x2e84('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x504531){if(_0x504531[_0x2e84('0x2a')][_0x2e84('0x19')]){var _0x25e604=_[_0x2e84('0x2b')](_0x504531[_0x2e84('0x2a')],function(_0x4e5a56){return _0x4e5a56[_0x2e84('0x2c')]['user_name'][_0x2e84('0x2d')]===_0x18d731;});if(_0x25e604){logger['info'](_0x2e84('0x2e'));return BPromise[_0x2e84('0x2f')]({'id':_0x25e604['name_value_list']['id'][_0x2e84('0x2d')],'name':_0x25e604[_0x2e84('0x2c')][_0x2e84('0xc')]['value']});}}logger['info'](_0x2e84('0x30'));return BPromise[_0x2e84('0x2f')]({'id':_0x284fc9[_0x2e84('0x2c')][_0x2e84('0x31')][_0x2e84('0x2d')],'name':_0x284fc9['name_value_list'][_0x2e84('0x29')][_0x2e84('0x2d')]});});}else{logger[_0x2e84('0xa')](_0x2e84('0x32'));return BPromise[_0x2e84('0x2f')]({'id':_0x284fc9['name_value_list'][_0x2e84('0x31')]['value'],'name':_0x284fc9[_0x2e84('0x2c')][_0x2e84('0x29')][_0x2e84('0x2d')]});}}function getEndUser(_0x262b72,_0xccde51,_0x349f2c,_0x2d4544){logger[_0x2e84('0xa')](_0x2e84('0x33'),_0x349f2c);return request({'form':{'method':_0x2e84('0x26'),'input_type':_0x2e84('0x1d'),'response_type':'JSON','rest_data':JSON[_0x2e84('0x24')]({'session':_0x2d4544['id'],'module_name':'Contacts','query':util[_0x2e84('0x1e')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x349f2c),'order_by':'','offset':'0','select_fields':['id',_0x2e84('0xc'),_0x2e84('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2e84('0x35')](function(_0x6d3f41){if(_0x6d3f41[_0x2e84('0x2a')][_0x2e84('0x19')]){var _0x5d939c=_['find'](_0x6d3f41['entry_list'],function(_0x1c12b0){return _0x1c12b0[_0x2e84('0x2c')]['phone_home'][_0x2e84('0x2d')]===_0x349f2c;});if(_0x5d939c){logger['info'](_0x2e84('0x36'));return BPromise[_0x2e84('0x2f')]({'id':_0x5d939c[_0x2e84('0x2c')]['id'][_0x2e84('0x2d')],'name':_0x5d939c[_0x2e84('0x2c')][_0x2e84('0xc')][_0x2e84('0x2d')],'phone':_0x5d939c[_0x2e84('0x2c')][_0x2e84('0x34')][_0x2e84('0x2d')]});}}else{logger[_0x2e84('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x2e84('0x1d'),'response_type':_0x2e84('0x1d'),'rest_data':JSON[_0x2e84('0x24')]({'session':_0x2d4544['id'],'module_name':_0x2e84('0x37'),'name_value_list':[{'name':'first_name','value':_0xccde51!==''?_0xccde51:util['format'](_0x2e84('0x38'),_0x349f2c)},{'name':_0x2e84('0x34'),'value':_0x349f2c}]})}})[_0x2e84('0x35')](function(_0x4b36eb){logger['info'](_0x2e84('0x39'));return BPromise['resolve']({'id':_0x4b36eb['id'],'name':_0x4b36eb[_0x2e84('0x2a')][_0x2e84('0x3a')][_0x2e84('0x2d')],'phone':_0x4b36eb[_0x2e84('0x2a')][_0x2e84('0x34')][_0x2e84('0x2d')]});});}});}function request(_0x4d5f22){logger['debug'](_0x2e84('0x3b'),JSON['stringify'](_0x4d5f22));return rp(_['merge'](def,_0x4d5f22));}function getTags(_0x574fca,_0x3c5f49){var _0x2c6bd9=[];if(_0x574fca&&_0x574fca[_0x2e84('0x19')]>0x0){_0x2c6bd9=_[_0x2e84('0x3c')](_0x574fca,_0x3c5f49);}return _0x2c6bd9;}function getCustomFields(_0x44d9d6,_0x1c3b16){var _0x336882=[];var _0x2f1e8f={'custom_fields':[]};if(_0x44d9d6[_0x2e84('0x19')]>0x0){_['forEach'](_0x44d9d6,function(_0x50021e){if(_0x50021e[_0x2e84('0x3d')]===_0x2e84('0x3e')&&_0x50021e[_0x2e84('0x3f')]&&!_0x50021e[_0x2e84('0x40')]){_0x2f1e8f[_0x50021e[_0x2e84('0x3f')][_0x2e84('0x41')]()]=_0x50021e[_0x2e84('0x42')][_0x2e84('0x21')]();}else if(_0x50021e[_0x2e84('0x3d')]===_0x2e84('0x3e')&&_0x50021e[_0x2e84('0x1b')]&&_0x50021e[_0x2e84('0x40')]){_0x2f1e8f[_0x2e84('0x43')]['push']({'id':_0x50021e[_0x2e84('0x1b')],'value':_0x50021e[_0x2e84('0x42')]['toString']()});}else if(_0x50021e[_0x2e84('0x3d')]==='variable'&&_0x50021e['variableName']&&_0x50021e[_0x2e84('0x1b')]&&_0x50021e['customField']){_0x1c3b16[_0x50021e[_0x2e84('0x1c')]]&&_0x2f1e8f[_0x2e84('0x43')][_0x2e84('0x44')]({'id':_0x50021e[_0x2e84('0x1b')],'value':_0x1c3b16[_0x50021e[_0x2e84('0x1c')]]['toString']()});}else if(_0x50021e[_0x2e84('0x3d')]===_0x2e84('0x45')&&_0x50021e[_0x2e84('0x46')]&&_0x50021e[_0x2e84('0x46')][_0x2e84('0xc')]&&_0x50021e[_0x2e84('0x1b')]&&_0x50021e['customField']){_0x1c3b16[_0x50021e[_0x2e84('0x46')][_0x2e84('0xc')]['toLowerCase']()]&&_0x2f1e8f['custom_fields'][_0x2e84('0x44')]({'id':_0x50021e[_0x2e84('0x1b')],'value':_0x1c3b16[_0x50021e[_0x2e84('0x46')][_0x2e84('0xc')][_0x2e84('0x41')]()][_0x2e84('0x21')]()});}});}return _0x2f1e8f;}function getConnection(_0x3e54ea){return request({'method':_0x2e84('0x8'),'form':{'method':_0x2e84('0x47'),'input_type':_0x2e84('0x1d'),'response_type':'JSON','rest_data':JSON[_0x2e84('0x24')]({'user_auth':{'user_name':_0x3e54ea[_0x2e84('0x48')],'password':_0x3e54ea[_0x2e84('0x49')],'encryption':_0x2e84('0x4a')},'application':_0x2e84('0x4b')})}})[_0x2e84('0x35')](function(_0x32dd32){var _0x536aea=_0x32dd32;if(_0x536aea['id']){def[_0x2e84('0x4c')]=_0x536aea['id'];return BPromise[_0x2e84('0x2f')](_0x536aea);}else{throw new Error(util[_0x2e84('0x1e')](_0x2e84('0x4d'),_0x3e54ea['id']));}});}function setRelationship(_0xa50886,_0x514e9c,_0x3daaad,_0x1d8260){return request({'form':{'method':_0x2e84('0x4e'),'input_type':_0x2e84('0x1d'),'response_type':'JSON','rest_data':JSON[_0x2e84('0x24')]({'session':_0xa50886['id'],'module_name':_0x2e84('0x4f'),'module_id':_0x3daaad['id'],'link_field_name':_0x1d8260,'related_ids':[_0x514e9c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2e84('0x50')]=function(_0x64aa2d,_0xd0416b,_0x451810,_0x5785cd,_0x42fe69,_0xad4ef6){var _0x521805,_0x23ca0b,_0x192bab,_0x55ed61;_0xad4ef6[_0x2e84('0x51')]=intUtil[_0x2e84('0x52')](_0xad4ef6[_0x2e84('0x51')]);_0xad4ef6[_0x2e84('0x53')]=intUtil[_0x2e84('0x52')](_0xad4ef6[_0x2e84('0x53')]);def[_0x2e84('0x54')]=util['format'](_0x2e84('0x55'),_0xad4ef6[_0x2e84('0x51')]);if(_0x42fe69&&_0x42fe69['monitor_format']){logger[_0x2e84('0xa')](_0x2e84('0x56'),_0x2e84('0x57'));_0xd0416b['recordingURL']=util[_0x2e84('0x1e')](_0x2e84('0x58'),_0xad4ef6['serverUrl'],_0xd0416b['uniqueid'],md5(_0xd0416b['uniqueid']));}else{_0xd0416b['recordingURL']='';}return getConnection(_0xad4ef6)['then'](function(_0x4d308c){_0x55ed61=_0x4d308c;return getUser(_0xad4ef6,_0x5785cd[_0x2e84('0xc')],_0x55ed61);})[_0x2e84('0x35')](function(_0x517883){_0x521805=_0x517883;logger['info'](_0x2e84('0x59'),_0x521805['id']);return getEndUser(_0xad4ef6,_0xd0416b[_0x2e84('0x5a')],_0xd0416b[_0x2e84('0x5b')],_0x55ed61);})[_0x2e84('0x35')](function(_0x4ebec2){_0x23ca0b=_0x4ebec2;logger[_0x2e84('0xa')]('The\x20Enduser\x20ID\x20is:',_0x23ca0b['id']);return getTicket(_0xad4ef6,_0x521805,_0x23ca0b,_0x451810,_0xd0416b,_0x451810[_0x2e84('0x5c')],_0x55ed61,'Inbound');})['then'](function(_0xb5e843){_0x192bab=_0xb5e843;logger[_0x2e84('0xa')](_0x2e84('0x5d'));logger[_0x2e84('0xa')](_0x2e84('0x5e'),_0x192bab['id']);return setRelationship(_0x55ed61,_0x521805,_0x192bab,'users');})['then'](function(){return setRelationship(_0x55ed61,_0x23ca0b,_0x192bab,'contacts');})[_0x2e84('0x35')](function(){return getServerInfo(_0x55ed61);})[_0x2e84('0x35')](function(_0x109c83){var _0x244a35=parseInt(_0x109c83[_0x2e84('0x5f')][_0x2e84('0x60')](0x0));var _0x5e4e05=util[_0x2e84('0x1e')](_0x2e84('0x61'),_0xad4ef6[_0x2e84('0x51')],_0x192bab['id']);if(_0x244a35>0x6){_0x5e4e05=util[_0x2e84('0x1e')](_0x2e84('0x62'),_0xad4ef6[_0x2e84('0x51')],_0x192bab['id']);}logger[_0x2e84('0xa')](_0x2e84('0x56'),_0x2e84('0x63'));emit(util[_0x2e84('0x1e')](_0x2e84('0x64'),_0x5785cd[_0x2e84('0xc')]),_0x2e84('0x65'),{'uri':_0x5e4e05});})[_0x2e84('0x66')](function(_0x13af70){logger['error']('[QUEUE]',JSON['stringify'](_0x13af70));});};exports[_0x2e84('0x67')]=function(_0x38f153,_0x34292c,_0x48f912,_0x2bd906,_0x3da29a,_0x1d97c8,_0x2b9a89){var _0x3fc97d,_0x368eb8,_0x187e47,_0xef8744;_0x1d97c8[_0x2e84('0x51')]=intUtil[_0x2e84('0x52')](_0x1d97c8[_0x2e84('0x51')]);_0x1d97c8[_0x2e84('0x53')]=intUtil['stripTrailingSlash'](_0x1d97c8[_0x2e84('0x53')]);def['uri']=util[_0x2e84('0x1e')]('%s/service/v4_1/rest.php',_0x1d97c8[_0x2e84('0x51')]);if(_0x2b9a89&&_0x2b9a89['recordingFormat']&&_0x2b9a89[_0x2e84('0x68')]!=='none'){logger[_0x2e84('0xa')]('[OUTBOUND]',_0x2e84('0x57'));_0x34292c[_0x2e84('0x69')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d97c8[_0x2e84('0x53')],_0x34292c['uniqueid'],md5(_0x34292c[_0x2e84('0x6a')]));}return getConnection(_0x1d97c8)[_0x2e84('0x35')](function(_0x27fdfa){_0xef8744=_0x27fdfa;return getUser(_0x1d97c8,_0x2bd906[_0x2e84('0xc')],_0xef8744);})[_0x2e84('0x35')](function(_0xe19810){_0x3fc97d=_0xe19810;logger[_0x2e84('0xa')](_0x2e84('0x59'),_0x3fc97d['id']);return getEndUser(_0x1d97c8,_0x34292c['destcalleridname'],_0x34292c[_0x2e84('0x6b')],_0xef8744);})[_0x2e84('0x35')](function(_0x1d1664){_0x368eb8=_0x1d1664;logger[_0x2e84('0xa')]('The\x20Enduser\x20ID\x20is:',_0x368eb8['id']);return getTicket(_0x1d97c8,_0x3fc97d,_0x368eb8,_0x48f912,_0x34292c,_0x48f912[_0x2e84('0x5c')],_0xef8744,_0x2e84('0x6c'));})[_0x2e84('0x35')](function(_0x34e03a){_0x187e47=_0x34e03a;logger[_0x2e84('0xa')](_0x2e84('0x5d'));logger[_0x2e84('0xa')](_0x2e84('0x5e'),_0x187e47['id']);return setRelationship(_0xef8744,_0x3fc97d,_0x187e47,'users');})['then'](function(){return setRelationship(_0xef8744,_0x368eb8,_0x187e47,'contacts');})[_0x2e84('0x35')](function(){return getServerInfo(_0xef8744);})[_0x2e84('0x35')](function(_0x280ccc){var _0x2d4873=parseInt(_0x280ccc['version'][_0x2e84('0x60')](0x0));var _0x36eb96=util['format'](_0x2e84('0x61'),_0x1d97c8['remoteUri'],_0x187e47['id']);if(_0x2d4873>0x6){_0x36eb96=util['format'](_0x2e84('0x62'),_0x1d97c8[_0x2e84('0x51')],_0x187e47['id']);}logger[_0x2e84('0xa')](_0x2e84('0x6d'),_0x2e84('0x63'));emit(util[_0x2e84('0x1e')](_0x2e84('0x64'),_0x2bd906['name']),_0x2e84('0x65'),{'uri':_0x36eb96});})[_0x2e84('0x66')](function(_0x5f1249){logger[_0x2e84('0x6e')](_0x2e84('0x6d'),JSON['stringify'](_0x5f1249));});};exports[_0x2e84('0x6f')]=function(_0x556273,_0xab8bbc,_0x2a87df,_0x4cfc92,_0x2db01a,_0x2ea92b){var _0x338010,_0x595609,_0x33d43d,_0x4b77d4;_0x2ea92b[_0x2e84('0x51')]=intUtil[_0x2e84('0x52')](_0x2ea92b[_0x2e84('0x51')]);_0x2ea92b[_0x2e84('0x53')]=intUtil[_0x2e84('0x52')](_0x2ea92b[_0x2e84('0x53')]);def[_0x2e84('0x54')]=util[_0x2e84('0x1e')]('%s/service/v4_1/rest.php',_0x2ea92b[_0x2e84('0x51')]);if(_0x2db01a&&_0x2db01a[_0x2e84('0x70')]){logger['info']('['+_0xab8bbc[_0x2e84('0x71')][_0x2e84('0x72')]()+']','Recording\x20is\x20enabled!');_0xab8bbc['recordingURL']=util[_0x2e84('0x1e')](_0x2e84('0x58'),_0x2ea92b[_0x2e84('0x53')],_0xab8bbc[_0x2e84('0x6a')],md5(_0xab8bbc[_0x2e84('0x6a')]));}else{_0xab8bbc['recordingURL']='';}return getConnection(_0x2ea92b)[_0x2e84('0x35')](function(_0x2ad484){_0x4b77d4=_0x2ad484;if(!_[_0x2e84('0x25')](_0x4cfc92)){return getUser(_0x2ea92b,_0x4cfc92[_0x2e84('0xc')],_0x4b77d4);}else{return getUser(_0x2ea92b,null,_0x4b77d4);}})[_0x2e84('0x35')](function(_0x53b4bd){_0x338010=_0x53b4bd;logger[_0x2e84('0xa')](_0x2e84('0x59'),_0x338010['id']);return getEndUser(_0x2ea92b,_0xab8bbc[_0x2e84('0x5a')],_0xab8bbc[_0x2e84('0x5b')],_0x4b77d4);})[_0x2e84('0x35')](function(_0x1df338){_0x595609=_0x1df338;logger['info'](_0x2e84('0x73'),_0x595609['id']);return getTicket(_0x2ea92b,_0x338010,_0x595609,_0x2a87df,_0xab8bbc,_0x2a87df[_0x2e84('0x5c')],_0x4b77d4,_0x2e84('0x74'));})[_0x2e84('0x35')](function(_0x190b55){_0x33d43d=_0x190b55;logger[_0x2e84('0xa')](_0x2e84('0x5d'));logger[_0x2e84('0xa')](_0x2e84('0x5e'),_0x33d43d['id']);return setRelationship(_0x4b77d4,_0x338010,_0x33d43d,_0x2e84('0x75'));})[_0x2e84('0x35')](function(){return setRelationship(_0x4b77d4,_0x595609,_0x33d43d,_0x2e84('0x76'));})[_0x2e84('0x35')](function(){return getServerInfo(_0x4b77d4);})[_0x2e84('0x66')](function(_0x576980){logger[_0x2e84('0x6e')]('['+_0xab8bbc[_0x2e84('0x71')][_0x2e84('0x72')]()+']',JSON[_0x2e84('0x24')](_0x576980));});}; \ No newline at end of file +var _0x74c9=['none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','unmanaged','lastevent','Recording\x20is\x20enabled!','calleridname','Fields','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','redis','localhost','POST','emit','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','set_entry','JSON','Calls','format','Basic\x20%s','toString','get_server_info','stringify','isNil','info','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','toLowerCase','content','idField','custom_fields','push','variable','customField','Variable','login','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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','catch','outbound','recordingFormat'];(function(_0x5c9f9c,_0x2193ed){var _0x20350a=function(_0x4b7419){while(--_0x4b7419){_0x5c9f9c['push'](_0x5c9f9c['shift']());}};_0x20350a(++_0x2193ed);}(_0x74c9,0x1eb));var _0x974c=function(_0x571b8c,_0x10b6ef){_0x571b8c=_0x571b8c-0x0;var _0x2e7bfd=_0x74c9[_0x571b8c];return _0x2e7bfd;};'use strict';var _=require(_0x974c('0x0'));var rp=require(_0x974c('0x1'));var BPromise=require(_0x974c('0x2'));var md5=require('md5');var util=require(_0x974c('0x3'));var Redis=require(_0x974c('0x4'));var intUtil=require(_0x974c('0x5'));var config=require('../../../../config/environment');var logger=require(_0x974c('0x6'))(_0x974c('0x7'));config['redis']=_[_0x974c('0x8')](config[_0x974c('0x9')],{'host':_0x974c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x974c('0x9')]));var def={'method':_0x974c('0xb'),'json':!![]};function emit(_0x1733dd,_0x1ff0c2,_0x1e702e){io['to'](_0x1733dd)[_0x974c('0xc')](_0x1ff0c2,_0x1e702e);}function getTicket(_0x4922bb,_0x3e3569,_0x2c0445,_0x547a47,_0x3b7a52,_0x28c107,_0x415e05,_0x44e69c){logger['info'](_0x974c('0xd'));var _0x31ed8c=new Date();var _0x27d4fc=[{'name':_0x974c('0xe'),'value':intUtil['getString'](_0x547a47[_0x974c('0xf')],_0x3b7a52,'\x20')},{'name':_0x974c('0x10'),'value':_0x3e3569['id']},{'name':_0x974c('0x11'),'value':_0x3e3569['id']},{'name':_0x974c('0x12'),'value':intUtil['getString'](_0x547a47[_0x974c('0x13')],_0x3b7a52,'\x0a')},{'name':_0x974c('0x14'),'value':_0x31ed8c[_0x974c('0x15')]()['slice'](0x0,0x13)[_0x974c('0x16')]('T','\x20')},{'name':_0x974c('0x17'),'value':'0'},{'name':_0x974c('0x18'),'value':'15'},{'name':_0x974c('0x19'),'value':_0x2c0445['id']},{'name':_0x974c('0x1a'),'value':_0x974c('0x1b')},{'name':_0x974c('0x1c'),'value':_0x2c0445[_0x974c('0xe')]},{'name':'direction','value':_0x44e69c}];if(_0x28c107[_0x974c('0x1d')]){_[_0x974c('0x1e')](_0x28c107,function(_0x2429d6){if(_0x3b7a52[_0x2429d6[_0x974c('0x1f')]]){_0x27d4fc['push']({'name':_0x2429d6['idField'],'value':_0x3b7a52[_0x2429d6[_0x974c('0x1f')]]});}});}return request({'form':{'method':_0x974c('0x20'),'input_type':_0x974c('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x415e05['id'],'module_name':_0x974c('0x22'),'name_value_list':_0x27d4fc})}});}function getAuth(_0x33a0f0){return util[_0x974c('0x23')](_0x974c('0x24'),new Buffer(_0x33a0f0['apiKey']+':X')[_0x974c('0x25')]('base64'));}function getServerInfo(_0x5df778){return request({'form':{'method':_0x974c('0x26'),'input_type':_0x974c('0x21'),'response_type':_0x974c('0x21'),'rest_data':JSON[_0x974c('0x27')]({'session':_0x5df778['id']})}});}function getUser(_0x536b8a,_0x5940be,_0xc25b10){if(!_[_0x974c('0x28')](_0x5940be)){logger[_0x974c('0x29')](_0x974c('0x2a'),_0x5940be);return request({'form':{'method':'get_entry_list','input_type':_0x974c('0x21'),'response_type':_0x974c('0x21'),'rest_data':JSON['stringify']({'session':_0xc25b10['id'],'module_name':_0x974c('0x2b'),'query':util['format'](_0x974c('0x2c'),_0x5940be),'order_by':'','offset':'0','select_fields':['id',_0x974c('0xe'),_0x974c('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4f9c9d){if(_0x4f9c9d[_0x974c('0x2e')][_0x974c('0x1d')]){var _0x572f52=_[_0x974c('0x2f')](_0x4f9c9d['entry_list'],function(_0x49dade){return _0x49dade['name_value_list'][_0x974c('0x2d')][_0x974c('0x30')]===_0x5940be;});if(_0x572f52){logger['info']('Agent\x20found!');return BPromise[_0x974c('0x31')]({'id':_0x572f52[_0x974c('0x32')]['id']['value'],'name':_0x572f52[_0x974c('0x32')][_0x974c('0xe')][_0x974c('0x30')]});}}logger[_0x974c('0x29')](_0x974c('0x33'));return BPromise[_0x974c('0x31')]({'id':_0xc25b10[_0x974c('0x32')][_0x974c('0x34')][_0x974c('0x30')],'name':_0xc25b10['name_value_list'][_0x974c('0x2d')][_0x974c('0x30')]});});}else{logger[_0x974c('0x29')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x974c('0x31')]({'id':_0xc25b10[_0x974c('0x32')][_0x974c('0x34')]['value'],'name':_0xc25b10['name_value_list'][_0x974c('0x2d')][_0x974c('0x30')]});}}function getEndUser(_0x3ba9a6,_0x1dd6f5,_0x311462,_0x2dddd9){logger[_0x974c('0x29')](_0x974c('0x35'),_0x311462);return request({'form':{'method':'get_entry_list','input_type':_0x974c('0x21'),'response_type':'JSON','rest_data':JSON[_0x974c('0x27')]({'session':_0x2dddd9['id'],'module_name':_0x974c('0x1b'),'query':util['format'](_0x974c('0x36'),_0x311462),'order_by':'','offset':'0','select_fields':['id',_0x974c('0xe'),_0x974c('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x974c('0x38')](function(_0x2eb796){if(_0x2eb796[_0x974c('0x2e')][_0x974c('0x1d')]){var _0x5be7c1=_[_0x974c('0x2f')](_0x2eb796[_0x974c('0x2e')],function(_0x505b38){return _0x505b38[_0x974c('0x32')][_0x974c('0x37')][_0x974c('0x30')]===_0x311462;});if(_0x5be7c1){logger[_0x974c('0x29')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x5be7c1[_0x974c('0x32')]['id'][_0x974c('0x30')],'name':_0x5be7c1['name_value_list'][_0x974c('0xe')]['value'],'phone':_0x5be7c1['name_value_list']['phone_home'][_0x974c('0x30')]});}}else{logger[_0x974c('0x29')](_0x974c('0x39'));return request({'form':{'method':_0x974c('0x20'),'input_type':_0x974c('0x21'),'response_type':_0x974c('0x21'),'rest_data':JSON[_0x974c('0x27')]({'session':_0x2dddd9['id'],'module_name':'Contacts','name_value_list':[{'name':_0x974c('0x3a'),'value':_0x1dd6f5!==_0x974c('0x3b')?_0x1dd6f5:util[_0x974c('0x23')](_0x974c('0x3c'),_0x311462)},{'name':'phone_home','value':_0x311462}]})}})['then'](function(_0x5e3e6c){logger[_0x974c('0x29')](_0x974c('0x3d'));return BPromise[_0x974c('0x31')]({'id':_0x5e3e6c['id'],'name':_0x5e3e6c['entry_list'][_0x974c('0x3a')][_0x974c('0x30')],'phone':_0x5e3e6c[_0x974c('0x2e')][_0x974c('0x37')]['value']});});}});}function request(_0x283b57){logger[_0x974c('0x3e')](_0x974c('0x3f'),JSON['stringify'](_0x283b57));return rp(_['merge'](def,_0x283b57));}function getTags(_0x19b544,_0x2be668){var _0x21ebf3=[];if(_0x19b544&&_0x19b544['length']>0x0){_0x21ebf3=_[_0x974c('0x40')](_0x19b544,_0x2be668);}return _0x21ebf3;}function getCustomFields(_0x2615b4,_0x2dce97){var _0x46e5f8=[];var _0x1a8606={'custom_fields':[]};if(_0x2615b4[_0x974c('0x1d')]>0x0){_['forEach'](_0x2615b4,function(_0x1e4e31){if(_0x1e4e31[_0x974c('0x41')]===_0x974c('0x42')&&_0x1e4e31[_0x974c('0x43')]&&!_0x1e4e31['customField']){_0x1a8606[_0x1e4e31['nameField'][_0x974c('0x44')]()]=_0x1e4e31[_0x974c('0x45')][_0x974c('0x25')]();}else if(_0x1e4e31['type']===_0x974c('0x42')&&_0x1e4e31[_0x974c('0x46')]&&_0x1e4e31['customField']){_0x1a8606[_0x974c('0x47')][_0x974c('0x48')]({'id':_0x1e4e31[_0x974c('0x46')],'value':_0x1e4e31[_0x974c('0x45')][_0x974c('0x25')]()});}else if(_0x1e4e31[_0x974c('0x41')]===_0x974c('0x49')&&_0x1e4e31[_0x974c('0x1f')]&&_0x1e4e31[_0x974c('0x46')]&&_0x1e4e31[_0x974c('0x4a')]){_0x2dce97[_0x1e4e31[_0x974c('0x1f')]]&&_0x1a8606[_0x974c('0x47')]['push']({'id':_0x1e4e31[_0x974c('0x46')],'value':_0x2dce97[_0x1e4e31[_0x974c('0x1f')]][_0x974c('0x25')]()});}else if(_0x1e4e31[_0x974c('0x41')]==='customVariable'&&_0x1e4e31[_0x974c('0x4b')]&&_0x1e4e31[_0x974c('0x4b')][_0x974c('0xe')]&&_0x1e4e31['idField']&&_0x1e4e31['customField']){_0x2dce97[_0x1e4e31['Variable'][_0x974c('0xe')]['toLowerCase']()]&&_0x1a8606[_0x974c('0x47')]['push']({'id':_0x1e4e31[_0x974c('0x46')],'value':_0x2dce97[_0x1e4e31[_0x974c('0x4b')][_0x974c('0xe')][_0x974c('0x44')]()][_0x974c('0x25')]()});}});}return _0x1a8606;}function getConnection(_0x5f0f7c){return request({'method':_0x974c('0xb'),'form':{'method':_0x974c('0x4c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x974c('0x27')]({'user_auth':{'user_name':_0x5f0f7c['username'],'password':_0x5f0f7c['password'],'encryption':'PLAIN'},'application':_0x974c('0x4d')})}})[_0x974c('0x38')](function(_0x371c7f){var _0x158123=_0x371c7f;if(_0x158123['id']){def[_0x974c('0x4e')]=_0x158123['id'];return BPromise[_0x974c('0x31')](_0x158123);}else{throw new Error(util[_0x974c('0x23')](_0x974c('0x4f'),_0x5f0f7c['id']));}});}function setRelationship(_0x300463,_0x131840,_0x29c327,_0x249113){return request({'form':{'method':'set_relationship','input_type':_0x974c('0x21'),'response_type':'JSON','rest_data':JSON[_0x974c('0x27')]({'session':_0x300463['id'],'module_name':_0x974c('0x22'),'module_id':_0x29c327['id'],'link_field_name':_0x249113,'related_ids':[_0x131840['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x974c('0x50')]=function(_0x25fe62,_0x211969,_0x1d78f0,_0x3c69de,_0x169eb3,_0x4a1796){var _0x1e2245,_0x9eb5da,_0x421e34,_0x32f742;_0x4a1796[_0x974c('0x51')]=intUtil['stripTrailingSlash'](_0x4a1796[_0x974c('0x51')]);_0x4a1796[_0x974c('0x52')]=intUtil[_0x974c('0x53')](_0x4a1796[_0x974c('0x52')]);def[_0x974c('0x54')]=util[_0x974c('0x23')](_0x974c('0x55'),_0x4a1796[_0x974c('0x51')]);if(_0x169eb3&&_0x169eb3[_0x974c('0x56')]){logger[_0x974c('0x29')](_0x974c('0x57'),'Recording\x20is\x20enabled!');_0x211969[_0x974c('0x58')]=util[_0x974c('0x23')](_0x974c('0x59'),_0x4a1796['serverUrl'],_0x211969[_0x974c('0x5a')],md5(_0x211969[_0x974c('0x5a')]));}else{_0x211969[_0x974c('0x58')]='';}return getConnection(_0x4a1796)[_0x974c('0x38')](function(_0x1ba372){_0x32f742=_0x1ba372;return getUser(_0x4a1796,_0x3c69de['name'],_0x32f742);})[_0x974c('0x38')](function(_0x4dac89){_0x1e2245=_0x4dac89;logger[_0x974c('0x29')](_0x974c('0x5b'),_0x1e2245['id']);return getEndUser(_0x4a1796,_0x211969['calleridname'],_0x211969['calleridnum'],_0x32f742);})[_0x974c('0x38')](function(_0x52c781){_0x9eb5da=_0x52c781;logger[_0x974c('0x29')](_0x974c('0x5c'),_0x9eb5da['id']);return getTicket(_0x4a1796,_0x1e2245,_0x9eb5da,_0x1d78f0,_0x211969,_0x1d78f0['Fields'],_0x32f742,_0x974c('0x5d'));})['then'](function(_0x53e739){_0x421e34=_0x53e739;logger['info'](_0x974c('0x5e'));logger[_0x974c('0x29')](_0x974c('0x5f'),_0x421e34['id']);return setRelationship(_0x32f742,_0x1e2245,_0x421e34,_0x974c('0x60'));})[_0x974c('0x38')](function(){return setRelationship(_0x32f742,_0x9eb5da,_0x421e34,_0x974c('0x61'));})[_0x974c('0x38')](function(){return getServerInfo(_0x32f742);})[_0x974c('0x38')](function(_0x521dcc){var _0x5bc11c=parseInt(_0x521dcc[_0x974c('0x62')]['charAt'](0x0));var _0x1dd941=util['format'](_0x974c('0x63'),_0x4a1796[_0x974c('0x51')],_0x421e34['id']);if(_0x5bc11c>0x6){_0x1dd941=util['format'](_0x974c('0x64'),_0x4a1796['remoteUri'],_0x421e34['id']);}logger[_0x974c('0x29')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x974c('0x23')]('user:%s',_0x3c69de['name']),'trigger:browser:url',{'uri':_0x1dd941});})[_0x974c('0x65')](function(_0x2019d0){logger['error'](_0x974c('0x57'),JSON[_0x974c('0x27')](_0x2019d0));});};exports[_0x974c('0x66')]=function(_0x272377,_0x142919,_0x4e4c3a,_0x4c72a2,_0x2992de,_0x5ee3d2,_0x28a8b8){var _0x55ff97,_0x105aec,_0x273e42,_0x2ddb7a;_0x5ee3d2['remoteUri']=intUtil[_0x974c('0x53')](_0x5ee3d2[_0x974c('0x51')]);_0x5ee3d2[_0x974c('0x52')]=intUtil[_0x974c('0x53')](_0x5ee3d2[_0x974c('0x52')]);def[_0x974c('0x54')]=util[_0x974c('0x23')](_0x974c('0x55'),_0x5ee3d2['remoteUri']);if(_0x28a8b8&&_0x28a8b8[_0x974c('0x67')]&&_0x28a8b8['recordingFormat']!==_0x974c('0x68')){logger[_0x974c('0x29')](_0x974c('0x69'),'Recording\x20is\x20enabled!');_0x142919['recordingURL']=util[_0x974c('0x23')](_0x974c('0x59'),_0x5ee3d2['serverUrl'],_0x142919[_0x974c('0x5a')],md5(_0x142919[_0x974c('0x5a')]));}return getConnection(_0x5ee3d2)[_0x974c('0x38')](function(_0x323d03){_0x2ddb7a=_0x323d03;return getUser(_0x5ee3d2,_0x4c72a2[_0x974c('0xe')],_0x2ddb7a);})[_0x974c('0x38')](function(_0x1e6325){_0x55ff97=_0x1e6325;logger[_0x974c('0x29')](_0x974c('0x5b'),_0x55ff97['id']);return getEndUser(_0x5ee3d2,_0x142919[_0x974c('0x6a')],_0x142919[_0x974c('0x6b')],_0x2ddb7a);})[_0x974c('0x38')](function(_0x5ee83c){_0x105aec=_0x5ee83c;logger[_0x974c('0x29')](_0x974c('0x5c'),_0x105aec['id']);return getTicket(_0x5ee3d2,_0x55ff97,_0x105aec,_0x4e4c3a,_0x142919,_0x4e4c3a['Fields'],_0x2ddb7a,_0x974c('0x6c'));})[_0x974c('0x38')](function(_0x19565a){_0x273e42=_0x19565a;logger[_0x974c('0x29')](_0x974c('0x5e'));logger[_0x974c('0x29')]('The\x20Ticket\x20ID\x20is:',_0x273e42['id']);return setRelationship(_0x2ddb7a,_0x55ff97,_0x273e42,_0x974c('0x60'));})['then'](function(){return setRelationship(_0x2ddb7a,_0x105aec,_0x273e42,_0x974c('0x61'));})[_0x974c('0x38')](function(){return getServerInfo(_0x2ddb7a);})[_0x974c('0x38')](function(_0x154d99){var _0x10fd5f=parseInt(_0x154d99['version'][_0x974c('0x6d')](0x0));var _0x206515=util['format'](_0x974c('0x63'),_0x5ee3d2[_0x974c('0x51')],_0x273e42['id']);if(_0x10fd5f>0x6){_0x206515=util[_0x974c('0x23')](_0x974c('0x64'),_0x5ee3d2[_0x974c('0x51')],_0x273e42['id']);}logger['info'](_0x974c('0x69'),_0x974c('0x6e'));emit(util[_0x974c('0x23')]('user:%s',_0x4c72a2[_0x974c('0xe')]),_0x974c('0x6f'),{'uri':_0x206515});})[_0x974c('0x65')](function(_0x1f07e4){logger[_0x974c('0x70')](_0x974c('0x69'),JSON[_0x974c('0x27')](_0x1f07e4));});};exports[_0x974c('0x71')]=function(_0x163833,_0x339b68,_0x444d3d,_0x41d85b,_0x441a01,_0x3f3fc6){var _0x3072a7,_0x14a86f,_0x1060e0,_0x2b1cd2;_0x3f3fc6[_0x974c('0x51')]=intUtil[_0x974c('0x53')](_0x3f3fc6[_0x974c('0x51')]);_0x3f3fc6[_0x974c('0x52')]=intUtil[_0x974c('0x53')](_0x3f3fc6[_0x974c('0x52')]);def[_0x974c('0x54')]=util[_0x974c('0x23')]('%s/service/v4_1/rest.php',_0x3f3fc6['remoteUri']);if(_0x441a01&&_0x441a01[_0x974c('0x56')]){logger[_0x974c('0x29')]('['+_0x339b68[_0x974c('0x72')]['toUpperCase']()+']',_0x974c('0x73'));_0x339b68[_0x974c('0x58')]=util[_0x974c('0x23')](_0x974c('0x59'),_0x3f3fc6['serverUrl'],_0x339b68[_0x974c('0x5a')],md5(_0x339b68[_0x974c('0x5a')]));}else{_0x339b68[_0x974c('0x58')]='';}return getConnection(_0x3f3fc6)[_0x974c('0x38')](function(_0x8e52a){_0x2b1cd2=_0x8e52a;if(!_[_0x974c('0x28')](_0x41d85b)){return getUser(_0x3f3fc6,_0x41d85b['name'],_0x2b1cd2);}else{return getUser(_0x3f3fc6,null,_0x2b1cd2);}})[_0x974c('0x38')](function(_0x1576bf){_0x3072a7=_0x1576bf;logger[_0x974c('0x29')](_0x974c('0x5b'),_0x3072a7['id']);return getEndUser(_0x3f3fc6,_0x339b68[_0x974c('0x74')],_0x339b68['calleridnum'],_0x2b1cd2);})[_0x974c('0x38')](function(_0x1e4b5a){_0x14a86f=_0x1e4b5a;logger[_0x974c('0x29')](_0x974c('0x5c'),_0x14a86f['id']);return getTicket(_0x3f3fc6,_0x3072a7,_0x14a86f,_0x444d3d,_0x339b68,_0x444d3d[_0x974c('0x75')],_0x2b1cd2,'Inbound');})[_0x974c('0x38')](function(_0x51c8a3){_0x1060e0=_0x51c8a3;logger[_0x974c('0x29')](_0x974c('0x5e'));logger[_0x974c('0x29')](_0x974c('0x5f'),_0x1060e0['id']);return setRelationship(_0x2b1cd2,_0x3072a7,_0x1060e0,'users');})[_0x974c('0x38')](function(){return setRelationship(_0x2b1cd2,_0x14a86f,_0x1060e0,_0x974c('0x61'));})[_0x974c('0x38')](function(){return getServerInfo(_0x2b1cd2);})[_0x974c('0x65')](function(_0xe85321){logger[_0x974c('0x70')]('['+_0x339b68[_0x974c('0x72')][_0x974c('0x76')]()+']',JSON['stringify'](_0xe85321));});}; \ 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 2526ac7..357ba43 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 _0x3958=['type','push','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyType','string','%s:\x20%s','keyContent','key','format','stripTrailingSlash','slice','validateEmail','isNil','test','lodash','getString','length','sortBy'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x3958,0x1c4));var _0x8395=function(_0x22a656,_0x117294){_0x22a656=_0x22a656-0x0;var _0x3d679d=_0x3958[_0x22a656];return _0x3d679d;};'use strict';var _=require(_0x8395('0x0'));var util=require('util');exports[_0x8395('0x1')]=function(_0x5ff0af,_0x333888,_0x281cb6){var _0x160c7f=[];if(_0x5ff0af[_0x8395('0x2')]>0x0){var _0x10669e=_[_0x8395('0x3')](_0x5ff0af,['id']);for(var _0x3e0a58=0x0;_0x3e0a58<_0x10669e['length'];_0x3e0a58++){var _0x1f8852=_0x10669e[_0x3e0a58];if(_0x1f8852[_0x8395('0x4')]==='string'){_0x160c7f[_0x8395('0x5')](_0x1f8852['content']);}else if(_0x1f8852[_0x8395('0x4')]===_0x8395('0x6')&&_0x1f8852['variableName']){_0x333888[_0x1f8852[_0x8395('0x7')]]&&_0x160c7f['push'](_0x333888[_0x1f8852[_0x8395('0x7')]]['toString']());}else if(_0x1f8852[_0x8395('0x4')]===_0x8395('0x8')&&_0x1f8852[_0x8395('0x9')]&&_0x1f8852['Variable'][_0x8395('0xa')]){_0x333888[_0x1f8852['Variable'][_0x8395('0xa')][_0x8395('0xb')]()]&&_0x160c7f[_0x8395('0x5')](_0x333888[_0x1f8852['Variable']['name'][_0x8395('0xb')]()][_0x8395('0xc')]());}else if(_0x1f8852[_0x8395('0x4')]==='keyValue'){if(_0x1f8852[_0x8395('0xd')]===_0x8395('0xe')&&_0x1f8852['key']){_0x160c7f[_0x8395('0x5')](util['format'](_0x8395('0xf'),_0x1f8852['key'],_0x1f8852[_0x8395('0x10')]));}else if(_0x1f8852[_0x8395('0xd')]===_0x8395('0x6')&&_0x1f8852[_0x8395('0x7')]&&_0x1f8852[_0x8395('0x11')]){_0x333888[_0x1f8852[_0x8395('0x7')]]&&_0x160c7f['push'](util[_0x8395('0x12')](_0x8395('0xf'),_0x1f8852['key'],_0x333888[_0x1f8852[_0x8395('0x7')]]));}else if(_0x1f8852[_0x8395('0xd')]===_0x8395('0x8')&&_0x1f8852[_0x8395('0x9')]&&_0x1f8852[_0x8395('0x9')][_0x8395('0xa')]&&_0x1f8852[_0x8395('0x11')]){_0x333888[_0x1f8852[_0x8395('0x9')]['name']['toLowerCase']()]&&_0x160c7f['push'](util[_0x8395('0x12')](_0x8395('0xf'),_0x1f8852[_0x8395('0x11')],_0x333888[_0x1f8852[_0x8395('0x9')][_0x8395('0xa')][_0x8395('0xb')]()]));}}}}return _0x160c7f['join'](_0x281cb6);};exports[_0x8395('0x13')]=function(_0x40c155){var _0x44db12=_0x40c155[_0x8395('0x14')](-0x1);if(_0x44db12==='/'){_0x40c155=_0x40c155['substring'](0x0,_0x40c155['lastIndexOf'](_0x44db12));}return _0x40c155;};exports[_0x8395('0x15')]=function(_0x4f1019){if(!_[_0x8395('0x16')](_0x4f1019)&&_0x4f1019!==''){var _0x176701=/^(([^<>()\[\]\\.,;:\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 _0x176701[_0x8395('0x17')](String(_0x4f1019)[_0x8395('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xe623=['%s:\x20%s','customVariable','slice','substring','lastIndexOf','validateEmail','isNil','util','getString','length','sortBy','string','push','content','type','variableName','toString','Variable','name','toLowerCase','keyType','key','format','variable'];(function(_0x13692c,_0xf981d7){var _0x26364c=function(_0xcc16a1){while(--_0xcc16a1){_0x13692c['push'](_0x13692c['shift']());}};_0x26364c(++_0xf981d7);}(_0xe623,0x13f));var _0x3e62=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xe623[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require('lodash');var util=require(_0x3e62('0x0'));exports[_0x3e62('0x1')]=function(_0x43916f,_0x46c9b6,_0x476f79){var _0x228496=[];if(_0x43916f[_0x3e62('0x2')]>0x0){var _0x1b2f55=_[_0x3e62('0x3')](_0x43916f,['id']);for(var _0x3aa2dc=0x0;_0x3aa2dc<_0x1b2f55[_0x3e62('0x2')];_0x3aa2dc++){var _0x416252=_0x1b2f55[_0x3aa2dc];if(_0x416252['type']===_0x3e62('0x4')){_0x228496[_0x3e62('0x5')](_0x416252[_0x3e62('0x6')]);}else if(_0x416252[_0x3e62('0x7')]==='variable'&&_0x416252[_0x3e62('0x8')]){_0x46c9b6[_0x416252[_0x3e62('0x8')]]&&_0x228496['push'](_0x46c9b6[_0x416252[_0x3e62('0x8')]][_0x3e62('0x9')]());}else if(_0x416252[_0x3e62('0x7')]==='customVariable'&&_0x416252[_0x3e62('0xa')]&&_0x416252[_0x3e62('0xa')][_0x3e62('0xb')]){_0x46c9b6[_0x416252[_0x3e62('0xa')][_0x3e62('0xb')][_0x3e62('0xc')]()]&&_0x228496['push'](_0x46c9b6[_0x416252[_0x3e62('0xa')][_0x3e62('0xb')][_0x3e62('0xc')]()][_0x3e62('0x9')]());}else if(_0x416252['type']==='keyValue'){if(_0x416252[_0x3e62('0xd')]===_0x3e62('0x4')&&_0x416252[_0x3e62('0xe')]){_0x228496['push'](util[_0x3e62('0xf')]('%s:\x20%s',_0x416252['key'],_0x416252['keyContent']));}else if(_0x416252['keyType']===_0x3e62('0x10')&&_0x416252[_0x3e62('0x8')]&&_0x416252[_0x3e62('0xe')]){_0x46c9b6[_0x416252[_0x3e62('0x8')]]&&_0x228496['push'](util['format'](_0x3e62('0x11'),_0x416252[_0x3e62('0xe')],_0x46c9b6[_0x416252[_0x3e62('0x8')]]));}else if(_0x416252[_0x3e62('0xd')]===_0x3e62('0x12')&&_0x416252[_0x3e62('0xa')]&&_0x416252['Variable']['name']&&_0x416252[_0x3e62('0xe')]){_0x46c9b6[_0x416252[_0x3e62('0xa')][_0x3e62('0xb')][_0x3e62('0xc')]()]&&_0x228496['push'](util[_0x3e62('0xf')](_0x3e62('0x11'),_0x416252[_0x3e62('0xe')],_0x46c9b6[_0x416252[_0x3e62('0xa')][_0x3e62('0xb')]['toLowerCase']()]));}}}}return _0x228496['join'](_0x476f79);};exports['stripTrailingSlash']=function(_0x41621f){var _0x58a4b1=_0x41621f[_0x3e62('0x13')](-0x1);if(_0x58a4b1==='/'){_0x41621f=_0x41621f[_0x3e62('0x14')](0x0,_0x41621f[_0x3e62('0x15')](_0x58a4b1));}return _0x41621f;};exports[_0x3e62('0x16')]=function(_0x194366){if(!_[_0x3e62('0x17')](_0x194366)&&_0x194366!==''){var _0x34c7b7=/^(([^<>()\[\]\\.,;:\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 _0x34c7b7['test'](String(_0x194366)['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 afa4a54..5562a2d 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 99ac2e0..1a3ec38 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 _0x9022=['Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','%s/token:%s','token','Basic\x20%s','toString','base64','stringify','GET','map','forEach','string','type','nameField','customField','toLowerCase','content','includes','idField','custom_fields','push','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL'];(function(_0x3e9316,_0x2a51c3){var _0x2833a3=function(_0x327d6b){while(--_0x327d6b){_0x3e9316['push'](_0x3e9316['shift']());}};_0x2833a3(++_0x2a51c3);}(_0x9022,0xfe));var _0x2902=function(_0xbaf699,_0x4aa945){_0xbaf699=_0xbaf699-0x0;var _0x55a131=_0x9022[_0xbaf699];return _0x55a131;};'use strict';var _=require(_0x2902('0x0'));var rp=require(_0x2902('0x1'));var md5=require(_0x2902('0x2'));var util=require(_0x2902('0x3'));var Redis=require(_0x2902('0x4'));var intUtil=require(_0x2902('0x5'));var config=require('../../../../config/environment');var logger=require(_0x2902('0x6'))(_0x2902('0x7'));config['redis']=_[_0x2902('0x8')](config[_0x2902('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x2902('0xa'))(new Redis(config[_0x2902('0x9')]));function emit(_0x4faa4e,_0x111810,_0x50c0f4){io['to'](_0x4faa4e)[_0x2902('0xb')](_0x111810,_0x50c0f4);}var headers={'Content-Type':_0x2902('0xc'),'Accept':_0x2902('0xc')};function getTicket(_0xe0c181,_0xff768e,_0x14ac82,_0x36ae69,_0x2d3d83){logger['info'](_0x2902('0xd'));return request({'uri':util[_0x2902('0xe')](_0x2902('0xf'),_0xe0c181[_0x2902('0x10')]),'method':_0x2902('0x11'),'body':{'ticket':_[_0x2902('0x12')]({'requester_id':_0x14ac82['id'],'submitter_id':_0xff768e?_0xff768e['id']:undefined,'assignee_id':_0xff768e?_0xff768e['id']:undefined,'tags':getTags(_0x36ae69[_0x2902('0x13')],_0x2902('0x14')),'subject':intUtil[_0x2902('0x15')](_0x36ae69[_0x2902('0x16')],_0x2d3d83,'\x20'),'description':intUtil['getString'](_0x36ae69[_0x2902('0x17')],_0x2d3d83,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x36ae69[_0x2902('0x17')],_0x2d3d83,'\x0a')}},getCustomFields(_0x36ae69[_0x2902('0x18')],_0x2d3d83))}})[_0x2902('0x19')](function(_0x1188c7){logger[_0x2902('0x1a')](_0x2902('0x1b'));return _0x1188c7['ticket'];});}function getUser(_0x4b0a0d,_0x131448){if(intUtil['validateEmail'](_0x131448)){logger['info'](_0x2902('0x1c'),_0x131448);return request({'uri':util[_0x2902('0xe')]('%s/search.json',_0x4b0a0d[_0x2902('0x10')]),'qs':{'query':util['format'](_0x2902('0x1d'),_0x131448)}})[_0x2902('0x19')](function(_0xf7758f){if(_0xf7758f[_0x2902('0x1e')]){logger[_0x2902('0x1a')]('Agent\x20found!');return _[_0x2902('0x1f')](_0xf7758f[_0x2902('0x20')],{'email':_0x131448,'role':'agent'});}else{logger[_0x2902('0x1a')](_0x2902('0x21'));return request({'uri':util[_0x2902('0xe')](_0x2902('0x22'),_0x4b0a0d[_0x2902('0x10')])})['then'](function(_0x586756){logger[_0x2902('0x1a')]('Admin\x20account\x20selected.');return _0x586756[_0x2902('0x23')];});}});}else{logger[_0x2902('0x1a')](_0x2902('0x21'));return request({'uri':util[_0x2902('0xe')]('%s/users/me.json',_0x4b0a0d['remoteUri'])})[_0x2902('0x19')](function(_0x157080){logger[_0x2902('0x1a')](_0x2902('0x24'));return _0x157080['user'];});}}function getEndUser(_0x1e3ce5,_0x5a0666,_0x1c4711){logger[_0x2902('0x1a')]('Searching\x20enduser\x20with\x20phone',_0x1c4711);return request({'uri':util[_0x2902('0xe')](_0x2902('0x25'),_0x1e3ce5[_0x2902('0x10')]),'qs':{'query':util['format'](_0x2902('0x26'),_0x1c4711)}})[_0x2902('0x19')](function(_0x3ac384){var _0x29935c;if(_0x3ac384[_0x2902('0x20')]['length']){_0x3ac384[_0x2902('0x20')]=_[_0x2902('0x27')](_0x3ac384[_0x2902('0x20')],{'suspended':![],'role':_0x2902('0x28')});if(_0x3ac384[_0x2902('0x20')][_0x2902('0x29')]){_0x29935c=_['first'](_0x3ac384[_0x2902('0x20')]);}}if(_0x29935c){logger['info'](_0x2902('0x2a'));return _0x29935c;}else{logger['info'](_0x2902('0x2b'));return request({'uri':util['format'](_0x2902('0x2c'),_0x1e3ce5[_0x2902('0x10')]),'method':_0x2902('0x11'),'body':{'user':{'role':'end-user','name':util[_0x2902('0xe')](_0x2902('0x2d'),_0x5a0666||_0x1c4711),'phone':_0x1c4711}}})[_0x2902('0x19')](function(_0x12adca){logger[_0x2902('0x1a')](_0x2902('0x2e'));return _0x12adca['user'];});}});}function getAuth(_0x1e97b7){var _0x312929;if(_0x1e97b7['authType']===_0x2902('0x2f')){_0x312929=util[_0x2902('0xe')]('%s:%s',_0x1e97b7[_0x2902('0x30')],_0x1e97b7[_0x2902('0x2f')]);}else if(_0x1e97b7[_0x2902('0x31')]==='token'){_0x312929=util[_0x2902('0xe')](_0x2902('0x32'),_0x1e97b7[_0x2902('0x30')],_0x1e97b7[_0x2902('0x33')]);}return util[_0x2902('0xe')](_0x2902('0x34'),new Buffer(_0x312929)[_0x2902('0x35')](_0x2902('0x36')));}function request(_0x4238d8){logger['debug']('[HTTP]',JSON[_0x2902('0x37')](_0x4238d8));return rp(_[_0x2902('0x8')](_0x4238d8,{'method':_0x2902('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x12a37f,_0x5804b7){var _0x3e20bb=[];if(_0x12a37f&&_0x12a37f[_0x2902('0x29')]>0x0){_0x3e20bb=_[_0x2902('0x39')](_0x12a37f,_0x5804b7);}return _0x3e20bb;}function getCustomFields(_0x4f2a7d,_0x11f198){var _0x4e05ce=[];var _0x484224={'custom_fields':[]};if(_0x4f2a7d[_0x2902('0x29')]>0x0){_[_0x2902('0x3a')](_0x4f2a7d,function(_0x4de5d6){if(_['includes']([_0x2902('0x3b'),'picklist'],_0x4de5d6[_0x2902('0x3c')])&&_0x4de5d6[_0x2902('0x3d')]&&!_0x4de5d6[_0x2902('0x3e')]){_0x484224[_0x4de5d6[_0x2902('0x3d')][_0x2902('0x3f')]()]=_0x4de5d6[_0x2902('0x40')][_0x2902('0x35')]();}else if(_[_0x2902('0x41')]([_0x2902('0x3b'),'picklist'],_0x4de5d6[_0x2902('0x3c')])&&_0x4de5d6[_0x2902('0x42')]&&_0x4de5d6[_0x2902('0x3e')]){_0x484224[_0x2902('0x43')][_0x2902('0x44')]({'id':_0x4de5d6[_0x2902('0x42')],'value':_0x4de5d6['content'][_0x2902('0x35')]()});}else if(_0x4de5d6[_0x2902('0x3c')]==='variable'&&_0x4de5d6['variableName']&&_0x4de5d6[_0x2902('0x42')]&&_0x4de5d6[_0x2902('0x3e')]){_0x11f198[_0x4de5d6[_0x2902('0x45')]]&&_0x484224[_0x2902('0x43')][_0x2902('0x44')]({'id':_0x4de5d6[_0x2902('0x42')],'value':_0x11f198[_0x4de5d6[_0x2902('0x45')]][_0x2902('0x35')]()});}else if(_0x4de5d6[_0x2902('0x3c')]==='customVariable'&&_0x4de5d6[_0x2902('0x46')]&&_0x4de5d6[_0x2902('0x46')][_0x2902('0x14')]&&_0x4de5d6[_0x2902('0x42')]&&_0x4de5d6[_0x2902('0x3e')]){_0x11f198[_0x4de5d6[_0x2902('0x46')]['name'][_0x2902('0x3f')]()]&&_0x484224[_0x2902('0x43')][_0x2902('0x44')]({'id':_0x4de5d6[_0x2902('0x42')],'value':_0x11f198[_0x4de5d6[_0x2902('0x46')][_0x2902('0x14')][_0x2902('0x3f')]()][_0x2902('0x35')]()});}});}return _0x484224;}exports[_0x2902('0x47')]=function(_0x4c8a7e,_0x281da5,_0x4172e0,_0x182b8b,_0x1c55e5,_0x772fa6){var _0x28919c,_0x186ccb;_0x772fa6[_0x2902('0x10')]=intUtil['stripTrailingSlash'](_0x772fa6['remoteUri']);_0x772fa6[_0x2902('0x48')]=intUtil[_0x2902('0x49')](_0x772fa6[_0x2902('0x48')]);if(_0x1c55e5&&_0x1c55e5[_0x2902('0x4a')]){logger[_0x2902('0x1a')](_0x2902('0x4b'),_0x2902('0x4c'));_0x281da5['recordingURL']=util[_0x2902('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x772fa6[_0x2902('0x48')],_0x281da5['uniqueid'],md5(_0x281da5[_0x2902('0x4d')]));}else{_0x281da5[_0x2902('0x4e')]='';}headers[_0x2902('0x4f')]=getAuth(_0x772fa6);return getUser(_0x772fa6,_0x182b8b[_0x2902('0x50')])[_0x2902('0x19')](function(_0x248b46){_0x28919c=_0x248b46;logger[_0x2902('0x1a')](_0x2902('0x51'),_0x28919c['id']);return getEndUser(_0x772fa6,_0x281da5[_0x2902('0x52')],_0x281da5[_0x2902('0x53')]);})[_0x2902('0x19')](function(_0x4861c7){_0x186ccb=_0x4861c7;logger[_0x2902('0x1a')](_0x2902('0x54'),_0x186ccb['id']);return getTicket(_0x772fa6,_0x28919c,_0x186ccb,_0x4172e0,_0x281da5);})['then'](function(_0x1539a2){if(_0x1539a2){logger[_0x2902('0x1a')](_0x2902('0x55'),_0x1539a2['id']);switch(_0x772fa6[_0x2902('0x3c')]){case _0x2902('0x56'):logger['info'](_0x2902('0x4b'),_0x2902('0x57'));return request({'uri':util[_0x2902('0xe')](_0x2902('0x58'),_0x772fa6[_0x2902('0x10')],_0x28919c['id'],_0x1539a2['id']),'method':_0x2902('0x11')});case _0x2902('0x59'):logger[_0x2902('0x1a')](_0x2902('0x4b'),_0x2902('0x5a'));emit(util[_0x2902('0xe')]('user:%s',_0x182b8b[_0x2902('0x14')]),_0x2902('0x5b'),{'uri':util[_0x2902('0xe')](_0x2902('0x5c'),_0x772fa6[_0x2902('0x10')][_0x2902('0x5d')](_0x2902('0x5e'),''),_0x1539a2['id'])});break;default:logger[_0x2902('0x5f')](_0x2902('0x4b'),_0x2902('0x60'));}}})[_0x2902('0x61')](function(_0x2f79ab){logger['error'](_0x2902('0x62'),util[_0x2902('0x63')](_0x2f79ab,{'showHidden':!![],'depth':null}));});};exports[_0x2902('0x64')]=function(_0x2b2c6e,_0x568625,_0x1abc16,_0xcd352d,_0x34afbb,_0x9090ef,_0x344327){var _0x16728d,_0x2f901f;_0x9090ef[_0x2902('0x10')]=intUtil['stripTrailingSlash'](_0x9090ef[_0x2902('0x10')]);_0x9090ef[_0x2902('0x48')]=intUtil['stripTrailingSlash'](_0x9090ef[_0x2902('0x48')]);if(_0x344327&&_0x344327['recordingFormat']&&_0x344327['recordingFormat']!==_0x2902('0x65')){logger['info'](_0x2902('0x66'),_0x2902('0x4c'));_0x568625[_0x2902('0x4e')]=util[_0x2902('0xe')](_0x2902('0x67'),_0x9090ef['serverUrl'],_0x568625[_0x2902('0x4d')],md5(_0x568625[_0x2902('0x4d')]));}headers[_0x2902('0x4f')]=getAuth(_0x9090ef);return getUser(_0x9090ef,_0xcd352d['email'])[_0x2902('0x19')](function(_0xadfbf8){_0x16728d=_0xadfbf8;logger[_0x2902('0x1a')]('The\x20User\x20ID\x20is:',_0x16728d['id']);return getEndUser(_0x9090ef,_0x568625[_0x2902('0x68')],_0x568625['destcalleridnum']);})[_0x2902('0x19')](function(_0x11930b){_0x2f901f=_0x11930b;logger['info'](_0x2902('0x54'),_0x2f901f['id']);return getTicket(_0x9090ef,_0x16728d,_0x2f901f,_0x1abc16,_0x568625);})[_0x2902('0x19')](function(_0x2921e1){if(_0x2921e1){logger[_0x2902('0x1a')]('The\x20Ticket\x20ID\x20is:',_0x2921e1['id']);switch(_0x9090ef[_0x2902('0x3c')]){case _0x2902('0x56'):logger['info'](_0x2902('0x66'),_0x2902('0x57'));return request({'uri':util[_0x2902('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x9090ef[_0x2902('0x10')],_0x16728d['id'],_0x2921e1['id']),'method':'POST'});case _0x2902('0x59'):logger[_0x2902('0x1a')](_0x2902('0x66'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2902('0xe')](_0x2902('0x69'),_0xcd352d[_0x2902('0x14')]),_0x2902('0x5b'),{'uri':util[_0x2902('0xe')](_0x2902('0x5c'),_0x9090ef[_0x2902('0x10')]['replace'](_0x2902('0x5e'),''),_0x2921e1['id'])});break;default:logger[_0x2902('0x5f')](_0x2902('0x66'),_0x2902('0x60'));}}})[_0x2902('0x61')](function(_0x5a6825){logger[_0x2902('0x5f')](_0x2902('0x6a'),util[_0x2902('0x63')](_0x5a6825,{'showHidden':!![],'depth':null}));});};exports[_0x2902('0x6b')]=function(_0x3c09ee,_0xae52ac,_0x40d27a,_0x1f90be,_0x5434e3,_0x5cea9b){var _0x1fb956,_0x46176b;_0x5cea9b['remoteUri']=intUtil[_0x2902('0x49')](_0x5cea9b['remoteUri']);_0x5cea9b[_0x2902('0x48')]=intUtil[_0x2902('0x49')](_0x5cea9b[_0x2902('0x48')]);if(_0x5434e3&&_0x5434e3[_0x2902('0x4a')]){logger[_0x2902('0x1a')]('['+_0xae52ac[_0x2902('0x6c')][_0x2902('0x6d')]()+']',_0x2902('0x4c'));_0xae52ac[_0x2902('0x4e')]=util[_0x2902('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5cea9b[_0x2902('0x48')],_0xae52ac[_0x2902('0x4d')],md5(_0xae52ac[_0x2902('0x4d')]));}else{_0xae52ac[_0x2902('0x4e')]='';}headers[_0x2902('0x4f')]=getAuth(_0x5cea9b);return getUser(_0x5cea9b)['then'](function(_0xaf4df1){_0x1fb956=_0xaf4df1;logger[_0x2902('0x1a')]('The\x20User\x20ID\x20is:',_0x1fb956['id']);return getEndUser(_0x5cea9b,_0xae52ac[_0x2902('0x52')],_0xae52ac[_0x2902('0x53')]);})[_0x2902('0x19')](function(_0x402854){_0x46176b=_0x402854;logger[_0x2902('0x1a')](_0x2902('0x54'),_0x46176b['id']);return getTicket(_0x5cea9b,_0x1fb956,_0x46176b,_0x40d27a,_0xae52ac);})[_0x2902('0x19')](function(_0x5e9176){if(_0x5e9176){logger[_0x2902('0x1a')](_0x2902('0x55'),_0x5e9176['id']);}})[_0x2902('0x61')](function(_0x13ada3){logger['error']('['+_0xae52ac[_0x2902('0x6c')][_0x2902('0x6d')]()+']'+_0x2902('0x6e'),util[_0x2902('0x63')](_0x13ada3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1b26=['serverUrl','monitor_format','[QUEUE]','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','integrationTab','error','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','format','remoteUri','POST','Tags','name','getString','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','Agent\x20found!','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','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','defaults','GET','map','includes','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','custom_fields','stripTrailingSlash'];(function(_0x43747e,_0x13b832){var _0x7fb853=function(_0x4b1028){while(--_0x4b1028){_0x43747e['push'](_0x43747e['shift']());}};_0x7fb853(++_0x13b832);}(_0x1b26,0x93));var _0x61b2=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1b26[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var rp=require(_0x61b2('0x0'));var md5=require('md5');var util=require(_0x61b2('0x1'));var Redis=require(_0x61b2('0x2'));var intUtil=require(_0x61b2('0x3'));var config=require('../../../../config/environment');var logger=require(_0x61b2('0x4'))(_0x61b2('0x5'));config[_0x61b2('0x6')]=_['defaults'](config[_0x61b2('0x6')],{'host':_0x61b2('0x7'),'port':0x18eb});var io=require(_0x61b2('0x8'))(new Redis(config[_0x61b2('0x6')]));function emit(_0x486c73,_0x259588,_0x59eee2){io['to'](_0x486c73)[_0x61b2('0x9')](_0x259588,_0x59eee2);}var headers={'Content-Type':_0x61b2('0xa'),'Accept':_0x61b2('0xa')};function getTicket(_0x4cabcb,_0x22a8a8,_0x4b5271,_0x20f6e8,_0x481aaa){logger[_0x61b2('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x61b2('0xc')]('%s/tickets.json',_0x4cabcb[_0x61b2('0xd')]),'method':_0x61b2('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x4b5271['id'],'submitter_id':_0x22a8a8?_0x22a8a8['id']:undefined,'assignee_id':_0x22a8a8?_0x22a8a8['id']:undefined,'tags':getTags(_0x20f6e8[_0x61b2('0xf')],_0x61b2('0x10')),'subject':intUtil[_0x61b2('0x11')](_0x20f6e8['Subjects'],_0x481aaa,'\x20'),'description':intUtil[_0x61b2('0x11')](_0x20f6e8[_0x61b2('0x12')],_0x481aaa,'\x0a'),'comment':{'public':![],'body':intUtil[_0x61b2('0x11')](_0x20f6e8[_0x61b2('0x12')],_0x481aaa,'\x0a')}},getCustomFields(_0x20f6e8[_0x61b2('0x13')],_0x481aaa))}})['then'](function(_0x251a9e){logger[_0x61b2('0xb')](_0x61b2('0x14'));return _0x251a9e[_0x61b2('0x15')];});}function getUser(_0xbafe5c,_0x4ac3ca){if(intUtil[_0x61b2('0x16')](_0x4ac3ca)){logger[_0x61b2('0xb')](_0x61b2('0x17'),_0x4ac3ca);return request({'uri':util['format'](_0x61b2('0x18'),_0xbafe5c[_0x61b2('0xd')]),'qs':{'query':util['format'](_0x61b2('0x19'),_0x4ac3ca)}})[_0x61b2('0x1a')](function(_0x395c51){if(_0x395c51['count']){logger[_0x61b2('0xb')](_0x61b2('0x1b'));return _[_0x61b2('0x1c')](_0x395c51[_0x61b2('0x1d')],{'email':_0x4ac3ca,'role':_0x61b2('0x1e')});}else{logger[_0x61b2('0xb')](_0x61b2('0x1f'));return request({'uri':util[_0x61b2('0xc')](_0x61b2('0x20'),_0xbafe5c[_0x61b2('0xd')])})[_0x61b2('0x1a')](function(_0x4eaeda){logger['info'](_0x61b2('0x21'));return _0x4eaeda['user'];});}});}else{logger[_0x61b2('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x61b2('0xc')](_0x61b2('0x20'),_0xbafe5c['remoteUri'])})[_0x61b2('0x1a')](function(_0x56f433){logger[_0x61b2('0xb')](_0x61b2('0x21'));return _0x56f433[_0x61b2('0x22')];});}}function getEndUser(_0x4e81cf,_0x5d787a,_0x3602dc){logger['info'](_0x61b2('0x23'),_0x3602dc);return request({'uri':util['format']('%s/search.json',_0x4e81cf['remoteUri']),'qs':{'query':util[_0x61b2('0xc')](_0x61b2('0x24'),_0x3602dc)}})[_0x61b2('0x1a')](function(_0x20a97c){var _0xe20414;if(_0x20a97c[_0x61b2('0x1d')]['length']){_0x20a97c[_0x61b2('0x1d')]=_['filter'](_0x20a97c[_0x61b2('0x1d')],{'suspended':![],'role':_0x61b2('0x25')});if(_0x20a97c[_0x61b2('0x1d')][_0x61b2('0x26')]){_0xe20414=_[_0x61b2('0x27')](_0x20a97c[_0x61b2('0x1d')]);}}if(_0xe20414){logger[_0x61b2('0xb')](_0x61b2('0x28'));return _0xe20414;}else{logger[_0x61b2('0xb')](_0x61b2('0x29'));return request({'uri':util['format']('%s/users.json',_0x4e81cf[_0x61b2('0xd')]),'method':_0x61b2('0xe'),'body':{'user':{'role':_0x61b2('0x25'),'name':util[_0x61b2('0xc')]('Caller\x20-\x20%s',_0x5d787a||_0x3602dc),'phone':_0x3602dc}}})['then'](function(_0x250c93){logger[_0x61b2('0xb')](_0x61b2('0x2a'));return _0x250c93[_0x61b2('0x22')];});}});}function getAuth(_0x2325c4){var _0x35e45e;if(_0x2325c4[_0x61b2('0x2b')]===_0x61b2('0x2c')){_0x35e45e=util[_0x61b2('0xc')]('%s:%s',_0x2325c4[_0x61b2('0x2d')],_0x2325c4[_0x61b2('0x2c')]);}else if(_0x2325c4[_0x61b2('0x2b')]===_0x61b2('0x2e')){_0x35e45e=util['format'](_0x61b2('0x2f'),_0x2325c4[_0x61b2('0x2d')],_0x2325c4[_0x61b2('0x2e')]);}return util[_0x61b2('0xc')](_0x61b2('0x30'),new Buffer(_0x35e45e)[_0x61b2('0x31')](_0x61b2('0x32')));}function request(_0x25a17d){logger[_0x61b2('0x33')](_0x61b2('0x34'),JSON['stringify'](_0x25a17d));return rp(_[_0x61b2('0x35')](_0x25a17d,{'method':_0x61b2('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x38e379,_0x292e19){var _0x48b025=[];if(_0x38e379&&_0x38e379['length']>0x0){_0x48b025=_[_0x61b2('0x37')](_0x38e379,_0x292e19);}return _0x48b025;}function getCustomFields(_0x296ecc,_0x224085){var _0x66d3dd=[];var _0x3212f5={'custom_fields':[]};if(_0x296ecc[_0x61b2('0x26')]>0x0){_['forEach'](_0x296ecc,function(_0x449de6){if(_[_0x61b2('0x38')](['string',_0x61b2('0x39')],_0x449de6[_0x61b2('0x3a')])&&_0x449de6[_0x61b2('0x3b')]&&!_0x449de6[_0x61b2('0x3c')]){_0x3212f5[_0x449de6[_0x61b2('0x3b')][_0x61b2('0x3d')]()]=_0x449de6[_0x61b2('0x3e')][_0x61b2('0x31')]();}else if(_[_0x61b2('0x38')](['string',_0x61b2('0x39')],_0x449de6[_0x61b2('0x3a')])&&_0x449de6[_0x61b2('0x3f')]&&_0x449de6[_0x61b2('0x3c')]){_0x3212f5['custom_fields']['push']({'id':_0x449de6['idField'],'value':_0x449de6[_0x61b2('0x3e')][_0x61b2('0x31')]()});}else if(_0x449de6['type']===_0x61b2('0x40')&&_0x449de6[_0x61b2('0x41')]&&_0x449de6[_0x61b2('0x3f')]&&_0x449de6[_0x61b2('0x3c')]){_0x224085[_0x449de6[_0x61b2('0x41')]]&&_0x3212f5['custom_fields'][_0x61b2('0x42')]({'id':_0x449de6['idField'],'value':_0x224085[_0x449de6[_0x61b2('0x41')]][_0x61b2('0x31')]()});}else if(_0x449de6[_0x61b2('0x3a')]===_0x61b2('0x43')&&_0x449de6[_0x61b2('0x44')]&&_0x449de6[_0x61b2('0x44')][_0x61b2('0x10')]&&_0x449de6[_0x61b2('0x3f')]&&_0x449de6[_0x61b2('0x3c')]){_0x224085[_0x449de6['Variable'][_0x61b2('0x10')][_0x61b2('0x3d')]()]&&_0x3212f5[_0x61b2('0x45')][_0x61b2('0x42')]({'id':_0x449de6['idField'],'value':_0x224085[_0x449de6[_0x61b2('0x44')]['name']['toLowerCase']()][_0x61b2('0x31')]()});}});}return _0x3212f5;}exports['queue']=function(_0x3e198f,_0x87634e,_0x56a5fd,_0x1ed1cd,_0x2040d0,_0x56645c){var _0xbecea4,_0x2341f8;_0x56645c[_0x61b2('0xd')]=intUtil[_0x61b2('0x46')](_0x56645c[_0x61b2('0xd')]);_0x56645c[_0x61b2('0x47')]=intUtil['stripTrailingSlash'](_0x56645c[_0x61b2('0x47')]);if(_0x2040d0&&_0x2040d0[_0x61b2('0x48')]){logger[_0x61b2('0xb')](_0x61b2('0x49'),'Recording\x20is\x20enabled!');_0x87634e['recordingURL']=util[_0x61b2('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56645c[_0x61b2('0x47')],_0x87634e[_0x61b2('0x4a')],md5(_0x87634e['uniqueid']));}else{_0x87634e['recordingURL']='';}headers[_0x61b2('0x4b')]=getAuth(_0x56645c);return getUser(_0x56645c,_0x1ed1cd[_0x61b2('0x4c')])[_0x61b2('0x1a')](function(_0x6be84a){_0xbecea4=_0x6be84a;logger[_0x61b2('0xb')](_0x61b2('0x4d'),_0xbecea4['id']);return getEndUser(_0x56645c,_0x87634e[_0x61b2('0x4e')],_0x87634e[_0x61b2('0x4f')]);})[_0x61b2('0x1a')](function(_0xc2fd3f){_0x2341f8=_0xc2fd3f;logger[_0x61b2('0xb')](_0x61b2('0x50'),_0x2341f8['id']);return getTicket(_0x56645c,_0xbecea4,_0x2341f8,_0x56a5fd,_0x87634e);})[_0x61b2('0x1a')](function(_0x5cd536){if(_0x5cd536){logger[_0x61b2('0xb')](_0x61b2('0x51'),_0x5cd536['id']);switch(_0x56645c['type']){case'integrationTab':logger[_0x61b2('0xb')]('[QUEUE]',_0x61b2('0x52'));return request({'uri':util[_0x61b2('0xc')](_0x61b2('0x53'),_0x56645c[_0x61b2('0xd')],_0xbecea4['id'],_0x5cd536['id']),'method':'POST'});case _0x61b2('0x54'):logger[_0x61b2('0xb')]('[QUEUE]',_0x61b2('0x55'));emit(util[_0x61b2('0xc')](_0x61b2('0x56'),_0x1ed1cd[_0x61b2('0x10')]),_0x61b2('0x57'),{'uri':util['format'](_0x61b2('0x58'),_0x56645c['remoteUri'][_0x61b2('0x59')](_0x61b2('0x5a'),''),_0x5cd536['id'])});break;default:logger['error'](_0x61b2('0x49'),_0x61b2('0x5b'));}}})['catch'](function(_0x24c79b){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x24c79b,{'showHidden':!![],'depth':null}));});};exports[_0x61b2('0x5c')]=function(_0x5d4893,_0x772e4f,_0x1704f6,_0x4c00e8,_0x528d5d,_0x3a9d9f,_0x31c0b0){var _0x521212,_0x41c706;_0x3a9d9f[_0x61b2('0xd')]=intUtil[_0x61b2('0x46')](_0x3a9d9f['remoteUri']);_0x3a9d9f[_0x61b2('0x47')]=intUtil[_0x61b2('0x46')](_0x3a9d9f[_0x61b2('0x47')]);if(_0x31c0b0&&_0x31c0b0[_0x61b2('0x5d')]&&_0x31c0b0[_0x61b2('0x5d')]!==_0x61b2('0x5e')){logger[_0x61b2('0xb')](_0x61b2('0x5f'),_0x61b2('0x60'));_0x772e4f[_0x61b2('0x61')]=util['format'](_0x61b2('0x62'),_0x3a9d9f[_0x61b2('0x47')],_0x772e4f[_0x61b2('0x4a')],md5(_0x772e4f[_0x61b2('0x4a')]));}headers[_0x61b2('0x4b')]=getAuth(_0x3a9d9f);return getUser(_0x3a9d9f,_0x4c00e8[_0x61b2('0x4c')])[_0x61b2('0x1a')](function(_0x2e7b97){_0x521212=_0x2e7b97;logger[_0x61b2('0xb')]('The\x20User\x20ID\x20is:',_0x521212['id']);return getEndUser(_0x3a9d9f,_0x772e4f[_0x61b2('0x63')],_0x772e4f[_0x61b2('0x64')]);})[_0x61b2('0x1a')](function(_0xca690d){_0x41c706=_0xca690d;logger[_0x61b2('0xb')](_0x61b2('0x50'),_0x41c706['id']);return getTicket(_0x3a9d9f,_0x521212,_0x41c706,_0x1704f6,_0x772e4f);})['then'](function(_0x2b1d28){if(_0x2b1d28){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2b1d28['id']);switch(_0x3a9d9f[_0x61b2('0x3a')]){case _0x61b2('0x65'):logger[_0x61b2('0xb')](_0x61b2('0x5f'),_0x61b2('0x52'));return request({'uri':util[_0x61b2('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3a9d9f['remoteUri'],_0x521212['id'],_0x2b1d28['id']),'method':_0x61b2('0xe')});case _0x61b2('0x54'):logger[_0x61b2('0xb')](_0x61b2('0x5f'),_0x61b2('0x55'));emit(util[_0x61b2('0xc')](_0x61b2('0x56'),_0x4c00e8[_0x61b2('0x10')]),_0x61b2('0x57'),{'uri':util[_0x61b2('0xc')]('%s/agent/tickets/%s',_0x3a9d9f[_0x61b2('0xd')][_0x61b2('0x59')](_0x61b2('0x5a'),''),_0x2b1d28['id'])});break;default:logger[_0x61b2('0x66')](_0x61b2('0x5f'),_0x61b2('0x5b'));}}})[_0x61b2('0x67')](function(_0x473060){logger[_0x61b2('0x66')](_0x61b2('0x68'),util['inspect'](_0x473060,{'showHidden':!![],'depth':null}));});};exports[_0x61b2('0x69')]=function(_0x561e37,_0x55ca47,_0x455fe8,_0xf1b2cf,_0x24ae2b,_0x5085cd){var _0x210603,_0x411c2b;_0x5085cd['remoteUri']=intUtil[_0x61b2('0x46')](_0x5085cd[_0x61b2('0xd')]);_0x5085cd['serverUrl']=intUtil['stripTrailingSlash'](_0x5085cd['serverUrl']);if(_0x24ae2b&&_0x24ae2b[_0x61b2('0x48')]){logger[_0x61b2('0xb')]('['+_0x55ca47[_0x61b2('0x6a')][_0x61b2('0x6b')]()+']',_0x61b2('0x60'));_0x55ca47[_0x61b2('0x61')]=util[_0x61b2('0xc')](_0x61b2('0x62'),_0x5085cd[_0x61b2('0x47')],_0x55ca47[_0x61b2('0x4a')],md5(_0x55ca47[_0x61b2('0x4a')]));}else{_0x55ca47[_0x61b2('0x61')]='';}headers['Authorization']=getAuth(_0x5085cd);return getUser(_0x5085cd)['then'](function(_0x5bd514){_0x210603=_0x5bd514;logger[_0x61b2('0xb')]('The\x20User\x20ID\x20is:',_0x210603['id']);return getEndUser(_0x5085cd,_0x55ca47[_0x61b2('0x4e')],_0x55ca47[_0x61b2('0x4f')]);})[_0x61b2('0x1a')](function(_0x35225f){_0x411c2b=_0x35225f;logger[_0x61b2('0xb')](_0x61b2('0x50'),_0x411c2b['id']);return getTicket(_0x5085cd,_0x210603,_0x411c2b,_0x455fe8,_0x55ca47);})[_0x61b2('0x1a')](function(_0x3fc2d8){if(_0x3fc2d8){logger[_0x61b2('0xb')](_0x61b2('0x51'),_0x3fc2d8['id']);}})[_0x61b2('0x67')](function(_0x1ed2cb){logger[_0x61b2('0x66')]('['+_0x55ca47['lastevent'][_0x61b2('0x6b')]()+']'+_0x61b2('0x6c'),util['inspect'](_0x1ed2cb,{'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 35c7888..2b3e30a 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 _0x46b3=['error','Failing\x20creating\x20the\x20access_token','stack','ActiveUsers','then','users','isArrayLikeObject','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','role','first_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','last_name','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','format','mm:ss','answertime','endtime','Call_Duration','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','merge','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','/downloads?type=uniqueid&token=','calleridnum','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','expires_in','catch'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x46b3,0x194));var _0x346b=function(_0x3e622d,_0x2a8d3c){_0x3e622d=_0x3e622d-0x0;var _0x9fa129=_0x46b3[_0x3e622d];return _0x9fa129;};'use strict';var _=require(_0x346b('0x0'));var rp=require(_0x346b('0x1'));var md5=require(_0x346b('0x2'));var util=require(_0x346b('0x3'));var intUtil=require(_0x346b('0x4'));var moment=require('moment');var Redis=require(_0x346b('0x5'));var BPromise=require(_0x346b('0x6'));var config=require(_0x346b('0x7'));var logger=require(_0x346b('0x8'))(_0x346b('0x9'));config['redis']=_[_0x346b('0xa')](config[_0x346b('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x346b('0xc'))(new Redis(config[_0x346b('0xb')]));function emit(_0x527854,_0x375833,_0x8d430){io['to'](_0x527854)[_0x346b('0xd')](_0x375833,_0x8d430);}function request(_0x447beb){logger[_0x346b('0xe')](_0x346b('0xf'),JSON[_0x346b('0x10')](_0x447beb));return rp(_0x447beb);}function getCustomFields(_0x37920c,_0x378423){var _0x4c6372={};if(_0x37920c[_0x346b('0x11')]>0x0){_[_0x346b('0x12')](_0x37920c,function(_0x552eec){if(_[_0x346b('0x13')]([_0x346b('0x14'),'picklist'],_0x552eec[_0x346b('0x15')])&&_0x552eec[_0x346b('0x16')]){_0x4c6372[_0x552eec['idField']]=_0x552eec['content'][_0x346b('0x17')]();}else if(_0x552eec[_0x346b('0x15')]===_0x346b('0x18')&&_0x552eec[_0x346b('0x19')]&&_0x552eec[_0x346b('0x16')]&&_0x378423[_0x552eec[_0x346b('0x19')]]){_0x4c6372[_0x552eec[_0x346b('0x16')]]=_0x378423[_0x552eec[_0x346b('0x19')]][_0x346b('0x17')]();}else if(_0x552eec[_0x346b('0x15')]==='customVariable'&&_0x552eec[_0x346b('0x1a')]&&_0x552eec['Variable'][_0x346b('0x1b')]&&_0x552eec[_0x346b('0x16')]&&_0x378423[_0x552eec[_0x346b('0x1a')]['name']['toLowerCase']()]){_0x4c6372[_0x552eec[_0x346b('0x16')]]=_0x378423[_0x552eec['Variable'][_0x346b('0x1b')][_0x346b('0x1c')]()][_0x346b('0x17')]();}});}return _0x4c6372;}function getName(_0x2e26c1){if(_0x2e26c1[_0x346b('0x1d')]('\x20')>0x0){var _0x3db379=_0x2e26c1['split'](/ (.+)/);if(_0x3db379[0x1]){return _0x3db379;}}return[_0x2e26c1,_0x2e26c1];}var accountsTokens={};function getAccessToken(_0x1e2647){return new Promise(function(_0x261734,_0x47d8ab){if(!_['isNil'](accountsTokens[_0x1e2647['id']])&&!_[_0x346b('0x1e')](accountsTokens[_0x1e2647['id']][_0x346b('0x1f')])){if(moment()[_0x346b('0x20')](accountsTokens[_0x1e2647['id']]['expires_in'])){_0x261734(accountsTokens[_0x1e2647['id']][_0x346b('0x1f')]);}}var _0x369096;switch(_0x1e2647[_0x346b('0x21')]){case'US':_0x369096='https://accounts.zoho.com';break;case'AU':_0x369096=_0x346b('0x22');break;case'EU':_0x369096='https://accounts.zoho.eu';break;case'IN':_0x369096=_0x346b('0x23');break;case'CN':_0x369096='https://accounts.zoho.com.cn';break;default:_0x369096=_0x346b('0x24');break;}var _0x1ddc11={'method':_0x346b('0x25'),'uri':_0x369096+_0x346b('0x26'),'qs':{'refresh_token':_0x1e2647['refreshToken'],'client_id':_0x1e2647[_0x346b('0x27')],'client_secret':_0x1e2647[_0x346b('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1ddc11)['then'](function(_0xbcdb3c){accountsTokens[_0x1e2647['id']]={'access_token':_0xbcdb3c[_0x346b('0x1f')],'expires_in':moment()['add'](_0xbcdb3c[_0x346b('0x29')],'seconds')};_0x261734(_0xbcdb3c[_0x346b('0x1f')]);})[_0x346b('0x2a')](function(_0xbf158){logger[_0x346b('0x2b')](_0x346b('0x2c'),_0xbf158[_0x346b('0x2d')]);_0x47d8ab(_0xbf158);});});}function getUser(_0x5d19e2,_0x1d6ba1,_0x18ab90,_0x30aea4){logger['info']('Search\x20user');return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x1d6ba1),'qs':{'type':_0x346b('0x2e')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d19e2},'json':!![]})[_0x346b('0x2f')](function(_0x2043e5){if(_0x2043e5[_0x346b('0x30')]){var _0x3b81b7=-0x1;if(_[_0x346b('0x31')](_0x2043e5[_0x346b('0x30')])){if(!_[_0x346b('0x1e')](_0x30aea4)){_0x3b81b7=_['findIndex'](_0x2043e5['users'],function(_0xbe772f){return _0xbe772f[_0x346b('0x32')]===_0x30aea4;});}if(_0x3b81b7>=0x0){logger[_0x346b('0x33')](_0x346b('0x34'));}else{logger['info'](_0x346b('0x35'));_0x3b81b7=_[_0x346b('0x36')](_0x2043e5['users'],function(_0x462dac){return _0x462dac[_0x346b('0x37')][_0x346b('0x1b')]==='Administrator';});}return _0x2043e5[_0x346b('0x30')][_0x3b81b7];}else{if(_0x2043e5['user'][_0x346b('0x37')][_0x346b('0x1b')]===_0x346b('0x38')){logger[_0x346b('0x33')](_0x346b('0x35'));user=_0x2043e5[_0x346b('0x39')];return user;}else{logger[_0x346b('0x2b')](_0x346b('0x3a'),JSON['stringify'](_0x2043e5));throw new Error(_0x346b('0x3b')+JSON['stringify'](_0x2043e5));}}}else{logger[_0x346b('0x2b')](_0x346b('0x3a'),JSON[_0x346b('0x10')](_0x2043e5));throw new Error(_0x346b('0x3b')+JSON[_0x346b('0x10')](_0x2043e5));}})[_0x346b('0x2a')](function(_0x51db43){console[_0x346b('0x2b')](_0x51db43);});}function getZohoUser(_0x7c9aaf,_0x3f7be1){return new BPromise(function(_0x53e5de,_0x1fcb31){request(_0x7c9aaf)['then'](function(_0x5e82f5){var _0x1470e4=null;if(_0x5e82f5){_0x1470e4=_0x5e82f5[_0x346b('0x3c')][0x0];_0x1470e4[_0x346b('0x3d')]=_0x3f7be1;}_0x53e5de(_0x1470e4);})['catch'](function(_0x138d48){_0x1fcb31(_0x138d48);});});}function createEndUser(_0x27d6c6,_0x5e7034,_0x5742f4,_0x24bff1,_0x3b47e6,_0x384ae3){var _0x5742f4=getName(_0x5742f4);return request({'method':'POST','uri':_0x346b('0x3e')+_0x5e7034+'/crm/v2/'+_[_0x346b('0x3f')](_0x384ae3['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5742f4[0x1],'First_Name':_0x5742f4[0x0],'Phone':_0x24bff1,'Owner':{'name':!_[_0x346b('0x1e')](_0x3b47e6[_0x346b('0x40')][_0x346b('0x1b')])?_0x3b47e6['role']['name']:!_[_0x346b('0x1e')](_0x3b47e6['first_name'])?_0x3b47e6[_0x346b('0x41')]+'\x20'+_0x3b47e6['last_name']:_0x3b47e6['last_name'],'id':_0x3b47e6['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x27d6c6},'json':!![]})[_0x346b('0x2f')](function(_0x5ddecf){if(_0x5ddecf&&_0x5ddecf[_0x346b('0x3c')][0x0][_0x346b('0x42')]===_0x346b('0x43')){var _0x544099=_0x5ddecf[_0x346b('0x3c')][0x0][_0x346b('0x44')];_0x544099[_0x346b('0x3d')]=_['startCase'](_0x384ae3[_0x346b('0x45')])+'s';return _0x544099;}logger[_0x346b('0x2b')](_0x346b('0x3a'),JSON['stringify'](data));throw new Error(_0x346b('0x46')+JSON[_0x346b('0x10')](data));})['catch'](function(_0x4517ea){console[_0x346b('0x47')]('CREATE\x20ERROR',_0x4517ea);});}function getEndUser(_0x5083cf,_0x519136,_0x59ce8b,_0x4fe8f6,_0x4cdf70,_0x5dd069,_0x327c9a){var _0x48fc11={'method':'GET','uri':'','headers':{'Authorization':_0x346b('0x48')+_0x5083cf},'json':!![]};switch(_0x327c9a[_0x346b('0x49')]){case _0x346b('0x4a'):_0x48fc11[_0x346b('0x4b')]=_0x346b('0x3e')+_0x519136+_0x346b('0x4c')+_0x4cdf70+'))';return getZohoUser(_0x48fc11,_0x346b('0x4d'))[_0x346b('0x2f')](function(_0x53b3a9){if(_0x53b3a9)return _0x53b3a9;_0x48fc11[_0x346b('0x4b')]=_0x346b('0x3e')+_0x519136+_0x346b('0x4e')+_0x4cdf70+'))';return getZohoUser(_0x48fc11,'Leads')['then'](function(_0x4f84be){if(_0x4f84be)return _0x4f84be;if(_0x327c9a[_0x346b('0x45')]!=_0x346b('0x4f')){return createEndUser(_0x5083cf,_0x519136,_0x4fe8f6,_0x4cdf70,_0x5dd069,_0x327c9a);}else{return{};}});});break;case'contact':_0x48fc11[_0x346b('0x4b')]=_0x346b('0x3e')+_0x519136+_0x346b('0x4c')+_0x4cdf70+'))';return getZohoUser(_0x48fc11,_0x346b('0x4d'))[_0x346b('0x2f')](function(_0xa66b0d){if(_0xa66b0d)return _0xa66b0d;if(_0x327c9a[_0x346b('0x45')]!=_0x346b('0x4f')){return createEndUser(_0x5083cf,_0x519136,_0x4fe8f6,_0x4cdf70,_0x5dd069,_0x327c9a);}else{return{};}});break;case _0x346b('0x50'):_0x48fc11[_0x346b('0x4b')]=_0x346b('0x3e')+_0x519136+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4cdf70+'))';return getZohoUser(_0x48fc11,_0x346b('0x51'))[_0x346b('0x2f')](function(_0x25c1b5){if(_0x25c1b5)return _0x25c1b5;if(_0x327c9a[_0x346b('0x45')]!=_0x346b('0x4f')){return createEndUser(_0x5083cf,_0x519136,_0x4fe8f6,_0x4cdf70,_0x5dd069,_0x327c9a);}else{return{};}});break;}}function getCall(_0x26a95f,_0xd38265,_0x25f5b2,_0xd31ff8,_0x484b5f,_0x4d678c,_0x5d1775,_0x587425){logger[_0x346b('0x33')](_0x346b('0x52'));var _0x438e69={};_0x438e69[_0x346b('0x53')]={'name':!_[_0x346b('0x1e')](_0xd31ff8[_0x346b('0x40')][_0x346b('0x1b')])&&!_[_0x346b('0x1e')](_0xd31ff8[_0x346b('0x37')][_0x346b('0x1b')])&&_0xd31ff8[_0x346b('0x37')][_0x346b('0x1b')]===_0x346b('0x54')?_0xd31ff8[_0x346b('0x40')][_0x346b('0x1b')]:!_[_0x346b('0x1e')](_0xd31ff8[_0x346b('0x41')])?_0xd31ff8['first_name']+'\x20'+_0xd31ff8['last_name']:_0xd31ff8[_0x346b('0x55')],'id':_0xd31ff8['id']};_0x438e69['Subject']=intUtil[_0x346b('0x56')](_0x4d678c['Subjects'],_0x5d1775,'\x20');_0x438e69[_0x346b('0x57')]=intUtil[_0x346b('0x56')](_0x4d678c[_0x346b('0x58')],_0x5d1775,'\x0a');if(_0x484b5f[_0x346b('0x3d')]===_0x346b('0x4d')){_0x438e69[_0x346b('0x59')]={'name':!_[_0x346b('0x1e')](_0x484b5f[_0x346b('0x5a')])?_0x484b5f[_0x346b('0x5a')]:!_[_0x346b('0x1e')](_0x484b5f[_0x346b('0x5b')])?_0x484b5f[_0x346b('0x5b')]+'\x20'+_0x484b5f[_0x346b('0x5c')]:_0x484b5f[_0x346b('0x5c')],'id':_0x484b5f['id']};}if(_0x484b5f['enduserType']===_0x346b('0x51')){_0x438e69['What_Id']={'name':!_[_0x346b('0x1e')](_0x484b5f[_0x346b('0x5a')])?_0x484b5f[_0x346b('0x5a')]:!_[_0x346b('0x1e')](_0x484b5f[_0x346b('0x5b')])?_0x484b5f[_0x346b('0x5b')]+'\x20'+_0x484b5f[_0x346b('0x5c')]:_0x484b5f['Last_Name'],'id':_0x484b5f['id']};_0x438e69[_0x346b('0x5d')]=_[_0x346b('0x3f')](_0x484b5f[_0x346b('0x3d')]);}if(_0x5d1775['talktime']){_0x438e69['Call_Duration']=moment['utc'](parseInt(_0x5d1775['talktime'])*0x3e8)[_0x346b('0x5e')](_0x346b('0x5f'));}else if(_0x5d1775[_0x346b('0x60')]&&_0x5d1775[_0x346b('0x61')]){_0x438e69[_0x346b('0x62')]=moment[_0x346b('0x63')](moment(_0x5d1775['endtime'],_0x346b('0x64'))[_0x346b('0x65')](moment(_0x5d1775[_0x346b('0x66')],_0x346b('0x64'))))['format'](_0x346b('0x5f'));}switch(_0x5d1775[_0x346b('0x67')]){case _0x346b('0x68'):_0x438e69['Call_Result']=_0x346b('0x69');break;case _0x346b('0x6a'):case'connect':_0x438e69[_0x346b('0x6b')]=_0x346b('0x6c');break;case _0x346b('0x6d'):_0x438e69[_0x346b('0x6b')]=_0x346b('0x6e');break;case _0x346b('0x6f'):_0x438e69['Call_Result']=_0x346b('0x70');break;case _0x346b('0x71'):_0x438e69[_0x346b('0x6b')]=_0x346b('0x72');default:}_0x438e69[_0x346b('0x73')]=(_0x587425===_0x346b('0x74')?moment(_0x5d1775[_0x346b('0x66')])[_0x346b('0x5e')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5d1775['agentcalledAt'])[_0x346b('0x5e')](_0x346b('0x64')))||moment()['format'](_0x346b('0x64'));_0x438e69[_0x346b('0x75')]=_0x587425||'Inbound';_0x438e69=_[_0x346b('0x76')](_0x438e69,getCustomFields(_0x4d678c['Fields'],_0x5d1775));return request({'method':'POST','uri':_0x346b('0x3e')+_0xd38265+_0x346b('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x26a95f},'body':{'data':[_0x438e69]},'json':!![]})[_0x346b('0x2f')](function(_0x84b939){if(_0x84b939&&_0x84b939[_0x346b('0x3c')][0x0]['code']===_0x346b('0x43')){logger[_0x346b('0x33')]('Call\x20created!');return{'id':_0x84b939[_0x346b('0x3c')][0x0][_0x346b('0x44')]['id']};}})[_0x346b('0x2a')](function(_0x159544){logger[_0x346b('0x33')](_0x346b('0x78'),_0x159544[_0x346b('0x2d')]);console[_0x346b('0x47')]('err',_0x159544);});}exports[_0x346b('0x79')]=function(_0x25d378,_0x467681,_0x5a23e8,_0x121c5f,_0x2a8ff1,_0x18a7f1){var _0x57cffb,_0x53e7dd,_0x24b012;_0x18a7f1[_0x346b('0x7a')]=intUtil[_0x346b('0x7b')](_0x18a7f1[_0x346b('0x7a')]);_0x18a7f1[_0x346b('0x7c')]=intUtil[_0x346b('0x7b')](_0x18a7f1['serverUrl']);if(_0x2a8ff1&&_0x2a8ff1[_0x346b('0x7d')]){logger[_0x346b('0x33')](_0x346b('0x7e'),_0x346b('0x7f'));_0x467681[_0x346b('0x80')]=_0x18a7f1['serverUrl']+_0x346b('0x81')+_0x467681[_0x346b('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x467681['uniqueid']);}else{_0x467681['recordingURL']='';}var _0x2227f0=_0x18a7f1['host']===_0x346b('0x83')?'eu':_0x346b('0x84');return getAccessToken(_0x18a7f1)['then'](function(_0x3fe60e){_0x24b012=_0x3fe60e;return getUser(_0x24b012,_0x2227f0,_0x18a7f1,_0x121c5f['email']);})[_0x346b('0x2f')](function(_0x2cb52f){_0x57cffb=_0x2cb52f;logger['info'](_0x346b('0x85'),_0x57cffb['id']);return getEndUser(_0x24b012,_0x2227f0,_0x18a7f1,_0x467681[_0x346b('0x86')],_0x467681['calleridnum'],_0x57cffb,_0x5a23e8);})[_0x346b('0x2f')](function(_0x2f7faf){_0x53e7dd=_0x2f7faf;return getCall(_0x24b012,_0x2227f0,_0x18a7f1,_0x57cffb,_0x53e7dd,_0x5a23e8,_0x467681,'Inbound');})['then'](function(_0x9acdbe){if(_0x9acdbe){logger[_0x346b('0x33')](_0x346b('0x87'),_0x9acdbe['id']);logger[_0x346b('0x33')](_0x346b('0x7e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x346b('0x5e')](_0x346b('0x88'),_0x121c5f[_0x346b('0x1b')]),_0x346b('0x89'),{'uri':_0x346b('0x8a')+_0x18a7f1['host']+_0x346b('0x8b')+_0x9acdbe['id']});}})[_0x346b('0x2a')](function(_0x619df6){logger['error']('[QUEUE]',JSON['stringify'](_0x619df6));});};exports[_0x346b('0x74')]=function(_0x17c1ec,_0x1b8619,_0x34aac3,_0x390d6c,_0x1635fa,_0x57ae09,_0x3a9d54){var _0x1187ea,_0x2712c7,_0x3f0f5f;_0x57ae09['host']=intUtil[_0x346b('0x7b')](_0x57ae09['host']);_0x57ae09[_0x346b('0x7c')]=intUtil[_0x346b('0x7b')](_0x57ae09[_0x346b('0x7c')]);if(_0x3a9d54&&_0x3a9d54['recordingFormat']&&_0x3a9d54['recordingFormat']!=='none'){logger[_0x346b('0x33')](_0x346b('0x8c'),_0x346b('0x7f'));_0x1b8619[_0x346b('0x80')]=_0x57ae09['serverUrl']+_0x346b('0x81')+_0x1b8619[_0x346b('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x1b8619[_0x346b('0x82')]);}var _0x778aa=_0x57ae09[_0x346b('0x7a')]==='zoho.eu'?'eu':_0x346b('0x84');return getAccessToken(_0x57ae09)[_0x346b('0x2f')](function(_0x3625de){_0x3f0f5f=_0x3625de;return getUser(_0x3f0f5f,_0x778aa,_0x57ae09,_0x390d6c[_0x346b('0x32')]);})['then'](function(_0x166529){_0x1187ea=_0x166529;logger['info'](_0x346b('0x85'),_0x1187ea['id']);return getEndUser(_0x3f0f5f,_0x778aa,_0x57ae09,_0x1b8619[_0x346b('0x8d')],_0x1b8619[_0x346b('0x8e')],_0x1187ea,_0x34aac3);})['then'](function(_0x596102){_0x2712c7=_0x596102;return getCall(_0x3f0f5f,_0x778aa,_0x57ae09,_0x1187ea,_0x2712c7,_0x34aac3,_0x1b8619,_0x346b('0x8f'));})['then'](function(_0x56eedd){if(_0x56eedd){logger['info'](_0x346b('0x87'),_0x56eedd['id']);logger[_0x346b('0x33')](_0x346b('0x8c'),_0x346b('0x90'));emit(util[_0x346b('0x5e')](_0x346b('0x88'),_0x390d6c[_0x346b('0x1b')]),_0x346b('0x89'),{'uri':_0x346b('0x8a')+_0x57ae09[_0x346b('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0x56eedd['id']});}})[_0x346b('0x2a')](function(_0x3249dc){logger[_0x346b('0x2b')](_0x346b('0x8c'),JSON[_0x346b('0x10')](_0x3249dc));});};exports[_0x346b('0x91')]=function(_0x4519d1,_0x30001e,_0x3d0e6b,_0x4f4a1e,_0x553faa,_0x3790de){var _0x983053,_0x24ceb4,_0x402576;_0x3790de[_0x346b('0x7a')]=intUtil[_0x346b('0x7b')](_0x3790de[_0x346b('0x7a')]);_0x3790de[_0x346b('0x7c')]=intUtil['stripTrailingSlash'](_0x3790de[_0x346b('0x7c')]);if(_0x553faa&&_0x553faa[_0x346b('0x7d')]){logger[_0x346b('0x33')]('['+_0x30001e['lastevent'][_0x346b('0x92')]()+']','Recording\x20is\x20enabled!');_0x30001e['recordingURL']=_0x3790de[_0x346b('0x7c')]+_0x346b('0x81')+_0x30001e[_0x346b('0x82')]+_0x346b('0x93')+md5(_0x30001e['uniqueid']);}else{_0x30001e[_0x346b('0x80')]='';}var _0x1b153c=_0x3790de['host']===_0x346b('0x83')?'eu':_0x346b('0x84');return getAccessToken(_0x3790de)['then'](function(_0x1cec0f){_0x402576=_0x1cec0f;return getUser(_0x402576,_0x1b153c,_0x3790de);})[_0x346b('0x2f')](function(_0x482ffc){_0x983053=_0x482ffc;logger[_0x346b('0x33')](_0x346b('0x85'),_0x983053['id']);return getEndUser(_0x402576,_0x1b153c,_0x3790de,_0x30001e[_0x346b('0x86')],_0x30001e[_0x346b('0x94')],_0x983053,_0x3d0e6b);})[_0x346b('0x2f')](function(_0x21b5d5){_0x24ceb4=_0x21b5d5;return getCall(_0x402576,_0x1b153c,_0x3790de,_0x983053,_0x24ceb4,_0x3d0e6b,_0x30001e,'Inbound');})['then'](function(_0x546152){if(_0x546152){logger[_0x346b('0x33')](_0x346b('0x87'),_0x546152['id']);}})['catch'](function(_0x50bf4a){logger['error']('['+_0x30001e[_0x346b('0x67')][_0x346b('0x92')]()+']',JSON[_0x346b('0x10')](_0x50bf4a));});}; \ No newline at end of file +var _0x3236=['stack','Search\x20user','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','info','Agent\x20found!','findIndex','profile','Administrator','user','Using\x20the\x20admin\x20account!','stringify','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','data','code','SUCCESS','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','lead','nothing','Creating\x20new\x20call...','Owner','Subject','getString','Description','Descriptions','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','Call_Duration','utc','talktime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','complete','connect','rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Call\x20created!','details','err','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','host','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','recordingURL','com','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','[HTTP]','length','forEach','includes','string','picklist','type','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3236,0x69));var _0x6323=function(_0x4d3bb5,_0xa55380){_0x4d3bb5=_0x4d3bb5-0x0;var _0x2ee6ed=_0x3236[_0x4d3bb5];return _0x2ee6ed;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x6323('0x0'));var util=require(_0x6323('0x1'));var intUtil=require('./util');var moment=require(_0x6323('0x2'));var Redis=require(_0x6323('0x3'));var BPromise=require('bluebird');var config=require(_0x6323('0x4'));var logger=require(_0x6323('0x5'))('zoho');config[_0x6323('0x6')]=_['defaults'](config[_0x6323('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6323('0x7'))(new Redis(config['redis']));function emit(_0x2c7810,_0x33e99c,_0x444da3){io['to'](_0x2c7810)['emit'](_0x33e99c,_0x444da3);}function request(_0x39d751){logger['debug'](_0x6323('0x8'),JSON['stringify'](_0x39d751));return rp(_0x39d751);}function getCustomFields(_0x31c866,_0x1b56b6){var _0x4b89f4={};if(_0x31c866[_0x6323('0x9')]>0x0){_[_0x6323('0xa')](_0x31c866,function(_0x53f0d8){if(_[_0x6323('0xb')]([_0x6323('0xc'),_0x6323('0xd')],_0x53f0d8[_0x6323('0xe')])&&_0x53f0d8[_0x6323('0xf')]){_0x4b89f4[_0x53f0d8[_0x6323('0xf')]]=_0x53f0d8[_0x6323('0x10')]['toString']();}else if(_0x53f0d8[_0x6323('0xe')]==='variable'&&_0x53f0d8[_0x6323('0x11')]&&_0x53f0d8[_0x6323('0xf')]&&_0x1b56b6[_0x53f0d8[_0x6323('0x11')]]){_0x4b89f4[_0x53f0d8['idField']]=_0x1b56b6[_0x53f0d8[_0x6323('0x11')]][_0x6323('0x12')]();}else if(_0x53f0d8[_0x6323('0xe')]===_0x6323('0x13')&&_0x53f0d8[_0x6323('0x14')]&&_0x53f0d8['Variable']['name']&&_0x53f0d8[_0x6323('0xf')]&&_0x1b56b6[_0x53f0d8[_0x6323('0x14')][_0x6323('0x15')][_0x6323('0x16')]()]){_0x4b89f4[_0x53f0d8['idField']]=_0x1b56b6[_0x53f0d8['Variable']['name']['toLowerCase']()][_0x6323('0x12')]();}});}return _0x4b89f4;}function getName(_0x304474){if(_0x304474[_0x6323('0x17')]('\x20')>0x0){var _0x58a484=_0x304474[_0x6323('0x18')](/ (.+)/);if(_0x58a484[0x1]){return _0x58a484;}}return[_0x304474,_0x304474];}var accountsTokens={};function getAccessToken(_0x37256c){return new Promise(function(_0x9c28e2,_0x202972){if(!_[_0x6323('0x19')](accountsTokens[_0x37256c['id']])&&!_[_0x6323('0x19')](accountsTokens[_0x37256c['id']][_0x6323('0x1a')])){if(moment()[_0x6323('0x1b')](accountsTokens[_0x37256c['id']][_0x6323('0x1c')])){_0x9c28e2(accountsTokens[_0x37256c['id']][_0x6323('0x1a')]);}}var _0x4cdfbc;switch(_0x37256c[_0x6323('0x1d')]){case'US':_0x4cdfbc=_0x6323('0x1e');break;case'AU':_0x4cdfbc=_0x6323('0x1f');break;case'EU':_0x4cdfbc='https://accounts.zoho.eu';break;case'IN':_0x4cdfbc='https://accounts.zoho.in';break;case'CN':_0x4cdfbc=_0x6323('0x20');break;default:_0x4cdfbc='https://accounts.zoho.eu';break;}var _0x46d7b5={'method':_0x6323('0x21'),'uri':_0x4cdfbc+_0x6323('0x22'),'qs':{'refresh_token':_0x37256c[_0x6323('0x23')],'client_id':_0x37256c[_0x6323('0x24')],'client_secret':_0x37256c[_0x6323('0x25')],'grant_type':_0x6323('0x26')},'json':!![]};return rp(_0x46d7b5)[_0x6323('0x27')](function(_0x22d777){accountsTokens[_0x37256c['id']]={'access_token':_0x22d777['access_token'],'expires_in':moment()[_0x6323('0x28')](_0x22d777[_0x6323('0x1c')],_0x6323('0x29'))};_0x9c28e2(_0x22d777[_0x6323('0x1a')]);})[_0x6323('0x2a')](function(_0x188088){logger[_0x6323('0x2b')](_0x6323('0x2c'),_0x188088[_0x6323('0x2d')]);_0x202972(_0x188088);});});}function getUser(_0x210eaf,_0x3956bb,_0x33110e,_0x4985c3){logger['info'](_0x6323('0x2e'));return request({'method':'GET','uri':util[_0x6323('0x2f')]('https://www.zohoapis.%s/crm/v2/users',_0x3956bb),'qs':{'type':_0x6323('0x30')},'headers':{'Authorization':_0x6323('0x31')+_0x210eaf},'json':!![]})[_0x6323('0x27')](function(_0x402a9a){if(_0x402a9a[_0x6323('0x32')]){var _0x544b55=-0x1;if(_[_0x6323('0x33')](_0x402a9a['users'])){if(!_[_0x6323('0x19')](_0x4985c3)){_0x544b55=_['findIndex'](_0x402a9a[_0x6323('0x32')],function(_0x447866){return _0x447866[_0x6323('0x34')]===_0x4985c3;});}if(_0x544b55>=0x0){logger[_0x6323('0x35')](_0x6323('0x36'));}else{logger[_0x6323('0x35')]('Using\x20the\x20admin\x20account!');_0x544b55=_[_0x6323('0x37')](_0x402a9a[_0x6323('0x32')],function(_0x11a760){return _0x11a760[_0x6323('0x38')]['name']===_0x6323('0x39');});}return _0x402a9a[_0x6323('0x32')][_0x544b55];}else{if(_0x402a9a[_0x6323('0x3a')][_0x6323('0x38')]['name']==='Administrator'){logger[_0x6323('0x35')](_0x6323('0x3b'));user=_0x402a9a[_0x6323('0x3a')];return user;}else{logger[_0x6323('0x2b')]('The\x20failing\x20result\x20is',JSON[_0x6323('0x3c')](_0x402a9a));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x6323('0x3c')](_0x402a9a));}}}else{logger[_0x6323('0x2b')](_0x6323('0x3d'),JSON[_0x6323('0x3c')](_0x402a9a));throw new Error(_0x6323('0x3e')+JSON[_0x6323('0x3c')](_0x402a9a));}})[_0x6323('0x2a')](function(_0x2a67b4){console[_0x6323('0x2b')](_0x2a67b4);});}function getZohoUser(_0x28b77f,_0x3af2e9){return new BPromise(function(_0x14e494,_0x19add0){request(_0x28b77f)[_0x6323('0x27')](function(_0x533d46){var _0x53df2e=null;if(_0x533d46){_0x53df2e=_0x533d46['data'][0x0];_0x53df2e[_0x6323('0x3f')]=_0x3af2e9;}_0x14e494(_0x53df2e);})[_0x6323('0x2a')](function(_0x958e7c){_0x19add0(_0x958e7c);});});}function createEndUser(_0x4bfb08,_0x2beefa,_0x1984a1,_0x24d048,_0x3f8fc8,_0x5176f2){var _0x1984a1=getName(_0x1984a1);return request({'method':'POST','uri':_0x6323('0x40')+_0x2beefa+_0x6323('0x41')+_['startCase'](_0x5176f2[_0x6323('0x42')])+'s','body':{'data':[{'Last_Name':_0x1984a1[0x1],'First_Name':_0x1984a1[0x0],'Phone':_0x24d048,'Owner':{'name':!_['isNil'](_0x3f8fc8[_0x6323('0x43')][_0x6323('0x15')])?_0x3f8fc8[_0x6323('0x43')]['name']:!_[_0x6323('0x19')](_0x3f8fc8[_0x6323('0x44')])?_0x3f8fc8[_0x6323('0x44')]+'\x20'+_0x3f8fc8[_0x6323('0x45')]:_0x3f8fc8[_0x6323('0x45')],'id':_0x3f8fc8['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4bfb08},'json':!![]})[_0x6323('0x27')](function(_0x8454bc){if(_0x8454bc&&_0x8454bc[_0x6323('0x46')][0x0][_0x6323('0x47')]===_0x6323('0x48')){var _0x588b51=_0x8454bc['data'][0x0]['details'];_0x588b51[_0x6323('0x3f')]=_[_0x6323('0x49')](_0x5176f2[_0x6323('0x42')])+'s';return _0x588b51;}logger[_0x6323('0x2b')]('The\x20failing\x20result\x20is',JSON[_0x6323('0x3c')](data));throw new Error(_0x6323('0x4a')+JSON[_0x6323('0x3c')](data));})[_0x6323('0x2a')](function(_0x2515d0){console[_0x6323('0x4b')](_0x6323('0x4c'),_0x2515d0);});}function getEndUser(_0x979aa8,_0x44bd30,_0x534c93,_0x20d846,_0x544126,_0x1def87,_0x30bdf1){var _0x5e6281={'method':'GET','uri':'','headers':{'Authorization':_0x6323('0x31')+_0x979aa8},'json':!![]};switch(_0x30bdf1[_0x6323('0x4d')]){case _0x6323('0x4e'):_0x5e6281[_0x6323('0x4f')]='https://www.zohoapis.'+_0x44bd30+_0x6323('0x50')+_0x544126+'))';return getZohoUser(_0x5e6281,_0x6323('0x51'))[_0x6323('0x27')](function(_0xe5856c){if(_0xe5856c)return _0xe5856c;_0x5e6281[_0x6323('0x4f')]=_0x6323('0x40')+_0x44bd30+_0x6323('0x52')+_0x544126+'))';return getZohoUser(_0x5e6281,_0x6323('0x53'))[_0x6323('0x27')](function(_0x2cdd5b){if(_0x2cdd5b)return _0x2cdd5b;if(_0x30bdf1[_0x6323('0x42')]!='nothing'){return createEndUser(_0x979aa8,_0x44bd30,_0x20d846,_0x544126,_0x1def87,_0x30bdf1);}else{return{};}});});break;case'contact':_0x5e6281['uri']='https://www.zohoapis.'+_0x44bd30+_0x6323('0x50')+_0x544126+'))';return getZohoUser(_0x5e6281,'Contacts')[_0x6323('0x27')](function(_0x224115){if(_0x224115)return _0x224115;if(_0x30bdf1[_0x6323('0x42')]!='nothing'){return createEndUser(_0x979aa8,_0x44bd30,_0x20d846,_0x544126,_0x1def87,_0x30bdf1);}else{return{};}});break;case _0x6323('0x54'):_0x5e6281[_0x6323('0x4f')]=_0x6323('0x40')+_0x44bd30+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x544126+'))';return getZohoUser(_0x5e6281,'Leads')[_0x6323('0x27')](function(_0x3690f9){if(_0x3690f9)return _0x3690f9;if(_0x30bdf1['moduleCreate']!=_0x6323('0x55')){return createEndUser(_0x979aa8,_0x44bd30,_0x20d846,_0x544126,_0x1def87,_0x30bdf1);}else{return{};}});break;}}function getCall(_0x1c2528,_0x52cbbe,_0xed9b73,_0x594c53,_0xc7edc5,_0x56aeb4,_0x432146,_0x50c44e){logger['info'](_0x6323('0x56'));var _0x26bc2d={};_0x26bc2d[_0x6323('0x57')]={'name':!_[_0x6323('0x19')](_0x594c53[_0x6323('0x43')]['name'])&&!_[_0x6323('0x19')](_0x594c53[_0x6323('0x38')][_0x6323('0x15')])&&_0x594c53[_0x6323('0x38')][_0x6323('0x15')]==='administrator'?_0x594c53[_0x6323('0x43')]['name']:!_[_0x6323('0x19')](_0x594c53[_0x6323('0x44')])?_0x594c53[_0x6323('0x44')]+'\x20'+_0x594c53[_0x6323('0x45')]:_0x594c53[_0x6323('0x45')],'id':_0x594c53['id']};_0x26bc2d[_0x6323('0x58')]=intUtil[_0x6323('0x59')](_0x56aeb4['Subjects'],_0x432146,'\x20');_0x26bc2d[_0x6323('0x5a')]=intUtil[_0x6323('0x59')](_0x56aeb4[_0x6323('0x5b')],_0x432146,'\x0a');if(_0xc7edc5['enduserType']===_0x6323('0x51')){_0x26bc2d[_0x6323('0x5c')]={'name':!_[_0x6323('0x19')](_0xc7edc5[_0x6323('0x5d')])?_0xc7edc5[_0x6323('0x5d')]:!_[_0x6323('0x19')](_0xc7edc5['First_Name'])?_0xc7edc5['First_Name']+'\x20'+_0xc7edc5[_0x6323('0x5e')]:_0xc7edc5[_0x6323('0x5e')],'id':_0xc7edc5['id']};}if(_0xc7edc5[_0x6323('0x3f')]===_0x6323('0x53')){_0x26bc2d[_0x6323('0x5f')]={'name':!_[_0x6323('0x19')](_0xc7edc5['Full_Name'])?_0xc7edc5[_0x6323('0x5d')]:!_[_0x6323('0x19')](_0xc7edc5[_0x6323('0x60')])?_0xc7edc5['First_Name']+'\x20'+_0xc7edc5['Last_Name']:_0xc7edc5['Last_Name'],'id':_0xc7edc5['id']};_0x26bc2d[_0x6323('0x61')]=_[_0x6323('0x49')](_0xc7edc5[_0x6323('0x3f')]);}if(_0x432146['talktime']){_0x26bc2d[_0x6323('0x62')]=moment[_0x6323('0x63')](parseInt(_0x432146[_0x6323('0x64')])*0x3e8)['format']('mm:ss');}else if(_0x432146['answertime']&&_0x432146[_0x6323('0x65')]){_0x26bc2d[_0x6323('0x62')]=moment['utc'](moment(_0x432146[_0x6323('0x65')],_0x6323('0x66'))[_0x6323('0x67')](moment(_0x432146[_0x6323('0x68')],_0x6323('0x66'))))[_0x6323('0x2f')](_0x6323('0x69'));}switch(_0x432146[_0x6323('0x6a')]){case _0x6323('0x6b'):_0x26bc2d[_0x6323('0x6c')]='Called';break;case _0x6323('0x6d'):case _0x6323('0x6e'):_0x26bc2d['Call_Result']='Answered';break;case _0x6323('0x6f'):_0x26bc2d[_0x6323('0x6c')]='Rejected';break;case _0x6323('0x70'):_0x26bc2d[_0x6323('0x6c')]=_0x6323('0x71');break;case'timeout':_0x26bc2d[_0x6323('0x6c')]=_0x6323('0x72');default:}_0x26bc2d[_0x6323('0x73')]=(_0x50c44e===_0x6323('0x74')?moment(_0x432146[_0x6323('0x68')])[_0x6323('0x2f')](_0x6323('0x66')):moment(_0x432146[_0x6323('0x75')])['format'](_0x6323('0x66')))||moment()['format'](_0x6323('0x66'));_0x26bc2d[_0x6323('0x76')]=_0x50c44e||'Inbound';_0x26bc2d=_['merge'](_0x26bc2d,getCustomFields(_0x56aeb4['Fields'],_0x432146));return request({'method':_0x6323('0x21'),'uri':_0x6323('0x40')+_0x52cbbe+'/crm/v2/Calls','headers':{'Authorization':_0x6323('0x31')+_0x1c2528},'body':{'data':[_0x26bc2d]},'json':!![]})['then'](function(_0x44af0e){if(_0x44af0e&&_0x44af0e[_0x6323('0x46')][0x0][_0x6323('0x47')]===_0x6323('0x48')){logger[_0x6323('0x35')](_0x6323('0x77'));return{'id':_0x44af0e[_0x6323('0x46')][0x0][_0x6323('0x78')]['id']};}})[_0x6323('0x2a')](function(_0x440233){logger['info'](_0x6323('0x79'),_0x440233[_0x6323('0x2d')]);console['log'](_0x6323('0x79'),_0x440233);});}exports[_0x6323('0x7a')]=function(_0xa0f391,_0x98aeea,_0x59e65f,_0x202690,_0x6eeb7e,_0x1f4d29){var _0x206607,_0x4e28f6,_0x3bbc7b;_0x1f4d29['host']=intUtil[_0x6323('0x7b')](_0x1f4d29['host']);_0x1f4d29['serverUrl']=intUtil[_0x6323('0x7b')](_0x1f4d29[_0x6323('0x7c')]);if(_0x6eeb7e&&_0x6eeb7e['monitor_format']){logger['info'](_0x6323('0x7d'),_0x6323('0x7e'));_0x98aeea['recordingURL']=_0x1f4d29[_0x6323('0x7c')]+_0x6323('0x7f')+_0x98aeea[_0x6323('0x80')]+_0x6323('0x81')+md5(_0x98aeea[_0x6323('0x80')]);}else{_0x98aeea['recordingURL']='';}var _0x58393e=_0x1f4d29[_0x6323('0x82')]===_0x6323('0x83')?'eu':'com';return getAccessToken(_0x1f4d29)[_0x6323('0x27')](function(_0x1ba93f){_0x3bbc7b=_0x1ba93f;return getUser(_0x3bbc7b,_0x58393e,_0x1f4d29,_0x202690[_0x6323('0x34')]);})[_0x6323('0x27')](function(_0x3a69f7){_0x206607=_0x3a69f7;logger[_0x6323('0x35')](_0x6323('0x84'),_0x206607['id']);return getEndUser(_0x3bbc7b,_0x58393e,_0x1f4d29,_0x98aeea[_0x6323('0x85')],_0x98aeea[_0x6323('0x86')],_0x206607,_0x59e65f);})['then'](function(_0x5f2353){_0x4e28f6=_0x5f2353;return getCall(_0x3bbc7b,_0x58393e,_0x1f4d29,_0x206607,_0x4e28f6,_0x59e65f,_0x98aeea,_0x6323('0x87'));})['then'](function(_0x10e36b){if(_0x10e36b){logger[_0x6323('0x35')]('The\x20Call\x20ID\x20is:',_0x10e36b['id']);logger['info'](_0x6323('0x7d'),_0x6323('0x88'));emit(util['format'](_0x6323('0x89'),_0x202690[_0x6323('0x15')]),_0x6323('0x8a'),{'uri':_0x6323('0x8b')+_0x1f4d29[_0x6323('0x82')]+_0x6323('0x8c')+_0x10e36b['id']});}})[_0x6323('0x2a')](function(_0x3673d3){logger[_0x6323('0x2b')](_0x6323('0x7d'),JSON['stringify'](_0x3673d3));});};exports[_0x6323('0x74')]=function(_0x32af05,_0x3148d4,_0x41022c,_0xca4ecd,_0x12c9bc,_0x3f9a4d,_0x7137f6){var _0x21614c,_0xacdcbd,_0x1479ca;_0x3f9a4d[_0x6323('0x82')]=intUtil[_0x6323('0x7b')](_0x3f9a4d[_0x6323('0x82')]);_0x3f9a4d[_0x6323('0x7c')]=intUtil['stripTrailingSlash'](_0x3f9a4d['serverUrl']);if(_0x7137f6&&_0x7137f6['recordingFormat']&&_0x7137f6[_0x6323('0x8d')]!==_0x6323('0x8e')){logger[_0x6323('0x35')](_0x6323('0x8f'),_0x6323('0x7e'));_0x3148d4[_0x6323('0x90')]=_0x3f9a4d['serverUrl']+'/api/voice/recordings/'+_0x3148d4[_0x6323('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x3148d4['uniqueid']);}var _0x53178e=_0x3f9a4d[_0x6323('0x82')]===_0x6323('0x83')?'eu':_0x6323('0x91');return getAccessToken(_0x3f9a4d)['then'](function(_0x56f618){_0x1479ca=_0x56f618;return getUser(_0x1479ca,_0x53178e,_0x3f9a4d,_0xca4ecd[_0x6323('0x34')]);})[_0x6323('0x27')](function(_0x2237a8){_0x21614c=_0x2237a8;logger[_0x6323('0x35')](_0x6323('0x84'),_0x21614c['id']);return getEndUser(_0x1479ca,_0x53178e,_0x3f9a4d,_0x3148d4['destcalleridname'],_0x3148d4['destcalleridnum'],_0x21614c,_0x41022c);})[_0x6323('0x27')](function(_0x4cc653){_0xacdcbd=_0x4cc653;return getCall(_0x1479ca,_0x53178e,_0x3f9a4d,_0x21614c,_0xacdcbd,_0x41022c,_0x3148d4,_0x6323('0x92'));})[_0x6323('0x27')](function(_0xebbba5){if(_0xebbba5){logger[_0x6323('0x35')](_0x6323('0x93'),_0xebbba5['id']);logger[_0x6323('0x35')](_0x6323('0x8f'),_0x6323('0x88'));emit(util[_0x6323('0x2f')](_0x6323('0x89'),_0xca4ecd[_0x6323('0x15')]),'trigger:browser:url',{'uri':'https://crm.'+_0x3f9a4d[_0x6323('0x82')]+_0x6323('0x8c')+_0xebbba5['id']});}})['catch'](function(_0x161e81){logger[_0x6323('0x2b')](_0x6323('0x8f'),JSON[_0x6323('0x3c')](_0x161e81));});};exports[_0x6323('0x94')]=function(_0x714e9,_0x38b26e,_0x3c047e,_0x24c463,_0x2aae21,_0x1c4ae5){var _0x2cd4ef,_0x5202d1,_0x4a0b96;_0x1c4ae5['host']=intUtil[_0x6323('0x7b')](_0x1c4ae5[_0x6323('0x82')]);_0x1c4ae5[_0x6323('0x7c')]=intUtil['stripTrailingSlash'](_0x1c4ae5[_0x6323('0x7c')]);if(_0x2aae21&&_0x2aae21['monitor_format']){logger[_0x6323('0x35')]('['+_0x38b26e[_0x6323('0x6a')][_0x6323('0x95')]()+']',_0x6323('0x7e'));_0x38b26e[_0x6323('0x90')]=_0x1c4ae5['serverUrl']+_0x6323('0x7f')+_0x38b26e[_0x6323('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x38b26e[_0x6323('0x80')]);}else{_0x38b26e[_0x6323('0x90')]='';}var _0x43b87f=_0x1c4ae5[_0x6323('0x82')]===_0x6323('0x83')?'eu':'com';return getAccessToken(_0x1c4ae5)['then'](function(_0x1d29a2){_0x4a0b96=_0x1d29a2;return getUser(_0x4a0b96,_0x43b87f,_0x1c4ae5);})['then'](function(_0x5449fe){_0x2cd4ef=_0x5449fe;logger[_0x6323('0x35')](_0x6323('0x84'),_0x2cd4ef['id']);return getEndUser(_0x4a0b96,_0x43b87f,_0x1c4ae5,_0x38b26e[_0x6323('0x85')],_0x38b26e['calleridnum'],_0x2cd4ef,_0x3c047e);})[_0x6323('0x27')](function(_0x5cfa2d){_0x5202d1=_0x5cfa2d;return getCall(_0x4a0b96,_0x43b87f,_0x1c4ae5,_0x2cd4ef,_0x5202d1,_0x3c047e,_0x38b26e,_0x6323('0x87'));})[_0x6323('0x27')](function(_0x58a9c0){if(_0x58a9c0){logger[_0x6323('0x35')]('The\x20Call\x20ID\x20is:',_0x58a9c0['id']);}})['catch'](function(_0x2d3647){logger['error']('['+_0x38b26e[_0x6323('0x6a')][_0x6323('0x95')]()+']',JSON[_0x6323('0x3c')](_0x2d3647));});}; \ 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 c1a3ab5..5201ff4 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 _0x450f=['util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x14d86c,_0x30d3ae){var _0x4bc4cd=function(_0x338f71){while(--_0x338f71){_0x14d86c['push'](_0x14d86c['shift']());}};_0x4bc4cd(++_0x30d3ae);}(_0x450f,0x70));var _0xf450=function(_0x2eebcc,_0x1e649d){_0x2eebcc=_0x2eebcc-0x0;var _0x39f1a5=_0x450f[_0x2eebcc];return _0x39f1a5;};'use strict';var util=require(_0xf450('0x0'));var sh=require(_0xf450('0x1'));var Mustache=require(_0xf450('0x2'));var logger=require(_0xf450('0x3'))(_0xf450('0x4'));exports[_0xf450('0x5')]=function(_0x2f7fb7,_0x4db0d0){var _0x4ddc92=_0x2f7fb7[_0xf450('0x6')]?_0x2f7fb7[_0xf450('0x6')]:_0xf450('0x7');var _0xdea43=_0x2f7fb7[_0xf450('0x8')]?Mustache[_0xf450('0x9')](_0x2f7fb7[_0xf450('0x8')],_0x4db0d0):_0x4db0d0;sh[_0xf450('0x5')](_0xdea43,function(_0x5649d4,_0x38bf4d,_0x3d94b4){if(_0x5649d4!==0x0){logger[_0xf450('0xa')](util[_0xf450('0xb')](_0xf450('0xc'),_0x4ddc92,_0xdea43,_0x5649d4,_0x3d94b4));}else{logger[_0xf450('0xd')](util[_0xf450('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x4ddc92,_0xdea43,_0x38bf4d));}});}; \ No newline at end of file +var _0xf9e8=['trigger','exec','data2','Script','data3','error','format','info','shelljs','mustache','../../../../config/logger'];(function(_0x5f1f41,_0x2437b4){var _0x5b8b58=function(_0x5dc7e1){while(--_0x5dc7e1){_0x5f1f41['push'](_0x5f1f41['shift']());}};_0x5b8b58(++_0x2437b4);}(_0xf9e8,0x152));var _0x8f9e=function(_0x46a085,_0x33fa72){_0x46a085=_0x46a085-0x0;var _0x57d64f=_0xf9e8[_0x46a085];return _0x57d64f;};'use strict';var util=require('util');var sh=require(_0x8f9e('0x0'));var Mustache=require(_0x8f9e('0x1'));var logger=require(_0x8f9e('0x2'))(_0x8f9e('0x3'));exports[_0x8f9e('0x4')]=function(_0x123e04,_0x416a2c){var _0x11bf61=_0x123e04['data2']?_0x123e04[_0x8f9e('0x5')]:_0x8f9e('0x6');var _0x572f93=_0x123e04[_0x8f9e('0x7')]?Mustache['render'](_0x123e04[_0x8f9e('0x7')],_0x416a2c):_0x416a2c;sh[_0x8f9e('0x4')](_0x572f93,function(_0x268409,_0x101fe0,_0x3230bb){if(_0x268409!==0x0){logger[_0x8f9e('0x8')](util[_0x8f9e('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x11bf61,_0x572f93,_0x268409,_0x3230bb));}else{logger[_0x8f9e('0xa')](util[_0x8f9e('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x11bf61,_0x572f93,_0x101fe0));}});}; \ 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 ac716f1..3660e11 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 _0x2f71=['mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','format','then',',\x20request\x20body:\x20','body','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','message','request-promise','util','lodash'];(function(_0x190f00,_0x28c850){var _0x48d523=function(_0x3348a4){while(--_0x3348a4){_0x190f00['push'](_0x190f00['shift']());}};_0x48d523(++_0x28c850);}(_0x2f71,0x133));var _0x12f7=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x2f71[_0x334841];return _0x5beb4b;};'use strict';var rp=require(_0x12f7('0x0'));var util=require(_0x12f7('0x1'));var _=require(_0x12f7('0x2'));var Mustache=require(_0x12f7('0x3'));var logger=require(_0x12f7('0x4'))(_0x12f7('0x5'));exports['exec']=function(_0x4760c9,_0x38dd94){var _0x5d80dd,_0x25dbdb;var _0x47ef9c={'method':_0x4760c9[_0x12f7('0x6')][_0x12f7('0x7')](),'uri':Mustache[_0x12f7('0x8')](_0x4760c9[_0x12f7('0x9')],_0x38dd94),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4760c9[_0x12f7('0xa')])===_0x12f7('0xb')&&parseInt(_0x4760c9[_0x12f7('0xa')])>=0x1&&parseInt(_0x4760c9[_0x12f7('0xa')])<=0xa?parseInt(_0x4760c9[_0x12f7('0xa')])*0x3e8:0x5*0x3e8};try{_0x47ef9c['headers']=_0x4760c9[_0x12f7('0xc')]?JSON[_0x12f7('0xd')](Mustache[_0x12f7('0x8')](_0x4760c9[_0x12f7('0xc')],_0x38dd94)):{};}catch(_0x281cbe){logger[_0x12f7('0xe')](_0x281cbe[_0x12f7('0xf')]);}switch(_0x4760c9[_0x12f7('0x6')][_0x12f7('0x7')]()){case _0x12f7('0x10'):case _0x12f7('0x11'):_0x5d80dd=null;_0x47ef9c['qs']=_0x38dd94;break;case _0x12f7('0x12'):case _0x12f7('0x13'):if(_0x4760c9[_0x12f7('0x14')]){try{_0x5d80dd=JSON['parse'](Mustache[_0x12f7('0x8')](_0x4760c9[_0x12f7('0x14')],_0x38dd94));_0x47ef9c['body']=_0x5d80dd;}catch(_0x16fc4d){logger['error'](_0x16fc4d[_0x12f7('0xf')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x5d80dd=_0x38dd94;_0x47ef9c['body']=_0x5d80dd;}break;}logger['info'](util[_0x12f7('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x4760c9['data1'],_0x4760c9[_0x12f7('0x9')],JSON['stringify'](_0x47ef9c)));rp(_0x47ef9c)[_0x12f7('0x16')](function(_0x3415bd){_0x5d80dd=!_['isNil'](_0x5d80dd)?_0x12f7('0x17')+_0x5d80dd:'';_0x25dbdb=typeof _0x3415bd[_0x12f7('0x18')]===_0x12f7('0x19')?JSON[_0x12f7('0x1a')](_0x3415bd[_0x12f7('0x18')]):_0x3415bd['body'];logger[_0x12f7('0x1b')](util[_0x12f7('0x15')](_0x12f7('0x1c'),_0x4760c9[_0x12f7('0x6')],_0x4760c9[_0x12f7('0x9')],_0x3415bd[_0x12f7('0x1d')],_0x25dbdb));})['catch'](function(_0x2983dc){logger[_0x12f7('0xe')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x4760c9['data1'],_0x4760c9[_0x12f7('0x9')],_0x2983dc[_0x12f7('0x1d')],_0x2983dc['name'],_0x2983dc[_0x12f7('0x1e')]));});}; \ No newline at end of file +var _0xe4b7=['stringify',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','parse','data6','error','stack','DELETE','POST','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0xe1b102,_0x542a72){var _0xed6dcc=function(_0x3191a6){while(--_0x3191a6){_0xe1b102['push'](_0xe1b102['shift']());}};_0xed6dcc(++_0x542a72);}(_0xe4b7,0x11f));var _0x7e4b=function(_0x393bf5,_0x225cac){_0x393bf5=_0x393bf5-0x0;var _0xcb023=_0xe4b7[_0x393bf5];return _0xcb023;};'use strict';var rp=require('request-promise');var util=require(_0x7e4b('0x0'));var _=require(_0x7e4b('0x1'));var Mustache=require(_0x7e4b('0x2'));var logger=require(_0x7e4b('0x3'))(_0x7e4b('0x4'));exports[_0x7e4b('0x5')]=function(_0x2b1e6a,_0x4c5a3b){var _0x9fef74,_0x4528aa;var _0x32ddd5={'method':_0x2b1e6a[_0x7e4b('0x6')][_0x7e4b('0x7')](),'uri':Mustache[_0x7e4b('0x8')](_0x2b1e6a[_0x7e4b('0x9')],_0x4c5a3b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2b1e6a[_0x7e4b('0xa')])===_0x7e4b('0xb')&&parseInt(_0x2b1e6a[_0x7e4b('0xa')])>=0x1&&parseInt(_0x2b1e6a[_0x7e4b('0xa')])<=0xa?parseInt(_0x2b1e6a[_0x7e4b('0xa')])*0x3e8:0x5*0x3e8};try{_0x32ddd5['headers']=_0x2b1e6a['data6']?JSON[_0x7e4b('0xc')](Mustache[_0x7e4b('0x8')](_0x2b1e6a[_0x7e4b('0xd')],_0x4c5a3b)):{};}catch(_0x13e3c2){logger[_0x7e4b('0xe')](_0x13e3c2[_0x7e4b('0xf')]);}switch(_0x2b1e6a[_0x7e4b('0x6')][_0x7e4b('0x7')]()){case'GET':case _0x7e4b('0x10'):_0x9fef74=null;_0x32ddd5['qs']=_0x4c5a3b;break;case _0x7e4b('0x11'):case'PUT':if(_0x2b1e6a['data7']){try{_0x9fef74=JSON[_0x7e4b('0xc')](Mustache[_0x7e4b('0x8')](_0x2b1e6a[_0x7e4b('0x12')],_0x4c5a3b));_0x32ddd5['body']=_0x9fef74;}catch(_0xf6586){logger['error'](_0xf6586[_0x7e4b('0xf')]);logger[_0x7e4b('0xe')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x9fef74=_0x4c5a3b;_0x32ddd5[_0x7e4b('0x13')]=_0x9fef74;}break;}logger[_0x7e4b('0x14')](util[_0x7e4b('0x15')](_0x7e4b('0x16'),_0x2b1e6a[_0x7e4b('0x6')],_0x2b1e6a[_0x7e4b('0x9')],JSON[_0x7e4b('0x17')](_0x32ddd5)));rp(_0x32ddd5)['then'](function(_0xcebea7){_0x9fef74=!_['isNil'](_0x9fef74)?_0x7e4b('0x18')+_0x9fef74:'';_0x4528aa=typeof _0xcebea7[_0x7e4b('0x13')]===_0x7e4b('0x19')?JSON['stringify'](_0xcebea7[_0x7e4b('0x13')]):_0xcebea7['body'];logger[_0x7e4b('0x14')](util[_0x7e4b('0x15')](_0x7e4b('0x1a'),_0x2b1e6a[_0x7e4b('0x6')],_0x2b1e6a[_0x7e4b('0x9')],_0xcebea7['statusCode'],_0x4528aa));})[_0x7e4b('0x1b')](function(_0x185074){logger[_0x7e4b('0xe')](util[_0x7e4b('0x15')](_0x7e4b('0x1c'),_0x2b1e6a[_0x7e4b('0x6')],_0x2b1e6a[_0x7e4b('0x9')],_0x185074['statusCode'],_0x185074[_0x7e4b('0x1d')],_0x185074[_0x7e4b('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 28b10da..1c8203b 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 _0x5065=['routing','client','http','request','then','debug','rpc','error','message','result','catch','exports','../../config/logger'];(function(_0x1c518c,_0x383352){var _0x2650cb=function(_0x45fe77){while(--_0x45fe77){_0x1c518c['push'](_0x1c518c['shift']());}};_0x2650cb(++_0x383352);}(_0x5065,0x12a));var _0x5506=function(_0x1f6eee,_0x55f845){_0x1f6eee=_0x1f6eee-0x0;var _0x48e34f=_0x5065[_0x1f6eee];return _0x48e34f;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x5506('0x0'))(_0x5506('0x1'));var client=jayson[_0x5506('0x2')][_0x5506('0x3')]({'port':0x2329});client['Request']=function(_0x1a4998,_0xbc4454){return new BPromise(function(_0x30f372,_0x54c4b8){return client[_0x5506('0x4')](_0x1a4998,_0xbc4454)[_0x5506('0x5')](function(_0x3b790c){logger[_0x5506('0x6')](_0x5506('0x7'),_0x5506('0x1'),_0x1a4998,_0xbc4454,_0x3b790c);if(_0x3b790c[_0x5506('0x8')]){logger[_0x5506('0x8')](_0x5506('0x7'),_0x5506('0x1'),_0x1a4998,_0x3b790c['error'][_0x5506('0x9')],_0xbc4454);return _0x54c4b8(_0x3b790c['error'][_0x5506('0x9')]);}else{return _0x30f372(_0x3b790c[_0x5506('0xa')]);}})[_0x5506('0xb')](function(_0x566e3f){logger['error'](_0x5506('0x7'),'routing',_0x1a4998,_0x566e3f,_0xbc4454);return _0x54c4b8(_0x566e3f);});});};module[_0x5506('0xc')]=client; \ No newline at end of file +var _0x19ea=['Request','request','then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','http'];(function(_0x293ca8,_0x3ca5de){var _0x4508aa=function(_0x289413){while(--_0x289413){_0x293ca8['push'](_0x293ca8['shift']());}};_0x4508aa(++_0x3ca5de);}(_0x19ea,0xec));var _0xa19e=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x19ea[_0x30faec];return _0x29484f;};'use strict';var jayson=require(_0xa19e('0x0'));var BPromise=require(_0xa19e('0x1'));var logger=require(_0xa19e('0x2'))('routing');var client=jayson['client'][_0xa19e('0x3')]({'port':0x2329});client[_0xa19e('0x4')]=function(_0x58b5fd,_0x4a3b95){return new BPromise(function(_0x4a1354,_0x9bac59){return client[_0xa19e('0x5')](_0x58b5fd,_0x4a3b95)[_0xa19e('0x6')](function(_0x38358c){logger[_0xa19e('0x7')](_0xa19e('0x8'),_0xa19e('0x9'),_0x58b5fd,_0x4a3b95,_0x38358c);if(_0x38358c[_0xa19e('0xa')]){logger[_0xa19e('0xa')]('rpc',_0xa19e('0x9'),_0x58b5fd,_0x38358c[_0xa19e('0xa')][_0xa19e('0xb')],_0x4a3b95);return _0x9bac59(_0x38358c[_0xa19e('0xa')][_0xa19e('0xb')]);}else{return _0x4a1354(_0x38358c[_0xa19e('0xc')]);}})[_0xa19e('0xd')](function(_0x46e7ee){logger[_0xa19e('0xa')](_0xa19e('0x8'),_0xa19e('0x9'),_0x58b5fd,_0x46e7ee,_0x4a3b95);return _0x9bac59(_0x46e7ee);});});};module[_0xa19e('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 3c01369..6711170 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 _0x9b51=['then','getMailAccounts','mailAccounts','listen','getSettings','catch','bluebird','./lib/email','./rpc/mailAccount','resolve'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x9b51,0x1d2));var _0x19b5=function(_0x2cd718,_0x1ab5dd){_0x2cd718=_0x2cd718-0x0;var _0x4c02ba=_0x9b51[_0x2cd718];return _0x4c02ba;};'use strict';var BPromise=require(_0x19b5('0x0'));var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x19b5('0x1'));var mailAccount=require(_0x19b5('0x2'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x19b5('0x3')]()[_0x19b5('0x4')](mailAccount[_0x19b5('0x5')]())['then'](realtime['initMailAccounts']())[_0x19b5('0x4')](function(){email['refresh'](realtime[_0x19b5('0x6')]);return realtime;});}function main(){return server[_0x19b5('0x7')](realtime,email)[_0x19b5('0x4')](function(){return initRealtime();})[_0x19b5('0x4')](function(){return setting[_0x19b5('0x8')]();})[_0x19b5('0x4')](function(_0x34cb75){return setInterval(initRealtime,_0x34cb75['loginMailFrequency']*0x3e8);})[_0x19b5('0x9')](function(_0x518e69){console['log'](_0x518e69);});}main(); \ No newline at end of file +var _0xf7e1=['resolve','getMailAccounts','then','initMailAccounts','refresh','getSettings','loginMailFrequency','log','bluebird','./server','./realtime','./lib/email'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0xf7e1,0x170));var _0x1f7e=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xf7e1[_0x58e469];return _0x4c01c5;};'use strict';var BPromise=require(_0x1f7e('0x0'));var server=require(_0x1f7e('0x1'));var Realtime=require(_0x1f7e('0x2'));var EmailChannel=require(_0x1f7e('0x3'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x1f7e('0x4')]()['then'](mailAccount[_0x1f7e('0x5')]())[_0x1f7e('0x6')](realtime[_0x1f7e('0x7')]())['then'](function(){email[_0x1f7e('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x1f7e('0x6')](function(){return initRealtime();})[_0x1f7e('0x6')](function(){return setting[_0x1f7e('0x9')]();})[_0x1f7e('0x6')](function(_0x35f087){return setInterval(initRealtime,_0x35f087[_0x1f7e('0xa')]*0x3e8);})['catch'](function(_0x2a24f0){console[_0x1f7e('0xb')](_0x2a24f0);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index eea564e..9738494 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 _0x3623=['isNil','stringify','mailAccount:update','hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd','handleImapError','status','disabled','handleImapBox','messages','firstName','lastName','from','notify','then','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','lodash','moment','md5','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x3623,0xb8));var _0x3362=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x3623[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x3362('0x0'));var moment=require(_0x3362('0x1'));var BPromise=require('bluebird');var md5=require(_0x3362('0x2'));var Redis=require('ioredis');var config=require(_0x3362('0x3'));var logger=require(_0x3362('0x4'))(_0x3362('0x5'));config[_0x3362('0x6')]=_['defaults'](config[_0x3362('0x6')],{'host':_0x3362('0x7'),'port':0x18eb});var io=require(_0x3362('0x8'))(new Redis(config[_0x3362('0x6')]));var EmailImap=require(_0x3362('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x3362('0xa'));var md5Accounts={};function EmailChannel(_0x1a79b2){logger[_0x3362('0xb')](_0x3362('0xc'));this[_0x3362('0xd')]=_0x1a79b2[_0x3362('0xd')];this[_0x3362('0xe')]={};this[_0x3362('0xf')]=new EmailSmtp();}EmailChannel[_0x3362('0x10')][_0x3362('0x11')]=function(_0x5c2fde){var _0x1c8d57=this[_0x3362('0xd')][_0x5c2fde];var _0x2f66f8={'id':_0x1c8d57['id'],'name':_0x1c8d57[_0x3362('0x12')],'key':_0x1c8d57[_0x3362('0x13')],'active':_0x1c8d57[_0x3362('0x14')],'Imap':{'status':_0x1c8d57[_0x3362('0x15')]['status'],'messageStatus':_0x1c8d57[_0x3362('0x15')][_0x3362('0x16')],'total':_0x1c8d57[_0x3362('0x15')][_0x3362('0x17')]}};if(_[_0x3362('0x18')](md5Accounts[_0x5c2fde])){md5Accounts[_0x5c2fde]={};}var _0x30bfb1=md5(JSON[_0x3362('0x19')](_0x2f66f8));if(md5Accounts[_0x5c2fde][_0x3362('0x2')]!==_0x30bfb1){md5Accounts[_0x5c2fde][_0x3362('0x2')]=_0x30bfb1;io['emit'](_0x3362('0x1a'),_0x2f66f8);}};EmailChannel[_0x3362('0x10')]['refresh']=function(_0x12a187){for(var _0x474796 in _0x12a187){if(_0x12a187[_0x3362('0x1b')](_0x474796)){if(_0x12a187[_0x474796][_0x3362('0x15')]&&_0x12a187[_0x474796]['active']){var _0x44556f=_0x12a187[_0x474796][_0x3362('0x15')];if(!this[_0x3362('0xe')][_0x3362('0x1b')](_0x44556f['id'])){this[_0x3362('0xe')][_0x44556f['id']]=new EmailImap(_0x44556f,_0x12a187[_0x474796][_0x3362('0x5')]);this[_0x3362('0xe')][_0x44556f['id']]['on'](_0x3362('0x1c'),this['handleImapBox'][_0x3362('0x1d')](this,_0x474796));this[_0x3362('0xe')][_0x44556f['id']]['on'](_0x3362('0x5'),this[_0x3362('0x1e')]['bind'](this,_0x474796));this[_0x3362('0xe')][_0x44556f['id']]['on'](_0x3362('0x1f'),this[_0x3362('0x20')][_0x3362('0x1d')](this,_0x474796));this[_0x3362('0xe')][_0x44556f['id']]['on']('error',this[_0x3362('0x21')][_0x3362('0x1d')](this,_0x474796));}}else{if(_[_0x3362('0x18')](this['mailAccounts'][_0x474796]['Imap'])){this[_0x3362('0xd')][_0x474796][_0x3362('0x15')]={};}this[_0x3362('0xd')][_0x474796][_0x3362('0x15')][_0x3362('0x22')]=_0x3362('0x23');this[_0x3362('0xd')][_0x474796][_0x3362('0x15')]['messageStatus']='';this[_0x3362('0x11')](_0x474796);}}}};EmailChannel[_0x3362('0x10')][_0x3362('0x24')]=function(_0x45d03d,_0x4e3098){if(this[_0x3362('0xd')][_0x45d03d]){this[_0x3362('0xd')][_0x45d03d][_0x3362('0x15')]['status']='connected';this['mailAccounts'][_0x45d03d][_0x3362('0x15')][_0x3362('0x16')]=_0x4e3098['name'];if(_0x4e3098[_0x3362('0x25')]){this[_0x3362('0xd')][_0x45d03d][_0x3362('0x15')][_0x3362('0x17')]=_0x4e3098[_0x3362('0x25')][_0x3362('0x17')];}return this[_0x3362('0x11')](_0x45d03d);}};EmailChannel[_0x3362('0x10')]['handleImapEmail']=function(_0x404895,_0x2a74dd){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2a74dd[_0x3362('0x26')],_0x2a74dd[_0x3362('0x27')],_0x2a74dd[_0x3362('0x28')],_0x404895);if(this[_0x3362('0xd')][_0x404895]){return mailAccount[_0x3362('0x29')](_0x404895,_0x2a74dd)[_0x3362('0x2a')](function(_0x2565c2){if(_0x2565c2){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x3362('0x2b')](function(_0x31ff8b){logger[_0x3362('0x2c')](_0x3362('0x2d'),JSON[_0x3362('0x19')](_0x31ff8b));});}};EmailChannel[_0x3362('0x10')][_0x3362('0x20')]=function(_0x14ed94){if(this[_0x3362('0xd')][_0x14ed94]&&this[_0x3362('0xd')][_0x14ed94][_0x3362('0x15')]){if(this[_0x3362('0xe')][this[_0x3362('0xd')][_0x14ed94][_0x3362('0x15')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x14ed94]['Imap']['id']];}this[_0x3362('0xd')][_0x14ed94][_0x3362('0x15')][_0x3362('0x2e')]=moment();this[_0x3362('0x11')](_0x14ed94);}};EmailChannel[_0x3362('0x10')]['handleImapError']=function(_0x65c73f,_0x3930d5){if(this[_0x3362('0xd')][_0x65c73f]){this[_0x3362('0xd')][_0x65c73f][_0x3362('0x15')][_0x3362('0x22')]='error';this[_0x3362('0xd')][_0x65c73f][_0x3362('0x15')][_0x3362('0x16')]=_0x3930d5;return this['emit'](_0x65c73f);}};EmailChannel['prototype'][_0x3362('0x2f')]=function(_0x53e72e,_0x248b4e){return this[_0x3362('0xf')][_0x3362('0x30')](_0x53e72e,_0x248b4e);};EmailChannel['prototype'][_0x3362('0x31')]=function(_0x6bd65c){var _0x51a70d=this;if(this[_0x3362('0xd')][_0x6bd65c['id']]){if(_[_0x3362('0x18')](this['mailAccounts'][_0x6bd65c['id']]['Smtp'])){this[_0x3362('0xd')][_0x6bd65c['id']][_0x3362('0x32')]={};}this[_0x3362('0xd')][_0x6bd65c['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x5c9d44,_0x3b628b){return _0x51a70d['smtp'][_0x3362('0x33')](_0x6bd65c)[_0x3362('0x2a')](function(_0x31e3df){_0x51a70d[_0x3362('0xd')][_0x6bd65c['id']][_0x3362('0x32')][_0x3362('0x22')]='verified';_0x51a70d[_0x3362('0xd')][_0x6bd65c['id']][_0x3362('0x32')][_0x3362('0x16')]='';_0x51a70d[_0x3362('0x11')](_0x6bd65c['id']);_0x5c9d44(_0x31e3df);})['catch'](function(_0x4040a4){_0x51a70d[_0x3362('0xd')][_0x6bd65c['id']][_0x3362('0x32')]['status']=_0x3362('0x2c');_0x51a70d[_0x3362('0xd')][_0x6bd65c['id']]['Smtp'][_0x3362('0x16')]=_0x4040a4;_0x51a70d['emit'](_0x6bd65c['id']);_0x3b628b(_0x4040a4);});});}return this[_0x3362('0xf')]['verify'](_0x6bd65c);};module['exports']=EmailChannel; \ No newline at end of file +var _0x107b=['Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','defaults','localhost','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','email','box','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','emit','connected','name','messages','firstName','from','notify','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x107b,0x1d2));var _0xb107=function(_0x109e46,_0x56f7ae){_0x109e46=_0x109e46-0x0;var _0x2d91b2=_0x107b[_0x109e46];return _0x2d91b2;};'use strict';var _=require(_0xb107('0x0'));var moment=require(_0xb107('0x1'));var BPromise=require(_0xb107('0x2'));var md5=require(_0xb107('0x3'));var Redis=require(_0xb107('0x4'));var config=require(_0xb107('0x5'));var logger=require(_0xb107('0x6'))('email');config['redis']=_[_0xb107('0x7')](config['redis'],{'host':_0xb107('0x8'),'port':0x18eb});var io=require(_0xb107('0x9'))(new Redis(config[_0xb107('0xa')]));var EmailImap=require(_0xb107('0xb'));var EmailSmtp=require(_0xb107('0xc'));var mailAccount=require(_0xb107('0xd'));var md5Accounts={};function EmailChannel(_0x536dfd){logger[_0xb107('0xe')](_0xb107('0xf'));this[_0xb107('0x10')]=_0x536dfd[_0xb107('0x10')];this[_0xb107('0x11')]={};this[_0xb107('0x12')]=new EmailSmtp();}EmailChannel[_0xb107('0x13')]['emit']=function(_0x67f054){var _0x527c1f=this[_0xb107('0x10')][_0x67f054];var _0x31c5be={'id':_0x527c1f['id'],'name':_0x527c1f['name'],'key':_0x527c1f[_0xb107('0x14')],'active':_0x527c1f[_0xb107('0x15')],'Imap':{'status':_0x527c1f[_0xb107('0x16')][_0xb107('0x17')],'messageStatus':_0x527c1f[_0xb107('0x16')][_0xb107('0x18')],'total':_0x527c1f['Imap'][_0xb107('0x19')]}};if(_[_0xb107('0x1a')](md5Accounts[_0x67f054])){md5Accounts[_0x67f054]={};}var _0x184615=md5(JSON[_0xb107('0x1b')](_0x31c5be));if(md5Accounts[_0x67f054][_0xb107('0x3')]!==_0x184615){md5Accounts[_0x67f054][_0xb107('0x3')]=_0x184615;io['emit'](_0xb107('0x1c'),_0x31c5be);}};EmailChannel['prototype'][_0xb107('0x1d')]=function(_0xef795c){for(var _0x705bd0 in _0xef795c){if(_0xef795c['hasOwnProperty'](_0x705bd0)){if(_0xef795c[_0x705bd0]['Imap']&&_0xef795c[_0x705bd0][_0xb107('0x15')]){var _0xdda87c=_0xef795c[_0x705bd0][_0xb107('0x16')];if(!this['imapAccounts'][_0xb107('0x1e')](_0xdda87c['id'])){this[_0xb107('0x11')][_0xdda87c['id']]=new EmailImap(_0xdda87c,_0xef795c[_0x705bd0][_0xb107('0x1f')]);this['imapAccounts'][_0xdda87c['id']]['on'](_0xb107('0x20'),this['handleImapBox'][_0xb107('0x21')](this,_0x705bd0));this[_0xb107('0x11')][_0xdda87c['id']]['on'](_0xb107('0x1f'),this[_0xb107('0x22')][_0xb107('0x21')](this,_0x705bd0));this[_0xb107('0x11')][_0xdda87c['id']]['on']('end',this[_0xb107('0x23')][_0xb107('0x21')](this,_0x705bd0));this['imapAccounts'][_0xdda87c['id']]['on'](_0xb107('0x24'),this[_0xb107('0x25')][_0xb107('0x21')](this,_0x705bd0));}}else{if(_[_0xb107('0x1a')](this[_0xb107('0x10')][_0x705bd0][_0xb107('0x16')])){this[_0xb107('0x10')][_0x705bd0][_0xb107('0x16')]={};}this[_0xb107('0x10')][_0x705bd0][_0xb107('0x16')][_0xb107('0x17')]=_0xb107('0x26');this[_0xb107('0x10')][_0x705bd0][_0xb107('0x16')][_0xb107('0x18')]='';this[_0xb107('0x27')](_0x705bd0);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x58018a,_0x1f0387){if(this[_0xb107('0x10')][_0x58018a]){this['mailAccounts'][_0x58018a]['Imap']['status']=_0xb107('0x28');this[_0xb107('0x10')][_0x58018a][_0xb107('0x16')][_0xb107('0x18')]=_0x1f0387[_0xb107('0x29')];if(_0x1f0387[_0xb107('0x2a')]){this[_0xb107('0x10')][_0x58018a]['Imap']['total']=_0x1f0387['messages'][_0xb107('0x19')];}return this[_0xb107('0x27')](_0x58018a);}};EmailChannel[_0xb107('0x13')][_0xb107('0x22')]=function(_0x1d6675,_0x3a0e24){logger[_0xb107('0xe')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3a0e24[_0xb107('0x2b')],_0x3a0e24['lastName'],_0x3a0e24[_0xb107('0x2c')],_0x1d6675);if(this[_0xb107('0x10')][_0x1d6675]){return mailAccount[_0xb107('0x2d')](_0x1d6675,_0x3a0e24)[_0xb107('0x2e')](function(_0x54a141){if(_0x54a141){logger[_0xb107('0xe')](_0xb107('0x2f'));}})[_0xb107('0x30')](function(_0x4d14da){logger[_0xb107('0x24')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xb107('0x1b')](_0x4d14da));});}};EmailChannel[_0xb107('0x13')][_0xb107('0x23')]=function(_0x50f7b7){if(this[_0xb107('0x10')][_0x50f7b7]&&this[_0xb107('0x10')][_0x50f7b7]['Imap']){if(this['imapAccounts'][this[_0xb107('0x10')][_0x50f7b7][_0xb107('0x16')]['id']]){delete this[_0xb107('0x11')][this[_0xb107('0x10')][_0x50f7b7][_0xb107('0x16')]['id']];}this[_0xb107('0x10')][_0x50f7b7]['Imap'][_0xb107('0x31')]=moment();this[_0xb107('0x27')](_0x50f7b7);}};EmailChannel['prototype']['handleImapError']=function(_0x54dc5f,_0x4daccc){if(this[_0xb107('0x10')][_0x54dc5f]){this[_0xb107('0x10')][_0x54dc5f][_0xb107('0x16')][_0xb107('0x17')]=_0xb107('0x24');this[_0xb107('0x10')][_0x54dc5f][_0xb107('0x16')][_0xb107('0x18')]=_0x4daccc;return this[_0xb107('0x27')](_0x54dc5f);}};EmailChannel[_0xb107('0x13')][_0xb107('0x32')]=function(_0x12d672,_0x13fccb){return this[_0xb107('0x12')][_0xb107('0x33')](_0x12d672,_0x13fccb);};EmailChannel[_0xb107('0x13')][_0xb107('0x34')]=function(_0x187f84){var _0x28ad70=this;if(this[_0xb107('0x10')][_0x187f84['id']]){if(_[_0xb107('0x1a')](this['mailAccounts'][_0x187f84['id']][_0xb107('0x35')])){this['mailAccounts'][_0x187f84['id']][_0xb107('0x35')]={};}this[_0xb107('0x10')][_0x187f84['id']][_0xb107('0x35')]['lastSync']=moment();return new BPromise(function(_0x42b13c,_0x39393b){return _0x28ad70[_0xb107('0x12')][_0xb107('0x36')](_0x187f84)[_0xb107('0x2e')](function(_0x12d001){_0x28ad70[_0xb107('0x10')][_0x187f84['id']][_0xb107('0x35')][_0xb107('0x17')]=_0xb107('0x37');_0x28ad70[_0xb107('0x10')][_0x187f84['id']][_0xb107('0x35')][_0xb107('0x18')]='';_0x28ad70[_0xb107('0x27')](_0x187f84['id']);_0x42b13c(_0x12d001);})['catch'](function(_0x537941){_0x28ad70[_0xb107('0x10')][_0x187f84['id']]['Smtp'][_0xb107('0x17')]=_0xb107('0x24');_0x28ad70['mailAccounts'][_0x187f84['id']]['Smtp']['messageStatus']=_0x537941;_0x28ad70['emit'](_0x187f84['id']);_0x39393b(_0x537941);});});}return this[_0xb107('0x12')][_0xb107('0x36')](_0x187f84);};module[_0xb107('0x38')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 7a44499..c455b02 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 _0x5fc7=['account','getAccount','ready','handleReady','bind','end','handleEnd','error','handleError','prototype','connTimeout','authTimeout','isNil','service','user','host','port','tls','autotls','password','getHost','anonymous@xcally.com','handleOpenBox','box','readUnseen','search','handleReadUnseen','length','fetch','handleFetchMessage','once','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x5fc7[_0x5a9c0c];return _0x53c77d;};'use strict';var fs=require('fs');var path=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var Imap=require(_0x75fc('0x2'));var _=require(_0x75fc('0x3'));var rs=require(_0x75fc('0x4'));var simpleParser=require(_0x75fc('0x5'))[_0x75fc('0x6')];var Iconv=require(_0x75fc('0x7'))[_0x75fc('0x8')];var EventEmitter=require(_0x75fc('0x9'))[_0x75fc('0xa')];var utils=require(_0x75fc('0xb'));var logger=require('../../../config/logger')(_0x75fc('0xc'));function EmailImap(_0xc85b45,_0x1430f3){this[_0x75fc('0xd')]=_0x75fc('0xe');this[_0x75fc('0xf')]=this[_0x75fc('0x10')](_0xc85b45,_0x1430f3);this[_0x75fc('0x2')]=new Imap(this[_0x75fc('0xf')]);this[_0x75fc('0x2')]['once'](_0x75fc('0x11'),this[_0x75fc('0x12')][_0x75fc('0x13')](this));this[_0x75fc('0x2')]['once'](_0x75fc('0x14'),this[_0x75fc('0x15')][_0x75fc('0x13')](this));this[_0x75fc('0x2')]['on'](_0x75fc('0x16'),this[_0x75fc('0x17')][_0x75fc('0x13')](this));this['imap']['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x75fc('0x18')][_0x75fc('0x10')]=function(_0x2e073b,_0x2cb4ed){var _0x2a8725={'connTimeout':_0x2e073b[_0x75fc('0x19')]?_0x2e073b[_0x75fc('0x19')]*0x3e8:0x2710,'authTimeout':_0x2e073b[_0x75fc('0x1a')]?_0x2e073b['authTimeout']*0x3e8:0x1388};if(_[_0x75fc('0x1b')](_0x2e073b[_0x75fc('0x1c')])){if(_0x2e073b['authentication']){_0x2a8725[_0x75fc('0x1d')]=_0x2e073b[_0x75fc('0x1d')];_0x2a8725['password']=_0x2e073b['password'];}_0x2a8725[_0x75fc('0x1e')]=_0x2e073b[_0x75fc('0x1e')];_0x2a8725[_0x75fc('0x1f')]=_0x2e073b[_0x75fc('0x1f')]||0x3e1;if(_0x2e073b[_0x75fc('0x20')]){_0x2a8725[_0x75fc('0x20')]=!![];}else{_0x2a8725['tls']=![];_0x2a8725[_0x75fc('0x21')]='required';}}else{_0x2a8725[_0x75fc('0x1d')]=_0x2e073b[_0x75fc('0x1d')];_0x2a8725[_0x75fc('0x22')]=_0x2e073b[_0x75fc('0x22')];_0x2a8725['host']=utils[_0x75fc('0x23')](_0x2e073b[_0x75fc('0x1c')]);_0x2a8725['port']=0x3e1;_0x2a8725[_0x75fc('0x20')]=!![];}_0x2a8725[_0x75fc('0xc')]=_0x2cb4ed||_0x2e073b['user']||_0x75fc('0x24');return _0x2a8725;};EmailImap['prototype'][_0x75fc('0x12')]=function(){this[_0x75fc('0x2')]['openBox'](this[_0x75fc('0xd')],![],this[_0x75fc('0x25')]['bind'](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x25')]=function(_0x53fcd2,_0x5774bb){if(_0x53fcd2){this[_0x75fc('0x17')](_0x53fcd2,!![]);}else{this['emit'](_0x75fc('0x26'),_0x5774bb);this[_0x75fc('0x27')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x5dd7a9){if(_0x5dd7a9){this[_0x75fc('0x17')](_0x5dd7a9,!![]);}else{this[_0x75fc('0x2')][_0x75fc('0x14')]();}};EmailImap[_0x75fc('0x18')][_0x75fc('0x27')]=function(){this[_0x75fc('0x2')][_0x75fc('0x28')](['UNSEEN'],this[_0x75fc('0x29')][_0x75fc('0x13')](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x29')]=function(_0x5c8adb,_0x214b30){if(_0x5c8adb){this['handleError'](_0x5c8adb,!![]);}else{if(_0x214b30[_0x75fc('0x2a')]){try{var _0x337032=this[_0x75fc('0x2')][_0x75fc('0x2b')](_0x214b30,{'bodies':'','markSeen':!![]});_0x337032['on']('message',this[_0x75fc('0x2c')]['bind'](this));_0x337032[_0x75fc('0x2d')](_0x75fc('0x16'),this['handleFetchError'][_0x75fc('0x13')](this));_0x337032[_0x75fc('0x2d')]('end',this[_0x75fc('0x2e')][_0x75fc('0x13')](this));}catch(_0xb50e9f){logger[_0x75fc('0x16')](_0xb50e9f);}}else{this[_0x75fc('0x2')][_0x75fc('0x2f')](!![],this[_0x75fc('0x30')][_0x75fc('0x13')](this));}}};EmailImap['prototype'][_0x75fc('0x2c')]=function(_0x447c13,_0x46dfa2){_0x447c13['on'](_0x75fc('0x31'),this[_0x75fc('0x32')][_0x75fc('0x13')](this));_0x447c13[_0x75fc('0x2d')](_0x75fc('0x33'),this[_0x75fc('0x34')][_0x75fc('0x13')](this));_0x447c13[_0x75fc('0x2d')](_0x75fc('0x14'),this[_0x75fc('0x35')]['bind'](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x32')]=function(_0x9636fe,_0x19e172){simpleParser(_0x9636fe,{'Iconv':Iconv},this['handleSimpleParser'][_0x75fc('0x13')](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x34')]=function(_0x10221b){};EmailImap[_0x75fc('0x18')][_0x75fc('0x35')]=function(){};EmailImap[_0x75fc('0x18')][_0x75fc('0x36')]=function(_0x5d0fdc,_0x9cd4bd){if(_0x5d0fdc){logger[_0x75fc('0x16')](_0x5d0fdc);}else{var _0x2b7398=this;utils[_0x75fc('0x37')](this[_0x75fc('0xf')],_0x9cd4bd,function(_0x443e1b){_0x2b7398['emit'](_0x75fc('0xc'),_0x443e1b);});}};EmailImap[_0x75fc('0x18')]['handleFetchEnd']=function(){this[_0x75fc('0x2')][_0x75fc('0x2f')](!![],this[_0x75fc('0x30')][_0x75fc('0x13')](this));};EmailImap[_0x75fc('0x18')]['handleFetchError']=function(_0x11434a){this['handleError'](_0x11434a);this[_0x75fc('0x2')][_0x75fc('0x2f')](!![],this[_0x75fc('0x30')][_0x75fc('0x13')](this));};EmailImap[_0x75fc('0x18')][_0x75fc('0x15')]=function(){this[_0x75fc('0x38')](_0x75fc('0x14'));};EmailImap[_0x75fc('0x18')]['handleError']=function(_0x382ca5,_0x3e8ec6){logger[_0x75fc('0x16')](_0x75fc('0x17'),this[_0x75fc('0xf')]['email'],JSON[_0x75fc('0x39')](_0x382ca5));var _0x2e0eab='';if(_0x382ca5){if(_0x382ca5[_0x75fc('0x3a')]){_0x2e0eab=_0x382ca5['textCode'];}else{for(var _0xf0a466 in _0x382ca5){if(_0x382ca5[_0x75fc('0x3b')](_0xf0a466)){_0x2e0eab+=_[_0x75fc('0x3c')](_0xf0a466)+':\x20'+_0x382ca5[_0xf0a466]+'\x0a';}}}}if(_0x3e8ec6){this[_0x75fc('0x2')][_0x75fc('0x14')]();}else{this[_0x75fc('0x38')](_0x75fc('0x16'),_0x2e0eab);this['emit'](_0x75fc('0x14'));}};module[_0x75fc('0x3d')]=EmailImap; \ No newline at end of file +var _0xd2bb=['hasOwnProperty','upperFirst','path','util','imap','lodash','randomstring','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','user','password','host','port','tls','required','service','handleOpenBox','bind','box','readUnseen','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify'];(function(_0x2bbcf0,_0x43665c){var _0x5a93ef=function(_0x28058b){while(--_0x28058b){_0x2bbcf0['push'](_0x2bbcf0['shift']());}};_0x5a93ef(++_0x43665c);}(_0xd2bb,0x1d2));var _0xbd2b=function(_0x1b9e40,_0x28e16f){_0x1b9e40=_0x1b9e40-0x0;var _0x2c0f56=_0xd2bb[_0x1b9e40];return _0x2c0f56;};'use strict';var fs=require('fs');var path=require(_0xbd2b('0x0'));var util=require(_0xbd2b('0x1'));var Imap=require(_0xbd2b('0x2'));var _=require(_0xbd2b('0x3'));var rs=require(_0xbd2b('0x4'));var simpleParser=require('mailparser')[_0xbd2b('0x5')];var Iconv=require('iconv')[_0xbd2b('0x6')];var EventEmitter=require(_0xbd2b('0x7'))[_0xbd2b('0x8')];var utils=require(_0xbd2b('0x9'));var logger=require(_0xbd2b('0xa'))(_0xbd2b('0xb'));function EmailImap(_0x552bb1,_0x2338f2){this[_0xbd2b('0xc')]='INBOX';this[_0xbd2b('0xd')]=this[_0xbd2b('0xe')](_0x552bb1,_0x2338f2);this['imap']=new Imap(this[_0xbd2b('0xd')]);this[_0xbd2b('0x2')][_0xbd2b('0xf')](_0xbd2b('0x10'),this[_0xbd2b('0x11')]['bind'](this));this['imap'][_0xbd2b('0xf')](_0xbd2b('0x12'),this[_0xbd2b('0x13')]['bind'](this));this['imap']['on']('error',this[_0xbd2b('0x14')]['bind'](this));this[_0xbd2b('0x2')][_0xbd2b('0x15')]();}util[_0xbd2b('0x16')](EmailImap,EventEmitter);EmailImap[_0xbd2b('0x17')]['getAccount']=function(_0x41099e,_0x581b5f){var _0x3a5372={'connTimeout':_0x41099e[_0xbd2b('0x18')]?_0x41099e[_0xbd2b('0x18')]*0x3e8:0x2710,'authTimeout':_0x41099e[_0xbd2b('0x19')]?_0x41099e[_0xbd2b('0x19')]*0x3e8:0x1388};if(_['isNil'](_0x41099e['service'])){if(_0x41099e['authentication']){_0x3a5372[_0xbd2b('0x1a')]=_0x41099e[_0xbd2b('0x1a')];_0x3a5372[_0xbd2b('0x1b')]=_0x41099e[_0xbd2b('0x1b')];}_0x3a5372[_0xbd2b('0x1c')]=_0x41099e[_0xbd2b('0x1c')];_0x3a5372[_0xbd2b('0x1d')]=_0x41099e[_0xbd2b('0x1d')]||0x3e1;if(_0x41099e[_0xbd2b('0x1e')]){_0x3a5372[_0xbd2b('0x1e')]=!![];}else{_0x3a5372[_0xbd2b('0x1e')]=![];_0x3a5372['autotls']=_0xbd2b('0x1f');}}else{_0x3a5372[_0xbd2b('0x1a')]=_0x41099e['user'];_0x3a5372['password']=_0x41099e['password'];_0x3a5372['host']=utils['getHost'](_0x41099e[_0xbd2b('0x20')]);_0x3a5372[_0xbd2b('0x1d')]=0x3e1;_0x3a5372[_0xbd2b('0x1e')]=!![];}_0x3a5372[_0xbd2b('0xb')]=_0x581b5f||_0x41099e['user']||'anonymous@xcally.com';return _0x3a5372;};EmailImap[_0xbd2b('0x17')][_0xbd2b('0x11')]=function(){this[_0xbd2b('0x2')]['openBox'](this[_0xbd2b('0xc')],![],this[_0xbd2b('0x21')][_0xbd2b('0x22')](this));};EmailImap['prototype'][_0xbd2b('0x21')]=function(_0x56a273,_0x24784a){if(_0x56a273){this['handleError'](_0x56a273,!![]);}else{this['emit'](_0xbd2b('0x23'),_0x24784a);this[_0xbd2b('0x24')]();}};EmailImap[_0xbd2b('0x17')]['handleCloseBox']=function(_0x524c3f){if(_0x524c3f){this[_0xbd2b('0x14')](_0x524c3f,!![]);}else{this[_0xbd2b('0x2')][_0xbd2b('0x12')]();}};EmailImap[_0xbd2b('0x17')][_0xbd2b('0x24')]=function(){this[_0xbd2b('0x2')]['search']([_0xbd2b('0x25')],this[_0xbd2b('0x26')][_0xbd2b('0x22')](this));};EmailImap[_0xbd2b('0x17')]['handleReadUnseen']=function(_0x1b9d78,_0x4ad000){if(_0x1b9d78){this[_0xbd2b('0x14')](_0x1b9d78,!![]);}else{if(_0x4ad000[_0xbd2b('0x27')]){try{var _0x46abb4=this[_0xbd2b('0x2')][_0xbd2b('0x28')](_0x4ad000,{'bodies':'','markSeen':!![]});_0x46abb4['on'](_0xbd2b('0x29'),this[_0xbd2b('0x2a')][_0xbd2b('0x22')](this));_0x46abb4[_0xbd2b('0xf')](_0xbd2b('0x2b'),this[_0xbd2b('0x2c')]['bind'](this));_0x46abb4[_0xbd2b('0xf')](_0xbd2b('0x12'),this[_0xbd2b('0x2d')][_0xbd2b('0x22')](this));}catch(_0x350013){logger['error'](_0x350013);}}else{this[_0xbd2b('0x2')][_0xbd2b('0x2e')](!![],this[_0xbd2b('0x2f')]['bind'](this));}}};EmailImap[_0xbd2b('0x17')][_0xbd2b('0x2a')]=function(_0x1c6bdb,_0x53d444){_0x1c6bdb['on'](_0xbd2b('0x30'),this[_0xbd2b('0x31')][_0xbd2b('0x22')](this));_0x1c6bdb[_0xbd2b('0xf')]('attributes',this[_0xbd2b('0x32')][_0xbd2b('0x22')](this));_0x1c6bdb['once']('end',this[_0xbd2b('0x33')]['bind'](this));};EmailImap[_0xbd2b('0x17')]['handleMessageBody']=function(_0x57ecf7,_0x4960eb){simpleParser(_0x57ecf7,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0xbd2b('0x17')]['handleMessageAttributes']=function(_0x9f6b86){};EmailImap[_0xbd2b('0x17')][_0xbd2b('0x33')]=function(){};EmailImap[_0xbd2b('0x17')][_0xbd2b('0x34')]=function(_0x2999e2,_0x52d165){if(_0x2999e2){logger[_0xbd2b('0x2b')](_0x2999e2);}else{var _0xae3a17=this;utils[_0xbd2b('0x35')](this[_0xbd2b('0xd')],_0x52d165,function(_0x4f5d25){_0xae3a17[_0xbd2b('0x36')]('email',_0x4f5d25);});}};EmailImap[_0xbd2b('0x17')][_0xbd2b('0x2d')]=function(){this['imap'][_0xbd2b('0x2e')](!![],this['handleCloseBox'][_0xbd2b('0x22')](this));};EmailImap['prototype'][_0xbd2b('0x2c')]=function(_0x4435b5){this[_0xbd2b('0x14')](_0x4435b5);this[_0xbd2b('0x2')]['closeBox'](!![],this[_0xbd2b('0x2f')][_0xbd2b('0x22')](this));};EmailImap['prototype'][_0xbd2b('0x13')]=function(){this[_0xbd2b('0x36')](_0xbd2b('0x12'));};EmailImap[_0xbd2b('0x17')][_0xbd2b('0x14')]=function(_0x4a9eb7,_0xedf34){logger[_0xbd2b('0x2b')](_0xbd2b('0x14'),this[_0xbd2b('0xd')][_0xbd2b('0xb')],JSON[_0xbd2b('0x37')](_0x4a9eb7));var _0x402060='';if(_0x4a9eb7){if(_0x4a9eb7['textCode']){_0x402060=_0x4a9eb7['textCode'];}else{for(var _0x4a9f9f in _0x4a9eb7){if(_0x4a9eb7[_0xbd2b('0x38')](_0x4a9f9f)){_0x402060+=_[_0xbd2b('0x39')](_0x4a9f9f)+':\x20'+_0x4a9eb7[_0x4a9f9f]+'\x0a';}}}}if(_0xedf34){this['imap'][_0xbd2b('0x12')]();}else{this[_0xbd2b('0x36')](_0xbd2b('0x2b'),_0x402060);this['emit'](_0xbd2b('0x12'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 01e3462..370841a 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 _0x6b12=['exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','use','sendMail','toString','createTransport','Not\x20verifired'];(function(_0x16f07d,_0x2ba1b5){var _0x2c3afb=function(_0x4cece0){while(--_0x4cece0){_0x16f07d['push'](_0x16f07d['shift']());}};_0x2c3afb(++_0x2ba1b5);}(_0x6b12,0x1a3));var _0x26b1=function(_0x384229,_0x269e36){_0x384229=_0x384229-0x0;var _0x3141f4=_0x6b12[_0x384229];return _0x3141f4;};'use strict';var nodemailer=require(_0x26b1('0x0'));var BPromise=require(_0x26b1('0x1'));var inlineBase64=require(_0x26b1('0x2'));function EmailSmtp(){}EmailSmtp[_0x26b1('0x3')][_0x26b1('0x4')]=function(_0x4ccde3,_0x18e02d){return new BPromise(function(_0x491a70,_0x422134){var _0x458e1b=nodemailer['createTransport'](_0x4ccde3);_0x458e1b[_0x26b1('0x5')]('compile',inlineBase64());_0x458e1b[_0x26b1('0x6')](_0x18e02d,function(_0x3082bf,_0x56de97){if(_0x3082bf){_0x422134(_0x3082bf[_0x26b1('0x7')]());}else{_0x491a70(_0x56de97);}});});};EmailSmtp['prototype']['verify']=function(_0x135487){return new BPromise(function(_0x555926,_0x2bbbdd){var _0x1eb10f=nodemailer[_0x26b1('0x8')](_0x135487);_0x1eb10f['verify'](function(_0x3fc14c,_0xe871d5){if(_0x3fc14c){_0x2bbbdd(_0x3fc14c[_0x26b1('0x7')]());}else{if(_0xe871d5){_0x555926(_0xe871d5);}else{_0x2bbbdd(_0x26b1('0x9'));}}});});};module[_0x26b1('0xa')]=EmailSmtp; \ No newline at end of file +var _0xa09d=['createTransport','toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','compile','sendMail','prototype','verify'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xa09d,0x1f3));var _0xda09=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0xa09d[_0x2d61b2];return _0x12df89;};'use strict';var nodemailer=require(_0xda09('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xda09('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xda09('0x2')]=function(_0x5c9a20,_0x5bdcda){return new BPromise(function(_0x518273,_0x1b64b9){var _0x11ef60=nodemailer['createTransport'](_0x5c9a20);_0x11ef60['use'](_0xda09('0x3'),inlineBase64());_0x11ef60[_0xda09('0x4')](_0x5bdcda,function(_0x33fac5,_0x3b98a3){if(_0x33fac5){_0x1b64b9(_0x33fac5['toString']());}else{_0x518273(_0x3b98a3);}});});};EmailSmtp[_0xda09('0x5')][_0xda09('0x6')]=function(_0x30f7af){return new BPromise(function(_0x464d51,_0x4a7a0a){var _0x2431e6=nodemailer[_0xda09('0x7')](_0x30f7af);_0x2431e6[_0xda09('0x6')](function(_0x4028e7,_0x5b882f){if(_0x4028e7){_0x4a7a0a(_0x4028e7[_0xda09('0x8')]());}else{if(_0x5b882f){_0x464d51(_0x5b882f);}else{_0x4a7a0a(_0xda09('0x9'));}}});});};module[_0xda09('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index d15a416..db0b342 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 _0x553a=['isEmpty','includes','bcc','attach','type','attachment','attachment-','format','%s-%s','now','join','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','moment','path','util','node-tnef','../../../config/environment','head','address','anonymous','generate','value','name','indexOf','split','length','slice','Anonymous','@xcally.com','html','replace','','body','textAsHtml','message','originCc','email'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x553a,0x192));var _0xa553=function(_0x5bb9ac,_0x417c09){_0x5bb9ac=_0x5bb9ac-0x0;var _0x38fd65=_0x553a[_0x5bb9ac];return _0x38fd65;};'use strict';var _=require('lodash');var moment=require(_0xa553('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0xa553('0x1'));var util=require(_0xa553('0x2'));var tnef=require(_0xa553('0x3'));var logger=require('../../../config/logger')('email');var config=require(_0xa553('0x4'));function getAddress(_0x50ecee){var _0x4b0e9b=_[_0xa553('0x5')](_0x50ecee['value']);return _0x4b0e9b&&_0x4b0e9b['address']?_0x4b0e9b[_0xa553('0x6')]:_0xa553('0x7')+random[_0xa553('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x25bbb7){var _0x5f09d8=_[_0xa553('0x5')](_0x25bbb7[_0xa553('0x9')]);if(_0x5f09d8&&_0x5f09d8[_0xa553('0xa')]){if(_0x5f09d8['name']==_0x5f09d8['address']){return _0x5f09d8[_0xa553('0xa')]['substring'](0x0,_0x5f09d8[_0xa553('0xa')][_0xa553('0xb')]('@'));}var _0x137813=_0x5f09d8['name'][_0xa553('0xc')](/\s+/);return _0x137813[_0xa553('0xd')]>0x1?_0x137813[_0xa553('0xe')](0x0,-0x1)['join']('\x20'):_0x5f09d8[_0xa553('0xa')];}return _0xa553('0xf');}function getLastName(_0x39f000){var _0x51df32=_['head'](_0x39f000[_0xa553('0x9')]);if(_0x51df32&&_0x51df32[_0xa553('0xa')]){var _0x14b019=_0x51df32[_0xa553('0xa')]['split'](/\s+/);return _0x14b019[_0xa553('0xd')]>0x1?_0x14b019['pop']():'';}return'';}function getMails(_0xaedbbc,_0x5a1270){var _0x509342='';for(var _0x1d0f4e=0x0;_0x1d0f4e<_0x5a1270['value'][_0xa553('0xd')];_0x1d0f4e+=0x1){if(_0x5a1270[_0xa553('0x9')][_0x1d0f4e][_0xa553('0x6')]!==_0xaedbbc){if(!_['isEmpty'](_0x509342)){_0x509342+=',';}_0x509342+=_0x5a1270[_0xa553('0x9')][_0x1d0f4e][_0xa553('0xa')]||_0x5a1270['value'][_0x1d0f4e][_0xa553('0x6')]||'';_0x509342+='\x20<';_0x509342+=_0x5a1270[_0xa553('0x9')][_0x1d0f4e]['address']?_0x5a1270[_0xa553('0x9')][_0x1d0f4e]['address']:_0xa553('0x7')+random[_0xa553('0x8')](0x6)+_0xa553('0x10');_0x509342+='>';}}return _0x509342;}function parseEmail(_0x238a99,_0x5792b9,_0x3cbbe8){if(_0x5792b9[_0xa553('0x11')]){var _0x137778=/)<[^<]*)*<\/script>/gi;while(_0x137778['test'](_0x5792b9[_0xa553('0x11')])){_0x5792b9['html']=_0x5792b9['html'][_0xa553('0x12')](_0x137778,'');}if(_0x5792b9[_0xa553('0x11')]['includes'](_0xa553('0x13'))){var _0x1c95bd=[];_0x5792b9[_0xa553('0x14')]['forEach'](_0x1d001a=>{_0x1c95bd[_0xa553('0x15')](_0x1d001a[_0xa553('0x16')]);});var _0x7b0d73=/]+>/g;var _0x247ce3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x49a916=_0x5792b9[_0xa553('0x11')][_0xa553('0x12')](_0x247ce3,'_SRC');var _0x5632f1=_0x49a916[_0xa553('0x12')](_0x7b0d73,_0xa553('0x17'));for(let _0x11b61e=0x0;_0x11b61e<_0x1c95bd[_0xa553('0xd')];_0x11b61e++){var _0x5e8e31=_0x5632f1[_0xa553('0x12')](_0xa553('0x17'),'\x20[Attachment:\x20'+_0x1c95bd[_0x11b61e]+_0xa553('0x18'));_0x5632f1=_0x5e8e31;}_0x5792b9[_0xa553('0x11')]=_0x5632f1;}_0x3cbbe8[_0xa553('0x19')]=_0x5792b9[_0xa553('0x11')];}else{_0x3cbbe8[_0xa553('0x19')]=_0x5792b9[_0xa553('0x1a')];}if(_0x3cbbe8[_0xa553('0x19')]){_0x3cbbe8[_0xa553('0x19')]=_0x3cbbe8[_0xa553('0x19')][_0xa553('0x12')](/0x0){var _0x427eb0=[_0xa553('0x2f'),_0xa553('0x30'),_0xa553('0x31')];for(var _0x2669c8=0x0;_0x2669c8<_0x5792b9[_0xa553('0x2e')][_0xa553('0xd')];_0x2669c8++){var _0xfbccf4=_[_0xa553('0xb')](_0x427eb0,_0x5792b9[_0xa553('0x2e')][_0x2669c8][_0xa553('0x32')]);if(_0xfbccf4>=0x0){_0x3cbbe8['isAutoreply']=!![];}}}return _0x3cbbe8;}exports['parser']=function(_0x30c332,_0x503a9d,_0x1a9d97){var _0x4786f0={'from':getAddress(_0x503a9d['from']),'firstName':getFirstName(_0x503a9d[_0xa553('0x33')]),'lastName':getLastName(_0x503a9d[_0xa553('0x33')]),'mapKey':'email','message':{'from':getMails(_0x30c332[_0xa553('0x1d')],_0x503a9d[_0xa553('0x33')]),'to':_0x30c332['email'],'cc':'','subject':_0x503a9d[_0xa553('0x34')]||'','messageId':_0x503a9d[_0xa553('0x35')],'inReplyTo':_0x503a9d['inReplyTo'],'sentAt':moment(_0x503a9d[_0xa553('0x36')])[_0xa553('0x25')](_0xa553('0x37')),'attach':![],'attachments':[]}};if(!_0x503a9d[_0xa553('0x11')]&&!_0x503a9d['textAsHtml']){var _0x149350=_[_0xa553('0x38')](_0x503a9d[_0xa553('0x14')],{'contentType':'application/ms-tnef'});if(_0x149350[_0xa553('0xd')]){logger[_0xa553('0x39')](util[_0xa553('0x25')](_0xa553('0x3a'),_0x503a9d[_0xa553('0x35')]));tnef[_0xa553('0x3b')](_['first'](_0x149350)['content'],function(_0x299883,_0x1f81bf){if(_0x1f81bf){_0x503a9d[_0xa553('0x11')]=_0x1f81bf[_0xa553('0x3c')]||_0xa553('0x3d');if(_0x1f81bf[_0xa553('0x3e')]){for(var _0x1534ac=0x0;_0x1534ac<_0x1f81bf[_0xa553('0x3e')]['length'];_0x1534ac++){var _0xf7ca1d=_0x1f81bf[_0xa553('0x3e')][_0x1534ac];_0x4786f0[_0xa553('0x1b')][_0xa553('0x14')][_0xa553('0x15')]({'filename':_0xf7ca1d[_0xa553('0x3f')],'content':Buffer[_0xa553('0x33')](_0xf7ca1d[_0xa553('0x40')])});}}}_0x1a9d97(parseEmail(_0x30c332,_0x503a9d,_0x4786f0));});}else{_0x503a9d[_0xa553('0x11')]='

Empty\x20message

';_0x1a9d97(parseEmail(_0x30c332,_0x503a9d,_0x4786f0));}}else{_0x1a9d97(parseEmail(_0x30c332,_0x503a9d,_0x4786f0));}};exports[_0xa553('0x41')]=function(_0x1d4678){switch(_0x1d4678){case'gmail':return _0xa553('0x42');case _0xa553('0x43'):return _0xa553('0x44');case'hotmail':return _0xa553('0x45');case _0xa553('0x46'):return _0xa553('0x47');}return'127.0.0.1';}; \ No newline at end of file +var _0xf811=['type','attachment','attachment-','%s-%s','now','writeFileSync','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','format','messageId','parseBuffer','first','BodyHTML','Attachments','Title','Data','getHost','gmail','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook.office365.com','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','forEach','push','filename','replace','_SRC','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x36ccd8[_0x1f81('0x14')](0x0,-0x1)[_0x1f81('0x15')]('\x20'):_0x513d73[_0x1f81('0xf')];}return _0x1f81('0x16');}function getLastName(_0x402c3f){var _0x37bc72=_[_0x1f81('0x9')](_0x402c3f['value']);if(_0x37bc72&&_0x37bc72[_0x1f81('0xf')]){var _0x2cc069=_0x37bc72['name']['split'](/\s+/);return _0x2cc069[_0x1f81('0x13')]>0x1?_0x2cc069[_0x1f81('0x17')]():'';}return'';}function getMails(_0x5da9d1,_0x3c042c){var _0x558761='';for(var _0x37434a=0x0;_0x37434a<_0x3c042c[_0x1f81('0xa')]['length'];_0x37434a+=0x1){if(_0x3c042c['value'][_0x37434a][_0x1f81('0xb')]!==_0x5da9d1){if(!_[_0x1f81('0x18')](_0x558761)){_0x558761+=',';}_0x558761+=_0x3c042c['value'][_0x37434a][_0x1f81('0xf')]||_0x3c042c['value'][_0x37434a][_0x1f81('0xb')]||'';_0x558761+='\x20<';_0x558761+=_0x3c042c[_0x1f81('0xa')][_0x37434a][_0x1f81('0xb')]?_0x3c042c['value'][_0x37434a][_0x1f81('0xb')]:_0x1f81('0xc')+random[_0x1f81('0xd')](0x6)+_0x1f81('0xe');_0x558761+='>';}}return _0x558761;}function parseEmail(_0x38e0bb,_0x20e351,_0x5e8577){if(_0x20e351[_0x1f81('0x19')]){var _0x37b6ff=/)<[^<]*)*<\/script>/gi;while(_0x37b6ff[_0x1f81('0x1a')](_0x20e351['html'])){_0x20e351['html']=_0x20e351[_0x1f81('0x19')]['replace'](_0x37b6ff,'');}if(_0x20e351[_0x1f81('0x19')]['includes']('{_0x34cdbc[_0x1f81('0x1c')](_0x599b8f[_0x1f81('0x1d')]);});var _0x147695=/]+>/g;var _0x17129b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x19dab0=_0x20e351[_0x1f81('0x19')][_0x1f81('0x1e')](_0x17129b,_0x1f81('0x1f'));var _0x34bc53=_0x19dab0[_0x1f81('0x1e')](_0x147695,'_IMG');for(let _0x292758=0x0;_0x292758<_0x34cdbc['length'];_0x292758++){var _0x2f1096=_0x34bc53[_0x1f81('0x1e')]('_IMG',_0x1f81('0x20')+_0x34cdbc[_0x292758]+_0x1f81('0x21'));_0x34bc53=_0x2f1096;}_0x20e351[_0x1f81('0x19')]=_0x34bc53;}_0x5e8577[_0x1f81('0x22')]=_0x20e351[_0x1f81('0x19')];}else{_0x5e8577[_0x1f81('0x22')]=_0x20e351[_0x1f81('0x23')];}if(_0x5e8577[_0x1f81('0x22')]){_0x5e8577['body']=_0x5e8577[_0x1f81('0x22')][_0x1f81('0x1e')](/0x0){var _0x4dcab0=[_0x1f81('0x32'),_0x1f81('0x33'),_0x1f81('0x34')];for(var _0x2133b5=0x0;_0x2133b5<_0x20e351[_0x1f81('0x31')][_0x1f81('0x13')];_0x2133b5++){var _0x5ac2a2=_[_0x1f81('0x11')](_0x4dcab0,_0x20e351[_0x1f81('0x31')][_0x2133b5][_0x1f81('0x35')]);if(_0x5ac2a2>=0x0){_0x5e8577[_0x1f81('0x36')]=!![];}}}return _0x5e8577;}exports['parser']=function(_0x2c9c48,_0x15c1b9,_0x55f194){var _0x3998d4={'from':getAddress(_0x15c1b9['from']),'firstName':getFirstName(_0x15c1b9[_0x1f81('0x37')]),'lastName':getLastName(_0x15c1b9['from']),'mapKey':_0x1f81('0x7'),'message':{'from':getMails(_0x2c9c48['email'],_0x15c1b9[_0x1f81('0x37')]),'to':_0x2c9c48[_0x1f81('0x7')],'cc':'','subject':_0x15c1b9[_0x1f81('0x38')]||'','messageId':_0x15c1b9['messageId'],'inReplyTo':_0x15c1b9[_0x1f81('0x39')],'sentAt':moment(_0x15c1b9[_0x1f81('0x3a')])['format'](_0x1f81('0x3b')),'attach':![],'attachments':[]}};if(!_0x15c1b9[_0x1f81('0x19')]&&!_0x15c1b9[_0x1f81('0x23')]){var _0x2c25e9=_[_0x1f81('0x3c')](_0x15c1b9[_0x1f81('0x2a')],{'contentType':_0x1f81('0x3d')});if(_0x2c25e9['length']){logger[_0x1f81('0x3e')](util[_0x1f81('0x3f')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x15c1b9[_0x1f81('0x40')]));tnef[_0x1f81('0x41')](_[_0x1f81('0x42')](_0x2c25e9)['content'],function(_0x25d345,_0xb1aac8){if(_0xb1aac8){_0x15c1b9['html']=_0xb1aac8[_0x1f81('0x43')]||'

Empty\x20message

';if(_0xb1aac8['Attachments']){for(var _0x19f10d=0x0;_0x19f10d<_0xb1aac8[_0x1f81('0x44')][_0x1f81('0x13')];_0x19f10d++){var _0x4fc5f6=_0xb1aac8['Attachments'][_0x19f10d];_0x3998d4[_0x1f81('0x25')]['attachments'][_0x1f81('0x1c')]({'filename':_0x4fc5f6[_0x1f81('0x45')],'content':Buffer[_0x1f81('0x37')](_0x4fc5f6[_0x1f81('0x46')])});}}}_0x55f194(parseEmail(_0x2c9c48,_0x15c1b9,_0x3998d4));});}else{_0x15c1b9[_0x1f81('0x19')]='

Empty\x20message

';_0x55f194(parseEmail(_0x2c9c48,_0x15c1b9,_0x3998d4));}}else{_0x55f194(parseEmail(_0x2c9c48,_0x15c1b9,_0x3998d4));}};exports[_0x1f81('0x47')]=function(_0x301ac8){switch(_0x301ac8){case _0x1f81('0x48'):return _0x1f81('0x49');case'yahoo':return'imap.mail.yahoo.com';case _0x1f81('0x4a'):return _0x1f81('0x4b');case'outlook365':return _0x1f81('0x4c');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 0f8596e..e6fd4a6 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc296=['name','key','SERV','active','Imap','Smtp','exports','lodash'];(function(_0x4292cd,_0x327a40){var _0x5e4838=function(_0x2d3786){while(--_0x2d3786){_0x4292cd['push'](_0x4292cd['shift']());}};_0x5e4838(++_0x327a40);}(_0xc296,0x10f));var _0x6c29=function(_0x2dcaf4,_0x16551d){_0x2dcaf4=_0x2dcaf4-0x0;var _0x58e941=_0xc296[_0x2dcaf4];return _0x58e941;};'use strict';var _=require(_0x6c29('0x0'));function MailAccount(_0x3d4a1c){this['id']=_0x3d4a1c['id']||0x0;this[_0x6c29('0x1')]=_0x3d4a1c[_0x6c29('0x1')]||'Service';this[_0x6c29('0x2')]=_0x3d4a1c[_0x6c29('0x2')]||_0x6c29('0x3');this[_0x6c29('0x4')]=_0x3d4a1c[_0x6c29('0x4')]||![];this[_0x6c29('0x5')]=_0x3d4a1c[_0x6c29('0x5')]||[];this[_0x6c29('0x6')]=_0x3d4a1c[_0x6c29('0x6')]||[];}module[_0x6c29('0x7')]=MailAccount; \ No newline at end of file +var _0x9aeb=['SERV','active','Imap','Smtp','exports','name','Service','key'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x9aeb,0xb5));var _0xb9ae=function(_0x125b01,_0x450777){_0x125b01=_0x125b01-0x0;var _0x1e7477=_0x9aeb[_0x125b01];return _0x1e7477;};'use strict';var _=require('lodash');function MailAccount(_0x163039){this['id']=_0x163039['id']||0x0;this[_0xb9ae('0x0')]=_0x163039['name']||_0xb9ae('0x1');this[_0xb9ae('0x2')]=_0x163039[_0xb9ae('0x2')]||_0xb9ae('0x3');this[_0xb9ae('0x4')]=_0x163039[_0xb9ae('0x4')]||![];this[_0xb9ae('0x5')]=_0x163039[_0xb9ae('0x5')]||[];this[_0xb9ae('0x6')]=_0x163039[_0xb9ae('0x6')]||[];}module[_0xb9ae('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 75e34b8..e7fc786 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5304=['mergeFromDatabase','initMailAccounts','length','isUndefined','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x1c3e47,_0x3d1b30){var _0x5d7a1b=function(_0x3aecf7){while(--_0x3aecf7){_0x1c3e47['push'](_0x1c3e47['shift']());}};_0x5d7a1b(++_0x3d1b30);}(_0x5304,0xff));var _0x4530=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0x5304[_0x5df033];return _0x445829;};'use strict';var _=require('lodash');var MailAccount=require(_0x4530('0x0'));var Realtime=function(){this[_0x4530('0x1')]={};};function freeIsNotKey(_0x1bea4b,_0x1c1e0d,_0x59774e){var _0x1d21b3=_[_0x4530('0x2')](_0x1bea4b,function(_0x5b6aa7,_0x57e1f0){return _0x5b6aa7[_0x59774e];});for(var _0x1b9548 in _0x1c1e0d){if(_0x1c1e0d[_0x4530('0x3')](_0x1b9548)){if(!_0x1d21b3[_0x1b9548]){delete _0x1c1e0d[_0x1b9548];}}}}Realtime[_0x4530('0x4')][_0x4530('0x5')]=function(_0x58b6f3,_0x597d4c){for(var _0x1cfd2e in _0x597d4c){if(_0x58b6f3[_0x4530('0x3')](_0x1cfd2e)){_0x58b6f3[_0x1cfd2e]=_0x597d4c[_0x1cfd2e];}}};Realtime[_0x4530('0x4')][_0x4530('0x6')]=function(){var _0x624b99=this;return function(_0x5e17ab){if(_0x5e17ab){freeIsNotKey(_0x5e17ab,_0x624b99[_0x4530('0x1')],'id');for(var _0x373348=0x0,_0x5ca8c0={},_0x17fd70={};_0x373348<_0x5e17ab[_0x4530('0x7')];_0x373348+=0x1){_0x5ca8c0=_0x5e17ab[_0x373348];if(_[_0x4530('0x8')](_0x624b99['mailAccounts'][_0x5ca8c0['id']])){_0x624b99['mailAccounts'][_0x5ca8c0['id']]=new MailAccount(_0x5ca8c0);}else{_['merge'](_0x624b99[_0x4530('0x1')][_0x5ca8c0['id']],_0x5ca8c0);}}}return _0x624b99[_0x4530('0x1')];};};module[_0x4530('0x9')]=Realtime; \ No newline at end of file +var _0xe84f=['mergeFromDatabase','length','exports','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x461fd5,_0x51747e){var _0x4e025b=function(_0x36d154){while(--_0x36d154){_0x461fd5['push'](_0x461fd5['shift']());}};_0x4e025b(++_0x51747e);}(_0xe84f,0x7b));var _0xfe84=function(_0x26c37a,_0x335c19){_0x26c37a=_0x26c37a-0x0;var _0x95217c=_0xe84f[_0x26c37a];return _0x95217c;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xfe84('0x0')]={};};function freeIsNotKey(_0x208d75,_0x266381,_0x2ca5b4){var _0x4ad3c7=_[_0xfe84('0x1')](_0x208d75,function(_0x260a79,_0x5b6aa5){return _0x260a79[_0x2ca5b4];});for(var _0x5f38ae in _0x266381){if(_0x266381[_0xfe84('0x2')](_0x5f38ae)){if(!_0x4ad3c7[_0x5f38ae]){delete _0x266381[_0x5f38ae];}}}}Realtime['prototype'][_0xfe84('0x3')]=function(_0x1fd6b2,_0x1cc06d){for(var _0x3e412a in _0x1cc06d){if(_0x1fd6b2['hasOwnProperty'](_0x3e412a)){_0x1fd6b2[_0x3e412a]=_0x1cc06d[_0x3e412a];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x264148=this;return function(_0x47fec8){if(_0x47fec8){freeIsNotKey(_0x47fec8,_0x264148[_0xfe84('0x0')],'id');for(var _0x4a541a=0x0,_0x2f278e={},_0x14d7e1={};_0x4a541a<_0x47fec8[_0xfe84('0x4')];_0x4a541a+=0x1){_0x2f278e=_0x47fec8[_0x4a541a];if(_['isUndefined'](_0x264148['mailAccounts'][_0x2f278e['id']])){_0x264148['mailAccounts'][_0x2f278e['id']]=new MailAccount(_0x2f278e);}else{_['merge'](_0x264148[_0xfe84('0x0')][_0x2f278e['id']],_0x2f278e);}}}return _0x264148['mailAccounts'];};};module[_0xfe84('0x5')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index d949141..ad50d7f 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5f3=['getMailAccounts','Request','name','service','email','ListId','TemplateId','MailServerIn','Imap','Smtp','getMailAccount','NotifyMailAccount','../client'];(function(_0x470212,_0x1387de){var _0x5083cb=function(_0x3bec27){while(--_0x3bec27){_0x470212['push'](_0x470212['shift']());}};_0x5083cb(++_0x1387de);}(_0xb5f3,0x137));var _0x3b5f=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xb5f3[_0x2f5a22];return _0x326b70;};'use strict';var client=require(_0x3b5f('0x0'));exports[_0x3b5f('0x1')]=function(){return function(){return client[_0x3b5f('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x3b5f('0x3'),_0x3b5f('0x4'),_0x3b5f('0x5'),'active','key',_0x3b5f('0x6'),_0x3b5f('0x7')],'raw':![],'include':[{'model':_0x3b5f('0x8'),'as':_0x3b5f('0x9')},{'model':'MailServerOut','as':_0x3b5f('0xa')}]},'log':_0x3b5f('0xb')});};};exports['notify']=function(_0x2e213c,_0x48597e){return client[_0x3b5f('0x2')](_0x3b5f('0xc'),{'account':{'id':_0x2e213c},'body':_0x48597e,'log':_0x3b5f('0xc')});}; \ No newline at end of file +var _0xc493=['active','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','service','email'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc493,0xba));var _0x3c49=function(_0x3ab848,_0x176c4e){_0x3ab848=_0x3ab848-0x0;var _0x5d89d3=_0xc493[_0x3ab848];return _0x5d89d3;};'use strict';var client=require(_0x3c49('0x0'));exports[_0x3c49('0x1')]=function(){return function(){return client['Request'](_0x3c49('0x2'),{'options':{'attributes':['id',_0x3c49('0x3'),_0x3c49('0x4'),_0x3c49('0x5'),_0x3c49('0x6'),_0x3c49('0x7'),_0x3c49('0x8'),_0x3c49('0x9')],'raw':![],'include':[{'model':_0x3c49('0xa'),'as':_0x3c49('0xb')},{'model':_0x3c49('0xc'),'as':_0x3c49('0xd')}]},'log':'getMailAccount'});};};exports[_0x3c49('0xe')]=function(_0x2a949d,_0x9744ba){return client['Request'](_0x3c49('0xf'),{'account':{'id':_0x2a949d},'body':_0x9744ba,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 8199447..1b8ebf0 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ce1=['getSettings','Request','ShowSetting'];(function(_0x474958,_0x32b2c3){var _0x48a8c7=function(_0x3880f3){while(--_0x3880f3){_0x474958['push'](_0x474958['shift']());}};_0x48a8c7(++_0x32b2c3);}(_0x0ce1,0xe1));var _0x10ce=function(_0x2fc917,_0x338d4c){_0x2fc917=_0x2fc917-0x0;var _0x17fa32=_0x0ce1[_0x2fc917];return _0x17fa32;};'use strict';var client=require('../client');exports[_0x10ce('0x0')]=function(){return client[_0x10ce('0x1')](_0x10ce('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file +var _0x6091=['GetSettings','Request','loginMailFrequency'];(function(_0x124409,_0x47f87b){var _0x39d8fa=function(_0x442c75){while(--_0x442c75){_0x124409['push'](_0x124409['shift']());}};_0x39d8fa(++_0x47f87b);}(_0x6091,0x70));var _0x1609=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x6091[_0x292f93];return _0x5a94b1;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x1609('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1609('0x1')]},'log':_0x1609('0x2')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d85beb3..90f2eb2 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 40f0dc9..f597f37 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2a9=['polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','../../config/environment','timeout','port','socket.io','websocket'];(function(_0x5cca5f,_0xc1ed0){var _0x35acb7=function(_0x31bc46){while(--_0x31bc46){_0x5cca5f['push'](_0x5cca5f['shift']());}};_0x35acb7(++_0xc1ed0);}(_0xd2a9,0x87));var _0x9d2a=function(_0x361190,_0x5517e1){_0x361190=_0x361190-0x0;var _0x56efe6=_0xd2a9[_0x361190];return _0x56efe6;};'use strict';var _=require('lodash');var http=require(_0x9d2a('0x0'));var express=require(_0x9d2a('0x1'));var sticky=require(_0x9d2a('0x2'));var Redis=require(_0x9d2a('0x3'));var config=require(_0x9d2a('0x4'));var app=express();var server=http['createServer'](app);server[_0x9d2a('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x9d2a('0x6')])){var socketio=require(_0x9d2a('0x7'))(server,{'transports':[_0x9d2a('0x8'),_0x9d2a('0x9')]});config[_0x9d2a('0xa')]=_[_0x9d2a('0xb')](config[_0x9d2a('0xa')],{'host':_0x9d2a('0xc'),'port':0x18eb});socketio[_0x9d2a('0xd')](require(_0x9d2a('0xe'))({'pubClient':new Redis(config[_0x9d2a('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x9d2a('0xf'))[_0x9d2a('0x10')]();require('../../config/socketio')['default'](socketio);require(_0x9d2a('0x11'))[_0x9d2a('0x10')](app);require(_0x9d2a('0x12'))[_0x9d2a('0x10')](app);}else{server[_0x9d2a('0x13')](_0x9d2a('0x14'),function(){console[_0x9d2a('0x15')](_0x9d2a('0x16'),config[_0x9d2a('0x6')]);});}exports=module[_0x9d2a('0x17')]=app; \ No newline at end of file +var _0x1e6f=['redis','default','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','../../config/environment','createServer','timeout','port','socket.io','polling','defaults','localhost','socket.io-redis'];(function(_0x471322,_0x4d1b2a){var _0x15a954=function(_0x10f1d2){while(--_0x10f1d2){_0x471322['push'](_0x471322['shift']());}};_0x15a954(++_0x4d1b2a);}(_0x1e6f,0x125));var _0xf1e6=function(_0x510b7b,_0x276601){_0x510b7b=_0x510b7b-0x0;var _0x445b95=_0x1e6f[_0x510b7b];return _0x445b95;};'use strict';var _=require(_0xf1e6('0x0'));var http=require(_0xf1e6('0x1'));var express=require(_0xf1e6('0x2'));var sticky=require('sticky-session');var Redis=require(_0xf1e6('0x3'));var config=require(_0xf1e6('0x4'));var app=express();var server=http[_0xf1e6('0x5')](app);server[_0xf1e6('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0xf1e6('0x7')])){var socketio=require(_0xf1e6('0x8'))(server,{'transports':['websocket',_0xf1e6('0x9')]});config['redis']=_[_0xf1e6('0xa')](config['redis'],{'host':_0xf1e6('0xb'),'port':0x18eb});socketio['adapter'](require(_0xf1e6('0xc'))({'pubClient':new Redis(config[_0xf1e6('0xd')]),'subClient':new Redis(config[_0xf1e6('0xd')])}));require('../../config/triggers')[_0xf1e6('0xe')]();require('../../config/socketio')[_0xf1e6('0xe')](socketio);require('../../config/express')['default'](app);require('../../routes')['default'](app);}else{server['once']('listening',function(){console[_0xf1e6('0xf')](_0xf1e6('0x10'),config[_0xf1e6('0x7')]);});}exports=module[_0xf1e6('0x11')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index ea57ca1..ad4ff22 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2af6=['routing','client','http','Request','request','then','error','rpc','message','result','catch','exports','jayson/promise','../../config/logger'];(function(_0xf3c348,_0x3e61c7){var _0x2cf48c=function(_0x50ea10){while(--_0x50ea10){_0xf3c348['push'](_0xf3c348['shift']());}};_0x2cf48c(++_0x3e61c7);}(_0x2af6,0x1e8));var _0x62af=function(_0x2cc418,_0x4e7c39){_0x2cc418=_0x2cc418-0x0;var _0x333a37=_0x2af6[_0x2cc418];return _0x333a37;};'use strict';var jayson=require(_0x62af('0x0'));var BPromise=require('bluebird');var logger=require(_0x62af('0x1'))(_0x62af('0x2'));var client=jayson[_0x62af('0x3')][_0x62af('0x4')]({'port':0x2329});client[_0x62af('0x5')]=function(_0x272e2e,_0x59cac0){return new BPromise(function(_0x35e23f,_0x2feb57){return client[_0x62af('0x6')](_0x272e2e,_0x59cac0)[_0x62af('0x7')](function(_0x4abf16){logger['debug']('rpc',_0x62af('0x2'),_0x272e2e,_0x59cac0,_0x4abf16);if(_0x4abf16[_0x62af('0x8')]){logger[_0x62af('0x8')](_0x62af('0x9'),_0x62af('0x2'),_0x272e2e,_0x4abf16['error']['message'],_0x59cac0);return _0x2feb57(_0x4abf16['error'][_0x62af('0xa')]);}else{return _0x35e23f(_0x4abf16[_0x62af('0xb')]);}})[_0x62af('0xc')](function(_0x1485ea){logger[_0x62af('0x8')]('rpc','routing',_0x272e2e,_0x1485ea,_0x59cac0);return _0x2feb57(_0x1485ea);});});};module[_0x62af('0xd')]=client; \ No newline at end of file +var _0x3f40=['client','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing'];(function(_0x33b744,_0x363cde){var _0x268463=function(_0x17498e){while(--_0x17498e){_0x33b744['push'](_0x33b744['shift']());}};_0x268463(++_0x363cde);}(_0x3f40,0x13f));var _0x03f4=function(_0x162805,_0x249508){_0x162805=_0x162805-0x0;var _0x161b33=_0x3f40[_0x162805];return _0x161b33;};'use strict';var jayson=require(_0x03f4('0x0'));var BPromise=require('bluebird');var logger=require(_0x03f4('0x1'))(_0x03f4('0x2'));var client=jayson[_0x03f4('0x3')]['http']({'port':0x2329});client[_0x03f4('0x4')]=function(_0x45f26e,_0x13b780){return new BPromise(function(_0x20e30e,_0xd4d6b2){return client[_0x03f4('0x5')](_0x45f26e,_0x13b780)[_0x03f4('0x6')](function(_0x5e4f36){logger[_0x03f4('0x7')](_0x03f4('0x8'),_0x03f4('0x2'),_0x45f26e,_0x13b780,_0x5e4f36);if(_0x5e4f36[_0x03f4('0x9')]){logger[_0x03f4('0x9')](_0x03f4('0x8'),_0x03f4('0x2'),_0x45f26e,_0x5e4f36['error']['message'],_0x13b780);return _0xd4d6b2(_0x5e4f36['error'][_0x03f4('0xa')]);}else{return _0x20e30e(_0x5e4f36[_0x03f4('0xb')]);}})[_0x03f4('0xc')](function(_0x537075){logger[_0x03f4('0x9')](_0x03f4('0x8'),'routing',_0x45f26e,_0x537075,_0x13b780);return _0xd4d6b2(_0x537075);});});};module[_0x03f4('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 903c2f7..522fd5e 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55fd=['getAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve'];(function(_0x2c3c92,_0x1f7932){var _0x5e95a4=function(_0x7da12c){while(--_0x7da12c){_0x2c3c92['push'](_0x2c3c92['shift']());}};_0x5e95a4(++_0x1f7932);}(_0x55fd,0x13b));var _0xd55f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x55fd[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0xd55f('0x0'));var server=require(_0xd55f('0x1'));var Realtime=require('./realtime');var user=require(_0xd55f('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xd55f('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xd55f('0x4'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xd55f('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd55f('0x6')]()['then'](user[_0xd55f('0x7')]())['then'](realtime['initAgents']())[_0xd55f('0x8')](interval[_0xd55f('0x9')]())[_0xd55f('0x8')](realtime[_0xd55f('0xa')]())[_0xd55f('0x8')](openchannelQueue[_0xd55f('0xb')]())[_0xd55f('0x8')](realtime[_0xd55f('0xc')]())[_0xd55f('0x8')](chatQueue[_0xd55f('0xd')]())[_0xd55f('0x8')](realtime[_0xd55f('0xe')]())['then'](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0xd55f('0x8')](mailQueue[_0xd55f('0xf')]())[_0xd55f('0x8')](realtime['initMailQueues']())[_0xd55f('0x8')](faxQueue[_0xd55f('0x10')]())[_0xd55f('0x8')](realtime[_0xd55f('0x11')]())['then'](whatsappQueue[_0xd55f('0x12')]())['then'](realtime[_0xd55f('0x13')]())[_0xd55f('0x8')](function(){return realtime;});}function main(){return server[_0xd55f('0x14')](realtime)[_0xd55f('0x8')](function(_0x4f5a41){return initRealtime();})[_0xd55f('0x8')](function(_0x40175c){return setInterval(initRealtime,0x1388);})[_0xd55f('0x15')](function(_0x2a33de){console[_0xd55f('0x16')](_0x2a33de);});}main(); \ No newline at end of file +var _0x304f=['bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','log'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x304f,0x69));var _0xf304=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x304f[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xf304('0x0'));var server=require(_0xf304('0x1'));var Realtime=require(_0xf304('0x2'));var user=require('./rpc/user');var interval=require(_0xf304('0x3'));var openchannelQueue=require(_0xf304('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xf304('0x5'));var mailQueue=require(_0xf304('0x6'));var faxQueue=require(_0xf304('0x7'));var whatsappQueue=require(_0xf304('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf304('0x9')]()[_0xf304('0xa')](user['getAgents']())[_0xf304('0xa')](realtime['initAgents']())[_0xf304('0xa')](interval[_0xf304('0xb')]())[_0xf304('0xa')](realtime['initIntervals']())[_0xf304('0xa')](openchannelQueue[_0xf304('0xc')]())['then'](realtime['initOpenchannelQueues']())[_0xf304('0xa')](chatQueue[_0xf304('0xd')]())[_0xf304('0xa')](realtime[_0xf304('0xe')]())[_0xf304('0xa')](smsQueue[_0xf304('0xf')]())[_0xf304('0xa')](realtime['initSmsQueues']())[_0xf304('0xa')](mailQueue[_0xf304('0x10')]())[_0xf304('0xa')](realtime[_0xf304('0x11')]())['then'](faxQueue['getFaxQueues']())[_0xf304('0xa')](realtime[_0xf304('0x12')]())[_0xf304('0xa')](whatsappQueue[_0xf304('0x13')]())['then'](realtime['initWhatsappQueues']())[_0xf304('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xf304('0xa')](function(_0x53d06b){return initRealtime();})[_0xf304('0xa')](function(_0x597c16){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1c9be1){console[_0xf304('0x14')](_0x1c9be1);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 363c764..d7de9b8 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1261,0x144));var _0x1126=function(_0x422994,_0x99047b){_0x422994=_0x422994-0x0;var _0x43ad8f=_0x1261[_0x422994];return _0x43ad8f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x552c27,_0x478dc2){_0x552c27=_0x552c27-0x0;var _0x2a0922=_0x1261[_0x552c27];return _0x2a0922;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index a89c8c1..f09cb0c 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34c0=['result','catch','sendMailMessage','jayson/promise','client','http','then','error','message'];(function(_0x334461,_0xe01226){var _0x11a893=function(_0xbb86bb){while(--_0xbb86bb){_0x334461['push'](_0x334461['shift']());}};_0x11a893(++_0xe01226);}(_0x34c0,0x18f));var _0x034c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34c0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x034c('0x0'));var client=jayson[_0x034c('0x1')][_0x034c('0x2')]({'port':0x232b});function request(_0xa80f73,_0x36060d){return new BPromise(function(_0x1c23f5,_0x4454bd){return client['request'](_0xa80f73,_0x36060d)[_0x034c('0x3')](function(_0x43285b){if(_0x43285b[_0x034c('0x4')]){return _0x4454bd(_0x43285b['error'][_0x034c('0x5')]);}else{return _0x1c23f5(_0x43285b[_0x034c('0x6')]);}})[_0x034c('0x7')](function(_0x42c2eb){return _0x4454bd(_0x42c2eb);});});}exports[_0x034c('0x8')]=function(_0x2f1713,_0x5e141e){return request('SendMail',{'account':_0x2f1713,'message':_0x5e141e});}; \ No newline at end of file +var _0x22d3=['then','error','result','catch','sendMailMessage','SendMail','jayson/promise','client','request'];(function(_0x1576fc,_0x81265d){var _0x2c1ed7=function(_0x5131ac){while(--_0x5131ac){_0x1576fc['push'](_0x1576fc['shift']());}};_0x2c1ed7(++_0x81265d);}(_0x22d3,0x1d1));var _0x322d=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x22d3[_0x4cd21c];return _0x5d8e5e;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x322d('0x0'));var client=jayson[_0x322d('0x1')]['http']({'port':0x232b});function request(_0x136261,_0x23a9ad){return new BPromise(function(_0x3c2974,_0x270f7c){return client[_0x322d('0x2')](_0x136261,_0x23a9ad)[_0x322d('0x3')](function(_0x8f0d73){if(_0x8f0d73[_0x322d('0x4')]){return _0x270f7c(_0x8f0d73['error']['message']);}else{return _0x3c2974(_0x8f0d73[_0x322d('0x5')]);}})[_0x322d('0x6')](function(_0x4c8e0c){return _0x270f7c(_0x4c8e0c);});});}exports[_0x322d('0x7')]=function(_0x18cad4,_0x35028c){return request(_0x322d('0x8'),{'account':_0x18cad4,'message':_0x35028c});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 981a1e6..9893b68 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1dc=['stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','chat','fax','sms','whatsapp','length','StatusTime','Status','chatCapacity','faxCurrentCapacity','openchannelCurrentCapacity','busyQueue'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb1dc,0xb7));var _0xcb1d=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xb1dc[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xcb1d('0x0'));var moment=require(_0xcb1d('0x1'));var md5=require(_0xcb1d('0x2'));var Redis=require(_0xcb1d('0x3'));var config=require(_0xcb1d('0x4'));config[_0xcb1d('0x5')]=_[_0xcb1d('0x6')](config[_0xcb1d('0x5')],{'host':_0xcb1d('0x7'),'port':0x18eb});var io=require(_0xcb1d('0x8'))(new Redis(config[_0xcb1d('0x5')]));function Agent(_0x88b451){this['id']=_0x88b451['id']||0x0;this[_0xcb1d('0x9')]=_0x88b451[_0xcb1d('0x9')]||'';this[_0xcb1d('0xa')]=_0x88b451[_0xcb1d('0xa')]||!![];this[_0xcb1d('0xb')]=_0x88b451['voicePause']||![];this[_0xcb1d('0xc')]=_0x88b451[_0xcb1d('0xc')]||![];this[_0xcb1d('0xd')]=_0x88b451[_0xcb1d('0xd')]||![];this[_0xcb1d('0xe')]=_0x88b451[_0xcb1d('0xe')]||![];this['smsPause']=_0x88b451[_0xcb1d('0xf')]||![];this[_0xcb1d('0x10')]=_0x88b451[_0xcb1d('0x10')]||![];this['chatStatus']=_0xcb1d('0x11');this[_0xcb1d('0x12')]=0x0;this['chatCapacity']=_0x88b451['chatCapacity']||0x0;this[_0xcb1d('0x13')]=0x0;this[_0xcb1d('0x14')]=_0xcb1d('0x11');this[_0xcb1d('0x15')]=0x0;this[_0xcb1d('0x16')]=_0x88b451[_0xcb1d('0x16')]||0x0;this[_0xcb1d('0x17')]=0x0;this[_0xcb1d('0x18')]=_0xcb1d('0x11');this[_0xcb1d('0x19')]=0x0;this[_0xcb1d('0x1a')]=_0x88b451[_0xcb1d('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xcb1d('0x1b')]='unknown';this[_0xcb1d('0x1c')]=0x0;this[_0xcb1d('0x1d')]=_0x88b451[_0xcb1d('0x1d')]||0x0;this[_0xcb1d('0x1e')]=0x0;this[_0xcb1d('0x1f')]=_0xcb1d('0x11');this[_0xcb1d('0x20')]=0x0;this[_0xcb1d('0x21')]=_0x88b451['whatsappCapacity']||0x0;this[_0xcb1d('0x22')]=0x0;this[_0xcb1d('0x23')]=_0xcb1d('0x11');this[_0xcb1d('0x24')]=0x0;this[_0xcb1d('0x25')]=_0x88b451['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xcb1d('0x26')]=![];this['busyQueue']=undefined;this['md5']='';this[_0xcb1d('0x27')]();}Agent[_0xcb1d('0x28')][_0xcb1d('0x29')]=function(_0x7df727){if(this[_0x7df727+_0xcb1d('0x2a')]>0x0){if(this[_0x7df727+_0xcb1d('0x2b')]>0x0&&this[_0x7df727+_0xcb1d('0x2a')]>=this[_0x7df727+'Capacity']){return _0xcb1d('0x2c');}else{return'working';}}else{return _0xcb1d('0x2d');}};Agent[_0xcb1d('0x28')][_0xcb1d('0x27')]=function(){var _0x22dcc9=['mail',_0xcb1d('0x2e'),'openchannel',_0xcb1d('0x2f'),_0xcb1d('0x30'),_0xcb1d('0x31')];for(var _0x3d610d=0x0;_0x3d610d<_0x22dcc9[_0xcb1d('0x32')];_0x3d610d+=0x1){var _0x56132d=this[_0xcb1d('0x29')](_0x22dcc9[_0x3d610d]);if(this[_0x22dcc9[_0x3d610d]+'Status']!==_0x56132d){this[_0x22dcc9[_0x3d610d]+_0xcb1d('0x33')]=_['toNumber'](moment()['format']('x'));}this[_0x22dcc9[_0x3d610d]+_0xcb1d('0x34')]=_0x56132d;}var _0x3fd39e={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xcb1d('0xb')],'chatPause':this[_0xcb1d('0xc')],'mailPause':this[_0xcb1d('0xd')],'smsPause':this[_0xcb1d('0xf')],'faxPause':this[_0xcb1d('0xe')],'openchannelPause':this[_0xcb1d('0x10')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xcb1d('0x12')],'chatCapacity':this[_0xcb1d('0x35')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xcb1d('0x14')],'mailStatusTime':this[_0xcb1d('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xcb1d('0x18')],'faxStatusTime':this[_0xcb1d('0x19')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xcb1d('0x36')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xcb1d('0x1c')],'smsCapacity':this[_0xcb1d('0x1d')],'smsCurrentCapacity':this[_0xcb1d('0x1e')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xcb1d('0x20')],'whatsappCapacity':this[_0xcb1d('0x21')],'whatsappCurrentCapacity':this[_0xcb1d('0x22')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xcb1d('0x25')],'openchannelCurrentCapacity':this[_0xcb1d('0x37')],'busy':this[_0xcb1d('0x26')],'busyQueue':this[_0xcb1d('0x38')]};var _0x1dc8c4=md5(JSON[_0xcb1d('0x39')](_0x3fd39e));if(this[_0xcb1d('0x2')]!==_0x1dc8c4){this['md5']=_0x1dc8c4;io[_0xcb1d('0x3a')]('user:save',_0x3fd39e);}};module[_0xcb1d('0x3b')]=Agent; \ No newline at end of file +var _0x9421=['smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCurrentCapacity','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','prototype','chat','fax','whatsapp','getChannelStatus','Status','StatusTime','toNumber','format','faxStatus','smsStatus','smsStatusTime','openchannelStatusTime','openchannelCapacity','busy','busyQueue','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','name','online','voicePause','chatPause','mailPause','faxPause'];(function(_0x57f3f8,_0x2e6248){var _0x2782f9=function(_0x34107a){while(--_0x34107a){_0x57f3f8['push'](_0x57f3f8['shift']());}};_0x2782f9(++_0x2e6248);}(_0x9421,0x155));var _0x1942=function(_0x53ddbb,_0x1b76b9){_0x53ddbb=_0x53ddbb-0x0;var _0x32ab79=_0x9421[_0x53ddbb];return _0x32ab79;};'use strict';var _=require(_0x1942('0x0'));var moment=require(_0x1942('0x1'));var md5=require(_0x1942('0x2'));var Redis=require(_0x1942('0x3'));var config=require(_0x1942('0x4'));config['redis']=_[_0x1942('0x5')](config[_0x1942('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1942('0x6')]));function Agent(_0x3b2509){this['id']=_0x3b2509['id']||0x0;this[_0x1942('0x7')]=_0x3b2509['name']||'';this[_0x1942('0x8')]=_0x3b2509[_0x1942('0x8')]||!![];this[_0x1942('0x9')]=_0x3b2509[_0x1942('0x9')]||![];this[_0x1942('0xa')]=_0x3b2509['chatPause']||![];this[_0x1942('0xb')]=_0x3b2509[_0x1942('0xb')]||![];this[_0x1942('0xc')]=_0x3b2509['faxPause']||![];this['smsPause']=_0x3b2509[_0x1942('0xd')]||![];this['openchannelPause']=_0x3b2509[_0x1942('0xe')]||![];this[_0x1942('0xf')]=_0x1942('0x10');this[_0x1942('0x11')]=0x0;this[_0x1942('0x12')]=_0x3b2509[_0x1942('0x12')]||0x0;this[_0x1942('0x13')]=0x0;this[_0x1942('0x14')]=_0x1942('0x10');this[_0x1942('0x15')]=0x0;this[_0x1942('0x16')]=_0x3b2509[_0x1942('0x16')]||0x0;this[_0x1942('0x17')]=0x0;this['faxStatus']='unknown';this[_0x1942('0x18')]=0x0;this[_0x1942('0x19')]=_0x3b2509[_0x1942('0x19')]||0x0;this[_0x1942('0x1a')]=0x0;this['smsStatus']=_0x1942('0x10');this['smsStatusTime']=0x0;this[_0x1942('0x1b')]=_0x3b2509[_0x1942('0x1b')]||0x0;this[_0x1942('0x1c')]=0x0;this[_0x1942('0x1d')]='unknown';this[_0x1942('0x1e')]=0x0;this[_0x1942('0x1f')]=_0x3b2509[_0x1942('0x1f')]||0x0;this[_0x1942('0x20')]=0x0;this[_0x1942('0x21')]=_0x1942('0x10');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x3b2509['openchannelCapacity']||0x0;this[_0x1942('0x22')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x1942('0x2')]='';this[_0x1942('0x23')]();}Agent['prototype']['getChannelStatus']=function(_0x530efc){if(this[_0x530efc+_0x1942('0x24')]>0x0){if(this[_0x530efc+_0x1942('0x25')]>0x0&&this[_0x530efc+_0x1942('0x24')]>=this[_0x530efc+_0x1942('0x25')]){return _0x1942('0x26');}else{return _0x1942('0x27');}}else{return'idle';}};Agent[_0x1942('0x28')]['updateRealtime']=function(){var _0x2e6956=['mail',_0x1942('0x29'),'openchannel',_0x1942('0x2a'),'sms',_0x1942('0x2b')];for(var _0x425267=0x0;_0x425267<_0x2e6956['length'];_0x425267+=0x1){var _0x5a8889=this[_0x1942('0x2c')](_0x2e6956[_0x425267]);if(this[_0x2e6956[_0x425267]+_0x1942('0x2d')]!==_0x5a8889){this[_0x2e6956[_0x425267]+_0x1942('0x2e')]=_[_0x1942('0x2f')](moment()[_0x1942('0x30')]('x'));}this[_0x2e6956[_0x425267]+'Status']=_0x5a8889;}var _0x3269ed={'id':this['id'],'name':this[_0x1942('0x7')],'online':this['online'],'voicePause':this[_0x1942('0x9')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x1942('0xd')],'faxPause':this[_0x1942('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x1942('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x1942('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x1942('0x14')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x1942('0x17')],'faxStatus':this[_0x1942('0x31')],'faxStatusTime':this[_0x1942('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x1942('0x1a')],'smsStatus':this[_0x1942('0x32')],'smsStatusTime':this[_0x1942('0x33')],'smsCapacity':this[_0x1942('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x1942('0x1f')],'whatsappCurrentCapacity':this[_0x1942('0x20')],'openchannelStatus':this[_0x1942('0x21')],'openchannelStatusTime':this[_0x1942('0x34')],'openchannelCapacity':this[_0x1942('0x35')],'openchannelCurrentCapacity':this[_0x1942('0x22')],'busy':this[_0x1942('0x36')],'busyQueue':this[_0x1942('0x37')]};var _0x29f5f8=md5(JSON[_0x1942('0x38')](_0x3269ed));if(this['md5']!==_0x29f5f8){this[_0x1942('0x2')]=_0x29f5f8;io[_0x1942('0x39')]('user:save',_0x3269ed);}};module[_0x1942('0x3a')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 9f0ee8b..bf0e80d 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 _0x8093=['defaults','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','online','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0x8093,0x67));var _0x3809=function(_0x513835,_0x93de04){_0x513835=_0x513835-0x0;var _0x567b24=_0x8093[_0x513835];return _0x567b24;};'use strict';var _=require(_0x3809('0x0'));var md5=require(_0x3809('0x1'));var util=require('util');var Redis=require(_0x3809('0x2'));var config=require(_0x3809('0x3'));config[_0x3809('0x4')]=_[_0x3809('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3809('0x4')]));function ChatQueue(_0x18de16){this['id']=_0x18de16['id']||0x0;this[_0x3809('0x6')]=_0x18de16[_0x3809('0x6')]||'';this[_0x3809('0x7')]=_0x18de16[_0x3809('0x7')]||0xa;this['strategy']=_0x18de16[_0x3809('0x8')]||'beepall';this[_0x3809('0x9')]=_0x18de16[_0x3809('0x9')];this[_0x3809('0xa')]={};this['waiting']=0x0;this[_0x3809('0x1')]='';this[_0x3809('0xb')]();this[_0x3809('0xc')]();}ChatQueue['prototype'][_0x3809('0xb')]=function(){var _0x3984e0=this[_0x3809('0xa')][_0x3809('0xd')];this[_0x3809('0xa')]=_['map'](this[_0x3809('0x9')],'id');this[_0x3809('0xa')][_0x3809('0xd')]=_0x3984e0;};ChatQueue[_0x3809('0xe')][_0x3809('0xc')]=function(){this[_0x3809('0xf')]=0x0;this[_0x3809('0x10')]=0x0;for(var _0x364e22=0x0;_0x364e22=0x0?this['available']:0x0;var _0x33146f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3809('0xf')],'name':this[_0x3809('0x6')],'paused':this[_0x3809('0x10')],'waiting':this[_0x3809('0x14')]};var _0x13cd75=md5(JSON[_0x3809('0x15')](_0x33146f));if(this[_0x3809('0x1')]!==_0x13cd75){this['md5']=_0x13cd75;io['to'](util[_0x3809('0x16')](_0x3809('0x17'),_0x33146f[_0x3809('0x6')]))[_0x3809('0x18')](_0x3809('0x19'),_0x33146f);}};module[_0x3809('0x1a')]=ChatQueue; \ No newline at end of file +var _0x4394=['format','emit','chat_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','chatPause','available','stringify'];(function(_0x4ac5a4,_0x248114){var _0x35e907=function(_0x325bf4){while(--_0x325bf4){_0x4ac5a4['push'](_0x4ac5a4['shift']());}};_0x35e907(++_0x248114);}(_0x4394,0xd4));var _0x4439=function(_0x3cdcbe,_0x450f7b){_0x3cdcbe=_0x3cdcbe-0x0;var _0x5846a1=_0x4394[_0x3cdcbe];return _0x5846a1;};'use strict';var _=require(_0x4439('0x0'));var md5=require(_0x4439('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x4439('0x2'));config[_0x4439('0x3')]=_[_0x4439('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4439('0x3')]));function ChatQueue(_0x30a2f7){this['id']=_0x30a2f7['id']||0x0;this[_0x4439('0x5')]=_0x30a2f7[_0x4439('0x5')]||'';this['timeout']=_0x30a2f7[_0x4439('0x6')]||0xa;this['strategy']=_0x30a2f7[_0x4439('0x7')]||_0x4439('0x8');this[_0x4439('0x9')]=_0x30a2f7[_0x4439('0x9')];this[_0x4439('0xa')]={};this[_0x4439('0xb')]=0x0;this[_0x4439('0x1')]='';this[_0x4439('0xc')]();this['updateRealtime']();}ChatQueue['prototype']['updateRouting']=function(){var _0xe37017=this[_0x4439('0xa')][_0x4439('0xd')];this['mapAgentsId']=_[_0x4439('0xe')](this[_0x4439('0x9')],'id');this['mapAgentsId'][_0x4439('0xd')]=_0xe37017;};ChatQueue['prototype'][_0x4439('0xf')]=function(){this[_0x4439('0x10')]=0x0;this[_0x4439('0x11')]=0x0;for(var _0x1d2932=0x0;_0x1d2932=0x0?this[_0x4439('0x14')]:0x0;var _0x4ad311={'id':this['id'],'available':this[_0x4439('0x14')],'loggedIn':this[_0x4439('0x10')],'name':this[_0x4439('0x5')],'paused':this[_0x4439('0x11')],'waiting':this['waiting']};var _0x3fdab9=md5(JSON[_0x4439('0x15')](_0x4ad311));if(this['md5']!==_0x3fdab9){this['md5']=_0x3fdab9;io['to'](util[_0x4439('0x16')]('chat:queue:%s',_0x4ad311[_0x4439('0x5')]))[_0x4439('0x17')](_0x4439('0x18'),_0x4ad311);}};module[_0x4439('0x19')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index cf5f90e..cb46446 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 _0x5aa0=['Agents','mapAgentsId','md5','updateRouting','prototype','_rr','updateRealtime','length','online','faxPause','paused','loggedIn','available','waiting','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x5aa0,0x1b7));var _0x05aa=function(_0x1e56a4,_0x2f288d){_0x1e56a4=_0x1e56a4-0x0;var _0x5cafe0=_0x5aa0[_0x1e56a4];return _0x5cafe0;};'use strict';var _=require(_0x05aa('0x0'));var md5=require('md5');var util=require(_0x05aa('0x1'));var Redis=require(_0x05aa('0x2'));var config=require(_0x05aa('0x3'));config[_0x05aa('0x4')]=_[_0x05aa('0x5')](config[_0x05aa('0x4')],{'host':_0x05aa('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x05aa('0x4')]));function FaxQueue(_0x1685f3){this['id']=_0x1685f3['id']||0x0;this[_0x05aa('0x7')]=_0x1685f3[_0x05aa('0x7')]||'';this[_0x05aa('0x8')]=_0x1685f3['timeout']||0xa;this[_0x05aa('0x9')]=_0x1685f3[_0x05aa('0x9')]||_0x05aa('0xa');this[_0x05aa('0xb')]=_0x1685f3[_0x05aa('0xb')];this[_0x05aa('0xc')]={};this['waiting']=0x0;this[_0x05aa('0xd')]='';this[_0x05aa('0xe')]();this['updateRealtime']();}FaxQueue[_0x05aa('0xf')]['updateRouting']=function(){var _0x557e41=this[_0x05aa('0xc')][_0x05aa('0x10')];this['mapAgentsId']=_['map'](this[_0x05aa('0xb')],'id');this[_0x05aa('0xc')][_0x05aa('0x10')]=_0x557e41;};FaxQueue['prototype'][_0x05aa('0x11')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4cbd98=0x0;_0x4cbd98=0x0?this[_0x05aa('0x17')]:0x0;var _0x28c69f={'id':this['id'],'available':this[_0x05aa('0x17')],'loggedIn':this[_0x05aa('0x16')],'name':this[_0x05aa('0x7')],'paused':this[_0x05aa('0x15')],'waiting':this[_0x05aa('0x18')]};var _0x41d808=md5(JSON[_0x05aa('0x19')](_0x28c69f));if(this['md5']!==_0x41d808){this[_0x05aa('0xd')]=_0x41d808;io['to'](util[_0x05aa('0x1a')](_0x05aa('0x1b'),_0x28c69f[_0x05aa('0x7')]))['emit'](_0x05aa('0x1c'),_0x28c69f);}};module[_0x05aa('0x1d')]=FaxQueue; \ No newline at end of file +var _0x93d1=['mapAgentsId','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','online','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x93d1,0xd4));var _0x193d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93d1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x193d('0x0'));var md5=require(_0x193d('0x1'));var util=require(_0x193d('0x2'));var Redis=require(_0x193d('0x3'));var config=require(_0x193d('0x4'));config[_0x193d('0x5')]=_[_0x193d('0x6')](config[_0x193d('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x193d('0x7'))(new Redis(config[_0x193d('0x5')]));function FaxQueue(_0x2ef243){this['id']=_0x2ef243['id']||0x0;this[_0x193d('0x8')]=_0x2ef243[_0x193d('0x8')]||'';this[_0x193d('0x9')]=_0x2ef243['timeout']||0xa;this[_0x193d('0xa')]=_0x2ef243['strategy']||'beepall';this[_0x193d('0xb')]=_0x2ef243[_0x193d('0xb')];this[_0x193d('0xc')]={};this['waiting']=0x0;this[_0x193d('0x1')]='';this[_0x193d('0xd')]();this[_0x193d('0xe')]();}FaxQueue[_0x193d('0xf')][_0x193d('0xd')]=function(){var _0x3cab4f=this['mapAgentsId']['_rr'];this[_0x193d('0xc')]=_[_0x193d('0x10')](this[_0x193d('0xb')],'id');this[_0x193d('0xc')]['_rr']=_0x3cab4f;};FaxQueue[_0x193d('0xf')][_0x193d('0xe')]=function(){this[_0x193d('0x11')]=0x0;this[_0x193d('0x12')]=0x0;for(var _0x5e34b7=0x0;_0x5e34b7=0x0?this['available']:0x0;var _0x200b55={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x193d('0x12')],'waiting':this[_0x193d('0x15')]};var _0x1e558d=md5(JSON[_0x193d('0x16')](_0x200b55));if(this[_0x193d('0x1')]!==_0x1e558d){this[_0x193d('0x1')]=_0x1e558d;io['to'](util[_0x193d('0x17')](_0x193d('0x18'),_0x200b55['name']))[_0x193d('0x19')](_0x193d('0x1a'),_0x200b55);}};module[_0x193d('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c85bccb..2b94966 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 _0x783d=['exports','name','Intervals'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x783d,0x97));var _0xd783=function(_0x28e0ff,_0x5bb56c){_0x28e0ff=_0x28e0ff-0x0;var _0x23f7be=_0x783d[_0x28e0ff];return _0x23f7be;};'use strict';function Interval(_0x2e605d){this['id']=_0x2e605d['id']||0x0;this['name']=_0x2e605d[_0xd783('0x0')]||'';this[_0xd783('0x1')]=_0x2e605d[_0xd783('0x1')]||{};}module[_0xd783('0x2')]=Interval; \ No newline at end of file +var _0xab40=['exports','name','Intervals'];(function(_0x1046d1,_0x72fbb){var _0x47720b=function(_0xc21f97){while(--_0xc21f97){_0x1046d1['push'](_0x1046d1['shift']());}};_0x47720b(++_0x72fbb);}(_0xab40,0xd9));var _0x0ab4=function(_0x20367b,_0x4cb75d){_0x20367b=_0x20367b-0x0;var _0x292978=_0xab40[_0x20367b];return _0x292978;};'use strict';function Interval(_0x5ea565){this['id']=_0x5ea565['id']||0x0;this[_0x0ab4('0x0')]=_0x5ea565['name']||'';this[_0x0ab4('0x1')]=_0x5ea565['Intervals']||{};}module[_0x0ab4('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 fb35d8d..1568112 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 _0x1a9f=['map','loggedIn','paused','length','online','mailPause','available','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr'];(function(_0x7b2615,_0x70d3e0){var _0x1ab413=function(_0x2bb167){while(--_0x2bb167){_0x7b2615['push'](_0x7b2615['shift']());}};_0x1ab413(++_0x70d3e0);}(_0x1a9f,0x184));var _0xf1a9=function(_0x26d2a9,_0x154f8b){_0x26d2a9=_0x26d2a9-0x0;var _0x5d31f1=_0x1a9f[_0x26d2a9];return _0x5d31f1;};'use strict';var _=require(_0xf1a9('0x0'));var md5=require(_0xf1a9('0x1'));var util=require(_0xf1a9('0x2'));var Redis=require(_0xf1a9('0x3'));var config=require(_0xf1a9('0x4'));config[_0xf1a9('0x5')]=_[_0xf1a9('0x6')](config[_0xf1a9('0x5')],{'host':_0xf1a9('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf1a9('0x5')]));function MailQueue(_0x14e668){this['id']=_0x14e668['id']||0x0;this[_0xf1a9('0x8')]=_0x14e668[_0xf1a9('0x8')]||'';this[_0xf1a9('0x9')]=_0x14e668[_0xf1a9('0x9')]||0xa;this[_0xf1a9('0xa')]=_0x14e668[_0xf1a9('0xa')]||_0xf1a9('0xb');this[_0xf1a9('0xc')]=_0x14e668['Agents'];this[_0xf1a9('0xd')]={};this['waiting']=0x0;this[_0xf1a9('0x1')]='';this[_0xf1a9('0xe')]();this['updateRealtime']();}MailQueue[_0xf1a9('0xf')][_0xf1a9('0xe')]=function(){var _0x2ece5d=this[_0xf1a9('0xd')][_0xf1a9('0x10')];this['mapAgentsId']=_[_0xf1a9('0x11')](this[_0xf1a9('0xc')],'id');this[_0xf1a9('0xd')]['_rr']=_0x2ece5d;};MailQueue[_0xf1a9('0xf')]['updateRealtime']=function(){this[_0xf1a9('0x12')]=0x0;this[_0xf1a9('0x13')]=0x0;for(var _0x4029=0x0;_0x4029=0x0?this[_0xf1a9('0x17')]:0x0;var _0x28fb11={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xf1a9('0x8')],'paused':this[_0xf1a9('0x13')],'waiting':this['waiting']};var _0xaa42cf=md5(JSON['stringify'](_0x28fb11));if(this[_0xf1a9('0x1')]!==_0xaa42cf){this[_0xf1a9('0x1')]=_0xaa42cf;io['to'](util[_0xf1a9('0x18')]('mail:queue:%s',_0x28fb11['name']))[_0xf1a9('0x19')]('mail_queue:save',_0x28fb11);}};module[_0xf1a9('0x1a')]=MailQueue; \ No newline at end of file +var _0x65c8=['map','_rr','updateRealtime','loggedIn','length','mailPause','paused','available','stringify','format','mail:queue:%s','exports','lodash','md5','ioredis','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x341192,_0x5f3b17){var _0xda956c=function(_0x2eb412){while(--_0x2eb412){_0x341192['push'](_0x341192['shift']());}};_0xda956c(++_0x5f3b17);}(_0x65c8,0xd4));var _0x865c=function(_0x4e49e9,_0x5a48a0){_0x4e49e9=_0x4e49e9-0x0;var _0x564625=_0x65c8[_0x4e49e9];return _0x564625;};'use strict';var _=require(_0x865c('0x0'));var md5=require(_0x865c('0x1'));var util=require('util');var Redis=require(_0x865c('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x865c('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x865c('0x4')]));function MailQueue(_0x289eed){this['id']=_0x289eed['id']||0x0;this['name']=_0x289eed[_0x865c('0x5')]||'';this[_0x865c('0x6')]=_0x289eed['timeout']||0xa;this['strategy']=_0x289eed[_0x865c('0x7')]||_0x865c('0x8');this[_0x865c('0x9')]=_0x289eed[_0x865c('0x9')];this[_0x865c('0xa')]={};this[_0x865c('0xb')]=0x0;this[_0x865c('0x1')]='';this[_0x865c('0xc')]();this['updateRealtime']();}MailQueue['prototype'][_0x865c('0xc')]=function(){var _0x3eff3b=this[_0x865c('0xa')]['_rr'];this[_0x865c('0xa')]=_[_0x865c('0xd')](this['Agents'],'id');this[_0x865c('0xa')][_0x865c('0xe')]=_0x3eff3b;};MailQueue['prototype'][_0x865c('0xf')]=function(){this[_0x865c('0x10')]=0x0;this['paused']=0x0;for(var _0x4900bf=0x0;_0x4900bf=0x0?this[_0x865c('0x14')]:0x0;var _0x3ae1cf={'id':this['id'],'available':this[_0x865c('0x14')],'loggedIn':this[_0x865c('0x10')],'name':this[_0x865c('0x5')],'paused':this[_0x865c('0x13')],'waiting':this[_0x865c('0xb')]};var _0x137004=md5(JSON[_0x865c('0x15')](_0x3ae1cf));if(this[_0x865c('0x1')]!==_0x137004){this['md5']=_0x137004;io['to'](util[_0x865c('0x16')](_0x865c('0x17'),_0x3ae1cf[_0x865c('0x5')]))['emit']('mail_queue:save',_0x3ae1cf);}};module[_0x865c('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 7f762b2..c1bdbca 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x1261,0x144));var _0x1126=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x1261[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x326f,0xd1));var _0xf326=function(_0x2bfb7f,_0x2ffefa){_0x2bfb7f=_0x2bfb7f-0x0;var _0xbbdfae=_0x326f[_0x2bfb7f];return _0xbbdfae;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index cb530d0..13d58f4 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 _0xa631=['sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','available','name','stringify','format'];(function(_0x2f0f52,_0x1b6426){var _0x2e0086=function(_0xf9002b){while(--_0xf9002b){_0x2f0f52['push'](_0x2f0f52['shift']());}};_0x2e0086(++_0x1b6426);}(_0xa631,0xe4));var _0x1a63=function(_0x161d3c,_0xce464e){_0x161d3c=_0x161d3c-0x0;var _0x4410a0=_0xa631[_0x161d3c];return _0x4410a0;};'use strict';var _=require('lodash');var md5=require(_0x1a63('0x0'));var util=require(_0x1a63('0x1'));var Redis=require(_0x1a63('0x2'));var config=require('../../../config/environment');config[_0x1a63('0x3')]=_['defaults'](config['redis'],{'host':_0x1a63('0x4'),'port':0x18eb});var io=require(_0x1a63('0x5'))(new Redis(config[_0x1a63('0x3')]));function SmsQueue(_0x4eed61){this['id']=_0x4eed61['id']||0x0;this['name']=_0x4eed61['name']||'';this['timeout']=_0x4eed61[_0x1a63('0x6')]||0xa;this[_0x1a63('0x7')]=_0x4eed61[_0x1a63('0x7')]||'beepall';this['Agents']=_0x4eed61[_0x1a63('0x8')];this[_0x1a63('0x9')]={};this[_0x1a63('0xa')]=0x0;this[_0x1a63('0x0')]='';this[_0x1a63('0xb')]();this['updateRealtime']();}SmsQueue[_0x1a63('0xc')][_0x1a63('0xb')]=function(){var _0x1899b9=this[_0x1a63('0x9')]['_rr'];this[_0x1a63('0x9')]=_[_0x1a63('0xd')](this[_0x1a63('0x8')],'id');this['mapAgentsId'][_0x1a63('0xe')]=_0x1899b9;};SmsQueue['prototype'][_0x1a63('0xf')]=function(){this[_0x1a63('0x10')]=0x0;this[_0x1a63('0x11')]=0x0;for(var _0x5301b6=0x0;_0x5301b6=0x0?this[_0x1a63('0x14')]:0x0;var _0x24996e={'id':this['id'],'available':this[_0x1a63('0x14')],'loggedIn':this[_0x1a63('0x10')],'name':this[_0x1a63('0x15')],'paused':this[_0x1a63('0x11')],'waiting':this['waiting']};var _0x34ad77=md5(JSON[_0x1a63('0x16')](_0x24996e));if(this['md5']!==_0x34ad77){this[_0x1a63('0x0')]=_0x34ad77;io['to'](util[_0x1a63('0x17')](_0x1a63('0x18'),_0x24996e[_0x1a63('0x15')]))[_0x1a63('0x19')](_0x1a63('0x1a'),_0x24996e);}};module[_0x1a63('0x1b')]=SmsQueue; \ No newline at end of file +var _0x089f=['available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x190d20,_0x4464cd){var _0x595842=function(_0x2ddb13){while(--_0x2ddb13){_0x190d20['push'](_0x190d20['shift']());}};_0x595842(++_0x4464cd);}(_0x089f,0x1c7));var _0xf089=function(_0x505b1d,_0x6f367d){_0x505b1d=_0x505b1d-0x0;var _0x2cdd54=_0x089f[_0x505b1d];return _0x2cdd54;};'use strict';var _=require('lodash');var md5=require(_0xf089('0x0'));var util=require(_0xf089('0x1'));var Redis=require(_0xf089('0x2'));var config=require(_0xf089('0x3'));config[_0xf089('0x4')]=_['defaults'](config[_0xf089('0x4')],{'host':_0xf089('0x5'),'port':0x18eb});var io=require(_0xf089('0x6'))(new Redis(config['redis']));function SmsQueue(_0x92f133){this['id']=_0x92f133['id']||0x0;this[_0xf089('0x7')]=_0x92f133[_0xf089('0x7')]||'';this['timeout']=_0x92f133[_0xf089('0x8')]||0xa;this[_0xf089('0x9')]=_0x92f133[_0xf089('0x9')]||'beepall';this[_0xf089('0xa')]=_0x92f133[_0xf089('0xa')];this[_0xf089('0xb')]={};this[_0xf089('0xc')]=0x0;this[_0xf089('0x0')]='';this[_0xf089('0xd')]();this['updateRealtime']();}SmsQueue[_0xf089('0xe')][_0xf089('0xd')]=function(){var _0x292556=this['mapAgentsId'][_0xf089('0xf')];this[_0xf089('0xb')]=_['map'](this['Agents'],'id');this[_0xf089('0xb')][_0xf089('0xf')]=_0x292556;};SmsQueue['prototype'][_0xf089('0x10')]=function(){this[_0xf089('0x11')]=0x0;this[_0xf089('0x12')]=0x0;for(var _0x337673=0x0;_0x337673=0x0?this[_0xf089('0x15')]:0x0;var _0x4e714a={'id':this['id'],'available':this[_0xf089('0x15')],'loggedIn':this[_0xf089('0x11')],'name':this['name'],'paused':this[_0xf089('0x12')],'waiting':this[_0xf089('0xc')]};var _0x5eadfe=md5(JSON[_0xf089('0x16')](_0x4e714a));if(this[_0xf089('0x0')]!==_0x5eadfe){this[_0xf089('0x0')]=_0x5eadfe;io['to'](util[_0xf089('0x17')](_0xf089('0x18'),_0x4e714a[_0xf089('0x7')]))[_0xf089('0x19')](_0xf089('0x1a'),_0x4e714a);}};module[_0xf089('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 78f0825..2d197ae 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 _0x9e1a=['lodash','md5','redis','defaults','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','whatsappPause','available','stringify','format','whatsapp_queue:save','exports'];(function(_0xc587ed,_0x11cbc2){var _0x41d137=function(_0x2d288f){while(--_0x2d288f){_0xc587ed['push'](_0xc587ed['shift']());}};_0x41d137(++_0x11cbc2);}(_0x9e1a,0x16c));var _0xa9e1=function(_0x26ef48,_0x4576f8){_0x26ef48=_0x26ef48-0x0;var _0x59a138=_0x9e1a[_0x26ef48];return _0x59a138;};'use strict';var _=require(_0xa9e1('0x0'));var md5=require(_0xa9e1('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xa9e1('0x2')]=_[_0xa9e1('0x3')](config['redis'],{'host':_0xa9e1('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9e1('0x2')]));function WhatsappQueue(_0x26b68d){this['id']=_0x26b68d['id']||0x0;this[_0xa9e1('0x5')]=_0x26b68d[_0xa9e1('0x5')]||'';this[_0xa9e1('0x6')]=_0x26b68d[_0xa9e1('0x6')]||0xa;this['strategy']=_0x26b68d['strategy']||_0xa9e1('0x7');this['Agents']=_0x26b68d[_0xa9e1('0x8')];this[_0xa9e1('0x9')]={};this[_0xa9e1('0xa')]=0x0;this[_0xa9e1('0x1')]='';this[_0xa9e1('0xb')]();this[_0xa9e1('0xc')]();}WhatsappQueue[_0xa9e1('0xd')][_0xa9e1('0xb')]=function(){var _0x17a653=this[_0xa9e1('0x9')][_0xa9e1('0xe')];this[_0xa9e1('0x9')]=_[_0xa9e1('0xf')](this['Agents'],'id');this[_0xa9e1('0x9')]['_rr']=_0x17a653;};WhatsappQueue[_0xa9e1('0xd')][_0xa9e1('0xc')]=function(){this['loggedIn']=0x0;this[_0xa9e1('0x10')]=0x0;for(var _0xe0f76b=0x0;_0xe0f76b=0x0?this[_0xa9e1('0x15')]:0x0;var _0x513e91={'id':this['id'],'available':this[_0xa9e1('0x15')],'loggedIn':this[_0xa9e1('0x13')],'name':this[_0xa9e1('0x5')],'paused':this[_0xa9e1('0x10')],'waiting':this['waiting']};var _0x1f44c7=md5(JSON[_0xa9e1('0x16')](_0x513e91));if(this[_0xa9e1('0x1')]!==_0x1f44c7){this['md5']=_0x1f44c7;io['to'](util[_0xa9e1('0x17')]('whatsapp:queue:%s',_0x513e91[_0xa9e1('0x5')]))['emit'](_0xa9e1('0x18'),_0x513e91);}};module[_0xa9e1('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x8c23=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x1b313d,_0x2c23e1){var _0x207297=function(_0x14ae12){while(--_0x14ae12){_0x1b313d['push'](_0x1b313d['shift']());}};_0x207297(++_0x2c23e1);}(_0x8c23,0x88));var _0x38c2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8c23[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var md5=require(_0x38c2('0x0'));var util=require(_0x38c2('0x1'));var Redis=require(_0x38c2('0x2'));var config=require(_0x38c2('0x3'));config[_0x38c2('0x4')]=_['defaults'](config[_0x38c2('0x4')],{'host':_0x38c2('0x5'),'port':0x18eb});var io=require(_0x38c2('0x6'))(new Redis(config[_0x38c2('0x4')]));function WhatsappQueue(_0x7739b3){this['id']=_0x7739b3['id']||0x0;this[_0x38c2('0x7')]=_0x7739b3[_0x38c2('0x7')]||'';this[_0x38c2('0x8')]=_0x7739b3[_0x38c2('0x8')]||0xa;this[_0x38c2('0x9')]=_0x7739b3['strategy']||_0x38c2('0xa');this[_0x38c2('0xb')]=_0x7739b3[_0x38c2('0xb')];this[_0x38c2('0xc')]={};this[_0x38c2('0xd')]=0x0;this[_0x38c2('0x0')]='';this[_0x38c2('0xe')]();this[_0x38c2('0xf')]();}WhatsappQueue['prototype'][_0x38c2('0xe')]=function(){var _0x1bef40=this[_0x38c2('0xc')][_0x38c2('0x10')];this[_0x38c2('0xc')]=_['map'](this['Agents'],'id');this[_0x38c2('0xc')][_0x38c2('0x10')]=_0x1bef40;};WhatsappQueue[_0x38c2('0x11')][_0x38c2('0xf')]=function(){this[_0x38c2('0x12')]=0x0;this[_0x38c2('0x13')]=0x0;for(var _0x589ba8=0x0;_0x589ba8=0x0?this[_0x38c2('0x16')]:0x0;var _0x12d702={'id':this['id'],'available':this[_0x38c2('0x16')],'loggedIn':this[_0x38c2('0x12')],'name':this[_0x38c2('0x7')],'paused':this[_0x38c2('0x13')],'waiting':this[_0x38c2('0xd')]};var _0x2ad195=md5(JSON[_0x38c2('0x17')](_0x12d702));if(this[_0x38c2('0x0')]!==_0x2ad195){this[_0x38c2('0x0')]=_0x2ad195;io['to'](util[_0x38c2('0x18')](_0x38c2('0x19'),_0x12d702[_0x38c2('0x7')]))[_0x38c2('0x1a')](_0x38c2('0x1b'),_0x12d702);}};module[_0x38c2('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index f9b9622..1ee50df 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3e219f,_0x38d0c5){var _0x25039f=function(_0x1eb4cc){while(--_0x1eb4cc){_0x3e219f['push'](_0x3e219f['shift']());}};_0x25039f(++_0x38d0c5);}(_0xb10b,0x12a));var _0xbb10=function(_0x39aedf,_0x2f5df8){_0x39aedf=_0x39aedf-0x0;var _0x39356c=_0xb10b[_0x39aedf];return _0x39356c;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _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(_0x40141a,_0x1518ef){var _0x229a9f=function(_0x513bfc){while(--_0x513bfc){_0x40141a['push'](_0x40141a['shift']());}};_0x229a9f(++_0x1518ef);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b1106,_0x4bd523){_0x3b1106=_0x3b1106-0x0;var _0x1fbeef=_0xb10b[_0x3b1106];return _0x1fbeef;};'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 1836df4..ad4ae40 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 _0x5398=['updateChatInteraction','Request','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0x3457df,_0x94b599){var _0xa2ee6=function(_0x7f55eb){while(--_0x7f55eb){_0x3457df['push'](_0x3457df['shift']());}};_0xa2ee6(++_0x94b599);}(_0x5398,0x135));var _0x8539=function(_0x224d5e,_0x27de6b){_0x224d5e=_0x224d5e-0x0;var _0x4e7c72=_0x5398[_0x224d5e];return _0x4e7c72;};'use strict';var client=require('../client');exports[_0x8539('0x0')]=function(_0x5951bf,_0x1829a3){return client['Request']('UpdateChatInteraction',{'body':_0x1829a3,'options':{'where':{'id':_0x5951bf}},'log':_0x8539('0x1')});};exports['addTags']=function(_0x5d6265,_0x2bf318){return client[_0x8539('0x2')](_0x8539('0x3'),{'body':_0x2bf318,'options':{'where':{'id':_0x5d6265}},'log':_0x8539('0x4')});}; \ No newline at end of file +var _0xe239=['addTags','AddTagsToChatInteraction','../client','Request','updateChatInteraction'];(function(_0x484426,_0x2198e5){var _0x585eb7=function(_0xbdfaec){while(--_0xbdfaec){_0x484426['push'](_0x484426['shift']());}};_0x585eb7(++_0x2198e5);}(_0xe239,0xa7));var _0x9e23=function(_0x142890,_0x4e431a){_0x142890=_0x142890-0x0;var _0x33d7e6=_0xe239[_0x142890];return _0x33d7e6;};'use strict';var client=require(_0x9e23('0x0'));exports['update']=function(_0x3dbbde,_0x2a9f88){return client[_0x9e23('0x1')]('UpdateChatInteraction',{'body':_0x2a9f88,'options':{'where':{'id':_0x3dbbde}},'log':_0x9e23('0x2')});};exports[_0x9e23('0x3')]=function(_0x87d8b8,_0x10089d){return client['Request'](_0x9e23('0x4'),{'body':_0x10089d,'options':{'where':{'id':_0x87d8b8}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index a0b4957..f150b9e 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 _0x4e6b=['createChatMessage','../client','create','Request'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x4e6b,0xe9));var _0xb4e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4e6b[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0xb4e6('0x0'));exports[_0xb4e6('0x1')]=function(_0x4579e7){return client[_0xb4e6('0x2')]('CreateChatMessage',{'body':_0x4579e7,'log':_0xb4e6('0x3')});}; \ No newline at end of file +var _0xc836=['create','CreateChatMessage','../client'];(function(_0x1e373e,_0x236080){var _0x572e59=function(_0x4e97d9){while(--_0x4e97d9){_0x1e373e['push'](_0x1e373e['shift']());}};_0x572e59(++_0x236080);}(_0xc836,0x12e));var _0x6c83=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc836[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6c83('0x0'));exports[_0x6c83('0x1')]=function(_0x46dc54){return client['Request'](_0x6c83('0x2'),{'body':_0x46dc54,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0de3a6c..bc2b663 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 _0x818f=['User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x319261,_0x2b165a){var _0x4a5cc9=function(_0x54149b){while(--_0x54149b){_0x319261['push'](_0x319261['shift']());}};_0x4a5cc9(++_0x2b165a);}(_0x818f,0x1da));var _0xf818=function(_0x297cd2,_0x5110cf){_0x297cd2=_0x297cd2-0x0;var _0x4bb84b=_0x818f[_0x297cd2];return _0x4bb84b;};'use strict';var client=require(_0xf818('0x0'));exports[_0xf818('0x1')]=function(){return function(){return client[_0xf818('0x2')](_0xf818('0x3'),{'options':{'raw':![],'attributes':['id',_0xf818('0x4'),_0xf818('0x5'),'strategy'],'include':[{'model':_0xf818('0x6'),'as':_0xf818('0x7'),'attributes':['id',_0xf818('0x4'),_0xf818('0x8'),_0xf818('0x9')]}]},'log':_0xf818('0x1')});};}; \ No newline at end of file +var _0xbe52=['name','strategy','User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x16f222,_0x52a290){var _0x4e852f=function(_0x37746c){while(--_0x37746c){_0x16f222['push'](_0x16f222['shift']());}};_0x4e852f(++_0x52a290);}(_0xbe52,0x164));var _0x2be5=function(_0x491ea1,_0x2345f6){_0x491ea1=_0x491ea1-0x0;var _0x220a5a=_0xbe52[_0x491ea1];return _0x220a5a;};'use strict';var client=require(_0x2be5('0x0'));exports[_0x2be5('0x1')]=function(){return function(){return client[_0x2be5('0x2')](_0x2be5('0x3'),{'options':{'raw':![],'attributes':['id',_0x2be5('0x4'),'timeout',_0x2be5('0x5')],'include':[{'model':_0x2be5('0x6'),'as':_0x2be5('0x7'),'attributes':['id',_0x2be5('0x4'),_0x2be5('0x8'),_0x2be5('0x9')]}]},'log':_0x2be5('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index e3365c7..13fe5e7 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 _0x25a3=['DESC','../client','create','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x25e95a,_0x2efe4a){var _0x2b35e8=function(_0x1cd36a){while(--_0x1cd36a){_0x25e95a['push'](_0x25e95a['shift']());}};_0x2b35e8(++_0x2efe4a);}(_0x25a3,0x121));var _0x325a=function(_0x5b670d,_0x4e6d01){_0x5b670d=_0x5b670d-0x0;var _0x32c35b=_0x25a3[_0x5b670d];return _0x32c35b;};'use strict';var client=require(_0x325a('0x0'));exports[_0x325a('0x1')]=function(_0x236732){return client['Request'](_0x325a('0x2'),{'body':_0x236732,'log':'CreateChatQueueReport'});};exports[_0x325a('0x3')]=function(_0x3b887a,_0x1f6e3d){return client['Request'](_0x325a('0x4'),{'body':_0x1f6e3d,'options':{'where':{'uniqueid':_0x3b887a},'order':[['id',_0x325a('0x5')]],'limit':0x1},'log':_0x325a('0x4')});}; \ No newline at end of file +var _0x3eec=['CreateChatQueueReport','update','UpdateChatQueueReport','../client','create','Request'];(function(_0x2d5ed7,_0x2f260e){var _0x54944b=function(_0x3c1dc8){while(--_0x3c1dc8){_0x2d5ed7['push'](_0x2d5ed7['shift']());}};_0x54944b(++_0x2f260e);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x35ae75,_0x2b7ff9){_0x35ae75=_0x35ae75-0x0;var _0x523e1c=_0x3eec[_0x35ae75];return _0x523e1c;};'use strict';var client=require(_0xc3ee('0x0'));exports[_0xc3ee('0x1')]=function(_0x181c8e){return client[_0xc3ee('0x2')]('CreateChatQueueReport',{'body':_0x181c8e,'log':_0xc3ee('0x3')});};exports[_0xc3ee('0x4')]=function(_0x12db6b,_0x35b2fb){return client[_0xc3ee('0x2')](_0xc3ee('0x5'),{'body':_0x35b2fb,'options':{'where':{'uniqueid':_0x12db6b},'order':[['id','DESC']],'limit':0x1},'log':_0xc3ee('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index b0fb545..8cec582 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(_0x1c8fdc,_0x4210b1){var _0x39e241=function(_0x1c1faf){while(--_0x1c1faf){_0x1c8fdc['push'](_0x1c8fdc['shift']());}};_0x39e241(++_0x4210b1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1577c5,_0x21e76){var _0x1629a7=function(_0x1a0d09){while(--_0x1a0d09){_0x1577c5['push'](_0x1577c5['shift']());}};_0x1629a7(++_0x21e76);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 0328a18..73b98ae 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 _0x89b5=['CreateFaxMessage','create','Request'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x89b5,0x19f));var _0x589b=function(_0x46c68e,_0x21809c){_0x46c68e=_0x46c68e-0x0;var _0xa759d6=_0x89b5[_0x46c68e];return _0xa759d6;};'use strict';var client=require('../client');exports[_0x589b('0x0')]=function(_0x4ce2f0){return client[_0x589b('0x1')](_0x589b('0x2'),{'body':_0x4ce2f0,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xc022=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x26efd0,_0x58767a){var _0x1be108=function(_0x44c223){while(--_0x44c223){_0x26efd0['push'](_0x26efd0['shift']());}};_0x1be108(++_0x58767a);}(_0xc022,0x1d7));var _0x2c02=function(_0x16fa02,_0x3eaff5){_0x16fa02=_0x16fa02-0x0;var _0x58fa70=_0xc022[_0x16fa02];return _0x58fa70;};'use strict';var client=require(_0x2c02('0x0'));exports[_0x2c02('0x1')]=function(_0x1ad2f4){return client['Request'](_0x2c02('0x2'),{'body':_0x1ad2f4,'log':_0x2c02('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ade2ea1..96fd7fe 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 _0x5bd4=['getFaxQueues','timeout','strategy','User','Agents','name','faxPause','../client'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0x5bd4,0x1ef));var _0x45bd=function(_0x415b1e,_0x5322f8){_0x415b1e=_0x415b1e-0x0;var _0x7e82e=_0x5bd4[_0x415b1e];return _0x7e82e;};'use strict';var client=require(_0x45bd('0x0'));exports[_0x45bd('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x45bd('0x2'),_0x45bd('0x3')],'include':[{'model':_0x45bd('0x4'),'as':_0x45bd('0x5'),'attributes':['id',_0x45bd('0x6'),'online',_0x45bd('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x3033=['GetFaxQueue','name','timeout','User','Agents','faxPause','../client','getFaxQueues','Request'];(function(_0x13425c,_0x5a7b01){var _0x1cb881=function(_0x1f348c){while(--_0x1f348c){_0x13425c['push'](_0x13425c['shift']());}};_0x1cb881(++_0x5a7b01);}(_0x3033,0x12f));var _0x3303=function(_0xcc9915,_0x55e979){_0xcc9915=_0xcc9915-0x0;var _0x10fbdb=_0x3033[_0xcc9915];return _0x10fbdb;};'use strict';var client=require(_0x3303('0x0'));exports[_0x3303('0x1')]=function(){return function(){return client[_0x3303('0x2')](_0x3303('0x3'),{'options':{'raw':![],'attributes':['id',_0x3303('0x4'),_0x3303('0x5'),'strategy'],'include':[{'model':_0x3303('0x6'),'as':_0x3303('0x7'),'attributes':['id',_0x3303('0x4'),'online',_0x3303('0x8')]}]},'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 d388dc5..08c331d 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 _0x856e=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x613566,_0x143ab4){var _0x518a69=function(_0x62e65e){while(--_0x62e65e){_0x613566['push'](_0x613566['shift']());}};_0x518a69(++_0x143ab4);}(_0x856e,0x106));var _0xe856=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x856e[_0x24392f];return _0x591e33;};'use strict';var client=require(_0xe856('0x0'));exports[_0xe856('0x1')]=function(_0x285106){return client[_0xe856('0x2')](_0xe856('0x3'),{'body':_0x285106,'log':_0xe856('0x3')});};exports[_0xe856('0x4')]=function(_0x546a34,_0x57d367){return client['Request'](_0xe856('0x5'),{'body':_0x57d367,'options':{'where':{'uniqueid':_0x546a34},'order':[['id',_0xe856('0x6')]],'limit':0x1},'log':_0xe856('0x5')});}; \ No newline at end of file +var _0x528d=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x528d,0x107));var _0xd528=function(_0x579390,_0x55e311){_0x579390=_0x579390-0x0;var _0x22c87f=_0x528d[_0x579390];return _0x22c87f;};'use strict';var client=require(_0xd528('0x0'));exports[_0xd528('0x1')]=function(_0x2fc923){return client[_0xd528('0x2')](_0xd528('0x3'),{'body':_0x2fc923,'log':_0xd528('0x3')});};exports['update']=function(_0x58bd85,_0x3e6c33){return client[_0xd528('0x2')](_0xd528('0x4'),{'body':_0x3e6c33,'options':{'where':{'uniqueid':_0x58bd85},'order':[['id',_0xd528('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 8003e4c..d22bfdc 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 _0xb22c=['GetInterval','name','interval','../client','getIntervals'];(function(_0x3e2a18,_0x3029dd){var _0x6ce6ba=function(_0x585b6a){while(--_0x585b6a){_0x3e2a18['push'](_0x3e2a18['shift']());}};_0x6ce6ba(++_0x3029dd);}(_0xb22c,0x18e));var _0xcb22=function(_0x40c8a2,_0x33c8e0){_0x40c8a2=_0x40c8a2-0x0;var _0x109831=_0xb22c[_0x40c8a2];return _0x109831;};'use strict';var client=require(_0xcb22('0x0'));exports[_0xcb22('0x1')]=function(){return function(){return client['Request'](_0xcb22('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xcb22('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xcb22('0x3'),_0xcb22('0x4')]}]},'log':_0xcb22('0x1')});};}; \ No newline at end of file +var _0x5f7d=['interval','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x30d872,_0x262fee){var _0x595fa7=function(_0xa004e0){while(--_0xa004e0){_0x30d872['push'](_0x30d872['shift']());}};_0x595fa7(++_0x262fee);}(_0x5f7d,0x166));var _0xd5f7=function(_0xbc9caa,_0x290192){_0xbc9caa=_0xbc9caa-0x0;var _0x312fdb=_0x5f7d[_0xbc9caa];return _0x312fdb;};'use strict';var client=require('../client');exports[_0xd5f7('0x0')]=function(){return function(){return client[_0xd5f7('0x1')](_0xd5f7('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd5f7('0x3')],'include':[{'model':_0xd5f7('0x4'),'as':_0xd5f7('0x5'),'attributes':['id','name',_0xd5f7('0x6')]}]},'log':_0xd5f7('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b8f313b..03f3a5c 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 _0x160f=['UpdateMailInteraction','updateMailInteraction','addTags','Request','addTagsToChatInteraction','../client','update'];(function(_0x5cba0e,_0x4fb1a6){var _0x5e1e19=function(_0x76779c){while(--_0x76779c){_0x5cba0e['push'](_0x5cba0e['shift']());}};_0x5e1e19(++_0x4fb1a6);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf160('0x0'));exports[_0xf160('0x1')]=function(_0x2d4cde,_0x2966aa){return client['Request'](_0xf160('0x2'),{'body':_0x2966aa,'options':{'where':{'id':_0x2d4cde}},'log':_0xf160('0x3')});};exports[_0xf160('0x4')]=function(_0x3b2d7b,_0x194331){return client[_0xf160('0x5')]('AddTagsToMailInteraction',{'body':_0x194331,'options':{'where':{'id':_0x3b2d7b}},'log':_0xf160('0x6')});}; \ No newline at end of file +var _0xdb28=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x15d700,_0x56b0f9){var _0x1630fc=function(_0x417825){while(--_0x417825){_0x15d700['push'](_0x15d700['shift']());}};_0x1630fc(++_0x56b0f9);}(_0xdb28,0x106));var _0x8db2=function(_0x526d40,_0x3a470b){_0x526d40=_0x526d40-0x0;var _0x166393=_0xdb28[_0x526d40];return _0x166393;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(_0x1dc797,_0xf66e59){return client['Request'](_0x8db2('0x2'),{'body':_0xf66e59,'options':{'where':{'id':_0x1dc797}},'log':_0x8db2('0x3')});};exports[_0x8db2('0x4')]=function(_0x4426fe,_0x11109e){return client['Request'](_0x8db2('0x5'),{'body':_0x11109e,'options':{'where':{'id':_0x4426fe}},'log':_0x8db2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 6269c53..df45741 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 _0xf3f1=['../client','create','Request'];(function(_0x145810,_0x23585d){var _0x30fa7d=function(_0x5d7095){while(--_0x5d7095){_0x145810['push'](_0x145810['shift']());}};_0x30fa7d(++_0x23585d);}(_0xf3f1,0x105));var _0x1f3f=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xf3f1[_0x4bacb6];return _0x58c029;};'use strict';var client=require(_0x1f3f('0x0'));exports[_0x1f3f('0x1')]=function(_0x1a7490){return client[_0x1f3f('0x2')]('CreateMailMessage',{'body':_0x1a7490,'log':'createMailMessage'});}; \ No newline at end of file +var _0x044c=['Request'];(function(_0x1ccb6b,_0x4e91e6){var _0x4c316=function(_0x324f8c){while(--_0x324f8c){_0x1ccb6b['push'](_0x1ccb6b['shift']());}};_0x4c316(++_0x4e91e6);}(_0x044c,0xd5));var _0xc044=function(_0x457ae3,_0xbd6ef5){_0x457ae3=_0x457ae3-0x0;var _0x3bef5c=_0x044c[_0x457ae3];return _0x3bef5c;};'use strict';var client=require('../client');exports['create']=function(_0xc91aed){return client[_0xc044('0x0')]('CreateMailMessage',{'body':_0xc91aed,'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 b8ba5d0..227b5b8 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 _0x0ee2=['User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','strategy'];(function(_0x130aee,_0x5efdac){var _0x452dcc=function(_0x2a4a7d){while(--_0x2a4a7d){_0x130aee['push'](_0x130aee['shift']());}};_0x452dcc(++_0x5efdac);}(_0x0ee2,0x90));var _0x20ee=function(_0x562eb5,_0x2c086c){_0x562eb5=_0x562eb5-0x0;var _0x190e9f=_0x0ee2[_0x562eb5];return _0x190e9f;};'use strict';var client=require(_0x20ee('0x0'));exports[_0x20ee('0x1')]=function(){return function(){return client[_0x20ee('0x2')](_0x20ee('0x3'),{'options':{'raw':![],'attributes':['id',_0x20ee('0x4'),'timeout',_0x20ee('0x5')],'include':[{'model':_0x20ee('0x6'),'as':_0x20ee('0x7'),'attributes':['id',_0x20ee('0x4'),_0x20ee('0x8'),_0x20ee('0x9')]}]},'log':_0x20ee('0x1')});};}; \ No newline at end of file +var _0x28b3=['online','../client','getMailQueues','Request','name','timeout','User','Agents'];(function(_0x2ade6c,_0x2d42f2){var _0x2cb372=function(_0x477d8a){while(--_0x477d8a){_0x2ade6c['push'](_0x2ade6c['shift']());}};_0x2cb372(++_0x2d42f2);}(_0x28b3,0x101));var _0x328b=function(_0x4fc4f1,_0x284eaf){_0x4fc4f1=_0x4fc4f1-0x0;var _0x2ffd84=_0x28b3[_0x4fc4f1];return _0x2ffd84;};'use strict';var client=require(_0x328b('0x0'));exports[_0x328b('0x1')]=function(){return function(){return client[_0x328b('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x328b('0x3'),_0x328b('0x4'),'strategy'],'include':[{'model':_0x328b('0x5'),'as':_0x328b('0x6'),'attributes':['id',_0x328b('0x3'),_0x328b('0x7'),'mailPause']}]},'log':_0x328b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 2089d98..ebc7837 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 _0xb44e=['CreateMailQueueReport','UpdateMailQueueReport','DESC','../client','Request'];(function(_0xf2437e,_0x30249d){var _0x3153cd=function(_0x5dcb9a){while(--_0x5dcb9a){_0xf2437e['push'](_0xf2437e['shift']());}};_0x3153cd(++_0x30249d);}(_0xb44e,0xf8));var _0xeb44=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xb44e[_0x16de68];return _0x1c277e;};'use strict';var client=require(_0xeb44('0x0'));exports['create']=function(_0x83583){return client[_0xeb44('0x1')](_0xeb44('0x2'),{'body':_0x83583,'log':_0xeb44('0x2')});};exports['update']=function(_0x515f03,_0x30788f){return client['Request'](_0xeb44('0x3'),{'body':_0x30788f,'options':{'where':{'uniqueid':_0x515f03},'order':[['id',_0xeb44('0x4')]],'limit':0x1},'log':_0xeb44('0x3')});}; \ No newline at end of file +var _0x7f6c=['create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0xf077cb,_0x11cfa6){var _0x5549d9=function(_0x131d90){while(--_0x131d90){_0xf077cb['push'](_0xf077cb['shift']());}};_0x5549d9(++_0x11cfa6);}(_0x7f6c,0x1b8));var _0xc7f6=function(_0x4cfb78,_0x37a30c){_0x4cfb78=_0x4cfb78-0x0;var _0x1fc81a=_0x7f6c[_0x4cfb78];return _0x1fc81a;};'use strict';var client=require('../client');exports[_0xc7f6('0x0')]=function(_0x12643a){return client[_0xc7f6('0x1')](_0xc7f6('0x2'),{'body':_0x12643a,'log':_0xc7f6('0x2')});};exports['update']=function(_0x46771d,_0x535fe6){return client[_0xc7f6('0x1')](_0xc7f6('0x3'),{'body':_0x535fe6,'options':{'where':{'uniqueid':_0x46771d},'order':[['id','DESC']],'limit':0x1},'log':_0xc7f6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 565174d..9f0f268 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 _0x300b=['addTags','AddTagsToOpenchannelInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x300b,0x170));var _0xb300=function(_0x8a6e9d,_0x159c88){_0x8a6e9d=_0x8a6e9d-0x0;var _0x171a68=_0x300b[_0x8a6e9d];return _0x171a68;};'use strict';var client=require(_0xb300('0x0'));exports[_0xb300('0x1')]=function(_0x11fe2b,_0x48d335){return client[_0xb300('0x2')]('UpdateOpenchannelInteraction',{'body':_0x48d335,'options':{'where':{'id':_0x11fe2b}},'log':_0xb300('0x3')});};exports[_0xb300('0x4')]=function(_0x662d5a,_0x47c81a){return client[_0xb300('0x2')](_0xb300('0x5'),{'body':_0x47c81a,'options':{'where':{'id':_0x662d5a}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xd00a=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client','update','UpdateOpenchannelInteraction'];(function(_0x527307,_0xc0b9d1){var _0x7afda3=function(_0x2c1fb5){while(--_0x2c1fb5){_0x527307['push'](_0x527307['shift']());}};_0x7afda3(++_0xc0b9d1);}(_0xd00a,0xd5));var _0xad00=function(_0x3e3c8f,_0x4b97ac){_0x3e3c8f=_0x3e3c8f-0x0;var _0x1d976a=_0xd00a[_0x3e3c8f];return _0x1d976a;};'use strict';var client=require(_0xad00('0x0'));exports[_0xad00('0x1')]=function(_0x2ef8cd,_0x43f50b){return client['Request'](_0xad00('0x2'),{'body':_0x43f50b,'options':{'where':{'id':_0x2ef8cd}},'log':_0xad00('0x3')});};exports[_0xad00('0x4')]=function(_0x2377c3,_0x3a6663){return client['Request'](_0xad00('0x5'),{'body':_0x3a6663,'options':{'where':{'id':_0x2377c3}},'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 1d894b7..19440ca 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 _0x1a42=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x5d347a,_0x13c656){var _0x2eee8b=function(_0x27d50f){while(--_0x27d50f){_0x5d347a['push'](_0x5d347a['shift']());}};_0x2eee8b(++_0x13c656);}(_0x1a42,0x180));var _0x21a4=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x1a42[_0x4605dc];return _0x5d3e81;};'use strict';var client=require(_0x21a4('0x0'));exports[_0x21a4('0x1')]=function(_0x1c1be3){return client[_0x21a4('0x2')](_0x21a4('0x3'),{'body':_0x1c1be3,'log':_0x21a4('0x4')});}; \ No newline at end of file +var _0xcb91=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x3895b7,_0xd4796b){var _0x3f3b8c=function(_0x43a116){while(--_0x43a116){_0x3895b7['push'](_0x3895b7['shift']());}};_0x3f3b8c(++_0xd4796b);}(_0xcb91,0x8b));var _0x1cb9=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xcb91[_0x2ae2ad];return _0x26dbd7;};'use strict';var client=require(_0x1cb9('0x0'));exports[_0x1cb9('0x1')]=function(_0x3cbb2b){return client[_0x1cb9('0x2')](_0x1cb9('0x3'),{'body':_0x3cbb2b,'log':_0x1cb9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 859b2b1..e06a167 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 _0x102a=['online','../client','getOpenchannelQueues','Request','name','timeout','User','Agents'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x102a,0x109));var _0xa102=function(_0xfe2b32,_0x120d82){_0xfe2b32=_0xfe2b32-0x0;var _0x29a157=_0x102a[_0xfe2b32];return _0x29a157;};'use strict';var client=require(_0xa102('0x0'));exports[_0xa102('0x1')]=function(){return function(){return client[_0xa102('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xa102('0x3'),_0xa102('0x4'),'strategy'],'include':[{'model':_0xa102('0x5'),'as':_0xa102('0x6'),'attributes':['id','name',_0xa102('0x7'),'openchannelPause']}]},'log':_0xa102('0x1')});};}; \ No newline at end of file +var _0xcf90=['../client','getOpenchannelQueues','Request','strategy','User','Agents','online'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0xcf90,0x1e3));var _0x0cf9=function(_0x1ea98f,_0xbe2453){_0x1ea98f=_0x1ea98f-0x0;var _0x17d881=_0xcf90[_0x1ea98f];return _0x17d881;};'use strict';var client=require(_0x0cf9('0x0'));exports[_0x0cf9('0x1')]=function(){return function(){return client[_0x0cf9('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x0cf9('0x3')],'include':[{'model':_0x0cf9('0x4'),'as':_0x0cf9('0x5'),'attributes':['id','name',_0x0cf9('0x6'),'openchannelPause']}]},'log':_0x0cf9('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 63c2eb8..4d3d08a 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 _0x25c2=['Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client'];(function(_0x3aa513,_0xbfbc63){var _0x2219c6=function(_0x4047ba){while(--_0x4047ba){_0x3aa513['push'](_0x3aa513['shift']());}};_0x2219c6(++_0xbfbc63);}(_0x25c2,0xdd));var _0x225c=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x25c2[_0x349367];return _0x14179b;};'use strict';var client=require(_0x225c('0x0'));exports['create']=function(_0xbe7f12){return client[_0x225c('0x1')]('CreateOpenchannelQueueReport',{'body':_0xbe7f12,'log':_0x225c('0x2')});};exports[_0x225c('0x3')]=function(_0x49fe6f,_0x24bca2){return client[_0x225c('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x24bca2,'options':{'where':{'uniqueid':_0x49fe6f},'order':[['id',_0x225c('0x4')]],'limit':0x1},'log':_0x225c('0x5')});}; \ No newline at end of file +var _0xccb3=['UpdateOpenchannelQueueReport','DESC','../client','Request','update'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xccb3,0xca));var _0x3ccb=function(_0x254081,_0x20731a){_0x254081=_0x254081-0x0;var _0x5d1e2a=_0xccb3[_0x254081];return _0x5d1e2a;};'use strict';var client=require(_0x3ccb('0x0'));exports['create']=function(_0x307690){return client[_0x3ccb('0x1')]('CreateOpenchannelQueueReport',{'body':_0x307690,'log':'CreateOpenchannelQueueReport'});};exports[_0x3ccb('0x2')]=function(_0x232ee7,_0x5eeb41){return client[_0x3ccb('0x1')](_0x3ccb('0x3'),{'body':_0x5eeb41,'options':{'where':{'uniqueid':_0x232ee7},'order':[['id',_0x3ccb('0x4')]],'limit':0x1},'log':_0x3ccb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 77648cb..89406c1 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 _0xdf70=['addTags','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x2e650d,_0x58436b){var _0x582488=function(_0x136231){while(--_0x136231){_0x2e650d['push'](_0x2e650d['shift']());}};_0x582488(++_0x58436b);}(_0xdf70,0x86));var _0x0df7=function(_0x1e3c6e,_0x21da32){_0x1e3c6e=_0x1e3c6e-0x0;var _0xa34dcf=_0xdf70[_0x1e3c6e];return _0xa34dcf;};'use strict';var client=require(_0x0df7('0x0'));exports[_0x0df7('0x1')]=function(_0x97711f,_0x54fb87){return client[_0x0df7('0x2')](_0x0df7('0x3'),{'body':_0x54fb87,'options':{'where':{'id':_0x97711f}},'log':'updateSmsInteraction'});};exports[_0x0df7('0x4')]=function(_0x4ae128,_0x278b96){return client[_0x0df7('0x2')]('AddTagsToSmsInteraction',{'body':_0x278b96,'options':{'where':{'id':_0x4ae128}},'log':_0x0df7('0x5')});}; \ No newline at end of file +var _0xc3a8=['addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x5e25c9,_0x3dd817){var _0x35c8d0=function(_0x387039){while(--_0x387039){_0x5e25c9['push'](_0x5e25c9['shift']());}};_0x35c8d0(++_0x3dd817);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x1e2bbe,_0x4df37d){_0x1e2bbe=_0x1e2bbe-0x0;var _0x435438=_0xc3a8[_0x1e2bbe];return _0x435438;};'use strict';var client=require(_0x8c3a('0x0'));exports[_0x8c3a('0x1')]=function(_0xfad188,_0x4fff77){return client[_0x8c3a('0x2')]('UpdateSmsInteraction',{'body':_0x4fff77,'options':{'where':{'id':_0xfad188}},'log':_0x8c3a('0x3')});};exports[_0x8c3a('0x4')]=function(_0x3585d1,_0x1d993b){return client['Request'](_0x8c3a('0x5'),{'body':_0x1d993b,'options':{'where':{'id':_0x3585d1}},'log':_0x8c3a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index facf01e..4599817 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 _0xe141=['CreateSmsMessage','../client','create','Request'];(function(_0x5418b4,_0x32c24e){var _0x6d93b4=function(_0x170f45){while(--_0x170f45){_0x5418b4['push'](_0x5418b4['shift']());}};_0x6d93b4(++_0x32c24e);}(_0xe141,0xfd));var _0x1e14=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0xe141[_0x5a7e3c];return _0x59252b;};'use strict';var client=require(_0x1e14('0x0'));exports[_0x1e14('0x1')]=function(_0x49b1d0){return client[_0x1e14('0x2')](_0x1e14('0x3'),{'body':_0x49b1d0,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x2071=['../client','Request','CreateSmsMessage'];(function(_0x53db8a,_0x543785){var _0x1857f8=function(_0x13cb5d){while(--_0x13cb5d){_0x53db8a['push'](_0x53db8a['shift']());}};_0x1857f8(++_0x543785);}(_0x2071,0xa2));var _0x1207=function(_0x4fa489,_0x4cba6b){_0x4fa489=_0x4fa489-0x0;var _0x41d2ce=_0x2071[_0x4fa489];return _0x41d2ce;};'use strict';var client=require(_0x1207('0x0'));exports['create']=function(_0xcbfcd){return client[_0x1207('0x1')](_0x1207('0x2'),{'body':_0xcbfcd,'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 0922a0d..81fe000 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x4641f0,_0x4f315b){var _0x308ddc=function(_0x2bd265){while(--_0x2bd265){_0x4641f0['push'](_0x4641f0['shift']());}};_0x308ddc(++_0x4f315b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x5d089f,_0x2b88d4){var _0x3fe205=function(_0x24290a){while(--_0x24290a){_0x5d089f['push'](_0x5d089f['shift']());}};_0x3fe205(++_0x2b88d4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xcb91[_0x218972];return _0x1bb1a8;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 2bdd2ce..41b0412 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x8eb4eb,_0xa70079){var _0x1ff8e3=function(_0x1e118e){while(--_0x1e118e){_0x8eb4eb['push'](_0x8eb4eb['shift']());}};_0x1ff8e3(++_0xa70079);}(_0x008c,0x188));var _0xc008=function(_0xa4b8e1,_0x49d30b){_0xa4b8e1=_0xa4b8e1-0x0;var _0x507e42=_0x008c[_0xa4b8e1];return _0x507e42;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x3b3d36,_0x4f8f6e){var _0x3c679f=function(_0x2d8097){while(--_0x2d8097){_0x3b3d36['push'](_0x3b3d36['shift']());}};_0x3c679f(++_0x4f8f6e);}(_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){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index b011efe..b06ecd2 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(_0x56b389,_0x56a28f){var _0x7cc435=function(_0x3ad2ce){while(--_0x3ad2ce){_0x56b389['push'](_0x56b389['shift']());}};_0x7cc435(++_0x56a28f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x8356d3,_0xf3f07a){var _0x45add1=function(_0x39ee40){while(--_0x39ee40){_0x8356d3['push'](_0x8356d3['shift']());}};_0x45add1(++_0xf3f07a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 52c6451..80d231b 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 _0x6c45=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x536d70,_0xa88ce3){var _0x455ed3=function(_0xaa6b){while(--_0xaa6b){_0x536d70['push'](_0x536d70['shift']());}};_0x455ed3(++_0xa88ce3);}(_0x6c45,0xb1));var _0x56c4=function(_0x83d81a,_0x499188){_0x83d81a=_0x83d81a-0x0;var _0x33e44e=_0x6c45[_0x83d81a];return _0x33e44e;};'use strict';var client=require(_0x56c4('0x0'));exports[_0x56c4('0x1')]=function(_0x559ee6,_0x2f7ee3){return client[_0x56c4('0x2')](_0x56c4('0x3'),{'body':_0x2f7ee3,'options':{'where':{'id':_0x559ee6}},'log':_0x56c4('0x4')});};exports[_0x56c4('0x5')]=function(_0x18d229,_0x1096ce){return client[_0x56c4('0x2')](_0x56c4('0x6'),{'body':_0x1096ce,'options':{'where':{'id':_0x18d229}},'log':_0x56c4('0x7')});}; \ No newline at end of file +var _0xcedf=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update'];(function(_0x2a276d,_0x482b0c){var _0x2914cd=function(_0x452b8b){while(--_0x452b8b){_0x2a276d['push'](_0x2a276d['shift']());}};_0x2914cd(++_0x482b0c);}(_0xcedf,0x1b6));var _0xfced=function(_0x34d36e,_0x4cbca3){_0x34d36e=_0x34d36e-0x0;var _0x16db4f=_0xcedf[_0x34d36e];return _0x16db4f;};'use strict';var client=require(_0xfced('0x0'));exports[_0xfced('0x1')]=function(_0x1ce4e6,_0x157ed6){return client['Request'](_0xfced('0x2'),{'body':_0x157ed6,'options':{'where':{'id':_0x1ce4e6}},'log':_0xfced('0x3')});};exports['addTags']=function(_0x5b16af,_0x1dad76){return client['Request'](_0xfced('0x4'),{'body':_0x1dad76,'options':{'where':{'id':_0x5b16af}},'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 56cde2f..93c5524 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 _0x22e4=['Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x393761,_0x1d1138){var _0x2e842f=function(_0x17663c){while(--_0x17663c){_0x393761['push'](_0x393761['shift']());}};_0x2e842f(++_0x1d1138);}(_0x22e4,0x1c7));var _0x422e=function(_0x29d98a,_0x1ff65c){_0x29d98a=_0x29d98a-0x0;var _0x261b15=_0x22e4[_0x29d98a];return _0x261b15;};'use strict';var client=require(_0x422e('0x0'));exports['create']=function(_0x4ac793){return client[_0x422e('0x1')](_0x422e('0x2'),{'body':_0x4ac793,'log':_0x422e('0x3')});}; \ No newline at end of file +var _0x0c1e=['Request','createWhatsappMessage','../client','create'];(function(_0x560631,_0x1d17f8){var _0x5d7c01=function(_0x2cc867){while(--_0x2cc867){_0x560631['push'](_0x560631['shift']());}};_0x5d7c01(++_0x1d17f8);}(_0x0c1e,0x12a));var _0xe0c1=function(_0x37276a,_0xeb1b47){_0x37276a=_0x37276a-0x0;var _0x3414d1=_0x0c1e[_0x37276a];return _0x3414d1;};'use strict';var client=require(_0xe0c1('0x0'));exports[_0xe0c1('0x1')]=function(_0xb08fbb){return client[_0xe0c1('0x2')]('CreateWhatsappMessage',{'body':_0xb08fbb,'log':_0xe0c1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 2c922d4..b016797 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 _0x6fbb=['GetWhatsappQueue','name','timeout','strategy','User','online','../client','getWhatsappQueues','Request'];(function(_0x339d5e,_0x4a3bcb){var _0x39b51b=function(_0x35a2af){while(--_0x35a2af){_0x339d5e['push'](_0x339d5e['shift']());}};_0x39b51b(++_0x4a3bcb);}(_0x6fbb,0xa8));var _0xb6fb=function(_0x1bc59c,_0x1fbd70){_0x1bc59c=_0x1bc59c-0x0;var _0x4333eb=_0x6fbb[_0x1bc59c];return _0x4333eb;};'use strict';var client=require(_0xb6fb('0x0'));exports[_0xb6fb('0x1')]=function(){return function(){return client[_0xb6fb('0x2')](_0xb6fb('0x3'),{'options':{'raw':![],'attributes':['id',_0xb6fb('0x4'),_0xb6fb('0x5'),_0xb6fb('0x6')],'include':[{'model':_0xb6fb('0x7'),'as':'Agents','attributes':['id','name',_0xb6fb('0x8'),'whatsappPause']}]},'log':_0xb6fb('0x1')});};}; \ No newline at end of file +var _0x7a80=['Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy'];(function(_0x595298,_0x5b8175){var _0x142c44=function(_0x455163){while(--_0x455163){_0x595298['push'](_0x595298['shift']());}};_0x142c44(++_0x5b8175);}(_0x7a80,0x15a));var _0x07a8=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7a80[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0x07a8('0x0'));exports[_0x07a8('0x1')]=function(){return function(){return client[_0x07a8('0x2')](_0x07a8('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x07a8('0x4'),_0x07a8('0x5')],'include':[{'model':'User','as':_0x07a8('0x6'),'attributes':['id','name','online',_0x07a8('0x7')]}]},'log':_0x07a8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 258f4f7..3f8f112 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 _0xf03a=['UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf03a,0x19b));var _0xaf03=function(_0x4780c2,_0x570b81){_0x4780c2=_0x4780c2-0x0;var _0x3967b9=_0xf03a[_0x4780c2];return _0x3967b9;};'use strict';var client=require(_0xaf03('0x0'));exports['create']=function(_0x187f39){return client[_0xaf03('0x1')](_0xaf03('0x2'),{'body':_0x187f39,'log':_0xaf03('0x2')});};exports[_0xaf03('0x3')]=function(_0x2c4df9,_0x26c5ce){return client[_0xaf03('0x1')](_0xaf03('0x4'),{'body':_0x26c5ce,'options':{'where':{'uniqueid':_0x2c4df9},'order':[['id','DESC']],'limit':0x1},'log':_0xaf03('0x4')});}; \ No newline at end of file +var _0x6a94=['../client','create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6a94,0xd2));var _0x46a9=function(_0x576106,_0x1dd020){_0x576106=_0x576106-0x0;var _0x2dad63=_0x6a94[_0x576106];return _0x2dad63;};'use strict';var client=require(_0x46a9('0x0'));exports[_0x46a9('0x1')]=function(_0x18ae3f){return client[_0x46a9('0x2')](_0x46a9('0x3'),{'body':_0x18ae3f,'log':_0x46a9('0x3')});};exports['update']=function(_0x901caf,_0x4d4f04){return client[_0x46a9('0x2')](_0x46a9('0x4'),{'body':_0x4d4f04,'options':{'where':{'uniqueid':_0x901caf},'order':[['id',_0x46a9('0x5')]],'limit':0x1},'log':_0x46a9('0x4')});}; \ 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 dbe732c..ca7048e 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 _0x9aed=['agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','createQueue','atimeout','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','info','next'];(function(_0x3f6460,_0x3bdb9b){var _0x5d9ac6=function(_0x1ebb5e){while(--_0x1ebb5e){_0x3f6460['push'](_0x3f6460['shift']());}};_0x5d9ac6(++_0x3bdb9b);}(_0x9aed,0xa4));var _0xd9ae=function(_0x5bef75,_0x43a9a){_0x5bef75=_0x5bef75-0x0;var _0x36b977=_0x9aed[_0x5bef75];return _0x36b977;};'use strict';var schema=require(_0xd9ae('0x0'));var _=require(_0xd9ae('0x1'));var util=require(_0xd9ae('0x2'));var seqqueue=require(_0xd9ae('0x3'));var logger=require(_0xd9ae('0x4'))(_0xd9ae('0x5'));var strategy=require(_0xd9ae('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xd9ae('0x7')}});function writeLog(_0x41303d,_0x533f33,_0xaec8b){return logger['info'](util[_0xd9ae('0x8')](_0xd9ae('0x9'),_0x41303d,_0x533f33[_0xd9ae('0xa')],_0xaec8b));}function handleFindAgent(_0x494fe6){return function(_0x514d01){return _0x514d01['name'][_0xd9ae('0xb')]()===_0x494fe6[_0xd9ae('0xb')]();};}exports[_0xd9ae('0xc')]=function(_0x2f8f7b,_0x56ad85,_0x336736,_0x3d3e95){return function(_0x274e3b){try{var _0x416f00={'name':_0x56ad85[0x0],'timeout':_0x56ad85[0x1]};var _0xaf9e8a=queue[_0xd9ae('0x0')](_0x416f00,{'typecast':!![]});if(_0xaf9e8a[_0xd9ae('0xd')]){logger[_0xd9ae('0xe')](_0xd9ae('0xf'),_0x2f8f7b,_[_0xd9ae('0x10')](_0xaf9e8a,_0xd9ae('0x11'))[_0xd9ae('0x12')](',\x20'));_0x274e3b[_0xd9ae('0x13')]();}else{var _0x300378=_['find'](_0x336736['agents'],handleFindAgent(_0x416f00[_0xd9ae('0xa')]));if(_0x300378){var _0x38be49=(_0x416f00['timeout']||0xa)*0x3e8;var _0xbab7ee,_0x4e232f;var _0x5d8764=seqqueue[_0xd9ae('0x14')](_0x38be49);_0x5d8764['id']=_0x2f8f7b;_0x5d8764[_0xd9ae('0x15')]=_0x38be49;_0x5d8764['channel']=_0x3d3e95['channel'];writeLog(_0x2f8f7b,_0x300378,util['format']('START:%s',_0x38be49));_0x336736['rules'][_0x2f8f7b]['on'](_0xd9ae('0x16'),function(){logger['info'](_0xd9ae('0x17'),_0x2f8f7b);clearTimeout(_0x4e232f);_0x4e232f=undefined;_0x5d8764[_0xd9ae('0x18')]();if(_0x336736[_0xd9ae('0x19')][_0x2f8f7b]){delete _0x336736[_0xd9ae('0x19')][_0x2f8f7b];}_0x274e3b[_0xd9ae('0x13')]();});_0x336736[_0xd9ae('0x19')][_0x2f8f7b]['on']('complete',function(){if(_0x336736[_0xd9ae('0x19')][_0x2f8f7b]){delete _0x336736[_0xd9ae('0x19')][_0x2f8f7b];}});_0x4e232f=setTimeout(function(){logger[_0xd9ae('0x1a')]('[%s][AGENT]\x20ROUTING\x20END',_0x2f8f7b);clearTimeout(_0x4e232f);_0x5d8764[_0xd9ae('0x18')]();_0x274e3b[_0xd9ae('0x1b')]();},_0x38be49);strategy[_0xd9ae('0x1c')](_0x5d8764,_0x300378,_0x336736,_0x3d3e95);}else{logger['error'](_0xd9ae('0x1d'),_0x2f8f7b,_0x416f00[_0xd9ae('0xa')]);_0x274e3b['stop']();}}}catch(_0x18aa41){console[_0xd9ae('0x1e')](_0x18aa41);logger['error'](_0xd9ae('0x1f'),_0x2f8f7b,_0x18aa41['stack']);_0x274e3b[_0xd9ae('0x13')]();}};}; \ No newline at end of file +var _0x515f=['toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','find','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','log','[%s][QUEUE]\x20%s','stack','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x515f,0x165));var _0xf515=function(_0x502b93,_0x25b04b){_0x502b93=_0x502b93-0x0;var _0x337691=_0x515f[_0x502b93];return _0x337691;};'use strict';var schema=require('validate');var _=require(_0xf515('0x0'));var util=require('util');var seqqueue=require(_0xf515('0x1'));var logger=require(_0xf515('0x2'))(_0xf515('0x3'));var strategy=require(_0xf515('0x4'));var queue=schema({'name':{'type':_0xf515('0x5'),'required':!![],'message':_0xf515('0x6')},'timeout':{'type':_0xf515('0x7'),'message':_0xf515('0x8')}});function writeLog(_0x250e90,_0x537a4d,_0x3fa235){return logger[_0xf515('0x9')](util[_0xf515('0xa')](_0xf515('0xb'),_0x250e90,_0x537a4d[_0xf515('0xc')],_0x3fa235));}function handleFindAgent(_0xb4ff1d){return function(_0x178a08){return _0x178a08['name'][_0xf515('0xd')]()===_0xb4ff1d[_0xf515('0xd')]();};}exports[_0xf515('0xe')]=function(_0x328564,_0x376329,_0x48fac1,_0x3a43ff){return function(_0x55c604){try{var _0x4f1e62={'name':_0x376329[0x0],'timeout':_0x376329[0x1]};var _0x3d5c01=queue[_0xf515('0xf')](_0x4f1e62,{'typecast':!![]});if(_0x3d5c01[_0xf515('0x10')]){logger[_0xf515('0x11')](_0xf515('0x12'),_0x328564,_[_0xf515('0x13')](_0x3d5c01,_0xf515('0x14'))[_0xf515('0x15')](',\x20'));_0x55c604['stop']();}else{var _0x43afd5=_[_0xf515('0x16')](_0x48fac1['agents'],handleFindAgent(_0x4f1e62[_0xf515('0xc')]));if(_0x43afd5){var _0x1568ef=(_0x4f1e62['timeout']||0xa)*0x3e8;var _0x418942,_0x5850b0;var _0x500cfe=seqqueue['createQueue'](_0x1568ef);_0x500cfe['id']=_0x328564;_0x500cfe[_0xf515('0x17')]=_0x1568ef;_0x500cfe['channel']=_0x3a43ff[_0xf515('0x18')];writeLog(_0x328564,_0x43afd5,util[_0xf515('0xa')](_0xf515('0x19'),_0x1568ef));_0x48fac1[_0xf515('0x1a')][_0x328564]['on']('end',function(){logger[_0xf515('0x9')](_0xf515('0x1b'),_0x328564);clearTimeout(_0x5850b0);_0x5850b0=undefined;_0x500cfe[_0xf515('0x1c')]();if(_0x48fac1[_0xf515('0x1a')][_0x328564]){delete _0x48fac1[_0xf515('0x1a')][_0x328564];}_0x55c604['stop']();});_0x48fac1[_0xf515('0x1a')][_0x328564]['on'](_0xf515('0x1d'),function(){if(_0x48fac1[_0xf515('0x1a')][_0x328564]){delete _0x48fac1[_0xf515('0x1a')][_0x328564];}});_0x5850b0=setTimeout(function(){logger[_0xf515('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x328564);clearTimeout(_0x5850b0);_0x500cfe[_0xf515('0x1c')]();_0x55c604[_0xf515('0x1e')]();},_0x1568ef);strategy[_0xf515('0x1f')](_0x500cfe,_0x43afd5,_0x48fac1,_0x3a43ff);}else{logger[_0xf515('0x11')](_0xf515('0x20'),_0x328564,_0x4f1e62[_0xf515('0xc')]);_0x55c604[_0xf515('0x21')]();}}}catch(_0x544729){console[_0xf515('0x22')](_0x544729);logger[_0xf515('0x11')](_0xf515('0x23'),_0x328564,_0x544729[_0xf515('0x24')]);_0x55c604[_0xf515('0x21')]();}};}; \ 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 4d7bef9..8878a69 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 _0xd3f0=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','body','postText','error','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','create','catch','stringify','finally'];(function(_0x87c20e,_0x427f12){var _0x285635=function(_0x87b694){while(--_0x87b694){_0x87c20e['push'](_0x87c20e['shift']());}};_0x285635(++_0x427f12);}(_0xd3f0,0x1d9));var _0x0d3f=function(_0xa1445e,_0x12ac58){_0xa1445e=_0xa1445e-0x0;var _0x1b2bef=_0xd3f0[_0xa1445e];return _0x1b2bef;};'use strict';var _=require(_0x0d3f('0x0'));var moment=require(_0x0d3f('0x1'));var AWS=require(_0x0d3f('0x2'));var utils=require(_0x0d3f('0x3'));var logger=require(_0x0d3f('0x4'))(_0x0d3f('0x5'));var rpc={'chatMessage':require(_0x0d3f('0x6')),'openchannelMessage':require(_0x0d3f('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0d3f('0x8')),'faxMessage':require(_0x0d3f('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x4564ba,_0x4d4e4a){return function(_0x43eddd){try{if(!_[_0x0d3f('0xa')](this['interaction'][_0x0d3f('0xb')])){logger[_0x0d3f('0xc')](_0x0d3f('0xd'),_0x4564ba,_0x0d3f('0xe'));return _0x43eddd[_0x0d3f('0xf')]();}var _0x10cb85={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0d3f('0x10')](_0x0d3f('0x11')),'direction':_0x0d3f('0x12')};if(this[_0x0d3f('0x13')]===_0x0d3f('0x14')||this[_0x0d3f('0x13')]===_0x0d3f('0x15')){_0x10cb85[_0x0d3f('0x16')]=this[_0x0d3f('0x17')]['phone'];}var _0x3490fe=this[_0x0d3f('0x13')];if(_0x3490fe===_0x0d3f('0x18')){_0x10cb85[_0x0d3f('0x19')]=this[_0x0d3f('0x1a')]['id'];}else{_0x10cb85[_['upperFirst'](_0x3490fe)+_0x0d3f('0x1b')]=this[_0x0d3f('0x1a')]['id'];}_0x10cb85[_[_0x0d3f('0x1c')](_0x3490fe)+_0x0d3f('0x1d')]=this['interaction']['id'];if(this['interaction']['created']){var _0x1a33fd=_0x4d4e4a[0x4];if(!_[_0x0d3f('0x1e')](_0x1a33fd)){_0x10cb85['body']=utils[_0x0d3f('0x1f')](_0x1a33fd,this);return rpc[_0x3490fe+_0x0d3f('0x20')][_0x0d3f('0x21')](_0x10cb85)['then'](function(_0x7a9e5c){logger[_0x0d3f('0xc')](_0x0d3f('0xd'),_0x4564ba,_0x10cb85['body']);})[_0x0d3f('0x22')](function(_0x2ca707){logger['error']('[%s][AMAZONLEX]\x20%s',_0x4564ba,JSON[_0x0d3f('0x23')](_0x2ca707));})[_0x0d3f('0x24')](function(){logger[_0x0d3f('0xc')](_0x0d3f('0x25'),_0x4564ba);_0x43eddd['stop']();});}else{logger[_0x0d3f('0xc')](_0x0d3f('0x26'),_0x4564ba);_0x43eddd[_0x0d3f('0x27')]();}}else{var _0x4c6811=this;var _0x44cc5c=new AWS[(_0x0d3f('0x28'))]({'accessKeyId':_0x4d4e4a[0x0],'secretAccessKey':_0x4d4e4a[0x1],'region':_0x4d4e4a[0x2]});var _0x4d95f6={'botAlias':_0x0d3f('0x29'),'botName':_0x4d4e4a[0x3],'inputText':this[_0x0d3f('0x2a')][_0x0d3f('0x2b')],'userId':this[_0x0d3f('0x13')]+':'+this[_0x0d3f('0x17')]['id']['toString']()};_0x44cc5c[_0x0d3f('0x2c')](_0x4d95f6,function(_0x3ecfb7,_0x490c60){if(_0x3ecfb7){logger[_0x0d3f('0x2d')](_0x0d3f('0xd'),_0x4564ba,_0x3ecfb7[_0x0d3f('0x2a')]);_0x43eddd[_0x0d3f('0xf')]();}else if(_0x490c60&&_0x490c60[_0x0d3f('0x2a')]){_0x4c6811[_0x0d3f('0x2b')][_0x0d3f('0x2e')]=_0x490c60;_0x10cb85[_0x0d3f('0x2b')]=_0x490c60['message'];_0x10cb85[_0x0d3f('0x2f')]=_0x0d3f('0x2e');_0x10cb85[_0x0d3f('0x30')]=JSON[_0x0d3f('0x23')](_0x490c60);return rpc[_0x3490fe+_0x0d3f('0x20')][_0x0d3f('0x21')](_0x10cb85)['then'](function(_0x3e7d05){logger[_0x0d3f('0xc')]('[%s][AMAZONLEX]\x20%s',_0x4564ba,_0x10cb85['body']);if(_0x490c60[_0x0d3f('0x31')]==_0x0d3f('0x32')){_0x43eddd['next']();}else{_0x43eddd[_0x0d3f('0x27')]();}})[_0x0d3f('0x22')](function(_0x11ceab){logger['error'](_0x0d3f('0xd'),_0x4564ba,JSON[_0x0d3f('0x23')](_0x11ceab));_0x43eddd['next']();});}else{_0x43eddd[_0x0d3f('0xf')]();}});}}catch(_0x5c8925){logger[_0x0d3f('0x2d')](_0x0d3f('0xd'),_0x4564ba,JSON[_0x0d3f('0x23')](_0x5c8925));_0x43eddd[_0x0d3f('0x27')]();}};}; \ No newline at end of file +var _0x3f25=['body','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','providerName','Message','dialogState','Failed','next','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','ChatWebsiteId','account','upperFirst','InteractionId','created','getMustacheRender','create','then'];(function(_0x5375be,_0x1d9b98){var _0x1bf8aa=function(_0x3282fe){while(--_0x3282fe){_0x5375be['push'](_0x5375be['shift']());}};_0x1bf8aa(++_0x1d9b98);}(_0x3f25,0xc4));var _0x53f2=function(_0x41ff6e,_0x18141a){_0x41ff6e=_0x41ff6e-0x0;var _0x116bd8=_0x3f25[_0x41ff6e];return _0x116bd8;};'use strict';var _=require(_0x53f2('0x0'));var moment=require(_0x53f2('0x1'));var AWS=require(_0x53f2('0x2'));var utils=require(_0x53f2('0x3'));var logger=require(_0x53f2('0x4'))(_0x53f2('0x5'));var rpc={'chatMessage':require(_0x53f2('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x53f2('0x7')),'faxMessage':require(_0x53f2('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x53f2('0x9')]=function(_0x5c4e5b,_0x2988ac){return function(_0x1200f4){try{if(!_[_0x53f2('0xa')](this[_0x53f2('0xb')][_0x53f2('0xc')])){logger[_0x53f2('0xd')](_0x53f2('0xe'),_0x5c4e5b,_0x53f2('0xf'));return _0x1200f4['next']();}var _0x3a541f={'ContactId':this['contact']['id'],'sentAt':moment()[_0x53f2('0x10')](_0x53f2('0x11')),'direction':_0x53f2('0x12')};if(this['channel']==='sms'||this[_0x53f2('0x13')]==='whatsapp'){_0x3a541f[_0x53f2('0x14')]=this[_0x53f2('0xb')][_0x53f2('0x14')];}var _0x3c8a6b=this['channel'];if(_0x3c8a6b==='chat'){_0x3a541f[_0x53f2('0x15')]=this[_0x53f2('0x16')]['id'];}else{_0x3a541f[_['upperFirst'](_0x3c8a6b)+'AccountId']=this[_0x53f2('0x16')]['id'];}_0x3a541f[_[_0x53f2('0x17')](_0x3c8a6b)+_0x53f2('0x18')]=this[_0x53f2('0xb')]['id'];if(this[_0x53f2('0xb')][_0x53f2('0x19')]){var _0x421be5=_0x2988ac[0x4];if(!_['isEmpty'](_0x421be5)){_0x3a541f['body']=utils[_0x53f2('0x1a')](_0x421be5,this);return rpc[_0x3c8a6b+'Message'][_0x53f2('0x1b')](_0x3a541f)[_0x53f2('0x1c')](function(_0x5ecad5){logger['info'](_0x53f2('0xe'),_0x5c4e5b,_0x3a541f[_0x53f2('0x1d')]);})[_0x53f2('0x1e')](function(_0x5004f0){logger[_0x53f2('0x1f')](_0x53f2('0xe'),_0x5c4e5b,JSON[_0x53f2('0x20')](_0x5004f0));})[_0x53f2('0x21')](function(){logger[_0x53f2('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5c4e5b);_0x1200f4[_0x53f2('0x22')]();});}else{logger[_0x53f2('0xd')](_0x53f2('0x23'),_0x5c4e5b);_0x1200f4[_0x53f2('0x22')]();}}else{var _0x17b033=this;var _0x1d4077=new AWS[(_0x53f2('0x24'))]({'accessKeyId':_0x2988ac[0x0],'secretAccessKey':_0x2988ac[0x1],'region':_0x2988ac[0x2]});var _0x472d44={'botAlias':_0x53f2('0x25'),'botName':_0x2988ac[0x3],'inputText':this[_0x53f2('0x26')][_0x53f2('0x1d')],'userId':this[_0x53f2('0x13')]+':'+this['interaction']['id'][_0x53f2('0x27')]()};_0x1d4077['postText'](_0x472d44,function(_0x20742d,_0x210f6e){if(_0x20742d){logger[_0x53f2('0x1f')](_0x53f2('0xe'),_0x5c4e5b,_0x20742d[_0x53f2('0x26')]);_0x1200f4['next']();}else if(_0x210f6e&&_0x210f6e[_0x53f2('0x26')]){_0x17b033[_0x53f2('0x1d')]['amazonlex']=_0x210f6e;_0x3a541f[_0x53f2('0x1d')]=_0x210f6e[_0x53f2('0x26')];_0x3a541f[_0x53f2('0x28')]='amazonlex';_0x3a541f['providerResponse']=JSON[_0x53f2('0x20')](_0x210f6e);return rpc[_0x3c8a6b+_0x53f2('0x29')]['create'](_0x3a541f)[_0x53f2('0x1c')](function(_0x3f2cd7){logger[_0x53f2('0xd')](_0x53f2('0xe'),_0x5c4e5b,_0x3a541f['body']);if(_0x210f6e[_0x53f2('0x2a')]==_0x53f2('0x2b')){_0x1200f4['next']();}else{_0x1200f4['stop']();}})[_0x53f2('0x1e')](function(_0x3c1124){logger[_0x53f2('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x5c4e5b,JSON[_0x53f2('0x20')](_0x3c1124));_0x1200f4[_0x53f2('0x2c')]();});}else{_0x1200f4['next']();}});}}catch(_0x51f532){logger[_0x53f2('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x5c4e5b,JSON[_0x53f2('0x20')](_0x51f532));_0x1200f4[_0x53f2('0x22')]();}};}; \ 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 6465010..ba6033e 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 _0xed2c=['../../rpc/faxInteraction','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','AccountId','upperFirst','InteractionId','Message','service','Smtp','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','','replace','';_0x230d25['headers']={'Auto-Submitted':_0xced2('0x3c'),'X-Auto-Response-Suppress':'All','Precedence':_0xced2('0x3d')};return mailRpc[_0xced2('0x3e')](_0x339e43,_0x230d25)['then'](function(_0x52297f){logger[_0xced2('0x10')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x18d96b);_0x230d25[_0xced2('0x37')]=_0x52297f[_0xced2('0x20')][_0xced2('0x37')];return rpc[_0x26a221+_0xced2('0x2d')][_0xced2('0x3f')](_0x230d25);})['then'](function(_0x935f2e){logger[_0xced2('0x10')](_0xced2('0x11'),_0x18d96b,JSON[_0xced2('0x40')](_0x935f2e));})[_0xced2('0x41')](function(_0x549bcf){logger[_0xced2('0x42')](_0xced2('0x43'),_0x18d96b,JSON['stringify'](_0x549bcf));})[_0xced2('0x44')](function(){Promise[_0xced2('0x45')]()[_0xced2('0x46')](function(){if(_0x11dedf[0x0]!=='2'||_0x1fa547[_0xced2('0x18')])return;return rpc[_0x26a221+'Interaction'][_0xced2('0x47')](_0x1fa547['id'],{'autoreplyExecuted':!![]})[_0xced2('0x46')](function(_0x25a7fd){logger[_0xced2('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x18d96b,JSON[_0xced2('0x40')](_0x25a7fd));})[_0xced2('0x41')](function(_0x5c07c6){logger[_0xced2('0x42')](_0xced2('0x48'),_0x18d96b,JSON[_0xced2('0x40')](_0x5c07c6));});})[_0xced2('0x46')](function(){_0x26c94b[_0xced2('0x17')]();});});}else{return rpc[this['channel']+'Message']['create'](_0x230d25)[_0xced2('0x46')](function(_0x3c46e3){logger['info']('[%s][AUTOREPLY]\x20%s',_0x18d96b,_0x230d25[_0xced2('0x1e')]);})[_0xced2('0x41')](function(_0x59cc57){logger[_0xced2('0x42')](_0xced2('0x11'),_0x18d96b,JSON[_0xced2('0x40')](_0x59cc57));})[_0xced2('0x44')](function(){Promise[_0xced2('0x45')]()['then'](function(){if(_0x11dedf[0x0]!=='2'||_0x1fa547[_0xced2('0x18')])return;return rpc[_0x26a221+_0xced2('0x49')]['update'](_0x1fa547['id'],{'autoreplyExecuted':!![]})[_0xced2('0x46')](function(_0x37bf62){logger[_0xced2('0x10')](_0xced2('0x4a'),_0x18d96b,JSON['stringify'](_0x37bf62));})['catch'](function(_0x5680ac){logger[_0xced2('0x42')](_0xced2('0x48'),_0x18d96b,JSON[_0xced2('0x40')](_0x5680ac));});})['then'](function(){_0x26c94b[_0xced2('0x17')]();});});}}}catch(_0xa4fb65){logger[_0xced2('0x42')](_0xced2('0x11'),_0x18d96b,JSON[_0xced2('0x40')](_0xa4fb65));_0x26c94b[_0xced2('0x4b')]();}};}; \ No newline at end of file +var _0x3f20=['All','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','finally','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','update','stop','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','out','mail','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','Smtp','service','host','secure','authentication','auth','inReplyTo','messageId','html','','auto-replied'];(function(_0x152cd2,_0x46a5fa){var _0x5d9ebe=function(_0x5d74af){while(--_0x5d74af){_0x152cd2['push'](_0x152cd2['shift']());}};_0x5d9ebe(++_0x46a5fa);}(_0x3f20,0x9a));var _0x03f2=function(_0x39c99b,_0x1b22c9){_0x39c99b=_0x39c99b-0x0;var _0x1944e1=_0x3f20[_0x39c99b];return _0x1944e1;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x03f2('0x0'));var logger=require(_0x03f2('0x1'))('routing');var rpc={'chatMessage':require(_0x03f2('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x03f2('0x3')),'smsMessage':require(_0x03f2('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x03f2('0x5')),'chatInteraction':require(_0x03f2('0x6')),'openchannelInteraction':require(_0x03f2('0x7')),'mailInteraction':require(_0x03f2('0x8')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x03f2('0x9')),'whatsappInteraction':require(_0x03f2('0xa'))};var mailRpc=require(_0x03f2('0xb'));exports[_0x03f2('0xc')]=function(_0x343e90,_0x1ae95b,_0x4aed3b,_0x40a59b){return function(_0x2ad30c){try{var _0xef4e16=this[_0x03f2('0xd')];if(_0xef4e16==='mail'&&_0x40a59b[_0x03f2('0xe')][_0x03f2('0xf')]){logger[_0x03f2('0x10')](_0x03f2('0x11'),_0x343e90,_0x03f2('0x12'));return _0x2ad30c[_0x03f2('0x13')]();}if(_0x1ae95b[0x0]==='1'&&(_[_0x03f2('0x14')](this[_0x03f2('0x15')][_0x03f2('0x16')])||!this[_0x03f2('0x15')][_0x03f2('0x16')])){logger[_0x03f2('0x10')](_0x03f2('0x11'),_0x343e90,_0x03f2('0x17'));return _0x2ad30c[_0x03f2('0x13')]();}if(_0x1ae95b[0x0]==='2'&&this[_0x03f2('0x15')][_0x03f2('0x18')]){logger[_0x03f2('0x10')](_0x03f2('0x19'),_0x343e90,'One\x20Time\x20already\x20sent');return _0x2ad30c[_0x03f2('0x13')]();}var _0x4264c7={'ContactId':this['contact']['id'],'sentAt':moment()[_0x03f2('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x03f2('0x1b')};if(this['channel']===_0x03f2('0x1c')){_0x4264c7[_0x03f2('0xe')]=utils[_0x03f2('0x1d')](_0x1ae95b[0x2],this);}else{_0x4264c7[_0x03f2('0xe')]=utils[_0x03f2('0x1d')](_0x1ae95b[0x1],this);}if(this[_0x03f2('0x1e')]){_0x4264c7['to']=this[_0x03f2('0x1e')][_0x03f2('0x1f')]||'';if(this[_0x03f2('0xd')]==='mail'&&_0x1ae95b[0x1]==='1'){_0x4264c7['cc']=this[_0x03f2('0x1e')]['cc']||'';}_0x4264c7[_0x03f2('0x1f')]=this[_0x03f2('0x1e')]['to']||'';_0x4264c7[_0x03f2('0x20')]=this[_0x03f2('0x1e')][_0x03f2('0x20')]||'';_0x4264c7[_0x03f2('0x21')]=!![];if(this[_0x03f2('0x1e')][_0x03f2('0x22')]){_0x4264c7['subject']='';_0x4264c7[_0x03f2('0x22')]+=_[_0x03f2('0x23')](this[_0x03f2('0x1e')]['subject'],_0x03f2('0x24'))?'':'Re:\x20';_0x4264c7[_0x03f2('0x22')]+=this['message']['subject'];}}if(this[_0x03f2('0xd')]===_0x03f2('0x25')){_0x4264c7[_0x03f2('0x26')]=this[_0x03f2('0x27')]['id'];}else{_0x4264c7[_['upperFirst'](this['channel'])+_0x03f2('0x28')]=this['account']['id'];}_0x4264c7[_[_0x03f2('0x29')](this[_0x03f2('0xd')])+_0x03f2('0x2a')]=this[_0x03f2('0x15')]['id'];var _0xbd6cbf=this[_0x03f2('0x15')];if(rpc[this['channel']+_0x03f2('0x2b')]){if(this[_0x03f2('0xd')]===_0x03f2('0x1c')){var _0x2b2e32={'tls':{'rejectUnauthorized':![]}};if(this[_0x03f2('0x27')][_0x03f2('0x2c')][_0x03f2('0x2d')]){_0x2b2e32[_0x03f2('0x2d')]=this[_0x03f2('0x27')][_0x03f2('0x2c')][_0x03f2('0x2d')];}else{_0x2b2e32[_0x03f2('0x2e')]=this[_0x03f2('0x27')][_0x03f2('0x2c')][_0x03f2('0x2e')];_0x2b2e32['port']=this[_0x03f2('0x27')]['Smtp']['port'];_0x2b2e32[_0x03f2('0x2f')]=this[_0x03f2('0x27')][_0x03f2('0x2c')][_0x03f2('0x2f')];}if(this[_0x03f2('0x27')][_0x03f2('0x2c')][_0x03f2('0x30')]){_0x2b2e32[_0x03f2('0x31')]={'user':this[_0x03f2('0x27')][_0x03f2('0x2c')]['user'],'pass':this[_0x03f2('0x27')][_0x03f2('0x2c')]['pass']};}_0x4264c7[_0x03f2('0x32')]=this[_0x03f2('0x1e')][_0x03f2('0x33')];_0x4264c7[_0x03f2('0x34')]=''+_['replace'](_0x4264c7[_0x03f2('0xe')],_0x03f2('0x35'),']+(>|$)/g,''),'priorityTrue':_0x60435[0x1],'priorityFalse':_0x60435[0x2]};var _0x1a969e=gotoif[_0x9286('0xb')](_0x2834f,{'typecast':!![]});if(_0x1a969e[_0x9286('0xc')]){logger[_0x9286('0xd')](_0x9286('0xe'),_0x4a20d2,_[_0x9286('0xf')](_0x1a969e,'message')['join'](',\x20'));_0x1675bf[_0x9286('0x10')]();}else{try{var _0xd6eaf8=eval('('+_0x2834f[_0x9286('0x11')]+')');var _0x1ae0c4=_0xd6eaf8?_0x2834f[_0x9286('0x12')]:_0x2834f['priorityFalse'];logger['info'](_0x9286('0x13'),_0x4a20d2,_0x2834f[_0x9286('0x11')],_0xd6eaf8,_0x1ae0c4||_0x9286('0x14'));if(_0x1ae0c4){var _0x480c31=_[_0x9286('0x15')](_0x1675bf['rules'](),{'p':_0x1ae0c4});if(_0x480c31>=0x0){logger[_0x9286('0x16')](_0x9286('0x17'),_0x4a20d2,_0x1ae0c4||_0x9286('0x14'),_0x480c31);_0x1675bf['next'](_0x480c31);}else{logger['info'](_0x9286('0x18'),_0x4a20d2,_0x1ae0c4||'next');_0x1675bf['stop']();}}else{_0x1675bf[_0x9286('0x14')]();}}catch(_0x21cb5e){logger[_0x9286('0xd')](_0x9286('0x19'),_0x4a20d2,_0x21cb5e[_0x9286('0x1a')]);_0x1675bf[_0x9286('0x10')]();}}}catch(_0x1e10d1){logger['error'](_0x9286('0xe'),_0x4a20d2,JSON[_0x9286('0x1b')](_0x1e10d1));_0x1675bf[_0x9286('0x10')]();}};}; \ No newline at end of file +var _0xd927=['number','priority\x20false\x20is\x20a\x20number','consequence','fromString','length','error','[%s][GOTOIF]\x20%s','message','join','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','priority\x20true\x20is\x20a\x20number'];(function(_0x423a8d,_0xfb858d){var _0x220831=function(_0x450747){while(--_0x450747){_0x423a8d['push'](_0x423a8d['shift']());}};_0x220831(++_0xfb858d);}(_0xd927,0x69));var _0x7d92=function(_0x228a78,_0x1b8e67){_0x228a78=_0x228a78-0x0;var _0x45a420=_0xd927[_0x228a78];return _0x45a420;};'use strict';var schema=require(_0x7d92('0x0'));var _=require(_0x7d92('0x1'));var htmlToText=require(_0x7d92('0x2'));var utils=require(_0x7d92('0x3'));var logger=require(_0x7d92('0x4'))(_0x7d92('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x7d92('0x6')},'priorityFalse':{'type':_0x7d92('0x7'),'message':_0x7d92('0x8')}});exports[_0x7d92('0x9')]=function(_0x5cfd3f,_0x35a41f){return function(_0x5e3b5b){try{var _0x4a0edb={'condition':htmlToText[_0x7d92('0xa')](utils['getMustacheRender'](_0x35a41f[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x35a41f[0x1],'priorityFalse':_0x35a41f[0x2]};var _0x10f63d=gotoif['validate'](_0x4a0edb,{'typecast':!![]});if(_0x10f63d[_0x7d92('0xb')]){logger[_0x7d92('0xc')](_0x7d92('0xd'),_0x5cfd3f,_['map'](_0x10f63d,_0x7d92('0xe'))[_0x7d92('0xf')](',\x20'));_0x5e3b5b['stop']();}else{try{var _0x119a16=eval('('+_0x4a0edb['condition']+')');var _0x48cfc4=_0x119a16?_0x4a0edb['priorityTrue']:_0x4a0edb[_0x7d92('0x10')];logger[_0x7d92('0x11')](_0x7d92('0x12'),_0x5cfd3f,_0x4a0edb[_0x7d92('0x13')],_0x119a16,_0x48cfc4||'next');if(_0x48cfc4){var _0xc86441=_[_0x7d92('0x14')](_0x5e3b5b[_0x7d92('0x15')](),{'p':_0x48cfc4});if(_0xc86441>=0x0){logger[_0x7d92('0x11')](_0x7d92('0x16'),_0x5cfd3f,_0x48cfc4||'next',_0xc86441);_0x5e3b5b[_0x7d92('0x17')](_0xc86441);}else{logger['info'](_0x7d92('0x18'),_0x5cfd3f,_0x48cfc4||_0x7d92('0x17'));_0x5e3b5b[_0x7d92('0x19')]();}}else{_0x5e3b5b[_0x7d92('0x17')]();}}catch(_0x3fe70a){logger['error'](_0x7d92('0x1a'),_0x5cfd3f,_0x3fe70a['message']);_0x5e3b5b[_0x7d92('0x19')]();}}}catch(_0x4e6e03){logger['error'](_0x7d92('0xd'),_0x5cfd3f,JSON[_0x7d92('0x1b')](_0x4e6e03));_0x5e3b5b[_0x7d92('0x19')]();}};}; \ 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 8a85e34..f7a8d80 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 _0x52cb=['map','message','join','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0x52cb,0x83));var _0xb52c=function(_0x59accc,_0x6097fa){_0x59accc=_0x59accc-0x0;var _0x810133=_0x52cb[_0x59accc];return _0x810133;};'use strict';var schema=require(_0xb52c('0x0'));var _=require('lodash');var logger=require(_0xb52c('0x1'))(_0xb52c('0x2'));var gotop=schema({'priority':{'type':_0xb52c('0x3'),'required':!![],'message':_0xb52c('0x4')}});exports[_0xb52c('0x5')]=function(_0xadd841,_0x1e6372){return function(_0xebd7fd){try{var _0x2ed4ba={'priority':_0x1e6372[0x0]};var _0x1498f5=gotop[_0xb52c('0x0')](_0x2ed4ba,{'typecast':!![]});if(_0x1498f5[_0xb52c('0x6')]){logger[_0xb52c('0x7')](_0xb52c('0x8'),_0xadd841,_[_0xb52c('0x9')](_0x1498f5,_0xb52c('0xa'))[_0xb52c('0xb')](',\x20'));_0xebd7fd['stop']();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0xadd841,_0x2ed4ba[_0xb52c('0xc')]);if(_0x2ed4ba[_0xb52c('0xc')]){var _0x5d1492=_[_0xb52c('0xd')](_0xebd7fd[_0xb52c('0xe')](),{'p':_0x2ed4ba[_0xb52c('0xc')]});if(_0x5d1492>=0x0){logger[_0xb52c('0xf')](_0xb52c('0x10'),_0xadd841,_0x2ed4ba[_0xb52c('0xc')]||_0xb52c('0x11'),_0x5d1492);_0xebd7fd[_0xb52c('0x11')](_0x5d1492);}else{logger[_0xb52c('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0xadd841,_0x2ed4ba[_0xb52c('0xc')]||'next');_0xebd7fd[_0xb52c('0x12')]();}}else{_0xebd7fd[_0xb52c('0x11')]();}}}catch(_0x44466f){logger['error']('[%s][GOTOP]\x20%s',_0xadd841,JSON[_0xb52c('0x13')](_0x44466f));_0xebd7fd['stop']();}};}; \ No newline at end of file +var _0xcbb6=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules'];(function(_0x35789c,_0x1485b8){var _0x126001=function(_0xb0f31){while(--_0xb0f31){_0x35789c['push'](_0x35789c['shift']());}};_0x126001(++_0x1485b8);}(_0xcbb6,0x158));var _0x6cbb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xcbb6[_0x501510];return _0x1e6ee5;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x6cbb('0x0'))('routing');var gotop=schema({'priority':{'type':_0x6cbb('0x1'),'required':!![],'message':_0x6cbb('0x2')}});exports[_0x6cbb('0x3')]=function(_0x3f4e4b,_0x41f294){return function(_0x189929){try{var _0x146e3a={'priority':_0x41f294[0x0]};var _0x4f2cd9=gotop[_0x6cbb('0x4')](_0x146e3a,{'typecast':!![]});if(_0x4f2cd9[_0x6cbb('0x5')]){logger[_0x6cbb('0x6')]('[%s][GOTOP]\x20%s',_0x3f4e4b,_['map'](_0x4f2cd9,_0x6cbb('0x7'))['join'](',\x20'));_0x189929[_0x6cbb('0x8')]();}else{logger[_0x6cbb('0x9')](_0x6cbb('0xa'),_0x3f4e4b,_0x146e3a[_0x6cbb('0xb')]);if(_0x146e3a['priority']){var _0x447178=_['findIndex'](_0x189929[_0x6cbb('0xc')](),{'p':_0x146e3a[_0x6cbb('0xb')]});if(_0x447178>=0x0){logger[_0x6cbb('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3f4e4b,_0x146e3a[_0x6cbb('0xb')]||_0x6cbb('0xd'),_0x447178);_0x189929[_0x6cbb('0xd')](_0x447178);}else{logger['info'](_0x6cbb('0xe'),_0x3f4e4b,_0x146e3a[_0x6cbb('0xb')]||'next');_0x189929['stop']();}}else{_0x189929[_0x6cbb('0xd')]();}}}catch(_0x571372){logger[_0x6cbb('0x6')](_0x6cbb('0xf'),_0x3f4e4b,JSON[_0x6cbb('0x10')](_0x571372));_0x189929[_0x6cbb('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 587ad2a..61a9db5 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 _0x01f0=['interaction','Message','create','then','next','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x01f0,0x93));var _0x001f=function(_0x2ad8ea,_0x32b828){_0x2ad8ea=_0x2ad8ea-0x0;var _0x1dd376=_0x01f0[_0x2ad8ea];return _0x1dd376;};'use strict';var _=require(_0x001f('0x0'));var utils=require('./utils');var logger=require(_0x001f('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x001f('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x001f('0x3')),'whatsappMessage':require(_0x001f('0x4'))};exports['consequence']=function(_0x55b660,_0x148647){return function(_0x591a49){try{var _0x5e1b23={'body':utils[_0x001f('0x5')](_0x148647[0x0],this),'ContactId':this[_0x001f('0x6')]['id']};if(this[_0x001f('0x7')]===_0x001f('0x8')){_0x5e1b23[_0x001f('0x9')]=this['account']['id'];}else{_0x5e1b23[_['upperFirst'](this['channel'])+_0x001f('0xa')]=this[_0x001f('0xb')]['id'];}_0x5e1b23[_[_0x001f('0xc')](this[_0x001f('0x7')])+_0x001f('0xd')]=this[_0x001f('0xe')]['id'];if(rpc[this['channel']+_0x001f('0xf')]){return rpc[this[_0x001f('0x7')]+_0x001f('0xf')][_0x001f('0x10')](_0x5e1b23)[_0x001f('0x11')](function(_0x533a03){logger['info']('[%s][MESSAGE]\x20%s',_0x55b660,_0x5e1b23['body']);_0x591a49[_0x001f('0x12')]();})['catch'](function(_0x685867){logger[_0x001f('0x13')](_0x001f('0x14'),_0x55b660,JSON[_0x001f('0x15')](_0x685867));_0x591a49[_0x001f('0x16')]();});}}catch(_0x5e7198){logger['error']('[%s][MESSAGE]\x20%s',_0x55b660,JSON[_0x001f('0x15')](_0x5e7198));_0x591a49['stop']();}};}; \ No newline at end of file +var _0x47c7=['../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x2f9a0b,_0x507dad){var _0x49c803=function(_0x3a03a0){while(--_0x3a03a0){_0x2f9a0b['push'](_0x2f9a0b['shift']());}};_0x49c803(++_0x507dad);}(_0x47c7,0x1f3));var _0x747c=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x47c7[_0x178856];return _0x3c7fe7;};'use strict';var _=require('lodash');var utils=require(_0x747c('0x0'));var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x747c('0x3')),'smsMessage':require(_0x747c('0x4')),'faxMessage':require(_0x747c('0x5')),'whatsappMessage':require(_0x747c('0x6'))};exports['consequence']=function(_0x24cbab,_0x5c9a0b){return function(_0xf4d0b2){try{var _0x351f82={'body':utils[_0x747c('0x7')](_0x5c9a0b[0x0],this),'ContactId':this[_0x747c('0x8')]['id']};if(this[_0x747c('0x9')]===_0x747c('0xa')){_0x351f82[_0x747c('0xb')]=this[_0x747c('0xc')]['id'];}else{_0x351f82[_[_0x747c('0xd')](this[_0x747c('0x9')])+_0x747c('0xe')]=this[_0x747c('0xc')]['id'];}_0x351f82[_[_0x747c('0xd')](this[_0x747c('0x9')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x747c('0x9')]+_0x747c('0xf')]){return rpc[this[_0x747c('0x9')]+_0x747c('0xf')]['create'](_0x351f82)['then'](function(_0x332b65){logger[_0x747c('0x10')](_0x747c('0x11'),_0x24cbab,_0x351f82[_0x747c('0x12')]);_0xf4d0b2[_0x747c('0x13')]();})[_0x747c('0x14')](function(_0x3a8d64){logger[_0x747c('0x15')]('[%s][MESSAGE]\x20%s',_0x24cbab,JSON[_0x747c('0x16')](_0x3a8d64));_0xf4d0b2[_0x747c('0x17')]();});}}catch(_0x17798d){logger[_0x747c('0x15')]('[%s][MESSAGE]\x20%s',_0x24cbab,JSON[_0x747c('0x16')](_0x17798d));_0xf4d0b2[_0x747c('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index f8b4368..901abbb 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 _0xa1bf=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop'];(function(_0x3b89cb,_0x356ca9){var _0x4b6c3d=function(_0x16dbe9){while(--_0x16dbe9){_0x3b89cb['push'](_0x3b89cb['shift']());}};_0x4b6c3d(++_0x356ca9);}(_0xa1bf,0x122));var _0xfa1b=function(_0x39df29,_0x450cdc){_0x39df29=_0x39df29-0x0;var _0x4cecc6=_0xa1bf[_0x39df29];return _0x4cecc6;};'use strict';var utils=require(_0xfa1b('0x0'));var logger=require(_0xfa1b('0x1'))(_0xfa1b('0x2'));exports[_0xfa1b('0x3')]=function(_0x2a1d06,_0x3b747d){return function(_0x2980da){try{logger[_0xfa1b('0x4')](_0xfa1b('0x5'),_0x2a1d06,utils[_0xfa1b('0x6')](_0x3b747d[0x0],this));_0x2980da[_0xfa1b('0x7')]();}catch(_0x2beb69){logger['error']('[%s][NOOP]\x20%s',_0x2a1d06,JSON[_0xfa1b('0x8')](_0x2beb69));_0x2980da[_0xfa1b('0x9')]();}};}; \ No newline at end of file +var _0x2602=['stringify','stop','./utils','../../../../config/logger','routing','consequence','info','next','error'];(function(_0x36de71,_0x148629){var _0x304290=function(_0x217b19){while(--_0x217b19){_0x36de71['push'](_0x36de71['shift']());}};_0x304290(++_0x148629);}(_0x2602,0x89));var _0x2260=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0x2602[_0x4be8ba];return _0x1af822;};'use strict';var utils=require(_0x2260('0x0'));var logger=require(_0x2260('0x1'))(_0x2260('0x2'));exports[_0x2260('0x3')]=function(_0x47ae78,_0x18d5c1){return function(_0x453dc5){try{logger[_0x2260('0x4')]('[%s][NOOP]\x20%s',_0x47ae78,utils['getMustacheRender'](_0x18d5c1[0x0],this));_0x453dc5[_0x2260('0x5')]();}catch(_0x2e918e){logger[_0x2260('0x6')]('[%s][NOOP]\x20%s',_0x47ae78,JSON[_0x2260('0x7')](_0x2e918e));_0x453dc5[_0x2260('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 2325996..460e615 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 _0x3589=['next','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','moment','ioredis','../../../../config/environment','routing','./strategy','redis','localhost','socket.io-emitter','account','queue','from','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','contact','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','info','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x3589,0x94));var _0x9358=function(_0xbe2e8,_0x424ee5){_0xbe2e8=_0xbe2e8-0x0;var _0x41dbf4=_0x3589[_0xbe2e8];return _0x41dbf4;};'use strict';var schema=require(_0x9358('0x0'));var _=require('lodash');var util=require(_0x9358('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x9358('0x2'));var Redis=require(_0x9358('0x3'));var config=require(_0x9358('0x4'));var logger=require('../../../../config/logger')(_0x9358('0x5'));var strategy=require(_0x9358('0x6'));config['redis']=_['defaults'](config[_0x9358('0x7')],{'host':_0x9358('0x8'),'port':0x18eb});var io=require(_0x9358('0x9'))(new Redis(config[_0x9358('0x7')]));var attributes=['id','queue_id',_0x9358('0xa'),_0x9358('0xb'),_0x9358('0xc'),'joinAt'];function emit(_0x1b400c,_0xf57a6a,_0xc1d876){io['to'](_0x1b400c)['emit'](_0xf57a6a,_0xc1d876);}function emitChannelQueueInteraction(_0x1fb2cf,_0x53021d,_0x2963d9,_0x29a9ef,_0x26add6,_0x130a4b,_0x462679,_0x3679cb){var _0x1618fe=_['clone'](_0x2963d9);_0x1618fe['queue_id']=_0x3679cb;_0x1618fe[_0x9358('0xb')]=_0x53021d;_0x1618fe[_0x9358('0xa')]=_0x29a9ef;_0x1618fe['id']=_0x26add6;if(_0x130a4b){_0x462679[util[_0x9358('0xd')](_0x9358('0xe'),_0x1fb2cf)][_0x26add6]=_[_0x9358('0xf')](_0x1618fe,attributes);}else{delete _0x462679[util[_0x9358('0xd')](_0x9358('0xe'),_0x1fb2cf)][_0x26add6];}emit(util[_0x9358('0xd')](_0x9358('0x10'),_0x1fb2cf,_0x53021d),util['format'](_0x9358('0x11'),_0x1fb2cf,_0x130a4b?_0x9358('0x12'):'remove'),_[_0x9358('0xf')](_0x1618fe,attributes));}var rpc={'openchannelQueueReport':require(_0x9358('0x13')),'mailQueueReport':require(_0x9358('0x14')),'chatQueueReport':require(_0x9358('0x15')),'smsQueueReport':require(_0x9358('0x16')),'faxQueueReport':require(_0x9358('0x17')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0x9358('0x18')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x146282,_0x3e3904,_0x1b4a1f,_0x8d6c07){if(_0x146282&&_0x3e3904&&_0x1b4a1f){_0x3e3904[_0x9358('0x19')]+=0x1;var _0xf1e778={'uniqueid':_0x146282,'from':_0x1b4a1f[_0x9358('0x1a')]?_0x1b4a1f['body'][_0x9358('0xc')]:'','joinAt':moment()[_0x9358('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1b4a1f['contact']?_0x1b4a1f[_0x9358('0x1b')]['id']:null,'ListId':_0x1b4a1f['list']?_0x1b4a1f['list']['id']:null};_0xf1e778[_[_0x9358('0x1c')](_0x1b4a1f[_0x9358('0x1d')])+'QueueId']=_0x3e3904['id']||null;_0xf1e778[_[_0x9358('0x1c')](_0x1b4a1f[_0x9358('0x1d')])+_0x9358('0x1e')]=_0x1b4a1f[_0x9358('0x1f')]?_0x1b4a1f[_0x9358('0x1f')]['id']:null;_0xf1e778[_[_0x9358('0x1c')](_0x1b4a1f[_0x9358('0x1d')])+_0x9358('0x20')]=_0x1b4a1f[_0x9358('0x21')]?_0x1b4a1f[_0x9358('0x21')]['id']:null;_0xf1e778[_[_0x9358('0x1c')](_0x1b4a1f[_0x9358('0x1d')])+(_0x1b4a1f[_0x9358('0x1d')]!==_0x9358('0x22')?_0x9358('0x23'):_0x9358('0x24'))]=_0x1b4a1f[_0x9358('0xa')]?_0x1b4a1f[_0x9358('0xa')]['id']:null;logger['info'](util[_0x9358('0xd')]('[%s][START:QUEUE][NAME:%s]',_0x146282,_0x3e3904[_0x9358('0x25')]));emitChannelQueueInteraction(_0x1b4a1f['channel'],_0x3e3904[_0x9358('0x25')],_0xf1e778,_0x1b4a1f['account'][_0x9358('0x25')],_0x1b4a1f[_0x9358('0x21')]['id'],!![],_0x8d6c07,_0x3e3904['id']);if(rpc[_0x1b4a1f['channel']+_0x9358('0x26')]){return rpc[_0x1b4a1f[_0x9358('0x1d')]+_0x9358('0x26')]['create'](_0xf1e778)[_0x9358('0x27')](function(_0x1b72b0){logger[_0x9358('0x28')](_0x9358('0x29'));});}}}function stopRouting(_0x3f2971,_0x2c31c2,_0x1af22b,_0x80924d){if(_0x3f2971&&_0x2c31c2){_0x2c31c2[_0x9358('0x19')]-=0x1;var _0x38e9cb={'leaveAt':moment()[_0x9358('0xd')](_0x9358('0x2a')),'acceptAt':moment()[_0x9358('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x9358('0x2b')};logger[_0x9358('0x2c')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x3f2971,_0x2c31c2[_0x9358('0x25')]));emitChannelQueueInteraction(_0x1af22b[_0x9358('0x1d')],_0x2c31c2[_0x9358('0x25')],_0x1af22b[_0x9358('0x1a')],_0x1af22b[_0x9358('0xa')][_0x9358('0x25')],_0x1af22b['message']['id'],![],_0x80924d,_0x2c31c2['id']);if(rpc[_0x1af22b['channel']+_0x9358('0x26')]){return rpc[_0x1af22b[_0x9358('0x1d')]+_0x9358('0x26')][_0x9358('0x2d')](_0x3f2971,_0x38e9cb)[_0x9358('0x27')](function(_0xb7744d){logger[_0x9358('0x28')](_0x9358('0x2e'));});}}}function endRouting(_0x2e8876,_0x4f26d3,_0x4109d5,_0x4e8590){if(_0x2e8876&&_0x4f26d3){_0x4f26d3['waiting']-=0x1;var _0x4d90ba={'leaveAt':moment()[_0x9358('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x9358('0xd')](_0x9358('0x2a')),'reason':_0x9358('0x2f')};logger[_0x9358('0x2c')](util[_0x9358('0xd')](_0x9358('0x30'),_0x2e8876,_0x4f26d3[_0x9358('0x25')]));emitChannelQueueInteraction(_0x4109d5[_0x9358('0x1d')],_0x4f26d3[_0x9358('0x25')],_0x4109d5[_0x9358('0x1a')],_0x4109d5[_0x9358('0xa')][_0x9358('0x25')],_0x4109d5[_0x9358('0x21')]['id'],![],_0x4e8590);if(rpc[_0x4109d5['channel']+_0x9358('0x26')]){return rpc[_0x4109d5[_0x9358('0x1d')]+_0x9358('0x26')]['update'](_0x2e8876,_0x4d90ba)[_0x9358('0x27')](function(_0x67e84a){logger[_0x9358('0x28')](_0x9358('0x2e'));});}}}function handleFindQueue(_0x3ab2e6){return function(_0x4054c2){return _0x4054c2[_0x9358('0x25')][_0x9358('0x31')]()===_0x3ab2e6[_0x9358('0x31')]();};}exports[_0x9358('0x32')]=function(_0x243541,_0x5f2b36,_0x544ae2,_0x49c4bc){return function(_0x2f3135){try{var _0xb85216={'name':_0x5f2b36[0x0],'timeout':_0x5f2b36[0x1]};var _0x474776=queue['validate'](_0xb85216,{'typecast':!![]});if(_0x474776[_0x9358('0x33')]){logger[_0x9358('0x28')](_0x9358('0x34'),_0x243541,_['map'](_0x474776,'message')[_0x9358('0x35')](',\x20'));_0x2f3135[_0x9358('0x36')]();}else{var _0x3d992c=_[_0x9358('0x37')](_0x544ae2[_0x49c4bc[_0x9358('0x1d')]+'Queues'],handleFindQueue(_0xb85216[_0x9358('0x25')]));if(_0x3d992c){startRouting(_0x243541,_0x3d992c,_0x49c4bc,_0x544ae2);var _0x218a3e=(_0x3d992c['timeout']||0xa)*0x3e8;var _0x38999d=(_0xb85216[_0x9358('0x2f')]||0x14)*0x3e8;var _0x9a8276,_0x2454f1;if(_0x218a3e>_0x38999d){_0x38999d=_0x218a3e;}var _0x51067e=seqqueue[_0x9358('0x38')](_0x218a3e);_0x51067e['id']=_0x243541;_0x51067e[_0x9358('0x39')]=_0x218a3e;_0x51067e[_0x9358('0x3a')]=_0x38999d;_0x51067e['channel']=_0x49c4bc[_0x9358('0x1d')];_0x544ae2[_0x9358('0x3b')][_0x243541]['on'](_0x9358('0x3c'),function(){logger[_0x9358('0x2c')](_0x9358('0x3d'),_0x243541);stopRouting(_0x243541,_0x3d992c,_0x49c4bc,_0x544ae2);clearTimeout(_0x9a8276);_0x9a8276=undefined;_0x51067e[_0x9358('0x3e')](!![]);if(_0x544ae2[_0x9358('0x3b')][_0x243541]){delete _0x544ae2[_0x9358('0x3b')][_0x243541];}_0x2f3135[_0x9358('0x36')]();});_0x544ae2[_0x9358('0x3b')][_0x243541]['on'](_0x9358('0x3f'),function(){if(_0x544ae2[_0x9358('0x3b')][_0x243541]){delete _0x544ae2['rules'][_0x243541];}});_0x9a8276=setTimeout(function(){logger[_0x9358('0x2c')](_0x9358('0x40'),_0x243541);endRouting(_0x243541,_0x3d992c,_0x49c4bc,_0x544ae2);clearTimeout(_0x9a8276);_0x51067e[_0x9358('0x3e')](!![]);_0x2f3135[_0x9358('0x41')]();},_0x38999d);switch(_0x3d992c[_0x9358('0x42')]){case'rrmemory':strategy['rrmemory'](_0x51067e,_0x3d992c,_0x544ae2,_0x49c4bc);break;default:strategy[_0x9358('0x43')](_0x51067e,_0x3d992c,_0x544ae2,_0x49c4bc);}}else{logger['error'](_0x9358('0x44'),_0x243541,_0xb85216[_0x9358('0x25')]);_0x2f3135[_0x9358('0x36')]();}}}catch(_0x56702a){console[_0x9358('0x45')](_0x56702a);logger['error']('[%s][QUEUE]\x20%s',_0x243541,_0x56702a[_0x9358('0x46')]);_0x2f3135['stop']();}};}; \ No newline at end of file +var _0x4fe0=['close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','account','queue','joinAt','emit','clone','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','channel','QueueId','upperFirst','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','accepted','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED'];(function(_0x1d3892,_0x47d5fe){var _0x574ff2=function(_0x5cc441){while(--_0x5cc441){_0x1d3892['push'](_0x1d3892['shift']());}};_0x574ff2(++_0x47d5fe);}(_0x4fe0,0x1d8));var _0x04fe=function(_0x261d0d,_0x14d235){_0x261d0d=_0x261d0d-0x0;var _0x4109c7=_0x4fe0[_0x261d0d];return _0x4109c7;};'use strict';var schema=require(_0x04fe('0x0'));var _=require(_0x04fe('0x1'));var util=require(_0x04fe('0x2'));var seqqueue=require(_0x04fe('0x3'));var moment=require(_0x04fe('0x4'));var Redis=require(_0x04fe('0x5'));var config=require(_0x04fe('0x6'));var logger=require(_0x04fe('0x7'))(_0x04fe('0x8'));var strategy=require(_0x04fe('0x9'));config[_0x04fe('0xa')]=_['defaults'](config[_0x04fe('0xa')],{'host':_0x04fe('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x04fe('0xc'),_0x04fe('0xd'),_0x04fe('0xe'),'from',_0x04fe('0xf')];function emit(_0x4153e9,_0x34989f,_0x483082){io['to'](_0x4153e9)[_0x04fe('0x10')](_0x34989f,_0x483082);}function emitChannelQueueInteraction(_0x65b6bb,_0x4b32f7,_0x45b647,_0x5c370c,_0x1683fa,_0x227a60,_0xe25525,_0x788be7){var _0x47edbe=_[_0x04fe('0x11')](_0x45b647);_0x47edbe['queue_id']=_0x788be7;_0x47edbe['queue']=_0x4b32f7;_0x47edbe['account']=_0x5c370c;_0x47edbe['id']=_0x1683fa;if(_0x227a60){_0xe25525[util[_0x04fe('0x12')]('%sQueuesWaitingInteractions',_0x65b6bb)][_0x1683fa]=_[_0x04fe('0x13')](_0x47edbe,attributes);}else{delete _0xe25525[util[_0x04fe('0x12')](_0x04fe('0x14'),_0x65b6bb)][_0x1683fa];}emit(util[_0x04fe('0x12')](_0x04fe('0x15'),_0x65b6bb,_0x4b32f7),util[_0x04fe('0x12')](_0x04fe('0x16'),_0x65b6bb,_0x227a60?_0x04fe('0x17'):'remove'),_[_0x04fe('0x13')](_0x47edbe,attributes));}var rpc={'openchannelQueueReport':require(_0x04fe('0x18')),'mailQueueReport':require(_0x04fe('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x04fe('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x04fe('0x1b'))};var queue=schema({'name':{'type':_0x04fe('0x1c'),'required':!![],'message':_0x04fe('0x1d')},'timeout':{'type':_0x04fe('0x1e'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x48b831,_0x28865e,_0x3ec30b,_0x12bf2f){if(_0x48b831&&_0x28865e&&_0x3ec30b){_0x28865e[_0x04fe('0x1f')]+=0x1;var _0x537377={'uniqueid':_0x48b831,'from':_0x3ec30b['body']?_0x3ec30b[_0x04fe('0x20')][_0x04fe('0x21')]:'','joinAt':moment()[_0x04fe('0x12')](_0x04fe('0x22')),'ContactId':_0x3ec30b[_0x04fe('0x23')]?_0x3ec30b[_0x04fe('0x23')]['id']:null,'ListId':_0x3ec30b['list']?_0x3ec30b['list']['id']:null};_0x537377[_['upperFirst'](_0x3ec30b[_0x04fe('0x24')])+_0x04fe('0x25')]=_0x28865e['id']||null;_0x537377[_[_0x04fe('0x26')](_0x3ec30b[_0x04fe('0x24')])+'InteractionId']=_0x3ec30b[_0x04fe('0x27')]?_0x3ec30b[_0x04fe('0x27')]['id']:null;_0x537377[_[_0x04fe('0x26')](_0x3ec30b['channel'])+_0x04fe('0x28')]=_0x3ec30b[_0x04fe('0x29')]?_0x3ec30b[_0x04fe('0x29')]['id']:null;_0x537377[_[_0x04fe('0x26')](_0x3ec30b[_0x04fe('0x24')])+(_0x3ec30b[_0x04fe('0x24')]!==_0x04fe('0x2a')?'AccountId':_0x04fe('0x2b'))]=_0x3ec30b['account']?_0x3ec30b[_0x04fe('0xd')]['id']:null;logger[_0x04fe('0x2c')](util['format'](_0x04fe('0x2d'),_0x48b831,_0x28865e[_0x04fe('0x2e')]));emitChannelQueueInteraction(_0x3ec30b[_0x04fe('0x24')],_0x28865e[_0x04fe('0x2e')],_0x537377,_0x3ec30b['account'][_0x04fe('0x2e')],_0x3ec30b['message']['id'],!![],_0x12bf2f,_0x28865e['id']);if(rpc[_0x3ec30b[_0x04fe('0x24')]+'QueueReport']){return rpc[_0x3ec30b[_0x04fe('0x24')]+_0x04fe('0x2f')]['create'](_0x537377)[_0x04fe('0x30')](function(_0x5246a3){logger[_0x04fe('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x41eae8,_0x3e92ea,_0x51a02f,_0x5cacb4){if(_0x41eae8&&_0x3e92ea){_0x3e92ea[_0x04fe('0x1f')]-=0x1;var _0x24dc3b={'leaveAt':moment()['format'](_0x04fe('0x22')),'acceptAt':moment()[_0x04fe('0x12')](_0x04fe('0x22')),'reason':_0x04fe('0x32')};logger[_0x04fe('0x2c')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x41eae8,_0x3e92ea['name']));emitChannelQueueInteraction(_0x51a02f['channel'],_0x3e92ea['name'],_0x51a02f[_0x04fe('0x20')],_0x51a02f['account']['name'],_0x51a02f['message']['id'],![],_0x5cacb4,_0x3e92ea['id']);if(rpc[_0x51a02f[_0x04fe('0x24')]+_0x04fe('0x2f')]){return rpc[_0x51a02f[_0x04fe('0x24')]+_0x04fe('0x2f')]['update'](_0x41eae8,_0x24dc3b)[_0x04fe('0x30')](function(_0x13b98e){logger['error'](_0x04fe('0x33'));});}}}function endRouting(_0x1166a2,_0x2cd8c6,_0x4ccdc9,_0x1620dc){if(_0x1166a2&&_0x2cd8c6){_0x2cd8c6[_0x04fe('0x1f')]-=0x1;var _0x13c510={'leaveAt':moment()[_0x04fe('0x12')](_0x04fe('0x22')),'exitAt':moment()[_0x04fe('0x12')](_0x04fe('0x22')),'reason':_0x04fe('0x34')};logger[_0x04fe('0x2c')](util['format'](_0x04fe('0x35'),_0x1166a2,_0x2cd8c6[_0x04fe('0x2e')]));emitChannelQueueInteraction(_0x4ccdc9[_0x04fe('0x24')],_0x2cd8c6['name'],_0x4ccdc9[_0x04fe('0x20')],_0x4ccdc9[_0x04fe('0xd')][_0x04fe('0x2e')],_0x4ccdc9[_0x04fe('0x29')]['id'],![],_0x1620dc);if(rpc[_0x4ccdc9[_0x04fe('0x24')]+_0x04fe('0x2f')]){return rpc[_0x4ccdc9[_0x04fe('0x24')]+_0x04fe('0x2f')][_0x04fe('0x36')](_0x1166a2,_0x13c510)[_0x04fe('0x30')](function(_0x2bdf0e){logger[_0x04fe('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x22a3d6){return function(_0x42a442){return _0x42a442[_0x04fe('0x2e')][_0x04fe('0x37')]()===_0x22a3d6[_0x04fe('0x37')]();};}exports[_0x04fe('0x38')]=function(_0x36a6c8,_0x1ec3ed,_0x19d745,_0x4ec471){return function(_0x10e092){try{var _0xfa8929={'name':_0x1ec3ed[0x0],'timeout':_0x1ec3ed[0x1]};var _0x25e0ee=queue[_0x04fe('0x0')](_0xfa8929,{'typecast':!![]});if(_0x25e0ee[_0x04fe('0x39')]){logger[_0x04fe('0x31')](_0x04fe('0x3a'),_0x36a6c8,_[_0x04fe('0x3b')](_0x25e0ee,_0x04fe('0x29'))[_0x04fe('0x3c')](',\x20'));_0x10e092[_0x04fe('0x3d')]();}else{var _0x56afad=_[_0x04fe('0x3e')](_0x19d745[_0x4ec471[_0x04fe('0x24')]+'Queues'],handleFindQueue(_0xfa8929[_0x04fe('0x2e')]));if(_0x56afad){startRouting(_0x36a6c8,_0x56afad,_0x4ec471,_0x19d745);var _0x49521b=(_0x56afad[_0x04fe('0x34')]||0xa)*0x3e8;var _0x504a17=(_0xfa8929[_0x04fe('0x34')]||0x14)*0x3e8;var _0x52d405,_0x209e2f;if(_0x49521b>_0x504a17){_0x504a17=_0x49521b;}var _0x2014a3=seqqueue['createQueue'](_0x49521b);_0x2014a3['id']=_0x36a6c8;_0x2014a3[_0x04fe('0x3f')]=_0x49521b;_0x2014a3[_0x04fe('0x40')]=_0x504a17;_0x2014a3[_0x04fe('0x24')]=_0x4ec471[_0x04fe('0x24')];_0x19d745['rules'][_0x36a6c8]['on'](_0x04fe('0x41'),function(){logger[_0x04fe('0x2c')](_0x04fe('0x42'),_0x36a6c8);stopRouting(_0x36a6c8,_0x56afad,_0x4ec471,_0x19d745);clearTimeout(_0x52d405);_0x52d405=undefined;_0x2014a3[_0x04fe('0x43')](!![]);if(_0x19d745[_0x04fe('0x44')][_0x36a6c8]){delete _0x19d745[_0x04fe('0x44')][_0x36a6c8];}_0x10e092[_0x04fe('0x3d')]();});_0x19d745[_0x04fe('0x44')][_0x36a6c8]['on'](_0x04fe('0x45'),function(){if(_0x19d745[_0x04fe('0x44')][_0x36a6c8]){delete _0x19d745['rules'][_0x36a6c8];}});_0x52d405=setTimeout(function(){logger['info'](_0x04fe('0x46'),_0x36a6c8);endRouting(_0x36a6c8,_0x56afad,_0x4ec471,_0x19d745);clearTimeout(_0x52d405);_0x2014a3[_0x04fe('0x43')](!![]);_0x10e092['next']();},_0x504a17);switch(_0x56afad[_0x04fe('0x47')]){case _0x04fe('0x48'):strategy[_0x04fe('0x48')](_0x2014a3,_0x56afad,_0x19d745,_0x4ec471);break;default:strategy[_0x04fe('0x49')](_0x2014a3,_0x56afad,_0x19d745,_0x4ec471);}}else{logger[_0x04fe('0x31')](_0x04fe('0x4a'),_0x36a6c8,_0xfa8929['name']);_0x10e092[_0x04fe('0x3d')]();}}}catch(_0xec7c22){console[_0x04fe('0x4b')](_0xec7c22);logger[_0x04fe('0x31')](_0x04fe('0x3a'),_0x36a6c8,_0xec7c22[_0x04fe('0x4c')]);_0x10e092[_0x04fe('0x3d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index fd553f0..6d62884 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 _0x9ab3=['agent','push','bind','handleTimeout','drained','handleDrained','prototype','handleRun','isNil','realtime','agents','info','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x3eab0b,_0x291b6d){var _0x59e91d=function(_0x10439b){while(--_0x10439b){_0x3eab0b['push'](_0x3eab0b['shift']());}};_0x59e91d(++_0x291b6d);}(_0x9ab3,0xcd));var _0x39ab=function(_0x4de131,_0x4ea93d){_0x4de131=_0x4de131-0x0;var _0x39481b=_0x9ab3[_0x4de131];return _0x39481b;};'use strict';var _=require('lodash');var uuid=require(_0x39ab('0x0'));var util=require('./util');var logger=require(_0x39ab('0x1'))(_0x39ab('0x2'));var Agent=function(_0x2164a2,_0xc9a3e3,_0x3b0872,_0x5d87a9){this[_0x39ab('0x3')]=uuid['v4']();this[_0x39ab('0x4')]=_0x2164a2;this[_0x39ab('0x5')]=_0xc9a3e3;this['realtime']=_0x3b0872;this['routing']=_0x5d87a9;this['squeue'][_0x39ab('0x6')](this['handleRun'][_0x39ab('0x7')](this),this['handleTimeout'][_0x39ab('0x7')](this));this['squeue']['on']('timeout',this[_0x39ab('0x8')]['bind'](this));this[_0x39ab('0x4')]['on'](_0x39ab('0x9'),this[_0x39ab('0xa')]['bind'](this));};Agent[_0x39ab('0xb')][_0x39ab('0x6')]=function(){this[_0x39ab('0x4')][_0x39ab('0x6')](this[_0x39ab('0xc')][_0x39ab('0x7')](this),this['handleTimeout'][_0x39ab('0x7')](this));};Agent[_0x39ab('0xb')][_0x39ab('0xa')]=function(){this[_0x39ab('0x8')](!![]);};Agent[_0x39ab('0xb')]['handleRun']=function(_0x3a3b7f){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);if(_[_0x39ab('0xd')](this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']])){logger[_0x39ab('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);setTimeout(this[_0x39ab('0x6')][_0x39ab('0x7')](this),0x3e8);}else{if(this[_0x39ab('0x2')][_0x39ab('0x11')]||util[_0x39ab('0x12')](this[_0x39ab('0x4')]['id'],this[_0x39ab('0xe')][_0x39ab('0xf')][this['agent']['id']],this['squeue']['channel'],![])){this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']][_0x39ab('0x13')]=!![];this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']][_0x39ab('0x14')]=undefined;util[_0x39ab('0x15')](this[_0x39ab('0x3')],this['squeue']['id'],this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']],null,this[_0x39ab('0x2')]);util[_0x39ab('0x16')](this[_0x39ab('0x4')]['id'],this['realtime'][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']],_0x39ab('0x17')+(this[_0x39ab('0x2')]['forcedOwnership']?_0x39ab('0x18'):''));}else{logger[_0x39ab('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);setTimeout(this[_0x39ab('0x6')][_0x39ab('0x7')](this),0x3e8);}}};Agent[_0x39ab('0xb')][_0x39ab('0x8')]=function(_0x19f430){if(_[_0x39ab('0xd')](this['realtime']['agents'][this[_0x39ab('0x5')]['id']])){return logger['info'](_0x39ab('0x19'),this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);}else{logger[_0x39ab('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x39ab('0x4')]['id'],this[_0x39ab('0x5')]['id']);util[_0x39ab('0x1a')](this[_0x39ab('0x3')],this['squeue']['id'],this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']],null,this[_0x39ab('0x2')]);this['realtime']['agents'][this[_0x39ab('0x5')]['id']]['busy']=![];this['realtime']['agents'][this['agent']['id']][_0x39ab('0x14')]=undefined;util[_0x39ab('0x16')](this[_0x39ab('0x4')]['id'],this[_0x39ab('0xe')][_0x39ab('0xf')][this[_0x39ab('0x5')]['id']],_0x19f430?_0x39ab('0x1b'):_0x39ab('0x1c'));}if(!_0x19f430){setTimeout(this['push'][_0x39ab('0x7')](this),0x3e8);}};function agent(_0x3a0d80,_0x484dfb,_0x2ef7df,_0x5523ad){return new Agent(_0x3a0d80,_0x484dfb,_0x2ef7df,_0x5523ad);}module[_0x39ab('0x1d')]=agent; \ No newline at end of file +var _0x156a=['exports','lodash','./util','../../../../../config/logger','routing','squeue','agent','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','notificationId','writeLog','STOP','TIMEOUT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x156a,0x101));var _0xa156=function(_0x17b355,_0x202bb0){_0x17b355=_0x17b355-0x0;var _0x3a10fd=_0x156a[_0x17b355];return _0x3a10fd;};'use strict';var _=require(_0xa156('0x0'));var uuid=require('uuid');var util=require(_0xa156('0x1'));var logger=require(_0xa156('0x2'))(_0xa156('0x3'));var Agent=function(_0x5d2f8c,_0x1dcaae,_0x17df7f,_0x1b6e41){this['notificationId']=uuid['v4']();this[_0xa156('0x4')]=_0x5d2f8c;this[_0xa156('0x5')]=_0x1dcaae;this['realtime']=_0x17df7f;this[_0xa156('0x3')]=_0x1b6e41;this[_0xa156('0x4')][_0xa156('0x6')](this[_0xa156('0x7')]['bind'](this),this['handleTimeout']['bind'](this));this[_0xa156('0x4')]['on']('timeout',this[_0xa156('0x8')][_0xa156('0x9')](this));this[_0xa156('0x4')]['on'](_0xa156('0xa'),this[_0xa156('0xb')]['bind'](this));};Agent[_0xa156('0xc')]['push']=function(){this[_0xa156('0x4')]['push'](this[_0xa156('0x7')][_0xa156('0x9')](this),this[_0xa156('0x8')][_0xa156('0x9')](this));};Agent[_0xa156('0xc')][_0xa156('0xb')]=function(){this[_0xa156('0x8')](!![]);};Agent[_0xa156('0xc')]['handleRun']=function(_0x3d60ae){logger[_0xa156('0xd')](_0xa156('0xe'),this[_0xa156('0x4')]['id'],this[_0xa156('0x5')]['id']);if(_[_0xa156('0xf')](this[_0xa156('0x10')][_0xa156('0x11')][this[_0xa156('0x5')]['id']])){logger['info'](_0xa156('0x12'),this[_0xa156('0x4')]['id'],this[_0xa156('0x5')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0xa156('0x13')]||util[_0xa156('0x14')](this[_0xa156('0x4')]['id'],this['realtime'][_0xa156('0x11')][this[_0xa156('0x5')]['id']],this[_0xa156('0x4')][_0xa156('0x15')],![])){this[_0xa156('0x10')][_0xa156('0x11')][this[_0xa156('0x5')]['id']][_0xa156('0x16')]=!![];this['realtime'][_0xa156('0x11')][this[_0xa156('0x5')]['id']][_0xa156('0x17')]=undefined;util[_0xa156('0x18')](this['notificationId'],this[_0xa156('0x4')]['id'],this[_0xa156('0x10')]['agents'][this[_0xa156('0x5')]['id']],null,this[_0xa156('0x3')]);util['writeLog'](this[_0xa156('0x4')]['id'],this['realtime'][_0xa156('0x11')][this[_0xa156('0x5')]['id']],'RINGING'+(this[_0xa156('0x3')][_0xa156('0x13')]?':FORCED':''));}else{logger[_0xa156('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xa156('0x4')]['id'],this[_0xa156('0x5')]['id']);setTimeout(this['push'][_0xa156('0x9')](this),0x3e8);}}};Agent[_0xa156('0xc')][_0xa156('0x8')]=function(_0x3afde5){if(_[_0xa156('0xf')](this[_0xa156('0x10')][_0xa156('0x11')][this[_0xa156('0x5')]['id']])){return logger[_0xa156('0xd')](_0xa156('0x12'),this[_0xa156('0x4')]['id'],this[_0xa156('0x5')]['id']);}else{logger[_0xa156('0xd')](_0xa156('0x19'),this['squeue']['id'],this[_0xa156('0x5')]['id']);util[_0xa156('0x1a')](this[_0xa156('0x1b')],this[_0xa156('0x4')]['id'],this[_0xa156('0x10')][_0xa156('0x11')][this['agent']['id']],null,this[_0xa156('0x3')]);this[_0xa156('0x10')][_0xa156('0x11')][this['agent']['id']][_0xa156('0x16')]=![];this[_0xa156('0x10')][_0xa156('0x11')][this[_0xa156('0x5')]['id']][_0xa156('0x17')]=undefined;util[_0xa156('0x1c')](this[_0xa156('0x4')]['id'],this[_0xa156('0x10')][_0xa156('0x11')][this['agent']['id']],_0x3afde5?_0xa156('0x1d'):_0xa156('0x1e'));}if(!_0x3afde5){setTimeout(this[_0xa156('0x6')][_0xa156('0x9')](this),0x3e8);}};function agent(_0x3e1b82,_0x2704b7,_0x2551ac,_0x34e45b){return new Agent(_0x3e1b82,_0x2704b7,_0x2551ac,_0x34e45b);}module[_0xa156('0x1f')]=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 ba2a91b..20c970a 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 _0x34aa=['[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','length','Agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','writeLog','busy','busyQueue','showNotification'];(function(_0x17598a,_0x522cc6){var _0x4cd046=function(_0x496f1a){while(--_0x496f1a){_0x17598a['push'](_0x17598a['shift']());}};_0x4cd046(++_0x522cc6);}(_0x34aa,0x171));var _0xa34a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x34aa[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xa34a('0x0'));var uuid=require('uuid');var util=require(_0xa34a('0x1'));var logger=require(_0xa34a('0x2'))(_0xa34a('0x3'));var Beepall=function(_0x1fc924,_0x496e55,_0x1d7a4f,_0x30f3a2){this[_0xa34a('0x4')]=uuid['v4']();this[_0xa34a('0x5')]=_0x1fc924;this[_0xa34a('0x6')]=_0x496e55;this[_0xa34a('0x7')]=_0x1d7a4f;this[_0xa34a('0x3')]=_0x30f3a2;this[_0xa34a('0x5')][_0xa34a('0x8')](this[_0xa34a('0x9')][_0xa34a('0xa')](this),this['handleTimeout'][_0xa34a('0xa')](this));this[_0xa34a('0x5')]['on'](_0xa34a('0xb'),this[_0xa34a('0xc')][_0xa34a('0xa')](this));this['squeue']['on'](_0xa34a('0xd'),this[_0xa34a('0xe')][_0xa34a('0xa')](this));};Beepall[_0xa34a('0xf')][_0xa34a('0x8')]=function(){this[_0xa34a('0x5')][_0xa34a('0x8')](this['handleRun'][_0xa34a('0xa')](this),this[_0xa34a('0xc')][_0xa34a('0xa')](this));};Beepall['prototype'][_0xa34a('0xe')]=function(_0x441a7f){this['handleTimeout'](!![]);};Beepall[_0xa34a('0xf')][_0xa34a('0x9')]=function(_0x5af32c){var _0x312734=!![];if(!_[_0xa34a('0x10')](this[_0xa34a('0x6')])&&!_[_0xa34a('0x10')](this[_0xa34a('0x6')]['Agents'])&&this[_0xa34a('0x6')]['Agents'][_0xa34a('0x11')]>0x0){for(var _0x14837d=0x0,_0x3a05ca;_0x14837d0x0){for(var _0x3f91cb=0x0,_0x4b205e;_0x3f91cb0x0&&_0x44861b[_0x29221b+_0xe627('0x26')]>=_0x44861b[_0x29221b+_0xe627('0x25')]){writeLog(_0x4873e6,_0x44861b,_0x29221b[_0xe627('0x27')]()+_0xe627('0x28'));return![];}}return!![];};exports[_0xe627('0x29')]=function(_0x44c9f7,_0x3e9eda,_0x58c728,_0x5ad327,_0x5aeba1){return sendNotification(!![],_0x44c9f7,_0x3e9eda,_0x58c728,_0x5ad327,_0x5aeba1);};exports['hideNotification']=function(_0x1e0bd7,_0xdf63c8,_0x5799a3,_0x39c23f,_0x54029d){return sendNotification(![],_0x1e0bd7,_0xdf63c8,_0x5799a3,_0x39c23f,_0x54029d);};exports[_0xe627('0x2a')]=writeLog; \ No newline at end of file +var _0x3d04=['\x20interaction','account','notificationSound','body','queue','msg','notificationTemplate','error','[%s][QUEUE]\x20%s','message','name','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','emit','format','user:save'];(function(_0x36ee10,_0x3e4e4b){var _0x1ae7e8=function(_0x138916){while(--_0x138916){_0x36ee10['push'](_0x36ee10['shift']());}};_0x1ae7e8(++_0x3e4e4b);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var utils=require(_0x43d0('0x2'));var Mustache=require(_0x43d0('0x3'));var Redis=require(_0x43d0('0x4'));var config=require(_0x43d0('0x5'));var logger=require(_0x43d0('0x6'))(_0x43d0('0x7'));config['redis']=_[_0x43d0('0x8')](config[_0x43d0('0x9')],{'host':_0x43d0('0xa'),'port':0x18eb});var io=require(_0x43d0('0xb'))(new Redis(config['redis']));function emit(_0x484271,_0x50919e,_0x5efb95){io['to'](_0x484271)[_0x43d0('0xc')](_0x50919e,_0x5efb95);}function sendNotification(_0x3344d3,_0x331421,_0x46e560,_0x44a763,_0x4d75d9,_0x54e570){io['to'](util[_0x43d0('0xd')]('user:%s',_0x44a763['name']))[_0x43d0('0xc')](_0x43d0('0xe'),_0x44a763);var _0x2d7768=_0x54e570||{};var _0x375174=_0x46e560['split']('.');var _0x45e9b2={'uniqueid':_0x331421,'channel':_0x375174[0x0],'id':_0x375174[0x1],'title':_0x375174[0x0]+_0x43d0('0xf'),'interactionId':_0x375174[0x2],'queue':_0x4d75d9?_0x4d75d9['name']:null,'sound':_0x2d7768[_0x43d0('0x10')][_0x43d0('0x11')],'shake':_0x2d7768[_0x43d0('0x10')]['notificationShake']};try{if(!_0x2d7768[_0x43d0('0x12')]){_0x2d7768[_0x43d0('0x12')]={};}if(_0x4d75d9){_0x2d7768[_0x43d0('0x12')]['queue']=_0x4d75d9;}else if(_0x2d7768[_0x43d0('0x12')][_0x43d0('0x13')]){delete _0x2d7768[_0x43d0('0x12')][_0x43d0('0x13')];}_0x45e9b2[_0x43d0('0x14')]=utils['getMustacheRender'](_0x2d7768['account'][_0x43d0('0x15')],_0x2d7768);}catch(_0x3356f1){_0x45e9b2[_0x43d0('0x14')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x43d0('0x16')](util['format'](_0x43d0('0x17'),_0x331421,_0x3356f1[_0x43d0('0x18')]));}io['to'](util[_0x43d0('0xd')]('user:%s',_0x44a763[_0x43d0('0x19')]))[_0x43d0('0xc')](util['format'](_0x43d0('0x1a'),_0x3344d3?_0x43d0('0x1b'):_0x43d0('0x1c')),_0x45e9b2);}function writeLog(_0x248622,_0x3009a7,_0x28381b){return logger[_0x43d0('0x1d')](util[_0x43d0('0xd')](_0x43d0('0x1e'),_0x248622,_0x3009a7[_0x43d0('0x19')],_0x28381b));}exports[_0x43d0('0x1f')]=function(_0x19d2ff,_0x326be8,_0xbc72e6,_0x2efd77){if(_0x326be8['busy']){writeLog(_0x19d2ff,_0x326be8,_0x43d0('0x20'));return![];}if(!_0x326be8[_0x43d0('0x21')]){writeLog(_0x19d2ff,_0x326be8,'OFFLINE');return![];}if(_0x326be8[_0xbc72e6+_0x43d0('0x22')]){writeLog(_0x19d2ff,_0x326be8,'PAUSE');return![];}if(_0x2efd77&&_0x326be8[_0x43d0('0x23')](_0xbc72e6+_0x43d0('0x24'))&&_0x326be8['hasOwnProperty'](_0xbc72e6+_0x43d0('0x25'))){if(_0x326be8[_0xbc72e6+_0x43d0('0x24')]>0x0&&_0x326be8[_0xbc72e6+'CurrentCapacity']>=_0x326be8[_0xbc72e6+_0x43d0('0x24')]){writeLog(_0x19d2ff,_0x326be8,_0xbc72e6[_0x43d0('0x26')]()+_0x43d0('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x447725,_0x38e89e,_0x2c4f3f,_0x1eb771,_0x37d78f){return sendNotification(!![],_0x447725,_0x38e89e,_0x2c4f3f,_0x1eb771,_0x37d78f);};exports[_0x43d0('0x28')]=function(_0x31a057,_0x4a3cd4,_0x2b0784,_0x2f5bc5,_0x6bc471){return sendNotification(![],_0x31a057,_0x4a3cd4,_0x2b0784,_0x2f5bc5,_0x6bc471);};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 58fc393..87b4add 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 _0xbaf4=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','shelljs','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','message','join','info'];(function(_0x49bef5,_0x5da5e6){var _0x4a6d37=function(_0x45dcb0){while(--_0x45dcb0){_0x49bef5['push'](_0x49bef5['shift']());}};_0x4a6d37(++_0x5da5e6);}(_0xbaf4,0xc4));var _0x4baf=function(_0x22fabc,_0x2fd77b){_0x22fabc=_0x22fabc-0x0;var _0x40d1e6=_0xbaf4[_0x22fabc];return _0x40d1e6;};'use strict';var schema=require('validate');var sh=require(_0x4baf('0x0'));var _=require('lodash');var utils=require(_0x4baf('0x1'));var logger=require(_0x4baf('0x2'))(_0x4baf('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x4baf('0x4')}});exports[_0x4baf('0x5')]=function(_0x1548a7,_0x191d5a){return function(_0xa3d4d4){try{var _0x138a3f={'command':_0x191d5a[0x0]};var _0x6a9f22=system[_0x4baf('0x6')](_0x138a3f,{'typecast':!![]});if(_0x6a9f22[_0x4baf('0x7')]){logger[_0x4baf('0x8')]('[%s][SYSTEM]\x20%s',_0x1548a7,_['map'](_0x6a9f22,_0x4baf('0x9'))[_0x4baf('0xa')](',\x20'));logger[_0x4baf('0xb')](_0x4baf('0xc'),_0x1548a7);_0xa3d4d4[_0x4baf('0xd')]();}else{var _0x21c28a=this;var _0x57d68f=utils[_0x4baf('0xe')](_0x191d5a[0x0],this);logger[_0x4baf('0xb')](_0x4baf('0xf'),_0x1548a7,_0x57d68f);sh[_0x4baf('0x10')](_['trim'](_0x57d68f),function(_0x20d120,_0x86b8eb){logger[_0x4baf('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x1548a7,_0x20d120);if(_0x20d120==0x0){var _0x2ed962=_0x86b8eb[_0x4baf('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x4baf('0x12')](_0x191d5a[0x1])||_[_0x4baf('0x13')](_0x191d5a[0x1])){logger[_0x4baf('0xb')](_0x4baf('0x14'),_0x1548a7);_0x21c28a[_0x4baf('0x15')][_0x191d5a[0x1]]=_0x2ed962;}else{logger[_0x4baf('0xb')](_0x4baf('0x16'),_0x1548a7,_0x191d5a[0x1],_0x2ed962);_0x21c28a[_0x4baf('0x15')][_0x191d5a[0x1]]=_0x2ed962;}}_0xa3d4d4[_0x4baf('0xd')]();});}}catch(_0x303fac){logger['error'](_0x4baf('0x17'),_0x1548a7,_[_0x4baf('0x18')](_0x303fac)?JSON[_0x4baf('0x19')](_0x303fac):_0x303fac);logger[_0x4baf('0xb')](_0x4baf('0xc'),_0x1548a7);_0xa3d4d4['next']();}};}; \ No newline at end of file +var _0xae4a=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0xae4a,0x68));var _0xaae4=function(_0x30cfc8,_0x516a25){_0x30cfc8=_0x30cfc8-0x0;var _0x70db06=_0xae4a[_0x30cfc8];return _0x70db06;};'use strict';var schema=require(_0xaae4('0x0'));var sh=require(_0xaae4('0x1'));var _=require('lodash');var utils=require(_0xaae4('0x2'));var logger=require(_0xaae4('0x3'))('routing');var system=schema({'command':{'type':_0xaae4('0x4'),'required':!![],'message':_0xaae4('0x5')}});exports[_0xaae4('0x6')]=function(_0x35e085,_0x209dde){return function(_0x420448){try{var _0x36d48e={'command':_0x209dde[0x0]};var _0x454d54=system[_0xaae4('0x0')](_0x36d48e,{'typecast':!![]});if(_0x454d54[_0xaae4('0x7')]){logger[_0xaae4('0x8')](_0xaae4('0x9'),_0x35e085,_[_0xaae4('0xa')](_0x454d54,'message')['join'](',\x20'));logger[_0xaae4('0xb')](_0xaae4('0xc'),_0x35e085);_0x420448[_0xaae4('0xd')]();}else{var _0x19bfd0=this;var _0xfe4e78=utils[_0xaae4('0xe')](_0x209dde[0x0],this);logger[_0xaae4('0xb')](_0xaae4('0xf'),_0x35e085,_0xfe4e78);sh[_0xaae4('0x10')](_[_0xaae4('0x11')](_0xfe4e78),function(_0x31f724,_0x1c0e59){logger[_0xaae4('0xb')](_0xaae4('0x12'),_0x35e085,_0x31f724);if(_0x31f724==0x0){var _0x3d831c=_0x1c0e59[_0xaae4('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xaae4('0x14')](_0x209dde[0x1])||_[_0xaae4('0x15')](_0x209dde[0x1])){logger['info'](_0xaae4('0x16'),_0x35e085);_0x19bfd0[_0xaae4('0x17')][_0x209dde[0x1]]=_0x3d831c;}else{logger[_0xaae4('0xb')](_0xaae4('0x18'),_0x35e085,_0x209dde[0x1],_0x3d831c);_0x19bfd0[_0xaae4('0x17')][_0x209dde[0x1]]=_0x3d831c;}}_0x420448['next']();});}}catch(_0xe8c9e0){logger['error'](_0xaae4('0x9'),_0x35e085,_[_0xaae4('0x19')](_0xe8c9e0)?JSON[_0xaae4('0x1a')](_0xe8c9e0):_0xe8c9e0);logger[_0xaae4('0xb')](_0xaae4('0xc'),_0x35e085);_0x420448[_0xaae4('0xd')]();}};}; \ 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 e1035c9..0e7e1f9 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 _0x45b8=['stringify','finally','next','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error'];(function(_0x21ac5c,_0x2eee06){var _0x4d85ff=function(_0x3f11eb){while(--_0x3f11eb){_0x21ac5c['push'](_0x21ac5c['shift']());}};_0x4d85ff(++_0x2eee06);}(_0x45b8,0xf7));var _0x845b=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x45b8[_0x45d3f0];return _0x314b79;};'use strict';var schema=require('validate');var _=require(_0x845b('0x0'));var rpc={'chatInteraction':require(_0x845b('0x1')),'openchannelInteraction':require(_0x845b('0x2')),'smsInteraction':require(_0x845b('0x3')),'mailInteraction':require(_0x845b('0x4')),'faxInteraction':require(_0x845b('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x845b('0x6'))(_0x845b('0x7'));var tag=schema({'tag':{'type':_0x845b('0x8'),'required':!![],'message':_0x845b('0x9')}});exports[_0x845b('0xa')]=function(_0x11ca99,_0x2f856a,_0x45c8b8,_0x4f5ba7){return function(_0x341584){try{var _0x2c3b66={'tag':_0x2f856a[0x0]};var _0x12d900=tag[_0x845b('0xb')](_0x2c3b66,{'typecast':!![]});if(_0x12d900[_0x845b('0xc')]){logger['error'](_0x845b('0xd'),_0x11ca99,_[_0x845b('0xe')](_0x12d900,'message')[_0x845b('0xf')](',\x20'));logger[_0x845b('0x10')](_0x845b('0x11'),_0x11ca99);_0x341584['next']();}else{var _0x3a8c8c={'ids':[_0x2f856a[0x0]]};if(rpc[_0x4f5ba7[_0x845b('0x12')]+_0x845b('0x13')]){rpc[_0x4f5ba7[_0x845b('0x12')]+'Interaction']['addTags'](_0x4f5ba7['interaction']['id'],_0x3a8c8c)['then'](function(_0xb402a1){logger[_0x845b('0x10')](_0x845b('0x14'),_0x11ca99,_0x2f856a[0x1],_0x4f5ba7[_0x845b('0x12')],_0x4f5ba7['interaction']['id']);})[_0x845b('0x15')](function(_0x1d19b4){logger[_0x845b('0x16')](_0x845b('0xd'),_0x11ca99,JSON[_0x845b('0x17')](_0x1d19b4));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x11ca99);})[_0x845b('0x18')](function(){_0x341584[_0x845b('0x19')]();});}}}catch(_0x1e9e7a){logger[_0x845b('0x16')]('[%s][TAG]\x20%s',_0x11ca99,_[_0x845b('0x1a')](_0x1e9e7a)?JSON['stringify'](_0x1e9e7a):_0x1e9e7a);logger[_0x845b('0x10')](_0x845b('0x11'),_0x11ca99);_0x341584['next']();}};}; \ No newline at end of file +var _0x8748=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','[%s][TAG]\x20%s','stringify','finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../../../config/logger','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','info'];(function(_0x309963,_0x5cd3a2){var _0x2c4f1b=function(_0x13c061){while(--_0x13c061){_0x309963['push'](_0x309963['shift']());}};_0x2c4f1b(++_0x5cd3a2);}(_0x8748,0x146));var _0x8874=function(_0x456220,_0x1fc5cf){_0x456220=_0x456220-0x0;var _0x39acda=_0x8748[_0x456220];return _0x39acda;};'use strict';var schema=require(_0x8874('0x0'));var _=require(_0x8874('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x8874('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x8874('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x8874('0x4'))('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':_0x8874('0x5')}});exports['consequence']=function(_0x5da16a,_0x47624a,_0x5886bf,_0x18fead){return function(_0x387be6){try{var _0x52763b={'tag':_0x47624a[0x0]};var _0x63854a=tag[_0x8874('0x0')](_0x52763b,{'typecast':!![]});if(_0x63854a[_0x8874('0x6')]){logger[_0x8874('0x7')]('[%s][TAG]\x20%s',_0x5da16a,_[_0x8874('0x8')](_0x63854a,'message')['join'](',\x20'));logger[_0x8874('0x9')](_0x8874('0xa'),_0x5da16a);_0x387be6[_0x8874('0xb')]();}else{var _0x36dd00={'ids':[_0x47624a[0x0]]};if(rpc[_0x18fead[_0x8874('0xc')]+_0x8874('0xd')]){rpc[_0x18fead[_0x8874('0xc')]+_0x8874('0xd')][_0x8874('0xe')](_0x18fead[_0x8874('0xf')]['id'],_0x36dd00)['then'](function(_0x87e8c7){logger[_0x8874('0x9')](_0x8874('0x10'),_0x5da16a,_0x47624a[0x1],_0x18fead[_0x8874('0xc')],_0x18fead[_0x8874('0xf')]['id']);})['catch'](function(_0x32f4f2){logger[_0x8874('0x7')](_0x8874('0x11'),_0x5da16a,JSON[_0x8874('0x12')](_0x32f4f2));logger[_0x8874('0x9')](_0x8874('0xa'),_0x5da16a);})[_0x8874('0x13')](function(){_0x387be6[_0x8874('0xb')]();});}}}catch(_0x29802f){logger[_0x8874('0x7')](_0x8874('0x11'),_0x5da16a,_[_0x8874('0x14')](_0x29802f)?JSON[_0x8874('0x12')](_0x29802f):_0x29802f);logger[_0x8874('0x9')](_0x8874('0xa'),_0x5da16a);_0x387be6['next']();}};}; \ 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 d1764da..7013895 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x3f4f49,_0xb0e03f){var _0x254263=function(_0x22a23b){while(--_0x22a23b){_0x3f4f49['push'](_0x3f4f49['shift']());}};_0x254263(++_0xb0e03f);}(_0xe706,0xa3));var _0x6e70=function(_0x1d20e5,_0x3d4f74){_0x1d20e5=_0x1d20e5-0x0;var _0x14c8d3=_0xe706[_0x1d20e5];return _0x14c8d3;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0xe905c4,_0x26a4e3){var _0x88fb02=function(_0x409333){while(--_0x409333){_0xe905c4['push'](_0xe905c4['shift']());}};_0x88fb02(++_0x26a4e3);}(_0xe706,0xa3));var _0x6e70=function(_0x2ce6c4,_0x1493e0){_0x2ce6c4=_0x2ce6c4-0x0;var _0x3fa5ef=_0xe706[_0x2ce6c4];return _0x3fa5ef;};'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 b373836..728f049 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 _0xa644=['intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','rules','message','interaction','isArray','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','split','channel','mail','push','slice','dialogflow','appdata','dialogflowv2','tag','format','%s:%s:%s','./interval','condition'];(function(_0x388493,_0x23301e){var _0x5300a1=function(_0x1d9c91){while(--_0x1d9c91){_0x388493['push'](_0x388493['shift']());}};_0x5300a1(++_0x23301e);}(_0xa644,0x1a8));var _0x4a64=function(_0x551de1,_0xf8a93){_0x551de1=_0x551de1-0x0;var _0x243a3d=_0xa644[_0x551de1];return _0x243a3d;};'use strict';var _=require(_0x4a64('0x0'));var util=require(_0x4a64('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x4a64('0x2'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x4a64('0x3'));var logger=require('../../../config/logger')(_0x4a64('0x4'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4a64('0x5')),'chatQueueReport':require(_0x4a64('0x6')),'smsQueueReport':require(_0x4a64('0x7')),'faxQueueReport':require(_0x4a64('0x8')),'whatsappQueueReport':require(_0x4a64('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2e85df,_0x1c3b6d,_0x151276){return util['format'](_0x4a64('0xa'),_0x2e85df,_0x1c3b6d||0x0,_0x151276||0x0);}function getIntervals(_0x368cad,_0x2ae34f){var _0x47d042=[];if(!_[_0x4a64('0xb')](_0x2ae34f[_0x4a64('0xc')])&&!_[_0x4a64('0xb')](_0x368cad[_0x2ae34f[_0x4a64('0xc')]])&&!_[_0x4a64('0xb')](_0x368cad[_0x2ae34f['IntervalId']]['Intervals'])){_0x47d042=_[_0x4a64('0xd')](_0x368cad[_0x2ae34f[_0x4a64('0xc')]][_0x4a64('0xe')],_0x4a64('0xf'));}else if(!_[_0x4a64('0xb')](_0x2ae34f[_0x4a64('0xf')])){_0x47d042=[_0x2ae34f[_0x4a64('0xf')]];}return _0x47d042;}exports['listen']=function(_0x1eba0e){_0x1eba0e[_0x4a64('0x10')]={};return new BPromise(function(_0x35e322,_0x4a62d6){var _0x50c8a3={'Start':function(_0xabf3fb){var _0x332188=this;return new Promise(function(_0xd8edc7,_0x301e37){if(_0xabf3fb){try{var _0x1c0a13=[];var _0x27cc83=getId(_0xabf3fb['channel'],_0xabf3fb[_0x4a64('0x11')]?_0xabf3fb[_0x4a64('0x11')]['id']:0x0,_0xabf3fb['interaction']?_0xabf3fb[_0x4a64('0x12')]['id']:0x0);if(_0xabf3fb['applications']&&_[_0x4a64('0x13')](_0xabf3fb[_0x4a64('0x14')])&&_0xabf3fb[_0x4a64('0x14')][_0x4a64('0x15')]){for(var _0x35da23=0x0;_0x35da23<_0xabf3fb['applications'][_0x4a64('0x15')];_0x35da23+=0x1){var _0x234383=_0xabf3fb[_0x4a64('0x14')][_0x35da23];if(fs[_0x4a64('0x16')](path[_0x4a64('0x17')](__dirname,'applications',_0x234383['app']+_0x4a64('0x18')))){var _0x478b0b=[];switch(_0x234383[_0x4a64('0x19')][_0x4a64('0x1a')]()){case _0x4a64('0x1b'):var _0x53590d=_0x234383['appdata'][_0x4a64('0x1c')](',');if(_0xabf3fb[_0x4a64('0x1d')]===_0x4a64('0x1e')){_0x478b0b[_0x4a64('0x1f')](_0x53590d[0x0]);_0x478b0b['push'](_0x53590d[0x1]);_0x478b0b[_0x4a64('0x1f')](_0x53590d['slice'](0x2,_0x53590d[_0x4a64('0x15')])[_0x4a64('0x17')](','));}else{_0x478b0b[_0x4a64('0x1f')](_0x53590d[0x0]);_0x478b0b[_0x4a64('0x1f')](_0x53590d[_0x4a64('0x20')](0x1,_0x53590d['length'])[_0x4a64('0x17')](','));}break;case _0x4a64('0x21'):var _0x3a36ea=_0x234383[_0x4a64('0x22')][_0x4a64('0x1c')](',');_0x478b0b[_0x4a64('0x1f')](_0x3a36ea[0x0]);_0x478b0b[_0x4a64('0x1f')](_0x3a36ea[0x1]);_0x478b0b[_0x4a64('0x1f')](_0x3a36ea[_0x4a64('0x20')](0x2,_0x3a36ea[_0x4a64('0x15')])[_0x4a64('0x17')](','));break;case _0x4a64('0x23'):var _0x1e3d30=_0x234383[_0x4a64('0x22')][_0x4a64('0x1c')](',');_0x478b0b['push'](_0x1e3d30[0x0]);_0x478b0b[_0x4a64('0x1f')](_0x1e3d30[0x1]);_0x478b0b[_0x4a64('0x1f')](_0x1e3d30[0x2]);_0x478b0b['push'](_0x1e3d30[0x3]);_0x478b0b[_0x4a64('0x1f')](_0x1e3d30[_0x4a64('0x20')](0x4,_0x1e3d30['length'])[_0x4a64('0x17')](','));break;case'amazonlex':var _0x33a68b=_0x234383[_0x4a64('0x22')][_0x4a64('0x1c')](',');_0x478b0b['push'](_0x33a68b[0x0]);_0x478b0b[_0x4a64('0x1f')](_0x33a68b[0x1]);_0x478b0b[_0x4a64('0x1f')](_0x33a68b[0x2]);_0x478b0b[_0x4a64('0x1f')](_0x33a68b[0x3]);_0x478b0b[_0x4a64('0x1f')](_0x33a68b['slice'](0x4,_0x33a68b[_0x4a64('0x15')])[_0x4a64('0x17')](','));break;case _0x4a64('0x11'):_0x478b0b[_0x4a64('0x1f')](_0x234383['appdata']);break;case _0x4a64('0x24'):_0x478b0b['push'](_0x234383['TagId']);_0x478b0b[_0x4a64('0x1f')](_0x234383[_0x4a64('0x22')]);break;default:_0x478b0b=_[_0x4a64('0xb')](_0x234383[_0x4a64('0x22')])?[]:_0x234383[_0x4a64('0x22')][_0x4a64('0x1c')](',');}var _0xac7591={'id':util[_0x4a64('0x25')](_0x4a64('0x26'),_0x27cc83,_0x234383['id'],_0x234383[_0x4a64('0x19')]),'condition':require(_0x4a64('0x27'))[_0x4a64('0x28')](_0x27cc83,getIntervals(_0x1eba0e[_0x4a64('0x29')],_0x234383),_0x1eba0e),'consequence':require(_0x4a64('0x2a')+_0x234383['app'])[_0x4a64('0x2b')](_0x27cc83,_0x478b0b,_0x1eba0e,_0xabf3fb),'p':_0x234383[_0x4a64('0x2c')]||0x0};logger[_0x4a64('0x2d')](_0x4a64('0x2e'),_0xac7591['id'],_0x4a64('0x2f'),getIntervals(_0x1eba0e[_0x4a64('0x29')],_0x234383)[_0x4a64('0x17')](_0x4a64('0x30')));_0x1c0a13[_0x4a64('0x1f')](_0xac7591);}else{logger[_0x4a64('0x31')](_0x4a64('0x32'),path[_0x4a64('0x17')](__dirname,_0x4a64('0x14'),_0x234383[_0x4a64('0x19')]+_0x4a64('0x18')));}}_0x1eba0e[_0x4a64('0x10')][_0x27cc83]=new RuleEngine(_0x1c0a13);_0x1eba0e[_0x4a64('0x10')][_0x27cc83]['execute'](_0xabf3fb,function(_0x489880){logger[_0x4a64('0x2d')]('Applications\x20executed',JSON[_0x4a64('0x33')](_0x489880[_0x4a64('0x34')]));if(_0x1eba0e[_0x4a64('0x10')][_0x27cc83]){_0x1eba0e[_0x4a64('0x10')][_0x27cc83]['emit'](_0x4a64('0x35'));}});return _0xd8edc7({'code':0xc8,'message':_0xabf3fb});}else{logger[_0x4a64('0x2d')](_0x4a64('0x36'));return _0xd8edc7({'code':0xc8,'message':_0xabf3fb});}}catch(_0x49867b){logger['error'](_0x49867b[_0x4a64('0x37')]);return _0x301e37(_0x332188[_0x4a64('0x31')](0x1f4,_0x49867b));}}return _0x301e37(_0x4a64('0x38'));});},'AcceptMessage':function(_0x70d811){var _0x8afa40=this;return new Promise(function(_0x1db1d7,_0x390ccc){if(_0x70d811[_0x4a64('0x39')]&&_0x70d811[_0x4a64('0x39')]['id']){if(_0x1eba0e['agents'][_0x70d811[_0x4a64('0x39')]['id']]){_0x1eba0e[_0x4a64('0x3a')][_0x70d811[_0x4a64('0x39')]['id']][_0x4a64('0x3b')]=![];_0x1eba0e[_0x4a64('0x3a')][_0x70d811[_0x4a64('0x39')]['id']][_0x4a64('0x3c')]=undefined;}}if(_0x70d811[_0x4a64('0x11')]&&_0x70d811[_0x4a64('0x11')]['id']){try{var _0x41bf34=getId(_0x70d811[_0x4a64('0x1d')],_0x70d811[_0x4a64('0x11')]?_0x70d811[_0x4a64('0x11')]['id']:0x0,_0x70d811[_0x4a64('0x12')]?_0x70d811[_0x4a64('0x12')]['id']:0x0);if(_0x1eba0e[_0x4a64('0x10')][_0x41bf34]){_0x1eba0e[_0x4a64('0x10')][_0x41bf34][_0x4a64('0x3d')](_0x4a64('0x3e'));if(rpc[_0x70d811[_0x4a64('0x1d')]+_0x4a64('0x3f')]){rpc[_0x70d811[_0x4a64('0x1d')]+_0x4a64('0x3f')]['update'](_0x41bf34,{'UserId':_0x70d811[_0x4a64('0x11')][_0x4a64('0x40')]})[_0x4a64('0x41')](function(_0x2b2dde){logger['error'](_0x4a64('0x42'));});}}return _0x1db1d7({'code':0xc8,'message':_0x70d811});}catch(_0x48a603){logger['error'](_0x48a603[_0x4a64('0x37')]);return _0x390ccc(_0x8afa40['error'](0x1f4,_0x48a603));}}logger['error']('message\x20is\x20empty');return _0x390ccc(_0x8afa40[_0x4a64('0x31')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x32cbf5){var _0x310d66=this;return new Promise(function(_0x330dbe,_0x25793f){if(_0x32cbf5[_0x4a64('0x39')]&&_0x32cbf5[_0x4a64('0x39')]['id']){try{if(_0x1eba0e[_0x4a64('0x3a')][_0x32cbf5[_0x4a64('0x39')]['id']]){_0x1eba0e[_0x4a64('0x3a')][_0x32cbf5[_0x4a64('0x39')]['id']][_0x4a64('0x3b')]=![];_0x1eba0e[_0x4a64('0x3a')][_0x32cbf5[_0x4a64('0x39')]['id']][_0x4a64('0x3c')]=undefined;}return _0x330dbe({'code':0xc8,'message':_0x32cbf5});}catch(_0x384482){logger[_0x4a64('0x31')](_0x384482['stack']);return _0x25793f(_0x310d66[_0x4a64('0x31')](0x1f4,_0x384482));}}logger[_0x4a64('0x31')]('message\x20is\x20empty');return _0x25793f(_0x310d66['error'](0x1f4,_0x4a64('0x43')));});},'AbandonInteraction':function(_0xe1dee6){var _0x562ea8=this;return new Promise(function(_0x5b00b9,_0x29577c){if(_0xe1dee6[_0x4a64('0x1d')]&&_0xe1dee6[_0x4a64('0x12')]&&_0xe1dee6[_0x4a64('0x12')]['id']){try{var _0xedce54=getId(_0xe1dee6[_0x4a64('0x1d')],_0xe1dee6[_0x4a64('0x11')]?_0xe1dee6['message']['id']:0x0,_0xe1dee6[_0x4a64('0x12')]?_0xe1dee6[_0x4a64('0x12')]['id']:0x0);if(_0x1eba0e['rules'][_0xedce54]){_0x1eba0e[_0x4a64('0x10')][_0xedce54][_0x4a64('0x3d')](_0x4a64('0x3e'));}return _0x5b00b9({'code':0xc8,'message':_0xe1dee6});}catch(_0x21a772){logger[_0x4a64('0x31')](_0x21a772['stack']);return _0x29577c(_0x562ea8[_0x4a64('0x31')](0x1f4,_0x21a772));}}logger['error'](_0x4a64('0x43'));return _0x29577c(_0x562ea8[_0x4a64('0x31')](0x1f4,_0x4a64('0x43')));});},'AgentCapacity':function(_0x2829c3){var _0x82aca4=this;return new Promise(function(_0xc35b80,_0x5757a2){if(_0x1eba0e[_0x4a64('0x3a')][_0x4a64('0x44')](_0x2829c3['id'])){for(var _0x4531b5 in _0x2829c3[_0x4a64('0x45')]){if(_0x2829c3[_0x4a64('0x45')][_0x4a64('0x44')](_0x4531b5)){if(_0x1eba0e[_0x4a64('0x3a')][_0x2829c3['id']]['hasOwnProperty'](_0x4531b5+_0x4a64('0x46'))){_0x1eba0e['agents'][_0x2829c3['id']][_0x4531b5+_0x4a64('0x46')]=parseInt(_0x2829c3[_0x4a64('0x45')][_0x4531b5],0xa);}}}_0x1eba0e['agents'][_0x2829c3['id']]['updateRealtime']();return _0xc35b80({'code':0xc8,'message':_0x1eba0e[_0x4a64('0x3a')][_0x2829c3['id']]});}else{return _0x5757a2(_0x82aca4[_0x4a64('0x31')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x385f85){return new Promise(function(_0x30ca03,_0x2d8e32){var _0x43638a=_[_0x4a64('0x47')](_0x1eba0e[_0x4a64('0x3a')]);_0x30ca03({'count':_0x43638a[_0x4a64('0x15')],'rows':_0x43638a});});},'ChatQueues':function(_0x1e5b6d){return new Promise(function(_0x57be89,_0x1a9bed){var _0x4c9a77=[];for(var _0x3e1342 in _0x1eba0e[_0x4a64('0x48')]){if(_0x1eba0e[_0x4a64('0x48')][_0x4a64('0x44')](_0x3e1342)){var _0x590686=_0x1eba0e[_0x4a64('0x48')][_0x3e1342];var _0xf1bb99={'id':_0x590686['id'],'available':_0x590686[_0x4a64('0x49')],'loggedIn':_0x590686[_0x4a64('0x4a')],'name':_0x590686[_0x4a64('0x4b')],'paused':_0x590686[_0x4a64('0x4c')],'waiting':_0x590686[_0x4a64('0x4d')]};_0x4c9a77[_0x4a64('0x1f')](_0xf1bb99);}}_0x57be89({'count':_0x4c9a77[_0x4a64('0x15')],'rows':_0x4c9a77});});},'MailQueues':function(_0x18bd17){return new Promise(function(_0x352405,_0x4c3bef){var _0x5acc39=[];for(var _0x348df5 in _0x1eba0e['mailQueues']){if(_0x1eba0e['mailQueues'][_0x4a64('0x44')](_0x348df5)){var _0x4e9a9d=_0x1eba0e[_0x4a64('0x4e')][_0x348df5];var _0x4f53d1={'id':_0x4e9a9d['id'],'available':_0x4e9a9d['available'],'loggedIn':_0x4e9a9d['loggedIn'],'name':_0x4e9a9d[_0x4a64('0x4b')],'paused':_0x4e9a9d[_0x4a64('0x4c')],'waiting':_0x4e9a9d[_0x4a64('0x4d')]};_0x5acc39[_0x4a64('0x1f')](_0x4f53d1);}}_0x352405({'count':_0x5acc39[_0x4a64('0x15')],'rows':_0x5acc39});});},'OpenchannelQueues':function(_0x4de990){return new Promise(function(_0xd63a27,_0x20b298){var _0x17a775=[];for(var _0x177090 in _0x1eba0e[_0x4a64('0x4f')]){if(_0x1eba0e[_0x4a64('0x4f')]['hasOwnProperty'](_0x177090)){var _0x27a058=_0x1eba0e['openchannelQueues'][_0x177090];var _0x275209={'id':_0x27a058['id'],'available':_0x27a058[_0x4a64('0x49')],'loggedIn':_0x27a058['loggedIn'],'name':_0x27a058[_0x4a64('0x4b')],'paused':_0x27a058[_0x4a64('0x4c')],'waiting':_0x27a058[_0x4a64('0x4d')]};_0x17a775[_0x4a64('0x1f')](_0x275209);}}_0xd63a27({'count':_0x17a775['length'],'rows':_0x17a775});});},'SmsQueues':function(_0x25092e){return new Promise(function(_0x1d3b93,_0x721040){var _0x1d539f=[];for(var _0x4e9187 in _0x1eba0e[_0x4a64('0x50')]){if(_0x1eba0e[_0x4a64('0x50')]['hasOwnProperty'](_0x4e9187)){var _0x32e1e2=_0x1eba0e['smsQueues'][_0x4e9187];var _0x352b3a={'id':_0x32e1e2['id'],'available':_0x32e1e2[_0x4a64('0x49')],'loggedIn':_0x32e1e2[_0x4a64('0x4a')],'name':_0x32e1e2[_0x4a64('0x4b')],'paused':_0x32e1e2[_0x4a64('0x4c')],'waiting':_0x32e1e2['waiting']};_0x1d539f['push'](_0x352b3a);}}_0x1d3b93({'count':_0x1d539f[_0x4a64('0x15')],'rows':_0x1d539f});});},'FaxQueues':function(_0x55ae9f){return new Promise(function(_0x1179f0,_0x4a9c73){var _0x2ae2b3=[];for(var _0x168214 in _0x1eba0e[_0x4a64('0x51')]){if(_0x1eba0e[_0x4a64('0x51')][_0x4a64('0x44')](_0x168214)){var _0x10356b=_0x1eba0e['faxQueues'][_0x168214];var _0x36ff0d={'id':_0x10356b['id'],'available':_0x10356b[_0x4a64('0x49')],'loggedIn':_0x10356b['loggedIn'],'name':_0x10356b[_0x4a64('0x4b')],'paused':_0x10356b[_0x4a64('0x4c')],'waiting':_0x10356b[_0x4a64('0x4d')]};_0x2ae2b3[_0x4a64('0x1f')](_0x36ff0d);}}_0x1179f0({'count':_0x2ae2b3['length'],'rows':_0x2ae2b3});});},'WhatsappQueues':function(_0x1736ab){return new Promise(function(_0x31ae59,_0x4f0fb2){var _0x7b3e8=[];for(var _0x17e193 in _0x1eba0e[_0x4a64('0x52')]){if(_0x1eba0e['whatsappQueues'][_0x4a64('0x44')](_0x17e193)){var _0x34545f=_0x1eba0e['whatsappQueues'][_0x17e193];var _0x230ef4={'id':_0x34545f['id'],'available':_0x34545f[_0x4a64('0x49')],'loggedIn':_0x34545f[_0x4a64('0x4a')],'name':_0x34545f[_0x4a64('0x4b')],'paused':_0x34545f[_0x4a64('0x4c')],'waiting':_0x34545f[_0x4a64('0x4d')]};_0x7b3e8[_0x4a64('0x1f')](_0x230ef4);}}_0x31ae59({'count':_0x7b3e8['length'],'rows':_0x7b3e8});});},'ChatQueuesWaitingInteractions':function(_0x4bd175){return new Promise(function(_0x135f06,_0x3775bb){var _0x25b9fa=_[_0x4a64('0x47')](_0x1eba0e[_0x4a64('0x53')]);_0x135f06({'count':_0x25b9fa['length'],'rows':_0x25b9fa});});},'MailQueuesWaitingInteractions':function(_0x5660b7){return new Promise(function(_0x48eb31,_0x55845a){var _0x366139=_['values'](_0x1eba0e[_0x4a64('0x54')]);_0x48eb31({'count':_0x366139[_0x4a64('0x15')],'rows':_0x366139});});},'OpenchannelQueuesWaitingInteractions':function(_0x306204){return new Promise(function(_0x5c2412,_0x417d30){var _0x519c5b=_[_0x4a64('0x47')](_0x1eba0e[_0x4a64('0x55')]);_0x5c2412({'count':_0x519c5b[_0x4a64('0x15')],'rows':_0x519c5b});});},'SmsQueuesWaitingInteractions':function(_0x409aa2){return new Promise(function(_0x48dd75,_0x45bb76){var _0x50dcac=_[_0x4a64('0x47')](_0x1eba0e[_0x4a64('0x56')]);_0x48dd75({'count':_0x50dcac['length'],'rows':_0x50dcac});});},'FaxQueuesWaitingInteractions':function(_0x550c5d){return new Promise(function(_0x40008b,_0x4d13ec){var _0x3aa0cf=_[_0x4a64('0x47')](_0x1eba0e['faxQueuesWaitingInteractions']);_0x40008b({'count':_0x3aa0cf[_0x4a64('0x15')],'rows':_0x3aa0cf});});},'WhatsappQueuesWaitingInteractions':function(_0x42fa5b){return new Promise(function(_0x775e71,_0x1525dd){var _0x3fe973=_['values'](_0x1eba0e[_0x4a64('0x57')]);_0x775e71({'count':_0x3fe973[_0x4a64('0x15')],'rows':_0x3fe973});});}};var _0x113b61=jayson[_0x4a64('0x58')](_0x50c8a3)['http']();_0x113b61['on'](_0x4a64('0x31'),function(_0x2d64e4){logger[_0x4a64('0x31')](JSON['stringify'](_0x2d64e4));return _0x4a62d6(_0x2d64e4);});_0x113b61[_0x4a64('0x59')](0x232c,_0x4a64('0x5a'),function(){console[_0x4a64('0x5b')](_0x4a64('0x5c'),0x232c);return _0x35e322('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x8dde=['openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','split','mail','push','dialogflow','appdata','slice','dialogflowv2','tag','TagId','%s:%s:%s','intervals','./applications/','consequence','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting'];(function(_0x2253b7,_0x247da3){var _0x359089=function(_0x1128b3){while(--_0x1128b3){_0x2253b7['push'](_0x2253b7['shift']());}};_0x359089(++_0x247da3);}(_0x8dde,0xce));var _0xe8dd=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x8dde[_0x128bef];return _0x1ba862;};'use strict';var _=require(_0xe8dd('0x0'));var util=require(_0xe8dd('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xe8dd('0x2'));var BPromise=require(_0xe8dd('0x3'));var uuid=require(_0xe8dd('0x4'));var config=require('../../../config/environment');var logger=require(_0xe8dd('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0xe8dd('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xe8dd('0x7')),'smsQueueReport':require(_0xe8dd('0x8')),'faxQueueReport':require(_0xe8dd('0x9')),'whatsappQueueReport':require(_0xe8dd('0xa'))};var RuleEngine=require(_0xe8dd('0xb'));function getId(_0x2c9d1e,_0x2d7298,_0x35ed46){return util[_0xe8dd('0xc')](_0xe8dd('0xd'),_0x2c9d1e,_0x2d7298||0x0,_0x35ed46||0x0);}function getIntervals(_0xabdd72,_0x2e18ba){var _0x24a282=[];if(!_['isNil'](_0x2e18ba['IntervalId'])&&!_[_0xe8dd('0xe')](_0xabdd72[_0x2e18ba[_0xe8dd('0xf')]])&&!_['isNil'](_0xabdd72[_0x2e18ba[_0xe8dd('0xf')]][_0xe8dd('0x10')])){_0x24a282=_[_0xe8dd('0x11')](_0xabdd72[_0x2e18ba[_0xe8dd('0xf')]][_0xe8dd('0x10')],'interval');}else if(!_[_0xe8dd('0xe')](_0x2e18ba[_0xe8dd('0x12')])){_0x24a282=[_0x2e18ba[_0xe8dd('0x12')]];}return _0x24a282;}exports['listen']=function(_0x27e6ab){_0x27e6ab[_0xe8dd('0x13')]={};return new BPromise(function(_0x403664,_0x2aac1e){var _0x597453={'Start':function(_0x250347){var _0x1ebed5=this;return new Promise(function(_0xd956f,_0x131d5a){if(_0x250347){try{var _0x2ad872=[];var _0x2465a3=getId(_0x250347[_0xe8dd('0x14')],_0x250347['message']?_0x250347[_0xe8dd('0x15')]['id']:0x0,_0x250347[_0xe8dd('0x16')]?_0x250347[_0xe8dd('0x16')]['id']:0x0);if(_0x250347[_0xe8dd('0x17')]&&_['isArray'](_0x250347[_0xe8dd('0x17')])&&_0x250347[_0xe8dd('0x17')][_0xe8dd('0x18')]){for(var _0x812a7b=0x0;_0x812a7b<_0x250347[_0xe8dd('0x17')][_0xe8dd('0x18')];_0x812a7b+=0x1){var _0x438841=_0x250347[_0xe8dd('0x17')][_0x812a7b];if(fs[_0xe8dd('0x19')](path[_0xe8dd('0x1a')](__dirname,_0xe8dd('0x17'),_0x438841[_0xe8dd('0x1b')]+_0xe8dd('0x1c')))){var _0x4504f1=[];switch(_0x438841['app'][_0xe8dd('0x1d')]()){case _0xe8dd('0x1e'):var _0x5d9e45=_0x438841['appdata'][_0xe8dd('0x1f')](',');if(_0x250347[_0xe8dd('0x14')]===_0xe8dd('0x20')){_0x4504f1[_0xe8dd('0x21')](_0x5d9e45[0x0]);_0x4504f1[_0xe8dd('0x21')](_0x5d9e45[0x1]);_0x4504f1[_0xe8dd('0x21')](_0x5d9e45['slice'](0x2,_0x5d9e45[_0xe8dd('0x18')])[_0xe8dd('0x1a')](','));}else{_0x4504f1[_0xe8dd('0x21')](_0x5d9e45[0x0]);_0x4504f1['push'](_0x5d9e45['slice'](0x1,_0x5d9e45[_0xe8dd('0x18')])['join'](','));}break;case _0xe8dd('0x22'):var _0xd022b7=_0x438841[_0xe8dd('0x23')][_0xe8dd('0x1f')](',');_0x4504f1[_0xe8dd('0x21')](_0xd022b7[0x0]);_0x4504f1[_0xe8dd('0x21')](_0xd022b7[0x1]);_0x4504f1[_0xe8dd('0x21')](_0xd022b7[_0xe8dd('0x24')](0x2,_0xd022b7[_0xe8dd('0x18')])[_0xe8dd('0x1a')](','));break;case _0xe8dd('0x25'):var _0x4dc957=_0x438841[_0xe8dd('0x23')][_0xe8dd('0x1f')](',');_0x4504f1['push'](_0x4dc957[0x0]);_0x4504f1[_0xe8dd('0x21')](_0x4dc957[0x1]);_0x4504f1[_0xe8dd('0x21')](_0x4dc957[0x2]);_0x4504f1[_0xe8dd('0x21')](_0x4dc957[0x3]);_0x4504f1[_0xe8dd('0x21')](_0x4dc957[_0xe8dd('0x24')](0x4,_0x4dc957[_0xe8dd('0x18')])[_0xe8dd('0x1a')](','));break;case'amazonlex':var _0x3d37fa=_0x438841['appdata'][_0xe8dd('0x1f')](',');_0x4504f1['push'](_0x3d37fa[0x0]);_0x4504f1[_0xe8dd('0x21')](_0x3d37fa[0x1]);_0x4504f1[_0xe8dd('0x21')](_0x3d37fa[0x2]);_0x4504f1[_0xe8dd('0x21')](_0x3d37fa[0x3]);_0x4504f1['push'](_0x3d37fa[_0xe8dd('0x24')](0x4,_0x3d37fa[_0xe8dd('0x18')])[_0xe8dd('0x1a')](','));break;case _0xe8dd('0x15'):_0x4504f1[_0xe8dd('0x21')](_0x438841[_0xe8dd('0x23')]);break;case _0xe8dd('0x26'):_0x4504f1['push'](_0x438841[_0xe8dd('0x27')]);_0x4504f1['push'](_0x438841[_0xe8dd('0x23')]);break;default:_0x4504f1=_[_0xe8dd('0xe')](_0x438841[_0xe8dd('0x23')])?[]:_0x438841['appdata'][_0xe8dd('0x1f')](',');}var _0x5ac828={'id':util[_0xe8dd('0xc')](_0xe8dd('0x28'),_0x2465a3,_0x438841['id'],_0x438841[_0xe8dd('0x1b')]),'condition':require('./interval')['condition'](_0x2465a3,getIntervals(_0x27e6ab[_0xe8dd('0x29')],_0x438841),_0x27e6ab),'consequence':require(_0xe8dd('0x2a')+_0x438841[_0xe8dd('0x1b')])[_0xe8dd('0x2b')](_0x2465a3,_0x4504f1,_0x27e6ab,_0x250347),'p':_0x438841['priority']||0x0};logger['info']('Push\x20new\x20rule',_0x5ac828['id'],_0xe8dd('0x2c'),getIntervals(_0x27e6ab[_0xe8dd('0x29')],_0x438841)[_0xe8dd('0x1a')](_0xe8dd('0x2d')));_0x2ad872[_0xe8dd('0x21')](_0x5ac828);}else{logger[_0xe8dd('0x2e')](_0xe8dd('0x2f'),path[_0xe8dd('0x1a')](__dirname,'applications',_0x438841[_0xe8dd('0x1b')]+_0xe8dd('0x1c')));}}_0x27e6ab[_0xe8dd('0x13')][_0x2465a3]=new RuleEngine(_0x2ad872);_0x27e6ab[_0xe8dd('0x13')][_0x2465a3]['execute'](_0x250347,function(_0x25e47a){logger[_0xe8dd('0x30')](_0xe8dd('0x31'),JSON[_0xe8dd('0x32')](_0x25e47a[_0xe8dd('0x33')]));if(_0x27e6ab[_0xe8dd('0x13')][_0x2465a3]){_0x27e6ab[_0xe8dd('0x13')][_0x2465a3][_0xe8dd('0x34')](_0xe8dd('0x35'));}});return _0xd956f({'code':0xc8,'message':_0x250347});}else{logger[_0xe8dd('0x30')](_0xe8dd('0x36'));return _0xd956f({'code':0xc8,'message':_0x250347});}}catch(_0x1509f1){logger[_0xe8dd('0x2e')](_0x1509f1[_0xe8dd('0x37')]);return _0x131d5a(_0x1ebed5[_0xe8dd('0x2e')](0x1f4,_0x1509f1));}}return _0x131d5a('routing\x20is\x20empty');});},'AcceptMessage':function(_0x198fb5){var _0x43ec76=this;return new Promise(function(_0x84aea8,_0x500a0c){if(_0x198fb5[_0xe8dd('0x38')]&&_0x198fb5[_0xe8dd('0x38')]['id']){if(_0x27e6ab[_0xe8dd('0x39')][_0x198fb5[_0xe8dd('0x38')]['id']]){_0x27e6ab[_0xe8dd('0x39')][_0x198fb5[_0xe8dd('0x38')]['id']][_0xe8dd('0x3a')]=![];_0x27e6ab[_0xe8dd('0x39')][_0x198fb5[_0xe8dd('0x38')]['id']][_0xe8dd('0x3b')]=undefined;}}if(_0x198fb5['message']&&_0x198fb5['message']['id']){try{var _0x47efc2=getId(_0x198fb5[_0xe8dd('0x14')],_0x198fb5[_0xe8dd('0x15')]?_0x198fb5['message']['id']:0x0,_0x198fb5[_0xe8dd('0x16')]?_0x198fb5[_0xe8dd('0x16')]['id']:0x0);if(_0x27e6ab[_0xe8dd('0x13')][_0x47efc2]){_0x27e6ab[_0xe8dd('0x13')][_0x47efc2][_0xe8dd('0x34')](_0xe8dd('0x3c'));if(rpc[_0x198fb5[_0xe8dd('0x14')]+_0xe8dd('0x3d')]){rpc[_0x198fb5[_0xe8dd('0x14')]+_0xe8dd('0x3d')][_0xe8dd('0x3e')](_0x47efc2,{'UserId':_0x198fb5[_0xe8dd('0x15')][_0xe8dd('0x3f')]})['catch'](function(_0x88bb7f){logger[_0xe8dd('0x2e')](_0xe8dd('0x40'));});}}return _0x84aea8({'code':0xc8,'message':_0x198fb5});}catch(_0x7f24f1){logger['error'](_0x7f24f1['stack']);return _0x500a0c(_0x43ec76[_0xe8dd('0x2e')](0x1f4,_0x7f24f1));}}logger[_0xe8dd('0x2e')](_0xe8dd('0x41'));return _0x500a0c(_0x43ec76[_0xe8dd('0x2e')](0x1f4,_0xe8dd('0x41')));});},'RejectMessage':function(_0x604de1){var _0x1da47c=this;return new Promise(function(_0x4ac1e4,_0x4919f5){if(_0x604de1[_0xe8dd('0x38')]&&_0x604de1['agent']['id']){try{if(_0x27e6ab[_0xe8dd('0x39')][_0x604de1[_0xe8dd('0x38')]['id']]){_0x27e6ab['agents'][_0x604de1[_0xe8dd('0x38')]['id']][_0xe8dd('0x3a')]=![];_0x27e6ab['agents'][_0x604de1[_0xe8dd('0x38')]['id']][_0xe8dd('0x3b')]=undefined;}return _0x4ac1e4({'code':0xc8,'message':_0x604de1});}catch(_0x3f26de){logger[_0xe8dd('0x2e')](_0x3f26de[_0xe8dd('0x37')]);return _0x4919f5(_0x1da47c['error'](0x1f4,_0x3f26de));}}logger[_0xe8dd('0x2e')]('message\x20is\x20empty');return _0x4919f5(_0x1da47c['error'](0x1f4,_0xe8dd('0x41')));});},'AbandonInteraction':function(_0x5a80c3){var _0x1507a2=this;return new Promise(function(_0x51819f,_0x52bda4){if(_0x5a80c3[_0xe8dd('0x14')]&&_0x5a80c3['interaction']&&_0x5a80c3['interaction']['id']){try{var _0x2a8808=getId(_0x5a80c3['channel'],_0x5a80c3['message']?_0x5a80c3[_0xe8dd('0x15')]['id']:0x0,_0x5a80c3[_0xe8dd('0x16')]?_0x5a80c3[_0xe8dd('0x16')]['id']:0x0);if(_0x27e6ab['rules'][_0x2a8808]){_0x27e6ab[_0xe8dd('0x13')][_0x2a8808][_0xe8dd('0x34')]('end');}return _0x51819f({'code':0xc8,'message':_0x5a80c3});}catch(_0x4b5f9b){logger['error'](_0x4b5f9b[_0xe8dd('0x37')]);return _0x52bda4(_0x1507a2[_0xe8dd('0x2e')](0x1f4,_0x4b5f9b));}}logger[_0xe8dd('0x2e')]('message\x20is\x20empty');return _0x52bda4(_0x1507a2[_0xe8dd('0x2e')](0x1f4,_0xe8dd('0x41')));});},'AgentCapacity':function(_0x2ec861){var _0x2fb795=this;return new Promise(function(_0x52c668,_0x17279b){if(_0x27e6ab[_0xe8dd('0x39')]['hasOwnProperty'](_0x2ec861['id'])){for(var _0x5744c2 in _0x2ec861[_0xe8dd('0x42')]){if(_0x2ec861['capacity'][_0xe8dd('0x43')](_0x5744c2)){if(_0x27e6ab[_0xe8dd('0x39')][_0x2ec861['id']][_0xe8dd('0x43')](_0x5744c2+'CurrentCapacity')){_0x27e6ab[_0xe8dd('0x39')][_0x2ec861['id']][_0x5744c2+_0xe8dd('0x44')]=parseInt(_0x2ec861[_0xe8dd('0x42')][_0x5744c2],0xa);}}}_0x27e6ab[_0xe8dd('0x39')][_0x2ec861['id']][_0xe8dd('0x45')]();return _0x52c668({'code':0xc8,'message':_0x27e6ab[_0xe8dd('0x39')][_0x2ec861['id']]});}else{return _0x17279b(_0x2fb795[_0xe8dd('0x2e')](0x1f4,_0xe8dd('0x46')));}});},'Agents':function(_0x8efbf5){return new Promise(function(_0x2a851c,_0x4a0cd7){var _0x1a22a5=_[_0xe8dd('0x47')](_0x27e6ab[_0xe8dd('0x39')]);_0x2a851c({'count':_0x1a22a5['length'],'rows':_0x1a22a5});});},'ChatQueues':function(_0x2f1316){return new Promise(function(_0x3c9bbb,_0x550203){var _0xd320d9=[];for(var _0x1b1be8 in _0x27e6ab[_0xe8dd('0x48')]){if(_0x27e6ab[_0xe8dd('0x48')][_0xe8dd('0x43')](_0x1b1be8)){var _0x12856f=_0x27e6ab[_0xe8dd('0x48')][_0x1b1be8];var _0x5e8ba2={'id':_0x12856f['id'],'available':_0x12856f[_0xe8dd('0x49')],'loggedIn':_0x12856f[_0xe8dd('0x4a')],'name':_0x12856f[_0xe8dd('0x4b')],'paused':_0x12856f[_0xe8dd('0x4c')],'waiting':_0x12856f['waiting']};_0xd320d9['push'](_0x5e8ba2);}}_0x3c9bbb({'count':_0xd320d9[_0xe8dd('0x18')],'rows':_0xd320d9});});},'MailQueues':function(_0x2e8bd1){return new Promise(function(_0x292c95,_0x49e2a8){var _0xe61bbe=[];for(var _0x5df33f in _0x27e6ab['mailQueues']){if(_0x27e6ab[_0xe8dd('0x4d')]['hasOwnProperty'](_0x5df33f)){var _0x192f2f=_0x27e6ab['mailQueues'][_0x5df33f];var _0x17b1c1={'id':_0x192f2f['id'],'available':_0x192f2f[_0xe8dd('0x49')],'loggedIn':_0x192f2f[_0xe8dd('0x4a')],'name':_0x192f2f[_0xe8dd('0x4b')],'paused':_0x192f2f[_0xe8dd('0x4c')],'waiting':_0x192f2f[_0xe8dd('0x4e')]};_0xe61bbe[_0xe8dd('0x21')](_0x17b1c1);}}_0x292c95({'count':_0xe61bbe[_0xe8dd('0x18')],'rows':_0xe61bbe});});},'OpenchannelQueues':function(_0x515acb){return new Promise(function(_0x7ddc54,_0x3c5402){var _0xda627d=[];for(var _0x5ba69f in _0x27e6ab[_0xe8dd('0x4f')]){if(_0x27e6ab[_0xe8dd('0x4f')]['hasOwnProperty'](_0x5ba69f)){var _0x3d9d77=_0x27e6ab[_0xe8dd('0x4f')][_0x5ba69f];var _0x45094c={'id':_0x3d9d77['id'],'available':_0x3d9d77[_0xe8dd('0x49')],'loggedIn':_0x3d9d77[_0xe8dd('0x4a')],'name':_0x3d9d77['name'],'paused':_0x3d9d77[_0xe8dd('0x4c')],'waiting':_0x3d9d77[_0xe8dd('0x4e')]};_0xda627d[_0xe8dd('0x21')](_0x45094c);}}_0x7ddc54({'count':_0xda627d[_0xe8dd('0x18')],'rows':_0xda627d});});},'SmsQueues':function(_0x4e6008){return new Promise(function(_0x33e938,_0x3425e3){var _0x2e865b=[];for(var _0x5426fc in _0x27e6ab[_0xe8dd('0x50')]){if(_0x27e6ab[_0xe8dd('0x50')][_0xe8dd('0x43')](_0x5426fc)){var _0x39b594=_0x27e6ab[_0xe8dd('0x50')][_0x5426fc];var _0x43ec74={'id':_0x39b594['id'],'available':_0x39b594[_0xe8dd('0x49')],'loggedIn':_0x39b594[_0xe8dd('0x4a')],'name':_0x39b594[_0xe8dd('0x4b')],'paused':_0x39b594[_0xe8dd('0x4c')],'waiting':_0x39b594['waiting']};_0x2e865b[_0xe8dd('0x21')](_0x43ec74);}}_0x33e938({'count':_0x2e865b[_0xe8dd('0x18')],'rows':_0x2e865b});});},'FaxQueues':function(_0x5d92d8){return new Promise(function(_0x4d5621,_0x700f53){var _0x49d383=[];for(var _0x2fc52b in _0x27e6ab['faxQueues']){if(_0x27e6ab[_0xe8dd('0x51')][_0xe8dd('0x43')](_0x2fc52b)){var _0x5a8566=_0x27e6ab[_0xe8dd('0x51')][_0x2fc52b];var _0x1b6068={'id':_0x5a8566['id'],'available':_0x5a8566[_0xe8dd('0x49')],'loggedIn':_0x5a8566['loggedIn'],'name':_0x5a8566[_0xe8dd('0x4b')],'paused':_0x5a8566[_0xe8dd('0x4c')],'waiting':_0x5a8566[_0xe8dd('0x4e')]};_0x49d383[_0xe8dd('0x21')](_0x1b6068);}}_0x4d5621({'count':_0x49d383[_0xe8dd('0x18')],'rows':_0x49d383});});},'WhatsappQueues':function(_0x31dceb){return new Promise(function(_0x589694,_0x5335c8){var _0x23bde6=[];for(var _0x71c6da in _0x27e6ab[_0xe8dd('0x52')]){if(_0x27e6ab[_0xe8dd('0x52')]['hasOwnProperty'](_0x71c6da)){var _0x42b041=_0x27e6ab[_0xe8dd('0x52')][_0x71c6da];var _0x11fd95={'id':_0x42b041['id'],'available':_0x42b041['available'],'loggedIn':_0x42b041[_0xe8dd('0x4a')],'name':_0x42b041[_0xe8dd('0x4b')],'paused':_0x42b041[_0xe8dd('0x4c')],'waiting':_0x42b041[_0xe8dd('0x4e')]};_0x23bde6[_0xe8dd('0x21')](_0x11fd95);}}_0x589694({'count':_0x23bde6[_0xe8dd('0x18')],'rows':_0x23bde6});});},'ChatQueuesWaitingInteractions':function(_0x3a6487){return new Promise(function(_0xa66429,_0x2d5517){var _0x3dc831=_[_0xe8dd('0x47')](_0x27e6ab[_0xe8dd('0x53')]);_0xa66429({'count':_0x3dc831[_0xe8dd('0x18')],'rows':_0x3dc831});});},'MailQueuesWaitingInteractions':function(_0x5e1e70){return new Promise(function(_0x5100ff,_0xa84157){var _0x389581=_[_0xe8dd('0x47')](_0x27e6ab[_0xe8dd('0x54')]);_0x5100ff({'count':_0x389581[_0xe8dd('0x18')],'rows':_0x389581});});},'OpenchannelQueuesWaitingInteractions':function(_0x456b02){return new Promise(function(_0x1be521,_0x1fc393){var _0x56fdae=_['values'](_0x27e6ab[_0xe8dd('0x55')]);_0x1be521({'count':_0x56fdae[_0xe8dd('0x18')],'rows':_0x56fdae});});},'SmsQueuesWaitingInteractions':function(_0x53ad0e){return new Promise(function(_0x58e728,_0x100fa2){var _0xf131b8=_[_0xe8dd('0x47')](_0x27e6ab[_0xe8dd('0x56')]);_0x58e728({'count':_0xf131b8[_0xe8dd('0x18')],'rows':_0xf131b8});});},'FaxQueuesWaitingInteractions':function(_0xaeac){return new Promise(function(_0x46fe0a,_0x488d31){var _0x76f1ab=_[_0xe8dd('0x47')](_0x27e6ab[_0xe8dd('0x57')]);_0x46fe0a({'count':_0x76f1ab[_0xe8dd('0x18')],'rows':_0x76f1ab});});},'WhatsappQueuesWaitingInteractions':function(_0xca2263){return new Promise(function(_0x49814c,_0x456841){var _0x2bdde4=_[_0xe8dd('0x47')](_0x27e6ab[_0xe8dd('0x58')]);_0x49814c({'count':_0x2bdde4[_0xe8dd('0x18')],'rows':_0x2bdde4});});}};var _0x32f82b=jayson['server'](_0x597453)[_0xe8dd('0x59')]();_0x32f82b['on'](_0xe8dd('0x2e'),function(_0x3d9152){logger[_0xe8dd('0x2e')](JSON[_0xe8dd('0x32')](_0x3d9152));return _0x2aac1e(_0x3d9152);});_0x32f82b[_0xe8dd('0x5a')](0x232c,_0xe8dd('0x5b'),function(){console[_0xe8dd('0x5c')](_0xe8dd('0x5d'),0x232c);return _0x403664(_0xe8dd('0x5e')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index bef0b48..351301a 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 _0x82ff=['format','indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','catch','stack','util','bluebird','lodash','routing','http','request','then','error','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command'];(function(_0x2d1991,_0x34eaeb){var _0x104578=function(_0x38ba6b){while(--_0x38ba6b){_0x2d1991['push'](_0x2d1991['shift']());}};_0x104578(++_0x34eaeb);}(_0x82ff,0x11c));var _0xf82f=function(_0xa66512,_0x865052){_0xa66512=_0xa66512-0x0;var _0x4e5b18=_0x82ff[_0xa66512];return _0x4e5b18;};'use strict';var util=require(_0xf82f('0x0'));var BPromise=require(_0xf82f('0x1'));var jayson=require('jayson/promise');var _=require(_0xf82f('0x2'));var logger=require('../../../config/logger')(_0xf82f('0x3'));var client=jayson['client'][_0xf82f('0x4')]({'port':0x232a});function request(_0x34106a,_0x5c4684){return new BPromise(function(_0x5f5609,_0x82e821){return client[_0xf82f('0x5')](_0x34106a,_0x5c4684)[_0xf82f('0x6')](function(_0x4e81ae){if(_0x4e81ae[_0xf82f('0x7')]){return _0x82e821(_0x4e81ae[_0xf82f('0x7')][_0xf82f('0x8')]);}else{return _0x5f5609(_0x4e81ae['result']);}})['catch'](function(_0x44a856){return _0x82e821(_0x44a856);});});}exports[_0xf82f('0x9')]=function(_0x23574f,_0x21dd93,_0x56526e){return function(_0x240b99){if(_0x56526e[_0xf82f('0xa')]&&!_0x56526e['rules'][_0x23574f]){logger[_0xf82f('0xb')](_0xf82f('0xc'),_0x23574f);return _0x240b99[_0xf82f('0xd')]();}var _0x5cacb0=[];for(var _0x34123d=0x0;_0x34123d<_0x21dd93['length'];_0x34123d+=0x1){_0x5cacb0[_0xf82f('0xe')](request(_0xf82f('0xf'),{'command':util[_0xf82f('0x10')]('iftime\x20%s',_0x21dd93[_0x34123d])})['then'](function(_0x524247){return _0x524247&&_0x524247[_0xf82f('0x8')]&&_0x524247['message'][_0xf82f('0x11')](_0xf82f('0x12'))>=0x0?!![]:![];})['catch'](function(_0x234ba8){logger['error'](_0xf82f('0x13'),_0x23574f,_0x21dd93[_0x34123d]);}));}BPromise['all'](_0x5cacb0)[_0xf82f('0x6')](function(_0x7e7461){var _0x15f816=_[_0xf82f('0x14')](_0x7e7461);logger[_0xf82f('0xb')](_0xf82f('0x15'),_0x23574f,_0x21dd93['join'](_0xf82f('0x16')),_0x15f816);_0x240b99['when'](_0x15f816);})[_0xf82f('0x17')](function(_0x426fb2){console['log'](_0x426fb2);logger[_0xf82f('0x7')](_0xf82f('0x15'),_0x23574f,_0x21dd93['join']('\x20|\x20'),_0x426fb2[_0xf82f('0x18')]);_0x240b99['stop']();});};}; \ No newline at end of file +var _0xd7ac=['http','request','message','catch','condition','rules','stop','Command','error','all','then','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client'];(function(_0x54b01b,_0x2f8e31){var _0x128b1f=function(_0x8d125a){while(--_0x8d125a){_0x54b01b['push'](_0x54b01b['shift']());}};_0x128b1f(++_0x2f8e31);}(_0xd7ac,0x77));var _0xcd7a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd7ac[_0x21a9d9];return _0x46adce;};'use strict';var util=require('util');var BPromise=require(_0xcd7a('0x0'));var jayson=require(_0xcd7a('0x1'));var _=require(_0xcd7a('0x2'));var logger=require(_0xcd7a('0x3'))(_0xcd7a('0x4'));var client=jayson[_0xcd7a('0x5')][_0xcd7a('0x6')]({'port':0x232a});function request(_0x34157c,_0x5bc5b2){return new BPromise(function(_0x229c43,_0x65f3fa){return client[_0xcd7a('0x7')](_0x34157c,_0x5bc5b2)['then'](function(_0x1d7574){if(_0x1d7574['error']){return _0x65f3fa(_0x1d7574['error'][_0xcd7a('0x8')]);}else{return _0x229c43(_0x1d7574['result']);}})[_0xcd7a('0x9')](function(_0x3388f9){return _0x65f3fa(_0x3388f9);});});}exports[_0xcd7a('0xa')]=function(_0x5a7cb1,_0xbd2816,_0x269779){return function(_0x326b70){if(_0x269779[_0xcd7a('0xb')]&&!_0x269779[_0xcd7a('0xb')][_0x5a7cb1]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x5a7cb1);return _0x326b70[_0xcd7a('0xc')]();}var _0x1a369b=[];for(var _0x539168=0x0;_0x539168<_0xbd2816['length'];_0x539168+=0x1){_0x1a369b['push'](request(_0xcd7a('0xd'),{'command':util['format']('iftime\x20%s',_0xbd2816[_0x539168])})['then'](function(_0x2baa93){return _0x2baa93&&_0x2baa93[_0xcd7a('0x8')]&&_0x2baa93[_0xcd7a('0x8')]['indexOf']('true')>=0x0?!![]:![];})[_0xcd7a('0x9')](function(_0x5788b1){logger[_0xcd7a('0xe')]('[%s][INTERVAL]\x20%s',_0x5a7cb1,_0xbd2816[_0x539168]);}));}BPromise[_0xcd7a('0xf')](_0x1a369b)[_0xcd7a('0x10')](function(_0x3a9646){var _0x492f1a=_[_0xcd7a('0x11')](_0x3a9646);logger[_0xcd7a('0x12')](_0xcd7a('0x13'),_0x5a7cb1,_0xbd2816[_0xcd7a('0x14')](_0xcd7a('0x15')),_0x492f1a);_0x326b70[_0xcd7a('0x16')](_0x492f1a);})[_0xcd7a('0x9')](function(_0x531a8c){console[_0xcd7a('0x17')](_0x531a8c);logger[_0xcd7a('0xe')](_0xcd7a('0x13'),_0x5a7cb1,_0xbd2816[_0xcd7a('0x14')]('\x20|\x20'),_0x531a8c[_0xcd7a('0x18')]);_0x326b70[_0xcd7a('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index e51d57b..97e9966 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 _0x4522=['agent','./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','lastevent','getVoiceQueueByName','then','type','agentcomplete','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','called','info','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','timeout','holdtime','ringtime','talktime','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','debug','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect','forIn','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','transfer','transfertype','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transferexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agentcompleteAt'];(function(_0x3c24ee,_0x4ea664){var _0x28b006=function(_0xcc4d15){while(--_0xcc4d15){_0x3c24ee['push'](_0x3c24ee['shift']());}};_0x28b006(++_0x4ea664);}(_0x4522,0x1a0));var _0x2452=function(_0x1427f8,_0x417f31){_0x1427f8=_0x1427f8-0x0;var _0x30a432=_0x4522[_0x1427f8];return _0x30a432;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x2452('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xa5f6b7,_0x4a08d4){utils['info'](util[_0x2452('0x1')](_0x2452('0x2'),_0xa5f6b7[_0x2452('0x3')],_0xa5f6b7[_0x2452('0x4')],_0xa5f6b7[_0x2452('0x5')],_0xa5f6b7[_0x2452('0x6')],_0xa5f6b7[_0x2452('0x7')],_0xa5f6b7[_0x2452('0x8')],_0xa5f6b7[_0x2452('0x9')],_0xa5f6b7[_0x2452('0xa')]));if(_0xa5f6b7[_0x2452('0x5')]){utils[_0x2452('0xb')](_0xa5f6b7[_0x2452('0x5')])[_0x2452('0xc')](function(_0x2e5caa){if(_0x2e5caa){_0xa5f6b7[_0x2452('0xd')]=_0x2e5caa['type'];_0xa5f6b7['agentacw']=_0xa5f6b7[_0x2452('0xe')]?_0x2e5caa['acw']:![];_0xa5f6b7['acwtime']=_0xa5f6b7[_0x2452('0xf')]?_0x2e5caa[_0x2452('0x10')]:0x0;}utils[_0x2452('0x11')](_0x2452('0x12'),_0xa5f6b7);});}else{utils[_0x2452('0x11')](_0x2452('0x12'),_0xa5f6b7);}if(_0x4a08d4){delete transfers[_0xa5f6b7[_0x2452('0x3')]];}else{delete agents[_0xa5f6b7[_0x2452('0x13')]];}}exports['agentcalled']=function(_0x529fb2){try{utils['debug'](util[_0x2452('0x1')]('[%s][agents][agentcalled]',_0x529fb2[_0x2452('0x3')]),_0x529fb2);agents[_0x529fb2['destuniqueid']]=_0x529fb2;agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x14')]=utils['now']();agents[_0x529fb2[_0x2452('0x13')]]['lastevent']=_0x2452('0x15');agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x9')]=null;agents[_0x529fb2[_0x2452('0x13')]]['connectedlinename']=null;utils[_0x2452('0x16')](util[_0x2452('0x1')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x529fb2['uniqueid'],agents[_0x529fb2[_0x2452('0x13')]][_0x2452('0x6')],_0x529fb2[_0x2452('0x13')]));}catch(_0x57cb03){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x18'),_0x529fb2[_0x2452('0x3')]),_0x57cb03);}};exports[_0x2452('0x19')]=function(_0x1c70cb){try{if(!_[_0x2452('0x1a')](agents[_0x1c70cb[_0x2452('0x13')]])){utils['debug'](util['format'](_0x2452('0x1b'),_0x1c70cb[_0x2452('0x3')]),_0x1c70cb);utils['info'](util[_0x2452('0x1')](_0x2452('0x1c'),_0x1c70cb[_0x2452('0x3')],agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x6')],_0x1c70cb[_0x2452('0x13')]));agents[_0x1c70cb[_0x2452('0x13')]]['agentringnoanswer']=!![];agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x1d')]=utils[_0x2452('0x1e')]();agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0xa')]='timeout';agents[_0x1c70cb['destuniqueid']][_0x2452('0x1f')]=_0x2452('0x20');agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x21')]=_0x1c70cb[_0x2452('0x22')]?parseInt(_0x1c70cb['ringtime'])/0x3e8:0x0;agents[_0x1c70cb[_0x2452('0x13')]][_0x2452('0x23')]=0x0;unanswered['push'](_0x1c70cb['destuniqueid']);}}catch(_0x332878){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x1b'),_0x1c70cb[_0x2452('0x3')]),_0x332878);}};exports[_0x2452('0x24')]=function(_0x504162){try{_['forIn'](agents,function(_0x46b611,_0x454e0a){if(_0x46b611[_0x2452('0x3')]==_0x504162['uniqueid']&&!_[_0x2452('0x25')](unanswered,_0x46b611[_0x2452('0x13')])){utils['debug'](util[_0x2452('0x1')](_0x2452('0x26'),_0x504162[_0x2452('0x3')]),_0x504162);utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x27'),_0x504162[_0x2452('0x3')],_0x46b611[_0x2452('0x6')],_0x46b611[_0x2452('0x13')]));_0x46b611[_0x2452('0x19')]=!![];_0x46b611[_0x2452('0x1d')]=utils[_0x2452('0x1e')]();_0x46b611[_0x2452('0xa')]='abandoned';_0x46b611[_0x2452('0x1f')]=_0x2452('0x28');_0x46b611['holdtime']=_0x504162[_0x2452('0x21')];_0x46b611['talktime']=0x0;writeDB(_0x46b611);}});}catch(_0x2c6843){utils[_0x2452('0x17')](util['format'](_0x2452('0x26'),_0x504162[_0x2452('0x3')]),_0x2c6843);}};exports[_0x2452('0x29')]=function(_0x5ce5fb){try{if(agents[_0x5ce5fb[_0x2452('0x13')]]){utils[_0x2452('0x2a')](util['format'](_0x2452('0x2b'),_0x5ce5fb[_0x2452('0x3')]),_0x5ce5fb);utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x2c'),_0x5ce5fb['uniqueid'],agents[_0x5ce5fb['destuniqueid']]['membername'],_0x5ce5fb[_0x2452('0x13')]));agents[_0x5ce5fb[_0x2452('0x13')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();agents[_0x5ce5fb[_0x2452('0x13')]]['connectedlinenum']=_0x5ce5fb[_0x2452('0x9')];agents[_0x5ce5fb['destuniqueid']]['connectedlinename']=_0x5ce5fb[_0x2452('0x2e')];agents[_0x5ce5fb['destuniqueid']][_0x2452('0x21')]=_0x5ce5fb[_0x2452('0x22')];agents[_0x5ce5fb['destuniqueid']][_0x2452('0xa')]=_0x2452('0x2f');_[_0x2452('0x30')](agents,function(_0x34d7f9,_0x2babbe){if(_0x34d7f9[_0x2452('0x13')]!=_0x5ce5fb[_0x2452('0x13')]&&_0x34d7f9[_0x2452('0x3')]==_0x5ce5fb['uniqueid']){_0x34d7f9[_0x2452('0x23')]=0x0;_0x34d7f9['holdtime']=_0x5ce5fb[_0x2452('0x22')];_0x34d7f9[_0x2452('0x19')]=!![];_0x34d7f9['agentringnoanswerAt']=utils[_0x2452('0x1e')]();_0x34d7f9[_0x2452('0xa')]=_0x2452('0x31');_0x34d7f9[_0x2452('0x1f')]=_0x2452('0x31');_0x34d7f9['answeredelsewheredestinationuniqueid']=_0x5ce5fb[_0x2452('0x13')];_0x34d7f9[_0x2452('0x32')]=_0x5ce5fb['membername'];writeDB(_0x34d7f9);}});}}catch(_0xfabbd8){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x2b'),_0x5ce5fb['uniqueid']),_0xfabbd8);}};exports[_0x2452('0xe')]=function(_0x304942){try{if(!_[_0x2452('0x1a')](agents[_0x304942[_0x2452('0x13')]])){utils[_0x2452('0x2a')](util[_0x2452('0x1')]('[%s][agents][agentcomplete]',_0x304942[_0x2452('0x3')]),_0x304942);utils['info'](util[_0x2452('0x1')](_0x2452('0x33'),_0x304942['uniqueid'],agents[_0x304942['destuniqueid']]['membername'],_0x304942['destuniqueid']));agents[_0x304942[_0x2452('0x13')]]['agentcomplete']=!![];agents[_0x304942[_0x2452('0x13')]]['agentcompleteAt']=utils[_0x2452('0x1e')]();agents[_0x304942[_0x2452('0x13')]]['talktime']=utils['diffTime'](agents[_0x304942[_0x2452('0x13')]]['agentcompleteAt'],agents[_0x304942[_0x2452('0x13')]][_0x2452('0x2d')]);agents[_0x304942[_0x2452('0x13')]][_0x2452('0x1f')]=_0x304942['reason'];agents[_0x304942['destuniqueid']][_0x2452('0xa')]=_0x2452('0x34');writeDB(agents[_0x304942[_0x2452('0x13')]]);}}catch(_0x2d06f2){utils[_0x2452('0x17')](util['format'](_0x2452('0x35'),_0x304942['uniqueid']),_0x2d06f2);}};exports[_0x2452('0x36')]=function(_0x53fd05){try{if(!_[_0x2452('0x1a')](agents[_0x53fd05[_0x2452('0x37')]])){utils['debug'](util[_0x2452('0x1')]('[%s][agents][blindtransfer]',_0x53fd05[_0x2452('0x3')]),_0x53fd05);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x53fd05[_0x2452('0x3')],agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x6')],agents[_0x53fd05['transfereruniqueid']][_0x2452('0x3')]));agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x38')]=!![];agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x39')]='blind';agents[_0x53fd05[_0x2452('0x37')]]['transferexten']=_0x53fd05[_0x2452('0x3a')];agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x3b')]=agents[_0x53fd05[_0x2452('0x37')]][_0x2452('0x3')];}}catch(_0x2096e2){utils[_0x2452('0x17')](util[_0x2452('0x1')](_0x2452('0x3c'),_0x53fd05['uniqueid']),_0x2096e2);}};exports[_0x2452('0x3d')]=function(_0x595f9f){try{utils[_0x2452('0x2a')](util['format'](_0x2452('0x3e'),_0x595f9f[_0x2452('0x3f')]),_0x595f9f);if(_0x595f9f['origtransfereruniqueid']==_0x595f9f[_0x2452('0x40')]){if(!_[_0x2452('0x1a')](agents[_0x595f9f[_0x2452('0x41')]])){utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x42'),_0x595f9f[_0x2452('0x3f')],agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x6')]));agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x38')]=!![];agents[_0x595f9f['secondtransfereruniqueid']][_0x2452('0x39')]='ATTENDED';agents[_0x595f9f[_0x2452('0x41')]]['transferexten']=_0x595f9f[_0x2452('0x43')];agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x3b')]=_0x595f9f[_0x2452('0x3f')];}if(_0x595f9f[_0x2452('0x44')]&&agents[_0x595f9f[_0x2452('0x44')]]){agents[_0x595f9f[_0x2452('0x44')]][_0x2452('0x45')]=0x1;transfers[_0x595f9f[_0x2452('0x44')]]=_[_0x2452('0x46')](agents[_0x595f9f[_0x2452('0x44')]]);transfers[_0x595f9f['transfereeuniqueid']][_0x2452('0x8')]=agents[_0x595f9f[_0x2452('0x41')]][_0x2452('0x8')];transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x47')]=agents[_0x595f9f[_0x2452('0x41')]]['calleridname'];transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x14')]=utils['now']();transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x21')]=0x0;transfers[_0x595f9f[_0x2452('0x44')]][_0x2452('0x45')]=0x2;}}else if(_0x595f9f[_0x2452('0x41')]==_0x595f9f[_0x2452('0x48')]){if(!_[_0x2452('0x1a')](agents[_0x595f9f[_0x2452('0x3f')]])){utils['info'](util['format'](_0x2452('0x42'),_0x595f9f['origtransfereruniqueid'],agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x6')]));agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x38')]=!![];agents[_0x595f9f[_0x2452('0x3f')]][_0x2452('0x39')]='ATTENDED';agents[_0x595f9f['origtransfereruniqueid']][_0x2452('0x49')]=_0x595f9f['secondtransfererexten'];agents[_0x595f9f[_0x2452('0x3f')]]['transferuniqueid']=_0x595f9f[_0x2452('0x41')];}if(_0x595f9f[_0x2452('0x4a')]&&agents[_0x595f9f[_0x2452('0x4a')]]){agents[_0x595f9f[_0x2452('0x4a')]]['agententerreason']=0x1;transfers[_0x595f9f['transfertargetuniqueid']]=_['clone'](agents[_0x595f9f[_0x2452('0x4a')]]);transfers[_0x595f9f[_0x2452('0x4a')]]['calleridnum']=agents[_0x595f9f['origtransfereruniqueid']]['calleridnum'];transfers[_0x595f9f['transfertargetuniqueid']]['calleridname']=agents[_0x595f9f[_0x2452('0x3f')]]['calleridname'];transfers[_0x595f9f['transfertargetuniqueid']][_0x2452('0x14')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x4a')]][_0x2452('0x2d')]=utils[_0x2452('0x1e')]();transfers[_0x595f9f[_0x2452('0x4a')]]['holdtime']=0x0;transfers[_0x595f9f[_0x2452('0x4a')]][_0x2452('0x45')]=0x2;}}}catch(_0x45c850){utils['error'](util['format'](_0x2452('0x3e'),_0x595f9f[_0x2452('0x3f')]),_0x45c850);}};exports[_0x2452('0x4b')]=function(_0x1dec54){try{utils[_0x2452('0x2a')](util[_0x2452('0x1')](_0x2452('0x4c'),_0x1dec54[_0x2452('0x3')]),_0x1dec54);if(agents[_0x1dec54['uniqueid']]&&agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')]===_0x2452('0x20')){if(_0x1dec54[_0x2452('0x4d')]==='21'){agents[_0x1dec54['uniqueid']][_0x2452('0x1f')]=_0x2452('0x4e');agents[_0x1dec54['uniqueid']][_0x2452('0xa')]=_0x2452('0x4e');}utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],agents[_0x1dec54['uniqueid']]['reason'],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]));writeDB(agents[_0x1dec54[_0x2452('0x3')]]);var _0x1530fe=unanswered['indexOf'](_0x1dec54[_0x2452('0x3')]);if(_0x1530fe>-0x1){unanswered[_0x2452('0x50')](_0x1530fe,0x1);}}if(transfers[_0x1dec54[_0x2452('0x3')]]){transfers[_0x1dec54[_0x2452('0x3')]]['agentcomplete']=!![];transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')]=utils[_0x2452('0x1e')]();transfers[_0x1dec54[_0x2452('0x3')]]['talktime']=utils['diffTime'](transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')],transfers[_0x1dec54['uniqueid']][_0x2452('0x2d')]);transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')]=_0x2452('0x52');transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]=_0x2452('0x34');utils[_0x2452('0x16')](util[_0x2452('0x1')](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],transfers[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')],transfers[_0x1dec54[_0x2452('0x3')]]['lastevent']));writeDB(transfers[_0x1dec54[_0x2452('0x3')]],!![]);}if(agents[_0x1dec54[_0x2452('0x3')]]&&agents[_0x1dec54[_0x2452('0x3')]]['agentconnectAt']){agents[_0x1dec54['uniqueid']]['agentcomplete']=!![];agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x51')]=utils[_0x2452('0x1e')]();agents[_0x1dec54[_0x2452('0x3')]]['talktime']=utils['diffTime'](agents[_0x1dec54['uniqueid']][_0x2452('0x51')],agents[_0x1dec54['uniqueid']][_0x2452('0x2d')]);agents[_0x1dec54['uniqueid']][_0x2452('0x1f')]=agents[_0x1dec54['uniqueid']][_0x2452('0x38')]?'transfer':_0x2452('0x52');agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]=_0x2452('0x34');utils[_0x2452('0x16')](util['format'](_0x2452('0x4f'),_0x1dec54[_0x2452('0x3')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x6')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0x1f')],agents[_0x1dec54[_0x2452('0x3')]][_0x2452('0xa')]));writeDB(agents[_0x1dec54[_0x2452('0x3')]]);}}catch(_0x3b681c){utils[_0x2452('0x17')](util['format'](_0x2452('0x4c'),_0x1dec54['uniqueid']),_0x3b681c);}}; \ No newline at end of file +var _0x593e=['answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentcompleteAt','agentconnectAt','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','acw','acwtime','agentacw','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','talktime','[%s][agents][agentconnect]','connect','answered_elsewhere'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x593e,0xcb));var _0xe593=function(_0x45d7d5,_0x149da4){_0x45d7d5=_0x45d7d5-0x0;var _0x2ebbff=_0x593e[_0x45d7d5];return _0x2ebbff;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var utils=require(_0xe593('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x28f28c,_0x43dabb){utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x5'),_0x28f28c['uniqueid'],_0x28f28c[_0xe593('0x6')],_0x28f28c[_0xe593('0x7')],_0x28f28c[_0xe593('0x8')],_0x28f28c[_0xe593('0x9')],_0x28f28c[_0xe593('0xa')],_0x28f28c[_0xe593('0xb')],_0x28f28c[_0xe593('0xc')]));if(_0x28f28c[_0xe593('0x7')]){utils[_0xe593('0xd')](_0x28f28c[_0xe593('0x7')])['then'](function(_0x38c470){if(_0x38c470){_0x28f28c[_0xe593('0xe')]=_0x38c470[_0xe593('0xe')];_0x28f28c['agentacw']=_0x28f28c['agentcomplete']?_0x38c470[_0xe593('0xf')]:![];_0x28f28c[_0xe593('0x10')]=_0x28f28c[_0xe593('0x11')]?_0x38c470['acwTimeout']:0x0;}utils[_0xe593('0x12')](_0xe593('0x13'),_0x28f28c);});}else{utils[_0xe593('0x12')](_0xe593('0x13'),_0x28f28c);}if(_0x43dabb){delete transfers[_0x28f28c[_0xe593('0x14')]];}else{delete agents[_0x28f28c[_0xe593('0x15')]];}}exports[_0xe593('0x16')]=function(_0xa4d5e9){try{utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][agentcalled]',_0xa4d5e9[_0xe593('0x14')]),_0xa4d5e9);agents[_0xa4d5e9[_0xe593('0x15')]]=_0xa4d5e9;agents[_0xa4d5e9['destuniqueid']][_0xe593('0x18')]=utils[_0xe593('0x19')]();agents[_0xa4d5e9['destuniqueid']][_0xe593('0xc')]=_0xe593('0x1a');agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0xb')]=null;agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0x1b')]=null;utils['info'](util[_0xe593('0x4')](_0xe593('0x1c'),_0xa4d5e9['uniqueid'],agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0x8')],_0xa4d5e9['destuniqueid']));}catch(_0x1c94aa){utils[_0xe593('0x1d')](util[_0xe593('0x4')](_0xe593('0x1e'),_0xa4d5e9[_0xe593('0x14')]),_0x1c94aa);}};exports[_0xe593('0x1f')]=function(_0x3d2a51){try{if(!_['isNil'](agents[_0x3d2a51['destuniqueid']])){utils[_0xe593('0x17')](util['format']('[%s][agents][agentringnoanswer]',_0x3d2a51[_0xe593('0x14')]),_0x3d2a51);utils[_0xe593('0x3')](util['format'](_0xe593('0x20'),_0x3d2a51['uniqueid'],agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x8')],_0x3d2a51[_0xe593('0x15')]));agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x1f')]=!![];agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x21')]=utils[_0xe593('0x19')]();agents[_0x3d2a51['destuniqueid']][_0xe593('0xc')]=_0xe593('0x22');agents[_0x3d2a51['destuniqueid']]['reason']=_0xe593('0x22');agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x23')]=_0x3d2a51[_0xe593('0x24')]?parseInt(_0x3d2a51[_0xe593('0x24')])/0x3e8:0x0;agents[_0x3d2a51[_0xe593('0x15')]]['talktime']=0x0;unanswered[_0xe593('0x25')](_0x3d2a51['destuniqueid']);}}catch(_0x1dacf6){utils[_0xe593('0x1d')](util['format'](_0xe593('0x26'),_0x3d2a51['uniqueid']),_0x1dacf6);}};exports[_0xe593('0x27')]=function(_0x1c147b){try{_[_0xe593('0x28')](agents,function(_0x501e54,_0x1ae8d9){if(_0x501e54[_0xe593('0x14')]==_0x1c147b[_0xe593('0x14')]&&!_[_0xe593('0x29')](unanswered,_0x501e54[_0xe593('0x15')])){utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][queuecallerabandon]',_0x1c147b[_0xe593('0x14')]),_0x1c147b);utils[_0xe593('0x3')](util['format'](_0xe593('0x2a'),_0x1c147b['uniqueid'],_0x501e54[_0xe593('0x8')],_0x501e54[_0xe593('0x15')]));_0x501e54[_0xe593('0x1f')]=!![];_0x501e54[_0xe593('0x21')]=utils[_0xe593('0x19')]();_0x501e54[_0xe593('0xc')]=_0xe593('0x2b');_0x501e54[_0xe593('0x2c')]=_0xe593('0x2b');_0x501e54[_0xe593('0x23')]=_0x1c147b['holdtime'];_0x501e54[_0xe593('0x2d')]=0x0;writeDB(_0x501e54);}});}catch(_0x2c0a30){utils[_0xe593('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x1c147b[_0xe593('0x14')]),_0x2c0a30);}};exports['agentconnect']=function(_0x232bf1){try{if(agents[_0x232bf1[_0xe593('0x15')]]){utils[_0xe593('0x17')](util[_0xe593('0x4')](_0xe593('0x2e'),_0x232bf1[_0xe593('0x14')]),_0x232bf1);utils[_0xe593('0x3')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x232bf1[_0xe593('0x14')],agents[_0x232bf1['destuniqueid']][_0xe593('0x8')],_0x232bf1['destuniqueid']));agents[_0x232bf1[_0xe593('0x15')]]['agentconnectAt']=utils['now']();agents[_0x232bf1[_0xe593('0x15')]][_0xe593('0xb')]=_0x232bf1[_0xe593('0xb')];agents[_0x232bf1['destuniqueid']]['connectedlinename']=_0x232bf1['connectedlinename'];agents[_0x232bf1[_0xe593('0x15')]]['holdtime']=_0x232bf1[_0xe593('0x24')];agents[_0x232bf1[_0xe593('0x15')]][_0xe593('0xc')]=_0xe593('0x2f');_['forIn'](agents,function(_0x196325,_0x53ed3c){if(_0x196325[_0xe593('0x15')]!=_0x232bf1['destuniqueid']&&_0x196325['uniqueid']==_0x232bf1['uniqueid']){_0x196325[_0xe593('0x2d')]=0x0;_0x196325['holdtime']=_0x232bf1[_0xe593('0x24')];_0x196325[_0xe593('0x1f')]=!![];_0x196325[_0xe593('0x21')]=utils['now']();_0x196325[_0xe593('0xc')]=_0xe593('0x30');_0x196325[_0xe593('0x2c')]=_0xe593('0x30');_0x196325[_0xe593('0x31')]=_0x232bf1[_0xe593('0x15')];_0x196325[_0xe593('0x32')]=_0x232bf1[_0xe593('0x8')];writeDB(_0x196325);}});}}catch(_0x4b36e1){utils[_0xe593('0x1d')](util[_0xe593('0x4')](_0xe593('0x2e'),_0x232bf1[_0xe593('0x14')]),_0x4b36e1);}};exports[_0xe593('0x33')]=function(_0x4d3018){try{if(!_['isNil'](agents[_0x4d3018[_0xe593('0x15')]])){utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][agentcomplete]',_0x4d3018[_0xe593('0x14')]),_0x4d3018);utils[_0xe593('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4d3018[_0xe593('0x14')],agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x8')],_0x4d3018['destuniqueid']));agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x33')]=!![];agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x34')]=utils['now']();agents[_0x4d3018['destuniqueid']]['talktime']=utils['diffTime'](agents[_0x4d3018[_0xe593('0x15')]]['agentcompleteAt'],agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x35')]);agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x2c')]=_0x4d3018[_0xe593('0x2c')];agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0xc')]=_0xe593('0x36');writeDB(agents[_0x4d3018['destuniqueid']]);}}catch(_0x3dbb46){utils[_0xe593('0x1d')](util[_0xe593('0x4')]('[%s][agents][agentcomplete]',_0x4d3018[_0xe593('0x14')]),_0x3dbb46);}};exports['blindtransfer']=function(_0x39ec9e){try{if(!_[_0xe593('0x37')](agents[_0x39ec9e[_0xe593('0x38')]])){utils['debug'](util['format'](_0xe593('0x39'),_0x39ec9e[_0xe593('0x14')]),_0x39ec9e);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x39ec9e['uniqueid'],agents[_0x39ec9e['transfereruniqueid']][_0xe593('0x8')],agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x14')]));agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3a')]=!![];agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3b')]=_0xe593('0x3c');agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3d')]=_0x39ec9e[_0xe593('0x3e')];agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3f')]=agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x14')];}}catch(_0x46544d){utils['error'](util[_0xe593('0x4')](_0xe593('0x39'),_0x39ec9e[_0xe593('0x14')]),_0x46544d);}};exports[_0xe593('0x40')]=function(_0x1204d8){try{utils[_0xe593('0x17')](util[_0xe593('0x4')](_0xe593('0x41'),_0x1204d8[_0xe593('0x42')]),_0x1204d8);if(_0x1204d8[_0xe593('0x42')]==_0x1204d8[_0xe593('0x43')]){if(!_[_0xe593('0x37')](agents[_0x1204d8[_0xe593('0x44')]])){utils[_0xe593('0x3')](util[_0xe593('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1204d8[_0xe593('0x42')],agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x8')]));agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3a')]=!![];agents[_0x1204d8['secondtransfereruniqueid']]['transfertype']=_0xe593('0x45');agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3d')]=_0x1204d8[_0xe593('0x46')];agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3f')]=_0x1204d8[_0xe593('0x42')];}if(_0x1204d8['transfereeuniqueid']&&agents[_0x1204d8['transfereeuniqueid']]){agents[_0x1204d8[_0xe593('0x47')]][_0xe593('0x48')]=0x1;transfers[_0x1204d8['transfereeuniqueid']]=_[_0xe593('0x49')](agents[_0x1204d8[_0xe593('0x47')]]);transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0xa')]=agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0xa')];transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x4a')]=agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x4a')];transfers[_0x1204d8['transfereeuniqueid']][_0xe593('0x18')]=utils[_0xe593('0x19')]();transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x35')]=utils[_0xe593('0x19')]();transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x23')]=0x0;transfers[_0x1204d8['transfereeuniqueid']][_0xe593('0x48')]=0x2;}}else if(_0x1204d8[_0xe593('0x44')]==_0x1204d8[_0xe593('0x4b')]){if(!_[_0xe593('0x37')](agents[_0x1204d8['origtransfereruniqueid']])){utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x4c'),_0x1204d8[_0xe593('0x42')],agents[_0x1204d8[_0xe593('0x42')]]['membername']));agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3a')]=!![];agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3b')]=_0xe593('0x45');agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3d')]=_0x1204d8[_0xe593('0x4d')];agents[_0x1204d8['origtransfereruniqueid']][_0xe593('0x3f')]=_0x1204d8[_0xe593('0x44')];}if(_0x1204d8[_0xe593('0x4e')]&&agents[_0x1204d8[_0xe593('0x4e')]]){agents[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x48')]=0x1;transfers[_0x1204d8[_0xe593('0x4e')]]=_[_0xe593('0x49')](agents[_0x1204d8[_0xe593('0x4e')]]);transfers[_0x1204d8[_0xe593('0x4e')]]['calleridnum']=agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0xa')];transfers[_0x1204d8[_0xe593('0x4e')]]['calleridname']=agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x4a')];transfers[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x18')]=utils[_0xe593('0x19')]();transfers[_0x1204d8['transfertargetuniqueid']][_0xe593('0x35')]=utils[_0xe593('0x19')]();transfers[_0x1204d8['transfertargetuniqueid']][_0xe593('0x23')]=0x0;transfers[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x48')]=0x2;}}}catch(_0x3486b3){utils['error'](util[_0xe593('0x4')](_0xe593('0x41'),_0x1204d8[_0xe593('0x42')]),_0x3486b3);}};exports['hangup']=function(_0x43dcb0){try{utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][hangup]',_0x43dcb0[_0xe593('0x14')]),_0x43dcb0);if(agents[_0x43dcb0[_0xe593('0x14')]]&&agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]===_0xe593('0x22')){if(_0x43dcb0['cause']==='21'){agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]=_0xe593('0x4f');agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x4f');}utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x8')],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')],agents[_0x43dcb0['uniqueid']][_0xe593('0xc')]));writeDB(agents[_0x43dcb0[_0xe593('0x14')]]);var _0x9427d6=unanswered[_0xe593('0x51')](_0x43dcb0[_0xe593('0x14')]);if(_0x9427d6>-0x1){unanswered[_0xe593('0x52')](_0x9427d6,0x1);}}if(transfers[_0x43dcb0[_0xe593('0x14')]]){transfers[_0x43dcb0[_0xe593('0x14')]]['agentcomplete']=!![];transfers[_0x43dcb0['uniqueid']]['agentcompleteAt']=utils[_0xe593('0x19')]();transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2d')]=utils['diffTime'](transfers[_0x43dcb0['uniqueid']][_0xe593('0x34')],transfers[_0x43dcb0['uniqueid']][_0xe593('0x35')]);transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]='agent';transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x36');utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],transfers[_0x43dcb0['uniqueid']][_0xe593('0x8')],transfers[_0x43dcb0[_0xe593('0x14')]]['reason'],transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]));writeDB(transfers[_0x43dcb0[_0xe593('0x14')]],!![]);}if(agents[_0x43dcb0['uniqueid']]&&agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x35')]){agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x33')]=!![];agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x34')]=utils['now']();agents[_0x43dcb0['uniqueid']][_0xe593('0x2d')]=utils['diffTime'](agents[_0x43dcb0['uniqueid']]['agentcompleteAt'],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x35')]);agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]=agents[_0x43dcb0[_0xe593('0x14')]]['transfer']?'transfer':_0xe593('0x53');agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x36');utils['info'](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],agents[_0x43dcb0['uniqueid']][_0xe593('0x8')],agents[_0x43dcb0[_0xe593('0x14')]]['reason'],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]));writeDB(agents[_0x43dcb0['uniqueid']]);}}catch(_0x5bb9e2){utils['error'](util['format']('[%s][agents][hangup]',_0x43dcb0['uniqueid']),_0x5bb9e2);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 637f213..d088e5d 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 _0x9023=['[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','noop','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','linkedid','exten','context','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','callerid','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid'];(function(_0x4cf82b,_0x36462a){var _0x10da53=function(_0x18e9e1){while(--_0x18e9e1){_0x4cf82b['push'](_0x4cf82b['shift']());}};_0x10da53(++_0x36462a);}(_0x9023,0x87));var _0x3902=function(_0x55deff,_0x386fed){_0x55deff=_0x55deff-0x0;var _0x2a612e=_0x9023[_0x55deff];return _0x2a612e;};'use strict';var _=require('lodash');var util=require(_0x3902('0x0'));var utils=require(_0x3902('0x1'));var transfers=require(_0x3902('0x2'));var dispositions=[_0x3902('0x3'),_0x3902('0x4'),'FAILED',_0x3902('0x3'),'NO\x20ANSWER',_0x3902('0x3'),_0x3902('0x5'),_0x3902('0x6'),_0x3902('0x4'),_0x3902('0x4'),_0x3902('0x4')];var channels={};function writeDB(_0x1f1090){var _0x4a65e0;if(transfers[_0x3902('0x7')][_0x1f1090['uniqueid']]){_0x4a65e0=_0x1f1090[_0x3902('0x8')];_0x1f1090[_0x3902('0x8')]=transfers['blinds'][_0x1f1090['uniqueid']][_0x3902('0x9')];}utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0xc'),_0x1f1090[_0x3902('0x8')],_0x1f1090[_0x3902('0xd')],_0x1f1090[_0x3902('0xe')],_0x1f1090[_0x3902('0xf')],_0x1f1090[_0x3902('0x10')],_0x1f1090[_0x3902('0x11')],_0x1f1090[_0x3902('0x12')],_0x1f1090[_0x3902('0x13')]));if(_0x1f1090[_0x3902('0x14')]){utils[_0x3902('0x15')](_0x1f1090[_0x3902('0x14')])[_0x3902('0x16')](function(_0x15bd1c){if(_0x15bd1c){_0x1f1090['UserId']=_0x15bd1c['id'];}utils[_0x3902('0x17')](_0x3902('0x18'),_0x1f1090);});}else{utils['request'](_0x3902('0x18'),_0x1f1090);}if(channels[_0x1f1090[_0x3902('0x8')]]){delete channels[_0x1f1090['uniqueid']];}else if(_0x4a65e0&&channels[_0x4a65e0]){delete transfers[_0x3902('0x7')][_0x4a65e0];delete channels[_0x4a65e0];}}exports[_0x3902('0x19')]=function(_0x24ab5c){try{utils[_0x3902('0x1a')](util[_0x3902('0xb')]('[%s][calls][newchannel]',_0x24ab5c[_0x3902('0x8')]),_0x24ab5c);if(_0x24ab5c[_0x3902('0x8')]==_0x24ab5c[_0x3902('0x1b')]&&_0x24ab5c[_0x3902('0xd')]!='OutgoingSpoolFailed'){utils['info'](util[_0x3902('0xb')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x24ab5c[_0x3902('0x8')],_0x24ab5c['context'],_0x24ab5c[_0x3902('0x1c')]));channels[_0x24ab5c[_0x3902('0x8')]]={'uniqueid':_0x24ab5c[_0x3902('0x8')],'accountcode':_0x24ab5c[_0x3902('0x14')],'source':_0x24ab5c[_0x3902('0x11')],'destination':_0x24ab5c[_0x3902('0x1c')],'destinationcontext':_0x24ab5c[_0x3902('0x1d')],'channel':_0x24ab5c['channel'],'starttime':utils[_0x3902('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x3902('0x1f')};}}catch(_0x4d9e38){utils[_0x3902('0x20')](util[_0x3902('0xb')](_0x3902('0x21'),_0x24ab5c['uniqueid']),_0x4d9e38);}};exports[_0x3902('0x22')]=function(_0x51e3e1){try{utils[_0x3902('0x1a')](util[_0x3902('0xb')](_0x3902('0x23'),_0x51e3e1[_0x3902('0x8')]),_0x51e3e1);if(!_[_0x3902('0x24')](channels[_0x51e3e1[_0x3902('0x8')]])&&_0x51e3e1[_0x3902('0x25')]==0x6){utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x51e3e1['uniqueid'],_0x51e3e1[_0x3902('0x1d')],_0x51e3e1[_0x3902('0xd')]));if(_['isNil'](channels[_0x51e3e1['uniqueid']][_0x3902('0x26')])){channels[_0x51e3e1[_0x3902('0x8')]][_0x3902('0x26')]=utils[_0x3902('0x1e')]();}}else if(!_[_0x3902('0x24')](channels[_0x51e3e1[_0x3902('0x1b')]])&&_0x51e3e1['channelstate']==0x6&&_0x51e3e1[_0x3902('0x1d')]!=_0x3902('0x27')){utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x28'),_0x51e3e1['uniqueid'],_0x51e3e1['linkedid'],_0x51e3e1['context'],_0x51e3e1[_0x3902('0xd')]));channels[_0x51e3e1['linkedid']][_0x3902('0x14')]=_0x51e3e1[_0x3902('0x14')];channels[_0x51e3e1[_0x3902('0x1b')]][_0x3902('0x29')]=_0x51e3e1['channel'];if(_[_0x3902('0x24')](channels[_0x51e3e1[_0x3902('0x1b')]][_0x3902('0x2a')])){channels[_0x51e3e1['linkedid']][_0x3902('0x2a')]=utils[_0x3902('0x1e')]();}channels[_0x51e3e1[_0x3902('0x1b')]][_0x3902('0x2b')]=dispositions[_[_0x3902('0x2c')](_0x51e3e1[_0x3902('0x25')])]||_0x3902('0x5');}}catch(_0x5eba8e){utils[_0x3902('0x20')](util[_0x3902('0xb')]('[%s][calls][newstate]',_0x51e3e1[_0x3902('0x8')]),_0x5eba8e);}};exports['hangup']=function(_0x4a6f78){try{if(!_[_0x3902('0x24')](channels[_0x4a6f78[_0x3902('0x8')]])){utils[_0x3902('0x1a')](util[_0x3902('0xb')]('[%s][calls][hangup]',_0x4a6f78[_0x3902('0x8')]),_0x4a6f78);if(_[_0x3902('0x24')](channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2d')])){channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2d')]=_0x4a6f78['calleridname']+'\x20<'+_0x4a6f78['calleridnum']+'>';}utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x4a6f78['uniqueid'],channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2d')],_0x4a6f78[_0x3902('0x2e')]));channels[_0x4a6f78['uniqueid']][_0x3902('0x2f')]=utils[_0x3902('0x1e')]();channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x30')]=utils[_0x3902('0x31')](channels[_0x4a6f78[_0x3902('0x8')]]['endtime'],channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x32')]);channels[_0x4a6f78['uniqueid']][_0x3902('0x33')]=channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2a')]?utils[_0x3902('0x31')](channels[_0x4a6f78[_0x3902('0x8')]][_0x3902('0x2f')],channels[_0x4a6f78[_0x3902('0x8')]]['answertime']):0x0;writeDB(channels[_0x4a6f78[_0x3902('0x8')]]);}}catch(_0x46853d){utils[_0x3902('0x20')](util[_0x3902('0xb')](_0x3902('0x34'),_0x4a6f78[_0x3902('0x8')]),_0x46853d);}};exports[_0x3902('0x35')]=function(_0x2db709){try{if(!_[_0x3902('0x24')](channels[_0x2db709[_0x3902('0x36')]])){utils[_0x3902('0x1a')](util['format']('[%s][calls][attendedtransfer]',_0x2db709[_0x3902('0x37')]),_0x2db709);if(channels[_0x2db709[_0x3902('0x36')]][_0x3902('0xd')]==_0x2db709[_0x3902('0x38')]){utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2db709[_0x3902('0x37')],_0x2db709[_0x3902('0x36')],_0x2db709['secondtransfererchannel']));channels[_0x2db709[_0x3902('0x36')]][_0x3902('0x29')]=_0x2db709[_0x3902('0x39')];channels[_0x2db709[_0x3902('0x36')]][_0x3902('0x3a')]=_0x3902('0x3b');}else if(channels[_0x2db709[_0x3902('0x36')]][_0x3902('0xd')]=_0x2db709[_0x3902('0x3c')]){utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2db709[_0x3902('0x37')],_0x2db709['localtwolinkedid'],_0x2db709[_0x3902('0x3d')]));channels[_0x2db709['localtwolinkedid']][_0x3902('0x29')]=_0x2db709[_0x3902('0x3d')];channels[_0x2db709[_0x3902('0x36')]][_0x3902('0x3a')]='_attended';}}}catch(_0x10cc1b){utils['error'](util[_0x3902('0xb')](_0x3902('0x3e'),_0x2db709[_0x3902('0x37')]),_0x10cc1b);}};exports['musiconholdstart']=function(_0x37a513){try{if(!_[_0x3902('0x24')](channels[_0x37a513[_0x3902('0x8')]])){utils[_0x3902('0x1a')](util['format'](_0x3902('0x3f'),_0x37a513[_0x3902('0x8')]),_0x37a513);channels[_0x37a513[_0x3902('0x8')]][_0x3902('0x40')]=utils[_0x3902('0x1e')]();utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x41'),_0x37a513[_0x3902('0x8')],channels[_0x37a513[_0x3902('0x8')]][_0x3902('0x40')]));}}catch(_0x16f26c){utils['error'](util['format'](_0x3902('0x3f'),_0x37a513[_0x3902('0x8')]),_0x16f26c);}};exports[_0x3902('0x42')]=function(_0x17998f){try{if(!_[_0x3902('0x24')](channels[_0x17998f['uniqueid']])){utils[_0x3902('0x1a')](util[_0x3902('0xb')](_0x3902('0x43'),_0x17998f[_0x3902('0x8')]),_0x17998f);if(!_[_0x3902('0x24')](channels[_0x17998f[_0x3902('0x8')]]['musiconholdstartAt'])){channels[_0x17998f['uniqueid']][_0x3902('0x44')]+=utils[_0x3902('0x31')](utils['now'](),channels[_0x17998f['uniqueid']][_0x3902('0x40')]);utils[_0x3902('0xa')](util['format'](_0x3902('0x45'),_0x17998f['uniqueid'],channels[_0x17998f[_0x3902('0x8')]][_0x3902('0x44')]));delete channels[_0x17998f[_0x3902('0x8')]][_0x3902('0x40')];}}}catch(_0x255458){utils[_0x3902('0x20')](util[_0x3902('0xb')](_0x3902('0x43'),_0x17998f[_0x3902('0x8')]),_0x255458);}};exports[_0x3902('0x46')]=function(_0xb16dd0){try{if(!_[_0x3902('0x24')](channels[_0xb16dd0['uniqueid']])){utils[_0x3902('0x1a')](util[_0x3902('0xb')](_0x3902('0x47'),_0xb16dd0[_0x3902('0x8')]),_0xb16dd0);if(!_['isNil'](_0xb16dd0[_0x3902('0x48')][_0x3902('0x49')])){utils[_0x3902('0xa')](util['format'](_0x3902('0x4a'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x4c')]=_0xb16dd0['value'];}if(!_[_0x3902('0x24')](_0xb16dd0['variable'][_0x3902('0x4d')])){utils[_0x3902('0xa')](util['format'](_0x3902('0x4e'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]]['destination']=_0xb16dd0[_0x3902('0x4b')];channels[_0xb16dd0['uniqueid']][_0x3902('0x2d')]='\x22'+_0xb16dd0[_0x3902('0x4b')]+_0x3902('0x4f')+_0xb16dd0[_0x3902('0x4b')]+'>';}if(!_['isNil'](_0xb16dd0[_0x3902('0x48')][_0x3902('0x50')])||!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x51')])){utils['info'](util[_0x3902('0xb')](_0x3902('0x52'),_0xb16dd0['uniqueid'],!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x50')])?'xmd-callerid-preview':_0x3902('0x51'),_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]]['callerid']=_0xb16dd0[_0x3902('0x4b')];}if(!_['isNil'](_0xb16dd0[_0x3902('0x48')][_0x3902('0x53')])||!_[_0x3902('0x24')](_0xb16dd0['variable'][_0x3902('0x54')])){utils[_0x3902('0xa')](util[_0x3902('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xb16dd0[_0x3902('0x8')],!_[_0x3902('0x24')](_0xb16dd0['variable'][_0x3902('0x53')])?_0x3902('0x53'):'xmcs-queue',_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x55')]=_0x3902('0x56');channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x57')]=_0xb16dd0[_0x3902('0x4b')];channels[_0xb16dd0[_0x3902('0x8')]]['queue']=!![];}if(!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x58')])){utils['info'](util['format'](_0x3902('0x59'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0['value']));channels[_0xb16dd0['uniqueid']]['ContactId']=_0xb16dd0['value'];}if(!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x5a')])){utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x5b'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x5c')]=_0xb16dd0['value'];}if(!_[_0x3902('0x24')](_0xb16dd0[_0x3902('0x48')][_0x3902('0x5d')])){utils[_0x3902('0xa')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0xb16dd0['uniqueid'],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0[_0x3902('0x8')]][_0x3902('0x5e')]=_0xb16dd0[_0x3902('0x4b')];}if(!_['isNil'](_0xb16dd0['variable']['sipcallid'])){utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x5f'),_0xb16dd0[_0x3902('0x8')],_0xb16dd0[_0x3902('0x4b')]));channels[_0xb16dd0['uniqueid']][_0x3902('0x60')]=_0xb16dd0[_0x3902('0x4b')];}}}catch(_0x1e5744){utils[_0x3902('0x20')](util[_0x3902('0xb')]('[%s][calls][varset]',_0xb16dd0['uniqueid']),_0x1e5744);}};exports[_0x3902('0x61')]=function(_0x5ae78a){try{if(!_[_0x3902('0x24')](channels[_0x5ae78a[_0x3902('0x8')]])){utils[_0x3902('0x1a')](util['format'](_0x3902('0x62'),_0x5ae78a[_0x3902('0x8')]),_0x5ae78a);utils[_0x3902('0xa')](util[_0x3902('0xb')](_0x3902('0x63'),_0x5ae78a['uniqueid'],_0x5ae78a[_0x3902('0x64')],_0x5ae78a[_0x3902('0x65')]));if(_0x5ae78a['application'][_0x3902('0x66')]()==_0x3902('0x67')&&_[_0x3902('0x68')](_0x5ae78a[_0x3902('0x65')][_0x3902('0x66')](),_0x3902('0x69'))){var _0x2185c1=_0x5ae78a[_0x3902('0x65')][_0x3902('0x6a')]('=');var _0x2ace94=_0x2185c1[0x0][_0x3902('0x6b')](_0x2185c1[0x0][_0x3902('0x6c')]('(')+0x1,_0x2185c1[0x0][_0x3902('0x6c')](')'));var _0x4a69d5=_0x2185c1[0x1];channels[_0x5ae78a[_0x3902('0x8')]][_0x2ace94]=_0x4a69d5;}if(!_[_0x3902('0x6d')]([_0x3902('0x6e'),_0x3902('0x6f'),'execif',_0x3902('0x67'),'gotoif'],_0x5ae78a['application'][_0x3902('0x66')]())){channels[_0x5ae78a['uniqueid']]['lastapplication']=_0x5ae78a[_0x3902('0x64')];channels[_0x5ae78a[_0x3902('0x8')]][_0x3902('0x57')]=_0x5ae78a[_0x3902('0x65')];}}}catch(_0x5056c8){utils[_0x3902('0x20')](util[_0x3902('0xb')]('[%s][calls][newexten]',_0x5ae78a[_0x3902('0x8')]),_0x5056c8);}}; \ No newline at end of file +var _0x76c6=['info','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','variable','value','destination','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmcs-queue','xmd-queue','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','channel','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','context','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0x76c6,0x192));var _0x676c=function(_0xc75e69,_0x19ac94){_0xc75e69=_0xc75e69-0x0;var _0x447f25=_0x76c6[_0xc75e69];return _0x447f25;};'use strict';var _=require(_0x676c('0x0'));var util=require(_0x676c('0x1'));var utils=require('./utils');var transfers=require(_0x676c('0x2'));var dispositions=[_0x676c('0x3'),_0x676c('0x4'),_0x676c('0x4'),_0x676c('0x3'),_0x676c('0x3'),_0x676c('0x3'),_0x676c('0x5'),_0x676c('0x6'),_0x676c('0x4'),_0x676c('0x4'),_0x676c('0x4')];var channels={};function writeDB(_0x3faee5){var _0x1cdebe;if(transfers[_0x676c('0x7')][_0x3faee5[_0x676c('0x8')]]){_0x1cdebe=_0x3faee5[_0x676c('0x8')];_0x3faee5[_0x676c('0x8')]=transfers[_0x676c('0x7')][_0x3faee5[_0x676c('0x8')]][_0x676c('0x9')];}utils['info'](util[_0x676c('0xa')](_0x676c('0xb'),_0x3faee5[_0x676c('0x8')],_0x3faee5['channel'],_0x3faee5[_0x676c('0xc')],_0x3faee5['membername'],_0x3faee5['interface'],_0x3faee5['calleridnum'],_0x3faee5[_0x676c('0xd')],_0x3faee5[_0x676c('0xe')]));if(_0x3faee5[_0x676c('0xf')]){utils[_0x676c('0x10')](_0x3faee5[_0x676c('0xf')])[_0x676c('0x11')](function(_0x335036){if(_0x335036){_0x3faee5['UserId']=_0x335036['id'];}utils['request']('CreateVoiceCallReport',_0x3faee5);});}else{utils[_0x676c('0x12')](_0x676c('0x13'),_0x3faee5);}if(channels[_0x3faee5['uniqueid']]){delete channels[_0x3faee5[_0x676c('0x8')]];}else if(_0x1cdebe&&channels[_0x1cdebe]){delete transfers[_0x676c('0x7')][_0x1cdebe];delete channels[_0x1cdebe];}}exports[_0x676c('0x14')]=function(_0x577b04){try{utils[_0x676c('0x15')](util['format'](_0x676c('0x16'),_0x577b04[_0x676c('0x8')]),_0x577b04);if(_0x577b04[_0x676c('0x8')]==_0x577b04['linkedid']&&_0x577b04[_0x676c('0x17')]!='OutgoingSpoolFailed'){utils['info'](util[_0x676c('0xa')](_0x676c('0x18'),_0x577b04[_0x676c('0x8')],_0x577b04['context'],_0x577b04[_0x676c('0x19')]));channels[_0x577b04[_0x676c('0x8')]]={'uniqueid':_0x577b04[_0x676c('0x8')],'accountcode':_0x577b04[_0x676c('0xf')],'source':_0x577b04[_0x676c('0x1a')],'destination':_0x577b04[_0x676c('0x19')],'destinationcontext':_0x577b04[_0x676c('0x1b')],'channel':_0x577b04['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x676c('0x3'),'amaflags':_0x676c('0x1c')};}}catch(_0x5f409b){utils[_0x676c('0x1d')](util[_0x676c('0xa')](_0x676c('0x16'),_0x577b04[_0x676c('0x8')]),_0x5f409b);}};exports[_0x676c('0x1e')]=function(_0x570b9d){try{utils[_0x676c('0x15')](util['format'](_0x676c('0x1f'),_0x570b9d[_0x676c('0x8')]),_0x570b9d);if(!_[_0x676c('0x20')](channels[_0x570b9d[_0x676c('0x8')]])&&_0x570b9d[_0x676c('0x21')]==0x6){utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x23'),_0x570b9d['uniqueid'],_0x570b9d[_0x676c('0x1b')],_0x570b9d['channel']));if(_[_0x676c('0x20')](channels[_0x570b9d['uniqueid']][_0x676c('0x24')])){channels[_0x570b9d[_0x676c('0x8')]][_0x676c('0x24')]=utils['now']();}}else if(!_[_0x676c('0x20')](channels[_0x570b9d[_0x676c('0x25')]])&&_0x570b9d[_0x676c('0x21')]==0x6&&_0x570b9d[_0x676c('0x1b')]!=_0x676c('0x26')){utils['info'](util[_0x676c('0xa')](_0x676c('0x27'),_0x570b9d[_0x676c('0x8')],_0x570b9d[_0x676c('0x25')],_0x570b9d['context'],_0x570b9d[_0x676c('0x17')]));channels[_0x570b9d[_0x676c('0x25')]][_0x676c('0xf')]=_0x570b9d['accountcode'];channels[_0x570b9d[_0x676c('0x25')]][_0x676c('0x28')]=_0x570b9d['channel'];if(_[_0x676c('0x20')](channels[_0x570b9d['linkedid']][_0x676c('0x29')])){channels[_0x570b9d[_0x676c('0x25')]][_0x676c('0x29')]=utils['now']();}channels[_0x570b9d[_0x676c('0x25')]]['disposition']=dispositions[_[_0x676c('0x2a')](_0x570b9d['channelstate'])]||_0x676c('0x5');}}catch(_0x2ae607){utils[_0x676c('0x1d')](util[_0x676c('0xa')](_0x676c('0x1f'),_0x570b9d['uniqueid']),_0x2ae607);}};exports[_0x676c('0x2b')]=function(_0x7bdc9b){try{if(!_[_0x676c('0x20')](channels[_0x7bdc9b[_0x676c('0x8')]])){utils[_0x676c('0x15')](util[_0x676c('0xa')](_0x676c('0x2c'),_0x7bdc9b[_0x676c('0x8')]),_0x7bdc9b);if(_[_0x676c('0x20')](channels[_0x7bdc9b[_0x676c('0x8')]][_0x676c('0x2d')])){channels[_0x7bdc9b[_0x676c('0x8')]][_0x676c('0x2d')]=_0x7bdc9b[_0x676c('0x2e')]+'\x20<'+_0x7bdc9b[_0x676c('0x1a')]+'>';}utils['info'](util['format'](_0x676c('0x2f'),_0x7bdc9b[_0x676c('0x8')],channels[_0x7bdc9b['uniqueid']]['callerid'],_0x7bdc9b[_0x676c('0x30')]));channels[_0x7bdc9b[_0x676c('0x8')]][_0x676c('0x31')]=utils['now']();channels[_0x7bdc9b['uniqueid']][_0x676c('0x32')]=utils[_0x676c('0x33')](channels[_0x7bdc9b['uniqueid']][_0x676c('0x31')],channels[_0x7bdc9b[_0x676c('0x8')]][_0x676c('0x34')]);channels[_0x7bdc9b[_0x676c('0x8')]][_0x676c('0x35')]=channels[_0x7bdc9b[_0x676c('0x8')]][_0x676c('0x29')]?utils[_0x676c('0x33')](channels[_0x7bdc9b[_0x676c('0x8')]][_0x676c('0x31')],channels[_0x7bdc9b['uniqueid']]['answertime']):0x0;writeDB(channels[_0x7bdc9b[_0x676c('0x8')]]);}}catch(_0x3feade){utils[_0x676c('0x1d')](util[_0x676c('0xa')]('[%s][calls][hangup]',_0x7bdc9b[_0x676c('0x8')]),_0x3feade);}};exports[_0x676c('0x36')]=function(_0x1874a4){try{if(!_[_0x676c('0x20')](channels[_0x1874a4[_0x676c('0x37')]])){utils[_0x676c('0x15')](util[_0x676c('0xa')](_0x676c('0x38'),_0x1874a4['origtransfereruniqueid']),_0x1874a4);if(channels[_0x1874a4[_0x676c('0x37')]]['channel']==_0x1874a4[_0x676c('0x39')]){utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x3a'),_0x1874a4['origtransfereruniqueid'],_0x1874a4[_0x676c('0x37')],_0x1874a4[_0x676c('0x3b')]));channels[_0x1874a4[_0x676c('0x37')]][_0x676c('0x28')]=_0x1874a4['secondtransfererchannel'];channels[_0x1874a4['localtwolinkedid']]['userfield']='_attended';}else if(channels[_0x1874a4[_0x676c('0x37')]][_0x676c('0x17')]=_0x1874a4[_0x676c('0x3c')]){utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x3a'),_0x1874a4[_0x676c('0x3d')],_0x1874a4[_0x676c('0x37')],_0x1874a4[_0x676c('0x3e')]));channels[_0x1874a4[_0x676c('0x37')]][_0x676c('0x28')]=_0x1874a4[_0x676c('0x3e')];channels[_0x1874a4['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x19cfd7){utils['error'](util[_0x676c('0xa')](_0x676c('0x38'),_0x1874a4[_0x676c('0x3d')]),_0x19cfd7);}};exports[_0x676c('0x3f')]=function(_0x5e006d){try{if(!_[_0x676c('0x20')](channels[_0x5e006d[_0x676c('0x8')]])){utils[_0x676c('0x15')](util[_0x676c('0xa')](_0x676c('0x40'),_0x5e006d[_0x676c('0x8')]),_0x5e006d);channels[_0x5e006d['uniqueid']][_0x676c('0x41')]=utils['now']();utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x42'),_0x5e006d[_0x676c('0x8')],channels[_0x5e006d[_0x676c('0x8')]][_0x676c('0x41')]));}}catch(_0x5bf40f){utils['error'](util[_0x676c('0xa')]('[%s][calls][musiconholdstart]',_0x5e006d[_0x676c('0x8')]),_0x5bf40f);}};exports[_0x676c('0x43')]=function(_0xabbdb2){try{if(!_[_0x676c('0x20')](channels[_0xabbdb2['uniqueid']])){utils[_0x676c('0x15')](util[_0x676c('0xa')](_0x676c('0x44'),_0xabbdb2[_0x676c('0x8')]),_0xabbdb2);if(!_[_0x676c('0x20')](channels[_0xabbdb2[_0x676c('0x8')]]['musiconholdstartAt'])){channels[_0xabbdb2[_0x676c('0x8')]][_0x676c('0x45')]+=utils[_0x676c('0x33')](utils['now'](),channels[_0xabbdb2[_0x676c('0x8')]][_0x676c('0x41')]);utils[_0x676c('0x22')](util['format'](_0x676c('0x46'),_0xabbdb2[_0x676c('0x8')],channels[_0xabbdb2[_0x676c('0x8')]]['mohtime']));delete channels[_0xabbdb2['uniqueid']][_0x676c('0x41')];}}}catch(_0x52f0e6){utils['error'](util[_0x676c('0xa')](_0x676c('0x44'),_0xabbdb2[_0x676c('0x8')]),_0x52f0e6);}};exports['varset']=function(_0x1bf7f0){try{if(!_[_0x676c('0x20')](channels[_0x1bf7f0['uniqueid']])){utils[_0x676c('0x15')](util[_0x676c('0xa')](_0x676c('0x47'),_0x1bf7f0[_0x676c('0x8')]),_0x1bf7f0);if(!_['isNil'](_0x1bf7f0['variable'][_0x676c('0x48')])){utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x49'),_0x1bf7f0[_0x676c('0x8')],_0x1bf7f0['value']));channels[_0x1bf7f0[_0x676c('0x8')]]['source']=_0x1bf7f0['value'];}if(!_[_0x676c('0x20')](_0x1bf7f0[_0x676c('0x4a')]['xmd-phone'])){utils['info'](util[_0x676c('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1bf7f0[_0x676c('0x8')],_0x1bf7f0[_0x676c('0x4b')]));channels[_0x1bf7f0[_0x676c('0x8')]][_0x676c('0x4c')]=_0x1bf7f0['value'];channels[_0x1bf7f0[_0x676c('0x8')]]['callerid']='\x22'+_0x1bf7f0[_0x676c('0x4b')]+'\x22\x20<'+_0x1bf7f0[_0x676c('0x4b')]+'>';}if(!_[_0x676c('0x20')](_0x1bf7f0[_0x676c('0x4a')][_0x676c('0x4d')])||!_[_0x676c('0x20')](_0x1bf7f0[_0x676c('0x4a')]['xmd-callerid'])){utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x4e'),_0x1bf7f0['uniqueid'],!_['isNil'](_0x1bf7f0['variable'][_0x676c('0x4d')])?'xmd-callerid-preview':_0x676c('0x4f'),_0x1bf7f0[_0x676c('0x4b')]));channels[_0x1bf7f0[_0x676c('0x8')]][_0x676c('0x2d')]=_0x1bf7f0['value'];}if(!_[_0x676c('0x20')](_0x1bf7f0['variable']['xmd-queue'])||!_[_0x676c('0x20')](_0x1bf7f0[_0x676c('0x4a')][_0x676c('0x50')])){utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x4e'),_0x1bf7f0[_0x676c('0x8')],!_[_0x676c('0x20')](_0x1bf7f0[_0x676c('0x4a')][_0x676c('0x51')])?_0x676c('0x51'):'xmcs-queue',_0x1bf7f0[_0x676c('0x4b')]));channels[_0x1bf7f0['uniqueid']][_0x676c('0x52')]='Queue';channels[_0x1bf7f0[_0x676c('0x8')]][_0x676c('0x53')]=_0x1bf7f0[_0x676c('0x4b')];channels[_0x1bf7f0[_0x676c('0x8')]][_0x676c('0xc')]=!![];}if(!_[_0x676c('0x20')](_0x1bf7f0['variable']['xmd-contactid'])){utils['info'](util[_0x676c('0xa')](_0x676c('0x54'),_0x1bf7f0['uniqueid'],_0x1bf7f0[_0x676c('0x4b')]));channels[_0x1bf7f0[_0x676c('0x8')]][_0x676c('0x55')]=_0x1bf7f0[_0x676c('0x4b')];}if(!_[_0x676c('0x20')](_0x1bf7f0[_0x676c('0x4a')]['xmd-cdrtype'])){utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x56'),_0x1bf7f0[_0x676c('0x8')],_0x1bf7f0[_0x676c('0x4b')]));channels[_0x1bf7f0[_0x676c('0x8')]][_0x676c('0x57')]=_0x1bf7f0[_0x676c('0x4b')];}if(!_[_0x676c('0x20')](_0x1bf7f0[_0x676c('0x4a')][_0x676c('0x58')])){utils['info'](util[_0x676c('0xa')](_0x676c('0x59'),_0x1bf7f0['uniqueid'],_0x1bf7f0['value']));channels[_0x1bf7f0[_0x676c('0x8')]][_0x676c('0x5a')]=_0x1bf7f0[_0x676c('0x4b')];}if(!_[_0x676c('0x20')](_0x1bf7f0[_0x676c('0x4a')]['sipcallid'])){utils[_0x676c('0x22')](util[_0x676c('0xa')](_0x676c('0x5b'),_0x1bf7f0[_0x676c('0x8')],_0x1bf7f0['value']));channels[_0x1bf7f0[_0x676c('0x8')]][_0x676c('0x5c')]=_0x1bf7f0[_0x676c('0x4b')];}}}catch(_0x49a477){utils[_0x676c('0x1d')](util[_0x676c('0xa')](_0x676c('0x47'),_0x1bf7f0[_0x676c('0x8')]),_0x49a477);}};exports[_0x676c('0x5d')]=function(_0x4cacbc){try{if(!_[_0x676c('0x20')](channels[_0x4cacbc[_0x676c('0x8')]])){utils[_0x676c('0x15')](util[_0x676c('0xa')](_0x676c('0x5e'),_0x4cacbc[_0x676c('0x8')]),_0x4cacbc);utils['info'](util[_0x676c('0xa')](_0x676c('0x5f'),_0x4cacbc[_0x676c('0x8')],_0x4cacbc[_0x676c('0x60')],_0x4cacbc[_0x676c('0x61')]));if(_0x4cacbc[_0x676c('0x60')][_0x676c('0x62')]()=='set'&&_[_0x676c('0x63')](_0x4cacbc[_0x676c('0x61')][_0x676c('0x62')](),_0x676c('0x64'))){var _0x1ad763=_0x4cacbc[_0x676c('0x61')][_0x676c('0x65')]('=');var _0x50d884=_0x1ad763[0x0][_0x676c('0x66')](_0x1ad763[0x0][_0x676c('0x67')]('(')+0x1,_0x1ad763[0x0][_0x676c('0x67')](')'));var _0xc58064=_0x1ad763[0x1];channels[_0x4cacbc['uniqueid']][_0x50d884]=_0xc58064;}if(!_[_0x676c('0x68')]([_0x676c('0x2b'),_0x676c('0x69'),_0x676c('0x6a'),_0x676c('0x6b'),_0x676c('0x6c')],_0x4cacbc['application'][_0x676c('0x62')]())){channels[_0x4cacbc[_0x676c('0x8')]][_0x676c('0x52')]=_0x4cacbc[_0x676c('0x60')];channels[_0x4cacbc[_0x676c('0x8')]][_0x676c('0x53')]=_0x4cacbc[_0x676c('0x61')];}}}catch(_0x4fc8c6){utils[_0x676c('0x1d')](util[_0x676c('0xa')](_0x676c('0x5e'),_0x4cacbc[_0x676c('0x8')]),_0x4fc8c6);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 6dcb76b..a8267d9 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 _0x933b=['[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x329169,_0x4a1e72){var _0x3d5690=function(_0x1eb5d1){while(--_0x1eb5d1){_0x329169['push'](_0x329169['shift']());}};_0x3d5690(++_0x4a1e72);}(_0x933b,0xf7));var _0xb933=function(_0x4540a8,_0x56056f){_0x4540a8=_0x4540a8-0x0;var _0x168164=_0x933b[_0x4540a8];return _0x168164;};'use strict';var utils=require(_0xb933('0x0'));exports['connect']=function(){utils[_0xb933('0x1')](_0xb933('0x2'));};exports[_0xb933('0x3')]=function(){utils[_0xb933('0x1')](_0xb933('0x4'));};exports[_0xb933('0x5')]=function(){utils[_0xb933('0x1')](_0xb933('0x6'));};exports[_0xb933('0x7')]=function(_0x60dcc9){utils[_0xb933('0x7')](_0xb933('0x8'),_0x60dcc9);};exports[_0xb933('0x9')]=function(){utils['info']('[core]\x20close');};exports[_0xb933('0xa')]=function(_0x3fcf1e){}; \ No newline at end of file +var _0x8cb5=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','./utils','connect','info'];(function(_0x3d773f,_0x3462b3){var _0x22bf3a=function(_0x2d295e){while(--_0x2d295e){_0x3d773f['push'](_0x3d773f['shift']());}};_0x22bf3a(++_0x3462b3);}(_0x8cb5,0x19f));var _0x58cb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8cb5[_0x3947c9];return _0x2e7871;};'use strict';var utils=require(_0x58cb('0x0'));exports[_0x58cb('0x1')]=function(){utils[_0x58cb('0x2')](_0x58cb('0x3'));};exports[_0x58cb('0x4')]=function(){utils[_0x58cb('0x2')](_0x58cb('0x5'));};exports[_0x58cb('0x6')]=function(){utils['info'](_0x58cb('0x7'));};exports[_0x58cb('0x8')]=function(_0x46d9a5){utils[_0x58cb('0x8')](_0x58cb('0x9'),_0x46d9a5);};exports[_0x58cb('0xa')]=function(){utils[_0x58cb('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x2cda8f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 4a2bd67..ace933f 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 _0xb671=['connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','assign','complete','duration','diffTime','endtime','billableseconds','lodash','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','connectedlinenum','dialstatus','request','uniqueid','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','error','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','now','[%s][dials][dialend]','ANSWER'];(function(_0xdea0a1,_0x3bc98e){var _0x39b1e3=function(_0x1c5d4a){while(--_0x1c5d4a){_0xdea0a1['push'](_0xdea0a1['shift']());}};_0x39b1e3(++_0x3bc98e);}(_0xb671,0xcf));var _0x1b67=function(_0x48d23b,_0x10b494){_0x48d23b=_0x48d23b-0x0;var _0x1bb0e0=_0xb671[_0x48d23b];return _0x1bb0e0;};'use strict';var _=require(_0x1b67('0x0'));var util=require('util');var utils=require(_0x1b67('0x1'));var dials={};function writeDB(_0x1c7dff){utils['info'](util[_0x1b67('0x2')](_0x1b67('0x3'),_0x1c7dff['uniqueid'],_0x1c7dff['channel'],_0x1c7dff[_0x1b67('0x4')],_0x1c7dff[_0x1b67('0x5')],_0x1c7dff[_0x1b67('0x6')],_0x1c7dff[_0x1b67('0x7')]));utils[_0x1b67('0x8')]('CreateVoiceDialReport',_0x1c7dff);delete dials[_0x1c7dff[_0x1b67('0x9')]];}exports[_0x1b67('0xa')]=function(_0x98930d){try{utils[_0x1b67('0xb')](util['format'](_0x1b67('0xc'),_0x98930d[_0x1b67('0x9')]),_0x98930d);utils[_0x1b67('0xd')](util['format'](_0x1b67('0xe'),_0x98930d['uniqueid'],_0x98930d[_0x1b67('0xf')],_0x98930d[_0x1b67('0x10')]));if(_0x98930d[_0x1b67('0xf')][_0x1b67('0x11')]()==_0x1b67('0x12')&&_['startsWith'](_0x98930d[_0x1b67('0x10')][_0x1b67('0x11')](),_0x1b67('0x13'))){var _0x285499=_0x98930d[_0x1b67('0x10')]['split']('=');dials[_0x98930d[_0x1b67('0x9')]]={'routeId':_0x285499[0x1]};}}catch(_0x3c311c){utils[_0x1b67('0x14')](util[_0x1b67('0x2')]('[%s][dials][newexten]',_0x98930d[_0x1b67('0x9')]),_0x3c311c);}};exports['varset']=function(_0xe2c10d){try{utils[_0x1b67('0xb')](util[_0x1b67('0x2')](_0x1b67('0x15'),_0xe2c10d[_0x1b67('0x9')]),_0xe2c10d);if(!_[_0x1b67('0x16')](_0xe2c10d[_0x1b67('0x17')][_0x1b67('0x18')])){utils['info'](util[_0x1b67('0x2')](_0x1b67('0x19'),_0xe2c10d[_0x1b67('0x9')],_0xe2c10d[_0x1b67('0x1a')]));dials[_0xe2c10d[_0x1b67('0x9')]]={'routeId':_0xe2c10d[_0x1b67('0x1a')]};}}catch(_0x32905c){utils[_0x1b67('0x14')](util[_0x1b67('0x2')]('[%s][dials][varset]',_0xe2c10d[_0x1b67('0x9')]),_0x32905c);}};exports[_0x1b67('0x1b')]=function(_0x4e4ec5){try{if(!_[_0x1b67('0x16')](dials[_0x4e4ec5[_0x1b67('0x9')]])){utils['debug'](util[_0x1b67('0x2')](_0x1b67('0x1c'),_0x4e4ec5[_0x1b67('0x9')]),_0x4e4ec5);dials[_0x4e4ec5[_0x1b67('0x9')]]=_['assign'](dials[_0x4e4ec5['uniqueid']],_0x4e4ec5);dials[_0x4e4ec5[_0x1b67('0x9')]][_0x1b67('0x1d')]=utils[_0x1b67('0x1e')]();dials[_0x4e4ec5['uniqueid']]['lastevent']='called';utils[_0x1b67('0xd')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x4e4ec5[_0x1b67('0x9')],dials[_0x4e4ec5['uniqueid']][_0x1b67('0x1d')]));}}catch(_0x556a38){utils[_0x1b67('0x14')](util[_0x1b67('0x2')](_0x1b67('0x1c'),_0x4e4ec5[_0x1b67('0x9')]),_0x556a38);}};exports['dialend']=function(_0xe42dbe){try{if(!_['isNil'](dials[_0xe42dbe['uniqueid']])){utils[_0x1b67('0xb')](util[_0x1b67('0x2')](_0x1b67('0x1f'),_0xe42dbe[_0x1b67('0x9')]),_0xe42dbe);dials[_0xe42dbe[_0x1b67('0x9')]][_0x1b67('0x7')]=_0xe42dbe[_0x1b67('0x7')];if(_0xe42dbe[_0x1b67('0x7')]==_0x1b67('0x20')){dials[_0xe42dbe[_0x1b67('0x9')]]=_['assign'](dials[_0xe42dbe[_0x1b67('0x9')]],_0xe42dbe);dials[_0xe42dbe['uniqueid']]['answertime']=utils['now']();dials[_0xe42dbe[_0x1b67('0x9')]]['lastevent']=_0x1b67('0x21');utils[_0x1b67('0xd')](util['format'](_0x1b67('0x22'),_0xe42dbe[_0x1b67('0x9')],_0xe42dbe[_0x1b67('0x7')],dials[_0xe42dbe['uniqueid']][_0x1b67('0x23')]));}else{utils['info'](util[_0x1b67('0x2')](_0x1b67('0x24'),_0xe42dbe[_0x1b67('0x9')],_0xe42dbe[_0x1b67('0x7')]));}}}catch(_0x213dd5){utils[_0x1b67('0x14')](util[_0x1b67('0x2')]('[%s][dials][dialend]',_0xe42dbe[_0x1b67('0x9')]),_0x213dd5);}};exports[_0x1b67('0x25')]=function(_0x3ef880){try{if(!_['isNil'](dials[_0x3ef880[_0x1b67('0x9')]])){utils[_0x1b67('0xb')](util['format'](_0x1b67('0x26'),_0x3ef880[_0x1b67('0x9')]),_0x3ef880);utils['info'](util[_0x1b67('0x2')](_0x1b67('0x27'),_0x3ef880[_0x1b67('0x9')],_0x3ef880[_0x1b67('0x5')],_0x3ef880[_0x1b67('0x28')],_0x3ef880[_0x1b67('0x29')]));dials[_0x3ef880[_0x1b67('0x9')]]=_[_0x1b67('0x2a')](dials[_0x3ef880[_0x1b67('0x9')]],{'endtime':utils[_0x1b67('0x1e')](),'lastevent':_0x1b67('0x2b')});dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2c')]=utils[_0x1b67('0x2d')](dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2e')],dials[_0x3ef880['uniqueid']]['starttime']);dials[_0x3ef880[_0x1b67('0x9')]]['holdtime']=utils[_0x1b67('0x2d')](dials[_0x3ef880[_0x1b67('0x9')]]['answertime']||dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2e')],dials[_0x3ef880[_0x1b67('0x9')]]['starttime']);dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2f')]=dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x23')]?utils['diffTime'](dials[_0x3ef880[_0x1b67('0x9')]][_0x1b67('0x2e')],dials[_0x3ef880[_0x1b67('0x9')]]['answertime']):0x0;writeDB(dials[_0x3ef880[_0x1b67('0x9')]]);}}catch(_0x4caa2d){utils[_0x1b67('0x14')](util[_0x1b67('0x2')](_0x1b67('0x26'),_0x3ef880[_0x1b67('0x9')]),_0x4caa2d);}}; \ No newline at end of file +var _0x2e1d=['calleridnum','dialstatus','request','CreateVoiceDialReport','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','assign','starttime','lastevent','called','[%s][dials][dialbegin]','dialend','debug','[%s][dials][dialend]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','uniqueid','channel','dialstring'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x2e1d,0x8e));var _0xd2e1=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x2e1d[_0x5fa520];return _0x1bf6c4;};'use strict';var _=require(_0xd2e1('0x0'));var util=require(_0xd2e1('0x1'));var utils=require(_0xd2e1('0x2'));var dials={};function writeDB(_0x5f391d){utils[_0xd2e1('0x3')](util[_0xd2e1('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x5f391d[_0xd2e1('0x5')],_0x5f391d[_0xd2e1('0x6')],_0x5f391d[_0xd2e1('0x7')],_0x5f391d[_0xd2e1('0x8')],_0x5f391d['connectedlinenum'],_0x5f391d[_0xd2e1('0x9')]));utils[_0xd2e1('0xa')](_0xd2e1('0xb'),_0x5f391d);delete dials[_0x5f391d[_0xd2e1('0x5')]];}exports['newexten']=function(_0x19ef18){try{utils['debug'](util[_0xd2e1('0x4')]('[%s][dials][newexten]',_0x19ef18['uniqueid']),_0x19ef18);utils[_0xd2e1('0x3')](util[_0xd2e1('0x4')](_0xd2e1('0xc'),_0x19ef18[_0xd2e1('0x5')],_0x19ef18['application'],_0x19ef18[_0xd2e1('0xd')]));if(_0x19ef18[_0xd2e1('0xe')][_0xd2e1('0xf')]()==_0xd2e1('0x10')&&_[_0xd2e1('0x11')](_0x19ef18[_0xd2e1('0xd')]['toLowerCase'](),_0xd2e1('0x12'))){var _0x4bf58f=_0x19ef18[_0xd2e1('0xd')][_0xd2e1('0x13')]('=');dials[_0x19ef18[_0xd2e1('0x5')]]={'routeId':_0x4bf58f[0x1]};}}catch(_0x241825){utils[_0xd2e1('0x14')](util[_0xd2e1('0x4')](_0xd2e1('0x15'),_0x19ef18[_0xd2e1('0x5')]),_0x241825);}};exports[_0xd2e1('0x16')]=function(_0x51f81b){try{utils['debug'](util[_0xd2e1('0x4')]('[%s][dials][varset]',_0x51f81b['uniqueid']),_0x51f81b);if(!_[_0xd2e1('0x17')](_0x51f81b[_0xd2e1('0x18')]['outboundrouteid'])){utils[_0xd2e1('0x3')](util[_0xd2e1('0x4')](_0xd2e1('0x19'),_0x51f81b[_0xd2e1('0x5')],_0x51f81b['value']));dials[_0x51f81b[_0xd2e1('0x5')]]={'routeId':_0x51f81b[_0xd2e1('0x1a')]};}}catch(_0xc9df3d){utils[_0xd2e1('0x14')](util[_0xd2e1('0x4')](_0xd2e1('0x1b'),_0x51f81b[_0xd2e1('0x5')]),_0xc9df3d);}};exports[_0xd2e1('0x1c')]=function(_0x1a656d){try{if(!_[_0xd2e1('0x17')](dials[_0x1a656d[_0xd2e1('0x5')]])){utils['debug'](util[_0xd2e1('0x4')]('[%s][dials][dialbegin]',_0x1a656d['uniqueid']),_0x1a656d);dials[_0x1a656d[_0xd2e1('0x5')]]=_[_0xd2e1('0x1d')](dials[_0x1a656d['uniqueid']],_0x1a656d);dials[_0x1a656d[_0xd2e1('0x5')]][_0xd2e1('0x1e')]=utils['now']();dials[_0x1a656d[_0xd2e1('0x5')]][_0xd2e1('0x1f')]=_0xd2e1('0x20');utils['info'](util[_0xd2e1('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1a656d['uniqueid'],dials[_0x1a656d['uniqueid']][_0xd2e1('0x1e')]));}}catch(_0x230d74){utils[_0xd2e1('0x14')](util[_0xd2e1('0x4')](_0xd2e1('0x21'),_0x1a656d['uniqueid']),_0x230d74);}};exports[_0xd2e1('0x22')]=function(_0x4b8d11){try{if(!_['isNil'](dials[_0x4b8d11[_0xd2e1('0x5')]])){utils[_0xd2e1('0x23')](util['format'](_0xd2e1('0x24'),_0x4b8d11['uniqueid']),_0x4b8d11);dials[_0x4b8d11[_0xd2e1('0x5')]][_0xd2e1('0x9')]=_0x4b8d11['dialstatus'];if(_0x4b8d11['dialstatus']==_0xd2e1('0x25')){dials[_0x4b8d11[_0xd2e1('0x5')]]=_['assign'](dials[_0x4b8d11['uniqueid']],_0x4b8d11);dials[_0x4b8d11['uniqueid']][_0xd2e1('0x26')]=utils[_0xd2e1('0x27')]();dials[_0x4b8d11[_0xd2e1('0x5')]][_0xd2e1('0x1f')]=_0xd2e1('0x28');utils[_0xd2e1('0x3')](util[_0xd2e1('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x4b8d11[_0xd2e1('0x5')],_0x4b8d11[_0xd2e1('0x9')],dials[_0x4b8d11[_0xd2e1('0x5')]]['answertime']));}else{utils[_0xd2e1('0x3')](util[_0xd2e1('0x4')](_0xd2e1('0x29'),_0x4b8d11[_0xd2e1('0x5')],_0x4b8d11[_0xd2e1('0x9')]));}}}catch(_0x1f0021){utils[_0xd2e1('0x14')](util[_0xd2e1('0x4')](_0xd2e1('0x24'),_0x4b8d11[_0xd2e1('0x5')]),_0x1f0021);}};exports[_0xd2e1('0x2a')]=function(_0x23be7a){try{if(!_[_0xd2e1('0x17')](dials[_0x23be7a['uniqueid']])){utils[_0xd2e1('0x23')](util[_0xd2e1('0x4')](_0xd2e1('0x2b'),_0x23be7a[_0xd2e1('0x5')]),_0x23be7a);utils[_0xd2e1('0x3')](util[_0xd2e1('0x4')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x23be7a['uniqueid'],_0x23be7a[_0xd2e1('0x8')],_0x23be7a[_0xd2e1('0x2c')],_0x23be7a[_0xd2e1('0x2d')]));dials[_0x23be7a[_0xd2e1('0x5')]]=_[_0xd2e1('0x1d')](dials[_0x23be7a[_0xd2e1('0x5')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x23be7a[_0xd2e1('0x5')]]['duration']=utils[_0xd2e1('0x2e')](dials[_0x23be7a['uniqueid']][_0xd2e1('0x2f')],dials[_0x23be7a[_0xd2e1('0x5')]][_0xd2e1('0x1e')]);dials[_0x23be7a[_0xd2e1('0x5')]][_0xd2e1('0x30')]=utils[_0xd2e1('0x2e')](dials[_0x23be7a['uniqueid']][_0xd2e1('0x26')]||dials[_0x23be7a[_0xd2e1('0x5')]]['endtime'],dials[_0x23be7a[_0xd2e1('0x5')]][_0xd2e1('0x1e')]);dials[_0x23be7a[_0xd2e1('0x5')]][_0xd2e1('0x31')]=dials[_0x23be7a[_0xd2e1('0x5')]][_0xd2e1('0x26')]?utils[_0xd2e1('0x2e')](dials[_0x23be7a[_0xd2e1('0x5')]][_0xd2e1('0x2f')],dials[_0x23be7a[_0xd2e1('0x5')]][_0xd2e1('0x26')]):0x0;writeDB(dials[_0x23be7a[_0xd2e1('0x5')]]);}}catch(_0x1ad20c){utils[_0xd2e1('0x14')](util[_0xd2e1('0x4')](_0xd2e1('0x2b'),_0x23be7a[_0xd2e1('0x5')]),_0x1ad20c);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index e8234c3..79ae7cf 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 _0x0ac5=['queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','asterisk','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]'];(function(_0x14a683,_0x40a302){var _0x4bedd6=function(_0x5a2571){while(--_0x5a2571){_0x14a683['push'](_0x14a683['shift']());}};_0x4bedd6(++_0x40a302);}(_0x0ac5,0xe1));var _0x50ac=function(_0x180d02,_0xf063d9){_0x180d02=_0x180d02-0x0;var _0x2d7a2b=_0x0ac5[_0x180d02];return _0x2d7a2b;};var AsteriskManager=require('asterisk-manager');var config=require(_0x50ac('0x0'));var utils=require(_0x50ac('0x1'));var util=require('util');var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0x50ac('0x2')]['username'],config['asterisk'][_0x50ac('0x3')],!![]);ami[_0x50ac('0x4')]();if(config[_0x50ac('0x5')]&&config[_0x50ac('0x5')][_0x50ac('0x6')]){utils['info'](_0x50ac('0x7'));}else{var agents=require('./agents.controller');var calls=require(_0x50ac('0x8'));var queues=require(_0x50ac('0x9'));var recordings=require('./recordings.controller');var members=require(_0x50ac('0xa'));var dials=require('./dials.controller');var transfers=require(_0x50ac('0xb'));var core=require(_0x50ac('0xc'));ami['on'](_0x50ac('0xd'),core['connect']);ami['on'](_0x50ac('0xe'),core[_0x50ac('0xe')]);ami['on'](_0x50ac('0xf'),core['fullybooted']);ami['on']('error',core[_0x50ac('0x10')]);ami['on'](_0x50ac('0x11'),core[_0x50ac('0x11')]);ami['on'](_0x50ac('0x12'),core[_0x50ac('0x12')]);ami['on']('devicestatechange',function(_0x443214){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x15'),_0x443214[_0x50ac('0x16')]),_0x443214);members[_0x50ac('0x17')](_0x443214);}catch(_0x6d8c95){utils[_0x50ac('0x10')](util['format'](_0x50ac('0x15'),_0x443214[_0x50ac('0x16')]),_0x6d8c95);}});ami['on'](_0x50ac('0x18'),function(_0x585ea8){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x19'),_0x585ea8[_0x50ac('0x1a')]),_0x585ea8);agents['agentcalled'](_0x585ea8);}catch(_0x58fc2b){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x19'),_0x585ea8[_0x50ac('0x1a')]),_0x58fc2b);}});ami['on']('agentringnoanswer',function(_0x4410c3){try{utils[_0x50ac('0x13')](util['format'](_0x50ac('0x1b'),_0x4410c3[_0x50ac('0x1a')]),_0x4410c3);agents[_0x50ac('0x1c')](_0x4410c3);}catch(_0xc3409b){utils[_0x50ac('0x10')](util[_0x50ac('0x14')]('[%s][index][agentringnoanswer]',_0x4410c3[_0x50ac('0x1a')]),_0xc3409b);}});ami['on'](_0x50ac('0x1d'),function(_0x1a49a6){try{utils[_0x50ac('0x13')](util['format'](_0x50ac('0x1e'),_0x1a49a6[_0x50ac('0x1a')]),_0x1a49a6);agents[_0x50ac('0x1d')](_0x1a49a6);queues[_0x50ac('0x1d')](_0x1a49a6);}catch(_0x52d222){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x1e'),_0x1a49a6[_0x50ac('0x1a')]),_0x52d222);}});ami['on']('agentcomplete',function(_0x350ded){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x1f'),_0x350ded[_0x50ac('0x1a')]),_0x350ded);agents[_0x50ac('0x20')](_0x350ded);queues['agentcomplete'](_0x350ded);members[_0x50ac('0x20')](_0x350ded);}catch(_0x1ade65){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x1f'),_0x350ded[_0x50ac('0x1a')]),_0x1ade65);}});ami['on'](_0x50ac('0x21'),function(_0x2bacdc){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')]('[%s][index][queuecallerabandon]',_0x2bacdc[_0x50ac('0x1a')]),_0x2bacdc);agents[_0x50ac('0x21')](_0x2bacdc);queues[_0x50ac('0x21')](_0x2bacdc);}catch(_0x2480c0){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x22'),_0x2bacdc[_0x50ac('0x1a')]),_0x2480c0);}});ami['on'](_0x50ac('0x23'),function(_0x25a3bd){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x24'),_0x25a3bd[_0x50ac('0x1a')]),_0x25a3bd);queues[_0x50ac('0x23')](_0x25a3bd);recordings[_0x50ac('0x23')](_0x25a3bd);}catch(_0x35d729){utils[_0x50ac('0x10')](util['format'](_0x50ac('0x24'),_0x25a3bd[_0x50ac('0x1a')]),_0x35d729);}});ami['on'](_0x50ac('0x25'),function(_0x3ee2e6){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x26'),_0x3ee2e6[_0x50ac('0x1a')]),_0x3ee2e6);queues[_0x50ac('0x25')](_0x3ee2e6);}catch(_0x57177e){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x26'),_0x3ee2e6[_0x50ac('0x1a')]),_0x57177e);}});ami['on'](_0x50ac('0x27'),function(_0x3cb332){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x28'),_0x3cb332['uniqueid']),_0x3cb332);queues[_0x50ac('0x27')](_0x3cb332);calls[_0x50ac('0x27')](_0x3cb332);}catch(_0x2c1e63){utils['error'](util['format'](_0x50ac('0x28'),_0x3cb332['uniqueid']),_0x2c1e63);}});ami['on'](_0x50ac('0x29'),function(_0x2309ff){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x2a'),_0x2309ff[_0x50ac('0x1a')]),_0x2309ff);queues[_0x50ac('0x29')](_0x2309ff);calls[_0x50ac('0x29')](_0x2309ff);}catch(_0x222d4a){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x2a'),_0x2309ff['uniqueid']),_0x222d4a);}});ami['on']('newstate',function(_0x4a5eb3){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x2b'),_0x4a5eb3['uniqueid']),_0x4a5eb3);calls[_0x50ac('0x2c')](_0x4a5eb3);recordings[_0x50ac('0x2c')](_0x4a5eb3);}catch(_0x2812cb){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x2b'),_0x4a5eb3[_0x50ac('0x1a')]),_0x2812cb);}});ami['on'](_0x50ac('0x2d'),function(_0x3f904c){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')]('[%s][index][hangup]',_0x3f904c[_0x50ac('0x1a')]),_0x3f904c);calls['hangup'](_0x3f904c);recordings[_0x50ac('0x2d')](_0x3f904c);dials[_0x50ac('0x2d')](_0x3f904c);agents[_0x50ac('0x2d')](_0x3f904c);queues[_0x50ac('0x2d')](_0x3f904c);}catch(_0x363416){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x2e'),_0x3f904c[_0x50ac('0x1a')]),_0x363416);}});ami['on']('cdr',function(_0x440ca5){try{utils[_0x50ac('0x13')](util['format'](_0x50ac('0x2f'),_0x440ca5['uniqueid']),_0x440ca5);members[_0x50ac('0x30')](_0x440ca5);}catch(_0x4bc67f){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x2f'),_0x440ca5[_0x50ac('0x1a')]),_0x4bc67f);}});ami['on'](_0x50ac('0x31'),function(_0x1ae230){try{utils['debug'](util[_0x50ac('0x14')]('[%s][index][blindtransfer]',_0x1ae230[_0x50ac('0x1a')]),_0x1ae230);queues['blindtransfer'](_0x1ae230);agents[_0x50ac('0x31')](_0x1ae230);transfers[_0x50ac('0x31')](_0x1ae230);}catch(_0x4323de){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x32'),_0x1ae230[_0x50ac('0x1a')]),_0x4323de);}});ami['on'](_0x50ac('0x33'),function(_0x521236){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x34'),_0x521236[_0x50ac('0x35')]),_0x521236);queues[_0x50ac('0x33')](_0x521236);transfers['attendedtransfer'](_0x521236);agents[_0x50ac('0x33')](_0x521236);calls[_0x50ac('0x33')](_0x521236);}catch(_0x294fac){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x34'),_0x521236[_0x50ac('0x35')]),_0x294fac);}});ami['on'](_0x50ac('0x36'),function(_0x362c46){try{utils[_0x50ac('0x13')](util['format'](_0x50ac('0x37'),_0x362c46[_0x50ac('0x1a')]),_0x362c46);queues['varset'](_0x362c46);recordings[_0x50ac('0x36')](_0x362c46);calls[_0x50ac('0x36')](_0x362c46);dials[_0x50ac('0x36')](_0x362c46);}catch(_0x3f97de){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x37'),_0x362c46[_0x50ac('0x1a')]),_0x3f97de);}});ami['on'](_0x50ac('0x38'),function(_0x165379){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x39'),_0x165379['uniqueid']),_0x165379);calls['newexten'](_0x165379);recordings['newexten'](_0x165379);dials[_0x50ac('0x38')](_0x165379);}catch(_0x17f804){utils['error'](util[_0x50ac('0x14')](_0x50ac('0x39'),_0x165379[_0x50ac('0x1a')]),_0x17f804);}});ami['on'](_0x50ac('0x3a'),function(_0xa163c0){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x3b'),_0xa163c0['uniqueid']),_0xa163c0);calls[_0x50ac('0x3a')](_0xa163c0);recordings['newchannel'](_0xa163c0);}catch(_0x57d7e5){utils['error'](util[_0x50ac('0x14')](_0x50ac('0x3b'),_0xa163c0[_0x50ac('0x1a')]),_0x57d7e5);}});ami['on'](_0x50ac('0x3c'),function(_0x235146){try{utils[_0x50ac('0x13')](util[_0x50ac('0x14')](_0x50ac('0x3d'),_0x235146[_0x50ac('0x1a')]),_0x235146);dials[_0x50ac('0x3c')](_0x235146);}catch(_0x4b6ea1){utils[_0x50ac('0x10')](util[_0x50ac('0x14')](_0x50ac('0x3e'),_0x235146['uniqueid']),_0x4b6ea1);}});ami['on'](_0x50ac('0x3f'),function(_0x5a7635){try{utils['debug'](util[_0x50ac('0x14')](_0x50ac('0x40'),_0x5a7635[_0x50ac('0x1a')]),_0x5a7635);dials[_0x50ac('0x3f')](_0x5a7635);}catch(_0x94dac5){utils[_0x50ac('0x10')](util['format'](_0x50ac('0x40'),_0x5a7635['uniqueid']),_0x94dac5);}});} \ No newline at end of file +var _0x73d9=['[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup'];(function(_0x27d006,_0x1f6758){var _0x320505=function(_0x39806a){while(--_0x39806a){_0x27d006['push'](_0x27d006['shift']());}};_0x320505(++_0x1f6758);}(_0x73d9,0xd2));var _0x973d=function(_0x456d2d,_0x2837e5){_0x456d2d=_0x456d2d-0x0;var _0x21db89=_0x73d9[_0x456d2d];return _0x21db89;};var AsteriskManager=require(_0x973d('0x0'));var config=require('../../config/environment');var utils=require(_0x973d('0x1'));var util=require(_0x973d('0x2'));var ami=new AsteriskManager(config[_0x973d('0x3')]['port'],config[_0x973d('0x3')]['ip'],config['asterisk']['username'],config['asterisk'][_0x973d('0x4')],!![]);ami[_0x973d('0x5')]();if(config['xdr']&&config[_0x973d('0x6')][_0x973d('0x7')]){utils[_0x973d('0x8')](_0x973d('0x9'));}else{var agents=require(_0x973d('0xa'));var calls=require(_0x973d('0xb'));var queues=require(_0x973d('0xc'));var recordings=require(_0x973d('0xd'));var members=require(_0x973d('0xe'));var dials=require(_0x973d('0xf'));var transfers=require(_0x973d('0x10'));var core=require('./core.controller');ami['on']('connect',core[_0x973d('0x11')]);ami['on'](_0x973d('0x12'),core[_0x973d('0x12')]);ami['on'](_0x973d('0x13'),core['fullybooted']);ami['on']('error',core[_0x973d('0x14')]);ami['on']('close',core[_0x973d('0x15')]);ami['on'](_0x973d('0x16'),core[_0x973d('0x16')]);ami['on'](_0x973d('0x17'),function(_0x36a9e8){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x1a'),_0x36a9e8[_0x973d('0x1b')]),_0x36a9e8);members[_0x973d('0x17')](_0x36a9e8);}catch(_0x57d31d){utils[_0x973d('0x14')](util[_0x973d('0x19')](_0x973d('0x1a'),_0x36a9e8[_0x973d('0x1b')]),_0x57d31d);}});ami['on']('agentcalled',function(_0x4ac251){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x1c'),_0x4ac251[_0x973d('0x1d')]),_0x4ac251);agents[_0x973d('0x1e')](_0x4ac251);}catch(_0x3ebb4a){utils[_0x973d('0x14')](util[_0x973d('0x19')](_0x973d('0x1c'),_0x4ac251[_0x973d('0x1d')]),_0x3ebb4a);}});ami['on']('agentringnoanswer',function(_0x11fc22){try{utils['debug'](util[_0x973d('0x19')](_0x973d('0x1f'),_0x11fc22[_0x973d('0x1d')]),_0x11fc22);agents[_0x973d('0x20')](_0x11fc22);}catch(_0x4ac712){utils['error'](util['format']('[%s][index][agentringnoanswer]',_0x11fc22['uniqueid']),_0x4ac712);}});ami['on'](_0x973d('0x21'),function(_0x41113a){try{utils[_0x973d('0x18')](util['format'](_0x973d('0x22'),_0x41113a['uniqueid']),_0x41113a);agents[_0x973d('0x21')](_0x41113a);queues[_0x973d('0x21')](_0x41113a);}catch(_0x3afe6f){utils['error'](util[_0x973d('0x19')]('[%s][index][agentconnect]',_0x41113a[_0x973d('0x1d')]),_0x3afe6f);}});ami['on']('agentcomplete',function(_0x390850){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x23'),_0x390850[_0x973d('0x1d')]),_0x390850);agents['agentcomplete'](_0x390850);queues[_0x973d('0x24')](_0x390850);members[_0x973d('0x24')](_0x390850);}catch(_0x452c26){utils[_0x973d('0x14')](util[_0x973d('0x19')](_0x973d('0x23'),_0x390850[_0x973d('0x1d')]),_0x452c26);}});ami['on'](_0x973d('0x25'),function(_0x981da){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x26'),_0x981da[_0x973d('0x1d')]),_0x981da);agents[_0x973d('0x25')](_0x981da);queues[_0x973d('0x25')](_0x981da);}catch(_0x1b00f6){utils[_0x973d('0x14')](util['format'](_0x973d('0x26'),_0x981da[_0x973d('0x1d')]),_0x1b00f6);}});ami['on'](_0x973d('0x27'),function(_0x52d478){try{utils[_0x973d('0x18')](util[_0x973d('0x19')]('[%s][index][queuecallerjoin]',_0x52d478[_0x973d('0x1d')]),_0x52d478);queues['queuecallerjoin'](_0x52d478);recordings['queuecallerjoin'](_0x52d478);}catch(_0x5de8f8){utils[_0x973d('0x14')](util[_0x973d('0x19')]('[%s][index][queuecallerjoin]',_0x52d478[_0x973d('0x1d')]),_0x5de8f8);}});ami['on'](_0x973d('0x28'),function(_0x1d5f52){try{utils[_0x973d('0x18')](util['format'](_0x973d('0x29'),_0x1d5f52[_0x973d('0x1d')]),_0x1d5f52);queues[_0x973d('0x28')](_0x1d5f52);}catch(_0x3aee4f){utils['error'](util['format'](_0x973d('0x29'),_0x1d5f52[_0x973d('0x1d')]),_0x3aee4f);}});ami['on'](_0x973d('0x2a'),function(_0xb84440){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x2b'),_0xb84440[_0x973d('0x1d')]),_0xb84440);queues[_0x973d('0x2a')](_0xb84440);calls[_0x973d('0x2a')](_0xb84440);}catch(_0x34a735){utils['error'](util[_0x973d('0x19')](_0x973d('0x2b'),_0xb84440['uniqueid']),_0x34a735);}});ami['on']('musiconholdstop',function(_0x2e52e6){try{utils['debug'](util[_0x973d('0x19')](_0x973d('0x2c'),_0x2e52e6[_0x973d('0x1d')]),_0x2e52e6);queues[_0x973d('0x2d')](_0x2e52e6);calls[_0x973d('0x2d')](_0x2e52e6);}catch(_0x251000){utils[_0x973d('0x14')](util['format'](_0x973d('0x2c'),_0x2e52e6[_0x973d('0x1d')]),_0x251000);}});ami['on']('newstate',function(_0x216147){try{utils[_0x973d('0x18')](util[_0x973d('0x19')]('[%s][index][newstate]',_0x216147['uniqueid']),_0x216147);calls['newstate'](_0x216147);recordings[_0x973d('0x2e')](_0x216147);}catch(_0x20f5e7){utils['error'](util[_0x973d('0x19')](_0x973d('0x2f'),_0x216147[_0x973d('0x1d')]),_0x20f5e7);}});ami['on']('hangup',function(_0x5c1bbc){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x30'),_0x5c1bbc[_0x973d('0x1d')]),_0x5c1bbc);calls[_0x973d('0x31')](_0x5c1bbc);recordings[_0x973d('0x31')](_0x5c1bbc);dials[_0x973d('0x31')](_0x5c1bbc);agents[_0x973d('0x31')](_0x5c1bbc);queues[_0x973d('0x31')](_0x5c1bbc);}catch(_0x476c41){utils[_0x973d('0x14')](util[_0x973d('0x19')](_0x973d('0x30'),_0x5c1bbc[_0x973d('0x1d')]),_0x476c41);}});ami['on']('cdr',function(_0x36a7a9){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x32'),_0x36a7a9[_0x973d('0x1d')]),_0x36a7a9);members['cdr'](_0x36a7a9);}catch(_0x269a7b){utils[_0x973d('0x14')](util['format']('[%s][index][cdr]',_0x36a7a9[_0x973d('0x1d')]),_0x269a7b);}});ami['on'](_0x973d('0x33'),function(_0x19a867){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x34'),_0x19a867['uniqueid']),_0x19a867);queues[_0x973d('0x33')](_0x19a867);agents[_0x973d('0x33')](_0x19a867);transfers[_0x973d('0x33')](_0x19a867);}catch(_0x2a4195){utils['error'](util[_0x973d('0x19')]('[%s][index][blindtransfer]',_0x19a867['uniqueid']),_0x2a4195);}});ami['on'](_0x973d('0x35'),function(_0x17ba2b){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x36'),_0x17ba2b[_0x973d('0x37')]),_0x17ba2b);queues[_0x973d('0x35')](_0x17ba2b);transfers['attendedtransfer'](_0x17ba2b);agents[_0x973d('0x35')](_0x17ba2b);calls[_0x973d('0x35')](_0x17ba2b);}catch(_0x318aef){utils['error'](util[_0x973d('0x19')](_0x973d('0x36'),_0x17ba2b[_0x973d('0x37')]),_0x318aef);}});ami['on']('varset',function(_0x4989ba){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x38'),_0x4989ba[_0x973d('0x1d')]),_0x4989ba);queues['varset'](_0x4989ba);recordings['varset'](_0x4989ba);calls[_0x973d('0x39')](_0x4989ba);dials[_0x973d('0x39')](_0x4989ba);}catch(_0x1bae39){utils[_0x973d('0x14')](util[_0x973d('0x19')](_0x973d('0x38'),_0x4989ba[_0x973d('0x1d')]),_0x1bae39);}});ami['on'](_0x973d('0x3a'),function(_0x396c19){try{utils[_0x973d('0x18')](util['format'](_0x973d('0x3b'),_0x396c19[_0x973d('0x1d')]),_0x396c19);calls['newexten'](_0x396c19);recordings['newexten'](_0x396c19);dials[_0x973d('0x3a')](_0x396c19);}catch(_0x202f68){utils[_0x973d('0x14')](util[_0x973d('0x19')](_0x973d('0x3b'),_0x396c19[_0x973d('0x1d')]),_0x202f68);}});ami['on']('newchannel',function(_0x2f846a){try{utils[_0x973d('0x18')](util[_0x973d('0x19')](_0x973d('0x3c'),_0x2f846a[_0x973d('0x1d')]),_0x2f846a);calls['newchannel'](_0x2f846a);recordings[_0x973d('0x3d')](_0x2f846a);}catch(_0x337a74){utils[_0x973d('0x14')](util[_0x973d('0x19')]('[%s][index][newchannel]',_0x2f846a[_0x973d('0x1d')]),_0x337a74);}});ami['on'](_0x973d('0x3e'),function(_0x2dfd14){try{utils[_0x973d('0x18')](util[_0x973d('0x19')]('[%s][index][dialbegin]',_0x2dfd14[_0x973d('0x1d')]),_0x2dfd14);dials['dialbegin'](_0x2dfd14);}catch(_0x3cc970){utils[_0x973d('0x14')](util[_0x973d('0x19')]('[%s]dialbegin',_0x2dfd14['uniqueid']),_0x3cc970);}});ami['on'](_0x973d('0x3f'),function(_0x1a1cf3){try{utils[_0x973d('0x18')](util['format']('[%s][index][dialend]',_0x1a1cf3[_0x973d('0x1d')]),_0x1a1cf3);dials[_0x973d('0x3f')](_0x1a1cf3);}catch(_0x40123b){utils[_0x973d('0x14')](util[_0x973d('0x19')](_0x973d('0x40'),_0x1a1cf3[_0x973d('0x1d')]),_0x40123b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 18a17af..9ff9e21 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 _0xa854=['util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','format','[%s][members][writeDB]','uniqueid','some','startsWith','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','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','data2','destinationchannel','lodash'];(function(_0x400a64,_0x5ec493){var _0x3108af=function(_0x421106){while(--_0x421106){_0x400a64['push'](_0x400a64['shift']());}};_0x3108af(++_0x5ec493);}(_0xa854,0x103));var _0x4a85=function(_0x51305d,_0x519fba){_0x51305d=_0x51305d-0x0;var _0x1efa1b=_0xa854[_0x51305d];return _0x1efa1b;};'use strict';var _=require(_0x4a85('0x0'));var util=require(_0x4a85('0x1'));var utils=require(_0x4a85('0x2'));var members={};var exclude=[_0x4a85('0x3'),_0x4a85('0x4')];function writeDB(_0x491f7c){utils[_0x4a85('0x5')](util['format'](_0x4a85('0x6'),_0x491f7c['uniqueid'],_0x491f7c[_0x4a85('0x7')],_0x491f7c[_0x4a85('0x8')],_0x491f7c['data2'],_0x491f7c[_0x4a85('0x9')],_0x491f7c[_0x4a85('0xa')]));if(_0x491f7c['interface']){utils[_0x4a85('0xb')](_0x491f7c['interface'])[_0x4a85('0xc')](function(_0x1131cd){if(_0x1131cd){_0x491f7c[_0x4a85('0x9')]=_0x1131cd[_0x4a85('0xd')];_0x491f7c[_0x4a85('0xe')]=_0x1131cd[_0x4a85('0xe')];utils[_0x4a85('0xf')](_0x4a85('0x10'),_0x491f7c);}else{utils[_0x4a85('0x11')](_0x491f7c['interface'][_0x4a85('0x12')]('/')[0x1])[_0x4a85('0xc')](function(_0x42b7b9){if(_0x42b7b9){_0x491f7c[_0x4a85('0x9')]=_0x42b7b9[_0x4a85('0xd')];_0x491f7c[_0x4a85('0xe')]=_0x42b7b9[_0x4a85('0xe')];utils[_0x4a85('0xf')](_0x4a85('0x10'),_0x491f7c);}});}})['catch'](function(_0x35e857){utils[_0x4a85('0x13')](util[_0x4a85('0x14')](_0x4a85('0x15'),_0x491f7c[_0x4a85('0x16')]),_0x35e857);});}delete members[_0x491f7c[_0x4a85('0x7')]];}function startsWith(_0x34743a,_0x256a3c){return _[_0x4a85('0x17')](_0x34743a,function(_0x397f4a){return _[_0x4a85('0x18')](_0x256a3c,_0x397f4a);});}exports['devicestatechange']=function(_0x28a7d3){try{utils[_0x4a85('0x19')](util['format'](_0x4a85('0x1a'),members[_0x28a7d3[_0x4a85('0x1b')]]?members[_0x28a7d3[_0x4a85('0x1b')]]['uniqueid']:_0x28a7d3[_0x4a85('0x1b')]),_0x28a7d3);utils[_0x4a85('0x5')](util[_0x4a85('0x14')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x28a7d3['device']]?members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x16')]:_0x28a7d3[_0x4a85('0x1b')],_0x28a7d3[_0x4a85('0x1c')],_0x28a7d3[_0x4a85('0x1b')]));switch(_0x28a7d3[_0x4a85('0x1c')]){case _0x4a85('0x1d'):case _0x4a85('0x1e'):if(!startsWith(exclude,_0x28a7d3['device'])){members[_0x28a7d3['device']]={'channel':'voice','interface':_0x28a7d3[_0x4a85('0x1b')],'type':_0x4a85('0x1f'),'enterAt':utils[_0x4a85('0x20')](),'role':_0x4a85('0x21')};}break;case'NOT_INUSE':if(!_[_0x4a85('0x22')](members[_0x28a7d3[_0x4a85('0x1b')]])){members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x23')]=utils[_0x4a85('0x20')]();members[_0x28a7d3['device']][_0x4a85('0x24')]=utils[_0x4a85('0x25')](members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x23')],members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x26')]);if(members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x16')]){writeDB(members[_0x28a7d3[_0x4a85('0x1b')]]);}}break;default:break;}}catch(_0x377796){utils['error'](util[_0x4a85('0x14')]('[%s][members][devicestatechange]',members[_0x28a7d3[_0x4a85('0x1b')]]?members[_0x28a7d3[_0x4a85('0x1b')]][_0x4a85('0x16')]:_0x28a7d3[_0x4a85('0x1b')]),_0x377796);}};exports[_0x4a85('0x27')]=function(_0x37095a){try{if(!_[_0x4a85('0x22')](members[_0x37095a[_0x4a85('0x7')]])){utils['debug'](util[_0x4a85('0x14')]('[%s][members][agentcomplete]',_0x37095a[_0x4a85('0x16')]),_0x37095a);utils[_0x4a85('0x5')](util['format'](_0x4a85('0x28'),_0x37095a[_0x4a85('0x16')],_0x37095a[_0x4a85('0x7')],_0x37095a[_0x4a85('0x29')]));members[_0x37095a[_0x4a85('0x7')]]=_[_0x4a85('0x2a')](members[_0x37095a[_0x4a85('0x7')]],{'data4':_0x37095a[_0x4a85('0x29')],'uniqueid':_0x37095a[_0x4a85('0x16')]});}}catch(_0x89e5bb){utils[_0x4a85('0x13')](util[_0x4a85('0x14')]('[%s][members][agentcomplete]',_0x37095a[_0x4a85('0x16')]),_0x89e5bb);}};exports[_0x4a85('0x2b')]=function(_0x41adff){try{utils[_0x4a85('0x19')](util['format'](_0x4a85('0x2c'),_0x41adff[_0x4a85('0x16')]),_0x41adff);if(_0x41adff[_0x4a85('0x8')]){var _0x117c3d=_0x41adff[_0x4a85('0x8')][_0x4a85('0x12')]('-')[0x0];if(!_[_0x4a85('0x22')](members[_0x117c3d])){members[_0x117c3d]=_['assign'](members[_0x117c3d],{'data1':members[_0x117c3d][_0x4a85('0x2d')]||_0x41adff[_0x4a85('0xa')],'data2':members[_0x117c3d]['data2']||_0x41adff[_0x4a85('0x2e')],'data3':members[_0x117c3d][_0x4a85('0x2f')]||_0x41adff[_0x4a85('0x30')],'uniqueid':members[_0x117c3d]['uniqueid']||_0x41adff[_0x4a85('0x16')]});utils[_0x4a85('0x5')](util[_0x4a85('0x14')](_0x4a85('0x31'),_0x41adff[_0x4a85('0x16')],members[_0x117c3d][_0x4a85('0x2d')],members[_0x117c3d][_0x4a85('0x32')],members[_0x117c3d][_0x4a85('0x2f')]));if(members[_0x117c3d][_0x4a85('0x23')]){writeDB(members[_0x117c3d]);}}}if(_0x41adff['destinationchannel']){var _0x200598=_0x41adff[_0x4a85('0x33')][_0x4a85('0x12')]('-')[0x0];if(!_['isNil'](members[_0x200598])){members[_0x200598]=_[_0x4a85('0x2a')](members[_0x200598],{'data1':members[_0x200598]['data1']||_0x41adff[_0x4a85('0xa')],'data2':members[_0x200598][_0x4a85('0x32')]||_0x41adff['source'],'data3':members[_0x200598][_0x4a85('0x2f')]||_0x41adff[_0x4a85('0x30')],'uniqueid':members[_0x200598][_0x4a85('0x16')]||_0x41adff['uniqueid']});utils['info'](util[_0x4a85('0x14')](_0x4a85('0x31'),_0x41adff['uniqueid'],members[_0x200598]['data1'],members[_0x200598]['data2'],members[_0x200598][_0x4a85('0x2f')]));if(members[_0x200598][_0x4a85('0x23')]){writeDB(members[_0x200598]);}}}}catch(_0x4fd1de){utils['error'](util[_0x4a85('0x14')](_0x4a85('0x2c'),_0x41adff[_0x4a85('0x16')]),_0x4fd1de);}}; \ No newline at end of file +var _0x4f73=['destination','lodash','util','./utils','Local/_attended@transfer','format','uniqueid','interface','channel','data2','membername','getUserByInterface','then','name','request','getUserByName','split','internal','CreateMemberReport','error','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','type','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel'];(function(_0x56d128,_0x9db63f){var _0x4db306=function(_0x30573c){while(--_0x30573c){_0x56d128['push'](_0x56d128['shift']());}};_0x4db306(++_0x9db63f);}(_0x4f73,0x10f));var _0x34f7=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0x4f73[_0x548d7d];return _0xb1c878;};'use strict';var _=require(_0x34f7('0x0'));var util=require(_0x34f7('0x1'));var utils=require(_0x34f7('0x2'));var members={};var exclude=[_0x34f7('0x3'),'Queue:'];function writeDB(_0x40bdf2){utils['info'](util[_0x34f7('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x40bdf2[_0x34f7('0x5')],_0x40bdf2[_0x34f7('0x6')],_0x40bdf2[_0x34f7('0x7')],_0x40bdf2[_0x34f7('0x8')],_0x40bdf2[_0x34f7('0x9')],_0x40bdf2['type']));if(_0x40bdf2['interface']){utils[_0x34f7('0xa')](_0x40bdf2[_0x34f7('0x6')])[_0x34f7('0xb')](function(_0x2a11e5){if(_0x2a11e5){_0x40bdf2[_0x34f7('0x9')]=_0x2a11e5[_0x34f7('0xc')];_0x40bdf2['internal']=_0x2a11e5['internal'];utils[_0x34f7('0xd')]('CreateMemberReport',_0x40bdf2);}else{utils[_0x34f7('0xe')](_0x40bdf2[_0x34f7('0x6')][_0x34f7('0xf')]('/')[0x1])[_0x34f7('0xb')](function(_0x3f0f94){if(_0x3f0f94){_0x40bdf2[_0x34f7('0x9')]=_0x3f0f94[_0x34f7('0xc')];_0x40bdf2[_0x34f7('0x10')]=_0x3f0f94['internal'];utils[_0x34f7('0xd')](_0x34f7('0x11'),_0x40bdf2);}});}})['catch'](function(_0x26516f){utils[_0x34f7('0x12')](util[_0x34f7('0x4')](_0x34f7('0x13'),_0x40bdf2[_0x34f7('0x5')]),_0x26516f);});}delete members[_0x40bdf2['interface']];}function startsWith(_0x3e2028,_0x36bb29){return _[_0x34f7('0x14')](_0x3e2028,function(_0x2e829b){return _[_0x34f7('0x15')](_0x36bb29,_0x2e829b);});}exports['devicestatechange']=function(_0x3460b4){try{utils[_0x34f7('0x16')](util['format'](_0x34f7('0x17'),members[_0x3460b4[_0x34f7('0x18')]]?members[_0x3460b4['device']][_0x34f7('0x5')]:_0x3460b4[_0x34f7('0x18')]),_0x3460b4);utils['info'](util['format'](_0x34f7('0x19'),members[_0x3460b4[_0x34f7('0x18')]]?members[_0x3460b4['device']][_0x34f7('0x5')]:_0x3460b4['device'],_0x3460b4[_0x34f7('0x1a')],_0x3460b4[_0x34f7('0x18')]));switch(_0x3460b4[_0x34f7('0x1a')]){case _0x34f7('0x1b'):case _0x34f7('0x1c'):if(!startsWith(exclude,_0x3460b4[_0x34f7('0x18')])){members[_0x3460b4[_0x34f7('0x18')]]={'channel':_0x34f7('0x1d'),'interface':_0x3460b4['device'],'type':_0x34f7('0x1e'),'enterAt':utils[_0x34f7('0x1f')](),'role':_0x34f7('0x20')};}break;case _0x34f7('0x21'):if(!_[_0x34f7('0x22')](members[_0x3460b4[_0x34f7('0x18')]])){members[_0x3460b4['device']][_0x34f7('0x23')]=utils[_0x34f7('0x1f')]();members[_0x3460b4[_0x34f7('0x18')]][_0x34f7('0x24')]=utils[_0x34f7('0x25')](members[_0x3460b4[_0x34f7('0x18')]]['exitAt'],members[_0x3460b4[_0x34f7('0x18')]][_0x34f7('0x26')]);if(members[_0x3460b4[_0x34f7('0x18')]]['uniqueid']){writeDB(members[_0x3460b4[_0x34f7('0x18')]]);}}break;default:break;}}catch(_0x3f1ead){utils[_0x34f7('0x12')](util['format']('[%s][members][devicestatechange]',members[_0x3460b4[_0x34f7('0x18')]]?members[_0x3460b4[_0x34f7('0x18')]][_0x34f7('0x5')]:_0x3460b4[_0x34f7('0x18')]),_0x3f1ead);}};exports[_0x34f7('0x27')]=function(_0x380613){try{if(!_['isNil'](members[_0x380613[_0x34f7('0x6')]])){utils[_0x34f7('0x16')](util[_0x34f7('0x4')](_0x34f7('0x28'),_0x380613['uniqueid']),_0x380613);utils[_0x34f7('0x29')](util['format'](_0x34f7('0x2a'),_0x380613[_0x34f7('0x5')],_0x380613[_0x34f7('0x6')],_0x380613[_0x34f7('0x2b')]));members[_0x380613[_0x34f7('0x6')]]=_[_0x34f7('0x2c')](members[_0x380613[_0x34f7('0x6')]],{'data4':_0x380613[_0x34f7('0x2b')],'uniqueid':_0x380613['uniqueid']});}}catch(_0x3b8b27){utils[_0x34f7('0x12')](util['format'](_0x34f7('0x28'),_0x380613[_0x34f7('0x5')]),_0x3b8b27);}};exports[_0x34f7('0x2d')]=function(_0x505b0c){try{utils['debug'](util[_0x34f7('0x4')](_0x34f7('0x2e'),_0x505b0c[_0x34f7('0x5')]),_0x505b0c);if(_0x505b0c['channel']){var _0x5d6b9d=_0x505b0c[_0x34f7('0x7')]['split']('-')[0x0];if(!_[_0x34f7('0x22')](members[_0x5d6b9d])){members[_0x5d6b9d]=_[_0x34f7('0x2c')](members[_0x5d6b9d],{'data1':members[_0x5d6b9d][_0x34f7('0x2f')]||_0x505b0c[_0x34f7('0x30')],'data2':members[_0x5d6b9d][_0x34f7('0x8')]||_0x505b0c[_0x34f7('0x31')],'data3':members[_0x5d6b9d][_0x34f7('0x32')]||_0x505b0c['destination'],'uniqueid':members[_0x5d6b9d][_0x34f7('0x5')]||_0x505b0c['uniqueid']});utils[_0x34f7('0x29')](util[_0x34f7('0x4')](_0x34f7('0x33'),_0x505b0c[_0x34f7('0x5')],members[_0x5d6b9d][_0x34f7('0x2f')],members[_0x5d6b9d][_0x34f7('0x8')],members[_0x5d6b9d][_0x34f7('0x32')]));if(members[_0x5d6b9d][_0x34f7('0x23')]){writeDB(members[_0x5d6b9d]);}}}if(_0x505b0c['destinationchannel']){var _0x1e996a=_0x505b0c[_0x34f7('0x34')][_0x34f7('0xf')]('-')[0x0];if(!_[_0x34f7('0x22')](members[_0x1e996a])){members[_0x1e996a]=_[_0x34f7('0x2c')](members[_0x1e996a],{'data1':members[_0x1e996a][_0x34f7('0x2f')]||_0x505b0c[_0x34f7('0x30')],'data2':members[_0x1e996a][_0x34f7('0x8')]||_0x505b0c[_0x34f7('0x31')],'data3':members[_0x1e996a][_0x34f7('0x32')]||_0x505b0c[_0x34f7('0x35')],'uniqueid':members[_0x1e996a][_0x34f7('0x5')]||_0x505b0c['uniqueid']});utils[_0x34f7('0x29')](util[_0x34f7('0x4')](_0x34f7('0x33'),_0x505b0c['uniqueid'],members[_0x1e996a][_0x34f7('0x2f')],members[_0x1e996a][_0x34f7('0x8')],members[_0x1e996a][_0x34f7('0x32')]));if(members[_0x1e996a][_0x34f7('0x23')]){writeDB(members[_0x1e996a]);}}}}catch(_0x17a71f){utils[_0x34f7('0x12')](util[_0x34f7('0x4')](_0x34f7('0x2e'),_0x505b0c['uniqueid']),_0x17a71f);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 619f148..5c1b6ad 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 _0x7f51=['extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten'];(function(_0x3116d6,_0x2d574f){var _0x18729d=function(_0x1945a0){while(--_0x1945a0){_0x3116d6['push'](_0x3116d6['shift']());}};_0x18729d(++_0x2d574f);}(_0x7f51,0x155));var _0x17f5=function(_0x2d025a,_0x2de4e3){_0x2d025a=_0x2d025a-0x0;var _0x47e307=_0x7f51[_0x2d025a];return _0x47e307;};'use strict';var _=require('lodash');var util=require(_0x17f5('0x0'));var utils=require(_0x17f5('0x1'));var queues={};function writeDB(_0x479809){utils['info'](util[_0x17f5('0x2')](_0x17f5('0x3'),_0x479809[_0x17f5('0x4')],_0x479809[_0x17f5('0x5')],_0x479809[_0x17f5('0x6')],_0x479809[_0x17f5('0x7')],_0x479809[_0x17f5('0x8')],_0x479809['accountcode'],_0x479809[_0x17f5('0x9')]));if(_0x479809['queue']){utils[_0x17f5('0xa')](_0x479809[_0x17f5('0x6')])['then'](function(_0x3185e0){if(_0x3185e0){_0x479809[_0x17f5('0xb')]=_0x3185e0[_0x17f5('0xb')];}utils[_0x17f5('0xc')](_0x17f5('0xd'),_0x479809);});}else{utils[_0x17f5('0xc')](_0x17f5('0xd'),_0x479809);}if(_0x479809[_0x17f5('0xe')]){delete queues[_0x479809[_0x17f5('0xe')]];}else{delete queues[_0x479809[_0x17f5('0x4')]];}}exports[_0x17f5('0xf')]=function(_0x3207c6){try{utils[_0x17f5('0x10')](util[_0x17f5('0x2')](_0x17f5('0x11'),_0x3207c6[_0x17f5('0x4')]),_0x3207c6);utils[_0x17f5('0x12')](util['format'](_0x17f5('0x13'),_0x3207c6[_0x17f5('0x4')],_0x3207c6[_0x17f5('0x6')],_0x3207c6[_0x17f5('0x14')]));queues[_0x3207c6[_0x17f5('0x4')]]=_[_0x17f5('0x15')](_0x3207c6,{'originalposition':_0x3207c6[_0x17f5('0x14')],'queuecallerjoinAt':utils[_0x17f5('0x16')](),'mohtime':0x0});}catch(_0x13f1f3){utils[_0x17f5('0x17')](util[_0x17f5('0x2')]('[%s][queues][queuecallerjoin]',_0x3207c6[_0x17f5('0x4')]),_0x13f1f3);}};exports[_0x17f5('0x18')]=function(_0x4b7611){try{if(!_[_0x17f5('0x19')](queues[_0x4b7611[_0x17f5('0x4')]])){utils[_0x17f5('0x10')](util[_0x17f5('0x2')](_0x17f5('0x1a'),_0x4b7611['uniqueid']),_0x4b7611);if(queues[_0x4b7611[_0x17f5('0x4')]][_0x17f5('0x1b')]){if(!queues[_0x4b7611[_0x17f5('0x4')]]['queuecallerabandon']&&!queues[_0x4b7611['uniqueid']]['queuecallerexit']){queues[_0x4b7611[_0x17f5('0x4')]]['queuecallercomplete']=!![];queues[_0x4b7611[_0x17f5('0x4')]][_0x17f5('0x1c')]=utils['now']();queues[_0x4b7611[_0x17f5('0x4')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x1d'),_0x4b7611[_0x17f5('0x4')],queues[_0x4b7611[_0x17f5('0x4')]][_0x17f5('0x1e')],queues[_0x4b7611['uniqueid']][_0x17f5('0x9')]));writeDB(queues[_0x4b7611['uniqueid']]);}else if(queues[_0x4b7611[_0x17f5('0x4')]]['transfereduniqueid']){utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x1f'),_0x4b7611[_0x17f5('0x4')],queues[_0x4b7611['uniqueid']]['name'],queues[_0x4b7611[_0x17f5('0x4')]][_0x17f5('0xe')]));queues[queues[_0x4b7611['uniqueid']][_0x17f5('0xe')]]=queues[_0x4b7611[_0x17f5('0x4')]];queues[queues[_0x4b7611['uniqueid']]['transfereduniqueid']][_0x17f5('0x20')]=0x2;delete queues[_0x4b7611[_0x17f5('0x4')]];}}}catch(_0xf7ff3f){utils[_0x17f5('0x17')](util[_0x17f5('0x2')]('[%s][queues][hangup]',_0x4b7611['uniqueid']),_0xf7ff3f);}};exports[_0x17f5('0x21')]=function(_0xca74cd){try{utils['debug'](util['format']('[%s][queues][varset]',_0xca74cd[_0x17f5('0x4')]),_0xca74cd);if(!_[_0x17f5('0x19')](_0xca74cd[_0x17f5('0x22')][_0x17f5('0x23')])&&_0xca74cd[_0x17f5('0x24')][_0x17f5('0x25')]()!=='CONTINUE'){if(!_['isNil'](queues[_0xca74cd[_0x17f5('0x4')]])){queues[_0xca74cd['uniqueid']][_0x17f5('0x26')]=![];queues[_0xca74cd['uniqueid']][_0x17f5('0x27')]=null;queues[_0xca74cd['uniqueid']][_0x17f5('0x28')]=!![];queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x29')]=utils[_0x17f5('0x16')]();queues[_0xca74cd['uniqueid']]['queuecallerexitreason']=_0xca74cd[_0x17f5('0x24')]['toUpperCase']();utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x2a'),_0xca74cd[_0x17f5('0x4')],queues[_0xca74cd['uniqueid']][_0x17f5('0x1e')],_0xca74cd[_0x17f5('0x24')],queues[_0xca74cd['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0xca74cd['uniqueid']]);}}else if(!_[_0x17f5('0x19')](_0xca74cd[_0x17f5('0x22')][_0x17f5('0x2b')])){if(!_['isNil'](queues[_0xca74cd['uniqueid']])&&!queues[_0xca74cd[_0x17f5('0x4')]]['queuecallerabandon']){queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x26')]=![];queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x27')]=null;queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x28')]=!![];queues[_0xca74cd[_0x17f5('0x4')]]['queuecallerexitAt']=utils[_0x17f5('0x16')]();queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x9')]=_0x17f5('0x2c');utils[_0x17f5('0x12')](util['format'](_0x17f5('0x2d'),_0xca74cd[_0x17f5('0x4')],queues[_0xca74cd['uniqueid']][_0x17f5('0x1e')],_0xca74cd[_0x17f5('0x24')],queues[_0xca74cd[_0x17f5('0x4')]][_0x17f5('0x9')]));}}}catch(_0x207009){utils[_0x17f5('0x17')](util[_0x17f5('0x2')](_0x17f5('0x2e'),_0xca74cd[_0x17f5('0x4')]),_0x207009);}};exports['queuecallerabandon']=function(_0x12bbd6){try{if(!_[_0x17f5('0x19')](queues[_0x12bbd6['uniqueid']])){utils['debug'](util['format'](_0x17f5('0x2f'),_0x12bbd6[_0x17f5('0x4')]),_0x12bbd6);queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x28')]=![];queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x29')]=null;queues[_0x12bbd6['uniqueid']][_0x17f5('0x26')]=!![];queues[_0x12bbd6[_0x17f5('0x4')]]['queuecallerabandonAt']=utils[_0x17f5('0x16')]();queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x9')]='ABANDONED';utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x30'),_0x12bbd6['uniqueid'],queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x1e')],queues[_0x12bbd6[_0x17f5('0x4')]][_0x17f5('0x9')]));}}catch(_0x43f1fe){utils[_0x17f5('0x17')](util[_0x17f5('0x2')](_0x17f5('0x2f'),_0x12bbd6[_0x17f5('0x4')]),_0x43f1fe);}};exports[_0x17f5('0x31')]=function(_0x428a34){try{if(!_[_0x17f5('0x19')](queues[_0x428a34['uniqueid']])){utils[_0x17f5('0x10')](util[_0x17f5('0x2')]('[%s][queues][queuecallerleave]',_0x428a34[_0x17f5('0x4')]),_0x428a34);utils['info'](util[_0x17f5('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x428a34[_0x17f5('0x4')],queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x1e')],_0x428a34[_0x17f5('0x32')],_0x428a34[_0x17f5('0x33')]));queues[_0x428a34[_0x17f5('0x4')]]['queuecallerleave']=!![];queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x1b')]=utils[_0x17f5('0x16')]();queues[_0x428a34[_0x17f5('0x4')]]['holdtime']=utils[_0x17f5('0x34')](queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x1b')],queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x35')]);queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x14')]=_0x428a34[_0x17f5('0x14')];queues[_0x428a34[_0x17f5('0x4')]][_0x17f5('0x36')]=_0x428a34[_0x17f5('0x36')];queues[_0x428a34[_0x17f5('0x4')]]['connectedlinenum']=_0x428a34[_0x17f5('0x32')];queues[_0x428a34[_0x17f5('0x4')]]['connectedlinename']=_0x428a34[_0x17f5('0x33')];}}catch(_0xe0cc33){utils['error'](util[_0x17f5('0x2')](_0x17f5('0x37'),_0x428a34[_0x17f5('0x4')]),_0xe0cc33);}};exports['agentconnect']=function(_0x1d1f7f){try{if(!_[_0x17f5('0x19')](queues[_0x1d1f7f[_0x17f5('0x4')]])){utils[_0x17f5('0x10')](util[_0x17f5('0x2')]('[%s][queues][agentconnect]',_0x1d1f7f[_0x17f5('0x4')]),_0x1d1f7f);utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x38'),_0x1d1f7f['uniqueid'],queues[_0x1d1f7f['uniqueid']][_0x17f5('0x1e')],_0x1d1f7f[_0x17f5('0x39')],_0x1d1f7f[_0x17f5('0x3a')]));queues[_0x1d1f7f[_0x17f5('0x4')]]['queuecallerabandon']=![];queues[_0x1d1f7f[_0x17f5('0x4')]][_0x17f5('0x26')]=![];queues[_0x1d1f7f[_0x17f5('0x4')]][_0x17f5('0x27')]=null;queues[_0x1d1f7f[_0x17f5('0x4')]][_0x17f5('0x28')]=![];queues[_0x1d1f7f[_0x17f5('0x4')]]['queuecallerexitreason']=null;queues[_0x1d1f7f[_0x17f5('0x4')]]['queuecallerexitAt']=null;queues[_0x1d1f7f['uniqueid']][_0x17f5('0x3b')]=!![];queues[_0x1d1f7f[_0x17f5('0x4')]]['accountcode']=_0x1d1f7f['destaccountcode'];queues[_0x1d1f7f[_0x17f5('0x4')]][_0x17f5('0x7')]=_0x1d1f7f['membername'];}}catch(_0x95869a){utils['error'](util[_0x17f5('0x2')](_0x17f5('0x3c'),_0x1d1f7f[_0x17f5('0x4')]),_0x95869a);}};exports[_0x17f5('0x3d')]=function(_0x10392b){try{if(!_['isNil'](queues[_0x10392b['uniqueid']])){if(queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x1b')]){utils['debug'](util[_0x17f5('0x2')](_0x17f5('0x3e'),_0x10392b[_0x17f5('0x4')]),_0x10392b);queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x26')]=![];queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x26')]=![];queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x27')]=null;queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x28')]=![];queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x29')]=null;queues[_0x10392b[_0x17f5('0x4')]]['assigned']=!![];queues[_0x10392b['uniqueid']][_0x17f5('0x7')]=_0x10392b['membername'];queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x3f')]=!![];queues[_0x10392b['uniqueid']][_0x17f5('0x1c')]=utils['now']();if(_0x10392b[_0x17f5('0x40')]==_0x17f5('0x41')){if(!queues[_0x10392b[_0x17f5('0x4')]]['transfer']){queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x9')]=_0x17f5('0x42');}}else{queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x9')]=_0x17f5('0x43')+_0x10392b[_0x17f5('0x40')]['toUpperCase']();}utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x44'),_0x10392b['uniqueid'],queues[_0x10392b[_0x17f5('0x4')]][_0x17f5('0x1e')],_0x10392b[_0x17f5('0x39')],queues[_0x10392b[_0x17f5('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x10392b['uniqueid']]);}}}catch(_0x236058){utils[_0x17f5('0x17')](util[_0x17f5('0x2')](_0x17f5('0x3e'),_0x10392b['uniqueid']),_0x236058);}};exports[_0x17f5('0x45')]=function(_0x1550c9){try{if(!_[_0x17f5('0x19')](queues[_0x1550c9[_0x17f5('0x46')]])){utils['debug'](util['format'](_0x17f5('0x47'),_0x1550c9['uniqueid']),_0x1550c9);queues[_0x1550c9[_0x17f5('0x46')]][_0x17f5('0x41')]=!![];queues[_0x1550c9['transfereeuniqueid']][_0x17f5('0x48')]=_0x17f5('0x49');queues[_0x1550c9[_0x17f5('0x46')]][_0x17f5('0x4a')]=_0x1550c9[_0x17f5('0x4b')];queues[_0x1550c9['transfereeuniqueid']][_0x17f5('0x4c')]=_0x1550c9[_0x17f5('0x46')];queues[_0x1550c9[_0x17f5('0x46')]][_0x17f5('0x9')]='BLINDTRANSFER';utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x4d'),_0x1550c9[_0x17f5('0x4')],queues[_0x1550c9[_0x17f5('0x46')]]['name'],_0x1550c9[_0x17f5('0x46')],_0x1550c9[_0x17f5('0x4b')]));}}catch(_0x3352d5){utils[_0x17f5('0x17')](util['format'](_0x17f5('0x47'),_0x1550c9['uniqueid']),_0x3352d5);}};exports[_0x17f5('0x4e')]=function(_0x463050){try{utils['debug'](util[_0x17f5('0x2')]('[%s][queues][attendedtransfer]',_0x463050[_0x17f5('0x4f')]),_0x463050);if(_0x463050[_0x17f5('0x4f')]==_0x463050[_0x17f5('0x50')]){if(!_[_0x17f5('0x19')](queues[_0x463050[_0x17f5('0x51')]])){utils[_0x17f5('0x12')](util[_0x17f5('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x463050[_0x17f5('0x4f')],queues[_0x463050[_0x17f5('0x51')]]['name'],_0x463050['origtransfererexten']));queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0x41')]=!![];queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0x48')]=_0x17f5('0x52');queues[_0x463050['secondtransfererlinkedid']][_0x17f5('0x4a')]=_0x463050['origtransfererexten'];queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0x4c')]=_0x463050[_0x17f5('0x4f')];queues[_0x463050['secondtransfererlinkedid']][_0x17f5('0x9')]=_0x17f5('0x53');}if(!_[_0x17f5('0x19')](queues[_0x463050[_0x17f5('0x50')]])){if(_0x463050[_0x17f5('0x54')]&&queues[_0x463050[_0x17f5('0x54')]]){queues[_0x463050[_0x17f5('0x54')]][_0x17f5('0x20')]=0x1;queues[_0x463050['transfereeuniqueid']]=_[_0x17f5('0x55')](queues[_0x463050[_0x17f5('0x54')]]);queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0xe')]=_0x463050[_0x17f5('0x56')];queues[_0x463050['transfereeuniqueid']][_0x17f5('0x20')]=0x2;queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x8')]=queues[_0x463050[_0x17f5('0x51')]]['calleridnum'];queues[_0x463050['transfereeuniqueid']][_0x17f5('0x57')]=queues[_0x463050[_0x17f5('0x51')]]['calleridname'];queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x35')]=utils[_0x17f5('0x16')]();queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x1b')]=utils['now']();queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x58')]=0x0;queues[_0x463050['transfereeuniqueid']][_0x17f5('0x59')]=0x0;utils[_0x17f5('0x12')](util['format'](_0x17f5('0x5a'),_0x463050[_0x17f5('0x4f')],queues[_0x463050['transfereeuniqueid']][_0x17f5('0x1e')],queues[_0x463050['transfereeuniqueid']][_0x17f5('0x8')],queues[_0x463050[_0x17f5('0x46')]][_0x17f5('0x57')]));}else{utils['info'](util[_0x17f5('0x2')](_0x17f5('0x5b'),_0x463050[_0x17f5('0x4f')],queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0x1e')],_0x463050[_0x17f5('0x51')]));queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0xe')]=_0x463050[_0x17f5('0x51')];}}}else if(_0x463050[_0x17f5('0x5c')]==_0x463050[_0x17f5('0x51')]){if(!_[_0x17f5('0x19')](queues[_0x463050[_0x17f5('0x50')]])){utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x5d'),_0x463050[_0x17f5('0x4f')],queues[_0x463050['origtransfererlinkedid']][_0x17f5('0x1e')],_0x463050[_0x17f5('0x5c')],_0x463050[_0x17f5('0x5e')]));queues[_0x463050['origtransfererlinkedid']][_0x17f5('0x41')]=!![];queues[_0x463050['origtransfererlinkedid']][_0x17f5('0x48')]=_0x17f5('0x52');queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0x4a')]=_0x463050['secondtransfererexten'];queues[_0x463050['origtransfererlinkedid']][_0x17f5('0x4c')]=_0x463050[_0x17f5('0x5c')];queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0x9')]=_0x17f5('0x53');}if(!_['isNil'](queues[_0x463050[_0x17f5('0x51')]])){if(_0x463050['transfertargetlinkedid']&&queues[_0x463050[_0x17f5('0x5f')]]){queues[_0x463050[_0x17f5('0x5f')]][_0x17f5('0x20')]=0x1;queues[_0x463050['transfertargetuniqueid']]=_[_0x17f5('0x55')](queues[_0x463050[_0x17f5('0x5f')]]);queues[_0x463050['transfertargetuniqueid']][_0x17f5('0xe')]=_0x463050['transfertargetuniqueid'];queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x20')]=0x2;queues[_0x463050[_0x17f5('0x56')]][_0x17f5('0x8')]=queues[_0x463050[_0x17f5('0x50')]][_0x17f5('0x8')];queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x57')]=queues[_0x463050[_0x17f5('0x50')]]['calleridname'];queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x35')]=utils[_0x17f5('0x16')]();queues[_0x463050[_0x17f5('0x56')]]['queuecallerleaveAt']=utils[_0x17f5('0x16')]();queues[_0x463050[_0x17f5('0x56')]][_0x17f5('0x58')]=0x0;queues[_0x463050['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x17f5('0x12')](util[_0x17f5('0x2')](_0x17f5('0x60'),_0x463050[_0x17f5('0x4f')],queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x1e')],queues[_0x463050[_0x17f5('0x56')]]['transfereduniqueid'],queues[_0x463050[_0x17f5('0x56')]]['calleridnum'],queues[_0x463050['transfertargetuniqueid']][_0x17f5('0x57')]));}else{utils[_0x17f5('0x12')](util[_0x17f5('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x463050[_0x17f5('0x4f')],queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0x1e')],_0x463050['origtransfererlinkedid']));queues[_0x463050[_0x17f5('0x51')]][_0x17f5('0xe')]=_0x463050[_0x17f5('0x50')];}}}}catch(_0x2be485){utils['error'](util['format'](_0x17f5('0x61'),_0x463050[_0x17f5('0x4f')]),_0x2be485);}};exports[_0x17f5('0x62')]=function(_0x344d92){try{if(!_[_0x17f5('0x19')](queues[_0x344d92['uniqueid']])){utils[_0x17f5('0x10')](util[_0x17f5('0x2')](_0x17f5('0x63'),_0x344d92['uniqueid']),_0x344d92);queues[_0x344d92[_0x17f5('0x4')]][_0x17f5('0x64')]=utils['now']();utils['info'](util['format'](_0x17f5('0x65'),_0x344d92[_0x17f5('0x4')],queues[_0x344d92[_0x17f5('0x4')]][_0x17f5('0x1e')],queues[_0x344d92['uniqueid']][_0x17f5('0x64')]));}}catch(_0x2d5202){utils['error'](util[_0x17f5('0x2')](_0x17f5('0x63'),_0x344d92[_0x17f5('0x4')]),_0x2d5202);}};exports[_0x17f5('0x66')]=function(_0x464f3a){try{if(!_[_0x17f5('0x19')](queues[_0x464f3a[_0x17f5('0x4')]])){if(!_[_0x17f5('0x19')](queues[_0x464f3a[_0x17f5('0x4')]][_0x17f5('0x64')])){utils[_0x17f5('0x10')](util['format']('[%s][queues][musiconholdstop]',_0x464f3a[_0x17f5('0x4')]),_0x464f3a);queues[_0x464f3a['uniqueid']]['mohtime']+=utils[_0x17f5('0x34')](utils[_0x17f5('0x16')](),queues[_0x464f3a[_0x17f5('0x4')]][_0x17f5('0x64')]);utils[_0x17f5('0x12')](util[_0x17f5('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x464f3a[_0x17f5('0x4')],queues[_0x464f3a[_0x17f5('0x4')]]['name'],queues[_0x464f3a[_0x17f5('0x4')]][_0x17f5('0x59')]));delete queues[_0x464f3a[_0x17f5('0x4')]][_0x17f5('0x64')];}}}catch(_0x4134a5){utils[_0x17f5('0x17')](util['format'](_0x17f5('0x67'),_0x464f3a['uniqueid']),_0x4134a5);}}; \ No newline at end of file +var _0x4504=['error','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','then','type','CreateVoiceQueueReport','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s'];(function(_0x38245d,_0x2e3c28){var _0x38860b=function(_0x25dd72){while(--_0x25dd72){_0x38245d['push'](_0x38245d['shift']());}};_0x38860b(++_0x2e3c28);}(_0x4504,0x173));var _0x4450=function(_0x1ae54a,_0x27b3b8){_0x1ae54a=_0x1ae54a-0x0;var _0x165046=_0x4504[_0x1ae54a];return _0x165046;};'use strict';var _=require(_0x4450('0x0'));var util=require('util');var utils=require(_0x4450('0x1'));var queues={};function writeDB(_0x49ea80){utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x4'),_0x49ea80['uniqueid'],_0x49ea80['channel'],_0x49ea80[_0x4450('0x5')],_0x49ea80[_0x4450('0x6')],_0x49ea80[_0x4450('0x7')],_0x49ea80[_0x4450('0x8')],_0x49ea80['queuecallerexitreason']));if(_0x49ea80[_0x4450('0x5')]){utils[_0x4450('0x9')](_0x49ea80[_0x4450('0x5')])[_0x4450('0xa')](function(_0x538a1e){if(_0x538a1e){_0x49ea80[_0x4450('0xb')]=_0x538a1e[_0x4450('0xb')];}utils['request'](_0x4450('0xc'),_0x49ea80);});}else{utils['request']('CreateVoiceQueueReport',_0x49ea80);}if(_0x49ea80[_0x4450('0xd')]){delete queues[_0x49ea80[_0x4450('0xd')]];}else{delete queues[_0x49ea80[_0x4450('0xe')]];}}exports['queuecallerjoin']=function(_0x3d1c51){try{utils[_0x4450('0xf')](util[_0x4450('0x3')](_0x4450('0x10'),_0x3d1c51['uniqueid']),_0x3d1c51);utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x11'),_0x3d1c51[_0x4450('0xe')],_0x3d1c51[_0x4450('0x5')],_0x3d1c51['position']));queues[_0x3d1c51[_0x4450('0xe')]]=_[_0x4450('0x12')](_0x3d1c51,{'originalposition':_0x3d1c51[_0x4450('0x13')],'queuecallerjoinAt':utils[_0x4450('0x14')](),'mohtime':0x0});}catch(_0x506e59){utils['error'](util['format'](_0x4450('0x10'),_0x3d1c51[_0x4450('0xe')]),_0x506e59);}};exports['hangup']=function(_0x56f506){try{if(!_[_0x4450('0x15')](queues[_0x56f506['uniqueid']])){utils['debug'](util['format'](_0x4450('0x16'),_0x56f506[_0x4450('0xe')]),_0x56f506);if(queues[_0x56f506['uniqueid']][_0x4450('0x17')]){if(!queues[_0x56f506[_0x4450('0xe')]][_0x4450('0x18')]&&!queues[_0x56f506[_0x4450('0xe')]][_0x4450('0x19')]){queues[_0x56f506[_0x4450('0xe')]][_0x4450('0x1a')]=!![];queues[_0x56f506[_0x4450('0xe')]][_0x4450('0x1b')]=utils[_0x4450('0x14')]();queues[_0x56f506['uniqueid']][_0x4450('0x1c')]=_0x4450('0x1d');}utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x1e'),_0x56f506[_0x4450('0xe')],queues[_0x56f506['uniqueid']][_0x4450('0x1f')],queues[_0x56f506[_0x4450('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x56f506[_0x4450('0xe')]]);}else if(queues[_0x56f506[_0x4450('0xe')]][_0x4450('0xd')]){utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x20'),_0x56f506[_0x4450('0xe')],queues[_0x56f506['uniqueid']][_0x4450('0x1f')],queues[_0x56f506['uniqueid']][_0x4450('0xd')]));queues[queues[_0x56f506[_0x4450('0xe')]][_0x4450('0xd')]]=queues[_0x56f506['uniqueid']];queues[queues[_0x56f506[_0x4450('0xe')]][_0x4450('0xd')]][_0x4450('0x21')]=0x2;delete queues[_0x56f506[_0x4450('0xe')]];}}}catch(_0xc3e7d1){utils['error'](util[_0x4450('0x3')]('[%s][queues][hangup]',_0x56f506[_0x4450('0xe')]),_0xc3e7d1);}};exports[_0x4450('0x22')]=function(_0x4aab27){try{utils[_0x4450('0xf')](util[_0x4450('0x3')](_0x4450('0x23'),_0x4aab27[_0x4450('0xe')]),_0x4aab27);if(!_[_0x4450('0x15')](_0x4aab27[_0x4450('0x24')][_0x4450('0x25')])&&_0x4aab27[_0x4450('0x26')][_0x4450('0x27')]()!==_0x4450('0x28')){if(!_[_0x4450('0x15')](queues[_0x4aab27[_0x4450('0xe')]])){queues[_0x4aab27[_0x4450('0xe')]]['queuecallerabandon']=![];queues[_0x4aab27['uniqueid']][_0x4450('0x29')]=null;queues[_0x4aab27[_0x4450('0xe')]][_0x4450('0x19')]=!![];queues[_0x4aab27[_0x4450('0xe')]][_0x4450('0x2a')]=utils[_0x4450('0x14')]();queues[_0x4aab27[_0x4450('0xe')]][_0x4450('0x1c')]=_0x4aab27[_0x4450('0x26')]['toUpperCase']();utils[_0x4450('0x2')](util[_0x4450('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4aab27[_0x4450('0xe')],queues[_0x4aab27['uniqueid']][_0x4450('0x1f')],_0x4aab27[_0x4450('0x26')],queues[_0x4aab27[_0x4450('0xe')]][_0x4450('0x1c')]));writeDB(queues[_0x4aab27[_0x4450('0xe')]]);}}else if(!_[_0x4450('0x15')](_0x4aab27['variable'][_0x4450('0x2b')])){if(!_['isNil'](queues[_0x4aab27['uniqueid']])&&!queues[_0x4aab27['uniqueid']][_0x4450('0x18')]){queues[_0x4aab27[_0x4450('0xe')]][_0x4450('0x18')]=![];queues[_0x4aab27[_0x4450('0xe')]][_0x4450('0x29')]=null;queues[_0x4aab27[_0x4450('0xe')]]['queuecallerexit']=!![];queues[_0x4aab27[_0x4450('0xe')]]['queuecallerexitAt']=utils['now']();queues[_0x4aab27[_0x4450('0xe')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x2c'),_0x4aab27['uniqueid'],queues[_0x4aab27[_0x4450('0xe')]][_0x4450('0x1f')],_0x4aab27[_0x4450('0x26')],queues[_0x4aab27[_0x4450('0xe')]][_0x4450('0x1c')]));}}}catch(_0x5f3045){utils[_0x4450('0x2d')](util[_0x4450('0x3')](_0x4450('0x23'),_0x4aab27[_0x4450('0xe')]),_0x5f3045);}};exports[_0x4450('0x18')]=function(_0x3cb6a5){try{if(!_[_0x4450('0x15')](queues[_0x3cb6a5[_0x4450('0xe')]])){utils[_0x4450('0xf')](util[_0x4450('0x3')](_0x4450('0x2e'),_0x3cb6a5[_0x4450('0xe')]),_0x3cb6a5);queues[_0x3cb6a5[_0x4450('0xe')]][_0x4450('0x19')]=![];queues[_0x3cb6a5[_0x4450('0xe')]][_0x4450('0x2a')]=null;queues[_0x3cb6a5['uniqueid']]['queuecallerabandon']=!![];queues[_0x3cb6a5[_0x4450('0xe')]]['queuecallerabandonAt']=utils[_0x4450('0x14')]();queues[_0x3cb6a5[_0x4450('0xe')]][_0x4450('0x1c')]=_0x4450('0x2f');utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x30'),_0x3cb6a5['uniqueid'],queues[_0x3cb6a5[_0x4450('0xe')]][_0x4450('0x1f')],queues[_0x3cb6a5[_0x4450('0xe')]][_0x4450('0x1c')]));}}catch(_0x31c04f){utils[_0x4450('0x2d')](util[_0x4450('0x3')](_0x4450('0x2e'),_0x3cb6a5[_0x4450('0xe')]),_0x31c04f);}};exports[_0x4450('0x31')]=function(_0x512fd3){try{if(!_[_0x4450('0x15')](queues[_0x512fd3[_0x4450('0xe')]])){utils[_0x4450('0xf')](util[_0x4450('0x3')](_0x4450('0x32'),_0x512fd3[_0x4450('0xe')]),_0x512fd3);utils[_0x4450('0x2')](util[_0x4450('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x512fd3[_0x4450('0xe')],queues[_0x512fd3['uniqueid']][_0x4450('0x1f')],_0x512fd3[_0x4450('0x33')],_0x512fd3[_0x4450('0x34')]));queues[_0x512fd3[_0x4450('0xe')]][_0x4450('0x31')]=!![];queues[_0x512fd3[_0x4450('0xe')]][_0x4450('0x17')]=utils[_0x4450('0x14')]();queues[_0x512fd3[_0x4450('0xe')]][_0x4450('0x35')]=utils[_0x4450('0x36')](queues[_0x512fd3[_0x4450('0xe')]][_0x4450('0x17')],queues[_0x512fd3[_0x4450('0xe')]][_0x4450('0x37')]);queues[_0x512fd3['uniqueid']][_0x4450('0x13')]=_0x512fd3['position'];queues[_0x512fd3[_0x4450('0xe')]][_0x4450('0x38')]=_0x512fd3['count'];queues[_0x512fd3[_0x4450('0xe')]][_0x4450('0x33')]=_0x512fd3['connectedlinenum'];queues[_0x512fd3['uniqueid']][_0x4450('0x34')]=_0x512fd3['connectedlinename'];}}catch(_0x5073af){utils[_0x4450('0x2d')](util[_0x4450('0x3')]('[%s][queues][queuecallerleave]',_0x512fd3[_0x4450('0xe')]),_0x5073af);}};exports[_0x4450('0x39')]=function(_0x3871a9){try{if(!_[_0x4450('0x15')](queues[_0x3871a9['uniqueid']])){utils[_0x4450('0xf')](util[_0x4450('0x3')](_0x4450('0x3a'),_0x3871a9[_0x4450('0xe')]),_0x3871a9);utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x3b'),_0x3871a9['uniqueid'],queues[_0x3871a9[_0x4450('0xe')]][_0x4450('0x1f')],_0x3871a9['membername'],_0x3871a9[_0x4450('0x3c')]));queues[_0x3871a9['uniqueid']]['queuecallerabandon']=![];queues[_0x3871a9[_0x4450('0xe')]][_0x4450('0x18')]=![];queues[_0x3871a9[_0x4450('0xe')]][_0x4450('0x29')]=null;queues[_0x3871a9[_0x4450('0xe')]][_0x4450('0x19')]=![];queues[_0x3871a9[_0x4450('0xe')]][_0x4450('0x1c')]=null;queues[_0x3871a9[_0x4450('0xe')]][_0x4450('0x2a')]=null;queues[_0x3871a9[_0x4450('0xe')]]['assigned']=!![];queues[_0x3871a9['uniqueid']][_0x4450('0x8')]=_0x3871a9[_0x4450('0x3c')];queues[_0x3871a9[_0x4450('0xe')]][_0x4450('0x6')]=_0x3871a9[_0x4450('0x3d')];}}catch(_0x525f1b){utils[_0x4450('0x2d')](util[_0x4450('0x3')](_0x4450('0x3a'),_0x3871a9[_0x4450('0xe')]),_0x525f1b);}};exports[_0x4450('0x3e')]=function(_0x44d631){try{if(!_[_0x4450('0x15')](queues[_0x44d631[_0x4450('0xe')]])){if(queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x17')]){utils[_0x4450('0xf')](util[_0x4450('0x3')](_0x4450('0x3f'),_0x44d631[_0x4450('0xe')]),_0x44d631);queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x18')]=![];queues[_0x44d631['uniqueid']]['queuecallerabandon']=![];queues[_0x44d631['uniqueid']]['queuecallerabandonAt']=null;queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x19')]=![];queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x2a')]=null;queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x40')]=!![];queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x6')]=_0x44d631[_0x4450('0x3d')];queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x1a')]=!![];queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x1b')]=utils[_0x4450('0x14')]();if(_0x44d631['reason']==_0x4450('0x41')){if(!queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x41')]){queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x1c')]=_0x4450('0x42');}}else{queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x1c')]=_0x4450('0x43')+_0x44d631[_0x4450('0x44')]['toUpperCase']();}utils['info'](util[_0x4450('0x3')](_0x4450('0x45'),_0x44d631[_0x4450('0xe')],queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x1f')],_0x44d631[_0x4450('0x3d')],queues[_0x44d631[_0x4450('0xe')]][_0x4450('0x1c')]));writeDB(queues[_0x44d631[_0x4450('0xe')]]);}}}catch(_0x226c17){utils[_0x4450('0x2d')](util['format'](_0x4450('0x3f'),_0x44d631[_0x4450('0xe')]),_0x226c17);}};exports[_0x4450('0x46')]=function(_0xd6476){try{if(!_['isNil'](queues[_0xd6476['transfereeuniqueid']])){utils[_0x4450('0xf')](util[_0x4450('0x3')](_0x4450('0x47'),_0xd6476[_0x4450('0xe')]),_0xd6476);queues[_0xd6476[_0x4450('0x48')]][_0x4450('0x41')]=!![];queues[_0xd6476[_0x4450('0x48')]]['transfertype']=_0x4450('0x49');queues[_0xd6476[_0x4450('0x48')]][_0x4450('0x4a')]=_0xd6476[_0x4450('0x4b')];queues[_0xd6476['transfereeuniqueid']][_0x4450('0x4c')]=_0xd6476['transfereeuniqueid'];queues[_0xd6476[_0x4450('0x48')]][_0x4450('0x1c')]=_0x4450('0x4d');utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x4e'),_0xd6476['uniqueid'],queues[_0xd6476[_0x4450('0x48')]][_0x4450('0x1f')],_0xd6476['transfereeuniqueid'],_0xd6476[_0x4450('0x4b')]));}}catch(_0x18a7ef){utils[_0x4450('0x2d')](util[_0x4450('0x3')]('[%s][queues][blindtransfer]',_0xd6476[_0x4450('0xe')]),_0x18a7ef);}};exports['attendedtransfer']=function(_0x576bd5){try{utils['debug'](util['format'](_0x4450('0x4f'),_0x576bd5['origtransfereruniqueid']),_0x576bd5);if(_0x576bd5[_0x4450('0x50')]==_0x576bd5[_0x4450('0x51')]){if(!_[_0x4450('0x15')](queues[_0x576bd5[_0x4450('0x52')]])){utils['info'](util[_0x4450('0x3')](_0x4450('0x53'),_0x576bd5['origtransfereruniqueid'],queues[_0x576bd5['secondtransfererlinkedid']]['name'],_0x576bd5[_0x4450('0x54')]));queues[_0x576bd5[_0x4450('0x52')]][_0x4450('0x41')]=!![];queues[_0x576bd5[_0x4450('0x52')]][_0x4450('0x55')]=_0x4450('0x56');queues[_0x576bd5[_0x4450('0x52')]]['transferexten']=_0x576bd5[_0x4450('0x54')];queues[_0x576bd5['secondtransfererlinkedid']]['transferuniqueid']=_0x576bd5[_0x4450('0x50')];queues[_0x576bd5[_0x4450('0x52')]][_0x4450('0x1c')]='ATTENDEDTRANSFER';}if(!_[_0x4450('0x15')](queues[_0x576bd5[_0x4450('0x51')]])){if(_0x576bd5['transfereelinkedid']&&queues[_0x576bd5[_0x4450('0x57')]]){queues[_0x576bd5['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x576bd5[_0x4450('0x48')]]=_['clone'](queues[_0x576bd5[_0x4450('0x57')]]);queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0xd')]=_0x576bd5[_0x4450('0x58')];queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0x21')]=0x2;queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0x7')]=queues[_0x576bd5['secondtransfererlinkedid']]['calleridnum'];queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0x59')]=queues[_0x576bd5[_0x4450('0x52')]][_0x4450('0x59')];queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0x37')]=utils['now']();queues[_0x576bd5['transfereeuniqueid']][_0x4450('0x17')]=utils[_0x4450('0x14')]();queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0x35')]=0x0;queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0x5a')]=0x0;utils[_0x4450('0x2')](util[_0x4450('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x576bd5[_0x4450('0x50')],queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0x1f')],queues[_0x576bd5[_0x4450('0x48')]][_0x4450('0x7')],queues[_0x576bd5['transfereeuniqueid']][_0x4450('0x59')]));}else{utils['info'](util[_0x4450('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x576bd5[_0x4450('0x50')],queues[_0x576bd5[_0x4450('0x51')]][_0x4450('0x1f')],_0x576bd5[_0x4450('0x52')]));queues[_0x576bd5[_0x4450('0x51')]][_0x4450('0xd')]=_0x576bd5[_0x4450('0x52')];}}}else if(_0x576bd5[_0x4450('0x5b')]==_0x576bd5[_0x4450('0x52')]){if(!_[_0x4450('0x15')](queues[_0x576bd5[_0x4450('0x51')]])){utils[_0x4450('0x2')](util['format'](_0x4450('0x5c'),_0x576bd5[_0x4450('0x50')],queues[_0x576bd5[_0x4450('0x51')]][_0x4450('0x1f')],_0x576bd5[_0x4450('0x5b')],_0x576bd5[_0x4450('0x5d')]));queues[_0x576bd5[_0x4450('0x51')]][_0x4450('0x41')]=!![];queues[_0x576bd5[_0x4450('0x51')]][_0x4450('0x55')]=_0x4450('0x56');queues[_0x576bd5['origtransfererlinkedid']][_0x4450('0x4a')]=_0x576bd5[_0x4450('0x5d')];queues[_0x576bd5[_0x4450('0x51')]][_0x4450('0x4c')]=_0x576bd5['secondtransfereruniqueid'];queues[_0x576bd5['origtransfererlinkedid']][_0x4450('0x1c')]='ATTENDEDTRANSFER';}if(!_[_0x4450('0x15')](queues[_0x576bd5['secondtransfererlinkedid']])){if(_0x576bd5['transfertargetlinkedid']&&queues[_0x576bd5[_0x4450('0x5e')]]){queues[_0x576bd5[_0x4450('0x5e')]]['queuecallerenterreason']=0x1;queues[_0x576bd5[_0x4450('0x58')]]=_[_0x4450('0x5f')](queues[_0x576bd5[_0x4450('0x5e')]]);queues[_0x576bd5[_0x4450('0x58')]][_0x4450('0xd')]=_0x576bd5[_0x4450('0x58')];queues[_0x576bd5[_0x4450('0x58')]]['queuecallerenterreason']=0x2;queues[_0x576bd5[_0x4450('0x58')]]['calleridnum']=queues[_0x576bd5[_0x4450('0x51')]][_0x4450('0x7')];queues[_0x576bd5[_0x4450('0x58')]][_0x4450('0x59')]=queues[_0x576bd5[_0x4450('0x51')]]['calleridname'];queues[_0x576bd5['transfertargetuniqueid']][_0x4450('0x37')]=utils['now']();queues[_0x576bd5[_0x4450('0x58')]][_0x4450('0x17')]=utils[_0x4450('0x14')]();queues[_0x576bd5['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x576bd5[_0x4450('0x58')]][_0x4450('0x5a')]=0x0;utils[_0x4450('0x2')](util[_0x4450('0x3')](_0x4450('0x60'),_0x576bd5[_0x4450('0x50')],queues[_0x576bd5['transfertargetuniqueid']]['name'],queues[_0x576bd5['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x576bd5[_0x4450('0x58')]][_0x4450('0x7')],queues[_0x576bd5[_0x4450('0x58')]][_0x4450('0x59')]));}else{utils[_0x4450('0x2')](util['format'](_0x4450('0x61'),_0x576bd5['origtransfereruniqueid'],queues[_0x576bd5[_0x4450('0x52')]][_0x4450('0x1f')],_0x576bd5[_0x4450('0x51')]));queues[_0x576bd5['secondtransfererlinkedid']][_0x4450('0xd')]=_0x576bd5[_0x4450('0x51')];}}}}catch(_0xc93fea){utils['error'](util[_0x4450('0x3')](_0x4450('0x4f'),_0x576bd5[_0x4450('0x50')]),_0xc93fea);}};exports[_0x4450('0x62')]=function(_0x41d5e4){try{if(!_[_0x4450('0x15')](queues[_0x41d5e4[_0x4450('0xe')]])){utils['debug'](util['format']('[%s][queues][musiconholdstart]',_0x41d5e4['uniqueid']),_0x41d5e4);queues[_0x41d5e4[_0x4450('0xe')]][_0x4450('0x63')]=utils[_0x4450('0x14')]();utils[_0x4450('0x2')](util[_0x4450('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x41d5e4[_0x4450('0xe')],queues[_0x41d5e4[_0x4450('0xe')]]['name'],queues[_0x41d5e4[_0x4450('0xe')]][_0x4450('0x63')]));}}catch(_0x2f418b){utils[_0x4450('0x2d')](util[_0x4450('0x3')](_0x4450('0x64'),_0x41d5e4[_0x4450('0xe')]),_0x2f418b);}};exports[_0x4450('0x65')]=function(_0x23ea70){try{if(!_[_0x4450('0x15')](queues[_0x23ea70[_0x4450('0xe')]])){if(!_[_0x4450('0x15')](queues[_0x23ea70['uniqueid']][_0x4450('0x63')])){utils[_0x4450('0xf')](util[_0x4450('0x3')]('[%s][queues][musiconholdstop]',_0x23ea70['uniqueid']),_0x23ea70);queues[_0x23ea70[_0x4450('0xe')]][_0x4450('0x5a')]+=utils[_0x4450('0x36')](utils[_0x4450('0x14')](),queues[_0x23ea70[_0x4450('0xe')]][_0x4450('0x63')]);utils['info'](util[_0x4450('0x3')](_0x4450('0x66'),_0x23ea70[_0x4450('0xe')],queues[_0x23ea70[_0x4450('0xe')]][_0x4450('0x1f')],queues[_0x23ea70[_0x4450('0xe')]][_0x4450('0x5a')]));delete queues[_0x23ea70['uniqueid']][_0x4450('0x63')];}}}catch(_0x345e12){utils[_0x4450('0x2d')](util[_0x4450('0x3')](_0x4450('0x67'),_0x23ea70[_0x4450('0xe')]),_0x345e12);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5b881d0..9bd8b55 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 _0x6abc=['debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','find','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','monitors','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','uniqueid','accountcode','then','membername','name','request','CreateVoiceRecording'];(function(_0x1433b2,_0x2a23de){var _0x253c75=function(_0x59df3b){while(--_0x59df3b){_0x1433b2['push'](_0x1433b2['shift']());}};_0x253c75(++_0x2a23de);}(_0x6abc,0x1b5));var _0xc6ab=function(_0x3f1438,_0x2fb615){_0x3f1438=_0x3f1438-0x0;var _0x2d209f=_0x6abc[_0x3f1438];return _0x2d209f;};'use strict';var _=require(_0xc6ab('0x0'));var util=require(_0xc6ab('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x182a46){utils[_0xc6ab('0x2')](util[_0xc6ab('0x3')]('[%s][recordings][writeDB]',_0x182a46[_0xc6ab('0x4')]));if(_0x182a46['accountcode']){utils['getUserByInternal'](_0x182a46[_0xc6ab('0x5')])[_0xc6ab('0x6')](function(_0x227163){if(_0x227163){_0x182a46[_0xc6ab('0x7')]=_0x227163[_0xc6ab('0x8')];_0x182a46['UserId']=_0x227163['id'];}utils[_0xc6ab('0x9')](_0xc6ab('0xa'),_0x182a46);});}else{utils['request']('CreateVoiceRecording',_0x182a46);}}exports['newchannel']=function(_0xbb9d47){try{utils[_0xc6ab('0xb')](util[_0xc6ab('0x3')](_0xc6ab('0xc'),_0xbb9d47['uniqueid']),_0xbb9d47);if(_0xbb9d47['uniqueid']==_0xbb9d47[_0xc6ab('0xd')]){utils['info'](util[_0xc6ab('0x3')](_0xc6ab('0xe'),_0xbb9d47['uniqueid'],_0xbb9d47[_0xc6ab('0xf')],_0xbb9d47[_0xc6ab('0x10')]));recordings[_0xbb9d47[_0xc6ab('0x4')]]={'uniqueid':_0xbb9d47[_0xc6ab('0x4')],'accountcode':_0xbb9d47['accountcode'],'exten':_0xbb9d47[_0xc6ab('0x10')],'context':_0xbb9d47[_0xc6ab('0xf')],'channel':_0xbb9d47[_0xc6ab('0x11')],'monitors':[]};}}catch(_0x3df627){utils[_0xc6ab('0x12')](util['format'](_0xc6ab('0xc'),_0xbb9d47[_0xc6ab('0x4')]),_0x3df627);}};exports[_0xc6ab('0x13')]=function(_0x26dfaa){try{utils[_0xc6ab('0xb')](util[_0xc6ab('0x3')](_0xc6ab('0x14'),_0x26dfaa['uniqueid']),_0x26dfaa);if(!_['isNil'](recordings[_0x26dfaa['uniqueid']])&&_0x26dfaa[_0xc6ab('0x15')]==0x6){utils[_0xc6ab('0x2')](util[_0xc6ab('0x3')](_0xc6ab('0x16'),_0x26dfaa[_0xc6ab('0x4')],_0x26dfaa[_0xc6ab('0xf')],_0x26dfaa['channel']));}else if(!_[_0xc6ab('0x17')](recordings[_0x26dfaa['linkedid']])&&_0x26dfaa[_0xc6ab('0x15')]==0x6&&_0x26dfaa[_0xc6ab('0xf')]!=_0xc6ab('0x18')){utils['info'](util[_0xc6ab('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x26dfaa[_0xc6ab('0x4')],_0x26dfaa[_0xc6ab('0xd')],_0x26dfaa[_0xc6ab('0xf')],_0x26dfaa[_0xc6ab('0x11')]));recordings[_0x26dfaa['linkedid']]['accountcode']=_0x26dfaa[_0xc6ab('0x5')];}}catch(_0xda43db){utils[_0xc6ab('0x12')](util[_0xc6ab('0x3')]('[%s][recordings][newstate]',_0x26dfaa[_0xc6ab('0x4')]),_0xda43db);}};exports[_0xc6ab('0x19')]=function(_0x19a140){try{if(!_['isNil'](_0x19a140[_0xc6ab('0x1a')])&&!_[_0xc6ab('0x17')](_0x19a140[_0xc6ab('0x1a')][_0xc6ab('0x1b')])){utils['debug'](util[_0xc6ab('0x3')](_0xc6ab('0x1c'),_0x19a140[_0xc6ab('0x4')]),_0x19a140);utils['info'](util[_0xc6ab('0x3')](_0xc6ab('0x1d'),_0x19a140[_0xc6ab('0x4')],_0x19a140['variable'],_0x19a140['value']));if(_[_0xc6ab('0x1e')](_0x19a140[_0xc6ab('0x1f')],_0xc6ab('0x20'))){_0x19a140['value']=_0x19a140[_0xc6ab('0x1f')][_0xc6ab('0x21')]('.wav49','.WAV');}if(recordings[_0x19a140[_0xc6ab('0xd')]]){var _0x209767=_[_0xc6ab('0x22')](recordings[_0x19a140[_0xc6ab('0xd')]]['monitors'],{'value':_0x19a140['value']});if(_['isNil'](_0x209767)){recordings[_0x19a140['linkedid']]['monitors'][_0xc6ab('0x23')]({'value':_0x19a140[_0xc6ab('0x1f')]});}}}}catch(_0x3aef43){utils[_0xc6ab('0x12')](util[_0xc6ab('0x3')]('[%s][recordings][varset]',_0x19a140[_0xc6ab('0x4')]),_0x3aef43);}};exports[_0xc6ab('0x24')]=function(_0x4e8d63){try{if(!_[_0xc6ab('0x17')](recordings[_0x4e8d63[_0xc6ab('0x4')]])){utils[_0xc6ab('0xb')](util['format'](_0xc6ab('0x25'),_0x4e8d63['uniqueid']),_0x4e8d63);utils[_0xc6ab('0x2')](util[_0xc6ab('0x3')](_0xc6ab('0x26'),_0x4e8d63[_0xc6ab('0x4')],_0x4e8d63[_0xc6ab('0x27')],_0x4e8d63[_0xc6ab('0x28')],_0x4e8d63[_0xc6ab('0x29')]));recordings[_0x4e8d63[_0xc6ab('0x4')]]['calleridnum']=_0x4e8d63[_0xc6ab('0x27')];recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x28')]=_0x4e8d63['calleridname'];recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2a')]=_0x4e8d63[_0xc6ab('0x2a')];recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2b')]=_0x4e8d63['connectedlinename'];if(recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2c')]==_0xc6ab('0x2d')&&recordings[_0x4e8d63[_0xc6ab('0x4')]]['accountcode']){recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2a')]=recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x5')];recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2b')]='';}recordings[_0x4e8d63[_0xc6ab('0x4')]][_0xc6ab('0x2e')][_0xc6ab('0x2f')](function(_0x27f318){var _0x4ebc91=_[_0xc6ab('0x30')](recordings[_0x4e8d63[_0xc6ab('0x4')]]);_0x4ebc91[_0xc6ab('0x1f')]=_0x27f318[_0xc6ab('0x1f')];writeDB(_0x4ebc91);});delete recordings[_0x4e8d63[_0xc6ab('0x4')]];}}catch(_0x5d140c){utils['error'](util['format'](_0xc6ab('0x25'),_0x4e8d63[_0xc6ab('0x4')]),_0x5d140c);}};exports[_0xc6ab('0x31')]=function(_0x3b3610){try{if(!_[_0xc6ab('0x17')](recordings[_0x3b3610['uniqueid']])){utils[_0xc6ab('0xb')](util[_0xc6ab('0x3')](_0xc6ab('0x32'),_0x3b3610[_0xc6ab('0x4')]),_0x3b3610);utils['info'](util[_0xc6ab('0x3')](_0xc6ab('0x33'),_0x3b3610['uniqueid'],_0x3b3610[_0xc6ab('0x34')],_0x3b3610[_0xc6ab('0x35')]));if(_0x3b3610['application'][_0xc6ab('0x36')]()==_0xc6ab('0x37')&&_[_0xc6ab('0x38')](_0x3b3610[_0xc6ab('0x35')][_0xc6ab('0x36')](),_0xc6ab('0x39'))){var _0x54c5fc=_0x3b3610['appdata']['split']('=');var _0x1dd414=_0x54c5fc[0x0][_0xc6ab('0x3a')](_0x54c5fc[0x0][_0xc6ab('0x3b')]('(')+0x1,_0x54c5fc[0x0][_0xc6ab('0x3b')](')'));var _0x496f16=_0x54c5fc[0x1];recordings[_0x3b3610['uniqueid']][_0x1dd414]=_0x496f16;}}}catch(_0x26cbac){utils[_0xc6ab('0x12')](util[_0xc6ab('0x3')]('[%s][recordings][newexten]',_0x3b3610['uniqueid']),_0x26cbac);}};exports[_0xc6ab('0x3c')]=function(_0x2a7e30){try{if(!_[_0xc6ab('0x17')](recordings[_0x2a7e30[_0xc6ab('0x4')]])){utils[_0xc6ab('0xb')](util['format'](_0xc6ab('0x3d'),_0x2a7e30[_0xc6ab('0x4')]),_0x2a7e30);utils[_0xc6ab('0x2')](util[_0xc6ab('0x3')](_0xc6ab('0x3e'),_0x2a7e30[_0xc6ab('0x4')],_0x2a7e30['queue']));recordings[_0x2a7e30[_0xc6ab('0x4')]][_0xc6ab('0x3f')]=_0x2a7e30[_0xc6ab('0x3f')];}}catch(_0x3bb727){utils[_0xc6ab('0x12')](util[_0xc6ab('0x3')]('[%s][recordings][queuecallerjoin]',_0x2a7e30[_0xc6ab('0x4')]),_0x3bb727);}}; \ No newline at end of file +var _0x7b63=['connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','[%s][recordings][newchannel]','linkedid','exten','context','error','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find','monitors','push','hangup','debug','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7b63,0x154));var _0x37b6=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7b63[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x37b6('0x0'));var util=require(_0x37b6('0x1'));var utils=require(_0x37b6('0x2'));var recordings={};function writeDB(_0x1575f0){utils[_0x37b6('0x3')](util[_0x37b6('0x4')](_0x37b6('0x5'),_0x1575f0[_0x37b6('0x6')]));if(_0x1575f0[_0x37b6('0x7')]){utils[_0x37b6('0x8')](_0x1575f0[_0x37b6('0x7')])[_0x37b6('0x9')](function(_0x3e071f){if(_0x3e071f){_0x1575f0[_0x37b6('0xa')]=_0x3e071f[_0x37b6('0xb')];_0x1575f0[_0x37b6('0xc')]=_0x3e071f['id'];}utils[_0x37b6('0xd')](_0x37b6('0xe'),_0x1575f0);});}else{utils[_0x37b6('0xd')](_0x37b6('0xe'),_0x1575f0);}}exports['newchannel']=function(_0x2e42ac){try{utils['debug'](util['format'](_0x37b6('0xf'),_0x2e42ac['uniqueid']),_0x2e42ac);if(_0x2e42ac['uniqueid']==_0x2e42ac[_0x37b6('0x10')]){utils['info'](util[_0x37b6('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2e42ac[_0x37b6('0x6')],_0x2e42ac['context'],_0x2e42ac[_0x37b6('0x11')]));recordings[_0x2e42ac['uniqueid']]={'uniqueid':_0x2e42ac[_0x37b6('0x6')],'accountcode':_0x2e42ac[_0x37b6('0x7')],'exten':_0x2e42ac[_0x37b6('0x11')],'context':_0x2e42ac[_0x37b6('0x12')],'channel':_0x2e42ac['channel'],'monitors':[]};}}catch(_0x357fe3){utils[_0x37b6('0x13')](util[_0x37b6('0x4')](_0x37b6('0xf'),_0x2e42ac[_0x37b6('0x6')]),_0x357fe3);}};exports[_0x37b6('0x14')]=function(_0x4d6274){try{utils['debug'](util[_0x37b6('0x4')](_0x37b6('0x15'),_0x4d6274['uniqueid']),_0x4d6274);if(!_[_0x37b6('0x16')](recordings[_0x4d6274['uniqueid']])&&_0x4d6274[_0x37b6('0x17')]==0x6){utils['info'](util[_0x37b6('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4d6274[_0x37b6('0x6')],_0x4d6274[_0x37b6('0x12')],_0x4d6274['channel']));}else if(!_['isNil'](recordings[_0x4d6274[_0x37b6('0x10')]])&&_0x4d6274[_0x37b6('0x17')]==0x6&&_0x4d6274['context']!=_0x37b6('0x18')){utils['info'](util['format'](_0x37b6('0x19'),_0x4d6274[_0x37b6('0x6')],_0x4d6274['linkedid'],_0x4d6274[_0x37b6('0x12')],_0x4d6274['channel']));recordings[_0x4d6274['linkedid']]['accountcode']=_0x4d6274[_0x37b6('0x7')];}}catch(_0x1e6757){utils[_0x37b6('0x13')](util[_0x37b6('0x4')]('[%s][recordings][newstate]',_0x4d6274[_0x37b6('0x6')]),_0x1e6757);}};exports[_0x37b6('0x1a')]=function(_0x21f8d5){try{if(!_[_0x37b6('0x16')](_0x21f8d5[_0x37b6('0x1b')])&&!_[_0x37b6('0x16')](_0x21f8d5['variable'][_0x37b6('0x1c')])){utils['debug'](util[_0x37b6('0x4')](_0x37b6('0x1d'),_0x21f8d5[_0x37b6('0x6')]),_0x21f8d5);utils[_0x37b6('0x3')](util[_0x37b6('0x4')](_0x37b6('0x1e'),_0x21f8d5[_0x37b6('0x6')],_0x21f8d5[_0x37b6('0x1b')],_0x21f8d5[_0x37b6('0x1f')]));if(_[_0x37b6('0x20')](_0x21f8d5[_0x37b6('0x1f')],_0x37b6('0x21'))){_0x21f8d5[_0x37b6('0x1f')]=_0x21f8d5[_0x37b6('0x1f')]['replace'](_0x37b6('0x21'),_0x37b6('0x22'));}if(recordings[_0x21f8d5['linkedid']]){var _0x395da0=_[_0x37b6('0x23')](recordings[_0x21f8d5['linkedid']][_0x37b6('0x24')],{'value':_0x21f8d5[_0x37b6('0x1f')]});if(_[_0x37b6('0x16')](_0x395da0)){recordings[_0x21f8d5['linkedid']]['monitors'][_0x37b6('0x25')]({'value':_0x21f8d5[_0x37b6('0x1f')]});}}}}catch(_0x1a071b){utils[_0x37b6('0x13')](util[_0x37b6('0x4')](_0x37b6('0x1d'),_0x21f8d5[_0x37b6('0x6')]),_0x1a071b);}};exports[_0x37b6('0x26')]=function(_0x113794){try{if(!_[_0x37b6('0x16')](recordings[_0x113794[_0x37b6('0x6')]])){utils[_0x37b6('0x27')](util[_0x37b6('0x4')](_0x37b6('0x28'),_0x113794[_0x37b6('0x6')]),_0x113794);utils['info'](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x113794['uniqueid'],_0x113794['calleridnum'],_0x113794['calleridname'],_0x113794['cause-txt']));recordings[_0x113794[_0x37b6('0x6')]][_0x37b6('0x29')]=_0x113794[_0x37b6('0x29')];recordings[_0x113794[_0x37b6('0x6')]][_0x37b6('0x2a')]=_0x113794[_0x37b6('0x2a')];recordings[_0x113794['uniqueid']][_0x37b6('0x2b')]=_0x113794[_0x37b6('0x2b')];recordings[_0x113794[_0x37b6('0x6')]][_0x37b6('0x2c')]=_0x113794['connectedlinename'];if(recordings[_0x113794[_0x37b6('0x6')]][_0x37b6('0x2d')]=='outbound'&&recordings[_0x113794[_0x37b6('0x6')]][_0x37b6('0x7')]){recordings[_0x113794[_0x37b6('0x6')]]['connectedlinenum']=recordings[_0x113794['uniqueid']][_0x37b6('0x7')];recordings[_0x113794['uniqueid']][_0x37b6('0x2c')]='';}recordings[_0x113794[_0x37b6('0x6')]]['monitors'][_0x37b6('0x2e')](function(_0x231089){var _0xd36746=_[_0x37b6('0x2f')](recordings[_0x113794[_0x37b6('0x6')]]);_0xd36746['value']=_0x231089[_0x37b6('0x1f')];writeDB(_0xd36746);});delete recordings[_0x113794[_0x37b6('0x6')]];}}catch(_0x4fd410){utils['error'](util['format'](_0x37b6('0x28'),_0x113794['uniqueid']),_0x4fd410);}};exports[_0x37b6('0x30')]=function(_0x3eeb63){try{if(!_[_0x37b6('0x16')](recordings[_0x3eeb63['uniqueid']])){utils[_0x37b6('0x27')](util[_0x37b6('0x4')](_0x37b6('0x31'),_0x3eeb63['uniqueid']),_0x3eeb63);utils[_0x37b6('0x3')](util[_0x37b6('0x4')](_0x37b6('0x32'),_0x3eeb63[_0x37b6('0x6')],_0x3eeb63['application'],_0x3eeb63['appdata']));if(_0x3eeb63[_0x37b6('0x33')][_0x37b6('0x34')]()==_0x37b6('0x35')&&_[_0x37b6('0x36')](_0x3eeb63['appdata'][_0x37b6('0x34')](),_0x37b6('0x37'))){var _0x2fb0bf=_0x3eeb63[_0x37b6('0x38')][_0x37b6('0x39')]('=');var _0x568ef2=_0x2fb0bf[0x0][_0x37b6('0x3a')](_0x2fb0bf[0x0][_0x37b6('0x3b')]('(')+0x1,_0x2fb0bf[0x0]['lastIndexOf'](')'));var _0x5eaf18=_0x2fb0bf[0x1];recordings[_0x3eeb63[_0x37b6('0x6')]][_0x568ef2]=_0x5eaf18;}}}catch(_0x56f758){utils[_0x37b6('0x13')](util[_0x37b6('0x4')]('[%s][recordings][newexten]',_0x3eeb63['uniqueid']),_0x56f758);}};exports[_0x37b6('0x3c')]=function(_0x400ae3){try{if(!_['isNil'](recordings[_0x400ae3['uniqueid']])){utils[_0x37b6('0x27')](util[_0x37b6('0x4')](_0x37b6('0x3d'),_0x400ae3[_0x37b6('0x6')]),_0x400ae3);utils[_0x37b6('0x3')](util[_0x37b6('0x4')](_0x37b6('0x3e'),_0x400ae3[_0x37b6('0x6')],_0x400ae3[_0x37b6('0x3f')]));recordings[_0x400ae3[_0x37b6('0x6')]]['queue']=_0x400ae3['queue'];}}catch(_0x2eb30d){utils['error'](util['format'](_0x37b6('0x3d'),_0x400ae3[_0x37b6('0x6')]),_0x2eb30d);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 39aec62..e7f01d0 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 _0xc868=['[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer'];(function(_0x39e58f,_0xf91bc5){var _0x541ec7=function(_0x17028a){while(--_0x17028a){_0x39e58f['push'](_0x39e58f['shift']());}};_0x541ec7(++_0xf91bc5);}(_0xc868,0x93));var _0x8c86=function(_0x534e9c,_0x521703){_0x534e9c=_0x534e9c-0x0;var _0x53192f=_0xc868[_0x534e9c];return _0x53192f;};'use strict';var _=require(_0x8c86('0x0'));var util=require(_0x8c86('0x1'));var utils=require(_0x8c86('0x2'));function writeDB(_0x43573a){utils[_0x8c86('0x3')](util[_0x8c86('0x4')](_0x8c86('0x5'),_0x43573a[_0x8c86('0x6')]===_0x8c86('0x7')?_0x43573a[_0x8c86('0x8')]:_0x43573a['uniqueid'],_0x43573a[_0x8c86('0x6')]));utils[_0x8c86('0x9')](_0x8c86('0xa'),_0x43573a);}exports[_0x8c86('0xb')]={};exports[_0x8c86('0xc')]=function(_0x1325c8){try{utils['debug'](util[_0x8c86('0x4')](_0x8c86('0xd'),_0x1325c8[_0x8c86('0xe')]),_0x1325c8);utils[_0x8c86('0x3')](util[_0x8c86('0x4')](_0x8c86('0xf'),_0x1325c8[_0x8c86('0xe')],_0x1325c8[_0x8c86('0x10')],_0x1325c8['transferercalleridname'],_0x1325c8[_0x8c86('0x11')],_0x1325c8[_0x8c86('0x12')]));_0x1325c8[_0x8c86('0x6')]='blind';exports[_0x8c86('0xb')][_0x1325c8[_0x8c86('0x13')]]=_0x1325c8;writeDB(_0x1325c8);}catch(_0x50970d){utils[_0x8c86('0x14')](util[_0x8c86('0x4')](_0x8c86('0xd'),_0x1325c8[_0x8c86('0xe')]),_0x50970d);}};exports[_0x8c86('0x15')]=function(_0xe2798b){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0xe2798b['origtransfereruniqueid']),_0xe2798b);utils[_0x8c86('0x3')](util['format'](_0x8c86('0x16'),_0xe2798b[_0x8c86('0x8')],_0xe2798b[_0x8c86('0x17')],_0xe2798b[_0x8c86('0x18')],_0xe2798b['transfertargetcalleridnum'],_0xe2798b[_0x8c86('0x19')]));_0xe2798b=_[_0x8c86('0x1a')](_0xe2798b,{'transfererchannel':_0xe2798b[_0x8c86('0x1b')],'transferercalleridnum':_0xe2798b[_0x8c86('0x17')],'transferercalleridname':_0xe2798b['origtransferercalleridname'],'transfererconnectedlinenum':_0xe2798b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xe2798b[_0x8c86('0x1c')],'transfereraccountcode':_0xe2798b['origtransfereraccountcode'],'transferercontext':_0xe2798b['secondtransferercontext'],'transfererexten':_0xe2798b[_0x8c86('0x1d')],'transfererlinkedid':_0xe2798b[_0x8c86('0x1e')],'context':_0xe2798b['origtransferercontext'],'extension':_0xe2798b[_0x8c86('0x1f')],'type':_0x8c86('0x7')});if(_['isNil'](_0xe2798b[_0x8c86('0x20')])){_0xe2798b=_['assign'](_0xe2798b,{'transfereechannel':_0xe2798b[_0x8c86('0x21')],'transfereecalleridnum':_0xe2798b[_0x8c86('0x22')],'transfereecalleridname':_0xe2798b[_0x8c86('0x19')],'transfereeconnectedlinenum':_0xe2798b[_0x8c86('0x23')],'transfereeconnectedlinename':_0xe2798b['transfertargetconnectedlinename'],'transfereeaccountcode':_0xe2798b[_0x8c86('0x24')],'transfereecontext':_0xe2798b[_0x8c86('0x25')],'transfereeexten':_0xe2798b[_0x8c86('0x26')],'transfereelinkedid':_0xe2798b[_0x8c86('0x27')]});}writeDB(_0xe2798b);}catch(_0x2a2c82){utils['error'](util['format']('[%s][transfers][attendedtransfer]',_0xe2798b[_0x8c86('0x8')]),_0x2a2c82);}}; \ No newline at end of file +var _0x89dc=['attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type'];(function(_0x5de889,_0x115fc4){var _0x549a4f=function(_0x1255e8){while(--_0x1255e8){_0x5de889['push'](_0x5de889['shift']());}};_0x549a4f(++_0x115fc4);}(_0x89dc,0xda));var _0xc89d=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x89dc[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xc89d('0x0'));var util=require(_0xc89d('0x1'));var utils=require(_0xc89d('0x2'));function writeDB(_0x3ad873){utils[_0xc89d('0x3')](util[_0xc89d('0x4')](_0xc89d('0x5'),_0x3ad873[_0xc89d('0x6')]===_0xc89d('0x7')?_0x3ad873[_0xc89d('0x8')]:_0x3ad873[_0xc89d('0x9')],_0x3ad873[_0xc89d('0x6')]));utils[_0xc89d('0xa')](_0xc89d('0xb'),_0x3ad873);}exports[_0xc89d('0xc')]={};exports[_0xc89d('0xd')]=function(_0x10a776){try{utils[_0xc89d('0xe')](util[_0xc89d('0x4')](_0xc89d('0xf'),_0x10a776[_0xc89d('0x9')]),_0x10a776);utils[_0xc89d('0x3')](util[_0xc89d('0x4')](_0xc89d('0x10'),_0x10a776[_0xc89d('0x9')],_0x10a776[_0xc89d('0x11')],_0x10a776[_0xc89d('0x12')],_0x10a776['transfereecalleridnum'],_0x10a776[_0xc89d('0x13')]));_0x10a776['type']=_0xc89d('0x14');exports[_0xc89d('0xc')][_0x10a776[_0xc89d('0x15')]]=_0x10a776;writeDB(_0x10a776);}catch(_0x2645ce){utils['error'](util[_0xc89d('0x4')]('[%s][transfers][blindtransfer]',_0x10a776['uniqueid']),_0x2645ce);}};exports[_0xc89d('0x16')]=function(_0x44d58e){try{utils[_0xc89d('0xe')](util[_0xc89d('0x4')](_0xc89d('0x17'),_0x44d58e[_0xc89d('0x8')]),_0x44d58e);utils[_0xc89d('0x3')](util[_0xc89d('0x4')](_0xc89d('0x18'),_0x44d58e['origtransfereruniqueid'],_0x44d58e[_0xc89d('0x19')],_0x44d58e[_0xc89d('0x1a')],_0x44d58e['transfertargetcalleridnum'],_0x44d58e[_0xc89d('0x1b')]));_0x44d58e=_[_0xc89d('0x1c')](_0x44d58e,{'transfererchannel':_0x44d58e[_0xc89d('0x1d')],'transferercalleridnum':_0x44d58e[_0xc89d('0x19')],'transferercalleridname':_0x44d58e[_0xc89d('0x1a')],'transfererconnectedlinenum':_0x44d58e[_0xc89d('0x1e')],'transfererconnectedlinename':_0x44d58e[_0xc89d('0x1f')],'transfereraccountcode':_0x44d58e[_0xc89d('0x20')],'transferercontext':_0x44d58e[_0xc89d('0x21')],'transfererexten':_0x44d58e[_0xc89d('0x22')],'transfererlinkedid':_0x44d58e[_0xc89d('0x23')],'context':_0x44d58e[_0xc89d('0x24')],'extension':_0x44d58e[_0xc89d('0x25')],'type':'attended'});if(_['isNil'](_0x44d58e['transfereechannel'])){_0x44d58e=_[_0xc89d('0x1c')](_0x44d58e,{'transfereechannel':_0x44d58e[_0xc89d('0x26')],'transfereecalleridnum':_0x44d58e[_0xc89d('0x27')],'transfereecalleridname':_0x44d58e[_0xc89d('0x1b')],'transfereeconnectedlinenum':_0x44d58e[_0xc89d('0x28')],'transfereeconnectedlinename':_0x44d58e[_0xc89d('0x29')],'transfereeaccountcode':_0x44d58e[_0xc89d('0x2a')],'transfereecontext':_0x44d58e[_0xc89d('0x2b')],'transfereeexten':_0x44d58e['transfertargetexten'],'transfereelinkedid':_0x44d58e[_0xc89d('0x2c')]});}writeDB(_0x44d58e);}catch(_0x325a04){utils['error'](util['format']('[%s][transfers][attendedtransfer]',_0x44d58e['origtransfereruniqueid']),_0x325a04);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index d5b454b..7050fd9 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 _0x76ce=['[utils][getVoiceQueueByName]\x20name:%s','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isBefore','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser','internal','name','stringify','length','result','then','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout'];(function(_0x4dd7c2,_0x5e86af){var _0x48ae97=function(_0x477727){while(--_0x477727){_0x4dd7c2['push'](_0x4dd7c2['shift']());}};_0x48ae97(++_0x5e86af);}(_0x76ce,0xb6));var _0xe76c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x76ce[_0x297fd3];return _0x2af381;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe76c('0x0'));var moment=require('moment');var util=require(_0xe76c('0x1'));var client=jayson[_0xe76c('0x2')][_0xe76c('0x3')]({'port':0x2329});var logger=require(_0xe76c('0x4'))(_0xe76c('0x5'));exports[_0xe76c('0x6')]=function(_0x2af400,_0x4ecb71){logger[_0xe76c('0x6')](_0x2af400,_0x4ecb71?util[_0xe76c('0x7')](_0x4ecb71,{'showHidden':![],'depth':null}):'');};exports[_0xe76c('0x8')]=function(_0x2bab39,_0x709b29){logger[_0xe76c('0x8')](_0x2bab39,_0x709b29?util[_0xe76c('0x7')](_0x709b29,{'showHidden':![],'depth':null}):'');};exports[_0xe76c('0x9')]=function(_0x5ad201,_0x3c3e1b){logger[_0xe76c('0x9')](_0x5ad201,_0x3c3e1b?util['inspect'](_0x3c3e1b,{'showHidden':![],'depth':null}):'');};exports[_0xe76c('0xa')]=function(_0x267895,_0x2713d1){return client[_0xe76c('0xa')](_0x267895,{'body':_0x2713d1})['then'](function(_0xe4ce57){logger['debug']('[utils][request]\x20name:%s',_0x267895,_0xe4ce57?util[_0xe76c('0x7')](_0xe4ce57,{'showHidden':![],'depth':null}):'');})[_0xe76c('0xb')](function(_0x421030){logger[_0xe76c('0x9')](_0xe76c('0xc'),_0x267895,_0x421030?util['inspect'](_0x421030,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3e4a6d){return client[_0xe76c('0xa')](_0xe76c('0xd'),{'options':{'raw':!![],'attributes':['id',_0xe76c('0xe'),_0xe76c('0xf'),'interface'],'where':_0x3e4a6d,'limit':0x1}})['then'](function(_0x61a869){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0xe76c('0x10')](_0x3e4a6d),_0x61a869?util[_0xe76c('0x7')](_0x61a869,{'showHidden':![],'depth':null}):'');return _0x61a869['result'][_0xe76c('0x11')]?_0x61a869[_0xe76c('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x1c5f18){return new BPromise(function(_0x1ea908,_0x42f65e){if(_0x1c5f18){return getUser({'internal':_0x1c5f18})[_0xe76c('0x13')](function(_0x421c3f){logger[_0xe76c('0x6')](_0xe76c('0x14'),_0x1c5f18,_0x421c3f?_0xe76c('0x15'):_0xe76c('0x16'));return _0x1ea908(_0x421c3f);})[_0xe76c('0xb')](function(_0x48bb96){logger['error'](_0xe76c('0x17'),_0x48bb96?util[_0xe76c('0x7')](_0x48bb96,{'showHidden':![],'depth':null}):'');return _0x1ea908(null);});}return _0x1ea908(null);});};exports[_0xe76c('0x18')]=function(_0x1a000e){return new BPromise(function(_0x169fbf,_0x52b41a){if(_0x1a000e){return getUser({'interface':_0x1a000e})['then'](function(_0x1fc558){logger[_0xe76c('0x6')](_0xe76c('0x19'),_0x1a000e,_0x1fc558?_0xe76c('0x15'):_0xe76c('0x16'));return _0x169fbf(_0x1fc558);})[_0xe76c('0xb')](function(_0x1b85d8){logger[_0xe76c('0x9')](_0xe76c('0x1a'),_0x1b85d8?util[_0xe76c('0x7')](_0x1b85d8,{'showHidden':![],'depth':null}):'');return _0x169fbf(null);});}return _0x169fbf(null);});};exports[_0xe76c('0x1b')]=function(_0xe87142){return new BPromise(function(_0x40128f,_0x25558d){if(_0xe87142){return getUser({'name':_0xe87142})[_0xe76c('0x13')](function(_0x147dfe){logger['info'](_0xe76c('0x1c'),_0xe87142,_0x147dfe?_0xe76c('0x15'):_0xe76c('0x16'));return _0x40128f(_0x147dfe);})['catch'](function(_0x1cb32f){logger['error']('[utils][getUserByName]',_0x1cb32f?util['inspect'](_0x1cb32f,{'showHidden':![],'depth':null}):'');return _0x40128f(null);});}return _0x40128f(null);});};exports[_0xe76c('0x1d')]=function(_0x4ed006){return new BPromise(function(_0x130fe8,_0x29e1fa){if(_0x4ed006){return client[_0xe76c('0xa')](_0xe76c('0x1e'),{'options':{'raw':!![],'attributes':['id','name','type',_0xe76c('0x1f'),_0xe76c('0x20')],'where':{'name':_0x4ed006},'limit':0x1}})[_0xe76c('0x13')](function(_0x5ce18e){logger[_0xe76c('0x8')](_0xe76c('0x21'),_0x4ed006,_0x5ce18e?util[_0xe76c('0x7')](_0x5ce18e,{'showHidden':![],'depth':null}):'');logger[_0xe76c('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4ed006,_0x5ce18e?_0xe76c('0x15'):_0xe76c('0x16'));return _0x130fe8(_0x5ce18e[_0xe76c('0x12')][_0xe76c('0x11')]?_0x5ce18e['result'][0x0]:null);})['catch'](function(_0x500078){logger[_0xe76c('0x9')]('[utils][getVoiceQueueByName]',_0x500078?util[_0xe76c('0x7')](_0x500078,{'showHidden':![],'depth':null}):'');return _0x130fe8(null);});}return _0x130fe8(null);});};exports[_0xe76c('0x22')]=function(_0x93fe01,_0x15c384){return moment(_0x93fe01)['add'](_0x15c384,_0xe76c('0x23'))[_0xe76c('0x24')](_0xe76c('0x25'));};exports['subtractTime']=function(_0x52fdff,_0x25b9e4){return moment(_0x52fdff)['subtract'](_0x25b9e4,_0xe76c('0x23'))['format'](_0xe76c('0x25'));};exports[_0xe76c('0x26')]=function(_0x39b085,_0x5565a2){return moment(_0x39b085)[_0xe76c('0x27')](moment(_0x5565a2),_0xe76c('0x23'));};exports[_0xe76c('0x28')]=function(_0x38e5b1,_0x1986f4){return parseInt(_0x38e5b1,0xa)+parseInt(_0x1986f4,0xa);};exports[_0xe76c('0x29')]=function(){return moment()[_0xe76c('0x24')](_0xe76c('0x25'));};exports['isAfter']=function(_0x11b8c6,_0x1a270b){if(_0x1a270b){return moment(_0x11b8c6)['isAfter'](_0x1a270b);}return!![];};exports[_0xe76c('0x2a')]=function(_0x4a9b6e,_0x10b9f7){if(_0x10b9f7){return moment(_0x4a9b6e)[_0xe76c('0x2a')](_0x10b9f7);}else if(_0x4a9b6e){return!![];}return![];}; \ No newline at end of file +var _0xc1bc=['request','[utils][request]\x20name:%s','GetUser','internal','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','../../config/logger','xdr','info','inspect','debug','error'];(function(_0x426570,_0x5a2b47){var _0x48a7e5=function(_0x5dc442){while(--_0x5dc442){_0x426570['push'](_0x426570['shift']());}};_0x48a7e5(++_0x5a2b47);}(_0xc1bc,0x86));var _0xcc1b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc1bc[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0xcc1b('0x0'));var jayson=require(_0xcc1b('0x1'));var moment=require('moment');var util=require(_0xcc1b('0x2'));var client=jayson[_0xcc1b('0x3')]['http']({'port':0x2329});var logger=require(_0xcc1b('0x4'))(_0xcc1b('0x5'));exports[_0xcc1b('0x6')]=function(_0x1b069b,_0x1e65e4){logger['info'](_0x1b069b,_0x1e65e4?util[_0xcc1b('0x7')](_0x1e65e4,{'showHidden':![],'depth':null}):'');};exports[_0xcc1b('0x8')]=function(_0x4c1e75,_0x2ca0f2){logger[_0xcc1b('0x8')](_0x4c1e75,_0x2ca0f2?util[_0xcc1b('0x7')](_0x2ca0f2,{'showHidden':![],'depth':null}):'');};exports[_0xcc1b('0x9')]=function(_0x221250,_0x9394ad){logger[_0xcc1b('0x9')](_0x221250,_0x9394ad?util[_0xcc1b('0x7')](_0x9394ad,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x5f5c41,_0x28d374){return client[_0xcc1b('0xa')](_0x5f5c41,{'body':_0x28d374})['then'](function(_0x1a47b6){logger['debug'](_0xcc1b('0xb'),_0x5f5c41,_0x1a47b6?util['inspect'](_0x1a47b6,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x46e07d){logger[_0xcc1b('0x9')](_0xcc1b('0xb'),_0x5f5c41,_0x46e07d?util[_0xcc1b('0x7')](_0x46e07d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5c6246){return client[_0xcc1b('0xa')](_0xcc1b('0xc'),{'options':{'raw':!![],'attributes':['id',_0xcc1b('0xd'),'name',_0xcc1b('0xe')],'where':_0x5c6246,'limit':0x1}})[_0xcc1b('0xf')](function(_0x4abf2b){logger[_0xcc1b('0x8')](_0xcc1b('0x10'),JSON[_0xcc1b('0x11')](_0x5c6246),_0x4abf2b?util['inspect'](_0x4abf2b,{'showHidden':![],'depth':null}):'');return _0x4abf2b[_0xcc1b('0x12')][_0xcc1b('0x13')]?_0x4abf2b[_0xcc1b('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x4ac21b){return new BPromise(function(_0x364275,_0xa66eec){if(_0x4ac21b){return getUser({'internal':_0x4ac21b})[_0xcc1b('0xf')](function(_0x3f27bd){logger[_0xcc1b('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x4ac21b,_0x3f27bd?'found':_0xcc1b('0x14'));return _0x364275(_0x3f27bd);})[_0xcc1b('0x15')](function(_0x5543b){logger['error'](_0xcc1b('0x16'),_0x5543b?util[_0xcc1b('0x7')](_0x5543b,{'showHidden':![],'depth':null}):'');return _0x364275(null);});}return _0x364275(null);});};exports['getUserByInterface']=function(_0x1481b2){return new BPromise(function(_0x5894d5,_0x1165f1){if(_0x1481b2){return getUser({'interface':_0x1481b2})[_0xcc1b('0xf')](function(_0x47869b){logger[_0xcc1b('0x6')](_0xcc1b('0x17'),_0x1481b2,_0x47869b?_0xcc1b('0x18'):_0xcc1b('0x14'));return _0x5894d5(_0x47869b);})['catch'](function(_0x3070f6){logger[_0xcc1b('0x9')](_0xcc1b('0x19'),_0x3070f6?util[_0xcc1b('0x7')](_0x3070f6,{'showHidden':![],'depth':null}):'');return _0x5894d5(null);});}return _0x5894d5(null);});};exports[_0xcc1b('0x1a')]=function(_0x2acd14){return new BPromise(function(_0x343b2a,_0x4cd551){if(_0x2acd14){return getUser({'name':_0x2acd14})['then'](function(_0x9e7e5f){logger[_0xcc1b('0x6')](_0xcc1b('0x1b'),_0x2acd14,_0x9e7e5f?'found':_0xcc1b('0x14'));return _0x343b2a(_0x9e7e5f);})[_0xcc1b('0x15')](function(_0x2619e3){logger[_0xcc1b('0x9')](_0xcc1b('0x1c'),_0x2619e3?util[_0xcc1b('0x7')](_0x2619e3,{'showHidden':![],'depth':null}):'');return _0x343b2a(null);});}return _0x343b2a(null);});};exports['getVoiceQueueByName']=function(_0x298b8c){return new BPromise(function(_0x376c36,_0x287015){if(_0x298b8c){return client['request'](_0xcc1b('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xcc1b('0x1e'),_0xcc1b('0x1f'),_0xcc1b('0x20'),_0xcc1b('0x21')],'where':{'name':_0x298b8c},'limit':0x1}})['then'](function(_0x580f73){logger[_0xcc1b('0x8')](_0xcc1b('0x22'),_0x298b8c,_0x580f73?util[_0xcc1b('0x7')](_0x580f73,{'showHidden':![],'depth':null}):'');logger[_0xcc1b('0x6')](_0xcc1b('0x23'),_0x298b8c,_0x580f73?_0xcc1b('0x18'):_0xcc1b('0x14'));return _0x376c36(_0x580f73[_0xcc1b('0x12')][_0xcc1b('0x13')]?_0x580f73[_0xcc1b('0x12')][0x0]:null);})[_0xcc1b('0x15')](function(_0x1f765d){logger[_0xcc1b('0x9')](_0xcc1b('0x24'),_0x1f765d?util['inspect'](_0x1f765d,{'showHidden':![],'depth':null}):'');return _0x376c36(null);});}return _0x376c36(null);});};exports[_0xcc1b('0x25')]=function(_0x5eb303,_0x9ddee1){return moment(_0x5eb303)[_0xcc1b('0x26')](_0x9ddee1,_0xcc1b('0x27'))['format'](_0xcc1b('0x28'));};exports[_0xcc1b('0x29')]=function(_0x4dc112,_0x5f21fc){return moment(_0x4dc112)['subtract'](_0x5f21fc,_0xcc1b('0x27'))[_0xcc1b('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x3415e0,_0xbf50f9){return moment(_0x3415e0)[_0xcc1b('0x2b')](moment(_0xbf50f9),'seconds');};exports[_0xcc1b('0x2c')]=function(_0x484f5f,_0x3cd16c){return parseInt(_0x484f5f,0xa)+parseInt(_0x3cd16c,0xa);};exports[_0xcc1b('0x2d')]=function(){return moment()[_0xcc1b('0x2a')](_0xcc1b('0x28'));};exports[_0xcc1b('0x2e')]=function(_0x2f3d39,_0x5b67c9){if(_0x5b67c9){return moment(_0x2f3d39)[_0xcc1b('0x2e')](_0x5b67c9);}return!![];};exports['isBefore']=function(_0x5d3343,_0x55ac0a){if(_0x55ac0a){return moment(_0x5d3343)[_0xcc1b('0x2f')](_0x55ac0a);}else if(_0x5d3343){return!![];}return![];}; \ No newline at end of file -- 1.7.1